diff --git a/cfg/const.inc.php b/cfg/const.inc.php index 3673b97dd4..ccae4069b2 100644 --- a/cfg/const.inc.php +++ b/cfg/const.inc.php @@ -1,990 +1,1217 @@ -exec_cfg->expand_collapse - very important do not change values, logic depends on values*/ -define('LAST_USER_CHOICE',2); -define('COLLAPSE', 0); -define('EXPAND',1 ); - -// used in several functions instead of MAGIC NUMBERS - Don't change -define('ALL_PRODUCTS', 0); -define('TP_ALL_STATUS', null); -define('FILTER_BY_PRODUCT', 1); -define('FILTER_BY_TESTPROJECT', 1); -define('TP_STATUS_ACTIVE', 1); - -define('DO_LANG_GET',1 ); -define('DONT_DO_LANG_GET',0 ); - -define('LANG_GET_NO_WARNING',true); - -define('DSN', FALSE); // for method connect() of database.class -define('ANY_BUILD', null); -define('GET_NO_EXEC', 1); - -define('FILTER_OPTION_ANY', 0); - -/** @uses planTCNavigator.php */ -define('FILTER_BY_BUILD_OFF', 0); -define('FILTER_BY_OWNER_OFF', 0); -define('FILTER_BY_TC_STATUS_OFF', null); -define('FILTER_BY_KEYWORD_OFF', null); -define('FILTER_BY_ASSIGNED_TO_OFF', 0); -define('SEARCH_BY_CUSTOM_FIELDS_OFF', null); -define('COLOR_BY_TC_STATUS_OFF', null); -define('CREATE_TC_STATUS_COUNTERS_OFF', 0); - -// moved from testSetRemove.php -define('WRITE_BUTTON_ONLY_IF_LINKED', 1); - -// moved from tc_exec_assignment.php -define('FILTER_BY_TC_OFF', null); -define('FILTER_BY_EXECUTE_STATUS_OFF', null); -define('ALL_USERS_FILTER', null); -define('ADD_BLANK_OPTION', true); - -// -define('FILTER_BY_SHOW_ON_EXECUTION', 1); - -define('GET_ALSO_NOT_EXECUTED', null); -define('GET_ONLY_EXECUTED', 'executed'); - -// generateTestSpecTree() -define('FOR_PRINTING', 1); -define('NOT_FOR_PRINTING', 0); - -define('HIDE_TESTCASES', 1); -define('SHOW_TESTCASES', 0); -define('FILTER_INACTIVE_TESTCASES', 1); -define('DO_NOT_FILTER_INACTIVE_TESTCASES', 0); - -define('ACTION_TESTCASE_DISABLE', 0); -define('IGNORE_INACTIVE_TESTCASES', 1); -define('IGNORE_ACTIVE_TESTCASES', 2); - -define('DO_ON_TESTCASE_CLICK', 1); -define('NO_ADDITIONAL_ARGS', ''); -define('NO_KEYWORD_ID_TO_FILTER', 0); - - -define('RECURSIVE_MODE', TRUE); -define('NO_NODE_TYPE_TO_FILTER', null); -define('ANY_OWNER', null); - -define('ALL_BUILDS', 'a'); -define('ALL_PLATFORMS', 'a'); -define('ALL_TEST_SUITES', 'all'); - -/** @todo use consts ACTIVE || INACTIVE, OPEN || CLOSED*/ -define('GET_ACTIVE_BUILD', 1); -define('GET_INACTIVE_BUILD', 0); -define('GET_OPEN_BUILD', 1); -define('GET_CLOSED_BUILD', 0); - -define('AUTOMATIC_ID', 0); -define('NO_FILTER_SHOW_ON_EXEC', null); -define('DONT_REFRESH', 0); -define('DEFAULT_TC_ORDER', 0); - -// bug_interface->buildViewBugLink() -define('GET_BUG_SUMMARY', true); - -// gen_spec_view() -define('DO_PRUNE', 1); - -// executeTestCase() -define('AUTOMATION_RESULT_KO', -1); -define('AUTOMATION_NOTES_KO', -1); - -define('REMOVEME', 'd8ba8cfb-ca92-4fa5-83c2-551977d405fb'); - -/** Constants for plugins */ -/** Plugin configuration types */ -define('CONFIG_TYPE_STRING', 0); -define('CONFIG_TYPE_INT', 1); -define('CONFIG_TYPE_FLOAT', 2); -define('CONFIG_TYPE_COMPLEX', 3); - -/** To indicate the plugin configuration belongs to ANY PROJECT */ -define('TL_ANY_PROJECT', -1); - -/** Constants for events */ -define('EVENT_TYPE_CREATE', 1); -define('EVENT_TYPE_UPDATE', 2); -define('EVENT_TYPE_DELETE', 3); -define('EVENT_TYPE_OUTPUT', 4); - - - - -// --------------------------------------------------------------------------------- -/* [GUI] */ - -/** - * @uses planAddTC_m1-tpl - * - **/ -define('TL_STYLE_FOR_ADDED_TC', 'background-color:yellow;'); - -/** Browser Cookie keeptime */ -define('TL_COOKIE_KEEPTIME', (time()+60*60*24*30)); // 30 days - -// needed for drap and drop feature -define('TL_DRAG_DROP_DIR', 'gui/drag_and_drop/'); -define('TL_DRAG_DROP_JS_DIR', TL_DRAG_DROP_DIR. 'js/'); -define('TL_DRAG_DROP_FOLDER_CSS', TL_DRAG_DROP_DIR . 'css/drag-drop-folder-tree.css'); -define('TL_DRAG_DROP_CONTEXT_MENU_CSS', TL_DRAG_DROP_DIR . 'css/context-menu.css'); - -/** Mark up inactive objects (test projects, etc) in GUI lists */ -define('TL_INACTIVE_MARKUP', '* '); - -/** @var string Delimiter used when created a test suite path, concatenating test suite names */ -$g_testsuite_sep='/'; - -/** - * using niftycorners - * @TODO havlatm: move to smarty templates - configuration should not contain HTML elements - **/ -define('MENU_ITEM_OPEN', '
'); - -/** - * Used to force the max len of this field, during the automatic creation of requirements - * or other import features - */ -$g_field_size = new stdClass(); -$g_field_size->node_name = 100; -$g_field_size->testsuite_name = 100; -$g_field_size->testcase_name = 100; -$g_field_size->testproject_name = 100; - -// requirements and req_spec tables field sizes -$g_field_size->req_docid = 64; -$g_field_size->req_title = 100; -$g_field_size->requirement_title = 100; -$g_field_size->docid = 64; - -// execution table -$g_field_size->bug_id = 16; - - -// -------------------------------------------------------------------------------------- -/* [LOCALIZATION] */ - -/** - * String that will used as prefix, to generate an string when a label to be localized - * is passed to lang_get() to be translated, by the label is not present in the strings file. - * The resulting string will be: TL_LOCALIZE_TAG . label - * @example code specifies the key of string: lang_get('hello') -> shows "LOCALIZE: Hello" - */ -define('TL_LOCALIZE_TAG','LOCALIZE: '); - -/** @var string Default format of date */ -$tlCfg->date_format ='%d/%m/%Y'; - -/** @var string Default format of datetime */ -$tlCfg->timestamp_format = '%d/%m/%Y %H:%M:%S'; - - -/** - * @var array List of supported localizations (used in user preferences to choose one) - * DEV: Please Maintain the alphabetical order when adding new locales. - * Also check inc.ext_js_tpl to set localization for ExtJS Components. - **/ -$tlCfg->locales = array('cs_CZ' => 'Czech','de_DE' => 'German','en_GB' => 'English (wide/UK)', - 'en_US' => 'English (US)','es_AR' => 'Spanish (Argentine)', - 'es_ES' => 'Spanish','fi_FI' => 'Finnish','fr_FR' => 'Français', - 'id_ID' => 'Indonesian','it_IT' => 'Italian','ja_JP' => 'Japanese', - 'ko_KR' => 'Korean','nl_NL' => 'Dutch','pl_PL' => 'Polski', - 'pt_BR' => 'Portuguese (Brazil)','pt_PT' => 'Portuguese', - 'ru_RU' => 'Russian','zh_CN' => 'Chinese Simplified'); - -/** - * Format of date - see strftime() in PHP manual - * NOTE: setting according local is done in testlinkInitPage() using setDateTimeFormats() - */ -/** @var array Localized format of date */ -$tlCfg->locales_date_format = array('cs_CZ' => '%d.%m.%Y','de_DE' => '%d.%m.%Y','en_GB' => '%d/%m/%Y', - 'en_US' => '%m/%d/%Y','es_AR' => '%d/%m/%Y','es_ES' => '%d/%m/%Y', - 'fi_FI' => '%d/%m/%Y','fr_FR' => '%d/%m/%Y','id_ID' => '%d/%m/%Y', - 'it_IT' => '%d/%m/%Y','ja_JP' => '%Y/%m/%d','ko_KR' => '%Y/%m/%d', - 'nl_NL' => '%d-%m-%Y','pl_PL' => '%d.%m.%Y','pt_BR' => '%d/%m/%Y', - 'pt_PT' => '%d/%m/%Y','ru_RU' => '%d.%m.%Y','zh_CN' => '%Y-%m-%d'); - -/** @var array Localized format of full timestamp */ -$tlCfg->locales_timestamp_format = array('cs_CZ' => '%d.%m.%Y %H:%M:%S','de_DE' => '%d.%m.%Y %H:%M:%S', - 'en_GB' => '%d/%m/%Y %H:%M:%S','en_US' => '%m/%d/%Y %H:%M:%S', - 'es_AR' => '%d/%m/%Y %H:%M:%S','es_ES' => '%d/%m/%Y %H:%M:%S', - 'fi_FI' => '%d/%m/%Y %H:%M:%S','fr_FR' => '%d/%m/%Y %H:%M:%S', - 'id_ID' => '%d/%m/%Y %H:%M:%S','it_IT' => '%d/%m/%Y %H:%M:%S', - 'ja_JP' => '%Y/%m/%d %H:%M:%S','ko_KR' => '%Y/%m/%d %H:%M:%S', - 'nl_NL' => '%d-%m-%Y %H:%M:%S','pl_PL' => '%d.%m.%Y %H:%M:%S', - 'pt_BR' => '%d/%m/%Y %H:%M:%S','pt_PT' => '%d/%m/%Y %H:%M:%S', - 'ru_RU' => '%d.%m.%Y %H:%M:%S','zh_CN' => '%Y-%m-%d %H:%M:%S'); - -/** @var array localized date format for smarty templates (html_select_date function) - * deprecated since use of datepicker */ -$tlCfg->locales_html_select_date_field_order = array('cs_CZ' => 'dmY','de_DE' => 'dmY','en_GB' => 'dmY', - 'en_US' => 'mdY','es_AR' => 'dmY','es_ES' => 'dmY','fi_FI' => 'dmY', - 'fr_FR' => 'dmY','id_ID' => 'dmY','it_IT' => 'dmY','ja_JP' => 'Ymd', - 'ko_KR' => 'Ymd','nl_NL' => 'dmY','pl_PL' => 'dmY','pt_BR' => 'dmY', - 'pt_PT' => 'dmY','ru_RU' => 'dmY','zh_CN' => 'Ymd'); - - - -// -------------------------------------------------------------------------------------- -/* ATTACHMENTS */ - -/** Attachment key constants (do not change) */ -define('TL_REPOSITORY_TYPE_DB', 1); -define('TL_REPOSITORY_TYPE_FS', 2); - -define('TL_REPOSITORY_COMPRESSIONTYPE_NONE', 1); -define('TL_REPOSITORY_COMPRESSIONTYPE_GZIP', 2); - - -// Two models to manage attachment interface in the execution screen -// $att_model_m1 -> shows upload button and title -// -$att_model_m1 = new stdClass(); -$att_model_m2 = new stdClass(); - -$att_model_m1->show_upload_btn = true; -$att_model_m1->show_title = true; -$att_model_m1->num_cols = 4; -$att_model_m1->show_upload_column = false; - -// $att_model_m2 -> hides upload button and title -// -$att_model_m2->show_upload_btn = false; -$att_model_m2->show_title = false; -$att_model_m2->num_cols = 5; -$att_model_m2->show_upload_column = true; - - -// -------------------------------------------------------------------------------------- -/* [Test execution] */ -/** - * Note: do not change existing values (you can enhance arrays of course more into custom_config) - * If you add new statuses, please use custom_strings.txt to add your localized strings - */ - -/** User can define own test status(es) by modifying - * - $tlCfg->results['status_code'] (in custom_config.inc.php) - * - $tlCfg->results['status_label'] (in custom_config.inc.php) - * - $tlCfg->results['status_label_for_exec_ui'] (in custom_config.inc.php) - * - $tlCfg->results['charts']['status_colour'] (in custom_config.inc.php) - * - /locale//custom_strings.txt - * - /gui/themes/default/css/custom.css - * - * DO NOT define Custom test status(es) in this file - use custom_config.inc.php - */ - -/** - * @var array List of Test Case execution results (status_key -> DB code). - * The code is used in DB to store results (not GUI). - * Do not do localisation here, i.e do not change "passed" by your national language. - */ -$tlCfg->results['status_code'] = array('failed' => 'f','blocked' => 'b', - 'passed' => 'p','not_run' => 'n', - 'not_available' => 'x','unknown' => 'u', - 'all' => 'a'); - -/* for some reports */ -$tlCfg->results['status_order'] = array('not_run' => 'n', - 'passed' => 'p', - 'failed' => 'f', - 'blocked' => 'b'); - -/** - * Used to get localized string to show to users - * Order is important, because this will be display order on GUI - * - * @var array key: status ID - * value: id to use with lang_get() to get the string, from strings.txt (or custom_strings.txt) - * - * @example use the next code to get localized string of a status - * - * $results_cfg = config_get('results'); - * lang_get($results_cfg['status_label']["passed"]); - * - */ -$tlCfg->results['status_label'] = array('not_run' => 'test_status_not_run', - 'passed' => 'test_status_passed', - 'failed' => 'test_status_failed', - 'blocked'=> 'test_status_blocked', - 'all' => 'test_status_all_status', - 'not_available' => 'test_status_not_available', - 'unknown' => 'test_status_unknown'); - -// Is RIGHT to have this configuration DIFFERENT from $tlCfg->results['status_label'], -// because you must choose to not allow some of previous status be available -// on execution page. -// See this as a subset of $tlCfg->results['status_label'] -// -// Used to generate radio and buttons at user interface level. -// -// IMPORTANT NOTE ABOUT ORDER: -// Order is important, because this will be display order on User Interface -// And will be used on every feature that will need to do ordering -// according Test Case Execution Status. -// -// -// key => verbose status as defined in $tlCfg->results['status_code'] -// value => string id defined in the strings.txt file, -// used to localize the strings. -// -$tlCfg->results['status_label_for_exec_ui'] = array('not_run' => 'test_status_not_run', - 'passed' => 'test_status_passed', - 'failed' => 'test_status_failed', - 'blocked' => 'test_status_blocked'); - - -$tlCfg->results['status_icons_for_exec_ui'] = - array('passed' => array('img' => 'test_status_passed', - 'title' => 'click_passed'), - 'failed' => array('img' => 'test_status_failed', - 'title' => 'click_failed'), - 'blocked' => array('img' => 'test_status_blocked', - 'title' => 'click_blocked')); - -$tlCfg->results['status_icons_for_exec_next_ui'] = - array('passed' => array('img' => 'test_status_passed_next', - 'title' => 'click_passed_next'), - 'failed' => array('img' => 'test_status_failed_next', - 'title' => 'click_failed_next'), - 'blocked' => array('img' => 'test_status_blocked_next', - 'title' => 'click_blocked_next')); - - -$tlCfg->results['execStatusToExclude'] = array(); -$tlCfg->results['execStatusToExclude']['testcase'] = - array($tlCfg->results['status_code']['all']); - -$tlCfg->results['execStatusToExclude']['step'] = - array($tlCfg->results['status_code']['all']); - - -/** - * Selected execution result by default. Values is key from $tlCfg->results['status_label'] - * @var string - **/ -$tlCfg->results['default_status'] = 'not_run'; - -/** - * Status colours for charts - use just RGB (not colour names) - * Colours should be compiant with definition in CSS - **/ -$tlCfg->results['charts']['status_colour'] = array('not_run' => '000000','passed' => '006400', - 'failed' => 'B22222','blocked' => '00008B'); - -/* - * arrays for new filter types (BUGID 2455, BUGID 3026) - * used for testcase execution - */ -$tlCfg->execution_filter_methods['status_code'] = array('latest_execution' => 1, - 'all_builds' => 2, - 'any_build' => 3, - 'specific_build' => 4, - 'current_build' => 5); - -$tlCfg->execution_filter_methods['status_label'] = array('latest_execution' => 'filter_result_latest_execution', - 'all_builds' => 'filter_result_all_builds', - 'any_build' => 'filter_result_any_build', - 'specific_build' => 'filter_result_specific_build', - 'current_build' => 'filter_result_current_build'); - -$tlCfg->execution_filter_methods['default_type'] = $tlCfg->execution_filter_methods['status_code']['current_build']; - -/* - * same as above, but without current build - * these are used for testcase execution assignment - */ -$tlCfg->execution_assignment_filter_methods['status_code'] = array('latest_execution' => 1, - 'all_builds' => 2, - 'any_build' => 3, - 'specific_build' => 4); - -$tlCfg->execution_assignment_filter_methods['status_label'] = array('latest_execution' => 'filter_result_latest_execution', - 'all_builds' => 'filter_result_all_builds', - 'any_build' => 'filter_result_any_build', - 'specific_build' => 'filter_result_specific_build'); - -// CRITIC NOTICE -// This values has to have certain coerence with -// $js_key_to_select on init_filter_result() in tlTestCaseFilterControl.class.php -// -$tlCfg->execution_assignment_filter_methods['default_type'] = - $tlCfg->execution_assignment_filter_methods['status_code']['specific_build']; - - - -// -------------------------------------------------------------------------------------- -/* [Users & Roles] */ - -define('TL_USER_NOBODY', -1); -define('TL_USER_SOMEBODY', -2); //new user for new filtertypes in 2455 & 3026 -define('TL_NO_USER', TL_USER_NOBODY); -define('TL_USER_ANYBODY', 0); - -/** Follows CODES present in roles table - DO NOT CHANGE ON ANY CIRCUNSTANCE */ -define('TL_ROLES_MANAGER', 1); -define('TL_ROLES_ADMIN', 8); -define('TL_ROLES_LEADER', 9); -define('TL_ROLES_TESTER', 7); -define('TL_ROLES_GUEST', 5); -define('TL_ROLES_NO_RIGHTS', 3); -define('TL_ROLES_UNDEFINED', 0); -define('TL_ROLES_INHERITED', 0); - -// Roles with id > to this role can be deleted from user interface -define('TL_LAST_SYSTEM_ROLE', 9); - - -// used on user management page to give different colour -// to different roles. -// If you don't want use colouring then configure in this way -// $g_role_colour = array ( ); -$g_role_colour = array ( - 'admin' => 'white', - 'tester' => 'wheat', - 'leader' => 'acqua', - 'senior tester' => '#FFA', - 'guest' => 'pink', - 'test designer' => 'cyan', - '' => 'grey', - '' => 'seashell'); - - -// -------------------------------------------------------------------------------------- -/** LDAP authentication errors */ -define( 'ERROR_LDAP_AUTH_FAILED',1400); -define( 'ERROR_LDAP_SERVER_CONNECT_FAILED',1401); -define( 'ERROR_LDAP_UPDATE_FAILED',1402 ); -define( 'ERROR_LDAP_USER_NOT_FOUND',1403); -define( 'ERROR_LDAP_BIND_FAILED',1404); -define( 'ERROR_LDAP_START_TLS_FAILED',1405); - -// -------------------------------------------------------------------------------------- -/* [Priority, Urgency, Importance] */ - -/** @var array importance levels */ -$tlCfg->importance_levels = array(HIGH => 3,MEDIUM => 2,LOW => 1); -$tlCfg->importance['code_label'] = array(HIGH => 'high',MEDIUM => 'medium',LOW => 'low'); - - -/** @var integer Default Test case Importance offered in GUI */ -$tlCfg->testcase_importance_default = MEDIUM; - -/** @var integer Default Test case Urgency offered in GUI */ -$tlCfg->testcase_urgency_default = MEDIUM; - -/** - * @var array Used to get localized string to show to users - * key: numeric code - * value: id to use with lang_get() to get the string, from strings.txt (or custom_strings.txt) - * @since 1.8 - */ -$tlCfg->urgency['code_label'] = array(HIGH => 'urgency_high',MEDIUM => 'urgency_medium',LOW => 'urgency_low'); - - -/* priority is calculated using importance and urgency */ -$tlCfg->priority['code_label'] = array(HIGH => 'high_priority',MEDIUM => 'medium_priority',LOW => 'low_priority'); - -// -------------------------------------------------------------------------------------- -/* [States & Review] */ - - -define('TL_REL_TYPE_PARENT_CHILD', 1); -define('TL_REL_TYPE_BLOCKS_DEPENDS', 2); -define('TL_REL_TYPE_RELATED', 3); -define('TL_REL_TYPE_AUTOMATION_PARENT_CHILD', 4); -define('TL_REL_TYPE_EXECUTE_TOGETHER',5); - - - -/** - * data status constants are applicable for data like requirement, test case, Test Plan - * @since 2.0 - */ -/** Review status: design phase; data are not available for review or using */ -define('TL_REVIEW_STATUS_DRAFT', 1); - -/** Review status: data was reviewed and are available for using */ -define('TL_REVIEW_STATUS_FINAL', 2); - -/** Review status: data wait for review */ -define('TL_REVIEW_STATUS_REVIEW', 3); - -/** Review status: data are not applicable for using (not listed in reports and lists) */ -define('TL_REVIEW_STATUS_OBSOLETE', 4); -define('TL_REVIEW_STATUS_FUTURE', 5); - -/** - * @var array localization identifiers for review states - * @since 2.0 - **/ -$tlCfg->text_status_labels = array( - TL_REVIEW_STATUS_DRAFT => 'review_status_draft', - TL_REVIEW_STATUS_FINAL => 'review_status_final', - TL_REVIEW_STATUS_REVIEW => 'review_status_review', - TL_REVIEW_STATUS_OBSOLETE => 'review_status_obsolete', - TL_REVIEW_STATUS_FUTURE => 'review_status_future'); - -/** - * - **/ -define('TL_REQ_STATUS_VALID', 'V'); -define('TL_REQ_STATUS_NOT_TESTABLE','N'); -define('TL_REQ_STATUS_DRAFT','D'); -define('TL_REQ_STATUS_REVIEW','R'); -define('TL_REQ_STATUS_REWORK','W'); -define('TL_REQ_STATUS_FINISH','F'); -define('TL_REQ_STATUS_IMPLEMENTED','I'); -define('TL_REQ_STATUS_OBSOLETE','O'); - -// key: status; value: text label -$tlCfg->req_cfg = new stdClass(); -$tlCfg->req_cfg->status_labels = array(TL_REQ_STATUS_DRAFT => 'req_status_draft', - TL_REQ_STATUS_REVIEW => 'req_status_review', - TL_REQ_STATUS_REWORK => 'req_status_rework', - TL_REQ_STATUS_FINISH => 'req_status_finish', - TL_REQ_STATUS_IMPLEMENTED => 'req_status_implemented', - TL_REQ_STATUS_VALID => 'review_status_valid', - TL_REQ_STATUS_NOT_TESTABLE => 'req_status_not_testable', - TL_REQ_STATUS_OBSOLETE => 'req_status_obsolete'); - -/** - * Types of requirements (with respect to standards) - *
    - *
  • Info -informational character, project and user documentation. - * The type is not testable = not used for testing logic (except metrics).
  • - *
  • Feature - valid and testable functional definition (default selection)
  • - *
  • Use case
  • - *
  • Interface - user interface, communication protocols
  • - *
  • Non-functional - performance, infrastructure, robustness, security, safety, etc.
  • - *
  • Constrain - Constraints and Limitations
  • - *
- * - * CRITIC: DO NOT REMOVE ANY OF THIS CONSTANTS, BECAUSE TL EXPECT THIS TO BE DEFINED - * - * @since TestLink 1.9 - * - * IMPORTANT NOTICE: this value will be written on DB on field of type CHAR(1) - **/ -define('TL_REQ_TYPE_INFO', '1'); -define('TL_REQ_TYPE_FEATURE','2'); -define('TL_REQ_TYPE_USE_CASE','3'); -define('TL_REQ_TYPE_INTERFACE','4'); -define('TL_REQ_TYPE_NON_FUNCTIONAL','5'); -define('TL_REQ_TYPE_CONSTRAIN','6'); -define('TL_REQ_TYPE_SYSTEM_FUNCTION','7'); - - -/** - * @var array localization identifiers for requirements types - * @since TestLink 1.9 - **/ -$tlCfg->req_cfg->type_labels = array( - TL_REQ_TYPE_INFO => 'req_type_info', - TL_REQ_TYPE_FEATURE => 'req_type_feature', - TL_REQ_TYPE_USE_CASE => 'req_type_use_case', - TL_REQ_TYPE_INTERFACE => 'req_type_interface', - TL_REQ_TYPE_NON_FUNCTIONAL => 'req_type_non_functional', - TL_REQ_TYPE_CONSTRAIN => 'req_type_constrain', - TL_REQ_TYPE_SYSTEM_FUNCTION => 'req_type_system_function'); - - - -/** - * All possible types of requirement relations (BUGID 1748). - * - * Important: - * When you add your own relation types here, you also have to add localization strings - * and configure those below. - * - * Add you types ONLY AFTER LAST RESERVED - * - * @since TestLink 1.9 - * - * IMPORTANT NOTICE this will be written on DB on an INT field - **/ -define('TL_REQ_REL_TYPE_PARENT_CHILD', 1); -define('TL_REQ_REL_TYPE_BLOCKS_DEPENDS', 2); -define('TL_REQ_REL_TYPE_RELATED', 3); -define('TL_REQ_REL_TYPE_RESERVED_1', 4); -define('TL_REQ_REL_TYPE_RESERVED_2', 5); -define('TL_REQ_REL_TYPE_RESERVED_3', 6); -define('TL_REQ_REL_TYPE_RESERVED_4', 7); -define('TL_REQ_REL_TYPE_RESERVED_5', 8); -define('TL_REQ_REL_TYPE_RESERVED_6', 9); - - - -/** - * Localization identifiers for requirement relation types (BUGID 1748). - * Types, which are configured above, have to be configured - * here too with attributes "source" and "destination". - * - * Last value will be selected in GUI as default. - * - * Form has to be like this: - * - * $tlCfg->req_cfg->rel_type_labels = array( - * RELATIONNAME => array( - * 'source' => 'SOURCE_LOCALIZATION_KEY', - * 'destination' => 'DESTINATION_LOCALIZATION_KEY'), - * ... - * - * @since TestLink 1.9 - **/ -$tlCfg->req_cfg->rel_type_labels = array( - TL_REQ_REL_TYPE_PARENT_CHILD => array( - 'source' => 'req_rel_is_parent_of', - 'destination' => 'req_rel_is_child_of'), - TL_REQ_REL_TYPE_BLOCKS_DEPENDS => array( - 'source' => 'req_rel_blocks', - 'destination' => 'req_rel_depends'), - TL_REQ_REL_TYPE_RELATED => array( // this is a flat relation, so strings are identical - 'source' => 'req_rel_is_related_to', - 'destination' => 'req_rel_is_related_to') - ); - - - -$tlCfg->req_cfg->rel_type_description = array(TL_REQ_REL_TYPE_PARENT_CHILD => 'parent_child', - TL_REQ_REL_TYPE_BLOCKS_DEPENDS => 'blocks_depends', - TL_REQ_REL_TYPE_RELATED => 'related_to'); - - -/** - * @var array controls is expected_coverage must be requested at user interface. - * following conditions (OR LOGIC) must be verified to request value: - * - * a. key is NOT PRESENT (!isset()) - * b. key is present with value TRUE - * - * Working in this way configuration is simplified. - * - * @since TestLink 1.9 - **/ -$tlCfg->req_cfg->type_expected_coverage = array(TL_REQ_TYPE_INFO => false); - - - -// IMPORTANT NOTICE: this value will be written on DB on field of type CHAR(1) -define('TL_REQ_SPEC_TYPE_SECTION', '1'); -define('TL_REQ_SPEC_TYPE_USER_REQ_SPEC', '2'); -define('TL_REQ_SPEC_TYPE_SYSTEM_REQ_SPEC', '3'); - - -// define('TL_REQ_SPEC_TYPE_FUNCTIONAL_AND_DATA', 1); -// define('TL_REQ_SPEC_TYPE_LOOK_AND_FEEL',2); -// define('TL_REQ_SPEC_TYPE_USABILITY_AND_HUMANITY',3); -// define('TL_REQ_SPEC_TYPE_PERFORMANCE',4); -// define('TL_REQ_SPEC_TYPE_OPERATIONAL_AND_ENVIRONMENTAL',5); -// define('TL_REQ_SPEC_TYPE_MAINTAINABILITY_AND_SUPPORT',6); -// define('TL_REQ_SPEC_TYPE_SECURITY',7); -// define('TL_REQ_SPEC_TYPE_CULTURAL_AND_POLITICAL',8); -// define('TL_REQ_SPEC_TYPE_LEGAL',9); - -$tlCfg->req_spec_cfg = new stdClass(); -$tlCfg->req_spec_cfg->type_labels = array( - TL_REQ_SPEC_TYPE_SECTION => 'req_spec_type_section', - TL_REQ_SPEC_TYPE_USER_REQ_SPEC => 'req_spec_type_user_req_spec', - TL_REQ_SPEC_TYPE_SYSTEM_REQ_SPEC => 'req_spec_type_system_req_spec'); - - -/** - * @deprecated 1.9 - * @todo havlatm: replace by $tlCfg->req_cfg->type_labels - **/ -define('TL_REQ_TYPE_1', 'V'); -define('TL_REQ_TYPE_2', 'N'); -define('NON_TESTABLE_REQ', 'n'); -define('VALID_REQ', 'v'); - - -// -------------------------------------------------------------------------------------- -/* [CUSTOM FIELDS] */ - -// /** -// * Custom field constrains for HTML inputs use values to created to get/show custom field contents -// *
    -// *
  • for string,numeric,float,email: size & maxlenght of the input type text.
  • -// *
  • for list,email size of the select input.
  • -// *
-// */ -// $tlCfg->gui->custom_fields->sizes = array( -// 'string' => 50, -// 'numeric'=> 10, -// 'float' => 10, -// 'email' => 50, -// 'list' => 1, -// 'multiselection list' => 5, -// 'text area' => array('cols' => 40, 'rows' => 6) -// ); - - - -// 20080815 - franciscom -// Use this variable (on custom_config.inc.php) to define new Custom Field types. -// IMPORTANT: -// check $custom_field_types property on cfield_mgr.class.php -// to avoid overwrite of standard types. -// -// $tlCfg->gui->custom_fields->types = null; - -// Use this variable (on custom_config.inc.php) -// to define possible values behaviour for new Custom Field types. -// -// IMPORTANT: -// check $possible_values_cfg property on cfield_mgr.class.php -// to avoid overwrite of standard values. -// -// $tlCfg->gui->custom_fields->possible_values_cfg = null; - -// Format string follows date() spec - see PHP Manual -// We can not use $g_timestamp_format, because format strings for date() and strftime() -// uses same LETTER with different meanings (Bad Luck!) -$tlCfg->gui = new stdClass(); -$tlCfg->gui->custom_fields = new stdClass(); -$tlCfg->gui->custom_fields->time_format = 'H:i:s'; - - -// -------------------------------------------------------------------------------------- -/* [MISC] */ - -/** - * Review types - user can define type for his review comment (disabled by default) - * @since TestLink version 2.0 - **/ -$tlCfg->review_types = array(1 => 'undefined',2 => 'typo',3 => 'recommendation', - 4 => 'question',5 => 'unclear',6 => 'major problem'); - -/** - * Top Menu definition - * - * structure - * - label: label to display, will be localized - * - url: resource to access when users click on menu item - * - right: user right need to display menu item. (can be an array) - * null => no right check needed - * - condition: specific condition = ['','TestPlanAvailable','ReqMgmtEnabled'] - * - shortcut: keyboard HTML shortcut - * - target: window/frame name (mainframe in the most of cases) - * - imgKey - * - * @since TestLink version 1.9 - */ -$tlCfg->guiTopMenu[1] = array('label' => 'home','url' => 'index.php','right' => null, - 'imgKey' => 'home', - 'condition'=>'','shortcut'=>'h','target'=>'_parent'); - -$tlCfg->guiTopMenu[2] = array('label' => 'title_requirements', - 'imgKey' => 'requirements', - 'url' => 'lib/general/frmWorkArea.php?feature=reqSpecMgmt', - 'right' => array('mgt_view_req','mgt_modify_req'), - 'condition'=>'ReqMgmtEnabled', - 'shortcut'=>'r','target'=>'mainframe'); - -$tlCfg->guiTopMenu[3] = array('label' => 'title_specification', - 'imgKey' => 'test_specification', - 'url' => 'lib/general/frmWorkArea.php?feature=editTc', - 'right' => array('mgt_view_tc','mgt_modify_tc'), - 'condition'=>'', - 'shortcut'=>'t','target'=>'mainframe'); - -$tlCfg->guiTopMenu[4] = array('label' => 'title_execute', - 'imgKey' => 'execution', - 'url' => 'lib/general/frmWorkArea.php?feature=executeTest', - 'right' => array('testplan_execute','exec_ro_access'), - 'condition'=>'TestPlanAvailable', - 'shortcut'=>'e','target'=>'mainframe'); - -$tlCfg->guiTopMenu[5] = array('label' => 'title_results', - 'imgKey' => 'report', - 'url' => 'lib/general/frmWorkArea.php?feature=showMetrics', - 'right' => 'testplan_metrics','condition'=>'TestPlanAvailable', - 'shortcut'=>'r','target'=>'mainframe'); - -$tlCfg->guiTopMenu[6] = array('label' => 'title_admin', - 'imgKey' => 'user', - 'url' => 'lib/usermanagement/usersView.php', - 'right' => 'mgt_users','condition'=>'', - 'shortcut'=>'u','target'=>'mainframe'); - -$tlCfg->guiTopMenu[7] = array('label' => 'title_events', - 'imgKey' => 'events', - 'url' => 'lib/events/eventviewer.php', - 'right' => array('events_mgt', 'mgt_view_events'),'condition'=>'', - 'shortcut'=>'v','target'=>'mainframe'); -$tlCfg->guiTopMenu[8] = array('label' => 'title_plugins', - 'imgKey' => 'plugins', - 'url' => 'lib/plugins/pluginView.php', - 'right' => array('mgt_plugins'),'condition'=>'', - 'shortcut'=>'p','target'=>'mainframe'); - - -define( 'PARTIAL_URL_TL_FILE_FORMATS_DOCUMENT', 'docs/tl-file-formats.pdf'); - - -// Configure Charts dimension -$tlCfg->results['charts']['dimensions'] = - array('topLevelSuitesBarChart' => array('chartTitle' => 'results_top_level_suites', - 'XSize' => 900,'YSize' => 400,'beginX' => 40, 'beginY' => 100, - 'legendXAngle' => 35 ), - 'keywordBarChart' => array('chartTitle' => 'results_by_keyword', - 'XSize' => 900,'YSize' => 400,'beginX' => 40, 'beginY' => 100, - 'legendXAngle' => 25 ), - 'ownerBarChart' => array('chartTitle' => 'results_by_tester', - 'XSize' => 900,'YSize' => 400,'beginX' => 40, 'beginY' => 100, - 'legendXAngle' => 35 ), - 'overallPieChart' => array('chartTitle' => 'results_by_tester', - 'XSize' => 400,'YSize' => 400,'radius' => 150, 'legendX' => 10, 'legendY' => 15 ), - 'platformPieChart' => array('chartTitle' => 'results_by_tester', - 'XSize' => 400,'YSize' => 400,'radius' => 150, 'legendX' => 10, 'legendY' => 15 ) - ); - -// if you need to define new one, start on 20 please. -// see strings.txt for labels -// $TLS_testCaseStatus_KEY => $TLS_testCaseStatus_draft -// -$tlCfg->testCaseStatus = array( 'draft' => 1, - 'readyForReview' => 2, - 'reviewInProgress' => 3, - 'rework' => 4, - 'obsolete' => 5, - 'future' => 6, - 'final' => 7 ); - - -// see strings.txt for labels -// $TLS_testCaseStatus_hint_KEY => $TLS_testCaseStatus_hint_draft -// -$tlCfg->testCaseStatusDisplayHintOnTestDesign = ['draft' => '' /* 'testCaseStatus_hint_draft' */, - 'readyForReview' => '', - 'reviewInProgress' => '', - 'rework' => '', - 'obsolete' => 'testCaseStatus_hint_obsolete', - 'future' => '', - 'final' => '' ]; -// ----------------------------------------------------------------------------------------- - - -/** @uses testcase.class.php */ -// if you need to define new one, start on 20 please. -// see strings.txt for labels -// $TLS_execution_type_KEY => $TLS_execution_type_manual -$tlCfg->execution_type = array( 'manual' => 1, 'auto' => 2); - -// To be removed -define('TESTCASE_EXECUTION_TYPE_MANUAL', $tlCfg->execution_type['manual']); -define('TESTCASE_EXECUTION_TYPE_AUTO', $tlCfg->execution_type['auto']); - -// for link_status field on req_coverage table -define('LINK_TC_REQ_OPEN', 1); -define('LINK_TC_REQ_CLOSED_BY_EXEC', 2); -define('LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION', 3); -define('LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION', 4); - -// for link_status field on testcase_relations table -define('LINK_TC_RELATION_OPEN', 1); -define('LINK_TC_RELATION_CLOSED_BY_EXEC', 2); -define('LINK_TC_RELATION_CLOSED_BY_NEW_TCVERSION', 3); - - -define('USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', 1); -define('USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS',2); -define('USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS',3); - - -// END +exec_cfg->expand_collapse + * very important do not change values, logic depends on values + */ +define('LAST_USER_CHOICE', 2); +define('COLLAPSE', 0); +define('EXPAND', 1); + +// used in several functions instead of MAGIC NUMBERS - Don't change +define('ALL_PRODUCTS', 0); +define('TP_ALL_STATUS', null); +define('FILTER_BY_PRODUCT', 1); +define('FILTER_BY_TESTPROJECT', 1); +define('TP_STATUS_ACTIVE', 1); + +define('DO_LANG_GET', 1); +define('DONT_DO_LANG_GET', 0); + +define('LANG_GET_NO_WARNING', true); + +define('DSN', false); // for method connect() of database.class +define('ANY_BUILD', null); +define('GET_NO_EXEC', 1); + +define('FILTER_OPTION_ANY', 0); + +/** + * + * @uses planTCNavigator.php + */ +define('FILTER_BY_BUILD_OFF', 0); +define('FILTER_BY_OWNER_OFF', 0); +define('FILTER_BY_TC_STATUS_OFF', null); +define('FILTER_BY_KEYWORD_OFF', null); +define('FILTER_BY_ASSIGNED_TO_OFF', 0); +define('SEARCH_BY_CUSTOM_FIELDS_OFF', null); +define('COLOR_BY_TC_STATUS_OFF', null); +define('CREATE_TC_STATUS_COUNTERS_OFF', 0); + +// moved from testSetRemove.php +define('WRITE_BUTTON_ONLY_IF_LINKED', 1); + +// moved from tc_exec_assignment.php +define('FILTER_BY_TC_OFF', null); +define('FILTER_BY_EXECUTE_STATUS_OFF', null); +define('ALL_USERS_FILTER', null); +define('ADD_BLANK_OPTION', true); + +// +define('FILTER_BY_SHOW_ON_EXECUTION', 1); + +define('GET_ALSO_NOT_EXECUTED', null); +define('GET_ONLY_EXECUTED', 'executed'); + +// generateTestSpecTree() +define('FOR_PRINTING', 1); +define('NOT_FOR_PRINTING', 0); + +define('HIDE_TESTCASES', 1); +define('SHOW_TESTCASES', 0); +define('FILTER_INACTIVE_TESTCASES', 1); +define('DO_NOT_FILTER_INACTIVE_TESTCASES', 0); + +define('ACTION_TESTCASE_DISABLE', 0); +define('IGNORE_INACTIVE_TESTCASES', 1); +define('IGNORE_ACTIVE_TESTCASES', 2); + +define('DO_ON_TESTCASE_CLICK', 1); +define('NO_ADDITIONAL_ARGS', ''); +define('NO_KEYWORD_ID_TO_FILTER', 0); + +define('RECURSIVE_MODE', true); +define('NO_NODE_TYPE_TO_FILTER', null); +define('ANY_OWNER', null); + +define('ALL_BUILDS', 'a'); +define('ALL_PLATFORMS', 'a'); +define('ALL_TEST_SUITES', 'all'); + +/** + * + * @todo use consts ACTIVE || INACTIVE, OPEN || CLOSED + */ +define('GET_ACTIVE_BUILD', 1); +define('GET_INACTIVE_BUILD', 0); +define('GET_OPEN_BUILD', 1); +define('GET_CLOSED_BUILD', 0); + +define('AUTOMATIC_ID', 0); +define('NO_FILTER_SHOW_ON_EXEC', null); +define('DONT_REFRESH', 0); +define('DEFAULT_TC_ORDER', 0); + +// bug_interface->buildViewBugLink() +define('GET_BUG_SUMMARY', true); + +// gen_spec_view() +define('DO_PRUNE', 1); + +// executeTestCase() +define('AUTOMATION_RESULT_KO', - 1); +define('AUTOMATION_NOTES_KO', - 1); + +define('REMOVEME', 'd8ba8cfb-ca92-4fa5-83c2-551977d405fb'); + +/** + * Constants for plugins + */ +/** + * Plugin configuration types + */ +define('CONFIG_TYPE_STRING', 0); +define('CONFIG_TYPE_INT', 1); +define('CONFIG_TYPE_FLOAT', 2); +define('CONFIG_TYPE_COMPLEX', 3); + +/** + * To indicate the plugin configuration belongs to ANY PROJECT + */ +define('TL_ANY_PROJECT', - 1); + +/** + * Constants for events + */ +define('EVENT_TYPE_CREATE', 1); +define('EVENT_TYPE_UPDATE', 2); +define('EVENT_TYPE_DELETE', 3); +define('EVENT_TYPE_OUTPUT', 4); + +// --------------------------------------------------------------------------------- +/* [GUI] */ + +/** + * + * @uses planAddTC_m1-tpl + * + */ +define('TL_STYLE_FOR_ADDED_TC', 'background-color:yellow;'); + +/** + * Browser Cookie keeptime + */ +define('TL_COOKIE_KEEPTIME', (time() + 60 * 60 * 24 * 30)); // 30 days + +// needed for drap and drop feature +define('TL_DRAG_DROP_DIR', 'gui/drag_and_drop/'); +define('TL_DRAG_DROP_JS_DIR', TL_DRAG_DROP_DIR . 'js/'); +define('TL_DRAG_DROP_FOLDER_CSS', + TL_DRAG_DROP_DIR . 'css/drag-drop-folder-tree.css'); +define('TL_DRAG_DROP_CONTEXT_MENU_CSS', + TL_DRAG_DROP_DIR . 'css/context-menu.css'); + +/** + * Mark up inactive objects (test projects, etc) in GUI lists + */ +define('TL_INACTIVE_MARKUP', '* '); + +/** @var string Delimiter used when created a test suite path, concatenating test suite names */ +$g_testsuite_sep = '/'; + +/** + * using niftycorners + * + * @todo havlatm: move to smarty templates - configuration should not contain HTML elements + */ +define('MENU_ITEM_OPEN', '
'); + +/** + * Used to force the max len of this field, during the automatic creation of requirements + * or other import features + */ +$g_field_size = new stdClass(); +$g_field_size->node_name = 100; +$g_field_size->testsuite_name = 100; +$g_field_size->testcase_name = 100; +$g_field_size->testproject_name = 100; + +// requirements and req_spec tables field sizes +$g_field_size->req_docid = 64; +$g_field_size->req_title = 100; +$g_field_size->requirement_title = 100; +$g_field_size->docid = 64; + +// execution table +$g_field_size->bug_id = 16; + +// -------------------------------------------------------------------------------------- +/* [LOCALIZATION] */ + +/** + * String that will used as prefix, to generate an string when a label to be localized + * is passed to lang_get() to be translated, by the label is not present in the strings file. + * The resulting string will be: TL_LOCALIZE_TAG . label + * + * @example code specifies the key of string: lang_get('hello') -> shows "LOCALIZE: Hello" + */ +define('TL_LOCALIZE_TAG', 'LOCALIZE: '); + +/** @var string Default format of date */ +$tlCfg->date_format = '%d/%m/%Y'; + +/** @var string Default format of datetime */ +$tlCfg->timestamp_format = '%d/%m/%Y %H:%M:%S'; + +/** + * + * @var array List of supported localizations (used in user preferences to choose one) + * DEV: Please Maintain the alphabetical order when adding new locales. + * Also check inc.ext_js_tpl to set localization for ExtJS Components. + */ +$tlCfg->locales = array( + 'cs_CZ' => 'Czech', + 'de_DE' => 'German', + 'en_GB' => 'English (wide/UK)', + 'en_US' => 'English (US)', + 'es_AR' => 'Spanish (Argentine)', + 'es_ES' => 'Spanish', + 'fi_FI' => 'Finnish', + 'fr_FR' => 'Français', + 'id_ID' => 'Indonesian', + 'it_IT' => 'Italian', + 'ja_JP' => 'Japanese', + 'ko_KR' => 'Korean', + 'nl_NL' => 'Dutch', + 'pl_PL' => 'Polski', + 'pt_BR' => 'Portuguese (Brazil)', + 'pt_PT' => 'Portuguese', + 'ru_RU' => 'Russian', + 'zh_CN' => 'Chinese Simplified' +); + +/** + * Format of date - see strftime() in PHP manual + * NOTE: setting according local is done in testlinkInitPage() using setDateTimeFormats() + */ +/** @var array Localized format of date */ +$tlCfg->locales_date_format = array( + 'cs_CZ' => '%d.%m.%Y', + 'de_DE' => '%d.%m.%Y', + 'en_GB' => '%d/%m/%Y', + 'en_US' => '%m/%d/%Y', + 'es_AR' => '%d/%m/%Y', + 'es_ES' => '%d/%m/%Y', + 'fi_FI' => '%d/%m/%Y', + 'fr_FR' => '%d/%m/%Y', + 'id_ID' => '%d/%m/%Y', + 'it_IT' => '%d/%m/%Y', + 'ja_JP' => '%Y/%m/%d', + 'ko_KR' => '%Y/%m/%d', + 'nl_NL' => '%d-%m-%Y', + 'pl_PL' => '%d.%m.%Y', + 'pt_BR' => '%d/%m/%Y', + 'pt_PT' => '%d/%m/%Y', + 'ru_RU' => '%d.%m.%Y', + 'zh_CN' => '%Y-%m-%d' +); + +/** @var array Localized format of full timestamp */ +$tlCfg->locales_timestamp_format = array( + 'cs_CZ' => '%d.%m.%Y %H:%M:%S', + 'de_DE' => '%d.%m.%Y %H:%M:%S', + 'en_GB' => '%d/%m/%Y %H:%M:%S', + 'en_US' => '%m/%d/%Y %H:%M:%S', + 'es_AR' => '%d/%m/%Y %H:%M:%S', + 'es_ES' => '%d/%m/%Y %H:%M:%S', + 'fi_FI' => '%d/%m/%Y %H:%M:%S', + 'fr_FR' => '%d/%m/%Y %H:%M:%S', + 'id_ID' => '%d/%m/%Y %H:%M:%S', + 'it_IT' => '%d/%m/%Y %H:%M:%S', + 'ja_JP' => '%Y/%m/%d %H:%M:%S', + 'ko_KR' => '%Y/%m/%d %H:%M:%S', + 'nl_NL' => '%d-%m-%Y %H:%M:%S', + 'pl_PL' => '%d.%m.%Y %H:%M:%S', + 'pt_BR' => '%d/%m/%Y %H:%M:%S', + 'pt_PT' => '%d/%m/%Y %H:%M:%S', + 'ru_RU' => '%d.%m.%Y %H:%M:%S', + 'zh_CN' => '%Y-%m-%d %H:%M:%S' +); + +/** + * + * @var array localized date format for smarty templates (html_select_date function) + * deprecated since use of datepicker + */ +$tlCfg->locales_html_select_date_field_order = array( + 'cs_CZ' => 'dmY', + 'de_DE' => 'dmY', + 'en_GB' => 'dmY', + 'en_US' => 'mdY', + 'es_AR' => 'dmY', + 'es_ES' => 'dmY', + 'fi_FI' => 'dmY', + 'fr_FR' => 'dmY', + 'id_ID' => 'dmY', + 'it_IT' => 'dmY', + 'ja_JP' => 'Ymd', + 'ko_KR' => 'Ymd', + 'nl_NL' => 'dmY', + 'pl_PL' => 'dmY', + 'pt_BR' => 'dmY', + 'pt_PT' => 'dmY', + 'ru_RU' => 'dmY', + 'zh_CN' => 'Ymd' +); + +// -------------------------------------------------------------------------------------- +/* ATTACHMENTS */ + +/** + * Attachment key constants (do not change) + */ +define('TL_REPOSITORY_TYPE_DB', 1); +define('TL_REPOSITORY_TYPE_FS', 2); + +define('TL_REPOSITORY_COMPRESSIONTYPE_NONE', 1); +define('TL_REPOSITORY_COMPRESSIONTYPE_GZIP', 2); + +// Two models to manage attachment interface in the execution screen +// $att_model_m1 -> shows upload button and title +// +$att_model_m1 = new stdClass(); +$att_model_m2 = new stdClass(); + +$att_model_m1->show_upload_btn = true; +$att_model_m1->show_title = true; +$att_model_m1->num_cols = 4; +$att_model_m1->show_upload_column = false; + +// $att_model_m2 -> hides upload button and title +// +$att_model_m2->show_upload_btn = false; +$att_model_m2->show_title = false; +$att_model_m2->num_cols = 5; +$att_model_m2->show_upload_column = true; + +// -------------------------------------------------------------------------------------- +/* [Test execution] */ +/** + * Note: do not change existing values (you can enhance arrays of course more into custom_config) + * If you add new statuses, please use custom_strings.txt to add your localized strings + */ + +/** + * User can define own test status(es) by modifying + * - $tlCfg->results['status_code'] (in custom_config.inc.php) + * - $tlCfg->results['status_label'] (in custom_config.inc.php) + * - $tlCfg->results['status_label_for_exec_ui'] (in custom_config.inc.php) + * - $tlCfg->results['charts']['status_colour'] (in custom_config.inc.php) + * - /locale//custom_strings.txt + * - /gui/themes/default/css/custom.css + * + * DO NOT define Custom test status(es) in this file - use custom_config.inc.php + */ + +/** + * + * @var array List of Test Case execution results (status_key -> DB code). + * The code is used in DB to store results (not GUI). + * Do not do localisation here, i.e do not change "passed" by your national language. + */ +$tlCfg->results['status_code'] = array( + 'failed' => 'f', + 'blocked' => 'b', + 'passed' => 'p', + 'not_run' => 'n', + 'not_available' => 'x', + 'unknown' => 'u', + 'all' => 'a' +); + +/* for some reports */ +$tlCfg->results['status_order'] = array( + 'not_run' => 'n', + 'passed' => 'p', + 'failed' => 'f', + 'blocked' => 'b' +); + +/** + * Used to get localized string to show to users + * Order is important, because this will be display order on GUI + * + * @var array key: status ID + * value: id to use with lang_get() to get the string, from strings.txt (or custom_strings.txt) + * + * @example use the next code to get localized string of a status + * + * $results_cfg = config_get('results'); + * lang_get($results_cfg['status_label']["passed"]); + * + */ +$tlCfg->results['status_label'] = array( + 'not_run' => 'test_status_not_run', + 'passed' => 'test_status_passed', + 'failed' => 'test_status_failed', + 'blocked' => 'test_status_blocked', + 'all' => 'test_status_all_status', + 'not_available' => 'test_status_not_available', + 'unknown' => 'test_status_unknown' +); + +// Is RIGHT to have this configuration DIFFERENT from $tlCfg->results['status_label'], +// because you must choose to not allow some of previous status be available +// on execution page. +// See this as a subset of $tlCfg->results['status_label'] +// +// Used to generate radio and buttons at user interface level. +// +// IMPORTANT NOTE ABOUT ORDER: +// Order is important, because this will be display order on User Interface +// And will be used on every feature that will need to do ordering +// according Test Case Execution Status. +// +// +// key => verbose status as defined in $tlCfg->results['status_code'] +// value => string id defined in the strings.txt file, +// used to localize the strings. +// +$tlCfg->results['status_label_for_exec_ui'] = array( + 'not_run' => 'test_status_not_run', + 'passed' => 'test_status_passed', + 'failed' => 'test_status_failed', + 'blocked' => 'test_status_blocked' +); + +$tlCfg->results['status_icons_for_exec_ui'] = array( + 'passed' => array( + 'img' => 'test_status_passed', + 'title' => 'click_passed' + ), + 'failed' => array( + 'img' => 'test_status_failed', + 'title' => 'click_failed' + ), + 'blocked' => array( + 'img' => 'test_status_blocked', + 'title' => 'click_blocked' + ) +); + +$tlCfg->results['status_icons_for_exec_next_ui'] = array( + 'passed' => array( + 'img' => 'test_status_passed_next', + 'title' => 'click_passed_next' + ), + 'failed' => array( + 'img' => 'test_status_failed_next', + 'title' => 'click_failed_next' + ), + 'blocked' => array( + 'img' => 'test_status_blocked_next', + 'title' => 'click_blocked_next' + ) +); + +$tlCfg->results['execStatusToExclude'] = array(); +$tlCfg->results['execStatusToExclude']['testcase'] = array( + $tlCfg->results['status_code']['all'] +); + +$tlCfg->results['execStatusToExclude']['step'] = array( + $tlCfg->results['status_code']['all'] +); + +/** + * Selected execution result by default. + * Values is key from $tlCfg->results['status_label'] + * + * @var string + */ +$tlCfg->results['default_status'] = 'not_run'; + +/** + * Status colours for charts - use just RGB (not colour names) + * Colours should be compiant with definition in CSS + */ +$tlCfg->results['charts']['status_colour'] = array( + 'not_run' => '000000', + 'passed' => '006400', + 'failed' => 'B22222', + 'blocked' => '00008B' +); + +/* + * arrays for new filter types (BUGID 2455, BUGID 3026) + * used for testcase execution + */ +$tlCfg->execution_filter_methods['status_code'] = array( + 'latest_execution' => 1, + 'all_builds' => 2, + 'any_build' => 3, + 'specific_build' => 4, + 'current_build' => 5 +); + +$tlCfg->execution_filter_methods['status_label'] = array( + 'latest_execution' => 'filter_result_latest_execution', + 'all_builds' => 'filter_result_all_builds', + 'any_build' => 'filter_result_any_build', + 'specific_build' => 'filter_result_specific_build', + 'current_build' => 'filter_result_current_build' +); + +$tlCfg->execution_filter_methods['default_type'] = $tlCfg->execution_filter_methods['status_code']['current_build']; + +/* + * same as above, but without current build + * these are used for testcase execution assignment + */ +$tlCfg->execution_assignment_filter_methods['status_code'] = array( + 'latest_execution' => 1, + 'all_builds' => 2, + 'any_build' => 3, + 'specific_build' => 4 +); + +$tlCfg->execution_assignment_filter_methods['status_label'] = array( + 'latest_execution' => 'filter_result_latest_execution', + 'all_builds' => 'filter_result_all_builds', + 'any_build' => 'filter_result_any_build', + 'specific_build' => 'filter_result_specific_build' +); + +// CRITIC NOTICE +// This values has to have certain coerence with +// $js_key_to_select on init_filter_result() in tlTestCaseFilterControl.class.php +// +$tlCfg->execution_assignment_filter_methods['default_type'] = $tlCfg->execution_assignment_filter_methods['status_code']['specific_build']; + +// -------------------------------------------------------------------------------------- +/* [Users & Roles] */ + +define('TL_USER_NOBODY', - 1); +define('TL_USER_SOMEBODY', - 2); // new user for new filtertypes in 2455 & 3026 +define('TL_NO_USER', TL_USER_NOBODY); +define('TL_USER_ANYBODY', 0); + +/** + * Follows CODES present in roles table - DO NOT CHANGE ON ANY CIRCUNSTANCE + */ +define('TL_ROLES_MANAGER', 1); +define('TL_ROLES_ADMIN', 8); +define('TL_ROLES_LEADER', 9); +define('TL_ROLES_TESTER', 7); +define('TL_ROLES_GUEST', 5); +define('TL_ROLES_NO_RIGHTS', 3); +define('TL_ROLES_UNDEFINED', 0); +define('TL_ROLES_INHERITED', 0); + +// Roles with id > to this role can be deleted from user interface +define('TL_LAST_SYSTEM_ROLE', 9); + +// used on user management page to give different colour +// to different roles. +// If you don't want use colouring then configure in this way +// $g_role_colour = array ( ); +$g_role_colour = array( + 'admin' => 'white', + 'tester' => 'wheat', + 'leader' => 'acqua', + 'senior tester' => '#FFA', + 'guest' => 'pink', + 'test designer' => 'cyan', + '' => 'grey', + '' => 'seashell' +); + +// -------------------------------------------------------------------------------------- +/** + * LDAP authentication errors + */ +define('ERROR_LDAP_AUTH_FAILED', 1400); +define('ERROR_LDAP_SERVER_CONNECT_FAILED', 1401); +define('ERROR_LDAP_UPDATE_FAILED', 1402); +define('ERROR_LDAP_USER_NOT_FOUND', 1403); +define('ERROR_LDAP_BIND_FAILED', 1404); +define('ERROR_LDAP_START_TLS_FAILED', 1405); + +// -------------------------------------------------------------------------------------- +/* [Priority, Urgency, Importance] */ + +/** @var array importance levels */ +$tlCfg->importance_levels = array( + HIGH => 3, + MEDIUM => 2, + LOW => 1 +); +$tlCfg->importance['code_label'] = array( + HIGH => 'high', + MEDIUM => 'medium', + LOW => 'low' +); + +/** @var integer Default Test case Importance offered in GUI */ +$tlCfg->testcase_importance_default = MEDIUM; + +/** @var integer Default Test case Urgency offered in GUI */ +$tlCfg->testcase_urgency_default = MEDIUM; + +/** + * + * @var array Used to get localized string to show to users + * key: numeric code + * value: id to use with lang_get() to get the string, from strings.txt (or custom_strings.txt) + * @since 1.8 + */ +$tlCfg->urgency['code_label'] = array( + HIGH => 'urgency_high', + MEDIUM => 'urgency_medium', + LOW => 'urgency_low' +); + +/* priority is calculated using importance and urgency */ +$tlCfg->priority['code_label'] = array( + HIGH => 'high_priority', + MEDIUM => 'medium_priority', + LOW => 'low_priority' +); + +// -------------------------------------------------------------------------------------- +/* [States & Review] */ + +define('TL_REL_TYPE_PARENT_CHILD', 1); +define('TL_REL_TYPE_BLOCKS_DEPENDS', 2); +define('TL_REL_TYPE_RELATED', 3); +define('TL_REL_TYPE_AUTOMATION_PARENT_CHILD', 4); +define('TL_REL_TYPE_EXECUTE_TOGETHER', 5); + +/** + * data status constants are applicable for data like requirement, test case, Test Plan + * + * @since 2.0 + */ +/** + * Review status: design phase; data are not available for review or using + */ +define('TL_REVIEW_STATUS_DRAFT', 1); + +/** + * Review status: data was reviewed and are available for using + */ +define('TL_REVIEW_STATUS_FINAL', 2); + +/** + * Review status: data wait for review + */ +define('TL_REVIEW_STATUS_REVIEW', 3); + +/** + * Review status: data are not applicable for using (not listed in reports and lists) + */ +define('TL_REVIEW_STATUS_OBSOLETE', 4); +define('TL_REVIEW_STATUS_FUTURE', 5); + +/** + * + * @var array localization identifiers for review states + * @since 2.0 + */ +$tlCfg->text_status_labels = array( + TL_REVIEW_STATUS_DRAFT => 'review_status_draft', + TL_REVIEW_STATUS_FINAL => 'review_status_final', + TL_REVIEW_STATUS_REVIEW => 'review_status_review', + TL_REVIEW_STATUS_OBSOLETE => 'review_status_obsolete', + TL_REVIEW_STATUS_FUTURE => 'review_status_future' +); + +/** + */ +define('TL_REQ_STATUS_VALID', 'V'); +define('TL_REQ_STATUS_NOT_TESTABLE', 'N'); +define('TL_REQ_STATUS_DRAFT', 'D'); +define('TL_REQ_STATUS_REVIEW', 'R'); +define('TL_REQ_STATUS_REWORK', 'W'); +define('TL_REQ_STATUS_FINISH', 'F'); +define('TL_REQ_STATUS_IMPLEMENTED', 'I'); +define('TL_REQ_STATUS_OBSOLETE', 'O'); + +// key: status; value: text label +$tlCfg->req_cfg = new stdClass(); +$tlCfg->req_cfg->status_labels = array( + TL_REQ_STATUS_DRAFT => 'req_status_draft', + TL_REQ_STATUS_REVIEW => 'req_status_review', + TL_REQ_STATUS_REWORK => 'req_status_rework', + TL_REQ_STATUS_FINISH => 'req_status_finish', + TL_REQ_STATUS_IMPLEMENTED => 'req_status_implemented', + TL_REQ_STATUS_VALID => 'review_status_valid', + TL_REQ_STATUS_NOT_TESTABLE => 'req_status_not_testable', + TL_REQ_STATUS_OBSOLETE => 'req_status_obsolete' +); + +/** + * Types of requirements (with respect to standards) + *
    + *
  • Info -informational character, project and user documentation. + * The type is not testable = not used for testing logic (except metrics).
  • + *
  • Feature - valid and testable functional definition (default selection)
  • + *
  • Use case
  • + *
  • Interface - user interface, communication protocols
  • + *
  • Non-functional - performance, infrastructure, robustness, security, safety, etc.
  • + *
  • Constrain - Constraints and Limitations
  • + *
+ * + * CRITIC: DO NOT REMOVE ANY OF THIS CONSTANTS, BECAUSE TL EXPECT THIS TO BE DEFINED + * + * @since TestLink 1.9 + * + * IMPORTANT NOTICE: this value will be written on DB on field of type CHAR(1) + */ +define('TL_REQ_TYPE_INFO', '1'); +define('TL_REQ_TYPE_FEATURE', '2'); +define('TL_REQ_TYPE_USE_CASE', '3'); +define('TL_REQ_TYPE_INTERFACE', '4'); +define('TL_REQ_TYPE_NON_FUNCTIONAL', '5'); +define('TL_REQ_TYPE_CONSTRAIN', '6'); +define('TL_REQ_TYPE_SYSTEM_FUNCTION', '7'); + +/** + * + * @var array localization identifiers for requirements types + * @since TestLink 1.9 + */ +$tlCfg->req_cfg->type_labels = array( + TL_REQ_TYPE_INFO => 'req_type_info', + TL_REQ_TYPE_FEATURE => 'req_type_feature', + TL_REQ_TYPE_USE_CASE => 'req_type_use_case', + TL_REQ_TYPE_INTERFACE => 'req_type_interface', + TL_REQ_TYPE_NON_FUNCTIONAL => 'req_type_non_functional', + TL_REQ_TYPE_CONSTRAIN => 'req_type_constrain', + TL_REQ_TYPE_SYSTEM_FUNCTION => 'req_type_system_function' +); + +/** + * All possible types of requirement relations (BUGID 1748). + * + * Important: + * When you add your own relation types here, you also have to add localization strings + * and configure those below. + * + * Add you types ONLY AFTER LAST RESERVED + * + * @since TestLink 1.9 + * + * IMPORTANT NOTICE this will be written on DB on an INT field + */ +define('TL_REQ_REL_TYPE_PARENT_CHILD', 1); +define('TL_REQ_REL_TYPE_BLOCKS_DEPENDS', 2); +define('TL_REQ_REL_TYPE_RELATED', 3); +define('TL_REQ_REL_TYPE_RESERVED_1', 4); +define('TL_REQ_REL_TYPE_RESERVED_2', 5); +define('TL_REQ_REL_TYPE_RESERVED_3', 6); +define('TL_REQ_REL_TYPE_RESERVED_4', 7); +define('TL_REQ_REL_TYPE_RESERVED_5', 8); +define('TL_REQ_REL_TYPE_RESERVED_6', 9); + +/** + * Localization identifiers for requirement relation types (BUGID 1748). + * Types, which are configured above, have to be configured + * here too with attributes "source" and "destination". + * + * Last value will be selected in GUI as default. + * + * Form has to be like this: + * + * $tlCfg->req_cfg->rel_type_labels = array( + * RELATIONNAME => array( + * 'source' => 'SOURCE_LOCALIZATION_KEY', + * 'destination' => 'DESTINATION_LOCALIZATION_KEY'), + * ... + * + * @since TestLink 1.9 + */ +$tlCfg->req_cfg->rel_type_labels = array( + TL_REQ_REL_TYPE_PARENT_CHILD => array( + 'source' => 'req_rel_is_parent_of', + 'destination' => 'req_rel_is_child_of' + ), + TL_REQ_REL_TYPE_BLOCKS_DEPENDS => array( + 'source' => 'req_rel_blocks', + 'destination' => 'req_rel_depends' + ), + TL_REQ_REL_TYPE_RELATED => array( // this is a flat relation, so strings are identical + 'source' => 'req_rel_is_related_to', + 'destination' => 'req_rel_is_related_to' + ) +); + +$tlCfg->req_cfg->rel_type_description = array( + TL_REQ_REL_TYPE_PARENT_CHILD => 'parent_child', + TL_REQ_REL_TYPE_BLOCKS_DEPENDS => 'blocks_depends', + TL_REQ_REL_TYPE_RELATED => 'related_to' +); + +/** + * + * @var array controls is expected_coverage must be requested at user interface. + * following conditions (OR LOGIC) must be verified to request value: + * + * a. key is NOT PRESENT (!isset()) + * b. key is present with value TRUE + * + * Working in this way configuration is simplified. + * + * @since TestLink 1.9 + */ +$tlCfg->req_cfg->type_expected_coverage = array( + TL_REQ_TYPE_INFO => false +); + +// IMPORTANT NOTICE: this value will be written on DB on field of type CHAR(1) +define('TL_REQ_SPEC_TYPE_SECTION', '1'); +define('TL_REQ_SPEC_TYPE_USER_REQ_SPEC', '2'); +define('TL_REQ_SPEC_TYPE_SYSTEM_REQ_SPEC', '3'); + +// define('TL_REQ_SPEC_TYPE_FUNCTIONAL_AND_DATA', 1); +// define('TL_REQ_SPEC_TYPE_LOOK_AND_FEEL',2); +// define('TL_REQ_SPEC_TYPE_USABILITY_AND_HUMANITY',3); +// define('TL_REQ_SPEC_TYPE_PERFORMANCE',4); +// define('TL_REQ_SPEC_TYPE_OPERATIONAL_AND_ENVIRONMENTAL',5); +// define('TL_REQ_SPEC_TYPE_MAINTAINABILITY_AND_SUPPORT',6); +// define('TL_REQ_SPEC_TYPE_SECURITY',7); +// define('TL_REQ_SPEC_TYPE_CULTURAL_AND_POLITICAL',8); +// define('TL_REQ_SPEC_TYPE_LEGAL',9); + +$tlCfg->req_spec_cfg = new stdClass(); +$tlCfg->req_spec_cfg->type_labels = array( + TL_REQ_SPEC_TYPE_SECTION => 'req_spec_type_section', + TL_REQ_SPEC_TYPE_USER_REQ_SPEC => 'req_spec_type_user_req_spec', + TL_REQ_SPEC_TYPE_SYSTEM_REQ_SPEC => 'req_spec_type_system_req_spec' +); + +/** + * + * @deprecated 1.9 + * @todo havlatm: replace by $tlCfg->req_cfg->type_labels + */ +define('TL_REQ_TYPE_1', 'V'); +define('TL_REQ_TYPE_2', 'N'); +define('NON_TESTABLE_REQ', 'n'); +define('VALID_REQ', 'v'); + +// -------------------------------------------------------------------------------------- +/* [CUSTOM FIELDS] */ + +// /** +// * Custom field constrains for HTML inputs use values to created to get/show custom field contents +// *
    +// *
  • for string,numeric,float,email: size & maxlenght of the input type text.
  • +// *
  • for list,email size of the select input.
  • +// *
+// */ +// $tlCfg->gui->custom_fields->sizes = array( +// 'string' => 50, +// 'numeric'=> 10, +// 'float' => 10, +// 'email' => 50, +// 'list' => 1, +// 'multiselection list' => 5, +// 'text area' => array('cols' => 40, 'rows' => 6) +// ); + +// 20080815 - franciscom +// Use this variable (on custom_config.inc.php) to define new Custom Field types. +// IMPORTANT: +// check $custom_field_types property on cfield_mgr.class.php +// to avoid overwrite of standard types. +// +// $tlCfg->gui->custom_fields->types = null; + +// Use this variable (on custom_config.inc.php) +// to define possible values behaviour for new Custom Field types. +// +// IMPORTANT: +// check $possible_values_cfg property on cfield_mgr.class.php +// to avoid overwrite of standard values. +// +// $tlCfg->gui->custom_fields->possible_values_cfg = null; + +// Format string follows date() spec - see PHP Manual +// We can not use $g_timestamp_format, because format strings for date() and strftime() +// uses same LETTER with different meanings (Bad Luck!) +$tlCfg->gui = new stdClass(); +$tlCfg->gui->custom_fields = new stdClass(); +$tlCfg->gui->custom_fields->time_format = 'H:i:s'; + +// -------------------------------------------------------------------------------------- +/* [MISC] */ + +/** + * Review types - user can define type for his review comment (disabled by default) + * + * @since TestLink version 2.0 + */ +$tlCfg->review_types = array( + 1 => 'undefined', + 2 => 'typo', + 3 => 'recommendation', + 4 => 'question', + 5 => 'unclear', + 6 => 'major problem' +); + +/** + * Top Menu definition + * + * structure + * - label: label to display, will be localized + * - url: resource to access when users click on menu item + * - right: user right need to display menu item. (can be an array) + * null => no right check needed + * - condition: specific condition = ['','TestPlanAvailable','ReqMgmtEnabled'] + * - shortcut: keyboard HTML shortcut + * - target: window/frame name (mainframe in the most of cases) + * - imgKey + * + * @since TestLink version 1.9 + */ +$tlCfg->guiTopMenu[1] = array( + 'label' => 'home', + 'url' => 'index.php', + 'right' => null, + 'imgKey' => 'home', + 'condition' => '', + 'shortcut' => 'h', + 'target' => '_parent' +); + +$tlCfg->guiTopMenu[2] = array( + 'label' => 'title_requirements', + 'imgKey' => 'requirements', + 'url' => 'lib/general/frmWorkArea.php?feature=reqSpecMgmt', + 'right' => array( + 'mgt_view_req', + 'mgt_modify_req' + ), + 'condition' => 'ReqMgmtEnabled', + 'shortcut' => 'r', + 'target' => 'mainframe' +); + +$tlCfg->guiTopMenu[3] = array( + 'label' => 'title_specification', + 'imgKey' => 'test_specification', + 'url' => 'lib/general/frmWorkArea.php?feature=editTc', + 'right' => array( + 'mgt_view_tc', + 'mgt_modify_tc' + ), + 'condition' => '', + 'shortcut' => 't', + 'target' => 'mainframe' +); + +$tlCfg->guiTopMenu[4] = array( + 'label' => 'title_execute', + 'imgKey' => 'execution', + 'url' => 'lib/general/frmWorkArea.php?feature=executeTest', + 'right' => array( + 'testplan_execute', + 'exec_ro_access' + ), + 'condition' => 'TestPlanAvailable', + 'shortcut' => 'e', + 'target' => 'mainframe' +); + +$tlCfg->guiTopMenu[5] = array( + 'label' => 'title_results', + 'imgKey' => 'report', + 'url' => 'lib/general/frmWorkArea.php?feature=showMetrics', + 'right' => 'testplan_metrics', + 'condition' => 'TestPlanAvailable', + 'shortcut' => 'r', + 'target' => 'mainframe' +); + +$tlCfg->guiTopMenu[6] = array( + 'label' => 'title_admin', + 'imgKey' => 'user', + 'url' => 'lib/usermanagement/usersView.php', + 'right' => 'mgt_users', + 'condition' => '', + 'shortcut' => 'u', + 'target' => 'mainframe' +); + +$tlCfg->guiTopMenu[7] = array( + 'label' => 'title_events', + 'imgKey' => 'events', + 'url' => 'lib/events/eventviewer.php', + 'right' => array( + 'events_mgt', + 'mgt_view_events' + ), + 'condition' => '', + 'shortcut' => 'v', + 'target' => 'mainframe' +); +$tlCfg->guiTopMenu[8] = array( + 'label' => 'title_plugins', + 'imgKey' => 'plugins', + 'url' => 'lib/plugins/pluginView.php', + 'right' => array( + 'mgt_plugins' + ), + 'condition' => '', + 'shortcut' => 'p', + 'target' => 'mainframe' +); + +define('PARTIAL_URL_TL_FILE_FORMATS_DOCUMENT', 'docs/tl-file-formats.pdf'); + +// Configure Charts dimension +$tlCfg->results['charts']['dimensions'] = array( + 'topLevelSuitesBarChart' => array( + 'chartTitle' => 'results_top_level_suites', + 'XSize' => 900, + 'YSize' => 400, + 'beginX' => 40, + 'beginY' => 100, + 'legendXAngle' => 35 + ), + 'keywordBarChart' => array( + 'chartTitle' => 'results_by_keyword', + 'XSize' => 900, + 'YSize' => 400, + 'beginX' => 40, + 'beginY' => 100, + 'legendXAngle' => 25 + ), + 'ownerBarChart' => array( + 'chartTitle' => 'results_by_tester', + 'XSize' => 900, + 'YSize' => 400, + 'beginX' => 40, + 'beginY' => 100, + 'legendXAngle' => 35 + ), + 'overallPieChart' => array( + 'chartTitle' => 'results_by_tester', + 'XSize' => 400, + 'YSize' => 400, + 'radius' => 150, + 'legendX' => 10, + 'legendY' => 15 + ), + 'platformPieChart' => array( + 'chartTitle' => 'results_by_tester', + 'XSize' => 400, + 'YSize' => 400, + 'radius' => 150, + 'legendX' => 10, + 'legendY' => 15 + ) +); + +// if you need to define new one, start on 20 please. +// see strings.txt for labels +// $TLS_testCaseStatus_KEY => $TLS_testCaseStatus_draft +// +$tlCfg->testCaseStatus = array( + 'draft' => 1, + 'readyForReview' => 2, + 'reviewInProgress' => 3, + 'rework' => 4, + 'obsolete' => 5, + 'future' => 6, + 'final' => 7 +); + +// see strings.txt for labels +// $TLS_testCaseStatus_hint_KEY => $TLS_testCaseStatus_hint_draft +// +$tlCfg->testCaseStatusDisplayHintOnTestDesign = [ + 'draft' => '' /* 'testCaseStatus_hint_draft' */, + 'readyForReview' => '', + 'reviewInProgress' => '', + 'rework' => '', + 'obsolete' => 'testCaseStatus_hint_obsolete', + 'future' => '', + 'final' => '' +]; +// ----------------------------------------------------------------------------------------- + +/** + * + * @uses testcase.class.php + */ +// if you need to define new one, start on 20 please. +// see strings.txt for labels +// $TLS_execution_type_KEY => $TLS_execution_type_manual +$tlCfg->execution_type = array( + 'manual' => 1, + 'auto' => 2 +); + +// To be removed +define('TESTCASE_EXECUTION_TYPE_MANUAL', $tlCfg->execution_type['manual']); +define('TESTCASE_EXECUTION_TYPE_AUTO', $tlCfg->execution_type['auto']); + +// for link_status field on req_coverage table +define('LINK_TC_REQ_OPEN', 1); +define('LINK_TC_REQ_CLOSED_BY_EXEC', 2); +define('LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION', 3); +define('LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION', 4); + +// for link_status field on testcase_relations table +define('LINK_TC_RELATION_OPEN', 1); +define('LINK_TC_RELATION_CLOSED_BY_EXEC', 2); +define('LINK_TC_RELATION_CLOSED_BY_NEW_TCVERSION', 3); + +define('USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', 1); +define('USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS', 2); +define('USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS', 3); + + +// END diff --git a/cfg/oauth_samples/oauth.azuread.inc.php b/cfg/oauth_samples/oauth.azuread.inc.php index 837dad2e74..c7815ff9fa 100644 --- a/cfg/oauth_samples/oauth.azuread.inc.php +++ b/cfg/oauth_samples/oauth.azuread.inc.php @@ -1,62 +1,57 @@ -OAuthServers[] -// can be anything you want that make this configuration -// does not overwrite other or will be overwritten -// -// HOW TO use this file ? -// 1. copy this file to -// [TESTLINK_INSTALL]/cfg/ -// -// 2. configure according your application -// -// 3. add the following line to your custom_config.inc.php -// require('aouth.azuread.inc.php'); -// -// ------------------------------------------------------------- -$tlCfg->OAuthServers['azuread'] = array(); - -$tlCfg->OAuthServers['azuread']['redirect_uri'] = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] . '/login.php'; - - -$tlCfg->OAuthServers['azuread']['oauth_client_id'] = 'CHANGE_WITH_CLIENT_ID'; -$tlCfg->OAuthServers['azuread']['oauth_client_secret'] = - 'CHANGE_WITH_CLIENT_SECRET'; - -// https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0/.well-known/openid-configuration -$azureADBaseURL = 'https://login.microsoftonline.com/CHANGE_WITH_TENANT_ID'; -$msGraphURL = 'https://graph.microsoft.com'; -$tlCfg->OAuthServers['azuread']['oauth_url'] = - $azureADBaseURL . '/oauth2/v2.0/authorize'; - -$tlCfg->OAuthServers['azuread']['token_url'] = - $azureADBaseURL . '/oauth2/v2.0/token'; - -$tlCfg->OAuthServers['azuread']['oauth_profile'] = - $msGraphURL . '/oidc/userinfo'; - - -$tlCfg->OAuthServers['azuread']['oauth_enabled'] = true; -$tlCfg->OAuthServers['azuread']['oauth_name'] = 'azuread'; //do not change this -$tlCfg->OAuthServers['azuread']['oauth_force_single'] = true; -$tlCfg->OAuthServers['azuread']['oauth_grant_type'] = 'authorization_code'; - -// the domain you want to whitelist (email domains) -$tlCfg->OAuthServers['azuread']['oauth_domain'] = 'autsoft.hu'; - - -$tlCfg->OAuthServers['azuread']['oauth_scope'] = - 'https://graph.microsoft.com/mail.read https://graph.microsoft.com/user.read openid profile email'; +OAuthServers[] +// can be anything you want that make this configuration +// does not overwrite other or will be overwritten +// +// HOW TO use this file ? +// 1. copy this file to +// [TESTLINK_INSTALL]/cfg/ +// +// 2. configure according your application +// +// 3. add the following line to your custom_config.inc.php +// require('aouth.azuread.inc.php'); +// +// ------------------------------------------------------------- +$tlCfg->OAuthServers['azuread'] = array(); + +$tlCfg->OAuthServers['azuread']['redirect_uri'] = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . + $_SERVER['HTTP_HOST'] . '/login.php'; + +$tlCfg->OAuthServers['azuread']['oauth_client_id'] = 'CHANGE_WITH_CLIENT_ID'; +$tlCfg->OAuthServers['azuread']['oauth_client_secret'] = 'CHANGE_WITH_CLIENT_SECRET'; + +// https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0/.well-known/openid-configuration +$azureADBaseURL = 'https://login.microsoftonline.com/CHANGE_WITH_TENANT_ID'; +$msGraphURL = 'https://graph.microsoft.com'; +$tlCfg->OAuthServers['azuread']['oauth_url'] = $azureADBaseURL . + '/oauth2/v2.0/authorize'; + +$tlCfg->OAuthServers['azuread']['token_url'] = $azureADBaseURL . + '/oauth2/v2.0/token'; + +$tlCfg->OAuthServers['azuread']['oauth_profile'] = $msGraphURL . '/oidc/userinfo'; + +$tlCfg->OAuthServers['azuread']['oauth_enabled'] = true; +$tlCfg->OAuthServers['azuread']['oauth_name'] = 'azuread'; // do not change this +$tlCfg->OAuthServers['azuread']['oauth_force_single'] = true; +$tlCfg->OAuthServers['azuread']['oauth_grant_type'] = 'authorization_code'; + +// the domain you want to whitelist (email domains) +$tlCfg->OAuthServers['azuread']['oauth_domain'] = 'autsoft.hu'; + +$tlCfg->OAuthServers['azuread']['oauth_scope'] = 'https://graph.microsoft.com/mail.read https://graph.microsoft.com/user.read openid profile email'; diff --git a/cfg/oauth_samples/oauth.github.inc.php b/cfg/oauth_samples/oauth.github.inc.php index bc095c2fac..05bede3a7e 100644 --- a/cfg/oauth_samples/oauth.github.inc.php +++ b/cfg/oauth_samples/oauth.github.inc.php @@ -1,46 +1,44 @@ -OAuthServers[] -# can be anything you want that make this configuration -# does not overwrite other or will be overwritten -# -# HOW TO use this file ? -# 1. copy this file to -# [TESTLINK_INSTALL]/cfg/ -# -# 2. configure according your application -# -# 3. add the following line to your custom_config.inc.php -# require('aouth.github.inc.php'); -# -# ########################################################### -# This is a working example for test site -# http://fman.hopto.org/ -# -# You need to create the configuration for your site -# This is only a working example that is useful -# for the TestLink Development Team -# -$tlCfg->OAuthServers['github'] = array(); -$tlCfg->OAuthServers['github']['redirect_uri'] = - 'http://fman.hopto.org/login.php?oauth=github'; - -$tlCfg->OAuthServers['github']['oauth_client_id'] ='aa5f70a8de342fb95043'; -$tlCfg->OAuthServers['github']['oauth_client_secret'] = - 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e'; - -$tlCfg->OAuthServers['github']['oauth_enabled'] = true; +OAuthServers[] +# can be anything you want that make this configuration +# does not overwrite other or will be overwritten +# +# HOW TO use this file ? +# 1. copy this file to +# [TESTLINK_INSTALL]/cfg/ +# +# 2. configure according your application +# +# 3. add the following line to your custom_config.inc.php +# require('aouth.github.inc.php'); +# +# ########################################################### +# This is a working example for test site +# http://fman.hopto.org/ +# +# You need to create the configuration for your site +# This is only a working example that is useful +# for the TestLink Development Team +# +$tlCfg->OAuthServers['github'] = array(); +$tlCfg->OAuthServers['github']['redirect_uri'] = 'http://fman.hopto.org/login.php?oauth=github'; + +$tlCfg->OAuthServers['github']['oauth_client_id'] = 'aa5f70a8de342fb95043'; +$tlCfg->OAuthServers['github']['oauth_client_secret'] = 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e'; + +$tlCfg->OAuthServers['github']['oauth_enabled'] = true; $tlCfg->OAuthServers['github']['oauth_name'] = 'github'; -# End Of File \ No newline at end of file + diff --git a/cfg/oauth_samples/oauth.gitlab.inc.php b/cfg/oauth_samples/oauth.gitlab.inc.php index 76d587ef77..5b0559c67a 100644 --- a/cfg/oauth_samples/oauth.gitlab.inc.php +++ b/cfg/oauth_samples/oauth.gitlab.inc.php @@ -1,46 +1,44 @@ -OAuthServers[] -# can be anything you want that make this configuration -# does not overwrite other or will be overwritten -# -# HOW TO use this file ? -# 1. copy this file to -# [TESTLINK_INSTALL]/cfg/ -# -# 2. configure according your application -# -# 3. add the following line to your custom_config.inc.php -# require('aouth.gitlab.inc.php'); -# -# ############################################################## -# -# This is a working example for test site -# http://fman.hopto.org/ -# -# You need to create the configuration for your site -# This is only a working example that is useful -# for the TestLink Development Team -# -$tlCfg->OAuthServers['gitlab'] = array(); - -$tlCfg->OAuthServers['gitlab']['redirect_uri'] = - 'http://fman.hopto.org/login.php?oauth=gitlab'; - -$tlCfg->OAuthServers['gitlab']['oauth_enabled'] = true; -$tlCfg->OAuthServers['gitlab']['oauth_name'] = 'gitlab'; - -$tlCfg->OAuthServers['gitlab']['oauth_client_id'] = -'27a03c93d60b5ddb4e0cef92149678fbe37c099733605e046a5428a9da4177ba'; - +OAuthServers[] +# can be anything you want that make this configuration +# does not overwrite other or will be overwritten +# +# HOW TO use this file ? +# 1. copy this file to +# [TESTLINK_INSTALL]/cfg/ +# +# 2. configure according your application +# +# 3. add the following line to your custom_config.inc.php +# require('aouth.gitlab.inc.php'); +# +# ############################################################## +# +# This is a working example for test site +# http://fman.hopto.org/ +# +# You need to create the configuration for your site +# This is only a working example that is useful +# for the TestLink Development Team +# +$tlCfg->OAuthServers['gitlab'] = array(); + +$tlCfg->OAuthServers['gitlab']['redirect_uri'] = 'http://fman.hopto.org/login.php?oauth=gitlab'; + +$tlCfg->OAuthServers['gitlab']['oauth_enabled'] = true; +$tlCfg->OAuthServers['gitlab']['oauth_name'] = 'gitlab'; + +$tlCfg->OAuthServers['gitlab']['oauth_client_id'] = '27a03c93d60b5ddb4e0cef92149678fbe37c099733605e046a5428a9da4177ba'; + $tlCfg->OAuthServers['gitlab']['oauth_client_secret'] = 'c157df291b81dbfd8084d38b155029baded3cf76c7449670bd2da889fe8b99eb'; diff --git a/cfg/oauth_samples/oauth.google.inc.php b/cfg/oauth_samples/oauth.google.inc.php index 5fd6bd7cea..1e403a8739 100644 --- a/cfg/oauth_samples/oauth.google.inc.php +++ b/cfg/oauth_samples/oauth.google.inc.php @@ -1,55 +1,52 @@ -OAuthServers[] -# can be anything you want that make this configuration -# does not overwrite other or will be overwritten -# -# HOW TO use this file ? -# 1. copy this file to -# [TESTLINK_INSTALL]/cfg/ -# -# 2. configure according your application -# -# 3. add the following line to your custom_config.inc.php -# require('aouth.google.inc.php'); -# -# ############################################################# -# Client implemented using -# https://github.com/thephpleague/oauth2-google -## -# This is a working example for test site -# http://fman.hopto.org/ -# -# You need to create the configuration for your site -# This is only a working example that is useful -# for the TestLink Development Team -# -$tlCfg->OAuthServers['google'] = array(); -$tlCfg->OAuthServers['google']['redirect_uri'] = - 'http://fman.hopto.org/login.php?oauth=google'; - -$tlCfg->OAuthServers['google']['oauth_enabled'] = true; -$tlCfg->OAuthServers['google']['oauth_name'] = 'google'; - -// Get from /gui/themes/default/images -$tlCfg->OAuthServers['google']['oauth_client_id'] = - '860603525614-fscj9cgr2dvks51uh6odl67skec536fd.apps.googleusercontent.com'; - -$tlCfg->OAuthServers['google']['oauth_client_secret'] = - '_YOKquNTa4Fux-OMJoxDBuov'; +OAuthServers[] +# can be anything you want that make this configuration +# does not overwrite other or will be overwritten +# +# HOW TO use this file ? +# 1. copy this file to +# [TESTLINK_INSTALL]/cfg/ +# +# 2. configure according your application +# +# 3. add the following line to your custom_config.inc.php +# require('aouth.google.inc.php'); +# +# ############################################################# +# Client implemented using +# https://github.com/thephpleague/oauth2-google +# # +# This is a working example for test site +# http://fman.hopto.org/ +# +# You need to create the configuration for your site +# This is only a working example that is useful +# for the TestLink Development Team +# +$tlCfg->OAuthServers['google'] = array(); +$tlCfg->OAuthServers['google']['redirect_uri'] = 'http://fman.hopto.org/login.php?oauth=google'; + +$tlCfg->OAuthServers['google']['oauth_enabled'] = true; +$tlCfg->OAuthServers['google']['oauth_name'] = 'google'; + +// Get from /gui/themes/default/images +$tlCfg->OAuthServers['google']['oauth_client_id'] = '860603525614-fscj9cgr2dvks51uh6odl67skec536fd.apps.googleusercontent.com'; + +$tlCfg->OAuthServers['google']['oauth_client_secret'] = '_YOKquNTa4Fux-OMJoxDBuov'; // Needed when you use the cURL implementation // Can be authorization_code (by default), client_credentials or password -// $tlCfg->OAuthServers['google']['oauth_grant_type'] = 'authorization_code'; +// $tlCfg->OAuthServers['google']['oauth_grant_type'] = 'authorization_code'; //$tlCfg->OAuthServers['google']['oauth_url'] = 'https://accounts.google.com/o/oauth2/auth'; //$tlCfg->OAuthServers['google']['token_url'] = 'https://accounts.google.com/o/oauth2/token'; // false => then the only user will be selected automatically (applied for google) -//$tlCfg->OAuthServers['google']['oauth_force_single'] = false; +//$tlCfg->OAuthServers['google']['oauth_force_single'] = false; // the domain you want to whitelist -//$tlCfg->OAuthServers['google']['oauth_domain'] = 'google.com'; +//$tlCfg->OAuthServers['google']['oauth_domain'] = 'google.com'; //$tlCfg->OAuthServers['google']['oauth_profile'] = 'https://www.googleapis.com/oauth2/v1/userinfo'; //$tlCfg->OAuthServers['google']['oauth_scope'] = 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile'; diff --git a/cfg/oauth_samples/oauth.microsoft.inc.php b/cfg/oauth_samples/oauth.microsoft.inc.php index 02d6cda54f..b8ec24badd 100644 --- a/cfg/oauth_samples/oauth.microsoft.inc.php +++ b/cfg/oauth_samples/oauth.microsoft.inc.php @@ -1,37 +1,37 @@ -OAuthServers[] -// can be anything you want that make this configuration -// does not overwrite other or will be overwritten -// -// HOW TO use this file ? -// 1. copy this file to -// [TESTLINK_INSTALL]/cfg/ -// -// 2. configure according your application -// -// 3. add the following line to your custom_config.inc.php -// require('aouth.microsoft.inc.php'); -// -// ------------------------------------------------------------- -$tlCfg->OAuthServers['microsoft'] = array(); -$tlCfg->OAuthServers['microsoft']['redirect_uri'] = ''; - -$tlCfg->OAuthServers['microsoft']['oauth_enabled'] = true; -$tlCfg->OAuthServers['microsoft']['oauth_name'] = 'microsoft'; -$tlCfg->OAuthServers['microsoft']['oauth_client_id'] = 'CLIENT_ID'; -$tlCfg->OAuthServers['microsoft']['oauth_client_secret'] = 'CLIENT_SECRET'; - -// Can be authorization_code (by default), client_credentials or password -$tlCfg->OAuthServers['microsoft']['oauth_grant_type'] = 'authorization_code'; -$tlCfg->OAuthServers['microsoft']['oauth_url'] = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'; - -$tlCfg->OAuthServers['microsoft']['token_url'] = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; - -$tlCfg->OAuthServers['microsoft']['oauth_force_single'] = true; -$tlCfg->OAuthServers['microsoft']['oauth_profile'] = 'https://graph.microsoft.com/v1.0/me'; +OAuthServers[] +// can be anything you want that make this configuration +// does not overwrite other or will be overwritten +// +// HOW TO use this file ? +// 1. copy this file to +// [TESTLINK_INSTALL]/cfg/ +// +// 2. configure according your application +// +// 3. add the following line to your custom_config.inc.php +// require('aouth.microsoft.inc.php'); +// +// ------------------------------------------------------------- +$tlCfg->OAuthServers['microsoft'] = array(); +$tlCfg->OAuthServers['microsoft']['redirect_uri'] = ''; + +$tlCfg->OAuthServers['microsoft']['oauth_enabled'] = true; +$tlCfg->OAuthServers['microsoft']['oauth_name'] = 'microsoft'; +$tlCfg->OAuthServers['microsoft']['oauth_client_id'] = 'CLIENT_ID'; +$tlCfg->OAuthServers['microsoft']['oauth_client_secret'] = 'CLIENT_SECRET'; + +// Can be authorization_code (by default), client_credentials or password +$tlCfg->OAuthServers['microsoft']['oauth_grant_type'] = 'authorization_code'; +$tlCfg->OAuthServers['microsoft']['oauth_url'] = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize'; + +$tlCfg->OAuthServers['microsoft']['token_url'] = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; + +$tlCfg->OAuthServers['microsoft']['oauth_force_single'] = true; +$tlCfg->OAuthServers['microsoft']['oauth_profile'] = 'https://graph.microsoft.com/v1.0/me'; $tlCfg->OAuthServers['microsoft']['oauth_scope'] = 'User.Read'; diff --git a/cfg/reports.cfg.php b/cfg/reports.cfg.php index ac915e9d5c..3611900b19 100644 --- a/cfg/reports.cfg.php +++ b/cfg/reports.cfg.php @@ -1,15 +1,17 @@ reports_formats = array( FORMAT_HTML => 'format_html', - FORMAT_MSWORD => 'format_pseudo_msword', - FORMAT_MAIL_HTML => 'format_mail_html'); - -/** Mime Content Type */ -$tlCfg->reports_applications = - array(FORMAT_HTML => 'text/html', - FORMAT_XLS => 'application/vnd.ms-excel', - FORMAT_MSWORD => 'application/vnd.ms-word'); - +/** + * supported document formats (value = localization ID) + */ +$tlCfg->reports_formats = array( + FORMAT_HTML => 'format_html', + FORMAT_MSWORD => 'format_pseudo_msword', + FORMAT_MAIL_HTML => 'format_mail_html' +); -/** Report file extenssion */ -$tlCfg->reports_file_extension = - array(FORMAT_HTML => 'html',FORMAT_XLS => 'xls',FORMAT_MSWORD => 'doc'); +/** + * Mime Content Type + */ +$tlCfg->reports_applications = array( + FORMAT_HTML => 'text/html', + FORMAT_XLS => 'application/vnd.ms-excel', + FORMAT_MSWORD => 'application/vnd.ms-word' +); +/** + * Report file extenssion + */ +$tlCfg->reports_file_extension = array( + FORMAT_HTML => 'html', + FORMAT_XLS => 'xls', + FORMAT_MSWORD => 'doc' +); -/** - * @VAR $tlCfg->reports_list['report_identifier'] - * definition of default set of reports - * title - title string identifier - * url - http path (without testPlanId and format) - * enabled - availability - * 1. all (everytime), - * 2. bts (if bug tracker is connected only), - * 3. req (if project has available requirements only) +/** + * + * @var $tlCfg->reports_list['report_identifier'] definition of default set of reports + * title - title string identifier + * url - http path (without testPlanId and format) + * enabled - availability + * 1. all (everytime), + * 2. bts (if bug tracker is connected only), + * 3. req (if project has available requirements only) */ -$tlCfg->reports_list['test_plan'] = array( - 'title' => 'link_report_test_plan', - 'url' => 'lib/results/printDocOptions.php?type=' . DOC_TEST_PLAN_DESIGN, - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=test_plan', - 'format' => 'format_html,format_pseudo_msword' +$tlCfg->reports_list['test_plan'] = array( + 'title' => 'link_report_test_plan', + 'url' => 'lib/results/printDocOptions.php?type=' . DOC_TEST_PLAN_DESIGN, + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=test_plan', + 'format' => 'format_html,format_pseudo_msword' ); -$tlCfg->reports_list['test_report'] = array( - 'title' => 'link_report_test_report', - 'url' => 'lib/results/printDocOptions.php?type=' . DOC_TEST_PLAN_EXECUTION, - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=test_report', - 'format' => 'format_html,format_pseudo_msword' +$tlCfg->reports_list['test_report'] = array( + 'title' => 'link_report_test_report', + 'url' => 'lib/results/printDocOptions.php?type=' . DOC_TEST_PLAN_EXECUTION, + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=test_report', + 'format' => 'format_html,format_pseudo_msword' ); -$tlCfg->reports_list['test_report_on_build'] = array( - 'title' => 'link_report_test_report_on_build', - 'url' => 'lib/results/printDocOptions.php?type=' . DOC_TEST_PLAN_EXECUTION_ON_BUILD, - 'enabled' => 'all', - 'format' => 'format_html,format_pseudo_msword' +$tlCfg->reports_list['test_report_on_build'] = array( + 'title' => 'link_report_test_report_on_build', + 'url' => 'lib/results/printDocOptions.php?type=' . + DOC_TEST_PLAN_EXECUTION_ON_BUILD, + 'enabled' => 'all', + 'format' => 'format_html,format_pseudo_msword' ); -$tlCfg->reports_list['metrics_tp_general'] = array( - 'title' => 'link_report_general_tp_metrics', - 'url' => 'lib/results/resultsGeneral.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=metrics_tp_general', - 'format' => 'format_html,format_pseudo_ods' +$tlCfg->reports_list['metrics_tp_general'] = array( + 'title' => 'link_report_general_tp_metrics', + 'url' => 'lib/results/resultsGeneral.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=metrics_tp_general', + 'format' => 'format_html,format_pseudo_ods' ); -$tlCfg->reports_list['report_by_tsuite'] = - array('title' => 'link_report_by_tsuite', - 'url' => 'lib/results/resultsByTSuite.php', - 'enabled' => 'all', - 'directLink' => - '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=report_by_tsuite', - 'format' => 'format_html' +$tlCfg->reports_list['report_by_tsuite'] = array( + 'title' => 'link_report_by_tsuite', + 'url' => 'lib/results/resultsByTSuite.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=report_by_tsuite', + 'format' => 'format_html' ); -$tlCfg->reports_list['baseline_l1l2'] = - array('title' => 'baseline_l1l2', - 'url' => 'lib/results/baselinel1l2.php', - 'enabled' => 'all', - 'directLink' => - '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0' . - '&type=baseline_l1l2', - 'format' => 'format_html' +$tlCfg->reports_list['baseline_l1l2'] = array( + 'title' => 'baseline_l1l2', + 'url' => 'lib/results/baselinel1l2.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0' . + '&type=baseline_l1l2', + 'format' => 'format_html' ); - -$tlCfg->reports_list['results_by_tester_per_build'] = array( - 'title' => 'link_report_by_tester_per_build', - 'url' => 'lib/results/resultsByTesterPerBuild.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=results_by_tester_per_build', - 'format' => 'format_html' +$tlCfg->reports_list['results_by_tester_per_build'] = array( + 'title' => 'link_report_by_tester_per_build', + 'url' => 'lib/results/resultsByTesterPerBuild.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0&type=results_by_tester_per_build', + 'format' => 'format_html' ); -$tlCfg->reports_list['assigned_tc_overview'] = array( - 'title' => 'link_assigned_tc_overview', - 'url' => 'lib/testcases/tcAssignedToUser.php?show_all_users=1&show_inactive_and_closed=1', - 'enabled' => 'all', 'directLink' => '', - 'format' => 'format_html' +$tlCfg->reports_list['assigned_tc_overview'] = array( + 'title' => 'link_assigned_tc_overview', + 'url' => 'lib/testcases/tcAssignedToUser.php?show_all_users=1&show_inactive_and_closed=1', + 'enabled' => 'all', + 'directLink' => '', + 'format' => 'format_html' ); // will be released in future because refactoring is not completed -//$tlCfg->reports_list['results_custom_query'] = array( -// 'title' => 'link_report_metrics_more_builds', -// 'url' => 'lib/results/resultsMoreBuildsGUI.php', -// 'enabled' => 'all', 'directLink' => '', -// 'format' => 'format_html,format_ods,format_xls,format_mail_html' -//); -$tlCfg->reports_list['results_matrix'] = array( - 'title' => 'link_report_test', - 'url' => 'lib/results/resultsTC.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_matrix', - 'format' => 'format_html,format_pseudo_ods' +// $tlCfg->reports_list['results_custom_query'] = array( +// 'title' => 'link_report_metrics_more_builds', +// 'url' => 'lib/results/resultsMoreBuildsGUI.php', +// 'enabled' => 'all', 'directLink' => '', +// 'format' => 'format_html,format_ods,format_xls,format_mail_html' +// ); +$tlCfg->reports_list['results_matrix'] = array( + 'title' => 'link_report_test', + 'url' => 'lib/results/resultsTC.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_matrix', + 'format' => 'format_html,format_pseudo_ods' ); -$tlCfg->reports_list['results_flat'] = array( - 'title' => 'link_report_test_flat', - 'url' => 'lib/results/resultsTCFlat.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_flat', - 'format' => 'format_html,format_mail_html' +$tlCfg->reports_list['results_flat'] = array( + 'title' => 'link_report_test_flat', + 'url' => 'lib/results/resultsTCFlat.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_flat', + 'format' => 'format_html,format_mail_html' ); /* 20191210 */ -$tlCfg->reports_list['abslatest_results_matrix'] = array( - 'title' => 'link_report_test_absolute_latest_exec', - 'url' => 'lib/results/resultsTCAbsoluteLatest.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_matrix', - 'format' => 'format_html,format_pseudo_ods' +$tlCfg->reports_list['abslatest_results_matrix'] = array( + 'title' => 'link_report_test_absolute_latest_exec', + 'url' => 'lib/results/resultsTCAbsoluteLatest.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=results_matrix', + 'format' => 'format_html,format_pseudo_ods' ); - -$tlCfg->reports_list['list_tc_failed'] = array( - 'title' => 'link_report_failed', - 'url' => 'lib/results/resultsByStatus.php?type=' . $tlCfg->results['status_code']['failed'], - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_failed', - 'format' => 'format_html,format_pseudo_ods' +$tlCfg->reports_list['list_tc_failed'] = array( + 'title' => 'link_report_failed', + 'url' => 'lib/results/resultsByStatus.php?type=' . + $tlCfg->results['status_code']['failed'], + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_failed', + 'format' => 'format_html,format_pseudo_ods' ); -$tlCfg->reports_list['list_tc_blocked'] = array( - 'title' => 'link_report_blocked_tcs', - 'url' => 'lib/results/resultsByStatus.php?type=' . $tlCfg->results['status_code']['blocked'], - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_blocked', - 'format' => 'format_html,format_pseudo_ods' +$tlCfg->reports_list['list_tc_blocked'] = array( + 'title' => 'link_report_blocked_tcs', + 'url' => 'lib/results/resultsByStatus.php?type=' . + $tlCfg->results['status_code']['blocked'], + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_blocked', + 'format' => 'format_html,format_pseudo_ods' ); -$tlCfg->reports_list['list_tc_not_run'] = array( - 'title' => 'link_report_not_run', - 'url' => 'lib/results/resultsByStatus.php?type=' . $tlCfg->results['status_code']['not_run'], - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_not_run', - 'format' => 'format_html,format_pseudo_ods', - 'misc' => array('bugs_not_linked' => false) +$tlCfg->reports_list['list_tc_not_run'] = array( + 'title' => 'link_report_not_run', + 'url' => 'lib/results/resultsByStatus.php?type=' . + $tlCfg->results['status_code']['not_run'], + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=list_tc_not_run', + 'format' => 'format_html,format_pseudo_ods', + 'misc' => array( + 'bugs_not_linked' => false + ) ); -$tlCfg->reports_list['never_run'] = array( - 'title' => 'link_report_never_run', - 'url' => 'lib/results/neverRunByPP.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=never_run', - 'format' => 'format_html,format_pseudo_ods', - 'misc' => array('bugs_not_linked' => false) +$tlCfg->reports_list['never_run'] = array( + 'title' => 'link_report_never_run', + 'url' => 'lib/results/neverRunByPP.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=never_run', + 'format' => 'format_html,format_pseudo_ods', + 'misc' => array( + 'bugs_not_linked' => false + ) ); - $tlCfg->reports_list['tcases_without_tester'] = array( - 'title' => 'link_report_tcases_without_tester', - 'url' => 'lib/results/testCasesWithoutTester.php', - 'enabled' => 'all', 'directLink' => '', - 'format' => 'format_html' + 'title' => 'link_report_tcases_without_tester', + 'url' => 'lib/results/testCasesWithoutTester.php', + 'enabled' => 'all', + 'directLink' => '', + 'format' => 'format_html' ); -$tlCfg->reports_list['charts_basic'] = array( - 'title' => 'link_charts', - 'url' => 'lib/results/charts.php', - 'enabled' => 'all', - 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=charts_basic', - 'format' => 'format_html' +$tlCfg->reports_list['charts_basic'] = array( + 'title' => 'link_charts', + 'url' => 'lib/results/charts.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&type=charts_basic', + 'format' => 'format_html' ); -$tlCfg->reports_list['results_requirements'] = array( - 'title' => 'link_report_reqs_coverage', - 'url' => 'lib/results/resultsReqs.php', - 'enabled' => 'req', - 'directLink' => '', - 'format' => 'format_html' +$tlCfg->reports_list['results_requirements'] = array( + 'title' => 'link_report_reqs_coverage', + 'url' => 'lib/results/resultsReqs.php', + 'enabled' => 'req', + 'directLink' => '', + 'format' => 'format_html' ); - -// disabled TICKET 37006 - disabled uncovered_testcases report -//$tlCfg->reports_list['uncovered_testcases'] = array( -// 'title' => 'link_report_uncovered_testcases', -// 'url' => 'lib/results/uncoveredTestCases.php', -// 'enabled' => 'req', -// 'format' => 'format_html' -//); - -$tlCfg->reports_list['list_problems'] = array( - 'title' => 'link_report_total_bugs', - 'url' => 'lib/results/resultsBugs.php?type=0', - 'enabled' => 'bts', - 'directLink' => '', - 'format' => 'format_html' +// disabled TICKET 37006 - disabled uncovered_testcases report +// $tlCfg->reports_list['uncovered_testcases'] = array( +// 'title' => 'link_report_uncovered_testcases', +// 'url' => 'lib/results/uncoveredTestCases.php', +// 'enabled' => 'req', +// 'format' => 'format_html' +// ); + +$tlCfg->reports_list['list_problems'] = array( + 'title' => 'link_report_total_bugs', + 'url' => 'lib/results/resultsBugs.php?type=0', + 'enabled' => 'bts', + 'directLink' => '', + 'format' => 'format_html' ); -$tlCfg->reports_list['issues_all_exec'] = array( - 'title' => 'link_report_total_bugs_all_exec', - 'url' => 'lib/results/resultsBugs.php?type=1', - 'enabled' => 'bts', - 'directLink' => '', - 'format' => 'format_html' +$tlCfg->reports_list['issues_all_exec'] = array( + 'title' => 'link_report_total_bugs_all_exec', + 'url' => 'lib/results/resultsBugs.php?type=1', + 'enabled' => 'bts', + 'directLink' => '', + 'format' => 'format_html' ); -$tlCfg->reports_list['tcases_with_cf'] = array( - 'title' => 'link_report_tcases_with_cf', - 'url' => 'lib/results/testCasesWithCF.php', - 'enabled' => 'all', 'directLink' => '', - 'format' => 'format_html' +$tlCfg->reports_list['tcases_with_cf'] = array( + 'title' => 'link_report_tcases_with_cf', + 'url' => 'lib/results/testCasesWithCF.php', + 'enabled' => 'all', + 'directLink' => '', + 'format' => 'format_html' ); -$tlCfg->reports_list['tplan_with_cf'] = array( - 'title' => 'link_report_tplans_with_cf', - 'url' => 'lib/results/testPlanWithCF.php', - 'enabled' => 'all', 'directLink' => '', - 'format' => 'format_html' +$tlCfg->reports_list['tplan_with_cf'] = array( + 'title' => 'link_report_tplans_with_cf', + 'url' => 'lib/results/testPlanWithCF.php', + 'enabled' => 'all', + 'directLink' => '', + 'format' => 'format_html' ); -$tlCfg->reports_list['free_tcases'] = array( -'title' => 'link_report_free_testcases_on_testproject', -'url' => 'lib/results/freeTestCases.php', -'enabled' => 'all', 'directLink' => '', -'format' => 'format_html' +$tlCfg->reports_list['free_tcases'] = array( + 'title' => 'link_report_free_testcases_on_testproject', + 'url' => 'lib/results/freeTestCases.php', + 'enabled' => 'all', + 'directLink' => '', + 'format' => 'format_html' ); $report = 'report_exec_timeline'; -$tlCfg->reports_list[$report] = array( - 'title' => 'link_report_exec_timeline', - 'url' => 'lib/results/execTimelineStats.php', - 'enabled' => 'all', - 'directLink' => - '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0' . - '&type=' . $report, - 'format' => 'format_html' +$tlCfg->reports_list[$report] = array( + 'title' => 'link_report_exec_timeline', + 'url' => 'lib/results/execTimelineStats.php', + 'enabled' => 'all', + 'directLink' => '%slnl.php?apikey=%s&tproject_id=%s&tplan_id=%s&format=0' . + '&type=' . $report, + 'format' => 'format_html' ); - - - // Add custom configuration clearstatcache(); $f2inc = TL_ABS_PATH . 'cfg/custom_reports.cfg.php'; -if ( file_exists($f2inc) ) { - require_once($f2inc); +if (file_exists($f2inc)) { + require_once $f2inc; } diff --git a/cfg/userRightMatrix.php b/cfg/userRightMatrix.php index a522175057..ece058a5d9 100644 --- a/cfg/userRightMatrix.php +++ b/cfg/userRightMatrix.php @@ -1,82 +1,148 @@ - array ("user_role_assignment",)); -$proj_admin=array("$proj_admin_url/projectEdit.php" => array("mgt_modify_product",)); -$test_exec=array("$test_exec_url/execnavigator.php" => array("testplan_execute",)); - - -$tplan_admin= array("$tplan_admin_url/planupdatetc.php" => array("testplan_planning",), - "$tplan_admin_url/planaddtc.php" => array("testplan_planning",), - "$tplan_admin_url/planaddtcnavigator.php" => array("testplan_planning",), - "$tplan_admin_url/planedit.php" => array("testplan_planning",), - "$tplan_admin_url/plannew.php" => array("testplan_planning",), - "$tplan_admin_url/planpriority.php" => array("testplan_planning",), - "$tplan_admin_url/planupdatetc.php" => array("testplan_planning",), - "$tplan_admin_url/planmilestoneedit.php" => array("testplan_planning",), - "$tplan_admin_url/plantcnavigator.php" => array("testplan_planning",), - "$tplan_admin_url/plantcremove.php" => array("testplan_planning",)); - -$reports=array( "$reports_url/resultsallbuilds.php" => array("testplan_metrics",), - "$reports_url/resultsbugs.php" => array("testplan_metrics",), - "$reports_url/resultsbuild.php" => array("testplan_metrics",), - "$reports_url/resultsbystatus.php" => array("testplan_metrics",), - "$reports_url/resultsgeneral.php" => array("testplan_metrics",), - "$reports_url/resultsnavigator.php" => array("testplan_metrics",), - "$reports_url/resultssend.php" => array("testplan_metrics",), - "$reports_url/resultstc.php" => array("testplan_metrics",)); - - -$tc_admin=array("$tc_admin_url/containeredit.php" => array("mgt_modify_tc","mgt_view_tc",), - "$tc_admin_url/tcedit.php" => array("mgt_modify_tc","mgt_view_tc",), - "$tc_admin_url/tcimport.php" => array("mgt_modify_tc","mgt_view_tc",), - "$tc_admin_url/searchform.php" => null, - "$tc_admin_url/searchdata.php" => null, - "$tc_admin_url/listtestcases.php" => null); - - -$print_data=array("$print_url/printdata.php" => null, - "$print_url/selectdata.php" => null); - - - -$cf_admin=array("$cf_admin_url/cfieldsEdit.php" => array("cfield_management",), - "$cf_admin_url/cfieldsView.php" => array("cfield_view",), - "$cf_admin_url/cfieldsTProjectAssign.php" => array("cfield_management",)); - - -// build rigth matrix -$g_userRights=$user_admin+$proj_admin+$test_exec+$print_data+ - $tplan_admin+$reports+$tc_admin+$cf_admin; \ No newline at end of file + array( + "user_role_assignment" + ) +); +$proj_admin = array( + "$proj_admin_url/projectEdit.php" => array( + "mgt_modify_product" + ) +); +$test_exec = array( + "$test_exec_url/execnavigator.php" => array( + "testplan_execute" + ) +); + +$tplan_admin = array( + "$tplan_admin_url/planupdatetc.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planaddtc.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planaddtcnavigator.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planedit.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/plannew.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planpriority.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planupdatetc.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/planmilestoneedit.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/plantcnavigator.php" => array( + "testplan_planning" + ), + "$tplan_admin_url/plantcremove.php" => array( + "testplan_planning" + ) +); + +$reports = array( + "$reports_url/resultsallbuilds.php" => array( + "testplan_metrics" + ), + "$reports_url/resultsbugs.php" => array( + "testplan_metrics" + ), + "$reports_url/resultsbuild.php" => array( + "testplan_metrics" + ), + "$reports_url/resultsbystatus.php" => array( + "testplan_metrics" + ), + "$reports_url/resultsgeneral.php" => array( + "testplan_metrics" + ), + "$reports_url/resultsnavigator.php" => array( + "testplan_metrics" + ), + "$reports_url/resultssend.php" => array( + "testplan_metrics" + ), + "$reports_url/resultstc.php" => array( + "testplan_metrics" + ) +); + +$tc_admin = array( + "$tc_admin_url/containeredit.php" => array( + "mgt_modify_tc", + "mgt_view_tc" + ), + "$tc_admin_url/tcedit.php" => array( + "mgt_modify_tc", + "mgt_view_tc" + ), + "$tc_admin_url/tcimport.php" => array( + "mgt_modify_tc", + "mgt_view_tc" + ), + "$tc_admin_url/searchform.php" => null, + "$tc_admin_url/searchdata.php" => null, + "$tc_admin_url/listtestcases.php" => null +); + +$print_data = array( + "$print_url/printdata.php" => null, + "$print_url/selectdata.php" => null +); + +$cf_admin = array( + "$cf_admin_url/cfieldsEdit.php" => array( + "cfield_management" + ), + "$cf_admin_url/cfieldsView.php" => array( + "cfield_view" + ), + "$cf_admin_url/cfieldsTProjectAssign.php" => array( + "cfield_management" + ) +); + +// build rigth matrix +$g_userRights = $user_admin + $proj_admin + $test_exec + $print_data + + $tplan_admin + $reports + $tc_admin + $cf_admin; diff --git a/composer.json b/composer.json index 5eee6b07ad..e4a30fdf15 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,27 @@ { - "config": { - "platform": { - "php": "7.4.2" - } - }, - "require": { - "php-http/guzzle6-adapter": "^1.0", - "slim/slim": "4.*", - "slim/psr7": "^0.6.0", - "nyholm/psr7": "^1.2", - "nyholm/psr7-server": "^0.4.1", - "guzzlehttp/psr7": "^1.6", - "http-interop/http-factory-guzzle": "^1.0", - "laminas/laminas-diactoros": "^2.2", - "adodb/adodb-php": "^5.22", - "phpmailer/phpmailer": "^6.1", - "smarty/smarty": "^3.1", - "psr/log": "^1.1", - "symfony/polyfill-mbstring": "^1.15", - "league/oauth2-client": "^2.4", - "omines/oauth2-gitlab": "^3.2", - "league/oauth2-github": "^2.0", - "league/oauth2-google": "^3.0" - } -} + "config" : { + "platform" : { + "php" : "8.2.12" + } + }, + "require" : { + "php-http/guzzle6-adapter" : "~2.0", + "slim/slim" : "4.*", + "slim/psr7" : "~1.7", + "nyholm/psr7" : "~1.8", + "nyholm/psr7-server" : "~1.1", + "guzzlehttp/psr7" : "^1.6", + "http-interop/http-factory-guzzle" : "^1.0", + "laminas/laminas-diactoros" : "^2.2", + "adodb/adodb-php" : "^5.22", + "phpmailer/phpmailer" : "^6.1", + "smarty/smarty" : "^3.1", + "psr/log" : "^1.1", + "symfony/polyfill-mbstring" : "^1.15", + "league/oauth2-client" : "^2.4", + "omines/oauth2-gitlab" : "^3.2", + "league/oauth2-github" : "^2.0", + "league/oauth2-google" : "^3.0", + "wp-statistics/pchart" : "~1.2" + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index 5b8b3290a3..7dbf81a7dd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "786f230454d498ed4b76b7df82872843", + "content-hash": "ce9d3d6d1e7230d3e77d8e1477ed420a", "packages": [ { "name": "adodb/adodb-php", - "version": "v5.22.1", + "version": "v5.22.9", "source": { "type": "git", "url": "https://github.com/ADOdb/ADOdb.git", - "reference": "64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6" + "reference": "a568bfeb72d6b5942df747adc36b95165a083e60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6", - "reference": "64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/a568bfeb72d6b5942df747adc36b95165a083e60", + "reference": "a568bfeb72d6b5942df747adc36b95165a083e60", "shasum": "" }, "require": { @@ -65,24 +65,24 @@ "issues": "https://github.com/ADOdb/ADOdb/issues", "source": "https://github.com/ADOdb/ADOdb" }, - "time": "2022-03-30T08:49:08+00:00" + "time": "2025-05-01T11:49:24+00:00" }, { "name": "fig/http-message-util", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/php-fig/http-message-util.git", - "reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422" + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/3242caa9da7221a304b8f84eb9eaddae0a7cf422", - "reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "suggest": { "psr/http-message": "The package containing the PSR-7 interfaces" @@ -105,7 +105,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", @@ -117,28 +117,32 @@ "request", "response" ], - "time": "2020-02-05T20:36:27+00:00" + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, + "time": "2020-11-24T22:02:12+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.5.3", + "version": "6.5.8", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e" + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", + "guzzlehttp/psr7": "^1.9", "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.11" + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { "ext-curl": "*", @@ -155,22 +159,52 @@ } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", @@ -184,71 +218,117 @@ "rest", "web service" ], - "time": "2020-04-18T10:38:46+00:00" + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2022-06-20T22:16:07+00:00" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { @@ -261,37 +341,53 @@ }, "require-dev": { "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -306,32 +402,54 @@ "uri", "url" ], - "time": "2019-07-01T23:21:34+00:00" + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2023-04-17T16:00:37+00:00" }, { "name": "http-interop/http-factory-guzzle", - "version": "1.0.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/http-interop/http-factory-guzzle.git", - "reference": "34861658efb9899a6618cef03de46e2a52c80fc0" + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/34861658efb9899a6618cef03de46e2a52c80fc0", - "reference": "34861658efb9899a6618cef03de46e2a52c80fc0", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", "shasum": "" }, "require": { - "guzzlehttp/psr7": "^1.4.2", + "guzzlehttp/psr7": "^1.7||^2.0", + "php": ">=7.3", "psr/http-factory": "^1.0" }, "provide": { "psr/http-factory-implementation": "^1.0" }, "require-dev": { - "http-interop/http-factory-tests": "^0.5", - "phpunit/phpunit": "^6.5" + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" }, "type": "library", "autoload": { @@ -356,53 +474,55 @@ "psr-17", "psr-7" ], - "time": "2018-07-31T19:32:56+00:00" + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" + }, + "time": "2021-07-21T13:50:14+00:00" }, { "name": "laminas/laminas-diactoros", - "version": "2.2.3", + "version": "2.26.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "b596c7141f5093aefec94cb5e8745212299e290f" + "reference": "6584d44eb8e477e89d453313b858daac6183cddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/b596c7141f5093aefec94cb5e8745212299e290f", - "reference": "b596c7141f5093aefec94cb5e8745212299e290f", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6584d44eb8e477e89d453313b858daac6183cddc", + "reference": "6584d44eb8e477e89d453313b858daac6183cddc", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "conflict": { - "phpspec/prophecy": "<1.9.0" + "zendframework/zend-diactoros": "*" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" - }, "require-dev": { "ext-curl": "*", "ext-dom": "*", + "ext-gd": "*", "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.5.0", - "laminas/laminas-coding-standard": "~1.0.0", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5.18" + "http-interop/http-factory-tests": "^0.9.0", + "laminas/laminas-coding-standard": "^2.5", + "php-http/psr7-integration-tests": "^1.2", + "phpunit/phpunit": "^9.5.28", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.6" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev", - "dev-develop": "2.2.x-dev", - "dev-release-1.8": "1.8.x-dev" + "laminas": { + "module": "Laminas\\Diactoros", + "config-provider": "Laminas\\Diactoros\\ConfigProvider" } }, "autoload": { @@ -438,94 +558,51 @@ "http", "laminas", "psr", + "psr-17", "psr-7" ], - "time": "2020-03-29T12:30:54+00:00" - }, - { - "name": "laminas/laminas-zendframework-bridge", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9", - "reference": "bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1", - "squizlabs/php_codesniffer": "^3.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev", - "dev-develop": "1.1.x-dev" - }, - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diactoros/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "keywords": [ - "ZendFramework", - "autoloading", - "laminas", - "zf" ], - "time": "2020-04-03T16:01:00+00:00" + "time": "2023-10-29T16:17:44+00:00" }, { "name": "league/oauth2-client", - "version": "2.4.1", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "cc114abc622a53af969e8664722e84ca36257530" + "reference": "9df2924ca644736c835fc60466a3a60390d334f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/cc114abc622a53af969e8664722e84ca36257530", - "reference": "cc114abc622a53af969e8664722e84ca36257530", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/9df2924ca644736c835fc60466a3a60390d334f9", + "reference": "9df2924ca644736c835fc60466a3a60390d334f9", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "paragonie/random_compat": "^1|^2|^9.99", - "php": "^5.6|^7.0" + "ext-json": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "php": "^7.1 || >=8.0.0 <8.5.0" }, "require-dev": { - "eloquent/liberator": "^2.0", - "eloquent/phony-phpunit": "^1.0|^3.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phpunit/phpunit": "^5.7|^6.0", - "squizlabs/php_codesniffer": "^2.3|^3.0" + "mockery/mockery": "^1.3.5", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, "autoload": { "psr-4": { "League\\OAuth2\\Client\\": "src/" @@ -559,7 +636,11 @@ "oauth2", "single sign on" ], - "time": "2018-11-22T18:33:57+00:00" + "support": { + "issues": "https://github.com/thephpleague/oauth2-client/issues", + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.1" + }, + "time": "2025-02-26T04:37:30+00:00" }, { "name": "league/oauth2-github", @@ -614,20 +695,24 @@ "oauth", "oauth2" ], + "support": { + "issues": "https://github.com/thephpleague/oauth2-github/issues", + "source": "https://github.com/thephpleague/oauth2-github/tree/master" + }, "time": "2017-01-26T01:14:51+00:00" }, { "name": "league/oauth2-google", - "version": "3.0.2", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-google.git", - "reference": "cfe9b0ae69eb5dbac64a282f04410b731f6b9c04" + "reference": "6b79441f244040760bed5fdcd092a2bda7cf34c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-google/zipball/cfe9b0ae69eb5dbac64a282f04410b731f6b9c04", - "reference": "cfe9b0ae69eb5dbac64a282f04410b731f6b9c04", + "url": "https://api.github.com/repos/thephpleague/oauth2-google/zipball/6b79441f244040760bed5fdcd092a2bda7cf34c6", + "reference": "6b79441f244040760bed5fdcd092a2bda7cf34c6", "shasum": "" }, "require": { @@ -665,7 +750,11 @@ "oauth", "oauth2" ], - "time": "2019-11-16T14:11:06+00:00" + "support": { + "issues": "https://github.com/thephpleague/oauth2-google/issues", + "source": "https://github.com/thephpleague/oauth2-google/tree/3.0.4" + }, + "time": "2021-01-27T16:09:03+00:00" }, { "name": "nikic/fast-route", @@ -689,12 +778,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, "files": [ "src/functions.php" - ] + ], + "psr-4": { + "FastRoute\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -711,41 +800,47 @@ "router", "routing" ], + "support": { + "issues": "https://github.com/nikic/FastRoute/issues", + "source": "https://github.com/nikic/FastRoute/tree/master" + }, "time": "2018-02-13T20:26:39+00:00" }, { "name": "nyholm/psr7", - "version": "1.2.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c" + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/55ff6b76573f5b242554c9775792bd59fb52e11c", - "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", "shasum": "" }, "require": { - "php": "^7.1", - "php-http/message-factory": "^1.0", + "php": ">=7.2", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { + "php-http/message-factory-implementation": "1.0", "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "http-interop/http-factory-tests": "dev-master", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^7.5" + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -768,36 +863,50 @@ } ], "description": "A fast PHP7 implementation of PSR-7", - "homepage": "http://tnyholm.se", + "homepage": "https://tnyholm.se", "keywords": [ "psr-17", "psr-7" ], - "time": "2019-09-05T13:24:16+00:00" + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" }, { "name": "nyholm/psr7-server", - "version": "0.4.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7-server.git", - "reference": "e6a526e9170e6e33a13efc2b61703ca476b7ea68" + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/e6a526e9170e6e33a13efc2b61703ca476b7ea68", - "reference": "e6a526e9170e6e33a13efc2b61703ca476b7ea68", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { "nyholm/nsa": "^1.1", - "nyholm/psr7": "^1.0", - "phpunit/phpunit": "^7.0" + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" }, "type": "library", "autoload": { @@ -825,35 +934,53 @@ "psr-17", "psr-7" ], - "time": "2019-11-05T20:36:33+00:00" + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2023-11-08T09:30:43+00:00" }, { "name": "omines/oauth2-gitlab", - "version": "3.2.0", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/omines/oauth2-gitlab.git", - "reference": "2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a" + "reference": "5d8afd581c3d40dc469d03fa42965c449e95de9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a", - "reference": "2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a", + "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/5d8afd581c3d40dc469d03fa42965c449e95de9a", + "reference": "5d8afd581c3d40dc469d03fa42965c449e95de9a", "shasum": "" }, "require": { - "league/oauth2-client": "^2.2", - "php": ">=7.2" - }, - "conflict": { - "league/oauth2-client": "2.4.0" + "league/oauth2-client": "^2.4.1", + "php": ">=8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "m4tthumphrey/php-gitlab-api": "^9.0.0", - "mockery/mockery": "^1.0", - "php-http/guzzle6-adapter": "^2.0.1", - "phpunit/phpunit": "^8.0|^9.0" + "friendsofphp/php-cs-fixer": "^3.37.1", + "guzzlehttp/psr7": "^2.6.1", + "http-interop/http-factory-guzzle": "^1.2", + "infection/infection": "^0.27.7", + "m4tthumphrey/php-gitlab-api": "^11.12", + "mockery/mockery": "^1.6.6", + "php-http/guzzle7-adapter": "^1.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.41", + "phpstan/phpstan-mockery": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.15", + "phpunit/phpunit": "^10.4.2" }, "suggest": { "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token" @@ -889,84 +1016,46 @@ "oauth", "oauth2" ], - "time": "2020-02-10T10:37:24+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v9.99.99", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "shasum": "" - }, - "require": { - "php": "^7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "support": { + "issues": "https://github.com/omines/oauth2-gitlab/issues", + "source": "https://github.com/omines/oauth2-gitlab/tree/3.6.0" }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "time": "2018-07-02T15:55:56+00:00" + "time": "2023-11-06T21:46:04+00:00" }, { "name": "php-http/guzzle6-adapter", - "version": "v1.1.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/9d1a45eb1c59f12574552e81fb295e9e53430a56", + "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "php-http/httplug": "^1.0" + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" }, "provide": { "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" }, "require-dev": { "ext-curl": "*", - "php-http/adapter-integration-tests": "^0.4" + "php-http/client-integration-tests": "^2.0 || ^3.0", + "phpunit/phpunit": "^7.4 || ^8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -979,13 +1068,13 @@ "MIT" ], "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, { "name": "David de Boer", "email": "david@ddeboer.nl" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" } ], "description": "Guzzle 6 HTTP Adapter", @@ -994,37 +1083,38 @@ "Guzzle", "http" ], - "time": "2016-05-10T06:13:32+00:00" + "support": { + "issues": "https://github.com/php-http/guzzle6-adapter/issues", + "source": "https://github.com/php-http/guzzle6-adapter/tree/v2.0.2" + }, + "abandoned": "guzzlehttp/guzzle or php-http/guzzle7-adapter", + "time": "2021-03-02T10:52:33+00:00" }, { "name": "php-http/httplug", - "version": "v1.1.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { - "php": ">=5.4", - "php-http/promise": "^1.0", - "psr/http-message": "^1.0" + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { "Http\\Client\\": "src/" @@ -1041,7 +1131,8 @@ }, { "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "HTTPlug, the HTTP client abstraction for PHP", @@ -1050,82 +1141,34 @@ "client", "http" ], - "time": "2016-08-31T08:30:17+00:00" - }, - { - "name": "php-http/message-factory", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "time": "2015-12-19T14:08:53+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { "name": "php-http/promise", - "version": "v1.0.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, + "require": { + "php": "^7.1 || ^8.0" + }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { "Http\\Promise\\": "src/" @@ -1136,13 +1179,13 @@ "MIT" ], "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, { "name": "Joel Wurtz", "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" } ], "description": "Promise used for asynchronous HTTP requests", @@ -1150,39 +1193,52 @@ "keywords": [ "promise" ], - "time": "2016-01-26T13:27:02+00:00" + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" + }, + "time": "2024-03-15T13:55:21+00:00" }, { "name": "phpmailer/phpmailer", - "version": "v6.1.5", + "version": "v6.10.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a8bf068f64a580302026e484ee29511f661b2ad3" + "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3", - "reference": "a8bf068f64a580302026e484ee29511f661b2ad3", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", + "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", "shasum": "" }, "require": { "ext-ctype": "*", "ext-filter": "*", + "ext-hash": "*", "php": ">=5.5.0" }, "require-dev": { - "doctrine/annotations": "^1.2", - "friendsofphp/php-cs-fixer": "^2.2", - "phpunit/phpunit": "^4.8 || ^5.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.2", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "ext-mbstring": "Needed to send email in multibyte encoding charset", + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { @@ -1212,29 +1268,39 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2020-03-14T14:23:48+00:00" + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "time": "2025-04-24T15:19:31+00:00" }, { "name": "psr/container", - "version": "1.0.0", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1249,7 +1315,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1261,25 +1327,81 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1299,10 +1421,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1313,29 +1435,32 @@ "request", "response" ], - "time": "2019-04-30T12:38:16+00:00" + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1363,25 +1488,28 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "support": { + "source": "https://github.com/php-fig/http-message/tree/1.1" + }, + "time": "2023-04-04T09:50:52+00:00" }, { "name": "psr/http-server-handler", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", "extra": { @@ -1401,7 +1529,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side request handler", @@ -1416,25 +1544,28 @@ "response", "server" ], - "time": "2018-10-30T16:46:14+00:00" + "support": { + "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" + }, + "time": "2023-04-10T20:06:20+00:00" }, { "name": "psr/http-server-middleware", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "type": "library", @@ -1455,7 +1586,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side middleware", @@ -1469,20 +1600,24 @@ "request", "response" ], - "time": "2018-10-30T17:12:04+00:00" + "support": { + "issues": "https://github.com/php-fig/http-server-middleware/issues", + "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" + }, + "time": "2023-04-11T06:14:47+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -1506,7 +1641,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1516,7 +1651,10 @@ "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" }, { "name": "ralouphie/getallheaders", @@ -1556,39 +1694,48 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { "name": "slim/psr7", - "version": "0.6", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/slimphp/Slim-Psr7.git", - "reference": "23015a8814382c244315602d44cb02d412b6b059" + "reference": "fe98653e7983010aa85c1d137c9b9ad5a1cd187d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/23015a8814382c244315602d44cb02d412b6b059", - "reference": "23015a8814382c244315602d44cb02d412b6b059", + "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/fe98653e7983010aa85c1d137c9b9ad5a1cd187d", + "reference": "fe98653e7983010aa85c1d137c9b9ad5a1cd187d", "shasum": "" }, "require": { - "fig/http-message-util": "^1.1.2", - "php": "^7.1", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3" + "fig/http-message-util": "^1.1.5", + "php": "^8.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.0 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/polyfill-php80": "^1.29" }, "provide": { - "psr/http-message-implementation": "1.0" + "psr/http-factory-implementation": "^1.0", + "psr/http-message-implementation": "^1.0 || ^2.0" }, "require-dev": { + "adriansuter/php-autoload-override": "^1.4", "ext-json": "*", - "http-interop/http-factory-tests": "^0.6.0", - "php-http/psr7-integration-tests": "dev-master", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.0|^7.0", - "squizlabs/php_codesniffer": "^3.3" + "http-interop/http-factory-tests": "^1.0 || ^2.0", + "php-http/psr7-integration-tests": "^1.4", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.2", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.6 || ^10", + "squizlabs/php_codesniffer": "^3.10" }, "type": "library", "autoload": { @@ -1604,22 +1751,22 @@ { "name": "Josh Lockhart", "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" + "homepage": "https://joshlockhart.com" }, { "name": "Andrew Smith", "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" + "homepage": "https://silentworks.co.uk" }, { "name": "Rob Allen", "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" + "homepage": "https://akrabat.com" }, { "name": "Pierre Berube", "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" + "homepage": "https://www.lgse.com" } ], "description": "Strict PSR-7 implementation", @@ -1629,47 +1776,54 @@ "psr-7", "psr7" ], - "time": "2019-10-05T20:27:07+00:00" + "support": { + "issues": "https://github.com/slimphp/Slim-Psr7/issues", + "source": "https://github.com/slimphp/Slim-Psr7/tree/1.7.1" + }, + "time": "2025-05-13T14:24:12+00:00" }, { "name": "slim/slim", - "version": "4.5.0", + "version": "4.14.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "5613cbb521081ed676d5d7eb3e44f2b80a818c24" + "reference": "5943393b88716eb9e82c4161caa956af63423913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/5613cbb521081ed676d5d7eb3e44f2b80a818c24", - "reference": "5613cbb521081ed676d5d7eb3e44f2b80a818c24", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/5943393b88716eb9e82c4161caa956af63423913", + "reference": "5943393b88716eb9e82c4161caa956af63423913", "shasum": "" }, "require": { "ext-json": "*", "nikic/fast-route": "^1.3", - "php": "^7.2", - "psr/container": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.1 || ^2.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "require-dev": { - "adriansuter/php-autoload-override": "^1.0", + "adriansuter/php-autoload-override": "^1.4", "ext-simplexml": "*", - "guzzlehttp/psr7": "^1.5", - "http-interop/http-factory-guzzle": "^1.0", - "laminas/laminas-diactoros": "^2.1", - "nyholm/psr7": "^1.1", - "nyholm/psr7-server": "^0.3.0", - "phpspec/prophecy": "^1.10", - "phpstan/phpstan": "^0.11.5", - "phpunit/phpunit": "^8.5", - "slim/http": "^1.0", - "slim/psr7": "^1.0", - "squizlabs/php_codesniffer": "^3.5" + "guzzlehttp/psr7": "^2.6", + "httpsoft/http-message": "^1.1", + "httpsoft/http-server-request": "^1.1", + "laminas/laminas-diactoros": "^2.17 || ^3", + "nyholm/psr7": "^1.8", + "nyholm/psr7-server": "^1.1", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^9.6", + "slim/http": "^1.3", + "slim/psr7": "^1.6", + "squizlabs/php_codesniffer": "^3.10", + "vimeo/psalm": "^5.24" }, "suggest": { "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", @@ -1722,27 +1876,47 @@ "micro", "router" ], - "time": "2020-04-14T20:49:48+00:00" + "support": { + "docs": "https://www.slimframework.com/docs/v4/", + "forum": "https://discourse.slimframework.com/", + "irc": "irc://irc.freenode.net:6667/slimphp", + "issues": "https://github.com/slimphp/Slim/issues", + "rss": "https://www.slimframework.com/blog/feed.rss", + "slack": "https://slimphp.slack.com/", + "source": "https://github.com/slimphp/Slim", + "wiki": "https://github.com/slimphp/Slim/wiki" + }, + "funding": [ + { + "url": "https://opencollective.com/slimphp", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slim/slim", + "type": "tidelift" + } + ], + "time": "2024-06-13T08:54:48+00:00" }, { "name": "smarty/smarty", - "version": "v3.1.36", + "version": "v3.1.46", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451" + "reference": "b3ade90dece67812410954528e0039fb5b73bcf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/fd148f7ade295014fff77f89ee3d5b20d9d55451", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/b3ade90dece67812410954528e0039fb5b73bcf7", + "reference": "b3ade90dece67812410954528e0039fb5b73bcf7", "shasum": "" }, "require": { "php": ">=5.2" }, "require-dev": { - "phpunit/phpunit": "6.4.1", + "phpunit/phpunit": "^7.5 || ^6.5 || ^5.7 || ^4.8", "smarty/smarty-lexer": "^3.1" }, "type": "library", @@ -1779,43 +1953,49 @@ "keywords": [ "templating" ], - "time": "2020-04-14T14:44:26+00:00" + "support": { + "forum": "http://www.smarty.net/forums/", + "irc": "irc://irc.freenode.org/smarty", + "issues": "https://github.com/smarty-php/smarty/issues", + "source": "https://github.com/smarty-php/smarty/tree/v3.1.46" + }, + "time": "2022-08-01T21:58:13+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.15.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf" + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1826,6 +2006,10 @@ "name": "Laurent Bassin", "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -1841,41 +2025,144 @@ "portable", "shim" ], - "time": "2020-03-09T19:04:49+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-10T14:38:51+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.15.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1900,37 +2187,58 @@ "portable", "shim" ], - "time": "2020-03-09T19:04:49+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" }, { - "name": "symfony/polyfill-php72", - "version": "v1.15.0", + "name": "symfony/polyfill-php80", + "version": "v1.32.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "37b0976c78b94856543260ce09b460a7bc852747" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747", - "reference": "37b0976c78b94856543260ce09b460a7bc852747", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1938,6 +2246,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -1947,7 +2259,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -1955,19 +2267,77 @@ "portable", "shim" ], - "time": "2020-02-27T09:26:54+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" + }, + { + "name": "wp-statistics/pchart", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/wp-statistics/pchart.git", + "reference": "721d03460b66de3d52a890c65e7d5cbf3a656059" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-statistics/pchart/zipball/721d03460b66de3d52a890c65e7d5cbf3a656059", + "reference": "721d03460b66de3d52a890c65e7d5cbf3a656059", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "pChart": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mostafa Soufi", + "email": "mostafa.soufi@hotmail.com" + } + ], + "description": "A PHP Class to build Charts", + "support": { + "issues": "https://github.com/wp-statistics/pchart/issues", + "source": "https://github.com/wp-statistics/pchart/tree/1.2.3" + }, + "abandoned": true, + "time": "2022-11-14T13:06:09+00:00" } ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "platform-overrides": { - "php": "7.4.2" + "php": "8.2.12" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/composer.phar b/composer.phar index 71993641d8..bb6ba648b0 100644 Binary files a/composer.phar and b/composer.phar differ diff --git a/config.inc.php b/config.inc.php index 008e65c755..c19b884ef3 100644 --- a/config.inc.php +++ b/config.inc.php @@ -1,2248 +1,2309 @@ -api = new stdClass(); -$tlCfg->cookie = new stdClass(); -$tlCfg->document_generator = new stdClass(); - -$tlCfg->spec_cfg = new stdClass(); - -$tlCfg->exec_cfg = new stdClass(); -$tlCfg->exec_cfg->view_mode = new stdClass(); -$tlCfg->exec_cfg->exec_mode = new stdClass(); - - -$tlCfg->UDFStripHTMLTags = true; - -// allow to define additional execution types other than -// defined in testcase.class.php -// array(code => lblkey) -// code int value > latest standard execution code defined. -// lblkey => key to be used on lang_get() call. -// -$tlCfg->custom_execution_types = null; - -$tlCfg->gui = new stdClass(); -$tlCfg->gui->custom_fields = new stdClass(); -$tlCfg->testcase_cfg = new stdClass(); -$tlCfg->req_cfg = new stdClass(); -$tlCfg->validation_cfg = new stdClass(); -$tlCfg->custom_fields = new stdClass(); -$tlCfg->req_spec_cfg = new stdClass(); -$tlCfg->diffEngine = new stdClass(); -$tlCfg->tplanDesign = new stdClass(); - -$tlCfg->notifications = new stdClass(); -$tlCfg->proxy = new stdClass(); - -$tlCfg->reqTCLinks = new stdClass(); - - -$tlCfg->keywords = new stdClass(); - -$tlCfg->keywords->annotations = [ - "@TestCaseSpecDisplay:" -]; - - -$tlCfg->keywords->onDeleteCheckFrozenTCVersions = TRUE; -$tlCfg->keywords->onDeleteCheckExecutedTCVersions = TRUE; - -// main key testproject PREFIX -// element array -// 'addTCLinkIntoITS' true => add note to Issue Tracker to issue with -// ISSUE ID similar to the KEYWORD (see kwPrefix below) -// -// 'kwPrefix' to remove from keyword to create the ISSUE ID -// -$tlCfg->keywords->byTestProject = array(); - -$tlCfg->keywords->headsUpTSuiteOnExec = 'CMD_OPEN_ON_EXEC'; - -$tlCfg->accessWithoutLogin = array(); - - -$tlCfg->platforms = new stdClass(); -$tlCfg->platforms->allowedOnAssign = [ - 'enable_on_design' => false, - 'enable_on_execution' => true, - 'is_open' => true -]; - - - -/** @uses database access definition (generated automatically by TL installer) */ -@include_once('config_db.inc.php'); -if( !defined('DB_TABLE_PREFIX') ) { - define('DB_TABLE_PREFIX','' ); -} - -/** The root dir for the testlink installation with trailing slash */ -define('TL_ABS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR); - -/** Just for documentation */ -$tlCfg->testlinkdotorg = 'http://www.testlink.org'; - -/** GUI themes (base for CSS and images)- modify if you create own one */ -$tlCfg->theme_dir = 'gui/themes/default/'; - -/** Dir for compiled templates */ -$tlCfg->temp_dir = TL_ABS_PATH . 'gui' . DIRECTORY_SEPARATOR . - 'templates_c' . DIRECTORY_SEPARATOR; -if (($tpltmp = getenv('TESTLINK_TEMPLATES_C'))) { - $tlCfg->temp_dir = trim($tpltmp); -} - -/** default filenames of CSS files of current GUI theme */ -define('TL_CSS_MAIN', 'testlink.css'); -define('TL_CSS_PRINT', 'tl_print.css'); -define('TL_CSS_DOCUMENTS', 'tl_documents.css'); - -define('TL_THEME_BASE_DIR', $tlCfg->theme_dir); -define('TL_THEME_IMG_DIR', $tlCfg->theme_dir . 'images/'); -define('TL_THEME_CSS_DIR', $tlCfg->theme_dir . 'css/'); -define('TL_TESTLINK_CSS', TL_THEME_CSS_DIR . TL_CSS_MAIN); -define('TL_PRINT_CSS', TL_THEME_CSS_DIR . TL_CSS_PRINT); - -// name of your custom.css, place it in same folder that standard TL css -// null or '' => do not use -$tlCfg->custom_css = null; - - -/** Include constants and magic numbers (users should not change it)*/ -require_once(TL_ABS_PATH . 'cfg' . DIRECTORY_SEPARATOR . 'const.inc.php'); - - -// ---------------------------------------------------------------------------- -/** @var string used to have (when needed) a possibility to identify different TL instances - @since 1.9.4 used on mail subject when mail logger is used - */ -$tlCfg->instance_name = 'Main TestLink Instance'; - -// do not use blanks or special characters, use a short string -$tlCfg->instance_id = 'TLM'; - -$tlCfg->gui->ux = 'tl-classic'; - -/** - * Copied from MantisBT - * - * Prefix for all TestLink cookies - * This should be an identifier which does not include spaces or periods, - * and should be unique per TestLink installation, especially if - * $tlCfg->cookie_path is not restricting the cookies' scope to the actual - * TestLink directory. - * @see $tlCfg->cookie->path - * @global string $tlCfg->cookie->prefix - */ -$tlCfg->cookie->prefix = 'TESTLINK1920'; - -/** - * @link http://php.net/function.setcookie - * - */ -$tlCfg->cookie->expire = (time()+60*60*24*30); // 30 days; -$tlCfg->cookie->domain = ''; -$tlCfg->cookie->secure = false; -$tlCfg->cookie->httponly = false; - -$tlCfg->cookie->testProjectMemory = $tlCfg->cookie->prefix . - '_PROJ_ID_USER_ID_'; - -/** - * Copied from MantisBT - * - * Specifies the path under which a cookie is visible - * All scripts in this directory and its sub-directories will be able - * to access TestLink cookies. - * It is recommended to set this to the actual TestLink path. - * @link http://php.net/function.setcookie - * @global string $tlCfg->cookie->path - */ - $tlCfg->cookie->path = '/'; - - -/* [ROLE INHERITANCE] */ -/** - * possible values - * - * 'testproject' - * 'global' - * - * 'testproject' - * till a role is specifically assigned to test plan, test plan role - * will be inherited from test project role. - * - * IMPORTANT NOTICE - * test project role can be specifically assigned or inherited from - * user's global role. - * - * if test project specifically assigned role changes, and test plan role was inherited, then it will also changes, due to inheritance. - * - * - * 'global' - * till a role is specifically assigned to test plan, test plan role - * will be inherited from user's global role, and NOT from test project - * specifically assigned role. - * - * if test project specifically assigned role changes, will not be changed. - * - */ - $tlCfg->testplan_role_inheritance_mode = 'testproject'; - - -/* [LOCALIZATION] */ - -/** @var string Default localization for users */ -// The value must be available in $$tlCfg->locales (see cfg/const.inc.php). -// Note: An attempt will be done to establish the default locale -// automatically using $_SERVER['HTTP_ACCEPT_LANGUAGE'] -$tlCfg->default_language = 'en_GB'; - -/** - * @var string Charset 'UTF-8' is only officially supported charset (Require - * MySQL version >= 4.1) 'ISO-8859-1' or another Charset could be set for - * backward compatability by experienced users. However we have not resources - * to support such patches. - **/ -$tlCfg->charset = 'UTF-8'; - -/** - * @var string characters used to surround a description in the user interface - * (for example role) - **/ -$tlCfg->gui_separator_open = '['; -$tlCfg->gui_separator_close = ']'; -$tlCfg->gui_room = '[ %s ]'; - -/** @var string Title separators are used when componing an title using several strings */ -$tlCfg->gui_title_separator_1 = ' : '; // object : name (Test Specification : My best product) -$tlCfg->gui_title_separator_2 = ' - '; // parent - child - -/** - * @var string delimiter used to create DOC ID in this way: - * . g_testcase_cfg->glue_character . - * Could not be empty - */ -$tlCfg->testcase_cfg->glue_character = '-'; - - - -$tlCfg->testcase_cfg->import = new stdClass(); -$tlCfg->testcase_cfg->import->wordwrap = new stdClass(); - -/* 0 => do not apply wordwrap() */ -$tlCfg->testcase_cfg->import->wordwrap->summary = 0; -$tlCfg->testcase_cfg->import->wordwrap->preconditions = 0; -$tlCfg->testcase_cfg->import->wordwrap->actions = 0; -$tlCfg->testcase_cfg->import->wordwrap->expected_results = 0; - - -/** - * fonts set used to draw charts - **/ -$tlCfg->charts_font_path = TL_ABS_PATH . "third_party/pchart/Fonts/tahoma.ttf"; -/** - * font size used to draw charts - **/ -$tlCfg->charts_font_size = 8; - - -// ---------------------------------------------------------------------------- -/* [SERVER ENVIRONMENT] */ - - -/** - * TICKET 4969: Add Setting to Force HTTPS - */ -$tlCfg->force_https = false; - - -/** - * @var integer Set the session timeout for inactivity [minutes]. - * Default high value disables this feature. - */ -$tlCfg->sessionInactivityTimeout = 9900; - -/** - * Set the session timeout value (in minutes). - * This will prevent sessions timing out after very short periods of time - * Warning: your server could block this settings - **/ -//ini_set('session.cache_expire',900); - -/** - * Set the session garbage collection timeout value (in seconds) - * The default session garbage collection in php is set to 1440 seconds (24 minutes) - * If you want sessions to last longer this must be set to a higher value. - * You may need to set this in your global php.ini if the settings don't take effect. - */ -//ini_set('session.gc_maxlifetime', 60*90); - -$tlCfg->notifications->userSignUp = new stdClass(); -$tlCfg->notifications->userSignUp->enabled = TRUE; // @see notifyGlobalAdmins() -$tlCfg->notifications->userSignUp->to = new stdClass(); -$tlCfg->notifications->userSignUp->to->roles = array(TL_ROLES_ADMIN); -$tlCfg->notifications->userSignUp->to->users = null; // i.e. array('login01','login02'); - -// ---------------------------------------------------------------------------- -/* [LOGGING] */ - -/** Error reporting - do we want php errors to show up for users */ -/** configure on custom_config.inc.php */ -/** error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING); */ -/** error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); */ -error_reporting(E_ALL); - -/** @var string Default level of logging (NONE, ERROR, INFO, DEBUG, EXTENDED) - * is not used by tlLogger, we need to change this in future. - */ -$tlCfg->log_level = 'ERROR'; - -/** @var boolean show smarty debug window */ -$tlCfg->smarty_debug = false; - -/** - * @var string Path to store logs - - * for security reasons (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/) - * put it out of reach via web or configure access denied. - */ -$tlCfg->log_path = '/var/testlink/logs/'; /* unix example */ -if (($lp = getenv('TESTLINK_LOG_PATH'))) { - $tlCfg->log_path = trim($lp); -} - -/** - * @var string How to warning user when security weak points exists. - * - * 'SCREEN': messages will displayed on login screen, and tl desktop - * 'FILE': a file with a list is created but users are not notified via GUI - * user will receive a message on screen. (default) - * 'SILENT': same that FILE, but user will not receive message on screen. - */ -$tlCfg->config_check_warning_mode = 'FILE'; - -/** - * ONCE_FOR_SESSION - * ALWAYS - */ -$tlCfg->config_check_warning_frequence = 'ONCE_FOR_SESSION'; - -/** - * - */ -$tlCfg->userDocOnDesktop = OFF; - - -/** - * Configure if individual logging data stores are enabled of disabled - * Possibile values to identify loggers: 'db','file' - * $g_loggerCfg=null; all loggers enabled - * $g_loggerCfg['db']['enable']=true/false; - * $g_loggerCfg['file']['enable']=true/false; - * $g_loggerCfg['mail']['enable']=true/false; - */ -$g_loggerCfg = array('mail' => array('enable' => false)); - -/** @var integer All events older this value [days] are removed from the db, during login */ -$g_removeEventsOlderThan = 30; - - -/** @var map keys: 'all' + values present on proprety of logger class $loggerTypeDomain - * values can be only these defined on logger.class.php - * @since 1.9.4 - * example array('all' => array('INFO','AUDIT'), - * 'mail' => array('ERROR')) - * - * $tlCfg->loggerFilter = array('db' => array('DEBUG','AUDIT','WARNING','ERROR'), - * 'file' => array('NONE')); - * - */ -$tlCfg->loggerFilter = null; // default defined on logger.class.php ; - -// ---------------------------------------------------------------------------- -/* [SMTP] */ - -/** - * @var string SMTP server name or IP address ("localhost" should work in the most cases) - * Configure using custom_config.inc.php - * @uses lib/functions/email_api.php - */ -$g_smtp_host = '[smtp_host_not_configured]'; # SMTP server MUST BE configured - -# Configure using custom_config.inc.php -$g_tl_admin_email = '[testlink_sysadmin_email_not_configured]'; # for problem/error notification -$g_from_email = '[from_email_not_configured]'; # email sender -$g_return_path_email = '[return_path_email_not_configured]'; - -/** - * Email notification priority (low by default) - * Urgent = 1, Not Urgent = 5, Disable = 0 - **/ -$g_mail_priority = 5; - -/** - * Taken from mantis for phpmailer config - * select the method to mail by: - * PHPMAILER_METHOD_MAIL - mail() - * PHPMAILER_METHOD_SENDMAIL - sendmail - * PHPMAILER_METHOD_SMTP - SMTP - */ -$g_phpMailer_method = PHPMAILER_METHOD_SMTP; - -/** Configure only if SMTP server requires authentication */ -$g_smtp_username = ''; # user -$g_smtp_password = ''; # password - -/** - * This control the connection mode to SMTP server. - * Can be '', 'ssl','tls' - * @global string $g_smtp_connection_mode - */ -$g_smtp_connection_mode = ''; - -/** - * The smtp port to use. The typical SMTP ports are 25 and 587. The port to use - * will depend on the SMTP server configuration and hence others may be used. - * @global int $g_smtp_port - */ -$g_smtp_port = 25; - - -/** - * @see https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting - * Opportunistic TLS - */ -$g_SMTPAutoTLS = false; - -// ---------------------------------------------------------------------------- -/* [User Authentication] */ - -/** - * Login authentication method: - * 'MD5' => use password stored on db => will be deprecated and DB used. - * 'DB' => Same as MD5 use password stored on db - * 'LDAP' => use password from LDAP Server - */ -$tlCfg->authentication['domain'] = array('DB' => array('description' => 'DB', 'allowPasswordManagement' => true) , - 'LDAP' => array('description' => 'LDAP', 'allowPasswordManagement' => false) ); - -/* Default Authentication method */ -$tlCfg->authentication['method'] = 'DB'; - -// Applies only if authentication method is DB. -// Used when: -// 1. user sign up -// -// null => only check password IS NOT EMPTY -// -// $tlCfg->passwordChecks = array('minlen' => 8,'maxlen' => 20,'number' => true,'letter' => true, -// 'capital' => true, 'symbol' => true); -$tlCfg->passwordChecks = null; - -// Applies ONLY to the HTML input. -// If auth method is DB, password will be stored as MD5 HASH that requires 32 chars (128 bits) -$tlCfg->loginPagePasswordMaxLenght = 40; - -/** - * Standard logout url, used also when SSO is used and hint to skip SSO is used. - * '' => use standard TestLink page - */ -$tlCfg->logoutUrl = ''; - -// users that will not allow expiration date management on GUI -$tlCfg->noExpDateUsers = array('admin'); - - -/** - * OAUTH auth - * Configure this on custom_config.inc.php - */ - -$tlCfg->OAuthServers = array(); - -// Google -// see cfg/oauth_samples/oauth.google.inc.php - -// Github -// see cfg/oauth_samples/oauth.github.inc.php - -// Gitlab -// see cfg/oauth_samples/oauth.gitlab.inc.php - -// Microsoft -// see cfg/oauth_samples/oauth.microsoft.inc.php - -// Azure AD -// see cfg/oauth_samples/oauth.azuread.inc.php - -/** - * Single Sign On authentication - * - * SSO_method: CLIENT_CERTIFICATE, tested with Apache Webserver - * SSP_method: WEBSERVER_VAR, tested with Apache and Shibboleth Service Provider. - */ -$tlCfg->authentication['SSO_enabled'] = false; -$tlCfg->authentication['SSO_logout_destination'] = 'YOUR LOGOUT DESTINATION'; - -// Tested with Apache Webserver -//$tlCfg->authentication['SSO_method'] = 'CLIENT_CERTIFICATE'; -//$tlCfg->authentication['SSO_uid_field'] = 'SSL_CLIENT_S_DN_Email'; - -// Tested with Apache and Shibboleth Service Provider -//$tlCfg->authentication['SSO_method'] = 'WEBSERVER_VAR'; -//$tlCfg->authentication['SSO_uid_field'] = 'REMOTE_USER'; -//$tlCfg->authentication['SSO_user_target_dbfield'] = 'email'; - -// Allow to restrict authentication to SSO -$tlCfg->authentication['sso_only'] = false; - - -/** - * LDAP authentication credentials, Multiple LDAP Servers can be used. - * User will be authenticaded against each server (one after other using array index order) - * till authentication succeed or all servers have been used. - */ -$tlCfg->authentication['ldap'] = array(); -$tlCfg->authentication['ldap'][1]['ldap_server'] = 'localhost'; -$tlCfg->authentication['ldap'][1]['ldap_port'] = '389'; -$tlCfg->authentication['ldap'][1]['ldap_version'] = '3'; // could be '2' in some cases -$tlCfg->authentication['ldap'][1]['ldap_root_dn'] = 'dc=mycompany,dc=com'; -$tlCfg->authentication['ldap'][1]['ldap_bind_dn'] = ''; // Left empty for anonymous LDAP binding -$tlCfg->authentication['ldap'][1]['ldap_bind_passwd'] = ''; // Left empty for anonymous LDAP binding -$tlCfg->authentication['ldap'][1]['ldap_tls'] = false; // true -> use tls - -// Following configuration parameters are used to build -// ldap filter and ldap attributes used by ldap_search() -// -// filter => "(&$t_ldap_organization($t_ldap_uid_field=$t_username))"; -// attributess => array( $t_ldap_uid_field, 'dn' ); -// -// This can be used to manage situation like explained on post on forum: -// ActiveDirectory + users in AD group -// -$tlCfg->authentication['ldap'][1]['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)' -$tlCfg->authentication['ldap'][1]['ldap_uid_field'] = 'uid'; // Use 'sAMAccountName' for Active Directory - -// Configure following fields in custom_config.inc.php according your configuration -$tlCfg->authentication['ldap'][1]['ldap_email_field'] = 'mail'; -$tlCfg->authentication['ldap'][1]['ldap_firstname_field'] = 'givenname'; -$tlCfg->authentication['ldap'][1]['ldap_surname_field'] = 'sn'; - - -// Follows Mantisbt idea. -// True if user does not exist on DB, but can be get from LDAP, -// the user will be created AUTOMATICALLY with default user role. -// Create user with following data from LDAP -// mail -// name -// surname -$tlCfg->authentication['ldap_automatic_user_creation'] = false; - - -/** Enable/disable Users to create accounts on login page */ -$tlCfg->user_self_signup = TRUE; - -/** What happens when Administrator push the Reset Password Button - 'send_password_by_mail' - 'display_on_screen' -*/ -$tlCfg->password_reset_send_method = 'send_password_by_mail'; - -/** - * Validating new user login names - * Taken mantisbt version 1.2.5 - www.mantisbt.org and adapted - * - * The regular expression to use when validating new user login names - * The default regular expression allows a-z, A-Z, 0-9, +, -, dot, @ and underscore. - * For testing regular expressions, use http://rubular.com/. - * For regular expression to englihs, use http://xenon.stanford.edu/~xusch/regexp/analyzer.html - */ -$tlCfg->validation_cfg->user_login_valid_regex='/^([a-z\d\-.+_@]+(@[a-z\d\-.]+\.[a-z]{2,4})?)$/i'; - -/** - * Validating user email addresses - * Example of other possibilities: - * - * $regex = "/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*" . - * "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i"; - * $regex = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/"; - * - **/ -// -// This expression does not allow Top Level Domian (last part of domain name) longer than 4 -// If you need to change this -// Configure this on custom_config.inc.php -$tlCfg->validation_cfg->user_email_valid_regex_js = "/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,4}$/"; -$tlCfg->validation_cfg->user_email_valid_regex_php = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/U"; - - -// -------------------------------------------------------------------------------------- -/* [API] */ - -/** XML-RPC API availability - do less than promised ;) - FALSE => user are not able to generate and set his/her API key. - XML-RPC server do not check this config in order to answer or not a call. - */ - -$tlCfg->api->enabled = TRUE; - -// used to display API ID info in the *View pages -$tlCfg->api->id_format = "[ID: %s ]"; - - -// --------------------------------------------------------------------------------- -/* [GUI LAYOUT] */ - -/** Company logo (used by navigation bar and login page page) */ -$tlCfg->logo_login = 'tl-logo-transparent-25.png'; -$tlCfg->logo_navbar = 'tl-logo-transparent-12.5.png'; - -/** Height of the navbar always displayed */ -$tlCfg->navbar_height = 70; - -/** Login page could show an informational text */ -$tlCfg->login_info = ''; // Empty by default - - - -/** - * controls if pagination (via Javascript) will be enabled - */ -$tlCfg->gui->projectView = new stdClass(); -$tlCfg->gui->projectView->pagination = new stdClass(); -$tlCfg->gui->projectView->pagination->enabled = true; -$tlCfg->gui->projectView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; - -$tlCfg->gui->usersAssign = new stdClass(); -$tlCfg->gui->usersAssign->pagination = new stdClass(); -$tlCfg->gui->usersAssign->pagination->enabled = true; -$tlCfg->gui->usersAssign->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; - -$tlCfg->gui->planView = new stdClass(); -$tlCfg->gui->planView->pagination = new stdClass(); -$tlCfg->gui->planView->pagination->enabled = true; -$tlCfg->gui->planView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; -$tlCfg->gui->planView->itemQtyForTopButton = 10; - -$tlCfg->gui->buildView = new stdClass(); -$tlCfg->gui->buildView->pagination = new stdClass(); -$tlCfg->gui->buildView->pagination->enabled = true; -$tlCfg->gui->buildView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; -$tlCfg->gui->buildView->itemQtyForTopButton = 10; - -$tlCfg->gui->keywordsView = new stdClass(); -$tlCfg->gui->keywordsView->pagination = new stdClass(); -$tlCfg->gui->keywordsView->pagination->enabled = true; -$tlCfg->gui->keywordsView->pagination->length = '[40, 60, 80, -1], [40, 60, 80, "All"]'; -$tlCfg->gui->keywordsView->itemQtyForTopButton = 10; - - - -/** - * controls if operation area (buttons) starts open ('' or 'inline') or closed ('none') on: - * - test suite management - * - test case management - * - req. spec management - * - req. management - */ -$tlCfg->gui->op_area_display = new stdClass(); - -// test_spec_container => test project, test suite -$tlCfg->gui->op_area_display->test_spec_container = 'none'; // '' -$tlCfg->gui->op_area_display->test_case = 'none'; // 'inline' -$tlCfg->gui->op_area_display->req_spec_container = 'none'; // 'inline' -$tlCfg->gui->op_area_display->req = 'none'; // 'inline' - - - -/** - * @var string Availability of Test Project specific background colour - * 'background' -> standard behaviour for 1.6.x you can have a different - * background colour for every test project. - * 'none' -> new behaviour no background color change - */ -$tlCfg->gui->testproject_coloring = 'none'; // I'm sorry default is not coloring using coloring is a pain - // and useless -/** @TODO havlatm4francisco Ok, then merge these two attributes into one */ -/** default background color */ -$tlCfg->gui->background_color = '#9BD'; - -// ENABLED: on features that assign user role to test projects and test plan, colour user name -// according GLOBAL role -// DISABLED: do not color [STANDARD BEHAVIOUR] -$tlCfg->gui->usersAssignGlobalRoleColoring = DISABLED; - - -// Enable/disable rounded corners via javascript -$tlCfg->gui->round_corners = new stdClass(); -$tlCfg->gui->round_corners->exec_history = ENABLED; -$tlCfg->gui->round_corners->tc_title = ENABLED; -$tlCfg->gui->round_corners->tc_spec = ENABLED; - -/** - * Display name definition (used to build a human readable display name for users) - * Example of values: - * '%first% %last%' -> John Cook - * '%last%, %first%' -> Cook John - * '%first% %last% %login%' -> John Cook [ux555] - **/ -$tlCfg->username_format = '%login%'; - -/** Configure the frame frmWorkArea navigator width */ -$tlCfg->frame_workarea_default_width = "30%"; - -/** true => icon edit will be added into as indication an edit features */ -$tlCfg->gui->show_icon_edit = false; - -/** - * '' => test project name - * 'prefix' => prefix : test project name - * - * ATTENTION : * is used to indicate test project is INACTIVE - * see also $tlCfg->gui->tprojects_combo_order_by - */ -$tlCfg->gui->tprojects_combo_format = 'prefix'; - - -/** - * Order to use when building a testproject combobox (value must be SQL compliant) - * For example: - * 'ORDER BY name' - * 'ORDER_BY nodes_hierarchy.id DESC' -> similar effect to order last created firts - **/ -// $tlCfg->gui->tprojects_combo_order_by = 'ORDER BY nodes_hierarchy.id DESC'; -$tlCfg->gui->tprojects_combo_order_by = 'ORDER BY TPROJ.prefix ASC'; - - - -/** Configure the input size of test case search by id on navigation bar. - * This value will be added to the length of the prefix to dynamically set input size. - * Example: prefix is "projectA-" -> length of prefix is 9 - * Now the here defined value (default: 6) will be added to the prefix length - * -> Input field will have an input size of 15 - **/ -$tlCfg->gui->dynamic_quick_tcase_search_input_size = 6; - -// used to round percentages on metricsDashboard.php -$tlCfg->dashboard_precision = 2; - -/** - * Choose what kind of webeditor you want to use in every TL area. This configuration - * will be used if no element with search key (area) is found on this structure. - * Every element is a mp with this configuration keys: - * - * 'type': - * 'ckeditor' - * 'tinymce' ==> will be deprecated in future versions - * 'none' -> use plain text area input field - * 'toolbar': only applicable for type = 'fckeditor', 'ckeditor' - * name of ToolbarSet (See: http://docs.fckeditor.net/ for more information about ToolbarSets) - * TestLink stores own definitions in /cfg/tl_ckeditor_config.js - * - * - * The next keys/areas are supported: - * 'all' (default setting), - * 'design', 'steps_design', 'testplan', 'build', 'testproject', 'role', 'requirement', 'requirement_spec'. - * - * Examples: - * - * // Copy this to custom_config.inc.php if you want use 'tinymce' as default. - * $tlCfg->gui->text_editor['all'] = array( 'type' => 'tinymce'); - * // Copy this to custom_config.inc.php if you want use 'nome' as default. - * $tlCfg->gui->text_editor['all'] = array( 'type' => 'none'); - * //This configuration is useful only if default type is set to 'fckeditor' - * $tlCfg->gui->text_editor['design'] = array('toolbar' => 'tl_mini'); - * - * $tlCfg->gui->text_editor['testplan'] = array( 'type' => 'none'); - * $tlCfg->gui->text_editor['build'] = array( 'type' => 'fckeditor','toolbar' => 'tl_mini'); - * $tlCfg->gui->text_editor['testproject'] = array( 'type' => 'tinymce'); - * $tlCfg->gui->text_editor['role'] = array( 'type' => 'tinymce'); - * $tlCfg->gui->text_editor['requirement'] = array( 'type' => 'none'); - * $tlCfg->gui->text_editor['requirement_spec'] = array( 'type' => 'none'); - * - * - * Hint: After doing configuration changes, clean you Browser's cookies and cache - */ -/* -$tlCfg->gui->text_editor = array(); -$tlCfg->gui->text_editor['all'] = array('type' => 'fckeditor', - 'toolbar' => 'tl_default', - 'configFile' => 'cfg/tl_ckeditor_config.js',); -$tlCfg->gui->text_editor['execution'] = array( 'type' => 'none'); -*/ - -$tlCfg->gui->text_editor = array(); -$tlCfg->gui->text_editor['all'] = ['type' => 'ckeditor', - 'toolbar' => 'Testlink', - 'configFile' => 'cfg/tl_ckeditor_config.js', - 'height' => 150]; - - -// mini toolbar for test case steps edit -$tlCfg->gui->text_editor['steps_design'] = ['type' => 'ckeditor', - 'toolbar' => 'TestlinkMini', - 'configFile' => 'cfg/tl_ckeditor_config.js', - 'height' => 100]; - -// -$tlCfg->gui->text_editor['preconditions'] = ['type' => 'ckeditor', - 'toolbar' => 'Testlink', - 'configFile' => 'cfg/tl_ckeditor_config.js', - 'height' => 150 - ]; - -$tlCfg->gui->text_editor['summary'] = ['type' => 'ckeditor', - 'toolbar' => 'Testlink', - 'configFile' => 'cfg/tl_ckeditor_config.js', - 'height' => 600 - ]; - - - -$tlCfg->gui->text_editor['execution'] = array('type' => 'none'); -$tlCfg->gui->text_editor['edit_execution'] = array('type' => 'none', 'cols' => 80, 'rows' => 20); -$tlCfg->gui->text_editor['display_execution_notes'] = array('type' => 'none', 'cols' => 80, 'rows' => 20); - -/** User can choose order of menu areas */ -$tlCfg->gui->layoutMainPageLeft = array( 'testProject' => 1, 'userAdministration' => 2 , - 'requirements' => 3, 'testSpecification' => 4, - 'general' => 5); -$tlCfg->gui->layoutMainPageRight = array( 'testPlan' => 1, 'testExecution' => 2 , - 'testPlanContents' => 3); - -/** - * Enable warning on a changed content before an user leave a page. - * - * Tested in: - * - IE8 OK - * - Firefox 3 OK - * - Chrome FAIL - * - * Does not work in Webkit browsers (Chrome, Safari) when using frames. - * Bug in webkit: https://bugs.webkit.org/show_bug.cgi?id=19418 - */ - -// seems that with config options that will be used on javascript via smarty template variables -// we are having problems using FALSE/TRUE => use 0/1 (or our CONSTANT DISABLED/ENABLED) -$tlCfg->gui->checkNotSaved = ENABLED; - - -// ---------------------------------------------------------------------------- -/* [GUI: TREE] */ - -/** Default ordering value for new Test Suites and Test Cases to separate them */ -$tlCfg->treemenu_default_testsuite_order = 1; -$tlCfg->treemenu_default_testcase_order = 1000; - -/** show/hide testcase id on tree menu */ -$tlCfg->treemenu_show_testcase_id = TRUE; - -/** Reorder test cases based on TC Name or External ID in tree on - * test suite level using reorder button - */ -// 'EXTERNAL_ID' -> Sort on Test Case External ID field displayed on tree.(Default) -// 'NAME' -> Sort on Test Case Name field - -$tlCfg->testcase_reorder_by = 'EXTERNAL_ID'; -// $tlCfg->testcase_reorder_by = 'NAME'; - -// ---------------------------------------------------------------------------- -/* [GUI: Javascript libraries] */ - -// May be in future another table sort engine will be better -// kryogenix.org -> Stuart Langridge sortTable -// '' (empty string) -> disable table sorting feature -$g_sort_table_engine='kryogenix.org'; - - -// -------------------------------------------------------------------------------------- -/* [Reports] */ -$tlCfg->reportsCfg=new stdClass(); - -//Displayed execution statuses to use on reports (ordered). */ -$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui']; - -/** - * Default Offset in seconds for reporting start date (reports with date range) - * @uses lib/results/resultsMoreBuilds.php - */ -$tlCfg->reportsCfg->start_date_offset = (7*24*60*60); // one week - -// minutes part is ignored but must be configured. -// Hint: set always to :00 -$tlCfg->reportsCfg->start_time = '00:00'; - -// Result matrix (resultsTC.php) -$tlCfg->resultMatrixReport = new stdClass(); - -// Shows an extra column with the result of the latest execution on -// the lastest CREATED build -$tlCfg->resultMatrixReport->buildColumns['showExecutionResultLatestCreatedBuild'] = true; - -// Result matrix (resultsTC.php) -// Shows an extra column with the note of latest execution on -// the lastest CREATED build -$tlCfg->resultMatrixReport->buildColumns['showExecutionNoteLatestCreatedBuild'] = true; - -// Show build columns in revers order. The latest build is to the left -$tlCfg->resultMatrixReport->buildColumns['latestBuildOnLeft'] = false; - -// After having got performance and usability issue, a limit on max qty of builds -// allowed on data extration has been set. -// Is absolutely arbitrary -// -$tlCfg->resultMatrixReport->buildQtyLimit = 6; - -// ORDER BY sql clause, refers to builds table columns -$tlCfg->resultMatrixReport->buildOrderByClause = " ORDER BY name ASC"; - - -// Show all available status details for test plans on metrics dashboard -$tlCfg->metrics_dashboard = new stdClass(); -$tlCfg->metrics_dashboard->show_test_plan_status = false; - - - - -// ---------------------------------------------------------------------------- -/* [GENERATED DOCUMENTATION] */ - -/** - * Texts and settings for printed documents - * Image is expected in directory /gui/themes//images/ - * Leave text values empty if you would like to hide parameters. - */ -$tlCfg->document_generator->company_name = 'TestLink Community [configure $tlCfg->document_generator->company_name]'; -$tlCfg->document_generator->company_copyright = '2021 © TestLink Community'; -$tlCfg->document_generator->confidential_msg = ''; - -// Logo for generated documents -$tlCfg->document_generator->company_logo = $tlCfg->logo_login; -$tlCfg->document_generator->company_logo_height = '53'; - -/** CSS used in printed html documents */ -$tlCfg->document_generator->css_template = 'css/tl_documents.css'; - -// CSS file for Requirement Specification Document, Requirement and Requirement Spec Print View -$tlCfg->document_generator->requirement_css_template = 'css/tl_documents.css'; - -/** Misc settings */ -// Display test case version when creating: -// - test spec document -// - test reports -$tlCfg->document_generator->tc_version_enabled = TRUE; - - - -// ---------------------------------------------------------------------------- -/* [Test Executions] */ - -// $tlCfg->exec_cfg->enable_test_automation = DISABLED; - -// ENABLED -> enable XML-RPC calls to external test automation server -// new buttons will be displayed on execution pages -// DISABLED -> disable -$tlCfg->exec_cfg->enable_test_automation = DISABLED; - - -// ASCending -> last execution at bottom -// DESCending -> last execution on top [STANDARD BEHAVIOUR] -$tlCfg->exec_cfg->history_order = 'DESC'; - -// TRUE -> the whole execution history for the choosen build will be showed -// FALSE -> just last execution for the choosen build will be showed [STANDARD BEHAVIOUR] -$tlCfg->exec_cfg->history_on = FALSE; - -// TRUE -> test case VERY LAST (i.e. in any build) execution status will be displayed [STANDARD BEHAVIOUR] -// FALSE -> only last result on current build. -$tlCfg->exec_cfg->show_last_exec_any_build = TRUE; - -// TRUE -> History for all builds will be shown -// FALSE -> Only history of the current build will be shown [STANDARD BEHAVIOUR] -$tlCfg->exec_cfg->show_history_all_builds = FALSE; - -// TRUE -> History for all platforms (if any exists for test plan) will be shown -// FALSE -> Only history of the current platform will be shown [STANDARD BEHAVIOUR] -$tlCfg->exec_cfg->show_history_all_platforms = FALSE; - -// different models for the attachments management on execution page -// $att_model_m1 -> shows upload button and title -// $att_model_m2 -> hides upload button and title -$tlCfg->exec_cfg->att_model = $att_model_m2; //defined in const.inc.php - -// IVU -// Default Value -// USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS -// USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS -// USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS -$tlCfg->exec_cfg->tcases_counters_mode = array(); -$tlCfg->exec_cfg->tcases_counters_mode['with_platforms'] = - USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS; - -$tlCfg->exec_cfg->tcases_counters_mode['without_platforms'] = - USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS; - - -$tlCfg->exec_cfg->tcases_counters_mode_domain = array(); -$tlCfg->exec_cfg->tcases_counters_mode_domain['with_platforms'] = - array('USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', - 'USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS', - 'USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS'); - -$tlCfg->exec_cfg->tcases_counters_mode_domain['without_platforms'] = - array('USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', - 'USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS'); - - - - -// ENABLED -> test cases will be coloured according to test case status -$tlCfg->exec_cfg->enable_tree_testcases_colouring = ENABLED; - -// ENABLED -> test cases will be coloured according to execution status on build selected for execution -// DISABLED -> test cases will be coloured according status on latest execution regardless of selected build -// see http://mantis.testlink.org/view.php?id=3450 for more details -$tlCfg->exec_cfg->testcases_colouring_by_selected_build = ENABLED; - -// ENABLED -> test case counters will be coloured according to test case status -$tlCfg->exec_cfg->enable_tree_counters_colouring = ENABLED; - - -// This can help to avoid performance problems. -// Controls what happens on right frame when user clicks on a testsuite on tree. -// ENABLED -> show all test cases -// see $tlCfg->exec_cfg->show_testsuite_contents_deep -// -// DISABLED -> nothing happens, to execute a test case you need to click on test case -$tlCfg->exec_cfg->show_testsuite_contents = DISABLED; - -// @since 1.9.13 -// works in 'team' with $tlCfg->exec_cfg->show_testsuite_contents -// children: only direct children. -// deep: all test cases present in test suite and test suites in any level below -// selected test suite. -// IMPORTANT NOTICE: -// selecting deep can create performance issues. -// -$tlCfg->exec_cfg->show_testsuite_contents_deep = 'children'; - - -// ENABLED -> enable testcase counters by status on tree -$tlCfg->exec_cfg->enable_tree_testcase_counters = ENABLED; - - -// Define list of roles that are affected by: -// $tlCfg->exec_cfg->view_mode and $tlCfg->exec_cfg->exec_mode -// User must reconfigure if define other simple tester roles -// -// In addition (till code changes) also roles that verify this condition: -// $effective_role->hasRight('testplan_execute') and !$effective_role->hasRight('testplan_planning') -// Will be affected by: -// $tlCfg->exec_cfg->view_mode and $tlCfg->exec_cfg->exec_mode -// -$tlCfg->exec_cfg->simple_tester_roles=array(TL_ROLES_TESTER); - -// Filter Test cases a user with tester role can VIEW depending on -// test execution assignment. -// all: all test cases. -// assigned_to_me: test cases assigned to logged user. -// assigned_to_me_or_free: test cases assigned to logged user or not assigned -$tlCfg->exec_cfg->view_mode->tester='assigned_to_me'; - -// Filter Test cases a user with tester role can EXECUTE depending on -// test execution assignment. -// all: all test cases. -// assigned_to_me: test cases assigned to logged user. -// assigned_to_me_or_free: test cases assigned to logged user or not assigned -$tlCfg->exec_cfg->exec_mode->tester='assigned_to_me'; - - -// How to set defaut values for execution fields (standard & custom) -// clean => all clean -// latest => get as much as possible values from latest execution on -// same context => test plan,platform, build -$tlCfg->exec_cfg->exec_mode->new_exec='clean'; - - -// @since 1.9.15 -// Before 1.9.15 save & move to next worked JUST inside -// a test suite => save_and_move = 'limited' -// 1.9.15 will move on whole test project -// save_and_move = 'unlimited' -$tlCfg->exec_cfg->exec_mode->save_and_move='unlimited'; - -$tlCfg->exec_cfg->exec_mode->addLinkToTLChecked = false; -$tlCfg->exec_cfg->exec_mode->addLinkToTLPrintViewChecked = false; -$tlCfg->exec_cfg->exec_mode->assignTaskChecked = false; - - -/** User filter in Test Execution navigator - default value */ -// logged_user -> combo will be set to logged user -// none -> no filter applied by default -$tlCfg->exec_cfg->user_filter_default='none'; - - -// 'horizontal' -> step and results on the same row -// 'vertical' -> steps on one row, results in the row bellow -$tlCfg->exec_cfg->steps_results_layout = 'horizontal'; - -// true => on single test case execution feature, notes and result -// can be provided for each step -// false => pre 1.9.10 behaviour -// -$tlCfg->exec_cfg->steps_exec = true; - -// this setting will work on AND mode with: -// $tlCfg->exec_cfg->steps_exec -$tlCfg->exec_cfg->steps_exec_attachments = true; - -// When textarea is displayed to allow user to write execution notes -// at step level, choose what to display: -// 'empty' -// 'latest' => latest execution notes. -$tlCfg->exec_cfg->steps_exec_notes_default = 'empty'; - - -// 'empty' -// 'latest' => latest execution notes. -$tlCfg->exec_cfg->steps_exec_status_default = 'empty'; - -// Parameters to show notes/details when entering test execution feature -// EXPAND: show expanded/open -// COLLAPSE: show collapsed/closede -// LAST_USER_CHOICE: get status from cookie that holds last user choice.[STANDARD BEHAVIOUR] -$tlCfg->exec_cfg->expand_collapse = new stdClass(); -$tlCfg->exec_cfg->expand_collapse->testplan_notes = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->platform_description = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->build_description = LAST_USER_CHOICE; -$tlCfg->exec_cfg->expand_collapse->testsuite_details = LAST_USER_CHOICE; - - - -$tlCfg->exec_cfg->copyLatestExecIssues = new stdClass(); - -// true => When saving an execution, a new option will be displayed, and user will be -// able to do a choice -// COPY OR NOT issues linked to latest execution to the new execution -// DEAFULT false => no option on GUI - -$tlCfg->exec_cfg->copyLatestExecIssues->enabled = FALSE; - - -// value to set as default -$tlCfg->exec_cfg->copyLatestExecIssues->default = FALSE; - -// you can choose only between columns present on -// (see exec.inc.php, function get_bugs_for_exec()) -$tlCfg->exec_cfg->bugs_order_clause = ' ORDER BY builds.name,step_number,bug_id '; - -$tlCfg->exec_cfg->features = new stdClass(); -$tlCfg->exec_cfg->features->attachments = new stdClass(); -$tlCfg->exec_cfg->features->attachments->enabled = true; -$tlCfg->exec_cfg->features->exec_duration = new stdClass(); -$tlCfg->exec_cfg->features->exec_duration->enabled = true; - -$tlCfg->exec_cfg->issues = new stdClass(); -$tlCfg->exec_cfg->issues->tcase_level = new stdClass(); -$tlCfg->exec_cfg->issues->tcstep_level = new stdClass(); - -/** - * %%STEPNUMBER%%,%%TCNAME%%,%%PROJECTNAME%%,%%PLANNAME%% - * %%BUILDNAME%%,%%PLATFNAME%%,%%EXECTSISO%%, - * %%TCPATHNAME%% - * - * /saado/TS100/SAA-4:WSTEPS Executed ON (ISO FORMAT): 2018-02-25CET10:00 - */ -$tlCfg->exec_cfg->issues->tcase_level->subject = -'$$issue_subject_tcname %%TCPATHNAME%% - $$issue_subject_execon %%EXECTSISO%% '; - -/* -$tlCfg->exec_cfg->issues->tcstep_level->subject = -'$$issue_on_step %%STEPNUMBER%% - $$issue_subject_tcname %%TCNAME%% - ' . -'$$issue_subject_projectname %%PROJECTNAME%% - ' . -'$$issue_subject_planname %%PLANNAME%% - ' . -'$$issue_subject_buildname %%BUILDNAME%% - ' . -'$$issue_subject_platfname %%PLATFNAME%%'; -*/ - -$tlCfg->exec_cfg->issues->tcstep_level->subject = '$$issue_on_step %%STEPNUMBER%% - $$issue_subject_tcname %%TCNAME%% '; - - -// ---------------------------------------------------------------------- -/* [Test Specification] */ - -// TRUE will be displayed when displayed a test case -$tlCfg->spec_cfg->show_tplan_usage = TRUE; - -// 'horizontal' -> step and results on the same row -// 'vertical' -> steps on one row, results in the row bellow -$tlCfg->spec_cfg->steps_results_layout = 'horizontal'; - - -// ENABLED -> User will see a test suite filter while creating test specification -// DISABLED -> no filter available -// $g_spec_cfg->show_tsuite_filter = ENABLED; -$tlCfg->spec_cfg->show_tsuite_filter = ENABLED; - -// ENABLED -> every time user do some operation on test specification -// tree is updated on screen. -// DISABLED -> tree will not be updated, user can update it manually. -// Anyway on user interface user will be able to change this choice -// $g_spec_cfg->automatic_tree_refresh = ENABLED; -$tlCfg->spec_cfg->automatic_tree_refresh = ENABLED; - - -// To avoid perfomance problems on search test case feature, -// we can decide when to inform user that results can not be displayed -// due to too many results. -$tlCfg->testcase_cfg->search=new stdClass(); -$tlCfg->testcase_cfg->search->max_qty_for_display=200; - - -$tlCfg->testcase_cfg->duplicated_name_algorithm = new stdClass(); -// 'stringPrefix' => use duplicated_name_algorithm->text -// 'counterSuffix' => creare name as : -// test case title + (number of existent test cases +1) -// example: My Test Title 2 -// duplicated_name_algorithm->text is used as sprintf format mask -$tlCfg->testcase_cfg->duplicated_name_algorithm->type = 'stringPrefix'; -$tlCfg->testcase_cfg->duplicated_name_algorithm->text = "%Y%m%d-%H:%M:%S"; - -// $tlCfg->testcase_cfg->duplicated_name_algorithm->type = 'counterSuffix'; -// $tlCfg->testcase_cfg->duplicated_name_algorithm->text = " (%s)"; - - -// TICKET 6422: Estimation in Test specification as mandatory field -// Implemented using HTML5 -$tlCfg->testcase_cfg->estimated_execution_duration = new stdClass(); -// $tlCfg->testcase_cfg->estimated_execution_duration->required = 'required'; -$tlCfg->testcase_cfg->estimated_execution_duration->required = ''; - - - -// There are some preconfigured standard types which you can use, -// additionally you can configure your own types. -$tlCfg->testcase_cfg->relations = new stdClass(); -$tlCfg->testcase_cfg->relations->enable = TRUE; -$tlCfg->testcase_cfg->relations->interproject_linking = FALSE; - - -/** - * Localization identifiers for test cases relation types - * Types, which are configured above, have to be configured - * here too with attributes "source" and "destination". - * - * Last value will be selected in GUI as default. - * - * Form has to be like this: - * - * ... = array( - * RELATIONNAME => array( - * 'source' => 'SOURCE_LOCALIZATION_KEY', - * 'destination' => 'DESTINATION_LOCALIZATION_KEY'), - * ... - * - * @since TestLink 1.9.12 - **/ - -$tlCfg->testcase_cfg->relations->type_labels = array( - TL_REL_TYPE_PARENT_CHILD => ['source' => 'parent_of','destination' => 'child_of'], - TL_REL_TYPE_BLOCKS_DEPENDS => ['source' => 'blocks','destination' => 'depends'], - TL_REL_TYPE_RELATED => ['source' => 'related_to','destination' => 'related_to'], - TL_REL_TYPE_AUTOMATION_PARENT_CHILD => ['source' => 'automates_also', 'destination' => 'is_automated_by'], - TL_REL_TYPE_EXECUTE_TOGETHER => ['source' => 'executed_me_and_also', 'destination' => 'executed_me_and_also'] -); - - - -$tlCfg->testcase_cfg->relations->type_description = [ - TL_REL_TYPE_PARENT_CHILD => 'parent_child', - TL_REL_TYPE_BLOCKS_DEPENDS => 'blocks_depends', - TL_REL_TYPE_RELATED => 'related_to', - TL_REL_TYPE_AUTOMATION_PARENT_CHILD => 'automation_script', - TL_REL_TYPE_EXECUTE_TOGETHER => 'executed_me_and_also' -]; - - - - -// @since 1.9.18 -// TRUE => After a test case version has been executed -// attachment on test case spec can not be added/removed -// -// FALSE -// -// This means that at GUI Level, will not be possible: -// add a new attachment to an Executed Test Case Version -// delete an attachment from Executed Test Case Version -$tlCfg->testcase_cfg->downloadOnlyAfterExec = TRUE; - -// This means that at GUI Level, will not be possible: -// add a new req version link to an Executed Test Case Version -// delete a req version link from Executed Test Case Version -$tlCfg->testcase_cfg->reqLinkingDisabledAfterExec = TRUE; - -// Effects on Linked Requirements Version after -// execution of a Test Case Version -$tlCfg->testcase_cfg->freezeReqVersionAfterExec = TRUE; - - -// Effects on TCVersion N when TCVersion N+1 is created -$tlCfg->testcase_cfg->freezeTCVersionOnNewTCVersion = TRUE; -$tlCfg->testcase_cfg->freezeTCVRelationsOnNewTCVersion = TRUE; - -// Because: -// The Relation must be frozen (cannot be deleted) when -// a new version of the test case is created. -// -// It seems confusing that relation can be added, then -// this new configuration will allow this operation -// only on latest test case version -// -$tlCfg->testcase_cfg->addTCVRelationsOnlyOnLatestTCVersion = TRUE; - - -// Not Already Implemented -//$tlCfg->testcase_cfg->allowAddTCVRelationsOnOldTCVersion = TRUE; - -//$tlCfg->testcase_cfg->frozenNotExecutedTCVDelAttachtments = FALSE; -//$tlCfg->testcase_cfg->frozenNotExecutedTCVAddAttachtments = FALSE; -//$tlCfg->testcase_cfg->frozenNotExecutedTCVAddTCVRel = FALSE; -//$tlCfg->testcase_cfg->frozenNotExecutedTCVDelTCVRel = FALSE; -//$tlCfg->testcase_cfg->frozenNotExecutedTCVAddREQVLink = FALSE; -//$tlCfg->testcase_cfg->frozenNotExecutedTCVDelREQVLink = FALSE; - - -// Change order using CSS flexbox model -// @used-by tcEdit.tpl -$tlCfg->testcase_cfg->viewerFieldsOrder = new stdClass(); -$tlCfg->testcase_cfg->viewerFieldsOrder->summary = 3; -$tlCfg->testcase_cfg->viewerFieldsOrder->spaceOne = 2; -$tlCfg->testcase_cfg->viewerFieldsOrder->preconditions = 1; - - - - - -// Effects on Req Version to TCVersion LINK -// when a new version of a linked Test Case is created -// If LINK is frozen, then this means that link can not be deleted. -// $tlCfg->reqTCLinks->freezeLinkOnNewTCVersion = FALSE; -// -// Important Notice: -// Req Version to TCVersion Link can be done ONLY TO LATEST TCV. -// -// This means that : -// -// on GUI on the Requirements Area on TEST CASE Specification Feature: -// this option has NO EFFECT -// -// on GUI on the Coverage Area on REQUIREMENT Specification Feature: -// this option has EFFECT -// -// on GUI on the Assign Requirements Feature: -// this option has EFFECT -// -$tlCfg->reqTCLinks->freezeLinkOnNewTCVersion = TRUE; - -// Effects on Req Version to TCVersion LINK -// when a new version of a linked Req Version is created -$tlCfg->reqTCLinks->freezeLinkOnNewREQVersion = TRUE; - - -// Effects on BOTH ends of Req Version to TCVersion LINK -// when a new version of a linked TC Version is created -$tlCfg->reqTCLinks->freezeBothEndsOnNewTCVersion = TRUE; - -// Effects on BOTH ends of Req Version to TCVersion LINK -// when a new version of a linked REQ Version is created -$tlCfg->reqTCLinks->freezeBothEndsOnNewREQVersion = TRUE; - - -// Effects on REQ Version N when REQ Version N+1 is created -$tlCfg->req_cfg->freezeREQVersionOnNewREQVersion = TRUE; - - -/** text template for a new items: - Test Case: summary, steps, expected_results, preconditions - -*/ -// object members has SAME NAME that FCK editor objects. -// the logic present on tcEdit.php is dependent of this rule. -// every text object contains an object with following members: type and value -// -// Possible values for type member: -// none: template will not be used, default will be a clean editor screen. -// -// string: value of value member is assigned to FCK object -// string_id: value member is used in a lang_get() call, and return value -// is assigned to FCK object. Configure string_id on custom_strings.txt -// value: value member is used as file name. -// file is readed and it's contains assigned to FCK object -// -// any other value for type, results on '' assigned to FCK object - -$tlCfg->testcase_template = new stdClass(); - -$tlCfg->testcase_template->summary = new stdClass(); -$tlCfg->testcase_template->summary->type = 'none'; -$tlCfg->testcase_template->summary->value = ''; - -$tlCfg->testcase_template->steps = new stdClass(); -$tlCfg->testcase_template->steps->type = 'none'; -$tlCfg->testcase_template->steps->value = ''; - -$tlCfg->testcase_template->expected_results = new stdClass(); -$tlCfg->testcase_template->expected_results->type = 'none'; -$tlCfg->testcase_template->expected_results->value = ''; - -$tlCfg->testcase_template->preconditions = new stdClass(); -$tlCfg->testcase_template->preconditions->type = 'none'; -$tlCfg->testcase_template->preconditions->value = ''; - - -/** text template for a new Test Suite description */ -$tlCfg->testsuite_template = new stdClass(); -$tlCfg->testsuite_template->details = new stdClass(); -$tlCfg->testsuite_template->details->type = 'none'; -$tlCfg->testsuite_template->details->value = ''; - -$tlCfg->project_template = new stdClass(); -$tlCfg->project_template->notes = new stdClass(); -$tlCfg->project_template->notes->type = 'none'; -$tlCfg->project_template->notes->value = ''; - -$tlCfg->testplan_template = new stdClass(); -$tlCfg->testplan_template->notes = new stdClass(); -$tlCfg->testplan_template->notes->type = 'none'; -$tlCfg->testplan_template->notes->value = ''; - -$tlCfg->execution_template = new stdClass(); -$tlCfg->execution_template->bulk_exec_notes = new stdClass(); -$tlCfg->execution_template->bulk_exec_notes->type = 'none'; -$tlCfg->execution_template->bulk_exec_notes->value = ''; - -$tlCfg->execution_template->notes = new stdClass(); -$tlCfg->execution_template->notes->type = 'none'; -$tlCfg->execution_template->notes->value = ''; - -$tlCfg->build_template = new stdClass(); -$tlCfg->build_template->notes = new stdClass(); -$tlCfg->build_template->notes->type = 'none'; -$tlCfg->build_template->notes->value = ''; - -$tlCfg->requirement_template = new stdClass(); -$tlCfg->requirement_template->scope = new stdClass(); -$tlCfg->requirement_template->scope->type = 'none'; -$tlCfg->requirement_template->scope->value = ''; - -$tlCfg->req_spec_template = new stdClass(); -$tlCfg->req_spec_template->scope = new stdClass(); -$tlCfg->req_spec_template->scope->type = 'none'; -$tlCfg->req_spec_template->scope->value = ''; - -$tlCfg->role_template = new stdClass(); -$tlCfg->role_template->notes = new stdClass(); -$tlCfg->role_template->notes->type = 'none'; -$tlCfg->role_template->notes->value = ''; - - -$tlCfg->platform_template = new stdClass(); -$tlCfg->platform_template->notes = new stdClass(); -$tlCfg->platform_template->notes->type = 'none'; -$tlCfg->platform_template->notes->value = ''; - -// ---------------------------------------------------------------------------- -/* [ATTACHMENTS] */ - -/** Attachment feature availability */ -$tlCfg->attachments = new stdClass(); -$tlCfg->attachments->enabled = TRUE; - -// TRUE -> when you upload a file you can give no title -$tlCfg->attachments->allow_empty_title = TRUE; - -// $tlCfg->attachments->allow_empty_title == TRUE, you can ask the system -// to do something -// -// 'none' -> just write on db an empty title -// 'use_filename' -> use filename as title -//$tlCfg->attachments->action_on_save_empty_title='use_filename'; -// -$tlCfg->attachments->action_on_save_empty_title = 'none'; - -// Remember that title is used as link description for download -// then if title is empty, what the system has to do when displaying ? -// 'show_icon' -> the $tlCfg->attachments->access_icon will be used. -// 'show_label' -> the value of $tlCfg->attachments->access_string will be used . -$tlCfg->attachments->action_on_display_empty_title = 'show_icon'; - -// Set display order of uploaded files -$tlCfg->attachments->order_by = " ORDER BY date_added DESC "; - - -// need to be moved AFTER include of custom_config -// -// $tlCfg->attachments->access_icon = ''; -$tlCfg->attachments->access_string = "[*]"; - -/** - * Files that are allowed. Separate items by commas. - * eg. 'doc,xls,gif,png,jpg' - */ -$tlCfg->attachments->allowed_files = 'doc,xls,gif,png,jpg,xlsx,csv'; - - -/** - * Process filename against XSS - * Thanks to http://owasp.org/index.php/Unrestricted_File_Upload - * '/^[a-zA-Z0-9]{1,20}\.[a-zA-Z0-9]{1,10}$/'; - * added - and _. - * - * NO CHECK if -> $g_attachments->allowed_filenames_regexp = ''; - * - */ -$tlCfg->attachments->allowed_filenames_regexp = '/^[a-zA-Z0-9_-]{1,20}\.[a-zA-Z0-9]{1,10}$/'; - - -/** the type of the repository can be database or filesystem - * TL_REPOSITORY_TYPE_DB => database - * TL_REPOSITORY_TYPE_FS => filesystem - **/ -$g_repositoryType = TL_REPOSITORY_TYPE_FS; - -/** - * TL_REPOSITORY_TYPE_FS: the where the filesystem repository should be located - * We recommend to change the directory for security reason. - * (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/) - * Put it out of reach via web or configure access denied. - * - **/ -$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */ -if (($upa = getenv('TESTLINK_UPLOAD_AREA'))) { - $g_repositoryPath = trim($upa); -} - -/** - * compression used within the repository - * TL_REPOSITORY_COMPRESSIONTYPE_NONE => no compression - * TL_REPOSITORY_COMPRESSIONTYPE_GZIP => gzip compression - */ -$g_repositoryCompressionType = TL_REPOSITORY_COMPRESSIONTYPE_NONE; - -// the maximum allowed file size for each repository entry, default 1MB. -// Also check your PHP settings (default is usually 2MBs) -$tlCfg->repository_max_filesize = 1; //MB - - - - -// ---------------------------------------------------------------------------- -/* [Requirements] */ - -// HAS TO BE REMOVED - > req_doc_id UNIQUE INSIDE test project -// true : you want req_doc_id UNIQUE IN THE WHOLE DB (system_wide) -// false: you want req_doc_id UNIQUE INSIDE a SRS -// $tlCfg->req_cfg->reqdoc_id->is_system_wide = FALSE; - -$tlCfg->req_cfg->monitor_enabled = true; - -// truncate log message to this amount of chars for reqCompareVersions -$tlCfg->req_cfg->log_message_len = 200; - -/** - * Test Case generation from Requirements - use_req_spec_as_testsuite_name - * FALSE => test cases are created and assigned to a test suite - * with name $tlCfg->req_cfg->default_testsuite_name - * TRUE => REQuirement Specification Title is used as testsuite name - */ -$tlCfg->req_cfg->use_req_spec_as_testsuite_name = TRUE; -$tlCfg->req_cfg->default_testsuite_name = "Auto-created Test cases"; -$tlCfg->req_cfg->testsuite_details = "Test Cases in the Test Suite are generated from Requirements. " . - "A refinement of test scenario is highly recommended."; -$tlCfg->req_cfg->testcase_summary_prefix = "The Test Case was generated from the assigned requirement.
"; - - -// If the following value is enabled, then the summary prefix string will include the -// title and version number of the assigned requirement. -$tlCfg->req_cfg->use_testcase_summary_prefix_with_title_and_version = ENABLED; - -// If above option is enabled, the following string will be used as a template for the tc summary prefix. -// It has to include four variables in the form of "%s". The first and second one will be used internally by the system. -// The third one will then be replaced by the title of the originating Requirement, -// the fourth one by its version number. -// Attention: If there aren't exactly three variables in it, the operation will fail. -$tlCfg->req_cfg->testcase_summary_prefix_with_title_and_version = "The Test Case was generated from the assigned" . - " requirement
\"%s\" (version %s).
"; - -/** - * ENABLED: When generating Test Cases from Requirements, copy the scope of the Requirement - * to the summary of the newly created Test Case. - */ -$tlCfg->req_cfg->copy_req_scope_to_tc_summary = DISABLED; - - -// To avoid perfomance problems on search Requirements feature, -// we can decide when to inform user that results can not be displayed -// due to too many results. -$tlCfg->req_cfg->search=new stdClass(); -$tlCfg->req_cfg->search->max_qty_for_display=200; - - -// ENABLED: allow N level depth tree -// DISABLED: just one level -$tlCfg->req_cfg->child_requirements_mgmt = ENABLED; - - -// ENABLED: ask for this value on user interface and use on several features -// DISABLED: do not ask, do not use -$tlCfg->req_cfg->expected_coverage_management = ENABLED; - -// Show Child Requirements on Requirement Specification Print View -// ENABLED: Requirement Specification including Child Requirements are shown -// DIABLED: ONLY Requirement Specification is shown -$tlCfg->req_cfg->show_child_reqs_on_reqspec_print_view = DISABLED; - -// -// Order of test cases status in this array, is used to undestand -// to what status set requirement in the requirements report. -// Standard algorithm, present in getReqCoverage(), is: -// -// if at least one of Test Cases linked to Requirement has status FAILED -// Requirement Coverage Status = FAILED -// else if at least one of Test Cases linked to Requirement has status BLOCKED -// Requirement Coverage Status = BLOCKED -// else if ALL Test Cases linked to Requirement has status NOT RUN -// Requirement Coverage Status = NOT RUN -// else if ALL Test Cases linked to Requirement has status PASSED -// Requirement Coverage Status = PASSED -// else -// Requirement Coverage Status = Partially Passed -// -// This logic is implemented using following config parameter -$tlCfg->req_cfg->coverageStatusAlgorithm['checkOrder']=array('atLeastOne','all'); -$tlCfg->req_cfg->coverageStatusAlgorithm['checkType']['atLeastOne']=array('failed','blocked'); -$tlCfg->req_cfg->coverageStatusAlgorithm['checkType']['all']=array('passed'); - -// Configure here what status has to get requirement when check of type 'all' fails like -// in following situation (Mantis 2171) -// -// If particular requirement has assigned more than one test cases, and: -// - at least one of assigned test cases was not yet executed -// - the rest of assigned test cases was executed and passed -// then on the "Requirements based report" this particular requirement is not shown at all (in any section). -// -// $tlCfg->req_cfg->coverageStatusAlgorithm['checkFail']['all']='partially_passed'; -// $tlCfg->req_cfg->coverageStatusAlgorithm['displayOrder']=array('passed','failed', -// 'blocked','not_run','partially_passed'); -// 20100819 - asimon - fix not needed anymore after rewrite of req based report -//$tlCfg->req_cfg->coverageStatusAlgorithm['checkFail']['all']='failed'; -//$tlCfg->req_cfg->coverageStatusAlgorithm['displayOrder']=array('passed','failed','blocked','not_run'); - - - - -// truncate log message to this amount of chars for reqSpecCompareRevisions -$tlCfg->req_spec_cfg->log_message_len = 200; - - -// Linking between requirements/requirement specifications -// -$tlCfg->internal_links = new stdClass(); - -// -// TRUE: links to other requirements/requirement specifications are -// automatically generated from the corresponding Document ID, enclosed by tags (like BBCode). -// -// Usage: -// link to requirements: [req]req_doc_id[/req] -// link to requirement specifications: [req_spec]req_spec_doc_id[/req_spec] -// -// The test project of the requirement / requirement specification and an anchor -// to jump to can also be specified: -// [req tproj= anchor=]req_doc_id[/req] -// This syntax also works for requirement specifications. -// -// FALSE: no links are automatically created. -// -$tlCfg->internal_links->enable = TRUE; - -// how a linked document (requirement/requirement specification) should be displayed. -// posible values: -// 'window': new window/tab will be used (depending on browser configuration) -// 'frame' : same frame as the clicked link -// 'popup' (default): popup window (ATTENTION to browser pop-up block). -// -$tlCfg->internal_links->target = 'popup'; - -// title for automatically created link -// possible values: -// 'string': lang_get() will be used to localize -// 'none': no title will be generated, only link with ID -// 'item' (default): localized type of item (e.g. "Requirement: ", "Req Spec") -// will be used as title for the generated link -// -$tlCfg->internal_links->req_link_title = new stdClass(); -$tlCfg->internal_links->req_link_title->type = 'item'; -$tlCfg->internal_links->req_link_title->value = ''; - -$tlCfg->internal_links->req_spec_link_title = new stdClass(); -$tlCfg->internal_links->req_spec_link_title->type = 'item'; -$tlCfg->internal_links->req_spec_link_title->value = ''; - - -// Relations between requirement documents: -// -// The relation types have to be configured in cfg/const.inc.php -// and their respective localization values in locale strings.txt. - -// There are some preconfigured standard types which you can use, -// additionally you can configure your own types. -$tlCfg->req_cfg->relations = new stdClass(); -$tlCfg->req_cfg->relations->enable = TRUE; -$tlCfg->req_cfg->relations->interproject_linking = FALSE; - -// Requirement/testcase diff -// default value of lines to show before and after each difference -$tlCfg->diffEngine->context = 5; - - -// Configuration for Requirement Import using DOCBOOK format -$tlCfg->req_cfg->importDocBook = new stdClass(); -$tlCfg->req_cfg->importDocBook->requirement= "sect3"; -$tlCfg->req_cfg->importDocBook->title= "title"; -$tlCfg->req_cfg->importDocBook->paragraph= "para"; -$tlCfg->req_cfg->importDocBook->ordered_list="orderedlist"; -$tlCfg->req_cfg->importDocBook->list_item="listitem"; -$tlCfg->req_cfg->importDocBook->table="informaltable"; -$tlCfg->req_cfg->importDocBook->table_group="tgroup"; -$tlCfg->req_cfg->importDocBook->table_head="thead"; -$tlCfg->req_cfg->importDocBook->table_body="tbody"; -$tlCfg->req_cfg->importDocBook->table_row="row"; -$tlCfg->req_cfg->importDocBook->table_entry="entry"; -$tlCfg->req_cfg->importDocBook->list_item_children = array('para','title'); -$tlCfg->req_cfg->importDocBook->table_entry_children = array('para'); - - -// If an external tool is used for requirement management, enable this setting. -// You will get an additional field on requirement specifications where you -// can enter the total count of requirements so that external requirements -// are also counted for metrics/statistics. -$tlCfg->req_cfg->external_req_management = DISABLED; - - -//If enabled an icon next to Document ID field will show up that allows -//to insert the last defined Requirement Document ID within the same Project -//into Document ID field -$tlCfg->req_cfg->allow_insertion_of_last_doc_id = DISABLED; - - -// used ONLY to configure the mask (text) . -// algorithm type is fixed HARDCODED -// -$tlCfg->req_cfg->duplicated_name_algorithm = new stdClass(); -$tlCfg->req_cfg->duplicated_name_algorithm->text = " (%s)"; - -$tlCfg->req_cfg->duplicated_docid_algorithm = new stdClass(); -$tlCfg->req_cfg->duplicated_docid_algorithm->text = " (%s)"; - - -// ---------------------------------------------------------------------------- -/* [TREE FILTER CONFIGURATION] */ - -/* In the following section, you can configure which filters shall be used - * in combination with the tree view for testcases and requirements. - * There are five available filter modes (four for the testcase tree, - * one for requirement documents), which are used for the different features - * as listed here: - * - * For Test Cases: - * --> execution_mode - * execution of testcases - * --> edit_mode - * create and edit testcases - * assign keywords to testcases - * assign requirements to testcases - * --> plan_mode - * assign testcase execution to users - * update linked versions for testplan - * set urgent testcases - * --> plan_add_mode - * add/remove testcases to/from testplan - * - * For Requirements: - * There are no modes defined, there is only one filter configuration. - * The filters configured here will be used for requirement editing. - */ -$tlCfg->tree_filter_cfg = new stdClass(); -$tlCfg->tree_filter_cfg->testcases = new stdClass(); -$tlCfg->tree_filter_cfg->requirements = new stdClass(); - -// These are the available filter modes for testcases: -$tlCfg->tree_filter_cfg->testcases->execution_mode = new stdClass(); -$tlCfg->tree_filter_cfg->testcases->edit_mode = new stdClass(); -$tlCfg->tree_filter_cfg->testcases->plan_mode = new stdClass(); -$tlCfg->tree_filter_cfg->testcases->plan_add_mode = new stdClass(); - -// If you disable one of these items here, you switch -// the complete filter panel off for a specific mode/feature. -// You should rather do this here instead of individually disabling all the filters, -// if you don't want to have any filters at all for a given feature. -$tlCfg->tree_filter_cfg->testcases->execution_mode->show_filters = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->show_filters = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->show_filters = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->show_filters = ENABLED; -$tlCfg->tree_filter_cfg->requirements->show_filters = ENABLED; - -// Detailed settings for each mode. -// Here, the single filter fields can be disabled if not wanted. -// Also, the choice of advanced filter mode can be disabled. -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_tc_id = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_testcase_name = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_toplevel_testsuite = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_keywords = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_priority = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_execution_type = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_assigned_user = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_custom_fields = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_result = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_bugs = ENABLED; -$tlCfg->tree_filter_cfg->testcases->execution_mode->advanced_filter_mode_choice = ENABLED; - -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_tc_id = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_testcase_name = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_toplevel_testsuite = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_keywords = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_platforms = ENABLED; - -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_active_inactive = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_importance = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_execution_type = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_custom_fields = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_workflow_status = ENABLED; -$tlCfg->tree_filter_cfg->testcases->edit_mode->advanced_filter_mode_choice = ENABLED; - -$tlCfg->tree_filter_cfg->testcases->edit_mode - ->filter_workflow_status_values = array(); - -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_tc_id = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_testcase_name = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_toplevel_testsuite = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_keywords = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_priority = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_execution_type = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_assigned_user = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_custom_fields = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_result = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->advanced_filter_mode_choice = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_mode->setting_build_inactive_out = FALSE; -$tlCfg->tree_filter_cfg->testcases->plan_mode->setting_build_close_out = FALSE; - - -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_tc_id = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_testcase_name = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_toplevel_testsuite = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_keywords = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_active_inactive = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_importance = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_execution_type = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_workflow_status = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_custom_fields = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->advanced_filter_mode_choice = ENABLED; -$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_platforms = ENABLED; - - -$tlCfg->tree_filter_cfg->requirements->filter_doc_id = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_title = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_status = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_type = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_spec_type = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_coverage = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_relation = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_tc_id = ENABLED; -$tlCfg->tree_filter_cfg->requirements->filter_custom_fields = ENABLED; -$tlCfg->tree_filter_cfg->requirements->advanced_filter_mode_choice = ENABLED; - -// ENABLED -> Every time the user does some operation on requirement spec, -// the tree will be updated on screen. [DEFAULT] -// DISABLED -> The tree will not be updated automatically, but the user can update it manually. -// On graphical user interface any user will is able to change this setting. -$tlCfg->tree_filter_cfg->requirements->automatic_tree_refresh = ENABLED; - - - -/* [Assign test cases to test plan] */ -$tlCfg->tplanDesign->hideTestCaseWithStatusIn = array($tlCfg->testCaseStatus['obsolete'] => 'obsolete', - $tlCfg->testCaseStatus['future'] => 'future' ); - -// ---------------------------------------------------------------------------- -/* [MISC FUNCTIONALITY] */ - -/** Maximum uploadfile size to importing stuff in TL */ -// Also check your PHP settings (default is usually 2MBs) -// unit BYTES is required by MAX_FILE_SIZE HTML option -$tlCfg->import_file_max_size_bytes = '800000'; - -/** Maximum line size of the imported file */ -$tlCfg->import_max_row = '10000'; // in chars - -/** Set the default role used for new users */ -// - created from the login page. -// - created using user management features -$tlCfg->default_roleid = TL_ROLES_GUEST; - -// only show custom fields if their value isn't empty -$tlCfg->custom_fields->show_custom_fields_without_value = true; - -/** used to check size in char for TEXT AREA type custom fields */ -// can not be greater that column definition on DB -// 0 => do not check. -$tlCfg->custom_fields->max_length = 255; - -// sizes for HTML INPUTS -// for list, multiselection list -// - MAXIMUM number of items displayed at once -// -// for checkbox,radio is useless -// Hint: more than 120 produce weird effects on user interface -// -$tlCfg->custom_fields->sizes = array('string' => 100, - 'numeric' => 10, - 'float' => 10, - 'email' => 100, - 'list' => 1, - 'multiselection list' => 5, - 'text area' => array('rows' => 6, 'cols' => 80), - 'script' => 100, - 'server' => 100); - -// Use this variable (on custom_config.inc.php) to define new Custom Field types. -// IMPORTANT: -// check $custom_field_types property on cfield_mgr.class.php -// to avoid overwrite of standard types. -// -$tlCfg->gui->custom_fields->types = null; - -// Use this variable (on custom_config.inc.php) -// to define possible values behaviour for new Custom Field types. -// -// IMPORTANT: -// check $possible_values_cfg property on cfield_mgr.class.php -// to avoid overwrite of standard values. -// -$tlCfg->gui->custom_fields->possible_values_cfg = null; - - -/** - * Check unique titles of Test Project, Test Suite and Test Case - * ENABLED => Check [STANDARD BEHAVIOUR] - * DISABLED => don't check - **/ -$tlCfg->check_names_for_duplicates = ENABLED; - -/** - * Action for duplication check (only if check_names_for_duplicates=ENABLED) - * 'allow_repeat' => allow the name to be repeated (backward compatibility) - * 'generate_new' => generate a new name using $g_prefix_name_for_copy - * 'block' => return with an error - **/ -$tlCfg->action_on_duplicate_name = 'generate_new'; - -/** - * String checking and conversions - * Allow automatically convert www URLs and email adresses into clickable links - * used by function string_display_links() for example by custom fields. - * Valid values = ENABLED/DISABLED. - **/ -$tlCfg->html_make_links = ENABLED; - -/** - * Define the valid html tags for "content driven" single-line and multi-line fields. - * Do NOT include tags with parameters (eg. ), img and href. - * It's used by function string_display_links() for example by custom fields. - */ -$tlCfg->html_valid_tags = 'p, li, ul, ol, br, pre, i, b, u, em'; -$tlCfg->html_valid_tags_single_line = 'i, b, u, em'; - -/** - * Defines the threshold values for filtering TC by a priority according to the formula - * LOW => all Tc's with (urgency*importance) < LOW_Threshold - * HIGH => all Tc's with (urgency*importance) >= HIGH_Threshold - * MEDIUM => all Tc's with (urgency*importance) >= LOW_Threshold AND (urgency*importance) < HIGH_Threshold - */ -$tlCfg->urgencyImportance = new stdClass(); -$tlCfg->urgencyImportance->threshold['low'] = 3; -$tlCfg->urgencyImportance->threshold['high'] = 6; - -/** - * @var boolean Demo mode disables some functionality - * user edit disable - * role create ENABLED - * user create ENABLED - * special users manage DISABLE - */ -$tlCfg->demoMode = OFF; -$tlCfg->demoSpecialUsers = array('admin'); - -/** - * If enabled, every Ext JS table in TestLink will offer an export button, - * which generates a file with the contents of the table. - * ATTENTION: This feature is fully experimental. Enable at your own risk! - * Enabling it can cause broken tables. - */ -$tlCfg->enableTableExportButton = DISABLED; - - -/** - * Taken from Mantis to implement better login security - * and solve TICKET 4342. - */ -$tlCfg->auth_cookie = $tlCfg->cookie->prefix . - "TESTLINK_USER_AUTH_COOKIE"; - -/** -Used when creating a Test Suite using copy -and you have choose $g_action_on_duplicate_name = 'generate_new' -if the name exist. -*/ -$g_prefix_name_for_copy = date("Y-m-d-H:i:s", time()); - - -/** - * Configurable templates this can help if you want to use a non standard template. - * i.e. you want to develop a new one without loosing the original template. - * key: original TL template name WITHOUT extension - * value: whatever name you want, only constrain you have to copy your template - * ON SAME FOLDER where original template is. - * See example below - */ -$g_tpl = array('inc_exec_controls' => 'inc_exec_img_controls.tpl'); -//$g_tpl = array('inc_exec_controls' => 'inc_exec_controls.tpl'); -$g_tpl['login'] = 'login/login-model-marcobiedermann.tpl'; - -// Example -// $g_tpl = array('tcView' => 'custom_tcView.tpl', -// 'tcSearchView' => 'myOwnTCSearchView.tpl', -// 'tcEdit' => 'tcEdit_ultraCool.tpl'); - -/** Add o replace images */ -$tlCfg->images = array(); - -// ---------------------------------------------------------------------------- -/* [REST API using Slim - Begin] */ -$tlCfg->restAPI = new stdClass(); - -// CRITIC -// This will work if your url to test link -// is something like -// -// https://testlink.antartic.org/ -// -$tlCfg->restAPI->basePath = "/lib/api/rest/v3"; - -// If your URL is like this -// https://myserver.ibiza.org/testlink/ -// You need to use: -// $basePath = "/testlink/lib/api/rest/v3"; -// -// The standard .htaccess provided with testlink, -// that is similar to the .htaccess provided by MantisBT -// it's ok!!! -// No need to proceed as detailed in this documentation -// - https://www.slimframework.com/docs/v4/start/web-servers.html -// Section: Running in a sub-directory -// -// - https://akrabat.com/running-slim-4-in-a-subdirectory/ -// BUT this is a good example to understand how to configure -// -/* [REST API using Slim - End] */ - - - -// ---------------------------------------------------------------------------- -/* [PROXY] */ -/* Used only */ -/* mantissoapInterface.class.php */ -/* jirasoapInterface.class.php */ -/* jirarestInterface.class.php */ -$tlCfg->proxy->host = null; -$tlCfg->proxy->port = null; -$tlCfg->proxy->login = null; -$tlCfg->proxy->password = null; - - -/** Plugins feature */ -define('TL_PLUGIN_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR); - -// ----- End of Config ------------------------------------------------------------------ -// -------------------------------------------------------------------------------------- -// DO NOT DO CHANGES BELOW -// -------------------------------------------------------------------------------------- - -/** Functions for check request status */ -require_once('configCheck.php'); - - -if( !defined('TL_JQUERY') ) -{ - define('TL_JQUERY','jquery-2.2.4.min.js' ); -} - -if( !defined('TL_DATATABLES_DIR') ) -{ - define('TL_DATATABLES_DIR','DataTables-1.10.24' ); -} - -/** root of testlink directory location seen through the web server */ -/* 20070106 - franciscom - this statement it's not 100% right - better use $_SESSION['basehref'] in the scripts. */ -define('TL_BASE_HREF', get_home_url(array('force_https' => $tlCfg->force_https))); - -clearstatcache(); -if ( file_exists( TL_ABS_PATH . 'custom_config.inc.php' ) ) -{ - require_once( TL_ABS_PATH . 'custom_config.inc.php' ); -} - - -if( !isset($tlCfg->attachments->access_icon) ) { - $tlCfg->attachments->access_icon = - ''; -} - - -// Important to do this only after custom_* to use (if exists) redefinition of -// $tlCfg->results['status_label_for_exec_ui'] -$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui']; - - -/** Support for localization */ -// @TODO move the code out of config and do it only once and -// not always in any include! -// @TODO a better parsing function should be include -$serverLanguage = false; -if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) -{ - @list($code) = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); - @list($a,$b) = explode("-",$code); - if ($a && $b) - { - $a = strtolower($a); - $b = strtoupper($a); - $serverLanguage = $a."_".$b; - } -} - -if(false !== $serverLanguage) -{ - if (array_key_exists($serverLanguage,$tlCfg->locales)) - { - $tlCfg->default_language = $serverLanguage; - } -} -define ('TL_DEFAULT_LOCALE', $tlCfg->default_language); - -// Reverted execution status is used for two applications. -// 1. To map code to CSS, Please if you add an status you need to add a corresponding CSS Class -// in the CSS files (see the gui directory) -// 2. to decode from code to some more human oriented to use in code -// -/** Revered list of Test Case execution results */ -$tlCfg->results['code_status'] = array_flip($tlCfg->results['status_code']); - -// Enable CSRF global protection -$tlCfg->csrf_filter_enabled = TRUE; - -// --------------------------------------------------------------------------------- -/** Converted and derived variables (Users should not modify this section) */ -define('REFRESH_SPEC_TREE',$tlCfg->spec_cfg->automatic_tree_refresh ? 1 : 0); -define('TL_SORT_TABLE_ENGINE',$g_sort_table_engine); -define("TL_REPOSITORY_MAXFILESIZE", 1024*1024*$tlCfg->repository_max_filesize); - -define('TL_XMLEXPORT_HEADER', "charset . "\"?>\n"); - - - -// --------------------------------------------------------------------------------- -// when a role is deleted, a new role must be assigned to all users -// having role to be deleted -// A right choice seems to be using $g_default_roleid. -// You can change this adding a config line in custom_config.inc.php -// @TODO martin: remove - use directly $tlCfg->default_roleid; -$g_role_replace_for_deleted_roles = $tlCfg->default_roleid; - - -/** - * Using "|" in the testsuite name causes malformed URLs - * regexp used to check for chars not allowed in: - * test project, test suite and testcase names. - * @TODO martin: encode harm characters @see http://cz.php.net/urlencode (and remove the parameter) - * - * now is preg pattern - */ -$g_ereg_forbidden = "/[|]/i"; - - - -/** - * @TODO remove from TL - unfinished refactorization; - * use $tlCfg instead of old variables and constants - */ -define('TL_IMPORT_ROW_MAX', $tlCfg->import_max_row); -define('TL_TPL_CHARSET', $tlCfg->charset); -define('TITLE_SEP',$tlCfg->gui_title_separator_1); -define('TITLE_SEP_TYPE2',$tlCfg->gui_title_separator_2); -define('TITLE_SEP_TYPE3',$tlCfg->gui_title_separator_2); // obsolete: use type 1,2 -define('TL_FRMWORKAREA_LEFT_FRAME_WIDTH', $tlCfg->frame_workarea_default_width); -define('TL_TEMP_PATH', $tlCfg->temp_dir); - -$tlCfg->gui->title_separator_1 = $tlCfg->gui_title_separator_1; -$tlCfg->gui->title_separator_2 = $tlCfg->gui_title_separator_2; -$tlCfg->gui->role_separator_open = $tlCfg->gui_separator_open; -$tlCfg->gui->role_separator_close = $tlCfg->gui_separator_close; - -$tlCfg->gui->version_separator_open = $tlCfg->gui_separator_open; -$tlCfg->gui->version_separator_close = $tlCfg->gui_separator_close; - - -/** - * Globals for Events storage - */ -$g_event_cache = array(); - -/** - * Globals for Plugins - */ +api = new stdClass(); +$tlCfg->cookie = new stdClass(); +$tlCfg->document_generator = new stdClass(); + +$tlCfg->spec_cfg = new stdClass(); + +$tlCfg->exec_cfg = new stdClass(); +$tlCfg->exec_cfg->view_mode = new stdClass(); +$tlCfg->exec_cfg->exec_mode = new stdClass(); + +$tlCfg->UDFStripHTMLTags = true; + +// allow to define additional execution types other than +// defined in testcase.class.php +// array(code => lblkey) +// code int value > latest standard execution code defined. +// lblkey => key to be used on lang_get() call. +// +$tlCfg->custom_execution_types = null; + +$tlCfg->gui = new stdClass(); +$tlCfg->gui->custom_fields = new stdClass(); +$tlCfg->testcase_cfg = new stdClass(); +$tlCfg->req_cfg = new stdClass(); +$tlCfg->validation_cfg = new stdClass(); +$tlCfg->custom_fields = new stdClass(); +$tlCfg->req_spec_cfg = new stdClass(); +$tlCfg->diffEngine = new stdClass(); +$tlCfg->tplanDesign = new stdClass(); + +$tlCfg->notifications = new stdClass(); +$tlCfg->proxy = new stdClass(); + +$tlCfg->reqTCLinks = new stdClass(); + +$tlCfg->keywords = new stdClass(); + +$tlCfg->keywords->annotations = [ + "@TestCaseSpecDisplay:" +]; + +$tlCfg->keywords->onDeleteCheckFrozenTCVersions = true; +$tlCfg->keywords->onDeleteCheckExecutedTCVersions = true; + +// main key testproject PREFIX +// element array +// 'addTCLinkIntoITS' true => add note to Issue Tracker to issue with +// ISSUE ID similar to the KEYWORD (see kwPrefix below) +// +// 'kwPrefix' to remove from keyword to create the ISSUE ID +// +$tlCfg->keywords->byTestProject = array(); + +$tlCfg->keywords->headsUpTSuiteOnExec = 'CMD_OPEN_ON_EXEC'; + +$tlCfg->accessWithoutLogin = array(); + +$tlCfg->platforms = new stdClass(); +$tlCfg->platforms->allowedOnAssign = [ + 'enable_on_design' => false, + 'enable_on_execution' => true, + 'is_open' => true +]; + +/** + * + * @uses database access definition (generated automatically by TL installer) + */ +@include_once ('config_db.inc.php'); +if (! defined('DB_TABLE_PREFIX')) { + define('DB_TABLE_PREFIX', ''); +} + +/** + * The root dir for the testlink installation with trailing slash + */ +define('TL_ABS_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR); + +/** + * Just for documentation + */ +$tlCfg->testlinkdotorg = 'http://www.testlink.org'; + +/** + * GUI themes (base for CSS and images)- modify if you create own one + */ +$tlCfg->theme_dir = 'gui/themes/default/'; + +/** + * Dir for compiled templates + */ +$tlCfg->temp_dir = TL_ABS_PATH . 'gui' . DIRECTORY_SEPARATOR . 'templates_c' . + DIRECTORY_SEPARATOR; +if ($tpltmp = getenv('TESTLINK_TEMPLATES_C')) { + $tlCfg->temp_dir = trim($tpltmp); +} + +/** + * default filenames of CSS files of current GUI theme + */ +define('TL_CSS_MAIN', 'testlink.css'); +define('TL_CSS_PRINT', 'tl_print.css'); +define('TL_CSS_DOCUMENTS', 'tl_documents.css'); + +define('TL_THEME_BASE_DIR', $tlCfg->theme_dir); +define('TL_THEME_IMG_DIR', $tlCfg->theme_dir . 'images/'); +define('TL_THEME_CSS_DIR', $tlCfg->theme_dir . 'css/'); +define('TL_TESTLINK_CSS', TL_THEME_CSS_DIR . TL_CSS_MAIN); +define('TL_PRINT_CSS', TL_THEME_CSS_DIR . TL_CSS_PRINT); + +// name of your custom.css, place it in same folder that standard TL css +// null or '' => do not use +$tlCfg->custom_css = null; + +/** + * Include constants and magic numbers (users should not change it) + */ +require_once (TL_ABS_PATH . 'cfg' . DIRECTORY_SEPARATOR . 'const.inc.php'); + +// ---------------------------------------------------------------------------- +/** + * + * @var string used to have (when needed) a possibility to identify different TL instances + * @since 1.9.4 used on mail subject when mail logger is used + */ +$tlCfg->instance_name = 'Main TestLink Instance'; + +// do not use blanks or special characters, use a short string +$tlCfg->instance_id = 'TLM'; + +$tlCfg->gui->ux = 'tl-classic'; + +/** + * Copied from MantisBT + * + * Prefix for all TestLink cookies + * This should be an identifier which does not include spaces or periods, + * and should be unique per TestLink installation, especially if + * $tlCfg->cookie_path is not restricting the cookies' scope to the actual + * TestLink directory. + * + * @see $tlCfg->cookie->path + * @global string $tlCfg->cookie->prefix + */ +$tlCfg->cookie->prefix = 'TESTLINK1920'; + +/** + * + * @link http://php.net/function.setcookie + * + */ +$tlCfg->cookie->expire = (time() + 60 * 60 * 24 * 30); // 30 days; +$tlCfg->cookie->domain = ''; +$tlCfg->cookie->secure = false; +$tlCfg->cookie->httponly = false; + +$tlCfg->cookie->testProjectMemory = $tlCfg->cookie->prefix . '_PROJ_ID_USER_ID_'; + +/** + * Copied from MantisBT + * + * Specifies the path under which a cookie is visible + * All scripts in this directory and its sub-directories will be able + * to access TestLink cookies. + * It is recommended to set this to the actual TestLink path. + * + * @link http://php.net/function.setcookie + * @global string $tlCfg->cookie->path + */ +$tlCfg->cookie->path = '/'; + +/* [ROLE INHERITANCE] */ +/** + * possible values + * + * 'testproject' + * 'global' + * + * 'testproject' + * till a role is specifically assigned to test plan, test plan role + * will be inherited from test project role. + * + * IMPORTANT NOTICE + * test project role can be specifically assigned or inherited from + * user's global role. + * + * if test project specifically assigned role changes, and test plan role was inherited, then it will also changes, due to inheritance. + * + * + * 'global' + * till a role is specifically assigned to test plan, test plan role + * will be inherited from user's global role, and NOT from test project + * specifically assigned role. + * + * if test project specifically assigned role changes, will not be changed. + */ +$tlCfg->testplan_role_inheritance_mode = 'testproject'; + +/* [LOCALIZATION] */ + +/** @var string Default localization for users */ +// The value must be available in $$tlCfg->locales (see cfg/const.inc.php). +// Note: An attempt will be done to establish the default locale +// automatically using $_SERVER['HTTP_ACCEPT_LANGUAGE'] +$tlCfg->default_language = 'en_GB'; + +/** + * + * @var string Charset 'UTF-8' is only officially supported charset (Require + * MySQL version >= 4.1) 'ISO-8859-1' or another Charset could be set for + * backward compatability by experienced users. However we have not resources + * to support such patches. + */ +$tlCfg->charset = 'UTF-8'; + +/** + * + * @var string characters used to surround a description in the user interface + * (for example role) + */ +$tlCfg->gui_separator_open = '['; +$tlCfg->gui_separator_close = ']'; +$tlCfg->gui_room = '[ %s ]'; + +/** @var string Title separators are used when componing an title using several strings */ +$tlCfg->gui_title_separator_1 = ' : '; // object : name (Test Specification : My best product) +$tlCfg->gui_title_separator_2 = ' - '; // parent - child + +/** + * + * @var string delimiter used to create DOC ID in this way: + * . g_testcase_cfg->glue_character . + * Could not be empty + */ +$tlCfg->testcase_cfg->glue_character = '-'; + +$tlCfg->testcase_cfg->import = new stdClass(); +$tlCfg->testcase_cfg->import->wordwrap = new stdClass(); + +/* 0 => do not apply wordwrap() */ +$tlCfg->testcase_cfg->import->wordwrap->summary = 0; +$tlCfg->testcase_cfg->import->wordwrap->preconditions = 0; +$tlCfg->testcase_cfg->import->wordwrap->actions = 0; +$tlCfg->testcase_cfg->import->wordwrap->expected_results = 0; + +/** + * fonts set used to draw charts + */ +$tlCfg->charts_font_path = TL_ABS_PATH . + "vendor/wp-statistics/pchart/src/Fonts/tahoma.ttf"; +/** + * font size used to draw charts + */ +$tlCfg->charts_font_size = 8; + +// ---------------------------------------------------------------------------- +/* [SERVER ENVIRONMENT] */ + +/** + * TICKET 4969: Add Setting to Force HTTPS + */ +$tlCfg->force_https = false; + +/** + * + * @var integer Set the session timeout for inactivity [minutes]. + * Default high value disables this feature. + */ +$tlCfg->sessionInactivityTimeout = 9900; + +/** + * Set the session timeout value (in minutes). + * This will prevent sessions timing out after very short periods of time + * Warning: your server could block this settings + */ +// ini_set('session.cache_expire',900); + +/** + * Set the session garbage collection timeout value (in seconds) + * The default session garbage collection in php is set to 1440 seconds (24 minutes) + * If you want sessions to last longer this must be set to a higher value. + * You may need to set this in your global php.ini if the settings don't take effect. + */ +// ini_set('session.gc_maxlifetime', 60*90); + +$tlCfg->notifications->userSignUp = new stdClass(); +$tlCfg->notifications->userSignUp->enabled = true; // @see notifyGlobalAdmins() +$tlCfg->notifications->userSignUp->to = new stdClass(); +$tlCfg->notifications->userSignUp->to->roles = array( + TL_ROLES_ADMIN +); +$tlCfg->notifications->userSignUp->to->users = null; // i.e. array('login01','login02'); + +// ---------------------------------------------------------------------------- +/* [LOGGING] */ + +/** + * Error reporting - do we want php errors to show up for users + */ +/** + * configure on custom_config.inc.php + */ +/** + * error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING); + */ +/** + * error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); + */ +error_reporting(E_ALL); + +/** + * + * @var string Default level of logging (NONE, ERROR, INFO, DEBUG, EXTENDED) + * is not used by tlLogger, we need to change this in future. + */ +$tlCfg->log_level = 'ERROR'; + +/** @var boolean show smarty debug window */ +$tlCfg->smarty_debug = false; + +/** + * + * @var string Path to store logs - + * for security reasons (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/) + * put it out of reach via web or configure access denied. + */ +$tlCfg->log_path = '/var/testlink/logs/'; /* unix example */ +if ($lp = getenv('TESTLINK_LOG_PATH')) { + $tlCfg->log_path = trim($lp); +} + +/** + * + * @var string How to warning user when security weak points exists. + * + * 'SCREEN': messages will displayed on login screen, and tl desktop + * 'FILE': a file with a list is created but users are not notified via GUI + * user will receive a message on screen. (default) + * 'SILENT': same that FILE, but user will not receive message on screen. + */ +$tlCfg->config_check_warning_mode = 'FILE'; + +/** + * ONCE_FOR_SESSION + * ALWAYS + */ +$tlCfg->config_check_warning_frequence = 'ONCE_FOR_SESSION'; + +/** + */ +$tlCfg->userDocOnDesktop = OFF; + +/** + * Configure if individual logging data stores are enabled of disabled + * Possibile values to identify loggers: 'db','file' + * $g_loggerCfg=null; all loggers enabled + * $g_loggerCfg['db']['enable']=true/false; + * $g_loggerCfg['file']['enable']=true/false; + * $g_loggerCfg['mail']['enable']=true/false; + */ +$g_loggerCfg = array( + 'mail' => array( + 'enable' => false + ) +); + +/** @var integer All events older this value [days] are removed from the db, during login */ +$g_removeEventsOlderThan = 30; + +/** + * + * @var map keys: 'all' + values present on proprety of logger class $loggerTypeDomain + * values can be only these defined on logger.class.php + * @since 1.9.4 + * example array('all' => array('INFO','AUDIT'), + * 'mail' => array('ERROR')) + * + * $tlCfg->loggerFilter = array('db' => array('DEBUG','AUDIT','WARNING','ERROR'), + * 'file' => array('NONE')); + * + */ +$tlCfg->loggerFilter = null; // default defined on logger.class.php ; + +// ---------------------------------------------------------------------------- +/* [SMTP] */ + +/** + * + * @var string SMTP server name or IP address ("localhost" should work in the most cases) + * Configure using custom_config.inc.php + * @uses lib/functions/email_api.php + */ +$g_smtp_host = '[smtp_host_not_configured]'; # SMTP server MUST BE configured + +# Configure using custom_config.inc.php +$g_tl_admin_email = '[testlink_sysadmin_email_not_configured]'; # for problem/error notification +$g_from_email = '[from_email_not_configured]'; # email sender +$g_return_path_email = '[return_path_email_not_configured]'; + +/** + * Email notification priority (low by default) + * Urgent = 1, Not Urgent = 5, Disable = 0 + */ +$g_mail_priority = 5; + +/** + * Taken from mantis for phpmailer config + * select the method to mail by: + * PHPMAILER_METHOD_MAIL - mail() + * PHPMAILER_METHOD_SENDMAIL - sendmail + * PHPMAILER_METHOD_SMTP - SMTP + */ +$g_phpMailer_method = PHPMAILER_METHOD_SMTP; + +/** + * Configure only if SMTP server requires authentication + */ +$g_smtp_username = ''; # user +$g_smtp_password = ''; # password + +/** + * This control the connection mode to SMTP server. + * Can be '', 'ssl','tls' + * + * @global string $g_smtp_connection_mode + */ +$g_smtp_connection_mode = ''; + +/** + * The smtp port to use. + * The typical SMTP ports are 25 and 587. The port to use + * will depend on the SMTP server configuration and hence others may be used. + * + * @global int $g_smtp_port + */ +$g_smtp_port = 25; + +/** + * + * @see https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Opportunistic TLS + */ +$g_SMTPAutoTLS = false; + +// ---------------------------------------------------------------------------- +/* [User Authentication] */ + +/** + * Login authentication method: + * 'MD5' => use password stored on db => will be deprecated and DB used. + * 'DB' => Same as MD5 use password stored on db + * 'LDAP' => use password from LDAP Server + */ +$tlCfg->authentication['domain'] = array( + 'DB' => array( + 'description' => 'DB', + 'allowPasswordManagement' => true + ), + 'LDAP' => array( + 'description' => 'LDAP', + 'allowPasswordManagement' => false + ) +); + +/* Default Authentication method */ +$tlCfg->authentication['method'] = 'DB'; + +// Applies only if authentication method is DB. +// Used when: +// 1. user sign up +// +// null => only check password IS NOT EMPTY +// +// $tlCfg->passwordChecks = array('minlen' => 8,'maxlen' => 20,'number' => true,'letter' => true, +// 'capital' => true, 'symbol' => true); +$tlCfg->passwordChecks = null; + +// Applies ONLY to the HTML input. +// If auth method is DB, password will be stored as MD5 HASH that requires 32 chars (128 bits) +$tlCfg->loginPagePasswordMaxLenght = 40; + +/** + * Standard logout url, used also when SSO is used and hint to skip SSO is used. + * '' => use standard TestLink page + */ +$tlCfg->logoutUrl = ''; + +// users that will not allow expiration date management on GUI +$tlCfg->noExpDateUsers = array( + 'admin' +); + +/** + * OAUTH auth + * Configure this on custom_config.inc.php + */ + +$tlCfg->OAuthServers = array(); + +// Google +// see cfg/oauth_samples/oauth.google.inc.php + +// Github +// see cfg/oauth_samples/oauth.github.inc.php + +// Gitlab +// see cfg/oauth_samples/oauth.gitlab.inc.php + +// Microsoft +// see cfg/oauth_samples/oauth.microsoft.inc.php + +// Azure AD +// see cfg/oauth_samples/oauth.azuread.inc.php + +/** + * Single Sign On authentication + * + * SSO_method: CLIENT_CERTIFICATE, tested with Apache Webserver + * SSP_method: WEBSERVER_VAR, tested with Apache and Shibboleth Service Provider. + */ +$tlCfg->authentication['SSO_enabled'] = false; +$tlCfg->authentication['SSO_logout_destination'] = 'YOUR LOGOUT DESTINATION'; + +// Tested with Apache Webserver +// $tlCfg->authentication['SSO_method'] = 'CLIENT_CERTIFICATE'; +// $tlCfg->authentication['SSO_uid_field'] = 'SSL_CLIENT_S_DN_Email'; + +// Tested with Apache and Shibboleth Service Provider +// $tlCfg->authentication['SSO_method'] = 'WEBSERVER_VAR'; +// $tlCfg->authentication['SSO_uid_field'] = 'REMOTE_USER'; +// $tlCfg->authentication['SSO_user_target_dbfield'] = 'email'; + +// Allow to restrict authentication to SSO +$tlCfg->authentication['sso_only'] = false; + +/** + * LDAP authentication credentials, Multiple LDAP Servers can be used. + * User will be authenticaded against each server (one after other using array index order) + * till authentication succeed or all servers have been used. + */ +$tlCfg->authentication['ldap'] = array(); +$tlCfg->authentication['ldap'][1]['ldap_server'] = 'localhost'; +$tlCfg->authentication['ldap'][1]['ldap_port'] = '389'; +$tlCfg->authentication['ldap'][1]['ldap_version'] = '3'; // could be '2' in some cases +$tlCfg->authentication['ldap'][1]['ldap_root_dn'] = 'dc=mycompany,dc=com'; +$tlCfg->authentication['ldap'][1]['ldap_bind_dn'] = ''; // Left empty for anonymous LDAP binding +$tlCfg->authentication['ldap'][1]['ldap_bind_passwd'] = ''; // Left empty for anonymous LDAP binding +$tlCfg->authentication['ldap'][1]['ldap_tls'] = false; // true -> use tls + +// Following configuration parameters are used to build +// ldap filter and ldap attributes used by ldap_search() +// +// filter => "(&$t_ldap_organization($t_ldap_uid_field=$t_username))"; +// attributess => array( $t_ldap_uid_field, 'dn' ); +// +// This can be used to manage situation like explained on post on forum: +// ActiveDirectory + users in AD group +// +$tlCfg->authentication['ldap'][1]['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)' +$tlCfg->authentication['ldap'][1]['ldap_uid_field'] = 'uid'; // Use 'sAMAccountName' for Active Directory + +// Configure following fields in custom_config.inc.php according your configuration +$tlCfg->authentication['ldap'][1]['ldap_email_field'] = 'mail'; +$tlCfg->authentication['ldap'][1]['ldap_firstname_field'] = 'givenname'; +$tlCfg->authentication['ldap'][1]['ldap_surname_field'] = 'sn'; + +// Follows Mantisbt idea. +// true if user does not exist on DB, but can be get from LDAP, +// the user will be created AUTOMATICALLY with default user role. +// Create user with following data from LDAP +// mail +// name +// surname +$tlCfg->authentication['ldap_automatic_user_creation'] = false; + +/** + * Enable/disable Users to create accounts on login page + */ +$tlCfg->user_self_signup = true; + +/** + * What happens when Administrator push the Reset Password Button + * 'send_password_by_mail' + * 'display_on_screen' + */ +$tlCfg->password_reset_send_method = 'send_password_by_mail'; + +/** + * Validating new user login names + * Taken mantisbt version 1.2.5 - www.mantisbt.org and adapted + * + * The regular expression to use when validating new user login names + * The default regular expression allows a-z, A-Z, 0-9, +, -, dot, @ and underscore. + * For testing regular expressions, use http://rubular.com/. + * For regular expression to englihs, use http://xenon.stanford.edu/~xusch/regexp/analyzer.html + */ +$tlCfg->validation_cfg->user_login_valid_regex = '/^([a-z\d\-.+_@]+(@[a-z\d\-.]+\.[a-z]{2,4})?)$/i'; + +/** + * Validating user email addresses + * Example of other possibilities: + * + * $regex = "/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*" . + * "@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i"; + * $regex = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/"; + * + */ +// +// This expression does not allow Top Level Domian (last part of domain name) longer than 4 +// If you need to change this +// Configure this on custom_config.inc.php +$tlCfg->validation_cfg->user_email_valid_regex_js = "/^(\w+)([-+.][\w]+)*@(\w[-\w]*\.){1,5}([A-Za-z]){2,4}$/"; +$tlCfg->validation_cfg->user_email_valid_regex_php = "/^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/U"; + +// -------------------------------------------------------------------------------------- +/* [API] */ + +/** + * XML-RPC API availability - do less than promised ;) + * false => user are not able to generate and set his/her API key. + * XML-RPC server do not check this config in order to answer or not a call. + */ + +$tlCfg->api->enabled = true; + +// used to display API ID info in the *View pages +$tlCfg->api->id_format = "[ID: %s ]"; + +// --------------------------------------------------------------------------------- +/* [GUI LAYOUT] */ + +/** + * Company logo (used by navigation bar and login page page) + */ +$tlCfg->logo_login = 'tl-logo-transparent-25.png'; +$tlCfg->logo_navbar = 'tl-logo-transparent-12.5.png'; + +/** + * Height of the navbar always displayed + */ +$tlCfg->navbar_height = 70; + +/** + * Login page could show an informational text + */ +$tlCfg->login_info = ''; // Empty by default + +/** + * controls if pagination (via Javascript) will be enabled + */ +$tlCfg->gui->projectView = new stdClass(); +$tlCfg->gui->projectView->pagination = new stdClass(); +$tlCfg->gui->projectView->pagination->enabled = true; +$tlCfg->gui->projectView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; + +$tlCfg->gui->usersAssign = new stdClass(); +$tlCfg->gui->usersAssign->pagination = new stdClass(); +$tlCfg->gui->usersAssign->pagination->enabled = true; +$tlCfg->gui->usersAssign->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; + +$tlCfg->gui->planView = new stdClass(); +$tlCfg->gui->planView->pagination = new stdClass(); +$tlCfg->gui->planView->pagination->enabled = true; +$tlCfg->gui->planView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; +$tlCfg->gui->planView->itemQtyForTopButton = 10; + +$tlCfg->gui->buildView = new stdClass(); +$tlCfg->gui->buildView->pagination = new stdClass(); +$tlCfg->gui->buildView->pagination->enabled = true; +$tlCfg->gui->buildView->pagination->length = '[20, 40, 60, -1], [20, 40, 60, "All"]'; +$tlCfg->gui->buildView->itemQtyForTopButton = 10; + +$tlCfg->gui->keywordsView = new stdClass(); +$tlCfg->gui->keywordsView->pagination = new stdClass(); +$tlCfg->gui->keywordsView->pagination->enabled = true; +$tlCfg->gui->keywordsView->pagination->length = '[40, 60, 80, -1], [40, 60, 80, "All"]'; +$tlCfg->gui->keywordsView->itemQtyForTopButton = 10; + +/** + * controls if operation area (buttons) starts open ('' or 'inline') or closed ('none') on: + * - test suite management + * - test case management + * - req. + * spec management + * - req. management + */ +$tlCfg->gui->op_area_display = new stdClass(); + +// test_spec_container => test project, test suite +$tlCfg->gui->op_area_display->test_spec_container = 'none'; // '' +$tlCfg->gui->op_area_display->test_case = 'none'; // 'inline' +$tlCfg->gui->op_area_display->req_spec_container = 'none'; // 'inline' +$tlCfg->gui->op_area_display->req = 'none'; // 'inline' + +/** + * + * @var string Availability of Test Project specific background colour + * 'background' -> standard behaviour for 1.6.x you can have a different + * background colour for every test project. + * 'none' -> new behaviour no background color change + */ +$tlCfg->gui->testproject_coloring = 'none'; // I'm sorry default is not coloring using coloring is a pain + // and useless +/** + * + * @todo havlatm4francisco Ok, then merge these two attributes into one + */ +/** + * default background color + */ +$tlCfg->gui->background_color = '#9BD'; + +// ENABLED: on features that assign user role to test projects and test plan, colour user name +// according GLOBAL role +// DISABLED: do not color [STANDARD BEHAVIOUR] +$tlCfg->gui->usersAssignGlobalRoleColoring = DISABLED; + +// Enable/disable rounded corners via javascript +$tlCfg->gui->round_corners = new stdClass(); +$tlCfg->gui->round_corners->exec_history = ENABLED; +$tlCfg->gui->round_corners->tc_title = ENABLED; +$tlCfg->gui->round_corners->tc_spec = ENABLED; + +/** + * Display name definition (used to build a human readable display name for users) + * Example of values: + * '%first% %last%' -> John Cook + * '%last%, %first%' -> Cook John + * '%first% %last% %login%' -> John Cook [ux555] + */ +$tlCfg->username_format = '%login%'; + +/** + * Configure the frame frmWorkArea navigator width + */ +$tlCfg->frame_workarea_default_width = "30%"; + +/** + * true => icon edit will be added into as indication an edit features + */ +$tlCfg->gui->show_icon_edit = false; + +/** + * '' => test project name + * 'prefix' => prefix : test project name + * + * ATTENTION : * is used to indicate test project is INACTIVE + * see also $tlCfg->gui->tprojects_combo_order_by + */ +$tlCfg->gui->tprojects_combo_format = 'prefix'; + +/** + * Order to use when building a testproject combobox (value must be SQL compliant) + * For example: + * 'ORDER BY name' + * 'ORDER_BY nodes_hierarchy.id DESC' -> similar effect to order last created firts + */ +// $tlCfg->gui->tprojects_combo_order_by = 'ORDER BY nodes_hierarchy.id DESC'; +$tlCfg->gui->tprojects_combo_order_by = 'ORDER BY TPROJ.prefix ASC'; + +/** + * Configure the input size of test case search by id on navigation bar. + * This value will be added to the length of the prefix to dynamically set input size. + * Example: prefix is "projectA-" -> length of prefix is 9 + * Now the here defined value (default: 6) will be added to the prefix length + * -> Input field will have an input size of 15 + */ +$tlCfg->gui->dynamic_quick_tcase_search_input_size = 6; + +// used to round percentages on metricsDashboard.php +$tlCfg->dashboard_precision = 2; + +/** + * Choose what kind of webeditor you want to use in every TL area. + * This configuration + * will be used if no element with search key (area) is found on this structure. + * Every element is a mp with this configuration keys: + * + * 'type': + * 'ckeditor' + * 'tinymce' ==> will be deprecated in future versions + * 'none' -> use plain text area input field + * 'toolbar': only applicable for type = 'fckeditor', 'ckeditor' + * name of ToolbarSet (See: http://docs.fckeditor.net/ for more information about ToolbarSets) + * TestLink stores own definitions in /cfg/tl_ckeditor_config.js + * + * + * The next keys/areas are supported: + * 'all' (default setting), + * 'design', 'steps_design', 'testplan', 'build', 'testproject', 'role', 'requirement', 'requirement_spec'. + * + * Examples: + * + * // Copy this to custom_config.inc.php if you want use 'tinymce' as default. + * $tlCfg->gui->text_editor['all'] = array( 'type' => 'tinymce'); + * // Copy this to custom_config.inc.php if you want use 'nome' as default. + * $tlCfg->gui->text_editor['all'] = array( 'type' => 'none'); + * //This configuration is useful only if default type is set to 'fckeditor' + * $tlCfg->gui->text_editor['design'] = array('toolbar' => 'tl_mini'); + * + * $tlCfg->gui->text_editor['testplan'] = array( 'type' => 'none'); + * $tlCfg->gui->text_editor['build'] = array( 'type' => 'fckeditor','toolbar' => 'tl_mini'); + * $tlCfg->gui->text_editor['testproject'] = array( 'type' => 'tinymce'); + * $tlCfg->gui->text_editor['role'] = array( 'type' => 'tinymce'); + * $tlCfg->gui->text_editor['requirement'] = array( 'type' => 'none'); + * $tlCfg->gui->text_editor['requirement_spec'] = array( 'type' => 'none'); + * + * + * Hint: After doing configuration changes, clean you Browser's cookies and cache + */ +/* + * $tlCfg->gui->text_editor = array(); + * $tlCfg->gui->text_editor['all'] = array('type' => 'fckeditor', + * 'toolbar' => 'tl_default', + * 'configFile' => 'cfg/tl_ckeditor_config.js',); + * $tlCfg->gui->text_editor['execution'] = array( 'type' => 'none'); + */ + +$tlCfg->gui->text_editor = array(); +$tlCfg->gui->text_editor['all'] = [ + 'type' => 'ckeditor', + 'toolbar' => 'Testlink', + 'configFile' => 'cfg/tl_ckeditor_config.js', + 'height' => 150 +]; + +// mini toolbar for test case steps edit +$tlCfg->gui->text_editor['steps_design'] = [ + 'type' => 'ckeditor', + 'toolbar' => 'TestlinkMini', + 'configFile' => 'cfg/tl_ckeditor_config.js', + 'height' => 100 +]; + +// +$tlCfg->gui->text_editor['preconditions'] = [ + 'type' => 'ckeditor', + 'toolbar' => 'Testlink', + 'configFile' => 'cfg/tl_ckeditor_config.js', + 'height' => 150 +]; + +$tlCfg->gui->text_editor['summary'] = [ + 'type' => 'ckeditor', + 'toolbar' => 'Testlink', + 'configFile' => 'cfg/tl_ckeditor_config.js', + 'height' => 600 +]; + +$tlCfg->gui->text_editor['execution'] = array( + 'type' => 'none' +); +$tlCfg->gui->text_editor['edit_execution'] = array( + 'type' => 'none', + 'cols' => 80, + 'rows' => 20 +); +$tlCfg->gui->text_editor['display_execution_notes'] = array( + 'type' => 'none', + 'cols' => 80, + 'rows' => 20 +); + +/** + * User can choose order of menu areas + */ +$tlCfg->gui->layoutMainPageLeft = array( + 'testProject' => 1, + 'userAdministration' => 2, + 'requirements' => 3, + 'testSpecification' => 4, + 'general' => 5 +); +$tlCfg->gui->layoutMainPageRight = array( + 'testPlan' => 1, + 'testExecution' => 2, + 'testPlanContents' => 3 +); + +/** + * Enable warning on a changed content before an user leave a page. + * + * Tested in: + * - IE8 OK + * - Firefox 3 OK + * - Chrome FAIL + * + * Does not work in Webkit browsers (Chrome, Safari) when using frames. + * Bug in webkit: https://bugs.webkit.org/show_bug.cgi?id=19418 + */ + +// seems that with config options that will be used on javascript via smarty template variables +// we are having problems using false/true => use 0/1 (or our CONSTANT DISABLED/ENABLED) +$tlCfg->gui->checkNotSaved = ENABLED; + +// ---------------------------------------------------------------------------- +/* [GUI: TREE] */ + +/** + * Default ordering value for new Test Suites and Test Cases to separate them + */ +$tlCfg->treemenu_default_testsuite_order = 1; +$tlCfg->treemenu_default_testcase_order = 1000; + +/** + * show/hide testcase id on tree menu + */ +$tlCfg->treemenu_show_testcase_id = true; + +/** + * Reorder test cases based on TC Name or External ID in tree on + * test suite level using reorder button + */ +// 'EXTERNAL_ID' -> Sort on Test Case External ID field displayed on tree.(Default) +// 'NAME' -> Sort on Test Case Name field + +$tlCfg->testcase_reorder_by = 'EXTERNAL_ID'; +// $tlCfg->testcase_reorder_by = 'NAME'; + +// ---------------------------------------------------------------------------- +/* [GUI: Javascript libraries] */ + +// May be in future another table sort engine will be better +// kryogenix.org -> Stuart Langridge sortTable +// '' (empty string) -> disable table sorting feature +$g_sort_table_engine = 'kryogenix.org'; + +// -------------------------------------------------------------------------------------- +/* [Reports] */ +$tlCfg->reportsCfg = new stdClass(); + +// Displayed execution statuses to use on reports (ordered). */ +$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui']; + +/** + * Default Offset in seconds for reporting start date (reports with date range) + * + * @uses lib/results/resultsMoreBuilds.php + */ +$tlCfg->reportsCfg->start_date_offset = (7 * 24 * 60 * 60); // one week + +// minutes part is ignored but must be configured. +// Hint: set always to :00 +$tlCfg->reportsCfg->start_time = '00:00'; + +// Result matrix (resultsTC.php) +$tlCfg->resultMatrixReport = new stdClass(); + +// Shows an extra column with the result of the latest execution on +// the lastest CREATED build +$tlCfg->resultMatrixReport->buildColumns['showExecutionResultLatestCreatedBuild'] = true; + +// Result matrix (resultsTC.php) +// Shows an extra column with the note of latest execution on +// the lastest CREATED build +$tlCfg->resultMatrixReport->buildColumns['showExecutionNoteLatestCreatedBuild'] = true; + +// Show build columns in revers order. The latest build is to the left +$tlCfg->resultMatrixReport->buildColumns['latestBuildOnLeft'] = false; + +// After having got performance and usability issue, a limit on max qty of builds +// allowed on data extration has been set. +// Is absolutely arbitrary +// +$tlCfg->resultMatrixReport->buildQtyLimit = 6; + +// ORDER BY sql clause, refers to builds table columns +$tlCfg->resultMatrixReport->buildOrderByClause = " ORDER BY name ASC"; + +// Show all available status details for test plans on metrics dashboard +$tlCfg->metrics_dashboard = new stdClass(); +$tlCfg->metrics_dashboard->show_test_plan_status = false; + +// ---------------------------------------------------------------------------- +/* [GENERATED DOCUMENTATION] */ + +/** + * Texts and settings for printed documents + * Image is expected in directory /gui/themes//images/ + * Leave text values empty if you would like to hide parameters. + */ +$tlCfg->document_generator->company_name = 'TestLink Community [configure $tlCfg->document_generator->company_name]'; +$tlCfg->document_generator->company_copyright = '2021 © TestLink Community'; +$tlCfg->document_generator->confidential_msg = ''; + +// Logo for generated documents +$tlCfg->document_generator->company_logo = $tlCfg->logo_login; +$tlCfg->document_generator->company_logo_height = '53'; + +/** + * CSS used in printed html documents + */ +$tlCfg->document_generator->css_template = 'css/tl_documents.css'; + +// CSS file for Requirement Specification Document, Requirement and Requirement Spec Print View +$tlCfg->document_generator->requirement_css_template = 'css/tl_documents.css'; + +/** + * Misc settings + */ +// Display test case version when creating: +// - test spec document +// - test reports +$tlCfg->document_generator->tc_version_enabled = true; + +// ---------------------------------------------------------------------------- +/* [Test Executions] */ + +// $tlCfg->exec_cfg->enable_test_automation = DISABLED; + +// ENABLED -> enable XML-RPC calls to external test automation server +// new buttons will be displayed on execution pages +// DISABLED -> disable +$tlCfg->exec_cfg->enable_test_automation = DISABLED; + +// ASCending -> last execution at bottom +// DESCending -> last execution on top [STANDARD BEHAVIOUR] +$tlCfg->exec_cfg->history_order = 'DESC'; + +// true -> the whole execution history for the choosen build will be showed +// false -> just last execution for the choosen build will be showed [STANDARD BEHAVIOUR] +$tlCfg->exec_cfg->history_on = false; + +// true -> test case VERY LAST (i.e. in any build) execution status will be displayed [STANDARD BEHAVIOUR] +// false -> only last result on current build. +$tlCfg->exec_cfg->show_last_exec_any_build = true; + +// true -> History for all builds will be shown +// false -> Only history of the current build will be shown [STANDARD BEHAVIOUR] +$tlCfg->exec_cfg->show_history_all_builds = false; + +// true -> History for all platforms (if any exists for test plan) will be shown +// false -> Only history of the current platform will be shown [STANDARD BEHAVIOUR] +$tlCfg->exec_cfg->show_history_all_platforms = false; + +// different models for the attachments management on execution page +// $att_model_m1 -> shows upload button and title +// $att_model_m2 -> hides upload button and title +$tlCfg->exec_cfg->att_model = $att_model_m2; // defined in const.inc.php + +// IVU +// Default Value +// USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS +// USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS +// USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS +$tlCfg->exec_cfg->tcases_counters_mode = array(); +$tlCfg->exec_cfg->tcases_counters_mode['with_platforms'] = USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS; + +$tlCfg->exec_cfg->tcases_counters_mode['without_platforms'] = USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS; + +$tlCfg->exec_cfg->tcases_counters_mode_domain = array(); +$tlCfg->exec_cfg->tcases_counters_mode_domain['with_platforms'] = array( + 'USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', + 'USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS', + 'USE_LATEST_EXEC_ON_TESTPLAN_PLAT_FOR_COUNTERS' +); + +$tlCfg->exec_cfg->tcases_counters_mode_domain['without_platforms'] = array( + 'USE_LATEST_EXEC_ON_CONTEX_FOR_COUNTERS', + 'USE_LATEST_EXEC_ON_TESTPLAN_FOR_COUNTERS' +); + +// ENABLED -> test cases will be coloured according to test case status +$tlCfg->exec_cfg->enable_tree_testcases_colouring = ENABLED; + +// ENABLED -> test cases will be coloured according to execution status on build selected for execution +// DISABLED -> test cases will be coloured according status on latest execution regardless of selected build +// see http://mantis.testlink.org/view.php?id=3450 for more details +$tlCfg->exec_cfg->testcases_colouring_by_selected_build = ENABLED; + +// ENABLED -> test case counters will be coloured according to test case status +$tlCfg->exec_cfg->enable_tree_counters_colouring = ENABLED; + +// This can help to avoid performance problems. +// Controls what happens on right frame when user clicks on a testsuite on tree. +// ENABLED -> show all test cases +// see $tlCfg->exec_cfg->show_testsuite_contents_deep +// +// DISABLED -> nothing happens, to execute a test case you need to click on test case +$tlCfg->exec_cfg->show_testsuite_contents = DISABLED; + +// @since 1.9.13 +// works in 'team' with $tlCfg->exec_cfg->show_testsuite_contents +// children: only direct children. +// deep: all test cases present in test suite and test suites in any level below +// selected test suite. +// IMPORTANT NOTICE: +// selecting deep can create performance issues. +// +$tlCfg->exec_cfg->show_testsuite_contents_deep = 'children'; + +// ENABLED -> enable testcase counters by status on tree +$tlCfg->exec_cfg->enable_tree_testcase_counters = ENABLED; + +// Define list of roles that are affected by: +// $tlCfg->exec_cfg->view_mode and $tlCfg->exec_cfg->exec_mode +// User must reconfigure if define other simple tester roles +// +// In addition (till code changes) also roles that verify this condition: +// $effective_role->hasRight('testplan_execute') and !$effective_role->hasRight('testplan_planning') +// Will be affected by: +// $tlCfg->exec_cfg->view_mode and $tlCfg->exec_cfg->exec_mode +// +$tlCfg->exec_cfg->simple_tester_roles = array( + TL_ROLES_TESTER +); + +// Filter Test cases a user with tester role can VIEW depending on +// test execution assignment. +// all: all test cases. +// assigned_to_me: test cases assigned to logged user. +// assigned_to_me_or_free: test cases assigned to logged user or not assigned +$tlCfg->exec_cfg->view_mode->tester = 'assigned_to_me'; + +// Filter Test cases a user with tester role can EXECUTE depending on +// test execution assignment. +// all: all test cases. +// assigned_to_me: test cases assigned to logged user. +// assigned_to_me_or_free: test cases assigned to logged user or not assigned +$tlCfg->exec_cfg->exec_mode->tester = 'assigned_to_me'; + +// How to set defaut values for execution fields (standard & custom) +// clean => all clean +// latest => get as much as possible values from latest execution on +// same context => test plan,platform, build +$tlCfg->exec_cfg->exec_mode->new_exec = 'clean'; + +// @since 1.9.15 +// Before 1.9.15 save & move to next worked JUST inside +// a test suite => save_and_move = 'limited' +// 1.9.15 will move on whole test project +// save_and_move = 'unlimited' +$tlCfg->exec_cfg->exec_mode->save_and_move = 'unlimited'; + +$tlCfg->exec_cfg->exec_mode->addLinkToTLChecked = false; +$tlCfg->exec_cfg->exec_mode->addLinkToTLPrintViewChecked = false; +$tlCfg->exec_cfg->exec_mode->assignTaskChecked = false; + +/** + * User filter in Test Execution navigator - default value + */ +// logged_user -> combo will be set to logged user +// none -> no filter applied by default +$tlCfg->exec_cfg->user_filter_default = 'none'; + +// 'horizontal' -> step and results on the same row +// 'vertical' -> steps on one row, results in the row bellow +$tlCfg->exec_cfg->steps_results_layout = 'horizontal'; + +// true => on single test case execution feature, notes and result +// can be provided for each step +// false => pre 1.9.10 behaviour +// +$tlCfg->exec_cfg->steps_exec = true; + +// this setting will work on AND mode with: +// $tlCfg->exec_cfg->steps_exec +$tlCfg->exec_cfg->steps_exec_attachments = true; + +// When textarea is displayed to allow user to write execution notes +// at step level, choose what to display: +// 'empty' +// 'latest' => latest execution notes. +$tlCfg->exec_cfg->steps_exec_notes_default = 'empty'; + +// 'empty' +// 'latest' => latest execution notes. +$tlCfg->exec_cfg->steps_exec_status_default = 'empty'; + +// Parameters to show notes/details when entering test execution feature +// EXPAND: show expanded/open +// COLLAPSE: show collapsed/closede +// LAST_USER_CHOICE: get status from cookie that holds last user choice.[STANDARD BEHAVIOUR] +$tlCfg->exec_cfg->expand_collapse = new stdClass(); +$tlCfg->exec_cfg->expand_collapse->testplan_notes = LAST_USER_CHOICE; +$tlCfg->exec_cfg->expand_collapse->platform_description = LAST_USER_CHOICE; +$tlCfg->exec_cfg->expand_collapse->build_description = LAST_USER_CHOICE; +$tlCfg->exec_cfg->expand_collapse->testsuite_details = LAST_USER_CHOICE; + +$tlCfg->exec_cfg->copyLatestExecIssues = new stdClass(); + +// true => When saving an execution, a new option will be displayed, and user will be +// able to do a choice +// COPY OR NOT issues linked to latest execution to the new execution +// DEAFULT false => no option on GUI + +$tlCfg->exec_cfg->copyLatestExecIssues->enabled = false; + +// value to set as default +$tlCfg->exec_cfg->copyLatestExecIssues->default = false; + +// you can choose only between columns present on +// (see exec.inc.php, function get_bugs_for_exec()) +$tlCfg->exec_cfg->bugs_order_clause = ' ORDER BY builds.name,step_number,bug_id '; + +$tlCfg->exec_cfg->features = new stdClass(); +$tlCfg->exec_cfg->features->attachments = new stdClass(); +$tlCfg->exec_cfg->features->attachments->enabled = true; +$tlCfg->exec_cfg->features->exec_duration = new stdClass(); +$tlCfg->exec_cfg->features->exec_duration->enabled = true; + +$tlCfg->exec_cfg->issues = new stdClass(); +$tlCfg->exec_cfg->issues->tcase_level = new stdClass(); +$tlCfg->exec_cfg->issues->tcstep_level = new stdClass(); + +/** + * %%STEPNUMBER%%,%%TCNAME%%,%%PROJECTNAME%%,%%PLANNAME%% + * %%BUILDNAME%%,%%PLATFNAME%%,%%EXECTSISO%%, + * %%TCPATHNAME%% + * + * /saado/TS100/SAA-4:WSTEPS Executed ON (ISO FORMAT): 2018-02-25CET10:00 + */ +$tlCfg->exec_cfg->issues->tcase_level->subject = '$$issue_subject_tcname %%TCPATHNAME%% - $$issue_subject_execon %%EXECTSISO%% '; + +/* + * $tlCfg->exec_cfg->issues->tcstep_level->subject = + * '$$issue_on_step %%STEPNUMBER%% - $$issue_subject_tcname %%TCNAME%% - ' . + * '$$issue_subject_projectname %%PROJECTNAME%% - ' . + * '$$issue_subject_planname %%PLANNAME%% - ' . + * '$$issue_subject_buildname %%BUILDNAME%% - ' . + * '$$issue_subject_platfname %%PLATFNAME%%'; + */ + +$tlCfg->exec_cfg->issues->tcstep_level->subject = '$$issue_on_step %%STEPNUMBER%% - $$issue_subject_tcname %%TCNAME%% '; + +// ---------------------------------------------------------------------- +/* [Test Specification] */ + +// true will be displayed when displayed a test case +$tlCfg->spec_cfg->show_tplan_usage = true; + +// 'horizontal' -> step and results on the same row +// 'vertical' -> steps on one row, results in the row bellow +$tlCfg->spec_cfg->steps_results_layout = 'horizontal'; + +// ENABLED -> User will see a test suite filter while creating test specification +// DISABLED -> no filter available +// $g_spec_cfg->show_tsuite_filter = ENABLED; +$tlCfg->spec_cfg->show_tsuite_filter = ENABLED; + +// ENABLED -> every time user do some operation on test specification +// tree is updated on screen. +// DISABLED -> tree will not be updated, user can update it manually. +// Anyway on user interface user will be able to change this choice +// $g_spec_cfg->automatic_tree_refresh = ENABLED; +$tlCfg->spec_cfg->automatic_tree_refresh = ENABLED; + +// To avoid perfomance problems on search test case feature, +// we can decide when to inform user that results can not be displayed +// due to too many results. +$tlCfg->testcase_cfg->search = new stdClass(); +$tlCfg->testcase_cfg->search->max_qty_for_display = 200; + +$tlCfg->testcase_cfg->duplicated_name_algorithm = new stdClass(); +// 'stringPrefix' => use duplicated_name_algorithm->text +// 'counterSuffix' => creare name as : +// test case title + (number of existent test cases +1) +// example: My Test Title 2 +// duplicated_name_algorithm->text is used as sprintf format mask +$tlCfg->testcase_cfg->duplicated_name_algorithm->type = 'stringPrefix'; +$tlCfg->testcase_cfg->duplicated_name_algorithm->text = "%Y%m%d-%H:%M:%S"; + +// $tlCfg->testcase_cfg->duplicated_name_algorithm->type = 'counterSuffix'; +// $tlCfg->testcase_cfg->duplicated_name_algorithm->text = " (%s)"; + +// TICKET 6422: Estimation in Test specification as mandatory field +// Implemented using HTML5 +$tlCfg->testcase_cfg->estimated_execution_duration = new stdClass(); +// $tlCfg->testcase_cfg->estimated_execution_duration->required = 'required'; +$tlCfg->testcase_cfg->estimated_execution_duration->required = ''; + +// There are some preconfigured standard types which you can use, +// additionally you can configure your own types. +$tlCfg->testcase_cfg->relations = new stdClass(); +$tlCfg->testcase_cfg->relations->enable = true; +$tlCfg->testcase_cfg->relations->interproject_linking = false; + +/** + * Localization identifiers for test cases relation types + * Types, which are configured above, have to be configured + * here too with attributes "source" and "destination". + * + * Last value will be selected in GUI as default. + * + * Form has to be like this: + * + * ... = array( + * RELATIONNAME => array( + * 'source' => 'SOURCE_LOCALIZATION_KEY', + * 'destination' => 'DESTINATION_LOCALIZATION_KEY'), + * ... + * + * @since TestLink 1.9.12 + */ + +$tlCfg->testcase_cfg->relations->type_labels = array( + TL_REL_TYPE_PARENT_CHILD => [ + 'source' => 'parent_of', + 'destination' => 'child_of' + ], + TL_REL_TYPE_BLOCKS_DEPENDS => [ + 'source' => 'blocks', + 'destination' => 'depends' + ], + TL_REL_TYPE_RELATED => [ + 'source' => 'related_to', + 'destination' => 'related_to' + ], + TL_REL_TYPE_AUTOMATION_PARENT_CHILD => [ + 'source' => 'automates_also', + 'destination' => 'is_automated_by' + ], + TL_REL_TYPE_EXECUTE_TOGETHER => [ + 'source' => 'executed_me_and_also', + 'destination' => 'executed_me_and_also' + ] +); + +$tlCfg->testcase_cfg->relations->type_description = [ + TL_REL_TYPE_PARENT_CHILD => 'parent_child', + TL_REL_TYPE_BLOCKS_DEPENDS => 'blocks_depends', + TL_REL_TYPE_RELATED => 'related_to', + TL_REL_TYPE_AUTOMATION_PARENT_CHILD => 'automation_script', + TL_REL_TYPE_EXECUTE_TOGETHER => 'executed_me_and_also' +]; + +// @since 1.9.18 +// true => After a test case version has been executed +// attachment on test case spec can not be added/removed +// +// false +// +// This means that at GUI Level, will not be possible: +// add a new attachment to an Executed Test Case Version +// delete an attachment from Executed Test Case Version +$tlCfg->testcase_cfg->downloadOnlyAfterExec = true; + +// This means that at GUI Level, will not be possible: +// add a new req version link to an Executed Test Case Version +// delete a req version link from Executed Test Case Version +$tlCfg->testcase_cfg->reqLinkingDisabledAfterExec = true; + +// Effects on Linked Requirements Version after +// execution of a Test Case Version +$tlCfg->testcase_cfg->freezeReqVersionAfterExec = true; + +// Effects on TCVersion N when TCVersion N+1 is created +$tlCfg->testcase_cfg->freezeTCVersionOnNewTCVersion = true; +$tlCfg->testcase_cfg->freezeTCVRelationsOnNewTCVersion = true; + +// Because: +// The Relation must be frozen (cannot be deleted) when +// a new version of the test case is created. +// +// It seems confusing that relation can be added, then +// this new configuration will allow this operation +// only on latest test case version +// +$tlCfg->testcase_cfg->addTCVRelationsOnlyOnLatestTCVersion = true; + +// Not Already Implemented +// $tlCfg->testcase_cfg->allowAddTCVRelationsOnOldTCVersion = true; + +// $tlCfg->testcase_cfg->frozenNotExecutedTCVDelAttachtments = false; +// $tlCfg->testcase_cfg->frozenNotExecutedTCVAddAttachtments = false; +// $tlCfg->testcase_cfg->frozenNotExecutedTCVAddTCVRel = false; +// $tlCfg->testcase_cfg->frozenNotExecutedTCVDelTCVRel = false; +// $tlCfg->testcase_cfg->frozenNotExecutedTCVAddREQVLink = false; +// $tlCfg->testcase_cfg->frozenNotExecutedTCVDelREQVLink = false; + +// Change order using CSS flexbox model +// @used-by tcEdit.tpl +$tlCfg->testcase_cfg->viewerFieldsOrder = new stdClass(); +$tlCfg->testcase_cfg->viewerFieldsOrder->summary = 3; +$tlCfg->testcase_cfg->viewerFieldsOrder->spaceOne = 2; +$tlCfg->testcase_cfg->viewerFieldsOrder->preconditions = 1; + +// Effects on Req Version to TCVersion LINK +// when a new version of a linked Test Case is created +// If LINK is frozen, then this means that link can not be deleted. +// $tlCfg->reqTCLinks->freezeLinkOnNewTCVersion = false; +// +// Important Notice: +// Req Version to TCVersion Link can be done ONLY TO LATEST TCV. +// +// This means that : +// +// on GUI on the Requirements Area on TEST CASE Specification Feature: +// this option has NO EFFECT +// +// on GUI on the Coverage Area on REQUIREMENT Specification Feature: +// this option has EFFECT +// +// on GUI on the Assign Requirements Feature: +// this option has EFFECT +// +$tlCfg->reqTCLinks->freezeLinkOnNewTCVersion = true; + +// Effects on Req Version to TCVersion LINK +// when a new version of a linked Req Version is created +$tlCfg->reqTCLinks->freezeLinkOnNewREQVersion = true; + +// Effects on BOTH ends of Req Version to TCVersion LINK +// when a new version of a linked TC Version is created +$tlCfg->reqTCLinks->freezeBothEndsOnNewTCVersion = true; + +// Effects on BOTH ends of Req Version to TCVersion LINK +// when a new version of a linked REQ Version is created +$tlCfg->reqTCLinks->freezeBothEndsOnNewREQVersion = true; + +// Effects on REQ Version N when REQ Version N+1 is created +$tlCfg->req_cfg->freezeREQVersionOnNewREQVersion = true; + +/** + * text template for a new items: + * Test Case: summary, steps, expected_results, preconditions + */ +// object members has SAME NAME that FCK editor objects. +// the logic present on tcEdit.php is dependent of this rule. +// every text object contains an object with following members: type and value +// +// Possible values for type member: +// none: template will not be used, default will be a clean editor screen. +// +// string: value of value member is assigned to FCK object +// string_id: value member is used in a lang_get() call, and return value +// is assigned to FCK object. Configure string_id on custom_strings.txt +// value: value member is used as file name. +// file is readed and it's contains assigned to FCK object +// +// any other value for type, results on '' assigned to FCK object + +$tlCfg->testcase_template = new stdClass(); + +$tlCfg->testcase_template->summary = new stdClass(); +$tlCfg->testcase_template->summary->type = 'none'; +$tlCfg->testcase_template->summary->value = ''; + +$tlCfg->testcase_template->steps = new stdClass(); +$tlCfg->testcase_template->steps->type = 'none'; +$tlCfg->testcase_template->steps->value = ''; + +$tlCfg->testcase_template->expected_results = new stdClass(); +$tlCfg->testcase_template->expected_results->type = 'none'; +$tlCfg->testcase_template->expected_results->value = ''; + +$tlCfg->testcase_template->preconditions = new stdClass(); +$tlCfg->testcase_template->preconditions->type = 'none'; +$tlCfg->testcase_template->preconditions->value = ''; + +/** + * text template for a new Test Suite description + */ +$tlCfg->testsuite_template = new stdClass(); +$tlCfg->testsuite_template->details = new stdClass(); +$tlCfg->testsuite_template->details->type = 'none'; +$tlCfg->testsuite_template->details->value = ''; + +$tlCfg->project_template = new stdClass(); +$tlCfg->project_template->notes = new stdClass(); +$tlCfg->project_template->notes->type = 'none'; +$tlCfg->project_template->notes->value = ''; + +$tlCfg->testplan_template = new stdClass(); +$tlCfg->testplan_template->notes = new stdClass(); +$tlCfg->testplan_template->notes->type = 'none'; +$tlCfg->testplan_template->notes->value = ''; + +$tlCfg->execution_template = new stdClass(); +$tlCfg->execution_template->bulk_exec_notes = new stdClass(); +$tlCfg->execution_template->bulk_exec_notes->type = 'none'; +$tlCfg->execution_template->bulk_exec_notes->value = ''; + +$tlCfg->execution_template->notes = new stdClass(); +$tlCfg->execution_template->notes->type = 'none'; +$tlCfg->execution_template->notes->value = ''; + +$tlCfg->build_template = new stdClass(); +$tlCfg->build_template->notes = new stdClass(); +$tlCfg->build_template->notes->type = 'none'; +$tlCfg->build_template->notes->value = ''; + +$tlCfg->requirement_template = new stdClass(); +$tlCfg->requirement_template->scope = new stdClass(); +$tlCfg->requirement_template->scope->type = 'none'; +$tlCfg->requirement_template->scope->value = ''; + +$tlCfg->req_spec_template = new stdClass(); +$tlCfg->req_spec_template->scope = new stdClass(); +$tlCfg->req_spec_template->scope->type = 'none'; +$tlCfg->req_spec_template->scope->value = ''; + +$tlCfg->role_template = new stdClass(); +$tlCfg->role_template->notes = new stdClass(); +$tlCfg->role_template->notes->type = 'none'; +$tlCfg->role_template->notes->value = ''; + +$tlCfg->platform_template = new stdClass(); +$tlCfg->platform_template->notes = new stdClass(); +$tlCfg->platform_template->notes->type = 'none'; +$tlCfg->platform_template->notes->value = ''; + +// ---------------------------------------------------------------------------- +/* [ATTACHMENTS] */ + +/** + * Attachment feature availability + */ +$tlCfg->attachments = new stdClass(); +$tlCfg->attachments->enabled = true; + +// true -> when you upload a file you can give no title +$tlCfg->attachments->allow_empty_title = true; + +// $tlCfg->attachments->allow_empty_title == true, you can ask the system +// to do something +// +// 'none' -> just write on db an empty title +// 'use_filename' -> use filename as title +// $tlCfg->attachments->action_on_save_empty_title='use_filename'; +// +$tlCfg->attachments->action_on_save_empty_title = 'none'; + +// Remember that title is used as link description for download +// then if title is empty, what the system has to do when displaying ? +// 'show_icon' -> the $tlCfg->attachments->access_icon will be used. +// 'show_label' -> the value of $tlCfg->attachments->access_string will be used . +$tlCfg->attachments->action_on_display_empty_title = 'show_icon'; + +// Set display order of uploaded files +$tlCfg->attachments->order_by = " ORDER BY date_added DESC "; + +// need to be moved AFTER include of custom_config +// +// $tlCfg->attachments->access_icon = ''; +$tlCfg->attachments->access_string = "[*]"; + +/** + * Files that are allowed. + * Separate items by commas. + * eg. 'doc,xls,gif,png,jpg' + */ +$tlCfg->attachments->allowed_files = 'doc,xls,gif,png,jpg,xlsx,csv'; + +/** + * Process filename against XSS + * Thanks to http://owasp.org/index.php/Unrestricted_File_Upload + * '/^[a-zA-Z0-9]{1,20}\.[a-zA-Z0-9]{1,10}$/'; + * added - and _. + * + * NO CHECK if -> $g_attachments->allowed_filenames_regexp = ''; + */ +$tlCfg->attachments->allowed_filenames_regexp = '/^[a-zA-Z0-9_-]{1,20}\.[a-zA-Z0-9]{1,10}$/'; + +/** + * the type of the repository can be database or filesystem + * TL_REPOSITORY_TYPE_DB => database + * TL_REPOSITORY_TYPE_FS => filesystem + */ +$g_repositoryType = TL_REPOSITORY_TYPE_FS; + +/** + * TL_REPOSITORY_TYPE_FS: the where the filesystem repository should be located + * We recommend to change the directory for security reason. + * (see http://itsecuritysolutions.org/2012-08-13-TestLink-1.9.3-multiple-vulnerabilities/) + * Put it out of reach via web or configure access denied. + */ +$g_repositoryPath = '/var/testlink/upload_area/'; /* unix example */ +if ($upa = getenv('TESTLINK_UPLOAD_AREA')) { + $g_repositoryPath = trim($upa); +} + +/** + * compression used within the repository + * TL_REPOSITORY_COMPRESSIONTYPE_NONE => no compression + * TL_REPOSITORY_COMPRESSIONTYPE_GZIP => gzip compression + */ +$g_repositoryCompressionType = TL_REPOSITORY_COMPRESSIONTYPE_NONE; + +// the maximum allowed file size for each repository entry, default 1MB. +// Also check your PHP settings (default is usually 2MBs) +$tlCfg->repository_max_filesize = 1; // MB + +// ---------------------------------------------------------------------------- +/* [Requirements] */ + +// HAS TO BE REMOVED - > req_doc_id UNIQUE INSIDE test project +// true : you want req_doc_id UNIQUE IN THE WHOLE DB (system_wide) +// false: you want req_doc_id UNIQUE INSIDE a SRS +// $tlCfg->req_cfg->reqdoc_id->is_system_wide = false; + +$tlCfg->req_cfg->monitor_enabled = true; + +// truncate log message to this amount of chars for reqCompareVersions +$tlCfg->req_cfg->log_message_len = 200; + +/** + * Test Case generation from Requirements - use_req_spec_as_testsuite_name + * false => test cases are created and assigned to a test suite + * with name $tlCfg->req_cfg->default_testsuite_name + * true => REQuirement Specification Title is used as testsuite name + */ +$tlCfg->req_cfg->use_req_spec_as_testsuite_name = true; +$tlCfg->req_cfg->default_testsuite_name = "Auto-created Test cases"; +$tlCfg->req_cfg->testsuite_details = "Test Cases in the Test Suite are generated from Requirements. " . + "A refinement of test scenario is highly recommended."; +$tlCfg->req_cfg->testcase_summary_prefix = "The Test Case was generated from the assigned requirement.
"; + +// If the following value is enabled, then the summary prefix string will include the +// title and version number of the assigned requirement. +$tlCfg->req_cfg->use_testcase_summary_prefix_with_title_and_version = ENABLED; + +// If above option is enabled, the following string will be used as a template for the tc summary prefix. +// It has to include four variables in the form of "%s". The first and second one will be used internally by the system. +// The third one will then be replaced by the title of the originating Requirement, +// the fourth one by its version number. +// Attention: If there aren't exactly three variables in it, the operation will fail. +$tlCfg->req_cfg->testcase_summary_prefix_with_title_and_version = "The Test Case was generated from the assigned" . + " requirement
\"%s\" (version %s).
"; + +/** + * ENABLED: When generating Test Cases from Requirements, copy the scope of the Requirement + * to the summary of the newly created Test Case. + */ +$tlCfg->req_cfg->copy_req_scope_to_tc_summary = DISABLED; + +// To avoid perfomance problems on search Requirements feature, +// we can decide when to inform user that results can not be displayed +// due to too many results. +$tlCfg->req_cfg->search = new stdClass(); +$tlCfg->req_cfg->search->max_qty_for_display = 200; + +// ENABLED: allow N level depth tree +// DISABLED: just one level +$tlCfg->req_cfg->child_requirements_mgmt = ENABLED; + +// ENABLED: ask for this value on user interface and use on several features +// DISABLED: do not ask, do not use +$tlCfg->req_cfg->expected_coverage_management = ENABLED; + +// Show Child Requirements on Requirement Specification Print View +// ENABLED: Requirement Specification including Child Requirements are shown +// DIABLED: ONLY Requirement Specification is shown +$tlCfg->req_cfg->show_child_reqs_on_reqspec_print_view = DISABLED; + +// +// Order of test cases status in this array, is used to undestand +// to what status set requirement in the requirements report. +// Standard algorithm, present in getReqCoverage(), is: +// +// if at least one of Test Cases linked to Requirement has status FAILED +// Requirement Coverage Status = FAILED +// else if at least one of Test Cases linked to Requirement has status BLOCKED +// Requirement Coverage Status = BLOCKED +// else if ALL Test Cases linked to Requirement has status NOT RUN +// Requirement Coverage Status = NOT RUN +// else if ALL Test Cases linked to Requirement has status PASSED +// Requirement Coverage Status = PASSED +// else +// Requirement Coverage Status = Partially Passed +// +// This logic is implemented using following config parameter +$tlCfg->req_cfg->coverageStatusAlgorithm['checkOrder'] = array( + 'atLeastOne', + 'all' +); +$tlCfg->req_cfg->coverageStatusAlgorithm['checkType']['atLeastOne'] = array( + 'failed', + 'blocked' +); +$tlCfg->req_cfg->coverageStatusAlgorithm['checkType']['all'] = array( + 'passed' +); + +// Configure here what status has to get requirement when check of type 'all' fails like +// in following situation (Mantis 2171) +// +// If particular requirement has assigned more than one test cases, and: +// - at least one of assigned test cases was not yet executed +// - the rest of assigned test cases was executed and passed +// then on the "Requirements based report" this particular requirement is not shown at all (in any section). +// +// $tlCfg->req_cfg->coverageStatusAlgorithm['checkFail']['all']='partially_passed'; +// $tlCfg->req_cfg->coverageStatusAlgorithm['displayOrder']=array('passed','failed', +// 'blocked','not_run','partially_passed'); +// 20100819 - asimon - fix not needed anymore after rewrite of req based report +// $tlCfg->req_cfg->coverageStatusAlgorithm['checkFail']['all']='failed'; +// $tlCfg->req_cfg->coverageStatusAlgorithm['displayOrder']=array('passed','failed','blocked','not_run'); + +// truncate log message to this amount of chars for reqSpecCompareRevisions +$tlCfg->req_spec_cfg->log_message_len = 200; + +// Linking between requirements/requirement specifications +// +$tlCfg->internal_links = new stdClass(); + +// +// true: links to other requirements/requirement specifications are +// automatically generated from the corresponding Document ID, enclosed by tags (like BBCode). +// +// Usage: +// link to requirements: [req]req_doc_id[/req] +// link to requirement specifications: [req_spec]req_spec_doc_id[/req_spec] +// +// The test project of the requirement / requirement specification and an anchor +// to jump to can also be specified: +// [req tproj= anchor=]req_doc_id[/req] +// This syntax also works for requirement specifications. +// +// false: no links are automatically created. +// +$tlCfg->internal_links->enable = true; + +// how a linked document (requirement/requirement specification) should be displayed. +// posible values: +// 'window': new window/tab will be used (depending on browser configuration) +// 'frame' : same frame as the clicked link +// 'popup' (default): popup window (ATTENTION to browser pop-up block). +// +$tlCfg->internal_links->target = 'popup'; + +// title for automatically created link +// possible values: +// 'string': lang_get() will be used to localize +// 'none': no title will be generated, only link with ID +// 'item' (default): localized type of item (e.g. "Requirement: ", "Req Spec") +// will be used as title for the generated link +// +$tlCfg->internal_links->req_link_title = new stdClass(); +$tlCfg->internal_links->req_link_title->type = 'item'; +$tlCfg->internal_links->req_link_title->value = ''; + +$tlCfg->internal_links->req_spec_link_title = new stdClass(); +$tlCfg->internal_links->req_spec_link_title->type = 'item'; +$tlCfg->internal_links->req_spec_link_title->value = ''; + +// Relations between requirement documents: +// +// The relation types have to be configured in cfg/const.inc.php +// and their respective localization values in locale strings.txt. + +// There are some preconfigured standard types which you can use, +// additionally you can configure your own types. +$tlCfg->req_cfg->relations = new stdClass(); +$tlCfg->req_cfg->relations->enable = true; +$tlCfg->req_cfg->relations->interproject_linking = false; + +// Requirement/testcase diff +// default value of lines to show before and after each difference +$tlCfg->diffEngine->context = 5; + +// Configuration for Requirement Import using DOCBOOK format +$tlCfg->req_cfg->importDocBook = new stdClass(); +$tlCfg->req_cfg->importDocBook->requirement = "sect3"; +$tlCfg->req_cfg->importDocBook->title = "title"; +$tlCfg->req_cfg->importDocBook->paragraph = "para"; +$tlCfg->req_cfg->importDocBook->ordered_list = "orderedlist"; +$tlCfg->req_cfg->importDocBook->list_item = "listitem"; +$tlCfg->req_cfg->importDocBook->table = "informaltable"; +$tlCfg->req_cfg->importDocBook->table_group = "tgroup"; +$tlCfg->req_cfg->importDocBook->table_head = "thead"; +$tlCfg->req_cfg->importDocBook->table_body = "tbody"; +$tlCfg->req_cfg->importDocBook->table_row = "row"; +$tlCfg->req_cfg->importDocBook->table_entry = "entry"; +$tlCfg->req_cfg->importDocBook->list_item_children = array( + 'para', + 'title' +); +$tlCfg->req_cfg->importDocBook->table_entry_children = array( + 'para' +); + +// If an external tool is used for requirement management, enable this setting. +// You will get an additional field on requirement specifications where you +// can enter the total count of requirements so that external requirements +// are also counted for metrics/statistics. +$tlCfg->req_cfg->external_req_management = DISABLED; + +// If enabled an icon next to Document ID field will show up that allows +// to insert the last defined Requirement Document ID within the same Project +// into Document ID field +$tlCfg->req_cfg->allow_insertion_of_last_doc_id = DISABLED; + +// used ONLY to configure the mask (text) . +// algorithm type is fixed HARDCODED +// +$tlCfg->req_cfg->duplicated_name_algorithm = new stdClass(); +$tlCfg->req_cfg->duplicated_name_algorithm->text = " (%s)"; + +$tlCfg->req_cfg->duplicated_docid_algorithm = new stdClass(); +$tlCfg->req_cfg->duplicated_docid_algorithm->text = " (%s)"; + +// ---------------------------------------------------------------------------- +/* [TREE FILTER CONFIGURATION] */ + +/* + * In the following section, you can configure which filters shall be used + * in combination with the tree view for testcases and requirements. + * There are five available filter modes (four for the testcase tree, + * one for requirement documents), which are used for the different features + * as listed here: + * + * For Test Cases: + * --> execution_mode + * execution of testcases + * --> edit_mode + * create and edit testcases + * assign keywords to testcases + * assign requirements to testcases + * --> plan_mode + * assign testcase execution to users + * update linked versions for testplan + * set urgent testcases + * --> plan_add_mode + * add/remove testcases to/from testplan + * + * For Requirements: + * There are no modes defined, there is only one filter configuration. + * The filters configured here will be used for requirement editing. + */ +$tlCfg->tree_filter_cfg = new stdClass(); +$tlCfg->tree_filter_cfg->testcases = new stdClass(); +$tlCfg->tree_filter_cfg->requirements = new stdClass(); + +// These are the available filter modes for testcases: +$tlCfg->tree_filter_cfg->testcases->execution_mode = new stdClass(); +$tlCfg->tree_filter_cfg->testcases->edit_mode = new stdClass(); +$tlCfg->tree_filter_cfg->testcases->plan_mode = new stdClass(); +$tlCfg->tree_filter_cfg->testcases->plan_add_mode = new stdClass(); + +// If you disable one of these items here, you switch +// the complete filter panel off for a specific mode/feature. +// You should rather do this here instead of individually disabling all the filters, +// if you don't want to have any filters at all for a given feature. +$tlCfg->tree_filter_cfg->testcases->execution_mode->show_filters = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->show_filters = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->show_filters = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->show_filters = ENABLED; +$tlCfg->tree_filter_cfg->requirements->show_filters = ENABLED; + +// Detailed settings for each mode. +// Here, the single filter fields can be disabled if not wanted. +// Also, the choice of advanced filter mode can be disabled. +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_tc_id = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_testcase_name = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_toplevel_testsuite = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_keywords = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_priority = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_execution_type = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_assigned_user = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_custom_fields = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_result = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->filter_bugs = ENABLED; +$tlCfg->tree_filter_cfg->testcases->execution_mode->advanced_filter_mode_choice = ENABLED; + +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_tc_id = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_testcase_name = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_toplevel_testsuite = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_keywords = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_platforms = ENABLED; + +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_active_inactive = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_importance = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_execution_type = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_custom_fields = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_workflow_status = ENABLED; +$tlCfg->tree_filter_cfg->testcases->edit_mode->advanced_filter_mode_choice = ENABLED; + +$tlCfg->tree_filter_cfg->testcases->edit_mode->filter_workflow_status_values = array(); + +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_tc_id = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_testcase_name = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_toplevel_testsuite = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_keywords = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_priority = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_execution_type = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_assigned_user = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_custom_fields = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->filter_result = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->advanced_filter_mode_choice = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_mode->setting_build_inactive_out = false; +$tlCfg->tree_filter_cfg->testcases->plan_mode->setting_build_close_out = false; + +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_tc_id = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_testcase_name = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_toplevel_testsuite = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_keywords = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_active_inactive = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_importance = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_execution_type = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_workflow_status = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_custom_fields = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->advanced_filter_mode_choice = ENABLED; +$tlCfg->tree_filter_cfg->testcases->plan_add_mode->filter_platforms = ENABLED; + +$tlCfg->tree_filter_cfg->requirements->filter_doc_id = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_title = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_status = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_type = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_spec_type = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_coverage = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_relation = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_tc_id = ENABLED; +$tlCfg->tree_filter_cfg->requirements->filter_custom_fields = ENABLED; +$tlCfg->tree_filter_cfg->requirements->advanced_filter_mode_choice = ENABLED; + +// ENABLED -> Every time the user does some operation on requirement spec, +// the tree will be updated on screen. [DEFAULT] +// DISABLED -> The tree will not be updated automatically, but the user can update it manually. +// On graphical user interface any user will is able to change this setting. +$tlCfg->tree_filter_cfg->requirements->automatic_tree_refresh = ENABLED; + +/* [Assign test cases to test plan] */ +$tlCfg->tplanDesign->hideTestCaseWithStatusIn = array( + $tlCfg->testCaseStatus['obsolete'] => 'obsolete', + $tlCfg->testCaseStatus['future'] => 'future' +); + +// ---------------------------------------------------------------------------- +/* [MISC FUNCTIONALITY] */ + +/** + * Maximum uploadfile size to importing stuff in TL + */ +// Also check your PHP settings (default is usually 2MBs) +// unit BYTES is required by MAX_FILE_SIZE HTML option +$tlCfg->import_file_max_size_bytes = '800000'; + +/** + * Maximum line size of the imported file + */ +$tlCfg->import_max_row = '10000'; // in chars + +/** + * Set the default role used for new users + */ +// - created from the login page. +// - created using user management features +$tlCfg->default_roleid = TL_ROLES_GUEST; + +// only show custom fields if their value isn't empty +$tlCfg->custom_fields->show_custom_fields_without_value = true; + +/** + * used to check size in char for TEXT AREA type custom fields + */ +// can not be greater that column definition on DB +// 0 => do not check. +$tlCfg->custom_fields->max_length = 255; + +// sizes for HTML INPUTS +// for list, multiselection list +// - MAXIMUM number of items displayed at once +// +// for checkbox,radio is useless +// Hint: more than 120 produce weird effects on user interface +// +$tlCfg->custom_fields->sizes = array( + 'string' => 100, + 'numeric' => 10, + 'float' => 10, + 'email' => 100, + 'list' => 1, + 'multiselection list' => 5, + 'text area' => array( + 'rows' => 6, + 'cols' => 80 + ), + 'script' => 100, + 'server' => 100 +); + +// Use this variable (on custom_config.inc.php) to define new Custom Field types. +// IMPORTANT: +// check $custom_field_types property on cfield_mgr.class.php +// to avoid overwrite of standard types. +// +$tlCfg->gui->custom_fields->types = null; + +// Use this variable (on custom_config.inc.php) +// to define possible values behaviour for new Custom Field types. +// +// IMPORTANT: +// check $possible_values_cfg property on cfield_mgr.class.php +// to avoid overwrite of standard values. +// +$tlCfg->gui->custom_fields->possible_values_cfg = null; + +/** + * Check unique titles of Test Project, Test Suite and Test Case + * ENABLED => Check [STANDARD BEHAVIOUR] + * DISABLED => don't check + */ +$tlCfg->check_names_for_duplicates = ENABLED; + +/** + * Action for duplication check (only if check_names_for_duplicates=ENABLED) + * 'allow_repeat' => allow the name to be repeated (backward compatibility) + * 'generate_new' => generate a new name using $g_prefix_name_for_copy + * 'block' => return with an error + */ +$tlCfg->action_on_duplicate_name = 'generate_new'; + +/** + * String checking and conversions + * Allow automatically convert www URLs and email adresses into clickable links + * used by function string_display_links() for example by custom fields. + * Valid values = ENABLED/DISABLED. + */ +$tlCfg->html_make_links = ENABLED; + +/** + * Define the valid html tags for "content driven" single-line and multi-line fields. + * Do NOT include tags with parameters (eg. ), img and href. + * It's used by function string_display_links() for example by custom fields. + */ +$tlCfg->html_valid_tags = 'p, li, ul, ol, br, pre, i, b, u, em'; +$tlCfg->html_valid_tags_single_line = 'i, b, u, em'; + +/** + * Defines the threshold values for filtering TC by a priority according to the formula + * LOW => all Tc's with (urgency*importance) < LOW_Threshold + * HIGH => all Tc's with (urgency*importance) >= HIGH_Threshold + * MEDIUM => all Tc's with (urgency*importance) >= LOW_Threshold AND (urgency*importance) < HIGH_Threshold + */ +$tlCfg->urgencyImportance = new stdClass(); +$tlCfg->urgencyImportance->threshold['low'] = 3; +$tlCfg->urgencyImportance->threshold['high'] = 6; + +/** + * + * @var boolean Demo mode disables some functionality + * user edit disable + * role create ENABLED + * user create ENABLED + * special users manage DISABLE + */ +$tlCfg->demoMode = OFF; +$tlCfg->demoSpecialUsers = array( + 'admin' +); + +/** + * If enabled, every Ext JS table in TestLink will offer an export button, + * which generates a file with the contents of the table. + * ATTENTION: This feature is fully experimental. Enable at your own risk! + * Enabling it can cause broken tables. + */ +$tlCfg->enableTableExportButton = DISABLED; + +/** + * Taken from Mantis to implement better login security + * and solve TICKET 4342. + */ +$tlCfg->auth_cookie = $tlCfg->cookie->prefix . "TESTLINK_USER_AUTH_COOKIE"; + +/** + * Used when creating a Test Suite using copy + * and you have choose $g_action_on_duplicate_name = 'generate_new' + * if the name exist. + */ +$g_prefix_name_for_copy = date("Y-m-d-H:i:s", time()); + +/** + * Configurable templates this can help if you want to use a non standard template. + * i.e. you want to develop a new one without loosing the original template. + * key: original TL template name WITHOUT extension + * value: whatever name you want, only constrain you have to copy your template + * ON SAME FOLDER where original template is. + * See example below + */ +$g_tpl = array( + 'inc_exec_controls' => 'inc_exec_img_controls.tpl' +); +// $g_tpl = array('inc_exec_controls' => 'inc_exec_controls.tpl'); +$g_tpl['login'] = 'login/login-model-marcobiedermann.tpl'; + +// Example +// $g_tpl = array('tcView' => 'custom_tcView.tpl', +// 'tcSearchView' => 'myOwnTCSearchView.tpl', +// 'tcEdit' => 'tcEdit_ultraCool.tpl'); + +/** + * Add o replace images + */ +$tlCfg->images = array(); + +// ---------------------------------------------------------------------------- +/* [REST API using Slim - Begin] */ +$tlCfg->restAPI = new stdClass(); + +// CRITIC +// This will work if your url to test link +// is something like +// +// https://testlink.antartic.org/ +// +$tlCfg->restAPI->basePath = "/lib/api/rest/v3"; + +// If your URL is like this +// https://myserver.ibiza.org/testlink/ +// You need to use: +// $basePath = "/testlink/lib/api/rest/v3"; +// +// The standard .htaccess provided with testlink, +// that is similar to the .htaccess provided by MantisBT +// it's ok!!! +// No need to proceed as detailed in this documentation +// - https://www.slimframework.com/docs/v4/start/web-servers.html +// Section: Running in a sub-directory +// +// - https://akrabat.com/running-slim-4-in-a-subdirectory/ +// BUT this is a good example to understand how to configure +// +/* [REST API using Slim - End] */ + +// ---------------------------------------------------------------------------- +/* [PROXY] */ +/* Used only */ +/* mantissoapInterface.class.php */ +/* jirasoapInterface.class.php */ +/* jirarestInterface.class.php */ +$tlCfg->proxy->host = null; +$tlCfg->proxy->port = null; +$tlCfg->proxy->login = null; +$tlCfg->proxy->password = null; + +/** + * Plugins feature + */ +define('TL_PLUGIN_PATH', + dirname(__FILE__) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR); + +// ----- End of Config ------------------------------------------------------------------ +// -------------------------------------------------------------------------------------- +// DO NOT DO CHANGES BELOW +// -------------------------------------------------------------------------------------- + +/** + * Functions for check request status + */ +require_once ('configCheck.php'); + +if (! defined('TL_JQUERY')) { + define('TL_JQUERY', 'jquery-2.2.4.min.js'); +} + +if (! defined('TL_DATATABLES_DIR')) { + define('TL_DATATABLES_DIR', 'DataTables-1.10.24'); +} + +/** + * root of testlink directory location seen through the web server + */ +/* + * 20070106 - franciscom - this statement it's not 100% right + * better use $_SESSION['basehref'] in the scripts. + */ +define('TL_BASE_HREF', + get_home_url(array( + 'force_https' => $tlCfg->force_https + ))); + +clearstatcache(); +if (file_exists(TL_ABS_PATH . 'custom_config.inc.php')) { + require_once (TL_ABS_PATH . 'custom_config.inc.php'); +} + +if (! isset($tlCfg->attachments->access_icon)) { + $tlCfg->attachments->access_icon = ''; +} + +// Important to do this only after custom_* to use (if exists) redefinition of +// $tlCfg->results['status_label_for_exec_ui'] +$tlCfg->reportsCfg->exec_status = $tlCfg->results['status_label_for_exec_ui']; + +/** + * Support for localization + */ +// @TODO move the code out of config and do it only once and +// not always in any include! +// @TODO a better parsing function should be include +$serverLanguage = false; +if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + @list ($code) = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']); + @list ($a, $b) = explode("-", $code); + if ($a && $b) { + $a = strtolower($a); + $b = strtoupper($a); + $serverLanguage = $a . "_" . $b; + } +} + +if (false !== $serverLanguage && + array_key_exists($serverLanguage, $tlCfg->locales)) { + $tlCfg->default_language = $serverLanguage; +} +define('TL_DEFAULT_LOCALE', $tlCfg->default_language); + +// Reverted execution status is used for two applications. +// 1. To map code to CSS, Please if you add an status you need to add a corresponding CSS Class +// in the CSS files (see the gui directory) +// 2. to decode from code to some more human oriented to use in code +// +/** + * Revered list of Test Case execution results + */ +$tlCfg->results['code_status'] = array_flip($tlCfg->results['status_code']); + +// Enable CSRF global protection +$tlCfg->csrf_filter_enabled = true; + +// --------------------------------------------------------------------------------- +/** + * Converted and derived variables (Users should not modify this section) + */ +define('REFRESH_SPEC_TREE', $tlCfg->spec_cfg->automatic_tree_refresh ? 1 : 0); +define('TL_SORT_TABLE_ENGINE', $g_sort_table_engine); +define("TL_REPOSITORY_MAXFILESIZE", + 1024 * 1024 * $tlCfg->repository_max_filesize); + +define('TL_XMLEXPORT_HEADER', + "charset . "\"?>\n"); + +// --------------------------------------------------------------------------------- +// when a role is deleted, a new role must be assigned to all users +// having role to be deleted +// A right choice seems to be using $g_default_roleid. +// You can change this adding a config line in custom_config.inc.php +// @TODO martin: remove - use directly $tlCfg->default_roleid; +$g_role_replace_for_deleted_roles = $tlCfg->default_roleid; + +/** + * Using "|" in the testsuite name causes malformed URLs + * regexp used to check for chars not allowed in: + * test project, test suite and testcase names. + * + * @todo martin: encode harm characters @see http://cz.php.net/urlencode (and remove the parameter) + * + * now is preg pattern + */ +$g_ereg_forbidden = "/[|]/i"; + +/** + * + * @todo remove from TL - unfinished refactorization; + * use $tlCfg instead of old variables and constants + */ +define('TL_IMPORT_ROW_MAX', $tlCfg->import_max_row); +define('TL_TPL_CHARSET', $tlCfg->charset); +define('TITLE_SEP', $tlCfg->gui_title_separator_1); +define('TITLE_SEP_TYPE2', $tlCfg->gui_title_separator_2); +define('TITLE_SEP_TYPE3', $tlCfg->gui_title_separator_2); // obsolete: use type 1,2 +define('TL_FRMWORKAREA_LEFT_FRAME_WIDTH', $tlCfg->frame_workarea_default_width); +define('TL_TEMP_PATH', $tlCfg->temp_dir); + +$tlCfg->gui->title_separator_1 = $tlCfg->gui_title_separator_1; +$tlCfg->gui->title_separator_2 = $tlCfg->gui_title_separator_2; +$tlCfg->gui->role_separator_open = $tlCfg->gui_separator_open; +$tlCfg->gui->role_separator_close = $tlCfg->gui_separator_close; + +$tlCfg->gui->version_separator_open = $tlCfg->gui_separator_open; +$tlCfg->gui->version_separator_close = $tlCfg->gui_separator_close; + +/** + * Globals for Events storage + */ +$g_event_cache = array(); + +/** + * Globals for Plugins + */ $g_plugin_config_cache = array(); // ----- END OF FILE -------------------------------------------------------------------- diff --git a/custom/_cf_radio_head.php b/custom/_cf_radio_head.php index 2ec9963a7f..1a1e949f59 100644 --- a/custom/_cf_radio_head.php +++ b/custom/_cf_radio_head.php @@ -1,86 +1,82 @@ -custom_fields->types = array(100 => 'radio head'); - * $tlCfg->custom_fields->possible_values_cfg = array('radio head' => 1); - * - * - * - * ----------------------------------------------------------------------------- -*/ -/* - function: string_input_radio_head - returns an string with the html need to display "radio head" custom field. - Is normally called by string_custom_field_input() - - args: p_field_def: contains the definition of the custom field - (including it's field id) - - p_input_name: html input name - - p_custom_field_value: html input value - htmlspecialchars() must be applied to this - argument by caller. - - returns: html string - - rev: based on Mantis 1.2.0a1 code - - */ -function string_input_radio_head($p_field_def, $p_input_name, $p_custom_field_value ) -{ - $str_out=''; - $t_values = explode( '|', $p_field_def['possible_values']); - $t_checked_values = explode( '|', $p_custom_field_value ); - foreach( $t_values as $t_option ) - { - $str_out .= ' ' . $t_option . '  '; - } - else - { - $str_out .= ' value="' . $t_option . '"> ' . $t_option . '  '; - } - } - return $str_out; -} - -/* - function: build_cfield_radio_head - support function useful for method used to write "radio head" CF values to db. - Is normally called by _build_cfield() - - args: custom_field_value: value to be converted to be written to db. - - returns: value converted - - - */ - -function build_cfield_radio_head($custom_field_value) -{ - if( count($value) > 1) - { - $value=implode('|',$custom_field_value); - } - else - { - $value=is_array($custom_field_value) ? $custom_field_value[0] :$custom_field_value; - } - return $value; - -} -?> \ No newline at end of file +custom_fields->types = array(100 => 'radio head'); + * $tlCfg->custom_fields->possible_values_cfg = array('radio head' => 1); + * + * + * + * ----------------------------------------------------------------------------- + */ +/* + * function: string_input_radio_head + * returns an string with the html need to display "radio head" custom field. + * Is normally called by string_custom_field_input() + * + * args: p_field_def: contains the definition of the custom field + * (including it's field id) + * + * p_input_name: html input name + * + * p_custom_field_value: html input value + * htmlspecialchars() must be applied to this + * argument by caller. + * + * returns: html string + * + * rev: based on Mantis 1.2.0a1 code + * + */ +function string_input_radio_head($p_field_def, $p_input_name, + $p_custom_field_value) +{ + $str_out = ''; + $t_values = explode('|', $p_field_def['possible_values']); + $t_checked_values = explode('|', $p_custom_field_value); + foreach ($t_values as $t_option) { + $str_out .= ' ' . + $t_option . '  '; + } else { + $str_out .= ' value="' . $t_option . '"> ' . $t_option . + '  '; + } + } + return $str_out; +} + +/* + * function: build_cfield_radio_head + * support function useful for method used to write "radio head" CF values to db. + * Is normally called by _build_cfield() + * + * args: custom_field_value: value to be converted to be written to db. + * + * returns: value converted + * + * + */ +function build_cfield_radio_head($custom_field_value) +{ + if (count($value) > 1) { + $value = implode('|', $custom_field_value); + } else { + $value = is_array($custom_field_value) ? $custom_field_value[0] : $custom_field_value; + } + return $value; +} +?> diff --git a/custom_config.inc.php.github.testlinkOauth.php b/custom_config.inc.php.github.testlinkOauth.php index 5253129251..84d1aff379 100644 --- a/custom_config.inc.php.github.testlinkOauth.php +++ b/custom_config.inc.php.github.testlinkOauth.php @@ -1,30 +1,28 @@ -OAuthServers[2]['redirect_uri'] = - 'http://fman.hopto.org/login.php?oauth=github'; - -$tlCfg->OAuthServers[2]['oauth_client_id'] ='aa5f70a8de342fb95043'; -$tlCfg->OAuthServers[2]['oauth_client_secret'] = - 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e'; - -$tlCfg->OAuthServers[2]['oauth_enabled'] = true; -$tlCfg->OAuthServers[2]['oauth_name'] = 'github'; - -// Can be authorization_code (by default), client_credentials or password -$tlCfg->OAuthServers[2]['oauth_grant_type'] = 'authorization_code'; -$tlCfg->OAuthServers[2]['oauth_url'] = 'https://github.com/login/oauth/authorize'; - -$tlCfg->OAuthServers[2]['token_url'] = 'https://github.com/login/oauth/access_token'; -$tlCfg->OAuthServers[2]['oauth_force_single'] = false; -$tlCfg->OAuthServers[2]['oauth_profile'] = 'https://api.github.com/user'; +OAuthServers[2]['redirect_uri'] = 'http://fman.hopto.org/login.php?oauth=github'; + +$tlCfg->OAuthServers[2]['oauth_client_id'] = 'aa5f70a8de342fb95043'; +$tlCfg->OAuthServers[2]['oauth_client_secret'] = 'c8d61d5ec4ed4eb2ac81064c27043ddef351107e'; + +$tlCfg->OAuthServers[2]['oauth_enabled'] = true; +$tlCfg->OAuthServers[2]['oauth_name'] = 'github'; + +// Can be authorization_code (by default), client_credentials or password +$tlCfg->OAuthServers[2]['oauth_grant_type'] = 'authorization_code'; +$tlCfg->OAuthServers[2]['oauth_url'] = 'https://github.com/login/oauth/authorize'; + +$tlCfg->OAuthServers[2]['token_url'] = 'https://github.com/login/oauth/access_token'; +$tlCfg->OAuthServers[2]['oauth_force_single'] = false; +$tlCfg->OAuthServers[2]['oauth_profile'] = 'https://api.github.com/user'; $tlCfg->OAuthServers[2]['oauth_scope'] = 'user:email'; -# End Of File \ No newline at end of file + diff --git a/error.php b/error.php index 032a9a8d90..469a6844da 100644 --- a/error.php +++ b/error.php @@ -1,64 +1,69 @@ -message = 'Rocket Raccoon is watching You'; - $code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0; - - switch($code) { - case 1: - $args->message = 'No CSRFName found, probable invalid request.'; - break; - - case 2: - $args->message = 'Invalid CSRF token'; - break; - - default: - break; - } - - return $args; -} - -/** - * - */ -function init_gui($args) { - $gui = new stdClass(); - $gui->message = ''; - - if (isset($args->message)) { - $gui->message = $args->message; - } - - return $gui; -} - -$templateCfg = templateConfiguration(); -$args = init_args(); -$gui = init_gui($args); - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->default_template); \ No newline at end of file +message = 'Rocket Raccoon is watching You'; + $code = isset($_REQUEST['code']) ? $_REQUEST['code'] : 0; + + switch ($code) { + case 1: + $args->message = 'No CSRFName found, probable invalid request.'; + break; + + case 2: + $args->message = 'Invalid CSRF token'; + break; + + default: + break; + } + + return $args; +} + +/** + * initializes the GUI + * + * @param stdClass $args + * @return stdClass + */ +function init_gui($args) +{ + $gui = new stdClass(); + $gui->message = ''; + + if (isset($args->message)) { + $gui->message = $args->message; + } + + return $gui; +} + +$templateCfg = templateConfiguration(); +$args = init_args(); +$gui = init_gui($args); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->default_template); diff --git a/firstLogin.php b/firstLogin.php index af3489c6ef..2edd456f39 100644 --- a/firstLogin.php +++ b/firstLogin.php @@ -1,177 +1,213 @@ -assign('title', lang_get('fatal_page_title')); - $smarty->assign('content', lang_get('error_self_signup_disabled')); - $smarty->assign('link_to_op', "login.php"); - $smarty->assign('hint_text', lang_get('link_back_to_login')); - $smarty->display('workAreaSimple.tpl'); - exit(); +assign('title', lang_get('fatal_page_title')); + $smarty->assign('content', lang_get('error_self_signup_disabled')); + $smarty->assign('link_to_op', "login.php"); + $smarty->assign('hint_text', lang_get('link_back_to_login')); + $smarty->display('workAreaSimple.tpl'); + exit(); +} +doDBConnect($db, database::ONERROREXIT); + +$message = ''; +if (! is_null($args->doEditUser)) { + if (strcmp($args->password, $args->password2)) { + $message = lang_get('passwd_dont_match'); + } else { + $user = new tlUser(); + $rx = $user->checkPasswordQuality($args->password); + if ($rx['status_ok'] >= tl::OK) { + $result = $user->setPassword($args->password); + if ($result >= tl::OK) { + $user->login = $args->login; + $user->emailAddress = $args->email; + $user->firstName = $args->firstName; + $user->lastName = $args->lastName; + $result = $user->writeToDB($db); + + $cfg = config_get('notifications'); + if ($cfg->userSignUp->enabled) { + notifyGlobalAdmins($db, $user); + } + logAuditEvent(TLS("audit_users_self_signup", $args->login), + "CREATE", $user->dbID, "users"); + + $url2go = "login.php?note=first"; + redirect(TL_BASE_HREF . $url2go); + exit(); + } else { + $message = getUserErrorMessage($result); + } + } else { + $message = $rx['msg']; + } + } +} + +$smarty = new TLSmarty(); + +// we get info about THE DEFAULT AUTHENTICATION METHOD +$gui->external_password_mgmt = tlUser::isPasswordMgtExternal(); +$gui->message = $message; +$smarty->assign('gui', $gui); + +$tpl = str_replace('.php', '.tpl', basename($_SERVER['SCRIPT_NAME'])); +if ($args->viewer == 'new') { + $tpl = 'firstLogin-model-marcobiedermann.tpl'; +} +$tpl = 'login/' . $tpl; +$smarty->display($tpl); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass + */ +function init_args() +{ + $args = new stdClass(); + $args->pwdInputSize = config_get('loginPagePasswordSize'); + + $iParams = array( + "doEditUser" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 1 + ), + "login" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 30 + ), + "password" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + $args->pwdInputSize + ), + "password2" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + $args->pwdInputSize + ), + "firstName" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 30 + ), + "lastName" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 30 + ), + "email" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 100 + ), + "viewer" => array( + 'GET', + tlInputParameter::STRING_N, + 0, + 3 + ) + ); + I_PARAMS($iParams, $args); + + return $args; +} + +/** + * send mail to administrators (users that have default role = administrator) + * to warn about new user created. + * + * @param database $dbHandler + * @param tlUser $userObj + */ +function notifyGlobalAdmins(&$dbHandler, &$userObj) +{ + // Get email addresses for all users that have default role = administrator + $cfg = config_get('notifications'); + if (! is_null($cfg->userSignUp->to->roles)) { + $opt = array( + 'active' => 1 + ); + foreach ($cfg->userSignUp->to->roles as $roleID) { + $roleMgr = new tlRole($roleID); + $userSet = $roleMgr->getUsersWithGlobalRole($dbHandler, $opt); + $key2loop = array_keys($userSet); + foreach ($key2loop as $userID) { + if (! isset($mail['to'][$userID])) { + $mail['to'][$userID] = $userSet[$userID]->emailAddress; + } + } + } + } + if (! is_null($cfg->userSignUp->to->users)) { + // Brute force query + $tables = tlObject::getDBTables('users'); + $sql = " SELECT id,email FROM {$tables['users']} " . " WHERE login IN('" . + implode("','", $cfg->userSignUp->to->users) . "')"; + echo '
' . __LINE__; + $userSet = $dbHandler->fetchRowsIntoMap($sql, 'id'); + if (! is_null($userSet)) { + foreach ($userSet as $userID => $elem) { + if (! isset($mail['to'][$userID])) { + $mail['to'][$userID] = $elem['email']; + } + } + } + } + + if ($mail['to'] != '') { + $dest = []; + $validator = new Zend_Validate_EmailAddress(); + foreach ($mail['to'] as $mm) { + $ema = trim($mm); + if ($ema == '' || ! $validator->isValid($ema)) { + continue; + } + $dest[] = $ema; + } + + // silence errors + if (! empty($dest)) { + $mail['to'] = implode(',', $dest); // email_api uses ',' as list separator + $mail['subject'] = lang_get('new_account'); + $mail['body'] = lang_get('new_account') . "\n"; + $mail['body'] .= " user:$userObj->login\n"; + $mail['body'] .= " first name:$userObj->firstName surname:$userObj->lastName\n"; + $mail['body'] .= " email:{$userObj->emailAddress}\n"; + @email_send(config_get('from_email'), $mail['to'], $mail['subject'], + $mail['body']); + } + } } -doDBConnect($db,database::ONERROREXIT); - -$message = ''; //lang_get('your_info_please'); -if( !is_null($args->doEditUser) ) { - if(strcmp($args->password,$args->password2)) { - $message = lang_get('passwd_dont_match'); - } else { - $user = new tlUser(); - $rx = $user->checkPasswordQuality($args->password); - if( $rx['status_ok'] >= tl::OK ) { - $result = $user->setPassword($args->password); - if ($result >= tl::OK) { - $user->login = $args->login; - $user->emailAddress = $args->email; - $user->firstName = $args->firstName; - $user->lastName = $args->lastName; - $result = $user->writeToDB($db); - - $cfg = config_get('notifications'); - if($cfg->userSignUp->enabled) { - notifyGlobalAdmins($db,$user); - } - logAuditEvent(TLS("audit_users_self_signup",$args->login),"CREATE",$user->dbID,"users"); - - $url2go = "login.php?note=first"; - redirect(TL_BASE_HREF . $url2go); - exit(); - } else { - $message = getUserErrorMessage($result); - } - } else { - $message = $rx['msg']; - } - } -} - -$smarty = new TLSmarty(); - -// we get info about THE DEFAULT AUTHENTICATION METHOD -$gui->external_password_mgmt = tlUser::isPasswordMgtExternal(); -$gui->message = $message; -$smarty->assign('gui',$gui); - -$tpl = str_replace('.php','.tpl',basename($_SERVER['SCRIPT_NAME'])); -if( $args->viewer == 'new' ) { - $tpl='firstLogin-model-marcobiedermann.tpl'; -} -$tpl = 'login/' . $tpl; -$smarty->display($tpl); - - -/** - * get input from user and return it in some sort of namespace - * - */ -function init_args() -{ - $args = new stdClass(); - $args->pwdInputSize = config_get('loginPagePasswordSize'); - - $iParams = array("doEditUser" => array('POST',tlInputParameter::STRING_N,0,1), - "login" => array('POST',tlInputParameter::STRING_N,0,30), - "password" => array('POST',tlInputParameter::STRING_N,0,$args->pwdInputSize), - "password2" => array('POST',tlInputParameter::STRING_N,0,$args->pwdInputSize), - "firstName" => array('POST',tlInputParameter::STRING_N,0,30), - "lastName" => array('POST',tlInputParameter::STRING_N,0,30), - "email" => array('POST',tlInputParameter::STRING_N,0,100), - "viewer" => array('GET',tlInputParameter::STRING_N, 0, 3), - ); - I_PARAMS($iParams,$args); - - return $args; -} - -/** - * send mail to administrators (users that have default role = administrator) - * to warn about new user created. - * - */ -function notifyGlobalAdmins(&$dbHandler,&$userObj) -{ - // Get email addresses for all users that have default role = administrator - $cfg = config_get('notifications'); - if( !is_null($cfg->userSignUp->to->roles) ) - { - $opt = array('active' => 1); - foreach($cfg->userSignUp->to->roles as $roleID) - { - $roleMgr = new tlRole($roleID); - $userSet = $roleMgr->getUsersWithGlobalRole($dbHandler,$opt); - $key2loop = array_keys($userSet); - foreach($key2loop as $userID) - { - if(!isset($mail['to'][$userID])) - { - $mail['to'][$userID] = $userSet[$userID]->emailAddress; - } - } - } - } - if( !is_null($cfg->userSignUp->to->users) ) - { - // Brute force query - $tables = tlObject::getDBTables('users'); - $sql = " SELECT id,email FROM {$tables['users']} " . - " WHERE login IN('" . implode("','", $cfg->userSignUp->to->users) . "')"; - echo '
' . __LINE__; - $userSet = $dbHandler->fetchRowsIntoMap($sql,'id'); - if(!is_null($userSet)) - { - foreach($userSet as $userID => $elem) - { - if(!isset($mail['to'][$userID])) - { - $mail['to'][$userID] = $elem['email']; - } - } - } - } - - if($mail['to'] != '') { - $dest = []; - $validator = new Zend_Validate_EmailAddress(); - foreach($mail['to'] as $mm) - { - $ema = trim($mm); - if($ema == '' || !$validator->isValid($ema)) - { - continue; - } - $dest[] = $ema; - } - - // silence errors - if(count($dest) > 0) - { - $mail['to'] = implode(',',$dest); // email_api uses ',' as list separator - $mail['subject'] = lang_get('new_account'); - $mail['body'] = lang_get('new_account') . "\n"; - $mail['body'] .= " user:$userObj->login\n"; - $mail['body'] .= " first name:$userObj->firstName surname:$userObj->lastName\n"; - $mail['body'] .= " email:{$userObj->emailAddress}\n"; - @email_send(config_get('from_email'), $mail['to'], $mail['subject'], $mail['body']); - } - } -} \ No newline at end of file diff --git a/gui/templates/tl-classic/execute/execDashboard.tpl b/gui/templates/tl-classic/execute/execDashboard.tpl index 1a94d2e837..bdb701523e 100644 --- a/gui/templates/tl-classic/execute/execDashboard.tpl +++ b/gui/templates/tl-classic/execute/execDashboard.tpl @@ -39,7 +39,7 @@ TestLink Open Source Project - http://testlink.sourceforge.net/
{$labels.testplan} {$gui->testplan_name|escape}
-
+
{if $gui->testPlanEditorType == 'none'}{$gui->testplan_notes|nl2br}{else}{$gui->testplan_notes}{/if} {if $gui->testplan_cfields neq ''}
{$gui->testplan_cfields}
{/if}
@@ -48,7 +48,7 @@ TestLink Open Source Project - http://testlink.sourceforge.net/
{$labels.platform} {$gui->platform_info.name|escape}
-
+
{if $gui->platformEditorType == 'none'}{$gui->platform_info.notes|nl2br}{else}{$gui->platform_info.notes}{/if}
{/if} @@ -56,7 +56,7 @@ TestLink Open Source Project - http://testlink.sourceforge.net/
{$labels.build} {$gui->build_name|escape}
-
+
{if $gui->buildEditorType == 'none'}{$gui->build_notes|nl2br}{else}{$gui->build_notes}{/if} {if $gui->build_cfields != ''}
{$gui->build_cfields}
{/if}
diff --git a/gui/templates/tl-classic/execute/execSetResults.tpl b/gui/templates/tl-classic/execute/execSetResults.tpl index fee46db240..1364f01fe8 100644 --- a/gui/templates/tl-classic/execute/execSetResults.tpl +++ b/gui/templates/tl-classic/execute/execSetResults.tpl @@ -331,7 +331,7 @@ IMPORTANT: if you change value, you need to chang init_args() logic on execSetRe '{$tsd_val_for_hidden_list}'); {/if} - {if $round_enabled}Nifty('div.exec_additional_info');{/if} + {if $round_enabled}Nifty('div.execAdditionalInfo');{/if} {if #ROUND_TC_SPEC#}Nifty('div.exec_test_spec');{/if} {if #ROUND_EXEC_HISTORY#}Nifty('div.exec_history');{/if} {if #ROUND_TC_TITLE#}Nifty('div.exec_tc_title');{/if}" @@ -482,10 +482,10 @@ IMPORTANT: if you change value, you need to chang init_args() logic on execSetRe show_hide_container_title=$gui->testplan_div_title show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id} -
+
{if $gui->testPlanEditorType == 'none'}{$gui->testplan_notes|nl2br}{else}{$gui->testplan_notes}{/if} {if $gui->testplan_cfields neq ''}
{$gui->testplan_cfields}
{/if}
@@ -504,7 +504,7 @@ IMPORTANT: if you change value, you need to chang init_args() logic on execSetRe show_hide_container_id=$div_id show_hide_container_view_status_id=$memstatus_id show_hide_container_draw=true - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_html=$content} {/if} {* ------------------------------------------------------- *} @@ -519,9 +519,9 @@ IMPORTANT: if you change value, you need to chang init_args() logic on execSetRe show_hide_container_id=$div_id show_hide_container_view_status_id=$memstatus_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info'} + show_hide_container_class='execAdditionalInfo'} -
+
{if $gui->buildEditorType == 'none'}{$gui->build_notes|nl2br}{else}{$gui->build_notes}{/if} {if $gui->build_cfields != ''}
{$gui->build_cfields}
{/if}
@@ -543,7 +543,7 @@ IMPORTANT: if you change value, you need to chang init_args() logic on execSetRe show_hide_container_title=$labels.bulk_tc_status_management show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id}
diff --git a/gui/templates/tl-classic/execute/inc_exec_img_controls.tpl b/gui/templates/tl-classic/execute/inc_exec_img_controls.tpl index 553d62c757..d322bd6bef 100644 --- a/gui/templates/tl-classic/execute/inc_exec_img_controls.tpl +++ b/gui/templates/tl-classic/execute/inc_exec_img_controls.tpl @@ -8,7 +8,7 @@ Purpose: draw execution controls Author : franciscom *} -{* Russian Doll, make name shorter *} +{* Russian Doll, make name shorter *} {$tcvID = $args_tcversion_id} {$ResultsStatusCode=$tlCfg->results.status_code} {if $args_save_type == 'bulk'} @@ -69,7 +69,7 @@ Author : franciscom {if $tlCfg->exec_cfg->exec_mode->new_exec == 'latest'} {$addBR=1} -   diff --git a/gui/templates/tl-classic/execute/inc_exec_show_tc_exec.tpl b/gui/templates/tl-classic/execute/inc_exec_show_tc_exec.tpl index f85ceb8a85..c60ec85ce4 100644 --- a/gui/templates/tl-classic/execute/inc_exec_show_tc_exec.tpl +++ b/gui/templates/tl-classic/execute/inc_exec_show_tc_exec.tpl @@ -39,10 +39,10 @@ TestLink Open Source Project - http://testlink.sourceforge.net/ show_hide_container_title=$container_title show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id} -
+

{$labels.details}
diff --git a/gui/templates/tl-classic/inc_filter_panel.tpl b/gui/templates/tl-classic/inc_filter_panel.tpl index 91f29d5934..5f23cde502 100644 --- a/gui/templates/tl-classic/inc_filter_panel.tpl +++ b/gui/templates/tl-classic/inc_filter_panel.tpl @@ -232,7 +232,7 @@ {$labels.caption_nav_filters}
-
+
@@ -537,7 +537,7 @@ {$labels.caption_nav_settings} -
+
@@ -572,7 +572,7 @@ {$labels.caption_nav_filters} -
+
diff --git a/gui/templates/tl-classic/inc_show_hide_mgmt.tpl b/gui/templates/tl-classic/inc_show_hide_mgmt.tpl index 10a9a17202..c2eb097658 100644 --- a/gui/templates/tl-classic/inc_show_hide_mgmt.tpl +++ b/gui/templates/tl-classic/inc_show_hide_mgmt.tpl @@ -7,7 +7,7 @@ Author : franciscom Rev: *} {$show_hide_container_draw=$show_hide_container_draw|default:false} -{$show_hide_container_class=$show_hide_container_class|default:"exec_additional_info"} +{$show_hide_container_class=$show_hide_container_class|default:"execAdditionalInfo"} {* franciscom - implementation note - 1. save the status when user saves executiosn. diff --git a/gui/templates/tl-classic/inc_tree_control.tpl b/gui/templates/tl-classic/inc_tree_control.tpl index ff5287232e..d4e656ce32 100644 --- a/gui/templates/tl-classic/inc_tree_control.tpl +++ b/gui/templates/tl-classic/inc_tree_control.tpl @@ -11,7 +11,7 @@ {lang_get var=labels s='expand_tree, collapse_tree'} -
+
@@ -91,13 +91,13 @@ function manageBuildRelated(checkBoxOid) @@ -110,21 +110,21 @@ function manageBuildRelated(checkBoxOid) {* always copy platform links *}
- {$labels.testplan_copy_user_roles} + {$labels.testplan_copy_user_roles}
- {$labels.testplan_copy_attachments} + {$labels.testplan_copy_attachments}
- + {$labels.testplan_copy_tcases}
         - {$labels.testplan_copy_priorities} + {$labels.testplan_copy_priorities}
- + {$labels.testplan_copy_builds}
- {$labels.testplan_copy_milestones} + {$labels.testplan_copy_milestones}
\ No newline at end of file diff --git a/gui/templates/tl-classic/requirements/reqViewVersions.tpl b/gui/templates/tl-classic/requirements/reqViewVersions.tpl index 5a7cb13e70..074fa68292 100644 --- a/gui/templates/tl-classic/requirements/reqViewVersions.tpl +++ b/gui/templates/tl-classic/requirements/reqViewVersions.tpl @@ -455,7 +455,7 @@ var {$gui->dialogName} = new std_dialog('&refreshTree'); show_hide_container_title=$labels.other_versions show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id}
@@ -478,7 +478,7 @@ var {$gui->dialogName} = new std_dialog('&refreshTree'); show_hide_container_title=$title show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id} {* Other Versions *} diff --git a/gui/templates/tl-classic/results/resultsBugs.tpl b/gui/templates/tl-classic/results/resultsBugs.tpl index c32c7c5c4a..2d467f6fbc 100644 --- a/gui/templates/tl-classic/results/resultsBugs.tpl +++ b/gui/templates/tl-classic/results/resultsBugs.tpl @@ -8,9 +8,9 @@ Purpose: smarty template - show Test Results and Metrics title_test_case_bugs, info_bugs_per_tc_report, generated_by_TestLink_on,bugs_resolved,bugs_total,tcs_with_bugs'} -{include file="inc_head.tpl"} +{include file="inc_head.tpl" openHead="yes"} {foreach from=$gui->tableSet key=idx item=matrix name="initializer"} - {$tableID="$matrix->tableID"} + {assign var=tableID value=$matrix->tableID} {if $smarty.foreach.initializer.first} {$matrix->renderCommonGlobals()} {if $matrix instanceof tlExtTable} @@ -20,7 +20,7 @@ Purpose: smarty template - show Test Results and Metrics {/if} {$matrix->renderHeadSection()} {/foreach} - + {if $gui->printDate == ''} @@ -78,4 +78,4 @@ Purpose: smarty template - show Test Results and Metrics
- \ No newline at end of file + diff --git a/gui/templates/tl-classic/testcases/tcView.tpl b/gui/templates/tl-classic/testcases/tcView.tpl index 9c06368f84..d85ca0c5d6 100644 --- a/gui/templates/tl-classic/testcases/tcView.tpl +++ b/gui/templates/tl-classic/testcases/tcView.tpl @@ -242,7 +242,7 @@ function jsCallDeleteFile(btn, text, o_id) { show_hide_container_title=$labels.other_versions show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id}
@@ -274,7 +274,7 @@ function jsCallDeleteFile(btn, text, o_id) { show_hide_container_title=$title show_hide_container_id=$div_id show_hide_container_draw=false - show_hide_container_class='exec_additional_info' + show_hide_container_class='execAdditionalInfo' show_hide_container_view_status_id=$memstatus_id}
diff --git a/gui/templates/tl-classic/tree_control_add_tc_navigator.inc.tpl b/gui/templates/tl-classic/tree_control_add_tc_navigator.inc.tpl index 4be8434bbb..4bd8f55502 100644 --- a/gui/templates/tl-classic/tree_control_add_tc_navigator.inc.tpl +++ b/gui/templates/tl-classic/tree_control_add_tc_navigator.inc.tpl @@ -11,7 +11,7 @@ {lang_get var=labels s='expand_tree, collapse_tree, show_whole_spec_on_right_panel'} -
+
diff --git a/gui/themes/default/css/testlink.css b/gui/themes/default/css/testlink.css index f1464a15d6..03216f574c 100644 --- a/gui/themes/default/css/testlink.css +++ b/gui/themes/default/css/testlink.css @@ -965,7 +965,7 @@ div.login_form.medium { } -.exec_additional_info{ +.execAdditionalInfo{ background-color: #F0F4F0; /* whitesmoke=F0F4F0, #FFC*/ color: black; margin-bottom: 10px; diff --git a/gui/themes/default/images/bulkAssignTransparent.png b/gui/themes/default/images/bulkAssignTransparent.png new file mode 100644 index 0000000000..0528dfa24e Binary files /dev/null and b/gui/themes/default/images/bulkAssignTransparent.png differ diff --git a/index.php b/index.php index 76494b8392..8adb2af836 100644 --- a/index.php +++ b/index.php @@ -1,122 +1,130 @@ -dbID = $_SESSION['currentUser']->dbID; - $user->readFromDB($db); - $dbSecurityCookie = $user->getSecurityCookie(); - $redir2login = ( $securityCookie != $dbSecurityCookie ); - } +dbID = $_SESSION['currentUser']->dbID; + $user->readFromDB($db); + $dbSecurityCookie = $user->getSecurityCookie(); + $redir2login = ($securityCookie != $dbSecurityCookie); + } +} + +if ($redir2login) { + // destroy user in session as security measure + unset($_SESSION['currentUser']); + + // If session does not exists I think is better in order to + // manage other type of authentication method/schemas + // to understand that this is a sort of FIRST Access. + // + // When TL undertand that session exists but has expired + // is OK to call login with expired indication, but is not this case + // + // Dev Notes: + // may be we are going to login.php and it will call us again! + $urlo = TL_BASE_HREF . "login.php" . ($args->ssodisable ? '?ssodisable' : ''); + redirect($urlo); + exit(); +} + +// We arrive to these lines only if we are logged in +// +// Calling testlinkInitPage() I'm doing what we do on navBar.php +// navBar.php is called via main.tpl +// testlinkInitPage($db,('initProject' == 'initProject')); + +$tplEngine = new TLSmarty(); +$tplEngine->assign('gui', $gui); +$tplEngine->display('main.tpl'); + +/** + * Initializes the environment + * + * @return stdClass[] object returns the arguments for the page + */ +function initEnv() +{ + $iParams = array( + "reqURI" => array( + tlInputParameter::STRING_N, + 0, + 4000 + ) + ); + $pParams = G_PARAMS($iParams); + + $args = new stdClass(); + $args->ssodisable = getSSODisable(); + + // CWE-79: + // Improper Neutralization of Input + // During Web Page Generation ('Cross-site Scripting') + // + // https://cxsecurity.com/issue/WLB-2019110139 + $args->reqURI = ''; + if ($pParams["reqURI"] != '') { + $args->reqURI = $pParams["reqURI"]; + + // some sanity checks + // strpos ( string $haystack , mixed $needle + if (stripos($args->reqURI, 'javascript') !== false) { + $args->reqURI = null; + } + } + if (null == $args->reqURI) { + $args->reqURI = 'lib/general/mainPage.php'; + } + $args->reqURI = $_SESSION['basehref'] . $args->reqURI; + + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + + $gui = new stdClass(); + $gui->title = lang_get('main_page_title'); + $gui->mainframe = $args->reqURI; + $gui->navbar_height = config_get('navbar_height'); + + $sso = ($args->ssodisable ? '&ssodisable' : ''); + $gui->titleframe = "lib/general/navBar.php?" . + "tproject_id={$args->tproject_id}&" . "tplan_id={$args->tplan_id}&" . + "updateMainPage=1" . $sso; + $gui->logout = 'logout.php?viewer=' . $sso; + + return array( + $args, + $gui + ); } - -if($redir2login) { - // destroy user in session as security measure - unset($_SESSION['currentUser']); - - // If session does not exists I think is better in order to - // manage other type of authentication method/schemas - // to understand that this is a sort of FIRST Access. - // - // When TL undertand that session exists but has expired - // is OK to call login with expired indication, but is not this case - // - // Dev Notes: - // may be we are going to login.php and it will call us again! - $urlo = TL_BASE_HREF . "login.php" . ($args->ssodisable ? '?ssodisable' : ''); - redirect($urlo); - exit; -} - - -// We arrive to these lines only if we are logged in -// -// Calling testlinkInitPage() I'm doing what we do on navBar.php -// navBar.php is called via main.tpl -// testlinkInitPage($db,('initProject' == 'initProject')); - -$tplEngine = new TLSmarty(); -$tplEngine->assign('gui', $gui); -$tplEngine->display('main.tpl'); - - -/** - * - * - */ -function initEnv() { - $iParams = array("reqURI" => array(tlInputParameter::STRING_N,0,4000)); - $pParams = G_PARAMS($iParams); - - $args = new stdClass(); - $args->ssodisable = getSSODisable(); - - // CWE-79: - // Improper Neutralization of Input - // During Web Page Generation ('Cross-site Scripting') - // - // https://cxsecurity.com/issue/WLB-2019110139 - $args->reqURI = ''; - if ($pParams["reqURI"] != '') { - $args->reqURI = $pParams["reqURI"]; - - // some sanity checks - // strpos ( string $haystack , mixed $needle - if (stripos($args->reqURI,'javascript') !== false) { - $args->reqURI = null; - } - } - if (null == $args->reqURI) { - $args->reqURI = 'lib/general/mainPage.php'; - } - $args->reqURI = $_SESSION['basehref'] . $args->reqURI; - - - - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - - $gui = new stdClass(); - $gui->title = lang_get('main_page_title'); - $gui->mainframe = $args->reqURI; - $gui->navbar_height = config_get('navbar_height'); - - $sso = ($args->ssodisable ? '&ssodisable' : ''); - $gui->titleframe = "lib/general/navBar.php?" . - "tproject_id={$args->tproject_id}&" . - "tplan_id={$args->tplan_id}&" . - "updateMainPage=1" . $sso; - $gui->logout = 'logout.php?viewer=' . $sso; - - return array($args,$gui); -} \ No newline at end of file diff --git a/install/index.php b/install/index.php index d039c576ed..66b6be96db 100644 --- a/install/index.php +++ b/install/index.php @@ -13,9 +13,9 @@ */ if(!isset($tlCfg)) { - $tlCfg = new stdClass(); -} -require_once("../cfg/const.inc.php"); + $tlCfg = new stdClass(); +} +require_once '../cfg/const.inc.php'; session_start(); $_SESSION['session_test'] = 1; @@ -40,8 +40,8 @@

You are installing TestLink

Migration to latest version ( ) requires Database changes that has to be done MANUALLY. - Please read README file provided with installation.

-

For information about Migration from older version ( < 1.9.3 ) please read README file provided with installation.

+ Please read README file provided with installation.

+

For information about Migration from older version ( < 1.9.3 ) please read README file provided with installation.

Please read Section on README file or go to (Forum: TestLink 1.9.4 and greater News,changes, etc)

Open Installation manual for more information or troubleshooting. You could also look at @@ -61,14 +61,14 @@
- TestLink is a complicated piece of software, and has always been released under - an Open Source license, and this will continue into the far future. -
It has cost thousands of hours to develop, test and support TestLink. -
If you find TestLink valuable, we would appreciate if you would consider - buying a support agreement or requesting custom development. + TestLink is a complicated piece of software, and has always been released under + an Open Source license, and this will continue into the far future. +
It has cost thousands of hours to develop, test and support TestLink. +
If you find TestLink valuable, we would appreciate if you would consider + buying a support agreement or requesting custom development.

 
- \ No newline at end of file + diff --git a/install/installCheck.php b/install/installCheck.php index 2cabead58b..7bd9f103b4 100644 --- a/install/installCheck.php +++ b/install/installCheck.php @@ -1,35 +1,35 @@ - absolutely wrong use as usual, used on installHead.inc +$inst_phase = 'checking'; // global variable -> absolutely wrong use as usual, used on installHead.inc $msg=''; -include 'installHead.inc'; +include_once 'installHead.inc'; ?>
-

TestLink will carry out a number of checks to see if everything's ready to start +

TestLink will carry out a number of checks to see if everything's ready to start the setup.

@@ -49,10 +49,10 @@ 0) { // Stop process because of error ?> -

Unfortunately, TestLink scripted setup cannot continue at the moment, due to the above - 1 ? $errors." " : "" ; ?>error 1 ? "s" : "" ; ?>. -
Please correct the error 1 ? "s" : "" ; ?>, - and try again (reload page). If you need help figuring out how to fix the +

Unfortunately, TestLink scripted setup cannot continue at the moment, due to the above + 1 ? $errors." " : "" ; ?>error 1 ? "s" : "" ; ?>. +
Please correct the error 1 ? "s" : "" ; ?>, + and try again (reload page). If you need help figuring out how to fix the problem 1 ? "s" : "" ; ?>, please read Installation manual and visit TestLink Forums [click here].

@@ -69,8 +69,8 @@

Your system is prepared for TestLink configuration (no fatal problem found).

- \ No newline at end of file +include_once 'installFooter.inc'; +?> diff --git a/install/installDbInput.php b/install/installDbInput.php index 096e822cdf..b4ed524caf 100644 --- a/install/installDbInput.php +++ b/install/installDbInput.php @@ -1,30 +1,30 @@ - absolutely wrong use as usual, used on installHead.inc -include 'installHead.inc'; +$inst_phase = 'dbaccess'; // global variable -> absolutely wrong use as usual, used on installHead.inc +include_once 'installHead.inc'; ?>
@@ -64,7 +64,7 @@ function validate() { return false; } - if(f.tableprefix.value != "") + if(f.tableprefix.value != "") { if( f.tableprefix.value.search(/^[A-Za-z0-9_]*$/) == -1) { @@ -87,7 +87,7 @@ function validate() {
- '); ?> + '; ?> @@ -108,7 +108,7 @@ function validate() {
-

+

@@ -123,32 +123,36 @@ function validate() { - +

- +

Note: In the case that you DB connection dosn't use STANDARD PORT for , you need to add ':port_number', at the end Database host parameter. - Example: you use MySQL running on port 6606, on server matrix + Example: you use MySQL running on port 6606, on server matrix then Database host will be matrix:6606
-

-

Enter the name of the TestLink database
+

+

Enter the name of the TestLink database

- +

Disallowed characters in Database Name:
- The database name can contains any character that is allowed in + The database name can contains any character that is allowed in a directory name, except '/', '\', or '.'.

@@ -163,10 +167,10 @@ function validate() {
Note: This parameter should be empty for the most of cases.
Using a Database shared with other applications: - Testlink can be installed (using this installer) on a existing database + Testlink can be installed (using this installer) on a existing database used by another application, using a table prefix.
- Warning! PART OF INSTALLATION PROCESS CONSISTS - on dropping all TestLink tables present on the database/schema (if any TestLink table exists). + Warning! PART OF INSTALLATION PROCESS CONSISTS + on dropping all TestLink tables present on the database/schema (if any TestLink table exists). Backup your Database Before installing and load after this process.

@@ -199,23 +203,24 @@ function validate() {

- This user will have permission only to work on TestLink database and will be + This user will have permission only to work on TestLink database and will be stored in TestLink configuration.
All TestLink requests to the Database will be done with this user.

- ' . - 'login name: admin
password : admin'; + ' . 'login name: admin
password : admin'; + } ?>

- + - \ No newline at end of file + diff --git a/install/installFooter.inc b/install/installFooter.inc index 56df987dba..a982a71631 100644 --- a/install/installFooter.inc +++ b/install/installFooter.inc @@ -1,13 +1,13 @@ - \ No newline at end of file + diff --git a/install/installHead.inc b/install/installHead.inc index d215d3306d..14e9f26d01 100644 --- a/install/installHead.inc +++ b/install/installHead.inc @@ -1,13 +1,13 @@ - +

Dot @@ -37,15 +37,15 @@ function getPhaseAttr($inst_phase, $phase)
    >Acceptance of License - >Verification of System and + >Verification of System and configuration requirements >Definition of DB access > + {echo "Create DB, testlink DB user, structures and default data & create configuration file.";} + else {echo "Update DB structures and migrate data.";} ?> - >Verify the procedure result and continue + >Verify the procedure result and continue to TestLink login.
diff --git a/install/installIntro.php b/install/installIntro.php index 1eb6854e63..f5cf6d8954 100644 --- a/install/installIntro.php +++ b/install/installIntro.php @@ -1,13 +1,13 @@

TestLink is developed and shared under GPL license. You are welcome to share your changes @@ -80,15 +80,15 @@ function ableButton() { button = document.getElementById("continue"); if(check.checked==true) { - button.disabled = false; + button.disabled = false; } else { - button.disabled = true; + button.disabled = true; } }

-

@@ -96,4 +96,4 @@ function ableButton() {

- \ No newline at end of file + diff --git a/install/installNewDB.php b/install/installNewDB.php index 8bb0ce8bad..2e1a0b72c8 100644 --- a/install/installNewDB.php +++ b/install/installNewDB.php @@ -1,701 +1,663 @@ -isValid($dbHost)) { - // hostname is invalid; print the reasons - foreach ($validator->getMessages() as $message) { - echo "$message\n"; - } - die(); -} - -// Allows only certan kind of letters, numbers, minus, underscore -$san = '/[^A-Za-z0-9\-_]/'; - -$db_name = trim($_SESSION['databasename']); -$db_name = preg_replace($san,'',$db_name); - -$db_table_prefix = trim($_SESSION['tableprefix']); -$db_table_prefix = preg_replace($san,'',$db_table_prefix); - -$db_type = trim($_SESSION['databasetype']); -$db_type = preg_replace($san,'',$db_type); - -$db_admin_pass = trim($_SESSION['databaseloginpassword']); -$tl_db_passwd = trim($_SESSION['tl_loginpassword']); - - - - -// will limit length to avoi some kind of injection -// Choice: 32 -// Allows only certan kind of letters, numbers, minus, underscore -$tl_db_login = trim($_SESSION['tl_loginname']); -$tl_db_login = substr(preg_replace($san,'',$tl_db_login),0,32); - -$db_admin_name = trim($_SESSION['databaseloginname']); -$db_admin_name = substr(preg_replace($san,'',$db_admin_name),0,32); - - - -$sql_create_schema = array(); -$sql_create_schema[] = "sql/{$db_type}/testlink_create_tables.sql"; -$a_sql_schema = array(); -$a_sql_schema[] = $sql_create_schema; - -$sql_default_data = array(); -$sql_default_data [] = "sql/{$db_type}/testlink_create_default_data.sql"; -$a_sql_data = array(); -$a_sql_data[] = $sql_default_data; - - -global $g_tlLogger; -$g_tlLogger->disableLogging('db'); -$inst_type_verbose=" Installation "; - -$install = $_SESSION['isNew']; -$upgrade = !$install; -if ($upgrade) -{ - $inst_type_verbose=" Upgrade "; - $a_sql_data = array(); -} -$the_title = $_SESSION['title']; +isValid($dbHost)) { + // hostname is invalid; print the reasons + foreach ($validator->getMessages() as $message) { + echo "$message\n"; + } + die(); +} + +// Allows only certan kind of letters, numbers, minus, underscore +$san = '/[^A-Za-z0-9\-_]/'; + +$db_name = trim($_SESSION['databasename']); +$db_name = preg_replace($san, '', $db_name); + +$db_table_prefix = trim($_SESSION['tableprefix']); +$db_table_prefix = preg_replace($san, '', $db_table_prefix); + +$db_type = trim($_SESSION['databasetype']); +$db_type = preg_replace($san, '', $db_type); + +$db_admin_pass = trim($_SESSION['databaseloginpassword']); +$tl_db_passwd = trim($_SESSION['tl_loginpassword']); + +// will limit length to avoi some kind of injection +// Choice: 32 +// Allows only certan kind of letters, numbers, minus, underscore +$tl_db_login = trim($_SESSION['tl_loginname']); +$tl_db_login = substr(preg_replace($san, '', $tl_db_login), 0, 32); + +$db_admin_name = trim($_SESSION['databaseloginname']); +$db_admin_name = substr(preg_replace($san, '', $db_admin_name), 0, 32); + +$sql_create_schema = array(); +$sql_create_schema[] = "sql/{$db_type}/testlink_create_tables.sql"; +$a_sql_schema = array(); +$a_sql_schema[] = $sql_create_schema; + +$sql_default_data = array(); +$sql_default_data[] = "sql/{$db_type}/testlink_create_default_data.sql"; +$a_sql_data = array(); +$a_sql_data[] = $sql_default_data; + +global $g_tlLogger; +$g_tlLogger->disableLogging('db'); +$inst_type_verbose = " Installation "; + +$install = $_SESSION['isNew']; +$upgrade = ! $install; +if ($upgrade) { + $inst_type_verbose = " Upgrade "; + $a_sql_data = array(); +} +$the_title = $_SESSION['title']; ?> - <?php echo $the_title; ?> + <?php + +echo $the_title; +?> - + -

+
- - + + - + - - "; + if ($my['opt']['addCheck']) { + $check_name = str_replace('id="', 'name="check_', $dummy[0]); + $cf_smarty .= ""; + } + + $cf_smarty .= "\n"; + } + + $cf_smarty = $openTag . $cf_smarty . $closeTag; + } + return $cf_smarty; + } + + /** + * + * @used-by html_inputs(), html_table_inputs() + */ + private function getValuesFromUserInput($cf_map, $name_suffix = '', + $input_values = null) + { + if (! is_null($input_values)) { + $dateFormatDomain = config_get('locales_date_format'); + + // It will be better remove this coupling + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $date_format = str_replace('%', '', $dateFormatDomain[$locale]); + + foreach ($cf_map as &$cf_info) { + $value = null; + $dtinname = null; + $verbose_type = trim( + $this->custom_field_types[$cf_info['type']]); + $cf_info['html_input_name'] = $this->buildHTMLInputName( + $cf_info, $name_suffix); + + switch ($verbose_type) { + case 'date': + $cf_info['html_input_name'] .= '_input'; + break; + + case 'datetime': + $dtinname = $cf_info['html_input_name']; + $cf_info['html_input_name'] .= '_input'; + break; + } + + if (isset($input_values[$cf_info['html_input_name']])) { + $value = $input_values[$cf_info['html_input_name']]; + } elseif (isset($input_values[$cf_info['id']])) { + $value = $input_values[$cf_info['id']]['value']; + } elseif (isset($cf_info['value'])) { + $value = $cf_info['value']; + } + + switch ($verbose_type) { + case 'date': + if (($value != 0) && ($value != '') && + ! is_numeric($value)) { + $parsed = split_localized_date($value, $date_format); + if ($parsed != null) { + $value = mktime(0, 0, 0, $parsed['month'], + $parsed['day'], $parsed['year']); + } else { + $value = ''; + } + } + break; + + case 'datetime': + if (($value != 0) && ($value != '') && + ! is_numeric($value)) { + $parsed = split_localized_date($value, $date_format); + if ($parsed != null) { + $vtime['hour'] = $input_values[$dtinname . + '_hour']; + $vtime['minute'] = $input_values[$dtinname . + '_minute']; + $vtime['second'] = $input_values[$dtinname . + '_second']; + + if ($vtime['hour'] == - 1 || + $vtime['minute'] == - 1 || + $vtime['second'] == - 1) { + $vtime['hour'] = $vtime['minute'] = $vtime['second'] = 0; + } + $value = mktime($vtime['hour'], $vtime['minute'], + $vtime['second'], $parsed['month'], + $parsed['day'], $parsed['year']); + } else { + $value = ''; + } + } + + break; + } + + if (! is_null($value) && is_array($value)) { + $value = implode("|", $value); + } + + $cf_info['value'] = $value; + } + } + return $cf_map; + } + + /** + */ + public function html_inputs($cfields_map, $name_suffix = '', + $input_values = null) + { + $inputSet = array(); + $getOpt = array( + 'name_suffix' => $name_suffix + ); + + if (! is_null($cfields_map)) { + $cf_map = $this->getValuesFromUserInput($cfields_map, $name_suffix, + $input_values); + + $NO_WARNING_IF_MISSING = true; + foreach ($cf_map as $cf_info) { + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, $NO_WARNING_IF_MISSING)); + + // IMPORTANT NOTICE + // assigning an ID with this format is CRITIC to Javascript logic used + // to validate input data filled by user according to CF type + // extract input html id + // Want to give an html id to "; - if($my['opt']['addCheck']) - { - $check_id = str_replace('id="', 'id="check_', $dummy[0]); - $check_name = str_replace('id="', 'name="check_', $dummy[0]); - $cf_smarty .= ""; - } - - $cf_smarty .= "\n"; - } - - $cf_smarty = $openTag . $cf_smarty . $closeTag; - } - return $cf_smarty; -} - - -/** - * - * @used-by html_inputs(), html_table_inputs() - */ -function getValuesFromUserInput($cf_map,$name_suffix='',$input_values=null) -{ - - if( !is_null($input_values) ) - { - $dateFormatDomain = config_get('locales_date_format'); - - // It will be better remove this coupling - $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; - $date_format = str_replace('%', '', $dateFormatDomain[$locale]); - - foreach($cf_map as &$cf_info) - { - $value = null; - $dtinname = null; - $verbose_type = trim($this->custom_field_types[$cf_info['type']]); - $cf_info['html_input_name'] = $this->buildHTMLInputName($cf_info,$name_suffix); - - switch($verbose_type) - { - case 'date': - $cf_info['html_input_name'] .= '_input'; - break; - - case 'datetime': - $dtinname = $cf_info['html_input_name']; - $cf_info['html_input_name'] .= '_input'; - break; - } - - if (isset($input_values[$cf_info['html_input_name']])) { - $value = $input_values[$cf_info['html_input_name']]; - } else if (isset($input_values[$cf_info['id']])) { - $value = $input_values[$cf_info['id']]['value']; - } else if (isset($cf_info['value'])) { - $value = $cf_info['value']; - } - - switch($verbose_type) - { - case 'date': - if ( ($value != 0) && ($value != '') && !is_numeric($value) ) - { - $parsed = split_localized_date($value, $date_format); - if($parsed != null) - { - $value = mktime(0,0,0,$parsed['month'],$parsed['day'], - $parsed['year']); - } - else - { - $value = ''; - } - } - break; - - case 'datetime': - if ( ($value != 0) && ($value != '') && !is_numeric($value) ) - { - $parsed = split_localized_date($value, $date_format); - if($parsed != null) - { - $vtime['hour'] = $input_values[$dtinname . '_hour']; - $vtime['minute'] = $input_values[$dtinname . '_minute']; - $vtime['second'] = $input_values[$dtinname . '_second']; - - if($vtime['hour'] == -1 || $vtime['minute'] == -1 || - $vtime['second'] == -1) - { - $vtime['hour'] = $vtime['minute'] = $vtime['second'] = 0; - } - $value = mktime($vtime['hour'], $vtime['minute'],$vtime['second'], - $parsed['month'],$parsed['day'],$parsed['year']); - } - else - { - $value = ''; - } - } - - - break; - - } - - if (!is_null($value) && is_array($value)) - { - $value = implode("|", $value); - } - - $cf_info['value'] = $value; - } - } - return $cf_map; -} - - - /** - * - * - */ - function html_inputs($cfields_map,$name_suffix='',$input_values=null) - { - $inputSet = array(); - $getOpt = array('name_suffix' => $name_suffix); - - if(!is_null($cfields_map)) - { - $cf_map = $this->getValuesFromUserInput($cfields_map,$name_suffix,$input_values); - - $NO_WARNING_IF_MISSING=true; - foreach($cf_map as $cf_id => $cf_info) - { - $label=str_replace(TL_LOCALIZE_TAG,'', - lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING)); - - - // IMPORTANT NOTICE - // assigning an ID with this format is CRITIC to Javascript logic used - // to validate input data filled by user according to CF type - // extract input html id - // Want to give an html id to
     
  
- + + - " . - ' + " . + ' - ' . - " + ' . + "
+
- 0 ) { - echo $check['msg']; - close_html_and_exit(); -} + 0) { + echo $check['msg']; + close_html_and_exit(); +} ?> TestLink setup will now attempt to setup the database:
-Creating connection to Database Server:"; - -// -------------------------------------------------------------------------- -// Connect to DB Server without choosing an specific database -switch($db_type) { - case 'mssql': - $dbDriverName = 'mssqlnative'; - break; - - default: - $dbDriverName = $db_type; - break; -} - -$db = new database($dbDriverName); -define('NO_DSN',FALSE); -@$conn_result = $db->connect(NO_DSN,$db_server, $db_admin_name, $db_admin_pass); - -if( $conn_result['status'] == 0 ) { - echo 'Failed!

Please check the database login details and try again.'; - echo '
Database Error Message: ' . $db->error_msg() . "
"; - - echo '
$db_server:' . $db_server . '
'; - echo '
$db_admin_name:' . $db_admin_name . '
'; - echo '
$db_admin_pass:' . $db_admin_pass . '
'; - - - close_html_and_exit(); -} else { - echo "OK!

"; -} -$db->close(); -$db=null; - - -// ------------------------------------------------------------------------- -// Connect to the Database (if Succesful -> database exists) -$db = new database($dbDriverName); - -@$conn_result = $db->connect(NO_DSN,$db_server, $db_admin_name, $db_admin_pass,$db_name); - -if( $conn_result['status'] == 0 ) { - $db->close(); - echo "
Database $db_name does not exist.
"; - - if( $upgrade ) { - echo "Can't Upgrade"; - close_html_and_exit(); - - $errors += 1; - } - else { - echo "Will attempt to create:"; - $create = true; - } -} -else { - echo "
Connecting to database `" . $db_name . "`:"; - echo "OK!"; -} -// ------------------- - - -// ------------------- -if($create) { - // check database name for invalid characters (now only for MySQL) - $db->close(); - $db = null; - - $db = New database($dbDriverName); - $conn_result=$db->connect(NO_DSN,$db_server, $db_admin_name, $db_admin_pass); - echo "
Creating database `" . $db_name . "`:"; - - // from MySQL Manual - // 9.2. Database, Table, Index, Column, and Alias Names - // - // Identifier : Database - // Maximum Length (bytes): 64 - // Allowed Characters : Any character that is allowed in a directory name, except '/', '\', or '.' - // - // An identifier may be quoted or unquoted. - // If an identifier is a reserved word or contains special characters, you must quote it whenever you refer to it. - // For a list of reserved words, see Section 9.6, �Treatment of Reserved Words in MySQL�. - // Special characters are those outside the set of alphanumeric characters from the current character set, - // '_', and '$'. - // The identifier quote character is the backtick ('`'): - // - // - // Postgres uses as identifier quote character " (double quotes): - $sql_create_db =$db->build_sql_create_db($db_name); - - if(!$db->exec_query($sql_create_db)) { - echo "Failed! - Could not create database: $db! " . - $db->error_msg(); - $errors += 1; - - echo "

TestLink setup could not create the database, " . - "and no existing database with the same name was found.
" . - "Please create a database by different way (e.g. from command line)," . - " or with different DB root account. Run setup again then."; - close_html_and_exit(); - } - else { - echo "OK!"; - } -} - -// in upgrade mode we detect the lenght of user password field -// to identify a version with uncrypted passwords -$tables = tlObject::getDBTables(); -$my_ado = $db->get_dbmgr_object(); -if ($upgrade) { - $user_table=$my_ado->MetaTables('TABLES',false,'user'); - if( count($user_table) == 1 ) { - $the_cols=$my_ado->MetaColumns('user'); - $pwd_field_len =$the_cols['PASSWORD']->max_length; - if ( $pwd_field_len == LEN_PWD_TL_1_0_4 ) { - $update_pwd=1; - echo "

You are trying to upgrade from a pre-release of TestLink 1.5" . - "
this kind of upgrade is supported by this script. Use upgrade to supported version " . - "at first.

"; - close_html_and_exit(); - } - } - // ------------------------------------------------------------- - - $a_sql_upd_dir=array(); - $a_sql_data_dir=array(); - - $the_version_table=$my_ado->MetaTables('TABLES',false,$db_table_prefix . 'db_version'); - if( count($the_version_table) == 0 ) { - echo "

You are trying to upgrade from a pre-release of TestLink 1.7" . - "
this kind of upgrade is supported by this script. Use upgrade to supported version " . - "at first.

"; - close_html_and_exit(); - } - else { - $migration_functions_file = ''; - $migration_process = ''; - - // try to know what db version is installed - // check if we need to use prefix but for some reason tlObjectWithDB::getDBTables - // have not returned prefix. - // - $dbVersionTable = $tables['db_version']; - if($dbVersionTable == 'db_version' && trim($db_table_prefix) != '') { - $dbVersionTable = $db_table_prefix . $dbVersionTable; - } - $sql = "SELECT * FROM {$dbVersionTable} ORDER BY upgrade_ts DESC"; - $res = $db->exec_query($sql); - if (!$res) { - echo "Database ERROR:" . $db->error_msg(); - exit(); - } - - $myrow = $db->fetch_array($res); - $schema_version=trim($myrow['version']); - - switch ($schema_version) { - case 'DB 1.2': - $a_sql_upd_dir[] = "sql/alter_tables/1.9/{$db_type}/DB.1.3/step1/"; - $a_sql_data_dir[] = "sql/alter_tables/1.9/{$db_type}/DB.1.3/stepZ/"; - $migration_process = 'migrate_18_to_19'; - $migration_functions_file = './migration/migrate_18/migrate_18_to_19.php'; - break; - - case 'DB 1.3': - echo "

Your DB Schema {$schema_version} NEED TO BE upgraded, but you have to do "; - echo " this MANUALLY using a SQL client and scripts you will find on "; - echo " directory install/sql/alter_tables/1.9.1 "; - echo "

"; - close_html_and_exit(); - break; - - case 'DB 1.4': - echo "

Your DB Schema {$schema_version} NEED TO BE upgraded, but you have to do "; - echo " this MANUALLY using a SQL client and scripts you will find on "; - echo " directory install/sql/alter_tables/1.9.4 "; - echo "

"; - close_html_and_exit(); - break; - - case 'DB 1.5': - echo "

Your DB Schema {$schema_version} is the last available, then you don't need to do any upgrade."; - echo "
Script is finished.

"; - close_html_and_exit(); - break; - - default: - if( strlen($schema_version) == 0 ) - { - echo "

Information of DB schema version is missing. Don't know how to upgrade.

"; - } - else - { - echo "

This script doesn't recognize your schema version: " . $schema_version . "

"; - } - echo "

Upgrade is not possible. Check your input data (Go back in page history).

"; - close_html_and_exit(); - break; - } - } - - $a_sql_schema = getDirSqlFiles($a_sql_upd_dir,ADD_DIR); - $a_sql_data = getDirSqlFiles($a_sql_data_dir,ADD_DIR); -} - - -// ------------------------------------------------------------------------ -// Now proceed with user checks and user creation (if needed) -// -// Added support for different types of architecture/installations: -// webserver and dbserver on same machines => user will be created as user -// webserver and dbserver on DIFFERENT machines => user must be created as user@webserver -// -// if @ in tl_db_login (username) -> get the hostname using splitting, and use it -// during user creation on db. -$db->close(); -$db=null; -$user_host = explode('@',$tl_db_login); -$msg = create_user_for_db($dbDriverName,$db_name, $db_server, - $db_admin_name, $db_admin_pass, - $tl_db_login, $tl_db_passwd); - -echo "
Creating Testlink DB user `" . $user_host[0] . "`:"; -if ( strpos($msg,'ok -') === FALSE ) { - echo "Failed! - Could not create user: $tl_db_login!"; - $errors += 1; -} -else { - echo "OK! ($msg) "; -} - - -// ------------------------------------------------------------------------ -// Schema Operations (CREATE, ALTER, ecc). -// Important: -// Postgres: do it as tl_login NOT as db_admin -// MySQL : do it as db_admin NOT as tl_login -if( !is_null($db) ) { - $db->close(); - $db=null; -} - -$db = new database($dbDriverName); -switch($db_type) { - case 'mssql': - @$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, $db_name); - break; - - case 'mysql': - @$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, $db_name); - break; - - case 'postgres': - @$conn_result = $db->connect(NO_DSN, $db_server, $tl_db_login, $tl_db_passwd, $db_name); - break; -} - -// ------------------------------------------------------------------------------------ -if( $install && $conn_result['status'] != 0 ) { - drop_views($db,$db_table_prefix,$db_type); - drop_tables($db,$db_table_prefix,$db_type); -} - - -// ------------------------------------------------------------------------------- -$sqlParser = new SqlParser($db,$db_type,$db_table_prefix); -foreach($a_sql_schema as $sql_schema) { - foreach ($sql_schema as $sql_file) { - echo "
Processing:" . $sql_file; - $sqlParser->process($sql_file); - } - echo "
"; -} - -// Now data migration must be done if needed -if( $migration_process != '' ) { - require_once($migration_functions_file); - $migration_process($db,$tables); -} - -// ------------------------------------------------- -// Data Operations -if ( count($a_sql_data) > 0 ) { - foreach($a_sql_data as $sql_data ) { - if ( count($sql_data) > 0 ) { - foreach ($sql_data as $sql_file) { - $sqlParser->process($sql_file); - } - } - } -} - - -// ------------------------------------------------- -if ($update_pwd) { - echo "Password Conversion ..."; - // @author Francisco Mancardi - 20050918 - // Found error upgrading from 1.0.4 to 1.6 on RH - // due to case sensitive on table name. (USER) - - $user_pwd = "UPDATE user SET password=MD5(password)"; - $result = $db->exec_query($user_pwd); -} - - -if($sqlParser->install_failed==true) -{ - echo "Failed! - {$inst_type_verbose} failed!"; - $errors += 1; - - echo "

" . - "TestLink setup couldn't install the default site into the selected database. " . - "The last error to occur was " . $sqlParser->sql_errors[count($sqlParser->sql_errors)-1]["error"] . - ' during the execution of SQL statement ' . - strip_tags($sqlParser->sql_errors[count($sqlParser->sql_errors)-1]["sql"]). ""; - - close_html_and_exit(); -} -else -{ - echo "OK!"; -} - -// ----------------------------------------------------------------------------- -echo "
Writing configuration file:"; -$data['db_host']=$db_server; -$data['db_login'] = $user_host[0]; -$data['db_passwd'] = $tl_db_passwd; -$data['db_name'] = $db_name; -$data['db_type'] = $db_type; -$data['db_table_prefix'] = $db_table_prefix; - - -$cfg_file = "../config_db.inc.php"; -$yy = write_config_db($cfg_file,$data); -// ----------------------------------------------------------------------------- - - -if(strcasecmp('ko', $yy['status']) == 0) { - echo "Failed!"; - $errors += 1; - - echo "

" . - "TestLink couldn't write the config file. Please copy the following into the " . - ' ' . $cfg_file . ' file:
' . - '"; - - echo "Once that's been done, you can log into TestLink by pointing your browser at your TestLink site."; - - close_html_and_exit(); -} -else -{ - echo "OK!"; -} - - -manual_operations($db_type); - -important_reminder(); - -// When testlink is updated do not show login data admin/admin -// as they might not exist -$successfull_message = '


'; - -echo $successfull_message; - -$db->close(); -close_html_and_exit(); - - - -/** - * - * - */ -function manual_operations($dbType) { - - echo '

IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE

'; - - echo ''; - //echo 'IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE'; - //echo ''; - - echo '
'; - echo '

YOU NEED TO RUN MANUALLY Following Script on your DB CLIENT Application

'; - echo '

'; - echo '

' . dirname(__FILE__) . '/sql/'. $dbType . '/testlink_create_udf0.sql'; - echo '


THANKS A LOT

'; -} - -// ----------------------------------------------------------- -function write_config_db($filename, $data) -{ - $ret = array('status' => 'ok', 'cfg_string' => ''); - - $db_host = $data['db_host']; - $db_login = $data['db_login']; - // if @ present in db_login, explode an take user name WITHOUT HOST - $user_host = explode('@',$db_login); - - if (count($user_host) > 1 ) - { - $db_login = $user_host[0]; - } - - $db_passwd = $data['db_passwd']; - $db_name = $data['db_name']; - $db_type = $data['db_type']; - $db_table_prefix = $data['db_table_prefix']; - - // write config.inc.php - $configString = "get_dbmgr_object(); - $tablesOnDB =$my_ado->MetaTables('TABLES'); - if( count($tablesOnDB) > 0 && isset($tablesOnDB[0])) - { - echo "
Dropping all TL existent tables:
"; - foreach($schema as $tablePlainName => $tableFullName) - { - $targetTable = $dbTablePrefix . $tablePlainName; - if( in_array($targetTable,$tablesOnDB) ) - { - // Need to add option (CASCADE ?) to delete dependent object - echo "Dropping $targetTable" . "
"; - $sql="DROP TABLE $targetTable"; - $sql .= (($dbType != 'mssql') && ($dbType != 'sqlsrv')) ? " CASCADE " : ' '; - $dbHandler->exec_query($sql); - } - } - echo "Done!"; - } -} - -function drop_views(&$dbHandler,$dbItemPrefix,$dbType) -{ - $schema = tlObjectWithDB::getDBViews(); - - // views present on target db - $my_ado = $dbHandler->get_dbmgr_object(); - $itemsOnDB =$my_ado->MetaTables('VIEWS'); - if( count($itemsOnDB) > 0 && isset($itemsOnDB[0])) - { - echo "
Dropping all TL existent views:
"; - foreach($schema as $itemPlainName => $itemFullName) - { - $target = $dbItemPrefix . $itemPlainName; - if( in_array($target,$itemsOnDB) ) - { - // Need to add option (CASCADE ?) to delete dependent object - echo "Dropping $target" . "
"; - $sql="DROP VIEW $target"; - $sql .= (($dbType != 'mssql') && ($dbType != 'sqlsrv')) ? " CASCADE " : ' '; - $dbHandler->exec_query($sql); - } - } - echo "Done!"; - } +Creating connection to Database Server:"; + +// Connect to DB Server without choosing an specific database +switch ($db_type) { + case 'mssql': + $dbDriverName = 'mssqlnative'; + break; + + default: + $dbDriverName = $db_type; + break; +} + +$db = new database($dbDriverName); +define('NO_DSN', false); +@$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass); + +if ($conn_result['status'] == 0) { + echo 'Failed!

Please check the database login details and try again.'; + echo '
Database Error Message: ' . $db->error_msg() . "
"; + + echo '
$db_server:' . $db_server . '
'; + echo '
$db_admin_name:' . $db_admin_name . '
'; + echo '
$db_admin_pass:' . $db_admin_pass . '
'; + + close_html_and_exit(); +} else { + echo "OK!

"; +} +$db->close(); +$db = null; + +// Connect to the Database (if Succesful -> database exists) +$db = new database($dbDriverName); + +@$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, + $db_name); + +if ($conn_result['status'] == 0) { + $db->close(); + echo "
Database $db_name does not exist.
"; + + if ($upgrade) { + echo "Can't Upgrade"; + close_html_and_exit(); + + $errors += 1; + } else { + echo "Will attempt to create:"; + $create = true; + } +} else { + echo "
Connecting to database `" . $db_name . "`:"; + echo "OK!"; +} + +if ($create) { + // check database name for invalid characters (now only for MySQL) + $db->close(); + $db = null; + + $db = new database($dbDriverName); + $conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass); + echo "
Creating database `" . $db_name . "`:"; + + // from MySQL Manual + // 9.2. Database, Table, Index, Column, and Alias Names + // + // Identifier : Database + // Maximum Length (bytes): 64 + // Allowed Characters : Any character that is allowed in a directory name, except '/', '\', or '.' + // + // An identifier may be quoted or unquoted. + // If an identifier is a reserved word or contains special characters, you must quote it whenever you refer to it. + // For a list of reserved words, see Section 9.6, �Treatment of Reserved Words in MySQL�. + // Special characters are those outside the set of alphanumeric characters from the current character set, + // '_', and '$'. + // The identifier quote character is the backtick ('`'): + // + // + // Postgres uses as identifier quote character " (double quotes): + $sql_create_db = $db->build_sql_create_db($db_name); + + if (! $db->exec_query($sql_create_db)) { + echo "Failed! - Could not create database: $db! " . + $db->error_msg(); + $errors += 1; + + echo "

TestLink setup could not create the database, " . + "and no existing database with the same name was found.
" . + "Please create a database by different way (e.g. from command line)," . + " or with different DB root account. Run setup again then."; + close_html_and_exit(); + } else { + echo "OK!"; + } +} + +// in upgrade mode we detect the lenght of user password field +// to identify a version with uncrypted passwords +$tables = tlObject::getDBTables(); +$my_ado = $db->get_dbmgr_object(); +if ($upgrade) { + $user_table = $my_ado->MetaTables('TABLES', false, 'user'); + if (count($user_table) == 1) { + $the_cols = $my_ado->MetaColumns('user'); + $pwd_field_len = $the_cols['PASSWORD']->max_length; + if ($pwd_field_len == LEN_PWD_TL_1_0_4) { + $update_pwd = 1; + echo "

You are trying to upgrade from a pre-release of TestLink 1.5" . + "
this kind of upgrade is supported by this script. Use upgrade to supported version " . + "at first.

"; + close_html_and_exit(); + } + } + + $a_sql_upd_dir = array(); + $a_sql_data_dir = array(); + + $the_version_table = $my_ado->MetaTables('TABLES', false, + $db_table_prefix . 'db_version'); + if (count($the_version_table) == 0) { + echo "

You are trying to upgrade from a pre-release of TestLink 1.7" . + "
this kind of upgrade is supported by this script. Use upgrade to supported version " . + "at first.

"; + close_html_and_exit(); + } else { + $migration_functions_file = ''; + $migration_process = ''; + + // try to know what db version is installed + // check if we need to use prefix but for some reason tlObjectWithDB::getDBTables + // have not returned prefix. + // + $dbVersionTable = $tables['db_version']; + if ($dbVersionTable == 'db_version' && trim($db_table_prefix) != '') { + $dbVersionTable = $db_table_prefix . $dbVersionTable; + } + $sql = "SELECT * FROM {$dbVersionTable} ORDER BY upgrade_ts DESC"; + $res = $db->exec_query($sql); + if (! $res) { + echo "Database ERROR:" . $db->error_msg(); + exit(); + } + + $myrow = $db->fetch_array($res); + $schema_version = trim($myrow['version']); + + switch ($schema_version) { + case 'DB 1.2': + $a_sql_upd_dir[] = "sql/alter_tables/1.9/{$db_type}/DB.1.3/step1/"; + $a_sql_data_dir[] = "sql/alter_tables/1.9/{$db_type}/DB.1.3/stepZ/"; + $migration_process = 'migrate_18_to_19'; + $migration_functions_file = './migration/migrate_18/migrate_18_to_19.php'; + break; + + case 'DB 1.3': + echo "

Your DB Schema {$schema_version} NEED TO BE upgraded, but you have to do "; + echo " this MANUALLY using a SQL client and scripts you will find on "; + echo " directory install/sql/alter_tables/1.9.1 "; + echo "

"; + close_html_and_exit(); + break; + + case 'DB 1.4': + echo "

Your DB Schema {$schema_version} NEED TO BE upgraded, but you have to do "; + echo " this MANUALLY using a SQL client and scripts you will find on "; + echo " directory install/sql/alter_tables/1.9.4 "; + echo "

"; + close_html_and_exit(); + break; + + case 'DB 1.5': + echo "

Your DB Schema {$schema_version} is the last available, then you don't need to do any upgrade."; + echo "
Script is finished.

"; + close_html_and_exit(); + break; + + default: + if (strlen($schema_version) == 0) { + echo "

Information of DB schema version is missing. Don't know how to upgrade.

"; + } else { + echo "

This script doesn't recognize your schema version: " . + $schema_version . "

"; + } + echo "

Upgrade is not possible. Check your input data (Go back in page history).

"; + close_html_and_exit(); + break; + } + } + + $a_sql_schema = getDirSqlFiles($a_sql_upd_dir, ADD_DIR); + $a_sql_data = getDirSqlFiles($a_sql_data_dir, ADD_DIR); +} + +// Now proceed with user checks and user creation (if needed) +// +// Added support for different types of architecture/installations: +// webserver and dbserver on same machines => user will be created as user +// webserver and dbserver on DIFFERENT machines => user must be created as user@webserver +// +// if @ in tl_db_login (username) -> get the hostname using splitting, and use it +// during user creation on db. +$db->close(); +$db = null; +$user_host = explode('@', $tl_db_login); +$msg = create_user_for_db($dbDriverName, $db_name, $db_server, $db_admin_name, + $db_admin_pass, $tl_db_login, $tl_db_passwd); + +echo "
Creating Testlink DB user `" . $user_host[0] . "`:"; +if (strpos($msg, 'ok -') === false) { + echo "Failed! - Could not create user: $tl_db_login!"; + $errors += 1; +} else { + echo "OK! ($msg) "; +} + +// Schema Operations (CREATE, ALTER, ecc). +// Important: +// Postgres: do it as tl_login NOT as db_admin +// MySQL : do it as db_admin NOT as tl_login +if (! is_null($db)) { + $db->close(); + $db = null; +} + +$db = new database($dbDriverName); +switch ($db_type) { + case 'mssql': + @$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass, $db_name); + break; + + case 'mysql': + @$conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass, $db_name); + break; + + case 'postgres': + @$conn_result = $db->connect(NO_DSN, $db_server, $tl_db_login, + $tl_db_passwd, $db_name); + break; +} + +if ($install && $conn_result['status'] != 0) { + drop_views($db, $db_table_prefix, $db_type); + drop_tables($db, $db_table_prefix, $db_type); +} + +$sqlParser = new SqlParser($db, $db_type, $db_table_prefix); +foreach ($a_sql_schema as $sql_schema) { + foreach ($sql_schema as $sql_file) { + echo "
Processing:" . $sql_file; + $sqlParser->process($sql_file); + } + echo "
"; +} + +// Now data migration must be done if needed +if ($migration_process != '') { + require_once $migration_functions_file; + $migration_process($db, $tables); +} + +// Data Operations +if (! empty($a_sql_data)) { + foreach ($a_sql_data as $sql_data) { + if (! empty($sql_data)) { + foreach ($sql_data as $sql_file) { + $sqlParser->process($sql_file); + } + } + } +} + +if ($update_pwd) { + echo "Password Conversion ..."; + // @author Francisco Mancardi - 20050918 + // Found error upgrading from 1.0.4 to 1.6 on RH + // due to case sensitive on table name. (USER) + + $user_pwd = "UPDATE user SET password=MD5(password)"; + $result = $db->exec_query($user_pwd); +} + +if ($sqlParser->install_failed) { + echo "Failed! - {$inst_type_verbose} failed!"; + $errors += 1; + + echo "

" . + "TestLink setup couldn't install the default site into the selected database. " . + "The last error to occur was " . + $sqlParser->sql_errors[count($sqlParser->sql_errors) - 1]["error"] . + ' during the execution of SQL statement ' . + strip_tags( + $sqlParser->sql_errors[count($sqlParser->sql_errors) - 1]["sql"]) . + ""; + + close_html_and_exit(); +} else { + echo "OK!"; +} + +echo "
Writing configuration file:"; +$data['db_host'] = $db_server; +$data['db_login'] = $user_host[0]; +$data['db_passwd'] = $tl_db_passwd; +$data['db_name'] = $db_name; +$data['db_type'] = $db_type; +$data['db_table_prefix'] = $db_table_prefix; + +$cfg_file = "../config_db.inc.php"; +$yy = write_config_db($cfg_file, $data); + +if (strcasecmp('ko', $yy['status']) == 0) { + echo "Failed!"; + $errors += 1; + + echo "

" . + "TestLink couldn't write the config file. Please copy the following into the " . + ' ' . $cfg_file . ' file:
' . + '"; + + echo "Once that's been done, you can log into TestLink by pointing your browser at your TestLink site."; + + close_html_and_exit(); +} else { + echo "OK!"; +} + +manual_operations($db_type); + +important_reminder(); + +// When testlink is updated do not show login data admin/admin +// as they might not exist +$successfull_message = '


'; + +echo $successfull_message; + +$db->close(); +close_html_and_exit(); + +/** + */ +function manual_operations($dbType) +{ + echo '

IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE - IMPORTANT NOTICE

'; + echo ''; + echo '
'; + echo '

YOU NEED TO RUN MANUALLY Following Script on your DB CLIENT Application

'; + echo '

'; + echo '

' . dirname(__FILE__) . '/sql/' . $dbType . + '/testlink_create_udf0.sql'; + echo '


THANKS A LOT

'; +} + +function write_config_db($filename, $data) +{ + $ret = array( + 'status' => 'ok', + 'cfg_string' => '' + ); + + $db_host = $data['db_host']; + $db_login = $data['db_login']; + // if @ present in db_login, explode an take user name WITHOUT HOST + $user_host = explode('@', $db_login); + + if (count($user_host) > 1) { + $db_login = $user_host[0]; + } + + $db_passwd = $data['db_passwd']; + $db_name = $data['db_name']; + $db_type = $data['db_type']; + $db_table_prefix = $data['db_table_prefix']; + + // write config.inc.php + $configString = "get_dbmgr_object(); + $tablesOnDB = $my_ado->MetaTables('TABLES'); + if (! empty($tablesOnDB) && isset($tablesOnDB[0])) { + echo "
Dropping all TL existent tables:
"; + foreach ($schema as $tablePlainName => $tableFullName) { + $targetTable = $dbTablePrefix . $tablePlainName; + if (in_array($targetTable, $tablesOnDB)) { + // Need to add option (CASCADE ?) to delete dependent object + echo "Dropping $targetTable" . "
"; + $sql = "DROP TABLE $targetTable"; + $sql .= (($dbType != 'mssql') && ($dbType != 'sqlsrv')) ? " CASCADE " : ' '; + $dbHandler->exec_query($sql); + } + } + echo "Done!"; + } +} + +function drop_views(&$dbHandler, $dbItemPrefix, $dbType) +{ + $schema = tlObjectWithDB::getDBViews(); + + // views present on target db + $my_ado = $dbHandler->get_dbmgr_object(); + $itemsOnDB = $my_ado->MetaTables('VIEWS'); + if (! empty($itemsOnDB) && isset($itemsOnDB[0])) { + echo "
Dropping all TL existent views:
"; + foreach ($schema as $itemPlainName => $itemFullName) { + $target = $dbItemPrefix . $itemPlainName; + if (in_array($target, $itemsOnDB)) { + // Need to add option (CASCADE ?) to delete dependent object + echo "Dropping $target" . "
"; + $sql = "DROP VIEW $target"; + $sql .= (($dbType != 'mssql') && ($dbType != 'sqlsrv')) ? " CASCADE " : ' '; + $dbHandler->exec_query($sql); + } + } + echo "Done!"; + } } diff --git a/install/installStart.php b/install/installStart.php index 0bdbfae1ed..b5400e1d41 100644 --- a/install/installStart.php +++ b/install/installStart.php @@ -13,4 +13,4 @@ echo "No installationType found in \$_GET."; } -?> \ No newline at end of file +?> diff --git a/install/installUtils.php b/install/installUtils.php index a6ad40bfad..77026e0248 100644 --- a/install/installUtils.php +++ b/install/installUtils.php @@ -1,987 +1,900 @@ - Eventum - Issue Tracking System -*/ -function getTableList($db) -{ - $my_ado = $db->get_dbmgr_object(); - $tables = $my_ado->MetaTables('TABLES',false,'db_version'); - return($tables); -} - - - -/* - function: getUserList - - args: - - returns: map or null - - rev : - -*/ -function getUserList(&$db,$db_type) -{ - $users=null; - switch($db_type) - { - case 'mysql': - $result = $db->exec_query('SELECT DISTINCT user AS user FROM user'); - break; - - case 'postgres': - $result = $db->exec_query('SELECT DISTINCT usename AS user FROM pg_user'); - break; - - case 'mssql': - case 'mssqlnative': - // info about running store procedures, get form adodb manuals - // Important: - // From ADODB manual - Prepare() documentation - // - // Returns an array containing the original sql statement in the first array element; - // the remaining elements of the array are driver dependent. - // - // Looking into adodb-mssql.inc.php, you will note that array[1] - // is a mssql stm object. - // This info is very important, to use mssql_free_statement() - // - $stmt = $db->db->PrepareSP('SP_HELPLOGINS'); # note that the parameter name does not have @ in front! - $result = $db->db->Execute($stmt); - - // Very important: - // Info from PHP Manual notes - // mssql_free_statement() - // - // mitch at 1800radiator dot kom (23-Mar-2005 06:02) - // Maybe it's unique to my FreeTDS configuration, but if - // I don't call mssql_free_statement() - // after every stored procedure (i.e. mssql_init, mssql_bind, - // mssql_execute, mssql_fetch_array), - // all subsequent stored procedures on the same database - // connection will fail. - // I only mention it because this man-page deprecates - // the use of mssql_free_statement(), - // saying it's only there for run-time memory concerns. - // At least in my case, it's also a crucial step in the - // process of running a stored procedure. - // If anyone else has problems running multiple stored - // procedures on the same connection, - // I hope this helps them out. - // - // Without this was not possible to call other functions - // that use store procedures, - // because I've got: - // a) wrong results - // b) mssql_init() errors - // - if( is_resource($stmt) ) { - if (function_exists('mssql_free_statement')) { - mssql_free_statement($stmt[1]); - } - else { - sqlsrv_free_stmt($stmt[1]); - } - } - break; - - } - - $users = array(); - - // MySQL NOTE: - // if the user cannot select from the mysql.user table, then return an empty list - // - if (!$result) - { - return $users; - } - if( $db_type == 'mssql' ) - { - while (!$result->EOF) - { - $row = $result->GetRowAssoc(); - - // seems that on newer SQL Server Version - // Camel Case is used, or may be ADODB behaviour has changed - // Anyway this check avoid issues - // - if( isset($row['LOGINNAME']) ) { - $uk = 'LOGINNAME'; - } - if( isset($row['LoginName']) ) { - $uk = 'LoginName'; - } - - $users[] = trim($row[$uk]); - $result->MoveNext(); - } - } - else - { - while ($row = $db->fetch_array($result)) - { - $users[] = trim($row['user']); - } - } - return($users); -} - - - -/* -Function: create_user_for_db - - Check for user existence. - - If doesn't exist - Creates a user/passwd with the following GRANTS: SELECT, UPDATE, DELETE, INSERT - for the database - Else - do nothing - - -20051217 - fm -refactoring - cosmetics changes - -20050910 - fm -webserver and dbserver on same machines => user will be created as user -webserver and dbserver on DIFFERENT machines => user must be created as user@webserver - -if @ in login -> get the hostname using splitting, and use it - during user creation on db. - - -*/ -function create_user_for_db($db_type,$db_name,$db_server, $db_admin_name, $db_admin_pass, - $login, $passwd) { -$db = new database($db_type); - -$user_host = explode('@',$login); -$the_host = 'localhost'; - -if ( count($user_host) > 1 ) { - $login = $user_host[0]; - $the_host = trim($user_host[1]); -} - -$try_create_user=0; -switch($db_type) { - - case 'mssql': - @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass,$db_name); - $msg="For MSSQL, no attempt is made to check for user existence"; - $try_create_user=1; - break; - - case 'postgres': - @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass,$db_name); - $try_create_user=1; - break; - - case 'mysql': - case 'mysqli': - @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, 'mysql'); - $try_create_user=1; - break; - - default: - $try_create_user=0; - break; - -} - -if( $try_create_user==1) -{ - $user_list = getUserList($db,$db_type); - $login_lc = strtolower($login); - $msg = "ko - fatal error - can't get db server user list !!!"; -} - -if ($try_create_user==1 && !is_null($user_list) && count($user_list) > 0) -{ - - $user_list = array_map('strtolower', $user_list); - $user_exists=in_array($login_lc, $user_list); - if (!$user_exists) - { - $msg = ''; - switch($db_type) - { - - case 'mssql': - $op = _mssql_make_user_with_grants($db,$the_host,$db_name,$login,$passwd); - _mssql_set_passwd($db,$login,$passwd); - break; - - case 'postgres': - $op = _postgres_make_user_with_grants($db,$the_host,$db_name,$login,$passwd); - break; - - case 'mysql': - case 'mysqli': - default: - // Starting with MySQL 8 the following sentence is WRONG !! - // for MySQL making the user and assign right is the same operation - // But I've modified _mysql_make_user in order to create user - // and assign rights - $op = _mysql_make_user($db,$the_host,$db_name,$login,$passwd); - break; - - } - } - else - { - // just assign rights on the database - $msg = 'ok - user_exists'; - switch($db_type) { - case 'mysql': - case 'mysqli': - $op = _mysql_assign_grants($db,$the_host,$db_name,$login,$passwd); - break; - - case 'postgres': - $op = _postgres_assign_grants($db,$the_host,$db_name,$login,$passwd); - break; - - case 'mssql': - $op = _mssql_assign_grants($db,$the_host,$db_name,$login,$passwd); - break; - } - - } - if( !$op->status_ok ) - { - $msg .= " but ..."; - } - $msg .= " " . $op->msg; - - -} - -if( !is_null($db) ) -{ - $db->close(); -} - -return($msg); -} - - -/* - function: close_html_and_exit() - - args : - - returns: - -*/ -function close_html_and_exit() -{ -echo " + Eventum - Issue Tracking System + */ +function getTableList($db) +{ + $my_ado = $db->get_dbmgr_object(); + return $my_ado->MetaTables('TABLES', false, 'db_version'); +} + +/* + * function: getUserList + * + * args: + * + * returns: map or null + * + * rev : + * + */ +function getUserList(&$db, $db_type) +{ + $users = null; + switch ($db_type) { + case 'mysql': + $result = $db->exec_query('SELECT DISTINCT user AS user FROM user'); + break; + + case 'postgres': + $result = $db->exec_query( + 'SELECT DISTINCT usename AS user FROM pg_user'); + break; + + case 'mssql': + case 'mssqlnative': + // info about running store procedures, get form adodb manuals + // Important: + // From ADODB manual - Prepare() documentation + // + // Returns an array containing the original sql statement in the first array element; + // the remaining elements of the array are driver dependent. + // + // Looking into adodb-mssql.inc.php, you will note that array[1] + // is a mssql stm object. + // This info is very important, to use mssql_free_statement() + // + $stmt = $db->db->PrepareSP('SP_HELPLOGINS'); # note that the parameter name does not have @ in front! + $result = $db->db->Execute($stmt); + + // Very important: + // Info from PHP Manual notes + // mssql_free_statement() + // + // mitch at 1800radiator dot kom (23-Mar-2005 06:02) + // Maybe it's unique to my FreeTDS configuration, but if + // I don't call mssql_free_statement() + // after every stored procedure (i.e. mssql_init, mssql_bind, + // mssql_execute, mssql_fetch_array), + // all subsequent stored procedures on the same database + // connection will fail. + // I only mention it because this man-page deprecates + // the use of mssql_free_statement(), + // saying it's only there for run-time memory concerns. + // At least in my case, it's also a crucial step in the + // process of running a stored procedure. + // If anyone else has problems running multiple stored + // procedures on the same connection, + // I hope this helps them out. + // + // Without this was not possible to call other functions + // that use store procedures, + // because I've got: + // a) wrong results + // b) mssql_init() errors + // + if (is_resource($stmt)) { + if (function_exists('mssql_free_statement')) { + mssql_free_statement($stmt[1]); + } else { + sqlsrv_free_stmt($stmt[1]); + } + } + break; + } + + $users = array(); + + // MySQL NOTE: + // if the user cannot select from the mysql.user table, then return an empty list + // + if (! $result) { + return $users; + } + if ($db_type == 'mssql') { + while (! $result->EOF) { + $row = $result->GetRowAssoc(); + + // seems that on newer SQL Server Version + // Camel Case is used, or may be ADODB behaviour has changed + // Anyway this check avoid issues + // + if (isset($row['LOGINNAME'])) { + $uk = 'LOGINNAME'; + } + if (isset($row['LoginName'])) { + $uk = 'LoginName'; + } + + $users[] = trim($row[$uk]); + $result->MoveNext(); + } + } else { + while ($row = $db->fetch_array($result)) { + $users[] = trim($row['user']); + } + } + return $users; +} + +/* + * Function: create_user_for_db + * + * Check for user existence. + * + * If doesn't exist + * Creates a user/passwd with the following GRANTS: SELECT, UPDATE, DELETE, INSERT + * for the database + * Else + * do nothing + * + * + * 20051217 - fm + * refactoring - cosmetics changes + * + * 20050910 - fm + * webserver and dbserver on same machines => user will be created as user + * webserver and dbserver on DIFFERENT machines => user must be created as user@webserver + * + * if @ in login -> get the hostname using splitting, and use it + * during user creation on db. + * + * + */ +function create_user_for_db($db_type, $db_name, $db_server, $db_admin_name, + $db_admin_pass, $login, $passwd) +{ + $db = new database($db_type); + + $user_host = explode('@', $login); + $the_host = 'localhost'; + + if (count($user_host) > 1) { + $login = $user_host[0]; + $the_host = trim($user_host[1]); + } + + $try_create_user = 0; + switch ($db_type) { + + case 'mssql': + @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass, $db_name); + $msg = "For MSSQL, no attempt is made to check for user existence"; + $try_create_user = 1; + break; + + case 'postgres': + @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass, $db_name); + $try_create_user = 1; + break; + + case 'mysql': + case 'mysqli': + @$conn_res = $db->connect(NO_DSN, $db_server, $db_admin_name, + $db_admin_pass, 'mysql'); + $try_create_user = 1; + break; + + default: + $try_create_user = 0; + break; + } + + if ($try_create_user == 1) { + $user_list = getUserList($db, $db_type); + $login_lc = strtolower($login); + $msg = "ko - fatal error - can't get db server user list !!!"; + } + + if ($try_create_user == 1 && ! empty($user_list)) { + + $user_list = array_map('strtolower', $user_list); + $user_exists = in_array($login_lc, $user_list); + if (! $user_exists) { + $msg = ''; + switch ($db_type) { + + case 'mssql': + $op = _mssql_make_user_with_grants($db, $the_host, $db_name, + $login, $passwd); + _mssql_set_passwd($db, $login, $passwd); + break; + + case 'postgres': + $op = _postgres_make_user_with_grants($db, $the_host, + $db_name, $login, $passwd); + break; + + case 'mysql': + case 'mysqli': + default: + // Starting with MySQL 8 the following sentence is WRONG !! + // for MySQL making the user and assign right is the same operation + // But I've modified _mysql_make_user in order to create user + // and assign rights + $op = _mysql_make_user($db, $the_host, $db_name, $login, + $passwd); + break; + } + } else { + // just assign rights on the database + $msg = 'ok - user_exists'; + switch ($db_type) { + case 'mysql': + case 'mysqli': + $op = _mysql_assign_grants($db, $the_host, $db_name, $login, + $passwd); + break; + + case 'postgres': + $op = _postgres_assign_grants($db, $the_host, $db_name, + $login, $passwd); + break; + + case 'mssql': + $op = _mssql_assign_grants($db, $the_host, $db_name, $login, + $passwd); + break; + } + } + if (! $op->status_ok) { + $msg .= " but ..."; + } + $msg .= " " . $op->msg; + } + + if (! is_null($db)) { + $db->close(); + } + + return $msg; +} + +/* + * function: close_html_and_exit() + * + * args : + * + * returns: + * + */ +function close_html_and_exit() +{ + echo "
  
 
-"; - -exit; -} - - -// check to see if required PEAR modules are installed -function check_pear_modules() -{ - $errors = 0; - $final_msg = '
Checking if PEAR modules are installed:'; - - // SpreadSheet_Excel_Writer is needed for TestPlanResultsObj that does excel reporting - if(false == include_once('Spreadsheet/Excel/Writer.php')) - { - $final_msg .= 'Failed! - Spreadsheet_Excel_Writer PEAR Module is required.
See' . - '' . - 'http://pear.php.net/package/Spreadsheet_Excel_Writer for additional information'; - $errors += 1; - } - else - { - $final_msg .= "OK!"; - } - - $ret = array('errors' => $errors, 'msg' => $final_msg); - - return $ret; -} - - -/* - function: check_db_loaded_extension - args : - returns: - - rev : - -*/ -function check_db_loaded_extension($db_type) { - $dbType2PhpExtension = array('postgres' => 'pgsql'); - - $isPHPGTE7 = version_compare(phpversion(), "7.0.0", ">="); - - $ext2search = $db_type; - if( $ext2search == 'mysql' && $isPHPGTE7) { - $ext2search = 'mysqli'; - } - - // PHP_OS constant - // keep in mind this constant will contain - // the operating system PHP was built on - // - if(PHP_OS == 'WINNT' || $isPHPGTE7 ) { - - // First Time: - // - // Faced this problem when testing XAMPP 1.7.7 on - // Windows 7 with MSSQL 2008 Express - // - // From PHP MANUAL - reganding mssql_* functions - // These functions allow you to access MS SQL Server database. - // This extension is not available anymore on Windows with - // PHP 5.3 or later. - // - // SQLSRV, an alternative driver for MS SQL is available from Microsoft: - // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. - // - // - // Second Time: (2018) - // When using PHP 7 or up - // Help from Bitnami - // PHP 7 does not support mssql anymore. - // The PECL extension recommended is to use the "sqlsrv" module - // but you will need to compile it on your own. - // - // - // PHP_VERSION_ID is available as of PHP 5.2.7 - if ( defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300){ - $dbType2PhpExtension['mssql'] = 'sqlsrv'; - } - - if ( $isPHPGTE7 ){ - $dbType2PhpExtension['mssql'] = 'sqlsrv'; - } - } - - if( isset($dbType2PhpExtension[$db_type]) ) { - $ext2search=$dbType2PhpExtension[$db_type]; - } - - $msg_ko = "Failed!"; - $msg_ok = 'OK!'; - $tt = array_flip(get_loaded_extensions()); - - $errors=0; - $final_msg = "

Checking PHP DB extensions "; - - if( !isset($tt[$ext2search]) ) { - $final_msg .= "Warning!: Your PHP installation don't have the {$db_type} extension {$ext2search} " . - "without it is IMPOSSIBLE to use Testlink."; - $final_msg .= $msg_ko; - $errors += 1; - } else { - $final_msg .= $msg_ok; - } - - $ret = array ('errors' => $errors, 'msg' => $final_msg); - - return $ret; -} - - - - - -/** - * - * - */ -function _mysql_make_user($dbhandler,$db_host,$db_name,$login,$passwd) { - - $op = new stdclass(); - - $op->status_ok = true; - $op->msg = 'ok - new user'; - - // Escaping following rules form: - // - // MySQL Manual - // 9.2. Database, Table, Index, Column, and Alias Names - // - $safeDBHost = $dbhandler->prepare_string($db_host); - $safeDBName = $dbhandler->prepare_string($db_name); - $safeLogin = $dbhandler->prepare_string($login); - - $stmt = " CREATE USER '$safeLogin' "; - if (strlen(trim($db_host)) != 0) { - $stmt .= "@" . "'$safeDBHost'"; - } - - // to guess if we are using MariaDB or MySQL - // does not seems to be a reliable way to do this - // - $sql = "SHOW VARIABLES LIKE 'version%'"; - $vg = array(); - $rh = $dbhandler->exec_query($sql); - if ($rh) { - while($row = $dbhandler->fetch_array($rh)) { - $vg[$row['Variable_name']] = $row['Value']; - } - } - - $isMariaDB = false; - $isMySQL = false; - foreach ($vg as $vn => $vv) { - if (strripos($vv,'MariaDB') !== FALSE) { - $isMariaDB = true; - break; - } - if (strripos($vv,'MySQL') !== FALSE) { - $isMySQL = true; - break; - } - } - - // To have compatibility with MySQL 5.x - // IDENTIFIED WITH mysql_native_password - if ($isMySQL) { - $stmt .= - " IDENTIFIED WITH mysql_native_password BY '$passwd' "; - } - - if ($isMariaDB) { - $stmt .= - " IDENTIFIED BY '$passwd' "; - } - - echo 'Running..' . $stmt; - if (!@$dbhandler->exec_query($stmt)) { - $op->msg = "ko - " . $dbhandler->error_msg(); - $op->status_ok=false; - } else { - // Assign Grants!! - $op = _mysql_assign_grants($dbhandler,$db_host,$db_name,$login,$passwd); - } - - return $op; -} - - -/** - * - */ -function _mysql_assign_grants($dbhandler,$db_host,$db_name,$login,$passwd) { - - $op = new stdClass(); - $op->status_ok = true; - $op->msg = 'ok - new user'; - - // Escaping following rules form: - // - // MySQL Manual - // 9.2. Database, Table, Index, Column, and Alias Names - // - $safeDBHost = $dbhandler->prepare_string($db_host); - $safeDBName = $dbhandler->prepare_string($db_name); - $safeLogin = $dbhandler->prepare_string($login); - - $stmt = "GRANT SELECT, UPDATE, DELETE, INSERT ON - `$safeDBName`.* TO '$safeLogin'@'$safeDBHost' - WITH GRANT OPTION "; - - if ( !@$dbhandler->exec_query($stmt) ) { - $op->msg = "ko - " . $dbhandler->error_msg(); - $op->status_ok=false; - } - - // found that you get access denied in this situation: - // 1. you have create the user with grant for host. - // 2. you are running your app on host. - // 3. you don't have GRANT for localhost. - // - // Then I've decide to grant always access from localhost - // to avoid this kind of problem. - // I hope this is not a security hole. - // - // - if( strcasecmp('localhost',$db_host) != 0 ) { - $stmt = "GRANT SELECT, UPDATE, DELETE, INSERT ON - `$safeDBName`.* TO '$safeLogin'@'localhost' - WITH GRANT OPTION "; - - if ( !@$dbhandler->exec_query($stmt) ) { - $op->msg = "ko - " . $dbhandler->error_msg(); - $op->status_ok=false; - } - } - - if( $op->status_ok) { - $op->msg = 'ok - grant assignment'; - } - - return ($op); -} - - -/* - function: _postgres_make_user_with_grants - - args : - - returns: - -*/ -function _postgres_make_user_with_grants(&$db,$db_host,$db_name,$login,$passwd) -{ -$op->status_ok=true; -$op->msg=''; - -$int_op = _postgres_make_user($db,$db_host,$db_name,$login,$passwd); - -if( $int_op->status_ok) -{ - $op->msg = $int_op->msg; - $int_op = _postgres_assign_grants($db,$db_host,$db_name,$login,$passwd); - - $op->msg .= " " . $int_op->msg; - $op->status_ok=$int_op->status_ok; -} - -return($op); -} // function end - - -/* - function: _postgres_make_user - - args : - - returns: - -*/ -function _postgres_make_user(&$db,$db_host,$db_name,$login,$passwd) -{ -$op->status_ok=true; -$op->msg = 'ok - new user'; - -$sql = 'CREATE USER "' . $db->prepare_string($login) . '"' . " ENCRYPTED PASSWORD '{$passwd}'"; -if (!@$db->exec_query($sql)) -{ - $op->status_ok=false; - $op->msg = "ko - " . $db->error_msg(); -} -return ($op); -} - - - -/* - function: _postgres_assign_grants - - args : - - returns: - -*/ -function _postgres_assign_grants(&$db,$db_host,$db_name,$login,$passwd) -{ - $op = new stdclass(); - $op->status_ok=true; - $op->msg = 'ok - grant assignment'; - - /* - if( $op->status_ok ) - { - $sql=" REVOKE ALL ON SCHEMA public FROM public "; - if (!@$dbhandler->exec_query($sql)) - { - $op->status_ok=false; - $op->msg = "ko - " . $dbhandler->error_msg(); - } - } - */ - - if( $op->status_ok ) - { - $sql = 'ALTER DATABASE "' . $db->prepare_string($db_name) . '" OWNER TO ' . - '"' . $db->prepare_string($login) . '"'; - if (!@$db->exec_query($sql)) - { - $op->status_ok=false; - $op->msg = "ko - " . $db->error_msg(); - } - } - - if( $op->status_ok ) - { - $sql = 'ALTER SCHEMA public OWNER TO ' . '"' . $db->prepare_string($login) . '"'; - if (!@$db->exec_query($sql)) - { - $op->status_ok=false; - $op->msg = "ko - " . $db->error_msg(); - } - } - - return ($op); -} - - -/* - function: _mssql_make_user_with_grants - - args : - - returns: - -*/ -function _mssql_make_user_with_grants($db,$the_host,$db_name,$login,$passwd) -{ - _mssql_make_user($db,$the_host,$db_name,$login,$passwd); - - $op->status_ok=true; - $op->msg = 'ok - new user'; - - // Check if has been created, because I'm not able to get return code. - $user_list=getUserList($db,'mssql'); - $user_list=array_map('strtolower', $user_list); - $user_exists=in_array(trim($login), $user_list); - if( !$user_exists ) - { - $op->status_ok=false; - $op->msg = "ko - " . $db->error_msg(); - } - else - { - _mssql_assign_grants($db,$the_host,$db_name,$login,$passwd); -} - return $op; - -} // function end - - -function _mssql_make_user($db,$the_host,$db_name,$login,$passwd) -{ - -// Transact-SQL Reference -// -// sp_addlogin -// New Information - SQL Server 2000 SP3. -// -// Creates a new Microsoft® SQL Server™ login that allows a user -// to connect to an instance of SQL Server using SQL Server Authentication. -// -// Security Note When possible, use Windows Authentication. -// -// Syntax -// sp_addlogin [ @loginame = ] 'login' -// [ , [ @passwd = ] 'password' ] -// [ , [ @defdb = ] 'database' ] -// [ , [ @deflanguage = ] 'language' ] -// [ , [ @sid = ] sid ] -// [ , [ @encryptopt = ] 'encryption_option' ] -// -// Arguments -// [@loginame =] 'login' -// Is the name of the login. login is sysname, with no default. -// -// [@passwd =] 'password' -// Is the login password. password is sysname, with a default of NULL. -// After sp_addlogin has been executed, the password is encrypted and stored in the system tables. -// -// [@defdb =] 'database' -// Is the default database of the login (the database the login is connected to after logging in). -// database is sysname, with a default of master. -// -// [@deflanguage =] 'language' -// Is the default language assigned when a user logs on to SQL Server. -// language is sysname, with a default of NULL. -// If language is not specified, language is set to the server's current default language -// (defined by the sp_configure configuration variable default language). -// Changing the server's default language does not change the default language for existing logins. -// language remains the same as the default language used when the login was added. -// -// [@sid =] sid -// Is the security identification number (SID). sid is varbinary(16), with a default of NULL. -// If sid is NULL, the system generates a SID for the new login. -// Despite the use of a varbinary data type, values other than NULL must be -// exactly 16 bytes in length, and must not already exist. -// SID is useful, for example, when you are scripting or moving SQL Server logins -// from one server to another and you want the logins to have the same SID between servers. -// -// [@encryptopt =] 'encryption_option' -// Specifies whether the password is encrypted when stored in the system tables. -// encryption_option is varchar(20), and can be one of these values. -// -// Value Description -// NULL The password is encrypted. This is the default. -// skip_encryption The password is already encrypted. -// SQL Server should store the value without re-encrypting it. -// skip_encryption_old The supplied password was encrypted by a previous version of SQL Server. -// SQL Server should store the value without re-encrypting it. -// This option is provided for upgrade purposes only. -// -// -// Return Code Values -// 0 (success) or 1 (failure) -// -// Permissions -// Only members of the sysadmin and securityadmin fixed server roles can execute sp_addlogin. -// -// Examples -// A. Create a login ID with master default database -// This example creates an SQL Server login for the user Victoria, without specifying a default database. -// -// EXEC sp_addlogin 'Victoria', 'B1r12-36' -// -// B. Create a login ID and default database -// This example creates a SQL Server login for the user Albert, with a password of "B1r12-36" -// and a default database of corporate. -// -// EXEC sp_addlogin 'Albert', 'B1r12-36', 'corporate' -// -// C. Create a login ID with a different default language -// This example creates an SQL Server login for the user Claire Picard, with a password of "B1r12-36", -// a default database of public_db, and a default language of French. -// -// EXEC sp_addlogin 'Claire Picard', 'B1r12-36', 'public_db', 'french' -// -// D. Create a login ID with a specific SID -// This example creates an SQL Server login for the user Michael, with a password of "B1r12-36," -// a default database of pubs, a default language of us_english, -// and an SID of 0x0123456789ABCDEF0123456789ABCDEF. -// -// EXEC sp_addlogin 'Michael', 'B1r12-36', 'pubs', 'us_english', 0x0123456789ABCDEF0123456789ABCDEF -// -// E. Create a login ID and do not encrypt the password -// This example creates an SQL Server login for the user Margaret with a password of "B1r12-36" on Server1, -// extracts the encrypted password, and then adds the login for the user Margaret to Server2 using -// the previously encrypted password but does not further encrypt the password. -// User Margaret can then log on to Server2 using the password Rose. - - - $op->status_ok=true; - $op->msg = 'ok - new user'; - - //sp_addlogin [ @loginame = ] 'login' - // [ , [ @passwd = ] 'password' ] - // [ , [ @defdb = ] 'database' ] - // [ , [ @deflanguage = ] 'language' ] - // [ , [ @sid = ] sid ] - // [ , [ @encryptopt = ] 'encryption_option' ] - // - // Important: - // From ADODB manual - Prepare() documentation - // - // Returns an array containing the original sql statement in the first array element; - // the remaining elements of the array are driver dependent. - // - // 20071104 - franciscom - // Looking into adodb-mssql.inc.php, you will note that array[1] - // is a mssql stm object. - // This info is very important, to use mssql_free_statement() - // - - $sid=null; - $encryptopt=null; - - $stmt = $db->db->PrepareSP('SP_ADDLOGIN'); - $db->db->InParameter($stmt,$login,'loginame'); - // $db->db->InParameter($stmt,$passwd,'passwd'); - $db->db->InParameter($stmt,$db_name,'defdb'); - // $db->db->InParameter($stmt,$sid,'sid'); - // $db->db->InParameter($stmt,$encryptopt,'encryptopt'); - - $db->db->OutParameter($stmt,$retval,'RETVAL'); - $result=$db->db->Execute($stmt); - - // Very important: - // Info from PHP Manual notes - // mssql_free_statement() - // - // mitch at 1800radiator dot kom (23-Mar-2005 06:02) - // Maybe it's unique to my FreeTDS configuration, but if I don't call mssql_free_statement() - // after every stored procedure (i.e. mssql_init, mssql_bind, mssql_execute, mssql_fetch_array), - // all subsequent stored procedures on the same database connection will fail. - // I only mention it because this man-page deprecates the use of mssql_free_statement(), - // saying it's only there for run-time memory concerns. - // At least in my case, it's also a crucial step in the process of running a stored procedure. - // If anyone else has problems running multiple stored procedures on the same connection, - // I hope this helps them out. - // - // franciscom - 20071104 - // Without this was not possible to call other functions that use store procedures, - // because I've got: - // a) wrong results - // b) mssql_init() errors - // - mssql_free_statement($stmt[1]); - - // I've problems trying to set password, - // then I will use as workaround setting a NULL password - // and after do a password change. - $passwd_null=NULL; - $stmt = $db->db->PrepareSP('SP_PASSWORD'); - $db->db->InParameter($stmt,$login,'loginame'); - $db->db->InParameter($stmt,$passwd_null,'old'); - $db->db->InParameter($stmt,$passwd,'new'); - $result=$db->db->Execute($stmt); - mssql_free_statement($stmt[1]); - - -} // function end - - -/* - function: _mssql_assign_grants - - args : - - returns: - -*/ -function _mssql_assign_grants($db,$the_host,$db_name,$login,$passwd) -{ - - // $stmt = $db->db->PrepareSP('SP_GRANTDBACCESS'); - // $db->db->InParameter($stmt,$login,'loginame'); - // $result=$db->db->Execute($stmt); - // mssql_free_statement($stmt[1]); - // - $db_role='db_owner'; - $stmt = $db->db->PrepareSP('SP_ADDUSER'); - $db->db->InParameter($stmt,$login,'loginame'); - $db->db->InParameter($stmt,$login,'name_in_db'); - $db->db->InParameter($stmt,$db_role,'grpname'); - $result=$db->db->Execute($stmt); - mssql_free_statement($stmt[1]); - - - $op = new stdClass(); - $op->status_ok=true; - $op->msg = 'ok - grant assignment'; - - return $op; -} // function end - -/* - function: - - args : - - returns: - -*/ -function _mssql_set_passwd($db,$login,$passwd) -{ - // $passwd_null=NULL; - //$stmt = $db->db->PrepareSP('SP_PASSWORD'); - //$db->db->InParameter($stmt,$login,'loginame'); - //$db->db->InParameter($stmt,$passwd,'old'); - //$db->db->InParameter($stmt,$passwd,'new'); - //$result=$db->db->Execute($stmt); - // - //// echo "
debug 20071104 - \ - " . __FUNCTION__ . " --- "; print_r($result); echo "
"; - //mssql_free_statement($stmt[1]); - - //$sql="EXEC SP_PASSWORD '{$passwd}','{$passwd}',{$login}"; - $sql="EXEC SP_PASSWORD NULL,'{$passwd}',{$login}"; - $db->exec_query($sql); - - -} - -/** - * - */ -function important_reminder() -{ - echo '

YOUR ATTENTION PLEASE:
To have a fully functional installation +"; + + exit(); +} + +// check to see if required PEAR modules are installed +function check_pear_modules() +{ + $errors = 0; + $final_msg = '

Checking if PEAR modules are installed:'; + + // SpreadSheet_Excel_Writer is needed for TestPlanResultsObj that does excel reporting + if (! include_once 'Spreadsheet/Excel/Writer.php') { + $final_msg .= 'Failed! - Spreadsheet_Excel_Writer PEAR Module is required.
See' . + '' . + 'http://pear.php.net/package/Spreadsheet_Excel_Writer for additional information'; + $errors += 1; + } else { + $final_msg .= "OK!"; + } + + return array( + 'errors' => $errors, + 'msg' => $final_msg + ); +} + +/* + * function: check_db_loaded_extension + * args : + * returns: + * + * rev : + * + */ +function check_db_loaded_extension($db_type) +{ + $dbType2PhpExtension = array( + 'postgres' => 'pgsql' + ); + + $isPHPGTE7 = version_compare(phpversion(), "7.0.0", ">="); + + $ext2search = $db_type; + if ($ext2search == 'mysql' && $isPHPGTE7) { + $ext2search = 'mysqli'; + } + + // PHP_OS constant + // keep in mind this constant will contain + // the operating system PHP was built on + // + if (PHP_OS == 'WINNT' || $isPHPGTE7) { + + // First Time: + // + // Faced this problem when testing XAMPP 1.7.7 on + // Windows 7 with MSSQL 2008 Express + // + // From PHP MANUAL - reganding mssql_* functions + // These functions allow you to access MS SQL Server database. + // This extension is not available anymore on Windows with + // PHP 5.3 or later. + // + // SQLSRV, an alternative driver for MS SQL is available from Microsoft: + // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. + // + // + // Second Time: (2018) + // When using PHP 7 or up + // Help from Bitnami + // PHP 7 does not support mssql anymore. + // The PECL extension recommended is to use the "sqlsrv" module + // but you will need to compile it on your own. + // + // + // PHP_VERSION_ID is available as of PHP 5.2.7 + if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300) { + $dbType2PhpExtension['mssql'] = 'sqlsrv'; + } + + if ($isPHPGTE7) { + $dbType2PhpExtension['mssql'] = 'sqlsrv'; + } + } + + if (isset($dbType2PhpExtension[$db_type])) { + $ext2search = $dbType2PhpExtension[$db_type]; + } + + $msg_ko = "Failed!"; + $msg_ok = 'OK!'; + $tt = array_flip(get_loaded_extensions()); + + $errors = 0; + $final_msg = "

Checking PHP DB extensions "; + + if (! isset($tt[$ext2search])) { + $final_msg .= "Warning!: Your PHP installation don't have the {$db_type} extension {$ext2search} " . + "without it is IMPOSSIBLE to use Testlink."; + $final_msg .= $msg_ko; + $errors += 1; + } else { + $final_msg .= $msg_ok; + } + + return array( + 'errors' => $errors, + 'msg' => $final_msg + ); +} + +/** + */ +function _mysql_make_user($dbhandler, $db_host, $db_name, $login, $passwd) +{ + $op = new stdclass(); + + $op->status_ok = true; + $op->msg = 'ok - new user'; + + // Escaping following rules form: + // + // MySQL Manual + // 9.2. Database, Table, Index, Column, and Alias Names + // + $safeDBHost = $dbhandler->prepare_string($db_host); + $safeLogin = $dbhandler->prepare_string($login); + + $stmt = " CREATE USER '$safeLogin' "; + if (strlen(trim($db_host)) != 0) { + $stmt .= "@" . "'$safeDBHost'"; + } + + // to guess if we are using MariaDB or MySQL + // does not seems to be a reliable way to do this + // + $sql = "SHOW VARIABLES LIKE 'version%'"; + $vg = array(); + $rh = $dbhandler->exec_query($sql); + if ($rh) { + while ($row = $dbhandler->fetch_array($rh)) { + $vg[$row['Variable_name']] = $row['Value']; + } + } + + $isMariaDB = false; + $isMySQL = false; + foreach ($vg as $vv) { + if (strripos($vv, 'MariaDB') !== false) { + $isMariaDB = true; + break; + } + if (strripos($vv, 'MySQL') !== false) { + $isMySQL = true; + break; + } + } + + // To have compatibility with MySQL 5.x + // IDENTIFIED WITH mysql_native_password + if ($isMySQL) { + $stmt .= " IDENTIFIED WITH mysql_native_password BY '$passwd' "; + } + + if ($isMariaDB) { + $stmt .= " IDENTIFIED BY '$passwd' "; + } + + echo 'Running..' . $stmt; + if (! @$dbhandler->exec_query($stmt)) { + $op->msg = "ko - " . $dbhandler->error_msg(); + $op->status_ok = false; + } else { + // Assign Grants!! + $op = _mysql_assign_grants($dbhandler, $db_host, $db_name, $login, + $passwd); + } + + return $op; +} + +/** + */ +function _mysql_assign_grants($dbhandler, $db_host, $db_name, $login, $passwd) +{ + $op = new stdClass(); + $op->status_ok = true; + $op->msg = 'ok - new user'; + + // Escaping following rules form: + // + // MySQL Manual + // 9.2. Database, Table, Index, Column, and Alias Names + // + $safeDBHost = $dbhandler->prepare_string($db_host); + $safeDBName = $dbhandler->prepare_string($db_name); + $safeLogin = $dbhandler->prepare_string($login); + + $stmt = "GRANT SELECT, UPDATE, DELETE, INSERT ON + `$safeDBName`.* TO '$safeLogin'@'$safeDBHost' + WITH GRANT OPTION "; + + if (! @$dbhandler->exec_query($stmt)) { + $op->msg = "ko - " . $dbhandler->error_msg(); + $op->status_ok = false; + } + + // found that you get access denied in this situation: + // 1. you have create the user with grant for host. + // 2. you are running your app on host. + // 3. you don't have GRANT for localhost. + // + // Then I've decide to grant always access from localhost + // to avoid this kind of problem. + // I hope this is not a security hole. + // + // + if (strcasecmp('localhost', $db_host) != 0) { + $stmt = "GRANT SELECT, UPDATE, DELETE, INSERT ON + `$safeDBName`.* TO '$safeLogin'@'localhost' + WITH GRANT OPTION "; + + if (! @$dbhandler->exec_query($stmt)) { + $op->msg = "ko - " . $dbhandler->error_msg(); + $op->status_ok = false; + } + } + + if ($op->status_ok) { + $op->msg = 'ok - grant assignment'; + } + + return $op; +} + +/* + * function: _postgres_make_user_with_grants + * + * args : + * + * returns: + * + */ +function _postgres_make_user_with_grants(&$db, $db_host, $db_name, $login, + $passwd) +{ + $op->status_ok = true; + $op->msg = ''; + + $int_op = _postgres_make_user($db, $db_host, $db_name, $login, $passwd); + + if ($int_op->status_ok) { + $op->msg = $int_op->msg; + $int_op = _postgres_assign_grants($db, $db_host, $db_name, $login, + $passwd); + + $op->msg .= " " . $int_op->msg; + $op->status_ok = $int_op->status_ok; + } + + return $op; +} + +// function end + +/* + * function: _postgres_make_user + * + * args : + * + * returns: + * + */ +function _postgres_make_user(&$db, $db_host, $db_name, $login, $passwd) +{ + $op->status_ok = true; + $op->msg = 'ok - new user'; + + $sql = 'CREATE USER "' . $db->prepare_string($login) . '"' . + " ENCRYPTED PASSWORD '{$passwd}'"; + if (! @$db->exec_query($sql)) { + $op->status_ok = false; + $op->msg = "ko - " . $db->error_msg(); + } + return $op; +} + +/* + * function: _postgres_assign_grants + * + * args : + * + * returns: + * + */ +function _postgres_assign_grants(&$db, $db_host, $db_name, $login, $passwd) +{ + $op = new stdclass(); + $op->status_ok = true; + $op->msg = 'ok - grant assignment'; + + if ($op->status_ok) { + $sql = 'ALTER DATABASE "' . $db->prepare_string($db_name) . '" OWNER TO ' . + '"' . $db->prepare_string($login) . '"'; + if (! @$db->exec_query($sql)) { + $op->status_ok = false; + $op->msg = "ko - " . $db->error_msg(); + } + } + + if ($op->status_ok) { + $sql = 'ALTER SCHEMA public OWNER TO ' . '"' . + $db->prepare_string($login) . '"'; + if (! @$db->exec_query($sql)) { + $op->status_ok = false; + $op->msg = "ko - " . $db->error_msg(); + } + } + + return $op; +} + +/* + * function: _mssql_make_user_with_grants + * + * args : + * + * returns: + * + */ +function _mssql_make_user_with_grants($db, $the_host, $db_name, $login, $passwd) +{ + _mssql_make_user($db, $the_host, $db_name, $login, $passwd); + + $op->status_ok = true; + $op->msg = 'ok - new user'; + + // Check if has been created, because I'm not able to get return code. + $user_list = getUserList($db, 'mssql'); + $user_list = array_map('strtolower', $user_list); + $user_exists = in_array(trim($login), $user_list); + if (! $user_exists) { + $op->status_ok = false; + $op->msg = "ko - " . $db->error_msg(); + } else { + _mssql_assign_grants($db, $the_host, $db_name, $login, $passwd); + } + return $op; +} + +function _mssql_make_user($db, $the_host, $db_name, $login, $passwd) +{ + + // Transact-SQL Reference + // + // sp_addlogin + // New Information - SQL Server 2000 SP3. + // + // Creates a new Microsoft® SQL Server™ login that allows a user + // to connect to an instance of SQL Server using SQL Server Authentication. + // + // Security Note When possible, use Windows Authentication. + // + // Syntax + // sp_addlogin [ @loginame = ] 'login' + // [ , [ @passwd = ] 'password' ] + // [ , [ @defdb = ] 'database' ] + // [ , [ @deflanguage = ] 'language' ] + // [ , [ @sid = ] sid ] + // [ , [ @encryptopt = ] 'encryption_option' ] + // + // Arguments + // [@loginame =] 'login' + // Is the name of the login. login is sysname, with no default. + // + // [@passwd =] 'password' + // Is the login password. password is sysname, with a default of NULL. + // After sp_addlogin has been executed, the password is encrypted and stored in the system tables. + // + // [@defdb =] 'database' + // Is the default database of the login (the database the login is connected to after logging in). + // database is sysname, with a default of master. + // + // [@deflanguage =] 'language' + // Is the default language assigned when a user logs on to SQL Server. + // language is sysname, with a default of NULL. + // If language is not specified, language is set to the server's current default language + // (defined by the sp_configure configuration variable default language). + // Changing the server's default language does not change the default language for existing logins. + // language remains the same as the default language used when the login was added. + // + // [@sid =] sid + // Is the security identification number (SID). sid is varbinary(16), with a default of NULL. + // If sid is NULL, the system generates a SID for the new login. + // Despite the use of a varbinary data type, values other than NULL must be + // exactly 16 bytes in length, and must not already exist. + // SID is useful, for example, when you are scripting or moving SQL Server logins + // from one server to another and you want the logins to have the same SID between servers. + // + // [@encryptopt =] 'encryption_option' + // Specifies whether the password is encrypted when stored in the system tables. + // encryption_option is varchar(20), and can be one of these values. + // + // Value Description + // NULL The password is encrypted. This is the default. + // skip_encryption The password is already encrypted. + // SQL Server should store the value without re-encrypting it. + // skip_encryption_old The supplied password was encrypted by a previous version of SQL Server. + // SQL Server should store the value without re-encrypting it. + // This option is provided for upgrade purposes only. + // + // + // Return Code Values + // 0 (success) or 1 (failure) + // + // Permissions + // Only members of the sysadmin and securityadmin fixed server roles can execute sp_addlogin. + // + // Examples + // A. Create a login ID with master default database + // This example creates an SQL Server login for the user Victoria, without specifying a default database. + // + // EXEC sp_addlogin 'Victoria', 'B1r12-36' + // + // B. Create a login ID and default database + // This example creates a SQL Server login for the user Albert, with a password of "B1r12-36" + // and a default database of corporate. + // + // EXEC sp_addlogin 'Albert', 'B1r12-36', 'corporate' + // + // C. Create a login ID with a different default language + // This example creates an SQL Server login for the user Claire Picard, with a password of "B1r12-36", + // a default database of public_db, and a default language of French. + // + // EXEC sp_addlogin 'Claire Picard', 'B1r12-36', 'public_db', 'french' + // + // D. Create a login ID with a specific SID + // This example creates an SQL Server login for the user Michael, with a password of "B1r12-36," + // a default database of pubs, a default language of us_english, + // and an SID of 0x0123456789ABCDEF0123456789ABCDEF. + // + // EXEC sp_addlogin 'Michael', 'B1r12-36', 'pubs', 'us_english', 0x0123456789ABCDEF0123456789ABCDEF + // + // E. Create a login ID and do not encrypt the password + // This example creates an SQL Server login for the user Margaret with a password of "B1r12-36" on Server1, + // extracts the encrypted password, and then adds the login for the user Margaret to Server2 using + // the previously encrypted password but does not further encrypt the password. + // User Margaret can then log on to Server2 using the password Rose. + $op->status_ok = true; + $op->msg = 'ok - new user'; + + // sp_addlogin [ @loginame = ] 'login' + // [ , [ @passwd = ] 'password' ] + // [ , [ @defdb = ] 'database' ] + // [ , [ @deflanguage = ] 'language' ] + // [ , [ @sid = ] sid ] + // [ , [ @encryptopt = ] 'encryption_option' ] + // + // Important: + // From ADODB manual - Prepare() documentation + // + // Returns an array containing the original sql statement in the first array element; + // the remaining elements of the array are driver dependent. + // + // 20071104 - franciscom + // Looking into adodb-mssql.inc.php, you will note that array[1] + // is a mssql stm object. + // This info is very important, to use mssql_free_statement() + // + + $stmt = $db->db->PrepareSP('SP_ADDLOGIN'); + $db->db->InParameter($stmt, $login, 'loginame'); + $db->db->InParameter($stmt, $db_name, 'defdb'); + + $db->db->OutParameter($stmt, $retval, 'RETVAL'); + $db->db->Execute($stmt); + + // Very important: + // Info from PHP Manual notes + // mssql_free_statement() + // + // mitch at 1800radiator dot kom (23-Mar-2005 06:02) + // Maybe it's unique to my FreeTDS configuration, but if I don't call mssql_free_statement() + // after every stored procedure (i.e. mssql_init, mssql_bind, mssql_execute, mssql_fetch_array), + // all subsequent stored procedures on the same database connection will fail. + // I only mention it because this man-page deprecates the use of mssql_free_statement(), + // saying it's only there for run-time memory concerns. + // At least in my case, it's also a crucial step in the process of running a stored procedure. + // If anyone else has problems running multiple stored procedures on the same connection, + // I hope this helps them out. + // + // franciscom - 20071104 + // Without this was not possible to call other functions that use store procedures, + // because I've got: + // a) wrong results + // b) mssql_init() errors + // + mssql_free_statement($stmt[1]); + + // I've problems trying to set password, + // then I will use as workaround setting a NULL password + // and after do a password change. + $passwd_null = null; + $stmt = $db->db->PrepareSP('SP_PASSWORD'); + $db->db->InParameter($stmt, $login, 'loginame'); + $db->db->InParameter($stmt, $passwd_null, 'old'); + $db->db->InParameter($stmt, $passwd, 'new'); + $db->db->Execute($stmt); + mssql_free_statement($stmt[1]); +} + +/* + * function: _mssql_assign_grants + * + * args : + * + * returns: + * + */ +function _mssql_assign_grants($db, $the_host, $db_name, $login, $passwd) +{ + $db_role = 'db_owner'; + $stmt = $db->db->PrepareSP('SP_ADDUSER'); + $db->db->InParameter($stmt, $login, 'loginame'); + $db->db->InParameter($stmt, $login, 'name_in_db'); + $db->db->InParameter($stmt, $db_role, 'grpname'); + $db->db->Execute($stmt); + mssql_free_statement($stmt[1]); + + $op = new stdClass(); + $op->status_ok = true; + $op->msg = 'ok - grant assignment'; + + return $op; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function _mssql_set_passwd($db, $login, $passwd) +{ + $sql = "EXEC SP_PASSWORD NULL,'{$passwd}',{$login}"; + $db->exec_query($sql); +} + +/** + */ +function important_reminder() +{ + echo '

YOUR ATTENTION PLEASE:
To have a fully functional installation You need to configure mail server settings, following this steps
  • copy from config.inc.php, [SMTP] Section into custom_config.inc.php.
  • -
  • complete correct data regarding email addresses and mail server.

'; +

  • complete correct data regarding email addresses and mail server.
  • '; } diff --git a/install/sqlParser.class.php b/install/sqlParser.class.php index e6fc6b61e4..a23211b24a 100644 --- a/install/sqlParser.class.php +++ b/install/sqlParser.class.php @@ -1,152 +1,145 @@ -db_conn = $db_conn; - $this->db_type = $db_type; - $this->db_table_prefix = trim($db_table_prefix); - } - - - /* - function: - - args : - - returns: - */ - function process($filename) - { - $new_value=null; - - // ----------------------------------------------------------------- - // part of this logic has been copied from the setup of EVENTUM - $contents = file($filename); - $do_replace = trim($this->db_table_prefix) != ''; - - // From PHP Manual Notes on using a class function as Filter - // This FAILS!!! - // $cfil = array_filter($contents,"only_good_sql"); - // - $do_additional_replace=false; - switch($this->db_type) - { - case 'mysql': - $cfil = array_filter($contents,array($this,"only_good_mysql")); - break; - - case 'postgres': - $target['sequence'] = "SELECT setval('"; - $do_additional_replace=true; - $cfil = array_filter($contents,array($this,"only_good_sql")); - break; - - case 'mssql': - $cfil = array_filter($contents,array($this,"only_good_sql")); - break; - } - - $r2d2 = implode("", $cfil); - // echo "

    debug 20090715 - \ - " . __FUNCTION__ . " --- "; print_r($r2d2); echo "
    "; - - if( $do_replace) - { - $r2d2 = str_replace('/*prefix*/',$this->db_table_prefix,$r2d2); - - // just to solve problem with sequence on PostGres when creating - // start up data (need to find a better way) - if($do_additional_replace) - { - foreach($target as $key => $value) - { - if( !is_null($value) ) - { - $new_value[$key] = $value . $this->db_table_prefix ; - $r2d2 = str_replace($value,$new_value[$key],$r2d2); - } - } - } - } - - $num = 0; - $sql_array = explode(";", $r2d2); - foreach($sql_array as $sql_do) - { - // Needed becuase explode() adds \r\n - $sql_dodo = trim(trim($sql_do, "\r\n ")); - - if( strlen($sql_dodo) > 0 ) - { - $num = $num + 1; - $status_ok=$this->db_conn->exec_query($sql_dodo); - if(!$status_ok) - { - $this->sql_errors[] = array("error" => $this->db_conn->error_msg(), "sql" => $sql_dodo); - $this->install_failed = true; - } - } - } // foreach +db_conn = $db_conn; + $this->db_type = $db_type; + $this->db_table_prefix = trim($db_table_prefix); + } + + /* + * function: + * + * args : + * + * returns: + */ + public function process($filename) + { + $new_value = null; + + // part of this logic has been copied from the setup of EVENTUM + $contents = file($filename); + $do_replace = trim($this->db_table_prefix) != ''; + + // From PHP Manual Notes on using a class function as Filter + // This FAILS!!! + // $cfil = array_filter($contents,"only_good_sql"); + // + $do_additional_replace = false; + switch ($this->db_type) { + case 'mysql': + $cfil = array_filter($contents, + array( + $this, + "only_good_mysql" + )); + break; + + case 'postgres': + $target['sequence'] = "SELECT setval('"; + $do_additional_replace = true; + $cfil = array_filter($contents, array( + $this, + "only_good_sql" + )); + break; + + case 'mssql': + $cfil = array_filter($contents, array( + $this, + "only_good_sql" + )); + break; + } + + $r2d2 = implode("", $cfil); + + if ($do_replace) { + $r2d2 = str_replace('/*prefix*/', $this->db_table_prefix, $r2d2); + + // just to solve problem with sequence on PostGres when creating + // start up data (need to find a better way) + if ($do_additional_replace) { + foreach ($target as $key => $value) { + if (! is_null($value)) { + $new_value[$key] = $value . $this->db_table_prefix; + $r2d2 = str_replace($value, $new_value[$key], $r2d2); + } + } + } + } + + $num = 0; + $sql_array = explode(";", $r2d2); + foreach ($sql_array as $sql_do) { + // Needed becuase explode() adds \r\n + $sql_dodo = trim(trim($sql_do, "\r\n ")); + + if (strlen($sql_dodo) > 0) { + $num += 1; + $status_ok = $this->db_conn->exec_query($sql_dodo); + if (! $status_ok) { + $this->sql_errors[] = array( + "error" => $this->db_conn->error_msg(), + "sql" => $sql_dodo + ); + $this->install_failed = true; + } + } + } + } + + protected function only_good_mysql($v) + { + $comment_char = '#'; + return $this->only_good_sql($v, $comment_char); + } + + protected function only_good_sql($v, $comment_char = '-') + { + $use_v = true; + $findme = $comment_char; + + // Must trim New Line for the strlen check + $v_c = trim($v, "\r\n "); + $pos = strpos($v_c, $findme); + + if ($pos === false) { + $use_v = true; + } else { + if ($pos == 0) { + $use_v = false; + } + } + + // Empty line must not be used + if ($use_v && strlen($v_c) == 0) { + $use_v = false; + } + + return $use_v; + } } - - -function only_good_mysql($v) -{ - $comment_char='#'; - return($this->only_good_sql($v, $comment_char)); -} - - -function only_good_sql($v, $comment_char='-') -{ - - $use_v = true; - $findme=$comment_char; - - // Must trim New Line for the strlen check - $v_c = trim($v, "\r\n "); - $pos = strpos($v_c, $findme); - - - if ($pos === false) - { - $use_v = true; - } - else - { - if ($pos == 0 ) - { - $use_v = false; - } - } - - // Empty line must not be used - if( $use_v == true ) - { - if ( strlen($v_c) == 0) - { - $use_v = false; - } - } - - return ($use_v); -} // Function ends - - -} // class end \ No newline at end of file diff --git a/install/util/sysinfo.php b/install/util/sysinfo.php index 5a2b282567..c449089632 100644 --- a/install/util/sysinfo.php +++ b/install/util/sysinfo.php @@ -1,70 +1,62 @@ -".$msg."
    "; - -return $msg; -} +" . $msg . ""; + + return $msg; +} ?> @@ -84,32 +76,28 @@ function reload() {

    TestLink - System & services checking

    Installation status: - +

    -Error counter = '.$errors.'

    '; +Error counter = ' . $errors . '

    '; ?>
    @@ -120,4 +108,4 @@ function reload() {
    - \ No newline at end of file + diff --git a/lib/ajax/checkDuplicateName.php b/lib/ajax/checkDuplicateName.php index 98145fab78..757ef9e90b 100644 --- a/lib/ajax/checkDuplicateName.php +++ b/lib/ajax/checkDuplicateName.php @@ -16,8 +16,8 @@ * **/ -require_once('../../config.inc.php'); -require_once('common.php'); +require_once '../../config.inc.php'; +require_once 'common.php'; testlinkInitPage($db); $data = array('success' => true, 'message' => ''); diff --git a/lib/ajax/checkNodeDuplicateName.php b/lib/ajax/checkNodeDuplicateName.php index 940aee5d09..765c75cece 100644 --- a/lib/ajax/checkNodeDuplicateName.php +++ b/lib/ajax/checkNodeDuplicateName.php @@ -1,45 +1,62 @@ - true, 'message' => ''); - -$iParams = array("node_name" => array(tlInputParameter::STRING_N,0,100), - "node_id" => array(tlInputParameter::INT), - "parent_id" => array(tlInputParameter::INT), - "node_type" => array(tlInputParameter::STRING_N,0,20)); -$args = G_PARAMS($iParams); - -$tree_manager = new tree($db); -$node_types_descr_id=$tree_manager->get_available_node_types(); - -// To allow name check when creating a NEW NODE => we do not have node id -$args['node_id'] = ($args['node_id'] > 0 )? $args['node_id'] : null; -$args['parent_id'] = ($args['parent_id'] > 0 )? $args['parent_id'] : null; - -$check = $tree_manager->nodeNameExists($args['node_name'], $node_types_descr_id[$args['node_type']], - $args['node_id'],$args['parent_id']); - -$data['success'] = !$check['status']; -$data['message'] = $check['msg']; - -echo json_encode($data); \ No newline at end of file + true, + 'message' => '' +); + +$iParams = array( + "node_name" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "node_id" => array( + tlInputParameter::INT + ), + "parent_id" => array( + tlInputParameter::INT + ), + "node_type" => array( + tlInputParameter::STRING_N, + 0, + 20 + ) +); +$args = G_PARAMS($iParams); + +$tree_manager = new tree($db); +$node_types_descr_id = $tree_manager->get_available_node_types(); + +// To allow name check when creating a NEW NODE => we do not have node id +$args['node_id'] = ($args['node_id'] > 0) ? $args['node_id'] : null; +$args['parent_id'] = ($args['parent_id'] > 0) ? $args['parent_id'] : null; + +$check = $tree_manager->nodeNameExists($args['node_name'], + $node_types_descr_id[$args['node_type']], $args['node_id'], + $args['parent_id']); + +$data['success'] = ! $check['status']; +$data['message'] = $check['msg']; + +echo json_encode($data); diff --git a/lib/ajax/checkTCaseDuplicateName.php b/lib/ajax/checkTCaseDuplicateName.php index 8584397747..d49532dbdf 100644 --- a/lib/ajax/checkTCaseDuplicateName.php +++ b/lib/ajax/checkTCaseDuplicateName.php @@ -1,66 +1,77 @@ - true, 'message' => ''); - -$iParams = array("name" => array(tlInputParameter::STRING_N,0,100), - "testcase_id" => array(tlInputParameter::INT), - "testsuite_id" => array(tlInputParameter::INT), - "testproject_id" => array(tlInputParameter::INT) - ); - -$args = G_PARAMS($iParams); - -// get test project id from session this need to be changed -$rights2check = ['mgt_view_tc','mgt_modify_tc']; -if ($_SESSION['currentUser']->hasRight($db, $rights2check[0],$args['testproject_id']) || - $_SESSION['currentUser']->hasRight($db, $rights2check[1],$args['testproject_id']) - ) { - - $tree_manager = new tree($db); - $node_types_descr_id=$tree_manager->get_available_node_types(); - - // To allow name check when creating a NEW test case => we do not have test case id - $args['testcase_id'] = ($args['testcase_id'] > 0 )? $args['testcase_id'] : null; - $args['testsuite_id'] = ($args['testsuite_id'] > 0 )? $args['testsuite_id'] : null; - - $check = $tree_manager->nodeNameExists($args['name'], $node_types_descr_id['testcase'], - $args['testcase_id'],$args['testsuite_id']); - - $data['success'] = !$check['status']; - $data['message'] = $check['msg']; - - /* - if (trim($data['message']) != '') { - $data['message'] .= " - testproject_id:" . $args['testproject_id'] . - " testsuite_id " . $args['testsuite_id']; - }*/ -} -else { - $tLogMsg = 'User ' . $_SESSION['currentUser']->login . - ' has not right needed () ' . json_encode($rights2check) . - ' to do requested action - checkTCaseDuplicateName.php' . - ' - testproject_id:' . $args['testproject_id']; - tLog($tLogMsg , 'ERROR'); - $data['success'] = false; - $data['message'] = lang_get('user_has_no_right_for_action'); -} - -echo json_encode($data); \ No newline at end of file + true, + 'message' => '' +); + +$iParams = array( + "name" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "testcase_id" => array( + tlInputParameter::INT + ), + "testsuite_id" => array( + tlInputParameter::INT + ), + "testproject_id" => array( + tlInputParameter::INT + ) +); + +$args = G_PARAMS($iParams); + +// get test project id from session this need to be changed +$rights2check = [ + 'mgt_view_tc', + 'mgt_modify_tc' +]; +if ($_SESSION['currentUser']->hasRight($db, $rights2check[0], + $args['testproject_id']) || + $_SESSION['currentUser']->hasRight($db, $rights2check[1], + $args['testproject_id'])) { + + $tree_manager = new tree($db); + $node_types_descr_id = $tree_manager->get_available_node_types(); + + // To allow name check when creating a NEW test case => we do not have test case id + $args['testcase_id'] = ($args['testcase_id'] > 0) ? $args['testcase_id'] : null; + $args['testsuite_id'] = ($args['testsuite_id'] > 0) ? $args['testsuite_id'] : null; + + $check = $tree_manager->nodeNameExists($args['name'], + $node_types_descr_id['testcase'], $args['testcase_id'], + $args['testsuite_id']); + + $data['success'] = ! $check['status']; + $data['message'] = $check['msg']; +} else { + $tLogMsg = 'User ' . $_SESSION['currentUser']->login . + ' has not right needed () ' . json_encode($rights2check) . + ' to do requested action - checkTCaseDuplicateName.php' . + ' - testproject_id:' . $args['testproject_id']; + tLog($tLogMsg, 'ERROR'); + $data['success'] = false; + $data['message'] = lang_get('user_has_no_right_for_action'); +} + +echo json_encode($data); diff --git a/lib/ajax/dragdroprequirementnodes.php b/lib/ajax/dragdroprequirementnodes.php index 63de9fa080..c250fb02cd 100644 --- a/lib/ajax/dragdroprequirementnodes.php +++ b/lib/ajax/dragdroprequirementnodes.php @@ -1,51 +1,57 @@ -doAction) { - case 'changeParent': - $treeMgr->change_parent($args->nodeid,$args->newparentid); - $sql = " UPDATE " . DB_TABLE_PREFIX . "requirements " . - " SET srs_id=" . intval($args->newparentid) . - " WHERE id=" . intval($args->nodeid); - $db->exec_query($sql); - break; - - case 'doReorder': - $dummy = explode(',',$args->nodelist); - $treeMgr->change_order_bulk($dummy); - break; -} - -/** - * - */ -function init_args() { - $args=new stdClass(); - - $key2loop=array('nodeid','newparentid','nodeorder'); - foreach($key2loop as $key) { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : null; - } - - $key2loop = array('doAction','top_or_bottom','nodelist'); - foreach($key2loop as $key) { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; - } - - return $args; -} \ No newline at end of file +doAction) { + case 'changeParent': + $treeMgr->change_parent($args->nodeid, $args->newparentid); + $sql = " UPDATE " . DB_TABLE_PREFIX . "requirements " . " SET srs_id=" . + intval($args->newparentid) . " WHERE id=" . intval($args->nodeid); + $db->exec_query($sql); + break; + + case 'doReorder': + $dummy = explode(',', $args->nodelist); + $treeMgr->change_order_bulk($dummy); + break; +} + +/** + */ +function initArgs() +{ + $args = new stdClass(); + + $key2loop = array( + 'nodeid', + 'newparentid', + 'nodeorder' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : null; + } + + $key2loop = array( + 'doAction', + 'top_or_bottom', + 'nodelist' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; + } + + return $args; +} diff --git a/lib/ajax/dragdroptprojectnodes.php b/lib/ajax/dragdroptprojectnodes.php index 410be04e3e..7c4fa41995 100644 --- a/lib/ajax/dragdroptprojectnodes.php +++ b/lib/ajax/dragdroptprojectnodes.php @@ -1,57 +1,70 @@ - 1, 'requirement' => 1, 'requirement_spec' => 1); - -$args=init_args(); -$treeMgr = new tree($db); - -switch($args->doAction) -{ - case 'changeParent': - $treeMgr->change_parent($args->nodeid,$args->newparentid); - break; - - case 'doReorder': - $dummy=explode(',',$args->nodelist); - $treeMgr->change_order_bulk($dummy); - break; + 1, + 'requirement' => 1, + 'requirement_spec' => 1 +); + +$args = initArgs(); +$treeMgr = new tree($db); + +switch ($args->doAction) { + case 'changeParent': + $treeMgr->change_parent($args->nodeid, $args->newparentid); + break; + + case 'doReorder': + $dummy = explode(',', $args->nodelist); + $treeMgr->change_order_bulk($dummy); + break; +} + +/** + * Initialize arguments + * + * @return stdClass + */ +function initArgs() +{ + $args = new stdClass(); + + $key2loop = array( + 'nodeid', + 'newparentid', + 'nodeorder' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : null; + } + + $key2loop = array( + 'doAction', + 'top_or_bottom', + 'nodelist' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; + } + + return $args; } - -/** - * - */ -function init_args() { - $args=new stdClass(); - - $key2loop=array('nodeid','newparentid','nodeorder'); - foreach($key2loop as $key) { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : null; - } - - $key2loop = array('doAction','top_or_bottom','nodelist'); - foreach($key2loop as $key) { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; - } - - return $args; -} \ No newline at end of file diff --git a/lib/ajax/dragdroptreenodes.php b/lib/ajax/dragdroptreenodes.php index d695398a9d..882e48e453 100644 --- a/lib/ajax/dragdroptreenodes.php +++ b/lib/ajax/dragdroptreenodes.php @@ -1,42 +1,46 @@ -doAction) -{ - case 'changeParent': - $treeMgr->change_parent($args->nodeid,$args->newparentid); - break; - - case 'doReorder': - $dummy=explode(',',$args->nodelist); - $treeMgr->change_order_bulk($dummy); - break; -} - -function init_args() -{ - $args=new stdClass(); - - $key2loop=array('nodeid','newparentid','doAction','top_or_bottom','nodeorder','nodelist'); - foreach($key2loop as $key) - { - $args->$key=isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; - } - return $args; -} -?> \ No newline at end of file +doAction) { + case 'changeParent': + $treeMgr->change_parent($args->nodeid, $args->newparentid); + break; + + case 'doReorder': + $dummy = explode(',', $args->nodelist); + $treeMgr->change_order_bulk($dummy); + break; +} + +function initArgs() +{ + $args = new stdClass(); + + $key2loop = array( + 'nodeid', + 'newparentid', + 'doAction', + 'top_or_bottom', + 'nodeorder', + 'nodelist' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; + } + return $args; +} +?> diff --git a/lib/ajax/getUsersWithRight.php b/lib/ajax/getUsersWithRight.php index 62605f8e30..13fb6b9f84 100644 --- a/lib/ajax/getUsersWithRight.php +++ b/lib/ajax/getUsersWithRight.php @@ -1,13 +1,13 @@ array(tlInputParameter::STRING_N,0,100,'/^[a-z0-9_]+$/') - ); + "right" => array(tlInputParameter::STRING_N,0,100,'/^[a-z0-9_]+$/') +); $args = G_PARAMS($iParams); // user must have the same right as requested (security) if (has_rights($db,$args['right'])) { - $tlUser = new tlUser($_SESSION['userID']); - $data['rows'] = $tlUser->getNamesForProjectRight($db,$args['right'],$_SESSION['testprojectID']); - $data['rows'][] = array('id'=>'0','login'=>' ','first'=>' ','last'=>' '); // option for no owner + $tlUser = new tlUser($_SESSION['userID']); + $data['rows'] = $tlUser->getNamesForProjectRight($db,$args['right'],$_SESSION['testprojectID']); + $data['rows'][] = array('id'=>'0','login'=>' ','first'=>' ','last'=>' '); // option for no owner } else { - tLog('Invalid right for the user: '.$args['right'], 'ERROR'); + tLog('Invalid right for the user: '.$args['right'], 'ERROR'); } echo json_encode($data); -?> \ No newline at end of file +?> diff --git a/lib/ajax/getcodetrackercfgtemplate.php b/lib/ajax/getcodetrackercfgtemplate.php index 759f64421f..94b63a6a25 100755 --- a/lib/ajax/getcodetrackercfgtemplate.php +++ b/lib/ajax/getcodetrackercfgtemplate.php @@ -1,44 +1,41 @@ - true, 'cfg' => ''); -$type = intval($_REQUEST['type']); -$itemMgr = new tlCodeTracker($db); -$ctt = $itemMgr->getTypes(); -if( isset($ctt[$type]) ) -{ - unset($ctt); - $cname = $itemMgr->getImplementationForType($type); - $info['cfg'] = stream_resolve_include_path($cname . '.class.php'); - - // Notes for developers - // Trying to use try/catch to manage missing interface file, results on nothing good. - // This way worked. - if( stream_resolve_include_path($cname . '.class.php') !== FALSE ) - { - $info['cfg'] = '
    ' . $cname::getCfgTemplate() . '
    '; - } - else - { - $info['cfg'] = sprintf(lang_get('codetracker_interface_not_implemented'),$cname); - } -} -else -{ - $info['cfg'] = sprintf(lang_get('codetracker_invalid_type'),$type); -} -echo json_encode($info); + true, + 'cfg' => '' +); +$type = intval($_REQUEST['type']); +$itemMgr = new tlCodeTracker($db); +$ctt = $itemMgr->getTypes(); +if (isset($ctt[$type])) { + unset($ctt); + $cname = $itemMgr->getImplementationForType($type); + $info['cfg'] = stream_resolve_include_path($cname . '.class.php'); + + // Notes for developers + // Trying to use try/catch to manage missing interface file, results on nothing good. + // This way worked. + if (stream_resolve_include_path($cname . '.class.php') !== false) { + $info['cfg'] = '
    ' . $cname::getCfgTemplate() . '
    '; + } else { + $info['cfg'] = sprintf( + lang_get('codetracker_interface_not_implemented'), $cname); + } +} else { + $info['cfg'] = sprintf(lang_get('codetracker_invalid_type'), $type); +} +echo json_encode($info); ?> diff --git a/lib/ajax/getissuetrackercfgtemplate.php b/lib/ajax/getissuetrackercfgtemplate.php index ab8d13899e..c1d2cef880 100644 --- a/lib/ajax/getissuetrackercfgtemplate.php +++ b/lib/ajax/getissuetrackercfgtemplate.php @@ -1,49 +1,46 @@ - true, 'cfg' => ''); -$type = intval($_REQUEST['type']); -$itemMgr = new tlIssueTracker($db); -$itt = $itemMgr->getTypes(); -if( isset($itt[$type]) ) -{ - unset($itt); - $iname = $itemMgr->getImplementationForType($type); - $info['cfg'] = stream_resolve_include_path($iname . '.class.php'); - - // Notes for developers - // Trying to use try/catch to manage missing interface file, results on nothing good. - // This way worked. - if( stream_resolve_include_path($iname . '.class.php') !== FALSE ) - { - $info['cfg'] = '
    ' . $iname::getCfgTemplate() . '
    '; - } - else - { - $info['cfg'] = sprintf(lang_get('issuetracker_interface_not_implemented'),$iname); - } -} -else -{ - $info['cfg'] = sprintf(lang_get('issuetracker_invalid_type'),$type); -} -echo json_encode($info); -?> \ No newline at end of file + true, + 'cfg' => '' +); +$type = intval($_REQUEST['type']); +$itemMgr = new tlIssueTracker($db); +$itt = $itemMgr->getTypes(); +if (isset($itt[$type])) { + unset($itt); + $iname = $itemMgr->getImplementationForType($type); + $info['cfg'] = stream_resolve_include_path($iname . '.class.php'); + + // Notes for developers + // Trying to use try/catch to manage missing interface file, results on nothing good. + // This way worked. + if (stream_resolve_include_path($iname . '.class.php') !== false) { + $info['cfg'] = '
    ' . $iname::getCfgTemplate() . '
    '; + } else { + $info['cfg'] = sprintf( + lang_get('issuetracker_interface_not_implemented'), $iname); + } +} else { + $info['cfg'] = sprintf(lang_get('issuetracker_invalid_type'), $type); +} +echo json_encode($info); +?> diff --git a/lib/ajax/getreqcoveragenodes.php b/lib/ajax/getreqcoveragenodes.php index 256cd9d3dd..667905811f 100644 --- a/lib/ajax/getreqcoveragenodes.php +++ b/lib/ajax/getreqcoveragenodes.php @@ -1,144 +1,158 @@ -child_requirements_mgmt) - { - $forbidden_parent['requirement_spec'] = 'none'; - } - - switch($operation) - { - - case 'print': - $js_function = array('testproject' => 'TPROJECT_PTP', - 'requirement_spec' =>'TPROJECT_PRS', 'requirement' => 'TPROJECT_PRS'); - break; - - case 'manage': - default: - $js_function = array('testproject' => 'EP','requirement_spec' =>'ERS', 'requirement' => 'ER'); - break; - } - - $nodes = null; - $filter_node_type = $show_children ? '' : ",'requirement'"; - $sql = " SELECT NHA.*, NT.description AS node_type, RSPEC.doc_id " . - " FROM {$tables['nodes_hierarchy']} NHA JOIN {$tables['node_types']} NT " . - " ON NHA.node_type_id=NT.id " . - " AND NT.description NOT IN " . - " ('testcase','testsuite','testcase_version','testplan','requirement_spec_revision' {$filter_node_type}) " . - " LEFT OUTER JOIN {$tables['req_specs']} RSPEC " . - " ON RSPEC.id = NHA.id " . - " WHERE NHA.parent_id = " . intval($parent); - - // file_put_contents('/tmp/getrequirementnodes.php.txt', $sql); - if(!is_null($filter_node) && $filter_node > 0 && $parent == $root_node) - { - $sql .= " AND NHA.id = " . intval($filter_node); - } - $sql .= " ORDER BY NHA.node_order "; - - $nodeSet = $dbHandler->get_recordset($sql); - if(!is_null($nodeSet)) - { - $sql = " SELECT DISTINCT req_doc_id AS doc_id,NHA.id" . - " FROM {$tables['requirements']} REQ JOIN {$tables['nodes_hierarchy']} NHA ON NHA.id = REQ.id " . - " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . - " JOIN {$tables['node_types']} NT ON NT.id = NHA.node_type_id " . - " WHERE NHB.id = " . intval($parent) . " AND NT.description = 'requirement'"; - $requirements = $dbHandler->fetchRowsIntoMap($sql,'id'); - - $treeMgr = new tree($dbHandler); - $ntypes = $treeMgr->get_available_node_types(); - $peerTypes = array('target' => $ntypes['requirement'], 'container' => $ntypes['requirement_spec']); - foreach($nodeSet as $key => $row) - { - $path['text'] = htmlspecialchars($row['name']); - $path['id'] = $row['id']; - - // this attribute/property is used on custom code on drag and drop - $path['position'] = $row['node_order']; - $path['leaf'] = false; - $path['cls'] = 'folder'; - - $path['testlink_node_type'] = $row['node_type']; - $path['testlink_node_name'] = $path['text']; // already htmlspecialchars() done - - $path['forbidden_parent'] = 'none'; - switch($row['node_type']) - { - case 'testproject': - $path['href'] = "javascript:EP({$path['id']})"; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - break; - - case 'requirement_spec': - $req_list = array(); - $treeMgr->getAllItemsID($row['id'],$req_list,$peerTypes); - - $path['href'] = "javascript:" . $js_function[$row['node_type']]. "({$path['id']})"; - $path['text'] = htmlspecialchars($row['doc_id'] . ":") . $path['text']; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - if(!is_null($req_list)) - { - $item_qty = count($req_list); - $path['text'] .= " ({$item_qty})"; - } - break; - - case 'requirement': - $path['href'] = "javascript:" . $js_function[$row['node_type']]. "({$path['id']})"; - $path['text'] = htmlspecialchars($requirements[$row['id']]['doc_id'] . ":") . $path['text']; - $path['leaf'] = true; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - break; - } - - $nodes[] = $path; - } // foreach - } - return $nodes; -} \ No newline at end of file +child_requirements_mgmt) { + $forbidden_parent['requirement_spec'] = 'none'; + } + + switch ($operation) { + + case 'print': + $js_function = array( + 'testproject' => 'TPROJECT_PTP', + 'requirement_spec' => 'TPROJECT_PRS', + 'requirement' => 'TPROJECT_PRS' + ); + break; + + case 'manage': + default: + $js_function = array( + 'testproject' => 'EP', + 'requirement_spec' => 'ERS', + 'requirement' => 'ER' + ); + break; + } + + $nodes = null; + $filter_node_type = $show_children ? '' : ",'requirement'"; + $sql = " SELECT NHA.*, NT.description AS node_type, RSPEC.doc_id " . + " FROM {$tables['nodes_hierarchy']} NHA JOIN {$tables['node_types']} NT " . + " ON NHA.node_type_id=NT.id " . " AND NT.description NOT IN " . + " ('testcase','testsuite','testcase_version','testplan','requirement_spec_revision' {$filter_node_type}) " . + " LEFT OUTER JOIN {$tables['req_specs']} RSPEC " . + " ON RSPEC.id = NHA.id " . " WHERE NHA.parent_id = " . intval($parent); + + if (! is_null($filter_node) && $filter_node > 0 && $parent == $root_node) { + $sql .= " AND NHA.id = " . intval($filter_node); + } + $sql .= " ORDER BY NHA.node_order "; + + $nodeSet = $dbHandler->get_recordset($sql); + if (! is_null($nodeSet)) { + $sql = " SELECT DISTINCT req_doc_id AS doc_id,NHA.id" . + " FROM {$tables['requirements']} REQ JOIN {$tables['nodes_hierarchy']} NHA ON NHA.id = REQ.id " . + " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . + " JOIN {$tables['node_types']} NT ON NT.id = NHA.node_type_id " . + " WHERE NHB.id = " . intval($parent) . + " AND NT.description = 'requirement'"; + $requirements = $dbHandler->fetchRowsIntoMap($sql, 'id'); + + $treeMgr = new tree($dbHandler); + $ntypes = $treeMgr->get_available_node_types(); + $peerTypes = array( + 'target' => $ntypes['requirement'], + 'container' => $ntypes['requirement_spec'] + ); + foreach ($nodeSet as $row) { + $path['text'] = htmlspecialchars($row['name']); + $path['id'] = $row['id']; + + // this attribute/property is used on custom code on drag and drop + $path['position'] = $row['node_order']; + $path['leaf'] = false; + $path['cls'] = 'folder'; + + $path['testlink_node_type'] = $row['node_type']; + $path['testlink_node_name'] = $path['text']; // already htmlspecialchars() done + + $path['forbidden_parent'] = 'none'; + switch ($row['node_type']) { + case 'testproject': + $path['href'] = "javascript:EP({$path['id']})"; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + break; + + case 'requirement_spec': + $req_list = array(); + $treeMgr->getAllItemsID($row['id'], $req_list, $peerTypes); + + $path['href'] = "javascript:" . + $js_function[$row['node_type']] . "({$path['id']})"; + $path['text'] = htmlspecialchars($row['doc_id'] . ":") . + $path['text']; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + if (! is_null($req_list)) { + $item_qty = count($req_list); + $path['text'] .= " ({$item_qty})"; + } + break; + + case 'requirement': + $path['href'] = "javascript:" . + $js_function[$row['node_type']] . "({$path['id']})"; + $path['text'] = htmlspecialchars( + $requirements[$row['id']]['doc_id'] . ":") . + $path['text']; + $path['leaf'] = true; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + break; + } + + $nodes[] = $path; + } + } + return $nodes; +} diff --git a/lib/ajax/getreqlog.php b/lib/ajax/getreqlog.php index f302c3954d..564a71c006 100644 --- a/lib/ajax/getreqlog.php +++ b/lib/ajax/getreqlog.php @@ -1,47 +1,48 @@ -tree_mgr->get_available_node_types(); - $dummy = $reqMgr->tree_mgr->get_node_hierarchy_info($item_id); - - - $target_table = 'req_revisions'; - if($dummy['node_type_id'] == $node_types['requirement_version'] ) - { - $target_table = 'req_versions'; - } - $sql = "SELECT log_message FROM {$tables[$target_table]} WHERE id=" . intval($item_id); - $info = $db->get_recordset($sql); - $info = nl2br($info[0]['log_message']); - - //

    and

    tag at the beginning and the end of summary cause visualization - // errors -> remove them and add
    to get a similar effect - $info = str_replace("

    ","",$info); - $info = str_replace("

    ","
    ",$info); - - // if log message is empty show this information - if ($info == "") { - $info = lang_get("empty_log_message"); - } -} -echo $info; \ No newline at end of file +tree_mgr->get_available_node_types(); + $dummy = $reqMgr->tree_mgr->get_node_hierarchy_info($item_id); + + $target_table = 'req_revisions'; + if ($dummy['node_type_id'] == $node_types['requirement_version']) { + $target_table = 'req_versions'; + } + $sql = "SELECT log_message FROM {$tables[$target_table]} WHERE id=" . + intval($item_id); + $info = $db->get_recordset($sql); + $info = nl2br($info[0]['log_message']); + + //

    and

    tag at the beginning and the end of summary cause visualization + // errors -> remove them and add
    to get a similar effect + $info = str_replace("

    ", "", $info); + $info = str_replace("

    ", "
    ", $info); + + // if log message is empty show this information + if ($info == "") { + $info = lang_get("empty_log_message"); + } +} +echo $info; diff --git a/lib/ajax/getreqmgrsystemcfgtemplate.php b/lib/ajax/getreqmgrsystemcfgtemplate.php index 84818e2fe1..1131f4cc92 100644 --- a/lib/ajax/getreqmgrsystemcfgtemplate.php +++ b/lib/ajax/getreqmgrsystemcfgtemplate.php @@ -1,49 +1,46 @@ - true, 'cfg' => ''); -$type = intval($_REQUEST['type']); -$mgr = new tlReqMgrSystem($db); -$itt = $mgr->getTypes(); -if( isset($itt[$type]) ) -{ - unset($itt); - $iname = $mgr->getImplementationForType($type); - $info['cfg'] = stream_resolve_include_path($iname . '.class.php'); - - // Notes for developers - // Trying to use try/catch to manage missing interface file, results on nothing good. - // This way worked. - if( stream_resolve_include_path($iname . '.class.php') !== FALSE ) - { - $info['cfg'] = '
    ' . $iname::getCfgTemplate() . '
    '; - } - else - { - $info['cfg'] = sprintf(lang_get('reqmgrsystem_interface_not_implemented'),$iname); - } -} -else -{ - $info['cfg'] = sprintf(lang_get('reqmgrsystem_invalid_type'),$type); -} -echo json_encode($info); -?> \ No newline at end of file + true, + 'cfg' => '' +); +$type = intval($_REQUEST['type']); +$mgr = new tlReqMgrSystem($db); +$itt = $mgr->getTypes(); +if (isset($itt[$type])) { + unset($itt); + $iname = $mgr->getImplementationForType($type); + $info['cfg'] = stream_resolve_include_path($iname . '.class.php'); + + // Notes for developers + // Trying to use try/catch to manage missing interface file, results on nothing good. + // This way worked. + if (stream_resolve_include_path($iname . '.class.php') !== false) { + $info['cfg'] = '
    ' . $iname::getCfgTemplate() . '
    '; + } else { + $info['cfg'] = sprintf( + lang_get('reqmgrsystem_interface_not_implemented'), $iname); + } +} else { + $info['cfg'] = sprintf(lang_get('reqmgrsystem_invalid_type'), $type); +} +echo json_encode($info); +?> diff --git a/lib/ajax/getreqspeclog.php b/lib/ajax/getreqspeclog.php index ec26c95507..450aa380ce 100644 --- a/lib/ajax/getreqspeclog.php +++ b/lib/ajax/getreqspeclog.php @@ -1,14 +1,14 @@ child_requirements_mgmt) { $forbidden_parent['requirement_spec'] = 'none'; - } + } $fn = array(); $fn['print']['reqspec'] = array('testproject' => 'TPROJECT_PTP_RS', @@ -73,54 +73,53 @@ function display_children($dbHandler,$root_node,$parent,$filter_node, default: $js_function=$fn['manage'][$mode]; - break; + break; } $nodes = null; $filter_node_type = $show_children ? '' : ",'requirement'"; - $sql = " SELECT NHA.*, NT.description AS node_type, RSPEC.doc_id " . + $sql = " SELECT NHA.*, NT.description AS node_type, RSPEC.doc_id " . " FROM {$tables['nodes_hierarchy']} NHA JOIN {$tables['node_types']} NT " . " ON NHA.node_type_id=NT.id " . - " AND NT.description NOT IN " . + " AND NT.description NOT IN " . " ('testcase','testsuite','testcase_version','testplan','requirement_spec_revision' {$filter_node_type}) " . " LEFT OUTER JOIN {$tables['req_specs']} RSPEC " . - " ON RSPEC.id = NHA.id " . + " ON RSPEC.id = NHA.id " . " WHERE NHA.parent_id = " . intval($parent); if(!is_null($filter_node) && $filter_node > 0 && $parent == $root_node) { - $sql .= " AND NHA.id = " . intval($filter_node); + $sql .= " AND NHA.id = " . intval($filter_node); } - $sql .= " ORDER BY NHA.node_order "; + $sql .= " ORDER BY NHA.node_order "; $nodeSet = $dbHandler->get_recordset($sql); - if(!is_null($nodeSet)) + if(!is_null($nodeSet)) { $sql = " SELECT DISTINCT req_doc_id AS doc_id,NHA.id" . " FROM {$tables['requirements']} REQ JOIN {$tables['nodes_hierarchy']} NHA ON NHA.id = REQ.id " . - " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . + " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . " JOIN {$tables['node_types']} NT ON NT.id = NHA.node_type_id " . " WHERE NHB.id = " . intval($parent) . " AND NT.description = 'requirement'"; $requirements = $dbHandler->fetchRowsIntoMap($sql,'id'); $treeMgr = new tree($dbHandler); $ntypes = $treeMgr->get_available_node_types(); - $peerTypes = array('target' => $ntypes['requirement'], 'container' => $ntypes['requirement_spec']); - foreach($nodeSet as $key => $row) + $peerTypes = array('target' => $ntypes['requirement'], 'container' => $ntypes['requirement_spec']); + foreach($nodeSet as $row) { - $path['text'] = htmlspecialchars($row['name']); - $path['id'] = $row['id']; + $path['text'] = htmlspecialchars($row['name']); + $path['id'] = $row['id']; // this attribute/property is used on custom code on drag and drop - $path['position'] = $row['node_order']; + $path['position'] = $row['node_order']; $path['leaf'] = false; $path['cls'] = 'folder'; // Important: // We can add custom keys, and will be able to access it using - // public property 'attributes' of object of Class Ext.tree.TreeNode - // - $path['testlink_node_type'] = $row['node_type']; + // public property 'attributes' of object of Class Ext.tree.TreeNode + $path['testlink_node_type'] = $row['node_type']; $path['testlink_node_name'] = $path['text']; // already htmlspecialchars() done $path['forbidden_parent'] = 'none'; @@ -141,7 +140,7 @@ function display_children($dbHandler,$root_node,$parent,$filter_node, if(!is_null($req_list)) { $item_qty = count($req_list); - $path['text'] .= " ({$item_qty})"; + $path['text'] .= " ({$item_qty})"; } break; @@ -153,8 +152,8 @@ function display_children($dbHandler,$root_node,$parent,$filter_node, break; } - $nodes[] = $path; - } // foreach + $nodes[] = $path; + } } - return $nodes; -} \ No newline at end of file + return $nodes; +} diff --git a/lib/ajax/gettestcasesummary.php b/lib/ajax/gettestcasesummary.php index 965f3e1528..0fa08a619c 100644 --- a/lib/ajax/gettestcasesummary.php +++ b/lib/ajax/gettestcasesummary.php @@ -1,47 +1,47 @@ - 0 ) { - if($tcversion_id > 0 ) { - $tcase = $tcase_mgr->get_by_id($tcase_id,$tcversion_id); - if(!is_null($tcase)) { - $tcase = $tcase[0]; - } - } else { - $tcase = $tcase_mgr->get_last_version_info($tcase_id); - } - $info = $tcase['summary']; - - //

    and

    tag at the beginning and the end of summary cause visualization - // errors -> remove them and add
    to get a similar effect - $info = str_replace("

    ","",$info); - $info = str_replace("

    ","
    ",$info); - - if ($info == "") { - $info = lang_get("empty_tc_summary"); - } else { - $info = '' . lang_get('summary') . '
    ' . $info; - } -} -echo $info; \ No newline at end of file + 0) { + if ($tcversion_id > 0) { + $tcase = $tcaseMgr->get_by_id($tcase_id, $tcversion_id); + if (! is_null($tcase)) { + $tcase = $tcase[0]; + } + } else { + $tcase = $tcaseMgr->getLastVersionInfo($tcase_id); + } + $info = $tcase['summary']; + + //

    and

    tag at the beginning and the end of summary cause visualization + // errors -> remove them and add
    to get a similar effect + $info = str_replace("

    ", "", $info); + $info = str_replace("

    ", "
    ", $info); + + if ($info == "") { + $info = lang_get("empty_tc_summary"); + } else { + $info = '' . lang_get('summary') . '
    ' . $info; + } +} +echo $info; diff --git a/lib/ajax/gettprojectnodes.php b/lib/ajax/gettprojectnodes.php index 1f150318a7..e02daef274 100644 --- a/lib/ajax/gettprojectnodes.php +++ b/lib/ajax/gettprojectnodes.php @@ -1,204 +1,229 @@ - 'none','testcase' => 'testproject', 'testsuite' => 'none'); - $external = ''; - $nodes = null; - $filter_node_type = $show_tcases ? '' : ",'testcase'"; - - switch($operation) - { - case 'print': - $js_function = array('testproject' => 'TPROJECT_PTP', - 'testsuite' =>'TPROJECT_PTS', 'testcase' => 'TPROJECT_PTS'); - break; - - case 'manage': - default: - $js_function = array('testproject' => 'EP','testsuite' =>'ETS', 'testcase' => 'ET'); - break; - } - - $sql = " SELECT NHA.*, NT.description AS node_type " . - " FROM {$tables['nodes_hierarchy']} NHA, {$tables['node_types']} NT " . - " WHERE NHA.node_type_id = NT.id " . - " AND parent_id = " . intval($parent) . - " AND NT.description NOT IN " . - " ('testcase_version','testplan','requirement_spec','requirement'{$filter_node_type}) "; - - if(!is_null($filter_node) && $filter_node > 0 && $parent == $root_node) - { - $sql .=" AND NHA.id = " . intval($filter_node); - } - $sql .= " ORDER BY NHA.node_order "; - - - $nodeSet = $dbHandler->get_recordset($sql); - - if($show_tcases) { - // Get external id, used on test case nodes - $sql = " SELECT DISTINCT tc_external_id,NHA.parent_id " . - " FROM {$tables['tcversions']} TCV " . - " JOIN {$tables['nodes_hierarchy']} NHA ON NHA.id = TCV.id " . - " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . - " WHERE NHB.parent_id = " . intval($parent) . " AND NHA.node_type_id = 4"; - $external = $dbHandler->fetchRowsIntoMap($sql,'parent_id'); - } - - if(!is_null($nodeSet)) { - foreach($nodeSet as $key => $row) { - $path['text'] = htmlspecialchars($row['name']); - $path['id'] = $row['id']; - - // this attribute/property is used on custom code on drag and drop - $path['position'] = $row['node_order']; - $path['leaf'] = false; - $path['cls'] = 'folder'; - - // customs key will be accessed using node.attributes.[key name] - $path['testlink_node_type'] = $row['node_type']; - $path['testlink_node_name'] = $path['text']; // already htmlspecialchars() done - $path['forbidden_parent'] = 'none'; - - $tcase_qty = null; - switch($row['node_type']) - { - case 'testproject': - // at least on Test Specification seems that we do not execute this piece of code. - $path['href'] = "javascript:EP({$path['id']})"; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - break; - - case 'testsuite': - $items = array(); - getAllTCasesID($row['id'],$items); - $tcase_qty = sizeof($items); - - $path['href'] = "javascript:" . $js_function[$row['node_type']]. "({$path['id']})"; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - break; - - case 'testcase': - $path['href'] = "javascript:" . $js_function[$row['node_type']]. "({$path['id']})"; - $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; - if(is_null($showTestCaseID)) - { - $showTestCaseID = config_get('treemenu_show_testcase_id'); - } - if($showTestCaseID) - { - $path['text'] = htmlspecialchars($tcprefix . $external[$row['id']]['tc_external_id'] . ":") . $path['text']; - } - $path['leaf'] = true; - break; - } - - if(!is_null($tcase_qty)) - { - $path['text'] .= " ({$tcase_qty})"; - } - - switch($row['node_type']) - { - case 'testproject': - case 'testsuite': - if( isset($helpText[$row['node_type']]) ) - { - $path['text'] = '' . $path['text'] . ''; - } - break; - } - - $nodes[] = $path; - } - } - return $nodes; -} - - -/** - * - */ -function getAllTCasesID($idList,&$tcIDs) { - - global $db; // I'm sorry for the global coupling - $tcNodeTypeID = 3; - $tsuiteNodeTypeID = 2; - - $tbl = DB_TABLE_PREFIX . 'nodes_hierarchy'; - $sql = " SELECT id,node_type_id FROM $tbl + 'none', + 'testcase' => 'testproject', + 'testsuite' => 'none' + ); + $external = ''; + $nodes = null; + $filter_node_type = $show_tcases ? '' : ",'testcase'"; + + switch ($operation) { + case 'print': + $js_function = array( + 'testproject' => 'TPROJECT_PTP', + 'testsuite' => 'TPROJECT_PTS', + 'testcase' => 'TPROJECT_PTS' + ); + break; + + case 'manage': + default: + $js_function = array( + 'testproject' => 'EP', + 'testsuite' => 'ETS', + 'testcase' => 'ET' + ); + break; + } + + $sql = " SELECT NHA.*, NT.description AS node_type " . + " FROM {$tables['nodes_hierarchy']} NHA, {$tables['node_types']} NT " . + " WHERE NHA.node_type_id = NT.id " . " AND parent_id = " . + intval($parent) . " AND NT.description NOT IN " . + " ('testcase_version','testplan','requirement_spec','requirement'{$filter_node_type}) "; + + if (! is_null($filter_node) && $filter_node > 0 && $parent == $root_node) { + $sql .= " AND NHA.id = " . intval($filter_node); + } + $sql .= " ORDER BY NHA.node_order "; + + $nodeSet = $dbHandler->get_recordset($sql); + + if ($show_tcases) { + // Get external id, used on test case nodes + $sql = " SELECT DISTINCT tc_external_id,NHA.parent_id " . + " FROM {$tables['tcversions']} TCV " . + " JOIN {$tables['nodes_hierarchy']} NHA ON NHA.id = TCV.id " . + " JOIN {$tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . + " WHERE NHB.parent_id = " . intval($parent) . + " AND NHA.node_type_id = 4"; + $external = $dbHandler->fetchRowsIntoMap($sql, 'parent_id'); + } + + if (! is_null($nodeSet)) { + foreach ($nodeSet as $row) { + $path['text'] = htmlspecialchars($row['name']); + $path['id'] = $row['id']; + + // this attribute/property is used on custom code on drag and drop + $path['position'] = $row['node_order']; + $path['leaf'] = false; + $path['cls'] = 'folder'; + + // customs key will be accessed using node.attributes.[key name] + $path['testlink_node_type'] = $row['node_type']; + $path['testlink_node_name'] = $path['text']; // already htmlspecialchars() done + $path['forbidden_parent'] = 'none'; + + $tcase_qty = null; + switch ($row['node_type']) { + case 'testproject': + // at least on Test Specification seems that we do not execute this piece of code. + $path['href'] = "javascript:EP({$path['id']})"; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + break; + + case 'testsuite': + $items = array(); + getAllTCasesID($row['id'], $items); + $tcase_qty = count($items); + + $path['href'] = "javascript:" . + $js_function[$row['node_type']] . "({$path['id']})"; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + break; + + case 'testcase': + $path['href'] = "javascript:" . + $js_function[$row['node_type']] . "({$path['id']})"; + $path['forbidden_parent'] = $forbidden_parent[$row['node_type']]; + if (is_null($showTestCaseID)) { + $showTestCaseID = config_get( + 'treemenu_show_testcase_id'); + } + if ($showTestCaseID) { + $path['text'] = htmlspecialchars( + $tcprefix . $external[$row['id']]['tc_external_id'] . + ":") . $path['text']; + } + $path['leaf'] = true; + break; + } + + if (! is_null($tcase_qty)) { + $path['text'] .= " ({$tcase_qty})"; + } + + switch ($row['node_type']) { + case 'testproject': + case 'testsuite': + if (isset($helpText[$row['node_type']])) { + $path['text'] = '' . $path['text'] . + ''; + } + break; + } + + $nodes[] = $path; + } + } + return $nodes; +} + +/** + * + * @param string $idList + * @param array $tcIDs + */ +function getAllTCasesID($idList, &$tcIDs) +{ + global $db; // I'm sorry for the global coupling + $tcNodeTypeID = 3; + + $tbl = DB_TABLE_PREFIX . 'nodes_hierarchy'; + $sql = " SELECT id,node_type_id FROM $tbl WHERE parent_id IN ($idList) - AND node_type_id IN (3,2) "; - - $result = $db->exec_query($sql); - if ($result) { - $suiteIDs = array(); - while($row = $db->fetch_array($result)) { - if ($row['node_type_id'] == $tcNodeTypeID) { - $tcIDs[] = $row['id']; - } else { - $suiteIDs[] = $row['id']; - } - } - if (sizeof($suiteIDs)) { - $suiteIDs = implode(",",$suiteIDs); - getAllTCasesID($suiteIDs,$tcIDs); - } - } + AND node_type_id IN (3,2) "; + + $result = $db->exec_query($sql); + if ($result) { + $suiteIDs = array(); + while ($row = $db->fetch_array($result)) { + if ($row['node_type_id'] == $tcNodeTypeID) { + $tcIDs[] = $row['id']; + } else { + $suiteIDs[] = $row['id']; + } + } + if (count($suiteIDs)) { + $suiteIDs = implode(",", $suiteIDs); + getAllTCasesID($suiteIDs, $tcIDs); + } + } } diff --git a/lib/ajax/requirements/getreqmonitors.php b/lib/ajax/requirements/getreqmonitors.php index 41616f911a..b8acc38f3e 100644 --- a/lib/ajax/requirements/getreqmonitors.php +++ b/lib/ajax/requirements/getreqmonitors.php @@ -1,14 +1,14 @@ data = $mon; } -echo json_encode($ou); \ No newline at end of file +echo json_encode($ou); diff --git a/lib/ajax/stepReorder.php b/lib/ajax/stepReorder.php index 0832741484..a86e07a17d 100644 --- a/lib/ajax/stepReorder.php +++ b/lib/ajax/stepReorder.php @@ -1,52 +1,53 @@ -stepSeq != '') { - $xx = explode('&', $args->stepSeq); - $point = 1; - $renumbered = []; - foreach($xx as $step_id) { - $renumbered[$step_id] = $point++; - } - - // Get test case version id from 1 step - $nt = $tcaseMgr->tree_manager->get_available_node_types(); - $tables = tlObjectWithDB::getDBTables(array('tcsteps','nodes_hierarchy')); - $sql = "SELECT NH_STEPS.parent_id - FROM {$tables['nodes_hierarchy']} NH_STEPS - WHERE NH_STEPS.id = {$xx[0]} - AND NH_STEPS.node_type_id = {$nt['testcase_step']}"; - - $tcaseMgr->set_step_number($renumbered); - file_put_contents('/var/testlink/logs/stepReorder.log', json_encode($renumbered)); - - echo json_encode($renumbered); -} - -/** - * - */ -function init_args() -{ - $args = new stdClass(); - $args->stepSeq = isset($_REQUEST["stepSeq"])? $_REQUEST["stepSeq"] : ""; - - return $args; -} \ No newline at end of file +stepSeq != '') { + $xx = explode('&', $args->stepSeq); + $point = 1; + $renumbered = []; + foreach ($xx as $step_id) { + $renumbered[$step_id] = $point ++; + } + + // Get test case version id from 1 step + $nt = $tcaseMgr->tree_manager->get_available_node_types(); + $tables = tlObjectWithDB::getDBTables(array( + 'tcsteps', + 'nodes_hierarchy' + )); + $sql = "SELECT NH_STEPS.parent_id + FROM {$tables['nodes_hierarchy']} NH_STEPS + WHERE NH_STEPS.id = {$xx[0]} + AND NH_STEPS.node_type_id = {$nt['testcase_step']}"; + + $tcaseMgr->set_step_number($renumbered); + file_put_contents('/var/testlink/logs/stepReorder.log', + json_encode($renumbered)); + + echo json_encode($renumbered); +} + +/** + */ +function initArgs() +{ + $args = new stdClass(); + $args->stepSeq = isset($_REQUEST["stepSeq"]) ? $_REQUEST["stepSeq"] : ""; + + return $args; +} diff --git a/lib/api/rest/v1/index.php b/lib/api/rest/v1/index.php index 11c56ff419..5d56a2b073 100644 --- a/lib/api/rest/v1/index.php +++ b/lib/api/rest/v1/index.php @@ -1,20 +1,19 @@ -app->run(); diff --git a/lib/api/rest/v1/tlRestApi.class.php b/lib/api/rest/v1/tlRestApi.class.php index ddb42dfcfe..026beefe5b 100644 --- a/lib/api/rest/v1/tlRestApi.class.php +++ b/lib/api/rest/v1/tlRestApi.class.php @@ -1,721 +1,821 @@ - - * @package TestLink - * @since 1.9.7 - * - * References - * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ - * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment - * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item - * http://www.redmine.org/projects/redmine/wiki/Rest_api - * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ - * https://github.com/educoder/pest/blob/master/examples/intouch_example.php - * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data - * - * http://phptrycatch.blogspot.it/ - * http://nitschinger.at/A-primer-on-PHP-exceptions - * - - * - * - * @internal revisions - * @since 1.9.11 - * - */ - -require_once('../../../../config.inc.php'); -require_once('common.php'); -require 'Slim/Slim.php'; -\Slim\Slim::registerAutoloader(); - -/** - * @author Francisco Mancardi - * @package TestLink - */ -class tlRestApi -{ - public static $version = "1.0"; - - - /** - * The DB object used throughout the class - * - * @access protected - */ - protected $db = null; - protected $tables = null; - - protected $tcaseMgr = null; - protected $tprojectMgr = null; - protected $tsuiteMgr = null; - protected $tplanMgr = null; - protected $tplanMetricsMgr = null; - protected $reqSpecMgr = null; - protected $reqMgr = null; - protected $platformMgr = null; - - /** userID associated with the apiKey provided */ - protected $userID = null; - - /** UserObject associated with the userID */ - protected $user = null; - - /** array where all the args are stored for requests */ - protected $args = null; - - /** array where error codes and messages are stored */ - protected $errors = array(); - - /** The api key being used to make a request */ - protected $apiKey = null; - - /** boolean to allow a method to invoke another method and avoid double auth */ - protected $authenticated = false; - - /** The version of a test case that is being used */ - /** This value is setted in following method: */ - /** _checkTCIDAndTPIDValid() */ - protected $tcVersionID = null; - protected $versionNumber = null; - - - - public $statusCode; - public $codeStatus; - - - /** - */ - public function __construct() - { - // We are following Slim naming convention - $this->app = new \Slim\Slim(); - $this->app->contentType('application/json'); - - - // test route with anonymous function - $this->app->get('/who', function () { echo __CLASS__ . ' : Get Route /who';}); - - $this->app->get('/whoAmI', array($this,'authenticate'), array($this,'whoAmI')); - $this->app->get('/testprojects', array($this,'authenticate'), array($this,'getProjects')); - - $this->app->get('/testprojects/:id', array($this,'authenticate'), array($this,'getProjects')); - $this->app->get('/testprojects/:id/testcases', array($this,'authenticate'), array($this,'getProjectTestCases')); - $this->app->get('/testprojects/:id/testplans', array($this,'authenticate'), array($this,'getProjectTestPlans')); - - $this->app->post('/testprojects', array($this,'authenticate'), array($this,'createTestProject')); - $this->app->post('/executions', array($this,'authenticate'), array($this,'createTestCaseExecution')); - $this->app->post('/testplans', array($this,'authenticate'), array($this,'createTestPlan')); - $this->app->post('/testplans/:id', array($this,'authenticate'), array($this,'updateTestPlan')); - - $this->app->post('/testsuites', array($this,'authenticate'), array($this,'createTestSuite')); - $this->app->post('/testcases', array($this,'authenticate'), array($this,'createTestCase')); - - // $this->app->get('/testplans/:id', array($this,'getTestPlan')); - - - $this->db = new database(DB_TYPE); - $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); - doDBConnect($this->db,database::ONERROREXIT); - - - $this->tcaseMgr=new testcase($this->db); - $this->tprojectMgr=new testproject($this->db); - $this->tsuiteMgr=new testsuite($this->db); - - $this->tplanMgr=new testplan($this->db); - $this->tplanMetricsMgr=new tlTestPlanMetrics($this->db); - $this->reqSpecMgr=new requirement_spec_mgr($this->db); - $this->reqMgr=new requirement_mgr($this->db); - $this->cfieldMgr=$this->tprojectMgr->cfield_mgr; - - $this->tables = $this->tcaseMgr->getDBTables(); - - $resultsCfg = config_get('results'); - foreach($resultsCfg['status_label_for_exec_ui'] as $key => $label ) - { - $this->statusCode[$key]=$resultsCfg['status_code'][$key]; - } - - if( isset($this->statusCode['not_run']) ) - { - unset($this->statusCode['not_run']); - } - $this->codeStatus=array_flip($this->statusCode); - } - - - /** - * - */ - function authenticate(\Slim\Route $route) - { - $apiKey = null; - if(is_null($apiKey)) - { - $request = $this->app->request(); - $apiKey = $request->headers('PHP_AUTH_USER'); - } - - $sql = "SELECT id FROM {$this->tables['users']} " . - "WHERE script_key='" . $this->db->prepare_string($apiKey) . "'"; - - $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); - if( ($ok=!is_null($this->userID)) ) - { - $this->user = tlUser::getByID($this->db,$this->userID); - } - else - { - $this->app->status(400); - echo json_encode(array('status' => 'ko', 'message' => 'authentication error')); - $this->app->stop(); - } - - return $ok; - } - - - - /** - * - */ - public function whoAmI() - { - echo json_encode(array('name' => __CLASS__ . ' : Get Route /whoAmI')); - } - - /** - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME - */ - public function getProjects($idCard=null, $opt=null) - { - $options = array_merge(array('output' => 'rest'), (array)$opt); - $op = array('status' => 'ok', 'message' => 'ok', 'item' => null); - if(is_null($idCard)) - { - $opOptions = array('output' => 'array_of_map', 'order_by' => " ORDER BY name ", 'add_issuetracker' => true, - 'add_reqmgrsystem' => true); - $op['item'] = $this->tprojectMgr->get_accessible_for_user($this->userID,$opOptions); - } - else - { - $opOptions = array('output' => 'map','field_set' => 'id', 'format' => 'simple'); - $zx = $this->tprojectMgr->get_accessible_for_user($this->userID,$opOptions); - if( ($safeID = intval($idCard)) > 0) - { - if( isset($zx[$safeID]) ) - { - $op['item'] = $this->tprojectMgr->get_by_id($safeID); - } - } - else - { - // Will consider id = name - foreach( $zx as $key => $value ) - { - if( strcmp($value['name'],$idCard) == 0 ) - { - $safeString = $this->db->prepare_string($idCard); - $op['item'] = $this->tprojectMgr->get_by_name($safeString); - break; - } - } - } - } - - // Developer (silly?) information - // json_encode() transforms maps in objects. - switch($options['output']) - { - case 'internal': - return $op['item']; - break; - - case 'rest': - default: - echo json_encode($op); - break; - } - } - - /** - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME - */ - public function getProjectTestPlans($idCard) - { - $op = array('status' => 'ok', 'message' => 'ok', 'items' => null); - $tproject = $this->getProjects($idCard, array('output' => 'internal')); - - if( !is_null($tproject) ) - { - $items = $this->tprojectMgr->get_all_testplans($tproject[0]['id']); - $op['items'] = (!is_null($items) && count($items) > 0) ? $items : null; - } - else - { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - } - - echo json_encode($op); - } - - /** - * Will return LATEST VERSION of each test case. - * Does return test step info ? - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME - */ - public function getProjectTestCases($idCard) - { - $op = array('status' => 'ok', 'message' => 'ok', 'items' => null); - $tproject = $this->getProjects($idCard, array('output' => 'internal')); - - if( !is_null($tproject) ) - { - $tcaseIDSet = array(); - $this->tprojectMgr->get_all_testcases_id($tproject[0]['id'],$tcaseIDSet); - if( !is_null($tcaseIDSet) && count($tcaseIDSet) > 0 ) - { - $op['items'] = array(); - foreach( $tcaseIDSet as $key => $tcaseID ) - { - $item = $this->tcaseMgr->get_last_version_info($tcaseID); - $item['keywords'] = $this->tcaseMgr->get_keywords_map($tcaseID); - $item['customfields'] = $this->tcaseMgr->get_linked_cfields_at_design($tcaseID,$item['tcversion_id'], - null,null,$tproject[0]['id']); - $op['items'][] = $item; - } - } - } - else - { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - } - - echo json_encode($op); - } - -// ============================================== - /** - * - * $item->name - * $item->prefix - * $item->notes - * $item->active - * $item->public - * $item->options - * $item->options->requirementsEnabled - * $item->options->testPriorityEnabled - * $item->options->automationEnabled - * $item->options->inventoryEnabled - */ - public function createTestProject() - { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try - { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op['id'] = $this->tprojectMgr->create($item,array('doChecks' => true)); - $op = array('status' => 'ok', 'message' => 'ok'); - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - - - /** - * - * Request Body - * - * $ex->testPlanID - * $ex->buildID - * $ex->platformID - * $ex->testCaseExternalID - * $ex->notes - * $ex->statusCode - * - * - * Checks to be done - * - * A. User right & Test plan existence - * user has right to execute on target Test plan? - * this means also that: Test plan ID exists ? - * - * B. Build - * does Build ID exist on target Test plan ? - * is Build enable to execution ? - * - * C. Platform - * do we need a platform ID in order to execute ? - * is a platform present on provided data ? - * does this platform belong to target Test plan ? - * - * D. Test case identity - * is target Test case part of Test plan ? - * - * - * Z. Other mandatory information - * We are not going to check for other mandatory info - * like: mandatory custom fields. (if we will be able in future to manage it) - * - * - */ - public function createTestCaseExecution() - { - $op = array('status' => ' ko', 'message' => 'ko', 'id' => -1); - try - { - $request = $this->app->request(); - $ex = json_decode($request->getBody()); - $util = $this->checkExecutionEnvironment($ex); - - // If we are here this means we can write execution status!!! - $ex->testerID = $this->userID; - foreach($util as $prop => $value) - { - $ex->$prop = $value; - } - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tplanMgr->writeExecution($ex); - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - - - // - // Support methods - // - private function checkExecutionEnvironment($ex) - { - // throw new Exception($message, $code, $previous); - - // Test plan ID exists and is ACTIVE - $msg = 'invalid Test plan ID'; - $getOpt = array('output' => 'testPlanFields','active' => 1, - 'testPlanFields' => 'id,testproject_id,is_public'); - $status_ok = !is_null($testPlan=$this->tplanMgr->get_by_id($ex->testPlanID,$getOpt)); - - if($status_ok) - { - // user has right to execute on Test plan ID - // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) - $msg = 'user has no right to execute'; - $status_ok = $this->user->hasRight($this->db,'testplan_execute', - $testPlan['testproject_id'],$ex->testPlanID,true); - } - - if($status_ok) - { - // Check if couple (buildID,testPlanID) is valid - $msg = '(buildID,testPlanID) couple is not valid'; - $getOpt = array('fields' => 'id,active,is_open', 'buildID' => $ex->buildID, 'orderBy' => null); - $status_ok = !is_null($build = $this->tplanMgr->get_builds($ex->testPlanID,null,null,$getOpt)); - - if($status_ok) - { - // now check is execution can be done againts this build - $msg = 'Build is not active and/or closed => execution can not be done'; - $status_ok = $build[$ex->buildID]['active'] && $build[$ex->buildID]['is_open']; - } - } - - if($status_ok) - { - // Get Test plan platforms - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => false); - $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID,$getOpt); - - if( !($hasPlatforms = !is_null($platformSet)) && $ex->platformID !=0) - { - $status_ok = false; - $msg = 'You can not execute against a platform, because Test plan has no platforms'; - } - - if($status_ok) - { - if($hasPlatforms) - { - if($ex->platformID == 0) - { - $status_ok = false; - $msg = 'Test plan has platforms, you need to provide one in order to execute'; - } - else if (!isset($platformSet[$ex->platformID])) - { - $status_ok = false; - $msg = '(platform,test plan) couple is not valid'; - } - } - } - } - - if($status_ok) - { - // Test case check - $msg = 'Test case does not exist'; - - $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); - $status_ok = ($tcaseID > 0); - if( $status_ok = ($tcaseID > 0) ) - { - $msg = 'Test case doesn not belong to right test project'; - $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase($tcaseID,0); - $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); - } - if($status_ok) - { - // Does this test case is linked to test plan ? - $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; - $getFilters = array('testplan_id' => $ex->testPlanID, 'platform_id' => $ex->platformID); - $getOpt = array('output' => 'simple'); - $links = $this->tcaseMgr->get_linked_versions($tcaseID,$getFilters,$getOpt); - $status_ok = !is_null($links); - } - } - if($status_ok) - { - // status code is OK ? - $msg = 'not run status is not a valid execution status (can not be written to DB)'; - $status_ok = ($ex->statusCode != 'n'); // Sorry for the MAGIC; - - if($status_ok) - { - $msg = 'Requested execution status is not configured on TestLink'; - $status_ok = isset($this->codeStatus[$ex->statusCode]); - } - } - - if($status_ok) - { - $ret = new stdClass(); - $ret->testProjectID = $testPlan['testproject_id']; - $ret->testCaseVersionID = key($links); - $ret->testCaseVersionNumber = $links[$ret->testCaseVersionID][$ex->testPlanID][$ex->platformID]['version']; - } - - if(!$status_ok) - { - throw new Exception($msg); - } - return $ret; - } - - - - /** - * 'name' - * 'testProjectID' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function createTestPlan() - { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try - { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tplanMgr->createFromObject($item,array('doChecks' => true)); - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - /** - * 'name' - * 'testProjectID' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function updateTestPlan($id) - { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try - { - $op = array('status' => 'ok', 'message' => 'ok'); - - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $item->id = $id; - $op['id'] = $this->tplanMgr->updateFromObject($item); - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - - /** - * 'name' - * 'testProjectID' - * 'parentID' - * 'notes' - * 'order' - */ - public function createTestSuite() - { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try - { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tsuiteMgr->createFromObject($item,array('doChecks' => true)); - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - /** - * "name" - * "testSuiteID" - * "testProjectID" - * "authorLogin" - * "authorID" - * "summary" - * "preconditions" - * "importance" - see const.inc.php for domain - * "executionType" - see ... for domain - * "order" - * - * "estimatedExecutionDuration" // to be implemented - */ - public function createTestCase() - { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try - { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - - // default management - $this->createTestCaseDefaultManagement($item); - - $this->checkRelatives($item->testProjectID,$item->testSuiteID); - - $ou = $this->tcaseMgr->createFromObject($item); - if( ($op['id']=$ou['id']) <= 0) - { - $op['status'] = 'ko'; - $op['message'] = $ou['msg']; - } - - } - catch (Exception $e) - { - $op['message'] = $e->getMessage(); - } - echo json_encode($op); - } - - /** - * - * - */ - private function getUserID($login) - { - - - } - - /** - * - * - */ - private function createTestCaseDefaultManagement(&$obj) - { - if(property_exists($obj, 'authorLogin')) - { - $obj->authorID = $this->getUserID($obj->authorLogin); - if( $obj->authorID <= 0 ) - { - // will use user that do the call ? - } - } - - if(!property_exists($obj, 'steps')) - { - $obj->steps = null; - } - } - - - /** - * - * - */ - private function checkRelatives($testProjectID,$testSuiteID) - { - if($testProjectID <= 0) - { - throw new Exception("Test Project ID is invalid (<=0)"); - } - - if($testSuiteID <= 0) - { - throw new Exception("Test Suite ID is invalid (<=0)"); - } - - $pinfo = $this->tprojectMgr->get_by_id($testProjectID); - if( is_null($pinfo) ) - { - throw new Exception("Test Project ID is invalid (does not exist)"); - } - - $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); - if( is_null($pinfo) ) - { - throw new Exception("Test Suite ID is invalid (does not exist)"); - } - - - if( $testProjectID != $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID,$testSuiteID) ) - { - throw new Exception("Test Suite does not belong to Test Project ID"); - } - } - - - + + * @package TestLink + * @since 1.9.7 + * + * References + * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ + * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment + * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item + * http://www.redmine.org/projects/redmine/wiki/Rest_api + * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ + * https://github.com/educoder/pest/blob/master/examples/intouch_example.php + * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data + * + * http://phptrycatch.blogspot.it/ + * http://nitschinger.at/A-primer-on-PHP-exceptions + * + + * + * + * @internal revisions + * @since 1.9.11 + * + */ +require_once '../../../../config.inc.php'; +require_once 'common.php'; +require_once 'Slim/Slim.php'; +\Slim\Slim::registerAutoloader(); + +/** + * + * @author Francisco Mancardi + * @package TestLink + */ +class tlRestApi +{ + + public static $version = "1.0"; + + /** + * The DB object used throughout the class + * + * @access protected + */ + protected $db = null; + + protected $tables = null; + + protected $tcaseMgr = null; + + protected $tprojectMgr = null; + + protected $tsuiteMgr = null; + + protected $tplanMgr = null; + + protected $tplanMetricsMgr = null; + + protected $reqSpecMgr = null; + + protected $reqMgr = null; + + protected $platformMgr = null; + + /** + * userID associated with the apiKey provided + */ + protected $userID = null; + + /** + * UserObject associated with the userID + */ + protected $user = null; + + /** + * array where all the args are stored for requests + */ + protected $args = null; + + /** + * array where error codes and messages are stored + */ + protected $errors = array(); + + /** + * The api key being used to make a request + */ + protected $apiKey = null; + + /** + * boolean to allow a method to invoke another method and avoid double auth + */ + protected $authenticated = false; + + /** + * The version of a test case that is being used + */ + /** + * This value is setted in following method: + */ + /** + * _checkTCIDAndTPIDValid() + */ + protected $tcVersionID = null; + + protected $versionNumber = null; + + public $statusCode; + + public $codeStatus; + + /** + */ + public function __construct() + { + // We are following Slim naming convention + $this->app = new \Slim\Slim(); + $this->app->contentType('application/json'); + + // test route with anonymous function + $this->app->get('/who', + function (): void { + echo __CLASS__ . ' : Get Route /who'; + }); + + $this->app->get('/whoAmI', array( + $this, + 'authenticate' + ), array( + $this, + 'whoAmI' + )); + $this->app->get('/testprojects', array( + $this, + 'authenticate' + ), array( + $this, + 'getProjects' + )); + + $this->app->get('/testprojects/:id', array( + $this, + 'authenticate' + ), array( + $this, + 'getProjects' + )); + $this->app->get('/testprojects/:id/testcases', + array( + $this, + 'authenticate' + ), array( + $this, + 'getProjectTestCases' + )); + $this->app->get('/testprojects/:id/testplans', + array( + $this, + 'authenticate' + ), array( + $this, + 'getProjectTestPlans' + )); + + $this->app->post('/testprojects', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestProject' + )); + $this->app->post('/executions', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestCaseExecution' + )); + $this->app->post('/testplans', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestPlan' + )); + $this->app->post('/testplans/:id', array( + $this, + 'authenticate' + ), array( + $this, + 'updateTestPlan' + )); + + $this->app->post('/testsuites', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestSuite' + )); + $this->app->post('/testcases', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestCase' + )); + + $this->db = new database(DB_TYPE); + $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); + doDBConnect($this->db, database::ONERROREXIT); + + $this->tcaseMgr = new testcase($this->db); + $this->tprojectMgr = new testproject($this->db); + $this->tsuiteMgr = new testsuite($this->db); + + $this->tplanMgr = new testplan($this->db); + $this->tplanMetricsMgr = new tlTestPlanMetrics($this->db); + $this->reqSpecMgr = new requirement_spec_mgr($this->db); + $this->reqMgr = new requirement_mgr($this->db); + $this->cfieldMgr = $this->tprojectMgr->cfield_mgr; + + $this->tables = $this->tcaseMgr->getDBTables(); + + $resultsCfg = config_get('results'); + foreach ($resultsCfg['status_label_for_exec_ui'] as $key => $label) { + $this->statusCode[$key] = $resultsCfg['status_code'][$key]; + } + + if (isset($this->statusCode['not_run'])) { + unset($this->statusCode['not_run']); + } + $this->codeStatus = array_flip($this->statusCode); + } + + /** + */ + public function authenticate(\Slim\Route $route) + { + $apiKey = null; + if (is_null($apiKey)) { + $request = $this->app->request(); + $apiKey = $request->headers('PHP_AUTH_USER'); + } + + $sql = "SELECT id FROM {$this->tables['users']} " . "WHERE script_key='" . + $this->db->prepare_string($apiKey) . "'"; + + $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); + if ($ok = ! is_null($this->userID)) { + $this->user = tlUser::getByID($this->db, $this->userID); + } else { + $this->app->status(400); + echo json_encode( + array( + 'status' => 'ko', + 'message' => 'authentication error' + )); + $this->app->stop(); + } + + return $ok; + } + + /** + */ + public function whoAmI() + { + echo json_encode(array( + 'name' => __CLASS__ . ' : Get Route /whoAmI' + )); + } + + /** + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME + */ + public function getProjects($idCard = null, $opt = null) + { + $options = array_merge(array( + 'output' => 'rest' + ), (array) $opt); + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'item' => null + ); + if (is_null($idCard)) { + $opOptions = array( + 'output' => 'array_of_map', + 'order_by' => " ORDER BY name ", + 'add_issuetracker' => true, + 'add_reqmgrsystem' => true + ); + $op['item'] = $this->tprojectMgr->get_accessible_for_user( + $this->userID, $opOptions); + } else { + $opOptions = array( + 'output' => 'map', + 'field_set' => 'id', + 'format' => 'simple' + ); + $zx = $this->tprojectMgr->get_accessible_for_user($this->userID, + $opOptions); + if (($safeID = intval($idCard)) > 0) { + if (isset($zx[$safeID])) { + $op['item'] = $this->tprojectMgr->get_by_id($safeID); + } + } else { + // Will consider id = name + foreach ($zx as $value) { + if (strcmp($value['name'], $idCard) == 0) { + $safeString = $this->db->prepare_string($idCard); + $op['item'] = $this->tprojectMgr->get_by_name( + $safeString); + break; + } + } + } + } + + // Developer (silly?) information + // json_encode() transforms maps in objects. + switch ($options['output']) { + case 'internal': + return $op['item']; + break; + + case 'rest': + default: + echo json_encode($op); + break; + } + } + + /** + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME + */ + public function getProjectTestPlans($idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tproject = $this->getProjects($idCard, array( + 'output' => 'internal' + )); + + if (! is_null($tproject)) { + $items = $this->tprojectMgr->get_all_testplans($tproject[0]['id']); + $op['items'] = (! empty($items)) ? $items : null; + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + } + + echo json_encode($op); + } + + /** + * Will return LATEST VERSION of each test case. + * Does return test step info ? + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME + */ + public function getProjectTestCases($idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tproject = $this->getProjects($idCard, array( + 'output' => 'internal' + )); + + if (! is_null($tproject)) { + $tcaseIDSet = array(); + $this->tprojectMgr->get_all_testcases_id($tproject[0]['id'], + $tcaseIDSet); + if (! empty($tcaseIDSet)) { + $op['items'] = array(); + foreach ($tcaseIDSet as $tcaseID) { + $item = $this->tcaseMgr->getLastVersionInfo($tcaseID); + $item['keywords'] = $this->tcaseMgr->get_keywords_map( + $tcaseID); + $item['customfields'] = $this->tcaseMgr->get_linked_cfields_at_design( + $tcaseID, $item['tcversion_id'], null, null, + $tproject[0]['id']); + $op['items'][] = $item; + } + } + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + } + + echo json_encode($op); + } + + /** + * $item->name + * $item->prefix + * $item->notes + * $item->active + * $item->public + * $item->options + * $item->options->requirementsEnabled + * $item->options->testPriorityEnabled + * $item->options->automationEnabled + * $item->options->inventoryEnabled + */ + public function createTestProject() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op['id'] = $this->tprojectMgr->create($item, + array( + 'doChecks' => true + )); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + /** + * Request Body + * + * $ex->testPlanID + * $ex->buildID + * $ex->platformID + * $ex->testCaseExternalID + * $ex->notes + * $ex->statusCode + * + * + * Checks to be done + * + * A. User right & Test plan existence + * user has right to execute on target Test plan? + * this means also that: Test plan ID exists ? + * + * B. Build + * does Build ID exist on target Test plan ? + * is Build enable to execution ? + * + * C. Platform + * do we need a platform ID in order to execute ? + * is a platform present on provided data ? + * does this platform belong to target Test plan ? + * + * D. Test case identity + * is target Test case part of Test plan ? + * + * + * Z. Other mandatory information + * We are not going to check for other mandatory info + * like: mandatory custom fields. (if we will be able in future to manage it) + */ + public function createTestCaseExecution() + { + $op = array( + 'status' => ' ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $ex = json_decode($request->getBody()); + $util = $this->checkExecutionEnvironment($ex); + + // If we are here this means we can write execution status!!! + $ex->testerID = $this->userID; + foreach ($util as $prop => $value) { + $ex->$prop = $value; + } + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tplanMgr->writeExecution($ex); + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + // + // Support methods + // + private function checkExecutionEnvironment($ex) + { + // Test plan ID exists and is ACTIVE + $msg = 'invalid Test plan ID'; + $getOpt = array( + 'output' => 'testPlanFields', + 'active' => 1, + 'testPlanFields' => 'id,testproject_id,is_public' + ); + $status_ok = ! is_null( + $testPlan = $this->tplanMgr->get_by_id($ex->testPlanID, $getOpt)); + + if ($status_ok) { + // user has right to execute on Test plan ID + // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) + $msg = 'user has no right to execute'; + $status_ok = $this->user->hasRight($this->db, 'testplan_execute', + $testPlan['testproject_id'], $ex->testPlanID, true); + } + + if ($status_ok) { + // Check if couple (buildID,testPlanID) is valid + $msg = '(buildID,testPlanID) couple is not valid'; + $getOpt = array( + 'fields' => 'id,active,is_open', + 'buildID' => $ex->buildID, + 'orderBy' => null + ); + $status_ok = ! is_null( + $build = $this->tplanMgr->get_builds($ex->testPlanID, null, null, + $getOpt)); + + if ($status_ok) { + // now check is execution can be done againts this build + $msg = 'Build is not active and/or closed => execution can not be done'; + $status_ok = $build[$ex->buildID]['active'] && + $build[$ex->buildID]['is_open']; + } + } + + if ($status_ok) { + // Get Test plan platforms + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => false + ); + $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID, + $getOpt); + + if (! ($hasPlatforms = ! is_null($platformSet)) && + $ex->platformID != 0) { + $status_ok = false; + $msg = 'You can not execute against a platform, because Test plan has no platforms'; + } + + if ($status_ok && $hasPlatforms) { + if ($ex->platformID == 0) { + $status_ok = false; + $msg = 'Test plan has platforms, you need to provide one in order to execute'; + } elseif (! isset($platformSet[$ex->platformID])) { + $status_ok = false; + $msg = '(platform,test plan) couple is not valid'; + } + } + } + + if ($status_ok) { + // Test case check + $msg = 'Test case does not exist'; + + $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); + if ($status_ok = ($tcaseID > 0)) { + $msg = 'Test case doesn not belong to right test project'; + $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase( + $tcaseID, 0); + $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); + } + if ($status_ok) { + // Does this test case is linked to test plan ? + $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; + $getFilters = array( + 'testplan_id' => $ex->testPlanID, + 'platform_id' => $ex->platformID + ); + $getOpt = array( + 'output' => 'simple' + ); + $links = $this->tcaseMgr->get_linked_versions($tcaseID, + $getFilters, $getOpt); + $status_ok = ! is_null($links); + } + } + if ($status_ok) { + // status code is OK ? + $msg = 'not run status is not a valid execution status (can not be written to DB)'; + $status_ok = ($ex->statusCode != 'n'); // Sorry for the MAGIC; + + if ($status_ok) { + $msg = 'Requested execution status is not configured on TestLink'; + $status_ok = isset($this->codeStatus[$ex->statusCode]); + } + } + + if ($status_ok) { + $ret = new stdClass(); + $ret->testProjectID = $testPlan['testproject_id']; + $ret->testCaseVersionID = key($links); + $ret->testCaseVersionNumber = $links[$ret->testCaseVersionID][$ex->testPlanID][$ex->platformID]['version']; + } + + if (! $status_ok) { + throw new Exception($msg); + } + return $ret; + } + + /** + * 'name' + * 'testProjectID' + * 'notes' + * 'active' + * 'is_public' + */ + public function createTestPlan() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tplanMgr->createFromObject($item, + array( + 'doChecks' => true + )); + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + /** + * 'name' + * 'testProjectID' + * 'notes' + * 'active' + * 'is_public' + */ + public function updateTestPlan($id) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $item->id = $id; + $op['id'] = $this->tplanMgr->updateFromObject($item); + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + /** + * 'name' + * 'testProjectID' + * 'parentID' + * 'notes' + * 'order' + */ + public function createTestSuite() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tsuiteMgr->createFromObject($item, + array( + 'doChecks' => true + )); + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + /** + * "name" + * "testSuiteID" + * "testProjectID" + * "authorLogin" + * "authorID" + * "summary" + * "preconditions" + * "importance" - see const.inc.php for domain + * "executionType" - see ... for domain + * "order" + * + * "estimatedExecutionDuration" // to be implemented + */ + public function createTestCase() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + + // default management + $this->createTestCaseDefaultManagement($item); + + $this->checkRelatives($item->testProjectID, $item->testSuiteID); + + $ou = $this->tcaseMgr->createFromObject($item); + if (($op['id'] = $ou['id']) <= 0) { + $op['status'] = 'ko'; + $op['message'] = $ou['msg']; + } + } catch (Exception $e) { + $op['message'] = $e->getMessage(); + } + echo json_encode($op); + } + + /** + */ + private function getUserID($login) + {} + + /** + */ + private function createTestCaseDefaultManagement(&$obj) + { + if (property_exists($obj, 'authorLogin')) { + $obj->authorID = $this->getUserID($obj->authorLogin); + if ($obj->authorID <= 0) { + // will use user that do the call ? + } + } + + if (! property_exists($obj, 'steps')) { + $obj->steps = null; + } + } + + /** + */ + private function checkRelatives($testProjectID, $testSuiteID) + { + if ($testProjectID <= 0) { + throw new Exception("Test Project ID is invalid (<=0)"); + } + + if ($testSuiteID <= 0) { + throw new Exception("Test Suite ID is invalid (<=0)"); + } + + $pinfo = $this->tprojectMgr->get_by_id($testProjectID); + if (is_null($pinfo)) { + throw new Exception("Test Project ID is invalid (does not exist)"); + } + + $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); + if (is_null($pinfo)) { + throw new Exception("Test Suite ID is invalid (does not exist)"); + } + + if ($testProjectID != + $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID, + $testSuiteID)) { + throw new Exception("Test Suite does not belong to Test Project ID"); + } + } } // class end diff --git a/lib/api/rest/v2/index.php b/lib/api/rest/v2/index.php index 11c56ff419..5d56a2b073 100644 --- a/lib/api/rest/v2/index.php +++ b/lib/api/rest/v2/index.php @@ -1,20 +1,19 @@ -app->run(); diff --git a/lib/api/rest/v2/tlRestApi.class.php b/lib/api/rest/v2/tlRestApi.class.php index 09a5e4edaa..35940cecfe 100644 --- a/lib/api/rest/v2/tlRestApi.class.php +++ b/lib/api/rest/v2/tlRestApi.class.php @@ -1,1576 +1,1850 @@ - - * @package TestLink - * @since 1.9.7 - * - * Implemented using Slim framework Version 2.2.0 - * - * - * References - * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ - * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment - * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item - * http://www.redmine.org/projects/redmine/wiki/Rest_api - * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ - * https://github.com/educoder/pest/blob/master/examples/intouch_example.php - * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data - * - * http://phptrycatch.blogspot.it/ - * http://nitschinger.at/A-primer-on-PHP-exceptions - * - * - * - */ - -require_once('../../../../config.inc.php'); -require_once('common.php'); -require 'Slim/Slim.php'; -\Slim\Slim::registerAutoloader(); - -/** - * @author Francisco Mancardi - * @package TestLink - */ -class tlRestApi -{ - public static $version = "2.1.1"; - - - /** - * The DB object used throughout the class - * - * @access protected - */ - protected $db = null; - protected $tables = null; - - protected $tcaseMgr = null; - protected $tprojectMgr = null; - protected $tsuiteMgr = null; - protected $tplanMgr = null; - protected $tplanMetricsMgr = null; - protected $reqSpecMgr = null; - protected $reqMgr = null; - protected $platformMgr = null; - protected $buildMgr = null; - protected $cfieldMgr = null; - - - /** userID associated with the apiKey provided */ - protected $userID = null; - - /** UserObject associated with the userID */ - protected $user = null; - - /** array where all the args are stored for requests */ - protected $args = null; - - /** array where error codes and messages are stored */ - protected $errors = array(); - - /** The api key being used to make a request */ - protected $apiKey = null; - - /** boolean to allow a method to invoke another method and avoid double auth */ - protected $authenticated = false; - - /** The version of a test case that is being used */ - /** This value is setted in following method: */ - protected $tcVersionID = null; - protected $versionNumber = null; - protected $debugMsg; - - protected $cfg; - - protected $apiLogPathName; - - protected $l10n; - - - - /** - */ - public function __construct() { - - // We are following Slim naming convention - $this->app = new \Slim\Slim(); - $this->app->contentType('application/json'); - - $tl = array('API_MISSING_REQUIRED_PROP' => null, - 'API_TESTPLAN_ID_DOES_NOT_EXIST' => null, - 'API_TESTPLAN_APIKEY_DOES_NOT_EXIST' => null, - 'API_BUILDNAME_ALREADY_EXISTS' => null, - 'API_INVALID_BUILDID' => null); - - $this->l10n = init_labels($tl); - - // GET Routes - // test route with anonymous function - $this->app->get('/who', function () { echo __CLASS__ . ' : You have called the Get Route /who';}); - - // using middleware for authentication - // https://docs.slimframework.com/routing/middleware/ - // - $this->app->get('/whoAmI', array($this,'authenticate'), array($this,'whoAmI')); - - $this->app->get('/superman', array($this,'authenticate'), array($this,'superman')); - - $this->app->get('/testprojects', array($this,'authenticate'), array($this,'getProjects')); - - $this->app->get('/testprojects/:id', array($this,'authenticate'), array($this,'getProjects')); - $this->app->get('/testprojects/:id/testcases', array($this,'authenticate'), array($this,'getProjectTestCases')); - $this->app->get('/testprojects/:id/testplans', array($this,'authenticate'), array($this,'getProjectTestPlans')); - - $this->app->get('/testplans/:id/builds', array($this,'authenticate'), array($this,'getPlanBuilds')); - - // POST Routes - $this->app->post('/builds', array($this,'authenticate'), array($this,'createBuild')); - - - $this->app->post('/testprojects', array($this,'authenticate'), array($this,'createTestProject')); - - $this->app->post('/executions', array($this,'authenticate'), array($this,'createTestCaseExecution')); - - $this->app->post('/testplans', array($this,'authenticate'), array($this,'createTestPlan')); - - $this->app->post('/testplans/:id', array($this,'authenticate'), array($this,'updateTestPlan')); - - - $this->app->post('/testplans/:id/platforms', array($this,'authenticate'), array($this,'addPlatformsToTestPlan')); - - $this->app->post('/testsuites', array($this,'authenticate'), array($this,'createTestSuite')); - - $this->app->post('/testcases', array($this,'authenticate'), array($this,'createTestCase')); - - $this->app->post('/keywords', array($this,'authenticate'), array($this,'createKeyword')); - - - // update routes - $this->app->post('/builds/:id', array($this,'authenticate'), array($this,'updateBuild')); - - - // $this->app->get('/testplans/:id', array($this,'getTestPlan')); - $this->apiLogPathName = '/var/testlink/rest-api.log'; - - $this->db = new database(DB_TYPE); - $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); - doDBConnect($this->db,database::ONERROREXIT); - - - $this->tcaseMgr = new testcase($this->db); - $this->tprojectMgr = new testproject($this->db); - $this->tsuiteMgr = new testsuite($this->db); - - $this->tplanMgr = new testplan($this->db); - $this->tplanMetricsMgr = new tlTestPlanMetrics($this->db); - $this->reqSpecMgr = new requirement_spec_mgr($this->db); - $this->reqMgr = new requirement_mgr($this->db); - $this->cfieldMgr = $this->tprojectMgr->cfield_mgr; - $this->buildMgr = new build_mgr($this->db); - - $this->tables = $this->tcaseMgr->getDBTables(); - - - $this->cfg = array(); - $conf = config_get('results'); - foreach($conf['status_label_for_exec_ui'] as $key => $label ) { - $this->cfg['exec']['statusCode'][$key] = $conf['status_code'][$key]; - } - - $this->cfg['exec']['codeStatus'] = array_flip($this->cfg['exec']['statusCode']); - - $this->cfg['tcase']['executionType'] = - config_get('execution_type'); - $this->cfg['tcase']['status'] = config_get('testCaseStatus'); - $this->cfg['tcase']['executionType'] = - config_get('execution_type'); - - $x = config_get('importance'); - $this->cfg['tcase']['importance'] = []; - foreach($x['code_label'] as $code => $label) { - $this->cfg['tcase']['importance'][$label] = $code; - } - - - // DEFAULTS - $this->cfg['tcase']['defaults']['executionType'] = - $this->cfg['tcase']['executionType']['manual']; - - $this->cfg['tcase']['defaults']['importance'] = config_get('testcase_importance_default'); - - - - - $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; - } - - - /** - * - */ - function authenticate(\Slim\Route $route) { - $apiKey = null; - if(is_null($apiKey)) { - $request = $this->app->request(); - $hh = $request->headers(); - - if( isset($hh['APIKEY']) ) { - $apiKey = $hh['APIKEY']; - } else { - $apiKey = $hh['PHP_AUTH_USER']; - } - } - $sql = "SELECT id FROM {$this->tables['users']} " . - "WHERE script_key='" . $this->db->prepare_string($apiKey) . "'"; - - $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); - if( ($ok=!is_null($this->userID)) ) { - $this->user = tlUser::getByID($this->db,$this->userID); - } else { - $this->app->status(400); - echo json_encode(array('status' => 'ko', 'message' => 'authentication error')); - $this->app->stop(); - } - - return $ok; - } - - - - /** - * - */ - public function whoAmI() { - echo json_encode(array('name' => __CLASS__ . ' : You have called Get Route /whoAmI')); - } - - /** - * - */ - public function superman() { - echo json_encode( - array('name' => __CLASS__ . ' : You have called the Get Route /superman')); - } - - - /** - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME - */ - public function getProjects($idCard=null, $opt=null) { - $options = array_merge(array('output' => 'rest'), (array)$opt); - $op = array('status' => 'ok', 'message' => 'ok', 'item' => null); - if(is_null($idCard)) { - $opOptions = array('output' => 'array_of_map', 'order_by' => " ORDER BY name ", 'add_issuetracker' => true, - 'add_reqmgrsystem' => true); - $op['item'] = $this->tprojectMgr->get_accessible_for_user($this->userID,$opOptions); - } else { - $opOptions = array('output' => 'map', - 'field_set' => 'prefix', - 'format' => 'simple'); - $zx = $this->tprojectMgr->get_accessible_for_user($this->userID,$opOptions); - - $targetID = null; - if( ($safeID = intval($idCard)) > 0) { - if( isset($zx[$safeID]) ) { - $targetID = $safeID; - } - } - else { - // Will consider id = name or prefix - foreach( $zx as $itemID => $value ) { - if( strcmp($value['name'],$idCard) == 0 || - strcmp($value['prefix'],$idCard) == 0 ) { - $targetID = $itemID; - break; - } - } - } - - if( null != $targetID ) { - $op['item'] = $this->tprojectMgr->get_by_id($targetID); - } - } - - // Developer (silly?) information - // json_encode() transforms maps in objects. - switch($options['output']) { - case 'internal': - return $op['item']; - break; - - case 'rest': - default: - echo json_encode($op); - break; - } - } - - /** - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME Or Prefix - */ - public function getProjectTestPlans($idCard) { - $op = array('status' => 'ok', 'message' => 'ok', 'items' => null); - $tproject = $this->getProjects($idCard, array('output' => 'internal')); - - if( !is_null($tproject) ) { - $items = $this->tprojectMgr->get_all_testplans($tproject['id']); - $op['items'] = (!is_null($items) && count($items) > 0) ? $items : null; - } else { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - $this->app->status(500); - } - - echo json_encode($op); - } - - /** - * Will return LATEST VERSION of each test case. - * Does return test step info ? - * - * @param mixed idCard if provided identifies test project - * if intval() > 0 => is considered DBID - * else => is used as PROJECT NAME - */ - public function getProjectTestCases($idCard) { - $op = array('status' => 'ok', 'message' => 'ok', 'items' => null); - $tproject = $this->getProjects($idCard, array('output' => 'internal')); - - if( !is_null($tproject) ) { - $tcaseIDSet = array(); - $this->tprojectMgr->get_all_testcases_id($tproject['id'],$tcaseIDSet); - - if( !is_null($tcaseIDSet) && count($tcaseIDSet) > 0 ) { - $op['items'] = array(); - foreach( $tcaseIDSet as $key => $tcaseID ) { - $item = $this->tcaseMgr->get_last_version_info($tcaseID); - $item['keywords'] = - $this->tcaseMgr->get_keywords_map($tcaseID,$item['tcversion_id']); - $item['customfields'] = - $this->tcaseMgr->get_linked_cfields_at_design($tcaseID,$item['tcversion_id'],null,null,$tproject['id']); - $op['items'][] = $item; - } - } - } else { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - } - - echo json_encode($op); - } - - /** - * - * $item->name - * $item->prefix - * $item->notes - * $item->active - * $item->public - * $item->options - * $item->options->requirementsEnabled - * $item->options->testPriorityEnabled - * $item->options->automationEnabled - * $item->options->inventoryEnabled - */ - public function createTestProject() { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - - try { - // Check user grants for requested operation - // This is a global right - $rightToCheck="mgt_modify_product"; - if( $this->userHasRight($rightToCheck) ) { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op['id'] = $this->tprojectMgr->create($item,array('doChecks' => true)); - $op = array('status' => 'ok', 'message' => 'ok'); - } else { - $this->app->status(403); - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = sprintf($msg,$rightToCheck,0,0); - } - } - catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - echo json_encode($op); - } - - - - /** - * - * Request Body - * - * $ex->testPlanID - * $ex->buildID - * $ex->platformID -> optional - * $ex->testCaseExternalID - * $ex->notes - * $ex->statusCode - * - * - * Checks to be done - * - * A. User right & Test plan existence - * user has right to execute on target Test plan? - * this means also that: Test plan ID exists ? - * - * B. Build - * does Build ID exist on target Test plan ? - * is Build enable to execution ? - * - * C. Platform - * do we need a platform ID in order to execute ? - * is a platform present on provided data ? - * does this platform belong to target Test plan ? - * - * D. Test case identity - * is target Test case part of Test plan ? - * - * - * Z. Other mandatory information - * We are not going to check for other mandatory info - * like: mandatory custom fields. (if we will be able in future to manage it) - * - * - */ - public function createTestCaseExecution() { - $op = array('status' => ' ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - $ex = json_decode($request->getBody()); - $util = $this->checkExecutionEnvironment($ex); - - // Complete missing propertie - if( property_exists($ex, 'platformID') == FALSE ) { - $ex->platformID = 0; - } - - if( property_exists($ex, 'executionType') == FALSE ) { - $ex->executionType = - $this->cfg['tcase']['executionType']['auto']; - } - - // If we are here this means we can write execution status!!! - $ex->testerID = $this->userID; - foreach($util as $prop => $value) { - $ex->$prop = $value; - } - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tplanMgr->writeExecution($ex); - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - $e->getMessage(); - } - echo json_encode($op); - } - - - - // - // Support methods - // - private function checkExecutionEnvironment($ex) { - // throw new Exception($message, $code, $previous); - - // no platform - $platform = 0; - - // Test plan ID exists and is ACTIVE - $msg = 'invalid Test plan ID'; - $getOpt = array('output' => 'testPlanFields','active' => 1, - 'testPlanFields' => 'id,testproject_id,is_public'); - $status_ok = !is_null($testPlan=$this->tplanMgr->get_by_id($ex->testPlanID,$getOpt)); - - if($status_ok) { - // user has right to execute on Test plan ID - // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) - $msg = 'user has no right to execute'; - $status_ok = $this->user->hasRight($this->db,'testplan_execute', - $testPlan['testproject_id'],$ex->testPlanID,true); - } - - if($status_ok) { - // Check if couple (buildID,testPlanID) is valid - $msg = '(buildID,testPlanID) couple is not valid'; - $getOpt = array('fields' => 'id,active,is_open', 'buildID' => $ex->buildID, 'orderBy' => null); - $status_ok = !is_null($build = $this->tplanMgr->get_builds($ex->testPlanID,null,null,$getOpt)); - - if($status_ok) { - // now check is execution can be done againts this build - $msg = 'Build is not active and/or closed => execution can not be done'; - $status_ok = $build[$ex->buildID]['active'] && $build[$ex->buildID]['is_open']; - } - } - - if($status_ok && property_exists($ex, 'platformID')) { - // Get Test plan platforms - $platform = $ex->platformID; - - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => false); - $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID,$getOpt); - - if( !($hasPlatforms = !is_null($platformSet)) && $platform !=0) { - $status_ok = false; - $msg = 'You can not execute against a platform, because Test plan has no platforms'; - } - - if($status_ok) { - if($hasPlatforms) { - if($platform == 0) { - $status_ok = false; - $msg = 'Test plan has platforms, you need to provide one in order to execute'; - } else if (!isset($platformSet[$platform])) { - $status_ok = false; - $msg = '(platform,test plan) couple is not valid'; - } - } - } - } - - if($status_ok) { - // Test case check - $msg = 'Test case does not exist'; - - $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); - $status_ok = ($tcaseID > 0); - if( $status_ok = ($tcaseID > 0) ) { - $msg = 'Test case doesn not belong to right test project'; - $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase($tcaseID,0); - $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); - } - - if($status_ok) { - // Does this test case is linked to test plan ? - $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; - $getFilters = array('testplan_id' => $ex->testPlanID, - 'platform_id' => $platform); - - $getOpt = array('output' => 'simple'); - $links = $this->tcaseMgr->get_linked_versions($tcaseID,$getFilters,$getOpt); - $status_ok = !is_null($links); - } - } - - if($status_ok) { - // status code is OK ? - $msg = 'not run status is not a valid execution status (can not be written to DB)'; - $status_ok = ($ex->statusCode != $this->cfg['exec']['statusCode']['not_run']); - - if($status_ok) { - $msg = 'Requested execution status is not configured on TestLink'; - $status_ok = isset($this->cfg['exec']['codeStatus'][$ex->statusCode]); - } - } - - if($status_ok) { - $msg = 'Last Step Get testCaseVersionNumber'; - $ret = new stdClass(); - $ret->testProjectID = $testPlan['testproject_id']; - $ret->testCaseVersionID = key($links); - - $status_ok = false; - if (isset($links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version'])) { - $ret->testCaseVersionNumber = - $links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version']; - $status_ok = true; - } - } - - if(!$status_ok) { - throw new Exception($msg); - } - - return $ret; - } - - - - /** - * 'name' - * 'testProjectID' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function createTestPlan() { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - - $op = array('status' => 'ok', 'message' => 'ok'); - $opeOpt = array('setSessionProject' => false, - 'doChecks' => true); - $op['id'] = $this->tplanMgr->createFromObject($item,$opeOpt); - - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . $e->getMessage(); - } - echo json_encode($op); - } - - /** - * 'name' - * 'testProjectID' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function updateTestPlan($id) { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $op = array('status' => 'ok', 'message' => 'ok'); - - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $item->id = $id; - $op['id'] = $this->tplanMgr->updateFromObject($item); - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . $e->getMessage(); - } - echo json_encode($op); - } - - - /** - * 'name' - * 'testProjectID' - * 'parentID' - * 'notes' - * 'order' - */ - public function createTestSuite() { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tsuiteMgr->createFromObject($item,array('doChecks' => true)); - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - msgFromException($e); - } - echo json_encode($op); - } - - /** - * - * "name" - * "testSuite": {"id": xxx} - * "testProject" : {"id": xxx} or {"prefix": yyy} - * "authorLogin" - * "authorID" - * - * "summary" can be a string or an array of strings - * "preconditions" can be a string or an array of strings - * - * "importance" - see const.inc.php for domain - * "executionType" - see ... for domain - * "order" - * - * "estimatedExecutionDuration" // to be implemented - * "steps": array of objects - * IMPORTANT NOTICE: actions and expected_results - * Can be string or array of strings - * [ - * { "step_number":1, - * "actions": "red", - * "expected_results": "#f00", - * "execution_type":1 - * }, - * { "step_number":12, - * "actions": "red12", - * "expected_results": "#f00", - * "execution_type":2 - * } - * ] - */ - public function createTestCase() { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - - // It will be important to document WHY!!! - // AFAIK some issues with json_decode() - // https://stackoverflow.com/questions/34486346/new-lines-and-tabs-in-json-decode-php-7 - $body = str_replace("\n", '', $request->getBody()); - $item = json_decode($body); - - if(is_null($item)) { - throw new Exception("Fatal Error " . __METHOD__ . " json_decode(requesBody) is NULL", 1); - } - - // create obj with standard properties - try { - $tcase = $this->buildTestCaseObj($item); - $this->checkRelatives($tcase); - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = 'After buildTestCaseObj() >> ' . - $this->msgFromException($e); - echo json_encode($op); - return; - } - - $ou = $this->tcaseMgr->createFromObject($tcase); - $op = array('status' => 'ok', 'message' => 'ok', 'id' => -1); - if( ($op['id']=$ou['id']) <= 0) { - $op['status'] = 'ko'; - $op['message'] = $ou['msg']; - $this->app->status(409); - } - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - echo json_encode($op); - } - - - /** - * - * @param mixed testplan - * - * step 1) testplan is a number ? - * use it as test plan id - * - * step 2) testplan is a string ? - * use it as test plan apikey - * - * Is not possible to consider testplan as name - * becase name can be used in several test projects. - * One option can be request testprojectname/testplanname - * - * @param string name: build name - * @param string [notes] - * @param string [active] - * @param string [open] - * @param string [releasedate]: format YYYY-MM-DD; - * @param int [copytestersfrombuild] - * - * step 1) is a number ? - * will be considered a target build id. - * check will be done to verify that is a valid - * build id inside the test plan. - * - * step 2) is a string ? - * will be used as build name to search inside - * the test plan. - * - * if check is OK, tester assignments will be copied. - * - */ - public function createBuild() { - - $op = array('status' => 'ko', 'message' => 'ko', - 'details' => array(), 'id' => -1); - - $rightToCheck = "testplan_create_build"; - - // need to get input, before doing right checks, - // because right can be tested against in this order - // Test Plan Right - // Test Project Right - // Default Right - $request = $this->app->request(); - $item = json_decode($request->getBody()); - if( null == $item ) { - $this->byeHTTP500(); - } - - $statusOK = true; - $build = new stdClass(); - - $reqProps = array('testplan','name'); - foreach( $reqProps as $prop ) { - if( !property_exists($item, $prop) ) { - $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . - $prop; - $statusOK = false; - } - } - - if( $statusOK ) { - $build->name = $item->name; - - if( is_numeric($item->testplan) ) { - // Check if is a valid test plan - // Get it's test project id - $tplan_id = intval($item->testplan); - $tplan = $this->tplanMgr->get_by_id( $tplan_id ); - - if( null == $tplan ) { - $statusOK = false; - $op['details'][] = - sprintf($this->l10n['API_TESTPLAN_ID_DOES_NOT_EXIST'],$item->testplan); - $this->app->status(404); - } - } else { - $tplanAPIKey = trim($item->testplan); - $tplan = $this->tplanMgr->getByAPIKey( $tplanAPIKey ); - if( null == $tplan ) { - $statusOK = false; - $op['details'][] = - sprintf($this->l10n['API_TESTPLAN_APIKEY_DOES_NOT_EXIST'],$item->testplan); - $this->app->status(404); - } - } - } - - if( $statusOK ) { - // Ready to check user permissions - $context = array('tplan_id' => $tplan['id'], - 'tproject_id' => $tplan['testproject_id']); - - if( !$this->userHasRight($rightToCheck,TRUE,$context) ) { - $statusOK = false; - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = - sprintf($msg,$rightToCheck,$this->user->login, - $context['tproject_id'],$context['tplan_id']); - $this->app->status(403); - } - } - - // Go ahead, try create build!! - // Step 1 - Check if build name already exists - if( $statusOK ) { - $build->id = - $this->tplanMgr->get_build_id_by_name( $context['tplan_id'], $build->name ); - - if( $build->id > 0 ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_BUILDNAME_ALREADY_EXISTS'], - $build->name, $build->id); - $this->app->status(409); - } - - $build->tplan_id = $context['tplan_id']; - } - - // Step 2 - Finally Create It!! - if( $statusOK ) { - // key 2 check with default value is parameter is missing - $k2check = array('is_open' => 1, - 'release_candidate' => null, - 'notes' => null, - 'commit_id' => null, 'tag' => null, - 'branch' => null, - 'is_active' => 1,'active' => 1, - 'releasedate' => null,'release_date' => null, - 'copy_testers_from_build' => null, - 'copytestersfrombuild' => null); - - $buildProp = array('tplan_id' => 'tplan_id', - 'release_date' => 'release_date', - 'releasedate' => 'release_date', - 'active' => 'is_active', - 'is_active' => 'is_active', - 'notes' => 'notes', - 'commit_id' => 'commit_id', - 'tag' => 'tag', 'branch' => 'branch', - 'release_candidate' =>'release_candidate', - 'is_open' => 'is_open', - 'copytestersfrombuild' => - 'copytestersfrombuild', - 'copy_testers_from_build' => - 'copytestersfrombuild'); - - $skipKey = array(); - foreach( $k2check as $key => $value ) { - $translate = $buildProp[$key]; - if( !isset($skipKey[$translate]) ) { - $build->$translate = $value; - if( property_exists($item, $key) ) { - $build->$translate = $item->$key; - $skipKey[$translate] = true; - } - } - } - - $itemID = $this->buildMgr->createFromObject($build); - if( $itemID > 0 ) { - $op = array('status' => 'ok', 'message' => 'ok', - 'details' => array(), 'id' => $itemID); - } - } - - echo json_encode($op); - } - - - /** - * - * - */ - private function getUserIDByAttr($user) { - $debugMsg = $this->debugMsg . __FUNCTION__; - $run = false; - $udi = -1; - - $sql = "/* $debugMsg */ SELECT id FROM {$this->tables['users']} "; - if(property_exists($user, 'login')) { - $run = true; - $sql .= " WHERE login='" . $this->db->prepare_string(trim($user->login)) . "'"; - } - - if($run==false && property_exists($user, 'id')) { - $run = true; - $sql .= " WHERE id=" . intval($user->id); - } - - if($run) { - $rs = $this->db->get_recordset($sql); - } - - return ($run && !is_null($rs)) ? $rs[0]['id'] : $uid; - } - - /** - * - * - */ - private function buildTestCaseObj(&$obj) { - if(is_null($obj)) { - throw new Exception("Fatal Error - " . __METHOD__ . " arg is NULL"); - } - - $tcase = new stdClass(); - $tcase->authorID = -1; - $tcase->steps = null; - $tcase->testProjectID = -1; - - $accessKey = array(); - $isOK = true; - - // Knowing author is critic, because rights are related to user. - // Another important thing: - // do we need to check that author when provided, has rights to do - // requested action? - // If we do not do this check, we will find in test cases created - // by people that do not have rights. - // May be is time to add a field that provide info about source of action - // GUI, API - // - if(property_exists($obj, 'author')) { - if(property_exists($obj->author, 'login') || property_exists($obj->author, 'id')) { - $tcase->authorID = $this->getUserIDByAttr($obj->author); - } - } - - // Last resort: get author from credentials use to make the call. - // no error message returned. - if($tcase->authorID <= 0) { - $tcase->authorID = $this->userID; - } - - - // Mandatory attributes - $ma = array('name' => null, - 'testProject' => array('id','prefix'), - 'testSuite' => array('id')); - - foreach ($ma as $key => $dummy) { - if( !($isOK = $isOK && property_exists($obj, $key)) ) { - throw new Exception("Missing Attribute: {$key} "); - } - } - - foreach ($ma as $key => $attr) { - if( !is_null($attr) ) { - $attrOK = false; - foreach($attr as $ak) { - $accessKey[$key][$ak] = property_exists($obj->$key,$ak); - $attrOK = $attrOK || $accessKey[$key][$ak]; - } - - if(!$attrOK) { - $msg = "Attribute: {$key} mandatory key ("; - if(count($attr) > 1) { - $msg .= "one of set: "; - } - $msg .= implode('/',$attr) . ") is missing"; - throw new Exception($msg); - } - } - } - - $tcase->name = trim($obj->name); - $tcase->testSuiteID = intval($obj->testSuite->id); - - $gOpt = array('output' => 'array_of_map', - 'field_set' => 'prefix', - 'add_issuetracker' => false, - 'add_reqmgrsystem' => false); - - - $msg = "Test project with "; - if($accessKey['testProject']['id']) { - $safeID = intval($obj->testProject->id); - $gFilters = array('id' => array('op' => '=', 'value' => $safeID)); - $msg .= "id={$safeID} "; - } - - if($accessKey['testProject']['prefix']) { - $gFilters = array('prefix' => - array('op' => '=', 'value' => trim($obj->testProject->prefix)) ); - $msg .= "prefix={$obj->testProject->prefix} "; - } - - $info = $this->tprojectMgr->get_accessible_for_user($this->userID,$gOpt,$gFilters); - - if(is_null($info)) { - $msg .= "does not exist or you have no rights to use it"; - throw new Exception($msg,999); - } - - $tcase->testProjectID = intval($info[0]['id']); - - $sk2d = array('summary' => '', - 'preconditions' => '', - 'order' => 100, - 'estimatedExecutionTime' => 0); - foreach($sk2d as $key => $value) { - $tcase->$key = property_exists($obj, $key) - ? $obj->$key : $value; - } - - // -------------------------------------------------------------- - // summary & preconditions - // if type is array -> generate string in this way - // - add
    -    // - concact the elements with "\n"
    -    // - add 
    - // -------------------------------------------------------------- - $sk2d = array('summary' => '', - 'preconditions' => ''); - foreach($sk2d as $key => $value) { - if (is_array($tcase->$key)) { - $tcase->$key = "
    " . implode("\n", $tcase->$key) . "
    "; - } - } - // -------------------------------------------------------------- - - - // -------------------------------------------------------------- - // these are objects with name as property. - $tcfg = $this->cfg['tcase']; - $ck2d = array('executionType' => $tcfg['executionType']['manual'], - 'importance' => $tcfg['defaults']['importance'], - 'status' => $tcfg['status']['draft']); - - foreach($ck2d as $prop => $defa) { - $tcase->$prop = property_exists($obj, $prop) ? - $tcfg[$prop][$obj->$prop->name] : $defa; - } - // -------------------------------------------------------------- - - // -------------------------------------------------------------- - if(property_exists($obj, 'steps')) { - $tcase->steps = []; - $sk2d = array('actions' => '', - 'expected_results' => ''); - foreach($obj->steps as $stepObj) { - foreach($sk2d as $key => $value) { - if (is_array($stepObj->$key)) { - $stepObj->$key = "
    " . implode("\n", $stepObj->$key) . "
    "; - } - } - $tcase->steps[] = $stepObj; - } - } - // -------------------------------------------------------------- - - return $tcase; - } - - - /** - * - * - */ - private function checkRelatives($ctx) - { - $testProjectID = $ctx->testProjectID; - $testSuiteID = $ctx->testSuiteID; - if($testProjectID <= 0) { - throw new Exception("Test Project ID is invalid (<=0)"); - } - - if($testSuiteID <= 0) { - throw new Exception("Test Suite ID is invalid (<=0)"); - } - - $pinfo = $this->tprojectMgr->get_by_id($testProjectID); - if( is_null($pinfo) ) { - throw new Exception("Test Project ID is invalid (does not exist)"); - } - - $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); - if( is_null($pinfo) ) { - throw new Exception("Test Suite ID is invalid (does not exist)"); - } - - if( $testProjectID != $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID,$testSuiteID) ) { - throw new Exception("Test Suite does not belong to Test Project ID"); - } - } - - - /** - * checks if a user has requested right on test project, test plan pair. - * - * @param string $rightToCheck one of the rights defined in rights table - * @param boolean $checkPublicPrivateAttr (optional) - * @param map $context (optional) - * keys tproject_id,tplan_id (both are also optional) - * - * @return boolean - * @access protected - * - * - */ - protected function userHasRight($rightToCheck,$checkPublicPrivateAttr=false, - $context=null) - { - $status_ok = true; - - // for global rights context is NULL - if( is_null($context) ) { - $tproject_id = 0; - $tplan_id = null; - } else { - $tproject_id = intval(isset($context['tproject_id']) ? - $context['tproject_id'] : 0); - - $tplan_id = null; - if(isset($context['tplan_id'])) { - $tplan_id = intval($context['tplan_id']); - } - - if( $tproject_id <= 0 && !is_null($tplan_id) ) { - // get test project from test plan - $dummy = $this->tplanMgr->get_by_id($tplanid,array('output' => 'minimun')); - $tproject_id = intval($dummy['tproject_id']); - } - } - - // echo $rightToCheck; - if(!$this->user->hasRight($this->db,$rightToCheck, - $tproject_id,$tplan_id,$checkPublicPrivateAttr)) { - $status_ok = false; - } - return $status_ok; - } - - /** - * "keyword" - * "notes" - * "testProject": {"prefix":"APR"} - */ - public function createKeyword() { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - $item = json_decode($request->getBody()); - if(is_null($item)) { - throw new Exception("Fatal Error " . __METHOD__ . " json_decode(requestBody) is NULL", 1); - } - - // create obj with standard properties - $pfx = $item->testProject->prefix; - $pid = $this->tprojectMgr->get_by_prefix((string)$pfx); - if( null == $pid ) { - $op['status'] = 'ko'; - $op['message'] = "Can't get test project ID"; - } else { - $pid = $pid['id']; - $ou = $this->tprojectMgr->addKeyword($pid,$item->keyword,$item->notes); - $op = array('status' => 'ok', 'message' => 'ok', 'id' => -1); - if( ($op['id'] = $ou['id']) <= 0) { - $op['status'] = 'ko'; - $op['message'] = $ou['msg']; - } - } - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - echo json_encode($op); - } - - - /** - * - * @param mixed idCard identifies test plan via apikey - * - */ - public function getPlanBuilds($idCard) { - $op = array('status' => 'ok', 'message' => 'ok', 'items' => null); - $tplan = $this->tplanMgr->getByAPIKey($idCard); - - if( !is_null($tplan) ) { - $items = $this->tplanMgr->get_builds($tplan['id']); - $op['items'] = (!is_null($items) && count($items) > 0) ? $items : null; - } else { - $op['message'] = "No Test Plan identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - } - - echo json_encode($op); - } - - - /** - * - * @param string id: build id - * @param string [notes] - * @param string [active] - * @param string [open] - * @param string [releasedate]: format YYYY-MM-DD; - * @param int [copytestersfrombuild] - * - * step 1) is a number ? - * will be considered a target build id. - * check will be done to verify that is a valid - * build id inside the test plan. - * - * step 2) is a string ? - * will be used as build name to search inside - * the test plan. - * - * if check is OK, tester assignments will be copied. - * - */ - public function updateBuild($id) { - - $op = array('status' => 'ko', 'message' => 'ko', - 'details' => array(), 'id' => -1); - - $rightToCheck = "testplan_create_build"; - - // need to get input, before doing right checks, - // because right can be tested against in this order - // Test Plan Right - // Test Project Right - // Default Right - $request = $this->app->request(); - $item = json_decode($request->getBody()); - if( null == $item ) { - $this->byeHTTP500(); - } - - - $statusOK = true; - if( intval($id) <= 0 ) { - $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . - 'id - the build ID'; - $statusOK = false; - } - - if( $statusOK ) { - $build = $this->buildMgr->get_by_id( $id ); - - if( null == $build ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_INVALID_BUILDID'],$id); - $this->app->status(404); - } - } - - if( $statusOK ) { - $tplan = $this->tplanMgr->get_by_id( $build['testplan_id'] ); - - // Ready to check user permissions - $context = array('tplan_id' => $tplan['id'], - 'tproject_id' => $tplan['testproject_id']); - - if( !$this->userHasRight($rightToCheck,TRUE,$context) ) { - $statusOK = false; - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = - sprintf($msg,$rightToCheck,$this->user->login, - $context['tproject_id'],$context['tplan_id']); - $this->app->status(403); - } - } - - // Go ahead, try to update build!! - if( $statusOK ) { - - // Step 1 - Check if build name already exists - if( property_exists($item,'name') ) { - if( $this->tplanMgr->check_build_name_existence( - $tplan['id'],$item->name,$id) ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_BUILDNAME_ALREADY_EXISTS'], - $item->name, $id); - $this->app->status(409); - } - } - } - - // Step 2 - Finally Update It!! - if( $statusOK ) { - - $k2check = array('is_open', 'name', - 'release_candidate', - 'notes','commit_id','tag', - 'branch','is_active','active', - 'releasedate','release_date', - 'copy_testers_from_build', - 'copytestersfrombuild'); - - $buildProp = array('name' => 'name', - 'tplan_id' => 'tplan_id', - 'release_date' => 'release_date', - 'releasedate' => 'release_date', - 'active' => 'is_active', - 'is_active' => 'is_active', - 'notes' => 'notes', - 'commit_id' => 'commit_id', - 'tag' => 'tag', 'branch' => 'branch', - 'release_candidate' =>'release_candidate', - 'is_open' => 'is_open', - 'copytestersfrombuild' => - 'copytestersfrombuild', - 'copy_testers_from_build' => - 'copytestersfrombuild'); - - $skipKey = array(); - $buildObj = new stdClass(); - $attr = array(); - foreach( $k2check as $key ) { - $translate = $buildProp[$key]; - if( !isset($skipKey[$translate]) ) { - - // init with value got from DB. - if( isset($build[$translate]) ) { - $buildObj->$translate = $build[$translate]; - } - - if( property_exists($item, $key) ) { - $buildObj->$translate = $item->$key; - $skipKey[$translate] = true; - } - - if( property_exists($buildObj, $translate) ) { - $attr[$translate] = $buildObj->$translate; - } - } - } - - // key 2 check - // $id,$name,$notes,$active=null,$open=null, - // $release_date='',$closed_on_date='') { - - /* - $k2check = array('name','notes','active','is_open', - 'release_date'); - - foreach( $k2check as $key ) { - if( property_exists($item, $key) ) { - $$key = $item->$key; - } else { - $$key = $build[$key]; - } - } - - $ox = $this->buildMgr->update($id,$name, - $notes,$active,$is_open,$release_date); - */ - $ox = $this->buildMgr->update($build['id'], - $buildObj->name,$buildObj->notes,$attr); - - if( $ox ) { - $op = array('status' => 'ok', 'message' => 'ok', - 'details' => array(), 'id' => $id); - - // Special processing Build Closing/Opening - // we need also to manage close on date. - if( property_exists($item,'is_open') ) { - $oio = intval($build['is_open']); - $nio = intval($item->is_open); - if( $oio != $nio ) { - if( $nio ) { - $this->buildMgr->setOpen($id); - } else { - $this->buildMgr->setClosed($id); - } - } - } - - - } - } - - echo json_encode($op); - } - - /** - * body will contain an array of objects - * that can be - * {'name': platform name} - * {'id': platform id} - * - * Check if done to understand if all platforms - * exist before doing any action - * - * - */ - public function addPlatformsToTestPlan($tplan_id) { - $op = array('status' => 'ko', 'message' => 'ko', 'id' => -1); - try { - $request = $this->app->request(); - $plat2link = json_decode($request->getBody()); - - $op = array('status' => 'ok', 'message' => 'ok'); - $statusOK = true; - if (null == $plat2link || !is_array($plat2link)) { - $statusOK = false; - $op['status'] = 'ko'; - $op['message'] = 'Bad Body'; - } - - if ($statusOK) { - // Validate Test plan existence. - // Get Test Project ID before doing anything - $getOpt = array('output' => 'testPlanFields','active' => 1, - 'testPlanFields' => 'id,testproject_id,is_public'); - - $testPlan = $this->tplanMgr->get_by_id($tplan_id,$getOpt); - $statusOK = !is_null($testPlan); - - if ($statusOK) { - $tproject_id = $testPlan['testproject_id']; - } else { - $op['status'] = 'ko'; - $op['message'] = 'Invalid Test Plan ID'; - } - } - - if ($statusOK) { - // Get all test project platforms, then validate - $platMgr = new tlPlatform($this->db,$tproject_id); - $platDomain = $platMgr->getAll(); - $idToLink = []; - $op['message'] = []; - - foreach ($plat2link as $accessObj) { - $checkOK = false; - if (property_exists($accessObj, 'name')) { - $needle = trim($accessObj->name); - foreach ($platDomain as $target) { - if ($target['name'] == $needle) { - $checkOK = true; - $idToLink[$target['id']] = $target['id']; - } - } - $statusOK = $statusOK && $checkOK; - if ($checkOK == false) { - $op['message'][] = "Platform with name:" . - $needle . - " does not exist"; - } - } - - if (property_exists($accessObj, 'id')) { - $needle = intval($accessObj->id); - foreach ($platDomain as $target) { - if ($target['id'] == $needle) { - $checkOK = true; - $idToLink[$target['id']] = $target['id']; - } - } - $statusOK = $statusOK && $checkOK; - if ($checkOK == false) { - $op['message'][] = "Platform with id:" . - $needle . - " does not exist"; - } - } - } - - $op['status'] = $statusOK; - } - - if ($statusOK) { - $p2link = []; - // Finally link platforms, if not linked yet - $gOpt = array('outputFormat' => 'mapAccessByID'); - $linked = (array)$platMgr->getLinkedToTestplan($tplan_id,$gOpt); - foreach ($idToLink as $plat_id) { - if (!isset($linked[$plat_id])) { - $p2link[$plat_id]=$plat_id; - } - } - if (count($p2link) >0){ - $platMgr->linkToTestplan($p2link,$tplan_id); - } - } - - if ($op['status']) { - $op['message'] = 'ok'; - } - } catch (Exception $e) { - $this->app->status(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - echo json_encode($op); - } - - - - - /** - * - */ - function byeHTTP500($msg=null) { - $op = array(); - if( null == $msg ) { - $msg = 'TestLink Fatal Error - Malformed Request Body - ' . - ' json_decode() issue'; - } - $op['details'][] = sprintf($msg); - $this->app->status(500); - echo json_encode($op); - exit(); // Bye! - } - - /** - * - */ - function msgFromException($e) - { - return $e->getMessage() . - ' - offending line number: ' . $e->getLine(); - } + + * @package TestLink + * @since 1.9.7 + * + * Implemented using Slim framework Version 2.2.0 + * + * + * References + * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ + * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment + * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item + * http://www.redmine.org/projects/redmine/wiki/Rest_api + * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ + * https://github.com/educoder/pest/blob/master/examples/intouch_example.php + * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data + * + * http://phptrycatch.blogspot.it/ + * http://nitschinger.at/A-primer-on-PHP-exceptions + * + * + * + */ +require_once '../../../../config.inc.php'; +require_once 'common.php'; +require_once 'Slim/Slim.php'; +\Slim\Slim::registerAutoloader(); + +/** + * + * @author Francisco Mancardi + * @package TestLink + */ +class tlRestApi +{ + + public static $version = "2.1.1"; + + /** + * The DB object used throughout the class + * + * @access protected + */ + protected $db = null; + + protected $tables = null; + + protected $tcaseMgr = null; + + protected $tprojectMgr = null; + + protected $tsuiteMgr = null; + + protected $tplanMgr = null; + + protected $tplanMetricsMgr = null; + + protected $reqSpecMgr = null; + + protected $reqMgr = null; + + protected $platformMgr = null; + + protected $buildMgr = null; + + protected $cfieldMgr = null; + + /** + * userID associated with the apiKey provided + */ + protected $userID = null; + + /** + * UserObject associated with the userID + */ + protected $user = null; + + /** + * array where all the args are stored for requests + */ + protected $args = null; + + /** + * array where error codes and messages are stored + */ + protected $errors = array(); + + /** + * The api key being used to make a request + */ + protected $apiKey = null; + + /** + * boolean to allow a method to invoke another method and avoid double auth + */ + protected $authenticated = false; + + /** + * The version of a test case that is being used + */ + /** + * This value is setted in following method: + */ + protected $tcVersionID = null; + + protected $versionNumber = null; + + protected $debugMsg; + + protected $cfg; + + protected $apiLogPathName; + + protected $l10n; + + /** + */ + public function __construct() + { + + // We are following Slim naming convention + $this->app = new \Slim\Slim(); + $this->app->contentType('application/json'); + + $tl = array( + 'API_MISSING_REQUIRED_PROP' => null, + 'API_TESTPLAN_ID_DOES_NOT_EXIST' => null, + 'API_TESTPLAN_APIKEY_DOES_NOT_EXIST' => null, + 'API_BUILDNAME_ALREADY_EXISTS' => null, + 'API_INVALID_BUILDID' => null + ); + + $this->l10n = init_labels($tl); + + // GET Routes + // test route with anonymous function + $this->app->get('/who', + function (): void { + echo __CLASS__ . ' : You have called the Get Route /who'; + }); + + // using middleware for authentication + // https://docs.slimframework.com/routing/middleware/ + // + $this->app->get('/whoAmI', array( + $this, + 'authenticate' + ), array( + $this, + 'whoAmI' + )); + + $this->app->get('/superman', array( + $this, + 'authenticate' + ), array( + $this, + 'superman' + )); + + $this->app->get('/testprojects', array( + $this, + 'authenticate' + ), array( + $this, + 'getProjects' + )); + + $this->app->get('/testprojects/:id', array( + $this, + 'authenticate' + ), array( + $this, + 'getProjects' + )); + $this->app->get('/testprojects/:id/testcases', + array( + $this, + 'authenticate' + ), array( + $this, + 'getProjectTestCases' + )); + $this->app->get('/testprojects/:id/testplans', + array( + $this, + 'authenticate' + ), array( + $this, + 'getProjectTestPlans' + )); + + $this->app->get('/testplans/:id/builds', array( + $this, + 'authenticate' + ), array( + $this, + 'getPlanBuilds' + )); + + // POST Routes + $this->app->post('/builds', array( + $this, + 'authenticate' + ), array( + $this, + 'createBuild' + )); + + $this->app->post('/testprojects', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestProject' + )); + + $this->app->post('/executions', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestCaseExecution' + )); + + $this->app->post('/testplans', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestPlan' + )); + + $this->app->post('/testplans/:id', array( + $this, + 'authenticate' + ), array( + $this, + 'updateTestPlan' + )); + + $this->app->post('/testplans/:id/platforms', + array( + $this, + 'authenticate' + ), array( + $this, + 'addPlatformsToTestPlan' + )); + + $this->app->post('/testsuites', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestSuite' + )); + + $this->app->post('/testcases', array( + $this, + 'authenticate' + ), array( + $this, + 'createTestCase' + )); + + $this->app->post('/keywords', array( + $this, + 'authenticate' + ), array( + $this, + 'createKeyword' + )); + + // update routes + $this->app->post('/builds/:id', array( + $this, + 'authenticate' + ), array( + $this, + 'updateBuild' + )); + + $this->apiLogPathName = '/var/testlink/rest-api.log'; + + $this->db = new database(DB_TYPE); + $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); + doDBConnect($this->db, database::ONERROREXIT); + + $this->tcaseMgr = new testcase($this->db); + $this->tprojectMgr = new testproject($this->db); + $this->tsuiteMgr = new testsuite($this->db); + + $this->tplanMgr = new testplan($this->db); + $this->tplanMetricsMgr = new tlTestPlanMetrics($this->db); + $this->reqSpecMgr = new requirement_spec_mgr($this->db); + $this->reqMgr = new requirement_mgr($this->db); + $this->cfieldMgr = $this->tprojectMgr->cfield_mgr; + $this->buildMgr = new build_mgr($this->db); + + $this->tables = $this->tcaseMgr->getDBTables(); + + $this->cfg = array(); + $conf = config_get('results'); + foreach ($conf['status_label_for_exec_ui'] as $key => $label) { + $this->cfg['exec']['statusCode'][$key] = $conf['status_code'][$key]; + } + + $this->cfg['exec']['codeStatus'] = array_flip( + $this->cfg['exec']['statusCode']); + + $this->cfg['tcase']['executionType'] = config_get('execution_type'); + $this->cfg['tcase']['status'] = config_get('testCaseStatus'); + $this->cfg['tcase']['executionType'] = config_get('execution_type'); + + $x = config_get('importance'); + $this->cfg['tcase']['importance'] = []; + foreach ($x['code_label'] as $code => $label) { + $this->cfg['tcase']['importance'][$label] = $code; + } + + // DEFAULTS + $this->cfg['tcase']['defaults']['executionType'] = $this->cfg['tcase']['executionType']['manual']; + + $this->cfg['tcase']['defaults']['importance'] = config_get( + 'testcase_importance_default'); + + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /** + */ + public function authenticate(\Slim\Route $route) + { + $apiKey = null; + if (is_null($apiKey)) { + $request = $this->app->request(); + $hh = $request->headers(); + + if (isset($hh['APIKEY'])) { + $apiKey = $hh['APIKEY']; + } else { + $apiKey = $hh['PHP_AUTH_USER']; + } + } + $sql = "SELECT id FROM {$this->tables['users']} " . "WHERE script_key='" . + $this->db->prepare_string($apiKey) . "'"; + + $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); + if ($ok = ! is_null($this->userID)) { + $this->user = tlUser::getByID($this->db, $this->userID); + } else { + $this->app->status(400); + echo json_encode( + array( + 'status' => 'ko', + 'message' => 'authentication error' + )); + $this->app->stop(); + } + + return $ok; + } + + /** + */ + public function whoAmI() + { + echo json_encode( + array( + 'name' => __CLASS__ . ' : You have called Get Route /whoAmI' + )); + } + + /** + */ + public function superman() + { + echo json_encode( + array( + 'name' => __CLASS__ . + ' : You have called the Get Route /superman' + )); + } + + /** + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME + */ + public function getProjects($idCard = null, $opt = null) + { + $options = array_merge(array( + 'output' => 'rest' + ), (array) $opt); + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'item' => null + ); + if (is_null($idCard)) { + $opOptions = array( + 'output' => 'array_of_map', + 'order_by' => " ORDER BY name ", + 'add_issuetracker' => true, + 'add_reqmgrsystem' => true + ); + $op['item'] = $this->tprojectMgr->get_accessible_for_user( + $this->userID, $opOptions); + } else { + $opOptions = array( + 'output' => 'map', + 'field_set' => 'prefix', + 'format' => 'simple' + ); + $zx = $this->tprojectMgr->get_accessible_for_user($this->userID, + $opOptions); + + $targetID = null; + if (($safeID = intval($idCard)) > 0) { + if (isset($zx[$safeID])) { + $targetID = $safeID; + } + } else { + // Will consider id = name or prefix + foreach ($zx as $itemID => $value) { + if (strcmp($value['name'], $idCard) == 0 || + strcmp($value['prefix'], $idCard) == 0) { + $targetID = $itemID; + break; + } + } + } + + if (null != $targetID) { + $op['item'] = $this->tprojectMgr->get_by_id($targetID); + } + } + + // Developer (silly?) information + // json_encode() transforms maps in objects. + switch ($options['output']) { + case 'internal': + return $op['item']; + break; + + case 'rest': + default: + echo json_encode($op); + break; + } + } + + /** + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME Or Prefix + */ + public function getProjectTestPlans($idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tproject = $this->getProjects($idCard, array( + 'output' => 'internal' + )); + + if (! is_null($tproject)) { + $items = $this->tprojectMgr->get_all_testplans($tproject['id']); + $op['items'] = (! empty($items)) ? $items : null; + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + $this->app->status(500); + } + + echo json_encode($op); + } + + /** + * Will return LATEST VERSION of each test case. + * Does return test step info ? + * + * @param + * mixed idCard if provided identifies test project + * if intval() > 0 => is considered DBID + * else => is used as PROJECT NAME + */ + public function getProjectTestCases($idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tproject = $this->getProjects($idCard, array( + 'output' => 'internal' + )); + + if (! is_null($tproject)) { + $tcaseIDSet = array(); + $this->tprojectMgr->get_all_testcases_id($tproject['id'], + $tcaseIDSet); + + if (! empty($tcaseIDSet)) { + $op['items'] = array(); + foreach ($tcaseIDSet as $tcaseID) { + $item = $this->tcaseMgr->getLastVersionInfo($tcaseID); + $item['keywords'] = $this->tcaseMgr->get_keywords_map( + $tcaseID, $item['tcversion_id']); + $item['customfields'] = $this->tcaseMgr->get_linked_cfields_at_design( + $tcaseID, $item['tcversion_id'], null, null, + $tproject['id']); + $op['items'][] = $item; + } + } + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + } + + echo json_encode($op); + } + + /** + * $item->name + * $item->prefix + * $item->notes + * $item->active + * $item->public + * $item->options + * $item->options->requirementsEnabled + * $item->options->testPriorityEnabled + * $item->options->automationEnabled + * $item->options->inventoryEnabled + */ + public function createTestProject() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + + try { + // Check user grants for requested operation + // This is a global right + $rightToCheck = "mgt_modify_product"; + if ($this->userHasRight($rightToCheck)) { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op['id'] = $this->tprojectMgr->create($item, + array( + 'doChecks' => true + )); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + } else { + $this->app->status(403); + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, 0, 0); + } + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + echo json_encode($op); + } + + /** + * Request Body + * + * $ex->testPlanID + * $ex->buildID + * $ex->platformID -> optional + * $ex->testCaseExternalID + * $ex->notes + * $ex->statusCode + * + * + * Checks to be done + * + * A. User right & Test plan existence + * user has right to execute on target Test plan? + * this means also that: Test plan ID exists ? + * + * B. Build + * does Build ID exist on target Test plan ? + * is Build enable to execution ? + * + * C. Platform + * do we need a platform ID in order to execute ? + * is a platform present on provided data ? + * does this platform belong to target Test plan ? + * + * D. Test case identity + * is target Test case part of Test plan ? + * + * + * Z. Other mandatory information + * We are not going to check for other mandatory info + * like: mandatory custom fields. (if we will be able in future to manage it) + */ + public function createTestCaseExecution() + { + $op = array( + 'status' => ' ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $ex = json_decode($request->getBody()); + $util = $this->checkExecutionEnvironment($ex); + + // Complete missing propertie + if (! property_exists($ex, 'platformID')) { + $ex->platformID = 0; + } + + if (! property_exists($ex, 'executionType')) { + $ex->executionType = $this->cfg['tcase']['executionType']['auto']; + } + + // If we are here this means we can write execution status!!! + $ex->testerID = $this->userID; + foreach ($util as $prop => $value) { + $ex->$prop = $value; + } + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tplanMgr->writeExecution($ex); + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $e->getMessage(); + } + echo json_encode($op); + } + + // + // Support methods + // + private function checkExecutionEnvironment($ex) + { + $platform = 0; + + // Test plan ID exists and is ACTIVE + $msg = 'invalid Test plan ID'; + $getOpt = array( + 'output' => 'testPlanFields', + 'active' => 1, + 'testPlanFields' => 'id,testproject_id,is_public' + ); + $status_ok = ! is_null( + $testPlan = $this->tplanMgr->get_by_id($ex->testPlanID, $getOpt)); + + if ($status_ok) { + // user has right to execute on Test plan ID + // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) + $msg = 'user has no right to execute'; + $status_ok = $this->user->hasRight($this->db, 'testplan_execute', + $testPlan['testproject_id'], $ex->testPlanID, true); + } + + if ($status_ok) { + // Check if couple (buildID,testPlanID) is valid + $msg = '(buildID,testPlanID) couple is not valid'; + $getOpt = array( + 'fields' => 'id,active,is_open', + 'buildID' => $ex->buildID, + 'orderBy' => null + ); + $status_ok = ! is_null( + $build = $this->tplanMgr->get_builds($ex->testPlanID, null, null, + $getOpt)); + + if ($status_ok) { + // now check is execution can be done againts this build + $msg = 'Build is not active and/or closed => execution can not be done'; + $status_ok = $build[$ex->buildID]['active'] && + $build[$ex->buildID]['is_open']; + } + } + + if ($status_ok && property_exists($ex, 'platformID')) { + // Get Test plan platforms + $platform = $ex->platformID; + + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => false + ); + $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID, + $getOpt); + + if (! ($hasPlatforms = ! is_null($platformSet)) && $platform != 0) { + $status_ok = false; + $msg = 'You can not execute against a platform, because Test plan has no platforms'; + } + + if ($status_ok && $hasPlatforms) { + if ($platform == 0) { + $status_ok = false; + $msg = 'Test plan has platforms, you need to provide one in order to execute'; + } elseif (! isset($platformSet[$platform])) { + $status_ok = false; + $msg = '(platform,test plan) couple is not valid'; + } + } + } + + if ($status_ok) { + // Test case check + $msg = 'Test case does not exist'; + + $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); + if ($status_ok = ($tcaseID > 0)) { + $msg = 'Test case doesn not belong to right test project'; + $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase( + $tcaseID, 0); + $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); + } + + if ($status_ok) { + // Does this test case is linked to test plan ? + $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; + $getFilters = array( + 'testplan_id' => $ex->testPlanID, + 'platform_id' => $platform + ); + + $getOpt = array( + 'output' => 'simple' + ); + $links = $this->tcaseMgr->get_linked_versions($tcaseID, + $getFilters, $getOpt); + $status_ok = ! is_null($links); + } + } + + if ($status_ok) { + // status code is OK ? + $msg = 'not run status is not a valid execution status (can not be written to DB)'; + $status_ok = ($ex->statusCode != + $this->cfg['exec']['statusCode']['not_run']); + + if ($status_ok) { + $msg = 'Requested execution status is not configured on TestLink'; + $status_ok = isset( + $this->cfg['exec']['codeStatus'][$ex->statusCode]); + } + } + + if ($status_ok) { + $msg = 'Last Step Get testCaseVersionNumber'; + $ret = new stdClass(); + $ret->testProjectID = $testPlan['testproject_id']; + $ret->testCaseVersionID = key($links); + + $status_ok = false; + if (isset( + $links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version'])) { + $ret->testCaseVersionNumber = $links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version']; + $status_ok = true; + } + } + + if (! $status_ok) { + throw new Exception($msg); + } + + return $ret; + } + + /** + * 'name' + * 'testProjectID' + * 'notes' + * 'active' + * 'is_public' + */ + public function createTestPlan() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $opeOpt = array( + 'setSessionProject' => false, + 'doChecks' => true + ); + $op['id'] = $this->tplanMgr->createFromObject($item, $opeOpt); + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $e->getMessage(); + } + echo json_encode($op); + } + + /** + * 'name' + * 'testProjectID' + * 'notes' + * 'active' + * 'is_public' + */ + public function updateTestPlan($id) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $item->id = $id; + $op['id'] = $this->tplanMgr->updateFromObject($item); + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $e->getMessage(); + } + echo json_encode($op); + } + + /** + * 'name' + * 'testProjectID' + * 'parentID' + * 'notes' + * 'order' + */ + public function createTestSuite() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tsuiteMgr->createFromObject($item, + array( + 'doChecks' => true + )); + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . msgFromException($e); + } + echo json_encode($op); + } + + /** + * "name" + * "testSuite": {"id": xxx} + * "testProject" : {"id": xxx} or {"prefix": yyy} + * "authorLogin" + * "authorID" + * + * "summary" can be a string or an array of strings + * "preconditions" can be a string or an array of strings + * + * "importance" - see const.inc.php for domain + * "executionType" - see ... for domain + * "order" + * + * "estimatedExecutionDuration" // to be implemented + * "steps": array of objects + * IMPORTANT NOTICE: actions and expected_results + * Can be string or array of strings + * [ + * { "step_number":1, + * "actions": "red", + * "expected_results": "#f00", + * "execution_type":1 + * }, + * { "step_number":12, + * "actions": "red12", + * "expected_results": "#f00", + * "execution_type":2 + * } + * ] + */ + public function createTestCase() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + + // It will be important to document WHY!!! + // AFAIK some issues with json_decode() + // https://stackoverflow.com/questions/34486346/new-lines-and-tabs-in-json-decode-php-7 + $body = str_replace("\n", '', $request->getBody()); + $item = json_decode($body); + + if (is_null($item)) { + throw new Exception( + "Fatal Error " . __METHOD__ . + " json_decode(requesBody) is NULL", 1); + } + + // create obj with standard properties + try { + $tcase = $this->buildTestCaseObj($item); + $this->checkRelatives($tcase); + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = 'After buildTestCaseObj() >> ' . + $this->msgFromException($e); + echo json_encode($op); + return; + } + + $ou = $this->tcaseMgr->createFromObject($tcase); + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'id' => - 1 + ); + if (($op['id'] = $ou['id']) <= 0) { + $op['status'] = 'ko'; + $op['message'] = $ou['msg']; + $this->app->status(409); + } + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + echo json_encode($op); + } + + /** + * + * @param + * mixed testplan + * + * step 1) testplan is a number ? + * use it as test plan id + * + * step 2) testplan is a string ? + * use it as test plan apikey + * + * Is not possible to consider testplan as name + * becase name can be used in several test projects. + * One option can be request testprojectname/testplanname + * + * @param + * string name: build name + * @param + * string [notes] + * @param + * string [active] + * @param + * string [open] + * @param + * string [releasedate]: format YYYY-MM-DD; + * @param + * int [copytestersfrombuild] + * + * step 1) is a number ? + * will be considered a target build id. + * check will be done to verify that is a valid + * build id inside the test plan. + * + * step 2) is a string ? + * will be used as build name to search inside + * the test plan. + * + * if check is OK, tester assignments will be copied. + * + */ + public function createBuild() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'details' => array(), + 'id' => - 1 + ); + + $rightToCheck = "testplan_create_build"; + + // need to get input, before doing right checks, + // because right can be tested against in this order + // Test Plan Right + // Test Project Right + // Default Right + $request = $this->app->request(); + $item = json_decode($request->getBody()); + if (null == $item) { + $this->byeHTTP500(); + } + + $statusOK = true; + $build = new stdClass(); + + $reqProps = array( + 'testplan', + 'name' + ); + foreach ($reqProps as $prop) { + if (! property_exists($item, $prop)) { + $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . + $prop; + $statusOK = false; + } + } + + if ($statusOK) { + $build->name = $item->name; + + if (is_numeric($item->testplan)) { + // Check if is a valid test plan + // Get it's test project id + $tplan_id = intval($item->testplan); + $tplan = $this->tplanMgr->get_by_id($tplan_id); + + if (null == $tplan) { + $statusOK = false; + $op['details'][] = sprintf( + $this->l10n['API_TESTPLAN_ID_DOES_NOT_EXIST'], + $item->testplan); + $this->app->status(404); + } + } else { + $tplanAPIKey = trim($item->testplan); + $tplan = $this->tplanMgr->getByAPIKey($tplanAPIKey); + if (null == $tplan) { + $statusOK = false; + $op['details'][] = sprintf( + $this->l10n['API_TESTPLAN_APIKEY_DOES_NOT_EXIST'], + $item->testplan); + $this->app->status(404); + } + } + } + + if ($statusOK) { + // Ready to check user permissions + $context = array( + 'tplan_id' => $tplan['id'], + 'tproject_id' => $tplan['testproject_id'] + ); + + if (! $this->userHasRight($rightToCheck, true, $context)) { + $statusOK = false; + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, $this->user->login, + $context['tproject_id'], $context['tplan_id']); + $this->app->status(403); + } + } + + // Go ahead, try create build!! + // Step 1 - Check if build name already exists + if ($statusOK) { + $build->id = $this->tplanMgr->get_build_id_by_name( + $context['tplan_id'], $build->name); + + if ($build->id > 0) { + $statusOK = false; + $op['message'] = sprintf( + $this->l10n['API_BUILDNAME_ALREADY_EXISTS'], $build->name, + $build->id); + $this->app->status(409); + } + + $build->tplan_id = $context['tplan_id']; + } + + // Step 2 - Finally Create It!! + if ($statusOK) { + // key 2 check with default value is parameter is missing + $k2check = array( + 'is_open' => 1, + 'release_candidate' => null, + 'notes' => null, + 'commit_id' => null, + 'tag' => null, + 'branch' => null, + 'is_active' => 1, + 'active' => 1, + 'releasedate' => null, + 'release_date' => null, + 'copy_testers_from_build' => null, + 'copytestersfrombuild' => null + ); + + $buildProp = array( + 'tplan_id' => 'tplan_id', + 'release_date' => 'release_date', + 'releasedate' => 'release_date', + 'active' => 'is_active', + 'is_active' => 'is_active', + 'notes' => 'notes', + 'commit_id' => 'commit_id', + 'tag' => 'tag', + 'branch' => 'branch', + 'release_candidate' => 'release_candidate', + 'is_open' => 'is_open', + 'copytestersfrombuild' => 'copytestersfrombuild', + 'copy_testers_from_build' => 'copytestersfrombuild' + ); + + $skipKey = array(); + foreach ($k2check as $key => $value) { + $translate = $buildProp[$key]; + if (! isset($skipKey[$translate])) { + $build->$translate = $value; + if (property_exists($item, $key)) { + $build->$translate = $item->$key; + $skipKey[$translate] = true; + } + } + } + + $itemID = $this->buildMgr->createFromObject($build); + if ($itemID > 0) { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'details' => array(), + 'id' => $itemID + ); + } + } + + echo json_encode($op); + } + + /** + */ + private function getUserIDByAttr($user) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $run = false; + $uid = - 1; + + $sql = "/* $debugMsg */ SELECT id FROM {$this->tables['users']} "; + if (property_exists($user, 'login')) { + $run = true; + $sql .= " WHERE login='" . + $this->db->prepare_string(trim($user->login)) . "'"; + } + + if (! $run && property_exists($user, 'id')) { + $run = true; + $sql .= " WHERE id=" . intval($user->id); + } + + if ($run) { + $rs = $this->db->get_recordset($sql); + } + + return ($run && ! is_null($rs)) ? $rs[0]['id'] : $uid; + } + + /** + */ + private function buildTestCaseObj(&$obj) + { + if (is_null($obj)) { + throw new Exception("Fatal Error - " . __METHOD__ . " arg is NULL"); + } + + $tcase = new stdClass(); + $tcase->authorID = - 1; + $tcase->steps = null; + $tcase->testProjectID = - 1; + + $accessKey = array(); + $isOK = true; + + // Knowing author is critic, because rights are related to user. + // Another important thing: + // do we need to check that author when provided, has rights to do + // requested action? + // If we do not do this check, we will find in test cases created + // by people that do not have rights. + // May be is time to add a field that provide info about source of action + // GUI, API + if (property_exists($obj, 'author') && + property_exists($obj->author, 'login') || + property_exists($obj->author, 'id')) { + $tcase->authorID = $this->getUserIDByAttr($obj->author); + } + + // Last resort: get author from credentials use to make the call. + // no error message returned. + if ($tcase->authorID <= 0) { + $tcase->authorID = $this->userID; + } + + // Mandatory attributes + $ma = array( + 'name' => null, + 'testProject' => array( + 'id', + 'prefix' + ), + 'testSuite' => array( + 'id' + ) + ); + + foreach ($ma as $key => $dummy) { + if (! ($isOK = $isOK && property_exists($obj, $key))) { + throw new Exception("Missing Attribute: {$key} "); + } + } + + foreach ($ma as $key => $attr) { + if (! is_null($attr)) { + $attrOK = false; + foreach ($attr as $ak) { + $accessKey[$key][$ak] = property_exists($obj->$key, $ak); + $attrOK = $attrOK || $accessKey[$key][$ak]; + } + + if (! $attrOK) { + $msg = "Attribute: {$key} mandatory key ("; + if (count($attr) > 1) { + $msg .= "one of set: "; + } + $msg .= implode('/', $attr) . ") is missing"; + throw new Exception($msg); + } + } + } + + $tcase->name = trim($obj->name); + $tcase->testSuiteID = intval($obj->testSuite->id); + + $gOpt = array( + 'output' => 'array_of_map', + 'field_set' => 'prefix', + 'add_issuetracker' => false, + 'add_reqmgrsystem' => false + ); + + $msg = "Test project with "; + if ($accessKey['testProject']['id']) { + $safeID = intval($obj->testProject->id); + $gFilters = array( + 'id' => array( + 'op' => '=', + 'value' => $safeID + ) + ); + $msg .= "id={$safeID} "; + } + + if ($accessKey['testProject']['prefix']) { + $gFilters = array( + 'prefix' => array( + 'op' => '=', + 'value' => trim($obj->testProject->prefix) + ) + ); + $msg .= "prefix={$obj->testProject->prefix} "; + } + + $info = $this->tprojectMgr->get_accessible_for_user($this->userID, $gOpt, + $gFilters); + + if (is_null($info)) { + $msg .= "does not exist or you have no rights to use it"; + throw new Exception($msg, 999); + } + + $tcase->testProjectID = intval($info[0]['id']); + + $sk2d = array( + 'summary' => '', + 'preconditions' => '', + 'order' => 100, + 'estimatedExecutionTime' => 0 + ); + foreach ($sk2d as $key => $value) { + $tcase->$key = property_exists($obj, $key) ? $obj->$key : $value; + } + + // summary & preconditions + // if type is array -> generate string in this way + // - add
    +        // - concact the elements with "\n"
    +        // - add 
    + $sk2d = array( + 'summary' => '', + 'preconditions' => '' + ); + foreach ($sk2d as $key => $value) { + if (is_array($tcase->$key)) { + $tcase->$key = "
    " . implode("\n", $tcase->$key) . "
    "; + } + } + + // these are objects with name as property. + $tcfg = $this->cfg['tcase']; + $ck2d = array( + 'executionType' => $tcfg['executionType']['manual'], + 'importance' => $tcfg['defaults']['importance'], + 'status' => $tcfg['status']['draft'] + ); + + foreach ($ck2d as $prop => $defa) { + $tcase->$prop = property_exists($obj, $prop) ? $tcfg[$prop][$obj->$prop->name] : $defa; + } + + if (property_exists($obj, 'steps')) { + $tcase->steps = []; + $sk2d = array( + 'actions' => '', + 'expected_results' => '' + ); + foreach ($obj->steps as $stepObj) { + foreach ($sk2d as $key => $value) { + if (is_array($stepObj->$key)) { + $stepObj->$key = "
    " . implode("\n", $stepObj->$key) .
    +                            "
    "; + } + } + $tcase->steps[] = $stepObj; + } + } + + return $tcase; + } + + /** + */ + private function checkRelatives($ctx) + { + $testProjectID = $ctx->testProjectID; + $testSuiteID = $ctx->testSuiteID; + if ($testProjectID <= 0) { + throw new Exception("Test Project ID is invalid (<=0)"); + } + + if ($testSuiteID <= 0) { + throw new Exception("Test Suite ID is invalid (<=0)"); + } + + $pinfo = $this->tprojectMgr->get_by_id($testProjectID); + if (is_null($pinfo)) { + throw new Exception("Test Project ID is invalid (does not exist)"); + } + + $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); + if (is_null($pinfo)) { + throw new Exception("Test Suite ID is invalid (does not exist)"); + } + + if ($testProjectID != + $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID, + $testSuiteID)) { + throw new Exception("Test Suite does not belong to Test Project ID"); + } + } + + /** + * checks if a user has requested right on test project, test plan pair. + * + * @param string $rightToCheck + * one of the rights defined in rights table + * @param boolean $checkPublicPrivateAttr + * (optional) + * @param array $context + * (optional) + * keys tproject_id,tplan_id (both are also optional) + * + * @return boolean + * @access protected + * + * + */ + protected function userHasRight($rightToCheck, + $checkPublicPrivateAttr = false, $context = null) + { + $status_ok = true; + + // for global rights context is NULL + if (is_null($context)) { + $tproject_id = 0; + $tplan_id = null; + } else { + $tproject_id = intval( + isset($context['tproject_id']) ? $context['tproject_id'] : 0); + + $tplan_id = null; + if (isset($context['tplan_id'])) { + $tplan_id = intval($context['tplan_id']); + } + + if ($tproject_id <= 0 && ! is_null($tplan_id)) { + // get test project from test plan + $dummy = $this->tplanMgr->get_by_id($tplanid, + array( + 'output' => 'minimun' + )); + $tproject_id = intval($dummy['tproject_id']); + } + } + + if (! $this->user->hasRight($this->db, $rightToCheck, $tproject_id, + $tplan_id, $checkPublicPrivateAttr)) { + $status_ok = false; + } + return $status_ok; + } + + /** + * "keyword" + * "notes" + * "testProject": {"prefix":"APR"} + */ + public function createKeyword() + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $item = json_decode($request->getBody()); + if (is_null($item)) { + throw new Exception( + "Fatal Error " . __METHOD__ . + " json_decode(requestBody) is NULL", 1); + } + + // create obj with standard properties + $pfx = $item->testProject->prefix; + $pid = $this->tprojectMgr->get_by_prefix((string) $pfx); + if (null == $pid) { + $op['status'] = 'ko'; + $op['message'] = "Can't get test project ID"; + } else { + $pid = $pid['id']; + $ou = $this->tprojectMgr->addKeyword($pid, $item->keyword, + $item->notes); + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'id' => - 1 + ); + if (($op['id'] = $ou['id']) <= 0) { + $op['status'] = 'ko'; + $op['message'] = $ou['msg']; + } + } + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + echo json_encode($op); + } + + /** + * + * @param + * mixed idCard identifies test plan via apikey + * + */ + public function getPlanBuilds($idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tplan = $this->tplanMgr->getByAPIKey($idCard); + + if (! is_null($tplan)) { + $items = $this->tplanMgr->get_builds($tplan['id']); + $op['items'] = (! empty($items)) ? $items : null; + } else { + $op['message'] = "No Test Plan identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + } + + echo json_encode($op); + } + + /** + * + * @param + * string id: build id + * @param + * string [notes] + * @param + * string [active] + * @param + * string [open] + * @param + * string [releasedate]: format YYYY-MM-DD; + * @param + * int [copytestersfrombuild] + * + * step 1) is a number ? + * will be considered a target build id. + * check will be done to verify that is a valid + * build id inside the test plan. + * + * step 2) is a string ? + * will be used as build name to search inside + * the test plan. + * + * if check is OK, tester assignments will be copied. + * + */ + public function updateBuild($id) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'details' => array(), + 'id' => - 1 + ); + + $rightToCheck = "testplan_create_build"; + + // need to get input, before doing right checks, + // because right can be tested against in this order + // Test Plan Right + // Test Project Right + // Default Right + $request = $this->app->request(); + $item = json_decode($request->getBody()); + if (null == $item) { + $this->byeHTTP500(); + } + + $statusOK = true; + if (intval($id) <= 0) { + $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . + 'id - the build ID'; + $statusOK = false; + } + + if ($statusOK) { + $build = $this->buildMgr->get_by_id($id); + + if (null == $build) { + $statusOK = false; + $op['message'] = sprintf($this->l10n['API_INVALID_BUILDID'], $id); + $this->app->status(404); + } + } + + if ($statusOK) { + $tplan = $this->tplanMgr->get_by_id($build['testplan_id']); + + // Ready to check user permissions + $context = array( + 'tplan_id' => $tplan['id'], + 'tproject_id' => $tplan['testproject_id'] + ); + + if (! $this->userHasRight($rightToCheck, true, $context)) { + $statusOK = false; + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, $this->user->login, + $context['tproject_id'], $context['tplan_id']); + $this->app->status(403); + } + } + + // Go ahead, try to update build!! + if ($statusOK && property_exists($item, 'name') && + $this->tplanMgr->check_build_name_existence($tplan['id'], + $item->name, $id)) { + $statusOK = false; + $op['message'] = sprintf( + $this->l10n['API_BUILDNAME_ALREADY_EXISTS'], $item->name, $id); + $this->app->status(409); + } + + // Step 2 - Finally Update It!! + if ($statusOK) { + + $k2check = array( + 'is_open', + 'name', + 'release_candidate', + 'notes', + 'commit_id', + 'tag', + 'branch', + 'is_active', + 'active', + 'releasedate', + 'release_date', + 'copy_testers_from_build', + 'copytestersfrombuild' + ); + + $buildProp = array( + 'name' => 'name', + 'tplan_id' => 'tplan_id', + 'release_date' => 'release_date', + 'releasedate' => 'release_date', + 'active' => 'is_active', + 'is_active' => 'is_active', + 'notes' => 'notes', + 'commit_id' => 'commit_id', + 'tag' => 'tag', + 'branch' => 'branch', + 'release_candidate' => 'release_candidate', + 'is_open' => 'is_open', + 'copytestersfrombuild' => 'copytestersfrombuild', + 'copy_testers_from_build' => 'copytestersfrombuild' + ); + + $skipKey = array(); + $buildObj = new stdClass(); + $attr = array(); + foreach ($k2check as $key) { + $translate = $buildProp[$key]; + if (! isset($skipKey[$translate])) { + + // init with value got from DB. + if (isset($build[$translate])) { + $buildObj->$translate = $build[$translate]; + } + + if (property_exists($item, $key)) { + $buildObj->$translate = $item->$key; + $skipKey[$translate] = true; + } + + if (property_exists($buildObj, $translate)) { + $attr[$translate] = $buildObj->$translate; + } + } + } + + $ox = $this->buildMgr->update($build['id'], $buildObj->name, + $buildObj->notes, $attr); + + if ($ox) { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'details' => array(), + 'id' => $id + ); + + // Special processing Build Closing/Opening + // we need also to manage close on date. + if (property_exists($item, 'is_open')) { + $oio = intval($build['is_open']); + $nio = intval($item->is_open); + if ($oio != $nio) { + if ($nio) { + $this->buildMgr->setOpen($id); + } else { + $this->buildMgr->setClosed($id); + } + } + } + } + } + + echo json_encode($op); + } + + /** + * body will contain an array of objects + * that can be + * {'name': platform name} + * {'id': platform id} + * + * Check if done to understand if all platforms + * exist before doing any action + */ + public function addPlatformsToTestPlan($tplan_id) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + try { + $request = $this->app->request(); + $plat2link = json_decode($request->getBody()); + + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $statusOK = true; + if (null == $plat2link || ! is_array($plat2link)) { + $statusOK = false; + $op['status'] = 'ko'; + $op['message'] = 'Bad Body'; + } + + if ($statusOK) { + // Validate Test plan existence. + // Get Test Project ID before doing anything + $getOpt = array( + 'output' => 'testPlanFields', + 'active' => 1, + 'testPlanFields' => 'id,testproject_id,is_public' + ); + + $testPlan = $this->tplanMgr->get_by_id($tplan_id, $getOpt); + $statusOK = ! is_null($testPlan); + + if ($statusOK) { + $tproject_id = $testPlan['testproject_id']; + } else { + $op['status'] = 'ko'; + $op['message'] = 'Invalid Test Plan ID'; + } + } + + if ($statusOK) { + // Get all test project platforms, then validate + $platMgr = new tlPlatform($this->db, $tproject_id); + $platDomain = $platMgr->getAll(); + $idToLink = []; + $op['message'] = []; + + foreach ($plat2link as $accessObj) { + $checkOK = false; + if (property_exists($accessObj, 'name')) { + $needle = trim($accessObj->name); + foreach ($platDomain as $target) { + if ($target['name'] == $needle) { + $checkOK = true; + $idToLink[$target['id']] = $target['id']; + } + } + $statusOK = $statusOK && $checkOK; + if (! $checkOK) { + $op['message'][] = "Platform with name:" . $needle . + " does not exist"; + } + } + + if (property_exists($accessObj, 'id')) { + $needle = intval($accessObj->id); + foreach ($platDomain as $target) { + if ($target['id'] == $needle) { + $checkOK = true; + $idToLink[$target['id']] = $target['id']; + } + } + $statusOK = $statusOK && $checkOK; + if (! $checkOK) { + $op['message'][] = "Platform with id:" . $needle . + " does not exist"; + } + } + } + + $op['status'] = $statusOK; + } + + if ($statusOK) { + $p2link = []; + // Finally link platforms, if not linked yet + $gOpt = array( + 'outputFormat' => 'mapAccessByID' + ); + $linked = (array) $platMgr->getLinkedToTestplan($tplan_id, $gOpt); + foreach ($idToLink as $plat_id) { + if (! isset($linked[$plat_id])) { + $p2link[$plat_id] = $plat_id; + } + } + if (! empty($p2link)) { + $platMgr->linkToTestplan($p2link, $tplan_id); + } + } + + if ($op['status']) { + $op['message'] = 'ok'; + } + } catch (Exception $e) { + $this->app->status(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + echo json_encode($op); + } + + /** + */ + private function byeHTTP500($msg = null) + { + $op = array(); + if (null == $msg) { + $msg = 'TestLink Fatal Error - Malformed Request Body - ' . + ' json_decode() issue'; + } + $op['details'][] = sprintf($msg); + $this->app->status(500); + echo json_encode($op); + exit(); // Bye! + } + + /** + */ + private function msgFromException($e) + { + return $e->getMessage() . ' - offending line number: ' . $e->getLine(); + } } // class end diff --git a/lib/api/rest/v3/RestApi.class.php b/lib/api/rest/v3/RestApi.class.php index fe418bddec..cfe5bfe9ab 100644 --- a/lib/api/rest/v3/RestApi.class.php +++ b/lib/api/rest/v3/RestApi.class.php @@ -1,1703 +1,1762 @@ - - * @package TestLink - * - * Implemented using - * Slim framework Version 4.3.0 / 4.4.0 - * PHP > 7.4.0 - * - * References - * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ - * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment - * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item - * http://www.redmine.org/projects/redmine/wiki/Rest_api - * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ - * https://github.com/educoder/pest/blob/master/examples/intouch_example.php - * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data - * - * http://phptrycatch.blogspot.it/ - * http://nitschinger.at/A-primer-on-PHP-exceptions - * - * - * - */ - -require_once('../../../../config.inc.php'); -require_once('common.php'); - -use Psr\Http\Message\ServerRequestInterface as Request; -use Psr\Http\Server\RequestHandlerInterface as RequestHandler; - -use Psr\Http\Message\ResponseInterface; -use Slim\Psr7\Response; - -/** - * @author Francisco Mancardi - * @package TestLink - */ -class RestApi -{ - public static $version = "3.0"; - - - /** - * The DB object used throughout the class - * - * @access protected - */ - protected $db = null; - protected $tables = null; - - protected $tcaseMgr = null; - protected $tprojectMgr = null; - protected $tsuiteMgr = null; - protected $tplanMgr = null; - protected $tplanMetricsMgr = null; - protected $reqSpecMgr = null; - protected $reqMgr = null; - protected $platformMgr = null; - protected $buildMgr = null; - protected $cfieldMgr = null; - - - /** userID associated with the apiKey provided */ - protected $userID = null; - - /** UserObject associated with the userID */ - protected $user = null; - - /** The api key being used to make a request */ - protected $apiKey = null; - - /** boolean to allow a method to invoke another method and avoid double auth */ - protected $authenticated = false; - - /** The version of a test case that is being used */ - /** This value is setted in following method: */ - protected $tcVersionID = null; - protected $versionNumber = null; - protected $debugMsg; - - protected $cfg; - - protected $apiLogPathName; - - protected $l10n; - - - - /** - */ - public function __construct() { - - // $this->app->contentType('application/json'); - - $tl = array('API_MISSING_REQUIRED_PROP' => null, - 'API_TESTPLAN_ID_DOES_NOT_EXIST' => null, - 'API_TESTPLAN_APIKEY_DOES_NOT_EXIST' => null, - 'API_BUILDNAME_ALREADY_EXISTS' => null, - 'API_INVALID_BUILDID' => null); - - $this->l10n = init_labels($tl); - - $this->apiLogPathName = '/var/testlink/rest-api.log'; - - $this->db = new database(DB_TYPE); - $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); - doDBConnect($this->db,database::ONERROREXIT); - - - $this->tcaseMgr = new testcase($this->db); - $this->tprojectMgr = new testproject($this->db); - $this->tsuiteMgr = new testsuite($this->db); - - $this->tplanMgr = new testplan($this->db); - $this->tplanMetricsMgr = new tlTestPlanMetrics($this->db); - $this->reqSpecMgr = new requirement_spec_mgr($this->db); - $this->reqMgr = new requirement_mgr($this->db); - $this->cfieldMgr = $this->tprojectMgr->cfield_mgr; - $this->buildMgr = new build_mgr($this->db); - - $this->tables = $this->tcaseMgr->getDBTables(); - - $this->cfg = array(); - $conf = config_get('results'); - foreach($conf['status_label_for_exec_ui'] as $key => $label ) { - $this->cfg['exec']['statusCode'][$key] = $conf['status_code'][$key]; - } - - $this->cfg['exec']['codeStatus'] = array_flip($this->cfg['exec']['statusCode']); - - $this->cfg['tcase']['status'] = config_get('testCaseStatus'); - $this->cfg['tcase']['executionType'] = - config_get('execution_type'); - - $this->cfg['tcase']['executionType']['automatic'] = - $this->cfg['tcase']['executionType']['auto']; - - - $x = config_get('importance'); - $this->cfg['tcase']['importance'] = []; - foreach($x['code_label'] as $code => $label) { - $this->cfg['tcase']['importance'][$label] = $code; - } - - - // DEFAULTS - $this->cfg['tcase']['defaults']['executionType'] = - $this->cfg['tcase']['executionType']['manual']; - - $this->cfg['tcase']['defaults']['importance'] = config_get('testcase_importance_default'); - $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; - } - - - /** - * - */ - public function authenticate(Request $request, RequestHandler $handler) - { - $hh = $request->getHeaders(); - - $apiKey = null; - - // @20200317 - Not tested - // IMPORTANT NOTICE: 'PHP_AUTH_USER' - // it seems this needs special configuration - // with Apache when you use CGI Module - // http://man.hubwiz.com/docset/PHP.docset/Contents/Resources/ - // Documents/php.net/manual/en/features.http-auth.html - // - $apiKeySet = [ - 'Apikey', - 'ApiKey', - 'APIKEY', - 'PHP_AUTH_USER' - ]; - foreach( $apiKeySet as $accessKey ) { - if (isset($hh[$accessKey])) { - $apiKey = trim($hh[$accessKey][0]); - break; - } - } - - if ($apiKey != null && $apiKey != '') { - $sql = "SELECT id FROM {$this->tables['users']} " . - "WHERE script_key='" . - $this->db->prepare_string($apiKey) . "'"; - - $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); - if( ($ok=!is_null($this->userID)) ) { - $this->user = tlUser::getByID($this->db,$this->userID); - return $handler->handle($request); - } - } - - // ========================================================= - // Houston we have a problem - $msg = 'Authentication Error'; - if ($apiKey == null) { - $msg .= " (missing authentication key) "; - } - $response = new Response(); - $response->getBody()->write($msg); - $response->withStatus(401); - return $response; - } - - /** - * - */ - public function setContentTypeJSON(Request $request, RequestHandler $handler) - { - $response = $handler->handle($request); - return $response - ->withHeader('Content-Type', 'application/json'); - } - - /** - * - */ - public function whoAmI(Request $request, Response $response, $args) - { - $msg = json_encode(array('name' => __CLASS__ . ' : You have called Get Route /whoAmI')); - $response->getBody()->write($msg); - return $response; - } - - - /** - * - * @param {array} $args - * parameter passed in route - * example - * ../testprojects/12 - * - * array(1) { - * ["id"]=> string(2) "12" - * } - * - */ - public function testprojects(Request $request, Response $response, $args) - { - $itemSet = $this->getProjects($args); - - // $data = array('name' => 'Bob', 'age' => 40); - // $payload = json_encode($data)//////; - // - // $response->getBody()->write($payload); - // return $response - // ->withHeader('Content-Type', 'application/json'); - $payload = json_encode($itemSet); - $response->getBody()->write($payload); - return $response; - } - - - /** - * - * @param array idCard if provided identifies test project - * Slim Framework will provided a map with a key - * as defined in the route. - * $app->get('/testprojects/{mixedID}/testplans', ... - * - * - */ - private function getProjects($idCard=null, $opt=null) - { - $options = array_merge(array('output' => 'rest'), (array)$opt); - $op = array('status' => 'ok', 'message' => 'ok', 'item' => null); - if(is_null($idCard) || count($idCard) == 0) { - $opOptions = array('output' => 'array_of_map', - 'order_by' => " ORDER BY name ", - 'add_issuetracker' => true, - 'add_reqmgrsystem' => true); - $op['item'] = $this->tprojectMgr - ->get_accessible_for_user( - $this->userID,$opOptions); - } else { - $opOptions = array('output' => 'map', - 'field_set' => 'prefix', - 'format' => 'simple'); - $zx = $this->tprojectMgr - ->get_accessible_for_user( - $this->userID,$opOptions); - - $targetID = null; - $safeID = intval($idCard['mixedID']); - if ($safeID > 0) { - if( isset($zx[$safeID]) ) { - $targetID = $safeID; - } - } - else { - // Will consider id = name or prefix - foreach( $zx as $itemID => $value ) { - if( strcmp($value['name'],$idCard['mixedID']) == 0 || - strcmp($value['prefix'],$idCard['mixedID']) == 0 ) { - $targetID = $itemID; - break; - } - } - } - - if( null != $targetID ) { - $op['item'] = $this->tprojectMgr->get_by_id($targetID); - } - } - - return $op['item']; - } - - /** - * Will return LATEST VERSION of each test case. - * Does return test step info ? - * - * @param array idCard if provided identifies test project - * 'id' -> DBID - * 'name' -> - * 'prefix' -> - */ - public function getProjectTestCases(Request $request, Response $response, $idCard) - { - - $op = array('status' => 'ok', - 'message' => 'ok', - 'items' => null); - $tproject = $this->getProjects($idCard, - array('output' => 'internal')); - - if( !is_null($tproject) ) { - $tcaseIDSet = array(); - $this->tprojectMgr->get_all_testcases_id($tproject['id'],$tcaseIDSet); - - if( !is_null($tcaseIDSet) && count($tcaseIDSet) > 0 ) { - $op['items'] = array(); - foreach( $tcaseIDSet as $key => $tcaseID ) { - $item = $this->tcaseMgr->get_last_version_info($tcaseID); - $item['keywords'] = - $this->tcaseMgr->get_keywords_map($tcaseID,$item['tcversion_id']); - $item['customfields'] = - $this->tcaseMgr->get_linked_cfields_at_design($tcaseID,$item['tcversion_id'],null,null,$tproject['id']); - $op['items'][] = $item; - } - } - } else { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - - } - - /** - * - * $item->name - * $item->prefix - * $item->notes - * $item->active - * $item->public - * $item->options - * $item->options->requirementsEnabled - * $item->options->testPriorityEnabled - * $item->options->automationEnabled - * $item->options->inventoryEnabled - */ - public function createTestProject(Request $request, Response $response, $args) { - $op = array('status' => 'ko', - 'message' => 'ko', - 'id' => -1); - - try { - // Check user grants for requested operation - // This is a global right - $rightToCheck="mgt_modify_product"; - if( $this->userHasRight($rightToCheck) ) { - $op = array('status' => 'ok', 'message' => 'ok'); - $item = json_decode($request->getBody()); - $op['id'] = $this->tprojectMgr->create($item, - array('doChecks' => true)); - } else { - $response = new Response(); - $response->withStatus(403); - - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = sprintf($msg,$rightToCheck,0,0); - } - } - catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * - * @param array idCard if provided identifies test project - * 'id' -> DBID - * 'name' -> - * 'prefix' -> - */ - public function getProjectTestPlans(Request $request, - Response $response, - $idCard) - { - $op = [ - 'status' => 'ok', - 'message' => 'ok', - 'items' => null - ]; - - $tproj = $this->getProjects($idCard, - array('output' => 'internal')); - - if( !is_null($tproj) ) { - $items = $this->tprojectMgr->get_all_testplans($tproj['id']); - $op['items'] = (!is_null($items) && count($items) > 0) - ? $items : null; - } else { - $op['message'] = "No Test Project identified by '" . $idCard . "'!"; - $op['status'] = 'error'; - $response = new Response(); - $response->withStatus(500); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * - * @param map idCard[tplanApiKey] - * - */ - public function getPlanBuilds(Request $request, - Response $response, - $idCard) - { - $op = $this->getStdOp(); - $tplan = $this->tplanMgr->getByAPIKey($idCard['tplanApiKey']); - - if( !is_null($tplan) ) { - $items = $this->tplanMgr->get_builds($tplan['id']); - $op['items'] = (!is_null($items) && count($items) > 0) - ? $items : null; - } else { - $op['message'] = "No Test Plan identified by API KEY:" . - $idCard['tplanApiKey'] . ""; - $op['status'] = 'error'; - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - - /** - * - * @param mixed testplan - * - * step 1) testplan is a number ? - * use it as test plan id - * - * step 2) testplan is a string ? - * use it as test plan apikey - * - * Is not possible to consider testplan as name - * becase name can be used in several test projects. - * One option can be request testprojectname/testplanname - * - * @param string name: build name - * @param string [notes] - * @param string [active] - * @param string [open] - * @param string [releasedate]: format YYYY-MM-DD; - * @param int [copytestersfrombuild] - * - * step 1) is a number ? - * will be considered a target build id. - * check will be done to verify that - * is a valid build id inside the test plan. - * - * step 2) is a string ? - * will be used as build name - * to search inside the test plan. - * - * if check is OK, tester assignments will be copied. - * - */ - public function createBuild(Request $request, - Response $response, - $args) - { - - $op = array('status' => 'ko', 'message' => 'ko', - 'details' => array(), 'id' => -1); - - $rightToCheck = "testplan_create_build"; - - // need to get input, before doing right checks, - // because right can be tested against in this order - // Test Plan Right - // Test Project Right - // Default Right - $item = json_decode($request->getBody()); - if( null == $item ) { - $this->byeHTTP500(__METHOD__); // No return from it - } - - $statusOK = true; - $build = new stdClass(); - - $reqProps = array('testplan','name'); - foreach( $reqProps as $prop ) { - if( !property_exists($item, $prop) ) { - $op['details'][] = - $this->l10n['API_MISSING_REQUIRED_PROP'] . $prop; - $statusOK = false; - } - } - - if( $statusOK ) { - $build->name = $item->name; - - if( is_numeric($item->testplan) ) { - // Check if is a valid test plan - // Get it's test project id - $tplan_id = intval($item->testplan); - $tplan = $this->tplanMgr->get_by_id($tplan_id); - - if( null == $tplan ) { - $statusOK = false; - $op['details'][] = - sprintf($this->l10n['API_TESTPLAN_ID_DOES_NOT_EXIST'], - $item->testplan); - - $response = new Response(); - $response->withStatus(404); - } - } else { - $tplanAPIKey = trim($item->testplan); - $tplan = $this->tplanMgr->getByAPIKey( $tplanAPIKey ); - if( null == $tplan ) { - $statusOK = false; - $op['details'][] = - sprintf($this->l10n['API_TESTPLAN_APIKEY_DOES_NOT_EXIST'],$item->testplan); - - $response = new Response(); - $response->withStatus(404); - } - } - } - - if( $statusOK ) { - // Ready to check user permissions - $context = array('tplan_id' => $tplan['id'], - 'tproject_id' => $tplan['testproject_id']); - - if( !$this->userHasRight($rightToCheck,TRUE,$context) ) { - $statusOK = false; - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = - sprintf($msg,$rightToCheck,$this->user->login, - $context['tproject_id'],$context['tplan_id']); - - $response = new Response(); - $response->withStatus(404); - } - } - - // Go ahead, try create build!! - // Step 1 - Check if build name already exists - if( $statusOK ) { - $build->id = - $this->tplanMgr->get_build_id_by_name( $context['tplan_id'], $build->name ); - - if( $build->id > 0 ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_BUILDNAME_ALREADY_EXISTS'], - $build->name, $build->id); - - $response = new Response(); - $response->withStatus(409); - } - - $build->tplan_id = $context['tplan_id']; - } - - // Step 2 - Finally Create It!! - if( $statusOK ) { - // key 2 check with default value is parameter is missing - $k2check = array('is_open' => 1, - 'release_candidate' => null, - 'notes' => null, - 'commit_id' => null, - 'tag' => null, - 'branch' => null, - 'is_active' => 1, - 'active' => 1, - 'releasedate' => null,'release_date' => null, - 'copy_testers_from_build' => null, - 'copytestersfrombuild' => null); - - $buildProp = $this->buildPropMapping(); - - $skipKey = array(); - foreach( $k2check as $key => $value ) { - $translate = $buildProp[$key]; - if( !isset($skipKey[$translate]) ) { - $build->$translate = $value; - if( property_exists($item, $key) ) { - $build->$translate = $item->$key; - $skipKey[$translate] = true; - } - } - } - - $itemID = $this->buildMgr->createFromObject($build); - if( $itemID > 0 ) { - $op = array('status' => 'ok', 'message' => 'ok', - 'details' => array(), 'id' => $itemID); - } - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * - * @param string id: build id - * @param string [notes] - * @param string [active] - * @param string [open] - * @param string [releasedate]: format YYYY-MM-DD; - * @param int [copytestersfrombuild] - * - * step 1) is a number ? - * will be considered a target build id. - * check will be done to verify that is - * a valid build id inside the test plan. - * - * step 2) is a string ? - * will be used as build name to search - * inside the test plan. - * - * if check is OK, tester assignments will be copied. - * - */ - public function updateBuild(Request $request, - Response $response, - $args) - { - - $op = array('status' => 'ko', 'message' => 'ko', - 'details' => array(), 'id' => -1); - - $id = intval($args['id']); - $rightToCheck = "testplan_create_build"; - - // need to get input, before doing right checks, - // because right can be tested against in this order - // Test Plan Right - // Test Project Right - // Default Right - $item = json_decode($request->getBody()); - if( null == $item ) { - $this->byeHTTP500(__METHOD__); // No return from it - } - - - $statusOK = true; - if( $id <= 0 ) { - $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . - 'id - the build ID'; - $statusOK = false; - } - - if( $statusOK ) { - $build = $this->buildMgr->get_by_id($id); - - if( null == $build ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_INVALID_BUILDID'],$id); - - $response = new Response(); - $response->withStatus(404); - } - } - - if( $statusOK ) { - $tplan = $this->tplanMgr->get_by_id( $build['testplan_id'] ); - - // Ready to check user permissions - $context = array('tplan_id' => $tplan['id'], - 'tproject_id' => $tplan['testproject_id']); - - if( !$this->userHasRight($rightToCheck,TRUE,$context) ) { - $statusOK = false; - $msg = lang_get('API_INSUFFICIENT_RIGHTS'); - $op['message'] = - sprintf($msg,$rightToCheck,$this->user->login, - $context['tproject_id'],$context['tplan_id']); - - $response = new Response(); - $response->withStatus(403); - } - } - - // Go ahead, try to update build!! - if( $statusOK ) { - // Step 1 - Check if build name already exists - if( property_exists($item,'name') ) { - if( $this->tplanMgr->check_build_name_existence( - $tplan['id'],$item->name,$id) ) { - $statusOK = false; - $op['message'] = - sprintf($this->l10n['API_BUILDNAME_ALREADY_EXISTS'], - $item->name, $id); - - $response = new Response(); - $response->withStatus(409); - } - } - } - - // Step 2 - Finally Update It!! - if( $statusOK ) { - $k2check = array('is_open', 'name', - 'release_candidate', - 'notes','commit_id','tag', - 'branch','is_active','active', - 'releasedate','release_date', - 'copy_testers_from_build', - 'copytestersfrombuild'); - - $buildProp = $this->buildPropMapping(); - - $skipKey = array(); - $buildObj = new stdClass(); - $attr = array(); - foreach( $k2check as $key ) { - $translate = $buildProp[$key]; - if( !isset($skipKey[$translate]) ) { - - // init with value got from DB. - if( isset($build[$translate]) ) { - $buildObj->$translate = $build[$translate]; - } - - if( property_exists($item, $key) ) { - $buildObj->$translate = $item->$key; - $skipKey[$translate] = true; - } - - if( property_exists($buildObj, $translate) ) { - $attr[$translate] = $buildObj->$translate; - } - } - } - - // key 2 check - // $id,$name,$notes,$active=null,$open=null, - // $release_date='',$closed_on_date='') { - - $ox = $this->buildMgr->update($build['id'], - $buildObj->name,$buildObj->notes,$attr); - - if( $ox ) { - $op = array('status' => 'ok', 'message' => 'ok', - 'details' => array(), 'id' => $id); - - // Special processing Build Closing/Opening - // we need also to manage close on date. - if( property_exists($item,'is_open') ) { - $oio = intval($build['is_open']); - $nio = intval($item->is_open); - if( $oio != $nio ) { - if( $nio ) { - $this->buildMgr->setOpen($id); - } else { - $this->buildMgr->setClosed($id); - } - } - } - } - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * 'name' - * 'testProjectID' - * 'testProjectPrefix' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function createTestPlan(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - try { - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - $opeOpt = array('setSessionProject' => false, - 'doChecks' => true); - - if (property_exists($item, 'testProjectPrefix')) { - $pi = $this->tprojectMgr->get_by_prefix(trim($item->testProjectPrefix)); - $item->testProjectID = intval($pi[id]); - } - - $op['id'] = $this->tplanMgr->createFromObject($item,$opeOpt); - - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - - /** - * 'name' - * 'testProjectID' - * 'notes' - * 'active' - * 'is_public' - * - */ - public function updateTestPlan(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - $id = intval($args['id']); - try { - $op = array('status' => 'ok', 'message' => 'ok'); - $item = json_decode($request->getBody()); - $item->id = $id; - var_dump($item); - $op['id'] = $this->tplanMgr->updateFromObject($item); - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * - * Request Body - * - * $ex->testPlanID - * $ex->buildID - * $ex->platformID -> optional - * $ex->testCaseExternalID - * $ex->notes - * $ex->statusCode - * $ex-steps [] - * An example: - "steps":[ - { - "stepNumber":1, - "notes":"This is an execution created via REST API", - "statusCode":"b" - }, - { - "stepNumber":12, - "notes":"This is an execution created via REST API", - "statusCode":"f" - } - ] - - * Checks to be done - * - * A. User right & Test plan existence - * user has right to execute on target Test plan? - * this means also that: Test plan ID exists ? - * - * B. Build - * does Build ID exist on target Test plan ? - * is Build enable to execution ? - * - * C. Platform - * do we need a platform ID in order to execute ? - * is a platform present on provided data ? - * does this platform belong to target Test plan ? - * - * D. Test case identity - * is target Test case part of Test plan ? - * - * - * Z. Other mandatory information - * We are not going to check for other mandatory info - * like: mandatory custom fields. (if we will be able in future to manage it) - * - * - */ - public function createTestCaseExecution(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - - try { - $ex = json_decode($request->getBody()); - $util = $this->checkExecutionEnvironment($ex); - - // Complete missing propertie - if( property_exists($ex, 'platformID') == FALSE ) { - $ex->platformID = 0; - } - - if( property_exists($ex, 'executionType') == FALSE ) { - $ex->executionType = - $this->cfg['tcase']['executionType']['auto']; - } - - // If we are here this means we can write execution status!!! - $ex->testerID = $this->userID; - foreach($util as $prop => $value) { - $ex->$prop = $value; - } - $op = array('status' => 'ok', 'message' => 'ok'); - - // This writes ONLY a test case level, not steps - $op['id'] = $this->tplanMgr->writeExecution($ex); - - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * 'name' - * 'testProjectID' - * 'parentID' - * 'notes' - * 'order' - */ - public function createTestSuite(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - try { - $item = json_decode($request->getBody()); - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $this->tsuiteMgr->createFromObject($item,array('doChecks' => true)); - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * body will contain an array of objects - * that can be - * {'name': platform name} - * {'id': platform id} - * - * Check if done to understand if all platforms - * exist before doing any action - * - * - */ - public function addPlatformsToTestPlan(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - $tplan_id = intval($args['tplan_id']); - try { - $plat2link = json_decode($request->getBody()); - - $op = array('status' => 'ok', 'message' => 'ok'); - $statusOK = true; - if (null == $plat2link || !is_array($plat2link)) { - $statusOK = false; - $op['status'] = 'ko'; - $op['message'] = 'Bad Body'; - } - - if ($statusOK) { - // Validate Test plan existence. - // Get Test Project ID before doing anything - $getOpt = array('output' => 'testPlanFields', - 'active' => 1, - 'testPlanFields' => - 'id,testproject_id,is_public'); - - $testPlan = $this->tplanMgr->get_by_id($tplan_id,$getOpt); - $statusOK = !is_null($testPlan); - - if ($statusOK) { - $tproject_id = $testPlan['testproject_id']; - } else { - $op['status'] = 'ko'; - $op['message'] = 'Invalid Test Plan ID'; - } - } - - if ($statusOK) { - // Get all test project platforms, - // that can be used on TEST PLAN - // (enabled on execution) - // - // then validate - $platMgr = new tlPlatform($this->db,$tproject_id); - $platDomain = $platMgr->getAll(); - $idToLink = []; - $op['message'] = []; - - foreach ($plat2link as $accessObj) { - $checkOK = false; - if (property_exists($accessObj, 'name')) { - $needle = trim($accessObj->name); - foreach ($platDomain as $target) { - if ($target['name'] == $needle) { - $checkOK = true; - $idToLink[$target['id']] = $target['id']; - } - } - $statusOK = $statusOK && $checkOK; - if ($checkOK == false) { - $op['message'][] = - " WARNING! - Platform with name:" . - $needle . " Reason: does not exist " . - " or is not enabled for execution"; - } - } - - if (property_exists($accessObj, 'id')) { - $needle = intval($accessObj->id); - foreach ($platDomain as $target) { - if ($target['id'] == $needle) { - $checkOK = true; - $idToLink[$target['id']] = $target['id']; - } - } - $statusOK = $statusOK && $checkOK; - if ($checkOK == false) { - $op['message'][] = "Platform with id:" . - $needle . - " does not exist"; - } - } - } - - $op['status'] = $statusOK; - } - - if ($statusOK) { - $p2link = []; - // Finally link platforms, if not linked yet - $gOpt = array('outputFormat' => 'mapAccessByID'); - $linked = (array)$platMgr->getLinkedToTestplan($tplan_id,$gOpt); - foreach ($idToLink as $plat_id) { - if (!isset($linked[$plat_id])) { - $p2link[$plat_id]=$plat_id; - } - } - if (count($p2link) >0){ - $platMgr->linkToTestplan($p2link,$tplan_id); - } - } - - if ($op['status']) { - $op['message'] = 'ok'; - } - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - /** - * "name" - * "testSuite": {"id": xxx} - * "testProject" : {"id": xxx} or {"prefix": yyy} - * - * One of the following - * "authorLogin" - * "authorID" - * ------------------------------------------ - * - * "summary" can be a string or an array of strings - * "preconditions" can be a string or an array of strings - * - * "importance": {"name": "verbose"} - * - see const.inc.php for domain - * "executionType": {"name": "verbose"} - * - see ... for domain - * "order" - * - * "estimatedExecutionDuration" // to be implemented - * - * "steps": array of objects - * IMPORTANT NOTICE: actions and expected_results - * Can be string or array of strings - * [ - * { "step_number":1, - * "actions": "red", - * "expected_results": "#f00", - * "execution_type":1 - * }, - * { "step_number":12, - * "actions": "red12", - * "expected_results": "#f00", - * "execution_type":2 - * } - * ] - * - */ - public function createTestCase(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - try { - - // It will be important to document WHY!!! - // AFAIK some issues with json_decode() - // https://stackoverflow.com/questions/34486346/new-lines-and-tabs-in-json-decode-php-7 - $body = str_replace("\n", '', $request->getBody()); - $item = json_decode($body); - - if (null == $item) { - $this->byeHTTP500(__METHOD__); - } - - // create obj with standard properties - $op['message'] = 'After buildTestCaseObj() >> ' . - $tcase = $this->buildTestCaseObj($item); - $this->checkRelatives($tcase); - - $ou = $this->tcaseMgr->createFromObject($tcase); - $op = array('status' => 'ok', 'message' => 'ok', 'id' => -1); - if( ($op['id']=$ou['id']) <= 0) { - $op['status'] = 'ko'; - $op['message'] = $ou['msg']; - $response = new Response(); - $response->withStatus(409); - } - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - if ($op['message'] == 'ko') { - $op['message'] = __METHOD__ . ' >> '; - } - $op['message'] .= $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - - /** - * "keyword" - * "notes" - * "testProject": {"prefix":"APR"} - */ - public function createKeyword(Request $request, - Response $response, - $args) - { - $op = $this->getStdIDKO(); - - try { - $body = $request->getBody(); - $bigString = $body->getContents(); - - $ba = explode('",', $bigString); - $needle = '"notes":'; - foreach( $ba as $pa => $ma) { - if (strpos($ma, $needle) !== FALSE) { - $zz = explode($needle,$ma); - $ba[$pa] = $needle . - str_replace("\n", "?^§", $zz[1]); - } - $ba[$pa] .= '",'; - } - - $bigString = implode("",$ba); - $bigString = trim($bigString,'",'); - $item = json_decode($bigString); - if( null == $item ) { - $this->byeHTTP500(__METHOD__); - } - - if (property_exists($item, 'notes')) { - $item->notes = str_replace("?^§", "\n", $item->notes); - - // try to remove useless spaces - $item->notes = str_replace(" ", "", $item->notes); - } - - // create obj with standard properties - $pfx = $item->testProject->prefix; - $pid = $this->tprojectMgr->get_by_prefix((string)$pfx); - if( null == $pid ) { - $op['status'] = 'ko'; - $op['message'] = "Can't get test project ID"; - } else { - $pid = $pid['id']; - $ou = $this->tprojectMgr->addKeyword($pid,$item->keyword,$item->notes); - $op = array('status' => 'ok', 'message' => 'ok'); - $op['id'] = $ou['id']; - if ($ou['status'] < 0) { - $op['status'] = 'ko'; - $op['message'] = $ou['msg']; - } - } - } catch (Exception $e) { - $response = new Response(); - $response->withStatus(500); - $op['message'] = __METHOD__ . ' >> ' . - $this->msgFromException($e); - } - - $payload = json_encode($op); - $response->getBody()->write($payload); - return $response; - } - - - /* ************************************ */ - /* Helpers */ - /* ************************************ */ - private function buildPropMapping() - { - $bp = array('name' => 'name', - 'tplan_id' => 'tplan_id', - 'release_date' => 'release_date', - 'releasedate' => 'release_date', - 'active' => 'is_active', - 'is_active' => 'is_active', - 'notes' => 'notes', - 'commit_id' => 'commit_id', - 'tag' => 'tag', 'branch' => 'branch', - 'release_candidate' =>'release_candidate', - 'is_open' => 'is_open', - 'copytestersfrombuild' => - 'copytestersfrombuild', - 'copy_testers_from_build' => - 'copytestersfrombuild'); - return $bp; - } - - - /** - * - * - */ - private function buildTestCaseObj(&$obj) - { - if(is_null($obj)) { - throw new Exception("Fatal Error - " . __METHOD__ . " arg is NULL"); - } - - $tcase = new stdClass(); - $tcase->authorID = -1; - $tcase->steps = null; - $tcase->testProjectID = -1; - - $accessKey = array(); - $isOK = true; - - // Knowing author is critic, because rights are related to user. - // Another important thing: - // do we need to check that author when provided, has rights to do - // requested action? - // If we do not do this check, we will find in test cases created - // by people that do not have rights. - // May be is time to add a field that provide info about source of action - // GUI, API - // - if(property_exists($obj, 'author')) { - if(property_exists($obj->author, 'login') || property_exists($obj->author, 'id')) { - $tcase->authorID = $this->getUserIDByAttr($obj->author); - } - } - - // Last resort: get author from credentials use to make the call. - // no error message returned. - if($tcase->authorID <= 0) { - $tcase->authorID = $this->userID; - } - - - // Mandatory attributes - $ma = array('name' => null, - 'testProject' => array('id','prefix'), - 'testSuite' => array('id')); - - foreach ($ma as $key => $dummy) { - if( !($isOK = $isOK && property_exists($obj, $key)) ) { - throw new Exception("Missing Attribute: {$key} "); - } - } - - foreach ($ma as $key => $attr) { - if( !is_null($attr) ) { - $attrOK = false; - foreach($attr as $ak) { - $accessKey[$key][$ak] = property_exists($obj->$key,$ak); - $attrOK = $attrOK || $accessKey[$key][$ak]; - } - - if(!$attrOK) { - $msg = "Attribute: {$key} mandatory key ("; - if(count($attr) > 1) { - $msg .= "one of set: "; - } - $msg .= implode('/',$attr) . ") is missing"; - throw new Exception($msg); - } - } - } - - $tcase->name = trim($obj->name); - $tcase->testSuiteID = intval($obj->testSuite->id); - - $gOpt = array('output' => 'array_of_map', - 'field_set' => 'prefix', - 'add_issuetracker' => false, - 'add_reqmgrsystem' => false); - - - $msg = "Test project with "; - if($accessKey['testProject']['id']) { - $safeID = intval($obj->testProject->id); - $gFilters = array('id' => array('op' => '=', 'value' => $safeID)); - $msg .= "id={$safeID} "; - } - - if($accessKey['testProject']['prefix']) { - $gFilters = array('prefix' => - array('op' => '=', 'value' => trim($obj->testProject->prefix)) ); - $msg .= "prefix={$obj->testProject->prefix} "; - } - - $info = $this->tprojectMgr->get_accessible_for_user($this->userID,$gOpt,$gFilters); - - if(is_null($info)) { - $msg .= "does not exist or you have no rights to use it"; - throw new Exception($msg,999); - } - - $tcase->testProjectID = intval($info[0]['id']); - - // -------------------------------------------------------------- - // summary & preconditions - // if type is array -> generate string in this way - // - add
    -    // - concact the elements with "\n"
    -    // - add 
    - // -------------------------------------------------------------- - $sk2d = array('summary' => '', - 'preconditions' => ''); - foreach($sk2d as $key => $value) { - if (is_array($tcase->$key)) { - $tcase->$key = "
    " . implode("\n", $tcase->$key) . "
    "; - } - } - // -------------------------------------------------------------- - - - // -------------------------------------------------------------- - // these are objects with name as property. - $tcfg = $this->cfg['tcase']; - $ck2d = array('executionType' => $tcfg['executionType']['manual'], - 'importance' => $tcfg['defaults']['importance'], - 'status' => $tcfg['status']['draft']); - - foreach($ck2d as $prop => $defa) { - $tcase->$prop = property_exists($obj, $prop) ? - $tcfg[$prop][$obj->$prop->name] : $defa; - } - - - // -------------------------------------------------------------- - if(property_exists($obj, 'steps')) { - $tcase->steps = []; - $sk2d = array('actions' => '', - 'expected_results' => ''); - foreach($obj->steps as $stepObj) { - foreach($sk2d as $key => $value) { - if (is_array($stepObj->$key)) { - $stepObj->$key = "
    " . implode("\n", $stepObj->$key) . "
    "; - } - } - $tcase->steps[] = $stepObj; - } - } - // -------------------------------------------------------------- - - - return $tcase; - } - - /** - * - */ - private function checkExecutionEnvironment($ex) - { - // throw new Exception($message, $code, $previous); - - // no platform - $platform = 0; - - // Test plan ID exists and is ACTIVE - $msg = 'invalid Test plan ID'; - $getOpt = array('output' => 'testPlanFields', - 'active' => 1, - 'testPlanFields' => - 'id,testproject_id,is_public'); - $status_ok = !is_null($testPlan=$this->tplanMgr->get_by_id($ex->testPlanID,$getOpt)); - - if($status_ok) { - // user has right to execute on Test plan ID - // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) - $msg = 'user has no right to execute'; - $status_ok = $this->user->hasRight($this->db, - 'testplan_execute', - $testPlan['testproject_id'], - $ex->testPlanID,true); - } - - if($status_ok) { - // Check if couple (buildID,testPlanID) is valid - $msg = '(buildID,testPlanID) couple is not valid'; - $getOpt = array('fields' => 'id,active,is_open', 'buildID' => $ex->buildID, 'orderBy' => null); - $status_ok = !is_null($build = $this->tplanMgr->get_builds($ex->testPlanID,null,null,$getOpt)); - - if($status_ok) { - // now check is execution can be done againts this build - $msg = 'Build is not active and/or closed => execution can not be done'; - $status_ok = $build[$ex->buildID]['active'] && $build[$ex->buildID]['is_open']; - } - } - - if($status_ok && property_exists($ex, 'platformID')) { - // Get Test plan platforms - $platform = $ex->platformID; - - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => false); - $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID,$getOpt); - - if( !($hasPlatforms = !is_null($platformSet)) && $platform !=0) { - $status_ok = false; - $msg = 'You can not execute against a platform, because Test plan has no platforms'; - } - - if($status_ok) { - if($hasPlatforms) { - if($platform == 0) { - $status_ok = false; - $msg = 'Test plan has platforms, you need to provide one in order to execute'; - } else if (!isset($platformSet[$platform])) { - $status_ok = false; - $msg = '(platform,test plan) couple is not valid'; - } - } - } - } - - if($status_ok) { - // Test case check - $msg = 'Test case does not exist'; - - $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); - $status_ok = ($tcaseID > 0); - if( $status_ok = ($tcaseID > 0) ) { - $msg = 'Test case doesn not belong to right test project'; - $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase($tcaseID,0); - $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); - } - - if($status_ok) { - // Does this test case is linked to test plan ? - $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; - $getFilters = array('testplan_id' => $ex->testPlanID, - 'platform_id' => $platform); - - $getOpt = array('output' => 'simple'); - $links = $this->tcaseMgr->get_linked_versions($tcaseID,$getFilters,$getOpt); - $status_ok = !is_null($links); - } - } - - if($status_ok) { - // status code is OK ? - $msg = 'not run status is not a valid execution status (can not be written to DB)'; - $status_ok = ($ex->statusCode != $this->cfg['exec']['statusCode']['not_run']); - - if($status_ok) { - $msg = 'Requested execution status is not configured on TestLink'; - $status_ok = isset($this->cfg['exec']['codeStatus'][$ex->statusCode]); - } - } - - if($status_ok) { - $ret = new stdClass(); - $ret->testProjectID = $testPlan['testproject_id']; - $ret->testCaseVersionID = key($links); - $ret->testCaseVersionNumber = - $links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version']; - } - - if(!$status_ok) { - throw new Exception($msg); - } - - return $ret; - } - - /** - * - * - */ - private function checkRelatives($ctx) - { - $testProjectID = $ctx->testProjectID; - $testSuiteID = $ctx->testSuiteID; - if($testProjectID <= 0) { - throw new Exception("Test Project ID is invalid (<=0)"); - } - - if($testSuiteID <= 0) { - throw new Exception("Test Suite ID is invalid (<=0)"); - } - - $pinfo = $this->tprojectMgr->get_by_id($testProjectID); - if( is_null($pinfo) ) { - throw new Exception("Test Project ID is invalid (does not exist)"); - } - - $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); - if( is_null($pinfo) ) { - throw new Exception( - "Test Suite ID is invalid (does not exist)"); - } - - if( $testProjectID != $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID,$testSuiteID) ) { - throw new Exception( - "Test Suite does not belong to Test Project ID"); - } - } - - - /** - * checks if a user has requested right on test project, test plan pair. - * - * @param string $rightToCheck one of the rights defined in rights table - * @param boolean $checkPublicPrivateAttr (optional) - * @param map $context (optional) - * keys tproject_id,tplan_id (both are also optional) - * - * @return boolean - * @access protected - * - * - */ - protected function userHasRight($rightToCheck, - $checkPublicPrivateAttr=false,$context=null) - { - $status_ok = true; - - // for global rights context is NULL - if( is_null($context) ) { - $tproject_id = 0; - $tplan_id = null; - } else { - $tproject_id = intval(isset($context['tproject_id']) ? - $context['tproject_id'] : 0); - - $tplan_id = null; - if(isset($context['tplan_id'])) { - $tplan_id = intval($context['tplan_id']); - } - - if( $tproject_id <= 0 && !is_null($tplan_id) ) { - // get test project from test plan - $dummy = $this->tplanMgr->get_by_id($tplanid,array('output' => 'minimun')); - $tproject_id = intval($dummy['tproject_id']); - } - } - - // echo $rightToCheck; - if(!$this->user->hasRight($this->db,$rightToCheck, - $tproject_id,$tplan_id,$checkPublicPrivateAttr)) { - $status_ok = false; - } - return $status_ok; - } - - /** - * - */ - private function getStdOp() - { - $op = array('status' => 'ok', - 'message' => 'ok', - 'items' => null); - return $op; - } - - /** - * - */ - private function getStdIDKO() - { - $op = array('status' => 'ko', - 'message' => 'ko', - 'id' => -1); - return $op; - } - - - /** - * - */ - function byeHTTP500($msg=null) - { - $op = array(); - if( null == $msg ) { - $msg = 'TestLink Fatal Error - Malformed Request Body - ' . - ' json_decode() issue'; - } - $op['details'][] = sprintf($msg); - - $response = new Response(); - $response->getBody()->write('Malformed Request Body'); - $response->withStatus(500); - return $response; - } - - - /** - * - */ - function msgFromException($e) - { - return $e->getMessage() . - ' - offending line number: ' . $e->getLine(); - } -} // class end + + * @package TestLink + * + * Implemented using + * Slim framework Version 4.3.0 / 4.4.0 + * PHP > 7.4.0 + * + * References + * http://ericbrandel.com/2013/01/14/quickly-build-restful-apis-in-php-with-slim-part-2/ + * https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Add+Comment + * http://confluence.jetbrains.com/display/YTD4/Create+New+Work+Item + * http://www.redmine.org/projects/redmine/wiki/Rest_api + * http://coenraets.org/blog/2011/12/restful-services-with-jquery-php-and-the-slim-framework/ + * https://github.com/educoder/pest/blob/master/examples/intouch_example.php + * http://stackoverflow.com/questions/9772933/rest-api-request-body-as-json-or-plain-post-data + * + * http://phptrycatch.blogspot.it/ + * http://nitschinger.at/A-primer-on-PHP-exceptions + * + * + * + */ +require_once '../../../../config.inc.php'; +require_once 'common.php'; + +use Psr\Http\Message\ServerRequestInterface as Request; +use Psr\Http\Server\RequestHandlerInterface as RequestHandler; +use Slim\Psr7\Response; + +/** + * + * @author Francisco Mancardi + * @package TestLink + */ +class RestApi +{ + + public static $version = "3.0"; + + /** + * The DB object used throughout the class + * + * @access protected + */ + protected $db = null; + + protected $tables = null; + + protected $tcaseMgr = null; + + protected $tprojectMgr = null; + + protected $tsuiteMgr = null; + + protected $tplanMgr = null; + + protected $tplanMetricsMgr = null; + + protected $reqSpecMgr = null; + + protected $reqMgr = null; + + protected $platformMgr = null; + + protected $buildMgr = null; + + protected $cfieldMgr = null; + + /** + * userID associated with the apiKey provided + */ + protected $userID = null; + + /** + * UserObject associated with the userID + */ + protected $user = null; + + /** + * The api key being used to make a request + */ + protected $apiKey = null; + + /** + * boolean to allow a method to invoke another method and avoid double auth + */ + protected $authenticated = false; + + /** + * The version of a test case that is being used + */ + /** + * This value is setted in following method: + */ + protected $tcVersionID = null; + + protected $versionNumber = null; + + protected $debugMsg; + + protected $cfg; + + protected $apiLogPathName; + + protected $l10n; + + /** + */ + public function __construct() + { + $tl = array( + 'API_MISSING_REQUIRED_PROP' => null, + 'API_TESTPLAN_ID_DOES_NOT_EXIST' => null, + 'API_TESTPLAN_APIKEY_DOES_NOT_EXIST' => null, + 'API_BUILDNAME_ALREADY_EXISTS' => null, + 'API_INVALID_BUILDID' => null + ); + + $this->l10n = init_labels($tl); + + $this->apiLogPathName = '/var/testlink/rest-api.log'; + + $this->db = new database(DB_TYPE); + $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); + doDBConnect($this->db, database::ONERROREXIT); + + $this->tcaseMgr = new testcase($this->db); + $this->tprojectMgr = new testproject($this->db); + $this->tsuiteMgr = new testsuite($this->db); + + $this->tplanMgr = new testplan($this->db); + $this->tplanMetricsMgr = new tlTestPlanMetrics($this->db); + $this->reqSpecMgr = new requirement_spec_mgr($this->db); + $this->reqMgr = new requirement_mgr($this->db); + $this->cfieldMgr = $this->tprojectMgr->cfield_mgr; + $this->buildMgr = new build_mgr($this->db); + + $this->tables = $this->tcaseMgr->getDBTables(); + + $this->cfg = array(); + $conf = config_get('results'); + foreach ($conf['status_label_for_exec_ui'] as $key => $label) { + $this->cfg['exec']['statusCode'][$key] = $conf['status_code'][$key]; + } + + $this->cfg['exec']['codeStatus'] = array_flip( + $this->cfg['exec']['statusCode']); + + $this->cfg['tcase']['status'] = config_get('testCaseStatus'); + $this->cfg['tcase']['executionType'] = config_get('execution_type'); + + $this->cfg['tcase']['executionType']['automatic'] = $this->cfg['tcase']['executionType']['auto']; + + $x = config_get('importance'); + $this->cfg['tcase']['importance'] = []; + foreach ($x['code_label'] as $code => $label) { + $this->cfg['tcase']['importance'][$label] = $code; + } + + // DEFAULTS + $this->cfg['tcase']['defaults']['executionType'] = $this->cfg['tcase']['executionType']['manual']; + + $this->cfg['tcase']['defaults']['importance'] = config_get( + 'testcase_importance_default'); + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /** + */ + public function authenticate(Request $request, RequestHandler $handler) + { + $hh = $request->getHeaders(); + + $apiKey = null; + + // @20200317 - Not tested + // IMPORTANT NOTICE: 'PHP_AUTH_USER' + // it seems this needs special configuration + // with Apache when you use CGI Module + // http://man.hubwiz.com/docset/PHP.docset/Contents/Resources/ + // Documents/php.net/manual/en/features.http-auth.html + $apiKeySet = [ + 'Apikey', + 'ApiKey', + 'APIKEY', + 'PHP_AUTH_USER' + ]; + foreach ($apiKeySet as $accessKey) { + if (isset($hh[$accessKey])) { + $apiKey = trim($hh[$accessKey][0]); + break; + } + } + + if ($apiKey != null && $apiKey != '') { + $sql = "SELECT id FROM {$this->tables['users']} " . + "WHERE script_key='" . $this->db->prepare_string($apiKey) . "'"; + + $this->userID = $this->db->fetchFirstRowSingleColumn($sql, "id"); + if (! is_null($this->userID)) { + $this->user = tlUser::getByID($this->db, $this->userID); + return $handler->handle($request); + } + } + + // ========================================================= + // Houston we have a problem + $msg = 'Authentication Error'; + if ($apiKey == null) { + $msg .= " (missing authentication key) "; + } + $response = new Response(); + $response->getBody()->write($msg); + $response->withStatus(401); + return $response; + } + + /** + */ + public function setContentTypeJSON(Request $request, RequestHandler $handler) + { + $response = $handler->handle($request); + return $response->withHeader('Content-Type', 'application/json'); + } + + /** + */ + public function whoAmI(Response $response) + { + $msg = json_encode( + array( + 'name' => __CLASS__ . ' : You have called Get Route /whoAmI' + )); + $response->getBody()->write($msg); + return $response; + } + + /** + * + * @param {array} $args + * parameter passed in route + * example + * ../testprojects/12 + * + * array(1) { + * ["id"]=> string(2) "12" + * } + * + */ + public function testprojects(Response $response, $args) + { + $itemSet = $this->getProjects($args); + + $payload = json_encode($itemSet); + $response->getBody()->write($payload); + return $response; + } + + /** + * + * @param + * array idCard if provided identifies test project + * Slim Framework will provided a map with a key + * as defined in the route. + * $app->get('/testprojects/{mixedID}/testplans', ... + * + * + */ + private function getProjects($idCard = null) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'item' => null + ); + if (empty($idCard)) { + $opOptions = array( + 'output' => 'array_of_map', + 'order_by' => " ORDER BY name ", + 'add_issuetracker' => true, + 'add_reqmgrsystem' => true + ); + $op['item'] = $this->tprojectMgr->get_accessible_for_user( + $this->userID, $opOptions); + } else { + $opOptions = array( + 'output' => 'map', + 'field_set' => 'prefix', + 'format' => 'simple' + ); + $zx = $this->tprojectMgr->get_accessible_for_user($this->userID, + $opOptions); + + $targetID = null; + $safeID = intval($idCard['mixedID']); + if ($safeID > 0) { + if (isset($zx[$safeID])) { + $targetID = $safeID; + } + } else { + // Will consider id = name or prefix + foreach ($zx as $itemID => $value) { + if (strcmp($value['name'], $idCard['mixedID']) == 0 || + strcmp($value['prefix'], $idCard['mixedID']) == 0) { + $targetID = $itemID; + break; + } + } + } + + if (null != $targetID) { + $op['item'] = $this->tprojectMgr->get_by_id($targetID); + } + } + + return $op['item']; + } + + /** + * Will return LATEST VERSION of each test case. + * Does return test step info ? + * + * @param + * array idCard if provided identifies test project + * 'id' -> DBID + * 'name' -> + * 'prefix' -> + */ + public function getProjectTestCases(Response $response, $idCard) + { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + $tproject = $this->getProjects($idCard); + + if (! is_null($tproject)) { + $tcaseIDSet = array(); + $this->tprojectMgr->get_all_testcases_id($tproject['id'], + $tcaseIDSet); + + if (! empty($tcaseIDSet)) { + $op['items'] = array(); + foreach ($tcaseIDSet as $tcaseID) { + $item = $this->tcaseMgr->getLastVersionInfo($tcaseID); + $item['keywords'] = $this->tcaseMgr->get_keywords_map( + $tcaseID, $item['tcversion_id']); + $item['customfields'] = $this->tcaseMgr->get_linked_cfields_at_design( + $tcaseID, $item['tcversion_id'], null, null, + $tproject['id']); + $op['items'][] = $item; + } + } + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * $item->name + * $item->prefix + * $item->notes + * $item->active + * $item->public + * $item->options + * $item->options->requirementsEnabled + * $item->options->testPriorityEnabled + * $item->options->automationEnabled + * $item->options->inventoryEnabled + */ + public function createTestProject(Request $request, Response $response) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + + try { + // Check user grants for requested operation + // This is a global right + $rightToCheck = "mgt_modify_product"; + if ($this->userHasRight($rightToCheck)) { + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $item = json_decode($request->getBody()); + $op['id'] = $this->tprojectMgr->create($item, + array( + 'doChecks' => true + )); + } else { + $response = new Response(); + $response->withStatus(403); + + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, 0, 0); + } + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * + * @param + * array idCard if provided identifies test project + * 'id' -> DBID + * 'name' -> + * 'prefix' -> + */ + public function getProjectTestPlans(Response $response, $idCard) + { + $op = [ + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ]; + + $tproj = $this->getProjects($idCard); + + if (! is_null($tproj)) { + $items = $this->tprojectMgr->get_all_testplans($tproj['id']); + $op['items'] = (! empty($items)) ? $items : null; + } else { + $op['message'] = "No Test Project identified by '" . $idCard . "'!"; + $op['status'] = 'error'; + $response = new Response(); + $response->withStatus(500); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * + * @param + * map idCard[tplanApiKey] + * + */ + public function getPlanBuilds(Response $response, $idCard) + { + $op = $this->getStdOp(); + $tplan = $this->tplanMgr->getByAPIKey($idCard['tplanApiKey']); + + if (! is_null($tplan)) { + $items = $this->tplanMgr->get_builds($tplan['id']); + $op['items'] = (! empty($items)) ? $items : null; + } else { + $op['message'] = "No Test Plan identified by API KEY:" . + $idCard['tplanApiKey'] . ""; + $op['status'] = 'error'; + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * + * @param + * mixed testplan + * + * step 1) testplan is a number ? + * use it as test plan id + * + * step 2) testplan is a string ? + * use it as test plan apikey + * + * Is not possible to consider testplan as name + * becase name can be used in several test projects. + * One option can be request testprojectname/testplanname + * + * @param + * string name: build name + * @param + * string [notes] + * @param + * string [active] + * @param + * string [open] + * @param + * string [releasedate]: format YYYY-MM-DD; + * @param + * int [copytestersfrombuild] + * + * step 1) is a number ? + * will be considered a target build id. + * check will be done to verify that + * is a valid build id inside the test plan. + * + * step 2) is a string ? + * will be used as build name + * to search inside the test plan. + * + * if check is OK, tester assignments will be copied. + * + */ + public function createBuild(Request $request, Response $response) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'details' => array(), + 'id' => - 1 + ); + + $rightToCheck = "testplan_create_build"; + + // need to get input, before doing right checks, + // because right can be tested against in this order + // Test Plan Right + // Test Project Right + // Default Right + $item = json_decode($request->getBody()); + if (null == $item) { + $this->byeHTTP500(__METHOD__); // No return from it + } + + $statusOK = true; + $build = new stdClass(); + + $reqProps = array( + 'testplan', + 'name' + ); + foreach ($reqProps as $prop) { + if (! property_exists($item, $prop)) { + $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . + $prop; + $statusOK = false; + } + } + + if ($statusOK) { + $build->name = $item->name; + + if (is_numeric($item->testplan)) { + // Check if is a valid test plan + // Get it's test project id + $tplan_id = intval($item->testplan); + $tplan = $this->tplanMgr->get_by_id($tplan_id); + + if (null == $tplan) { + $statusOK = false; + $op['details'][] = sprintf( + $this->l10n['API_TESTPLAN_ID_DOES_NOT_EXIST'], + $item->testplan); + + $response = new Response(); + $response->withStatus(404); + } + } else { + $tplanAPIKey = trim($item->testplan); + $tplan = $this->tplanMgr->getByAPIKey($tplanAPIKey); + if (null == $tplan) { + $statusOK = false; + $op['details'][] = sprintf( + $this->l10n['API_TESTPLAN_APIKEY_DOES_NOT_EXIST'], + $item->testplan); + + $response = new Response(); + $response->withStatus(404); + } + } + } + + if ($statusOK) { + // Ready to check user permissions + $context = array( + 'tplan_id' => $tplan['id'], + 'tproject_id' => $tplan['testproject_id'] + ); + + if (! $this->userHasRight($rightToCheck, true, $context)) { + $statusOK = false; + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, $this->user->login, + $context['tproject_id'], $context['tplan_id']); + + $response = new Response(); + $response->withStatus(404); + } + } + + // Go ahead, try create build!! + // Step 1 - Check if build name already exists + if ($statusOK) { + $build->id = $this->tplanMgr->get_build_id_by_name( + $context['tplan_id'], $build->name); + + if ($build->id > 0) { + $statusOK = false; + $op['message'] = sprintf( + $this->l10n['API_BUILDNAME_ALREADY_EXISTS'], $build->name, + $build->id); + + $response = new Response(); + $response->withStatus(409); + } + + $build->tplan_id = $context['tplan_id']; + } + + // Step 2 - Finally Create It!! + if ($statusOK) { + // key 2 check with default value is parameter is missing + $k2check = array( + 'is_open' => 1, + 'release_candidate' => null, + 'notes' => null, + 'commit_id' => null, + 'tag' => null, + 'branch' => null, + 'is_active' => 1, + 'active' => 1, + 'releasedate' => null, + 'release_date' => null, + 'copy_testers_from_build' => null, + 'copytestersfrombuild' => null + ); + + $buildProp = $this->buildPropMapping(); + + $skipKey = array(); + foreach ($k2check as $key => $value) { + $translate = $buildProp[$key]; + if (! isset($skipKey[$translate])) { + $build->$translate = $value; + if (property_exists($item, $key)) { + $build->$translate = $item->$key; + $skipKey[$translate] = true; + } + } + } + + $itemID = $this->buildMgr->createFromObject($build); + if ($itemID > 0) { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'details' => array(), + 'id' => $itemID + ); + } + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * + * @param + * string id: build id + * @param + * string [notes] + * @param + * string [active] + * @param + * string [open] + * @param + * string [releasedate]: format YYYY-MM-DD; + * @param + * int [copytestersfrombuild] + * + * step 1) is a number ? + * will be considered a target build id. + * check will be done to verify that is + * a valid build id inside the test plan. + * + * step 2) is a string ? + * will be used as build name to search + * inside the test plan. + * + * if check is OK, tester assignments will be copied. + * + */ + public function updateBuild(Request $request, Response $response, $args) + { + $op = array( + 'status' => 'ko', + 'message' => 'ko', + 'details' => array(), + 'id' => - 1 + ); + + $id = intval($args['id']); + $rightToCheck = "testplan_create_build"; + + // need to get input, before doing right checks, + // because right can be tested against in this order + // Test Plan Right + // Test Project Right + // Default Right + $item = json_decode($request->getBody()); + if (null == $item) { + $this->byeHTTP500(__METHOD__); // No return from it + } + + $statusOK = true; + if ($id <= 0) { + $op['details'][] = $this->l10n['API_MISSING_REQUIRED_PROP'] . + 'id - the build ID'; + $statusOK = false; + } + + if ($statusOK) { + $build = $this->buildMgr->get_by_id($id); + + if (null == $build) { + $statusOK = false; + $op['message'] = sprintf($this->l10n['API_INVALID_BUILDID'], $id); + + $response = new Response(); + $response->withStatus(404); + } + } + + if ($statusOK) { + $tplan = $this->tplanMgr->get_by_id($build['testplan_id']); + + // Ready to check user permissions + $context = array( + 'tplan_id' => $tplan['id'], + 'tproject_id' => $tplan['testproject_id'] + ); + + if (! $this->userHasRight($rightToCheck, true, $context)) { + $statusOK = false; + $msg = lang_get('API_INSUFFICIENT_RIGHTS'); + $op['message'] = sprintf($msg, $rightToCheck, $this->user->login, + $context['tproject_id'], $context['tplan_id']); + + $response = new Response(); + $response->withStatus(403); + } + } + + // Go ahead, try to update build!! + if ($statusOK && property_exists($item, 'name') && + $this->tplanMgr->check_build_name_existence($tplan['id'], + $item->name, $id)) { + $statusOK = false; + $op['message'] = sprintf( + $this->l10n['API_BUILDNAME_ALREADY_EXISTS'], $item->name, $id); + + $response = new Response(); + $response->withStatus(409); + } + + // Step 2 - Finally Update It!! + if ($statusOK) { + $k2check = array( + 'is_open', + 'name', + 'release_candidate', + 'notes', + 'commit_id', + 'tag', + 'branch', + 'is_active', + 'active', + 'releasedate', + 'release_date', + 'copy_testers_from_build', + 'copytestersfrombuild' + ); + + $buildProp = $this->buildPropMapping(); + + $skipKey = array(); + $buildObj = new stdClass(); + $attr = array(); + foreach ($k2check as $key) { + $translate = $buildProp[$key]; + if (! isset($skipKey[$translate])) { + + // init with value got from DB. + if (isset($build[$translate])) { + $buildObj->$translate = $build[$translate]; + } + + if (property_exists($item, $key)) { + $buildObj->$translate = $item->$key; + $skipKey[$translate] = true; + } + + if (property_exists($buildObj, $translate)) { + $attr[$translate] = $buildObj->$translate; + } + } + } + + // key 2 check + // $id,$name,$notes,$active=null,$open=null, + // $release_date='',$closed_on_date='') { + + $ox = $this->buildMgr->update($build['id'], $buildObj->name, + $buildObj->notes, $attr); + + if ($ox) { + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'details' => array(), + 'id' => $id + ); + + // Special processing Build Closing/Opening + // we need also to manage close on date. + if (property_exists($item, 'is_open')) { + $oio = intval($build['is_open']); + $nio = intval($item->is_open); + if ($oio != $nio) { + if ($nio) { + $this->buildMgr->setOpen($id); + } else { + $this->buildMgr->setClosed($id); + } + } + } + } + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * 'name' + * 'testProjectID' + * 'testProjectPrefix' + * 'notes' + * 'active' + * 'is_public' + */ + public function createTestPlan(Request $request, Response $response) + { + $op = $this->getStdIDKO(); + try { + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $opeOpt = array( + 'setSessionProject' => false, + 'doChecks' => true + ); + + if (property_exists($item, 'testProjectPrefix')) { + $pi = $this->tprojectMgr->get_by_prefix( + trim($item->testProjectPrefix)); + $item->testProjectID = intval($pi[id]); + } + + $op['id'] = $this->tplanMgr->createFromObject($item, $opeOpt); + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * 'name' + * 'testProjectID' + * 'notes' + * 'active' + * 'is_public' + */ + public function updateTestPlan(Request $request, Response $response, $args) + { + $op = $this->getStdIDKO(); + $id = intval($args['id']); + try { + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $item = json_decode($request->getBody()); + $item->id = $id; + var_dump($item); + $op['id'] = $this->tplanMgr->updateFromObject($item); + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * Request Body + * + * $ex->testPlanID + * $ex->buildID + * $ex->platformID -> optional + * $ex->testCaseExternalID + * $ex->notes + * $ex->statusCode + * $ex-steps [] + * An example: + * "steps":[ + * { + * "stepNumber":1, + * "notes":"This is an execution created via REST API", + * "statusCode":"b" + * }, + * { + * "stepNumber":12, + * "notes":"This is an execution created via REST API", + * "statusCode":"f" + * } + * ] + * + * Checks to be done + * + * A. User right & Test plan existence + * user has right to execute on target Test plan? + * this means also that: Test plan ID exists ? + * + * B. Build + * does Build ID exist on target Test plan ? + * is Build enable to execution ? + * + * C. Platform + * do we need a platform ID in order to execute ? + * is a platform present on provided data ? + * does this platform belong to target Test plan ? + * + * D. Test case identity + * is target Test case part of Test plan ? + * + * + * Z. Other mandatory information + * We are not going to check for other mandatory info + * like: mandatory custom fields. (if we will be able in future to manage it) + */ + public function createTestCaseExecution(Request $request, Response $response) + { + $op = $this->getStdIDKO(); + + try { + $ex = json_decode($request->getBody()); + $util = $this->checkExecutionEnvironment($ex); + + // Complete missing propertie + if (! property_exists($ex, 'platformID')) { + $ex->platformID = 0; + } + + if (! property_exists($ex, 'executionType')) { + $ex->executionType = $this->cfg['tcase']['executionType']['auto']; + } + + // If we are here this means we can write execution status!!! + $ex->testerID = $this->userID; + foreach ($util as $prop => $value) { + $ex->$prop = $value; + } + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + + // This writes ONLY a test case level, not steps + $op['id'] = $this->tplanMgr->writeExecution($ex); + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * 'name' + * 'testProjectID' + * 'parentID' + * 'notes' + * 'order' + */ + public function createTestSuite(Request $request, Response $response) + { + $op = $this->getStdIDKO(); + try { + $item = json_decode($request->getBody()); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $this->tsuiteMgr->createFromObject($item, + array( + 'doChecks' => true + )); + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * body will contain an array of objects + * that can be + * {'name': platform name} + * {'id': platform id} + * + * Check if done to understand if all platforms + * exist before doing any action + */ + public function addPlatformsToTestPlan(Request $request, Response $response, + $args) + { + $op = $this->getStdIDKO(); + $tplan_id = intval($args['tplan_id']); + try { + $plat2link = json_decode($request->getBody()); + + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $statusOK = true; + if (null == $plat2link || ! is_array($plat2link)) { + $statusOK = false; + $op['status'] = 'ko'; + $op['message'] = 'Bad Body'; + } + + if ($statusOK) { + // Validate Test plan existence. + // Get Test Project ID before doing anything + $getOpt = array( + 'output' => 'testPlanFields', + 'active' => 1, + 'testPlanFields' => 'id,testproject_id,is_public' + ); + + $testPlan = $this->tplanMgr->get_by_id($tplan_id, $getOpt); + $statusOK = ! is_null($testPlan); + + if ($statusOK) { + $tproject_id = $testPlan['testproject_id']; + } else { + $op['status'] = 'ko'; + $op['message'] = 'Invalid Test Plan ID'; + } + } + + if ($statusOK) { + // Get all test project platforms, + // that can be used on TEST PLAN + // (enabled on execution) + // + // then validate + $platMgr = new tlPlatform($this->db, $tproject_id); + $platDomain = $platMgr->getAll(); + $idToLink = []; + $op['message'] = []; + + foreach ($plat2link as $accessObj) { + $checkOK = false; + if (property_exists($accessObj, 'name')) { + $needle = trim($accessObj->name); + foreach ($platDomain as $target) { + if ($target['name'] == $needle) { + $checkOK = true; + $idToLink[$target['id']] = $target['id']; + } + } + $statusOK = $statusOK && $checkOK; + if (! $checkOK) { + $op['message'][] = " WARNING! - Platform with name:" . + $needle . " Reason: does not exist " . + " or is not enabled for execution"; + } + } + + if (property_exists($accessObj, 'id')) { + $needle = intval($accessObj->id); + foreach ($platDomain as $target) { + if ($target['id'] == $needle) { + $checkOK = true; + $idToLink[$target['id']] = $target['id']; + } + } + $statusOK = $statusOK && $checkOK; + if (! $checkOK) { + $op['message'][] = "Platform with id:" . $needle . + " does not exist"; + } + } + } + + $op['status'] = $statusOK; + } + + if ($statusOK) { + $p2link = []; + // Finally link platforms, if not linked yet + $gOpt = array( + 'outputFormat' => 'mapAccessByID' + ); + $linked = (array) $platMgr->getLinkedToTestplan($tplan_id, $gOpt); + foreach ($idToLink as $plat_id) { + if (! isset($linked[$plat_id])) { + $p2link[$plat_id] = $plat_id; + } + } + if (! empty($p2link)) { + $platMgr->linkToTestplan($p2link, $tplan_id); + } + } + + if ($op['status']) { + $op['message'] = 'ok'; + } + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * "name" + * "testSuite": {"id": xxx} + * "testProject" : {"id": xxx} or {"prefix": yyy} + * + * One of the following + * "authorLogin" + * "authorID" + * ------------------------------------------ + * + * "summary" can be a string or an array of strings + * "preconditions" can be a string or an array of strings + * + * "importance": {"name": "verbose"} + * - see const.inc.php for domain + * "executionType": {"name": "verbose"} + * - see ... for domain + * "order" + * + * "estimatedExecutionDuration" // to be implemented + * + * "steps": array of objects + * IMPORTANT NOTICE: actions and expected_results + * Can be string or array of strings + * [ + * { "step_number":1, + * "actions": "red", + * "expected_results": "#f00", + * "execution_type":1 + * }, + * { "step_number":12, + * "actions": "red12", + * "expected_results": "#f00", + * "execution_type":2 + * } + * ] + */ + public function createTestCase(Request $request, Response $response) + { + $op = $this->getStdIDKO(); + try { + + // It will be important to document WHY!!! + // AFAIK some issues with json_decode() + // https://stackoverflow.com/questions/34486346/new-lines-and-tabs-in-json-decode-php-7 + $body = str_replace("\n", '', $request->getBody()); + $item = json_decode($body); + + if (null == $item) { + $this->byeHTTP500(__METHOD__); + } + + // create obj with standard properties + $op['message'] = 'After buildTestCaseObj() >> ' . + $tcase = $this->buildTestCaseObj($item); + $this->checkRelatives($tcase); + + $ou = $this->tcaseMgr->createFromObject($tcase); + $op = array( + 'status' => 'ok', + 'message' => 'ok', + 'id' => - 1 + ); + if (($op['id'] = $ou['id']) <= 0) { + $op['status'] = 'ko'; + $op['message'] = $ou['msg']; + $response = new Response(); + $response->withStatus(409); + } + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + if ($op['message'] == 'ko') { + $op['message'] = __METHOD__ . ' >> '; + } + $op['message'] .= $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /** + * "keyword" + * "notes" + * "testProject": {"prefix":"APR"} + */ + public function createKeyword(Request $request, Response $response) + { + $op = $this->getStdIDKO(); + + try { + $body = $request->getBody(); + $bigString = $body->getContents(); + + $ba = explode('",', $bigString); + $needle = '"notes":'; + foreach ($ba as $pa => $ma) { + if (strpos($ma, $needle) !== false) { + $zz = explode($needle, $ma); + $ba[$pa] = $needle . str_replace("\n", "?^§", $zz[1]); + } + $ba[$pa] .= '",'; + } + + $bigString = implode("", $ba); + $bigString = trim($bigString, '",'); + $item = json_decode($bigString); + if (null == $item) { + $this->byeHTTP500(__METHOD__); + } + + if (property_exists($item, 'notes')) { + $item->notes = str_replace("?^§", "\n", $item->notes); + + // try to remove useless spaces + $item->notes = str_replace(" ", "", $item->notes); + } + + // create obj with standard properties + $pfx = $item->testProject->prefix; + $pid = $this->tprojectMgr->get_by_prefix((string) $pfx); + if (null == $pid) { + $op['status'] = 'ko'; + $op['message'] = "Can't get test project ID"; + } else { + $pid = $pid['id']; + $ou = $this->tprojectMgr->addKeyword($pid, $item->keyword, + $item->notes); + $op = array( + 'status' => 'ok', + 'message' => 'ok' + ); + $op['id'] = $ou['id']; + if ($ou['status'] < 0) { + $op['status'] = 'ko'; + $op['message'] = $ou['msg']; + } + } + } catch (Exception $e) { + $response = new Response(); + $response->withStatus(500); + $op['message'] = __METHOD__ . ' >> ' . $this->msgFromException($e); + } + + $payload = json_encode($op); + $response->getBody()->write($payload); + return $response; + } + + /* ************************************ */ + /* Helpers */ + /* ************************************ */ + private function buildPropMapping() + { + return array( + 'name' => 'name', + 'tplan_id' => 'tplan_id', + 'release_date' => 'release_date', + 'releasedate' => 'release_date', + 'active' => 'is_active', + 'is_active' => 'is_active', + 'notes' => 'notes', + 'commit_id' => 'commit_id', + 'tag' => 'tag', + 'branch' => 'branch', + 'release_candidate' => 'release_candidate', + 'is_open' => 'is_open', + 'copytestersfrombuild' => 'copytestersfrombuild', + 'copy_testers_from_build' => 'copytestersfrombuild' + ); + } + + /** + */ + private function buildTestCaseObj(&$obj) + { + if (is_null($obj)) { + throw new Exception("Fatal Error - " . __METHOD__ . " arg is NULL"); + } + + $tcase = new stdClass(); + $tcase->authorID = - 1; + $tcase->steps = null; + $tcase->testProjectID = - 1; + + $accessKey = array(); + $isOK = true; + + // Knowing author is critic, because rights are related to user. + // Another important thing: + // do we need to check that author when provided, has rights to do + // requested action? + // If we do not do this check, we will find in test cases created + // by people that do not have rights. + // May be is time to add a field that provide info about source of action + // GUI, API + if (property_exists($obj, 'author') && + property_exists($obj->author, 'login') || + property_exists($obj->author, 'id')) { + $tcase->authorID = $this->getUserIDByAttr($obj->author); + } + + // Last resort: get author from credentials use to make the call. + // no error message returned. + if ($tcase->authorID <= 0) { + $tcase->authorID = $this->userID; + } + + // Mandatory attributes + $ma = array( + 'name' => null, + 'testProject' => array( + 'id', + 'prefix' + ), + 'testSuite' => array( + 'id' + ) + ); + + foreach ($ma as $key => $dummy) { + if (! ($isOK = $isOK && property_exists($obj, $key))) { + throw new Exception("Missing Attribute: {$key} "); + } + } + + foreach ($ma as $key => $attr) { + if (! is_null($attr)) { + $attrOK = false; + foreach ($attr as $ak) { + $accessKey[$key][$ak] = property_exists($obj->$key, $ak); + $attrOK = $attrOK || $accessKey[$key][$ak]; + } + + if (! $attrOK) { + $msg = "Attribute: {$key} mandatory key ("; + if (count($attr) > 1) { + $msg .= "one of set: "; + } + $msg .= implode('/', $attr) . ") is missing"; + throw new Exception($msg); + } + } + } + + $tcase->name = trim($obj->name); + $tcase->testSuiteID = intval($obj->testSuite->id); + + $gOpt = array( + 'output' => 'array_of_map', + 'field_set' => 'prefix', + 'add_issuetracker' => false, + 'add_reqmgrsystem' => false + ); + + $msg = "Test project with "; + if ($accessKey['testProject']['id']) { + $safeID = intval($obj->testProject->id); + $gFilters = array( + 'id' => array( + 'op' => '=', + 'value' => $safeID + ) + ); + $msg .= "id={$safeID} "; + } + + if ($accessKey['testProject']['prefix']) { + $gFilters = array( + 'prefix' => array( + 'op' => '=', + 'value' => trim($obj->testProject->prefix) + ) + ); + $msg .= "prefix={$obj->testProject->prefix} "; + } + + $info = $this->tprojectMgr->get_accessible_for_user($this->userID, $gOpt, + $gFilters); + + if (is_null($info)) { + $msg .= "does not exist or you have no rights to use it"; + throw new Exception($msg, 999); + } + + $tcase->testProjectID = intval($info[0]['id']); + + // summary & preconditions + // if type is array -> generate string in this way + // - add
    +        // - concact the elements with "\n"
    +        // - add 
    + $sk2d = array( + 'summary' => '', + 'preconditions' => '' + ); + foreach ($sk2d as $key => $value) { + if (is_array($tcase->$key)) { + $tcase->$key = "
    " . implode("\n", $tcase->$key) . "
    "; + } + } + + // these are objects with name as property. + $tcfg = $this->cfg['tcase']; + $ck2d = array( + 'executionType' => $tcfg['executionType']['manual'], + 'importance' => $tcfg['defaults']['importance'], + 'status' => $tcfg['status']['draft'] + ); + + foreach ($ck2d as $prop => $defa) { + $tcase->$prop = property_exists($obj, $prop) ? $tcfg[$prop][$obj->$prop->name] : $defa; + } + + if (property_exists($obj, 'steps')) { + $tcase->steps = []; + $sk2d = array( + 'actions' => '', + 'expected_results' => '' + ); + foreach ($obj->steps as $stepObj) { + foreach ($sk2d as $key => $value) { + if (is_array($stepObj->$key)) { + $stepObj->$key = "
    " . implode("\n", $stepObj->$key) .
    +                            "
    "; + } + } + $tcase->steps[] = $stepObj; + } + } + + return $tcase; + } + + /** + */ + private function checkExecutionEnvironment($ex) + { + + // no platform + $platform = 0; + + // Test plan ID exists and is ACTIVE + $msg = 'invalid Test plan ID'; + $getOpt = array( + 'output' => 'testPlanFields', + 'active' => 1, + 'testPlanFields' => 'id,testproject_id,is_public' + ); + $status_ok = ! is_null( + $testPlan = $this->tplanMgr->get_by_id($ex->testPlanID, $getOpt)); + + if ($status_ok) { + // user has right to execute on Test plan ID + // hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) + $msg = 'user has no right to execute'; + $status_ok = $this->user->hasRight($this->db, 'testplan_execute', + $testPlan['testproject_id'], $ex->testPlanID, true); + } + + if ($status_ok) { + // Check if couple (buildID,testPlanID) is valid + $msg = '(buildID,testPlanID) couple is not valid'; + $getOpt = array( + 'fields' => 'id,active,is_open', + 'buildID' => $ex->buildID, + 'orderBy' => null + ); + $status_ok = ! is_null( + $build = $this->tplanMgr->get_builds($ex->testPlanID, null, null, + $getOpt)); + + if ($status_ok) { + // now check is execution can be done againts this build + $msg = 'Build is not active and/or closed => execution can not be done'; + $status_ok = $build[$ex->buildID]['active'] && + $build[$ex->buildID]['is_open']; + } + } + + if ($status_ok && property_exists($ex, 'platformID')) { + // Get Test plan platforms + $platform = $ex->platformID; + + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => false + ); + $platformSet = $this->tplanMgr->getPlatforms($ex->testPlanID, + $getOpt); + + if (! ($hasPlatforms = ! is_null($platformSet)) && $platform != 0) { + $status_ok = false; + $msg = 'You can not execute against a platform, because Test plan has no platforms'; + } + + if ($status_ok && $hasPlatforms) { + if ($platform == 0) { + $status_ok = false; + $msg = 'Test plan has platforms, you need to provide one in order to execute'; + } elseif (! isset($platformSet[$platform])) { + $status_ok = false; + $msg = '(platform,test plan) couple is not valid'; + } + } + } + + if ($status_ok) { + // Test case check + $msg = 'Test case does not exist'; + + $tcaseID = $this->tcaseMgr->getInternalID($ex->testCaseExternalID); + if ($status_ok = ($tcaseID > 0)) { + $msg = 'Test case doesn not belong to right test project'; + $testCaseTestProject = $this->tcaseMgr->getTestProjectFromTestCase( + $tcaseID, 0); + $status_ok = ($testCaseTestProject == $testPlan['testproject_id']); + } + + if ($status_ok) { + // Does this test case is linked to test plan ? + $msg = 'Test case is not linked to (test plan,platform) => can not be executed'; + $getFilters = array( + 'testplan_id' => $ex->testPlanID, + 'platform_id' => $platform + ); + + $getOpt = array( + 'output' => 'simple' + ); + $links = $this->tcaseMgr->get_linked_versions($tcaseID, + $getFilters, $getOpt); + $status_ok = ! is_null($links); + } + } + + if ($status_ok) { + // status code is OK ? + $msg = 'not run status is not a valid execution status (can not be written to DB)'; + $status_ok = ($ex->statusCode != + $this->cfg['exec']['statusCode']['not_run']); + + if ($status_ok) { + $msg = 'Requested execution status is not configured on TestLink'; + $status_ok = isset( + $this->cfg['exec']['codeStatus'][$ex->statusCode]); + } + } + + if ($status_ok) { + $ret = new stdClass(); + $ret->testProjectID = $testPlan['testproject_id']; + $ret->testCaseVersionID = key($links); + $ret->testCaseVersionNumber = $links[$ret->testCaseVersionID][$ex->testPlanID][$platform]['version']; + } + + if (! $status_ok) { + throw new Exception($msg); + } + + return $ret; + } + + /** + */ + private function checkRelatives($ctx) + { + $testProjectID = $ctx->testProjectID; + $testSuiteID = $ctx->testSuiteID; + if ($testProjectID <= 0) { + throw new Exception("Test Project ID is invalid (<=0)"); + } + + if ($testSuiteID <= 0) { + throw new Exception("Test Suite ID is invalid (<=0)"); + } + + $pinfo = $this->tprojectMgr->get_by_id($testProjectID); + if (is_null($pinfo)) { + throw new Exception("Test Project ID is invalid (does not exist)"); + } + + $pinfo = $this->tsuiteMgr->get_by_id($testSuiteID); + if (is_null($pinfo)) { + throw new Exception("Test Suite ID is invalid (does not exist)"); + } + + if ($testProjectID != + $this->tsuiteMgr->getTestProjectFromTestSuite($testSuiteID, + $testSuiteID)) { + throw new Exception("Test Suite does not belong to Test Project ID"); + } + } + + /** + * checks if a user has requested right on test project, test plan pair. + * + * @param string $rightToCheck + * one of the rights defined in rights table + * @param boolean $checkPublicPrivateAttr + * (optional) + * @param array $context + * (optional) + * keys tproject_id,tplan_id (both are also optional) + * + * @return boolean + * @access protected + * + * + */ + protected function userHasRight($rightToCheck, + $checkPublicPrivateAttr = false, $context = null) + { + $status_ok = true; + + // for global rights context is NULL + if (is_null($context)) { + $tproject_id = 0; + $tplan_id = null; + } else { + $tproject_id = intval( + isset($context['tproject_id']) ? $context['tproject_id'] : 0); + + $tplan_id = null; + if (isset($context['tplan_id'])) { + $tplan_id = intval($context['tplan_id']); + } + + if ($tproject_id <= 0 && ! is_null($tplan_id)) { + // get test project from test plan + $dummy = $this->tplanMgr->get_by_id($tplanid, + array( + 'output' => 'minimun' + )); + $tproject_id = intval($dummy['tproject_id']); + } + } + + if (! $this->user->hasRight($this->db, $rightToCheck, $tproject_id, + $tplan_id, $checkPublicPrivateAttr)) { + $status_ok = false; + } + return $status_ok; + } + + /** + */ + private function getStdOp() + { + return array( + 'status' => 'ok', + 'message' => 'ok', + 'items' => null + ); + } + + /** + */ + private function getStdIDKO() + { + return array( + 'status' => 'ko', + 'message' => 'ko', + 'id' => - 1 + ); + } + + /** + */ + private function byeHTTP500($msg = null) + { + $op = array(); + if (null == $msg) { + $msg = 'TestLink Fatal Error - Malformed Request Body - ' . + ' json_decode() issue'; + } + $op['details'][] = sprintf($msg); + + $response = new Response(); + $response->getBody()->write('Malformed Request Body'); + $response->withStatus(500); + return $response; + } + + /** + */ + private function msgFromException($e) + { + return $e->getMessage() . ' - offending line number: ' . $e->getLine(); + } +} diff --git a/lib/api/rest/v3/core/routes.php b/lib/api/rest/v3/core/routes.php index f0e2404fae..ccea4dfa04 100644 --- a/lib/api/rest/v3/core/routes.php +++ b/lib/api/rest/v3/core/routes.php @@ -1,69 +1,98 @@ -get('/',World::class . ':hello'); - - // using array(), was the way in Slim3 and - // still seems valid - $app->get('/whoAmI',array($app->restApi,'whoAmI')); - - $app->get('/testprojects', - array($app->restApi,'testprojects')); - $app->get('/testprojects/{id}', - array($app->restApi,'testprojects')); - - $app->get('/testprojects/{id}/testcases', - array($app->restApi,'getProjectTestCases')); - $app->get('/testprojects/{mixedID}/testplans', - array($app->restApi,'getProjectTestPlans')); - - $app->get('/testplans/{tplanApiKey}/builds', - array($app->restApi,'getPlanBuilds')); - - /* - $app->get('/builds/{id}', - array($app->restApi,'getBuild')); - */ - - $app->post('/executions', - array($app->restApi,'createTestCaseExecution')); - - $app->post('/builds', - array($app->restApi,'createBuild')); - - $app->post('/keywords', - array($app->restApi,'createKeyword')); - - $app->post('/testcases', - array($app->restApi,'createTestCase')); - - $app->post('/testplans', - array($app->restApi,'createTestPlan')); - - $app->post('/testprojects', - array($app->restApi,'createTestProject')); - - $app->post('/testsuites', - array($app->restApi,'createTestSuite')); - - - // Update Routes - // Following advice from - // https://restfulapi.net/rest-put-vs-post/ - // - $app->put('/builds/{id}', - array($app->restApi,'updateBuild')); - - $app->put('/testplans/{id}', - array($app->restApi,'updateTestPlan')); - - $app->put('/testplans/{tplan_id}/platforms', - array($app->restApi,'addPlatformsToTestPlan')); - +get('/',World::class . ':hello'); + + // using array(), was the way in Slim3 and + // still seems valid + $app->get('/whoAmI', array( + $app->restApi, + 'whoAmI' + )); + + $app->get('/testprojects', array( + $app->restApi, + 'testprojects' + )); + $app->get('/testprojects/{id}', array( + $app->restApi, + 'testprojects' + )); + + $app->get('/testprojects/{id}/testcases', + array( + $app->restApi, + 'getProjectTestCases' + )); + $app->get('/testprojects/{mixedID}/testplans', + array( + $app->restApi, + 'getProjectTestPlans' + )); + + $app->get('/testplans/{tplanApiKey}/builds', + array( + $app->restApi, + 'getPlanBuilds' + )); + + $app->post('/executions', array( + $app->restApi, + 'createTestCaseExecution' + )); + + $app->post('/builds', array( + $app->restApi, + 'createBuild' + )); + + $app->post('/keywords', array( + $app->restApi, + 'createKeyword' + )); + + $app->post('/testcases', array( + $app->restApi, + 'createTestCase' + )); + + $app->post('/testplans', array( + $app->restApi, + 'createTestPlan' + )); + + $app->post('/testprojects', array( + $app->restApi, + 'createTestProject' + )); + + $app->post('/testsuites', array( + $app->restApi, + 'createTestSuite' + )); + + // Update Routes + // Following advice from + // https://restfulapi.net/rest-put-vs-post/ + // + $app->put('/builds/{id}', array( + $app->restApi, + 'updateBuild' + )); + + $app->put('/testplans/{id}', array( + $app->restApi, + 'updateTestPlan' + )); + + $app->put('/testplans/{tplan_id}/platforms', + array( + $app->restApi, + 'addPlatformsToTestPlan' + )); }; diff --git a/lib/api/rest/v3/custom/api/RestApiCustomExample.class.php b/lib/api/rest/v3/custom/api/RestApiCustomExample.class.php index bfefd4c407..ee3e1e5b97 100644 --- a/lib/api/rest/v3/custom/api/RestApiCustomExample.class.php +++ b/lib/api/rest/v3/custom/api/RestApiCustomExample.class.php @@ -1,4 +1,4 @@ - - * @package TestLink + * @package TestLink */ class RestApiCustomExample extends RestApi { @@ -31,12 +31,12 @@ class RestApiCustomExample extends RestApi /** */ - public function __construct() + public function __construct() { $this->db = new database(DB_TYPE); $this->db->db->SetFetchMode(ADODB_FETCH_ASSOC); doDBConnect($this->db,database::ONERROREXIT); - } + } @@ -44,7 +44,7 @@ public function __construct() * */ public function whoAmI(Request $request, Response $response, $args) - { + { $msg = json_encode(array('name' => __CLASS__ . ' : You have called Get Route /whoAmI')); $response->getBody()->write($msg); return $response; diff --git a/lib/api/rest/v3/custom/routes/routesCustomExample.php b/lib/api/rest/v3/custom/routes/routesCustomExample.php index c8ecae8d79..e72936a99f 100644 --- a/lib/api/rest/v3/custom/routes/routesCustomExample.php +++ b/lib/api/rest/v3/custom/routes/routesCustomExample.php @@ -9,8 +9,8 @@ use Slim\App; -return function (App $app) { +return function (App $app): void { $app->get('/CustomExample/whoAmI', array($app->restApiCustomExample,'whoAmI')); -}; \ No newline at end of file +}; diff --git a/lib/api/rest/v3/index.php b/lib/api/rest/v3/index.php index 10c2e561bb..92990102c9 100644 --- a/lib/api/rest/v3/index.php +++ b/lib/api/rest/v3/index.php @@ -4,14 +4,14 @@ use Slim\Factory\AppFactory; -require_once('../../../../config.inc.php'); -require 'autoload.php'; -require 'RestApi.class.php'; +require_once '../../../../config.inc.php'; +require_once 'autoload.php'; +require_once 'RestApi.class.php'; $app = AppFactory::create(); -// CRITIC -// This will work if your url to test link +// CRITIC +// This will work if your url to test link // is something like // // https://testlink.antartic.org/ @@ -21,15 +21,15 @@ // You need to use: // $basePath = "/testlink/lib/api/rest/v3"; // -// The standard .htaccess provided with testlink, +// The standard .htaccess provided with testlink, // that is similar to the .htaccess provided by MantisBT // it's ok!!! // No need to proceed as detailed in this documentation -// - https://www.slimframework.com/docs/v4/start/web-servers.html +// - https://www.slimframework.com/docs/v4/start/web-servers.html // Section: Running in a sub-directory // // - https://akrabat.com/running-slim-4-in-a-subdirectory/ -// BUT this is a good example to understand how to configure +// BUT this is a good example to understand how to configure // $basePath = config_get('restAPI')->basePath; $app->setBasePath($basePath); @@ -49,7 +49,7 @@ foreach ($itera as $fileinfo) { if ($fileinfo->isFile()) { $who = $fileinfo->getFilename(); - require ($where . $who); + require_once $where . $who; // generate class name $className = str_replace('.class.php', '', $who); @@ -72,7 +72,7 @@ foreach ($itera as $fileinfo) { if ($fileinfo->isFile()) { $who = $fileinfo->getFilename(); - $customRoutes = require ($where . $who); + $customRoutes = require_once $where . $who; $customRoutes($app); } } @@ -80,7 +80,7 @@ // * Load Custom API - END // Register Standard routes -$routes = require './core/routes.php'; +$routes = require_once './core/routes.php'; $routes($app); // Middleware diff --git a/lib/api/rest/v3/untitled.php b/lib/api/rest/v3/untitled.php deleted file mode 100644 index f43c5611c0..0000000000 --- a/lib/api/rest/v3/untitled.php +++ /dev/null @@ -1,33 +0,0 @@ - $buildProp = array('tplan_id' => 'tplan_id', - 'release_date' => 'release_date', - 'releasedate' => 'release_date', - 'active' => 'is_active', - 'is_active' => 'is_active', - 'notes' => 'notes', - 'commit_id' => 'commit_id', - 'tag' => 'tag', - 'branch' => 'branch', - 'is_open' => 'is_open', - 'release_candidate' => - 'release_candidate', - 'copytestersfrombuild' => - 'copytestersfrombuild', - 'copy_testers_from_build' => - 'copytestersfrombuild'); - - - $buildProp = array('name' => 'name', - 'tplan_id' => 'tplan_id', - 'release_date' => 'release_date', - 'releasedate' => 'release_date', - 'active' => 'is_active', - 'is_active' => 'is_active', - 'notes' => 'notes', - 'commit_id' => 'commit_id', - 'tag' => 'tag', 'branch' => 'branch', - 'release_candidate' =>'release_candidate', - 'is_open' => 'is_open', - 'copytestersfrombuild' => - 'copytestersfrombuild', - 'copy_testers_from_build' => - 'copytestersfrombuild'); diff --git a/lib/api/xmlrpc/v1/APIErrors.php b/lib/api/xmlrpc/v1/APIErrors.php index f967bc942a..208735afc6 100644 --- a/lib/api/xmlrpc/v1/APIErrors.php +++ b/lib/api/xmlrpc/v1/APIErrors.php @@ -1,402 +1,434 @@ - - * @package TestlinkAPI - * - * - */ - - /** - * general config file gives us lang_get access - */ -require_once 'lang_api.php'; - -/**#@+ - * Constants - */ - - -/** - * a catch all generic error - */ -define('GENERAL_ERROR_CODE', -1); -define('GENERAL_SUCCESS_CODE', 1); - -// IMPORTANT: -// lang_get('API_GENERAL_SUCCESS',null,1) -// null -> use user locale -// 1 -> do not log on audit system if localized string do not exist -// -define('GENERAL_SUCCESS_STR', lang_get('API_GENERAL_SUCCESS',null,1)); - -define('NOT_YET_IMPLEMENTED', 50); -define('NOT_YET_IMPLEMENTED_STR', lang_get('API_NOT_YET_IMPLEMENTED',null,1)); - -/** - * Error codes below 1000 are system level - */ -define('NO_DEV_KEY', 100); -define('NO_DEV_KEY_STR', lang_get('API_NO_DEV_KEY',null,1)); - -define('NO_TCASEID', 110); -define('NO_TCASEID_STR', lang_get('API_NO_TCASEID',null,1)); - -define('NO_TCASEEXTERNALID', 110); -define('NO_TCASEEXTERNALID_STR', lang_get('API_NO_TCASEEXTERNALID',null,1)); - -define('NO_TCASEVERSIONID', 111); -define('NO_TCASEVERSIONID_STR', lang_get('API_NO_TCASEVERSIONID',null,1)); - -define('NO_TPLANID', 120); -define('NO_TPLANID_STR', lang_get('API_NO_TPLANID',null,1)); - -define('NO_BUILDID', 130); -define('NO_BUILDID_STR', lang_get('API_NO_BUILDID',null,1)); - -define('NO_TEST_MODE', 140); -define('NO_TEST_MODE_STR', lang_get('API_NO_TEST_MODE',null,1)); - -define('NO_STATUS', 150); -define('NO_STATUS_STR', lang_get('API_NO_STATUS',null,1)); - -define('NO_TESTPROJECTID', 160); -define('NO_TESTPROJECTID_STR', lang_get('API_NO_TESTPROJECTID',null,1)); - -define('NO_TESTCASENAME', 170); -define('NO_TESTCASENAME_STR', lang_get('API_NO_TESTCASENAME',null,1)); - -define('NO_TESTSUITEID', 180); -define('NO_TESTSUITEID_STR', lang_get('API_NO_TESTSUITEID',null,1)); - -define('MISSING_REQUIRED_PARAMETER', 200); -define('MISSING_REQUIRED_PARAMETER_STR', lang_get('API_MISSING_REQUIRED_PARAMETER',null,1)); - -define('PARAMETER_NOT_INT',210); -define('PARAMETER_NOT_INT_STR', lang_get('API_PARAMETER_NOT_INT',null,1)); - -define('NO_TESTSUITENAME', 220); -define('NO_TESTSUITENAME_STR', lang_get('API_NO_TESTSUITENAME',null,1)); - -define('NODEID_IS_NOT_INTEGER',230); -define('NODEID_IS_NOT_INTEGER_STR',lang_get('API_NODEID_IS_NOT_INTEGER',null,1)); - -define('NODEID_DOESNOT_EXIST',231); -define('NODEID_DOESNOT_EXIST_STR',lang_get('API_NODEID_DOESNOT_EXIST',null,1)); - -define('CFG_DELETE_EXEC_DISABLED',232); -define('CFG_DELETE_EXEC_DISABLED_STR',lang_get('API_CFG_DELETE_EXEC_DISABLED',null,1)); - -define('NO_PLATFORMID', 233); -define('NO_PLATFORMID_STR', lang_get('API_NO_PLATFORMID',null,1)); - - -define('NODEID_INVALID_DATA_TYPE', 234); -define('NODEID_INVALID_DATA_TYPE_STR', lang_get('API_NODEID_INVALID_DATA_TYPE',null,1)); - - -define('PLATFORM_NAME_DOESNOT_EXIST', 235); -define('PLATFORM_NAME_DOESNOT_EXIST_STR', lang_get('API_PLATFORM_NAME_DOESNOT_EXIST',null,1)); - -define('NO_MATCH', 236); -define('NO_MATCH_STR', lang_get('API_NO_MATCH',null,1)); - -define('INVALID_TIMESTAMP', 237); -define('INVALID_TIMESTAMP_STR', lang_get('API_INVALID_TIMESTAMP',null,1)); - -define('TSUITE_NOT_ON_TCASE_TPROJ', 238); -define('TSUITE_NOT_ON_TCASE_TPROJ_STR', - lang_get('API_TSUITE_NOT_ON_TCASE_TPROJ',null,1)); - -/** - * 2000 level - authentication errors - */ -define('INVALID_AUTH', 2000); -define('INVALID_AUTH_STR', lang_get('API_INVALID_AUTH',null,1)); -define('INSUFFICIENT_RIGHTS', 2010); -define('INSUFFICIENT_RIGHTS_STR', lang_get('API_INSUFFICIENT_RIGHTS',null,1)); -define('UPDATER_INSUFFICIENT_RIGHTS', 2015); -define('UPDATER_INSUFFICIENT_RIGHTS_STR', - lang_get('API_UPDATER_INSUFFICIENT_RIGHTS',null,1)); -define('MUST_BE_ADMIN', 2016); -define('MUST_BE_ADMIN_STR', lang_get('API_MUST_BE_ADMIN',null,1)); - - -/** - * 3000 level - Test Plan errors - */ -define('INVALID_TPLANID', 3000); -define('INVALID_TPLANID_STR', lang_get('API_INVALID_TPLANID',null,1)); -define('TPLANID_NOT_INTEGER', 3010); -define('TPLANID_NOT_INTEGER_STR', lang_get('API_TPLANID_NOT_INTEGER',null,1)); -define('NO_BUILD_FOR_TPLANID', 3020); -define('NO_BUILD_FOR_TPLANID_STR', lang_get('API_NO_BUILD_FOR_TPLANID',null,1)); -define('TCASEID_NOT_IN_TPLANID', 3030); -define('TCASEID_NOT_IN_TPLANID_STR', lang_get('API_TCASEID_NOT_IN_TPLANID',null,1)); - -define('TPLAN_HAS_NO_BUILDS',3031); -define('TPLAN_HAS_NO_BUILDS_STR', lang_get('API_TPLAN_HAS_NO_BUILDS',null,1)); - -define('BAD_BUILD_FOR_TPLAN', 3032); -define('BAD_BUILD_FOR_TPLAN_STR', lang_get('API_BAD_BUILD_FOR_TPLAN',null,1)); - -define('TESTPLANNAME_DOESNOT_EXIST', 3033); -define('TESTPLANNAME_DOESNOT_EXIST_STR', lang_get('API_TESTPLANNAME_DOESNOT_EXIST',null,1)); - -define('TESTPLANNAME_ALREADY_EXISTS', 3034); -define('TESTPLANNAME_ALREADY_EXISTS_STR', lang_get('API_TESTPLANNAME_ALREADY_EXISTS',null,1)); - - -define('PLATFORM_NOT_LINKED_TO_TESTPLAN', 3040); -define('PLATFORM_NOT_LINKED_TO_TESTPLAN_STR', lang_get('API_PLATFORM_NOT_LINKED_TO_TESTPLAN',null,1)); - -define('TESTPLAN_HAS_NO_PLATFORMS', 3041); -define('TESTPLAN_HAS_NO_PLATFORMS_STR',lang_get('API_TESTPLAN_HAS_NO_PLATFORMS',null,1)); - -define('TCASEID_NOT_IN_TPLANID_FOR_PLATFORM', 3042); -define('TCASEID_NOT_IN_TPLANID_FOR_PLATFORM_STR', lang_get('API_TCASEID_NOT_IN_TPLANID_FOR_PLATFORM',null,1)); - -define('MISSING_PLATFORMID_BUT_NEEDED', 3043); -define('MISSING_PLATFORMID_BUT_NEEDED_STR', lang_get('API_MISSING_PLATFORMID_BUT_NEEDED',null,1)); - -define('PLATFORM_ID_NOT_LINKED_TO_TESTPLAN', 3044); -define('PLATFORM_ID_NOT_LINKED_TO_TESTPLAN_STR', lang_get('API_PLATFORM_ID_NOT_LINKED_TO_TESTPLAN',null,1)); - -define('LINKED_FEATURE_ALREADY_EXISTS', 3045); -define('LINKED_FEATURE_ALREADY_EXISTS_STR', lang_get('API_LINKED_FEATURE_ALREADY_EXISTS',null,1)); - -define('OTHER_VERSION_IS_ALREADY_LINKED', 3046); -define('OTHER_VERSION_IS_ALREADY_LINKED_STR', lang_get('API_OTHER_VERSION_IS_ALREADY_LINKED',null,1)); - -define('TCVERSIONID_NOT_IN_TPLANID', 3047); -define('TCVERSIONID_NOT_IN_TPLANID_STR', lang_get('API_TCVERSIONID_NOT_IN_TPLANID',null,1)); - - -/** - * 4000 level - Build errors - */ -define('INVALID_BUILDID', 4000); -define('INVALID_BUILDID_STR', lang_get('API_INVALID_BUILDID',null,1)); - -define('BUILDID_NOT_INTEGER', 4010); -define('BUILDID_NOT_INTEGER_STR', lang_get('API_BUILDID_NOT_INTEGER',null,1)); - -define('BUILDID_NOGUESS', 4020); -define('BUILDID_NOGUESS_STR', lang_get('API_BUILDID_NOGUESS',null,1)); - -define('BUILDNAME_ALREADY_EXISTS', 4030); -define('BUILDNAME_ALREADY_EXISTS_STR', lang_get('API_BUILDNAME_ALREADY_EXISTS',null,1)); - -define('BUILDNAME_DOES_NOT_EXIST', 4040); -define('BUILDNAME_DOES_NOT_EXIST_STR', lang_get('API_BUILDNAME_DOES_NOT_EXIST',null,1)); - - - -/** - * 5000 level - Test Case errors - */ -define('INVALID_TCASEID', 5000); -define('INVALID_TCASEID_STR' , lang_get('API_INVALID_TCASEID',null,1)); -define('INVALID_TCASEVERSIONID', 5001); -define('INVALID_TCASEVERSIONID_STR' , lang_get('API_INVALID_TCASEVERSIONID',null,1)); -define('TCASEID_NOT_INTEGER', 5010); -define('TCASEID_NOT_INTEGER_STR', lang_get('API_TCASEID_NOT_INTEGER',null,1)); -define('TCASEVERSIONID_NOT_INTEGER', 5011); -define('TCASEVERSIONID_NOT_INTEGER_STR', lang_get('API_TCASEVERSIONID_NOT_INTEGER',null,1)); -define('TESTCASENAME_NOT_STRING', 5020); -define('TESTCASENAME_NOT_STRING_STR', lang_get('API_TESTCASENAME_NOT_STRING',null,1)); -define('NO_TESTCASE_BY_THIS_NAME', 5030); -define('NO_TESTCASE_BY_THIS_NAME_STR', lang_get('API_NO_TESTCASE_BY_THIS_NAME',null,1)); -define('INVALID_TESTCASE_EXTERNAL_ID', 5040); -define('INVALID_TESTCASE_EXTERNAL_ID_STR', lang_get('API_INVALID_TESTCASE_EXTERNAL_ID',null,1)); -define('INVALID_TESTCASE_VERSION_NUMBER', 5050); -define('INVALID_TESTCASE_VERSION_NUMBER_STR', lang_get('API_INVALID_TESTCASE_VERSION_NUMBER',null,1)); -define('TCASE_VERSION_NUMBER_KO',5051); -define('TCASE_VERSION_NUMBER_KO_STR', lang_get('API_TCASE_VERSION_NUMBER_KO',null,1)); - -define('VERSION_NOT_VALID',5052); -define('VERSION_NOT_VALID_STR', lang_get('API_VERSION_NOT_VALID',null,1)); -define('NO_TESTCASE_FOUND', 5053); -define('NO_TESTCASE_FOUND_STR', lang_get('API_NO_TESTCASE_FOUND',null,1)); - - -/** - * 6000 level - Status errors - */ -define('INVALID_STATUS', 6000); -define('INVALID_STATUS_STR' , lang_get('API_INVALID_STATUS',null,1)); - -define('ATTACH_TEMP_FILE_CREATION_ERROR', 6001); -define('ATTACH_TEMP_FILE_CREATION_ERROR_STR' , lang_get('API_ATTACH_TEMP_FILE_CREATION_ERROR',null,1)); - -define('ATTACH_DB_WRITE_ERROR', 6002); -define('ATTACH_DB_WRITE_ERROR_STR', lang_get('API_ATTACH_DB_WRITE_ERROR',null,1)); - -define('ATTACH_FEATURE_DISABLED', 6003); -define('ATTACH_FEATURE_DISABLED_STR', lang_get('API_ATTACH_FEATURE_DISABLED',null,1)); - -define('ATTACH_INVALID_FK', 6004); -define('ATTACH_INVALID_FK_STR', lang_get('API_ATTACH_INVALID_FK',null,1)); - -define('ATTACH_INVALID_ATTACHMENT', 6005); -define('ATTACH_INVALID_ATTACHMENT_STR', lang_get('API_ATTACH_INVALID_ATTACHMENT',null,1)); - - -/** - * 7000 level - Test Project errors - */ -define('INVALID_TESTPROJECTID', 7000); -define('INVALID_TESTPROJECTID_STR' , lang_get('API_INVALID_TESTPROJECTID',null,1)); - -define('TESTPROJECTNAME_SINTAX_ERROR', 7001); -define('TESTPROJECTNAME_EXISTS', 7002); -define('TESTPROJECT_TESTCASEPREFIX_EXISTS', 7003); -define('TESTPROJECT_TESTCASEPREFIX_IS_EMPTY', 7004); -define('TESTPROJECT_TESTCASEPREFIX_IS_TOO_LONG', 7005); - -define('TPLAN_TPROJECT_KO',7006); -define('TPLAN_TPROJECT_KO_STR',lang_get('API_TPLAN_TPROJECT_KO',null,1)); - -define('TCASE_TPROJECT_KO',7007); -define('TCASE_TPROJECT_KO_STR',lang_get('API_TCASE_TPROJECT_KO',null,1)); - -define('TPROJECT_IS_EMPTY',7008); -define('TPROJECT_IS_EMPTY_STR',lang_get('API_TPROJECT_IS_EMPTY',null,1)); - -define('TPROJECT_PREFIX_ALREADY_EXISTS',7009); -define('TPROJECT_PREFIX_ALREADY_EXISTS_STR', - lang_get('API_TPROJECT_PREFIX_ALREADY_EXISTS',null,1)); - -define('REQSPEC_TPROJECT_KO',7010); -define('REQSPEC_TPROJECT_KO_STR',lang_get('API_REQSPEC_TPROJECT_KO',null,1)); - -define('TESTPROJECTNAME_DOESNOT_EXIST',7011); -define('TESTPROJECTNAME_DOESNOT_EXIST_STR',lang_get('API_TESTPROJECTNAME_DOESNOT_EXIST',null,1)); - -define('TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST',7012); -define('TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST_STR',lang_get('API_TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST',null,1)); - -define('TPROJECT_PREFIX_DOESNOT_EXIST',7013); -define('TPROJECT_PREFIX_DOESNOT_EXIST_STR', - lang_get('API_TPROJECT_PREFIX_DOESNOT_EXIST',null,1)); - -/** - * 8000 level - Test Suite errors - */ -define('INVALID_TESTSUITEID', 8000); -define('INVALID_TESTSUITEID_STR', lang_get('API_INVALID_TESTSUITEID',null,1)); - -define('TESTSUITE_DONOTBELONGTO_TESTPROJECT', 8001); -define('TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR', - lang_get('API_TESTSUITE_DONOTBELONGTO_TESTPROJECT',null,1)); - -define('TESTSUITENAME_NOT_STRING', 8002); -define('TESTSUITENAME_NOT_STRING_STR', lang_get('API_TESTSUITENAME_NOT_STRING',null,1)); - -define('INVALID_PARENT_TESTSUITEID', 8003); -define('INVALID_PARENT_TESTSUITEID_STR', lang_get('API_INVALID_PARENT_TESTSUITEID',null,1)); - - - -/** - * 9000 level - Custom Fields - */ -define('NO_CUSTOMFIELD_BY_THIS_NAME', 9000); -define('NO_CUSTOMFIELD_BY_THIS_NAME_STR', lang_get('API_NO_CUSTOMFIELD_BY_THIS_NAME',null,1)); - -define('CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE',9001); -define('CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE_STR', lang_get('API_CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE',null,1)); - -define('CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE',9002); -define('CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE_STR', lang_get('API_CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE',null,1)); - -define('CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT',9003); -define('CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT_STR', lang_get('API_CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT',null,1)); - -define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES',9004); -define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES_STR', lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES',null,1)); - -define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES',9005); -define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES_STR', lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES',null,1)); - -define('NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS',9006); -define('NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS_STR', lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS',null,1)); - - - -/** - * 10000 level - User - */ -define('NO_USER_BY_THIS_LOGIN', 10000); -define('NO_USER_BY_THIS_LOGIN_STR', lang_get('API_NO_USER_BY_THIS_LOGIN',null,1)); - -define('NO_USER_BY_THIS_ID', 10001); -define('NO_USER_BY_THIS_ID_STR', lang_get('API_NO_USER_BY_THIS_ID',null,1)); - -/** - * 11000 level - Requirements - */ -define('REQSPEC_KO', 11000); -define('REQSPEC_KO_STR', lang_get('API_REQSPEC_KO',null,1)); - -define('REQSPEC_IS_EMPTY', 11001); -define('REQSPEC_IS_EMPTY_STR', lang_get('API_REQSPEC_IS_EMPTY',null,1)); - -define('REQ_REQSPEC_KO', 11002); -define('REQ_REQSPEC_KO_STR', lang_get('API_REQ_REQSPEC_KO',null,1)); - -define('REQ_KO', 11003); -define('REQ_KO_STR', lang_get('API_REQ_KO',null,1)); - -define('NO_REQ_IN_THIS_PROJECT', 11004); -define('NO_REQ_IN_THIS_PROJECT_STR', lang_get('API_NO_REQ_IN_THIS_PROJECT',null,1)); - - -/** - * 12000 level - Platforms - */ -define('PLATFORMNAME_ALREADY_EXISTS',12000); -define('PLATFORMNAME_ALREADY_EXISTS_STR', lang_get('API_PLATFORMNAME_ALREADY_EXISTS',null,1)); - -define('PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK',12001); -define('PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK_STR', lang_get('API_PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK',null,1)); - - -/** - * 13000 level - ITS - */ -define('ITS_NOT_FOUND',13000); -define('ITS_NOT_FOUND_STR', lang_get('API_ITS_NOT_FOUND',null,1)); - -/** - * 14000 level - Users - */ -define('NO_USERID',14000); -define('NO_USERID_STR', lang_get('API_NO_USERID',null,1)); - -define('INVALID_USERID',14001); -define('INVALID_USERID_STR', lang_get('API_INVALID_USERID',null,1)); - -define('USER_LOGIN_DOESNOT_EXIST',14002); -define('USER_LOGIN_DOESNOT_EXIST_STR', lang_get('API_USER_LOGIN_DOESNOT_EXIST',null,1)); - -define('USER_CREATION_ERROR',14003); -// for message see getUserErrorMessage - -/** - * 15000 level - Roles - */ -define('NO_ROLEID',15000); -define('NO_ROLEID_STR', lang_get('API_NO_ROLEID',null,1)); - -define('INVALID_ROLEID',15001); -define('INVALID_ROLEID_STR', lang_get('API_INVALID_ROLEID',null,1)); - -define('ROLE_NAME_DOESNOT_EXIST',15002); -define('ROLE_NAME_DOESNOT_EXIST_STR', lang_get('API_ROLE_NAME_DOESNOT_EXIST',null,1)); - -define('ROLE_SETTING_ERROR',15003); -define('ROLE_SETTING_ERROR_STR', lang_get('API_ROLE_SETTING_ERROR',null,1)); + + * @package TestlinkAPI + * + * + */ + +/** + * general config file gives us lang_get access + */ +require_once 'lang_api.php'; + +/** + * #@+ + * Constants + */ + +/** + * a catch all generic error + */ +define('GENERAL_ERROR_CODE', - 1); +define('GENERAL_SUCCESS_CODE', 1); + +// IMPORTANT: +// lang_get('API_GENERAL_SUCCESS',null,1) +// null -> use user locale +// 1 -> do not log on audit system if localized string do not exist +// +define('GENERAL_SUCCESS_STR', lang_get('API_GENERAL_SUCCESS', null, 1)); + +define('NOT_YET_IMPLEMENTED', 50); +define('NOT_YET_IMPLEMENTED_STR', lang_get('API_NOT_YET_IMPLEMENTED', null, 1)); + +/** + * Error codes below 1000 are system level + */ +define('NO_DEV_KEY', 100); +define('NO_DEV_KEY_STR', lang_get('API_NO_DEV_KEY', null, 1)); + +define('NO_TCASEID', 110); +define('NO_TCASEID_STR', lang_get('API_NO_TCASEID', null, 1)); + +define('NO_TCASEEXTERNALID', 110); +define('NO_TCASEEXTERNALID_STR', lang_get('API_NO_TCASEEXTERNALID', null, 1)); + +define('NO_TCASEVERSIONID', 111); +define('NO_TCASEVERSIONID_STR', lang_get('API_NO_TCASEVERSIONID', null, 1)); + +define('NO_TPLANID', 120); +define('NO_TPLANID_STR', lang_get('API_NO_TPLANID', null, 1)); + +define('NO_BUILDID', 130); +define('NO_BUILDID_STR', lang_get('API_NO_BUILDID', null, 1)); + +define('NO_TEST_MODE', 140); +define('NO_TEST_MODE_STR', lang_get('API_NO_TEST_MODE', null, 1)); + +define('NO_STATUS', 150); +define('NO_STATUS_STR', lang_get('API_NO_STATUS', null, 1)); + +define('NO_TESTPROJECTID', 160); +define('NO_TESTPROJECTID_STR', lang_get('API_NO_TESTPROJECTID', null, 1)); + +define('NO_TESTCASENAME', 170); +define('NO_TESTCASENAME_STR', lang_get('API_NO_TESTCASENAME', null, 1)); + +define('NO_TESTSUITEID', 180); +define('NO_TESTSUITEID_STR', lang_get('API_NO_TESTSUITEID', null, 1)); + +define('MISSING_REQUIRED_PARAMETER', 200); +define('MISSING_REQUIRED_PARAMETER_STR', + lang_get('API_MISSING_REQUIRED_PARAMETER', null, 1)); + +define('PARAMETER_NOT_INT', 210); +define('PARAMETER_NOT_INT_STR', lang_get('API_PARAMETER_NOT_INT', null, 1)); + +define('NO_TESTSUITENAME', 220); +define('NO_TESTSUITENAME_STR', lang_get('API_NO_TESTSUITENAME', null, 1)); + +define('NODEID_IS_NOT_INTEGER', 230); +define('NODEID_IS_NOT_INTEGER_STR', lang_get('API_NODEID_IS_NOT_INTEGER', null, + 1)); + +define('NODEID_DOESNOT_EXIST', 231); +define('NODEID_DOESNOT_EXIST_STR', lang_get('API_NODEID_DOESNOT_EXIST', null, 1)); + +define('CFG_DELETE_EXEC_DISABLED', 232); +define('CFG_DELETE_EXEC_DISABLED_STR', + lang_get('API_CFG_DELETE_EXEC_DISABLED', null, 1)); + +define('NO_PLATFORMID', 233); +define('NO_PLATFORMID_STR', lang_get('API_NO_PLATFORMID', null, 1)); + +define('NODEID_INVALID_DATA_TYPE', 234); +define('NODEID_INVALID_DATA_TYPE_STR', + lang_get('API_NODEID_INVALID_DATA_TYPE', null, 1)); + +define('PLATFORM_NAME_DOESNOT_EXIST', 235); +define('PLATFORM_NAME_DOESNOT_EXIST_STR', + lang_get('API_PLATFORM_NAME_DOESNOT_EXIST', null, 1)); + +define('NO_MATCH', 236); +define('NO_MATCH_STR', lang_get('API_NO_MATCH', null, 1)); + +define('INVALID_TIMESTAMP', 237); +define('INVALID_TIMESTAMP_STR', lang_get('API_INVALID_TIMESTAMP', null, 1)); + +define('TSUITE_NOT_ON_TCASE_TPROJ', 238); +define('TSUITE_NOT_ON_TCASE_TPROJ_STR', + lang_get('API_TSUITE_NOT_ON_TCASE_TPROJ', null, 1)); + +/** + * 2000 level - authentication errors + */ +define('INVALID_AUTH', 2000); +define('INVALID_AUTH_STR', lang_get('API_INVALID_AUTH', null, 1)); +define('INSUFFICIENT_RIGHTS', 2010); +define('INSUFFICIENT_RIGHTS_STR', lang_get('API_INSUFFICIENT_RIGHTS', null, 1)); +define('UPDATER_INSUFFICIENT_RIGHTS', 2015); +define('UPDATER_INSUFFICIENT_RIGHTS_STR', + lang_get('API_UPDATER_INSUFFICIENT_RIGHTS', null, 1)); +define('MUST_BE_ADMIN', 2016); +define('MUST_BE_ADMIN_STR', lang_get('API_MUST_BE_ADMIN', null, 1)); + +/** + * 3000 level - Test Plan errors + */ +define('INVALID_TPLANID', 3000); +define('INVALID_TPLANID_STR', lang_get('API_INVALID_TPLANID', null, 1)); +define('TPLANID_NOT_INTEGER', 3010); +define('TPLANID_NOT_INTEGER_STR', lang_get('API_TPLANID_NOT_INTEGER', null, 1)); +define('NO_BUILD_FOR_TPLANID', 3020); +define('NO_BUILD_FOR_TPLANID_STR', lang_get('API_NO_BUILD_FOR_TPLANID', null, 1)); +define('TCASEID_NOT_IN_TPLANID', 3030); +define('TCASEID_NOT_IN_TPLANID_STR', + lang_get('API_TCASEID_NOT_IN_TPLANID', null, 1)); + +define('TPLAN_HAS_NO_BUILDS', 3031); +define('TPLAN_HAS_NO_BUILDS_STR', lang_get('API_TPLAN_HAS_NO_BUILDS', null, 1)); + +define('BAD_BUILD_FOR_TPLAN', 3032); +define('BAD_BUILD_FOR_TPLAN_STR', lang_get('API_BAD_BUILD_FOR_TPLAN', null, 1)); + +define('TESTPLANNAME_DOESNOT_EXIST', 3033); +define('TESTPLANNAME_DOESNOT_EXIST_STR', + lang_get('API_TESTPLANNAME_DOESNOT_EXIST', null, 1)); + +define('TESTPLANNAME_ALREADY_EXISTS', 3034); +define('TESTPLANNAME_ALREADY_EXISTS_STR', + lang_get('API_TESTPLANNAME_ALREADY_EXISTS', null, 1)); + +define('PLATFORM_NOT_LINKED_TO_TESTPLAN', 3040); +define('PLATFORM_NOT_LINKED_TO_TESTPLAN_STR', + lang_get('API_PLATFORM_NOT_LINKED_TO_TESTPLAN', null, 1)); + +define('TESTPLAN_HAS_NO_PLATFORMS', 3041); +define('TESTPLAN_HAS_NO_PLATFORMS_STR', + lang_get('API_TESTPLAN_HAS_NO_PLATFORMS', null, 1)); + +define('TCASEID_NOT_IN_TPLANID_FOR_PLATFORM', 3042); +define('TCASEID_NOT_IN_TPLANID_FOR_PLATFORM_STR', + lang_get('API_TCASEID_NOT_IN_TPLANID_FOR_PLATFORM', null, 1)); + +define('MISSING_PLATFORMID_BUT_NEEDED', 3043); +define('MISSING_PLATFORMID_BUT_NEEDED_STR', + lang_get('API_MISSING_PLATFORMID_BUT_NEEDED', null, 1)); + +define('PLATFORM_ID_NOT_LINKED_TO_TESTPLAN', 3044); +define('PLATFORM_ID_NOT_LINKED_TO_TESTPLAN_STR', + lang_get('API_PLATFORM_ID_NOT_LINKED_TO_TESTPLAN', null, 1)); + +define('LINKED_FEATURE_ALREADY_EXISTS', 3045); +define('LINKED_FEATURE_ALREADY_EXISTS_STR', + lang_get('API_LINKED_FEATURE_ALREADY_EXISTS', null, 1)); + +define('OTHER_VERSION_IS_ALREADY_LINKED', 3046); +define('OTHER_VERSION_IS_ALREADY_LINKED_STR', + lang_get('API_OTHER_VERSION_IS_ALREADY_LINKED', null, 1)); + +define('TCVERSIONID_NOT_IN_TPLANID', 3047); +define('TCVERSIONID_NOT_IN_TPLANID_STR', + lang_get('API_TCVERSIONID_NOT_IN_TPLANID', null, 1)); + +/** + * 4000 level - Build errors + */ +define('INVALID_BUILDID', 4000); +define('INVALID_BUILDID_STR', lang_get('API_INVALID_BUILDID', null, 1)); + +define('BUILDID_NOT_INTEGER', 4010); +define('BUILDID_NOT_INTEGER_STR', lang_get('API_BUILDID_NOT_INTEGER', null, 1)); + +define('BUILDID_NOGUESS', 4020); +define('BUILDID_NOGUESS_STR', lang_get('API_BUILDID_NOGUESS', null, 1)); + +define('BUILDNAME_ALREADY_EXISTS', 4030); +define('BUILDNAME_ALREADY_EXISTS_STR', + lang_get('API_BUILDNAME_ALREADY_EXISTS', null, 1)); + +define('BUILDNAME_DOES_NOT_EXIST', 4040); +define('BUILDNAME_DOES_NOT_EXIST_STR', + lang_get('API_BUILDNAME_DOES_NOT_EXIST', null, 1)); + +/** + * 5000 level - Test Case errors + */ +define('INVALID_TCASEID', 5000); +define('INVALID_TCASEID_STR', lang_get('API_INVALID_TCASEID', null, 1)); +define('INVALID_TCASEVERSIONID', 5001); +define('INVALID_TCASEVERSIONID_STR', + lang_get('API_INVALID_TCASEVERSIONID', null, 1)); +define('TCASEID_NOT_INTEGER', 5010); +define('TCASEID_NOT_INTEGER_STR', lang_get('API_TCASEID_NOT_INTEGER', null, 1)); +define('TCASEVERSIONID_NOT_INTEGER', 5011); +define('TCASEVERSIONID_NOT_INTEGER_STR', + lang_get('API_TCASEVERSIONID_NOT_INTEGER', null, 1)); +define('TESTCASENAME_NOT_STRING', 5020); +define('TESTCASENAME_NOT_STRING_STR', + lang_get('API_TESTCASENAME_NOT_STRING', null, 1)); +define('NO_TESTCASE_BY_THIS_NAME', 5030); +define('NO_TESTCASE_BY_THIS_NAME_STR', + lang_get('API_NO_TESTCASE_BY_THIS_NAME', null, 1)); +define('INVALID_TESTCASE_EXTERNAL_ID', 5040); +define('INVALID_TESTCASE_EXTERNAL_ID_STR', + lang_get('API_INVALID_TESTCASE_EXTERNAL_ID', null, 1)); +define('INVALID_TESTCASE_VERSION_NUMBER', 5050); +define('INVALID_TESTCASE_VERSION_NUMBER_STR', + lang_get('API_INVALID_TESTCASE_VERSION_NUMBER', null, 1)); +define('TCASE_VERSION_NUMBER_KO', 5051); +define('TCASE_VERSION_NUMBER_KO_STR', + lang_get('API_TCASE_VERSION_NUMBER_KO', null, 1)); + +define('VERSION_NOT_VALID', 5052); +define('VERSION_NOT_VALID_STR', lang_get('API_VERSION_NOT_VALID', null, 1)); +define('NO_TESTCASE_FOUND', 5053); +define('NO_TESTCASE_FOUND_STR', lang_get('API_NO_TESTCASE_FOUND', null, 1)); + +/** + * 6000 level - Status errors + */ +define('INVALID_STATUS', 6000); +define('INVALID_STATUS_STR', lang_get('API_INVALID_STATUS', null, 1)); + +define('ATTACH_TEMP_FILE_CREATION_ERROR', 6001); +define('ATTACH_TEMP_FILE_CREATION_ERROR_STR', + lang_get('API_ATTACH_TEMP_FILE_CREATION_ERROR', null, 1)); + +define('ATTACH_DB_WRITE_ERROR', 6002); +define('ATTACH_DB_WRITE_ERROR_STR', lang_get('API_ATTACH_DB_WRITE_ERROR', null, + 1)); + +define('ATTACH_FEATURE_DISABLED', 6003); +define('ATTACH_FEATURE_DISABLED_STR', + lang_get('API_ATTACH_FEATURE_DISABLED', null, 1)); + +define('ATTACH_INVALID_FK', 6004); +define('ATTACH_INVALID_FK_STR', lang_get('API_ATTACH_INVALID_FK', null, 1)); + +define('ATTACH_INVALID_ATTACHMENT', 6005); +define('ATTACH_INVALID_ATTACHMENT_STR', + lang_get('API_ATTACH_INVALID_ATTACHMENT', null, 1)); + +/** + * 7000 level - Test Project errors + */ +define('INVALID_TESTPROJECTID', 7000); +define('INVALID_TESTPROJECTID_STR', lang_get('API_INVALID_TESTPROJECTID', null, + 1)); + +define('TESTPROJECTNAME_SINTAX_ERROR', 7001); +define('TESTPROJECTNAME_EXISTS', 7002); +define('TESTPROJECT_TESTCASEPREFIX_EXISTS', 7003); +define('TESTPROJECT_TESTCASEPREFIX_IS_EMPTY', 7004); +define('TESTPROJECT_TESTCASEPREFIX_IS_TOO_LONG', 7005); + +define('TPLAN_TPROJECT_KO', 7006); +define('TPLAN_TPROJECT_KO_STR', lang_get('API_TPLAN_TPROJECT_KO', null, 1)); + +define('TCASE_TPROJECT_KO', 7007); +define('TCASE_TPROJECT_KO_STR', lang_get('API_TCASE_TPROJECT_KO', null, 1)); + +define('TPROJECT_IS_EMPTY', 7008); +define('TPROJECT_IS_EMPTY_STR', lang_get('API_TPROJECT_IS_EMPTY', null, 1)); + +define('TPROJECT_PREFIX_ALREADY_EXISTS', 7009); +define('TPROJECT_PREFIX_ALREADY_EXISTS_STR', + lang_get('API_TPROJECT_PREFIX_ALREADY_EXISTS', null, 1)); + +define('REQSPEC_TPROJECT_KO', 7010); +define('REQSPEC_TPROJECT_KO_STR', lang_get('API_REQSPEC_TPROJECT_KO', null, 1)); + +define('TESTPROJECTNAME_DOESNOT_EXIST', 7011); +define('TESTPROJECTNAME_DOESNOT_EXIST_STR', + lang_get('API_TESTPROJECTNAME_DOESNOT_EXIST', null, 1)); + +define('TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST', 7012); +define('TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST_STR', + lang_get('API_TESTPROJECTCOPY_SOURCENAME_DOESNOT_EXIST', null, 1)); + +define('TPROJECT_PREFIX_DOESNOT_EXIST', 7013); +define('TPROJECT_PREFIX_DOESNOT_EXIST_STR', + lang_get('API_TPROJECT_PREFIX_DOESNOT_EXIST', null, 1)); + +/** + * 8000 level - Test Suite errors + */ +define('INVALID_TESTSUITEID', 8000); +define('INVALID_TESTSUITEID_STR', lang_get('API_INVALID_TESTSUITEID', null, 1)); + +define('TESTSUITE_DONOTBELONGTO_TESTPROJECT', 8001); +define('TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR', + lang_get('API_TESTSUITE_DONOTBELONGTO_TESTPROJECT', null, 1)); + +define('TESTSUITENAME_NOT_STRING', 8002); +define('TESTSUITENAME_NOT_STRING_STR', + lang_get('API_TESTSUITENAME_NOT_STRING', null, 1)); + +define('INVALID_PARENT_TESTSUITEID', 8003); +define('INVALID_PARENT_TESTSUITEID_STR', + lang_get('API_INVALID_PARENT_TESTSUITEID', null, 1)); + +/** + * 9000 level - Custom Fields + */ +define('NO_CUSTOMFIELD_BY_THIS_NAME', 9000); +define('NO_CUSTOMFIELD_BY_THIS_NAME_STR', + lang_get('API_NO_CUSTOMFIELD_BY_THIS_NAME', null, 1)); + +define('CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE', 9001); +define('CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE_STR', + lang_get('API_CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE', null, 1)); + +define('CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE', 9002); +define('CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE_STR', + lang_get('API_CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE', null, 1)); + +define('CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT', 9003); +define('CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT_STR', + lang_get('API_CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT', null, 1)); + +define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES', 9004); +define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES_STR', + lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES', null, 1)); + +define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES', 9005); +define('NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES_STR', + lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES', null, 1)); + +define('NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS', 9006); +define('NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS_STR', + lang_get('API_NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS', null, 1)); + +/** + * 10000 level - User + */ +define('NO_USER_BY_THIS_LOGIN', 10000); +define('NO_USER_BY_THIS_LOGIN_STR', lang_get('API_NO_USER_BY_THIS_LOGIN', null, + 1)); + +define('NO_USER_BY_THIS_ID', 10001); +define('NO_USER_BY_THIS_ID_STR', lang_get('API_NO_USER_BY_THIS_ID', null, 1)); + +/** + * 11000 level - Requirements + */ +define('REQSPEC_KO', 11000); +define('REQSPEC_KO_STR', lang_get('API_REQSPEC_KO', null, 1)); + +define('REQSPEC_IS_EMPTY', 11001); +define('REQSPEC_IS_EMPTY_STR', lang_get('API_REQSPEC_IS_EMPTY', null, 1)); + +define('REQ_REQSPEC_KO', 11002); +define('REQ_REQSPEC_KO_STR', lang_get('API_REQ_REQSPEC_KO', null, 1)); + +define('REQ_KO', 11003); +define('REQ_KO_STR', lang_get('API_REQ_KO', null, 1)); + +define('NO_REQ_IN_THIS_PROJECT', 11004); +define('NO_REQ_IN_THIS_PROJECT_STR', + lang_get('API_NO_REQ_IN_THIS_PROJECT', null, 1)); + +/** + * 12000 level - Platforms + */ +define('PLATFORMNAME_ALREADY_EXISTS', 12000); +define('PLATFORMNAME_ALREADY_EXISTS_STR', + lang_get('API_PLATFORMNAME_ALREADY_EXISTS', null, 1)); + +define('PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK', 12001); +define('PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK_STR', + lang_get('API_PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK', null, 1)); + +/** + * 13000 level - ITS + */ +define('ITS_NOT_FOUND', 13000); +define('ITS_NOT_FOUND_STR', lang_get('API_ITS_NOT_FOUND', null, 1)); + +/** + * 14000 level - Users + */ +define('NO_USERID', 14000); +define('NO_USERID_STR', lang_get('API_NO_USERID', null, 1)); + +define('INVALID_USERID', 14001); +define('INVALID_USERID_STR', lang_get('API_INVALID_USERID', null, 1)); + +define('USER_LOGIN_DOESNOT_EXIST', 14002); +define('USER_LOGIN_DOESNOT_EXIST_STR', + lang_get('API_USER_LOGIN_DOESNOT_EXIST', null, 1)); + +define('USER_CREATION_ERROR', 14003); +// for message see getUserErrorMessage + +/** + * 15000 level - Roles + */ +define('NO_ROLEID', 15000); +define('NO_ROLEID_STR', lang_get('API_NO_ROLEID', null, 1)); + +define('INVALID_ROLEID', 15001); +define('INVALID_ROLEID_STR', lang_get('API_INVALID_ROLEID', null, 1)); + +define('ROLE_NAME_DOESNOT_EXIST', 15002); +define('ROLE_NAME_DOESNOT_EXIST_STR', + lang_get('API_ROLE_NAME_DOESNOT_EXIST', null, 1)); + +define('ROLE_SETTING_ERROR', 15003); +define('ROLE_SETTING_ERROR_STR', lang_get('API_ROLE_SETTING_ERROR', null, 1)); diff --git a/lib/api/xmlrpc/v1/api.const.inc.php b/lib/api/xmlrpc/v1/api.const.inc.php index 1cb5e686a7..685ec4a670 100644 --- a/lib/api/xmlrpc/v1/api.const.inc.php +++ b/lib/api/xmlrpc/v1/api.const.inc.php @@ -1,18 +1,21 @@ - - * @package TestlinkAPI - */ - -/** DB Constants used for testing */ -define('TEST_DSN',FALSE); -define('TEST_DB_TYPE', 'mysql'); -define('TEST_DB_USER', 'root'); -define('TEST_DB_PASS', ''); -define('TEST_DB_HOST', 'localhost'); -define('TEST_DB_NAME', 'testlink_development'); \ No newline at end of file + + * @package TestlinkAPI + */ + +/** + * DB Constants used for testing + */ +define('TEST_DSN', false); +define('TEST_DB_TYPE', 'mysql'); +define('TEST_DB_USER', 'root'); +define('TEST_DB_PASS', ''); +define('TEST_DB_HOST', 'localhost'); +define('TEST_DB_NAME', 'testlink_development'); diff --git a/lib/api/xmlrpc/v1/poc/php/example01/autom01.php b/lib/api/xmlrpc/v1/poc/php/example01/autom01.php index 1535883a30..257e2a77fb 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/autom01.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/autom01.php @@ -1,77 +1,84 @@ -tlProjectID = -1; -$env->tlSuiteID = -1; -$env->tlPlanID = -1; -$env->tlTestCaseVersion = 1; -// ---------------------------------------------- :) - -$doSetUp = true; -$phpSteps = array(); - -if( $doSetUp ) -{ - $phpSteps[] = array('f2i' => 'stepDeleteTestProject.php', 'id' => 'tlProjectID'); - $phpSteps[] = array('f2i' => 'stepCreateTestProject.php', 'id' => 'tlProjectID'); - $phpSteps[] = array('f2i' => 'stepCreateTestSuite.php', 'id' => 'tlSuiteID'); - $phpSteps[] = array('f2i' => 'stepCreateTestCase.php', 'id' => 'tlJolt'); - $phpSteps[] = array('f2i' => 'stepCreateTestPlan.php', 'id' => 'tlPlanID'); -} -else -{ - // - $env->tlProjectID = 1046; - $env->tlPlanID = 1051; - $env->tlTestCaseVersion = 2; - $tlOverWriteOnAdd = 1; -} - -$phpSteps[] = array('f2i' => 'stepAddTestCaseToTestPlan.php', 'id' => 'tlJolt'); - -// Generate some user feedback -$whatWillBeDone = '

    Steps that will be done (in this order)

    '; -$actions = array(); -foreach($phpSteps as $xx) -{ - foreach($xx as $key => $val) - { - if($key == 'f2i') - { - $actions[] = $val; - } - } -} -$whatWillBeDone .= count($actions) ? implode('
    ',$actions) : 'Nothing!!'; -echo $whatWillBeDone . '
    '; - -foreach( $phpSteps as $m2i) -{ - try - { - $tlIDName = $m2i['id']; - require_once $m2i['f2i']; - } - catch (Exception $e) - { - echo $e->getMessage(); - } -} \ No newline at end of file +tlProjectID = - 1; +$env->tlSuiteID = - 1; +$env->tlPlanID = - 1; +$env->tlTestCaseVersion = 1; + +$doSetUp = true; +$phpSteps = array(); + +if ($doSetUp) { + $phpSteps[] = array( + 'f2i' => 'stepDeleteTestProject.php', + 'id' => 'tlProjectID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestProject.php', + 'id' => 'tlProjectID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestSuite.php', + 'id' => 'tlSuiteID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestCase.php', + 'id' => 'tlJolt' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestPlan.php', + 'id' => 'tlPlanID' + ); +} else { + // + $env->tlProjectID = 1046; + $env->tlPlanID = 1051; + $env->tlTestCaseVersion = 2; + $tlOverWriteOnAdd = 1; +} + +$phpSteps[] = array( + 'f2i' => 'stepAddTestCaseToTestPlan.php', + 'id' => 'tlJolt' +); + +// Generate some user feedback +$whatWillBeDone = '

    Steps that will be done (in this order)

    '; +$actions = array(); +foreach ($phpSteps as $xx) { + foreach ($xx as $key => $val) { + if ($key == 'f2i') { + $actions[] = $val; + } + } +} +$whatWillBeDone .= count($actions) ? implode('
    ', $actions) : 'Nothing!!'; +echo $whatWillBeDone . '
    '; + +foreach ($phpSteps as $m2i) { + try { + $tlIDName = $m2i['id']; + require_once $m2i['f2i']; + } catch (Exception $e) { + echo $e->getMessage(); + } +} diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepAddTestCaseToTestPlan.php b/lib/api/xmlrpc/v1/poc/php/example01/stepAddTestCaseToTestPlan.php index 8b8006fc33..0d8fb694b9 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepAddTestCaseToTestPlan.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepAddTestCaseToTestPlan.php @@ -1,41 +1,41 @@ -tlProjectID; -$args["testplanid"] = $env->tlPlanID; - -$args["testcaseexternalid"] = $tlTestCasePrefix . '-1'; -$args["version"] = $env->tlTestCaseVersion; -$args["overwrite"] = $tlOverWriteOnAdd; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$answer = runTest($client,$method,$args,$tlIdx); \ No newline at end of file +tlProjectID; +$args["testplanid"] = $env->tlPlanID; + +$args["testcaseexternalid"] = $tlTestCasePrefix . '-1'; +$args["version"] = $env->tlTestCaseVersion; +$args["overwrite"] = $tlOverWriteOnAdd; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$answer = runTest($client, $method, $args, $tlIdx); diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestCase.php b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestCase.php index 9068b0e55b..9e4c587c38 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestCase.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestCase.php @@ -1,32 +1,36 @@ -tlProjectID; -$args["testsuiteid"] = $env->tlSuiteID; - -$args["testcasename"]='ZZ - TEST CASE NAME IS OK'; -$args["summary"]='Test Case created via API'; -$args["preconditions"]='Test Link API Up & Running'; -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=0; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); - -$unitTestDescription = ""; -echo $unitTestDescription; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); \ No newline at end of file +tlProjectID; +$args["testsuiteid"] = $env->tlSuiteID; + +$args["testcasename"] = 'ZZ - TEST CASE NAME IS OK'; +$args["summary"] = 'Test Case created via API'; +$args["preconditions"] = 'Test Link API Up & Running'; +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 0; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); + +$unitTestDescription = ""; +echo $unitTestDescription; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestPlan.php b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestPlan.php index fc754f5629..c31c1b81f0 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestPlan.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestPlan.php @@ -1,36 +1,33 @@ -debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); } - -$args=array(); -$args["devKey"] =isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; -$args["prefix"] = $tlTestCasePrefix; -$args["testplanname"]="TPLAN BY API"; -$args["notes"]="test plan created using XML-RPC-API"; - -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; -} -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestProject.php b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestProject.php index d3f93c983d..8f5c82a00d 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestProject.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestProject.php @@ -1,40 +1,38 @@ - {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; -} -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file + {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); +} diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestSuite.php b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestSuite.php index 321dd09130..684153affb 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestSuite.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepCreateTestSuite.php @@ -1,36 +1,33 @@ -tlProjectID; -$args["testsuitename"] = 'TS API 100'; -$args["details"]='This has been created by XMLRPC API Call'; - -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$tlIdx++; -$ret = runTest($client,$method,$args,$tlIdx); - - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; +tlProjectID; +$args["testsuitename"] = 'TS API 100'; +$args["details"] = 'This has been created by XMLRPC API Call'; + +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$tlIdx ++; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); } -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/poc/php/example01/stepDeleteTestProject.php b/lib/api/xmlrpc/v1/poc/php/example01/stepDeleteTestProject.php index aba689ed91..11b24246e7 100644 --- a/lib/api/xmlrpc/v1/poc/php/example01/stepDeleteTestProject.php +++ b/lib/api/xmlrpc/v1/poc/php/example01/stepDeleteTestProject.php @@ -1,26 +1,25 @@ -debug = $tlDebug; - -$tlIdx++; -$answer = runTest($client,$method,$args,$tlIdx); \ No newline at end of file +debug = $tlDebug; + +$tlIdx ++; +$answer = runTest($client, $method, $args, $tlIdx); diff --git a/lib/api/xmlrpc/v1/poc/php/util/setup.inc.php b/lib/api/xmlrpc/v1/poc/php/util/setup.inc.php index 485e4574a9..8a2988915a 100644 --- a/lib/api/xmlrpc/v1/poc/php/util/setup.inc.php +++ b/lib/api/xmlrpc/v1/poc/php/util/setup.inc.php @@ -1,21 +1,23 @@ - TestLink XMLRPC Proof Of Concept @@ -25,43 +27,40 @@ storedDetail : '', toggle : function(id){ - if(this.storedDetail && this.storedDetail != id) + if(this.storedDetail && this.storedDetail != id) { document.getElementById(this.storedDetail).style.display = 'none'; } this.storedDetail = id; var style = document.getElementById(id).style; - if(style.display == 'block') + if(style.display == 'block') { style.display = 'none'; } else { style.display = 'block'; - } + } return false; } }; -TestLink XML-RPC API - POC Samples Runner
    '; -echo "XMLRPC Server URL {$server_url}

    "; \ No newline at end of file +TestLink XML-RPC API - POC Samples Runner
    '; +echo "XMLRPC Server URL {$server_url}

    "; diff --git a/lib/api/xmlrpc/v1/poc/php/util/util.php b/lib/api/xmlrpc/v1/poc/php/util/util.php index 441616a1b4..85030512ea 100644 --- a/lib/api/xmlrpc/v1/poc/php/util/util.php +++ b/lib/api/xmlrpc/v1/poc/php/util/util.php @@ -1,64 +1,62 @@ -

    This sample can be runned without changes against sample database testlinkAPI'; - echo ('
    that you will find on [YOUR TL INSTALLATION DIR]' . '\\docs\\db_sample\\'); - echo '



    '; +

    This sample can be runned without changes against sample database testlinkAPI'; + echo '
    that you will find on [YOUR TL INSTALLATION DIR]' . + '\\docs\\db_sample\\'; + echo '



    '; +} + +function runTest(&$client, $method, $args, $feedback_id = 1) +{ + $html_id = "result_{$feedback_id}"; + $msg_click_to_show = "click to show XML-RPC Client Debug Info"; + + $imgFO = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'img' . + DIRECTORY_SEPARATOR . 'icon-foldout.gif'; + $imgSRC = ' '; + + $onClick = "return DetailController.toggle('{$html_id}')"; + + if ($client->debug) { + echo '
    Debug: Inside function: ' . __FUNCTION__ . '
    '; + new dBug($args); + + echo '
    '; + echo $imgSRC . "{$msg_click_to_show} "; + } + echo '

    "; + + echo "
    Result was: "; + new dBug($response); + echo "
    "; + echo "


    "; + + return $response; } - -function runTest(&$client,$method,$args,$feedback_id=1) -{ - $html_id="result_{$feedback_id}"; - $msg_click_to_show="click to show XML-RPC Client Debug Info"; - - $imgFO = dirname(__FILE__) . DIRECTORY_SEPARATOR . - 'img' . DIRECTORY_SEPARATOR . 'icon-foldout.gif'; - $imgSRC = ' '; - - $onClick = "return DetailController.toggle('{$html_id}')"; - - if($client->debug) - { - echo '
    Debug: Inside function: ' . __FUNCTION__ . '
    '; - new dBug($args); - - echo '
    '; - echo $imgSRC . "{$msg_click_to_show} "; - } - echo '

    "; - - echo "
    Result was: "; - new dBug($response); - echo "
    "; - echo "


    "; - - return $response; -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientAddPlatformToTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientAddPlatformToTestPlan.php index 2d0fc40ae5..1788c574c4 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientAddPlatformToTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientAddPlatformToTestPlan.php @@ -1,29 +1,29 @@ -debug=$debug; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- -?> \ No newline at end of file +debug = $debug; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientAddTestCaseKeywords.php b/lib/api/xmlrpc/v1/sample_clients/php/clientAddTestCaseKeywords.php index 4723642db4..308d3b0d45 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientAddTestCaseKeywords.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientAddTestCaseKeywords.php @@ -1,27 +1,35 @@ - array('Barbie','Barbie'), - 'MAB-2' => array('Barbie','Jessie')); - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -$answer = runTest($client,$method,$args); \ No newline at end of file + array( + 'Barbie', + 'Barbie' + ), + 'MAB-2' => array( + 'Barbie', + 'Jessie' + ) +); + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +$answer = runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientAssignRequirements.php b/lib/api/xmlrpc/v1/sample_clients/php/clientAssignRequirements.php index 891fcf9002..49c32a0b10 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientAssignRequirements.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientAssignRequirements.php @@ -1,39 +1,50 @@ - 336,'requirements' => array(340)), - array('req_spec' => 345,'requirements' => array(346,348)) - ); - -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -?> \ No newline at end of file + 336, + 'requirements' => array( + 340 + ) + ), + array( + 'req_spec' => 345, + 'requirements' => array( + 346, + 348 + ) + ) +); + +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientAssignTestCaseExecutionTask.php b/lib/api/xmlrpc/v1/sample_clients/php/clientAssignTestCaseExecutionTask.php index ddf8bcc4b9..4158c7c6b3 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientAssignTestCaseExecutionTask.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientAssignTestCaseExecutionTask.php @@ -1,192 +1,168 @@ -debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -new dBug($answer); -die(); - -// --------------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------------- -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - All OK"; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 278; -$args["testcaseexternalid"] = 'APX-1'; -$args["platformname"] = 'Informix'; -$args["buildname"] = '2.0'; -$args["user"] = 'giskard'; - - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); - -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Plan ID"; - -$args=array(); -$args["devKey"] = $devKey; -// $args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Case "; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 9; -// $args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -// $args["buildname"] = '1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 900000; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-WRONG-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); +debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +new dBug($answer); +die(); + +// --------------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------------- +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - All OK"; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 278; +$args["testcaseexternalid"] = 'APX-1'; +$args["platformname"] = 'Informix'; +$args["buildname"] = '2.0'; +$args["user"] = 'giskard'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Plan ID"; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Case "; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 9; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 900000; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-WRONG-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); // --------------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php index 58f0d38e88..2ebde34a20 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCheckDevKey.php @@ -1,58 +1,56 @@ -must finish OK
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY . 'UUUU'; - -$additionalInfo='
    Must Fail
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); +must finish OK
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY . 'UUUU'; + +$additionalInfo = '
    Must Fail
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); // --------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCloseBuild.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCloseBuild.php index 70f57ea80e..e1d0993c4e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCloseBuild.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCloseBuild.php @@ -8,7 +8,7 @@ * @Author: francisco.mancardi@gmail.com * */ - + require_once 'util.php'; require_once 'sample.inc.php'; show_api_db_sample_msg(); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateBuild.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateBuild.php index a793f6e2e5..c61d8e27d8 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateBuild.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateBuild.php @@ -1,66 +1,60 @@ -debug = $debug; +runTest($client, $method, $args, $test_num); + +$method = 'createBuild'; +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 72; +$args["buildname"] = 'AAASECOND TEST API BUILD'; +$args["buildnotes"] = 'Created via API'; +$args["active"] = 0; +$args["open"] = 0; +$args["releasedate"] = '2016-09-01'; +$additionalInfo = ' active+open+releasedate attributes'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); - -$test_num=0; -$devKey = '985978c915f50e47a4b1a54a943d1b76'; - -// -------------------------------------------------------- -$method='createBuild'; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=$devKey; -$args["testplanid"]=61; -$args["buildname"]='Abril 230'; -$args["buildnotes"]='Created via API 3'; -$args["copytestersfrombuild"]='3'; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); - -// -------------------------------------------------------- - -// -------------------------------------------------------- -$method='createBuild'; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=$devKey; -$args["testplanid"]=72; -$args["buildname"]='AAASECOND TEST API BUILD'; -$args["buildnotes"]='Created via API'; -$args["active"]=0; -$args["open"]=0; -$args["releasedate"] = '2016-09-01'; -$additionalInfo=' active+open+releasedate attributes'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// -------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateNTestCases.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateNTestCases.php index f7ee574272..2009bdd563 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateNTestCases.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateNTestCases.php @@ -1,44 +1,43 @@ - 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); -$args["authorlogin"]='admin'; - -$client = new IXR_Client($server_url); -$client->debug=true; - -for($idx=1 ; $idx <= $tcaseQty; $idx++) -{ - $args["testcasename"] = "Sample TEST #{$idx}"; - $args["summary"]=$args["testcasename"] . 'created via XML-RPC API'; - runTest($client,$method,$args); -} -echo 'Test Cases Created'; -?> \ No newline at end of file + 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); +$args["authorlogin"] = 'admin'; + +$client = new IXR_Client($server_url); +$client->debug = true; + +for ($idx = 1; $idx <= $tcaseQty; $idx ++) { + $args["testcasename"] = "Sample TEST #{$idx}"; + $args["summary"] = $args["testcasename"] . 'created via XML-RPC API'; + runTest($client, $method, $args); +} +echo 'Test Cases Created'; +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreatePlatform.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreatePlatform.php index 254d2d264b..e872b178ac 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreatePlatform.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreatePlatform.php @@ -1,31 +1,31 @@ -debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; \ No newline at end of file +debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateScenario.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateScenario.php index eeb32acb7c..a032d4902d 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateScenario.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateScenario.php @@ -1,123 +1,122 @@ -debug = false; -$cfg->devKey = 'admin'; -$cfg->prefix = 'AX'; - -// $server_url is GLOBAL created on some previous include -$args4call = array(); - -$ret['createTestProject'] = createTestProject($server_url,$cfg,$args4call); -// $ret = createTestSuite($server_url$cfg,$args4call); -$ret['createTestPlan'] = createTestPlan($server_url,$cfg,$args4call); -$ret['createBuild'] = createBuild($server_url,$cfg,$args4call,$ret['createTestPlan'][0]['id']); -$ret['createPlatform'] = createPlatform($server_url,$cfg,$args4call); - - - -/** - * - */ -function createTestProject($server_url,$cfg,&$args4call) -{ - $method = __FUNCTION__; - - $args4call[$method] = array("devKey" => $cfg->devKey, - "testcaseprefix" => $cfg->prefix, - "testprojectname" => 'TPROJ-01', - "notes" => "test project created using XML-RPC-API"); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - - -/** - * - */ -function createTestPlan($server_url,$cfg,&$args4call) -{ - $method = __FUNCTION__; - $args4call[$method] = array("devKey" => $cfg->devKey, - "testprojectname" => $args4call['createTestProject']["testprojectname"], - "testplanname" => "TPLAN A", - "notes" => "Test plan used to test report 'Test cases without tester assignment' "); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - - -/** - * - */ -function createBuild($server_url,$cfg,&$args4call,$tplan_id) -{ - - $method = __FUNCTION__; - $args4call[$method] = array("devKey" => $cfg->devKey, - "buildname" => '1.0', - "testplanid" => $tplan_id, - "buildnote" => "Build used to test issue 5451"); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - -/** - * - */ -function createPlatform($server_url,$cfg,&$args4call) -{ - $method = __FUNCTION__; - - $platforms = array(); - - $item = new stdClass(); - $item->name = 'PLAT-01'; - $item->notes = 'Notes for' . $item->name; - $platforms[] = $item; - - $item = new stdClass(); - $item->name = 'PLAT-02'; - $item->notes = 'Notes for' . $item->name; - $platforms[] = $item; - - $item = new stdClass(); - $item->name = 'PLAT-03'; - $item->notes = 'Notes for' . $item->name; - $platforms[] = $item; - - $res = array(); - $client = new IXR_Client($server_url); - foreach($platforms as $item) - { - $args4call[$method] = array("devKey" => $cfg->devKey, - "platformname" => $item->name, - "notes" => $item->notes, - "testprojectname" => $args4call['createTestProject']["testprojectname"]); - $client->debug = $cfg->debug; - $res[] = runTest($client,$method,$args4call[$method]); - } - return $res; +debug = false; +$cfg->devKey = 'admin'; +$cfg->prefix = 'AX'; + +// $server_url is GLOBAL created on some previous include +$args4call = array(); + +$ret['createTestProject'] = createTestProject($server_url, $cfg, $args4call); +// $ret = createTestSuite($server_url$cfg,$args4call); +$ret['createTestPlan'] = createTestPlan($server_url, $cfg, $args4call); +$ret['createBuild'] = createBuild($server_url, $cfg, $args4call, + $ret['createTestPlan'][0]['id']); +$ret['createPlatform'] = createPlatform($server_url, $cfg, $args4call); + +/** + */ +function createTestProject($server_url, $cfg, &$args4call) +{ + $method = __FUNCTION__; + + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "testcaseprefix" => $cfg->prefix, + "testprojectname" => 'TPROJ-01', + "notes" => "test project created using XML-RPC-API" + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +/** + */ +function createTestPlan($server_url, $cfg, &$args4call) +{ + $method = __FUNCTION__; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "testprojectname" => $args4call['createTestProject']["testprojectname"], + "testplanname" => "TPLAN A", + "notes" => "Test plan used to test report 'Test cases without tester assignment' " + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +/** + */ +function createBuild($server_url, $cfg, &$args4call, $tplan_id) +{ + $method = __FUNCTION__; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "buildname" => '1.0', + "testplanid" => $tplan_id, + "buildnote" => "Build used to test issue 5451" + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +/** + */ +function createPlatform($server_url, $cfg, &$args4call) +{ + $method = __FUNCTION__; + + $platforms = array(); + + $item = new stdClass(); + $item->name = 'PLAT-01'; + $item->notes = 'Notes for' . $item->name; + $platforms[] = $item; + + $item = new stdClass(); + $item->name = 'PLAT-02'; + $item->notes = 'Notes for' . $item->name; + $platforms[] = $item; + + $item = new stdClass(); + $item->name = 'PLAT-03'; + $item->notes = 'Notes for' . $item->name; + $platforms[] = $item; + + $res = array(); + $client = new IXR_Client($server_url); + foreach ($platforms as $item) { + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "platformname" => $item->name, + "notes" => $item->notes, + "testprojectname" => $args4call['createTestProject']["testprojectname"] + ); + $client->debug = $cfg->debug; + $res[] = runTest($client, $method, $args4call[$method]); + } + return $res; } diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCase.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCase.php index 1a56d4aae3..ed02dc3520 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCase.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCase.php @@ -1,135 +1,139 @@ - 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); - -// $wfd = config_get('testCaseStatus'); -$args["status"] = 4; -//$args["estimatedexecduration"] = 4.5; - -$unitTestDescription = "Test #{$tcCounter}- {$method} - With STATUS:{$args['wfstatus']}"; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -// --------------------------------------------------------------------------------- -$method='createTestCase'; -$unitTestDescription = "Test #{$tcCounter}- {$method} - With NAME exceeding limit"; -$tcCounter++; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=280; -$args["testsuiteid"]=297; -$args["testcasename"]= -'TEST CASE NAME IS LONGER THAT ALLOWED SIZE - 100 CHARACTERS - The quick brown fox jumps over the X % lazydog (bye bye dog)'; -$args["summary"]='Test Case created via API'; -$args["preconditions"]='Test Link API Up & Running'; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=1; - - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - - -// ---------------------------------------------------------------------------------------------------- -$method='createTestCase'; -$unitTestDescription="Test #{$tcCounter}- {$method}"; -$tcCounter++; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=620; -$args["testsuiteid"]=621; -$args["testcasename"]='Network Interface Card (NIC) driver update'; -$args["summary"]='Test Case created via API'; -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=1; -$args["keywordid"]='1,2,3,4'; - - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -// ---------------------------------------------------------------------------------------------------- -$method='createTestCase'; -$unitTestDescription="Test #{$tcCounter}- {$method}"; -$tcCounter++; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=620; -$args["testsuiteid"]=621; -$args["testcasename"]='Volume Manager Increase size'; -$args["summary"]='Test Case created via API - Volume Manager Increase size'; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); -$args["steps"][]=array('step_number' => 2, 'actions' => 'Connect to Server', 'expected_results' => 'beep twice'); -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=1; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -// ---------------------------------------------------------------------------------------------------- -$method='createTestCase'; -$unitTestDescription="Test #{$tcCounter}- {$method}"; -$tcCounter++; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=620; -$args["testsuiteid"]=621; -$args["testcasename"]='Volume Manager Increase size'; -$args["summary"]='Want to test Action On Duplicate with value create_new_version FOR Volume Manager Increase size'; -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=1; -$args["actiononduplicatedname"]="create_new_version"; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ---------------------------------------------------------------------------------------------------- -?> \ No newline at end of file + 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); + +$args["status"] = 4; + +$unitTestDescription = "Test #{$tcCounter}- {$method} - With STATUS:{$args['wfstatus']}"; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$method = 'createTestCase'; +$unitTestDescription = "Test #{$tcCounter}- {$method} - With NAME exceeding limit"; +$tcCounter ++; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testprojectid"] = 280; +$args["testsuiteid"] = 297; +$args["testcasename"] = 'TEST CASE NAME IS LONGER THAT ALLOWED SIZE - 100 CHARACTERS - The quick brown fox jumps over the X % lazydog (bye bye dog)'; +$args["summary"] = 'Test Case created via API'; +$args["preconditions"] = 'Test Link API Up & Running'; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 1; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$method = 'createTestCase'; +$unitTestDescription = "Test #{$tcCounter}- {$method}"; +$tcCounter ++; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testprojectid"] = 620; +$args["testsuiteid"] = 621; +$args["testcasename"] = 'Network Interface Card (NIC) driver update'; +$args["summary"] = 'Test Case created via API'; +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 1; +$args["keywordid"] = '1,2,3,4'; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$method = 'createTestCase'; +$unitTestDescription = "Test #{$tcCounter}- {$method}"; +$tcCounter ++; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testprojectid"] = 620; +$args["testsuiteid"] = 621; +$args["testcasename"] = 'Volume Manager Increase size'; +$args["summary"] = 'Test Case created via API - Volume Manager Increase size'; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); +$args["steps"][] = array( + 'step_number' => 2, + 'actions' => 'Connect to Server', + 'expected_results' => 'beep twice' +); +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 1; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$method = 'createTestCase'; +$unitTestDescription = "Test #{$tcCounter}- {$method}"; +$tcCounter ++; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testprojectid"] = 620; +$args["testsuiteid"] = 621; +$args["testcasename"] = 'Volume Manager Increase size'; +$args["summary"] = 'Want to test Action On Duplicate with value create_new_version FOR Volume Manager Increase size'; +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 1; +$args["actiononduplicatedname"] = "create_new_version"; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCaseSteps.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCaseSteps.php index 7895c17544..26c7570471 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCaseSteps.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestCaseSteps.php @@ -1,81 +1,83 @@ - 12, 'actions' => 'SKIP !!!!Start Server Ubuntu 11.04', - 'expected_results' => 'green light' . ' ' . $args["action"]); - -// $args["steps"][]=array('step_number' => 12, 'actions' => 'SKIP !!!! Start Server Fedora 15', -// 'expected_results' => 'green lantern' . ' ' . $args["action"]); -//$args["authorlogin"]='admin'; - - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$tcCounter); -die(); -// ---------------------------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------------------- -$tcCounter++; -$method='createTestCaseSteps'; -$unitTestDescription = "Test #{$tcCounter}- {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcaseexternalid"]='MKO-1'; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); -$args["authorlogin"]='admin'; - - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$tcCounter); -// ---------------------------------------------------------------------------------------------------- -// -------------------------------------------------------------------------------------------- -$tcCounter++; -$method='createTestCaseSteps'; -$unitTestDescription = "Test #{$tcCounter}- {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcaseexternalid"]='MKO-1'; -$args["version"]=100; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server VERSION DOES NOT EXIST', - 'expected_results' => 'green light'); -$args["authorlogin"]='admin'; - - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$tcCounter); -// ---------------------------------------------------------------------------------------------------- - -?> \ No newline at end of file + 12, + 'actions' => 'SKIP !!!!Start Server Ubuntu 11.04', + 'expected_results' => 'green light' . ' ' . $args["action"] +); + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $tcCounter); +die(); +// ---------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------- +$tcCounter ++; +$method = 'createTestCaseSteps'; +$unitTestDescription = "Test #{$tcCounter}- {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcaseexternalid"] = 'MKO-1'; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); +$args["authorlogin"] = 'admin'; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $tcCounter); +// ---------------------------------------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------- +$tcCounter ++; +$method = 'createTestCaseSteps'; +$unitTestDescription = "Test #{$tcCounter}- {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcaseexternalid"] = 'MKO-1'; +$args["version"] = 100; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server VERSION DOES NOT EXIST', + 'expected_results' => 'green light' +); +$args["authorlogin"] = 'admin'; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $tcCounter); +// ---------------------------------------------------------------------------------------------------- + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestPlan.php index cb56698c5e..7e718f2f1e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestPlan.php @@ -1,61 +1,61 @@ -debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testprojectname"]='TPROJECT1'; -$args["testplanname"]="TPLAN BY API"; -$args["notes"]="test plan created using XML-RPC-API"; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testprojectname"]='TPROJECT1'; -$args["testplanname"]="TPLAN BY API-2"; -$args["notes"]="test plan 2 created using XML-RPC-API"; -$args["active"]=0; -$args["public"]=1; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; \ No newline at end of file +debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testprojectname"] = 'TPROJECT1'; +$args["testplanname"] = "TPLAN BY API"; +$args["notes"] = "test plan created using XML-RPC-API"; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testprojectname"] = 'TPROJECT1'; +$args["testplanname"] = "TPLAN BY API-2"; +$args["notes"] = "test plan 2 created using XML-RPC-API"; +$args["active"] = 0; +$args["public"] = 1; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProject.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProject.php index 312172deb6..a7553d4d89 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProject.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProject.php @@ -1,248 +1,259 @@ - {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +die(); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 0; +$args["public"] = 0; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0, + 'testPriorityEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 0; +$args["public"] = 0; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); + +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0, + 'testPriorityEnabled' => 0, + 'automationEnabled' => 0, + 'inventoryEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 0; +$args["public"] = 0; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); + +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0, + 'testPriorityEnabled' => 0, + 'automationEnabled' => 0, + 'inventoryEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 0; +$args["public"] = 1; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); + +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0, + 'testPriorityEnabled' => 0, + 'automationEnabled' => 0, + 'inventoryEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 1; +$args["public"] = 0; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; + +$args = array(); + +// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled +$args["options"] = array( + 'requirementsEnabled' => 0, + 'testPriorityEnabled' => 0, + 'automationEnabled' => 0, + 'inventoryEnabled' => 0 +); +$dummy = 'Options['; +foreach ($args["options"] as $key => $value) { + $dummy .= $key . ' -> ' . $value . ' '; +} +$dummy .= "] "; + +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["active"] = 1; +$args["public"] = 1; + +$additionalInfo = $dummy . + " active -> {$args['active']}, public -> {$args['public']}"; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); // ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; -$prefix = uniqid(); -$devKey = '985978c915f50e47a4b1a54a943d1b76'; -$devKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; - -$args=array(); -$args["devKey"] = $devKey; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; - -$dummy = ''; -$additionalInfo = $dummy; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -die(); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - - -$args=array(); -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 0; -$args["public"] = 0; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug = true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - -$args=array(); -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0, 'testPriorityEnabled' => 0); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 0; -$args["public"] = 0; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - -$args=array(); - -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0, 'testPriorityEnabled' => 0, - 'automationEnabled' => 0 ,'inventoryEnabled' => 0 ); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 0; -$args["public"] = 0; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - -$args=array(); - -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0, 'testPriorityEnabled' => 0, - 'automationEnabled' => 0 ,'inventoryEnabled' => 0 ); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 0; -$args["public"] = 1; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - -$args=array(); - -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0, 'testPriorityEnabled' => 0, - 'automationEnabled' => 0 ,'inventoryEnabled' => 0 ); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 1; -$args["public"] = 0; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; - -$args=array(); - -// requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled -$args["options"] = array('requirementsEnabled' => 0, 'testPriorityEnabled' => 0, - 'automationEnabled' => 0 ,'inventoryEnabled' => 0 ); -$dummy = 'Options['; -foreach($args["options"] as $key => $value) -{ - $dummy .= $key . ' -> ' . $value . ' '; -} -$dummy .= "] "; - - -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["active"] = 1; -$args["public"] = 1; - -$additionalInfo = $dummy . " active -> {$args['active']}, public -> {$args['public']}"; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProjectWithITS.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProjectWithITS.php index e99044472f..2ca44e9124 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProjectWithITS.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestProjectWithITS.php @@ -1,70 +1,66 @@ - {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -//runTest($client,$method,$args); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}() ::: "; -$prefix = uniqid(); -$devKey = '985978c915f50e47a4b1a54a943d1b76'; -$devKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; - -$args=array(); -$args["devKey"] = $devKey; -$args["testcaseprefix"] = $prefix . $test_num; -$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; -$args["itsname"] = "jira-testlink.jira"; -$args["itsenabled"] = 1; - -$dummy = ''; -$additionalInfo = $dummy; -$args["notes"]="test project created using XML-RPC-API -
    {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); + {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}() ::: "; +$prefix = uniqid(); +$devKey = '985978c915f50e47a4b1a54a943d1b76'; +$devKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; + +$args = array(); +$args["devKey"] = $devKey; +$args["testcaseprefix"] = $prefix . $test_num; +$args["testprojectname"] = "API Methods Test Project {$args['testcaseprefix']}"; +$args["itsname"] = "jira-testlink.jira"; +$args["itsenabled"] = 1; + +$dummy = ''; +$additionalInfo = $dummy; +$args["notes"] = "test project created using XML-RPC-API -
    {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestSuite.php index 3b108610a7..3ced2bbf51 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientCreateTestSuite.php @@ -1,76 +1,70 @@ - default behaviour BLOCK => will not be created -// use name of existent Test Suite in parentid, request renaming -// - -$method='createTestSuite'; - - -$unitTestDescription="Test - $method"; -$test_num = 0; -$tlDevKey = '985978c915f50e47a4b1a54a943d1b76'; -$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; - -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project PREFIX'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["prefix"]='ZTZ'; -$args["testsuitename"]='TS API 200.0'; -$args["details"]='This has been created by XMLRPC API Call'; - -// $args["parentid"]=16; -$args["checkduplicatedname"]=1; -$args["actiononduplicatedname"]='generate_new'; -$args["order"]=1; - - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project ID'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["testprojectid"]=1046; -$args["testsuitename"]='TS API 2'; -$args["details"]='This has been created by XMLRPC API Call'; - -// $args["parentid"]=16; -$args["checkduplicatedname"]=1; -$args["actiononduplicatedname"]='generate_new'; -$args["order"]=1; - - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); \ No newline at end of file + default behaviour BLOCK => will not be created +// use name of existent Test Suite in parentid, request renaming +// + +$method = 'createTestSuite'; + +$unitTestDescription = "Test - $method"; +$test_num = 0; +$tlDevKey = '985978c915f50e47a4b1a54a943d1b76'; +$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; + +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project PREFIX'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["prefix"] = 'ZTZ'; +$args["testsuitename"] = 'TS API 200.0'; +$args["details"] = 'This has been created by XMLRPC API Call'; + +$args["checkduplicatedname"] = 1; +$args["actiononduplicatedname"] = 'generate_new'; +$args["order"] = 1; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project ID'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["testprojectid"] = 1046; +$args["testsuitename"] = 'TS API 2'; +$args["details"] = 'This has been created by XMLRPC API Call'; + +$args["checkduplicatedname"] = 1; +$args["actiononduplicatedname"] = 'generate_new'; +$args["order"] = 1; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteExecution.php b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteExecution.php index 28678ea480..9bb45f2f07 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteExecution.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteExecution.php @@ -1,32 +1,32 @@ -debug=$debug; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -?> \ No newline at end of file +debug = $debug; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestCaseSteps.php b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestCaseSteps.php index 2bac34b587..ac01fb9e75 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestCaseSteps.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestCaseSteps.php @@ -1,34 +1,36 @@ -debug=$debug; -runTest($client,$method,$args,$tcCounter); -// ---------------------------------------------------------------------------------------------------- -?> \ No newline at end of file +debug = $debug; +runTest($client, $method, $args, $tcCounter); +// ---------------------------------------------------------------------------------------------------- +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestProject.php b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestProject.php index 26d42babc6..5c3afc9aa1 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestProject.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientDeleteTestProject.php @@ -1,37 +1,35 @@ -debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); +debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientDoesUserExist.php b/lib/api/xmlrpc/v1/sample_clients/php/clientDoesUserExist.php index 2158c88ad3..faae9ccaa3 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientDoesUserExist.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientDoesUserExist.php @@ -1,60 +1,58 @@ -User does not exist
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["user"]='admin'; - -$additionalInfo='
    User exists
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); +User does not exist
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["user"] = 'admin'; + +$additionalInfo = '
    User exists
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); // --------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetAllExecutionsResults.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetAllExecutionsResults.php index 8aba0ecba4..51272543bb 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetAllExecutionsResults.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetAllExecutionsResults.php @@ -1,89 +1,63 @@ -debug=$debug; -runTest($client,$method,$args); -*/ -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='developer'; -$args["testplanid"]=133683; -//$args["testcaseexternalid"]='EW-1'; //121690 -$args["testcaseid"]=121690; - -$args["buildid"]=4; -$unitTestDescription="Test - {$method} - ONLY BUILD ID Filter => " . $args["buildid"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -die(); -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='DEV_KEY'; -$args["testplanid"]=3; -$args["testcaseexternalid"]='PJH-1'; -$args["buildname"]='1'; -$unitTestDescription="Test - {$method} - ONLY BUILD NAME Filter => " . $args["buildname"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='DEV_KEY'; -$args["testplanid"]=10; -$args["testcaseexternalid"]='PJH-1'; -// $args["buildname"]='1'; -$args["platformname"]='Ferrari'; -$unitTestDescription="Test - {$method} - ONLY PLATFORM NAME Filter => " . $args["platformname"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// -------------------------------------------------------------------- + " . + $args["buildid"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +die(); + +$args = array(); +$args["devKey"] = 'DEV_KEY'; +$args["testplanid"] = 3; +$args["testcaseexternalid"] = 'PJH-1'; +$args["buildname"] = '1'; +$unitTestDescription = "Test - {$method} - ONLY BUILD NAME Filter => " . + $args["buildname"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$args = array(); +$args["devKey"] = 'DEV_KEY'; +$args["testplanid"] = 10; +$args["testcaseexternalid"] = 'PJH-1'; +$args["platformname"] = 'Ferrari'; +$unitTestDescription = "Test - {$method} - ONLY PLATFORM NAME Filter => " . + $args["platformname"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetBuilds.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetBuilds.php index e1104df141..63cf86f995 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetBuilds.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetBuilds.php @@ -1,46 +1,45 @@ -debug=$debug; -runTest($client,$method,$args); - -// ------------------------------------------------------------------------------------- -$method='getLatestBuildForTestPlan'; -$unitTestDescription="Test - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=3; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -?> \ No newline at end of file +debug = $debug; +runTest($client, $method, $args); + +// ------------------------------------------------------------------------------------- +$method = 'getLatestBuildForTestPlan'; +$unitTestDescription = "Test - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 3; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetExecCountersByBuild.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetExecCountersByBuild.php index 44488e28fd..9fb2b40139 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetExecCountersByBuild.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetExecCountersByBuild.php @@ -1,29 +1,27 @@ -Simple client to test method:' . $method . '()'; - - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=337058; -$client = new IXR_Client($server_url); -$client->debug=true; -runTest($client,$method,$args); - -?> \ No newline at end of file +Simple client to test method:' . $method . '()'; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 337058; +$client = new IXR_Client($server_url); +$client->debug = true; +runTest($client, $method, $args); + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetFirstLevelTestSuitesForTestProject.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetFirstLevelTestSuitesForTestProject.php index 8f1d6ea329..9fb47be8b6 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetFirstLevelTestSuitesForTestProject.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetFirstLevelTestSuitesForTestProject.php @@ -1,35 +1,34 @@ -debug=$debug; -runTest($client,$method,$args); -?> \ No newline at end of file +debug = $debug; +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetFullPath.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetFullPath.php index 3ce56e4601..d5c88eb9ea 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetFullPath.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetFullPath.php @@ -1,109 +1,117 @@ - Array - */ -require_once 'util.php'; -require_once 'sample.inc.php'; -show_api_db_sample_msg(); - -$method='getFullPath'; -$unitTestDescription="Test - {$method}"; -$idx=1; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=3312; -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=array(3312,3314,3316); -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=array(3333312,3314,3316); -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; -// -------------------------------------------------------------------------- - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]='A'; -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=-1; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=1; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -// -------------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["nodeid"]=419; - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$idx); -$idx++; - -?> \ No newline at end of file + Array + */ +require_once 'util.php'; +require_once 'sample.inc.php'; +show_api_db_sample_msg(); + +$method = 'getFullPath'; +$unitTestDescription = "Test - {$method}"; +$idx = 1; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = 3312; +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; +// -------------------------------------------------------------------------- + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = array( + 3312, + 3314, + 3316 +); +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = array( + 3333312, + 3314, + 3316 +); +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; +// -------------------------------------------------------------------------- + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = 'A'; +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = - 1; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = 1; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +// -------------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["nodeid"] = 419; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $idx); +$idx ++; + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetLastExecutionResult.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetLastExecutionResult.php index a3977384e6..48c45fb874 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetLastExecutionResult.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetLastExecutionResult.php @@ -1,91 +1,64 @@ -debug=$debug; -runTest($client,$method,$args); -*/ -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='eb6fa75e125944e68739514937d63659'; -$args["testplanid"]=189; -$args["testcaseexternalid"]='AF-1'; -// $args["buildid"]=4; -$unitTestDescription="Test - {$method} - ONLY BUILD ID Filter => " . $args["buildid"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -die(); -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='DEV_KEY'; -$args["testplanid"]=3; -$args["testcaseexternalid"]='PJH-1'; -$args["buildname"]='1'; -$unitTestDescription="Test - {$method} - ONLY BUILD NAME Filter => " . $args["buildname"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// -------------------------------------------------------------------- - -// -------------------------------------------------------------------- -$args=array(); -$args["devKey"]='DEV_KEY'; -$args["testplanid"]=10; -$args["testcaseexternalid"]='PJH-1'; -// $args["buildname"]='1'; -$args["platformname"]='Ferrari'; -$unitTestDescription="Test - {$method} - ONLY PLATFORM NAME Filter => " . $args["platformname"]; - -$debug=true; -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// -------------------------------------------------------------------- + " . + $args["buildid"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +die(); + +$args = array(); +$args["devKey"] = 'DEV_KEY'; +$args["testplanid"] = 3; +$args["testcaseexternalid"] = 'PJH-1'; +$args["buildname"] = '1'; +$unitTestDescription = "Test - {$method} - ONLY BUILD NAME Filter => " . + $args["buildname"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +$args = array(); +$args["devKey"] = 'DEV_KEY'; +$args["testplanid"] = 10; +$args["testcaseexternalid"] = 'PJH-1'; +$args["platformname"] = 'Ferrari'; +$unitTestDescription = "Test - {$method} - ONLY PLATFORM NAME Filter => " . + $args["platformname"]; + +$debug = true; +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectKeywords.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectKeywords.php index b90c9fdb49..911e00352a 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectKeywords.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectKeywords.php @@ -1,31 +1,30 @@ -debug=$debug; - -runTest($client,$method,$args); \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectPlatforms.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectPlatforms.php index 3a516b8dc0..3737cdf6ae 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectPlatforms.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectPlatforms.php @@ -1,56 +1,53 @@ -debug=$debug; - -runTest($client,$method,$args,$test_num); - - -// ------------------------------------------------ -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=$tlDevKey; -$args["testprojectid"]=1046; -$additionalInfo='Access By Test Project ID'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args,$test_num); \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args, $test_num); + +// ------------------------------------------------ +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = $tlDevKey; +$args["testprojectid"] = 1046; +$additionalInfo = 'Access By Test Project ID'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectTestPlans.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectTestPlans.php index 2abfccd35e..285b4d5e05 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectTestPlans.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjectTestPlans.php @@ -1,36 +1,35 @@ -debug=$debug; - -runTest($client,$method,$args); -?> \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjects.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjects.php index 007e39cfa2..9bc5d1aa97 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjects.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetProjects.php @@ -1,45 +1,42 @@ -debug=$debug; -$answer = runTest($client,$method,$args); -new dBug($answer); - -$items_qty = count($answer); -foreach($answer as $item) -{ - if( isset($item['name']) ) - { - echo 'name:' . htmlentities($item['name']) . '
    '; - echo 'name:' . htmlentities(utf8_decode($item['name'])) . '
    '; - } -} -?> \ No newline at end of file +debug = $debug; +$answer = runTest($client, $method, $args); +new dBug($answer); + +$items_qty = count($answer); +foreach ($answer as $item) { + if (isset($item['name'])) { + echo 'name:' . htmlentities($item['name']) . '
    '; + echo 'name:' . htmlentities(utf8_decode($item['name'])) . '
    '; + } +} +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCase.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCase.php index 0d40bb909f..ad61eb96bb 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCase.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCase.php @@ -1,95 +1,93 @@ -debug=$debug; - -runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; -$args["testcaseexternalid"]='API-2'; -$args["version"]=1; -$additionalInfo=''; - -$debug=true; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; -$args["testcaseid"]='1667'; -$args["version"]=1; -$additionalInfo=''; - -$debug=true; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; -$args["testcaseexternalid"]='API-2'; -$args["version"]=3; -$additionalInfo=''; - -$debug=true; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); +debug = $debug; + +runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; +$args["testcaseexternalid"] = 'API-2'; +$args["version"] = 1; +$additionalInfo = ''; + +$debug = true; +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; +$args["testcaseid"] = '1667'; +$args["version"] = 1; +$additionalInfo = ''; + +$debug = true; +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $devKey; +$args["testcaseexternalid"] = 'API-2'; +$args["version"] = 3; +$additionalInfo = ''; + +$debug = true; +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); // --------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAssignedTester.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAssignedTester.php index d09dd93241..22273a1176 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAssignedTester.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAssignedTester.php @@ -1,154 +1,136 @@ -debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +die(); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Plan ID"; + +$args = array(); +$args["devKey"] = $devKey; +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Case "; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 9; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 900000; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-WRONG-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); -$method="getTestCaseAssignedTester"; -$utc = 0; -$devKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : 'admin'; - -// --------------------------------------------------------------------------------------- -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - All OK"; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 197; -$args["testcaseexternalid"] = 'SK-1'; -// $args["platformname"] = 'P1'; -$args["buildname"] = '1'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -die(); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Plan ID"; - -$args=array(); -$args["devKey"] = $devKey; -// $args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Case "; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 9; -// $args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -// $args["buildname"] = '1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 900000; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-WRONG-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAttachments.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAttachments.php index 5a437cbcc8..4c403fa29b 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAttachments.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseAttachments.php @@ -1,31 +1,29 @@ -debug=$debug; -runTest($client,$method,$args); \ No newline at end of file +debug = $debug; +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseBugs.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseBugs.php index df508cc499..4cd238678c 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseBugs.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseBugs.php @@ -1,46 +1,43 @@ -"; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$args["testplanid"]="21"; -$args["testcaseid"]="4"; -runTest($client,$method,$args,1); - -echo "Test adding a filter on a the build 2
    "; -$args["buildid"]="2"; -runTest($client,$method,$args,2); - -echo "Test adding a filter on the build 1
    "; -$args["buildid"]="1"; -runTest($client,$method,$args,3); - -echo "Test adding a filter on a platform
    "; -$args["platformid"]="1"; -runTest($client,$method,$args,4); - -echo "Test adding a filter on an execution ID
    "; -$args["executionid"]=1; -runTest($client,$method,$args,5); - -echo "Test adding a filter on another execution ID
    "; -$args["executionid"]=3; -runTest($client,$method,$args,6); +"; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$args["testplanid"] = "21"; +$args["testcaseid"] = "4"; +runTest($client, $method, $args, 1); + +echo "Test adding a filter on a the build 2
    "; +$args["buildid"] = "2"; +runTest($client, $method, $args, 2); + +echo "Test adding a filter on the build 1
    "; +$args["buildid"] = "1"; +runTest($client, $method, $args, 3); + +echo "Test adding a filter on a platform
    "; +$args["platformid"] = "1"; +runTest($client, $method, $args, 4); + +echo "Test adding a filter on an execution ID
    "; +$args["executionid"] = 1; +runTest($client, $method, $args, 5); + +echo "Test adding a filter on another execution ID
    "; +$args["executionid"] = 3; +runTest($client, $method, $args, 6); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldDesignValue.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldDesignValue.php index f853614bed..66509316a3 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldDesignValue.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldDesignValue.php @@ -1,76 +1,75 @@ - Ask for NON EXISTENT VERSION'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -// ----------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcaseexternalid"]='QAZ-1'; -$args["testprojectid"]=455; -$args["customfieldname"]='M LIST'; -$args["details"]='simple'; -$args["version"]= 2; - -$additionalInfo = ' -> Must be GOOD call'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -// ----------------------------------------------------------------------- -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcaseexternalid"]='QAZ-1'; -$args["testprojectid"]=455; -$args["customfieldname"]='M LIST'; -$args["details"]='simple'; -$args["version"]= 1; - -$additionalInfo = ' -> Another GOOD call but for a DIFFERENT Version '; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); - -?> \ No newline at end of file + Ask for NON EXISTENT VERSION'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +// ----------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcaseexternalid"] = 'QAZ-1'; +$args["testprojectid"] = 455; +$args["customfieldname"] = 'M LIST'; +$args["details"] = 'simple'; +$args["version"] = 2; + +$additionalInfo = ' -> Must be GOOD call'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +// ----------------------------------------------------------------------- +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcaseexternalid"] = 'QAZ-1'; +$args["testprojectid"] = 455; +$args["customfieldname"] = 'M LIST'; +$args["details"] = 'simple'; +$args["version"] = 1; + +$additionalInfo = ' -> Another GOOD call but for a DIFFERENT Version '; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldExecutionValue.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldExecutionValue.php index 00f9bd0cfc..b0c68766a6 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldExecutionValue.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseCustomFieldExecutionValue.php @@ -1,112 +1,110 @@ -debug = $debug; +runTest($client, $method, $args, $test_num); +// ----------------------------------------------------- + +// ----------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = 'admin'; +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279311; +$args["testplanid"] = 279324; +$args["version"] = 2; +$args["executionid"] = 9230; +$args["customfieldname"] = 'STRING4EXEC'; +$args["details"] = 'simple'; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); +// ----------------------------------------------------- + +// ----------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279311; +$args["testplanid"] = 173854; + +$args["customfieldname"] = 'STRING4EXEC'; +$args["details"] = 'simple'; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); +// ----------------------------------------------------- + +// ----------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279311; +$args["testplanid"] = 279324; +$args["version"] = 17; +$args["executionid"] = 17; + +$args["customfieldname"] = 'STRING4EXEC'; +$args["details"] = 'simple'; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); // ----------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]='admin'; -$args["testprojectid"]=279311; -$args["testplanid"]=279324; -$args["version"]=1; -$args["executionid"]=9229; -$args["customfieldname"]='STRING4EXEC'; -$args["details"]='simple'; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ----------------------------------------------------- - -// ----------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]='admin'; -$args["devKey"]='admin'; -$args["testprojectid"]=279311; -$args["testplanid"]=279324; -$args["version"]=2; -$args["executionid"]=9230; -$args["customfieldname"]='STRING4EXEC'; -$args["details"]='simple'; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ----------------------------------------------------- - -// ----------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]='admin'; -$args["testprojectid"]=279311; -// $args["testplanid"]=279324; -$args["testplanid"]=173854; - -$args["customfieldname"]='STRING4EXEC'; -$args["details"]='simple'; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ----------------------------------------------------- - -// ----------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]='admin'; -$args["testprojectid"]=279311; -$args["testplanid"]=279324; -$args["version"]=17; -$args["executionid"]=17; - -$args["customfieldname"]='STRING4EXEC'; -$args["details"]='simple'; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ----------------------------------------------------- \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseIDByName.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseIDByName.php index f357ef6f67..da04388413 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseIDByName.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCaseIDByName.php @@ -1,75 +1,74 @@ -debug=$debug; - -runTest($client,$method,$args); -die(); +debug = $debug; + +runTest($client, $method, $args); +die(); +// --------------------------------------------------------------------------------- + +$test_num = 2; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseexternalid"] = 'API-2'; +$args["version"] = 1; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +$test_num = 2; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testcaseid"] = '1667'; +$args["version"] = 1; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); // --------------------------------------------------------------------------------- - -$test_num=2; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseexternalid"]='API-2'; -$args["version"]=1; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -$test_num=2; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testcaseid"]='1667'; -$args["version"]=1; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestPlan.php index 4c9c7927fb..9c99e37447 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestPlan.php @@ -1,173 +1,172 @@ -debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); +debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["getstepsinfo"] = false; +$args["details"] = 'simple'; +$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["getstepsinfo"] = false; +$args["details"] = 'full'; +$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["getstepsinfo"] = false; +$args["details"] = 'summary'; +$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["keywords"] = 'Key Feature'; +$additionalInfo = 'Filter by Keyword name - JUST ONE KEYWORD'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["keywords"] = 'Key Feature,Must have,Obsolete,Performance,System wide,Usability'; +$additionalInfo = 'Filter by Keyword name - Multiple Keywords - ONLY OR Search'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["getstepsinfo"] = false; + +$additionalInfo = 'get steps info: -> false'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testplanid"] = $tplan_id; +$args["getstepsinfo"] = true; + +$additionalInfo = 'get steps info: -> true'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); // --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["getstepsinfo"]=false; -$args["details"]='simple'; -$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["getstepsinfo"]=false; -$args["details"]='full'; -$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["getstepsinfo"]=false; -$args["details"]='summary'; -$additionalInfo = '$args["details"]: ->' . $args["details"] . '
    '; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["keywords"]='Key Feature'; -$additionalInfo='Filter by Keyword name - JUST ONE KEYWORD'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["keywords"]='Key Feature,Must have,Obsolete,Performance,System wide,Usability'; -$additionalInfo='Filter by Keyword name - Multiple Keywords - ONLY OR Search'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["getstepsinfo"]=false; - -$additionalInfo='get steps info: -> false'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testplanid"]=$tplan_id; -$args["getstepsinfo"]=true; - -$additionalInfo='get steps info: -> true'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestSuite.php index f3406c642a..13e5df1042 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesForTestSuite.php @@ -1,60 +1,59 @@ -debug=$debug; - -runTest($client,$method,$args); - -// --------------------------------------------------------------------------------- -$method='getTestCasesForTestSuite'; -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; -$args["testprojectid"]=12222; -$args["testsuiteid"]=186; -$args["deep"]=false; -$args["details"]='simple'; - -$additionalInfo=' Parameter deep = ' . $args["deep"]; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -runTest($client,$method,$args); \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); + +// --------------------------------------------------------------------------------- +$method = 'getTestCasesForTestSuite'; +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : DEV_KEY; +$args["testprojectid"] = 12222; +$args["testsuiteid"] = 186; +$args["deep"] = false; +$args["details"] = 'simple'; + +$additionalInfo = ' Parameter deep = ' . $args["deep"]; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesIDByName.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesIDByName.php index 8e1d54fecb..fd603396d7 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesIDByName.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestCasesIDByName.php @@ -1,62 +1,60 @@ -debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcasename"]='Full speed unload'; -$args["testcasepathname"]='ZATHURA::Holodeck::Apollo 10 Simulation::Unload::Full speed unload'; - -$additionalInfo=''; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -?> \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcasename"] = 'Full speed unload'; +$args["testcasepathname"] = 'ZATHURA::Holodeck::Apollo 10 Simulation::Unload::Full speed unload'; + +$additionalInfo = ''; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanByName.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanByName.php index 3bd7a0837c..1c9ee3d0ea 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanByName.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanByName.php @@ -1,38 +1,37 @@ -debug=$debug; - -runTest($client,$method,$args); -?> \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanPlatforms.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanPlatforms.php index daec8a2f53..69f02c05a1 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanPlatforms.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestPlanPlatforms.php @@ -1,107 +1,103 @@ -Test PLan ID is < 0 => INEXISTENT
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=380; - -$additionalInfo='
    Test Plan HAS NO PLATFORMS
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=1651; - -$additionalInfo='
    Test Plan Has platforms
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["tesid"]=1651; - -$additionalInfo='
    BAD parameter
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -?> \ No newline at end of file +Test PLan ID is < 0 => INEXISTENT
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 380; + +$additionalInfo = '
    Test Plan HAS NO PLATFORMS
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 1651; + +$additionalInfo = '
    Test Plan Has platforms
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["tesid"] = 1651; + +$additionalInfo = '
    BAD parameter
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php index 883aca3c98..549c535326 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestProjectByName.php @@ -1,37 +1,36 @@ -debug=$debug; - -runTest($client,$method,$args); -?> \ No newline at end of file +debug = $debug; + +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuite.php index cbc648ebf2..c2022f4cf5 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuite.php @@ -1,73 +1,72 @@ -debug = $debug; -runTest($client,$method,$args); -// ---- - -// ---- -$UTDescr = "{$method} - Test - Call with just test suite name"; -echo $UTDescr; - -$debug = false; -$args=array(); -$args["devKey"] = 'devkey'; -$args["testsuitename"] = 'QAZ-TS'; - -$client = new IXR_Client($server_url); -$client->debug = $debug; -runTest($client,$method,$args); - -// ---- - -// ---- -$UTDescr = "{$method} - Test - Call with just test project prefix"; - -$debug=false; -echo $UTDescr; -$args=array(); -$args["devKey"] = 'devkey'; -$args["prefix"] = 'QUANTAS'; -$args["details"]='simple'; - -$client = new IXR_Client($server_url); -$client->debug = $debug; -runTest($client,$method,$args); -// ---- - -// ---- -$UTDescr = "{$method} - Test "; - -$debug=false; -echo $UTDescr; -$args=array(); -$args["devKey"] = 'devkey'; -$args["testsuitename"] = 'CANNES'; -$args["prefix"] = 'SRM'; -$args["details"]='simple'; - -$client = new IXR_Client($server_url); -$client->debug = $debug; -runTest($client,$method,$args); +debug = $debug; +runTest($client, $method, $args); +// ---- + +// ---- +$UTDescr = "{$method} - Test - Call with just test suite name"; +echo $UTDescr; + +$debug = false; +$args = array(); +$args["devKey"] = 'devkey'; +$args["testsuitename"] = 'QAZ-TS'; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); + +// ---- + +// ---- +$UTDescr = "{$method} - Test - Call with just test project prefix"; + +$debug = false; +echo $UTDescr; +$args = array(); +$args["devKey"] = 'devkey'; +$args["prefix"] = 'QUANTAS'; +$args["details"] = 'simple'; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); +// ---- + +// ---- +$UTDescr = "{$method} - Test "; + +$debug = false; +echo $UTDescr; +$args = array(); +$args["devKey"] = 'devkey'; +$args["testsuitename"] = 'CANNES'; +$args["prefix"] = 'SRM'; +$args["details"] = 'simple'; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); // ---- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestPlan.php index 0c4a5c787a..eebe797c71 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestPlan.php @@ -1,46 +1,45 @@ - - * @package TestlinkAPI - * @link http://testlink.org/api/ - * - * - * - * rev: 20081013 - franciscom - minor improvements to avoid reconfigure server url - * added test of getTestSuitesForTestPlan() - * 20080818 - franciscom - start work on custom field tests - * 20080306 - franciscom - added dBug to improve diagnostic info. - * 20080305 - franciscom - refactored - */ - -require_once 'util.php'; -require_once 'sample.inc.php'; -show_api_db_sample_msg(); - -$method='getTestSuitesForTestPlan'; -$test_num=1; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=3; - -$debug=true; -echo $unitTestDescription; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -?> \ No newline at end of file + + * @package TestlinkAPI + * @link http://testlink.org/api/ + * + * + * + * rev: 20081013 - franciscom - minor improvements to avoid reconfigure server url + * added test of getTestSuitesForTestPlan() + * 20080818 - franciscom - start work on custom field tests + * 20080306 - franciscom - added dBug to improve diagnostic info. + * 20080305 - franciscom - refactored + */ +require_once 'util.php'; +require_once 'sample.inc.php'; +show_api_db_sample_msg(); + +$method = 'getTestSuitesForTestPlan'; +$test_num = 1; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 3; + +$debug = true; +echo $unitTestDescription; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestSuite.php index 28bede51dc..9253fb034d 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTestSuitesForTestSuite.php @@ -1,107 +1,103 @@ -Test suite ID is INEXISTENT
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testsuiteid"]=689; - -$additionalInfo='

    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testsuiteid"]=193; - -$additionalInfo='
    Test Suite HAS NO CHILDREN
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testsuiteid"]=228; - -$additionalInfo=''; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -$answer = runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -?> \ No newline at end of file +Test suite ID is INEXISTENT
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testsuiteid"] = 689; + +$additionalInfo = '

    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testsuiteid"] = 193; + +$additionalInfo = '
    Test Suite HAS NO CHILDREN
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testsuiteid"] = 228; + +$additionalInfo = ''; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +$answer = runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTotalsForPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTotalsForPlan.php index 4b181fa1ee..bf8288a2a1 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetTotalsForPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetTotalsForPlan.php @@ -1,60 +1,58 @@ -Test plan has no platforms
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args); -// --------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=10872; - -$additionalInfo='
    Test Plan has platforms
    '; -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; -echo 'arguments:
    '; -foreach($args as $key => $value) -{ - echo $key . '=' . $value . '
    '; -} - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args); +Test plan has no platforms
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args); +// --------------------------------------------------------------------------------- + +// --------------------------------------------------------------------------------- +$test_num ++; +$unitTestDescription = "Test {$test_num} - {$method}"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 10872; + +$additionalInfo = '
    Test Plan has platforms
    '; +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; +echo 'arguments:
    '; +foreach ($args as $key => $value) { + echo $key . '=' . $value . '
    '; +} + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args); // --------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientGetUserByLogin.php b/lib/api/xmlrpc/v1/sample_clients/php/clientGetUserByLogin.php index ce4bf6ae57..018a86e738 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientGetUserByLogin.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientGetUserByLogin.php @@ -1,28 +1,27 @@ -debug=$debug; -runTest($client,$method,$args); \ No newline at end of file +debug = $debug; +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientRemovePlatformFromTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/clientRemovePlatformFromTestPlan.php index 41a0a570ee..910a12baec 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientRemovePlatformFromTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientRemovePlatformFromTestPlan.php @@ -1,29 +1,29 @@ -debug=$debug; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- -?> \ No newline at end of file +debug = $debug; +$answer = runTest($client, $method, $args); +// --------------------------------------------------------------------------------------- +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientRemoveTestCaseKeywords.php b/lib/api/xmlrpc/v1/sample_clients/php/clientRemoveTestCaseKeywords.php index 9e5d0ce75f..7a478173d8 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientRemoveTestCaseKeywords.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientRemoveTestCaseKeywords.php @@ -1,29 +1,33 @@ - array('Barbie'), - 'MAB-2' => array('Barbie')); - - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; -$answer = runTest($client,$method,$args); \ No newline at end of file + array( + 'Barbie' + ), + 'MAB-2' => array( + 'Barbie' + ) +); + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; +$answer = runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResult.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResult.php index c681a4094e..615f1c9ff4 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResult.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResult.php @@ -1,140 +1,122 @@ -testplanid=2; -$context->buildid=1; -$context->buildname=null; -$context->platformname=null; -$context->testcaseexternalid='AF-1'; -$context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['blocked']; -$exec->notes="Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -//$exec->user = 'QQ'; -$exec->overwrite=false; - -$debug=false; -echo '
    ' . $unitTestDescription . ''; -echo '
    '; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - echo '
    Context is:'; - new dBug($context); - - - echo '
    Execution data is:'; - new dBug($exec); - - echo '
    '; - - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - $data["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; - $data["status"] = $exec->status; - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - echo '
    Method will be called with following data:'; - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 2; +$context->buildid = 1; +$context->buildname = null; +$context->platformname = null; +$context->testcaseexternalid = 'AF-1'; +$context->testcaseid = null; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['blocked']; +$exec->notes = "Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->overwrite = false; + +$debug = false; +echo '
    ' . $unitTestDescription . ''; +echo '
    '; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + echo '
    Context is:'; + new dBug($context); + + echo '
    Execution data is:'; + new dBug($exec); + + echo '
    '; + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; + $data["status"] = $exec->status; + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + echo '
    Method will be called with following data:'; + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTester.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTester.php index b37505d556..4a26fe7c75 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTester.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTester.php @@ -1,134 +1,116 @@ -testplanid=2; -$context->buildid=1; -$context->buildname=null; -$context->platformname=null; -$context->testcaseexternalid='AF-1'; -$context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['blocked']; -$exec->notes="Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->user = 'QQ'; -$exec->overwrite=false; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - new dBug($context); - new dBug($exec); - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - $data["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; - $data["status"] = $exec->status; - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 2; +$context->buildid = 1; +$context->buildname = null; +$context->platformname = null; +$context->testcaseexternalid = 'AF-1'; +$context->testcaseid = null; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['blocked']; +$exec->notes = "Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->user = 'QQ'; +$exec->overwrite = false; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + new dBug($context); + new dBug($exec); + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; + $data["status"] = $exec->status; + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTimestamp.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTimestamp.php index 472beadb87..4a8010158d 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTimestamp.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultForcingTimestamp.php @@ -1,136 +1,118 @@ -testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['blocked']; -$exec->notes="Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-09-07 12:00:00'; -$exec->overwrite=false; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - new dBug($context); - new dBug($exec); - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - $data["devKey"] = 'admin'; - $data["status"] = $exec->status; - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - if( property_exists($exec, 'timestamp') && !is_null($exec->timestamp) ) - { - $data["timestamp"]=$exec->timestamp; - } - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['blocked']; +$exec->notes = "Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-09-07 12:00:00'; +$exec->overwrite = false; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + new dBug($context); + new dBug($exec); + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = 'admin'; + $data["status"] = $exec->status; + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + if (property_exists($exec, 'timestamp') && ! is_null($exec->timestamp)) { + $data["timestamp"] = $exec->timestamp; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITE.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITE.php index c52e7d44a1..a788918127 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITE.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITE.php @@ -1,153 +1,135 @@ - - * @package TestlinkAPI - */ - -require_once 'util.php'; -require_once 'sample.inc.php'; -show_api_db_sample_msg(); - -$tcaseStatusCode['passed']='p'; -$tcaseStatusCode['blocked']='b'; -$tcaseStatusCode['failed']='f'; -$tcaseStatusCode['wrong']='w'; -$tcaseStatusCode['departed']='d'; - -// Substitute for tcid and tpid that apply to your project -$unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildID"; -$testPlanID=337084; -$testCaseExternalID='URN-1'; -$testCaseID=null; -$buildID=142; -// $status=$tcaseStatusCode['blocked']; -$status=$tcaseStatusCode['passed']; - -date_default_timezone_set('UTC'); - -$exec_notes="Call using all EXTERNAL ID ({$testCaseExternalID}) - status={$status} - " . date(DATE_RFC822); -$platformName='Ferrari'; -$overwrite=true; -$bug_id = null; -$customfields = null; -$debug=false; -echo $unitTestDescription; -$response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, - $buildID,null,$status,$exec_notes,$bug_id,$customfields, - $platformName,$overwrite,$debug); - -echo "
    Result was: "; -// Typically you'd want to validate the result here and probably do something more useful with it -// print_r($response); -new dBug($response); -echo "
    "; - - -// Substitute for tcid and tpid that apply to your project -// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildID"; -// $testPlanID=446; -// $testCaseExternalID='AA-1'; -// $testCaseID=null; -// $buildID=2; -// // $status=$tcaseStatusCode['departed']; -// $status=$tcaseStatusCode['blocked']; -// // $status=$tcaseStatusCode['wrong']; -// // $exec_notes="Call using all INTERNAL ID's ({$testCaseID}) - status={$status}"; -// $exec_notes="Call using all EXTERNAL ID ({$testCaseExternalID}) - status={$status}"; -// $bug_id='999FF'; -// $customfields=array('CF_EXE1' => 'COMODORE64','CF_DT' => mktime(10,10,0,7,29,2009)); -// -// $debug=false; -// echo $unitTestDescription; -// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, -// $buildID,null,$status,$exec_notes,$bug_id,$customfields,$debug); -// -// echo "
    Result was: "; -// // Typically you'd want to validate the result here and probably do something more useful with it -// // print_r($response); -// new dBug($response); -// echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function reportResult($server_url,$tcaseid=null, $tcaseexternalid=null,$tplanid, $buildid=null, - $buildname=null, $status,$notes=null,$bugid=null,$customfields=null, - $platformname=null,$overwrite=false,$debug=false) -{ - - $client = new IXR_Client($server_url); - - $client->debug=$debug; - - $data = array(); - $data["devKey"] = constant("DEV_KEY"); - $data["testplanid"] = $tplanid; - - if( !is_null($bugid) ) - { - $data["bugid"] = $bugid; - } - - if( !is_null($tcaseid) ) - { - $data["testcaseid"] = $tcaseid; - } - else if( !is_null($tcaseexternalid) ) - { - $data["testcaseexternalid"] = $tcaseexternalid; - } - - if( !is_null($buildid) ) - { - $data["buildid"] = $buildid; - } - else if ( !is_null($buildname) ) - { - $data["buildname"] = $buildname; - } - - if( !is_null($notes) ) - { - $data["notes"] = $notes; - } - $data["status"] = $status; - - if( !is_null($customfields) ) - { - $data["customfields"]=$customfields; - } - - if( !is_null($platformname) ) - { - $data["platformname"]=$platformname; - } - - if( !is_null($overwrite) ) - { - $data["overwrite"]=$overwrite; - } - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} - - -?> \ No newline at end of file + + * @package TestlinkAPI + */ +require_once 'util.php'; +require_once 'sample.inc.php'; +show_api_db_sample_msg(); + +$tcaseStatusCode['passed'] = 'p'; +$tcaseStatusCode['blocked'] = 'b'; +$tcaseStatusCode['failed'] = 'f'; +$tcaseStatusCode['wrong'] = 'w'; +$tcaseStatusCode['departed'] = 'd'; + +// Substitute for tcid and tpid that apply to your project +$unitTestDescription = "Test - Call with valid parameters: testPlanID,testCaseID,buildID"; +$testPlanID = 337084; +$testCaseExternalID = 'URN-1'; +$testCaseID = null; +$buildID = 142; +$status = $tcaseStatusCode['passed']; + +date_default_timezone_set('UTC'); + +$exec_notes = "Call using all EXTERNAL ID ({$testCaseExternalID}) - status={$status} - " . + date(DATE_RFC822); +$platformName = 'Ferrari'; +$overwrite = true; +$bug_id = null; +$customfields = null; +$debug = false; +echo $unitTestDescription; +$response = reportResult($server_url, $testCaseID, $testCaseExternalID, + $testPlanID, $buildID, null, $status, $exec_notes, $bug_id, $customfields, + $platformName, $overwrite, $debug); + +echo "
    Result was: "; +// Typically you'd want to validate the result here and probably do something more useful with it +// print_r($response); +new dBug($response); +echo "
    "; + +// Substitute for tcid and tpid that apply to your project +// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildID"; +// $testPlanID=446; +// $testCaseExternalID='AA-1'; +// $testCaseID=null; +// $buildID=2; +// // $status=$tcaseStatusCode['departed']; +// $status=$tcaseStatusCode['blocked']; +// // $status=$tcaseStatusCode['wrong']; +// // $exec_notes="Call using all INTERNAL ID's ({$testCaseID}) - status={$status}"; +// $exec_notes="Call using all EXTERNAL ID ({$testCaseExternalID}) - status={$status}"; +// $bug_id='999FF'; +// $customfields=array('CF_EXE1' => 'COMODORE64','CF_DT' => mktime(10,10,0,7,29,2009)); +// +// $debug=false; +// echo $unitTestDescription; +// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, +// $buildID,null,$status,$exec_notes,$bug_id,$customfields,$debug); +// +// echo "
    Result was: "; +// // Typically you'd want to validate the result here and probably do something more useful with it +// // print_r($response); +// new dBug($response); +// echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function reportResult($server_url, $tcaseid = null, $tcaseexternalid = null, + $tplanid, $buildid = null, $buildname = null, $status, $notes = null, + $bugid = null, $customfields = null, $platformname = null, + $overwrite = false, $debug = false) +{ + $client = new IXR_Client($server_url); + + $client->debug = $debug; + + $data = array(); + $data["devKey"] = constant("DEV_KEY"); + $data["testplanid"] = $tplanid; + + if (! is_null($bugid)) { + $data["bugid"] = $bugid; + } + + if (! is_null($tcaseid)) { + $data["testcaseid"] = $tcaseid; + } elseif (! is_null($tcaseexternalid)) { + $data["testcaseexternalid"] = $tcaseexternalid; + } + + if (! is_null($buildid)) { + $data["buildid"] = $buildid; + } elseif (! is_null($buildname)) { + $data["buildname"] = $buildname; + } + + if (! is_null($notes)) { + $data["notes"] = $notes; + } + $data["status"] = $status; + + if (! is_null($customfields)) { + $data["customfields"] = $customfields; + } + + if (! is_null($platformname)) { + $data["platformname"] = $platformname; + } + + if (! is_null($overwrite)) { + $data["overwrite"] = $overwrite; + } + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITEForcingTimestamp.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITEForcingTimestamp.php index 91cdae2033..de3097f0b6 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITEForcingTimestamp.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultOVERWRITEForcingTimestamp.php @@ -1,217 +1,192 @@ -testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-09-07 12:12:30'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-09-07 12:'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-31-10 12:'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-10-10'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - new dBug($context); - new dBug($exec); - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - $data["devKey"] = 'admin'; - $data["status"] = $exec->status; - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - if( property_exists($exec, 'timestamp') && !is_null($exec->timestamp) ) - { - $data["timestamp"]=$exec->timestamp; - } - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-09-07 12:12:30'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-09-07 12:'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-31-10 12:'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-10-10'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + new dBug($context); + new dBug($exec); + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = 'admin'; + $data["status"] = $exec->status; + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + if (property_exists($exec, 'timestamp') && ! is_null($exec->timestamp)) { + $data["timestamp"] = $exec->timestamp; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWIthExecDuration.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWIthExecDuration.php index 0d91cf5397..a48e15336e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWIthExecDuration.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWIthExecDuration.php @@ -1,45 +1,43 @@ -debug = $debug; +runTest($client, $method, $args, $test_num); -$method='reportTCResult'; - -$tcaseStatusCode['passed']='p'; -$tcaseStatusCode['blocked']='b'; -$tcaseStatusCode['failed']='f'; -$tcaseStatusCode['wrong']='w'; -$tcaseStatusCode['departed']='d'; - -$test_num=0; - -// ----------------------------------------------------- -$test_num++; -$unitTestDescription="Test {$test_num} - {$method}"; - -$args=array(); -$args["devKey"]='admin'; -$args['testcaseexternalid'] = 'IU7206-1'; -$args["testplanid"]=279324; -$args["buildname"]='1.0'; -$args["execduration"]=2.7; -$args['status'] = $tcaseStatusCode['failed']; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); -// ----------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWithSteps.php b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWithSteps.php index e9ff33115a..11c6446bf7 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWithSteps.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientReportTCResultWithSteps.php @@ -1,228 +1,203 @@ -testplanid=308; -// $context->buildid=1; -$context->buildname='1.0'; -//$context->platformname='PLAT01'; -$context->testcaseexternalid='EO-8'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -// $exec->timestamp = '2015-09-07 12:12:30'; -$exec->overwrite = FALSE; -$exec->steps = array( - array('step_number' => 1, - 'result' => 'n', 'notes' => 'no')); - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; -die(); - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-09-07 12:'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-31-10 12:'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// -------------------------------------- -$unitTestDescription="Test - Call with BAD TIMESTAMP"; - -$context = new stdClass(); -$context->testplanid=279348; -// $context->buildid=1; -$context->buildname='2.0'; -$context->platformname='PLAT01'; -$context->testcaseexternalid='ZQ-3'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['passed']; -$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; -$exec->customfields = null; -$exec->bugid = null; -$exec->timestamp = '2015-10-10'; -$exec->overwrite = TRUE; - -$debug=false; -echo $unitTestDescription; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - new dBug($context); - new dBug($exec); - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - // $data["devKey"] = 'admin'; - $data["devKey"] = 'devkey'; - - $data["status"] = $exec->status; - - if( property_exists($exec, 'steps') ) - { - $data["steps"]=$exec->steps; - } - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - if( property_exists($exec, 'timestamp') && !is_null($exec->timestamp) ) - { - $data["timestamp"]=$exec->timestamp; - } - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 308; +$context->buildname = '1.0'; +$context->testcaseexternalid = 'EO-8'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->overwrite = false; +$exec->steps = array( + array( + 'step_number' => 1, + 'result' => 'n', + 'notes' => 'no' + ) +); + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; +die(); + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-09-07 12:'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-31-10 12:'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// -------------------------------------- +$unitTestDescription = "Test - Call with BAD TIMESTAMP"; + +$context = new stdClass(); +$context->testplanid = 279348; +$context->buildname = '2.0'; +$context->platformname = 'PLAT01'; +$context->testcaseexternalid = 'ZQ-3'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['passed']; +$exec->notes = "OVERWRITE - Call using all EXTERNAL ID ({$context->testcaseexternalid}) - status={$exec->status}"; +$exec->customfields = null; +$exec->bugid = null; +$exec->timestamp = '2015-10-10'; +$exec->overwrite = true; + +$debug = false; +echo $unitTestDescription; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + new dBug($context); + new dBug($exec); + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = 'devkey'; + + $data["status"] = $exec->status; + + if (property_exists($exec, 'steps')) { + $data["steps"] = $exec->steps; + } + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + if (property_exists($exec, 'timestamp') && ! is_null($exec->timestamp)) { + $data["timestamp"] = $exec->timestamp; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSample.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSample.php index 67bcabc71d..7a43fe630d 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSample.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSample.php @@ -1,171 +1,153 @@ - - * @package TestlinkAPI - * @link http://testlink.org/api/ - * - * rev: 20080306 - franciscom - added dBug to improve diagnostic info. - * 20080305 - franciscom - refactored - */ - -require_once 'util.php'; -require_once 'sample.inc.php'; - -$tcaseStatusCode['passed']='p'; -$tcaseStatusCode['blocked']='b'; -$tcaseStatusCode['failed']='f'; -$tcaseStatusCode['wrong']='w'; -$tcaseStatusCode['departed']='d'; - - - -// Substitute for tcid and tpid that apply to your project -$unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildID"; -$testPlanID=222; -// $testCaseID=185; -$testCaseID=58; -$testCaseExternalID=null; -$buildID=15; -// $status=$tcaseStatusCode['departed']; -$status=$tcaseStatusCode['blocked']; -// $status=$tcaseStatusCode['wrong']; -$exec_notes="Call using all INTERNAL ID's ({$testCaseID}) - status={$status}"; -$bug_id='999FF'; - -$debug=false; -echo $unitTestDescription; -$response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, - $buildID,null,$status,$exec_notes,$bug_id,$debug); - -echo "
    Result was: "; -// Typically you'd want to validate the result here and probably do something more useful with it -// print_r($response); -new dBug($response); -echo "
    "; -// -// -// // Now do a wrong build call -// $unitTestDescription="Test - Call with at least one NON EXISTENT parameters: testPlanID,testCaseID,buildID"; -// $testPlanID=95; -// $testCaseID=86; -// $testCaseExternalID=null; -// $buildID=50; -// $exec_notes=""; -// -// //$debug=true; -// $debug=false; -// echo $unitTestDescription; -// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, -// $buildID,null,$tcaseStatusCode['passed'],$exec_notes,$bug_id,$debug); -// -// echo "
    Result was: "; -// new dBug($response); -// echo "
    "; -// -// // ---------------------------------------------------------------------------------------- -// // Now do a build name call -// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildName"; -// $testPlanID=95; -// $testCaseID=83; -// $testCaseExternalID=''; -// $buildName="Spock"; -// $exec_notes="Call using all Build by name ({$testCaseID})"; -// -// //$debug=true; -// $debug=false; -// echo $unitTestDescription; -// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID,null, -// $buildName,$tcaseStatusCode['blocked'],$exec_notes,$bug_id,$debug); -// -// echo "
    Result was: "; -// new dBug($response); -// echo "
    "; -// // ---------------------------------------------------------------------------------------- -// -// -// // Now do a build name call -// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseExternalID,buildName"; -// $testPlanID=95; -// $testCaseID=null; -// $testCaseExternalID='ESP-3'; -// $buildName="Spock"; -// // $exec_notes="Call using Test Case External ID and Build by Name"; -// $exec_notes=null; -// -// //$debug=true; -// $debug=false; -// echo $unitTestDescription; -// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID,null, -// $buildName,$tcaseStatusCode['failed'],$exec_notes,$bug_id,$debug); -// -// echo "
    Result was: "; -// new dBug($response); -// echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function reportResult($server_url,$tcaseid=null, $tcaseexternalid=null,$tplanid, $buildid=null, - $buildname=null, $status,$notes=null,$bugid=null,$debug=false) -{ - - $client = new IXR_Client($server_url); - - $client->debug=$debug; - - $data = array(); - $data["devKey"] = constant("DEV_KEY"); - $data["testplanid"] = $tplanid; - - if( !is_null($bugid) ) - { - $data["bugid"] = $bugid; - } - - if( !is_null($tcaseid) ) - { - $data["testcaseid"] = $tcaseid; - } - else if( !is_null($tcaseexternalid) ) - { - $data["testcaseexternalid"] = $tcaseexternalid; - } - - if( !is_null($buildid) ) - { - $data["buildid"] = $buildid; - } - else if ( !is_null($buildname) ) - { - $data["buildname"] = $buildname; - } - - if( !is_null($notes) ) - { - $data["notes"] = $notes; - } - $data["status"] = $status; - - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) - { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else - { - return $client->getResponse(); - } -} - - -?> \ No newline at end of file + + * @package TestlinkAPI + * @link http://testlink.org/api/ + * + * rev: 20080306 - franciscom - added dBug to improve diagnostic info. + * 20080305 - franciscom - refactored + */ +require_once 'util.php'; +require_once 'sample.inc.php'; + +$tcaseStatusCode['passed'] = 'p'; +$tcaseStatusCode['blocked'] = 'b'; +$tcaseStatusCode['failed'] = 'f'; +$tcaseStatusCode['wrong'] = 'w'; +$tcaseStatusCode['departed'] = 'd'; + +// Substitute for tcid and tpid that apply to your project +$unitTestDescription = "Test - Call with valid parameters: testPlanID,testCaseID,buildID"; +$testPlanID = 222; +$testCaseID = 58; +$testCaseExternalID = null; +$buildID = 15; +$status = $tcaseStatusCode['blocked']; +$exec_notes = "Call using all INTERNAL ID's ({$testCaseID}) - status={$status}"; +$bug_id = '999FF'; + +$debug = false; +echo $unitTestDescription; +$response = reportResult($server_url, $testCaseID, $testCaseExternalID, + $testPlanID, $buildID, null, $status, $exec_notes, $bug_id, $debug); + +echo "
    Result was: "; +// Typically you'd want to validate the result here and probably do something more useful with it +// print_r($response); +new dBug($response); +echo "
    "; + +// +// +// // Now do a wrong build call +// $unitTestDescription="Test - Call with at least one NON EXISTENT parameters: testPlanID,testCaseID,buildID"; +// $testPlanID=95; +// $testCaseID=86; +// $testCaseExternalID=null; +// $buildID=50; +// $exec_notes=""; +// +// //$debug=true; +// $debug=false; +// echo $unitTestDescription; +// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID, +// $buildID,null,$tcaseStatusCode['passed'],$exec_notes,$bug_id,$debug); +// +// echo "
    Result was: "; +// new dBug($response); +// echo "
    "; +// +// // ---------------------------------------------------------------------------------------- +// // Now do a build name call +// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseID,buildName"; +// $testPlanID=95; +// $testCaseID=83; +// $testCaseExternalID=''; +// $buildName="Spock"; +// $exec_notes="Call using all Build by name ({$testCaseID})"; +// +// //$debug=true; +// $debug=false; +// echo $unitTestDescription; +// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID,null, +// $buildName,$tcaseStatusCode['blocked'],$exec_notes,$bug_id,$debug); +// +// echo "
    Result was: "; +// new dBug($response); +// echo "
    "; +// // ---------------------------------------------------------------------------------------- +// +// +// // Now do a build name call +// $unitTestDescription="Test - Call with valid parameters: testPlanID,testCaseExternalID,buildName"; +// $testPlanID=95; +// $testCaseID=null; +// $testCaseExternalID='ESP-3'; +// $buildName="Spock"; +// // $exec_notes="Call using Test Case External ID and Build by Name"; +// $exec_notes=null; +// +// //$debug=true; +// $debug=false; +// echo $unitTestDescription; +// $response = reportResult($server_url,$testCaseID,$testCaseExternalID,$testPlanID,null, +// $buildName,$tcaseStatusCode['failed'],$exec_notes,$bug_id,$debug); +// +// echo "
    Result was: "; +// new dBug($response); +// echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function reportResult($server_url, $tcaseid = null, $tcaseexternalid = null, + $tplanid, $buildid = null, $buildname = null, $status, $notes = null, + $bugid = null, $debug = false) +{ + $client = new IXR_Client($server_url); + + $client->debug = $debug; + + $data = array(); + $data["devKey"] = constant("DEV_KEY"); + $data["testplanid"] = $tplanid; + + if (! is_null($bugid)) { + $data["bugid"] = $bugid; + } + + if (! is_null($tcaseid)) { + $data["testcaseid"] = $tcaseid; + } elseif (! is_null($tcaseexternalid)) { + $data["testcaseexternalid"] = $tcaseexternalid; + } + + if (! is_null($buildid)) { + $data["buildid"] = $buildid; + } elseif (! is_null($buildname)) { + $data["buildname"] = $buildname; + } + + if (! is_null($notes)) { + $data["notes"] = $notes; + } + $data["status"] = $status; + + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSample2.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSample2.php index c1e134b6ec..f49cc5997c 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSample2.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSample2.php @@ -1,175 +1,165 @@ - - * @package TestlinkAPI - * @link http://testlink.org/api/ - * - * - * - * rev: 20081013 - franciscom - minor improvements to avoid reconfigure server url - * added test of getTestSuitesForTestPlan() - * 20080818 - franciscom - start work on custom field tests - * 20080306 - franciscom - added dBug to improve diagnostic info. - * 20080305 - franciscom - refactored - */ - -require_once 'util.php'; -require_once 'sample.inc.php'; - -$unitTestDescription="Test - getTestCasesForTestPlan"; - -/** -* getTestCasesForTestPlan -* List test cases linked to a test plan -* -* @param struct $args -* @param string $args["devKey"] -* @param int $args["testplanid"] -* @param int $args["testcaseid"] - optional -* @param int $args["buildid"] - optional -* @param int $args["keywordid"] - optional -* @param boolean $args["executed"] - optional -* @param int $args["$assignedto"] - optional -* @param string $args["executestatus"] - optional -* @return mixed $resultInfo -*/ -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=61579; - -// optional -// $args["testcaseid"] - optional -// $args["buildid"] - optional -// $args["keywordid"] - optional -// $args["executed"] - optional -// $args["$assignedto"] - optional -// $args["executestatus"] - optional - -//$debug=true; -$debug=false; -echo $unitTestDescription; - - -$client = new IXR_Client($server_url); -$client->debug=$debug; - - - -new dBug($args); -if(!$client->query('tl.getTestCasesForTestPlan', $args)) -{ - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - $response=null; -} -else -{ - $response=$client->getResponse(); -} - -echo "
    Result was: "; -// Typically you'd want to validate the result here and probably do something more useful with it -// print_r($response); -new dBug($response); -echo "
    "; - - -// 20080518 - franciscom -$unitTestDescription="Test - createTestProject"; -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectname"]='API TestProject'; - -$debug=true; -//$debug=false; -echo $unitTestDescription; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -new dBug($args); -if(!$client->query('tl.createTestProject', $args)) -{ - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - $response=null; -} -else -{ - $response=$client->getResponse(); -} - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// ---------------------------------------------------------------------- -$method='getTestCaseCustomFieldDesignValue'; -$client_query='tl.' . $method; -$unitTestDescription="Test - $method"; - -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testcaseexternalid"]='ESP-1'; -// $args["customfieldname"]='TESTER_EXPERIENCE'; -$args["customfieldname"]='SSCRIPT_CF1'; - -$debug=true; - -echo $unitTestDescription; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -new dBug($args); -if(!$client->query($client_query, $args)) -{ - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - $response=null; -} -else -{ - $response=$client->getResponse(); -} - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -// ------------------------------------------------------------------------------------- -$unitTestDescription="Test - getTestSuitesForTestPlan"; -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testplanid"]=61579; - -$debug=true; -echo $unitTestDescription; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -new dBug($args); -if(!$client->query('tl.getTestSuitesForTestPlan', $args)) -{ - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - $response=null; -} -else -{ - $response=$client->getResponse(); -} - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -?> \ No newline at end of file + + * @package TestlinkAPI + * @link http://testlink.org/api/ + * + * + * + * rev: 20081013 - franciscom - minor improvements to avoid reconfigure server url + * added test of getTestSuitesForTestPlan() + * 20080818 - franciscom - start work on custom field tests + * 20080306 - franciscom - added dBug to improve diagnostic info. + * 20080305 - franciscom - refactored + */ +require_once 'util.php'; +require_once 'sample.inc.php'; + +$unitTestDescription = "Test - getTestCasesForTestPlan"; + +/** + * getTestCasesForTestPlan + * List test cases linked to a test plan + * + * @param struct $args + * @param string $args["devKey"] + * @param int $args["testplanid"] + * @param int $args["testcaseid"] + * - optional + * @param int $args["buildid"] + * - optional + * @param int $args["keywordid"] + * - optional + * @param boolean $args["executed"] + * - optional + * @param int $args["$assignedto"] + * - optional + * @param string $args["executestatus"] + * - optional + * @return mixed $resultInfo + */ +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 61579; + +// optional +// $args["testcaseid"] - optional +// $args["buildid"] - optional +// $args["keywordid"] - optional +// $args["executed"] - optional +// $args["$assignedto"] - optional +// $args["executestatus"] - optional + +$debug = false; +echo $unitTestDescription; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +new dBug($args); +if (! $client->query('tl.getTestCasesForTestPlan', $args)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + $response = null; +} else { + $response = $client->getResponse(); +} + +echo "
    Result was: "; +// Typically you'd want to validate the result here and probably do something more useful with it +// print_r($response); +new dBug($response); +echo "
    "; + +// 20080518 - franciscom +$unitTestDescription = "Test - createTestProject"; +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testprojectname"] = 'API TestProject'; + +$debug = true; +echo $unitTestDescription; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +new dBug($args); +if (! $client->query('tl.createTestProject', $args)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + $response = null; +} else { + $response = $client->getResponse(); +} + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// ---------------------------------------------------------------------- +$method = 'getTestCaseCustomFieldDesignValue'; +$client_query = 'tl.' . $method; +$unitTestDescription = "Test - $method"; + +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testcaseexternalid"] = 'ESP-1'; +$args["customfieldname"] = 'SSCRIPT_CF1'; + +$debug = true; + +echo $unitTestDescription; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +new dBug($args); +if (! $client->query($client_query, $args)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + $response = null; +} else { + $response = $client->getResponse(); +} + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +// ------------------------------------------------------------------------------------- +$unitTestDescription = "Test - getTestSuitesForTestPlan"; +$args = array(); +$args["devKey"] = DEV_KEY; +$args["testplanid"] = 61579; + +$debug = true; +echo $unitTestDescription; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +new dBug($args); +if (! $client->query('tl.getTestSuitesForTestPlan', $args)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + $response = null; +} else { + $response = $client->getResponse(); +} + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSample20160730.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSample20160730.php index dc57f965d6..e1155adfb1 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSample20160730.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSample20160730.php @@ -1,62 +1,72 @@ -tlProjectID = -1; -$env->tlSuiteID = -1; -$env->tlPlanID = -1; -$env->tlTestCaseVersion = 1; -// ---------------------------------------------- :) - -$doSetUp = false; -$phpSteps = array(); - -if( $doSetUp ) -{ - $phpSteps[] = array('f2i' => 'stepDeleteTestProject.php', 'id' => 'tlProjectID'); - $phpSteps[] = array('f2i' => 'stepCreateTestProject.php', 'id' => 'tlProjectID'); - $phpSteps[] = array('f2i' => 'stepCreateTestSuite.php', 'id' => 'tlSuiteID'); - $phpSteps[] = array('f2i' => 'stepCreateTestCase.php', 'id' => 'tlJolt'); - $phpSteps[] = array('f2i' => 'stepCreateTestPlan.php', 'id' => 'tlPlanID'); -} -else -{ - // - $env->tlProjectID = 1046; - $env->tlPlanID = 1051; - $env->tlTestCaseVersion = 2; - $tlOverWriteOnAdd = 1; -} - -$phpSteps[] = array('f2i' => 'stepAddTestCaseToTestPlan.php', 'id' => 'tlJolt'); - -foreach( $phpSteps as $m2i) -{ - try - { - $tlIDName = $m2i['id']; - require_once $m2i['f2i']; - } - catch (Exception $e) - { - echo $e->getMessage(); - } -} \ No newline at end of file +tlProjectID = - 1; +$env->tlSuiteID = - 1; +$env->tlPlanID = - 1; +$env->tlTestCaseVersion = 1; +// ---------------------------------------------- :) + +$doSetUp = false; +$phpSteps = array(); + +if ($doSetUp) { + $phpSteps[] = array( + 'f2i' => 'stepDeleteTestProject.php', + 'id' => 'tlProjectID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestProject.php', + 'id' => 'tlProjectID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestSuite.php', + 'id' => 'tlSuiteID' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestCase.php', + 'id' => 'tlJolt' + ); + $phpSteps[] = array( + 'f2i' => 'stepCreateTestPlan.php', + 'id' => 'tlPlanID' + ); +} else { + // + $env->tlProjectID = 1046; + $env->tlPlanID = 1051; + $env->tlTestCaseVersion = 2; + $tlOverWriteOnAdd = 1; +} + +$phpSteps[] = array( + 'f2i' => 'stepAddTestCaseToTestPlan.php', + 'id' => 'tlJolt' +); + +foreach ($phpSteps as $m2i) { + try { + $tlIDName = $m2i['id']; + require_once $m2i['f2i']; + } catch (Exception $e) { + echo $e->getMessage(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseExecutionType.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseExecutionType.php index bf55e04e03..f95cbe347a 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseExecutionType.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseExecutionType.php @@ -1,55 +1,28 @@ -debug=true; -runTest($client,$method,$args); - -/* -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=32989; -$args["testcaseexternalid"]='APF-1'; -$args["version"]=1; -$args["executiontype"]=2; -$client = new IXR_Client($server_url); -$client->debug=true; -runTest($client,$method,$args); -*/ - -/* -$args=array(); -$args["devKey"]=DEV_KEY; -$args["testprojectid"]=32989; -$args["testcaseexternalid"]='APF-1'; -$args["version"]=1; -$args["executiontype"]=10; -$client = new IXR_Client($server_url); -$client->debug=true; -runTest($client,$method,$args); -*/ -?> \ No newline at end of file +debug = true; +runTest($client, $method, $args); + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseTestSuite.php index 013fe2baf6..0d45763333 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSetTestCaseTestSuite.php @@ -1,32 +1,30 @@ -debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); -die(); \ No newline at end of file +debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); +die(); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientSetupTicket-5451.php b/lib/api/xmlrpc/v1/sample_clients/php/clientSetupTicket-5451.php index df89e25bc6..31a59ff8a3 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientSetupTicket-5451.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientSetupTicket-5451.php @@ -1,130 +1,127 @@ -debug = false; -$cfg->devKey = 'Spock (The Tholian Web)'; -$cfg->prefix = 'AXE'; - -$args4call = array(); - -// $server_url is GLOBAL created on some previous include -$op = createTestProject($server_url,$cfg,$args4call); -$op = createTestPlan($server_url,$cfg,$args4call); -if( isset($op[0]['status']) && $op[0]['status']) -{ - $tplan_id = $op[0]['id']; - $op = createBuild($server_url,$cfg,$args4call,$tplan_id); -} - - -$platformSet = array(); -$dummy = new stdClass(); -$dummy->name = 'Ferrari'; -$dummy->notes = 'Italy'; -$platformSet[$dummy->name] = $dummy; - -$dummy = new stdClass(); -$dummy->name = 'Porsche'; -$dummy->notes = 'Germany'; -$platformSet[$dummy->name] = $dummy; - -$dummy = new stdClass(); -$dummy->name = 'Renault'; -$dummy->notes = 'France'; -$platformSet[$dummy->name] = $dummy; - -foreach($platformSet as $name => &$item) -{ - $op = createPlatform($server_url,$cfg,$args4call,$item); - $item->id = $op['id']; -} - - - - -// ------------------------------------------------------------------------------------------------ -// Support functions -// ------------------------------------------------------------------------------------------------ -function createTestProject($server_url,$cfg,&$args4call) -{ - $method = 'createTestProject'; - $args4call[$method] = array("devKey" => $cfg->devKey, - "testcaseprefix" => $cfg->prefix, - "testprojectname" => "TICKET 5451", - "notes" => - "To test TICKET 5451: Test Plan WITH 2 or more PLATFORMS - " . - "Test Cases Without Tester Assignment provide wrong result"); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - - -function createTestPlan($server_url,$cfg,&$args4call) -{ - $method = 'createTestPlan'; - $args4call[$method] = array("devKey" => $cfg->devKey, - "testprojectname" => $args4call['createTestProject']["testprojectname"], - "testplanname" => "TPLAN A - 3 Platforms", - "notes" => "Test plan used to test report 'Test cases without tester assignment' "); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - - -function createBuild($server_url,$cfg,&$args4call,$tplan_id) -{ - - $method = 'createBuild'; - $args4call[$method] = array("devKey" => $cfg->devKey, - "buildname" => '1.0', - "testplanid" => $tplan_id, - "buildnote" => "Build used to test issue 5451"); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - -function createPlatform($server_url,$cfg,&$args4call,$item) -{ - $method = 'createPlatform'; - $args4call[$method] = array("devKey" => $cfg->devKey, - "platformname" => $item->name, - "notes" => $item->notes, - "testprojectname" => $args4call['createTestProject']["testprojectname"]); - - $client = new IXR_Client($server_url); - $client->debug = $cfg->debug; - return runTest($client,$method,$args4call[$method]); -} - - -?> \ No newline at end of file +debug = false; +$cfg->devKey = 'Spock (The Tholian Web)'; +$cfg->prefix = 'AXE'; + +$args4call = array(); + +// $server_url is GLOBAL created on some previous include +$op = createTestProject($server_url, $cfg, $args4call); +$op = createTestPlan($server_url, $cfg, $args4call); +if (isset($op[0]['status']) && $op[0]['status']) { + $tplan_id = $op[0]['id']; + $op = createBuild($server_url, $cfg, $args4call, $tplan_id); +} + +$platformSet = array(); +$dummy = new stdClass(); +$dummy->name = 'Ferrari'; +$dummy->notes = 'Italy'; +$platformSet[$dummy->name] = $dummy; + +$dummy = new stdClass(); +$dummy->name = 'Porsche'; +$dummy->notes = 'Germany'; +$platformSet[$dummy->name] = $dummy; + +$dummy = new stdClass(); +$dummy->name = 'Renault'; +$dummy->notes = 'France'; +$platformSet[$dummy->name] = $dummy; + +foreach ($platformSet as &$item) { + $op = createPlatform($server_url, $cfg, $args4call, $item); + $item->id = $op['id']; +} + +// ------------------------------------------------------------------------------------------------ +// Support functions +// ------------------------------------------------------------------------------------------------ +function createTestProject($server_url, $cfg, &$args4call) +{ + $method = 'createTestProject'; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "testcaseprefix" => $cfg->prefix, + "testprojectname" => "TICKET 5451", + "notes" => "To test TICKET 5451: Test Plan WITH 2 or more PLATFORMS - " . + "Test Cases Without Tester Assignment provide wrong result" + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +function createTestPlan($server_url, $cfg, &$args4call) +{ + $method = 'createTestPlan'; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "testprojectname" => $args4call['createTestProject']["testprojectname"], + "testplanname" => "TPLAN A - 3 Platforms", + "notes" => "Test plan used to test report 'Test cases without tester assignment' " + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +function createBuild($server_url, $cfg, &$args4call, $tplan_id) +{ + $method = 'createBuild'; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "buildname" => '1.0', + "testplanid" => $tplan_id, + "buildnote" => "Build used to test issue 5451" + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +function createPlatform($server_url, $cfg, &$args4call, $item) +{ + $method = 'createPlatform'; + $args4call[$method] = array( + "devKey" => $cfg->devKey, + "platformname" => $item->name, + "notes" => $item->notes, + "testprojectname" => $args4call['createTestProject']["testprojectname"] + ); + + $client = new IXR_Client($server_url); + $client->debug = $cfg->debug; + return runTest($client, $method, $args4call[$method]); +} + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientTestExecStepsIncremental.php b/lib/api/xmlrpc/v1/sample_clients/php/clientTestExecStepsIncremental.php index b2b5d6b1f5..0901a7dd97 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientTestExecStepsIncremental.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientTestExecStepsIncremental.php @@ -1,161 +1,146 @@ -testplanid=434; -// $context->buildid=1; -$context->buildname='1.0'; -// $context->platformname=null; -$context->testcaseexternalid='ZS-1'; -// $context->testcaseid=null; - -$exec = new stdClass(); -$exec->status = $tcaseStatusCode['blocked']; -$exec->notes="Call using all EXTERNAL ID"; -//$exec->customfields = null; -//$exec->bugid = null; -//$exec->user = 'QQ'; -$exec->overwrite=true; - -$exec->steps=array( array('step_number' => 1, - 'result' => 'f', 'notes' => 'no') ); - - -$debug=false; -echo '
    ' . $unitTestDescription . ''; -echo '
    '; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - -$exec->steps=array( array('step_number' => 2, - 'result' => 'p', 'notes' => 'no for 2') ); - -$debug=false; -echo '
    ' . $unitTestDescription . ''; -echo '
    '; -$response = executeTestCase($server_url,$context,$exec,$debug); - -echo "
    Result was: "; -new dBug($response); -echo "
    "; - - - -/* - function: - - args: - - returns: - -*/ -function executeTestCase($server_url,$context,$exec,$debug=false) -{ - - echo '
    Context is:'; - new dBug($context); - - - echo '
    Execution data is:'; - new dBug($exec); - - echo '
    '; - - - $client = new IXR_Client($server_url); - $client->debug=$debug; - - $data = array(); - $data["devKey"] = '3c41cb6d3c39f263b6bade693f8f7fa7'; - $data["status"] = $exec->status; - - if( property_exists($exec, 'steps') && !is_null($exec->steps) ) - { - $data["steps"] = $exec->steps; - } - - if( property_exists($exec, 'user') && !is_null($exec->user) ) - { - $data["user"]=$exec->user; - } - - if( property_exists($exec, 'notes') && !is_null($exec->notes) ) - { - $data["notes"] = $exec->notes; - } - - if( property_exists($exec, 'bugid') && !is_null($exec->bugid) ) - { - $data["bugid"] = $exec->bugid; - } - - if( property_exists($exec, 'overwrite') && !is_null($exec->overwrite) ) - { - $data["overwrite"]=$exec->overwrite; - } - - if( property_exists($exec, 'customfields') && !is_null($exec->customfields) ) - { - $data["customfields"]=$customfields; - } - - - $data["testplanid"] = $context->testplanid; - if( property_exists($context, 'testcaseid') && !is_null($context->testcaseid) ) - { - $data["testcaseid"] = $context->testcaseid; - } - else if( property_exists($context, 'testcaseexternalid') && !is_null($context->testcaseexternalid) ) - { - $data["testcaseexternalid"] = $context->testcaseexternalid; - } - - if( property_exists($context, 'buildid') && !is_null($context->buildid) ) - { - $data["buildid"] = $context->buildid; - } - else if ( property_exists($context, 'buildname') && !is_null($context->buildname) ) - { - $data["buildname"] = $context->buildname; - } - - if( property_exists($context, 'platformname') && !is_null($context->platformname) ) - { - $data["platformname"]=$context->platformname; - } - - - echo '
    Method will be called with following data:'; - new dBug($data); - - if(!$client->query('tl.reportTCResult', $data)) { - echo "something went wrong - " . $client->getErrorCode() . " - " . $client->getErrorMessage(); - } - else { - return $client->getResponse(); - } -} \ No newline at end of file +testplanid = 434; +$context->buildname = '1.0'; +$context->testcaseexternalid = 'ZS-1'; + +$exec = new stdClass(); +$exec->status = $tcaseStatusCode['blocked']; +$exec->notes = "Call using all EXTERNAL ID"; +$exec->overwrite = true; + +$exec->steps = array( + array( + 'step_number' => 1, + 'result' => 'f', + 'notes' => 'no' + ) +); + +$debug = false; +echo '
    ' . $unitTestDescription . ''; +echo '
    '; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +$exec->steps = array( + array( + 'step_number' => 2, + 'result' => 'p', + 'notes' => 'no for 2' + ) +); + +$debug = false; +echo '
    ' . $unitTestDescription . ''; +echo '
    '; +$response = executeTestCase($server_url, $context, $exec, $debug); + +echo "
    Result was: "; +new dBug($response); +echo "
    "; + +/* + * function: + * + * args: + * + * returns: + * + */ +function executeTestCase($server_url, $context, $exec, $debug = false) +{ + echo '
    Context is:'; + new dBug($context); + + echo '
    Execution data is:'; + new dBug($exec); + + echo '
    '; + + $client = new IXR_Client($server_url); + $client->debug = $debug; + + $data = array(); + $data["devKey"] = '3c41cb6d3c39f263b6bade693f8f7fa7'; + $data["status"] = $exec->status; + + if (property_exists($exec, 'steps') && ! is_null($exec->steps)) { + $data["steps"] = $exec->steps; + } + + if (property_exists($exec, 'user') && ! is_null($exec->user)) { + $data["user"] = $exec->user; + } + + if (property_exists($exec, 'notes') && ! is_null($exec->notes)) { + $data["notes"] = $exec->notes; + } + + if (property_exists($exec, 'bugid') && ! is_null($exec->bugid)) { + $data["bugid"] = $exec->bugid; + } + + if (property_exists($exec, 'overwrite') && ! is_null($exec->overwrite)) { + $data["overwrite"] = $exec->overwrite; + } + + if (property_exists($exec, 'customfields') && ! is_null($exec->customfields)) { + $data["customfields"] = $customfields; + } + + $data["testplanid"] = $context->testplanid; + if (property_exists($context, 'testcaseid') && + ! is_null($context->testcaseid)) { + $data["testcaseid"] = $context->testcaseid; + } elseif (property_exists($context, 'testcaseexternalid') && + ! is_null($context->testcaseexternalid)) { + $data["testcaseexternalid"] = $context->testcaseexternalid; + } + + if (property_exists($context, 'buildid') && ! is_null($context->buildid)) { + $data["buildid"] = $context->buildid; + } elseif (property_exists($context, 'buildname') && + ! is_null($context->buildname)) { + $data["buildname"] = $context->buildname; + } + + if (property_exists($context, 'platformname') && + ! is_null($context->platformname)) { + $data["platformname"] = $context->platformname; + } + + echo '
    Method will be called with following data:'; + new dBug($data); + + if (! $client->query('tl.reportTCResult', $data)) { + echo "something went wrong - " . $client->getErrorCode() . " - " . + $client->getErrorMessage(); + } else { + return $client->getResponse(); + } +} diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientTestLinkVersion.php b/lib/api/xmlrpc/v1/sample_clients/php/clientTestLinkVersion.php index caa0bd26c7..bd06619c2a 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientTestLinkVersion.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientTestLinkVersion.php @@ -1,25 +1,25 @@ -debug=$debug; -$answer = runTest($client,$method,$args); \ No newline at end of file +debug = $debug; +$answer = runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientTestSuiteTestCaseStepsManagement.php b/lib/api/xmlrpc/v1/sample_clients/php/clientTestSuiteTestCaseStepsManagement.php index 88feefe74f..09f57e08db 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientTestSuiteTestCaseStepsManagement.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientTestSuiteTestCaseStepsManagement.php @@ -1,169 +1,155 @@ -tcasePrefix = 'MKO'; -$cfg->tcaseVersionNumber = 1; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -$tcCounter = 0; - -$commonArgs = array(); -$commonArgs["devKey"]=DEV_KEY; -$commonArgs["testcaseexternalid"]=$cfg->tcasePrefix . '-1'; - -// Sample data -$qtySteps = 6; -$fakeSteps = null; -for($idx=1; $idx < $qtySteps; $idx++) -{ - $action = 'FULL STOP NOW!!!! - intensity='; - $expected_results = '%s Red Lights ON'; - if( $idx & 1 ) - { - $action = 'Start Server with power='; - $expected_results = 'GREEN Lantern %s ON'; - } - $expected_results = sprintf($expected_results,$idx); - $fakeSteps[] = array('step_number' => $idx, 'actions' => $action . $idx, - 'expected_results' => $expected_results); -} -// --------------------------------------------------------------------------------- - - -// --------------------------------------------------------------------------------- -// Get existent Test Case -$additionalInfo=''; -$tcCounter++; -$args = $commonArgs; -$rr = runTest($client,'getTestCase',$args,$tcCounter); -$ret = $rr[0]; -if(isset($ret['code'])) -{ - new dBug($ret); - exit(); -} - -// Build data to Delete ALL steps -$originalSteps = null; -if( !is_null($ret) && isset($ret['steps']) && !is_null($ret['steps']) && $ret['steps'] != '') -{ - $originalSteps = (array)$ret['steps']; -} - -if( ($loop2do = count($originalSteps)) > 0 ) -{ - $runDelete = true; - $allSteps = null; - for($idx=0; $idx < $loop2do; $idx++) - { - $allSteps[] = $originalSteps[$idx]['step_number']; - } - - // Now request delete - $args=$commonArgs; - $args["version"]=$cfg->tcaseVersionNumber; - $args["steps"] = $allSteps; - $rr = runTest($client,'deleteTestCaseSteps',$args,$tcCounter); - $ret = isset($rr[0]) ? $rr[0] : $rr; - if(isset($ret['code'])) - { - new dBug($ret); - exit(); - } -} - -// Now reinsert original content if any -$steps2insert = !is_null($originalSteps) && count((array)$originalSteps >0) ? $originalSteps : $fakeSteps; -$args=$commonArgs; -$args["version"]=$cfg->tcaseVersionNumber; -$args["action"] = 'create'; -$args['steps'] = $steps2insert; - -// new dBug($steps2insert); -$rr = runTest($client,'createTestCaseSteps',$args,$tcCounter); -$ret = isset($rr[0]) ? $rr[0] : $rr; -if(isset($ret['code'])) -{ - new dBug($ret); - exit(); -} -// ---------------------------------------------------------------------------------------------------- - -// Now Create a Fake Step to PUSH -$alienStartPos = intval($qtySteps/3); -$aliens[] = array('step_number' => $alienStartPos, 'actions' => 'ALIEN ' . $action, - 'expected_results' => 'Ripley Will BE INFECTED'); - -$args=$commonArgs; -$args["version"]=$cfg->tcaseVersionNumber; -$args["action"] = 'push'; -$args['steps'] = $aliens; -$rr = runTest($client,'createTestCaseSteps',$args,$tcCounter); -$ret = isset($rr[0]) ? $rr[0] : $rr; -if(isset($ret['code'])) -{ - new dBug($ret); - exit(); -} -// ---------------------------------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------------------------------- -// Now TRY TO Create EXISTENT STEP -$alienStartPos = intval($qtySteps/3); -$aliens[] = array('step_number' => $alienStartPos, - 'actions' => 'If you see this content => Houston we have a problem' . $action, - 'expected_results' => 'Ripley Will BE INFECTED'); - -$args=$commonArgs; -$args["version"]=$cfg->tcaseVersionNumber; -$args["action"] = 'create'; -$args['steps'] = $aliens; -$rr = runTest($client,'createTestCaseSteps',$args,$tcCounter); -$ret = isset($rr[0]) ? $rr[0] : $rr; -if(isset($ret['code'])) -{ - new dBug($ret); - exit(); -} -// ---------------------------------------------------------------------------------------------------- - - -// ---------------------------------------------------------------------------------------------------- -// Now TRY TO UPDATE a NON EXISTENT STEP -$hint = 'You have requested UPDATE of NON EXISTENT Step => we will CREATE it'; -$alienStartPos = 1000; -$aliens[] = array('step_number' => $alienStartPos, - 'actions' => $hint . $action, - 'expected_results' => 'Ripley Will BE INFECTED'); - -$args=$commonArgs; -$args["version"]=$cfg->tcaseVersionNumber; -$args["action"] = 'update'; -$args['steps'] = $aliens; -$rr = runTest($client,'createTestCaseSteps',$args,$tcCounter); -$ret = isset($rr[0]) ? $rr[0] : $rr; -if(isset($ret['code'])) -{ - new dBug($ret); - exit(); -} -// ---------------------------------------------------------------------------------------------------- - - - -?> \ No newline at end of file +tcasePrefix = 'MKO'; +$cfg->tcaseVersionNumber = 1; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +$tcCounter = 0; + +$commonArgs = array(); +$commonArgs["devKey"] = DEV_KEY; +$commonArgs["testcaseexternalid"] = $cfg->tcasePrefix . '-1'; + +// Sample data +$qtySteps = 6; +$fakeSteps = null; +for ($idx = 1; $idx < $qtySteps; $idx ++) { + $action = 'FULL STOP NOW!!!! - intensity='; + $expected_results = '%s Red Lights ON'; + if ($idx & 1) { + $action = 'Start Server with power='; + $expected_results = 'GREEN Lantern %s ON'; + } + $expected_results = sprintf($expected_results, $idx); + $fakeSteps[] = array( + 'step_number' => $idx, + 'actions' => $action . $idx, + 'expected_results' => $expected_results + ); +} + +// Get existent Test Case +$additionalInfo = ''; +$tcCounter ++; +$args = $commonArgs; +$rr = runTest($client, 'getTestCase', $args, $tcCounter); +$ret = $rr[0]; +if (isset($ret['code'])) { + new dBug($ret); + exit(); +} + +// Build data to Delete ALL steps +$originalSteps = null; +if (! is_null($ret) && isset($ret['steps']) && ! is_null($ret['steps']) && + $ret['steps'] != '') { + $originalSteps = (array) $ret['steps']; +} + +if (($loop2do = count($originalSteps)) > 0) { + $runDelete = true; + $allSteps = null; + for ($idx = 0; $idx < $loop2do; $idx ++) { + $allSteps[] = $originalSteps[$idx]['step_number']; + } + + // Now request delete + $args = $commonArgs; + $args["version"] = $cfg->tcaseVersionNumber; + $args["steps"] = $allSteps; + $rr = runTest($client, 'deleteTestCaseSteps', $args, $tcCounter); + $ret = isset($rr[0]) ? $rr[0] : $rr; + if (isset($ret['code'])) { + new dBug($ret); + exit(); + } +} + +// Now reinsert original content if any +$steps2insert = ! is_null($originalSteps) && count((array) $originalSteps > 0) ? $originalSteps : $fakeSteps; +$args = $commonArgs; +$args["version"] = $cfg->tcaseVersionNumber; +$args["action"] = 'create'; +$args['steps'] = $steps2insert; + +$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter); +$ret = isset($rr[0]) ? $rr[0] : $rr; +if (isset($ret['code'])) { + new dBug($ret); + exit(); +} + +// Now Create a Fake Step to PUSH +$alienStartPos = intval($qtySteps / 3); +$aliens[] = array( + 'step_number' => $alienStartPos, + 'actions' => 'ALIEN ' . $action, + 'expected_results' => 'Ripley Will BE INFECTED' +); + +$args = $commonArgs; +$args["version"] = $cfg->tcaseVersionNumber; +$args["action"] = 'push'; +$args['steps'] = $aliens; +$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter); +$ret = isset($rr[0]) ? $rr[0] : $rr; +if (isset($ret['code'])) { + new dBug($ret); + exit(); +} + +// Now TRY TO Create EXISTENT STEP +$alienStartPos = intval($qtySteps / 3); +$aliens[] = array( + 'step_number' => $alienStartPos, + 'actions' => 'If you see this content => Houston we have a problem' . $action, + 'expected_results' => 'Ripley Will BE INFECTED' +); + +$args = $commonArgs; +$args["version"] = $cfg->tcaseVersionNumber; +$args["action"] = 'create'; +$args['steps'] = $aliens; +$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter); +$ret = isset($rr[0]) ? $rr[0] : $rr; +if (isset($ret['code'])) { + new dBug($ret); + exit(); +} + +// Now TRY TO UPDATE a NON EXISTENT STEP +$hint = 'You have requested UPDATE of NON EXISTENT Step => we will CREATE it'; +$alienStartPos = 1000; +$aliens[] = array( + 'step_number' => $alienStartPos, + 'actions' => $hint . $action, + 'expected_results' => 'Ripley Will BE INFECTED' +); + +$args = $commonArgs; +$args["version"] = $cfg->tcaseVersionNumber; +$args["action"] = 'update'; +$args['steps'] = $aliens; +$rr = runTest($client, 'createTestCaseSteps', $args, $tcCounter); +$ret = isset($rr[0]) ? $rr[0] : $rr; +if (isset($ret['code'])) { + new dBug($ret); + exit(); +} + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUnassignTestCaseExecutionTask.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUnassignTestCaseExecutionTask.php index 719f5e858f..709caf4134 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUnassignTestCaseExecutionTask.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUnassignTestCaseExecutionTask.php @@ -1,194 +1,156 @@ -debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); +new dBug($answer); +die(); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - All OK"; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 278; +$args["testcaseexternalid"] = 'APX-1'; +$args["platformname"] = 'Informix'; +$args["buildname"] = '2.0'; +$args["user"] = 'giskard'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Plan ID"; + +$args = array(); +$args["devKey"] = $devKey; +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Test Case "; + +$args = array(); +$args["devKey"] = $devKey; +$args["testplanid"] = 9; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Missing argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 900000; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-WRONG-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); + +$utc ++; +$unitTestDescription = "Test #{$utc} - {$method} - Wrong argument - Build Name "; + +$args = array(); +$args["devKey"] = $devKey; + +$args["testplanid"] = 9; +$args["testcaseexternalid"] = 'GK-1'; +$args["buildname"] = 'WRONG - 1.0'; +$args["platformname"] = 'P2'; + +$debug = true; +$client = new IXR_Client($server_url); +$client->debug = $debug; + +echo $unitTestDescription; +$answer = runTest($client, $method, $args); -$method="unassignTestCaseExecutionTask"; -$utc = 0; -$devKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : 'admin'; - -// --------------------------------------------------------------------------------------- -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - All OK"; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 2808; -$args["testcaseexternalid"] = 'DSM-1'; -// $args["platformname"] = 'Apache Derby'; -// $args["platformname"] = 'Informix'; -$args["buildname"] = '1.0'; -$args["action"] = 'unassignAll'; - -//$args["user"] = 'David.Gilmour'; -// $args["user"] = 'Nick.Mason'; - - -/* -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 278; -$args["testcaseexternalid"] = 'APX-1'; -$args["platformname"] = 'Informix'; -$args["buildname"] = '2.0'; -$args["user"] = 'giskard'; -*/ - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -new dBug($answer); -die(); - -// --------------------------------------------------------------------------------------- - -// --------------------------------------------------------------------------------------- -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - All OK"; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 278; -$args["testcaseexternalid"] = 'APX-1'; -$args["platformname"] = 'Informix'; -$args["buildname"] = '2.0'; -$args["user"] = 'giskard'; - - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); - -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Plan ID"; - -$args=array(); -$args["devKey"] = $devKey; -// $args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Test Case "; - -$args=array(); -$args["devKey"] = $devKey; -$args["testplanid"] = 9; -// $args["testcaseexternalid"] = 'GK-1'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Missing argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -// $args["buildname"] = '1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Plan ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 900000; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Test Case External ID "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-WRONG-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- - -$utc++; -$unitTestDescription="Test #{$utc} - {$method} - Wrong argument - Build Name "; - -$args=array(); -$args["devKey"] = $devKey; - -$args["testplanid"] = 9; -$args["testcaseexternalid"] = 'GK-1'; -$args["buildname"] = 'WRONG - 1.0'; -$args["platformname"] = 'P2'; - - -$debug=true; -$client = new IXR_Client($server_url); -$client->debug=$debug; - -echo $unitTestDescription; -$answer = runTest($client,$method,$args); -// --------------------------------------------------------------------------------------- diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCase.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCase.php index 6fa2bb3389..e94c79d7f8 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCase.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCase.php @@ -1,154 +1,155 @@ -debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - - - -// Update Only Summary + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-3'; -$args["version"]=1; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - -// Trying to Update AN INEXISTENT Version + Only Summary + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-3'; -$args["version"]=1222; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - -// Update Summary + duration + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-3'; -$args["version"]=1; -$args["estimatedexecduration"] = 12.5; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - - -// Update Summary + duration + importance + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-3'; -$args["version"]=1; -$args["estimatedexecduration"] = 12.5; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; -$args["importance"] = 3; - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - - -// Update creating steps + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-5'; -$args["version"]=1; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); - -// Update creating steps + Setting updater -$args=array(); -$args["devKey"]='21232f297a57a5a743894a0e4a801fc3'; -$args["testcaseexternalid"]='IU-5844-5'; -$args["version"]=1; -$args["user"]='Iasmin'; -$args["summary"]='Updated via XML-RPC API - by ' . $args["user"]; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server Upd', 'expected_results' => 'green light'); -$args["steps"][]=array('step_number' => 10, 'actions' => 'Start Server NEW', 'expected_results' => 'green light'); - - -$client = new IXR_Client($server_url); -$client->debug=true; - -$tcCounter++; -runTest($client,$method,$args,$tcCounter); +debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Update Only Summary + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-3'; +$args["version"] = 1; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Trying to Update AN INEXISTENT Version + Only Summary + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-3'; +$args["version"] = 1222; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Update Summary + duration + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-3'; +$args["version"] = 1; +$args["estimatedexecduration"] = 12.5; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Update Summary + duration + importance + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-3'; +$args["version"] = 1; +$args["estimatedexecduration"] = 12.5; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; +$args["importance"] = 3; + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Update creating steps + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-5'; +$args["version"] = 1; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); + +// Update creating steps + Setting updater +$args = array(); +$args["devKey"] = '21232f297a57a5a743894a0e4a801fc3'; +$args["testcaseexternalid"] = 'IU-5844-5'; +$args["version"] = 1; +$args["user"] = 'Iasmin'; +$args["summary"] = 'Updated via XML-RPC API - by ' . $args["user"]; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server Upd', + 'expected_results' => 'green light' +); +$args["steps"][] = array( + 'step_number' => 10, + 'actions' => 'Start Server NEW', + 'expected_results' => 'green light' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +$tcCounter ++; +runTest($client, $method, $args, $tcCounter); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCaseCustomFieldDesignValue.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCaseCustomFieldDesignValue.php index 95b3849e53..85432e7272 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCaseCustomFieldDesignValue.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestCaseCustomFieldDesignValue.php @@ -1,47 +1,34 @@ - 'COMODORE64','CF_DT' => mktime(10,10,0,7,29,2009)); -// $args["customfields"] = array('TCSTRING' => 'From DUCATI to YAMAHA'); - -$args["customfields"] = - array('L2D' => - 'http://localhost/development/github/testlink-code/' . - 'linkto.php?tprojectPrefix=HA&item=testcase&id=HA-1 '); - - -$client = new IXR_Client($server_url); -$client->debug=true; - -/* -for($idx=1 ; $idx <= $tcaseQty; $idx++) -{ - runTest($client,$method,$args); -} -*/ -runTest($client,$method,$args); + 'http://localhost/development/github/testlink-code/' . + 'linkto.php?tprojectPrefix=HA&item=testcase&id=HA-1 ' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuite.php index 02dee8e5ad..07852f4012 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuite.php @@ -1,115 +1,102 @@ - default behaviour BLOCK => will not be created -// use name of existent Test Suite in parentid, request renaming -// - -$method='updateTestSuite'; - - -$unitTestDescription="Test - $method"; -$test_num = 0; -$tlDevKey = '985978c915f50e47a4b1a54a943d1b76'; -$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; - - -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project PREFIX - Will Change ORDER'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["prefix"]='ZTZ'; -$args["testsuiteid"]=1072; -$args["order"]=12000; -// $args["testsuitename"]='TS API 200.0'; -// $args["details"]='MOMO This has been created by XMLRPC API Call'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); - - -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project PREFIX - Will UPDATE Name CREATING DUP'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["prefix"]='ZTZ'; -$args["testsuiteid"]=1081; -$args["testsuitename"]='TS API 200.0'; -$args["details"]='MOMO This has been created by XMLRPC API Call'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); - - -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project PREFIX - Will Update Name QUIET'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["prefix"]='ZTZ'; -$args["testsuiteid"]=1080; -$args["testsuitename"]='TS API SUPER 200.0'; - -// $args["details"]='MOMO This has been created by XMLRPC API Call'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); - - - -// ------------------------------------------------------------- -$test_num++; -$additionalInfo = 'Using Test Project PREFIX - Will Update Details'; -$args=array(); -$args["devKey"]=$tlDevKey; - -$args["prefix"]='ZTZ'; -$args["testsuiteid"]=1080; - -// $args["testsuitename"]='TS API 200.0'; - -$args["details"]='MOMO This has been created by XMLRPC API Call'; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; -runTest($client,$method,$args,$test_num); + default behaviour BLOCK => will not be created +// use name of existent Test Suite in parentid, request renaming +// + +$method = 'updateTestSuite'; + +$unitTestDescription = "Test - $method"; +$test_num = 0; +$tlDevKey = '985978c915f50e47a4b1a54a943d1b76'; +$tlDevKey = isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; + +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project PREFIX - Will Change ORDER'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["prefix"] = 'ZTZ'; +$args["testsuiteid"] = 1072; +$args["order"] = 12000; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); + +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project PREFIX - Will UPDATE Name CREATING DUP'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["prefix"] = 'ZTZ'; +$args["testsuiteid"] = 1081; +$args["testsuitename"] = 'TS API 200.0'; +$args["details"] = 'MOMO This has been created by XMLRPC API Call'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); + +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project PREFIX - Will Update Name QUIET'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["prefix"] = 'ZTZ'; +$args["testsuiteid"] = 1080; +$args["testsuitename"] = 'TS API SUPER 200.0'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); + +// ------------------------------------------------------------- +$test_num ++; +$additionalInfo = 'Using Test Project PREFIX - Will Update Details'; +$args = array(); +$args["devKey"] = $tlDevKey; + +$args["prefix"] = 'ZTZ'; +$args["testsuiteid"] = 1080; + +$args["details"] = 'MOMO This has been created by XMLRPC API Call'; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; +runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuiteCustomFieldDesignValue.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuiteCustomFieldDesignValue.php index 78aba92e80..848f63c80f 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuiteCustomFieldDesignValue.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUpdateTestSuiteCustomFieldDesignValue.php @@ -1,53 +1,58 @@ -Testing Method: ' . $method . ''; - -$args=array(); -$args["devKey"] = 'admin'; -$args["testprojectid"]=279340; -$args["testsuiteid"]=279341; -$args["customfields"] = array('TCSTRING' => 'From DUCATI to YAMAHA'); - -$client = new IXR_Client($server_url); -$client->debug=true; - -runTest($client,$method,$args); - -// -$args=array(); -$args["devKey"] = 'admin'; -$args["testprojectid"]=279340; -$args["testsuiteid"]=279341; -$args["customfields"] = array('CF_MOTO' => 'From DUCATI to YAMAHA'); - -$client = new IXR_Client($server_url); -$client->debug=true; - -runTest($client,$method,$args); - -// -$args=array(); -$args["devKey"] = 'admin'; -$args["testprojectid"]=279340; -$args["testsuiteid"]=279341; -$args["customfields"] = array('CF_MOTO' => 'From DUCATI to YAMAHA'); - -$client = new IXR_Client($server_url); -$client->debug=true; - -runTest($client,$method,$args); +Testing Method: ' . $method . ''; + +$args = array(); +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279340; +$args["testsuiteid"] = 279341; +$args["customfields"] = array( + 'TCSTRING' => 'From DUCATI to YAMAHA' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +runTest($client, $method, $args); + +// +$args = array(); +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279340; +$args["testsuiteid"] = 279341; +$args["customfields"] = array( + 'CF_MOTO' => 'From DUCATI to YAMAHA' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +runTest($client, $method, $args); + +// +$args = array(); +$args["devKey"] = 'admin'; +$args["testprojectid"] = 279340; +$args["testsuiteid"] = 279341; +$args["customfields"] = array( + 'CF_MOTO' => 'From DUCATI to YAMAHA' +); + +$client = new IXR_Client($server_url); +$client->debug = true; + +runTest($client, $method, $args); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/clientUploadTestCaseAttachment.php b/lib/api/xmlrpc/v1/sample_clients/php/clientUploadTestCaseAttachment.php index 26bda95c44..8421bd8b01 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/clientUploadTestCaseAttachment.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/clientUploadTestCaseAttachment.php @@ -1,63 +1,62 @@ -debug=$debug; - -runTest($client,$method,$args,$test_num); -// --------------------------------------------------------------------------------- - -$test_num=2; -$unitTestDescription="Test {$test_num} - {$method}"; -$attach = file_get_contents('./other/marilyn-monroe.jpg'); -$encoded = base64_encode($attach); -$args=array(); -$args["devKey"]='developer'; -$args["testcaseid"]=118951; -$args["version"] = 2; -$args["title"] = 'Marilyn Monroe'; -$args["filename"] = 'marilyn-monroe.jpg'; -$args["content"] = $encoded; -$additionalInfo=''; - -$debug=true; -echo $unitTestDescription; -echo $additionalInfo; - -$client = new IXR_Client($server_url); -$client->debug=$debug; - -runTest($client,$method,$args,$test_num); +debug = $debug; + +runTest($client, $method, $args, $test_num); +// --------------------------------------------------------------------------------- + +$test_num = 2; +$unitTestDescription = "Test {$test_num} - {$method}"; +$attach = file_get_contents('./other/marilyn-monroe.jpg'); +$encoded = base64_encode($attach); +$args = array(); +$args["devKey"] = 'developer'; +$args["testcaseid"] = 118951; +$args["version"] = 2; +$args["title"] = 'Marilyn Monroe'; +$args["filename"] = 'marilyn-monroe.jpg'; +$args["content"] = $encoded; +$additionalInfo = ''; + +$debug = true; +echo $unitTestDescription; +echo $additionalInfo; + +$client = new IXR_Client($server_url); +$client->debug = $debug; + +runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t1.php b/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t1.php index ed3d6b4f35..a56b4205c4 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t1.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t1.php @@ -1,30 +1,30 @@ -debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); \ No newline at end of file +debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t2.php b/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t2.php index 778731a363..f3ed40fd27 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t2.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/client_issue6159_t2.php @@ -1,32 +1,32 @@ -debug=$debug; - -$answer = runTest($client,$method,$args,$test_num); \ No newline at end of file +debug = $debug; + +$answer = runTest($client, $method, $args, $test_num); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/index.php b/lib/api/xmlrpc/v1/sample_clients/php/index.php index f0f578b9e8..8780792446 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/index.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/index.php @@ -1,62 +1,53 @@ -
    Click on file name to launch sample client

    '; -echo ''; -foreach($examples as $url2launch) -{ - echo ''; -} -echo '
    '; - echo '' . $url2launch . ''; - echo '
    '; - -?> +
    Click on file name to launch sample client

    '; +echo ''; +foreach ($examples as $url2launch) { + echo ''; +} +echo '
    '; + echo '' . $url2launch . ''; + echo '
    '; + +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/sample.inc.php b/lib/api/xmlrpc/v1/sample_clients/php/sample.inc.php index f17a0df76a..c65ff32f96 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/sample.inc.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/sample.inc.php @@ -1,21 +1,23 @@ - -<?php echo $tl_and_version ?> +<?php + +echo $tl_and_version?> @@ -27,54 +29,51 @@ storedDetail : '', toggle : function(id){ - if(this.storedDetail && this.storedDetail != id) + if(this.storedDetail && this.storedDetail != id) { document.getElementById(this.storedDetail).style.display = 'none'; } this.storedDetail = id; var style = document.getElementById(id).style; - if(style.display == 'block') + if(style.display == 'block') { style.display = 'none'; } else { style.display = 'block'; - } + } return false; } }; -Test Link XML-RPC API - PHP Samples
    '; - -// substitute your Dev Key Here -define("DEV_KEY", "dev01"); -if( DEV_KEY == "dev01" ) -{ - echo '

    Attention: DEVKEY is still setted to demo value (' . DEV_KEY . ')

    '; - echo 'Please check if this VALUE is defined for a user on yout DB Installation'; - echo '
    '; -} -?> \ No newline at end of file +Test Link XML-RPC API - PHP Samples
    '; + +// substitute your Dev Key Here +define("DEV_KEY", "dev01"); +if (DEV_KEY == "dev01") { + echo '

    Attention: DEVKEY is still setted to demo value (' . DEV_KEY . + ')

    '; + echo 'Please check if this VALUE is defined for a user on yout DB Installation'; + echo '
    '; +} +?> diff --git a/lib/api/xmlrpc/v1/sample_clients/php/stepAddTestCaseToTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/stepAddTestCaseToTestPlan.php index 0c2dbbac4e..6efe455398 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/stepAddTestCaseToTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/stepAddTestCaseToTestPlan.php @@ -1,44 +1,44 @@ -tlProjectID; -$args["testplanid"] = $env->tlPlanID; - -$args["testcaseexternalid"] = $tlTestCasePrefix . '-1'; -$args["version"] = $env->tlTestCaseVersion; -$args["overwrite"] = $tlOverWriteOnAdd; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$answer = runTest($client,$method,$args,$tlIdx); +tlProjectID; +$args["testplanid"] = $env->tlPlanID; + +$args["testcaseexternalid"] = $tlTestCasePrefix . '-1'; +$args["version"] = $env->tlTestCaseVersion; +$args["overwrite"] = $tlOverWriteOnAdd; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$answer = runTest($client, $method, $args, $tlIdx); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestCase.php b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestCase.php index e304c4e6e4..2643f1f98e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestCase.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestCase.php @@ -1,34 +1,35 @@ -tlProjectID; -$args["testsuiteid"] = $env->tlSuiteID; -$args["testcasename"]='ZZ - TEST CASE NAME IS OK'; -$args["summary"]='Test Case created via API'; -$args["preconditions"]='Test Link API Up & Running'; -$args["authorlogin"]='admin'; -$args["checkduplicatedname"]=0; -$args["steps"][]=array('step_number' => 1, 'actions' => 'Start Server', 'expected_results' => 'green light'); - -$unitTestDescription = ""; -echo $unitTestDescription; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); \ No newline at end of file +tlProjectID; +$args["testsuiteid"] = $env->tlSuiteID; +$args["testcasename"] = 'ZZ - TEST CASE NAME IS OK'; +$args["summary"] = 'Test Case created via API'; +$args["preconditions"] = 'Test Link API Up & Running'; +$args["authorlogin"] = 'admin'; +$args["checkduplicatedname"] = 0; +$args["steps"][] = array( + 'step_number' => 1, + 'actions' => 'Start Server', + 'expected_results' => 'green light' +); + +$unitTestDescription = ""; +echo $unitTestDescription; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); diff --git a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestPlan.php b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestPlan.php index 339f72b814..c31c1b81f0 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestPlan.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestPlan.php @@ -1,38 +1,33 @@ -debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); } - -$args=array(); -$args["devKey"] =isset($_REQUEST['apiKey']) ? $_REQUEST['apiKey'] : $tlDevKey; -$args["prefix"] = $tlTestCasePrefix; -$args["testplanname"]="TPLAN BY API"; -$args["notes"]="test plan created using XML-RPC-API"; - -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; -} -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestProject.php b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestProject.php index c69e217436..fcafffc7b7 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestProject.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestProject.php @@ -1,43 +1,38 @@ - {$additionalInfo}"; - -echo $unitTestDescription . ' ' . $additionalInfo; - -$tlIdx++; -$client = new IXR_Client($server_url); -$client->debug=$tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; + {$additionalInfo}"; + +echo $unitTestDescription . ' ' . $additionalInfo; + +$tlIdx ++; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); } -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestSuite.php b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestSuite.php index a256edd6b7..ffa5813d3e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestSuite.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/stepCreateTestSuite.php @@ -1,39 +1,35 @@ -tlProjectID; -$args["testsuitename"] = 'TS API 100'; -$args["details"]='This has been created by XMLRPC API Call'; - -echo $unitTestDescription; -$client = new IXR_Client($server_url); -$client->debug = $tlDebug; -$ret = runTest($client,$method,$args,$tlIdx); - - -if( isset($ret[0]['id']) ) -{ - $env->$tlIDName = $ret[0]['id']; +tlProjectID; +$args["testsuitename"] = 'TS API 100'; +$args["details"] = 'This has been created by XMLRPC API Call'; + +echo $unitTestDescription; +$client = new IXR_Client($server_url); +$client->debug = $tlDebug; +$ret = runTest($client, $method, $args, $tlIdx); + +if (isset($ret[0]['id'])) { + $env->$tlIDName = $ret[0]['id']; +} else { + $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . + basename(__FILE__) . ")"; + throw new Exception($msg, 1); } -else -{ - $msg = 'Warning! ' . ' :: ' . $ret[0]['message'] . ' (file: ' . basename(__FILE__) . ")"; - throw new Exception($msg, 1); -} \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/php/util.php b/lib/api/xmlrpc/v1/sample_clients/php/util.php index c726286edf..2a7a27e0f6 100644 --- a/lib/api/xmlrpc/v1/sample_clients/php/util.php +++ b/lib/api/xmlrpc/v1/sample_clients/php/util.php @@ -1,54 +1,53 @@ -

    This sample can be runned without changes against sample database testlinkAPI'; - echo ('
    that you will find on [YOUR TL INSTALLATION DIR]' . '\\docs\\db_sample\\'); - echo '



    '; +

    This sample can be runned without changes against sample database testlinkAPI'; + echo '
    that you will find on [YOUR TL INSTALLATION DIR]' . + '\\docs\\db_sample\\'; + echo '



    '; +} + +function runTest(&$client, $method, $args, $feedback_id = 1) +{ + echo __FUNCTION__ . '
    '; + new dBug($args); + $html_id = "result_{$feedback_id}"; + + $msg_click_to_show = "click to show XML-RPC Client Debug Info"; + echo "
    + {$msg_click_to_show}"; + echo '

    "; + + echo "
    Result was: "; + new dBug($response); + echo "
    "; + echo "


    "; + + return $response; } - -function runTest(&$client,$method,$args,$feedback_id=1) -{ - - echo __FUNCTION__ . '
    '; - new dBug($args); - $html_id="result_{$feedback_id}"; - - $msg_click_to_show="click to show XML-RPC Client Debug Info"; - echo "
    - {$msg_click_to_show}"; - echo '

    "; - - echo "
    Result was: "; - new dBug($response); - echo "
    "; - echo "


    "; - - return $response; -} diff --git a/lib/api/xmlrpc/v1/sample_clients/python/clientCreateUser.py b/lib/api/xmlrpc/v1/sample_clients/python/clientCreateUser.py index 2a0041d51f..606592cc26 100644 --- a/lib/api/xmlrpc/v1/sample_clients/python/clientCreateUser.py +++ b/lib/api/xmlrpc/v1/sample_clients/python/clientCreateUser.py @@ -11,7 +11,7 @@ server = xmlrpclib.Server(SERVER_URL%serverName) -print server.tl.about() +print(server.tl.about()) # check Key if not (server.tl.checkDevKey({'devKey': devKey})): @@ -24,15 +24,15 @@ 'email': 'user.api@your.domain.org', 'password': 'yourpwd'} -print "Create user with password..." +print("Create user with password...") userID = server.tl.createUser(args) if isinstance(userID, str): - print "User %s created."%userID + print("User %s created."%userID) else: - print "Something's wrong: " + print("Something's wrong: ") for err in userID: - print err['message'] + print(err['message']) args = {'devKey': devKey, 'login': 'uapi2', @@ -40,15 +40,15 @@ 'lastname': 'API2', 'email': 'user.api2@your.domain.org'} -print "Create user without password..." +print("Create user without password...") userID = server.tl.createUser(args) if isinstance(userID, str): - print "User %s created."%userID + print("User %s created."%userID) else: - print "Something's wrong: " + print("Something's wrong: ") for err in userID: - print err['message'] + print(err['message']) args = {'devKey': devKey, 'login': 'uapi2', @@ -56,12 +56,12 @@ 'lastname': 'API2', 'email': 'user.api2@your.domain.org'} -print "Create user with existing uid..." +print("Create user with existing uid...") userID = server.tl.createUser(args) if isinstance(userID, str): - print "User %s created."%userID + print("User %s created."%userID) else: - print "Something's wrong: " + print("Something's wrong: ") for err in userID: - print err['message'] + print(err['message']) diff --git a/lib/api/xmlrpc/v1/sample_clients/python/clientGetTestCaseForTestSuite.py b/lib/api/xmlrpc/v1/sample_clients/python/clientGetTestCaseForTestSuite.py index c5a04f8bf0..4dfff10e6d 100644 --- a/lib/api/xmlrpc/v1/sample_clients/python/clientGetTestCaseForTestSuite.py +++ b/lib/api/xmlrpc/v1/sample_clients/python/clientGetTestCaseForTestSuite.py @@ -15,4 +15,4 @@ data["details"] = "full" tcinfo = conn.tl.getTestCasesForTestSuite(data) -print tcinfo \ No newline at end of file +print(tcinfo) \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/python/clientSample.py b/lib/api/xmlrpc/v1/sample_clients/python/clientSample.py index 871b80cef8..2da90aae9e 100644 --- a/lib/api/xmlrpc/v1/sample_clients/python/clientSample.py +++ b/lib/api/xmlrpc/v1/sample_clients/python/clientSample.py @@ -22,8 +22,8 @@ def getInfo(self): # substitute your Dev Key Here client = TestlinkAPIClient("f2a979d533cdd9761434bba60a88e4d8") # get info about the server -print client.getInfo() +print(client.getInfo()) # Substitute for tcid and tpid that apply to your project result = client.reportTCResult(1132, 56646, "p") # Typically you'd want to validate the result here and probably do something more useful with it -print "reportTCResult result was: %s" %(result) \ No newline at end of file +print("reportTCResult result was: %s" %(result)) \ No newline at end of file diff --git a/lib/api/xmlrpc/v1/sample_clients/python/clientSetRole.py b/lib/api/xmlrpc/v1/sample_clients/python/clientSetRole.py index d45b176b7a..23fbf748d3 100644 --- a/lib/api/xmlrpc/v1/sample_clients/python/clientSetRole.py +++ b/lib/api/xmlrpc/v1/sample_clients/python/clientSetRole.py @@ -11,7 +11,7 @@ server = xmlrpclib.Server(SERVER_URL%serverName) -print server.tl.about() +print(server.tl.about()) # check Key if not (server.tl.checkDevKey({'devKey': devKey})): @@ -22,27 +22,27 @@ 'testprojectid': 1, 'rolename': 'leader'} -print "Set role leader to a user..." +print("Set role leader to a user...") res = server.tl.setUserRoleOnProject(args) if res == True: - print "The role %s is granted to the user %s on the project %s."%(args['rolename'], args['userid'], args['testprojectid']) + print("The role %s is granted to the user %s on the project %s."%(args['rolename'], args['userid'], args['testprojectid'])) else: - print "Something's wrong: " + print("Something's wrong: ") for err in res: - print err['message'] + print(err['message']) args = {'devKey': devKey, 'userid': 9999, 'testprojectid': 1, 'rolename': 'leader'} -print "Set role leader to a non existing user..." +print("Set role leader to a non existing user...") res = server.tl.setUserRoleOnProject(args) if res == True: - print "The role %s is granted to the user %s on the project %s."%(args['rolename'], args['userid'], args['testprojectid']) + print("The role %s is granted to the user %s on the project %s."%(args['rolename'], args['userid'], args['testprojectid'])) else: - print "Something's wrong: " + print("Something's wrong: ") for err in res: - print err['message'] + print(err['message']) diff --git a/lib/api/xmlrpc/v1/sample_extended_server/extended_server.php b/lib/api/xmlrpc/v1/sample_extended_server/extended_server.php index 25ffcfa3d9..f0e5910960 100644 --- a/lib/api/xmlrpc/v1/sample_extended_server/extended_server.php +++ b/lib/api/xmlrpc/v1/sample_extended_server/extended_server.php @@ -1,98 +1,118 @@ - 'this:getTestSuiteIDByName', - 'tl.uploadStats' => 'this:uploadStats' -); - parent::__construct($callbacks); - } - - private function _getTestSuiteByName($args) { - $status_ok=false; - $testSuiteName = $args[self::$testSuiteNameParamName]; - - $result = $this->tsuiteMgr->get_by_name($testSuiteName); - - $num = sizeof($result); - if ($num == 0) { - $msg = $msg_prefix . sprintf("Name %s does not belong to a test suite present on system!", $testSuiteName); - $this->errors[] = new IXR_Error(8004, $msg); - } else { - // Check project id - foreach ($result as $row) { - $projectid = $this->tsuiteMgr->getTestProjectFromTestSuite($row['id']); - if ($projectid == $args[self::$testProjectIDParamName]) { - $result[0] = $row; - $status_ok=true; - break; - } - } - - if (!$status_ok) { - $tprojectInfo=$this->tprojectMgr->get_by_id($args[self::$testProjectIDParamName]); - $msg= sprintf(TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR, $result[0]['id'], - $tprojectInfo['name'], $args[self::$testProjectIDParamName]); - $this->errors[] = new IXR_Error(TESTSUITE_DONOTBELONGTO_TESTPROJECT,$msg_prefix . $msg); - } - } - - return $status_ok ? $result : $this->errors; - } - - public function getTestSuiteIDByName($args) { - $msg_prefix="(" .__FUNCTION__. ") - "; - $status_ok=true; - $this->_setArgs($args); - - $checkFunctions = array('authenticate','checkTestSuiteName'); - $status_ok = $this->_runChecks($checkFunctions,$msg_prefix) && $this->userHasRight("mgt_view_tc"); - - if ($status_ok) { - $keys2check = array(self::$testSuiteNameParamName); - - foreach ($keys2check as $key) { - if (!$this->_isParamPresent($key)) { - $this->errors[] = new IXR_Error(NO_TESTSUITENAME, - $msg_prefix . NO_TESTSUITENAME_STR); - $status_ok=false; - } - } - } - - return $status_ok ? $this->_getTestSuiteByName($this->args) : $this->errors; - } - - public function uploadStats($args) { - foreach ($args as $key => $value) { - switch ($key) { - case devKey: - break; - default: - $stat_msg = sprintf("%s: %s = %s\n", - $_SERVER['REMOTE_ADDR'], $key, $value); - syslog(LOG_INFO, $stat_msg); - break; - } - } - } -} - -$XMLRPCServer = new SampleXMLRPCServer(); - + 'this:getTestSuiteIDByName', + 'tl.uploadStats' => 'this:uploadStats' + ); + parent::__construct($callbacks); + } + + private function _getTestSuiteByName($args) + { + $status_ok = false; + $testSuiteName = $args[self::$testSuiteNameParamName]; + + $result = $this->tsuiteMgr->get_by_name($testSuiteName); + + $num = count($result); + if ($num == 0) { + $msg = $msg_prefix . + sprintf( + "Name %s does not belong to a test suite present on system!", + $testSuiteName); + $this->errors[] = new IXR_Error(8004, $msg); + } else { + // Check project id + foreach ($result as $row) { + $projectid = $this->tsuiteMgr->getTestProjectFromTestSuite( + $row['id']); + if ($projectid == $args[self::$testProjectIDParamName]) { + $result[0] = $row; + $status_ok = true; + break; + } + } + + if (! $status_ok) { + $tprojectInfo = $this->tprojectMgr->get_by_id( + $args[self::$testProjectIDParamName]); + $msg = sprintf(TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR, + $result[0]['id'], $tprojectInfo['name'], + $args[self::$testProjectIDParamName]); + $this->errors[] = new IXR_Error( + TESTSUITE_DONOTBELONGTO_TESTPROJECT, $msg_prefix . $msg); + } + } + + return $status_ok ? $result : $this->errors; + } + + public function getTestSuiteIDByName($args) + { + $msg_prefix = "(" . __FUNCTION__ . ") - "; + $status_ok = true; + $this->_setArgs($args); + + $checkFunctions = array( + 'authenticate', + 'checkTestSuiteName' + ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->userHasRight("mgt_view_tc"); + + if ($status_ok) { + $keys2check = array( + self::$testSuiteNameParamName + ); + + foreach ($keys2check as $key) { + if (! $this->_isParamPresent($key)) { + $this->errors[] = new IXR_Error(NO_TESTSUITENAME, + $msg_prefix . NO_TESTSUITENAME_STR); + $status_ok = false; + } + } + } + + return $status_ok ? $this->_getTestSuiteByName($this->args) : $this->errors; + } + + public function uploadStats($args) + { + foreach ($args as $key => $value) { + switch ($key) { + case devKey: + break; + default: + $stat_msg = sprintf("%s: %s = %s\n", $_SERVER['REMOTE_ADDR'], + $key, $value); + syslog(LOG_INFO, $stat_msg); + break; + } + } + } +} + +$XMLRPCServer = new SampleXMLRPCServer(); + ?> diff --git a/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTest.php b/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTest.php index ffff509027..2ac3b4d04c 100644 --- a/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTest.php +++ b/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTest.php @@ -1,996 +1,1015 @@ - - * @package TestlinkAPI - * @link http://testlink.org/api/ - */ - -require_once dirname(__FILE__) . '/../../../third_party/xml-rpc/class-IXR.php'; -require_once dirname(__FILE__) . '/../APIErrors.php'; -require_once dirname(__FILE__) . '/TestlinkXMLRPCServerTestData.php'; -require_once 'PHPUnit/Framework.php'; -require_once 'PHPUnit/TextUI/TestRunner.php'; - -/** - * Unit tests for the Testlink API - * - * @author Asiel Brumfield - * @since Class available since Release 1.8.0 - * @version 1.0 - */ -class TestlinkXMLRPCServerTest extends PHPUnit_Framework_TestCase -{ - protected $client; - protected $SERVER_URL = "http://localhost/testlink_trunk/lib/api/xmlrpc.php"; - - function setUp() - { - // This is the path to the server and will vary from machine to machine - $this->client = $client = new IXR_Client($this->SERVER_URL); - // run IXR_Client in debug mode showing verbose output - $this->client->debug = true; - //$this->setupTestMode(); - } - - private function setupTestMode() - { - $data["testmode"] = true; - - if(!$this->client->query('tl.setTestMode', $data)) { - echo "\n" . $this->getName() . " >> problem setting testMode - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $this->assertEquals(true, $this->client->getResponse()); - } - - public static function suite() - { - $suite = new PHPUnit_Framework_TestSuite; - - // Run specific individual tests - $suite->addTest(new TestlinkXMLRPCServerTest('testSayHello')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidDevKey')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithoutDevKey')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithEmptyDevKey')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithoutTCID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidTCID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithoutNonIntTCID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithoutTPID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithoutStatus')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithInvalidStatus')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithBlockedStatus')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithPassedStatus')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultValidRequest')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithNoParams')); - - - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithValidBuildID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultNotGuessingBuildID')); - - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithNotes')); - $suite->addTest(new TestlinkXMLRPCServerTest('testCreateBuildWithoutNotes')); - $suite->addTest(new TestlinkXMLRPCServerTest('testCreateBuildWithNotes')); - $suite->addTest(new TestlinkXMLRPCServerTest('testCreateBuildWithInvalidTPID')); - $suite->addTest(new TestlinkXMLRPCServerTest('testValidDevKeyWorks')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjects')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultRequestWithFailedStatus')); - $suite->addTest(new TestlinkXMLRPCServerTest('testCreateBuildWithInsufficientRights')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlans')); - - - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuite')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteDeepFalse')); - - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCaseIDByName')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCaseIDByNameWithInvalidName')); - $suite->addTest(new TestlinkXMLRPCServerTest('testRepeat')); - $suite->addTest(new TestlinkXMLRPCServerTest('testAbout')); - $suite->addTest(new TestlinkXMLRPCServerTest('testNonExistantMethod')); - - //NEW TESTS - $suite->addTest(new TestlinkXMLRPCServerTest('testCreateBuildWithInsufficientRights')); - $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithInsufficientRights')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteWithInsufficientRights')); - $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCaseIDByNameWithInsufficientRights')); - - $suite->addTest(new TestlinkXMLRPCServerTest('testGetLastTestResult')); - - - - //INCOMPLETE - - - //THERE IS NO RIGHTS ASSOCIATED WITH THIS YET - $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectsWithInsufficientRights')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidTCIDAndTPIDCombo')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithTimestamp')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlansWithInvalidID')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlansWithoutTestProjectID')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetTestSuitesForTestPlan')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetTestSuitesForTestPlanWithoutTestPlanID')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteWithInvalidSuiteID')); - //$suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteWithoutSuiteID')); - - - // run all the tests - //$suite->addTestSuite('TestlinkXMLRPCServerTest'); - return $suite; - } - - function testSayHello() - { - if (!$this->client->query('tl.sayHello')) { - die('big time problem ' . $this->client->getErrorCode() . ' : ' . - $this->client->getErrorMessage()); - } - - $this->assertEquals('Hello!', $this->client->getResponse()); - } - - function testReportTCResultWithInvalidDevKey() - { - $data = array(); - $data["devKey"] = "wrongKey"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_AUTH"); - $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); - - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - - function testReportTCResultWithInsufficientRights() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - // set the status to blocked - $data["status"] = "b"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); - $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); - - $result = $this->client->getResponse(); - $this->assertEquals($expectedResult, $result); - } - - - - function testReportTCResultWithoutDevKey() - { - $data = array(); - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_DEV_KEY"); - $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); - - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - function testReportTCResultWithEmptyDevKey() - { - $data = array(); - $data["devKey"] = ""; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_AUTH"); - $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); - - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - function testReportTCResultWithoutTCID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_TCASEID"); - $expectedResult[0]["message"] = constant("NO_TCASEID_STR"); - - var_dump($expectedResult); - - var_dump($this->client->getResponse()); - - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - function testReportTCResultWithInvalidTCID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["status"] = "f"; - $data["testcaseid"] = -100; // shouldn't have a negative number for TCID in db - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_TCASEID"); - $expectedResult[0]["message"] = constant("INVALID_TCASEID_STR"); - - $result = $this->client->getResponse(); - //print_r($result); - //print_r($expectedResult); - $this->assertEquals($expectedResult, $result); - } - - function testReportTCResultWithoutNonIntTCID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = "notAnInt"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array containing the errors that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("TCASEID_NOT_INTEGER"); - $expectedResult[0]["message"] = constant("TCASEID_NOT_INTEGER_STR"); - $expectedResult[1]["code"] = constant("INVALID_TCASEID"); - $expectedResult[1]["message"] = constant("INVALID_TCASEID_STR"); - - $result = $this->client->getResponse(); - - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - // TODO: Implement - function testReportTCResultWithoutTPID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - // dependant on data in the sql file - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_TPLANID"); - $expectedResult[0]["message"] = constant("NO_TPLANID_STR"); - - $response = $this->client->getResponse(); - $this->assertEquals($expectedResult, $response); - } - - function testReportTCResultRequestWithoutStatus() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_STATUS"); - $expectedResult[0]["message"] = constant("NO_STATUS_STR"); - - $response = $this->client->getResponse(); - $this->assertEquals($expectedResult, $response); - } - - function testReportTCResultRequestWithInvalidStatus() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - $data["status"] = "invalidStatus"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_STATUS"); - $expectedResult[0]["message"] = constant("INVALID_STATUS_STR"); - - $response = $this->client->getResponse(); - $this->assertEquals($expectedResult, $response); - } - - function testReportTCResultRequestWithBlockedStatus() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - // set the status to blocked - $data["status"] = "b"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - var_dump($response); - // Just check the size is good since we don't know the insert id - $this->assertEquals(3, sizeof($response[0])); - } - - function testReportTCResultRequestWithPassedStatus() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - // set the status to passed - $data["status"] = "p"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - $this->assertEquals(3, sizeof($response[0])); - } - - function testReportTCResultRequestWithFailedStatus() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - // set the status to failed - $data["status"] = "f"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - $this->assertEquals(3, sizeof($response[0])); - } - - function testReportTCResultWithNoParams() - { - $data = array(); - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_DEV_KEY"); - $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); - $this->assertEquals($expectedResult, $this->client->getResponse()); - } - - // TODO: Implement - function testReportTCResultWithInvalidTCIDAndTPIDCombo() - { - // TCID_NOT_IN_TPID, TCID_NOT_IN_TPID_STR - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testReportTCResultValidRequest() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - $data["status"] = "p"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - $this->assertEquals(3, sizeof($response[0])); - } - - function testGetLastTestResult() - { - //Setup a Known Response by reporting a block - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - $data["status"] = "b"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - -//Now Building our get last test result - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - if(!$this->client->query('tl.getLastTestResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - print_r($response); - $this->assertEquals(9, sizeof($response[0])); - $this->assertEquals('b', $response[0]['status']); - - } - - function testReportTCResultRequestWithValidBuildID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - $data["guess"] = false; - $data["status"] = "f"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - //$expectedResult[0]["message"] = constant("GENERAL_SUCCESS_STR"); - //$expectedResult[0]["status"] = true; - - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - $this->assertEquals(3, sizeof($response[0])); - } - - function testReportTCResultNotGuessingBuildID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - // don't allow guessing the build id - $data["guess"] = false; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // build up an array contining the error that should come back - $expectedResult = array(); - $expectedResult[0]["code"] = constant("BUILDID_NOGUESS"); - $expectedResult[0]["message"] = constant("BUILDID_NOGUESS_STR"); - $expectedResult[1]["code"] = constant("NO_BUILDID"); - $expectedResult[1]["message"] = constant("NO_BUILDID_STR"); - - $response = $this->client->getResponse(); - $this->assertEquals($expectedResult, $response); - } - - function testReportTCResultWithTimestamp() - { - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testReportTCResultWithNotes() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["status"] = "p"; - $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; - $data["notes"] = "this is a note about the test"; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - // Just check the size is good since we don't know the insert id - var_dump($response); - - $this->assertEquals(3, sizeof($response[0])); - } - - function testCreateBuildWithInsufficientRights() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; - $data["buildname"] = "Another test build from " . @strftime("%c"); - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - - if(!$this->client->query('tl.createBuild', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); - $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); - - $result = $this->client->getResponse(); - $this->assertEquals($expectedResult, $result); - } - - function testCreateBuildWithoutNotes() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["buildname"] = "Another test build from " . @strftime("%c"); - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - - if(!$this->client->query('tl.createBuild', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $response = $this->client->getResponse(); - var_dump($response); - $this->assertEquals(3, sizeof($response[0])); - } - - function testCreateBuildWithNotes() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["buildname"] = "Another notes test build from " . @strftime("%c"); - $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; - $data["buildnotes"] = "Some notes from the build created at " . @strftime("%c"); - - if(!$this->client->query('tl.createBuild', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $response = $this->client->getResponse(); - $this->assertEquals(3, sizeof($response[0])); - } - - function testCreateBuildWithInvalidTPID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["buildname"] = "Another test build from " . @strftime("%c"); - $data["testplanid"] = -1; - $data["buildnotes"] = "Some notes from the build created at " . @strftime("%c"); - - if(!$this->client->query('tl.createBuild', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_TPLANID"); - $expectedResult[0]["message"] = sprintf(constant("INVALID_TPLANID_STR"), $data["testplanid"]); - - $result = $this->client->getResponse(); - //print_r($expectedResult); - //print_r($result); - - $this->assertEquals($expectedResult, $result); - } - - function testValidDevKeyWorks() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - - if(!$this->client->query('tl.reportTCResult', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - // The response should not have any errors related to the devKey - $response = $this->client->getResponse(); - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INVALID_AUTH"); - $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); - $this->assertNotEquals($expectedResult, $this->client->getResponse()); - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_DEV_KEY"); - $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); - $this->assertNotEquals($expectedResult, $this->client->getResponse()); - } - - function testGetProjects() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - - if(!$this->client->query('tl.getProjects', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - - $expectedResult[0]["id"] = "1"; - $expectedResult[0]["notes"] = "

    A project for testing

    "; - - $expectedResult[0]["color"] = ""; - - $expectedResult[0]["active"] = "1"; - $expectedResult[0]["option_reqs"] = "1"; - $expectedResult[0]["option_priority"] = "1"; - $expectedResult[0]["prefix"] = ""; - $expectedResult[0]["tc_counter"] = "0"; - $expectedResult[0]["option_automation"] = "0"; - $expectedResult[0]["name"] = "Test Project"; - - $response = $this->client->getResponse(); - - var_dump($response); - var_dump($expectedResult); - - $this->assertEquals($expectedResult, $response); - } - - function testGetProjectsWithInsufficientRights() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; - - if(!$this->client->query('tl.getProjects', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); - $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); - - $result = $this->client->getResponse(); - $this->assertEquals($expectedResult, $result); - - - } - - function testGetProjectTestPlansWithInvalidID() - { - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - function testGetProjectTestPlansWithoutTestProjectID() - { - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testGetProjectTestPlans() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testprojectid"] = 1; - - if(!$this->client->query('tl.getProjectTestPlans', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $testplanID = 2; - $expectedResult[$testplanID]["id"] = $testplanID; - $expectedResult[$testplanID]["name"] = "A test plan for testing"; - // characters like

    are stripped - $expectedResult[$testplanID]["notes"] = "

    A description of a test plan for testing

    "; - $expectedResult[$testplanID]["active"] = "1"; - $expectedResult[$testplanID]["testproject_id"] = "1"; - - $expectedResult = array($expectedResult); - - - $response = $this->client->getResponse(); - //print_r($expectedResult); - //print_r($response); - - $this->assertEquals($expectedResult, $response); - } - - function testGetTestSuitesForTestPlan() - { - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testGetTestSuitesForTestPlanWithoutTestPlanID() - { - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testGetTestCasesForTestSuite() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testsuiteid"] = 3; - - if(!$this->client->query('tl.getTestCasesForTestSuite', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["id"] = 11; - $expectedResult[0]["name"] = "test case in child suite"; - $expectedResult[0]["parent_id"] = 10; - $expectedResult[0]["node_type_id"] = 3; - $expectedResult[0]["node_order"] = 100; - $expectedResult[1]["id"] = 4; - $expectedResult[1]["name"] = "First test case version 3"; - $expectedResult[1]["parent_id"] = 3; - $expectedResult[1]["node_type_id"] = 3; - $expectedResult[1]["node_order"] = 100; - $expectedResult[2]["id"] = 6; - $expectedResult[2]["name"] = "Another test case"; - $expectedResult[2]["parent_id"] = 3; - $expectedResult[2]["node_type_id"] = 3; - $expectedResult[2]["node_order"] = 100; - - $response = $this->client->getResponse(); - - $this->assertEquals($expectedResult, $response, "arrays do not match"); - } - - function testGetTestCasesForTestSuiteWithInsufficientRights() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; - $data["testsuiteid"] = 3; - - if(!$this->client->query('tl.getTestCasesForTestSuite', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); - $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); - - $result = $this->client->getResponse(); - $this->assertEquals($expectedResult, $result); - } - - function testGetTestCasesForTestSuiteDeepFalse() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testsuiteid"] = 3; - $data["deep"] = false; - - if(!$this->client->query('tl.getTestCasesForTestSuite', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["id"] = 4; - $expectedResult[0]["name"] = "First test case version 3"; - $expectedResult[0]["parent_id"] = 3; - $expectedResult[0]["node_type_id"] = 3; - $expectedResult[0]["node_order"] = 100; - $expectedResult[1]["id"] = 6; - $expectedResult[1]["name"] = "Another test case"; - $expectedResult[1]["parent_id"] = 3; - $expectedResult[1]["node_type_id"] = 3; - $expectedResult[1]["node_order"] = 100; - - $response = $this->client->getResponse(); - //print_r($response); - $this->assertEquals($expectedResult, $response, "arrays do not match"); - } - - function testGetTestCasesForTestSuiteWithoutSuiteID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testsuiteid"] = 3; - - if(!$this->client->query('tl.getTestCasesForTestSuite', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - //print_r($response); - - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - function testGetTestCasesForTestSuiteWithInvalidSuiteID() - { - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testsuiteid"] = 2000; - - if(!$this->client->query('tl.getTestCasesForTestSuite', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $response = $this->client->getResponse(); - //print_r($response); - - //TODO: Implement - throw new PHPUnit_Framework_IncompleteTestError('This test is not yet implemented'); - } - - - function testGetTestCaseIDByName() - { - $tcName = "First test case version 3"; - - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcasename"] = $tcName; - - if(!$this->client->query('tl.getTestCaseIDByName', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["id"] = TestlinkXMLRPCServerTestData::testTCID; - $expectedResult[0]["name"] = $tcName; - $expectedResult[0]["parent_id"] = "1"; - $expectedResult[0]["tsuite_name"] = "Top Level Suite"; - $expectedResult[0]["tc_external_id"] = "0"; - - $response = $this->client->getResponse(); - //print_r($response); - //print_r($expectedResult); - - $this->assertEquals($expectedResult, $response); - } - - function testGetTestCaseIDByNameWithInsufficientRights() - { - $tcName = "First test case version 3"; - - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; - $data["testcasename"] = $tcName; - - if(!$this->client->query('tl.getTestCaseIDByName', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - $expectedResult = array(); - $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); - $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); - - $result = $this->client->getResponse(); - $this->assertEquals($expectedResult, $result); - } - - function testGetTestCaseIDByNameWithInvalidName() - { - $tcName = "A Test case that does not exist"; - - $data = array(); - $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; - $data["testcasename"] = $tcName; - - if(!$this->client->query('tl.getTestCaseIDByName', $data)) { - echo "\n" . $this->getName() . " >> something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $expectedResult = array(); - $expectedResult[0]["code"] = constant("NO_TESTCASE_BY_THIS_NAME"); - $expectedResult[0]["message"] = "(getTestCaseIDByName) - " . constant("NO_TESTCASE_BY_THIS_NAME_STR"); - - $response = $this->client->getResponse(); - //print_r($expectedResult); - //print_r($response); - - $this->assertEquals($expectedResult, $response); - } - - - function testRepeat() - { - $data = array(); - $data["str"] = "I like to talk to myself"; - - if(!$this->client->query('tl.repeat', $data)) - { - echo "\n\n" . $this->getName() . "something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - - $this->assertEquals("You said: " . $data["str"], $this->client->getResponse()); - } - - function testAbout() - { - if(!$this->client->query('tl.about', null)) - { - echo "\n\n" . $this->getName() . "something went really wrong - " . $this->client->getErrorCode() . - $this->client->getErrorMessage(); - } - else - { - echo "success!"; - } - } - - function testNonExistantMethod() - { - $this->assertFalse($this->client->query('tl.noSuchMethodExists')); - } - -} - -// this is only necessary if you want to run "php FileName.php" -// otherwise you can just run "phpunit FileName.php" and it should work -//PHPUnit_TextUI_TestRunner::run(TestlinkXMLRPCServerTest::suite()); - + + * @package TestlinkAPI + * @link http://testlink.org/api/ + */ +require_once dirname(__FILE__) . '/../../../third_party/xml-rpc/class-IXR.php'; +require_once dirname(__FILE__) . '/../APIErrors.php'; +require_once dirname(__FILE__) . '/TestlinkXMLRPCServerTestData.php'; +require_once 'PHPUnit/Framework.php'; +require_once 'PHPUnit/TextUI/TestRunner.php'; + +/** + * Unit tests for the Testlink API + * + * @author Asiel Brumfield + * @since Class available since Release 1.8.0 + * @version 1.0 + */ +class TestlinkXMLRPCServerTest extends PHPUnit_Framework_TestCase +{ + + protected $client; + + protected $SERVER_URL = "http://localhost/testlink_trunk/lib/api/xmlrpc.php"; + + private function setUp() + { + // This is the path to the server and will vary from machine to machine + $this->client = new IXR_Client($this->SERVER_URL); + // run IXR_Client in debug mode showing verbose output + $this->client->debug = true; + } + + private function setupTestMode() + { + $data["testmode"] = true; + + if (! $this->client->query('tl.setTestMode', $data)) { + echo "\n" . $this->getName() . " >> problem setting testMode - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $this->assertEquals(true, $this->client->getResponse()); + } + + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite(); + + // Run specific individual tests + $suite->addTest(new TestlinkXMLRPCServerTest('testSayHello')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidDevKey')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithoutDevKey')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithEmptyDevKey')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithoutTCID')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidTCID')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithoutNonIntTCID')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithoutTPID')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithoutStatus')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithInvalidStatus')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithBlockedStatus')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithPassedStatus')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultValidRequest')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithNoParams')); + + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithValidBuildID')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultNotGuessingBuildID')); + + $suite->addTest( + new TestlinkXMLRPCServerTest('testReportTCResultWithNotes')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testCreateBuildWithoutNotes')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testCreateBuildWithNotes')); + $suite->addTest( + new TestlinkXMLRPCServerTest('testCreateBuildWithInvalidTPID')); + $suite->addTest(new TestlinkXMLRPCServerTest('testValidDevKeyWorks')); + $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjects')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultRequestWithFailedStatus')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testCreateBuildWithInsufficientRights')); + $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlans')); + + $suite->addTest( + new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuite')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testGetTestCasesForTestSuiteDeepFalse')); + + $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCaseIDByName')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testGetTestCaseIDByNameWithInvalidName')); + $suite->addTest(new TestlinkXMLRPCServerTest('testRepeat')); + $suite->addTest(new TestlinkXMLRPCServerTest('testAbout')); + $suite->addTest(new TestlinkXMLRPCServerTest('testNonExistantMethod')); + + // NEW TESTS + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testCreateBuildWithInsufficientRights')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testReportTCResultWithInsufficientRights')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testGetTestCasesForTestSuiteWithInsufficientRights')); + $suite->addTest( + new TestlinkXMLRPCServerTest( + 'testGetTestCaseIDByNameWithInsufficientRights')); + + $suite->addTest(new TestlinkXMLRPCServerTest('testGetLastTestResult')); + + // INCOMPLETE + + // THERE IS NO RIGHTS ASSOCIATED WITH THIS YET - $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectsWithInsufficientRights')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithInvalidTCIDAndTPIDCombo')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testReportTCResultWithTimestamp')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlansWithInvalidID')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetProjectTestPlansWithoutTestProjectID')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestSuitesForTestPlan')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestSuitesForTestPlanWithoutTestPlanID')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteWithInvalidSuiteID')); + // $suite->addTest(new TestlinkXMLRPCServerTest('testGetTestCasesForTestSuiteWithoutSuiteID')); + + // run all the tests + // $suite->addTestSuite('TestlinkXMLRPCServerTest'); + return $suite; + } + + private function testSayHello() + { + if (! $this->client->query('tl.sayHello')) { + die( + 'big time problem ' . $this->client->getErrorCode() . ' : ' . + $this->client->getErrorMessage()); + } + + $this->assertEquals('Hello!', $this->client->getResponse()); + } + + private function testReportTCResultWithInvalidDevKey() + { + $data = array(); + $data["devKey"] = "wrongKey"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_AUTH"); + $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); + + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + private function testReportTCResultWithInsufficientRights() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + // set the status to blocked + $data["status"] = "b"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); + $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testReportTCResultWithoutDevKey() + { + $data = array(); + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_DEV_KEY"); + $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); + + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + private function testReportTCResultWithEmptyDevKey() + { + $data = array(); + $data["devKey"] = ""; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_AUTH"); + $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); + + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + private function testReportTCResultWithoutTCID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_TCASEID"); + $expectedResult[0]["message"] = constant("NO_TCASEID_STR"); + + var_dump($expectedResult); + + var_dump($this->client->getResponse()); + + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + private function testReportTCResultWithInvalidTCID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["status"] = "f"; + $data["testcaseid"] = - 100; // shouldn't have a negative number for TCID in db + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_TCASEID"); + $expectedResult[0]["message"] = constant("INVALID_TCASEID_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testReportTCResultWithoutNonIntTCID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = "notAnInt"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array containing the errors that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("TCASEID_NOT_INTEGER"); + $expectedResult[0]["message"] = constant("TCASEID_NOT_INTEGER_STR"); + $expectedResult[1]["code"] = constant("INVALID_TCASEID"); + $expectedResult[1]["message"] = constant("INVALID_TCASEID_STR"); + + $this->client->getResponse(); + + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + private function testReportTCResultWithoutTPID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + // dependant on data in the sql file + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_TPLANID"); + $expectedResult[0]["message"] = constant("NO_TPLANID_STR"); + + $response = $this->client->getResponse(); + $this->assertEquals($expectedResult, $response); + } + + private function testReportTCResultRequestWithoutStatus() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_STATUS"); + $expectedResult[0]["message"] = constant("NO_STATUS_STR"); + + $response = $this->client->getResponse(); + $this->assertEquals($expectedResult, $response); + } + + private function testReportTCResultRequestWithInvalidStatus() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + $data["status"] = "invalidStatus"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_STATUS"); + $expectedResult[0]["message"] = constant("INVALID_STATUS_STR"); + + $response = $this->client->getResponse(); + $this->assertEquals($expectedResult, $response); + } + + private function testReportTCResultRequestWithBlockedStatus() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + // set the status to blocked + $data["status"] = "b"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + var_dump($response); + // Just check the size is good since we don't know the insert id + $this->assertEquals(3, count($response[0])); + } + + private function testReportTCResultRequestWithPassedStatus() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + // set the status to passed + $data["status"] = "p"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + $this->assertEquals(3, count($response[0])); + } + + private function testReportTCResultRequestWithFailedStatus() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + // set the status to failed + $data["status"] = "f"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + $this->assertEquals(3, count($response[0])); + } + + private function testReportTCResultWithNoParams() + { + $data = array(); + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_DEV_KEY"); + $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); + $this->assertEquals($expectedResult, $this->client->getResponse()); + } + + // TODO: Implement + private function testReportTCResultWithInvalidTCIDAndTPIDCombo() + { + // TCID_NOT_IN_TPID, TCID_NOT_IN_TPID_STR + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testReportTCResultValidRequest() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + $data["status"] = "p"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + $this->assertEquals(3, count($response[0])); + } + + private function testGetLastTestResult() + { + // Setup a Known Response by reporting a block + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + $data["status"] = "b"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // Now Building our get last test result + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + if (! $this->client->query('tl.getLastTestResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + print_r($response); + $this->assertEquals(9, count($response[0])); + $this->assertEquals('b', $response[0]['status']); + } + + private function testReportTCResultRequestWithValidBuildID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + $data["guess"] = false; + $data["status"] = "f"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + $this->assertEquals(3, count($response[0])); + } + + private function testReportTCResultNotGuessingBuildID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + // don't allow guessing the build id + $data["guess"] = false; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // build up an array contining the error that should come back + $expectedResult = array(); + $expectedResult[0]["code"] = constant("BUILDID_NOGUESS"); + $expectedResult[0]["message"] = constant("BUILDID_NOGUESS_STR"); + $expectedResult[1]["code"] = constant("NO_BUILDID"); + $expectedResult[1]["message"] = constant("NO_BUILDID_STR"); + + $response = $this->client->getResponse(); + $this->assertEquals($expectedResult, $response); + } + + private function testReportTCResultWithTimestamp() + { + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testReportTCResultWithNotes() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcaseid"] = TestlinkXMLRPCServerTestData::testTCID; + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["status"] = "p"; + $data["buildid"] = TestlinkXMLRPCServerTestData::testBuildID; + $data["notes"] = "this is a note about the test"; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $response = $this->client->getResponse(); + // Just check the size is good since we don't know the insert id + var_dump($response); + + $this->assertEquals(3, count($response[0])); + } + + private function testCreateBuildWithInsufficientRights() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; + $data["buildname"] = "Another test build from " . @strftime("%c"); + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + + if (! $this->client->query('tl.createBuild', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); + $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testCreateBuildWithoutNotes() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["buildname"] = "Another test build from " . @strftime("%c"); + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + + if (! $this->client->query('tl.createBuild', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $response = $this->client->getResponse(); + var_dump($response); + $this->assertEquals(3, count($response[0])); + } + + private function testCreateBuildWithNotes() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["buildname"] = "Another notes test build from " . @strftime("%c"); + $data["testplanid"] = TestlinkXMLRPCServerTestData::testTPID; + $data["buildnotes"] = "Some notes from the build created at " . + @strftime("%c"); + + if (! $this->client->query('tl.createBuild', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $response = $this->client->getResponse(); + $this->assertEquals(3, count($response[0])); + } + + private function testCreateBuildWithInvalidTPID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["buildname"] = "Another test build from " . @strftime("%c"); + $data["testplanid"] = - 1; + $data["buildnotes"] = "Some notes from the build created at " . + @strftime("%c"); + + if (! $this->client->query('tl.createBuild', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_TPLANID"); + $expectedResult[0]["message"] = sprintf(constant("INVALID_TPLANID_STR"), + $data["testplanid"]); + + $result = $this->client->getResponse(); + + $this->assertEquals($expectedResult, $result); + } + + private function testValidDevKeyWorks() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + + if (! $this->client->query('tl.reportTCResult', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + // The response should not have any errors related to the devKey + $this->client->getResponse(); + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INVALID_AUTH"); + $expectedResult[0]["message"] = constant("INVALID_AUTH_STR"); + $this->assertNotEquals($expectedResult, $this->client->getResponse()); + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_DEV_KEY"); + $expectedResult[0]["message"] = constant("NO_DEV_KEY_STR"); + $this->assertNotEquals($expectedResult, $this->client->getResponse()); + } + + private function testGetProjects() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + + if (! $this->client->query('tl.getProjects', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + + $expectedResult[0]["id"] = "1"; + $expectedResult[0]["notes"] = "

    A project for testing

    "; + + $expectedResult[0]["color"] = ""; + + $expectedResult[0]["active"] = "1"; + $expectedResult[0]["option_reqs"] = "1"; + $expectedResult[0]["option_priority"] = "1"; + $expectedResult[0]["prefix"] = ""; + $expectedResult[0]["tc_counter"] = "0"; + $expectedResult[0]["option_automation"] = "0"; + $expectedResult[0]["name"] = "Test Project"; + + $response = $this->client->getResponse(); + + var_dump($response); + var_dump($expectedResult); + + $this->assertEquals($expectedResult, $response); + } + + private function testGetProjectsWithInsufficientRights() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; + + if (! $this->client->query('tl.getProjects', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); + $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testGetProjectTestPlansWithInvalidID() + { + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetProjectTestPlansWithoutTestProjectID() + { + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetProjectTestPlans() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testprojectid"] = 1; + + if (! $this->client->query('tl.getProjectTestPlans', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $testplanID = 2; + $expectedResult[$testplanID]["id"] = $testplanID; + $expectedResult[$testplanID]["name"] = "A test plan for testing"; + // characters like

    are stripped + $expectedResult[$testplanID]["notes"] = "

    A description of a test plan for testing

    "; + $expectedResult[$testplanID]["active"] = "1"; + $expectedResult[$testplanID]["testproject_id"] = "1"; + + $expectedResult = array( + $expectedResult + ); + + $response = $this->client->getResponse(); + + $this->assertEquals($expectedResult, $response); + } + + private function testGetTestSuitesForTestPlan() + { + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetTestSuitesForTestPlanWithoutTestPlanID() + { + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetTestCasesForTestSuite() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testsuiteid"] = 3; + + if (! $this->client->query('tl.getTestCasesForTestSuite', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["id"] = 11; + $expectedResult[0]["name"] = "test case in child suite"; + $expectedResult[0]["parent_id"] = 10; + $expectedResult[0]["node_type_id"] = 3; + $expectedResult[0]["node_order"] = 100; + $expectedResult[1]["id"] = 4; + $expectedResult[1]["name"] = "First test case version 3"; + $expectedResult[1]["parent_id"] = 3; + $expectedResult[1]["node_type_id"] = 3; + $expectedResult[1]["node_order"] = 100; + $expectedResult[2]["id"] = 6; + $expectedResult[2]["name"] = "Another test case"; + $expectedResult[2]["parent_id"] = 3; + $expectedResult[2]["node_type_id"] = 3; + $expectedResult[2]["node_order"] = 100; + + $response = $this->client->getResponse(); + + $this->assertEquals($expectedResult, $response, "arrays do not match"); + } + + private function testGetTestCasesForTestSuiteWithInsufficientRights() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; + $data["testsuiteid"] = 3; + + if (! $this->client->query('tl.getTestCasesForTestSuite', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); + $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testGetTestCasesForTestSuiteDeepFalse() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testsuiteid"] = 3; + $data["deep"] = false; + + if (! $this->client->query('tl.getTestCasesForTestSuite', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["id"] = 4; + $expectedResult[0]["name"] = "First test case version 3"; + $expectedResult[0]["parent_id"] = 3; + $expectedResult[0]["node_type_id"] = 3; + $expectedResult[0]["node_order"] = 100; + $expectedResult[1]["id"] = 6; + $expectedResult[1]["name"] = "Another test case"; + $expectedResult[1]["parent_id"] = 3; + $expectedResult[1]["node_type_id"] = 3; + $expectedResult[1]["node_order"] = 100; + + $response = $this->client->getResponse(); + $this->assertEquals($expectedResult, $response, "arrays do not match"); + } + + private function testGetTestCasesForTestSuiteWithoutSuiteID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testsuiteid"] = 3; + + if (! $this->client->query('tl.getTestCasesForTestSuite', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $this->client->getResponse(); + + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetTestCasesForTestSuiteWithInvalidSuiteID() + { + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testsuiteid"] = 2000; + + if (! $this->client->query('tl.getTestCasesForTestSuite', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $this->client->getResponse(); + + // TODO: Implement + throw new PHPUnit_Framework_IncompleteTestError( + 'This test is not yet implemented'); + } + + private function testGetTestCaseIDByName() + { + $tcName = "First test case version 3"; + + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcasename"] = $tcName; + + if (! $this->client->query('tl.getTestCaseIDByName', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["id"] = TestlinkXMLRPCServerTestData::testTCID; + $expectedResult[0]["name"] = $tcName; + $expectedResult[0]["parent_id"] = "1"; + $expectedResult[0]["tsuite_name"] = "Top Level Suite"; + $expectedResult[0]["tc_external_id"] = "0"; + + $response = $this->client->getResponse(); + + $this->assertEquals($expectedResult, $response); + } + + private function testGetTestCaseIDByNameWithInsufficientRights() + { + $tcName = "First test case version 3"; + + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::noRightsDevKey; + $data["testcasename"] = $tcName; + + if (! $this->client->query('tl.getTestCaseIDByName', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + $expectedResult = array(); + $expectedResult[0]["code"] = constant("INSUFFICIENT_RIGHTS"); + $expectedResult[0]["message"] = constant("INSUFFICIENT_RIGHTS_STR"); + + $result = $this->client->getResponse(); + $this->assertEquals($expectedResult, $result); + } + + private function testGetTestCaseIDByNameWithInvalidName() + { + $tcName = "A Test case that does not exist"; + + $data = array(); + $data["devKey"] = TestlinkXMLRPCServerTestData::testDevKey; + $data["testcasename"] = $tcName; + + if (! $this->client->query('tl.getTestCaseIDByName', $data)) { + echo "\n" . $this->getName() . " >> something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $expectedResult = array(); + $expectedResult[0]["code"] = constant("NO_TESTCASE_BY_THIS_NAME"); + $expectedResult[0]["message"] = "(getTestCaseIDByName) - " . + constant("NO_TESTCASE_BY_THIS_NAME_STR"); + + $response = $this->client->getResponse(); + + $this->assertEquals($expectedResult, $response); + } + + private function testRepeat() + { + $data = array(); + $data["str"] = "I like to talk to myself"; + + if (! $this->client->query('tl.repeat', $data)) { + echo "\n\n" . $this->getName() . "something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } + + $this->assertEquals("You said: " . $data["str"], + $this->client->getResponse()); + } + + private function testAbout() + { + if (! $this->client->query('tl.about', null)) { + echo "\n\n" . $this->getName() . "something went really wrong - " . + $this->client->getErrorCode() . $this->client->getErrorMessage(); + } else { + echo "success!"; + } + } + + private function testNonExistantMethod() + { + $this->assertFalse($this->client->query('tl.noSuchMethodExists')); + } +} + +// this is only necessary if you want to run "php FileName.php" +// otherwise you can just run "phpunit FileName.php" and it should work +// PHPUnit_TextUI_TestRunner::run(TestlinkXMLRPCServerTest::suite()); + ?> diff --git a/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTestData.php b/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTestData.php index 509ad8f82a..b7f5d4a383 100644 --- a/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTestData.php +++ b/lib/api/xmlrpc/v1/test/TestlinkXMLRPCServerTestData.php @@ -1,73 +1,77 @@ - - * @package TestlinkAPI - * @link http://testlink.org/testlinkWebServices - */ - - /** - * Alternate class method of generating necessary test data - * @deprecated The SQL file should be used since this isn't maintained - */ -class TestlinkXMLRPCServerTestData -{ - // dependant on data in the sql file - const testDevKey = "validTestDevKey"; - const noRightsDevKey = "devKeyWithNoRights"; - const testTPID = 2; - const testTCID = 4; - const testBuildID = 1; - - - public function __construct() - { - echo $this->_getMessage(); - echo $this->_getTestDeveloperKeys(); - } - - private function _getTestDeveloperKeys() - { - $str = ""; - $str .= "INSERT INTO `api_developer_keys` (`id` ,`developer_key` ,`user_id`) VALUES (NULL , '" . self::testDevKey . "', '1');"; - $str .= "
    "; - return $str; - } - - private function _getNewTCID() - { - $str = ""; - $str .= "@tcid := SELECT MAX()"; - //$str .= "INSERT INTO " - } - - private function _getNewTPID() - { - - } - - private function _getMessage() - { - $str = ""; - $str .= "-- Copy this SQL text and insert it into your testlink database"; - $str .= "
    "; - return $str; - } -} - -// don't output the data when running from cli i.e. gets included in phpUnit test run -if(php_sapi_name() != "cli") -{ - $data = new TestlinkXMLRPCServerTestData(); -} - -?> \ No newline at end of file + + * @package TestlinkAPI + * @link http://testlink.org/testlinkWebServices + */ + +/** + * Alternate class method of generating necessary test data + * + * @deprecated The SQL file should be used since this isn't maintained + */ +class TestlinkXMLRPCServerTestData +{ + + // dependant on data in the sql file + const testDevKey = "validTestDevKey"; + + const noRightsDevKey = "devKeyWithNoRights"; + + const testTPID = 2; + + const testTCID = 4; + + const testBuildID = 1; + + public function __construct() + { + echo $this->_getMessage(); + echo $this->_getTestDeveloperKeys(); + } + + private function _getTestDeveloperKeys() + { + $str = ""; + $str .= "INSERT INTO `api_developer_keys` (`id` ,`developer_key` ,`user_id`) VALUES (NULL , '" . + self::testDevKey . "', '1');"; + $str .= "
    "; + return $str; + } + + private function _getNewTCID() + { + $str = ""; + $str .= "@tcid := SELECT MAX()"; + // $str .= "INSERT INTO " + } + + private function _getNewTPID() + {} + + private function _getMessage() + { + $str = ""; + $str .= "-- Copy this SQL text and insert it into your testlink database"; + $str .= "
    "; + return $str; + } +} + +// don't output the data when running from cli i.e. gets included in phpUnit test run +if (php_sapi_name() != "cli") { + $data = new TestlinkXMLRPCServerTestData(); +} + +?> diff --git a/lib/api/xmlrpc/v1/xmlrpc.class.php b/lib/api/xmlrpc/v1/xmlrpc.class.php index 0b07e4d99b..9a11246490 100644 --- a/lib/api/xmlrpc/v1/xmlrpc.class.php +++ b/lib/api/xmlrpc/v1/xmlrpc.class.php @@ -23,13 +23,15 @@ /** * IXR is the class used for the XML-RPC server */ -define( "TL_APICALL", 'XML-RPC' ); +use const Collator\OFF; -require_once("../../../../config.inc.php"); -require_once("common.php"); -require_once("xml-rpc/class-IXR.php"); -require_once("api.const.inc.php"); -require_once("APIErrors.php"); +define("TL_APICALL", 'XML-RPC'); + +require_once '../../../../config.inc.php'; +require_once 'common.php'; +require_once 'xml-rpc/class-IXR.php'; +require_once 'api.const.inc.php'; +require_once 'APIErrors.php'; /** * The entry class for serving XML-RPC Requests @@ -45,13 +47,21 @@ * @package TestlinkAPI * @since Class available since Release 1.8.0 */ -class TestlinkXMLRPCServer extends IXR_Server { +class TestlinkXMLRPCServer extends IXR_Server +{ + public static $version = "1.1"; + const OFF = false; + const ON = true; + const BUILD_GUESS_DEFAULT_MODE = OFF; + const SET_ERROR = true; + const CHECK_PUBLIC_PRIVATE_ATTR = true; + const THROW_ON_ERROR = true; /** @@ -60,15 +70,25 @@ class TestlinkXMLRPCServer extends IXR_Server { * @access protected */ protected $dbObj = null; + protected $tables = null; + protected $tcaseMgr = null; + protected $tprojectMgr = null; + protected $tplanMgr = null; + protected $tplanMetricsMgr = null; + protected $reqSpecMgr = null; + protected $reqMgr = null; + protected $platformMgr = null; + protected $itsMgr = null; + protected $userMgr = null; /** @@ -116,6 +136,7 @@ class TestlinkXMLRPCServer extends IXR_Server { * _checkTCIDAndTPIDValid() */ protected $tcVersionID = null; + protected $versionNumber = null; /** @@ -136,97 +157,189 @@ class TestlinkXMLRPCServer extends IXR_Server { * @static */ public static $actionOnDuplicatedNameParamName = "actiononduplicatedname"; + public static $actionParamName = "action"; + public static $activeParamName = "active"; + public static $assignedToParamName = "assignedto"; + public static $automatedParamName = "automated"; + public static $authorLoginParamName = "authorlogin"; + public static $bugIDParamName = "bugid"; + public static $buildIDParamName = "buildid"; + public static $buildNameParamName = "buildname"; + public static $buildNotesParamName = "buildnotes"; + public static $checkDuplicatedNameParamName = "checkduplicatedname"; + public static $contentParamName = "content"; + public static $customFieldNameParamName = "customfieldname"; + public static $customFieldsParamName = "customfields"; + public static $deepParamName = "deep"; + public static $descriptionParamName = "description"; + public static $detailsParamName = "details"; + public static $devKeyParamName = "devKey"; + public static $executionIDParamName = "executionid"; + public static $executionOrderParamName = "executionorder"; + public static $executedParamName = "executed"; + public static $executeStatusParamName = "executestatus"; + public static $executionTypeParamName = "executiontype"; + public static $expectedResultsParamName = "expectedresults"; + public static $fileNameParamName = "filename"; + public static $fileTypeParamName = "filetype"; + public static $foreignKeyIdParamName = "fkid"; + public static $foreignKeyTableNameParamName = "fktable"; + public static $guessParamName = "guess"; + public static $getStepsInfoParamName = "getstepsinfo"; + public static $getKeywordsParamName = "getkeywords"; + public static $importanceParamName = "importance"; + public static $internalIDParamName = "internalid"; + public static $keywordIDParamName = "keywordid"; + public static $keywordNameParamName = "keywords"; + public static $linkIDParamName = "linkid"; + public static $nodeIDParamName = "nodeid"; + public static $nodeTypeParamName = "nodetype"; + public static $noteParamName = "notes"; + public static $openParamName = "open"; + public static $optionsParamName = "options"; + public static $orderParamName = "order"; + public static $overwriteParamName = "overwrite"; + public static $parentIDParamName = "parentid"; + public static $platformNameParamName = "platformname"; + public static $platformIDParamName = "platformid"; + public static $platformOnDesignParamName = "platformondesign"; + public static $platformOnExecutionParamName = "platformonexecution"; + public static $preconditionsParamName = "preconditions"; + public static $publicParamName = "public"; + public static $releaseDateParamName = "releasedate"; + public static $roleIDParamName = "roleid"; + public static $roleNameParamName = "rolename"; + public static $requirementsParamName = "requirements"; + public static $requirementIDParamName = "requirementid"; + public static $requirementVersionIDParamName = "requirementversionid"; + public static $requirementDocIDParamName = "requirementdocid"; + public static $reqSpecIDParamName = "reqspecid"; + public static $scopeParamName = "scope"; + public static $summaryParamName = "summary"; + public static $statusParamName = "status"; + public static $stepsParamName = "steps"; + public static $testCaseIDParamName = "testcaseid"; + public static $testCaseExternalIDParamName = "testcaseexternalid"; + public static $testCaseNameParamName = "testcasename"; + public static $testCasePathNameParamName = "testcasepathname"; + public static $testCasePrefixParamName = "testcaseprefix"; + public static $testCaseVersionIDParamName = "testcaseversionid"; + public static $testModeParamName = "testmode"; + public static $testPlanIDParamName = "testplanid"; + public static $testPlanNameParamName = "testplanname"; + public static $testProjectIDParamName = "testprojectid"; + public static $testProjectNameParamName = "testprojectname"; + public static $testSuiteIDParamName = "testsuiteid"; + public static $testSuiteNameParamName = "testsuitename"; + public static $timeStampParamName = "timestamp"; + public static $titleParamName = "title"; + public static $urgencyParamName = "urgency"; + public static $userEmailParamName = "email"; + public static $userFirstNameParamName = "firstname"; + public static $userIDParamName = "userid"; + public static $userLastNameParamName = "lastname"; + public static $userLoginParamName = "login"; + public static $userParamName = "user"; + public static $userPasswordParamName = "password"; + public static $versionNumberParamName = "version"; + public static $estimatedExecDurationParamName = "estimatedexecduration"; + public static $executionDurationParamName = "execduration"; + public static $prefixParamName = "prefix"; + public static $testCaseVersionParamName = "tcversion"; + public static $itsNameParamName = "itsname"; + public static $itsEnabledParamName = "itsenabled"; + public static $copyTestersFromBuildParamName = "copytestersfrombuild"; /** @@ -238,64 +351,68 @@ class TestlinkXMLRPCServer extends IXR_Server { * Will be initialized using user configuration via config_get() */ public $statusCode; + public $codeStatus; /** * Constructor sets up the IXR_Server and db connection */ - public function __construct($callbacks = array()) { - $this->dbObj = new database( DB_TYPE ); - $this->dbObj->db->SetFetchMode( ADODB_FETCH_ASSOC ); + public function __construct($callbacks = array()) + { + $this->dbObj = new database(DB_TYPE); + $this->dbObj->db->SetFetchMode(ADODB_FETCH_ASSOC); $this->_connectToDB(); global $g_tlLogger; $this->tlLogger = &$g_tlLogger; - $this->tlLogger->setDB( $this->dbObj ); + $this->tlLogger->setDB($this->dbObj); // This close the default transaction that is started // when logger.class.php is included. $this->tlLogger->endTransaction(); - $this->tcaseMgr = new testcase( $this->dbObj ); - $this->tprojectMgr = new testproject( $this->dbObj ); - $this->tplanMgr = new testplan( $this->dbObj ); - $this->tplanMetricsMgr = new tlTestPlanMetrics( $this->dbObj ); - $this->reqSpecMgr = new requirement_spec_mgr( $this->dbObj ); - $this->reqMgr = new requirement_mgr( $this->dbObj ); - $this->userMgr = new tlUser( $this->dbObj ); + $this->tcaseMgr = new testcase($this->dbObj); + $this->tprojectMgr = new testproject($this->dbObj); + $this->tplanMgr = new testplan($this->dbObj); + $this->tplanMetricsMgr = new tlTestPlanMetrics($this->dbObj); + $this->reqSpecMgr = new requirement_spec_mgr($this->dbObj); + $this->reqMgr = new requirement_mgr($this->dbObj); + $this->userMgr = new tlUser($this->dbObj); - $this->tprojectMgr->setAuditEventSource( 'API-XMLRPC' ); + $this->tprojectMgr->setAuditEventSource('API-XMLRPC'); $this->tables = $this->tcaseMgr->getDBTables(); - $resultsCfg = config_get( 'results' ); - foreach( $resultsCfg['status_label_for_exec_ui'] as $key => $label ) { + $resultsCfg = config_get('results'); + foreach ($resultsCfg['status_label_for_exec_ui'] as $key => $label) { $this->statusCode[$key] = $resultsCfg['status_code'][$key]; } - if(isset( $this->statusCode['not_run'] )) { - unset( $this->statusCode['not_run'] ); + if (isset($this->statusCode['not_run'])) { + unset($this->statusCode['not_run']); } - $this->codeStatus = array_flip( $this->statusCode ); + $this->codeStatus = array_flip($this->statusCode); $this->initMethodYellowPages(); $this->methods += $callbacks; // after changing IXR_Server() constructor to __contructor() - parent::__construct( $this->methods ); + parent::__construct($this->methods); } /** */ - protected function _setArgs($args, $opt = null) { + protected function _setArgs($args, $opt = null) + { // TODO: should escape args $this->args = $args; - if(isset( $this->args[self::$testProjectNameParamName] ) && ! isset( $this->args[self::$testProjectIDParamName] )) { - $name = trim( $this->args[self::$testProjectNameParamName] ); - $projects = $this->tprojectMgr->get_by_name( $name ); - if (! is_null( $projects )) { - $info = current( $projects ); + if (isset($this->args[self::$testProjectNameParamName]) && + ! isset($this->args[self::$testProjectIDParamName])) { + $name = trim($this->args[self::$testProjectNameParamName]); + $projects = $this->tprojectMgr->get_by_name($name); + if (! is_null($projects)) { + $info = current($projects); $this->args[self::$testProjectIDParamName] = $info['id']; } } @@ -307,12 +424,13 @@ protected function _setArgs($args, $opt = null) { * @param int $buildID * @access protected */ - protected function _setBuildID($buildID) { - if(GENERAL_ERROR_CODE != $buildID) { + protected function _setBuildID($buildID) + { + if (GENERAL_ERROR_CODE != $buildID) { $this->args[self::$buildIDParamName] = $buildID; return true; } else { - $this->errors[] = new IXR_Error( INVALID_BUILDID, INVALID_BUILDID_STR ); + $this->errors[] = new IXR_Error(INVALID_BUILDID, INVALID_BUILDID_STR); return false; } } @@ -323,7 +441,8 @@ protected function _setBuildID($buildID) { * @param int $tcaseID * @access protected */ - protected function _setTestCaseID($tcaseID) { + protected function _setTestCaseID($tcaseID) + { $this->args[self::$testCaseIDParamName] = $tcaseID; } @@ -333,12 +452,13 @@ protected function _setTestCaseID($tcaseID) { * @return boolean * @access protected */ - protected function _setBuildID2Latest() { + protected function _setBuildID2Latest() + { $tplan_id = $this->args[self::$testPlanIDParamName]; - $maxbuildid = $this->tplanMgr->get_max_build_id( $tplan_id ); - $status_ok =($maxbuildid > 0); - if($status_ok) { - $this->_setBuildID( $maxbuildid ); + $maxbuildid = $this->tplanMgr->get_max_build_id($tplan_id); + $status_ok = ($maxbuildid > 0); + if ($status_ok) { + $this->_setBuildID($maxbuildid); } return $status_ok; } @@ -352,17 +472,20 @@ protected function _setBuildID2Latest() { * 20100731 - asimon - BUGID 3644(additional fix for BUGID 2607) * 20100711 - franciscom - BUGID 2607 - UTF8 settings for MySQL */ - protected function _connectToDB() { - if(true == $this->testMode) { - $this->dbObj->connect( TEST_DSN, TEST_DB_HOST, TEST_DB_USER, TEST_DB_PASS, TEST_DB_NAME ); + protected function _connectToDB() + { + if ($this->testMode) { + $this->dbObj->connect(TEST_DSN, TEST_DB_HOST, TEST_DB_USER, + TEST_DB_PASS, TEST_DB_NAME); } else { - $this->dbObj->connect( DSN, DB_HOST, DB_USER, DB_PASS, DB_NAME ); + $this->dbObj->connect(DSN, DB_HOST, DB_USER, DB_PASS, DB_NAME); } // asimon - BUGID 3644 & 2607 - $charSet was undefined here - $charSet = config_get( 'charset' ); - if((DB_TYPE == 'mysql') &&($charSet == 'UTF-8')) { - $this->dbObj->exec_query( "SET CHARACTER SET utf8" ); - $this->dbObj->exec_query( "SET collation_connection = 'utf8_general_ci'" ); + $charSet = config_get('charset'); + if ((DB_TYPE == 'mysql') && ($charSet == 'UTF-8')) { + $this->dbObj->exec_query("SET CHARACTER SET utf8"); + $this->dbObj->exec_query( + "SET collation_connection = 'utf8_general_ci'"); } } @@ -377,10 +500,12 @@ protected function _connectToDB() { * @return boolean * @access protected */ - protected function authenticate($messagePrefix = '') { + protected function authenticate($messagePrefix = '') + { // check that the key was given as part of the args - if(! $this->_isDevKeyPresent()) { - $this->errors[] = new IXR_ERROR( NO_DEV_KEY, $messagePrefix . NO_DEV_KEY_STR ); + if (! $this->_isDevKeyPresent()) { + $this->errors[] = new IXR_ERROR(NO_DEV_KEY, + $messagePrefix . NO_DEV_KEY_STR); $this->authenticated = false; return false; } else { @@ -388,16 +513,17 @@ protected function authenticate($messagePrefix = '') { } // make sure the key we have is valid - if(! $this->_isDevKeyValid( $this->devKey )) { - $this->errors[] = new IXR_Error( INVALID_AUTH, $messagePrefix . INVALID_AUTH_STR ); + if (! $this->_isDevKeyValid($this->devKey)) { + $this->errors[] = new IXR_Error(INVALID_AUTH, + $messagePrefix . INVALID_AUTH_STR); $this->authenticated = false; return false; } else { // Load User - $this->user = tlUser::getByID( $this->dbObj, $this->userID ); + $this->user = tlUser::getByID($this->dbObj, $this->userID); $this->authenticated = true; - $this->tlLogger->startTransaction( 'DEFAULT', null, $this->userID ); + $this->tlLogger->startTransaction('DEFAULT', null, $this->userID); return true; } } @@ -413,11 +539,13 @@ protected function authenticate($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkIsSystemWideAdmin($messagePrefix = '') { + protected function checkIsSystemWideAdmin($messagePrefix = '') + { $res = ($this->user->globalRole->dbID == TL_ROLES_ADMIN); - if (!$res) { - $this->errors[] = new IXR_Error( MUST_BE_ADMIN, $messagePrefix . MUST_BE_ADMIN_STR ); + if (! $res) { + $this->errors[] = new IXR_Error(MUST_BE_ADMIN, + $messagePrefix . MUST_BE_ADMIN_STR); } return $res; @@ -429,84 +557,98 @@ protected function checkIsSystemWideAdmin($messagePrefix = '') { * @param string $rightToCheck * one of the rights defined in rights table * @param boolean $checkPublicPrivateAttr - * (optional) - * @param map $context - * (optional) + * (optional) + * @param array $context + * (optional) * keys testprojectid,testplanid(both are also optional) * * @return boolean * @access protected * */ - protected function userHasRight($rightToCheck, $checkPublicPrivateAttr = false, $context = null) { + protected function userHasRight($rightToCheck, + $checkPublicPrivateAttr = false, $context = null) + { $status_ok = true; // Site admin has all rights if ($this->user->globalRole->dbID == TL_ROLES_ADMIN) { - return true; + return true; } - - $tprojectid = intval( isset( $context[self::$testProjectIDParamName] ) ? $context[self::$testProjectIDParamName] : 0 ); - if($tprojectid == 0 && isset( $this->args[self::$testProjectIDParamName] )) { + $tprojectid = intval( + isset($context[self::$testProjectIDParamName]) ? $context[self::$testProjectIDParamName] : 0); + + if ($tprojectid == 0 && + isset($this->args[self::$testProjectIDParamName])) { $tprojectid = $this->args[self::$testProjectIDParamName]; } - if(isset( $context[self::$testPlanIDParamName] )) { + if (isset($context[self::$testPlanIDParamName])) { $tplanid = $context[self::$testPlanIDParamName]; } else { - $tplanid = isset( $this->args[self::$testPlanIDParamName] ) ? $this->args[self::$testPlanIDParamName] : null; + $tplanid = isset($this->args[self::$testPlanIDParamName]) ? $this->args[self::$testPlanIDParamName] : null; } - $tprojectid = intval( $tprojectid ); - $tplanid = ! is_null( $tplanid ) ? intval( $tplanid ) : - 1; + $tprojectid = intval($tprojectid); + $tplanid = ! is_null($tplanid) ? intval($tplanid) : - 1; - if($tprojectid <= 0 && $tplanid > 0) { + if ($tprojectid <= 0 && $tplanid > 0) { // get test project from test plan $ox = array( - 'output' => 'minimun' + 'output' => 'minimun' ); - $dummy = $this->tplanMgr->get_by_id( $tplanid, $ox ); - $tprojectid = intval( $dummy['tproject_id'] ); + $dummy = $this->tplanMgr->get_by_id($tplanid, $ox); + $tprojectid = intval($dummy['tproject_id']); } // Contribution by frankfal // Some APIs only provide TestSuiteID or TestCaseID, look up TestProjectID - if ($tprojectid <= 0 && $tplanid == -1) { + if ($tprojectid <= 0 && $tplanid == - 1) { // Try using TestSuiteID to get TestProjectID - $tsuitid = intval( isset( $context[self::$testSuiteIDParamName] ) ? $context[self::$testSuiteIDParamName] : 0 ); - if($tsuiteid == 0 && isset( $this->args[self::$testSuiteIDParamName] )) { - $tsuiteid = intval( $this->args[self::$testSuiteIDParamName] ); + $tsuiteid = intval( + isset($context[self::$testSuiteIDParamName]) ? $context[self::$testSuiteIDParamName] : 0); + if ($tsuiteid == 0 && + isset($this->args[self::$testSuiteIDParamName])) { + $tsuiteid = intval($this->args[self::$testSuiteIDParamName]); } if ($tsuiteid > 0) { - $dummy = $this->tprojectMgr->tree_manager->get_path( $tsuiteid ); + $dummy = $this->tprojectMgr->tree_manager->get_path($tsuiteid); $tprojectid = $dummy[0]['parent_id']; } else { // Try using TestCaseID to get TestProjectID - $tcaseid = intval( isset( $context[self::$testCaseIDParamName] ) ? $context[self::$testCaseIDParamName] : 0 ); - if($tcaseid == 0 && isset( $this->args[self::$testCaseIDParamName] )) { - $tcaseid = intval( $this->args[self::$testCaseIDParamName] ); + $tcaseid = intval( + isset($context[self::$testCaseIDParamName]) ? $context[self::$testCaseIDParamName] : 0); + if ($tcaseid == 0 && + isset($this->args[self::$testCaseIDParamName])) { + $tcaseid = intval($this->args[self::$testCaseIDParamName]); } if ($tcaseid > 0) { - $tprojectid = $this->tcaseMgr->get_testproject( $tcaseid ); + $tprojectid = $this->tcaseMgr->get_testproject($tcaseid); } } } - if(! $this->user->hasRight( $this->dbObj, $rightToCheck, $tprojectid, $tplanid, $checkPublicPrivateAttr )) { + if (! $this->user->hasRight($this->dbObj, $rightToCheck, $tprojectid, + $tplanid, $checkPublicPrivateAttr)) { $status_ok = false; - $msg = sprintf( INSUFFICIENT_RIGHTS_STR, $this->user->login, $rightToCheck, $tprojectid, $tplanid ); - $this->errors[] = new IXR_Error( INSUFFICIENT_RIGHTS, $msg ); + $msg = sprintf(INSUFFICIENT_RIGHTS_STR, $this->user->login, + $rightToCheck, $tprojectid, $tplanid); + $this->errors[] = new IXR_Error(INSUFFICIENT_RIGHTS, $msg); } - if(isset( $context['updaterID'] )) { - $updUser = tlUser::getByID( $this->dbObj, intval( $context['updaterID'] ) ); + if (isset($context['updaterID'])) { + $updUser = tlUser::getByID($this->dbObj, + intval($context['updaterID'])); - $sk = $updUser->hasRight( $this->dbObj, $rightToCheck, $tprojectid, $tplanid, $checkPublicPrivateAttr ); - if(! $sk) { + $sk = $updUser->hasRight($this->dbObj, $rightToCheck, $tprojectid, + $tplanid, $checkPublicPrivateAttr); + if (! $sk) { $status_ok = false; - $msg = sprintf( UPDATER_INSUFFICIENT_RIGHTS_STR, $updUser->login, $rightToCheck, $tprojectid, $tplanid ); - $this->errors[] = new IXR_Error( UPDATER_INSUFFICIENT_RIGHTS, $msg ); + $msg = sprintf(UPDATER_INSUFFICIENT_RIGHTS_STR, $updUser->login, + $rightToCheck, $tprojectid, $tplanid); + $this->errors[] = new IXR_Error(UPDATER_INSUFFICIENT_RIGHTS, + $msg); } } @@ -521,15 +663,17 @@ protected function userHasRight($rightToCheck, $checkPublicPrivateAttr = false, * @return boolean * @access protected */ - protected function checkTestCaseName() { + protected function checkTestCaseName() + { $status = true; - if(! $this->_isTestCaseNamePresent()) { - $this->errors[] = new IXR_Error( NO_TESTCASENAME, NO_TESTCASENAME_STR ); + if (! $this->_isTestCaseNamePresent()) { + $this->errors[] = new IXR_Error(NO_TESTCASENAME, NO_TESTCASENAME_STR); $status = false; } else { $testCaseName = $this->args[self::$testCaseNameParamName]; - if(! is_string( $testCaseName )) { - $this->errors[] = new IXR_Error( TESTCASENAME_NOT_STRING, TESTCASENAME_NOT_STRING_STR ); + if (! is_string($testCaseName)) { + $this->errors[] = new IXR_Error(TESTCASENAME_NOT_STRING, + TESTCASENAME_NOT_STRING_STR); $status = false; } } @@ -544,14 +688,17 @@ protected function checkTestCaseName() { * @return boolean * @access protected */ - protected function checkStatus() { - if(($status = $this->_isStatusPresent())) { - if(!($status = $this->_isStatusValid( $this->args[self::$statusParamName] ))) { - $msg = sprintf( INVALID_STATUS_STR, $this->args[self::$statusParamName] ); - $this->errors[] = new IXR_Error( INVALID_STATUS, $msg ); + protected function checkStatus() + { + if ($status = $this->_isStatusPresent()) { + if (! ($status = $this->_isStatusValid( + $this->args[self::$statusParamName]))) { + $msg = sprintf(INVALID_STATUS_STR, + $this->args[self::$statusParamName]); + $this->errors[] = new IXR_Error(INVALID_STATUS, $msg); } } else { - $this->errors[] = new IXR_Error( NO_STATUS, NO_STATUS_STR ); + $this->errors[] = new IXR_Error(NO_STATUS, NO_STATUS_STR); } return $status; } @@ -567,17 +714,19 @@ protected function checkStatus() { * @return boolean * @access protected */ - protected function checkTestCaseID($messagePrefix = '') { + protected function checkTestCaseID($messagePrefix = '') + { $msg = $messagePrefix; $status_ok = $this->_isTestCaseIDPresent(); - if($status_ok) { + if ($status_ok) { $tcaseid = $this->args[self::$testCaseIDParamName]; - if(! $this->_isTestCaseIDValid( $tcaseid )) { - $this->errors[] = new IXR_Error( INVALID_TCASEID, $msg . INVALID_TCASEID_STR ); + if (! $this->_isTestCaseIDValid($tcaseid)) { + $this->errors[] = new IXR_Error(INVALID_TCASEID, + $msg . INVALID_TCASEID_STR); $status_ok = false; } } else { - $this->errors[] = new IXR_Error( NO_TCASEID, $msg . NO_TCASEID_STR ); + $this->errors[] = new IXR_Error(NO_TCASEID, $msg . NO_TCASEID_STR); } return $status_ok; } @@ -593,17 +742,21 @@ protected function checkTestCaseID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkTestCaseVersionID($messagePrefix = '') { + protected function checkTestCaseVersionID($messagePrefix = '') + { $msg = $messagePrefix; $status_ok = $this->_isTestCaseVersionIDPresent(); - if($status_ok) { + if ($status_ok) { $tcaseversionid = $this->args[self::$testCaseVersionIDParamName]; - if(! $this->_isTestCaseVersionIDValid( $tcaseversionid, "checkTestCaseVersionID", true )) { - $this->errors[] = new IXR_Error( INVALID_TCASEVERSIONID, sprintf($msg . INVALID_TCASEVERSIONID_STR, $tcaseversionid) ); + if (! $this->_isTestCaseVersionIDValid($tcaseversionid, + "checkTestCaseVersionID", true)) { + $this->errors[] = new IXR_Error(INVALID_TCASEVERSIONID, + sprintf($msg . INVALID_TCASEVERSIONID_STR, $tcaseversionid)); $status_ok = false; } } else { - $this->errors[] = new IXR_Error( NO_TCASEVERSIONID, $msg . NO_TCASEVERSIONID_STR ); + $this->errors[] = new IXR_Error(NO_TCASEVERSIONID, + $msg . NO_TCASEVERSIONID_STR); } return $status_ok; } @@ -619,25 +772,30 @@ protected function checkTestCaseVersionID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkTestPlanID($messagePrefix = '') { + protected function checkTestPlanID($messagePrefix = '') + { $status = true; - if(! $this->_isTestPlanIDPresent()) { + if (! $this->_isTestPlanIDPresent()) { $msg = $messagePrefix . NO_TPLANID_STR; - $this->errors[] = new IXR_Error( NO_TPLANID, $msg ); + $this->errors[] = new IXR_Error(NO_TPLANID, $msg); $status = false; } else { // See if this TPID exists in the db - $tplanid = $this->dbObj->prepare_int( $this->args[self::$testPlanIDParamName] ); + $tplanid = $this->dbObj->prepare_int( + $this->args[self::$testPlanIDParamName]); $query = "SELECT id FROM {$this->tables['testplans']} WHERE id={$tplanid}"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - if(null == $result) { - $msg = $messagePrefix . sprintf( INVALID_TPLANID_STR, $tplanid ); - $this->errors[] = new IXR_Error( INVALID_TPLANID, $msg ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + if (null == $result) { + $msg = $messagePrefix . sprintf(INVALID_TPLANID_STR, $tplanid); + $this->errors[] = new IXR_Error(INVALID_TPLANID, $msg); $status = false; } else { // tplanid exists and its valid // Do we need to try to guess build id ? - if($this->checkGuess() &&(! $this->_isBuildIDPresent() && ! $this->_isParamPresent( self::$buildNameParamName, $messagePrefix ))) { + if ($this->checkGuess() && + (! $this->_isBuildIDPresent() && + ! $this->_isParamPresent(self::$buildNameParamName, + $messagePrefix))) { $status = $this->_setBuildID2Latest(); } } @@ -656,17 +814,21 @@ protected function checkTestPlanID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkTestProjectID($messagePrefix = '') { - if(!($status = $this->_isTestProjectIDPresent())) { - $this->errors[] = new IXR_Error( NO_TESTPROJECTID, $messagePrefix . NO_TESTPROJECTID_STR ); + protected function checkTestProjectID($messagePrefix = '') + { + if (! ($status = $this->_isTestProjectIDPresent())) { + $this->errors[] = new IXR_Error(NO_TESTPROJECTID, + $messagePrefix . NO_TESTPROJECTID_STR); } else { // See if this Test Project ID exists in the db - $testprojectid = $this->dbObj->prepare_int( $this->args[self::$testProjectIDParamName] ); + $testprojectid = $this->dbObj->prepare_int( + $this->args[self::$testProjectIDParamName]); $query = "SELECT id FROM {$this->tables['testprojects']} WHERE id={$testprojectid}"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - if(null == $result) { - $msg = $messagePrefix . sprintf( INVALID_TESTPROJECTID_STR, $testprojectid ); - $this->errors[] = new IXR_Error( INVALID_TESTPROJECTID, $msg ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + if (null == $result) { + $msg = $messagePrefix . + sprintf(INVALID_TESTPROJECTID_STR, $testprojectid); + $this->errors[] = new IXR_Error(INVALID_TESTPROJECTID, $msg); $status = false; } } @@ -689,29 +851,29 @@ protected function checkTestProjectID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkTestProjectIdentity($messagePrefix = '') { + protected function checkTestProjectIdentity($messagePrefix = '') + { $status = false; - $fromExternal = false; - $fromInternal = false; - if($this->_isTestProjectIDPresent()) { - $fromInternal = true; - $status = $this->checkTestProjectID( $messagePrefix ); - } else if($this->_isParamPresent( self::$prefixParamName, $messagePrefix, true )) { - // Go for the prefix - $fromExternal = true; + if ($this->_isTestProjectIDPresent()) { + $status = $this->checkTestProjectID($messagePrefix); + } elseif ($this->_isParamPresent(self::$prefixParamName, $messagePrefix, + true)) { - $target = $this->dbObj->prepare_string( $this->args[self::$prefixParamName] ); + $target = $this->dbObj->prepare_string( + $this->args[self::$prefixParamName]); $sql = " SELECT id FROM {$this->tables['testprojects']} WHERE prefix='{$target}' "; - $fieldValue = $this->dbObj->fetchFirstRowSingleColumn( $sql, "id" ); - $status =(! is_null( $fieldValue ) &&(intval( $fieldValue ) > 0)); - if($status) { + $fieldValue = $this->dbObj->fetchFirstRowSingleColumn($sql, "id"); + $status = (! is_null($fieldValue) && (intval($fieldValue) > 0)); + if ($status) { $this->args[self::$testProjectIDParamName] = $fieldValue; } else { $status = false; - $msg = $messagePrefix . sprintf( TPROJECT_PREFIX_DOESNOT_EXIST_STR, $target ); - $this->errors[] = new IXR_Error( TPROJECT_PREFIX_DOESNOT_EXIST, $msg ); + $msg = $messagePrefix . + sprintf(TPROJECT_PREFIX_DOESNOT_EXIST_STR, $target); + $this->errors[] = new IXR_Error(TPROJECT_PREFIX_DOESNOT_EXIST, + $msg); } } else { $status = false; @@ -720,7 +882,6 @@ protected function checkTestProjectIdentity($messagePrefix = '') { return $status; } - /** * Helper method to see if the UserID provided is valid * @@ -732,17 +893,20 @@ protected function checkTestProjectIdentity($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkUserID($messagePrefix = '') { - if(!($status = $this->_isUserIDPresent())) { - $this->errors[] = new IXR_Error( NO_USERID, $messagePrefix . NO_USERID_STR ); + protected function checkUserID($messagePrefix = '') + { + if (! ($status = $this->_isUserIDPresent())) { + $this->errors[] = new IXR_Error(NO_USERID, + $messagePrefix . NO_USERID_STR); } else { // See if this user ID exists in the DB - $userid = $this->dbObj->prepare_int( $this->args[self::$userIDParamName] ); + $userid = $this->dbObj->prepare_int( + $this->args[self::$userIDParamName]); $query = "SELECT id FROM {$this->tables['users']} WHERE id={$userid}"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - if(null == $result) { - $msg = $messagePrefix . sprintf( INVALID_USERID_STR, $userid ); - $this->errors[] = new IXR_Error( INVALID_USERID, $msg ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + if (null == $result) { + $msg = $messagePrefix . sprintf(INVALID_USERID_STR, $userid); + $this->errors[] = new IXR_Error(INVALID_USERID, $msg); $status = false; } } @@ -765,29 +929,28 @@ protected function checkUserID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkUserIdentity($messagePrefix = '') { + protected function checkUserIdentity($messagePrefix = '') + { $status = false; - $fromExternal = false; - $fromInternal = false; - if($this->_isUserIDPresent()) { - $fromInternal = true; - $status = $this->checkUserID( $messagePrefix ); - } else if($this->_isParamPresent( self::$userLoginParamName, $messagePrefix, true )) { - // Go from the login - $fromExternal = true; + if ($this->_isUserIDPresent()) { + $status = $this->checkUserID($messagePrefix); + } elseif ($this->_isParamPresent(self::$userLoginParamName, + $messagePrefix, true)) { - $target = $this->dbObj->prepare_string( $this->args[self::$userLoginParamName] ); + $target = $this->dbObj->prepare_string( + $this->args[self::$userLoginParamName]); $sql = " SELECT id FROM {$this->tables['users']} WHERE login='{$target}' "; - $fieldValue = $this->dbObj->fetchFirstRowSingleColumn( $sql, "id" ); - $status =(! is_null( $fieldValue ) &&(intval( $fieldValue ) > 0)); - if($status) { + $fieldValue = $this->dbObj->fetchFirstRowSingleColumn($sql, "id"); + $status = (! is_null($fieldValue) && (intval($fieldValue) > 0)); + if ($status) { $this->args[self::$UserIDParamName] = $fieldValue; } else { $status = false; - $msg = $messagePrefix . sprintf( USER_LOGIN_DOESNOT_EXIST_STR, $target ); - $this->errors[] = new IXR_Error( USER_LOGIN_DOESNOT_EXIST, $msg ); + $msg = $messagePrefix . + sprintf(USER_LOGIN_DOESNOT_EXIST_STR, $target); + $this->errors[] = new IXR_Error(USER_LOGIN_DOESNOT_EXIST, $msg); } } else { $status = false; @@ -807,17 +970,20 @@ protected function checkUserIdentity($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkRoleID($messagePrefix = '') { - if(!($status = $this->_isRoleIDPresent())) { - $this->errors[] = new IXR_Error( NO_ROLEID, $messagePrefix . NO_ROLEID_STR ); + protected function checkRoleID($messagePrefix = '') + { + if (! ($status = $this->_isRoleIDPresent())) { + $this->errors[] = new IXR_Error(NO_ROLEID, + $messagePrefix . NO_ROLEID_STR); } else { // See if this role ID exists in the DB - $roleid = $this->dbObj->prepare_int( $this->args[self::$roleIDParamName] ); + $roleid = $this->dbObj->prepare_int( + $this->args[self::$roleIDParamName]); $query = "SELECT id FROM {$this->tables['roles']} WHERE id={$roleid}"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - if(null == $result) { - $msg = $messagePrefix . sprintf( INVALID_ROLEID_STR, $roleid ); - $this->errors[] = new IXR_Error( INVALID_ROLEID, $msg ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + if (null == $result) { + $msg = $messagePrefix . sprintf(INVALID_ROLEID_STR, $roleid); + $this->errors[] = new IXR_Error(INVALID_ROLEID, $msg); $status = false; } } @@ -840,28 +1006,27 @@ protected function checkRoleID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkRoleIdentity($messagePrefix = '') { + protected function checkRoleIdentity($messagePrefix = '') + { $status = false; - $fromExternal = false; - $fromInternal = false; - if($this->_isRoleIDPresent()) { - $fromInternal = true; - $status = $this->checkRoleID( $messagePrefix ); - } else if($this->_isParamPresent( self::$roleNameParamName, $messagePrefix, true )) { - // Go from the name - $fromExternal = true; + if ($this->_isRoleIDPresent()) { + $status = $this->checkRoleID($messagePrefix); + } elseif ($this->_isParamPresent(self::$roleNameParamName, + $messagePrefix, true)) { - $target = $this->dbObj->prepare_string( $this->args[self::$roleNameParamName] ); + $target = $this->dbObj->prepare_string( + $this->args[self::$roleNameParamName]); $sql = " SELECT id FROM {$this->tables['roles']} WHERE description='{$target}' "; - $fieldValue = $this->dbObj->fetchFirstRowSingleColumn( $sql, "id" ); - $status =(! is_null( $fieldValue ) && (intval( $fieldValue ) > 0)); - if($status) { + $fieldValue = $this->dbObj->fetchFirstRowSingleColumn($sql, "id"); + $status = (! is_null($fieldValue) && (intval($fieldValue) > 0)); + if ($status) { $this->args[self::$roleIDParamName] = $fieldValue; } else { - $msg = $messagePrefix . sprintf( ROLE_NAME_DOESNOT_EXIST_STR, $target ); - $this->errors[] = new IXR_Error( ROLE_NAME_DOESNOT_EXIST, $msg ); + $msg = $messagePrefix . + sprintf(ROLE_NAME_DOESNOT_EXIST_STR, $target); + $this->errors[] = new IXR_Error(ROLE_NAME_DOESNOT_EXIST, $msg); } } else { $status = false; @@ -881,16 +1046,21 @@ protected function checkRoleIdentity($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkTestSuiteID($messagePrefix = '') { - if(!($status = $this->_isTestSuiteIDPresent())) { - $this->errors[] = new IXR_Error( NO_TESTSUITEID, $messagePrefix . NO_TESTSUITEID_STR ); + protected function checkTestSuiteID($messagePrefix = '') + { + if (! ($status = $this->_isTestSuiteIDPresent())) { + $this->errors[] = new IXR_Error(NO_TESTSUITEID, + $messagePrefix . NO_TESTSUITEID_STR); } else { // See if this Test Suite ID exists in the db - $tsuiteMgr = new testsuite( $this->dbObj ); - $node_info = $tsuiteMgr->get_by_id( $this->args[self::$testSuiteIDParamName] ); - if(!($status = ! is_null( $node_info ))) { - $msg = $messagePrefix . sprintf( INVALID_TESTSUITEID_STR, $this->args[self::$testSuiteIDParamName] ); - $this->errors[] = new IXR_Error( INVALID_TESTSUITEID, $msg ); + $tsuiteMgr = new testsuite($this->dbObj); + $node_info = $tsuiteMgr->get_by_id( + $this->args[self::$testSuiteIDParamName]); + if (! ($status = ! is_null($node_info))) { + $msg = $messagePrefix . + sprintf(INVALID_TESTSUITEID_STR, + $this->args[self::$testSuiteIDParamName]); + $this->errors[] = new IXR_Error(INVALID_TESTSUITEID, $msg); } } return $status; @@ -906,9 +1076,10 @@ protected function checkTestSuiteID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkGuess() { + protected function checkGuess() + { // if guess is set return its value otherwise return true to guess by default - return($this->_isGuessPresent() ? $this->args[self::$guessParamName] : self::BUILD_GUESS_DEFAULT_MODE); + return $this->_isGuessPresent() ? $this->args[self::$guessParamName] : self::BUILD_GUESS_DEFAULT_MODE; } /** @@ -923,30 +1094,36 @@ protected function checkGuess() { * * @internal revision */ - protected function checkBuildID($msg_prefix) { + protected function checkBuildID($msg_prefix) + { $tplan_id = $this->args[self::$testPlanIDParamName]; $status = true; $try_again = false; // First thing is to know is test plan has any build - $buildQty = $this->tplanMgr->getNumberOfBuilds( $tplan_id ); - if($buildQty == 0) { + $buildQty = $this->tplanMgr->getNumberOfBuilds($tplan_id); + if ($buildQty == 0) { $status = false; - $tplan_info = $this->tplanMgr->get_by_id( $tplan_id ); - $msg = $msg_prefix . sprintf( TPLAN_HAS_NO_BUILDS_STR, $tplan_info['name'], $tplan_info['id'] ); - $this->errors[] = new IXR_Error( TPLAN_HAS_NO_BUILDS, $msg ); + $tplan_info = $this->tplanMgr->get_by_id($tplan_id); + $msg = $msg_prefix . + sprintf(TPLAN_HAS_NO_BUILDS_STR, $tplan_info['name'], + $tplan_info['id']); + $this->errors[] = new IXR_Error(TPLAN_HAS_NO_BUILDS, $msg); } - if($status) { - if(! $this->_isBuildIDPresent()) { + if ($status) { + if (! $this->_isBuildIDPresent()) { $try_again = true; - if($this->_isBuildNamePresent()) { + if ($this->_isBuildNamePresent()) { $try_again = false; - $bname = trim( $this->args[self::$buildNameParamName] ); - $buildInfo = $this->tplanMgr->get_build_by_name( $tplan_id, $bname ); - if(is_null( $buildInfo )) { - $msg = $msg_prefix . sprintf( BUILDNAME_DOES_NOT_EXIST_STR, $bname ); - $this->errors[] = new IXR_Error( BUILDNAME_DOES_NOT_EXIST, $msg ); + $bname = trim($this->args[self::$buildNameParamName]); + $buildInfo = $this->tplanMgr->get_build_by_name($tplan_id, + $bname); + if (is_null($buildInfo)) { + $msg = $msg_prefix . + sprintf(BUILDNAME_DOES_NOT_EXIST_STR, $bname); + $this->errors[] = new IXR_Error( + BUILDNAME_DOES_NOT_EXIST, $msg); $status = false; } else { $this->args[self::$buildIDParamName] = $buildInfo['id']; @@ -954,27 +1131,31 @@ protected function checkBuildID($msg_prefix) { } } - if($try_again) { + if ($try_again) { // this means we aren't supposed to guess the buildid - if(false == $this->checkGuess()) { - $this->errors[] = new IXR_Error( NO_BUILDID, NO_BUILDID_STR ); + if (! $this->checkGuess()) { + $this->errors[] = new IXR_Error(NO_BUILDID, NO_BUILDID_STR); $status = false; } else { $setBuildResult = $this->_setBuildID2Latest(); - if(false == $setBuildResult) { - $this->errors[] = new IXR_Error( NO_BUILD_FOR_TPLANID, NO_BUILD_FOR_TPLANID_STR ); + if (! $setBuildResult) { + $this->errors[] = new IXR_Error(NO_BUILD_FOR_TPLANID, + NO_BUILD_FOR_TPLANID_STR); $status = false; } } } - if($status) { - $buildID = $this->dbObj->prepare_int( $this->args[self::$buildIDParamName] ); - $buildInfo = $this->tplanMgr->get_build_by_id( $tplan_id, $buildID ); - if(is_null( $buildInfo )) { - $tplan_info = $this->tplanMgr->get_by_id( $tplan_id ); - $msg = sprintf( BAD_BUILD_FOR_TPLAN_STR, $buildID, $tplan_info['name'], $tplan_id ); - $this->errors[] = new IXR_Error( BAD_BUILD_FOR_TPLAN, $msg ); + if ($status) { + $buildID = $this->dbObj->prepare_int( + $this->args[self::$buildIDParamName]); + $buildInfo = $this->tplanMgr->get_build_by_id($tplan_id, + $buildID); + if (is_null($buildInfo)) { + $tplan_info = $this->tplanMgr->get_by_id($tplan_id); + $msg = sprintf(BAD_BUILD_FOR_TPLAN_STR, $buildID, + $tplan_info['name'], $tplan_id); + $this->errors[] = new IXR_Error(BAD_BUILD_FOR_TPLAN, $msg); $status = false; } } @@ -998,11 +1179,14 @@ protected function checkBuildID($msg_prefix) { * * */ - protected function _isParamPresent($pname, $messagePrefix = '', $setError = false) { - $status_ok =(isset( $this->args[$pname] ) ? true : false); - if(! $status_ok && $setError) { - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $pname ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + protected function _isParamPresent($pname, $messagePrefix = '', + $setError = false) + { + $status_ok = (isset($this->args[$pname]) ? true : false); + if (! $status_ok && $setError) { + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } return $status_ok; } @@ -1013,8 +1197,9 @@ protected function _isParamPresent($pname, $messagePrefix = '', $setError = fals * @return boolean * @access protected */ - protected function _isStatusValid($status) { - return(in_array( $status, $this->statusCode )); + protected function _isStatusValid($status) + { + return in_array($status, $this->statusCode); } /** @@ -1023,8 +1208,9 @@ protected function _isStatusValid($status) { * @return boolean * @access protected */ - protected function _isTestCaseNamePresent() { - return(isset( $this->args[self::$testCaseNameParamName] ) ? true : false); + protected function _isTestCaseNamePresent() + { + return isset($this->args[self::$testCaseNameParamName]) ? true : false; } /** @@ -1033,9 +1219,9 @@ protected function _isTestCaseNamePresent() { * @return boolean * @access protected */ - protected function _isTestCaseExternalIDPresent() { - $status = isset( $this->args[self::$testCaseExternalIDParamName] ) ? true : false; - return $status; + protected function _isTestCaseExternalIDPresent() + { + return isset($this->args[self::$testCaseExternalIDParamName]) ? true : false; } /** @@ -1045,8 +1231,9 @@ protected function _isTestCaseExternalIDPresent() { * @return boolean * @access protected */ - protected function _isTimeStampPresent() { - return(isset( $this->args[self::$timeStampParamName] ) ? true : false); + protected function _isTimeStampPresent() + { + return isset($this->args[self::$timeStampParamName]) ? true : false; } /** @@ -1055,8 +1242,9 @@ protected function _isTimeStampPresent() { * @return boolean * @access protected */ - protected function _isBuildIDPresent() { - return(isset( $this->args[self::$buildIDParamName] ) ? true : false); + protected function _isBuildIDPresent() + { + return isset($this->args[self::$buildIDParamName]) ? true : false; } /** @@ -1065,9 +1253,9 @@ protected function _isBuildIDPresent() { * @return boolean * @access protected */ - protected function _isBuildNamePresent() { - $status = isset( $this->args[self::$buildNameParamName] ) ? true : false; - return $status; + protected function _isBuildNamePresent() + { + return isset($this->args[self::$buildNameParamName]) ? true : false; } /** @@ -1076,8 +1264,9 @@ protected function _isBuildNamePresent() { * @return boolean * @access protected */ - protected function _isBuildNotePresent() { - return(isset( $this->args[self::$buildNotesParamName] ) ? true : false); + protected function _isBuildNotePresent() + { + return isset($this->args[self::$buildNotesParamName]) ? true : false; } /** @@ -1086,8 +1275,9 @@ protected function _isBuildNotePresent() { * @return boolean * @access protected */ - protected function _isTestSuiteIDPresent() { - return(isset( $this->args[self::$testSuiteIDParamName] ) ? true : false); + protected function _isTestSuiteIDPresent() + { + return isset($this->args[self::$testSuiteIDParamName]) ? true : false; } /** @@ -1096,8 +1286,9 @@ protected function _isTestSuiteIDPresent() { * @return boolean * @access protected */ - protected function _isNotePresent() { - return(isset( $this->args[self::$noteParamName] ) ? true : false); + protected function _isNotePresent() + { + return isset($this->args[self::$noteParamName]) ? true : false; } /** @@ -1106,8 +1297,9 @@ protected function _isNotePresent() { * @return boolean * @access protected */ - protected function _isTestPlanIDPresent() { - return(isset( $this->args[self::$testPlanIDParamName] ) ? true : false); + protected function _isTestPlanIDPresent() + { + return isset($this->args[self::$testPlanIDParamName]) ? true : false; } /** @@ -1116,8 +1308,9 @@ protected function _isTestPlanIDPresent() { * @return boolean * @access protected */ - protected function _isTestProjectIDPresent() { - return(isset( $this->args[self::$testProjectIDParamName] ) ? true : false); + protected function _isTestProjectIDPresent() + { + return isset($this->args[self::$testProjectIDParamName]) ? true : false; } /** @@ -1126,8 +1319,9 @@ protected function _isTestProjectIDPresent() { * @return boolean * @access protected */ - protected function _isUserIDPresent() { - return(isset( $this->args[self::$userIDParamName] )); + protected function _isUserIDPresent() + { + return isset($this->args[self::$userIDParamName]); } /** @@ -1136,8 +1330,9 @@ protected function _isUserIDPresent() { * @return boolean * @access protected */ - protected function _isRoleIDPresent() { - return(isset( $this->args[self::$roleIDParamName] )); + protected function _isRoleIDPresent() + { + return isset($this->args[self::$roleIDParamName]); } /** @@ -1146,8 +1341,9 @@ protected function _isRoleIDPresent() { * @return boolean * @access protected */ - protected function _isRequirementIDPresent() { - return(isset( $this->args[self::$requirementIDParamName] )); + protected function _isRequirementIDPresent() + { + return isset($this->args[self::$requirementIDParamName]); } /** @@ -1156,8 +1352,9 @@ protected function _isRequirementIDPresent() { * @return boolean * @access protected */ - protected function _isRequirementDocIDPresent() { - return(isset( $this->args[self::$requirementDocIDParamName] )); + protected function _isRequirementDocIDPresent() + { + return isset($this->args[self::$requirementDocIDParamName]); } /** @@ -1166,8 +1363,9 @@ protected function _isRequirementDocIDPresent() { * @return boolean * @access protected */ - protected function _isRequirementVersionIDPresent() { - return(isset( $this->args[self::$requirementVersionIDParamName] )); + protected function _isRequirementVersionIDPresent() + { + return isset($this->args[self::$requirementVersionIDParamName]); } /** @@ -1176,8 +1374,9 @@ protected function _isRequirementVersionIDPresent() { * @return boolean * @access protected */ - protected function _isAutomatedPresent() { - return(isset( $this->args[self::$automatedParamName] ) ? true : false); + protected function _isAutomatedPresent() + { + return isset($this->args[self::$automatedParamName]) ? true : false; } /** @@ -1186,8 +1385,9 @@ protected function _isAutomatedPresent() { * @return boolean * @access protected */ - protected function _isTestModePresent() { - return(isset( $this->args[self::$testModeParamName] ) ? true : false); + protected function _isTestModePresent() + { + return isset($this->args[self::$testModeParamName]) ? true : false; } /** @@ -1196,8 +1396,9 @@ protected function _isTestModePresent() { * @return boolean * @access protected */ - protected function _isDevKeyPresent() { - return(isset( $this->args[self::$devKeyParamName] ) ? true : false); + protected function _isDevKeyPresent() + { + return isset($this->args[self::$devKeyParamName]) ? true : false; } /** @@ -1206,8 +1407,9 @@ protected function _isDevKeyPresent() { * @return boolean * @access protected */ - protected function _isTestCaseIDPresent() { - return(isset( $this->args[self::$testCaseIDParamName] ) ? true : false); + protected function _isTestCaseIDPresent() + { + return isset($this->args[self::$testCaseIDParamName]) ? true : false; } /** @@ -1216,8 +1418,9 @@ protected function _isTestCaseIDPresent() { * @return boolean * @access protected */ - protected function _isTestCaseVersionIDPresent() { - return(isset( $this->args[self::$testCaseVersionIDParamName] ) ? true : false); + protected function _isTestCaseVersionIDPresent() + { + return isset($this->args[self::$testCaseVersionIDParamName]) ? true : false; } /** @@ -1226,9 +1429,9 @@ protected function _isTestCaseVersionIDPresent() { * @return boolean * @access protected */ - protected function _isGuessPresent() { - $status = isset( $this->args[self::$guessParamName] ) ? true : false; - return $status; + protected function _isGuessPresent() + { + return isset($this->args[self::$guessParamName]) ? true : false; } /** @@ -1237,8 +1440,9 @@ protected function _isGuessPresent() { * @return boolean * @access protected */ - protected function _isTestSuiteNamePresent() { - return(isset( $this->args[self::$testSuiteNameParamName] ) ? true : false); + protected function _isTestSuiteNamePresent() + { + return isset($this->args[self::$testSuiteNameParamName]) ? true : false; } /** @@ -1247,8 +1451,9 @@ protected function _isTestSuiteNamePresent() { * @return boolean * @access protected */ - protected function _isDeepPresent() { - return(isset( $this->args[self::$deepParamName] ) ? true : false); + protected function _isDeepPresent() + { + return isset($this->args[self::$deepParamName]) ? true : false; } /** @@ -1257,8 +1462,9 @@ protected function _isDeepPresent() { * @return boolean * @access protected */ - protected function _isStatusPresent() { - return(isset( $this->args[self::$statusParamName] ) ? true : false); + protected function _isStatusPresent() + { + return isset($this->args[self::$statusParamName]) ? true : false; } /** @@ -1273,16 +1479,23 @@ protected function _isStatusPresent() { * @return boolean * @access protected */ - protected function _isTestCaseIDValid($tcaseid, $messagePrefix = '', $setError = false) { - $status_ok = is_numeric( $tcaseid ); - if($status_ok) { + protected function _isTestCaseIDValid($tcaseid, $messagePrefix = '', + $setError = false) + { + $status_ok = is_numeric($tcaseid); + if ($status_ok) { // must be of type 'testcase' and show up in the nodes_hierarchy - $tcaseid = $this->dbObj->prepare_int( $tcaseid ); - $query = " SELECT NH.id AS id " . " FROM {$this->tables['nodes_hierarchy']} NH, " . " {$this->tables['node_types']} NT " . " WHERE NH.id={$tcaseid} AND node_type_id=NT.id " . " AND NT.description='testcase'"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - $status_ok = is_null( $result ) ? false : true; - } else if($setError) { - $this->errors[] = new IXR_Error( TCASEID_NOT_INTEGER, $messagePrefix . TCASEID_NOT_INTEGER_STR ); + $tcaseid = $this->dbObj->prepare_int($tcaseid); + $query = " SELECT NH.id AS id " . + " FROM {$this->tables['nodes_hierarchy']} NH, " . + " {$this->tables['node_types']} NT " . + " WHERE NH.id={$tcaseid} AND node_type_id=NT.id " . + " AND NT.description='testcase'"; + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + $status_ok = is_null($result) ? false : true; + } elseif ($setError) { + $this->errors[] = new IXR_Error(TCASEID_NOT_INTEGER, + $messagePrefix . TCASEID_NOT_INTEGER_STR); } return $status_ok; } @@ -1299,16 +1512,19 @@ protected function _isTestCaseIDValid($tcaseid, $messagePrefix = '', $setError = * @return boolean * @access protected */ - protected function _isTestCaseVersionIDValid($tcaseversionid, $messagePrefix = '', $setError = false) { - $status_ok = is_numeric( $tcaseversionid ); - if($status_ok) { + protected function _isTestCaseVersionIDValid($tcaseversionid, + $messagePrefix = '', $setError = false) + { + $status_ok = is_numeric($tcaseversionid); + if ($status_ok) { // must be of type 'testcaseversion' and show up in the nodes_hierarchy - $tcaseversionid = $this->dbObj->prepare_int( $tcaseversionid ); + $tcaseversionid = $this->dbObj->prepare_int($tcaseversionid); $query = "SELECT NH.id AS id FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['node_types']} NT WHERE NH.id={$tcaseversionid} AND node_type_id=NT.id AND NT.description='testcase_version'"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - $status_ok = is_null( $result ) ? false : true; - } else if($setError) { - $this->errors[] = new IXR_Error( TCASEVERSIONID_NOT_INTEGER, $messagePrefix . TCASEVERSIONID_NOT_INTEGER_STR ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + $status_ok = is_null($result) ? false : true; + } elseif ($setError) { + $this->errors[] = new IXR_Error(TCASEVERSIONID_NOT_INTEGER, + $messagePrefix . TCASEVERSIONID_NOT_INTEGER_STR); } return $status_ok; } @@ -1320,20 +1536,17 @@ protected function _isTestCaseVersionIDValid($tcaseversionid, $messagePrefix = ' * @return boolean * @access protected */ - protected function _isDevKeyValid($devKey) { - if(null == $devKey || "" == $devKey) { + protected function _isDevKeyValid($devKey) + { + if (null == $devKey || "" == $devKey) { return false; } else { $this->userID = null; - $this->devKey = $this->dbObj->prepare_string( $devKey ); + $this->devKey = $this->dbObj->prepare_string($devKey); $query = "SELECT id FROM {$this->tables['users']} WHERE script_key='{$this->devKey}'"; - $this->userID = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); + $this->userID = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); - if(null == $this->userID) { - return false; - } else { - return true; - } + return null == $this->userID; } } @@ -1344,51 +1557,60 @@ protected function _isDevKeyValid($devKey) { * @return boolean * @access protected */ - protected function _setTCVersion() { + protected function _setTCVersion() + { // TODO: Implement } /** * Helper method to See if the tcid and tplanid are valid together * - * @param map $platformInfo + * @param array $platformInfo * key: platform ID * @param string $messagePrefix * used to be prepended to error message * @return boolean * @access protected */ - protected function _checkTCIDAndTPIDValid($platformInfo = null, $messagePrefix = '') { + protected function _checkTCIDAndTPIDValid($platformInfo = null, + $messagePrefix = '') + { $tplan_id = $this->args[self::$testPlanIDParamName]; $tcase_id = $this->args[self::$testCaseIDParamName]; - $platform_id = ! is_null( $platformInfo ) ? key( $platformInfo ) : null; + $platform_id = ! is_null($platformInfo) ? key($platformInfo) : null; $filters = array( - 'exec_status' => "ALL", - 'active_status' => "ALL", - 'tplan_id' => $tplan_id, - 'platform_id' => $platform_id + 'exec_status' => "ALL", + 'active_status' => "ALL", + 'tplan_id' => $tplan_id, + 'platform_id' => $platform_id ); - $info = $this->tcaseMgr->get_linked_versions( $tcase_id, $filters ); - $status_ok = ! is_null( $info ); + $info = $this->tcaseMgr->get_linked_versions($tcase_id, $filters); + $status_ok = ! is_null($info); - if($status_ok) { - $this->tcVersionID = key( $info ); - $dummy = current( $info ); - $plat = is_null( $platform_id ) ? 0 : $platform_id; + if ($status_ok) { + $this->tcVersionID = key($info); + $dummy = current($info); + $plat = is_null($platform_id) ? 0 : $platform_id; $this->versionNumber = $dummy[$tplan_id][$plat]['version']; } else { - $tplan_info = $this->tplanMgr->get_by_id( $tplan_id ); - $tcase_info = $this->tcaseMgr->get_by_id( $tcase_id, testcase::ALL_VERSIONS, null, array( + $tplan_info = $this->tplanMgr->get_by_id($tplan_id); + $tcase_info = $this->tcaseMgr->get_by_id($tcase_id, + testcase::ALL_VERSIONS, null, array( 'output' => 'essential' - ) ); - if(is_null( $platform_id )) { - $msg = sprintf( TCASEID_NOT_IN_TPLANID_STR, $tcase_info[0]['name'], $tcase_id, $tplan_info['name'], $tplan_id ); - $this->errors[] = new IXR_Error( TCASEID_NOT_IN_TPLANID, $msg ); + )); + if (is_null($platform_id)) { + $msg = sprintf(TCASEID_NOT_IN_TPLANID_STR, + $tcase_info[0]['name'], $tcase_id, $tplan_info['name'], + $tplan_id); + $this->errors[] = new IXR_Error(TCASEID_NOT_IN_TPLANID, $msg); } else { - $msg = sprintf( TCASEID_NOT_IN_TPLANID_FOR_PLATFORM_STR, $tcase_info[0]['name'], $tcase_id, $tplan_info['name'], $tplan_id, $platformInfo[$platform_id], $platform_id ); - $this->errors[] = new IXR_Error( TCASEID_NOT_IN_TPLANID_FOR_PLATFORM, $msg ); + $msg = sprintf(TCASEID_NOT_IN_TPLANID_FOR_PLATFORM_STR, + $tcase_info[0]['name'], $tcase_id, $tplan_info['name'], + $tplan_id, $platformInfo[$platform_id], $platform_id); + $this->errors[] = new IXR_Error( + TCASEID_NOT_IN_TPLANID_FOR_PLATFORM, $msg); } } return $status_ok; @@ -1402,14 +1624,16 @@ protected function _checkTCIDAndTPIDValid($platformInfo = null, $messagePrefix = * @return boolean * @access protected */ - protected function _checkCreateBuildRequest($messagePrefix = '') { + protected function _checkCreateBuildRequest($messagePrefix = '') + { $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); - if($status_ok) { - $status_ok = $this->_isParamPresent( self::$buildNameParamName, $messagePrefix, self::SET_ERROR ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); + if ($status_ok) { + $status_ok = $this->_isParamPresent(self::$buildNameParamName, + $messagePrefix, self::SET_ERROR); } return $status_ok; @@ -1421,13 +1645,13 @@ protected function _checkCreateBuildRequest($messagePrefix = '') { * @return boolean * @access protected */ - protected function _checkGetBuildRequest() { + protected function _checkGetBuildRequest() + { $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions ); - return $status_ok; + return $this->_runChecks($checkFunctions); } /** @@ -1441,13 +1665,14 @@ protected function _checkGetBuildRequest() { * @return boolean * @access protected */ - protected function _runChecks($checkFunctions, $messagePrefix = '') { - foreach( $checkFunctions as $pfn ) { - if(!($status_ok = $this->$pfn( $messagePrefix ))) { - break; + protected function _runChecks($checkFunctions, $messagePrefix = '') + { + foreach ($checkFunctions as $pfn) { + if (! ($status_ok = $this->$pfn($messagePrefix))) { + break; + } } - } - return $status_ok; + return $status_ok; } /** @@ -1460,30 +1685,32 @@ protected function _runChecks($checkFunctions, $messagePrefix = '') { * * @access public */ - public function getLatestBuildForTestPlan($args) { + public function getLatestBuildForTestPlan($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $status_ok = true; - $this->_setArgs( $args ); - $resultInfo = array(); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { $testPlanID = $this->args[self::$testPlanIDParamName]; - $build_id = $this->tplanMgr->get_max_build_id( $testPlanID ); + $build_id = $this->tplanMgr->get_max_build_id($testPlanID); - if(($status_ok = $build_id > 0)) { - $builds = $this->tplanMgr->get_builds( $testPlanID ); + if ($status_ok = $build_id > 0) { + $builds = $this->tplanMgr->get_builds($testPlanID); $build_info = $builds[$build_id]; } else { - $tplan_info = $this->tplanMgr->get_by_id( $testPlanID ); - $msg = $msg_prefix . sprintf( TPLAN_HAS_NO_BUILDS_STR, $tplan_info['name'], $tplan_info['id'] ); - $this->errors[] = new IXR_Error( TPLAN_HAS_NO_BUILDS, $msg ); + $tplan_info = $this->tplanMgr->get_by_id($testPlanID); + $msg = $msg_prefix . + sprintf(TPLAN_HAS_NO_BUILDS_STR, $tplan_info['name'], + $tplan_info['id']); + $this->errors[] = new IXR_Error(TPLAN_HAS_NO_BUILDS, $msg); } } @@ -1496,12 +1723,13 @@ public function getLatestBuildForTestPlan($args) { * @param struct $args * */ - protected function _getLatestBuildForTestPlan($args) { - $builds = $this->_getBuildsForTestPlan( $args ); + protected function _getLatestBuildForTestPlan($args) + { + $builds = $this->_getBuildsForTestPlan($args); $maxid = - 1; $maxkey = - 1; - foreach( $builds as $key => $build ) { - if($build['id'] > $maxid) { + foreach ($builds as $key => $build) { + if ($build['id'] > $maxid) { $maxkey = $key; $maxid = $build['id']; } @@ -1565,11 +1793,12 @@ protected function _getLatestBuildForTestPlan($args) { * * @access public */ - public function getLastExecutionResult($args) { + public function getLastExecutionResult($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $status_ok = true; @@ -1578,76 +1807,87 @@ public function getLastExecutionResult($args) { // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestPlanID', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->_checkTCIDAndTPIDValid( null, $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->_checkTCIDAndTPIDValid(null, $msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => null, - 'build_id' => null + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => null, + 'build_id' => null ); - if($status_ok) { - if($this->_isParamPresent( self::$optionsParamName, $msg_prefix )) { + if ($status_ok) { + if ($this->_isParamPresent(self::$optionsParamName, $msg_prefix)) { $dummy = $this->args[self::$optionsParamName]; - if(is_array( $dummy )) { - foreach( $dummy as $key => $value ) { - $options->$key =($value > 0) ? 1 : 0; + if (is_array($dummy)) { + foreach ($dummy as $key => $value) { + $options->$key = ($value > 0) ? 1 : 0; } } } // Now we can check for Optional parameters - if($this->_isBuildIDPresent() || $this->_isBuildNamePresent()) { - if(($status_ok = $this->checkBuildID( $msg_prefix ))) { - $execContext['build_id'] = $this->args[self::$buildIDParamName]; - } + if ($this->_isBuildIDPresent() || + $this->_isBuildNamePresent() && + $status_ok = $this->checkBuildID($msg_prefix)) { + $execContext['build_id'] = $this->args[self::$buildIDParamName]; } - if($status_ok) { - if($this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) || $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { - $status_ok = $this->checkPlatformIdentity( $this->args[self::$testPlanIDParamName] ); + if ($status_ok && + $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) || + $this->_isParamPresent(self::$platformNameParamName, $msg_prefix)) { + $status_ok = $this->checkPlatformIdentity( + $this->args[self::$testPlanIDParamName]); - if($status_ok) { - $execContext['platform_id'] = $this->args[self::$platformIDParamName]; - } + if ($status_ok) { + $execContext['platform_id'] = $this->args[self::$platformIDParamName]; } } } - if($status_ok) { + if ($status_ok) { - $sql = " SELECT MAX(id) AS exec_id FROM {$this->tables['executions']} " . " WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} " . " AND tcversion_id IN(" . " SELECT id FROM {$this->tables['nodes_hierarchy']} " . " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; + $sql = " SELECT MAX(id) AS exec_id FROM {$this->tables['executions']} " . + " WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} " . + " AND tcversion_id IN(" . + " SELECT id FROM {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; - if(! is_null( $execContext['build_id'] )) { - $sql .= " AND build_id = " . intval( $execContext['build_id'] ); + if (! is_null($execContext['build_id'])) { + $sql .= " AND build_id = " . intval($execContext['build_id']); } - if(! is_null( $execContext['platform_id'] )) { - $sql .= " AND platform_id = " . intval( $execContext['platform_id'] ); + if (! is_null($execContext['platform_id'])) { + $sql .= " AND platform_id = " . + intval($execContext['platform_id']); } - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'exec_id' ); - if(is_null( $rs )) { + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'exec_id'); + if (is_null($rs)) { // has not been executed // execution id = -1 => test case has not been runned. $resultInfo[] = array( - 'id' => - 1 + 'id' => - 1 ); } else { // OK Select * is not a good practice but ...(fman) - $targetID = intval( key( $rs ) ); - $sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" . $targetID; - $resultInfo[0] = $this->dbObj->fetchFirstRow( $sql ); + $targetID = intval(key($rs)); + $sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" . + $targetID; + $resultInfo[0] = $this->dbObj->fetchFirstRow($sql); - if($options->getBugs) { + if ($options->getBugs) { $resultInfo[0]['bugs'] = array(); - $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " . " WHERE execution_id = " . $targetID; - $resultInfo[0]['bugs'] =( array ) $this->dbObj->get_recordset( $sql ); + $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " . + " WHERE execution_id = " . $targetID; + $resultInfo[0]['bugs'] = (array) $this->dbObj->get_recordset( + $sql); } } } @@ -1658,7 +1898,7 @@ public function getLastExecutionResult($args) { /** * Gets ALL EXECUTIONS for a particular testcase on a test plan. * If there are no filter criteria regarding platform and build, - * result will be get WITHOUT checking for a particular platform + * result will be get WITHOUT checking for a particular platform * and build. * * @param struct $args @@ -1666,12 +1906,12 @@ public function getLastExecutionResult($args) { * @param int $args["tplanid"] * @param int $args["testcaseid"]: * Pseudo optional. - * if does not is present then + * if does not is present then * testcaseexternalid MUST BE present * * @param int $args["testcaseexternalid"]: * Pseudo optional. - * if does not is present then testcaseid + * if does not is present then testcaseid * MUST BE present * * @param string $args["platform_id"]: @@ -1697,16 +1937,17 @@ public function getLastExecutionResult($args) { * If user has requested getbugs, then a key bugs(that is an array) * will also exists. * - * if test case has not been execute, the first map + * if test case has not been execute, the first map * will be returned with -1 as 'id' * * @access public */ - public function getAllExecutionsResults($args) { + public function getAllExecutionsResults($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $status_ok = true; @@ -1714,83 +1955,93 @@ public function getAllExecutionsResults($args) { $options->getBugs = 0; // Checks are done in order - $checkFunctions = array('authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity'); + $checkFunctions = array( + 'authenticate', + 'checkTestPlanID', + 'checkTestCaseIdentity' + ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->_checkTCIDAndTPIDValid( null, $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->_checkTCIDAndTPIDValid(null, $msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => null, 'build_id' => null); + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => null, + 'build_id' => null + ); - if($status_ok) { - if($this->_isParamPresent( self::$optionsParamName, $msg_prefix )) { - $dummy = $this->args[self::$optionsParamName]; - if(is_array( $dummy )) { - foreach( $dummy as $key => $value ) { - $options->$key =($value > 0) ? 1 : 0; + if ($status_ok) { + if ($this->_isParamPresent(self::$optionsParamName, $msg_prefix)) { + $dummy = $this->args[self::$optionsParamName]; + if (is_array($dummy)) { + foreach ($dummy as $key => $value) { + $options->$key = ($value > 0) ? 1 : 0; + } + } } - } - } - // Now we can check for Optional parameters - if($this->_isBuildIDPresent() || $this->_isBuildNamePresent()) { - if(($status_ok = $this->checkBuildID( $msg_prefix ))) { - $execContext['build_id'] = $this->args[self::$buildIDParamName]; - } - } + // Now we can check for Optional parameters + if ($this->_isBuildIDPresent() || + $this->_isBuildNamePresent() && + $status_ok = $this->checkBuildID($msg_prefix)) { + $execContext['build_id'] = $this->args[self::$buildIDParamName]; + } - if($status_ok) { - if($this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) || $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { - $status_ok = $this->checkPlatformIdentity( $this->args[self::$testPlanIDParamName] ); + if ($status_ok && + $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) || + $this->_isParamPresent(self::$platformNameParamName, $msg_prefix)) { + $status_ok = $this->checkPlatformIdentity( + $this->args[self::$testPlanIDParamName]); - if($status_ok) { + if ($status_ok) { $execContext['platform_id'] = $this->args[self::$platformIDParamName]; } - } + } } - } - if($status_ok) { + if ($status_ok) { - $sql = " SELECT(id) AS exec_id FROM {$this->tables['executions']} - WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} - AND tcversion_id IN(" . - " SELECT id FROM {$this->tables['nodes_hierarchy']} + $sql = " SELECT(id) AS exec_id FROM {$this->tables['executions']} + WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} + AND tcversion_id IN(" . + " SELECT id FROM {$this->tables['nodes_hierarchy']} WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; - if(!is_null( $execContext['build_id'] )) { - $sql .= " AND build_id = " . intval( $execContext['build_id'] ); - } + if (! is_null($execContext['build_id'])) { + $sql .= " AND build_id = " . intval($execContext['build_id']); + } - if(!is_null( $execContext['platform_id'] )) { - $sql .= " AND platform_id = " . intval( $execContext['platform_id'] ); - } + if (! is_null($execContext['platform_id'])) { + $sql .= " AND platform_id = " . + intval($execContext['platform_id']); + } - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'exec_id' ); - if(is_null( $rs )) { - // has not been executed - // execution id = -1 => test case has not been runned. - $resultInfo[0] = array('id' => - 1); - } else { - foreach( $rs as $tcExecId => $dummy ) { - $sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" . - $tcExecId; - $resultInfo[$tcExecId] = $this->dbObj->fetchFirstRow( $sql ); - if($options->getBugs) { - $resultInfo[$tcExecId]['bugs'] = array(); - $sql = " SELECT DISTINCT bug_id FROM + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'exec_id'); + if (is_null($rs)) { + // has not been executed + // execution id = -1 => test case has not been runned. + $resultInfo[0] = array( + 'id' => - 1 + ); + } else { + foreach ($rs as $tcExecId => $dummy) { + $sql = "SELECT * FROM {$this->tables['executions']} WHERE id=" . + $tcExecId; + $resultInfo[$tcExecId] = $this->dbObj->fetchFirstRow($sql); + if ($options->getBugs) { + $resultInfo[$tcExecId]['bugs'] = array(); + $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} WHERE execution_id = " . $tcExecId; - $resultInfo[$tcExecId]['bugs'] = - (array)$this->dbObj->get_recordset( $sql ); + $resultInfo[$tcExecId]['bugs'] = (array) $this->dbObj->get_recordset( + $sql); + } + } } - } } - } - return $status_ok ? $resultInfo : $this->errors; + return $status_ok ? $resultInfo : $this->errors; } /** @@ -1799,21 +2050,20 @@ public function getAllExecutionsResults($args) { * @return int * @access protected */ - protected function _insertResultToDB($user_id = null, $exec_ts = null) { + protected function _insertResultToDB($user_id = null, $exec_ts = null) + { $build_id = $this->args[self::$buildIDParamName]; $status = $this->args[self::$statusParamName]; $testplan_id = $this->args[self::$testPlanIDParamName]; $tcversion_id = $this->tcVersionID; $version_number = $this->versionNumber; - $tester_id = is_null( $user_id ) ? $this->userID : $user_id; - $execTimeStamp = is_null( $exec_ts ) ? $this->dbObj->db_now() : $exec_ts; - - // return $execTimeStamp; + $tester_id = is_null($user_id) ? $this->userID : $user_id; + $execTimeStamp = is_null($exec_ts) ? $this->dbObj->db_now() : $exec_ts; $platform_id = 0; - if(isset( $this->args[self::$platformIDParamName] )) { + if (isset($this->args[self::$platformIDParamName])) { $platform_id = $this->args[self::$platformIDParamName]; } @@ -1821,28 +2071,37 @@ protected function _insertResultToDB($user_id = null, $exec_ts = null) { $notes_field = ""; $notes_value = ""; - if($this->_isNotePresent()) { - $notes = $this->dbObj->prepare_string( $this->args[self::$noteParamName] ); + if ($this->_isNotePresent()) { + $notes = $this->dbObj->prepare_string( + $this->args[self::$noteParamName]); } - if(trim( $notes ) != "") { + if (trim($notes) != "") { $notes_field = ",notes"; $notes_value = ", '{$notes}'"; } $duration_field = ''; $duration_value = ''; - if(isset( $this->args[self::$executionDurationParamName] )) { + if (isset($this->args[self::$executionDurationParamName])) { $duration_field = ',execution_duration'; - $duration_value = ", " . floatval( $this->args[self::$executionDurationParamName] ); + $duration_value = ", " . + floatval($this->args[self::$executionDurationParamName]); } - $execution_type = constant( "TESTCASE_EXECUTION_TYPE_AUTO" ); + $execution_type = constant("TESTCASE_EXECUTION_TYPE_AUTO"); - $query = "INSERT INTO {$this->tables['executions']} " . "(build_id, tester_id, execution_ts, status, testplan_id, tcversion_id, " . " platform_id, tcversion_number," . " execution_type {$notes_field} {$duration_field}) " . " VALUES({$build_id},{$tester_id},{$execTimeStamp}," . " '{$status}',{$testplan_id}," . " {$tcversion_id},{$platform_id}, {$version_number},{$execution_type} " . " {$notes_value} {$duration_value})"; + $query = "INSERT INTO {$this->tables['executions']} " . + "(build_id, tester_id, execution_ts, status, testplan_id, tcversion_id, " . + " platform_id, tcversion_number," . + " execution_type {$notes_field} {$duration_field}) " . + " VALUES({$build_id},{$tester_id},{$execTimeStamp}," . + " '{$status}',{$testplan_id}," . + " {$tcversion_id},{$platform_id}, {$version_number},{$execution_type} " . + " {$notes_value} {$duration_value})"; - $this->dbObj->exec_query( $query ); - return $this->dbObj->insert_id( $this->tables['executions'] ); + $this->dbObj->exec_query($query); + return $this->dbObj->insert_id($this->tables['executions']); } /** @@ -1853,7 +2112,8 @@ protected function _insertResultToDB($user_id = null, $exec_ts = null) { * @return string "Hello!" * @access public */ - public function sayHello($args) { + public function sayHello($args) + { return 'Hello!'; } @@ -1865,10 +2125,10 @@ public function sayHello($args) { * @return string * @access public */ - public function repeat($args) { - $this->_setArgs( $args ); - $str = "You said: " . $this->args['str']; - return $str; + public function repeat($args) + { + $this->_setArgs($args); + return "You said: " . $this->args['str']; } /** @@ -1878,7 +2138,8 @@ public function repeat($args) { * @return string * @access public */ - public function testLinkVersion() { + public function testLinkVersion() + { return TL_VERSION_NUMBER; } @@ -1890,10 +2151,12 @@ public function testLinkVersion() { * @return string * @access public */ - public function about($args) { - $this->_setArgs( $args ); - $str = " Testlink API Version: " . self::$version . " initially written by Asiel Brumfield\n" . " with contributions by TestLink development Team"; - return $str; + public function about($args) + { + $this->_setArgs($args); + return " Testlink API Version: " . self::$version . + " initially written by Asiel Brumfield\n" . + " with contributions by TestLink development Team"; } /** @@ -1916,7 +2179,8 @@ public function about($args) { * * @access public */ - public function createBuild($args) { + public function createBuild($args) + { $operation = __FUNCTION__; $messagePrefix = "({$operation}) - "; $resultInfo = array(); @@ -1925,61 +2189,73 @@ public function createBuild($args) { $insertID = ''; $returnMessage = GENERAL_SUCCESS_STR; - $this->_setArgs( $args ); + $this->_setArgs($args); // check the tpid - if($this->_checkCreateBuildRequest( $messagePrefix ) && $this->userHasRight( "testplan_create_build", self::CHECK_PUBLIC_PRIVATE_ATTR )) { - $testPlanID = intval( $this->args[self::$testPlanIDParamName] ); + if ($this->_checkCreateBuildRequest($messagePrefix) && + $this->userHasRight("testplan_create_build", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { + $testPlanID = intval($this->args[self::$testPlanIDParamName]); $buildName = $this->args[self::$buildNameParamName]; $buildNotes = ""; - if($this->_isBuildNotePresent()) { - $buildNotes = $this->dbObj->prepare_string( $this->args[self::$buildNotesParamName] ); + if ($this->_isBuildNotePresent()) { + $buildNotes = $this->dbObj->prepare_string( + $this->args[self::$buildNotesParamName]); } - if($this->tplanMgr->check_build_name_existence( $testPlanID, $buildName )) { + if ($this->tplanMgr->check_build_name_existence($testPlanID, + $buildName)) { // Build exists so just get the id of the existing build - $insertID = $this->tplanMgr->get_build_id_by_name( $testPlanID, $buildName ); - $returnMessage = sprintf( BUILDNAME_ALREADY_EXISTS_STR, $buildName, $insertID ); + $insertID = $this->tplanMgr->get_build_id_by_name($testPlanID, + $buildName); + $returnMessage = sprintf(BUILDNAME_ALREADY_EXISTS_STR, + $buildName, $insertID); $resultInfo[0]["status"] = false; } else { // Build doesn't exist so create one // ,$active=1,$open=1); - //($tplan_id,$name,$notes = '',$active=1,$open=1,$release_date='') + // ($tplan_id,$name,$notes = '',$active=1,$open=1,$release_date='') // key 2 check with default value is parameter is missing $k2check = array( - self::$activeParamName => 1, - self::$openParamName => 1, - self::$releaseDateParamName => null, - self::$copyTestersFromBuildParamName => 0 + self::$activeParamName => 1, + self::$openParamName => 1, + self::$releaseDateParamName => null, + self::$copyTestersFromBuildParamName => 0 ); - foreach( $k2check as $key => $value ) { - $opt[$key] = $this->_isParamPresent( $key ) ? $this->args[$key] : $value; + foreach ($k2check as $key => $value) { + $opt[$key] = $this->_isParamPresent($key) ? $this->args[$key] : $value; } // check if release date is valid date. // do not check relation with now(), i.e can be <,> or =. // - if(! is_null( $opt[self::$releaseDateParamName] )) { - if(! $this->validateDateISO8601( $opt[self::$releaseDateParamName] )) { - $opt[self::$releaseDateParamName] = null; - } + if (! is_null($opt[self::$releaseDateParamName]) && + ! $this->validateDateISO8601( + $opt[self::$releaseDateParamName])) { + $opt[self::$releaseDateParamName] = null; } - $bm = new build_mgr( $this->dbObj ); - $insertID = $bm->create( $testPlanID, $buildName, $buildNotes, $opt[self::$activeParamName], $opt[self::$openParamName], $opt[self::$releaseDateParamName] ); + $bm = new build_mgr($this->dbObj); + $insertID = $bm->create($testPlanID, $buildName, $buildNotes, + $opt[self::$activeParamName], $opt[self::$openParamName], + $opt[self::$releaseDateParamName]); - if($insertID > 0) { - $sourceBuild = intval( $opt[self::$copyTestersFromBuildParamName] ); + if ($insertID > 0) { + $sourceBuild = intval( + $opt[self::$copyTestersFromBuildParamName]); - if($sourceBuild > 0) { + if ($sourceBuild > 0) { // Check if belongs to test plan, otherwise ignore in silence - $sql = " SELECT id FROM {$this->tables['builds']} " . " WHERE id = " . $sourceBuild . " AND testplan_id = " . $testPlanID; - $rs = $this->dbObj->get_recordset( $sql ); - - if(count( $rs ) == 1) { - $taskMgr = new assignment_mgr( $this->dbObj ); - $taskMgr->copy_assignments( $sourceBuild, $insertID, $this->userID ); + $sql = " SELECT id FROM {$this->tables['builds']} " . + " WHERE id = " . $sourceBuild . " AND testplan_id = " . + $testPlanID; + $rs = $this->dbObj->get_recordset($sql); + + if (count($rs) == 1) { + $taskMgr = new assignment_mgr($this->dbObj); + $taskMgr->copy_assignments($sourceBuild, $insertID, + $this->userID); } } } @@ -2001,10 +2277,14 @@ public function createBuild($args) { * @return mixed $resultInfo * @access public */ - public function getProjects($args) { - $this->_setArgs( $args ); - if($this->authenticate()) { - return $this->tprojectMgr->get_accessible_for_user($this->userID, array('output' => 'array_of_map')); + public function getProjects($args) + { + $this->_setArgs($args); + if ($this->authenticate()) { + return $this->tprojectMgr->get_accessible_for_user($this->userID, + array( + 'output' => 'array_of_map' + )); } else { return $this->errors; } @@ -2020,23 +2300,24 @@ public function getProjects($args) { * * @access public */ - public function getProjectTestPlans($args) { + public function getProjectTestPlans($args) + { $messagePrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); // check the tplanid // TODO: NEED associated RIGHT $checkFunctions = array( - 'authenticate', - 'checkTestProjectID' + 'authenticate', + 'checkTestProjectID' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); - if($status_ok) { + if ($status_ok) { $testProjectID = $this->args[self::$testProjectIDParamName]; - $info = $this->tprojectMgr->get_all_testplans( $testProjectID ); - if(! is_null( $info ) && count( $info ) > 0) { - $info = array_values( $info ); + $info = $this->tprojectMgr->get_all_testplans($testProjectID); + if (! empty($info)) { + $info = array_values($info); } return $info; } else { @@ -2057,25 +2338,26 @@ public function getProjectTestPlans($args) { * * @access public */ - public function getBuildsForTestPlan($args) { + public function getBuildsForTestPlan($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $builds = null; $status_ok = true; $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { $testPlanID = $this->args[self::$testPlanIDParamName]; - $dummy = $this->tplanMgr->get_builds( $testPlanID ); + $dummy = $this->tplanMgr->get_builds($testPlanID); - if(! is_null( $dummy )) { - $builds = array_values( $dummy ); + if (! is_null($dummy)) { + $builds = array_values($dummy); } } return $status_ok ? $builds : $this->errors; @@ -2089,20 +2371,20 @@ public function getBuildsForTestPlan($args) { * @param int $args["testplanid"] * @return mixed $resultInfo */ - public function getTestSuitesForTestPlan($args) { + public function getTestSuitesForTestPlan($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); - if($status_ok) { + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); + if ($status_ok) { $testPlanID = $this->args[self::$testPlanIDParamName]; - $result = $this->tplanMgr->get_testsuites( $testPlanID ); - return $result; + return $this->tplanMgr->get_testsuites($testPlanID); } else { return $this->errors; } @@ -2117,7 +2399,7 @@ public function getTestSuitesForTestPlan($args) { * @param string $args["testcaseprefix"] * @param string $args["notes"] * OPTIONAL - * @param map $args["options"] + * @param array $args["options"] * OPTIONAL ALL int treated as boolean * keys requirementsEnabled,testPriorityEnabled,automationEnabled,inventoryEnabled * @@ -2133,13 +2415,15 @@ public function getTestSuitesForTestPlan($args) { * * @return mixed $resultInfo */ - public function createTestProject($args) { - $this->_setArgs( $args ); + public function createTestProject($args) + { + $this->_setArgs($args); $msg_prefix = "(" . __FUNCTION__ . ") - "; - $checkRequestMethod = '_check' . ucfirst( __FUNCTION__ ) . 'Request'; + $checkRequestMethod = '_check' . ucfirst(__FUNCTION__) . 'Request'; $status_ok = false; - if($this->$checkRequestMethod( $msg_prefix ) && $this->userHasRight( "mgt_modify_product" )) { + if ($this->$checkRequestMethod($msg_prefix) && + $this->userHasRight("mgt_modify_product")) { $status_ok = true; $item = new stdClass(); @@ -2149,11 +2433,11 @@ public function createTestProject($args) { $item->options->automationEnabled = 1; $item->options->inventoryEnabled = 1; - if($this->_isParamPresent( self::$optionsParamName, $msg_prefix )) { + if ($this->_isParamPresent(self::$optionsParamName, $msg_prefix)) { // has to be an array ? $dummy = $this->args[self::$optionsParamName]; - if(is_array( $dummy )) { - foreach( $dummy as $key => $value ) { + if (is_array($dummy)) { + foreach ($dummy as $key => $value) { $item->options->$key = $value > 0 ? 1 : 0; } } @@ -2162,101 +2446,112 @@ public function createTestProject($args) { // other optional parameters(not of complex type) // key 2 check with default value is parameter is missing $keys2check = array( - self::$activeParamName => 1, - self::$publicParamName => 1, - self::$noteParamName => '', - self::$itsEnabledParamName => 0, - self::$itsNameParamName => '' + self::$activeParamName => 1, + self::$publicParamName => 1, + self::$noteParamName => '', + self::$itsEnabledParamName => 0, + self::$itsNameParamName => '' ); - foreach( $keys2check as $key => $value ) { - $optional[$key] = $this->_isParamPresent( $key ) ? trim( $this->args[$key] ) : $value; + foreach ($keys2check as $key => $value) { + $optional[$key] = $this->_isParamPresent($key) ? trim( + $this->args[$key]) : $value; } - $item->name = htmlspecialchars( $this->args[self::$testProjectNameParamName] ); - $item->prefix = htmlspecialchars( $this->args[self::$testCasePrefixParamName] ); + $item->name = htmlspecialchars( + $this->args[self::$testProjectNameParamName]); + $item->prefix = htmlspecialchars( + $this->args[self::$testCasePrefixParamName]); - $item->notes = htmlspecialchars( $optional[self::$noteParamName] ); - $item->active =($optional[self::$activeParamName] > 0) ? 1 : 0; - $item->is_public =($optional[self::$publicParamName] > 0) ? 1 : 0; + $item->notes = htmlspecialchars($optional[self::$noteParamName]); + $item->active = ($optional[self::$activeParamName] > 0) ? 1 : 0; + $item->is_public = ($optional[self::$publicParamName] > 0) ? 1 : 0; $item->color = ''; $its = null; - if($optional[self::$itsNameParamName] != "") { - $this->itsMgr = new tlIssueTracker( $this->dbObj ); - $its = $this->getIssueTrackerSystem( $this->args, 'internal' ); + if ($optional[self::$itsNameParamName] != "") { + $this->itsMgr = new tlIssueTracker($this->dbObj); + $its = $this->getIssueTrackerSystem($this->args, 'internal'); - $itsOK = ! is_null( $its ); - if(! $itsOK) { + $itsOK = ! is_null($its); + if (! $itsOK) { $status_ok = false; } } } // All checks OK => try to create testproject - if($status_ok) { - $tproject_id = $this->tprojectMgr->create( $item ); + if ($status_ok) { + $tproject_id = $this->tprojectMgr->create($item); // link & enable its? - if($itsOK && $tproject_id > 0) { + if ($itsOK && $tproject_id > 0) { // link - $this->itsMgr->link( $its["id"], $tproject_id ); + $this->itsMgr->link($its["id"], $tproject_id); // enable - if($optional[self::$itsEnabledParamName] > 0) { - $this->tprojectMgr->enableIssueTracker( $tproject_id ); + if ($optional[self::$itsEnabledParamName] > 0) { + $this->tprojectMgr->enableIssueTracker($tproject_id); } } $ret = array(); $ret[] = array( - "operation" => __FUNCTION__, - "additionalInfo" => null, - "status" => true, - "id" => $tproject_id, - "message" => GENERAL_SUCCESS_STR + "operation" => __FUNCTION__, + "additionalInfo" => null, + "status" => true, + "id" => $tproject_id, + "message" => GENERAL_SUCCESS_STR ); return $ret; } - return($status_ok ? $ret : $this->errors); + return $status_ok ? $ret : $this->errors; } /** * _checkCreateTestProjectRequest */ - protected function _checkCreateTestProjectRequest($msg_prefix) { + protected function _checkCreateTestProjectRequest($msg_prefix) + { $status_ok = $this->authenticate(); $name = $this->args[self::$testProjectNameParamName]; $prefix = $this->args[self::$testCasePrefixParamName]; - if($status_ok) { - $check_op = $this->tprojectMgr->checkNameSintax( $name ); + if ($status_ok) { + $check_op = $this->tprojectMgr->checkNameSintax($name); $status_ok = $check_op['status_ok']; - if(! $status_ok) { - $this->errors[] = new IXR_Error( TESTPROJECTNAME_SINTAX_ERROR, $msg_prefix . $check_op['msg'] ); + if (! $status_ok) { + $this->errors[] = new IXR_Error(TESTPROJECTNAME_SINTAX_ERROR, + $msg_prefix . $check_op['msg']); } } - if($status_ok) { - $check_op = $this->tprojectMgr->checkNameExistence( $name ); + if ($status_ok) { + $check_op = $this->tprojectMgr->checkNameExistence($name); $status_ok = $check_op['status_ok']; - if(! $status_ok) { - $this->errors[] = new IXR_Error( TESTPROJECTNAME_EXISTS, $msg_prefix . $check_op['msg'] ); + if (! $status_ok) { + $this->errors[] = new IXR_Error(TESTPROJECTNAME_EXISTS, + $msg_prefix . $check_op['msg']); } } - if($status_ok) { - $status_ok = ! empty( $prefix ); - if(! $status_ok) { - $this->errors[] = new IXR_Error( TESTPROJECT_TESTCASEPREFIX_IS_EMPTY, $msg_prefix . $check_op['msg'] ); + if ($status_ok) { + $status_ok = ! empty($prefix); + if (! $status_ok) { + $this->errors[] = new IXR_Error( + TESTPROJECT_TESTCASEPREFIX_IS_EMPTY, + $msg_prefix . $check_op['msg']); } } - if($status_ok) { - $info = $this->tprojectMgr->get_by_prefix( $prefix ); - if(!($status_ok = is_null( $info ))) { - $msg = $msg_prefix . sprintf( TPROJECT_PREFIX_ALREADY_EXISTS_STR, $prefix, $info['name'] ); - $this->errors[] = new IXR_Error( TPROJECT_PREFIX_ALREADY_EXISTS, $msg ); + if ($status_ok) { + $info = $this->tprojectMgr->get_by_prefix($prefix); + if (! ($status_ok = is_null($info))) { + $msg = $msg_prefix . + sprintf(TPROJECT_PREFIX_ALREADY_EXISTS_STR, $prefix, + $info['name']); + $this->errors[] = new IXR_Error(TPROJECT_PREFIX_ALREADY_EXISTS, + $msg); } } @@ -2287,45 +2582,49 @@ protected function _checkCreateTestProjectRequest($msg_prefix) { * * */ - public function getTestCasesForTestSuite($args) { + public function getTestCasesForTestSuite($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); - $status_ok = $this->_runChecks( array( + $this->_setArgs($args); + $status_ok = $this->_runChecks( + array( 'authenticate', 'checkTestSuiteID' - ), $msg_prefix ); + ), $msg_prefix); $details = 'simple'; $key2search = self::$detailsParamName; - if($this->_isParamPresent( $key2search )) { + if ($this->_isParamPresent($key2search)) { $details = $this->args[$key2search]; } - if($status_ok) { + if ($status_ok) { $testSuiteID = $this->args[self::$testSuiteIDParamName]; - $dummy = $this->tprojectMgr->tree_manager->get_path( $testSuiteID ); + $dummy = $this->tprojectMgr->tree_manager->get_path($testSuiteID); $this->args[self::$testProjectIDParamName] = $dummy[0]['parent_id']; - $status_ok = $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->userHasRight("mgt_view_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR); } - if($status_ok) { - $tsuiteMgr = new testsuite( $this->dbObj ); - if(! $this->_isDeepPresent() || $this->args[self::$deepParamName]) { + if ($status_ok) { + $tsuiteMgr = new testsuite($this->dbObj); + if (! $this->_isDeepPresent() || $this->args[self::$deepParamName]) { $pfn = 'get_testcases_deep'; } else { $pfn = 'get_children_testcases'; } $opt = null; - if(isset( $this->args[self::$getKeywordsParamName] ) && $this->args[self::$getKeywordsParamName]) { + if (isset($this->args[self::$getKeywordsParamName]) && + $this->args[self::$getKeywordsParamName]) { $opt = array( - 'getKeywords' => true + 'getKeywords' => true ); } - return $tsuiteMgr->$pfn( $testSuiteID, $details, $opt ); + return $tsuiteMgr->$pfn($testSuiteID, $details, $opt); } else { return $this->errors; } @@ -2352,51 +2651,57 @@ public function getTestCasesForTestSuite($args) { * pieces separator -> :: -> default value of getByPathName() * @return mixed $resultInfo */ - public function getTestCaseIDByName($args) { + public function getTestCaseIDByName($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $result = null; $checkFunctions = array( - 'authenticate', - 'checkTestCaseName' + 'authenticate', + 'checkTestCaseName' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { $testCaseName = $this->args[self::$testCaseNameParamName]; - $testCaseMgr = new testcase( $this->dbObj ); + $testCaseMgr = new testcase($this->dbObj); $keys2check = array( - self::$testSuiteNameParamName, - self::$testCasePathNameParamName, - self::$testProjectNameParamName + self::$testSuiteNameParamName, + self::$testCasePathNameParamName, + self::$testProjectNameParamName ); - foreach( $keys2check as $key ) { - $optional[$key] = $this->_isParamPresent( $key ) ? trim( $this->args[$key] ) : ''; + foreach ($keys2check as $key) { + $optional[$key] = $this->_isParamPresent($key) ? trim( + $this->args[$key]) : ''; } - if($optional[self::$testCasePathNameParamName] != '') { - $dummy = $testCaseMgr->getByPathName( $optional[self::$testCasePathNameParamName] ); - if(! is_null( $dummy )) { + if ($optional[self::$testCasePathNameParamName] != '') { + $dummy = $testCaseMgr->getByPathName( + $optional[self::$testCasePathNameParamName]); + if (! is_null($dummy)) { $result[0] = $dummy; } } else { - $result = $testCaseMgr->get_by_name( $testCaseName, $optional[self::$testSuiteNameParamName], $optional[self::$testProjectNameParamName] ); + $result = $testCaseMgr->get_by_name($testCaseName, + $optional[self::$testSuiteNameParamName], + $optional[self::$testProjectNameParamName]); } - $match_count = count( $result ); - switch($match_count) { - case 0 : + $match_count = count($result); + switch ($match_count) { + case 0: $status_ok = false; - $this->errors[] = new IXR_ERROR( NO_TESTCASE_BY_THIS_NAME, $msg_prefix . NO_TESTCASE_BY_THIS_NAME_STR ); + $this->errors[] = new IXR_ERROR(NO_TESTCASE_BY_THIS_NAME, + $msg_prefix . NO_TESTCASE_BY_THIS_NAME_STR); break; - case 1 : + case 1: $status_ok = true; break; - default : + default: // multiple matches. $status_ok = true; break; @@ -2409,11 +2714,13 @@ public function getTestCaseIDByName($args) { // what to do ? // check access for each result and remove result if user has no access to corresponding // test project. - if($status_ok) { + if ($status_ok) { $out = null; - foreach( $result as $testcase ) { - $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->get_testproject( $testcase['id'] ); - if($this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + foreach ($result as $testcase) { + $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->get_testproject( + $testcase['id']); + if ($this->userHasRight("mgt_view_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { $out[] = $testcase; } } @@ -2470,90 +2777,106 @@ public function getTestCaseIDByName($args) { * @return boolean $resultInfo['additionalInfo']['has_duplicate'] - for debug * @return string $resultInfo['message'] operation message */ - public function createTestCase($args) { + public function createTestCase($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $wfStatusDomain = config_get( 'testCaseStatus' ); + $wfStatusDomain = config_get('testCaseStatus'); $keywordSet = ''; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestSuiteID', - 'checkTestCaseName' + 'authenticate', + 'checkTestProjectID', + 'checkTestSuiteID', + 'checkTestCaseName' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->userHasRight("mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if($status_ok) { + if ($status_ok) { $keys2check = array( - self::$authorLoginParamName, - self::$summaryParamName, - self::$stepsParamName + self::$authorLoginParamName, + self::$summaryParamName, + self::$stepsParamName ); - foreach( $keys2check as $key ) { - if(! $this->_isParamPresent( $key )) { + foreach ($keys2check as $key) { + if (! $this->_isParamPresent($key)) { $status_ok = false; - $msg = $msg_prefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $key ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + $msg = $msg_prefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $key); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, + $msg); } } } - if($status_ok) { - $author_id = tlUser::doesUserExist( $this->dbObj, $this->args[self::$authorLoginParamName] ); - if(!($status_ok = ! is_null( $author_id ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$authorLoginParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + if ($status_ok) { + $author_id = tlUser::doesUserExist($this->dbObj, + $this->args[self::$authorLoginParamName]); + if (! ($status_ok = ! is_null($author_id))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$authorLoginParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_THIS_LOGIN, $msg); } } - if($status_ok) { - $keywordSet = $this->getKeywordSet( $this->args[self::$testProjectIDParamName] ); + if ($status_ok) { + $keywordSet = $this->getKeywordSet( + $this->args[self::$testProjectIDParamName]); } - if($status_ok) { + if ($status_ok) { // Optional parameters $opt = array( - self::$importanceParamName => 2, - self::$executionTypeParamName => TESTCASE_EXECUTION_TYPE_MANUAL, - self::$orderParamName => testcase::DEFAULT_ORDER, - self::$internalIDParamName => testcase::AUTOMATIC_ID, - self::$checkDuplicatedNameParamName => testcase::DONT_CHECK_DUPLICATE_NAME, - self::$actionOnDuplicatedNameParamName => 'generate_new', - self::$preconditionsParamName => '', - self::$statusParamName => $wfStatusDomain['draft'], - self::$estimatedExecDurationParamName => null + self::$importanceParamName => 2, + self::$executionTypeParamName => TESTCASE_EXECUTION_TYPE_MANUAL, + self::$orderParamName => testcase::DEFAULT_ORDER, + self::$internalIDParamName => testcase::AUTOMATIC_ID, + self::$checkDuplicatedNameParamName => testcase::DONT_CHECK_DUPLICATE_NAME, + self::$actionOnDuplicatedNameParamName => 'generate_new', + self::$preconditionsParamName => '', + self::$statusParamName => $wfStatusDomain['draft'], + self::$estimatedExecDurationParamName => null ); - foreach( $opt as $key => $value ) { - if($this->_isParamPresent( $key )) { + foreach ($opt as $key => $value) { + if ($this->_isParamPresent($key)) { $opt[$key] = $this->args[$key]; } } } - if($status_ok) { + if ($status_ok) { $options = array( - 'check_duplicate_name' => $opt[self::$checkDuplicatedNameParamName], - 'action_on_duplicate_name' => $opt[self::$actionOnDuplicatedNameParamName], - 'status' => $opt[self::$statusParamName], - 'estimatedExecDuration' => $opt[self::$estimatedExecDurationParamName] + 'check_duplicate_name' => $opt[self::$checkDuplicatedNameParamName], + 'action_on_duplicate_name' => $opt[self::$actionOnDuplicatedNameParamName], + 'status' => $opt[self::$statusParamName], + 'estimatedExecDuration' => $opt[self::$estimatedExecDurationParamName] ); - $op_result = $this->tcaseMgr->create( $this->args[self::$testSuiteIDParamName], $this->args[self::$testCaseNameParamName], $this->args[self::$summaryParamName], $opt[self::$preconditionsParamName], $this->args[self::$stepsParamName], $author_id, $keywordSet, $opt[self::$orderParamName], $opt[self::$internalIDParamName], $opt[self::$executionTypeParamName], $opt[self::$importanceParamName], $options ); + $op_result = $this->tcaseMgr->create( + $this->args[self::$testSuiteIDParamName], + $this->args[self::$testCaseNameParamName], + $this->args[self::$summaryParamName], + $opt[self::$preconditionsParamName], + $this->args[self::$stepsParamName], $author_id, $keywordSet, + $opt[self::$orderParamName], $opt[self::$internalIDParamName], + $opt[self::$executionTypeParamName], + $opt[self::$importanceParamName], $options); $resultInfo = array(); $resultInfo[] = array( - "operation" => $operation, - "status" => true, - "id" => $op_result['id'], - "additionalInfo" => $op_result, - "message" => GENERAL_SUCCESS_STR + "operation" => $operation, + "status" => true, + "id" => $op_result['id'], + "additionalInfo" => $op_result, + "message" => GENERAL_SUCCESS_STR ); } - return($status_ok ? $resultInfo : $this->errors); + return $status_ok ? $resultInfo : $this->errors; } /** @@ -2615,16 +2938,16 @@ public function createTestCase($args) { * @param string $args["customfields"] * - optional * contains an map with key:Custom Field Name, value: value for CF. - * VERY IMPORTANT: value must be formatted in the way + * VERY IMPORTANT: value must be formatted in the way * it's written to db, * this is important for types like: * * DATE: strtotime() * DATETIME: mktime() - * MULTISELECTION LIST / CHECKBOX / RADIO: + * MULTISELECTION LIST / CHECKBOX / RADIO: * character '!'' as separator when multiple values are allowed * - * these custom fields must be configured to be writte during + * these custom fields must be configured to be writte during * execution. * If custom field do not meet condition value will not be written * @@ -2634,163 +2957,179 @@ public function createTestCase($args) { * * @param boolean $args["user"] * - optional, if present and user is a valid login - * (no other check will be done) it will be used when writting execution. + * (no other check will be done) it will be used when writting execution. * * @param string $args["timestamp"] * - optional, if not present now is used * format YYYY-MM-DD HH:MM:SS * example 2015-05-22 12:15:45 * @return mixed $resultInfo - * [status] => true/false of success - * [id] => result id or error code - * [message] => optional message for error message string + * [status] => true/false of success + * [id] => result id or error code + * [message] => optional message for error message string * @access public * * @internal revisions * */ - public function reportTCResult($args) { + public function reportTCResult($args) + { $resultInfo = array(); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $this->errors = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo[0]["status"] = true; $checkFunctions = array( - 'authenticate', - 'checkTestCaseIdentity', - 'checkTestPlanID', - 'checkBuildID', - 'checkStatus' + 'authenticate', + 'checkTestCaseIdentity', + 'checkTestPlanID', + 'checkBuildID', + 'checkStatus' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { // This check is needed only if test plan has platforms - $platformSet = (array)$this->tplanMgr->getPlatforms( $this->args[self::$testPlanIDParamName], array( + $platformSet = (array) $this->tplanMgr->getPlatforms( + $this->args[self::$testPlanIDParamName], + array( 'outputFormat' => 'map' - ) ); + )); $targetPlatform = null; - if(count($platformSet) > 0) { - $status_ok = $this->checkPlatformIdentity( $this->args[self::$testPlanIDParamName], $platformSet, $msg_prefix ); - if($status_ok) { + if (! empty($platformSet)) { + $status_ok = $this->checkPlatformIdentity( + $this->args[self::$testPlanIDParamName], $platformSet, + $msg_prefix); + if ($status_ok) { $targetPlatform[$this->args[self::$platformIDParamName]] = $platformSet[$this->args[self::$platformIDParamName]]; } } - $status_ok = $status_ok && $this->_checkTCIDAndTPIDValid( $targetPlatform, $msg_prefix ); + $status_ok = $status_ok && + $this->_checkTCIDAndTPIDValid($targetPlatform, $msg_prefix); } $tester_id = null; - if($status_ok) { + if ($status_ok) { $this->errors = null; - if($this->_isParamPresent( self::$userParamName )) { - $tester_id = tlUser::doesUserExist( $this->dbObj, $this->args[self::$userParamName] ); - if(!($status_ok = ! is_null( $tester_id ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$userParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + if ($this->_isParamPresent(self::$userParamName)) { + $tester_id = tlUser::doesUserExist($this->dbObj, + $this->args[self::$userParamName]); + if (! ($status_ok = ! is_null($tester_id))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$userParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_THIS_LOGIN, $msg); } } } $exec_ts = null; - if($status_ok) { - if($this->_isParamPresent( self::$timeStampParamName )) { - // Now check if is a valid one - $exec_ts = $this->args[self::$timeStampParamName]; - - try { - checkTimeStamp( $exec_ts ); - $exec_ts = "'{$exec_ts}'"; - } catch( Exception $e ) { - $status_ok = false; - $this->errors = null; - $msg = $msg_prefix . sprintf( INVALID_TIMESTAMP_STR, $exec_ts ); - $this->errors[] = new IXR_Error( INVALID_TIMESTAMP, $msg ); - } + if ($status_ok && $this->_isParamPresent(self::$timeStampParamName)) { + // Now check if is a valid one + $exec_ts = $this->args[self::$timeStampParamName]; + + try { + checkTimeStamp($exec_ts); + $exec_ts = "'{$exec_ts}'"; + } catch (Exception $e) { + $status_ok = false; + $this->errors = null; + $msg = $msg_prefix . sprintf(INVALID_TIMESTAMP_STR, $exec_ts); + $this->errors[] = new IXR_Error(INVALID_TIMESTAMP, $msg); } } - if($status_ok && $this->userHasRight( "testplan_execute", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && + $this->userHasRight("testplan_execute", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { $executionID = 0; $resultInfo[0]["operation"] = $operation; $resultInfo[0]["overwrite"] = false; $resultInfo[0]["status"] = true; $resultInfo[0]["message"] = GENERAL_SUCCESS_STR; - $doOverwrite = $this->_isParamPresent( self::$overwriteParamName ) && $this->args[self::$overwriteParamName]; + $doOverwrite = $this->_isParamPresent(self::$overwriteParamName) && + $this->args[self::$overwriteParamName]; - if($doOverwrite) { + if ($doOverwrite) { $resultInfo[0]["overwrite"] = true; - $executionID = $this->_updateResult( $tester_id, $exec_ts ); + $executionID = $this->_updateResult($tester_id, $exec_ts); - if($executionID != 0 && $this->_isParamPresent( self::$stepsParamName )) { + if ($executionID != 0 && + $this->_isParamPresent(self::$stepsParamName)) { $resultInfo[0]["steps"] = 'yes!'; - $resultInfo[0]["steps_sql"] = $this->_updateStepsResult( $executionID ); + $resultInfo[0]["steps_sql"] = $this->_updateStepsResult( + $executionID); } } - if($executionID == 0) { - $executionID = $this->_insertResultToDB( $tester_id, $exec_ts ); + if ($executionID == 0) { + $executionID = $this->_insertResultToDB($tester_id, $exec_ts); } $resultInfo[0]["id"] = $executionID; // Do we need to insert a bug ? - if($this->_isParamPresent( self::$bugIDParamName )) { + if ($this->_isParamPresent(self::$bugIDParamName)) { $bugID = $this->args[self::$bugIDParamName]; - $resultInfo[0]["bugidstatus"] = $this->_insertExecutionBug( $executionID, $bugID ); + $resultInfo[0]["bugidstatus"] = $this->_insertExecutionBug( + $executionID, $bugID); } - if($this->_isParamPresent( self::$customFieldsParamName )) { - $resultInfo[0]["customfieldstatus"] = $this->_insertCustomFieldExecValues( $executionID ); + if ($this->_isParamPresent(self::$customFieldsParamName)) { + $resultInfo[0]["customfieldstatus"] = $this->_insertCustomFieldExecValues( + $executionID); } - // - if($executionID > 0 && ! $resultInfo[0]["overwrite"]) { - // Get steps info - // step number, result, notes - if($this->_isParamPresent( self::$stepsParamName )) { - $resultInfo[0]["steps"] = 'yes!'; + // Get steps info + // step number, result, notes + if ($executionID > 0 && ! $resultInfo[0]["overwrite"] && + $this->_isParamPresent(self::$stepsParamName)) { + $resultInfo[0]["steps"] = 'yes!'; - $st = &$this->args[self::$stepsParamName]; - foreach( $st as $sp ) { - $nst[$sp['step_number']] = $sp; - } + $st = &$this->args[self::$stepsParamName]; + foreach ($st as $sp) { + $nst[$sp['step_number']] = $sp; + } - $r2d2 = array( - 'fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', - 'accessKey' => 'step_number', - 'renderGhostSteps' => false, - 'renderImageInline' => false - ); + $r2d2 = array( + 'fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', + 'accessKey' => 'step_number', + 'renderGhostSteps' => false, + 'renderImageInline' => false + ); - $steps = $this->tcaseMgr->getStepsSimple( $this->tcVersionID, 0, $r2d2 ); + $steps = $this->tcaseMgr->getStepsSimple($this->tcVersionID, 0, + $r2d2); - $target = DB_TABLE_PREFIX . 'execution_tcsteps'; - $resultsCfg = config_get( 'results' ); + $target = DB_TABLE_PREFIX . 'execution_tcsteps'; + $resultsCfg = config_get('results'); - foreach( $nst as $spnum => $spdata ) { - // check if step exists, if not ignore - if(isset( $steps[$spnum] )) { - // if result is not on domain, write it - // anyway. - $status = strtolower( trim( $spdata['result'] ) ); - $status = $status[0]; + foreach ($nst as $spnum => $spdata) { + // check if step exists, if not ignore + if (isset($steps[$spnum])) { + // if result is not on domain, write it + // anyway. + $status = strtolower(trim($spdata['result'])); + $status = $status[0]; - $sql = " INSERT INTO {$target}(execution_id,tcstep_id,notes"; - $sql .= ",status"; + $sql = " INSERT INTO {$target}(execution_id,tcstep_id,notes"; + $sql .= ",status"; - $values = " VALUES( {$executionID}, {$steps[$spnum]['id']}," . "'" . $this->dbObj->prepare_string( $spdata['notes'] ) . "'"; - $values .= ",'" . $this->dbObj->prepare_string( $status ) . "'"; - $sql .= ") " . $values . ")"; + $values = " VALUES( {$executionID}, {$steps[$spnum]['id']}," . + "'" . $this->dbObj->prepare_string($spdata['notes']) . + "'"; + $values .= ",'" . $this->dbObj->prepare_string($status) . + "'"; + $sql .= ") " . $values . ")"; - if($status != $resultsCfg['status_code']['not_run']) { - $this->dbObj->exec_query( $sql ); - } + if ($status != $resultsCfg['status_code']['not_run']) { + $this->dbObj->exec_query($sql); } } } @@ -2811,11 +3150,12 @@ public function reportTCResult($args) { * @return boolean * @access protected */ - public function setTestMode($args) { - $this->_setArgs( $args ); + public function setTestMode($args) + { + $this->_setArgs($args); - if(! $this->_isTestModePresent()) { - $this->errors[] = new IXR_ERROR( NO_TEST_MODE, NO_TEST_MODE_STR ); + if (! $this->_isTestModePresent()) { + $this->errors[] = new IXR_ERROR(NO_TEST_MODE, NO_TEST_MODE_STR); return false; } else { // TODO: should probably validate that this is a bool or t/f string @@ -2841,42 +3181,51 @@ public function setTestMode($args) { * @return boolean * @access protected */ - protected function checkTestCaseIdentity($messagePrefix = '') { + protected function checkTestCaseIdentity($messagePrefix = '') + { // Three Cases - Internal ID, External ID, No Id $status = false; $tcaseID = 0; - $my_errors = array(); $fromExternal = false; $fromInternal = false; - if($this->_isTestCaseIDPresent()) { + if ($this->_isTestCaseIDPresent()) { $fromInternal = true; - $status =(($tcaseID = intval( $this->args[self::$testCaseIDParamName] )) > 0); + $status = (($tcaseID = intval( + $this->args[self::$testCaseIDParamName])) > 0); - if(! $status) { - $this->errors[] = new IXR_Error( $tcaseID, sprintf( $messagePrefix . INVALID_TCASEID_STR, $tcaseID ) ); + if (! $status) { + $this->errors[] = new IXR_Error($tcaseID, + sprintf($messagePrefix . INVALID_TCASEID_STR, $tcaseID)); } - } elseif($this->_isTestCaseExternalIDPresent()) { + } elseif ($this->_isTestCaseExternalIDPresent()) { $fromExternal = true; $tcaseExternalID = $this->args[self::$testCaseExternalIDParamName]; - $tcaseID = intval( $this->tcaseMgr->getInternalID( $tcaseExternalID ) ); + $tcaseID = intval($this->tcaseMgr->getInternalID($tcaseExternalID)); $status = $tcaseID > 0 ? true : false; // Invalid TestCase ID - if(! $status) { - $this->errors[] = new IXR_Error( INVALID_TESTCASE_EXTERNAL_ID, sprintf( $messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR, $tcaseExternalID ) ); + if (! $status) { + $this->errors[] = new IXR_Error(INVALID_TESTCASE_EXTERNAL_ID, + sprintf($messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR, + $tcaseExternalID)); } } - if($status) { - if($this->_isTestCaseIDValid( $tcaseID, $messagePrefix )) { - $this->_setTestCaseID( $tcaseID ); + if ($status) { + if ($this->_isTestCaseIDValid($tcaseID, $messagePrefix)) { + $this->_setTestCaseID($tcaseID); } else { $status = false; - if($fromInternal) { - $this->errors[] = new IXR_Error( INVALID_TCASEID, sprintf( $messagePrefix . INVALID_TCASEID_STR, $tcaseID ) ); - } elseif($fromExternal) { - $this->errors[] = new IXR_Error( INVALID_TESTCASE_EXTERNAL_ID, sprintf( $messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR, $tcaseExternalID ) ); + if ($fromInternal) { + $this->errors[] = new IXR_Error(INVALID_TCASEID, + sprintf($messagePrefix . INVALID_TCASEID_STR, $tcaseID)); + } elseif ($fromExternal) { + $this->errors[] = new IXR_Error( + INVALID_TESTCASE_EXTERNAL_ID, + sprintf( + $messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR, + $tcaseExternalID)); } } } @@ -2918,99 +3267,101 @@ protected function checkTestCaseIdentity($messagePrefix = '') { * 'simple': * 'details': * @param array $args["customfields"] - * - optional can be a boolean or an array with the requested fields + * - optional can be a boolean or an array with the requested fields * @return mixed $resultInfo * * @internal revisions * @since 1.9.13 * 20141230 - franciscom - TICKET 6805: platform parameter */ - public function getTestCasesForTestPlan($args) { + public function getTestCasesForTestPlan($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; // Optional parameters that are not mutual exclusive, // DEFAULT value to use if parameter was not provided $opt = array( - self::$testCaseIDParamName => null, - self::$buildIDParamName => null, - self::$keywordIDParamName => null, - self::$executedParamName => null, - self::$assignedToParamName => null, - self::$executeStatusParamName => null, - self::$executionTypeParamName => null, - self::$getStepsInfoParamName => false, - self::$customFieldsParamName => false, - self::$detailsParamName => 'full', - self::$platformIDParamName => null + self::$testCaseIDParamName => null, + self::$buildIDParamName => null, + self::$keywordIDParamName => null, + self::$executedParamName => null, + self::$assignedToParamName => null, + self::$executeStatusParamName => null, + self::$executionTypeParamName => null, + self::$getStepsInfoParamName => false, + self::$customFieldsParamName => false, + self::$detailsParamName => 'full', + self::$platformIDParamName => null ); - $optMutualExclusive = array( - self::$keywordIDParamName => null, - self::$keywordNameParamName => null - ); - $this->_setArgs( $args ); - if(!($this->_checkGetTestCasesForTestPlanRequest( $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ))) { + $this->_setArgs($args); + if (! ($this->_checkGetTestCasesForTestPlanRequest($msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR))) { return $this->errors; } $tplanid = $this->args[self::$testPlanIDParamName]; - $tplanInfo = $this->tplanMgr->tree_manager->get_node_hierarchy_info( $tplanid ); + $tplanInfo = $this->tplanMgr->tree_manager->get_node_hierarchy_info( + $tplanid); - foreach( $opt as $key => $value ) { - if($this->_isParamPresent( $key )) { + foreach ($opt as $key => $value) { + if ($this->_isParamPresent($key)) { $opt[$key] = $this->args[$key]; } } $keywordSet = $opt[self::$keywordIDParamName]; - if(is_null( $keywordSet )) { + if (is_null($keywordSet)) { $keywordSet = null; - $keywordList = $this->getKeywordSet( $tplanInfo['parent_id'] ); - if(! is_null( $keywordList )) { - $keywordSet = explode( ",", $keywordList ); + $keywordList = $this->getKeywordSet($tplanInfo['parent_id']); + if (! is_null($keywordList)) { + $keywordSet = explode(",", $keywordList); } } $options = array( - 'executed_only' => $opt[self::$executedParamName], - 'details' => $opt[self::$detailsParamName], - 'output' => 'mapOfMap' + 'executed_only' => $opt[self::$executedParamName], + 'details' => $opt[self::$detailsParamName], + 'output' => 'mapOfMap' ); $filters = array( - 'tcase_id' => $opt[self::$testCaseIDParamName], - 'keyword_id' => $keywordSet, - 'assigned_to' => $opt[self::$assignedToParamName], - 'exec_status' => $opt[self::$executeStatusParamName], - 'build_id' => $opt[self::$buildIDParamName], - 'exec_type' => $opt[self::$executionTypeParamName], - 'platform_id' => $opt[self::$platformIDParamName] + 'tcase_id' => $opt[self::$testCaseIDParamName], + 'keyword_id' => $keywordSet, + 'assigned_to' => $opt[self::$assignedToParamName], + 'exec_status' => $opt[self::$executeStatusParamName], + 'build_id' => $opt[self::$buildIDParamName], + 'exec_type' => $opt[self::$executionTypeParamName], + 'platform_id' => $opt[self::$platformIDParamName] ); - $recordset = $this->tplanMgr->getLTCVNewGeneration( $tplanid, $filters, $options ); + $recordset = $this->tplanMgr->getLTCVNewGeneration($tplanid, $filters, + $options); // Do we need to get Test Case Steps? - if(! is_null( $recordset ) && $opt[self::$getStepsInfoParamName]) { - $itemSet = array_keys( $recordset ); - switch($options['output']) { - case 'mapOfArray' : - case 'mapOfMap' : - foreach( $itemSet as $itemKey ) { - $keySet = array_keys( $recordset[$itemKey] ); + if (! is_null($recordset) && $opt[self::$getStepsInfoParamName]) { + $itemSet = array_keys($recordset); + switch ($options['output']) { + case 'mapOfArray': + case 'mapOfMap': + foreach ($itemSet as $itemKey) { + $keySet = array_keys($recordset[$itemKey]); $target = &$recordset[$itemKey]; - foreach( $keySet as $accessKey ) { - $steps = $this->tcaseMgr->get_steps( $target[$accessKey]['tcversion_id'] ); + foreach ($keySet as $accessKey) { + $steps = $this->tcaseMgr->get_steps( + $target[$accessKey]['tcversion_id']); $target[$accessKey]['steps'] = $steps; } } break; - case 'array' : - case 'map' : - default : - foreach( $itemSet as $accessKey ) { - $sts = $this->tcaseMgr->get_steps( $recordset[$accessKey]['tcversion_id'] ); + case 'array': + case 'map': + default: + foreach ($itemSet as $accessKey) { + $sts = $this->tcaseMgr->get_steps( + $recordset[$accessKey]['tcversion_id']); $recordset[$accessKey]['steps'] = $sts; } break; @@ -3018,27 +3369,31 @@ public function getTestCasesForTestPlan($args) { } // Do we need the custom fields? - if (! is_null( $recordset ) && ($opt[self::$customFieldsParamName] || is_array($opt[self::$customFieldsParamName]))) { - $itemSet = array_keys( $recordset ); - switch($options['output']) { - case 'mapOfArray' : - case 'mapOfMap' : - foreach( $itemSet as $itemKey ) { - $keySet = array_keys( $recordset[$itemKey] ); + if (! is_null($recordset) && + ($opt[self::$customFieldsParamName] || + is_array($opt[self::$customFieldsParamName]))) { + $itemSet = array_keys($recordset); + switch ($options['output']) { + case 'mapOfArray': + case 'mapOfMap': + foreach ($itemSet as $itemKey) { + $keySet = array_keys($recordset[$itemKey]); $target = &$recordset[$itemKey]; - foreach( $keySet as $accessKey ) { + foreach ($keySet as $accessKey) { $target[$accessKey]['customfields'] = $this->_testcaseCustomFieldData( - $target[$accessKey], $tplanInfo['parent_id'], $opt[self::$customFieldsParamName]); + $target[$accessKey], $tplanInfo['parent_id'], + $opt[self::$customFieldsParamName]); } } break; - case 'array' : - case 'map' : - default : - foreach( $itemSet as $accessKey ) { + case 'array': + case 'map': + default: + foreach ($itemSet as $accessKey) { $recordset[$accessKey]['customfields'] = $this->_testcaseCustomFieldData( - $recordset[$accessKey], $tplanInfo['parent_id'], $opt[self::$customFieldsParamName]); + $recordset[$accessKey], $tplanInfo['parent_id'], + $opt[self::$customFieldsParamName]); } break; } @@ -3054,31 +3409,33 @@ public function getTestCasesForTestPlan($args) { * custom field names as $cf_options. * * @param mixed $testcase - * The testcase to query for. + * The testcase to query for. * @param int $project_id - * The project to query for. + * The project to query for. * @param array $cf_options - * The optional name filter. + * The optional name filter. * @return array * @access private */ - private function _testcaseCustomFieldData(&$testcase, $project_id, &$cf_options) { + private function _testcaseCustomFieldData(&$testcase, $project_id, + &$cf_options) + { $cf = $this->tcaseMgr->get_linked_cfields_at_design( - $testcase['tcase_id'], $testcase['tcversion_id'], - null, null, $project_id); + $testcase['tcase_id'], $testcase['tcversion_id'], null, null, + $project_id); $filtered_cf = array(); $cfieds_selected = is_array($cf_options); - foreach ($cf as $cf_id => $cfield) { - if ($cfieds_selected && !in_array($cfield['name'], $cf_options)) { + foreach ($cf as $cfield) { + if ($cfieds_selected && ! in_array($cfield['name'], $cf_options)) { continue; } $filtered_cf[$cfield['name']] = array( - 'name' => $cfield['id']['name'], - 'label' => $cfield['id']['label'], - 'type' => $cfield['id']['type'], - 'value' => $cfield['id']['value'] + 'name' => $cfield['id']['name'], + 'label' => $cfield['id']['label'], + 'type' => $cfield['id']['type'], + 'value' => $cfield['id']['value'] ); } @@ -3095,16 +3452,17 @@ private function _testcaseCustomFieldData(&$testcase, $project_id, &$cf_options) * @return boolean * @access protected */ - protected function _checkGetTestCasesForTestPlanRequest($messagePrefix = '') { + protected function _checkGetTestCasesForTestPlanRequest($messagePrefix = '') + { $status = $this->authenticate(); - if($status) { - $status &= $this->checkTestPlanID( $messagePrefix ); + if ($status) { + $status &= $this->checkTestPlanID($messagePrefix); - if($status && $this->_isTestCaseIDPresent( $messagePrefix )) { - $status &= $this->_checkTCIDAndTPIDValid( null, $messagePrefix ); + if ($status && $this->_isTestCaseIDPresent($messagePrefix)) { + $status &= $this->_checkTCIDAndTPIDValid(null, $messagePrefix); } - if($status && $this->_isBuildIDPresent( $messagePrefix )) { - $status &= $this->checkBuildID( $messagePrefix ); + if ($status && $this->_isBuildIDPresent($messagePrefix)) { + $status &= $this->checkBuildID($messagePrefix); } } return $status; @@ -3135,41 +3493,46 @@ protected function _checkGetTestCasesForTestPlanRequest($messagePrefix = '') { * * @access public */ - public function getTestCaseCustomFieldDesignValue($args) { + public function getTestCaseCustomFieldDesignValue($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestCaseIdentity', - 'checkTestCaseVersionNumber' + 'authenticate', + 'checkTestProjectID', + 'checkTestCaseIdentity', + 'checkTestCaseVersionNumber' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - $status_ok = $this->_isParamPresent( self::$customFieldNameParamName, $msg_prefix, self::SET_ERROR ); + if ($status_ok) { + $status_ok = $this->_isParamPresent(self::$customFieldNameParamName, + $msg_prefix, self::SET_ERROR); } - if($status_ok) { + if ($status_ok) { $ret = $this->checkTestCaseAncestry(); $status_ok = $ret['status_ok']; - if($status_ok) { + if ($status_ok) { // Check if version number exists for Test Case $ret = $this->checkTestCaseVersionNumberAncestry(); $status_ok = $ret['status_ok']; } - if($status_ok) { - $status_ok = $this->_checkGetTestCaseCustomFieldDesignValueRequest( $msg_prefix ); + if ($status_ok) { + $status_ok = $this->_checkGetTestCaseCustomFieldDesignValueRequest( + $msg_prefix); } else { - $this->errors[] = new IXR_Error( $ret['error_code'], $msg_prefix . $ret['error_msg'] ); + $this->errors[] = new IXR_Error($ret['error_code'], + $msg_prefix . $ret['error_msg']); } } - if($status_ok && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR)) { $details = 'value'; - if($this->_isParamPresent( self::$detailsParamName )) { + if ($this->_isParamPresent(self::$detailsParamName)) { $details = $this->args[self::$detailsParamName]; } @@ -3178,29 +3541,30 @@ public function getTestCaseCustomFieldDesignValue($args) { $tcase_id = $this->args[self::$testCaseIDParamName]; $cfield_mgr = $this->tprojectMgr->cfield_mgr; - $cfinfo = $cfield_mgr->get_by_name( $cf_name ); - $cfield = current( $cfinfo ); + $cfinfo = $cfield_mgr->get_by_name($cf_name); + $cfield = current($cfinfo); $filters = array( - 'cfield_id' => $cfield['id'] + 'cfield_id' => $cfield['id'] ); - $cfieldSpec = $this->tcaseMgr->get_linked_cfields_at_design( $tcase_id, $this->tcVersionID, null, $filters, $tproject_id ); + $cfieldSpec = $this->tcaseMgr->get_linked_cfields_at_design( + $tcase_id, $this->tcVersionID, null, $filters, $tproject_id); - switch($details) { - case 'full' : + switch ($details) { + case 'full': $retval = $cfieldSpec[$cfield['id']]; break; - case 'simple' : + case 'simple': $retval = array( - 'name' => $cf_name, - 'label' => $cfieldSpec[$cfield['id']]['label'], - 'type' => $cfieldSpec[$cfield['id']]['type'], - 'value' => $cfieldSpec[$cfield['id']]['value'] + 'name' => $cf_name, + 'label' => $cfieldSpec[$cfield['id']]['label'], + 'type' => $cfieldSpec[$cfield['id']]['type'], + 'value' => $cfieldSpec[$cfield['id']]['value'] ); break; - case 'value' : - default : + case 'value': + default: $retval = $cfieldSpec[$cfield['id']]['value']; break; } @@ -3225,8 +3589,9 @@ public function getTestCaseCustomFieldDesignValue($args) { * @return boolean * @access protected */ - protected function _checkGetTestCaseCustomFieldDesignValueRequest($messagePrefix = '') { - // $status_ok=$this->authenticate($messagePrefix); + protected function _checkGetTestCaseCustomFieldDesignValueRequest( + $messagePrefix = '') + { $cf_name = $this->args[self::$customFieldNameParamName]; // $testCaseIDParamName = "testcaseid"; @@ -3241,39 +3606,50 @@ protected function _checkGetTestCaseCustomFieldDesignValueRequest($messagePrefix // - Custom Field exists ? $cfield_mgr = $this->tprojectMgr->cfield_mgr; - $cfinfo = $cfield_mgr->get_by_name( $cf_name ); - if(!($status_ok = ! is_null( $cfinfo ))) { - $msg = sprintf( NO_CUSTOMFIELD_BY_THIS_NAME_STR, $cf_name ); - $this->errors[] = new IXR_Error( NO_CUSTOMFIELD_BY_THIS_NAME, $messagePrefix . $msg ); + $cfinfo = $cfield_mgr->get_by_name($cf_name); + if (! ($status_ok = ! is_null($cfinfo))) { + $msg = sprintf(NO_CUSTOMFIELD_BY_THIS_NAME_STR, $cf_name); + $this->errors[] = new IXR_Error(NO_CUSTOMFIELD_BY_THIS_NAME, + $messagePrefix . $msg); } // - Can be used on a test case ? - if($status_ok) { - $cfield = current( $cfinfo ); - $status_ok =(strcasecmp( $cfield['node_type'], 'testcase' ) == 0); - if(! $status_ok) { - $msg = sprintf( CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE_STR, $cf_name, 'testcase', $cfield['node_type'] ); - $this->errors[] = new IXR_Error( CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE, $messagePrefix . $msg ); + if ($status_ok) { + $cfield = current($cfinfo); + $status_ok = (strcasecmp($cfield['node_type'], 'testcase') == 0); + if (! $status_ok) { + $msg = sprintf(CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE_STR, $cf_name, + 'testcase', $cfield['node_type']); + $this->errors[] = new IXR_Error( + CUSTOMFIELD_NOT_APP_FOR_NODE_TYPE, $messagePrefix . $msg); } } // - Custom Field scope includes 'design' ? - if($status_ok) { - $status_ok =($cfield['show_on_design'] || $cfield['enable_on_design']); - if(! $status_ok) { - $msg = sprintf( CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE_STR, $cf_name ); - $this->errors[] = new IXR_Error( CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE, $messagePrefix . $msg ); + if ($status_ok) { + $status_ok = ($cfield['show_on_design'] || + $cfield['enable_on_design']); + if (! $status_ok) { + $msg = sprintf(CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE_STR, $cf_name); + $this->errors[] = new IXR_Error( + CUSTOMFIELD_HAS_NOT_DESIGN_SCOPE, $messagePrefix . $msg); } } // - is linked to testproject that owns test case ? - if($status_ok) { - $allCF = $cfield_mgr->get_linked_to_testproject( $this->args[self::$testProjectIDParamName] ); - $status_ok = ! is_null( $allCF ) && isset( $allCF[$cfield['id']] ); - if(! $status_ok) { - $tproject_info = $this->tprojectMgr->get_by_id( $this->args[self::$testProjectIDParamName] ); - $msg = sprintf( CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT_STR, $cf_name, $tproject_info['name'], $this->args[self::$testProjectIDParamName] ); - $this->errors[] = new IXR_Error( CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT, $messagePrefix . $msg ); + if ($status_ok) { + $allCF = $cfield_mgr->get_linked_to_testproject( + $this->args[self::$testProjectIDParamName]); + $status_ok = ! is_null($allCF) && isset($allCF[$cfield['id']]); + if (! $status_ok) { + $tproject_info = $this->tprojectMgr->get_by_id( + $this->args[self::$testProjectIDParamName]); + $msg = sprintf(CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT_STR, + $cf_name, $tproject_info['name'], + $this->args[self::$testProjectIDParamName]); + $this->errors[] = new IXR_Error( + CUSTOMFIELD_NOT_ASSIGNED_TO_TESTPROJECT, + $messagePrefix . $msg); } } @@ -3290,20 +3666,21 @@ protected function _checkGetTestCaseCustomFieldDesignValueRequest($messagePrefix * * @access protected */ - protected function getKeywordSet($tproject_id) { + protected function getKeywordSet($tproject_id) + { $keywordSet = null; $kMethod = null; - if($this->_isParamPresent( self::$keywordNameParamName )) { + if ($this->_isParamPresent(self::$keywordNameParamName)) { $kMethod = 'getValidKeywordSetByName'; $accessKey = self::$keywordNameParamName; - } else if($this->_isParamPresent( self::$keywordIDParamName )) { + } elseif ($this->_isParamPresent(self::$keywordIDParamName)) { $kMethod = 'getValidKeywordSetById'; $accessKey = self::$keywordIDParamName; } - if(! is_null( $kMethod )) { - $keywordSet = $this->$kMethod( $tproject_id, $this->args[$accessKey] ); + if (! is_null($kMethod)) { + $keywordSet = $this->$kMethod($tproject_id, $this->args[$accessKey]); } return $keywordSet; @@ -3320,8 +3697,9 @@ protected function getKeywordSet($tproject_id) { * * @access protected */ - protected function getValidKeywordSetByName($tproject_id, $keywords) { - return $this->getValidKeywordSet( $tproject_id, $keywords, true ); + protected function getValidKeywordSetByName($tproject_id, $keywords) + { + return $this->getValidKeywordSet($tproject_id, $keywords, true); } /** @@ -3334,41 +3712,44 @@ protected function getValidKeywordSetByName($tproject_id, $keywords) { * this to true if $keywords is an array of keywords, false if it's an array of keywordIDs * @return string that represent a list of keyword id(comma is character separator) */ - protected function getValidKeywordSet($tproject_id, $keywords, $byName, $op = null) { + protected function getValidKeywordSet($tproject_id, $keywords, $byName, + $op = null) + { $keywordSet = array(); - $sql = " SELECT keyword,id FROM {$this->tables['keywords']} " . " WHERE testproject_id = {$tproject_id} "; + $sql = " SELECT keyword,id FROM {$this->tables['keywords']} " . + " WHERE testproject_id = {$tproject_id} "; - $keywords = trim( $keywords ); - if($keywords != "") { - $a_keywords = explode( ",", $keywords ); - $items_qty = count( $a_keywords ); - for($idx = 0; $idx < $items_qty; $idx ++) { - $a_keywords[$idx] = trim( $a_keywords[$idx] ); + $keywords = trim($keywords); + if ($keywords != "") { + $a_keywords = explode(",", $keywords); + $items_qty = count($a_keywords); + for ($idx = 0; $idx < $items_qty; $idx ++) { + $a_keywords[$idx] = trim($a_keywords[$idx]); } - $itemSet = implode( "','", $a_keywords ); + $itemSet = implode("','", $a_keywords); - if($byName) { + if ($byName) { $sql .= " AND keyword IN('{$itemSet}')"; } else { $sql .= " AND id IN({$itemSet})"; } } - $keywordMap = $this->dbObj->fetchRowsIntoMap( $sql, 'keyword' ); - if(! is_null( $keywordMap )) { - if(is_null( $op )) { + $keywordMap = $this->dbObj->fetchRowsIntoMap($sql, 'keyword'); + if (! is_null($keywordMap)) { + if (is_null($op)) { $a_items = null; - for($idx = 0; $idx < $items_qty; $idx ++) { - if(isset( $keywordMap[$a_keywords[$idx]] )) { + for ($idx = 0; $idx < $items_qty; $idx ++) { + if (isset($keywordMap[$a_keywords[$idx]])) { $a_items[] = $keywordMap[$a_keywords[$idx]]['id']; } } - if(! is_null( $a_items )) { - $keywordSet = implode( ",", $a_items ); + if (! is_null($a_items)) { + $keywordSet = implode(",", $a_items); } } else { - foreach( $keywordMap as $kw => $elem ) { + foreach ($keywordMap as $elem) { $keywordSet[$elem['id']] = $elem['keyword']; } } @@ -3388,35 +3769,39 @@ protected function getValidKeywordSet($tproject_id, $keywords, $byName, $op = nu * * @access protected */ - protected function getValidKeywordSetById($tproject_id, $keywords) { - return $this->getValidKeywordSet( $tproject_id, $keywords, false ); + protected function getValidKeywordSetById($tproject_id, $keywords) + { + return $this->getValidKeywordSet($tproject_id, $keywords, false); } /** * Checks a version number * - * - is present - * - is integer - * - is strictly positive + * - is present + * - is integer + * - is strictly positive * * @return boolean * * @access protected */ - protected function checkVersionNumber() { + protected function checkVersionNumber() + { $status = true; - if(!($status = $this->_isParamPresent( self::$versionNumberParamName ))) { - $msg = sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$versionNumberParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + if (! ($status = $this->_isParamPresent(self::$versionNumberParamName))) { + $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$versionNumberParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } else { $version = $this->args[self::$versionNumberParamName]; - if(!($status = is_int( $version ))) { - $msg = sprintf( PARAMETER_NOT_INT_STR, self::$versionNumberParamName, $version ); - $this->errors[] = new IXR_Error( PARAMETER_NOT_INT, $msg ); + if (! ($status = is_int($version))) { + $msg = sprintf(PARAMETER_NOT_INT_STR, + self::$versionNumberParamName, $version); + $this->errors[] = new IXR_Error(PARAMETER_NOT_INT, $msg); } else { - if(!($status =($version > 0))) { - $msg = sprintf( VERSION_NOT_VALID_STR, $version ); - $this->errors[] = new IXR_Error( VERSION_NOT_VALID, $msg ); + if (! ($status = ($version > 0))) { + $msg = sprintf(VERSION_NOT_VALID_STR, $version); + $this->errors[] = new IXR_Error(VERSION_NOT_VALID, $msg); } } } @@ -3433,8 +3818,9 @@ protected function checkVersionNumber() { * * @access protected */ - protected function checkTestCaseVersionNumber() { - return $this->checkVersionNumber(); + protected function checkTestCaseVersionNumber() + { + return $this->checkVersionNumber(); } /** @@ -3458,10 +3844,11 @@ protected function checkTestCaseVersionNumber() { * args['overwrite'] - OPTIONAL * */ - public function addTestCaseToTestPlan($args) { + public function addTestCaseToTestPlan($args) + { $operation = __FUNCTION__; $messagePrefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $op_result = null; $additional_fields = ''; @@ -3471,76 +3858,85 @@ public function addTestCaseToTestPlan($args) { $hasPlatformIDArgs = false; $platform_id = 0; $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestCaseVersionNumber', - 'checkTestCaseIdentity', - 'checkTestPlanID' + 'authenticate', + 'checkTestProjectID', + 'checkTestCaseVersionNumber', + 'checkTestCaseIdentity', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); // Test Plan belongs to test project ? - if($status_ok) { + if ($status_ok) { $tproject_id = $this->args[self::$testProjectIDParamName]; $tplan_id = $this->args[self::$testPlanIDParamName]; - $tplan_info = $this->tplanMgr->get_by_id( $tplan_id ); + $tplan_info = $this->tplanMgr->get_by_id($tplan_id); - $sql = " SELECT id FROM {$this->tables['testplans']}" . " WHERE testproject_id={$tproject_id} AND id = {$tplan_id}"; + $sql = " SELECT id FROM {$this->tables['testplans']}" . + " WHERE testproject_id={$tproject_id} AND id = {$tplan_id}"; - $rs = $this->dbObj->get_recordset( $sql ); + $rs = $this->dbObj->get_recordset($sql); - if(count( $rs ) != 1) { + if (count($rs) != 1) { $status_ok = false; - $tproject_info = $this->tprojectMgr->get_by_id( $tproject_id ); - $msg = sprintf( TPLAN_TPROJECT_KO_STR, $tplan_info['name'], $tplan_id, $tproject_info['name'], $tproject_id ); - $this->errors[] = new IXR_Error( TPLAN_TPROJECT_KO, $msg_prefix . $msg ); + $tproject_info = $this->tprojectMgr->get_by_id($tproject_id); + $msg = sprintf(TPLAN_TPROJECT_KO_STR, $tplan_info['name'], + $tplan_id, $tproject_info['name'], $tproject_id); + $this->errors[] = new IXR_Error(TPLAN_TPROJECT_KO, + $msg_prefix . $msg); } } // Test Case belongs to test project ? - if($status_ok) { + if ($status_ok) { $ret = $this->checkTestCaseAncestry(); $status_ok = $ret['status_ok']; - if(! $ret['status_ok']) { - $this->errors[] = new IXR_Error( $ret['error_code'], $msg_prefix . $ret['error_msg'] ); + if (! $ret['status_ok']) { + $this->errors[] = new IXR_Error($ret['error_code'], + $msg_prefix . $ret['error_msg']); } } // Does this Version number exist for this test case ? - if($status_ok) { + if ($status_ok) { $tcase_id = $this->args[self::$testCaseIDParamName]; $version_number = $this->args[self::$versionNumberParamName]; - $sql = " SELECT TCV.version,TCV.id " . " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . " WHERE NH.parent_id = {$tcase_id} " . " AND TCV.version = {$version_number} " . " AND TCV.id = NH.id "; + $sql = " SELECT TCV.version,TCV.id " . + " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . + " WHERE NH.parent_id = {$tcase_id} " . + " AND TCV.version = {$version_number} " . " AND TCV.id = NH.id "; - $target_tcversion = $this->dbObj->fetchRowsIntoMap( $sql, 'version' ); - if(is_null( $target_tcversion ) || count( $target_tcversion ) != 1) { + $target_tcversion = $this->dbObj->fetchRowsIntoMap($sql, 'version'); + if (is_null($target_tcversion) || count($target_tcversion) != 1) { $status_ok = false; - $tcase_info = $this->tcaseMgr->get_by_id( $tcase_id ); - $msg = sprintf( TCASE_VERSION_NUMBER_KO_STR, $version_number, $tcase_external_id, $tcase_info[0]['name'] ); - $this->errors[] = new IXR_Error( TCASE_VERSION_NUMBER_KO, $msg_prefix . $msg ); + $tcase_info = $this->tcaseMgr->get_by_id($tcase_id); + $msg = sprintf(TCASE_VERSION_NUMBER_KO_STR, $version_number, + $tcase_external_id, $tcase_info[0]['name']); + $this->errors[] = new IXR_Error(TCASE_VERSION_NUMBER_KO, + $msg_prefix . $msg); } } - if($status_ok) { + if ($status_ok) { // Optional parameters $additional_fields = null; $additional_values = null; $opt_fields = array( - self::$urgencyParamName => 'urgency', - self::$executionOrderParamName => 'node_order' + self::$urgencyParamName => 'urgency', + self::$executionOrderParamName => 'node_order' ); $opt_values = array( - self::$urgencyParamName => null, - self::$executionOrderParamName => 1 + self::$urgencyParamName => null, + self::$executionOrderParamName => 1 ); - foreach( $opt_fields as $key => $field_name ) { - if($this->_isParamPresent( $key )) { + foreach ($opt_fields as $key => $field_name) { + if ($this->_isParamPresent($key)) { $additional_values[] = $this->args[$key]; $additional_fields[] = $field_name; } else { - if(! is_null( $opt_values[$key] )) { + if (! is_null($opt_values[$key])) { $additional_values[] = $opt_values[$key]; $additional_fields[] = $field_name; } @@ -3548,34 +3944,41 @@ public function addTestCaseToTestPlan($args) { } } - if($status_ok) { + if ($status_ok) { // 20100705 - work in progress - BUGID 3564 // if test plan has platforms, platformid argument is MANDATORY $opt = array( - 'outputFormat' => 'mapAccessByID' + 'outputFormat' => 'mapAccessByID' ); - $platformSet = (arrya)$this->tplanMgr->getPlatforms( $tplan_id, $opt ); - $hasPlatforms = (count( $platformSet ) > 0); - $hasPlatformIDArgs = $this->_isParamPresent( self::$platformIDParamName ); + $platformSet = (array) $this->tplanMgr->getPlatforms($tplan_id, $opt); + $hasPlatforms = (! empty($platformSet)); + $hasPlatformIDArgs = $this->_isParamPresent( + self::$platformIDParamName); - if($hasPlatforms) { - if($hasPlatformIDArgs) { + if ($hasPlatforms) { + if ($hasPlatformIDArgs) { // Check if platform id belongs to test plan $platform_id = $this->args[self::$platformIDParamName]; - $status_ok = isset( $platformSet[$platform_id] ); - if(! $status_ok) { - $msg = sprintf( PLATFORM_ID_NOT_LINKED_TO_TESTPLAN_STR, $platform_id, $tplan_info['name'] ); - $this->errors[] = new IXR_Error( PLATFORM_ID_NOT_LINKED_TO_TESTPLAN, $msg ); + $status_ok = isset($platformSet[$platform_id]); + if (! $status_ok) { + $msg = sprintf(PLATFORM_ID_NOT_LINKED_TO_TESTPLAN_STR, + $platform_id, $tplan_info['name']); + $this->errors[] = new IXR_Error( + PLATFORM_ID_NOT_LINKED_TO_TESTPLAN, $msg); } } else { - $msg = sprintf( MISSING_PLATFORMID_BUT_NEEDED_STR, $tplan_info['name'], $tplan_id ); - $this->errors[] = new IXR_Error( MISSING_PLATFORMID_BUT_NEEDED, $msg_prefix . $msg ); + $msg = sprintf(MISSING_PLATFORMID_BUT_NEEDED_STR, + $tplan_info['name'], $tplan_id); + $this->errors[] = new IXR_Error( + MISSING_PLATFORMID_BUT_NEEDED, $msg_prefix . $msg); $status_ok = false; } } } - if($status_ok && $this->userHasRight( "testplan_planning", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && + $this->userHasRight("testplan_planning", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { // 20100711 - franciscom // Because for TL 1.9 link is done to test plan + platform, logic used // to understand what to unlink has to be changed. @@ -3593,37 +3996,49 @@ public function addTestCaseToTestPlan($args) { // May be is not wise, IMHO this must be refactored, and give user indication that // requested version already is part of Test Plan. // - $sql = " SELECT TCV.version,TCV.id " . " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . " WHERE NH.parent_id = " . intval( $tcase_id ) . " AND TCV.id = NH.id "; + $sql = " SELECT TCV.version,TCV.id " . + " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . + " WHERE NH.parent_id = " . intval($tcase_id) . + " AND TCV.id = NH.id "; - $all_tcversions = $this->dbObj->fetchRowsIntoMap( $sql, 'id' ); - $id_set = array_keys( $all_tcversions ); + $all_tcversions = $this->dbObj->fetchRowsIntoMap($sql, 'id'); + $id_set = array_keys($all_tcversions); // get records regarding all test case versions linked to test plan - $in_clause = implode( ",", $id_set ); - $sql = " SELECT tcversion_id, platform_id, PLAT.name FROM {$this->tables['testplan_tcversions']} TPTCV " . " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = platform_id " . " WHERE TPTCV.testplan_id={$tplan_id} AND TPTCV.tcversion_id IN({$in_clause}) "; + $in_clause = implode(",", $id_set); + $sql = " SELECT tcversion_id, platform_id, PLAT.name FROM {$this->tables['testplan_tcversions']} TPTCV " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = platform_id " . + " WHERE TPTCV.testplan_id={$tplan_id} AND TPTCV.tcversion_id IN({$in_clause}) "; - if($hasPlatforms) { - $sql .= " AND TPTCV.platform_id=" . intval( $platform_id ); + if ($hasPlatforms) { + $sql .= " AND TPTCV.platform_id=" . intval($platform_id); } - $rs = $this->dbObj->fetchMapRowsIntoMap( $sql, 'tcversion_id', 'platform_id' ); + $rs = $this->dbObj->fetchMapRowsIntoMap($sql, 'tcversion_id', + 'platform_id'); - $doLink = is_null( $rs ); + $doLink = is_null($rs); - if(! $doLink) { + if (! $doLink) { // Are we going to update ? - if(isset( $rs[$target_tcversion[$version_number]['id']] )) { - if($hasPlatforms) { - $plat_keys = array_flip( array_keys( $rs[$target_tcversion[$version_number]['id']] ) ); + if (isset($rs[$target_tcversion[$version_number]['id']])) { + if ($hasPlatforms) { + $plat_keys = array_flip( + array_keys( + $rs[$target_tcversion[$version_number]['id']])); // need to understand what where the linked platforms. $platform_id = $this->args[self::$platformIDParamName]; - $linkExists = isset( $plat_keys[$platform_id] ); + $linkExists = isset($plat_keys[$platform_id]); $doLink = ! $linkExists; - if($linkExists) { + if ($linkExists) { $platform_name = $rs[$target_tcversion[$version_number]['id']][$platform_id]['name']; - $msg = sprintf( LINKED_FEATURE_ALREADY_EXISTS_STR, $tplan_info['name'], $tplan_id, $platform_name, $platform_id ); - $this->errors[] = new IXR_Error( LINKED_FEATURE_ALREADY_EXISTS, $msg_prefix . $msg ); + $msg = sprintf(LINKED_FEATURE_ALREADY_EXISTS_STR, + $tplan_info['name'], $tplan_id, $platform_name, + $platform_id); + $this->errors[] = new IXR_Error( + LINKED_FEATURE_ALREADY_EXISTS, + $msg_prefix . $msg); $status_ok = false; } } else { @@ -3636,61 +4051,68 @@ public function addTestCaseToTestPlan($args) { } else { // Other version than requested done is already linked $doLink = false; - if($this->_isParamPresent( self::$overwriteParamName ) && $this->args[self::$overwriteParamName]) { + if ($this->_isParamPresent(self::$overwriteParamName) && + $this->args[self::$overwriteParamName]) { $doLink = $doDeleteLinks = true; } - reset( $rs ); - $linked_tcversion = key( $rs ); + reset($rs); + $linked_tcversion = key($rs); $other_version = $all_tcversions[$linked_tcversion]['version']; - if(! $doLink) { + if (! $doLink) { $doLink = false; - $msg = sprintf( OTHER_VERSION_IS_ALREADY_LINKED_STR, $other_version, $version_number, $tplan_info['name'], $tplan_id ); - $this->errors[] = new IXR_Error( OTHER_VERSION_IS_ALREADY_LINKED, $msg_prefix . $msg ); + $msg = sprintf(OTHER_VERSION_IS_ALREADY_LINKED_STR, + $other_version, $version_number, $tplan_info['name'], + $tplan_id); + $this->errors[] = new IXR_Error( + OTHER_VERSION_IS_ALREADY_LINKED, $msg_prefix . $msg); $status_ok = false; } } } - if($doLink && $hasPlatforms) { + if ($doLink && $hasPlatforms) { $additional_values[] = $platform_id; $additional_fields[] = 'platform_id'; } - if($doDeleteLinks) { - // $in_clause=implode(",",$id_set); - $sql = " DELETE FROM {$this->tables['testplan_tcversions']} " . " WHERE testplan_id=" . intval( $tplan_id ) . " AND tcversion_id=" . intval( $linked_tcversion ); + if ($doDeleteLinks) { + $sql = " DELETE FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id=" . intval($tplan_id) . + " AND tcversion_id=" . intval($linked_tcversion); - if($hasPlatforms) { - $sql .= " AND platform_id=" . intval( $platform_id ); + if ($hasPlatforms) { + $sql .= " AND platform_id=" . intval($platform_id); } - $this->dbObj->exec_query( $sql ); + $this->dbObj->exec_query($sql); } - if($doLink) { + if ($doLink) { $fields = "testplan_id,tcversion_id,author_id,creation_ts"; - if(! is_null( $additional_fields )) { - $dummy = implode( ",", $additional_fields ); + if (! is_null($additional_fields)) { + $dummy = implode(",", $additional_fields); $fields .= ',' . $dummy; } - $sql_values = "{$tplan_id},{$target_tcversion[$version_number]['id']}," . "{$this->userID},{$this->dbObj->db_now()}"; - if(! is_null( $additional_values )) { - $dummy = implode( ",", $additional_values ); + $sql_values = "{$tplan_id},{$target_tcversion[$version_number]['id']}," . + "{$this->userID},{$this->dbObj->db_now()}"; + if (! is_null($additional_values)) { + $dummy = implode(",", $additional_values); $sql_values .= ',' . $dummy; } $sql = " INSERT INTO {$this->tables['testplan_tcversions']}({$fields}) VALUES({$sql_values})"; - $this->dbObj->exec_query( $sql ); + $this->dbObj->exec_query($sql); - $op_result['feature_id'] = $this->dbObj->insert_id( $this->tables['testplan_tcversions'] ); + $op_result['feature_id'] = $this->dbObj->insert_id( + $this->tables['testplan_tcversions']); } $op_result['operation'] = $operation; $op_result['status'] = true; $op_result['message'] = ''; } - return($status_ok ? $op_result : $this->errors); + return $status_ok ? $op_result : $this->errors; } /** @@ -3702,24 +4124,28 @@ public function addTestCaseToTestPlan($args) { * @return array * */ - public function getFirstLevelTestSuitesForTestProject($args) { + public function getFirstLevelTestSuitesForTestProject($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID' + 'authenticate', + 'checkTestProjectID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - $result = $this->tprojectMgr->get_first_level_test_suites( $this->args[self::$testProjectIDParamName] ); - if(is_null( $result )) { + if ($status_ok) { + $result = $this->tprojectMgr->get_first_level_test_suites( + $this->args[self::$testProjectIDParamName]); + if (is_null($result)) { $status_ok = false; - $tproject_info = $this->tprojectMgr->get_by_id( $this->args[self::$testProjectIDParamName] ); - $msg = $msg_prefix . sprintf( TPROJECT_IS_EMPTY_STR, $tproject_info['name'] ); - $this->errors[] = new IXR_ERROR( TPROJECT_IS_EMPTY, $msg ); + $tproject_info = $this->tprojectMgr->get_by_id( + $this->args[self::$testProjectIDParamName]); + $msg = $msg_prefix . + sprintf(TPROJECT_IS_EMPTY_STR, $tproject_info['name']); + $this->errors[] = new IXR_ERROR(TPROJECT_IS_EMPTY, $msg); } } return $status_ok ? $result : $this->errors; @@ -3743,56 +4169,60 @@ public function getFirstLevelTestSuitesForTestProject($args) { * array('req_spec' => 3,'requirements' => array(22,42)) * */ - public function assignRequirements($args) { + public function assignRequirements($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestProjectID', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { $ret = $this->checkTestCaseAncestry(); $status_ok = $ret['status_ok']; - if(! $status_ok) { - $this->errors[] = new IXR_Error( $ret['error_code'], $msg_prefix . $ret['error_msg'] ); + if (! $status_ok) { + $this->errors[] = new IXR_Error($ret['error_code'], + $msg_prefix . $ret['error_msg']); } } - if($status_ok) { + if ($status_ok) { $ret = $this->checkReqSpecQuality(); $status_ok = $ret['status_ok']; - if(! $status_ok) { - $this->errors[] = new IXR_Error( $ret['error_code'], $msg_prefix . $ret['error_msg'] ); + if (! $status_ok) { + $this->errors[] = new IXR_Error($ret['error_code'], + $msg_prefix . $ret['error_msg']); } } - if($status_ok) { + if ($status_ok) { // assignment // Note: when test case identity is checked this args key is setted // this does not means that this mut be present on method call. // $tcase_id = $this->args[self::$testCaseIDParamName]; - foreach( $this->args[self::$requirementsParamName] as $item ) { - foreach( $item['requirements'] as $req_id ) { - $this->reqMgr->assignToTCaseUsingLatestVersions( $req_id, $tcase_id, $this->userID ); + foreach ($this->args[self::$requirementsParamName] as $item) { + foreach ($item['requirements'] as $req_id) { + $this->reqMgr->assignToTCaseUsingLatestVersions($req_id, + $tcase_id, $this->userID); } } $resultInfo[] = array( - "operation" => $operation, - "status" => true, - "id" => - 1, - "additionalInfo" => '', - "message" => GENERAL_SUCCESS_STR + "operation" => $operation, + "status" => true, + "id" => - 1, + "additionalInfo" => '', + "message" => GENERAL_SUCCESS_STR ); } - return($status_ok ? $resultInfo : $this->errors); + return $status_ok ? $resultInfo : $this->errors; } /** @@ -3801,34 +4231,36 @@ public function assignRequirements($args) { * @param string $messagePrefix * used to be prepended to error message * - * @return map with following keys + * @return array with following keys * boolean map['status_ok'] * string map['error_msg'] * int map['error_code'] */ - protected function checkTestCaseAncestry($messagePrefix = '') { + protected function checkTestCaseAncestry($messagePrefix = '') + { $ret = array( - 'status_ok' => true, - 'error_msg' => '', - 'error_code' => 0 + 'status_ok' => true, + 'error_msg' => '', + 'error_code' => 0 ); $tproject_id = $this->args[self::$testProjectIDParamName]; $tcase_id = $this->args[self::$testCaseIDParamName]; - $tcase_tproject_id = $this->tcaseMgr->get_testproject( $tcase_id ); + $tcase_tproject_id = $this->tcaseMgr->get_testproject($tcase_id); - if($tcase_tproject_id != $tproject_id) { - $status_ok = false; - $tcase_info = $this->tcaseMgr->get_by_id( $tcase_id ); - $dummy = $this->tcaseMgr->getExternalID( $tcase_id ); + if ($tcase_tproject_id != $tproject_id) { + $tcase_info = $this->tcaseMgr->get_by_id($tcase_id); + $dummy = $this->tcaseMgr->getExternalID($tcase_id); $tcase_external_id = $dummy[0]; - $tproject_info = $this->tprojectMgr->get_by_id( $tproject_id ); - $msg = $messagePrefix . sprintf( TCASE_TPROJECT_KO_STR, $tcase_external_id, $tcase_info[0]['name'], $tproject_info['name'], $tproject_id ); + $tproject_info = $this->tprojectMgr->get_by_id($tproject_id); + $msg = $messagePrefix . + sprintf(TCASE_TPROJECT_KO_STR, $tcase_external_id, + $tcase_info[0]['name'], $tproject_info['name'], $tproject_id); $ret = array( - 'status_ok' => false, - 'error_msg' => $msg, - 'error_code' => TCASE_TPROJECT_KO + 'status_ok' => false, + 'error_msg' => $msg, + 'error_code' => TCASE_TPROJECT_KO ); } return $ret; @@ -3838,9 +4270,9 @@ protected function checkTestCaseAncestry($messagePrefix = '') { * Helper method to check if the requirement ID provided is valid * * It is valid when: - * - is present - * - is integer - * - exists in DB + * - is present + * - is integer + * - exists in DB * * @param string $messagePrefix * used to be prepended to error message @@ -3848,51 +4280,52 @@ protected function checkTestCaseAncestry($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkReqID($messagePrefix = '') { - $status = false; - - if ($this->_isRequirementIDPresent()) { - $reqID = $this->args[self::$requirementIDParamName]; - if (is_int($reqID)) { - // See if this req ID exists in the DB - $reqID = $this->dbObj->prepare_int($reqID); - $query = "SELECT NH.id AS id " . - "FROM {$this->tables['nodes_hierarchy']} NH, " . - "{$this->tables['node_types']} NT " . - "WHERE NH.id={$reqID} " . - "AND NH.node_type_id=NT.id " . - "AND NT.description='requirement'"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - - if($result) { - $status = true; - - } else { - $msg = $messagePrefix . sprintf( REQ_KO_STR, $reqID ); - $this->errors[] = new IXR_Error( REQ_KO, $msg ); - } + protected function checkReqID($messagePrefix = '') + { + $status = false; + if ($this->_isRequirementIDPresent()) { + $reqID = $this->args[self::$requirementIDParamName]; + if (is_int($reqID)) { + // See if this req ID exists in the DB + $reqID = $this->dbObj->prepare_int($reqID); + $query = "SELECT NH.id AS id " . + "FROM {$this->tables['nodes_hierarchy']} NH, " . + "{$this->tables['node_types']} NT " . "WHERE NH.id={$reqID} " . + "AND NH.node_type_id=NT.id " . + "AND NT.description='requirement'"; + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + + if ($result) { + $status = true; + } else { + $msg = $messagePrefix . sprintf(REQ_KO_STR, $reqID); + $this->errors[] = new IXR_Error(REQ_KO, $msg); + } + } else { + $msg = $messagePrefix . + sprintf(PARAMETER_NOT_INT_STR, self::$requirementIDParamName, + $reqID); + $this->errors[] = new IXR_Error(PARAMETER_NOT_INT, $msg); + } } else { - $msg = $messagePrefix . sprintf( PARAMETER_NOT_INT_STR, self::$requirementIDParamName, $reqID ); - $this->errors[] = new IXR_Error( PARAMETER_NOT_INT, $msg ); + // required argument missing + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$requirementIDParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - } else { - // required argument missing - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$requirementIDParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } - - return $status; + return $status; } /** * Helper method to check if the requirement version ID provided is valid * * It is valid when: - * - is present - * - is integer - * - exists in DB + * - is present + * - is integer + * - exists in DB * * @param string $messagePrefix * used to be prepended to error message @@ -3900,50 +4333,51 @@ protected function checkReqID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkReqVersionID($messagePrefix = '') { - $status = false; - - if ($this->_isRequirementVersionIDPresent()) { - $reqVersionID = $this->args[self::$requirementVersionIDParamName]; - if (is_int($reqVersionID)) { - // See if this req ID exists in the DB - $reqVersionID = $this->dbObj->prepare_int($reqVersionID); - $query = "SELECT NH.id AS id " . - "FROM {$this->tables['nodes_hierarchy']} NH, " . - "{$this->tables['node_types']} NT " . - "WHERE NH.id={$reqVersionID} " . - "AND NH.node_type_id=NT.id " . - "AND NT.description='requirement_version'"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); - - if($result) { - $status = true; - - } else { - $msg = $messagePrefix . sprintf( REQ_KO_STR, $reqID ); - $this->errors[] = new IXR_Error( REQ_KO, $msg ); - } + protected function checkReqVersionID($messagePrefix = '') + { + $status = false; + if ($this->_isRequirementVersionIDPresent()) { + $reqVersionID = $this->args[self::$requirementVersionIDParamName]; + if (is_int($reqVersionID)) { + // See if this req ID exists in the DB + $reqVersionID = $this->dbObj->prepare_int($reqVersionID); + $query = "SELECT NH.id AS id " . + "FROM {$this->tables['nodes_hierarchy']} NH, " . + "{$this->tables['node_types']} NT " . + "WHERE NH.id={$reqVersionID} " . "AND NH.node_type_id=NT.id " . + "AND NT.description='requirement_version'"; + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); + + if ($result) { + $status = true; + } else { + $msg = $messagePrefix . sprintf(REQ_KO_STR, $reqID); + $this->errors[] = new IXR_Error(REQ_KO, $msg); + } + } else { + $msg = $messagePrefix . + sprintf(PARAMETER_NOT_INT_STR, self::$requirementIDParamName, + $reqVersionID); + $this->errors[] = new IXR_Error(PARAMETER_NOT_INT, $msg); + } } else { - $msg = $messagePrefix . sprintf( PARAMETER_NOT_INT_STR, self::$requirementIDParamName, $reqVersionID ); - $this->errors[] = new IXR_Error( PARAMETER_NOT_INT, $msg ); + // required argument missing + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$requirementIDParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - } else { - // required argument missing - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$requirementIDParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } - - return $status; + return $status; } /** * Helper method to check if the requirement identity provided is valid * Identity may be specified in on of theses modes: * - * - requirement Doc ID - * - requirement internal ID + * - requirement Doc ID + * - requirement internal ID * * If Doc ID is provided, the project ID must be provided. * @@ -3955,56 +4389,58 @@ protected function checkReqVersionID($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkReqIdentity($messagePrefix = '') { - - $status = false; - - if ($this->_isRequirementIDPresent()) { - - if (is_int($this->args[self::$requirementIDParamName])) { - $status = true; - } else { - $msg = $messagePrefix . sprintf( PARAMETER_NOT_INT_STR, self::$requirementIDParamName, $this->args[self::$requirementIDParamName] ); - $this->errors[] = new IXR_Error( PARAMETER_NOT_INT, $msg ); - } - - } elseif ($this->_isRequirementDocIDPresent()) { - - if ($this->checkTestProjectID()) { - // check req id exists in the project - $reqDocID = $this->args[self::$requirementDocIDParamName]; - $req = $this->reqMgr->getByDocID( $reqDocID, - $this->args[self::$testProjectIDParamName], - null, - array( - 'access_key' => 'req_doc_id', - 'output' => 'minimun' - ) ); - if(! is_null( $req )) { - // set the requirement ID - $this->args[self::$requirementIDParamName] = (int) $req[$reqDocID]['id']; - $status = true; - } else { - $msg = $messagePrefix . sprintf( NO_REQ_IN_THIS_PROJECT_STR, $reqDocID, $this->args[self::$testProjectIDParamName] ); - $this->errors[] = new IXR_Error( NO_REQ_IN_THIS_PROJECT, $msg ); - } - } - - } else { + protected function checkReqIdentity($messagePrefix = '') + { + $status = false; - // required argument missing - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$requirementIDParamName . ' or ' . self::$requirementDocIDParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + if ($this->_isRequirementIDPresent()) { - } + if (is_int($this->args[self::$requirementIDParamName])) { + $status = true; + } else { + $msg = $messagePrefix . + sprintf(PARAMETER_NOT_INT_STR, self::$requirementIDParamName, + $this->args[self::$requirementIDParamName]); + $this->errors[] = new IXR_Error(PARAMETER_NOT_INT, $msg); + } + } elseif ($this->_isRequirementDocIDPresent()) { + + if ($this->checkTestProjectID()) { + // check req id exists in the project + $reqDocID = $this->args[self::$requirementDocIDParamName]; + $req = $this->reqMgr->getByDocID($reqDocID, + $this->args[self::$testProjectIDParamName], null, + array( + 'access_key' => 'req_doc_id', + 'output' => 'minimun' + )); + if (! is_null($req)) { + // set the requirement ID + $this->args[self::$requirementIDParamName] = (int) $req[$reqDocID]['id']; + $status = true; + } else { + $msg = $messagePrefix . + sprintf(NO_REQ_IN_THIS_PROJECT_STR, $reqDocID, + $this->args[self::$testProjectIDParamName]); + $this->errors[] = new IXR_Error(NO_REQ_IN_THIS_PROJECT, $msg); + } + } + } else { - if ($status) { - $status = $this->checkReqID($messagePrefix); - } + // required argument missing + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$requirementIDParamName . ' or ' . + self::$requirementDocIDParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); + } - return $status; - } + if ($status) { + $status = $this->checkReqID($messagePrefix); + } + return $status; + } /* * checks Quality of requirements spec @@ -4012,65 +4448,72 @@ protected function checkReqIdentity($messagePrefix = '') { * Requirements Specification is present on system * Requirements Specification belongs to test project * - * @return map with following keys + * @return array with following keys * boolean map['status_ok'] * string map['error_msg'] * int map['error_code'] */ - protected function checkReqSpecQuality() { + protected function checkReqSpecQuality() + { $ret = array( - 'status_ok' => true, - 'error_msg' => '', - 'error_code' => 0 + 'status_ok' => true, + 'error_msg' => '', + 'error_code' => 0 ); $tproject_id = $this->args[self::$testProjectIDParamName]; $nodes_types = $this->tprojectMgr->tree_manager->get_available_node_types(); - foreach( $this->args[self::$requirementsParamName] as $item ) { + foreach ($this->args[self::$requirementsParamName] as $item) { // does it exist ? $req_spec_id = $item['req_spec']; - $reqspec_info = $this->reqSpecMgr->get_by_id( $req_spec_id ); - if(is_null( $reqspec_info )) { + $reqspec_info = $this->reqSpecMgr->get_by_id($req_spec_id); + if (is_null($reqspec_info)) { $status_ok = false; - $msg = sprintf( REQSPEC_KO_STR, $req_spec_id ); + $msg = sprintf(REQSPEC_KO_STR, $req_spec_id); $error_code = REQSPEC_KO; break; } // does it belongs to test project ? - $a_path = $this->tprojectMgr->tree_manager->get_path( $req_spec_id ); + $a_path = $this->tprojectMgr->tree_manager->get_path($req_spec_id); $req_spec_tproject_id = $a_path[0]['parent_id']; - if($req_spec_tproject_id != $tproject_id) { + if ($req_spec_tproject_id != $tproject_id) { $status_ok = false; - $tproject_info = $this->tprojectMgr->get_by_id( $tproject_id ); - $msg = sprintf( REQSPEC_TPROJECT_KO_STR, $reqspec_info['title'], $req_spec_id, $tproject_info['name'], $tproject_id ); + $tproject_info = $this->tprojectMgr->get_by_id($tproject_id); + $msg = sprintf(REQSPEC_TPROJECT_KO_STR, $reqspec_info['title'], + $req_spec_id, $tproject_info['name'], $tproject_id); $error_code = REQSPEC_TPROJECT_KO; break; } // does this specification have requirements ? - $my_requirements = $this->tprojectMgr->tree_manager->get_subtree_list( $req_spec_id, $nodes_types['requirement'] ); - $status_ok =(trim( $my_requirements ) != ""); - if(! $status_ok) { - $msg = sprintf( REQSPEC_IS_EMPTY_STR, $reqspec_info['title'], $req_spec_id ); + $my_requirements = $this->tprojectMgr->tree_manager->get_subtree_list( + $req_spec_id, $nodes_types['requirement']); + $status_ok = (trim($my_requirements) != ""); + if (! $status_ok) { + $msg = sprintf(REQSPEC_IS_EMPTY_STR, $reqspec_info['title'], + $req_spec_id); $error_code = REQSPEC_IS_EMPTY; break; } // if everything is OK, analise requirements - if($status_ok) { - $dummy = array_flip( explode( ",", $my_requirements ) ); - foreach( $item['requirements'] as $req_id ) { - if(! isset( $dummy[$req_id] )) { + if ($status_ok) { + $dummy = array_flip(explode(",", $my_requirements)); + foreach ($item['requirements'] as $req_id) { + if (! isset($dummy[$req_id])) { $status_ok = false; - $req_info = $this->reqMgr->get_by_id( $req_id, requirement_mgr::LATEST_VERSION ); + $req_info = $this->reqMgr->get_by_id($req_id, + requirement_mgr::LATEST_VERSION); - if(is_null( $req_info )) { - $msg = sprintf( REQ_KO_STR, $req_id ); + if (is_null($req_info)) { + $msg = sprintf(REQ_KO_STR, $req_id); $error_code = REQ_KO; } else { $req_info = $req_inf[0]; - $msg = sprintf( REQ_REQSPEC_KO_STR, $req_info['req_doc_id'], $req_info['title'], $req_id, $reqspec_info['title'], $req_spec_id ); + $msg = sprintf(REQ_REQSPEC_KO_STR, + $req_info['req_doc_id'], $req_info['title'], + $req_id, $reqspec_info['title'], $req_spec_id); $error_code = REQ_REQSPEC_KO; } break; @@ -4078,15 +4521,16 @@ protected function checkReqSpecQuality() { } } - if(! $status_ok) { + if (! $status_ok) { break; } } - if(! $status_ok) { - $ret = array('status_ok' => false, - 'error_msg' => $msg, - 'error_code' => $error_code + if (! $status_ok) { + $ret = array( + 'status_ok' => false, + 'error_msg' => $msg, + 'error_code' => $error_code ); } return $ret; @@ -4101,18 +4545,21 @@ protected function checkReqSpecQuality() { * @access protected * contribution by hnishiyama */ - protected function _insertExecutionBug($executionID, $bugID) { + protected function _insertExecutionBug($executionID, $bugID) + { // Check for existence of executionID $sql = "SELECT id FROM {$this->tables['executions']} WHERE id={$executionID}"; - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'id' ); - $status_ok = !(is_null( $rs ) || $bugID == ''); - if($status_ok) { - $safeBugID = $this->dbObj->prepare_string( $bugID ); - $sql = "SELECT execution_id FROM {$this->tables['execution_bugs']} " . "WHERE execution_id={$executionID} AND bug_id='{$safeBugID}'"; - - if(is_null( $this->dbObj->fetchRowsIntoMap( $sql, 'execution_id' ) )) { - $sql = "INSERT INTO {$this->tables['execution_bugs']} " . "(execution_id,bug_id) VALUES({$executionID},'{$safeBugID}')"; - $result = $this->dbObj->exec_query( $sql ); + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'id'); + $status_ok = ! (is_null($rs) || $bugID == ''); + if ($status_ok) { + $safeBugID = $this->dbObj->prepare_string($bugID); + $sql = "SELECT execution_id FROM {$this->tables['execution_bugs']} " . + "WHERE execution_id={$executionID} AND bug_id='{$safeBugID}'"; + + if (is_null($this->dbObj->fetchRowsIntoMap($sql, 'execution_id'))) { + $sql = "INSERT INTO {$this->tables['execution_bugs']} " . + "(execution_id,bug_id) VALUES({$executionID},'{$safeBugID}')"; + $result = $this->dbObj->exec_query($sql); $status_ok = $result ? true : false; } } @@ -4124,13 +4571,19 @@ protected function _insertExecutionBug($executionID, $bugID) { * * @param int $execution_id * - * @return map indexed by bug_id + * @return array indexed by bug_id */ - protected function _getBugsForExecutionId($execution_id) { + protected function _getBugsForExecutionId($execution_id) + { $rs = null; - if(! is_null( $execution_id ) && $execution_id != '') { - $sql = "SELECT execution_id,bug_id, B.name AS build_name " . "FROM {$this->tables['execution_bugs']} ," . " {$this->tables['executions']} E, {$this->tables['builds']} B " . "WHERE execution_id={$execution_id} " . "AND execution_id=E.id " . "AND E.build_id=B.id " . "ORDER BY B.name,bug_id"; - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'bug_id' ); + if (! is_null($execution_id) && $execution_id != '') { + $sql = "SELECT execution_id,bug_id, B.name AS build_name " . + "FROM {$this->tables['execution_bugs']} ," . + " {$this->tables['executions']} E, {$this->tables['builds']} B " . + "WHERE execution_id={$execution_id} " . + "AND execution_id=E.id " . "AND E.build_id=B.id " . + "ORDER BY B.name,bug_id"; + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'bug_id'); } return $rs; } @@ -4142,44 +4595,47 @@ protected function _getBugsForExecutionId($execution_id) { * * @param struct $args * @param string $args["devKey"] - attachm * Developer key + * attachm * Developer key * @param int $args["testsuiteid"]: * id of the testsuite * * @return mixed $resultInfo * @author dennis@etern-it.de */ - public function getTestSuiteAttachments($args) { - $this->_setArgs( $args ); - $box= null; + public function getTestSuiteAttachments($args) + { + $this->_setArgs($args); + $box = null; $checkFunctions = array( - 'authenticate', - 'checkTestSuiteID' + 'authenticate', + 'checkTestSuiteID' ); - $status_ok = $this->_runChecks( $checkFunctions ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if($status_ok) { + if ($status_ok) { $tsuite_id = $this->args[self::$testSuiteIDParamName]; - $docRepo = tlAttachmentRepository::create( $this->dbObj ); - $docSet = $docRepo->getAttachmentInfosFor( $tsuite_id, "nodes_hierarchy" ); + $docRepo = tlAttachmentRepository::create($this->dbObj); + $docSet = $docRepo->getAttachmentInfosFor($tsuite_id, + "nodes_hierarchy"); - if($docSet) { - foreach( $docSet as $docu ) { + if ($docSet) { + foreach ($docSet as $docu) { $aID = $docu["id"]; - $content = $docRepo->getAttachmentContent( $aID, $docu ); + $content = $docRepo->getAttachmentContent($aID, $docu); - if($content != null) { + if ($content != null) { $box[$aID]["id"] = $aID; $box[$aID]["name"] = $docu["file_name"]; $box[$aID]["file_type"] = $docu["file_type"]; $box[$aID]["title"] = $docu["title"]; $box[$aID]["date_added"] = $docu["date_added"]; - $box[$aID]["content"] = base64_encode( $content ); + $box[$aID]["content"] = base64_encode($content); } } } } - return $status_ok ? $box: $this->errors; + return $status_ok ? $box : $this->errors; } /** @@ -4203,55 +4659,59 @@ public function getTestSuiteAttachments($args) { * * @return mixed $resultInfo */ - public function getTestCaseAttachments($args) { - $this->_setArgs( $args ); - $box= null; - $checkFunctions = array('authenticate', - 'checkTestCaseIdentity' + public function getTestCaseAttachments($args) + { + $this->_setArgs($args); + $box = null; + $checkFunctions = array( + 'authenticate', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if( !$status_ok ) { + if (! $status_ok) { return $this->errors; - } - - if( $status_ok && - !$this->_isParamPresent( self::$versionNumberParamName ) ) { - try { - $tc = $this->getTestCase($args,self::THROW_ON_ERROR); - $this->args[self::$versionNumberParamName] = $tc[0][self::$versionNumberParamName]; - } catch (Exception $e) { - return $this->errors; - } } - + + if ($status_ok && + ! $this->_isParamPresent(self::$versionNumberParamName)) { + try { + $tc = $this->getTestCase($args, self::THROW_ON_ERROR); + $this->args[self::$versionNumberParamName] = $tc[0][self::$versionNumberParamName]; + } catch (Exception $e) { + return $this->errors; + } + } + $map = $this->checkTestCaseVersionNumberAncestry(); $status_ok = $map["status_ok"]; - - if($status_ok) { + + if ($status_ok) { $tcvid = $this->tcVersionID; - $docRepo = tlAttachmentRepository::create( $this->dbObj ); - $docSet = $docRepo->getAttachmentInfosFor( $tcvid, "tcversions" ); + $docRepo = tlAttachmentRepository::create($this->dbObj); + $docSet = $docRepo->getAttachmentInfosFor($tcvid, "tcversions"); - if($docSet) { - foreach( $docSet as $docu ) { + if ($docSet) { + foreach ($docSet as $docu) { $aID = $docu["id"]; - $content = $docRepo->getAttachmentContent( $aID, $docu ); + $content = $docRepo->getAttachmentContent($aID, $docu); - if($content != null) { + if ($content != null) { $box[$aID]["id"] = $aID; $box[$aID]["name"] = $docu["file_name"]; $box[$aID]["file_type"] = $docu["file_type"]; $box[$aID]["title"] = $docu["title"]; $box[$aID]["date_added"] = $docu["date_added"]; - $box[$aID]["content"] = base64_encode( $content ); + $box[$aID]["content"] = base64_encode($content); } } } } else { - $this->errors[] = new IXR_Error( INVALID_TESTCASE_VERSION_NUMBER, $map["error_msg"] ); + $this->errors[] = new IXR_Error(INVALID_TESTCASE_VERSION_NUMBER, + $map["error_msg"]); } - return $status_ok ? $box: $this->errors; + return $status_ok ? $box : $this->errors; } /** @@ -4272,9 +4732,10 @@ public function getTestCaseAttachments($args) { * * @return mixed $resultInfo */ - public function updateTestSuite($args) { + public function updateTestSuite($args) + { $args[self::$actionParamName] = 'update'; - return $this->createTestSuite( $args ); + return $this->createTestSuite($args); } /** @@ -4300,97 +4761,114 @@ public function updateTestSuite($args) { * * @return mixed $resultInfo */ - public function createTestSuite($args) { + public function createTestSuite($args) + { $result = array(); - $this->_setArgs( $args ); - $action = isset( $this->args, self::$actionParamName ) ? $this->args[self::$actionParamName] : 'create'; + $this->_setArgs($args); + $action = isset($this->args, self::$actionParamName) ? $this->args[self::$actionParamName] : 'create'; $checkFunctions = array( - 'authenticate', - 'checkTestProjectIdentity' + 'authenticate', + 'checkTestProjectIdentity' ); - switch($action) { - case 'update' : + switch ($action) { + case 'update': $operation = 'updateTestSuite'; $opt = array( - self::$detailsParamName => null, - self::$testSuiteNameParamName => null, - self::$orderParamName => testsuite::DEFAULT_ORDER, - self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME, - self::$actionOnDuplicatedNameParamName => 'block' + self::$detailsParamName => null, + self::$testSuiteNameParamName => null, + self::$orderParamName => testsuite::DEFAULT_ORDER, + self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME, + self::$actionOnDuplicatedNameParamName => 'block' ); break; - case 'create' : - default : + case 'create': + default: $operation = __FUNCTION__; $opt = array( - self::$orderParamName => testsuite::DEFAULT_ORDER, - self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME, - self::$actionOnDuplicatedNameParamName => 'block' + self::$orderParamName => testsuite::DEFAULT_ORDER, + self::$checkDuplicatedNameParamName => testsuite::CHECK_DUPLICATE_NAME, + self::$actionOnDuplicatedNameParamName => 'block' ); $checkFunctions[] = 'checkTestSuiteName'; break; } $msg_prefix = "({$operation}) - "; - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); // When working on PRIVATE containers, globalRole Admin is ENOUGH // because this is how TestLink works when this action is done on GUI - if($status_ok && $this->user->globalRole->dbID != TL_ROLES_ADMIN) { - $status_ok = FALSE; - if($this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && $this->user->globalRole->dbID != TL_ROLES_ADMIN) { + $status_ok = false; + if ($this->userHasRight("mgt_modify_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { $status_ok = true; } } - if($status_ok) { + if ($status_ok) { // Needed After refactoring to use checkTestProjectIdentity() $key = self::$testProjectIDParamName; $args[$key] = $this->args[$key]; // Optional parameters - foreach( $opt as $key => $value ) { - if($this->_isParamPresent( $key )) { + foreach ($opt as $key => $value) { + if ($this->_isParamPresent($key)) { $opt[$key] = $this->args[$key]; } } } - if($status_ok) { + if ($status_ok) { $parent_id = $args[self::$testProjectIDParamName]; - $tprojectInfo = $this->tprojectMgr->get_by_id( $args[self::$testProjectIDParamName] ); + $tprojectInfo = $this->tprojectMgr->get_by_id( + $args[self::$testProjectIDParamName]); - $tsuiteMgr = new testsuite( $this->dbObj ); - if($this->_isParamPresent( self::$parentIDParamName )) { + $tsuiteMgr = new testsuite($this->dbObj); + if ($this->_isParamPresent(self::$parentIDParamName)) { $parent_id = $args[self::$parentIDParamName]; // if parentid exists it must: // be a test suite id - $node_info = $tsuiteMgr->get_by_id( $args[self::$parentIDParamName] ); - if(!($status_ok = ! is_null( $node_info ))) { - $msg = sprintf( INVALID_PARENT_TESTSUITEID_STR, $args[self::$parentIDParamName], $args[self::$testSuiteNameParamName] ); - $this->errors[] = new IXR_Error( INVALID_PARENT_TESTSUITEID, $msg_prefix . $msg ); + $node_info = $tsuiteMgr->get_by_id( + $args[self::$parentIDParamName]); + if (! ($status_ok = ! is_null($node_info))) { + $msg = sprintf(INVALID_PARENT_TESTSUITEID_STR, + $args[self::$parentIDParamName], + $args[self::$testSuiteNameParamName]); + $this->errors[] = new IXR_Error(INVALID_PARENT_TESTSUITEID, + $msg_prefix . $msg); } - if($status_ok) { + if ($status_ok) { // Must belong to target test project - $root_node_id = $tsuiteMgr->getTestProjectFromTestSuite( $args[self::$parentIDParamName], null ); - - if(!($status_ok =($root_node_id == $args[self::$testProjectIDParamName]))) { - $msg = sprintf( TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR, $args[self::$parentIDParamName], $tprojectInfo['name'], $args[self::$testProjectIDParamName] ); - $this->errors[] = new IXR_Error( TESTSUITE_DONOTBELONGTO_TESTPROJECT, $msg_prefix . $msg ); + $root_node_id = $tsuiteMgr->getTestProjectFromTestSuite( + $args[self::$parentIDParamName], null); + + if (! ($status_ok = ($root_node_id == + $args[self::$testProjectIDParamName]))) { + $msg = sprintf(TESTSUITE_DONOTBELONGTO_TESTPROJECT_STR, + $args[self::$parentIDParamName], + $tprojectInfo['name'], + $args[self::$testProjectIDParamName]); + $this->errors[] = new IXR_Error( + TESTSUITE_DONOTBELONGTO_TESTPROJECT, + $msg_prefix . $msg); } } } } - if($status_ok) { - switch($action) { - case 'update' : - $op = $tsuiteMgr->update( $args[self::$testSuiteIDParamName], $args[self::$testSuiteNameParamName], $args[self::$detailsParamName], $parent_id, $opt[self::$orderParamName] ); + if ($status_ok) { + switch ($action) { + case 'update': + $op = $tsuiteMgr->update($args[self::$testSuiteIDParamName], + $args[self::$testSuiteNameParamName], + $args[self::$detailsParamName], $parent_id, + $opt[self::$orderParamName]); /* * $opt[self::$checkDuplicatedNameParamName], @@ -4398,23 +4876,29 @@ public function createTestSuite($args) { */ break; - case 'create' : - default : - $op = $tsuiteMgr->create( $parent_id, $args[self::$testSuiteNameParamName], $args[self::$detailsParamName], $opt[self::$orderParamName], $opt[self::$checkDuplicatedNameParamName], $opt[self::$actionOnDuplicatedNameParamName] ); + case 'create': + default: + $op = $tsuiteMgr->create($parent_id, + $args[self::$testSuiteNameParamName], + $args[self::$detailsParamName], + $opt[self::$orderParamName], + $opt[self::$checkDuplicatedNameParamName], + $opt[self::$actionOnDuplicatedNameParamName]); break; } - if(($status_ok = $op['status_ok'])) { + if ($status_ok = $op['status_ok']) { $op['status'] = $op['status_ok'] ? true : false; $op['operation'] = $operation; $op['additionalInfo'] = ''; $op['message'] = $op['msg']; - unset( $op['msg'] ); - unset( $op['status_ok'] ); + unset($op['msg']); + unset($op['status_ok']); $result[] = $op; } else { // @TODO needs refactoring for UPDATE action - $op['msg'] = sprintf( $op['msg'], $args[self::$testSuiteNameParamName] ); + $op['msg'] = sprintf($op['msg'], + $args[self::$testSuiteNameParamName]); $this->errors = $op; } } @@ -4431,17 +4915,19 @@ public function createTestSuite($args) { * @return boolean * @access protected */ - protected function checkTestSuiteName($messagePrefix = '') { - $status_ok = isset( $this->args[self::$testSuiteNameParamName] ) ? true : false; - if($status_ok) { + protected function checkTestSuiteName($messagePrefix = '') + { + $status_ok = isset($this->args[self::$testSuiteNameParamName]) ? true : false; + if ($status_ok) { $name = $this->args[self::$testSuiteNameParamName]; - if(! is_string( $name )) { + if (! is_string($name)) { $msg = $messagePrefix . TESTSUITENAME_NOT_STRING_STR; - $this->errors[] = new IXR_Error( TESTSUITENAME_NOT_STRING, $msg ); + $this->errors[] = new IXR_Error(TESTSUITENAME_NOT_STRING, $msg); $status_ok = false; } } else { - $this->errors[] = new IXR_Error( NO_TESTSUITENAME, $messagePrefix . NO_TESTSUITENAME_STR ); + $this->errors[] = new IXR_Error(NO_TESTSUITENAME, + $messagePrefix . NO_TESTSUITENAME_STR); } return $status_ok; } @@ -4455,13 +4941,16 @@ protected function checkTestSuiteName($messagePrefix = '') { * @return mixed $resultInfo * @access public */ - public function getTestProjectByName($args) { + public function getTestProjectByName($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = false; - $this->_setArgs( $args ); + $this->_setArgs($args); - if($this->authenticate() && $this->_isParamPresent( self::$testProjectNameParamName, $msg_prefix, self::SET_ERROR )) { - $op = $this->helperGetTestProjectByName( $msg_prefix ); + if ($this->authenticate() && + $this->_isParamPresent(self::$testProjectNameParamName, $msg_prefix, + self::SET_ERROR)) { + $op = $this->helperGetTestProjectByName($msg_prefix); $status_ok = $op['status_ok']; } return $status_ok ? $op['info'] : $this->errors; @@ -4477,45 +4966,51 @@ public function getTestProjectByName($args) { * @return mixed $resultInfo * @access public */ - public function getTestPlanByName($args) { + public function getTestPlanByName($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); - if($this->authenticate()) { + $this->_setArgs($args); + if ($this->authenticate()) { $keys2check = array( - self::$testPlanNameParamName, - self::$testProjectNameParamName + self::$testPlanNameParamName, + self::$testProjectNameParamName ); - foreach( $keys2check as $key ) { - $names[$key] = $this->_isParamPresent( $key, $msg_prefix, self::SET_ERROR ) ? trim( $this->args[$key] ) : ''; - if($names[$key] == '') { + foreach ($keys2check as $key) { + $names[$key] = $this->_isParamPresent($key, $msg_prefix, + self::SET_ERROR) ? trim($this->args[$key]) : ''; + if ($names[$key] == '') { $status_ok = false; break; } } } - if($status_ok) { + if ($status_ok) { // need to check name existences $name = $names[self::$testProjectNameParamName]; - $check_op = $this->tprojectMgr->checkNameExistence( $name ); + $check_op = $this->tprojectMgr->checkNameExistence($name); $not_found = $check_op['status_ok']; $status_ok = ! $not_found; - if($not_found) { + if ($not_found) { $status_ok = false; - $msg = $msg_prefix . sprintf( TESTPROJECTNAME_DOESNOT_EXIST_STR, $name ); - $this->errors[] = new IXR_Error( TESTPROJECTNAME_DOESNOT_EXIST, $msg ); + $msg = $msg_prefix . + sprintf(TESTPROJECTNAME_DOESNOT_EXIST_STR, $name); + $this->errors[] = new IXR_Error(TESTPROJECTNAME_DOESNOT_EXIST, + $msg); } else { - $tprojectInfo = current( $this->tprojectMgr->get_by_name( $name ) ); + $tprojectInfo = current($this->tprojectMgr->get_by_name($name)); } } - if($status_ok) { - $name = trim( $names[self::$testPlanNameParamName] ); - $info = $this->tplanMgr->get_by_name( $name, $tprojectInfo['id'] ); - if(!($status_ok = ! is_null( $info ))) { - $msg = $msg_prefix . sprintf( TESTPLANNAME_DOESNOT_EXIST_STR, $name, $tprojectInfo['name'] ); - $this->errors[] = new IXR_Error( TESTPLANNAME_DOESNOT_EXIST, $msg ); + if ($status_ok) { + $name = trim($names[self::$testPlanNameParamName]); + $info = $this->tplanMgr->get_by_name($name, $tprojectInfo['id']); + if (! ($status_ok = ! is_null($info))) { + $msg = $msg_prefix . + sprintf(TESTPLANNAME_DOESNOT_EXIST_STR, $name, + $tprojectInfo['name']); + $this->errors[] = new IXR_Error(TESTPLANNAME_DOESNOT_EXIST, $msg); } } @@ -4540,70 +5035,73 @@ public function getTestPlanByName($args) { * * @return mixed $resultInfo */ - public function getTestCase($args,$throwOnError=false) { + public function getTestCase($args, $throwOnError = false) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); - $checkFunctions = array('authenticate', - 'checkTestCaseIdentity' + $checkFunctions = array( + 'authenticate', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); $version_id = testcase::LATEST_VERSION; $version_number = - 1; - if($status_ok) { - // check optional arguments - if($this->_isParamPresent( self::$versionNumberParamName )) { - if(($status_ok = $this->checkTestCaseVersionNumber())) { - $version_id = null; - $version_number = $this->args[self::$versionNumberParamName]; - } - } + // check optional arguments + if ($status_ok && $this->_isParamPresent(self::$versionNumberParamName) && + $status_ok = $this->checkTestCaseVersionNumber()) { + $version_id = null; + $version_number = $this->args[self::$versionNumberParamName]; } - if($status_ok) { - $testCaseMgr = new testcase( $this->dbObj ); + if ($status_ok) { + $testCaseMgr = new testcase($this->dbObj); $id = $this->args[self::$testCaseIDParamName]; $filters = array( - 'active_status' => 'ALL', - 'open_status' => 'ALL', - 'version_number' => $version_number + 'active_status' => 'ALL', + 'open_status' => 'ALL', + 'version_number' => $version_number ); - $result = $testCaseMgr->get_by_id( $id, $version_id, $filters ); - - if(0 == sizeof( $result )) { + $result = $testCaseMgr->get_by_id($id, $version_id, $filters); + if (empty($result)) { $status_ok = false; - $this->errors[] = new IXR_ERROR( NO_TESTCASE_FOUND, $msg_prefix . NO_TESTCASE_FOUND_STR ); + $this->errors[] = new IXR_ERROR(NO_TESTCASE_FOUND, + $msg_prefix . NO_TESTCASE_FOUND_STR); return $this->errors; } else { - if(isset( $this->args[self::$testCaseExternalIDParamName] )) { + if (isset($this->args[self::$testCaseExternalIDParamName])) { $result[0]['full_tc_external_id'] = $this->args[self::$testCaseExternalIDParamName]; } else { - $dummy = $this->tcaseMgr->getPrefix( $id ); - $result[0]['full_tc_external_id'] = $dummy[0] . config_get( 'testcase_cfg' )->glue_character . $result[0]['tc_external_id']; + $dummy = $this->tcaseMgr->getPrefix($id); + $result[0]['full_tc_external_id'] = $dummy[0] . + config_get('testcase_cfg')->glue_character . + $result[0]['tc_external_id']; } } } - if($status_ok) { + if ($status_ok) { // before returning info need to understand if test case belongs to a test project // accessible to user requesting info // return $result[0]['id']; - $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->get_testproject( $result[0]['id'] ); - $status_ok = $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->get_testproject( + $result[0]['id']); + $status_ok = $this->userHasRight("mgt_view_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR); } - if( $status_ok ) { - return $result; + if ($status_ok) { + return $result; } else { - if( $throwOnError ) { - throw new Exception("Test Case Does Not Exist", 1); - } else { - return $this->errors; - } + if ($throwOnError) { + throw new Exception("Test Case Does Not Exist", 1); + } else { + return $this->errors; + } } } @@ -4627,34 +5125,37 @@ public function getTestCase($args,$throwOnError=false) { * @return mixed $resultInfo * @internal revisions */ - public function createTestPlan($args) { - $this->_setArgs( $args ); + public function createTestPlan($args) + { + $this->_setArgs($args); $status_ok = false; $msg_prefix = "(" . __FUNCTION__ . ") - "; - if($this->authenticate()) { + if ($this->authenticate()) { $keys2check = array( - self::$testPlanNameParamName + self::$testPlanNameParamName ); $status_ok = true; - foreach( $keys2check as $key ) { - $dummy[$key] = $this->_isParamPresent( $key, $msg_prefix, self::SET_ERROR ) ? trim( $this->args[$key] ) : ''; - if($dummy[$key] == '') { + foreach ($keys2check as $key) { + $dummy[$key] = $this->_isParamPresent($key, $msg_prefix, + self::SET_ERROR) ? trim($this->args[$key]) : ''; + if ($dummy[$key] == '') { $status_ok = false; break; } } } - if($status_ok) { + if ($status_ok) { $keys2check = array( - self::$testProjectNameParamName, - self::$prefixParamName + self::$testProjectNameParamName, + self::$prefixParamName ); $status_ok = true; - foreach( $keys2check as $key ) { - $target[$key] = $this->_isParamPresent( $key, $msg_prefix ) ? trim( $this->args[$key] ) : ''; - if($target[$key] == '') { + foreach ($keys2check as $key) { + $target[$key] = $this->_isParamPresent($key, $msg_prefix) ? trim( + $this->args[$key]) : ''; + if ($target[$key] == '') { $status_ok = false; } else { // first good match is OK @@ -4663,11 +5164,12 @@ public function createTestPlan($args) { } } - if($status_ok == false) { + if (! $status_ok) { // lazy way to generate error - foreach( $keys2check as $key ) { - $dummy[$key] = $this->_isParamPresent( $key, $msg_prefix ) ? trim( $this->args[$key] ) : ''; - if($dummy[$key] == '') { + foreach ($keys2check as $key) { + $dummy[$key] = $this->_isParamPresent($key, $msg_prefix) ? trim( + $this->args[$key]) : ''; + if ($dummy[$key] == '') { $status_ok = false; break; } @@ -4675,75 +5177,89 @@ public function createTestPlan($args) { } } - if($status_ok) { + if ($status_ok) { $status_ok = false; - if(isset( $target[self::$testProjectNameParamName] ) && $target[self::$testProjectNameParamName] != '') { - $name = trim( $this->args[self::$testProjectNameParamName] ); - $check_op = $this->tprojectMgr->checkNameExistence( $name ); + if (isset($target[self::$testProjectNameParamName]) && + $target[self::$testProjectNameParamName] != '') { + $name = trim($this->args[self::$testProjectNameParamName]); + $check_op = $this->tprojectMgr->checkNameExistence($name); $status_ok = ! $check_op['status_ok']; - if($status_ok) { - $tprojectInfo = current( $this->tprojectMgr->get_by_name( $name ) ); + if ($status_ok) { + $tprojectInfo = current( + $this->tprojectMgr->get_by_name($name)); } else { $status_ok = false; - $msg = $msg_prefix . sprintf( TESTPROJECTNAME_DOESNOT_EXIST_STR, $name ); - $this->errors[] = new IXR_Error( TESTPROJECTNAME_DOESNOT_EXIST, $msg ); + $msg = $msg_prefix . + sprintf(TESTPROJECTNAME_DOESNOT_EXIST_STR, $name); + $this->errors[] = new IXR_Error( + TESTPROJECTNAME_DOESNOT_EXIST, $msg); } } else { - if(isset( $target[self::$prefixParamName] ) && $target[self::$prefixParamName] != '') { - $prefix = trim( $this->args[self::$prefixParamName] ); - $tprojectInfo = $this->tprojectMgr->get_by_prefix( $prefix ); + if (isset($target[self::$prefixParamName]) && + $target[self::$prefixParamName] != '') { + $prefix = trim($this->args[self::$prefixParamName]); + $tprojectInfo = $this->tprojectMgr->get_by_prefix($prefix); - if(($status_ok = ! is_null( $tprojectInfo )) == false) { - $msg = $msg_prefix . sprintf( TPROJECT_PREFIX_DOESNOT_EXIST_STR, $prefix ); - $this->errors[] = new IXR_Error( TPROJECT_PREFIX_DOESNOT_EXIST, $msg ); + if ($status_ok = is_null($tprojectInfo)) { + $msg = $msg_prefix . + sprintf(TPROJECT_PREFIX_DOESNOT_EXIST_STR, $prefix); + $this->errors[] = new IXR_Error( + TPROJECT_PREFIX_DOESNOT_EXIST, $msg); } } } } // Now we need to check if user has rights to do this action - if($status_ok) { + if ($status_ok) { $this->args[self::$testProjectIDParamName] = $tprojectInfo['id']; $this->args[self::$testPlanIDParamName] = null; // When working on PRIVATE containers, globalRole Admin is ENOUGH // because this is how TestLink works when this action is done on GUI - if($this->user->globalRole->dbID != TL_ROLES_ADMIN) { - $status_ok = $this->userHasRight( "mgt_testplan_create", self::CHECK_PUBLIC_PRIVATE_ATTR ); + if ($this->user->globalRole->dbID != TL_ROLES_ADMIN) { + $status_ok = $this->userHasRight("mgt_testplan_create", + self::CHECK_PUBLIC_PRIVATE_ATTR); } } - if($status_ok) { - $name = trim( $this->args[self::$testPlanNameParamName] ); - $info = $this->tplanMgr->get_by_name( $name, $tprojectInfo['id'] ); - $status_ok = is_null( $info ); + if ($status_ok) { + $name = trim($this->args[self::$testPlanNameParamName]); + $info = $this->tplanMgr->get_by_name($name, $tprojectInfo['id']); - if(!($status_ok = is_null( $info ))) { - $msg = $msg_prefix . sprintf( TESTPLANNAME_ALREADY_EXISTS_STR, $name, $tprojectInfo['name'] ); - $this->errors[] = new IXR_Error( TESTPLANNAME_ALREADY_EXISTS, $msg ); + if (! ($status_ok = is_null($info))) { + $msg = $msg_prefix . + sprintf(TESTPLANNAME_ALREADY_EXISTS_STR, $name, + $tprojectInfo['name']); + $this->errors[] = new IXR_Error(TESTPLANNAME_ALREADY_EXISTS, + $msg); } } - if($status_ok) { + if ($status_ok) { $keys2check = array( - self::$activeParamName => 1, - self::$publicParamName => 1, - self::$noteParamName => '' + self::$activeParamName => 1, + self::$publicParamName => 1, + self::$noteParamName => '' ); - foreach( $keys2check as $key => $value ) { - $optional[$key] = $this->_isParamPresent( $key ) ? trim( $this->args[$key] ) : $value; + foreach ($keys2check as $key => $value) { + $optional[$key] = $this->_isParamPresent($key) ? trim( + $this->args[$key]) : $value; } - $retval = $this->tplanMgr->create( htmlspecialchars( $name ), htmlspecialchars( $optional[self::$noteParamName] ), $tprojectInfo['id'], $optional[self::$activeParamName], $optional[self::$publicParamName] ); + $retval = $this->tplanMgr->create(htmlspecialchars($name), + htmlspecialchars($optional[self::$noteParamName]), + $tprojectInfo['id'], $optional[self::$activeParamName], + $optional[self::$publicParamName]); $resultInfo = array(); $resultInfo[] = array( - "operation" => __FUNCTION__, - "additionalInfo" => null, - "status" => true, - "id" => $retval, - "message" => GENERAL_SUCCESS_STR + "operation" => __FUNCTION__, + "additionalInfo" => null, + "status" => true, + "id" => $retval, + "message" => GENERAL_SUCCESS_STR ); } @@ -4767,75 +5283,88 @@ public function createTestPlan($args) { * where all is ok, but content for KEY(nodeID) will be NULL instead of rising ERROR * */ - public function getFullPath($args) { - $this->_setArgs( $args ); + public function getFullPath($args) + { + $this->_setArgs($args); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $checkFunctions = array( - 'authenticate' + 'authenticate' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->_isParamPresent( self::$nodeIDParamName, $msg_prefix, self::SET_ERROR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->_isParamPresent(self::$nodeIDParamName, $msg_prefix, + self::SET_ERROR); - if($status_ok) { + if ($status_ok) { $nodeIDSet = $this->args[self::$nodeIDParamName]; // if is array => OK - if(!($workOnSet = is_array( $nodeIDSet )) &&(! is_int( $nodeIDSet ) || $nodeIDSet <= 0)) { - $msg = $msg_prefix . sprintf( NODEID_INVALID_DATA_TYPE ); - $this->errors[] = new IXR_Error( NODEID_INVALID_DATA_TYPE, $msg ); + if (! ($workOnSet = is_array($nodeIDSet)) && + (! is_int($nodeIDSet) || $nodeIDSet <= 0)) { + $msg = $msg_prefix . sprintf(NODEID_INVALID_DATA_TYPE); + $this->errors[] = new IXR_Error(NODEID_INVALID_DATA_TYPE, $msg); $status_ok = false; } - if($status_ok && $workOnSet) { + if ($status_ok && $workOnSet) { // do check on each item on set - foreach( $nodeIDSet as $itemID ) { - if(! is_int( $itemID ) || $itemID <= 0) { - $msg = $msg_prefix . sprintf( NODEID_IS_NOT_INTEGER_STR, $itemID ); - $this->errors[] = new IXR_Error( NODEID_IS_NOT_INTEGER, $msg ); + foreach ($nodeIDSet as $itemID) { + if (! is_int($itemID) || $itemID <= 0) { + $msg = $msg_prefix . + sprintf(NODEID_IS_NOT_INTEGER_STR, $itemID); + $this->errors[] = new IXR_Error(NODEID_IS_NOT_INTEGER, + $msg); $status_ok = false; } } } } - if($status_ok) { + if ($status_ok) { // IMPORTANT NOTICE: - //(may be a design problem but ..) + // (may be a design problem but ..) // If $nodeIDSet is an array and for one of items path can not be found // get_full_path_verbose() returns null, no matter if for other items // information is available // - $full_path = $this->tprojectMgr->tree_manager->get_full_path_verbose( $nodeIDSet ); + $full_path = $this->tprojectMgr->tree_manager->get_full_path_verbose( + $nodeIDSet); } return $status_ok ? $full_path : $this->errors; } /** */ - protected function _insertCustomFieldExecValues($executionID) { + protected function _insertCustomFieldExecValues($executionID) + { // // Check for existence of executionID $status_ok = true; $sql = "SELECT id FROM {$this->tables['executions']} WHERE id={$executionID}"; - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'id' ); + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'id'); // $cfieldSet = $this->args[self::$customFieldsParamName]; - $tprojectID = $this->tcaseMgr->get_testproject( $this->args[self::$testCaseIDParamName] ); + $tprojectID = $this->tcaseMgr->get_testproject( + $this->args[self::$testCaseIDParamName]); $tplanID = $this->args[self::$testPlanIDParamName]; $cfieldMgr = $this->tprojectMgr->cfield_mgr; - $cfieldsMap = $cfieldMgr->get_linked_cfields_at_execution( $tprojectID, 1, 'testcase', null, null, null, 'name' ); - $status_ok = !(is_null( $rs ) || is_null( $cfieldSet ) || count( $cfieldSet ) == 0); + $cfieldsMap = $cfieldMgr->get_linked_cfields_at_execution($tprojectID, 1, + 'testcase', null, null, null, 'name'); + $status_ok = ! (is_null($rs) || is_null($cfieldSet) || + count($cfieldSet) == 0); $cfield4write = null; - if($status_ok && ! is_null( $cfieldsMap )) { - foreach( $cfieldSet as $name => $value ) { - if(isset( $cfieldsMap[$name] )) { + if ($status_ok && ! is_null($cfieldsMap)) { + foreach ($cfieldSet as $name => $value) { + if (isset($cfieldsMap[$name])) { $cfield4write[$cfieldsMap[$name]['id']] = array( - "type_id" => $cfieldsMap[$name]['type'], - "cf_value" => $value + "type_id" => $cfieldsMap[$name]['type'], + "cf_value" => $value ); } } - if(! is_null( $cfield4write )) { - $cfieldMgr->execution_values_to_db( $cfield4write, $this->tcVersionID, $executionID, $tplanID, null, 'write-through' ); + if (! is_null($cfield4write)) { + $cfieldMgr->execution_values_to_db($cfield4write, + $this->tcVersionID, $executionID, $tplanID, null, + 'write-through'); } } return $status_ok; @@ -4849,38 +5378,42 @@ protected function _insertCustomFieldExecValues($executionID) { * @param int $args["executionid"] * * @return mixed $resultInfo - * [status] => true/false of success - * [id] => result id or error code - * [message] => optional message for error message string + * [status] => true/false of success + * [id] => result id or error code + * [message] => optional message for error message string * @access public */ - public function deleteExecution($args) { + public function deleteExecution($args) + { $resultInfo = array(); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo[0]["status"] = false; $checkFunctions = array( - 'authenticate', - 'checkExecutionID' + 'authenticate', + 'checkExecutionID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); // missing : // we need to get Context => Test plan & Test project to understand if // user has the right to do this operation - if($status_ok) { - if($this->userHasRight( "exec_delete", self::CHECK_PUBLIC_PRIVATE_ATTR )) { - $this->tcaseMgr->deleteExecution( $args[self::$executionIDParamName] ); + if ($status_ok) { + if ($this->userHasRight("exec_delete", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { + $this->tcaseMgr->deleteExecution( + $args[self::$executionIDParamName]); $resultInfo[0]["status"] = true; $resultInfo[0]["id"] = $args[self::$executionIDParamName]; $resultInfo[0]["message"] = GENERAL_SUCCESS_STR; $resultInfo[0]["operation"] = $operation; } else { $status_ok = false; - $this->errors[] = new IXR_Error( CFG_DELETE_EXEC_DISABLED, CFG_DELETE_EXEC_DISABLED_STR ); + $this->errors[] = new IXR_Error(CFG_DELETE_EXEC_DISABLED, + CFG_DELETE_EXEC_DISABLED_STR); } } @@ -4896,20 +5429,24 @@ public function deleteExecution($args) { * @return boolean * @access protected */ - protected function checkExecutionID($messagePrefix = '', $setError = false) { + protected function checkExecutionID($messagePrefix = '', $setError = false) + { $pname = self::$executionIDParamName; - $status_ok = $this->_isParamPresent( $pname, $messagePrefix, $setError ); - if(! $status_ok) { - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $pname ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + $status_ok = $this->_isParamPresent($pname, $messagePrefix, $setError); + if (! $status_ok) { + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } else { - if (gettype($this->args[$pname]) == "string" and intval($this->args[$pname])) { - $this->args[$pname] = intval($this->args[$pname]); + if (gettype($this->args[$pname]) == "string" && + intval($this->args[$pname])) { + $this->args[$pname] = intval($this->args[$pname]); } - $status_ok = is_int( $this->args[$pname] ) && $this->args[$pname] > 0; - if(! $status_ok) { - $msg = $messagePrefix . sprintf( PARAMETER_NOT_INT_STR, $pname, $this->args[$pname] ); - $this->errors[] = new IXR_Error( PARAMETER_NOT_INT, $msg ); + $status_ok = is_int($this->args[$pname]) && $this->args[$pname] > 0; + if (! $status_ok) { + $msg = $messagePrefix . + sprintf(PARAMETER_NOT_INT_STR, $pname, $this->args[$pname]); + $this->errors[] = new IXR_Error(PARAMETER_NOT_INT, $msg); } } return $status_ok; @@ -4923,7 +5460,7 @@ protected function checkExecutionID($messagePrefix = '', $setError = false) { * * @param int $tplanID * Test Plan ID - * @param map $platformInfo + * @param array $platformInfo * key: platform ID * @param string $messagePrefix * used to be prepended to error message @@ -4932,61 +5469,71 @@ protected function checkExecutionID($messagePrefix = '', $setError = false) { * @return boolean * @access protected */ - protected function checkPlatformIdentity($tplanID, $platformInfo = null, $messagePrefix = '') { + protected function checkPlatformIdentity($tplanID, $platformInfo = null, + $messagePrefix = '') + { $status = true; - $platformID = 0; - $name_exists = $this->_isParamPresent( self::$platformNameParamName, $messagePrefix ); - $id_exists = $this->_isParamPresent( self::$platformIDParamName, $messagePrefix ); + $name_exists = $this->_isParamPresent(self::$platformNameParamName, + $messagePrefix); + $id_exists = $this->_isParamPresent(self::$platformIDParamName, + $messagePrefix); $status = $name_exists | $id_exists; - if(! $status) { - $pname = self::$platformNameParamName . ' OR ' . self::$platformIDParamName; - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $pname ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + if (! $status) { + $pname = self::$platformNameParamName . ' OR ' . + self::$platformIDParamName; + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - if($status) { + if ($status) { // get test plan name is useful for error messages - $tplanInfo = $this->tplanMgr->get_by_id( $tplanID ); - if(is_null( $platformInfo )) { - $platformInfo = $this->tplanMgr->getPlatforms( $tplanID, array( + $tplanInfo = $this->tplanMgr->get_by_id($tplanID); + if (is_null($platformInfo)) { + $platformInfo = $this->tplanMgr->getPlatforms($tplanID, + array( 'outputFormat' => 'map' - ) ); + )); } - if(is_null( $platformInfo )) { + if (is_null($platformInfo)) { $status = false; - $msg = sprintf( $messagePrefix . TESTPLAN_HAS_NO_PLATFORMS_STR, $tplanInfo['name'] ); - $this->errors[] = new IXR_Error( TESTPLAN_HAS_NO_PLATFORMS, $msg ); + $msg = sprintf($messagePrefix . TESTPLAN_HAS_NO_PLATFORMS_STR, + $tplanInfo['name']); + $this->errors[] = new IXR_Error(TESTPLAN_HAS_NO_PLATFORMS, $msg); } } - if($status) { + if ($status) { $platform_name = null; $platform_id = null; - if($name_exists) { + if ($name_exists) { $this->errors[] = $platformInfo; $platform_name = $this->args[self::$platformNameParamName]; - $status = in_array( $this->args[self::$platformNameParamName], $platformInfo ); + $status = in_array($this->args[self::$platformNameParamName], + $platformInfo); } else { $platform_id = $this->args[self::$platformIDParamName]; - $status = isset( $platformInfo[$this->args[self::$platformIDParamName]] ); + $status = isset( + $platformInfo[$this->args[self::$platformIDParamName]]); } - if(! $status) { + if (! $status) { // Platform does not exist in target testplan // Can I Try to understand if platform exists on test project ? - $msg = sprintf( $messagePrefix . PLATFORM_NOT_LINKED_TO_TESTPLAN_STR, $platform_name, $platform_id, $tplanInfo['name'] ); - $this->errors[] = new IXR_Error( PLATFORM_NOT_LINKED_TO_TESTPLAN, $msg ); + $msg = sprintf( + $messagePrefix . PLATFORM_NOT_LINKED_TO_TESTPLAN_STR, + $platform_name, $platform_id, $tplanInfo['name']); + $this->errors[] = new IXR_Error(PLATFORM_NOT_LINKED_TO_TESTPLAN, + $msg); } } - if($status) { - if($name_exists) { - $dummy = array_flip( $platformInfo ); - $this->args[self::$platformIDParamName] = $dummy[$this->args[self::$platformNameParamName]]; - } + if ($status && $name_exists) { + $dummy = array_flip($platformInfo); + $this->args[self::$platformIDParamName] = $dummy[$this->args[self::$platformNameParamName]]; } return $status; } @@ -5009,9 +5556,10 @@ protected function checkPlatformIdentity($tplanID, $platformInfo = null, $messag * * @access protected */ - protected function _updateResult($user_id = null, $exec_ts = null) { - $tester_id = is_null( $user_id ) ? $this->userID : $user_id; - $execTimeStamp = is_null( $exec_ts ) ? $this->dbObj->db_now() : $exec_ts; + protected function _updateResult($user_id = null, $exec_ts = null) + { + $tester_id = is_null($user_id) ? $this->userID : $user_id; + $execTimeStamp = is_null($exec_ts) ? $this->dbObj->db_now() : $exec_ts; $exec_id = 0; $status = $this->args[self::$statusParamName]; @@ -5020,51 +5568,50 @@ protected function _updateResult($user_id = null, $exec_ts = null) { // $testplan_id = $this->args[self::$testPlanIDParamName]; // $build_id = $this->args[self::$buildIDParamName]; - $tcversion_id = $this->tcVersionID; $tcase_id = $this->args[self::$testCaseIDParamName]; $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => $this->args[self::$platformIDParamName], - 'build_id' => $this->args[self::$buildIDParamName] + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => $this->args[self::$platformIDParamName], + 'build_id' => $this->args[self::$buildIDParamName] ); - // $db_now=$this->dbObj->db_now(); - - if(isset( $this->args[self::$platformIDParamName] )) { - $platform_id = $this->args[self::$platformIDParamName]; - } - // Here steps and expected results are not needed => do not request => less data on network // $options = array('getSteps' => 0); $opt = array( - 'output' => 'exec_id' + 'output' => 'exec_id' ); - $exec_id = $this->tcaseMgr->getLatestExecSingleContext( array( + $exec_id = $this->tcaseMgr->getLatestExecSingleContext( + array( 'id' => $tcase_id, 'version_id' => null - ), $execContext, $opt ); - if(! is_null( $exec_id )) { - $execution_type = constant( "TESTCASE_EXECUTION_TYPE_AUTO" ); + ), $execContext, $opt); + if (! is_null($exec_id)) { + $execution_type = constant("TESTCASE_EXECUTION_TYPE_AUTO"); $notes = ''; $notes_update = ''; - if($this->_isNotePresent()) { - $notes = $this->dbObj->prepare_string( $this->args[self::$noteParamName] ); + if ($this->_isNotePresent()) { + $notes = $this->dbObj->prepare_string( + $this->args[self::$noteParamName]); } - if(trim( $notes ) != "") { + if (trim($notes) != "") { $notes_update = ",notes='{$notes}'"; } $duration_update = ''; - if(isset( $this->args[self::$executionDurationParamName] )) { - $duration_update = ",execution_duration=" . floatval( $this->args[self::$executionDurationParamName] ); + if (isset($this->args[self::$executionDurationParamName])) { + $duration_update = ",execution_duration=" . + floatval($this->args[self::$executionDurationParamName]); } - $sql = " UPDATE {$this->tables['executions']} " . " SET tester_id={$tester_id}, execution_ts={$execTimeStamp}," . " status='{$status}', execution_type= {$execution_type} " . " {$notes_update} {$duration_update} WHERE id = {$exec_id}"; + $sql = " UPDATE {$this->tables['executions']} " . + " SET tester_id={$tester_id}, execution_ts={$execTimeStamp}," . + " status='{$status}', execution_type= {$execution_type} " . + " {$notes_update} {$duration_update} WHERE id = {$exec_id}"; - $this->dbObj->exec_query( $sql ); + $this->dbObj->exec_query($sql); } return $exec_id; } @@ -5080,26 +5627,23 @@ protected function _updateResult($user_id = null, $exec_ts = null) { * * @access public */ - public function getTestSuiteByID($args) { + public function getTestSuiteByID($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); - $status_ok = $this->_runChecks( array( + $this->_setArgs($args); + $status_ok = $this->_runChecks( + array( 'authenticate', 'checkTestSuiteID' - ), $msg_prefix ); - - $details = 'simple'; - $key2search = self::$detailsParamName; - if($this->_isParamPresent( $key2search )) { - $details = $this->args[$key2search]; - } + ), $msg_prefix); - if($status_ok && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR)) { $testSuiteID = $this->args[self::$testSuiteIDParamName]; - $tsuiteMgr = new testsuite( $this->dbObj ); - return $tsuiteMgr->get_by_id( $testSuiteID ); + $tsuiteMgr = new testsuite($this->dbObj); + return $tsuiteMgr->get_by_id($testSuiteID); } else { return $this->errors; } @@ -5115,20 +5659,23 @@ public function getTestSuiteByID($args) { * * @access public */ - public function getTestSuitesForTestSuite($args) { + public function getTestSuitesForTestSuite($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $items = null; - $this->_setArgs( $args ); - $status_ok = $this->_runChecks( array( + $this->_setArgs($args); + $status_ok = $this->_runChecks( + array( 'authenticate', 'checkTestSuiteID' - ), $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); - if($status_ok) { + ), $msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); + if ($status_ok) { $testSuiteID = $this->args[self::$testSuiteIDParamName]; - $tsuiteMgr = new testsuite( $this->dbObj ); - $items = $tsuiteMgr->get_children( $testSuiteID ); + $tsuiteMgr = new testsuite($this->dbObj); + $items = $tsuiteMgr->get_children($testSuiteID); } return $status_ok ? $items : $this->errors; } @@ -5144,31 +5691,35 @@ public function getTestSuitesForTestSuite($args) { * * @access public */ - public function getTestPlanPlatforms($args) { + public function getTestPlanPlatforms($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $status_ok = false; $items = null; // Checks if a test plan id was provided - $status_ok = $this->_isParamPresent( self::$testPlanIDParamName, $msg_prefix, self::SET_ERROR ); + $status_ok = $this->_isParamPresent(self::$testPlanIDParamName, + $msg_prefix, self::SET_ERROR); - if($status_ok) { + if ($status_ok) { // Checks if the provided test plan id is valid - $status_ok = $this->_runChecks( array( + $status_ok = $this->_runChecks( + array( 'authenticate', 'checkTestPlanID' - ), $msg_prefix ); + ), $msg_prefix); } - if($status_ok) { + if ($status_ok) { $tplanID = $this->args[self::$testPlanIDParamName]; // get test plan name is useful for error messages - $tplanInfo = $this->tplanMgr->get_by_id( $tplanID ); - $items = $this->tplanMgr->getPlatforms( $tplanID ); - if(!($status_ok = ! is_null( $items ))) { - $msg = sprintf( $messagePrefix . TESTPLAN_HAS_NO_PLATFORMS_STR, $tplanInfo['name'] ); - $this->errors[] = new IXR_Error( TESTPLAN_HAS_NO_PLATFORMS, $msg ); + $tplanInfo = $this->tplanMgr->get_by_id($tplanID); + $items = $this->tplanMgr->getPlatforms($tplanID); + if (! ($status_ok = ! is_null($items))) { + $msg = sprintf($messagePrefix . TESTPLAN_HAS_NO_PLATFORMS_STR, + $tplanInfo['name']); + $this->errors[] = new IXR_Error(TESTPLAN_HAS_NO_PLATFORMS, $msg); } } return $status_ok ? $items : $this->errors; @@ -5184,7 +5735,7 @@ public function getTestPlanPlatforms($args) { * @param int $args["testplanid"] * test plan id * - * @return map where every element has: + * @return array where every element has: * * 'type' => 'platform' * 'total_tc => ZZ @@ -5195,24 +5746,26 @@ public function getTestPlanPlatforms($args) { * * @access public */ - public function getTotalsForTestPlan($args) { + public function getTotalsForTestPlan($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $total = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $status_ok = true; // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if($status_ok) { - // $total = $this->tplanMgr->getStatusTotalsByPlatform($this->args[self::$testPlanIDParamName]); - $total = $this->tplanMetricsMgr->getExecCountersByPlatformExecStatus( $this->args[self::$testPlanIDParamName] ); + if ($status_ok) { + $total = $this->tplanMetricsMgr->getExecCountersByPlatformExecStatus( + $this->args[self::$testPlanIDParamName]); } return $status_ok ? $total : $this->errors; @@ -5229,15 +5782,19 @@ public function getTotalsForTestPlan($args) { * * @access public */ - public function doesUserExist($args) { + public function doesUserExist($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); - $user_id = tlUser::doesUserExist( $this->dbObj, $this->args[self::$userParamName] ); - if(!($status_ok = ! is_null( $user_id ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$userParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + $user_id = tlUser::doesUserExist($this->dbObj, + $this->args[self::$userParamName]); + if (! ($status_ok = ! is_null($user_id))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$userParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_THIS_LOGIN, $msg); } return $status_ok ? $status_ok : $this->errors; } @@ -5253,58 +5810,60 @@ public function doesUserExist($args) { * @param string $args["firstname"] * @param string $args["lastname"] * @param string $args["email"] - * @param string $args["password"] - OPTIONAL - * + * @param string $args["password"] + * - OPTIONAL + * * * @return ID the new user if OK, otherwise error structure * * @access public */ - public function createUser($args) { + public function createUser($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); - $checkFunctions = array('authenticate', - 'checkIsSystemWideAdmin'); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $checkFunctions = array( + 'authenticate', + 'checkIsSystemWideAdmin' + ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - $password = null; - if ($status_ok) { - if (isset($this->args[self::$userPasswordParamName])) { + $password = null; + if ($status_ok && isset($this->args[self::$userPasswordParamName])) { $password = $this->args[self::$userPasswordParamName]; $res = $this->userMgr->checkPasswordQuality($password); - if ( $res['status_ok'] == tl::ERROR ) { - $status_ok = false; - $this->errors[] = new IXR_Error(GENERAL_ERROR_CODE, $res['msg']); + if ($res['status_ok'] == tl::ERROR) { + $status_ok = false; + $this->errors[] = new IXR_Error(GENERAL_ERROR_CODE, $res['msg']); } - } - } + } if ($status_ok) { - $res = tl::OK; + $res = tl::OK; - if ($password) { - $res = $this->userMgr->setPassword($password); - } + if ($password) { + $res = $this->userMgr->setPassword($password); + } - if ($res == tl::OK) { - $this->userMgr->dbID = null; - $this->userMgr->login = $this->args[self::$userLoginParamName]; - $this->userMgr->firstName = $this->args[self::$userFirstNameParamName]; - $this->userMgr->lastName = $this->args[self::$userLastNameParamName]; - $this->userMgr->emailAddress = $this->args[self::$userEmailParamName]; - $res = $this->userMgr->writeToDB($this->dbObj); - } + if ($res == tl::OK) { + $this->userMgr->dbID = null; + $this->userMgr->login = $this->args[self::$userLoginParamName]; + $this->userMgr->firstName = $this->args[self::$userFirstNameParamName]; + $this->userMgr->lastName = $this->args[self::$userLastNameParamName]; + $this->userMgr->emailAddress = $this->args[self::$userEmailParamName]; + $res = $this->userMgr->writeToDB($this->dbObj); + } - if ($res != tl::OK) { - $status_ok = false; - $msg = getUserErrorMessage($res); - $this->errors[] = new IXR_Error(USER_CREATION_ERROR, $msg); - } else { - logAuditEvent(TLS("audit_user_created", $this->userMgr->login),"CREATE", - $this->userMgr->dbID, "users"); - } + if ($res != tl::OK) { + $status_ok = false; + $msg = getUserErrorMessage($res); + $this->errors[] = new IXR_Error(USER_CREATION_ERROR, $msg); + } else { + logAuditEvent(TLS("audit_user_created", $this->userMgr->login), + "CREATE", $this->userMgr->dbID, "users"); + } } return $status_ok ? $this->userMgr->dbID : $this->errors; @@ -5328,16 +5887,16 @@ public function setUserRoleOnProject($args) { $msg_prefix = "(" . __FUNCTION__ . ") - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkIsSystemWideAdmin', - 'checkTestProjectID', - 'checkUserID', - 'checkRoleIdentity' + 'authenticate', + 'checkIsSystemWideAdmin', + 'checkTestProjectID', + 'checkUserID', + 'checkRoleIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); if ($status_ok) { @@ -5345,7 +5904,7 @@ public function setUserRoleOnProject($args) $projectID = $this->args[self::$testProjectIDParamName]; $role = $this->args[self::$roleNameParamName]; - $roleID = tlRole::doesRoleExist($this->dbObj, $role, -1); + $roleID = tlRole::doesRoleExist($this->dbObj, $role, - 1); // role exists. It was checked by checkRoleIdentity // delete existing user's role if any before adding the new one @@ -5356,13 +5915,16 @@ public function setUserRoleOnProject($args) // user already has given role -> OK nothing to do return true; } - $this->tprojectMgr->deleteUserRoles($projectID, array($userID)); + $this->tprojectMgr->deleteUserRoles($projectID, array( + $userID + )); } $res = $this->tprojectMgr->addUserRole($userID, $projectID, $roleID); - if ( $res != tl::OK ) { + if ($res != tl::OK) { $status_ok = false; - $msg = $msg_prefix . sprintf( ROLE_SETTING_ERROR_STR, $role, $userID ); + $msg = $msg_prefix . + sprintf(ROLE_SETTING_ERROR_STR, $role, $userID); $this->errors[] = new IXR_Error(ROLE_SETTING_ERROR, $msg); } } @@ -5380,14 +5942,15 @@ public function setUserRoleOnProject($args) * * @access public */ - public function checkDevKey($args) { + public function checkDevKey($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate' + 'authenticate' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); return $status_ok ? $status_ok : $this->errors; } @@ -5402,9 +5965,9 @@ public function checkDevKey($args) { * @param int $args["reqspecid"] * The Requirement Specification ID * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5417,12 +5980,13 @@ public function checkDevKey($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the error map. */ - public function uploadRequirementSpecificationAttachment($args) { + public function uploadRequirementSpecificationAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $args[self::$foreignKeyTableNameParamName] = 'req_specs'; $args[self::$foreignKeyIdParamName] = $args['reqspecid']; - $this->_setArgs( $args ); - return $this->uploadAttachment( $args, $msg_prefix, false ); + $this->_setArgs($args); + return $this->uploadAttachment($args, $msg_prefix, false); } /** @@ -5436,9 +6000,9 @@ public function uploadRequirementSpecificationAttachment($args) { * @param int $args["requirementid"] * The Requirement ID * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5451,12 +6015,13 @@ public function uploadRequirementSpecificationAttachment($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the erros map. */ - public function uploadRequirementAttachment($args) { + public function uploadRequirementAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $args[self::$foreignKeyTableNameParamName] = 'requirements'; $args[self::$foreignKeyIdParamName] = $args['requirementid']; - $this->_setArgs( $args ); - return $this->uploadAttachment( $args, $msg_prefix, false ); + $this->_setArgs($args); + return $this->uploadAttachment($args, $msg_prefix, false); } /** @@ -5470,9 +6035,9 @@ public function uploadRequirementAttachment($args) { * @param int $args["testprojectid"] * The Test Project ID * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5485,21 +6050,21 @@ public function uploadRequirementAttachment($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the erros map. */ - public function uploadTestProjectAttachment($args) { + public function uploadTestProjectAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $ret = null; $args[self::$foreignKeyTableNameParamName] = 'nodes_hierarchy'; $args[self::$foreignKeyIdParamName] = $args[self::$testProjectIDParamName]; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID' + 'authenticate', + 'checkTestProjectID' ); - $statusOK = $this->_runChecks( $checkFunctions ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); - $ret = $statusOK ? $this->uploadAttachment( $args, $msg_prefix, false ) : $this->errors; - return $ret; + $statusOK = $this->_runChecks($checkFunctions) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); + return $statusOK ? $this->uploadAttachment($args, $msg_prefix, false) : $this->errors; } /** @@ -5513,9 +6078,9 @@ public function uploadTestProjectAttachment($args) { * @param int $args["testsuiteid"] * The Test Suite ID * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5528,19 +6093,20 @@ public function uploadTestProjectAttachment($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the erros map. */ - public function uploadTestSuiteAttachment($args) { + public function uploadTestSuiteAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $args[self::$foreignKeyTableNameParamName] = 'nodes_hierarchy'; $args[self::$foreignKeyIdParamName] = $args[self::$testSuiteIDParamName]; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestSuiteID' + 'authenticate', + 'checkTestSuiteID' ); - $statusOK = $this->_runChecks( $checkFunctions ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); - $ret = $statusOK ? $this->uploadAttachment( $args, $msg_prefix, false ) : $this->errors; - return $ret; + $statusOK = $this->_runChecks($checkFunctions) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); + return $statusOK ? $this->uploadAttachment($args, $msg_prefix, false) : $this->errors; } /** @@ -5557,9 +6123,9 @@ public function uploadTestSuiteAttachment($args) { * version number * * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5571,41 +6137,43 @@ public function uploadTestSuiteAttachment($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the erros map. */ - public function uploadTestCaseAttachment($args) { - $ret = null; + public function uploadTestCaseAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); // Mandatory Parameters $prm = self::$versionNumberParamName; - $statusOK = $this->_isParamPresent( $prm, $msgPrefix, self::SET_ERROR ); + $statusOK = $this->_isParamPresent($prm, $msgPrefix, self::SET_ERROR); - if($statusOK) { - $checkFunctions = array('authenticate', - 'checkTestCaseIdentity', - 'checkTestCaseVersionNumberAncestry'); + if ($statusOK) { + $checkFunctions = array( + 'authenticate', + 'checkTestCaseIdentity', + 'checkTestCaseVersionNumberAncestry' + ); } - if($statusOK = $this->_runChecks( $checkFunctions, $msg_prefix )) { + if ($statusOK = $this->_runChecks($checkFunctions, $msg_prefix)) { - $args[self::$foreignKeyTableNameParamName] = 'tcversions'; - $args[self::$foreignKeyIdParamName] = $this->tcVersionID; - $this->_setArgs( $args ); - // Need to get test project information - // from test case in order to be able - // to do RIGHTS check on $this->userHasRight() - // !!! Important Notice!!!!: - // method checkTestCaseIdentity sets $this->args[self::$testCaseIDParamName] + $args[self::$foreignKeyTableNameParamName] = 'tcversions'; + $args[self::$foreignKeyIdParamName] = $this->tcVersionID; + $this->_setArgs($args); + // Need to get test project information + // from test case in order to be able + // to do RIGHTS check on $this->userHasRight() + // !!! Important Notice!!!!: + // method checkTestCaseIdentity sets $this->args[self::$testCaseIDParamName] - $this->args[self::$testProjectIDParamName] = - $this->tcaseMgr->getTestProjectFromTestCase( $this->args[self::$testCaseIDParamName] ); + $this->args[self::$testProjectIDParamName] = $this->tcaseMgr->getTestProjectFromTestCase( + $this->args[self::$testCaseIDParamName]); - $statusOK = $this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $statusOK = $this->userHasRight("mgt_modify_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR); } - $ret = $statusOK ? $this->uploadAttachment( $args, $msg_prefix, false ) : $this->errors; - return $ret; + return $statusOK ? $this->uploadAttachment($args, $msg_prefix, false) : $this->errors; } /** @@ -5619,9 +6187,9 @@ public function uploadTestCaseAttachment($args) { * @param int $args["executionid"] * execution ID * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5634,16 +6202,17 @@ public function uploadTestCaseAttachment($args) { * description, file_name, file_size and file_type. If any errors occur it * returns the erros map. */ - public function uploadExecutionAttachment($args) { + public function uploadExecutionAttachment($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; $args[self::$foreignKeyTableNameParamName] = 'executions'; $args[self::$foreignKeyIdParamName] = $args['executionid']; - $this->_setArgs( $args ); + $this->_setArgs($args); // We need to check that user has right to execute in order to allow // him/her to do attachment - return $this->uploadAttachment( $args, $msg_prefix, false ); + return $this->uploadAttachment($args, $msg_prefix, false); } /** @@ -5662,9 +6231,9 @@ public function uploadExecutionAttachment($args) { * @param string $args["fktable"] * The Attachment Foreign Key Table * @param string $args["title"] - * (Optional) The title of the Attachment + * (Optional) The title of the Attachment * @param string $args["description"] - * (Optional) The description of the Attachment + * (Optional) The description of the Attachment * @param string $args["filename"] * The file name of the Attachment(e.g.:notes.txt) * @param string $args["filetype"] @@ -5672,31 +6241,32 @@ public function uploadExecutionAttachment($args) { * @param string $args["content"] * The content(Base64 encoded) of the Attachment * - * @return mixed $resultInfo an array containing + * @return mixed $resultInfo an array containing * the fk_id, fk_table, title, - * description, file_name, file_size and file_type. + * description, file_name, file_size and file_type. * If any errors occur it * returns the errors map. */ - public function uploadAttachment($args, $messagePrefix = '', $setArgs = true) { + public function uploadAttachment($args, $messagePrefix = '', $setArgs = true) + { $resultInfo = array(); - if($setArgs) { - $this->_setArgs( $args ); + if ($setArgs) { + $this->_setArgs($args); } - $msg_prefix =($messagePrefix == '') ?("(" . __FUNCTION__ . ") - ") : $messagePrefix; + $msg_prefix = ($messagePrefix == '') ? ("(" . __FUNCTION__ . ") - ") : $messagePrefix; $checkFunctions = array(); - // TODO: please, somebody review if this is valid. + // TODO: please, somebody review if this is valid. // I added this property // to avoid the upload method of double authenticating the user. - // Otherwise, when uploadTestCaseAttachment was called, + // Otherwise, when uploadTestCaseAttachment was called, // for instante, it // would authenticate, check if the nodes_hierarchy is type TestCase // and then call uploadAttachment that would, authenticate again. // What do you think? - if(!$this->authenticated) { - $checkFunctions[] = 'authenticate'; + if (! $this->authenticated) { + $checkFunctions[] = 'authenticate'; } // check if : @@ -5707,54 +6277,55 @@ public function uploadAttachment($args, $messagePrefix = '', $setArgs = true) { $checkFunctions[] = 'checkForeignKey'; $checkFunctions[] = 'checkUploadAttachmentRequest'; - $statusOK = $this->_runChecks( $checkFunctions, $msg_prefix ); - if($statusOK) { - - $fkId = $this->args[self::$foreignKeyIdParamName]; - $fkTable = $this->args[self::$foreignKeyTableNameParamName]; - $title = $this->args[self::$titleParamName]; - - // creates a temp file and returns an array with size and tmp_name - $fInfo = $this->createAttachmentTempFile(); - if(!$fInfo) { - // Error creating attachment temp file. Ask user to check temp dir - // settings in php.ini and security and rights of this dir. - $msg = $msg_prefix . ATTACH_TEMP_FILE_CREATION_ERROR_STR; - $this->errors[] = new IXR_ERROR( ATTACH_TEMP_FILE_CREATION_ERROR, $msg ); - $statusOK = false; - } else { - // The values have already been validated in the method - // checkUploadAttachmentRequest() - $fInfo['name'] = $args[self::$fileNameParamName]; - $fInfo['type'] = $args[self::$fileTypeParamName]; - if( trim($fInfo['type']) == '' ) { - $fInfo['type'] = mime_content_type($fInfo['tmp_name']); - } - - $docRepo = tlAttachmentRepository::create( $this->dbObj ); - $uploadOp = $docRepo->insertAttachment( $fkId, $fkTable, $title, $fInfo ); - - - if($uploadOp->statusOK == false) { - $msg = $msg_prefix . ATTACH_DB_WRITE_ERROR_STR; - $this->errors[] = new IXR_ERROR( ATTACH_DB_WRITE_ERROR, $msg ); - $statusOK = false; + $statusOK = $this->_runChecks($checkFunctions, $msg_prefix); + if ($statusOK) { + + $fkId = $this->args[self::$foreignKeyIdParamName]; + $fkTable = $this->args[self::$foreignKeyTableNameParamName]; + $title = $this->args[self::$titleParamName]; + + // creates a temp file and returns an array with size and tmp_name + $fInfo = $this->createAttachmentTempFile(); + if (! $fInfo) { + // Error creating attachment temp file. Ask user to check temp dir + // settings in php.ini and security and rights of this dir. + $msg = $msg_prefix . ATTACH_TEMP_FILE_CREATION_ERROR_STR; + $this->errors[] = new IXR_ERROR(ATTACH_TEMP_FILE_CREATION_ERROR, + $msg); + $statusOK = false; } else { - // We are returning some data that the user originally sent. - // Perhaps we could return only new data, like the file size? - $resultInfo['fk_id'] = $args[self::$foreignKeyIdParamName]; - $resultInfo['fk_table'] = $args[self::$foreignKeyTableNameParamName]; - $resultInfo['title'] = $args[self::$titleParamName]; - $resultInfo['description'] = $args[self::$descriptionParamName]; - $resultInfo['file_name'] = $args[self::$fileNameParamName]; + // The values have already been validated in the method + // checkUploadAttachmentRequest() + $fInfo['name'] = $args[self::$fileNameParamName]; + $fInfo['type'] = $args[self::$fileTypeParamName]; + if (trim($fInfo['type']) == '') { + $fInfo['type'] = mime_content_type($fInfo['tmp_name']); + } - // It would be nice have all info available in db - // $resultInfo['file_path'] = $args[""]; - // we could also return the tmp_name, but would it be useful? - $resultInfo['file_size'] = $fInfo['size']; - $resultInfo['file_type'] = $args[self::$fileTypeParamName]; + $docRepo = tlAttachmentRepository::create($this->dbObj); + $uploadOp = $docRepo->insertAttachment($fkId, $fkTable, $title, + $fInfo); + + if (! $uploadOp->statusOK) { + $msg = $msg_prefix . ATTACH_DB_WRITE_ERROR_STR; + $this->errors[] = new IXR_ERROR(ATTACH_DB_WRITE_ERROR, $msg); + $statusOK = false; + } else { + // We are returning some data that the user originally sent. + // Perhaps we could return only new data, like the file size? + $resultInfo['fk_id'] = $args[self::$foreignKeyIdParamName]; + $resultInfo['fk_table'] = $args[self::$foreignKeyTableNameParamName]; + $resultInfo['title'] = $args[self::$titleParamName]; + $resultInfo['description'] = $args[self::$descriptionParamName]; + $resultInfo['file_name'] = $args[self::$fileNameParamName]; + + // It would be nice have all info available in db + // $resultInfo['file_path'] = $args[""]; + // we could also return the tmp_name, but would it be useful? + $resultInfo['file_size'] = $fInfo['size']; + $resultInfo['file_type'] = $args[self::$fileTypeParamName]; + } } - } } return $statusOK ? $resultInfo : $this->errors; @@ -5768,11 +6339,12 @@ public function uploadAttachment($args, $messagePrefix = '', $setArgs = true) { * @return boolean true if attachments feature is enabled in TestLink * configuration, false otherwise. */ - protected function isAttachmentEnabled($msg_prefix = '') { + protected function isAttachmentEnabled($msg_prefix = '') + { $status_ok = true; - if(! config_get( "attachments" )->enabled) { + if (! config_get("attachments")->enabled) { $msg = $msg_prefix . ATTACH_FEATURE_DISABLED_STR; - $this->errors[] = new IXR_ERROR( ATTACH_FEATURE_DISABLED, $msg ); + $this->errors[] = new IXR_ERROR(ATTACH_FEATURE_DISABLED, $msg); $status_ok = false; } return $status_ok; @@ -5787,23 +6359,23 @@ protected function isAttachmentEnabled($msg_prefix = '') { * @since 1.9beta6 * @return boolean true if the given foreign key exists, false otherwise. */ - protected function checkForeignKey($msg_prefix = '') { + protected function checkForeignKey($msg_prefix = '') + { $statusOK = true; - $fkId = $this->args[self::$foreignKeyIdParamName]; $fkTable = $this->args[self::$foreignKeyTableNameParamName]; - - if(isset( $fkId ) && isset( $fkTable )) { - $query = "SELECT id FROM {$this->tables[$fkTable]} + + if (isset($fkId) && isset($fkTable)) { + $query = "SELECT id FROM {$this->tables[$fkTable]} WHERE id={$fkId}"; - $result = $this->dbObj->fetchFirstRowSingleColumn( $query, "id" ); + $result = $this->dbObj->fetchFirstRowSingleColumn($query, "id"); } - if(null == $result) { - $msg = $msg_prefix . sprintf( ATTACH_INVALID_FK_STR, $fkId, $fkTable ); - $this->errors[] = new IXR_ERROR( ATTACH_INVALID_FK, $msg ); + if (null == $result) { + $msg = $msg_prefix . sprintf(ATTACH_INVALID_FK_STR, $fkId, $fkTable); + $this->errors[] = new IXR_ERROR(ATTACH_INVALID_FK, $msg); $statusOK = false; } @@ -5821,24 +6393,26 @@ protected function checkForeignKey($msg_prefix = '') { * @since 1.9beta6 * @return boolean true if the file name and the content are set */ - protected function checkUploadAttachmentRequest($msg_prefix = '') { + protected function checkUploadAttachmentRequest($msg_prefix = '') + { // Did the client set file name? - $status = isset( $this->args[self::$fileNameParamName] ); - if($status) { + $status = isset($this->args[self::$fileNameParamName]); + if ($status) { // Did the client set file content? - $status = isset( $this->args[self::$contentParamName] ); - if($status) { - // Did the client set the file type? If not so use binary as default file type - if(isset( $this->args[self::$fileTypeParamName] )) { - // By default, if no file type is provided, put it as binary - $this->args[self::$fileTypeParamName] = "application/octet-stream"; - } + $status = isset($this->args[self::$contentParamName]); + // Did the client set the file type? If not so use binary as default file type + if ($status && isset($this->args[self::$fileTypeParamName])) { + // By default, if no file type is provided, put it as binary + $this->args[self::$fileTypeParamName] = "application/octet-stream"; } } - if(! $status) { - $msg = $msg_prefix . sprintf( ATTACH_INVALID_ATTACHMENT_STR, $this->args[self::$fileNameParamName], sizeof( $this->args[self::$contentParamName] ) ); - $this->errors[] = new IXR_ERROR( ATTACH_INVALID_ATTACHMENT, $msg ); + if (! $status) { + $msg = $msg_prefix . + sprintf(ATTACH_INVALID_ATTACHMENT_STR, + $this->args[self::$fileNameParamName], + count($this->args[self::$contentParamName])); + $this->errors[] = new IXR_ERROR(ATTACH_INVALID_ATTACHMENT, $msg); } return $status; @@ -5852,16 +6426,17 @@ protected function checkUploadAttachmentRequest($msg_prefix = '') { * @since 1.9beta6 * @return file handler */ - protected function createAttachmentTempFile() { + protected function createAttachmentTempFile() + { $resultInfo = array(); - $filename = tempnam( sys_get_temp_dir(), 'tl-' ); + $filename = tempnam(sys_get_temp_dir(), 'tl-'); $resultInfo["tmp_name"] = $filename; - $handle = fopen( $filename, "w" ); - fwrite( $handle, base64_decode( $this->args[self::$contentParamName] ) ); - fclose( $handle ); + $handle = fopen($filename, "w"); + fwrite($handle, base64_decode($this->args[self::$contentParamName])); + fclose($handle); - $filesize = filesize( $filename ); + $filesize = filesize($filename); $resultInfo["size"] = $filesize; return $resultInfo; @@ -5874,32 +6449,42 @@ protected function createAttachmentTempFile() { * @param string $messagePrefix * used to be prepended to error message * - * @return map with following keys + * @return array with following keys * boolean map['status_ok'] * string map['error_msg'] * int map['error_code'] */ - protected function checkTestCaseVersionNumberAncestry($messagePrefix = '') { - $ret = array('status_ok' => true, - 'error_msg' => '', - 'error_code' => 0 ); + protected function checkTestCaseVersionNumberAncestry($messagePrefix = '') + { + $ret = array( + 'status_ok' => true, + 'error_msg' => '', + 'error_code' => 0 + ); $tcase_id = $this->args[self::$testCaseIDParamName]; $version_number = $this->args[self::$versionNumberParamName]; - $sql = " SELECT TCV.version,TCV.id " . " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . " WHERE NH.parent_id = {$tcase_id} " . " AND TCV.version = {$version_number} " . " AND TCV.id = NH.id "; + $sql = " SELECT TCV.version,TCV.id " . + " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['tcversions']} TCV " . + " WHERE NH.parent_id = {$tcase_id} " . + " AND TCV.version = {$version_number} " . " AND TCV.id = NH.id "; - $target_tcversion = $this->dbObj->fetchRowsIntoMap( $sql, 'version' ); - if(! is_null( $target_tcversion ) && count( $target_tcversion ) == 1) { - $dummy = current( $target_tcversion ); + $target_tcversion = $this->dbObj->fetchRowsIntoMap($sql, 'version'); + if (! is_null($target_tcversion) && count($target_tcversion) == 1) { + $dummy = current($target_tcversion); $this->tcVersionID = $dummy['id']; } else { - $status_ok = false; - $tcase_info = $this->tcaseMgr->tree_manager->get_node_hierarchy_info( $tcase_id ); - $msg = sprintf( TCASE_VERSION_NUMBER_KO_STR, $version_number, $this->args[self::$testCaseExternalIDParamName], $tcase_info['name'] ); - $ret = array('status_ok' => false, - 'error_msg' => $msg, - 'error_code' => TCASE_VERSION_NUMBER_KO); + $tcase_info = $this->tcaseMgr->tree_manager->get_node_hierarchy_info( + $tcase_id); + $msg = sprintf(TCASE_VERSION_NUMBER_KO_STR, $version_number, + $this->args[self::$testCaseExternalIDParamName], + $tcase_info['name']); + $ret = array( + 'status_ok' => false, + 'error_msg' => $msg, + 'error_code' => TCASE_VERSION_NUMBER_KO + ); } return $ret; } @@ -5913,8 +6498,9 @@ protected function checkTestCaseVersionNumberAncestry($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkCustomField($messagePrefix = '') { - return(isset( $this->args[self::$customFieldNameParamName] ) ? true : false); + protected function checkCustomField($messagePrefix = '') + { + return isset($this->args[self::$customFieldNameParamName]) ? true : false; } /** @@ -5928,17 +6514,16 @@ protected function checkCustomField($messagePrefix = '') { * @return boolean * @access protected */ - protected function checkCustomFieldScope($messagePrefix = '') { - $status = false; + protected function checkCustomFieldScope($messagePrefix = '') + { $domain = array( - 'design' => true, - 'execution' => true, - 'testplan_design' => true + 'design' => true, + 'execution' => true, + 'testplan_design' => true ); $scope = $this->args[self::$scopeParamName]; - $status = is_null( $scope ) ? false : isset( $domain[$scope] ); - return $status; + return is_null($scope) ? false : isset($domain[$scope]); } /** @@ -5973,47 +6558,54 @@ protected function checkCustomFieldScope($messagePrefix = '') { * * @access protected */ - protected function getCustomFieldValue($args, $msg_prefix = '') { - $this->_setArgs( $args ); + protected function getCustomFieldValue($args, $msg_prefix = '') + { + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkCustomField', - 'checkCustomFieldScope' + 'authenticate', + 'checkTestProjectID', + 'checkCustomField', + 'checkCustomFieldScope' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); $scope = $this->args[self::$scopeParamName]; - switch($scope) { - case 'execution' : + switch ($scope) { + case 'execution': // test plan id is valid ? - if(($status_ok = $this->checkTestPlanID( $msg_prefix ))) { + if ($status_ok = $this->checkTestPlanID($msg_prefix)) { // test plan has to belong to test project - $tplanid = intval( $this->args[self::$testPlanIDParamName] ); - $tprojectid = intval( $this->args[self::$testProjectIDParamName] ); - - $sql = " SELECT id FROM {$this->tables['nodes_hierarchy']} " . " WHERE id = " . $tplanid . " AND parent_id = " . $tprojectid; - - $rs = $this->dbObj->get_recordset( $sql ); - $status_ok = ! is_null( $rs ); - if($status_ok == FALSE) { - $project = $this->tprojectMgr->get_by_id( $tprojectid ); - $plan = $this->tplanMgr->get_by_id( $tplanid ); - $msg = sprintf( TPLAN_TPROJECT_KO_STR, $plan['name'], $tplanid, $project['name'], $tprojectid ); - $this->errors[] = new IXR_Error( TPLAN_TPROJECT_KO, $msg_prefix . $msg ); + $tplanid = intval($this->args[self::$testPlanIDParamName]); + $tprojectid = intval( + $this->args[self::$testProjectIDParamName]); + + $sql = " SELECT id FROM {$this->tables['nodes_hierarchy']} " . + " WHERE id = " . $tplanid . " AND parent_id = " . + $tprojectid; + + $rs = $this->dbObj->get_recordset($sql); + $status_ok = ! is_null($rs); + if (! $status_ok) { + $project = $this->tprojectMgr->get_by_id($tprojectid); + $plan = $this->tplanMgr->get_by_id($tplanid); + $msg = sprintf(TPLAN_TPROJECT_KO_STR, $plan['name'], + $tplanid, $project['name'], $tprojectid); + $this->errors[] = new IXR_Error(TPLAN_TPROJECT_KO, + $msg_prefix . $msg); } } break; - case 'design' : - default : + case 'design': + default: break; } - if($status_ok && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($status_ok && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR)) { $cf_name = $this->args[self::$customFieldNameParamName]; $tproject_id = $this->args[self::$testProjectIDParamName]; $nodetype = $this->args[self::$nodeTypeParamName]; @@ -6025,23 +6617,28 @@ protected function getCustomFieldValue($args, $msg_prefix = '') { $enabled = 1; // returning only enabled custom fields $cfield_mgr = $this->tprojectMgr->cfield_mgr; - $cfinfo = $cfield_mgr->get_by_name( $cf_name ); - $cfield = current( $cfinfo ); + $cfinfo = $cfield_mgr->get_by_name($cf_name); + $cfield = current($cfinfo); - switch($scope) { - case 'design' : + switch ($scope) { + case 'design': $filters = array( - 'cfield_id' => $cfield['id'] + 'cfield_id' => $cfield['id'] ); - $cfieldSpec = $cfield_mgr->get_linked_cfields_at_design( $tproject_id, $enabled, $filters, $nodetype, $nodeid ); + $cfieldSpec = $cfield_mgr->get_linked_cfields_at_design( + $tproject_id, $enabled, $filters, $nodetype, $nodeid); break; - case 'execution' : - $cfieldSpec = $cfield_mgr->get_linked_cfields_at_execution( $tproject_id, $enabled, $nodetype, $nodeid, $executionid, $testplanid ); + case 'execution': + $cfieldSpec = $cfield_mgr->get_linked_cfields_at_execution( + $tproject_id, $enabled, $nodetype, $nodeid, $executionid, + $testplanid); break; - case 'testplan_design' : - $cfieldSpec = $cfield_mgr->get_linked_cfields_at_testplan_design( $tproject_id, $enabled, $nodetype, $nodeid, $linkid, $testplanid ); + case 'testplan_design': + $cfieldSpec = $cfield_mgr->get_linked_cfields_at_testplan_design( + $tproject_id, $enabled, $nodetype, $nodeid, $linkid, + $testplanid); break; } return $cfieldSpec[$cfield['id']]; @@ -6073,44 +6670,49 @@ protected function getCustomFieldValue($args, $msg_prefix = '') { * * @access public */ - public function getTestCaseCustomFieldExecutionValue($args) { + public function getTestCaseCustomFieldExecutionValue($args) + { $msgPrefix = "(" . __FUNCTION__ . ") - "; $args[self::$nodeTypeParamName] = 'testcase'; $args[self::$scopeParamName] = 'execution'; - $this->_setArgs( $args ); + $this->_setArgs($args); $status_ok = true; $p2c = array( - self::$executionIDParamName, - self::$versionNumberParamName + self::$executionIDParamName, + self::$versionNumberParamName ); - foreach( $p2c as $prm ) { - $status_ok = $this->_isParamPresent( $prm, $msgPrefix, self::SET_ERROR ); - if($status_ok == FALSE) { + foreach ($p2c as $prm) { + $status_ok = $this->_isParamPresent($prm, $msgPrefix, + self::SET_ERROR); + if (! $status_ok) { break; } } // version number is related to execution id - if($status_ok) { - $sql = " SELECT id,tcversion_id FROM {$this->tables['executions']} " . " WHERE id = " . intval( $args[self::$executionIDParamName] ) . " AND tcversion_number = " . intval( $args[self::$versionNumberParamName] ); - - $rs = $this->dbObj->get_recordset( $sql ); + if ($status_ok) { + $sql = " SELECT id,tcversion_id FROM {$this->tables['executions']} " . + " WHERE id = " . intval($args[self::$executionIDParamName]) . + " AND tcversion_number = " . + intval($args[self::$versionNumberParamName]); + $rs = $this->dbObj->get_recordset($sql); - // return $sql; - if(is_null( $rs )) { + if (is_null($rs)) { $status_ok = false; - $msg = sprintf( NO_MATCH_STR, self::$versionNumberParamName . '/' . self::$executionIDParamName ); - $this->errors[] = new IXR_Error( NO_MATCH, $msg ); + $msg = sprintf(NO_MATCH_STR, + self::$versionNumberParamName . '/' . + self::$executionIDParamName); + $this->errors[] = new IXR_Error(NO_MATCH, $msg); } else { $args[self::$nodeIDParamName] = $rs[0]['tcversion_id']; } } - if($status_ok) { - return $this->getCustomFieldValue( $args ); + if ($status_ok) { + return $this->getCustomFieldValue($args); } return $this->errors; } @@ -6138,12 +6740,13 @@ public function getTestCaseCustomFieldExecutionValue($args) { * * @access public */ - public function getTestCaseCustomFieldTestPlanDesignValue($args) { + public function getTestCaseCustomFieldTestPlanDesignValue($args) + { $args[self::$nodeTypeParamName] = 'testcase'; $args[self::$nodeIDParamName] = $args[self::$versionNumberParamName]; $args[self::$scopeParamName] = 'testplan_design'; - return $this->getCustomFieldValue( $args ); + return $this->getCustomFieldValue($args); } /** @@ -6165,12 +6768,13 @@ public function getTestCaseCustomFieldTestPlanDesignValue($args) { * * @access public */ - public function getTestSuiteCustomFieldDesignValue($args) { + public function getTestSuiteCustomFieldDesignValue($args) + { $args[self::$nodeTypeParamName] = 'testsuite'; $args[self::$nodeIDParamName] = $args[self::$testSuiteIDParamName]; $args[self::$scopeParamName] = 'design'; - return $this->getCustomFieldValue( $args ); + return $this->getCustomFieldValue($args); } /** @@ -6192,12 +6796,13 @@ public function getTestSuiteCustomFieldDesignValue($args) { * * @access public */ - public function getTestPlanCustomFieldDesignValue($args) { + public function getTestPlanCustomFieldDesignValue($args) + { $args[self::$nodeTypeParamName] = 'testplan'; $args[self::$nodeIDParamName] = $args[self::$testPlanIDParamName]; $args[self::$scopeParamName] = 'design'; - return $this->getCustomFieldValue( $args ); + return $this->getCustomFieldValue($args); } /** @@ -6219,12 +6824,13 @@ public function getTestPlanCustomFieldDesignValue($args) { * * @access public */ - public function getReqSpecCustomFieldDesignValue($args) { + public function getReqSpecCustomFieldDesignValue($args) + { $args[self::$nodeTypeParamName] = 'requirement_spec'; $args[self::$nodeIDParamName] = $args[self::$reqSpecIDParamName]; $args[self::$scopeParamName] = 'design'; - return $this->getCustomFieldValue( $args ); + return $this->getCustomFieldValue($args); } /** @@ -6246,12 +6852,13 @@ public function getReqSpecCustomFieldDesignValue($args) { * * @access public */ - public function getRequirementCustomFieldDesignValue($args) { + public function getRequirementCustomFieldDesignValue($args) + { $args['nodetype'] = 'requirement'; $args['nodeid'] = $args[self::$requirementIDParamName]; $args['scope'] = 'design'; - return $this->getCustomFieldValue( $args ); + return $this->getCustomFieldValue($args); } /** @@ -6285,24 +6892,24 @@ public function getRequirementCustomFieldDesignValue($args) { * @internal revisions * 20111018 - franciscom - TICKET 4774: New methods to manage test case steps */ - function createTestCaseSteps($args) { + public function createTestCaseSteps($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $resultInfo = array(); - $useLatestVersion = true; $version = - 1; $item = null; $stepSet = null; - $stepNumbers = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->userHasRight("mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if($status_ok) { + if ($status_ok) { // Important Notice: method checkTestCaseIdentity sets // $this->args[self::$testCaseIDParamName] $tcaseID = $this->args[self::$testCaseIDParamName]; @@ -6311,115 +6918,123 @@ function createTestCaseSteps($args) { // if parameter version does not exits or is < 0 // then we will on latest version active or not - if($this->_isParamPresent( self::$versionNumberParamName )) { + if ($this->_isParamPresent(self::$versionNumberParamName)) { $version = $this->args[self::$versionNumberParamName]; } $resultInfo['version'] = 'exists'; - if($version > 0) { - $item = $this->tcaseMgr->get_basic_info( $tcaseID, array( + if ($version > 0) { + $item = $this->tcaseMgr->get_basic_info($tcaseID, + array( 'number' => $version - ) ); + )); } else { $resultInfo['version'] = 'DOES NOT ' . $resultInfo['version']; - $item = $this->tcaseMgr->get_last_active_version( $tcaseID ); - if(is_null( $item )) { + $item = $this->tcaseMgr->get_last_active_version($tcaseID); + if (is_null($item)) { // get last version no matter if is active - $dummy = $this->tcaseMgr->get_last_version_info( $tcaseID ); + $dummy = $this->tcaseMgr->getLastVersionInfo($tcaseID); $dummy['tcversion_id'] = $dummy['id']; $item[0] = $dummy; } } - if(is_null( $item )) { + if (is_null($item)) { $status_ok = false; - $msg = sprintf( VERSION_NOT_VALID_STR, $version ); - $this->errors[] = new IXR_Error( VERSION_NOT_VALID, $msg ); + $msg = sprintf(VERSION_NOT_VALID_STR, $version); + $this->errors[] = new IXR_Error(VERSION_NOT_VALID, $msg); } - if($status_ok) { - $item = current( $item ); + if ($status_ok) { + $item = current($item); $tcversion_id = $item['tcversion_id']; $resultInfo['tcversion_id'] = $tcversion_id; $step_id = 0; $stepSet = null; - $action = isset( $this->args, self::$actionParamName ) ? $this->args[self::$actionParamName] : 'create'; + $action = isset($this->args, self::$actionParamName) ? $this->args[self::$actionParamName] : 'create'; // // id,step_number,actions,expected_results,active,execution_type $opt = array( - 'accessKey' => 'step_number' + 'accessKey' => 'step_number' ); - $stepSet =( array ) $this->tcaseMgr->get_steps( $tcversion_id, 0, $opt ); - $stepNumberIDSet = array_flip( array_keys( $stepSet ) ); - foreach( $stepNumberIDSet as $sn => $dummy ) { + $stepSet = (array) $this->tcaseMgr->get_steps($tcversion_id, 0, + $opt); + $stepNumberIDSet = array_flip(array_keys($stepSet)); + foreach ($stepNumberIDSet as $sn => $dummy) { $stepNumberIDSet[$sn] = $stepSet[$sn]['id']; } $resultInfo['stepSet'] = $stepSet; $resultInfo['stepNumberIDSet'] = $stepNumberIDSet; - foreach( $this->args[self::$stepsParamName] as $si ) { - $execution_type = isset( $si['execution_type'] ) ? $si['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; - $stepExists = isset( $stepSet[$si['step_number']] ); - if($stepExists) { + foreach ($this->args[self::$stepsParamName] as $si) { + $execution_type = isset($si['execution_type']) ? $si['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; + $stepExists = isset($stepSet[$si['step_number']]); + if ($stepExists) { // needed for update op. $step_id = $stepSet[$si['step_number']]['id']; $resultInfo['stepID'][] = array( - $step_id, - $si['step_number'] + $step_id, + $si['step_number'] ); } - switch($action) { - case 'update' : + switch ($action) { + case 'update': $op = $stepExists ? $action : 'create'; break; - case 'push' : + case 'push': $op = $stepExists ? $action : 'skip'; break; - case 'create' : + case 'create': $op = $stepExists ? 'skip' : $action; break; } $resultInfo['feedback'][] = array( - 'operation' => $op, - 'step_number' => $si['step_number'] + 'operation' => $op, + 'step_number' => $si['step_number'] ); - switch($op) { - case 'update' : - $this->tcaseMgr->update_step( $step_id, $si['step_number'], $si['actions'], $si['expected_results'], $execution_type ); + switch ($op) { + case 'update': + $this->tcaseMgr->update_step($step_id, + $si['step_number'], $si['actions'], + $si['expected_results'], $execution_type); break; - case 'create' : - $this->tcaseMgr->create_step( $tcversion_id, $si['step_number'], $si['actions'], $si['expected_results'], $execution_type ); + case 'create': + $this->tcaseMgr->create_step($tcversion_id, + $si['step_number'], $si['actions'], + $si['expected_results'], $execution_type); break; - case 'push' : + case 'push': // First action renumber existent steps $renumberedSet = null; - foreach( $stepNumberIDSet as $tsn => $dim ) { - if($tsn < $si['step_number']) { - unset( $stepNumberIDSet[$tsn] ); + foreach ($stepNumberIDSet as $tsn => $dim) { + if ($tsn < $si['step_number']) { + unset($stepNumberIDSet[$tsn]); } else { $renumberedSet[$dim] = $tsn + 1; } } - $this->tcaseMgr->set_step_number( $renumberedSet ); - $this->tcaseMgr->create_step( $tcversion_id, $si['step_number'], $si['actions'], $si['expected_results'], $execution_type ); + $this->tcaseMgr->set_step_number($renumberedSet); + $this->tcaseMgr->create_step($tcversion_id, + $si['step_number'], $si['actions'], + $si['expected_results'], $execution_type); break; - case 'skip' : - default : + case 'skip': + default: break; } } } } - return($status_ok ? $resultInfo : $this->errors); + return $status_ok ? $resultInfo : $this->errors; } /** @@ -6438,23 +7053,24 @@ function createTestCaseSteps($args) { * @internal revisions * 20111018 - franciscom - TICKET 4774: New methods to manage test case steps */ - function deleteTestCaseSteps($args) { + public function deleteTestCaseSteps($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $resultInfo = array(); $version = - 1; $item = null; $stepSet = null; - $stepNumberIDSet = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->userHasRight("mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); - if($status_ok) { + if ($status_ok) { // Important Notice: method checkTestCaseIdentity sets // $this->args[self::$testCaseIDParamName] $tcaseID = $this->args[self::$testCaseIDParamName]; @@ -6463,50 +7079,48 @@ function deleteTestCaseSteps($args) { // if parameter version does not exits or is < 0 // then we will on latest version active or not - if($this->_isParamPresent( self::$versionNumberParamName )) { + if ($this->_isParamPresent(self::$versionNumberParamName)) { $version = $this->args[self::$versionNumberParamName]; } $resultInfo['version'] = 'exists'; - if($version > 0) { - $item = $this->tcaseMgr->get_basic_info( $tcaseID, array( + if ($version > 0) { + $item = $this->tcaseMgr->get_basic_info($tcaseID, + array( 'number' => $version - ) ); + )); } else { $resultInfo['version'] = 'DOES NOT ' . $resultInfo['version']; - $item = $this->tcaseMgr->get_last_active_version( $tcaseID ); + $item = $this->tcaseMgr->get_last_active_version($tcaseID); } - if(is_null( $item )) { + if (is_null($item)) { $status_ok = false; - $msg = sprintf( VERSION_NOT_VALID_STR, $version ); - $this->errors[] = new IXR_Error( VERSION_NOT_VALID, $msg ); + $msg = sprintf(VERSION_NOT_VALID_STR, $version); + $this->errors[] = new IXR_Error(VERSION_NOT_VALID, $msg); } - // $resultInfo['item'] = is_null($item) ? $msg : $item; - - if($status_ok) { - - // $resultInfo['steps'] = $this->args[self::$stepsParamName]; + if ($status_ok) { $tcversion_id = $item[0]['tcversion_id']; - $step_id = 0; $stepSet = null; // // id,step_number,actions,expected_results,active,execution_type $opt = array( - 'accessKey' => 'step_number' + 'accessKey' => 'step_number' ); - $stepSet =( array ) $this->tcaseMgr->get_steps( $tcversion_id, 0, $opt ); + $stepSet = (array) $this->tcaseMgr->get_steps($tcversion_id, 0, + $opt); $resultInfo['stepSet'] = $stepSet; - foreach( $this->args[self::$stepsParamName] as $step_number ) { - if(isset( $stepSet[$step_number] )) { - $this->tcaseMgr->delete_step_by_id( $stepSet[$step_number]['id'] ); + foreach ($this->args[self::$stepsParamName] as $step_number) { + if (isset($stepSet[$step_number])) { + $this->tcaseMgr->delete_step_by_id( + $stepSet[$step_number]['id']); } } } } - return($status_ok ? $resultInfo : $this->errors); + return $status_ok ? $resultInfo : $this->errors; } /** @@ -6539,53 +7153,58 @@ function deleteTestCaseSteps($args) { * * @access public */ - public function updateTestCaseCustomFieldDesignValue($args) { + public function updateTestCaseCustomFieldDesignValue($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunc = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestCaseIdentity', - 'checkTestCaseVersionNumber' + 'authenticate', + 'checkTestProjectID', + 'checkTestCaseIdentity', + 'checkTestCaseVersionNumber' ); - $status_ok = $this->_runChecks( $checkFunc, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunc, $msg_prefix); - if($status_ok) { - if(! $this->_isParamPresent( self::$customFieldsParamName )) { - $status_ok = false; - $msg = sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$customFieldsParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } + if ($status_ok && ! $this->_isParamPresent(self::$customFieldsParamName)) { + $status_ok = false; + $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$customFieldsParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - if($status_ok) { + if ($status_ok) { // now check if custom fields are ok // For each custom field need to check if: // 1. is linked to test project // 2. is available for test case at design time - $cfieldMgr = new cfield_mgr( $this->dbObj ); + $cfieldMgr = new cfield_mgr($this->dbObj); // Just ENABLED - $linkedSet = $cfieldMgr->get_linked_cfields_at_design( $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, null, 'testcase', null, 'name' ); - if(is_null( $linkedSet )) { + $linkedSet = $cfieldMgr->get_linked_cfields_at_design( + $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, + null, 'testcase', null, 'name'); + if (is_null($linkedSet)) { $status_ok = false; $msg = NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES_STR; - $this->errors[] = new IXR_Error( NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES, $msg ); + $this->errors[] = new IXR_Error( + NO_CUSTOMFIELDS_DT_LINKED_TO_TESTCASES, $msg); } } - if($status_ok) { + if ($status_ok) { $accessVersionBy['number'] = $this->args[self::$versionNumberParamName]; - $nodeInfo = $this->tcaseMgr->get_basic_info( $this->args[self::$testCaseIDParamName], $accessVersionBy ); + $nodeInfo = $this->tcaseMgr->get_basic_info( + $this->args[self::$testCaseIDParamName], $accessVersionBy); $cfSet = $args[self::$customFieldsParamName]; - foreach( $cfSet as $cfName => $cfValue ) { + foreach ($cfSet as $cfName => $cfValue) { // $accessKey = "custom_field_" . $item['id'] . _ // design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null) $item = $linkedSet[$cfName]; $accessKey = "custom_field_" . $item['type'] . '_' . $item['id']; $hash[$accessKey] = $cfValue; - $cfieldMgr->design_values_to_db( $hash, $nodeInfo[0]['tcversion_id'] ); + $cfieldMgr->design_values_to_db($hash, + $nodeInfo[0]['tcversion_id']); } } else { return $this->errors; @@ -6612,33 +7231,37 @@ public function updateTestCaseCustomFieldDesignValue($args) { * * @access public */ - public function setTestCaseExecutionType($args) { + public function setTestCaseExecutionType($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestCaseIdentity', - 'checkTestCaseVersionNumber' + 'authenticate', + 'checkTestProjectID', + 'checkTestCaseIdentity', + 'checkTestCaseVersionNumber' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); - if($status_ok) { - if(! $this->_isParamPresent( self::$executionTypeParamName )) { - $status_ok = false; - $msg = sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$customFieldsParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); + if ($status_ok && ! $this->_isParamPresent( + self::$executionTypeParamName)) { + $status_ok = false; + $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$customFieldsParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - if($status_ok) { + if ($status_ok) { // if value not on domain, will use TESTCASE_EXECUTION_TYPE_MANUAL $accessVersionBy['number'] = $this->args[self::$versionNumberParamName]; - $nodeInfo = $this->tcaseMgr->get_basic_info( $this->args[self::$testCaseIDParamName], $accessVersionBy ); - $dbg = $this->tcaseMgr->setExecutionType( $nodeInfo[0]['tcversion_id'], $this->args[self::$executionTypeParamName] ); + $nodeInfo = $this->tcaseMgr->get_basic_info( + $this->args[self::$testCaseIDParamName], $accessVersionBy); + $dbg = $this->tcaseMgr->setExecutionType( + $nodeInfo[0]['tcversion_id'], + $this->args[self::$executionTypeParamName]); return array( - $this->args, - $dbg + $this->args, + $dbg ); } else { return $this->errors; @@ -6647,41 +7270,42 @@ public function setTestCaseExecutionType($args) { /** */ - public function getExecCountersByBuild($args) { + public function getExecCountersByBuild($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $total = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $status_ok = true; // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - $metrics = $this->tplanMetricsMgr->getExecCountersByBuildExecStatus( $this->args[self::$testPlanIDParamName] ); + if ($status_ok) { + $metrics = $this->tplanMetricsMgr->getExecCountersByBuildExecStatus( + $this->args[self::$testPlanIDParamName]); } - if(! is_null( $metrics )) { + if (! is_null($metrics)) { // transform in somethin similar to a simple table $out = array(); - foreach( $metrics['with_tester'] as $build_id => &$elem ) { + foreach ($metrics['with_tester'] as $build_id => &$elem) { $out[$build_id] = array(); $out[$build_id]['name'] = $metrics['active_builds'][$build_id]['name']; $out[$build_id]['notes'] = $metrics['active_builds'][$build_id]['notes']; $out[$build_id]['total'] = $metrics['total'][$build_id]['qty']; - foreach( $elem as $status_code => &$data ) { + foreach ($elem as $status_code => &$data) { $out[$build_id][$status_code] = $data['exec_qty']; } } return array( - 'raw' => $metrics, - 'table' => $out + 'raw' => $metrics, + 'table' => $out ); } else { return $this->errors; @@ -6701,61 +7325,70 @@ public function getExecCountersByBuild($args) { * @return mixed $resultInfo * @internal revisions */ - public function createPlatform($args) { - $this->_setArgs( $args ); + public function createPlatform($args) + { + $this->_setArgs($args); $status_ok = false; $msg_prefix = "(" . __FUNCTION__ . ") - "; - if($this->authenticate() && $this->userHasRight( "platform_management", self::CHECK_PUBLIC_PRIVATE_ATTR )) { + if ($this->authenticate() && + $this->userHasRight("platform_management", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { $status_ok = true; $keys2check = array( - self::$platformNameParamName, - self::$testProjectNameParamName + self::$platformNameParamName, + self::$testProjectNameParamName ); - foreach( $keys2check as $key ) { - $names[$key] = $this->_isParamPresent( $key, $msg_prefix, self::SET_ERROR ) ? trim( $this->args[$key] ) : ''; - if($names[$key] == '') { + foreach ($keys2check as $key) { + $names[$key] = $this->_isParamPresent($key, $msg_prefix, + self::SET_ERROR) ? trim($this->args[$key]) : ''; + if ($names[$key] == '') { $status_ok = false; break; } } } - if($status_ok) { - $op = $this->helperGetTestProjectByName( $msg_prefix ); + if ($status_ok) { + $op = $this->helperGetTestProjectByName($msg_prefix); $status_ok = $op['status_ok']; } - if($status_ok) { + if ($status_ok) { // now check if platform exists - if(is_null( $this->platformMgr )) { - $this->platformMgr = new tlPlatform( $this->dbObj, $op['info']['id'] ); + if (is_null($this->platformMgr)) { + $this->platformMgr = new tlPlatform($this->dbObj, + $op['info']['id']); } // lazy way - $name = trim( $this->args[self::$platformNameParamName] ); + $name = trim($this->args[self::$platformNameParamName]); - $opx = array('accessKey' => 'name', - 'output' => 'allinfo'); + $opx = array( + 'accessKey' => 'name', + 'output' => 'allinfo' + ); $itemSet = $this->platformMgr->getAllAsMap($opx); - if(isset( $itemSet[$name] )) { + if (isset($itemSet[$name])) { $status_ok = false; - $msg = $msg_prefix . sprintf( PLATFORMNAME_ALREADY_EXISTS_STR, $name, $itemSet[$name]['id'] ); - $this->errors[] = new IXR_Error( PLATFORMNAME_ALREADY_EXISTS, $msg ); + $msg = $msg_prefix . + sprintf(PLATFORMNAME_ALREADY_EXISTS_STR, $name, + $itemSet[$name]['id']); + $this->errors[] = new IXR_Error(PLATFORMNAME_ALREADY_EXISTS, + $msg); } } - if($status_ok) { - $notes = $this->_isNotePresent() - ? $this->args[self::$noteParamName] : ''; + if ($status_ok) { + $notes = $this->_isNotePresent() ? $this->args[self::$noteParamName] : ''; $plot = new stdClass(); $plot->name = $name; $plot->notes = $notes; - $plot->enable_on_design = $this->_isParamPresent( self::$platformOnDesignParamName ) - ? $this->args[self::$platformOnDesignParamName] : false; - $plot->enable_on_execution = $this->_isParamPresent( self::$platformOnExecutionParamName ) - ? $this->args[self::$platformOnExecutionParamName] : false; + $plot->enable_on_design = $this->_isParamPresent( + self::$platformOnDesignParamName) ? $this->args[self::$platformOnDesignParamName] : false; + $plot->enable_on_execution = $this->_isParamPresent( + self::$platformOnExecutionParamName) ? $this->args[self::$platformOnExecutionParamName] : false; $op = $this->platformMgr->create($plot); $resultInfo = $op; } @@ -6765,30 +7398,32 @@ public function createPlatform($args) { /** */ - public function getProjectPlatforms($args) { + public function getProjectPlatforms($args) + { $messagePrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectIdentity' + 'authenticate', + 'checkTestProjectIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); - if($status_ok) { + if ($status_ok) { $testProjectID = $this->args[self::$testProjectIDParamName]; - if(is_null( $this->platformMgr )) { - $this->platformMgr = new tlPlatform( $this->dbObj, $testProjectID ); + if (is_null($this->platformMgr)) { + $this->platformMgr = new tlPlatform($this->dbObj, $testProjectID); } - $optPlat = array('accessKey' => 'name', - 'output' => 'allinfo', - 'orderBy' => ' ORDER BY name ', - 'enable_on_design' => null, - 'enable_on_execution' => null); + $optPlat = array( + 'accessKey' => 'name', + 'output' => 'allinfo', + 'orderBy' => ' ORDER BY name ', + 'enable_on_design' => null, + 'enable_on_execution' => null + ); - $itemSet = $this->platformMgr->getAllAsMap($optPlat); - return $itemSet; + return $this->platformMgr->getAllAsMap($optPlat); } else { return $this->errors; } @@ -6800,12 +7435,13 @@ public function getProjectPlatforms($args) { * @param struct $args * @param string $args["devKey"] * @param int $args["testplanid"] - * @param map $args["platformname"] + * @param array $args["platformname"] * @return mixed $resultInfo * @internal revisions */ - public function addPlatformToTestPlan($args) { - return $this->platformLinkOp( $args, 'link', "(" . __FUNCTION__ . ") - " ); + public function addPlatformToTestPlan($args) + { + return $this->platformLinkOp($args, 'link', "(" . __FUNCTION__ . ") - "); } /** @@ -6814,12 +7450,14 @@ public function addPlatformToTestPlan($args) { * @param struct $args * @param string $args["devKey"] * @param int $args["testplanid"] - * @param map $args["platformname"] + * @param array $args["platformname"] * @return mixed $resultInfo * @internal revisions */ - public function removePlatformFromTestPlan($args) { - return $this->platformLinkOp( $args, 'unlink', "(" . __FUNCTION__ . ") - " ); + public function removePlatformFromTestPlan($args) + { + return $this->platformLinkOp($args, 'unlink', + "(" . __FUNCTION__ . ") - "); } /** @@ -6844,28 +7482,32 @@ public function removePlatformFromTestPlan($args) { * @return mixed $ret * */ - public function getUserByLogin($args) { + public function getUserByLogin($args) + { $messagePrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate' + 'authenticate' ); $ret = array(); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); - if($status_ok) { - if( $this->user->globalRole->dbID == TL_ROLES_ADMIN || $this->user->login == $this->args[self::$userParamName] ) - { - $user_id = tlUser::doesUserExist( $this->dbObj, $this->args[self::$userParamName] ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); + if ($status_ok) { + if ($this->user->globalRole->dbID == TL_ROLES_ADMIN || + $this->user->login == $this->args[self::$userParamName]) { + $user_id = tlUser::doesUserExist($this->dbObj, + $this->args[self::$userParamName]); } - if(!($status_ok = ! is_null( $user_id ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$userParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + if (! ($status_ok = ! is_null($user_id))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$userParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_THIS_LOGIN, $msg); } } - if($status_ok) { - $user = tlUser::getByID( $this->dbObj, $user_id ); + if ($status_ok) { + $user = tlUser::getByID($this->dbObj, $user_id); $user->userApiKey = null; $ret[] = $user; } @@ -6895,24 +7537,28 @@ public function getUserByLogin($args) { * @return mixed $ret * */ - public function getUserByID($args) { + public function getUserByID($args) + { $messagePrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate' + 'authenticate' ); $ret = array(); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); - if($status_ok) { - if( $this->user->globalRole->dbID == TL_ROLES_ADMIN || $this->userID == $this->args[self::$userIDParamName] ) - { - $user = tlUser::getByID( $this->dbObj, $this->args[self::$userIDParamName] ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); + if ($status_ok) { + if ($this->user->globalRole->dbID == TL_ROLES_ADMIN || + $this->userID == $this->args[self::$userIDParamName]) { + $user = tlUser::getByID($this->dbObj, + $this->args[self::$userIDParamName]); } - if(is_null( $user )) { + if (is_null($user)) { $status_ok = false; - $msg = $messagePrefix . sprintf( NO_USER_BY_THIS_ID_STR, $this->args[self::$userIDParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_ID_LOGIN, $msg ); + $msg = $messagePrefix . + sprintf(NO_USER_BY_THIS_ID_STR, + $this->args[self::$userIDParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_ID_LOGIN, $msg); } else { $user->userApiKey = null; $ret[] = $user; @@ -6924,73 +7570,86 @@ public function getUserByID($args) { /** */ - private function platformLinkOp($args, $op, $messagePrefix) { - $this->_setArgs( $args ); + private function platformLinkOp($args, $op, $messagePrefix) + { + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ) && $this->_isParamPresent( self::$platformNameParamName, $messagePrefix, self::SET_ERROR ); - if($status_ok) { + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix) && + $this->_isParamPresent(self::$platformNameParamName, $messagePrefix, + self::SET_ERROR); + if ($status_ok) { $testPlanID = $this->args[self::$testPlanIDParamName]; // get Test project ID in order to check that requested Platform // belong to same test project that test plan - $dummy = $this->tplanMgr->get_by_id( $testPlanID ); + $dummy = $this->tplanMgr->get_by_id($testPlanID); $testProjectID = $dummy['testproject_id']; - if(is_null( $this->platformMgr )) { - $this->platformMgr = new tlPlatform( $this->dbObj, $testProjectID ); + if (is_null($this->platformMgr)) { + $this->platformMgr = new tlPlatform($this->dbObj, $testProjectID); } else { // extra protection ??(20131307) - $this->platformMgr->setTestProjectID( $testProjectID ); + $this->platformMgr->setTestProjectID($testProjectID); } $platName = $this->args[self::$platformNameParamName]; - $platform = $this->platformMgr->getByName( $platName ); - if(is_null( $platform )) { + $platform = $this->platformMgr->getByName($platName); + if (is_null($platform)) { $status_ok = false; - $msg = $messagePrefix . sprintf( PLATFORM_NAME_DOESNOT_EXIST_STR, $platName ); - $this->errors[] = new IXR_Error( PLATFORM_NAME_DOESNOT_EXIST, $msg ); + $msg = $messagePrefix . + sprintf(PLATFORM_NAME_DOESNOT_EXIST_STR, $platName); + $this->errors[] = new IXR_Error(PLATFORM_NAME_DOESNOT_EXIST, + $msg); } } - if($status_ok) { - $linkExists = $this->platformMgr->isLinkedToTestplan( $platform['id'], $testPlanID ); + if ($status_ok) { + $linkExists = $this->platformMgr->isLinkedToTestplan( + $platform['id'], $testPlanID); $ret = array( - 'operation' => $op, - 'msg' => 'nothing to do', - 'linkStatus' => $linkExists + 'operation' => $op, + 'msg' => 'nothing to do', + 'linkStatus' => $linkExists ); - switch($op) { - case 'link' : - if(! $linkExists) { - $this->platformMgr->linkToTestplan( $platform['id'], $testPlanID ); + switch ($op) { + case 'link': + if (! $linkExists) { + $this->platformMgr->linkToTestplan($platform['id'], + $testPlanID); $ret['msg'] = 'link done'; } break; - case 'unlink' : - if($linkExists) { + case 'unlink': + if ($linkExists) { // If there are test case versions linked to test plan, that use // this platform, operation(as happens on GUI) can not be done - $hits = $this->tplanMgr->countLinkedTCVersionsByPlatform( $testPlanID,( array ) $platform['id'] ); - if($hits[$platform['id']]['qty'] == 0) { - $this->platformMgr->unlinkFromTestplan( $platform['id'], $testPlanID ); + $hits = $this->tplanMgr->countLinkedTCVersionsByPlatform( + $testPlanID, (array) $platform['id']); + if ($hits[$platform['id']]['qty'] == 0) { + $this->platformMgr->unlinkFromTestplan( + $platform['id'], $testPlanID); $ret['msg'] = 'unlink done'; } else { $status_ok = false; - $msg = $messagePrefix . sprintf( PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK_STR, $platName, $hits[$platform['id']]['qty'] ); - $this->errors[] = new IXR_Error( PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK, $msg ); + $msg = $messagePrefix . + sprintf( + PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK_STR, + $platName, $hits[$platform['id']]['qty']); + $this->errors[] = new IXR_Error( + PLATFORM_REMOVETC_NEEDED_BEFORE_UNLINK, $msg); } } break; } - if($status_ok) { + if ($status_ok) { return $ret; } } - if(! $tatus_ok) { + if (! $tatus_ok) { return $this->errors; } } @@ -7029,7 +7688,8 @@ private function platformLinkOp($args, $op, $messagePrefix) { * - login name used as updater - optional * if not provided will be set to user that request update */ - public function updateTestCase($args) { + public function updateTestCase($args) + { // Check test case identity // Check if user(devkey) has grants to do operation // @@ -7038,80 +7698,82 @@ public function updateTestCase($args) { // // translate args key to column name $updKeys = array( - "summary" => null, - "preconditions" => null, - "importance" => null, - "status" => null, - "executiontype" => "execution_type", - "estimatedexecduration" => "estimated_exec_duration" + "summary" => null, + "preconditions" => null, + "importance" => null, + "status" => null, + "executiontype" => "execution_type", + "estimatedexecduration" => "estimated_exec_duration" ); - $resultInfo = array(); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $debug_info = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); $tprojectID = 0; - if($status_ok) { + if ($status_ok) { $tcaseID = $this->args[self::$testCaseIDParamName]; - $tprojectID = $this->tcaseMgr->getTestProjectFromTestCase( $tcaseID, null ); + $tprojectID = $this->tcaseMgr->getTestProjectFromTestCase($tcaseID, + null); } - if($status_ok) { - $updaterID = $this->updateTestCaseGetUpdater( $msg_prefix ); - $status_ok =($updaterID > 0); + if ($status_ok) { + $updaterID = $this->updateTestCaseGetUpdater($msg_prefix); + $status_ok = ($updaterID > 0); } - if($status_ok) { + if ($status_ok) { // we have got internal test case ID on checkTestCaseIdentity - list( $status_ok, $tcversion_id ) = $this->updateTestCaseGetTCVID( $tcaseID ); + list ($status_ok, $tcversion_id) = $this->updateTestCaseGetTCVID( + $tcaseID); } // We will check that: // updater has right to update // user doing call has also has right to update - if($status_ok) { + if ($status_ok) { $ctx[self::$testProjectIDParamName] = $tprojectID; - if($updaterID != $this->userID) { + if ($updaterID != $this->userID) { $ctx['updaterID'] = $updaterID; } $ck = self::CHECK_PUBLIC_PRIVATE_ATTR; $r2c = array( - 'mgt_modify_tc' + 'mgt_modify_tc' ); - foreach( $r2c as $right ) { - $status_ok = $this->userHasRight( $right, $ck, $ctx ); - if(! $status_ok) { + foreach ($r2c as $right) { + $status_ok = $this->userHasRight($right, $ck, $ctx); + if (! $status_ok) { break; } } } // If test case version has been executed, need to check another right - if($status_ok) { - $xc = $this->tcaseMgr->get_versions_status_quo( $tcaseID, $tcversion_id ); + if ($status_ok) { + $xc = $this->tcaseMgr->getVersionsStatusQuo($tcaseID, $tcversion_id); $checkRight = false; - foreach( $xc as $ele ) { - if($ele['executed']) { + foreach ($xc as $ele) { + if ($ele['executed']) { $checkRight = true; break; } } - if($checkRight) { - $r2c = array('testproject_edit_executed_testcases' ); - foreach( $r2c as $right ) { - $status_ok = $this->userHasRight( $right, $ck, $ctx ); - if(! $status_ok) { + if ($checkRight) { + $r2c = array( + 'testproject_edit_executed_testcases' + ); + foreach ($r2c as $right) { + $status_ok = $this->userHasRight($right, $ck, $ctx); + if (! $status_ok) { break; } } @@ -7120,42 +7782,42 @@ public function updateTestCase($args) { // if name update requested, it will be first thing to be udpated // because if we got duplicate name, we will not do update - if($status_ok) { - if(isset( $this->args[self::$testCaseNameParamName] )) { - $ret = $this->tcaseMgr->updateName( $tcaseID, trim( $this->args[self::$testCaseNameParamName] ) ); - if(!($status_ok = $ret['status_ok'])) { - $this->errors[] = new IXR_Error( constant( $ret['API_error_code'] ), $msg_prefix . $ret['msg'] ); - } + if ($status_ok && isset($this->args[self::$testCaseNameParamName])) { + $ret = $this->tcaseMgr->updateName($tcaseID, + trim($this->args[self::$testCaseNameParamName])); + if (! ($status_ok = $ret['status_ok'])) { + $this->errors[] = new IXR_Error( + constant($ret['API_error_code']), $msg_prefix . $ret['msg']); } } - if($status_ok) { + if ($status_ok) { $fv = null; - foreach( $updKeys as $k2s => $field2update ) { - if(isset( $this->args[$k2s] )) { - $fv[(is_null( $field2update ) ? $k2s : $field2update)] = $this->args[$k2s]; + foreach ($updKeys as $k2s => $field2update) { + if (isset($this->args[$k2s])) { + $fv[(is_null($field2update) ? $k2s : $field2update)] = $this->args[$k2s]; } } - if(! is_null( $fv )) { - $sql = $this->tcaseMgr->updateSimpleFields( $tcversion_id, $fv ); + if (! is_null($fv)) { + $this->tcaseMgr->updateSimpleFields($tcversion_id, $fv); } } // if exist proceed with steps actions / expected results update. - if($status_ok) { - if($this->_isParamPresent( self::$stepsParamName ) && ! is_null( $this->args[self::$stepsParamName] )) { - $this->tcaseMgr->update_tcversion_steps( $tcversion_id, $this->args[self::$stepsParamName] ); - } + if ($status_ok && $this->_isParamPresent(self::$stepsParamName) && + ! is_null($this->args[self::$stepsParamName])) { + $this->tcaseMgr->update_tcversion_steps($tcversion_id, + $this->args[self::$stepsParamName]); } - if($status_ok) { + if ($status_ok) { // update updater and modification time stamp - $this->tcaseMgr->updateChangeAuditTrial( $tcversion_id, $updaterID ); + $this->tcaseMgr->updateChangeAuditTrial($tcversion_id, $updaterID); return array( - 'status_ok' => true, - 'msg' => 'ok', - 'operation' => __FUNCTION__ + 'status_ok' => true, + 'msg' => 'ok', + 'operation' => __FUNCTION__ ); } @@ -7164,14 +7826,18 @@ public function updateTestCase($args) { /** */ - function updateTestCaseGetUpdater($msg_prefix) { + private function updateTestCaseGetUpdater($msg_prefix) + { $status_ok = true; $updaterID = $this->userID; - if($this->_isParamPresent( self::$userParamName )) { - $updaterID = tlUser::doesUserExist( $this->dbObj, $this->args[self::$userParamName] ); - if(!($status_ok = ! is_null( $updaterID ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$userParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + if ($this->_isParamPresent(self::$userParamName)) { + $updaterID = tlUser::doesUserExist($this->dbObj, + $this->args[self::$userParamName]); + if (! ($status_ok = ! is_null($updaterID))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$userParamName]); + $this->errors[] = new IXR_Error(NO_USER_BY_THIS_LOGIN, $msg); } } return $status_ok ? $updaterID : - 1; @@ -7179,57 +7845,61 @@ function updateTestCaseGetUpdater($msg_prefix) { /** */ - function updateTestCaseGetTCVID($tcaseID) { + private function updateTestCaseGetTCVID($tcaseID) + { $status_ok = true; $tcversion_id = - 1; // if user has not provided version number, get last version // no matter if active or not - if(isset( $this->args[self::$versionNumberParamName] )) { - if(($status_ok = $this->checkTestCaseVersionNumber())) { + if (isset($this->args[self::$versionNumberParamName])) { + if ($status_ok = $this->checkTestCaseVersionNumber()) { // Check if version number exists for Test Case $ret = $this->checkTestCaseVersionNumberAncestry(); - if(!($status_ok = $ret['status_ok'])) { - $this->errors[] = new IXR_Error( $ret['error_code'], $msg_prefix . $ret['error_msg'] ); + if (! ($status_ok = $ret['status_ok'])) { + $this->errors[] = new IXR_Error($ret['error_code'], + $msg_prefix . $ret['error_msg']); } } - if($status_ok) { + if ($status_ok) { $opt = array( - 'number' => $this->args[self::$versionNumberParamName] + 'number' => $this->args[self::$versionNumberParamName] ); - $dummy = $this->tcaseMgr->get_basic_info( $tcaseID, $opt ); + $dummy = $this->tcaseMgr->get_basic_info($tcaseID, $opt); $tcversion_id = $dummy[0]['tcversion_id']; } } else { // get latest version info - $dummy = $this->tcaseMgr->get_last_version_info( $tcaseID ); + $dummy = $this->tcaseMgr->getLastVersionInfo($tcaseID); $dummy['tcversion_id'] = $dummy['id']; $tcversion_id = $dummy['tcversion_id']; } return array( - $status_ok, - $tcversion_id + $status_ok, + $tcversion_id ); } /** */ - private function helperGetTestProjectByName($msgPrefix = '') { + private function helperGetTestProjectByName($msgPrefix = '') + { $ret = array( - 'status_ok' => true, - 'info' => null + 'status_ok' => true, + 'info' => null ); - $name = trim( $this->args[self::$testProjectNameParamName] ); - $check_op = $this->tprojectMgr->checkNameExistence( $name ); + $name = trim($this->args[self::$testProjectNameParamName]); + $check_op = $this->tprojectMgr->checkNameExistence($name); $ret['status_ok'] = ! $check_op['status_ok']; - if($ret['status_ok']) { - $ret['info'] = current( $this->tprojectMgr->get_by_name( $name ) ); + if ($ret['status_ok']) { + $ret['info'] = current($this->tprojectMgr->get_by_name($name)); } else { - $msg = $msg_prefix . sprintf( TESTPROJECTNAME_DOESNOT_EXIST_STR, $name ); - $this->errors[] = new IXR_Error( TESTPROJECTNAME_DOESNOT_EXIST, $msg ); + $msg = $msg_prefix . + sprintf(TESTPROJECTNAME_DOESNOT_EXIST_STR, $name); + $this->errors[] = new IXR_Error(TESTPROJECTNAME_DOESNOT_EXIST, $msg); } return $ret; } @@ -7256,10 +7926,11 @@ private function helperGetTestProjectByName($msgPrefix = '') { * - login name => tester * */ - public function assignTestCaseExecutionTask($args) { + public function assignTestCaseExecutionTask($args) + { $msgPrefix = "(" . __FUNCTION__ . ") - "; $args['action'] = 'assignOne'; - return $this->manageTestCaseExecutionTask( $args, $msgPrefix ); + return $this->manageTestCaseExecutionTask($args, $msgPrefix); } /** @@ -7286,12 +7957,13 @@ public function assignTestCaseExecutionTask($args) { * ¸ * */ - public function unassignTestCaseExecutionTask($args) { + public function unassignTestCaseExecutionTask($args) + { $msgPrefix = "(" . __FUNCTION__ . ") - "; - if(! isset( $args['action'] )) { + if (! isset($args['action'])) { $args['action'] = 'unassignOne'; } - return $this->manageTestCaseExecutionTask( $args, $msgPrefix ); + return $this->manageTestCaseExecutionTask($args, $msgPrefix); } /** @@ -7321,92 +7993,101 @@ public function unassignTestCaseExecutionTask($args) { * * @access public */ - public function getTestCaseAssignedTester($args) { + public function getTestCaseAssignedTester($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity', - 'checkBuildID' + 'authenticate', + 'checkTestPlanID', + 'checkTestCaseIdentity', + 'checkBuildID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); // Check if requested test case is linke to test plan // if answer is yes, get link info, in order to be able to check if // we need also platform info - if($status_ok) { + if ($status_ok) { $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => null, - 'build_id' => $this->args[self::$buildIDParamName] + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => null, + 'build_id' => $this->args[self::$buildIDParamName] ); $tplan_id = $this->args[self::$testPlanIDParamName]; $tcase_id = $this->args[self::$testCaseIDParamName]; $filters = array( - 'exec_status' => "ALL", - 'active_status' => "ALL", - 'tplan_id' => $tplan_id, - 'platform_id' => null + 'exec_status' => "ALL", + 'active_status' => "ALL", + 'tplan_id' => $tplan_id, + 'platform_id' => null ); - $info = $this->tcaseMgr->get_linked_versions( $tcase_id, $filters, array( + $info = $this->tcaseMgr->get_linked_versions($tcase_id, $filters, + array( 'output' => "feature_id" - ) ); + )); // more than 1 item => we have platforms // access key => tcversion_id, tplan_id, platform_id - $link = current( $info ); + $link = current($info); $link = $link[$tplan_id]; // Inside test plan, is indexed by platform - $check_platform =(count( $link ) > 1) || ! isset( $link[0] ); + $check_platform = (count($link) > 1) || ! isset($link[0]); } - if($status_ok && $check_platform) { + if ($status_ok && $check_platform) { // this means that platform is MANDATORY - if(! $this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) && ! $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { + if (! $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) && + ! $this->_isParamPresent(self::$platformNameParamName, + $msg_prefix)) { $status_ok = false; - $pname = self::$platformNameParamName . ' OR ' . self::$platformIDParamName; - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $pname ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + $pname = self::$platformNameParamName . ' OR ' . + self::$platformIDParamName; + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } else { // get platform_id and check it - if(($status_ok = $this->checkPlatformIdentity( $tplan_id ))) { - $platform_set = $this->tplanMgr->getPlatforms( $tplan_id, array( + if ($status_ok = $this->checkPlatformIdentity($tplan_id)) { + $platform_set = $this->tplanMgr->getPlatforms($tplan_id, + array( 'outputFormat' => 'mapAccessByID', 'outputDetails' => 'name' - ) ); + )); // Now check if link has all 3 components // test plan, test case, platform $platform_id = $this->args[self::$platformIDParamName]; $platform_info = array( - $platform_id => $platform_set[$platform_id] + $platform_id => $platform_set[$platform_id] ); - if(($status_ok = $this->_checkTCIDAndTPIDValid( $platform_info, $msg_prefix ))) { + if ($status_ok = $this->_checkTCIDAndTPIDValid( + $platform_info, $msg_prefix)) { $execContext['platform_id'] = $platform_id; } } } } - if($status_ok) { + if ($status_ok) { $getOpt = array( - 'output' => 'assignment_info', - 'build4assignment' => $execContext['build_id'] + 'output' => 'assignment_info', + 'build4assignment' => $execContext['build_id'] ); - $dummy = $this->tplanMgr->getLinkInfo( $tplan_id, $tcase_id, $platform_id, $getOpt ); + $dummy = $this->tplanMgr->getLinkInfo($tplan_id, $tcase_id, + $platform_id, $getOpt); $resultInfo[0] = array( - 'user_id' => $dummy[0]['user_id'], - 'login' => $dummy[0]['login'], - 'first' => $dummy[0]['first'], - 'last' => $dummy[0]['last'] + 'user_id' => $dummy[0]['user_id'], + 'login' => $dummy[0]['login'], + 'first' => $dummy[0]['first'], + 'last' => $dummy[0]['last'] ); } @@ -7444,10 +8125,11 @@ public function getTestCaseAssignedTester($args) { * @param int $args["buildname"] * - optional(see $args["buildid"]) * - * @param int $args["executionid"]: optional - * Restrict bugs of the given execution. Otherwise, give all - * bugs of all executions of the Test Case (possibly filtered on - * platforms and builds) + * @param int $args["executionid"]: + * optional + * Restrict bugs of the given execution. Otherwise, give all + * bugs of all executions of the Test Case (possibly filtered on + * platforms and builds) * * @return mixed $resultInfo * if execution found @@ -7459,76 +8141,75 @@ public function getTestCaseAssignedTester($args) { * * @access public */ - public function getTestCaseBugs($args) { + public function getTestCaseBugs($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $status_ok = true; - // Checks are done in order - $checkFunctions = array( - 'authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity' - ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->_checkTCIDAndTPIDValid( null, $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); - $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => null, - 'build_id' => null, - 'execution_id' => null + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => null, + 'build_id' => null, + 'execution_id' => null ); // Now we can check for Optional parameters - if($this->_isBuildIDPresent() || $this->_isBuildNamePresent()) { - if(($status_ok = $this->checkBuildID( $msg_prefix ))) { - $execContext['build_id'] = $this->args[self::$buildIDParamName]; - } + if ($this->_isBuildIDPresent() || + $this->_isBuildNamePresent() && + $status_ok = $this->checkBuildID($msg_prefix)) { + $execContext['build_id'] = $this->args[self::$buildIDParamName]; } - if ($status_ok) { - if($this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) || $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { - $status_ok = $this->checkPlatformIdentity( $this->args[self::$testPlanIDParamName] ); - if ($status_ok) { - $execContext['platform_id'] = $this->args[self::$platformIDParamName]; - } + if ($status_ok && + $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) || + $this->_isParamPresent(self::$platformNameParamName, $msg_prefix)) { + $status_ok = $this->checkPlatformIdentity( + $this->args[self::$testPlanIDParamName]); + if ($status_ok) { + $execContext['platform_id'] = $this->args[self::$platformIDParamName]; } } - if ($status_ok) { - if( $this->_isParamPresent(self::$executionIDParamName, $msg_prefix) ) { - $status_ok = $this->checkExecutionID($msg_prefix); - if ($status_ok) { - $execContext['execution_id'] = $this->args[self::$executionIDParamName]; - } + if ($status_ok && + $this->_isParamPresent(self::$executionIDParamName, $msg_prefix)) { + $status_ok = $this->checkExecutionID($msg_prefix); + if ($status_ok) { + $execContext['execution_id'] = $this->args[self::$executionIDParamName]; } } if ($status_ok) { $targetIDs = array(); - if ( is_null($execContext['execution_id']) ) { - $sql = " SELECT id AS exec_id FROM {$this->tables['executions']} " . " WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} " . " AND tcversion_id IN(" . " SELECT id FROM {$this->tables['nodes_hierarchy']} " . " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; - - if(! is_null( $execContext['build_id'] )) { - $sql .= " AND build_id = " . intval( $execContext['build_id'] ); + if (is_null($execContext['execution_id'])) { + $sql = " SELECT id AS exec_id FROM {$this->tables['executions']} " . + " WHERE testplan_id = {$this->args[self::$testPlanIDParamName]} " . + " AND tcversion_id IN(" . + " SELECT id FROM {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id = {$this->args[self::$testCaseIDParamName]})"; + + if (! is_null($execContext['build_id'])) { + $sql .= " AND build_id = " . + intval($execContext['build_id']); } - if(! is_null( $execContext['platform_id'] )) { - $sql .= " AND platform_id = " . intval( $execContext['platform_id'] ); + if (! is_null($execContext['platform_id'])) { + $sql .= " AND platform_id = " . + intval($execContext['platform_id']); } - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'exec_id' ); - if(is_null( $rs )) { + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'exec_id'); + if (is_null($rs)) { // has not been executed // execution id = -1 => test case has not been runned. $resultInfo[] = array( - 'id' => - 1 - ); + 'id' => - 1 + ); } else { - foreach( $rs as $execrun ) { + foreach ($rs as $execrun) { $targetIDs[] = $execrun['exec_id']; } } @@ -7536,10 +8217,12 @@ public function getTestCaseBugs($args) { $targetIDs[] = $execContext['execution_id']; } - if ( count($targetIDs) > 0 ) { + if (! empty($targetIDs)) { $resultInfo[0]['bugs'] = array(); - $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " . " WHERE execution_id in(" . implode( ',', $targetIDs ) . ")"; - $resultInfo[0]['bugs'] =( array ) $this->dbObj->get_recordset( $sql ); + $sql = " SELECT DISTINCT bug_id FROM {$this->tables['execution_bugs']} " . + " WHERE execution_id in(" . implode(',', $targetIDs) . ")"; + $resultInfo[0]['bugs'] = (array) $this->dbObj->get_recordset( + $sql); } } @@ -7571,34 +8254,40 @@ public function getTestCaseBugs($args) { * - login name => tester * */ - private function manageTestCaseExecutionTask($args, $msg_prefix) { + private function manageTestCaseExecutionTask($args, $msg_prefix) + { $status_ok = true; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity', - 'checkBuildID' + 'authenticate', + 'checkTestPlanID', + 'checkTestCaseIdentity', + 'checkBuildID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); - - if($status_ok) { - switch($args['action']) { - case 'assignOne' : - case 'unassignOne' : - if(($status_ok = $this->_isParamPresent( self::$userParamName, $msg_prefix, self::SET_ERROR ))) { - $tester_id = tlUser::doesUserExist( $this->dbObj, $this->args[self::$userParamName] ); - if(!($status_ok = ! is_null( $tester_id ))) { - $msg = $msg_prefix . sprintf( NO_USER_BY_THIS_LOGIN_STR, $this->args[self::$userParamName] ); - $this->errors[] = new IXR_Error( NO_USER_BY_THIS_LOGIN, $msg ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); + + if ($status_ok) { + switch ($args['action']) { + case 'assignOne': + case 'unassignOne': + if ($status_ok = $this->_isParamPresent( + self::$userParamName, $msg_prefix, self::SET_ERROR)) { + $tester_id = tlUser::doesUserExist($this->dbObj, + $this->args[self::$userParamName]); + if (! ($status_ok = ! is_null($tester_id))) { + $msg = $msg_prefix . + sprintf(NO_USER_BY_THIS_LOGIN_STR, + $this->args[self::$userParamName]); + $this->errors[] = new IXR_Error( + NO_USER_BY_THIS_LOGIN, $msg); } } break; - case 'unassignAll' : + case 'unassignAll': break; } } @@ -7606,65 +8295,72 @@ private function manageTestCaseExecutionTask($args, $msg_prefix) { // Check if requested test case is linked to test plan // if answer is yes, get link info, in order to be able to check if // we need also platform info - if($status_ok) { + if ($status_ok) { $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => null, - 'build_id' => $this->args[self::$buildIDParamName] + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => null, + 'build_id' => $this->args[self::$buildIDParamName] ); $tplan_id = $this->args[self::$testPlanIDParamName]; $tcase_id = $this->args[self::$testCaseIDParamName]; $filters = array( - 'exec_status' => "ALL", - 'active_status' => "ALL", - 'tplan_id' => $tplan_id, - 'platform_id' => null + 'exec_status' => "ALL", + 'active_status' => "ALL", + 'tplan_id' => $tplan_id, + 'platform_id' => null ); - $info = $this->tcaseMgr->get_linked_versions( $tcase_id, $filters, array( + $info = $this->tcaseMgr->get_linked_versions($tcase_id, $filters, + array( 'output' => "feature_id" - ) ); + )); // more than 1 item => we have platforms // access key => tcversion_id, tplan_id, platform_id - $link = current( $info ); + $link = current($info); $link = $link[$tplan_id]; // Inside test plan, is indexed by platform $platform_id = 0; - $check_platform =(count( $link ) > 1) || ! isset( $link[0] ); + $check_platform = (count($link) > 1) || ! isset($link[0]); } - if($status_ok && $check_platform) { + if ($status_ok && $check_platform) { // this means that platform is MANDATORY - if(! $this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) && ! $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { + if (! $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) && + ! $this->_isParamPresent(self::$platformNameParamName, + $msg_prefix)) { $status_ok = false; - $pname = self::$platformNameParamName . ' OR ' . self::$platformIDParamName; - $msg = $messagePrefix . sprintf( MISSING_REQUIRED_PARAMETER_STR, $pname ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); + $pname = self::$platformNameParamName . ' OR ' . + self::$platformIDParamName; + $msg = $messagePrefix . + sprintf(MISSING_REQUIRED_PARAMETER_STR, $pname); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } else { // get platform_id and check it - if(($status_ok = $this->checkPlatformIdentity( $tplan_id ))) { - $platform_set = $this->tplanMgr->getPlatforms( $tplan_id, array( + if ($status_ok = $this->checkPlatformIdentity($tplan_id)) { + $platform_set = $this->tplanMgr->getPlatforms($tplan_id, + array( 'outputFormat' => 'mapAccessByID', 'outputDetails' => 'name' - ) ); + )); // Now check if link has all 3 components // test plan, test case, platform $platform_id = $this->args[self::$platformIDParamName]; $platform_info = array( - $platform_id => $platform_set[$platform_id] + $platform_id => $platform_set[$platform_id] ); - if(($status_ok = $this->_checkTCIDAndTPIDValid( $platform_info, $msg_prefix ))) { + if ($status_ok = $this->_checkTCIDAndTPIDValid( + $platform_info, $msg_prefix)) { $execContext['platform_id'] = $platform_id; } } } } - if($status_ok) { - $assignment_mgr = new assignment_mgr( $this->dbObj ); + if ($status_ok) { + $assignment_mgr = new assignment_mgr($this->dbObj); $types = $assignment_mgr->get_available_types(); // Remove old execution task assignment @@ -7679,33 +8375,28 @@ private function manageTestCaseExecutionTask($args, $msg_prefix) { // `status` int(10) unsigned default '1', // ATTENTION WITH PLATFORMS - $link = is_null( $execContext['platform_id'] ) ? $link[0] : $link[$execContext['platform_id']]; - $feature = array( - $link['feature_id'] => array( - 'build_id' => $execContext['build_id'] - ) - ); + $link = is_null($execContext['platform_id']) ? $link[0] : $link[$execContext['platform_id']]; - switch($args['action']) { - case 'unassignOne' : + switch ($args['action']) { + case 'unassignOne': $signature[] = array( - 'type' => $types['testcase_execution']['id'], - 'user_id' => $tester_id, - 'feature_id' => $link['feature_id'], - 'build_id' => $execContext['build_id'] + 'type' => $types['testcase_execution']['id'], + 'user_id' => $tester_id, + 'feature_id' => $link['feature_id'], + 'build_id' => $execContext['build_id'] ); - $assignment_mgr->deleteBySignature( $signature ); + $assignment_mgr->deleteBySignature($signature); break; - case 'assignOne' : + case 'assignOne': // Step 1 - remove if exists $signature[] = array( - 'type' => $types['testcase_execution']['id'], - 'user_id' => $tester_id, - 'feature_id' => $link['feature_id'], - 'build_id' => $execContext['build_id'] + 'type' => $types['testcase_execution']['id'], + 'user_id' => $tester_id, + 'feature_id' => $link['feature_id'], + 'build_id' => $execContext['build_id'] ); - $assignment_mgr->deleteBySignature( $signature ); + $assignment_mgr->deleteBySignature($signature); // Step 2 - Now assign $assign_status = $assignment_mgr->get_available_status(); @@ -7715,21 +8406,21 @@ private function manageTestCaseExecutionTask($args, $msg_prefix) { $oo[$link['feature_id']]['user_id'] = $tester_id; $oo[$link['feature_id']]['assigner_id'] = $this->userID; $oo[$link['feature_id']]['build_id'] = $execContext['build_id']; - $assignment_mgr->assign( $oo ); + $assignment_mgr->assign($oo); break; - case 'unassignAll' : + case 'unassignAll': $oo[$link['feature_id']]['type'] = $types['testcase_execution']['id']; $oo[$link['feature_id']]['build_id'] = $execContext['build_id']; - $assignment_mgr->delete_by_feature_id_and_build_id( $oo ); + $assignment_mgr->delete_by_feature_id_and_build_id($oo); break; } $resultInfo = array( - "status" => true, - "args" => $this->args + "status" => true, + "args" => $this->args ); - unset( $resultInfo['args']['devKey'] ); + unset($resultInfo['args']['devKey']); } return $status_ok ? $resultInfo : $this->errors; @@ -7737,19 +8428,21 @@ private function manageTestCaseExecutionTask($args, $msg_prefix) { /** */ - public function getProjectKeywords($args) { + public function getProjectKeywords($args) + { $messagePrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID' + 'authenticate', + 'checkTestProjectID' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); - if($status_ok) { - $itemSet = $this->getValidKeywordSet( intval( $this->args[self::$testProjectIDParamName] ), '', true, 'getProjectKeywords' ); - return $itemSet; + if ($status_ok) { + return $this->getValidKeywordSet( + intval($this->args[self::$testProjectIDParamName]), '', true, + 'getProjectKeywords'); } else { return $this->errors; } @@ -7758,65 +8451,70 @@ public function getProjectKeywords($args) { /** * Gets list of keywords for a given Test Case Version * - * @param mixed $testcaseid can be int or array - * mixed $testcaseexternalid can be int or array - * mixed[$version] can be int or array - * if not provided latest version will be used + * @param mixed $testcaseid + * can be int or array + * mixed $testcaseexternalid can be int or array + * mixed[$version] can be int or array + * if not provided latest version will be used * - * @return map indexed by Access Key - * test case internal(DB) ID OR - * test case external ID. + * @return array indexed by Access Key + * test case internal(DB) ID OR + * test case external ID. * * @access public */ - public function getTestCaseKeywords($args) { + public function getTestCaseKeywords($args) + { $msgPrefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); // Prepare material for checkTestCaseSetIdentity() - $a2check = array( self::$testCaseIDParamName, - self::$testCaseExternalIDParamName ); - - foreach( $a2check as $k2c ) { - if(isset( $this->args[$k2c] )) { - $retAsArray = is_array( $this->args[$k2c] ); - $this->args[$k2c] =(array) $this->args[$k2c]; - $outBy = $k2c; - break; - } - } - - $checkFunctions = array('authenticate', - 'checkTestCaseSetIdentity'); - $status_ok = $this->_runChecks( $checkFunctions, $msgPrefix ); - - if($status_ok) { - $hasVersionSet = isset($this->args[self::$versionNumberParamName]); - if( $hasVersionSet ) { - $versionSet = $this->args[self::$versionNumberParamName]; - } - - $kwSet = array(); - $itemSet = $this->args[self::$testCaseIDParamName]; - foreach( $itemSet as $idx => $tcaseID ) { - - $safeTCID = intval($tcaseID); - $accessKey =($outBy == self::$testCaseIDParamName) ? - $tcaseID : $this->args[$outBy][$idx]; - - if( $hasVersionSet && isset($versionSet[$idx]) ) { - $vnum = intval($versionSet[$idx]); - $tcversion_id = getTCVersionIDFromVersion($safeTCID,$vnum); - } else { - $tcversion_id = $this->tcaseMgr->getLatestVersionID($safeTCID); + $a2check = array( + self::$testCaseIDParamName, + self::$testCaseExternalIDParamName + ); + + foreach ($a2check as $k2c) { + if (isset($this->args[$k2c])) { + $this->args[$k2c] = (array) $this->args[$k2c]; + $outBy = $k2c; + break; + } + } + + $checkFunctions = array( + 'authenticate', + 'checkTestCaseSetIdentity' + ); + $status_ok = $this->_runChecks($checkFunctions, $msgPrefix); + + if ($status_ok) { + $hasVersionSet = isset($this->args[self::$versionNumberParamName]); + if ($hasVersionSet) { + $versionSet = $this->args[self::$versionNumberParamName]; } - $kwSet[$accessKey] = - $this->tcaseMgr->get_keywords_map($safeTCID,$tcversion_id); - } - return $kwSet; + $kwSet = array(); + $itemSet = $this->args[self::$testCaseIDParamName]; + foreach ($itemSet as $idx => $tcaseID) { + + $safeTCID = intval($tcaseID); + $accessKey = ($outBy == self::$testCaseIDParamName) ? $tcaseID : $this->args[$outBy][$idx]; + + if ($hasVersionSet && isset($versionSet[$idx])) { + $vnum = intval($versionSet[$idx]); + $tcversion_id = getTCVersionIDFromVersion($safeTCID, $vnum); + } else { + $tcversion_id = $this->tcaseMgr->getLatestVersionID( + $safeTCID); + } + + $kwSet[$accessKey] = $this->tcaseMgr->get_keywords_map( + $safeTCID, $tcversion_id); + } + return $kwSet; } else { - return $this->errors; + return $this->errors; } } @@ -7830,37 +8528,40 @@ public function getTestCaseKeywords($args) { * @param string $args["devKey"] * @param int $args["testcaseversionid"] * - * @return array - * requirement list, if success + * @return array requirement list, if success * error info, if failure * * @access public * - * compatible with TL version >= 1.9.18 + * compatible with TL version >= 1.9.18 * */ public function getTestCaseRequirements($args) { - $msgPrefix="(" .__FUNCTION__ . ") - "; - $this->_setArgs($args); - $checkFunctions = array('authenticate','checkTestCaseVersionID'); + $msgPrefix = "(" . __FUNCTION__ . ") - "; + $this->_setArgs($args); + $checkFunctions = array( + 'authenticate', + 'checkTestCaseVersionID' + ); - $status_ok=$this->_runChecks($checkFunctions,$msgPrefix); + $status_ok = $this->_runChecks($checkFunctions, $msgPrefix); - if ($status_ok) { - // set the project as context - $tcaseVersionID = $this->args[self::$testCaseVersionIDParamName]; - $tcase_tprojectID = $this->tcaseMgr->get_testproject( $tcaseVersionID ); - $context[self::$testProjectIDParamName] = $tcase_tprojectID; + if ($status_ok) { + // set the project as context + $tcaseVersionID = $this->args[self::$testCaseVersionIDParamName]; + $tcase_tprojectID = $this->tcaseMgr->get_testproject( + $tcaseVersionID); + $context[self::$testProjectIDParamName] = $tcase_tprojectID; - $status_ok = $this->userHasRight("mgt_view_req", false, $context); + $status_ok = $this->userHasRight("mgt_view_req", false, $context); - if($status_ok) { - $itemSet = $this->reqMgr->getGoodForTCVersion($tcaseVersionID); - } - } + if ($status_ok) { + $itemSet = $this->reqMgr->getGoodForTCVersion($tcaseVersionID); + } + } - return $status_ok ? $itemSet : $this->errors; + return $status_ok ? $itemSet : $this->errors; } /** @@ -7871,35 +8572,38 @@ public function getTestCaseRequirements($args) * @param int $args["$tplanID"] * * @return mixed $resultInfo - * [status] => true/false of success - * [id] => result id or error code - * [message] => optional message for error message string + * [status] => true/false of success + * [id] => result id or error code + * [message] => optional message for error message string * @access public */ - public function deleteTestPlan($args) { + public function deleteTestPlan($args) + { $resultInfo = array(); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo[0]["status"] = false; $checkFunctions = array( - 'authenticate', - 'checkTestPlanID' + 'authenticate', + 'checkTestPlanID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - if($this->userHasRight( "exec_delete", self::CHECK_PUBLIC_PRIVATE_ATTR )) { - $this->tplanMgr->delete( $args[self::$testPlanIDParamName] ); + if ($status_ok) { + if ($this->userHasRight("exec_delete", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { + $this->tplanMgr->delete($args[self::$testPlanIDParamName]); $resultInfo[0]["status"] = true; $resultInfo[0]["id"] = $args[self::$testPlanIDParamName]; $resultInfo[0]["message"] = GENERAL_SUCCESS_STR; $resultInfo[0]["operation"] = $operation; } else { $status_ok = false; - $this->errors[] = new IXR_Error( CFG_DELETE_EXEC_DISABLED, CFG_DELETE_EXEC_DISABLED_STR ); + $this->errors[] = new IXR_Error(CFG_DELETE_EXEC_DISABLED, + CFG_DELETE_EXEC_DISABLED_STR); } } @@ -7920,11 +8624,13 @@ public function deleteTestPlan($args) { * @return mixed $resultInfo * */ - function addTestCaseKeywords($args) { - $ret = $this->checksForManageTestCaseKeywords( $args, 'add' ); - if($ret['status_ok']) { + private function addTestCaseKeywords($args) + { + $ret = $this->checksForManageTestCaseKeywords($args, 'add'); + if ($ret['status_ok']) { $kwSet = $this->args[self::$keywordNameParamName]; - return $this->manageTestCaseKeywords( $kwSet, $ret['tprojectSet'], 'add' ); + return $this->manageTestCaseKeywords($kwSet, $ret['tprojectSet'], + 'add'); } return $this->errors; } @@ -7940,11 +8646,13 @@ function addTestCaseKeywords($args) { * @internal revisions * @since 1.9.14 */ - function removeTestCaseKeywords($args) { - $ret = $this->checksForManageTestCaseKeywords( $args, 'remove' ); - if($ret['status_ok']) { + private function removeTestCaseKeywords($args) + { + $ret = $this->checksForManageTestCaseKeywords($args, 'remove'); + if ($ret['status_ok']) { $kwSet = $this->args[self::$keywordNameParamName]; - return $this->manageTestCaseKeywords( $kwSet, $ret['tprojectSet'], 'remove' ); + return $this->manageTestCaseKeywords($kwSet, $ret['tprojectSet'], + 'remove'); } return $this->errors; } @@ -7953,38 +8661,41 @@ function removeTestCaseKeywords($args) { * * @used by manageTestCaseKeywords */ - protected function checksForManageTestCaseKeywords($args, $action) { - $operation = str_replace( 'checksForManage', $action, __FUNCTION__ ); + protected function checksForManageTestCaseKeywords($args, $action) + { + $operation = str_replace('checksForManage', $action, __FUNCTION__); $msg_prefix = "({$operation}) - "; - $resultInfo = array(); - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate' + 'authenticate' ); // Check on user rights can have some problems if test cases do not belong // to same test project - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); - if($status_ok) { - $items = array_keys( $this->args[self::$keywordNameParamName] ); - $status_ok = $this->checkTestCaseSetIdentity( $msg_prefix, $items ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); + if ($status_ok) { + $items = array_keys($this->args[self::$keywordNameParamName]); + $status_ok = $this->checkTestCaseSetIdentity($msg_prefix, $items); } - if($status_ok) { + if ($status_ok) { // Get test projects $idSet = $this->args[self::$testCaseIDParamName]; - foreach( $idSet as $key => $val ) { + foreach ($idSet as $key => $val) { // indexed by same value than keywords - $tprojectSet[$items[$key]] = $this->tcaseMgr->get_testproject( $val ); + $tprojectSet[$items[$key]] = $this->tcaseMgr->get_testproject( + $val); // Do authorization checks, all or nothing // userHasRight() on failure set error to return to caller - $status_ok = $this->userHasRight( "mgt_modify_tc", self::CHECK_PUBLIC_PRIVATE_ATTR, array( + $status_ok = $this->userHasRight("mgt_modify_tc", + self::CHECK_PUBLIC_PRIVATE_ATTR, + array( self::$testProjectIDParamName => $tprojectSet[$items[$key]] - ) ); - if(! $status_ok) { + )); + if (! $status_ok) { break; } } @@ -8007,20 +8718,22 @@ protected function checksForManageTestCaseKeywords($args, $action) { * @return mixed $resultInfo * */ - protected function manageTestCaseKeywords($keywords, $tprojects, $action) { - switch($action) { - case 'add' : + protected function manageTestCaseKeywords($keywords, $tprojects, $action) + { + switch ($action) { + case 'add': $method2call = 'addKeywords'; break; - case 'delete' : - case 'remove' : + case 'delete': + case 'remove': $method2call = 'deleteKeywords'; break; - default : + default: $resultInfo['status_ok'] = false; - $resultInfo['verbose'] = __FUNCTION__ . ' :: Banzai!! - No valida method'; + $resultInfo['verbose'] = __FUNCTION__ . + ' :: Banzai!! - No valida method'; return $resultInfo; break; } @@ -8029,22 +8742,26 @@ protected function manageTestCaseKeywords($keywords, $tprojects, $action) { $resultInfo['validKeywords'] = null; $resultInfo['status_ok'] = true; - foreach( $keywords as $ak => $kwset ) { - $kw[$ak] = $this->getValidKeywordSet( $tprojects[$ak], implode( ",", $kwset ), true, true ); + foreach ($keywords as $ak => $kwset) { + $kw[$ak] = $this->getValidKeywordSet($tprojects[$ak], + implode(",", $kwset), true, true); $resultInfo['validKeywords'][$ak] = $kw[$ak]; - $resultInfo['status_ok'] = $resultInfo['status_ok'] &&($kw[$ak] != ''); + $resultInfo['status_ok'] = $resultInfo['status_ok'] && + ($kw[$ak] != ''); } - if($resultInfo['status_ok']) { + if ($resultInfo['status_ok']) { $cacheLTCV = array(); - foreach( $kw as $ak => $val ) { + foreach ($kw as $ak => $val) { $tcaseID = $this->tcaseE2I[$ak]; - if(! isset( $cacheLTCV[$tcaseID] )) { - $cacheLTCV[$tcaseID] = $this->tcaseMgr->getLatestVersionID( $tcaseID ); + if (! isset($cacheLTCV[$tcaseID])) { + $cacheLTCV[$tcaseID] = $this->tcaseMgr->getLatestVersionID( + $tcaseID); } - $this->tcaseMgr->$method2call( $this->tcaseE2I[$ak], $cacheLTCV[$tcaseID], array_keys( $val ) ); + $this->tcaseMgr->$method2call($this->tcaseE2I[$ak], + $cacheLTCV[$tcaseID], array_keys($val)); } } @@ -8066,10 +8783,11 @@ protected function manageTestCaseKeywords($keywords, $tprojects, $action) { * @return boolean * @access protected */ - protected function checkTestCaseSetIdentity($messagePrefix = '', $itemSet = null) { + protected function checkTestCaseSetIdentity($messagePrefix = '', + $itemSet = null) + { // Three Cases - Internal ID, External ID, No Id $status_ok = false; - $fromExternal = false; $fromInternal = false; $fromItemSet = false; @@ -8077,56 +8795,59 @@ protected function checkTestCaseSetIdentity($messagePrefix = '', $itemSet = null $tcaseIDSet = null; $tcaseE2I = null; // External to Internal - if(! is_null( $itemSet )) { - $fromExternal = true; + if (! is_null($itemSet)) { $fromItemSet = true; $errorCode = INVALID_TESTCASE_EXTERNAL_ID; $msg = $messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR; - foreach( $itemSet as $tcaseExternalID ) { - $tcaseE2I[$tcaseExternalID] = $tcaseIDSet[] = intval( $this->tcaseMgr->getInternalID( $tcaseExternalID ) ); + foreach ($itemSet as $tcaseExternalID) { + $tcaseE2I[$tcaseExternalID] = $tcaseIDSet[] = intval( + $this->tcaseMgr->getInternalID($tcaseExternalID)); } } - if($this->_isTestCaseExternalIDPresent()) { - $fromExternal = true; + if ($this->_isTestCaseExternalIDPresent()) { $errorCode = INVALID_TESTCASE_EXTERNAL_ID; $msg = $messagePrefix . INVALID_TESTCASE_EXTERNAL_ID_STR; - foreach( $this->args[self::$testCaseExternalIDParamName] as $tcaseExternalID ) { - $tcaseIDSet[] = intval( $this->tcaseMgr->getInternalID( $tcaseExternalID ) ); + foreach ($this->args[self::$testCaseExternalIDParamName] as $tcaseExternalID) { + $tcaseIDSet[] = intval( + $this->tcaseMgr->getInternalID($tcaseExternalID)); } } - if($this->_isTestCaseIDPresent()) { + if ($this->_isTestCaseIDPresent()) { $fromInternal = true; $errorCode = INVALID_TESTCASE_EXTERNAL_ID; $msg = $messagePrefix . INVALID_TCASEID_STR; $tcaseIDSet = $this->args[self::$testCaseIDParamName]; } - if(! is_null( $tcaseIDSet )) { + if (! is_null($tcaseIDSet)) { $status_ok = true; - foreach( $tcaseIDSet as $idx => $tcaseID ) { - if((($tcaseID = intval( $tcaseID )) <= 0) ||(! $this->_isTestCaseIDValid( $tcaseID, $messagePrefix ))) { + foreach ($tcaseIDSet as $idx => $tcaseID) { + if ((($tcaseID = intval($tcaseID)) <= 0) || + (! $this->_isTestCaseIDValid($tcaseID, $messagePrefix))) { $status_ok = false; - if($fromInternal) { - $this->errors[] = new IXR_Error( $errorCode, sprintf( $msg, $tcaseID ) ); + if ($fromInternal) { + $this->errors[] = new IXR_Error($errorCode, + sprintf($msg, $tcaseID)); } else { - if($fromItemSet) { + if ($fromItemSet) { $tcaseExternalID = $itemSet[$idx]; } else { $tcaseExternalID = $this->args[self::$testCaseExternalIDParamName][$idx]; } - $this->errors[] = new IXR_Error( $errorCode, sprintf( $msg, $tcaseExternalID ) ); + $this->errors[] = new IXR_Error($errorCode, + sprintf($msg, $tcaseExternalID)); } } } } - if($status_ok) { - $this->_setTestCaseID( $tcaseIDSet ); + if ($status_ok) { + $this->_setTestCaseID($tcaseIDSet); $this->tcaseE2I = $tcaseE2I; } @@ -8135,10 +8856,11 @@ protected function checkTestCaseSetIdentity($messagePrefix = '', $itemSet = null /** */ - private function getTcaseDbId($items) { + private function getTcaseDbId($items) + { $tcaseIDSet = null; - foreach( $items as $idx => $eID ) { - $tcaseIDSet[$idx] = intval( $this->tcaseMgr->getInternalID( $eID ) ); + foreach ($items as $idx => $eID) { + $tcaseIDSet[$idx] = intval($this->tcaseMgr->getInternalID($eID)); } return $tcaseIDSet; } @@ -8151,39 +8873,45 @@ private function getTcaseDbId($items) { * @param int $args["prefix"] * * @return mixed $resultInfo - * [status] => true/false of success - * [message] => optional message for error message string + * [status] => true/false of success + * [message] => optional message for error message string * @access public */ - public function deleteTestProject($args) { + public function deleteTestProject($args) + { $resultInfo = array(); $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo[0]["status"] = false; $checkFunctions = array( - 'authenticate' + 'authenticate' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - $status_ok = $this->userHasRight( "mgt_modify_product" ); + if ($status_ok) { + $status_ok = $this->userHasRight("mgt_modify_product"); } - if($status_ok) { - $status_ok = $this->_isParamPresent( self::$prefixParamName, $msg_prefix, true ); + if ($status_ok) { + $status_ok = $this->_isParamPresent(self::$prefixParamName, + $msg_prefix, true); } - if($status_ok) { - if(($info = $this->tprojectMgr->get_by_prefix( $this->args[self::$prefixParamName] ))) { - $this->tprojectMgr->delete( $info['id'] ); + if ($status_ok) { + if ($info = $this->tprojectMgr->get_by_prefix( + $this->args[self::$prefixParamName])) { + $this->tprojectMgr->delete($info['id']); $resultInfo[0]["status"] = true; } else { $status_ok = false; - $msg = $msg_prefix . sprintf( TPROJECT_PREFIX_DOESNOT_EXIST_STR, $this->args[self::$prefixParamName] ); - $this->errors[] = new IXR_Error( TPROJECT_PREFIX_DOESNOT_EXIST, $msg ); + $msg = $msg_prefix . + sprintf(TPROJECT_PREFIX_DOESNOT_EXIST_STR, + $this->args[self::$prefixParamName]); + $this->errors[] = new IXR_Error(TPROJECT_PREFIX_DOESNOT_EXIST, + $msg); } } @@ -8218,63 +8946,67 @@ public function deleteTestProject($args) { * * @access public */ - public function updateTestSuiteCustomFieldDesignValue($args) { + public function updateTestSuiteCustomFieldDesignValue($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkTestSuiteID' + 'authenticate', + 'checkTestProjectID', + 'checkTestSuiteID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - if(! $this->_isParamPresent( self::$customFieldsParamName )) { - $status_ok = false; - $msg = sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$customFieldsParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } + if ($status_ok && ! $this->_isParamPresent(self::$customFieldsParamName)) { + $status_ok = false; + $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$customFieldsParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - if($status_ok) { + if ($status_ok) { // now check if custom fields are ok // For each custom field need to check if: // 1. is linked to test project // 2. is available for Test Suite at design time - $cfieldMgr = new cfield_mgr( $this->dbObj ); + $cfieldMgr = new cfield_mgr($this->dbObj); // Just ENABLED - $linkedSet = $cfieldMgr->get_linked_cfields_at_design( $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, null, 'testsuite', null, 'name' ); - if(is_null( $linkedSet )) { + $linkedSet = $cfieldMgr->get_linked_cfields_at_design( + $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, + null, 'testsuite', null, 'name'); + if (is_null($linkedSet)) { $status_ok = false; $msg = NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES_STR; - $this->errors[] = new IXR_Error( NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES, $msg ); + $this->errors[] = new IXR_Error( + NO_CUSTOMFIELDS_DT_LINKED_TO_TESTSUITES, $msg); } } - if($status_ok) { + if ($status_ok) { $cfSet = $args[self::$customFieldsParamName]; $itemID = $args[self::$testSuiteIDParamName]; - foreach( $cfSet as $cfName => $cfValue ) { + foreach ($cfSet as $cfName => $cfValue) { // $accessKey = "custom_field_" . $item['id'] . _ // design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null) // // Simple check: if name is not present on set => ignore - if(isset( $linkedSet[$cfName] )) { + if (isset($linkedSet[$cfName])) { $item = $linkedSet[$cfName]; - $accessKey = "custom_field_" . $item['type'] . '_' . $item['id']; + $accessKey = "custom_field_" . $item['type'] . '_' . + $item['id']; $hash[$accessKey] = $cfValue; - $cfieldMgr->design_values_to_db( $hash, $itemID ); + $cfieldMgr->design_values_to_db($hash, $itemID); $ret[] = array( - 'status' => 'ok', - 'msg' => 'Custom Field:' . $cfName . ' processed ' + 'status' => 'ok', + 'msg' => 'Custom Field:' . $cfName . ' processed ' ); } else { $ret[] = array( - 'status' => 'ko', - 'msg' => 'Custom Field:' . $cfName . ' skipped ' + 'status' => 'ko', + 'msg' => 'Custom Field:' . $cfName . ' skipped ' ); } @@ -8313,64 +9045,71 @@ public function updateTestSuiteCustomFieldDesignValue($args) { * * @access public */ - public function updateBuildCustomFieldsValues($args) { + public function updateBuildCustomFieldsValues($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkBuildID' + 'authenticate', + 'checkTestProjectID', + 'checkBuildID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { - if(! $this->_isParamPresent( self::$customFieldsParamName )) { - $status_ok = false; - $msg = sprintf( MISSING_REQUIRED_PARAMETER_STR, self::$customFieldsParamName ); - $this->errors[] = new IXR_Error( MISSING_REQUIRED_PARAMETER, $msg ); - } + if ($status_ok && ! $this->_isParamPresent(self::$customFieldsParamName)) { + $status_ok = false; + $msg = sprintf(MISSING_REQUIRED_PARAMETER_STR, + self::$customFieldsParamName); + $this->errors[] = new IXR_Error(MISSING_REQUIRED_PARAMETER, $msg); } - if($status_ok) { + if ($status_ok) { // now check if custom fields are ok // For each custom field need to check if: // 1. is linked to test project // 2. is available for Build at design time - $cfieldMgr = new cfield_mgr( $this->dbObj ); + $cfieldMgr = new cfield_mgr($this->dbObj); // Just ENABLED - $linkedSet = $cfieldMgr->get_linked_cfields_at_design( $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, null, 'build', null, 'name' ); - if(is_null( $linkedSet )) { + $linkedSet = $cfieldMgr->get_linked_cfields_at_design( + $this->args[self::$testProjectIDParamName], cfield_mgr::ENABLED, + null, 'build', null, 'name'); + if (is_null($linkedSet)) { $status_ok = false; $msg = NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS_STR; - $this->errors[] = new IXR_Error( NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS, $msg ); + $this->errors[] = new IXR_Error( + NO_CUSTOMFIELDS_DT_LINKED_TO_BUILDS, $msg); } } - if($status_ok) { + if ($status_ok) { $cfSet = $args[self::$customFieldsParamName]; $ret = array(); - foreach( $cfSet as $cfName => $cfValue ) { + foreach ($cfSet as $cfName => $cfValue) { // $accessKey = "custom_field_" . $item['id'] . _ // design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null) // // Simple check: if name is not present on set => ignore - if(isset( $linkedSet[$cfName] )) { + if (isset($linkedSet[$cfName])) { $item = $linkedSet[$cfName]; - $accessKey = "custom_field_" . $item['type'] . '_' . $item['id']; + $accessKey = "custom_field_" . $item['type'] . '_' . + $item['id']; $hash[$accessKey] = $cfValue; - $cfieldMgr->design_values_to_db( $hash, $args[self::$buildIDParamName], null, null, 'build' ); + $cfieldMgr->design_values_to_db($hash, + $args[self::$buildIDParamName], null, null, 'build'); // Add the result for each custom field to the returned array - array_push( $ret, array( + array_push($ret, + array( 'status' => 'ok', 'msg' => 'Custom Field:' . $cfName . ' processed ' - ) ); + )); } else { - array_push( $ret, array( + array_push($ret, + array( 'status' => 'ko', 'msg' => 'Custom Field:' . $cfName . ' skipped ' - ) ); + )); } } // Return the result after all of the fields have been processed @@ -8393,29 +9132,31 @@ public function updateBuildCustomFieldsValues($args) { * * @access public */ - public function getTestSuite($args) { + public function getTestSuite($args) + { $ope = __FUNCTION__; $msg_prefix = "({$ope}) - "; - $this->_setArgs( $args ); - $status_ok = $this->_runChecks( array( - 'authenticate' - ), $msg_prefix ); + $this->_setArgs($args); + $status_ok = $this->_runChecks(array( + 'authenticate' + ), $msg_prefix); - if($status_ok) { + if ($status_ok) { // Check for mandatory parameters $k2s = array( - self::$testSuiteNameParamName, - self::$prefixParamName + self::$testSuiteNameParamName, + self::$prefixParamName ); - foreach( $k2s as $target ) { - $ok = $this->_isParamPresent( $target, $msg_prefix, self::SET_ERROR ); + foreach ($k2s as $target) { + $ok = $this->_isParamPresent($target, $msg_prefix, + self::SET_ERROR); $status_ok = $status_ok && $ok; } } - if($status_ok) { + if ($status_ok) { // optionals // $details='simple'; // $k2s=self::$detailsParamName; @@ -8425,39 +9166,41 @@ public function getTestSuite($args) { // } } - if($status_ok) { - $tprojectMgr = new testproject( $this->dbObj ); + if ($status_ok) { + $tprojectMgr = new testproject($this->dbObj); $pfx = $this->args[self::$prefixParamName]; - $tproj = $tprojectMgr->get_by_prefix( $pfx ); + $tproj = $tprojectMgr->get_by_prefix($pfx); - if(is_null( $tproj )) { + if (is_null($tproj)) { $status_ok = false; - $msg = $msg_prefix . sprintf( TPROJECT_PREFIX_DOESNOT_EXIST_STR, $pfx ); - $this->errors[] = new IXR_Error( TPROJECT_PREFIX_DOESNOT_EXIST, $msg ); + $msg = $msg_prefix . + sprintf(TPROJECT_PREFIX_DOESNOT_EXIST_STR, $pfx); + $this->errors[] = new IXR_Error(TPROJECT_PREFIX_DOESNOT_EXIST, + $msg); } else { $ctx[self::$testProjectIDParamName] = $dummy['id']; } } - if($status_ok && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR, $ctx )) { + if ($status_ok && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR, + $ctx)) { $opt = array( - 'recursive' => false, - 'exclude_testcases' => true + 'recursive' => false, + 'exclude_testcases' => true ); - // $target = $this->dbObj->prepare_string($tg); - // $filters['additionalWhereClause'] = - // " AND name = '{$target}' "; $filters = null; - $items = $tprojectMgr->get_subtree( $tproj['id'], $filters, $opt ); + $items = $tprojectMgr->get_subtree($tproj['id'], $filters, $opt); $ni = array(); - if(! is_null( $items ) &&($l2d = count( $items )) > 0) { + if (! empty($items)) { + $l2d = count($items); $tg = $this->args[self::$testSuiteNameParamName]; - for($ydx = 0; $ydx <= $l2d; $ydx ++) { - if(strcmp( $items[$ydx]['name'], $tg ) == 0) { - unset( $items[$ydx]['tcversion_id'] ); + for ($ydx = 0; $ydx <= $l2d; $ydx ++) { + if (strcmp($items[$ydx]['name'], $tg) == 0) { + unset($items[$ydx]['tcversion_id']); $ni[] = $items[$ydx]; } } @@ -8467,7 +9210,9 @@ public function getTestSuite($args) { } return $status_ok ? $ni : $this->errors; - } // function end + } + + // function end /** * Get Issue Tracker System by name @@ -8479,56 +9224,60 @@ public function getTestSuite($args) { * @return mixed $itsObject * @access public */ - public function getIssueTrackerSystem($args, $call = null) { + public function getIssueTrackerSystem($args, $call = null) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); - $extCall = is_null( $call ); - if($extCall) { + $extCall = is_null($call); + if ($extCall) { $status_ok = $this->authenticate(); - if(! $status_ok) { + if (! $status_ok) { return $this->errors; } - if(! $this->userHasRight( "issuetracker_view", self::CHECK_PUBLIC_PRIVATE_ATTR )) { - $msg = sprintf( INSUFFICIENT_RIGHTS_STR ); - $this->errors[] = new IXR_Error( INSUFFICIENT_RIGHTS, $msg_prefix . $msg ); + if (! $this->userHasRight("issuetracker_view", + self::CHECK_PUBLIC_PRIVATE_ATTR)) { + $msg = sprintf(INSUFFICIENT_RIGHTS_STR); + $this->errors[] = new IXR_Error(INSUFFICIENT_RIGHTS, + $msg_prefix . $msg); return $this->errors; } } $ret = null; - if(is_null( $this->itsMgr )) { - $this->itsMgr = new tlIssueTracker( $this->dbObj ); + if (is_null($this->itsMgr)) { + $this->itsMgr = new tlIssueTracker($this->dbObj); } - $ret = $this->itsMgr->getByName( $this->args[self::$itsNameParamName] ); - $status_ok = ! is_null( $ret ); - if(! $status_ok) { - $msg = $msg_prefix . sprintf( ITS_NOT_FOUND_STR, $this->args[self::$itsNameParamName] ); - $this->errors[] = new IXR_Error( ITS_NOT_FOUND, $msg ); + $ret = $this->itsMgr->getByName($this->args[self::$itsNameParamName]); + $status_ok = ! is_null($ret); + if (! $status_ok) { + $msg = $msg_prefix . + sprintf(ITS_NOT_FOUND_STR, $this->args[self::$itsNameParamName]); + $this->errors[] = new IXR_Error(ITS_NOT_FOUND, $msg); } - if($extCall) { - if(! $status_ok) { - $ret = $this->errors; - } + if ($extCall && ! $status_ok) { + $ret = $this->errors; } return $ret; } /** */ - function validateDateISO8601($dateAsString) { - return $this->validateDate( $dateAsString ); + private function validateDateISO8601($dateAsString) + { + return $this->validateDate($dateAsString); } /** */ - function validateDate($dateAsString, $format = 'Y-m-d') { - $d = DateTime::createFromFormat( $format, $dateAsString ); - return $d && $d->format( $format ) == $dateAsString; + private function validateDate($dateAsString, $format = 'Y-m-d') + { + $d = DateTime::createFromFormat($format, $dateAsString); + return $d && $d->format($format) == $dateAsString; } /** @@ -8544,46 +9293,51 @@ function validateDate($dateAsString, $format = 'Y-m-d') { * * @access public */ - public function getRequirements($args) { + public function getRequirements($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID' + 'authenticate', + 'checkTestProjectID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); - if($status_ok) { + if ($status_ok) { $context['tproject_id'] = $this->args[self::$testProjectIDParamName]; // check if a context(test plan/platform) is provided - if($this->_isParamPresent( self::$testPlanIDParamName )) { - $status_ok = $this->checkTestPlanID( $msg_prefix ); + if ($this->_isParamPresent(self::$testPlanIDParamName)) { + $status_ok = $this->checkTestPlanID($msg_prefix); $context['tplan_id'] = $this->args[self::$testPlanIDParamName]; - if($status_ok) { - if($this->_isParamPresent( self::$platformIDParamName )) { - $status_ok = $this->checkPlatformIdentity( $this->args[self::$testPlanIDParamName], null, $msg_prefix ); - $context['platform_id'] = $this->args[self::$platformIDParamName]; - } + if ($status_ok && + $this->_isParamPresent(self::$platformIDParamName)) { + $status_ok = $this->checkPlatformIdentity( + $this->args[self::$testPlanIDParamName], null, + $msg_prefix); + $context['platform_id'] = $this->args[self::$platformIDParamName]; } } } - if($status_ok) { - $context_for_rights = array(self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName], - self::$testPlanIDParamName => $this->args[self::$testPlanIDParamName] - ); - $status_ok = $this->userHasRight( 'mgt_view_req', self::CHECK_PUBLIC_PRIVATE_ATTR, $context_for_rights ); + if ($status_ok) { + $context_for_rights = array( + self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName], + self::$testPlanIDParamName => $this->args[self::$testPlanIDParamName] + ); + $status_ok = $this->userHasRight('mgt_view_req', + self::CHECK_PUBLIC_PRIVATE_ATTR, $context_for_rights); } - if($status_ok) { - $dummy = $this->reqMgr->getAllByContext( $context ); - if(! is_null( $dummy )) - $req = array_values( $dummy ); - else + if ($status_ok) { + $dummy = $this->reqMgr->getAllByContext($context); + if (! is_null($dummy)) { + $req = array_values($dummy); + } else { $status_ok = false; + } } return $status_ok ? $req : $this->errors; @@ -8603,66 +9357,68 @@ public function getRequirements($args) { * OPTIONAL * @param string $args["requirementversionid"] * OPTIONAL - * If neither version nor versionid are present, the latest version is used + * If neither version nor versionid are present, the latest version is used * * @return mixed error if someting's wrong, else a requirement version * * @access public */ - public function getRequirement($args) { - $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); - - $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkReqIdentity' - ); - - $status = $this->_runChecks($checkFunctions, $msg_prefix); - - if ($status) { - $context = array(self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName]); - $status = $this->userHasRight( 'mgt_view_req', self::CHECK_PUBLIC_PRIVATE_ATTR, $context ); - } - - if($status) { - $latest = true; - $version = false; - - if ($this->_isParamPresent(self::$requirementVersionIDParamName)) { - if (! $this->checkReqVersionID($msg_prefix)) { - return false; - } else { - $reqVersionID = $this->args[self::$requirementVersionIDParamName]; - $latest = false; - } + public function getRequirement($args) + { + $msg_prefix = "(" . __FUNCTION__ . ") - "; + $this->_setArgs($args); - } elseif ($this->_isParamPresent(self::$versionNumberParamName)) { - if (! $this->checkVersionNumber()) { - return false; - } else { - $reqVersionNumber = $this->args[self::$versionNumberParamName]; - $latest = false; - $version = true; - } + $checkFunctions = array( + 'authenticate', + 'checkTestProjectID', + 'checkReqIdentity' + ); - } + $status = $this->_runChecks($checkFunctions, $msg_prefix); - $reqID = $this->args[self::$requirementIDParamName]; - if ($latest) { - $reqVersionID = requirement_mgr::LATEST_VERSION; + if ($status) { + $context = array( + self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName] + ); + $status = $this->userHasRight('mgt_view_req', + self::CHECK_PUBLIC_PRIVATE_ATTR, $context); } - if ($version) { - $resultInfo = $this->reqMgr->get_by_id($reqID, null, $reqVersionNumber); - } else { - $resultInfo = $this->reqMgr->get_by_id($reqID, $reqVersionID); - } + if ($status) { + $latest = true; + $version = false; + + if ($this->_isParamPresent(self::$requirementVersionIDParamName)) { + if (! $this->checkReqVersionID($msg_prefix)) { + return false; + } else { + $reqVersionID = $this->args[self::$requirementVersionIDParamName]; + $latest = false; + } + } elseif ($this->_isParamPresent(self::$versionNumberParamName)) { + if (! $this->checkVersionNumber()) { + return false; + } else { + $reqVersionNumber = $this->args[self::$versionNumberParamName]; + $latest = false; + $version = true; + } + } + + $reqID = $this->args[self::$requirementIDParamName]; + if ($latest) { + $reqVersionID = requirement_mgr::LATEST_VERSION; + } - } + if ($version) { + $resultInfo = $this->reqMgr->get_by_id($reqID, null, + $reqVersionNumber); + } else { + $resultInfo = $this->reqMgr->get_by_id($reqID, $reqVersionID); + } + } - return $status ? $resultInfo : $this->errors; + return $status ? $resultInfo : $this->errors; } /** @@ -8682,26 +9438,30 @@ public function getRequirement($args) { * * @access public */ - public function getReqCoverage($args) { + public function getReqCoverage($args) + { $msg_prefix = "(" . __FUNCTION__ . ") - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $checkFunctions = array( - 'authenticate', - 'checkTestProjectID', - 'checkReqVersionID' + 'authenticate', + 'checkTestProjectID', + 'checkReqVersionID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); if ($status_ok) { - $context = array(self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName]); - $status_ok = $this->userHasRight( 'mgt_view_req', self::CHECK_PUBLIC_PRIVATE_ATTR, $context ); + $context = array( + self::$testProjectIDParamName => $this->args[self::$testProjectIDParamName] + ); + $status_ok = $this->userHasRight('mgt_view_req', + self::CHECK_PUBLIC_PRIVATE_ATTR, $context); } - if($status_ok) { - $reqVersionID = $this->args[self::$requirementVersionIDParamName]; - $resultInfo = $this->reqMgr->getActiveForReqVersion( $reqVersionID ); + if ($status_ok) { + $reqVersionID = $this->args[self::$requirementVersionIDParamName]; + $resultInfo = $this->reqMgr->getActiveForReqVersion($reqVersionID); } return $status_ok ? $resultInfo : $this->errors; } @@ -8715,61 +9475,66 @@ public function getReqCoverage($args) { * @param int $args["testsuiteid"] * */ - public function setTestCaseTestSuite($args) { + public function setTestCaseTestSuite($args) + { // Check test case identity // Check if user(devkey) has grants to do operation // $ret[] = array( - "operation" => __FUNCTION__, - "status" => true, - "message" => GENERAL_SUCCESS_STR + "operation" => __FUNCTION__, + "status" => true, + "message" => GENERAL_SUCCESS_STR ); $operation = $ret['operation']; $msgPrefix = "({$operation}) - "; - $debug_info = null; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate', - 'checkTestCaseIdentity', - 'checkTestSuiteID' + 'authenticate', + 'checkTestCaseIdentity', + 'checkTestSuiteID' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ); - if($status_ok) { + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix); + if ($status_ok) { // Test Case & Test Suite belongs to same Test Project? - $tcaseTProj = $this->args[self::$testProjectIDParamName] = intval( $this->tcaseMgr->getTestProjectFromTestCase( $this->args[self::$testCaseIDParamName], null ) ); + $tcaseTProj = $this->args[self::$testProjectIDParamName] = intval( + $this->tcaseMgr->getTestProjectFromTestCase( + $this->args[self::$testCaseIDParamName], null)); - $tsuiteMgr = new testsuite( $this->dbObj ); + $tsuiteMgr = new testsuite($this->dbObj); $tsuite_id = $this->args[self::$testSuiteIDParamName]; - $tsuiteTProj = intval( $tsuiteMgr->getTestProjectFromTestSuite( $tsuite_id, null ) ); + $tsuiteTProj = intval( + $tsuiteMgr->getTestProjectFromTestSuite($tsuite_id, null)); - $status_ok =($tcaseTProj == $tsuiteTProj); - if(! $status_ok) { + $status_ok = ($tcaseTProj == $tsuiteTProj); + if (! $status_ok) { $msg = $msgPrefix . TSUITE_NOT_ON_TCASE_TPROJ_STR; - $this->errors[] = new IXR_Error( TSUITE_NOT_ON_TCASE_TPROJ, $msg ); + $this->errors[] = new IXR_Error(TSUITE_NOT_ON_TCASE_TPROJ, $msg); } } - if($status_ok) { + if ($status_ok) { $ctx[self::$testProjectIDParamName] = $tcaseTProj; $ck = self::CHECK_PUBLIC_PRIVATE_ATTR; $r2c = array( - 'mgt_modify_tc' + 'mgt_modify_tc' ); - foreach( $r2c as $right ) { - $status_ok = $this->userHasRight( $right, $ck, $ctx ); - if(! $status_ok) { + foreach ($r2c as $right) { + $status_ok = $this->userHasRight($right, $ck, $ctx); + if (! $status_ok) { break; } } } - if($status_ok) { + if ($status_ok) { - $sql = "/* " . __FUNCTION__ . " */" . " UPDATE " . $this->tables['nodes_hierarchy'] . " SET parent_id=" . $tsuite_id . " WHERE id=" . $this->args['testcaseid']; - $this->dbObj->exec_query( $sql ); + $sql = "/* " . __FUNCTION__ . " */" . " UPDATE " . + $this->tables['nodes_hierarchy'] . " SET parent_id=" . $tsuite_id . + " WHERE id=" . $this->args['testcaseid']; + $this->dbObj->exec_query($sql); } return $status_ok ? $ret : $this->errors; @@ -8819,11 +9584,12 @@ public function setTestCaseTestSuite($args) { * array('id' => -1) * @access public */ - public function getExecutionSet($args) { + public function getExecutionSet($args) + { $operation = __FUNCTION__; $msg_prefix = "({$operation}) - "; - $this->_setArgs( $args ); + $this->_setArgs($args); $resultInfo = array(); $status_ok = true; @@ -8832,71 +9598,79 @@ public function getExecutionSet($args) { // Checks are done in order $checkFunctions = array( - 'authenticate', - 'checkTestPlanID', - 'checkTestCaseIdentity' + 'authenticate', + 'checkTestPlanID', + 'checkTestCaseIdentity' ); - $status_ok = $this->_runChecks( $checkFunctions, $msg_prefix ) && $this->_checkTCIDAndTPIDValid( null, $msg_prefix ) && $this->userHasRight( "mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR ); + $status_ok = $this->_runChecks($checkFunctions, $msg_prefix) && + $this->_checkTCIDAndTPIDValid(null, $msg_prefix) && + $this->userHasRight("mgt_view_tc", self::CHECK_PUBLIC_PRIVATE_ATTR); $tplan_id = $this->args[self::$testPlanIDParamName]; $tcase_id = $this->args[self::$testCaseIDParamName]; $execContext = array( - 'tplan_id' => $tplan_id, - 'platform_id' => null, - 'build_id' => null + 'tplan_id' => $tplan_id, + 'platform_id' => null, + 'build_id' => null ); - if($status_ok) { - if($this->_isParamPresent( self::$optionsParamName, $msg_prefix )) { + if ($status_ok) { + if ($this->_isParamPresent(self::$optionsParamName, $msg_prefix)) { $dummy = $this->args[self::$optionsParamName]; - if(is_array( $dummy )) { - foreach( $dummy as $key => $value ) { - $opt->$key =($value > 0) ? 1 : 0; + if (is_array($dummy)) { + foreach ($dummy as $key => $value) { + $opt->$key = ($value > 0) ? 1 : 0; } } } // Now we can check for Optional parameters - if($this->_isBuildIDPresent() || $this->_isBuildNamePresent()) { - if(($status_ok = $this->checkBuildID( $msg_prefix ))) { - $execContext['build_id'] = $this->args[self::$buildIDParamName]; - } + if ($this->_isBuildIDPresent() || + $this->_isBuildNamePresent() && + $status_ok = $this->checkBuildID($msg_prefix)) { + $execContext['build_id'] = $this->args[self::$buildIDParamName]; } - if($status_ok) { - if($this->_isParamPresent( self::$platformIDParamName, $msg_prefix ) || $this->_isParamPresent( self::$platformNameParamName, $msg_prefix )) { - $status_ok = $this->checkPlatformIdentity( $tplan_id ); - if($status_ok) { - $execContext['platform_id'] = $this->args[self::$platformIDParamName]; - } + if ($status_ok && + $this->_isParamPresent(self::$platformIDParamName, $msg_prefix) || + $this->_isParamPresent(self::$platformNameParamName, $msg_prefix)) { + $status_ok = $this->checkPlatformIdentity($tplan_id); + if ($status_ok) { + $execContext['platform_id'] = $this->args[self::$platformIDParamName]; } } } - if($status_ok) { - $sql = " SELECT * FROM {$this->tables['executions']} WHERE id " . " IN(SELECT id AS exec_id FROM {$this->tables['executions']} " . " WHERE testplan_id = {$tplan_id} " . " AND tcversion_id " . " IN( SELECT id FROM {$this->tables['nodes_hierarchy']} " . " WHERE parent_id = {$tcase_id} )"; + if ($status_ok) { + $sql = " SELECT * FROM {$this->tables['executions']} WHERE id " . + " IN(SELECT id AS exec_id FROM {$this->tables['executions']} " . + " WHERE testplan_id = {$tplan_id} " . + " AND tcversion_id " . + " IN( SELECT id FROM {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id = {$tcase_id} )"; - if(! is_null( $execContext['build_id'] )) { - $sql .= " AND build_id = " . intval( $execContext['build_id'] ); + if (! is_null($execContext['build_id'])) { + $sql .= " AND build_id = " . intval($execContext['build_id']); } - if(! is_null( $execContext['platform_id'] )) { - $sql .= " AND platform_id = " . intval( $execContext['platform_id'] ); + if (! is_null($execContext['platform_id'])) { + $sql .= " AND platform_id = " . + intval($execContext['platform_id']); } // closing bracket for 1st level SELECT $sql .= ")"; $sql .= " ORDER BY id "; - $sql .=($opt->getOrderDescending) ? " DESC" : " ASC"; + $sql .= ($opt->getOrderDescending) ? " DESC" : " ASC"; - $rs = $this->dbObj->fetchRowsIntoMap( $sql, 'id' ); - if(is_null( $rs )) { + $rs = $this->dbObj->fetchRowsIntoMap($sql, 'id'); + if (is_null($rs)) { // has not been executed // execution id = -1 => test case has not been runned. $resultInfo[] = array( - 'id' => - 1 + 'id' => - 1 ); } else { $resultInfo = $rs; @@ -8917,7 +9691,8 @@ public function getExecutionSet($args) { * * @access public */ - public function closeBuild($args) { + public function closeBuild($args) + { $operation = __FUNCTION__; $messagePrefix = "({$operation}) - "; @@ -8928,52 +9703,54 @@ public function closeBuild($args) { $resultInfo[0]["operation"] = $operation; $resultInfo[0]["message"] = GENERAL_SUCCESS_STR; - $this->_setArgs( $args ); + $this->_setArgs($args); $checkFunctions = array( - 'authenticate' + 'authenticate' ); - $status_ok = $this->_runChecks( $checkFunctions, $messagePrefix ); + $status_ok = $this->_runChecks($checkFunctions, $messagePrefix); - if($status_ok) { - $status_ok = $this->_isParamPresent( self::$buildIDParamName, $messagePrefix, self::SET_ERROR ); + if ($status_ok) { + $status_ok = $this->_isParamPresent(self::$buildIDParamName, + $messagePrefix, self::SET_ERROR); } - if($status_ok) { + if ($status_ok) { $buildID = $this->args[self::$buildIDParamName]; - if(!($status_ok = is_int( $buildID ))) { - $msg = sprintf( BUILDID_NOT_INTEGER_STR, $buildID ); - $this->errors[] = new IXR_Error( BUILDID_NOT_INTEGER, $msg ); + if (! ($status_ok = is_int($buildID))) { + $msg = sprintf(BUILDID_NOT_INTEGER_STR, $buildID); + $this->errors[] = new IXR_Error(BUILDID_NOT_INTEGER, $msg); } } - if($status_ok) { + if ($status_ok) { // Get Test Plan ID from Build ID in order to check rights - $bm = new build_mgr( $this->dbObj ); + $bm = new build_mgr($this->dbObj); - $buildID = intval( $this->args[self::$buildIDParamName] ); + $buildID = intval($this->args[self::$buildIDParamName]); $opx = array( - 'output' => 'fields', - 'fields' => 'id,testplan_id' + 'output' => 'fields', + 'fields' => 'id,testplan_id' ); - $buildInfo = $bm->get_by_id( $buildID, $opx ); + $buildInfo = $bm->get_by_id($buildID, $opx); - if($buildInfo == false || count( $buildInfo ) == 0) { + if (! $buildInfo || empty($buildInfo)) { $status_ok = false; - $msg = sprintf( INVALID_BUILDID_STR, $buildID ); - $this->errors[] = new IXR_Error( INVALID_BUILDID, $msg ); + $msg = sprintf(INVALID_BUILDID_STR, $buildID); + $this->errors[] = new IXR_Error(INVALID_BUILDID, $msg); } } - if($status_ok) { + if ($status_ok) { $context = array(); $context[self::$testPlanIDParamName] = $buildInfo['testplan_id']; - $status_ok = $this->userHasRight( "testplan_create_build", self::CHECK_PUBLIC_PRIVATE_ATTR, $context ); + $status_ok = $this->userHasRight("testplan_create_build", + self::CHECK_PUBLIC_PRIVATE_ATTR, $context); } - if($status_ok) { - $bm->setClosed( $buildID ); + if ($status_ok) { + $bm->setClosed($buildID); $resultInfo[0]["id"] = $buildID; } @@ -8988,104 +9765,108 @@ public function closeBuild($args) { * * @access protected */ - protected function _updateStepsResult($execID = null) { + protected function _updateStepsResult($execID = null) + { $tcversion_id = $this->tcVersionID; $tcase_id = $this->args[self::$testCaseIDParamName]; - $stepExecStatus = $this->args[self::$stepsParamName]; - $exec_id = $execID; - if(is_null( $exec_id )) { + if (is_null($exec_id)) { $execContext = array( - 'tplan_id' => $this->args[self::$testPlanIDParamName], - 'platform_id' => $this->args[self::$platformIDParamName], - 'build_id' => $this->args[self::$buildIDParamName] + 'tplan_id' => $this->args[self::$testPlanIDParamName], + 'platform_id' => $this->args[self::$platformIDParamName], + 'build_id' => $this->args[self::$buildIDParamName] ); $opt = array( - 'output' => 'exec_id' + 'output' => 'exec_id' ); $identity = array( - 'id' => $tcase_id, - 'version_id' => $tcversion_id + 'id' => $tcase_id, + 'version_id' => $tcversion_id ); - $exec_id = $this->tcaseMgr->getLatestExecSingleContext( $identity, $execContext, $opt ); + $exec_id = $this->tcaseMgr->getLatestExecSingleContext($identity, + $execContext, $opt); } - if(! is_null( $exec_id )) { - $exec_id = intval( $exec_id ); - $execution_type = constant( "TESTCASE_EXECUTION_TYPE_AUTO" ); + if (! is_null($exec_id)) { + $exec_id = intval($exec_id); $st = &$this->args[self::$stepsParamName]; // needed to get tcstep_id from step number $r2d2 = array( - 'fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', - 'accessKey' => 'step_number', - 'renderGhostSteps' => false, - 'renderImageInline' => false + 'fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', + 'accessKey' => 'step_number', + 'renderGhostSteps' => false, + 'renderImageInline' => false ); - $steps = $this->tcaseMgr->getStepsSimple( $this->tcVersionID, 0, $r2d2 ); + $steps = $this->tcaseMgr->getStepsSimple($this->tcVersionID, 0, + $r2d2); $xx = null; - foreach( $st as $spdata ) { + foreach ($st as $spdata) { $dbField = null; $dbVal = null; - foreach( $spdata as $keyF => $value ) { - switch($keyF) { - case 'result' : - $status = strtolower( trim( $spdata['result'] ) ); + foreach ($spdata as $keyF => $value) { + switch ($keyF) { + case 'result': + $status = strtolower(trim($spdata['result'])); $dbField[] = 'status'; $dbVal[] = "'" . $status[0] . "'"; break; - case 'notes' : + case 'notes': $dbField[] = $keyF; - $dbVal[] = "'" . $this->dbObj->prepare_string( $spdata[$keyF] ) . "'"; + $dbVal[] = "'" . + $this->dbObj->prepare_string($spdata[$keyF]) . + "'"; break; } } $spnum = $spdata['step_number']; - if(! is_null( $dbField ) && isset( $steps[$spnum] )) { + if (! is_null($dbField) && isset($steps[$spnum])) { $target = DB_TABLE_PREFIX . 'execution_tcsteps'; - $where = " WHERE execution_id=" . $exec_id . " AND " . " tcstep_id=" . intval( $steps[$spnum]['id'] ); + $where = " WHERE execution_id=" . $exec_id . " AND " . + " tcstep_id=" . intval($steps[$spnum]['id']); // Manage Insert $sql = "SELECT id FROM $target $where"; - $rs = $this->dbObj->get_recordset( $sql ); + $rs = $this->dbObj->get_recordset($sql); - if(is_null( $rs ) or count( $rs ) != 1) { + if (is_null($rs) || count($rs) != 1) { $sql = " INSERT INTO $target("; $dbField[] = 'tcstep_id'; - $dbVal[] = intval( $steps[$spnum]['id'] ); + $dbVal[] = intval($steps[$spnum]['id']); $dbField[] = 'execution_id'; $dbVal[] = $exec_id; - foreach( $dbField as $idx => $kf ) { - if($idx > 0) { + foreach ($dbField as $idx => $kf) { + if ($idx > 0) { $sql .= ','; } $sql .= $kf; } $sql .= ') VALUES( '; - foreach( $dbVal as $idx => $kv ) { - if($idx > 0) { + foreach ($dbVal as $idx => $kv) { + if ($idx > 0) { $sql .= ','; } $sql .= $kv; } $sql .= ") "; } else { - $sql = " UPDATE " . DB_TABLE_PREFIX . 'execution_tcsteps' . " SET "; - foreach( $dbField as $idx => $kf ) { - if($idx > 0) { + $sql = " UPDATE " . DB_TABLE_PREFIX . 'execution_tcsteps' . + " SET "; + foreach ($dbField as $idx => $kf) { + if ($idx > 0) { $sql .= ','; } $sql .= $kf . '=' . $dbVal[$idx]; @@ -9095,8 +9876,8 @@ protected function _updateStepsResult($execID = null) { try { $xx[] = $sql; - $this->dbObj->exec_query( $sql ); - } catch( Exception $e ) { + $this->dbObj->exec_query($sql); + } catch (Exception $e) { return $e; } } @@ -9107,97 +9888,98 @@ protected function _updateStepsResult($execID = null) { /** */ - function initMethodYellowPages() { + private function initMethodYellowPages() + { $this->methods = array( - 'tl.reportTCResult' => 'this:reportTCResult', - 'tl.setTestCaseExecutionResult' => 'this:reportTCResult', - 'tl.createBuild' => 'this:createBuild', - 'tl.closeBuild' => 'this:closeBuild', - 'tl.createPlatform' => 'this:createPlatform', - 'tl.createTestCase' => 'this:createTestCase', - 'tl.createTestCaseSteps' => 'this:createTestCaseSteps', - 'tl.createTestPlan' => 'this:createTestPlan', - 'tl.createTestProject' => 'this:createTestProject', - 'tl.createTestSuite' => 'this:createTestSuite', - 'tl.deleteTestCaseSteps' => 'this:deleteTestCaseSteps', - 'tl.deleteTestPlan' => 'this:deleteTestPlan', - 'tl.deleteTestProject' => 'this:deleteTestProject', - 'tl.uploadExecutionAttachment' => 'this:uploadExecutionAttachment', - 'tl.uploadRequirementSpecificationAttachment' => 'this:uploadRequirementSpecificationAttachment', - 'tl.uploadRequirementAttachment' => 'this:uploadRequirementAttachment', - 'tl.uploadTestProjectAttachment' => 'this:uploadTestProjectAttachment', - 'tl.uploadTestSuiteAttachment' => 'this:uploadTestSuiteAttachment', - 'tl.uploadTestCaseAttachment' => 'this:uploadTestCaseAttachment', - 'tl.uploadAttachment' => 'this:uploadAttachment', - 'tl.assignRequirements' => 'this:assignRequirements', - 'tl.addTestCaseToTestPlan' => 'this:addTestCaseToTestPlan', - 'tl.addPlatformToTestPlan' => 'this:addPlatformToTestPlan', - 'tl.removePlatformFromTestPlan' => 'this:removePlatformFromTestPlan', - 'tl.getExecCountersByBuild' => 'this:getExecCountersByBuild', - 'tl.getIssueTrackerSystem' => 'this:getIssueTrackerSystem', - 'tl.getProjects' => 'this:getProjects', - 'tl.getProjectKeywords' => 'this:getProjectKeywords', - 'tl.getProjectPlatforms' => 'this:getProjectPlatforms', - 'tl.getProjectTestPlans' => 'this:getProjectTestPlans', - 'tl.getTestCaseAssignedTester' => 'this:getTestCaseAssignedTester', - 'tl.getTestCaseBugs' => 'this:getTestCaseBugs', - 'tl.getTestCaseKeywords' => 'this:getTestCaseKeywords', - 'tl.getTestCaseRequirements' => 'this:getTestCaseRequirements', - 'tl.getTestProjectByName' => 'this:getTestProjectByName', - 'tl.getTestPlanByName' => 'this:getTestPlanByName', - 'tl.getTestPlanPlatforms' => 'this:getTestPlanPlatforms', - 'tl.getTotalsForTestPlan' => 'this:getTotalsForTestPlan', - 'tl.getBuildsForTestPlan' => 'this:getBuildsForTestPlan', - 'tl.getLatestBuildForTestPlan' => 'this:getLatestBuildForTestPlan', - 'tl.getLastExecutionResult' => 'this:getLastExecutionResult', - 'tl.getTestSuitesForTestPlan' => 'this:getTestSuitesForTestPlan', - 'tl.getTestSuitesForTestSuite' => 'this:getTestSuitesForTestSuite', - 'tl.getTestCasesForTestSuite' => 'this:getTestCasesForTestSuite', - 'tl.getTestCasesForTestPlan' => 'this:getTestCasesForTestPlan', - 'tl.getTestCaseIDByName' => 'this:getTestCaseIDByName', - 'tl.getTestCaseCustomFieldDesignValue' => 'this:getTestCaseCustomFieldDesignValue', - 'tl.getTestCaseCustomFieldExecutionValue' => 'this:getTestCaseCustomFieldExecutionValue', - 'tl.getTestCaseCustomFieldTestPlanDesignValue' => 'this:getTestCaseCustomFieldTestPlanDesignValue', - 'tl.getTestSuiteCustomFieldDesignValue' => 'this:getTestSuiteCustomFieldDesignValue', - 'tl.getTestPlanCustomFieldDesignValue' => 'this:getTestPlanCustomFieldDesignValue', - 'tl.getReqSpecCustomFieldDesignValue' => 'this:getReqSpecCustomFieldDesignValue', - 'tl.getRequirementCustomFieldDesignValue' => 'this:getRequirementCustomFieldDesignValue', - 'tl.getFirstLevelTestSuitesForTestProject' => 'this:getFirstLevelTestSuitesForTestProject', - 'tl.getTestCaseAttachments' => 'this:getTestCaseAttachments', - 'tl.getTestSuiteAttachments' => 'this:getTestSuiteAttachments', - 'tl.getTestCase' => 'this:getTestCase', - 'tl.getFullPath' => 'this:getFullPath', - 'tl.getTestSuiteByID' => 'this:getTestSuiteByID', - 'tl.getUserByLogin' => 'this:getUserByLogin', - 'tl.getUserByID' => 'this:getUserByID', - 'tl.deleteExecution' => 'this:deleteExecution', - 'tl.doesUserExist' => 'this:doesUserExist', - 'tl.createUser' => 'this:createUser', - 'tl.setUserRoleOnProject' => 'this:setUserRoleOnProject', - 'tl.updateTestCaseCustomFieldDesignValue' => 'this:updateTestCaseCustomFieldDesignValue', - 'tl.updateTestCase' => 'this:updateTestCase', - 'tl.setTestCaseExecutionType' => 'this:setTestCaseExecutionType', - 'tl.assignTestCaseExecutionTask' => 'this:assignTestCaseExecutionTask', - 'tl.unassignTestCaseExecutionTask' => 'this:unassignTestCaseExecutionTask', - 'tl.addTestCaseKeywords' => 'this:addTestCaseKeywords', - 'tl.removeTestCaseKeywords' => 'this:removeTestCaseKeywords', - 'tl.updateTestSuiteCustomFieldDesignValue' => 'this:updateTestSuiteCustomFieldDesignValue', - 'tl.updateBuildCustomFieldsValues' => 'this:updateBuildCustomFieldsValues', - 'tl.getTestSuite' => 'this:getTestSuite', - 'tl.updateTestSuite' => 'this:updateTestSuite', - 'tl.getRequirements' => 'this:getRequirements', - 'tl.getRequirement' => 'this:getRequirement', - 'tl.getReqCoverage' => 'this:getReqCoverage', - 'tl.setTestCaseTestSuite' => 'this:setTestCaseTestSuite', - 'tl.getExecutionSet' => 'this:getExecutionSet', - 'tl.checkDevKey' => 'this:checkDevKey', - 'tl.about' => 'this:about', - 'tl.testLinkVersion' => 'this:testLinkVersion', - 'tl.setTestMode' => 'this:setTestMode', - 'tl.ping' => 'this:sayHello', - 'tl.sayHello' => 'this:sayHello', - 'tl.repeat' => 'this:repeat', - 'tl.getAllExecutionsResults' => 'this:getAllExecutionsResults' + 'tl.reportTCResult' => 'this:reportTCResult', + 'tl.setTestCaseExecutionResult' => 'this:reportTCResult', + 'tl.createBuild' => 'this:createBuild', + 'tl.closeBuild' => 'this:closeBuild', + 'tl.createPlatform' => 'this:createPlatform', + 'tl.createTestCase' => 'this:createTestCase', + 'tl.createTestCaseSteps' => 'this:createTestCaseSteps', + 'tl.createTestPlan' => 'this:createTestPlan', + 'tl.createTestProject' => 'this:createTestProject', + 'tl.createTestSuite' => 'this:createTestSuite', + 'tl.deleteTestCaseSteps' => 'this:deleteTestCaseSteps', + 'tl.deleteTestPlan' => 'this:deleteTestPlan', + 'tl.deleteTestProject' => 'this:deleteTestProject', + 'tl.uploadExecutionAttachment' => 'this:uploadExecutionAttachment', + 'tl.uploadRequirementSpecificationAttachment' => 'this:uploadRequirementSpecificationAttachment', + 'tl.uploadRequirementAttachment' => 'this:uploadRequirementAttachment', + 'tl.uploadTestProjectAttachment' => 'this:uploadTestProjectAttachment', + 'tl.uploadTestSuiteAttachment' => 'this:uploadTestSuiteAttachment', + 'tl.uploadTestCaseAttachment' => 'this:uploadTestCaseAttachment', + 'tl.uploadAttachment' => 'this:uploadAttachment', + 'tl.assignRequirements' => 'this:assignRequirements', + 'tl.addTestCaseToTestPlan' => 'this:addTestCaseToTestPlan', + 'tl.addPlatformToTestPlan' => 'this:addPlatformToTestPlan', + 'tl.removePlatformFromTestPlan' => 'this:removePlatformFromTestPlan', + 'tl.getExecCountersByBuild' => 'this:getExecCountersByBuild', + 'tl.getIssueTrackerSystem' => 'this:getIssueTrackerSystem', + 'tl.getProjects' => 'this:getProjects', + 'tl.getProjectKeywords' => 'this:getProjectKeywords', + 'tl.getProjectPlatforms' => 'this:getProjectPlatforms', + 'tl.getProjectTestPlans' => 'this:getProjectTestPlans', + 'tl.getTestCaseAssignedTester' => 'this:getTestCaseAssignedTester', + 'tl.getTestCaseBugs' => 'this:getTestCaseBugs', + 'tl.getTestCaseKeywords' => 'this:getTestCaseKeywords', + 'tl.getTestCaseRequirements' => 'this:getTestCaseRequirements', + 'tl.getTestProjectByName' => 'this:getTestProjectByName', + 'tl.getTestPlanByName' => 'this:getTestPlanByName', + 'tl.getTestPlanPlatforms' => 'this:getTestPlanPlatforms', + 'tl.getTotalsForTestPlan' => 'this:getTotalsForTestPlan', + 'tl.getBuildsForTestPlan' => 'this:getBuildsForTestPlan', + 'tl.getLatestBuildForTestPlan' => 'this:getLatestBuildForTestPlan', + 'tl.getLastExecutionResult' => 'this:getLastExecutionResult', + 'tl.getTestSuitesForTestPlan' => 'this:getTestSuitesForTestPlan', + 'tl.getTestSuitesForTestSuite' => 'this:getTestSuitesForTestSuite', + 'tl.getTestCasesForTestSuite' => 'this:getTestCasesForTestSuite', + 'tl.getTestCasesForTestPlan' => 'this:getTestCasesForTestPlan', + 'tl.getTestCaseIDByName' => 'this:getTestCaseIDByName', + 'tl.getTestCaseCustomFieldDesignValue' => 'this:getTestCaseCustomFieldDesignValue', + 'tl.getTestCaseCustomFieldExecutionValue' => 'this:getTestCaseCustomFieldExecutionValue', + 'tl.getTestCaseCustomFieldTestPlanDesignValue' => 'this:getTestCaseCustomFieldTestPlanDesignValue', + 'tl.getTestSuiteCustomFieldDesignValue' => 'this:getTestSuiteCustomFieldDesignValue', + 'tl.getTestPlanCustomFieldDesignValue' => 'this:getTestPlanCustomFieldDesignValue', + 'tl.getReqSpecCustomFieldDesignValue' => 'this:getReqSpecCustomFieldDesignValue', + 'tl.getRequirementCustomFieldDesignValue' => 'this:getRequirementCustomFieldDesignValue', + 'tl.getFirstLevelTestSuitesForTestProject' => 'this:getFirstLevelTestSuitesForTestProject', + 'tl.getTestCaseAttachments' => 'this:getTestCaseAttachments', + 'tl.getTestSuiteAttachments' => 'this:getTestSuiteAttachments', + 'tl.getTestCase' => 'this:getTestCase', + 'tl.getFullPath' => 'this:getFullPath', + 'tl.getTestSuiteByID' => 'this:getTestSuiteByID', + 'tl.getUserByLogin' => 'this:getUserByLogin', + 'tl.getUserByID' => 'this:getUserByID', + 'tl.deleteExecution' => 'this:deleteExecution', + 'tl.doesUserExist' => 'this:doesUserExist', + 'tl.createUser' => 'this:createUser', + 'tl.setUserRoleOnProject' => 'this:setUserRoleOnProject', + 'tl.updateTestCaseCustomFieldDesignValue' => 'this:updateTestCaseCustomFieldDesignValue', + 'tl.updateTestCase' => 'this:updateTestCase', + 'tl.setTestCaseExecutionType' => 'this:setTestCaseExecutionType', + 'tl.assignTestCaseExecutionTask' => 'this:assignTestCaseExecutionTask', + 'tl.unassignTestCaseExecutionTask' => 'this:unassignTestCaseExecutionTask', + 'tl.addTestCaseKeywords' => 'this:addTestCaseKeywords', + 'tl.removeTestCaseKeywords' => 'this:removeTestCaseKeywords', + 'tl.updateTestSuiteCustomFieldDesignValue' => 'this:updateTestSuiteCustomFieldDesignValue', + 'tl.updateBuildCustomFieldsValues' => 'this:updateBuildCustomFieldsValues', + 'tl.getTestSuite' => 'this:getTestSuite', + 'tl.updateTestSuite' => 'this:updateTestSuite', + 'tl.getRequirements' => 'this:getRequirements', + 'tl.getRequirement' => 'this:getRequirement', + 'tl.getReqCoverage' => 'this:getReqCoverage', + 'tl.setTestCaseTestSuite' => 'this:setTestCaseTestSuite', + 'tl.getExecutionSet' => 'this:getExecutionSet', + 'tl.checkDevKey' => 'this:checkDevKey', + 'tl.about' => 'this:about', + 'tl.testLinkVersion' => 'this:testLinkVersion', + 'tl.setTestMode' => 'this:setTestMode', + 'tl.ping' => 'this:sayHello', + 'tl.sayHello' => 'this:sayHello', + 'tl.repeat' => 'this:repeat', + 'tl.getAllExecutionsResults' => 'this:getAllExecutionsResults' ); } -} // class end +} diff --git a/lib/api/xmlrpc/v1/xmlrpc.php b/lib/api/xmlrpc/v1/xmlrpc.php index 5fd5b2a011..7fef92f62a 100644 --- a/lib/api/xmlrpc/v1/xmlrpc.php +++ b/lib/api/xmlrpc/v1/xmlrpc.php @@ -1,17 +1,16 @@ -id) -{ - $attachmentRepository = tlAttachmentRepository::create($db); - $attachmentInfo = $attachmentRepository->getAttachmentInfo($args->id); - if ($attachmentInfo && checkAttachmentID($db,$args->id,$attachmentInfo)) - { - $deleteDone = $attachmentRepository->deleteAttachment($args->id,$attachmentInfo); - if ($deleteDone) - { - logAuditEvent(TLS("audit_attachment_deleted", - $attachmentInfo['title']),"DELETE",$args->id,"attachments"); - } - } -} - -$smarty = new TLSmarty(); -$smarty->assign('bDeleted',$deleteDone); -$smarty->display('attachmentdelete.tpl'); - - -/** - * @return object returns the arguments for the page - */ -function init_args() -{ - //the id (attachments.id) of the attachment to be deleted - $iParams = array( - "id" => array(tlInputParameter::INT_N), - ); - $args = new stdClass(); - G_PARAMS($iParams,$args); - - return $args; -} - - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return (config_get("attachments")->enabled); -} -?> \ No newline at end of file +id) { + $attachmentRepository = tlAttachmentRepository::create($db); + $attachmentInfo = $attachmentRepository->getAttachmentInfo($args->id); + if ($attachmentInfo && checkAttachmentID($db, $args->id, $attachmentInfo)) { + $deleteDone = $attachmentRepository->deleteAttachment($args->id, + $attachmentInfo); + if ($deleteDone) { + logAuditEvent( + TLS("audit_attachment_deleted", $attachmentInfo['title']), + "DELETE", $args->id, "attachments"); + } + } +} + +$smarty = new TLSmarty(); +$smarty->assign('bDeleted', $deleteDone); +$smarty->display('attachmentdelete.tpl'); + +/** + * + * @return object returns the arguments for the page + */ +function initArgs() +{ + // the id (attachments.id) of the attachment to be deleted + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ) + ); + $args = new stdClass(); + G_PARAMS($iParams, $args); + + return $args; +} + +/** + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return config_get("attachments")->enabled; +} +?> diff --git a/lib/attachments/attachmentdownload.php b/lib/attachments/attachmentdownload.php index a6aed0501d..7b54f6bda3 100644 --- a/lib/attachments/attachmentdownload.php +++ b/lib/attachments/attachmentdownload.php @@ -1,176 +1,186 @@ -id) { - $fileRepo = tlAttachmentRepository::create($db); - $attachInfo = $fileRepo->getAttachmentInfo($args->id); - - if ($attachInfo) { - switch ($args->opmode) { - case 'API': - // want to check if apikey provided is right - // for attachment context - // - test project api key: - // is needed to get attachments for: - // test specifications - // - // - test plan api key: - // is needed to get attacments for: - // test case executions - // test specifications ( access to parent data - OK!) - // - // What kind of attachments I've got ? - $doIt = false; - $attContext = $attachInfo['fk_table']; - switch ($attContext) { - case 'executions': - // check apikey - // 1. has to be a test plan key - // 2. execution must belong to the test plan. - $item = getEntityByAPIKey($db,$args->apikey,'testplan'); - if (!is_null($item)) { - $tables = tlObjectWithDB::getDBTables(array('executions')); - $sql = "SELECT testplan_id FROM {$tables['executions']} " . - "WHERE id = " . intval($attachInfo['fk_id']); - - $rs = $db->get_recordset($sql); - if (!is_null($rs)) { - if($rs['0']['testplan_id'] == $item['id']) { - // GOOD ! - $doIt = true; - } - } - } - break; - } - break; - - case 'GUI': - default: - $doIt = true; - break; - } - - - if ($doIt) { - $content = ''; - $getContent = true; - if( $args->opmode !== 'API' && $args->skipCheck !== 0 - && $args->skipCheck !== false) { - if( $args->skipCheck != hash('sha256',$attachInfo['file_name']) ) { - $getContent = false; - } - } - - if ($getContent) { - $content = $fileRepo->getAttachmentContent($args->id, - $attachInfo); - } - - if ($content != "") { - - // try to fight XSS in SVG - global $g_repositoryType; - $doEncode = ($g_repositoryType == TL_REPOSITORY_TYPE_DB); - if ($doEncode) { - $content = base64_decode($content); - } - - $what2do = "Content-Disposition: inline;"; - // is SVG? - if (strripos($content, "id) { + $fileRepo = tlAttachmentRepository::create($db); + $attachInfo = $fileRepo->getAttachmentInfo($args->id); + + if ($attachInfo) { + switch ($args->opmode) { + case 'API': + // want to check if apikey provided is right + // for attachment context + // - test project api key: + // is needed to get attachments for: + // test specifications + // + // - test plan api key: + // is needed to get attacments for: + // test case executions + // test specifications ( access to parent data - OK!) + // + // What kind of attachments I've got ? + $doIt = false; + $attContext = $attachInfo['fk_table']; + switch ($attContext) { + case 'executions': + // check apikey + // 1. has to be a test plan key + // 2. execution must belong to the test plan. + $item = getEntityByAPIKey($db, $args->apikey, 'testplan'); + if (! is_null($item)) { + $tables = tlObjectWithDB::getDBTables( + array( + 'executions' + )); + $sql = "SELECT testplan_id FROM {$tables['executions']} " . + "WHERE id = " . intval($attachInfo['fk_id']); + + $rs = $db->get_recordset($sql); + if (! is_null($rs) && + $rs['0']['testplan_id'] == $item['id']) { + $doIt = true; + } + } + break; + } + break; + + case 'GUI': + default: + $doIt = true; + break; + } + + if ($doIt) { + $content = ''; + $getContent = true; + if ($args->opmode !== 'API' && $args->skipCheck !== 0 && + $args->skipCheck !== false && + $args->skipCheck != hash('sha256', $attachInfo['file_name'])) { + $getContent = false; + } + + if ($getContent) { + $content = $fileRepo->getAttachmentContent($args->id, + $attachInfo); + } + + if ($content != "") { + + // try to fight XSS in SVG + global $g_repositoryType; + $doEncode = ($g_repositoryType == TL_REPOSITORY_TYPE_DB); + if ($doEncode) { + $content = base64_decode($content); + } + + $what2do = "Content-Disposition: inline;"; + // is SVG? + if (strripos($content, "assign('gui', $args); +$smarty->display('attachment404.tpl'); + +/** + * + * @return object returns the arguments for the page + */ +function initArgs(&$dbHandler) +{ + // id (attachments.id) of the attachment to be downloaded + $iParams = array( + 'id' => array( + tlInputParameter::INT_N + ), + 'apikey' => array( + tlInputParameter::STRING_N, + 64 + ), + 'skipCheck' => array( + tlInputParameter::STRING_N, + 1, + 64 + ) + ); + + $args = new stdClass(); + G_PARAMS($iParams, $args); + + $args->light = 'green'; + $args->opmode = 'GUI'; + if (is_null($args->skipCheck) || $args->skipCheck === 0) { + $args->skipCheck = false; + } + + // var_dump($args->skipCheck);die(); + // using apikey lenght to understand apikey type + // 32 => user api key + // other => test project or test plan + $args->apikey = trim($args->apikey); + $apikeyLenght = strlen($args->apikey); + if ($apikeyLenght > 0) { + $args->opmode = 'API'; + $args->skipCheck = true; + } + return $args; +} + +/** + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return config_get("attachments")->enabled; } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$args); -$smarty->display('attachment404.tpl'); - -/** - * @return object returns the arguments for the page - */ -function init_args(&$dbHandler) -{ - // id (attachments.id) of the attachment to be downloaded - $iParams = array('id' => array(tlInputParameter::INT_N), - 'apikey' => array(tlInputParameter::STRING_N,64), - 'skipCheck' => array(tlInputParameter::STRING_N,1,64)); - - $args = new stdClass(); - G_PARAMS($iParams,$args); - - $args->light = 'green'; - $args->opmode = 'GUI'; - if( is_null($args->skipCheck) || $args->skipCheck === 0 ) - { - $args->skipCheck = false; - } - - // var_dump($args->skipCheck);die(); - // using apikey lenght to understand apikey type - // 32 => user api key - // other => test project or test plan - $args->apikey = trim($args->apikey); - $apikeyLenght = strlen($args->apikey); - if($apikeyLenght > 0) - { - $args->opmode = 'API'; - $args->skipCheck = true; - } - return $args; -} - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return (config_get("attachments")->enabled); -} \ No newline at end of file diff --git a/lib/attachments/attachmentupload.php b/lib/attachments/attachmentupload.php index 7a1bf467c8..21bf6a76cf 100644 --- a/lib/attachments/attachmentupload.php +++ b/lib/attachments/attachmentupload.php @@ -1,104 +1,118 @@ -uploaded = false; -$gui->msg = null; -$gui->tableName = $args->tableName; -$gui->import_limit = TL_REPOSITORY_MAXFILESIZE; -$gui->id = $args->id; - -if ($args->bPostBack) { - $fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; - $id = $_SESSION['s_upload_id']; - $gui->tableName = $_SESSION['s_upload_tableName']; - - if ($fInfo && $id && $gui->tableName != "") { - $opt = null; - if (trim($gui->tableName) == 'executions') { - $opt['allow_empty_title'] = true; - } - - $l2d = count($fInfo); - for($fdx=0; $fdx <= $l2d; $fdx++) { - $fSize = isset($fInfo['size'][$fdx]) ? $fInfo['size'][$fdx] : 0; - $fTmpName = isset($fInfo['tmp_name'][$fdx]) ? - $fInfo['tmp_name'][$fdx] : ''; - - $fin = array(); - $fin['size'] = $fSize; - $fin['tmp_name'] = $fTmpName; - $fin['type'] = $fInfo['type'][$fdx]; - $fin['name'] = $fInfo['name'][$fdx]; - $fin['error'] = $fInfo['error'][$fdx]; - - if ($fSize && $fTmpName != "") { - $docRepo = tlAttachmentRepository::create($db); - - $uploadOP = $docRepo->insertAttachment($id,$gui->tableName,$args->title,$fin,$opt); - $gui->uploaded = $uploadOP->statusOK; - if ($gui->uploaded) { - logAuditEvent(TLS("audit_attachment_created", - $args->title,$fin['name']), - "CREATE",$id,"attachments"); - } - } else { - $gui->msg = getFileUploadErrorMessage($fin,$uploadOP); - } - } - } +uploaded = false; +$gui->msg = null; +$gui->tableName = $args->tableName; +$gui->import_limit = TL_REPOSITORY_MAXFILESIZE; +$gui->id = $args->id; + +if ($args->bPostBack) { + $fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; + $id = $_SESSION['s_upload_id']; + $gui->tableName = $_SESSION['s_upload_tableName']; + + if ($fInfo && $id && $gui->tableName != "") { + $opt = null; + if (trim($gui->tableName) == 'executions') { + $opt['allow_empty_title'] = true; + } + + $l2d = count($fInfo); + for ($fdx = 0; $fdx <= $l2d; $fdx ++) { + $fSize = isset($fInfo['size'][$fdx]) ? $fInfo['size'][$fdx] : 0; + $fTmpName = isset($fInfo['tmp_name'][$fdx]) ? $fInfo['tmp_name'][$fdx] : ''; + + $fin = array(); + $fin['size'] = $fSize; + $fin['tmp_name'] = $fTmpName; + $fin['type'] = $fInfo['type'][$fdx]; + $fin['name'] = $fInfo['name'][$fdx]; + $fin['error'] = $fInfo['error'][$fdx]; + + if ($fSize && $fTmpName != "") { + $docRepo = tlAttachmentRepository::create($db); + + $uploadOP = $docRepo->insertAttachment($id, $gui->tableName, + $args->title, $fin, $opt); + $gui->uploaded = $uploadOP->statusOK; + if ($gui->uploaded) { + logAuditEvent( + TLS("audit_attachment_created", $args->title, + $fin['name']), "CREATE", $id, "attachments"); + } + } else { + $gui->msg = getFileUploadErrorMessage($fin, $uploadOP); + } + } + } +} else { + $_SESSION['s_upload_tableName'] = $args->tableName; + $_SESSION['s_upload_id'] = $args->id; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display('attachmentupload.tpl'); + +/** + * + * @return object returns the arguments for the page + */ +function initArgs() +{ + $iParams = array( + // the id (attachments.fk_id) of the object, to which the attachment belongs to + "id" => array( + "GET", + tlInputParameter::INT_N + ), + // the table to which the fk_id refers to (attachments.fk_table) of the attachment + "tableName" => array( + "GET", + tlInputParameter::STRING_N, + 0, + 250 + ), + // the title of the attachment (attachments.title) + "title" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 250 + ) + ); + $args = new stdClass(); + I_PARAMS($iParams, $args); + + $args->bPostBack = count($_POST); + + return $args; +} + +/** + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return config_get("attachments")->enabled; } -else -{ - $_SESSION['s_upload_tableName'] = $args->tableName; - $_SESSION['s_upload_id'] = $args->id; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display('attachmentupload.tpl'); - -/** - * @return object returns the arguments for the page - */ -function init_args() -{ - $iParams = array( - //the id (attachments.fk_id) of the object, to which the attachment belongs to - "id" => array("GET",tlInputParameter::INT_N), - //the table to which the fk_id refers to (attachments.fk_table) of the attachment - "tableName" => array("GET",tlInputParameter::STRING_N,0,250), - //the title of the attachment (attachments.title) - "title" => array("POST",tlInputParameter::STRING_N,0,250), - ); - $args = new stdClass(); - I_PARAMS($iParams,$args); - - $args->bPostBack = sizeof($_POST); - - return $args; -} - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return (config_get("attachments")->enabled); -} \ No newline at end of file diff --git a/lib/cfields/cfieldsEdit.php b/lib/cfields/cfieldsEdit.php index 033f3c6cb5..068de570d6 100644 --- a/lib/cfields/cfieldsEdit.php +++ b/lib/cfields/cfieldsEdit.php @@ -1,493 +1,482 @@ -cfieldCfg; -$gui->cfield = $cfMix->emptyCF; - -switch ($args->do_action) { - case 'create': - $templateCfg->template=$templateCfg->default_template; - $user_feedback =''; - $operation_descr = ''; - break; - - case 'edit': - $op = edit($args,$cfield_mgr); - $gui->cfield = $op->cf; - $gui->cfield_is_used = $op->cf_is_used; - $gui->cfield_is_linked = $op->cf_is_linked; - $gui->linked_tprojects = $op->linked_tprojects; - $user_feedback = $op->user_feedback; - $operation_descr=$op->operation_descr; - break; - - case 'do_add': - case 'do_add_and_assign': - $op = doCreate($_REQUEST,$cfield_mgr,$args); - $gui->cfield = $op->cf; - $user_feedback = $op->user_feedback; - $templateCfg->template = $op->template; - $operation_descr = ''; - break; - - case 'do_update': - $op = doUpdate($_REQUEST,$args,$cfield_mgr); - $gui->cfield = $op->cf; - $user_feedback = $op->user_feedback; - $operation_descr=$op->operation_descr; - $templateCfg->template = $op->template; - break; - - case 'do_delete': - $op = doDelete($args,$cfield_mgr); - $user_feedback = $op->user_feedback; - $operation_descr=$op->operation_descr; - $templateCfg->template = $op->template; - $do_control_combo_display = 0; - break; +cfieldCfg; +$gui->cfield = $cfMix->emptyCF; + +switch ($args->do_action) { + case 'create': + $templateCfg->template = $templateCfg->default_template; + $user_feedback = ''; + $operation_descr = ''; + break; + + case 'edit': + $op = edit($args, $cfield_mgr); + $gui->cfield = $op->cf; + $gui->cfield_is_used = $op->cf_is_used; + $gui->cfield_is_linked = $op->cf_is_linked; + $gui->linked_tprojects = $op->linked_tprojects; + $user_feedback = $op->user_feedback; + $operation_descr = $op->operation_descr; + break; + + case 'do_add': + case 'do_add_and_assign': + $op = doCreate($_REQUEST, $cfield_mgr, $args); + $gui->cfield = $op->cf; + $user_feedback = $op->user_feedback; + $templateCfg->template = $op->template; + $operation_descr = ''; + break; + + case 'do_update': + $op = doUpdate($_REQUEST, $args, $cfield_mgr); + $gui->cfield = $op->cf; + $user_feedback = $op->user_feedback; + $operation_descr = $op->operation_descr; + $templateCfg->template = $op->template; + break; + + case 'do_delete': + $op = doDelete($args, $cfield_mgr); + $user_feedback = $op->user_feedback; + $operation_descr = $op->operation_descr; + $templateCfg->template = $op->template; + $do_control_combo_display = 0; + break; +} + +if ($do_control_combo_display) { + $keys2loop = $cfield_mgr->get_application_areas(); + foreach ($keys2loop as $ui_mode) { + $cfieldCfg->cf_enable_on[$ui_mode]['value'] = 0; + $cfieldCfg->cf_show_on[$ui_mode]['disabled'] = ''; + $cfieldCfg->cf_show_on[$ui_mode]['style'] = ''; + + if ($cfieldCfg->enable_on_cfg[$ui_mode][$gui->cfield['node_type_id']]) { + $cfieldCfg->cf_enable_on[$ui_mode]['value'] = 1; + } + + if (! $cfieldCfg->show_on_cfg[$ui_mode][$gui->cfield['node_type_id']]) { + $cfieldCfg->cf_show_on[$ui_mode]['disabled'] = ' disabled="disabled" '; + $cfieldCfg->cf_show_on[$ui_mode]['style'] = ' style="display:none;" '; + } + } +} + +$gui->show_possible_values = 0; +if (isset($gui->cfield['type'])) { + $gui->show_possible_values = $cfieldCfg->possible_values_cfg[$gui->cfield['type']]; +} + +// enable on 'execution' implies show on 'execution' then has nosense to display show_on combo +if ($args->do_action == 'edit' && $gui->cfield['enable_on_execution']) { + $cfieldCfg->cf_show_on['execution']['style'] = ' style="display:none;" '; +} + +$gui->cfieldCfg = $cfieldCfg; + +$smarty = new TLSmarty(); +$smarty->assign('operation_descr', $operation_descr); +$smarty->assign('user_feedback', $user_feedback); +$smarty->assign('user_action', $args->do_action); +renderGui($smarty, $args, $gui, $cfield_mgr, $templateCfg); + +/** + * + * @param stdClass $args + * @param cfield_mgr $cfield_mgr + * @return stdClass + */ +function getCFCfg(&$args, &$cfield_mgr) +{ + $cfg = new stdClass(); + + $cfg->cfieldCfg = cfieldCfgInit($cfield_mgr); + + $cfg->emptyCF = array( + 'id' => $args->cfield_id, + 'name' => '', + 'label' => '', + 'type' => 0, + 'possible_values' => '', + 'show_on_design' => 1, + 'enable_on_design' => 1, + 'show_on_execution' => 0, + 'enable_on_execution' => 0, + 'show_on_testplan_design' => 0, + 'enable_on_testplan_design' => 0 + ); + + $cfg->emptyCF['node_type_id'] = $cfg->cfieldCfg->allowed_nodes['testcase']; + + return $cfg; +} + +/** + * + * @param cfield_mgr $cfield_mgr + * @return stdClass + */ +function initializeGui(&$cfield_mgr) +{ + return $cfield_mgr->initViewGUI(); +} + +/** + * scan a hash looking for a keys with 'cf_' prefix, + * because this keys represents fields of Custom Fields + * tables. + * Is used to get values filled by user on a HTML form. + * This requirement dictated how html inputs must be named. + * If notation is not followed logic will fail. + * + * @param array $hash + * @return array only with related to custom fields, where + * (keys,values) are the original with 'cf_' prefix, but + * in this new hash prefix on key is removed. + * + * rev: + * 20090524 - franciscom - changes due to User Interface changes + * 20080811 - franciscom - added new values on missing_keys + */ +function request2cf($hash) +{ + // design and execution has sense for node types regarding testing + // testplan,testsuite,testcase, but no sense for requirements. + // + // Missing keys are combos that will be disabled and not show at UI. + // For req spec and req, no combo is showed. + // To avoid problems (need to be checked), my choice is set to 1 + // *_on_design keys, that right now will not present only for + // req spec and requirements. + // + $missing_keys = array( + 'show_on_design' => 0, + 'enable_on_design' => 0, + 'show_on_execution' => 0, + 'enable_on_execution' => 0, + 'show_on_testplan_design' => 0, + 'enable_on_testplan_design' => 0, + 'possible_values' => ' ' + ); + + $cf_prefix = 'cf_'; + $len_cfp = tlStringLen($cf_prefix); + $start_pos = $len_cfp; + $cf = array(); + foreach ($hash as $key => $value) { + if (strncmp($key, $cf_prefix, $len_cfp) == 0) { + $dummy = substr($key, $start_pos); + $cf[$dummy] = $value; + } + } + + foreach ($missing_keys as $key => $value) { + if (! isset($cf[$key])) { + $cf[$key] = $value; + } + } + + // After logic refactoring + // if ENABLE_ON_[area] == 1 + // DISPLAY_ON_[area] = 1 + // + // + // IMPORTANT/CRITIC: + // this KEY MUST BE ALIGNED WITH name on User Inteface + // then if is changed on UI must be changed HERE + $setter = array( + 'design' => 0, + 'execution' => 0, + 'testplan_design' => 0 + ); + switch ($cf['enable_on']) { + case 'design': + case 'execution': + case 'testplan_design': + $setter[$cf['enable_on']] = 1; + break; + + default: + $setter['design'] = 1; + break; + } + + foreach ($setter as $key => $value) { + $cf['enable_on_' . $key] = $value; + if ($cf['enable_on_' . $key]) { + $cf['show_on_' . $key] = 1; + } + } + return $cf; +} + +/** + * + * @return stdClass + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $args->do_action = isset($_REQUEST['do_action']) ? $_REQUEST['do_action'] : null; + $args->cfield_id = isset($_REQUEST['cfield_id']) ? intval( + $_REQUEST['cfield_id']) : 0; + $args->cf_name = isset($_REQUEST['cf_name']) ? $_REQUEST['cf_name'] : null; + + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + return $args; +} + +/** + * + * @param stdClass $argsObj + * @param cfield_mgr $cfieldMgr + * @return stdClass + */ +function edit(&$argsObj, &$cfieldMgr) +{ + $op = new stdClass(); + $op->cf = null; + $op->cf_is_used = 0; + $op->cf_is_linked = 0; + + $op->user_feedback = ''; + $op->template = null; + $op->operation_descr = ''; + $op->linked_tprojects = null; + + $cfinfo = $cfieldMgr->get_by_id($argsObj->cfield_id); + + if ($cfinfo) { + $op->cf = $cfinfo[$argsObj->cfield_id]; + $op->cf_is_used = $cfieldMgr->is_used($argsObj->cfield_id); + + $op->operation_descr = lang_get('title_cfield_edit') . TITLE_SEP_TYPE3 . + $op->cf['name']; + $op->linked_tprojects = $cfieldMgr->get_linked_testprojects( + $argsObj->cfield_id); + $op->cf_is_linked = ! is_null($op->linked_tprojects) && + count($op->linked_tprojects) > 0; + } + return $op; +} + +/** + * + * @param array $hash_request + * @param cfield_mgr $cfieldMgr + * @param stdClass $argsObj + * @return stdClass + */ +function doCreate(&$hash_request, &$cfieldMgr, &$argsObj) +{ + $op = new stdClass(); + $op->template = "cfieldsEdit.tpl"; + $op->user_feedback = ''; + $op->cf = request2cf($hash_request); + + $keys2trim = array( + 'name', + 'label', + 'possible_values' + ); + foreach ($keys2trim as $key) { + $op->cf[$key] = trim($op->cf[$key]); + } + + // Check if name exists + $dupcf = $cfieldMgr->get_by_name($op->cf['name']); + if (is_null($dupcf)) { + $ret = $cfieldMgr->create($op->cf); + if (! $ret['status_ok']) { + $op->user_feedback = lang_get("error_creating_cf"); + } else { + $op->template = null; + logAuditEvent(TLS("audit_cfield_created", $op->cf['name']), "CREATE", + $ret['id'], "custom_fields"); + + if ($hash_request['do_action'] == 'do_add_and_assign') { + $cfieldMgr->link_to_testproject($argsObj->tproject_id, + array( + $ret['id'] + )); + } + } + } else { + $op->user_feedback = lang_get("cf_name_exists"); + } + + return $op; +} + +/** + * + * @param array $hash_request + * @param stdClass $argsObj + * @param cfield_mgr $cfieldMgr + * @return stdClass + */ +function doUpdate(&$hash_request, &$argsObj, &$cfieldMgr) +{ + $op = new stdClass(); + $op->template = "cfieldsEdit.tpl"; + $op->user_feedback = ''; + $op->cf = request2cf($hash_request); + $op->cf['id'] = $argsObj->cfield_id; + + $oldObjData = $cfieldMgr->get_by_id($argsObj->cfield_id); + $oldname = $oldObjData[$argsObj->cfield_id]['name']; + $op->operation_descr = lang_get('title_cfield_edit') . TITLE_SEP_TYPE3 . + $oldname; + + $keys2trim = array( + 'name', + 'label', + 'possible_values' + ); + foreach ($keys2trim as $key) { + $op->cf[$key] = trim($op->cf[$key]); + } + + // Check if name exists + $is_unique = $cfieldMgr->name_is_unique($op->cf['id'], $op->cf['name']); + if ($is_unique) { + $ret = $cfieldMgr->update($op->cf); + if ($ret) { + $op->template = null; + logAuditEvent(TLS("audit_cfield_saved", $op->cf['name']), "SAVE", + $op->cf['id'], "custom_fields"); + } + } else { + $op->user_feedback = lang_get("cf_name_exists"); + } + return $op; +} + +/** + * + * @param stdClass $argsObj + * @param cfield_mgr $cfieldMgr + * @return stdClass + */ +function doDelete(&$argsObj, &$cfieldMgr) +{ + $op = new stdClass(); + $op->user_feedback = ''; + $op->cf = null; + $op->template = null; + $op->operation_descr = ''; + + $cf = $cfieldMgr->get_by_id($argsObj->cfield_id); + if ($cf) { + $cf = $cf[$argsObj->cfield_id]; + if ($cfieldMgr->delete($argsObj->cfield_id)) { + logAuditEvent(TLS("audit_cfield_deleted", $cf['name']), "DELETE", + $argsObj->cfield_id, "custom_fields"); + } + } + return $op; +} + +/** + * + * @param cfield_mgr $cfieldMgr + * @return stdClass + */ +function cfieldCfgInit($cfieldMgr) +{ + $cfg = new stdClass(); + $cfAppAreas = $cfieldMgr->get_application_areas(); + foreach ($cfAppAreas as $area) { + $cfg->disabled_cf_enable_on[$area] = array(); + $cfg->cf_show_on[$area]['disabled'] = ''; + $cfg->cf_show_on[$area]['style'] = ''; + + $cfg->cf_enable_on[$area] = array(); + $cfg->cf_enable_on[$area]['label'] = lang_get($area); + $cfg->cf_enable_on[$area]['value'] = 0; + + $cfg->enable_on_cfg[$area] = $cfieldMgr->get_enable_on_cfg($area); + $cfg->show_on_cfg[$area] = $cfieldMgr->get_show_on_cfg($area); + } + + $cfg->possible_values_cfg = $cfieldMgr->get_possible_values_cfg(); + $cfg->allowed_nodes = $cfieldMgr->get_allowed_nodes(); + $cfg->cf_allowed_nodes = array(); + foreach ($cfg->allowed_nodes as $verbose_type => $type_id) { + $cfg->cf_allowed_nodes[$type_id] = lang_get($verbose_type); + } + + return $cfg; +} + +/** + * set environment and render (if needed) smarty template + * + * @param TLSmarty $smartyObj + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param cfield_mgr $cfieldMgr + * @param stdClass $templateCfg + */ +function renderGui(&$smartyObj, &$argsObj, &$guiObj, &$cfieldMgr, $templateCfg) +{ + $doRender = false; + switch ($argsObj->do_action) { + case "do_add": + case "do_delete": + case "do_update": + case "do_add_and_assign": + $doRender = true; + $tpl = is_null($templateCfg->template) ? 'cfieldsView.tpl' : $templateCfg->template; + break; + + case "edit": + case "create": + $doRender = true; + $tpl = is_null($templateCfg->template) ? $templateCfg->default_template : $templateCfg->template; + break; + } + + if ($doRender) { + $guiObj->cf_map = $cfieldMgr->get_all(null, 'transform'); + $guiObj->cf_types = $cfieldMgr->get_available_types(); + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($templateCfg->template_dir . $tpl); + } +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "cfield_management"); } - -if( $do_control_combo_display ) { - $keys2loop = $cfield_mgr->get_application_areas(); - foreach( $keys2loop as $ui_mode) { - $cfieldCfg->cf_enable_on[$ui_mode]['value']=0; - $cfieldCfg->cf_show_on[$ui_mode]['disabled']=''; - $cfieldCfg->cf_show_on[$ui_mode]['style']=''; - - if($cfieldCfg->enable_on_cfg[$ui_mode][$gui->cfield['node_type_id']]) { - $cfieldCfg->cf_enable_on[$ui_mode]['value']=1; - } - - if(!$cfieldCfg->show_on_cfg[$ui_mode][$gui->cfield['node_type_id']]) { - $cfieldCfg->cf_show_on[$ui_mode]['disabled']=' disabled="disabled" '; - $cfieldCfg->cf_show_on[$ui_mode]['style']=' style="display:none;" '; - } - } -} - -$gui->show_possible_values = 0; -if(isset($gui->cfield['type'])) { - $gui->show_possible_values = $cfieldCfg->possible_values_cfg[$gui->cfield['type']]; -} - -// enable on 'execution' implies show on 'execution' then has nosense to display show_on combo -if($args->do_action == 'edit' && $gui->cfield['enable_on_execution'] ) { - $cfieldCfg->cf_show_on['execution']['style']=' style="display:none;" '; -} - -$gui->cfieldCfg = $cfieldCfg; - -$smarty = new TLSmarty(); -$smarty->assign('operation_descr',$operation_descr); -$smarty->assign('user_feedback',$user_feedback); -$smarty->assign('user_action',$args->do_action); -renderGui($smarty,$args,$gui,$cfield_mgr,$templateCfg); - -/** - * - */ -function getCFCfg(&$args,&$cfield_mgr) { - $cfg = new stdClass(); - - $cfg->cfieldCfg = cfieldCfgInit($cfield_mgr); - - $cfg->emptyCF = array('id' => $args->cfield_id, - 'name' => '','label' => '', - 'type' => 0,'possible_values' => '', - 'show_on_design' => 1,'enable_on_design' => 1, - 'show_on_execution' => 0,'enable_on_execution' => 0, - 'show_on_testplan_design' => 0, - 'enable_on_testplan_design' => 0); - - $cfg->emptyCF['node_type_id'] = $cfg->cfieldCfg->allowed_nodes['testcase']; - - return $cfg; -} - - -/** - * - */ -function initializeGui(&$cfield_mgr) { - $gui = $cfield_mgr->initViewGUI(); - return $gui; -} - - - -/* - function: request2cf - scan a hash looking for a keys with 'cf_' prefix, - because this keys represents fields of Custom Fields - tables. - Is used to get values filled by user on a HTML form. - This requirement dictated how html inputs must be named. - If notation is not followed logic will fail. - - args: hash - - returns: hash only with related to custom fields, where - (keys,values) are the original with 'cf_' prefix, but - in this new hash prefix on key is removed. - - rev: - 20090524 - franciscom - changes due to User Interface changes - 20080811 - franciscom - added new values on missing_keys - -*/ -function request2cf($hash) -{ - // design and execution has sense for node types regarding testing - // testplan,testsuite,testcase, but no sense for requirements. - // - // Missing keys are combos that will be disabled and not show at UI. - // For req spec and req, no combo is showed. - // To avoid problems (need to be checked), my choice is set to 1 - // *_on_design keys, that right now will not present only for - // req spec and requirements. - // - $missing_keys = array('show_on_design' => 0, - 'enable_on_design' => 0, - 'show_on_execution' => 0, - 'enable_on_execution' => 0, - 'show_on_testplan_design' => 0, - 'enable_on_testplan_design' => 0, - 'possible_values' => ' ' ); - - $cf_prefix = 'cf_'; - $len_cfp = tlStringLen($cf_prefix); - $start_pos = $len_cfp; - $cf = array(); - foreach($hash as $key => $value) - { - if(strncmp($key,$cf_prefix,$len_cfp) == 0) - { - $dummy = substr($key,$start_pos); - $cf[$dummy] = $value; - } - } - - foreach($missing_keys as $key => $value) - { - if(!isset($cf[$key])) - { - $cf[$key] = $value; - } - } - - // After logic refactoring - // if ENABLE_ON_[area] == 1 - // DISPLAY_ON_[area] = 1 - // - // - // IMPORTANT/CRITIC: - // this KEY MUST BE ALIGNED WITH name on User Inteface - // then if is changed on UI must be changed HERE - $setter=array('design' => 0, 'execution' => 0, 'testplan_design' => 0); - switch($cf['enable_on']) - { - case 'design': - case 'execution': - case 'testplan_design': - $setter[$cf['enable_on']]=1; - break; - - default: - $setter['design']=1; - break; - } - - foreach($setter as $key => $value) - { - $cf['enable_on_' . $key] = $value; - if( $cf['enable_on_' . $key] ) - { - $cf['show_on_' . $key] = 1; - } - } - return $cf; -} - -/* - function: - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $args->do_action = isset($_REQUEST['do_action']) ? $_REQUEST['do_action'] : null; - $args->cfield_id = isset($_REQUEST['cfield_id']) ? intval($_REQUEST['cfield_id']) : 0; - $args->cf_name = isset($_REQUEST['cf_name']) ? $_REQUEST['cf_name'] : null; - - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - if( $args->tproject_id == 0 ) - { - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - return $args; -} - -/* - function: edit - - args: - - returns: - -*/ -function edit(&$argsObj,&$cfieldMgr) -{ - $op = new stdClass(); - $op->cf = null; - $op->cf_is_used = 0; - $op->cf_is_linked = 0; - - $op->user_feedback = ''; - $op->template = null; - $op->operation_descr = ''; - $op->linked_tprojects = null; - - $cfinfo = $cfieldMgr->get_by_id($argsObj->cfield_id); - - if ($cfinfo) - { - $op->cf = $cfinfo[$argsObj->cfield_id]; - $op->cf_is_used = $cfieldMgr->is_used($argsObj->cfield_id); - - $op->operation_descr = lang_get('title_cfield_edit') . TITLE_SEP_TYPE3 . $op->cf['name']; - $op->linked_tprojects = $cfieldMgr->get_linked_testprojects($argsObj->cfield_id); - $op->cf_is_linked = !is_null($op->linked_tprojects) && count($op->linked_tprojects) > 0; - } - return $op; -} - - -/* - function: doCreate - - args: - - returns: - -*/ -function doCreate(&$hash_request,&$cfieldMgr,&$argsObj) -{ - $op = new stdClass(); - $op->template = "cfieldsEdit.tpl"; - $op->user_feedback=''; - $op->cf = request2cf($hash_request); - - $keys2trim=array('name','label','possible_values'); - foreach($keys2trim as $key) - { - $op->cf[$key]=trim($op->cf[$key]); - } - - // Check if name exists - $dupcf = $cfieldMgr->get_by_name($op->cf['name']); - if(is_null($dupcf)) - { - $ret = $cfieldMgr->create($op->cf); - if(!$ret['status_ok']) - { - $op->user_feedback = lang_get("error_creating_cf"); - } - else - { - $op->template = null; - logAuditEvent(TLS("audit_cfield_created",$op->cf['name']),"CREATE",$ret['id'],"custom_fields"); - - if($hash_request['do_action'] == 'do_add_and_assign') - { - $cfieldMgr->link_to_testproject($argsObj->tproject_id,array($ret['id'])); - } - } - } - else - { - $op->user_feedback = lang_get("cf_name_exists"); - } - - return $op; -} - - - -/* - function: doUpdate - - args: - - returns: - -*/ -function doUpdate(&$hash_request,&$argsObj,&$cfieldMgr) -{ - $op = new stdClass(); - $op->template = "cfieldsEdit.tpl"; - $op->user_feedback=''; - $op->cf = request2cf($hash_request); - $op->cf['id'] = $argsObj->cfield_id; - - $oldObjData=$cfieldMgr->get_by_id($argsObj->cfield_id); - $oldname=$oldObjData[$argsObj->cfield_id]['name']; - $op->operation_descr=lang_get('title_cfield_edit') . TITLE_SEP_TYPE3 . $oldname; - - $keys2trim=array('name','label','possible_values'); - foreach($keys2trim as $key) - { - $op->cf[$key]=trim($op->cf[$key]); - } - - // Check if name exists - $is_unique = $cfieldMgr->name_is_unique($op->cf['id'],$op->cf['name']); - if($is_unique) - { - $ret = $cfieldMgr->update($op->cf); - if ($ret) - { - $op->template = null; - logAuditEvent(TLS("audit_cfield_saved",$op->cf['name']),"SAVE",$op->cf['id'],"custom_fields"); - } - } - else - { - $op->user_feedback = lang_get("cf_name_exists"); - } - return $op; -} - - - -/* - function: doDelete - - args: - - returns: - -*/ -function doDelete(&$argsObj,&$cfieldMgr) -{ - $op = new stdClass(); - $op->user_feedback=''; - $op->cf = null; - $op->template = null; - $op->operation_descr = ''; - - $cf = $cfieldMgr->get_by_id($argsObj->cfield_id); - if ($cf) - { - $cf = $cf[$argsObj->cfield_id]; - if ($cfieldMgr->delete($argsObj->cfield_id)) - { - logAuditEvent(TLS("audit_cfield_deleted",$cf['name']),"DELETE",$argsObj->cfield_id,"custom_fields"); - } - } - return $op; -} - - -/* - function: cfieldCfgInit - - args : - - returns: object with configuration options -*/ -function cfieldCfgInit($cfieldMgr) -{ - $cfg = new stdClass(); - $cfAppAreas=$cfieldMgr->get_application_areas(); - foreach($cfAppAreas as $area) - { - $cfg->disabled_cf_enable_on[$area] = array(); - $cfg->cf_show_on[$area]['disabled'] = ''; - $cfg->cf_show_on[$area]['style'] = ''; - - $cfg->cf_enable_on[$area] = array(); - $cfg->cf_enable_on[$area]['label'] = lang_get($area); - $cfg->cf_enable_on[$area]['value'] = 0; - - $cfg->enable_on_cfg[$area] = $cfieldMgr->get_enable_on_cfg($area); - $cfg->show_on_cfg[$area] = $cfieldMgr->get_show_on_cfg($area); - } - - $cfg->possible_values_cfg = $cfieldMgr->get_possible_values_cfg(); - $cfg->allowed_nodes = $cfieldMgr->get_allowed_nodes(); - $cfg->cf_allowed_nodes = array(); - foreach($cfg->allowed_nodes as $verbose_type => $type_id) - { - $cfg->cf_allowed_nodes[$type_id] = lang_get($verbose_type); - } - - return $cfg; -} - - -/* - function: renderGui - set environment and render (if needed) smarty template - - args: - - returns: - - - -*/ -function renderGui(&$smartyObj,&$argsObj,&$guiObj,&$cfieldMgr,$templateCfg) -{ - $doRender=false; - switch($argsObj->do_action) - { - case "do_add": - case "do_delete": - case "do_update": - case "do_add_and_assign": - $doRender=true; - $tpl = is_null($templateCfg->template) ? 'cfieldsView.tpl' : $templateCfg->template; - break; - - case "edit": - case "create": - $doRender=true; - $tpl = is_null($templateCfg->template) ? $templateCfg->default_template : $templateCfg->template; - break; - } - - if($doRender) - { - $guiObj->cf_map = $cfieldMgr->get_all(null,'transform'); - $guiObj->cf_types=$cfieldMgr->get_available_types(); - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($templateCfg->template_dir . $tpl); - } -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"cfield_management"); -} \ No newline at end of file diff --git a/lib/cfields/cfieldsExport.php b/lib/cfields/cfieldsExport.php index 501119633c..5662b829a2 100644 --- a/lib/cfields/cfieldsExport.php +++ b/lib/cfields/cfieldsExport.php @@ -1,113 +1,118 @@ -page_title = lang_get('export_cfields'); -$gui->do_it = 1; -$gui->nothing_todo_msg = ''; -$gui->goback_url = !is_null($args->goback_url) ? $args->goback_url : ''; -$gui->export_filename = is_null($args->export_filename) ? 'customFields.xml' : $args->export_filename; -$gui->exportTypes = array('XML' => 'XML'); - -switch( $args->doAction ) -{ - case 'doExport': - doExport($db,$gui->export_filename); - break; - - default: - break; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args() - - args: - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = - array("doAction" - => array(tlInputParameter::STRING_N,0,50), - "export_filename" - => array(tlInputParameter::STRING_N,0,100)); - - R_PARAMS($iParams,$args); - $args->userID = $_SESSION['userID']; - - $args->goback_url = $_SESSION['basehref'] . - 'lib/cfields/cfieldsView.php'; - - return $args; -} - - - -/* - function: doExport() - - args: dbHandler - filename: where to export - - returns: - - -*/ -function doExport(&$dbHandler,$filename) -{ - $tables = tlObjectWithDB::getDBTables(array('custom_fields','cfield_node_types')); - - // To solve issues with MAC OS - $tmp = (PHP_OS == 'Darwin') ? config_get('temp_dir') : null; - - $adodbXML = new ADODB_XML("1.0", "ISO-8859-1",$tmp); - $sql = " SELECT name,label,type,possible_values,default_value,valid_regexp, " . - " length_min,length_max,show_on_design,enable_on_design,show_on_execution," . - " enable_on_execution,show_on_testplan_design,enable_on_testplan_design, " . - " node_type_id " . - " FROM {$tables['custom_fields']} CF,{$tables['cfield_node_types']} " . - " WHERE CF.id=field_id "; - - $adodbXML->setRootTagName('custom_fields'); - $adodbXML->setRowTagName('custom_field'); - - $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql); - downloadContentsToFile($content,$filename); - exit(); -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"cfield_view"); -} -?> \ No newline at end of file +page_title = lang_get('export_cfields'); +$gui->do_it = 1; +$gui->nothing_todo_msg = ''; +$gui->goback_url = ! is_null($args->goback_url) ? $args->goback_url : ''; +$gui->export_filename = is_null($args->export_filename) ? 'customFields.xml' : $args->export_filename; +$gui->exportTypes = array( + 'XML' => 'XML' +); + +switch ($args->doAction) { + case 'doExport': + doExport($db, $gui->export_filename); + break; + + default: + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "export_filename" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + R_PARAMS($iParams, $args); + $args->userID = $_SESSION['userID']; + + $args->goback_url = $_SESSION['basehref'] . 'lib/cfields/cfieldsView.php'; + + return $args; +} + +/** + * + * @param database $dbHandler + * @param string $filename + */ +function doExport(&$dbHandler, $filename) +{ + $tables = tlObjectWithDB::getDBTables( + array( + 'custom_fields', + 'cfield_node_types' + )); + + // To solve issues with MAC OS + $tmp = (PHP_OS == 'Darwin') ? config_get('temp_dir') : null; + + $adodbXML = new ADODB_XML("1.0", "ISO-8859-1", $tmp); + $sql = " SELECT name,label,type,possible_values,default_value,valid_regexp, " . + " length_min,length_max,show_on_design,enable_on_design,show_on_execution," . + " enable_on_execution,show_on_testplan_design,enable_on_testplan_design, " . + " node_type_id " . + " FROM {$tables['custom_fields']} CF,{$tables['cfield_node_types']} " . + " WHERE CF.id=field_id "; + + $adodbXML->setRootTagName('custom_fields'); + $adodbXML->setRowTagName('custom_field'); + + $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql); + downloadContentsToFile($content, $filename); + exit(); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "cfield_view"); +} +?> diff --git a/lib/cfields/cfieldsImport.php b/lib/cfields/cfieldsImport.php index 4c8f52ba97..724b7dff05 100644 --- a/lib/cfields/cfieldsImport.php +++ b/lib/cfields/cfieldsImport.php @@ -1,142 +1,153 @@ -page_title=lang_get('import_cfields'); -$gui->goback_url = !is_null($args->goback_url) ? $args->goback_url : ''; -$gui->file_check = array('show_results' => 0, 'status_ok' => 1, - 'msg' => 'ok', 'filename' => ''); - -switch( $args->doAction ) -{ - case 'doImport': - $gui->file_check = doImport($db); - break; - - default: - break; -} - -$obj_mgr = new cfield_mgr($db); -$gui->importTypes = array('XML' => 'XML'); -$gui->importLimitKB = (config_get('import_file_max_size_bytes') / 1024); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/* - function: init_args() - - args: - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = - array("doAction" => array(tlInputParameter::STRING_N,0,50), - "export_filename" - => array(tlInputParameter::STRING_N,0,100)); - - R_PARAMS($iParams,$args); - $args->userID = $_SESSION['userID']; - - $args->goback_url = $_SESSION['basehref'] . - 'lib/cfields/cfieldsView.php'; - - return $args; -} - - -/** - * @param object dbHandler reference to db handler - * - */ -function doImport(&$dbHandler) -{ - - $import_msg=array('ok' => array(), 'ko' => array()); - $file_check=array('show_results' => 0, 'status_ok' => 0, 'msg' => '', - 'filename' => '', 'import_msg' => $import_msg); - - $key='targetFilename'; - $dest = TL_TEMP_PATH . session_id(). "-import_cfields.tmp"; - $source = isset($_FILES[$key]['tmp_name']) ? $_FILES[$key]['tmp_name'] : null; - - if (($source != 'none') && ($source != '')) - { - $file_check['filename'] = $_FILES[$key]['name']; - $file_check['status_ok'] = 1; - if (move_uploaded_file($source, $dest)) - { - $file_check['status_ok']=!(($xml=@simplexml_load_file_wrapper($dest)) === FALSE); - } - if( $file_check['status_ok'] ) - { - $file_check['show_results']=1; - $cfield_mgr = new cfield_mgr($dbHandler); - foreach($xml as $cf) - { - if( is_null($cfield_mgr->get_by_name($cf->name)) ) - { - $cfield_mgr->create((array) $cf); - $import_msg['ok'][]=sprintf(lang_get('custom_field_imported'),$cf->name); - } - else - { - $import_msg['ko'][]=sprintf(lang_get('custom_field_already_exists'),$cf->name); - } - } - } - else - { - $file_check['msg']=lang_get('problems_loading_xml_content'); - } - } - else - { - $file_check = array('show_results'=>0, 'status_ok' => 0, - 'msg' => lang_get('please_choose_file_to_import')); - } - - $file_check['import_msg']=$import_msg; - return $file_check; -} - -/** - * - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"cfield_management"); -} -?> \ No newline at end of file +page_title = lang_get('import_cfields'); +$gui->goback_url = ! is_null($args->goback_url) ? $args->goback_url : ''; +$gui->file_check = array( + 'show_results' => 0, + 'status_ok' => 1, + 'msg' => 'ok', + 'filename' => '' +); + +switch ($args->doAction) { + case 'doImport': + $gui->file_check = doImport($db); + break; + + default: + break; +} + +$obj_mgr = new cfield_mgr($db); +$gui->importTypes = array( + 'XML' => 'XML' +); +$gui->importLimitKB = (config_get('import_file_max_size_bytes') / 1024); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "export_filename" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + R_PARAMS($iParams, $args); + $args->userID = $_SESSION['userID']; + + $args->goback_url = $_SESSION['basehref'] . 'lib/cfields/cfieldsView.php'; + + return $args; +} + +/** + * + * @param database $dbHandler + * reference to db handler + * + */ +function doImport(&$dbHandler) +{ + $import_msg = array( + 'ok' => array(), + 'ko' => array() + ); + $file_check = array( + 'show_results' => 0, + 'status_ok' => 0, + 'msg' => '', + 'filename' => '', + 'import_msg' => $import_msg + ); + + $key = 'targetFilename'; + $dest = TL_TEMP_PATH . session_id() . "-import_cfields.tmp"; + $source = isset($_FILES[$key]['tmp_name']) ? $_FILES[$key]['tmp_name'] : null; + + if (($source != 'none') && ($source != '')) { + $file_check['filename'] = $_FILES[$key]['name']; + $file_check['status_ok'] = 1; + if (move_uploaded_file($source, $dest)) { + $file_check['status_ok'] = (($xml = @simplexml_load_file_wrapper( + $dest)) !== false); + } + if ($file_check['status_ok']) { + $file_check['show_results'] = 1; + $cfield_mgr = new cfield_mgr($dbHandler); + foreach ($xml as $cf) { + if (is_null($cfield_mgr->get_by_name($cf->name))) { + $cfield_mgr->create((array) $cf); + $import_msg['ok'][] = sprintf( + lang_get('custom_field_imported'), $cf->name); + } else { + $import_msg['ko'][] = sprintf( + lang_get('custom_field_already_exists'), $cf->name); + } + } + } else { + $file_check['msg'] = lang_get('problems_loading_xml_content'); + } + } else { + $file_check = array( + 'show_results' => 0, + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + } + + $file_check['import_msg'] = $import_msg; + return $file_check; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return array + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "cfield_management"); +} +?> diff --git a/lib/cfields/cfieldsTprojectAssign.php b/lib/cfields/cfieldsTprojectAssign.php index b323df9433..1d76020354 100644 --- a/lib/cfields/cfieldsTprojectAssign.php +++ b/lib/cfields/cfieldsTprojectAssign.php @@ -1,270 +1,276 @@ -checkedCF); - -switch ($args->doAction) { - case 'doAssign': - $cfield_mgr->link_to_testproject($args->tproject_id,$checkedIDSet); - break; - - case 'doUnassign': - $cfield_mgr->unlink_from_testproject($args->tproject_id,$checkedIDSet); - break; - - case 'doReorder': - // To make user's life simpler, we work on all linked CF - // and not only on selected. - $cfield_mgr->set_display_order($args->tproject_id,$args->display_order); - if( !is_null($args->location) ) { - $cfield_mgr->setDisplayLocation($args->tproject_id,$args->location); - } - break; - - case 'doBooleanMgmt': - // To make user's life simpler, we work on all linked CF - // and not only on selected. - $args->attrBefore = $cfield_mgr->getBooleanAttributes($args->tproject_id); - doActiveMgmt($cfield_mgr,$args); - doRequiredMgmt($cfield_mgr,$args); - doMonitorableMgmt($cfield_mgr,$args); - break; - +checkedCF); + +switch ($args->doAction) { + case 'doAssign': + $cfield_mgr->link_to_testproject($args->tproject_id, $checkedIDSet); + break; + + case 'doUnassign': + $cfield_mgr->unlink_from_testproject($args->tproject_id, $checkedIDSet); + break; + + case 'doReorder': + // To make user's life simpler, we work on all linked CF + // and not only on selected. + $cfield_mgr->set_display_order($args->tproject_id, $args->display_order); + if (! is_null($args->location)) { + $cfield_mgr->setDisplayLocation($args->tproject_id, $args->location); + } + break; + + case 'doBooleanMgmt': + // To make user's life simpler, we work on all linked CF + // and not only on selected. + $args->attrBefore = $cfield_mgr->getBooleanAttributes( + $args->tproject_id); + doActiveMgmt($cfield_mgr, $args); + doRequiredMgmt($cfield_mgr, $args); + doMonitorableMgmt($cfield_mgr, $args); + break; +} + +// Get all available custom fields +$cfield_map = $cfield_mgr->get_all(); + +// It's better to get AGAIN CF info AFTER user operations has been applied +// in order to display UPDATED Situation +$gui = initializeGui($args, $cfield_mgr); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * create object with all user inputs + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + $key2search = array( + 'doAction', + 'checkedCF', + 'display_order', + 'location', + 'hidden_active_cfield', + 'active_cfield', + 'hidden_required_cfield', + 'required_cfield', + 'hidden_monitorable_cfield', + 'monitorable_cfield' + ); + + foreach ($key2search as $key) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; + } + + if (is_null($args->checkedCF)) { + $args->checkedCF = array(); + } + + getTproj($dbHandler, $args); + + return $args; +} + +/** + * + * @param database $dbH + * @param stdClass $args + */ +function getTproj(&$dbH, &$args) +{ + $args->tproject_name = ''; + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + if ($args->tproject_id > 0) { + $mgr = new tree($dbH); + $dummy = $mgr->get_node_hierarchy_info($args->tproject_id, null, + array( + 'nodeType' => 'testproject' + )); + if (is_null($dummy)) { + throw new Exception("Unable to get Test Project ID"); + } + $args->tproject_name = $dummy['name']; + } +} + +/** + * + * @param stdClass $args + * @param cfield_mgr $cfield_mgr + * @return stdClass + */ +function initializeGui(&$args, &$cfield_mgr) +{ + $gui = new stdClass(); + + $gui->locations = createLocationsMenu($cfield_mgr->getLocations()); + $gui->tproject_name = $args->tproject_name; + + $gui->linkedCF = $cfield_mgr->get_linked_to_testproject($args->tproject_id); + $cf2exclude = is_null($gui->linkedCF) ? null : array_keys($gui->linkedCF); + $gui->other_cf = $cfield_mgr->get_all($cf2exclude); + + $gui->cf_available_types = $cfield_mgr->get_available_types(); + $gui->cf_allowed_nodes = array(); + $allowed_nodes = $cfield_mgr->get_allowed_nodes(); + + foreach ($allowed_nodes as $verbose_type => $type_id) { + $gui->cf_allowed_nodes[$type_id] = lang_get($verbose_type); + } + + return $gui; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "cfield_management"); +} + +/** + * + * @param array $locations + * map of maps with locations of CF + * key: item type: 'testcase','testsuite', etc + * @return NULL + */ +function createLocationsMenu($locations) +{ + $menuContents = null; + $items = $locations['testcase']; + foreach ($items as $code => $key4label) { + $menuContents[$code] = lang_get($key4label); + } + return $menuContents; +} + +/** + * + * @param cfield_mgr $cfieldMgr + * @param stdClass $argsObj + */ +function doRequiredMgmt(&$cfieldMgr, $argsObj) +{ + $cfg = array(); + $cfg['attrKey'] = 'required'; + $cfg['dbField'] = 'required'; + $cfg['attr'] = "{$cfg['attrKey']}_cfield"; + $cfg['m2c'] = 'set' . ucfirst($cfg['attrKey']); + $cfg['ha'] = "hidden_{$cfg['attr']}"; + + doSimpleBooleanMgmt($cfieldMgr, $argsObj, $cfg); +} + +/** + * + * @param cfield_mgr $cfieldMgr + * @param stdClass $argsObj + */ +function doActiveMgmt(&$cfieldMgr, $argsObj) +{ + $cfg = array(); + $cfg['attrKey'] = 'active'; + $cfg['dbField'] = 'active'; + $cfg['attr'] = "{$cfg['attrKey']}_cfield"; + $cfg['m2c'] = 'set_active_for_testproject'; + $cfg['ha'] = "hidden_{$cfg['attr']}"; + + doSimpleBooleanMgmt($cfieldMgr, $argsObj, $cfg); +} + +/** + * + * @param cfield_mgr $cfieldMgr + * @param stdClass $argsObj + */ +function doMonitorableMgmt(&$cfieldMgr, $argsObj) +{ + $cfg = array(); + $cfg['attrKey'] = 'monitorable'; + $cfg['dbField'] = 'monitorable'; + $cfg['attr'] = "{$cfg['attrKey']}_cfield"; + $cfg['m2c'] = 'set' . ucfirst($cfg['attrKey']); + $cfg['ha'] = "hidden_{$cfg['attr']}"; + + doSimpleBooleanMgmt($cfieldMgr, $argsObj, $cfg); +} + +/** + * + * @param cfield_mgr $cfieldMgr + * @param stdClass $argsObj + * @param array $cfg + */ +function doSimpleBooleanMgmt(&$cfieldMgr, $argsObj, $cfg) +{ + + // This way user does not need to check cf for this operations + // Think makes life easier + $serviceInput = $cfg['ha']; + $cfSet = array_keys($argsObj->$serviceInput); + + $m2c = $cfg['m2c']; + $operativeInput = $cfg['attr']; + + // we are working with checkboxes, and as we know if is not checked + // nothing will arrive on $_REQUEST + if (is_null($argsObj->$operativeInput)) { + $cfieldMgr->$m2c($argsObj->tproject_id, $cfSet, 0); + } else { + $on = null; + $off = null; + foreach ($cfSet as $id) { + if (isset($argsObj->$operativeInput[$id])) { + if ($argsObj->attrBefore[$id][$cfg['dbField']] == 0) { + $on[] = $id; + } + } else { + if ($argsObj->attrBefore[$id][$cfg['dbField']] == 1) { + $off[] = $id; + } + } + } + + if (! is_null($on)) { + $cfieldMgr->$m2c($argsObj->tproject_id, $on, 1); + } + + if (! is_null($off)) { + $cfieldMgr->$m2c($argsObj->tproject_id, $off, 0); + } + } } - -// Get all available custom fields -$cfield_map = $cfield_mgr->get_all(); - -// It's better to get AGAIN CF info AFTER user operations has been applied -// in order to display UPDATED Situation -$gui = initializeGui($args,$cfield_mgr); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * create object with all user inputs - * - */ -function init_args(&$dbHandler) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - $key2search = array('doAction','checkedCF','display_order', - 'location', - 'hidden_active_cfield','active_cfield', - 'hidden_required_cfield','required_cfield', - 'hidden_monitorable_cfield', - 'monitorable_cfield'); - - foreach ($key2search as $key) { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null; - } - - if( is_null($args->checkedCF) ) { - $args->checkedCF = array(); - } - - getTproj($dbHandler,$args); - - return $args; -} - - -/** - * - */ -function getTproj(&$dbH,&$args) -{ - $args->tproject_name = ''; - $args->tproject_id = isset($_REQUEST['tproject_id']) ? - intval($_REQUEST['tproject_id']) : 0; - - if( $args->tproject_id == 0 ) - { - $args->tproject_id = isset($_SESSION['testprojectID']) ? - intval($_SESSION['testprojectID']) : 0; - } - - if( $args->tproject_id > 0 ) - { - $mgr = new tree($dbH); - $dummy = $mgr->get_node_hierarchy_info($args->tproject_id,null, - array('nodeType' => 'testproject')); - if(is_null($dummy)) - { - throw new Exception("Unable to get Test Project ID"); - } - $args->tproject_name = $dummy['name']; - } -} - -/** - * - */ -function initializeGui(&$args,&$cfield_mgr) -{ - $gui = new stdClass(); - - $gui->locations = createLocationsMenu($cfield_mgr->getLocations()); - $gui->tproject_name = $args->tproject_name; - - $gui->linkedCF = $cfield_mgr->get_linked_to_testproject($args->tproject_id); - $cf2exclude = is_null($gui->linkedCF) ? null :array_keys($gui->linkedCF); - $gui->other_cf = $cfield_mgr->get_all($cf2exclude); - - $gui->cf_available_types = $cfield_mgr->get_available_types(); - $gui->cf_allowed_nodes = array(); - $allowed_nodes = $cfield_mgr->get_allowed_nodes(); - - foreach($allowed_nodes as $verbose_type => $type_id) - { - $gui->cf_allowed_nodes[$type_id] = lang_get($verbose_type); - } - - return $gui; -} - -/** - * - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"cfield_management"); -} - -/** - * @parame map of maps with locations of CF - * key: item type: 'testcase','testsuite', etc - * - */ -function createLocationsMenu($locations) -{ - $menuContents = null; - $items = $locations['testcase']; - foreach($items as $code => $key4label) { - $menuContents[$code] = lang_get($key4label); - } - return $menuContents; -} - - -/** - * - */ -function doRequiredMgmt(&$cfieldMgr,$argsObj) -{ - $cfg = array(); - $cfg['attrKey'] = 'required'; - $cfg['dbField'] = 'required'; - $cfg['attr'] = "{$cfg['attrKey']}_cfield"; - $cfg['m2c'] = 'set' . ucfirst($cfg['attrKey']); - $cfg['ha'] = "hidden_{$cfg['attr']}"; - - doSimpleBooleanMgmt($cfieldMgr,$argsObj,$cfg); -} - - -/** - * - */ -function doActiveMgmt(&$cfieldMgr,$argsObj) -{ - $cfg = array(); - $cfg['attrKey'] = 'active'; - $cfg['dbField'] = 'active'; - $cfg['attr'] = "{$cfg['attrKey']}_cfield"; - $cfg['m2c'] = 'set_active_for_testproject'; - $cfg['ha'] = "hidden_{$cfg['attr']}"; - - doSimpleBooleanMgmt($cfieldMgr,$argsObj,$cfg); -} - -/** - * - */ -function doMonitorableMgmt(&$cfieldMgr,$argsObj) -{ - $cfg = array(); - $cfg['attrKey'] = 'monitorable'; - $cfg['dbField'] = 'monitorable'; - $cfg['attr'] = "{$cfg['attrKey']}_cfield"; - $cfg['m2c'] = 'set' . ucfirst($cfg['attrKey']); - $cfg['ha'] = "hidden_{$cfg['attr']}"; - - doSimpleBooleanMgmt($cfieldMgr,$argsObj,$cfg); -} - -/** - * - * - */ -function doSimpleBooleanMgmt(&$cfieldMgr,$argsObj,$cfg) -{ - - // This way user does not need to check cf for this operations - // Think makes life easier - $serviceInput = $cfg['ha']; - $cfSet = array_keys($argsObj->$serviceInput); - - $m2c = $cfg['m2c']; - $operativeInput = $cfg['attr']; - - // we are working with checkboxes, and as we know if is not checked - // nothing will arrive on $_REQUEST - if( is_null($argsObj->$operativeInput) ) - { - $cfieldMgr->$m2c($argsObj->tproject_id,$cfSet,0); - } - else - { - $on = null; - $off = null; - foreach($cfSet as $id) - { - if( isset($argsObj->$operativeInput[$id]) ) - { - if($argsObj->attrBefore[$id][$cfg['dbField']] == 0) - { - $on[] = $id; - } - } - else - { - if($argsObj->attrBefore[$id][$cfg['dbField']] == 1) - { - $off[] = $id; - } - } - } - - if(!is_null($on)) - { - $cfieldMgr->$m2c($argsObj->tproject_id,$on,1); - } - - if(!is_null($off)) - { - $cfieldMgr->$m2c($argsObj->tproject_id,$off,0); - } - } - -} - \ No newline at end of file diff --git a/lib/cfields/cfieldsView.php b/lib/cfields/cfieldsView.php index 0c3a8c4469..81767ccf77 100644 --- a/lib/cfields/cfieldsView.php +++ b/lib/cfields/cfieldsView.php @@ -1,30 +1,34 @@ -initViewGUI(); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function checkRights(&$db,&$user) { - return $user->hasRight($db,"cfield_management") || $user->hasRight($db,"cfield_view"); +initViewGUI(); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @param database $db + * @param tlUser $user + * @return boolean + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "cfield_management") || + $user->hasRight($db, "cfield_view"); } diff --git a/lib/codetrackerintegration/codeTrackerInterface.class.php b/lib/codetrackerintegration/codeTrackerInterface.class.php index 1a89af649e..b128c0f4a0 100755 --- a/lib/codetrackerintegration/codeTrackerInterface.class.php +++ b/lib/codetrackerintegration/codeTrackerInterface.class.php @@ -1,331 +1,325 @@ -tlCharSet = config_get('charset'); - $this->guiCfg = array('use_decoration' => true); // add [] on summary and statusHTMLString - $this->name = $name; - - if( $this->setCfg($config) ) - { - // useful only for integration via DB - if( !property_exists($this->cfg,'dbcharset') ) - { - $this->cfg->dbcharset = $this->tlCharSet; - } - $this->connect(); - } - else - { - $this->connected = false; - } - } - - /** - * - **/ - function getCfg() - { - return $this->cfg; - } - - /** - * - * - **/ - function setCfg($xmlString) - { - $msg = null; - $signature = 'Source:' . __METHOD__; - - // check for empty string - if(strlen(trim($xmlString)) == 0) - { - // Bye,Bye - $msg = " - Code tracker:$this->name - XML Configuration seems to be empty - please check"; - tLog(__METHOD__ . $msg, 'ERROR'); - return false; - } - - $xmlCfg = " " . $xmlString; - libxml_use_internal_errors(true); - try - { - $this->cfg = simplexml_load_string($xmlCfg); - if (!$this->cfg) - { - $msg = $signature . " - Failure loading XML STRING\n"; - foreach(libxml_get_errors() as $error) - { - $msg .= "\t" . $error->message; - } - } - } - catch(Exception $e) - { - $msg = $signature . " - Exception loading XML STRING\n"; - $msg .= 'Message: ' .$e->getMessage(); - } - - if( !($retval = is_null($msg)) ) - { - tLog(__METHOD__ . $msg, 'ERROR'); - } - - // From - // http://php.net/manual/it/function.unserialize.php#112823 - // - // After PHP 5.3 an object made by - // SimpleXML_Load_String() cannot be serialized. - // An attempt to do so will result in a run-time - // failure, throwing an exception. - // - // If you store such an object in $_SESSION, - // you will get a post-execution error that says this: - // Fatal error: Uncaught exception 'Exception' - // with message 'Serialization of 'SimpleXMLElement' - // is not allowed' in [no active file]:0 - // Stack trace: #0 {main} thrown in [no active file] - // on line 0 - // - // !!!!! The entire contents of the session will be lost. - // http://stackoverflow.com/questions/1584725/quickly-convert-simplexmlobject-to-stdclass - $this->cfg = json_decode(json_encode($this->cfg)); - return $retval; - } - - /** - * - **/ - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - /** - * establishes the database connection to the codetracking system - * - * @return bool returns true if the db connection was established and the - * db could be selected, false else - * - **/ - function connect() - { - if (is_null($this->cfg->dbhost) || is_null($this->cfg->dbuser)) - { - return false; - } - - // cast everything to string in order to avoid issues - // @20140604 someone has been issues trying to connect to JIRA on MSSQL - $this->cfg->dbtype = strtolower((string)$this->cfg->dbtype); - $this->cfg->dbhost = (string)$this->cfg->dbhost; - $this->cfg->dbuser = (string)$this->cfg->dbuser; - $this->cfg->dbpassword = (string)$this->cfg->dbpassword; - $this->cfg->dbname = (string)$this->cfg->dbname; - - $this->dbConnection = new database($this->cfg->dbtype); - $result = $this->dbConnection->connect(false, $this->cfg->dbhost,$this->cfg->dbuser, - $this->cfg->dbpassword, $this->cfg->dbname); - - if (!$result['status']) - { - $this->dbConnection = null; - $connection_args = "(interface: - Host:$this->cfg->dbhost - " . - "DBName: $this->cfg->dbname - User: $this->cfg->dbuser) "; - $msg = sprintf(lang_get('CTS_connect_to_database_fails'),$connection_args); - tLog($msg . $result['dbms_msg'], 'ERROR'); - } - elseif ($this->cfg->dbtype == 'mysql') - { - if ($this->cfg->dbcharset == 'UTF-8') - { - $r = $this->dbConnection->exec_query("SET CHARACTER SET utf8"); - $r = $this->dbConnection->exec_query("SET NAMES utf8"); - $r = $this->dbConnection->exec_query("SET collation_connection = 'utf8_general_ci'"); - } - else - { - $r = $this->dbConnection->exec_query("SET CHARACTER SET " . $this->cfg->dbcharset); - $r = $this->dbConnection->exec_query("SET NAMES ". $this->cfg->dbcharset); - } - } - - $this->connected = $result['status'] ? true : false; - - return $this->connected; - } - - /** - * State of connection to CTS - * - * @return bool returns true if connection with CTS is established, false else - * - **/ - function isConnected() - { - - return ($this->connected && - ((!$this->interfaceViaDB ) || is_object($this->dbConnection)) ? 1 : 0); - } - - /** - * Closes the db connection (if any) - * - **/ - function disconnect() - { - if ($this->isConnected() && $this->interfaceViaDB) - { - $this->dbConnection->close(); - } - $this->connected = false; - $this->dbConnection = null; - } - - /** - * default implementation for generating a link to the codetracking page for viewing - * the code with the given id in a new page - * - * @param mixed project_key - * @param mixed repository_name - * @param mixed code_path - * - * @return string returns a complete HTML HREF to view the code (if found in db) - * - **/ - function buildViewCodeLink($project_key, $repository_name, $code_path, $opt=null) - { - $branch_name = null; - $commit_id = null; - if (isset($opt['branch'])) - { - $branch_name = $opt['branch']; - } - if (isset($opt['commit_id'])) - { - $commit_id = $opt['commit_id']; - } - $link = ""; - - $link .= $code_path; - - $link .= ""; - - $ret = new stdClass(); - $ret->link = $link; - $ret->op = true; - - return $ret; - } - - /** - * returns the URL which should be displayed for entering code links - * - * @return string returns a complete URL - * - **/ - function getEnterCodeURL() - { - return $this->cfg->uricreate; - } - - - /** - * Returns URL to the codetracking page for viewing ticket - * - * @param mixed project_key - * @param mixed repository_name - * @param mixed code_path - * @param mixed branch_name - * - * @return string - **/ - function buildViewCodeURL($project_key, $repository_name, $code_path, $branch_name=null, $commit_id=null) - { - $codeURL = $this->cfg->uriview . $project_key . '/repos/' . $repository_name . - '/browse/' . $code_path; - - //commit_id has priority over branch name - if (!is_null($commit_id)) - { - $codeURL .= '?at=' . $commit_id; - } - else if (!is_null($branch_name)) - { - $codeURL .= '?at=refs%2Fheads%2F' . $branch_name; - } - - return $codeURL; - } - - // How to Force Extending class to define this STATIC method ? - // KO abstract public static function getCfgTemplate(); - public static function getCfgTemplate() - { - throw new RuntimeException("Unimplemented - YOU must implement it in YOUR interface Class"); - } - - /** - * - **/ - public static function checkEnv() - { - $ret = array(); - $ret['status'] = true; - $ret['msg'] = 'OK'; - return $ret; - } - +tlCharSet = config_get('charset'); + $this->guiCfg = array( + 'use_decoration' => true + ); // add [] on summary and statusHTMLString + $this->name = $name; + + if ($this->setCfg($config)) { + // useful only for integration via DB + if (! property_exists($this->cfg, 'dbcharset')) { + $this->cfg->dbcharset = $this->tlCharSet; + } + $this->connect(); + } else { + $this->connected = false; + } + } + + /** + */ + public function getCfg() + { + return $this->cfg; + } + + /** + */ + public function setCfg($xmlString) + { + $msg = null; + $signature = 'Source:' . __METHOD__; + + // check for empty string + if (strlen(trim($xmlString)) == 0) { + // Bye,Bye + $msg = " - Code tracker:$this->name - XML Configuration seems to be empty - please check"; + tLog(__METHOD__ . $msg, 'ERROR'); + return false; + } + + $xmlCfg = " " . $xmlString; + libxml_use_internal_errors(true); + try { + $this->cfg = simplexml_load_string($xmlCfg); + if (! $this->cfg) { + $msg = $signature . " - Failure loading XML STRING\n"; + foreach (libxml_get_errors() as $error) { + $msg .= "\t" . $error->message; + } + } + } catch (Exception $e) { + $msg = $signature . " - Exception loading XML STRING\n"; + $msg .= 'Message: ' . $e->getMessage(); + } + + if (! ($retval = is_null($msg))) { + tLog(__METHOD__ . $msg, 'ERROR'); + } + + // From + // http://php.net/manual/it/function.unserialize.php#112823 + // + // After PHP 5.3 an object made by + // SimpleXML_Load_String() cannot be serialized. + // An attempt to do so will result in a run-time + // failure, throwing an exception. + // + // If you store such an object in $_SESSION, + // you will get a post-execution error that says this: + // Fatal error: Uncaught exception 'Exception' + // with message 'Serialization of 'SimpleXMLElement' + // is not allowed' in [no active file]:0 + // Stack trace: #0 {main} thrown in [no active file] + // on line 0 + // + // !!!!! The entire contents of the session will be lost. + // http://stackoverflow.com/questions/1584725/quickly-convert-simplexmlobject-to-stdclass + $this->cfg = json_decode(json_encode($this->cfg)); + return $retval; + } + + /** + */ + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + /** + * establishes the database connection to the codetracking system + * + * @return bool returns true if the db connection was established and the + * db could be selected, false else + * + */ + public function connect() + { + if (is_null($this->cfg->dbhost) || is_null($this->cfg->dbuser)) { + return false; + } + + // cast everything to string in order to avoid issues + // @20140604 someone has been issues trying to connect to JIRA on MSSQL + $this->cfg->dbtype = strtolower((string) $this->cfg->dbtype); + $this->cfg->dbhost = (string) $this->cfg->dbhost; + $this->cfg->dbuser = (string) $this->cfg->dbuser; + $this->cfg->dbpassword = (string) $this->cfg->dbpassword; + $this->cfg->dbname = (string) $this->cfg->dbname; + + $this->dbConnection = new database($this->cfg->dbtype); + $result = $this->dbConnection->connect(false, $this->cfg->dbhost, + $this->cfg->dbuser, $this->cfg->dbpassword, $this->cfg->dbname); + + if (! $result['status']) { + $this->dbConnection = null; + $connection_args = "(interface: - Host:$this->cfg->dbhost - " . + "DBName: $this->cfg->dbname - User: $this->cfg->dbuser) "; + $msg = sprintf(lang_get('CTS_connect_to_database_fails'), + $connection_args); + tLog($msg . $result['dbms_msg'], 'ERROR'); + } elseif ($this->cfg->dbtype == 'mysql') { + if ($this->cfg->dbcharset == 'UTF-8') { + $this->dbConnection->exec_query("SET CHARACTER SET utf8"); + $this->dbConnection->exec_query("SET NAMES utf8"); + $this->dbConnection->exec_query( + "SET collation_connection = 'utf8_general_ci'"); + } else { + $this->dbConnection->exec_query( + "SET CHARACTER SET " . $this->cfg->dbcharset); + $this->dbConnection->exec_query( + "SET NAMES " . $this->cfg->dbcharset); + } + } + + $this->connected = $result['status'] ? true : false; + + return $this->connected; + } + + /** + * State of connection to CTS + * + * @return bool returns true if connection with CTS is established, false else + * + */ + public function isConnected() + { + return $this->connected && + ((! $this->interfaceViaDB) || is_object($this->dbConnection)) ? 1 : 0; + } + + /** + * Closes the db connection (if any) + */ + public function disconnect() + { + if ($this->isConnected() && $this->interfaceViaDB) { + $this->dbConnection->close(); + } + $this->connected = false; + $this->dbConnection = null; + } + + /** + * default implementation for generating a link to the codetracking page for viewing + * the code with the given id in a new page + * + * @param + * mixed project_key + * @param + * mixed repository_name + * @param + * mixed code_path + * + * @return string returns a complete HTML HREF to view the code (if found in db) + * + */ + public function buildViewCodeLink($project_key, $repository_name, $code_path, + $opt = null) + { + $branch_name = null; + $commit_id = null; + if (isset($opt['branch'])) { + $branch_name = $opt['branch']; + } + if (isset($opt['commit_id'])) { + $commit_id = $opt['commit_id']; + } + $link = ""; + + $link .= $code_path; + + $link .= ""; + + $ret = new stdClass(); + $ret->link = $link; + $ret->op = true; + + return $ret; + } + + /** + * returns the URL which should be displayed for entering code links + * + * @return string returns a complete URL + * + */ + public function getEnterCodeURL() + { + return $this->cfg->uricreate; + } + + /** + * Returns URL to the codetracking page for viewing ticket + * + * @param + * mixed project_key + * @param + * mixed repository_name + * @param + * mixed code_path + * @param + * mixed branch_name + * + * @return string + */ + public function buildViewCodeURL($project_key, $repository_name, $code_path, + $branch_name = null, $commit_id = null) + { + $codeURL = $this->cfg->uriview . $project_key . '/repos/' . + $repository_name . '/browse/' . $code_path; + + // commit_id has priority over branch name + if (! is_null($commit_id)) { + $codeURL .= '?at=' . $commit_id; + } elseif (! is_null($branch_name)) { + $codeURL .= '?at=refs%2Fheads%2F' . $branch_name; + } + + return $codeURL; + } + + // How to Force Extending class to define this STATIC method ? + // KO abstract public static function getCfgTemplate(); + public static function getCfgTemplate() + { + throw new RuntimeException( + "Unimplemented - YOU must implement it in YOUR interface Class"); + } + + /** + */ + public static function checkEnv() + { + $ret = array(); + $ret['status'] = true; + $ret['msg'] = 'OK'; + return $ret; + } } diff --git a/lib/codetrackerintegration/code_testing/gitlab/test.php b/lib/codetrackerintegration/code_testing/gitlab/test.php index 29e51ae467..98ba4d47dd 100644 --- a/lib/codetrackerintegration/code_testing/gitlab/test.php +++ b/lib/codetrackerintegration/code_testing/gitlab/test.php @@ -1,93 +1,75 @@ -\n" . - "{$token}\n". - "{$gitlabUrl}\n". - "{$gitlabUrl}api/4.0/\n". - "{$projectID}\n". - "code\n". - "\n"; -*/ -/* git.tesisquare.com - francisco -*/ -$gitlabUrl = 'https://git.tesisquare.com/'; -$token ='ToG9Q1UaYdZDWqeG3Uyw'; -$projectID = 4641; -$path = 'test/product-tree/PT.01.SCM.Sourcing/'; -$path = 'test/product-tree/PT.02.SCM.Procurement/'; -$path = 'test/product-tree/'; - -$cfg = "\n" . - "{$token}\n". - "{$gitlabUrl}\n". - "{$gitlabUrl}api/4.0/\n". - "{$projectID}\n". - "{$path}\n". - "\n"; - - -echo '

    '; -echo "Testing gitlab rest "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$system = new gitlabrestInterface(18,$cfg,'pandora'); -$cfgObj = $system->getCfg(); - -$params = ['id' => $cfgObj->projectidentifier, - 'path' => $cfgObj->testscriptpath]; -$client = $system->getAPIClient(); - - - -echo '
     - getRepoFilesTreeFlat
    '; - -// First Steps First level -$params['recursive'] = false; -$params['itemType'] = 'tree'; -$main = $client->getRepoFilesTreeFlat($params); - -var_dump($main); - -$all = []; -foreach ($main as $path) { - $params['itemType'] = 'blob'; - $params['recursive'] = true; - $params['path'] = $path; - - $all[$path] = $client->getRepoFilesTreeFlat($params); -} - -var_dump($all); - +\n" . "{$token}\n" . + "{$gitlabUrl}\n" . + "{$gitlabUrl}api/4.0/\n" . + "{$projectID}\n" . + "{$path}\n" . "\n"; + +echo '

    '; +echo "Testing gitlab rest "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$system = new gitlabrestInterface(18, $cfg, 'pandora'); +$cfgObj = $system->getCfg(); + +$params = [ + 'id' => $cfgObj->projectidentifier, + 'path' => $cfgObj->testscriptpath +]; +$client = $system->getAPIClient(); + +echo '
     - getRepoFilesTreeFlat
    '; + +// First Steps First level +$params['recursive'] = false; +$params['itemType'] = 'tree'; +$main = $client->getRepoFilesTreeFlat($params); + +var_dump($main); + +$all = []; +foreach ($main as $path) { + $params['itemType'] = 'blob'; + $params['recursive'] = true; + $params['path'] = $path; + + $all[$path] = $client->getRepoFilesTreeFlat($params); +} + +var_dump($all); + echo '
    '; diff --git a/lib/codetrackerintegration/stashrestInterface.class.php b/lib/codetrackerintegration/stashrestInterface.class.php index a3fa697254..37bd73a698 100755 --- a/lib/codetrackerintegration/stashrestInterface.class.php +++ b/lib/codetrackerintegration/stashrestInterface.class.php @@ -1,428 +1,366 @@ -name = $name; - $this->interfaceViaDB = false; - - if($this->setCfg($config) && $this->checkCfg()) - { - $this->completeCfg(); - $this->connect(); - $this->guiCfg = array('use_decoration' => true); - } - } - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - - if( !property_exists($this->cfg,'uriapi') ) - { - $this->cfg->uriapi = $base . 'rest/api/1.0/'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'projects/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . ''; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * returns the URL which should be displayed for entering code links - * - * @return string returns a complete URL - * - **/ - function getEnterCodeURL() - { - return $this->cfg->uricreate . 'projects'; - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $this->stashCfg = array('username' => (string)trim($this->cfg->username), - 'password' => (string)trim($this->cfg->password), - 'host' => (string)trim($this->cfg->uriapi)); - - $this->stashCfg['proxy'] = config_get('proxy'); - if( !is_null($this->stashCfg['proxy']) ) - { - if( is_null($this->stashCfg['proxy']->host) ) - { - $this->stashCfg['proxy'] = null; - } - } - - - $this->APIClient = new StashApi\Stash($this->stashCfg); - - $this->connected = $this->APIClient->testLogin(); - if($this->connected && ($this->cfg->projectkey != self::NOPROJECTKEY)) - { - // Now check if can get info about the project, to understand - // if at least it exists. - $pk = trim((string)$this->cfg->projectkey); - $this->APIClient->getProject($pk); - } - } - catch(Exception $e) - { - $this->connected = false; - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - /** - * - */ - public function getProject($projectKey) - { - try - { - return $this->APIClient->getProject($projectKey); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getProjects() - { - try - { - return $this->APIClient->getProjects(); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getProjectsForHTMLSelect() - { - $ret = null; - $projList = $this->getProjects(); - if (property_exists($projList, 'values')) - { - $ret = $this->objectAttrToKeyName($projList->values); - } - return $ret; - } - - /** - * - */ - public function getRepos($projectKey) - { - try - { - return $this->APIClient->getRepos($projectKey); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getReposForHTMLSelect($projectKey) - { - $ret = null; - $repoList = $this->getRepos($projectKey); - if (property_exists($repoList, 'values')) - { - $ret = $this->objectAttrToIDName($repoList->values, 'slug','name'); - } - return $ret; - } - - /** - * - */ - public function getRepoContent($projectKey,$repoName,$path='',$branch='',$commit_id='',$type=false) - { - try - { - return $this->APIClient->getRepoContent($projectKey,$repoName,$path,$branch,$commit_id,$type); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getRepoContentForHTMLSelect($projectKey,$repoName,$path='',$branch='',$type=false) - { - $ret = null; - $contentList = $this->getRepoContent($projectKey,$repoName,$path,$branch,'',$type); - if (property_exists($contentList, 'children') && property_exists($contentList->children, 'values')) - { - if ($path != '' && substr($path,-1) != "/") - { - $path .= "/"; - } - foreach($contentList->children->values as $elem) - { - $tmpName = $elem->path->toString; - $slashPos = strpos($elem->path->toString, '/'); - if ($slashPos !== false) - { - $tmpName = substr($tmpName, 0, $slashPos); - } - $ret[$tmpName] = array($elem->type,$path); - } - } - return $ret; - } - - /** - * - */ - public function getBranches($projectKey,$repoName) - { - try - { - return $this->APIClient->getBranches($projectKey,$repoName); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getBranchesForHTMLSelect($projectKey,$repoName) - { - $ret = null; - $branchList = $this->getBranches($projectKey,$repoName); - if (property_exists($branchList, 'values')) - { - $ret = $this->objectAttrToIDName($branchList->values, 'displayId','displayId'); - } - return $ret; - } - - /** - * - */ - public function getCommits($projectKey,$repoName,$branchName=null) - { - try - { - return $this->APIClient->getCommits($projectKey,$repoName,$branchName); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getCommitsForHTMLSelect($projectKey,$repoName,$branchName) - { - $ret = null; - $commitList = $this->getCommits($projectKey,$repoName,$branchName); - if (property_exists($commitList, 'values')) - { - $dateFormats = config_get('locales_date_format'); - - $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; - $localesDateFormat = $dateFormats[$locale]; - - foreach($commitList->values as $elem) - { - $ret[$elem->id] = $elem->displayId . ' (' . @strftime($localesDateFormat, - ($elem->authorTimestamp / 1000)) . '): ' . $elem->message; - } - } - return $ret; - } - - /** - * - * - */ - private function objectAttrToKeyName($attrSet) - { - $ret = null; - if(!is_null($attrSet)) - { - $ic = count($attrSet); - for($idx=0; $idx < $ic; $idx++) - { - $ret[$attrSet[$idx]->key] = $attrSet[$idx]->name . " (" . $attrSet[$idx]->key . ")"; - } - } - return $ret; - } - - /** - * - * - */ - private function objectAttrToIDName($attrSet,$id='id',$name='name') - { - $ret = null; - if(!is_null($attrSet)) - { - $ic = count($attrSet); - for($idx=0; $idx < $ic; $idx++) - { - $ret[$attrSet[$idx]->$id] = $attrSet[$idx]->$name; - } - } - return $ret; - } - - /** - * - * - */ - private function objectAttrToIDNameKey($attrSet) - { - $ret = null; - if(!is_null($attrSet)) - { - $ic = count($attrSet); - for($idx=0; $idx < $ic; $idx++) - { - $ret[$attrSet[$idx]->id] = $attrSet[$idx]->name . " (" . $attrSet[$idx]->key . ")"; - } - } - return $ret; - } - - - - - - /** - * - * @author uwe_kirst@mentor.com> - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "STASH LOGIN NAME\n" . - "STASH PASSWORD\n" . - "https://testlink.atlassian.net/\n" . - "https://testlink.atlassian.net/rest/api/1.0/\n" . - "https://testlink.atlassian.net/projects/\n" . - "STASH PROJECT KEY\n" . - "\n"; - return $tpl; - } - - /** - * - * - **/ - function checkCfg() - { - $status_ok = true; - if( property_exists($this->cfg, 'projectkey') ) - { - $pk = trim((string)($this->cfg->projectkey)); - if($pk == '') - { - $status_ok = false; - $msg = __CLASS__ . ' - Empty configuration: '; - } - } - else - { - // this is oK if user only wants to LINK issues - $this->cfg->projectkey = self::NOPROJECTKEY; - } - - if(!$status_ok) - { - tLog(__METHOD__ . ' / ' . $msg , 'ERROR'); - } - return $status_ok; - } - - +name = $name; + $this->interfaceViaDB = false; + + if ($this->setCfg($config) && $this->checkCfg()) { + $this->completeCfg(); + $this->connect(); + $this->guiCfg = array( + 'use_decoration' => true + ); + } + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + + if (! property_exists($this->cfg, 'uriapi')) { + $this->cfg->uriapi = $base . 'rest/api/1.0/'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'projects/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . ''; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * returns the URL which should be displayed for entering code links + * + * @return string returns a complete URL + * + */ + public function getEnterCodeURL() + { + return $this->cfg->uricreate . 'projects'; + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + * + */ + public function connect() + { + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $this->stashCfg = array( + 'username' => (string) trim($this->cfg->username), + 'password' => (string) trim($this->cfg->password), + 'host' => (string) trim($this->cfg->uriapi) + ); + + $this->stashCfg['proxy'] = config_get('proxy'); + if (! is_null($this->stashCfg['proxy']) && + is_null($this->stashCfg['proxy']->host)) { + $this->stashCfg['proxy'] = null; + } + + $this->APIClient = new StashApi\Stash($this->stashCfg); + + $this->connected = $this->APIClient->testLogin(); + if ($this->connected && + ($this->cfg->projectkey != self::NOPROJECTKEY)) { + // Now check if can get info about the project, to understand + // if at least it exists. + $pk = trim((string) $this->cfg->projectkey); + $this->APIClient->getProject($pk); + } + } catch (Exception $e) { + $this->connected = false; + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getProject($projectKey) + { + try { + return $this->APIClient->getProject($projectKey); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getProjects() + { + try { + return $this->APIClient->getProjects(); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getProjectsForHTMLSelect() + { + $ret = null; + $projList = $this->getProjects(); + if (property_exists($projList, 'values')) { + $ret = $this->objectAttrToKeyName($projList->values); + } + return $ret; + } + + /** + */ + public function getRepos($projectKey) + { + try { + return $this->APIClient->getRepos($projectKey); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getReposForHTMLSelect($projectKey) + { + $ret = null; + $repoList = $this->getRepos($projectKey); + if (property_exists($repoList, 'values')) { + $ret = $this->objectAttrToIDName($repoList->values, 'slug', 'name'); + } + return $ret; + } + + /** + */ + public function getRepoContent($projectKey, $repoName, $path = '', + $branch = '', $commit_id = '', $type = false) + { + try { + return $this->APIClient->getRepoContent($projectKey, $repoName, + $path, $branch, $commit_id, $type); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getRepoContentForHTMLSelect($projectKey, $repoName, + $path = '', $branch = '', $type = false) + { + $ret = null; + $contentList = $this->getRepoContent($projectKey, $repoName, $path, + $branch, '', $type); + if (property_exists($contentList, 'children') && + property_exists($contentList->children, 'values')) { + if ($path != '' && substr($path, - 1) != "/") { + $path .= "/"; + } + foreach ($contentList->children->values as $elem) { + $tmpName = $elem->path->toString; + $slashPos = strpos($elem->path->toString, '/'); + if ($slashPos !== false) { + $tmpName = substr($tmpName, 0, $slashPos); + } + $ret[$tmpName] = array( + $elem->type, + $path + ); + } + } + return $ret; + } + + /** + */ + public function getBranches($projectKey, $repoName) + { + try { + return $this->APIClient->getBranches($projectKey, $repoName); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getBranchesForHTMLSelect($projectKey, $repoName) + { + $ret = null; + $branchList = $this->getBranches($projectKey, $repoName); + if (property_exists($branchList, 'values')) { + $ret = $this->objectAttrToIDName($branchList->values, 'displayId', + 'displayId'); + } + return $ret; + } + + /** + */ + public function getCommits($projectKey, $repoName, $branchName = null) + { + try { + return $this->APIClient->getCommits($projectKey, $repoName, + $branchName); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getCommitsForHTMLSelect($projectKey, $repoName, $branchName) + { + $ret = null; + $commitList = $this->getCommits($projectKey, $repoName, $branchName); + if (property_exists($commitList, 'values')) { + $dateFormats = config_get('locales_date_format'); + + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $localesDateFormat = $dateFormats[$locale]; + + foreach ($commitList->values as $elem) { + $ret[$elem->id] = $elem->displayId . ' (' . + @strftime($localesDateFormat, + ($elem->authorTimestamp / 1000)) . '): ' . $elem->message; + } + } + return $ret; + } + + /** + */ + private function objectAttrToKeyName($attrSet) + { + $ret = null; + if (! is_null($attrSet)) { + $ic = count($attrSet); + for ($idx = 0; $idx < $ic; $idx ++) { + $ret[$attrSet[$idx]->key] = $attrSet[$idx]->name . " (" . + $attrSet[$idx]->key . ")"; + } + } + return $ret; + } + + /** + */ + private function objectAttrToIDName($attrSet, $id = 'id', $name = 'name') + { + $ret = null; + if (! is_null($attrSet)) { + $ic = count($attrSet); + for ($idx = 0; $idx < $ic; $idx ++) { + $ret[$attrSet[$idx]->$id] = $attrSet[$idx]->$name; + } + } + return $ret; + } + + /** + */ + private function objectAttrToIDNameKey($attrSet) + { + $ret = null; + if (! is_null($attrSet)) { + $ic = count($attrSet); + for ($idx = 0; $idx < $ic; $idx ++) { + $ret[$attrSet[$idx]->id] = $attrSet[$idx]->name . " (" . + $attrSet[$idx]->key . ")"; + } + } + return $ret; + } + + /** + * + * @author uwe_kirst@mentor.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "STASH LOGIN NAME\n" . + "STASH PASSWORD\n" . + "https://testlink.atlassian.net/\n" . + "https://testlink.atlassian.net/rest/api/1.0/\n" . + "https://testlink.atlassian.net/projects/\n" . + "STASH PROJECT KEY\n" . "\n"; + } + + /** + */ + private function checkCfg() + { + $status_ok = true; + if (property_exists($this->cfg, 'projectkey')) { + $pk = trim((string) ($this->cfg->projectkey)); + if ($pk == '') { + $status_ok = false; + $msg = __CLASS__ . ' - Empty configuration: '; + } + } else { + // this is oK if user only wants to LINK issues + $this->cfg->projectkey = self::NOPROJECTKEY; + } + + if (! $status_ok) { + tLog(__METHOD__ . ' / ' . $msg, 'ERROR'); + } + return $status_ok; + } } diff --git a/lib/codetrackers/codeTrackerCommands.class.php b/lib/codetrackers/codeTrackerCommands.class.php index 0cd8d9ec09..84e026e60c 100755 --- a/lib/codetrackers/codeTrackerCommands.class.php +++ b/lib/codetrackers/codeTrackerCommands.class.php @@ -1,274 +1,261 @@ -db=$dbHandler; - $this->codeTrackerMgr = new tlCodeTracker($dbHandler); - $this->entitySpec = $this->codeTrackerMgr->getEntitySpec(); - - $this->grants=new stdClass(); - $this->grants->canManage = false; - - $this->guiOpWhiteList = array_flip(array('checkConnection','create','edit','delete','doCreate', - 'doUpdate','doDelete')); - } - - function setTemplateCfg($cfg) - { - $this->templateCfg = $cfg; - } - - function getGuiOpWhiteList() - { - return $this->guiOpWhiteList; - } - - /** - * - * - */ - function initGuiBean(&$argsObj, $caller) - { - $obj = new stdClass(); - $obj->action = $caller; - $obj->typeDomain = $this->codeTrackerMgr->getTypes(); - $obj->canManage = $argsObj->currentUser->hasRight($this->db,'codetracker_management'); - $obj->user_feedback = array('type' => '', 'message' => ''); - - $obj->l18n = init_labels(array('codetracker_management' => null, - 'btn_save' => null, 'create' => null, - 'edit' => null, - 'checkConnection' => 'btn_check_connection', - 'codetracker_deleted' => null)); - - // we experiment on way to get Action Description for GUI using __FUNCTION__ - $obj->l18n['doUpdate'] = $obj->l18n['edit']; - $obj->l18n['doCreate'] = $obj->l18n['create']; - $obj->l18n['doDelete'] = ''; - $obj->main_descr = $obj->l18n['codetracker_management']; - $obj->action_descr = ucfirst($obj->l18n[$caller]); - $obj->connectionStatus = ''; - - switch($caller) - { - case 'delete': - case 'doDelete': - $obj->submit_button_label = ''; - break; - - default: - $obj->submit_button_label = $obj->l18n['btn_save']; - break; - } - - return $obj; - } - - /** - * - * - */ - function create(&$argsObj,$request,$caller=null) - { - $guiObj = $this->initGuiBean($argsObj,(is_null($caller) ? __FUNCTION__ : $caller)); - $templateCfg = templateConfiguration('codeTrackerEdit'); - $guiObj->template = $templateCfg->default_template; - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'codetracker_management'); - - $guiObj->item = array('id' => 0); - $dummy = ''; - foreach($this->entitySpec as $property => $type) - { - $guiObj->item[$property] = ($type == 'int') ? 0 :''; - } - return $guiObj; - } - - /** - * - * - */ - function doCreate(&$argsObj,$request) - { - $guiObj = $this->create($argsObj,$request,__FUNCTION__); - - // Checks are centralized on create() - $ct = new stdClass(); - foreach($this->entitySpec as $property => $type) - { - $ct->$property = $argsObj->$property; - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$ct; - - $op = $this->codeTrackerMgr->create($ct); - if($op['status_ok']) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "codeTrackerView.php"; - } - else - { - $templateCfg = templateConfiguration('codeTrackerEdit'); - $guiObj->template=$templateCfg->default_template; - $guiObj->user_feedback['message'] = $op['msg']; - } - - return $guiObj; - } - - - - - /* - function: edit - - args: - - returns: - - */ - function edit(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $templateCfg = templateConfiguration('codeTrackerEdit'); - $guiObj->template = $templateCfg->default_template; - - $guiObj->item = $this->codeTrackerMgr->getByID($argsObj->id); - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'codetracker_management'); - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $ct = new stdClass(); - $ct->id = $argsObj->id; - foreach($this->entitySpec as $property => $type) - { - $ct->$property = $argsObj->$property; - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$ct; - - $op = $this->codeTrackerMgr->update($ct); - if( $op['status_ok'] ) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "codeTrackerView.php"; - } - else - { - $guiObj->user_feedback['message'] = $op['msg']; - $guiObj->template = null; - } - - return $guiObj; - } - - /** - * - * - */ - function doDelete(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - // get minimal info for user feedback before deleting - // $ct = $this->codeTrackerMgr->getByID($argsObj->id); - $op = $this->codeTrackerMgr->delete($argsObj->id); - - // http://www.plus2net.com/php_tutorial/variables.php - //if($op['status_ok']) - //{ - // $msg = sprintf($this->guiObj->l18n['codetracker_deleted'],$ct['name']); - //} - //else - //{ - // $msg = $op['msg']; - //} - //$_SESSION['codeTrackerView.user_feedback'] = $msg; - - $guiObj->action = 'doDelete'; - $guiObj->template = "codeTrackerView.php?"; - - return $guiObj; - } - - /** - * - */ - function checkConnection(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'codetracker_management'); - - $tplCfg = templateConfiguration('codeTrackerEdit'); - $guiObj->template = $tplCfg->default_template; - - if( $argsObj->id > 0 ) - { - $cxx = $this->codeTrackerMgr->getByID($argsObj->id); - $guiObj->item['id'] = $cxx['id']; - } - else - { - $guiObj->operation = 'doCreate'; - $guiObj->item['id'] = 0; - } - - $guiObj->item['name'] = $argsObj->name; - $guiObj->item['type'] = $argsObj->type; - $guiObj->item['cfg'] = $argsObj->cfg; - $guiObj->item['implementation'] = - $this->codeTrackerMgr->getImplementationForType($argsObj->type); - - $class2create = $guiObj->item['implementation']; - $cts = new $class2create($argsObj->type,$argsObj->cfg,$argsObj->name); - $guiObj->connectionStatus = $cts->isConnected() ? 'ok' : 'ko'; - - return $guiObj; - } - -} // end class +db = $dbHandler; + $this->codeTrackerMgr = new tlCodeTracker($dbHandler); + $this->entitySpec = $this->codeTrackerMgr->getEntitySpec(); + + $this->grants = new stdClass(); + $this->grants->canManage = false; + + $this->guiOpWhiteList = array_flip( + array( + 'checkConnection', + 'create', + 'edit', + 'delete', + 'doCreate', + 'doUpdate', + 'doDelete' + )); + } + + public function setTemplateCfg($cfg) + { + $this->templateCfg = $cfg; + } + + public function getGuiOpWhiteList() + { + return $this->guiOpWhiteList; + } + + /** + */ + public function initGuiBean(&$argsObj, $caller) + { + $obj = new stdClass(); + $obj->action = $caller; + $obj->typeDomain = $this->codeTrackerMgr->getTypes(); + $obj->canManage = $argsObj->currentUser->hasRight($this->db, + 'codetracker_management'); + $obj->user_feedback = array( + 'type' => '', + 'message' => '' + ); + + $obj->l18n = init_labels( + array( + 'codetracker_management' => null, + 'btn_save' => null, + 'create' => null, + 'edit' => null, + 'checkConnection' => 'btn_check_connection', + 'codetracker_deleted' => null + )); + + // we experiment on way to get Action Description for GUI using __FUNCTION__ + $obj->l18n['doUpdate'] = $obj->l18n['edit']; + $obj->l18n['doCreate'] = $obj->l18n['create']; + $obj->l18n['doDelete'] = ''; + $obj->main_descr = $obj->l18n['codetracker_management']; + $obj->action_descr = ucfirst($obj->l18n[$caller]); + $obj->connectionStatus = ''; + + switch ($caller) { + case 'delete': + case 'doDelete': + $obj->submit_button_label = ''; + break; + + default: + $obj->submit_button_label = $obj->l18n['btn_save']; + break; + } + + return $obj; + } + + /** + */ + public function create(&$argsObj, $request, $caller = null) + { + $guiObj = $this->initGuiBean($argsObj, + (is_null($caller) ? __FUNCTION__ : $caller)); + $templateCfg = templateConfiguration('codeTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'codetracker_management'); + + $guiObj->item = array( + 'id' => 0 + ); + foreach ($this->entitySpec as $property => $type) { + $guiObj->item[$property] = ($type == 'int') ? 0 : ''; + } + return $guiObj; + } + + /** + */ + public function doCreate(&$argsObj, $request) + { + $guiObj = $this->create($argsObj, $request, __FUNCTION__); + + // Checks are centralized on create() + $ct = new stdClass(); + foreach ($this->entitySpec as $property => $type) { + $ct->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $ct; + + $op = $this->codeTrackerMgr->create($ct); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "codeTrackerView.php"; + } else { + $templateCfg = templateConfiguration('codeTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->user_feedback['message'] = $op['msg']; + } + + return $guiObj; + } + + /* + * function: edit + * + * args: + * + * returns: + * + */ + public function edit(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $templateCfg = templateConfiguration('codeTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + + $guiObj->item = $this->codeTrackerMgr->getByID($argsObj->id); + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'codetracker_management'); + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $ct = new stdClass(); + $ct->id = $argsObj->id; + foreach ($this->entitySpec as $property => $type) { + $ct->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $ct; + + $op = $this->codeTrackerMgr->update($ct); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "codeTrackerView.php"; + } else { + $guiObj->user_feedback['message'] = $op['msg']; + $guiObj->template = null; + } + + return $guiObj; + } + + /** + */ + public function doDelete(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $this->codeTrackerMgr->delete($argsObj->id); + + $guiObj->action = 'doDelete'; + $guiObj->template = "codeTrackerView.php?"; + + return $guiObj; + } + + /** + */ + public function checkConnection(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'codetracker_management'); + + $tplCfg = templateConfiguration('codeTrackerEdit'); + $guiObj->template = $tplCfg->default_template; + + if ($argsObj->id > 0) { + $cxx = $this->codeTrackerMgr->getByID($argsObj->id); + $guiObj->item['id'] = $cxx['id']; + } else { + $guiObj->operation = 'doCreate'; + $guiObj->item['id'] = 0; + } + + $guiObj->item['name'] = $argsObj->name; + $guiObj->item['type'] = $argsObj->type; + $guiObj->item['cfg'] = $argsObj->cfg; + $guiObj->item['implementation'] = $this->codeTrackerMgr->getImplementationForType( + $argsObj->type); + + $class2create = $guiObj->item['implementation']; + $cts = new $class2create($argsObj->type, $argsObj->cfg, $argsObj->name); + $guiObj->connectionStatus = $cts->isConnected() ? 'ok' : 'ko'; + + return $guiObj; + } +} diff --git a/lib/codetrackers/codeTrackerEdit.php b/lib/codetrackers/codeTrackerEdit.php index b88a3efa0b..85e0156aca 100755 --- a/lib/codetrackers/codeTrackerEdit.php +++ b/lib/codetrackers/codeTrackerEdit.php @@ -1,185 +1,210 @@ -doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) -{ - $op = $commandMgr->$pFn($args,$_REQUEST); -} - -renderGui($db,$args,$gui,$op,$templateCfg); - - - - -/** - */ -function renderGui(&$dbHandler,&$argsObj,$guiObj,$opObj,$templateCfg) -{ - $smartyObj = new TLSmarty(); - $renderType = 'none'; - - // key: gui action - // value: next gui action (used to set value of action button on gui) - $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doCreate' => 'doCreate', - 'doUpdate' => 'doUpdate', - 'checkConnection' => 'doCreate'); - - if($argsObj->id > 0) - { - $actionOperation['checkConnection'] = 'doUpdate'; - } - - // Get rendering type and set variable for template - switch($argsObj->doAction) - { - case "edit": - case "create": - case "doDelete": - case "doCreate": - case "doUpdate": - case "checkConnection": - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) - { - $guiObj->$key = $value; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - $renderType = 'redirect'; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - $pos = strpos($tpl, '.php'); - if($pos === false) - { - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = $tplDir . $tpl; - $renderType = 'template'; - } - break; - } - - // execute rendering - // new dBug($tpl); - // new dBug($guiObj); - - switch($renderType) - { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } -} - -/** - * - */ -function initScript(&$dbHandler) { - $mgr = new codeTrackerCommands($dbHandler); - $args = init_args(array('doAction' => $mgr->getGuiOpWhiteList())); - $gui = initializeGui($dbHandler,$args,$mgr); - return array($args,$gui,$mgr); -} - -/** - * @return object returns the arguments for the page - */ -function init_args($whiteList) { - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - $iParams = array("id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,20), - "name" => array(tlInputParameter::STRING_N,0,100), - "cfg" => array(tlInputParameter::STRING_N,0,2000), - "type" => array(tlInputParameter::INT_N)); - - R_PARAMS($iParams,$args); - - // sanitize via whitelist - foreach($whiteList as $inputKey => $allowedValues) { - if( property_exists($args,$inputKey) ) { - if( !isset($allowedValues[$args->$inputKey]) ) { - $msg = "Input parameter $inputKey - white list validation failure - " . - "Value:" . $args->$inputKey . " - " . - "File: " . basename(__FILE__) . " - Function: " . __FUNCTION__ ; - tLog($msg,'ERROR'); - throw new Exception($msg); - } - } - } - - $args->currentUser = $_SESSION['currentUser']; - - return $args; -} - - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,&$commandMgr) -{ - $gui = new stdClass(); - $gui->main_descr = ''; - $gui->action_descr = ''; - $gui->user_feedback = array('type' => '', 'message' => ''); - $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler,'mgt_view_events'); - - // get affected test projects - $gui->testProjectSet = null; - if($argsObj->id > 0) - { - - // just to fix erroneous test project delete - $dummy = $commandMgr->codeTrackerMgr->getLinks($argsObj->id,array('getDeadLinks' => true)); - if( !is_null($dummy) ) - { - foreach($dummy as $key => $elem) - { - $commandMgr->codeTrackerMgr->unlink($argsObj->id,$key); - } - } - - // Now get good info - $gui->testProjectSet = $commandMgr->codeTrackerMgr->getLinks($argsObj->id); - } - return $gui; -} - - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'codetracker_management'); -} +doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_REQUEST); +} + +renderGui($db, $args, $gui, $op, $templateCfg); + +/** + */ +function renderGui(&$dbHandler, &$argsObj, $guiObj, $opObj, $templateCfg) +{ + $smartyObj = new TLSmarty(); + $renderType = 'none'; + + // key: gui action + // value: next gui action (used to set value of action button on gui) + $actionOperation = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'checkConnection' => 'doCreate' + ); + + if ($argsObj->id > 0) { + $actionOperation['checkConnection'] = 'doUpdate'; + } + + // Get rendering type and set variable for template + switch ($argsObj->doAction) { + case "edit": + case "create": + case "doDelete": + case "doCreate": + case "doUpdate": + case "checkConnection": + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + $renderType = 'redirect'; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = $tplDir . $tpl; + $renderType = 'template'; + } + break; + } + + // execute rendering + // new dBug($tpl); + // new dBug($guiObj); + + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/** + */ +function initScript(&$dbHandler) +{ + $mgr = new codeTrackerCommands($dbHandler); + $args = initArgs(array( + 'doAction' => $mgr->getGuiOpWhiteList() + )); + $gui = initializeGui($dbHandler, $args, $mgr); + return array( + $args, + $gui, + $mgr + ); +} + +/** + * + * @return object returns the arguments for the page + */ +function initArgs($whiteList) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "name" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "cfg" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ), + "type" => array( + tlInputParameter::INT_N + ) + ); + + R_PARAMS($iParams, $args); + + // sanitize via whitelist + foreach ($whiteList as $inputKey => $allowedValues) { + if (property_exists($args, $inputKey) && + ! isset($allowedValues[$args->$inputKey])) { + $msg = "Input parameter $inputKey - white list validation failure - " . + "Value:" . $args->$inputKey . " - " . "File: " . + basename(__FILE__) . " - Function: " . __FUNCTION__; + tLog($msg, 'ERROR'); + throw new Exception($msg); + } + } + + $args->currentUser = $_SESSION['currentUser']; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, &$commandMgr) +{ + $gui = new stdClass(); + $gui->main_descr = ''; + $gui->action_descr = ''; + $gui->user_feedback = array( + 'type' => '', + 'message' => '' + ); + $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler, + 'mgt_view_events'); + + // get affected test projects + $gui->testProjectSet = null; + if ($argsObj->id > 0) { + + // just to fix erroneous test project delete + $dummy = $commandMgr->codeTrackerMgr->getLinks($argsObj->id, + array( + 'getDeadLinks' => true + )); + if (! is_null($dummy)) { + foreach ($dummy as $key => $elem) { + $commandMgr->codeTrackerMgr->unlink($argsObj->id, $key); + } + } + + // Now get good info + $gui->testProjectSet = $commandMgr->codeTrackerMgr->getLinks( + $argsObj->id); + } + return $gui; +} + +/** + * + * @param database $db + * the database connection handle + * @param tlUser $user + * the current active user + * + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'codetracker_management'); +} ?> diff --git a/lib/codetrackers/codeTrackerView.php b/lib/codetrackers/codeTrackerView.php index e06cccf170..6f611059cd 100755 --- a/lib/codetrackers/codeTrackerView.php +++ b/lib/codetrackers/codeTrackerView.php @@ -1,71 +1,76 @@ -items = $codeTrackerMgr->getAll(array('output' => 'add_link_count', 'checkEnv' => true)); -$gui->canManage = $args->currentUser->hasRight($db,"codetracker_management"); -$gui->user_feedback = $args->user_feedback; - -if($args->id > 0) -{ - $gui->items[$args->id]['connection_status'] = $codeTrackerMgr->checkConnection($args->id) ? 'ok' : 'ko'; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * @return object returns the arguments for the page - */ -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - - if( $args->tproject_id == 0 ) - { - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - } - $args->currentUser = $_SESSION['currentUser']; - - $args->user_feedback = array('type' => '', 'message' => ''); - - // only way I've found in order to give feedback for delete - // need to undertand if we really need/want to do all this mess - // $args->user_feedback = array('type' => '', 'message' => ''); - // if( isset($_SESSION['codeTrackerView.user_feedback']) ) - // { - // $args->user_feedback = array('type' => '', 'message' => $_SESSION['codeTrackerView.user_feedback']); - // unset($_SESSION['codeTrackerView.user_feedback']); - // } - - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - return $args; -} - - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"codetracker_view") || $user->hasRight($db,"codetracker_management"); +items = $codeTrackerMgr->getAll( + array( + 'output' => 'add_link_count', + 'checkEnv' => true + )); +$gui->canManage = $args->currentUser->hasRight($db, "codetracker_management"); +$gui->user_feedback = $args->user_feedback; + +if ($args->id > 0) { + $gui->items[$args->id]['connection_status'] = $codeTrackerMgr->checkConnection( + $args->id) ? 'ok' : 'ko'; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return object returns the arguments for the page + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + } + $args->currentUser = $_SESSION['currentUser']; + + $args->user_feedback = array( + 'type' => '', + 'message' => '' + ); + + // only way I've found in order to give feedback for delete + // need to undertand if we really need/want to do all this mess + // $args->user_feedback = array('type' => '', 'message' => ''); + // if( isset($_SESSION['codeTrackerView.user_feedback']) ) + // { + // $args->user_feedback = array('type' => '', 'message' => $_SESSION['codeTrackerView.user_feedback']); + // unset($_SESSION['codeTrackerView.user_feedback']); + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + return $args; +} + +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "codetracker_view") || + $user->hasRight($db, "codetracker_management"); } diff --git a/lib/events/eventinfo.php b/lib/events/eventinfo.php index 90da87153e..b6af0beca0 100644 --- a/lib/events/eventinfo.php +++ b/lib/events/eventinfo.php @@ -1,66 +1,68 @@ -id) -{ - $event = new tlEvent($args->id); - if ($event->readFromDB($db,tlEvent::TLOBJ_O_GET_DETAIL_TRANSACTION) >= tl::OK) - { - $user = new tlUser($event->userID); - if ($user->readFromDB($db) < tl::OK) - { - $user = null; - } - } - else - { - $event = null; - } -} - -$smarty = new TLSmarty(); -$smarty->assign("event",$event); -$smarty->assign("user",$user); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - * @return object returns the arguments of the page - */ -function init_args() -{ - $iParams = array("id" => array(tlInputParameter::INT_N)); - $args = new stdClass(); - P_PARAMS($iParams,$args); - - return $args; -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) -{ - return ($user->hasRight($db,"mgt_view_events")) ? true : false; -} \ No newline at end of file +id) { + $event = new tlEvent($args->id); + if ($event->readFromDB($db, tlEvent::TLOBJ_O_GET_DETAIL_TRANSACTION) >= + tl::OK) { + $user = new tlUser($event->userID); + if ($user->readFromDB($db) < tl::OK) { + $user = null; + } + } else { + $event = null; + } +} + +$smarty = new TLSmarty(); +$smarty->assign("event", $event); +$smarty->assign("user", $user); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return object returns the arguments of the page + */ +function initArgs() +{ + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ) + ); + $args = new stdClass(); + P_PARAMS($iParams, $args); + + return $args; +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return ($user->hasRight($db, "mgt_view_events")) ? true : false; +} diff --git a/lib/events/eventviewer.php b/lib/events/eventviewer.php index c67b8bf32a..565fbc3736 100644 --- a/lib/events/eventviewer.php +++ b/lib/events/eventviewer.php @@ -1,276 +1,331 @@ -doAction) -{ - case 'clear': - // Ability to delete events from selected class from event logs - $g_tlLogger->deleteEventsFor($args->logLevel); - if( is_null($args->logLevel) ) - { - logAuditEvent(TLS("audit_all_events_deleted",$args->currentUser->login),"DELETE",null,"events"); - } - else - { - $logLevelVerbose = null; - foreach( $args->logLevel as $code ) - { - $logLevelVerbose[] = $gui->logLevels[$code]; - } - $logLevelVerbose = implode(',',$logLevelVerbose); - logAuditEvent(TLS("audit_events_with_level_deleted",$args->currentUser->login,$logLevelVerbose),"DELETE",null,"events"); - } - - // reset filters after clearing events - $args->logLevel = null; - $gui->selectedLogLevels = array(); - $gui->selectedTesters = array(); - $gui->startDate = null; - $gui->endDate = null; - break; - - case 'filter': - default: - $filters = getFilters($args,$date_format_cfg); - break; -} - -$gui->events = $g_tlLogger->getEventsFor($args->logLevel,$args->object_id ? $args->object_id : null, - $args->object_type ? $args->object_type : null,null,500,$filters->startTime, - $filters->endTime,$filters->users); - -if (count($gui->events) > 0) -{ - $table = buildExtTable($gui, $show_icon, $charset); - if (!is_null($table)) - { - $gui->tableSet[] = $table; - } -} -else -{ - $gui->warning_msg = lang_get("no_events"); -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - * @return object returns the arguments of the page - */ -function init_args() -{ - $iParams = array("startDate" => array("POST",tlInputParameter::STRING_N,0,10), - "endDate" => array("POST",tlInputParameter::STRING_N,0,10), - "doAction" => array("POST",tlInputParameter::STRING_N,0,100), - "object_id" => array("REQUEST",tlInputParameter::INT_N), - "object_type" => array("REQUEST",tlInputParameter::STRING_N,0,15), - "logLevel" => array("POST",tlInputParameter::ARRAY_INT), - "testers" => array("REQUEST",tlInputParameter::ARRAY_INT)); - - $args = new stdClass(); - I_PARAMS($iParams,$args); - $args->currentUser = $_SESSION['currentUser']; - return $args; -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user,$action) -{ - $checkStatus = $user->hasRight($db,"mgt_view_events"); - if( !$checkStatus ) - { - $iParams = array("doAction" => array(tlInputParameter::STRING_N,0,100)); - $rParams = R_PARAMS($iParams); - if ($rParams["doAction"] == 'clear') - { - $checkStatus = $user->hasRight($db,'events_mgt'); - } - } - return $checkStatus; -} - - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj) -{ - $gui = new stdClass(); - $gui->logLevels = array(tlLogger::AUDIT => lang_get("log_level_AUDIT"), - tlLogger::ERROR => lang_get("log_level_ERROR"), - tlLogger::WARNING => lang_get("log_level_WARNING"), - tlLogger::INFO => lang_get("log_level_INFO"), - tlLogger::DEBUG => lang_get("log_level_DEBUG"), - tlLogger::L18N => lang_get("log_level_L18N")); - - $gui->allusers = tlUser::getAll($dbHandler); // THIS IS AN OVERKILL because get ALL USER OBJECTS - $gui->testers = getUsersForHtmlOptions($dbHandler,null,null,true,$gui->allusers); - $gui->users = getUsersForHtmlOptions($dbHandler); - $gui->users[0] = false; - - $gui->startDate=$argsObj->startDate; - $gui->endDate=$argsObj->endDate; - $gui->object_id=$argsObj->object_id; - $gui->object_type=$argsObj->object_type; - - $gui->selectedLogLevels = ($argsObj->logLevel ? array_values($argsObj->logLevel) : array()); - $gui->selectedTesters = ($argsObj->testers ? array_values($argsObj->testers) : array()); - - $gui->canDelete = $argsObj->currentUser->hasRight($dbHandler,"events_mgt"); - - $gui->warning_msg = ""; - $gui->tableSet = null; - - return $gui; -} - - -/** - * - * - */ -function getFilters(&$argsObj=null,$dateFormat=null) -{ - $filters = new stdClass(); - $filters->startTime = null; - $filters->endTime = null; - $filters->users = null; - - if( !is_null($argsObj) ) - { - if ($argsObj->startDate != "") - { - $date_array = split_localized_date($argsObj->startDate, $dateFormat); - if ($date_array != null) { - // convert localized date to date that strtotime understands -> en_US: m/d/Y: - $filters->startTime = strToTime($date_array['month'] . "/" . $date_array['day']. "/" .$date_array['year']); - } - if ($filters->startTime == "") - { - $filters->startTime = null; - } - } - - if ($argsObj->endDate != "") - { - $date_array = split_localized_date($argsObj->endDate, $dateFormat); - if ($date_array != null) { - // convert localized date to date that strtotime understands -> en_US: m/d/Y: - // end time must end at selected day at 23:59:59 - $filters->endTime = strToTime($date_array['month'] . "/" . $date_array['day']. "/" . - $date_array['year'] . ", 23:59:59"); - } - if (!$filters->endTime) - { - $filters->endTime = null; - } - } - - if (!is_null($argsObj->testers)) - { - $filters->users = implode(",",$argsObj->testers); - if (!$filters->users) - { - $filters->users = null; - } - } - } - - return $filters; -} - -/** - * - * - */ -function buildExtTable($gui,$show_icon,$charset) -{ - $table = null; - if(count($gui->events) > 0) - { - $columns = array(); - $columns[] = array('title_key' => 'th_timestamp', 'width' => 15); - $columns[] = array('title_key' => 'th_loglevel', 'width' => 15); - $columns[] = array('title_key' => 'th_user', 'width' => 15); - $columns[] = array('title_key' => 'th_event_description','type' => 'text'); - $columns[] = array('title_key' => 'th_transaction', 'width' => 15, 'hidden' => 'true'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - foreach ($gui->events as $event_key => $event) - { - $transactionID = $event->transactionID; - - $rowData = array(); - - // necessary as localize_dateOrTimeStamp expects 2nd parameter to pass by reference - $dummy = null; - // use html comment to sort properly by timestamp - $rowData[] = "" . - localize_dateOrTimeStamp(null, $dummy, 'timestamp_format',$event->timestamp); - - $rowData[] = $event->getlogLevel(); - - if (isset($event->userID) && $event->userID != false && isset($gui->users[$event->userID])) { - $rowData[] = $gui->users[$event->userID]; - } else { - $rowData[] = lang_get("not_aplicable"); - } - $description = htmlentities($event->description, ENT_QUOTES, $charset); - $rowData[] = "" . - "dbID});\" style=\"cursor: hand; cursor: pointer;\">" . - " " . - $description; - - $rowData[] = $event->transactionID; - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_eventviewer'); - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - - $table->setGroupByColumnName(lang_get('th_loglevel')); - $table->setSortByColumnName(lang_get('th_timestamp')); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - } - return($table); +doAction) { + case 'clear': + // Ability to delete events from selected class from event logs + $g_tlLogger->deleteEventsFor($args->logLevel); + if (is_null($args->logLevel)) { + logAuditEvent( + TLS("audit_all_events_deleted", $args->currentUser->login), + "DELETE", null, "events"); + } else { + $logLevelVerbose = null; + foreach ($args->logLevel as $code) { + $logLevelVerbose[] = $gui->logLevels[$code]; + } + $logLevelVerbose = implode(',', $logLevelVerbose); + logAuditEvent( + TLS("audit_events_with_level_deleted", $args->currentUser->login, + $logLevelVerbose), "DELETE", null, "events"); + } + + // reset filters after clearing events + $args->logLevel = null; + $gui->selectedLogLevels = array(); + $gui->selectedTesters = array(); + $gui->startDate = null; + $gui->endDate = null; + break; + + case 'filter': + default: + $filters = getFilters($args, $date_format_cfg); + break; +} + +$gui->events = $g_tlLogger->getEventsFor($args->logLevel, + $args->object_id ? $args->object_id : null, + $args->object_type ? $args->object_type : null, null, 500, + $filters->startTime, $filters->endTime, $filters->users); + +if (! empty($gui->events)) { + $table = buildExtTable($gui, $show_icon, $charset); + if (! is_null($table)) { + $gui->tableSet[] = $table; + } +} else { + $gui->warning_msg = lang_get("no_events"); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return object returns the arguments of the page + */ +function initArgs() +{ + $iParams = array( + "startDate" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 10 + ), + "endDate" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 10 + ), + "doAction" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 100 + ), + "object_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "object_type" => array( + "REQUEST", + tlInputParameter::STRING_N, + 0, + 15 + ), + "logLevel" => array( + "POST", + tlInputParameter::ARRAY_INT + ), + "testers" => array( + "REQUEST", + tlInputParameter::ARRAY_INT + ) + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + $args->currentUser = $_SESSION['currentUser']; + return $args; +} + +/** + * Checks the user rights for viewing the page + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + $checkStatus = $user->hasRight($db, "mgt_view_events"); + if (! $checkStatus) { + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + $rParams = R_PARAMS($iParams); + if ($rParams["doAction"] == 'clear') { + $checkStatus = $user->hasRight($db, 'events_mgt'); + } + } + return $checkStatus; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $gui = new stdClass(); + $gui->logLevels = array( + tlLogger::AUDIT => lang_get("log_level_AUDIT"), + tlLogger::ERROR => lang_get("log_level_ERROR"), + tlLogger::WARNING => lang_get("log_level_WARNING"), + tlLogger::INFO => lang_get("log_level_INFO"), + tlLogger::DEBUG => lang_get("log_level_DEBUG"), + tlLogger::L18N => lang_get("log_level_L18N") + ); + + $gui->allusers = tlUser::getAll($dbHandler); // THIS IS AN OVERKILL because get ALL USER OBJECTS + $gui->testers = getUsersForHtmlOptions($dbHandler, null, null, true, + $gui->allusers); + $gui->users = getUsersForHtmlOptions($dbHandler); + $gui->users[0] = false; + + $gui->startDate = $argsObj->startDate; + $gui->endDate = $argsObj->endDate; + $gui->object_id = $argsObj->object_id; + $gui->object_type = $argsObj->object_type; + + $gui->selectedLogLevels = ($argsObj->logLevel ? array_values( + $argsObj->logLevel) : array()); + $gui->selectedTesters = ($argsObj->testers ? array_values($argsObj->testers) : array()); + + $gui->canDelete = $argsObj->currentUser->hasRight($dbHandler, "events_mgt"); + + $gui->warning_msg = ""; + $gui->tableSet = null; + + return $gui; +} + +/** + * + * @param stdClass $argsObj + * @param string $dateFormat + * @return stdClass + */ +function getFilters(&$argsObj = null, $dateFormat = null) +{ + $filters = new stdClass(); + $filters->startTime = null; + $filters->endTime = null; + $filters->users = null; + + if (! is_null($argsObj)) { + if ($argsObj->startDate != "") { + $date_array = split_localized_date($argsObj->startDate, $dateFormat); + if ($date_array != null) { + // convert localized date to date that strtotime understands -> en_US: m/d/Y: + $filters->startTime = strToTime( + $date_array['month'] . "/" . $date_array['day'] . "/" . + $date_array['year']); + } + if ($filters->startTime == "") { + $filters->startTime = null; + } + } + + if ($argsObj->endDate != "") { + $date_array = split_localized_date($argsObj->endDate, $dateFormat); + if ($date_array != null) { + // convert localized date to date that strtotime understands -> en_US: m/d/Y: + // end time must end at selected day at 23:59:59 + $filters->endTime = strToTime( + $date_array['month'] . "/" . $date_array['day'] . "/" . + $date_array['year'] . ", 23:59:59"); + } + if (! $filters->endTime) { + $filters->endTime = null; + } + } + + if (! is_null($argsObj->testers)) { + $filters->users = implode(",", $argsObj->testers); + if (! $filters->users) { + $filters->users = null; + } + } + } + + return $filters; +} + +/** + * + * @param stdClass $gui + * @param string $show_icon + * @param string $charset + * @return tlExtTable + */ +function buildExtTable($gui, $show_icon, $charset) +{ + $table = null; + if (! empty($gui->events)) { + $columns = array(); + $columns[] = array( + 'title_key' => 'th_timestamp', + 'width' => 15 + ); + $columns[] = array( + 'title_key' => 'th_loglevel', + 'width' => 15 + ); + $columns[] = array( + 'title_key' => 'th_user', + 'width' => 15 + ); + $columns[] = array( + 'title_key' => 'th_event_description', + 'type' => 'text' + ); + $columns[] = array( + 'title_key' => 'th_transaction', + 'width' => 15, + 'hidden' => 'true' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + foreach ($gui->events as $event) { + $rowData = array(); + + // necessary as localize_dateOrTimeStamp expects 2nd parameter to pass by reference + $dummy = null; + // use html comment to sort properly by timestamp + $rowData[] = "" . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $event->timestamp); + + $rowData[] = $event->getlogLevel(); + + if (isset($event->userID) && $event->userID && + isset($gui->users[$event->userID])) { + $rowData[] = $gui->users[$event->userID]; + } else { + $rowData[] = lang_get("not_aplicable"); + } + $description = htmlentities($event->description, ENT_QUOTES, + $charset); + $rowData[] = "" . + "dbID});\" style=\"cursor: hand; cursor: pointer;\">" . + " " . $description; + + $rowData[] = $event->transactionID; + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_eventviewer'); + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + $table->setGroupByColumnName(lang_get('th_loglevel')); + $table->setSortByColumnName(lang_get('th_timestamp')); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + } + return $table; } diff --git a/lib/execute/bugAdd.php b/lib/execute/bugAdd.php index df8c996361..f56b3863df 100644 --- a/lib/execute/bugAdd.php +++ b/lib/execute/bugAdd.php @@ -1,343 +1,422 @@ -user_action == 'create' || $args->user_action == 'doCreate') && - $gui->issueTrackerCfg->tlCanCreateIssue) { - // get matadata - $gui->issueTrackerMetaData = getIssueTrackerMetaData($its); - - switch($args->user_action) { - case 'create': - $dummy = generateIssueText($db,$args,$its); - $gui->bug_summary = $dummy->summary; - break; - - case 'doCreate': - $args->direct_link = getDirectLinkToExec($db,$args->exec_id); - - $dummy = generateIssueText($db,$args,$its); - $gui->bug_summary = $dummy->summary; - - $aop = array('addLinkToTL' => $args->addLinkToTL, - 'addLinkToTLPrintView' => $args->addLinkToTLPrintView); - - $ret = addIssue($db,$args,$its,$aop); - $gui->issueTrackerCfg->tlCanCreateIssue = $ret['status_ok']; - $gui->msg = $ret['msg']; - break; - - } -} -else if($args->user_action == 'link' || $args->user_action == 'add_note') { - // Well do not think is very elegant to check for $args->bug_id != "" - // to understand if user has pressed ADD Button - if(!is_null($issueT) && $args->bug_id != "") { - $l18n = init_labels(array("error_wrong_BugID_format" => null,"error_bug_does_not_exist_on_bts" => null)); - - switch($args->user_action) { - case 'link': - $gui->msg = $l18n["error_wrong_BugID_format"]; - if ($its->checkBugIDSyntax($args->bug_id)) { - $bugID = $its->normalizeBugID($args->bug_id); - if ($its->checkBugIDExistence($bugID)) { - if (write_execution_bug($db,$args->exec_id, $bugID,$args->tcstep_id)) { - $gui->msg = lang_get("bug_added"); - logAuditEvent(TLS("audit_executionbug_added",$args->bug_id),"CREATE",$args->exec_id,"executions"); - - // blank notes will not be added :). - if($gui->issueTrackerCfg->tlCanAddIssueNote) { - $hasNotes = (strlen($gui->bug_notes) > 0); - // will do call to update issue Notes - if($args->addLinkToTL || $args->addLinkToTLPrintView) { - $args->direct_link = getDirectLinkToExec($db,$args->exec_id); - - $aop = array('addLinkToTL' => $args->addLinkToTL, - 'addLinkToTLPrintView' => $args->addLinkToTLPrintView); - - $dummy = generateIssueText($db,$args,$its,$aop); - $gui->bug_notes = $dummy->description; - } - - if( $args->addLinkToTL || $args->addLinkToTLPrintView || - $hasNotes ) { - $opt = new stdClass(); - $opt->reporter = $args->user->login; - $opt->reporter_email = trim($args->user->emailAddress); - if( '' == $opt->reporter_email ) { - $opt->reporter_email = $opt->reporter; - } - - $its->addNote($bugID,$gui->bug_notes,$opt); - } - } - } - } else { - $gui->msg = sprintf($l18n["error_bug_does_not_exist_on_bts"],$gui->bug_id); - } - } - break; - - case 'add_note': - // blank notes will not be added :). - $gui->msg = ''; - if($gui->issueTrackerCfg->tlCanAddIssueNote && (strlen($gui->bug_notes) > 0) ) { - $opt = new stdClass(); - $opt->reporter = $args->user->login; - $opt->reporter_email = trim($args->user->emailAddress); - if( '' == $opt->reporter_email ) { - $opt->reporter_email = $opt->reporter; - } - - $ope = $its->addNote($args->bug_id,$gui->bug_notes,$opt); - - if( !$ope['status_ok'] ) { - $gui->msg = $ope['msg']; - } - } - break; - } - } -} -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); - -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * - * - */ -function initEnv(&$dbHandler) -{ - $uaWhiteList = array(); - $uaWhiteList['elements'] = array('link','create','doCreate','add_note'); - $uaWhiteList['lenght'] = array(); - foreach ($uaWhiteList['elements'] as $xmen) { - $uaWhiteList['lenght'][] = strlen($xmen); - } - $user_action['maxLengh'] = max($uaWhiteList['lenght']); - $user_action['minLengh'] = min($uaWhiteList['lenght']); - - $iParams = array("exec_id" => array("GET",tlInputParameter::INT_N), - "bug_id" => array("REQUEST",tlInputParameter::STRING_N), - "tproject_id" => array("REQUEST",tlInputParameter::INT_N), - "tplan_id" => array("REQUEST",tlInputParameter::INT_N), - "tcversion_id" => array("REQUEST",tlInputParameter::INT_N), - "bug_notes" => array("POST",tlInputParameter::STRING_N), - "issueType" => array("POST",tlInputParameter::INT_N), - "issuePriority" => array("POST",tlInputParameter::INT_N), - "artifactComponent" => array("POST",tlInputParameter::ARRAY_INT), - "artifactVersion" => array("POST",tlInputParameter::ARRAY_INT), - "user_action" => array("REQUEST",tlInputParameter::STRING_N, - $user_action['minLengh'],$user_action['maxLengh']), - "addLinkToTL" => array("POST",tlInputParameter::CB_BOOL), - "addLinkToTLPrintView" => array("POST",tlInputParameter::CB_BOOL), - "tcstep_id" => array("REQUEST",tlInputParameter::INT_N),); - - $args = new stdClass(); - I_PARAMS($iParams,$args); - if ($args->exec_id) { - $_SESSION['bugAdd_execID'] = intval($args->exec_id); - } - else { - $args->exec_id = intval(isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0); - } - - // it's a checkbox - $args->addLinkToTL = isset($_REQUEST['addLinkToTL']); - $args->addLinkToTLPrintView = isset($_REQUEST['addLinkToTLPrintView']); - - $args->user = $_SESSION['currentUser']; - - $gui = new stdClass(); - $cfg = config_get('exec_cfg'); - $gui->addLinkToTLChecked = $cfg->exec_mode->addLinkToTLChecked; - $gui->addLinkToTLPrintViewChecked = - $cfg->exec_mode->addLinkToTLPrintViewChecked; - - - switch($args->user_action) { - case 'create': - case 'doCreate': - $gui->pageTitle = lang_get('create_issue'); - break; - - case 'add_note': - $gui->pageTitle = lang_get('add_issue_note'); - break; - - case 'link': - default: - $gui->pageTitle = lang_get('title_bug_add'); - break; - } - - $gui->msg = ''; - $gui->bug_summary = ''; - $gui->tproject_id = $args->tproject_id; - $gui->tplan_id = $args->tplan_id; - $gui->tcversion_id = $args->tcversion_id; - $gui->tcstep_id = $args->tcstep_id; - - $gui->user_action = $args->user_action; - $gui->bug_id = $args->bug_id; - - - - // --------------------------------------------------------------- - // Special processing - list($itObj,$itCfg) = getIssueTracker($dbHandler,$args,$gui); - $itsDefaults = $itObj->getCfg(); - - $gui->issueType = $args->issueType; - $gui->issuePriority = $args->issuePriority; - $gui->artifactVersion = $args->artifactVersion; - $gui->artifactComponent = $args->artifactComponent; - $gui->issueTrackerCfg->editIssueAttr = $itsDefaults->userinteraction; - - // This code has been verified with JIRA REST - if ($itsDefaults->userinteraction == 0) { - $singleVal = array('issuetype' => 'issueType', - 'issuepriority' => 'issuePriority'); - foreach ($singleVal as $kj => $attr) { - $gui->$attr = $itsDefaults->$kj; - } - - $multiVal = array('version' => 'artifactVersion', - 'component' => 'artifactComponent'); - foreach ($multiVal as $kj => $attr) { - $gui->$attr = (array)$itsDefaults->$kj; - } - } - $gui->allIssueAttrOnScreen = 1; - - // Second access to user input - $bug_summary['minLengh'] = 1; - $bug_summary['maxLengh'] = $itObj->getBugSummaryMaxLength(); - - $inputCfg = array("bug_summary" => array("POST",tlInputParameter::STRING_N, - $bug_summary['minLengh'],$bug_summary['maxLengh'])); - - I_PARAMS($inputCfg,$args); - - $args->bug_id = trim($args->bug_id); - switch ($args->user_action) { - case 'create': - case 'link': - if( $args->bug_id == '' && $args->exec_id > 0) { - $map = get_execution($dbHandler,$args->exec_id); - $args->bug_notes = $map[0]['notes']; - } - break; - - case 'doCreate': - case 'add_note': - default: - break; - } - - $gui->bug_notes = $args->bug_notes = trim($args->bug_notes); - - $args->basehref = $_SESSION['basehref']; - $tables = tlObjectWithDB::getDBTables(array('testplans')); - $sql = ' SELECT api_key FROM ' . $tables['testplans'] . - ' WHERE id=' . intval($args->tplan_id); - - $rs = $dbHandler->get_recordset($sql); - $args->tplan_apikey = $rs[0]['api_key']; - - return array($args,$gui,$itObj,$itCfg); -} - - -/** - * - */ -function getIssueTracker(&$dbHandler,$argsObj,&$guiObj) -{ - $its = null; - $tprojectMgr = new testproject($dbHandler); - $info = $tprojectMgr->get_by_id($argsObj->tproject_id); - - $guiObj->issueTrackerCfg = new stdClass(); - $guiObj->issueTrackerCfg->createIssueURL = null; - $guiObj->issueTrackerCfg->VerboseID = ''; - $guiObj->issueTrackerCfg->VerboseType = ''; - $guiObj->issueTrackerCfg->bugIDMaxLength = 0; - $guiObj->issueTrackerCfg->bugSummaryMaxLength = 100; // MAGIC - $guiObj->issueTrackerCfg->tlCanCreateIssue = false; - $guiObj->issueTrackerCfg->tlCanAddIssueNote = true; - - if($info['issue_tracker_enabled']) { - $it_mgr = new tlIssueTracker($dbHandler); - $issueTrackerCfg = $it_mgr->getLinkedTo($argsObj->tproject_id); - - if( !is_null($issueTrackerCfg) ) { - $its = $it_mgr->getInterfaceObject($argsObj->tproject_id); - - $guiObj->issueTrackerCfg->VerboseType = $issueTrackerCfg['verboseType']; - $guiObj->issueTrackerCfg->VerboseID = $issueTrackerCfg['issuetracker_name']; - $guiObj->issueTrackerCfg->bugIDMaxLength = $its->getBugIDMaxLength(); - $guiObj->issueTrackerCfg->createIssueURL = $its->getEnterBugURL(); - $guiObj->issueTrackerCfg->bugSummaryMaxLength = $its->getBugSummaryMaxLength(); - - $guiObj->issueTrackerCfg->tlCanCreateIssue = method_exists($its,'addIssue'); - $guiObj->issueTrackerCfg->tlCanAddIssueNote = method_exists($its,'addNote'); - } - } - return array($its,$issueTrackerCfg); -} - -/** - * - */ -function getDirectLinkToExec(&$dbHandler,$execID) -{ - $tbk = array('executions','testplan_tcversions'); - $tbl = tlObjectWithDB::getDBTables($tbk); - $sql = " SELECT EX.id,EX.build_id,EX.testplan_id," . - " EX.tcversion_id,TPTCV.id AS feature_id " . - " FROM {$tbl['executions']} EX " . - " JOIN {$tbl['testplan_tcversions']} TPTCV " . - " ON TPTCV.testplan_id=EX.testplan_id " . - " AND TPTCV.tcversion_id=EX.tcversion_id " . - " AND TPTCV.platform_id=EX.platform_id " . - " WHERE EX.id=" . intval($execID); - - $rs = $dbHandler->get_recordset($sql); - $rs = $rs[0]; - $dlk = trim($_SESSION['basehref'],'/') . - "/ltx.php?item=exec&feature_id=" . $rs['feature_id'] . - "&build_id=" . $rs['build_id']; - - return $dlk; -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) { - $hasRights = $user->hasRightOnProj($db,"testplan_execute"); - return $hasRights; -} \ No newline at end of file +user_action == 'create' || $args->user_action == 'doCreate') && + $gui->issueTrackerCfg->tlCanCreateIssue) { + // get matadata + $gui->issueTrackerMetaData = getIssueTrackerMetaData($its); + + switch ($args->user_action) { + case 'create': + $dummy = generateIssueText($db, $args, $its); + $gui->bug_summary = $dummy->summary; + break; + + case 'doCreate': + $args->direct_link = getDirectLinkToExec($db, $args->exec_id); + + $dummy = generateIssueText($db, $args, $its); + $gui->bug_summary = $dummy->summary; + + $aop = array( + 'addLinkToTL' => $args->addLinkToTL, + 'addLinkToTLPrintView' => $args->addLinkToTLPrintView + ); + + $ret = addIssue($db, $args, $its, $aop); + $gui->issueTrackerCfg->tlCanCreateIssue = $ret['status_ok']; + $gui->msg = $ret['msg']; + break; + } +} elseif ($args->user_action == 'link' || $args->user_action == 'add_note') { + // Well do not think is very elegant to check for $args->bug_id != "" + // to understand if user has pressed ADD Button + if (! is_null($issueT) && $args->bug_id != "") { + $l18n = init_labels( + array( + "error_wrong_BugID_format" => null, + "error_bug_does_not_exist_on_bts" => null + )); + + switch ($args->user_action) { + case 'link': + $gui->msg = $l18n["error_wrong_BugID_format"]; + if ($its->checkBugIDSyntax($args->bug_id)) { + $bugID = $its->normalizeBugID($args->bug_id); + if ($its->checkBugIDExistence($bugID)) { + if (write_execution_bug($db, $args->exec_id, $bugID, + $args->tcstep_id)) { + $gui->msg = lang_get("bug_added"); + logAuditEvent( + TLS("audit_executionbug_added", $args->bug_id), + "CREATE", $args->exec_id, "executions"); + + // blank notes will not be added :). + if ($gui->issueTrackerCfg->tlCanAddIssueNote) { + $hasNotes = (strlen($gui->bug_notes) > 0); + // will do call to update issue Notes + if ($args->addLinkToTL || + $args->addLinkToTLPrintView) { + $args->direct_link = getDirectLinkToExec( + $db, $args->exec_id); + + $aop = array( + 'addLinkToTL' => $args->addLinkToTL, + 'addLinkToTLPrintView' => $args->addLinkToTLPrintView + ); + + $dummy = generateIssueText($db, $args, $its, + $aop); + $gui->bug_notes = $dummy->description; + } + + if ($args->addLinkToTL || + $args->addLinkToTLPrintView || $hasNotes) { + $opt = new stdClass(); + $opt->reporter = $args->user->login; + $opt->reporter_email = trim( + $args->user->emailAddress); + if ('' == $opt->reporter_email) { + $opt->reporter_email = $opt->reporter; + } + + $its->addNote($bugID, $gui->bug_notes, $opt); + } + } + } + } else { + $gui->msg = sprintf( + $l18n["error_bug_does_not_exist_on_bts"], + $gui->bug_id); + } + } + break; + + case 'add_note': + // blank notes will not be added :). + $gui->msg = ''; + if ($gui->issueTrackerCfg->tlCanAddIssueNote && + (strlen($gui->bug_notes) > 0)) { + $opt = new stdClass(); + $opt->reporter = $args->user->login; + $opt->reporter_email = trim($args->user->emailAddress); + if ('' == $opt->reporter_email) { + $opt->reporter_email = $opt->reporter; + } + + $ope = $its->addNote($args->bug_id, $gui->bug_notes, $opt); + + if (! $ope['status_ok']) { + $gui->msg = $ope['msg']; + } + } + break; + } + } +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); + +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initEnv(&$dbHandler) +{ + $uaWhiteList = array(); + $uaWhiteList['elements'] = array( + 'link', + 'create', + 'doCreate', + 'add_note' + ); + $uaWhiteList['lenght'] = array(); + foreach ($uaWhiteList['elements'] as $xmen) { + $uaWhiteList['lenght'][] = strlen($xmen); + } + $user_action['maxLengh'] = max($uaWhiteList['lenght']); + $user_action['minLengh'] = min($uaWhiteList['lenght']); + + $iParams = array( + "exec_id" => array( + "GET", + tlInputParameter::INT_N + ), + "bug_id" => array( + "REQUEST", + tlInputParameter::STRING_N + ), + "tproject_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "tplan_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "tcversion_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "bug_notes" => array( + "POST", + tlInputParameter::STRING_N + ), + "issueType" => array( + "POST", + tlInputParameter::INT_N + ), + "issuePriority" => array( + "POST", + tlInputParameter::INT_N + ), + "artifactComponent" => array( + "POST", + tlInputParameter::ARRAY_INT + ), + "artifactVersion" => array( + "POST", + tlInputParameter::ARRAY_INT + ), + "user_action" => array( + "REQUEST", + tlInputParameter::STRING_N, + $user_action['minLengh'], + $user_action['maxLengh'] + ), + "addLinkToTL" => array( + "POST", + tlInputParameter::CB_BOOL + ), + "addLinkToTLPrintView" => array( + "POST", + tlInputParameter::CB_BOOL + ), + "tcstep_id" => array( + "REQUEST", + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + if ($args->exec_id) { + $_SESSION['bugAdd_execID'] = intval($args->exec_id); + } else { + $args->exec_id = intval( + isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0); + } + + // it's a checkbox + $args->addLinkToTL = isset($_REQUEST['addLinkToTL']); + $args->addLinkToTLPrintView = isset($_REQUEST['addLinkToTLPrintView']); + + $args->user = $_SESSION['currentUser']; + + $gui = new stdClass(); + $cfg = config_get('exec_cfg'); + $gui->addLinkToTLChecked = $cfg->exec_mode->addLinkToTLChecked; + $gui->addLinkToTLPrintViewChecked = $cfg->exec_mode->addLinkToTLPrintViewChecked; + + switch ($args->user_action) { + case 'create': + case 'doCreate': + $gui->pageTitle = lang_get('create_issue'); + break; + + case 'add_note': + $gui->pageTitle = lang_get('add_issue_note'); + break; + + case 'link': + default: + $gui->pageTitle = lang_get('title_bug_add'); + break; + } + + $gui->msg = ''; + $gui->bug_summary = ''; + $gui->tproject_id = $args->tproject_id; + $gui->tplan_id = $args->tplan_id; + $gui->tcversion_id = $args->tcversion_id; + $gui->tcstep_id = $args->tcstep_id; + + $gui->user_action = $args->user_action; + $gui->bug_id = $args->bug_id; + + // --------------------------------------------------------------- + // Special processing + list ($itObj, $itCfg) = getIssueTracker($dbHandler, $args, $gui); + $itsDefaults = $itObj->getCfg(); + + $gui->issueType = $args->issueType; + $gui->issuePriority = $args->issuePriority; + $gui->artifactVersion = $args->artifactVersion; + $gui->artifactComponent = $args->artifactComponent; + $gui->issueTrackerCfg->editIssueAttr = $itsDefaults->userinteraction; + + // This code has been verified with JIRA REST + if ($itsDefaults->userinteraction == 0) { + $singleVal = array( + 'issuetype' => 'issueType', + 'issuepriority' => 'issuePriority' + ); + foreach ($singleVal as $kj => $attr) { + $gui->$attr = $itsDefaults->$kj; + } + + $multiVal = array( + 'version' => 'artifactVersion', + 'component' => 'artifactComponent' + ); + foreach ($multiVal as $kj => $attr) { + $gui->$attr = (array) $itsDefaults->$kj; + } + } + $gui->allIssueAttrOnScreen = 1; + + // Second access to user input + $bug_summary['minLengh'] = 1; + $bug_summary['maxLengh'] = $itObj->getBugSummaryMaxLength(); + + $inputCfg = array( + "bug_summary" => array( + "POST", + tlInputParameter::STRING_N, + $bug_summary['minLengh'], + $bug_summary['maxLengh'] + ) + ); + + I_PARAMS($inputCfg, $args); + + $args->bug_id = trim($args->bug_id); + switch ($args->user_action) { + case 'create': + case 'link': + if ($args->bug_id == '' && $args->exec_id > 0) { + $map = get_execution($dbHandler, $args->exec_id); + $args->bug_notes = $map[0]['notes']; + } + break; + + case 'doCreate': + case 'add_note': + default: + break; + } + + $gui->bug_notes = $args->bug_notes = trim($args->bug_notes); + + $args->basehref = $_SESSION['basehref']; + $tables = tlObjectWithDB::getDBTables(array( + 'testplans' + )); + $sql = ' SELECT api_key FROM ' . $tables['testplans'] . ' WHERE id=' . + intval($args->tplan_id); + + $rs = $dbHandler->get_recordset($sql); + $args->tplan_apikey = $rs[0]['api_key']; + + return array( + $args, + $gui, + $itObj, + $itCfg + ); +} + +/** + */ +function getIssueTracker(&$dbHandler, $argsObj, &$guiObj) +{ + $its = null; + $tprojectMgr = new testproject($dbHandler); + $info = $tprojectMgr->get_by_id($argsObj->tproject_id); + + $guiObj->issueTrackerCfg = new stdClass(); + $guiObj->issueTrackerCfg->createIssueURL = null; + $guiObj->issueTrackerCfg->VerboseID = ''; + $guiObj->issueTrackerCfg->VerboseType = ''; + $guiObj->issueTrackerCfg->bugIDMaxLength = 0; + $guiObj->issueTrackerCfg->bugSummaryMaxLength = 100; // MAGIC + $guiObj->issueTrackerCfg->tlCanCreateIssue = false; + $guiObj->issueTrackerCfg->tlCanAddIssueNote = true; + + if ($info['issue_tracker_enabled']) { + $it_mgr = new tlIssueTracker($dbHandler); + $issueTrackerCfg = $it_mgr->getLinkedTo($argsObj->tproject_id); + + if (! is_null($issueTrackerCfg)) { + $its = $it_mgr->getInterfaceObject($argsObj->tproject_id); + + $guiObj->issueTrackerCfg->VerboseType = $issueTrackerCfg['verboseType']; + $guiObj->issueTrackerCfg->VerboseID = $issueTrackerCfg['issuetracker_name']; + $guiObj->issueTrackerCfg->bugIDMaxLength = $its->getBugIDMaxLength(); + $guiObj->issueTrackerCfg->createIssueURL = $its->getEnterBugURL(); + $guiObj->issueTrackerCfg->bugSummaryMaxLength = $its->getBugSummaryMaxLength(); + + $guiObj->issueTrackerCfg->tlCanCreateIssue = method_exists($its, + 'addIssue'); + $guiObj->issueTrackerCfg->tlCanAddIssueNote = method_exists($its, + 'addNote'); + } + } + return array( + $its, + $issueTrackerCfg + ); +} + +/** + */ +function getDirectLinkToExec(&$dbHandler, $execID) +{ + $tbk = array( + 'executions', + 'testplan_tcversions' + ); + $tbl = tlObjectWithDB::getDBTables($tbk); + $sql = " SELECT EX.id,EX.build_id,EX.testplan_id," . + " EX.tcversion_id,TPTCV.id AS feature_id " . + " FROM {$tbl['executions']} EX " . + " JOIN {$tbl['testplan_tcversions']} TPTCV " . + " ON TPTCV.testplan_id=EX.testplan_id " . + " AND TPTCV.tcversion_id=EX.tcversion_id " . + " AND TPTCV.platform_id=EX.platform_id " . " WHERE EX.id=" . + intval($execID); + + $rs = $dbHandler->get_recordset($sql); + $rs = $rs[0]; + return trim($_SESSION['basehref'], '/') . "/ltx.php?item=exec&feature_id=" . + $rs['feature_id'] . "&build_id=" . $rs['build_id']; +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, "testplan_execute"); +} diff --git a/lib/execute/bugDelete.php b/lib/execute/bugDelete.php index 337e699538..8021b2cabf 100644 --- a/lib/execute/bugDelete.php +++ b/lib/execute/bugDelete.php @@ -1,81 +1,91 @@ -exec_id && $args->bug_id != "") -{ - if (write_execution_bug($db,$args->exec_id,$args->bug_id,$args->tcstep_id,true)) - { - // get audit info - $ainfo = get_execution($db,$args->exec_id,array('output' => 'audit')); - $ainfo = $ainfo[0]; - - $msg = lang_get('bugdeleting_was_ok'); - if( $ainfo['platform_name'] == '' ) - { - $auditMsg = TLS('audit_executionbug_deleted_no_platform',$args->bug_id, - $ainfo['exec_id'],$ainfo['testcase_name'], - $ainfo['testproject_name'],$ainfo['testplan_name'], - $ainfo['build_name']); - } - else - { - $auditMsg = TLS('audit_executionbug_deleted',$args->bug_id,$ainfo['exec_id'], - $ainfo['testcase_name'],$ainfo['testproject_name'], - $ainfo['testplan_name'],$ainfo['platform_name'], - $ainfo['build_name']); - } - logAuditEvent($auditMsg,"DELETE",$args->exec_id,"executions"); - } -} - -$smarty = new TLSmarty(); -$smarty->assign('msg',$msg); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - * @return object returns the arguments of the page - */ -function init_args() -{ - $args = new stdClass(); - $iParams = array("exec_id" => array("GET",tlInputParameter::INT_N), - "tcstep_id" => array("GET",tlInputParameter::INT_N), - "bug_id" => array("GET",tlInputParameter::STRING_N,0,config_get('field_size')->bug_id)); - - $pParams = I_PARAMS($iParams,$args); - $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']; - - return $args; -} - - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) -{ - $hasRights = $user->hasRightOnProj($db,"testplan_execute"); - return $hasRights; -} \ No newline at end of file +exec_id && $args->bug_id != "" && + write_execution_bug($db, $args->exec_id, $args->bug_id, $args->tcstep_id, + true)) { + // get audit info + $ainfo = get_execution($db, $args->exec_id, array( + 'output' => 'audit' + )); + $ainfo = $ainfo[0]; + + $msg = lang_get('bugdeleting_was_ok'); + if ($ainfo['platform_name'] == '') { + $auditMsg = TLS('audit_executionbug_deleted_no_platform', $args->bug_id, + $ainfo['exec_id'], $ainfo['testcase_name'], + $ainfo['testproject_name'], $ainfo['testplan_name'], + $ainfo['build_name']); + } else { + $auditMsg = TLS('audit_executionbug_deleted', $args->bug_id, + $ainfo['exec_id'], $ainfo['testcase_name'], + $ainfo['testproject_name'], $ainfo['testplan_name'], + $ainfo['platform_name'], $ainfo['build_name']); + } + logAuditEvent($auditMsg, "DELETE", $args->exec_id, "executions"); +} + +$smarty = new TLSmarty(); +$smarty->assign('msg', $msg); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return object returns the arguments of the page + */ +function initArgs() +{ + $args = new stdClass(); + $iParams = array( + "exec_id" => array( + "GET", + tlInputParameter::INT_N + ), + "tcstep_id" => array( + "GET", + tlInputParameter::INT_N + ), + "bug_id" => array( + "GET", + tlInputParameter::STRING_N, + 0, + config_get('field_size')->bug_id + ) + ); + + I_PARAMS($iParams, $args); + $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']; + + return $args; +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, "testplan_execute"); +} diff --git a/lib/execute/editExecution.php b/lib/execute/editExecution.php index 1ddfc3bbda..91368d437f 100644 --- a/lib/execute/editExecution.php +++ b/lib/execute/editExecution.php @@ -1,115 +1,134 @@ -basehref,$editorCfg); -switch ($args->doAction) { - case 'edit': - break; - - case 'doUpdate': - doUpdate($db,$args,$tcase_mgr,$_REQUEST); - break; +basehref, $editorCfg); +switch ($args->doAction) { + case 'edit': + break; + + case 'doUpdate': + doUpdate($db, $args, $tcaseMgr, $_REQUEST); + break; +} +$map = get_execution($db, $args->exec_id); +$owebeditor->Value = $map[0]['notes']; + +// order on script is critic +$gui = initializeGui($args, $tcaseMgr); +$cols = intval(isset($editorCfg['cols']) ? $editorCfg['cols'] : 60); +$rows = intval(isset($editorCfg['rows']) ? $editorCfg['rows'] : 10); +$gui->notes = $owebeditor->CreateHTML($rows, $cols); +$gui->editorType = $editorCfg['type']; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function doUpdate(&$db, &$args, &$tcaseMgr, &$request) +{ + updateExecutionNotes($db, $args->exec_id, $args->notes); + + $cfield_mgr = new cfield_mgr($db); + $cfield_mgr->execution_values_to_db($request, $args->tcversion_id, + $args->exec_id, $args->tplan_id); +} + +/** + */ +function initArgs() +{ + // Take care of proper escaping when magic_quotes_gpc is enabled + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "exec_id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "notes" => array( + tlInputParameter::STRING_N + ), + "tcversion_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "tproject_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->basehref = $_SESSION['basehref']; + $args->user = $_SESSION['currentUser']; + + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$tcaseMgr) +{ + $guiObj = new stdClass(); + $guiObj->dialogName = 'editexec_dialog'; + $guiObj->bodyOnLoad = "dialog_onLoad($guiObj->dialogName)"; + $guiObj->bodyOnUnload = "dialog_onUnload($guiObj->dialogName)"; + $guiObj->submitCode = "return dialog_onSubmit($guiObj->dialogName)"; + + $guiObj->exec_id = $argsObj->exec_id; + $guiObj->tcversion_id = $argsObj->tcversion_id; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->edit_enabled = $argsObj->user->hasRight($db, "exec_edit_notes") == + 'yes' ? 1 : 0; + $guiObj->cfields_exec = $tcaseMgr->html_table_of_custom_field_inputs( + $argsObj->tcversion_id, null, 'execution', '_cf', $argsObj->exec_id, + $argsObj->tplan_id, $argsObj->tproject_id); + return $guiObj; +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "testplan_execute") && + $user->hasRight($db, "exec_edit_notes"); } -$map = get_execution($db,$args->exec_id); -$owebeditor->Value = $map[0]['notes']; - -// order on script is critic -$gui = initializeGui($args,$tcase_mgr); -$cols = intval(isset($editorCfg['cols']) ? $editorCfg['cols'] : 60); -$rows = intval(isset($editorCfg['rows']) ? $editorCfg['rows'] : 10); -$gui->notes = $owebeditor->CreateHTML($rows,$cols); -$gui->editorType = $editorCfg['type']; - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - */ -function doUpdate(&$db,&$args,&$tcaseMgr,&$request) -{ - updateExecutionNotes($db,$args->exec_id,$args->notes); - - $cfield_mgr = new cfield_mgr($db); - $cfield_mgr->execution_values_to_db($request,$args->tcversion_id,$args->exec_id,$args->tplan_id); -} - -/** - * - */ -function init_args() -{ - // Take care of proper escaping when magic_quotes_gpc is enabled - $_REQUEST=strings_stripSlashes($_REQUEST); - - $iParams = array("exec_id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,100), - "notes" => array(tlInputParameter::STRING_N), - "tcversion_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "tproject_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->basehref = $_SESSION['basehref']; - $args->user = $_SESSION['currentUser']; - - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj,&$tcaseMgr) -{ - $guiObj = new stdClass(); - $guiObj->dialogName='editexec_dialog'; - $guiObj->bodyOnLoad="dialog_onLoad($guiObj->dialogName)"; - $guiObj->bodyOnUnload="dialog_onUnload($guiObj->dialogName)"; - $guiObj->submitCode="return dialog_onSubmit($guiObj->dialogName)"; - - $guiObj->exec_id = $argsObj->exec_id; - $guiObj->tcversion_id = $argsObj->tcversion_id; - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->edit_enabled = $argsObj->user->hasRight($db,"exec_edit_notes") == 'yes' ? 1 : 0; - $guiObj->cfields_exec = $tcaseMgr->html_table_of_custom_field_inputs($argsObj->tcversion_id,null,'execution','_cf', - $argsObj->exec_id,$argsObj->tplan_id,$argsObj->tproject_id); - return $guiObj; -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"testplan_execute") && $user->hasRight($db,"exec_edit_notes"); -} \ No newline at end of file diff --git a/lib/execute/execDashboard.php b/lib/execute/execDashboard.php index f37e311f3b..d2d3e011ee 100644 --- a/lib/execute/execDashboard.php +++ b/lib/execute/execDashboard.php @@ -1,273 +1,275 @@ -assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: - - args: - - returns: -*/ -function init_args(&$dbHandler,$cfgObj) { - - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - $tplan_mgr = new testplan($dbHandler); - - - // Settings we put on session to create some sort of persistent scope, - // because we have had issues when passing this info using GET mode (size limits) - // - // we get info about build_id, platform_id, etc ... - getContextFromGlobalScope($args); - $args->user = $_SESSION['currentUser']; - $args->user_id = $args->user->dbID; - $args->caller = isset($_REQUEST['caller']) ? $_REQUEST['caller'] : 'exec_feature'; - $args->reload_caller = false; - - $args->tplan_id = intval(isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); - $args->tproject_id = intval(isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); - - if($args->tproject_id <= 0) { - $tree_mgr = new tree($dbHandler); - $dm = $tree_mgr->get_node_hierarchy_info($args->tplan_id); - $args->tproject_id = $dm['parent_id']; - } - - if(is_null($args->build_id) || ($args->build_id == 0) ) { - // Go for the build - // this info can be present in session, then we will try different ways - // ATTENTION: - // give a look to tlTestCaseFilterControl.class.php method init_setting_build() - // - $key = $args->tplan_id . '_stored_setting_build'; - $args->build_id = isset($_SESSION[$key]) ? intval($_SESSION[$key]) : null; - if( is_null($args->build_id) ) { - $args->build_id = $tplan_mgr->get_max_build_id($args->tplan_id,1,1); - } - } - - if(is_null($args->platform_id) || ($args->platform_id <= 0) ) { - // Go for the platform (if any exists) - // this info can be present in session, then we will try different ways - // ATTENTION: - // give a look to tlTestCaseFilterControl.class.php method init_setting_platform() - // - $itemSet = $tplan_mgr->getPlatforms($args->tplan_id); - if(!is_null($itemSet)) { - $key = $args->tplan_id . '_stored_setting_platform'; - $args->platform_id = isset($_SESSION[$key]) ? intval($_SESSION[$key]) : null; - if( is_null($args->platform_id) || ($args->platform_id <= 0) ) { - $args->platform_id = $itemSet[0]['id']; - } - } - } - return array($args,$tplan_mgr); -} - - - -/* - function: initializeRights - create object with rights useful for this feature - - args: - dbHandler: reference to db object - userObj: reference to current user object - tproject_id: - tplan_id - - Warning: this is right interface for this function, but - has_rights() can works in a mode (that i consider a dirty one) - using SESSION to achieve global coupling. - - returns: - -*/ -function initializeRights(&$dbHandler,&$userObj,$tproject_id,$tplan_id) -{ - $exec_cfg = config_get('exec_cfg'); - $grants = new stdClass(); - - $grants->execute = $userObj->hasRight($dbHandler,"testplan_execute",$tproject_id,$tplan_id); - $grants->execute = $grants->execute=="yes" ? 1 : 0; - - // IMPORTANT NOTICE - TICKET 5128 - // If is TRUE we will need also to analize, test case by test case - // these settings: - // $tlCfg->exec_cfg->exec_mode->tester - // $tlCfg->exec_cfg->simple_tester_roles - // - // Why ? - // Because if a tester can execute ONLY test cases assigned to him, this also - // has to mean that: - // can delete executions ONLY of test cases assigned to him - // can edit exec notes ONLY of test cases assigned to him - // can manage uploads on executions, ONLY of test cases assigned to him - // - // These checks can not be done here - // - // TICKET 5310: Execution Config - convert options into rights - $grants->delete_execution = $userObj->hasRight($dbHandler,"exec_delete",$tproject_id,$tplan_id); - - - // Important: - // Execution right must be present to consider this configuration option. - // $grants->edit_exec_notes = $grants->execute && $exec_cfg->edit_notes; - $grants->edit_exec_notes = $grants->execute && - $userObj->hasRight($dbHandler,"exec_edit_notes",$tproject_id,$tplan_id); - - - $grants->edit_testcase = $userObj->hasRight($dbHandler,"mgt_modify_tc",$tproject_id,$tplan_id); - $grants->edit_testcase = $grants->edit_testcase=="yes" ? 1 : 0; - return $grants; -} - - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,&$argsObj,&$cfgObj,&$tplanMgr) { - - $buildMgr = new build_mgr($dbHandler); - $platformMgr = new tlPlatform($dbHandler,$argsObj->tproject_id); - - $gui = new stdClass(); - $gui->form_token = $argsObj->form_token; - $gui->remoteExecFeedback = $gui->user_feedback = ''; - $gui->tplan_id=$argsObj->tplan_id; - $gui->tproject_id=$argsObj->tproject_id; - $gui->build_id = $argsObj->build_id; - $gui->platform_id = $argsObj->platform_id; - - $gui->attachmentInfos=null; - $gui->refreshTree = 0; - - $cfgTestPlan = getWebEditorCfg('testplan'); - $gui->testPlanEditorType = $cfgTestPlan['type']; - $cfgPlatform = getWebEditorCfg('platform'); - $gui->platformEditorType = $cfgPlatform['type']; - $cfgBuild = getWebEditorCfg('build'); - $gui->buildEditorType = $cfgBuild['type']; - - // Just for the records: - // doing this here, we avoid to do on processTestSuite() and processTestCase(), - // but absolutely this will not improve in ANY WAY perfomance, because we do not loop - // over these two functions. - $tprojectMgr = new testproject($dbHandler); - $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tproject_id); - $build_info = $buildMgr->get_by_id($argsObj->build_id); - $gui->build_notes=$build_info['notes']; - $gui->build_is_open=($build_info['is_open'] == 1 ? 1 : 0); - - $dummy = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id); - $gui->build_name = isset($dummy[$argsObj->build_id]) ? $dummy[$argsObj->build_id] : ''; - $rs = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->testplan_notes = $rs['notes']; - $gui->testplan_name = $rs['name']; - - // Important note: - // custom fields for test plan can be edited ONLY on design, that's reason why we are using - // scope = 'design' instead of 'execution' - $gui->testplan_cfields = $tplanMgr->html_table_of_custom_field_values($argsObj->tplan_id,'design', - array('show_on_execution' => 1)); - - - $gui->build_cfields = $buildMgr->html_table_of_custom_field_values($argsObj->build_id,$argsObj->tproject_id, - 'design',array('show_on_execution' => 1)); - - $dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id); - $gui->has_platforms = !is_null($dummy) ? 1 : 0; - - $gui->platform_info['id']=0; - $gui->platform_info['name']=''; - if(!is_null($argsObj->platform_id) && $argsObj->platform_id > 0 ) { - $gui->platform_info = $platformMgr->getByID($argsObj->platform_id); - } - - $gui->pageTitlePrefix = lang_get('execution_context') . ':'; - - - // JSON for REST API - $gui->restArgs = new stdClass(); - $gui->restArgs->testPlanID = intval($argsObj->tplan_id); - $gui->restArgs->buildID = intval($argsObj->build_id); - $gui->restArgs->platformID = intval($argsObj->platform_id); - - $gui->RESTArgsJSON = json_encode($gui->restArgs); - - return $gui; -} - - -/** - * get info from ... - * - */ -function getContextFromGlobalScope(&$argsObj) -{ - $mode = 'execution_mode'; - $settings = array('build_id' => 'setting_build', 'platform_id' => 'setting_platform'); - $isNumeric = array('build_id' => 0, 'platform_id' => 0); - - $argsObj->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $sf = isset($_SESSION['execution_mode']) && isset($_SESSION['execution_mode'][$argsObj->form_token]) ? - $_SESSION['execution_mode'][$argsObj->form_token] : null; - - if(is_null($sf)) - { - foreach($settings as $key => $sfKey) - { - $argsObj->$key = null; - } - return; - } - - foreach($settings as $key => $sfKey) - { - $argsObj->$key = isset($sf[$sfKey]) ? $sf[$sfKey] : null; - if (is_null($argsObj->$key)) - { - // let's this page be functional withouth a form token too - // (when called from testcases assigned to me) - $argsObj->$key = isset($_REQUEST[$sfKey]) ? $_REQUEST[$sfKey] : null; - } - if(isset($isNumeric[$key])) - { - $argsObj->$key = intval($argsObj->$key); - } - } - +assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * + * args: + * + * returns: + */ +function initArgs(&$dbHandler) +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + $tplan_mgr = new testplan($dbHandler); + + // Settings we put on session to create some sort of persistent scope, + // because we have had issues when passing this info using GET mode (size limits) + // + // we get info about build_id, platform_id, etc ... + getContextFromGlobalScope($args); + $args->user = $_SESSION['currentUser']; + $args->user_id = $args->user->dbID; + $args->caller = isset($_REQUEST['caller']) ? $_REQUEST['caller'] : 'exec_feature'; + $args->reload_caller = false; + + $args->tplan_id = intval( + isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); + $args->tproject_id = intval( + isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); + + if ($args->tproject_id <= 0) { + $tree_mgr = new tree($dbHandler); + $dm = $tree_mgr->get_node_hierarchy_info($args->tplan_id); + $args->tproject_id = $dm['parent_id']; + } + + if (is_null($args->build_id) || ($args->build_id == 0)) { + // Go for the build + // this info can be present in session, then we will try different ways + // ATTENTION: + // give a look to tlTestCaseFilterControl.class.php method init_setting_build() + // + $key = $args->tplan_id . '_stored_setting_build'; + $args->build_id = isset($_SESSION[$key]) ? intval($_SESSION[$key]) : null; + if (is_null($args->build_id)) { + $args->build_id = $tplan_mgr->get_max_build_id($args->tplan_id, 1, 1); + } + } + + if (is_null($args->platform_id) || ($args->platform_id <= 0)) { + // Go for the platform (if any exists) + // this info can be present in session, then we will try different ways + // ATTENTION: + // give a look to tlTestCaseFilterControl.class.php method init_setting_platform() + // + $itemSet = $tplan_mgr->getPlatforms($args->tplan_id); + if (! is_null($itemSet)) { + $key = $args->tplan_id . '_stored_setting_platform'; + $args->platform_id = isset($_SESSION[$key]) ? intval( + $_SESSION[$key]) : null; + if (is_null($args->platform_id) || ($args->platform_id <= 0)) { + $args->platform_id = $itemSet[0]['id']; + } + } + } + return array( + $args, + $tplan_mgr + ); +} + +/* + * function: initializeRights + * create object with rights useful for this feature + * + * args: + * dbHandler: reference to db object + * userObj: reference to current user object + * tproject_id: + * tplan_id + * + * Warning: this is right interface for this function, but + * has_rights() can works in a mode (that i consider a dirty one) + * using SESSION to achieve global coupling. + * + * returns: + * + */ +function initializeRights(&$dbHandler, &$userObj, $tproject_id, $tplan_id) +{ + $grants = new stdClass(); + + $grants->execute = $userObj->hasRight($dbHandler, "testplan_execute", + $tproject_id, $tplan_id); + $grants->execute = $grants->execute == "yes" ? 1 : 0; + + // IMPORTANT NOTICE - TICKET 5128 + // If is TRUE we will need also to analize, test case by test case + // these settings: + // $tlCfg->exec_cfg->exec_mode->tester + // $tlCfg->exec_cfg->simple_tester_roles + // + // Why ? + // Because if a tester can execute ONLY test cases assigned to him, this also + // has to mean that: + // can delete executions ONLY of test cases assigned to him + // can edit exec notes ONLY of test cases assigned to him + // can manage uploads on executions, ONLY of test cases assigned to him + // + // These checks can not be done here + // + // TICKET 5310: Execution Config - convert options into rights + $grants->delete_execution = $userObj->hasRight($dbHandler, "exec_delete", + $tproject_id, $tplan_id); + + // Important: + // Execution right must be present to consider this configuration option. + // $grants->edit_exec_notes = $grants->execute && $exec_cfg->edit_notes; + $grants->edit_exec_notes = $grants->execute && + $userObj->hasRight($dbHandler, "exec_edit_notes", $tproject_id, + $tplan_id); + + $grants->edit_testcase = $userObj->hasRight($dbHandler, "mgt_modify_tc", + $tproject_id, $tplan_id); + $grants->edit_testcase = $grants->edit_testcase == "yes" ? 1 : 0; + return $grants; +} + +/* + * function: initializeGui + * + * args : + * + * returns: + * + */ +function initializeGui(&$dbHandler, &$argsObj, &$cfgObj, &$tplanMgr) +{ + $buildMgr = new build_mgr($dbHandler); + $platformMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + + $gui = new stdClass(); + $gui->form_token = $argsObj->form_token; + $gui->remoteExecFeedback = $gui->user_feedback = ''; + $gui->tplan_id = $argsObj->tplan_id; + $gui->tproject_id = $argsObj->tproject_id; + $gui->build_id = $argsObj->build_id; + $gui->platform_id = $argsObj->platform_id; + + $gui->attachmentInfos = null; + $gui->refreshTree = 0; + + $cfgTestPlan = getWebEditorCfg('testplan'); + $gui->testPlanEditorType = $cfgTestPlan['type']; + $cfgPlatform = getWebEditorCfg('platform'); + $gui->platformEditorType = $cfgPlatform['type']; + $cfgBuild = getWebEditorCfg('build'); + $gui->buildEditorType = $cfgBuild['type']; + + // Just for the records: + // doing this here, we avoid to do on processTestSuite() and processTestCase(), + // but absolutely this will not improve in ANY WAY perfomance, because we do not loop + // over these two functions. + $tprojectMgr = new testproject($dbHandler); + $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tproject_id); + $build_info = $buildMgr->get_by_id($argsObj->build_id); + $gui->build_notes = $build_info['notes']; + $gui->build_is_open = ($build_info['is_open'] == 1 ? 1 : 0); + + $dummy = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id); + $gui->build_name = isset($dummy[$argsObj->build_id]) ? $dummy[$argsObj->build_id] : ''; + $rs = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->testplan_notes = $rs['notes']; + $gui->testplan_name = $rs['name']; + + // Important note: + // custom fields for test plan can be edited ONLY on design, that's reason why we are using + // scope = 'design' instead of 'execution' + $gui->testplan_cfields = $tplanMgr->html_table_of_custom_field_values( + $argsObj->tplan_id, 'design', array( + 'show_on_execution' => 1 + )); + + $gui->build_cfields = $buildMgr->html_table_of_custom_field_values( + $argsObj->build_id, $argsObj->tproject_id, 'design', + array( + 'show_on_execution' => 1 + )); + + $dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id); + $gui->has_platforms = ! is_null($dummy) ? 1 : 0; + + $gui->platform_info['id'] = 0; + $gui->platform_info['name'] = ''; + if (! is_null($argsObj->platform_id) && $argsObj->platform_id > 0) { + $gui->platform_info = $platformMgr->getByID($argsObj->platform_id); + } + + $gui->pageTitlePrefix = lang_get('execution_context') . ':'; + + // JSON for REST API + $gui->restArgs = new stdClass(); + $gui->restArgs->testPlanID = intval($argsObj->tplan_id); + $gui->restArgs->buildID = intval($argsObj->build_id); + $gui->restArgs->platformID = intval($argsObj->platform_id); + + $gui->RESTArgsJSON = json_encode($gui->restArgs); + + return $gui; +} + +/** + * get info from ... + */ +function getContextFromGlobalScope(&$argsObj) +{ + $settings = array( + 'build_id' => 'setting_build', + 'platform_id' => 'setting_platform' + ); + $isNumeric = array( + 'build_id' => 0, + 'platform_id' => 0 + ); + + $argsObj->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $sf = isset($_SESSION['execution_mode']) && + isset($_SESSION['execution_mode'][$argsObj->form_token]) ? $_SESSION['execution_mode'][$argsObj->form_token] : null; + + if (is_null($sf)) { + foreach ($settings as $key => $sfKey) { + $argsObj->$key = null; + } + return; + } + + foreach ($settings as $key => $sfKey) { + $argsObj->$key = isset($sf[$sfKey]) ? $sf[$sfKey] : null; + if (is_null($argsObj->$key)) { + // let's this page be functional withouth a form token too + // (when called from testcases assigned to me) + $argsObj->$key = isset($_REQUEST[$sfKey]) ? $_REQUEST[$sfKey] : null; + } + if (isset($isNumeric[$key])) { + $argsObj->$key = intval($argsObj->$key); + } + } } diff --git a/lib/execute/execExport.php b/lib/execute/execExport.php index a46b7c0600..a1c8d7d69c 100644 --- a/lib/execute/execExport.php +++ b/lib/execute/execExport.php @@ -1,213 +1,200 @@ -doExport) -{ - $content = contentAsXML($db,$args,$tplan_mgr); - downloadContentsToFile($content,$gui->export_filename); - exit(); -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $args->doExport = isset($_REQUEST['export']) ? $_REQUEST['export'] : null; - $args->exportType = isset($_REQUEST['exportType']) ? $_REQUEST['exportType'] : null; - - $key2loop = array('tproject','tplan','platform','build','tsuite'); - foreach($key2loop as $item) - { - $argsKey = $item . '_id'; - $inputKey = $item . 'ID'; - $args->$argsKey = isset($_REQUEST[$inputKey]) ? intval($_REQUEST[$inputKey]) : 0; - } - - $args->export_filename=isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; - $args->goback_url=isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - $args->tcversionSet=isset($_REQUEST['tcversionSet']) ? $_REQUEST['tcversionSet'] : null; - return $args; -} - - -/** - * - * - */ -function initializeGui(&$argsObj,&$tplanMgr) -{ - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - - $guiObj = new stdClass(); - $guiObj->do_it = 1; - $guiObj->nothing_todo_msg = ''; - $guiObj->export_filename = 'export_execution_set.xml'; - $guiObj->exportTypes = array('XML' => 'XML'); - $guiObj->page_title = lang_get('export_execution_set'); - $guiObj->object_name = ''; - $guiObj->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - - $key2loop = array('tproject','tplan','platform','build','tsuite'); - foreach($key2loop as $item) - { - $argsKey = $item . '_id'; - // $inputKey = $item . 'ID'; - $guiObj->$argsKey = intval($argsObj->$argsKey); - } - $guiObj->tcversionSet = $argsObj->tcversionSet; - $guiObj->drawCancelButton = false; - - return $guiObj; -} - - - -/** - * - * - */ -function contentAsXML(&$dbHandler,$contextSet,&$tplanMgr) -{ - $dummy = array(); - $dummy['context'] = contextAsXML($dbHandler,$contextSet,$tplanMgr); - $dummy['tcaseSet'] = tcaseSetAsXML($dbHandler,$contextSet); - - $xmlString = TL_XMLEXPORT_HEADER . - "\n\n\t{$dummy['context']}\n\t{$dummy['tcaseSet']}\n\t"; - return $xmlString; - -} - -/** - * - * - */ -function contextAsXML(&$dbHandler,$contextSet,&$tplanMgr) -{ - $info = array(); - $tprojectMgr = new testproject($dbHandler); - $info['tproject'] = $tprojectMgr->get_by_id($contextSet->tproject_id); - unset($tprojectMgr); - - $info['tplan'] = $tplanMgr->get_by_id($contextSet->tplan_id); - - $buildMgr = new build_mgr($dbHandler); - $info['build'] = $buildMgr->get_by_id($contextSet->build_id); - unset($buildMgr); - - $info['platform'] = null; - $platform_template = ''; - if( $contextSet->platform_id > 0 ) - { - $platformMgr = new tlPlatform($dbHandler, $contextSet->tproject_id); - $info['platform'] = $platformMgr->getByID($contextSet->platform_id); - unset($platformMgr); - - $platform_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - } - - $key2loop = array_keys($info); - foreach($key2loop as $item_key) - { - if(!is_null($info[$item_key])) - { - $contextInfo[$item_key . '_id'] = $info[$item_key]['id']; - $contextInfo[$item_key . '_name'] = $info[$item_key]['name']; - } - } - $contextInfo['prefix'] = $info['tproject']['prefix']; - - $xml_root = "{{XMLCODE}}\n"; - $xml_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . "" . - "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . "" . $platform_template . - "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - - $xml_mapping = null; - $xml_mapping = array("||TPROJECTNAME||" => "tproject_name", "||TPROJECTID||" => 'tproject_id', - "||TPROJECTPREFIX||" => "prefix", - "||TPLANNAME||" => "tplan_name", "||TPLANID||" => 'tplan_id', - "||BUILDNAME||" => "build_name", "||BUILDID||" => 'build_id', - "||PLATFORMNAME||" => "platform_name", "||PLATFORMID||" => 'platform_id'); - - - $mm = array($contextInfo); - $contextXML = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping,('noXMLHeader'=='noXMLHeader')); - // echo '
    ';
    -	// echo $contextXML;
    -	// echo '
    '; - - return $contextXML; -} - -/** - * - * - */ -function tcaseSetAsXML(&$dbHandler,$contextSet) -{ - $tcaseMgr = new testcase($dbHandler); - $tcversionSet = explode(',',$contextSet->tcversionSet); - $xmlTC = "\n\t"; - foreach($tcversionSet as $tcversion_id) - { - $xmlTC .= $tcaseMgr->exportTestCaseDataToXML(0,$tcversion_id,$contextSet->tproject_id,true); - - } - $xmlTC .= "\n\t"; - return $xmlTC; -} +doExport) { + $content = contentAsXML($db, $args, $tplan_mgr); + downloadContentsToFile($content, $gui->export_filename); + exit(); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $args->doExport = isset($_REQUEST['export']) ? $_REQUEST['export'] : null; + $args->exportType = isset($_REQUEST['exportType']) ? $_REQUEST['exportType'] : null; + + $key2loop = array( + 'tproject', + 'tplan', + 'platform', + 'build', + 'tsuite' + ); + foreach ($key2loop as $item) { + $argsKey = $item . '_id'; + $inputKey = $item . 'ID'; + $args->$argsKey = isset($_REQUEST[$inputKey]) ? intval( + $_REQUEST[$inputKey]) : 0; + } + + $args->export_filename = isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + $args->tcversionSet = isset($_REQUEST['tcversionSet']) ? $_REQUEST['tcversionSet'] : null; + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$tplanMgr) +{ + $guiObj = new stdClass(); + $guiObj->do_it = 1; + $guiObj->nothing_todo_msg = ''; + $guiObj->export_filename = 'export_execution_set.xml'; + $guiObj->exportTypes = array( + 'XML' => 'XML' + ); + $guiObj->page_title = lang_get('export_execution_set'); + $guiObj->object_name = ''; + $guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + + $key2loop = array( + 'tproject', + 'tplan', + 'platform', + 'build', + 'tsuite' + ); + foreach ($key2loop as $item) { + $argsKey = $item . '_id'; + $guiObj->$argsKey = intval($argsObj->$argsKey); + } + $guiObj->tcversionSet = $argsObj->tcversionSet; + $guiObj->drawCancelButton = false; + + return $guiObj; +} + +/** + */ +function contentAsXML(&$dbHandler, $contextSet, &$tplanMgr) +{ + $dummy = array(); + $dummy['context'] = contextAsXML($dbHandler, $contextSet, $tplanMgr); + $dummy['tcaseSet'] = tcaseSetAsXML($dbHandler, $contextSet); + + return TL_XMLEXPORT_HEADER . + "\n\n\t{$dummy['context']}\n\t{$dummy['tcaseSet']}\n\t"; +} + +/** + */ +function contextAsXML(&$dbHandler, $contextSet, &$tplanMgr) +{ + $info = array(); + $tprojectMgr = new testproject($dbHandler); + $info['tproject'] = $tprojectMgr->get_by_id($contextSet->tproject_id); + unset($tprojectMgr); + + $info['tplan'] = $tplanMgr->get_by_id($contextSet->tplan_id); + + $buildMgr = new build_mgr($dbHandler); + $info['build'] = $buildMgr->get_by_id($contextSet->build_id); + unset($buildMgr); + + $info['platform'] = null; + $platform_template = ''; + if ($contextSet->platform_id > 0) { + $platformMgr = new tlPlatform($dbHandler, $contextSet->tproject_id); + $info['platform'] = $platformMgr->getByID($contextSet->platform_id); + unset($platformMgr); + + $platform_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + } + + $key2loop = array_keys($info); + foreach ($key2loop as $item_key) { + if (! is_null($info[$item_key])) { + $contextInfo[$item_key . '_id'] = $info[$item_key]['id']; + $contextInfo[$item_key . '_name'] = $info[$item_key]['name']; + } + } + $contextInfo['prefix'] = $info['tproject']['prefix']; + + $xml_root = "{{XMLCODE}}\n"; + $xml_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + "" . "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + "" . $platform_template . "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + + $xml_mapping = null; + $xml_mapping = array( + "||TPROJECTNAME||" => "tproject_name", + "||TPROJECTID||" => 'tproject_id', + "||TPROJECTPREFIX||" => "prefix", + "||TPLANNAME||" => "tplan_name", + "||TPLANID||" => 'tplan_id', + "||BUILDNAME||" => "build_name", + "||BUILDID||" => 'build_id', + "||PLATFORMNAME||" => "platform_name", + "||PLATFORMID||" => 'platform_id' + ); + + $mm = array( + $contextInfo + ); + return exportDataToXML($mm, $xml_root, $xml_template, $xml_mapping, true); +} + +/** + */ +function tcaseSetAsXML(&$dbHandler, $contextSet) +{ + $tcaseMgr = new testcase($dbHandler); + $tcversionSet = explode(',', $contextSet->tcversionSet); + $xmlTC = "\n\t"; + foreach ($tcversionSet as $tcversion_id) { + $xmlTC .= $tcaseMgr->exportTestCaseDataToXML(0, $tcversion_id, + $contextSet->tproject_id, true); + } + $xmlTC .= "\n\t"; + return $xmlTC; +} ?> diff --git a/lib/execute/execHistory.php b/lib/execute/execHistory.php index 7b892daf5a..d14a7d9a77 100644 --- a/lib/execute/execHistory.php +++ b/lib/execute/execHistory.php @@ -1,198 +1,195 @@ -exec_cfg = config_get('exec_cfg'); - - -$node['basic'] = $tcase_mgr->tree_manager->get_node_hierarchy_info($args->tcase_id); -$node['specific'] = $tcase_mgr->getExternalID($args->tcase_id); -$idCard = $node['specific'][0] . ' : ' . $node['basic']['name']; - - -$gui->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - -// IMPORTANT NOTICE: -// getExecutionSet() consider only executions written to DB. -// we can filter out execution that belongs to test plans / test project current user -// has no right to access -// does this means we need to get also for each test project/test plan present -// in result set it's public/private status -// - -// Need to get all test plans user is able to access. -$testPlanSet = - (array)$args->user->getAccessibleTestPlans($db,$gui->tproject_id,null, - array('active' => $args->onlyActiveTestPlans)); - -$gui->grants = new stdClass(); -$gui->grants->exec_edit_notes = null; -$filters['testplan_id'] = null; -foreach($testPlanSet as $rx) -{ - $filters['testplan_id'][] = $rx['id']; - $gui->grants->exec_edit_notes[$rx['id']] = - $args->user->hasRight($db,'exec_edit_notes',$gui->tproject_id,$rx['id']); +exec_cfg = config_get('exec_cfg'); + +$node['basic'] = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $args->tcase_id); +$node['specific'] = $tcaseMgr->getExternalID($args->tcase_id); +$idCard = $node['specific'][0] . ' : ' . $node['basic']['name']; + +$gui->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + +// IMPORTANT NOTICE: +// getExecutionSet() consider only executions written to DB. +// we can filter out execution that belongs to test plans / test project current user +// has no right to access +// does this means we need to get also for each test project/test plan present +// in result set it's public/private status +// + +// Need to get all test plans user is able to access. +$testPlanSet = (array) $args->user->getAccessibleTestPlans($db, + $gui->tproject_id, null, array( + 'active' => $args->onlyActiveTestPlans + )); + +$gui->grants = new stdClass(); +$gui->grants->exec_edit_notes = null; +$filters['testplan_id'] = null; +foreach ($testPlanSet as $rx) { + $filters['testplan_id'][] = $rx['id']; + $gui->grants->exec_edit_notes[$rx['id']] = $args->user->hasRight($db, + 'exec_edit_notes', $gui->tproject_id, $rx['id']); +} +$gui->execSet = $tcaseMgr->getExecutionSet($args->tcase_id, null, $filters); + +$gui->warning_msg = (! is_null($gui->execSet)) ? '' : lang_get( + 'tcase_never_executed'); +$gui->user_is_admin = ($args->user->globalRole->name == 'admin') ? true : false; + +$gui->execPlatformSet = null; +$gui->cfexec = null; +$gui->attachments = null; + +if (! is_null($gui->execSet)) { + $gui->execPlatformSet = $tcaseMgr->getExecutedPlatforms($args->tcase_id); + + // get issue tracker config and object to manage TestLink - BTS integration + $its = null; + $tproject_mgr = new testproject($db); + $info = $tproject_mgr->get_by_id($gui->tproject_id); + if ($info['issue_tracker_enabled']) { + $gui->bugs = getIssues($db, $gui->execSet, $gui->tproject_id); + } + // get custom fields brute force => do not check if this call is needed + $gui->cfexec = getCustomFields($tcaseMgr, $gui->execSet); + $gui->attachments = getAttachments($db, $gui->execSet); +} + +$gui->displayPlatformCol = ! is_null($gui->execPlatformSet) ? 1 : 0; +$gui->main_descr = lang_get('execution_history'); +$gui->detailed_descr = lang_get('test_case') . ' ' . $idCard; +$gui->tcase_id = intval($args->tcase_id); +$gui->onlyActiveTestPlans = intval($args->onlyActiveTestPlans); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "tcase_id" => array( + tlInputParameter::INT_N + ), + 'onlyActiveTestPlans' => array( + tlInputParameter::INT_N + ) + ); + $pParams = R_PARAMS($iParams); + + $args = new stdClass(); + $args->tcase_id = intval($pParams["tcase_id"]); + + $args->onlyActiveTestPlans = null; + if (intval($pParams["onlyActiveTestPlans"]) > 0 || + $pParams["onlyActiveTestPlans"] == 'on') { + $args->onlyActiveTestPlans = 1; + } + + // not a very good solution but a Quick & Dirty Fix + $args->user = $_SESSION['currentUser']; + + return $args; +} + +/** + * + * @param database $dbHandler + * @param array $execSet + * @param int $tprojectID + * @return array + */ +function getIssues(&$dbHandler, &$execSet, $tprojectID) +{ + $it_mgr = new tlIssueTracker($dbHandler); + $its = $it_mgr->getInterfaceObject($tprojectID); + unset($it_mgr); + + // we will see in future if we can use a better algorithm + $issues = array(); + $tcv2loop = array_keys($execSet); + foreach ($tcv2loop as $tcvid) { + $execQty = count($execSet[$tcvid]); + for ($idx = 0; $idx < $execQty; $idx ++) { + $exec_id = $execSet[$tcvid][$idx]['execution_id']; + $dummy = get_bugs_for_exec($dbHandler, $its, $exec_id); + if (! empty($dummy)) { + $issues[$exec_id] = $dummy; + } + } + } + return $issues; +} + +/** + * + * @param testcase $tcaseMgr + * @param array $execSet + * @return string[]|array[] + */ +function getCustomFields(&$tcaseMgr, &$execSet) +{ + $cf = array(); + $tcv2loop = array_keys($execSet); + foreach ($tcv2loop as $tcvid) { + $execQty = count($execSet[$tcvid]); + for ($idx = 0; $idx < $execQty; $idx ++) { + $exec_id = $execSet[$tcvid][$idx]['execution_id']; + $tplan_id = $execSet[$tcvid][$idx]['testplan_id']; + $dummy = (array) $tcaseMgr->html_table_of_custom_field_values( + $tcvid, 'execution', null, $exec_id, $tplan_id); + $cf[$exec_id] = (! empty($dummy)) ? $dummy : ''; + } + } + return $cf; +} + +/** + * + * @param database $dbHandler + * @param array $execSet + * @return NULL|array + */ +function getAttachments(&$dbHandler, &$execSet) +{ + $attachmentMgr = tlAttachmentRepository::create($dbHandler); + + $att = null; + $tcv2loop = array_keys($execSet); + foreach ($tcv2loop as $tcvid) { + $execQty = count($execSet[$tcvid]); + for ($idx = 0; $idx < $execQty; $idx ++) { + $exec_id = $execSet[$tcvid][$idx]['execution_id']; + $items = getAttachmentInfos($attachmentMgr, $exec_id, 'executions', + true, 1); + if ($items) { + $att[$exec_id] = $items; + } + } + } + return $att; } -$gui->execSet = $tcase_mgr->getExecutionSet($args->tcase_id,null,$filters); - -$gui->warning_msg = (!is_null($gui->execSet)) ? '' : lang_get('tcase_never_executed'); -$gui->user_is_admin = ($args->user->globalRole->name=='admin') ? true : false; - -$gui->execPlatformSet = null; -$gui->cfexec = null; -$gui->attachments = null; - -if(!is_null($gui->execSet) ) -{ - $gui->execPlatformSet = $tcase_mgr->getExecutedPlatforms($args->tcase_id); - - // get issue tracker config and object to manage TestLink - BTS integration - $its = null; - $tproject_mgr = new testproject($db); - $info = $tproject_mgr->get_by_id($gui->tproject_id); - if($info['issue_tracker_enabled']) - { - $gui->bugs = getIssues($db,$gui->execSet,$gui->tproject_id); - } - // get custom fields brute force => do not check if this call is needed - $gui->cfexec = getCustomFields($tcase_mgr,$gui->execSet); - $gui->attachments = getAttachments($db,$gui->execSet); - -} - -$gui->displayPlatformCol = !is_null($gui->execPlatformSet) ? 1 : 0; -$gui->main_descr = lang_get('execution_history'); -$gui->detailed_descr = lang_get('test_case') . ' ' . $idCard; -$gui->tcase_id = intval($args->tcase_id); -$gui->onlyActiveTestPlans = intval($args->onlyActiveTestPlans); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = array("tcase_id" => array(tlInputParameter::INT_N), - 'onlyActiveTestPlans' => array(tlInputParameter::INT_N)); - $pParams = R_PARAMS($iParams); - - $args = new stdClass(); - $args->tcase_id = intval($pParams["tcase_id"]); - - $args->onlyActiveTestPlans = null; - if(intval($pParams["onlyActiveTestPlans"]) > 0 || - $pParams["onlyActiveTestPlans"] == 'on') - { - $args->onlyActiveTestPlans = 1; - } - - // not a very good solution but a Quick & Dirty Fix - $args->user = $_SESSION['currentUser']; - - return $args; -} - - -/** - * - * - */ -function getIssues(&$dbHandler,&$execSet,$tprojectID) -{ - - $it_mgr = new tlIssueTracker($dbHandler); - $its = $it_mgr->getInterfaceObject($tprojectID); - unset($it_mgr); - - // we will see in future if we can use a better algorithm - $issues = array(); - $tcv2loop = array_keys($execSet); - foreach($tcv2loop as $tcvid) - { - $execQty = count($execSet[$tcvid]); - for($idx=0; $idx < $execQty; $idx++) - { - $exec_id = $execSet[$tcvid][$idx]['execution_id']; - $dummy = get_bugs_for_exec($dbHandler,$its,$exec_id); - if(count($dummy) > 0) - { - $issues[$exec_id] = $dummy; - } - } - } - return $issues; -} - -/** - * - * - */ -function getCustomFields(&$tcaseMgr,&$execSet) -{ - $cf = array(); - $tcv2loop = array_keys($execSet); - foreach($tcv2loop as $tcvid) - { - $execQty = count($execSet[$tcvid]); - for($idx=0; $idx < $execQty; $idx++) - { - $exec_id = $execSet[$tcvid][$idx]['execution_id']; - $tplan_id = $execSet[$tcvid][$idx]['testplan_id']; - $dummy = (array)$tcaseMgr->html_table_of_custom_field_values($tcvid,'execution',null,$exec_id,$tplan_id); - $cf[$exec_id] = (count($dummy) > 0) ? $dummy : ''; - } - } - return $cf; -} - -/** - * - * - */ -function getAttachments(&$dbHandler,&$execSet) -{ - $attachmentMgr = tlAttachmentRepository::create($dbHandler); - - $att = null; - $tcv2loop = array_keys($execSet); - foreach($tcv2loop as $tcvid) - { - $execQty = count($execSet[$tcvid]); - for($idx=0; $idx < $execQty; $idx++) - { - $exec_id = $execSet[$tcvid][$idx]['execution_id']; - $items = getAttachmentInfos($attachmentMgr,$exec_id,'executions',true,1); - if($items) - { - $att[$exec_id] = $items; - } - } - } - return $att; -} \ No newline at end of file diff --git a/lib/execute/execNavigator.php b/lib/execute/execNavigator.php index 345944703c..dd9148b150 100644 --- a/lib/execute/execNavigator.php +++ b/lib/execute/execNavigator.php @@ -1,142 +1,137 @@ -formAction = ''; - -$gui = initializeGui($db,$control); - - -$control->build_tree_menu($gui); - - -$smarty = new TLSmarty(); -if( $gui->execAccess ) { - $smarty->assign('gui',$gui); - $smarty->assign('control', $control); - $smarty->assign('menuUrl',$gui->menuUrl); - $smarty->assign('args', $gui->args); - $tpl = $templateCfg->template_dir . $templateCfg->default_template; -} else { - $tpl = 'noaccesstofeature.tpl'; +formAction = ''; + +$gui = initializeGui($db, $control); + +$control->build_tree_menu($gui); + +$smarty = new TLSmarty(); +if ($gui->execAccess) { + $smarty->assign('gui', $gui); + $smarty->assign('control', $control); + $smarty->assign('menuUrl', $gui->menuUrl); + $smarty->assign('args', $gui->args); + $tpl = $templateCfg->template_dir . $templateCfg->default_template; +} else { + $tpl = 'noaccesstofeature.tpl'; +} + +$smarty->display($tpl); + +/** + */ +function initializeGui(&$dbH, &$control) +{ + $gui = new stdClass(); + + // This logic is managed from execSetResults.php + $gui->loadExecDashboard = true; + if (isset($_SESSION['loadExecDashboard'][$control->form_token]) || + $control->args->loadExecDashboard == 0) { + $gui->loadExecDashboard = false; + unset($_SESSION['loadExecDashboard'][$control->form_token]); + } + + $gui->menuUrl = 'lib/execute/execSetResults.php'; + $gui->args = $control->get_argument_string(); + if (! $control->args->loadExecDashboard) { + $gui->src_workframe = ''; + } else { + $gui->src_workframe = $control->args->basehref . $gui->menuUrl . + "?edit=testproject&id={$control->args->testproject_id}" . $gui->args; + } + + $control->draw_export_testplan_button = true; + $control->draw_import_xml_results_button = true; + + $dummy = config_get('results'); + $gui->not_run = $dummy['status_code']['not_run']; + + $dummy = config_get('execution_filter_methods'); + $gui->lastest_exec_method = $dummy['status_code']['latest_execution']; + $gui->pageTitle = lang_get('href_execute_test'); + + $grants = checkAccessToExec($dbH, $control); + + // feature to enable/disable + $gui->features = array( + 'export' => false, + 'import' => false + ); + $gui->execAccess = false; + if ($grants['testplan_execute']) { + $gui->features['export'] = true; + $gui->features['import'] = true; + $gui->execAccess = true; + } + + if ($grants['exec_ro_access']) { + $gui->execAccess = true; + } + + $control->draw_export_testplan_button = $gui->features['export']; + $control->draw_import_xml_results_button = $gui->features['import']; + + return $gui; +} + +/** + */ +function checkAccessToExec(&$dbH, &$ct) +{ + $tplan_id = intval($ct->args->testplan_id); + $sch = tlObject::getDBTables(array( + 'testplans' + )); + $sql = "SELECT testproject_id FROM {$sch['testplans']} " . "WHERE id=" . + $tplan_id; + $rs = $dbH->get_recordset($sql); + if (is_null($rs)) { + throw new Exception("Can not find Test Project For Test Plan - ABORT", 1); + } + $rs = current($rs); + $tproject_id = $rs['testproject_id']; + + $user = $_SESSION['currentUser']; + $grants = null; + $k2a = array( + 'testplan_execute', + 'exec_ro_access' + ); + foreach ($k2a as $r2c) { + $grants[$r2c] = false; + if ($user->hasRight($dbH, $r2c, $tproject_id, $tplan_id, true) || + $user->globalRoleID == TL_ROLES_ADMIN) { + $grants[$r2c] = true; + } + } + + return $grants; } - -$smarty->display($tpl); - - -/** - * - * - */ -function initializeGui(&$dbH,&$control) { - $gui = new stdClass(); - - // This logic is managed from execSetResults.php - $gui->loadExecDashboard = true; - if( isset($_SESSION['loadExecDashboard'][$control->form_token]) || - $control->args->loadExecDashboard == 0 - ) { - $gui->loadExecDashboard = false; - unset($_SESSION['loadExecDashboard'][$control->form_token]); - } - - $gui->menuUrl = 'lib/execute/execSetResults.php'; - $gui->args = $control->get_argument_string(); - if($control->args->loadExecDashboard == false) { - $gui->src_workframe = ''; - } else { - $gui->src_workframe = $control->args->basehref . $gui->menuUrl . - "?edit=testproject&id={$control->args->testproject_id}" . - $gui->args; - } - - $control->draw_export_testplan_button = true; - $control->draw_import_xml_results_button = true; - - - $dummy = config_get('results'); - $gui->not_run = $dummy['status_code']['not_run']; - - $dummy = config_get('execution_filter_methods'); - $gui->lastest_exec_method = $dummy['status_code']['latest_execution']; - $gui->pageTitle = lang_get('href_execute_test'); - - $grants = checkAccessToExec($dbH,$control); - - // feature to enable/disable - $gui->features = array('export' => false,'import' => false); - $gui->execAccess = false; - if($grants['testplan_execute']) { - $gui->features['export'] = true; - $gui->features['import'] = true; - $gui->execAccess = true; - } - - if($grants['exec_ro_access']) { - $gui->execAccess = true; - } - - - $control->draw_export_testplan_button = $gui->features['export']; - $control->draw_import_xml_results_button = $gui->features['import']; - - return $gui; -} - - -/** - * - */ -function checkAccessToExec(&$dbH,&$ct) { - $tplan_id = intval($ct->args->testplan_id); - $sch = tlObject::getDBTables(array('testplans')); - $sql = "SELECT testproject_id FROM {$sch['testplans']} " . - "WHERE id=" . $tplan_id; - $rs = $dbH->get_recordset($sql); - if(is_null($rs)) - { - throw new Exception("Can not find Test Project For Test Plan - ABORT", 1); - - } - $rs = current($rs); - $tproject_id = $rs['testproject_id']; - - $user = $_SESSION['currentUser']; - $grants = null; - $k2a = array('testplan_execute','exec_ro_access'); - foreach($k2a as $r2c) - { - $grants[$r2c] = false; - if( $user->hasRight($dbH,$r2c,$tproject_id,$tplan_id,true) || $user->globalRoleID == TL_ROLES_ADMIN ) - { - $grants[$r2c] = true; - } - } - - return $grants; -} diff --git a/lib/execute/execNotes.php b/lib/execute/execNotes.php index 0df6e4f277..aada5ba389 100644 --- a/lib/execute/execNotes.php +++ b/lib/execute/execNotes.php @@ -1,85 +1,92 @@ -doAction) -{ - case 'edit': - break; - - case 'doUpdate': - doUpdate($db,$args); - break; -} -$map = get_execution($db,$args->exec_id); -$owebeditor->Value = $map[0]['notes']; - -$smarty = new TLSmarty(); -$smarty->assign('notes',$owebeditor->CreateHTML()); -$smarty->assign('editorType',$editorCfg['type']); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: - - args : - - returns: - -*/ -function doUpdate(&$dbHandler,&$argsObj) -{ - $tables = tlObjectWithDB::getDBTables('executions'); - $sql = "UPDATE {$tables['executions']} " . - " SET notes='" . $dbHandler->prepare_string($argsObj->notes) . "' " . - " WHERE id={$argsObj->exec_id} "; - $dbHandler->exec_query($sql); -} - - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $iParams = array("exec_id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,100), - "notes" => array(tlInputParameter::STRING_N)); - $args = new stdClass(); - R_PARAMS($iParams,$args); - return $args; -} - -?> \ No newline at end of file +doAction) { + case 'edit': + break; + + case 'doUpdate': + doUpdate($db, $args); + break; +} +$map = get_execution($db, $args->exec_id); +$owebeditor->Value = $map[0]['notes']; + +$smarty = new TLSmarty(); +$smarty->assign('notes', $owebeditor->CreateHTML()); +$smarty->assign('editorType', $editorCfg['type']); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * + * args : + * + * returns: + * + */ +function doUpdate(&$dbHandler, &$argsObj) +{ + $tables = tlObjectWithDB::getDBTables('executions'); + $sql = "UPDATE {$tables['executions']} " . " SET notes='" . + $dbHandler->prepare_string($argsObj->notes) . "' " . + " WHERE id={$argsObj->exec_id} "; + $dbHandler->exec_query($sql); +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $iParams = array( + "exec_id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "notes" => array( + tlInputParameter::STRING_N + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + return $args; +} + +?> diff --git a/lib/execute/execPrint.php b/lib/execute/execPrint.php index 1b742b6458..299a4b2439 100644 --- a/lib/execute/execPrint.php +++ b/lib/execute/execPrint.php @@ -1,71 +1,86 @@ -goback_url = !is_null($args->goback_url) ? $args->goback_url : ''; -$gui->page_title = ''; - -if($args->deleteAttachmentID >0) -{ - deleteAttachment($db,$args->deleteAttachmentID); -} - -// Struture defined in printDocument.php -$printingOptions = array('toc' => 0,'body' => 1,'summary' => 1, 'header' => 0,'headerNumbering' => 0, - 'passfail' => 0, 'author' => 1, 'notes' => 1, 'requirement' => 1, 'keyword' => 1, - 'cfields' => 1, 'displayVersion' => 1, 'displayDates' => 1, - 'docType' => SINGLE_TESTCASE, 'importance' => 1); - -$level = 0; -$tplanID = 0; -$prefix = null; -$text2print = ''; -$text2print .= renderHTMLHeader($gui->page_title,$_SESSION['basehref'],SINGLE_TESTCASE, - array('gui/javascript/testlink_library.js')); - -$text2print .= renderExecutionForPrinting($db,$_SESSION['basehref'],$args->id,$_SESSION['currentUser']); - -echo $text2print; - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - $args->deleteAttachmentID = isset($_REQUEST['deleteAttachmentID']) ? intval($_REQUEST['deleteAttachmentID']) : 0; - - $args->goback_url = null; - return $args; -} \ No newline at end of file +goback_url = ! is_null($args->goback_url) ? $args->goback_url : ''; +$gui->page_title = ''; + +if ($args->deleteAttachmentID > 0) { + deleteAttachment($db, $args->deleteAttachmentID); +} + +// Struture defined in printDocument.php +$printingOptions = array( + 'toc' => 0, + 'body' => 1, + 'summary' => 1, + 'header' => 0, + 'headerNumbering' => 0, + 'passfail' => 0, + 'author' => 1, + 'notes' => 1, + 'requirement' => 1, + 'keyword' => 1, + 'cfields' => 1, + 'displayVersion' => 1, + 'displayDates' => 1, + 'docType' => SINGLE_TESTCASE, + 'importance' => 1 +); + +$level = 0; +$tplanID = 0; +$prefix = null; +$text2print = ''; +$text2print .= renderHTMLHeader($gui->page_title, $_SESSION['basehref'], + SINGLE_TESTCASE, array( + 'gui/javascript/testlink_library.js' + )); + +$text2print .= renderExecutionForPrinting($db, $_SESSION['basehref'], $args->id, + $_SESSION['currentUser']); + +echo $text2print; + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + $args->deleteAttachmentID = isset($_REQUEST['deleteAttachmentID']) ? intval( + $_REQUEST['deleteAttachmentID']) : 0; + + $args->goback_url = null; + return $args; +} diff --git a/lib/execute/execSetResults.php b/lib/execute/execSetResults.php index 901f24b776..76c59ef5c7 100644 --- a/lib/execute/execSetResults.php +++ b/lib/execute/execSetResults.php @@ -1,2523 +1,2587 @@ -testcases_to_show - * - * Normally this script is called from the tree. - * Filters and other conditions (example display test cases just assigned to me,etc) - * can be applied, creating a set of test cases that can be used. - * Due to size restrictions on POST variables this info is transfered via $_SESSION. - * - * But because we have choosen to add access to this script from other features - * we have forgot to populate this info. - * This is the reason for several issues. - * The approach will be to understand who is the caller and apply different logics - * instead of recreate the logic to populate $_SESSION - * (I think this approach will be simpler). - * - * - * Note about step info - * is present in gui->map_last_exec - * - * -**/ -require_once('../../config.inc.php'); -require_once('common.php'); -require_once('exec.inc.php'); -require_once("attachments.inc.php"); -require_once("specview.php"); -require_once("web_editor.php"); -require_once('event_api.php'); - -$cfg = getCfg(); -require_once(require_web_editor($cfg->editorCfg['type'])); - -if( $cfg->exec_cfg->enable_test_automation ) { - require_once('remote_exec.php'); -} - -// CRITIC: -// If call to testlinkInitPage() is done AFTER require_once for BTS -// log to event viewer fails, but log to file works ok -testlinkInitPage($db); -$templateCfg = templateConfiguration(); - -$tcversion_id = null; -$submitResult = null; -list($args,$its,$cts) = init_args($db,$cfg); - -// ------------------------------------------------------------------------------ -// the default -1 create an out of range error on TC execution without platform -if ($args->platform_id == -1){ - $args->platform_id = 0; -} -// ------------------------------------------------------------------------------ - -$smarty = new TLSmarty(); -$smarty->assign('tsuite_info',null); - -$tree_mgr = new tree($db); -$tplan_mgr = new testplan($db); -$tcase_mgr = new testcase($db); -$exec_cfield_mgr = new exec_cfield_mgr($db,$args->tproject_id); -$fileRepo = tlAttachmentRepository::create($db); -$req_mgr = new requirement_mgr($db); - -$gui = initializeGui($db,$args,$cfg,$tplan_mgr,$tcase_mgr,$its,$cts); - -$_SESSION['history_on'] = $gui->history_on; -$attachmentInfos = null; - -$do_show_instructions = ($args->level == "" || $args->level == 'testproject') ? 1 : 0; -if ($do_show_instructions) { - show_instructions('executeTest'); - exit(); -} - -// Testplan executions and result archiving. -// Checks whether execute cases button was clicked -if($args->doExec == 1 && !is_null($args->tc_versions) && count($args->tc_versions)) { - $gui->remoteExecFeedback = launchRemoteExec($db,$args,$gui->tcasePrefix,$tplan_mgr,$tcase_mgr); -} - - -// link Update will be done on Context -// Context = testplan -// -// @20210901 -> CRITIC -// because we do not allow different versions on different platforms -// for same test plan -> platform MUST NOT BE USED -if( $args->linkLatestVersion && $args->level == 'testcase') { - $args->version_id = $tcase_mgr->updateTPlanLinkToLatestTCV($args->TCVToUpdate, $args->tplan_id); -} - - -// LOAD What To Display -list($linked_tcversions,$itemSet) = - getLinkedItems($args,$gui->history_on,$cfg,$tcase_mgr,$tplan_mgr); - -$tcase_id = 0; -$userid_array = null; -if(!is_null($linked_tcversions)) { - - $items_to_exec = array(); - $_SESSION['s_lastAttachmentInfos'] = null; - if($args->level == 'testcase') { - // passed by reference to be updated inside function - // $gui, $args - $tcase = null; - list($tcase_id,$tcversion_id,$latestExecIDInContext,$hasCFOnExec) = - processTestCase($tcase,$gui,$args,$cfg,$linked_tcversions, - $tree_mgr,$tcase_mgr,$fileRepo); - } else { - processTestSuite($db,$gui,$args,$itemSet,$tree_mgr,$tcase_mgr,$fileRepo); - $tcase_id = $itemSet->tcase_id; - $tcversion_id = $itemSet->tcversion_id; - } - - // Send Event for Drawing UI from plugins - $ctx = array('tplan_id' => $args->tplan_id, - 'build_id' => $args->build_id, - 'tcase_id' => $tcase_id, - 'tcversion_id' => $tcversion_id); - - $gui->plugins = array(); - $gui->plugins['EVENT_TESTRUN_DISPLAY'] = - event_signal('EVENT_TESTRUN_DISPLAY', $ctx); - - // check if value is an array before calling implode to avoid warnings in event log - $gui->tcversionSet = is_array($tcversion_id) ? implode(',',$tcversion_id) : $tcversion_id; - - // will create a record even if the testcase version has not been executed (GET_NO_EXEC) - // - // Can be DONE JUST ONCE AFTER write results to DB - // -------------------------------------------------------------------------- - // Results to DB - // - // 20130917 - this implementation regarding save_results is confusing. - // why ? - // because in some situations args->save_results is a number (0) an in other is an array - // with just one element with key => test case version ID executed. - // - if ($args->doSave || $args->doNavigate || $args->saveStepsPartialExec) { - // this has to be done to do not break logic present on write_execution() - $args->save_results = $args->save_and_next ? $args->save_and_next : - ($args->save_results ? $args->save_results : $args->save_and_exit); - - - if( $args->save_results || $args->do_bulk_save) { - // Need to get Latest execution ID before writing - $lexidSysWide = 0; - if($args->copyIssues && $args->level == 'testcase') { - $lexidSysWide = $tcase_mgr->getSystemWideLastestExecutionID($args->version_id); - } - - $_REQUEST['save_results'] = $args->save_results; - - // Steps Partial Execution Feature - if (isset($_REQUEST['step_notes'])) { - $ctx = new stdClass(); - $ctx->testplan_id = $args->tplan_id; - $ctx->platform_id = $args->platform_id; - $ctx->build_id = $args->build_id; - - $tcase_mgr->deleteStepsPartialExec(array_keys($_REQUEST['step_notes']),$ctx); - } - - list($execSet,$gui->addIssueOp,$gui->uploadOp) = - write_execution($db,$args,$_REQUEST,$its); - - // Copy Attachments from latest exec ? - if ($args->copyAttFromLEXEC && $cfg->exec_cfg->exec_mode->new_exec - && $args->level == 'testcase') { - - // we have got Latest Execution on Context on processTestCase() - if( $latestExecIDInContext > 0 ) { - - // need to copy : - // attachments at execution level - // attachments at step execution level - - // attachments at execution level - $fileRepo->copyAttachments($latestExecIDInContext, - $execSet[$tcversion_id],'executions'); - - // attachments at step execution level - $tbl = array(); - $tbl['exec_tcsteps'] = DB_TABLE_PREFIX . 'execution_tcsteps'; - $tbl['tcsteps'] = DB_TABLE_PREFIX . 'tcsteps'; - $sql = "SELECT step_number,tcstep_id, - EXTCS.id AS tcsexe_id +testcases_to_show + * + * Normally this script is called from the tree. + * Filters and other conditions (example display test cases just assigned to me,etc) + * can be applied, creating a set of test cases that can be used. + * Due to size restrictions on POST variables this info is transfered via $_SESSION. + * + * But because we have choosen to add access to this script from other features + * we have forgot to populate this info. + * This is the reason for several issues. + * The approach will be to understand who is the caller and apply different logics + * instead of recreate the logic to populate $_SESSION + * (I think this approach will be simpler). + * + * + * Note about step info + * is present in gui->map_last_exec + * + * + **/ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'exec.inc.php'; +require_once 'attachments.inc.php'; +require_once 'specview.php'; +require_once 'web_editor.php'; +require_once 'event_api.php'; + +$cfg = getCfg(); +require_once require_web_editor($cfg->editorCfg['type']); + +if ($cfg->exec_cfg->enable_test_automation) { + require_once 'remote_exec.php'; +} + +// CRITIC: +// If call to testlinkInitPage() is done AFTER require_once for BTS +// log to event viewer fails, but log to file works ok +testlinkInitPage($db); +$templateCfg = templateConfiguration(); + +$tcversion_id = null; +$submitResult = null; +list ($args, $its, $cts) = initArgs($db, $cfg); + +// the default -1 create an out of range error on TC execution without platform +if ($args->platform_id == - 1) { + $args->platform_id = 0; +} + +$smarty = new TLSmarty(); +$smarty->assign('tsuite_info', null); + +$tree_mgr = new tree($db); +$tplan_mgr = new testplan($db); +$tcaseMgr = new testcase($db); +$exec_cfield_mgr = new exec_cfield_mgr($db, $args->tproject_id); +$fileRepo = tlAttachmentRepository::create($db); +$req_mgr = new requirement_mgr($db); + +$gui = initializeGui($db, $args, $cfg, $tplan_mgr, $tcaseMgr, $its, $cts); + +$_SESSION['history_on'] = $gui->history_on; +$attachmentInfos = null; + +$do_show_instructions = ($args->level == "" || $args->level == 'testproject') ? 1 : 0; +if ($do_show_instructions) { + show_instructions('executeTest'); + exit(); +} + +// Testplan executions and result archiving. +// Checks whether execute cases button was clicked +if ($args->doExec == 1 && ! is_null($args->tc_versions) && + count($args->tc_versions)) { + $gui->remoteExecFeedback = launchRemoteExec($db, $args, $gui->tcasePrefix, + $tplan_mgr, $tcaseMgr); +} + +// link Update will be done on Context +// Context = testplan +// +// @20210901 -> CRITIC +// because we do not allow different versions on different platforms +// for same test plan -> platform MUST NOT BE USED +if ($args->linkLatestVersion && $args->level == 'testcase') { + $args->version_id = $tcaseMgr->updateTPlanLinkToLatestTCV( + $args->TCVToUpdate, $args->tplan_id); +} + +// LOAD What To Display +list ($linked_tcversions, $itemSet) = getLinkedItems($args, $gui->history_on, + $cfg, $tcaseMgr, $tplan_mgr); + +$tcase_id = 0; +$userid_array = null; +if (! is_null($linked_tcversions)) { + + $items_to_exec = array(); + $_SESSION['s_lastAttachmentInfos'] = null; + if ($args->level == 'testcase') { + // passed by reference to be updated inside function + // $gui, $args + $tcase = null; + list ($tcase_id, $tcversion_id, $latestExecIDInContext, $hasCFOnExec) = processTestCase( + $tcase, $gui, $args, $cfg, $linked_tcversions, $tree_mgr, $tcaseMgr, + $fileRepo); + } else { + processTestSuite($db, $gui, $args, $itemSet, $tree_mgr, $tcaseMgr, + $fileRepo); + $tcase_id = $itemSet->tcase_id; + $tcversion_id = $itemSet->tcversion_id; + } + + // Send Event for Drawing UI from plugins + $ctx = array( + 'tplan_id' => $args->tplan_id, + 'build_id' => $args->build_id, + 'tcase_id' => $tcase_id, + 'tcversion_id' => $tcversion_id + ); + + $gui->plugins = array(); + $gui->plugins['EVENT_TESTRUN_DISPLAY'] = event_signal( + 'EVENT_TESTRUN_DISPLAY', $ctx); + + // check if value is an array before calling implode to avoid warnings in event log + $gui->tcversionSet = is_array($tcversion_id) ? implode(',', $tcversion_id) : $tcversion_id; + + // will create a record even if the testcase version has not been executed (GET_NO_EXEC) + // + // Can be DONE JUST ONCE AFTER write results to DB + // -------------------------------------------------------------------------- + // Results to DB + // + // 20130917 - this implementation regarding save_results is confusing. + // why ? + // because in some situations args->save_results is a number (0) an in other is an array + // with just one element with key => test case version ID executed. + // + if ($args->doSave || $args->doNavigate || $args->saveStepsPartialExec) { + // this has to be done to do not break logic present on write_execution() + $args->save_results = $args->save_and_next ? $args->save_and_next : ($args->save_results ? $args->save_results : $args->save_and_exit); + + if ($args->save_results || $args->do_bulk_save) { + // Need to get Latest execution ID before writing + $lexidSysWide = 0; + if ($args->copyIssues && $args->level == 'testcase') { + $lexidSysWide = $tcaseMgr->getSystemWideLastestExecutionID( + $args->version_id); + } + + $_REQUEST['save_results'] = $args->save_results; + + // Steps Partial Execution Feature + if (isset($_REQUEST['step_notes'])) { + $ctx = new stdClass(); + $ctx->testplan_id = $args->tplan_id; + $ctx->platform_id = $args->platform_id; + $ctx->build_id = $args->build_id; + + $tcaseMgr->deleteStepsPartialExec( + array_keys($_REQUEST['step_notes']), $ctx); + } + + list ($execSet, $gui->addIssueOp, $gui->uploadOp) = write_execution( + $db, $args, $_REQUEST, $its); + + // Copy Attachments from latest exec ? + // we have got Latest Execution on Context on processTestCase() + if ($args->copyAttFromLEXEC && $cfg->exec_cfg->exec_mode->new_exec && + $args->level == 'testcase' && $latestExecIDInContext > 0) { + // need to copy : + // attachments at execution level + // attachments at step execution level + + // attachments at execution level + $fileRepo->copyAttachments($latestExecIDInContext, + $execSet[$tcversion_id], 'executions'); + + // attachments at step execution level + $tbl = array(); + $tbl['exec_tcsteps'] = DB_TABLE_PREFIX . 'execution_tcsteps'; + $tbl['tcsteps'] = DB_TABLE_PREFIX . 'tcsteps'; + $sql = "SELECT step_number,tcstep_id, + EXTCS.id AS tcsexe_id FROM {$tbl['tcsteps']} TCS JOIN {$tbl['exec_tcsteps']} EXTCS ON - EXTCS.tcstep_id = TCS.id - WHERE EXTCS.execution_id = "; - - $from = (array)$db->fetchRowsIntoMap($sql . $latestExecIDInContext,'step_number'); - - $to = (array)$db->fetchRowsIntoMap($sql . $execSet[$tcversion_id],'step_number'); - - foreach($from as $step_num => $sxelem) { - if( isset($to[$step_num]) ) { - $fileRepo->copyAttachments($sxelem['tcsexe_id'], - $to[$step_num]['tcsexe_id'],'execution_tcsteps'); - } - } - } - } - - - if($args->assignTask) { - $fid = $tplan_mgr->getFeatureID($args->tplan_id,$args->platform_id,$args->version_id); - $taskMgr = new assignment_mgr($db); - $taskDomain = $taskMgr->get_available_types(); - $taskStatusDomain = $taskMgr->get_available_status(); - - $fmap[$fid]['user_id'] = $fmap[$fid]['assigner_id'] = $args->user_id; - $fmap[$fid]['build_id'] = $args->build_id; - $fmap[$fid]['type'] = $taskDomain['testcase_execution']['id']; - $fmap[$fid]['status'] = $taskStatusDomain['open']['id']; - $taskMgr->assign($fmap); - } - - if ($lexidSysWide > 0 && $args->copyIssues - && $args->level == 'testcase') { - copyIssues($db,$lexidSysWide,$execSet[$args->version_id]); - } - - if ($args->level == 'testcase') { - // Propagate events - $ctx = array('id' => $execSet[$tcversion_id], - 'tplan_id' => $args->tplan_id, - 'build_id' => $args->build_id, - 'tcase_id' => $tcase_id, - 'status' => $args->statusSingle[$args->version_id], - 'directLink' => $args->direct_link); - event_signal('EVENT_EXECUTE_TEST', $ctx); - $tc_info = $tcase_mgr->getExternalID($tcase_id); - $tp_info = $tplan_mgr->get_by_id($args->tplan_id); - $build_info = $tplan_mgr->get_build_by_id($args->tplan_id,$args->build_id); - - logAuditEvent(TLS("audit_exec_saved",$tc_info[0],$build_info['name'],$tp_info['name']),"CREATE",$execSet[$tcversion_id],"execution"); - } - } - - // Need to re-read to update test case status - if ($args->save_and_next || $args->doMoveNext || $args->doMovePrevious) { - $nextInChain = -1; - if( $cfg->exec_cfg->exec_mode->save_and_move == 'unlimited' ) { - if( $args->caller == 'tcAssignedToMe') { - $optz = array('order_by' => 'ORDER BY TPTCV.node_order'); - $filters['build_id'] = $args->build_id; - - $xx = $tcase_mgr->get_assigned_to_user( - $args->user_id, $args->tproject_id, - array($args->tplan_id), $optz, $filters); - $xx = current($xx); - - // key test case id - // inside an idx array - $args->testcases_to_show = array_keys($xx); - } - - $chainLen = count($args->testcases_to_show); - foreach($args->testcases_to_show as $ix => $val) { - if( $val == $args->tc_id) { - $nextInChain = $ix+1; - if($nextInChain == $chainLen) { - $nextInChain = 0; - } - break; - } - } - } - - // IMPORTANT DEVELOPMENT NOTICE - // Normally this script is called from the tree. - // Filters and other conditions (example display test cases just assigned to me,etc) - // can be applied, creating a set of test cases that can be used. - // Due to size restrictions on POST variables this info is transfered via $_SESSION. - // - // But because we have choosen to add access to this script from other features - // we have forgot to populate this info. - // This is the reason for several issues. - // The approach will be to understand who is the caller and apply different logics - // instead of recreate the logic to populate $_SESSION (I think this approach - // will be simpler). - $doSingleStep = is_null($args->testcases_to_show); - $args->testcases_to_show = (array)$args->testcases_to_show; - - $opt4sibling = array('move' => $args->moveTowards); - switch ($args->caller) { - case 'tcAssignedToMe': - $doSingleStep = true; - $opt4sibling['assigned_to'] = array('user_id' => $args->user_id, 'build_id' => $args->build_id); - break; - - default: - break; - } - - switch($cfg->exec_cfg->exec_mode->save_and_move) { - case 'unlimited': - // get position on chain - $opx = array('tcase_id' => - $args->testcases_to_show[$nextInChain]); - $nextItem = $tplan_mgr->get_linked_tcvid($args->tplan_id,$args->platform_id,$opx); - $nextItem = current($nextItem); - break; - - case 'limited': - $nextItem = $tplan_mgr->getTestCaseNextSibling($args->tplan_id,$tcversion_id,$args->platform_id,$opt4sibling); - if(!$doSingleStep) - { - while (!is_null($nextItem) && !in_array($nextItem['tcase_id'], $args->testcases_to_show)) - { - $nextItem = $tplan_mgr->getTestCaseNextSibling($args->tplan_id,$nextItem['tcversion_id'], - $args->platform_id,$opt4sibling); - } - } - break; - } // cfg - - if( !is_null($nextItem) ) - { - $tcase_id = $nextItem['tcase_id']; - $tcversion_id = $nextItem['tcversion_id']; - - // Save and Next - Issues with display CF for test plan design - always EMPTY - // need info about this test case => need to update linked_tcversions info - $identity = array('id' => $nextItem['tcase_id'], 'version_id' => $nextItem['tcversion_id']); - list($lt,$xdm) = getLinkedItems($args,$gui->history_on,$cfg,$tcase_mgr,$tplan_mgr,$identity); - processTestCase($nextItem,$gui,$args,$cfg,$lt,$tree_mgr,$tcase_mgr,$fileRepo); - } - } - else if($args->save_and_exit) { - $args->reload_caller = true; - } - else if ($args->saveStepsPartialExec) { - $partialExec = array("notes" => $_REQUEST['step_notes'], - "status" => $_REQUEST['step_status'] ); - - $ctx = new stdClass(); - $ctx->testplan_id = $args->tplan_id; - $ctx->platform_id = $args->platform_id; - $ctx->build_id = $args->build_id; - $ctx->tester_id = $args->user_id; - $tcase_mgr->saveStepsPartialExec($partialExec,$ctx); - } - } - - if(!$args->reload_caller) { - if ($args->doDelete) { - $dummy = delete_execution($db,$args->exec_to_delete); - if ($dummy){ - $tc_info = $tcase_mgr->getExternalID($tcase_id); - $tp_info = $tplan_mgr->get_by_id($args->tplan_id); - $build_info = $tplan_mgr->get_build_by_id($args->tplan_id,$args->build_id); - logAuditEvent(TLS("audit_exec_deleted",$tc_info[0],$build_info['name'],$tp_info['name']),"DELETE",$args->exec_to_delete,"execution"); - } - } - - // Important Notice: - // $tcase_id and $tcversions_id, can be ARRAYS - // when user enable bulk execution - if( is_array($tcase_id)) { - $tcase_id = array_intersect($tcase_id, $args->testcases_to_show); - } - - $gui->map_last_exec = - getLatestExec($db,$tcase_id,$tcversion_id,$gui,$args,$tcase_mgr); - - $gui->map_last_exec_any_build = null; - - - // need to get step info from gui - $stepSet = array(); - foreach($gui->map_last_exec as $tcID => $dummy) { - if( null != $gui->map_last_exec[$tcID]['steps'] ) { - foreach ($gui->map_last_exec[$tcID]['steps'] as $step) { - $stepSet[] = $step["id"]; - } - } - } - - if( count($stepSet) > 0 ) { - // test case version under exec has steps - $ctx = new stdClass(); - $ctx->testplan_id = $args->tplan_id; - $ctx->platform_id = $args->platform_id; - $ctx->build_id = $args->build_id; - - $gui->stepsPartialExec = - $tcase_mgr->getStepsPartialExec($stepSet,$ctx); - - if( null != $gui->stepsPartialExec ) { - // will reload it! - $kij = current(array_keys($gui->map_last_exec)); - $cucu = &$gui->map_last_exec[$kij]; - foreach($cucu['steps'] as $ccx => $se) { - $stepID = $se['id']; - if( isset($gui->stepsPartialExec[$stepID]) ) { - $cucu['steps'][$ccx]['execution_notes'] = - $gui->stepsPartialExec[$stepID]['notes']; - - $cucu['steps'][$ccx]['execution_status'] = - $gui->stepsPartialExec[$stepID]['status']; - } - } - } - } - $testerIdKey = 'tester_id'; - - $gui->other_execs=null; - $testerid = null; - - if($args->level == 'testcase') { - // @TODO 20090815 - franciscom check what to do with platform - if( $cfg->exec_cfg->show_last_exec_any_build ) { - $options=array('getNoExecutions' => 1, 'groupByBuild' => 0); - $gui->map_last_exec_any_build = $tcase_mgr->get_last_execution($tcase_id,$tcversion_id,$args->tplan_id,testcase::ANY_BUILD, - $args->platform_id,$options); - - // Get UserID and Updater ID for current Version - $tc_current = $gui->map_last_exec_any_build; - foreach ($tc_current as $key => $value) { - $testerid = $value[$testerIdKey]; - $userid_array[$testerid] = $testerid; - } - } - - $gui->req_details = null; - if( $args->reqEnabled ) { - $gui->req_details = $req_mgr->getActiveForTCVersion($tcversion_id); - } - - $idCard = array('tcase_id' => $tcase_id, 'tcversion_id' => $tcversion_id); - $gui->relations = $tcase_mgr->getTCVersionRelations($idCard); - - $gui->kw = $tcase_mgr->getKeywordsByIdCard($idCard,array('output' => 'kwfull')); - - if(!is_null($cts)) { - $gui->scripts[$tcversion_id]=$tcase_mgr->getScriptsForTestCaseVersion($cts, $tcversion_id); - } - - $gui->other_execs = getOtherExecutions($db,$tcase_id,$tcversion_id,$gui,$args,$cfg,$tcase_mgr); - - // Get attachment,bugs, etc - if(!is_null($gui->other_execs)) { - //Get the Tester ID for all previous executions - foreach ($gui->other_execs as $key => $execution) { - foreach ($execution as $singleExecution) { - $testerid = $singleExecution[$testerIdKey]; - $userid_array[$testerid] = $testerid; - } - } - $other_info = exec_additional_info($db,$fileRepo,$tcase_mgr,$gui->other_execs, - $args->tplan_id,$args->tproject_id, - $args->issue_tracker_enabled,$its); - - $gui->attachments=$other_info['attachment']; - $gui->bugs=$other_info['bugs']; - $gui->other_exec_cfields=$other_info['cfexec_values']; - - // this piece of code is useful to avoid error on smarty template due to undefined value - if( is_array($tcversion_id) && (count($gui->other_execs) != count($gui->map_last_exec)) ) { - foreach($tcversion_id as $version_id) { - if( !isset($gui->other_execs[$version_id]) ) { - $gui->other_execs[$version_id]=null; - } - } - } - - } // if(!is_null($gui->other_execs)) - } - } -} // if(!is_null($linked_tcversions)) - - -if($args->reload_caller) { - windowCloseAndOpenerReload(); - exit(); -} else { - // Removing duplicate and NULL id's - unset($userid_array['']); - $userSet = null; - if ($userid_array) { - foreach($userid_array as $value) { - $userSet[] = $value; - } - } - - $gui->headsUpTSuite = - smarty_assign_tsuite_info($smarty,$tree_mgr,$tcase_id,$args->tproject_id,$cfg); - if ($args->doSave || $args->saveStepsPartialExec) { - $gui->headsUpTSuite = false; - } - - // Bulk is possible when test suite is selected (and is allowed in config) - if( $gui->can_use_bulk_op = ($args->level == 'testsuite') ) { - $xx = null; - if( property_exists($gui, 'execution_time_cfields') ) { - $xx = current((array)$gui->execution_time_cfields); - } - - $gui->execution_time_cfields = null; - if( !is_null($xx) ) { - $gui->execution_time_cfields[0] = $xx; - } - } - - // has sense only if there are cf for execution - // may be can improve check - if( $gui->can_use_bulk_op == false && - $cfg->exec_cfg->exec_mode->new_exec == 'latest' ) { - - list($tcase_id,$tcversion_id,$latestExecIDInContext,$hasCFOnExec) = - processTestCase($tcase,$gui,$args,$cfg,$linked_tcversions, - $tree_mgr,$tcase_mgr,$fileRepo); - - if($latestExecIDInContext > 0) { - $tbl = DB_TABLE_PREFIX . 'executions'; - $sql = "SELECT notes FROM $tbl - WHERE id = $latestExecIDInContext"; - $rs = $db->get_recordset($sql); - $gui->lexNotes = $rs != null ? $rs[0]['notes'] : null; - } - - } - - initWebEditors($gui,$cfg,$_SESSION['basehref']); - - - - // To silence smarty errors - // future must be initialized in a right way - $smarty->assign('test_automation_enabled',0); - $smarty->assign('gui',$gui); - $smarty->assign('cfg',$cfg); - $smarty->assign('users',tlUser::getByIDs($db,$userSet)); - - $smarty->display($templateCfg->template_dir . $templateCfg->default_template); -} - -/** - * - * - */ -function init_args(&$dbHandler,$cfgObj) { - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - // Settings and Filters that we put on session to create some - // sort of persistent scope, because we have had issues when passing this info - // using GET mode (size limits) - // - // we get info about build_id, platform_id, etc ... - getSettingsAndFilters($args); - manageCookies($args,$cfgObj); - - // need to comunicate with left frame, will do via $_SESSION and form_token - if( ($args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0) > 0 ) - { - // do not understand why this do not works OK - // $_SESSION[$args->treeFormToken]['loadExecDashboard'] = false; - $_SESSION['loadExecDashboard'][$args->treeFormToken] = false; - } - - - $args->followTheWhiteRabbit = isset($_REQUEST['followTheWhiteRabbit']) ? 1 : 0; - if(is_null($args->refreshTree)) { - $args->refreshTree = isset($_REQUEST['refresh_tree']) ? intval($_REQUEST['refresh_tree']) : 0; - } - - $args->basehref = $_SESSION['basehref']; - $args->assignTask = isset($_REQUEST['assignTask']) ? 1: 0; - $args->createIssue = isset($_REQUEST['createIssue']) ? 1: 0; - $args->copyIssues = isset($_REQUEST['copyIssues']) ? 1: 0; - $args->copyAttFromLEXEC = isset($_REQUEST['copyAttFromLEXEC']) ? 1: 0; - - - $args->tc_id = null; - $args->tsuite_id = null; - $args->user = $_SESSION['currentUser']; - $args->user_id = intval($args->user->dbID); - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - - $args->caller = isset($_REQUEST['caller']) ? $_REQUEST['caller'] : 'exec_feature'; - $args->reload_caller = false; - - $args->doExec = isset($_REQUEST['execute_cases']) ? 1 : 0; - $args->doDelete = isset($_REQUEST['do_delete']) ? $_REQUEST['do_delete'] : 0; - - $args->doMoveNext = isset($_REQUEST['move2next']) ? 1 : 0; - - $args->doMovePrevious = isset($_REQUEST['move2previous']) ? $_REQUEST['move2previous'] : 0; - $args->moveTowards = $args->doMoveNext ? 'forward' : ($args->doMovePrevious ? 'backward' : null); - - // can be a list, will arrive via form POST - $args->tc_versions = isset($_REQUEST['tc_version']) ? $_REQUEST['tc_version'] : null; - - // it's a submit button! - $args->saveStepsPartialExec = isset($_REQUEST['saveStepsPartialExec']); - - $key2loop = array('level' => '','status' => null, 'statusSingle' => null, - 'do_bulk_save' => 0,'save_results' => 0,'save_and_next' => 0, - 'save_and_exit' => 0); - foreach($key2loop as $key => $value) { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; - } - - $args->doSave = $args->save_results || $args->save_and_next || - $args->save_and_exit || $args->do_bulk_save; - - $args->doNavigate = $args->doMoveNext || $args->doMovePrevious; - - - // See details on: "When nullify filter_status - 20080504" in this file - if( $args->level == 'testcase' || is_null($args->filter_status) || - (!is_array($args->filter_status) && trim($args->filter_status)=='') - ) { - $args->filter_status = null; - } - else { - // 20130306 - franciscom - // This (without the strlen() check) generated issue 5541: When "Result" filter is used ... - // at least when result DIFFERENT that NOT RUN is used on filter - // - // 20120616 - franciscom - // some strange thing to investigate, seems that unserialize is invoked - // under the hood when getting data from $_REQUEST, then this piece - // of code not only will be useless BUT WRONG, because will try - // to unserialize something that IS NOT SERIALIZED!!!! - - // After TICKET 6651, may be need to limit size of $args->filter_status - if(is_string($args->filter_status) && strlen($args->filter_status) > 1) { - $args->filter_status = json_decode($args->filter_status); - } - } - - - switch($args->level) { - case 'testcase': - $args->tc_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; - if( !is_null($args->tc_versions) ) { - $args->tc_id = current($args->tc_versions); - $args->id = $args->tc_id; - $args->version_id = key($args->tc_versions); - } - $args->tsuite_id = null; - break; - - case 'testsuite': - $args->tsuite_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; - $args->tc_id = null; - break; - } - - // - $args->updateTCVToThis = isset($_REQUEST['updateTCVToThis']) ? $_REQUEST['updateTCVToThis'] : null; - if( null != $args->updateTCVToThis ) { - $args->version_id = intval($args->updateTCVToThis); - } - - - $args->tsuitesInBranch = null; - if( !is_null($args->tsuite_id) ) { - // will get all test suites in this branch, in order to limit amount of data returned - // by functions/method that collect linked tcversions - // THIS COLLECT ONLY FIRST LEVEL UNDER test suite, do not do deep search - // Need to understand is still needed - $tsuite_mgr = new testsuite($dbHandler); - $xx = $tsuite_mgr->get_children($args->tsuite_id,array('details' => 'id')); - $ldx = count($xx); - $xx[$ldx] = $args->tsuite_id; - $args->tsuitesInBranch = $xx; - unset($tsuite_mgr); - } - - - // TICKET 5630: Test Results by direct link ... - $args->tplan_id = intval(isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); - $args->tproject_id = intval(isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); - - if($args->tproject_id <= 0) { - $tree_mgr = new tree($dbHandler); - $dm = $tree_mgr->get_node_hierarchy_info($args->tplan_id); - $args->tproject_id = $dm['parent_id']; - } - - - $args->addLinkToTL = isset($_REQUEST['addLinkToTL']) ? TRUE : FALSE; - $args->addLinkToTLPrintView = isset($_REQUEST['addLinkToTLPrintView']) ? TRUE : FALSE; - - // Do this only on single execution mode - // get issue tracker config and object to manage TestLink - BTS integration - $args->itsCfg = null; - $its = null; - - $tproject_mgr = new testproject($dbHandler); - $info = $tproject_mgr->get_by_id($args->tproject_id); - $args->reqEnabled = intval($info['option_reqs']); - - unset($tproject_mgr); - $bug_summary['minLengh'] = 1; - $bug_summary['maxLengh'] = 1; - - if( ($args->issue_tracker_enabled = $info['issue_tracker_enabled']) ) { - $it_mgr = new tlIssueTracker($dbHandler); - $args->itsCfg = $it_mgr->getLinkedTo($args->tproject_id); - $its = $it_mgr->getInterfaceObject($args->tproject_id); - - if(!is_null($args->itsCfg) && !is_null($its)) { - $bug_summary['maxLengh'] = $its->getBugSummaryMaxLength(); - } - unset($it_mgr); - } - - initArgsIssueOnTestCase($args,$bug_summary); - - initArgsIssueOnSteps($args,$bug_summary); - - // get code tracker config and object to manage TestLink - CTS integration - $args->ctsCfg = null; - $cts = null; - - if( ($args->codeTrackerEnabled = intval($info['code_tracker_enabled'])) ) { - $ct_mgr = new tlCodeTracker($dbHandler); - $args->ctsCfg = $ct_mgr->getLinkedTo($args->tproject_id); - $cts = $ct_mgr->getInterfaceObject($args->tproject_id); - - unset($ct_mgr); - } - - // is a submit button - $prop = 'linkLatestVersion'; - $args->$prop = isset($_REQUEST[$prop]); - - $prop = 'TCVToUpdate'; - $args->$prop = intval(isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : 0); - - - $prop = 'updateTCVToThis'; - $args->$prop = intval(isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : 0); - - return array($args,$its,$cts); -} - -/** - * - * - */ -function initArgsIssueOnTestCase(&$argsObj,$bugSummaryProp) { - - $inputCfg = array("bug_notes" => array("POST",tlInputParameter::STRING_N), - "issueType" => array("POST",tlInputParameter::INT_N), - "issuePriority" => array("POST",tlInputParameter::INT_N), - "artifactComponent" => array("POST",tlInputParameter::ARRAY_INT), - "artifactVersion" => array("POST",tlInputParameter::ARRAY_INT)); - - $inputCfg["bug_summary"] = array("POST",tlInputParameter::STRING_N); - - // hmm this MAGIC needs to be commented - if(!$argsObj->do_bulk_save) { - $inputCfg["bug_summary"][2] = $bugSummaryProp['minLengh']; - $inputCfg["bug_summary"][3] = $bugSummaryProp['maxLengh']; - } - - I_PARAMS($inputCfg,$argsObj); - -} - -/** - * - * - */ -function initArgsIssueOnSteps(&$argsObj,$bugSummaryProp) { - $arrayOfInt = array("POST",tlInputParameter::ARRAY_INT); - - $cfg = array("issueBodyForStep" => array("POST",tlInputParameter::ARRAY_STRING_N), - "issueTypeForStep" => $arrayOfInt, - "issuePriorityForStep" => $arrayOfInt); - - $cfg["issueSummaryForStep"] = array("POST",tlInputParameter::ARRAY_STRING_N); - - // hmm this MAGIC needs to be commented - if(!$argsObj->do_bulk_save) { - $cfg["issueSummaryForStep"][2] = $bugSummaryProp['minLengh']; - $cfg["issueSummaryForStep"][3] = $bugSummaryProp['maxLengh']; - } - - I_PARAMS($cfg,$argsObj); - - // Special - // Array of Check Boxes: - // 'issueForStep','addLinkToTLForStep' - $sk = array('issueForStep','addLinkToTLForStep', - 'artifactComponentForStep','artifactVersionForStep'); - - foreach($sk as $kt) { - $argsObj->$kt = null; - if(isset($_REQUEST[$kt])) { - $argsObj->$kt = $_REQUEST[$kt]; - } - } - -} - -/* - function: - - args : - - returns: - -*/ -function manage_history_on($hash_REQUEST,$hash_SESSION, - $exec_cfg,$btn_on_name,$btn_off_name,$hidden_on_name) -{ - - - if( isset($hash_REQUEST[$btn_on_name]) ) - { - $history_on = true; - } - elseif(isset($_REQUEST[$btn_off_name])) - { - $history_on = false; - } - elseif (isset($_REQUEST[$hidden_on_name])) - { - $history_on = $_REQUEST[$hidden_on_name]; - } - elseif (isset($_SESSION[$hidden_on_name])) - { - $history_on = $_SESSION[$hidden_on_name]; - } - else - { - $history_on = $exec_cfg->history_on; - } - - return $history_on ? true : false; -} - -/* - function: get_ts_name_details - - args : - - returns: map with key=TCID - values= assoc_array([tsuite_id => 5341 - [details] => my detailas ts1 - [tcid] => 5343 - [tsuite_name] => ts1) -*/ -function get_ts_name_details(&$db,$tcase_id) { - $tables = array(); - $tables['testsuites'] = DB_TABLE_PREFIX . 'testsuites'; - $tables['nodes_hierarchy'] = DB_TABLE_PREFIX . 'nodes_hierarchy'; - - - $rs = ''; - $do_query = true; - $sql = "SELECT TS.id AS tsuite_id, TS.details, - NHA.id AS tc_id, NHB.name AS tsuite_name - FROM {$tables['testsuites']} TS, - {$tables['nodes_hierarchy']} NHA, + EXTCS.tcstep_id = TCS.id + WHERE EXTCS.execution_id = "; + + $from = (array) $db->fetchRowsIntoMap( + $sql . $latestExecIDInContext, 'step_number'); + + $to = (array) $db->fetchRowsIntoMap( + $sql . $execSet[$tcversion_id], 'step_number'); + + foreach ($from as $step_num => $sxelem) { + if (isset($to[$step_num])) { + $fileRepo->copyAttachments($sxelem['tcsexe_id'], + $to[$step_num]['tcsexe_id'], 'execution_tcsteps'); + } + } + } + + if ($args->assignTask) { + $fid = $tplan_mgr->getFeatureID($args->tplan_id, + $args->platform_id, $args->version_id); + $taskMgr = new assignment_mgr($db); + $taskDomain = $taskMgr->get_available_types(); + $taskStatusDomain = $taskMgr->get_available_status(); + + $fmap[$fid]['user_id'] = $fmap[$fid]['assigner_id'] = $args->user_id; + $fmap[$fid]['build_id'] = $args->build_id; + $fmap[$fid]['type'] = $taskDomain['testcase_execution']['id']; + $fmap[$fid]['status'] = $taskStatusDomain['open']['id']; + $taskMgr->assign($fmap); + } + + if ($lexidSysWide > 0 && $args->copyIssues && + $args->level == 'testcase') { + copyIssues($db, $lexidSysWide, $execSet[$args->version_id]); + } + + if ($args->level == 'testcase') { + // Propagate events + $ctx = array( + 'id' => $execSet[$tcversion_id], + 'tplan_id' => $args->tplan_id, + 'build_id' => $args->build_id, + 'tcase_id' => $tcase_id, + 'status' => $args->statusSingle[$args->version_id], + 'directLink' => $args->direct_link + ); + event_signal('EVENT_EXECUTE_TEST', $ctx); + $tc_info = $tcaseMgr->getExternalID($tcase_id); + $tp_info = $tplan_mgr->get_by_id($args->tplan_id); + $build_info = $tplan_mgr->get_build_by_id($args->tplan_id, + $args->build_id); + + logAuditEvent( + TLS("audit_exec_saved", $tc_info[0], $build_info['name'], + $tp_info['name']), "CREATE", $execSet[$tcversion_id], + "execution"); + } + } + + // Need to re-read to update test case status + if ($args->save_and_next || $args->doMoveNext || $args->doMovePrevious) { + $nextInChain = - 1; + if ($cfg->exec_cfg->exec_mode->save_and_move == 'unlimited') { + if ($args->caller == 'tcAssignedToMe') { + $optz = array( + 'order_by' => 'ORDER BY TPTCV.node_order' + ); + $filters['build_id'] = $args->build_id; + + $xx = $tcaseMgr->getAssignedToUser($args->user_id, + $args->tproject_id, array( + $args->tplan_id + ), $optz, $filters); + $xx = current($xx); + + // key test case id + // inside an idx array + $args->testcases_to_show = array_keys($xx); + } + + $chainLen = count($args->testcases_to_show); + foreach ($args->testcases_to_show as $ix => $val) { + if ($val == $args->tc_id) { + $nextInChain = $ix + 1; + if ($nextInChain == $chainLen) { + $nextInChain = 0; + } + break; + } + } + } + + // IMPORTANT DEVELOPMENT NOTICE + // Normally this script is called from the tree. + // Filters and other conditions (example display test cases just assigned to me,etc) + // can be applied, creating a set of test cases that can be used. + // Due to size restrictions on POST variables this info is transfered via $_SESSION. + // + // But because we have choosen to add access to this script from other features + // we have forgot to populate this info. + // This is the reason for several issues. + // The approach will be to understand who is the caller and apply different logics + // instead of recreate the logic to populate $_SESSION (I think this approach + // will be simpler). + $doSingleStep = is_null($args->testcases_to_show); + $args->testcases_to_show = (array) $args->testcases_to_show; + + $opt4sibling = array( + 'move' => $args->moveTowards + ); + switch ($args->caller) { + case 'tcAssignedToMe': + $doSingleStep = true; + $opt4sibling['assigned_to'] = array( + 'user_id' => $args->user_id, + 'build_id' => $args->build_id + ); + break; + + default: + break; + } + + switch ($cfg->exec_cfg->exec_mode->save_and_move) { + case 'unlimited': + // get position on chain + $opx = array( + 'tcase_id' => $args->testcases_to_show[$nextInChain] + ); + $nextItem = $tplan_mgr->get_linked_tcvid($args->tplan_id, + $args->platform_id, $opx); + $nextItem = current($nextItem); + break; + + case 'limited': + $nextItem = $tplan_mgr->getTestCaseNextSibling( + $args->tplan_id, $tcversion_id, $args->platform_id, + $opt4sibling); + if (! $doSingleStep) { + while (! is_null($nextItem) && + ! in_array($nextItem['tcase_id'], + $args->testcases_to_show)) { + $nextItem = $tplan_mgr->getTestCaseNextSibling( + $args->tplan_id, $nextItem['tcversion_id'], + $args->platform_id, $opt4sibling); + } + } + break; + } // cfg + + if (! is_null($nextItem)) { + $tcase_id = $nextItem['tcase_id']; + $tcversion_id = $nextItem['tcversion_id']; + + // Save and Next - Issues with display CF for test plan design - always EMPTY + // need info about this test case => need to update linked_tcversions info + $identity = array( + 'id' => $nextItem['tcase_id'], + 'version_id' => $nextItem['tcversion_id'] + ); + list ($lt, $xdm) = getLinkedItems($args, $gui->history_on, $cfg, + $tcaseMgr, $tplan_mgr, $identity); + processTestCase($nextItem, $gui, $args, $cfg, $lt, $tree_mgr, + $tcaseMgr, $fileRepo); + } + } elseif ($args->save_and_exit) { + $args->reload_caller = true; + } elseif ($args->saveStepsPartialExec) { + $partialExec = array( + "notes" => $_REQUEST['step_notes'], + "status" => $_REQUEST['step_status'] + ); + + $ctx = new stdClass(); + $ctx->testplan_id = $args->tplan_id; + $ctx->platform_id = $args->platform_id; + $ctx->build_id = $args->build_id; + $ctx->tester_id = $args->user_id; + $tcaseMgr->saveStepsPartialExec($partialExec, $ctx); + } + } + + if (! $args->reload_caller) { + if ($args->doDelete) { + $dummy = delete_execution($db, $args->exec_to_delete); + if ($dummy) { + $tc_info = $tcaseMgr->getExternalID($tcase_id); + $tp_info = $tplan_mgr->get_by_id($args->tplan_id); + $build_info = $tplan_mgr->get_build_by_id($args->tplan_id, + $args->build_id); + logAuditEvent( + TLS("audit_exec_deleted", $tc_info[0], $build_info['name'], + $tp_info['name']), "DELETE", $args->exec_to_delete, + "execution"); + } + } + + // Important Notice: + // $tcase_id and $tcversions_id, can be ARRAYS + // when user enable bulk execution + if (is_array($tcase_id)) { + $tcase_id = array_intersect($tcase_id, $args->testcases_to_show); + } + + $gui->map_last_exec = getLatestExec($db, $tcase_id, $tcversion_id, $gui, + $args, $tcaseMgr); + + $gui->map_last_exec_any_build = null; + + // need to get step info from gui + $stepSet = array(); + foreach ($gui->map_last_exec as $tcID => $dummy) { + if (null != $gui->map_last_exec[$tcID]['steps']) { + foreach ($gui->map_last_exec[$tcID]['steps'] as $step) { + $stepSet[] = $step["id"]; + } + } + } + + if (! empty($stepSet)) { + // test case version under exec has steps + $ctx = new stdClass(); + $ctx->testplan_id = $args->tplan_id; + $ctx->platform_id = $args->platform_id; + $ctx->build_id = $args->build_id; + + $gui->stepsPartialExec = $tcaseMgr->getStepsPartialExec($stepSet, + $ctx); + + if (null != $gui->stepsPartialExec) { + // will reload it! + $kij = current(array_keys($gui->map_last_exec)); + $cucu = &$gui->map_last_exec[$kij]; + foreach ($cucu['steps'] as $ccx => $se) { + $stepID = $se['id']; + if (isset($gui->stepsPartialExec[$stepID])) { + $cucu['steps'][$ccx]['execution_notes'] = $gui->stepsPartialExec[$stepID]['notes']; + + $cucu['steps'][$ccx]['execution_status'] = $gui->stepsPartialExec[$stepID]['status']; + } + } + } + } + $testerIdKey = 'tester_id'; + + $gui->other_execs = null; + $testerid = null; + + if ($args->level == 'testcase') { + // @TODO 20090815 - franciscom check what to do with platform + if ($cfg->exec_cfg->show_last_exec_any_build) { + $options = array( + 'getNoExecutions' => 1, + 'groupByBuild' => 0 + ); + $gui->map_last_exec_any_build = $tcaseMgr->getLastExecution( + $tcase_id, $tcversion_id, $args->tplan_id, + testcase::ANY_BUILD, $args->platform_id, $options); + + // Get UserID and Updater ID for current Version + $tc_current = $gui->map_last_exec_any_build; + foreach ($tc_current as $value) { + $testerid = $value[$testerIdKey]; + $userid_array[$testerid] = $testerid; + } + } + + $gui->req_details = null; + if ($args->reqEnabled) { + $gui->req_details = $req_mgr->getActiveForTCVersion( + $tcversion_id); + } + + $idCard = array( + 'tcase_id' => $tcase_id, + 'tcversion_id' => $tcversion_id + ); + $gui->relations = $tcaseMgr->getTCVersionRelations($idCard); + + $gui->kw = $tcaseMgr->getKeywordsByIdCard($idCard, + array( + 'output' => 'kwfull' + )); + + if (! is_null($cts)) { + $gui->scripts[$tcversion_id] = $tcaseMgr->getScriptsForTestCaseVersion( + $cts, $tcversion_id); + } + + $gui->other_execs = getOtherExecutions($db, $tcase_id, $tcversion_id, + $gui, $args, $cfg, $tcaseMgr); + + // Get attachment,bugs, etc + if (! is_null($gui->other_execs)) { + // Get the Tester ID for all previous executions + foreach ($gui->other_execs as $execution) { + foreach ($execution as $singleExecution) { + $testerid = $singleExecution[$testerIdKey]; + $userid_array[$testerid] = $testerid; + } + } + $other_info = execAdditionalInfo($db, $fileRepo, $tcaseMgr, + $gui->other_execs, $args->tplan_id, $args->tproject_id, + $args->issue_tracker_enabled, $its); + + $gui->attachments = $other_info['attachment']; + $gui->bugs = $other_info['bugs']; + $gui->other_exec_cfields = $other_info['cfexec_values']; + + // this piece of code is useful to avoid error on smarty template due to undefined value + if (is_array($tcversion_id) && + (count($gui->other_execs) != count($gui->map_last_exec))) { + foreach ($tcversion_id as $version_id) { + if (! isset($gui->other_execs[$version_id])) { + $gui->other_execs[$version_id] = null; + } + } + } + } + } + } +} + +if ($args->reload_caller) { + windowCloseAndOpenerReload(); + exit(); +} else { + // Removing duplicate and NULL id's + unset($userid_array['']); + $userSet = null; + if ($userid_array) { + foreach ($userid_array as $value) { + $userSet[] = $value; + } + } + + $gui->headsUpTSuite = smartyAssignTestsuiteInfo($smarty, $tree_mgr, + $tcase_id, $args->tproject_id, $cfg); + if ($args->doSave || $args->saveStepsPartialExec) { + $gui->headsUpTSuite = false; + } + + // Bulk is possible when test suite is selected (and is allowed in config) + if ($gui->can_use_bulk_op = ($args->level == 'testsuite')) { + $xx = null; + if (property_exists($gui, 'execution_time_cfields')) { + $xx = current((array) $gui->execution_time_cfields); + } + + $gui->execution_time_cfields = null; + if (! is_null($xx)) { + $gui->execution_time_cfields[0] = $xx; + } + } + + // has sense only if there are cf for execution + // may be can improve check + if (! $gui->can_use_bulk_op && + $cfg->exec_cfg->exec_mode->new_exec == 'latest') { + + list ($tcase_id, $tcversion_id, $latestExecIDInContext, $hasCFOnExec) = processTestCase( + $tcase, $gui, $args, $cfg, $linked_tcversions, $tree_mgr, $tcaseMgr, + $fileRepo); + + if ($latestExecIDInContext > 0) { + $tbl = DB_TABLE_PREFIX . 'executions'; + $sql = "SELECT notes FROM $tbl + WHERE id = $latestExecIDInContext"; + $rs = $db->get_recordset($sql); + $gui->lexNotes = $rs != null ? $rs[0]['notes'] : null; + } + } + + initWebEditors($gui, $cfg, $_SESSION['basehref']); + + // To silence smarty errors + // future must be initialized in a right way + $smarty->assign('test_automation_enabled', 0); + $smarty->assign('gui', $gui); + $smarty->assign('cfg', $cfg); + $smarty->assign('users', tlUser::getByIDs($db, $userSet)); + + $smarty->display( + $templateCfg->template_dir . $templateCfg->default_template); +} + +/** + */ +function initArgs(&$dbHandler, $cfgObj) +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + // Settings and Filters that we put on session to create some + // sort of persistent scope, because we have had issues when passing this info + // using GET mode (size limits) + // + // we get info about build_id, platform_id, etc ... + getSettingsAndFilters($args); + manageCookies($args, $cfgObj); + + // need to comunicate with left frame, will do via $_SESSION and form_token + if (($args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0) > + 0) { + // do not understand why this do not works OK + // $_SESSION[$args->treeFormToken]['loadExecDashboard'] = false; + $_SESSION['loadExecDashboard'][$args->treeFormToken] = false; + } + + $args->followTheWhiteRabbit = isset($_REQUEST['followTheWhiteRabbit']) ? 1 : 0; + if (is_null($args->refreshTree)) { + $args->refreshTree = isset($_REQUEST['refresh_tree']) ? intval( + $_REQUEST['refresh_tree']) : 0; + } + + $args->basehref = $_SESSION['basehref']; + $args->assignTask = isset($_REQUEST['assignTask']) ? 1 : 0; + $args->createIssue = isset($_REQUEST['createIssue']) ? 1 : 0; + $args->copyIssues = isset($_REQUEST['copyIssues']) ? 1 : 0; + $args->copyAttFromLEXEC = isset($_REQUEST['copyAttFromLEXEC']) ? 1 : 0; + + $args->tc_id = null; + $args->tsuite_id = null; + $args->user = $_SESSION['currentUser']; + $args->user_id = intval($args->user->dbID); + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + + $args->caller = isset($_REQUEST['caller']) ? $_REQUEST['caller'] : 'exec_feature'; + $args->reload_caller = false; + + $args->doExec = isset($_REQUEST['execute_cases']) ? 1 : 0; + $args->doDelete = isset($_REQUEST['do_delete']) ? $_REQUEST['do_delete'] : 0; + + $args->doMoveNext = isset($_REQUEST['move2next']) ? 1 : 0; + + $args->doMovePrevious = isset($_REQUEST['move2previous']) ? $_REQUEST['move2previous'] : 0; + $args->moveTowards = $args->doMoveNext ? 'forward' : ($args->doMovePrevious ? 'backward' : null); + + // can be a list, will arrive via form POST + $args->tc_versions = isset($_REQUEST['tc_version']) ? $_REQUEST['tc_version'] : null; + + // it's a submit button! + $args->saveStepsPartialExec = isset($_REQUEST['saveStepsPartialExec']); + + $key2loop = array( + 'level' => '', + 'status' => null, + 'statusSingle' => null, + 'do_bulk_save' => 0, + 'save_results' => 0, + 'save_and_next' => 0, + 'save_and_exit' => 0 + ); + foreach ($key2loop as $key => $value) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; + } + + $args->doSave = $args->save_results || $args->save_and_next || + $args->save_and_exit || $args->do_bulk_save; + + $args->doNavigate = $args->doMoveNext || $args->doMovePrevious; + + // See details on: "When nullify filter_status - 20080504" in this file + if ($args->level == 'testcase' || is_null($args->filter_status) || + (! is_array($args->filter_status) && trim($args->filter_status) == '')) { + $args->filter_status = null; + } else { + // 20130306 - franciscom + // This (without the strlen() check) generated issue 5541: When "Result" filter is used ... + // at least when result DIFFERENT that NOT RUN is used on filter + // + // 20120616 - franciscom + // some strange thing to investigate, seems that unserialize is invoked + // under the hood when getting data from $_REQUEST, then this piece + // of code not only will be useless BUT WRONG, because will try + // to unserialize something that IS NOT SERIALIZED!!!! + + // After TICKET 6651, may be need to limit size of $args->filter_status + if (is_string($args->filter_status) && strlen($args->filter_status) > 1) { + $args->filter_status = json_decode($args->filter_status); + } + } + + switch ($args->level) { + case 'testcase': + $args->tc_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; + if (! is_null($args->tc_versions)) { + $args->tc_id = current($args->tc_versions); + $args->id = $args->tc_id; + $args->version_id = key($args->tc_versions); + } + $args->tsuite_id = null; + break; + + case 'testsuite': + $args->tsuite_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; + $args->tc_id = null; + break; + } + + // + $args->updateTCVToThis = isset($_REQUEST['updateTCVToThis']) ? $_REQUEST['updateTCVToThis'] : null; + if (null != $args->updateTCVToThis) { + $args->version_id = intval($args->updateTCVToThis); + } + + $args->tsuitesInBranch = null; + if (! is_null($args->tsuite_id)) { + // will get all test suites in this branch, in order to limit amount of data returned + // by functions/method that collect linked tcversions + // THIS COLLECT ONLY FIRST LEVEL UNDER test suite, do not do deep search + // Need to understand is still needed + $tsuite_mgr = new testsuite($dbHandler); + $xx = $tsuite_mgr->get_children($args->tsuite_id, + array( + 'details' => 'id' + )); + $ldx = count($xx); + $xx[$ldx] = $args->tsuite_id; + $args->tsuitesInBranch = $xx; + unset($tsuite_mgr); + } + + // TICKET 5630: Test Results by direct link ... + $args->tplan_id = intval( + isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); + $args->tproject_id = intval( + isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); + + if ($args->tproject_id <= 0) { + $tree_mgr = new tree($dbHandler); + $dm = $tree_mgr->get_node_hierarchy_info($args->tplan_id); + $args->tproject_id = $dm['parent_id']; + } + + $args->addLinkToTL = isset($_REQUEST['addLinkToTL']) ? true : false; + $args->addLinkToTLPrintView = isset($_REQUEST['addLinkToTLPrintView']) ? true : false; + + // Do this only on single execution mode + // get issue tracker config and object to manage TestLink - BTS integration + $args->itsCfg = null; + $its = null; + + $tproject_mgr = new testproject($dbHandler); + $info = $tproject_mgr->get_by_id($args->tproject_id); + $args->reqEnabled = intval($info['option_reqs']); + + unset($tproject_mgr); + $bug_summary['minLengh'] = 1; + $bug_summary['maxLengh'] = 1; + + if ($args->issue_tracker_enabled = $info['issue_tracker_enabled']) { + $it_mgr = new tlIssueTracker($dbHandler); + $args->itsCfg = $it_mgr->getLinkedTo($args->tproject_id); + $its = $it_mgr->getInterfaceObject($args->tproject_id); + + if (! is_null($args->itsCfg) && ! is_null($its)) { + $bug_summary['maxLengh'] = $its->getBugSummaryMaxLength(); + } + unset($it_mgr); + } + + initArgsIssueOnTestCase($args, $bug_summary); + + initArgsIssueOnSteps($args, $bug_summary); + + // get code tracker config and object to manage TestLink - CTS integration + $args->ctsCfg = null; + $cts = null; + + if ($args->codeTrackerEnabled = intval($info['code_tracker_enabled'])) { + $ct_mgr = new tlCodeTracker($dbHandler); + $args->ctsCfg = $ct_mgr->getLinkedTo($args->tproject_id); + $cts = $ct_mgr->getInterfaceObject($args->tproject_id); + + unset($ct_mgr); + } + + // is a submit button + $prop = 'linkLatestVersion'; + $args->$prop = isset($_REQUEST[$prop]); + + $prop = 'TCVToUpdate'; + $args->$prop = intval(isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : 0); + + $prop = 'updateTCVToThis'; + $args->$prop = intval(isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : 0); + + return array( + $args, + $its, + $cts + ); +} + +/** + */ +function initArgsIssueOnTestCase(&$argsObj, $bugSummaryProp) +{ + $inputCfg = array( + "bug_notes" => array( + "POST", + tlInputParameter::STRING_N + ), + "issueType" => array( + "POST", + tlInputParameter::INT_N + ), + "issuePriority" => array( + "POST", + tlInputParameter::INT_N + ), + "artifactComponent" => array( + "POST", + tlInputParameter::ARRAY_INT + ), + "artifactVersion" => array( + "POST", + tlInputParameter::ARRAY_INT + ) + ); + + $inputCfg["bug_summary"] = array( + "POST", + tlInputParameter::STRING_N + ); + + // hmm this MAGIC needs to be commented + if (! $argsObj->do_bulk_save) { + $inputCfg["bug_summary"][2] = $bugSummaryProp['minLengh']; + $inputCfg["bug_summary"][3] = $bugSummaryProp['maxLengh']; + } + + I_PARAMS($inputCfg, $argsObj); +} + +/** + */ +function initArgsIssueOnSteps(&$argsObj, $bugSummaryProp) +{ + $arrayOfInt = array( + "POST", + tlInputParameter::ARRAY_INT + ); + + $cfg = array( + "issueBodyForStep" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "issueTypeForStep" => $arrayOfInt, + "issuePriorityForStep" => $arrayOfInt + ); + + $cfg["issueSummaryForStep"] = array( + "POST", + tlInputParameter::ARRAY_STRING_N + ); + + // hmm this MAGIC needs to be commented + if (! $argsObj->do_bulk_save) { + $cfg["issueSummaryForStep"][2] = $bugSummaryProp['minLengh']; + $cfg["issueSummaryForStep"][3] = $bugSummaryProp['maxLengh']; + } + + I_PARAMS($cfg, $argsObj); + + // Special + // Array of Check Boxes: + // 'issueForStep','addLinkToTLForStep' + $sk = array( + 'issueForStep', + 'addLinkToTLForStep', + 'artifactComponentForStep', + 'artifactVersionForStep' + ); + + foreach ($sk as $kt) { + $argsObj->$kt = null; + if (isset($_REQUEST[$kt])) { + $argsObj->$kt = $_REQUEST[$kt]; + } + } +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function manageHistoryOn($hash_REQUEST, $hash_SESSION, $exec_cfg, $btn_on_name, + $btn_off_name, $hidden_on_name) +{ + if (isset($hash_REQUEST[$btn_on_name])) { + $history_on = true; + } elseif (isset($_REQUEST[$btn_off_name])) { + $history_on = false; + } elseif (isset($_REQUEST[$hidden_on_name])) { + $history_on = $_REQUEST[$hidden_on_name]; + } elseif (isset($_SESSION[$hidden_on_name])) { + $history_on = $_SESSION[$hidden_on_name]; + } else { + $history_on = $exec_cfg->history_on; + } + + return $history_on ? true : false; +} + +/* + * function: get_ts_name_details + * + * args : + * + * returns: map with key=TCID + * values= assoc_array([tsuite_id => 5341 + * [details] => my detailas ts1 + * [tcid] => 5343 + * [tsuite_name] => ts1) + */ +function getTestsuiteNameDetails(&$db, $tcase_id) +{ + $tables = array(); + $tables['testsuites'] = DB_TABLE_PREFIX . 'testsuites'; + $tables['nodes_hierarchy'] = DB_TABLE_PREFIX . 'nodes_hierarchy'; + + $rs = ''; + $do_query = true; + $sql = "SELECT TS.id AS tsuite_id, TS.details, + NHA.id AS tc_id, NHB.name AS tsuite_name + FROM {$tables['testsuites']} TS, + {$tables['nodes_hierarchy']} NHA, {$tables['nodes_hierarchy']} NHB WHERE TS.id=NHA.parent_id - AND NHB.id=NHA.parent_id "; - if( is_array($tcase_id) && count($tcase_id) > 0) { - $in_list = implode(",",$tcase_id); - $sql .= "AND NHA.id IN (" . $in_list . ")"; - } else if(!is_null($tcase_id)) { - $sql .= "AND NHA.id={$tcase_id}"; - } else { - $do_query = false; - } - - if ($do_query) { - $rs = $db->fetchRowsIntoMap($sql,'tc_id'); - } - return $rs; -} - -/* - function: - - args : - - returns: - -*/ -function smarty_assign_tsuite_info(&$smarty,&$tree_mgr,$tcase_id,$tproject_id,$cfgObj) -{ - - if( ($safeTCaseID = intval($tcase_id)) <= 0) { - // hmm, no good - return; - } - $fpath = $tree_mgr->get_full_path_verbose($tcase_id, array('output_format' => 'id_name')); - - $tsuite_info = get_ts_name_details($tree_mgr->db,$tcase_id); - - foreach($fpath as $key => $value) { - unset($value['name'][0]); // Remove test plan name - unset($value['node_id'][0]); // Remove test plan name - $str=''; - foreach($value['name'] as $jdx => $elem) { - $str .= " "; - $str .= htmlspecialchars($elem,ENT_QUOTES) . '/'; - } - $tsuite_info[$key]['tsuite_name']=$str; - } - $smarty->assign('tsuite_info',$tsuite_info); - - $headsUp = false; - - // -------------------------------------------------------------------------- - if (!is_null($tsuite_info)) { - $ckObj = new stdClass(); - $ckCfg = config_get('cookie'); - $cookieKey = $ckCfg->prefix . 'TL_execSetResults_tsdetails_view_status'; - - $exec_cfg = config_get('exec_cfg'); - $a_tsvw=array(); - $a_ts=array(); - $a_tsval=array(); - - $tsuite_mgr = new testsuite($tree_mgr->db); - $tsid = current($tsuite_info)['tsuite_id']; - if ($cfgObj->kwHeadsUpTSuiteOnExec != '') { - $headsUp = $tsuite_mgr->keywordIsLinked($tsid, - $cfgObj->kwHeadsUpTSuiteOnExec); - } - foreach($tsuite_info as $key => $elem) { - $main_k = 'tsdetails_view_status_' . $key; - $a_tsvw[] = $main_k; - $a_ts[] = 'tsdetails_' . $key; - $expand_collapse = 0; - if( !isset($_REQUEST[$main_k]) ){ - // First time we are entered here => - // we can need to understand how to proceed - switch($exec_cfg->expand_collapse->testsuite_details) { - case LAST_USER_CHOICE: - if (isset($_COOKIE[$cookieKey]) ) { - $expand_collapse = $_COOKIE[$cookieKey]; - } - break; - - default: - $expand_collapse = $exec_cfg->expand_collapse->testsuite_details; - break; - } - } - $a_tsval[] = isset($_REQUEST[$main_k]) ? - $_REQUEST[$main_k] : $expand_collapse; - $tsuite_id = $elem['tsuite_id']; - $tc_id = $elem['tc_id']; - if (!isset($cached_cf[$tsuite_id])) { - $cached_cf[$tsuite_id] = $tsuite_mgr->html_table_of_custom_field_values($tsuite_id,'design',null,$tproject_id); - } - $ts_cf_smarty[$tc_id] = $cached_cf[$tsuite_id]; - } - - if( count($a_tsval) > 0 ) { - $ckObj->value = $a_tsval[0]; - tlSetCookie($ckObj); - } - - $smarty->assign('tsd_div_id_list',implode(",",$a_ts)); - $smarty->assign('tsd_hidden_id_list',implode(",",$a_tsvw)); - $smarty->assign('tsd_val_for_hidden_list',implode(",",$a_tsval)); - - $smarty->assign('ts_cf_smarty',$ts_cf_smarty); - } - return $headsUp; -} -// ---------------------------------------------------------------------------- - - -/* - function: - - args : - - returns: - - @internal revisions: -*/ -function exec_additional_info(&$db, $fileRepo, &$tcase_mgr, $other_execs, - $tplan_id, $tproject_id, $bugInterfaceOn, $bugInterface) -{ - $attachmentInfos = null; - $bugs = null; - $cfexec_values = null; - - - foreach($other_execs as $tcversion_id => $execInfo) { - $num_elem = sizeof($execInfo); - for($idx = 0;$idx < $num_elem;$idx++) { - $exec_id = $execInfo[$idx]['execution_id']; - $aInfo = getAttachmentInfos($fileRepo,$exec_id,'executions',true,1); - if ($aInfo) { - $attachmentInfos[$exec_id] = $aInfo; - } - - if($bugInterfaceOn) { - $the_bugs = get_bugs_for_exec($db,$bugInterface,$exec_id); - if(count($the_bugs) > 0) { - $bugs[$exec_id] = $the_bugs; - } - } - - // Custom fields - $cfexec_values[$exec_id] = - $tcase_mgr->html_table_of_custom_field_values($tcversion_id, - 'execution',null,$exec_id,$tplan_id,$tproject_id); - } - } - - $info = array( 'attachment' => $attachmentInfos, - 'bugs' => $bugs, - 'cfexec_values' => $cfexec_values); - - return $info; -} //function end - - -/* - function: - - args : context hash with following keys - target => array('tc_versions' => array, 'version_id' =>, 'feature_id' => array) - context => array with keys - tproject_id - tplan_id - platform_id - build_id - user_id - - - returns: - -*/ -function do_remote_execution(&$dbHandler,$context) -{ - $debugMsg = "File:" . __FILE__ . " Function: " . __FUNCTION__; - - $tables = array(); - $tables['executions'] = DB_TABLE_PREFIX . 'executions'; - - $resultsCfg = config_get('results'); - $tc_status = $resultsCfg['status_code']; - $tree_mgr = new tree($dbHandler); - $cfield_mgr = new cfield_mgr($dbHandler); - - $ret = null; - $executionResults = array(); - - $myResult = array(); - $sql = " /* $debugMsg */ INSERT INTO {$tables['executions']} " . - " (testplan_id,platform_id,build_id,tester_id,execution_type," . - " tcversion_id,execution_ts,status,notes) " . - " VALUES ({$context['context']['tplan_id']}, " . - " {$context['context']['platform_id']}, " . - " {$context['context']['build_id']}," . - " {$context['context']['user_id']}," . TESTCASE_EXECUTION_TYPE_AUTO . ","; - - // have we got multiple test cases to execute ? - $target = &$context['target']; - foreach($target['tc_versions'] as $version_id => $tcase_id) - { - $ret[$version_id] = array("verboseID" => null, - "status" => null,"notes" => null,"system" => null, - "scheduled" => null, "timestamp" => null); - - $tcaseInfo = $tree_mgr->get_node_hierarchy_info($tcase_id); - $tcaseInfo['version_id'] = $version_id; - - // For each test case version we can have a different server config - $serverCfg = $cfield_mgr->getXMLRPCServerParams($version_id,$target['feature_id'][$version_id]); - $execResult[$version_id] = executeTestCase($tcaseInfo,$serverCfg,$context['context']); // RPC call - - - $tryWrite = false; - switch($execResult[$version_id]['system']['status']) - { - case 'configProblems': - $tryWrite = false; - break; - - case 'connectionFailure': - $tryWrite = false; - break; - - case 'ok'; - $tryWrite = true; - break; - } - - if( $tryWrite ) - { - $trun = &$execResult[$version_id]['execution']; - $ret[$version_id]["status"] = strtolower($trun['result']); - $ret[$version_id]["statusVerbose"] = $trun['resultVerbose']; - $ret[$version_id]["notes"] = trim($trun['notes']); - if( $trun['scheduled'] == 'now' ) - { - $notes = $dbHandler->prepare_string($ret[$version_id]["notes"]); - - if( $ret[$version_id]["status"] != $tc_status['passed'] && - $ret[$version_id]["status"] != $tc_status['failed'] && - $ret[$version_id]["status"] != $tc_status['blocked']) - { - $ret[$version_id]["status"] = $tc_status['blocked']; - } - - // - $sql2exec = $sql . $version_id . "," . $dbHandler->db_now() . - ", '{$ret[$version_id]["status"]}', '{$notes}' )"; - $dbHandler->exec_query($sql2exec); - } - else - { - $ret[$version_id]["scheduled"] = $trun['scheduled']; - $ret[$version_id]["timestamp"]= $trun['timestampISO']; - } - } - else - { - $ret[$version_id]["system"] = $execResult[$version_id]['system']; - } - } - - return $ret; -} - - -/* - function: initializeExecMode - - args: - - returns: - -*/ -function initializeExecMode(&$db,$exec_cfg,$userObj,$tproject_id,$tplan_id) -{ - - $simple_tester_roles=array_flip($exec_cfg->simple_tester_roles); - $effective_role = $userObj->getEffectiveRole($db,$tproject_id,$tplan_id); - - // Role is considered tester if: - // role == TL_ROLES_TESTER OR Role has Test Plan execute but not Test Plan planning - // - // - $can_execute = $effective_role->hasRight('testplan_execute'); - $can_manage = $effective_role->hasRight('testplan_planning'); - - $use_exec_cfg = isset($simple_tester_roles[$effective_role->dbID]) || ($can_execute && !$can_manage); - - return $use_exec_cfg ? $exec_cfg->exec_mode->tester : 'all'; -} // function end - - -/* - function: setTesterAssignment - - args: - - returns: - -*/ -function setTesterAssignment(&$db,$exec_info,&$tcase_mgr,$tplan_id,$platform_id, $build_id) -{ - foreach($exec_info as $version_id => $value) - { - $exec_info[$version_id]['assigned_user'] = null; - $exec_info[$version_id]['assigned_user_id'] = null; - - // map of map: main key version_id, secondary key: platform_id - $p3 = $tcase_mgr->get_version_exec_assignment($version_id,$tplan_id, $build_id); - if(!is_null($p3)) - { - foreach($p3[$version_id][$platform_id] as $uu) - { - $assignedTesterId = intval($uu['user_id']); - if($assignedTesterId) - { - $user = tlUser::getByID($db,$assignedTesterId); - if ($user) - { - $exec_info[$version_id]['assigned_user'][]= $user->getDisplayName(); - - } - $exec_info[$version_id]['assigned_user_id'][] = $assignedTesterId; - } - } - } - $exec_info[$version_id]['assigned_user'] = implode(',',(array)$exec_info[$version_id]['assigned_user']); - $exec_info[$version_id]['assigned_user_id'] = implode(',',(array)$exec_info[$version_id]['assigned_user_id']); - } - return $exec_info; -} //function end - -/* - function: - Reorder executions to mantaing correct visualization order. - - args: - - returns: - -*/ -function reorderExecutions(&$tcversion_id,&$exec_info) -{ - $dummy = array(); - foreach($tcversion_id as $idx => $tcv_id) - { - if(isset($exec_info[$tcv_id])) - { - $dummy[$idx] = $exec_info[$tcv_id]; - } - } - return $dummy; -} - -/* - function: setCanExecute - - args: - - returns: - -*/ -function setCanExecute($exec_info,$execution_mode,$can_execute,$tester_id) -{ - foreach($exec_info as $key => $tc_exec) - { - $execution_enabled = 0; - - if($can_execute == 1 && $tc_exec['active'] == 1) - { - $is_free = $tc_exec['assigned_user_id'] == '' ? 1 : 0; - - $testerSet = array_flip(explode(',',$tc_exec['assigned_user_id'])); - $assigned_to_me = isset($testerSet[$tester_id]) ? 1 : 0; - - switch($execution_mode) - { - case 'assigned_to_me': - $execution_enabled = $assigned_to_me; - break; - - case 'assigned_to_me_or_free': - $execution_enabled = $assigned_to_me || $is_free; - break; - - case 'all': - $execution_enabled = 1; - break; - - default: - $execution_enabled = 0; - break; - } // switch - } - $exec_info[$key]['can_be_executed']=$execution_enabled; - } - return $exec_info; -} - - -/* - function: createExecNotesWebEditor - creates map of html needed to display web editors - for execution notes. - - args: tcversions: array where each element has information - about testcase version that can be executed. - - basehref: URL - editorCfg: - - returns: map - key: testcase id - value: html to display web editor. - -*/ -function createExecNotesWebEditor(&$tcversions,$basehref,$editorCfg,$execCfg,$initValue=null) { - - if(is_null($tcversions) || count($tcversions) == 0 ) { - return null; // nothing todo >>>------> bye! - } - - // Important Notice: - // - // When using tinymce or none as web editor, we need to set rows and cols - // to appropriate values, to avoid an ugly ui. - // null => use default values defined on editor class file - // - // Rows and Cols values are useless for FCKeditor. - // - - if( $execCfg->exec_mode->new_exec == 'latest') { - $itemTemplateValue = $initValue != null ? $initValue : ''; - } else { - $itemTemplateValue = getItemTemplateContents('execution_template', 'notes', null); - } - - foreach($tcversions as $key => $tcv) { - $tcversion_id=$tcv['id']; - $tcase_id=$tcv['testcase_id']; - - $of = web_editor("notes[{$tcversion_id}]",$basehref,$editorCfg) ; - $of->Value = $itemTemplateValue; - - // Magic numbers that can be determined by trial and error - $cols = intval(isset($editorCfg['cols']) ? $editorCfg['cols'] : 60); - $rows = intval(isset($editorCfg['rows']) ? $editorCfg['rows'] : 10); - $editors[$tcase_id]=$of->CreateHTML($rows,$cols); - unset($of); - } - return $editors; -} - - - -/* - function: getCfg - - args: - - returns: - -*/ -function getCfg() { - $cfg = new stdClass(); - $cfg->exec_cfg = config_get('exec_cfg'); - $cfg->gui_cfg = config_get('gui'); - - $results = config_get('results'); - $cfg->tc_status = $results['status_code']; - $cfg->execStatusToExclude = $results['execStatusToExclude']; - - $cfg->testcase_cfg = config_get('testcase_cfg'); - $cfg->editorCfg = getWebEditorCfg('execution'); - - $cfg->cookie = config_get('cookie'); - - $cfg->kwHeadsUpTSuiteOnExec = - trim(config_get('keywords')->headsUpTSuiteOnExec); - - return $cfg; -} - - -/* - function: initializeRights - create object with rights useful for this feature - - args: - dbHandler: reference to db object - userObj: reference to current user object - tproject_id: - tplan_id - - Warning: this is right interface for this function, but - has_rights() can works in a mode (that i consider a dirty one) - using SESSION to achieve global coupling. - - returns: - -*/ -function initializeRights(&$dbHandler,&$userObj,$tproject_id,$tplan_id) { - $exec_cfg = config_get('exec_cfg'); - - - $userERole = $userObj->getEffectiveRole($dbHandler,$tproject_id,$tplan_id); - - $grants = new stdClass(); - $grants->execute = $userERole->hasRight("testplan_execute"); - - // IMPORTANT NOTICE - TICKET 5128 - // If is TRUE we will need also to analize, test case by test case - // these settings: - // $tlCfg->exec_cfg->exec_mode->tester - // $tlCfg->exec_cfg->simple_tester_roles - // - // Why ? - // Because if a tester can execute ONLY test cases assigned to him, this also - // has to mean that: - // can delete executions ONLY of test cases assigned to him - // can edit exec notes ONLY of test cases assigned to him - // can manage uploads on executions, ONLY of test cases assigned to him - // - // These checks can not be done here - // - // TICKET 5310: Execution Config - convert options into rights - $grants->delete_execution = $userERole->hasRight("exec_delete"); - - - // Important: - // Execution right must be present to consider this configuration option. - // $grants->edit_exec_notes = $grants->execute && $exec_cfg->edit_notes; - $grants->edit_exec_notes = $grants->execute && - $userERole->hasRight("exec_edit_notes"); - - $grants->edit_testcase = $userERole->hasRight("mgt_modify_tc"); - - - return $grants; -} - - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,&$argsObj,&$cfgObj,&$tplanMgr,&$tcaseMgr,&$issueTracker,&$codeTracker) -{ - $buildMgr = new build_mgr($dbHandler); - $platformMgr = new tlPlatform($dbHandler,$argsObj->tproject_id); - - $gui = new stdClass(); - $gui->uploadOp = null; - $gui->headsUpTSuite = false; - $gui->direct_link = ''; - $gui->allIssueAttrOnScreen = 0; - $gui->lexNotes = null; - $gui->tcversionSet = null; - $gui->plugins = null; - $gui->hasNewestVersion = 0; - $gui->addLinkToTLChecked = $cfgObj->exec_cfg->exec_mode->addLinkToTLChecked; - $gui->addLinkToTLPrintViewChecked = $cfgObj->exec_cfg->exec_mode->addLinkToTLPrintViewChecked; - - $gui->assignTaskChecked = $cfgObj->exec_cfg->exec_mode->assignTaskChecked; - - - $k2i = array('import','attachments','exec','edit_exec'); - $gui->features = array(); - foreach($k2i as $olh) { - $gui->features[$olh] = false; - } - - if( $argsObj->user->hasRight($dbHandler,'testplan_execute', - $argsObj->tproject_id,$argsObj->tplan_id,true) ) { - foreach($k2i as $olh) { - $gui->features[$olh] = true; - } - } - - $gui->showExternalAccessString = true; - $gui->showImgInlineString = false; - - $gui->issueSummaryForStep = null; - $gui->addIssueOp = null; - $gui->allowStepAttachments = true; - - - $gui->remoteExecFeedback = $gui->user_feedback = ''; - $gui->tplan_id=$argsObj->tplan_id; - $gui->tproject_id=$argsObj->tproject_id; - $gui->build_id = $argsObj->build_id; - $gui->platform_id = $argsObj->platform_id; - $gui->loadExecDashboard = false; - $gui->treeFormToken = $argsObj->treeFormToken; - $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; - - - $gui->execStatusIcons = getResultsIcons(); - $gui->execStatusIconsNext = getResultsIconsNext(); - - list($gui->execStatusValues,$gui->execStepStatusValues) = - initExecValuesMenus($cfgObj->tc_status,$cfgObj->execStatusToExclude); - - $gui->can_use_bulk_op=0; - $gui->exec_notes_editors=null; - $gui->bulk_exec_notes_editor=null; - $gui->req_details=null; - $gui->attachmentInfos=null; - $gui->bugs=null; - $gui->scripts=null; - $gui->other_exec_cfields=null; - $gui->ownerDisplayName = null; - - $gui->editorType=$cfgObj->editorCfg['type']; - $cfgTestPlan = getWebEditorCfg('testplan'); - $gui->testPlanEditorType = $cfgTestPlan['type']; - $cfgPlatform = getWebEditorCfg('platform'); - $gui->platformEditorType = $cfgPlatform['type']; - $cfgBuild = getWebEditorCfg('build'); - $gui->buildEditorType = $cfgBuild['type']; - $cfgDesign = getWebEditorCfg('design'); - $gui->testDesignEditorType = $cfgDesign['type']; - $cfgStepsDesign = getWebEditorCfg('design'); - $gui->stepDesignEditorType = $cfgStepsDesign['type']; - - $gui->filter_assigned_to=$argsObj->filter_assigned_to; - $gui->tester_id=$argsObj->user_id; - $gui->include_unassigned=$argsObj->include_unassigned; - $gui->tpn_view_status=$argsObj->tpn_view_status; - $gui->bn_view_status=$argsObj->bn_view_status; - $gui->bc_view_status=$argsObj->bc_view_status; - $gui->platform_notes_view_status=$argsObj->platform_notes_view_status; - - - $gui->refreshTree = $argsObj->refreshTree; - if( !$argsObj->followTheWhiteRabbit ) { - if (!$argsObj->statusSingle || - current($argsObj->statusSingle) == $cfgObj->tc_status['not_run']) { - $gui->refreshTree = 0; - } - } - $gui->map_last_exec_any_build=null; - $gui->map_last_exec=null; - - // 20081122 - franciscom - // Just for the records: - // doing this here, we avoid to do on processTestSuite() and processTestCase(), - // but absolutely this will not improve in ANY WAY perfomance, because we do not loop - // over these two functions. - $tprojectMgr = new testproject($dbHandler); - $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tproject_id); - - $build_info = $buildMgr->get_by_id($argsObj->build_id); - - $gui->build_name = $build_info['name']; - $gui->build_notes=$build_info['notes']; - $gui->build_is_open=($build_info['is_open'] == 1 ? 1 : 0); - $gui->execution_types=$tcaseMgr->get_execution_types(); - - if ($argsObj->filter_assigned_to) { - $userSet = tlUser::getByIds($dbHandler,array_values($argsObj->filter_assigned_to)); - if ($userSet) { - foreach ($userSet as $key => $userObj) { - $gui->ownerDisplayName[$key] = $userObj->getDisplayName(); - } - } - } - // ------------------------------------------------------------------ - - $dummy = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id); - $gui->build_name = isset($dummy[$argsObj->build_id]) ? $dummy[$argsObj->build_id] : ''; - $gui->build_div_title = lang_get('build') . ' ' . $gui->build_name; - - $gui->exec_mode = initializeExecMode($dbHandler,$cfgObj->exec_cfg, - $argsObj->user,$argsObj->tproject_id,$argsObj->tplan_id); - - $gui->grants = initializeRights($dbHandler,$argsObj->user,$argsObj->tproject_id,$argsObj->tplan_id); - - $rs = $tplanMgr->get_by_id($argsObj->tplan_id); - - $gui->testplan_name = $rs['name']; - $gui->testproject_name = $rs['tproject_name']; - $gui->testplan_notes = $rs['notes']; - $gui->testplan_div_title = lang_get('test_plan') . ' ' . $gui->testplan_name; - - $argsObj->tplan_apikey = $rs['api_key']; - - - // Important note: - // custom fields for test plan can be edited ONLY on design, that's reason why we are using - // scope = 'design' instead of 'execution' - $gui->testplan_cfields = $tplanMgr->html_table_of_custom_field_values( - $argsObj->tplan_id,'design', - array('show_on_execution' => 1)); - - $gui->build_cfields = $buildMgr->html_table_of_custom_field_values( - $argsObj->build_id,$argsObj->tproject_id, - 'design',array('show_on_execution' => 1)); - - - $gui->history_on = manage_history_on($_REQUEST,$_SESSION,$cfgObj->exec_cfg, - 'btn_history_on','btn_history_off','history_on'); - $gui->history_status_btn_name = $gui->history_on ? 'btn_history_off' : 'btn_history_on'; - - - - $dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id); - $gui->has_platforms = !is_null($dummy) ? 1 : 0; - - $gui->platform_info['id'] = 0; - $gui->platform_info['name'] = ''; - if(!is_null($argsObj->platform_id) && $argsObj->platform_id > 0 ) - { - $gui->platform_info = $platformMgr->getByID($argsObj->platform_id); - } - $gui->platform_div_title = lang_get('platform') . ' ' . $gui->platform_info['name']; - - - $gui->node_id = $argsObj->id; - $gui->draw_save_and_exit = ($argsObj->caller == 'tcAssignedToMe'); - - // ------------------------------------------------------------------------------------- - // Issue Tracker Integration - $issueTrackerExists = !is_null($issueTracker); - $gui->tlCanCreateIssue = false; - $gui->tlCanAddIssueNote = false; - $gui->issueTrackerIntegrationOn = false; - if ($issueTrackerExists) { - $gui->tlCanCreateIssue = method_exists($issueTracker,'addIssue') && - $issueTracker->canCreateViaAPI(); - $gui->tlCanAddIssueNote = method_exists($issueTracker,'addNote') && - $issueTracker->canAddNoteViaAPI(); - } - - $gui->bug_summary = ''; - $gui->issueTrackerCfg = new stdClass(); - $gui->issueTrackerCfg->bugSummaryMaxLength = 100; // MAGIC I'm sorry - $gui->issueTrackerCfg->editIssueAttr = false; - $gui->issueTrackerCfg->crudIssueViaAPI = false; - - $gui->issueTrackerMetaData = null; - $issueTrackerUpAndRunning = 0; - if($issueTrackerExists) { - if ( $issueTracker->isConnected() ) { - $issueTrackerUpAndRunning = 1; - - $itsCfg = $issueTracker->getCfg(); - $gui->issueTrackerCfg->bugSummaryMaxLength = $issueTracker->getBugSummaryMaxLength(); - $gui->issueTrackerCfg->editIssueAttr = (intval($itsCfg->userinteraction) > 0); - $gui->issueTrackerCfg->crudIssueViaAPI = (intval($itsCfg->createissueviaapi) > 0); - - $gui->issueTrackerIntegrationOn = true; - $gui->accessToIssueTracker = lang_get('link_bts_create_bug') . - "({$argsObj->itsCfg['issuetracker_name']})"; - $gui->createIssueURL = $issueTracker->getEnterBugURL(); - - if ($gui->issueTrackerCfg->crudIssueViaAPI) { - // get metadata - $gui->issueTrackerMetaData = getIssueTrackerMetaData($issueTracker); - $gui->tlCanCreateIssue = method_exists($issueTracker,'addIssue') && - $issueTracker->canCreateViaAPI(); - - $gui->tlCanAddIssueNote = method_exists($issueTracker,'addNote') && - $issueTracker->canAddNoteViaAPI(); - } - - } else { - $gui->user_feedback = lang_get('issue_tracker_integration_problems'); - } - } - - - if ($gui->issueTrackerCfg->editIssueAttr == 1) { - $k2c = array('issueType','issuePriority','artifactVersion', - 'artifactComponent'); - foreach ($k2c as $kj) { - $gui->$kj = $argsObj->$kj; - - // To manage issue at step level - $kx = $kj . 'ForStep'; - $gui->$kx = $argsObj->$kx; - } - } else { - if( null != $gui->issueTrackerMetaData ) { - $singleVal = array('issuetype' => 'issueType', - 'issuepriority' => 'issuePriority'); - foreach ($singleVal as $kj => $attr) { - $gui->$attr = null; - if (property_exists($itsCfg, $kj)) { - $gui->$attr = $itsCfg->$kj; - } else { - /* Provide warning */ - tLog("Issue Tracker Config Issue? - Attribute:$kj doesn't exist","WARNING"); - } - $forStep = $attr . 'ForStep'; - $gui->$forStep = $gui->$attr; - } - - $multiVal = array('version' => 'artifactVersion', - 'component' => 'artifactComponent'); - foreach ($multiVal as $kj => $attr) { - $gui->$attr = null; - if (property_exists($itsCfg, $kj)) { - $gui->$attr = (array)$itsCfg->$kj; - } else { - /* Provide warning */ - tLog("Issue Tracker Config Issue? - Attribute:$kj doesn't exist","WARNING"); - } - $forStep = $attr . 'ForStep'; - $gui->$forStep = $gui->$attr; - } - } - } - - $gui->executionContext = array(); - $gui->executionContext['tproject_name'] = $gui->testproject_name; - $gui->executionContext['tplan_name'] = $gui->testplan_name; - $gui->executionContext['platform_name'] = $gui->platform_info['name']; - $gui->executionContext['build_name'] = $gui->build_name; - - return $gui; -} - - -/** - * processTestCase - * - */ -function processTestCase($tcase,&$guiObj,&$argsObj,&$cfgObj,$tcv,&$treeMgr,&$tcaseMgr,&$docRepository) -{ - - // IMPORTANT due to platform feature - // every element on linked_tcversions will be an array. - $cf_filters = array('show_on_execution' => 1); - $locationFilters = $tcaseMgr->buildCFLocationMap(); - - $guiObj->design_time_cfields = array(); - $guiObj->testplan_design_time_cfields = array(); - - $tcase_id = isset($tcase['tcase_id']) ? $tcase['tcase_id'] : $argsObj->id; - - // Development Notice: - // accessing a FIXED index like in: - // - // $items_to_exec[$tcase_id] = $linked_tcversions[$tcase_id][0]['tcversion_id']; - // $link_id = $linked_tcversions[$tcase_id][0]['feature_id']; - // - // Because we want to access FIRTS element is better to use current. - // - $target = current(current($tcv)); - $items_to_exec[$tcase_id] = $target['tcversion_id']; - $link_id = $target['feature_id']; - $tcversion_id = isset($tcase['tcversion_id']) ? $tcase['tcversion_id'] : $items_to_exec[$tcase_id]; - - // - $ltcvID = $tcaseMgr->getLatestVersionID($tcase_id); - $guiObj->hasNewestVersion = ($ltcvID != $tcversion_id); - - $eid = -1; - if($cfgObj->exec_cfg->exec_mode->new_exec == 'latest' ) { - // Need latest exec id on context - $eid = $tcaseMgr->getLatestExecIDInContext($tcversion_id,$argsObj); - } - - $cf_map = null; - $guiObj->execution_time_cfields[$tcase_id] = null; - if($guiObj->grants->execute) { - if( $eid > 0 ) { - // I'm getting the values saved on latest execution - $cf_map = $tcaseMgr->get_linked_cfields_at_execution( - $tcversion_id,null,null,$eid, - $argsObj->tplan_id,$argsObj->tproject_id); - } - - $guiObj->execution_time_cfields[$tcase_id] = - $tcaseMgr->html_table_of_custom_field_inputs($tcase_id,null, - 'execution',"_{$tcase_id}",null,null, - $argsObj->tproject_id,null,$cf_map); - } - - $guiObj->tcAttachments[$tcase_id] = getAttachmentInfos($docRepository,$tcversion_id,'tcversions',1); - - foreach($locationFilters as $locationKey => $filterValue) { - $finalFilters=$cf_filters+$filterValue; - $guiObj->design_time_cfields[$tcase_id][$locationKey] = - $tcaseMgr->html_table_of_custom_field_values($tcase_id,'design',$finalFilters,null,null, - $argsObj->tproject_id,null,$tcversion_id); - - $guiObj->testplan_design_time_cfields[$tcase_id] = - $tcaseMgr->html_table_of_custom_field_values($tcversion_id, - 'testplan_design',$cf_filters,null,null, - $argsObj->tproject_id,null,$link_id); - } - - - $tc_info = $treeMgr->get_node_hierarchy_info($tcase_id); - $guiObj->tSuiteAttachments[$tc_info['parent_id']] = - getAttachmentInfos($docRepository,$tc_info['parent_id'], - 'nodes_hierarchy',true,1); - // Direct Link - $lk = current($tcv); - $guiObj->direct_link = trim($_SESSION['basehref'],'/') . - "/ltx.php?item=exec&feature_id=" . $lk[0]['feature_id'] . - "&build_id=" . $argsObj->build_id; - - $argsObj->direct_link = $guiObj->direct_link; - - - // Information for Issue Management - // Common Info - $signature = new stdClass(); - $signature->tcname = $tc_info['name']; - $signature->tcpathname = $tcaseMgr->getPathName($tcase_id); - $signature->tcversion_id = $tcversion_id; - - list($guiObj->bug_summary,$guiObj->issueSummaryForStep) = - genIssueSummary($tcaseMgr,$signature,$guiObj->executionContext); - - // return more data eid, has cf on exec - return array($tcase_id,$tcversion_id,$eid,($cf_map != null)); -} - - - - -/* - function: getLatestExec - Important Notice: - $tcase_id and $tcversions_id, can be ARRAYS when user enable bulk execution - - args : - - returns: - -*/ -function getLatestExec(&$dbHandler,$tcase_id,$tcversion_id,$guiObj,$argsObj,&$tcaseMgr) -{ - $options = array('getNoExecutions' => 1, 'groupByBuild' => 0, 'getStepsExecInfo' => 1); - - $last_exec = - $tcaseMgr->get_last_execution($tcase_id,$tcversion_id,$argsObj->tplan_id, - $argsObj->build_id,$argsObj->platform_id,$options); - - if( !is_null($last_exec) ) { - $last_exec = setTesterAssignment($dbHandler,$last_exec,$tcaseMgr, - $argsObj->tplan_id,$argsObj->platform_id, - $argsObj->build_id); - - // Warning: setCanExecute() must be called AFTER setTesterAssignment() - $can_execute = $guiObj->grants->execute && ($guiObj->build_is_open); - $last_exec = setCanExecute($last_exec,$guiObj->exec_mode,$can_execute,$argsObj->user_id); - } - - // Reorder executions to mantaing correct visualization order. - if( is_array($tcversion_id) ) { - $last_exec = reorderExecutions($tcversion_id,$last_exec); - } - - return $last_exec; -} - -/** - * Function retrieve test steps backup - * - * @param testcase $tcaseMgr the testcase Manager - * @param array $guiObj - * @param int $testPlanId - * @param int $platformId - * @param int $buildId - * - * return map - */ -// Has to be moved to testcase class -function getBackupSteps(&$tcaseMgr,$guiObj,$testPlanId,$platformId,$buildId) { - - $stepsIds = array(); - foreach($guiObj->map_last_exec as $tcId => $elements) { - foreach ($guiObj->map_last_exec[$tcId]['steps'] as $step) { - array_push($stepsIds, $step["id"]); - } - } - - return $tcaseMgr->getBackupSteps($stepsIds,$testPlanId,$platformId,$buildId); -} - - - -/* - function: getOtherExecutions - - args : - - returns: - - rev: -*/ -function getOtherExecutions(&$dbHandler,$tcase_id,$tcversion_id,$guiObj,$argsObj,&$cfgObj,&$tcaseMgr) -{ - $other_execs = null; - if($guiObj->history_on) - { - // CRITIC see for key names - testcases.class.php -> getExecutionSet() - $execContext = array('testplan_id' => $argsObj->tplan_id, 'platform_id' => $argsObj->platform_id, - 'build_id' => $argsObj->build_id); - - if($cfgObj->exec_cfg->show_history_all_builds ) - { - $execContext['build_id'] = null; - } - if($cfgObj->exec_cfg->show_history_all_platforms ) - { - $execContext['platform_id'] = null; - } - - $options = array('exec_id_order' => $cfgObj->exec_cfg->history_order); - $other_execs = $tcaseMgr->getExecutionSet($tcase_id,$tcversion_id,$execContext,$options); - } - else - { - // Warning!!!: - // we can't use the data we have got with previous call to get_last_execution() - // because if user have asked to save results last execution data may be has changed - $aux_map = $tcaseMgr->get_last_execution($tcase_id,$tcversion_id,$argsObj->tplan_id, - $argsObj->build_id,$argsObj->platform_id); - if(!is_null($aux_map)) - { - $other_execs = array(); - foreach($aux_map as $key => $value ) - { - $other_execs[$key] = array($value); - } - } - } - return $other_execs; -} - - -/* - function: processTestSuite - - args : - - returns: - -*/ -function processTestSuite(&$dbHandler,&$guiObj,&$argsObj,$testSet,&$treeMgr,&$tcaseMgr,&$docRepository) -{ - $locationFilters = $tcaseMgr->buildCFLocationMap(); - $cf_filters = array('show_on_execution' => 1); - $tsuite_mgr=new testsuite($dbHandler); - $tsuite_data = $tsuite_mgr->get_by_id($argsObj->id); - - // Get the path for every test case, grouping test cases that have same parent. - $testCaseQty = count($testSet->tcase_id); - if( $testCaseQty > 0 ) - { - $dummy = $tcaseMgr->cfield_mgr->getLocations(); - $verboseLocationCode = array_flip($dummy['testcase']); - $filters=null; - foreach($verboseLocationCode as $key => $value) - { - $filters[$key]['location']=$value; - } - - $dummy_id = current($testSet->tcase_id); - $index = $testCaseQty == 1 ? $dummy_id : 0; // 0 => BULK - $suffix = '_' . $index; - $execution_time_cfields = - $tcaseMgr->html_table_of_custom_field_inputs($dummy_id,$argsObj->tproject_id,'execution',$suffix, - null,null,$argsObj->tproject_id); - - $guiObj->execution_time_cfields[$index] = $execution_time_cfields; - $gdx=0; - foreach($testSet->tcase_id as $testcase_id) - { - $path_f = $treeMgr->get_path($testcase_id,null,'full'); - foreach($path_f as $key => $path_elem) - { - if( $path_elem['parent_id'] == $argsObj->id ) - { - // Can be added because is present in the branch the user wants to view - // ID of branch starting node is in $argsObj->id - $guiObj->tcAttachments[$testcase_id] = getAttachmentInfos($docRepository,$testcase_id,'nodes_hierarchy',true,1); - - foreach($locationFilters as $locationKey => $filterValue) { - $finalFilters = $cf_filters+$filterValue; - $guiObj->design_time_cfields[$testcase_id][$locationKey] = - $tcaseMgr->html_table_of_custom_field_values($testcase_id,'design',$finalFilters,null,null, - $argsObj->tproject_id,null,$testSet->tcversion_id[$gdx]); - - $guiObj->testplan_design_time_cfields[$testcase_id] = - $tcaseMgr->html_table_of_custom_field_values($testcase_id,'testplan_design',$cf_filters, - null,null,$argsObj->tproject_id); - - } - - if($guiObj->grants->execute) { - $guiObj->execution_time_cfields[$testcase_id] = - $tcaseMgr->html_table_of_custom_field_inputs($testcase_id, null,'execution', "_".$testcase_id,null,null, - $argsObj->tproject_id); - } - - } // if( $path_elem['parent_id'] == $argsObj->id ) - - // We do this because do not know if some test case not yet analised will be direct - // child of this test suite, then we get this info in advance. - // In situations where only last test suite on branch have test cases, we are colleting - // info we will never use. - if($path_elem['node_table'] == 'testsuites' && !isset($guiObj->tSuiteAttachments[$path_elem['id']])) - { - $guiObj->tSuiteAttachments[$path_elem['id']] = - getAttachmentInfos($docRepository,$path_elem['id'],'nodes_hierarchy',true,1); - } - - } //foreach($path_f as $key => $path_elem) - $gdx++; - } - } - // return array($testSet->tcase_id,$testSet->tcversion_id); -} - - -/** - * - */ -function buildExecContext(&$argsObj,$tcasePrefix,&$tplanMgr,&$tcaseMgr) -{ - $debugMsg = "File:" . __FILE__ . "Function:" . __FUNCTION__; - - $ret = array(); - $ret['target'] = array('tc_versions' => null,'version_id' => null,'feature_id' => null, 'basic_info' => null); - $ret['context'] = array('tproject_id' => null,'tplan_id' => null, 'platform_id' => null, - 'build_id' => null,'user_id' => null); - - - foreach($ret as $area => &$value) - { - foreach($value as $key => $dummy) - { - if( property_exists($argsObj,$key) ) - { - $value[$key] = $argsObj->$key; - } - } - } - - // Now get another important information feature_id on testplan_tcversions - // needed to get remote execution server config if this config has been - // done with Custom Fields at Test Plan Design Time - foreach($ret['target']['tc_versions'] as $tcv_id => $tc_id) - { - $ret['target']['feature_id'][$tcv_id] = $tplanMgr->getFeatureID($ret['context']['tplan_id'], - $ret['context']['platform_id'], - $tcv_id); - - $dummy = $tcaseMgr->get_basic_info($tc_id,array('id' => $tcv_id)); - $dummy[0]['tcasePrefix'] = $tcasePrefix; - $ret['target']['basic_info'][$tcv_id] = $dummy[0]; - - } - return $ret; -} - - - -function launchRemoteExec(&$dbHandler,&$argsObj,$tcasePrefix,&$tplanMgr,&$tcaseMgr) -{ - // IMPORTANT NOTICE - // Remote execution will NOT use ANY of data typed by user, - // - notes - // - custom fields - // - // IMPORTANT NOTICE - // need to understand what to do with feedback provided - // by do_remote_execution(). - // Right now no matter how things go, no feedback is given to user. - // May be this need to be improved in future. - // - // Only drawback i see is when remote exec is done on a test suite - // and amount of feedback can be high, then do not see what can be effect - // on GUI - $execContext = buildExecContext($argsObj,$tcasePrefix,$tplanMgr,$tcaseMgr); - $feedback = do_remote_execution($dbHandler,$execContext); - $feedback = current($feedback); - return $feedback; -} - - - -/** - * @use testplan->filterByOnDesignCustomFields - * - */ -function getLinkedItems($argsObj,$historyOn,$cfgObj,$tcaseMgr,$tplanMgr,$identity=null) -{ - - $ltcv = null; - $idCard = null; - $itemSet = null; - - if (null == $argsObj->tsuite_id) { - if( !is_null($identity) ) { - $idCard = $identity; - } - else if(!is_null($argsObj->tc_id) && !is_array($argsObj->tc_id) ) { - $idCard = array('id' => $argsObj->tc_id, 'version_id' => $argsObj->version_id); - } - - $idCard['version_id'] = $tplanMgr->getVersionLinked($argsObj->tplan_id,$idCard['id']); - } - - if( !is_null($idCard) ) { - // CRITIC see for key names - testcases.class.php -> getExecutionSet() - $execContext = array('testplan_id' => $argsObj->tplan_id, - 'platform_id' => $argsObj->platform_id, - 'build_id' => $argsObj->build_id); - - $ltcv = null; - if($historyOn) { - $execContext['testplan_id'] = $argsObj->tplan_id; - $ltcv = $tcaseMgr->getExecutionSet($idCard['id'],null,$execContext); - } - - // lazy implementation: - // getExecutionSet() returns data ONLY for Statuses that are written ON DB, - // then if full history for test case is NOT RUN, we are doomed!! - if(!$historyOn || is_null($ltcv)) { - $opt = null; - $ltcv = $tcaseMgr->getLatestExecSingleContext($idCard,$execContext,$opt); - } - } else { - // ----------------------------------------------------------- - // When nullify filter_status - 20080504 - DO NOT REMOVE - - // - // May be in the following situation we do not HAVE to apply filter status: - // 1. User have filter for Not Run on Tree - // 2. Clicks on TC XXX - // 3. Executes TC - // 4. DO NOT UPDATE TREE. - // we do not update automatically to avoid: - // a) performance problems - // b) delays on operations due to tree redraw - // c) loose tree status due to lack of feature of tree engine - // - // 5. Clicks again on TC XXX - // If we use filter, we will get No Data Available. - // - // When working on show_testsuite_contents mode (OLD MODE) - // when we show all testcases inside a testsuite - // that verifies a filter criteria - // WE NEED TO APPLY FILTER - // - // We do not have this problem when this page is called after user have executed, - // probably because filter_status is not send back. - // - // I will add logic to nullify filter_status on init_args() - // - - $options = array('only_executed' => true, - 'output' => $historyOn ? 'mapOfArray' : 'mapOfMap', - 'include_unassigned' => $argsObj->include_unassigned, - 'group_by_build' => 'add_build', - 'last_execution' => !$historyOn); - - if(is_null($argsObj->filter_status) || in_array($cfgObj->tc_status['not_run'],(array)$argsObj->filter_status)) { - $options['only_executed'] = false; - } - - // args->tsuites_id: is only used when user click on a test suite. - // probably is used only when bulk execution is enabled. - // - // if args->tc_id is not null, theorically all other filters are useless. - // why ? - // Because will normally call this script, - // from the execution tree and if we can click - // on a tree node, this means it has passed all filters. - // - // - // $args->platform_id: needed to get execution status info - // $args->build_id: needed to get execution status info - // - $basic_filters = array('tcase_id' => $argsObj->tc_id, - 'platform_id' => $argsObj->platform_id, - 'build_id' => $argsObj->build_id); - - // This filters are useful when bulk execution is enabled, - // and user do click on a test suite on execution tree. - - // seems to be useless => 'cf_hash' => $argsObj->filter_cfields, - // need to review $tplanMgr->getLinkedForExecTree - // - - // $setOfTestSuites = (array)$argsObj->tsuite_id; - $bulk_filters = array('keyword_id' => $argsObj->keyword_id, - 'assigned_to' => $argsObj->filter_assigned_to, - 'exec_status' => $argsObj->filter_status, - 'tsuites_id' => $argsObj->tsuite_id, - 'assigned_on_build' => $argsObj->build_id, - 'exec_type' => $argsObj->execution_type, - 'urgencyImportance' => $argsObj->priority); - - // CRITIC / IMPORTANT - // With BULK Operation enabled, we prefer to display Test cases - // that are ONLY DIRECT CHILDREN - // of test suite id => we do not do deep walk. - // Think is a good choice, to avoid retrieving lot of info. - // May be we need to add a config parameter (or better an option at GUI level) - // in order to allow use how he / she wants to work. - // - $filters = array_merge($basic_filters,$bulk_filters); - - if( !is_null($sql2do = $tplanMgr->getLinkedForExecTree($argsObj->tplan_id,$filters,$options)) ) { - if( is_array($sql2do) ) { - if( isset($filters['keyword_filter_type']) && ($filters['keyword_filter_type'] == 'And') ) { - $kmethod = "fetchRowsIntoMapAddRC"; - $unionClause = " UNION ALL "; - } else { - $kmethod = "fetchRowsIntoMap"; - $unionClause = ' UNION '; - } - $sql2run = $sql2do['exec'] . $unionClause . $sql2do['not_run']; - } else { - $sql2run = $sql2do; - } - - // Development Notice: - // CUMULATIVE is used only to create same type of datastructe that existed - // before this refactoring - // - // $tex = $tcaseMgr->db->$kmethod($sql2run,'tcase_id',database::CUMULATIVE); - $sql2run .= ' ORDER BY exec_order '; - - $ltcv = $tex = $tcaseMgr->db->$kmethod($sql2run,'tcase_id'); - if(!is_null($tex)) { - // We need to create: - // one set for Custom fields that apply to DESIGN - // one set for Custom fields that apply to TESTPLAN DESIGN - - if(!is_null($argsObj->filter_cfields)) - { - $tk = array_keys($argsObj->filter_cfields); - $cf = null; - // foreach( array('design','testplan_design') as $l4) - foreach( array('design') as $l4) - { - $cf[$l4] = $tplanMgr->cfield_mgr->getByIDAndEnableOn($tk,array($l4 => true)); - } - if(isset($cf['design']) && !is_null($cf['design'])) - { - foreach($cf['design'] as $yy => $xc) - { - $az[$yy] = $argsObj->filter_cfields[$yy]; - } - $tex = $tplanMgr->filterByOnDesignCustomFields($tex,$az); - } - } - - foreach($tex as $xkey => $xvalue) - { - $itemSet->tcase_id[]=$xkey; - $itemSet->tcversion_id[]=$xvalue['tcversion_id']; - } - } - } - } - return array($ltcv,$itemSet); -} - - -/** - * - * - */ -function initWebEditors(&$guiObj,$cfgObj,$baseHREF) { - if( $guiObj->can_use_bulk_op ) { - $of = web_editor("bulk_exec_notes",$baseHREF,$cfgObj->editorCfg); - $of->Value = getItemTemplateContents('execution_template', $of->InstanceName, null); - - // Magic numbers that can be determined by trial and error - $cols = intval(isset($editorCfg['cols']) ? $cfgObj->editorCfg['cols'] : 60); - $rows = intval(isset($editorCfg['rows']) ? $cfgObj->editorCfg['rows'] : 10); - $guiObj->bulk_exec_notes_editor = $of->CreateHTML($rows,$cols); - unset($of); - } else { - $guiObj->exec_notes_editors = createExecNotesWebEditor($guiObj->map_last_exec,$baseHREF,$cfgObj->editorCfg, - $cfgObj->exec_cfg,$guiObj->lexNotes); - } -} - - - - -/** - * get info from ... - * - */ -function getSettingsAndFilters(&$argsObj) { - - $mode = 'execution_mode'; - $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $sf = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; - - $argsObj->testcases_to_show = isset($sf['testcases_to_show']) ? $sf['testcases_to_show'] : null; - - // just for better readability - $filters = [ - 'filter_status' => 'filter_result_result', - 'filter_assigned_to' => 'filter_assigned_user', - 'execution_type' => 'filter_execution_type', - 'priority' => 'filter_priority', - 'filter_cfields' => - 'filter_custom_fields']; - $settings = [ - 'build_id' => 'setting_build', - 'platform_id' => 'setting_platform' - ]; - - $key2null = array_merge($filters,$settings); - $isNumeric = [ - 'build_id' => 0, - 'platform_id' => -1 - ]; - - foreach($key2null as $key => $sfKey) - { - $argsObj->$key = isset($sf[$sfKey]) ? $sf[$sfKey] : null; - if (is_null($argsObj->$key)) - { - // let's this page be functional withouth a form token too - // (when called from testcases assigned to me) - $argsObj->$key = isset($_REQUEST[$sfKey]) ? $_REQUEST[$sfKey] : null; - } - - if(isset($isNumeric[$key])) - { - $argsObj->$key = intval($argsObj->$key); - } - } - - - // keywords filter - $argsObj->keyword_id = 0; - if (isset($sf['filter_keywords'])) - { - $argsObj->keyword_id = $sf['filter_keywords']; - if (is_array($argsObj->keyword_id) && count($argsObj->keyword_id) == 1) - { - $argsObj->keyword_id = $argsObj->keyword_id[0]; - } - } - - $argsObj->keywordsFilterType = null; - if (isset($sf['filter_keywords_filter_type'])) { - $argsObj->keywordsFilterType = $sf['filter_keywords_filter_type']; - } - - // 20190119 - if (!property_exists($argsObj,'refreshTree')) { - $argsObj->refreshTree = true; - } - $argsObj->refreshTree = isset($sf['setting_refresh_tree_on_action']) ? - $sf['setting_refresh_tree_on_action'] : $argsObj->refreshTree; - - // Checkbox - $tgk = 'filter_assigned_user_include_unassigned'; - $argsObj->include_unassigned = isset($sf[$tgk]) && ($sf[$tgk] != 0 ? 1 : 0); -} - - - -/** - * get info from cookies and also set values on cookies - * - */ -function manageCookies(&$argsObj,$cfgObj) -{ - $cookieExecPrefix = 'TL_execSetResults_'; - - // IMPORTANT: logic for test suite notes CAN NOT BE IMPLEMENTED HERE - // see smarty_assign_tsuite_info() in this file. - $key4cookies = array('tpn_view_status' => 'testplan_notes','bn_view_status' => 'build_description', - 'platform_notes_view_status' => 'platform_description'); - - $key2loop = array('id' => 0, 'exec_to_delete' => 0, 'version_id' => 0, 'tpn_view_status' => 0, - 'bn_view_status' => 0, 'bc_view_status' => 1,'platform_notes_view_status' => 0); - - foreach($key4cookies as $key => $cfgKey) - { - $cookieKey = $cookieExecPrefix . $key; - if( !isset($_REQUEST[$key]) ) - { - // First time we are entered here => we can need to understand how to proceed - switch($cfgObj->exec_cfg->expand_collapse->$cfgKey ) - { - case LAST_USER_CHOICE: - if (isset($_COOKIE[$cookieKey]) ) - { - $key2loop[$key] = $_COOKIE[$cookieKey]; - } - break; - - default: - $key2loop[$key] = $cfgObj->exec_cfg->expand_collapse->$cfgKey; - break; - } - } - } - - $ckObj = new stdClass(); - foreach($key2loop as $key => $value) - { - $argsObj->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : $value; - if( isset($key4cookies[$key]) ) - { - $ckObj->name = $cfgObj->cookie->prefix . $cookieExecPrefix . $key; - $ckObj->value = $argsObj->$key; - tlSetCookie($ckObj); - } - } -} - -/** - * - */ -function getResultsIcons() -{ - $resultsCfg = config_get('results'); - // loop over status for user interface, because these are the statuses - // user can assign while executing test cases - foreach ($resultsCfg['status_icons_for_exec_ui'] as $verbose_status => $ele) { - if ($verbose_status != 'not_run') { - $code = $resultsCfg['status_code'][$verbose_status]; - $items[$code] = $ele; - $items[$code]['title'] = lang_get($items[$code]['title']); - } - } - return $items; -} - -/** - * - */ -function getResultsIconsNext() -{ - $resultsCfg = config_get('results'); - // loop over status for user interface, because these are the statuses - // user can assign while executing test cases - foreach($resultsCfg['status_icons_for_exec_next_ui'] as $verbose_status => $ele) - { - if( $verbose_status != 'not_run' ) - { - $code = $resultsCfg['status_code'][$verbose_status]; - $items[$code] = $ele; - $items[$code]['title'] = lang_get($items[$code]['title']); - } - } - return $items; -} - -/** - * - */ -function genIssueSummary(&$tcaseMgr,$signature,$context) { - - $cfg = config_get('exec_cfg'); - - // Work on labels - $text = array(); - $text['tcase'] = helperLabels($cfg->issues->tcase_level->subject); - $text['tcstep'] = helperLabels($cfg->issues->tcstep_level->subject); - - // Work on values - $ecx = &$context; - $searchFor = array('%%TCNAME%%', '%%PROJECTNAME%%', - '%%PLANNAME%%','%%BUILDNAME%%','%%PLATFNAME%%', - '%%TCPATHNAME%%','%%EXECTSISO%%'); - - $replaceWith = array($signature->tcname,$ecx['tproject_name'], - $ecx['tplan_name'],$ecx['build_name'], - $ecx['platform_name'],$signature->tcpathname, - date('Y-m-dTH:i',time())); - - $nu = array(); - $nu['tcase'] = str_replace($searchFor, $replaceWith, $text['tcase']); - $nu['tcstep'] = null; - - $opt = array('fields2get' => 'step_number,id'); - $steps = $tcaseMgr->get_steps($signature->tcversion_id,0,$opt); - if(null != $steps) { - $tstx = str_replace($searchFor, $replaceWith, $text['tcstep']); - foreach($steps as $elem) { - $nu['tcstep'][$elem['id']] = - str_replace('%%STEPNUMBER%%',$elem['step_number'],$tstx); - } - } - - return array($nu['tcase'],$nu['tcstep']); -} - - - -/** - * - */ -function helperLabels($haystack) { - $searchFor = array('$$issue_on_step', - '$$issue_subject_tcname','$$issue_subject_tcpathname', - '$$issue_subject_projectname', - '$$issue_subject_planname','$$issue_subject_buildname', - '$$issue_subject_platfname','$$issue_subject_execon'); - - $replaceWith = array(); - foreach ( $searchFor as $lblKey ) { - $jk = str_replace('$$','',$lblKey); - $replaceWith[] = lang_get($jk); - } - $hy = str_replace($searchFor, $replaceWith, $haystack); - return $hy; -} - -/** - * - */ -function initExecValuesMenus($tcStatusCfg, $execStatusToExclude) { - - $remove = array($tcStatusCfg['not_run']); - $execStatusTestCase = $execStatusTestCaseStep = createResultsMenu($remove); - - foreach($execStatusToExclude['testcase'] as $code) { - if( isset($execStatusTestCase[$code]) ) { - unset($execStatusTestCase[$code]); - } - } - - foreach($execStatusToExclude['step'] as $code) { - if( isset($execStatusTestCaseStep[$code]) ) { - unset($execStatusTestCaseStep[$code]); - } - } - - return array($execStatusTestCase,$execStatusTestCaseStep); + AND NHB.id=NHA.parent_id "; + if (is_array($tcase_id) && ! empty($tcase_id)) { + $in_list = implode(",", $tcase_id); + $sql .= "AND NHA.id IN (" . $in_list . ")"; + } elseif (! is_null($tcase_id)) { + $sql .= "AND NHA.id={$tcase_id}"; + } else { + $do_query = false; + } + + if ($do_query) { + $rs = $db->fetchRowsIntoMap($sql, 'tc_id'); + } + return $rs; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function smartyAssignTestsuiteInfo(&$smarty, &$tree_mgr, $tcase_id, $tproject_id, + $cfgObj) +{ + if ((intval($tcase_id)) <= 0) { + // hmm, no good + return; + } + $fpath = $tree_mgr->get_full_path_verbose($tcase_id, + array( + 'output_format' => 'id_name' + )); + + $tsuite_info = getTestsuiteNameDetails($tree_mgr->db, $tcase_id); + + foreach ($fpath as $key => $value) { + unset($value['name'][0]); // Remove test plan name + unset($value['node_id'][0]); // Remove test plan name + $str = ''; + foreach ($value['name'] as $jdx => $elem) { + $str .= " "; + $str .= htmlspecialchars($elem, ENT_QUOTES) . '/'; + } + $tsuite_info[$key]['tsuite_name'] = $str; + } + $smarty->assign('tsuite_info', $tsuite_info); + + $headsUp = false; + + // -------------------------------------------------------------------------- + if (! is_null($tsuite_info)) { + $ckObj = new stdClass(); + $ckCfg = config_get('cookie'); + $cookieKey = $ckCfg->prefix . 'TL_execSetResults_tsdetails_view_status'; + + $exec_cfg = config_get('exec_cfg'); + $a_tsvw = array(); + $a_ts = array(); + $a_tsval = array(); + + $tsuite_mgr = new testsuite($tree_mgr->db); + $tsid = current($tsuite_info)['tsuite_id']; + if ($cfgObj->kwHeadsUpTSuiteOnExec != '') { + $headsUp = $tsuite_mgr->keywordIsLinked($tsid, + $cfgObj->kwHeadsUpTSuiteOnExec); + } + foreach ($tsuite_info as $key => $elem) { + $main_k = 'tsdetails_view_status_' . $key; + $a_tsvw[] = $main_k; + $a_ts[] = 'tsdetails_' . $key; + $expand_collapse = 0; + if (! isset($_REQUEST[$main_k])) { + // First time we are entered here => + // we can need to understand how to proceed + switch ($exec_cfg->expand_collapse->testsuite_details) { + case LAST_USER_CHOICE: + if (isset($_COOKIE[$cookieKey])) { + $expand_collapse = $_COOKIE[$cookieKey]; + } + break; + + default: + $expand_collapse = $exec_cfg->expand_collapse->testsuite_details; + break; + } + } + $a_tsval[] = isset($_REQUEST[$main_k]) ? $_REQUEST[$main_k] : $expand_collapse; + $tsuite_id = $elem['tsuite_id']; + $tc_id = $elem['tc_id']; + if (! isset($cached_cf[$tsuite_id])) { + $cached_cf[$tsuite_id] = $tsuite_mgr->html_table_of_custom_field_values( + $tsuite_id, 'design', null, $tproject_id); + } + $ts_cf_smarty[$tc_id] = $cached_cf[$tsuite_id]; + } + + if (! empty($a_tsval)) { + $ckObj->value = $a_tsval[0]; + tlSetCookie($ckObj); + } + + $smarty->assign('tsd_div_id_list', implode(",", $a_ts)); + $smarty->assign('tsd_hidden_id_list', implode(",", $a_tsvw)); + $smarty->assign('tsd_val_for_hidden_list', implode(",", $a_tsval)); + + $smarty->assign('ts_cf_smarty', $ts_cf_smarty); + } + return $headsUp; +} + +/* + * function: + * + * args : + * + * returns: + * + * @internal revisions: + */ +function execAdditionalInfo(&$db, $fileRepo, &$tcaseMgr, $other_execs, $tplan_id, + $tproject_id, $bugInterfaceOn, $bugInterface) +{ + $attachmentInfos = null; + $bugs = null; + $cfexec_values = null; + + foreach ($other_execs as $tcversion_id => $execInfo) { + $num_elem = count($execInfo); + for ($idx = 0; $idx < $num_elem; $idx ++) { + $exec_id = $execInfo[$idx]['execution_id']; + $aInfo = getAttachmentInfos($fileRepo, $exec_id, 'executions', true, + 1); + if ($aInfo) { + $attachmentInfos[$exec_id] = $aInfo; + } + + if ($bugInterfaceOn) { + $the_bugs = get_bugs_for_exec($db, $bugInterface, $exec_id); + if (! empty($the_bugs)) { + $bugs[$exec_id] = $the_bugs; + } + } + + // Custom fields + $cfexec_values[$exec_id] = $tcaseMgr->html_table_of_custom_field_values( + $tcversion_id, 'execution', null, $exec_id, $tplan_id, + $tproject_id); + } + } + + return array( + 'attachment' => $attachmentInfos, + 'bugs' => $bugs, + 'cfexec_values' => $cfexec_values + ); +} + +/* + * function: + * + * args : context hash with following keys + * target => array('tc_versions' => array, 'version_id' =>, 'feature_id' => array) + * context => array with keys + * tproject_id + * tplan_id + * platform_id + * build_id + * user_id + * + * + * returns: + * + */ +function doRemoteExecution(&$dbHandler, $context) +{ + $debugMsg = "File:" . __FILE__ . " Function: " . __FUNCTION__; + + $tables = array(); + $tables['executions'] = DB_TABLE_PREFIX . 'executions'; + + $resultsCfg = config_get('results'); + $tc_status = $resultsCfg['status_code']; + $tree_mgr = new tree($dbHandler); + $cfield_mgr = new cfield_mgr($dbHandler); + + $ret = null; + + $sql = " /* $debugMsg */ INSERT INTO {$tables['executions']} " . + " (testplan_id,platform_id,build_id,tester_id,execution_type," . + " tcversion_id,execution_ts,status,notes) " . + " VALUES ({$context['context']['tplan_id']}, " . + " {$context['context']['platform_id']}, " . + " {$context['context']['build_id']}," . + " {$context['context']['user_id']}," . TESTCASE_EXECUTION_TYPE_AUTO . ","; + + // have we got multiple test cases to execute ? + $target = &$context['target']; + foreach ($target['tc_versions'] as $version_id => $tcase_id) { + $ret[$version_id] = array( + "verboseID" => null, + "status" => null, + "notes" => null, + "system" => null, + "scheduled" => null, + "timestamp" => null + ); + + $tcaseInfo = $tree_mgr->get_node_hierarchy_info($tcase_id); + $tcaseInfo['version_id'] = $version_id; + + // For each test case version we can have a different server config + $serverCfg = $cfield_mgr->getXMLRPCServerParams($version_id, + $target['feature_id'][$version_id]); + $execResult[$version_id] = executeTestCase($tcaseInfo, $serverCfg, + $context['context']); // RPC call + + $tryWrite = false; + switch ($execResult[$version_id]['system']['status']) { + case 'configProblems': + $tryWrite = false; + break; + + case 'connectionFailure': + $tryWrite = false; + break; + + case 'ok': + $tryWrite = true; + break; + } + + if ($tryWrite) { + $trun = &$execResult[$version_id]['execution']; + $ret[$version_id]["status"] = strtolower($trun['result']); + $ret[$version_id]["statusVerbose"] = $trun['resultVerbose']; + $ret[$version_id]["notes"] = trim($trun['notes']); + if ($trun['scheduled'] == 'now') { + $notes = $dbHandler->prepare_string($ret[$version_id]["notes"]); + + if ($ret[$version_id]["status"] != $tc_status['passed'] && + $ret[$version_id]["status"] != $tc_status['failed'] && + $ret[$version_id]["status"] != $tc_status['blocked']) { + $ret[$version_id]["status"] = $tc_status['blocked']; + } + + // + $sql2exec = $sql . $version_id . "," . $dbHandler->db_now() . + ", '{$ret[$version_id]["status"]}', '{$notes}' )"; + $dbHandler->exec_query($sql2exec); + } else { + $ret[$version_id]["scheduled"] = $trun['scheduled']; + $ret[$version_id]["timestamp"] = $trun['timestampISO']; + } + } else { + $ret[$version_id]["system"] = $execResult[$version_id]['system']; + } + } + + return $ret; +} + +/* + * function: initializeExecMode + * + * args: + * + * returns: + * + */ +function initializeExecMode(&$db, $exec_cfg, $userObj, $tproject_id, $tplan_id) +{ + $simple_tester_roles = array_flip($exec_cfg->simple_tester_roles); + $effective_role = $userObj->getEffectiveRole($db, $tproject_id, $tplan_id); + + // Role is considered tester if: + // role == TL_ROLES_TESTER OR Role has Test Plan execute but not Test Plan planning + // + // + $can_execute = $effective_role->hasRight('testplan_execute'); + $can_manage = $effective_role->hasRight('testplan_planning'); + + $use_exec_cfg = isset($simple_tester_roles[$effective_role->dbID]) || + ($can_execute && ! $can_manage); + + return $use_exec_cfg ? $exec_cfg->exec_mode->tester : 'all'; +} + +/* + * function: setTesterAssignment + * + * args: + * + * returns: + * + */ +function setTesterAssignment(&$db, $exec_info, &$tcaseMgr, $tplan_id, + $platform_id, $build_id) +{ + foreach ($exec_info as $version_id => $value) { + $exec_info[$version_id]['assigned_user'] = null; + $exec_info[$version_id]['assigned_user_id'] = null; + + // map of map: main key version_id, secondary key: platform_id + $p3 = $tcaseMgr->getVersionExecAssignment($version_id, $tplan_id, + $build_id); + if (! is_null($p3)) { + foreach ($p3[$version_id][$platform_id] as $uu) { + $assignedTesterId = intval($uu['user_id']); + if ($assignedTesterId) { + $user = tlUser::getByID($db, $assignedTesterId); + if ($user) { + $exec_info[$version_id]['assigned_user'][] = $user->getDisplayName(); + } + $exec_info[$version_id]['assigned_user_id'][] = $assignedTesterId; + } + } + } + $exec_info[$version_id]['assigned_user'] = implode(',', + (array) $exec_info[$version_id]['assigned_user']); + $exec_info[$version_id]['assigned_user_id'] = implode(',', + (array) $exec_info[$version_id]['assigned_user_id']); + } + return $exec_info; +} + +/* + * function: + * Reorder executions to mantaing correct visualization order. + * + * args: + * + * returns: + * + */ +function reorderExecutions(&$tcversion_id, &$exec_info) +{ + $dummy = array(); + foreach ($tcversion_id as $idx => $tcv_id) { + if (isset($exec_info[$tcv_id])) { + $dummy[$idx] = $exec_info[$tcv_id]; + } + } + return $dummy; +} + +/* + * function: setCanExecute + * + * args: + * + * returns: + * + */ +function setCanExecute($exec_info, $execution_mode, $can_execute, $tester_id) +{ + foreach ($exec_info as $key => $tc_exec) { + $execution_enabled = 0; + + if ($can_execute == 1 && $tc_exec['active'] == 1) { + $is_free = $tc_exec['assigned_user_id'] == '' ? 1 : 0; + + $testerSet = array_flip(explode(',', $tc_exec['assigned_user_id'])); + $assigned_to_me = isset($testerSet[$tester_id]) ? 1 : 0; + + switch ($execution_mode) { + case 'assigned_to_me': + $execution_enabled = $assigned_to_me; + break; + + case 'assigned_to_me_or_free': + $execution_enabled = $assigned_to_me || $is_free; + break; + + case 'all': + $execution_enabled = 1; + break; + + default: + $execution_enabled = 0; + break; + } // switch + } + $exec_info[$key]['can_be_executed'] = $execution_enabled; + } + return $exec_info; +} + +/* + * function: createExecNotesWebEditor + * creates map of html needed to display web editors + * for execution notes. + * + * args: tcversions: array where each element has information + * about testcase version that can be executed. + * + * basehref: URL + * editorCfg: + * + * returns: map + * key: testcase id + * value: html to display web editor. + * + */ +function createExecNotesWebEditor(&$tcversions, $basehref, $editorCfg, $execCfg, + $initValue = null) +{ + if (is_null($tcversions) || count($tcversions) == 0) { + return null; // nothing todo >>>------> bye! + } + + // Important Notice: + // + // When using tinymce or none as web editor, we need to set rows and cols + // to appropriate values, to avoid an ugly ui. + // null => use default values defined on editor class file + // + // Rows and Cols values are useless for FCKeditor. + // + if ($execCfg->exec_mode->new_exec == 'latest') { + $itemTemplateValue = $initValue != null ? $initValue : ''; + } else { + $itemTemplateValue = getItemTemplateContents('execution_template', + 'notes', null); + } + + foreach ($tcversions as $tcv) { + $tcversion_id = $tcv['id']; + $tcase_id = $tcv['testcase_id']; + + $of = web_editor("notes[{$tcversion_id}]", $basehref, $editorCfg); + $of->Value = $itemTemplateValue; + + // Magic numbers that can be determined by trial and error + $cols = intval(isset($editorCfg['cols']) ? $editorCfg['cols'] : 60); + $rows = intval(isset($editorCfg['rows']) ? $editorCfg['rows'] : 10); + $editors[$tcase_id] = $of->CreateHTML($rows, $cols); + unset($of); + } + return $editors; +} + +/* + * function: getCfg + * + * args: + * + * returns: + * + */ +function getCfg() +{ + $cfg = new stdClass(); + $cfg->exec_cfg = config_get('exec_cfg'); + $cfg->gui_cfg = config_get('gui'); + + $results = config_get('results'); + $cfg->tc_status = $results['status_code']; + $cfg->execStatusToExclude = $results['execStatusToExclude']; + + $cfg->testcase_cfg = config_get('testcase_cfg'); + $cfg->editorCfg = getWebEditorCfg('execution'); + + $cfg->cookie = config_get('cookie'); + + $cfg->kwHeadsUpTSuiteOnExec = trim( + config_get('keywords')->headsUpTSuiteOnExec); + + return $cfg; +} + +/* + * function: initializeRights + * create object with rights useful for this feature + * + * args: + * dbHandler: reference to db object + * userObj: reference to current user object + * tproject_id: + * tplan_id + * + * Warning: this is right interface for this function, but + * has_rights() can works in a mode (that i consider a dirty one) + * using SESSION to achieve global coupling. + * + * returns: + * + */ +function initializeRights(&$dbHandler, &$userObj, $tproject_id, $tplan_id) +{ + $userERole = $userObj->getEffectiveRole($dbHandler, $tproject_id, $tplan_id); + + $grants = new stdClass(); + $grants->execute = $userERole->hasRight("testplan_execute"); + + // IMPORTANT NOTICE - TICKET 5128 + // If is TRUE we will need also to analize, test case by test case + // these settings: + // $tlCfg->exec_cfg->exec_mode->tester + // $tlCfg->exec_cfg->simple_tester_roles + // + // Why ? + // Because if a tester can execute ONLY test cases assigned to him, this also + // has to mean that: + // can delete executions ONLY of test cases assigned to him + // can edit exec notes ONLY of test cases assigned to him + // can manage uploads on executions, ONLY of test cases assigned to him + // + // These checks can not be done here + // + // TICKET 5310: Execution Config - convert options into rights + $grants->delete_execution = $userERole->hasRight("exec_delete"); + + // Important: + // Execution right must be present to consider this configuration option. + // $grants->edit_exec_notes = $grants->execute && $exec_cfg->edit_notes; + $grants->edit_exec_notes = $grants->execute && + $userERole->hasRight("exec_edit_notes"); + + $grants->edit_testcase = $userERole->hasRight("mgt_modify_tc"); + + return $grants; +} + +/* + * function: initializeGui + * + * args : + * + * returns: + * + */ +function initializeGui(&$dbHandler, &$argsObj, &$cfgObj, &$tplanMgr, &$tcaseMgr, + &$issueTracker, &$codeTracker) +{ + $buildMgr = new build_mgr($dbHandler); + $platformMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + + $gui = new stdClass(); + $gui->uploadOp = null; + $gui->headsUpTSuite = false; + $gui->direct_link = ''; + $gui->allIssueAttrOnScreen = 0; + $gui->lexNotes = null; + $gui->tcversionSet = null; + $gui->plugins = null; + $gui->hasNewestVersion = 0; + $gui->addLinkToTLChecked = $cfgObj->exec_cfg->exec_mode->addLinkToTLChecked; + $gui->addLinkToTLPrintViewChecked = $cfgObj->exec_cfg->exec_mode->addLinkToTLPrintViewChecked; + + $gui->assignTaskChecked = $cfgObj->exec_cfg->exec_mode->assignTaskChecked; + + $k2i = array( + 'import', + 'attachments', + 'exec', + 'edit_exec' + ); + $gui->features = array(); + foreach ($k2i as $olh) { + $gui->features[$olh] = false; + } + + if ($argsObj->user->hasRight($dbHandler, 'testplan_execute', + $argsObj->tproject_id, $argsObj->tplan_id, true)) { + foreach ($k2i as $olh) { + $gui->features[$olh] = true; + } + } + + $gui->showExternalAccessString = true; + $gui->showImgInlineString = false; + + $gui->issueSummaryForStep = null; + $gui->addIssueOp = null; + $gui->allowStepAttachments = true; + + $gui->remoteExecFeedback = $gui->user_feedback = ''; + $gui->tplan_id = $argsObj->tplan_id; + $gui->tproject_id = $argsObj->tproject_id; + $gui->build_id = $argsObj->build_id; + $gui->platform_id = $argsObj->platform_id; + $gui->loadExecDashboard = false; + $gui->treeFormToken = $argsObj->treeFormToken; + $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; + + $gui->execStatusIcons = getResultsIcons(); + $gui->execStatusIconsNext = getResultsIconsNext(); + + list ($gui->execStatusValues, $gui->execStepStatusValues) = initExecValuesMenus( + $cfgObj->tc_status, $cfgObj->execStatusToExclude); + + $gui->can_use_bulk_op = 0; + $gui->exec_notes_editors = null; + $gui->bulk_exec_notes_editor = null; + $gui->req_details = null; + $gui->attachmentInfos = null; + $gui->bugs = null; + $gui->scripts = null; + $gui->other_exec_cfields = null; + $gui->ownerDisplayName = null; + + $gui->editorType = $cfgObj->editorCfg['type']; + $cfgTestPlan = getWebEditorCfg('testplan'); + $gui->testPlanEditorType = $cfgTestPlan['type']; + $cfgPlatform = getWebEditorCfg('platform'); + $gui->platformEditorType = $cfgPlatform['type']; + $cfgBuild = getWebEditorCfg('build'); + $gui->buildEditorType = $cfgBuild['type']; + $cfgDesign = getWebEditorCfg('design'); + $gui->testDesignEditorType = $cfgDesign['type']; + $cfgStepsDesign = getWebEditorCfg('design'); + $gui->stepDesignEditorType = $cfgStepsDesign['type']; + + $gui->filter_assigned_to = $argsObj->filter_assigned_to; + $gui->tester_id = $argsObj->user_id; + $gui->include_unassigned = $argsObj->include_unassigned; + $gui->tpn_view_status = $argsObj->tpn_view_status; + $gui->bn_view_status = $argsObj->bn_view_status; + $gui->bc_view_status = $argsObj->bc_view_status; + $gui->platform_notes_view_status = $argsObj->platform_notes_view_status; + + $gui->refreshTree = $argsObj->refreshTree; + if (! $argsObj->followTheWhiteRabbit && ! $argsObj->statusSingle || + current($argsObj->statusSingle) == $cfgObj->tc_status['not_run']) { + $gui->refreshTree = 0; + } + $gui->map_last_exec_any_build = null; + $gui->map_last_exec = null; + + // 20081122 - franciscom + // Just for the records: + // doing this here, we avoid to do on processTestSuite() and processTestCase(), + // but absolutely this will not improve in ANY WAY perfomance, because we do not loop + // over these two functions. + $tprojectMgr = new testproject($dbHandler); + $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tproject_id); + + $build_info = $buildMgr->get_by_id($argsObj->build_id); + + $gui->build_name = $build_info['name']; + $gui->build_notes = $build_info['notes']; + $gui->build_is_open = ($build_info['is_open'] == 1 ? 1 : 0); + $gui->execution_types = $tcaseMgr->get_execution_types(); + + if ($argsObj->filter_assigned_to) { + $userSet = tlUser::getByIds($dbHandler, + array_values($argsObj->filter_assigned_to)); + if ($userSet) { + foreach ($userSet as $key => $userObj) { + $gui->ownerDisplayName[$key] = $userObj->getDisplayName(); + } + } + } + + $dummy = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id); + $gui->build_name = isset($dummy[$argsObj->build_id]) ? $dummy[$argsObj->build_id] : ''; + $gui->build_div_title = lang_get('build') . ' ' . $gui->build_name; + + $gui->exec_mode = initializeExecMode($dbHandler, $cfgObj->exec_cfg, + $argsObj->user, $argsObj->tproject_id, $argsObj->tplan_id); + + $gui->grants = initializeRights($dbHandler, $argsObj->user, + $argsObj->tproject_id, $argsObj->tplan_id); + + $rs = $tplanMgr->get_by_id($argsObj->tplan_id); + + $gui->testplan_name = $rs['name']; + $gui->testproject_name = $rs['tproject_name']; + $gui->testplan_notes = $rs['notes']; + $gui->testplan_div_title = lang_get('test_plan') . ' ' . $gui->testplan_name; + + $argsObj->tplan_apikey = $rs['api_key']; + + // Important note: + // custom fields for test plan can be edited ONLY on design, that's reason why we are using + // scope = 'design' instead of 'execution' + $gui->testplan_cfields = $tplanMgr->html_table_of_custom_field_values( + $argsObj->tplan_id, 'design', array( + 'show_on_execution' => 1 + )); + + $gui->build_cfields = $buildMgr->html_table_of_custom_field_values( + $argsObj->build_id, $argsObj->tproject_id, 'design', + array( + 'show_on_execution' => 1 + )); + + $gui->history_on = manageHistoryOn($_REQUEST, $_SESSION, $cfgObj->exec_cfg, + 'btn_history_on', 'btn_history_off', 'history_on'); + $gui->history_status_btn_name = $gui->history_on ? 'btn_history_off' : 'btn_history_on'; + + $dummy = $platformMgr->getLinkedToTestplan($argsObj->tplan_id); + $gui->has_platforms = ! is_null($dummy) ? 1 : 0; + + $gui->platform_info['id'] = 0; + $gui->platform_info['name'] = ''; + if (! is_null($argsObj->platform_id) && $argsObj->platform_id > 0) { + $gui->platform_info = $platformMgr->getByID($argsObj->platform_id); + } + $gui->platform_div_title = lang_get('platform') . ' ' . + $gui->platform_info['name']; + + $gui->node_id = $argsObj->id; + $gui->draw_save_and_exit = ($argsObj->caller == 'tcAssignedToMe'); + + // Issue Tracker Integration + $issueTrackerExists = ! is_null($issueTracker); + $gui->tlCanCreateIssue = false; + $gui->tlCanAddIssueNote = false; + $gui->issueTrackerIntegrationOn = false; + if ($issueTrackerExists) { + $gui->tlCanCreateIssue = method_exists($issueTracker, 'addIssue') && + $issueTracker->canCreateViaAPI(); + $gui->tlCanAddIssueNote = method_exists($issueTracker, 'addNote') && + $issueTracker->canAddNoteViaAPI(); + } + + $gui->bug_summary = ''; + $gui->issueTrackerCfg = new stdClass(); + $gui->issueTrackerCfg->bugSummaryMaxLength = 100; // MAGIC I'm sorry + $gui->issueTrackerCfg->editIssueAttr = false; + $gui->issueTrackerCfg->crudIssueViaAPI = false; + + $gui->issueTrackerMetaData = null; + if ($issueTrackerExists) { + if ($issueTracker->isConnected()) { + + $itsCfg = $issueTracker->getCfg(); + $gui->issueTrackerCfg->bugSummaryMaxLength = $issueTracker->getBugSummaryMaxLength(); + $gui->issueTrackerCfg->editIssueAttr = (intval( + $itsCfg->userinteraction) > 0); + $gui->issueTrackerCfg->crudIssueViaAPI = (intval( + $itsCfg->createissueviaapi) > 0) ?? false; + + $gui->issueTrackerIntegrationOn = true; + $gui->accessToIssueTracker = lang_get('link_bts_create_bug') . + "({$argsObj->itsCfg['issuetracker_name']})"; + $gui->createIssueURL = $issueTracker->getEnterBugURL(); + + if ($gui->issueTrackerCfg->crudIssueViaAPI) { + // get metadata + $gui->issueTrackerMetaData = getIssueTrackerMetaData( + $issueTracker); + $gui->tlCanCreateIssue = method_exists($issueTracker, 'addIssue') && + $issueTracker->canCreateViaAPI(); + + $gui->tlCanAddIssueNote = method_exists($issueTracker, 'addNote') && + $issueTracker->canAddNoteViaAPI(); + } + } else { + $gui->user_feedback = lang_get('issue_tracker_integration_problems'); + } + } + + if ($gui->issueTrackerCfg->editIssueAttr == 1) { + $k2c = array( + 'issueType', + 'issuePriority', + 'artifactVersion', + 'artifactComponent' + ); + foreach ($k2c as $kj) { + $gui->$kj = $argsObj->$kj; + + // To manage issue at step level + $kx = $kj . 'ForStep'; + $gui->$kx = $argsObj->$kx; + } + } else { + if (null != $gui->issueTrackerMetaData) { + $singleVal = array( + 'issuetype' => 'issueType', + 'issuepriority' => 'issuePriority' + ); + foreach ($singleVal as $kj => $attr) { + $gui->$attr = null; + if (property_exists($itsCfg, $kj)) { + $gui->$attr = $itsCfg->$kj; + } else { + /* Provide warning */ + tLog( + "Issue Tracker Config Issue? - Attribute:$kj doesn't exist", + "WARNING"); + } + $forStep = $attr . 'ForStep'; + $gui->$forStep = $gui->$attr; + } + + $multiVal = array( + 'version' => 'artifactVersion', + 'component' => 'artifactComponent' + ); + foreach ($multiVal as $kj => $attr) { + $gui->$attr = null; + if (property_exists($itsCfg, $kj)) { + $gui->$attr = (array) $itsCfg->$kj; + } else { + /* Provide warning */ + tLog( + "Issue Tracker Config Issue? - Attribute:$kj doesn't exist", + "WARNING"); + } + $forStep = $attr . 'ForStep'; + $gui->$forStep = $gui->$attr; + } + } + } + + $gui->executionContext = array(); + $gui->executionContext['tproject_name'] = $gui->testproject_name; + $gui->executionContext['tplan_name'] = $gui->testplan_name; + $gui->executionContext['platform_name'] = $gui->platform_info['name']; + $gui->executionContext['build_name'] = $gui->build_name; + + return $gui; +} + +/** + * processTestCase + */ +function processTestCase($tcase, &$guiObj, &$argsObj, &$cfgObj, $tcv, &$treeMgr, + &$tcaseMgr, &$docRepository) +{ + // IMPORTANT due to platform feature + // every element on linked_tcversions will be an array. + $cf_filters = array( + 'show_on_execution' => 1 + ); + $locationFilters = $tcaseMgr->buildCFLocationMap(); + + $guiObj->design_time_cfields = array(); + $guiObj->testplan_design_time_cfields = array(); + + $tcase_id = isset($tcase['tcase_id']) ? $tcase['tcase_id'] : $argsObj->id; + + // Development Notice: + // accessing a FIXED index like in: + // + // $items_to_exec[$tcase_id] = $linked_tcversions[$tcase_id][0]['tcversion_id']; + // $link_id = $linked_tcversions[$tcase_id][0]['feature_id']; + // + // Because we want to access FIRTS element is better to use current. + $target = current(current($tcv)); + $items_to_exec[$tcase_id] = $target['tcversion_id']; + $link_id = $target['feature_id']; + $tcversion_id = isset($tcase['tcversion_id']) ? $tcase['tcversion_id'] : $items_to_exec[$tcase_id]; + + $ltcvID = $tcaseMgr->getLatestVersionID($tcase_id); + $guiObj->hasNewestVersion = ($ltcvID != $tcversion_id); + + $eid = - 1; + if ($cfgObj->exec_cfg->exec_mode->new_exec == 'latest') { + // Need latest exec id on context + $eid = $tcaseMgr->getLatestExecIDInContext($tcversion_id, $argsObj); + } + + $cf_map = null; + $guiObj->execution_time_cfields[$tcase_id] = null; + if ($guiObj->grants->execute) { + if ($eid > 0) { + // I'm getting the values saved on latest execution + $cf_map = $tcaseMgr->get_linked_cfields_at_execution($tcversion_id, + null, null, $eid, $argsObj->tplan_id, $argsObj->tproject_id); + } + + $guiObj->execution_time_cfields[$tcase_id] = $tcaseMgr->html_table_of_custom_field_inputs( + $tcase_id, null, 'execution', "_{$tcase_id}", null, null, + $argsObj->tproject_id, null, $cf_map); + } + + $guiObj->tcAttachments[$tcase_id] = getAttachmentInfos($docRepository, + $tcversion_id, 'tcversions', 1); + + foreach ($locationFilters as $locationKey => $filterValue) { + $finalFilters = $cf_filters + $filterValue; + $guiObj->design_time_cfields[$tcase_id][$locationKey] = $tcaseMgr->html_table_of_custom_field_values( + $tcase_id, 'design', $finalFilters, null, null, + $argsObj->tproject_id, null, $tcversion_id); + + $guiObj->testplan_design_time_cfields[$tcase_id] = $tcaseMgr->html_table_of_custom_field_values( + $tcversion_id, 'testplan_design', $cf_filters, null, null, + $argsObj->tproject_id, null, $link_id); + } + + $tc_info = $treeMgr->get_node_hierarchy_info($tcase_id); + $guiObj->tSuiteAttachments[$tc_info['parent_id']] = getAttachmentInfos( + $docRepository, $tc_info['parent_id'], 'nodes_hierarchy', true, 1); + // Direct Link + $lk = current($tcv); + $guiObj->direct_link = trim($_SESSION['basehref'], '/') . + "/ltx.php?item=exec&feature_id=" . $lk[0]['feature_id'] . "&build_id=" . + $argsObj->build_id; + + $argsObj->direct_link = $guiObj->direct_link; + + // Information for Issue Management + // Common Info + $signature = new stdClass(); + $signature->tcname = $tc_info['name']; + $signature->tcpathname = $tcaseMgr->getPathName($tcase_id); + $signature->tcversion_id = $tcversion_id; + + list ($guiObj->bug_summary, $guiObj->issueSummaryForStep) = genIssueSummary( + $tcaseMgr, $signature, $guiObj->executionContext); + + // return more data eid, has cf on exec + return array( + $tcase_id, + $tcversion_id, + $eid, + ($cf_map != null) + ); +} + +/* + * function: getLatestExec + * Important Notice: + * $tcase_id and $tcversions_id, can be ARRAYS when user enable bulk execution + * + * args : + * + * returns: + * + */ +function getLatestExec(&$dbHandler, $tcase_id, $tcversion_id, $guiObj, $argsObj, + &$tcaseMgr) +{ + $options = array( + 'getNoExecutions' => 1, + 'groupByBuild' => 0, + 'getStepsExecInfo' => 1 + ); + + $last_exec = $tcaseMgr->getLastExecution($tcase_id, $tcversion_id, + $argsObj->tplan_id, $argsObj->build_id, $argsObj->platform_id, $options); + + if (! is_null($last_exec)) { + $last_exec = setTesterAssignment($dbHandler, $last_exec, $tcaseMgr, + $argsObj->tplan_id, $argsObj->platform_id, $argsObj->build_id); + + // Warning: setCanExecute() must be called AFTER setTesterAssignment() + $can_execute = $guiObj->grants->execute && ($guiObj->build_is_open); + $last_exec = setCanExecute($last_exec, $guiObj->exec_mode, $can_execute, + $argsObj->user_id); + } + + // Reorder executions to mantaing correct visualization order. + if (is_array($tcversion_id)) { + $last_exec = reorderExecutions($tcversion_id, $last_exec); + } + + return $last_exec; +} + +/** + * Function retrieve test steps backup + * + * @param testcase $tcaseMgr + * the testcase Manager + * @param array $guiObj + * @param int $testPlanId + * @param int $platformId + * @param int $buildId + * return map + */ +// Has to be moved to testcase class +function getBackupSteps(&$tcaseMgr, $guiObj, $testPlanId, $platformId, $buildId) +{ + $stepsIds = array(); + foreach ($guiObj->map_last_exec as $tcId => $elements) { + foreach ($guiObj->map_last_exec[$tcId]['steps'] as $step) { + array_push($stepsIds, $step["id"]); + } + } + + return $tcaseMgr->getBackupSteps($stepsIds, $testPlanId, $platformId, + $buildId); +} + +/* + * function: getOtherExecutions + * + * args : + * + * returns: + * + * rev: + */ +function getOtherExecutions(&$dbHandler, $tcase_id, $tcversion_id, $guiObj, + $argsObj, &$cfgObj, &$tcaseMgr) +{ + $other_execs = null; + if ($guiObj->history_on) { + // CRITIC see for key names - testcases.class.php -> getExecutionSet() + $execContext = array( + 'testplan_id' => $argsObj->tplan_id, + 'platform_id' => $argsObj->platform_id, + 'build_id' => $argsObj->build_id + ); + + if ($cfgObj->exec_cfg->show_history_all_builds) { + $execContext['build_id'] = null; + } + if ($cfgObj->exec_cfg->show_history_all_platforms) { + $execContext['platform_id'] = null; + } + + $options = array( + 'exec_id_order' => $cfgObj->exec_cfg->history_order + ); + $other_execs = $tcaseMgr->getExecutionSet($tcase_id, $tcversion_id, + $execContext, $options); + } else { + // Warning!!!: + // we can't use the data we have got with previous call to getLastExecution() + // because if user have asked to save results last execution data may be has changed + $aux_map = $tcaseMgr->getLastExecution($tcase_id, $tcversion_id, + $argsObj->tplan_id, $argsObj->build_id, $argsObj->platform_id); + if (! is_null($aux_map)) { + $other_execs = array(); + foreach ($aux_map as $key => $value) { + $other_execs[$key] = array( + $value + ); + } + } + } + return $other_execs; +} + +/* + * function: processTestSuite + * + * args : + * + * returns: + * + */ +function processTestSuite(&$dbHandler, &$guiObj, &$argsObj, $testSet, &$treeMgr, + &$tcaseMgr, &$docRepository) +{ + $locationFilters = $tcaseMgr->buildCFLocationMap(); + $cf_filters = array( + 'show_on_execution' => 1 + ); + + // Get the path for every test case, grouping test cases that have same parent. + $testCaseQty = count($testSet->tcase_id); + if ($testCaseQty > 0) { + $dummy = $tcaseMgr->cfield_mgr->getLocations(); + $verboseLocationCode = array_flip($dummy['testcase']); + $filters = null; + foreach ($verboseLocationCode as $key => $value) { + $filters[$key]['location'] = $value; + } + + $dummy_id = current($testSet->tcase_id); + $index = $testCaseQty == 1 ? $dummy_id : 0; // 0 => BULK + $suffix = '_' . $index; + $execution_time_cfields = $tcaseMgr->html_table_of_custom_field_inputs( + $dummy_id, $argsObj->tproject_id, 'execution', $suffix, null, null, + $argsObj->tproject_id); + + $guiObj->execution_time_cfields[$index] = $execution_time_cfields; + $gdx = 0; + foreach ($testSet->tcase_id as $testcase_id) { + $path_f = $treeMgr->get_path($testcase_id, null, 'full'); + foreach ($path_f as $path_elem) { + if ($path_elem['parent_id'] == $argsObj->id) { + // Can be added because is present in the branch the user wants to view + // ID of branch starting node is in $argsObj->id + $guiObj->tcAttachments[$testcase_id] = getAttachmentInfos( + $docRepository, $testcase_id, 'nodes_hierarchy', true, 1); + + foreach ($locationFilters as $locationKey => $filterValue) { + $finalFilters = $cf_filters + $filterValue; + $guiObj->design_time_cfields[$testcase_id][$locationKey] = $tcaseMgr->html_table_of_custom_field_values( + $testcase_id, 'design', $finalFilters, null, null, + $argsObj->tproject_id, null, + $testSet->tcversion_id[$gdx]); + + $guiObj->testplan_design_time_cfields[$testcase_id] = $tcaseMgr->html_table_of_custom_field_values( + $testcase_id, 'testplan_design', $cf_filters, null, + null, $argsObj->tproject_id); + } + + if ($guiObj->grants->execute) { + $guiObj->execution_time_cfields[$testcase_id] = $tcaseMgr->html_table_of_custom_field_inputs( + $testcase_id, null, 'execution', "_" . $testcase_id, + null, null, $argsObj->tproject_id); + } + } // if( $path_elem['parent_id'] == $argsObj->id ) + + // We do this because do not know if some test case not yet analised will be direct + // child of this test suite, then we get this info in advance. + // In situations where only last test suite on branch have test cases, we are colleting + // info we will never use. + if ($path_elem['node_table'] == 'testsuites' && + ! isset($guiObj->tSuiteAttachments[$path_elem['id']])) { + $guiObj->tSuiteAttachments[$path_elem['id']] = getAttachmentInfos( + $docRepository, $path_elem['id'], 'nodes_hierarchy', + true, 1); + } + } + $gdx ++; + } + } +} + +/** + */ +function buildExecContext(&$argsObj, $tcasePrefix, &$tplanMgr, &$tcaseMgr) +{ + $ret = array(); + $ret['target'] = array( + 'tc_versions' => null, + 'version_id' => null, + 'feature_id' => null, + 'basic_info' => null + ); + $ret['context'] = array( + 'tproject_id' => null, + 'tplan_id' => null, + 'platform_id' => null, + 'build_id' => null, + 'user_id' => null + ); + + foreach ($ret as &$value) { + foreach ($value as $key => $dummy) { + if (property_exists($argsObj, $key)) { + $value[$key] = $argsObj->$key; + } + } + } + + // Now get another important information feature_id on testplan_tcversions + // needed to get remote execution server config if this config has been + // done with Custom Fields at Test Plan Design Time + foreach ($ret['target']['tc_versions'] as $tcv_id => $tc_id) { + $ret['target']['feature_id'][$tcv_id] = $tplanMgr->getFeatureID( + $ret['context']['tplan_id'], $ret['context']['platform_id'], $tcv_id); + + $dummy = $tcaseMgr->get_basic_info($tc_id, array( + 'id' => $tcv_id + )); + $dummy[0]['tcasePrefix'] = $tcasePrefix; + $ret['target']['basic_info'][$tcv_id] = $dummy[0]; + } + return $ret; +} + +function launchRemoteExec(&$dbHandler, &$argsObj, $tcasePrefix, &$tplanMgr, + &$tcaseMgr) +{ + // IMPORTANT NOTICE + // Remote execution will NOT use ANY of data typed by user, + // - notes + // - custom fields + // + // IMPORTANT NOTICE + // need to understand what to do with feedback provided + // by do_remote_execution(). + // Right now no matter how things go, no feedback is given to user. + // May be this need to be improved in future. + // + // Only drawback i see is when remote exec is done on a test suite + // and amount of feedback can be high, then do not see what can be effect + // on GUI + $execContext = buildExecContext($argsObj, $tcasePrefix, $tplanMgr, $tcaseMgr); + $feedback = doRemoteExecution($dbHandler, $execContext); + $feedback = current($feedback); + return $feedback; +} + +/** + * + * @use testplan->filterByOnDesignCustomFields + * + */ +function getLinkedItems($argsObj, $historyOn, $cfgObj, $tcaseMgr, $tplanMgr, + $identity = null) +{ + $ltcv = null; + $idCard = null; + $itemSet = null; + + if (null == $argsObj->tsuite_id) { + if (! is_null($identity)) { + $idCard = $identity; + } elseif (! is_null($argsObj->tc_id) && ! is_array($argsObj->tc_id)) { + $idCard = array( + 'id' => $argsObj->tc_id, + 'version_id' => $argsObj->version_id + ); + } + + $idCard['version_id'] = $tplanMgr->getVersionLinked($argsObj->tplan_id, + $idCard['id']); + } + + if (! is_null($idCard)) { + // CRITIC see for key names - testcases.class.php -> getExecutionSet() + $execContext = array( + 'testplan_id' => $argsObj->tplan_id, + 'platform_id' => $argsObj->platform_id, + 'build_id' => $argsObj->build_id + ); + + $ltcv = null; + if ($historyOn) { + $execContext['testplan_id'] = $argsObj->tplan_id; + $ltcv = $tcaseMgr->getExecutionSet($idCard['id'], null, $execContext); + } + + // lazy implementation: + // getExecutionSet() returns data ONLY for Statuses that are written ON DB, + // then if full history for test case is NOT RUN, we are doomed!! + if (! $historyOn || is_null($ltcv)) { + $opt = null; + $ltcv = $tcaseMgr->getLatestExecSingleContext($idCard, $execContext, + $opt); + } + } else { + // ----------------------------------------------------------- + // When nullify filter_status - 20080504 - DO NOT REMOVE - + // + // May be in the following situation we do not HAVE to apply filter status: + // 1. User have filter for Not Run on Tree + // 2. Clicks on TC XXX + // 3. Executes TC + // 4. DO NOT UPDATE TREE. + // we do not update automatically to avoid: + // a) performance problems + // b) delays on operations due to tree redraw + // c) loose tree status due to lack of feature of tree engine + // + // 5. Clicks again on TC XXX + // If we use filter, we will get No Data Available. + // + // When working on show_testsuite_contents mode (OLD MODE) + // when we show all testcases inside a testsuite + // that verifies a filter criteria + // WE NEED TO APPLY FILTER + // + // We do not have this problem when this page is called after user have executed, + // probably because filter_status is not send back. + // + // I will add logic to nullify filter_status on init_args() + $options = array( + 'only_executed' => true, + 'output' => $historyOn ? 'mapOfArray' : 'mapOfMap', + 'include_unassigned' => $argsObj->include_unassigned, + 'group_by_build' => 'add_build', + 'last_execution' => ! $historyOn + ); + + if (is_null($argsObj->filter_status) || + in_array($cfgObj->tc_status['not_run'], + (array) $argsObj->filter_status)) { + $options['only_executed'] = false; + } + + // args->tsuites_id: is only used when user click on a test suite. + // probably is used only when bulk execution is enabled. + // + // if args->tc_id is not null, theorically all other filters are useless. + // why ? + // Because will normally call this script, + // from the execution tree and if we can click + // on a tree node, this means it has passed all filters. + // + // + // $args->platform_id: needed to get execution status info + // $args->build_id: needed to get execution status info + // + $basic_filters = array( + 'tcase_id' => $argsObj->tc_id, + 'platform_id' => $argsObj->platform_id, + 'build_id' => $argsObj->build_id + ); + + // This filters are useful when bulk execution is enabled, + // and user do click on a test suite on execution tree. + + // seems to be useless => 'cf_hash' => $argsObj->filter_cfields, + // need to review $tplanMgr->getLinkedForExecTree + $bulk_filters = array( + 'keyword_id' => $argsObj->keyword_id, + 'assigned_to' => $argsObj->filter_assigned_to, + 'exec_status' => $argsObj->filter_status, + 'tsuites_id' => $argsObj->tsuite_id, + 'assigned_on_build' => $argsObj->build_id, + 'exec_type' => $argsObj->execution_type, + 'urgencyImportance' => $argsObj->priority + ); + + // CRITIC / IMPORTANT + // With BULK Operation enabled, we prefer to display Test cases + // that are ONLY DIRECT CHILDREN + // of test suite id => we do not do deep walk. + // Think is a good choice, to avoid retrieving lot of info. + // May be we need to add a config parameter (or better an option at GUI level) + // in order to allow use how he / she wants to work. + // + $filters = array_merge($basic_filters, $bulk_filters); + + if (! is_null( + $sql2do = $tplanMgr->getLinkedForExecTree($argsObj->tplan_id, + $filters, $options))) { + if (is_array($sql2do)) { + if (isset($filters['keyword_filter_type']) && + ($filters['keyword_filter_type'] == 'And')) { + $kmethod = "fetchRowsIntoMapAddRC"; + $unionClause = " UNION ALL "; + } else { + $kmethod = "fetchRowsIntoMap"; + $unionClause = ' UNION '; + } + $sql2run = $sql2do['exec'] . $unionClause . $sql2do['not_run']; + } else { + $sql2run = $sql2do; + } + + // Development Notice: + // CUMULATIVE is used only to create same type of datastructe that existed + // before this refactoring + // + // $tex = $tcaseMgr->db->$kmethod($sql2run,'tcase_id',database::CUMULATIVE); + $sql2run .= ' ORDER BY exec_order '; + + $ltcv = $tex = $tcaseMgr->db->$kmethod($sql2run, 'tcase_id'); + if (! is_null($tex)) { + // We need to create: + // one set for Custom fields that apply to DESIGN + // one set for Custom fields that apply to TESTPLAN DESIGN + + if (! is_null($argsObj->filter_cfields)) { + $tk = array_keys($argsObj->filter_cfields); + $cf = null; + // foreach( array('design','testplan_design') as $l4) + foreach (array( + 'design' + ) as $l4) { + $cf[$l4] = $tplanMgr->cfield_mgr->getByIDAndEnableOn( + $tk, array( + $l4 => true + )); + } + if (isset($cf['design']) && ! is_null($cf['design'])) { + foreach ($cf['design'] as $yy => $xc) { + $az[$yy] = $argsObj->filter_cfields[$yy]; + } + $tex = $tplanMgr->filterByOnDesignCustomFields($tex, $az); + } + } + + foreach ($tex as $xkey => $xvalue) { + $itemSet->tcase_id[] = $xkey; + $itemSet->tcversion_id[] = $xvalue['tcversion_id']; + } + } + } + } + return array( + $ltcv, + $itemSet + ); +} + +/** + */ +function initWebEditors(&$guiObj, $cfgObj, $baseHREF) +{ + if ($guiObj->can_use_bulk_op) { + $of = web_editor("bulk_exec_notes", $baseHREF, $cfgObj->editorCfg); + $of->Value = getItemTemplateContents('execution_template', + $of->InstanceName, null); + + // Magic numbers that can be determined by trial and error + $cols = intval( + isset($editorCfg['cols']) ? $cfgObj->editorCfg['cols'] : 60); + $rows = intval( + isset($editorCfg['rows']) ? $cfgObj->editorCfg['rows'] : 10); + $guiObj->bulk_exec_notes_editor = $of->CreateHTML($rows, $cols); + unset($of); + } else { + $guiObj->exec_notes_editors = createExecNotesWebEditor( + $guiObj->map_last_exec, $baseHREF, $cfgObj->editorCfg, + $cfgObj->exec_cfg, $guiObj->lexNotes); + } +} + +/** + * get info from ... + */ +function getSettingsAndFilters(&$argsObj) +{ + $mode = 'execution_mode'; + $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $sf = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; + + $argsObj->testcases_to_show = isset($sf['testcases_to_show']) ? $sf['testcases_to_show'] : null; + + // just for better readability + $filters = [ + 'filter_status' => 'filter_result_result', + 'filter_assigned_to' => 'filter_assigned_user', + 'execution_type' => 'filter_execution_type', + 'priority' => 'filter_priority', + 'filter_cfields' => 'filter_custom_fields' + ]; + $settings = [ + 'build_id' => 'setting_build', + 'platform_id' => 'setting_platform' + ]; + + $key2null = array_merge($filters, $settings); + $isNumeric = [ + 'build_id' => 0, + 'platform_id' => - 1 + ]; + + foreach ($key2null as $key => $sfKey) { + $argsObj->$key = isset($sf[$sfKey]) ? $sf[$sfKey] : null; + if (is_null($argsObj->$key)) { + // let's this page be functional withouth a form token too + // (when called from testcases assigned to me) + $argsObj->$key = isset($_REQUEST[$sfKey]) ? $_REQUEST[$sfKey] : null; + } + + if (isset($isNumeric[$key])) { + $argsObj->$key = intval($argsObj->$key); + } + } + + // keywords filter + $argsObj->keyword_id = 0; + if (isset($sf['filter_keywords'])) { + $argsObj->keyword_id = $sf['filter_keywords']; + if (is_array($argsObj->keyword_id) && count($argsObj->keyword_id) == 1) { + $argsObj->keyword_id = $argsObj->keyword_id[0]; + } + } + + $argsObj->keywordsFilterType = null; + if (isset($sf['filter_keywords_filter_type'])) { + $argsObj->keywordsFilterType = $sf['filter_keywords_filter_type']; + } + + // 20190119 + if (! property_exists($argsObj, 'refreshTree')) { + $argsObj->refreshTree = true; + } + $argsObj->refreshTree = isset($sf['setting_refresh_tree_on_action']) ? $sf['setting_refresh_tree_on_action'] : $argsObj->refreshTree; + + // Checkbox + $tgk = 'filter_assigned_user_include_unassigned'; + $argsObj->include_unassigned = isset($sf[$tgk]) && ($sf[$tgk] != 0 ? 1 : 0); +} + +/** + * get info from cookies and also set values on cookies + */ +function manageCookies(&$argsObj, $cfgObj) +{ + $cookieExecPrefix = 'TL_execSetResults_'; + + // IMPORTANT: logic for test suite notes CAN NOT BE IMPLEMENTED HERE + // see smarty_assign_tsuite_info() in this file. + $key4cookies = array( + 'tpn_view_status' => 'testplan_notes', + 'bn_view_status' => 'build_description', + 'platform_notes_view_status' => 'platform_description' + ); + + $key2loop = array( + 'id' => 0, + 'exec_to_delete' => 0, + 'version_id' => 0, + 'tpn_view_status' => 0, + 'bn_view_status' => 0, + 'bc_view_status' => 1, + 'platform_notes_view_status' => 0 + ); + + foreach ($key4cookies as $key => $cfgKey) { + $cookieKey = $cookieExecPrefix . $key; + if (! isset($_REQUEST[$key])) { + // First time we are entered here => we can need to understand how to proceed + switch ($cfgObj->exec_cfg->expand_collapse->$cfgKey) { + case LAST_USER_CHOICE: + if (isset($_COOKIE[$cookieKey])) { + $key2loop[$key] = $_COOKIE[$cookieKey]; + } + break; + + default: + $key2loop[$key] = $cfgObj->exec_cfg->expand_collapse->$cfgKey; + break; + } + } + } + + $ckObj = new stdClass(); + foreach ($key2loop as $key => $value) { + $argsObj->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : $value; + if (isset($key4cookies[$key])) { + $ckObj->name = $cfgObj->cookie->prefix . $cookieExecPrefix . $key; + $ckObj->value = $argsObj->$key; + tlSetCookie($ckObj); + } + } +} + +/** + */ +function getResultsIcons() +{ + $resultsCfg = config_get('results'); + // loop over status for user interface, because these are the statuses + // user can assign while executing test cases + foreach ($resultsCfg['status_icons_for_exec_ui'] as $verbose_status => $ele) { + if ($verbose_status != 'not_run') { + $code = $resultsCfg['status_code'][$verbose_status]; + $items[$code] = $ele; + $items[$code]['title'] = lang_get($items[$code]['title']); + } + } + return $items; +} + +/** + */ +function getResultsIconsNext() +{ + $resultsCfg = config_get('results'); + // loop over status for user interface, because these are the statuses + // user can assign while executing test cases + foreach ($resultsCfg['status_icons_for_exec_next_ui'] as $verbose_status => $ele) { + if ($verbose_status != 'not_run') { + $code = $resultsCfg['status_code'][$verbose_status]; + $items[$code] = $ele; + $items[$code]['title'] = lang_get($items[$code]['title']); + } + } + return $items; +} + +/** + */ +function genIssueSummary(&$tcaseMgr, $signature, $context) +{ + $cfg = config_get('exec_cfg'); + + // Work on labels + $text = array(); + $text['tcase'] = helperLabels($cfg->issues->tcase_level->subject); + $text['tcstep'] = helperLabels($cfg->issues->tcstep_level->subject); + + // Work on values + $ecx = &$context; + $searchFor = array( + '%%TCNAME%%', + '%%PROJECTNAME%%', + '%%PLANNAME%%', + '%%BUILDNAME%%', + '%%PLATFNAME%%', + '%%TCPATHNAME%%', + '%%EXECTSISO%%' + ); + + $replaceWith = array( + $signature->tcname, + $ecx['tproject_name'], + $ecx['tplan_name'], + $ecx['build_name'], + $ecx['platform_name'], + $signature->tcpathname, + date('Y-m-dTH:i', time()) + ); + + $nu = array(); + $nu['tcase'] = str_replace($searchFor, $replaceWith, $text['tcase']); + $nu['tcstep'] = null; + + $opt = array( + 'fields2get' => 'step_number,id' + ); + $steps = $tcaseMgr->get_steps($signature->tcversion_id, 0, $opt); + if (null != $steps) { + $tstx = str_replace($searchFor, $replaceWith, $text['tcstep']); + foreach ($steps as $elem) { + $nu['tcstep'][$elem['id']] = str_replace('%%STEPNUMBER%%', + $elem['step_number'], $tstx); + } + } + + return array( + $nu['tcase'], + $nu['tcstep'] + ); +} + +/** + */ +function helperLabels($haystack) +{ + $searchFor = array( + '$$issue_on_step', + '$$issue_subject_tcname', + '$$issue_subject_tcpathname', + '$$issue_subject_projectname', + '$$issue_subject_planname', + '$$issue_subject_buildname', + '$$issue_subject_platfname', + '$$issue_subject_execon' + ); + + $replaceWith = array(); + foreach ($searchFor as $lblKey) { + $jk = str_replace('$$', '', $lblKey); + $replaceWith[] = lang_get($jk); + } + return str_replace($searchFor, $replaceWith, $haystack); +} + +/** + */ +function initExecValuesMenus($tcStatusCfg, $execStatusToExclude) +{ + $remove = array( + $tcStatusCfg['not_run'] + ); + $execStatusTestCase = $execStatusTestCaseStep = createResultsMenu($remove); + + foreach ($execStatusToExclude['testcase'] as $code) { + if (isset($execStatusTestCase[$code])) { + unset($execStatusTestCase[$code]); + } + } + + foreach ($execStatusToExclude['step'] as $code) { + if (isset($execStatusTestCaseStep[$code])) { + unset($execStatusTestCaseStep[$code]); + } + } + + return array( + $execStatusTestCase, + $execStatusTestCaseStep + ); } diff --git a/lib/execute/getExecNotes.php b/lib/execute/getExecNotes.php index 44002bed6f..93e481bc74 100644 --- a/lib/execute/getExecNotes.php +++ b/lib/execute/getExecNotes.php @@ -1,70 +1,71 @@ -exec_id); -$notesContent = $map[0]['notes']; - -$readonly = $args->readonly > 0 ? 'readonly="readonly"' : ''; -$smarty = new TLSmarty(); -$smarty->assign('notes',$notesContent); -$smarty->assign('webeditorCfg',$webeditorCfg); -$smarty->assign('webeditorType',$webeditorCfg['type']); -$smarty->assign('readonly',$readonly); -$smarty->assign('editor_instance','exec_notes_' . $args->exec_id); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -function createExecNotesWebEditor($id,$basehref,$editorCfg,$content=null) -{ - // Important Notice: - // - // When using tinymce or none as web editor, we need to set rows and cols - // to appropriate values, to avoid an ugly ui. - // null => use default values defined on editor class file - // - // Rows and Cols values are useless for FCKeditor. - // - $of=web_editor("exec_notes_$id",$basehref,$editorCfg) ; - $of->Value = $content; - $editor=$of->CreateHTML(10,60); - unset($of); - return $editor; -} - - - -function init_args() -{ - $iParams = array("exec_id" => array(tlInputParameter::INT_N), - "readonly" => array(tlInputParameter::INT_N)); - $args = new stdClass(); - R_PARAMS($iParams,$args); - return $args; -} -?> \ No newline at end of file +exec_id); +$notesContent = $map[0]['notes']; + +$readonly = $args->readonly > 0 ? 'readonly="readonly"' : ''; +$smarty = new TLSmarty(); +$smarty->assign('notes', $notesContent); +$smarty->assign('webeditorCfg', $webeditorCfg); +$smarty->assign('webeditorType', $webeditorCfg['type']); +$smarty->assign('readonly', $readonly); +$smarty->assign('editor_instance', 'exec_notes_' . $args->exec_id); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +function createExecNotesWebEditor($id, $basehref, $editorCfg, $content = null) +{ + // Important Notice: + // + // When using tinymce or none as web editor, we need to set rows and cols + // to appropriate values, to avoid an ugly ui. + // null => use default values defined on editor class file + // + // Rows and Cols values are useless for FCKeditor. + // + $of = web_editor("exec_notes_$id", $basehref, $editorCfg); + $of->Value = $content; + $editor = $of->CreateHTML(10, 60); + unset($of); + return $editor; +} + +function initArgs() +{ + $iParams = array( + "exec_id" => array( + tlInputParameter::INT_N + ), + "readonly" => array( + tlInputParameter::INT_N + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + return $args; +} +?> diff --git a/lib/experiments/gitlab.php b/lib/experiments/gitlab.php index 2a464d1aff..389b68e7d7 100644 --- a/lib/experiments/gitlab.php +++ b/lib/experiments/gitlab.php @@ -1,68 +1,62 @@ - - '99b938c71df5dc93ac0c5dc81cdc6e33906d9708e8297d1fe2b99f872279fda7', - - 'clientSecret' => - '57d10fc0e6fe9f95ee9faf371dd5d02033fa0b0e63f3db966763c405e5b118ef', - 'redirectUri' => $redu - - ] -); - -session_start(); - -if (!isset($_GET['code'])) { - // If we don't have an authorization code then get one - $authUrl = $provider->getAuthorizationUrl(); - $_SESSION['oauth2state'] = $provider->getState(); - header('Location: '.$authUrl); - exit; - -// Check given state against previously stored one to mitigate CSRF attack -} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - - var_dump($_GET['state']); - die(); - unset($_SESSION['oauth2state']); - exit('Invalid state'); - -} else { - - // Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken('authorization_code', [ - 'code' => $_GET['code'], - ]); - - // Optional: Now you have a token you can look up a users profile data - try { - - // We got an access token, let's now get the user's details - $user = $provider->getResourceOwner($token); - - echo '
    ';
    -        var_dump($user->toArray());
    -        echo '
    '; - // Use these details to create a new profile - printf('
    getName %s!', $user->getName()); - printf('
    getEmail %s!', $user->getEmail()); - printf('
    getUserName %s!', $user->getUserName()); - echo '
    '; - - - - } catch (Exception $e) { - - // Failed to get user details - exit('Oh dear...'); - } - - // Use this to interact with an API on the users behalf - echo $token->getToken(); -} \ No newline at end of file + '99b938c71df5dc93ac0c5dc81cdc6e33906d9708e8297d1fe2b99f872279fda7', + + 'clientSecret' => '57d10fc0e6fe9f95ee9faf371dd5d02033fa0b0e63f3db966763c405e5b118ef', + 'redirectUri' => $redu + ]); + +session_start(); + +if (! isset($_GET['code'])) { + // If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl(); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit(); + + // Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + + var_dump($_GET['state']); + die(); + unset($_SESSION['oauth2state']); + exit('Invalid state'); +} else { + + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // Optional: Now you have a token you can look up a users profile data + try { + + // We got an access token, let's now get the user's details + $user = $provider->getResourceOwner($token); + + echo '
    ';
    +        var_dump($user->toArray());
    +        echo '
    '; + // Use these details to create a new profile + printf('
    getName %s!', $user->getName()); + printf('
    getEmail %s!', $user->getEmail()); + printf('
    getUserName %s!', $user->getUserName()); + echo '
    '; + } catch (Exception $e) { + + // Failed to get user details + exit('Oh dear...'); + } + + // Use this to interact with an API on the users behalf + echo $token->getToken(); +} diff --git a/lib/experiments/google.php b/lib/experiments/google.php index e29c6061e2..3ed32771bd 100644 --- a/lib/experiments/google.php +++ b/lib/experiments/google.php @@ -1,77 +1,62 @@ - '{google-client-id}', - 'clientSecret' => '{google-client-secret}', - 'redirectUri' => 'https://example.com/callback-url', - 'hostedDomain' => 'example.com', // optional; used to restrict access to users on your G Suite/Google Apps for Business accounts -]); -*/ - -$redu = 'http://fman.hopto.org/lib/experiments/google.php'; - -$provider = new Google([ - 'clientId' => -'860603525614-fscj9cgr2dvks51uh6odl67skec536fd.apps.googleusercontent.com', - 'clientSecret' => '_YOKquNTa4Fux-OMJoxDBuov', - 'redirectUri' => $redu - -]); - -if (!empty($_GET['error'])) { - - // Got an error, probably user denied access - exit('Got error: ' . htmlspecialchars($_GET['error'], ENT_QUOTES, 'UTF-8')); - -} elseif (empty($_GET['code'])) { - - // If we don't have an authorization code then get one - $authUrl = $provider->getAuthorizationUrl(); - $_SESSION['oauth2state'] = $provider->getState(); - header('Location: ' . $authUrl); - exit; - -} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - - // State is invalid, possible CSRF attack in progress - unset($_SESSION['oauth2state']); - exit('Invalid state'); - -} else { - - // Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken('authorization_code', [ - 'code' => $_GET['code'] - ]); - - // Optional: Now you have a token you can look up a users profile data - try { - - // We got an access token, let's now get the owner details - $ownerDetails = $provider->getResourceOwner($token); - - // Use these details to create a new profile - printf('Hello %s!', $ownerDetails->getFirstName()); - - } catch (Exception $e) { - - // Failed to get user details - exit('Something went wrong: ' . $e->getMessage()); - - } - - // Use this to interact with an API on the users behalf - echo $token->getToken(); - - // Use this to get a new access token if the old one expires - echo $token->getRefreshToken(); - - // Unix timestamp at which the access token expires - echo $token->getExpires(); -} \ No newline at end of file + '860603525614-fscj9cgr2dvks51uh6odl67skec536fd.apps.googleusercontent.com', + 'clientSecret' => '_YOKquNTa4Fux-OMJoxDBuov', + 'redirectUri' => $redu + ]); + +if (! empty($_GET['error'])) { + + // Got an error, probably user denied access + exit('Got error: ' . htmlspecialchars($_GET['error'], ENT_QUOTES, 'UTF-8')); +} elseif (empty($_GET['code'])) { + + // If we don't have an authorization code then get one + $authUrl = $provider->getAuthorizationUrl(); + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit(); +} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + + // State is invalid, possible CSRF attack in progress + unset($_SESSION['oauth2state']); + exit('Invalid state'); +} else { + + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // Optional: Now you have a token you can look up a users profile data + try { + // We got an access token, let's now get the owner details + $ownerDetails = $provider->getResourceOwner($token); + + // Use these details to create a new profile + printf('Hello %s!', $ownerDetails->getFirstName()); + } catch (Exception $e) { + + // Failed to get user details + exit('Something went wrong: ' . $e->getMessage()); + } + + // Use this to interact with an API on the users behalf + echo $token->getToken(); + + // Use this to get a new access token if the old one expires + echo $token->getRefreshToken(); + + // Unix timestamp at which the access token expires + echo $token->getExpires(); +} diff --git a/lib/experiments/lea.php b/lib/experiments/lea.php index b36467872a..b7a0a77acb 100644 --- a/lib/experiments/lea.php +++ b/lib/experiments/lea.php @@ -1,76 +1,74 @@ - 'demoapp', // The client ID assigned to you by the provider - 'clientSecret' => 'demopass', // The client password assigned to you by the provider - 'redirectUri' => 'http://example.com/your-redirect-url/', - 'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize', - 'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token', - 'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource' -]); - -// If we don't have an authorization code then get one -if (!isset($_GET['code'])) { - - // Fetch the authorization URL from the provider; this returns the - // urlAuthorize option and generates and applies any necessary parameters - // (e.g. state). - $authorizationUrl = $provider->getAuthorizationUrl(); - - // Get the state generated for you and store it to the session. - $_SESSION['oauth2state'] = $provider->getState(); - - // Redirect the user to the authorization URL. - header('Location: ' . $authorizationUrl); - exit; - -// Check given state against previously stored one to mitigate CSRF attack -} elseif (empty($_GET['state']) || (isset($_SESSION['oauth2state']) && $_GET['state'] !== $_SESSION['oauth2state'])) { - - if (isset($_SESSION['oauth2state'])) { - unset($_SESSION['oauth2state']); - } - - exit('Invalid state'); - -} else { - - try { - - // Try to get an access token using the authorization code grant. - $accessToken = $provider->getAccessToken('authorization_code', [ - 'code' => $_GET['code'] - ]); - - // We have an access token, which we may use in authenticated - // requests against the service provider's API. - echo 'Access Token: ' . $accessToken->getToken() . "
    "; - echo 'Refresh Token: ' . $accessToken->getRefreshToken() . "
    "; - echo 'Expired in: ' . $accessToken->getExpires() . "
    "; - echo 'Already expired? ' . ($accessToken->hasExpired() ? 'expired' : 'not expired') . "
    "; - - // Using the access token, we may look up details about the - // resource owner. - $resourceOwner = $provider->getResourceOwner($accessToken); - - var_export($resourceOwner->toArray()); - - // The provider provides a way to get an authenticated API request for - // the service, using the access token; it returns an object conforming - // to Psr\Http\Message\RequestInterface. - $request = $provider->getAuthenticatedRequest( - 'GET', - 'http://brentertainment.com/oauth2/lockdin/resource', - $accessToken - ); - - } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { - - // Failed to get the access token or user details. - exit($e->getMessage()); - - } - -} \ No newline at end of file + 'demoapp', // The client ID assigned to you by the provider + 'clientSecret' => 'demopass', // The client password assigned to you by the provider + 'redirectUri' => 'http://example.com/your-redirect-url/', + 'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize', + 'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token', + 'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource' + ]); + +// If we don't have an authorization code then get one +if (! isset($_GET['code'])) { + + // Fetch the authorization URL from the provider; this returns the + // urlAuthorize option and generates and applies any necessary parameters + // (e.g. state). + $authorizationUrl = $provider->getAuthorizationUrl(); + + // Get the state generated for you and store it to the session. + $_SESSION['oauth2state'] = $provider->getState(); + + // Redirect the user to the authorization URL. + header('Location: ' . $authorizationUrl); + exit(); + + // Check given state against previously stored one to mitigate CSRF attack +} elseif (empty($_GET['state']) || + (isset($_SESSION['oauth2state']) && + $_GET['state'] !== $_SESSION['oauth2state'])) { + + if (isset($_SESSION['oauth2state'])) { + unset($_SESSION['oauth2state']); + } + + exit('Invalid state'); +} else { + + try { + + // Try to get an access token using the authorization code grant. + $accessToken = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // We have an access token, which we may use in authenticated + // requests against the service provider's API. + echo 'Access Token: ' . $accessToken->getToken() . "
    "; + echo 'Refresh Token: ' . $accessToken->getRefreshToken() . "
    "; + echo 'Expired in: ' . $accessToken->getExpires() . "
    "; + echo 'Already expired? ' . + ($accessToken->hasExpired() ? 'expired' : 'not expired') . "
    "; + + // Using the access token, we may look up details about the + // resource owner. + $resourceOwner = $provider->getResourceOwner($accessToken); + + var_export($resourceOwner->toArray()); + + // The provider provides a way to get an authenticated API request for + // the service, using the access token; it returns an object conforming + // to Psr\Http\Message\RequestInterface. + $request = $provider->getAuthenticatedRequest('GET', + 'http://brentertainment.com/oauth2/lockdin/resource', $accessToken); + } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { + + // Failed to get the access token or user details. + exit($e->getMessage()); + } +} diff --git a/lib/functions/APIKey.class.php b/lib/functions/APIKey.class.php index 6d089b79c5..819ad6e6a9 100644 --- a/lib/functions/APIKey.class.php +++ b/lib/functions/APIKey.class.php @@ -1,122 +1,100 @@ -object_table = $this->tables["users"]; - } - - /* - function: addKeyForUser - - args: userid - - returns: tl::OK / tl::ERROR - - */ - public function addKeyForUser($userID) - { - $query = "UPDATE {$this->object_table} " . - " SET script_key='" . $this->generateKey() . "' " . - " WHERE id='".intval($userID)."'"; - $result = $this->db->exec_query($query); - - if ($result) - { - $this->dbID = $this->db->insert_id(); - } - return $result ? tl::OK : tl::ERROR; - } - - /* - function: generateKey - - args: - - - returns: key - - */ - private function generateKey() - { - $key = ''; - - for($i=0; $i<8; $i++) - { - $key .= mt_rand(); - } - - return md5($key); - } - - /* - function: getAPIKey - - args: - - - returns: key - - */ - public function getAPIKey($userID) - { - $key=null; - $key_map=$this->getAPIKeys($userID); - - if( !is_null($key_map) ) - { - $key = $key_map[$userID]; - } - - return $key; - } - - - /* - function: getAPIKeys - - args: [userID]=default null => all APIkeys - - returns: map - associative array[userID]=script_key - - */ - public function getAPIKeys($userID=null) - { - $query = "SELECT id, script_key " . - " FROM {$this->object_table} " ; - - if( is_null($userID) ) - { - $whereClause = " WHERE script_key IS NOT NULL"; - } - else - { - $whereClause = " WHERE id=" . intval($userID); - } - $query .= $whereClause; - - $rs = $this->db->fetchColumnsIntoMap($query, 'id', 'script_key'); - return $rs; - } -} -?> \ No newline at end of file +object_table = $this->tables["users"]; + } + + /** + * + * @param int $userID + * @return mixed tl::OK / tl::ERROR + */ + public function addKeyForUser($userID) + { + $query = "UPDATE {$this->object_table} " . " SET script_key='" . + $this->generateKey() . "' " . " WHERE id='" . intval($userID) . "'"; + $result = $this->db->exec_query($query); + + if ($result) { + $this->dbID = $this->db->insert_id(); + } + return $result ? tl::OK : tl::ERROR; + } + + /** + * + * @return string md5 hash of a string + */ + private function generateKey() + { + $key = ''; + + for ($i = 0; $i < 8; $i ++) { + $key .= mt_rand(); + } + + return md5($key); + } + + /** + * + * @param int $userID + * @return $key + */ + public function getAPIKey($userID) + { + $key = null; + $key_map = $this->getAPIKeys($userID); + + if (! is_null($key_map)) { + $key = $key_map[$userID]; + } + + return $key; + } + + /** + * + * @param int $userID + * [userID]=default null => all APIkeys + * @return array associative array[userID]=script_key + */ + public function getAPIKeys($userID = null) + { + $query = "SELECT id, script_key " . " FROM {$this->object_table} "; + + if (is_null($userID)) { + $whereClause = " WHERE script_key IS NOT NULL"; + } else { + $whereClause = " WHERE id=" . intval($userID); + } + $query .= $whereClause; + + return $this->db->fetchColumnsIntoMap($query, 'id', 'script_key'); + } +} +?> diff --git a/lib/functions/assignment_mgr.class.php b/lib/functions/assignment_mgr.class.php index 77dbe39e8c..fe37d95e6e 100644 --- a/lib/functions/assignment_mgr.class.php +++ b/lib/functions/assignment_mgr.class.php @@ -1,590 +1,568 @@ -tables['assignment_types']}"; - $hash_types = $this->db->fetchRowsIntoMap($sql,$key_field); - } - return $hash_types; - } - - /* - $key_field: contains the name column that has to be used as the key of - the returned hash. - */ - function get_available_status($key_field='description') - { - static $hash_types; - if (!$hash_types) - { - $sql = " SELECT * FROM {$this->tables['assignment_status']} "; - $hash_types = $this->db->fetchRowsIntoMap($sql,$key_field); - } - - return $hash_types; - } - - // $feature_id can be an scalar or an array - function delete_by_feature_id($feature_id) - { - if( is_array($feature_id) ) - { - $feature_id_list = implode(",",$feature_id); - $where_clause = " WHERE feature_id IN ($feature_id_list) "; - } - else - { - $where_clause = " WHERE feature_id={$feature_id}"; - } - $sql = " DELETE FROM {$this->tables['user_assignments']} {$where_clause}"; - $result = $this->db->exec_query($sql); - } - - /** - * Delete the user assignments for a given build. - * - * @author Andreas Simon - * @param int $build_id The ID of the build for which the user assignments shall be deleted. - * @param int $delete_all_types If true, all assignments regardless of type will be deleted, - * else (default) only tester assignments. - */ - function delete_by_build_id($build_id, $delete_all_types = false) - { - $type_sql = ""; - - if (!$delete_all_types) - { - $types = $this->get_available_types(); - $tc_execution_type = $types['testcase_execution']['id']; - $type_sql = " AND type = {$tc_execution_type} "; - } - - $sql = " DELETE FROM {$this->tables['user_assignments']} " . - " WHERE build_id = " . intval($build_id) . " {$type_sql} "; - - $this->db->exec_query($sql); - } - - // delete assignments by feature id and build_id - function delete_by_feature_id_and_build_id($feature_map) - { - $feature_id_list = implode(",",array_keys($feature_map)); - $where_clause = " WHERE feature_id IN ($feature_id_list) "; - - $sql = " DELETE FROM {$this->tables['user_assignments']} {$where_clause} "; - - // build_id is the same for all entries because of assignment form - // -> skip foreach after first iteration - $build_id = 0; - foreach ($feature_map as $key => $feature) - { - $build_id = $feature['build_id']; - break; - } - - $sql .= " AND build_id = {$build_id} "; - $result = $this->db->exec_query($sql); - } - - /** - * $items array of signature - * signature = array('type' => ,'feature_id' =>,'user_id' =>, 'build_id' => ) - * - */ - function deleteBySignature($items) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - foreach($items as $signature) - { - $sql = " DELETE FROM {$this->tables['user_assignments']} WHERE 1=1 "; - foreach($signature as $column => $val) - { - $sql .= " AND $column = " . intval($val); - } - $result = $this->db->exec_query($sql); - } - } - - - /** - * - * @param $feature_map - * $feature_map['feature_id']['user_id'] - * $feature_map['feature_id']['type'] - * $feature_map['feature_id']['status'] - * $feature_map['feature_id']['assigner_id'] - * $feature_map['feature_id']['build_id'] - * - * - * Need to manage situation where user_id = 0 is passed - * I will IGNORE IT - * - * @internal revisions - */ - function assign($feature_map) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array(); - $types = $this->get_available_types(); - $safe = null; - - foreach($feature_map as $feature_id => $elem) - { - $safe['feature_id'] = intval($feature_id); - $safe['build_id'] = intval($elem['build_id']); - $safe['type'] = intval($elem['type']); - - $uSet = (array)$elem['user_id']; - - foreach($uSet as $user_id) - { - $safe['user_id'] = intval($user_id); - - // Check if exists before adding - $check = "/* $debugMsg */ "; - $check .= " SELECT id FROM {$this->tables['user_assignments']} " . - " WHERE feature_id = " . $safe['feature_id'] . - " AND build_id = " . $safe['build_id'] . - " AND type = " . $safe['type'] . - " AND user_id = " . $safe['user_id']; - - $rs = $this->db->get_recordset($check); - if( is_null($rs) || count($rs) == 0 ) - { - if($safe['user_id'] > 0) - { - $sql = "INSERT INTO {$this->tables['user_assignments']} " . - "(feature_id,user_id,assigner_id,type,status,creation_ts"; - - $values = "VALUES({$safe['feature_id']},{$safe['user_id']}," . - "{$elem['assigner_id']}," . - "{$safe['type']},{$elem['status']},"; - $values .= (isset($elem['creation_ts']) ? $elem['creation_ts'] : $this->db->db_now()); - - if(isset($elem['deadline_ts']) ) - { - $sql .=",deadline_ts"; - $values .="," . $elem['deadline_ts']; - } - - if(isset($elem['build_id'])) - { - $sql .= ",build_id"; - $values .= "," . $safe['build_id']; - } - else - { - if($safe['type'] == $types['testcase_execution']['id']) - { - throw new Exception("Error Processing Request - BUILD ID is Mandatory"); - } - } - - $sql .= ") " . $values . ")"; - tLog(__METHOD__ . '::' . $sql,"DEBUG"); - $this->db->exec_query($sql); - $ret[] = $sql; - } - } - } // loop over users - } - return $ret; - } - - - /** - * - * @param $feature_map - * $feature_map: key => feature_id - * value => hash with optional keys - * that have the same name of user_assignment fields - * - * @internal revisions - */ - function update($feature_map) - { - foreach($feature_map as $feature_id => $elem) - { - $sepa = ""; - $sql = "UPDATE {$this->tables['user_assignments']} SET "; - $simple_fields = array('user_id','assigner_id','type','status'); - $date_fields = array('deadline_ts','creation_ts'); - - foreach($simple_fields as $idx => $field) - { - if(isset($elem[$field])) - { - $sql .= $sepa . "$field={$elem[$field]} "; - $sepa=","; - } - } - - foreach($date_fields as $idx => $field) - { - if(isset($elem[$field])) - { - $sql .= $sepa . "$field=" . $elem[$field] . " "; - $sepa = ","; - } - } - - $sql .= "WHERE feature_id={$feature_id} AND build_id={$elem['build_id']}"; - - $this->db->exec_query($sql); - } - } - - /** - * Get the number of assigned users for a given build ID. - * @param int $build_id ID of the build to check - * @param int $count_all_types if true, all assignments will be counted, otherwise - * only tester assignments - * @param int $user_id if given, user ID for which the assignments per build shall be counted - * @return int $count Number of assignments - */ - function get_count_of_assignments_for_build_id($build_id, $count_all_types = false, $user_id = 0) - { - $count = 0; - - $types = $this->get_available_types(); - $tc_execution_type = $types['testcase_execution']['id']; - $type_sql = ($count_all_types) ? "" : " AND type = {$tc_execution_type} "; - - $user_sql = ($user_id && is_numeric($user_id)) ? "AND user_id = {$user_id} " : ""; - - $sql = " SELECT COUNT(id) AS count FROM {$this->tables['user_assignments']} " . - " WHERE build_id = {$build_id} {$user_sql} {$type_sql} "; - - $count = $this->db->fetchOneValue($sql); - - return $count; - } - - /** - * Get count of assigned, but not run testcases per build (and optionally user). - * @param int $build_id - * @param bool $all_types - * @param int $user_id if set and != 0, counts only the assignments for the given user - * - * @internal revisions - */ - function get_not_run_tc_count_per_build($build_id, $all_types = false, $user_id = 0) - { - $count = 0; - - $types = $this->get_available_types(); - $tc_execution_type = $types['testcase_execution']['id']; - $type_sql = ($all_types) ? "" : " AND UA.type = {$tc_execution_type} "; - $user_sql = ($user_id && is_numeric($user_id)) ? "AND UA.user_id = {$user_id} " : ""; - - $sql = " SELECT UA.id as assignment_id,UA.user_id,TPTCV.testplan_id," . - " TPTCV.platform_id,BU.id AS BUILD_ID,E.id AS EXECID, E.status " . - " FROM {$this->tables['user_assignments']} UA " . - " JOIN {$this->tables['builds']} BU ON UA.build_id = BU.id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.testplan_id = BU.testplan_id " . - " AND TPTCV.id = UA.feature_id " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = UA.build_id " . - " WHERE UA.build_id = {$build_id} AND E.status IS NULL {$type_sql} {$user_sql} "; - - - if (isset($build_id) && is_numeric($build_id)) { - $count = count($this->db->fetchRowsIntoMap($sql, 'assignment_id')); - } - - return $count; - } - - /** - * Copy the test case execution assignments for a test plan - * from one build to another. - * During copying of assignments, the assigner id can be updated if an ID is passed - * and the timestamp will be updated. - * - * @author Andreas Simon - * @param int $source_build_id ID of the build to copy the assignments from - * @param int $target_build_id ID of the target build to which the assignments will be copied - * @param int $assigner_id will be set as assigner ID of the new assignments if != 0, - * otherwise old assigner ID will be copied - * @param array $opt - * key => keep_old_assignments: - * true: existing assignments in target build will be kept, - * otherwise (default) every existing tester assignment will be deleted. - * - * key => copy_all_types - * true: all assignments of any type will be copied. - * false: only tester assignments will be copied (default). - * key => feature_set: array of id - */ - function copy_assignments($source_build_id, $target_build_id, - $assigner_id = 0, $opt = null) - { - - $my = array('opt'); - $my['opt']['keep_old_assignments'] = false; - $my['opt']['copy_all_types'] = false; - $my['opt']['feature_set'] = null; - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $ua = $this->tables['user_assignments']; - $creation_ts = $this->db->db_now(); - $types = $this->get_available_types(); - $tc_execution_type = $types['testcase_execution']['id']; - $delete_all_types = $my['opt']['copy_all_types']; - - $type_sql = ($my['opt']['copy_all_types']) ? "" : " AND type = {$tc_execution_type} "; - $user_sql = (is_numeric($assigner_id) && $assigner_id != 0) ? $assigner_id : "assigner_id"; - - if ($my['opt']['keep_old_assignments'] == false) - { - // delete the old tester assignments in target builds if there are any - $this->delete_by_build_id($target_build_id, $delete_all_types); - } - - $sql = " INSERT INTO {$ua} " . - " (type, feature_id, user_id, deadline_ts, " . - " assigner_id, creation_ts, status, build_id) " . - - " SELECT type, feature_id, user_id, deadline_ts, " . - " {$user_sql}, {$creation_ts}, status, {$target_build_id} " . - " FROM {$ua} " . - " WHERE build_id = " . intval($source_build_id) . $type_sql; - - if(!is_null($my['opt']['feature_set'])) - { - $sql .= " AND feature_id IN (" . implode(',',$my['opt']['feature_set']). ")"; - } - - $this->db->exec_query($sql); - } - - - /** - * get hash with build id and amount of test cases assigned to testers - * - * @author Francisco Mancardi - * @param mixed $buildID can be single value or array of build ID. - */ - function getExecAssignmentsCountByBuild($buildID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs = null; - $types = $this->get_available_types(); - $execAssign = $types['testcase_execution']['id']; - - $sql = "/* $debugMsg */ ". - " SELECT COUNT(id) AS qty, build_id " . - " FROM {$this->tables['user_assignments']} " . - " WHERE build_id IN ( " . implode(",",(array)$buildID) . " ) " . - " AND type = {$execAssign} " . - " GROUP BY build_id "; - $rs = $this->db->fetchRowsIntoMap($sql,'build_id'); - - return $rs; - } - - - /** - * get hash with build id and amount of test cases assigned to testers, - * but NOT EXECUTED. - * - * - * @author Francisco Mancardi - * @param mixed $buildID can be single value or array of build ID. - */ - function getNotRunAssignmentsCountByBuild($buildID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs = null; - $types = $this->get_available_types(); - $execAssign = $types['testcase_execution']['id']; - - $sql = "/* $debugMsg */ ". - " SELECT count(0) as qty, UA.build_id ". - " FROM {$this->tables['user_assignments']} UA " . - " JOIN {$this->tables['builds']} BU ON UA.build_id = BU.id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.testplan_id = BU.testplan_id " . - " AND TPTCV.id = UA.feature_id " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = UA.build_id " . - " WHERE UA.build_id IN ( " . implode(",",(array)$buildID) . " ) " . - " AND E.status IS NULL " . - " AND type = {$execAssign} " . - " GROUP BY UA.build_id "; - - $rs = $this->db->fetchRowsIntoMap($sql,'build_id'); - - return $rs; - } - - - /** - * - */ - function getUsersByFeatureBuild($featureSet,$buildID,$assignmentType) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs = null; - - if(is_null($assignmentType) || !is_numeric($assignmentType) ) - { - throw new Exception(__METHOD__ . ' assignmentType can not be NULL or not numeric '); - } - $sql = "/* $debugMsg */ ". - " SELECT UA.user_id,UA.feature_id ". - " FROM {$this->tables['user_assignments']} UA " . - " WHERE UA.build_id = " . intval($buildID) . - " AND UA.feature_id IN(" . implode(",",(array)$featureSet) . " )" . - " AND type = " . intval($assignmentType); - - $rs = $this->db->fetchMapRowsIntoMap($sql,'feature_id','user_id'); - - return $rs; - } - - - - /** - * Send link with filters to access (after login) - * to testCaseAssignedToMe feature - * - */ - function emailLinkToExecPlanning($context,$targetUsers=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($targetUsers)) - { - $sql = "/* $debugMsg */ " . - " SELECT id FROM {$this->tables['users']} "; - $targetUsers = $this->db->fetchColumnsIntoArray($sql,'id'); - } - $uSet = (array)$targetUsers; - - - // if user has at least 1 assignment in context - // send link - $atd = $this->get_available_types(); - - $tplan_id = intval($context['tplan_id']); - $build_id = intval($context['build_id']); - $sql = "/* $debugMsg */ ". - " SELECT UA.user_id, U.email ". - " FROM {$this->tables['user_assignments']} UA " . - " JOIN {$this->tables['builds']} B " . - " ON UA.build_id = B.id " . - " LEFT JOIN {$this->tables['users']} U " . - " ON U.id = UA.user_id " . - " WHERE B.testplan_id = " . $tplan_id . - " AND B.id = " . $build_id . - " AND type = " . intval($atd['testcase_execution']['id']); - - $rs = $this->db->fetchRowsIntoMap($sql,'user_id'); - - - $bye = true; - if( !is_null($rs) && count($rs) > 0) - { - $bye = false; - $sql = " SELECT NHTPRJ.name AS tproject, " . - " NHTPL.name AS tplan " . - " FROM {$this->tables['nodes_hierarchy']} NHTPRJ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTPL " . - " ON NHTPRJ.id = NHTPL.parent_id " . - " JOIN {$this->tables['node_types']} NT " . - " ON NHTPRJ.node_type_id = NT.id " . - " WHERE NT.description = 'testproject' " . - " AND NHTPL.id = " . $tplan_id; - $names = $this->db->get_recordset($sql); - $names = $names[0]; - $body_flines = lang_get('testproject') . ': ' . $names['tproject'] . '
    ' . - lang_get('testplan') . ': ' . $names['tplan'] .'

    '; - } - - if($bye) - { - return; // >>>----> Bye,Bye!!! - } - - $email = array(); - $email['from_address'] = config_get('from_email'); - - $isoTS = date(DATE_RFC1123); - $genby = lang_get('generated_by_TestLink_on') . ' ' . $isoTS; - $ll = lang_get('mail_subject_link_to_assigned'); - $email['subject'] = sprintf($ll,$names['tplan'],$isoTS); - - $ln = $_SESSION['basehref'] . 'ltx.php?item=xta2m&tplan_id=' . - $tplan_id . '&user_id='; - - $hint = lang_get('hint_you_need_to_be_logged'); - require_once('email_api.php'); - foreach($uSet as $user_id) - { - if(isset($rs[$user_id])) - { - $email['to_address'] = trim($rs[$user_id]['email']); - if($email['to_address'] != '') - { - $email['body'] = $body_flines; - $email['body'] .= $hint . '

    ' . $ln . $user_id; - $email['body'] .= '

    ' . $genby; - - $email['cc'] = ''; - $email['attachment'] = null; - $email['exit_on_error'] = true; - $email['htmlFormat'] = true; - - $eop = email_send($email['from_address'],$email['to_address'], - $email['subject'], $email['body'], - $email['cc'],$email['attachment'], - $email['exit_on_error'], $email['htmlFormat']); - } - } - } - } - -} // class end +tables['assignment_types']}"; + $hash_types = $this->db->fetchRowsIntoMap($sql, $key_field); + } + return $hash_types; + } + + /** + * + * @param string $key_field + * contains the name column that has to be used as the key of the returned hash. + * @return array + */ + public function get_available_status($key_field = 'description') + { + static $hash_types; + if (! $hash_types) { + $sql = " SELECT * FROM {$this->tables['assignment_status']} "; + $hash_types = $this->db->fetchRowsIntoMap($sql, $key_field); + } + + return $hash_types; + } + + /** + * + * @param + * int or array $feature_id + */ + public function delete_by_feature_id($feature_id) + { + if (is_array($feature_id)) { + $feature_id_list = implode(",", $feature_id); + $where_clause = " WHERE feature_id IN ($feature_id_list) "; + } else { + $where_clause = " WHERE feature_id={$feature_id}"; + } + $sql = " DELETE FROM {$this->tables['user_assignments']} {$where_clause}"; + $this->db->exec_query($sql); + } + + /** + * Delete the user assignments for a given build. + * + * @author Andreas Simon + * @param int $build_id + * The ID of the build for which the user assignments shall be deleted. + * @param boolean $delete_all_types + * If true, all assignments regardless of type will be deleted, + * else (default) only tester assignments. + */ + public function delete_by_build_id($build_id, $delete_all_types = false) + { + $type_sql = ""; + + if (! $delete_all_types) { + $types = $this->get_available_types(); + $tc_execution_type = $types['testcase_execution']['id']; + $type_sql = " AND type = {$tc_execution_type} "; + } + + $sql = " DELETE FROM {$this->tables['user_assignments']} " . + " WHERE build_id = " . intval($build_id) . " {$type_sql} "; + + $this->db->exec_query($sql); + } + + /** + * delete assignments by feature id and build_id + * + * @param array $feature_map + */ + public function delete_by_feature_id_and_build_id($feature_map) + { + $feature_id_list = implode(",", array_keys($feature_map)); + $where_clause = " WHERE feature_id IN ($feature_id_list) "; + + $sql = " DELETE FROM {$this->tables['user_assignments']} {$where_clause} "; + + // build_id is the same for all entries because of assignment form + // -> skip foreach after first iteration + $build_id = 0; + foreach ($feature_map as $feature) { + $build_id = $feature['build_id']; + break; + } + + $sql .= " AND build_id = {$build_id} "; + $this->db->exec_query($sql); + } + + /** + * + * @param array $items + * array of signature + * signature = array('type' => ,'feature_id' =>,'user_id' =>, 'build_id' => ) + */ + public function deleteBySignature($items) + { + foreach ($items as $signature) { + $sql = " DELETE FROM {$this->tables['user_assignments']} WHERE 1=1 "; + foreach ($signature as $column => $val) { + $sql .= " AND $column = " . intval($val); + } + $this->db->exec_query($sql); + } + } + + /** + * + * @param array $feature_map + * $feature_map['feature_id']['user_id'] + * $feature_map['feature_id']['type'] + * $feature_map['feature_id']['status'] + * $feature_map['feature_id']['assigner_id'] + * $feature_map['feature_id']['build_id'] + * + * Need to manage situation where user_id = 0 is passed + * I will IGNORE IT + * @return array + * + * @internal revisions + */ + public function assign($feature_map) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $ret = array(); + $types = $this->get_available_types(); + $safe = null; + + foreach ($feature_map as $feature_id => $elem) { + $safe['feature_id'] = intval($feature_id); + $safe['build_id'] = intval($elem['build_id']); + $safe['type'] = intval($elem['type']); + + $uSet = (array) $elem['user_id']; + + foreach ($uSet as $user_id) { + $safe['user_id'] = intval($user_id); + + // Check if exists before adding + $check = "/* $debugMsg */ "; + $check .= " SELECT id FROM {$this->tables['user_assignments']} " . + " WHERE feature_id = " . $safe['feature_id'] . + " AND build_id = " . $safe['build_id'] . " AND type = " . + $safe['type'] . " AND user_id = " . $safe['user_id']; + + $rs = $this->db->get_recordset($check); + if ((is_null($rs) || count($rs) == 0) && ($safe['user_id'] > 0)) { + $sql = "INSERT INTO {$this->tables['user_assignments']} " . + "(feature_id,user_id,assigner_id,type,status,creation_ts"; + + $values = "VALUES({$safe['feature_id']},{$safe['user_id']}," . + "{$elem['assigner_id']}," . + "{$safe['type']},{$elem['status']},"; + $values .= (isset($elem['creation_ts']) ? $elem['creation_ts'] : $this->db->db_now()); + + if (isset($elem['deadline_ts'])) { + $sql .= ",deadline_ts"; + $values .= "," . $elem['deadline_ts']; + } + + if (isset($elem['build_id'])) { + $sql .= ",build_id"; + $values .= "," . $safe['build_id']; + } else { + if ($safe['type'] == $types['testcase_execution']['id']) { + throw new Exception( + "Error Processing Request - BUILD ID is Mandatory"); + } + } + + $sql .= ") " . $values . ")"; + tLog(__METHOD__ . '::' . $sql, "DEBUG"); + $this->db->exec_query($sql); + $ret[] = $sql; + } + } + } + return $ret; + } + + /** + * + * @param array $feature_map + * $feature_map: key => feature_id + * value => hash with optional keys + * that have the same name of user_assignment fields + * + * @internal revisions + */ + public function update($feature_map) + { + foreach ($feature_map as $feature_id => $elem) { + $sepa = ""; + $sql = "UPDATE {$this->tables['user_assignments']} SET "; + $simple_fields = array( + 'user_id', + 'assigner_id', + 'type', + 'status' + ); + $date_fields = array( + 'deadline_ts', + 'creation_ts' + ); + + foreach ($simple_fields as $idx => $field) { + if (isset($elem[$field])) { + $sql .= $sepa . "$field={$elem[$field]} "; + $sepa = ","; + } + } + + foreach ($date_fields as $field) { + if (isset($elem[$field])) { + $sql .= $sepa . "$field=" . $elem[$field] . " "; + $sepa = ","; + } + } + + $sql .= "WHERE feature_id={$feature_id} AND build_id={$elem['build_id']}"; + + $this->db->exec_query($sql); + } + } + + /** + * Get the number of assigned users for a given build ID. + * + * @param int $build_id + * ID of the build to check + * @param int $count_all_types + * if true, all assignments will be counted, otherwise + * only tester assignments + * @param int $user_id + * if given, user ID for which the assignments per build shall be counted + * @return int $count Number of assignments + */ + public function get_count_of_assignments_for_build_id($build_id, + $count_all_types = false, $user_id = 0) + { + $types = $this->get_available_types(); + $tc_execution_type = $types['testcase_execution']['id']; + $type_sql = ($count_all_types) ? "" : " AND type = {$tc_execution_type} "; + + $user_sql = ($user_id && is_numeric($user_id)) ? "AND user_id = {$user_id} " : ""; + + $sql = " SELECT COUNT(id) AS count FROM {$this->tables['user_assignments']} " . + " WHERE build_id = {$build_id} {$user_sql} {$type_sql} "; + + return $this->db->fetchOneValue($sql); + } + + /** + * Get count of assigned, but not run testcases per build (and optionally user). + * + * @param int $build_id + * @param bool $all_types + * @param int $user_id + * if set and != 0, counts only the assignments for the given user + * + * @internal revisions + */ + public function get_not_run_tc_count_per_build($build_id, $all_types = false, + $user_id = 0) + { + $count = 0; + + $types = $this->get_available_types(); + $tc_execution_type = $types['testcase_execution']['id']; + $type_sql = ($all_types) ? "" : " AND UA.type = {$tc_execution_type} "; + $user_sql = ($user_id && is_numeric($user_id)) ? "AND UA.user_id = {$user_id} " : ""; + + $sql = " SELECT UA.id as assignment_id,UA.user_id,TPTCV.testplan_id," . + " TPTCV.platform_id,BU.id AS BUILD_ID,E.id AS EXECID, E.status " . + " FROM {$this->tables['user_assignments']} UA " . + " JOIN {$this->tables['builds']} BU ON UA.build_id = BU.id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.testplan_id = BU.testplan_id " . + " AND TPTCV.id = UA.feature_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.build_id = UA.build_id " . + " WHERE UA.build_id = {$build_id} AND E.status IS NULL {$type_sql} {$user_sql} "; + + if (isset($build_id) && is_numeric($build_id)) { + $count = count($this->db->fetchRowsIntoMap($sql, 'assignment_id')); + } + + return $count; + } + + /** + * Copy the test case execution assignments for a test plan + * from one build to another. + * During copying of assignments, the assigner id can be updated if an ID is passed + * and the timestamp will be updated. + * + * @author Andreas Simon + * @param int $source_build_id + * ID of the build to copy the assignments from + * @param int $target_build_id + * ID of the target build to which the assignments will be copied + * @param int $assigner_id + * will be set as assigner ID of the new assignments if != 0, + * otherwise old assigner ID will be copied + * @param array $opt + * key => keep_old_assignments: + * true: existing assignments in target build will be kept, + * otherwise (default) every existing tester assignment will be deleted. + * + * key => copy_all_types + * true: all assignments of any type will be copied. + * false: only tester assignments will be copied (default). + * key => feature_set: array of id + */ + public function copy_assignments($source_build_id, $target_build_id, + $assigner_id = 0, $opt = null) + { + $my = array( + 'opt' + ); + $my['opt']['keep_old_assignments'] = false; + $my['opt']['copy_all_types'] = false; + $my['opt']['feature_set'] = null; + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $ua = $this->tables['user_assignments']; + $creation_ts = $this->db->db_now(); + $types = $this->get_available_types(); + $tc_execution_type = $types['testcase_execution']['id']; + $delete_all_types = $my['opt']['copy_all_types']; + + $type_sql = ($my['opt']['copy_all_types']) ? "" : " AND type = {$tc_execution_type} "; + $user_sql = (is_numeric($assigner_id) && $assigner_id != 0) ? $assigner_id : "assigner_id"; + + if (! $my['opt']['keep_old_assignments']) { + // delete the old tester assignments in target builds if there are any + $this->delete_by_build_id($target_build_id, $delete_all_types); + } + + $sql = " INSERT INTO {$ua} " . + " (type, feature_id, user_id, deadline_ts, " . + " assigner_id, creation_ts, status, build_id) " . + + " SELECT type, feature_id, user_id, deadline_ts, " . + " {$user_sql}, {$creation_ts}, status, {$target_build_id} " . + " FROM {$ua} " . " WHERE build_id = " . intval($source_build_id) . + $type_sql; + + if (! is_null($my['opt']['feature_set'])) { + $sql .= " AND feature_id IN (" . + implode(',', $my['opt']['feature_set']) . ")"; + } + + $this->db->exec_query($sql); + } + + /** + * get hash with build id and amount of test cases assigned to testers + * + * @author Francisco Mancardi + * @param mixed $buildID + * can be single value or array of build ID. + * @return array + */ + private function getExecAssignmentsCountByBuild($buildID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $types = $this->get_available_types(); + $execAssign = $types['testcase_execution']['id']; + + $sql = "/* $debugMsg */ " . " SELECT COUNT(id) AS qty, build_id " . + " FROM {$this->tables['user_assignments']} " . + " WHERE build_id IN ( " . implode(",", (array) $buildID) . " ) " . + " AND type = {$execAssign} " . " GROUP BY build_id "; + return $this->db->fetchRowsIntoMap($sql, 'build_id'); + } + + /** + * get hash with build id and amount of test cases assigned to testers, + * but NOT EXECUTED. + * + * @author Francisco Mancardi + * @param mixed $buildID + * can be single value or array of build ID. + * @return array + */ + private function getNotRunAssignmentsCountByBuild($buildID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $types = $this->get_available_types(); + $execAssign = $types['testcase_execution']['id']; + + $sql = "/* $debugMsg */ " . " SELECT count(0) as qty, UA.build_id " . + " FROM {$this->tables['user_assignments']} UA " . + " JOIN {$this->tables['builds']} BU ON UA.build_id = BU.id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.testplan_id = BU.testplan_id " . + " AND TPTCV.id = UA.feature_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.build_id = UA.build_id " . " WHERE UA.build_id IN ( " . + implode(",", (array) $buildID) . " ) " . " AND E.status IS NULL " . + " AND type = {$execAssign} " . " GROUP BY UA.build_id "; + + return $this->db->fetchRowsIntoMap($sql, 'build_id'); + } + + /** + * + * @param array $featureSet + * @param int $buildID + * @param int $assignmentType + * @return array + */ + public function getUsersByFeatureBuild($featureSet, $buildID, + $assignmentType) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (is_null($assignmentType) || ! is_numeric($assignmentType)) { + throw new Exception( + __METHOD__ . ' assignmentType can not be NULL or not numeric '); + } + $sql = "/* $debugMsg */ " . " SELECT UA.user_id,UA.feature_id " . + " FROM {$this->tables['user_assignments']} UA " . + " WHERE UA.build_id = " . intval($buildID) . " AND UA.feature_id IN(" . + implode(",", (array) $featureSet) . " )" . " AND type = " . + intval($assignmentType); + + return $this->db->fetchMapRowsIntoMap($sql, 'feature_id', 'user_id'); + } + + /** + * Send link with filters to access (after login) + * to testCaseAssignedToMe feature + * + * @param array $context + * @param array $targetUsers + */ + public function emailLinkToExecPlanning($context, $targetUsers = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($targetUsers)) { + $sql = "/* $debugMsg */ " . + " SELECT id FROM {$this->tables['users']} "; + $targetUsers = $this->db->fetchColumnsIntoArray($sql, 'id'); + } + $uSet = (array) $targetUsers; + + // if user has at least 1 assignment in context + // send link + $atd = $this->get_available_types(); + + $tplan_id = intval($context['tplan_id']); + $build_id = intval($context['build_id']); + $sql = "/* $debugMsg */ " . " SELECT UA.user_id, U.email " . + " FROM {$this->tables['user_assignments']} UA " . + " JOIN {$this->tables['builds']} B " . " ON UA.build_id = B.id " . + " LEFT JOIN {$this->tables['users']} U " . " ON U.id = UA.user_id " . + " WHERE B.testplan_id = " . $tplan_id . " AND B.id = " . $build_id . + " AND type = " . intval($atd['testcase_execution']['id']); + + $rs = $this->db->fetchRowsIntoMap($sql, 'user_id'); + + $bye = true; + if (! is_null($rs) && ! empty($rs)) { + $bye = false; + $sql = " SELECT NHTPRJ.name AS tproject, " . " NHTPL.name AS tplan " . + " FROM {$this->tables['nodes_hierarchy']} NHTPRJ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTPL " . + " ON NHTPRJ.id = NHTPL.parent_id " . + " JOIN {$this->tables['node_types']} NT " . + " ON NHTPRJ.node_type_id = NT.id " . + " WHERE NT.description = 'testproject' " . " AND NHTPL.id = " . + $tplan_id; + $names = $this->db->get_recordset($sql); + $names = $names[0]; + $body_flines = lang_get('testproject') . ': ' . $names['tproject'] . + '
    ' . lang_get('testplan') . ': ' . $names['tplan'] . + '

    '; + } + + if ($bye) { + return; + } + + $email = array(); + $email['from_address'] = config_get('from_email'); + + $isoTS = date(DATE_RFC1123); + $genby = lang_get('generated_by_TestLink_on') . ' ' . $isoTS; + $ll = lang_get('mail_subject_link_to_assigned'); + $email['subject'] = sprintf($ll, $names['tplan'], $isoTS); + + $ln = $_SESSION['basehref'] . 'ltx.php?item=xta2m&tplan_id=' . $tplan_id . + '&user_id='; + + $hint = lang_get('hint_you_need_to_be_logged'); + require_once 'email_api.php'; + foreach ($uSet as $user_id) { + if (isset($rs[$user_id])) { + $email['to_address'] = trim($rs[$user_id]['email']); + if ($email['to_address'] != '') { + $email['body'] = $body_flines; + $email['body'] .= $hint . '

    ' . $ln . $user_id; + $email['body'] .= '

    ' . $genby; + + $email['cc'] = ''; + $email['attachment'] = null; + $email['exit_on_error'] = true; + $email['htmlFormat'] = true; + + email_send($email['from_address'], $email['to_address'], + $email['subject'], $email['body'], $email['cc'], + $email['attachment'], $email['exit_on_error'], + $email['htmlFormat']); + } + } + } + } +} diff --git a/lib/functions/attachments.inc.php b/lib/functions/attachments.inc.php index 28cc8b2f22..9b6a3074c1 100644 --- a/lib/functions/attachments.inc.php +++ b/lib/functions/attachments.inc.php @@ -1,169 +1,178 @@ - 0 the attachments are appended to existing attachments within the session - * - * @return array infos about the attachment on success, NULL else -*/ -function getAttachmentInfos(&$attachmentRepository,$fkid,$fkTableName,$storeListInSession = true,$counter = 0) -{ - $attachmentInfos = $attachmentRepository->getAttachmentInfosFor($fkid,$fkTableName); - if ($storeListInSession) - { - storeAttachmentsInSession($attachmentInfos,$counter); - } - return $attachmentInfos; -} - -/** - * Get infos about the attachments of a given object - * - * @param tlObjectWithAttachments $object The object whose attachment should be fetched - * @param int $fkid the id of the object (attachments.fk_id); - * @param bool $storeListInSession if true, the attachment list will be stored within the session - * @param int $counter if $counter > 0 the attachments are appended to existing attachments within the session - * - * @return array returns infos about the attachment on success, NULL else - */ -function getAttachmentInfosFrom(&$object,$fkid,$storeListInSession = true,$counter = 0) -{ - $attachmentInfos = $object->getAttachmentInfos($fkid); - if ($storeListInSession) - { - storeAttachmentsInSession($attachmentInfos,$counter); - } - return $attachmentInfos; -} - -/** - * Stores the attachment infos into the session for referencing it later - * - * @param array $attachmentInfos infos about attachment - * @param $counter counter for the attachments in the session - */ -function storeAttachmentsInSession($attachmentInfos,$counter = 0) -{ - if (!$attachmentInfos) - { - $attachmentInfos = array(); - } - - if (!isset($_SESSION['s_lastAttachmentInfos']) || !$_SESSION['s_lastAttachmentInfos']) - { - $_SESSION['s_lastAttachmentInfos'] = array(); - } - - if ($counter == 0) - { - $_SESSION['s_lastAttachmentInfos'] = $attachmentInfos; - } - else - { - $_SESSION['s_lastAttachmentInfos'] = array_merge($_SESSION['s_lastAttachmentInfos'],$attachmentInfos); - } - -} - -/** - * Checks the id of an attachment and the corresponding attachment info for validity - * - * @param resource $db [ref] the database connection - * @param integer $id the database identifier of the attachment - * @param $attachmentInfo - * @return boolean return true if the id is valid, false else - */ -function checkAttachmentID(&$db,$id,$attachmentInfo) -{ - $isValid = false; - if ($attachmentInfo) - { - $sLastAttachmentInfos = isset($_SESSION['s_lastAttachmentInfos']) ? $_SESSION['s_lastAttachmentInfos'] : null; - for($i = 0;$i < sizeof($sLastAttachmentInfos);$i++) - { - $info = $sLastAttachmentInfos[$i]; - if ($info['id'] == $id) - { - $isValid = true; - break; - } - } - } - return $isValid; -} - - -/** - * - */ -function fileUploadManagement(&$dbHandler,$id,$title,$table) -{ - $uploadOp = new stdClass(); - $uploadOp->statusOK = false; - $uploadOp->statusCode = 0; - $uploadOp->msg = null; - - $fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; - if ($fInfo && $id) { - $fSize = isset($fInfo['size']) ? $fInfo['size'] : 0; - $fTmpName = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : ''; - - if ($fSize && $fTmpName != "") { - $repo = tlAttachmentRepository::create($dbHandler); - $uploadOp = $repo->insertAttachment($id,$table,$title,$fInfo); - $uploadOp->uploaded = $uploadOp->statusOK; - - if ($uploadOp->statusOK) { - logAuditEvent(TLS("audit_attachment_created",$title,$fInfo['name']),"CREATE",$id,"attachments"); - } else { - $uploadOp->msg = getFileUploadErrorMessage($fInfo,$uploadOp); - } - } else { - $uploadOp->msg = getFileUploadErrorMessage($fInfo); - } - } - return $uploadOp; -} - -/** - * - */ -function deleteAttachment(&$dbHandler,$fileID,$checkOnSession=true) { - $repo = tlAttachmentRepository::create($dbHandler); - $info = $repo->getAttachmentInfo($fileID); - if( $info ) { - $doIt = true; - if( $checkOnSession ) { - $doIt = checkAttachmentID($dbHandler,$fileID,$info); - } - - if( $doIt ) { - if($repo->deleteAttachment($fileID,$info)) { - logAuditEvent(TLS("audit_attachment_deleted",$info['title']),"DELETE",$fileID,"attachments"); - } - } - } - return $info; + 0 the attachments are appended to existing attachments within the session + * + * @return array infos about the attachment on success, NULL else + */ +function getAttachmentInfos(&$attachmentRepository, $fkid, $fkTableName, + $storeListInSession = true, $counter = 0) +{ + $attachmentInfos = $attachmentRepository->getAttachmentInfosFor($fkid, + $fkTableName); + if ($storeListInSession) { + storeAttachmentsInSession($attachmentInfos, $counter); + } + return $attachmentInfos; +} + +/** + * Get infos about the attachments of a given object + * + * @param tlObjectWithAttachments $object + * The object whose attachment should be fetched + * @param int $fkid + * the id of the object (attachments.fk_id); + * @param bool $storeListInSession + * if true, the attachment list will be stored within the session + * @param int $counter + * if $counter > 0 the attachments are appended to existing attachments within the session + * + * @return array returns infos about the attachment on success, NULL else + */ +function getAttachmentInfosFrom(&$object, $fkid, $storeListInSession = true, + $counter = 0) +{ + $attachmentInfos = $object->getAttachmentInfos($fkid); + if ($storeListInSession) { + storeAttachmentsInSession($attachmentInfos, $counter); + } + return $attachmentInfos; +} + +/** + * Stores the attachment infos into the session for referencing it later + * + * @param array $attachmentInfos + * infos about attachment + * @param int $counter + * counter for the attachments in the session + */ +function storeAttachmentsInSession($attachmentInfos, $counter = 0) +{ + if (! $attachmentInfos) { + $attachmentInfos = array(); + } + + if (! isset($_SESSION['s_lastAttachmentInfos']) || + ! $_SESSION['s_lastAttachmentInfos']) { + $_SESSION['s_lastAttachmentInfos'] = array(); + } + + if ($counter == 0) { + $_SESSION['s_lastAttachmentInfos'] = $attachmentInfos; + } else { + $_SESSION['s_lastAttachmentInfos'] = array_merge( + $_SESSION['s_lastAttachmentInfos'], $attachmentInfos); + } +} + +/** + * Checks the id of an attachment and the corresponding attachment info for validity + * + * @param resource $db + * [ref] the database connection + * @param integer $id + * the database identifier of the attachment + * @param + * $attachmentInfo + * @return boolean return true if the id is valid, false else + */ +function checkAttachmentID(&$db, $id, $attachmentInfo) +{ + $isValid = false; + if ($attachmentInfo) { + $sLastAttachmentInfos = isset($_SESSION['s_lastAttachmentInfos']) ? $_SESSION['s_lastAttachmentInfos'] : null; + for ($i = 0; $i < count($sLastAttachmentInfos); $i ++) { + $info = $sLastAttachmentInfos[$i]; + if ($info['id'] == $id) { + $isValid = true; + break; + } + } + } + return $isValid; +} + +/** + */ +function fileUploadManagement(&$dbHandler, $id, $title, $table) +{ + $uploadOp = new stdClass(); + $uploadOp->statusOK = false; + $uploadOp->statusCode = 0; + $uploadOp->msg = null; + + $fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; + if ($fInfo && $id) { + $fSize = isset($fInfo['size']) ? $fInfo['size'] : 0; + $fTmpName = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : ''; + + if ($fSize && $fTmpName != "") { + $repo = tlAttachmentRepository::create($dbHandler); + $uploadOp = $repo->insertAttachment($id, $table, $title, $fInfo); + $uploadOp->uploaded = $uploadOp->statusOK; + + if ($uploadOp->statusOK) { + logAuditEvent( + TLS("audit_attachment_created", $title, $fInfo['name']), + "CREATE", $id, "attachments"); + } else { + $uploadOp->msg = getFileUploadErrorMessage($fInfo, $uploadOp); + } + } else { + $uploadOp->msg = getFileUploadErrorMessage($fInfo); + } + } + return $uploadOp; +} + +/** + */ +function deleteAttachment(&$dbHandler, $fileID, $checkOnSession = true) +{ + $repo = tlAttachmentRepository::create($dbHandler); + $info = $repo->getAttachmentInfo($fileID); + if ($info) { + $doIt = true; + if ($checkOnSession) { + $doIt = checkAttachmentID($dbHandler, $fileID, $info); + } + + if ($doIt && $repo->deleteAttachment($fileID, $info)) { + logAuditEvent(TLS("audit_attachment_deleted", $info['title']), + "DELETE", $fileID, "attachments"); + } + } + return $info; } diff --git a/lib/functions/bareBonesRestAPI.class.php b/lib/functions/bareBonesRestAPI.class.php index 80c5f6652a..7d229864f0 100644 --- a/lib/functions/bareBonesRestAPI.class.php +++ b/lib/functions/bareBonesRestAPI.class.php @@ -1,9 +1,10 @@ * * @author Francisco Mancardi @@ -11,248 +12,251 @@ */ /** - * */ -class bareBonesRestAPI { - /** - * @var string - * - * Some systems i.e. trello need both - */ - public $apikey = ''; - public $apitoken = ''; - - /** - * Curl interface with specific settings - * @var string - */ - public $curl = ''; - - - /** - * Curl Header - * changes according the system - * - * @var [] - */ - public $curlHeader = []; - - /** - * properties - * host - * port - * login - * password - */ - public $proxy = null; - - public $cfg; - - /** - * Constructor - * - * - * @return void - */ - public function __construct() - { - // $this->initCurl(); - } - - /** - * - * - */ - public function initCurl($cfg=null) - { - $agent = "TestLink " . TL_VERSION_NUMBER; - try { - $this->curl = curl_init(); - } - catch (Exception $e) { - var_dump($e); - } - - // set the agent, forwarding, and turn off ssl checking - // Timeout in Seconds - $curlCfg = [CURLOPT_USERAGENT => $agent, - CURLOPT_VERBOSE => 0, - CURLOPT_FOLLOWLOCATION => TRUE, - CURLOPT_RETURNTRANSFER => TRUE, - CURLOPT_AUTOREFERER => TRUE, - CURLOPT_TIMEOUT => 60, - CURLOPT_SSL_VERIFYPEER => FALSE]; - - if(!is_null($this->proxy)) +class bareBonesRestAPI +{ + + /** + * + * @var string Some systems i.e. trello need both + */ + public $apikey = ''; + + public $apitoken = ''; + + /** + * Curl interface with specific settings + * + * @var string + */ + public $curl = ''; + + /** + * Curl Header + * changes according the system + * + * @var [] + */ + public $curlHeader = []; + + /** + * properties + * host + * port + * login + * password + */ + public $proxy = null; + + public $cfg; + + /** + * Constructor + * + * + * @return void + */ + public function __construct() + {} + + /** + */ + public function initCurl($cfg = null) { - $doProxyAuth = false; - $curlCfg[CURLOPT_PROXYTYPE] = 'HTTP'; - - foreach($this->proxy as $prop => $value) - { - switch($prop) - { - case 'host': - $curlCfg[CURLOPT_PROXY] = $value; - break; - - case 'port': - $curlCfg[CURLOPT_PROXYPORT] = $value; - break; - - case 'login': - case 'password': - $doProxyAuth = true; - break; + $agent = "TestLink " . TL_VERSION_NUMBER; + try { + $this->curl = curl_init(); + } catch (Exception $e) { + var_dump($e); } - } - - if($doProxyAuth && !is_null($this->proxy->login) && - !is_null($this->proxy->password) ) - { - $curlCfg[CURLOPT_PROXYUSERPWD] = - $this->proxy->login . ':' . $this->proxy->password; - } - } - - curl_setopt_array($this->curl,$curlCfg); - } - - - - /** - * - * @internal notice - * copied and adpated from work on YouTrack API interface by Jens Jahnke - **/ - protected function _get($cmd) - { - // GET must returns a JSON object ALWAYS - return $this->_request_json('GET', $cmd); - } - - - /** - * - * Use it when the API called will return - * - response - * - JSON content - * - */ - protected function _postWithContent($cmd,$body=null) { - return $this->_request_json('POST', $cmd, $body); - } - - - /** - * - * Use it when the API called will return - * - response - * - */ - protected function _post($cmd,$body=null) { - return $this->_request('POST', $cmd, $body); - } - - - /** - * - * @internal notice - * copied and adpated from work on YouTrack API interface by Jens Jahnke - **/ - protected function _request_json($method, $cmd, $body = NULL, $ignore_status = 0,$reporter=null) { - $r = $this->_request($method, $cmd, $body, $ignore_status,$reporter); - $response = $r['response']; - $content = $r['content']; - - $content = json_decode($r['content']); - if (json_last_error() == JSON_ERROR_NONE) { - return $content; + + // set the agent, forwarding, and turn off ssl checking + // Timeout in Seconds + $curlCfg = [ + CURLOPT_USERAGENT => $agent, + CURLOPT_VERBOSE => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_AUTOREFERER => true, + CURLOPT_TIMEOUT => 60, + CURLOPT_SSL_VERIFYPEER => false + ]; + + if (! is_null($this->proxy)) { + $doProxyAuth = false; + $curlCfg[CURLOPT_PROXYTYPE] = 'HTTP'; + + foreach ($this->proxy as $prop => $value) { + switch ($prop) { + case 'host': + $curlCfg[CURLOPT_PROXY] = $value; + break; + + case 'port': + $curlCfg[CURLOPT_PROXYPORT] = $value; + break; + + case 'login': + case 'password': + $doProxyAuth = true; + break; + } + } + + if ($doProxyAuth && ! is_null($this->proxy->login) && + ! is_null($this->proxy->password)) { + $curlCfg[CURLOPT_PROXYUSERPWD] = $this->proxy->login . ':' . + $this->proxy->password; + } + } + + curl_setopt_array($this->curl, $curlCfg); } - // Oh no!!! - $msg = 'Bad Response!!'; - if (null != $response && isset($response['http_code'])) { - $msg = "http_code:" . $response['http_code']; + /** + * + * @internal notice + * copied and adpated from work on YouTrack API interface by Jens Jahnke + */ + protected function _get($cmd) + { + // GET must returns a JSON object ALWAYS + return $this->_request_json('GET', $cmd); } - $msg = "Error Parsing JSON In TESTLINK -> " . $msg . - " -> Give a look to TestLink Event Viewer"; - - throw new Exception($msg, 1); - } - - /** - * - * @internal notice - * copied and adpated from work on YouTrack API interface by Jens Jahnke - **/ - protected function _request($method, $cmd, $body = NULL, $ignoreStatusCode = 0,$reporter = null) - { - - // this is the minimal test - if(empty($this->apikey) ){ - throw new exception(__METHOD__ . - " Can not work without apikey"); - } - - - // this can happens because if I save object on _SESSION PHP is not able to - // save resources. - if( !is_resource($this->curl) ) { - $this->initCurl(); - } - - $additional = ''; - if (property_exists($this, 'api')) { - $additional = trim($this->api); + + /** + * Use it when the API called will return + * - response + * - JSON content + */ + protected function _postWithContent($cmd, $body = null) + { + return $this->_request_json('POST', $cmd, $body); } - $url = $this->url . $additional . $cmd; - - curl_setopt($this->curl, CURLOPT_URL, $url); - curl_setopt($this->curl, CURLOPT_DNS_USE_GLOBAL_CACHE, false ); - curl_setopt($this->curl, CURLOPT_DNS_CACHE_TIMEOUT, 2 ); - curl_setopt($this->curl, CURLOPT_HEADER, 0); - - if (count($this->curlHeader) >0) { - curl_setopt($this->curl, CURLOPT_HTTPHEADER, $this->curlHeader); + + /** + * Use it when the API called will return + * - response + */ + protected function _post($cmd, $body = null) + { + return $this->_request('POST', $cmd, $body); } - switch ($method) { - case 'GET': - curl_setopt($this->curl, CURLOPT_HTTPGET, TRUE); - break; - - case 'POST': - case 'PATCH': - curl_setopt($this->curl, CURLOPT_POST, TRUE); - if (!empty($body)) { - curl_setopt($this->curl, CURLOPT_POSTFIELDS, json_encode($body)); + /** + * + * @param unknown $method + * @param unknown $cmd + * @param unknown $body + * @param number $ignore_status + * @param unknown $reporter + * @return mixed + * @internal notice + * copied and adpated from work on YouTrack API interface by Jens Jahnke + */ + protected function _request_json($method, $cmd, $body = null, + $ignore_status = 0, $reporter = null) + { + $r = $this->_request($method, $cmd, $body, $ignore_status, $reporter); + $response = $r['response']; + + $content = json_decode($r['content']); + if (json_last_error() == JSON_ERROR_NONE) { + return $content; + } + + // Oh no!!! + $msg = 'Bad Response!!'; + if (null != $response && isset($response['http_code'])) { + $msg = "http_code:" . $response['http_code']; } - break; - - default: - throw new exception("Unknown method $method!"); - break; + $msg = "Error Parsing JSON In TESTLINK -> " . $msg . + " -> Give a look to TestLink Event Viewer"; + + throw new Exception($msg, 1); } - - $content = curl_exec($this->curl); - $response = curl_getinfo($this->curl); - $curlError = curl_error($this->curl); - $httpCode = (int)$response['http_code']; - if ($httpCode != 200 && $httpCode != 201 && $httpCode != $ignoreStatusCode) { - throw new exception(__METHOD__ . "url:$this->url - response:" . - json_encode($response) . ' - content: ' . json_encode($content) ); + + /** + * + * @param unknown $method + * @param unknown $cmd + * @param unknown $body + * @param number $ignoreStatusCode + * @param unknown $reporter + * @return array + * + * @internal notice + * copied and adpated from work on YouTrack API interface by Jens Jahnke + */ + protected function _request($method, $cmd, $body = null, + $ignoreStatusCode = 0, $reporter = null) + { + + // this is the minimal test + if (empty($this->apikey)) { + throw new exception(__METHOD__ . " Can not work without apikey"); + } + + // this can happens because if I save object on _SESSION PHP is not able to + // save resources. + if (! is_resource($this->curl)) { + $this->initCurl(); + } + + $additional = ''; + if (property_exists($this, 'api')) { + $additional = trim($this->api); + } + $url = $this->url . $additional . $cmd; + + curl_setopt($this->curl, CURLOPT_URL, $url); + curl_setopt($this->curl, CURLOPT_DNS_USE_GLOBAL_CACHE, false); + curl_setopt($this->curl, CURLOPT_DNS_CACHE_TIMEOUT, 2); + curl_setopt($this->curl, CURLOPT_HEADER, 0); + + if (! empty($this->curlHeader)) { + curl_setopt($this->curl, CURLOPT_HTTPHEADER, $this->curlHeader); + } + + switch ($method) { + case 'GET': + curl_setopt($this->curl, CURLOPT_HTTPGET, true); + break; + + case 'POST': + case 'PATCH': + curl_setopt($this->curl, CURLOPT_POST, true); + if (! empty($body)) { + curl_setopt($this->curl, CURLOPT_POSTFIELDS, + json_encode($body)); + } + break; + + default: + throw new exception("Unknown method $method!"); + break; + } + + $content = curl_exec($this->curl); + $response = curl_getinfo($this->curl); + $curlError = curl_error($this->curl); + $httpCode = (int) $response['http_code']; + if ($httpCode != 200 && $httpCode != 201 && + $httpCode != $ignoreStatusCode) { + throw new exception( + __METHOD__ . "url:$this->url - response:" . + json_encode($response) . ' - content: ' . json_encode($content)); + } + + return [ + 'content' => $content, + 'response' => $response, + 'curlError' => $curlError + ]; } - - $rr = ['content' => $content,'response' => $response,'curlError' => $curlError]; - return $rr; - } - - /** - * - */ - public function __destruct() - { - } - -} \ No newline at end of file + + /** + */ + public function __destruct() + {} +} diff --git a/lib/functions/cfield_mgr.class.php b/lib/functions/cfield_mgr.class.php index 31168f984d..16eacd5eb9 100644 --- a/lib/functions/cfield_mgr.class.php +++ b/lib/functions/cfield_mgr.class.php @@ -1,3042 +1,2940 @@ - 0 ) -{ - foreach($cf_files as $inc) - { - require_once($inc); - } + 240 chars <= 255 chars table field size + */ + const TEXTAREA_DEFAULT_COLS = 70; + + const TEXTAREA_DEFAULT_ROWS = 4; + + const CF_ENABLED = 1; + + const ENABLED = 1; + + const DISABLED = 0; + + /** @var resource the database handler */ + private $db; + + /** @var object tree class */ + private $tree_manager; + + /** + * + * @var array $application_areas Holds string keys used on this object and pages that manages CF, + * identifying in what areas/features something will be done + * 'execution' => mainly on test execution pages, + * identifies TL features/pages to record test results + * 'design' => test suites, test cases creation + * identifies TL features/pages to create test specification + * 'testplan_design' => link test cases to test plan (assign testcase option) + * + * IMPORTANT: this values are used as access keys in several properties of this object. + * then if you add one here, remember to update other properties. + */ + private $application_areas = array( + 'execution', + 'design', + 'testplan_design' + ); + + /** + * + * @var array Define type of custom fields managed. + * Values will be displayed in "Custom Field Type" combo box when + * users create custom fields. No localization is applied + * + * + * Added specific type for test automation related custom fields. + * Start at code 500 + */ + public $custom_field_types = array( + 0 => 'string', + 1 => 'numeric', + 2 => 'float', + 4 => 'email', + 5 => 'checkbox', + 6 => 'list', + 7 => 'multiselection list', + 8 => 'date', + 9 => 'radio', + 10 => 'datetime', + 20 => 'text area', + 500 => 'script', + 501 => 'server' + ); + + /** + * + * @var array Configures for what type of CF "POSSIBLE_VALUES" field need to be manage at GUI level + * Keys of this map must be the values present in: + * $this->custom_field_types + */ + public $possible_values_cfg = array( + 'string' => 0, + 'numeric' => 0, + 'float' => 0, + 'email' => 0, + 'checkbox' => 1, + 'list' => 1, + 'multiselection list' => 1, + 'date' => 0, + 'radio' => 1, + 'datetime' => 0, + 'text area' => 0, + 'script' => 0, + 'server' => 0 + ); + + /** @var array only the types listed here can have custom fields */ + private $node_types = array( + 'build', + 'testsuite', + 'testplan', + 'testcase', + 'requirement_spec', + 'requirement' + ); + + /** + * + * @var array of maps $locations + * + * Location is place on page where to display custom field. + * This concept has been created to implement a user contribution, that allows for + * test cases, display custom fields in a different location (standard location is after + * all test case definition), to implemente Prerequisites using CF. + * + * First map key: node type: 'testcase','testsuite', etc. + * Each element will be a map with following structure: + * key:Holds string keys used on this object and pages that manages CF. + * current options: 1 -> standard location, i.e. work as done before this implementation. + * 2 -> before steps and results, => between summary and steps/results. + * + * value: used to get translated label to use on User Interface. + * + * IMPORTANT: if you add a new key, this values are used as access keys in several properties of this object. + * then if you add one here, remember to update other properties. + */ + private $locations = [ + 'testcase' => [ + 1 => 'standard_location', + 2 => 'before_steps_results', + 3 => 'before_summary', + 4 => 'before_preconditions', + 5 => 'after_title', + 6 => 'after_summary', + 7 => 'after_preconditions', + 8 => 'hide_because_is_used_as_variable' /* use when you will use the custom field as a variable [tlVar][/tlvar] */ + ] + ]; + + // changes in configuration + // + // Needed to manage user interface, when creating Custom Fields. + // When user choose a item type (test case, etc), a javascript logic + // uses this information to hide/show enable_on, and show_on combos. + // + // 0 => combo will not displayed + // + // May be need a review, because after the changes, seems a little bit silly. + private $enable_on_cfg = array( + 'execution' => array( + 'build' => 0, + 'testsuite' => 0, + 'testplan' => 0, + 'testcase' => 1, + 'requirement_spec' => 0, + 'requirement' => 0 + ), + 'design' => array( + 'build' => 0, + 'testsuite' => 0, + 'testplan' => 0, + 'testcase' => 1, + 'requirement_spec' => 0, + 'requirement' => 0 + ), + 'testplan_design' => array( + 'build' => 0, + 'testsuite' => 0, + 'testplan' => 0, + 'testcase' => 1, + 'requirement_spec' => 0, + 'requirement' => 0 + ) + ); + + // 0 => combo will not displayed + private $show_on_cfg = array( + 'execution' => array( + 'testsuite' => 1, + 'testplan' => 1, + 'testcase' => 1, + 'build' => 1, + 'requirement_spec' => 0, + 'requirement' => 0 + ), + 'design' => array( + 'testsuite' => 1, + 'testplan' => 1, + 'testcase' => 1, + 'build' => 0, + 'requirement_spec' => 0, + 'requirement' => 0 + ), + 'testplan_design' => array( + 'testsuite' => 1, + 'testplan' => 1, + 'testcase' => 1, + 'build' => 0, + 'requirement_spec' => 0, + 'requirement' => 0 + ) + ); + + // the name of html input will have the following format + // __ + // + public $name_prefix = 'custom_field_'; + + private $sizes = null; + + // must be equal to the lenght of: + // value column on cfield_*_values tables + // default_value column on custom_fields table + // 0 -> no limit + // Is used on text area types + private $max_length_value; + + // must be equal to the lenght of: + // possible_values column on custom_fields table + // 0 -> no limit + private $max_length_possible_values; + + private $decode; + + private $html_date_input_suffix = array( + 'input' => true, + 'hour' => true, + 'minute' => true, + 'second' => true + ); + + /** + * Class constructor + * + * @param + * database &$db reference to the database handler + */ + public function __construct(&$db) + { + parent::__construct(); + + $this->db = &$db; + $this->tree_manager = new tree($this->db); + + $cfConfig = config_get('custom_fields'); + $this->sizes = $cfConfig->sizes; + + if (property_exists($cfConfig, 'types') && ! is_null($cfConfig->types)) { + $this->custom_field_types += $cfConfig->types; + ksort($this->custom_field_types); + } + + if (property_exists($cfConfig, 'possible_values_cfg') && + ! is_null($cfConfig->possible_values_cfg)) { + $this->possible_values_cfg += $cfConfig->possible_values_cfg; + } + $this->object_table = $this->tables["custom_fields"]; + + $this->max_length_value = $cfConfig->max_length; + $this->max_length_possible_values = $this->max_length_value; + + $this->decode['nodes'] = $this->tree_manager->get_available_node_types(); + + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /** + * + * @return array + */ + private function getSizeLimit() + { + return $this->max_length_value; + } + + /** + * + * @return array + */ + public function get_application_areas() + { + return $this->application_areas; + } + + /** + * + * @return array with available locatipons + */ + public function getLocations() + { + return $this->locations; + } + + /** + * + * @return array with custom field available types + * key: numeric id + * value: short description + */ + public function get_available_types() + { + return $this->custom_field_types; + } + + /** + * + * @return string + */ + public function get_name_prefix() + { + return $this->name_prefix; + } + + /** + * + * @return array with node types id, that can have custom fields. + * key: short description (node_types.description) + * value: node_type_id (node_types.id) + */ + public function get_allowed_nodes() + { + $allowed_nodes = array(); + foreach ($this->node_types as $verbose_type) { + $allowed_nodes[$verbose_type] = $this->decode['nodes'][$verbose_type]; + } + return $allowed_nodes; + } + + /** + * + * @return array with node types id, that can have custom fields with enabled_on_$ui_mode. + * key : node_type_id (node_types.id) + * value: 1 -> enable on exec can be configured by user + */ + public function get_enable_on_cfg($ui_mode) + { + return $this->_get_ui_mgtm_cfg_for_node_type( + $this->enable_on_cfg[$ui_mode]); + } + + /** + * + * @param string $ui_mode + * @return array + */ + public function get_show_on_cfg($ui_mode) + { + return $this->_get_ui_mgtm_cfg_for_node_type( + $this->show_on_cfg[$ui_mode]); + } + + /* + * function: _get_ui_mgtm_cfg_for_node_type + * utility method + * + * returns: hash with node types id. + * key : node_type_id (node_types.id) + * value: 1 -> enable on exec can be configured by user + * + * + */ + private function _get_ui_mgtm_cfg_for_node_type($map_node_id_cfg) + { + $enabled_mgmt = array(); + $tl_node_types = $this->decode['nodes']; + foreach ($this->node_types as $verbose_type) { + $type_id = $tl_node_types[$verbose_type]; + if (isset($map_node_id_cfg[$verbose_type])) { + $enabled_mgmt[$type_id] = $map_node_id_cfg[$verbose_type]; + } + } + return $enabled_mgmt; + } + + /* + * function: get_possible_values_cfg + * + * returns: hash + * key : cf_type_id (see $custom_field_types) + * value: 1 -> possible values can be managed on UI. + * + * + */ + public function get_possible_values_cfg() + { + $pv_cfg = array(); + $custom_field_types_id = array_flip($this->custom_field_types); + + foreach ($this->possible_values_cfg as $verbose_cf_type => $use_on_ui) { + $cf_type_id = $custom_field_types_id[$verbose_cf_type]; + $pv_cfg[$cf_type_id] = $use_on_ui; + } + return $pv_cfg; + } + + /** + * + * @param array $context + * @param array $filters + * @param string $access_key + * @return array + */ + public function getLinkedCfieldsAtDesign($context, $filters = null, + $access_key = 'id') + { + $ctx = array( + 'tproject_id' => null, + 'enabled' => true, + 'node_type' => null, + 'node_id' => null + ); + $ctx = array_merge($ctx, $context); + if (null == $ctx['tproject_id']) { + throw new Exception( + __METHOD__ . ' EXCEPTION: test project ID, is mandatory'); + } + + extract($ctx); + + return $this->get_linked_cfields_at_design($tproject_id, $enabled, + $filters, $node_type, $node_id, $access_key); + } + + /* + * function: get_linked_cfields_at_design + * returns information about custom fields that can be used + * at least at design time, with the value assigned (is any has been assigned). + * + * + * $tproject_id: needed because is possible to associate/link + * a different set of custom field for every test project + * + * $enabled : 1 -> get custom fields that are has been configured + * to be shown during specification design AND are enabled. + * + * Remember that also exist custom fields + * that can be only used during TEST CASE EXECUTION. + * + * [$filters]:default: null + * map with keys: + * [show_on_execution]: 1 -> filter on field show_on_execution=1 + * 0 or null or not exists -> don't filter + * + * [show_on_testplan_design]: 1 -> filter on field show_on_execution=1 + * 0 or null or not exists -> don't filter + * + * [cfield_id]: if exists use it's value to filter on custom field id + * null or not exists -> don't filter + * + * [location]: new concept used to define on what location on screen + * custom field will be designed. + * Initally used with CF available for Test cases, to + * implement pre-requisites. + * null => no filtering + * + * [$node_type]: default: null + * verbose id ('testcase', 'testsuite', etc) of a node type. + * custom fields are linked also to different node types. + * Example: + * I can define a custom field "Aspect" with values + * Performace, Usability and wnat use it only for test suites. + * + * [$node_id]: default: null + * identification of a node/element on node hierarchy. + * Needed when I want to get the value of custom fields + * linked to a node. + * Example: + * Have two test cases (ID:9999, ID:89800), and want to get + * the value assigned to custom field "Operating System". + * I will do two calls to this method. + * + * [$access_key]: default id, field name to use as access key in returned hash + * + * returns: hash + * key: custom field id + * + * + * rev : + * + */ + public function get_linked_cfields_at_design($tproject_id, $enabled, + $filters = null, $node_type = null, $node_id = null, $access_key = 'id') + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $additional_join = ""; + $additional_values = ""; + $additional_filter = ""; + + switch ($access_key) { + case 'id': + case 'node_id': + case 'name': + break; + + default: + $access_key = 'id'; + break; + } + + switch ($node_type) { + case 'build': + $table_key = 'cfield_build_design_values'; + break; + + default: + $table_key = 'cfield_design_values'; + break; + } + + if (! is_null($node_type)) { + $additional_join .= " JOIN {$this->tables['cfield_node_types']} CFNT + ON CFNT.field_id=CF.id AND CFNT.node_type_id=" . + $this->db->prepare_int($this->decode['nodes'][$node_type]); + } + + $targetIsArray = false; + if (! is_null($node_id)) { + $additional_values .= ",CFDV.value AS value,CFDV.node_id AS node_id"; + + if (is_array($node_id)) { + $targetIsArray = true; + $sane = array_map('intval', $node_id); + $inClause = implode(',', $sane); + } else { + $inClause = $this->db->prepare_int($node_id); + } + + $additional_join .= " LEFT OUTER JOIN {$this->tables[$table_key]} CFDV ON CFDV.field_id=CF.id + AND CFDV.node_id IN ($inClause) "; + } + + $locFilter = []; + $replaceLocation = false; + $targetLocationCode = 0; + + if (! is_null($filters)) { + if (isset($filters['show_on_execution']) && + ! is_null($filters['show_on_execution'])) { + $additional_filter .= " AND CF.show_on_execution=1 "; + } + + // Probably this piece need to be changed to act on enable_on_ attribute + // due to CF display logic refactoring + // if( isset($filters['show_on_testplan_design']) && !is_null($filters['show_on_testplan_design']) ) + // { + // $additional_filter .= " AND CF.show_on_testplan_design=1 "; + // } + if (isset($filters['show_on_testplan_design']) && + ! is_null($filters['show_on_testplan_design'])) { + $additional_filter .= " AND CF.enable_on_testplan_design=1 "; + } + + if (isset($filters['cfield_id']) && ! is_null($filters['cfield_id'])) { + $additional_filter .= " AND CF.id = {$filters['cfield_id']} "; + } + + $filterKey = 'location'; + if (isset($filters[$filterKey]) && ! is_null($filters[$filterKey])) { + $locFilter = (array) $filters[$filterKey]; + $additional_filter .= " AND CFTP.$filterKey IN(" . + implode(",", $locFilter) . ") "; + + if ($replaceLocation = (count($locFilter) > 1)) { + $locMap = $this->buildLocationMap('testcase'); + $targetLocationCode = " {$locMap['standard_location']['location']} AS location "; + } + } + } + $sql = "/* $debugMsg */ SELECT CF.*,CFTP.display_order,CFTP.location,CFTP.required "; + if ($replaceLocation) { + $sql = str_replace('CFTP.location', $targetLocationCode, $sql); + } + + $sql .= $additional_values . " FROM {$this->object_table} CF " . + " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . + $additional_join . " WHERE CFTP.testproject_id=" . + intval($tproject_id) . + " AND CFTP.active=1 AND CF.show_on_design=1 " . + " AND CF.enable_on_design={$enabled} " . $additional_filter . + " ORDER BY display_order,CF.id "; + + if ($targetIsArray) { + // # 0008792: Tl 1.9.20 (dev) >> Requirement overview >> Custom field content displayed in wrong column + // $map = $this->db->fetchArrayRowsIntoMap($sql,$access_key); + $map = $this->db->fetchMapRowsIntoMap($sql, $access_key, 'id'); + } else { + $map = $this->db->fetchRowsIntoMap($sql, $access_key); + } + + return $map; + } + + /* + * ==================================================================== + * * Very Imporant ** + * This code is based on Mantis code. + * Initial development was based on 1.x.x versions. + * file:custom_field_api.php - function:print_custom_field_input() + * + * 20080815: some changes are done to add more flexibility, and idea + * was compared with 1.2.0a1 Mantis implementation. + * ==================================================================== + * + * function: string_custom_field_input + * returns an string with the html needed to display the custom field. + * + * If no specific code is found to manage a custom field type, + * it will be used code that manage string type. + * + * args: $p_field_def: contains the definition of the custom field + * (including it's field id) + * + * [$name_suffix]: if used must start with _. + * example _TCID017 + * + * returns: html string + * + * rev : + */ + public function string_custom_field_input($p_field_def, $opt = null) + { + $options = array( + 'name_suffix' => '', + 'field_size' => 0, + 'show_on_filters' => false, + 'remove_required' => false + ); + $options = array_merge($options, (array) $opt); + extract($options); + + $str_out = ''; + + $cfValue = $p_field_def['default_value']; + if (isset($p_field_def['value'])) { + $cfValue = $p_field_def['value']; + } + + $verbose_type = trim($this->custom_field_types[$p_field_def['type']]); + $cfValue = htmlspecialchars($cfValue); + $input_name = $this->buildHTMLInputName($p_field_def, $name_suffix); + $size = isset($this->sizes[$verbose_type]) ? intval( + $this->sizes[$verbose_type]) : 0; + + if ($options['remove_required']) { + $required = ' class="" '; + } else { + $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; + } + + $dateOpt = array( + 'default_disable' => false, + 'allow_blank' => true, + 'required' => $required, + 'show_on_filters' => $show_on_filters + ); + + if ($field_size > 0) { + $size = $field_size; + } + + switch ($verbose_type) { + case 'list': + case 'multiselection list': + $t_values = explode('|', $p_field_def['possible_values']); + + if ($verbose_type == 'list') { + // get maximum allowed window size for lists + // $window_size = intval($size) > 1 ? $size : self::LISTBOX_WINDOW_SIZE; + $t_multiple = ' '; + $t_name_suffix = ''; + } else { + $t_name_suffix = '[]'; + $t_multiple = ' multiple="multiple" '; + } + + $html_identity = $input_name . $t_name_suffix; + $str_out .= ''; + break; + + case 'checkbox': + $t_values = explode('|', $p_field_def['possible_values']); + $t_checked_values = explode('|', $cfValue); + foreach ($t_values as $t_option) { + $str_out .= ' ' . $t_option . + '  '; + } else { + $str_out .= ' value="' . $t_option . '"> ' . + $t_option . '  '; + } + } + break; + + case 'string': + case 'email': + case 'float': + case 'numeric': + $str_out .= $this->string_input_string($p_field_def, $input_name, + $cfValue, $size, $options); + break; + + case 'text area': + $cols = intval($this->sizes['text area']['cols']); + $rows = intval($this->sizes['text area']['rows']); + if ($cols <= 0) { + $cols = self::TEXTAREA_DEFAULT_COLS; + } + if ($rows <= 0) { + $rows = self::TEXTAREA_DEFAULT_ROWS; + } + + if ($this->max_length_value > 0) { + $counterId = $input_name . '_counter'; + $cf_current_size = $this->max_length_value - + tlStringLen($cfValue); + + // call JS function for check max. size from validate.js + $js_function = '"textCounter(this.form.' . $input_name . + ',document.getElementById(\'' . $counterId . '\'),' . + $this->max_length_value . ');" '; + + $str_out .= '\n"; + + // show character counter + $str_out .= '
    ' . + sprintf(lang_get('text_counter_feedback'), + $this->max_length_value) . ' ' . $cf_current_size . '.
    '; + } else { + // unlimited + $str_out .= '\n"; + } + break; + + case 'date': + $str_out .= create_date_selection_set($input_name, + config_get('date_format'), $cfValue, $dateOpt); + break; + + case 'datetime': + $cfg = config_get('gui'); + + // Important + // We can do this mix (get date format configuration from standard variable + // and time format from an specific custom field config) because string used + // for date_format on strftime() has no problem + // on date() calls (that are used in create_date_selection_set() ). + $format = config_get('date_format') . " " . + $cfg->custom_fields->time_format; + $str_out .= create_date_selection_set($input_name, $format, + $cfValue, $dateOpt); + break; + + default: + $dynamic_call = 'string_input_' . + str_replace(' ', '_', $verbose_type); + if (function_exists($dynamic_call)) { + $str_out .= $dynamic_call($p_field_def, $input_name, + $cfValue); + } elseif (method_exists($this, $dynamic_call)) { + $str_out .= $this->$dynamic_call($p_field_def, $input_name, + $cfValue); + } else { + // treat it as an simple string + $str_out .= $this->string_input_string($p_field_def, + $input_name, $cfValue, $size, $options); + } + break; + } + return $str_out; + } + + /* + * function: design_values_to_db + * write values of custom fields that are used at design time. + * + * args: $hash: contains info about CF gathered at user interface. + * (normally $_REQUEST variable) + * key: custom_field__. + * Example custom_field_0_67 -> 0=> string field + * + * $node_id: + * [$cf_map]: hash -> all the custom fields linked and enabled + * that are applicable to the node type of $node_id. + * + * For the keys not present in $hash, we will write + * an appropriate value according to custom field + * type. + * + * This is needed because when trying to udpate + * with hash being $_REQUEST, $_POST or $_GET + * some kind of custom fields (checkbox, list, multiple list) + * when has been deselected by user. + * + * + * rev: + */ + public function design_values_to_db($hash, $node_id, $cf_map = null, + $hash_type = null, $node_type = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + if (is_null($hash) && is_null($cf_map)) { + return; + } + + $cfield = $hash; + if (is_null($hash_type)) { + $cfield = $this->_build_cfield($hash, $cf_map); + } + + if (! is_null($cfield)) { + switch ($node_type) { + case 'build': + $table_key = 'cfield_build_design_values'; + break; + + default: + $table_key = 'cfield_design_values'; + break; + } + + $safeNodeID = intval($node_id); + foreach ($cfield as $field_id => $type_and_value) { + $value = $type_and_value['cf_value']; + + // do I need to update or insert this value? + $sql = "/* $debugMsg */ SELECT value FROM {$this->tables[$table_key]} " . + " WHERE field_id=" . intval($field_id) . " AND node_id=" . + $safeNodeID; + + $result = $this->db->exec_query($sql); + + // max_length_value = 0 => no limit + if ($this->max_length_value > 0 && + tlStringLen($value) > $this->max_length_value) { + $value = substr($value, 0, $this->max_length_value); + } + + $safe_value = $this->db->prepare_string($value); + $rowCount = $this->db->num_rows($result); + if ($rowCount > 0) { + if ($value != "") { + $sql = "/* $debugMsg */ UPDATE {$this->tables[$table_key]} " . + " SET value='{$safe_value}' "; + } else { + // bye, bye record + $sql = "/* $debugMsg */ DELETE FROM {$this->tables[$table_key]} "; + } + $sql .= " WHERE field_id=" . intval($field_id) . + " AND node_id=" . $safeNodeID; + $this->db->exec_query($sql); + } elseif ($rowCount == 0 && $value != "") { + # Remark got from Mantis code: + # Always store the value, even if it's the dafault value + # This is important, as the definitions might change but the + # values stored with a bug must not change + $sql = "/* $debugMsg */ INSERT INTO {$this->tables[$table_key]} " . + " ( field_id, node_id, value ) " . " VALUES ( " . + intval($field_id) . ", {$safeNodeID}, '{$safe_value}' )"; + $this->db->exec_query($sql); + } + } + } + } + + /* + * function: remove_all_design_values_from_node + * remove the values of ALL custom fields linked to + * a node. (example test case 5555) + * + * args: $node_id: single value or array + * + * returns: - + * + * rev : + * 20070102 - franciscom - $node_id can be an array + * + */ + public function remove_all_design_values_from_node($node_id, + $node_type = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + switch ($node_type) { + case 'build': + $table_key = 'cfield_build_design_values'; + break; + + default: + $table_key = 'cfield_design_values'; + break; + } + + $sql = "/* $debugMsg */ DELETE FROM {$this->tables[$table_key]} "; + if (is_array($node_id)) { + $sql .= " WHERE node_id IN(" . implode(",", $node_id) . ") "; + } else { + $sql .= " WHERE node_id=" . intval($node_id); + } + + $this->db->exec_query($sql); + } + + /* + * function: get_all + * get the definition of all custom field defined in the system, + * or all custom fields with id not included in $id2exclude. + * + * args: [$id2exclude]: array with custom field ids + * + * returns: hash: + * key: custom field id + * + */ + public function get_all($id2exclude = null, $opt = null) + { + static $lbl; + + if (! $lbl) { + $lbl = init_labels( + array( + 'context_design' => null, + 'context_exec' => null, + 'context_testplan_design' => null + )); + } + + $not_in_clause = ""; + if (! is_null($id2exclude)) { + $not_in_clause = " AND CF.id NOT IN (" . implode(',', $id2exclude) . + ") "; + } + $sql = "SELECT CF.*,NT.description AS node_description,NT.id AS node_type_id " . + " FROM {$this->object_table} CF, " . + " {$this->tables['cfield_node_types']} CFNT, " . + " {$this->tables['node_types']} NT " . + " WHERE CF.id=CFNT.field_id " . " AND NT.id=CFNT.node_type_id " . + $not_in_clause . " ORDER BY CF.name"; + + $map = $this->db->fetchRowsIntoMap($sql, 'id'); + if (! is_null($map) && ! is_null($opt)) { + $k2l = array_keys($map); + foreach ($k2l as $key) { + $map[$key]['enabled_on_context'] = ''; + if ($map[$key]['enable_on_design']) { + $map[$key]['enabled_on_context'] = $lbl['context_design']; + } elseif ($map[$key]['enable_on_execution']) { + $map[$key]['enabled_on_context'] = $lbl['context_exec']; + } elseif ($map[$key]['enable_on_testplan_design']) { + $map[$key]['enabled_on_context'] = $lbl['context_testplan_design']; + } + } + } + + return $map; + } + + /* + * function: get_linked_to_testproject + * get definition of all custom fields linked to a test project. + * + * + * args: $tproject_id + * [$active]: if not null will add the following filter " AND CFTP.active={$active}" + * + * returns: hash: + * key: custom field id + * + * internal revision: + */ + public function get_linked_to_testproject($tproject_id, $active = null, + $opt = null) + { + $options = array( + 'name' => null + ); + $options = array_merge($options, (array) $opt); + + $sql = "SELECT CF.*,NT.description AS node_description,NT.id AS node_type_id, " . + " CFTP.display_order, CFTP.active, CFTP.location,CFTP.required,CFTP.monitorable " . + " FROM {$this->object_table} CF, " . + " {$this->tables['cfield_testprojects']} CFTP, " . + " {$this->tables['cfield_node_types']} CFNT, " . + " {$this->tables['node_types']} NT " . + " WHERE CF.id=CFNT.field_id " . " AND CF.id=CFTP.field_id " . + " AND NT.id=CFNT.node_type_id " . " AND CFTP.testproject_id=" . + $this->db->prepare_int($tproject_id); + + if (! is_null($active)) { + $sql .= " AND CFTP.active={$active} "; + } + + if (! is_null($options['name'])) { + $sql .= " AND CF.name='" . + $this->db->prepare_string($options['name']) . "'"; + } + + $sql .= " ORDER BY NT.description,CF.enable_on_design desc, " . + " CF.enable_on_execution desc, " . + " CF.enable_on_testplan_design desc," . + " CFTP.display_order, CF.name"; + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /* + * function: link_to_testproject + * + * + * + * args: $tproject_id + * $cfields_id: array() + * + * returns: - + */ + public function link_to_testproject($tproject_id, $cfield_ids) + { + if (is_null($cfield_ids)) { + return; + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + $safeID = intval($tproject_id); + $tproject_info = $this->tree_manager->get_node_hierarchy_info($safeID); + foreach ($cfield_ids as $field_id) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['cfield_testprojects']} " . + " (testproject_id,field_id) " . " VALUES({$safeID},{$field_id})"; + + if ($this->db->exec_query($sql)) { + $cf = $this->get_by_id($field_id); + if ($cf) { + logAuditEvent( + TLS("audit_cfield_assigned", $cf[$field_id]['name'], + $tproject_info['name']), "ASSIGN", $tproject_id, + "testprojects"); + } + } + } + } + + /* + * function: set_active_for_testproject + * set the value of active field + * + * + * args: $tproject_id + * $cfields_id: array() + * $active_val: 1/0 + * + * returns: - + */ + public function set_active_for_testproject($tproject_id, $cfield_ids, + $active_val) + { + if (is_null($cfield_ids)) { + return; + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + $tproject_info = $this->tree_manager->get_node_hierarchy_info( + $tproject_id); + $auditMsg = $active_val ? "audit_cfield_activated" : "audit_cfield_deactivated"; + foreach ($cfield_ids as $field_id) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . + " SET active={$active_val} " . " WHERE testproject_id=" . + $this->db->prepare_int($tproject_id) . " AND field_id=" . + $this->db->prepare_int($field_id); + + if ($this->db->exec_query($sql)) { + $cf = $this->get_by_id($field_id); + if ($cf) { + logAuditEvent( + TLS($auditMsg, $cf[$field_id]['name'], + $tproject_info['name']), "SAVE", $tproject_id, + "testprojects"); + } + } + } + } + + /** + */ + public function setRequired($tproject_id, $cfieldSet, $val) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + if (is_null($cfieldSet)) { + return; + } + + $safe = new stdClass(); + $safe->tproject_id = intval($tproject_id); + $safe->val = (intval($val) > 0) ? 1 : 0; + + $info = $this->tree_manager->get_node_hierarchy_info($safe->tproject_id); + $auditMsg = $val ? "audit_cfield_required_on" : "audit_cfield_required_off"; + foreach ($cfieldSet as $field_id) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . + " SET required=" . $safe->val . " WHERE testproject_id=" . + $safe->tproject_id . " AND field_id=" . + $this->db->prepare_int($field_id); + + if ($this->db->exec_query($sql)) { + $cf = $this->get_by_id($field_id); + if ($cf) { + logAuditEvent( + TLS($auditMsg, $cf[$field_id]['name'], $info['name']), + "SAVE", $safe->tproject_id, "testprojects"); + } + } + } + } + + // function end + + /** + * unlink_from_testproject + * remove custom field links from target test project + * N.B.: following Mantis Bugtracking System model, + * this operation will NOR remove all values assigned to + * these custom fields . + * + * @param int $tproject_id + * @param array $cfield_ids + * + */ + public function unlink_from_testproject($tproject_id, $cfield_ids) + { + if (is_null($cfield_ids)) { + return; + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + $tproject_info = $this->tree_manager->get_node_hierarchy_info( + $tproject_id); + foreach ($cfield_ids as $field_id) { + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testprojects']} " . + " WHERE field_id = " . $this->db->prepare_int($field_id) . + " AND testproject_id = " . $this->db->prepare_int($tproject_id); + if ($this->db->exec_query($sql)) { + $cf = $this->get_by_id($field_id); + if ($cf) { + logAuditEvent( + TLS("audit_cfield_unassigned", $cf[$field_id]['name'], + $tproject_info['name']), "ASSIGN", $tproject_id, + "testprojects"); + } + } + } + } + + /* + * function: get_by_name + * get custom field definition + * + * args: $name: custom field name + * + * returns: hash + */ + public function get_by_name($name) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my_name = $this->db->prepare_string(trim($name)); + + $sql = "/* $debugMsg */ SELECT CF.*, CFNT.node_type_id,NT.description AS node_type" . + " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT," . + " {$this->tables['node_types']} NT" . " WHERE CF.id=CFNT.field_id " . + " AND CFNT.node_type_id=NT.id " . " AND name='{$my_name}' "; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /* + * function: get_by_id + * get custom field definition + * + * args: $id: custom field id + * + * returns: hash + * + */ + public function get_by_id($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT CF.*, CFNT.node_type_id" . + " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT" . + " WHERE CF.id=CFNT.field_id " . " AND CF.id IN (" . + implode(',', (array) $id) . ")"; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /* + * function: get_available_item_type + * get information about what item type (testcase,testplan, etc) + * can use this custom field + * + * args: $id: custom field id + * + * returns: + */ + private function get_available_item_type($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT CFNT.field_id,CFNT.node_type_id " . + " FROM {$this->tables['cfield_node_types']} CFNT, " . + " {$this->tables['nodes_types']} NT " . + " WHERE NT.id=CFNT.node_type_id " . " CFNt.field_id=" . + $this->db->prepare_int($id); + + return $this->db->fetchRowsIntoMap($sql, 'field_id'); + } + + /* + * + * keys name -> trim will be applied + * label -> trim will be applied + * type -> intval() wil be applied + * possible_values + * show_on_design -> trasformation on 1/0 using intval() [*] + * enable_on_design -> [*] + * show_on_execute -> [*] + * enable_on_execute -> [*] + * show_on_testplan_design -> [*] + * enable_on_testplan_design -> [*] + * + */ + private function sanitize($cf) + { + $safe = $cf; + + // remove the standard set of characters considered harmful + // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab + // "\r" - carriage return + // and spaces + // fortunatelly this is trim standard behaviour + $k2san = array( + 'name', + 'label' + ); + foreach ($k2san as $key) { + $safe[$key] = $this->db->prepare_string(trim($cf[$key])); + } + + // seems here is better do not touch. + $safe['possible_values'] = $this->db->prepare_string( + $cf['possible_values']); + + $onezero = array( + 'show_on_design', + 'enable_on_design', + 'show_on_testplan_design', + 'enable_on_testplan_design', + 'show_on_execution', + 'enable_on_execution' + ); + + foreach ($onezero as $key) { + $safe[$key] = intval($cf[$key]) > 0 ? 1 : 0; + } + + $safe['type'] = intval((int) $cf['type']); + $safe['node_type_id'] = intval((int) $cf['node_type_id']); + return $safe; + } + + /** + * create a custom field + * + * @param array $cf + * keys: name -> trim will be applied + * label -> trim will be applied + * type -> intval() wil be applied + * possible_values + * show_on_design -> trasformation on 1/0 using intval() [*] + * enable_on_design -> [*] + * show_on_execute -> [*] + * enable_on_execute -> [*] + * show_on_testplan_design -> [*] + * enable_on_testplan_design -> [*] + * node_type_id + * @return array + * @internal revision + */ + public function create($cf) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => 'ko' + ); + + $safecf = $this->sanitize($cf); + + // if CF is for BUILD force enable_on_execution ALWAYS FALSE + // Node Verbose Code / Node Code Verbose + $nvc = $this->tree_manager->get_available_node_types(); + $ncv = array_flip($nvc); + if ($ncv[$safecf['node_type_id']] == 'build') { + $safecf['enable_on_design'] = 1; + $safecf['enable_on_execution'] = 0; + } + + $sql = "/* $debugMsg */ INSERT INTO {$this->object_table} " . + " (name,label,type,possible_values, " . + " show_on_design,enable_on_design, " . + " show_on_testplan_design,enable_on_testplan_design, " . + " show_on_execution,enable_on_execution) " . " VALUES('" . + $safecf['name'] . "','" . $safecf['label'] . "'," . + intval($safecf['type']) . ",'" . $safecf['possible_values'] . "', " . + " {$safecf['show_on_design']},{$safecf['enable_on_design']}," . + " {$safecf['show_on_testplan_design']},{$safecf['enable_on_testplan_design']}," . + " {$safecf['show_on_execution']},{$safecf['enable_on_execution']})"; + $result = $this->db->exec_query($sql); + + if ($result) { + // at least for Postgres DBMS table name is needed. + $field_id = $this->db->insert_id($this->object_table); + + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['cfield_node_types']} " . + " (field_id,node_type_id) " . + " VALUES({$field_id},{$safecf['node_type_id']}) "; + $result = $this->db->exec_query($sql); + } + + if ($result) { + $ret = array( + 'status_ok' => 1, + 'id' => $field_id, + 'msg' => 'ok' + ); + } + return $ret; + } + + /** + * update a custom field + * + * @param array $cf + * keys: name + * label + * type + * possible_values + * show_on_design + * enable_on_design + * show_on_execute + * enable_on_execute + * show_on_testplan_design + * enable_on_testplan_design + * node_type_id + * @return number + */ + public function update($cf) + { + $safecf = $this->sanitize($cf); + + // if CF is for BUILD force enable_on_execution ALWAYS FALSE + // Node Verbose Code / Node Code Verbose + $nvc = $this->tree_manager->get_available_node_types(); + $ncv = array_flip($nvc); + if ($ncv[$safecf['node_type_id']] == 'build') { + $safecf['enable_on_design'] = 1; + $safecf['enable_on_execution'] = 0; + } + + $sql = "UPDATE {$this->tables['custom_fields']} " . " SET name='" . + $safecf['name'] . "'," . " label='" . $safecf['label'] . "'," . + " type={$safecf['type']}," . " possible_values='" . + $safecf['possible_values'] . "'," . + " show_on_design={$safecf['show_on_design']}," . + " enable_on_design={$safecf['enable_on_design']}," . + " show_on_testplan_design={$safecf['show_on_testplan_design']}," . + " enable_on_testplan_design={$safecf['enable_on_testplan_design']}," . + " show_on_execution={$safecf['show_on_execution']}," . + " enable_on_execution={$safecf['enable_on_execution']}" . + " WHERE id={$safecf['id']}"; + $result = $this->db->exec_query($sql); + + if ($result) { + $sql = "UPDATE {$this->tables['cfield_node_types']} " . + " SET node_type_id={$safecf['node_type_id']}" . + " WHERE field_id={$safecf['id']}"; + $result = $this->db->exec_query($sql); + } + return $result ? 1 : 0; + } + + /** + * Will delete custom field definition and also ALL assigned values + * If custom field is linked to test projects, these links must be removed + * + * @param int $id + * @return number + */ + public function delete($id) + { + // Before deleting definition I need to remove values + if ($this->is_used($id)) { + $this->remove_all_scopes_values($id); + } + $linked_tprojects = $this->get_linked_testprojects($id); + if (! empty($linked_tprojects)) { + $target = array_keys($linked_tprojects); + foreach ($target as $tproject_id) { + $this->unlink_from_testproject($tproject_id, (array) $id); + } + } + + $sql = "DELETE FROM {$this->tables['cfield_node_types']} WHERE field_id={$id}"; + $result = $this->db->exec_query($sql); + if ($result) { + $sql = "DELETE FROM {$this->tables['custom_fields']} WHERE id={$id}"; + $result = $this->db->exec_query($sql); + } + return $result ? 1 : 0; + } + + /* + * function: is_used + * + * args: $id: custom field id + * + * returns: 1/0 + * + * @used by cfieldsEdit.php, cfieldsEdit.tpl + * + */ + public function is_used($id) + { + $sql = "SELECT field_id FROM {$this->tables['cfield_design_values']} " . + "WHERE field_id={$id} " . "UNION " . + "SELECT field_id FROM {$this->tables['cfield_build_design_values']} " . + "WHERE field_id={$id} " . "UNION " . + "SELECT field_id FROM {$this->tables['cfield_testplan_design_values']} " . + "WHERE field_id={$id} " . "UNION " . + "SELECT field_id FROM {$this->tables['cfield_execution_values']} " . + "WHERE field_id={$id} "; + $result = $this->db->exec_query($sql); + return $this->db->num_rows($result) > 0 ? 1 : 0; + } + + // function end + + /** + * + * @param int $id + * @param string $name + * @return number 1 => name is unique + */ + public function name_is_unique($id, $name) + { + $cf = $this->get_by_name($name); + $status = 0; + if (is_null($cf) || isset($cf[$id])) { + $status = 1; + } + return $status; + } + + # -------------------- + # Adapted from Mantis code + # Prepare a string containing a custom field value for display + # $p_field_def definition of the custom field + # $p_node_id bug id to display the custom field value for + # + # [$p_value_field]: field id, to point to the field value in $p_field_def + public function string_custom_field_value($p_field_def, $p_node_id, + $p_value_field = 'value') + { + $t_value = isset($p_field_def[$p_value_field]) ? $p_field_def[$p_value_field] : null; + $cfValue = htmlspecialchars($t_value); + + switch ($this->custom_field_types[intval($p_field_def['type'])]) { + case 'email': + return "$cfValue"; + break; + + case 'enum': + case 'list': + case 'multiselection list': + case 'checkbox': + return str_replace('|', ', ', $cfValue); + break; + + case 'date': + if ($cfValue != null) { + // must remove % + $t_date_format = str_replace("%", "", + config_get('date_format')); + return date($t_date_format, $cfValue); + } + break; + + case 'datetime': + if ($cfValue != null) { + // must remove % + // $t_date_format=str_replace("%","",config_get( 'timestamp_format')); + // $datetime_format=$t_date_format; + $t_date_format = str_replace("%", "", + config_get('date_format')); + $cfg = config_get('gui'); + $datetime_format = $t_date_format . " " . + $cfg->custom_fields->time_format; + return date($datetime_format, $cfValue); + } + break; + + case 'text area': + if ($cfValue != null) { + return nl2br($cfValue); + } + break; + + case 'string': + return string_display_links($cfValue); + break; + + default: + // done this way in order to be able to debug if needed + return string_display_links($cfValue); + break; + } + } + + /* + * function: get_linked_cfields_at_execution + * returns information about custom fields that can be used + * at least at executed, with the value assigned (is any has been assigned). + * + * + * $tproject_id: needed because is possible to associate/link + * a different set of custom field for every test project + * + * $enabled : 1 -> get custom fields that are has been configured + * to be shown during test case execution AND are enabled. + * + * [$node_type]: default: null + * verbose id ('testcase', 'testsuite', etc) of a node type. + * custom fields are linked also to different node types. + * Example: + * I can define a custom field "Aspect" with values + * Performace, Usability and wnat use it only for test suites. + * + * [$node_id]: default: null + * identification of a node/element on node hierarchy. + * Needed when I want to get the value of custom fields + * linked to a node. + * Example: + * Have two test cases (ID:9999, ID:89800), and want to get + * the value assigned to custom field "Operating System". + * I will do two calls to this method. + * + * + * [execution_id] + * [testplan_id] + * [access_key] + * [location] + * + * returns: hash + * key: custom field id + * + */ + public function get_linked_cfields_at_execution($tproject_id, $enabled, + $node_type = null, $node_id = null, $execution_id = null, + $testplan_id = null, $access_key = 'id', $location = null) + { + $base_values = "CF.*,"; + $additional_join = ""; + $additional_values = ""; + $additional_filter = ""; + $order_clause = " ORDER BY display_order,CF.id "; + + $fetchMethod = 'fetchRowsIntoMap'; + + if (! is_null($node_type)) { + $additional_join .= " JOIN {$this->tables['cfield_node_types']} CFNT ON CFNT.field_id=CF.id " . + " AND CFNT.node_type_id=" . $this->decode['nodes'][$node_type]; + } + + if (! is_null($node_id) && ! is_null($execution_id) && + ! is_null($testplan_id)) { + $additional_values .= ",CFEV.value AS value,CFEV.tcversion_id AS node_id"; + $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . + " AND CFEV.tcversion_id=" . intval($node_id) . " " . + " AND CFEV.execution_id=" . intval($execution_id) . " " . + " AND CFEV.testplan_id=" . intval($testplan_id) . " "; + } elseif (! is_null($execution_id)) { + $access_key = 'execution_id'; + $fetchMethod = 'fetchMapRowsIntoMap'; + $additional_values .= ',CFEV.value AS value, CFEV.execution_id '; + $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . + " AND CFEV.execution_id IN (" . implode(',', $execution_id) . + ") "; + } else { + if (! is_null($testplan_id)) { + $base_values = ''; + + // MSSQL BLOCKING error on Report "Test Cases with Execution Details" due to reserved word EXEC + $additional_values .= ",CF.type,CF.name,CF.label,CF.id,CFEV.value AS value,CFEV.tcversion_id AS node_id," . + "EXECU.id AS exec_id, EXECU.tcversion_id,EXECU.tcversion_number," . + "EXECU.execution_ts,EXECU.status AS exec_status,EXECU.notes AS exec_notes, " . + "NHB.id AS tcase_id, NHB.name AS tcase_name, TCV.tc_external_id, " . + "B.id AS builds_id,B.name AS build_name, U.login AS tester, " . + "PLAT.name AS platform_name, COALESCE(PLAT.id,0) AS platform_id"; + + $additional_join .= " JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . + " AND CFEV.testplan_id={$testplan_id} " . + " JOIN {$this->tables['executions']} EXECU ON CFEV.tcversion_id = EXECU.tcversion_id " . + " AND CFEV.execution_id = EXECU.id "; + + $additional_join .= " JOIN {$this->tables['builds']} B ON B.id = EXECU.build_id " . + " AND B.testplan_id = EXECU.testplan_id "; + + $additional_join .= " JOIN {$this->tables['tcversions']} TCV ON TCV.version = EXECU.tcversion_number " . + " AND TCV.id = EXECU.tcversion_id "; + + $additional_join .= " JOIN {$this->tables['users']} U ON U.id = EXECU.tester_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHA ON NHA.id = EXECU.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.id = NHA.parent_id "; + + // Use left join, if platforms is not used platform_name will become null + $additional_join .= " LEFT JOIN {$this->tables['platforms']} PLAT ON EXECU.platform_id = PLAT.id"; + $order_clause = "ORDER BY EXECU.tcversion_id,exec_status,exec_id"; + + $fetchMethod = 'fetchArrayRowsIntoMap'; + } + } + + if (! is_null($location)) { + $additional_filter .= " AND CF.id= " . intval($location) . " "; + } + + $sql = "SELECT {$base_values} CFTP.display_order,CFTP.location,CFTP.required" . + $additional_values . " FROM {$this->tables['custom_fields']} CF " . + " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . + $additional_join . " WHERE CFTP.testproject_id={$tproject_id} " . + " AND CFTP.active=1 " . " AND CF.enable_on_execution={$enabled} " . + " AND CF.show_on_execution=1 {$additional_filter} {$order_clause} "; + + switch ($fetchMethod) { + case 'fetchArrayRowsIntoMap': + case 'fetchRowsIntoMap': + $map = $this->db->$fetchMethod($sql, $access_key); + break; + + case 'fetchMapRowsIntoMap': + $map = $this->db->$fetchMethod($sql, $access_key, 'id'); + break; + } + return $map; + } + + /* + * function: execution_values_to_db + * write values of custom fields that are used at execution time. + * if record exists => UPDATE + * + * args: $hash: contains info about CF gathered at user interface. + * (normally $_REQUEST variable) + * key: custom_field__. + * Example custom_field_0_67 -> 0=> string field + * + * $node_id: + * $execution_id: + * $testplan_id: + * + * [$cf_map]: hash -> all the custom fields linked and enabled + * that are applicable to the node type of $node_id. + * + * For the keys not present in $hash, we will write + * an appropriate value according to custom field + * type. + * + * This is needed because when trying to udpate + * with hash being $_REQUEST, $_POST or $_GET + * some kind of custom fields (checkbox, list, multiple list) + * when has been deselected by user. + * + * + * [hash_type]: default null, string that can be used to change how hash + * is processed. + * + * rev: + * 20090727 - franciscom - added [hash_type], to reuse this method on API + * 20070501 - franciscom - limiting lenght of value before writting + */ + public function execution_values_to_db($hash, $node_id, $execution_id, + $testplan_id, $cf_map = null, $hash_type = null) + { + if (is_null($hash) && is_null($cf_map)) { + return; + } + + $cfield = $hash; + if (is_null($hash_type)) { + $cfield = $this->_build_cfield($hash, $cf_map); + } + + if (! is_null($cfield)) { + foreach ($cfield as $field_id => $type_and_value) { + $value = $type_and_value['cf_value']; + + $where_clause = " WHERE field_id=" . + $this->db->prepare_int($field_id) . " AND tcversion_id=" . + $this->db->prepare_int($node_id) . " AND execution_id=" . + $this->db->prepare_int($execution_id) . " AND testplan_id=" . + $this->db->prepare_int($testplan_id); + + $debugMsg = $this->debugMsg . __FUNCTION__; + + // do I need to update or insert this value? + $sql = " SELECT value,field_id,execution_id " . + " FROM {$this->tables['cfield_execution_values']} " . + $where_clause; + + $rs = (array) $this->db->get_recordset($sql); + + // max_length_value = 0 => no limit + if ($this->max_length_value > 0 && + tlStringLen($value) > $this->max_length_value) { + $value = substr($value, 0, $this->max_length_value); + } + $safe_value = $this->db->prepare_string($value); + + $howMany = count($rs); + if ($howMany > 0 && $value != "") { + $sql = " UPDATE {$this->tables['cfield_execution_values']} " . + " SET value='{$safe_value}' " . $where_clause; + $this->db->exec_query($sql); + } elseif ($howMany == 0 && $value != "") { + + # Remark got from Mantis code: + # Always store the value, even if it's the default value + # This is important, as the definitions might change but the + # values stored with a bug must not change + $sql = "INSERT INTO {$this->tables['cfield_execution_values']} " . + " ( field_id, tcversion_id, execution_id,testplan_id,value ) " . + " VALUES ( {$field_id}, {$node_id}, {$execution_id}, {$testplan_id}, '{$safe_value}' )"; + $this->db->exec_query($sql); + } elseif ($howMany > 0 && $value == "") { + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_execution_values']} " . + $where_clause; + $this->db->exec_query($sql); + } + } + } + } + + /* + * function: _build_cfield + * support function useful for method used to write CF values to db: + * - design_values_to_db() + * - execution_values_to_db() + * - testplan_design_values_to_db() + * + * args: $hash: + * key: custom_field__[_][_]. + * Example custom_field_0_67 -> 0=> string field + * + * In certain situation we can get: + * custom_field_0_67_234 + * 0 => string field + * 234 => item owner of CF. + * this happens when you can have multiple times same CF on a page, as happens + * on execution page if configure TL to work on all test cases in test suite, + * or when you use CF on testplan_design. + * + * To understand [<_date_part>] read below on "Notes on DATE PART - _build_cfield" + * + * value: can be an array, or a string depending the + * + * $cf_map: hash + * key: cfield_id + * value: custom field definition data + * + * + * returns: hash or null. + * + * key: cfield_id + * value: hash ('type_id' => field_type_id, + * 'cf_value' => value) + * + * rev: + */ + public function _build_cfield($hash, $cf_map) + { + $localesDateFormat = config_get('locales_date_format'); + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $date_format = str_replace('%', '', $localesDateFormat[$locale]); + + // carved in the stone + $cf_prefix = $this->name_prefix; + $len_cfp = tlStringLen($cf_prefix); + $cftype_pos = 2; + $cfid_pos = 3; + $cfield = null; + + if (! is_null($cf_map)) { + foreach ($cf_map as $key => $value) { + $cfield[$key] = array( + "type_id" => $value['type'], + "cf_value" => '' + ); + } + } + + // Overwrite with values if custom field id exist + if (! is_null($hash)) { + foreach ($hash as $key => $value) { + if (strncmp($key, $cf_prefix, $len_cfp) == 0) { + // Notes on DATE PART - _build_cfield + // + // When using Custom Fields on Test Spec: + // key has this format (for every type except date ) + // custom_field_0_10 for every type except for type date & datetime. + // + // For date custom fields: + // custom_field_8_10_input + // + // For datetime custom fields + // custom_field_8_10_input + // custom_field_8_10_hour, custom_field_8_10_minute, ..._second + // + // After explode() + // Position 2: CF type + // Position 3: CF id + // Position 4: only available for date CF, is date part indicator + // + // When using Custom Fields on Execution + // another piece is added (TC id) then for a date CF, + // date part indicator is Position 5, instead of 4 + // + // When using Custom Fields on Testplan Design + // another piece is added (testplan_tcversion.id) then for a date CF, + // date part indicator is Position 5, instead of 4 + $dummy = explode('_', $key); + $last_idx = count($dummy) - 1; + + $the_value = null; // without this #0008347 :( + if (isset($this->html_date_input_suffix[$dummy[$last_idx]])) { + $the_value[$dummy[$last_idx]] = $value; + } else { + $the_value = $value; + } + + $cfield[$dummy[$cfid_pos]] = array( + "type_id" => $dummy[$cftype_pos], + "cf_value" => $the_value + ); + } + } + } + + if (! is_null($cfield)) { + foreach ($cfield as $field_id => $type_and_value) { + $value = $type_and_value['cf_value']; + $verbose_type = trim( + $this->custom_field_types[$type_and_value['type_id']]); + switch ($verbose_type) { + case 'multiselection list': + case 'checkbox': + $valueIsArray = is_array($value); + if ($valueIsArray && count($value) > 1) { + $value = implode('|', $value); + } else { + $value = $valueIsArray ? $value[0] : $value; + } + $cfield[$field_id]['cf_value'] = $value; + break; + + case 'date': + if (($value['input'] == 0) || ($value['input'] == '')) { + $cfield[$field_id]['cf_value'] = ''; + } else { + $cfield[$field_id]['cf_value'] = ''; + $pvalue = split_localized_date($value['input'], + $date_format); + if ($pvalue != null) { + $cfield[$field_id]['cf_value'] = mktime(0, 0, 0, + $pvalue['month'], $pvalue['day'], + $pvalue['year']); + } + } + break; + + case 'datetime': + if ($value['input'] == '') { + $cfield[$field_id]['cf_value'] = ''; + } else { + $cfield[$field_id]['cf_value'] = ''; + $pvalue = split_localized_date($value['input'], + $date_format); + if ($pvalue != null) { + if ($value['hour'] == - 1 || + $value['minute'] == - 1 || + $value['second'] == - 1) { + $value['hour'] = $value['minute'] = $value['second'] = 0; + } + $cfield[$field_id]['cf_value'] = mktime( + $value['hour'], $value['minute'], + $value['second'], $pvalue['month'], + $pvalue['day'], $pvalue['year']); + } + } + break; + + default: + $dynamic_call = 'build_cfield_' . + str_replace(' ', '_', $verbose_type); + if (function_exists($dynamic_call)) { + $cfield[$field_id]['cf_value'] = $dynamic_call( + $value); + } elseif (method_exists($this, $dynamic_call)) { + $cfield[$field_id]['cf_value'] = $this->$dynamic_call( + $value); + } else { + $cfield[$field_id]['cf_value'] = $value; + } + break; + } + } + } + return $cfield; + } + + /* + * function: set_display_order + * + * args : $tproject_id: needed because is possible to associate/link + * a different set of custom field for every test project + * $map_field_id_display_order + * + * + * + * returns: + * + */ + public function set_display_order($tproject_id, $map_field_id_display_order) + { + $tproject_info = $this->tree_manager->get_node_hierarchy_info( + $tproject_id); + foreach ($map_field_id_display_order as $field_id => $display_order) { + $sql = "UPDATE {$this->tables['cfield_testprojects']} " . + " SET display_order=" . intval($display_order) . + " WHERE testproject_id={$tproject_id} AND field_id={$field_id} "; + $this->db->exec_query($sql); + } + if ($tproject_info) { + logAuditEvent( + TLS("audit_cfield_display_order_changed", $tproject_info['name']), + "SAVE", $tproject_id, "testprojects"); + } + } + + /** + * set value of location attribute for one or multiple custom fields. + */ + public function setDisplayLocation($tproject_id, $field_id_location) + { + $tproject_info = $this->tree_manager->get_node_hierarchy_info( + $tproject_id); + foreach ($field_id_location as $field_id => $location) { + $sql = "UPDATE {$this->tables['cfield_testprojects']} " . + " SET location=" . intval($location) . + " WHERE testproject_id={$tproject_id} AND field_id={$field_id} "; + $this->db->exec_query($sql); + } + if ($tproject_info) { + logAuditEvent( + TLS("audit_cfield_location_changed", $tproject_info['name']), + "SAVE", $tproject_id, "testprojects"); + } + } + + # code from mantis helper_api.php + # -------------------- + # returns a tab index value and increments it by one. This is used to give sequential tab index on + # a form. + private function helper_get_tab_index_value() + { + static $tab_index = 0; + return ++ $tab_index; + } + + # -------------------- + # returns a tab index and increments internal state by 1. This is used to give sequential tab index on + # a form. For example, this function returns: tabindex="1" + private function helper_get_tab_index() + { + return 'tabindex="' . helper_get_tab_index_value() . '"'; + } + + /** + * Retrieves the XML-RPC Server Parameters specified through custom fields. + * + * Done searching CARVED in the stone Custom Field Names on different + * (AGAIN CARVED in the stone) CF value tables in this way: + * + * CF name will have 3 pieces separated by _ (underscore) + * + * RE-XMLRPC_url_tsuite + * RE-XMLRPC_url_tcase + * RE-XMLRPC_url_link + * + * Part 1: RE-XMLRPC_ FIXED value, used as search key to get automatically + * CF to be analised. + * + * Part 2: url will be key on returned hash, and is part of 'contract' with caller, + * i.e. caller will use this key. + * This key is a FREE choice of developer of Remote Execute modules to use + * with TL. + * + * Part 3: this part is domain (link,tcase,tsuite) + * work this way: + * To specify Remote Execution server parameters we have provided 3 choices + * a. on test case version LINKED to Test Plan + Platform (Test Plan Design time) + * b. on test case version BUT at Test Spec Design time. + * In this way if is OK to have always same parameters no matter + * test plan + platform where test case version has been linked, we configure + * this just ONCE. + * c. on test suite (can be done ONLY at Test Spec Design time), all test case versions + * contained on this test suite branch (and children Test suites) will share this + * configuration. + * + * + * + * @param integer $node_id + * Accepts current node id from nodes hierarchy level + * @return mixed An array of config params if found, else returns null + * + * @internal rev: + * + * 20110123 - franciscom - need refactoring after we have choose to link custom field + * values to test case version not to test case + * + */ + public function getXMLRPCServerParams($nodeID, $tplanLinkID = null) + { + static $node_type; + static $likeTarget; + static $CFGKEY_IDX; + + $debugMsg = $this->debugMsg . __FUNCTION__; + + if (is_null($node_type)) { + $node_type = $this->tree_manager->get_available_node_types(); + $likeTarget = 'RE-XMLRPC_%'; + $CFGKEY_IDX = 1; + } + + $node_info = $this->tree_manager->get_node_hierarchy_info($nodeID); + $ret = null; + + if (! is_null($node_info)) { + $server_info = null; + + // First Search at test plan design time + if (! is_null($tplanLinkID)) { + $sql = " /* $debugMsg */ SELECT cf.name, cfv.value " . + " FROM {$this->tables['cfield_testplan_design_values']} cfv " . + " JOIN {$this->tables['custom_fields']} cf ON " . + " cfv.field_id = cf.id " . + " WHERE cf.name LIKE '{$likeTarget}' " . + " AND cfv.link_id = " . intval($tplanLinkID); + + $server_info = $this->db->fetchRowsIntoMap($sql, 'name'); + } + + if (is_null($server_info)) { + + $sql = " /* $debugMsg */ SELECT cf.name, cfv.value " . + " FROM {$this->tables['cfield_design_values']} cfv " . + " JOIN {$this->tables['custom_fields']} cf ON " . + " cfv.field_id = cf.id " . + " WHERE cf.name LIKE '{$likeTarget}' " . + " AND cfv.node_id = " . intval($nodeID); + + $server_info = $this->db->fetchRowsIntoMap($sql, 'name'); + } + + if (is_null($server_info)) { + // Recurse + // 20110123 - franciscom + // At time of initial development this was thinked to try to get + // server info from Test Suite. + // Because with TL 1.9.x when working with test case we will receive + // Test Case Version ID, instead of Test Case ID (1.8.x), we will do + // a call to reach Test Case and then another to reach Test Suite + if ($node_info['parent_id'] != "") { + $ret = $this->getXMLRPCServerParams($node_info['parent_id']); + } + } else { + $key2loop = array_keys($server_info); + foreach ($key2loop as $target) { + $dummy = explode('_', $target); + $ret[$dummy[$CFGKEY_IDX]] = $server_info[$target]['value']; + } + } + } + + return $ret; + } + + /* + * function: testplan_design_values_to_db + * write values of custom fields that are used at testplan design time. + * + * args: $hash: contains info about CF gathered at user interface. + * (normally $_REQUEST variable) + * key: custom_field__. + * Example custom_field_0_67 -> 0=> string field + * + * $node_id: Remember that this CF are used to extend information + * on test cases (tcversions) linked to test plans. + * Then node_id can not point to other type of node than test case version, + * then node_id will contain a tcversion_id. + * + * I have leave this argument to + * + * + * + * $link_id: Remember that this CF are used to extend information + * on test cases (tcversions) linked to test plans. + * Link information is store in testplan_tcversions table, + * $link_id points to this link (testplan_tcversions.id field) + * + * [$cf_map]: hash -> all the custom fields linked and enabled + * that are applicable to the node type of $node_id. + * + * For the keys not present in $hash, we will write + * an appropriate value according to custom field + * type. + * This is needed because when trying to udpate + * with hash being $_REQUEST, $_POST or $_GET + * some kind of custom fields (checkbox, list, multiple list) + * when has been deselected by user. + * + * [$hash_type]: NEED TO BE COMMENTED + * + * + * rev: + */ + public function testplan_design_values_to_db($hash, $node_id, $link_id, + $cf_map = null, $hash_type = null) + { + if (is_null($hash) && is_null($cf_map)) { + return; + } + $debugMsg = $this->debugMsg . __FUNCTION__; + $cfield = is_null($hash_type) ? $this->_build_cfield($hash, $cf_map) : $hash; + if (! is_null($cfield)) { + foreach ($cfield as $field_id => $type_and_value) { + $value = $type_and_value['cf_value']; + + // do I need to update or insert this value? + $sql = "SELECT value FROM {$this->tables['cfield_testplan_design_values']} " . + " WHERE field_id={$field_id} AND link_id={$link_id}"; + + $result = $this->db->exec_query($sql); + + // max_length_value = 0 => no limit + if ($this->max_length_value > 0 && + tlStringLen($value) > $this->max_length_value) { + $value = substr($value, 0, $this->max_length_value); + } + + $safe_value = $this->db->prepare_string($value); + if ($this->db->num_rows($result) > 0 && $value != "") { + $sql = "UPDATE {$this->tables['cfield_testplan_design_values']} " . + " SET value='{$safe_value}' " . + " WHERE field_id={$field_id} AND link_id={$link_id}"; + $this->db->exec_query($sql); + } // BUGID 3989 + elseif ($this->db->num_rows($result) == 0 && $value != "") { + # Remark got from Mantis code: + # Always store the value, even if it's the dafault value + # This is important, as the definitions might change but the + # values stored with a bug must not change + $sql = "INSERT INTO {$this->tables['cfield_testplan_design_values']} " . + " ( field_id, link_id, value ) " . + " VALUES ( {$field_id}, {$link_id}, '{$safe_value}' )"; + $this->db->exec_query($sql); + // BUGID 3989 + } elseif ($this->db->num_rows($result) > 0 && $value == "") { + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " . + " WHERE field_id={$field_id} AND link_id={$link_id}"; + $this->db->exec_query($sql); + } + } + } + } + + /* + * function: get_linked_cfields_at_testplan_design + * returns information about custom fields that can be used + * at least at testplan design time (test case assignment), + * with the value assigned (is any has been assigned). + * + * + * $tproject_id: needed because is possible to associate/link + * a different set of custom field for every test project + * + * $enabled : 1 -> get custom fields that are has been configured + * to be shown during test case execution AND are enabled. + * + * [$node_type]: default: null + * verbose id ('testcase', 'testsuite', etc) of a node type. + * custom fields are linked also to different node types. + * Example: + * I can define a custom field "Aspect" with values + * Performace, Usability and wnat use it only for test suites. + * + * [$node_id]: default: null + * identification of a node/element on node hierarchy. + * Needed when I want to get the value of custom fields + * linked to a node. + * Example: + * Have two test cases (ID:9999, ID:89800), and want to get + * the value assigned to custom field "Operating System". + * I will do two calls to this method. + * + * IMPORTANT: + * Fot testplan_design Custom Field this will be a TCVERSION_ID, + * not a TESTCASE_ID + * + * + * [link_id]: points to testplan_tcversions.id field + * [testplan_id] + * + * + * returns: hash + * key: custom field id + * + * + * + */ + public function get_linked_cfields_at_testplan_design($tproject_id, $enabled, + $node_type = null, $node_id = null, $link_id = null, $testplan_id = null, + $access_key = 'id') + { + $additional_join = ""; + $additional_values = ""; + + $order_by_clause = " ORDER BY display_order,CF.id "; + $fetchMethod = 'fetchRowsIntoMap'; + + if (! is_null($node_type)) { + $hash_descr_id = $this->tree_manager->get_available_node_types(); + $node_type_id = $hash_descr_id[$node_type]; + + $additional_join .= " JOIN {$this->tables['cfield_node_types']} CFNT ON CFNT.field_id=CF.id " . + " AND CFNT.node_type_id={$node_type_id} "; + } + + if (is_null($link_id) && ! is_null($testplan_id)) { + $additional_values .= ",CFTDV.value AS value, CFTDV.link_id AS node_id, " . + "NHB.id AS tcase_id, NHB.name AS tcase_name, " . + "TCV.tc_external_id "; + + $additional_join .= "JOIN {$this->tables['testplan_tcversions']} TPTC" . + " ON TPTC.testplan_id = {$testplan_id}" . + " JOIN {$this->tables['cfield_testplan_design_values']} CFTDV " . + " ON CFTDV.field_id=CF.id " . " AND CFTDV.link_id = TPTC.id "; + + $additional_join .= " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTC.tcversion_id " . + " AND TCV.id = TPTC.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHA ON NHA.id = TPTC.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.id = NHA.parent_id "; + + $order_by_clause = " ORDER BY node_id,display_order,CF.id "; + $fetchMethod = 'fetchArrayRowsIntoMap'; + $access_key = 'node_id'; + } elseif (! is_null($link_id)) { + $additional_values .= ",CFTDV.value AS value, CFTDV.link_id AS node_id"; + $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_testplan_design_values']} CFTDV " . + " ON CFTDV.field_id=CF.id " . " AND CFTDV.link_id={$link_id} "; + } + + $sql = "SELECT CF.*,CFTP.display_order,CFTP.required" . + $additional_values . " FROM {$this->tables['custom_fields']} CF " . + " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . + $additional_join . " WHERE CFTP.testproject_id={$tproject_id} " . + " AND CFTP.active=1 " . + " AND CF.enable_on_testplan_design={$enabled} " . $order_by_clause; + + return $this->db->$fetchMethod($sql, $access_key); + } + + /* + * function: string_input_radio + * returns an string with the html needed to display radio custom field. + * Is normally called by string_custom_field_input() + * + * args: p_field_def: contains the definition of the custom field + * (including it's field id) + * + * p_input_name: html input name + * + * p_custom_field_value: html input value + * htmlspecialchars() must be applied to this + * argument by caller. + * + * returns: html string + * + * rev: 20080816 - franciscom + * based on Mantis 1.2.0a1 code + * + */ + private function string_input_radio($p_field_def, $p_input_name, + $p_custom_field_value, $opt = null) + { + $options = array( + 'remove_required' => false + ); + $options = array_merge($options, (array) $opt); + + $str_out = ''; + $t_values = explode('|', $p_field_def['possible_values']); + $t_checked_values = explode('|', $p_custom_field_value); + + if ($options['remove_required']) { + $required = ' class="" '; + } else { + $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; + } + + foreach ($t_values as $t_option) { + $str_out .= ' ' . + $t_option . '  '; + } else { + $str_out .= ' value="' . $t_option . '"> ' . $t_option . + '  '; + } + } + return $str_out; + } + + /* + * function: build_cfield_radio + * support function useful for method used to write radio CF values to db. + * Is normally called by _build_cfield() + * + * args: custom_field_value: value to be converted to be written to db. + * + * returns: value converted + * + * rev: 20080816 - franciscom + * + */ + private function build_cfield_radio($custom_field_value) + { + if (count($custom_field_value) > 1) { + $value = implode('|', $custom_field_value); + } else { + $value = is_array($custom_field_value) ? $custom_field_value[0] : $custom_field_value; + } + return $value; + } + + /* + * function: string_input_string + * returns an string with the html needed to display custom field of type: + * string, email, numeric, float + * + * Is normally called by string_custom_field_input() + * + * args: p_field_def: contains the definition of the custom field + * (including it's field id) + * + * p_input_name: html input name + * + * p_custom_field_value: html input value + * htmlspecialchars() must be applied to this + * argument by caller. + * + * p_size: html input size + * + * returns: html string + * + * + */ + private function string_input_string($p_field_def, $p_input_name, + $p_custom_field_value, $p_size, $opt = null) + { + $options = array( + 'remove_required' => false + ); + $options = array_merge($options, (array) $opt); + if ($options['remove_required']) { + $required = ' class="" '; + } else { + $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; + } + + $str_out = ''; + $size = intval($p_size) > 0 ? $p_size : self::DEFAULT_INPUT_SIZE; + $str_out .= "'; + return $str_out; + } + + /** + * exportValueAsXML + * generate XML with custom field name, and custom field value + * useful on export to XML method for items that can have custom fields, + * example: test cases, test suites, req specification, etc. + * + * @param array $cfMap: + * key: custom file ID, value: map with at least keys 'name', 'value' + * + */ + public function exportValueAsXML($cfMap) + { + $cfRootElem = "\n{{XMLCODE}}\t\t\n"; + $cfElemTemplate = "\t\t\t" . + "\n\t\t\t\n\t\t\t" . + "\n" . "\t\t\t" . + "\n"; + $cfDecode = array( + "||NAME||" => "name", + "||VALUE||" => "value" + ); + return exportDataToXML($cfMap, $cfRootElem, $cfElemTemplate, $cfDecode, + true); + } + + /** + * remove_all_scopes_values + * For a given custom field id remove all assigned values in any scope + * + * @param int $id: + * custom field id + * + */ + private function remove_all_scopes_values($id) + { + // some sort of blind delete + $tables = array( + 'cfield_design_values', + 'cfield_build_design_values', + 'cfield_execution_values', + 'cfield_testplan_design_values' + ); + $safe_id = intval($id); + foreach ($tables as $tt) { + $sql = "DELETE FROM {$this->tables[$tt]} WHERE field_id={$safe_id} "; + $this->db->exec_query($sql); + } + } + + /** + * get_linked_testprojects + * For a given custom field id return all test projects where is linked. + * + * @param int $id: + * custom field id + * @return array + */ + public function get_linked_testprojects($id) + { + $sql = " SELECT NH.id, NH.name " . + " FROM {$this->tables['cfield_testprojects']} CFTP, {$this->tables['nodes_hierarchy']} NH " . + " WHERE CFTP.testproject_id=NH.id " . + " AND CFTP.field_id = {$id} ORDER BY NH.name "; + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * + * @param + * string node type in verbose form. Example 'testcase' + * + * returns map with key: verbose location (see custom field class $locations) + * value: array with fixed key 'location' + * value: location code + * + */ + public function buildLocationMap($nodeType) + { + $locationMap = null; + $dummy = $this->getLocations(); + $verboseLocationCode = array_flip($dummy[$nodeType]); + if (! empty($verboseLocationCode)) { + foreach ($verboseLocationCode as $key => $value) { + $locationMap[$key]['location'] = $value; + } + } + return $locationMap; + } + + /** + * + * @param + * int linkID: how is used depends on $options['scope'] + * $options['scope']=design => node_id + * $options['scope']=testplan_design => feature_id (see testplan_tcversions table) + * $options['scope']=execution => execution_id + * + * @used by testsuite.class.php => copy_cfields_values + */ + public function getByLinkID($linkID, $options = null) + { + $my['options'] = array( + 'scope' => 'design', + 'output' => 'field_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + switch ($my['options']['output']) { + case 'field_id': + $sql = "/* debugMsg */ SELECT field_id FROM "; + break; + + case 'full': + $sql = "/* debugMsg */ SELECT * FROM "; + break; + } + + switch ($my['options']['scope']) { + case 'design': + $sql .= " {$this->tables['cfield_design_values']} " . + " WHERE node_id = {$linkID} "; + break; + + case 'testplan_design': + $sql .= " {$this->tables['cfield_testplan_design_values']} " . + " WHERE feature_id = {$linkID} "; + break; + + case 'execution': + $sql .= " {$this->tables['cfield_execution_values']} " . + " WHERE execution_id = {$linkID} "; + break; + } + return $this->db->get_recordset($sql); + } + + /** + * buildHTMLInputName + */ + private function buildHTMLInputName($cf, $name_suffix) + { + return "{$this->name_prefix}{$cf['type']}_{$cf['id']}{$name_suffix}"; + } + + /** + */ + public function html_table_inputs($cfields_map, $name_suffix = '', + $input_values = null, $opt = null) + { + $cf_smarty = ''; + $getOpt = array( + 'name_suffix' => $name_suffix + ); + + $my['opt'] = array( + 'addCheck' => false, + 'addTable' => true, + 'forceOptional' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if (! is_null($cfields_map)) { + $lbl_upd = lang_get('update_hint'); + $cf_map = $this->getValuesFromUserInput($cfields_map, $name_suffix, + $input_values); + + $NO_WARNING_IF_MISSING = true; + $openTag = $my['opt']['addTable'] ? "" : ''; + $closeTag = $my['opt']['addTable'] ? "
    " : ''; + + $add_img = "'; + + $cf_smarty = ''; + foreach ($cf_map as $cf_info) { + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, $NO_WARNING_IF_MISSING)); + + // IMPORTANT NOTICE + // assigning an ID with this format is CRITIC to Javascript logic used + // to validate input data filled by user according to CF type + // extract input html id + // Want to give an html id to
    used as labelHolder, to use it in Javascript + // logic to validate CF content + if ($my['opt']['forceOptional']) { + $cf_info['required'] = 0; + } + + $cf_html_string = $this->string_custom_field_input($cf_info, + $getOpt); + + $dummy = explode(' ', + strstr($cf_html_string, 'id="custom_field_')); + $td_label_id = str_replace('id="', 'id="label_', $dummy[0]); + + $cf_smarty .= "
    {$add_img}" . + " " . + htmlspecialchars($label) . ":" . + $this->string_custom_field_input($cf_info, $getOpt) . + "
    used as labelHolder, to use it in Javascript + // logic to validate CF content + $cf_html_string = $this->string_custom_field_input($cf_info, + $getOpt); + + $dummy = explode(' ', + strstr($cf_html_string, 'id="custom_field_')); + $label_id = str_replace('id="', 'id="label_', $dummy[0]); + + $inputSet[] = array( + 'label' => htmlspecialchars($label), + 'label_id' => $label_id, + 'input' => $this->string_custom_field_input($cf_info, + $getOpt) + ); + } + } + return $inputSet; + } + + /** + */ + public function getByIDAndEnableOn($id, $enableOn = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT CF.*, CFNT.node_type_id" . + " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT" . + " WHERE CF.id=CFNT.field_id " . " AND CF.id IN (" . + implode(',', (array) $id) . ")"; + + if (! is_null($enableOn) && is_array($enableOn)) { + foreach ($this->application_areas as $key) { + if (isset($enableOn[$key]) && $enableOn[$key]) { + $sql .= " AND CF.enable_on_{$key}=1 "; + } + } + } + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + public function setMonitorable($tproject_id, $cfieldSet, $val) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + if (is_null($cfieldSet)) { + return; + } + + $safe = new stdClass(); + $safe->tproject_id = intval($tproject_id); + $safe->val = (intval($val) > 0) ? 1 : 0; + + $field = 'monitorable'; + + $info = $this->tree_manager->get_node_hierarchy_info($safe->tproject_id); + $auditMsg = $val ? "audit_cfield_{$field}_on" : "audit_cfield_{$field}_off"; + foreach ($cfieldSet as $field_id) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . + " SET {$field}=" . $safe->val . " WHERE testproject_id=" . + $safe->tproject_id . " AND field_id=" . + $this->db->prepare_int($field_id); + + if ($this->db->exec_query($sql)) { + $cf = $this->get_by_id($field_id); + if ($cf) { + logAuditEvent( + TLS($auditMsg, $cf[$field_id]['name'], $info['name']), + "SAVE", $safe->tproject_id, "testprojects"); + } + } + } + } + + /** + */ + public function cfdate2mktime($value) + { + if (($value == 0) || ($value == '')) { + return ''; + } else { + $localesDateFormat = config_get('locales_date_format'); + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $date_format = str_replace('%', '', $localesDateFormat[$locale]); + + $pvalue = split_localized_date($value, $date_format); + if ($pvalue != null) { + $pvalue = mktime(0, 0, 0, $pvalue['month'], $pvalue['day'], + $pvalue['year']); + return $pvalue; + } else { + return ''; + } + } + } + + /** + */ + public function getBooleanAttributes($tproject_id, $cfSet = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = " /* $debugMsg */ " . + " SELECT field_id,active,required,monitorable " . + " FROM {$this->tables['cfield_testprojects']} CFTP " . + " WHERE testproject_id =" . intval($tproject_id); + + if (! is_null($cfSet)) { + $sql .= " AND field_id IN(" . implode(',', $cfSet) . ")"; + } + + return $this->db->fetchRowsIntoMap($sql, 'field_id'); + } + + /** + * + * @return stdClass + */ + public function initViewGUI() + { + $gogo = new stdClass(); + + $gogo->cfield = null; + $gogo->cfield_is_used = 0; + $gogo->cfield_is_linked = 0; + $gogo->linked_tprojects = null; + + $gogo->cf_map = $this->get_all(null, 'transform'); + $gogo->cf_types = $gogo->cfield_types = $this->get_available_types(); + + // MAGIC 10 + $gogo->drawControlsOnTop = (null != $gogo->cf_map && + count($gogo->cf_map) > 10); + + return $gogo; + } } - - -/** - * class is responsible for logic and store Custom Fields functionality - * @package TestLink - */ -class cfield_mgr extends tlObject -{ - const DEFAULT_INPUT_SIZE = 50; - const TEXTAREA_MAX_SIZE = 255; - - // EDIT HERE IF YOU CUSTOMIZE YOUR DB - /** for text area custom field 40 x 6 -> 240 chars <= 255 chars table field size */ - const TEXTAREA_DEFAULT_COLS = 70; - const TEXTAREA_DEFAULT_ROWS = 4; - - const CF_ENABLED = 1; - const ENABLED = 1; - const DISABLED = 0; - - /** @var resource the database handler */ - var $db; - - /** @var object tree class */ - var $tree_manager; - - /** - * @var array $application_areas - * Holds string keys used on this object and pages that manages CF, - * identifying in what areas/features something will be done - * 'execution' => mainly on test execution pages, - * identifies TL features/pages to record test results - * 'design' => test suites, test cases creation - * identifies TL features/pages to create test specification - * 'testplan_design' => link test cases to test plan (assign testcase option) - * - * IMPORTANT: this values are used as access keys in several properties of this object. - * then if you add one here, remember to update other properties. - */ - var $application_areas = array('execution','design','testplan_design'); - - /** - * @var array Define type of custom fields managed. - * Values will be displayed in "Custom Field Type" combo box when - * users create custom fields. No localization is applied - * - * - * Added specific type for test automation related custom fields. - * Start at code 500 - */ - var $custom_field_types = array(0=>'string', - 1=>'numeric', - 2=>'float', - 4=>'email', - 5=>'checkbox', - 6=>'list', - 7=>'multiselection list', - 8=>'date', - 9=>'radio', - 10=>'datetime', - 20=>'text area', - 500=>'script', - 501=>'server'); - - /** - * @var array Configures for what type of CF "POSSIBLE_VALUES" field need to be manage at GUI level - * Keys of this map must be the values present in: - * $this->custom_field_types - */ - var $possible_values_cfg = array('string' => 0, - 'numeric'=> 0, - 'float'=> 0, - 'email'=> 0, - 'checkbox' => 1, - 'list' => 1, - 'multiselection list' => 1, - 'date' => 0, - 'radio' => 1, - 'datetime' =>0, - 'text area' => 0, - 'script'=> 0, - 'server' => 0); - - /** @var array only the types listed here can have custom fields */ - var $node_types = array('build','testsuite','testplan','testcase','requirement_spec','requirement'); - - /** - * @var map of maps $locations - * - * Location is place on page where to display custom field. - * This concept has been created to implement a user contribution, that allows for - * test cases, display custom fields in a different location (standard location is after - * all test case definition), to implemente Prerequisites using CF. - * - * First map key: node type: 'testcase','testsuite', etc. - * Each element will be a map with following structure: - * key:Holds string keys used on this object and pages that manages CF. - * current options: 1 -> standard location, i.e. work as done before this implementation. - * 2 -> before steps and results, => between summary and steps/results. - * - * value: used to get translated label to use on User Interface. - * - * IMPORTANT: if you add a new key, this values are used as access keys in several properties of this object. - * then if you add one here, remember to update other properties. - */ - var $locations = [ - 'testcase' => [ - 1 => 'standard_location', - 2 => 'before_steps_results', - 3 => 'before_summary', - 4 => 'before_preconditions', - 5 => 'after_title', - 6 => 'after_summary', - 7 => 'after_preconditions', - 8 => 'hide_because_is_used_as_variable' /* use when you will use the custom field as a variable [tlVar][/tlvar] */ - ] - ]; - - // changes in configuration - // - // Needed to manage user interface, when creating Custom Fields. - // When user choose a item type (test case, etc), a javascript logic - // uses this information to hide/show enable_on, and show_on combos. - // - // 0 => combo will not displayed - // - // May be need a review, because after the changes, seems a little bit silly. - var $enable_on_cfg = array('execution' => array('build' => 0, 'testsuite' => 0, - 'testplan' => 0,'testcase' => 1, - 'requirement_spec' => 0,'requirement' => 0), - 'design' => array('build' => 0,'testsuite' => 0, - 'testplan' => 0,'testcase' => 1, - 'requirement_spec' => 0,'requirement' => 0), - 'testplan_design' => array('build' => 0,'testsuite' => 0, - 'testplan' => 0,'testcase' => 1, - 'requirement_spec' => 0,'requirement' => 0)); - - // 0 => combo will not displayed - var $show_on_cfg=array('execution'=>array('testsuite' => 1, - 'testplan' => 1, - 'testcase' => 1, - 'build' => 1, - 'requirement_spec' => 0, - 'requirement' => 0 ), - 'design' => array('testsuite' => 1, - 'testplan' => 1, - 'testcase' => 1, - 'build' => 0, - 'requirement_spec' => 0, - 'requirement' => 0 ), - 'testplan_design' => array('testsuite' => 1, - 'testplan' => 1, - 'testcase' => 1, - 'build' => 0, - 'requirement_spec' => 0, - 'requirement' => 0 ) - ); - - // the name of html input will have the following format - // __ - // - var $name_prefix='custom_field_'; - var $sizes = null; - - // must be equal to the lenght of: - // value column on cfield_*_values tables - // default_value column on custom_fields table - // 0 -> no limit - // Is used on text area types - var $max_length_value; - - // must be equal to the lenght of: - // possible_values column on custom_fields table - // 0 -> no limit - var $max_length_possible_values; - - var $decode; - var $html_date_input_suffix = array('input' => true,'hour' => true, - 'minute' => true,'second' => true); - - /** - * Class constructor - * - * @param resource &$db reference to the database handler - */ - function __construct(&$db) - { - parent::__construct(); - - $this->db = &$db; - $this->tree_manager = new tree($this->db); - - $cfConfig = config_get('custom_fields'); - $this->sizes = $cfConfig->sizes; - - - - if( property_exists($cfConfig,'types') && !is_null($cfConfig->types) ) - { - $this->custom_field_types +=$cfConfig->types; - ksort($this->custom_field_types); - } - - if( property_exists($cfConfig,'possible_values_cfg') && - !is_null($cfConfig->possible_values_cfg) ) - { - $this->possible_values_cfg +=$cfConfig->possible_values_cfg; - } - $this->object_table=$this->tables["custom_fields"]; - - $this->max_length_value = $cfConfig->max_length; - $this->max_length_possible_values = $this->max_length_value; - - $this->decode['nodes'] = $this->tree_manager->get_available_node_types(); - - - } - - - function getSizeLimit() - { - return $this->max_length_value; - } - - - function get_application_areas() - { - return($this->application_areas); - } - - /** - * @return hash with available locatipons - * - * - */ - function getLocations() - { - return $this->locations; - } - - - /** - * @return hash with custom field available types - * key: numeric id - * value: short description - */ - function get_available_types() - { - return($this->custom_field_types); - } - - /** - * @return string - */ - function get_name_prefix() { - return $this->name_prefix ; - } - - /** - * @return hash with node types id, that can have custom fields. - * key: short description (node_types.description) - * value: node_type_id (node_types.id) - */ - function get_allowed_nodes() - { - $allowed_nodes = array(); - foreach($this->node_types as $verbose_type ) - { - $allowed_nodes[$verbose_type] = $this->decode['nodes'][$verbose_type]; - } - return $allowed_nodes; - } - - /** - * @return hash with node types id, that can have custom fields with enabled_on_$ui_mode. - * key : node_type_id (node_types.id) - * value: 1 -> enable on exec can be configured by user - */ - function get_enable_on_cfg($ui_mode) - { - $mgmt_cfg=array(); - $mgmt_cfg=$this->_get_ui_mgtm_cfg_for_node_type($this->enable_on_cfg[$ui_mode]); - return($mgmt_cfg); - } - - - function get_show_on_cfg($ui_mode) - { - $mgmt_cfg=array(); - $mgmt_cfg=$this->_get_ui_mgtm_cfg_for_node_type($this->show_on_cfg[$ui_mode]); - return($mgmt_cfg); - } - - - /* - function: _get_ui_mgtm_cfg_for_node_type - utility method - - returns: hash with node types id. - key : node_type_id (node_types.id) - value: 1 -> enable on exec can be configured by user - - - */ - function _get_ui_mgtm_cfg_for_node_type($map_node_id_cfg) - { - $enabled_mgmt = array(); - $tl_node_types = $this->decode['nodes']; - foreach($this->node_types as $verbose_type) - { - $type_id = $tl_node_types[$verbose_type]; - if( isset($map_node_id_cfg[$verbose_type]) ) - { - $enabled_mgmt[$type_id]=$map_node_id_cfg[$verbose_type]; - } - } - return $enabled_mgmt; - } - - - - /* - function: get_possible_values_cfg - - returns: hash - key : cf_type_id (see $custom_field_types) - value: 1 -> possible values can be managed on UI. - - - */ - function get_possible_values_cfg() - { - $pv_cfg=array(); - $custom_field_types_id=array_flip($this->custom_field_types); - - foreach($this->possible_values_cfg as $verbose_cf_type => $use_on_ui) - { - $cf_type_id=$custom_field_types_id[$verbose_cf_type]; - $pv_cfg[$cf_type_id]=$use_on_ui; - } - return($pv_cfg); - } - - /** - * - */ - function getLinkedCfieldsAtDesign($context,$filters=null,$access_key='id') { - - // $context - $ctx = array('tproject_id' => null, 'enabled' => true, 'node_type' => null, - 'node_id' => null); - $ctx = array_merge($ctx,$context); - if( null == $ctx['tproject_id'] ) { - throw new Exception(__METHOD__ . ' EXCEPTION: test project ID, is mandatory'); - } - - extract($ctx); - - return $this->get_linked_cfields_at_design($tproject_id, - $enabled,$filters, - $node_type,$node_id,$access_key); - - } - - - - - /* - function: get_linked_cfields_at_design - returns information about custom fields that can be used - at least at design time, with the value assigned (is any has been assigned). - - - $tproject_id: needed because is possible to associate/link - a different set of custom field for every test project - - $enabled : 1 -> get custom fields that are has been configured - to be shown during specification design AND are enabled. - - Remember that also exist custom fields - that can be only used during TEST CASE EXECUTION. - - [$filters]:default: null - map with keys: - [show_on_execution]: 1 -> filter on field show_on_execution=1 - 0 or null or not exists -> don't filter - - [show_on_testplan_design]: 1 -> filter on field show_on_execution=1 - 0 or null or not exists -> don't filter - - [cfield_id]: if exists use it's value to filter on custom field id - null or not exists -> don't filter - - [location]: new concept used to define on what location on screen - custom field will be designed. - Initally used with CF available for Test cases, to - implement pre-requisites. - null => no filtering - - [$node_type]: default: null - verbose id ('testcase', 'testsuite', etc) of a node type. - custom fields are linked also to different node types. - Example: - I can define a custom field "Aspect" with values - Performace, Usability and wnat use it only for test suites. - - [$node_id]: default: null - identification of a node/element on node hierarchy. - Needed when I want to get the value of custom fields - linked to a node. - Example: - Have two test cases (ID:9999, ID:89800), and want to get - the value assigned to custom field "Operating System". - I will do two calls to this method. - - [$access_key]: default id, field name to use as access key in returned hash - - returns: hash - key: custom field id - - - rev : - - */ - function get_linked_cfields_at_design($tproject_id,$enabled, - $filters=null,$node_type=null,$node_id=null, - $access_key='id') - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $additional_join=""; - $additional_values=""; - $additional_filter=""; - - switch ($access_key) { - case 'id': - case 'node_id': - case 'name': - break; - - default: - $access_key = 'id'; - break; - } - - switch($node_type) { - case 'build': - $table_key = 'cfield_build_design_values'; - break; - - default: - $table_key = 'cfield_design_values'; - break; - } - - if( !is_null($node_type) ) { - $additional_join .= - " JOIN {$this->tables['cfield_node_types']} CFNT - ON CFNT.field_id=CF.id AND CFNT.node_type_id=" . - $this->db->prepare_int($this->decode['nodes'][$node_type]); - } - - $targetIsArray = false; - if( !is_null($node_id) ) { - $additional_values .= ",CFDV.value AS value,CFDV.node_id AS node_id"; - - if( is_array($node_id) ) { - $targetIsArray = true; - $sane = array_map('intval', $node_id); - $inClause = implode(',',$sane); - } else { - $inClause = $this->db->prepare_int($node_id); - } - - $additional_join .= - " LEFT OUTER JOIN {$this->tables[$table_key]} CFDV ON CFDV.field_id=CF.id - AND CFDV.node_id IN ($inClause) "; - } - - $locFilter = []; - $replaceLocation = false; - $targetLocationCode = 0; - - if (!is_null($filters)) { - if (isset($filters['show_on_execution']) && - !is_null($filters['show_on_execution']) ) { - $additional_filter .= " AND CF.show_on_execution=1 "; - } - - // Probably this piece need to be changed to act on enable_on_ attribute - // due to CF display logic refactoring - // if( isset($filters['show_on_testplan_design']) && !is_null($filters['show_on_testplan_design']) ) - // { - // $additional_filter .= " AND CF.show_on_testplan_design=1 "; - // } - if (isset($filters['show_on_testplan_design']) && - !is_null($filters['show_on_testplan_design'])) { - $additional_filter .= " AND CF.enable_on_testplan_design=1 "; - } - - if( isset($filters['cfield_id']) && !is_null($filters['cfield_id']) ) - { - $additional_filter .= " AND CF.id = {$filters['cfield_id']} "; - } - - $filterKey='location'; - if( isset($filters[$filterKey]) && !is_null($filters[$filterKey]) ) { - $locFilter = (array)$filters[$filterKey]; - $additional_filter .= " AND CFTP.$filterKey IN(" . implode(",",$locFilter ) . ") "; - - if ( $replaceLocation = (count($locFilter) > 1) ) { - $locMap = $this->buildLocationMap('testcase'); - $targetLocationCode = " {$locMap['standard_location']['location']} AS location "; - } - } - } - $sql = "/* $debugMsg */ SELECT CF.*,CFTP.display_order,CFTP.location,CFTP.required "; - if ($replaceLocation) { - $sql = str_replace('CFTP.location', $targetLocationCode,$sql); - } - - $sql .= $additional_values . - " FROM {$this->object_table} CF " . - " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . - $additional_join . - " WHERE CFTP.testproject_id=" . intval($tproject_id) . - " AND CFTP.active=1 AND CF.show_on_design=1 " . - " AND CF.enable_on_design={$enabled} " . - $additional_filter . - " ORDER BY display_order,CF.id "; - - - if ( $targetIsArray ) { - // # 0008792: Tl 1.9.20 (dev) >> Requirement overview >> Custom field content displayed in wrong column - // - // $map = $this->db->fetchArrayRowsIntoMap($sql,$access_key); - $map = $this->db->fetchMapRowsIntoMap($sql,$access_key,'id'); - } else { - $map = $this->db->fetchRowsIntoMap($sql,$access_key); - } - - return $map; - } - - - /* - ==================================================================== - ** Very Imporant ** - This code is based on Mantis code. - Initial development was based on 1.x.x versions. - file:custom_field_api.php - function:print_custom_field_input() - - 20080815: some changes are done to add more flexibility, and idea - was compared with 1.2.0a1 Mantis implementation. - ==================================================================== - - function: string_custom_field_input - returns an string with the html needed to display the custom field. - - If no specific code is found to manage a custom field type, - it will be used code that manage string type. - - args: $p_field_def: contains the definition of the custom field - (including it's field id) - - [$name_suffix]: if used must start with _. - example _TCID017 - - returns: html string - - rev : - */ - function string_custom_field_input($p_field_def,$opt = null) - { - $options = array('name_suffix' => '', 'field_size' => 0, 'show_on_filters' => false, 'remove_required' => false); - $options = array_merge($options,(array)$opt); - extract($options); - - $str_out=''; - - $cfValue = $p_field_def['default_value']; - if( isset($p_field_def['value']) ) - { - $cfValue = $p_field_def['value']; - } - - $verbose_type=trim($this->custom_field_types[$p_field_def['type']]); - $cfValue = htmlspecialchars($cfValue); - $input_name = $this->buildHTMLInputName($p_field_def,$name_suffix); - $size = isset($this->sizes[$verbose_type]) ? intval($this->sizes[$verbose_type]) : 0; - - if($options['remove_required']) - { - $required = ' class="" '; - } - else - { - $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; - } - - $dateOpt = array('default_disable' => false, 'allow_blank' => true, 'required' => $required, - 'show_on_filters' => $show_on_filters); - - if( $field_size > 0) - { - $size=$field_size; - } - - switch ($verbose_type) - { - case 'list': - case 'multiselection list': - $t_values = explode( '|', $p_field_def['possible_values']); - $t_values_count = count($t_values); - $window_size = intval($size); - if($t_values_count < $window_size) - { - $window_size = $t_values_count; - } - - if( $verbose_type == 'list' ) - { - // get maximum allowed window size for lists - // $window_size = intval($size) > 1 ? $size : self::LISTBOX_WINDOW_SIZE; - $t_multiple=' '; - $t_name_suffix=''; - } - else - { - $t_name_suffix='[]'; - $t_multiple=' multiple="multiple" '; - } - - // set the list size to the number of possible values of custom field - // but respect the maximum window size - $t_list_size = $t_values_count; - if($t_list_size > $window_size) - { - $t_list_size=$window_size; - } - - $html_identity=$input_name . $t_name_suffix; - $str_out .= ''; - break; - - case 'checkbox': - $t_values = explode( '|', $p_field_def['possible_values']); - $t_checked_values = explode( '|', $cfValue); - foreach( $t_values as $t_option ) - { - $str_out .= ' ' . $t_option . '  '; - } - else - { - $str_out .= ' value="' . $t_option . '"> ' . $t_option . '  '; - } - - } - break; - - case 'string': - case 'email': - case 'float': - case 'numeric': - $str_out .= $this->string_input_string($p_field_def,$input_name,$cfValue,$size,$options); - break ; - - case 'text area': - $cols = intval($this->sizes['text area']['cols']); - $rows = intval($this->sizes['text area']['rows']); - if($cols <= 0) - { - $cols = self::TEXTAREA_DEFAULT_COLS; - } - if($rows <= 0) - { - $rows = self::TEXTAREA_DEFAULT_ROWS; - } - - if( $this->max_length_value > 0 ) - { - $counterId = $input_name . '_counter'; - $cf_current_size = $this->max_length_value - tlStringLen($cfValue); - - // call JS function for check max. size from validate.js - $js_function = '"textCounter(this.form.' . $input_name . - ',document.getElementById(\''. $counterId.'\'),' . $this->max_length_value .');" '; - - $str_out .= '\n"; - - // show character counter - $str_out .= '
    ' . - sprintf(lang_get('text_counter_feedback'), $this->max_length_value) . - ' '.$cf_current_size.'.
    '; - } - else - { - // unlimited - $str_out .= '\n"; - - } - break; - - case 'date': - $str_out .= create_date_selection_set($input_name,config_get('date_format'),$cfValue,$dateOpt); - break; - - case 'datetime': - $cfg=config_get('gui'); - - // Important - // We can do this mix (get date format configuration from standard variable - // and time format from an specific custom field config) because string used - // for date_format on strftime() has no problem - // on date() calls (that are used in create_date_selection_set() ). - $format = config_get('date_format') . " " . $cfg->custom_fields->time_format; - $str_out .=create_date_selection_set($input_name,$format,$cfValue,$dateOpt); - break; - - - default: - $dynamic_call='string_input_' . str_replace(' ', '_', $verbose_type); - if( function_exists($dynamic_call) ) - { - $str_out .= $dynamic_call($p_field_def, $input_name, $cfValue); - } - else if( method_exists($this, $dynamic_call) ) - { - $str_out .= $this->$dynamic_call($p_field_def, $input_name, $cfValue); - } - else - { - // treat it as an simple string - $str_out .= $this->string_input_string($p_field_def,$input_name,$cfValue,$size,$options); - } - break; - - - } - return ($str_out); - } //function end - - - /* - function: design_values_to_db - write values of custom fields that are used at design time. - - args: $hash: contains info about CF gathered at user interface. - (normally $_REQUEST variable) - key: custom_field__. - Example custom_field_0_67 -> 0=> string field - - $node_id: - [$cf_map]: hash -> all the custom fields linked and enabled - that are applicable to the node type of $node_id. - - For the keys not present in $hash, we will write - an appropriate value according to custom field - type. - - This is needed because when trying to udpate - with hash being $_REQUEST, $_POST or $_GET - some kind of custom fields (checkbox, list, multiple list) - when has been deselected by user. - - - rev: - */ - function design_values_to_db($hash,$node_id,$cf_map=null,$hash_type=null,$node_type=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if( is_null($hash) && is_null($cf_map) ) { - return; - } - - $cfield=$hash; - if( is_null($hash_type) ) { - $cfield=$this->_build_cfield($hash,$cf_map); - } - - if( !is_null($cfield) ) { - switch($node_type) { - case 'build': - $table_key = 'cfield_build_design_values'; - break; - - default: - $table_key = 'cfield_design_values'; - break; - } - - $safeNodeID = intval($node_id); - foreach($cfield as $field_id => $type_and_value) { - $value = $type_and_value['cf_value']; - - // do I need to update or insert this value? - $sql = "/* $debugMsg */ SELECT value FROM {$this->tables[$table_key]} " . - " WHERE field_id=" . intval($field_id) . " AND node_id=" . $safeNodeID; - - $result = $this->db->exec_query($sql); - - // max_length_value = 0 => no limit - if( $this->max_length_value > 0 && tlStringLen($value) > $this->max_length_value) { - $value = substr($value,0,$this->max_length_value); - } - - $safe_value = $this->db->prepare_string($value); - $rowCount = $this->db->num_rows($result); - if( $rowCount > 0 ) { - if( $value != "" ) { - $sql = "/* $debugMsg */ UPDATE {$this->tables[$table_key]} " . - " SET value='{$safe_value}' "; - } - else { - // bye, bye record - $sql = "/* $debugMsg */ DELETE FROM {$this->tables[$table_key]} "; - } - $sql .= " WHERE field_id=" . intval($field_id) . " AND node_id=" . $safeNodeID; - $this->db->exec_query($sql); - } - else if ($rowCount == 0 && $value != "") { - # Remark got from Mantis code: - # Always store the value, even if it's the dafault value - # This is important, as the definitions might change but the - # values stored with a bug must not change - $sql = "/* $debugMsg */ INSERT INTO {$this->tables[$table_key]} " . - " ( field_id, node_id, value ) " . - " VALUES ( " . intval($field_id) . ", {$safeNodeID}, '{$safe_value}' )"; - $this->db->exec_query($sql); - } - } //foreach($cfield - } //if( !is_null($cfield) ) - } //function end - - - - /* - function: remove_all_design_values_from_node - remove the values of ALL custom fields linked to - a node. (example test case 5555) - - args: $node_id: single value or array - - returns: - - - rev : - 20070102 - franciscom - $node_id can be an array - - */ - function remove_all_design_values_from_node($node_id,$node_type=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - switch($node_type) - { - case 'build': - $table_key = 'cfield_build_design_values'; - break; - - default: - $table_key = 'cfield_design_values'; - break; - } - - $sql = "/* $debugMsg */ DELETE FROM {$this->tables[$table_key]} "; - if( is_array($node_id) ) - { - $sql .= " WHERE node_id IN(" . implode(",",$node_id) . ") "; - } - else - { - $sql .= " WHERE node_id=" . intval($node_id); - } - - $this->db->exec_query($sql); - } - - - /* - function: get_all - get the definition of all custom field defined in the system, - or all custom fields with id not included in $id2exclude. - - args: [$id2exclude]: array with custom field ids - - returns: hash: - key: custom field id - - */ - function get_all($id2exclude=null,$opt=null) - { - static $lbl; - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(!$lbl) - { - $lbl = init_labels(array('context_design' => null,'context_exec' => null, - 'context_testplan_design' => null)); - } - - $not_in_clause=""; - if( !is_null($id2exclude) ) - { - $not_in_clause=" AND CF.id NOT IN (" .implode(',',$id2exclude) .") "; - } - $sql="SELECT CF.*,NT.description AS node_description,NT.id AS node_type_id " . - " FROM {$this->object_table} CF, " . - " {$this->tables['cfield_node_types']} CFNT, " . - " {$this->tables['node_types']} NT " . - " WHERE CF.id=CFNT.field_id " . - " AND NT.id=CFNT.node_type_id " . - $not_in_clause . - " ORDER BY CF.name"; - - $map = $this->db->fetchRowsIntoMap($sql,'id'); - if(!is_null($map) && !is_null($opt)) - { - $k2l = array_keys($map); - foreach($k2l as $key) - { - $map[$key]['enabled_on_context'] = ''; - if($map[$key]['enable_on_design']) - { - $map[$key]['enabled_on_context'] = $lbl['context_design']; - } - else if($map[$key]['enable_on_execution']) - { - $map[$key]['enabled_on_context'] = $lbl['context_exec']; - } - else if($map[$key]['enable_on_testplan_design']) - { - $map[$key]['enabled_on_context'] = $lbl['context_testplan_design']; - } - } - } - - return $map; - } - - /* - function: get_linked_to_testproject - get definition of all custom fields linked to a test project. - - - args: $tproject_id - [$active]: if not null will add the following filter " AND CFTP.active={$active}" - - returns: hash: - key: custom field id - - internal revision: - */ - function get_linked_to_testproject($tproject_id,$active=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('name' => null); - $options = array_merge($options,(array)$opt); - - - $sql="SELECT CF.*,NT.description AS node_description,NT.id AS node_type_id, " . - " CFTP.display_order, CFTP.active, CFTP.location,CFTP.required,CFTP.monitorable " . - " FROM {$this->object_table} CF, " . - " {$this->tables['cfield_testprojects']} CFTP, " . - " {$this->tables['cfield_node_types']} CFNT, " . - " {$this->tables['node_types']} NT " . - " WHERE CF.id=CFNT.field_id " . - " AND CF.id=CFTP.field_id " . - " AND NT.id=CFNT.node_type_id " . - " AND CFTP.testproject_id=" . $this->db->prepare_int($tproject_id); - - if( !is_null($active) ) - { - $sql .= " AND CFTP.active={$active} "; - } - - if( !is_null($options['name']) ) - { - $sql .= " AND CF.name='" . $this->db->prepare_string($options['name']) . "'"; - } - - $sql .= " ORDER BY NT.description,CF.enable_on_design desc, " . - " CF.enable_on_execution desc, " . - " CF.enable_on_testplan_design desc,". - " CFTP.display_order, CF.name"; - - $map = $this->db->fetchRowsIntoMap($sql,'id'); - return $map; - } - - - /* - function: link_to_testproject - - - - args: $tproject_id - $cfields_id: array() - - returns: - - */ - function link_to_testproject($tproject_id,$cfield_ids) - { - if(is_null($cfield_ids)) - { - return; - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeID = intval($tproject_id); - $tproject_info = $this->tree_manager->get_node_hierarchy_info($safeID); - foreach($cfield_ids as $field_id) - { - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['cfield_testprojects']} " . - " (testproject_id,field_id) " . - " VALUES({$safeID},{$field_id})"; - - if ($this->db->exec_query($sql)) - { - $cf = $this->get_by_id($field_id); - if ($cf) - { - logAuditEvent(TLS("audit_cfield_assigned",$cf[$field_id]['name'],$tproject_info['name']), - "ASSIGN",$tproject_id,"testprojects"); - } - } - } - } - - - /* - function: set_active_for_testproject - set the value of active field - - - args: $tproject_id - $cfields_id: array() - $active_val: 1/0 - - returns: - - */ - function set_active_for_testproject($tproject_id,$cfield_ids,$active_val) - { - if(is_null($cfield_ids)) - { - return; - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $tproject_info = $this->tree_manager->get_node_hierarchy_info($tproject_id); - $auditMsg = $active_val ? "audit_cfield_activated" : "audit_cfield_deactivated"; - foreach($cfield_ids as $field_id) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . - " SET active={$active_val} " . - " WHERE testproject_id=" . $this->db->prepare_int($tproject_id) . - " AND field_id=" . $this->db->prepare_int($field_id); - - if ($this->db->exec_query($sql)) - { - $cf = $this->get_by_id($field_id); - if ($cf) - { - logAuditEvent(TLS($auditMsg,$cf[$field_id]['name'],$tproject_info['name']), - "SAVE",$tproject_id,"testprojects"); - } - } - } - } //function end - - - /** - * - */ - function setRequired($tproject_id,$cfieldSet,$val) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($cfieldSet)) - { - return; - } - - $safe = new stdClass(); - $safe->tproject_id = intval($tproject_id); - $safe->val = (intval($val) > 0) ? 1 : 0; - - $info = $this->tree_manager->get_node_hierarchy_info($safe->tproject_id); - $auditMsg = $val ? "audit_cfield_required_on" : "audit_cfield_required_off"; - foreach($cfieldSet as $field_id) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . - " SET required=" . $safe->val . - " WHERE testproject_id=" . $safe->tproject_id . - " AND field_id=" . $this->db->prepare_int($field_id); - - if ($this->db->exec_query($sql)) - { - $cf = $this->get_by_id($field_id); - if($cf) - { - logAuditEvent(TLS($auditMsg,$cf[$field_id]['name'],$info['name']), - "SAVE",$safe->tproject_id,"testprojects"); - } - } - } - } //function end - - - - /** - * unlink_from_testproject - * remove custom field links from target test project - * N.B.: following Mantis Bugtracking System model, - * this operation will NOR remove all values assigned to - * these custom fields . - * - * @param int $tproject_id - * @param array $cfield_ids - * - */ - function unlink_from_testproject($tproject_id,$cfield_ids) - { - if(is_null($cfield_ids)) - { - return; - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $tproject_info = $this->tree_manager->get_node_hierarchy_info($tproject_id); - foreach($cfield_ids as $field_id) - { - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testprojects']} " . - " WHERE field_id = " . $this->db->prepare_int($field_id) . - " AND testproject_id = " . $this->db->prepare_int($tproject_id); - if ($this->db->exec_query($sql)) - { - $cf = $this->get_by_id($field_id); - if ($cf) - { - logAuditEvent(TLS("audit_cfield_unassigned",$cf[$field_id]['name'],$tproject_info['name']), - "ASSIGN",$tproject_id,"testprojects"); - } - } - } - } //function end - - - - /* - function: get_by_name - get custom field definition - - args: $name: custom field name - - returns: hash - */ - function get_by_name($name) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my_name=$this->db->prepare_string(trim($name)); - - $sql="/* $debugMsg */ SELECT CF.*, CFNT.node_type_id,NT.description AS node_type" . - " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT," . - " {$this->tables['node_types']} NT" . - " WHERE CF.id=CFNT.field_id " . - " AND CFNT.node_type_id=NT.id " . - " AND name='{$my_name}' "; - return $this->db->fetchRowsIntoMap($sql,'id'); - } - - /* - function: get_by_id - get custom field definition - - args: $id: custom field id - - returns: hash - - */ - function get_by_id($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT CF.*, CFNT.node_type_id" . - " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT" . - " WHERE CF.id=CFNT.field_id " . - " AND CF.id IN (" . implode(',',(array)$id) . ")"; - return($this->db->fetchRowsIntoMap($sql,'id')); - } - - /* - function: get_available_item_type - get information about what item type (testcase,testplan, etc) - can use this custom field - - args: $id: custom field id - - returns: - - */ - function get_available_item_type($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT CFNT.field_id,CFNT.node_type_id ". - " FROM {$this->tables['cfield_node_types']} CFNT, " . - " {$this->tables['nodes_types']} NT " . - " WHERE NT.id=CFNT.node_type_id " . - " CFNt.field_id=" . $this->db->prepare_int($id); - - return($this->db->fetchRowsIntoMap($sql,'field_id')); - } - - - /* - * - * keys name -> trim will be applied - * label -> trim will be applied - * type -> intval() wil be applied - * possible_values - * show_on_design -> trasformation on 1/0 using intval() [*] - * enable_on_design -> [*] - * show_on_execute -> [*] - * enable_on_execute -> [*] - * show_on_testplan_design -> [*] - * enable_on_testplan_design -> [*] - * - */ - function sanitize($cf) - { - $safe = $cf; - - // remove the standard set of characters considered harmful - // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab - // "\r" - carriage return - // and spaces - // fortunatelly this is trim standard behaviour - $k2san = array('name','label'); - foreach($k2san as $key) - { - $safe[$key] = $this->db->prepare_string(trim($cf[$key])); - } - - // seems here is better do not touch. - $safe['possible_values'] = $this->db->prepare_string($cf['possible_values']); - - $onezero = array('show_on_design','enable_on_design','show_on_testplan_design', - 'enable_on_testplan_design','show_on_execution','enable_on_execution'); - - foreach($onezero as $key) - { - $safe[$key] = intval($cf[$key]) > 0 ? 1 : 0; - } - - $safe['type'] = intval((int)$cf['type']); - $safe['node_type_id'] = intval((int)$cf['node_type_id']); - return $safe; - } - - /* - function: create a custom field - - args: $hash: - keys name -> trim will be applied - label -> trim will be applied - type -> intval() wil be applied - possible_values - show_on_design -> trasformation on 1/0 using intval() [*] - enable_on_design -> [*] - show_on_execute -> [*] - enable_on_execute -> [*] - show_on_testplan_design -> [*] - enable_on_testplan_design -> [*] - node_type_id - - returns: - - - rev: - @internal revision - */ - function create($cf) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => 'ko'); - - $safecf = $this->sanitize($cf); - - // if CF is for BUILD force enable_on_execution ALWAYS FALSE - // Node Verbose Code / Node Code Verbose - $nvc = $this->tree_manager->get_available_node_types(); - $ncv = array_flip($nvc); - if($ncv[$safecf['node_type_id']] == 'build') - { - $safecf['enable_on_design'] = 1; - $safecf['enable_on_execution'] = 0; - } - - $sql="/* $debugMsg */ INSERT INTO {$this->object_table} " . - " (name,label,type,possible_values, " . - " show_on_design,enable_on_design, " . - " show_on_testplan_design,enable_on_testplan_design, " . - " show_on_execution,enable_on_execution) " . - " VALUES('" . $safecf['name'] . "','" . $safecf['label'] . "'," . - intval($safecf['type']) . ",'" . $safecf['possible_values'] . "', " . - " {$safecf['show_on_design']},{$safecf['enable_on_design']}," . - " {$safecf['show_on_testplan_design']},{$safecf['enable_on_testplan_design']}," . - " {$safecf['show_on_execution']},{$safecf['enable_on_execution']})"; - $result=$this->db->exec_query($sql); - - if ($result) - { - // at least for Postgres DBMS table name is needed. - $field_id=$this->db->insert_id($this->object_table); - - $sql="/* $debugMsg */ INSERT INTO {$this->tables['cfield_node_types']} " . - " (field_id,node_type_id) " . - " VALUES({$field_id},{$safecf['node_type_id']}) "; - $result=$this->db->exec_query($sql); - } - - if ($result) - { - $ret = array('status_ok' => 1, 'id' => $field_id, 'msg' => 'ok'); - } - return $ret; - } - - - - - /* - function: update a custom field - - args: $hash: - keys name - label - type - possible_values - show_on_design - enable_on_design - show_on_execute - enable_on_execute - show_on_testplan_design - enable_on_testplan_design - node_type_id - - returns: - - */ - function update($cf) - { - $safecf = $this->sanitize($cf); - - // if CF is for BUILD force enable_on_execution ALWAYS FALSE - // Node Verbose Code / Node Code Verbose - $nvc = $this->tree_manager->get_available_node_types(); - $ncv = array_flip($nvc); - if($ncv[$safecf['node_type_id']] == 'build') - { - $safecf['enable_on_design'] = 1; - $safecf['enable_on_execution'] = 0; - } - - $sql = "UPDATE {$this->tables['custom_fields']} " . - " SET name='" . $safecf['name'] . "'," . - " label='" . $safecf['label'] . "'," . - " type={$safecf['type']}," . - " possible_values='" . $safecf['possible_values'] . "'," . - " show_on_design={$safecf['show_on_design']}," . - " enable_on_design={$safecf['enable_on_design']}," . - " show_on_testplan_design={$safecf['show_on_testplan_design']}," . - " enable_on_testplan_design={$safecf['enable_on_testplan_design']}," . - " show_on_execution={$safecf['show_on_execution']}," . - " enable_on_execution={$safecf['enable_on_execution']}" . - " WHERE id={$safecf['id']}"; - $result = $this->db->exec_query($sql); - - if ($result) - { - $sql = "UPDATE {$this->tables['cfield_node_types']} " . - " SET node_type_id={$safecf['node_type_id']}" . - " WHERE field_id={$safecf['id']}"; - $result = $this->db->exec_query($sql); - } - return $result ? 1 : 0; - } - - - /** - * delete() - * Will delete custom field definition and also ALL assigned values - * If custom field is linked to test projects, these links must be removed - * - */ - function delete($id) - { - // Before deleting definition I need to remove values - if( $this->is_used($id) ) - { - $this->remove_all_scopes_values($id); - } - $linked_tprojects = $this->get_linked_testprojects($id); - if( !is_null($linked_tprojects) && count($linked_tprojects) > 0 ) - { - $target=array_keys($linked_tprojects); - foreach($target as $tproject_id) - { - $this->unlink_from_testproject($tproject_id,(array)$id); - } - } - - $sql="DELETE FROM {$this->tables['cfield_node_types']} WHERE field_id={$id}"; - $result=$this->db->exec_query($sql); - if($result) - { - $sql="DELETE FROM {$this->tables['custom_fields']} WHERE id={$id}"; - $result=$this->db->exec_query($sql); - } - return $result ? 1 : 0; - } - - - /* - function: is_used - - args: $id: custom field id - - returns: 1/0 - - @used by cfieldsEdit.php, cfieldsEdit.tpl - - */ - function is_used($id) - { - $sql="SELECT field_id FROM {$this->tables['cfield_design_values']} " . - "WHERE field_id={$id} " . - "UNION " . - "SELECT field_id FROM {$this->tables['cfield_build_design_values']} " . - "WHERE field_id={$id} " . - "UNION " . - "SELECT field_id FROM {$this->tables['cfield_testplan_design_values']} " . - "WHERE field_id={$id} " . - "UNION " . - "SELECT field_id FROM {$this->tables['cfield_execution_values']} " . - "WHERE field_id={$id} "; - $result=$this->db->exec_query($sql); - return($this->db->num_rows( $result ) > 0 ? 1 : 0); - } //function end - - -/* - function: name_is_unique - - args: $id - $name - - returns: 1 => name is unique -*/ -function name_is_unique($id,$name) -{ - $cf=$this->get_by_name($name); - $status=0; - if( is_null($cf) || isset($cf[$id]) ) - { - $status=1; - } - return($status); -} //function end - - - - # -------------------- - # Adapted from Mantis code - # Prepare a string containing a custom field value for display - # $p_field_def definition of the custom field - # $p_node_id bug id to display the custom field value for - # - # [$p_value_field]: field id, to point to the field value in $p_field_def - function string_custom_field_value( $p_field_def, $p_node_id,$p_value_field='value') - { - $t_value = isset($p_field_def[$p_value_field]) ? $p_field_def[$p_value_field] : null; - $cfValue = htmlspecialchars($t_value); - - switch ($this->custom_field_types[intval($p_field_def['type'])]) - { - case 'email': - return "$cfValue"; - break; - - case 'enum': - case 'list': - case 'multiselection list': - case 'checkbox': - return str_replace( '|', ', ', $cfValue ); - break; - - case 'date': - if ($cfValue != null) - { - // must remove % - $t_date_format=str_replace("%","",config_get( 'date_format')); - $xdate=date( $t_date_format, $cfValue); - return $xdate; - } - break ; - - case 'datetime': - if ($cfValue != null) - { - // must remove % - // $t_date_format=str_replace("%","",config_get( 'timestamp_format')); - // $datetime_format=$t_date_format; - $t_date_format=str_replace("%","",config_get( 'date_format')); - $cfg=config_get('gui'); - $datetime_format=$t_date_format . " " . $cfg->custom_fields->time_format; - $xdate=date($datetime_format, $cfValue); - return $xdate; - } - break ; - - - case 'text area': - if ($cfValue != null) - { - return nl2br($cfValue); - } - break; - - case 'string': - return string_display_links($cfValue); - break; - - default: - // done this way in order to be able to debug if needed - return string_display_links($cfValue); - break; - } - } - - - - /* - function: get_linked_cfields_at_execution - returns information about custom fields that can be used - at least at executed, with the value assigned (is any has been assigned). - - - $tproject_id: needed because is possible to associate/link - a different set of custom field for every test project - - $enabled : 1 -> get custom fields that are has been configured - to be shown during test case execution AND are enabled. - - [$node_type]: default: null - verbose id ('testcase', 'testsuite', etc) of a node type. - custom fields are linked also to different node types. - Example: - I can define a custom field "Aspect" with values - Performace, Usability and wnat use it only for test suites. - - [$node_id]: default: null - identification of a node/element on node hierarchy. - Needed when I want to get the value of custom fields - linked to a node. - Example: - Have two test cases (ID:9999, ID:89800), and want to get - the value assigned to custom field "Operating System". - I will do two calls to this method. - - - [execution_id] - [testplan_id] - [access_key] - [location] - - returns: hash - key: custom field id - - */ - function get_linked_cfields_at_execution($tproject_id,$enabled, - $node_type=null,$node_id=null, - $execution_id=null,$testplan_id=null, - $access_key='id',$location=null) - { - $base_values="CF.*,"; - $additional_join=""; - $additional_values=""; - $additional_filter=""; - $order_clause=" ORDER BY display_order,CF.id "; - - $fetchMethod='fetchRowsIntoMap'; - - if( !is_null($node_type) ) - { - $additional_join .= " JOIN {$this->tables['cfield_node_types']} CFNT ON CFNT.field_id=CF.id " . - " AND CFNT.node_type_id=" . $this->decode['nodes'][$node_type]; - } - - if( !is_null($node_id) && !is_null($execution_id) && !is_null($testplan_id) ) - { - $additional_values .= ",CFEV.value AS value,CFEV.tcversion_id AS node_id"; - $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . - " AND CFEV.tcversion_id=" . intval($node_id) . " " . - " AND CFEV.execution_id=" . intval($execution_id) . " " . - " AND CFEV.testplan_id=" . intval($testplan_id) . " "; - } - else if(!is_null($execution_id)) - { - $access_key = 'execution_id'; - $fetchMethod='fetchMapRowsIntoMap'; - $additional_values .= ',CFEV.value AS value, CFEV.execution_id '; - $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . - " AND CFEV.execution_id IN (" . implode(',', $execution_id) . ") "; - } - else - { - if( !is_null($testplan_id) ) - { - $base_values = ''; - - // MSSQL BLOCKING error on Report "Test Cases with Execution Details" due to reserved word EXEC - $additional_values .= ",CF.type,CF.name,CF.label,CF.id,CFEV.value AS value,CFEV.tcversion_id AS node_id," . - "EXECU.id AS exec_id, EXECU.tcversion_id,EXECU.tcversion_number," . - "EXECU.execution_ts,EXECU.status AS exec_status,EXECU.notes AS exec_notes, " . - "NHB.id AS tcase_id, NHB.name AS tcase_name, TCV.tc_external_id, " . - "B.id AS builds_id,B.name AS build_name, U.login AS tester, " . - "PLAT.name AS platform_name, COALESCE(PLAT.id,0) AS platform_id"; - - $additional_join .= " JOIN {$this->tables['cfield_execution_values']} CFEV ON CFEV.field_id=CF.id " . - " AND CFEV.testplan_id={$testplan_id} " . - " JOIN {$this->tables['executions']} EXECU ON CFEV.tcversion_id = EXECU.tcversion_id " . - " AND CFEV.execution_id = EXECU.id " ; - - $additional_join .= " JOIN {$this->tables['builds']} B ON B.id = EXECU.build_id " . - " AND B.testplan_id = EXECU.testplan_id " ; - - $additional_join .= " JOIN {$this->tables['tcversions']} TCV ON TCV.version = EXECU.tcversion_number " . - " AND TCV.id = EXECU.tcversion_id " ; - - $additional_join .= " JOIN {$this->tables['users']} U ON U.id = EXECU.tester_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHA ON NHA.id = EXECU.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.id = NHA.parent_id " ; - - // Use left join, if platforms is not used platform_name will become null - $additional_join .= " LEFT JOIN {$this->tables['platforms']} PLAT ON EXECU.platform_id = PLAT.id"; - $order_clause="ORDER BY EXECU.tcversion_id,exec_status,exec_id"; - - $fetchMethod='fetchArrayRowsIntoMap'; - } - } - - if( !is_null($location) ) - { - $additional_filter .= " AND CF.id= " . intval($location) . " "; - } - - - $sql = "SELECT {$base_values} CFTP.display_order,CFTP.location,CFTP.required" . - $additional_values . - " FROM {$this->tables['custom_fields']} CF " . - " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . - $additional_join . - " WHERE CFTP.testproject_id={$tproject_id} " . - " AND CFTP.active=1 " . - " AND CF.enable_on_execution={$enabled} " . - " AND CF.show_on_execution=1 {$additional_filter} {$order_clause} "; - - switch ($fetchMethod) - { - case 'fetchArrayRowsIntoMap': - case 'fetchRowsIntoMap': - $map = $this->db->$fetchMethod($sql,$access_key); - break; - - case 'fetchMapRowsIntoMap': - $map = $this->db->$fetchMethod($sql,$access_key,'id'); - break; - } - return $map; - } - - - - - /* - function: execution_values_to_db - write values of custom fields that are used at execution time. - if record exists => UPDATE - - args: $hash: contains info about CF gathered at user interface. - (normally $_REQUEST variable) - key: custom_field__. - Example custom_field_0_67 -> 0=> string field - - $node_id: - $execution_id: - $testplan_id: - - [$cf_map]: hash -> all the custom fields linked and enabled - that are applicable to the node type of $node_id. - - For the keys not present in $hash, we will write - an appropriate value according to custom field - type. - - This is needed because when trying to udpate - with hash being $_REQUEST, $_POST or $_GET - some kind of custom fields (checkbox, list, multiple list) - when has been deselected by user. - - - [hash_type]: default null, string that can be used to change how hash - is processed. - - rev: - 20090727 - franciscom - added [hash_type], to reuse this method on API - 20070501 - franciscom - limiting lenght of value before writting - */ - function execution_values_to_db($hash,$node_id,$execution_id,$testplan_id, - $cf_map=null,$hash_type=null) - { - if( is_null($hash) && is_null($cf_map) ) - { - return; - } - - $cfield=$hash; - if( is_null($hash_type) ) { - $cfield=$this->_build_cfield($hash,$cf_map); - } - - if( !is_null($cfield) ) - { - foreach($cfield as $field_id => $type_and_value) - { - $value = $type_and_value['cf_value']; - - $where_clause = " WHERE field_id=" . $this->db->prepare_int($field_id) . - " AND tcversion_id=" . $this->db->prepare_int($node_id) . - " AND execution_id=" .$this->db->prepare_int($execution_id) . - " AND testplan_id=" . $this->db->prepare_int($testplan_id); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // do I need to update or insert this value? - $sql = " SELECT value,field_id,execution_id " . - " FROM {$this->tables['cfield_execution_values']} " . $where_clause; - - $rs = (array)$this->db->get_recordset($sql); - - // max_length_value = 0 => no limit - if( $this->max_length_value > 0 && tlStringLen($value) > $this->max_length_value) { - $value = substr($value,0,$this->max_length_value); - } - $safe_value=$this->db->prepare_string($value); - - $howMany = count($rs); - if( $howMany > 0 && $value != "" ) { - $sql = " UPDATE {$this->tables['cfield_execution_values']} " . - " SET value='{$safe_value}' " . $where_clause; - $this->db->exec_query($sql); - } else if( $howMany == 0 && $value != "" ) { - - # Remark got from Mantis code: - # Always store the value, even if it's the default value - # This is important, as the definitions might change but the - # values stored with a bug must not change - $sql = "INSERT INTO {$this->tables['cfield_execution_values']} " . - " ( field_id, tcversion_id, execution_id,testplan_id,value ) " . - " VALUES ( {$field_id}, {$node_id}, {$execution_id}, {$testplan_id}, '{$safe_value}' )"; - $this->db->exec_query($sql); - - } else if( $howMany > 0 && $value == "") { - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_execution_values']} " . $where_clause; - $this->db->exec_query($sql); - } - - } //foreach($cfield - } //if( !is_null($cfield) ) - } //function end - - - - /* - function: _build_cfield - support function useful for method used to write CF values to db: - - design_values_to_db() - - execution_values_to_db() - - testplan_design_values_to_db() - - args: $hash: - key: custom_field__[_][_]. - Example custom_field_0_67 -> 0=> string field - - In certain situation we can get: - custom_field_0_67_234 - 0 => string field - 234 => item owner of CF. - this happens when you can have multiple times same CF on a page, as happens - on execution page if configure TL to work on all test cases in test suite, - or when you use CF on testplan_design. - - To understand [<_date_part>] read below on "Notes on DATE PART - _build_cfield" - - value: can be an array, or a string depending the - - $cf_map: hash - key: cfield_id - value: custom field definition data - - - returns: hash or null. - - key: cfield_id - value: hash ('type_id' => field_type_id, - 'cf_value' => value) - - rev: - */ - function _build_cfield($hash,$cf_map) { - $localesDateFormat = config_get('locales_date_format'); - $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; - $date_format = str_replace('%', '', $localesDateFormat[$locale]); - - // carved in the stone - $cf_prefix = $this->name_prefix; - $len_cfp = tlStringLen($cf_prefix); - $cftype_pos=2; - $cfid_pos=3; - $cfield=null; - - // --------------------------------------------------------------------- - if( !is_null($cf_map) ) { - foreach($cf_map as $key => $value) { - $cfield[$key]=array("type_id" => $value['type'], "cf_value" => ''); - } - } - // --------------------------------------------------------------------- - - // --------------------------------------------------------------------- - // Overwrite with values if custom field id exist - if( !is_null($hash) ) { - foreach($hash as $key => $value) { - if( strncmp($key,$cf_prefix,$len_cfp) == 0 ) { - // Notes on DATE PART - _build_cfield - // - // When using Custom Fields on Test Spec: - // key has this format (for every type except date ) - // custom_field_0_10 for every type except for type date & datetime. - // - // For date custom fields: - // custom_field_8_10_input - // - // For datetime custom fields - // custom_field_8_10_input - // custom_field_8_10_hour, custom_field_8_10_minute, ..._second - // - // After explode() - // Position 2: CF type - // Position 3: CF id - // Position 4: only available for date CF, is date part indicator - // - // When using Custom Fields on Execution - // another piece is added (TC id) then for a date CF, - // date part indicator is Position 5, instead of 4 - // - // When using Custom Fields on Testplan Design - // another piece is added (testplan_tcversion.id) then for a date CF, - // date part indicator is Position 5, instead of 4 - // - $dummy = explode('_',$key); - $last_idx = count($dummy)-1; - - $the_value = null; // without this #0008347 :( - if( isset($this->html_date_input_suffix[$dummy[$last_idx]]) ) { - $the_value[$dummy[$last_idx]] = $value; - } - else { - $the_value = $value; - } - - $cfield[$dummy[$cfid_pos]]=array("type_id" => $dummy[$cftype_pos], - "cf_value" => $the_value); - } - } - } //if( !is_null($hash) ) - - if( !is_null($cfield) ) { - foreach($cfield as $field_id => $type_and_value) { - $value = $type_and_value['cf_value']; - $verbose_type=trim($this->custom_field_types[$type_and_value['type_id']]); - switch ($verbose_type) { - case 'multiselection list': - case 'checkbox': - $valueIsArray = is_array($value); - if( $valueIsArray && count($value) > 1) { - $value=implode('|',$value); - } - else { - $value = $valueIsArray ? $value[0] : $value; - } - $cfield[$field_id]['cf_value']=$value; - break; - - case 'date': - if (($value['input'] == 0) || ($value['input'] == '')) { - $cfield[$field_id]['cf_value']=''; - } - else { - $cfield[$field_id]['cf_value']=''; - $pvalue = split_localized_date($value['input'], $date_format); - if($pvalue != null) { - $cfield[$field_id]['cf_value'] = - mktime(0,0,0,$pvalue['month'],$pvalue['day'],$pvalue['year']); - } - } - break; - - case 'datetime': - if ($value['input'] == '') { - $cfield[$field_id]['cf_value']=''; - } - else { - $cfield[$field_id]['cf_value']=''; - $pvalue = split_localized_date($value['input'], $date_format); - if($pvalue != null) { - if($value['hour'] == -1 || $value['minute'] == -1 || - $value['second'] == -1) { - $value['hour'] = $value['minute'] = $value['second'] = 0; - } - $cfield[$field_id]['cf_value'] = - mktime($value['hour'], $value['minute'], $value['second'], - $pvalue['month'], $pvalue['day'], $pvalue['year']); - } - } - break; - - default: - $dynamic_call='build_cfield_' . str_replace(' ', '_', $verbose_type); - if( function_exists($dynamic_call) ) { - $cfield[$field_id]['cf_value'] = $dynamic_call($value); - } - else if( method_exists($this,$dynamic_call) ) { - $cfield[$field_id]['cf_value'] = $this->$dynamic_call($value); - } - else { - $cfield[$field_id]['cf_value']=$value; - } - break; - - } - } // foreach - } - return $cfield; - } // function end - - - - - - - /* - function: set_display_order - - args : $tproject_id: needed because is possible to associate/link - a different set of custom field for every test project - $map_field_id_display_order - - - - returns: - - */ - function set_display_order($tproject_id, $map_field_id_display_order) - { - $tproject_info = $this->tree_manager->get_node_hierarchy_info($tproject_id); - foreach($map_field_id_display_order as $field_id => $display_order) - { - $sql = "UPDATE {$this->tables['cfield_testprojects']} " . - " SET display_order=" . intval($display_order) . - " WHERE testproject_id={$tproject_id} AND field_id={$field_id} "; - $this->db->exec_query($sql); - } - if ($tproject_info) - { - logAuditEvent(TLS("audit_cfield_display_order_changed",$tproject_info['name']), - "SAVE",$tproject_id,"testprojects"); - } - } // function end - - -/** - * set value of location attribute for one or multiple custom fields. - * - * - */ - function setDisplayLocation($tproject_id, $field_id_location) - { - $tproject_info = $this->tree_manager->get_node_hierarchy_info($tproject_id); - foreach($field_id_location as $field_id => $location) - { - $sql = "UPDATE {$this->tables['cfield_testprojects']} " . - " SET location=" . intval($location) . - " WHERE testproject_id={$tproject_id} AND field_id={$field_id} "; - $this->db->exec_query($sql); - } - if ($tproject_info) - { - logAuditEvent(TLS("audit_cfield_location_changed",$tproject_info['name']), - "SAVE",$tproject_id,"testprojects"); - } - } // function end - - - # code from mantis helper_api.php - # -------------------- - # returns a tab index value and increments it by one. This is used to give sequential tab index on - # a form. - function helper_get_tab_index_value() { - static $tab_index = 0; - return ++$tab_index; - } - - # -------------------- - # returns a tab index and increments internal state by 1. This is used to give sequential tab index on - # a form. For example, this function returns: tabindex="1" - function helper_get_tab_index() { - return 'tabindex="' . helper_get_tab_index_value() . '"'; - } - - - -/** - * Retrieves the XML-RPC Server Parameters specified through custom fields. - * - * Done searching CARVED in the stone Custom Field Names on different - * (AGAIN CARVED in the stone) CF value tables in this way: - * - * CF name will have 3 pieces separated by _ (underscore) - * - * RE-XMLRPC_url_tsuite - * RE-XMLRPC_url_tcase - * RE-XMLRPC_url_link - * - * Part 1: RE-XMLRPC_ FIXED value, used as search key to get automatically - * CF to be analised. - * - * Part 2: url will be key on returned hash, and is part of 'contract' with caller, - * i.e. caller will use this key. - * This key is a FREE choice of developer of Remote Execute modules to use - * with TL. - * - * Part 3: this part is domain (link,tcase,tsuite) - * work this way: - * To specify Remote Execution server parameters we have provided 3 choices - * a. on test case version LINKED to Test Plan + Platform (Test Plan Design time) - * b. on test case version BUT at Test Spec Design time. - * In this way if is OK to have always same parameters no matter - * test plan + platform where test case version has been linked, we configure - * this just ONCE. - * c. on test suite (can be done ONLY at Test Spec Design time), all test case versions - * contained on this test suite branch (and children Test suites) will share this - * configuration. - * - * - * - * @param integer $node_id Accepts current node id from nodes hierarchy level - * @return mixed An array of config params if found, else returns null - * - * @internal rev: - * - * 20110123 - franciscom - need refactoring after we have choose to link custom field - * values to test case version not to test case - * - **/ -function getXMLRPCServerParams($nodeID,$tplanLinkID=null) -{ - static $node_type; - static $likeTarget; - static $CFGKEY_IDX; - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $srv_cfg = new stdClass(); - - if( is_null($node_type) ) - { - $node_type=$this->tree_manager->get_available_node_types(); - $likeTarget = 'RE-XMLRPC_%'; - $CFGKEY_IDX = 1; - } - - $node_info = $this->tree_manager->get_node_hierarchy_info($nodeID); - $ret = null; - - if( !is_null($node_info) ) - { - $server_info = null; - - // First Search at test plan design time - if( !is_null($tplanLinkID) ) - { - $sql = " /* $debugMsg */ SELECT cf.name, cfv.value " . - " FROM {$this->tables['cfield_testplan_design_values']} cfv " . - " JOIN {$this->tables['custom_fields']} cf ON " . - " cfv.field_id = cf.id " . - " WHERE cf.name LIKE '{$likeTarget}' " . - " AND cfv.link_id = " . intval($tplanLinkID); - - $server_info = $this->db->fetchRowsIntoMap($sql,'name'); - } - - if( is_null($server_info) ) - { - - $sql = " /* $debugMsg */ SELECT cf.name, cfv.value " . - " FROM {$this->tables['cfield_design_values']} cfv " . - " JOIN {$this->tables['custom_fields']} cf ON " . - " cfv.field_id = cf.id " . - " WHERE cf.name LIKE '{$likeTarget}' " . - " AND cfv.node_id = " . intval($nodeID); - - $server_info = $this->db->fetchRowsIntoMap($sql,'name'); - } - - if( is_null($server_info) ) - { - // Recurse - // 20110123 - franciscom - // At time of initial development this was thinked to try to get - // server info from Test Suite. - // Because with TL 1.9.x when working with test case we will receive - // Test Case Version ID, instead of Test Case ID (1.8.x), we will do - // a call to reach Test Case and then another to reach Test Suite - // - // - if($node_info['parent_id'] != "") - { - $ret = $this->getXMLRPCServerParams($node_info['parent_id']); - } - } - else - { - $key2loop = array_keys($server_info); - foreach($key2loop as $target) - { - $dummy = explode('_',$target); - $ret[$dummy[$CFGKEY_IDX]] = $server_info[$target]['value']; - } - } - } // if( !is_null($node_info) ) - - return $ret; -} //function end - - - /* - function: testplan_design_values_to_db - write values of custom fields that are used at testplan design time. - - args: $hash: contains info about CF gathered at user interface. - (normally $_REQUEST variable) - key: custom_field__. - Example custom_field_0_67 -> 0=> string field - - $node_id: Remember that this CF are used to extend information - on test cases (tcversions) linked to test plans. - Then node_id can not point to other type of node than test case version, - then node_id will contain a tcversion_id. - - I have leave this argument to - - - - $link_id: Remember that this CF are used to extend information - on test cases (tcversions) linked to test plans. - Link information is store in testplan_tcversions table, - $link_id points to this link (testplan_tcversions.id field) - - [$cf_map]: hash -> all the custom fields linked and enabled - that are applicable to the node type of $node_id. - - For the keys not present in $hash, we will write - an appropriate value according to custom field - type. - This is needed because when trying to udpate - with hash being $_REQUEST, $_POST or $_GET - some kind of custom fields (checkbox, list, multiple list) - when has been deselected by user. - - [$hash_type]: NEED TO BE COMMENTED - - - rev: - */ - function testplan_design_values_to_db($hash,$node_id,$link_id,$cf_map=null,$hash_type=null) - { - if( is_null($hash) && is_null($cf_map) ) - { - return; - } - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $cfield = is_null($hash_type) ? $this->_build_cfield($hash,$cf_map) : $hash; - if( !is_null($cfield) ) - { - foreach($cfield as $field_id => $type_and_value) - { - $value = $type_and_value['cf_value']; - - // do I need to update or insert this value? - $sql = "SELECT value FROM {$this->tables['cfield_testplan_design_values']} " . - " WHERE field_id={$field_id} AND link_id={$link_id}"; - - $result = $this->db->exec_query($sql); - - // max_length_value = 0 => no limit - if( $this->max_length_value > 0 && tlStringLen($value) > $this->max_length_value) - { - $value = substr($value,0,$this->max_length_value); - } - - $safe_value=$this->db->prepare_string($value); - if($this->db->num_rows( $result ) > 0 && $value != "") - { - $sql = "UPDATE {$this->tables['cfield_testplan_design_values']} " . - " SET value='{$safe_value}' " . - " WHERE field_id={$field_id} AND link_id={$link_id}"; - $this->db->exec_query($sql); - } - // BUGID 3989 - else if ($this->db->num_rows( $result ) == 0 && $value != "") - { - # Remark got from Mantis code: - # Always store the value, even if it's the dafault value - # This is important, as the definitions might change but the - # values stored with a bug must not change - $sql = "INSERT INTO {$this->tables['cfield_testplan_design_values']} " . - " ( field_id, link_id, value ) " . - " VALUES ( {$field_id}, {$link_id}, '{$safe_value}' )"; - $this->db->exec_query($sql); - // BUGID 3989 - } else if ($this->db->num_rows( $result ) > 0 && $value == "") { - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testplan_design_values']} " . - " WHERE field_id={$field_id} AND link_id={$link_id}"; - $this->db->exec_query($sql); - } - - } //foreach($cfield - } //if( !is_null($cfield) ) - - } //function end - - - - /* - function: get_linked_cfields_at_testplan_design - returns information about custom fields that can be used - at least at testplan design time (test case assignment), - with the value assigned (is any has been assigned). - - - $tproject_id: needed because is possible to associate/link - a different set of custom field for every test project - - $enabled : 1 -> get custom fields that are has been configured - to be shown during test case execution AND are enabled. - - [$node_type]: default: null - verbose id ('testcase', 'testsuite', etc) of a node type. - custom fields are linked also to different node types. - Example: - I can define a custom field "Aspect" with values - Performace, Usability and wnat use it only for test suites. - - [$node_id]: default: null - identification of a node/element on node hierarchy. - Needed when I want to get the value of custom fields - linked to a node. - Example: - Have two test cases (ID:9999, ID:89800), and want to get - the value assigned to custom field "Operating System". - I will do two calls to this method. - - IMPORTANT: - Fot testplan_design Custom Field this will be a TCVERSION_ID, - not a TESTCASE_ID - - - [link_id]: points to testplan_tcversions.id field - [testplan_id] - - - returns: hash - key: custom field id - - - - */ - function get_linked_cfields_at_testplan_design($tproject_id,$enabled, - $node_type=null,$node_id=null, - $link_id=null,$testplan_id=null,$access_key = 'id') - { - $additional_join=""; - $additional_values=""; - $additional_filter=""; - - $order_by_clause = " ORDER BY display_order,CF.id "; - $fetchMethod = 'fetchRowsIntoMap'; - - if( !is_null($node_type) ) - { - $hash_descr_id = $this->tree_manager->get_available_node_types(); - $node_type_id=$hash_descr_id[$node_type]; - - $additional_join .= " JOIN {$this->tables['cfield_node_types']} CFNT ON CFNT.field_id=CF.id " . - " AND CFNT.node_type_id={$node_type_id} "; - } - - if( is_null($link_id) && !is_null($testplan_id)) - { - $additional_values .= ",CFTDV.value AS value, CFTDV.link_id AS node_id, " . - "NHB.id AS tcase_id, NHB.name AS tcase_name, " . - "TCV.tc_external_id "; - - $additional_join .= "JOIN {$this->tables['testplan_tcversions']} TPTC" . - " ON TPTC.testplan_id = {$testplan_id}" . - " JOIN {$this->tables['cfield_testplan_design_values']} CFTDV " . - " ON CFTDV.field_id=CF.id " . - " AND CFTDV.link_id = TPTC.id "; - - $additional_join .= " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTC.tcversion_id " . - " AND TCV.id = TPTC.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHA ON NHA.id = TPTC.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.id = NHA.parent_id " ; - - $order_by_clause = " ORDER BY node_id,display_order,CF.id "; - $fetchMethod = 'fetchArrayRowsIntoMap'; - $access_key = 'node_id'; - - } - elseif( !is_null($link_id) ) - { - $additional_values .= ",CFTDV.value AS value, CFTDV.link_id AS node_id"; - $additional_join .= " LEFT OUTER JOIN {$this->tables['cfield_testplan_design_values']} CFTDV " . - " ON CFTDV.field_id=CF.id " . - " AND CFTDV.link_id={$link_id} "; - } - - $sql="SELECT CF.*,CFTP.display_order,CFTP.required" . - $additional_values . - " FROM {$this->tables['custom_fields']} CF " . - " JOIN {$this->tables['cfield_testprojects']} CFTP ON CFTP.field_id=CF.id " . - $additional_join . - " WHERE CFTP.testproject_id={$tproject_id} " . - " AND CFTP.active=1 " . - " AND CF.enable_on_testplan_design={$enabled} " . - $order_by_clause; - - $map = $this->db->$fetchMethod($sql,$access_key); - return $map; - } - - /* - function: string_input_radio - returns an string with the html needed to display radio custom field. - Is normally called by string_custom_field_input() - - args: p_field_def: contains the definition of the custom field - (including it's field id) - - p_input_name: html input name - - p_custom_field_value: html input value - htmlspecialchars() must be applied to this - argument by caller. - - returns: html string - - rev: 20080816 - franciscom - based on Mantis 1.2.0a1 code - - */ - private function string_input_radio($p_field_def, $p_input_name, $p_custom_field_value,$opt=null) - { - $options = array('remove_required' => false); - $options = array_merge($options,(array)$opt); - - $str_out=''; - $t_values = explode( '|', $p_field_def['possible_values']); - $t_checked_values = explode( '|', $p_custom_field_value ); - - if($options['remove_required']) - { - $required = ' class="" '; - } - else - { - $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; - } - - foreach( $t_values as $t_option ) - { - // $str_out .= ' ' . $t_option . '  '; - } - else - { - $str_out .= ' value="' . $t_option . '"> ' . $t_option . '  '; - } - } - return $str_out; - } - - /* - function: build_cfield_radio - support function useful for method used to write radio CF values to db. - Is normally called by _build_cfield() - - args: custom_field_value: value to be converted to be written to db. - - returns: value converted - - rev: 20080816 - franciscom - - */ - function build_cfield_radio($custom_field_value) - { - if( count($custom_field_value) > 1) - { - $value=implode('|',$custom_field_value); - } - else - { - $value=is_array($custom_field_value) ? $custom_field_value[0] :$custom_field_value; - } - return $value; - } - - -/* - function: string_input_string - returns an string with the html needed to display custom field of type: - string, email, numeric, float - - Is normally called by string_custom_field_input() - - args: p_field_def: contains the definition of the custom field - (including it's field id) - - p_input_name: html input name - - p_custom_field_value: html input value - htmlspecialchars() must be applied to this - argument by caller. - - p_size: html input size - - returns: html string - - - */ - private function string_input_string($p_field_def, $p_input_name, $p_custom_field_value, $p_size,$opt=null) - { - $options = array('remove_required' => false); - $options = array_merge($options,(array)$opt); - if($options['remove_required']) - { - $required = ' class="" '; - } - else - { - $required = $p_field_def['required'] ? ' class="required" required ' : ' class="" '; - } - - $str_out=''; - $size = intval($p_size) > 0 ? $p_size : self::DEFAULT_INPUT_SIZE; - $str_out .= "'; - return $str_out; - } - - - -/** - * exportValueAsXML - * generate XML with custom field name, and custom field value - * useful on export to XML method for items that can have custom fields, - * example: test cases, test suites, req specification, etc. - * - * @param map $cfMap: key: custom file ID, value: map with at least keys 'name', 'value' - * - */ - function exportValueAsXML($cfMap) - { - $cfRootElem = "\n{{XMLCODE}}\t\t\n"; - $cfElemTemplate = "\t\t\t" . "\n\t\t\t\n\t\t\t" . - "\n" . - "\t\t\t" . "\n"; - $cfDecode = array ("||NAME||" => "name","||VALUE||" => "value"); - $cfXML = exportDataToXML($cfMap,$cfRootElem,$cfElemTemplate,$cfDecode,true); - return $cfXML; - } - - -/** - * remove_all_scopes_values - * For a given custom field id remove all assigned values in any scope - * - * @param int $id: custom field id - * - * - * - * - */ -function remove_all_scopes_values($id) -{ - // some sort of blind delete - $tables = array('cfield_design_values','cfield_build_design_values', - 'cfield_execution_values','cfield_testplan_design_values'); - $safe_id = intval($id); - foreach($tables as $tt) - { - $sql = "DELETE FROM {$this->tables[$tt]} WHERE field_id={$safe_id} "; - $this->db->exec_query($sql); - } -} - -/** - * get_linked_testprojects - * For a given custom field id return all test projects where is linked. - * - * @param int $id: custom field id - * - */ -function get_linked_testprojects($id) -{ - $sql=" SELECT NH.id, NH.name " . - " FROM {$this->tables['cfield_testprojects']} CFTP, {$this->tables['nodes_hierarchy']} NH " . - " WHERE CFTP.testproject_id=NH.id " . - " AND CFTP.field_id = {$id} ORDER BY NH.name "; - - $rs=$this->db->fetchRowsIntoMap($sql,'id'); - return $rs; -} - - -/** - * @param string node type in verbose form. Example 'testcase' - * - * returns map with key: verbose location (see custom field class $locations) - * value: array with fixed key 'location' - * value: location code - * - */ -function buildLocationMap($nodeType) -{ - $locationMap=null; - $dummy = $this->getLocations(); - $verboseLocationCode = array_flip($dummy[$nodeType]); - if( !is_null($verboseLocationCode) - && count($verboseLocationCode) > 0 ) { - foreach($verboseLocationCode as $key => $value) { - $locationMap[$key]['location']=$value; - } - } - return $locationMap; -} - - -/** - * @param int linkID: how is used depends on $options['scope'] - * $options['scope']=design => node_id - * $options['scope']=testplan_design => feature_id (see testplan_tcversions table) - * $options['scope']=execution => execution_id - * - * @used by testsuite.class.php => copy_cfields_values - */ -function getByLinkID($linkID, $options=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('scope' => 'design', 'output' => 'field_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - switch($my['options']['output']) - { - case 'field_id': - $sql = "/* debugMsg */ SELECT field_id FROM "; - break; - - case 'full': - $sql = "/* debugMsg */ SELECT * FROM "; - break; - - } - - switch($my['options']['scope']) - { - case 'design': - $sql .= " {$this->tables['cfield_design_values']} " . - " WHERE node_id = {$linkID} "; - break; - - case 'testplan_design': - $sql .= " {$this->tables['cfield_testplan_design_values']} " . - " WHERE feature_id = {$linkID} "; - break; - - case 'execution': - $sql .= " {$this->tables['cfield_execution_values']} " . - " WHERE execution_id = {$linkID} "; - break; - - } - $rs = $this->db->get_recordset($sql); - - - return $rs; -} - - - -/** - * buildHTMLInputName - * - */ -function buildHTMLInputName($cf,$name_suffix) { - return "{$this->name_prefix}{$cf['type']}_{$cf['id']}{$name_suffix}"; -} - - - -/** - * - * - */ -function html_table_inputs($cfields_map,$name_suffix='',$input_values=null,$opt=null) -{ - $cf_smarty = ''; - $getOpt = array('name_suffix' => $name_suffix); - - $my['opt'] = array('addCheck' => false, 'addTable' => true, 'forceOptional' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - if(!is_null($cfields_map)) - { - $lbl_upd = lang_get('update_hint'); - $cf_map = $this->getValuesFromUserInput($cfields_map,$name_suffix,$input_values); - - $NO_WARNING_IF_MISSING=true; - $openTag = $my['opt']['addTable'] ? "" : ''; - $closeTag = $my['opt']['addTable'] ? "
    " : ''; - - $add_img = "'; - - $cf_smarty = ''; - foreach($cf_map as $cf_id => $cf_info) - { - $label=str_replace(TL_LOCALIZE_TAG,'', - lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING)); - - - // IMPORTANT NOTICE - // assigning an ID with this format is CRITIC to Javascript logic used - // to validate input data filled by user according to CF type - // extract input html id - // Want to give an html id to
    used as labelHolder, to use it in Javascript - // logic to validate CF content - if($my['opt']['forceOptional']) - { - $cf_info['required'] = 0; - } - - $cf_html_string = $this->string_custom_field_input($cf_info,$getOpt); - - $dummy = explode(' ', strstr($cf_html_string,'id="custom_field_')); - $td_label_id = str_replace('id="', 'id="label_', $dummy[0]); - - $cf_smarty .= "
    {$add_img}" . - " " . htmlspecialchars($label) . ":" . - $this->string_custom_field_input($cf_info,$getOpt) . "
    used as labelHolder, to use it in Javascript - // logic to validate CF content - $cf_html_string = $this->string_custom_field_input($cf_info,$getOpt); - - $dummy = explode(' ', strstr($cf_html_string,'id="custom_field_')); - $label_id = str_replace('id="', 'id="label_', $dummy[0]); - - $inputSet[] = array('label' => htmlspecialchars($label) , - 'label_id' => $label_id, - 'input' => $this->string_custom_field_input($cf_info,$getOpt)); - } - } - return $inputSet; - } - - /** - * - * - */ - function getByIDAndEnableOn($id,$enableOn=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT CF.*, CFNT.node_type_id" . - " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_node_types']} CFNT" . - " WHERE CF.id=CFNT.field_id " . - " AND CF.id IN (" . implode(',',(array)$id) . ")"; - - if(!is_null($enableOn) && is_array($enableOn)) - { - foreach($this->application_areas as $key) - { - if(isset($enableOn[$key]) && $enableOn[$key]) - { - $sql .= " AND CF.enable_on_{$key}=1 "; - } - } - } - - return($this->db->fetchRowsIntoMap($sql,'id')); - } - - /** - * - */ - function setMonitorable($tproject_id,$cfieldSet,$val) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($cfieldSet)) - { - return; - } - - $safe = new stdClass(); - $safe->tproject_id = intval($tproject_id); - $safe->val = (intval($val) > 0) ? 1 : 0; - - $field = 'monitorable'; - - $info = $this->tree_manager->get_node_hierarchy_info($safe->tproject_id); - $auditMsg = $val ? "audit_cfield_{$field}_on" : "audit_cfield_{$field}_off"; - foreach($cfieldSet as $field_id) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['cfield_testprojects']} " . - " SET {$field}=" . $safe->val . - " WHERE testproject_id=" . $safe->tproject_id . - " AND field_id=" . $this->db->prepare_int($field_id); - - if ($this->db->exec_query($sql)) - { - $cf = $this->get_by_id($field_id); - if($cf) - { - logAuditEvent(TLS($auditMsg,$cf[$field_id]['name'],$info['name']), - "SAVE",$safe->tproject_id,"testprojects"); - } - } - } - } - - /** - * - * - */ - function cfdate2mktime($value) - { - if (($value == 0) || ($value == '')) - { - return ''; - } - else - { - $localesDateFormat = config_get('locales_date_format'); - $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; - $date_format = str_replace('%', '', $localesDateFormat[$locale]); - - $pvalue = split_localized_date($value, $date_format); - if($pvalue != null) - { - $pvalue = mktime(0, 0, 0, $pvalue['month'], $pvalue['day'], $pvalue['year']); - return $pvalue; - } - else - { - return ''; - } - } - } - - /** - * - */ - function getBooleanAttributes($tproject_id,$cfSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ " . - " SELECT field_id,active,required,monitorable " . - " FROM {$this->tables['cfield_testprojects']} CFTP " . - " WHERE testproject_id =" . intval($tproject_id); - - if(!is_null($cfSet)) - { - $sql .= " AND field_id IN(" . implode(',', $cfSet) . ")"; - } - - $rs = $this->db->fetchRowsIntoMap($sql,'field_id'); - - return $rs; - } - - /** - * - * - */ - function initViewGUI() { - $gogo = new stdClass(); - - $gogo->cfield = null; - $gogo->cfield_is_used = 0; - $gogo->cfield_is_linked = 0; - $gogo->linked_tprojects = null; - - $gogo->cf_map = $this->get_all(null,'transform'); - $gogo->cf_types = $gogo->cfield_types = $this->get_available_types(); - - // MAGIC 10 - $gogo->drawControlsOnTop = (null != $gogo->cf_map && count($gogo->cf_map) > 10); - - return $gogo; - } - -} // end class \ No newline at end of file diff --git a/lib/functions/ckeditor.class.php b/lib/functions/ckeditor.class.php index a0112d8444..cda0ef36bd 100644 --- a/lib/functions/ckeditor.class.php +++ b/lib/functions/ckeditor.class.php @@ -1,43 +1,45 @@ -InstanceName = $instanceName; - $this->Value = ''; - $this->Editor = new CKEditor(); - $this->Editor->returnOutput = true; - } - - /** - * - */ - function Create() { - echo $this->CreateHtml($rows,$cols); - } - - /** - * - */ - function CreateHtml($config=[]) { - $Html = $this->Editor->editor($this->InstanceName, $this->Value, $config); - return $Html ; - } - -} // class end \ No newline at end of file +InstanceName = $instanceName; + $this->Value = ''; + $this->Editor = new CKEditor(); + $this->Editor->returnOutput = true; + } + + /** + */ + public function Create() + { + echo $this->CreateHtml($rows, $cols); + } + + /** + */ + public function CreateHtml($config = []) + { + return $this->Editor->editor($this->InstanceName, $this->Value, $config); + } +} diff --git a/lib/functions/code_testing/cfield_mgr.class.test.php b/lib/functions/code_testing/cfield_mgr.class.test.php index 356a18fc75..8058e12d84 100644 --- a/lib/functions/code_testing/cfield_mgr.class.test.php +++ b/lib/functions/code_testing/cfield_mgr.class.test.php @@ -1,51 +1,51 @@ -Poor's Man - $object_item - code inspection tool
    "; -echo "
    Scope of this page is allow you to understand with live
    "; -echo "examples how to use object: $object_item (implemented in file $object_class.class.php)
    "; -echo "Important:"; -echo "You are using your testlink DB to do all operations"; -echo "
    "; -echo "
    "; -echo "
     $object_item - constructor - $object_class(&\$db)";echo "
    "; -$obj_mgr=new $object_class($db); -new dBug($obj_mgr); - -$tproject_id=2714; -$enabled=1; +Poor's Man - $object_item - code inspection tool
    "; +echo "
    Scope of this page is allow you to understand with live
    "; +echo "examples how to use object: $object_item (implemented in file $object_class.class.php)
    "; +echo "Important:"; +echo "You are using your testlink DB to do all operations"; +echo "
    "; +echo "
    "; +echo "
     $object_item - constructor - $object_class(&\$db)";
    +echo "
    "; +$obj_mgr = new $object_class($db); +new dBug($obj_mgr); + +$tproject_id = 2714; +$enabled = 1; echo " function get_linked_cfields_at_testplan_design(\$tproject_id,\$enabled, \$node_type=null,\$node_id=null, \$link_id=null,\$testplan_id=null) -"; +"; echo " function get_linked_cfields_at_testplan_design($tproject_id,$enabled); -"; -$cf=$obj_mgr->get_linked_cfields_at_testplan_design($tproject_id,$enabled); -new dBug($cf); - - -?> \ No newline at end of file +"; +$cf = $obj_mgr->get_linked_cfields_at_testplan_design($tproject_id, $enabled); +new dBug($cf); + +?> diff --git a/lib/functions/code_testing/dBug.php b/lib/functions/code_testing/dBug.php index 9e498ea90e..dd574823d3 100644 --- a/lib/functions/code_testing/dBug.php +++ b/lib/functions/code_testing/dBug.php @@ -1,526 +1,606 @@ -initJSandCSS(); - } - $arrAccept=array("array","object","xml"); //array of variable types that can be "forced" - if(in_array($forceType,$arrAccept)) - $this->{"varIs".ucfirst($forceType)}($var); - else - $this->checkType($var); - } - - //get variable name - function getVariableName() { - $arrBacktrace = debug_backtrace(); - - //possible 'included' functions - $arrInclude = array("include","include_once","require","require_once"); - - //check for any included/required files. if found, get array of the last included file (they contain the right line numbers) - for($i=count($arrBacktrace)-1; $i>=0; $i--) { - $arrCurrent = $arrBacktrace[$i]; - if(array_key_exists("function", $arrCurrent) && - (in_array($arrCurrent["function"], $arrInclude) || (0 != strcasecmp($arrCurrent["function"], "dbug")))) - continue; - - $arrFile = $arrCurrent; - - break; - } - - if(isset($arrFile)) { - $arrLines = file($arrFile["file"]); - $code = $arrLines[($arrFile["line"]-1)]; - - //find call to dBug class - preg_match('/\bnew dBug\s*\(\s*(.+)\s*\);/i', $code, $arrMatches); - - return $arrMatches[1]; - } - return ""; - } - - //create the main table header - function makeTableHeader($type,$header,$colspan=2) { - if(!$this->bInitialized) { - $header = $this->getVariableName() . " (" . $header . ")"; - $this->bInitialized = true; - } - echo " +initJSandCSS(); + } + $arrAccept = array( + "array", + "object", + "xml" + ); // array of variable types that can be "forced" + if (in_array($forceType, $arrAccept)) + $this->{"varIs" . ucfirst($forceType)}($var); + else + $this->checkType($var); + } + + private function getVariableName() + { + $arrBacktrace = debug_backtrace(); + + // possible 'included' functions + $arrInclude = array( + "include", + "include_once", + "require", + "require_once" + ); + + // check for any included/required files. if found, get array of the last included file (they contain the right line numbers) + for ($i = count($arrBacktrace) - 1; $i >= 0; $i --) { + $arrCurrent = $arrBacktrace[$i]; + if (array_key_exists("function", $arrCurrent) && + (in_array($arrCurrent["function"], $arrInclude) || + (0 != strcasecmp($arrCurrent["function"], "dbug")))) + continue; + + $arrFile = $arrCurrent; + + break; + } + + if (isset($arrFile)) { + $arrLines = file($arrFile["file"]); + $code = $arrLines[($arrFile["line"] - 1)]; + + // find call to dBug class + preg_match('/\bnew dBug\s*\(\s*(.+)\s*\);/i', $code, $arrMatches); + + return $arrMatches[1]; + } + return ""; + } + + // create the main table header + function makeTableHeader($type, $header, $colspan = 2) + { + if (! $this->bInitialized) { + $header = $this->getVariableName() . " (" . $header . ")"; + $this->bInitialized = true; + } + echo "
    - - "; - } - - //create the table row header - function makeTDHeader($type,$header) { - echo " - - \n"; - } - - //error - function error($type) { - $error="Error: Variable cannot be a"; - // this just checks if the type starts with a vowel or "x" and displays either "a" or "an" - if(in_array(substr($type,0,1),array("a","e","i","o","u","x"))) - $error.="n"; - return ($error." ".$type." type"); - } - - //check variable type - function checkType($var) { - switch(gettype($var)) { - case "resource": - $this->varIsResource($var); - break; - case "object": - $this->varIsObject($var); - break; - case "array": - $this->varIsArray($var); - break; - case "NULL": - $this->varIsNULL(); - break; - case "boolean": - $this->varIsBoolean($var); - break; - default: - $var=($var=="") ? "[empty string]" : $var; - echo "
    ".$header."
    ".$header.""; - } - - //close table row - function closeTDRow() { - return "
    \n\n\n
    ".$var."
    \n"; - break; - } - } - - //if variable is a NULL type - function varIsNULL() { - echo "NULL"; - } - - //if variable is a boolean type - function varIsBoolean($var) { - $var=($var==1) ? "TRUE" : "FALSE"; - echo $var; - } - - //if variable is an array type - function varIsArray($var) { - $var_ser = serialize($var); - array_push($this->arrHistory, $var_ser); - - $this->makeTableHeader("array","array"); - if(is_array($var)) { - foreach($var as $key=>$value) { - $this->makeTDHeader("array",$key); - - //check for recursion - if(is_array($value)) { - $var_ser = serialize($value); - if(in_array($var_ser, $this->arrHistory, TRUE)) - $value = "*RECURSION*"; - } - - if(in_array(gettype($value),$this->arrType)) - $this->checkType($value); - else { - $value=(trim($value)=="") ? "[empty string]" : $value; - echo $value; - } - echo $this->closeTDRow(); - } - } - else echo "
    ".$this->error("array").$this->closeTDRow(); - array_pop($this->arrHistory); - echo "
    "; - } - - //if variable is an object type - function varIsObject($var) { - $var_ser = serialize($var); - array_push($this->arrHistory, $var_ser); - $this->makeTableHeader("object","object"); - - if(is_object($var)) { - $arrObjVars=get_object_vars($var); - foreach($arrObjVars as $key=>$value) { - - $value=(!is_object($value) && !is_array($value) && trim($value)=="") ? "[empty string]" : $value; - $this->makeTDHeader("object",$key); - - //check for recursion - if(is_object($value)||is_array($value)) { - $var_ser = serialize($value); - if(in_array($var_ser, $this->arrHistory, TRUE)) { - $value = (is_object($value)) ? "*RECURSION* -> $".get_class($value) : "*RECURSION*"; - - } - } - if(in_array(gettype($value),$this->arrType)) - $this->checkType($value); - else echo $value; - echo $this->closeTDRow(); - } - $arrObjMethods=get_class_methods(get_class($var)); - foreach($arrObjMethods as $key=>$value) { - $this->makeTDHeader("object",$value); - echo "[function]".$this->closeTDRow(); - } - } - else echo "".$this->error("object").$this->closeTDRow(); - array_pop($this->arrHistory); - echo ""; - } - - //if variable is a resource type - function varIsResource($var) { - $this->makeTableHeader("resourceC","resource",1); - echo "\n\n"; - switch(get_resource_type($var)) { - case "fbsql result": - case "mssql result": - case "msql query": - case "pgsql result": - case "sybase-db result": - case "sybase-ct result": - case "mysql result": - $db=current(explode(" ",get_resource_type($var))); - $this->varIsDBResource($var,$db); - break; - case "gd": - $this->varIsGDResource($var); - break; - case "xml": - $this->varIsXmlResource($var); - break; - default: - echo get_resource_type($var).$this->closeTDRow(); - break; - } - echo $this->closeTDRow()."\n"; - } - - //if variable is a database resource type - function varIsDBResource($var,$db="mysql") { - if($db == "pgsql") - $db = "pg"; - if($db == "sybase-db" || $db == "sybase-ct") - $db = "sybase"; - $arrFields = array("name","type","flags"); - $numrows=call_user_func($db."_num_rows",$var); - $numfields=call_user_func($db."_num_fields",$var); - $this->makeTableHeader("resource",$db." result",$numfields+1); - echo " "; - for($i=0;$i<$numfields;$i++) { - $field_header = ""; - for($j=0; $j".$field_name.""; - } - echo ""; - for($i=0;$i<$numrows;$i++) { - $row=call_user_func($db."_fetch_array",$var,constant(strtoupper($db)."_ASSOC")); - echo "\n"; - echo "".($i+1).""; - for($k=0;$k<$numfields;$k++) { - $tempField=$field[$k]->name; - $fieldrow=$row[($field[$k]->name)]; - $fieldrow=($fieldrow=="") ? "[empty string]" : $fieldrow; - echo "".$fieldrow."\n"; - } - echo "\n"; - } - echo ""; - if($numrows>0) - call_user_func($db."_data_seek",$var,0); - } - - //if variable is an image/gd resource type - function varIsGDResource($var) { - $this->makeTableHeader("resource","gd",2); - $this->makeTDHeader("resource","Width"); - echo imagesx($var).$this->closeTDRow(); - $this->makeTDHeader("resource","Height"); - echo imagesy($var).$this->closeTDRow(); - $this->makeTDHeader("resource","Colors"); - echo imagecolorstotal($var).$this->closeTDRow(); - echo ""; - } - - //if variable is an xml type - function varIsXml($var) { - $this->varIsXmlResource($var); - } - - //if variable is an xml resource type - function varIsXmlResource($var) { - $xml_parser=xml_parser_create(); - xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0); - xml_set_element_handler($xml_parser,array(&$this,"xmlStartElement"),array(&$this,"xmlEndElement")); - xml_set_character_data_handler($xml_parser,array(&$this,"xmlCharacterData")); - xml_set_default_handler($xml_parser,array(&$this,"xmlDefaultHandler")); - - $this->makeTableHeader("xml","xml document",2); - $this->makeTDHeader("xml","xmlRoot"); - - //attempt to open xml file - $bFile=(!($fp=@fopen($var,"r"))) ? false : true; - - //read xml file - if($bFile) { - while($data=str_replace("\n","",fread($fp,4096))) - $this->xmlParse($xml_parser,$data,feof($fp)); - } - //if xml is not a file, attempt to read it as a string - else { - if(!is_string($var)) { - echo $this->error("xml").$this->closeTDRow()."\n"; - return; - } - $data=$var; - $this->xmlParse($xml_parser,$data,1); - } - - echo $this->closeTDRow()."\n"; - - } - - //parse xml - function xmlParse($xml_parser,$data,$bFinal) { - if (!xml_parse($xml_parser,$data,$bFinal)) { - die(sprintf("XML error: %s at line %d\n", - xml_error_string(xml_get_error_code($xml_parser)), - xml_get_current_line_number($xml_parser))); - } - } - - //xml: inititiated when a start tag is encountered - function xmlStartElement($parser,$name,$attribs) { - $this->xmlAttrib[$this->xmlCount]=$attribs; - $this->xmlName[$this->xmlCount]=$name; - $this->xmlSData[$this->xmlCount]='$this->makeTableHeader("xml","xml element",2);'; - $this->xmlSData[$this->xmlCount].='$this->makeTDHeader("xml","xmlName");'; - $this->xmlSData[$this->xmlCount].='echo "'.$this->xmlName[$this->xmlCount].'".$this->closeTDRow();'; - $this->xmlSData[$this->xmlCount].='$this->makeTDHeader("xml","xmlAttributes");'; - if(count($attribs)>0) - $this->xmlSData[$this->xmlCount].='$this->varIsArray($this->xmlAttrib['.$this->xmlCount.']);'; - else - $this->xmlSData[$this->xmlCount].='echo " ";'; - $this->xmlSData[$this->xmlCount].='echo $this->closeTDRow();'; - $this->xmlCount++; - } - - //xml: initiated when an end tag is encountered - function xmlEndElement($parser,$name) { - for($i=0;$i<$this->xmlCount;$i++) { - eval($this->xmlSData[$i]); - $this->makeTDHeader("xml","xmlText"); - echo (!empty($this->xmlCData[$i])) ? $this->xmlCData[$i] : " "; - echo $this->closeTDRow(); - $this->makeTDHeader("xml","xmlComment"); - echo (!empty($this->xmlDData[$i])) ? $this->xmlDData[$i] : " "; - echo $this->closeTDRow(); - $this->makeTDHeader("xml","xmlChildren"); - unset($this->xmlCData[$i],$this->xmlDData[$i]); - } - echo $this->closeTDRow(); - echo ""; - $this->xmlCount=0; - } - - //xml: initiated when text between tags is encountered - function xmlCharacterData($parser,$data) { - $count=$this->xmlCount-1; - if(!empty($this->xmlCData[$count])) - $this->xmlCData[$count].=$data; - else - $this->xmlCData[$count]=$data; - } - - //xml: initiated when a comment or other miscellaneous texts is encountered - function xmlDefaultHandler($parser,$data) { - //strip '' off comments - $data=str_replace(array("<!--","-->"),"",htmlspecialchars($data)); - $count=$this->xmlCount-1; - if(!empty($this->xmlDData[$count])) - $this->xmlDData[$count].=$data; - else - $this->xmlDData[$count]=$data; - } - - function initJSandCSS() { - echo << - /* code modified from ColdFusion's cfdump code */ - function dBug_toggleRow(source) { - var target = (document.all) ? source.parentElement.cells[1] : source.parentNode.lastChild; - dBug_toggleTarget(target,dBug_toggleSource(source)); - } - - function dBug_toggleSource(source) { - if (source.style.fontStyle=='italic') { - source.style.fontStyle='normal'; - source.title='click to collapse'; - return 'open'; - } else { - source.style.fontStyle='italic'; - source.title='click to expand'; - return 'closed'; - } - } - - function dBug_toggleTarget(target,switchToState) { - target.style.display = (switchToState=='open') ? '' : 'none'; - } - - function dBug_toggleTable(source) { - var switchToState=dBug_toggleSource(source); - if(document.all) { - var table=source.parentElement.parentElement; - for(var i=1;i - - -SCRIPTS; - } - -} -?> \ No newline at end of file + " . $header . " + "; + } + + // create the table row header + function makeTDHeader($type, $header) + { + echo " + " . $header . " + "; + } + + // close table row + function closeTDRow() + { + return "\n"; + } + + // error + function error($type) + { + $error = "Error: Variable cannot be a"; + // this just checks if the type starts with a vowel or "x" and displays either "a" or "an" + if (in_array(substr($type, 0, 1), array( + "a", + "e", + "i", + "o", + "u", + "x" + ))) + $error .= "n"; + return $error . " " . $type . " type"; + } + + // check variable type + function checkType($var) + { + switch (gettype($var)) { + case "resource": + $this->varIsResource($var); + break; + case "object": + $this->varIsObject($var); + break; + case "array": + $this->varIsArray($var); + break; + case "NULL": + $this->varIsNULL(); + break; + case "boolean": + $this->varIsBoolean($var); + break; + default: + $var = ($var == "") ? "[empty string]" : $var; + echo "\n\n\n
    " . $var . + "
    \n"; + break; + } + } + + // if variable is a NULL type + function varIsNULL() + { + echo "NULL"; + } + + // if variable is a boolean type + function varIsBoolean($var) + { + $var = ($var == 1) ? "TRUE" : "FALSE"; + echo $var; + } + + // if variable is an array type + function varIsArray($var) + { + $var_ser = serialize($var); + array_push($this->arrHistory, $var_ser); + + $this->makeTableHeader("array", "array"); + if (is_array($var)) { + foreach ($var as $key => $value) { + $this->makeTDHeader("array", $key); + + // check for recursion + if (is_array($value)) { + $var_ser = serialize($value); + if (in_array($var_ser, $this->arrHistory, true)) + $value = "*RECURSION*"; + } + + if (in_array(gettype($value), $this->arrType)) + $this->checkType($value); + else { + $value = (trim($value) == "") ? "[empty string]" : $value; + echo $value; + } + echo $this->closeTDRow(); + } + } else + echo "" . $this->error("array") . $this->closeTDRow(); + array_pop($this->arrHistory); + echo ""; + } + + // if variable is an object type + function varIsObject($var) + { + $var_ser = serialize($var); + array_push($this->arrHistory, $var_ser); + $this->makeTableHeader("object", "object"); + + if (is_object($var)) { + $arrObjVars = get_object_vars($var); + foreach ($arrObjVars as $key => $value) { + + $value = (! is_object($value) && ! is_array($value) && + trim($value) == "") ? "[empty string]" : $value; + $this->makeTDHeader("object", $key); + + // check for recursion + if (is_object($value) || is_array($value)) { + $var_ser = serialize($value); + if (in_array($var_ser, $this->arrHistory, true)) { + $value = (is_object($value)) ? "*RECURSION* -> $" . + get_class($value) : "*RECURSION*"; + } + } + if (in_array(gettype($value), $this->arrType)) + $this->checkType($value); + else + echo $value; + echo $this->closeTDRow(); + } + $arrObjMethods = get_class_methods(get_class($var)); + foreach ($arrObjMethods as $value) { + $this->makeTDHeader("object", $value); + echo "[function]" . $this->closeTDRow(); + } + } else + echo "" . $this->error("object") . $this->closeTDRow(); + array_pop($this->arrHistory); + echo ""; + } + + // if variable is a resource type + function varIsResource($var) + { + $this->makeTableHeader("resourceC", "resource", 1); + echo "\n\n"; + switch (get_resource_type($var)) { + case "fbsql result": + case "mssql result": + case "msql query": + case "pgsql result": + case "sybase-db result": + case "sybase-ct result": + case "mysql result": + $db = current(explode(" ", get_resource_type($var))); + $this->varIsDBResource($var, $db); + break; + case "gd": + $this->varIsGDResource($var); + break; + case "xml": + $this->varIsXmlResource($var); + break; + default: + echo get_resource_type($var) . $this->closeTDRow(); + break; + } + echo $this->closeTDRow() . "\n"; + } + + // if variable is a database resource type + function varIsDBResource($var, $db = "mysql") + { + if ($db == "pgsql") + $db = "pg"; + if ($db == "sybase-db" || $db == "sybase-ct") + $db = "sybase"; + $arrFields = array( + "name", + "type", + "flags" + ); + $numrows = call_user_func($db . "_num_rows", $var); + $numfields = call_user_func($db . "_num_fields", $var); + $this->makeTableHeader("resource", $db . " result", $numfields + 1); + echo " "; + for ($i = 0; $i < $numfields; $i ++) { + $field_header = ""; + for ($j = 0; $j < count($arrFields); $j ++) { + $db_func = $db . "_field_" . $arrFields[$j]; + if (function_exists($db_func)) { + $fheader = call_user_func($db_func, $var, $i) . " "; + if ($j == 0) + $field_name = $fheader; + else + $field_header .= $fheader; + } + } + $field[$i] = call_user_func($db . "_fetch_field", $var, $i); + echo "" . $field_name . ""; + } + echo ""; + for ($i = 0; $i < $numrows; $i ++) { + $row = call_user_func($db . "_fetch_array", $var, + constant(strtoupper($db) . "_ASSOC")); + echo "\n"; + echo "" . ($i + 1) . ""; + for ($k = 0; $k < $numfields; $k ++) { + $fieldrow = $row[($field[$k]->name)]; + $fieldrow = ($fieldrow == "") ? "[empty string]" : $fieldrow; + echo "" . $fieldrow . "\n"; + } + echo "\n"; + } + echo ""; + if ($numrows > 0) + call_user_func($db . "_data_seek", $var, 0); + } + + // if variable is an image/gd resource type + function varIsGDResource($var) + { + $this->makeTableHeader("resource", "gd", 2); + $this->makeTDHeader("resource", "Width"); + echo imagesx($var) . $this->closeTDRow(); + $this->makeTDHeader("resource", "Height"); + echo imagesy($var) . $this->closeTDRow(); + $this->makeTDHeader("resource", "Colors"); + echo imagecolorstotal($var) . $this->closeTDRow(); + echo ""; + } + + // if variable is an xml type + function varIsXml($var) + { + $this->varIsXmlResource($var); + } + + // if variable is an xml resource type + function varIsXmlResource($var) + { + $xml_parser = xml_parser_create(); + xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); + xml_set_element_handler($xml_parser, array( + &$this, + "xmlStartElement" + ), array( + &$this, + "xmlEndElement" + )); + xml_set_character_data_handler($xml_parser, + array( + &$this, + "xmlCharacterData" + )); + xml_set_default_handler($xml_parser, + array( + &$this, + "xmlDefaultHandler" + )); + + $this->makeTableHeader("xml", "xml document", 2); + $this->makeTDHeader("xml", "xmlRoot"); + + // attempt to open xml file + $bFile = (! ($fp = @fopen($var, "r"))) ? false : true; + + // read xml file + if ($bFile) { + while ($data = str_replace("\n", "", fread($fp, 4096))) + $this->xmlParse($xml_parser, $data, feof($fp)); + } // if xml is not a file, attempt to read it as a string + else { + if (! is_string($var)) { + echo $this->error("xml") . $this->closeTDRow() . "\n"; + return; + } + $data = $var; + $this->xmlParse($xml_parser, $data, 1); + } + + echo $this->closeTDRow() . "\n"; + } + + // parse xml + function xmlParse($xml_parser, $data, $bFinal) + { + if (! xml_parse($xml_parser, $data, $bFinal)) { + die( + sprintf("XML error: %s at line %d\n", + xml_error_string(xml_get_error_code($xml_parser)), + xml_get_current_line_number($xml_parser))); + } + } + + // xml: inititiated when a start tag is encountered + function xmlStartElement($parser, $name, $attribs) + { + $this->xmlAttrib[$this->xmlCount] = $attribs; + $this->xmlName[$this->xmlCount] = $name; + $this->xmlSData[$this->xmlCount] = '$this->makeTableHeader("xml","xml element",2);'; + $this->xmlSData[$this->xmlCount] .= '$this->makeTDHeader("xml","xmlName");'; + $this->xmlSData[$this->xmlCount] .= 'echo "' . + $this->xmlName[$this->xmlCount] . '".$this->closeTDRow();'; + $this->xmlSData[$this->xmlCount] .= '$this->makeTDHeader("xml","xmlAttributes");'; + if (! empty($attribs)) + $this->xmlSData[$this->xmlCount] .= '$this->varIsArray($this->xmlAttrib[' . + $this->xmlCount . ']);'; + else + $this->xmlSData[$this->xmlCount] .= 'echo " ";'; + $this->xmlSData[$this->xmlCount] .= 'echo $this->closeTDRow();'; + $this->xmlCount ++; + } + + // xml: initiated when an end tag is encountered + function xmlEndElement($parser, $name) + { + for ($i = 0; $i < $this->xmlCount; $i ++) { + eval($this->xmlSData[$i]); + $this->makeTDHeader("xml", "xmlText"); + echo (! empty($this->xmlCData[$i])) ? $this->xmlCData[$i] : " "; + echo $this->closeTDRow(); + $this->makeTDHeader("xml", "xmlComment"); + echo (! empty($this->xmlDData[$i])) ? $this->xmlDData[$i] : " "; + echo $this->closeTDRow(); + $this->makeTDHeader("xml", "xmlChildren"); + unset($this->xmlCData[$i], $this->xmlDData[$i]); + } + echo $this->closeTDRow(); + echo ""; + $this->xmlCount = 0; + } + + // xml: initiated when text between tags is encountered + function xmlCharacterData($parser, $data) + { + $count = $this->xmlCount - 1; + if (! empty($this->xmlCData[$count])) + $this->xmlCData[$count] .= $data; + else + $this->xmlCData[$count] = $data; + } + + // xml: initiated when a comment or other miscellaneous texts is encountered + function xmlDefaultHandler($parser, $data) + { + // strip '' off comments + $data = str_replace(array( + "<!--", + "-->" + ), "", htmlspecialchars($data)); + $count = $this->xmlCount - 1; + if (! empty($this->xmlDData[$count])) + $this->xmlDData[$count] .= $data; + else + $this->xmlDData[$count] = $data; + } + + function initJSandCSS() + { + echo << + /* code modified from ColdFusion's cfdump code */ + function dBug_toggleRow(source) { + var target = (document.all) ? source.parentElement.cells[1] : source.parentNode.lastChild; + dBug_toggleTarget(target,dBug_toggleSource(source)); + } + + function dBug_toggleSource(source) { + if (source.style.fontStyle=='italic') { + source.style.fontStyle='normal'; + source.title='click to collapse'; + return 'open'; + } else { + source.style.fontStyle='italic'; + source.title='click to expand'; + return 'closed'; + } + } + + function dBug_toggleTarget(target,switchToState) { + target.style.display = (switchToState=='open') ? '' : 'none'; + } + + function dBug_toggleTable(source) { + var switchToState=dBug_toggleSource(source); + if(document.all) { + var table=source.parentElement.parentElement; + for(var i=1;i + + + SCRIPTS; + } +} +?> diff --git a/lib/functions/code_testing/get_linked_tcversions.testplan.class.test.php b/lib/functions/code_testing/get_linked_tcversions.testplan.class.test.php index 91d823f67d..1752504406 100644 --- a/lib/functions/code_testing/get_linked_tcversions.testplan.class.test.php +++ b/lib/functions/code_testing/get_linked_tcversions.testplan.class.test.php @@ -1,159 +1,176 @@ -get_linked_tcversions($tplan_id); -echo '
    '; -echo $descr . '
    '; -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -*/ -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$descr='Get all linked test case versions'; - -$filters = array('tcase_id' => 32614); -$opt = array('exclude_info' => array('exec_info','assigned_on_build','priority')); -$lt=$obj_mgr->get_linked_tcversions($tplan_id,$filters,$opt); -echo '
    '; -echo $descr . '
    '; - -if( !is_null($filters) ) -{ - echo 'Filters:'; - new dBug($filters); -} - -if( !is_null($opt) ) -{ - echo 'Options:'; - new dBug($opt); -} -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$descr='Get all linked test case versions'; - -$filters = array('tcase_id' => 32614, 'assigned_on_build' => 5); -$opt = array('exclude_info' => array('exec_info','priority')); -$lt=$obj_mgr->get_linked_tcversions($tplan_id,$filters,$opt); -echo '
    ';echo $descr . '
    '; - -if( !is_null($filters) ) -{ - echo 'Filters:'; - new dBug($filters); -} - -if( !is_null($opt) ) -{ - echo 'Options:'; - new dBug($opt); -} -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$descr='Get all linked test case versions'; - -$filters = array('tcase_id' => 32614, 'assigned_on_build' => 5555); -$opt = array('exclude_info' => array('exec_info','priority')); -$lt=$obj_mgr->get_linked_tcversions($tplan_id,$filters,$opt); -echo '
    ';echo $descr . '
    '; - -if( !is_null($filters) ) -{ - echo 'Filters:'; - new dBug($filters); -} - -if( !is_null($opt) ) -{ - echo 'Options:'; - new dBug($opt); -} -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -// ------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------ -$descr='Get all linked test case versions'; - -$filters = array('platform_id' => 2, 'assigned_on_build' => 5555); -$opt = array('exclude_info' => array('exec_info','priority')); -$lt=$obj_mgr->get_linked_tcversions($tplan_id,$filters,$opt); -echo '
    ';echo $descr . '
    '; - -if( !is_null($filters) ) -{ - echo 'Filters:'; - new dBug($filters); -} - -if( !is_null($opt) ) -{ - echo 'Options:'; - new dBug($opt); -} -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -// ------------------------------------------------------------------------------------ - - -// ------------------------------------------------------------------------------------ -$tplan_id = 32676; -$descr='Get all linked test case versions'; - -$filters = array('platform_id' => 9, 'assigned_on_build' => 5555); -$opt = array('exclude_info' => array('exec_info','priority')); -$lt=$obj_mgr->get_linked_tcversions($tplan_id,$filters,$opt); -echo '
    ';echo $descr . '
    '; - -if( !is_null($filters) ) -{ - echo 'Filters:'; - new dBug($filters); -} - -if( !is_null($opt) ) -{ - echo 'Options:'; - new dBug($opt); -} -echo 'Qta records:' . count($lt) . '
    '; -new dBug($lt); -// ------------------------------------------------------------------------------------ - - - -?> \ No newline at end of file + 32614 +); +$opt = array( + 'exclude_info' => array( + 'exec_info', + 'assigned_on_build', + 'priority' + ) +); +$lt = $obj_mgr->get_linked_tcversions($tplan_id, $filters, $opt); +echo '
    '; +echo $descr . '
    '; + +if (! is_null($filters)) { + echo 'Filters:'; + new dBug($filters); +} + +if (! is_null($opt)) { + echo 'Options:'; + new dBug($opt); +} +echo 'Qta records:' . count($lt) . '
    '; +new dBug($lt); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$descr = 'Get all linked test case versions'; + +$filters = array( + 'tcase_id' => 32614, + 'assigned_on_build' => 5 +); +$opt = array( + 'exclude_info' => array( + 'exec_info', + 'priority' + ) +); +$lt = $obj_mgr->get_linked_tcversions($tplan_id, $filters, $opt); +echo '
    '; +echo $descr . '
    '; + +if (! is_null($filters)) { + echo 'Filters:'; + new dBug($filters); +} + +if (! is_null($opt)) { + echo 'Options:'; + new dBug($opt); +} +echo 'Qta records:' . count($lt) . '
    '; +new dBug($lt); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$descr = 'Get all linked test case versions'; + +$filters = array( + 'tcase_id' => 32614, + 'assigned_on_build' => 5555 +); +$opt = array( + 'exclude_info' => array( + 'exec_info', + 'priority' + ) +); +$lt = $obj_mgr->get_linked_tcversions($tplan_id, $filters, $opt); +echo '
    '; +echo $descr . '
    '; + +if (! is_null($filters)) { + echo 'Filters:'; + new dBug($filters); +} + +if (! is_null($opt)) { + echo 'Options:'; + new dBug($opt); +} +echo 'Qta records:' . count($lt) . '
    '; +new dBug($lt); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$descr = 'Get all linked test case versions'; + +$filters = array( + 'platform_id' => 2, + 'assigned_on_build' => 5555 +); +$opt = array( + 'exclude_info' => array( + 'exec_info', + 'priority' + ) +); +$lt = $obj_mgr->get_linked_tcversions($tplan_id, $filters, $opt); +echo '
    '; +echo $descr . '
    '; + +if (! is_null($filters)) { + echo 'Filters:'; + new dBug($filters); +} + +if (! is_null($opt)) { + echo 'Options:'; + new dBug($opt); +} +echo 'Qta records:' . count($lt) . '
    '; +new dBug($lt); +// ------------------------------------------------------------------------------------ + +// ------------------------------------------------------------------------------------ +$tplan_id = 32676; +$descr = 'Get all linked test case versions'; + +$filters = array( + 'platform_id' => 9, + 'assigned_on_build' => 5555 +); +$opt = array( + 'exclude_info' => array( + 'exec_info', + 'priority' + ) +); +$lt = $obj_mgr->get_linked_tcversions($tplan_id, $filters, $opt); +echo '
    '; +echo $descr . '
    '; + +if (! is_null($filters)) { + echo 'Filters:'; + new dBug($filters); +} + +if (! is_null($opt)) { + echo 'Options:'; + new dBug($opt); +} +echo 'Qta records:' . count($lt) . '
    '; +new dBug($lt); +// ------------------------------------------------------------------------------------ + +?> diff --git a/lib/functions/code_testing/requirement_mgr.class.test.php b/lib/functions/code_testing/requirement_mgr.class.test.php index 6726f26cf0..8f8624c5de 100644 --- a/lib/functions/code_testing/requirement_mgr.class.test.php +++ b/lib/functions/code_testing/requirement_mgr.class.test.php @@ -1,134 +1,145 @@ - Class Under Test : {$classUnderTest} "; -echo "
     {$classUnderTest}.class - constructor - $classUnderTest(&\$db)";echo "
    "; -$obj_mgr=new $classUnderTest($db); -new dBug($obj_mgr); - -// $method2test = "create"; -// echo "
     {$method2test} - $$method2test(&\$db)";echo "
    "; -// $obj_mgr=new $classUnderTest($db); -// new dBug($obj_mgr); - -$method2test = "updateOpen"; -$reqID = 18; -$reqVersionID = 19; -$value = 0; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - - -$method2test = "updateOpen"; -$reqID = 18; -$reqVersionID = 19; -$value = 1; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = 0; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = 1000; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = null; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = "one"; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = array(); -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = -18; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - -$method2test = "updateActive"; -$reqID = 18; -$reqVersionID = 19; -$value = false; -echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";echo "
    "; -echo "
     {$method2test} - $$method2test($reqVersionID,$value)";echo "
    "; - -$obj_mgr->$method2test($reqVersionID,$value); -$req_version = $obj_mgr->get_by_id($reqID); -new dBug($req_version); - - -?> \ No newline at end of file + Class Under Test : {$classUnderTest} "; +echo "
     {$classUnderTest}.class - constructor - $classUnderTest(&\$db)";
    +echo "
    "; +$obj_mgr = new $classUnderTest($db); +new dBug($obj_mgr); + +$method2test = "updateOpen"; +$reqID = 18; +$reqVersionID = 19; +$value = 0; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateOpen"; +$reqID = 18; +$reqVersionID = 19; +$value = 1; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = 0; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = 1000; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = null; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = "one"; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = array(); +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = - 18; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +$method2test = "updateActive"; +$reqID = 18; +$reqVersionID = 19; +$value = false; +echo "
     {$method2test} - $$method2test(&\$reqVersionID,\$value)";
    +echo "
    "; +echo "
     {$method2test} - $$method2test($reqVersionID,$value)";
    +echo "
    "; + +$obj_mgr->$method2test($reqVersionID, $value); +$req_version = $obj_mgr->get_by_id($reqID); +new dBug($req_version); + +?> diff --git a/lib/functions/code_testing/requirement_spec_mgr.class.test.php b/lib/functions/code_testing/requirement_spec_mgr.class.test.php index d3ecc8fc90..3cef1fa906 100644 --- a/lib/functions/code_testing/requirement_spec_mgr.class.test.php +++ b/lib/functions/code_testing/requirement_spec_mgr.class.test.php @@ -1,48 +1,40 @@ - Class Under Test : {$classUnderTest} "; -echo "
     {$classUnderTest}.class - constructor - $classUnderTest(&\$db)";echo "
    "; -$obj_mgr=new $classUnderTest($db); -new dBug($obj_mgr); - -// $method2test = "create"; -// echo "
     {$method2test} - $$method2test(&\$db)";echo "
    "; -// $obj_mgr=new $classUnderTest($db); -// new dBug($obj_mgr); - -$method2test = "create_revision"; -$rspecID='12'; -$item = array(); -$item['revision'] = 2; -$item['doc_id'] = 'DOCO'; -$item['name']='NIKO'; -$item['scope'] = ' Scoppppp'; -$item['status']=3; -$item['type'] ='K'; -$item['log_message']='This is a log message'; -$item['author_id']=1; -// $item['creation_ts']='This is a log message'; -// $item['modifier_id']='This is a log message'; -// $item['modification_ts']='This is a log message'; - -echo "
     {$method2test} - $$method2test(&\$rspecID,&\$item,)";echo "
    "; - - -new dBug($obj_mgr->$method2test($rspecID,$item)); - -?> \ No newline at end of file + Class Under Test : {$classUnderTest} "; +echo "
     {$classUnderTest}.class - constructor - $classUnderTest(&\$db)";
    +echo "
    "; +$obj_mgr = new $classUnderTest($db); +new dBug($obj_mgr); + +$method2test = "create_revision"; +$rspecID = '12'; +$item = array(); +$item['revision'] = 2; +$item['doc_id'] = 'DOCO'; +$item['name'] = 'NIKO'; +$item['scope'] = ' Scoppppp'; +$item['status'] = 3; +$item['type'] = 'K'; +$item['log_message'] = 'This is a log message'; +$item['author_id'] = 1; + +echo "
     {$method2test} - $$method2test(&\$rspecID,&\$item,)";
    +echo "
    "; + +new dBug($obj_mgr->$method2test($rspecID, $item)); + +?> diff --git a/lib/functions/code_testing/testcase.class.test.php b/lib/functions/code_testing/testcase.class.test.php index 28669208b2..fac3d15434 100644 --- a/lib/functions/code_testing/testcase.class.test.php +++ b/lib/functions/code_testing/testcase.class.test.php @@ -1,365 +1,367 @@ - testcase - constructor - testcase(&\$db)";echo ""; -$tcase_mgr = new testcase($db); - -$steps = array('notes' => array(1 => 'Lone Ranger',23 => 'Kimosawi'), - 'status' => array(1 => 'f', 23 => 'p')); - - -$context = new stdClass(); -$context->testplan_id = 2; -$context->platform_id = 0; -$context->build_id = 20; -$context->tester_id = 10; - - -$stepsID = array_keys($steps['notes']); -//$tcase_mgr->deleteStepsPartialExec($stepsID,$context); - -$m2r = 'saveStepsPartialExec'; -echo '
    Testing:' . $m2r . '
    '; -var_dump($steps,$context); -$tcase_mgr->$m2r($steps,$context); - -$m2r = 'getStepsPartialExec'; -echo '
    Testing:' . $m2r . '
    '; -var_dump($tcase_mgr->$m2r($stepsID,$context) ); - -die(); - - - -die(); - - -// new dBug($tcase_mgr); - -try -{ - $fullEID = 'PTJ09-1'; - echo '
    Testing getInternalID with fullEID
    '; - $va = $tcase_mgr->getInternalID($fullEID); - new dBug($va); -} -catch (Exception $e) -{ - echo 'Message: ' .$e->getMessage(); -} - -try -{ - $EID = 1; - echo '
    Testing getInternalID with ONLY NUMERIC EID
    '; - $va = $tcase_mgr->getInternalID($EID); - new dBug($va); -} -catch (Exception $e) -{ - echo 'Message: ' .$e->getMessage(); -} - -try -{ - $EID = 1; - echo '
    Testing getInternalID with ONLY NUMERIC EID
    '; - $va = $tcase_mgr->getInternalID($EID, array('tproject_id' => 282)); - new dBug($va); -} -catch (Exception $e) -{ - echo 'Message: ' .$e->getMessage(); -} - - -die(); - - -$items = array(1628,1626,1616,392,531); -$va = $tcase_mgr->get_last_active_version($items); -new dBug($va); - -$va = $tcase_mgr->get_last_active_version($items[0]); -new dBug($va); - -$options = array('access_key' => 'id', 'max_field' => 'version'); -$va = $tcase_mgr->get_last_active_version($items,$options); -new dBug($options); -new dBug($items); -new dBug($va); - - -die(); - -// SELECT MAX(version) AS version, NH_TCVERSION.parent_id AS id FROM tcversions TCV -// JOIN nodes_hierarchy NH_TCVERSION ON NH_TCVERSION.id = TCV.id AND TCV.active=1 -// AND NH_TCVERSION.parent_id IN () GROUP BY NH_TCVERSION.parent_id ORDER BY NH_TCVERSION.parent_id , -1) called at [C:\usr\local\xampp-1.7.2\xampp\htdocs\head-20100315\lib\functions\database.class.php:593] -// #1 database->fetchRowsIntoMap(/* Class:testcase - Method: get_last_active_version - -// $old_article = file_get_contents('./old_article.txt'); -// $new_article = $_REQUEST['article']; /* Let's say that someone pasted a new article to html form */ -// -// $diff = xdiff_string_diff($old_article, $new_article, 1); -// if (is_string($diff)) { -// echo "Differences between two articles:\n"; -// echo $diff; -// } - -$version_a=1; -$version_b=2; - -$tcase_id=88; -$va = $tcase_mgr->get_by_id($tcase_id,null,'ALL','ALL',$version_a); -$vb = $tcase_mgr->get_by_id($tcase_id,null,'ALL','ALL',$version_b); - -new dBug($va); -new dBug($vb); -$diff = xdiff_string_diff($va[0]['summary'], $vb[0]['summary'], 1); -echo "Differences between two articles:\n"; -echo $diff; -die(); - - - -// getByPathName -// function getByPathName($pathName,$pathSeparator='::') -$pathName='ZATHURA::Holodeck::Apollo 10 Simulation::Unload::Full speed unload'; -$fname = 'getByPathName'; -echo "
     testcase - $fname(\$pathName,\$pathSeparator='::')";echo "
    "; -echo "
                $fname($pathName)";echo "
    "; -$result=$tcase_mgr->$fname($pathName); -new dBug($result); -die(); - - -$tcase_id=318; -$tplan_id=389; -$build_id=21; -$platform_id=5; -$version_id=testcase::ALL_VERSIONS; -// $options = array('getNoExecutions' => true); -$options = null; - -// function get_last_execution($id,$version_id,$tplan_id,$build_id,$platform_id,$options=null) -echo "
     testcase - get_last_execution(\$id,\$version_id,\$tplan_id,\$build_id,\$platform_id\$options=null)";echo "
    "; -echo "
                get_last_execution($tcase_id,$version_id,$tplan_id,$build_id,$platform_id,$options)";echo "
    "; -$last_execution=$tcase_mgr->get_last_execution($tcase_id,$version_id,$tplan_id,$build_id,$platform_id,$options); -new dBug($last_execution); -die(); - -$tcase_id=4; -echo "
     testcase - get_by_id(\$id,\$version_id = TC_ALL_VERSIONS, \$active_status='ALL',\$open_status='ALL')";echo "
    "; -echo "
                get_by_id($tcase_id)";echo "
    "; -$tcase_info=$tcase_mgr->get_by_id($tcase_id); -new dBug($tcase_info); - - -$set_of_tcase_id=array(4,6); -echo "
                get_by_id($set_of_tcase_id)";echo "
    "; -$set_of_tcase_info=$tcase_mgr->get_by_id($set_of_tcase_id); -new dBug($set_of_tcase_info); - -$tcase_name='Configuration'; -$method='get_by_name'; -$tsuite_name=''; -$tproject_name=''; -echo "
                $method('{$tcase_name}')";echo "
    "; -$info=$tcase_mgr->$method($tcase_name); -new dBug($info); - -$tcase_name='Configuration'; -$tsuite_name='Bugzilla'; -$tproject_name=''; -$method='get_by_name'; -echo "
                $method('{$tcase_name}','{$tsuite_name}')";echo "
    "; -$info=$tcase_mgr->$method($tcase_name,$tsuite_name); -new dBug($info); - -$tcase_name='Configuration'; -$tsuite_name='Bugzilla'; -$tproject_name='IMPORT_TEST'; -$method='get_by_name'; -echo "
                $method('{$tcase_name}','{$tsuite_name}','{$tproject_name}')";echo "
    "; -$info=$tcase_mgr->$method($tcase_name,$tsuite_name,$tproject_name); -new dBug($info); - - -die(); - - - -$tcase_id=4; -echo "
     testcase - check_link_and_exec_status(\$id)";echo "
    "; -echo "
                check_link_and_exec_status($tcase_id)";echo "
    "; -$link_and_exec_status=$tcase_mgr->check_link_and_exec_status($tcase_id); -new dBug($link_and_exec_status); - - -echo "
     testcase - get_linked_versions(\$id,\$exec_status='ALL',\$active_status='ALL')";
    -echo "
                get_linked_versions($tcase_id)";
    -$linked_versions=$tcase_mgr->get_linked_versions($tcase_id);
    -new dBug($linked_versions);
    -
    -$tcase_id=4;
    -echo "
     testcase - get_testproject(\$id)";
    -echo "
                get_testproject($tcase_id)";
    -$testproject_id=$tcase_mgr->get_testproject($tcase_id);
    -new dBug("testproject id=" . $testproject_id);
    -
    -
    -$tcase_id=4;
    -echo "
     testcase - get_last_version_info(\$id)";
    -echo "
                get_last_version_info($tcase_id)";
    -$last_version_info=$tcase_mgr->get_last_version_info($tcase_id);
    -new dBug($last_version_info);
    -
    -
    -echo "
     testcase - get_versions_status_quo(\$id,\$tcversion_id=null, \$testplan_id=null)";
    -echo "
                get_versions_status_quo($tcase_id)";
    -$status_quo=$tcase_mgr->get_versions_status_quo($tcase_id);
    -new dBug($status_quo);
    -
    -
    -echo "
     testcase - get_exec_status(\$id)";
    -echo "
                get_exec_status($tcase_id)";
    -$testcase_exec_status=$tcase_mgr->get_exec_status($tcase_id);
    -new dBug($testcase_exec_status);
    -
    -
    -echo "
     testcase - getKeywords(\$tcID,\$kwID = null)";echo "
    "; -echo "
                getKeywords($tcase_id)";echo "
    "; -$keywords=$tcase_mgr->getKeywords($tcase_id); -new dBug($keywords); - - -echo "
     testcase - get_keywords_map(\$id,\$order_by_clause='')";echo "
    "; -$tcase_id=4; -echo "
                   get_keywords_map($tcase_id)";echo "
    "; -$keywords_map=$tcase_mgr->get_keywords_map($tcase_id); -new dBug($keywords_map); - - -$tcase_id=4; -$version_id=5; -$tplan_id=8; -$build_id=1; + testcase - constructor - testcase(&\$db)"; +echo "
    "; +$tcaseMgr = new testcase($db); + +$steps = array( + 'notes' => array( + 1 => 'Lone Ranger', + 23 => 'Kimosawi' + ), + 'status' => array( + 1 => 'f', + 23 => 'p' + ) +); + +$context = new stdClass(); +$context->testplan_id = 2; +$context->platform_id = 0; +$context->build_id = 20; +$context->tester_id = 10; + +$stepsID = array_keys($steps['notes']); + +$m2r = 'saveStepsPartialExec'; +echo '
    Testing:' . $m2r . '
    '; +var_dump($steps, $context); +$tcaseMgr->$m2r($steps, $context); + +$m2r = 'getStepsPartialExec'; +echo '
    Testing:' . $m2r . '
    '; +var_dump($tcaseMgr->$m2r($stepsID, $context)); + +die(); + +die(); + +try { + $fullEID = 'PTJ09-1'; + echo '
    Testing getInternalID with fullEID
    '; + $va = $tcaseMgr->getInternalID($fullEID); + new dBug($va); +} catch (Exception $e) { + echo 'Message: ' . $e->getMessage(); +} + +try { + $EID = 1; + echo '
    Testing getInternalID with ONLY NUMERIC EID
    '; + $va = $tcaseMgr->getInternalID($EID); + new dBug($va); +} catch (Exception $e) { + echo 'Message: ' . $e->getMessage(); +} + +try { + $EID = 1; + echo '
    Testing getInternalID with ONLY NUMERIC EID
    '; + $va = $tcaseMgr->getInternalID($EID, array( + 'tproject_id' => 282 + )); + new dBug($va); +} catch (Exception $e) { + echo 'Message: ' . $e->getMessage(); +} + +die(); + +$items = array( + 1628, + 1626, + 1616, + 392, + 531 +); +$va = $tcaseMgr->get_last_active_version($items); +new dBug($va); + +$va = $tcaseMgr->get_last_active_version($items[0]); +new dBug($va); + +$options = array( + 'access_key' => 'id', + 'max_field' => 'version' +); +$va = $tcaseMgr->get_last_active_version($items, $options); +new dBug($options); +new dBug($items); +new dBug($va); + +die(); + +// SELECT MAX(version) AS version, NH_TCVERSION.parent_id AS id FROM tcversions TCV +// JOIN nodes_hierarchy NH_TCVERSION ON NH_TCVERSION.id = TCV.id AND TCV.active=1 +// AND NH_TCVERSION.parent_id IN () GROUP BY NH_TCVERSION.parent_id ORDER BY NH_TCVERSION.parent_id , -1) called at [C:\usr\local\xampp-1.7.2\xampp\htdocs\head-20100315\lib\functions\database.class.php:593] +// #1 database->fetchRowsIntoMap(/* Class:testcase - Method: get_last_active_version + +$version_a = 1; +$version_b = 2; + +$tcase_id = 88; +$va = $tcaseMgr->get_by_id($tcase_id, null, 'ALL', 'ALL', $version_a); +$vb = $tcaseMgr->get_by_id($tcase_id, null, 'ALL', 'ALL', $version_b); + +new dBug($va); +new dBug($vb); +$diff = xdiff_string_diff($va[0]['summary'], $vb[0]['summary'], 1); +echo "Differences between two articles:\n"; +echo $diff; +die(); + +// getByPathName +// function getByPathName($pathName,$pathSeparator='::') +$pathName = 'ZATHURA::Holodeck::Apollo 10 Simulation::Unload::Full speed unload'; +$fname = 'getByPathName'; +echo "
     testcase - $fname(\$pathName,\$pathSeparator='::')";
    +echo "
    "; +echo "
                $fname($pathName)";
    +echo "
    "; +$result = $tcaseMgr->$fname($pathName); +new dBug($result); +die(); + +$tcase_id = 318; +$tplan_id = 389; +$build_id = 21; +$platform_id = 5; +$version_id = testcase::ALL_VERSIONS; +$options = null; + +// function getLastExecution($id,$version_id,$tplan_id,$build_id,$platform_id,$options=null) +echo "
     testcase - getLastExecution(\$id,\$version_id,\$tplan_id,\$build_id,\$platform_id\$options=null)";
    +echo "
    "; +echo "
                getLastExecution($tcase_id,$version_id,$tplan_id,$build_id,$platform_id,$options)";
    +echo "
    "; +$last_execution = $tcaseMgr->getLastExecution($tcase_id, $version_id, $tplan_id, + $build_id, $platform_id, $options); +new dBug($last_execution); +die(); + +$tcase_id = 4; +echo "
     testcase - get_by_id(\$id,\$version_id = TC_ALL_VERSIONS, \$active_status='ALL',\$open_status='ALL')";
    +echo "
    "; +echo "
                get_by_id($tcase_id)";
    +echo "
    "; +$tcase_info = $tcaseMgr->get_by_id($tcase_id); +new dBug($tcase_info); + +$set_of_tcase_id = array( + 4, + 6 +); +echo "
                get_by_id($set_of_tcase_id)";
    +echo "
    "; +$set_of_tcase_info = $tcaseMgr->get_by_id($set_of_tcase_id); +new dBug($set_of_tcase_info); + +$tcase_name = 'Configuration'; +$method = 'get_by_name'; +$tsuite_name = ''; +$tproject_name = ''; +echo "
                $method('{$tcase_name}')";
    +echo "
    "; +$info = $tcaseMgr->$method($tcase_name); +new dBug($info); + +$tcase_name = 'Configuration'; +$tsuite_name = 'Bugzilla'; +$tproject_name = ''; +$method = 'get_by_name'; +echo "
                $method('{$tcase_name}','{$tsuite_name}')";
    +echo "
    "; +$info = $tcaseMgr->$method($tcase_name, $tsuite_name); +new dBug($info); + +$tcase_name = 'Configuration'; +$tsuite_name = 'Bugzilla'; +$tproject_name = 'IMPORT_TEST'; +$method = 'get_by_name'; +echo "
                $method('{$tcase_name}','{$tsuite_name}','{$tproject_name}')";
    +echo "
    "; +$info = $tcaseMgr->$method($tcase_name, $tsuite_name, $tproject_name); +new dBug($info); + +die(); + +$tcase_id = 4; +echo "
     testcase - check_link_and_exec_status(\$id)";
    +echo "
    "; +echo "
                check_link_and_exec_status($tcase_id)";
    +echo "
    "; +$link_and_exec_status = $tcaseMgr->checkLinkAndExecStatus($tcase_id); +new dBug($link_and_exec_status); + +echo "
     testcase - get_linked_versions(\$id,\$exec_status='ALL',\$active_status='ALL')";
    +echo "
                get_linked_versions($tcase_id)";
    +$linked_versions = $tcaseMgr->get_linked_versions($tcase_id);
    +new dBug($linked_versions);
    +
    +$tcase_id = 4;
    +echo "
     testcase - get_testproject(\$id)";
    +echo "
                get_testproject($tcase_id)";
    +$testproject_id = $tcaseMgr->get_testproject($tcase_id);
    +new dBug("testproject id=" . $testproject_id);
    +
    +$tcase_id = 4;
    +echo "
     testcase - getLastVersionInfo(\$id)";
    +echo "
                getLastVersionInfo($tcase_id)";
    +$last_version_info = $tcaseMgr->getLastVersionInfo($tcase_id);
    +new dBug($last_version_info);
    +
    +echo "
     testcase - get_versions_status_quo(\$id,\$tcversion_id=null, \$testplan_id=null)";
    +echo "
                get_versions_status_quo($tcase_id)";
    +$status_quo = $tcaseMgr->getVersionsStatusQuo($tcase_id);
    +new dBug($status_quo);
    +
    +echo "
     testcase - get_exec_status(\$id)";
    +echo "
                get_exec_status($tcase_id)";
    +$testcase_exec_status = $tcaseMgr->getExecStatus($tcase_id);
    +new dBug($testcase_exec_status);
    +
    +echo "
     testcase - getKeywords(\$tcID,\$kwID = null)";
    +echo "
    "; +echo "
                getKeywords($tcase_id)";
    +echo "
    "; +$keywords = $tcaseMgr->getKeywords($tcase_id); +new dBug($keywords); + +echo "
     testcase - get_keywords_map(\$id,\$order_by_clause='')";
    +echo "
    "; +$tcase_id = 4; +echo "
                   get_keywords_map($tcase_id)";
    +echo "
    "; +$keywords_map = $tcaseMgr->get_keywords_map($tcase_id); +new dBug($keywords_map); + +$tcase_id = 4; +$version_id = 5; +$tplan_id = 8; +$build_id = 1; echo "
     testcase - get_executions(\$id,\$version_id,\$tplan_id,\$build_id,
    - \$exec_id_order='DESC',\$exec_to_exclude=null)";echo "
    "; - -echo "
                get_executions($tcase_id,$version_id,$tplan_id,$build_id)";echo "
    "; -$executions=$tcase_mgr->get_executions($tcase_id,$version_id,$tplan_id,$build_id); -new dBug($executions); - - -echo "
     testcase - get_last_execution(\$id,\$version_id,\$tplan_id,\$build_id,\$get_no_executions=0)";echo "
    "; -echo "
                get_last_execution($tcase_id,$version_id,$tplan_id,$build_id)";echo "
    "; -$last_execution=$tcase_mgr->get_last_execution($tcase_id,$version_id,$tplan_id,$build_id); -new dBug($last_execution); - - - - -$tcversion_id=5; -$tplan_id=8; -echo "
     testcase - get_version_exec_assignment(\$tcversion_id,\$tplan_id)";echo "
    "; -echo "
                get_version_exec_assignment($tcversion_id,$tplan_id)";echo "
    "; -$version_exec_assignment=$tcase_mgr->get_version_exec_assignment($tcversion_id,$tplan_id); -new dBug($version_exec_assignment); - - -echo "
     testcase - get_linked_cfields_at_design(\$id,\$parent_id=null,\$show_on_execution=null)";echo "
    "; -echo "
                get_linked_cfields_at_design($tcase_id)";echo "
    "; -$linked_cfields_at_design=$tcase_mgr->get_linked_cfields_at_design($tcase_id); -new dBug($linked_cfields_at_design); - - - + \$exec_id_order='DESC',\$exec_to_exclude=null)"; +echo "
    "; + +echo "
                get_executions($tcase_id,$version_id,$tplan_id,$build_id)";
    +echo "
    "; +$executions = $tcaseMgr->get_executions($tcase_id, $version_id, $tplan_id, + $build_id); +new dBug($executions); + +echo "
     testcase - getLastExecution(\$id,\$version_id,\$tplan_id,\$build_id,\$get_no_executions=0)";
    +echo "
    "; +echo "
                getLastExecution($tcase_id,$version_id,$tplan_id,$build_id)";
    +echo "
    "; +$last_execution = $tcaseMgr->getLastExecution($tcase_id, $version_id, $tplan_id, + $build_id); +new dBug($last_execution); + +$tcversion_id = 5; +$tplan_id = 8; +echo "
     testcase - getVersionExecAssignment(\$tcversion_id,\$tplan_id)";
    +echo "
    "; +echo "
                getVersionExecAssignment($tcversion_id,$tplan_id)";
    +echo "
    "; +$version_exec_assignment = $tcaseMgr->getVersionExecAssignment($tcversion_id, + $tplan_id); +new dBug($version_exec_assignment); + +echo "
     testcase - get_linked_cfields_at_design(\$id,\$parent_id=null,\$show_on_execution=null)";
    +echo "
    "; +echo "
                get_linked_cfields_at_design($tcase_id)";
    +echo "
    "; +$linked_cfields_at_design = $tcaseMgr->get_linked_cfields_at_design($tcase_id); +new dBug($linked_cfields_at_design); + echo "
     testcase - get_linked_cfields_at_execution(\$id,\$parent_id=null,
    \$show_on_execution=null,
    - \$execution_id=null,\$testplan_id=null)";echo "
    "; -echo "
                get_linked_cfields_at_execution($tcase_id)";echo "
    "; -$linked_cfields_at_execution=$tcase_mgr->get_linked_cfields_at_execution($tcase_id); -new dBug($linked_cfields_at_execution); - - - -echo "
     testcase - html_table_of_custom_field_inputs(\$id,\$parent_id=null,\$scope='design',\$name_suffix='')";echo "
    "; -echo "
                html_table_of_custom_field_inputs($tcase_id)";echo "
    "; -$table_of_custom_field_inputs=$tcase_mgr->html_table_of_custom_field_inputs($tcase_id); -echo "
    "; echo $table_of_custom_field_inputs; echo "
    "; - - + \$execution_id=null,\$testplan_id=null)"; +echo "
    "; +echo "
                get_linked_cfields_at_execution($tcase_id)";
    +echo "
    "; +$linked_cfields_at_execution = $tcaseMgr->get_linked_cfields_at_execution( + $tcase_id); +new dBug($linked_cfields_at_execution); + +echo "
     testcase - html_table_of_custom_field_inputs(\$id,\$parent_id=null,\$scope='design',\$name_suffix='')";
    +echo "
    "; +echo "
                html_table_of_custom_field_inputs($tcase_id)";
    +echo "
    "; +$table_of_custom_field_inputs = $tcaseMgr->html_table_of_custom_field_inputs( + $tcase_id); +echo "
    ";
    +echo $table_of_custom_field_inputs;
    +echo "
    "; + echo "
     testcase - html_table_of_custom_field_values(\$id,\$scope='design',
    \$show_on_execution=null,
    - \$execution_id=null,\$testplan_id=null) ";echo "
    "; - -echo "
     testcase - html_table_of_custom_field_values($tcase_id)";echo "
    "; -$table_of_custom_field_values=$tcase_mgr->html_table_of_custom_field_values($tcase_id); -echo "
    "; echo $table_of_custom_field_values; echo "
    "; - - - - - - - - -/* - function testcase(&$db) -function get_by_name($name) -function get_all() -function show(&$smarty,$id, $user_id, $version_id=TC_ALL_VERSIONS, $action='', -function update($id,$tcversion_id,$name,$summary,$steps, -function check_link_and_exec_status($id) -function delete($id,$version_id = TC_ALL_VERSIONS) -function get_linked_versions($id,$exec_status="ALL",$active_status='ALL') -function _blind_delete($id,$version_id=TC_ALL_VERSIONS,$children=null) -function _execution_delete($id,$version_id=TC_ALL_VERSIONS,$children=null) -function get_testproject($id) -function copy_to($id,$parent_id,$user_id, -function create_new_version($id,$user_id) -function get_last_version_info($id) -function copy_tcversion($from_tcversion_id,$to_tcversion_id,$as_version_number,$user_id) -function get_by_id_bulk($id,$version_id=TC_ALL_VERSIONS, $get_active=0, $get_open=0) -function get_by_id($id,$version_id = TC_ALL_VERSIONS, $active_status='ALL',$open_status='ALL') -function get_versions_status_quo($id, $tcversion_id=null, $testplan_id=null) -function get_exec_status($id) -function getKeywords($tcID,$kwID = null) -function get_keywords_map($id,$order_by_clause='') -function addKeyword($id,$kw_id) -function addKeywords($id,$kw_ids) -function copyKeywordsTo($id,$destID) -function deleteKeywords($tcID,$kwID = null) -function get_executions($id,$version_id,$tplan_id,$build_id,$exec_id_order='DESC',$exec_to_exclude=null) -function get_last_execution($id,$version_id,$tplan_id,$build_id,$get_no_executions=0) -function exportTestCaseDataToXML($tcase_id,$tcversion_id,$bNoXMLHeader = false,$optExport = array()) -function get_version_exec_assignment($tcversion_id,$tplan_id) -function update_active_status($id,$tcversion_id,$active_status) -function copy_attachments($source_id,$target_id) -function deleteAttachments($id) -function get_linked_cfields_at_design($id,$parent_id=null,$show_on_execution=null) -function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design',$name_suffix='') -function html_table_of_custom_field_values($id,$scope='design',$show_on_execution=null, -function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null, -function copy_cfields_design_values($from_id,$to_id) -*/?> + \$execution_id=null,\$testplan_id=null) "; +echo "
    "; + +echo "
     testcase - html_table_of_custom_field_values($tcase_id)";
    +echo "
    "; +$table_of_custom_field_values = $tcaseMgr->html_table_of_custom_field_values( + $tcase_id); +echo "
    ";
    +echo $table_of_custom_field_values;
    +echo "
    "; + +/* + * function testcase(&$db) + * function get_by_name($name) + * function get_all() + * function show(&$smarty,$id, $user_id, $version_id=TC_ALL_VERSIONS, $action='', + * function update($id,$tcversion_id,$name,$summary,$steps, + * function check_link_and_exec_status($id) + * function delete($id,$version_id = TC_ALL_VERSIONS) + * function get_linked_versions($id,$exec_status="ALL",$active_status='ALL') + * function _blind_delete($id,$version_id=TC_ALL_VERSIONS,$children=null) + * function _execution_delete($id,$version_id=TC_ALL_VERSIONS,$children=null) + * function get_testproject($id) + * function copy_to($id,$parent_id,$user_id, + * function create_new_version($id,$user_id) + * function getLastVersionInfo($id) + * function copy_tcversion($from_tcversion_id,$to_tcversion_id,$as_version_number,$user_id) + * function get_by_id_bulk($id,$version_id=TC_ALL_VERSIONS, $get_active=0, $get_open=0) + * function get_by_id($id,$version_id = TC_ALL_VERSIONS, $active_status='ALL',$open_status='ALL') + * function get_versions_status_quo($id, $tcversion_id=null, $testplan_id=null) + * function get_exec_status($id) + * function getKeywords($tcID,$kwID = null) + * function get_keywords_map($id,$order_by_clause='') + * function addKeyword($id,$kw_id) + * function addKeywords($id,$kw_ids) + * function copyKeywordsTo($id,$destID) + * function deleteKeywords($tcID,$kwID = null) + * function get_executions($id,$version_id,$tplan_id,$build_id,$exec_id_order='DESC',$exec_to_exclude=null) + * function getLastExecution($id,$version_id,$tplan_id,$build_id,$get_no_executions=0) + * function exportTestCaseDataToXML($tcase_id,$tcversion_id,$bNoXMLHeader = false,$optExport = array()) + * function getVersionExecAssignment($tcversion_id,$tplan_id) + * function update_active_status($id,$tcversion_id,$active_status) + * function copy_attachments($source_id,$target_id) + * function deleteAttachments($id) + * function get_linked_cfields_at_design($id,$parent_id=null,$show_on_execution=null) + * function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design',$name_suffix='') + * function html_table_of_custom_field_values($id,$scope='design',$show_on_execution=null, + * function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null, + * function copyCfieldsDesignValues($from_id,$to_id) + */ +?> diff --git a/lib/functions/code_testing/testplan.class.test.php b/lib/functions/code_testing/testplan.class.test.php index 89d94b2713..45edc30451 100644 --- a/lib/functions/code_testing/testplan.class.test.php +++ b/lib/functions/code_testing/testplan.class.test.php @@ -1,339 +1,269 @@ -Poor's Man - $object_item - code inspection tool
    "; -echo "
    Scope of this page is allow you to understand with live
    "; -echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; -echo "Important:"; -echo "You are using your testlink DB to do all operations"; -echo "
    "; -echo "
    "; -echo "
     $object_item - constructor - $object_class(&\$db)";echo "
    "; -$obj_mgr=new $object_class($db); -new dBug($obj_mgr); - -// echo "
     testplan - get_linked_tcversions(\$tplan_id,\$tcase_id=null,\$keyword_id=0,\$executed=null,
    -//                                              \$assigned_to=null,\$exec_status=null,\$build_id=0,
    -//                                              \$cf_hash = null)";echo "
    "; -// - -$tplan_id = 1212; -echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";echo "
    "; -echo "
     get_linked_tcversions($tplan_id)";echo "
    "; -$linked_tcversions=$obj_mgr->get_linked_tcversions($tplan_id); -new dBug($linked_tcversions); - -$options = array('output' => 'mapOfMap'); -echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";echo "
    "; - -echo "
     get_linked_tcversions($tplan_id,null,$options)";echo "
    "; -new dBug($options); -$linked_tcversions=$obj_mgr->get_linked_tcversions($tplan_id,null,$options); -new dBug($linked_tcversions); - -$options = array('output' => 'array'); -echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";echo "
    "; - -echo "
     get_linked_tcversions($tplan_id,null,$options)";echo "
    "; -new dBug($options); -$linked_tcversions=$obj_mgr->get_linked_tcversions($tplan_id,null,$options); -new dBug($linked_tcversions); - -die(); - - - - - - - - - -$target_testproject=new stdClass(); -$target_testproject->name='Testplan Class Unit Test'; -$target_testproject->color=''; - -$target_testproject->options=new stdClass(); -$target_testproject->options->requirement_mgmt=1; -$target_testproject->options->priority_mgmt=1; -$target_testproject->options->automated_execution=1; - -$target_testproject->notes='Created to run testplan unit tests on '; -$target_testproject->active=1; -$target_testproject->tcasePrefix='TPlanUnitTest'; - -// Create a test project that will be Test plan parent -$tproject_mgr=new testproject($db); -$info=$tproject_mgr->get_by_name($target_testproject->name); -if( !is_null($info) ) -{ - $name=$info[0]['name']; - echo "TestProject with name {$name} exists!
    Will be deleted and re-created"; - $tproject_mgr->delete($info[0]['id']); -} -$testproject_id=$tproject_mgr->create($target_testproject->name, - $target_testproject->color, - $target_testproject->options, - $target_testproject->notes,$target_testproject->active, - $target_testproject->tcasePrefix); - - -$testplan = new stdClass(); -$testplan->name='Test Plan Code Testing'; -$testplan->notes='Test Plan created running Code Testing code by TestLink Development Team'; -echo "
     {$object_class} - create(\$name,\$notes,\$testproject_id)";echo "
    "; -echo "
     {$object_class} - create('$testplan->name','$testplan->notes',$testproject_id)";echo "
    "; -$testplan->id=$obj_mgr->create($testplan->name,$testplan->notes,$testproject_id); -$info=$obj_mgr->get_by_id($testplan->id); -new dBug($info); - - - - -// --------------------------------------------------------------------------------------------------------- -// Build Manager -// --------------------------------------------------------------------------------------------------------- -// Support Object -$tplan_mgr=new testplan($db); - -$object_item="Build Manager"; -$object_class="build_mgr"; -$object_class_file="testplan"; - -echo "
    Poor's Man - $object_item - code inspection tool
    "; -echo "
    Scope of this page is allow you to understand with live
    "; -echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; -echo "Important:"; -echo "You are using your testlink DB to do all operations"; -echo "
    "; -echo "
    "; -echo "
     $object_item - constructor - $object_class(&\$db)";echo "
    "; -$obj_mgr=new $object_class($db); -new dBug($obj_mgr); - - - - - - -$build = new stdClass(); -$build->name='Build Code Testing'; -$build->notes='Build created running Code Testing code by TestLink Development Team'; - -echo "
     {$object_class} - create(\$tplan_id,\$name,\$notes = '',\$active=1,\$open=1)";echo "
    "; -echo "
     {$object_class} - create($testplan->id,'$build->name','$build->notes')";echo "
    "; -$build->id=$obj_mgr->create($testplan->id,$build->name,$build->notes); -$info=$obj_mgr->get_by_id($build->id); -new dBug($info); - -echo "
     Check Build existence using testplan manager method 'get_builds()'";echo "
    "; -echo "
     testplan - get_builds(\$testplan_id,\$active=null,\$open=null)";echo "
    "; -echo "
                get_builds($testplan->id)";echo "
    "; -$all_builds=$tplan_mgr->get_builds($testplan->id); -new dBug($all_builds); - -// Final Clean-Up -$tproject_mgr->delete($testproject_id); -die(); - - -// OLD CODE MUST BE REFACTORED -echo "
     testplan - get_all()";echo "
    "; -$all_testplans_on_tl=$tplan_mgr->get_all(); -new dBug($all_testplans_on_tl); - -$tplan_id=-1; -if( !is_null($all_testplans_on_tl) ) -{ - $tplan_id=$all_testplans_on_tl[0]['id']; -} - -echo "
     testplan - get_by_id(\$id)";echo "
    "; -echo "
                get_by_id($tplan_id)";echo "
    "; -$tplan_info=$tplan_mgr->get_by_id($tplan_id); -new dBug($tplan_info); - - -$tplan_name="TEST_TESTPLAN"; -echo "
     testplan - get_by_name(\$name,\$tproject_id = 0)";echo "
    "; -echo "
                get_by_name($tplan_name)";echo "
    "; -$tplan_info=$tplan_mgr->get_by_name($tplan_name); -new dBug($tplan_info); - - -echo "
     testplan - get_builds(\$tplan_id,\$active=null,\$open=null)";echo "
    "; -echo "
                get_builds($tplan_id)";echo "
    "; -$all_builds=$tplan_mgr->get_builds($tplan_id); -new dBug($all_builds); - - -echo "
     testplan - count_testcases(\$tplan_id)";echo "
    "; -echo "
                count_testcases($tplan_id)";echo "
    "; -$count_testcases=$tplan_mgr->count_testcases($tplan_id); -new dBug("Number of testcase linked to test plan=" . $count_testcases); - -// echo "
     testplan - get_linked_tcversions(\$tplan_id,\$tcase_id=null,\$keyword_id=0,\$executed=null,
    -//                                              \$assigned_to=null,\$exec_status=null,\$build_id=0,
    -//                                              \$cf_hash = null)";echo "
    "; -// - - -echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";echo "
    "; - -echo "
                get_linked_tcversions($tplan_id)";echo "
    "; -$linked_tcversions=$tplan_mgr->get_linked_tcversions($tplan_id); -new dBug($linked_tcversions); - - - -// ------------------------------------------------------------------------------------------- -echo "

    Build Manager Class

    "; -echo "
     build manager - constructor - build_mgr(&\$db)";echo "
    "; -$build_mgr=new build_mgr($db); -new dBug($build_mgr); - - -$all_builds=$tplan_mgr->get_builds($tplan_id); -$dummy=array_keys($all_builds); -$build_id=$dummy[0]; - -echo "
     build manager - get_by_id(\$id)";echo "
    "; -echo "
                     get_by_id($build_id)";echo "
    "; -$build_info=$build_mgr->get_by_id($build_id); -new dBug($build_info); - - - - - - -/* - -// getKeywords($testproject_id,$keywordID = null) -$tplan_id=1; -echo "
     testplan - getKeywords(\$testproject_id,\$keywordID = null)";echo "
    "; -echo "
                   getKeywords($tplan_id)";echo "
    "; -$keywords=$tplan_mgr->getKeywords($tplan_id); -new dBug($keywords); - - -echo "
     testplan - get_keywords_map(\$testproject_id)";echo "
    "; -$tplan_id=1; -echo "
                   get_keywords_map($tplan_id)";echo "
    "; -$keywords_map=$tplan_mgr->get_keywords_map($tplan_id); -new dBug($keywords_map); - - -echo "
     testplan - get_keywords_tcases(\$testproject_id, \$keyword_id=0)";echo "
    "; -echo "
                   get_keywords_tcases($tplan_id)";echo "
    "; -$keywords_tcases=$tplan_mgr->get_keywords_tcases($tplan_id); -new dBug($keywords_tcases); - - -echo "
     testplan - get_linked_custom_fields(\$id,\$node_type=null)";echo "
    "; -echo "
                   get_linked_custom_fields($tplan_id)";echo "
    "; -$linked_custom_fields=$tplan_mgr->get_linked_custom_fields($tplan_id); -new dBug($linked_custom_fields); - - -echo "
     testplan - gen_combo_test_suites(\$id,\$exclude_branches=null,\$mode='dotted')";echo "
    "; -echo "
                   gen_combo_test_suites($tplan_id,null,'dotted')";echo "
    "; -$combo_test_suites=$tplan_mgr->gen_combo_test_suites($tplan_id,null,'dotted'); -new dBug($combo_test_suites); - -echo "
                   gen_combo_test_suites($tplan_id,null,'dotted')";echo "
    "; -$combo_test_suites=$tplan_mgr->gen_combo_test_suites($tplan_id,null,'array'); -new dBug($combo_test_suites); - - -echo "
     testplan - getReqSpec(\$testproject_id, \$id = null)";echo "
    "; -echo "
                   getReqSpec($tplan_id)";echo "
    "; -$requirement_spec=$tplan_mgr->getReqSpec($tplan_id); -new dBug($requirement_spec); - -$srs_id=2; -echo "
                   getReqSpec(\$tplan_id,\$srs_id)";echo "
    "; -echo "
                   getReqSpec($tplan_id,$srs_id)";echo "
    "; -$requirement_spec=$tplan_mgr->getReqSpec($tplan_id,$srs_id); -new dBug($requirement_spec); - - -$srs_title='SRS2'; -echo "
     testplan - get_srs_by_title(\$testproject_id,\$title,\$ignore_case=0)";echo "
    "; -echo "
                   get_srs_by_title($tplan_id,$srs_title)";echo "
    "; -$srs_by_title=$tplan_mgr->get_srs_by_title($tplan_id,$srs_title); -new dBug($srs_by_title); - -// function get_srs_by_title($testproject_id,$title,$ignore_case=0) -*/ - -/* -function count_testcases($id) - -function link_tcversions($id,&$items_to_link) -function get_linked_tcversions($id,$tcase_id=null,$keyword_id=0,$executed=null, -function get_linked_and_newest_tcversions($id,$tcase_id=null) -function unlink_tcversions($id,&$items) -function get_keywords_map($id,$order_by_clause='') -function get_keywords_tcases($id,$keyword_id=0) -function copy_as($id,$new_tplan_id,$tplan_name=null,$tproject_id=null) -function copy_builds($id,$new_tplan_id) -function copy_linked_tcversions($id,$new_tplan_id) -function copy_milestones($id,$new_tplan_id) -function get_milestones($id) -function copy_user_roles($id,$new_tplan_id) -function copy_priorities($id,$new_tplan_id) -function delete($id) -function get_builds_for_html_options($id,$active=null,$open=null) -function get_max_build_id($id,$active = null,$open = null) -function get_builds($id,$active=null,$open=null) -function _natsort_builds($builds_map) -function check_build_name_existence($tplan_id,$build_name,$case_sensitive=0) -function create_build($tplan_id,$name,$notes = '',$active=1,$open=1) -function get_linked_cfields_at_design($id,$parent_id=null,$show_on_execution=null) -function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null) -function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design') -function html_table_of_custom_field_values($id,$scope='design',$show_on_execution=null) -} // function end -function insert_default_priorities($tplan_id) -function get_priority_rules($tplan_id,$do_lang_get=0) -function set_priority_rules($tplan_id,$priority_hash) -function filter_cf_selection ($tp_tcs, $cf_hash) - -function build_mgr(&$db) -function create($tplan_id,$name,$notes = '',$active=1,$open=1) -function update($id,$name,$notes,$active=null,$open=null) -function delete($id) -function get_by_id($id) -function milestone_mgr(&$db) -function create($tplan_id,$name,$date,$A,$B,$C) -function update($id,$name,$date,$A,$B,$C) -function delete($id) -function get_by_id($id) -function get_all_by_testplan($tplan_id) - - -*/ +Poor's Man - $object_item - code inspection tool
    "; +echo "
    Scope of this page is allow you to understand with live
    "; +echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; +echo "Important:"; +echo "You are using your testlink DB to do all operations"; +echo "
    "; +echo "
    "; +echo "
     $object_item - constructor - $object_class(&\$db)";
    +echo "
    "; +$obj_mgr = new $object_class($db); +new dBug($obj_mgr); + +$tplan_id = 1212; +echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";
    +echo "
    "; +echo "
     get_linked_tcversions($tplan_id)";
    +echo "
    "; +$linked_tcversions = $obj_mgr->get_linked_tcversions($tplan_id); +new dBug($linked_tcversions); + +$options = array( + 'output' => 'mapOfMap' +); +echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";
    +echo "
    "; + +echo "
     get_linked_tcversions($tplan_id,null,$options)";
    +echo "
    "; +new dBug($options); +$linked_tcversions = $obj_mgr->get_linked_tcversions($tplan_id, null, $options); +new dBug($linked_tcversions); + +$options = array( + 'output' => 'array' +); +echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";
    +echo "
    "; + +echo "
     get_linked_tcversions($tplan_id,null,$options)";
    +echo "
    "; +new dBug($options); +$linked_tcversions = $obj_mgr->get_linked_tcversions($tplan_id, null, $options); +new dBug($linked_tcversions); + +die(); + +$target_testproject = new stdClass(); +$target_testproject->name = 'Testplan Class Unit Test'; +$target_testproject->color = ''; + +$target_testproject->options = new stdClass(); +$target_testproject->options->requirement_mgmt = 1; +$target_testproject->options->priority_mgmt = 1; +$target_testproject->options->automated_execution = 1; + +$target_testproject->notes = 'Created to run testplan unit tests on '; +$target_testproject->active = 1; +$target_testproject->tcasePrefix = 'TPlanUnitTest'; + +// Create a test project that will be Test plan parent +$tproject_mgr = new testproject($db); +$info = $tproject_mgr->get_by_name($target_testproject->name); +if (! is_null($info)) { + $name = $info[0]['name']; + echo "TestProject with name {$name} exists!
    Will be deleted and re-created"; + $tproject_mgr->delete($info[0]['id']); +} +$testproject_id = $tproject_mgr->create($target_testproject->name, + $target_testproject->color, $target_testproject->options, + $target_testproject->notes, $target_testproject->active, + $target_testproject->tcasePrefix); + +$testplan = new stdClass(); +$testplan->name = 'Test Plan Code Testing'; +$testplan->notes = 'Test Plan created running Code Testing code by TestLink Development Team'; +echo "
     {$object_class} - create(\$name,\$notes,\$testproject_id)";
    +echo "
    "; +echo "
     {$object_class} - create('$testplan->name','$testplan->notes',$testproject_id)";
    +echo "
    "; +$testplan->id = $obj_mgr->create($testplan->name, $testplan->notes, + $testproject_id); +$info = $obj_mgr->get_by_id($testplan->id); +new dBug($info); + +// --------------------------------------------------------------------------------------------------------- +// Build Manager +// --------------------------------------------------------------------------------------------------------- +// Support Object +$tplan_mgr = new testplan($db); + +$object_item = "Build Manager"; +$object_class = "build_mgr"; +$object_class_file = "testplan"; + +echo "
    Poor's Man - $object_item - code inspection tool
    "; +echo "
    Scope of this page is allow you to understand with live
    "; +echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; +echo "Important:"; +echo "You are using your testlink DB to do all operations"; +echo "
    "; +echo "
    "; +echo "
     $object_item - constructor - $object_class(&\$db)";
    +echo "
    "; +$obj_mgr = new $object_class($db); +new dBug($obj_mgr); + +$build = new stdClass(); +$build->name = 'Build Code Testing'; +$build->notes = 'Build created running Code Testing code by TestLink Development Team'; + +echo "
     {$object_class} - create(\$tplan_id,\$name,\$notes = '',\$active=1,\$open=1)";
    +echo "
    "; +echo "
     {$object_class} - create($testplan->id,'$build->name','$build->notes')";
    +echo "
    "; +$build->id = $obj_mgr->create($testplan->id, $build->name, $build->notes); +$info = $obj_mgr->get_by_id($build->id); +new dBug($info); + +echo "
     Check Build existence using testplan manager method 'get_builds()'";
    +echo "
    "; +echo "
     testplan - get_builds(\$testplan_id,\$active=null,\$open=null)";
    +echo "
    "; +echo "
                get_builds($testplan->id)";
    +echo "
    "; +$all_builds = $tplan_mgr->get_builds($testplan->id); +new dBug($all_builds); + +// Final Clean-Up +$tproject_mgr->delete($testproject_id); +die(); + +// OLD CODE MUST BE REFACTORED +echo "
     testplan - get_all()";
    +echo "
    "; +$all_testplans_on_tl = $tplan_mgr->getAll(); +new dBug($all_testplans_on_tl); + +$tplan_id = - 1; +if (! is_null($all_testplans_on_tl)) { + $tplan_id = $all_testplans_on_tl[0]['id']; +} + +echo "
     testplan - get_by_id(\$id)";
    +echo "
    "; +echo "
                get_by_id($tplan_id)";
    +echo "
    "; +$tplan_info = $tplan_mgr->get_by_id($tplan_id); +new dBug($tplan_info); + +$tplan_name = "TEST_TESTPLAN"; +echo "
     testplan - get_by_name(\$name,\$tproject_id = 0)";
    +echo "
    "; +echo "
                get_by_name($tplan_name)";
    +echo "
    "; +$tplan_info = $tplan_mgr->get_by_name($tplan_name); +new dBug($tplan_info); + +echo "
     testplan - get_builds(\$tplan_id,\$active=null,\$open=null)";
    +echo "
    "; +echo "
                get_builds($tplan_id)";
    +echo "
    "; +$all_builds = $tplan_mgr->get_builds($tplan_id); +new dBug($all_builds); + +echo "
     testplan - count_testcases(\$tplan_id)";
    +echo "
    "; +echo "
                count_testcases($tplan_id)";
    +echo "
    "; +$count_testcases = $tplan_mgr->count_testcases($tplan_id); +new dBug("Number of testcase linked to test plan=" . $count_testcases); + +echo "
     testplan - get_linked_tcversions(\$id,\$filters=null,\$options=null)";
    +echo "
    "; + +echo "
                get_linked_tcversions($tplan_id)";
    +echo "
    "; +$linked_tcversions = $tplan_mgr->get_linked_tcversions($tplan_id); +new dBug($linked_tcversions); + +// ------------------------------------------------------------------------------------------- +echo "

    Build Manager Class

    "; +echo "
     build manager - constructor - build_mgr(&\$db)";
    +echo "
    "; +$build_mgr = new build_mgr($db); +new dBug($build_mgr); + +$all_builds = $tplan_mgr->get_builds($tplan_id); +$dummy = array_keys($all_builds); +$build_id = $dummy[0]; + +echo "
     build manager - get_by_id(\$id)";
    +echo "
    "; +echo "
                     get_by_id($build_id)";
    +echo "
    "; +$build_info = $build_mgr->get_by_id($build_id); +new dBug($build_info); + +/* + * function count_testcases($id) + * + * function link_tcversions($id,&$items_to_link) + * function get_linked_tcversions($id,$tcase_id=null,$keyword_id=0,$executed=null, + * function get_linked_and_newest_tcversions($id,$tcase_id=null) + * function unlink_tcversions($id,&$items) + * function get_keywords_map($id,$order_by_clause='') + * function get_keywords_tcases($id,$keyword_id=0) + * function copy_as($id,$new_tplan_id,$tplan_name=null,$tproject_id=null) + * function copy_builds($id,$new_tplan_id) + * function copy_linked_tcversions($id,$new_tplan_id) + * function copy_milestones($id,$new_tplan_id) + * function get_milestones($id) + * function copy_user_roles($id,$new_tplan_id) + * function copy_priorities($id,$new_tplan_id) + * function delete($id) + * function get_builds_for_html_options($id,$active=null,$open=null) + * function get_max_build_id($id,$active = null,$open = null) + * function get_builds($id,$active=null,$open=null) + * function _natsort_builds($builds_map) + * function check_build_name_existence($tplan_id,$build_name,$case_sensitive=0) + * function create_build($tplan_id,$name,$notes = '',$active=1,$open=1) + * function get_linked_cfields_at_design($id,$parent_id=null,$show_on_execution=null) + * function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null) + * function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design') + * function html_table_of_custom_field_values($id,$scope='design',$show_on_execution=null) + * } // function end + * function insert_default_priorities($tplan_id) + * function get_priority_rules($tplan_id,$do_lang_get=0) + * function set_priority_rules($tplan_id,$priority_hash) + * function filter_cf_selection ($tp_tcs, $cf_hash) + * + * function build_mgr(&$db) + * function create($tplan_id,$name,$notes = '',$active=1,$open=1) + * function update($id,$name,$notes,$active=null,$open=null) + * function delete($id) + * function get_by_id($id) + * function milestone_mgr(&$db) + * function create($tplan_id,$name,$date,$A,$B,$C) + * function update($id,$name,$date,$A,$B,$C) + * function delete($id) + * function get_by_id($id) + * function get_all_by_testplan($tplan_id) + * + * + */ ?> diff --git a/lib/functions/code_testing/testplan.getHits.test.php b/lib/functions/code_testing/testplan.getHits.test.php index 53210f28c6..96451a4edb 100644 --- a/lib/functions/code_testing/testplan.getHits.test.php +++ b/lib/functions/code_testing/testplan.getHits.test.php @@ -1,38 +1,38 @@ -Database:' . DB_NAME . '
    '; -$object_item="Testplan Manager"; -$object_class="testplan"; - -echo "
    Poor's Man - $object_item - code inspection tool
    "; -echo "
    Scope of this page is allow you to understand with live
    "; -echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; -echo "Important:"; -echo "You are using your testlink DB to do all operations"; -echo "
    "; -echo "
    "; -echo "
     $object_item - constructor - $object_class(&\$db)";echo "
    "; - -echo "
    "; +Database:' . DB_NAME . '
    '; +$object_item = "Testplan Manager"; +$object_class = "testplan"; + +echo "
    Poor's Man - $object_item - code inspection tool
    "; +echo "
    Scope of this page is allow you to understand with live
    "; +echo "examples how to use object: $object_item (implemented in file $object_class_file.class.php)
    "; +echo "Important:"; +echo "You are using your testlink DB to do all operations"; +echo "
    "; +echo "
    "; +echo "
     $object_item - constructor - $object_class(&\$db)";
    +echo "
    "; + +echo "
    "; echo <<TC-200 B1 1/FAILED TC-200 B2 1/FAILED TC-200 B3 1/BLOCKED - + TC-300 B1 3/Passed TC-300 B1 2/Passed TC-300 B1 1/Passed @@ -57,7 +57,7 @@ TC-300 B3 3/BLOCKED TC-300 B3 2/Passed TC-300 B3 1/FAILED - + TC-400 B1 2/FAILED = TC-400 B1 1/BLOCKED TC-400 B2 1/FAILED = @@ -69,273 +69,276 @@ TC-500 B2 0 / NOT RUN TC-500 B3 0 / NOT RUN -STUFF; -// ================================================================================ - - -$obj_mgr=new $object_class($db); -// new dBug($obj_mgr); - - -$tplan_id = 33123; -$platform_id = 0; - -echo '

    Test group conditions

    '; -echo 'Test Plan ID:' . $tplan_id . '
    '; -echo 'Platform ID:' . $platform_id . '
    '; -echo '
    '; - - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsStatusSetOnLatestExecution'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$statusMixed = 'n'; -try -{ - $$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -} -catch (Exception $e) -{ - echo $e->getMessage(); -} -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - - -$statusMixed = array('n','p'); -try -{ - $$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -} -catch (Exception $e) -{ - echo $e->getMessage(); -} -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('b','p'); -try -{ - $$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -} -catch (Exception $e) -{ - echo $e->getMessage(); -} -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - - -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsStatusSetOnBuild'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- -$build_id = 26; // 26,27,28 -echo 'Build ID:' . $build_id . '
    '; - -$statusMixed = 'p'; -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('p','b'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('f','b'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -// ----------------------------------------------------------------------------- - - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsNotRunOnBuild'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$build_id = 26; // 26,27,28 -echo 'Build ID:' . $build_id . '
    '; - -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; - -$build_id = 27; // 26,27,28 -echo 'Build ID:' . $build_id . '
    '; - -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; - -$build_id = 28; // 26,27,28 -echo 'Build ID:' . $build_id . '
    '; - -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$build_id); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - - - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsSameStatusFull'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$statusMixed = 'n'; -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('n','p'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('b','p'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; - -$statusMixed = array('b','f'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusMixed); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($statusMixed); -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsNotRunFull'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsSingleStatusFull'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$status = 'p'; -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$status); -echo '
    ' . $method2call . '()' . '
    '; -echo '
    ' . "status=$status" . '
    '; -new dBug($$method2call); -echo '
    '; - -$status = 'b'; -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$status); -echo '
    ' . $method2call . '()' . '
    '; -echo '
    ' . "status=$status" . '
    '; -new dBug($$method2call); -echo '
    '; - -$status = 'f'; -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$status); -echo '
    ' . "status=$status" . '
    '; -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsStatusSetFull'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$statusSet = array('b','p'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusSet); -echo '
    ' . $method2call . '()' . '
    '; -var_dump($statusSet); -new dBug($$method2call); -echo '
    '; - -$statusSet = array('b','f'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusSet); -echo '
    ' . $method2call . '()' . '
    '; -var_dump($statusSet); -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsNotRunPartial'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- - -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id); -echo '
    ' . $method2call . '()' . '
    '; -new dBug($$method2call); -echo '
    '; -// ----------------------------------------------------------------------------- - -// ----------------------------------------------------------------------------- -$method2call = 'getHitsStatusSetPartial'; -echo "

    TESTING:$method2call

    "; -// ----------------------------------------------------------------------------- -$statusSet = array('b','p'); -$$method2call = $obj_mgr->$method2call($tplan_id,$platform_id,$statusSet); -echo '
    ' . $method2call . '()' . '
    '; -var_dump($statusSet); -new dBug($$method2call); -echo '
    '; - - - -// WITH PLATFORMS -/* -$tplan_id = 33111; -$platform_id = 0; -echo '

    Test group conditions

    '; -echo 'Test Plan ID:' . $tplan_id . '
    '; -echo 'Platform ID:' . $platform_id . '
    '; -*/ - - -/* -new view -last_executions -SELECT tcversion_id,testplan_id,platform_id,build_id,MAX(status) AS status, id AS MAX(E.id) AS id -FROM executions -GROUP BY tcversion_id,testsplan_id,platform_id,build_id - -CREATE VIEW tk_last_executions AS -SELECT tcversion_id,testplan_id,platform_id,build_id,max(status) AS status,max(id) AS id -from tk_executions -group by tcversion_id,testplan_id,platform_id,build_id -*/ +STUFF; +// ================================================================================ + +$obj_mgr = new $object_class($db); + +$tplan_id = 33123; +$platform_id = 0; + +echo '

    Test group conditions

    '; +echo 'Test Plan ID:' . $tplan_id . '
    '; +echo 'Platform ID:' . $platform_id . '
    '; +echo '
    '; + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsStatusSetOnLatestExecution'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$statusMixed = 'n'; +try { + $$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +} catch (Exception $e) { + echo $e->getMessage(); +} +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'n', + 'p' +); +try { + $$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +} catch (Exception $e) { + echo $e->getMessage(); +} +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'b', + 'p' +); +try { + $$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +} catch (Exception $e) { + echo $e->getMessage(); +} +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsStatusSetOnBuild'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- +$build_id = 26; // 26,27,28 +echo 'Build ID:' . $build_id . '
    '; + +$statusMixed = 'p'; +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id, + $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'p', + 'b' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id, + $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'f', + 'b' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id, + $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsNotRunOnBuild'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$build_id = 26; // 26,27,28 +echo 'Build ID:' . $build_id . '
    '; + +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; + +$build_id = 27; // 26,27,28 +echo 'Build ID:' . $build_id . '
    '; + +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; + +$build_id = 28; // 26,27,28 +echo 'Build ID:' . $build_id . '
    '; + +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $build_id); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsSameStatusFull'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$statusMixed = 'n'; +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'n', + 'p' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'b', + 'p' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; + +$statusMixed = array( + 'b', + 'f' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusMixed); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($statusMixed); +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsNotRunFull'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsSingleStatusFull'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$status = 'p'; +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $status); +echo '
    ' . $method2call . '()' . '
    '; +echo '
    ' . "status=$status" . '
    '; +new dBug($$method2call); +echo '
    '; + +$status = 'b'; +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $status); +echo '
    ' . $method2call . '()' . '
    '; +echo '
    ' . "status=$status" . '
    '; +new dBug($$method2call); +echo '
    '; + +$status = 'f'; +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $status); +echo '
    ' . "status=$status" . '
    '; +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsStatusSetFull'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$statusSet = array( + 'b', + 'p' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusSet); +echo '
    ' . $method2call . '()' . '
    '; +var_dump($statusSet); +new dBug($$method2call); +echo '
    '; + +$statusSet = array( + 'b', + 'f' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusSet); +echo '
    ' . $method2call . '()' . '
    '; +var_dump($statusSet); +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsNotRunPartial'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- + +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id); +echo '
    ' . $method2call . '()' . '
    '; +new dBug($$method2call); +echo '
    '; +// ----------------------------------------------------------------------------- + +// ----------------------------------------------------------------------------- +$method2call = 'getHitsStatusSetPartial'; +echo "

    TESTING:$method2call

    "; +// ----------------------------------------------------------------------------- +$statusSet = array( + 'b', + 'p' +); +$$method2call = $obj_mgr->$method2call($tplan_id, $platform_id, $statusSet); +echo '
    ' . $method2call . '()' . '
    '; +var_dump($statusSet); +new dBug($$method2call); +echo '
    '; + +/* + * new view + * last_executions + * SELECT tcversion_id,testplan_id,platform_id,build_id,MAX(status) AS status, id AS MAX(E.id) AS id + * FROM executions + * GROUP BY tcversion_id,testsplan_id,platform_id,build_id + * + * CREATE VIEW tk_last_executions AS + * SELECT tcversion_id,testplan_id,platform_id,build_id,max(status) AS status,max(id) AS id + * from tk_executions + * group by tcversion_id,testplan_id,platform_id,build_id + */ ?> diff --git a/lib/functions/code_testing/testproject.class.test.php b/lib/functions/code_testing/testproject.class.test.php index b120dc1a1c..fbdc29244c 100644 --- a/lib/functions/code_testing/testproject.class.test.php +++ b/lib/functions/code_testing/testproject.class.test.php @@ -1,167 +1,167 @@ - testproject - constructor - testproject(&\$db)";echo "
    "; -$tproject_mgr=new testproject($db); -new dBug($tproject_mgr); - -$item = new stdClass(); -$item->name = 'CRASH'; -$item->notes = " Created doing test "; -$item->color = ''; -$item->options = new stdClass(); -//$item->options->requirement_mgmt = 1; -//$item->options->priority_mgmt = 1; -//$item->options->automated_execution = 1; -$item->active=1; -$item->is_public=1; -$item->prefix = 'TPX :: '; - -try -{ - $id = $tproject_mgr->create($item, array('doChecks' => true)); -} -catch (Exception $e) -{ - echo 'Caught exception: ', $e->getMessage(), "\n"; -} -die(); - - -// new dBug($_SESSION); - -$xx=$tproject_mgr->get_accessible_for_user(1, - array('output' => 'map','field_set' => 'id', 'format' => 'simple')); -new dBug($xx); -die(); - -// create() -// function create($name,$color,$options,$notes,$active=1,$tcasePrefix='',$is_public=1) -$notes = " Created doing test "; -$color = ''; -$options = new stdClass(); -$options->requirement_mgmt = 1; -$options->priority_mgmt = 1; -$options->automated_execution = 1; - -$active=1; -$is_public=1; - -$namePrefix = 'TPX :: '; -$name = uniqid($namePrefix,true); -$tcasePrefix = uniqid('',false); -//$new_id = $tproject_mgr->create($name,$color,$options,$notes,$active,$tcasePrefix,$is_public); -// -//$name = $namePrefix . $new_id; -//$tcasePrefix = $namePrefix . $new_id; -// -//$tproject_mgr->update($new_id, $name, $color, $options->requirement_mgmt, -// $options->priority_mgmt, $options->automated_execution, -// $notes,$active,$tcasePrefix,$is_public); -// -//new dBug($tproject_mgr->get_by_id($new_id)); -//die(); - -$new_id = 1157; -$tproject_mgr->copy_as(9,$new_id,1); -die(); - - -// getKeywords($testproject_id,$keywordID = null) -$tproject_id=1; -echo "
     testproject - getKeywords(\$testproject_id,\$keywordID = null)";echo "
    "; -echo "
                   getKeywords($tproject_id)";echo "
    "; -$keywords=$tproject_mgr->getKeywords($tproject_id); -new dBug($keywords); - -$tproject_id=1; -echo "
     testproject - get_first_level_test_suites($tproject_id,$mode='simple')";echo "
    "; -echo "
                   get_first_level_test_suites($tproject_id,$mode='simple')";echo "
    "; -$info=$tproject_mgr->get_first_level_test_suites($tproject_id,$mode='simple'); -new dBug($info); -die(); - -echo "
     testproject - get_keywords_map(\$testproject_id)";echo "
    "; -$tproject_id=1; -echo "
                   get_keywords_map($tproject_id)";echo "
    "; -$keywords_map=$tproject_mgr->get_keywords_map($tproject_id); -new dBug($keywords_map); - - -echo "
     testproject - get_keywords_tcases(\$testproject_id, \$keyword_id=0)";echo "
    "; -echo "
                   get_keywords_tcases($tproject_id)";echo "
    "; -$keywords_tcases=$tproject_mgr->get_keywords_tcases($tproject_id); -new dBug($keywords_tcases); - - -echo "
     testproject - get_linked_custom_fields(\$id,\$node_type=null)";echo "
    "; -echo "
                   get_linked_custom_fields($tproject_id)";echo "
    "; -$linked_custom_fields=$tproject_mgr->get_linked_custom_fields($tproject_id); -new dBug($linked_custom_fields); - - -echo "
     testproject - gen_combo_test_suites(\$id,\$exclude_branches=null,\$mode='dotted')";echo "
    "; -echo "
                   gen_combo_test_suites($tproject_id,null,'dotted')";echo "
    "; -$combo_test_suites=$tproject_mgr->gen_combo_test_suites($tproject_id,null,'dotted'); -new dBug($combo_test_suites); - -echo "
                   gen_combo_test_suites($tproject_id,null,'dotted')";echo "
    "; -$combo_test_suites=$tproject_mgr->gen_combo_test_suites($tproject_id,null,'array'); -new dBug($combo_test_suites); - - -echo "
     testproject - getReqSpec(\$testproject_id, \$id = null)";echo "
    "; -echo "
                   getReqSpec($tproject_id)";echo "
    "; -$requirement_spec=$tproject_mgr->getReqSpec($tproject_id); -new dBug($requirement_spec); - -$srs_id=2; -echo "
                   getReqSpec(\$tproject_id,\$srs_id)";echo "
    "; -echo "
                   getReqSpec($tproject_id,$srs_id)";echo "
    "; -$requirement_spec=$tproject_mgr->getReqSpec($tproject_id,$srs_id); -new dBug($requirement_spec); - - -$srs_title='SRS2'; -echo "
     testproject - get_srs_by_title(\$testproject_id,\$title,\$ignore_case=0)";echo "
    "; -echo "
                   get_srs_by_title($tproject_id,$srs_title)";echo "
    "; -$srs_by_title=$tproject_mgr->get_srs_by_title($tproject_id,$srs_title); -new dBug($srs_by_title); - -// function get_srs_by_title($testproject_id,$title,$ignore_case=0) - - - -/* -function getReqSpec($testproject_id, $id = null) -function createReqSpec($testproject_id,$title, $scope, $countReq,$user_id,$type = 'n') -function get_srs_by_title($testproject_id,$title,$ignore_case=0) -function check_srs_title($testproject_id,$title,$ignore_case=0) -function delete($id,&$error) -function get_keywords_map($testproject_id) -function get_all_testcases_id($id) -function get_keywords_tcases($testproject_id, $keyword_id=0) -function get_all_testplans($testproject_id,$get_tp_without_tproject_id=0,$plan_status=null) -function check_tplan_name_existence($tproject_id,$tplan_name,$case_sensitive=0) -function get_first_level_test_suites($tproject_id,$mode='simple') -function get_linked_custom_fields($id,$node_type=null,$node_id=null) -*/ - + testproject - constructor - testproject(&\$db)"; +echo "
    "; +$tproject_mgr = new testproject($db); +new dBug($tproject_mgr); + +$item = new stdClass(); +$item->name = 'CRASH'; +$item->notes = " Created doing test "; +$item->color = ''; +$item->options = new stdClass(); +$item->active = 1; +$item->is_public = 1; +$item->prefix = 'TPX :: '; + +try { + $id = $tproject_mgr->create($item, array( + 'doChecks' => true + )); +} catch (Exception $e) { + echo 'Caught exception: ', $e->getMessage(), "\n"; +} +die(); + +$xx = $tproject_mgr->get_accessible_for_user(1, + array( + 'output' => 'map', + 'field_set' => 'id', + 'format' => 'simple' + )); +new dBug($xx); +die(); + +// create() +// function create($name,$color,$options,$notes,$active=1,$tcasePrefix='',$is_public=1) +$notes = " Created doing test "; +$color = ''; +$options = new stdClass(); +$options->requirement_mgmt = 1; +$options->priority_mgmt = 1; +$options->automated_execution = 1; + +$active = 1; +$is_public = 1; + +$namePrefix = 'TPX :: '; +$name = uniqid($namePrefix, true); +$tcasePrefix = uniqid('', false); + +$new_id = 1157; +$tproject_mgr->copy_as(9, $new_id, 1); +die(); + +// getKeywords($testproject_id,$keywordID = null) +$tproject_id = 1; +echo "
     testproject - getKeywords(\$testproject_id,\$keywordID = null)";
    +echo "
    "; +echo "
                   getKeywords($tproject_id)";
    +echo "
    "; +$keywords = $tproject_mgr->getKeywords($tproject_id); +new dBug($keywords); + +$tproject_id = 1; +echo "
     testproject - get_first_level_test_suites($tproject_id,$mode='simple')";
    +echo "
    "; +echo "
                   get_first_level_test_suites($tproject_id,$mode='simple')";
    +echo "
    "; +$info = $tproject_mgr->get_first_level_test_suites($tproject_id, + $mode = 'simple'); +new dBug($info); +die(); + +echo "
     testproject - get_keywords_map(\$testproject_id)";
    +echo "
    "; +$tproject_id = 1; +echo "
                   get_keywords_map($tproject_id)";
    +echo "
    "; +$keywords_map = $tproject_mgr->get_keywords_map($tproject_id); +new dBug($keywords_map); + +echo "
     testproject - get_keywords_tcases(\$testproject_id, \$keyword_id=0)";
    +echo "
    "; +echo "
                   get_keywords_tcases($tproject_id)";
    +echo "
    "; +$keywords_tcases = $tproject_mgr->get_keywords_tcases($tproject_id); +new dBug($keywords_tcases); + +echo "
     testproject - get_linked_custom_fields(\$id,\$node_type=null)";
    +echo "
    "; +echo "
                   get_linked_custom_fields($tproject_id)";
    +echo "
    "; +$linked_custom_fields = $tproject_mgr->get_linked_custom_fields($tproject_id); +new dBug($linked_custom_fields); + +echo "
     testproject - gen_combo_test_suites(\$id,\$exclude_branches=null,\$mode='dotted')";
    +echo "
    "; +echo "
                   gen_combo_test_suites($tproject_id,null,'dotted')";
    +echo "
    "; +$combo_test_suites = $tproject_mgr->gen_combo_test_suites($tproject_id, null, + 'dotted'); +new dBug($combo_test_suites); + +echo "
                   gen_combo_test_suites($tproject_id,null,'dotted')";
    +echo "
    "; +$combo_test_suites = $tproject_mgr->gen_combo_test_suites($tproject_id, null, + 'array'); +new dBug($combo_test_suites); + +echo "
     testproject - getReqSpec(\$testproject_id, \$id = null)";
    +echo "
    "; +echo "
                   getReqSpec($tproject_id)";
    +echo "
    "; +$requirement_spec = $tproject_mgr->getReqSpec($tproject_id); +new dBug($requirement_spec); + +$srs_id = 2; +echo "
                   getReqSpec(\$tproject_id,\$srs_id)";
    +echo "
    "; +echo "
                   getReqSpec($tproject_id,$srs_id)";
    +echo "
    "; +$requirement_spec = $tproject_mgr->getReqSpec($tproject_id, $srs_id); +new dBug($requirement_spec); + +$srs_title = 'SRS2'; +echo "
     testproject - get_srs_by_title(\$testproject_id,\$title,\$ignore_case=0)";
    +echo "
    "; +echo "
                   get_srs_by_title($tproject_id,$srs_title)";
    +echo "
    "; +$srs_by_title = $tproject_mgr->get_srs_by_title($tproject_id, $srs_title); +new dBug($srs_by_title); + +// function get_srs_by_title($testproject_id,$title,$ignore_case=0) + +/* + * function getReqSpec($testproject_id, $id = null) + * function createReqSpec($testproject_id,$title, $scope, $countReq,$user_id,$type = 'n') + * function get_srs_by_title($testproject_id,$title,$ignore_case=0) + * function check_srs_title($testproject_id,$title,$ignore_case=0) + * function delete($id,&$error) + * function get_keywords_map($testproject_id) + * function get_all_testcases_id($id) + * function get_keywords_tcases($testproject_id, $keyword_id=0) + * function get_all_testplans($testproject_id,$get_tp_without_tproject_id=0,$plan_status=null) + * function check_tplan_name_existence($tproject_id,$tplan_name,$case_sensitive=0) + * function get_first_level_test_suites($tproject_id,$mode='simple') + * function get_linked_custom_fields($id,$node_type=null,$node_id=null) + */ + ?> diff --git a/lib/functions/code_testing/testsuite.class.test.php b/lib/functions/code_testing/testsuite.class.test.php index 03e38939d8..100c3963c7 100644 --- a/lib/functions/code_testing/testsuite.class.test.php +++ b/lib/functions/code_testing/testsuite.class.test.php @@ -1,127 +1,149 @@ - testsuite - constructor - testsuite(&\$db)";echo "
    "; -$tsuite_mgr=new testsuite($db); -new dBug($tsuite_mgr); - -$tsuite_name = 'Build Management'; -echo "
     testsuite - get_by_name(\$name)";echo "
    "; -echo "
                 get_by_name($tsuite_name)";echo "
    "; -$tsuite_info = $tsuite_mgr->get_by_name($tsuite_name); -new dBug($tsuite_info); -die(); - -$tsuite_id=689; -echo "
     testsuite - get_children(\$id)";echo "
    "; -echo "
                 get_children($tsuite_id)";echo "
    "; -$tsuite_info=$tsuite_mgr->get_children($tsuite_id); -new dBug($tsuite_info); - - -$tsuite_id=676; -echo "
     testsuite - get_by_id(\$id)";echo "
    "; -echo "
                 get_by_id($tsuite_id)";echo "
    "; -$tsuite_info=$tsuite_mgr->get_by_id($tsuite_id); -new dBug($tsuite_info); - -$tsuite_name=$tsuite_info['name']; - -$tsuite_id = array(); -$tsuite_id[]=676; -$tsuite_id[]=804; -$tsuite_id[]=826; - - -echo "
     testsuite - get_by_id(\$id)";echo "
    "; -echo "
                 get_by_id($tsuite_id)";echo "
    "; -$tsuite_info=$tsuite_mgr->get_by_id($tsuite_id); -new dBug($tsuite_info); -die(); - - - -echo "
     testsuite - get_all()";echo "
    "; -echo "
                 get_all()";echo "
    "; -$all_tsuites_in_my_tl=$tsuite_mgr->get_all(); -new dBug($all_tsuites_in_my_tl); - -echo "
     testsuite - get_by_name(\$name)";echo "
    "; -echo "
                 get_by_name($tsuite_name)";echo "
    "; -$tsuite_info=$tsuite_mgr->get_by_name($tsuite_name); -new dBug($tsuite_info); - -echo "
     testsuite - get_testcases_deep(\$id,\$details='simple')";echo "
    "; -echo "
                 get_testcases_deep($tsuite_id,'simple')";echo "
    "; -$testcases_deep=$tsuite_mgr->get_testcases_deep($tsuite_id); -new dBug($testcases_deep); - -define("GET_ONLY_TESTCASE_ID",1); -echo "
                 get_testcases_deep(\$tsuite_id,\$details='full')";echo "
    "; -$testcases_deep=$tsuite_mgr->get_testcases_deep($tsuite_id,'full'); -new dBug($testcases_deep); - -echo "
     testsuite - getKeywords(\$tcID,\$kwID = null)";echo "
    "; -echo "
                getKeywords($tsuite_id)";echo "
    "; -$keywords=$tsuite_mgr->getKeywords($tsuite_id); -new dBug($keywords); - - -echo "
     testsuite - get_keywords_map(\$id,\$order_by_clause='')";echo "
    "; -$tsuite_id=4; -echo "
                   get_keywords_map($tsuite_id)";echo "
    "; -$keywords_map=$tsuite_mgr->get_keywords_map($tsuite_id); -new dBug($keywords_map); - - - - -echo "
     testsuite - get_linked_cfields_at_design(\$id,\$parent_id=null,\$show_on_execution=null)";echo "
    "; -echo "
                get_linked_cfields_at_design($tsuite_id)";echo "
    "; -$linked_cfields_at_design=$tsuite_mgr->get_linked_cfields_at_design($tsuite_id); -new dBug($linked_cfields_at_design); - - - + testsuite - constructor - testsuite(&\$db)"; +echo "
    "; +$tsuite_mgr = new testsuite($db); +new dBug($tsuite_mgr); + +$tsuite_name = 'Build Management'; +echo "
     testsuite - get_by_name(\$name)";
    +echo "
    "; +echo "
                 get_by_name($tsuite_name)";
    +echo "
    "; +$tsuite_info = $tsuite_mgr->get_by_name($tsuite_name); +new dBug($tsuite_info); +die(); + +$tsuite_id = 689; +echo "
     testsuite - get_children(\$id)";
    +echo "
    "; +echo "
                 get_children($tsuite_id)";
    +echo "
    "; +$tsuite_info = $tsuite_mgr->get_children($tsuite_id); +new dBug($tsuite_info); + +$tsuite_id = 676; +echo "
     testsuite - get_by_id(\$id)";
    +echo "
    "; +echo "
                 get_by_id($tsuite_id)";
    +echo "
    "; +$tsuite_info = $tsuite_mgr->get_by_id($tsuite_id); +new dBug($tsuite_info); + +$tsuite_name = $tsuite_info['name']; + +$tsuite_id = array(); +$tsuite_id[] = 676; +$tsuite_id[] = 804; +$tsuite_id[] = 826; + +echo "
     testsuite - get_by_id(\$id)";
    +echo "
    "; +echo "
                 get_by_id($tsuite_id)";
    +echo "
    "; +$tsuite_info = $tsuite_mgr->get_by_id($tsuite_id); +new dBug($tsuite_info); +die(); + +echo "
     testsuite - get_all()";
    +echo "
    "; +echo "
                 get_all()";
    +echo "
    "; +$all_tsuites_in_my_tl = $tsuite_mgr->get_all(); +new dBug($all_tsuites_in_my_tl); + +echo "
     testsuite - get_by_name(\$name)";
    +echo "
    "; +echo "
                 get_by_name($tsuite_name)";
    +echo "
    "; +$tsuite_info = $tsuite_mgr->get_by_name($tsuite_name); +new dBug($tsuite_info); + +echo "
     testsuite - get_testcases_deep(\$id,\$details='simple')";
    +echo "
    "; +echo "
                 get_testcases_deep($tsuite_id,'simple')";
    +echo "
    "; +$testcases_deep = $tsuite_mgr->get_testcases_deep($tsuite_id); +new dBug($testcases_deep); + +define("GET_ONLY_TESTCASE_ID", 1); +echo "
                 get_testcases_deep(\$tsuite_id,\$details='full')";
    +echo "
    "; +$testcases_deep = $tsuite_mgr->get_testcases_deep($tsuite_id, 'full'); +new dBug($testcases_deep); + +echo "
     testsuite - getKeywords(\$tcID,\$kwID = null)";
    +echo "
    "; +echo "
                getKeywords($tsuite_id)";
    +echo "
    "; +$keywords = $tsuite_mgr->getKeywords($tsuite_id); +new dBug($keywords); + +echo "
     testsuite - get_keywords_map(\$id,\$order_by_clause='')";
    +echo "
    "; +$tsuite_id = 4; +echo "
                   get_keywords_map($tsuite_id)";
    +echo "
    "; +$keywords_map = $tsuite_mgr->get_keywords_map($tsuite_id); +new dBug($keywords_map); + +echo "
     testsuite - get_linked_cfields_at_design(\$id,\$parent_id=null,\$show_on_execution=null)";
    +echo "
    "; +echo "
                get_linked_cfields_at_design($tsuite_id)";
    +echo "
    "; +$linked_cfields_at_design = $tsuite_mgr->get_linked_cfields_at_design( + $tsuite_id); +new dBug($linked_cfields_at_design); + echo "
     testsuite - get_linked_cfields_at_execution(\$id,\$parent_id=null,
    \$show_on_execution=null,
    - \$execution_id=null,\$testplan_id=null)";echo "
    "; -echo "
                get_linked_cfields_at_execution($tsuite_id)";echo "
    "; -$linked_cfields_at_execution=$tsuite_mgr->get_linked_cfields_at_execution($tsuite_id); -new dBug($linked_cfields_at_execution); - - - -echo "
     testsuite - html_table_of_custom_field_inputs(\$id,\$parent_id=null,\$scope='design',\$name_suffix='')";echo "
    "; -echo "
                html_table_of_custom_field_inputs($tsuite_id)";echo "
    "; -$table_of_custom_field_inputs=$tsuite_mgr->html_table_of_custom_field_inputs($tsuite_id); -echo "
    "; echo $table_of_custom_field_inputs; echo "
    "; - - + \$execution_id=null,\$testplan_id=null)"; +echo "
    "; +echo "
                get_linked_cfields_at_execution($tsuite_id)";
    +echo "
    "; +$linked_cfields_at_execution = $tsuite_mgr->get_linked_cfields_at_execution( + $tsuite_id); +new dBug($linked_cfields_at_execution); + +echo "
     testsuite - html_table_of_custom_field_inputs(\$id,\$parent_id=null,\$scope='design',\$name_suffix='')";
    +echo "
    "; +echo "
                html_table_of_custom_field_inputs($tsuite_id)";
    +echo "
    "; +$table_of_custom_field_inputs = $tsuite_mgr->html_table_of_custom_field_inputs( + $tsuite_id); +echo "
    ";
    +echo $table_of_custom_field_inputs;
    +echo "
    "; + echo "
     testsuite - html_table_of_custom_field_values(\$id,\$scope='design',
    \$show_on_execution=null,
    - \$execution_id=null,\$testplan_id=null) ";echo "
    "; - -echo "
     testsuite - html_table_of_custom_field_values($tsuite_id)";echo "
    "; -$table_of_custom_field_values=$tsuite_mgr->html_table_of_custom_field_values($tsuite_id); -echo "
    "; echo $table_of_custom_field_values; echo "
    "; + \$execution_id=null,\$testplan_id=null) "; +echo "
    "; + +echo "
     testsuite - html_table_of_custom_field_values($tsuite_id)";
    +echo "
    "; +$table_of_custom_field_values = $tsuite_mgr->html_table_of_custom_field_values( + $tsuite_id); +echo "
    ";
    +echo $table_of_custom_field_values;
    +echo "
    "; ?> diff --git a/lib/functions/code_testing/tlIssueTracker.test.php b/lib/functions/code_testing/tlIssueTracker.test.php index 19758bbd1e..624ba51cb4 100644 --- a/lib/functions/code_testing/tlIssueTracker.test.php +++ b/lib/functions/code_testing/tlIssueTracker.test.php @@ -1,134 +1,87 @@ -getTypes()); - -$tprojectSet = array(32674,2,27); - -/* -$dx = new stdClass(); -$dx->name = 'Francisco2'; -$dx->type = $issueTrackerDomain['MANTIS']; -$dx->cfg = " I'm Mantis "; -$info = $it->create($dx); -new dBug($info); -*/ - -$str = ""; -$str = ''; -$str .= "" . - "localhost" . - "mantis_tlorg" . - "mysql" . - "root" . - "mysqlroot" . - "http://localhost:8080/development/mantisbt-1.2.5/my_view_page.php?id=" . - "http://localhost:8080/development/mantisbt-1.2.5/" . - ""; - -$dx = new stdClass(); -$dx->name = 'Francisco3'; -$dx->type = $issueTrackerDomain['MANTIS']; -$dx->cfg = $str; -$info = $it->create($dx); -new dBug($info); - -$info = $it->getByName('Francisco3'); -new dBug($info); - - -die(); - -$links = $it->getLinks(4); -new dBug($links); - -// $it->link(4,2); - -$links = $it->getLinks(4); -new dBug($links); - - -$linkSet = $it->getLinkSet(); -new dBug($linkSet); - -$info = $it->delete(0); -new dBug($info); - -$info = $it->delete('papap'); -new dBug($info); - -$info = $it->delete(-1); -new dBug($info); - - -$info = $it->delete(4); -new dBug($info); - -$info = $it->delete(5); -new dBug($info); - -die(); - - -/* -$opt = array(null,array('output' => 'id')); -foreach($opt as $o) -{ - $info = $it->getByName('FMAN',$o); - new dBug($info); -} - -$opt = array(null,array('output' => 'id')); -foreach($opt as $o) -{ - $info = $it->getByID(2,$o); - new dBug($info); -} - - -$dx = new stdClass(); -$dx->name = 'FEFE'; -$dx->type = $issueTrackerDomain['MANTIS']; -$dx->cfg = " I'm Mantis "; -$info = $it->create($dx); -new dBug($info); -*/ - -/* -$it->link(22,27); -$it->unlink(2,27); -$it->unlink(22,27); -*/ - -$dx = new stdClass(); -$dx->id = 1; -$dx->name = 'FEFE'; -$dx->type = $issueTrackerDomain['MANTIS']; -$dx->cfg = " I'm Mantis "; -$xx = $it->update($dx); - -new dBug($xx); - -$dx = new stdClass(); -$dx->id = 1; -$dx->name = 'FARFANS'; -$dx->type = $issueTrackerDomain['MANTIS']; -$dx->cfg = " I'm Mantis "; -$xx = $it->update($dx); - -new dBug($xx); - - -$links = $it->getLinks(1); -new dBug($links); - - -?> \ No newline at end of file +getTypes()); + +$tprojectSet = array( + 32674, + 2, + 27 +); + +$str = ""; +$str = ''; +$str .= "" . "localhost" . + "mantis_tlorg" . "mysql" . + "root" . "mysqlroot" . + "http://localhost:8080/development/mantisbt-1.2.5/my_view_page.php?id=" . + "http://localhost:8080/development/mantisbt-1.2.5/" . + ""; + +$dx = new stdClass(); +$dx->name = 'Francisco3'; +$dx->type = $issueTrackerDomain['MANTIS']; +$dx->cfg = $str; +$info = $it->create($dx); +new dBug($info); + +$info = $it->getByName('Francisco3'); +new dBug($info); + +die(); + +$links = $it->getLinks(4); +new dBug($links); + +$links = $it->getLinks(4); +new dBug($links); + +$linkSet = $it->getLinkSet(); +new dBug($linkSet); + +$info = $it->delete(0); +new dBug($info); + +$info = $it->delete('papap'); +new dBug($info); + +$info = $it->delete(- 1); +new dBug($info); + +$info = $it->delete(4); +new dBug($info); + +$info = $it->delete(5); +new dBug($info); + +die(); + +$dx = new stdClass(); +$dx->id = 1; +$dx->name = 'FEFE'; +$dx->type = $issueTrackerDomain['MANTIS']; +$dx->cfg = " I'm Mantis "; +$xx = $it->update($dx); + +new dBug($xx); + +$dx = new stdClass(); +$dx->id = 1; +$dx->name = 'FARFANS'; +$dx->type = $issueTrackerDomain['MANTIS']; +$dx->cfg = " I'm Mantis "; +$xx = $it->update($dx); + +new dBug($xx); + +$links = $it->getLinks(1); +new dBug($links); + +?> diff --git a/lib/functions/code_testing/tree.class.test.php b/lib/functions/code_testing/tree.class.test.php index 6d74da793d..db6c799f5c 100644 --- a/lib/functions/code_testing/tree.class.test.php +++ b/lib/functions/code_testing/tree.class.test.php @@ -1,105 +1,129 @@ - tree - constructor - tree(&\$db)";echo "
    "; -$tree_mgr=new tree($db); -new dBug($tree_mgr); - -echo "
     tree - getNodeByAttributes()";echo "
    "; -$xx = $tree_mgr->getNodeByAttributes(array('type' => 'testproject','name' => 'ISSUE-5429')); -new dBug($xx); - -$xx = $tree_mgr->getNodeByAttributes(array('type' => 'testplan','name' => 'AKA','parent_id' => 5675)); -new dBug($xx); - -echo "
     tree - get_available_node_types()";echo "
    "; -$available_node_types = $tree_mgr->get_available_node_types(); -new dBug($available_node_types); - -echo "
     tree - get_node_hierarchy_info(\$node_id)";echo "
    "; -$node_id=1; -echo "
     get_node_hierarchy_info($node_id)";echo "
    "; -$node_hierachy_info = $tree_mgr->get_node_hierarchy_info($node_id); -new dBug($node_hierachy_info); - -echo "
     tree - get_subtree(\$node_id)";echo "
    "; -echo "
     get_subtree($node_id)";echo "
    "; -$subtree = $tree_mgr->get_subtree($node_id); -new dBug($subtree); - - -echo "
     tree - get_subtree(\$node_id,\$exclude_node_types=null," . "
    " . -" \$exclude_children_of=null,\$exclude_branches=null," . "
    " . -" \$and_not_in_clause='',\$bRecursive = false)";echo "
    "; - -echo "
     get_subtree($node_id,null,null,null,'',false)";echo "
    "; -$subtree = $tree_mgr->get_subtree($node_id,null,null,null,'',false); -new dBug($subtree); - - -echo "
     get_subtree($node_id,null,null,null,'',true)";echo "
    "; -$subtree = $tree_mgr->get_subtree($node_id,null,null,null,'',true); -new dBug($subtree); - - -echo "
     tree - get_subtree_list(\$node_id)";echo "
    "; -echo "
     get_subtree_list($node_id)";echo "
    "; -$subtree_list = $tree_mgr->get_subtree_list($node_id); -new dBug($subtree_list); - -$path_begin_node_id=285; -$path_end_node_id=2; -define('TREE_ROOT',null); -define('FORMAT_FULL','full'); -define('FORMAT_SIMPLE','simple'); - -echo "
     tree - get_path(\$node_id,\$to_node_id = null,\$format = 'full') ";echo "
    "; -echo "
     tree - get_path($path_begin_node_id) ";echo "
    "; -$path=$tree_mgr->get_path($path_begin_node_id); -new dBug($path); - - -echo "
     tree - get_path(\$node_id,\$to_node_id = null,\$format = 'full') ";echo "
    "; -echo "
     tree - get_path($path_begin_node_id,TREE_ROOT,FORMAT_FULL) ";echo "
    "; -$path=$tree_mgr->get_path($path_begin_node_id,TREE_ROOT,FORMAT_FULL); -new dBug($path); - -echo "
     tree - get_path($path_begin_node_id,TREE_ROOT,FORMAT_SIMPLE) ";echo "
    "; -$path=$tree_mgr->get_path($path_begin_node_id,TREE_ROOT,FORMAT_SIMPLE); -new dBug($path); - - -echo "
     tree - get_path($path_begin_node_id,$path_end_node_id,FORMAT_FULL) ";echo "
    "; -$path=$tree_mgr->get_path($path_begin_node_id,$path_end_node_id,FORMAT_FULL); -new dBug($path); - -$node_id=1; -echo "
     tree - get_children(\$node_id)";echo "
    "; -echo "
     get_children($node_id)";echo "
    "; -$children = $tree_mgr->get_children($node_id); -new dBug($children); - - -echo "
     tree - get_node_hierarchy_info(\$node_id) ";echo "
    "; -echo "
     get_node_hierarchy_info($node_id) ";echo "
    "; -$node_hierachy_info=$tree_mgr->get_node_hierarchy_info($node_id) ; -new dBug($node_hierachy_info); -?> \ No newline at end of file + tree - constructor - tree(&\$db)"; +echo "
    "; +$tree_mgr = new tree($db); +new dBug($tree_mgr); + +echo "
     tree - getNodeByAttributes()";
    +echo "
    "; +$xx = $tree_mgr->getNodeByAttributes( + array( + 'type' => 'testproject', + 'name' => 'ISSUE-5429' + )); +new dBug($xx); + +$xx = $tree_mgr->getNodeByAttributes( + array( + 'type' => 'testplan', + 'name' => 'AKA', + 'parent_id' => 5675 + )); +new dBug($xx); + +echo "
     tree - get_available_node_types()";
    +echo "
    "; +$available_node_types = $tree_mgr->get_available_node_types(); +new dBug($available_node_types); + +echo "
     tree - get_node_hierarchy_info(\$node_id)";
    +echo "
    "; +$node_id = 1; +echo "
     get_node_hierarchy_info($node_id)";
    +echo "
    "; +$node_hierachy_info = $tree_mgr->get_node_hierarchy_info($node_id); +new dBug($node_hierachy_info); + +echo "
     tree - get_subtree(\$node_id)";
    +echo "
    "; +echo "
     get_subtree($node_id)";
    +echo "
    "; +$subtree = $tree_mgr->get_subtree($node_id); +new dBug($subtree); + +echo "
     tree - get_subtree(\$node_id,\$exclude_node_types=null," . "
    " . + " \$exclude_children_of=null,\$exclude_branches=null," . + "
    " . + " \$and_not_in_clause='',\$bRecursive = false)"; +echo "
    "; + +echo "
     get_subtree($node_id,null,null,null,'',false)";
    +echo "
    "; +$subtree = $tree_mgr->get_subtree($node_id, null, null, null, '', false); +new dBug($subtree); + +echo "
     get_subtree($node_id,null,null,null,'',true)";
    +echo "
    "; +$subtree = $tree_mgr->get_subtree($node_id, null, null, null, '', true); +new dBug($subtree); + +echo "
     tree - get_subtree_list(\$node_id)";
    +echo "
    "; +echo "
     get_subtree_list($node_id)";
    +echo "
    "; +$subtree_list = $tree_mgr->get_subtree_list($node_id); +new dBug($subtree_list); + +$path_begin_node_id = 285; +$path_end_node_id = 2; +define('TREE_ROOT', null); +define('FORMAT_FULL', 'full'); +define('FORMAT_SIMPLE', 'simple'); + +echo "
     tree - get_path(\$node_id,\$to_node_id = null,\$format = 'full') ";
    +echo "
    "; +echo "
     tree - get_path($path_begin_node_id) ";
    +echo "
    "; +$path = $tree_mgr->get_path($path_begin_node_id); +new dBug($path); + +echo "
     tree - get_path(\$node_id,\$to_node_id = null,\$format = 'full') ";
    +echo "
    "; +echo "
     tree - get_path($path_begin_node_id,TREE_ROOT,FORMAT_FULL) ";
    +echo "
    "; +$path = $tree_mgr->get_path($path_begin_node_id, TREE_ROOT, FORMAT_FULL); +new dBug($path); + +echo "
     tree - get_path($path_begin_node_id,TREE_ROOT,FORMAT_SIMPLE) ";
    +echo "
    "; +$path = $tree_mgr->get_path($path_begin_node_id, TREE_ROOT, FORMAT_SIMPLE); +new dBug($path); + +echo "
     tree - get_path($path_begin_node_id,$path_end_node_id,FORMAT_FULL) ";
    +echo "
    "; +$path = $tree_mgr->get_path($path_begin_node_id, $path_end_node_id, FORMAT_FULL); +new dBug($path); + +$node_id = 1; +echo "
     tree - get_children(\$node_id)";
    +echo "
    "; +echo "
     get_children($node_id)";
    +echo "
    "; +$children = $tree_mgr->get_children($node_id); +new dBug($children); + +echo "
     tree - get_node_hierarchy_info(\$node_id) ";
    +echo "
    "; +echo "
     get_node_hierarchy_info($node_id) ";
    +echo "
    "; +$node_hierachy_info = $tree_mgr->get_node_hierarchy_info($node_id); +new dBug($node_hierachy_info); +?> diff --git a/lib/functions/common.php b/lib/functions/common.php index bc2b3bc6e2..a220e866ae 100644 --- a/lib/functions/common.php +++ b/lib/functions/common.php @@ -1,2166 +1,2184 @@ - TICKET 0007190 */ -if( !defined('TL_APICALL') ) -{ - require_once("csrf.php"); -} - -/** Input data validation */ -require_once("inputparameter.inc.php"); - -/** @TODO use the next include only if it is used -> must be removed */ -// require_once("testproject.class.php"); -require_once("treeMenu.inc.php"); - - -// 20130526 checks need to be done in order to understand if this class is really needed -require_once("exec_cfield_mgr.class.php"); - -/** - * Automatic loader for PHP classes - * See PHP Manual for details - */ -function tlAutoload($class_name) { - - // exceptions - // 1. remove prefix and convert lower case - $tlClasses = null; - $tlClassPrefixLen = 2; - $classFileName = $class_name; - - - // 2. add a lower case directory - $addDirToInclude = array('Kint' => true); - - // this way Zend_Loader_Autoloader will take care of these classes. - // Needed in order to make work bugzillaxmlrpc interface - if( strstr($class_name,'Zend_') !== FALSE ) { - return false; - } - - // Workaround - // https://github.com/smarty-php/smarty/issues/344 - // https://github.com/smarty-php/smarty/pull/345 - if( strpos($class_name,'Smarty_Internal_Compile_') !== FALSE ) { - return false; - } - - if (isset($tlClasses[$classFileName])) { - $len = tlStringLen($classFileName) - $tlClassPrefixLen; - $classFileName = strtolower(tlSubstr($classFileName,$tlClassPrefixLen,$len)); - } - - if (isset($addDirToInclude[$class_name])) { - $classFileName = strtolower($class_name) . "/" . $class_name; - } - - // Plugin special processing, class name ends with Plugin (see plugin_register()) - // Does not use autoload - if( preg_match('/Plugin$/', $class_name) == 1 ) { - return; - } - - - // fix provided by BitNami for: - // Reason: We had a problem integrating TestLink with other apps. - // You can reproduce it installing ThinkUp and TestLink applications in the same stack. - - try { - include_once $classFileName . '.class.php'; - } - catch (Exception $e) { - } - + TICKET 0007190 + */ +if (! defined('TL_APICALL')) { + require_once 'csrf.php'; +} + +/** + * Input data validation + */ +require_once 'inputparameter.inc.php'; + +/** + */ +require_once 'treeMenu.inc.php'; + +// 20130526 checks need to be done in order to understand if this class is really needed +require_once 'exec_cfield_mgr.class.php'; + +/** + * Automatic loader for PHP classes + * See PHP Manual for details + */ +function tlAutoload($class_name) +{ + + // exceptions + // 1. remove prefix and convert lower case + $tlClasses = null; + $tlClassPrefixLen = 2; + $classFileName = $class_name; + + // 2. add a lower case directory + $addDirToInclude = array( + 'Kint' => true + ); + + // this way Zend_Loader_Autoloader will take care of these classes. + // Needed in order to make work bugzillaxmlrpc interface + if (strstr($class_name, 'Zend_') !== false) { + return false; + } + + // Workaround + // https://github.com/smarty-php/smarty/issues/344 + // https://github.com/smarty-php/smarty/pull/345 + if (strpos($class_name, 'Smarty_Internal_Compile_') !== false) { + return false; + } + + if (isset($tlClasses[$classFileName])) { + $len = tlStringLen($classFileName) - $tlClassPrefixLen; + $classFileName = strtolower( + tlSubstr($classFileName, $tlClassPrefixLen, $len)); + } + + if (isset($addDirToInclude[$class_name])) { + $classFileName = strtolower($class_name) . "/" . $class_name; + } + + // Plugin special processing, class name ends with Plugin (see plugin_register()) + // Does not use autoload + if (preg_match('/Plugin$/', $class_name) == 1) { + return; + } + + // fix provided by BitNami for: + // Reason: We had a problem integrating TestLink with other apps. + // You can reproduce it installing ThinkUp and TestLink applications in the same stack. + + try { + include_once $classFileName . '.class.php'; + } catch (Exception $e) {} +} + +/** @var integer global main DB connection identifier */ +$db = 0; + +/** + * TestLink connects to the database + * + * @param + * database &$db reference to resource, here resource pointer will be returned. + * @param boolean $onErrorExit + * default + * false, true standard page will be displayed + * + * @return array aa['status'] = 1 -> OK , 0 -> KO + * aa['dbms_msg''] = 'ok', or $db->error_msg(). + */ +function doDBConnect(&$db, $onErrorExit = false) +{ + global $g_tlLogger; + + $charSet = config_get('charset'); + + switch (DB_TYPE) { + case 'mssql': + $dbDriverName = 'mssqlnative'; + break; + + default: + $dbDriverName = DB_TYPE; + break; + } + + $db = new database($dbDriverName); + $result = $db->connect(DSN, DB_HOST, DB_USER, DB_PASS, DB_NAME); + + if (! $result['status']) { + echo $result['dbms_msg']; + $result['status'] = 0; + $search = array( + '', + '', + '
    ' + ); + $replace = array( + '', + '', + " :: " + ); + $logtext = ' Connect to database ' . DB_NAME . ' on Host ' . + DB_HOST . ' fails
    '; + $logtext .= 'DBMS Error Message: ' . $result['dbms_msg']; + + $logmsg = $logtext . + ($onErrorExit ? '
    Redirection to connection fail screen.' : ''); + tLog(str_replace($search, $replace, $logmsg), 'ERROR'); + if ($onErrorExit) { + $smarty = new TLSmarty(); + $smarty->assign('title', lang_get('fatal_page_title')); + $smarty->assign('content', $logtext); + $smarty->assign('link_to_op', null); + $smarty->display('workAreaSimple.tpl'); + exit(); + } + } else { + if ((DB_TYPE == 'mysql') && ($charSet == 'UTF-8')) { + $db->exec_query("SET CHARACTER SET utf8"); + $db->exec_query("SET collation_connection = 'utf8_general_ci'"); + } + } + + // if we establish a DB connection, we reopen the session, + // to attach the db connection + $g_tlLogger->endTransaction(); + $g_tlLogger->startTransaction(); + + return $result; +} + +/** + * Set session data related to the current test plan + * and saves a cookie with current testplan id + * + * @param array $tplan_info + * result of DB query + */ +function setSessionTestPlan($tplan_info) +{ + if ($tplan_info) { + $_SESSION['testplanID'] = $tplan_info['id']; + $_SESSION['testplanName'] = $tplan_info['name']; + + // Save testplan id for next session + $ckObj = new stdClass(); + + $ckCfg = config_get('cookie'); + $ckObj->name = $ckCfg->prefix . 'TL_lastTestPlanForUserID_' . + intval($_SESSION['userID']); + $ckObj->value = $tplan_info['id']; + + tlSetCookie($ckObj); + + tLog( + "Test Plan was adjusted to '" . $tplan_info['name'] . "' ID(" . + $tplan_info['id'] . ')', 'INFO'); + } else { + unset($_SESSION['testplanID']); + unset($_SESSION['testplanName']); + } +} + +/** + * Set home URL path + * + * @internal revisions + */ +function setPaths() +{ + if (! isset($_SESSION['basehref'])) { + $_SESSION['basehref'] = get_home_url( + array( + 'force_https' => config_get('force_https') + )); + } +} + +/** + * Verify if user is log in. + * Redirect to login page if not. + * + * @param integer $db + * DB identifier + * @param boolean $redirect + * if true (default) redirects user to login page, otherwise returns true/false as login status + */ +function checkSessionValid(&$db, $redirect = true) +{ + $isValidSession = false; + if (isset($_SESSION['userID']) && $_SESSION['userID'] > 0) { + $now = time(); + if (($now - $_SESSION['lastActivity']) <= + (config_get("sessionInactivityTimeout") * 60)) { + $_SESSION['lastActivity'] = $now; + $user = new tlUser($_SESSION['userID']); + $user->readFromDB($db); + $_SESSION['currentUser'] = $user; + $isValidSession = true; + } + } + + if (! $isValidSession && $redirect) { + tLog( + 'Invalid session from ' . $_SERVER["REMOTE_ADDR"] . + '. Redirected to login page.', 'INFO'); + + $fName = "login.php"; + $baseDir = dirname($_SERVER['SCRIPT_FILENAME']); + + while (! file_exists($baseDir . DIRECTORY_SEPARATOR . $fName)) { + $fName = "../" . $fName; + } + $destination = "&destination=" . urlencode($_SERVER['REQUEST_URI']); + redirect($fName . "?note=expired" . $destination, "top.location"); + exit(); + } + return $isValidSession; +} + +/** + * Start session + */ +function doSessionStart($setPaths = false) +{ + if (PHP_SESSION_NONE == session_status()) { + session_set_cookie_params(99999); + } + + if (! isset($_SESSION)) { + session_start(); + if (defined('KINT_ON') && KINT_ON) { + Kint::enabled(true); + } else { + Kint::enabled(false); + } + } + + if ($setPaths) { + unset($_SESSION['basehref']); + setPaths(); + } +} + +/** + * Initialize structure of top menu for the user and the project. + * + * @param integer $db + * DB connection identifier + * @uses $_SESSION Requires initialized project, test plan and user data. + * @since 1.9 + * + * @internal revisions + */ +function initTopMenu(&$db) +{ + $_SESSION['testprojectTopMenu'] = ''; + $guiTopMenu = config_get('guiTopMenu'); + + $imageSet = TLSmarty::getImageSet(); + + // check if Project is available + if (isset($_SESSION['testprojectID']) && $_SESSION['testprojectID'] > 0) { + $idx = 1; + foreach ($guiTopMenu as $element) { + // check if Test Plan is available + $testPlanID = (isset($_SESSION['testplanID']) && + $_SESSION['testplanID'] > 0) ? $_SESSION['testplanID'] : null; + if ((! isset($element['condition'])) || ($element['condition'] == '') || + (($element['condition'] == 'TestPlanAvailable') && + ! is_null($testPlanID)) || + (($element['condition'] == 'ReqMgmtEnabled') && + isset($_SESSION['testprojectOptions']->requirementsEnabled) && + $_SESSION['testprojectOptions']->requirementsEnabled)) { + // (is_null($element['right']) => no right needed => display always + + $addItem = is_null($element['right']); + if (! $addItem) { + if (is_array($element['right'])) { + foreach ($element['right'] as $rg) { + if ($addItem = (has_rights($db, $rg, + $_SESSION['testprojectID'], $testPlanID) == "yes")) { + break; + } + } + } else { + $addItem = (has_rights($db, $element['right'], + $_SESSION['testprojectID'], $testPlanID) == "yes"); + } + } + + if ($addItem) { + $_SESSION['testprojectTopMenu'] .= ""; + + if (isset($element['imgKey'])) { + $_SESSION['testprojectTopMenu'] .= ''; + } else { + $_SESSION['testprojectTopMenu'] .= lang_get( + $element['label']); + } + + $_SESSION['testprojectTopMenu'] .= "   "; + } + } + } + $_SESSION['testprojectTopMenu'] .= "      "; + } +} + +/** + * Update Project and Test Plan data on Project change or startup + * Data are stored in $_SESSION array + * + * If we receive TestPlan ID in the _SESSION then do some checks and if everything OK + * Update this value at Session Level, to set it available in other pieces of the application + * + * @param integer $db + * DB connection identifier + * @param array $hash_user_sel + * input data for the page ($_REQUEST) + * + * @uses initMenu() + * @internal revisions + */ +function initProject(&$db, $hash_user_sel) +{ + $ckObj = new stdClass(); + $ckCfg = config_get('cookie'); + + $tproject = new testproject($db); + $user_sel = array( + "tplan_id" => 0, + "tproject_id" => 0 + ); + $user_sel["tproject_id"] = isset($hash_user_sel['testproject']) ? intval( + $hash_user_sel['testproject']) : 0; + $user_sel["tplan_id"] = isset($hash_user_sel['testplan']) ? intval( + $hash_user_sel['testplan']) : 0; + + $tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + // test project is Test Plan container, then we start checking the container + if ($user_sel["tproject_id"] != 0) { + $tproject_id = $user_sel["tproject_id"]; + } + + // We need to do checks before updating the SESSION to cover the case that not defined but exists + if (! $tproject_id) { + $all_tprojects = $tproject->get_all(); + if ($all_tprojects) { + $tproject_data = $all_tprojects[0]; + $tproject_id = $tproject_data['id']; + } + } + $tproject->setSessionProject($tproject_id); + + // set a Test Plan + // Refresh test project id after call to setSessionProject + $tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : null; + + // Now we need to validate the TestPlan + $ckObj->name = $ckCfg->prefix . + "TL_user{$_SESSION['userID']}_proj{$tproject_id}_testPlanId"; + + if ($user_sel["tplan_id"] != 0) { + $ckObj->value = $user_sel["tplan_id"]; + $ckObj->expire = time() + 60 * 60 * 24 * 90; + tlSetCookie($ckObj); + } elseif (isset($_COOKIE[$ckObj->name])) { + $tplan_id = intval($_COOKIE[$ckObj->name]); + } + + // check if the specific combination of testprojectid and testplanid is valid + $tplan_data = $_SESSION['currentUser']->getAccessibleTestPlans($db, + $tproject_id, $tplan_id); + if (is_null($tplan_data)) { + // Need to get first accessible test plan for user, if any exists. + $tplan_data = $_SESSION['currentUser']->getAccessibleTestPlans($db, + $tproject_id); + } + + if (! is_null($tplan_data) && is_array($tplan_data)) { + $tplan_data = $tplan_data[0]; + setSessionTestPlan($tplan_data); + } + + // initialize structure of top menu for the user and the project + initTopMenu($db); +} + +/** + * General GUI page initialization procedure + * - init session + * - init database + * - check rights + * - initialize project data (if requested) + * + * @param integer $db + * DB connection identifier + * @param boolean $initProject + * (optional) Set true if adjustment of Test Project or + * Test Plan is required; default is FALSE + * @param boolean $dontCheckSession + * (optional) Set to true if no session should be started + * @param string $userRightsCheckFunction + * (optional) name of function used to check user right needed + * to execute the page + */ +function testlinkInitPage(&$db, $initProject = false, $dontCheckSession = false, + $userRightsCheckFunction = null, $onFailureGoToLogin = false) +{ + static $pageStatistics = null; + + doSessionStart(); + setPaths(); + if (isset($_SESSION['locale']) && ! is_null($_SESSION['locale'])) { + setDateTimeFormats($_SESSION['locale']); + } + doDBConnect($db); + + if (! $pageStatistics && (config_get('log_level') == 'EXTENDED')) { + $pageStatistics = new tlPageStatistics($db); + } + + if (! $dontCheckSession) { + checkSessionValid($db); + } + + if ($userRightsCheckFunction !== null) { + checkUserRightsFor($db, $userRightsCheckFunction, $onFailureGoToLogin); + } + + // Init plugins + plugin_init_installed(); + + // adjust Product and Test Plan to $_SESSION + if ($initProject) { + initProject($db, $_REQUEST); + } + + // used to disable the attachment feature if there are problems with repository path + /** + * + * @todo this check should not be done anytime but on login and using + */ + global $g_repositoryPath; + global $g_repositoryType; + global $tlCfg; + $tlCfg->attachments->disabled_msg = ""; + if ($g_repositoryType == TL_REPOSITORY_TYPE_FS) { + $ret = checkForRepositoryDir($g_repositoryPath); + if (! $ret['status_ok']) { + $tlCfg->attachments->enabled = false; + $tlCfg->attachments->disabled_msg = $ret['msg']; + } + } +} + +/** + * Redirect page to another one + * + * @param + * string URL of required page + * @param + * string Browser location - use for redirection or refresh of another frame + * Default: 'location' + */ +function redirect($url, $level = 'location') +{ + // XSS Attack - 06486: Cross-Site Scripting on login page + $safeUrl = addslashes($url); + echo ""; + echo ""; + + exit(); +} + +/** + * Security parser for input strings + * + * @param string $parameter + * @return string cleaned parameter + */ +function strings_stripSlashes($parameter, $bGPC = true) +{ + if ($bGPC && ! ini_get('magic_quotes_gpc')) { + return $parameter; + } + + if (is_array($parameter)) { + $retParameter = null; + if (count($parameter)) { + foreach ($parameter as $key => $value) { + if (is_array($value)) { + $retParameter[$key] = strings_stripSlashes($value, $bGPC); + } else { + $retParameter[$key] = stripslashes($value); + } + } + } + return $retParameter; + } else { + return stripslashes($parameter); + } +} + +function to_boolean($alt_boolean) +{ + $the_val = 1; + + if (is_numeric($alt_boolean) && ! intval($alt_boolean)) { + $the_val = 0; + } else { + $a_bool = array( + "on" => 1, + "y" => 1, + "off" => 0, + "n" => 0 + ); + $alt_boolean = strtolower($alt_boolean); + if (isset($a_bool[$alt_boolean])) { + $the_val = $a_bool[$alt_boolean]; + } + } + + return $the_val; +} + +/** + * Validate string by relular expression + * + * @param string $str2check + * @param string $regexp_forbidden_chars + * Regular expression (perl format) + * @return boolean 1: check ok, 0:check KO + * + * @todo havlatm: remove as obsolete or move to inputparam.inc.php + */ +function checkString($str2check, $regexp_forbidden_chars) +{ + $status_ok = 1; + + if (! empty($regexp_forbidden_chars) && + preg_match($regexp_forbidden_chars, $str2check)) { + $status_ok = 0; + } + return $status_ok; +} + +/** + * Load global configuration to function + * + * @param string $config_id + * key for identification of configuration parameter + * @return mixed the configuration parameter(s) + * + * @internal Revisions + */ +function config_get($config_id, $default = null) +{ + $t_value = (null == $default) ? '' : $default; + $t_found = false; + $logInfo = array( + 'msg' => "config option not available: {$config_id}", + 'level' => 'WARNING' + ); + if (! $t_found) { + $my = "g_" . $config_id; + if ($t_found = isset($GLOBALS[$my])) { + $t_value = $GLOBALS[$my]; + } else { + $cfg = $GLOBALS['tlCfg']; + if ($t_found = property_exists($cfg, $config_id)) { + $t_value = $cfg->$config_id; + } + } + + if ($t_found) { + $logInfo['msg'] = "config option: {$config_id} is " . + ((is_object($t_value) || is_array($t_value)) ? serialize( + $t_value) : $t_value); + $logInfo['level'] = 'INFO'; + } + } + + tLog($logInfo['msg'], $logInfo['level']); + return $t_value; +} + +/** + * + * @return boolean Return true if the parameter is an empty string or a string + * containing only whitespace, false otherwise + * @author Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito + */ +function isBlank($p_var) +{ + $p_var = trim($p_var); + $str_len = strlen($p_var); + if (0 == $str_len) { + return true; + } + return false; +} + +/** + * Builds the header needed to make the content available for downloading + * + * @param string $content + * the content which should be downloaded + * @param string $fileName + * the filename + */ +function downloadContentsToFile($content, $fileName, $opt = null) +{ + $my = array(); + $my['opt'] = array( + 'Content-Type' => 'text/plain' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + $charSet = config_get('charset'); + + ob_get_clean(); + header('Pragma: public'); + header( + 'Content-Type: ' . $my['opt']['Content-Type'] . + "; charset={$charSet}; name={$fileName}"); + header('Content-Transfer-Encoding: BASE64;'); + header('Content-Disposition: attachment; filename="' . $fileName . '"'); + echo $content; +} + +/** + * helper function for performance timing + * + * @todo havlatm: Andreas, move to logger? + * returns: ? + */ +function microtime_float() +{ + list ($usec, $sec) = explode(" ", microtime()); + return (float) $usec + (float) $sec; +} + +/** + * Converts a priority weight (urgency * importance) to HIGH, MEDUIM or LOW + * + * @return integer HIGH, MEDUIM or LOW + */ +function priority_to_level($priority) +{ + $urgencyImportance = config_get('urgencyImportance'); + + if ($priority >= $urgencyImportance->threshold['high']) { + return HIGH; + } elseif ($priority < $urgencyImportance->threshold['low']) { + return LOW; + } else { + return MEDIUM; + } +} + +/** + * Get the named php ini variable but return it as a bool + * + * @author Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito + */ +function ini_get_bool($p_name) +{ + $result = ini_get($p_name); + + if (is_string($result)) { + switch ($result) { + case 'off': + case 'false': + case 'no': + case 'none': + case '': + case '0': + return false; + break; + case 'on': + case 'true': + case 'yes': + case '1': + return true; + break; + } + } else { + return (bool) $result; + } +} + +/** + * Trim string and limit to N chars + * + * @param + * string + * @param + * int [len]: how many chars return + * @return string trimmed string + * + * @author Francisco Mancardi - 20050905 - refactoring + */ +function trimAndLimit($s, $len = 100) +{ + $s = trim($s); + if (tlStringLen($s) > $len) { + $s = tlSubStr($s, 0, $len); + } + + return $s; +} + +/** + * + * @todo havlatm - 20100207 - what's that? and why here. Remove' + */ +// nodes_order format: NODE_ID-?,NODE_ID-? +// 2-0,10-0,3-0 +function transform_nodes_order($nodes_order, $node_to_exclude = null) +{ + $fa = explode(',', $nodes_order); + + foreach ($fa as $value) { + // $value= X-Y + $fb = explode('-', $value); + + if (is_null($node_to_exclude) || $fb[0] != $node_to_exclude) { + $nodes_id[] = $fb[0]; + } + } + + return $nodes_id; +} + +/** + * Checks $_FILES for errors while uploading + * + * @param array $fInfo + * an array used by uploading files ($_FILES) + * @return string containing an error message (if any) + */ +function getFileUploadErrorMessage($fInfo, $tlInfo = null) +{ + $msg = null; + if (isset($fInfo['error'])) { + switch ($fInfo['error']) { + case UPLOAD_ERR_INI_SIZE: + $msg = lang_get( + 'error_file_size_larger_than_maximum_size_check_php_ini'); + break; + + case UPLOAD_ERR_FORM_SIZE: + $msg = lang_get('error_file_size_larger_than_maximum_size'); + break; + + case UPLOAD_ERR_PARTIAL: + case UPLOAD_ERR_NO_FILE: + $msg = lang_get('error_file_upload'); + break; + } + } + + if (null == $msg && null != $tlInfo && ! $tlInfo->statusOK) { + $msg = lang_get('FILE_UPLOAD_' . $tlInfo->statusCode); + if (property_exists($tlInfo, 'msg')) { + $msg = $tlInfo->msg; + } + } + return $msg; +} + +/** + * Redirect to a page with static html defined in locale/en_GB/texts.php + * + * @param string $key + * keyword for finding exact html text in definition array + */ +function show_instructions($key, $refreshTree = 0) +{ + $myURL = $_SESSION['basehref'] . "lib/general/staticPage.php?key={$key}"; + + if ($refreshTree) { + $myURL .= "&refreshTree=1"; + } + redirect($myURL); +} + +/** + * + * @param string $template2get + * @return stdClass with the template configuration + */ +function templateConfiguration($template2get = null) +{ + $custom_templates = config_get('tpl'); + $access_key = $template2get; + if (is_null($access_key)) { + $access_key = str_replace('.php', '', basename($_SERVER['SCRIPT_NAME'])); + } + + $path_parts = explode("/", dirname($_SERVER['SCRIPT_NAME'])); + $last_part = array_pop($path_parts); + $tcfg = new stdClass(); + $tcfg->template_dir = "{$last_part}/"; + $tcfg->default_template = isset($custom_templates[$access_key]) ? $custom_templates[$access_key] : ($access_key . + '.tpl'); + $tcfg->template = null; + $tcfg->tpl = $tcfg->template_dir . $tcfg->default_template; + return $tcfg; +} + +/** + * Check if an string is a valid ISO date/time + * accepted format: YYYY-MM-DD HH:MM:SS + * + * @param string $isoDateTime + * datetime to check + * @return boolean True if string has correct format + * + * @internal rev: 20080907 - franciscom - Code taked form PHP manual + */ +function isValidISODateTime($isoDateTime) +{ + $dateParts = array( + 'YEAR' => 1, + 'MONTH' => 2, + 'DAY' => 3 + ); + + $matches = null; + $status_ok = false; + if (preg_match( + "/^(\d{4})-(\d{2})-(\d{2}) ([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/", + $isoDateTime, $matches)) { + $status_ok = checkdate($matches[$dateParts['MONTH']], + $matches[$dateParts['DAY']], $matches[$dateParts['YEAR']]); + } + return $status_ok; +} + +/** + * Check if a localized timestamp is valid + * uses split_localized_date() + */ +function is_valid_date($timestamp, $dateFormat) +{ + $date_array = split_localized_date($timestamp, $dateFormat); + + $status_ok = false; + if ($date_array != null) { + $status_ok = checkdate($date_array['month'], $date_array['day'], + $date_array['year']); + } + + return $status_ok; +} + +/** + * Returns array containing date pieces for a given timestamp according to dateFormat + */ +function split_localized_date($timestamp, $dateFormat) +{ + if (strlen(trim($timestamp)) == 0) { + return null; + } + + $splitChar = null; + $needle = array( + ".", + "-", + "/", + "%" + ); + foreach ($needle as $target) { + if (strpos($timestamp, $target) !== false) { + $splitChar = $target; + break; + } + } + // put each char of strippedDateFormat into an Array Element + $strippedDateFormat = str_replace($needle, "", $dateFormat); + $format = preg_split('//', $strippedDateFormat, - 1, PREG_SPLIT_NO_EMPTY); + $pieces = explode($splitChar, $timestamp); + $result = array(); + if (count($pieces) == 3) // MAGIC ALLOWED + { + $k2t = array( + 'Y' => 'year', + 'm' => 'month', + 'd' => 'day' + ); + foreach ($format as $idx => $access) { + $result[$k2t[$access]] = $pieces[$idx]; + } + } + return $result; +} + +/** + */ +function checkUserRightsFor(&$db, $pfn, $onFailureGoToLogin = false) +{ + $script = basename($_SERVER['PHP_SELF']); + $currentUser = $_SESSION['currentUser']; + $doExit = false; + $action = null; + + $m2call = $pfn; + $arguments = null; + if (is_object($pfn)) { + $m2call = $pfn->method; + $arguments = $pfn->args; + } + + if (! $m2call($db, $currentUser, $arguments, $action)) { + if (! $action) { + $action = "any"; + } + logAuditEvent( + TLS("audit_security_user_right_missing", $currentUser->login, + $script, $action), $action, $currentUser->dbID, "users"); + $doExit = true; + } + + if ($doExit) { + $myURL = $_SESSION['basehref']; + if ($onFailureGoToLogin) { + unset($_SESSION['currentUser']); + redirect($myURL . "login.php"); + } else { + redirect($myURL, "top.location"); + } + exit(); + } +} + +function tlStringLen($str) +{ + $charset = config_get('charset'); + $nLen = iconv_strlen($str, $charset); + if ($nLen === false) { + throw new Exception("Invalid UTF-8 Data detected!"); + } + return $nLen; +} + +function tlSubStr($str, $start, $length = null) +{ + $charset = config_get('charset'); + if ($length === null) { + $length = iconv_strlen($str, $charset); + } + // BUGID 3951: replaced iconv_substr() by mb_substr() + $function_call = "mb_substr"; + if (function_exists('iconv_substr') && + version_compare(PHP_VERSION, '5.2.0') >= 0) { + $function_call = "iconv_substr"; + } + return $function_call($str, $start, $length, $charset); +} + +/** + * Get text from a configured item template for editor objects + * + * @param string $itemTemplate + * identifies + * a TestLink item that can have + * templates that can be loaded when creating an item to semplify + * or guide user's work. + * $itemTemplate is a property (of type stdClass) of $tlCfg configuration object. + * + * supported values: + * testcase_template + * + * @param string $webEditorName + * webeditor + * name, that identifies a propety of $tlCfg->$itemTemplate + * that holds input tenmplate configuration + * + * @param string $defaultText + * text + * to use if: + * $tlCfg->itemTemplate OR $tlCfg->itemTemplate->$webEditorName + * does not exists. + * + */ +function getItemTemplateContents($itemTemplate, $webEditorName, + $defaultText = '') +{ + $editorTemplate = config_get($itemTemplate); + $value = $defaultText; + if (! is_null($editorTemplate) && + property_exists($editorTemplate, $webEditorName)) { + switch ($editorTemplate->$webEditorName->type) { + case 'string': + $value = $editorTemplate->$webEditorName->value; + break; + + case 'string_id': + $value = lang_get($editorTemplate->$webEditorName->value); + break; + + case 'file': + $value = getFileContents($editorTemplate->$webEditorName->value); + if (is_null($value)) { + $value = lang_get('problems_trying_to_access_template') . + " {$editorTemplate->$webEditorName->value} "; + } + break; + + case 'none': + default: + break; + } + } + return $value; +} + +/** + * Builds a string $testCasePrefix . + * $glueChar . $external_id + * + * @param string $testCasePrefix + * prefix for the project without glue character + * @param mixed $external_id + */ +function buildExternalIdString($testCasePrefix, $external_id) +{ + static $glueChar; + if (! $glueChar) { + $glueChar = config_get('testcase_cfg')->glue_character; + } + return $testCasePrefix . $glueChar . $external_id; +} + +/** + */ +function displayMemUsage($msg = '') +{ + $dx = date('l jS \of F Y h:i:s A'); + echo "
    {$msg} :: {$dx}
    "; + ob_flush(); + flush(); + echo "memory:" . memory_get_usage() . " - PEAK -> " . memory_get_peak_usage() . + '
    '; + ob_flush(); + flush(); +} + +/** + */ +function setUpEnvForRemoteAccess(&$dbHandler, $apikey, $rightsCheck = null, + $opt = null) +{ + $my = array( + 'opt' => array( + 'setPaths' => false, + 'clearSession' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if ($my['opt']['clearSession']) { + $_SESSION = null; + } + + doSessionStart($my['opt']['setPaths']); + if (isset($_SESSION['locale']) && ! is_null($_SESSION['locale'])) { + setDateTimeFormats($_SESSION['locale']); + } + doDBConnect($dbHandler); + + $user = tlUser::getByAPIKey($dbHandler, $apikey); + if (count($user) == 1) { + $_SESSION['lastActivity'] = time(); + $userObj = new tlUser(key($user)); + $userObj->readFromDB($dbHandler); + $_SESSION['currentUser'] = $userObj; + $_SESSION['userID'] = $userObj->dbID; + $_SESSION['locale'] = $userObj->locale; + + // if user do this: + // 1. login to test link + // 2. get direct link and open in new tab or new window while still logged + // 3. logout + // If user refresh tab / window open on (2), because on (3) we destroyed + // session we have loose basehref, and we are not able to recreate it. + // Without basehref we are not able to get CSS, JS, etc. + // In this situation we destroy session, this way user is forced to login + // again in one of two ways + // a. using the direct link + // b. using traditional login + // In both way we assure that behaivour will be OK. + // + if (! isset($_SESSION['basehref'])) { + session_unset(); + session_destroy(); + if (property_exists($rightsCheck, 'redirect_target') && + ! is_null($rightsCheck->redirect_target)) { + redirect($rightsCheck->redirect_target); + } else { + // best guess for all features that live on ./lib/results/ + redirect("../../login.php?note=logout"); + } + + exit(); + } + + if (! is_null($rightsCheck)) { + checkUserRightsFor($dbHandler, $rightsCheck, true); + } + } +} + +/* + * returns map with config values and strings translated (using lang_get()) + * to be used on user interface for a Test link configuration option that + * is structure in this way: + * config_option = array( string_value => any_value, ...) + * + * All this works if TL_ strings defined on strings.txt follows this naming standard. + * + * For a config option like: + * $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); + * + * + * will exists: $TL_workflowStatus_draft='...'; + * $TL_workflowStatus_review='...'; + * + * @param string configKey: valus used on call to standard test link + * method to get configuration option + * + * @param string accessMode: two values allowed 'key', 'code' + * indicates how the returned map must be indexed. + * + * 'key' => will be indexed by string + * value that is key of config option + * + * 'code' => will be indexed by value of config option + * + * @example + * + * $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); + * $i18nlabels = getLabels('workflowStatus','key'); + * array_keys($i18nlabels) will return array('draft','review'); + * + * + * $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); + * $i18nlabels = getLabels('workflowStatus','code'); + * array_keys($i18nlabels) will return array(1,2); + * + * @internal revisions + * @since 1.9.7 + */ +function getConfigAndLabels($configKey, $accessMode = 'key') +{ + $stringKeyCode = config_get($configKey); + $labels = null; + foreach ($stringKeyCode as $accessKey => $code) { + $index = ($accessMode == 'key') ? $accessKey : $code; + $labels[$index] = lang_get($configKey . '_' . $accessKey); + } + return array( + 'cfg' => $stringKeyCode, + 'lbl' => $labels + ); +} + +function setDateTimeFormats($locale) +{ + global $tlCfg; + + if ($tlCfg->locales_date_format[$locale]) { + $tlCfg->date_format = $tlCfg->locales_date_format[$locale]; + } + + if ($tlCfg->locales_timestamp_format[$locale]) { + $tlCfg->timestamp_format = $tlCfg->locales_timestamp_format[$locale]; + } +} + +/** + * windowCloseAndOpenerReload() + * will close a popup window and reload caller contents. + */ +function windowCloseAndOpenerReload() +{ + echo ""; + echo ""; + exit(); +} + +/** + */ +function setUpEnvForAnonymousAccess(&$dbHandler, $apikey, $rightsCheck = null, + $opt = null) +{ + $my = array( + 'opt' => array( + 'setPaths' => false, + 'clearSession' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if ($my['opt']['clearSession']) { + $_SESSION = null; + } + + doSessionStart($my['opt']['setPaths']); + if (isset($_SESSION['locale']) && ! is_null($_SESSION['locale'])) { + setDateTimeFormats($_SESSION['locale']); + } + doDBConnect($dbHandler); + + // @since 1.9.14 + $checkMode = 'paranoic'; + if (property_exists($rightsCheck->args, 'envCheckMode')) { + $checkMode = $rightsCheck->args->envCheckMode; + } + + switch ($checkMode) { + case 'hippie': + $tk = array( + 'testplan', + 'testproject' + ); + break; + + default: + $tk[] = (intval($rightsCheck->args->tplan_id) != 0) ? 'testplan' : 'testproject'; + break; + } + + foreach ($tk as $ak) { + $item = getEntityByAPIKey($dbHandler, $apikey, $ak); + if (! is_null($item)) { + break; + } + } + + $status_ok = false; + if (! is_null($item)) { + $_SESSION['lastActivity'] = time(); + $userObj = new tlUser(); + $_SESSION['currentUser'] = $userObj; + $_SESSION['userID'] = - 1; + $_SESSION['locale'] = config_get('default_language'); + + // if user do this: + // 1. login to test link + // 2. get direct link and open in new tab or new window while still logged + // 3. logout + // If user refresh tab / window open on (2), because on (3) we destroyed + // session we have loose basehref, and we are not able to recreate it. + // Without basehref we are not able to get CSS, JS, etc. + // In this situation we destroy session, this way user is forced to login + // again in one of two ways + // a. using the direct link + // b. using traditional login + // In both way we assure that behaivour will be OK. + // + if (! isset($_SESSION['basehref'])) { + session_unset(); + session_destroy(); + if (property_exists($rightsCheck, 'redirect_target') && + ! is_null($rightsCheck->redirect_target)) { + redirect($rightsCheck->redirect_target); + } else { + // best guess for all features that live on ./lib/results/ + redirect("../../login.php?note=logout"); + } + exit(); + } + + if (! is_null($rightsCheck->method)) { + checkUserRightsFor($dbHandler, $rightsCheck->method, true); + } + $status_ok = true; + } + + return $status_ok; +} + +/** + */ +function getEntityByAPIKey(&$dbHandler, $apiKey, $type) +{ + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $tables = tlObjectWithDB::getDBTables(array( + 'testprojects', + 'testplans' + )); + switch ($type) { + case 'testproject': + $target = $tables['testprojects']; + break; + + case 'testplan': + $target = $tables['testplans']; + break; + + default: + throw new Exception("Aborting - Bad type", 1); + break; + } + + $sql = "/* $debugMsg */ " . " SELECT id FROM {$target} " . + " WHERE api_key = '" . $dbHandler->prepare_string($apiKey) . "'"; + + $rs = $dbHandler->get_recordset($sql); + return $rs ? $rs[0] : null; +} + +/** + */ +function checkAccess(&$dbHandler, &$userObj, $context, $rightsToCheck) +{ + // name of caller script + $script = basename($_SERVER['PHP_SELF']); + $doExit = false; + $action = 'any'; + $env = array( + 'tproject_id' => 0, + 'tplan_id' => 0 + ); + $env = array_merge($env, $context); + foreach ($env as $key => $val) { + $env[$key] = intval($val); + } + + if ($doExit = (is_null($env) || $env['tproject_id'] == 0)) { + logAuditEvent(TLS("audit_security_no_environment", $script), $action, + $userObj->dbID, "users"); + } + + if (! $doExit) { + foreach ($rightsToCheck->items as $verboseRight) { + $status = $userObj->hasRight($dbHandler, $verboseRight, + $env['tproject_id'], $env['tplan_id'], true); + if (($doExit = ! $status) && ($rightsToCheck->mode == 'and')) { + $action = 'any'; + logAuditEvent( + TLS("audit_security_user_right_missing", $userObj->login, + $script, $action), $action, $userObj->dbID, "users"); + break; + } + } + } + + if ($doExit) { + redirect($_SESSION['basehref'], "top.location"); + exit(); + } +} + +/* + * function: getWebEditorCfg + * + * args:- + * + * returns: + * + */ +function getWebEditorCfg($feature = 'all') +{ + $cfg = config_get('gui'); + $defaultCfg = $cfg->text_editor['all']; + $webEditorCfg = isset($cfg->text_editor[$feature]) ? $cfg->text_editor[$feature] : $defaultCfg; + + foreach ($defaultCfg as $key => $value) { + if (! isset($webEditorCfg[$key])) { + $webEditorCfg[$key] = $defaultCfg[$key]; + } + } + return $webEditorCfg; +} + +/** + */ +function downloadXls($fname, $xlsType, $gui, $filePrefix) +{ + $sets = array(); + $sets['Excel2007'] = array( + 'ext' => '.xlsx', + 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ); + $sets['Excel5'] = array( + 'ext' => '.xls', + 'Content-Type' => 'application/vnd.ms-excel' + ); + + $dct = array( + 'Content-Type' => $sets[$xlsType]['Content-Type'] + ); + $content = file_get_contents($fname); + $f2d = $filePrefix . $gui->tproject_name . '_' . $gui->tplan_name . + $sets[$xlsType]['ext']; + + downloadContentsToFile($content, $f2d, $dct); + unlink($fname); + exit(); +} + +/** + * POC on papertrailapp.com + */ +function syslogOnCloud($message, $component = "web", $program = "TestLink") +{ + $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + foreach (explode("\n", $message) as $line) { + $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . + $component . ': ' . $line; + socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, + 'logs5.papertrailapp.com', 11613); + } + socket_close($sock); +} + +/** + */ +function getSSODisable() +{ + return isset($_REQUEST['ssodisable']) ? 1 : 0; +} + +/** + */ +function tlSetCookie($ckObj) +{ + $stdCk = config_get('cookie'); + + foreach ($ckObj as $prop => $value) { + $stdCk->$prop = $value; + } + + setcookie($stdCk->name, $stdCk->value, $stdCk->expire, $stdCk->path, + $stdCk->domain, $stdCk->secure, $stdCk->httponly); +} + +/** + * $opt: skip map each element can be a map + * tplanForInit + * tplanToGetEffectiveRole + */ +function initUserEnv(&$dbH, $context, $opt = null) +{ + $args = new stdClass(); + $gui = new stdClass(); + + $optDeep = array( + 'skip' => array( + 'tplanForInit' => false, + 'tplanToGetEffectiveRole' => false + ) + ); + $options = array( + 'forceCreateProj' => false, + 'initNavBarMenu' => false, + 'caller' => 'not provided' + ); + if (null != $opt) { + if (isset($opt['skip'])) { + $optDeep['skip'] = array_merge($optDeep['skip'], $opt['skip']); + } + + foreach ($options as $key => $defa) { + if (isset($opt[$key])) { + $options[$key] = $opt[$key]; + } + } + } + + $args->user = $_SESSION['currentUser']; + $k2l = array( + 'tproject_id' => 0, + 'current_tproject_id' => 0, + 'tplan_id' => 0 + ); + + foreach ($k2l as $pp => $vv) { + $args->$pp = $vv; + if (isset($_REQUEST[$pp])) { + $args->$pp = intval($_REQUEST[$pp]); + } elseif (null != $context && property_exists($context, $pp)) { + $args->$pp = intval($context->$pp); + } + } + $tprjMgr = new testproject($dbH); + $guiCfg = config_get("gui"); + $opx = array( + 'output' => 'map_name_with_inactive_mark', + 'field_set' => $guiCfg->tprojects_combo_format, + 'order_by' => $guiCfg->tprojects_combo_order_by + ); + + $gui->prjSet = $tprjMgr->get_accessible_for_user($args->user->dbID, $opx); + $gui->prjQtyWholeSystem = $tprjMgr->getItemCount(); + $gui->zeroTestProjects = ($gui->prjQtyWholeSystem == 0); + $args->zeroTestProjects = $gui->zeroTestProjects; + + $args->userIsBlindFolded = (is_null($gui->prjSet) || count($gui->prjSet) == 0) && + $gui->prjQtyWholeSystem > 0; + if ($args->userIsBlindFolded) { + $args->current_tproject_id = 0; + $args->tproject_id = 0; + $args->tplan_id = 0; + } + + // It's ok to get testproject context if + // we have the testplan id? + // Can this be a potential security issue? + // Can this create a non coherent situation on GUI? + if ($args->tproject_id == 0) { + $args->tproject_id = key($gui->prjSet); + } + + if ($args->current_tproject_id == 0) { + $args->current_tproject_id = $args->tproject_id; + } + + $gui->caller = isset($_REQUEST['caller']) ? trim($_REQUEST['caller']) : ''; + $gui->tproject_id = intval($args->tproject_id); + $gui->current_tproject_id = intval($args->current_tproject_id); + $gui->tplan_id = intval($args->tplan_id); + + if ($gui->tproject_id > 0) { + // Force to avoid lot of processing + $gui->hasTestCases = $gui->hasKeywords = true; + + $gui->num_active_tplans = $tprjMgr->getActiveTestPlansCount( + $args->tproject_id); + + // get Test Plans available for the user + // $gpOpt = array('output' => 'map'); + $gpOpt = null; + $gui->tplanSet = (array) $args->user->getAccessibleTestPlans($dbH, + $args->tproject_id, $gpOpt); + $gui->countPlans = count($gui->tplanSet); + + /* + * 20191212 - will remove because have created issues + * with IVU, and I not sure anymore of usefulness + * if (false == $optDeep['skip']['tplanForInit'] || $args->tplan_id <= 0) { + * $gui->tplan_id = $args->tplan_id = (int)doTestPlanSetup($gui); + * } + */ + if ($args->tplan_id <= 0) { + $gui->tplan_id = $args->tplan_id = (int) doTestPlanSetup($gui); + } + } + + $doInitUX = ($args->tproject_id > 0) || $options['forceCreateProj']; + $gui->grants = null; + $gui->access = null; + $gui->showMenu = null; + $gui->activeMenu = setSystemWideActiveMenuOFF(); + + if ($doInitUX) { + $gui->grants = getGrantSetWithExit($dbH, $args, $tprjMgr, $options); + $gui->access = getAccess($gui); + $gui->showMenu = getMenuVisibility($gui); + } + + // Get Role Description to display. + // This means get Effective Role that has to be calculated + // using current test project & current test plan + // + // SKIP is useful if you want to consider role only + // at test project level. + // + $tplan_id = $gui->tplan_id; + if ($optDeep['skip']['tplanToGetEffectiveRole']) { + $tplan_id = null; + } + + $eRoleObj = $args->user->getEffectiveRole($dbH, $gui->tproject_id, $tplan_id); + + $cfg = config_get('gui'); + $gui->whoami = $args->user->getDisplayName() . ' ' . + $cfg->role_separator_open . $eRoleObj->getDisplayName() . + $cfg->role_separator_close; + + $gui->launcher = $_SESSION['basehref'] . 'lib/general/frmWorkArea.php'; + + $gui->docs = config_get('userDocOnDesktop') ? getUserDocumentation() : null; + + $secCfg = config_get('config_check_warning_frequence'); + $gui->securityNotes = ''; + if ((strcmp($secCfg, 'ALWAYS') == 0) || + (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && + ! isset($_SESSION['getSecurityNotesOnMainPageDone']))) { + $_SESSION['getSecurityNotesOnMainPageDone'] = 1; + $gui->securityNotes = getSecurityNotes($dbH); + } + + $gui->tprojOpt = $tprjMgr->getOptions($args->tproject_id); + $gui->opt_requirements = isset($gui->tprojOpt->requirementsEnabled) ? $gui->tprojOpt->requirementsEnabled : null; + + getActions($gui, $_SESSION['basehref']); + + $gui->logo = $_SESSION['basehref'] . TL_THEME_IMG_DIR . + config_get('logo_navbar'); + + $ft = 'form_token'; + $gui->$ft = isset($args->$ft) ? $args->$ft : 0; + if ($gui->$ft == 0 && isset($_REQUEST[$ft])) { + $gui->$ft = $_REQUEST[$ft]; + } + $gui->treeFormToken = $gui->form_token; + + return array( + $args, + $gui, + $tprjMgr + ); +} + +/** + * Actions for left side menu + */ +function getActions(&$gui, $baseURL) +{ + $bb = "{$baseURL}lib"; + + $tproject_id = 0; + if (property_exists($gui, 'tproject_id')) { + $tproject_id = intval($gui->tproject_id); + } + $ctx = "tproject_id={$tproject_id}"; + + $tplan_id = 0; + if (property_exists($gui, 'tplan_id')) { + $tplan_id = intval($gui->tplan_id); + } + $ctx .= "&tplan_id={$tplan_id}"; + + $actions = new stdClass(); + + $actions->events = "$bb/events/eventviewer.php?{$ctx}"; + $actions->usersAssign = "$bb/usermanagement/usersAssign.php?{$ctx}&featureType=testproject&featureID=" . + intval($gui->tproject_id); + + $actions->userMgmt = "$bb/usermanagement/usersView.php?{$ctx}" . + intval($gui->tproject_id); + + $actions->userInfo = "$bb/usermanagement/userInfo.php?{$ctx}"; + $actions->projectView = "$bb/project/projectView.php?{$ctx}"; + + $actions->cfAssignment = "$bb/cfields/cfieldsTprojectAssign.php?{$ctx}"; + $actions->cfieldsView = "$bb/cfields/cfieldsView.php?{$ctx}"; + + $actions->keywordsView = "$bb/keywords/keywordsView.php?{$ctx}"; + $actions->platformsView = "$bb/platforms/platformsView.php?{$ctx}"; + $actions->issueTrackerView = "$bb/issuetrackers/issueTrackerView.php?{$ctx}"; + $actions->codeTrackerView = "$bb/codetrackers/codeTrackerView.php?{$ctx}"; + $actions->reqOverView = "$bb/requirements/reqOverview.php?{$ctx}"; + $actions->reqMonOverView = "$bb/requirements/reqMonitorOverview.php?{$ctx}"; + $actions->tcSearch = "$bb/testcases/tcSearch.php?doAction=userInput&{$ctx}"; + $actions->tcCreatedUser = "$bb/results/tcCreatedPerUserOnTestProject.php?do_action=uinput&{$ctx}"; + $actions->assignReq = "$bb/general/frmWorkArea.php?feature=assignReqs&{$ctx}"; + $actions->inventoryView = "$bb/inventory/inventoryView.php?{$ctx}"; + + $actions->fullTextSearch = "$bb/search/searchMgmt.php?{$ctx}"; + + $actions->metrics_dashboard = "$bb/results/metricsDashboard.php?{$ctx}"; + + $pp = $bb . '/plan'; + $actions->planView = "$pp/planView.php?{$ctx}"; + + $actions->buildView = null; + $actions->mileView = null; + $actions->platformAssign = null; + $actions->milestonesView = null; + $actions->testcase_assignments = null; + if ($tplan_id > 0) { + $actions->buildView = "$pp/buildView.php?{$ctx}"; + $actions->mileView = "$pp/planMilestonesView.php?{$ctx}"; + $actions->platformAssign = "$bb/platforms/platformsAssign.php?{$ctx}"; + $actions->milestonesView = "$bb/plan/planMilestonesView.php?{$ctx}"; + $actions->testcase_assignments = "$bb/testcases/tcAssignedToUser.php?{$ctx}"; + } + + $launcher = $_SESSION['basehref'] . "lib/general/frmWorkArea.php?feature="; + + $gui->workArea = new stdClass(); + $gui->workArea->testSpec = "editTc&{$ctx}"; + $gui->workArea->keywordsAssign = "keywordsAssign&{$ctx}"; + + $gui->workArea->planAddTC = null; + $gui->workArea->executeTest = null; + $gui->workArea->setTestUrgency = null; + $gui->workArea->planUpdateTC = null; + $gui->workArea->showNewestTCV = null; + $gui->workArea->assignTCVExecution = null; + $gui->workArea->showMetrics = null; + + if ($tplan_id > 0) { + $gui->workArea->planAddTC = "planAddTC&{$ctx}"; + $gui->workArea->executeTest = "executeTest&{$ctx}"; + $gui->workArea->setTestUrgency = "test_urgency&{$ctx}"; + $gui->workArea->planUpdateTC = "planUpdateTC&{$ctx}"; + $gui->workArea->showNewestTCV = "newest_tcversions&{$ctx}"; + $gui->workArea->assignTCVExecution = "tc_exec_assignment&{$ctx}"; + $gui->workArea->showMetrics = "showMetrics&{$ctx}"; + } + + $gui->workArea->reqSpecMgmt = "reqSpecMgmt&{$ctx}"; + $gui->workArea->printReqSpec = "printReqSpec&{$ctx}"; + $gui->workArea->searchReq = "searchReq&{$ctx}"; + $gui->workArea->searchReqSpec = "searchReqSpec&{$ctx}"; + + $wprop = get_object_vars($gui->workArea); + foreach ($wprop as $wp => $wv) { + if (null != $gui->workArea->$wp) { + $gui->workArea->$wp = $launcher . $gui->workArea->$wp; + } + $actions->$wp = $gui->workArea->$wp; + } + + $gui->uri = $actions; + $p2l = get_object_vars($actions); + foreach ($p2l as $pp => $val) { + $gui->$pp = $actions->$pp; + } +} + +/** + */ +function getGrantSetWithExit(&$dbHandler, &$argsObj, &$tprojMgr, $opt = null) +{ + + /** + * redirect admin to create testproject if not found + */ + $options = array( + 'forceCreateProj' => true + ); + $options = array_merge($options, (array) $opt); + + if ($options['forceCreateProj'] && $argsObj->zeroTestProjects && + $argsObj->user->hasRight($dbHandler, 'mgt_modify_product')) { + redirect( + $_SESSION['basehref'] . 'lib/project/projectEdit.php?doAction=create'); + exit(); + } + + // User has test project rights + // This talks about Default/Global + // + // key: more or less verbose + // value: string present on rights table + + $systemWideRights = array( + 'project_edit' => 'mgt_modify_product', + 'configuration' => "system_configuraton", + 'usergroups' => "mgt_view_usergroups", + 'event_viewer' => "events_mgt", + 'user_mgmt' => "mgt_users" + ); + + $r2cTranslate = array( + 'reqs_view' => "mgt_view_req", + 'monitor_req' => "monitor_requirement", + 'reqs_edit' => "mgt_modify_req", + 'keywords_view' => "mgt_view_key", + 'keywords_edit' => "mgt_modify_key", + 'view_tc' => "mgt_view_tc", + 'view_testcase_spec' => "mgt_view_tc", + 'modify_tc' => 'mgt_modify_tc', + 'testplan_create' => 'mgt_testplan_create' + ); + + $r2cSame = array( + 'req_tcase_link_management', + 'keyword_assignment', + 'issuetracker_management', + 'issuetracker_view', + 'codetracker_management', + 'codetracker_view', + 'platform_management', + 'platform_view', + 'cfield_management', + 'cfield_view', + 'cfield_assignment', + 'project_inventory_view', + 'project_inventory_management', + 'testplan_unlink_executed_testcases', + 'testproject_delete_executed_testcases', + 'mgt_testplan_create', + 'testplan_execute', + 'testplan_create_build', + 'testplan_metrics', + 'testplan_planning', + 'testplan_user_role_assignment', + 'testplan_add_remove_platforms', + 'testplan_update_linked_testcase_versions', + 'testplan_set_urgent_testcases', + 'testplan_show_testcases_newest_versions', + 'testplan_milestone_overview', + 'exec_edit_notes', + 'exec_delete', + 'exec_ro_access', + 'exec_testcases_assigned_to_me', + 'exec_assign_testcases' + ); + + if ($argsObj->userIsBlindFolded) { + $tr = array_merge($systemWideRights, $r2cTranslate); + $grants = array_fill_keys(array_keys($tr), 'no'); + + foreach ($r2cSame as $rr) { + $grants[$rr] = 'no'; + } + return (object) $grants; + } + + // Go ahead, continue with the analysis + // First get system wide rights + foreach ($systemWideRights as $humankey => $right) { + $grants[$humankey] = $argsObj->user->hasRight($dbHandler, $right); + } + + foreach ($r2cTranslate as $humankey => $right) { + $grants[$humankey] = $argsObj->user->hasRight($dbHandler, $right, + $argsObj->tproject_id, $argsObj->tplan_id); + } + + foreach ($r2cSame as $right) { + $grants[$right] = $argsObj->user->hasRight($dbHandler, $right, + $argsObj->tproject_id, $argsObj->tplan_id); + } + + // check right ONLY if option is enabled + $tprojOpt = $tprojMgr->getOptions($argsObj->tproject_id); + if ($tprojOpt->inventoryEnabled) { + $invr = array( + 'project_inventory_view', + 'project_inventory_management' + ); + foreach ($invr as $r) { + $grants[$r] = ($argsObj->user->hasRight($dbHandler, $r) == 'yes') ? 1 : 0; + } + } + + $grants['tproject_user_role_assignment'] = "no"; + if ($argsObj->user->hasRight($dbH, "testproject_user_role_assignment", + $argsObj->tproject_id, - 1) == "yes" || + $argsObj->user->hasRight($db, "user_role_assignment", null, - 1) == "yes") { + $grants['tproject_user_role_assignment'] = "yes"; + } + return (object) $grants; +} + +/** + */ +function getAccess(&$gui) +{ + $k2l = array( + 'codetracker', + 'issuetracker', + 'platform' + ); + foreach ($k2l as $ak) { + $access[$ak] = 'no'; + $p_m = $ak . '_management'; + $p_v = $ak . '_view'; + if ('yes' == $gui->grants->$p_m || 'yes' == $gui->grants->$p_v) { + $access[$ak] = 'yes'; + } + } + return $access; +} + +/** + */ +function getMenuVisibility(&$gui) +{ + $showMenu = getFirstLevelMenuStructure(); + + if ($gui->tproject_id > 0 && + ($gui->grants->view_tc == "yes" || $gui->grants->reqs_view == "yes" || + $gui->grants->reqs_edit == "yes")) { + $showMenu['search'] = true; + } + + if ($gui->tproject_id > 0 && + ($gui->grants->cfield_assignment == "yes" || + $gui->grants->cfield_management == "yes" || + $gui->grants->issuetracker_management == "yes" || + $gui->grants->codetracker_management == "yes" || + $gui->grants->issuetracker_view == "yes" || + $gui->grants->codetracker_view == "yes")) { + $showMenu['system'] = true; + } + + if ($gui->tproject_id > 0 && + ($gui->grants->project_edit == "yes" || + $gui->grants->tproject_user_role_assignment == "yes" || + $gui->grants->cfield_management == "yes" || + $gui->grants->platform_management == "yes" || + $gui->grants->keywords_view == "yes")) { + $showMenu['projects'] = true; + } + + if ($gui->tproject_id > 0 && + // $gui->opt_requirements == true && TO REACTIVATE + ($gui->grants->reqs_view == "yes" || $gui->grants->reqs_edit == "yes" || + $gui->grants->monitor_req == "yes" || + $gui->grants->req_tcase_link_management == "yes")) { + $showMenu['requirements_design'] = true; + } + + if ($gui->tproject_id > 0 && ($gui->grants->view_tc == "yes")) { + $showMenu['tests_design'] = true; + } + + if ($gui->tproject_id > 0 && + ($gui->grants->testplan_planning == "yes" || + $gui->grants->mgt_testplan_create == "yes" || + $gui->grants->testplan_user_role_assignment == "yes" || + $gui->grants->testplan_create_build == "yes")) { + $showMenu['plans'] = true; + } + + if ($gui->tproject_id > 0 && $gui->tplan_id > 0 && + ($gui->grants->testplan_execute == "yes" || + $gui->grants->exec_ro_access == "yes")) { + $showMenu['execution'] = true; + } + + if ($gui->tproject_id > 0 && $gui->tplan_id > 0) { + $showMenu['reports'] = true; + } + + return $showMenu; +} + +/** + */ +function setSystemWideActiveMenuOFF() +{ + $items = getFirstLevelMenuStructure(); + foreach ($items as $ky => $dm) { + $items[$ky] = ''; + } + return $items; +} + +/** + */ +function getFirstLevelMenuStructure() +{ + return array( + 'dashboard' => false, + 'system' => false, + 'projects' => false, + 'requirements_design' => false, + 'tests_design' => false, + 'plans' => false, + 'execution' => false, + 'reports' => false + ); +} + +/** + */ +function doTestPlanSetup(&$gui) +{ + $loop2do = count($gui->tplanSet); + if ($loop2do == 0) { + return $gui->tplan_id; + } + + $index = 0; + $found = 0; + for ($idx = 0; $idx < $loop2do; $idx ++) { + if ($gui->tplanSet[$idx]['id'] == $gui->tplan_id) { + $found = 1; + $index = $idx; + break; + } + } + + if ($found == 0) { + $index = 0; + $gui->tplan_id = $gui->tplanSet[$index]['id']; + } + + $gui->tplanSet[$index]['selected'] = 1; + + return $gui->tplan_id; +} + +/** + */ +function initContext() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $context = new stdClass(); + $env = ''; + $k2ctx = array( + 'tproject_id' => 0, + 'tplan_id' => 0, + 'form_token' => 0 + ); + foreach ($k2ctx as $prop => $defa) { + $context->$prop = isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : $defa; + if (is_numeric($defa)) { + $context->$prop = intval($context->$prop); + } + if ($env != '') { + $env .= "&"; + } + $env .= "$prop=" . $context->$prop; + } + + return array( + $context, + $env + ); +} + +/* + * rights check + */ +function pageAccessCheck(&$db, &$user, $context) +{ + $tplan_id = 0; + if (property_exists($context, 'tplan_id')) { + $tplan_id = $context->tplan_id; + } + + $checkAnd = true; + foreach ($context->rightsAnd as $ri) { + // $user->hasRight() needs refactoring to return ALWAYS boolean + // right now it seems will return + // false or null -> for FALSE + // 'yes' -> for TRUE !!! + $boolCheck = ($user->hasRight($db, $ri, $context->tproject_id, $tplan_id, + true) == 'yes'); + $checkAnd &= $boolCheck; + } + + $checkOr = true; + if ($checkAnd) { + $checkOr = false; + foreach ($context->rightsAnd as $ri) { + $checkOr = $user->hasRight($db, $ri, $context->tproject_id, + $tplan_id, true); + if ($checkOr) { + break; + } + } + } + + if (! $checkAnd && ! $checkOr) { + $script = basename($_SERVER['PHP_SELF']); + $action = 'Access Req Feature'; + $msg = TLS("audit_security_user_right_missing", $user->login, $script, + $action); + logAuditEvent($msg, $action, $user->dbID, "users"); + throw new Exception($msg, 1); + } +} + +/** + */ +function xssStringScriptSafe($content) +{ + $needle = []; + $needle[] = " OK , 0 -> KO - * aa['dbms_msg''] = 'ok', or $db->error_msg(). - */ -function doDBConnect(&$db,$onErrorExit=false) { - global $g_tlLogger; - - $charSet = config_get('charset'); - $result = array('status' => 1, 'dbms_msg' => 'ok'); - - switch(DB_TYPE) { - case 'mssql': - $dbDriverName = 'mssqlnative'; - break; - - default: - $dbDriverName = DB_TYPE; - break; - } - - $db = new database($dbDriverName); - $result = $db->connect(DSN, DB_HOST, DB_USER, DB_PASS, DB_NAME); - - if (!$result['status']) { - echo $result['dbms_msg']; - $result['status'] = 0; - $search = array('','','
    '); - $replace = array('',''," :: "); - $logtext = ' Connect to database ' . DB_NAME . ' on Host ' . DB_HOST . ' fails
    '; - $logtext .= 'DBMS Error Message: ' . $result['dbms_msg']; - - $logmsg = $logtext . ($onErrorExit ? '
    Redirection to connection fail screen.' : ''); - tLog(str_replace($search,$replace,$logmsg), 'ERROR'); - if( $onErrorExit ) { - $smarty = new TLSmarty(); - $smarty->assign('title', lang_get('fatal_page_title')); - $smarty->assign('content', $logtext); - $smarty->assign('link_to_op', null); - $smarty->display('workAreaSimple.tpl'); - exit(); - } - } - else { - if((DB_TYPE == 'mysql') && ($charSet == 'UTF-8')) { - $db->exec_query("SET CHARACTER SET utf8"); - $db->exec_query("SET collation_connection = 'utf8_general_ci'"); - } - } - - // if we establish a DB connection, we reopen the session, - // to attach the db connection - $g_tlLogger->endTransaction(); - $g_tlLogger->startTransaction(); - - return $result; -} - - -/** - * Set session data related to the current test plan - * and saves a cookie with current testplan id - * - * @param array $tplan_info result of DB query - */ -function setSessionTestPlan($tplan_info) { - if ($tplan_info) { - $_SESSION['testplanID'] = $tplan_info['id']; - $_SESSION['testplanName'] = $tplan_info['name']; - - // Save testplan id for next session - $ckObj = new stdClass(); - - $ckCfg = config_get('cookie'); - $ckObj->name = $ckCfg->prefix . 'TL_lastTestPlanForUserID_' . - intval($_SESSION['userID']); - $ckObj->value = $tplan_info['id']; - - tlSetCookie($ckObj); - - tLog("Test Plan was adjusted to '" . $tplan_info['name'] . "' ID(" . $tplan_info['id'] . ')', 'INFO'); - } - else { - unset($_SESSION['testplanID']); - unset($_SESSION['testplanName']); - } -} - - -/** - * Set home URL path - * @internal revisions - */ -function setPaths() -{ - if (!isset($_SESSION['basehref'])) - { - $_SESSION['basehref'] = get_home_url(array('force_https' => config_get('force_https'))); - } -} - - -/** - * Verify if user is log in. Redirect to login page if not. - * - * @param integer $db DB identifier - * @param boolean $redirect if true (default) redirects user to login page, otherwise returns true/false as login status - **/ -function checkSessionValid(&$db, $redirect=true) -{ - $isValidSession = false; - if (isset($_SESSION['userID']) && $_SESSION['userID'] > 0) { - $now = time(); - if (($now - $_SESSION['lastActivity']) <= (config_get("sessionInactivityTimeout") * 60)) { - $_SESSION['lastActivity'] = $now; - $user = new tlUser($_SESSION['userID']); - $user->readFromDB($db); - $_SESSION['currentUser'] = $user; - $isValidSession = true; - } - } - - if (!$isValidSession && $redirect) { - tLog('Invalid session from ' . $_SERVER["REMOTE_ADDR"] . '. Redirected to login page.', 'INFO'); - - $fName = "login.php"; - $baseDir = dirname($_SERVER['SCRIPT_FILENAME']); - - while(!file_exists($baseDir . DIRECTORY_SEPARATOR . $fName)) - { - $fName = "../" . $fName; - } - $destination = "&destination=" . urlencode($_SERVER['REQUEST_URI']); - redirect($fName . "?note=expired" . $destination,"top.location"); - exit(); - } - return $isValidSession; -} - - -/** - * Start session - */ -function doSessionStart($setPaths=false) { - - if( PHP_SESSION_NONE == session_status() ) { - session_set_cookie_params(99999); - } - - if(!isset($_SESSION)) { - session_start(); - if(defined('KINT_ON') && KINT_ON) { - Kint::enabled(true); - } else { - Kint::enabled(false); - } - } - - if($setPaths) { - unset($_SESSION['basehref']); - setPaths(); - } -} - - -/** - * Initialize structure of top menu for the user and the project. - * - * @param integer $db DB connection identifier - * @uses $_SESSION Requires initialized project, test plan and user data. - * @since 1.9 - * - * @internal revisions - */ -function initTopMenu(&$db) -{ - $_SESSION['testprojectTopMenu'] = ''; - $guiTopMenu = config_get('guiTopMenu'); - - $imageSet = TLSmarty::getImageSet(); - - // check if Project is available - if (isset($_SESSION['testprojectID']) && $_SESSION['testprojectID'] > 0) - { - $idx = 1; - foreach ($guiTopMenu as $element) - { - // check if Test Plan is available - $testPlanID = (isset($_SESSION['testplanID']) && $_SESSION['testplanID'] > 0) ? $_SESSION['testplanID'] : null; - if ((!isset($element['condition'])) || ($element['condition'] == '') || - (($element['condition'] == 'TestPlanAvailable') && - !is_null($testPlanID)) || - (($element['condition'] == 'ReqMgmtEnabled') && - isset($_SESSION['testprojectOptions']->requirementsEnabled) && - $_SESSION['testprojectOptions']->requirementsEnabled)) - { - // (is_null($element['right']) => no right needed => display always - - $addItem = is_null($element['right']); - if(!$addItem) - { - if( is_array($element['right'])) - { - foreach($element['right'] as $rg) - { - if( $addItem = (has_rights($db,$rg, $_SESSION['testprojectID'], $testPlanID) == "yes") ) - { - break; - } - } - } - else - { - $addItem = (has_rights($db,$element['right'], $_SESSION['testprojectID'], $testPlanID) == "yes"); - } - } - - if( $addItem ) - { - $_SESSION['testprojectTopMenu'] .= ""; - - if( isset($element['imgKey']) ) - { - $_SESSION['testprojectTopMenu'] .= ''; - } - else - { - $_SESSION['testprojectTopMenu'] .= - lang_get($element['label']); - } - - $_SESSION['testprojectTopMenu'] .= "   "; - } - } - } - $_SESSION['testprojectTopMenu'] .= "      "; - } -} - - -/** - * Update Project and Test Plan data on Project change or startup - * Data are stored in $_SESSION array - * - * If we receive TestPlan ID in the _SESSION then do some checks and if everything OK - * Update this value at Session Level, to set it available in other pieces of the application - * - * @param integer $db DB connection identifier - * @param array $hash_user_sel input data for the page ($_REQUEST) - * - * @uses initMenu() - * @internal revisions - **/ -function initProject(&$db,$hash_user_sel) { - - $ckObj = new stdClass(); - $ckCfg = config_get('cookie'); - - $tproject = new testproject($db); - $user_sel = array("tplan_id" => 0, "tproject_id" => 0 ); - $user_sel["tproject_id"] = isset($hash_user_sel['testproject']) ? intval($hash_user_sel['testproject']) : 0; - $user_sel["tplan_id"] = isset($hash_user_sel['testplan']) ? intval($hash_user_sel['testplan']) : 0; - - $tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - // test project is Test Plan container, then we start checking the container - if( $user_sel["tproject_id"] != 0 ) { - $tproject_id = $user_sel["tproject_id"]; - } - - // We need to do checks before updating the SESSION to cover the case that not defined but exists - if (!$tproject_id) { - $all_tprojects = $tproject->get_all(); - if ($all_tprojects) { - $tproject_data = $all_tprojects[0]; - $tproject_id = $tproject_data['id']; - } - } - $tproject->setSessionProject($tproject_id); - - // set a Test Plan - // Refresh test project id after call to setSessionProject - $tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : null; - - // Now we need to validate the TestPlan - $ckObj->name = $ckCfg->prefix . "TL_user{$_SESSION['userID']}_proj{$tproject_id}_testPlanId"; - - if($user_sel["tplan_id"] != 0) { - $ckObj->value = $user_sel["tplan_id"]; - $ckObj->expire = time()+60*60*24*90; - tlSetCookie($ckObj); - } - elseif (isset($_COOKIE[$ckObj->name])) { - $tplan_id = intval($_COOKIE[$ckObj->name]); - } - - // check if the specific combination of testprojectid and testplanid is valid - $tplan_data = $_SESSION['currentUser']->getAccessibleTestPlans($db,$tproject_id,$tplan_id); - if(is_null($tplan_data)) - { - // Need to get first accessible test plan for user, if any exists. - $tplan_data = $_SESSION['currentUser']->getAccessibleTestPlans($db,$tproject_id); - } - - if(!is_null($tplan_data) && is_array($tplan_data)) - { - $tplan_data = $tplan_data[0]; - setSessionTestPlan($tplan_data); - } - - // initialize structure of top menu for the user and the project - initTopMenu($db); -} - - -/** - * General GUI page initialization procedure - * - init session - * - init database - * - check rights - * - initialize project data (if requested) - * - * @param integer $db DB connection identifier - * @param boolean $initProject (optional) Set true if adjustment of Test Project or - * Test Plan is required; default is FALSE - * @param boolean $dontCheckSession (optional) Set to true if no session should be started - * @param string $userRightsCheckFunction (optional) name of function used to check user right needed - * to execute the page - */ -function testlinkInitPage(&$db, $initProject = FALSE, - $dontCheckSession = false, - $userRightsCheckFunction = null, - $onFailureGoToLogin = false) -{ - static $pageStatistics = null; - - doSessionStart(); - setPaths(); - if( isset($_SESSION['locale']) - && !is_null($_SESSION['locale']) ) { - setDateTimeFormats($_SESSION['locale']); - } - doDBConnect($db); - - if (!$pageStatistics && (config_get('log_level') == 'EXTENDED')) { - $pageStatistics = new tlPageStatistics($db); - } - - if (!$dontCheckSession) { - checkSessionValid($db); - } - - if ($userRightsCheckFunction !== null) { - checkUserRightsFor($db,$userRightsCheckFunction, - $onFailureGoToLogin); - } - - // Init plugins - plugin_init_installed(); - - // adjust Product and Test Plan to $_SESSION - if ($initProject) { - initProject($db,$_REQUEST); - } - - // used to disable the attachment feature if there are problems with repository path - /** @TODO this check should not be done anytime but on login and using */ - global $g_repositoryPath; - global $g_repositoryType; - global $tlCfg; - $tlCfg->attachments->disabled_msg = ""; - if($g_repositoryType == TL_REPOSITORY_TYPE_FS) { - $ret = checkForRepositoryDir($g_repositoryPath); - if(!$ret['status_ok']) { - $tlCfg->attachments->enabled = FALSE; - $tlCfg->attachments->disabled_msg = $ret['msg']; - } - } -} - - -/** - * Redirect page to another one - * - * @param string URL of required page - * @param string Browser location - use for redirection or refresh of another frame - * Default: 'location' - */ -function redirect($url, $level = 'location') -{ - // XSS Attack - 06486: Cross-Site Scripting on login page - $safeUrl = addslashes($url); - echo ""; - echo ""; - - exit; -} - - -/** - * Security parser for input strings - * - * @param string $parameter - * @return string cleaned parameter - */ -function strings_stripSlashes($parameter,$bGPC = true) -{ - if ($bGPC && !ini_get('magic_quotes_gpc')) - { - return $parameter; - } - - if (is_array($parameter)) - { - $retParameter = null; - if (sizeof($parameter)) - { - foreach($parameter as $key=>$value) - { - if (is_array($value)) - { - $retParameter[$key] = strings_stripSlashes($value,$bGPC); - } - else - { - $retParameter[$key] = stripslashes($value); - } - } - } - return $retParameter; - } - else - { - return stripslashes($parameter); - } -} - - -function to_boolean($alt_boolean) -{ - $the_val = 1; - - if (is_numeric($alt_boolean) && !intval($alt_boolean)) - { - $the_val = 0; - } - else - { - $a_bool = array ("on" => 1, "y" => 1, "off" => 0, "n" => 0); - $alt_boolean = strtolower($alt_boolean); - if(isset($a_bool[$alt_boolean])) - { - $the_val = $a_bool[$alt_boolean]; - } - } - - return $the_val; -} - - -/** - * Validate string by relular expression - * - * @param string $str2check - * @param string $regexp_forbidden_chars Regular expression (perl format) - * - * @return boolean 1: check ok, 0:check KO - * - * @todo havlatm: remove as obsolete or move to inputparam.inc.php - */ -function check_string($str2check, $regexp_forbidden_chars) -{ - $status_ok = 1; - - if( $regexp_forbidden_chars != '' && !is_null($regexp_forbidden_chars)) - { - if (preg_match($regexp_forbidden_chars, $str2check)) - { - $status_ok=0; - } - } - return $status_ok; -} - - -/** - * Load global configuration to function - * - * @param string $config_id key for identification of configuration parameter - * @return mixed the configuration parameter(s) - * - * @internal Revisions - */ -function config_get($config_id, $default=null) { - $t_value = (null == $default) ? '' : $default; - $t_found = false; - $logInfo = array('msg' => "config option not available: {$config_id}", 'level' => 'WARNING'); - if(!$t_found) { - $my = "g_" . $config_id; - if( ($t_found = isset($GLOBALS[$my])) ) - { - $t_value = $GLOBALS[$my]; - } - else - { - $cfg = $GLOBALS['tlCfg']; - if( ($t_found = property_exists($cfg,$config_id)) ) - { - $t_value = $cfg->$config_id; - } - } - - if( $t_found ) - { - $logInfo['msg'] = "config option: {$config_id} is " . - ((is_object($t_value) || is_array($t_value)) ? serialize($t_value) : $t_value); - $logInfo['level'] = 'INFO'; - } - } - - tLog($logInfo['msg'],$logInfo['level']); - return $t_value; -} - - -/** - * @return boolean Return true if the parameter is an empty string or a string - * containing only whitespace, false otherwise - * @author Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito - */ -function is_blank( $p_var ) -{ - $p_var = trim( $p_var ); - $str_len = strlen( $p_var ); - if ( 0 == $str_len ) { - return true; - } - return false; -} - - -/** - * Builds the header needed to make the content available for downloading - * - * @param string $content the content which should be downloaded - * @param string $fileName the filename - **/ -function downloadContentsToFile($content,$fileName,$opt=null) -{ - $my = array(); - $my['opt'] = array('Content-Type' => 'text/plain'); - $my['opt'] = array_merge($my['opt'], (array)$opt); - $charSet = config_get('charset'); - - ob_get_clean(); - header('Pragma: public' ); - header('Content-Type: ' . $my['opt']['Content-Type'] . "; charset={$charSet}; name={$fileName}" ); - header('Content-Transfer-Encoding: BASE64;' ); - header('Content-Disposition: attachment; filename="' . $fileName .'"'); - echo $content; -} - - -/** - * helper function for performance timing - * - * @TODO havlatm: Andreas, move to logger? - * returns: ? - */ -function microtime_float() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} - - -/** - * Converts a priority weight (urgency * importance) to HIGH, MEDUIM or LOW - * - * @return integer HIGH, MEDUIM or LOW - */ -function priority_to_level($priority) { - $urgencyImportance = config_get('urgencyImportance'); - - if ($priority >= $urgencyImportance->threshold['high']) { - return HIGH; - } else if ($priority < $urgencyImportance->threshold['low']) { - return LOW; - } else { - return MEDIUM; - } -} - - -/** - * Get the named php ini variable but return it as a bool - * - * @author Copyright (C) 2000 - 2004 Mantis Team, Kenzaburo Ito - */ -function ini_get_bool( $p_name ) { - $result = ini_get( $p_name ); - - if ( is_string( $result ) ) { - switch ( $result ) { - case 'off': - case 'false': - case 'no': - case 'none': - case '': - case '0': - return false; - break; - case 'on': - case 'true': - case 'yes': - case '1': - return true; - break; - } - } else { - return (bool)$result; - } -} - - -/** - * Trim string and limit to N chars - * - * @param string - * @param int [len]: how many chars return - * - * @return string trimmed string - * - * @author Francisco Mancardi - 20050905 - refactoring - */ -function trim_and_limit($s, $len = 100) -{ - $s = trim($s); - if (tlStringLen($s) > $len) { - $s = tlSubStr($s, 0, $len); - } - - return $s; -} - - -/** @todo havlatm - 20100207 - what's that? and why here. Remove' */ -// nodes_order format: NODE_ID-?,NODE_ID-? -// 2-0,10-0,3-0 -function transform_nodes_order($nodes_order,$node_to_exclude=null) -{ - $fa = explode(',',$nodes_order); - - foreach($fa as $key => $value) - { - // $value= X-Y - $fb = explode('-',$value); - - if( is_null($node_to_exclude) || $fb[0] != $node_to_exclude) - { - $nodes_id[]=$fb[0]; - } - } - - return $nodes_id; -} - - -/** - * Checks $_FILES for errors while uploading - * - * @param array $fInfo an array used by uploading files ($_FILES) - * @return string containing an error message (if any) - */ -function getFileUploadErrorMessage($fInfo,$tlInfo=null) -{ - $msg = null; - if (isset($fInfo['error'])) { - switch($fInfo['error']) { - case UPLOAD_ERR_INI_SIZE: - $msg = lang_get('error_file_size_larger_than_maximum_size_check_php_ini'); - break; - - case UPLOAD_ERR_FORM_SIZE: - $msg = lang_get('error_file_size_larger_than_maximum_size'); - break; - - case UPLOAD_ERR_PARTIAL: - case UPLOAD_ERR_NO_FILE: - $msg = lang_get('error_file_upload'); - break; - } - } - - if (null == $msg && null != $tlInfo && $tlInfo->statusOK == false) { - $msg = lang_get('FILE_UPLOAD_' . $tlInfo->statusCode); - if( property_exists($tlInfo,'msg') ) { - $msg = $tlInfo->msg; - } - } - return $msg; -} - - -/** - * Redirect to a page with static html defined in locale/en_GB/texts.php - * - * @param string $key keyword for finding exact html text in definition array - */ -function show_instructions($key, $refreshTree=0) -{ - $myURL = $_SESSION['basehref'] . "lib/general/staticPage.php?key={$key}"; - - if( $refreshTree ) - { - $myURL .= "&refreshTree=1"; - } - redirect($myURL); -} - - -/** - * @TODO: franciscom - 20091003 - document return value - */ -function templateConfiguration($template2get=null) -{ - $custom_templates = config_get('tpl'); - $access_key = $template2get; - if( is_null($access_key) ) - { - $access_key = str_replace('.php','',basename($_SERVER['SCRIPT_NAME'])); - } - - $path_parts=explode("/",dirname($_SERVER['SCRIPT_NAME'])); - $last_part=array_pop($path_parts); - $tcfg = new stdClass(); - $tcfg->template_dir = "{$last_part}/"; - $tcfg->default_template = isset($custom_templates[$access_key]) ? $custom_templates[$access_key] : ($access_key . '.tpl'); - $tcfg->template = null; - $tcfg->tpl = $tcfg->template_dir . $tcfg->default_template; - return $tcfg; -} - - -/** - * Check if an string is a valid ISO date/time - * accepted format: YYYY-MM-DD HH:MM:SS - * - * @param string $ISODateTime datetime to check - * @return boolean True if string has correct format - * - * @internal - * rev: 20080907 - franciscom - Code taked form PHP manual - */ -function isValidISODateTime($ISODateTime) -{ - $dateParts=array('YEAR' => 1, 'MONTH' => 2 , 'DAY' => 3); - - $matches=null; - $status_ok=false; - if (preg_match("/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/", $ISODateTime, $matches)) - { - $status_ok=checkdate($matches[$dateParts['MONTH']],$matches[$dateParts['DAY']],$matches[$dateParts['YEAR']]); - } - return $status_ok; -} - -/** - * Check if a localized timestamp is valid - * uses split_localized_date() - * - */ -function is_valid_date($timestamp, $dateFormat) { - $date_array = split_localized_date($timestamp,$dateFormat); - - $status_ok = false; - if ($date_array != null) { - $status_ok = checkdate($date_array['month'],$date_array['day'],$date_array['year']); - } - - return $status_ok; -} - -/** - * Returns array containing date pieces for a given timestamp according to dateFormat - */ - -function split_localized_date($timestamp,$dateFormat) -{ - if(strlen(trim($timestamp)) == 0) - { - return null; - } - - $splitChar = null; - $needle = array(".","-","/","%"); - foreach($needle as $target) - { - if (strpos($timestamp,$target) !== false) - { - $splitChar = $target; - break; - } - } - // put each char of strippedDateFormat into an Array Element - $strippedDateFormat = str_replace($needle,"",$dateFormat); - $format = preg_split('//', $strippedDateFormat, -1, PREG_SPLIT_NO_EMPTY); - $pieces = explode($splitChar,$timestamp); - $result = array(); - if( count($pieces) == 3 ) // MAGIC ALLOWED - { - $k2t = array('Y' => 'year', 'm' => 'month', 'd' => 'day'); - foreach ($format as $idx => $access) - { - $result[$k2t[$access]] = $pieces[$idx]; - } - } - return $result; -} - - -/** - * - * - */ -function checkUserRightsFor(&$db,$pfn,$onFailureGoToLogin=false) -{ - $script = basename($_SERVER['PHP_SELF']); - $currentUser = $_SESSION['currentUser']; - $doExit = false; - $action = null; - - $m2call = $pfn; - $arguments = null; - if( is_object($pfn) ) - { - $m2call = $pfn->method; - $arguments = $pfn->args; - } - - - if (!$m2call($db,$currentUser,$arguments,$action)) { - if (!$action) { - $action = "any"; - } - logAuditEvent(TLS("audit_security_user_right_missing",$currentUser->login,$script,$action), - $action,$currentUser->dbID,"users"); - $doExit = true; - } - - if($doExit) - { - $myURL = $_SESSION['basehref']; - if($onFailureGoToLogin) - { - unset($_SESSION['currentUser']); - redirect($myURL ."login.php"); - } - else - { - redirect($myURL,"top.location"); - } - exit(); - } -} - - -function tlStringLen($str) -{ - $charset = config_get('charset'); - $nLen = iconv_strlen($str,$charset); - if ($nLen === false) - { - throw new Exception("Invalid UTF-8 Data detected!"); - } - return $nLen; -} - - -function tlSubStr($str,$start,$length = null) -{ - $charset = config_get('charset'); - if ($length === null) - { - $length = iconv_strlen($str,$charset); - } - // BUGID 3951: replaced iconv_substr() by mb_substr() - $function_call = "mb_substr"; - if (function_exists('iconv_substr') && version_compare(PHP_VERSION, '5.2.0') >= 0) { - $function_call = "iconv_substr"; - } - return $function_call($str,$start,$length,$charset); -} - -/** - * Get text from a configured item template for editor objects - * - * @param $itemTemplate identifies a TestLink item that can have - * templates that can be loaded when creating an item to semplify - * or guide user's work. - * $itemTemplate is a property (of type stdClass) of $tlCfg configuration object. - * - * supported values: - * testcase_template - * - * @param $webEditorName webeditor name, that identifies a propety of $tlCfg->$itemTemplate - * that holds input tenmplate configuration - * - * @param $defaultText text to use if: - * $tlCfg->itemTemplate OR $tlCfg->itemTemplate->$webEditorName - * does not exists. - * - */ -function getItemTemplateContents($itemTemplate, $webEditorName, $defaultText='') { - $editorTemplate = config_get($itemTemplate); - $value=$defaultText; - if( !is_null($editorTemplate) ) { - if (property_exists($editorTemplate, $webEditorName)) { - switch($editorTemplate->$webEditorName->type) { - case 'string': - $value = $editorTemplate->$webEditorName->value; - break; - - case 'string_id': - $value = lang_get($editorTemplate->$webEditorName->value); - break; - - case 'file': - $value = getFileContents($editorTemplate->$webEditorName->value); - if (is_null($value)) { - $value = lang_get('problems_trying_to_access_template') . - " {$editorTemplate->$webEditorName->value} "; - } - break; - - case 'none': - default: - break; - } - } - } - return $value; -} - - -/** - * Builds a string $testCasePrefix . $glueChar . $external_id - * - * @param string $testCasePrefix prefix for the project without glue character - * @param mixed $external_id - */ -function buildExternalIdString($testCasePrefix, $external_id) -{ - static $glueChar; - if (!$glueChar) { - $glueChar = config_get('testcase_cfg')->glue_character; - } - return $testCasePrefix . $glueChar . $external_id; - -} - -/** - * - * - */ -function displayMemUsage($msg='') -{ - $dx = date('l jS \of F Y h:i:s A'); - echo "
    {$msg} :: {$dx}
    "; - ob_flush();flush(); - echo "memory:" . memory_get_usage() . " - PEAK -> " . memory_get_peak_usage() .'
    '; - ob_flush();flush(); -} - -/** - * - */ -function setUpEnvForRemoteAccess(&$dbHandler,$apikey,$rightsCheck=null,$opt=null) -{ - $my = array('opt' => array('setPaths' => false,'clearSession' => false)); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - if($my['opt']['clearSession']) - { - $_SESSION = null; - } - - doSessionStart($my['opt']['setPaths']); - if( isset($_SESSION['locale']) && !is_null($_SESSION['locale']) ) - { - setDateTimeFormats($_SESSION['locale']); - } - doDBConnect($dbHandler); - - $user = tlUser::getByAPIKey($dbHandler,$apikey); - if( count($user) == 1 ) { - $_SESSION['lastActivity'] = time(); - $userObj = new tlUser(key($user)); - $userObj->readFromDB($dbHandler); - $_SESSION['currentUser'] = $userObj; - $_SESSION['userID'] = $userObj->dbID; - $_SESSION['locale'] = $userObj->locale; - - // if user do this: - // 1. login to test link - // 2. get direct link and open in new tab or new window while still logged - // 3. logout - // If user refresh tab / window open on (2), because on (3) we destroyed - // session we have loose basehref, and we are not able to recreate it. - // Without basehref we are not able to get CSS, JS, etc. - // In this situation we destroy session, this way user is forced to login - // again in one of two ways - // a. using the direct link - // b. using traditional login - // In both way we assure that behaivour will be OK. - // - if (!isset($_SESSION['basehref'])) { - session_unset(); - session_destroy(); - if(property_exists($rightsCheck, 'redirect_target') - && !is_null($rightsCheck->redirect_target)) { - redirect($rightsCheck->redirect_target); - } else { - // best guess for all features that live on ./lib/results/ - redirect("../../login.php?note=logout"); - } - - exit(); - } - - - if(!is_null($rightsCheck)) { - checkUserRightsFor($dbHandler,$rightsCheck,true); - } - } -} - - - -/* - returns map with config values and strings translated (using lang_get()) - to be used on user interface for a Test link configuration option that - is structure in this way: - config_option = array( string_value => any_value, ...) - - All this works if TL_ strings defined on strings.txt follows this naming standard. - - For a config option like: - $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); - - - will exists: $TL_workflowStatus_draft='...'; - $TL_workflowStatus_review='...'; - - @param string configKey: valus used on call to standard test link - method to get configuration option - - @param string accessMode: two values allowed 'key', 'code' - indicates how the returned map must be indexed. - - 'key' => will be indexed by string - value that is key of config option - - 'code' => will be indexed by value of config option - - @example - - $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); - $i18nlabels = getLabels('workflowStatus','key'); - array_keys($i18nlabels) will return array('draft','review'); - - - $tlCfg->workflowStatus=array('draft' => 1, 'review' => 2); - $i18nlabels = getLabels('workflowStatus','code'); - array_keys($i18nlabels) will return array(1,2); - - @internal revisions - @since 1.9.7 -*/ - -function getConfigAndLabels($configKey,$accessMode='key') -{ - $stringKeyCode = config_get($configKey); - $labels=null; - foreach( $stringKeyCode as $accessKey => $code ) - { - $index = ($accessMode == 'key') ? $accessKey : $code; - $labels[$index] = lang_get($configKey . '_' . $accessKey); - } - return array('cfg' => $stringKeyCode, 'lbl' => $labels); -} - - -function setDateTimeFormats($locale) -{ - global $tlCfg; - - if($tlCfg->locales_date_format[$locale]) - { - $tlCfg->date_format = $tlCfg->locales_date_format[$locale]; - } - - if($tlCfg->locales_timestamp_format[$locale]) - { - $tlCfg->timestamp_format = $tlCfg->locales_timestamp_format[$locale]; - } -} - -/** - * windowCloseAndOpenerReload() - * will close a popup window and reload caller contents. - */ -function windowCloseAndOpenerReload() -{ - echo ""; - echo ""; - exit; -} - - -/** - * - */ -function setUpEnvForAnonymousAccess(&$dbHandler,$apikey,$rightsCheck=null,$opt=null) -{ - $my = array('opt' => array('setPaths' => false,'clearSession' => false)); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - if($my['opt']['clearSession']) - { - $_SESSION = null; - } - - doSessionStart($my['opt']['setPaths']); - if( isset($_SESSION['locale']) && !is_null($_SESSION['locale']) ) - { - setDateTimeFormats($_SESSION['locale']); - } - doDBConnect($dbHandler); - - // @since 1.9.14 - $checkMode = 'paranoic'; - if(property_exists($rightsCheck->args, 'envCheckMode')) - { - $checkMode = $rightsCheck->args->envCheckMode; - } - - switch($checkMode) - { - case 'hippie': - $tk = array('testplan','testproject'); - break; - - default: - $tk[] = (intval($rightsCheck->args->tplan_id) != 0) ? 'testplan' : 'testproject'; - break; - } - - foreach($tk as $ak) - { - $item = getEntityByAPIKey($dbHandler,$apikey,$ak); - if(!is_null($item)) - { - break; - } - } - - $status_ok = false; - if (!is_null($item)) { - $_SESSION['lastActivity'] = time(); - $userObj = new tlUser(); - $_SESSION['currentUser'] = $userObj; - $_SESSION['userID'] = -1; - $_SESSION['locale'] = config_get('default_language'); - - // if user do this: - // 1. login to test link - // 2. get direct link and open in new tab or new window while still logged - // 3. logout - // If user refresh tab / window open on (2), because on (3) we destroyed - // session we have loose basehref, and we are not able to recreate it. - // Without basehref we are not able to get CSS, JS, etc. - // In this situation we destroy session, this way user is forced to login - // again in one of two ways - // a. using the direct link - // b. using traditional login - // In both way we assure that behaivour will be OK. - // - if(!isset($_SESSION['basehref'])) - { - // echo $rightsCheck->redirect_target; - session_unset(); - session_destroy(); - if(property_exists($rightsCheck, 'redirect_target') && !is_null($rightsCheck->redirect_target)) - { - redirect($rightsCheck->redirect_target); - } - else - { - // best guess for all features that live on ./lib/results/ - redirect("../../login.php?note=logout"); - } - exit(); - } - - if(!is_null($rightsCheck->method)) - { - checkUserRightsFor($dbHandler,$rightsCheck->method,true); - } - $status_ok = true; - } - - return $status_ok; -} - -/** - * - */ -function getEntityByAPIKey(&$dbHandler,$apiKey,$type) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $tables = tlObjectWithDB::getDBTables(array('testprojects','testplans')); - switch ($type) - { - case 'testproject': - $target = $tables['testprojects']; - break; - - case 'testplan': - $target = $tables['testplans']; - break; - - default: - throw new Exception("Aborting - Bad type", 1); - break; - } - - $sql = "/* $debugMsg */ " . - " SELECT id FROM {$target} " . - " WHERE api_key = '" . - $dbHandler->prepare_string($apiKey) . "'"; - - $rs = $dbHandler->get_recordset($sql); - return ($rs ? $rs[0] : null); -} - -/** - * - * - */ -function checkAccess(&$dbHandler,&$userObj,$context,$rightsToCheck) -{ - // name of caller script - $script = basename($_SERVER['PHP_SELF']); - $doExit = false; - $action = 'any'; - $env = array('tproject_id' => 0, 'tplan_id' => 0); - $env = array_merge($env, $context); - foreach($env as $key => $val) - { - $env[$key] = intval($val); - } - - if( $doExit = (is_null($env) || $env['tproject_id'] == 0) ) - { - logAuditEvent(TLS("audit_security_no_environment",$script), $action,$userObj->dbID,"users"); - } - - if( !$doExit ) { - foreach($rightsToCheck->items as $verboseRight) { - $status = $userObj->hasRight($dbHandler,$verboseRight, - $env['tproject_id'],$env['tplan_id'],true); - if( ($doExit = !$status) && ($rightsToCheck->mode == 'and')) - { - $action = 'any'; - logAuditEvent(TLS("audit_security_user_right_missing",$userObj->login,$script,$action), - $action,$userObj->dbID,"users"); - break; - } - } - } - - if ($doExit) - { - redirect($_SESSION['basehref'],"top.location"); - exit(); - } -} - -/* - function: getWebEditorCfg - - args:- - - returns: - -*/ -function getWebEditorCfg($feature='all') -{ - $cfg = config_get('gui'); - $defaultCfg = $cfg->text_editor['all']; - $webEditorCfg = isset($cfg->text_editor[$feature]) ? $cfg->text_editor[$feature] : $defaultCfg; - - foreach($defaultCfg as $key => $value) - { - if(!isset($webEditorCfg[$key])) - { - $webEditorCfg[$key] = $defaultCfg[$key]; - } - } - return $webEditorCfg; -} - -/** - * - */ -function downloadXls($fname,$xlsType,$gui,$filePrefix) -{ - $sets = array(); - $sets['Excel2007'] = array('ext' => '.xlsx', - 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); - $sets['Excel5'] = array('ext' => '.xls', - 'Content-Type' => 'application/vnd.ms-excel'); - - - $dct = array('Content-Type' => $sets[$xlsType]['Content-Type']); - $content = file_get_contents($fname); - $f2d = $filePrefix . $gui->tproject_name . '_' . $gui->tplan_name . - $sets[$xlsType]['ext']; - - downloadContentsToFile($content,$f2d,$dct); - unlink($fname); - exit(); -} - -/** - * POC on papertrailapp.com - */ -function syslogOnCloud($message, $component = "web", $program = "TestLink") -{ - $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); - foreach(explode("\n", $message) as $line) - { - $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . - $component . ': ' . $line; - socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, - 'logs5.papertrailapp.com', 11613); - } - socket_close($sock); -} - -/** - * - */ -function getSSODisable() -{ - return isset($_REQUEST['ssodisable']) ? 1 : 0; -} - -/** - * - */ -function tlSetCookie($ckObj) { - $stdCk = config_get('cookie'); - - foreach($ckObj as $prop => $value) { - $stdCk->$prop = $value; - } - - setcookie($stdCk->name, $stdCk->value, $stdCk->expire,$stdCk->path, - $stdCk->domain,$stdCk->secure,$stdCk->httponly); -} - - -/** - * - * $opt: skip map each element can be a map - * tplanForInit - * tplanToGetEffectiveRole - */ -function initUserEnv(&$dbH, $context, $opt=null) { - $args = new stdClass(); - $gui = new stdClass(); - - $optDeep = array('skip' => array('tplanForInit' => false, - 'tplanToGetEffectiveRole' => false)); - $options = array('forceCreateProj' => false, - 'initNavBarMenu' => false, - 'caller' => 'not provided'); - if (null != $opt) { - if( isset($opt['skip']) ) { - $optDeep['skip'] = array_merge($optDeep['skip'],$opt['skip']); - } - - foreach ($options as $key => $defa) { - if (isset($opt[$key])) { - $options[$key] = $opt[$key]; - } - } - } - - $args->user = $_SESSION['currentUser']; - $k2l = array( 'tproject_id' => 0, - 'current_tproject_id' => 0, - 'tplan_id' => 0); - - foreach($k2l as $pp => $vv) { - $args->$pp = $vv; - if( isset($_REQUEST[$pp]) ) { - $args->$pp = intval($_REQUEST[$pp]); - } else if (null != $context && property_exists($context, $pp)) { - $args->$pp = intval($context->$pp); - } - } - $tprjMgr = new testproject($dbH); - $guiCfg = config_get("gui"); - $opx = array('output' => 'map_name_with_inactive_mark', - 'field_set' => $guiCfg->tprojects_combo_format, - 'order_by' => $guiCfg->tprojects_combo_order_by); - - $gui->prjSet = $tprjMgr->get_accessible_for_user($args->user->dbID, $opx); - $gui->prjQtyWholeSystem = $tprjMgr->getItemCount(); - $gui->zeroTestProjects = ($gui->prjQtyWholeSystem == 0); - $args->zeroTestProjects = $gui->zeroTestProjects; - - $args->userIsBlindFolded = - (is_null($gui->prjSet) || count($gui->prjSet) == 0) - && $gui->prjQtyWholeSystem > 0; - if( $args->userIsBlindFolded ) { - $args->current_tproject_id = 0; - $args->tproject_id = 0; - $args->tplan_id = 0; - } - - - // It's ok to get testproject context if - // we have the testplan id? - // Can this be a potential security issue? - // Can this create a non coherent situation on GUI? - if( $args->tproject_id == 0 ) { - $args->tproject_id = key($gui->prjSet); - } - - if( $args->current_tproject_id == 0 ) { - $args->current_tproject_id = $args->tproject_id; - } - - $gui->caller = isset($_REQUEST['caller']) ? trim($_REQUEST['caller']) : ''; - $gui->tproject_id = intval($args->tproject_id); - $gui->current_tproject_id = intval($args->current_tproject_id); - $gui->tplan_id = intval($args->tplan_id); - - if( $gui->tproject_id > 0 ) { - // Force to avoid lot of processing - $gui->hasTestCases = $gui->hasKeywords = true; - - $gui->num_active_tplans = $tprjMgr->getActiveTestPlansCount($args->tproject_id); - - // get Test Plans available for the user - // $gpOpt = array('output' => 'map'); - $gpOpt = null; - $gui->tplanSet = (array)$args->user->getAccessibleTestPlans($dbH,$args->tproject_id,$gpOpt); - $gui->countPlans = count($gui->tplanSet); - - /* 20191212 - will remove because have created issues - with IVU, and I not sure anymore of usefulness - if (false == $optDeep['skip']['tplanForInit'] || $args->tplan_id <= 0) { - $gui->tplan_id = $args->tplan_id = (int)doTestPlanSetup($gui); - } - */ - if ($args->tplan_id <= 0) { - $gui->tplan_id = $args->tplan_id = (int)doTestPlanSetup($gui); - } - } - - $doInitUX = ($args->tproject_id > 0) || $options['forceCreateProj']; - $gui->grants = null; - $gui->access = null; - $gui->showMenu = null; - $gui->activeMenu = setSystemWideActiveMenuOFF(); - - /* - if ($options['caller'] != 'not provided') { - echo '
    1509 - caller => ' . $options['caller'] . '
    '; - } - */ - - if( $doInitUX ) { - // echo 'doInitUX
    '; - $gui->grants = getGrantSetWithExit($dbH,$args,$tprjMgr,$options); - $gui->access = getAccess($gui); - $gui->showMenu = getMenuVisibility($gui); - - /* - if ($options['caller'] != 'not provided') { - echo '
    1509 - caller => ' . $options['caller'] . '
    '; - } - */ - } - - // Get Role Description to display. - // This means get Effective Role that has to be calculated - // using current test project & current test plan - // - // SKIP is useful if you want to consider role only - // at test project level. - // - $tplan_id = $gui->tplan_id; - if( $optDeep['skip']['tplanToGetEffectiveRole'] ) { - $tplan_id = null; - } - - $eRoleObj = $args->user->getEffectiveRole($dbH,$gui->tproject_id,$tplan_id); - - $cfg = config_get('gui'); - $gui->whoami = $args->user->getDisplayName() . ' ' . - $cfg->role_separator_open . - $eRoleObj->getDisplayName() . - $cfg->role_separator_close; - - $gui->launcher = $_SESSION['basehref'] . - 'lib/general/frmWorkArea.php'; - - $gui->docs = config_get('userDocOnDesktop') ? getUserDocumentation() : null; - - $secCfg = config_get('config_check_warning_frequence'); - $gui->securityNotes = ''; - if( (strcmp($secCfg, 'ALWAYS') == 0) || - (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && !isset($_SESSION['getSecurityNotesOnMainPageDone'])) ) { - $_SESSION['getSecurityNotesOnMainPageDone'] = 1; - $gui->securityNotes = getSecurityNotes($dbH); - } - - $gui->tprojOpt = $tprjMgr->getOptions($args->tproject_id); - $gui->opt_requirements = - isset($gui->tprojOpt->requirementsEnabled) ? - $gui->tprojOpt->requirementsEnabled : null; - - getActions($gui,$_SESSION['basehref']); - - if( $gui->current_tproject_id == null || - trim($gui->current_tproject_id) == '' ) { - } - - $gui->logo = $_SESSION['basehref'] . TL_THEME_IMG_DIR . - config_get('logo_navbar'); - - - $ft = 'form_token'; - $gui->$ft = isset($args->$ft) ? $args->$ft : 0; - if ($gui->$ft == 0 && isset($_REQUEST[$ft])) { - $gui->$ft = $_REQUEST[$ft]; - } - $gui->treeFormToken = $gui->form_token; - - return array($args,$gui,$tprjMgr); -} - -/** - * - * Actions for left side menu - * - */ -function getActions(&$gui,$baseURL) { - $bb = "{$baseURL}lib"; - - $tproject_id = 0; - if( property_exists($gui,'tproject_id')) { - $tproject_id = intval($gui->tproject_id); - } - $ctx = "tproject_id={$tproject_id}"; - - $tplan_id = 0; - if( property_exists($gui,'tplan_id')) { - $tplan_id = intval($gui->tplan_id); - } - $ctx .= "&tplan_id={$tplan_id}"; - - $actions = new stdClass(); - - $actions->events = "$bb/events/eventviewer.php?{$ctx}"; - $actions->usersAssign = "$bb/usermanagement/usersAssign.php?{$ctx}&featureType=testproject&featureID=" . intval($gui->tproject_id); - - $actions->userMgmt = "$bb/usermanagement/usersView.php?{$ctx}" . - intval($gui->tproject_id); - - $actions->userInfo = "$bb/usermanagement/userInfo.php?{$ctx}"; - $actions->projectView = "$bb/project/projectView.php?{$ctx}"; - - $actions->cfAssignment = "$bb/cfields/cfieldsTprojectAssign.php?{$ctx}"; - $actions->cfieldsView = "$bb/cfields/cfieldsView.php?{$ctx}"; - - $actions->keywordsView = "$bb/keywords/keywordsView.php?{$ctx}"; - $actions->platformsView = "$bb/platforms/platformsView.php?{$ctx}"; - $actions->issueTrackerView = "$bb/issuetrackers/issueTrackerView.php?{$ctx}"; - $actions->codeTrackerView = "$bb/codetrackers/codeTrackerView.php?{$ctx}"; - $actions->reqOverView = "$bb/requirements/reqOverview.php?{$ctx}"; - $actions->reqMonOverView = "$bb/requirements/reqMonitorOverview.php?{$ctx}"; - $actions->tcSearch = "$bb/testcases/tcSearch.php?doAction=userInput&{$ctx}"; - $actions->tcCreatedUser = "$bb/results/tcCreatedPerUserOnTestProject.php?do_action=uinput&{$ctx}"; - $actions->assignReq = "$bb/general/frmWorkArea.php?feature=assignReqs&{$ctx}"; - $actions->inventoryView = "$bb/inventory/inventoryView.php?{$ctx}"; - - $actions->fullTextSearch = "$bb/search/searchMgmt.php?{$ctx}"; - - $actions->metrics_dashboard = - "$bb/results/metricsDashboard.php?{$ctx}"; - - - $pp = $bb . '/plan'; - $actions->planView = "$pp/planView.php?{$ctx}"; - - $actions->buildView = null; - $actions->mileView = null; - $actions->platformAssign = null; - $actions->milestonesView = null; - $actions->testcase_assignments = null; - if ($tplan_id >0) { - $actions->buildView = "$pp/buildView.php?{$ctx}"; - $actions->mileView = "$pp/planMilestonesView.php?{$ctx}"; - $actions->platformAssign = "$bb/platforms/platformsAssign.php?{$ctx}"; - $actions->milestonesView = "$bb/plan/planMilestonesView.php?{$ctx}"; - $actions->testcase_assignments = - "$bb/testcases/tcAssignedToUser.php?{$ctx}"; - } - - $launcher = $_SESSION['basehref'] . - "lib/general/frmWorkArea.php?feature="; - - $gui->workArea = new stdClass(); - $gui->workArea->testSpec = "editTc&{$ctx}"; - $gui->workArea->keywordsAssign = "keywordsAssign&{$ctx}"; - - $gui->workArea->planAddTC = null; - $gui->workArea->executeTest = null; - $gui->workArea->setTestUrgency = null; - $gui->workArea->planUpdateTC = null; - $gui->workArea->showNewestTCV = null; - $gui->workArea->assignTCVExecution = null; - $gui->workArea->showMetrics = null; - - if ($tplan_id >0) { - $gui->workArea->planAddTC = "planAddTC&{$ctx}"; - $gui->workArea->executeTest = "executeTest&{$ctx}"; - $gui->workArea->setTestUrgency = "test_urgency&{$ctx}"; - $gui->workArea->planUpdateTC = "planUpdateTC&{$ctx}"; - $gui->workArea->showNewestTCV = "newest_tcversions&{$ctx}"; - $gui->workArea->assignTCVExecution = "tc_exec_assignment&{$ctx}"; - $gui->workArea->showMetrics = "showMetrics&{$ctx}"; - } - - $gui->workArea->reqSpecMgmt = "reqSpecMgmt&{$ctx}"; - $gui->workArea->printReqSpec = "printReqSpec&{$ctx}"; - $gui->workArea->searchReq = "searchReq&{$ctx}"; - $gui->workArea->searchReqSpec = "searchReqSpec&{$ctx}"; - - $wprop = get_object_vars($gui->workArea); - foreach ($wprop as $wp => $wv) { - if (null != $gui->workArea->$wp) { - $gui->workArea->$wp = $launcher . $gui->workArea->$wp; - } - $actions->$wp = $gui->workArea->$wp; - } - - $gui->uri = $actions; - $p2l = get_object_vars($actions); - foreach( $p2l as $pp => $val) { - $gui->$pp = $actions->$pp; - } -} - - -/** - * - */ -function getGrantSetWithExit(&$dbHandler,&$argsObj,&$tprojMgr,$opt=null) { - - /** redirect admin to create testproject if not found */ - $options = array('forceCreateProj' => true); - $options = array_merge($options,(array)$opt); - - if ($options['forceCreateProj'] && $argsObj->zeroTestProjects) { - if ($argsObj->user->hasRight($dbHandler,'mgt_modify_product')) { - redirect($_SESSION['basehref'] . - 'lib/project/projectEdit.php?doAction=create'); - exit(); - } - } - - // User has test project rights - // This talks about Default/Global - // - // key: more or less verbose - // value: string present on rights table - - $systemWideRights = - array( - 'project_edit' => 'mgt_modify_product', - 'configuration' => "system_configuraton", - 'usergroups' => "mgt_view_usergroups", - 'event_viewer' => "events_mgt", - 'user_mgmt' => "mgt_users" - ); - - $r2cTranslate = - array( - 'reqs_view' => "mgt_view_req", - 'monitor_req' => "monitor_requirement", - 'reqs_edit' => "mgt_modify_req", - 'keywords_view' => "mgt_view_key", - 'keywords_edit' => "mgt_modify_key", - 'view_tc' => "mgt_view_tc", - 'view_testcase_spec' => "mgt_view_tc", - 'modify_tc' => 'mgt_modify_tc', - 'testplan_create' => 'mgt_testplan_create'); - - $r2cSame = array ( - 'req_tcase_link_management','keyword_assignment', - 'issuetracker_management','issuetracker_view', - 'codetracker_management','codetracker_view', - 'platform_management','platform_view', - 'cfield_management', - 'cfield_view','cfield_assignment', - 'project_inventory_view','project_inventory_management', - 'testplan_unlink_executed_testcases', - 'testproject_delete_executed_testcases', - 'mgt_testplan_create', - 'testplan_execute','testplan_create_build', - 'testplan_metrics','testplan_planning', - 'testplan_user_role_assignment', - 'testplan_add_remove_platforms', - 'testplan_update_linked_testcase_versions', - 'testplan_set_urgent_testcases', - 'testplan_show_testcases_newest_versions', - 'testplan_milestone_overview', - 'exec_edit_notes','exec_delete','exec_ro_access', - 'exec_testcases_assigned_to_me','exec_assign_testcases'); - - if( ($forceToNo = $argsObj->userIsBlindFolded) ) { - $tr = array_merge($systemWideRights, $r2cTranslate); - $grants = array_fill_keys(array_keys($tr), 'no'); - - foreach($r2cSame as $rr) { - $grants[$rr] = 'no'; - } - return (object)$grants; - } - - // Go ahead, continue with the analysis - // First get system wide rights - foreach ($systemWideRights as $humankey => $right) { - $grants[$humankey] = $argsObj->user->hasRight($dbHandler,$right); - } - - foreach ($r2cTranslate as $humankey => $right) { - $grants[$humankey] = - $argsObj->user->hasRight($dbHandler,$right,$argsObj->tproject_id,$argsObj->tplan_id); - } - - - foreach ($r2cSame as $right) { - $grants[$right] = - $argsObj->user->hasRight($dbHandler,$right,$argsObj->tproject_id,$argsObj->tplan_id); - } - - - // check right ONLY if option is enabled - $tprojOpt = $tprojMgr->getOptions($argsObj->tproject_id); - if($tprojOpt->inventoryEnabled) { - $invr = array('project_inventory_view','project_inventory_management'); - foreach($invr as $r){ - $grants[$r] = - ($argsObj->user->hasRight($dbHandler,$r) == 'yes') ? 1 : 0; - } - } - - $grants['tproject_user_role_assignment'] = "no"; - if( $argsObj->user->hasRight($dbH,"testproject_user_role_assignment", - $argsObj->tproject_id,-1) == "yes" || - $argsObj->user->hasRight($db,"user_role_assignment",null,-1) == "yes" ) { - $grants['tproject_user_role_assignment'] = "yes"; - } - return (object)$grants; -} - -/** - * - */ -function getAccess(&$gui) { - $k2l = array('codetracker','issuetracker','platform'); - foreach($k2l as $ak) { - $access[$ak] = 'no'; - $p_m = $ak . '_management'; - $p_v = $ak . '_view'; - if( 'yes' == $gui->grants->$p_m || - 'yes' == $gui->grants->$p_v ) { - $access[$ak] = 'yes'; - } - } - return $access; -} - - -/** - * - * - */ -function getMenuVisibility(&$gui) -{ - $showMenu = getFirstLevelMenuStructure(); - - if($gui->tproject_id > 0 && - ( $gui->grants->view_tc == "yes" - || $gui->grants->reqs_view == "yes" - || $gui->grants->reqs_edit == "yes") ) { - $showMenu['search'] = true; - } - - if($gui->tproject_id > 0 && - ($gui->grants->cfield_assignment == "yes" || - $gui->grants->cfield_management == "yes" || - $gui->grants->issuetracker_management == "yes" || - $gui->grants->codetracker_management == "yes" || - $gui->grants->issuetracker_view == "yes" || - $gui->grants->codetracker_view == "yes") ) { - $showMenu['system'] = true; - } - - if($gui->tproject_id > 0 && - ($gui->grants->project_edit == "yes" || - $gui->grants->tproject_user_role_assignment == "yes" || - $gui->grants->cfield_management == "yes" || - $gui->grants->platform_management == "yes" || - $gui->grants->keywords_view == "yes") ) { - $showMenu['projects'] = true; - } - - if ( $gui->tproject_id > 0 && - //$gui->opt_requirements == true && TO REACTIVATE - ($gui->grants->reqs_view == "yes" || - $gui->grants->reqs_edit == "yes" || - $gui->grants->monitor_req == "yes" || - $gui->grants->req_tcase_link_management == "yes") ) { - $showMenu['requirements_design'] = true; - } - - if($gui->tproject_id > 0 && - ($gui->grants->view_tc == "yes") ) { - $showMenu['tests_design'] = true; - } - - if($gui->tproject_id > 0 && - ($gui->grants->testplan_planning == "yes" || - $gui->grants->mgt_testplan_create == "yes" || - $gui->grants->testplan_user_role_assignment == "yes" || - $gui->grants->testplan_create_build == "yes") ) { - $showMenu['plans'] = true; - } - - if ($gui->tproject_id > 0 - && $gui->tplan_id > 0 - && ($gui->grants->testplan_execute == "yes" || - $gui->grants->exec_ro_access == "yes") ) { - $showMenu['execution'] = true; - } - - if($gui->tproject_id > 0 && $gui->tplan_id > 0) { - $showMenu['reports'] = true; - } - - return $showMenu; -} - -/** - * - */ -function setSystemWideActiveMenuOFF() -{ - $items = getFirstLevelMenuStructure(); - foreach( $items as $ky => $dm) { - $items[$ky] = ''; - } - return $items; -} - -/** - * - */ -function getFirstLevelMenuStructure() -{ - return array('dashboard' => false, - 'system'=> false, - 'projects' => false, - 'requirements_design' => false, - 'tests_design' => false, - 'plans' => false, - 'execution' => false, - 'reports' => false, - ); -} - - -/** - * - * - */ -function doTestPlanSetup(&$gui) { - $loop2do = count($gui->tplanSet); - if( $loop2do == 0 ) { - return $gui->tplan_id; - } - - $index = 0; - $found = 0; - for($idx = 0; $idx < $loop2do; $idx++) { - if( $gui->tplanSet[$idx]['id'] == $gui->tplan_id ) { - $found = 1; - $index = $idx; - break; - } - } - - if( $found == 0 ) { - $index = 0; - $gui->tplan_id = $gui->tplanSet[$index]['id']; - } - - $gui->tplanSet[$index]['selected']=1; - - return $gui->tplan_id; -} - -/** - * - */ -function initContext() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $context = new stdClass(); - $env = ''; - $k2ctx = array('tproject_id' => 0, - 'tplan_id' => 0, - 'form_token' => 0); - foreach ($k2ctx as $prop => $defa) { - $context->$prop = isset($_REQUEST[$prop]) ? $_REQUEST[$prop] : $defa; - if( is_numeric($defa) ) { - $context->$prop = intval($context->$prop); - } - if ($env != '') { - $env .= "&"; - } - $env .= "$prop=" . $context->$prop; - } - - return array($context,$env); -} - - - -/* - * rights check - */ -function pageAccessCheck(&$db, &$user, $context) -{ - $tplan_id = 0; - if (property_exists($context,'tplan_id')) { - $tplan_id = $context->tplan_id; - } - - - $checkAnd = true; - foreach ($context->rightsAnd as $ri) { - // $user->hasRight() needs refactoring to return ALWAYS boolean - // right now it seems will return - // false or null -> for FALSE - // 'yes' -> for TRUE !!! - $boolCheck = ($user->hasRight($db,$ri,$context->tproject_id,$tplan_id,true) == 'yes'); - $checkAnd &= $boolCheck; - } - - $checkOr = true; - if ($checkAnd) { - $checkOr = false; - foreach ($context->rightsAnd as $ri) { - $checkOr = $user->hasRight($db,$ri, - $context->tproject_id, - $tplan_id,true); - if ($checkOr) { - break; - } - } - } - - if ($checkAnd == false && $checkOr == false) { - $script = basename($_SERVER['PHP_SELF']); - $action = 'Access Req Feature'; - $msg = TLS("audit_security_user_right_missing", - $user->login,$script,$action); - logAuditEvent($msg, $action,$user->dbID,"users"); - throw new Exception($msg, 1); - } -} - -/** - * - */ -function XSS_StringScriptSafe($content) -{ - $needle = []; - $needle[] = "'; + exit(); + } +} + +/** + * checks if installation is done + * + * @return bool returns true if the installation was already executed, false else + * @author Martin Havlat + */ +function checkInstallStatus() +{ + return defined('DB_TYPE') ? true : false; +} + +/** + * Checks if charts are supported (GD and PNG library) + * + * @return string resulted message ('OK' means pass) + * @author Martin Havlat + */ +function checkLibGd() +{ + if (extension_loaded('gd')) { + $arrLibConf = gd_info(); + $msg = lang_get("error_gd_png_support_disabled"); + if ($arrLibConf["PNG Support"]) { + $msg = 'OK'; + } + } else { + $msg = lang_get("error_gd_missing"); + } + return $msg; +} + +/** + * Checks if needed functions and extensions are defined + * + * @param + * array [ref] msgs will be appended + * @return bool returns true if all extension or functions ar present or defined + * + */ +function checkForExtensions(&$msg) +{ + // without this pChart do not work + if (! extension_loaded('gd')) { + $msg[] = lang_get("error_gd_missing"); + } + return true; +} + +/** + * checks if the install dir is present + * + * @return bool returns true if the install dir is present, false else + */ +function checkForInstallDir() +{ + $installerDir = TL_ABS_PATH . DIRECTORY_SEPARATOR . "install" . + DIRECTORY_SEPARATOR; + clearstatcache(); + return (is_dir($installerDir)) ? true : false; +} + +/** + * checks if the default password for the admin accout is still set + * + * @return boolean returns true if the default password for the admin account is set, + * false else + */ +function checkForAdminDefaultPwd(&$db) +{ + $passwordHasDefaultValue = false; + + $user = new tlUser(); + $user->login = "admin"; + if ($user->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) >= tl::OK && + $user->comparePassword($db, "admin") >= tl::OK) { + $passwordHasDefaultValue = true; + } + return $passwordHasDefaultValue; +} + +/* + * function: checkForLDAPExtension + */ +function checkForLDAPExtension() +{ + return extension_loaded("ldap"); +} + +/** + * builds the security notes while checking some security issues + * these notes should be displayed! + * + * @return array returns the security issues, or null if none found! + * + */ +function getSecurityNotes(&$db) +{ + $repository['type'] = config_get('repositoryType'); + $repository['path'] = config_get('repositoryPath'); + + $securityNotes = null; + if (checkForInstallDir()) { + $securityNotes[] = lang_get("sec_note_remove_install_dir"); + } + + $authCfg = config_get('authentication'); + if ('LDAP' == $authCfg['method']) { + if (! checkForLDAPExtension()) { + $securityNotes[] = lang_get("ldap_extension_not_loaded"); + } + } else { + if (checkForAdminDefaultPwd($db)) { + $securityNotes[] = lang_get("sec_note_admin_default_pwd"); + } + } + + if (! checkForBTSConnection()) { + $securityNotes[] = lang_get("bts_connection_problems"); + } + + if ($repository['type'] == TL_REPOSITORY_TYPE_FS) { + $ret = checkForRepositoryDir($repository['path']); + if (! $ret['status_ok']) { + $securityNotes[] = $ret['msg']; + } + } + + // Needed when schemas change has been done. + // This call can be removed when release is stable + $res = checkSchemaVersion($db); + $msg = $res['msg']; + + if ($msg != "") { + $securityNotes[] = $msg; + } + + $msg = checkEmailConfig(); + if (! is_null($msg)) { + foreach ($msg as $detail) { + $securityNotes[] = $detail; + } + } + checkForExtensions($securityNotes); + + if (! is_null($securityNotes)) { + $user_feedback = config_get('config_check_warning_mode'); + + switch ($user_feedback) { + case 'SCREEN': + break; + + case 'FILE': + case 'SILENT': + $warnings = ''; + $filename = config_get('log_path') . 'config_check.txt'; + if (@$handle = fopen($filename, 'w')) { + $warnings = implode("\n", $securityNotes); + @fwrite($handle, $warnings); + @fclose($handle); + } + $securityNotes = null; + if ($user_feedback == 'FILE') { + $securityNotes[] = sprintf( + lang_get('config_check_warnings'), $filename); + } + break; + } + } + return $securityNotes; +} + +/** + * checks if the connection to the Bug Tracking System database is working + * + * @return boolean returns true if ok + * false else + * @author franciscom + */ +function checkForBTSConnection() +{ + global $g_bugInterface; + $status_ok = true; + if ($g_bugInterface && ! $g_bugInterface->connect()) { + $status_ok = false; + } + return $status_ok; +} + +/** + * Check if server OS is microsoft Windows flavour + * + * @return boolean TRUE if microsoft + * @author havlatm + */ +function isMSWindowsServer() +{ + $osID = strtoupper(substr(PHP_OS, 0, 3)); + return (strcmp('WIN', $osID) == 0) ? true : false; +} + +/* + * function: checkForRepositoryDir + */ +function checkForRepositoryDir($the_dir) +{ + clearstatcache(); + + $ret['msg'] = lang_get('attachments_dir') . " " . $the_dir . " "; + $ret['status_ok'] = false; + + if (is_dir($the_dir)) { + $ret['msg'] .= lang_get('exists') . ' '; + $ret['status_ok'] = (is_writable($the_dir)) ? true : false; + + if ($ret['status_ok']) { + $ret['msg'] .= lang_get('directory_is_writable'); + } else { + $ret['msg'] .= lang_get('but_directory_is_not_writable'); + } + } else { + $ret['msg'] .= lang_get('does_not_exist'); + } + + return $ret; +} + +/** + * Check if DB schema is valid + * + * @param database $db + * Database class + * @return string message + * @todo Update list of versions + */ +function checkSchemaVersion(&$db) +{ + $result = array( + 'status' => tl::ERROR, + 'msg' => null, + 'kill_session' => true + ); + $latest_version = TL_LATEST_DB_VERSION; + $db_version_table = DB_TABLE_PREFIX . 'db_version'; + + $sql = "SELECT * FROM {$db_version_table} ORDER BY upgrade_ts DESC"; + $res = $db->exec_query($sql, 1); + if (! $res) { + return $result['msg'] = "Failed to get Schema version from DB"; + } + + $myrow = $db->fetch_array($res); + + $upgrade_msg = "You need to upgrade your Testlink Database to {$latest_version} -
    " . + 'click here access install and upgrade page
    '; + + $manualop_msg = "You need to proceed with Manual upgrade of your DB scheme to {$latest_version} - Read README file!"; + + switch (trim($myrow['version'])) { + + case '1.7.0 Alpha': + case '1.7.0 Beta 1': + case '1.7.0 Beta 2': + case '1.7.0 Beta 3': + case '1.7.0 Beta 4': + case '1.7.0 Beta 5': + case '1.7.0 RC 2': + case '1.7.0 RC 3': + case 'DB 1.1': + case 'DB 1.2': + $result['msg'] = $upgrade_msg; + break; + + case 'DB 1.3': + case 'DB 1.4': + case 'DB 1.5': + case 'DB 1.6': + case 'DB 1.9.8': + case 'DB 1.9.10': + case 'DB 1.9.11': + case 'DB 1.9.12': + case 'DB 1.9.13': + case 'DB 1.9.14': + case 'DB 1.9.15': + case 'DB 1.9.16': + case 'DB 1.9.17': + case 'DB 1.9.18': + case 'DB 1.9.19': + $result['msg'] = $manualop_msg; + break; + + case 'DB 1.9.20': + // check critic DB schema change because + // blocks login + $m = $db->db->metaColumns(DB_TABLE_PREFIX . 'users'); + if ($m['PASSWORD']->max_length == 32) { + $result['msg'] = "It seems that you have migrated to 1.9.20" . + "
    But migration does not changed users table structure" . + "
    the password field is not able to contain " . + " a bcrypt password"; + $result['status'] = tl::ERROR; + } else { + $result['status'] = tl::OK; + $result['kill_session'] = 'false'; + } + break; + + case $latest_version: + $result['status'] = tl::OK; + $result['kill_session'] = 'false'; + break; + + default: + $result['msg'] = "Unknown Schema version " . trim($myrow['version']) . + ", please upgrade your Testlink Database to " . $latest_version; + break; + } + + /* + * It will be better for debug if this message will be written to a log file + * if($result['status'] != tl::OK) + * { + * + * } + */ + return $result; +} + +/* + * function: checkEmailConfig + * args : + * returns: + */ +function checkEmailConfig() +{ + $common[] = lang_get('check_email_config'); + $msg = null; + $idx = 1; + $key2get = array( + 'tl_admin_email', + 'from_email', + 'return_path_email', + 'smtp_host' + ); + + foreach ($key2get as $cfg_key) { + $cfg_param = config_get($cfg_key); + if (trim($cfg_param) == "" || strpos($cfg_param, 'not_configured') > 0) { + $msg[$idx ++] = $cfg_key; + } + } + return is_null($msg) ? null : $common + $msg; +} + +/** + * checking register global = OFF (doesn't cause error') + * + * @param + * integer &$errCounter reference to error counter + * @return string html table row + */ +function check_php_settings(&$errCounter) +{ + $max_execution_time_recommended = 120; + $max_execution_time = ini_get('max_execution_time'); + $memory_limit_recommended = 64; + $memory_limit = intval(str_ireplace('M', '', ini_get('memory_limit'))); + + $final_msg = 'Checking max. execution time (Parameter max_execution_time)'; + if ($max_execution_time < $max_execution_time_recommended) { + $final_msg .= "{$max_execution_time} seconds - " . + "We suggest {$max_execution_time_recommended} " . + "seconds in order to manage hundred of test cases (edit php.ini)"; + } else { + $final_msg .= 'OK (' . $max_execution_time . + ' seconds)'; + } + $final_msg .= "Checking maximal allowed memory (Parameter memory_limit)"; + if ($memory_limit < $memory_limit_recommended) { + $final_msg .= "$memory_limit MegaBytes - " . + "We suggest {$memory_limit_recommended} MB" . + " in order to manage hundred of test cases"; + } else { + $final_msg .= 'OK (' . $memory_limit . + ' MegaBytes)'; + } + $final_msg .= "Checking if Register Globals is disabled"; + if (ini_get('register_globals')) { + $final_msg .= "Failed! is enabled - " . + "Please change the setting in your php.ini file"; + } else { + $final_msg .= "OK\n"; + } + return $final_msg; +} + +/** + * Check availability of PHP extensions + * + * @param + * integer &$errCounter pointer to error counter + * @return string html table rows + * @author Martin Havlat + * @todo martin: Do we require "Checking DOM XML support"? It seems that we use internal library. + * if (function_exists('domxml_open_file')) + */ +function checkPhpExtensions(&$errCounter) +{ + $td_ok = "OK\n"; + $td_failed = 'Failed! %s %s.'; + + $msg_support = 'Checking %s '; + $checks = array(); + + // Database extensions + $checks[] = array( + 'extension' => 'pgsql', + 'msg' => array( + 'feedback' => 'Postgres Database', + 'ok' => $td_ok, + 'ko' => 'cannot be used' + ) + ); + + $mysqlExt = 'mysql'; + if (version_compare(phpversion(), "7.4.2", ">=")) { + $mysqlExt = 'mysqli'; + } + $checks[] = array( + 'extension' => $mysqlExt, + 'msg' => array( + 'feedback' => 'MySQL Database', + 'ok' => $td_ok, + 'ko' => 'cannot be used' + ) + ); + + // ---------------------------------------------------------------------------- + // special check for MSSQL + $isPHPGTE7 = version_compare(phpversion(), "7.0.0", ">="); + + $extid = 'mssql'; + if (PHP_OS == 'WINNT' || $isPHPGTE7) { + // Faced this problem when testing XAMPP 1.7.7 on Windows 7 with MSSQL 2008 Express + // From PHP MANUAL - reganding mssql_* functions + // These functions allow you to access MS SQL Server database. + // This extension is not available anymore on Windows with PHP 5.3 or later. + // SQLSRV, an alternative driver for MS SQL is available from Microsoft: + // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. + // + // Second Time: (2018) + // When using PHP 7 or up + // Help from Bitnami + // PHP 7 does not support mssql anymore. + // The PECL extension recommended is to use the "sqlsrv" module + // but you will need to compile it on your own. + // + // + // PHP_VERSION_ID is available as of PHP 5.2.7 + if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300) { + $extid = 'sqlsrv'; + } + + if ($isPHPGTE7) { + $extid = 'sqlsrv'; + } + } + $checks[] = array( + 'extension' => $extid, + 'msg' => array( + 'feedback' => 'MSSQL Database', + 'ok' => $td_ok, + 'ko' => 'cannot be used' + ) + ); + // --------------------------------------------------------------------------------------------------------- + + $checks[] = array( + 'extension' => 'gd', + 'msg' => array( + 'feedback' => 'GD Graphic library', + 'ok' => $td_ok, + 'ko' => " not enabled.
    Graph rendering requires it. This feature will be disabled." . + " It's recommended to install it." + ) + ); + + $checks[] = array( + 'extension' => 'ldap', + 'msg' => array( + 'feedback' => 'LDAP library', + 'ok' => $td_ok, + 'ko' => " not enabled. LDAP authentication cannot be used. " . + "(default internal authentication will works)" + ) + ); + + $checks[] = array( + 'extension' => 'json', + 'msg' => array( + 'feedback' => 'JSON library', + 'ok' => $td_ok, + 'ko' => " not enabled. You MUST install it to use EXT-JS tree component. " + ) + ); + + $checks[] = array( + 'extension' => 'curl', + 'msg' => array( + 'feedback' => 'cURL library', + 'ok' => $td_ok, + 'ko' => " not enabled. You MUST install it to use REST Integration with issue trackers. " + ) + ); + + $out = ''; + foreach ($checks as $test) { + $out .= sprintf($msg_support, $test['msg']['feedback']); + if (extension_loaded($test['extension'])) { + $msg = $test['msg']['ok']; + } else { + $msg = sprintf($td_failed, $test['msg']['feedback'], + $test['msg']['ko']); + } + $out .= $msg; + } + + return $out; +} + +/** + * Check if web server support session data + * + * @param + * integer &$errCounter reference to error counter + * @return string html row with result + */ +function check_session(&$errCounter) +{ + $out = "Checking if sessions are properly configured"; + + if (! isset($_SESSION)) { + session_start(); + } + + if ($_SESSION['session_test'] != 1) { + $color = 'success'; + $msg = 'OK'; + } else { + $color = 'error'; + $msg = 'Failed!'; + $errCounter ++; + } + + $out .= "$msg\n"; + return $out; +} + +// function end + +/** + * check PHP defined timeout + * + * @param + * integer &$errCounter reference to error counter + * @return string html row with result + */ +function check_timeout(&$errCounter) +{ + $out = 'Maximum Session Idle Time before Timeout'; + + $timeout = ini_get("session.gc_maxlifetime"); + $gc_maxlifetime_min = floor($timeout / 60); + $gc_maxlifetime_sec = $timeout % 60; + + if ($gc_maxlifetime_min > 30) { + $color = 'success'; + $res = 'OK'; + } elseif ($gc_maxlifetime_min > 10) { + $color = 'warning'; + $res = 'Short. Consider to extend.'; + } else { + $color = 'error'; + $res = 'Too short. It must be extended!'; + $errCounter ++; + } + $out .= "" . $gc_maxlifetime_min . + " minutes and $gc_maxlifetime_sec seconds - ($res)\n"; + + return $out; +} + +/** + * check Database type + * + * @param + * integer &$errCounter reference to error counter + * @param string $type + * valid PHP database type label + * + * @return string html row with result + */ +function checkDbType(&$errCounter, $type) +{ + $out = 'Database type'; + + switch ($type) { + case 'mysql': + case 'mysqli': + case 'mssql': + case 'postgres': + $out .= '' . $type . + ''; + break; + + default: + $out .= 'Unsupported type: ' . $type . + '. MySQL,Postgres and MSSQL are supported DB types. Of course' . + ' you can use also other ones without migration support.'; + break; + } + + return $out; +} + +/** + * Display Operating System + * + * @return string html table row + */ +function checkServerOs() +{ + $final_msg = 'Server Operating System (no constrains)'; + $final_msg .= '' . PHP_OS . ''; + + return $final_msg; +} + +/** + * check minimal required PHP version + * + * @param + * integer &$errCounter pointer to error counter + * @return string html row with result + */ +function checkPhpVersion(&$errCounter) +{ + $min_version = '7.4.2'; + $my_version = phpversion(); + + // version_compare: + // -1 if left is less, 0 if equal, +1 if left is higher + $php_ver_comp = version_compare($my_version, $min_version); + + $final_msg = 'PHP version'; + + if ($php_ver_comp < 0) { + $final_msg .= "Failed! - You are running on PHP " . + $my_version . ", and TestLink requires PHP " . $min_version . + ' or greater. ' . 'This is fatal problem. You must upgrade it.'; + $errCounter += 1; + } else { + $final_msg .= "OK ( {$min_version} [minimum version] "; + $final_msg .= ($php_ver_comp == 0 ? " = " : " <= "); + $final_msg .= $my_version . " [your version] "; + $final_msg .= " ) "; + } + + return $final_msg; +} + +/** + * verify that files are writable/readable + * OK result is for state: + * a) installation - writable + * b) installed - readable + * + * @param + * integer &$errCounter pointer to error counter + * @return string html row with result + * @author Martin Havlat + */ +function check_file_permissions(&$errCounter, $inst_type, $checked_filename, + $isCritical = false) +{ + $checked_path = realpath( + dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . + '..'); + $checked_file = $checked_path . DIRECTORY_SEPARATOR . $checked_filename; + $out = 'Access to file (' . $checked_file . ')'; + + if ($inst_type == 'new') { + if (file_exists($checked_file)) { + if (is_writable($checked_file)) { + $out .= "OK (writable)\n"; + } else { + if ($isCritical) { + $out .= "Failed! Please fix the file " . + $checked_file . + " permissions and reload the page."; + $errCounter += 1; + } else { + $out .= "Not writable! Please fix the file " . + $checked_file . " permissions."; + } + } + } else { + if (is_writable($checked_path)) { + $out .= "OK\n"; + } else { + if ($isCritical) { + $out .= "Directory is not writable! Please fix " . + $checked_path . + " permissions and reload the page."; + $errCounter += 1; + } else { + $out .= "Directory is not writable! Please fix " . + $checked_path . " permissions."; + } + } + } + } else { + if (file_exists($checked_file)) { + if (! is_writable($checked_file)) { + $out .= "OK (read only)\n"; + } else { + $out .= "It's recommended to have read only permission for security reason."; + } + } else { + if ($isCritical) { + $out .= "Failed! The file is not on place."; + $errCounter += 1; + } else { + $out .= "The file is not on place."; + } + } + } + + return $out; +} + +/** + * Check read/write permissions for directories + * based on check_with_feedback($dirs_to_check); + * + * @param + * integer &$errCounter pointer to error counter + * @return string html row with result + * @author Martin Havlat + */ +function check_dir_permissions(&$errCounter) +{ + $dirs_to_check = [ + 'templates_c' => [ + 'config' => 'temp_dir', + 'needsLock' => '' + ], + 'logs' => [ + 'config' => 'log_path', + 'needsLock' => '[S] ' + ], + 'upload_area' => [ + 'config' => 'repositoryPath', + 'needsLock' => '[S] ' + ] + ]; + + $final_msg = ''; + $msg_ko = "Failed!"; + $msg_ok = "OK"; + + $final_msg .= "For security reasons we suggest that directories tagged with [S]" . + " on following messages, will be made UNREACHEABLE from browser.
    " . + "Give a look to README file, section 'Installation & SECURITY' " . + " to understand how to change the defaults."; + + $os = strtolower(PHP_OS); + if ($os == 'linux') { + $final_msg .= '
    Give a look to SELINUX section in README.md'; + } + $final_msg .= ""; + + foreach ($dirs_to_check as $the_d => $settings) { + + $the_d = config_get($settings['config']); + $needsLock = $settings['needsLock']; + + $final_msg .= "Checking if {$the_d} directory exists {$needsLock}"; + if (! file_exists($the_d)) { + $errCounter += 1; + $final_msg .= $msg_ko; + } else { + $final_msg .= $msg_ok; + $final_msg .= "Checking if {$the_d} directory is writable (by user used to run webserver process) "; + if (! is_writable($the_d)) { + $errCounter += 1; + $final_msg .= $msg_ko; + } else { + $final_msg .= $msg_ok; + } + } + } + + return $final_msg; +} + +/** + * Print table with checking www browser support + * + * @param + * integer &$errCounter pointer to error counter + * @author Martin Havlat + */ +function reportCheckingBrowser(&$errCounter) +{ + $browser = strtolower($_SERVER['HTTP_USER_AGENT']); + + echo "\n" . + '

    Browser compliance

    ' . + "\n"; + + echo '

    ' . $browser . '

    '; + echo ''; + + if (strpos($browser, 'firefox') === false || + strpos($browser, 'msie') === false) { + echo ""; + } else { + echo ""; + } + + echo ''; + + echo '
    Browser supportedOK
    Unsupported: {$_SERVER['HTTP_USER_AGENT']}
    Javascript availability' . + '' . + '' . + '
    '; +} + +/** + * print table with system checking results + * + * @param + * integer &$errCounter reference to error counter + * @author Martin Havlat + */ +function reportCheckingSystem(&$errCounter) +{ + echo '

    System requirements

    '; + echo checkServerOs(); + echo checkPhpVersion($errCounter); + echo '
    '; +} + +/** + * print table with database checking + * + * @param + * integer &$errCounter reference to error counter + * @author Martin Havlat + */ +function reportCheckingDatabase(&$errCounter, $type = null) +{ + if (checkInstallStatus()) { + $type = DB_TYPE; + } + + if (! is_null($type)) { + echo '

    Database checking

    '; + echo checkDbType($errCounter, $type); + echo "
    \n"; + } +} + +/** + * print table with system checking results + * + * @param + * integer &$errCounter reference to error counter + * @author Martin Havlat + */ +function reportCheckingWeb(&$errCounter) +{ + echo '

    Web and PHP configuration

    '; + echo check_timeout($errCounter); + echo check_php_settings($errCounter); + echo checkPhpExtensions($errCounter); + echo '
    '; +} + +/** + * print table with system checking results + * + * @param + * integer &$errCounter pointer to error counter + * @param + * string installationType: useful when this function is used on installer + * + * @author Martin Havlat + */ +function reportCheckingPermissions(&$errCounter, $installationType = 'none') +{ + echo '

    Read/write permissions

    '; + echo check_dir_permissions($errCounter); + + // for $installationType='upgrade' existence of config_db.inc.php is not needed + $blockingCheck = $installationType == 'upgrade' ? false : true; + if ($installationType == 'new') { + echo check_file_permissions($errCounter, $installationType, + 'config_db.inc.php', $blockingCheck); + } + echo '
    '; } - - -/** check language acceptance by web client */ -function checkServerLanguageSettings($defaultLanguage) { - $language = $defaultLanguage; - - // check for !== false because getenv() returns false on error - $serverLanguage = getenv($_SERVER['HTTP_ACCEPT_LANGUAGE']); - if(false !== $serverLanguage) { - $localeSet = config_get('locales'); - if (array_key_exists($serverLanguage,$localeSet)) - { - $language = $serverLanguage; - } - } - - return $language; -} - - -/** Check if we need to run the install program. Used on login.php and index.php */ -function checkConfiguration() -{ - clearstatcache(); - $file_to_check = "config_db.inc.php"; - if(!is_file($file_to_check)) { - echo ''; - exit(); - } -} - - -/** - * checks if installation is done - * - * @return bool returns true if the installation was already executed, false else - * @author Martin Havlat - **/ -function checkInstallStatus() -{ - $status=defined('DB_TYPE') ? true : false; - return $status; -} - - -/** - * Checks if charts are supported (GD and PNG library) - * - * @return string resulted message ('OK' means pass) - * @author Martin Havlat - **/ -function checkLibGd() -{ - if( extension_loaded('gd') ) { - $arrLibConf = gd_info(); - $msg = lang_get("error_gd_png_support_disabled"); - if ($arrLibConf["PNG Support"]) { - $msg = 'OK'; - } - } else { - $msg = lang_get("error_gd_missing"); - } - return $msg; -} - - -/** - * Checks if needed functions and extensions are defined - * - * @param array [ref] msgs will be appended - * @return bool returns true if all extension or functions ar present or defined - * - **/ -function checkForExtensions(&$msg) -{ - // without this pChart do not work - if( !extension_loaded('gd') ) - { - $msg[] = lang_get("error_gd_missing"); - } - return true; -} - -/** - * checks if the install dir is present - * - * @return bool returns true if the install dir is present, false else - **/ -function checkForInstallDir() -{ - $installerDir = TL_ABS_PATH. DIRECTORY_SEPARATOR . "install" . DIRECTORY_SEPARATOR; - clearstatcache(); - $dirExists= (is_dir($installerDir)) ? true : false; - return $dirExists; -} - - -/** - * checks if the default password for the admin accout is still set - * - * @return boolean returns true if the default password for the admin account is set, - * false else - **/ -function checkForAdminDefaultPwd(&$db) -{ - $passwordHasDefaultValue = false; - - $user = new tlUser(); - $user->login = "admin"; - if ($user->readFromDB($db,tlUser::USER_O_SEARCH_BYLOGIN) >= tl::OK && - $user->comparePassword($db,"admin") >= tl::OK) { - $passwordHasDefaultValue = true; - } - return $passwordHasDefaultValue; -} - -/* - function: checkForLDAPExtension -*/ -function checkForLDAPExtension() -{ - return extension_loaded("ldap"); -} - -/** - * builds the security notes while checking some security issues - * these notes should be displayed! - * - * @return array returns the security issues, or null if none found! - * - **/ -function getSecurityNotes(&$db) -{ - $repository['type'] = config_get('repositoryType'); - $repository['path'] = config_get('repositoryPath'); - - $securityNotes = null; - if (checkForInstallDir()) { - $securityNotes[] = lang_get("sec_note_remove_install_dir"); - } - - $authCfg = config_get('authentication'); - if( 'LDAP' == $authCfg['method'] ) { - if( !checkForLDAPExtension() ) { - $securityNotes[] = lang_get("ldap_extension_not_loaded"); - } - } else { - if( checkForAdminDefaultPwd($db) ) { - $securityNotes[] = lang_get("sec_note_admin_default_pwd"); - } - } - - - if (!checkForBTSConnection()) { - $securityNotes[] = lang_get("bts_connection_problems"); - } - - if($repository['type'] == TL_REPOSITORY_TYPE_FS) { - $ret = checkForRepositoryDir($repository['path']); - if(!$ret['status_ok']) { - $securityNotes[] = $ret['msg']; - } - } - - // Needed when schemas change has been done. - // This call can be removed when release is stable - $res = checkSchemaVersion($db); - $msg = $res['msg']; - - if($msg != "") { - $securityNotes[] = $msg; - } - - $msg = checkEmailConfig(); - if(!is_null($msg)) { - foreach($msg as $detail) - { - $securityNotes[] = $detail; - } - } - checkForExtensions($securityNotes); - - if(!is_null($securityNotes)) - { - $user_feedback=config_get('config_check_warning_mode'); - - switch($user_feedback) - { - case 'SCREEN': - break; - - case 'FILE': - case 'SILENT': - $warnings=''; - $filename = config_get('log_path') . 'config_check.txt'; - if (@$handle = fopen($filename, 'w')) - { - $warnings=implode("\n",$securityNotes); - @fwrite($handle, $warnings); - @fclose($handle); - } - $securityNotes=null; - if($user_feedback=='FILE') - { - $securityNotes[] = sprintf(lang_get('config_check_warnings'),$filename); - } - break; - } - } - return $securityNotes; -} - - -/** - * checks if the connection to the Bug Tracking System database is working - * - * @return boolean returns true if ok - * false else - * @author franciscom - **/ -function checkForBTSConnection() -{ - - global $g_bugInterface; - $status_ok = true; - if($g_bugInterface && !$g_bugInterface->connect()) - { - $status_ok = false; - } - return $status_ok; -} - -/** - * Check if server OS is microsoft Windows flavour - * - * @return boolean TRUE if microsoft - * @author havlatm - */ -function isMSWindowsServer() -{ - $osID = strtoupper(substr(PHP_OS, 0, 3)); - $isWindows = (strcmp('WIN',$osID) == 0) ? true: false; - return $isWindows; -} - -/* - function: checkForRepositoryDir -*/ -function checkForRepositoryDir($the_dir) -{ - clearstatcache(); - - $ret['msg']=lang_get('attachments_dir') . " " . $the_dir . " "; - $ret['status_ok']=false; - - if(is_dir($the_dir)) { - $ret['msg'] .= lang_get('exists') . ' '; - $ret['status_ok'] = true; - $ret['status_ok'] = (is_writable($the_dir)) ? true : false; - - if($ret['status_ok']) { - $ret['msg'] .= lang_get('directory_is_writable'); - } else { - $ret['msg'] .= lang_get('but_directory_is_not_writable'); - } - } else { - $ret['msg'] .= lang_get('does_not_exist'); - } - - return $ret; -} - - -/** - * Check if DB schema is valid - * - * @param pointer $db Database class - * @return string message - * @todo Update list of versions - */ -function checkSchemaVersion(&$db) -{ - $result = array('status' => tl::ERROR, 'msg' => null, 'kill_session' => true); - $latest_version = TL_LATEST_DB_VERSION; - $db_version_table = DB_TABLE_PREFIX . 'db_version'; - - $sql = "SELECT * FROM {$db_version_table} ORDER BY upgrade_ts DESC"; - $res = $db->exec_query($sql,1); - if (!$res) { - return $result['msg'] = "Failed to get Schema version from DB"; - } - - $myrow = $db->fetch_array($res); - - $upgrade_msg = "You need to upgrade your Testlink Database to {$latest_version} -
    " . - 'click here access install and upgrade page
    '; - - $manualop_msg = "You need to proceed with Manual upgrade of your DB scheme to {$latest_version} - Read README file!"; - - switch (trim($myrow['version'])) { - - case '1.7.0 Alpha': - case '1.7.0 Beta 1': - case '1.7.0 Beta 2': - case '1.7.0 Beta 3': - case '1.7.0 Beta 4': - case '1.7.0 Beta 5': - case '1.7.0 RC 2': - case '1.7.0 RC 3': - case 'DB 1.1': - case 'DB 1.2': - $result['msg'] = $upgrade_msg; - break; - - case 'DB 1.3': - case 'DB 1.4': - case 'DB 1.5': - case 'DB 1.6': - case 'DB 1.9.8': - case 'DB 1.9.10': - case 'DB 1.9.11': - case 'DB 1.9.12': - case 'DB 1.9.13': - case 'DB 1.9.14': - case 'DB 1.9.15': - case 'DB 1.9.16': - case 'DB 1.9.17': - case 'DB 1.9.18': - case 'DB 1.9.19': - $result['msg'] = $manualop_msg; - break; - - case 'DB 1.9.20': - // check critic DB schema change because - // blocks login - $m = $db->db->metaColumns(DB_TABLE_PREFIX . 'users'); - if ($m['PASSWORD']->max_length == 32) { - $result['msg'] = - "It seems that you have migrated to 1.9.20" . - "
    But migration does not changed users table structure" . - "
    the password field is not able to contain " . - " a bcrypt password"; - $result['status'] = tl::ERROR; - } else { - $result['status'] = tl::OK; - $result['kill_session'] = 'false'; - } - break; - - case $latest_version: - $result['status'] = tl::OK; - $result['kill_session'] = 'false'; - break; - - default: - $result['msg'] = "Unknown Schema version " . trim($myrow['version']) . - ", please upgrade your Testlink Database to " . $latest_version; - break; - } - - /* It will be better for debug if this message will be written to a log file - if($result['status'] != tl::OK) - { - - } - */ - return $result; -} - -/* - function: checkEmailConfig - args : - returns: -*/ -function checkEmailConfig() -{ - $common[] = lang_get('check_email_config'); - $msg = null; - $idx = 1; - $key2get = array('tl_admin_email','from_email','return_path_email','smtp_host'); - - foreach($key2get as $cfg_key) - { - $cfg_param = config_get($cfg_key); - if(trim($cfg_param) == "" || strpos($cfg_param,'not_configured') > 0 ) - { - $msg[$idx++] = $cfg_key; - } - } - return is_null($msg) ? null : $common+$msg; -} - -/** - * checking register global = OFF (doesn't cause error') - * @param integer &$errCounter reference to error counter - * @return string html table row - */ -function check_php_settings(&$errCounter) -{ - $max_execution_time_recommended = 120; - $max_execution_time = ini_get('max_execution_time'); - $memory_limit_recommended = 64; - $memory_limit = intval(str_ireplace('M','',ini_get('memory_limit'))); - - $final_msg = 'Checking max. execution time (Parameter max_execution_time)'; - if($max_execution_time < $max_execution_time_recommended) - { - $final_msg .= "{$max_execution_time} seconds - " . - "We suggest {$max_execution_time_recommended} " . - "seconds in order to manage hundred of test cases (edit php.ini)"; - } - else - { - $final_msg .= 'OK ('.$max_execution_time.' seconds)'; - } - $final_msg .= "Checking maximal allowed memory (Parameter memory_limit)"; - if($memory_limit < $memory_limit_recommended) - { - $final_msg .= "$memory_limit MegaBytes - " . - "We suggest {$memory_limit_recommended} MB" . - " in order to manage hundred of test cases"; - } - else - { - $final_msg .= 'OK ('.$memory_limit.' MegaBytes)'; - } - $final_msg .= "Checking if Register Globals is disabled"; - if(ini_get('register_globals')) - { - $final_msg .= "Failed! is enabled - " . - "Please change the setting in your php.ini file"; - } - else - { - $final_msg .= "OK\n"; - } - return ($final_msg); -} - - -/** - * Check availability of PHP extensions - * - * @param integer &$errCounter pointer to error counter - * @return string html table rows - * @author Martin Havlat - * @todo martin: Do we require "Checking DOM XML support"? It seems that we use internal library. - * if (function_exists('domxml_open_file')) - */ -function checkPhpExtensions(&$errCounter) { - - $cannot_use='cannot be used'; - $td_ok = "OK\n"; - $td_failed = 'Failed! %s %s.'; - - $msg_support='Checking %s '; - $checks=array(); - - // Database extensions - $checks[]=array('extension' => 'pgsql', - 'msg' => array('feedback' => 'Postgres Database', 'ok' => $td_ok, 'ko' => 'cannot be used') ); - - $mysqlExt = 'mysql'; - if( version_compare(phpversion(), "7.4.2", ">=") ) { - $mysqlExt = 'mysqli'; - } - $checks[]=array('extension' => $mysqlExt, - 'msg' => array('feedback' => 'MySQL Database', 'ok' => $td_ok, 'ko' => 'cannot be used') ); - - // ---------------------------------------------------------------------------- - // special check for MSSQL - $isPHPGTE7 = version_compare(phpversion(), "7.0.0", ">="); - - $extid = 'mssql'; - if(PHP_OS == 'WINNT' || $isPHPGTE7 ) { - // Faced this problem when testing XAMPP 1.7.7 on Windows 7 with MSSQL 2008 Express - // From PHP MANUAL - reganding mssql_* functions - // These functions allow you to access MS SQL Server database. - // This extension is not available anymore on Windows with PHP 5.3 or later. - // SQLSRV, an alternative driver for MS SQL is available from Microsoft: - // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. - // - // Second Time: (2018) - // When using PHP 7 or up - // Help from Bitnami - // PHP 7 does not support mssql anymore. - // The PECL extension recommended is to use the "sqlsrv" module - // but you will need to compile it on your own. - // - // - // PHP_VERSION_ID is available as of PHP 5.2.7 - if ( defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300 ) { - $extid = 'sqlsrv'; - } - - if ( $isPHPGTE7 ) { - $extid = 'sqlsrv'; - } - - } - $checks[] = array('extension' => $extid, - 'msg' => array('feedback' => 'MSSQL Database', 'ok' => $td_ok, 'ko' => 'cannot be used') ); - // --------------------------------------------------------------------------------------------------------- - - - $checks[]=array('extension' => 'gd', - 'msg' => array('feedback' => 'GD Graphic library', 'ok' => $td_ok, - 'ko' => " not enabled.
    Graph rendering requires it. This feature will be disabled." . - " It's recommended to install it.") ); - - $checks[]=array('extension' => 'ldap', - 'msg' => array('feedback' => 'LDAP library', 'ok' => $td_ok, - 'ko' => " not enabled. LDAP authentication cannot be used. " . - "(default internal authentication will works)")); - - $checks[]=array('extension' => 'json', - 'msg' => array('feedback' => 'JSON library', 'ok' => $td_ok, - 'ko' => " not enabled. You MUST install it to use EXT-JS tree component. ")); - - $checks[]=array('extension' => 'curl', - 'msg' => array('feedback' => 'cURL library', 'ok' => $td_ok, - 'ko' => " not enabled. You MUST install it to use REST Integration with issue trackers. ")); - - $out=''; - foreach($checks as $test) - { - $out .= sprintf($msg_support,$test['msg']['feedback']); - if( extension_loaded($test['extension']) ) - { - $msg=$test['msg']['ok']; - } - else - { - $msg=sprintf($td_failed,$test['msg']['feedback'],$test['msg']['ko']); - } - $out .= $msg; - } - - return $out; -} - - - -/** - * Check if web server support session data - * - * @param integer &$errCounter reference to error counter - * @return string html row with result - */ -function check_session(&$errCounter) { - $out = "Checking if sessions are properly configured"; - - if( !isset($_SESSION) ) - { - session_start(); - } - - if( $_SESSION['session_test'] != 1 ) - { - $color = 'success'; - $msg = 'OK'; - } - else - { - $color = 'error'; - $msg = 'Failed!'; - $errCounter++; - } - - $out .= "$msg\n"; - return ($out); -} //function end - - -/** - * check PHP defined timeout - * - * @param integer &$errCounter reference to error counter - * @return string html row with result - */ -function check_timeout(&$errCounter) -{ - $out = 'Maximum Session Idle Time before Timeout'; - - $timeout = ini_get("session.gc_maxlifetime"); - $gc_maxlifetime_min = floor($timeout/60); - $gc_maxlifetime_sec = $timeout % 60; - - if ($gc_maxlifetime_min > 30) { - $color = 'success'; - $res = 'OK'; - } else if ($gc_maxlifetime_min > 10){ - $color = 'warning'; - $res = 'Short. Consider to extend.'; - } else { - $color = 'error'; - $res = 'Too short. It must be extended!'; - $errCounter++; - } - $out .= "".$gc_maxlifetime_min . - " minutes and $gc_maxlifetime_sec seconds - ($res)\n"; - - return $out; -} - - -/** - * check Database type - * - * @param integer &$errCounter reference to error counter - * @param string $type valid PHP database type label - * - * @return string html row with result - */ -function checkDbType(&$errCounter, $type) -{ - $out = 'Database type'; - - switch ($type) - { - case 'mysql': - case 'mysqli': - case 'mssql': - case 'postgres': - $out .= ''.$type.''; - break; - - default: - $out .= 'Unsupported type: '.$type. - '. MySQL,Postgres and MSSQL are supported DB types. Of course' . - ' you can use also other ones without migration support.'; - break; - } - - return $out; -} - - -/** - * Display Operating System - * - * @return string html table row - */ -function checkServerOs() -{ - $final_msg = 'Server Operating System (no constrains)'; - $final_msg .= '' . PHP_OS . ''; - - return $final_msg; -} - - -/** - * check minimal required PHP version - * - * @param integer &$errCounter pointer to error counter - * @return string html row with result - */ -function checkPhpVersion(&$errCounter) -{ - $min_version = '7.4.2'; - $my_version = phpversion(); - - // version_compare: - // -1 if left is less, 0 if equal, +1 if left is higher - $php_ver_comp = version_compare($my_version, $min_version); - - $final_msg = 'PHP version'; - - if($php_ver_comp < 0) { - $final_msg .= - "Failed! - You are running on PHP " . - $my_version . - ", and TestLink requires PHP " . $min_version . - ' or greater. ' . - 'This is fatal problem. You must upgrade it.'; - $errCounter += 1; - } else { - $final_msg .= "OK ( {$min_version} [minimum version] "; - $final_msg .= ($php_ver_comp == 0 ? " = " : " <= "); - $final_msg .= $my_version . " [your version] " ; - $final_msg .= " ) "; - } - - return $final_msg; -} - - -/** - * verify that files are writable/readable - * OK result is for state: - * a) installation - writable - * b) installed - readable - * - * @param integer &$errCounter pointer to error counter - * @return string html row with result - * @author Martin Havlat - */ -function check_file_permissions(&$errCounter, $inst_type, $checked_filename, $isCritical=FALSE) -{ - $checked_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'); - $checked_file = $checked_path.DIRECTORY_SEPARATOR.$checked_filename; - $out = 'Access to file ('.$checked_file.')'; - - if ($inst_type == 'new') { - if (file_exists($checked_file)) { - if (is_writable($checked_file)) { - $out .= "OK (writable)\n"; - } else { - if ($isCritical) { - $out .= "Failed! Please fix the file " . - $checked_file . " permissions and reload the page."; - $errCounter += 1; - } else { - $out .= "Not writable! Please fix the file " . - $checked_file . " permissions."; - } - } - } else { - if (is_writable($checked_path)) { - $out .= "OK\n"; - } else { - if ($isCritical) { - $out .= "Directory is not writable! Please fix " . - $checked_path . " permissions and reload the page."; - $errCounter += 1; - } else { - $out .= "Directory is not writable! Please fix " . - $checked_path . " permissions."; - } - } - } - } else { - if (file_exists($checked_file)) { - if (!is_writable($checked_file)) { - $out .= "OK (read only)\n"; - } else { - $out .= "It's recommended to have read only permission for security reason."; - } - } else { - if ($isCritical) { - $out .= "Failed! The file is not on place."; - $errCounter += 1; - } else { - $out .= "The file is not on place."; - } - } - } - - return $out; -} - - -/** - * Check read/write permissions for directories - * based on check_with_feedback($dirs_to_check); - * - * @param integer &$errCounter pointer to error counter - * @return string html row with result - * @author Martin Havlat - */ -function check_dir_permissions(&$errCounter) -{ - - $dirs_to_check = ['templates_c' => ['config' => 'temp_dir', 'needsLock' =>''], - 'logs' => ['config' => 'log_path', 'needsLock' => '[S] '] , - 'upload_area' => ['config' => 'repositoryPath', 'needsLock' => '[S] ']]; - - $final_msg = ''; - $msg_ko = "Failed!"; - $msg_ok = "OK"; - $checked_path_base = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'); - - $final_msg .= - "For security reasons we suggest that directories tagged with [S]" . - " on following messages, will be made UNREACHEABLE from browser.
    " . - "Give a look to README file, section 'Installation & SECURITY' " . - " to understand how to change the defaults."; - - $os = strtolower(PHP_OS); - if ($os == 'linux') { - $final_msg .= - '
    Give a look to SELINUX section in README.md'; - } - $final_msg .= ""; - - foreach ($dirs_to_check as $the_d => $settings) { - - $the_d = config_get($settings['config']); - $needsLock = $settings['needsLock']; - - $final_msg .= "Checking if {$the_d} directory exists {$needsLock}"; - if(!file_exists($the_d)) { - $errCounter += 1; - $final_msg .= $msg_ko; - } - else { - $final_msg .= $msg_ok; - $final_msg .= "Checking if {$the_d} directory is writable (by user used to run webserver process) "; - if(!is_writable($the_d)) - { - $errCounter += 1; - $final_msg .= $msg_ko; - } - else - { - $final_msg .= $msg_ok; - } - } - } - - return($final_msg); -} - - -/** - * Print table with checking www browser support - * - * @param integer &$errCounter pointer to error counter - * @author Martin Havlat - **/ -function reportCheckingBrowser(&$errCounter) -{ - $browser = strtolower($_SERVER['HTTP_USER_AGENT']); - - echo "\n".'

    Browser compliance

    '."\n"; - - echo '

    '.$browser.'

    '; - echo ''; - - if (strpos($browser, 'firefox') === false || strpos($browser, 'msie') === false) - { - echo ""; - } - else - { - echo ""; - } - - echo ''; - - echo '
    Browser supportedOK
    Unsupported: {$_SERVER['HTTP_USER_AGENT']}
    Javascript availability' . - ''. - '' . - '
    '; -} - - -/** - * print table with system checking results - * - * @param integer &$errCounter reference to error counter - * @author Martin Havlat - **/ -function reportCheckingSystem(&$errCounter) -{ - echo '

    System requirements

    '; - echo checkServerOs(); - echo checkPhpVersion($errCounter); - echo '
    '; -} - - -/** - * print table with database checking - * - * @param integer &$errCounter reference to error counter - * @author Martin Havlat - **/ -function reportCheckingDatabase(&$errCounter, $type = null) -{ - if (checkInstallStatus()) - { - $type = DB_TYPE; - } - - if (!is_null($type)) - { - echo '

    Database checking

    '; - echo checkDbType($errCounter, $type); - echo "
    \n"; - } - -} - - -/** - * print table with system checking results - * - * @param integer &$errCounter reference to error counter - * @author Martin Havlat - **/ -function reportCheckingWeb(&$errCounter) { - echo '

    Web and PHP configuration

    '; - echo check_timeout($errCounter); - echo check_php_settings($errCounter); - echo checkPhpExtensions($errCounter); - echo '
    '; -} - - -/** - * print table with system checking results - * - * @param integer &$errCounter pointer to error counter - * @param string installationType: useful when this function is used on installer - * - * @author Martin Havlat - **/ -function reportCheckingPermissions(&$errCounter,$installationType='none') -{ - echo '

    Read/write permissions

    '; - echo check_dir_permissions($errCounter); - - // for $installationType='upgrade' existence of config_db.inc.php is not needed - $blockingCheck=$installationType=='upgrade' ? FALSE : TRUE; - if($installationType=='new') - { - echo check_file_permissions($errCounter,$installationType,'config_db.inc.php', $blockingCheck); - } - echo '
    '; -} \ No newline at end of file diff --git a/lib/functions/csrf.php b/lib/functions/csrf.php index 02e86ec180..b474a156c5 100644 --- a/lib/functions/csrf.php +++ b/lib/functions/csrf.php @@ -1,212 +1,197 @@ - - * In case you would like to skip this, you can add a nocsrf field. - * - * @param unknown_type $form_data_html HTML content - * @return html content with modified forms that include CSRF hidden tokens - */ -function csrfguard_replace_forms($form_data_html) -{ - $count=preg_match_all("/(.*?)<\\/form>/is",$form_data_html,$matches,PREG_SET_ORDER); - if (is_array($matches)) - { - foreach ($matches as $m) - { - if (strpos($m[1],"nocsrf")!==false) - { - continue; - } - $name="CSRFGuard_".mt_rand(0,mt_getrandmax()); - $token= csrfguard_generate_token($name); - - // because you can have multiple forms in a HTML page - // is not possible to add a fixed ID. - // - $form_data_html=str_replace($m[0], - " + + * In case you would like to skip this, you can add a nocsrf field. + * + * @param string $form_data_html + * HTML content + * @return string html content with modified forms that include CSRF hidden tokens + */ +function csrfguard_replace_forms($form_data_html) +{ + preg_match_all("/(.*?)<\\/form>/is", $form_data_html, $matches, + PREG_SET_ORDER); + if (is_array($matches)) { + foreach ($matches as $m) { + if (strpos($m[1], "nocsrf") !== false) { + continue; + } + $name = "CSRFGuard_" . mt_rand(0, mt_getrandmax()); + $token = csrfguard_generate_token($name); + + // because you can have multiple forms in a HTML page + // is not possible to add a fixed ID. + // + $form_data_html = str_replace($m[0], + " - {$m[2]}",$form_data_html); - } - } - return $form_data_html; -} - -/** - * Applies CSRF filter on Smarty template content. Can be - * used as a output filter. - * - * @param string $source - * @param Smarty $smarty - * @return CSRF filtered content - */ -function smarty_csrf_filter($source, $smarty) { - return csrfguard_replace_forms($source); -} - -/** - * Validates the CSRF tokens found in $_POST variable. Raoses user - * errors if the token is not found or invalid. - * - * @return true if validated correctly, otherwise false - */ -function csrfguard_start() -{ - if (count($_POST)) - { - if (!isset($_POST['CSRFName'])) - { - //trigger_error("No CSRFName found, probable invalid request.",E_USER_ERROR); - //return false; - redirect($_SESSION['basehref'] . 'error.php?code=1'); - exit(); - } - - $name = trim($_POST['CSRFName']); - $token = trim($_POST['CSRFToken']); - $good = (strlen($name) > 0 && strlen($token) > 0); - - if (!$good || !csrfguard_validate_token($name, $token)) - { - //trigger_error("Invalid CSRF token.",E_USER_ERROR); - //return false; - redirect($_SESSION['basehref'] . 'error.php?code=2'); - exit(); - } - } -} - -// this way is runned always -// Need to understand if this is needed -// + {$m[2]}", + $form_data_html); + } + } + return $form_data_html; +} + +/** + * Applies CSRF filter on Smarty template content. + * Can be + * used as a output filter. + * + * @param string $source + * @param Smarty $smarty + * @return string CSRF filtered content + */ +function smarty_csrf_filter($source, $smarty) +{ + return csrfguard_replace_forms($source); +} + +/** + * Validates the CSRF tokens found in $_POST variable. + * Raoses user + * errors if the token is not found or invalid. + * + * @return true if validated correctly, otherwise false + */ +function csrfguard_start() +{ + if (count($_POST)) { + if (! isset($_POST['CSRFName'])) { + redirect($_SESSION['basehref'] . 'error.php?code=1'); + exit(); + } + + $name = trim($_POST['CSRFName']); + $token = trim($_POST['CSRFToken']); + $good = (strlen($name) > 0 && strlen($token) > 0); + + if (! $good || ! csrfguard_validate_token($name, $token)) { + redirect($_SESSION['basehref'] . 'error.php?code=2'); + exit(); + } + } +} + +// this way is runned always +// Need to understand if this is needed doSessionStart(false); -// csrfguard_start(); \ No newline at end of file + diff --git a/lib/functions/csv.inc.php b/lib/functions/csv.inc.php index 6f30ea0a98..85ad2e3e32 100644 --- a/lib/functions/csv.inc.php +++ b/lib/functions/csv.inc.php @@ -1,165 +1,177 @@ - ';', + 'fieldQty' => 0, + 'processHeader' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $handle = fopen($fileName, "r"); + $check_syntax = $my['options']['fieldQty'] > 0; + $do_import = 1; + + // parsedCounter: count lines on file that has been parsed => exclude comment lines + // syntaxError: array: index -> line number on file that has been skipped due to syntax + // check problems. + // info: map with lines that can be processed by caller + // + $retVal = array( + 'userFeedback' => array( + 'parsedCounter' => 0, + 'syntaxError' => array() + ), + 'info' => null + ); + + if ($handle) { + $lineNumber = 0; + $idx = 0; + $isHeaderLine = true; + $keyMappings = $fieldMappings; + + $debugMsg = 'DEBUG::' . basename(__FILE__); + + if ($debugMe) { + echo $debugMsg . ' OPTIONS: processHeader=' . + (($my['options']['processHeader']) ? 'true' : 'false') . '
    '; + } + + while ($data = fgetcsv($handle, TL_IMPORT_ROW_MAX, + $my['options']['delimiter'])) { + $lineNumber ++; + + // ignore line that start with comment char, leading blanks are ignored + $firstChunk = trim($data[0]); + $positionCheck = strpos($firstChunk, '#'); + $processLine = ($positionCheck === false || $positionCheck != 0); + + if ($debugMe) { + echo $debugMsg . ':: Line: ' . $lineNumber . '=>' . + (($processLine) ? 'OK to process' : 'Skipped') . '
    '; + } + + if ($processLine) { + $retVal['userFeedback']['parsedCounter'] ++; + + if ($isHeaderLine && $my['options']['processHeader']) { + // Get format information from first line, and rebuild with this + // information the keyMappings, using fieldMappings + $isHeaderLine = false; + $keyMappings = null; + foreach ($fieldMapping as $k => $targetKey) { + if (is_int($k)) { + $needle = $targetKey; + $dest = $needle; + } else { + $needle = $k; + $dest = $targetKey; + } + $t = array_search($needle, $data); + $keyMappings[$t] = $dest; + } + } else { + if ($check_syntax) { + $fieldsQty = count($data); + if (! ($do_import = ($fieldsQty == + $my['options']['fieldQty']))) { + $msg = 'Field count:' . $fieldsQty . + ' Required Field count: ' . + $my['options']['fieldQty']; + + $retVal['userFeedback']['syntaxError'][$lineNumber] = $msg; + + if ($debugMe) { + echo $debugMsg . 'Syntax Check Failure - Line ' . + $lineNumber . $msg . ' - SKIPPED ' . '
    '; + } + } + } + + if ($do_import) { + foreach ($keyMappings as $fieldPos => $fieldKey) { + $retVal['info'][$idx][$fieldKey] = $data[$fieldPos]; + } + $idx ++; + } + } + } + } + } + return $retVal; } - -// added [$num_fields] number of fields a line must have to be valid -// if the number is not verified the line is discarded. -// -/** @uses requirements.inc.php */ -function importCSVData($fileName,$fieldMappings, $options = null) { - $debugMe = false; //true; - $my['options'] = array( 'delimiter' => ';', 'fieldQty' => 0, 'processHeader' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $handle = fopen ($fileName,"r"); - $check_syntax = $my['options']['fieldQty'] > 0; - $do_import = 1; - - // parsedCounter: count lines on file that has been parsed => exclude comment lines - // syntaxError: array: index -> line number on file that has been skipped due to syntax - // check problems. - // info: map with lines that can be processed by caller - // - $retVal = array('userFeedback' => array('parsedCounter' => 0, 'syntaxError' => array()), - 'info' => null); - - if ($handle) - { - $lineNumber = 0; - $idx = 0; - $isHeaderLine = true; - $keyMappings = $fieldMappings; - - $debugMsg = 'DEBUG::' . basename(__FILE__); - - if( $debugMe ) - { - echo $debugMsg . ' OPTIONS: processHeader=' . - (($my['options']['processHeader']) ? 'true' : 'false' ) . '
    '; - } - - while( $data = fgetcsv($handle, TL_IMPORT_ROW_MAX, $my['options']['delimiter']) ) - { - $lineNumber++; - - // ignore line that start with comment char, leading blanks are ignored - $firstChunk = trim($data[0]); - $positionCheck = strpos($firstChunk,'#'); - $processLine = ($positionCheck === false || $positionCheck != 0); - - if( $debugMe ) - { - echo $debugMsg . ':: Line: ' . $lineNumber . '=>' . - (($processLine) ? 'OK to process' : 'Skipped') .'
    '; - } - - if( $processLine ) - { - $retVal['userFeedback']['parsedCounter']++; - - if( $isHeaderLine && $my['options']['processHeader'] ) - { - // Get format information from first line, and rebuild with this - // information the keyMappings, using fieldMappings - // - $isHeaderLine = false; - $keyMappings = null; - foreach($fieldMapping as $k => $targetKey) - { - if (is_int($k)) - { - $needle = $targetKey; - $dest = $needle; - } - else - { - $needle = $k; - $dest = $targetKey; - } - $t = array_search($needle, $data); - $keyMappings[$t] = $dest; - } - } - else - { - if( $check_syntax) - { - $fieldsQty = count($data); - if( !($do_import = ($fieldsQty == $my['options']['fieldQty']))) - { - $msg = 'Field count:' . $fieldsQty . ' Required Field count: ' . - $my['options']['fieldQty']; - - $retVal['userFeedback']['syntaxError'][$lineNumber] = $msg; - - if($debugMe) - { - echo $debugMsg . 'Syntax Check Failure - Line ' . $lineNumber . - $msg . ' - SKIPPED ' . '
    '; - } - } - } - - if( $do_import ) - { - foreach($keyMappings as $fieldPos => $fieldKey) - { - $retVal['info'][$idx][$fieldKey] = $data[$fieldPos]; - } - $idx++; - } - } - } - } // end while - } - return $retVal; -} - - diff --git a/lib/functions/database.class.php b/lib/functions/database.class.php index 3ecf3c7090..f9ff4ef89a 100644 --- a/lib/functions/database.class.php +++ b/lib/functions/database.class.php @@ -1,1065 +1,1066 @@ -logEnabled=$value ? 1 : 0; - } - - function getLogEnabled($value) - { - return $this->logEnabled; - } - - function setLogQueries($value) - { - $this->logQueries = $value ? 1 : 0; - } - - function getLogQueries($value) - { - return $this->logQueries; - } - - // TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher - function __construct($db_type) - { - $fetch_mode = ADODB_FETCH_ASSOC; - - $this->dbType = $db_type; - if( $this->dbType == 'mysql' && version_compare(phpversion(), "5.5.0", ">=") ) - { - $this->dbType = 'mysqli'; - } - $adodb_driver = $this->dbType; - - // added to reduce memory usage (before this setting we used ADODB_FETCH_BOTH) - if($this->dbType == 'mssql') - { - $fetch_mode = ADODB_FETCH_BOTH; - if(PHP_OS == 'WINNT') - { - // Faced this problem when testing XAMPP 1.7.7 on Windows 7 with MSSQL 2008 Express - // From PHP MANUAL - reganding mssql_* functions - // These functions allow you to access MS SQL Server database. - // This extension is not available anymore on Windows with PHP 5.3 or later. - // SQLSRV, an alternative driver for MS SQL is available from Microsoft: - // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. - // - // PHP_VERSION_ID is available as of PHP 5.2.7 - if ( defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 50300) - { - $adodb_driver = 'mssqlnative'; - } - } - } - $this->db = NewADOConnection($adodb_driver); - $this->db->SetFetchMode($fetch_mode); - } - - - // access to the ADODB object - function get_dbmgr_object() - { - return($this->db); - } - - - - /** Make a connection to the database */ - # changed Connect() to NConnect() see ADODB Manuals - function connect( $p_dsn, $p_hostname = null, $p_username = null, - $p_password = null, $p_database_name = null ) - { - $result = array('status' => 1, 'dbms_msg' => 'ok'); - - if( $p_dsn === false ) { - $t_result = $this->db->NConnect($p_hostname, $p_username, $p_password, $p_database_name ); - } else { - $t_result = $this->db->IsConnected(); - } - - if ( $t_result ) { - $this->is_connected = true; - } else { - $result['status'] = 0; - $result['dbms_msg']=$this->error(); - } - return ($result); - } - - - /** - * execute SQL query, - * requires connection to be opened - * - * @param string $p_query SQL request - * @param integer $p_limit (optional) number of rows - * @param integer $p_offset (optional) begining row number - * - * @return boolean result of request - **/ - function exec_query( $p_query, $p_limit = -1, $p_offset = -1 ) - { - $ec = 0; - $emsg = null; - $logLevel = 'DEBUG'; - $message = ''; - - if($this->logQueries) - { - $this->nQuery++; - $t_start = $this->microtime_float(); - } - - if ( ( $p_limit != -1 ) || ( $p_offset != -1 ) ) { - $t_result = $this->db->SelectLimit( $p_query, $p_limit, $p_offset ); - } else { - $t_result = $this->db->Execute( $p_query ); - } - - if($this->logQueries) - { - $t_elapsed = number_format( $this->microtime_float() - $t_start, 4); - $this->overallDuration += $t_elapsed; - $message = "SQL [". $this->nQuery . "] executed [took {$t_elapsed} secs]" . - "[all took {$this->overallDuration} secs]:\n\t\t"; - } - $message .= $p_query; - - if (!$t_result) - { - $ec = $this->error_num(); - $emsg = $this->error_msg(); - $message .= "\nQuery failed: errorcode[" . $ec . "]". "\n\terrormsg:".$emsg; - $logLevel = 'ERROR'; - - - tLog("ERROR ON exec_query() - database.class.php
    " . $this->error(htmlspecialchars($p_query)) . - "
    THE MESSAGE : $message ", 'ERROR', "DATABASE"); - echo "
     ============================================================================== 
    "; - echo "
     DB Access Error - debug_print_backtrace() OUTPUT START 
    "; - echo "
     ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200) 
    "; - echo "
                Having this additional Information could be useful for reporting 
    "; - echo "
                issue to development TEAM. 
    "; - echo "
     ============================================================================== 
    "; - - if(defined('DBUG_ON') && DBUG_ON == 1) - { - echo "
    "; debug_print_backtrace(); echo "
    "; - die(); - } - echo "
    "; debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); echo "
    "; - die(); - - //else - //{ - // echo "
    "; debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); echo "
    "; - //} - echo "
     ============================================================================== 
    "; - $t_result = false; - } - - if($this->logEnabled) - { - tLog($message,$logLevel,"DATABASE"); - } - - if($this->logQueries) - { - array_push ($this->queries_array, array( $p_query, $t_elapsed, $ec, $emsg ) ); - } - - return $t_result; - - } - - - // TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher - function fetch_array( &$p_result ) - { - if ( $p_result->EOF ) { - return false; - } - - // mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this - switch ($this->db->databaseType) - { - case "mysql": - case "oci8po": - case "mssql": - case "mssqlnative": - $t_array = $p_result->fields; - break; - - default: - $t_array = $p_result->GetRowAssoc(false); - break; - } - - $p_result->MoveNext(); - return $t_array; - } - - - // 20080315 - franciscom - Got new code from Mantis, that manages FETCH_MODE_ASSOC - function db_result( $p_result, $p_index1=0, $p_index2=0 ) { - if ( $p_result && ( $this->num_rows( $p_result ) > 0 ) ) - { - $p_result->Move( $p_index1 ); - $t_result = $p_result->GetArray(); - - if ( isset( $t_result[0][$p_index2] ) ) { - return $t_result[0][$p_index2]; - } - - // The numeric index doesn't exist. FETCH_MODE_ASSOC may have been used. - // Get 2nd dimension and make it numerically indexed - $t_result = array_values( $t_result[0] ); - return $t_result[$p_index2]; - } - return false; - } - - - /** @return integer the last inserted id */ - function insert_id($p_table = null) - { - if ( isset($p_table) && ($this->db_is_pgsql() || $this->db_is_oracle())) - { - if ( $this->db_is_pgsql() ) - { - $sql = "SELECT currval('".$p_table."_id_seq')"; - } - elseif ($this->db_is_oracle()) - { - $sql = "SELECT ".$p_table."_id_seq.currval from dual"; - } - $result = $this->exec_query( $sql ); - return $this->db_result($result); - } - return $this->db->Insert_ID( ); - } - - - /** Check is the database is PostgreSQL */ - function db_is_pgsql() - { - $status_ok = false; - $dbType = $this->dbType; - if (strpos($dbType, 'postgres') === 0) { - $dbType = 'postgres'; - } - - switch( $dbType ) { - case 'postgres': - case 'pgsql': - $status_ok = true; - break; - } - return $status_ok; - } - - - /** - * Check is the database is ORACLE - * @return boolean TRUE = Oracle type - **/ - function db_is_oracle() - { - $status_ok = false; - switch( $this->dbType ) - { - case 'oci8': - case 'oci8po': - $status_ok = true; - break; - } - return $status_ok; - } - - - function db_table_exists( $p_table_name ) { - return in_array ( $p_table_name , $this->db->MetaTables( "TABLE" ) ) ; - } - - - function db_field_exists( $p_field_name, $p_table_name ) { - return in_array ( $p_field_name , $this->db->MetaColumnNames( $p_table_name ) ) ; - } - - - /** - * Check if there is an index defined on the specified table/field and with - * the specified type. - * Warning: only works with MySQL - * - * @param string $p_table Name of table to check - * @param string $p_field Name of field to check - * @param string $p_key key type to check for (eg: PRI, MUL, ...etc) - * - * @return boolean - */ - function key_exists_on_field( $p_table, $p_field, $p_key ) { - $c_table = $this->db->prepare_string( $p_table ); - $c_field = $this->db->prepare_string( $p_field ); - $c_key = $this->db->prepare_string( $p_key ); - - $sql = "DESCRIBE $c_table"; - $result = $this->exec_query( $sql ); - - $count = $this->num_rows( $result ); - for ( $i=0 ; $i < $count ; $i++ ) { - $row = $this->db->fetch_array( $result ); - - if ( $row['Field'] == $c_field ) { - return ( $row['Key'] == $c_key ); - } - } - return false; - } - - - # prepare a string before DB insertion - # 20051226 - fm - function prepare_string( $p_string ) - { - if (is_null($p_string)) - return ''; - - $t_escaped = $this->db->qstr( $p_string, false ); - // from second char(1) to one before last(-1) - return(substr($t_escaped,1,-1)); - } - - - # prepare an integer before DB insertion - function prepare_int( $p_int ) { - return (int)$p_int; - } - - - # prepare a boolean before DB insertion - function prepare_bool( $p_bool ) { - return (int)(bool)$p_bool; - } - - # return current timestamp for DB - function db_now() - { - switch($this->db->databaseType) - { - /* @todo: maybe we should use this? - case 'odbc_mssql': - return "GETDATE()"; - */ - default: - return $this->db->DBTimeStamp(time()); - } - } - - - # generate a unixtimestamp of a date - # > SELECT UNIX_TIMESTAMP(); - # -> 882226357 - # > SELECT UNIX_TIMESTAMP('1997-10-04 22:23:00'); - # -> 875996580 - function db_timestamp( $p_date=null ) { - - if ( null !== $p_date ) { - $p_timestamp = $this->db->UnixTimeStamp($p_date); - } else { - $p_timestamp = time(); - } - return $this->db->DBTimeStamp($p_timestamp) ; - } - - - function db_unixtimestamp( $p_date=null ) { - - if ( null !== $p_date ) { - $p_timestamp = $this->db->UnixTimeStamp($p_date); - } else { - $p_timestamp = time(); - } - return $p_timestamp ; - } - - - /** @return integer count queries */ - function count_queries () { - return count( $this->queries_array ); - } - - - /** @return integer count unique queries */ - function count_unique_queries () { - - $t_unique_queries = 0; - $t_shown_queries = array(); - foreach ($this->queries_array as $t_val_array) { - if ( ! in_array( $t_val_array[0], $t_shown_queries ) ) { - $t_unique_queries++; - array_push( $t_shown_queries, $t_val_array[0] ); - } - } - return $t_unique_queries; - } - - - /** get total time for queries */ - function time_queries () { - $t_count = count( $this->queries_array ); - $t_total = 0; - for ( $i = 0; $i < $t_count; $i++ ) { - $t_total += $this->queries_array[$i][1]; - } - return $t_total; - } - - - /** - * close the connection. - * Not really necessary most of the time since a connection is - * automatically closed when a page finishes loading. - */ - function close() { - $t_result = $this->db->Close(); - } - - - function error_num() { - return $this->db->ErrorNo(); - } - - - function error_msg() { - return $this->db->ErrorMsg(); - } - - - /** - * returns a message string with: error num, error msg and query. - * - * @return string the message - */ - function error( $p_query=null ) { - $msg= $this->error_num() . " - " . $this->error_msg(); - - if ( null !== $p_query ) - { - $msg .= " - " . $p_query ; - } - return $msg; - } - - - function num_rows( $p_result ) { - return $p_result->RecordCount( ); - } - - - function affected_rows() { - return $this->db->Affected_Rows( ); - } - - - /** - * Fetches the first column first row - * - * @param string $sql the query to be executed - * @param string $column the name of the column which shall be returned - * - * @return mixed the value of the column - **/ - function fetchFirstRowSingleColumn($sql,$column) - { - $value = null; - $row = $this->fetchFirstRow($sql); - - // BUGID 1318 - if ($row && array_key_exists($column, $row)) - { - $value = $row[$column]; - } - return $value; - } - - /** - * Fetches the first row (in a assoc-array) - * - * @param string $sql the query to be executed - * @return array the first row - **/ - function fetchFirstRow($sql) - { - $result = $this->exec_query($sql); - $row = null; - if ($result) - { - $row = $this->fetch_array($result); - } - unset($result); - return $row; - } - - - /** - * Get one value (no array) - * for example: SELECT COUNT(*) FROM table - * - * @param string $sql the query to be executed - * @return string of one value || null - **/ - public function fetchOneValue($sql) - { - $row = $this->fetchFirstRow($sql); - if ($row) - { - $fieldName = array_keys($row); - return $row[$fieldName[0]]; - } - return null; - } - - - /** - * Fetches all values for a given column of all returned rows - * - * @param string $sql the query to be executed - * @param string $column the name of the column - * @param integer $limit (optional) number of rows - * - * @return array an enumerated array, which contains all the values - **/ - function fetchColumnsIntoArray($sql,$column,$limit = -1) - { - $items = null; - $result = $this->exec_query($sql,$limit); - if ($result) - { - while($row = $this->fetch_array($result)) - { - $items[] = $row[$column]; - } - } - - unset($result); - return $items; - } - - - /** - * Fetches all rows into a map whose keys are the values of columns - * - * @param string $sql the query to be executed - * @param string $column the name of the column - * @param booleam $cumulative default 0 - * useful in situations with results set with multiple - * rows with same value on key column like this: - * - * col1 col2 col3 ... - * X A C - * X B Z - * Y B 0 - * - * cumulative=0 -> - * return items= array('X' => array('A','C'), 'Y' => array('B','0') ) - * - * cumulative=1 -> - * return items= - * array('X' => - * array( 0 => array('A','C'), - * 1 => array('B','Z')), - * 'Y' => array( 0 => array('B','0') ) - * - * @param integer $limit (optional) number of rows - * - * @return array an assoc array whose keys are the values from the columns - * of the rows - **/ - function fetchRowsIntoMap($sql,$column,$cumulative = 0,$limit = -1,$col2implode='') - { - $items = null; - $result = $this->exec_query($sql,$limit); - if ($result) - { - // ----------------------------------------------- - // Error management Code - $errorMsg=__CLASS__ . '/' . __FUNCTION__ . ' - '; - if( ($empty_column = (trim($column)=='') ) ) - { - $errorMsg .= 'empty column - SQL:' . $sql; - trigger_error($errorMsg,E_USER_NOTICE); - return null; - } - - while($row = $this->fetch_array($result)) - { - // ----------------------------------------------- - // Error management Code - if( !isset($row[$column]) ) - { - $errorMsg .= 'missing column:' . $column; - $errorMsg .= ' - SQL:' . $sql; - trigger_error($errorMsg,E_USER_NOTICE); - return null; - } - // ----------------------------------------------- - - if ($cumulative) - { - $items[$row[$column]][] = $row; - } - else if($col2implode != '') - { - if(isset($items[$row[$column]])) - { - $items[$row[$column]][$col2implode] .= ',' . $row[$col2implode]; - } - else - { - $items[$row[$column]] = $row; - } - } - else - { - $items[$row[$column]] = $row; - } - } - } - - unset($result); - unset($row); - return $items; - } - - - /** - * Fetches the values of two columns from all rows into a map - * - * @param string $sql the query to be executed - * @param string $column1 the name of the column (keys for the map) - * @param string $column2 the name of the second column (values of the map) - * @param boolean $cumulative - * useful in situations with results set like - * col1 col2 - * X A - * X B - * Y B - * - * cumulative=0 -> return items= array('X' => 'B', 'Y' => 'B') - * - * cumulative=1 -> return items= array('X' => array('A','B'), 'Y' => array('B') ) - * - * @param integer $limit (optional) number of rows - * - * @return assoc array whose keys are the values of column1 and the values are: - * - * cumulative=0 => the values of column2 - * cumulative=1 => array with the values of column2 - * - **/ - function fetchColumnsIntoMap($sql,$column1,$column2,$cumulative=0,$limit = -1) - { - $result = $this->exec_query($sql,$limit); - $items = null; - if ($result) - { - while ($myrow = $this->fetch_array($result)) - { - if($cumulative) - { - $items[$myrow[$column1]][] = $myrow[$column2]; - } - else - { - $items[$myrow[$column1]] = $myrow[$column2]; - } - } - } - - unset($result); - return $items; - } - - - /** - * database server information - * wrapper for adodb method ServerInfo - * - * @return assoc array members 'version' and 'description' - **/ - function get_version_info() - { - $version = $this->db->ServerInfo(); - return $version; - } - - - /** - **/ - function get_recordset($sql,$fetch_mode = null,$limit = -1, $start = -1) - { - $output = null; - - $result = $this->exec_query($sql,$limit,$start); - if ($result) - { - while($row = $this->fetch_array($result)) - { - $output[] = $row; - } - } - - unset($result); - return $output; - } - - - /** - * Fetches all rows into a map whose keys are the values of columns - * - * @param string $sql the query to be executed - * @param string $column the name of the column - * @param integer $limit (optional) number of rows - * - * @return array an assoc array whose keys are the values from the columns - * of the rows - **/ - function fetchArrayRowsIntoMap($sql,$column,$limit = -1) - { - $items = null; - $result = $this->exec_query($sql,$limit); - if ($result) - { - while($row = $this->fetch_array($result)) - { - $items[$row[$column]][] = $row; - } - } - - unset($result); - return $items; - } - - - /** - * Fetches all rows into a map whose keys are the values of columns - * - * @param string $sql the query to be executed - * @param string $column_main_key the name of the column - * @param string $column_sec_key the name of the column - * @param boolean $cumulative - * @param integer $limit (optional) number of rows - * - * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] - * - **/ - function fetchMapRowsIntoMap($sql,$main_key,$sec_key, - $cumulative = 0,$limit = -1, $col2implode ='') - { - $items = null; - $result = $this->exec_query($sql,$limit); - if ($result) { - while($row = $this->fetch_array($result)) { - if($cumulative) { - $items[$row[$main_key]][$row[$sec_key]][] = $row; - } else if($col2implode !='') { - if(isset($items[$row[$main_key]][$row[$sec_key]])) { - $items[$row[$main_key]][$row[$sec_key]][$col2implode] .= - ',' . $row[$col2implode]; - } else { - $items[$row[$main_key]][$row[$sec_key]] = $row; - } - } - else { - $items[$row[$main_key]][$row[$sec_key]] = $row; - } - } - } - - unset($result); - return $items; - } - - /** - * TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher - **/ - function build_sql_create_db($db_name) - { - $sql=''; - $dbType = $this->db->databaseType; - - // @user contribution - if (strpos($dbType, 'postgres') === 0) { - $dbType = 'postgres'; - } - - switch($dbType) { - case 'postgres': - $sql = 'CREATE DATABASE "' . $this->prepare_string($db_name) . '" ' . "WITH ENCODING='UNICODE' "; - break; - - case 'mssql': - case 'mssqlnative': - $sql = 'CREATE DATABASE [' . $this->prepare_string($db_name) . '] '; - break; - - case 'mysql': - default: - $sql = "CREATE DATABASE `" . $this->prepare_string($db_name) . "` CHARACTER SET utf8 "; - break; - } - return ($sql); - } - - - function db_null_timestamp() - { - $db_type = $this->db->databaseType; - $nullValue = NULL; - - switch($db_type) - { - case 'mysql': - // is not an error i put single quote on value - $nullValue = " '0000-00-00 00:00:00' "; - break; - } - return $nullValue; - } - - /** - * Fetches all rows into a map of 2 levels - * - * @param string $sql the query to be executed - * @param array $keyCols, columns to used as access key - * @param boolean $cumulative - * @param integer $limit (optional) number of rows - * - * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] - * - **/ - function fetchRowsIntoMap2l($sql,$keyCols,$cumulative = 0,$limit = -1) { - $items = null; - $result = $this->exec_query($sql,$limit); - - // new dBug($result); - if ($result) { - while($row = $this->fetch_array($result)) { - if($cumulative) { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]][] = $row; - } else { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]] = $row; - } - } - } - - unset($result); - return $items; - } - - /** - * Fetches all rows into a map of 3 levels - * - * @param string $sql the query to be executed - * @param array $keyCols, columns to used as access key - * @param boolean $cumulative - * @param integer $limit (optional) number of rows - * - * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] - * - **/ - function fetchRowsIntoMap3l($sql,$keyCols,$cumulative = 0,$limit = -1) { - $items = null; - $result = $this->exec_query($sql,$limit); - - // new dBug($result); - if ($result) { - while($row = $this->fetch_array($result)) { - if($cumulative) { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][] = $row; - } else { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]] = $row; - } - } - } - - unset($result); - return $items; - } - - - /** - * Fetches all rows into a map of 4 levels - * - * @param string $sql the query to be executed - * @param array $keyCols, columns to used as access key - * @param boolean $cumulative - * @param integer $limit (optional) number of rows - * - * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] - * - **/ - function fetchRowsIntoMap4l($sql,$keyCols,$cumulative = 0,$limit = -1) - { - $items = null; - $result = $this->exec_query($sql,$limit); - - // displayMemUsage(__FUNCTION__); - - // new dBug($result); - if ($result) - { - while($row = $this->fetch_array($result)) - { - if($cumulative) - { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][$row[$keyCols[3]]][] = $row; - } - else - { - $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][$row[$keyCols[3]]] = $row; - } - } - } - // displayMemUsage(__FUNCTION__); - unset($result); - // displayMemUsage(__FUNCTION__); - return $items; - } - - - - - /** - * Fetches all rows into a map whose keys are the values of columns - * - * @param string $sql the query to be executed - * @param string $column the name of the column - * - * @return array an assoc array - **/ - function fetchRowsIntoMapAddRC($sql,$column,$limit = -1) - { - $items = null; - $result = $this->exec_query($sql,$limit); - if ($result) - { - $errorMsg=__CLASS__ . '/' . __FUNCTION__ . ' - '; - if( ($empty_column = (trim($column)=='') ) ) - { - $errorMsg .= 'empty column - SQL:' . $sql; - trigger_error($errorMsg,E_USER_NOTICE); - return null; - } - - while($row = $this->fetch_array($result)) - { - if( !isset($row[$column]) ) - { - $errorMsg .= 'missing column:' . $column; - $errorMsg .= ' - SQL:' . $sql; - trigger_error($errorMsg,E_USER_NOTICE); - return null; - } - if(!isset($items[$row[$column]]) ) - { - $row['recordcount'] = 0; - } - else - { - $row['recordcount'] = $items[$row[$column]]['recordcount']; - } - $row['recordcount']++; - $items[$row[$column]] = $row; - } - } - - unset($result); - unset($row); - return $items; - } - - /** - * @used-by testplan.class.php - */ - function fetchMapRowsIntoMapStackOnCol($sql,$column_main_key,$column_sec_key,$stackOnCol) { - $items = null; - $result = $this->exec_query($sql); - if ($result) { - while($row = $this->fetch_array($result)) { - if( !isset($items[$row[$column_main_key]][$row[$column_sec_key]]) ) { - $items[$row[$column_main_key]][$row[$column_sec_key]] = $row; - $items[$row[$column_main_key]][$row[$column_sec_key]][$stackOnCol] = array(); - } - $items[$row[$column_main_key]][$row[$column_sec_key]][$stackOnCol][]=$row[$stackOnCol]; - } - } - unset($result); - return $items; - } - - -} // end of database class \ No newline at end of file +logEnabled = $value ? 1 : 0; + } + + private function getLogEnabled($value) + { + return $this->logEnabled; + } + + private function setLogQueries($value) + { + $this->logQueries = $value ? 1 : 0; + } + + private function getLogQueries($value) + { + return $this->logQueries; + } + + // TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher + public function __construct($db_type) + { + $fetch_mode = ADODB_FETCH_ASSOC; + + $this->dbType = $db_type; + if ($this->dbType == 'mysql' && + version_compare(phpversion(), "5.5.0", ">=")) { + $this->dbType = 'mysqli'; + } + $adodb_driver = $this->dbType; + + // added to reduce memory usage (before this setting we used ADODB_FETCH_BOTH) + if ($this->dbType == 'mssql') { + $fetch_mode = ADODB_FETCH_BOTH; + + // Faced this problem when testing XAMPP 1.7.7 on Windows 7 with MSSQL 2008 Express + // From PHP MANUAL - reganding mssql_* functions + // These functions allow you to access MS SQL Server database. + // This extension is not available anymore on Windows with PHP 5.3 or later. + // SQLSRV, an alternative driver for MS SQL is available from Microsoft: + // http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx. + // + // PHP_VERSION_ID is available as of PHP 5.2.7 + if (PHP_OS == 'WINNT' && defined('PHP_VERSION_ID') && + PHP_VERSION_ID >= 50300) { + $adodb_driver = 'mssqlnative'; + } + } + $this->db = NewADOConnection($adodb_driver); + $this->db->SetFetchMode($fetch_mode); + } + + // access to the ADODB object + public function get_dbmgr_object() + { + return $this->db; + } + + /** + * Make a connection to the database + */ + # changed Connect() to NConnect() see ADODB Manuals + public function connect($p_dsn, $p_hostname = null, $p_username = null, + $p_password = null, $p_database_name = null) + { + $result = array( + 'status' => 1, + 'dbms_msg' => 'ok' + ); + + if ($p_dsn === false) { + $t_result = $this->db->NConnect($p_hostname, $p_username, + $p_password, $p_database_name); + } else { + $t_result = $this->db->IsConnected(); + } + + if ($t_result) { + $this->is_connected = true; + } else { + $result['status'] = 0; + $result['dbms_msg'] = $this->error(); + } + return $result; + } + + /** + * execute SQL query, + * requires connection to be opened + * + * @param string $p_query + * SQL request + * @param integer $p_limit + * (optional) number of rows + * @param integer $p_offset + * (optional) begining row number + * + * @return boolean result of request + */ + public function exec_query($p_query, $p_limit = - 1, $p_offset = - 1) + { + $ec = 0; + $emsg = null; + $logLevel = 'DEBUG'; + $message = ''; + + if ($this->logQueries) { + $this->nQuery ++; + $t_start = $this->microtime_float(); + } + + if (($p_limit != - 1) || ($p_offset != - 1)) { + $t_result = $this->db->SelectLimit($p_query, $p_limit, $p_offset); + } else { + $t_result = $this->db->Execute($p_query); + } + + if ($this->logQueries) { + $t_elapsed = number_format($this->microtime_float() - $t_start, 4); + $this->overallDuration += $t_elapsed; + $message = "SQL [" . $this->nQuery . + "] executed [took {$t_elapsed} secs]" . + "[all took {$this->overallDuration} secs]:\n\t\t"; + } + $message .= $p_query; + + if (! $t_result) { + $ec = $this->error_num(); + $emsg = $this->error_msg(); + $message .= "\nQuery failed: errorcode[" . $ec . "]" . + "\n\terrormsg:" . $emsg; + $logLevel = 'ERROR'; + + tLog( + "ERROR ON exec_query() - database.class.php
    " . + $this->error(htmlspecialchars($p_query)) . + "
    THE MESSAGE : $message ", 'ERROR', "DATABASE"); + echo "
     ============================================================================== 
    "; + echo "
     DB Access Error - debug_print_backtrace() OUTPUT START 
    "; + echo "
     ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200) 
    "; + echo "
                Having this additional Information could be useful for reporting 
    "; + echo "
                issue to development TEAM. 
    "; + echo "
     ============================================================================== 
    "; + + if (defined('DBUG_ON') && DBUG_ON == 1) { + echo "
    ";
    +                debug_print_backtrace();
    +                echo "
    "; + die(); + } + echo "
    ";
    +            debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
    +            echo "
    "; + die(); + + echo "
     ============================================================================== 
    "; + $t_result = false; + } + + if ($this->logEnabled) { + tLog($message, $logLevel, "DATABASE"); + } + + if ($this->logQueries) { + array_push($this->queries_array, + array( + $p_query, + $t_elapsed, + $ec, + $emsg + )); + } + + return $t_result; + } + + // TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher + public function fetch_array(&$p_result) + { + if ($p_result->EOF) { + return false; + } + + // mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this + switch ($this->db->databaseType) { + case "mysql": + case "oci8po": + case "mssql": + case "mssqlnative": + $t_array = $p_result->fields; + break; + + default: + $t_array = $p_result->GetRowAssoc(false); + break; + } + + $p_result->MoveNext(); + return $t_array; + } + + // 20080315 - franciscom - Got new code from Mantis, that manages FETCH_MODE_ASSOC + private function db_result($p_result, $p_index1 = 0, $p_index2 = 0) + { + if ($p_result && ($this->num_rows($p_result) > 0)) { + $p_result->Move($p_index1); + $t_result = $p_result->GetArray(); + + if (isset($t_result[0][$p_index2])) { + return $t_result[0][$p_index2]; + } + + // The numeric index doesn't exist. FETCH_MODE_ASSOC may have been used. + // Get 2nd dimension and make it numerically indexed + $t_result = array_values($t_result[0]); + return $t_result[$p_index2]; + } + return false; + } + + /** + * + * @return integer the last inserted id + */ + public function insert_id($p_table = null) + { + if (isset($p_table) && ($this->db_is_pgsql() || $this->db_is_oracle())) { + if ($this->db_is_pgsql()) { + $sql = "SELECT currval('" . $p_table . "_id_seq')"; + } elseif ($this->db_is_oracle()) { + $sql = "SELECT " . $p_table . "_id_seq.currval from dual"; + } + $result = $this->exec_query($sql); + return $this->db_result($result); + } + return $this->db->Insert_ID(); + } + + /** + * Check is the database is PostgreSQL + */ + private function db_is_pgsql() + { + $status_ok = false; + $dbType = $this->dbType; + if (strpos($dbType, 'postgres') === 0) { + $dbType = 'postgres'; + } + + switch ($dbType) { + case 'postgres': + case 'pgsql': + $status_ok = true; + break; + } + return $status_ok; + } + + /** + * Check is the database is ORACLE + * + * @return boolean TRUE = Oracle type + */ + private function db_is_oracle() + { + $status_ok = false; + switch ($this->dbType) { + case 'oci8': + case 'oci8po': + $status_ok = true; + break; + } + return $status_ok; + } + + private function db_table_exists($p_table_name) + { + return in_array($p_table_name, $this->db->MetaTables("TABLE")); + } + + private function db_field_exists($p_field_name, $p_table_name) + { + return in_array($p_field_name, $this->db->MetaColumnNames($p_table_name)); + } + + /** + * Check if there is an index defined on the specified table/field and with + * the specified type. + * Warning: only works with MySQL + * + * @param string $p_table + * Name of table to check + * @param string $p_field + * Name of field to check + * @param string $p_key + * key type to check for (eg: PRI, MUL, ...etc) + * + * @return boolean + */ + private function key_exists_on_field($p_table, $p_field, $p_key) + { + $c_table = $this->db->prepare_string($p_table); + $c_field = $this->db->prepare_string($p_field); + $c_key = $this->db->prepare_string($p_key); + + $sql = "DESCRIBE $c_table"; + $result = $this->exec_query($sql); + + $count = $this->num_rows($result); + for ($i = 0; $i < $count; $i ++) { + $row = $this->db->fetch_array($result); + + if ($row['Field'] == $c_field) { + return $row['Key'] == $c_key; + } + } + return false; + } + + # prepare a string before DB insertion + # 20051226 - fm + public function prepare_string($p_string) + { + if (is_null($p_string)) { + return ''; + } + + $t_escaped = $this->db->qstr($p_string, false); + // from second char(1) to one before last(-1) + return substr($t_escaped, 1, - 1); + } + + # prepare an integer before DB insertion + public function prepare_int($p_int) + { + return (int) $p_int; + } + + # prepare a boolean before DB insertion + private function prepare_bool($p_bool) + { + return (int) (bool) $p_bool; + } + + # return current timestamp for DB + public function db_now() + { + switch ($this->db->databaseType) { + /* + * @todo: maybe we should use this? + * case 'odbc_mssql': + * return "GETDATE()"; + */ + default: + return $this->db->DBTimeStamp(time()); + } + } + + # generate a unixtimestamp of a date + # > SELECT UNIX_TIMESTAMP(); + # -> 882226357 + # > SELECT UNIX_TIMESTAMP('1997-10-04 22:23:00'); + # -> 875996580 + private function db_timestamp($p_date = null) + { + if (null !== $p_date) { + $p_timestamp = $this->db->UnixTimeStamp($p_date); + } else { + $p_timestamp = time(); + } + return $this->db->DBTimeStamp($p_timestamp); + } + + public function db_unixtimestamp($p_date = null) + { + if (null !== $p_date) { + $p_timestamp = $this->db->UnixTimeStamp($p_date); + } else { + $p_timestamp = time(); + } + return $p_timestamp; + } + + /** + * + * @return integer count queries + */ + private function count_queries() + { + return count($this->queries_array); + } + + /** + * + * @return integer count unique queries + */ + private function count_unique_queries() + { + $t_unique_queries = 0; + $t_shown_queries = array(); + foreach ($this->queries_array as $t_val_array) { + if (! in_array($t_val_array[0], $t_shown_queries)) { + $t_unique_queries ++; + array_push($t_shown_queries, $t_val_array[0]); + } + } + return $t_unique_queries; + } + + /** + * get total time for queries + */ + private function time_queries() + { + $t_count = count($this->queries_array); + $t_total = 0; + for ($i = 0; $i < $t_count; $i ++) { + $t_total += $this->queries_array[$i][1]; + } + return $t_total; + } + + /** + * close the connection. + * Not really necessary most of the time since a connection is + * automatically closed when a page finishes loading. + */ + public function close() + { + $this->db->Close(); + } + + private function error_num() + { + return $this->db->ErrorNo(); + } + + public function error_msg() + { + return $this->db->ErrorMsg(); + } + + /** + * returns a message string with: error num, error msg and query. + * + * @return string the message + */ + private function error($p_query = null) + { + $msg = $this->error_num() . " - " . $this->error_msg(); + + if (null !== $p_query) { + $msg .= " - " . $p_query; + } + return $msg; + } + + public function num_rows($p_result) + { + return $p_result->RecordCount(); + } + + public function affected_rows() + { + return $this->db->Affected_Rows(); + } + + /** + * Fetches the first column first row + * + * @param string $sql + * the query to be executed + * @param string $column + * the name of the column which shall be returned + * + * @return mixed the value of the column + */ + public function fetchFirstRowSingleColumn($sql, $column) + { + $value = null; + $row = $this->fetchFirstRow($sql); + + // BUGID 1318 + if ($row && array_key_exists($column, $row)) { + $value = $row[$column]; + } + return $value; + } + + /** + * Fetches the first row (in a assoc-array) + * + * @param string $sql + * the query to be executed + * @return array the first row + */ + public function fetchFirstRow($sql) + { + $result = $this->exec_query($sql); + $row = null; + if ($result) { + $row = $this->fetch_array($result); + } + unset($result); + return $row; + } + + /** + * Get one value (no array) + * for example: SELECT COUNT(*) FROM table + * + * @param string $sql + * the query to be executed + * @return string of one value || null + */ + public function fetchOneValue($sql) + { + $row = $this->fetchFirstRow($sql); + if ($row) { + $fieldName = array_keys($row); + return $row[$fieldName[0]]; + } + return null; + } + + /** + * Fetches all values for a given column of all returned rows + * + * @param string $sql + * the query to be executed + * @param string $column + * the name of the column + * @param integer $limit + * (optional) number of rows + * + * @return array an enumerated array, which contains all the values + */ + public function fetchColumnsIntoArray($sql, $column, $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + if ($result) { + while ($row = $this->fetch_array($result)) { + $items[] = $row[$column]; + } + } + + unset($result); + return $items; + } + + /** + * Fetches all rows into a map whose keys are the values of columns + * + * @param string $sql + * the query to be executed + * @param string $column + * the name of the column + * @param boolean $cumulative + * default 0 + * useful in situations with results set with multiple + * rows with same value on key column like this: + * + * col1 col2 col3 ... + * X A C + * X B Z + * Y B 0 + * + * cumulative=0 -> + * return items= array('X' => array('A','C'), 'Y' => array('B','0') ) + * + * cumulative=1 -> + * return items= + * array('X' => + * array( 0 => array('A','C'), + * 1 => array('B','Z')), + * 'Y' => array( 0 => array('B','0') ) + * + * @param integer $limit + * (optional) number of rows + * + * @return array an assoc array whose keys are the values from the columns + * of the rows + */ + public function fetchRowsIntoMap($sql, $column, $cumulative = 0, + $limit = - 1, $col2implode = '') + { + $items = null; + $result = $this->exec_query($sql, $limit); + if ($result) { + // Error management Code + $errorMsg = __CLASS__ . '/' . __FUNCTION__ . ' - '; + if (trim($column) == '') { + $errorMsg .= 'empty column - SQL:' . $sql; + trigger_error($errorMsg, E_USER_NOTICE); + return null; + } + + while ($row = $this->fetch_array($result)) { + // Error management Code + if (! isset($row[$column])) { + $errorMsg .= 'missing column:' . $column; + $errorMsg .= ' - SQL:' . $sql; + trigger_error($errorMsg, E_USER_NOTICE); + return null; + } + + if ($cumulative) { + $items[$row[$column]][] = $row; + } elseif ($col2implode != '') { + if (isset($items[$row[$column]])) { + $items[$row[$column]][$col2implode] .= ',' . + $row[$col2implode]; + } else { + $items[$row[$column]] = $row; + } + } else { + $items[$row[$column]] = $row; + } + } + } + + unset($result); + unset($row); + return $items; + } + + /** + * Fetches the values of two columns from all rows into a map + * + * @param string $sql + * the query to be executed + * @param string $column1 + * the name of the column (keys for the map) + * @param string $column2 + * the name of the second column (values of the map) + * @param boolean $cumulative + * useful in situations with results set like + * col1 col2 + * X A + * X B + * Y B + * + * cumulative=0 -> return items= array('X' => 'B', 'Y' => 'B') + * + * cumulative=1 -> return items= array('X' => array('A','B'), 'Y' => array('B') ) + * + * @param integer $limit + * (optional) number of rows + * + * @return array whose keys are the values of column1 and the values are: + * + * cumulative=0 => the values of column2 + * cumulative=1 => array with the values of column2 + * + */ + public function fetchColumnsIntoMap($sql, $column1, $column2, + $cumulative = 0, $limit = - 1) + { + $result = $this->exec_query($sql, $limit); + $items = null; + if ($result) { + while ($myrow = $this->fetch_array($result)) { + if ($cumulative) { + $items[$myrow[$column1]][] = $myrow[$column2]; + } else { + $items[$myrow[$column1]] = $myrow[$column2]; + } + } + } + + unset($result); + return $items; + } + + /** + * database server information + * wrapper for adodb method ServerInfo + * + * @return array members 'version' and 'description' + */ + private function get_version_info() + { + return $this->db->ServerInfo(); + } + + /** + */ + public function get_recordset($sql, $fetch_mode = null, $limit = - 1, + $start = - 1) + { + $output = null; + + $result = $this->exec_query($sql, $limit, $start); + if ($result) { + while ($row = $this->fetch_array($result)) { + $output[] = $row; + } + } + + unset($result); + return $output; + } + + /** + * Fetches all rows into a map whose keys are the values of columns + * + * @param string $sql + * the query to be executed + * @param string $column + * the name of the column + * @param integer $limit + * (optional) number of rows + * + * @return array an assoc array whose keys are the values from the columns + * of the rows + */ + public function fetchArrayRowsIntoMap($sql, $column, $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + if ($result) { + while ($row = $this->fetch_array($result)) { + $items[$row[$column]][] = $row; + } + } + + unset($result); + return $items; + } + + /** + * Fetches all rows into a map whose keys are the values of columns + * + * @param string $sql + * the query to be executed + * @param string $column_main_key + * the name of the column + * @param string $column_sec_key + * the name of the column + * @param boolean $cumulative + * @param integer $limit + * (optional) number of rows + * + * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] + * + */ + public function fetchMapRowsIntoMap($sql, $main_key, $sec_key, + $cumulative = 0, $limit = - 1, $col2implode = '') + { + $items = null; + $result = $this->exec_query($sql, $limit); + if ($result) { + while ($row = $this->fetch_array($result)) { + if ($cumulative) { + $items[$row[$main_key]][$row[$sec_key]][] = $row; + } elseif ($col2implode != '') { + if (isset($items[$row[$main_key]][$row[$sec_key]])) { + $items[$row[$main_key]][$row[$sec_key]][$col2implode] .= ',' . + $row[$col2implode]; + } else { + $items[$row[$main_key]][$row[$sec_key]] = $row; + } + } else { + $items[$row[$main_key]][$row[$sec_key]] = $row; + } + } + } + + unset($result); + return $items; + } + + /** + * TICKET 4898: MSSQL - Add support for SQLSRV drivers needed for PHP on WINDOWS version 5.3 and higher + */ + public function build_sql_create_db($db_name) + { + $sql = ''; + $dbType = $this->db->databaseType; + + // @user contribution + if (strpos($dbType, 'postgres') === 0) { + $dbType = 'postgres'; + } + + switch ($dbType) { + case 'postgres': + $sql = 'CREATE DATABASE "' . $this->prepare_string($db_name) . + '" ' . "WITH ENCODING='UNICODE' "; + break; + + case 'mssql': + case 'mssqlnative': + $sql = 'CREATE DATABASE [' . $this->prepare_string($db_name) . + '] '; + break; + + case 'mysql': + default: + $sql = "CREATE DATABASE `" . $this->prepare_string($db_name) . + "` CHARACTER SET utf8 "; + break; + } + return $sql; + } + + /** + * + * @return NULL|string + */ + public function db_null_timestamp() + { + $db_type = $this->db->databaseType; + $nullValue = null; + + switch ($db_type) { + case 'mysql': + // is not an error i put single quote on value + $nullValue = " '0000-00-00 00:00:00' "; + break; + } + return $nullValue; + } + + /** + * Fetches all rows into a map of 2 levels + * + * @param string $sql + * the query to be executed + * @param array $keyCols, + * columns to used as access key + * @param boolean $cumulative + * @param integer $limit + * (optional) number of rows + * + * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] + * + */ + public function fetchRowsIntoMap2l($sql, $keyCols, $cumulative = 0, + $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + + if ($result) { + while ($row = $this->fetch_array($result)) { + if ($cumulative) { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]][] = $row; + } else { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]] = $row; + } + } + } + + unset($result); + return $items; + } + + /** + * Fetches all rows into a map of 3 levels + * + * @param string $sql + * the query to be executed + * @param array $keyCols, + * columns to used as access key + * @param boolean $cumulative + * @param integer $limit + * (optional) number of rows + * + * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] + * + */ + public function fetchRowsIntoMap3l($sql, $keyCols, $cumulative = 0, + $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + + if ($result) { + while ($row = $this->fetch_array($result)) { + if ($cumulative) { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][] = $row; + } else { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]] = $row; + } + } + } + + unset($result); + return $items; + } + + /** + * Fetches all rows into a map of 4 levels + * + * @param string $sql + * the query to be executed + * @param array $keyCols, + * columns to used as access key + * @param boolean $cumulative + * @param integer $limit + * (optional) number of rows + * + * @return array $items[$row[$column_main_key]][$row[$column_sec_key]] + * + */ + public function fetchRowsIntoMap4l($sql, $keyCols, $cumulative = 0, + $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + + if ($result) { + while ($row = $this->fetch_array($result)) { + if ($cumulative) { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][$row[$keyCols[3]]][] = $row; + } else { + $items[$row[$keyCols[0]]][$row[$keyCols[1]]][$row[$keyCols[2]]][$row[$keyCols[3]]] = $row; + } + } + } + unset($result); + + return $items; + } + + /** + * Fetches all rows into a map whose keys are the values of columns + * + * @param string $sql + * the query to be executed + * @param string $column + * the name of the column + * + * @return array an assoc array + */ + public function fetchRowsIntoMapAddRC($sql, $column, $limit = - 1) + { + $items = null; + $result = $this->exec_query($sql, $limit); + if ($result) { + $errorMsg = __CLASS__ . '/' . __FUNCTION__ . ' - '; + if (trim($column) == '') { + $errorMsg .= 'empty column - SQL:' . $sql; + trigger_error($errorMsg, E_USER_NOTICE); + return null; + } + + while ($row = $this->fetch_array($result)) { + if (! isset($row[$column])) { + $errorMsg .= 'missing column:' . $column; + $errorMsg .= ' - SQL:' . $sql; + trigger_error($errorMsg, E_USER_NOTICE); + return null; + } + if (! isset($items[$row[$column]])) { + $row['recordcount'] = 0; + } else { + $row['recordcount'] = $items[$row[$column]]['recordcount']; + } + $row['recordcount'] ++; + $items[$row[$column]] = $row; + } + } + + unset($result); + unset($row); + return $items; + } + + /** + * + * @used-by testplan.class.php + */ + public function fetchMapRowsIntoMapStackOnCol($sql, $column_main_key, + $column_sec_key, $stackOnCol) + { + $items = null; + $result = $this->exec_query($sql); + if ($result) { + while ($row = $this->fetch_array($result)) { + if (! isset( + $items[$row[$column_main_key]][$row[$column_sec_key]])) { + $items[$row[$column_main_key]][$row[$column_sec_key]] = $row; + $items[$row[$column_main_key]][$row[$column_sec_key]][$stackOnCol] = array(); + } + $items[$row[$column_main_key]][$row[$column_sec_key]][$stackOnCol][] = $row[$stackOnCol]; + } + } + unset($result); + return $items; + } +} diff --git a/lib/functions/date_api.php b/lib/functions/date_api.php index 8033357b59..ff2d2f8ec3 100644 --- a/lib/functions/date_api.php +++ b/lib/functions/date_api.php @@ -1,301 +1,293 @@ -$month_name"; - } else { - $month_option .= ""; - } - } - return $month_option; +$month_name"; + } else { + $month_option .= ""; + } + } + return $month_option; +} + +function create_numeric_month_option_list($p_month = 0) +{ + $month_option = ''; + for ($i = 1; $i <= 12; $i ++) { + if ($i == $p_month) { + $month_option .= ""; + } else { + $month_option .= ""; + } + } + return $month_option; +} + +function create_day_option_list($p_day = 0) +{ + $day_option = ''; + for ($i = 1; $i <= 31; $i ++) { + if ($i == $p_day) { + $day_option .= ""; + } else { + $day_option .= ""; + } + } + return $day_option; +} + +function create_year_option_list($p_year = 0) +{ + $year_option = ''; + $current_year = date("Y"); + + for ($i = $current_year; $i > 1999; $i --) { + if ($i == $p_year) { + $year_option .= ""; + } else { + $year_option .= ""; + } + } + return $year_option; +} + +// Added contribution (done on mantis) to manage datetime +/** + * used in cfield_mgr.class.php + */ +function create_date_selection_set($p_name, $p_format, $p_date = 0, + $options = null) +{ + $opt = array( + 'default_disable' => false, + 'allow_blank' => false, + 'show_on_filters' => false, + 'required' => '' + ); + + $opt = array_merge($opt, (array) $options); + + $localeDateFormat = config_get('locales_date_format'); + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $date_format = $localeDateFormat[$locale]; + $date_format_without_percent = str_replace('%', '', $date_format); + + // if calender shall be shown on filter position has to be fixed to fully display + $calender_div_position = $opt['show_on_filters'] ? "fixed" : "absolute"; + + $str_out = ''; + $t_chars = preg_split('//', $p_format, - 1, PREG_SPLIT_NO_EMPTY); + if ($p_date != 0) { + $t_date = preg_split('/-| |:/', date('Y-m-d H:i:s', $p_date), - 1, + PREG_SPLIT_NO_EMPTY); + } else { + $t_date = array( + - 1, + - 1, + - 1, + - 1, + - 1, + - 1 + ); + } + + $t_disable = ''; + $t_blank_line_time = ''; + if ($opt['default_disable']) { + $t_disable = 'disabled'; + } + if ($opt['allow_blank']) { + $t_blank_line_time = ""; + } + + $m = $t_date[1]; + $d = $t_date[2]; + $y = $t_date[0]; + + // PHP on 32bit systems, when passing mktime(0,0,0,-1,-1,-1) returns false. + // PHP on 64bit systems it returns a long negative value which causes the error. + if ($m < 0 || $d < 0 || $y < 0) { + $time = 0; + } else { + $time = mktime(0, 0, 0, $m, $d, $y); + } + + $formatted_date = $time != 0 ? strftime($date_format, $time) : ''; + + $str_out .= '' . ' ' . ' ' . '
    '; + + // Here we work with the TIME PART, that exists only when we require TIMESTAMP + foreach ($t_chars as $t_char) { + $common = $opt['required'] . " $t_disable>"; + if (strcasecmp($t_char, "H") == 0) { + $mask = '' . - ' ' . - ' ' . - '
    '; - - - // Here we work with the TIME PART, that exists only when we require TIMESTAMP - foreach( $t_chars as $t_char ) - { - $common = $opt['required'] . " $t_disable>" ; - if (strcasecmp( $t_char, "H") == 0) - { - $mask = '" ; - - return $Html ; - } - -} // class end \ No newline at end of file +InstanceName = $instanceName; + $this->Value = ''; + } + + public function Create($rows = null, $cols = null) + { + echo $this->CreateHtml($rows, $cols); + } + + public function CreateHtml($rows = null, $cols = null) + { + $htmlValue = htmlspecialchars($this->Value); + + $my_rows = $rows; + $my_cols = $cols; + + if (is_null($my_rows) || $my_rows <= 0) { + $my_rows = $this->rows; + } + + if (is_null($my_cols) || $my_cols <= 0) { + $my_cols = $this->cols; + } + + return ' "; + } +} diff --git a/lib/functions/oauth_api.php b/lib/functions/oauth_api.php index 093cbb017e..9e2d3fc31c 100644 --- a/lib/functions/oauth_api.php +++ b/lib/functions/oauth_api.php @@ -1,57 +1,54 @@ - $cfg['oauth_client_id'], - 'clientSecret' => $cfg['oauth_client_secret'], - 'redirectUri' => $cfg['redirect_uri'] ]; - break; - } - - session_start(); - switch ($oauth2Name) { - case 'gitlab': - $provider = new Omines\OAuth2\Client\Provider\Gitlab($providerCfg); - $urlOpt = []; - break; - - case 'github': - $provider = new \League\OAuth2\Client\Provider\Github($providerCfg); - $urlOpt = ['scope' => ['user','user:email','public_profile']]; - break; - - case 'google': - $provider = new League\OAuth2\Client\Provider\Google($providerCfg); - $urlOpt = []; - break; - - case 'microsoft': - case 'azuread'; - $clientType = 'testLink'; - $_SESSION['oauth2state'] = $oauth2Name . '$$$' . - bin2hex(random_bytes(32)); - - // see https://docs.microsoft.com/en-us/azure/ - // active-directory/develop/v1-protocols-oauth-code - // for details - $oap = []; - $oap['state'] = $_SESSION['oauth2state']; - $oap['redirect_uri'] = $cfg['redirect_uri']; - $oap['client_id'] = $cfg['oauth_client_id']; - $oap['scope'] = $cfg['oauth_scope']; - - $oap['response_type'] = 'code'; - - if ($oauth2Name == 'azuread') { - if (!is_null($oauthCfg['oauth_domain'])) { - $oap['domain_hint'] = $oauthCfg['oauth_domain']; - } - } else { - if ($oauthCfg['oauth_force_single']) { - $oap['prompt'] = 'consent'; - } - } - - // http_build_query — Generate URL-encoded query string - $authUrl = $cfg['oauth_url'] . '?' . http_build_query($oap); - break; - - default: - $clientType = 'testLink'; - break; - } - - - switch ($clientType) { - case 'ThePHPLeague': - // Give a look to - // https://github.com/omines/oauth2-gitlab#managing-scopes - // - $authUrl = $provider->getAuthorizationUrl($urlOpt); - - // We are setting this to be able to check given state - // against previously stored one (this one!!) - // to mitigate CSRF attack - // This check will be done in method oauth_get_token() - // - $_SESSION['oauth2state'] = $provider->getState(); - header('Location: ' . $authUrl); - exit; - break; - - default: - header('Location: ' . $authUrl); - break; - } -} \ No newline at end of file + $cfg['oauth_client_id'], + 'clientSecret' => $cfg['oauth_client_secret'], + 'redirectUri' => $cfg['redirect_uri'] + ]; + break; + } + + session_start(); + switch ($oauth2Name) { + case 'gitlab': + $provider = new Omines\OAuth2\Client\Provider\Gitlab($providerCfg); + $urlOpt = []; + break; + + case 'github': + $provider = new \League\OAuth2\Client\Provider\Github($providerCfg); + $urlOpt = [ + 'scope' => [ + 'user', + 'user:email', + 'public_profile' + ] + ]; + break; + + case 'google': + $provider = new League\OAuth2\Client\Provider\Google($providerCfg); + $urlOpt = []; + break; + + case 'microsoft': + case 'azuread': + $clientType = 'testLink'; + $_SESSION['oauth2state'] = $oauth2Name . '$$$' . + bin2hex(random_bytes(32)); + + // see https://docs.microsoft.com/en-us/azure/ + // active-directory/develop/v1-protocols-oauth-code + // for details + $oap = []; + $oap['state'] = $_SESSION['oauth2state']; + $oap['redirect_uri'] = $cfg['redirect_uri']; + $oap['client_id'] = $cfg['oauth_client_id']; + $oap['scope'] = $cfg['oauth_scope']; + + $oap['response_type'] = 'code'; + + if ($oauth2Name == 'azuread') { + if (! is_null($oauthCfg['oauth_domain'])) { + $oap['domain_hint'] = $oauthCfg['oauth_domain']; + } + } else { + if ($oauthCfg['oauth_force_single']) { + $oap['prompt'] = 'consent'; + } + } + + // http_build_query — Generate URL-encoded query string + $authUrl = $cfg['oauth_url'] . '?' . http_build_query($oap); + break; + + default: + $clientType = 'testLink'; + break; + } + + switch ($clientType) { + case 'ThePHPLeague': + // Give a look to + // https://github.com/omines/oauth2-gitlab#managing-scopes + // + $authUrl = $provider->getAuthorizationUrl($urlOpt); + + // We are setting this to be able to check given state + // against previously stored one (this one!!) + // to mitigate CSRF attack + // This check will be done in method oauth_get_token() + // + $_SESSION['oauth2state'] = $provider->getState(); + header('Location: ' . $authUrl); + exit(); + break; + + default: + header('Location: ' . $authUrl); + break; + } +} diff --git a/lib/functions/oauth_providers/azuread.php b/lib/functions/oauth_providers/azuread.php index 6a51f92c56..109224638f 100644 --- a/lib/functions/oauth_providers/azuread.php +++ b/lib/functions/oauth_providers/azuread.php @@ -1,93 +1,98 @@ -status = array('status' => tl::OK, 'msg' => null); - - // Params to get token - $oauthParams = array( - 'code' => $code, - 'grant_type' => $authCfg['oauth_grant_type'], - 'client_id' => $authCfg['oauth_client_id'], - 'client_secret' => $authCfg['oauth_client_secret'] - ); - - $oauthParams['redirect_uri'] = trim($authCfg['redirect_uri']); - if( isset($_SERVER['HTTPS']) ) { - $oauthParams['redirect_uri'] = - str_replace('http://', 'https://', $oauthParams['redirect_uri']); - } - - $token_curl = curl_init(); - curl_setopt($token_curl, CURLOPT_URL, $authCfg['token_url']); - curl_setopt($token_curl, CURLOPT_POST, 1); - curl_setopt($token_curl, CURLOPT_POSTFIELDS, http_build_query($oauthParams)); - curl_setopt($token_curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($token_curl, CURLOPT_SSL_VERIFYPEER, false); - $result_token_curl = curl_exec($token_curl); - curl_close($token_curl); - $tokenInfo = json_decode($result_token_curl, true); - - // To get user principal name, given name, and surname from token endpoint, Directory.ReadWriteAll permission is required. - // However, it is too much to give Write permission, so if you get them via the graph API, only User.Read and Email.Read will be sufficient. - $graph_curl = curl_init(); - $graph_api_header = [ - 'Content-Type: application/json', - 'Authorization: Bearer ' . $tokenInfo['access_token'] - ]; - curl_setopt($graph_curl, CURLOPT_URL, $authCfg['oauth_profile']); - curl_setopt($graph_curl, CURLOPT_HTTPHEADER, $graph_api_header); - curl_setopt($graph_curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($graph_curl, CURLOPT_SSL_VERIFYPEER, false); - $result_graph_curl = curl_exec($graph_curl); - curl_close($graph_curl); - $userInfo = json_decode($result_graph_curl, true); - - // At this point we may turn to the user_info endpoint for additional information - // but for now, we are going to ignore it, as all neccessary information is available - // in the id_token - if (isset($tokenInfo['id_token'])){ - list($header, $payload, $signature) = explode(".", $tokenInfo['id_token']); - $jwtInfo = json_decode(base64_decode ($payload), true); - - if (isset($jwtInfo['oid'])){ - if (isset($authCfg['oauth_domain'])) { - $domain = substr(strrchr($userInfo['email'], "@"), 1); - if ($domain !== $authCfg['oauth_domain']){ - $result->status['msg'] = - "TestLink Oauth policy - User email domain:$domain does not - match \$authCfg['oauth_domain']:{$authCfg['oauth_domain']} "; - $result->status['status'] = tl::ERROR; - } - } - } else { - $result->status['msg'] = 'TestLink - User ID is empty'; - $result->status['status'] = tl::ERROR; - } - - $options = new stdClass(); - $options->givenName = $userInfo['given_name']; - $options->familyName = $userInfo['family_name']; - $options->user = $userInfo['email']; - $options->auth = 'oauth'; - - $result->options = $options; - } else { - $result->status['msg'] = 'TestLink - An error occurred during get token e'.$result_curl.'e'; - $result->status['status'] = tl::ERROR; - } - - return $result; +status = array( + 'status' => tl::OK, + 'msg' => null + ); + + // Params to get token + $oauthParams = array( + 'code' => $code, + 'grant_type' => $authCfg['oauth_grant_type'], + 'client_id' => $authCfg['oauth_client_id'], + 'client_secret' => $authCfg['oauth_client_secret'] + ); + + $oauthParams['redirect_uri'] = trim($authCfg['redirect_uri']); + if (isset($_SERVER['HTTPS'])) { + $oauthParams['redirect_uri'] = str_replace('http://', 'https://', + $oauthParams['redirect_uri']); + } + + $token_curl = curl_init(); + curl_setopt($token_curl, CURLOPT_URL, $authCfg['token_url']); + curl_setopt($token_curl, CURLOPT_POST, 1); + curl_setopt($token_curl, CURLOPT_POSTFIELDS, http_build_query($oauthParams)); + curl_setopt($token_curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($token_curl, CURLOPT_SSL_VERIFYPEER, false); + $result_token_curl = curl_exec($token_curl); + curl_close($token_curl); + $tokenInfo = json_decode($result_token_curl, true); + + // To get user principal name, given name, and surname from token endpoint, Directory.ReadWriteAll permission is required. + // However, it is too much to give Write permission, so if you get them via the graph API, only User.Read and Email.Read will be sufficient. + $graph_curl = curl_init(); + $graph_api_header = [ + 'Content-Type: application/json', + 'Authorization: Bearer ' . $tokenInfo['access_token'] + ]; + curl_setopt($graph_curl, CURLOPT_URL, $authCfg['oauth_profile']); + curl_setopt($graph_curl, CURLOPT_HTTPHEADER, $graph_api_header); + curl_setopt($graph_curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($graph_curl, CURLOPT_SSL_VERIFYPEER, false); + $result_graph_curl = curl_exec($graph_curl); + curl_close($graph_curl); + $userInfo = json_decode($result_graph_curl, true); + + // At this point we may turn to the user_info endpoint for additional information + // but for now, we are going to ignore it, as all neccessary information is available + // in the id_token + if (isset($tokenInfo['id_token'])) { + list (, $payload,) = explode(".", $tokenInfo['id_token']); + $jwtInfo = json_decode(base64_decode($payload), true); + + if (isset($jwtInfo['oid'])) { + if (isset($authCfg['oauth_domain'])) { + $domain = substr(strrchr($userInfo['email'], "@"), 1); + if ($domain !== $authCfg['oauth_domain']) { + $result->status['msg'] = "TestLink Oauth policy - User email domain:$domain does not + match \$authCfg['oauth_domain']:{$authCfg['oauth_domain']} "; + $result->status['status'] = tl::ERROR; + } + } + } else { + $result->status['msg'] = 'TestLink - User ID is empty'; + $result->status['status'] = tl::ERROR; + } + + $options = new stdClass(); + $options->givenName = $userInfo['given_name']; + $options->familyName = $userInfo['family_name']; + $options->user = $userInfo['email']; + $options->auth = 'oauth'; + + $result->options = $options; + } else { + $result->status['msg'] = 'TestLink - An error occurred during get token e' . + $result_curl . 'e'; + $result->status['status'] = tl::ERROR; + } + + return $result; } diff --git a/lib/functions/oauth_providers/github.php b/lib/functions/oauth_providers/github.php index 4451d8bb2d..f2d2fd28a1 100644 --- a/lib/functions/oauth_providers/github.php +++ b/lib/functions/oauth_providers/github.php @@ -1,96 +1,90 @@ -status = array('status' => tl::OK, 'msg' => null); - - $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; - if( isset($_SERVER['HTTPS']) ) { - $oauthParams['redirect_uri'] = - str_replace('http://', 'https://', - $oauthParams['redirect_uri']); - } - - $providerCfg = ['clientId' => $authCfg['oauth_client_id'], - 'clientSecret' => $authCfg['oauth_client_secret'], - 'redirectUri' => $oauthParams['redirect_uri']]; - - $provider = new \League\OAuth2\Client\Provider\Github($providerCfg); - - // echo '
    state from SESSION: '. $_SESSION['oauth2state']; - // echo '
    state from GET: ' . $_GET['state']; - - // CRITICAL - // Suggested in https://github.com/thephpleague/oauth2-client - // - // Check given state ($_GET) against previously stored one - // ($_SESSION) to mitigate CSRF attack - if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - $msg = "OAuth CSRF Check using \$_SESSION['oauth2state'] -> Failed!"; - throw new Exception("OAuth CSRF Check using ", 1); - } - - - // Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken('authorization_code', - ['code' => $_GET['code']]); - - // Now you have a token you can look up a users profile data - try { - // We got an access token, let's now get the user's details - $user = $provider->getResourceOwner($token); - - $firstLast = $user->getName(); - $result->options = new stdClass(); - $result->options->givenName = $firstLast; - $result->options->familyName = $firstLast; - - // Github does not provide the email in the getResourceOwner() - // response if the user has configured the mail as Private. - // Solution from: - // https://github.com/thephpleague/oauth2-github/issues/3 - // - $email = $user->getEmail(); - if ($email == null) { - $request = $provider->getAuthenticatedRequest( - 'GET', - 'https://api.github.com/user/emails', - $token // Your access token - ); - $array = $provider->getParsedResponse($request); - foreach ($array as $item) { - if ($item['primary'] === true) { - $email = $item['email']; - break; - } - } - } - $result->options->user = $email; - $result->options->email = $email; - //$result->options->login = $user->getUserName(); - $result->options->auth = 'oauth'; - - return $result; - - } catch (Exception $e) { - // Failed to get user details - exit('Oh dear...'); - } -} \ No newline at end of file +status = array( + 'status' => tl::OK, + 'msg' => null + ); + + $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; + if (isset($_SERVER['HTTPS'])) { + $oauthParams['redirect_uri'] = str_replace('http://', 'https://', + $oauthParams['redirect_uri']); + } + + $providerCfg = [ + 'clientId' => $authCfg['oauth_client_id'], + 'clientSecret' => $authCfg['oauth_client_secret'], + 'redirectUri' => $oauthParams['redirect_uri'] + ]; + + $provider = new \League\OAuth2\Client\Provider\Github($providerCfg); + + // CRITICAL + // Suggested in https://github.com/thephpleague/oauth2-client + // + // Check given state ($_GET) against previously stored one + // ($_SESSION) to mitigate CSRF attack + if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + throw new Exception("OAuth CSRF Check using ", 1); + } + + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // Now you have a token you can look up a users profile data + try { + // We got an access token, let's now get the user's details + $user = $provider->getResourceOwner($token); + + $firstLast = $user->getName(); + $result->options = new stdClass(); + $result->options->givenName = $firstLast; + $result->options->familyName = $firstLast; + + // Github does not provide the email in the getResourceOwner() + // response if the user has configured the mail as Private. + // Solution from: + // https://github.com/thephpleague/oauth2-github/issues/3 + // + $email = $user->getEmail(); + if ($email == null) { + $request = $provider->getAuthenticatedRequest('GET', + 'https://api.github.com/user/emails', $token // Your access token + ); + $array = $provider->getParsedResponse($request); + foreach ($array as $item) { + if ($item['primary'] === true) { + $email = $item['email']; + break; + } + } + } + $result->options->user = $email; + $result->options->email = $email; + $result->options->auth = 'oauth'; + + return $result; + } catch (Exception $e) { + // Failed to get user details + exit('Oh dear...'); + } +} diff --git a/lib/functions/oauth_providers/gitlab.php b/lib/functions/oauth_providers/gitlab.php index bd9e488cd2..5b0cfb41ac 100644 --- a/lib/functions/oauth_providers/gitlab.php +++ b/lib/functions/oauth_providers/gitlab.php @@ -1,78 +1,72 @@ -status = array('status' => tl::OK, 'msg' => null); - - $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; - if( isset($_SERVER['HTTPS']) ) { - $oauthParams['redirect_uri'] = - str_replace('http://', 'https://', - $oauthParams['redirect_uri']); - } - - $providerCfg = ['clientId' => $authCfg['oauth_client_id'], - 'clientSecret' => $authCfg['oauth_client_secret'], - 'redirectUri' => $oauthParams['redirect_uri'] ]; - - $provider = new Omines\OAuth2\Client\Provider\Gitlab($providerCfg); - // echo '
    state from SESSION: '. $_SESSION['oauth2state']; - // echo '
    state from GET: ' . $_GET['state']; - - // CRITICAL - // Suggested in https://github.com/thephpleague/oauth2-client - // - // Check given state ($_GET) against previously stored one - // ($_SESSION) to mitigate CSRF attack - if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - $msg = "OAuth CSRF Check using \$_SESSION['oauth2state'] -> Failed!"; - throw new Exception("OAuth CSRF Check using ", 1); - } - - - // Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken('authorization_code', - ['code' => $_GET['code']]); - - // Now you have a token you can look up a users profile data - try { - // We got an access token, let's now get the user's details - $user = $provider->getResourceOwner($token); - - // printf('
    getName %s!', $user->getName()); - // printf('
    getEmail %s!', $user->getEmail()); - // printf('
    getUserName %s!', $user->getUserName()); - - $firstLast = $user->getName(); - $result->options = new stdClass(); - $result->options->givenName = $firstLast; - $result->options->familyName = $firstLast; - $result->options->user = $user->getEmail(); - $result->options->email = $user->getEmail(); - $result->options->login = $user->getUserName(); - $result->options->auth = 'oauth'; - - return $result; - - } catch (Exception $e) { - // Failed to get user details - exit('Oh dear...'); - } -} \ No newline at end of file +status = array( + 'status' => tl::OK, + 'msg' => null + ); + + $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; + if (isset($_SERVER['HTTPS'])) { + $oauthParams['redirect_uri'] = str_replace('http://', 'https://', + $oauthParams['redirect_uri']); + } + + $providerCfg = [ + 'clientId' => $authCfg['oauth_client_id'], + 'clientSecret' => $authCfg['oauth_client_secret'], + 'redirectUri' => $oauthParams['redirect_uri'] + ]; + + $provider = new Omines\OAuth2\Client\Provider\Gitlab($providerCfg); + + // CRITICAL + // Suggested in https://github.com/thephpleague/oauth2-client + // + // Check given state ($_GET) against previously stored one + // ($_SESSION) to mitigate CSRF attack + if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + throw new Exception("OAuth CSRF Check using ", 1); + } + + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // Now you have a token you can look up a users profile data + try { + // We got an access token, let's now get the user's details + $user = $provider->getResourceOwner($token); + + $firstLast = $user->getName(); + $result->options = new stdClass(); + $result->options->givenName = $firstLast; + $result->options->familyName = $firstLast; + $result->options->user = $user->getEmail(); + $result->options->email = $user->getEmail(); + $result->options->login = $user->getUserName(); + $result->options->auth = 'oauth'; + + return $result; + } catch (Exception $e) { + // Failed to get user details + exit('Oh dear...'); + } +} diff --git a/lib/functions/oauth_providers/google.php b/lib/functions/oauth_providers/google.php index ca0cc9e231..1c669f7036 100644 --- a/lib/functions/oauth_providers/google.php +++ b/lib/functions/oauth_providers/google.php @@ -1,79 +1,72 @@ -status = array('status' => tl::OK, 'msg' => null); - - $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; - if( isset($_SERVER['HTTPS']) ) { - $oauthParams['redirect_uri'] = - str_replace('http://', 'https://', - $oauthParams['redirect_uri']); - } - - $providerCfg = ['clientId' => $authCfg['oauth_client_id'], - 'clientSecret' => $authCfg['oauth_client_secret'], - 'redirectUri' => $oauthParams['redirect_uri'] ]; - - $provider = new League\OAuth2\Client\Provider\Google($providerCfg); - - // - // CRITICAL - // Suggested in https://github.com/thephpleague/oauth2-client - // - // Check given state ($_GET) against previously stored one - // ($_SESSION) to mitigate CSRF attack - if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { - $msg = "OAuth CSRF Check using \$_SESSION['oauth2state'] -> Failed!"; - throw new Exception("OAuth CSRF Check using ", 1); - } - - - // Try to get an access token (using the authorization code grant) - $token = $provider->getAccessToken('authorization_code', - ['code' => $_GET['code']]); - - // Now you have a token you can look up a users profile data - try { - // We got an access token, let's now get the user's details - $user = $provider->getResourceOwner($token); - - // printf('
    getName %s!', $user->getName()); - // printf('
    getEmail %s!', $user->getEmail()); - // printf('
    getUserName %s!', $user->getUserName()); - //echo '
    ';
    -    //var_dump($user->toArray());
    -    //echo '
    '; - - $result->options = new stdClass(); - $result->options->givenName = $user->getFirstName(); - $result->options->familyName = $user->getLastName(); - $result->options->user = $user->getEmail(); - $result->options->email = $user->getEmail(); - $result->options->login = $user->getEmail(); - $result->options->auth = 'oauth'; - - return $result; - - } catch (Exception $e) { - // Failed to get user details - exit('Oh dear...'); - } -} \ No newline at end of file +status = array( + 'status' => tl::OK, + 'msg' => null + ); + + $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; + if (isset($_SERVER['HTTPS'])) { + $oauthParams['redirect_uri'] = str_replace('http://', 'https://', + $oauthParams['redirect_uri']); + } + + $providerCfg = [ + 'clientId' => $authCfg['oauth_client_id'], + 'clientSecret' => $authCfg['oauth_client_secret'], + 'redirectUri' => $oauthParams['redirect_uri'] + ]; + + $provider = new League\OAuth2\Client\Provider\Google($providerCfg); + + // + // CRITICAL + // Suggested in https://github.com/thephpleague/oauth2-client + // + // Check given state ($_GET) against previously stored one + // ($_SESSION) to mitigate CSRF attack + if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { + throw new Exception("OAuth CSRF Check using ", 1); + } + + // Try to get an access token (using the authorization code grant) + $token = $provider->getAccessToken('authorization_code', + [ + 'code' => $_GET['code'] + ]); + + // Now you have a token you can look up a users profile data + try { + // We got an access token, let's now get the user's details + $user = $provider->getResourceOwner($token); + + $result->options = new stdClass(); + $result->options->givenName = $user->getFirstName(); + $result->options->familyName = $user->getLastName(); + $result->options->user = $user->getEmail(); + $result->options->email = $user->getEmail(); + $result->options->login = $user->getEmail(); + $result->options->auth = 'oauth'; + + return $result; + } catch (Exception $e) { + // Failed to get user details + exit('Oh dear...'); + } +} diff --git a/lib/functions/oauth_providers/microsoft.php b/lib/functions/oauth_providers/microsoft.php index 89055a54e4..8635484b48 100644 --- a/lib/functions/oauth_providers/microsoft.php +++ b/lib/functions/oauth_providers/microsoft.php @@ -1,96 +1,104 @@ -status = array('status' => tl::OK, 'msg' => null); - - // Params to get token - $oauthParams = array( - 'code' => $code, - 'client_id' => $authCfg['oauth_client_id'], - 'client_secret' => $authCfg['oauth_client_secret'], - 'scope' => $authCfg['oauth_scope'], - 'grant_type' => $authCfg['oauth_grant_type'] - ); - - $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; - if( isset($_SERVER['HTTPS']) ) { - $oauthParams['redirect_uri'] = - str_replace('http://', 'https://', $oauthParams['redirect_uri']); - } - - $curlAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'; - $curlContentType = array('Content-Type: application/xml','Accept: application/json'); - - // Step #1 - Get the token - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $authCfg['token_url']); - curl_setopt($curl, CURLOPT_POST, 1); - curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json')); - curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($oauthParams)); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curl, CURLOPT_COOKIESESSION, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - $result_curl = curl_exec($curl); - - if( $result_curl === false ) { - echo 'Curl error: ' . curl_error($curl); - echo '
    ';
    -    var_dump(curl_getinfo($curl));
    -    echo '
    '; - die(); - } - curl_close($curl); - $tokenInfo = json_decode($result_curl); - - // If token is received start session - if (isset($tokenInfo->access_token)) { - $oauthParams['access_token'] = $tokenInfo->access_token; - - $targetURL = array(); - $targetURL['user'] = $authCfg['oauth_profile']; - $curlContentType[] = 'Authorization: Bearer ' . $oauthParams['access_token']; - - // Get User - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, $targetURL['user']); - curl_setopt($curl, CURLOPT_USERAGENT, $curlAgent); - curl_setopt($curl, CURLOPT_HTTPHEADER, $curlContentType); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); - - $result_curl = curl_exec($curl); - $userInfo = json_decode($result_curl, true); - curl_close($curl); - - if (!isset($userInfo['userPrincipalName'])) { - $result->status['msg'] = 'User ID is empty'; - $result->status['status'] = tl::ERROR; - } - - $result->options = new stdClass(); - $result->options->givenName = $userInfo['givenName']; - $result->options->familyName = $userInfo['surname']; - $result->options->user = $userInfo['userPrincipalName']; - $result->options->auth = 'oauth'; - - } else { - $result->status['msg'] = 'An error occurred during getting token'; - $result->status['status'] = tl::ERROR; - } - - return $result; -} \ No newline at end of file +status = array( + 'status' => tl::OK, + 'msg' => null + ); + + // Params to get token + $oauthParams = array( + 'code' => $code, + 'client_id' => $authCfg['oauth_client_id'], + 'client_secret' => $authCfg['oauth_client_secret'], + 'scope' => $authCfg['oauth_scope'], + 'grant_type' => $authCfg['oauth_grant_type'] + ); + + $oauthParams['redirect_uri'] = $authCfg['redirect_uri']; + if (isset($_SERVER['HTTPS'])) { + $oauthParams['redirect_uri'] = str_replace('http://', 'https://', + $oauthParams['redirect_uri']); + } + + $curlAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'; + $curlContentType = array( + 'Content-Type: application/xml', + 'Accept: application/json' + ); + + // Step #1 - Get the token + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $authCfg['token_url']); + curl_setopt($curl, CURLOPT_POST, 1); + curl_setopt($curl, CURLOPT_HTTPHEADER, array( + 'Accept: application/json' + )); + curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($oauthParams)); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_COOKIESESSION, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + $result_curl = curl_exec($curl); + + if ($result_curl === false) { + echo 'Curl error: ' . curl_error($curl); + echo '
    ';
    +        var_dump(curl_getinfo($curl));
    +        echo '
    '; + die(); + } + curl_close($curl); + $tokenInfo = json_decode($result_curl); + + // If token is received start session + if (isset($tokenInfo->access_token)) { + $oauthParams['access_token'] = $tokenInfo->access_token; + + $targetURL = array(); + $targetURL['user'] = $authCfg['oauth_profile']; + $curlContentType[] = 'Authorization: Bearer ' . + $oauthParams['access_token']; + + // Get User + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, $targetURL['user']); + curl_setopt($curl, CURLOPT_USERAGENT, $curlAgent); + curl_setopt($curl, CURLOPT_HTTPHEADER, $curlContentType); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + + $result_curl = curl_exec($curl); + $userInfo = json_decode($result_curl, true); + curl_close($curl); + + if (! isset($userInfo['userPrincipalName'])) { + $result->status['msg'] = 'User ID is empty'; + $result->status['status'] = tl::ERROR; + } + + $result->options = new stdClass(); + $result->options->givenName = $userInfo['givenName']; + $result->options->familyName = $userInfo['surname']; + $result->options->user = $userInfo['userPrincipalName']; + $result->options->auth = 'oauth'; + } else { + $result->status['msg'] = 'An error occurred during getting token'; + $result->status['status'] = tl::ERROR; + } + + return $result; +} diff --git a/lib/functions/object.class.php b/lib/functions/object.class.php index 6164476223..e84f9893e6 100644 --- a/lib/functions/object.class.php +++ b/lib/functions/object.class.php @@ -1,723 +1,782 @@ -= tl::OK, and for ERROR with < tl::OK - */ - const OK = 1; - - /** - * error and status codes: - * all ERROR error codes and ERROR status codes should be lesser than tl::ERROR - * so we can check for ERRORS with <= tl::ERROR, and for SUCCESS with > tl::ERROR - */ - const ERROR = 0; - - /** - * error and status codes: - * return code for not implemented interface functions - */ - const E_NOT_IMPLEMENTED = -0xFFFFFFFF; -}; - - -require_once('int_serialization.php'); - -/** - * Base class for all managed TestLink objects, all tl-managed objects should extend this base class - * - * @package TestLink - * @abstract - */ -abstract class tlObject implements iSerialization -{ - /** @var string the unique object id */ - protected $objectID; - - /** - * @var string a message for user feedback - */ - protected $userFeedback; - - /** - * @var array supported serialization interfaces - */ - protected $serializationInterfaces; - - /** - * @var array of format descriptors for the interfaces - */ - protected $serializationFormatDescriptors; - - /** - * @var array useful to manage DB where TL table names must have a prefix. - * key: table name WITHOUT prefix - * value: table name WITH PREFIX - * @see getDBTables() - */ - protected $tables = null; - - /** - * @var array useful to manage DB where TL view names must have a prefix. - * key: view name WITHOUT prefix - * value: view name WITH PREFIX - * @see getDBViews() - */ - protected $views = null; - - protected $auditCfg; - - - /** class constructor */ - public function __construct() - { - if (!isset($this->tables)) - { - $this->tables = self::getDBTables(); - $this->views = self::getDBViews(); - } - - $this->objectID = str_replace(".","",uniqid("", true)); - - $this->auditCfg = new stdClass(); - $this->auditCfg->eventSource = 'GUI'; - $this->auditCfg->logEnabled = true; - - /* - Any supported import/Export Serialization Interface must be prefixed with iSerializationTo - so we can automatically detected the interfaces - */ - $prefix = "iSerializationTo"; - $prefixLen = strlen($prefix); - $o = new ReflectionObject($this); - $interfaces = $o->getInterfaces(); - $this->serializationInterfaces = null; - $this->serializationFormatDescriptors = null; - if ($interfaces) - { - foreach($interfaces as $name => $info) - { - $iPos = strpos($name,$prefix); - if ($iPos === 0) - { - $format = substr($name,$prefixLen); - $this->serializationInterfaces[$name] = $format; - $pfn = "getFormatDescriptionFor".$format; - $this->serializationFormatDescriptors[$format] = $this->$pfn(); - } - } - } - $this->getSupportedSerializationFormatDescriptions(); - } - - /** - * - */ - function setAuditLogOn() - { - $this->auditCfg->logEnabled = true; - } - - /** - * - */ - function setAuditLogOff() - { - $this->auditCfg->logEnabled = false; - } - - /** - * - */ - function setAuditEventSource($val) - { - $this->auditCfg->eventSource = $val; - } - - /** - * get a message for user - */ - public function getUserFeedback() - { - return $this->userFeedback; - } - - /** - * Set a message for user - * @param string $message a localized message as user feedback - */ - public function setUserFeedback($message) - { - $this->userFeedback = $message; - } - - /** - * Getter for the unique objectID - * @return string the ID of the object - */ - public function getObjectID() - { - return $this->objectID; - } - - /** class destructor */ - public function __destruct() - { - $this->_clean(); - } - - - /** - * magic method for usage with print() or echo() , dumps out the object - * - * @return string a dump of the object - */ - public function __toString() - { - return __CLASS__.", ".print_r($this,true); - } - - /** function used for resetting the object's internal data */ - protected function _clean() - { - } - - /** - * Gets all serializationInterfaces the object supports - * - * @return all supported Import/Export Interfaces - **/ - function getSupportedSerializationInterfaces() - { - return $this->serializationInterfaces; - } - - /** - * @return all supported Import/Export Interfaces - Format Descriptors - **/ - function getSupportedSerializationFormatDescriptions() - { - return $this->serializationFormatDescriptors; - } - - /** - * should be called whenever a not implemented method is called - * - * @param string name of method - * @return integer error code "not implemented" - **/ - protected function handleNotImplementedMethod($fName = "") - { - trigger_error("Method ".$fName." called which is not implemented",E_USER_WARNING); - return tl::E_NOT_IMPLEMENTED; - } - - - /** - * useful to manage DB where TL table names must have a prefix. - * - * @param $tableNames array of tablenames, to get only some of the tables - * @return map key=table name without prefix, value=table name on db - * - */ - static public function getDBTables($tableNames = null) - { - $items = array( 'assignment_status', - 'assignment_types', - 'attachments', - 'baseline_l1l2_context', - 'baseline_l1l2_details', - 'builds', - 'cfield_build_design_values', - 'cfield_design_values', - 'cfield_execution_values', - 'cfield_node_types', - 'cfield_testplan_design_values', - 'cfield_testprojects', - 'custom_fields', - 'db_version', - 'events', - 'execution_bugs', - 'execution_tcsteps', - 'executions', - 'inventory', - 'issuetrackers', - 'testproject_issuetracker', - 'codetrackers', - 'testproject_codetracker', - 'keywords', - 'milestones', - 'node_types', - 'nodes_hierarchy', - 'object_keywords', - 'platforms', - 'plugins', - 'plugins_configuration', - 'req_coverage', - 'req_relations', - 'req_specs', - 'req_specs_revisions', - 'reqmgrsystems', - 'testproject_reqmgrsystem', - 'requirements', - 'req_versions', - 'req_revisions', - 'req_notify_assignments', - 'req_monitor', - 'rights', - 'risk_assignments', - 'role_rights', - 'roles', - 'testcase_relations', - 'tcversions', - 'tcsteps', - 'testcase_keywords', - 'testcase_platforms', - 'testplan_platforms' , - 'testcase_script_links', - 'testplan_tcversions' , - 'testplans' , - 'testprojects', - 'testsuites', - 'text_templates', - 'transactions', - 'user_assignments', - 'user_group', - 'user_group_assign', - 'user_testplan_roles', - 'user_testproject_roles', - 'users', - 'execution_tcsteps_wip' - ); - - $tables = array(); - foreach($items as $tblKey) { - $tables[$tblKey] = DB_TABLE_PREFIX . $tblKey; - } - - if ($tableNames != null) { - $tableNames = (array)$tableNames; - $tableNames = array_flip($tableNames); - $tables = array_intersect_key($tables,$tableNames); - if (sizeof($tables) != sizeof($tableNames)) { - throw new Exception("Wrong table name(s) for getDBTables() detected!"); - } - } - - return $tables; - } - - /** - * - */ - static public function getDBViews($itemNames = null) - { - $items = array('tcversions_last_active' => null, - 'tcversions_without_keywords' => null, - 'tcversions_without_platforms' => null, - 'latest_exec_by_context' => null, - 'latest_exec_by_testplan' => null, - 'latest_exec_by_testplan_plat' => null, - 'latest_tcase_version_id' => null, - 'latest_tcase_version_number' => null, - 'latest_req_version' => null, - 'latest_req_version_id' => null, - 'latest_rspec_revision' => null, - 'tsuites_tree_depth_2' => null, - 'exec_by_date_time' => null, - 'exec_daily_stats' => null); - - foreach($items as $key => $value) { - $items[$key] = DB_TABLE_PREFIX . $key; - } - - if ($itemNames != null) { - $itemNames = (array)$itemNames; - $itemNames = array_flip($itemNames); - $items = array_intersect_key($items,$itemNames); - if (sizeof($items) != sizeof($itemNames)) { - $msg = "Wrong view name(s) for " . __FUNCTION__ . " detected!"; - throw new Exception($msg); - } - } - - return $items; - } - -} - - -/** - * The base class for all managed TestLink objects which need a db connection - * - * @package TestLink - * @abstract - */ -abstract class tlObjectWithDB extends tlObject -{ - /** @var resource the db connection to the testlink database */ - protected $db; - - /** - * Class contructor - * @param object [ref] $db the database connection - */ - function __construct(&$db) - { - tlObject::__construct(); - $this->db = &$db; - } - - function setDB(&$db) - { - $this->db = &$db; - } - -} - -/** - * The base class for all managed TestLink objects which support attachments - * - * @package TestLink - * @abstract - */ -abstract class tlObjectWithAttachments extends tlObjectWithDB -{ - /** @var object the attachment repository object */ - protected $attachmentRepository; - - /** @var string the foreign key table name to store the attachements */ - protected $attachmentTableName; - - /** - * 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; - } - - /** - * gets all infos about the attachments of the object specified by $id - * - * @param integer $id this is the fkid of the attachments table - * @return array returns map with the infos of the attachment, - * keys are the column names of the attachments table - * - * @TODO schlundus: legacy function to keep existing code, should be replaced by a - * function which returns objects - */ - function getAttachmentInfos($id) - { - return $this->attachmentRepository->getAttachmentInfosFor($id,$this->attachmentTableName); - } - - /** - * deletes all attachments of the object specified by $id - * - * @param int $id this is the fkid of the attachments table - * @return returns tl::OK on success, else error code - */ - function deleteAttachments($id) - { - return $this->attachmentRepository->deleteAttachmentsFor($id,$this->attachmentTableName); - } - - /** - * function used for resetting the object's internal data - **/ - protected function _clean() - { - $this->attachmentRepository = null; - $this->attachmentTableName = null; - } - - function getAttachmentTableName() - { - return $this->attachmentTableName; - } - -} - - -/** - * class implement basic support for work with DB - * - * @package TestLink - * @abstract - */ -abstract class tlDBObject extends tlObject implements iDBSerialization -{ - /** - * @var array this is the static object cache for all tlDBObject. objects are stored like this - * [classname][detailLevel][databaseID] - */ - static protected $objectCache = null; - - /** - * @var boolean activate Caching or not, default is set to false, because it all brings performance to certain - * objects - */ - protected $activateCaching = false; - - /** - * @var integer the database id of the object - */ - public $dbID; - - /** - * @var int the detail level, used to configure how much information - * about the object is read from the database - */ - protected $detailLevel; - - /** standard get option, all other get options must be greater than this */ - const TLOBJ_O_SEARCH_BY_ID = 1; - - //standard detail levels, can be used to get only some specific details when reading an object - //to avoid unneccessary DB queries (when the info is actual not used and not needed) - const TLOBJ_O_GET_DETAIL_MINIMUM = 0; - - //get all information - const TLOBJ_O_GET_DETAIL_FULL = 0xFFFFFFFF; - - /** - * Class constructor - * - * @param integer $dbID (optional) the database identifier - */ - function __construct($dbID = null) - { - parent::__construct(); - - $this->dbID = $dbID; - $this->detailLevel = self::TLOBJ_O_GET_DETAIL_FULL; - } - - /** - * if we fetch an object, we can set here different details levels for the objects, because we - * don't always need all nested data - - * @param $level integer any combination of TLOBJ_O_GET_DETAIL_? constancts - */ - public function setDetailLevel($level = self::TLOBJ_O_GET_DETAIL_FULL) - { - $this->detailLevel = $level; - } - - /* some factory functions to be used to create tl managed objects */ - /** - * creates any tl-managed objects - * - * @param object [ref] $db the database connection - * @param int $id the id of the object to be created (must exist in the database) - * @param string $className the class name of the object - * @param int $options some additional options for creating the options (these are class specific) - * @param int $detailLevel the detail level of the object - * - * @return the newly created object on success, or null else - */ - static public function createObjectFromDB(&$db,$id,$className, - $options = self::TLOBJ_O_SEARCH_BY_ID, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) { - if ($id) { - $item = new $className($id); - $item->setDetailLevel($detailLevel); - if ($item->readFromDB($db,$options) >= tl::OK) { - return $item; - } - } - return null; - } - - /** - * used to create any tl-managed objects - * - * @param object [ref] $db the database connection - * @param string $query the ids of the objects to be created are obtained by this query - * @param string $column the name of the column which delivers the ids - * @param string $className the class name of the objects - * @param boolean $returnAsMap if set to true, to objects are returned in a - * map whose keys are the ids, else they are returned in a normal array. - - * @param int $detailLevel the detail level of the object - * - * @return the newly created objects on success, or null else - */ - static public function createObjectsFromDBbySQL(&$db,$query,$column,$className,$returnAsMap = false, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL,$limit = -1) - { - $ids = $db->fetchColumnsIntoArray($query,$column,$limit); - return self::createObjectsFromDB($db,$ids,$className,$returnAsMap,$detailLevel); - } - - /** - * used to create any tl-managed objects - * - * @param object [ref] $db the database connection - * @param array $ids the ids of the objects to be created - * @param string $className the class name of the objects - * @param boolean $returnAsMap if set to true, to objects are returned in a - * map whose keys are the ids, else they are returned in a normal array. - * @param integer $detailLevel the detail level of the object - * - * @return mixed the newly created objects on success, or null else - */ - static public function createObjectsFromDB(&$db,$ids,$className,$returnAsMap = false, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - $items = null; - - if (in_array("iDBBulkReadSerialization",class_implements($className))) - $items = self::bulkCreateObjectsFromDB($db,$ids,$className,$returnAsMap,$detailLevel); - else - { - for($i = 0;$i < sizeof((array)$ids);$i++) - { - $id = $ids[$i]; - $item = self::createObjectFromDB($db,$id,$className,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - if ($item) - { - if ($returnAsMap) - { - $items[$id] = $item; - } - else - { - $items[] = $item; - } - } - } - } - return $items; - } - - /** - * used to bulk-create tl-managed objects which support the "iDBBulkReadSerialization"-Interface - * - * @param object [ref] $db the database connection - * @param array $ids the ids of the objects to be created - * @param string $className the class name of the objects - * @param boolean $returnAsMap if set to true, to objects are returned in a - * map whose keys are the ids, else they are returned in a normal array. - * @param integer $detailLevel the detail level of the object - * - * @return mixed the newly created objects on success, or null else - */ - static public function bulkCreateObjectsFromDB(&$db,$ids,$className,$returnAsMap = false, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - $items = null; - if (null != $ids && sizeof($ids)) { - $dummyItem = new $className(); - $query = $dummyItem->getReadFromDBQuery($ids,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - $result = $db->exec_query($query); - if ($result) { - while($row = $db->fetch_array($result)) { - $item = new $className(); - $item->readFromDBRow($row); - - if ($returnAsMap) { - $items[$item->dbID] = $item; - } else { - $items[] = $item; - } - } - } - } - return $items; - } - - /** - * deletes an tl-Managed object from the DB - * - * @param object [rerf] $db the database connection - * @param int $id the database-id of the object which should be deleted - * @param string $className the class name of the object - * - * @return integer result code - */ - static public function deleteObjectFromDB(&$db,$id,$className) { - if ($id) { - $item = new $className($id); - return $item->deleteFromDB($db); - } - return tl::ERROR; - } - - /** - * Adds the object to the cache if caching is activated - * - * @return integer returns always tl::OK - */ - protected function addToCache() { - if ($this->activateCaching) { - self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID] = $this; - } - return tl::OK; - } - - /** - * Remove the object from the cache - * - * @return integer returns always tl::OK - */ - protected function removeFromCache() { - if ($this->activateCaching) { - unset(self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID]); - } - return tl::OK; - } - - /** - * Dummy implementation, each cachable object needs only to implement this function - * The function must read the members (but not the internal ones) from object and copy it to itself - * - * @param $object the object to read from - * @return integer returns always tl::OK - */ - protected function copyFromCache($object) { - return tl::OK; - } - - /** - * @return integer returns tl::ERROR if caching is not activated or a cache miss happens - * else it returns the result of copyFromCache - */ - public function readFromCache() { - if (!$this->activateCaching) { - return tl::ERROR; - } - - if (isset(self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID])) { - $object = self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID]; - return $this->copyFromCache($object); - } - return tl::ERROR; - } += tl::OK, and for ERROR with < tl::OK + */ + const OK = 1; + + /** + * error and status codes: + * all ERROR error codes and ERROR status codes should be lesser than tl::ERROR + * so we can check for ERRORS with <= tl::ERROR, and for SUCCESS with > tl::ERROR + */ + const ERROR = 0; + + /** + * error and status codes: + * return code for not implemented interface functions + */ + const E_NOT_IMPLEMENTED = - 0xFFFFFFFF; +} + +require_once 'int_serialization.php'; + +/** + * Base class for all managed TestLink objects, all tl-managed objects should extend this base class + * + * @package TestLink + * @abstract + */ +abstract class tlObject implements iSerialization +{ + + /** @var string the unique object id */ + protected $objectID; + + /** + * + * @var string a message for user feedback + */ + protected $userFeedback; + + /** + * + * @var array supported serialization interfaces + */ + protected $serializationInterfaces; + + /** + * + * @var array of format descriptors for the interfaces + */ + protected $serializationFormatDescriptors; + + /** + * + * @var array useful to manage DB where TL table names must have a prefix. + * key: table name WITHOUT prefix + * value: table name WITH PREFIX + * @see getDBTables() + */ + protected $tables = null; + + /** + * + * @var array useful to manage DB where TL view names must have a prefix. + * key: view name WITHOUT prefix + * value: view name WITH PREFIX + * @see getDBViews() + */ + protected $views = null; + + protected $auditCfg; + + /** + * class constructor + */ + public function __construct() + { + if (! isset($this->tables)) { + $this->tables = self::getDBTables(); + $this->views = self::getDBViews(); + } + + $this->objectID = str_replace(".", "", uniqid("", true)); + + $this->auditCfg = new stdClass(); + $this->auditCfg->eventSource = 'GUI'; + $this->auditCfg->logEnabled = true; + + /* + * Any supported import/Export Serialization Interface must be prefixed with iSerializationTo + * so we can automatically detected the interfaces + */ + $prefix = "iSerializationTo"; + $prefixLen = strlen($prefix); + $o = new ReflectionObject($this); + $interfaces = $o->getInterfaces(); + $this->serializationInterfaces = null; + $this->serializationFormatDescriptors = null; + if ($interfaces) { + foreach ($interfaces as $name => $info) { + $iPos = strpos($name, $prefix); + if ($iPos === 0) { + $format = substr($name, $prefixLen); + $this->serializationInterfaces[$name] = $format; + $pfn = "getFormatDescriptionFor" . $format; + $this->serializationFormatDescriptors[$format] = $this->$pfn(); + } + } + } + $this->getSupportedSerializationFormatDescriptions(); + } + + /** + */ + public function setAuditLogOn() + { + $this->auditCfg->logEnabled = true; + } + + /** + */ + public function setAuditLogOff() + { + $this->auditCfg->logEnabled = false; + } + + /** + */ + public function setAuditEventSource($val) + { + $this->auditCfg->eventSource = $val; + } + + /** + * get a message for user + */ + public function getUserFeedback() + { + return $this->userFeedback; + } + + /** + * Set a message for user + * + * @param string $message + * a localized message as user feedback + */ + public function setUserFeedback($message) + { + $this->userFeedback = $message; + } + + /** + * Getter for the unique objectID + * + * @return string the ID of the object + */ + public function getObjectID() + { + return $this->objectID; + } + + /** + * class destructor + */ + public function __destruct() + { + $this->_clean(); + } + + /** + * magic method for usage with print() or echo() , dumps out the object + * + * @return string a dump of the object + */ + public function __toString() + { + return __CLASS__ . ", " . print_r($this, true); + } + + /** + * function used for resetting the object's internal data + */ + protected function _clean() + {} + + /** + * Gets all serializationInterfaces the object supports + * + * @return all supported Import/Export Interfaces + */ + public function getSupportedSerializationInterfaces() + { + return $this->serializationInterfaces; + } + + /** + * + * @return all supported Import/Export Interfaces - Format Descriptors + */ + public function getSupportedSerializationFormatDescriptions() + { + return $this->serializationFormatDescriptors; + } + + /** + * should be called whenever a not implemented method is called + * + * @param + * string name of method + * @return integer error code "not implemented" + */ + protected function handleNotImplementedMethod($fName = "") + { + trigger_error("Method " . $fName . " called which is not implemented", + E_USER_WARNING); + return tl::E_NOT_IMPLEMENTED; + } + + /** + * useful to manage DB where TL table names must have a prefix. + * + * @param $tableNames array + * of tablenames, to get only some of the tables + * @return map key=table name without prefix, value=table name on db + * + */ + public static function getDBTables($tableNames = null) + { + $items = array( + 'assignment_status', + 'assignment_types', + 'attachments', + 'baseline_l1l2_context', + 'baseline_l1l2_details', + 'builds', + 'cfield_build_design_values', + 'cfield_design_values', + 'cfield_execution_values', + 'cfield_node_types', + 'cfield_testplan_design_values', + 'cfield_testprojects', + 'custom_fields', + 'db_version', + 'events', + 'execution_bugs', + 'execution_tcsteps', + 'executions', + 'inventory', + 'issuetrackers', + 'testproject_issuetracker', + 'codetrackers', + 'testproject_codetracker', + 'keywords', + 'milestones', + 'node_types', + 'nodes_hierarchy', + 'object_keywords', + 'platforms', + 'plugins', + 'plugins_configuration', + 'req_coverage', + 'req_relations', + 'req_specs', + 'req_specs_revisions', + 'reqmgrsystems', + 'testproject_reqmgrsystem', + 'requirements', + 'req_versions', + 'req_revisions', + 'req_notify_assignments', + 'req_monitor', + 'rights', + 'risk_assignments', + 'role_rights', + 'roles', + 'testcase_relations', + 'tcversions', + 'tcsteps', + 'testcase_keywords', + 'testcase_platforms', + 'testplan_platforms', + 'testcase_script_links', + 'testplan_tcversions', + 'testplans', + 'testprojects', + 'testsuites', + 'text_templates', + 'transactions', + 'user_assignments', + 'user_group', + 'user_group_assign', + 'user_testplan_roles', + 'user_testproject_roles', + 'users', + 'execution_tcsteps_wip' + ); + + $tables = array(); + foreach ($items as $tblKey) { + $tables[$tblKey] = DB_TABLE_PREFIX . $tblKey; + } + + if ($tableNames != null) { + $tableNames = (array) $tableNames; + $tableNames = array_flip($tableNames); + $tables = array_intersect_key($tables, $tableNames); + if (count($tables) != count($tableNames)) { + throw new Exception( + "Wrong table name(s) for getDBTables() detected!"); + } + } + + return $tables; + } + + /** + */ + public static function getDBViews($itemNames = null) + { + $items = array( + 'tcversions_last_active' => null, + 'tcversions_without_keywords' => null, + 'tcversions_without_platforms' => null, + 'latest_exec_by_context' => null, + 'latest_exec_by_testplan' => null, + 'latest_exec_by_testplan_plat' => null, + 'latest_tcase_version_id' => null, + 'latest_tcase_version_number' => null, + 'latest_req_version' => null, + 'latest_req_version_id' => null, + 'latest_rspec_revision' => null, + 'tsuites_tree_depth_2' => null, + 'exec_by_date_time' => null, + 'exec_daily_stats' => null + ); + + foreach ($items as $key => $value) { + $items[$key] = DB_TABLE_PREFIX . $key; + } + + if ($itemNames != null) { + $itemNames = (array) $itemNames; + $itemNames = array_flip($itemNames); + $items = array_intersect_key($items, $itemNames); + if (count($items) != count($itemNames)) { + $msg = "Wrong view name(s) for " . __FUNCTION__ . " detected!"; + throw new Exception($msg); + } + } + + return $items; + } +} + +/** + * The base class for all managed TestLink objects which need a db connection + * + * @package TestLink + * @abstract + */ +abstract class tlObjectWithDB extends tlObject +{ + + /** @var resource the db connection to the testlink database */ + protected $db; + + /** + * Class contructor + * + * @param + * object [ref] $db the database connection + */ + public function __construct(&$db) + { + tlObject::__construct(); + $this->db = &$db; + } + + public function setDB(&$db) + { + $this->db = &$db; + } +} + +/** + * The base class for all managed TestLink objects which support attachments + * + * @package TestLink + * @abstract + */ +abstract class tlObjectWithAttachments extends tlObjectWithDB +{ + + /** @var object the attachment repository object */ + protected $attachmentRepository; + + /** @var string the foreign key table name to store the attachements */ + protected $attachmentTableName; + + /** + * Class constructor + * + * @param + * object [ref] $db the database connection + * @param string $attachmentTableName + * the foreign key table name to store the attachments + */ + public function __construct(&$db, $attachmentTableName) + { + tlObjectWithDB::__construct($db); + $this->attachmentRepository = tlAttachmentRepository::create($this->db); + $this->attachmentTableName = $attachmentTableName; + } + + /** + * gets all infos about the attachments of the object specified by $id + * + * @param integer $id + * this is the fkid of the attachments table + * @return array returns map with the infos of the attachment, + * keys are the column names of the attachments table + * + * @todo schlundus: legacy function to keep existing code, should be replaced by a + * function which returns objects + */ + public function getAttachmentInfos($id) + { + return $this->attachmentRepository->getAttachmentInfosFor($id, + $this->attachmentTableName); + } + + /** + * deletes all attachments of the object specified by $id + * + * @param int $id + * this is the fkid of the attachments table + * @return returns tl::OK on success, else error code + */ + public function deleteAttachments($id) + { + return $this->attachmentRepository->deleteAttachmentsFor($id, + $this->attachmentTableName); + } + + /** + * function used for resetting the object's internal data + */ + protected function _clean() + { + $this->attachmentRepository = null; + $this->attachmentTableName = null; + } + + public function getAttachmentTableName() + { + return $this->attachmentTableName; + } +} + +/** + * class implement basic support for work with DB + * + * @package TestLink + * @abstract + */ +abstract class tlDBObject extends tlObject implements iDBSerialization +{ + + /** + * + * @var array this is the static object cache for all tlDBObject. objects are stored like this + * [classname][detailLevel][databaseID] + */ + protected static $objectCache = null; + + /** + * + * @var boolean activate Caching or not, default is set to false, because it all brings performance to certain + * objects + */ + protected $activateCaching = false; + + /** + * + * @var integer the database id of the object + */ + public $dbID; + + /** + * + * @var int the detail level, used to configure how much information + * about the object is read from the database + */ + protected $detailLevel; + + /** + * standard get option, all other get options must be greater than this + */ + const TLOBJ_O_SEARCH_BY_ID = 1; + + // standard detail levels, can be used to get only some specific details when reading an object + // to avoid unneccessary DB queries (when the info is actual not used and not needed) + const TLOBJ_O_GET_DETAIL_MINIMUM = 0; + + // get all information + const TLOBJ_O_GET_DETAIL_FULL = 0xFFFFFFFF; + + /** + * Class constructor + * + * @param integer $dbID + * (optional) the database identifier + */ + public function __construct($dbID = null) + { + parent::__construct(); + + $this->dbID = $dbID; + $this->detailLevel = self::TLOBJ_O_GET_DETAIL_FULL; + } + + /** + * if we fetch an object, we can set here different details levels for the objects, because we + * don't always need all nested data + * + * @param $level integer + * any combination of TLOBJ_O_GET_DETAIL_? constancts + */ + public function setDetailLevel($level = self::TLOBJ_O_GET_DETAIL_FULL) + { + $this->detailLevel = $level; + } + + /* some factory functions to be used to create tl managed objects */ + /** + * creates any tl-managed objects + * + * @param + * object [ref] $db the database connection + * @param int $id + * the id of the object to be created (must exist in the database) + * @param string $className + * the class name of the object + * @param int $options + * some additional options for creating the options (these are class specific) + * @param int $detailLevel + * the detail level of the object + * + * @return the newly created object on success, or null else + */ + public static function createObjectFromDB(&$db, $id, $className, + $options = self::TLOBJ_O_SEARCH_BY_ID, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + if ($id) { + $item = new $className($id); + $item->setDetailLevel($detailLevel); + if ($item->readFromDB($db, $options) >= tl::OK) { + return $item; + } + } + return null; + } + + /** + * used to create any tl-managed objects + * + * @param + * object [ref] $db the database connection + * @param string $query + * the ids of the objects to be created are obtained by this query + * @param string $column + * the name of the column which delivers the ids + * @param string $className + * the class name of the objects + * @param boolean $returnAsMap + * if set to true, to objects are returned in a + * map whose keys are the ids, else they are returned in a normal array. + * + * @param int $detailLevel + * the detail level of the object + * + * @return the newly created objects on success, or null else + */ + public static function createObjectsFromDBbySQL(&$db, $query, $column, + $className, $returnAsMap = false, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL, $limit = - 1) + { + $ids = $db->fetchColumnsIntoArray($query, $column, $limit); + return self::createObjectsFromDB($db, $ids, $className, $returnAsMap, + $detailLevel); + } + + /** + * used to create any tl-managed objects + * + * @param + * object [ref] $db the database connection + * @param array $ids + * the ids of the objects to be created + * @param string $className + * the class name of the objects + * @param boolean $returnAsMap + * if set to true, to objects are returned in a + * map whose keys are the ids, else they are returned in a normal array. + * @param integer $detailLevel + * the detail level of the object + * + * @return mixed the newly created objects on success, or null else + */ + public static function createObjectsFromDB(&$db, $ids, $className, + $returnAsMap = false, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $items = null; + + if (in_array("iDBBulkReadSerialization", class_implements($className))) { + $items = self::bulkCreateObjectsFromDB($db, $ids, $className, + $returnAsMap, $detailLevel); + } else { + for ($i = 0; $i < count((array) $ids); $i ++) { + $id = $ids[$i]; + $item = self::createObjectFromDB($db, $id, $className, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + if ($item) { + if ($returnAsMap) { + $items[$id] = $item; + } else { + $items[] = $item; + } + } + } + } + return $items; + } + + /** + * used to bulk-create tl-managed objects which support the "iDBBulkReadSerialization"-Interface + * + * @param + * object [ref] $db the database connection + * @param array $ids + * the ids of the objects to be created + * @param string $className + * the class name of the objects + * @param boolean $returnAsMap + * if set to true, to objects are returned in a + * map whose keys are the ids, else they are returned in a normal array. + * @param integer $detailLevel + * the detail level of the object + * + * @return mixed the newly created objects on success, or null else + */ + public static function bulkCreateObjectsFromDB(&$db, $ids, $className, + $returnAsMap = false, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $items = null; + if (null != $ids && count($ids)) { + $dummyItem = new $className(); + $query = $dummyItem->getReadFromDBQuery($ids, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + $result = $db->exec_query($query); + if ($result) { + while ($row = $db->fetch_array($result)) { + $item = new $className(); + $item->readFromDBRow($row); + + if ($returnAsMap) { + $items[$item->dbID] = $item; + } else { + $items[] = $item; + } + } + } + } + return $items; + } + + /** + * deletes an tl-Managed object from the DB + * + * @param + * object [rerf] $db the database connection + * @param int $id + * the database-id of the object which should be deleted + * @param string $className + * the class name of the object + * + * @return integer result code + */ + public static function deleteObjectFromDB(&$db, $id, $className) + { + if ($id) { + $item = new $className($id); + return $item->deleteFromDB($db); + } + return tl::ERROR; + } + + /** + * Adds the object to the cache if caching is activated + * + * @return integer returns always tl::OK + */ + protected function addToCache() + { + if ($this->activateCaching) { + self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID] = $this; + } + return tl::OK; + } + + /** + * Remove the object from the cache + * + * @return integer returns always tl::OK + */ + protected function removeFromCache() + { + if ($this->activateCaching) { + unset( + self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID]); + } + return tl::OK; + } + + /** + * Dummy implementation, each cachable object needs only to implement this function + * The function must read the members (but not the internal ones) from object and copy it to itself + * + * @param $object the + * object to read from + * @return integer returns always tl::OK + */ + protected function copyFromCache($object) + { + return tl::OK; + } + + /** + * + * @return integer returns tl::ERROR if caching is not activated or a cache miss happens + * else it returns the result of copyFromCache + */ + public function readFromCache() + { + if (! $this->activateCaching) { + return tl::ERROR; + } + + if (isset( + self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID])) { + $object = self::$objectCache[get_class($this)][$this->detailLevel][$this->dbID]; + return $this->copyFromCache($object); + } + return tl::ERROR; + } } diff --git a/lib/functions/opt_transfer.php b/lib/functions/opt_transfer.php index af71da4af3..72a60aa629 100644 --- a/lib/functions/opt_transfer.php +++ b/lib/functions/opt_transfer.php @@ -1,172 +1,159 @@ -js_events->all_right_click="window.setTimeout('$js_ot_name.transferAllRight()',20);"; - $opt_cfg->js_events->left2right_click="window.setTimeout('$js_ot_name.transferRight()',20);"; - $opt_cfg->js_events->right2left_click="window.setTimeout('$js_ot_name.transferLeft()',20);"; - $opt_cfg->js_events->all_left_click="window.setTimeout('$js_ot_name.transferAllLeft()',20);"; - - - $a_right = array(); - $a_left = array(); - - if(trim($right_list) == "") - { - if(!is_null($opt_cfg->to->map)) - { - $a_right = $opt_cfg->to->map; - } - } - else - { - $a_k = explode(",",trim($right_list)); - foreach($a_k as $key => $code) - { - $a_right[$code] = $opt_cfg->from->map[$code]; - } - } - - if(!is_null($opt_cfg->from->map)) - { - $a_left = array_diff_assoc($opt_cfg->from->map,$a_right); - } - - $opt_cfg->from->map = $a_left; - $opt_cfg->to->map = $a_right; -} - - -function keywords_opt_transf_cfg(&$opt_cfg, $right_list) -{ - $opt_cfg->size = 8; - $opt_cfg->style = "width: 98%;"; - - $opt_cfg->js_events = new stdClass(); - $opt_cfg->js_events->all_right_click = ""; - $opt_cfg->js_events->left2right_click = ""; - $opt_cfg->js_events->right2left_click = ""; - $opt_cfg->js_events->all_left_click = ""; - - if( is_null($opt_cfg->from)) - { - $opt_cfg->from = new stdClass(); - } - $opt_cfg->from->name = "from_select_box"; - $opt_cfg->from->id_field = 'id'; - $opt_cfg->from->desc_field = 'keyword'; - $opt_cfg->from->desc_glue = " "; - $opt_cfg->from->desc_html_content = true; - $opt_cfg->from->required = false; - $opt_cfg->from->show_id_in_desc = true; - $opt_cfg->from->js_events->ondblclick = ""; - - if( is_null($opt_cfg->to)) - { - $opt_cfg->to = new stdClass(); - } - $opt_cfg->to->name = "to_select_box"; - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->id_field = 'id'; - $opt_cfg->to->desc_field = 'keyword'; - $opt_cfg->to->desc_glue = " "; - $opt_cfg->to->desc_html_content = true; - $opt_cfg->to->required = false; - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->js_events->ondblclick = ""; - - opt_transf_cfg($opt_cfg, $right_list,$opt_cfg->js_ot_name); -} - -function opt_transf_empty_cfg() -{ - $opt_cfg = new stdClass(); - $opt_cfg->js_ot_name = ""; - $opt_cfg->size = 8; - $opt_cfg->style = "width: 300px;"; - - $opt_cfg->js_events = new stdClass(); - $opt_cfg->js_events->all_right_click = ""; - $opt_cfg->js_events->left2right_click = ""; - $opt_cfg->js_events->right2left_click = ""; - $opt_cfg->js_events->all_left_click = ""; - - $opt_cfg->global_lbl = 'Option Transfer'; - $opt_cfg->from = new stdClass(); - $opt_cfg->from->lbl = 'from'; - $opt_cfg->from->name = "from_select_box"; - $opt_cfg->from->map = array(); - - $opt_cfg->from->id_field = ''; - $opt_cfg->from->desc_field = ''; - $opt_cfg->from->desc_glue = " "; - $opt_cfg->from->desc_html_content = true; - $opt_cfg->from->required = false; - $opt_cfg->from->show_id_in_desc = true; - $opt_cfg->from->js_events = new stdClass; - $opt_cfg->from->js_events->ondblclick = ""; - - $opt_cfg->to = new stdClass(); - $opt_cfg->to->lbl = 'to'; - $opt_cfg->to->name = "to_select_box"; - $opt_cfg->to->map = array(); - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->id_field = ''; - $opt_cfg->to->desc_field = ''; - $opt_cfg->to->desc_glue = " "; - $opt_cfg->to->desc_html_content = true; - $opt_cfg->to->required = false; - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->js_events = new stdClass(); - $opt_cfg->to->js_events->ondblclick = ""; - - return $opt_cfg; -} - -/** - * - * - */ -function item_opt_transf_cfg(&$opt_cfg, $right_list) -{ - $opt_cfg->size = 8; - $opt_cfg->style = "width: 98%;"; - - $opt_cfg->js_events->all_right_click = ""; - $opt_cfg->js_events->left2right_click = ""; - $opt_cfg->js_events->right2left_click = ""; - $opt_cfg->js_events->all_left_click = ""; - $opt_cfg->from->name = "from_select_box"; - - $opt_cfg->from->id_field = 'id'; - // $opt_cfg->from->desc_field = 'keyword'; - $opt_cfg->from->desc_glue = " "; - $opt_cfg->from->desc_html_content = true; - $opt_cfg->from->required = false; - $opt_cfg->from->show_id_in_desc = true; - $opt_cfg->from->js_events->ondblclick = ""; - - $opt_cfg->to->name = "to_select_box"; - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->id_field = 'id'; - //$opt_cfg->to->desc_field = 'keyword'; - $opt_cfg->to->desc_glue = " "; - $opt_cfg->to->desc_html_content = true; - $opt_cfg->to->required = false; - $opt_cfg->to->show_id_in_desc = true; - $opt_cfg->to->js_events->ondblclick = ""; - - opt_transf_cfg($opt_cfg, $right_list,$opt_cfg->js_ot_name); +js_events->all_right_click = "window.setTimeout('$js_ot_name.transferAllRight()',20);"; + $opt_cfg->js_events->left2right_click = "window.setTimeout('$js_ot_name.transferRight()',20);"; + $opt_cfg->js_events->right2left_click = "window.setTimeout('$js_ot_name.transferLeft()',20);"; + $opt_cfg->js_events->all_left_click = "window.setTimeout('$js_ot_name.transferAllLeft()',20);"; + + $a_right = array(); + $a_left = array(); + + if (trim($right_list) == "") { + if (! is_null($opt_cfg->to->map)) { + $a_right = $opt_cfg->to->map; + } + } else { + $a_k = explode(",", trim($right_list)); + foreach ($a_k as $code) { + $a_right[$code] = $opt_cfg->from->map[$code]; + } + } + + if (! is_null($opt_cfg->from->map)) { + $a_left = array_diff_assoc($opt_cfg->from->map, $a_right); + } + + $opt_cfg->from->map = $a_left; + $opt_cfg->to->map = $a_right; +} + +function keywords_opt_transf_cfg(&$opt_cfg, $right_list) +{ + $opt_cfg->size = 8; + $opt_cfg->style = "width: 98%;"; + + $opt_cfg->js_events = new stdClass(); + $opt_cfg->js_events->all_right_click = ""; + $opt_cfg->js_events->left2right_click = ""; + $opt_cfg->js_events->right2left_click = ""; + $opt_cfg->js_events->all_left_click = ""; + + if (is_null($opt_cfg->from)) { + $opt_cfg->from = new stdClass(); + } + $opt_cfg->from->name = "from_select_box"; + $opt_cfg->from->id_field = 'id'; + $opt_cfg->from->desc_field = 'keyword'; + $opt_cfg->from->desc_glue = " "; + $opt_cfg->from->desc_html_content = true; + $opt_cfg->from->required = false; + $opt_cfg->from->show_id_in_desc = true; + $opt_cfg->from->js_events->ondblclick = ""; + + if (is_null($opt_cfg->to)) { + $opt_cfg->to = new stdClass(); + } + $opt_cfg->to->name = "to_select_box"; + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->id_field = 'id'; + $opt_cfg->to->desc_field = 'keyword'; + $opt_cfg->to->desc_glue = " "; + $opt_cfg->to->desc_html_content = true; + $opt_cfg->to->required = false; + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->js_events->ondblclick = ""; + + opt_transf_cfg($opt_cfg, $right_list, $opt_cfg->js_ot_name); +} + +function opt_transf_empty_cfg() +{ + $opt_cfg = new stdClass(); + $opt_cfg->js_ot_name = ""; + $opt_cfg->size = 8; + $opt_cfg->style = "width: 300px;"; + + $opt_cfg->js_events = new stdClass(); + $opt_cfg->js_events->all_right_click = ""; + $opt_cfg->js_events->left2right_click = ""; + $opt_cfg->js_events->right2left_click = ""; + $opt_cfg->js_events->all_left_click = ""; + + $opt_cfg->global_lbl = 'Option Transfer'; + $opt_cfg->from = new stdClass(); + $opt_cfg->from->lbl = 'from'; + $opt_cfg->from->name = "from_select_box"; + $opt_cfg->from->map = array(); + + $opt_cfg->from->id_field = ''; + $opt_cfg->from->desc_field = ''; + $opt_cfg->from->desc_glue = " "; + $opt_cfg->from->desc_html_content = true; + $opt_cfg->from->required = false; + $opt_cfg->from->show_id_in_desc = true; + $opt_cfg->from->js_events = new stdClass(); + $opt_cfg->from->js_events->ondblclick = ""; + + $opt_cfg->to = new stdClass(); + $opt_cfg->to->lbl = 'to'; + $opt_cfg->to->name = "to_select_box"; + $opt_cfg->to->map = array(); + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->id_field = ''; + $opt_cfg->to->desc_field = ''; + $opt_cfg->to->desc_glue = " "; + $opt_cfg->to->desc_html_content = true; + $opt_cfg->to->required = false; + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->js_events = new stdClass(); + $opt_cfg->to->js_events->ondblclick = ""; + + return $opt_cfg; +} + +/** + */ +function item_opt_transf_cfg(&$opt_cfg, $right_list) +{ + $opt_cfg->size = 8; + $opt_cfg->style = "width: 98%;"; + + $opt_cfg->js_events->all_right_click = ""; + $opt_cfg->js_events->left2right_click = ""; + $opt_cfg->js_events->right2left_click = ""; + $opt_cfg->js_events->all_left_click = ""; + $opt_cfg->from->name = "from_select_box"; + + $opt_cfg->from->id_field = 'id'; + $opt_cfg->from->desc_glue = " "; + $opt_cfg->from->desc_html_content = true; + $opt_cfg->from->required = false; + $opt_cfg->from->show_id_in_desc = true; + $opt_cfg->from->js_events->ondblclick = ""; + + $opt_cfg->to->name = "to_select_box"; + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->id_field = 'id'; + $opt_cfg->to->desc_glue = " "; + $opt_cfg->to->desc_html_content = true; + $opt_cfg->to->required = false; + $opt_cfg->to->show_id_in_desc = true; + $opt_cfg->to->js_events->ondblclick = ""; + + opt_transf_cfg($opt_cfg, $right_list, $opt_cfg->js_ot_name); } diff --git a/lib/functions/pagestatistics.class.php b/lib/functions/pagestatistics.class.php index 352e2a130b..bbd3b9f0ba 100644 --- a/lib/functions/pagestatistics.class.php +++ b/lib/functions/pagestatistics.class.php @@ -1,237 +1,247 @@ -initialize(); - } - - /** - * initializes the page statistics, by starting the "OVERALL" Counter - */ - protected function initialize() - { - $this->startPerformanceCounter("OVERALL",tlPerformanceCounter::TYPE_ALL); - } - - /** - * starts a new performance counter with the given title and type - * - * @param string $title the title of the performance counter - * @param integer $type the type of the performance Counter, any combination of - * tlPerformanceCounter::TYPE_ Flags - */ - public function startPerformanceCounter($title,$type) - { - $this->performanceCounters[$title] = new tlPerformanceCounter($this->db,$type); - } - - /** - * Class destructor, echoes the contents of the counter - */ - public function __destruct() - { - echo (string) $this; - } - - /** - * Magic function called by php whenever a tlPageStatistics should be used as string - * - * @return string returns a string representation of the counter - */ - public function __toString() - { - $output = "
    "; - $output .= "Performance counters: \n
    "; - foreach($this->performanceCounters as $title => $counter) - { - $output .= "{$title}\n
    "; - $output .= "    {$counter}"; - } - $output .= "
    "; - - return $output; - - } -} - - -/** - * @package TestLink - * @author Andreas Morsing - * @since 1.9 - Jun, 2009 - */ -class tlPerformanceCounter extends tlObjectWithDB -{ - const TYPE_MEMORY = 1; - const TYPE_TIME = 2; - const TYPE_SQL = 4; - const TYPE_ALL = 0xFFFF; - - private $counterType = self::TYPE_ALL; - private $memoryPeak = 0; - private $memoryStart = 0; - private $memoryEnd = 0; - private $echoOnDestruct = false; - private $initialStart = 0; - private $duration = 0; - private $initialQueries = 0; - private $initialOverall = 0; - private $sqlQueries = 0; - private $sqlOverall = 0; - - function __construct(&$db,$type,$echoOnDestruct = false) - { - parent::__construct($db); - $this->counterType = $type; - $this->reset(); - $this->echoOnDestruct = $echoOnDestruct; - } - public function __destruct() - { - if ($this->echoOnDestruct) - { - $this->stop(); - echo $this; - } - } - - public function __toString() - { - $output = null; - if ($this->counterType & self::TYPE_MEMORY) - { - $this->updateMemory(); - $output .= "MEMORY: {$this->memoryStart} to {$this->memoryEnd} (max. Peak {$this->memoryPeak});\n"; - } - if ($this->counterType & self::TYPE_TIME) - { - $duration = $this->getDuration(); - $output .= "DURATION: {$duration} secs;\n"; - } - if ($this->counterType & self::TYPE_SQL) - { - $this->updateSQL(); - $output .= "SQL queries: ".($this->sqlQueries).";\n"; - $output .= "took ".$this->sqlOverall." secs;\n"; - } - return $output; - } - - public function getDuration() - { - $current = $this->getmicrotime(); - return ($current - $this->initialStart); - } - - public function reset() - { - $this->resetTimer(); - $this->resetMemory(); - $this->resetSQL(); - } - - public function resetTimer() - { - if ($this->counterType & self::TYPE_TIME) - { - $this->initialStart = $this->getmicrotime(); - $this->duration = 0; - } - } - - public function resetMemory() - { - if ($this->counterType & self::TYPE_MEMORY) - { - $this->memoryStart = memory_get_usage(true); - $this->memoryEnd = 0; - $this->memoryPeak = memory_get_peak_usage(true); - } - } - - public function resetSQL() - { - if ($this->counterType & self::TYPE_SQL) - { - $this->initialOverall = $this->db->overallDuration; - $this->initialQueries = $this->db->nQuery; - } - } - - public function stop() - { - $this->stopTimer(); - $this->updateMemory(); - $this->updateSQL(); - } - - protected function updateMemory() - { - if ($this->counterType & self::TYPE_MEMORY) - { - $this->memoryEnd = memory_get_usage(true); - $this->memoryPeak = memory_get_peak_usage(true); - } - } - - protected function updateSQL() - { - if ($this->counterType & self::TYPE_SQL) - { - $this->sqlOverall = $this->db->overallDuration - $this->initialOverall; - $this->sqlQueries = $this->db->nQuery - $this->initialQueries; - } - } - - public function stopTimer() - { - if ($this->counterType & self::TYPE_TIME) - { - $current = $this->getmicrotime(); - $this->duration = ($current - $this->initialStart); - } - } - - protected function getmicrotime() - { - $t = microtime(); - $t = explode(' ',$t); - return (float)$t[1]+ (float)$t[0]; - } -} -?> \ No newline at end of file +initialize(); + } + + /** + * initializes the page statistics, by starting the "OVERALL" Counter + */ + protected function initialize() + { + $this->startPerformanceCounter("OVERALL", tlPerformanceCounter::TYPE_ALL); + } + + /** + * starts a new performance counter with the given title and type + * + * @param string $title + * the title of the performance counter + * @param integer $type + * the type of the performance Counter, any combination of + * tlPerformanceCounter::TYPE_ Flags + */ + public function startPerformanceCounter($title, $type) + { + $this->performanceCounters[$title] = new tlPerformanceCounter($this->db, + $type); + } + + /** + * Class destructor, echoes the contents of the counter + */ + public function __destruct() + { + echo (string) $this; + } + + /** + * Magic function called by php whenever a tlPageStatistics should be used as string + * + * @return string returns a string representation of the counter + */ + public function __toString() + { + $output = "
    "; + $output .= "Performance counters: \n
    "; + foreach ($this->performanceCounters as $title => $counter) { + $output .= "{$title}\n
    "; + $output .= "    {$counter}"; + } + $output .= "
    "; + + return $output; + } +} + +/** + * + * @package TestLink + * @author Andreas Morsing + * @since 1.9 - Jun, 2009 + */ +class tlPerformanceCounter extends tlObjectWithDB +{ + + const TYPE_MEMORY = 1; + + const TYPE_TIME = 2; + + const TYPE_SQL = 4; + + const TYPE_ALL = 0xFFFF; + + private $counterType = self::TYPE_ALL; + + private $memoryPeak = 0; + + private $memoryStart = 0; + + private $memoryEnd = 0; + + private $echoOnDestruct = false; + + private $initialStart = 0; + + private $duration = 0; + + private $initialQueries = 0; + + private $initialOverall = 0; + + private $sqlQueries = 0; + + private $sqlOverall = 0; + + private function __construct(&$db, $type, $echoOnDestruct = false) + { + parent::__construct($db); + $this->counterType = $type; + $this->reset(); + $this->echoOnDestruct = $echoOnDestruct; + } + + public function __destruct() + { + if ($this->echoOnDestruct) { + $this->stop(); + echo $this; + } + } + + public function __toString() + { + $output = null; + if ($this->counterType & self::TYPE_MEMORY) { + $this->updateMemory(); + $output .= "MEMORY: {$this->memoryStart} to {$this->memoryEnd} (max. Peak {$this->memoryPeak});\n"; + } + if ($this->counterType & self::TYPE_TIME) { + $duration = $this->getDuration(); + $output .= "DURATION: {$duration} secs;\n"; + } + if ($this->counterType & self::TYPE_SQL) { + $this->updateSQL(); + $output .= "SQL queries: " . ($this->sqlQueries) . ";\n"; + $output .= "took " . $this->sqlOverall . " secs;\n"; + } + return $output; + } + + public function getDuration() + { + $current = $this->getmicrotime(); + return $current - $this->initialStart; + } + + public function reset() + { + $this->resetTimer(); + $this->resetMemory(); + $this->resetSQL(); + } + + public function resetTimer() + { + if ($this->counterType & self::TYPE_TIME) { + $this->initialStart = $this->getmicrotime(); + $this->duration = 0; + } + } + + public function resetMemory() + { + if ($this->counterType & self::TYPE_MEMORY) { + $this->memoryStart = memory_get_usage(true); + $this->memoryEnd = 0; + $this->memoryPeak = memory_get_peak_usage(true); + } + } + + public function resetSQL() + { + if ($this->counterType & self::TYPE_SQL) { + $this->initialOverall = $this->db->overallDuration; + $this->initialQueries = $this->db->nQuery; + } + } + + public function stop() + { + $this->stopTimer(); + $this->updateMemory(); + $this->updateSQL(); + } + + protected function updateMemory() + { + if ($this->counterType & self::TYPE_MEMORY) { + $this->memoryEnd = memory_get_usage(true); + $this->memoryPeak = memory_get_peak_usage(true); + } + } + + protected function updateSQL() + { + if ($this->counterType & self::TYPE_SQL) { + $this->sqlOverall = $this->db->overallDuration - + $this->initialOverall; + $this->sqlQueries = $this->db->nQuery - $this->initialQueries; + } + } + + public function stopTimer() + { + if ($this->counterType & self::TYPE_TIME) { + $current = $this->getmicrotime(); + $this->duration = ($current - $this->initialStart); + } + } + + protected function getmicrotime() + { + $t = microtime(); + $t = explode(' ', $t); + return (float) $t[1] + (float) $t[0]; + } +} +?> diff --git a/lib/functions/plugin_api.php b/lib/functions/plugin_api.php index fe66616126..6d21c7c812 100644 --- a/lib/functions/plugin_api.php +++ b/lib/functions/plugin_api.php @@ -1,625 +1,637 @@ -prepare_string($full_option); - - $sql = "/* $debugMsg */ " . - " SELECT config_value FROM " . $tables['plugins_configuration'] . - " where config_key = '" . $full_option . "' AND testproject_id = "; - - $value = $dbHandler->fetchOneValue($sql . intval($project)); - - if (is_null($value) && $project != TL_ANY_PROJECT) - { - // Check if its in the Global Project - $value = $dbHandler->fetchOneValue($sql . TL_ANY_PROJECT); - } - - if (is_null($value)) - { - // Fetch from the Global list, and if not, fetch from default value - global $g_plugin_config_cache; - $value = array_key_exists($full_option, $g_plugin_config_cache) ? $g_plugin_config_cache[$full_option] : $default; - } - return $value; -} - -/** - * Set a plugin configuration option in the database. - * @param string Configuration option name - * @param multi Option value - * @param int User ID - * @param int Project ID - * @param int Access threshold - */ -function plugin_config_set($option, $value, $project = TL_ANY_PROJECT) -{ - doDBConnect($dbHandler); - $tables = tlObjectWithDB::getDBTables(array('plugins_configuration')); - $plugin_config_table = $tables['plugins_configuration']; - - $basename = plugin_get_current(); - $full_option = 'plugin_' . $basename . '_' . $option; - - if (is_array($value) || is_object($value)) - { - $config_type = CONFIG_TYPE_COMPLEX; - $value = serialize($value); - } - else if (is_float($value)) - { - $config_type = CONFIG_TYPE_FLOAT; - $value = (float)$value; - } - else if (is_int($value) || is_numeric($value)) - { - $config_type = CONFIG_TYPE_INT; - $value = $dbHandler->prepare_int($value); - } - else - { - $config_type = CONFIG_TYPE_STRING; - } - - - $safe_id = intval($project); - $sql = " SELECT COUNT(*) from $plugin_config_table " . - " WHERE config_key = '" . $dbHandler->prepare_string($full_option) . "' " . - " AND testproject_id = {$safe_id} "; - $rows_exist = $dbHandler->fetchOneValue($sql); - - if ($rows_exist > 0) - { - // Update the existing record - $sql = " UPDATE $plugin_config_table " . - " SET config_value = '" . $dbHandler->prepare_string($value) . "'," . - " config_type = " . $config_type . - " WHERE config_key = '" . $dbHandler->prepare_string($full_option) . "' " . - " AND testproject_id = {$safe_id} "; - } - else - { - // Insert new config value - $sql = " INSERT INTO $plugin_config_table " . - " (config_key, config_type, config_value, testproject_id, author_id) " . - " VALUES (" . - "'" . $dbHandler->prepare_string($full_option) . "', " . - $config_type . "," . - "'" . $dbHandler->prepare_string($value) . "', " . - $safe_id . ", " . $_SESSION['currentUser']->dbID . ")"; - } - $dbHandler->exec_query($sql); -} - -/** - * Set plugin default values to global values without overriding anything. - * @param array Array of configuration option name/value pairs. - */ -function plugin_config_defaults($options) -{ - global $g_plugin_config_cache; - if (!is_array($options)) - { - return; - } - - $basename = plugin_get_current(); - $option_base = 'plugin_' . $basename . '_'; - - foreach ($options as $option => $value) - { - $full_option = $option_base . $option; - $g_plugin_config_cache[$full_option] = $value; - } -} - -/** - * Get a language string for the plugin. - * Automatically prepends plugin_ to the string requested. - * @param string Language string name - * @param string Plugin basename - * @return string Language string - */ -function plugin_lang_get($p_name, $p_basename = null) -{ - if (!is_null($p_basename)) - { - plugin_push_current($p_basename); - } - - $t_basename = plugin_get_current(); - $t_name = 'plugin_' . $t_basename . '_' . $p_name; - $t_string = lang_get($t_name); - - if (!is_null($p_basename)) - { - plugin_pop_current(); - } - return $t_string; -} - -/** - * Hook a plugin's callback function to an event. - * @param string Event name - * @param string Callback function - */ -function plugin_event_hook($p_name, $p_callback) -{ - $t_basename = plugin_get_current(); - event_hook($p_name, $p_callback, $t_basename); -} - -/** - * Hook multiple plugin callbacks at once. - * @param array Array of event name/callback key/value pairs - */ -function plugin_event_hook_many($p_hooks) -{ - if (!is_array($p_hooks)) - { - return; - } - - $t_basename = plugin_get_current(); - - foreach ($p_hooks as $t_event => $t_callbacks) - { - if (!is_array($t_callbacks)) - { - event_hook($t_event, $t_callbacks, $t_basename); - continue; - } - - foreach ($t_callbacks as $t_callback) - { - event_hook($t_event, $t_callback, $t_basename); - } - } -} - -# ## Plugin Management Helpers - -/** - * Checks if a given plugin has been registered and initialized, - * and returns a boolean value representing the "loaded" state. - * @param string Plugin basename - * @return boolean Plugin loaded - */ -function plugin_is_loaded($p_basename) -{ - global $g_plugin_cache_init; - - return (isset($g_plugin_cache_init[$p_basename]) && $g_plugin_cache_init[$p_basename]); -} - -# ## Plugin management functions -/** - * Determine if a given plugin is installed. - * @param string Plugin basename - * @return boolean True if plugin is installed - */ -function plugin_is_installed($p_basename) -{ - doDBConnect($dbHandler); - $tables = tlObjectWithDB::getDBTables(array('plugins')); - - $sql = " SELECT COUNT(*) count FROM {$tables['plugins']} " . - " WHERE basename='" . $dbHandler->prepare_string($p_basename) . "'"; - - $t_result = $dbHandler->fetchFirstRow($sql); - return (0 < $t_result['count']); -} - -/** - * Install a plugin to the database. - * @param string Plugin basename - */ -function plugin_install($p_plugin) -{ - $debugMsg = "Function: " . __FUNCTION__; - - if (plugin_is_installed($p_plugin->basename)) - { - trigger_error('Plugin ' . $p_plugin->basename . ' already installed', E_USER_WARNING); - return null; - } - - plugin_push_current($p_plugin->basename); - - if (!$p_plugin->install()) - { - plugin_pop_current($p_plugin->basename); - return null; - } - - doDBConnect($dbHandler); - $tables = tlObjectWithDB::getDBTables(array('plugins')); - $sql = "/* $debugMsg */ INSERT INTO {$tables['plugins']} (basename,enabled) " . - " VALUES ('" . $dbHandler->prepare_string($p_plugin->basename) . "',1)"; - $dbHandler->exec_query($sql); - - plugin_pop_current(); -} - -/** - * Uninstall a plugin from the database. - * @param string Plugin basename - */ -function plugin_uninstall($plugin_id) -{ - global $g_plugin_cache; - $debugMsg = "Function: " . __FUNCTION__; - - doDBConnect($dbHandler); - $tables = tlObjectWithDB::getDBTables(array('plugins')); - $sql = "/* debugMsg */ " . - " SELECT basename FROM {$tables['plugins']} WHERE id=" . $plugin_id; - - $t_row = $dbHandler->fetchFirstRow($sql); - - // Check that teh plugin is actually available and loaded - if (!$t_row) - { - return; - } - $t_basename = $t_row['basename']; - - $sql = "/* $debugMsg */ DELETE FROM {$tables['plugins']} " . - " WHERE id=" . $plugin_id; - $dbHandler->exec_query($sql); - - $p_plugin = $g_plugin_cache[$t_basename]; - $p_plugin->uninstall(); - return $t_basename; -} - -# ## Core usage only. -/** - * Search the plugins directory for plugins. - * @return array Plugin basename/info key/value pairs. - */ -function plugin_find_all() -{ - $t_plugin_path = TL_PLUGIN_PATH; - - if ($t_dir = opendir($t_plugin_path)) - { - while (($t_file = readdir($t_dir)) !== false) - { - if ('.' == $t_file || '..' == $t_file) - { - continue; - } - if (is_dir($t_plugin_path . $t_file)) - { - $t_plugin = plugin_register($t_file, true); - - if (!is_null($t_plugin)) - { - $t_plugins[$t_file] = $t_plugin; - } - } - } - closedir($t_dir); - } - return $t_plugins; -} - -/** - * Load a plugin's core class file. - * @param string Plugin basename - */ -function plugin_include($p_basename) -{ - $t_plugin_file = TL_PLUGIN_PATH . $p_basename . DIRECTORY_SEPARATOR . $p_basename . '.php'; - - $t_included = false; - if (is_file($t_plugin_file)) - { - include_once($t_plugin_file); - $t_included = true; - } - - return $t_included; -} - -/** - * Register a plugin with TestLink. - * The plugin class must already be loaded before calling. - * @param string Plugin classname without 'Plugin' postfix - */ -function plugin_register($p_basename, $p_return = false) -{ - global $g_plugin_cache; - - if (!isset($g_plugin_cache[$p_basename])) - { - $t_classname = $p_basename . 'Plugin'; - - # Include the plugin script if the class is not already declared. - if (!class_exists($t_classname)) - { - if (!plugin_include($p_basename)) - { - return null; - } - } - - # Make sure the class exists and that it's of the right type. - if (class_exists($t_classname) && is_subclass_of($t_classname, 'TestlinkPlugin')) - { - plugin_push_current($p_basename); - - doDBConnect($dbHandler); - $t_plugin = new $t_classname($dbHandler, $p_basename); - - plugin_pop_current(); - - # Final check on the class - if (is_null($t_plugin->name) || is_null($t_plugin->version)) - { - return null; - } - - if ($p_return) - { - return $t_plugin; - } - else - { - $g_plugin_cache[$p_basename] = $t_plugin; - } - } - } - - return $g_plugin_cache[$p_basename]; -} - -/** - * Find and register all installed plugins. - */ -function plugin_register_installed() -{ - doDBConnect($dbHandler); - $tables = tlObjectWithDB::getDBTables(array('plugins')); - $sql = "/* debugMsg */ " . - " SELECT basename FROM {$tables['plugins']} WHERE enabled=1 "; - - $t_result = $dbHandler->exec_query($sql); - while ($t_row = $dbHandler->fetch_array($t_result)) - { - $t_basename = $t_row['basename']; - plugin_register($t_basename); - } -} - -/** - * Initialize all installed plugins. - */ -function plugin_init_installed() -{ - - global $g_plugin_cache, $g_plugin_current, $g_plugin_cache_init; - $g_plugin_cache = array(); - $g_plugin_current = array(); - $g_plugin_cache_init = array(); - - plugin_register_installed(); - - $t_plugins = array_keys($g_plugin_cache); - - foreach ($t_plugins as $t_basename) - { - plugin_init($t_basename); - } - -} - -/** - * Initialize a single plugin. - * @param string Plugin basename - * @return boolean True if plugin initialized, false otherwise. - */ -function plugin_init($p_basename) -{ - global $g_plugin_cache, $g_plugin_cache_init; - - $ret = false; - if (isset($g_plugin_cache[$p_basename])) - { - $t_plugin = $g_plugin_cache[$p_basename]; - - plugin_push_current($p_basename); - - # finish initializing the plugin - $t_plugin->__init(); - $g_plugin_cache_init[$p_basename] = true; - - plugin_pop_current(); - $ret = true; - } - return $ret; -} - -function get_all_installed_plugins() -{ - doDBConnect($dbHandler); - - // Store all the available plugins (Enabled + Disabled + Just Available) - $installed_plugins = array(); - - $tables = tlObjectWithDB::getDBTables(array('plugins')); - $sql = "/* debugMsg */ " . - " SELECT id, basename, enabled FROM {$tables['plugins']}"; - - $t_result = $dbHandler->exec_query($sql); - while ($t_row = $dbHandler->fetch_array($t_result)) { - $t_basename = $t_row['basename']; - $t_enabled = $t_row['enabled']; - $t_pluginid = $t_row['id']; - - if (plugin_include($t_basename)) { - $t_classname = $t_basename . 'Plugin'; - $t_plugin = new $t_classname($dbHandler, $t_basename); - - $installed_plugins[] = array( - 'id' => $t_pluginid, - 'name' => $t_basename, - 'enabled' => $t_enabled, - 'description' => $t_plugin->description, - 'version' => $t_plugin->version); - } - } - - return $installed_plugins; -} - -function get_plugin_name($arr) -{ - if (array_key_exists('name', $arr)) - { - return $arr['name']; - } - return false; -} - -function get_all_available_plugins($existing_plugins) -{ - $registered_plugin_names = array_map("get_plugin_name", $existing_plugins); - $available_plugins = array(); - // Find all plugins that are newly available (And not already registered) - if ($t_dir = opendir(TL_PLUGIN_PATH)) - { - while (($t_file = readdir($t_dir)) !== false) - { - if ('.' == $t_file || '..' == $t_file) - { - continue; - } - if (!in_array($t_file, $registered_plugin_names) && - is_dir(TL_PLUGIN_PATH. $t_file) && plugin_include($t_file)) - { - $t_classname = $t_file . 'Plugin'; - if (class_exists($t_classname) && is_subclass_of($t_classname, 'TestlinkPlugin')) - { - $t_plugin = new $t_classname($dbHandler, $t_file); - - $available_plugins[] = array('name' => $t_plugin->name, - 'enabled' => 0, - 'description' => $t_plugin->description, - 'version' => $t_plugin->version); - } - } - } - closedir($t_dir); - } - - return $available_plugins; +prepare_string($full_option); + + $sql = "/* $debugMsg */ " . " SELECT config_value FROM " . + $tables['plugins_configuration'] . " where config_key = '" . $full_option . + "' AND testproject_id = "; + + $value = $dbHandler->fetchOneValue($sql . intval($project)); + + if (is_null($value) && $project != TL_ANY_PROJECT) { + // Check if its in the Global Project + $value = $dbHandler->fetchOneValue($sql . TL_ANY_PROJECT); + } + + if (is_null($value)) { + // Fetch from the Global list, and if not, fetch from default value + global $g_plugin_config_cache; + $value = array_key_exists($full_option, $g_plugin_config_cache) ? $g_plugin_config_cache[$full_option] : $default; + } + return $value; +} + +/** + * Set a plugin configuration option in the database. + * + * @param + * string Configuration option name + * @param + * multi Option value + * @param + * int User ID + * @param + * int Project ID + * @param + * int Access threshold + */ +function plugin_config_set($option, $value, $project = TL_ANY_PROJECT) +{ + doDBConnect($dbHandler); + $tables = tlObjectWithDB::getDBTables(array( + 'plugins_configuration' + )); + $plugin_config_table = $tables['plugins_configuration']; + + $basename = plugin_get_current(); + $full_option = 'plugin_' . $basename . '_' . $option; + + if (is_array($value) || is_object($value)) { + $config_type = CONFIG_TYPE_COMPLEX; + $value = serialize($value); + } elseif (is_float($value)) { + $config_type = CONFIG_TYPE_FLOAT; + $value = (float) $value; + } elseif (is_int($value) || is_numeric($value)) { + $config_type = CONFIG_TYPE_INT; + $value = $dbHandler->prepare_int($value); + } else { + $config_type = CONFIG_TYPE_STRING; + } + + $safe_id = intval($project); + $sql = " SELECT COUNT(*) from $plugin_config_table " . + " WHERE config_key = '" . $dbHandler->prepare_string($full_option) . "' " . + " AND testproject_id = {$safe_id} "; + $rows_exist = $dbHandler->fetchOneValue($sql); + + if ($rows_exist > 0) { + // Update the existing record + $sql = " UPDATE $plugin_config_table " . " SET config_value = '" . + $dbHandler->prepare_string($value) . "'," . " config_type = " . + $config_type . " WHERE config_key = '" . + $dbHandler->prepare_string($full_option) . "' " . + " AND testproject_id = {$safe_id} "; + } else { + // Insert new config value + $sql = " INSERT INTO $plugin_config_table " . + " (config_key, config_type, config_value, testproject_id, author_id) " . + " VALUES (" . "'" . $dbHandler->prepare_string($full_option) . "', " . + $config_type . "," . "'" . $dbHandler->prepare_string($value) . "', " . + $safe_id . ", " . $_SESSION['currentUser']->dbID . ")"; + } + $dbHandler->exec_query($sql); +} + +/** + * Set plugin default values to global values without overriding anything. + * + * @param + * array Array of configuration option name/value pairs. + */ +function plugin_config_defaults($options) +{ + global $g_plugin_config_cache; + if (! is_array($options)) { + return; + } + + $basename = plugin_get_current(); + $option_base = 'plugin_' . $basename . '_'; + + foreach ($options as $option => $value) { + $full_option = $option_base . $option; + $g_plugin_config_cache[$full_option] = $value; + } +} + +/** + * Get a language string for the plugin. + * Automatically prepends plugin_ to the string requested. + * + * @param + * string Language string name + * @param + * string Plugin basename + * @return string Language string + */ +function plugin_lang_get($p_name, $p_basename = null) +{ + if (! is_null($p_basename)) { + plugin_push_current($p_basename); + } + + $t_basename = plugin_get_current(); + $t_name = 'plugin_' . $t_basename . '_' . $p_name; + $t_string = lang_get($t_name); + + if (! is_null($p_basename)) { + plugin_pop_current(); + } + return $t_string; +} + +/** + * Hook a plugin's callback function to an event. + * + * @param + * string Event name + * @param + * string Callback function + */ +function plugin_event_hook($p_name, $p_callback) +{ + $t_basename = plugin_get_current(); + event_hook($p_name, $p_callback, $t_basename); +} + +/** + * Hook multiple plugin callbacks at once. + * + * @param + * array Array of event name/callback key/value pairs + */ +function plugin_event_hook_many($p_hooks) +{ + if (! is_array($p_hooks)) { + return; + } + + $t_basename = plugin_get_current(); + + foreach ($p_hooks as $t_event => $t_callbacks) { + if (! is_array($t_callbacks)) { + event_hook($t_event, $t_callbacks, $t_basename); + continue; + } + + foreach ($t_callbacks as $t_callback) { + event_hook($t_event, $t_callback, $t_basename); + } + } +} + +# ## Plugin Management Helpers + +/** + * Checks if a given plugin has been registered and initialized, + * and returns a boolean value representing the "loaded" state. + * + * @param + * string Plugin basename + * @return boolean Plugin loaded + */ +function plugin_is_loaded($p_basename) +{ + global $g_plugin_cache_init; + + return isset($g_plugin_cache_init[$p_basename]) && + $g_plugin_cache_init[$p_basename]; +} + +# ## Plugin management functions +/** + * Determine if a given plugin is installed. + * + * @param + * string Plugin basename + * @return boolean True if plugin is installed + */ +function plugin_is_installed($p_basename) +{ + doDBConnect($dbHandler); + $tables = tlObjectWithDB::getDBTables(array( + 'plugins' + )); + + $sql = " SELECT COUNT(*) count FROM {$tables['plugins']} " . + " WHERE basename='" . $dbHandler->prepare_string($p_basename) . "'"; + + $t_result = $dbHandler->fetchFirstRow($sql); + return 0 < $t_result['count']; +} + +/** + * Install a plugin to the database. + * + * @param + * string Plugin basename + */ +function plugin_install($p_plugin) +{ + $debugMsg = "Function: " . __FUNCTION__; + + if (plugin_is_installed($p_plugin->basename)) { + trigger_error('Plugin ' . $p_plugin->basename . ' already installed', + E_USER_WARNING); + return null; + } + + plugin_push_current($p_plugin->basename); + + if (! $p_plugin->install()) { + plugin_pop_current($p_plugin->basename); + return null; + } + + doDBConnect($dbHandler); + $tables = tlObjectWithDB::getDBTables(array( + 'plugins' + )); + $sql = "/* $debugMsg */ INSERT INTO {$tables['plugins']} (basename,enabled) " . + " VALUES ('" . $dbHandler->prepare_string($p_plugin->basename) . "',1)"; + $dbHandler->exec_query($sql); + + plugin_pop_current(); +} + +/** + * Uninstall a plugin from the database. + * + * @param + * string Plugin basename + */ +function plugin_uninstall($plugin_id) +{ + global $g_plugin_cache; + $debugMsg = "Function: " . __FUNCTION__; + + doDBConnect($dbHandler); + $tables = tlObjectWithDB::getDBTables(array( + 'plugins' + )); + $sql = "/* debugMsg */ " . + " SELECT basename FROM {$tables['plugins']} WHERE id=" . $plugin_id; + + $t_row = $dbHandler->fetchFirstRow($sql); + + // Check that teh plugin is actually available and loaded + if (! $t_row) { + return; + } + $t_basename = $t_row['basename']; + + $sql = "/* $debugMsg */ DELETE FROM {$tables['plugins']} " . " WHERE id=" . + $plugin_id; + $dbHandler->exec_query($sql); + + $p_plugin = $g_plugin_cache[$t_basename]; + $p_plugin->uninstall(); + return $t_basename; +} + +# ## Core usage only. +/** + * Search the plugins directory for plugins. + * + * @return array Plugin basename/info key/value pairs. + */ +function plugin_find_all() +{ + $t_plugin_path = TL_PLUGIN_PATH; + + if ($t_dir = opendir($t_plugin_path)) { + while (($t_file = readdir($t_dir)) !== false) { + if ('.' == $t_file || '..' == $t_file) { + continue; + } + if (is_dir($t_plugin_path . $t_file)) { + $t_plugin = plugin_register($t_file, true); + + if (! is_null($t_plugin)) { + $t_plugins[$t_file] = $t_plugin; + } + } + } + closedir($t_dir); + } + return $t_plugins; +} + +/** + * Load a plugin's core class file. + * + * @param + * string Plugin basename + */ +function plugin_include($p_basename) +{ + $t_plugin_file = TL_PLUGIN_PATH . $p_basename . DIRECTORY_SEPARATOR . + $p_basename . '.php'; + + $t_included = false; + if (is_file($t_plugin_file)) { + include_once $t_plugin_file; + $t_included = true; + } + + return $t_included; +} + +/** + * Register a plugin with TestLink. + * The plugin class must already be loaded before calling. + * + * @param + * string Plugin classname without 'Plugin' postfix + */ +function plugin_register($p_basename, $p_return = false) +{ + global $g_plugin_cache; + + if (! isset($g_plugin_cache[$p_basename])) { + $t_classname = $p_basename . 'Plugin'; + + # Include the plugin script if the class is not already declared. + if (! class_exists($t_classname) && ! plugin_include($p_basename)) { + return null; + } + + # Make sure the class exists and that it's of the right type. + if (class_exists($t_classname) && + is_subclass_of($t_classname, 'TestlinkPlugin')) { + plugin_push_current($p_basename); + + doDBConnect($dbHandler); + $t_plugin = new $t_classname($dbHandler, $p_basename); + + plugin_pop_current(); + + # Final check on the class + if (is_null($t_plugin->name) || is_null($t_plugin->version)) { + return null; + } + + if ($p_return) { + return $t_plugin; + } else { + $g_plugin_cache[$p_basename] = $t_plugin; + } + } + } + + return $g_plugin_cache[$p_basename]; +} + +/** + * Find and register all installed plugins. + */ +function plugin_register_installed() +{ + doDBConnect($dbHandler); + $tables = tlObjectWithDB::getDBTables(array( + 'plugins' + )); + $sql = "/* debugMsg */ " . + " SELECT basename FROM {$tables['plugins']} WHERE enabled=1 "; + + $t_result = $dbHandler->exec_query($sql); + while ($t_row = $dbHandler->fetch_array($t_result)) { + $t_basename = $t_row['basename']; + plugin_register($t_basename); + } +} + +/** + * Initialize all installed plugins. + */ +function plugin_init_installed() +{ + global $g_plugin_cache, $g_plugin_current, $g_plugin_cache_init; + $g_plugin_cache = array(); + $g_plugin_current = array(); + $g_plugin_cache_init = array(); + + plugin_register_installed(); + + $t_plugins = array_keys($g_plugin_cache); + + foreach ($t_plugins as $t_basename) { + plugin_init($t_basename); + } +} + +/** + * Initialize a single plugin. + * + * @param + * string Plugin basename + * @return boolean True if plugin initialized, false otherwise. + */ +function plugin_init($p_basename) +{ + global $g_plugin_cache, $g_plugin_cache_init; + + $ret = false; + if (isset($g_plugin_cache[$p_basename])) { + $t_plugin = $g_plugin_cache[$p_basename]; + + plugin_push_current($p_basename); + + # finish initializing the plugin + $t_plugin->__init(); + $g_plugin_cache_init[$p_basename] = true; + + plugin_pop_current(); + $ret = true; + } + return $ret; +} + +function get_all_installed_plugins() +{ + doDBConnect($dbHandler); + + // Store all the available plugins (Enabled + Disabled + Just Available) + $installed_plugins = array(); + + $tables = tlObjectWithDB::getDBTables(array( + 'plugins' + )); + $sql = "/* debugMsg */ " . + " SELECT id, basename, enabled FROM {$tables['plugins']}"; + + $t_result = $dbHandler->exec_query($sql); + while ($t_row = $dbHandler->fetch_array($t_result)) { + $t_basename = $t_row['basename']; + $t_enabled = $t_row['enabled']; + $t_pluginid = $t_row['id']; + + if (plugin_include($t_basename)) { + $t_classname = $t_basename . 'Plugin'; + $t_plugin = new $t_classname($dbHandler, $t_basename); + + $installed_plugins[] = array( + 'id' => $t_pluginid, + 'name' => $t_basename, + 'enabled' => $t_enabled, + 'description' => $t_plugin->description, + 'version' => $t_plugin->version + ); + } + } + + return $installed_plugins; +} + +function get_plugin_name($arr) +{ + if (array_key_exists('name', $arr)) { + return $arr['name']; + } + return false; +} + +function get_all_available_plugins($existing_plugins) +{ + $registered_plugin_names = array_map("get_plugin_name", $existing_plugins); + $available_plugins = array(); + // Find all plugins that are newly available (And not already registered) + if ($t_dir = opendir(TL_PLUGIN_PATH)) { + while (($t_file = readdir($t_dir)) !== false) { + if ('.' == $t_file || '..' == $t_file) { + continue; + } + if (! in_array($t_file, $registered_plugin_names) && + is_dir(TL_PLUGIN_PATH . $t_file) && plugin_include($t_file)) { + $t_classname = $t_file . 'Plugin'; + if (class_exists($t_classname) && + is_subclass_of($t_classname, 'TestlinkPlugin')) { + $t_plugin = new $t_classname($dbHandler, $t_file); + + $available_plugins[] = array( + 'name' => $t_plugin->name, + 'enabled' => 0, + 'description' => $t_plugin->description, + 'version' => $t_plugin->version + ); + } + } + } + closedir($t_dir); + } + + return $available_plugins; } diff --git a/lib/functions/print.inc.php b/lib/functions/print.inc.php index 0d43a923be..c8689e6ac2 100644 --- a/lib/functions/print.inc.php +++ b/lib/functions/print.inc.php @@ -1,2330 +1,2417 @@ - 'requirement', 'status' => 'status', - 'scope' => 'scope', 'type' => 'type', 'author' => 'author', - 'relations' => 'relations','not_aplicable' => 'not_aplicable', - 'coverage' => 'coverage','last_edit' => 'last_edit', - 'custom_field' => 'custom_field', 'relation_project' => 'relation_project', - 'related_tcs' => 'related_tcs', 'version' => 'version', - 'revision' => 'revision', 'attached_files' => 'attached_files'); - - $labels = init_labels($labels); - - $decodeReq = array(); - $decodeReq['status'] = init_labels($req_cfg->status_labels); - $decodeReq['type'] = init_labels($req_cfg->type_labels); - - - $force['displayVersion'] = isset($options['displayVersion']) ? $options['displayVersion'] : false; - $force['displayLastEdit'] = isset($options['displayLastEdit']) ? $options['displayLastEdit'] : false; - - - $title_separator = config_get('gui_title_separator_1'); - $req_mgr = new requirement_mgr($db); - $tplan_mgr = new testplan($db); - - $repoDir = config_get('repositoryPath'); - } - - $versionID = isset($node['version_id']) ? intval($node['version_id']) : requirement_mgr::LATEST_VERSION; - $revision = isset($node['revision']) ? intval($node['revision']) : null; - - $getOpt = array('renderImageInline' => true); - if( is_null($revision) ) { - // will get last revision of requested req version - $dummy = $req_mgr->get_by_id($node['id'],$versionID,1,$getOpt); - } - else { - $dummy = $req_mgr->get_version_revision($versionID,array('number' => $revision),$getOpt); - if(!is_null($dummy)) { - // do this way instead of using SQL alias on get_version_revision(), in order - // to avoid issues (potential not confirmed)on different DBMS. - $dummy[0]['id'] = $dummy[0]['req_id']; - } - } - - $req = $dummy[0]; - - // update with values got from req, this is needed if user did not provide it - $versionID = $req['version_id']; - $revision = $req['revision']; - - $name = htmlspecialchars($req["req_doc_id"] . $title_separator . $req['title']); - - // change table style in case of single req printing to not be indented - $table_style = ""; - if (isset($options['docType']) && $options['docType'] == SINGLE_REQ) - { - $table_style = "style=\"margin-left: 0;\""; - } - - $output = "\n"; - - if( $force['displayVersion'] ) { - foreach(array('version','revision') as $key) { - $output .= '' . - '\n"; - } - } - - - if ($options['toc']) { - $options['tocCode'] .= '

    ' . - $name . '

    '; - $output .= ''; - } - - if ($options['req_author']) - { - $output .= '' . - '\n"; - - if ($req['modifier_id'] > 0) - { - // add updater if available and differs from author OR forced - if ($force['displayLastEdit'] || ($req['modifier_id'] != $req['modifier_id']) ) - { - $output .= '' . - '\n"; - } - } - } - - foreach(array('status','type') as $key) - { - if($options['req_' . $key]) - { - $output .= '" . - ""; - } - } - - if ($options['req_coverage']) { - - // @since 1.9.18 - // Coverage Link REQV to TCV - // $current = count($req_mgr->get_coverage($req['id'])); - $current = count((array)$req_mgr->getGoodForReqVersion($req['version_id'])); - - $expected = $req['expected_coverage']; - $coverage = $labels['not_aplicable'] . " ($current/0)"; - if ($expected) { - $percentage = round(100 / $expected * $current, 2); - $coverage = "{$percentage}% ({$current}/{$expected})"; - } - - $output .= "" . ""; - } - - if ($options['req_scope']) - { - $output .= ""; - } - - if ($options['req_relations']) { - - // REQ relations are managed AT REQ level NOT REQV - $relations = $req_mgr->get_relations($req['id']); - - if ($relations['num_relations']) { - $output .= ""; - } - } - - if ($options['req_linked_tcs']) { - - // @since 1.9.18 - // Coverage links REQV to TCV - // $req_coverage = $req_mgr->get_coverage($req['id']); - $req_coverage = - (array)$req_mgr->getGoodForReqVersion($req['version_id'], - array('verbose' => true, 'tproject_id' => $tprojectID)); - - if (count($req_coverage) > 0) { - $output .= "" . ""; - } - } - - if ($options['req_cf']) - { - $childID = (is_null($revision) || $req['revision_id'] < 0) ? $req['version_id'] : $req['revision_id']; - $linked_cf = $req_mgr->get_linked_cfields($req['id'], $childID); - if ($linked_cf) - { - foreach ($linked_cf as $key => $cf) - { - $cflabel = htmlspecialchars($cf['label']); - $value = htmlspecialchars($cf['value']); - - $output .= "" . ""; - } - } - } - - // Display Images Inline (Always) - // since 1.9.18 => we need to use req version - $attachSet = (array)$req_mgr->getAttachmentInfos($req['revision_id']); - - if (count($attachSet)) { - $output .= ""; - } - - - $output .= "
    " . - "{$labels['requirement']}: " . $name . "
    ' . - ''.$labels[$key].':' . $req[$key]. "
    ' . - ''.$labels['author'].':' . htmlspecialchars(gendocGetUserName($db, $req['author_id'])); - - if(isset($options['displayDates']) && $options['displayDates']) - { - $dummy = null; - $output .= ' - ' . localize_dateOrTimeStamp(null,$dummy,'timestamp_format',$req['creation_ts']); - } - $output .= "
    ' . - ''. $labels['last_edit'] . ':' . htmlspecialchars(gendocGetUserName($db, $req['modifier_id'])); - - if(isset($options['displayDates']) && $options['displayDates']) - { - $dummy = null; - $output .= ' - ' . localize_dateOrTimeStamp(null,$dummy,'timestamp_format', - $req['modification_ts']); - } - $output .= "
    ' . - $labels[$key] . "" . $decodeReq[$key][$req[$key]] . "
    " . $labels['coverage'] . - "$coverage

    " . $req['scope'] . "
    " . $labels['relations'] . - ""; - - $filler = str_repeat(' ',5); // MAGIC allowed - foreach ($relations['relations'] as $rel) - { - $output .= "{$rel['type_localized']}:
    {$filler}" . - htmlspecialchars($rel['related_req']['req_doc_id']) . $title_separator . - htmlspecialchars($rel['related_req']['title']) . "
    " . - "{$filler}{$labels['status']}: " . - "{$decodeReq['status'][$rel['related_req']['status']]}
    "; - - if ($req_cfg->relations->interproject_linking) - { - $output .= "{$filler}{$labels['relation_project']}: " . - htmlspecialchars($rel['related_req']['testproject_name']) . "
    "; - } - } - - $output .= "
    " . $labels['related_tcs'] . - ""; - foreach ($req_coverage[$req['version_id']] as $tc) { - $output .= htmlspecialchars($tc['tc_external_id'] . $title_separator . $tc['testcase_name']) . "  [{$labels['version']}:" . $tc['version'] . "]"; - } - - $output .= "
    " . - $cflabel . "$value
    " . - $labels['attached_files'] . ""; - - foreach($attachSet as $fitem) { - $sec = hash('sha256',$fitem['file_name']); - $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . $sec . - '&id=' . $fitem['id']; - - $safeFileName = htmlspecialchars($fitem['file_name']); - if($fitem['is_image']) { - $output .= "
  • " . $safeFileName . "
  • "; - - $pathname = $repoDir . $item['file_path']; - list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname); - - // Sorry by MAGIC Numbers - if($iWidth > 900 or $iHeight > 700) { - if($iWidth > $iHeight) { - $imgDiff = round($iWidth / 600); - } else { - $imgDiff = round($iHeight / 450); - } - $iWidth = $iWidth/$imgDiff; - $iHeight = $iHeight/$imgDiff; - } - // --- - - - $iDim = ' width=' . $iWidth . ' height=' . $iHeight; - $output .= '
  • ' . ''; - - } else { - $output .= '
  • ' . ' ' . $safeFileName . ''; - } - } - $output .="

  • "; - - return $output; -} - - -/** - * render a requirement specification node as HTML code for printing - * - * @author Andreas Simon - * - * @param resource $db - * @param array $node the node to be printed - * @param array $options - * @param string $tocPrefix Prefix to be printed in TOC before title of node - * @param int $level - * @param int $tprojectID - * - * @return string $output HTML Code - */ -function renderReqSpecNodeForPrinting(&$db, &$node, &$options, $tocPrefix, $rsLevel, $tprojectID) -{ - static $tableColspan; - static $firstColWidth; - static $labels; - static $title_separator; - static $req_spec_mgr; - static $tplan_mgr; - static $req_spec_cfg; - static $reqSpecTypeLabels; - static $nodeTypes; - static $basehref; - static $repoDir; - - $output = ''; - $reLevel = ($rsLevel > 0) ? $rsLevel : 1; - - if (!$req_spec_mgr) { - $repoDir = config_get('repositoryPath'); - - $basehref = $_SESSION['basehref']; - $req_spec_cfg = config_get('req_spec_cfg'); - $firstColWidth = '20%'; - $tableColspan = 2; - $labels = array('requirements_spec' => 'requirements_spec', - 'scope' => 'scope', 'type' => 'type', 'author' => 'author', - 'relations' => 'relations', 'overwritten_count' => 'req_total', - 'coverage' => 'coverage','revision' => 'revision','attached_files' => 'attached_files', - 'undefined_req_spec_type' => 'undefined_req_spec_type', - 'custom_field' => 'custom_field', 'not_aplicable' => 'not_aplicable'); - - $labels = init_labels($labels); - $reqSpecTypeLabels = init_labels($req_spec_cfg->type_labels); - $title_separator = config_get('gui_title_separator_1'); - $req_spec_mgr = new requirement_spec_mgr($db); - $tplan_mgr = new testplan($db); - $nodeTypes = array_flip($tplan_mgr->tree_manager->get_available_node_types()); - } - - switch($nodeTypes[$node['node_type_id']]) - { - case 'requirement_spec_revision': - $spec = $req_spec_mgr->getRevisionByID($node['id']); - $spec_id = $spec['parent_id']; - $who = array('parent_id' => $spec['parent_id'],'item_id' => $spec['id'], - 'tproject_id' => $spec['testproject_id']); - break; - - case 'requirement_spec': - $spec = $req_spec_mgr->get_by_id($node['id']); - $spec_id = $spec['id']; - $who = array('parent_id' => $spec['id'],'item_id' => $spec['revision_id'], - 'tproject_id' => $spec['testproject_id']); - break; - } - $name = htmlspecialchars($spec['doc_id'] . $title_separator . $spec['title']); - - $docHeadingNumbering = ''; - if ($options['headerNumbering']) { - $docHeadingNumbering = "$tocPrefix. "; - } - - if($options['docType'] != SINGLE_REQSPEC) - { - $output = '

    '; - } - - // Remember that only H1 to H6 exists - $reLevel = ($reLevel > 6) ? 6 : $reLevel; - $reLevel = ($reLevel < 1) ? 1 : $reLevel; - - $output .= "\n"; - - if ($options['toc']) - { - $spacing = ($reLevel == 2) ? "
    " : ""; - $options['tocCode'] .= $spacing.'

    ' . - '' . $docHeadingNumbering . $name . "

    \n"; - $output .= "\n"; - } - $output .= '\n"; - - if ($options['req_spec_author']) - { - // get author name for node - $author = tlUser::getById($db, $spec['author_id']); - $whois = (is_null($author)) ? lang_get('undefined') : $author->getDisplayName(); - $output .= '\n"; - } - - if ($options['req_spec_type']) - { - $output .= '" . ""; - } - - if ($options['req_spec_overwritten_count_reqs']) { - $current = $req_spec_mgr->get_requirements_count($spec_id); // NEEDS REFACTOR - $expected = $spec['total_req']; - $coverage = $labels['not_aplicable'] . " ($current/0)"; - if ($expected) { - $percentage = round(100 / $expected * $current, 2); - $coverage = "{$percentage}% ({$current}/{$expected})"; - } - - $output .= '" . - ""; - } - - if ($options['req_spec_scope']) - { - $output .= ""; - } - - if ($options['req_spec_cf']) - { - - $linked_cf = $req_spec_mgr->get_linked_cfields($who); - if ($linked_cf) - { - foreach ($linked_cf as $key => $cf) - { - $cflabel = htmlspecialchars($cf['label']); - $value = htmlspecialchars($cf['value']); - - $output .= "" . - ""; - } - } - } - - $attachSet = (array)$req_spec_mgr->getAttachmentInfos($spec_id); - if (count($attachSet)) { - $output .= ""; - } - - $output .= "
    " . - " {$docHeadingNumbering}{$labels['requirements_spec']}: " . - $name . "
    ' . - $labels['revision'] . " " . - $spec['revision'] . "
    ' . - $labels['author'] . " " . - htmlspecialchars($whois) . "
    ' . - $labels['type'] . ""; - - if( isset($reqSpecTypeLabels[$spec['type']]) ) - { - $output .= $reqSpecTypeLabels[$spec['type']]; - } - else - { - $output .= sprintf($labels['undefined_req_spec_type'],$spec['type']); - } - $output .= "
    ' . - $labels['overwritten_count'] . " (" . $labels['coverage'] . ")" . $coverage . "
    " . $spec['scope'] . "
    " . - $cflabel . "$value
    " . - $labels['attached_files'] . "
      "; - - foreach($attachSet as $item) { - $fname = ""; - if ($item['title']) { - $fname .= htmlspecialchars($item['title']) . " : "; - } - $fname .= htmlspecialchars($item['file_name']); - $output .= "
    • $fname
    • "; - } - $output .="

    \n"; - - return $output; -} - - -/** - * render a complete tree, consisting of mixed requirement and req spec nodes, - * as HTML code for printing - * - * @author Andreas Simon - * - * @param resource $db - * @param array $node the node to be printed - * @param array $options - * @param string $tocPrefix Prefix to be printed in TOC before title of each node - * @param int $level - * @param int $tprojectID - * @param int $user_id ID of user which shall be printed as author of the document - * - * @return string $output HTML Code - */ -function renderReqSpecTreeForPrinting(&$db, &$node, &$options,$tocPrefix, $rsCnt, $rstLevel, $user_id, - $tplan_id = 0, $tprojectID = 0) -{ - - static $tree_mgr; - static $map_id_descr; - static $tplan_mgr; - static $repoDir; - $code = null; - - if(!$tree_mgr) { - $tplan_mgr = new testplan($db); - $tree_mgr = new tree($db); - $map_id_descr = $tree_mgr->node_types; - $repoDir = config_get('repositoryPath'); - } - $verbose_node_type = $map_id_descr[$node['node_type_id']]; - - switch($verbose_node_type) - { - case 'testproject': - - break; - - case 'requirement_spec': - $tocPrefix .= (!is_null($tocPrefix) ? "." : '') . $rsCnt; - $code .= renderReqSpecNodeForPrinting($db,$node,$options, - $tocPrefix, $rstLevel, $tprojectID); - break; - - case 'requirement': - $tocPrefix .= (!is_null($tocPrefix) ? "." : '') . $rsCnt; - $code .= renderReqForPrinting($db, $node, $options, - $tocPrefix, $rstLevel, $tprojectID); - break; - } - - if (isset($node['childNodes']) && $node['childNodes']) - { - - $childNodes = $node['childNodes']; - $rsCnt = 0; - $children_qty = sizeof($childNodes); - for($i = 0;$i < $children_qty ;$i++) - { - $current = $childNodes[$i]; - if(is_null($current)) - { - continue; - } - - if (isset($current['node_type_id']) && - $map_id_descr[$current['node_type_id']] == 'requirement_spec') - { - $rsCnt++; - } - - $code .= renderReqSpecTreeForPrinting($db, $current, $options,$tocPrefix, $rsCnt, - $rstLevel+1, $user_id, $tplan_id, $tprojectID); - } - } - - if ($verbose_node_type == 'testproject') - { - if ($options['toc']) - { - $code = str_replace("{{INSERT_TOC}}",$options['tocCode'],$code); - } - } - - return $code; -} - - -/** - * render HTML header - * Standard: HTML 4.01 trans (because is more flexible to bugs in user data) - * - * @param string $title - * @param string $base_href Base URL - * - * @return string html data - */ -function renderHTMLHeader($title,$base_href,$doc_type,$jsSet=null) -{ - $themeDir = config_get('theme_dir'); - $docCfg = config_get('document_generator'); - - $cssFile = $base_href . $themeDir; - switch ($doc_type) - { - case DOC_REQ_SPEC: - case SINGLE_REQ: - case SINGLE_REQSPEC: - $cssFile .= $docCfg->requirement_css_template; - break; - - case DOC_TEST_SPEC: - case DOC_TEST_PLAN_DESIGN: - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - case SINGLE_TESTCASE: - default: - $cssFile .= $docCfg->css_template; - break; - } - - $output = "\n"; - - $output .= "\n\n"; - $output .= ''; - - $output .= '' . htmlspecialchars($title). "\n"; - $output .= '\n"; - - // way to add CSS directly to the exported file (not used - test required) - // $docCss = file_get_contents(TL_ABS_PATH . $docCfg->css_template); - // $output .= '\n"; - $output .= ''; - - if(!is_null($jsSet)) - { - foreach($jsSet as $js) - { - $output .= "\n" . '' . "\n"; - } - } - - $output .= "\n\n"; - return $output; -} - - -/** - * Generate initial page of document - * - * @param object $doc_info data with the next string values: - * title - * type_name: what does this means ??? - * author, tproject_name, testplan_name - * @return string html - * @author havlatm - */ -function renderFirstPage($doc_info) -{ - $docCfg = config_get('document_generator'); - $date_format_cfg = config_get('date_format'); - $output = "\n
    \n"; - - // Print header - if ($docCfg->company_name != '' ) - { - $output .= '
    ' . htmlspecialchars($docCfg->company_name) ."
    \n"; - } - $output .= "
     

    \n"; - - if ($docCfg->company_logo != '' ) - { - // allow to configure height via config file - $height = ''; - if (isset($docCfg->company_logo_height) && $docCfg->company_logo_height != '') - { - $height = "height=\"{$docCfg->company_logo_height}\""; - } - - $safePName = $_SESSION['basehref'] . TL_THEME_IMG_DIR . $docCfg->company_logo; - list($iWidth, $iHeight, $iType, $iAttr) = getimagesize($safePName); - $output .= '

    TestLink logo

    '; - } - $output .= "
    \n"; - - // Print context - // Report Minimal Description - // Test Project Name - // Test Plan Name - // Build Name (if applicable) - // Test Suite Name (if applicable) - // - $output .= '
    ' . '

    ' . $doc_info->type_name . '

    '; - if($doc_info->additional_info != '') - { - $output .= '

    ' . $doc_info->additional_info . '

    '; - } - $output .= "
    \n"; - $output .= '
    ' . '

    ' . - lang_get('testproject') . ": " . $doc_info->tproject_name; - - if($doc_info->type == DOC_TEST_PLAN_DESIGN || $doc_info->type == DOC_TEST_PLAN_EXECUTION || - $doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) - { - $output .= '
    ' . lang_get('testplan') . ": " . $doc_info->testplan_name; - } - - if($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) - { - $output .= '
    ' . lang_get('build') . ": " . $doc_info->build_name; - } - - - if($doc_info->content_range == 'testsuite') - { - $output .= '
    ' . lang_get('testsuite') . ": " . $doc_info->title; - } - $output .= '

    ' . "
    \n"; - - - $output .= '
    ' . '

    ' . lang_get('printed_by_TestLink_on')." ". - @strftime($date_format_cfg, time()) . "

    \n"; - - // Print legal notes - if ($docCfg->company_copyright != '') - { - $output .= '\n"; - } - - if ($docCfg->confidential_msg != '') - { - $output .= '\n"; - } - - return $output; -} - - -/** - * Generate a chapter to a document - * - * @param string $title - * @param string $content - * - * @return string html - * @author havlatm - */ -function renderSimpleChapter($title, $content, $addToStyle=null) -{ - $output = ''; - if ($content != "") - { - $sAdd = !is_null($addToStyle) ? " style=\"{$addToStyle}\" " : ''; - $output .= '

    ' . $title . "

    \n"; - $output .= '
    ' .$content . "
    \n
    "; - } - return $output; -} - - -/* - function: renderTestSpecTreeForPrinting - args : - returns: - - -env->base_href -env->item_type -env->tocPrefix -env->testCounter => env->tocCounter -env->user_id - -context['tproject_id'] -context['tplan_id'] -context['platform_id'] -context['build_id'] -context['level'] >>>>> WRONG -context['prefix'] - -*/ - -function renderTestSpecTreeForPrinting(&$db,&$node,&$options,$env,$context,$tocPrefix,$indentLevel) -{ - static $tree_mgr; - static $id_descr; - static $tplan_mgr; - static $repoDir; - - $code = null; - - if(!$tree_mgr) { - $tplan_mgr = new testplan($db); - $tree_mgr = new tree($db); - $id_descr = $tree_mgr->node_types; - $repoDir = config_get('repositoryPath'); - - $k2i = array('tproject_id' => 0, 'tplan_id' => 0, 'platform_id' => 0, 'build_id' => 0, 'prefix' => null); - $context = array_merge($k2i,$context); - } - - $node_type = $id_descr[intval($node['node_type_id'])]; - switch($node_type) { - case 'testproject': - break; - - case 'testsuite': - $tocPrefix .= (!is_null($tocPrefix) ? "." : '') . $env->tocCounter; - $code .= renderTestSuiteNodeForPrinting($db,$node,$env,$options,$context,$tocPrefix,$indentLevel); - break; - - case 'testcase': - $code .= renderTestCaseForPrinting($db,$node,$options,$env,$context,$indentLevel); - break; - } - - if (isset($node['childNodes']) && $node['childNodes']) { - // Need to be a LOCAL COUNTER for each PARENT - $TOCCounter = 0; - $childNodes = $node['childNodes']; - $children_qty = sizeof($childNodes); - for($idx = 0;$idx < $children_qty ;$idx++) - { - $current = $childNodes[$idx]; - if(is_null($current) || $current == REMOVEME) - { - continue; - } - - if (isset($current['node_type_id']) && $id_descr[$current['node_type_id']] == 'testsuite') - { - // Each time I found a contained Test Suite need to add a .x.x. to TOC - $TOCCounter++; - } - $env->tocCounter = $TOCCounter; - $code .= renderTestSpecTreeForPrinting($db,$current,$options,$env,$context,$tocPrefix,$indentLevel+1); - } - } - - if ($node_type == 'testproject' && $options['toc']) - { - $code = str_replace("{{INSERT_TOC}}",$options['tocCode'],$code); - } - - return $code; -} - - -/** - * get user name from pool (save used names in session to improve performance) - * - * @param integer $db DB connection identifier - * @param integer $userId - * - * @return string readable user name - * @author havlatm - */ -function gendocGetUserName(&$db, $userId) -{ - $authorName = null; - - if(isset($_SESSION['userNamePool'][$userId])) - { - $authorName = $_SESSION['userNamePool'][$userId]; - } - else - { - $user = tlUser::getByID($db,$userId); - if ($user) { - $authorName = $user->getDisplayName(); - $authorName = htmlspecialchars($authorName); - $_SESSION['userNamePool'][$userId] = $authorName; - } - else { - $authorName = lang_get('undefined'); - tLog('tlUser::getByID($db,$userId) failed', 'ERROR'); - } - } - - return $authorName; -} - - -/** - * render Test Case content for generated documents - * - * @param $integer db DB connection identifier - * @return string generated html code - * - * @internal revisions - */ -function renderTestCaseForPrinting(&$db,&$node,&$options,$env,$context,$indentLevel) { - - - static $st; - static $statusL10N; - static $labels; - static $tcase_prefix; - static $userMap = array(); - static $cfg; - static $force = null; - - $code = null; - $tcInfo = null; - $tcResultInfo = null; - $tcase_pieces = null; - - $id = $node['id']; - $tcversion_id = isset($node['tcversion_id']) ? $node['tcversion_id'] : null; - - $level = $indentLevel; - $prefix = isset($context['prefix']) ? $context['prefix'] : null; - $tplan_id = isset($context['tplan_id']) ? $context['tplan_id'] : 0; - $tprojectID = isset($context['tproject_id']) ? $context['tproject_id'] : 0; - $platform_id = isset($context['platform_id']) ? $context['platform_id'] : 0; - $build_id = isset($context['build_id']) ? $context['build_id'] : 0; - - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - $stepDesignCfg = getWebEditorCfg('steps_design'); - $stepDesignType = $stepDesignCfg['type']; - - // init static elements - if (!$st) { - - $st = new stdClass(); - $statusL10N = array(); - list($cfg,$labels,$statusL10N) = initRenderTestCaseCfg($options); - $st = initStaticRenderTestCaseForPrinting($db,$node['id'],$context,$cfg); - $st->statusL10N = $statusL10N; - - $tcase_prefix = $st->tcase_prefix; - - $force['displayVersion'] = isset($options['displayVersion']) ? $options['displayVersion'] : false; - $force['displayLastEdit'] = isset($options['displayLastEdit']) ? $options['displayLastEdit'] : false; - - // change table style in case of single TC printing to not be indented - $st->table_style = ""; - if (isset($options['docType']) && $options['docType'] == SINGLE_TESTCASE) { - $st->table_style = 'style="margin-left: 0;"'; - } - } - - - /** - * @TODO THIS IS NOT THE WAY TO DO THIS IS ABSOLUTELY WRONG AND MUST BE REFACTORED, - * using existent methods - franciscom - 20090329 - * Need to get CF with execution scope - */ - $exec_info = null; - $getByID['filters'] = null; - - $opt = array(); - $opt['step_exec_notes'] = isset($options['step_exec_notes']) && $options['step_exec_notes']; - $opt['step_exec_status'] = isset($options['step_exec_status']) && $options['step_exec_status']; - - switch($options["docType"]) { - case DOC_TEST_SPEC: - $getByID['tcversion_id'] = testcase::LATEST_VERSION; - $getExecutions = false; - break; - - case SINGLE_TESTCASE: - $getByID['tcversion_id'] = $node['tcversion_id']; - $getExecutions = ($options['passfail'] || $options['notes'] || - $opt['step_exec_notes'] || $opt['step_exec_status']); - break; - - default: - $getByID['tcversion_id'] = $node['tcversion_id']; - $getExecutions = ($options['cfields'] || $options['passfail'] || - $options['notes'] || - $opt['step_exec_notes'] || $opt['step_exec_status']); - break; - } - - if ($getExecutions) { - // Thanks to Evelyn from Cortado, have found a very old issue never reported. - // 1. create TC-1A VERSION 1 - // 2. add to test plan and execute FAILED ON BUILD 1 - // 3. Request Test Report (Test Plan EXECUTION REPORT). - // You will get spec for VERSION 1 and result for VERSION 1 - OK cool! - // 4. create VERSION 2 - // 5. update linked Test Case Versions - // 6. do nothing more than repeat step 3 - // without this fix you will get - // You will get spec for VERSION 2 and result for VERSION 1 - Hmmm - // and in addition is not clear that execution was on VERSION 1 . No GOOD!! - // - // HOW has been fixed ? - // Getting info about THE CURRENT LINKED test case version and looking for - // exec info for this. - // - // ATTENTION: THIS IS OK ONLY WHEN BUILD ID is not provided - // - // - // Get Linked test case version - $linkedItem = $st->tplan_mgr->getLinkInfo($tplan_id,$id,$platform_id); - - $sql = " SELECT E.id AS execution_id, E.status, E.execution_ts, + 'requirement', + 'status' => 'status', + 'scope' => 'scope', + 'type' => 'type', + 'author' => 'author', + 'relations' => 'relations', + 'not_aplicable' => 'not_aplicable', + 'coverage' => 'coverage', + 'last_edit' => 'last_edit', + 'custom_field' => 'custom_field', + 'relation_project' => 'relation_project', + 'related_tcs' => 'related_tcs', + 'version' => 'version', + 'revision' => 'revision', + 'attached_files' => 'attached_files' + ); + + $labels = init_labels($labels); + + $decodeReq = array(); + $decodeReq['status'] = init_labels($req_cfg->status_labels); + $decodeReq['type'] = init_labels($req_cfg->type_labels); + + $force['displayVersion'] = isset($options['displayVersion']) ? $options['displayVersion'] : false; + $force['displayLastEdit'] = isset($options['displayLastEdit']) ? $options['displayLastEdit'] : false; + + $title_separator = config_get('gui_title_separator_1'); + $req_mgr = new requirement_mgr($db); + + $repoDir = config_get('repositoryPath'); + } + + $versionID = isset($node['version_id']) ? intval($node['version_id']) : requirement_mgr::LATEST_VERSION; + $revision = isset($node['revision']) ? intval($node['revision']) : null; + + $getOpt = array( + 'renderImageInline' => true + ); + if (is_null($revision)) { + // will get last revision of requested req version + $dummy = $req_mgr->get_by_id($node['id'], $versionID, 1, $getOpt); + } else { + $dummy = $req_mgr->get_version_revision($versionID, + array( + 'number' => $revision + ), $getOpt); + if (! is_null($dummy)) { + // do this way instead of using SQL alias on get_version_revision(), in order + // to avoid issues (potential not confirmed)on different DBMS. + $dummy[0]['id'] = $dummy[0]['req_id']; + } + } + + $req = $dummy[0]; + + // update with values got from req, this is needed if user did not provide it + $revision = $req['revision']; + + $name = htmlspecialchars( + $req["req_doc_id"] . $title_separator . $req['title']); + + // change table style in case of single req printing to not be indented + $table_style = ""; + if (isset($options['docType']) && $options['docType'] == SINGLE_REQ) { + $table_style = "style=\"margin-left: 0;\""; + } + + $output = "\n"; + + if ($force['displayVersion']) { + foreach (array( + 'version', + 'revision' + ) as $key) { + $output .= '' . '\n"; + } + } + + if ($options['toc']) { + $options['tocCode'] .= '

    ' . + $name . '

    '; + $output .= ''; + } + + if ($options['req_author']) { + $output .= '' . '\n"; + + // add updater if available and differs from author OR forced + if ($req['modifier_id'] > 0 && $force['displayLastEdit'] || + ($req['modifier_id'] != $req['modifier_id'])) { + $output .= '' . '\n"; + } + } + + foreach (array( + 'status', + 'type' + ) as $key) { + if ($options['req_' . $key]) { + $output .= '" . + ""; + } + } + + if ($options['req_coverage']) { + + // @since 1.9.18 + // Coverage Link REQV to TCV + // $current = count($req_mgr->get_coverage($req['id'])); + $current = count( + (array) $req_mgr->getGoodForReqVersion($req['version_id'])); + + $expected = $req['expected_coverage']; + $coverage = $labels['not_aplicable'] . " ($current/0)"; + if ($expected) { + $percentage = round(100 / $expected * $current, 2); + $coverage = "{$percentage}% ({$current}/{$expected})"; + } + + $output .= "" . ""; + } + + if ($options['req_scope']) { + $output .= ""; + } + + if ($options['req_relations']) { + + // REQ relations are managed AT REQ level NOT REQV + $relations = $req_mgr->get_relations($req['id']); + + if ($relations['num_relations']) { + $output .= ""; + } + } + + if ($options['req_linked_tcs']) { + + // @since 1.9.18 + // Coverage links REQV to TCV + // $req_coverage = $req_mgr->get_coverage($req['id']); + $req_coverage = (array) $req_mgr->getGoodForReqVersion( + $req['version_id'], + array( + 'verbose' => true, + 'tproject_id' => $tprojectID + )); + + if (! empty($req_coverage)) { + $output .= "" . ""; + } + } + + if ($options['req_cf']) { + $childID = (is_null($revision) || $req['revision_id'] < 0) ? $req['version_id'] : $req['revision_id']; + $linked_cf = $req_mgr->get_linked_cfields($req['id'], $childID); + if ($linked_cf) { + foreach ($linked_cf as $cf) { + $cflabel = htmlspecialchars($cf['label']); + $value = htmlspecialchars($cf['value']); + + $output .= "" . ""; + } + } + } + + // Display Images Inline (Always) + // since 1.9.18 => we need to use req version + $attachSet = (array) $req_mgr->getAttachmentInfos($req['revision_id']); + + if (count($attachSet)) { + $output .= ""; + } + + $output .= "
    " . + "{$labels['requirement']}: " . $name . + "
    ' . '' . + $labels[$key] . ':' . $req[$key] . + "
    ' . '' . + $labels['author'] . ':' . + htmlspecialchars(gendocGetUserName($db, $req['author_id'])); + + if (isset($options['displayDates']) && $options['displayDates']) { + $dummy = null; + $output .= ' - ' . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $req['creation_ts']); + } + $output .= "
    ' . '' . + $labels['last_edit'] . ':' . + htmlspecialchars(gendocGetUserName($db, $req['modifier_id'])); + + if (isset($options['displayDates']) && $options['displayDates']) { + $dummy = null; + $output .= ' - ' . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $req['modification_ts']); + } + $output .= "
    ' . $labels[$key] . "" . $decodeReq[$key][$req[$key]] . "
    " . + $labels['coverage'] . "$coverage

    " . $req['scope'] . + "
    " . + $labels['relations'] . ""; + + $filler = str_repeat(' ', 5); // MAGIC allowed + foreach ($relations['relations'] as $rel) { + $output .= "{$rel['type_localized']}:
    {$filler}" . + htmlspecialchars($rel['related_req']['req_doc_id']) . + $title_separator . + htmlspecialchars($rel['related_req']['title']) . "
    " . + "{$filler}{$labels['status']}: " . + "{$decodeReq['status'][$rel['related_req']['status']]}
    "; + + if ($req_cfg->relations->interproject_linking) { + $output .= "{$filler}{$labels['relation_project']}: " . + htmlspecialchars( + $rel['related_req']['testproject_name']) . "
    "; + } + } + + $output .= "
    " . + $labels['related_tcs'] . ""; + foreach ($req_coverage[$req['version_id']] as $tc) { + $output .= htmlspecialchars( + $tc['tc_external_id'] . $title_separator . + $tc['testcase_name']) . "  [{$labels['version']}:" . + $tc['version'] . "]"; + } + + $output .= "
    " . + $cflabel . "$value
    " . + $labels['attached_files'] . ""; + + foreach ($attachSet as $fitem) { + $sec = hash('sha256', $fitem['file_name']); + $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . $sec . + '&id=' . $fitem['id']; + + $safeFileName = htmlspecialchars($fitem['file_name']); + if ($fitem['is_image']) { + $output .= "
  • " . $safeFileName . "
  • "; + + $pathname = $repoDir . $item['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize($pathname); + + // Sorry by MAGIC Numbers + if ($iWidth > 900 || $iHeight > 700) { + if ($iWidth > $iHeight) { + $imgDiff = round($iWidth / 600); + } else { + $imgDiff = round($iHeight / 450); + } + $iWidth /= $imgDiff; + $iHeight /= $imgDiff; + } + + $iDim = ' width=' . $iWidth . ' height=' . $iHeight; + $output .= '
  • ' . ''; + } else { + $output .= '
  • ' . ' ' . $safeFileName . ''; + } + } + $output .= "

  • "; + + return $output; +} + +/** + * render a requirement specification node as HTML code for printing + * + * @author Andreas Simon + * + * @param resource $db + * @param array $node + * the node to be printed + * @param array $options + * @param string $tocPrefix + * Prefix to be printed in TOC before title of node + * @param int $level + * @param int $tprojectID + * + * @return string $output HTML Code + */ +function renderReqSpecNodeForPrinting(&$db, &$node, &$options, $tocPrefix, + $rsLevel) +{ + static $tableColspan; + static $firstColWidth; + static $labels; + static $title_separator; + static $req_spec_mgr; + static $tplan_mgr; + static $req_spec_cfg; + static $reqSpecTypeLabels; + static $nodeTypes; + + $output = ''; + $reLevel = ($rsLevel > 0) ? $rsLevel : 1; + + if (! $req_spec_mgr) { + $req_spec_cfg = config_get('req_spec_cfg'); + $firstColWidth = '20%'; + $tableColspan = 2; + $labels = array( + 'requirements_spec' => 'requirements_spec', + 'scope' => 'scope', + 'type' => 'type', + 'author' => 'author', + 'relations' => 'relations', + 'overwritten_count' => 'req_total', + 'coverage' => 'coverage', + 'revision' => 'revision', + 'attached_files' => 'attached_files', + 'undefined_req_spec_type' => 'undefined_req_spec_type', + 'custom_field' => 'custom_field', + 'not_aplicable' => 'not_aplicable' + ); + + $labels = init_labels($labels); + $reqSpecTypeLabels = init_labels($req_spec_cfg->type_labels); + $title_separator = config_get('gui_title_separator_1'); + $req_spec_mgr = new requirement_spec_mgr($db); + $tplan_mgr = new testplan($db); + $nodeTypes = array_flip( + $tplan_mgr->tree_manager->get_available_node_types()); + } + + switch ($nodeTypes[$node['node_type_id']]) { + case 'requirement_spec_revision': + $spec = $req_spec_mgr->getRevisionByID($node['id']); + $spec_id = $spec['parent_id']; + $who = array( + 'parent_id' => $spec['parent_id'], + 'item_id' => $spec['id'], + 'tproject_id' => $spec['testproject_id'] + ); + break; + + case 'requirement_spec': + $spec = $req_spec_mgr->get_by_id($node['id']); + $spec_id = $spec['id']; + $who = array( + 'parent_id' => $spec['id'], + 'item_id' => $spec['revision_id'], + 'tproject_id' => $spec['testproject_id'] + ); + break; + } + $name = htmlspecialchars( + $spec['doc_id'] . $title_separator . $spec['title']); + + $docHeadingNumbering = ''; + if ($options['headerNumbering']) { + $docHeadingNumbering = "$tocPrefix. "; + } + + if ($options['docType'] != SINGLE_REQSPEC) { + $output = '

    '; + } + + // Remember that only H1 to H6 exists + $reLevel = ($reLevel > 6) ? 6 : $reLevel; + $reLevel = ($reLevel < 1) ? 1 : $reLevel; + + $output .= "\n"; + + if ($options['toc']) { + $spacing = ($reLevel == 2) ? "
    " : ""; + $options['tocCode'] .= $spacing . '

    ' . '' . $docHeadingNumbering . $name . + "

    \n"; + $output .= "\n"; + } + $output .= '\n"; + + if ($options['req_spec_author']) { + // get author name for node + $author = tlUser::getById($db, $spec['author_id']); + $whois = (is_null($author)) ? lang_get('undefined') : $author->getDisplayName(); + $output .= '\n"; + } + + if ($options['req_spec_type']) { + $output .= '" . ""; + } + + if ($options['req_spec_overwritten_count_reqs']) { + $current = $req_spec_mgr->get_requirements_count($spec_id); // NEEDS REFACTOR + $expected = $spec['total_req']; + $coverage = $labels['not_aplicable'] . " ($current/0)"; + if ($expected) { + $percentage = round(100 / $expected * $current, 2); + $coverage = "{$percentage}% ({$current}/{$expected})"; + } + + $output .= '" . ""; + } + + if ($options['req_spec_scope']) { + $output .= ""; + } + + if ($options['req_spec_cf']) { + + $linked_cf = $req_spec_mgr->get_linked_cfields($who); + if ($linked_cf) { + foreach ($linked_cf as $cf) { + $cflabel = htmlspecialchars($cf['label']); + $value = htmlspecialchars($cf['value']); + + $output .= "" . ""; + } + } + } + + $attachSet = (array) $req_spec_mgr->getAttachmentInfos($spec_id); + if (count($attachSet)) { + $output .= ""; + } + + $output .= "
    " . + " {$docHeadingNumbering}{$labels['requirements_spec']}: " . + $name . "
    ' . + $labels['revision'] . " " . $spec['revision'] . + "
    ' . + $labels['author'] . " " . htmlspecialchars($whois) . + "
    ' . + $labels['type'] . ""; + + if (isset($reqSpecTypeLabels[$spec['type']])) { + $output .= $reqSpecTypeLabels[$spec['type']]; + } else { + $output .= sprintf($labels['undefined_req_spec_type'], $spec['type']); + } + $output .= "
    ' . + $labels['overwritten_count'] . " (" . $labels['coverage'] . + ")" . $coverage . "
    " . $spec['scope'] . + "
    " . + $cflabel . "$value
    " . + $labels['attached_files'] . "
      "; + + foreach ($attachSet as $item) { + $fname = ""; + if ($item['title']) { + $fname .= htmlspecialchars($item['title']) . " : "; + } + $fname .= htmlspecialchars($item['file_name']); + $output .= "
    • $fname
    • "; + } + $output .= "

    \n"; + + return $output; +} + +/** + * render a complete tree, consisting of mixed requirement and req spec nodes, + * as HTML code for printing + * + * @author Andreas Simon + * + * @param resource $db + * @param array $node + * the node to be printed + * @param array $options + * @param string $tocPrefix + * Prefix to be printed in TOC before title of each node + * @param int $level + * @param int $tprojectID + * @param int $user_id + * ID of user which shall be printed as author of the document + * + * @return string $output HTML Code + */ +function renderReqSpecTreeForPrinting(&$db, &$node, &$options, $tocPrefix, + $rsCnt, $rstLevel, $user_id, $tplan_id = 0, $tprojectID = 0) +{ + static $tree_mgr; + static $map_id_descr; + $code = null; + + if (! $tree_mgr) { + $tree_mgr = new tree($db); + $map_id_descr = $tree_mgr->node_types; + } + $verbose_node_type = $map_id_descr[$node['node_type_id']]; + + switch ($verbose_node_type) { + case 'testproject': + + break; + + case 'requirement_spec': + $tocPrefix .= (! is_null($tocPrefix) ? "." : '') . $rsCnt; + $code .= renderReqSpecNodeForPrinting($db, $node, $options, + $tocPrefix, $rstLevel, $tprojectID); + break; + + case 'requirement': + $tocPrefix .= (! is_null($tocPrefix) ? "." : '') . $rsCnt; + $code .= renderReqForPrinting($db, $node, $options, $rstLevel, + $tprojectID); + break; + } + + if (isset($node['childNodes']) && $node['childNodes']) { + + $childNodes = $node['childNodes']; + $rsCnt = 0; + $children_qty = count($childNodes); + for ($i = 0; $i < $children_qty; $i ++) { + $current = $childNodes[$i]; + if (is_null($current)) { + continue; + } + + if (isset($current['node_type_id']) && + $map_id_descr[$current['node_type_id']] == 'requirement_spec') { + $rsCnt ++; + } + + $code .= renderReqSpecTreeForPrinting($db, $current, $options, + $tocPrefix, $rsCnt, $rstLevel + 1, $user_id, $tplan_id, + $tprojectID); + } + } + + if ($verbose_node_type == 'testproject' && $options['toc']) { + $code = str_replace("{{INSERT_TOC}}", $options['tocCode'], $code); + } + + return $code; +} + +/** + * render HTML header + * Standard: HTML 4.01 trans (because is more flexible to bugs in user data) + * + * @param string $title + * @param string $base_href + * Base URL + * + * @return string html data + */ +function renderHTMLHeader($title, $base_href, $doc_type, $jsSet = null) +{ + $themeDir = config_get('theme_dir'); + $docCfg = config_get('document_generator'); + + $cssFile = $base_href . $themeDir; + switch ($doc_type) { + case DOC_REQ_SPEC: + case SINGLE_REQ: + case SINGLE_REQSPEC: + $cssFile .= $docCfg->requirement_css_template; + break; + + case DOC_TEST_SPEC: + case DOC_TEST_PLAN_DESIGN: + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + case SINGLE_TESTCASE: + default: + $cssFile .= $docCfg->css_template; + break; + } + + $output = "\n"; + + $output .= "\n\n"; + $output .= ''; + + $output .= '' . htmlspecialchars($title) . "\n"; + $output .= '\n"; + + // way to add CSS directly to the exported file (not used - test required) + // $docCss = file_get_contents(TL_ABS_PATH . $docCfg->css_template); + // $output .= '\n"; + $output .= ''; + + if (! is_null($jsSet)) { + foreach ($jsSet as $js) { + $output .= "\n" . '' . "\n"; + } + } + + $output .= "\n\n"; + return $output; +} + +/** + * Generate initial page of document + * + * @param object $doc_info + * data with the next string values: + * title + * type_name: what does this means ??? + * author, tproject_name, testplan_name + * @return string html + * @author havlatm + */ +function renderFirstPage($doc_info) +{ + $docCfg = config_get('document_generator'); + $date_format_cfg = config_get('date_format'); + $output = "\n
    \n"; + + // Print header + if ($docCfg->company_name != '') { + $output .= '
    ' . + htmlspecialchars($docCfg->company_name) . "
    \n"; + } + $output .= "
     

    \n"; + + if ($docCfg->company_logo != '') { + // allow to configure height via config file + $safePName = $_SESSION['basehref'] . TL_THEME_IMG_DIR . + $docCfg->company_logo; + list ($iWidth, $iHeight, ,) = getimagesize($safePName); + $output .= '

    TestLink logo

    '; + } + $output .= "
    \n"; + + // Print context + // Report Minimal Description + // Test Project Name + // Test Plan Name + // Build Name (if applicable) + // Test Suite Name (if applicable) + // + $output .= '
    ' . '

    ' . $doc_info->type_name . '

    '; + if ($doc_info->additional_info != '') { + $output .= '

    ' . $doc_info->additional_info . '

    '; + } + $output .= "
    \n"; + $output .= '
    ' . + '

    ' . lang_get('testproject') . ": " . $doc_info->tproject_name; + + if ($doc_info->type == DOC_TEST_PLAN_DESIGN || + $doc_info->type == DOC_TEST_PLAN_EXECUTION || + $doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $output .= '
    ' . lang_get('testplan') . ": " . + $doc_info->testplan_name; + } + + if ($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $output .= '
    ' . lang_get('build') . ": " . $doc_info->build_name; + } + + if ($doc_info->content_range == 'testsuite') { + $output .= '
    ' . lang_get('testsuite') . ": " . $doc_info->title; + } + $output .= '

    ' . "
    \n"; + + $output .= '
    ' . '

    ' . + lang_get('printed_by_TestLink_on') . " " . + @strftime($date_format_cfg, time()) . "

    \n"; + + // Print legal notes + if ($docCfg->company_copyright != '') { + $output .= '\n"; + } + + if ($docCfg->confidential_msg != '') { + $output .= '\n"; + } + + return $output; +} + +/** + * Generate a chapter to a document + * + * @param string $title + * @param string $content + * + * @return string html + * @author havlatm + */ +function renderSimpleChapter($title, $content, $addToStyle = null) +{ + $output = ''; + if ($content != "") { + $sAdd = ! is_null($addToStyle) ? " style=\"{$addToStyle}\" " : ''; + $output .= '

    ' . $title . "

    \n"; + $output .= '
    ' . $content . "
    \n
    "; + } + return $output; +} + +/* + * function: renderTestSpecTreeForPrinting + * args : + * returns: + * + * + * env->base_href + * env->item_type + * env->tocPrefix + * env->testCounter => env->tocCounter + * env->user_id + * + * context['tproject_id'] + * context['tplan_id'] + * context['platform_id'] + * context['build_id'] + * context['level'] >>>>> WRONG + * context['prefix'] + * + */ +function renderTestSpecTreeForPrinting(&$db, &$node, &$options, $env, $context, + $tocPrefix, $indentLevel) +{ + static $tree_mgr; + static $id_descr; + + $code = null; + + if (! $tree_mgr) { + $tree_mgr = new tree($db); + $id_descr = $tree_mgr->node_types; + + $k2i = array( + 'tproject_id' => 0, + 'tplan_id' => 0, + 'platform_id' => 0, + 'build_id' => 0, + 'prefix' => null + ); + $context = array_merge($k2i, $context); + } + + $node_type = $id_descr[intval($node['node_type_id'])]; + switch ($node_type) { + case 'testproject': + break; + + case 'testsuite': + $tocPrefix .= (! is_null($tocPrefix) ? "." : '') . $env->tocCounter; + $code .= renderTestSuiteNodeForPrinting($db, $node, $env, $options, + $context, $tocPrefix, $indentLevel); + break; + + case 'testcase': + $code .= renderTestCaseForPrinting($db, $node, $options, $env, + $context, $indentLevel); + break; + } + + if (isset($node['childNodes']) && $node['childNodes']) { + // Need to be a LOCAL COUNTER for each PARENT + $tocCounter = 0; + $childNodes = $node['childNodes']; + $children_qty = count($childNodes); + for ($idx = 0; $idx < $children_qty; $idx ++) { + $current = $childNodes[$idx]; + if (is_null($current) || $current == REMOVEME) { + continue; + } + + if (isset($current['node_type_id']) && + $id_descr[$current['node_type_id']] == 'testsuite') { + // Each time I found a contained Test Suite need to add a .x.x. to TOC + $tocCounter ++; + } + $env->tocCounter = $tocCounter; + $code .= renderTestSpecTreeForPrinting($db, $current, $options, $env, + $context, $tocPrefix, $indentLevel + 1); + } + } + + if ($node_type == 'testproject' && $options['toc']) { + $code = str_replace("{{INSERT_TOC}}", $options['tocCode'], $code); + } + + return $code; +} + +/** + * get user name from pool (save used names in session to improve performance) + * + * @param integer $db + * DB connection identifier + * @param integer $userId + * + * @return string readable user name + * @author havlatm + */ +function gendocGetUserName(&$db, $userId) +{ + $authorName = null; + + if (isset($_SESSION['userNamePool'][$userId])) { + $authorName = $_SESSION['userNamePool'][$userId]; + } else { + $user = tlUser::getByID($db, $userId); + if ($user) { + $authorName = $user->getDisplayName(); + $authorName = htmlspecialchars($authorName); + $_SESSION['userNamePool'][$userId] = $authorName; + } else { + $authorName = lang_get('undefined'); + tLog('tlUser::getByID($db,$userId) failed', 'ERROR'); + } + } + + return $authorName; +} + +/** + * render Test Case content for generated documents + * + * @param $integer db + * DB connection identifier + * @return string generated html code + * + * @internal revisions + */ +function renderTestCaseForPrinting(&$db, &$node, &$options, $env, $context, + $indentLevel) +{ + static $st; + static $statusL10N; + static $labels; + static $tcase_prefix; + static $cfg; + static $force = null; + + $code = null; + $tcInfo = null; + $tcase_pieces = null; + + $id = $node['id']; + + $level = $indentLevel; + $tplan_id = isset($context['tplan_id']) ? $context['tplan_id'] : 0; + $tprojectID = isset($context['tproject_id']) ? $context['tproject_id'] : 0; + $platform_id = isset($context['platform_id']) ? $context['platform_id'] : 0; + $build_id = isset($context['build_id']) ? $context['build_id'] : 0; + + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + $stepDesignCfg = getWebEditorCfg('steps_design'); + $stepDesignType = $stepDesignCfg['type']; + + // init static elements + if (! $st) { + + $st = new stdClass(); + $statusL10N = array(); + list ($cfg, $labels, $statusL10N) = initRenderTestCaseCfg($options); + $st = initStaticRenderTestCaseForPrinting($db, $node['id'], $context, + $cfg); + $st->statusL10N = $statusL10N; + + $tcase_prefix = $st->tcase_prefix; + + $force['displayVersion'] = isset($options['displayVersion']) ? $options['displayVersion'] : false; + $force['displayLastEdit'] = isset($options['displayLastEdit']) ? $options['displayLastEdit'] : false; + + // change table style in case of single TC printing to not be indented + $st->table_style = ""; + if (isset($options['docType']) && $options['docType'] == SINGLE_TESTCASE) { + $st->table_style = 'style="margin-left: 0;"'; + } + } + + /** + * + * @todo THIS IS NOT THE WAY TO DO THIS IS ABSOLUTELY WRONG AND MUST BE REFACTORED, + * using existent methods - franciscom - 20090329 + * Need to get CF with execution scope + */ + $exec_info = null; + $getByID['filters'] = null; + + $opt = array(); + $opt['step_exec_notes'] = isset($options['step_exec_notes']) && + $options['step_exec_notes']; + $opt['step_exec_status'] = isset($options['step_exec_status']) && + $options['step_exec_status']; + + switch ($options["docType"]) { + case DOC_TEST_SPEC: + $getByID['tcversion_id'] = testcase::LATEST_VERSION; + $getExecutions = false; + break; + + case SINGLE_TESTCASE: + $getByID['tcversion_id'] = $node['tcversion_id']; + $getExecutions = ($options['passfail'] || $options['notes'] || + $opt['step_exec_notes'] || $opt['step_exec_status']); + break; + + default: + $getByID['tcversion_id'] = $node['tcversion_id']; + $getExecutions = ($options['cfields'] || $options['passfail'] || + $options['notes'] || $opt['step_exec_notes'] || + $opt['step_exec_status']); + break; + } + + if ($getExecutions) { + // Thanks to Evelyn from Cortado, have found a very old issue never reported. + // 1. create TC-1A VERSION 1 + // 2. add to test plan and execute FAILED ON BUILD 1 + // 3. Request Test Report (Test Plan EXECUTION REPORT). + // You will get spec for VERSION 1 and result for VERSION 1 - OK cool! + // 4. create VERSION 2 + // 5. update linked Test Case Versions + // 6. do nothing more than repeat step 3 + // without this fix you will get + // You will get spec for VERSION 2 and result for VERSION 1 - Hmmm + // and in addition is not clear that execution was on VERSION 1 . No GOOD!! + // + // HOW has been fixed ? + // Getting info about THE CURRENT LINKED test case version and looking for + // exec info for this. + // + // ATTENTION: THIS IS OK ONLY WHEN BUILD ID is not provided + // + // Get Linked test case version + $linkedItem = $st->tplan_mgr->getLinkInfo($tplan_id, $id, $platform_id); + + $sql = " SELECT E.id AS execution_id, E.status, E.execution_ts, E.tester_id, E.notes, E.build_id, E.tcversion_id, - E.tcversion_number,E.testplan_id," . - " E.execution_type, E.execution_duration, " . - " B.name AS build_name " . - " FROM {$st->tables['executions']} E " . - " JOIN {$st->tables['builds']} B ON B.id = E.build_id " . - " WHERE 1 = 1 "; - - //Bugfix to show only active builds in Test Report view - $sql .= "AND B.active = 1"; - - if(isset($context['exec_id'])) { - $sql .= " AND E.id=" . intval($context['exec_id']); - } else { - $sql .= " AND E.testplan_id = " . intval($tplan_id) . - " AND E.platform_id = " . intval($platform_id) . - " AND E.tcversion_id = " . intval($linkedItem[0]['tcversion_id']); - if($build_id > 0) { - $sql .= " AND E.build_id = " . intval($build_id); - } else { - // We are looking for LATEST EXECUTION of CURRENT LINKED test case version - $sql .= " AND E.tcversion_number=" . intval($linkedItem[0]['version']); - } - $sql .= " ORDER BY execution_id DESC"; - } - - $exec_info = $db->get_recordset($sql,null,1); - - $getByID['tcversion_id'] = $linkedItem[0]['tcversion_id']; - $getByID['filters'] = null; - $linkedItem = null; - - if( !is_null($exec_info) ) { - $getByID['tcversion_id'] = null; - $getByID['filters'] = array('version_number' => $exec_info[0]['tcversion_number']); - $tbuild_id = $exec_info[0]['build_id']; - if( isset($options['build_cfields']) && $options['build_cfields'] ) { - if( !isset($st->buildCfields[$tbuild_id]) ) { - $st->buildCfields[$tbuild_id] = - $st->build_mgr->html_table_of_custom_field_values($tbuild_id,$tprojectID); - } - } - } - } - - $tcInfo = (array)$st->tc_mgr->get_by_id($id,$getByID['tcversion_id'], - $getByID['filters'], - array('renderGhost' => true, - 'renderImageInline' => true)); - - - if( null != $tcInfo && count($tcInfo) > 0) { - $tcInfo = $tcInfo[0]; - } else { - $msg = basename(__FILE__) . ' >' . - 'Line: ' . __LINE__ . ' > ' . - 'Function: ' . __FUNCTION__ . ' > ' . - "Failed to get Test Case Info for ID=" . $id; - - if( $getByID['tcversion_id'] == testcase::ALL_VERSIONS ) { - $msg .= " ALL VERSIONS "; - } else if ( $getByID['tcversion_id'] == testcase::LATEST_VERSION ) { - $msg .= " LATEST VERSION "; - } else { - $msg .= " tcversion id:" . $getByID['tcversion_id']; - } - - tLog( $msg , 'ERROR'); - - throw new Exception($msg, 1); - } - - $tcVersionID = $tcInfo['id']; - - $external_id = $tcase_prefix . $tcInfo['tc_external_id']; - $name = htmlspecialchars($node['name']); - - $cfields = array('specScope' => null, 'execScope' => null); - if ($options['cfields']) { - // Get custom fields that has specification scope - // Custom Field values at Test Case VERSION Level - foreach($st->locationFilters as $fkey => $fvalue) { - $cfields['specScope'][$fkey] = - $st->tc_mgr->html_table_of_custom_field_values($id,'design',$fvalue,null, - $tplan_id,$tprojectID, - $st->cfieldFormatting,$tcInfo['id']); - } - - if (!is_null($exec_info)) { - $cfields['execScope'] = $st->tc_mgr->html_table_of_custom_field_values( - $tcInfo['id'],'execution',null, - $exec_info[0]['execution_id'], $tplan_id, - $tprojectID,$st->cfieldFormatting); - } - } - - if ($options['toc']) { - // EXTERNAL ID added - $options['tocCode'] .= '

    ' . - htmlspecialchars($external_id) . ": ". $name . '

    '; - $code .= ''; - } - - - $code .= '

     

    table_style . '>'; - $code .= '\n"; - - - if ($options['author']) { - $code .= '' . - '\n"; - - if ($tcInfo['updater_id'] > 0) { - // add updater if available and differs from author OR forced - if ($force['displayLastEdit'] > 0 || ($tcInfo['updater_id'] != $tcInfo['author_id']) ) - { - $code .= '' . - '\n"; - } - } - } - - if ($options['body'] || $options['summary']) { - $tcase_pieces = array('summary'); - } - - if ($options['body']) { - $tcase_pieces[] = 'preconditions'; - } - - if( $options['body'] || $options['step_exec_notes'] || $options['step_exec_status'] ){ - $tcase_pieces[] = 'steps'; - } - - if(!is_null($tcase_pieces)) { - // Check user rights in order to understand if can delete attachments here - // function hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) - // $tplan_id = isset($context['tplan_id']) ? $context['tplan_id'] : 0; - // $tprojectID = isset($context['tproject_id']) ? $context['tproject_id'] : 0; - $canManageAttachments = false; - if(isset($context['user']) && !is_null($context['user'])) { - $canManageAttachments = $context['user']->hasRight($db,'testplan_execute',$tprojectID,$tplan_id); - } - - // Multiple Test Case Steps Feature - foreach($tcase_pieces as $key) { - if( $key == 'steps' ) { - if( isset($cfields['specScope']['before_steps_results']) ) { - $code .= $cfields['specScope']['before_steps_results']; - } - - if (!is_null($tcInfo[$key]) && $tcInfo[$key] != '') { - $td_colspan = 3; - $code .= '' . - '' . - '' . - ''; - - $sxni = null; - if($opt['step_exec_notes'] || $opt['step_exec_status']) { - $sxni = $st->tc_mgr->getStepsExecInfo($exec_info[0]['execution_id']); - - if($opt['step_exec_notes']) { - $td_colspan++; - $code .= ''; - } - - if($opt['step_exec_status']) { - $td_colspan++; - $code .= ''; - } - } - - $code .= ''; - - $loop2do = count($tcInfo[$key]); - for($ydx=0 ; $ydx < $loop2do; $ydx++) { - $code .= '' . - '' . - '' . - ''; - - $nike = !is_null($sxni) && isset($sxni[$tcInfo[$key][$ydx]['id']]) && - !is_null($sxni[$tcInfo[$key][$ydx]['id']]); - if( $opt['step_exec_notes'] ) { - $code .= ''; - } - - if( $opt['step_exec_status'] ) { - $code .= ''; - } - $code .= ''; - - // Attachment management - if($getExecutions) { - if( isset($sxni[$tcInfo[$key][$ydx]['id']])) { - $attachInfo = getAttachmentInfos($st->docRepo, - $sxni[$tcInfo[$key][$ydx]['id']]['id'], - $st->tables['execution_tcsteps'],true,1); - - if( !is_null($attachInfo) ) { - $code .= ''; - } - } - } // $getExecutions - - } - } - } - else - { - // disable the field if it's empty - if ($tcInfo[$key] != '') { - $code .= '"; - } - } - } - } - - - $code .= '' . - '\n"; - - // estimated execution time - $code .= '' . - '\n"; - - if( isset($options['importance']) && $options['importance'] ) { - $code .= '' . - '\n"; - } - - - // print priority when printing test plan - if (isset($options['priority']) && $options['priority']) { - // Get priority of this tc version for this test plan by using testplanUrgency class. - // Is there maybe a better method than this one? - $filters = array('tcversion_id' => $tcInfo['id']); - $opt = array('details' => 'tcversion'); - $prio_info = $st->tplan_urgency->getPriority($tplan_id, $filters, $opt); - $prio = $prio_info[$tcInfo['id']]['priority_level']; - - $code .= '' . - '\n"; - } - - // Spacer - $code .= '"; - $code .= $cfields['specScope']['standard_location'] . $cfields['execScope']; - - // - $cfields = null; - $prio_info = null; - - // since 1.9.18 - // TC relations has been migrated to TCV relations - $greenCard = array('tcase_id' => $id, 'tcversion_id' => $tcVersionID); - $relSet = $st->tc_mgr->getTCVersionRelations($greenCard); - - if(!is_null($relSet['relations'])) { - // $fx = str_repeat(' ',5); // MAGIC allowed - $code .= ''; - - $code .= ''; - } - $relSet = null; - - - // collect REQ for Test Case Version - if ($options['requirement']) { - // Coverage Links REQV to TCV - $requirements = (array)$st->req_mgr->getActiveForTCVersion($tcVersionID); - $code .= '\n"; - } - $requirements = null; - - // collect keywords for TC VERSION - if ($options['keyword']) { - $code .= ''; - $code .= '\n"; - } - $kwSet = null; - - // collect platforms for TC VERSION - if ($options['platform']) { - $code .= ''; - $code .= '\n"; - } - $itSet = null; - - - // Attachments - $attachSet = (array)$st->tc_mgr->getAttachmentInfos($tcVersionID); - if (count($attachSet) > 0) { - $code .= ''; - $code .= '"; - } - $attachSet = null; - - - // generate test results data for test report - if ($options['passfail']) { - $tsp = ($cfg['tableColspan']-1); - $code .= '' . '' . - '\n"; - - - $bn = ''; - switch($env->reportType) { - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $ib = $st->build_mgr->get_by_id($build_id); - $bn = htmlspecialchars($ib['name']); - break; - - case DOC_TEST_PLAN_EXECUTION: - if ($exec_info) { - $bn = htmlspecialchars($exec_info[0]['build_name']); - } - break; - } - - /* Build name */ - if( $bn != '' ) { - $code .= '' . - '\n"; - - if(is_null($exec_info)) { - if(!is_null($buildCfields) && - isset($st->buildCfields[$build_id]) && - $st->buildCfields[$build_id] != '') { - $code .= '' . '\n"; - } - } - } - - if( isset($node['assigned_to']) ) { - $crew = explode(',',$node['assigned_to']); - $code .= '' . - '\n"; - } - - if ($exec_info) { - $settings['cfg'] = $cfg; - $settings['lbl'] = $labels; - $settings['opt'] = array('show_notes' => $options['notes']); - $settings['colspan'] = $cfg['tableColspan']-1; - - $code .= - buildTestExecResults($db,$its,$exec_info,$settings,$st->buildCfields); - - // Get Execution Attachments - // Need to fixed in a better way - // Seems that when creating attachment I use 'executions' - // instead of real table name. - // Name will be different is TABLE PREFIX is configured - // - $execAttachInfo = - getAttachmentInfos($st->docRepo,$exec_info[0]['execution_id'],'executions', - true,1); - - if( !is_null($execAttachInfo) ) { - $code .= ''; - } - - } - else - { - $code .= '' . - '\n"; - } - $execAttachInfo = null; - $exec_info = null; - } - - $code .= "
    ' . - $labels['test_case'] . " " . - htmlspecialchars($external_id) . ": " . $name; - - // add test case version - switch($env->reportType) { - case DOC_TEST_PLAN_DESIGN: - $version_number = isset($node['version']) ? $node['version'] : $tcInfo['version']; - break; - - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $version_number = $tcInfo['version']; - break; - - default: - $version_number = $tcInfo['version']; - break; - } - - if($cfg['doc']->tc_version_enabled || $force['displayVersion'] ) { - $code .= ' ' . - $cfg['gui']->version_separator_open . - $labels['version'] . $cfg['gui']->title_separator_1 . $version_number . - $cfg['gui']->version_separator_close . ''; - } - $code .= "
    ' . - ''.$labels['author'].':' . - gendocGetUserName($db, $tcInfo['author_id']); - - if(isset($options['displayDates']) && $options['displayDates']) { - $dummy = null; - $code .= ' - ' . localize_dateOrTimeStamp(null,$dummy,'timestamp_format',$tcInfo['creation_ts']); - } - $code .= "
    ' . - ''. $labels['last_edit'] . ':' . - gendocGetUserName($db, $tcInfo['updater_id']); - - if(isset($options['displayDates']) && $options['displayDates']) { - $dummy = null; - $code .= ' - ' . localize_dateOrTimeStamp(null,$dummy,'timestamp_format',$tcInfo['modification_ts']); - } - $code .= "
    ' . $labels['step_number'] .':' . $labels['step_actions'] .':' . $labels['expected_results'] .':' . $labels['step_exec_notes'] .':' . $labels['step_exec_status'] .':
    ' . $tcInfo[$key][$ydx]['step_number'] . - '' . ($stepDesignType == 'none' ? nl2br($tcInfo[$key][$ydx]['actions']) : $tcInfo[$key][$ydx]['actions'] ) . '' . ($stepDesignType == 'none' ? nl2br($tcInfo[$key][$ydx]['expected_results']) : $tcInfo[$key][$ydx]['expected_results'] ) . ''; - if( $nike ) { - $code .= nl2br($sxni[$tcInfo[$key][$ydx]['id']]['notes']); - } - $code .= ''; - if( $nike ) { - $sk = $sxni[$tcInfo[$key][$ydx]['id']]; - if(isset($statusL10N[$sk['status']])) - { - $code .= $statusL10N[$sk['status']]; - } - } - $code .= '
    '; - $code .= '' . $labels['exec_attachments'] . '
    '; - - foreach($attachInfo as $fitem) { - $code .= '
    '; - - $code .= ''; - - $safeItemID = intval($fitem['id']); - $code .= ''; - - $safeFileName = htmlspecialchars($fitem['file_name']); - $sec = hash('sha256',$fitem['file_name']); - $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . - $sec . '&id=' . $safeItemID; - - - if($fitem['is_image']) { - $code .= "
  • {$safeFileName}
  • "; - $pathname = $st->repoDir . $fitem['file_path']; - list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname); - - // Sorry by MAGIC Numbers - if($iWidth > 900 or $iHeight > 700) { - if($iWidth > $iHeight) { - $imgDiff = round($iWidth / 600); - } else { - $imgDiff = round($iHeight / 450); - } - $iWidth = $iWidth/$imgDiff; - $iHeight = $iHeight/$imgDiff; - } - - $iDim = ' width=' . $iWidth . - ' height=' . $iHeight; - $code .= '
  • '; - } else { - $code .= '
  • ' . $safeFileName . ''; - } - $code .= '
  • '; - } - $code .= '
    ' . $labels[$key] . - ':
    ' . ($designType == 'none' ? nl2br($tcInfo[$key]) : $tcInfo[$key] ) . "
    ' . - ''.$labels['execution_type'].':'; - - - // This is what have been choosen DURING DESIGN, but may be we can choose at DESIGN - // manual and the execute AUTO, or may be choose AUTO and execute MANUAL. - // After report on MANTIS, seems that we need to provide in output two values: - // DESIGN execution type - // EXECUTION execution type - switch ($tcInfo['execution_type']) { - case TESTCASE_EXECUTION_TYPE_AUTO: - $code .= $labels['execution_type_auto']; - break; - - case TESTCASE_EXECUTION_TYPE_MANUAL: - default: - $code .= $labels['execution_type_manual']; - break; - } - $code .= "
    ' . - ''. $labels['estimated_execution_duration'].':' . $tcInfo['estimated_exec_duration']; - $code .= "
    ' . - ''.$labels['importance'].':' . - $cfg['importance'][$tcInfo['importance']]; - $code .= "
    ' . - ''.$labels['priority'].':' . $cfg['priority'][$prio]; - $code .= "
    ' . "
    ' . $labels['relations'] . ''; - for($rdx=0; $rdx < $relSet['num_relations']; $rdx++) { - if($relSet['relations'][$rdx]['source_id'] == $id) { - $ak = 'source_localized'; - } - else { - $ak = 'destination_localized'; - } - - $code .= htmlspecialchars($relSet['relations'][$rdx][$ak]) . ' - ' . - htmlspecialchars($relSet['relations'][$rdx]['related_tcase']['fullExternalID']) . ':' . - htmlspecialchars($relSet['relations'][$rdx]['related_tcase']['name']) . "  [{$labels['version']}:" . - $relSet['relations'][$rdx]['related_tcase']['version'] . "]"; - } - $code .= '
    '. - $labels['reqs'].''; - $code .= ''; - - if (sizeof($requirements)) { - foreach ($requirements as $req) { - $code .= htmlspecialchars($req['req_doc_id'] . ": " . $req['title']) . - " " . - $cfg['gui']->version_separator_open . - "{$labels['version']}: {$req['version']}" . - $cfg['gui']->version_separator_close . - "
    "; - } - } else { - $code .= ' ' . $labels['none'] . '
    '; - } - $code .= "
    '. - $labels['keywords'].':'; - - $kwSet = (array)$st->tc_mgr->getKeywords($id,$tcVersionID,null,array('fields' => 'keyword_id,KW.keyword')); - if (sizeof($kwSet)) { - foreach ($kwSet as $kw) { - $code .= htmlspecialchars($kw['keyword']) . "
    "; - } - } else { - $code .= ' ' . $labels['none'] . '
    '; - } - $code .= "
    '. - $labels['platforms'].':'; - - $itSet = (array)$st->tc_mgr->getPlatforms($id,$tcVersionID,null,array('fields' => 'platform_id,PL.name')); - if (sizeof($itSet)) { - foreach ($itSet as $it) { - $code .= htmlspecialchars($it['name']) . "
    "; - } - } else { - $code .= ' ' . $labels['none'] . '
    '; - } - $code .= "
    ' . $labels['attached_files'] . '
      '; - - foreach($attachSet as $item) { - $fname = ""; - if ($item['title']) { - $fname .= htmlspecialchars($item['title']) . " : "; - } - $fname .= htmlspecialchars($item['file_name']); - $code .= "
    • $fname
    • "; - - $sec = hash('sha256',$item['file_name']); - - $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . $sec . - '&id=' . $item['id']; - - if($item['is_image']) { - $pathname = $st->repoDir . $item['file_path']; - list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname); - - $iDim = ' width=' . $iWidth . ' height=' . $iHeight; - $code .= '
    • ' . '
    • '; - } else { - $code .= '
    • ' . ' ' . htmlspecialchars($item['file_name']) . '
    • '; - } - } - $code .="
    ' . - $labels['execution_details'] .'' . " " . "
    ' . - $labels['build'] .'' . $bn . "
    ' . - $st->buildCfields[$build_id] . "
    ' . - $labels['assigned_to'] . ''; - - $xdx = 0; - foreach($crew as $mm) { - if ($xdx != 0) { - $code .= ','; - } - $xdx = -1; - echo $mm .'
    '; - $code .= gendocGetUserName($db, $mm); - } - $code .= "
    '; - $code .= '' . $labels['exec_attachments'] . '
    '; - foreach($execAttachInfo as $fitem) { - $sec = hash('sha256',$fitem['file_name']); - - $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . $sec . - '&id=' . $fitem['id']; - - $safeFileName = htmlspecialchars($fitem['file_name']); - if($fitem['is_image']) { - $code .= "
  • {$safeFileName}
  • "; - - $pathname = $st->repoDir . $item['file_path']; - list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname); - - // Sorry by MAGIC Numbers - if($iWidth > 900 or $iHeight > 700) { - if($iWidth > $iHeight) { - $imgDiff = round($iWidth / 600); - } else { - $imgDiff = round($iHeight / 450); - } - $iWidth = $iWidth/$imgDiff; - $iHeight = $iHeight/$imgDiff; - } - // --- - - - $iDim = ' width=' . $iWidth . ' height=' . $iHeight; - $code .= '
  • ' . '
  • '; - } else { - $code .= '
  • ' . ' ' . $safeFileName . '
  • '; - } - } - $code .= '
    ' . - '' . $labels['report_exec_result'] . '' . $labels["test_status_not_run"] . - "
    \n
    \n"; - return $code; -} - - -/** - * - * - * - */ -function renderTOC(&$options) -{ - $code = ''; - $options['toc_numbers'][1] = 0; - if ($options['toc']) - { - $options['tocCode'] = '

    ' . - lang_get('title_toc').'

    '; - $code .= "{{INSERT_TOC}}"; - } - - return $code; -} - - -/* - function: renderTestSuiteNodeForPrinting - args : - returns: - - ATTENTION: This variables: $tocPrefix,$indentLevel - - can not be passed on a data type that pass by reference - because need to have LOCAL life during recursion. - Having added it as members of $env and $context has generated a BUG -*/ -function renderTestSuiteNodeForPrinting(&$db,&$node,$env,&$options,$context,$tocPrefix,$indentLevel) -{ - static $tsuite_mgr; - static $l10n; - static $title_separator; - static $cfieldFormatting; - static $getOpt; - static $reporDir; - - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - if(is_null($l10n)) { - $repoDir = config_get('repositoryPath'); - $tsuite_mgr = new testsuite($db); - - $l10n = array('test_suite' => 'test_suite', 'details' => 'details', - 'attached_files' => 'attached_files'); - - $l10n = init_labels($l10n); - - $title_separator = config_get('gui_title_separator_1'); - $cfieldFormatting = array('table_css_style' => 'class="cf"'); - - $getOpt['getByID'] = array('fields' => ' TS.id,TS.details ', - 'renderImageInline' => true); - } - - $code = null; - $name = isset($node['name']) ? htmlspecialchars($node['name']) : ''; - $cfields = array('design' => ''); - - $docHeadingNumbering = $options['headerNumbering'] ? ($tocPrefix . ".") : ''; - - if ($options['toc']) { - $spacing = ($indentLevel == 2 && $tocPrefix != 1) ? "
    " : ""; - $options['tocCode'] .= $spacing.'

    ' . - '' . $docHeadingNumbering . - $name . "

    \n"; - $code .= "\n"; - } - - // we would like to have html top heading H1 - H6 - $docHeadingLevel = ($indentLevel-1); - - // Remember that only H1 to H6 exists - $docHeadingLevel = ($docHeadingLevel > 6) ? 6 : $docHeadingLevel; - $docHeadingLevel = ($docHeadingLevel < 1) ? 1 : $docHeadingLevel; - - $code .= "" . $docHeadingNumbering . $l10n['test_suite'] . - $title_separator . $name . "\n"; - - - // ----- get Test Suite text ----------------- - if ($options['header']) { - - $tInfo = $tsuite_mgr->get_by_id($node['id'],$getOpt['getByID']); - if ($tInfo['details'] != '') { - $code .= '
    ' . ($designType == 'none' ? nl2br($tInfo['details']) : $tInfo['details'] ) . '
    '; - } - $tInfo = null; - - $attachSet = (array)$tsuite_mgr->getAttachmentInfos($node['id']); - if (count($attachSet) > 0) { - $code .= ''; - $code .= ''; - $code .= '"; - $code .= "
    ' . $l10n['attached_files'] . '
     
      '; - foreach($attachSet as $item) { - $fname = ""; - if ($item['title']) { - $fname .= htmlspecialchars($item['title']) . " : "; - } - $fname .= htmlspecialchars($item['file_name']); - $code .= "
    • $fname
    • "; - - - $sec = hash('sha256',$item['file_name']); - $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . - $sec . '&id=' . $item['id']; - - if($item['is_image']) { - $pathname = $repoDir . $item['file_path']; - list($iWidth, $iHeight, $iT, $iA) = getimagesize($pathname); - $iDim = ' width=' . $iWidth . ' height=' . $iHeight; - $code .= '
    • ' . '
    • '; - } else { - $code .= '
    • ' . ' ' . htmlspecialchars($item['file_name']) . '
    • '; - } - } - $code .="
    "; - } - $attachSet = null; - - // get Custom fields - // Attention: for test suites custom fields can not be edited during execution, - // then we need to get just custom fields with scope 'design' - foreach($cfields as $key => $value) { - $cfields[$key] = - $tsuite_mgr->html_table_of_custom_field_values($node['id'],$key,null, - $context['tproject_id'], - $cfieldFormatting); - if($cfields[$key] != "") { - $add_br = true; - $code .= '

    ' . $cfields[$key] . '

    '; - } - } - $cfields = null; - } - return $code; -} - - - - -/* - function: renderTestPlanForPrinting - args: - returns: - - @internal revisions: -*/ -function renderTestPlanForPrinting(&$db,&$node,&$options,$env,$context) { - $tProjectMgr = new testproject($db); - $context['prefix'] = $tProjectMgr->getTestCasePrefix($context['tproject_id']); - $code = - renderTestSpecTreeForPrinting($db,$node,$options,$env,$context,$env->tocPrefix,$context['level']); - return $code; -} - - -/** - * Render HTML for estimated and real execute duration based on contribution - * - * @param array_of_strings $statistics - * @return string HTML code - */ -function renderTestDuration($statistics,$platform_id=0) { - static $ecfg; - - $output = ''; - $hasOutput = false; - - if(!$ecfg) { - $ecfg = config_get('exec_cfg'); - } - $estimatedTimeAvailable = isset($statistics['estimated_execution']) && !is_null($statistics['estimated_execution']); - - if($ecfg->features->exec_duration->enabled) { - $realTimeAvailable = isset($statistics['real_execution']) && - !is_null($statistics['real_execution']['platform'][$platform_id]); - } else { - $realTimeAvailable = null; - } - - - if( $estimatedTimeAvailable || $realTimeAvailable) { - if($estimatedTimeAvailable) { - $estimated_minutes = $statistics['estimated_execution']['platform'][$platform_id]['minutes']; - $tcase_qty = $statistics['estimated_execution']['platform'][$platform_id]['tcase_qty']; - if($estimated_minutes > 0) { - if($estimated_minutes > 60) { - $estimated_string = lang_get('estimated_time_hours') . round($estimated_minutes/60,2) ; - } - else - { - $estimated_string = lang_get('estimated_time_min') . $estimated_minutes; - } - $estimated_string = sprintf($estimated_string,$tcase_qty); - $output .= '

    ' . $estimated_string . "

    \n"; - } - } - - if($realTimeAvailable) { - $real_minutes = $statistics['real_execution']['platform'][$platform_id]['minutes']; - $tcase_qty = $statistics['real_execution']['platform'][$platform_id]['tcase_qty']; - if( $real_minutes > 0 ) { - if($real_minutes > 60) { - $real_string = lang_get('real_time_hours') . round($real_minutes/60,2) ; - } else { - $real_string = lang_get('real_time_min') . $real_minutes; - } - $real_string = sprintf($real_string,$tcase_qty); - $output .= '

    ' . $real_string . "

    \n"; - } - } - } - - if($output != '') { - $output = "
    \n" . $output . "
    \n"; - } - - return $output; -} - - -/** - * get final markup for HTML - * - * @return string HTML - **/ -function renderEOF() { - return "\n\n"; -} - - -/** - * compose html text for metrics (meantime estimated time only) - * - * @return string html - */ -function buildTestPlanMetrics($statistics,$platform_id = 0) { - static $lbl; - if(!$lbl) { - $lbl = lang_get('execution_time_metrics'); - } - - $output =''; - $dummy = renderTestDuration($statistics,$platform_id); - if($dummy != '') - { - $output = '

    ' . $lbl . "

    \n" . $dummy; - } - return $output; -} - - -/** - * utility function to allow easy reading of code - * on renderTestCaseForPrinting() - * - * @return map with configuration and labels - * - */ -function initRenderTestCaseCfg($options) { - $config = null; - $config['firstColWidth'] = '20%'; - $config['doc'] = config_get('document_generator'); - $config['gui'] = config_get('gui'); - $config['testcase'] = config_get('testcase_cfg'); - $config['results'] = config_get('results'); - $config['exec_cfg'] = config_get('exec_cfg'); - - $config['tableColspan'] = 4; - if( (isset($options['step_exec_notes']) && $options['step_exec_notes']) ) { - $config['tableColspan']++; - } - if( (isset($options['step_exec_status']) && $options['step_exec_status']) ) { - $config['tableColspan']++; - } - - - foreach($config['results']['code_status'] as $key => $value) { - $config['status_labels'][$key] = - "check your \$tlCfg->results['status_label'] configuration "; - if( isset($config['results']['status_label'][$value]) ) { - $config['status_labels'][$key] = lang_get($config['results']['status_label'][$value]); - } - } - - $labelsKeys=array('last_exec_result', 'report_exec_result','execution_details', - 'execution_mode','version', 'bugs','tester', - 'title_execution_notes', 'none', 'reqs','author', 'summary', - 'steps', 'expected_results','build', 'test_case', 'keywords', - 'test_status_not_run', 'not_aplicable', 'preconditions','step', - 'step_number', 'step_actions', 'last_edit', 'created_on', - 'execution_type', - 'execution_type_manual','execution_type_auto','importance', - 'relations', - 'estimated_execution_duration','step_exec_notes', - 'step_exec_status', - 'exec_attachments','alt_delete_attachment','assigned_to', - 'high_importance','medium_importance','low_importance', - 'execution_duration', - 'priority', 'high_priority','medium_priority','low_priority', - 'attached_files','platforms'); - - $labelsQty=count($labelsKeys); - for($idx=0; $idx < $labelsQty; $idx++) { - $labels[$labelsKeys[$idx]] = lang_get($labelsKeys[$idx]); - } - - $config['importance'] = array(HIGH => $labels['high_importance'], - MEDIUM => $labels['medium_importance'], - LOW => $labels['low_importance']); - - $config['priority'] = array(HIGH => $labels['high_priority'], - MEDIUM => $labels['medium_priority'], - LOW => $labels['low_priority']); - - - $statusL10N = null; - foreach($config['results']['code_status'] as $vc => $vstat) { - if(isset($config['results']['status_label_for_exec_ui'][$vstat])) { - $statusL10N[$vc] = - lang_get($config['results']['status_label_for_exec_ui'][$vstat]); - } - } - - - return array($config,$labels,$statusL10N); -} - - -/** - * - * @internal revisions - * @since 1.9.12 - * - * - */ -function buildTestExecResults(&$dbHandler,&$its,$exec_info,$opt,$buildCF=null) -{ - static $testerNameCache; - $out=''; - - $my['opt'] = array('show_notes' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $cfg = &$opt['cfg']; - - $labels = &$opt['lbl']; - $testStatus = $cfg['status_labels'][$exec_info[0]['status']]; - - if(!isset($testerNameCache[$exec_info[0]['tester_id']])) - { - $testerNameCache[$exec_info[0]['tester_id']] = - gendocGetUserName($dbHandler, $exec_info[0]['tester_id']); - } - - $executionNotes = $my['opt']['show_notes'] ? $exec_info[0]['notes'] : ''; - - switch($exec_info[0]['execution_type']) - { - case TESTCASE_EXECUTION_TYPE_AUTO: - $etk = 'execution_type_auto'; - break; - - case TESTCASE_EXECUTION_TYPE_MANUAL: - default: - $etk = 'execution_type_manual'; - break; - } - - $td_colspan = ''; - if( !is_null($opt['colspan']) ) - { - $td_colspan .= ' colspan="' . $opt['colspan'] . '" '; - } - - // Check if CF exits for this BUILD - if(!is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']]) && - $buildCF[$exec_info[0]['build_id']] != '') - { - $out .= '' . - '' . $buildCF[$exec_info[0]['build_id']] . "\n"; - } - $out .= '' . $labels['tester'] .'' . - '' . $testerNameCache[$exec_info[0]['tester_id']] . "\n"; - - - $out .= '' . - '' . $labels['report_exec_result'] . ':' . - '' . $testStatus . "\n" . - - '' . - '' . $labels['execution_mode'] . ':' . - '' . $labels[$etk] . "\n"; - - if($cfg['exec_cfg']->features->exec_duration->enabled) - { - $out .= '' . - '' . $labels['execution_duration'] . ':' . - - '' . - (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : " ") . - "\n"; - } - - if ($executionNotes != '') // show execution notes is not empty - { - $out .= ''.$labels['title_execution_notes'] . '' . - '' . nl2br($executionNotes) . "\n"; - } - - if( !is_null($its) ) - { - $bugs = get_bugs_for_exec($dbHandler,$its,$exec_info[0]['execution_id']); - - if ($bugs) - { - $bugString = ''; - foreach($bugs as $bugID => $bugInfo) - { - if($bugInfo['step_number'] != '') - { - $bugString .= $labels['step'] . ' ' . $bugInfo['step_number'] . ' - '; - } - $bugString .= $bugInfo['link_to_bts']."
    "; - } - $out .= '' . - $labels['bugs'] . '' . $bugString ."\n"; - - } - } - - return $out; -} - - -/** - * Render HTML header for a given platform. - * Also adds code to $options['tocCode'] - */ -function renderPlatformHeading($tocPrefix, $platform,&$options) -{ - $platformCfg = getWebEditorCfg('platform'); - $platformType = $platformCfg['type']; - $lbl = lang_get('platform'); - $name = htmlspecialchars($platform['name']); - $options['tocCode'] .= '

     

    ' . "$tocPrefix. $lbl" . ':' . $name . '

    '; - - $out = '

    $tocPrefix. $lbl: $name

    "; - // platform description is enabled with test plan description option settings - if ($options['showPlatformNotes']) - { - $out .= '
    ' . ( $platformType == 'none' ? nl2br($platform['notes']) : $platform['notes'] ) . "
    \n
    "; - } - return $out; -} - - -/** - * simple utility function, to avoid lot of copy and paste - * given an string, return an string useful to jump to an anchor on document - */ -function prefixToHTMLID($string2convert,$anchor_prefix='toc_') { - return $anchor_prefix . str_replace('.', '_', $string2convert); -} - -function renderTestProjectItem($info) { - $testProjectCfg = getWebEditorCfg('testproject'); - $testProjectType = $testProjectCfg['type']; - $lbl = init_labels(array('testproject' => null, 'context' => null, 'scope' => null)); - $out = ''; - $out .= renderSimpleChapter($lbl['testproject'] . ': ' . htmlspecialchars($info->tproject_name), - ($testProjectType == 'none' ? nl2br($info->tproject_scope) : $info->tproject_scope ) ); - return $out; -} - -/** - * - */ -function renderTestPlanItem($info) { - $testPlanCfg = getWebEditorCfg('testplan'); - $testPlanType = $testPlanCfg['type']; - $lbl = init_labels(array('testplan' => null, 'scope' => null)); - $out = ''; - $out .= renderSimpleChapter($lbl['testplan'] . ': ' . htmlspecialchars($info->testplan_name), - ($testPlanType == 'none' ? nl2br($info->testplan_scope) : $info->testplan_scope ), 'page-break-before: avoid;'); - return $out; -} - - - -/** - * - */ -function renderExecutionForPrinting(&$dbHandler, $baseHref, $id, $userObj = null) -{ - static $tprojectMgr; - static $tcaseMgr; - static $st; - - $out = ''; - - if(!$st) - { - $st = new stdClass(); - $st->tables = tlDBObject::getDBTables(array('executions','builds')); - - $tprojectMgr = new testproject($dbHandler); - $tcaseMgr = new testcase($dbHandler); - $tplanMgr = new testplan($dbHandler); - } - - $sql = " SELECT E.id AS execution_id, E.status, E.execution_ts, E.tester_id," . - " E.notes, E.build_id, E.tcversion_id,E.tcversion_number,E.testplan_id," . - " E.platform_id,E.execution_duration, " . - " B.name AS build_name, B.id AS build_id " . - " FROM {$st->tables['executions']} E " . - " JOIN {$st->tables['builds']} B ON B.id = E.build_id " . - " WHERE E.id = " . intval($id); - - $exec_info = $dbHandler->get_recordset($sql); - if( !is_null($exec_info) ) - { - $exec_info = $exec_info[0]; - - - $context['exec_id'] = intval($id); - - $context['tplan_id'] = $exec_info['testplan_id']; - $context['platform_id'] = $exec_info['platform_id']; - $context['build_id'] = $exec_info['build_id']; - $context['level'] = '??'; // ??? - - $node = $tprojectMgr->tree_manager->get_node_hierarchy_info($context['tplan_id']); - $context['prefix'] = $tprojectMgr->getTestCasePrefix($node['parent_id']); - $context['tproject_id'] = $node['parent_id']; - unset($tprojectMgr); - - // IMPORTANT DEVELOPMENT NOTICE - // Remember that on executions table we have following fields - // - // testplan_id - // tcversion_id - // tcversion_number - // - // a. (testplan_id ,tcversion_id) ARE LINK To testplan_tcversions table - // b. if user creates a new version of a LINKED AND EXECUTED test case - // when he/she updates test plan, ONLY tcversion_id is updated, - // while tcversion_number HAS ALWAYS the VERSION HUMAN READABLE NUMBER - // of executed version. - // - // Then if you want to access specification of executed test case version - // you need to proceed this way - // 1. with tcversion_id => get test case id - // 2. using test case id AND tcversion_number you access the data. - // - // Why is important to remember this? - // Because here we need to get data for renderTestCaseForPrinting - // - // The Cinematic Orchestra: To build a home Incubus: Wish you were here Mau Mau: La ola - $node = $tcaseMgr->tree_manager->get_node_hierarchy_info($exec_info['tcversion_id']); - - // get_by_id($id,$version_id = self::ALL_VERSIONS, $filters = null, $options=null) - $tcase = $tcaseMgr->get_by_id($node['parent_id'],null,array('version_number' => $exec_info['tcversion_number'])); - - - $renderOptions = array('toc' => 0,'body' => 1,'summary' => 1, 'header' => 0,'headerNumbering' => 0, - 'passfail' => 1, 'author' => 1, 'notes' => 1, 'requirement' => 1, 'keyword' => 1, - 'cfields' => 1, 'displayVersion' => 1, 'displayDates' => 1, - 'docType' => SINGLE_TESTCASE, 'importance' => 1, - 'step_exec_notes' => 1, 'step_exec_status' => 1); - - // need to change keys - $tcase = $tcase[0]; - $tcase['tcversion_id'] = $tcase['id']; - $tcase['id'] = $node['parent_id']; - - $env = new stdClass(); - $env->base_href = $baseHref; - $env->reportType = $renderOptions['docType']; - - $indentLevel = 100000; - - $context['user'] = $userObj; - $out .= renderTestCaseForPrinting($dbHandler,$tcase,$renderOptions,$env,$context,$indentLevel); - - $tplanInfo = $tplanMgr->get_by_id($context['tplan_id']); - $out .= '
    ' . lang_get('direct_link') . ':' . - $env->base_href . 'lnl.php?type=exec&id=' . intval($id) . - '&apikey=' . $tplanInfo['api_key'] . '
    '; - $exec_info = null; - } - - return $out; -} - -/** - * - */ -function renderBuildItem($info) { - $cfg = getWebEditorCfg('build'); - $buildType = $cfg['type']; - $lbl = init_labels(array('build' => null, 'notes' => null)); - $out = ''; - - $title = $lbl['build'] . ': ' . htmlspecialchars($info->build_name); - $out .= renderSimpleChapter($title, - ($buildType == 'none' ? nl2br($info->build_notes) : $info->build_notes), - 'page-break-before: avoid;'); - - return $out; + E.tcversion_number,E.testplan_id," . + " E.execution_type, E.execution_duration, " . + " B.name AS build_name " . " FROM {$st->tables['executions']} E " . + " JOIN {$st->tables['builds']} B ON B.id = E.build_id " . + " WHERE 1 = 1 "; + + // Bugfix to show only active builds in Test Report view + $sql .= "AND B.active = 1"; + + if (isset($context['exec_id'])) { + $sql .= " AND E.id=" . intval($context['exec_id']); + } else { + $sql .= " AND E.testplan_id = " . intval($tplan_id) . + " AND E.platform_id = " . intval($platform_id) . + " AND E.tcversion_id = " . intval( + $linkedItem[0]['tcversion_id']); + if ($build_id > 0) { + $sql .= " AND E.build_id = " . intval($build_id); + } else { + // We are looking for LATEST EXECUTION of CURRENT LINKED test case version + $sql .= " AND E.tcversion_number=" . + intval($linkedItem[0]['version']); + } + $sql .= " ORDER BY execution_id DESC"; + } + + $exec_info = $db->get_recordset($sql, null, 1); + + $getByID['tcversion_id'] = $linkedItem[0]['tcversion_id']; + $getByID['filters'] = null; + $linkedItem = null; + + if (! is_null($exec_info)) { + $getByID['tcversion_id'] = null; + $getByID['filters'] = array( + 'version_number' => $exec_info[0]['tcversion_number'] + ); + $tbuild_id = $exec_info[0]['build_id']; + if (isset($options['build_cfields']) && $options['build_cfields'] && + ! isset($st->buildCfields[$tbuild_id])) { + $st->buildCfields[$tbuild_id] = $st->build_mgr->html_table_of_custom_field_values( + $tbuild_id, $tprojectID); + } + } + } + + $tcInfo = (array) $st->tc_mgr->get_by_id($id, $getByID['tcversion_id'], + $getByID['filters'], + array( + 'renderGhost' => true, + 'renderImageInline' => true + )); + + if (! empty($tcInfo)) { + $tcInfo = $tcInfo[0]; + } else { + $msg = basename(__FILE__) . ' >' . 'Line: ' . __LINE__ . ' > ' . + 'Function: ' . __FUNCTION__ . ' > ' . + "Failed to get Test Case Info for ID=" . $id; + + if ($getByID['tcversion_id'] == testcase::ALL_VERSIONS) { + $msg .= " ALL VERSIONS "; + } elseif ($getByID['tcversion_id'] == testcase::LATEST_VERSION) { + $msg .= " LATEST VERSION "; + } else { + $msg .= " tcversion id:" . $getByID['tcversion_id']; + } + + tLog($msg, 'ERROR'); + + throw new Exception($msg, 1); + } + + $tcVersionID = $tcInfo['id']; + + $external_id = $tcase_prefix . $tcInfo['tc_external_id']; + $name = htmlspecialchars($node['name']); + + $cfields = array( + 'specScope' => null, + 'execScope' => null + ); + if ($options['cfields']) { + // Get custom fields that has specification scope + // Custom Field values at Test Case VERSION Level + foreach ($st->locationFilters as $fkey => $fvalue) { + $cfields['specScope'][$fkey] = $st->tc_mgr->html_table_of_custom_field_values( + $id, 'design', $fvalue, null, $tplan_id, $tprojectID, + $st->cfieldFormatting, $tcInfo['id']); + } + + if (! is_null($exec_info)) { + $cfields['execScope'] = $st->tc_mgr->html_table_of_custom_field_values( + $tcInfo['id'], 'execution', null, $exec_info[0]['execution_id'], + $tplan_id, $tprojectID, $st->cfieldFormatting); + } + } + + if ($options['toc']) { + // EXTERNAL ID added + $options['tocCode'] .= '

    ' . + htmlspecialchars($external_id) . ": " . $name . '

    '; + $code .= ''; + } + + $code .= '

     

    table_style . '>'; + $code .= '\n"; + + if ($options['author']) { + $code .= '' . + '\n"; + + // add updater if available and differs from author OR forced + if ($tcInfo['updater_id'] > 0 && $force['displayLastEdit'] > 0 || + ($tcInfo['updater_id'] != $tcInfo['author_id'])) { + $code .= '' . '\n"; + } + } + + if ($options['body'] || $options['summary']) { + $tcase_pieces = array( + 'summary' + ); + } + + if ($options['body']) { + $tcase_pieces[] = 'preconditions'; + } + + if ($options['body'] || $options['step_exec_notes'] || + $options['step_exec_status']) { + $tcase_pieces[] = 'steps'; + } + + if (! is_null($tcase_pieces)) { + // Check user rights in order to understand if can delete attachments here + // function hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) + // $tplan_id = isset($context['tplan_id']) ? $context['tplan_id'] : 0; + // $tprojectID = isset($context['tproject_id']) ? $context['tproject_id'] : 0; + // $canManageAttachments = false; + // if(isset($context['user']) && !is_null($context['user'])) { + // $canManageAttachments = $context['user']->hasRight($db,'testplan_execute',$tprojectID,$tplan_id); + // } + + // Multiple Test Case Steps Feature + foreach ($tcase_pieces as $key) { + if ($key == 'steps') { + if (isset($cfields['specScope']['before_steps_results'])) { + $code .= $cfields['specScope']['before_steps_results']; + } + + if (! is_null($tcInfo[$key]) && $tcInfo[$key] != '') { + $td_colspan = 3; + $code .= '' . '' . + '' . ''; + + $sxni = null; + if ($opt['step_exec_notes'] || $opt['step_exec_status']) { + $sxni = $st->tc_mgr->getStepsExecInfo( + $exec_info[0]['execution_id']); + + if ($opt['step_exec_notes']) { + $td_colspan ++; + $code .= ''; + } + + if ($opt['step_exec_status']) { + $td_colspan ++; + $code .= ''; + } + } + + $code .= ''; + + $loop2do = count($tcInfo[$key]); + for ($ydx = 0; $ydx < $loop2do; $ydx ++) { + $code .= '' . '' . '' . ''; + + $nike = ! is_null($sxni) && + isset($sxni[$tcInfo[$key][$ydx]['id']]) && + ! is_null($sxni[$tcInfo[$key][$ydx]['id']]); + if ($opt['step_exec_notes']) { + $code .= ''; + } + + if ($opt['step_exec_status']) { + $code .= ''; + } + $code .= ''; + + // Attachment management + if ($getExecutions && + isset($sxni[$tcInfo[$key][$ydx]['id']])) { + $attachInfo = getAttachmentInfos($st->docRepo, + $sxni[$tcInfo[$key][$ydx]['id']]['id'], + $st->tables['execution_tcsteps'], true, 1); + + if (! is_null($attachInfo)) { + $code .= ''; + } + } + } + } + } else { + // disable the field if it's empty + if ($tcInfo[$key] != '') { + $code .= '"; + } + } + } + } + + $code .= '' . + '\n"; + + // estimated execution time + $code .= '' . '\n"; + + if (isset($options['importance']) && $options['importance']) { + $code .= '' . + '\n"; + } + + // print priority when printing test plan + if (isset($options['priority']) && $options['priority']) { + // Get priority of this tc version for this test plan by using testplanUrgency class. + // Is there maybe a better method than this one? + $filters = array( + 'tcversion_id' => $tcInfo['id'] + ); + $opt = array( + 'details' => 'tcversion' + ); + $prio_info = $st->tplan_urgency->getPriority($tplan_id, $filters, $opt); + $prio = $prio_info[$tcInfo['id']]['priority_level']; + + $code .= '' . + '\n"; + } + + // Spacer + $code .= '"; + $code .= $cfields['specScope']['standard_location'] . $cfields['execScope']; + + $cfields = null; + $prio_info = null; + + // since 1.9.18 + // TC relations has been migrated to TCV relations + $greenCard = array( + 'tcase_id' => $id, + 'tcversion_id' => $tcVersionID + ); + $relSet = $st->tc_mgr->getTCVersionRelations($greenCard); + + if (! is_null($relSet['relations'])) { + // $fx = str_repeat(' ',5); // MAGIC allowed + $code .= ''; + + $code .= ''; + } + $relSet = null; + + // collect REQ for Test Case Version + if (isset($options['requirement'])) { + // Coverage Links REQV to TCV + $requirements = (array) $st->req_mgr->getActiveForTCVersion( + $tcVersionID); + $code .= '\n"; + } + $requirements = null; + + // collect keywords for TC VERSION + if (isset($options['keyword'])) { + $code .= ''; + $code .= '\n"; + } + $kwSet = null; + + // collect platforms for TC VERSION + if (isset($options['platform'])) { + $code .= ''; + $code .= '\n"; + } + $itSet = null; + + // Attachments + $attachSet = (array) $st->tc_mgr->getAttachmentInfos($tcVersionID); + if (! empty($attachSet)) { + $code .= ''; + $code .= '"; + } + $attachSet = null; + + // generate test results data for test report + if ($options['passfail']) { + $tsp = ($cfg['tableColspan'] - 1); + $code .= '' . + '' . '\n"; + + $bn = ''; + switch ($env->reportType) { + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $ib = $st->build_mgr->get_by_id($build_id); + $bn = htmlspecialchars($ib['name']); + break; + + case DOC_TEST_PLAN_EXECUTION: + if ($exec_info) { + $bn = htmlspecialchars($exec_info[0]['build_name']); + } + break; + } + + /* Build name */ + if ($bn != '') { + $code .= '' . '\n"; + + if (is_null($exec_info) && ! is_null($buildCfields) && + isset($st->buildCfields[$build_id]) && + $st->buildCfields[$build_id] != '') { + $code .= '' . '\n"; + } + } + + if (isset($node['assigned_to'])) { + $crew = explode(',', $node['assigned_to']); + $code .= '' . + '\n"; + } + + if ($exec_info) { + $settings['cfg'] = $cfg; + $settings['lbl'] = $labels; + $settings['opt'] = array( + 'show_notes' => $options['notes'] + ); + $settings['colspan'] = $cfg['tableColspan'] - 1; + + $code .= buildTestExecResults($db, $its, $exec_info, $settings, + $st->buildCfields); + + // Get Execution Attachments + // Need to fixed in a better way + // Seems that when creating attachment I use 'executions' + // instead of real table name. + // Name will be different is TABLE PREFIX is configured + // + $execAttachInfo = getAttachmentInfos($st->docRepo, + $exec_info[0]['execution_id'], 'executions', true, 1); + + if (! is_null($execAttachInfo)) { + $code .= ''; + } + } else { + $code .= '' . '\n"; + } + $execAttachInfo = null; + $exec_info = null; + } + + $code .= "
    ' . + $labels['test_case'] . " " . htmlspecialchars($external_id) . ": " . + $name; + + // add test case version + switch ($env->reportType) { + case DOC_TEST_PLAN_DESIGN: + $version_number = isset($node['version']) ? $node['version'] : $tcInfo['version']; + break; + + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $version_number = $tcInfo['version']; + break; + + default: + $version_number = $tcInfo['version']; + break; + } + + if ($cfg['doc']->tc_version_enabled || $force['displayVersion']) { + $code .= ' ' . + $cfg['gui']->version_separator_open . $labels['version'] . + $cfg['gui']->title_separator_1 . $version_number . + $cfg['gui']->version_separator_close . ''; + } + $code .= "
    ' . + '' . $labels['author'] . ':' . + gendocGetUserName($db, $tcInfo['author_id']); + + if (isset($options['displayDates']) && $options['displayDates']) { + $dummy = null; + $code .= ' - ' . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $tcInfo['creation_ts']); + } + $code .= "
    ' . '' . $labels['last_edit'] . + ':' . gendocGetUserName($db, $tcInfo['updater_id']); + + if (isset($options['displayDates']) && $options['displayDates']) { + $dummy = null; + $code .= ' - ' . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $tcInfo['modification_ts']); + } + $code .= "
    ' . + $labels['step_number'] . ':' . $labels['step_actions'] . + ':' . + $labels['expected_results'] . ':' . + $labels['step_exec_notes'] . ':' . + $labels['step_exec_status'] . ':
    ' . + $tcInfo[$key][$ydx]['step_number'] . '' . + ($stepDesignType == 'none' ? nl2br( + $tcInfo[$key][$ydx]['actions']) : $tcInfo[$key][$ydx]['actions']) . + '' . + ($stepDesignType == 'none' ? nl2br( + $tcInfo[$key][$ydx]['expected_results']) : $tcInfo[$key][$ydx]['expected_results']) . + ''; + if ($nike) { + $code .= nl2br( + $sxni[$tcInfo[$key][$ydx]['id']]['notes']); + } + $code .= ''; + if ($nike) { + $sk = $sxni[$tcInfo[$key][$ydx]['id']]; + if (isset($statusL10N[$sk['status']])) { + $code .= $statusL10N[$sk['status']]; + } + } + $code .= '
    '; + $code .= '' . $labels['exec_attachments'] . + '
    '; + + foreach ($attachInfo as $fitem) { + $code .= '
    '; + + $code .= ''; + + $safeItemID = intval($fitem['id']); + $code .= ''; + + $safeFileName = htmlspecialchars( + $fitem['file_name']); + $sec = hash('sha256', $fitem['file_name']); + $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . + $sec . '&id=' . $safeItemID; + + if ($fitem['is_image']) { + $code .= "
  • {$safeFileName}
  • "; + $pathname = $st->repoDir . + $fitem['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize( + $pathname); + + // Sorry by MAGIC Numbers + if ($iWidth > 900 || $iHeight > 700) { + if ($iWidth > $iHeight) { + $imgDiff = round($iWidth / 600); + } else { + $imgDiff = round($iHeight / 450); + } + $iWidth /= $imgDiff; + $iHeight /= $imgDiff; + } + + $iDim = ' width=' . $iWidth . ' height=' . + $iHeight; + $code .= '
  • '; + } else { + $code .= '
  • ' . + $safeFileName . ''; + } + $code .= '
  • '; + } + $code .= '
    ' . $labels[$key] . + ':
    ' . + ($designType == 'none' ? nl2br($tcInfo[$key]) : $tcInfo[$key]) . + "
    ' . + '' . $labels['execution_type'] . ':'; + + // This is what have been choosen DURING DESIGN, but may be we can choose at DESIGN + // manual and the execute AUTO, or may be choose AUTO and execute MANUAL. + // After report on MANTIS, seems that we need to provide in output two values: + // DESIGN execution type + // EXECUTION execution type + switch ($tcInfo['execution_type']) { + case TESTCASE_EXECUTION_TYPE_AUTO: + $code .= $labels['execution_type_auto']; + break; + + case TESTCASE_EXECUTION_TYPE_MANUAL: + default: + $code .= $labels['execution_type_manual']; + break; + } + $code .= "
    ' . + '' . $labels['estimated_execution_duration'] . + ':' . + $tcInfo['estimated_exec_duration']; + $code .= "
    ' . + '' . $labels['importance'] . ':' . + $cfg['importance'][$tcInfo['importance']]; + $code .= "
    ' . + '' . $labels['priority'] . ':' . + $cfg['priority'][$prio]; + $code .= "
    ' . "
    ' . $labels['relations'] . + ''; + for ($rdx = 0; $rdx < $relSet['num_relations']; $rdx ++) { + if ($relSet['relations'][$rdx]['source_id'] == $id) { + $ak = 'source_localized'; + } else { + $ak = 'destination_localized'; + } + + $code .= htmlspecialchars($relSet['relations'][$rdx][$ak]) . ' - ' . + htmlspecialchars( + $relSet['relations'][$rdx]['related_tcase']['fullExternalID']) . + ':' . + htmlspecialchars( + $relSet['relations'][$rdx]['related_tcase']['name']) . + "  [{$labels['version']}:" . + $relSet['relations'][$rdx]['related_tcase']['version'] . "]"; + } + $code .= '
    ' . $labels['reqs'] . ''; + $code .= ''; + + if (count($requirements)) { + foreach ($requirements as $req) { + $code .= htmlspecialchars( + $req['req_doc_id'] . ": " . $req['title']) . " " . + $cfg['gui']->version_separator_open . + "{$labels['version']}: {$req['version']}" . + $cfg['gui']->version_separator_close . "
    "; + } + } else { + $code .= ' ' . $labels['none'] . '
    '; + } + $code .= "
    ' . $labels['keywords'] . + ':'; + + $kwSet = (array) $st->tc_mgr->getKeywords($id, $tcVersionID, null, + array( + 'fields' => 'keyword_id,KW.keyword' + )); + if (count($kwSet)) { + foreach ($kwSet as $kw) { + $code .= htmlspecialchars($kw['keyword']) . "
    "; + } + } else { + $code .= ' ' . $labels['none'] . '
    '; + } + $code .= "
    ' . $labels['platforms'] . + ':'; + + $itSet = (array) $st->tc_mgr->getPlatforms($id, $tcVersionID, null, + array( + 'fields' => 'platform_id,PL.name' + )); + if (count($itSet)) { + foreach ($itSet as $it) { + $code .= htmlspecialchars($it['name']) . "
    "; + } + } else { + $code .= ' ' . $labels['none'] . '
    '; + } + $code .= "
    ' . $labels['attached_files'] . + '
      '; + + foreach ($attachSet as $item) { + $fname = ""; + if ($item['title']) { + $fname .= htmlspecialchars($item['title']) . " : "; + } + $fname .= htmlspecialchars($item['file_name']); + $code .= "
    • $fname
    • "; + + $sec = hash('sha256', $item['file_name']); + + $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . $sec . + '&id=' . $item['id']; + + if ($item['is_image']) { + $pathname = $st->repoDir . $item['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize($pathname); + + $iDim = ' width=' . $iWidth . ' height=' . $iHeight; + $code .= '
    • ' . '
    • '; + } else { + $code .= '
    • ' . ' ' . htmlspecialchars($item['file_name']) . + '
    • '; + } + } + $code .= "
    ' . + $labels['execution_details'] . '' . " " . "
    ' . $labels['build'] . '' . $bn . "
    ' . + $st->buildCfields[$build_id] . "
    ' . $labels['assigned_to'] . ''; + + $xdx = 0; + foreach ($crew as $mm) { + if ($xdx != 0) { + $code .= ','; + } + $xdx = - 1; + echo $mm . '
    '; + $code .= gendocGetUserName($db, $mm); + } + $code .= "
    '; + $code .= '' . $labels['exec_attachments'] . '
    '; + foreach ($execAttachInfo as $fitem) { + $sec = hash('sha256', $fitem['file_name']); + + $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . + $sec . '&id=' . $fitem['id']; + + $safeFileName = htmlspecialchars($fitem['file_name']); + if ($fitem['is_image']) { + $code .= "
  • {$safeFileName}
  • "; + + $pathname = $st->repoDir . $item['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize($pathname); + + // Sorry by MAGIC Numbers + if ($iWidth > 900 || $iHeight > 700) { + if ($iWidth > $iHeight) { + $imgDiff = round($iWidth / 600); + } else { + $imgDiff = round($iHeight / 450); + } + $iWidth /= $imgDiff; + $iHeight /= $imgDiff; + } + + $iDim = ' width=' . $iWidth . ' height=' . $iHeight; + $code .= '
  • ' . '
  • '; + } else { + $code .= '
  • ' . ' ' . $safeFileName . '
  • '; + } + } + $code .= '
    ' . '' . + $labels['report_exec_result'] . '' . + $labels["test_status_not_run"] . "
    \n
    \n"; + return $code; +} + +/** + */ +function renderTOC(&$options) +{ + $code = ''; + $options['toc_numbers'][1] = 0; + if ($options['toc']) { + $options['tocCode'] = '

    ' . + lang_get('title_toc') . '

    '; + $code .= "{{INSERT_TOC}}"; + } + + return $code; +} + +/* + * function: renderTestSuiteNodeForPrinting + * args : + * returns: + * + * ATTENTION: This variables: $tocPrefix,$indentLevel + * + * can not be passed on a data type that pass by reference + * because need to have LOCAL life during recursion. + * Having added it as members of $env and $context has generated a BUG + */ +function renderTestSuiteNodeForPrinting(&$db, &$node, $env, &$options, $context, + $tocPrefix, $indentLevel) +{ + static $tsuite_mgr; + static $l10n; + static $title_separator; + static $cfieldFormatting; + static $getOpt; + + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + if (is_null($l10n)) { + $repoDir = config_get('repositoryPath'); + $tsuite_mgr = new testsuite($db); + + $l10n = array( + 'test_suite' => 'test_suite', + 'details' => 'details', + 'attached_files' => 'attached_files' + ); + + $l10n = init_labels($l10n); + + $title_separator = config_get('gui_title_separator_1'); + $cfieldFormatting = array( + 'table_css_style' => 'class="cf"' + ); + + $getOpt['getByID'] = array( + 'fields' => ' TS.id,TS.details ', + 'renderImageInline' => true + ); + } + + $code = null; + $name = isset($node['name']) ? htmlspecialchars($node['name']) : ''; + $cfields = array( + 'design' => '' + ); + + $docHeadingNumbering = $options['headerNumbering'] ? ($tocPrefix . ".") : ''; + + if ($options['toc']) { + $spacing = ($indentLevel == 2 && $tocPrefix != 1) ? "
    " : ""; + $options['tocCode'] .= $spacing . '

    ' . '' . $docHeadingNumbering . $name . + "

    \n"; + $code .= "\n"; + } + + // we would like to have html top heading H1 - H6 + $docHeadingLevel = ($indentLevel - 1); + + // Remember that only H1 to H6 exists + $docHeadingLevel = ($docHeadingLevel > 6) ? 6 : $docHeadingLevel; + $docHeadingLevel = ($docHeadingLevel < 1) ? 1 : $docHeadingLevel; + + $code .= "" . $docHeadingNumbering . + $l10n['test_suite'] . $title_separator . $name . + "\n"; + + // ----- get Test Suite text ----------------- + if ($options['header']) { + + $tInfo = $tsuite_mgr->get_by_id($node['id'], $getOpt['getByID']); + if ($tInfo['details'] != '') { + $code .= '
    ' . + ($designType == 'none' ? nl2br($tInfo['details']) : $tInfo['details']) . + '
    '; + } + $tInfo = null; + + $attachSet = (array) $tsuite_mgr->getAttachmentInfos($node['id']); + if (! empty($attachSet)) { + $code .= ''; + $code .= ''; + $code .= '"; + $code .= "
    ' . + $l10n['attached_files'] . '
     
      '; + foreach ($attachSet as $item) { + $fname = ""; + if ($item['title']) { + $fname .= htmlspecialchars($item['title']) . " : "; + } + $fname .= htmlspecialchars($item['file_name']); + $code .= "
    • $fname
    • "; + + $sec = hash('sha256', $item['file_name']); + $cmout = 'lib/attachments/attachmentdownload.php?skipCheck=' . + $sec . '&id=' . $item['id']; + + if ($item['is_image']) { + $pathname = $repoDir . $item['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize($pathname); + $iDim = ' width=' . $iWidth . ' height=' . $iHeight; + $code .= '
    • ' . '
    • '; + } else { + $code .= '
    • ' . ' ' . + htmlspecialchars($item['file_name']) . '
    • '; + } + } + $code .= "
    "; + } + $attachSet = null; + + // get Custom fields + // Attention: for test suites custom fields can not be edited during execution, + // then we need to get just custom fields with scope 'design' + foreach ($cfields as $key => $value) { + $cfields[$key] = $tsuite_mgr->html_table_of_custom_field_values( + $node['id'], $key, null, $context['tproject_id'], + $cfieldFormatting); + if ($cfields[$key] != "") { + $code .= '

    ' . $cfields[$key] . '

    '; + } + } + $cfields = null; + } + return $code; +} + +/* + * function: renderTestPlanForPrinting + * args: + * returns: + * + * @internal revisions: + */ +function renderTestPlanForPrinting(&$db, &$node, &$options, $env, $context) +{ + $tProjectMgr = new testproject($db); + $context['prefix'] = $tProjectMgr->getTestCasePrefix( + $context['tproject_id']); + return renderTestSpecTreeForPrinting($db, $node, $options, $env, $context, + $env->tocPrefix, $context['level']); +} + +/** + * Render HTML for estimated and real execute duration based on contribution + * + * @param array $statistics + * @return string HTML code + */ +function renderTestDuration($statistics, $platform_id = 0) +{ + static $ecfg; + + $output = ''; + + if (! $ecfg) { + $ecfg = config_get('exec_cfg'); + } + $estimatedTimeAvailable = isset($statistics['estimated_execution']) && + ! is_null($statistics['estimated_execution']); + + if ($ecfg->features->exec_duration->enabled) { + $realTimeAvailable = isset($statistics['real_execution']) && + ! is_null($statistics['real_execution']['platform'][$platform_id]); + } else { + $realTimeAvailable = null; + } + + if ($estimatedTimeAvailable || $realTimeAvailable) { + if ($estimatedTimeAvailable) { + $estimated_minutes = $statistics['estimated_execution']['platform'][$platform_id]['minutes']; + $tcase_qty = $statistics['estimated_execution']['platform'][$platform_id]['tcase_qty']; + if ($estimated_minutes > 0) { + if ($estimated_minutes > 60) { + $estimated_string = lang_get('estimated_time_hours') . + round($estimated_minutes / 60, 2); + } else { + $estimated_string = lang_get('estimated_time_min') . + $estimated_minutes; + } + $estimated_string = sprintf($estimated_string, $tcase_qty); + $output .= '

    ' . $estimated_string . "

    \n"; + } + } + + if ($realTimeAvailable) { + $real_minutes = $statistics['real_execution']['platform'][$platform_id]['minutes']; + $tcase_qty = $statistics['real_execution']['platform'][$platform_id]['tcase_qty']; + if ($real_minutes > 0) { + if ($real_minutes > 60) { + $real_string = lang_get('real_time_hours') . + round($real_minutes / 60, 2); + } else { + $real_string = lang_get('real_time_min') . $real_minutes; + } + $real_string = sprintf($real_string, $tcase_qty); + $output .= '

    ' . $real_string . "

    \n"; + } + } + } + + if ($output != '') { + $output = "
    \n" . $output . "
    \n"; + } + + return $output; +} + +/** + * get final markup for HTML + * + * @return string HTML + */ +function renderEOF() +{ + return "\n\n"; +} + +/** + * compose html text for metrics (meantime estimated time only) + * + * @return string html + */ +function buildTestPlanMetrics($statistics, $platform_id = 0) +{ + static $lbl; + if (! $lbl) { + $lbl = lang_get('execution_time_metrics'); + } + + $output = ''; + $dummy = renderTestDuration($statistics, $platform_id); + if ($dummy != '') { + $output = '

    ' . $lbl . "

    \n" . $dummy; + } + return $output; +} + +/** + * utility function to allow easy reading of code + * on renderTestCaseForPrinting() + * + * @return array with configuration and labels + * + */ +function initRenderTestCaseCfg($options) +{ + $config = null; + $config['firstColWidth'] = '20%'; + $config['doc'] = config_get('document_generator'); + $config['gui'] = config_get('gui'); + $config['testcase'] = config_get('testcase_cfg'); + $config['results'] = config_get('results'); + $config['exec_cfg'] = config_get('exec_cfg'); + + $config['tableColspan'] = 4; + if (isset($options['step_exec_notes']) && $options['step_exec_notes']) { + $config['tableColspan'] ++; + } + if (isset($options['step_exec_status']) && $options['step_exec_status']) { + $config['tableColspan'] ++; + } + + foreach ($config['results']['code_status'] as $key => $value) { + $config['status_labels'][$key] = "check your \$tlCfg->results['status_label'] configuration "; + if (isset($config['results']['status_label'][$value])) { + $config['status_labels'][$key] = lang_get( + $config['results']['status_label'][$value]); + } + } + + $labelsKeys = array( + 'last_exec_result', + 'report_exec_result', + 'execution_details', + 'execution_mode', + 'version', + 'bugs', + 'tester', + 'title_execution_notes', + 'none', + 'reqs', + 'author', + 'summary', + 'steps', + 'expected_results', + 'build', + 'test_case', + 'keywords', + 'test_status_not_run', + 'not_aplicable', + 'preconditions', + 'step', + 'step_number', + 'step_actions', + 'last_edit', + 'created_on', + 'execution_type', + 'execution_type_manual', + 'execution_type_auto', + 'importance', + 'relations', + 'estimated_execution_duration', + 'step_exec_notes', + 'step_exec_status', + 'exec_attachments', + 'alt_delete_attachment', + 'assigned_to', + 'high_importance', + 'medium_importance', + 'low_importance', + 'execution_duration', + 'priority', + 'high_priority', + 'medium_priority', + 'low_priority', + 'attached_files', + 'platforms' + ); + + $labelsQty = count($labelsKeys); + for ($idx = 0; $idx < $labelsQty; $idx ++) { + $labels[$labelsKeys[$idx]] = lang_get($labelsKeys[$idx]); + } + + $config['importance'] = array( + HIGH => $labels['high_importance'], + MEDIUM => $labels['medium_importance'], + LOW => $labels['low_importance'] + ); + + $config['priority'] = array( + HIGH => $labels['high_priority'], + MEDIUM => $labels['medium_priority'], + LOW => $labels['low_priority'] + ); + + $statusL10N = null; + foreach ($config['results']['code_status'] as $vc => $vstat) { + if (isset($config['results']['status_label_for_exec_ui'][$vstat])) { + $statusL10N[$vc] = lang_get( + $config['results']['status_label_for_exec_ui'][$vstat]); + } + } + + return array( + $config, + $labels, + $statusL10N + ); +} + +/** + * + * @internal revisions + * @since 1.9.12 + * + * + */ +function buildTestExecResults(&$dbHandler, &$its, $exec_info, $opt, + $buildCF = null) +{ + static $testerNameCache; + $out = ''; + + $my['opt'] = array( + 'show_notes' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $cfg = &$opt['cfg']; + + $labels = &$opt['lbl']; + $testStatus = $cfg['status_labels'][$exec_info[0]['status']]; + + if (! isset($testerNameCache[$exec_info[0]['tester_id']])) { + $testerNameCache[$exec_info[0]['tester_id']] = gendocGetUserName( + $dbHandler, $exec_info[0]['tester_id']); + } + + $executionNotes = $my['opt']['show_notes'] ? $exec_info[0]['notes'] : ''; + + switch ($exec_info[0]['execution_type']) { + case TESTCASE_EXECUTION_TYPE_AUTO: + $etk = 'execution_type_auto'; + break; + + case TESTCASE_EXECUTION_TYPE_MANUAL: + default: + $etk = 'execution_type_manual'; + break; + } + + $td_colspan = ''; + if (! is_null($opt['colspan'])) { + $td_colspan .= ' colspan="' . $opt['colspan'] . '" '; + } + + // Check if CF exits for this BUILD + if (! is_null($buildCF) && isset($buildCF[$exec_info[0]['build_id']]) && + $buildCF[$exec_info[0]['build_id']] != '') { + $out .= '' . '' . + $buildCF[$exec_info[0]['build_id']] . "\n"; + } + $out .= '' . + $labels['tester'] . '' . '' . + $testerNameCache[$exec_info[0]['tester_id']] . "\n"; + + $out .= '' . '' . + $labels['report_exec_result'] . ':' . '' . $testStatus . "\n" . '' . + '' . $labels['execution_mode'] . ':' . + '' . $labels[$etk] . "\n"; + + if ($cfg['exec_cfg']->features->exec_duration->enabled) { + $out .= '' . '' . + $labels['execution_duration'] . ':' . '' . + (isset($exec_info[0]['execution_duration']) ? $exec_info[0]['execution_duration'] : " ") . + "\n"; + } + + if ($executionNotes != '') // show execution notes is not empty + { + $out .= '' . + $labels['title_execution_notes'] . '' . '' . nl2br($executionNotes) . "\n"; + } + + if (! is_null($its)) { + $bugs = get_bugs_for_exec($dbHandler, $its, + $exec_info[0]['execution_id']); + + if ($bugs) { + $bugString = ''; + foreach ($bugs as $bugInfo) { + if ($bugInfo['step_number'] != '') { + $bugString .= $labels['step'] . ' ' . $bugInfo['step_number'] . + ' - '; + } + $bugString .= $bugInfo['link_to_bts'] . "
    "; + } + $out .= '' . + $labels['bugs'] . '' . $bugString . + "\n"; + } + } + + return $out; +} + +/** + * Render HTML header for a given platform. + * Also adds code to $options['tocCode'] + */ +function renderPlatformHeading($tocPrefix, $platform, &$options) +{ + $platformCfg = getWebEditorCfg('platform'); + $platformType = $platformCfg['type']; + $lbl = lang_get('platform'); + $name = htmlspecialchars($platform['name']); + $options['tocCode'] .= '

     

    ' . "$tocPrefix. $lbl" . ':' . $name . + '

    '; + + $out = '

    $tocPrefix. $lbl: $name

    "; + // platform description is enabled with test plan description option settings + if ($options['showPlatformNotes']) { + $out .= '
    ' . + ($platformType == 'none' ? nl2br($platform['notes']) : $platform['notes']) . + "
    \n
    "; + } + return $out; +} + +/** + * simple utility function, to avoid lot of copy and paste + * given an string, return an string useful to jump to an anchor on document + */ +function prefixToHTMLID($string2convert, $anchor_prefix = 'toc_') +{ + return $anchor_prefix . str_replace('.', '_', $string2convert); +} + +function renderTestProjectItem($info) +{ + $testProjectCfg = getWebEditorCfg('testproject'); + $testProjectType = $testProjectCfg['type']; + $lbl = init_labels( + array( + 'testproject' => null, + 'context' => null, + 'scope' => null + )); + $out = ''; + $out .= renderSimpleChapter( + $lbl['testproject'] . ': ' . htmlspecialchars($info->tproject_name), + ($testProjectType == 'none' ? nl2br($info->tproject_scope) : $info->tproject_scope)); + return $out; +} + +/** + */ +function renderTestPlanItem($info) +{ + $testPlanCfg = getWebEditorCfg('testplan'); + $testPlanType = $testPlanCfg['type']; + $lbl = init_labels(array( + 'testplan' => null, + 'scope' => null + )); + $out = ''; + $out .= renderSimpleChapter( + $lbl['testplan'] . ': ' . htmlspecialchars($info->testplan_name), + ($testPlanType == 'none' ? nl2br($info->testplan_scope) : $info->testplan_scope), + 'page-break-before: avoid;'); + return $out; +} + +/** + */ +function renderExecutionForPrinting(&$dbHandler, $baseHref, $id, $userObj = null) +{ + static $tprojectMgr; + static $tcaseMgr; + static $st; + + $out = ''; + + if (! $st) { + $st = new stdClass(); + $st->tables = tlDBObject::getDBTables(array( + 'executions', + 'builds' + )); + + $tprojectMgr = new testproject($dbHandler); + $tcaseMgr = new testcase($dbHandler); + $tplanMgr = new testplan($dbHandler); + } + + $sql = " SELECT E.id AS execution_id, E.status, E.execution_ts, E.tester_id," . + " E.notes, E.build_id, E.tcversion_id,E.tcversion_number,E.testplan_id," . + " E.platform_id,E.execution_duration, " . + " B.name AS build_name, B.id AS build_id " . + " FROM {$st->tables['executions']} E " . + " JOIN {$st->tables['builds']} B ON B.id = E.build_id " . + " WHERE E.id = " . intval($id); + + $exec_info = $dbHandler->get_recordset($sql); + if (! is_null($exec_info)) { + $exec_info = $exec_info[0]; + + $context['exec_id'] = intval($id); + + $context['tplan_id'] = $exec_info['testplan_id']; + $context['platform_id'] = $exec_info['platform_id']; + $context['build_id'] = $exec_info['build_id']; + $context['level'] = '??'; // ??? + + $node = $tprojectMgr->tree_manager->get_node_hierarchy_info( + $context['tplan_id']); + $context['prefix'] = $tprojectMgr->getTestCasePrefix($node['parent_id']); + $context['tproject_id'] = $node['parent_id']; + unset($tprojectMgr); + + // IMPORTANT DEVELOPMENT NOTICE + // Remember that on executions table we have following fields + // + // testplan_id + // tcversion_id + // tcversion_number + // + // a. (testplan_id ,tcversion_id) ARE LINK To testplan_tcversions table + // b. if user creates a new version of a LINKED AND EXECUTED test case + // when he/she updates test plan, ONLY tcversion_id is updated, + // while tcversion_number HAS ALWAYS the VERSION HUMAN READABLE NUMBER + // of executed version. + // + // Then if you want to access specification of executed test case version + // you need to proceed this way + // 1. with tcversion_id => get test case id + // 2. using test case id AND tcversion_number you access the data. + // + // Why is important to remember this? + // Because here we need to get data for renderTestCaseForPrinting + // + // The Cinematic Orchestra: To build a home Incubus: Wish you were here Mau Mau: La ola + $node = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $exec_info['tcversion_id']); + + // get_by_id($id,$version_id = self::ALL_VERSIONS, $filters = null, $options=null) + $tcase = $tcaseMgr->get_by_id($node['parent_id'], null, + array( + 'version_number' => $exec_info['tcversion_number'] + )); + + $renderOptions = array( + 'toc' => 0, + 'body' => 1, + 'summary' => 1, + 'header' => 0, + 'headerNumbering' => 0, + 'passfail' => 1, + 'author' => 1, + 'notes' => 1, + 'requirement' => 1, + 'keyword' => 1, + 'cfields' => 1, + 'displayVersion' => 1, + 'displayDates' => 1, + 'docType' => SINGLE_TESTCASE, + 'importance' => 1, + 'step_exec_notes' => 1, + 'step_exec_status' => 1 + ); + + // need to change keys + $tcase = $tcase[0]; + $tcase['tcversion_id'] = $tcase['id']; + $tcase['id'] = $node['parent_id']; + + $env = new stdClass(); + $env->base_href = $baseHref; + $env->reportType = $renderOptions['docType']; + + $indentLevel = 100000; + + $context['user'] = $userObj; + $out .= renderTestCaseForPrinting($dbHandler, $tcase, $renderOptions, + $env, $context, $indentLevel); + + $tplanInfo = $tplanMgr->get_by_id($context['tplan_id']); + $out .= '
    ' . lang_get('direct_link') . ':' . $env->base_href . + 'lnl.php?type=exec&id=' . intval($id) . '&apikey=' . + $tplanInfo['api_key'] . '
    '; + $exec_info = null; + } + + return $out; +} + +/** + */ +function renderBuildItem($info) +{ + $cfg = getWebEditorCfg('build'); + $buildType = $cfg['type']; + $lbl = init_labels(array( + 'build' => null, + 'notes' => null + )); + $out = ''; + + $title = $lbl['build'] . ': ' . htmlspecialchars($info->build_name); + $out .= renderSimpleChapter($title, + ($buildType == 'none' ? nl2br($info->build_notes) : $info->build_notes), + 'page-break-before: avoid;'); + + return $out; +} + +/** + */ +function initStaticRenderTestCaseForPrinting(&$dbH, $tcaseID, $ctx, $cfg) +{ + $things = new stdClass(); + $things->repoDir = config_get('repositoryPath'); + $things->tables = tlDBObject::getDBTables( + array( + 'executions', + 'builds', + 'execution_tcsteps' + )); + + $things->tc_mgr = new testcase($dbH); + $things->tplan_urgency = new testPlanUrgency($dbH); + $things->build_mgr = new build_mgr($dbH); + $things->tplan_mgr = new testplan($dbH); + $things->req_mgr = new requirement_mgr($dbH); + $things->tproject_mgr = new testproject($dbH); + $things->docRepo = tlAttachmentRepository::create($dbH); + + $things->locationFilters = $things->tc_mgr->buildCFLocationMap(); + + $things->buildCfields = array(); + + $prefix = isset($ctx['prefix']) ? $ctx['prefix'] : null; + if (! is_null($prefix)) { + $things->tcase_prefix = $prefix; + } else { + list ($things->tcase_prefix,) = $things->tc_mgr->getPrefix($tcaseID); + } + $things->tcase_prefix .= $cfg['testcase']->glue_character; + + $things->its = null; + $tprojectID = isset($ctx['tproject_id']) ? $ctx['tproject_id'] : 0; + $info = $things->tproject_mgr->get_by_id($tprojectID); + if ($info['issue_tracker_enabled']) { + $it_mgr = new tlIssueTracker($dbH); + $things->its = $it_mgr->getInterfaceObject($tprojectID); + unset($it_mgr); + } + + $things->cfieldFormatting = array( + 'label_css_style' => '', + 'add_table' => false, + 'value_css_style' => ' colspan = "' . ($cfg['tableColspan'] - 1) . '" ' + ); + + return $things; } - - -/** - * - */ -function initStaticRenderTestCaseForPrinting(&$dbH,$tcaseID,$ctx,$cfg) { - - $things = new stdClass(); - $things->repoDir = config_get('repositoryPath'); - $things->tables = - tlDBObject::getDBTables(array('executions','builds','execution_tcsteps')); - - - $things->tc_mgr = new testcase($dbH); - $things->tplan_urgency = new testPlanUrgency($dbH); - $things->build_mgr = new build_mgr($dbH); - $things->tplan_mgr = new testplan($dbH); - $things->req_mgr = new requirement_mgr($dbH); - $things->tproject_mgr = new testproject($dbH); - $things->docRepo = tlAttachmentRepository::create($dbH); - - $things->locationFilters = $things->tc_mgr->buildCFLocationMap(); - - - $things->buildCfields = array(); - - $prefix = isset($ctx['prefix']) ? $ctx['prefix'] : null; - if(!is_null($prefix)) { - $things->tcase_prefix = $prefix; - } else { - list($things->tcase_prefix,$dummy) = $things->tc_mgr->getPrefix($tcaseID); - } - $things->tcase_prefix .= $cfg['testcase']->glue_character; - - - $things->its = null; - $tprojectID = isset($ctx['tproject_id']) ? $ctx['tproject_id'] : 0; - $info = $things->tproject_mgr->get_by_id($tprojectID); - if($info['issue_tracker_enabled']) { - $it_mgr = new tlIssueTracker($dbH); - $things->its = $it_mgr->getInterfaceObject($tprojectID); - unset($it_mgr); - } - - $things->cfieldFormatting = - array('label_css_style' => '', 'add_table' => false, - 'value_css_style' => - ' colspan = "' . ($cfg['tableColspan']-1) . '" ' ); - - - return $things; -} \ No newline at end of file diff --git a/lib/functions/printDocOptions.class.php b/lib/functions/printDocOptions.class.php index 36f67f007e..26f6399d2f 100644 --- a/lib/functions/printDocOptions.class.php +++ b/lib/functions/printDocOptions.class.php @@ -1,140 +1,206 @@ -doc = array(); - - // element format - // - // 'value' => 'toc','description' => 'opt_show_toc','checked' => 'n' - // 'value': will be used to get the value - // 'description': label id, to be used for localization - // - // if checked is not present => 'checked' => 'n' - // - $this->doc[] = array( 'value' => 'toc','description' => 'opt_show_toc'); - $this->doc[] = array( 'value' => 'headerNumbering','description' => 'opt_show_hdrNumbering'); - - // Specific for Documents regarding Requirement Specifications - $this->reqSpec = array(); - $key2init = array('req_spec_scope','req_spec_author', - 'req_spec_overwritten_count_reqs', - 'req_spec_type','req_spec_cf','req_scope', - 'req_author','req_status', - 'req_type','req_cf','req_relations', - 'req_linked_tcs','req_coverage','displayVersion'); - - $yes = array('req_spec_scope' => 'y','req_scope' => 'y'); - foreach($key2init as $key) { - $yn = isset($key2init2yes[$key]) ? $key2init2yes[$key] : 'n'; - $this->reqSpec[] = array('value' => $key,'checked' => $yn, - 'description' => 'opt_' . $key); - } - - $this->testSpec = array(); - $this->testSpec[] = array('value' => 'header','description' => 'opt_show_suite_txt'); - $this->testSpec[] = array('value' => 'summary','description' => 'opt_show_tc_summary','checked' => 'y'); - $this->testSpec[] = array('value' => 'body','description' => 'opt_show_tc_body'); - $this->testSpec[] = array('value' => 'author','description' => 'opt_show_tc_author'); - $this->testSpec[] = array('value' => 'keyword','description' => 'opt_show_tc_keys'); - $this->testSpec[] = array('value' => 'cfields','description' => 'opt_show_cfields'); - $this->testSpec[] = array( 'value' => 'requirement','description' => 'opt_show_tc_reqs'); - - $this->exec = array(); - $this->exec[] = array( 'value' => 'execResultsByCFOnExecCombination','description' => 'opt_cfexec_comb'); - - $this->exec[] = array('value' => 'notes', 'description' => 'opt_show_tc_notes'); - - $this->exec[] = array('value' => 'step_exec_notes', 'description' => 'opt_show_tcstep_exec_notes'); - - $this->exec[] = array('value' => 'passfail','description' => 'opt_show_passfail','checked' => 'y'); - - $this->exec[] = array('value' => 'step_exec_status','description' => 'opt_show_tcstep_exec_status','checked' => 'y'); - - $this->exec[] = array('value' => 'build_cfields','description' => 'opt_show_build_cfields','checked' => 'n'); - $this->exec[] = array('value' => 'metrics','description' => 'opt_show_metrics'); - - } - - /** - * - */ - function getDocOpt() { - return $this->doc; - } - - /** - * - */ - function getTestSpecOpt() { - return $this->testSpec; - } - - /** - * - */ - function getReqSpecOpt() { - return $this->reqSpec; - } - - - /** - * - */ - function getExecOpt() { - return $this->exec; - } - - - /** - * - */ - function getAllOptVars() { - - $ov = array(); - $prop = array('doc','testSpec','reqSpec','exec'); - foreach($prop as $pp) { - foreach($this->$pp as $ele) { - $ov[$ele['value']] = isset($ele['checked']) ? $ele['checked'] : 'n'; - $ov[$ele['value']] = ($ov[$ele['value']] == 'y') ? 1 : 0; - } - } - - return $ov; - } - - /** - * - */ - function getJSPrintPreferences() { - - $ov = array(); - $prop = array("doc","testSpec","reqSpec","exec"); - foreach($prop as $pp) { - foreach($this->$pp as $ele) { - $ov[] = $ele['value']; - } - } - return implode(',',$ov); - } - - - - - - +doc = array(); + + // element format + // + // 'value' => 'toc','description' => 'opt_show_toc','checked' => 'n' + // 'value': will be used to get the value + // 'description': label id, to be used for localization + // + // if checked is not present => 'checked' => 'n' + $this->doc[] = array( + 'value' => 'toc', + 'description' => 'opt_show_toc' + ); + $this->doc[] = array( + 'value' => 'headerNumbering', + 'description' => 'opt_show_hdrNumbering' + ); + + // Specific for Documents regarding Requirement Specifications + $this->reqSpec = array(); + $key2init = array( + 'req_spec_scope', + 'req_spec_author', + 'req_spec_overwritten_count_reqs', + 'req_spec_type', + 'req_spec_cf', + 'req_scope', + 'req_author', + 'req_status', + 'req_type', + 'req_cf', + 'req_relations', + 'req_linked_tcs', + 'req_coverage', + 'displayVersion' + ); + + foreach ($key2init as $key) { + $yn = isset($key2init2yes[$key]) ? $key2init2yes[$key] : 'n'; + $this->reqSpec[] = array( + 'value' => $key, + 'checked' => $yn, + 'description' => 'opt_' . $key + ); + } + + $this->testSpec = array(); + $this->testSpec[] = array( + 'value' => 'header', + 'description' => 'opt_show_suite_txt' + ); + $this->testSpec[] = array( + 'value' => 'summary', + 'description' => 'opt_show_tc_summary', + 'checked' => 'y' + ); + $this->testSpec[] = array( + 'value' => 'body', + 'description' => 'opt_show_tc_body' + ); + $this->testSpec[] = array( + 'value' => 'author', + 'description' => 'opt_show_tc_author' + ); + $this->testSpec[] = array( + 'value' => 'keyword', + 'description' => 'opt_show_tc_keys' + ); + $this->testSpec[] = array( + 'value' => 'cfields', + 'description' => 'opt_show_cfields' + ); + $this->testSpec[] = array( + 'value' => 'requirement', + 'description' => 'opt_show_tc_reqs' + ); + + $this->exec = array(); + $this->exec[] = array( + 'value' => 'execResultsByCFOnExecCombination', + 'description' => 'opt_cfexec_comb' + ); + + $this->exec[] = array( + 'value' => 'notes', + 'description' => 'opt_show_tc_notes' + ); + + $this->exec[] = array( + 'value' => 'step_exec_notes', + 'description' => 'opt_show_tcstep_exec_notes' + ); + + $this->exec[] = array( + 'value' => 'passfail', + 'description' => 'opt_show_passfail', + 'checked' => 'y' + ); + + $this->exec[] = array( + 'value' => 'step_exec_status', + 'description' => 'opt_show_tcstep_exec_status', + 'checked' => 'y' + ); + + $this->exec[] = array( + 'value' => 'build_cfields', + 'description' => 'opt_show_build_cfields', + 'checked' => 'n' + ); + $this->exec[] = array( + 'value' => 'metrics', + 'description' => 'opt_show_metrics' + ); + } + + /** + */ + public function getDocOpt() + { + return $this->doc; + } + + /** + */ + public function getTestSpecOpt() + { + return $this->testSpec; + } + + /** + */ + public function getReqSpecOpt() + { + return $this->reqSpec; + } + + /** + */ + public function getExecOpt() + { + return $this->exec; + } + + /** + */ + public function getAllOptVars() + { + $ov = array(); + $prop = array( + 'doc', + 'testSpec', + 'reqSpec', + 'exec' + ); + foreach ($prop as $pp) { + foreach ($this->$pp as $ele) { + $ov[$ele['value']] = isset($ele['checked']) ? $ele['checked'] : 'n'; + $ov[$ele['value']] = ($ov[$ele['value']] == 'y') ? 1 : 0; + } + } + + return $ov; + } + + /** + */ + public function getJSPrintPreferences() + { + $ov = array(); + $prop = array( + "doc", + "testSpec", + "reqSpec", + "exec" + ); + foreach ($prop as $pp) { + foreach ($this->$pp as $ele) { + $ov[] = $ele['value']; + } + } + return implode(',', $ov); + } } diff --git a/lib/functions/remote_exec.php b/lib/functions/remote_exec.php index 5057c3173c..a1d016c2f2 100644 --- a/lib/functions/remote_exec.php +++ b/lib/functions/remote_exec.php @@ -1,133 +1,134 @@ - - * - * @internal revisions - * 20110308 - franciscom - refactoring - */ -require_once("../../config.inc.php"); -require_once (TL_ABS_PATH . 'third_party'. DIRECTORY_SEPARATOR . 'xml-rpc/class-IXR.php'); - -/** -* 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. -* -* @param $tcaseInfo: -* @param $serverCfg: -* @param $context -* -* @return map: -* keys: 'result','notes','message' -* values: 'result' -> (Pass, Fail or Blocked) -* 'notes' -> Notes text -* 'message' -> Message from server -*/ -function executeTestCase($tcaseInfo,$serverCfg,$context) -{ - // system: to give info about conection to remote execution server - // execution: - // scheduled: domain 'now', 'future' - // caller will use this attribute to write exec result (only if now) - // timestampISO: can be used by server to say the scheduled time. - // To be used only if scheduled = 'future' - // - // Complete date plus hours, minutes and seconds: - // YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) - // - // where: - // - // YYYY = four-digit year - // MM = two-digit month (01=January, etc.) - // DD = two-digit day of month (01 through 31) - // hh = two digits of hour (00 through 23) (am/pm NOT allowed) - // mm = two digits of minute (00 through 59) - // ss = two digits of second (00 through 59) - // TZD = time zone designator (Z or +hh:mm or -hh:mm) - - - $ret = array('system' => array('status' => 'ok', 'msg' => 'ok'), - 'execution' => array('scheduled' => '', - 'result' => '', - 'resultVerbose' => '', - 'notes' => '', - 'timestampISO' => '') ); - - - $labels = init_labels(array('remoteExecServerConfigProblems' => null, - 'remoteExecServerConnectionFailure' => null)); - - - $do_it = (!is_null($serverCfg) && !is_null($serverCfg["url"]) ); - if(!$do_it) - { - $ret['system']['status'] = 'configProblems'; - $ret['system']['msg'] = $labels['remoteExecServerConfigProblems']; - } - - if($do_it) - { - $xmlrpcClient = new IXR_Client($serverCfg["url"]); - if( is_null($xmlrpcClient) ) - { - $do_it = false; - $ret['system']['status'] = 'connectionFailure'; - $ret['system']['msg'] = $labels['remoteExecServerConnectionFailure']; - } - } - - if($do_it) - { - $args4call = array(); - - // Execution Target - $args4call['testCaseName'] = $tcaseInfo['name']; - $args4call['testCaseID'] = $tcaseInfo['id']; - $args4call['testCaseVersionID'] = $tcaseInfo['version_id']; - - // Context - $args4call['testProjectID'] = $context['tproject_id']; - $args4call['testPlanID'] = $context['tplan_id']; - $args4call['platformID'] = $context['platform_id']; - $args4call['buildID'] = $context['build_id']; - $args4call['executionMode'] = 'now'; // domain: deferred,now - - $xmlrpcClient->query('executeTestCase',$args4call); - $response = $xmlrpcClient->getResponse(); - - if( is_null($response) ) - { - // Houston we have a problem!!! (Apollo 13) - $ret['system']['status'] = 'connectionFailure'; - $ret['system']['msg'] = $labels['remoteExecServerConnectionFailure']; - $ret['execution'] = null; - } - else - { - $ret['execution'] = $response; - $ret['execution']['resultVerbose'] = ''; - - if(!is_null($response['result'])) - { - $code = trim($response['result']); - if( $code != '') - { - $resultsCfg = config_get('results'); - $codeStatus = array_flip($resultsCfg['status_code']); - $dummy = trim($codeStatus[$code]); - $ret['execution']['resultVerbose'] = lang_get($resultsCfg['status_label'][$dummy]); - } - } - } - } - - return $ret; -} // function end -?> \ No newline at end of file + + * + * @internal revisions + * 20110308 - franciscom - refactoring + */ +require_once '../../config.inc.php'; +require_once TL_ABS_PATH . 'third_party' . DIRECTORY_SEPARATOR . + 'xml-rpc/class-IXR.php'; + +/** + * 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. + * + * @param + * $tcaseInfo: + * @param + * $serverCfg: + * @param + * $context + * + * @return map: keys: 'result','notes','message' + * values: 'result' -> (Pass, Fail or Blocked) + * 'notes' -> Notes text + * 'message' -> Message from server + */ +function executeTestCase($tcaseInfo, $serverCfg, $context) +{ + // system: to give info about conection to remote execution server + // execution: + // scheduled: domain 'now', 'future' + // caller will use this attribute to write exec result (only if now) + // timestampISO: can be used by server to say the scheduled time. + // To be used only if scheduled = 'future' + // + // Complete date plus hours, minutes and seconds: + // YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00) + // + // where: + // + // YYYY = four-digit year + // MM = two-digit month (01=January, etc.) + // DD = two-digit day of month (01 through 31) + // hh = two digits of hour (00 through 23) (am/pm NOT allowed) + // mm = two digits of minute (00 through 59) + // ss = two digits of second (00 through 59) + // TZD = time zone designator (Z or +hh:mm or -hh:mm) + $ret = array( + 'system' => array( + 'status' => 'ok', + 'msg' => 'ok' + ), + 'execution' => array( + 'scheduled' => '', + 'result' => '', + 'resultVerbose' => '', + 'notes' => '', + 'timestampISO' => '' + ) + ); + + $labels = init_labels( + array( + 'remoteExecServerConfigProblems' => null, + 'remoteExecServerConnectionFailure' => null + )); + + $do_it = (! is_null($serverCfg) && ! is_null($serverCfg["url"])); + if (! $do_it) { + $ret['system']['status'] = 'configProblems'; + $ret['system']['msg'] = $labels['remoteExecServerConfigProblems']; + } + + if ($do_it) { + $xmlrpcClient = new IXR_Client($serverCfg["url"]); + if (is_null($xmlrpcClient)) { + $do_it = false; + $ret['system']['status'] = 'connectionFailure'; + $ret['system']['msg'] = $labels['remoteExecServerConnectionFailure']; + } + } + + if ($do_it) { + $args4call = array(); + + // Execution Target + $args4call['testCaseName'] = $tcaseInfo['name']; + $args4call['testCaseID'] = $tcaseInfo['id']; + $args4call['testCaseVersionID'] = $tcaseInfo['version_id']; + + // Context + $args4call['testProjectID'] = $context['tproject_id']; + $args4call['testPlanID'] = $context['tplan_id']; + $args4call['platformID'] = $context['platform_id']; + $args4call['buildID'] = $context['build_id']; + $args4call['executionMode'] = 'now'; // domain: deferred,now + + $xmlrpcClient->query('executeTestCase', $args4call); + $response = $xmlrpcClient->getResponse(); + + if (is_null($response)) { + // Houston we have a problem!!! (Apollo 13) + $ret['system']['status'] = 'connectionFailure'; + $ret['system']['msg'] = $labels['remoteExecServerConnectionFailure']; + $ret['execution'] = null; + } else { + $ret['execution'] = $response; + $ret['execution']['resultVerbose'] = ''; + + if (! is_null($response['result'])) { + $code = trim($response['result']); + if ($code != '') { + $resultsCfg = config_get('results'); + $codeStatus = array_flip($resultsCfg['status_code']); + $dummy = trim($codeStatus[$code]); + $ret['execution']['resultVerbose'] = lang_get( + $resultsCfg['status_label'][$dummy]); + } + } + } + } + + return $ret; +} +?> diff --git a/lib/functions/reports.class.php b/lib/functions/reports.class.php index e0d9bc20c1..b7b79dcb8f 100644 --- a/lib/functions/reports.class.php +++ b/lib/functions/reports.class.php @@ -1,162 +1,168 @@ -db = $db; - $this->testPlanID = $tplanId; - // tlObjectWithDB::__construct($db); - parent::__construct($this->db); - } - - - /** - * Function returns array with input for reports navigator - * - * @param object $context - * @param boolean $bug_interface_enabled - * @param boolean $req_mgmt_enabled - * @param integer $format format identifier - * - * @return array of array - described for array $g_reports_list in const.inc.php - **/ - public function get_list_reports($context,$bug_interface_enabled, $req_mgmt_enabled, $format) { - - $reportList = config_get('reports_list'); - $items = array(); - - $toggleMsg = lang_get('show_hide_direct_link'); - $canNotCreateDirectLink = lang_get('can_not_create_direct_link'); - - $apiKeyLen = strlen(trim($context->apikey)); - $apiKeyIsValid = ($apiKeyLen == 32 || $apiKeyLen == 64); // I'm sorry for MAGIC - - $xdx = 0; - - foreach ($reportList as &$rptItem) { - // check validity of report - if (($rptItem['enabled'] == 'all') || - (($rptItem['enabled'] == 'req') && $req_mgmt_enabled) || - (($rptItem['enabled'] == 'bts') && $bug_interface_enabled)) { - - if (strpos(",".$rptItem['format'],$format) > 0) { - $reportUrl = $rptItem['url'] . ( stristr($rptItem['url'], "?") ? '&' : '?'); - $items[$xdx] = - array('name' => lang_get($rptItem['title']), - 'href' => $reportUrl, 'directLink' => ''); - - if(isset($rptItem['directLink']) && - trim($rptItem['directLink']) != '') { - if($apiKeyIsValid) { - $items[$xdx]['directLink'] = - sprintf($rptItem['directLink'],$_SESSION['basehref'], - $context->apikey,$context->tproject_id,$context->tplan_id); - } else { - $items[$xdx]['directLink'] = $canNotCreateDirectLink; - } - } - - $dl = $items[$xdx]['directLink']; - $mask = '%s'; - - $divClass = 'direct_link_' . $xdx; - $items[$xdx]['toggle'] = sprintf($mask,$toggleMsg,$toggleMsg,$divClass); - $items[$xdx]['directLinkDiv'] = ''; - $xdx++; - } - } - } - return $items; - } - - - /** - * get count of builds - * - * @param boolean $active (optional) query open builds [0,1] - * @param boolean $open (optional) query active builds [0,1] - * - * @return integer count of builds - */ - public function get_count_builds($active=1, $open=0) { - $sql = " SELECT COUNT(0) FROM {$this->tables['builds']} builds " . - " WHERE builds.testplan_id = {$this->testPlanID} "; - - if( $active ) - { - $sql .= " AND active=" . intval($active) . " "; - } - - if( $open ) - { - $sql .= " AND is_open=" . intval($open) . " "; - } - - return $this->db->fetchOneValue($sql); - } - - - /** - * get count of testcase linked to a testplan - * @return integer count - */ - public function get_count_testcase4testplan() - { - $sql = " SELECT COUNT(0) FROM {$this->tables['testplan_tcversions']} testplan_tcversions " . - " WHERE testplan_id = {$this->testPlanID} "; - return $this->db->fetchOneValue($sql); - } - -} // end class result - -?> \ No newline at end of file +db = $db; + $this->testPlanID = $tplanId; + parent::__construct($this->db); + } + + /** + * Function returns array with input for reports navigator + * + * @param object $context + * @param boolean $bug_interface_enabled + * @param boolean $req_mgmt_enabled + * @param integer $format + * format identifier + * + * @return array of array - described for array $g_reports_list in const.inc.php + */ + public function get_list_reports($context, $bug_interface_enabled, + $req_mgmt_enabled, $format) + { + $reportList = config_get('reports_list'); + $items = array(); + + $toggleMsg = lang_get('show_hide_direct_link'); + $canNotCreateDirectLink = lang_get('can_not_create_direct_link'); + + $apiKeyLen = strlen(trim($context->apikey)); + $apiKeyIsValid = ($apiKeyLen == 32 || $apiKeyLen == 64); // I'm sorry for MAGIC + + $xdx = 0; + foreach ($reportList as &$rptItem) { + // check validity of report + if (($rptItem['enabled'] == 'all') || + (($rptItem['enabled'] == 'req') && $req_mgmt_enabled) || + (($rptItem['enabled'] == 'bts') && $bug_interface_enabled) && + strpos("," . $rptItem['format'], $format) > 0) { + $reportUrl = $rptItem['url'] . + (stristr($rptItem['url'], "?") ? '&' : '?'); + $items[$xdx] = array( + 'name' => lang_get($rptItem['title']), + 'href' => $reportUrl, + 'directLink' => '' + ); + + if (isset($rptItem['directLink']) && + trim($rptItem['directLink']) != '') { + if ($apiKeyIsValid) { + $items[$xdx]['directLink'] = sprintf( + $rptItem['directLink'], $_SESSION['basehref'], + $context->apikey, $context->tproject_id, + $context->tplan_id); + } else { + $items[$xdx]['directLink'] = $canNotCreateDirectLink; + } + } + + $dl = $items[$xdx]['directLink']; + $mask = '%s'; + + $divClass = 'direct_link_' . $xdx; + $items[$xdx]['toggle'] = sprintf($mask, $toggleMsg, $toggleMsg, + $divClass); + $items[$xdx]['directLinkDiv'] = ''; + $xdx ++; + } + } + return $items; + } + + /** + * get count of builds + * + * @param boolean $active + * (optional) query open builds [0,1] + * @param boolean $open + * (optional) query active builds [0,1] + * + * @return integer count of builds + */ + public function get_count_builds($active = 1, $open = 0) + { + $sql = " SELECT COUNT(0) FROM {$this->tables['builds']} builds " . + " WHERE builds.testplan_id = {$this->testPlanID} "; + + if ($active) { + $sql .= " AND active=" . intval($active) . " "; + } + + if ($open) { + $sql .= " AND is_open=" . intval($open) . " "; + } + + return $this->db->fetchOneValue($sql); + } + + /** + * get count of testcase linked to a testplan + * + * @return integer count + */ + public function get_count_testcase4testplan() + { + $sql = " SELECT COUNT(0) FROM {$this->tables['testplan_tcversions']} testplan_tcversions " . + " WHERE testplan_id = {$this->testPlanID} "; + return $this->db->fetchOneValue($sql); + } +} + +?> diff --git a/lib/functions/requirement_mgr.class.php b/lib/functions/requirement_mgr.class.php index 29ccd56b8d..44cfef18d5 100644 --- a/lib/functions/requirement_mgr.class.php +++ b/lib/functions/requirement_mgr.class.php @@ -1,4926 +1,4885 @@ - - * @copyright 2007-2020, TestLink community - * - * Manager for requirements. - * Requirements are children of a requirement specification (requirements container) - * - * - */ - -// Needed to use extends tlObjectWithAttachments, If not present autoload fails. -require_once( dirname(__FILE__) . '/attachments.inc.php'); -class requirement_mgr extends tlObjectWithAttachments { - var $db; - var $cfield_mgr; - var $my_node_type; - var $tree_mgr; - var $node_types_descr_id; - var $node_types_id_descr; - var $attachmentTableName; - - // 20100220 - franciscom - I'm will work only on XML - // then remove other formats till other dev do refactor - var $import_file_types = array("csv" => "CSV", - "csv_doors" => "CSV (Doors)", - "XML" => "XML", - "DocBook" => "DocBook"); - - var $export_file_types = array("XML" => "XML"); - - var $fieldSize; - var $reqCfg; - var $internal_links; - var $relationsCfg; - var $notifyOn; - var $reqTCLinkCfg; - - - - const AUTOMATIC_ID=0; - const ALL_VERSIONS=0; - const LATEST_VERSION=-1; - const NO_REVISION=-1; - - - - /* - function: requirement_mgr - contructor - - args: db: reference to db object - - returns: instance of requirement_mgr - - */ - function __construct(&$db) { - - $this->db = &$db; - $this->cfield_mgr=new cfield_mgr($this->db); - $this->tree_mgr = new tree($this->db); - - $this->attachmentTableName = 'req_versions'; - - tlObjectWithAttachments::__construct($this->db,$this->attachmentTableName); - - $this->node_types_descr_id= $this->tree_mgr->get_available_node_types(); - $this->node_types_id_descr=array_flip($this->node_types_descr_id); - $this->my_node_type=$this->node_types_descr_id['requirement']; - $this->object_table=$this->tables['requirements']; - - $this->fieldSize = config_get('field_size'); - $this->reqCfg = config_get('req_cfg'); - $this->reqTCLinkCfg = config_get('reqTCLinks'); - - $this->relationsCfg = new stdClass(); - $this->relationsCfg->interProjectLinking = $this->reqCfg->relations->interproject_linking; - - $this->internal_links = config_get('internal_links'); - - $this->notifyOn = null; - } - - /* - function: get_export_file_types - getter - - args: - - - returns: map - key: export file type code - value: export file type verbose description - - */ - function get_export_file_types() - { - return $this->export_file_types; - } - - /* - function: get_impor_file_types - getter - - args: - - - returns: map - key: import file type code - value: import file type verbose description - - */ - function get_import_file_types() - { - return $this->import_file_types; - } - - - - - -/* - function: get_by_id - - - args: id: requirement id (can be an array) - [version_id]: requirement version id (can be an array) - [version_number]: - [options] - - - returns: null if query fails - map with requirement info - - -*/ -function get_by_id($id,$version_id=self::ALL_VERSIONS,$version_number=1,$options=null,$filters=null) -{ - static $debugMsg; - static $userCache; // key: user id, value: display name - static $lables; - static $user_keys; - - if(!$debugMsg) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $labels['undefined'] = lang_get('undefined'); - $user_keys = array('author' => 'author_id', 'modifier' => 'modifier_id'); - } - - - $my['options'] = array('order_by' => " ORDER BY REQV.version DESC ", - 'output_format' => 'array', 'renderImageInline' => false, - 'decodeUsers' => true, 'outputLevel' => 'std'); - - $my['options'] = array_merge($my['options'], (array)$options); - - // null => do not filter - $my['filters'] = array('status' => null, 'type' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $filter_clause = ''; - $dummy[]=''; // trick to make implode() work - foreach( $my['filters'] as $field2filter => $value) { - if( !is_null($value) ) { - $dummy[] = " {$field2filter} = '{$value}' "; - } - } - - if( count($dummy) > 1) { - $filter_clause = implode(" AND ",$dummy); - } - - $where_clause = " WHERE NH_REQV.parent_id "; - if( ($id_is_array=is_array($id)) ) { - $where_clause .= "IN (" . implode(",",$id) . ") "; - } else { - $where_clause .= " = {$id} "; - } - - if(is_array($version_id)) { - $versionid_list = implode(",",$version_id); - $where_clause .= " AND REQV.id IN ({$versionid_list}) "; - } else { - if( is_null($version_id) ) { - // search by "human" version number - $where_clause .= " AND REQV.version = {$version_number} "; - } else { - if($version_id != self::ALL_VERSIONS && $version_id != self::LATEST_VERSION) { - $where_clause .= " AND REQV.id = {$version_id} "; - } - } - } - - // added -1 AS revision_id to make some process easier - switch($my['options']['outputLevel']) { - case 'minimal': - $outf = " /* $debugMsg */ - SELECT REQ.id,REQ.req_doc_id,REQV.id AS version_id, - NH_REQ.name AS title "; - break; - - case 'std': - default: - $outf = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . - " REQV.scope,REQV.status,REQV.type,REQV.active," . - " REQV.is_open,REQV.is_open AS reqver_is_open,REQV.author_id,REQV.version,REQV.id AS version_id," . - " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . - " REQV.modification_ts,REQV.revision, -1 AS revision_id, " . - " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; - break; - } - - // added -1 AS revision_id to make some process easier - $sql = $outf . - " FROM {$this->object_table} REQ " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id ". - " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - $where_clause . $filter_clause . $my['options']['order_by']; - - $decodeUserMode = 'simple'; - if ($version_id != self::LATEST_VERSION) { - switch($my['options']['output_format']) { - case 'mapOfArray': - $recordset = $this->db->fetchRowsIntoMap($sql,'id',database::CUMULATIVE); - $decodeUserMode = 'complex'; - break; - - case 'array': - default: - $recordset = $this->db->get_recordset($sql); - break; - - } - } else { - // But, how performance wise can be do this, - // instead of using MAX(version) and a group by? - // - // if $id was a list then this will return something USELESS - // - if( !$id_is_array ) { - $recordset = array($this->db->fetchFirstRow($sql)); - } else { - // Write to event viewer ??? - // Developer Needs to user - die('use getByIDBulkLatestVersionRevision()'); - } - } - - $rs = null; - if(!is_null($recordset) && $my['options']['renderImageInline']) { - $k2l = array_keys($recordset); - foreach($k2l as $akx) { - $this->renderImageAttachments($id,$recordset[$akx]); - } - reset($recordset); - } - - $rs = $recordset; - if(!is_null($recordset) && $my['options']['decodeUsers']) { - switch ($decodeUserMode) { - case 'complex': - // output[REQID][0] = array('id' =>, 'xx' => ...) - $flevel = array_keys($recordset); - foreach($flevel as $flk) { - $key2loop = array_keys($recordset[$flk]); - foreach( $key2loop as $key ) { - foreach( $user_keys as $ukey => $userid_field) { - $rs[$flk][$key][$ukey] = ''; - if(trim($rs[$flk][$key][$userid_field]) != "") { - if( !isset($userCache[$rs[$flk][$key][$userid_field]]) ) { - $user = tlUser::getByID($this->db,$rs[$flk][$key][$userid_field]); - $rs[$flk][$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$flk][$key][$userid_field]] = $rs[$flk][$key][$ukey]; - unset($user); - } else { - $rs[$flk][$key][$ukey] = $userCache[$rs[$flk][$key][$userid_field]]; - } - } - } - } - } - break; - - case 'simple': - default: - $key2loop = array_keys($recordset); - foreach( $key2loop as $key ) { - foreach( $user_keys as $ukey => $userid_field) { - $rs[$key][$ukey] = ''; - if(trim($rs[$key][$userid_field]) != "") { - if( !isset($userCache[$rs[$key][$userid_field]]) ) { - $user = tlUser::getByID($this->db,$rs[$key][$userid_field]); - $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; - unset($user); - } else { - $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; - } - } - } - } - break; - } - } - - unset($recordset); - unset($my); - unset($dummy); - - return $rs; -} - - /* - function: create - - args: srs_id: req spec id, parent of requirement to be created - reqdoc_id - title - scope - user_id: author - [status] - [type] - [expected_coverage] - [node_order] - - returns: map with following keys: - status_ok -> 1/0 - msg -> some simple message, useful when status_ok ==0 - id -> id of new requirement. - - @internal revision - */ -function create($srs_id,$reqdoc_id,$title, $scope, $user_id, - $status = TL_REQ_STATUS_VALID, $type = TL_REQ_TYPE_INFO, - $expected_coverage=1,$node_order=0,$tproject_id=null, $options=null) -{ - // This kind of saving is important when called in a loop in situations like - // copy test project - static $debugMsg; - static $log_message; - - if(!$log_message) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $log_message = lang_get('req_created_automatic_log'); - } - - $tproject_id = is_null($tproject_id) ? $this->tree_mgr->getTreeRoot($srs_id) : $tproject_id; - - $result = array( 'id' => 0, 'status_ok' => 0, 'msg' => 'ko'); - $my['options'] = array('quickAndDirty' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - if(!$my['options']['quickAndDirty']) - { - $reqdoc_id = trim_and_limit($reqdoc_id,$this->fieldSize->req_docid); - $title = trim_and_limit($title,$this->fieldSize->req_title); - $op = $this->check_basic_data($srs_id,$tproject_id,$title,$reqdoc_id); - } - else - { - $op['status_ok'] = true; - } - - $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; - if( $op['status_ok'] ) - { - $result = $this->create_req_only($srs_id,$reqdoc_id,$title,$user_id,$node_order); - if($result["status_ok"]) - { - if ($this->internal_links->enable ) - { - $scope = req_link_replace($this->db, $scope, $tproject_id); - } - - $op = $this->create_version($result['id'],1,$scope,$user_id, - $status,$type,intval($expected_coverage)); - $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; - $result['version_id'] = $op['status_ok'] ? $op['id'] : -1; - - if( $op['status_ok'] ) - { - $sql = "/* $debugMsg */ " . - "UPDATE {$this->tables['req_versions']} " . - " SET log_message='" . $this->db->prepare_string($log_message) . "'" . - " WHERE id = " . intval($op['id']) ; - $this->db->exec_query($sql); - } - - } - } - $ctx = array('id' => $result['id']); - event_signal('EVENT_TEST_REQUIREMENT_CREATE', $ctx); - - return $result; - -} // function end - - - /* - function: update - - - args: id: requirement id - version_id - reqdoc_id - title - scope - user_id: author - status - type - $expected_coverage - [skip_controls] - - - returns: map: keys : status_ok, msg - - @internal revision - 20091202 - franciscom - - - */ - -function update($id,$version_id,$reqdoc_id,$title, $scope, $user_id, $status, $type, - $expected_coverage,$node_order=null,$tproject_id=null,$skip_controls=0, - $create_revision=false,$log_msg=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $result['status_ok'] = 1; - $result['msg'] = 'ok'; - - $db_now = $this->db->db_now(); - - // get SRSid, needed to do controls - $rs=$this->get_by_id($id,$version_id); - $req = $rs[0]; - $srs_id=$req['srs_id']; - - // try to avoid function calls when data is available on caller - $tproject_id = is_null($tproject_id) ? $this->tree_mgr->getTreeRoot($srs_id): $tproject_id; - - if ($this->internal_links->enable ) - { - $scope = req_link_replace($this->db, $scope, $tproject_id); - } - - $reqdoc_id=trim_and_limit($reqdoc_id,$this->fieldSize->req_docid); - $title=trim_and_limit($title,$this->fieldSize->req_title); - $chk=$this->check_basic_data($srs_id,$tproject_id,$title,$reqdoc_id,$id); - - if($chk['status_ok'] || $skip_controls) - { - if( $create_revision ) - { - $this->create_new_revision($version_id,$user_id,$tproject_id,$req,$log_msg); - } - - $sql = array(); - - $q = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . - " SET name='" . $this->db->prepare_string($title) . "'"; - if( !is_null($node_order) ) - { - $q .= ', node_order= ' . abs(intval($node_order)); - } - $sql[] = $q . " WHERE id={$id}"; - - - $sql[] = "/* $debugMsg */ UPDATE {$this->tables['requirements']} " . - " SET req_doc_id='" . $this->db->prepare_string($reqdoc_id) . "'" . - " WHERE id={$id}"; - - $sql_temp = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . - " SET scope='" . $this->db->prepare_string($scope) . "', " . - " status='" . $this->db->prepare_string($status) . "', " . - " expected_coverage={$expected_coverage}, " . - " type='" . $this->db->prepare_string($type) . "' "; - - // only if no new revision is created set modifier and modification ts - // otherwise those values are handled by function create_new_revision() - if (!$create_revision) - { - $sql_temp .= ", modifier_id={$user_id}, modification_ts={$db_now} "; - } - - $sql[] = $sql_temp . " WHERE id=" . intval($version_id); - - foreach($sql as $stm) - { - $qres = $this->db->exec_query($stm); - if( !$qres ) - { - $result['status_ok'] = 0; - $result['msg'] = $this->db->error_msg; - $result['sql'] = $stm; - break; - } - } - - } // if($chk['status_ok'] || $skip_controls) - else - { - $result['status_ok']=$chk['status_ok']; - $result['msg']=$chk['msg']; - } - - $ctx = array('id' => $id); - event_signal('EVENT_TEST_REQUIREMENT_UPDATE', $ctx); - return $result; - } //function end - - - - /* - function: delete - Requirement - Requirement link to testcases - Requirement relations - Requirement custom fields values - Attachments - - check if we are deleting the only existent version, in this case - we need to delete the requirement. - - args: id: can be one id, or an array of id - - returns: - - - */ - function delete($id,$version_id = self::ALL_VERSIONS,$user_id=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $children = null; - - $where = array('coverage' => '','this' => '', 'iam_parent' => ''); - $deleteAll = false; - $result = null; - $doIt = true; - $kaboom = false; - - if(is_array($id)) { - $id_list = implode(',',$id); - $where['coverage'] = " WHERE req_id IN ({$id_list})"; - $where['this'] = " WHERE id IN ({$id_list})"; - $where['iam_parent'] = " WHERE parent_id IN ({$id_list})"; - } - else { - $safeID = intval($id); - $where['coverage'] = " WHERE req_id = " . $safeID; - $where['this'] = " WHERE id = " . $safeID; - $where['iam_parent'] = " WHERE parent_id = " . $safeID; - } - - $set2del = null; - - // if we are trying to delete ONE SPECIFIC VERSION - // of ONE REQ, and is the ONLY VERSION on DB - // then we are going to delete the req. - $checkNotify = true; - $action4notify = 'delete'; - if( $version_id != self::ALL_VERSIONS ) { - // we use version id when working on ONE REQ, - // then I'm going to trust this. - // From GUI if only one version exists, - // the operation available is DELETE REQ, - // not delete version - $sql = "SELECT COUNT(0) AS VQTY, parent_id FROM " . - " {$this->tables['nodes_hierarchy']} " . - $where['iam_parent'] . ' GROUP BY parent_id'; - - $rs = $this->db->fetchRowsIntoMap($sql,'parent_id'); - $rs = current($rs); - if(isset($rs['VQTY']) && $rs['VQTY'] > 1) { - $action4notify = 'delete_version'; - } - } - - if( $checkNotify && $this->notifyOn[__FUNCTION__] ) { - // Need to save data before delete - $set2del = $this->getByIDBulkLatestVersionRevision($id); - if( !is_null($set2del) ) { - foreach($set2del as $rk => $r2d) { - $this->notifyMonitors($rk,$action4notify,$user_id); - if($action4notify == 'delete') { - $this->monitorOff($rk); - } - } - } - } - - // When deleting only one version, we need to check - // if we need to delete requirement also. - $children[] = $version_id; - if( $version_id == self::ALL_VERSIONS) { - $deleteAll = true; - - // I'm trying to speedup the next deletes - $sql = "/* $debugMsg */ " . - "SELECT NH.id FROM {$this->tables['nodes_hierarchy']} NH " . - "WHERE NH.parent_id "; - - if( is_array($id) ) { - $sql .= " IN (" .implode(',',$id) . ") "; - } - else { - $sql .= " = {$id} "; - } - - $sql .= " AND node_type_id=" . $this->node_types_descr_id['requirement_version']; - - $children_rs=$this->db->fetchRowsIntoMap($sql,'id'); - $children = array_keys($children_rs); - - // delete dependencies with test specification - $sql = "DELETE FROM {$this->tables['req_coverage']} " . - $where['coverage']; - $result = $this->db->exec_query($sql); - - // also delete relations to other requirements - // Issue due to FK - // - if ($result) { - $this->delete_all_relations($id); - } - - if ($result) { - // Need to get all versions for all requirements - $doIt = true; - $reqIDSet = (array)$id; - $reqVerSet = $this->getAllReqVersionIDForReq($reqIDSet); - - foreach($reqVerSet as $reqID2Del => $reqVerElem) { - foreach($reqVerElem as $ydx => $reqVID2Del) { - $result = $this->attachmentRepository->deleteAttachmentsFor( - $reqVID2Del,$this->attachmentTableName); - } - } - } - } - - // Delete version info - $target = null; - if( $doIt ) { - // As usual working with MySQL makes easier to be lazy and forget that - // agregate functions need GROUP BY - // How many versions are there? - // we will delete req also for all with COUNT(0) == 1 - $sql = "SELECT COUNT(0) AS VQTY, parent_id " . - " FROM {$this->tables['nodes_hierarchy']} " . - $where['iam_parent'] . ' GROUP BY parent_id'; - - $rs = $this->db->fetchRowsIntoMap($sql,'parent_id'); - foreach($rs as $el) { - if(isset($el['VQTY']) && $el['VQTY'] == 1) { - $target[] = $el['parent_id']; - } - } - - if( ($kaboom = !is_null($target)) ) { - $where['this'] = " WHERE id IN (" . implode(',',$target) . ")"; - } - - // Attachments are related to VERSION - foreach($children as $key => $reqVID) { - $result = $this->attachmentRepository->deleteAttachmentsFor($reqVID,$this->attachmentTableName); - } - - - // Going to work on REVISIONS - $implosion = implode(',',$children); - $sql = "/* $debugMsg */ " . - " SELECT id from {$this->tables['nodes_hierarchy']} " . - " WHERE parent_id IN ( {$implosion} ) " . - " AND node_type_id=" . - $this->node_types_descr_id['requirement_revision']; - - $revisionSet = $this->db->fetchRowsIntoMap($sql,'id'); - if( !is_null($revisionSet) ) { - $this->cfield_mgr->remove_all_design_values_from_node(array_keys($revisionSet)); - - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['req_revisions']} - WHERE parent_id IN ( {$implosion} ) "; - $result = $this->db->exec_query($sql); - - $sql = "/* $debugMsg */ - DELETE FROM {$this->tables['nodes_hierarchy']} - WHERE parent_id IN ( {$implosion} ) - AND node_type_id=" . $this->node_types_descr_id['requirement_revision']; - $result = $this->db->exec_query($sql); - } - $this->cfield_mgr->remove_all_design_values_from_node((array)$children); - - $where['children'] = " WHERE id IN ( {$implosion} ) "; - - $sql = "DELETE FROM {$this->tables['req_versions']} " . $where['children']; - $result = $this->db->exec_query($sql); - - $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . - $where['children'] . - " AND node_type_id=" . $this->node_types_descr_id['requirement_version']; - $result = $this->db->exec_query($sql); - } - - $kaboom = $kaboom || ($deleteAll && $result); - if( $kaboom ) { - $sql = "DELETE FROM {$this->object_table} " . $where['this']; - $result = $this->db->exec_query($sql); - - $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . $where['this'] . - " AND node_type_id=" . $this->node_types_descr_id['requirement']; - - $result = $this->db->exec_query($sql); - } - - $result = (!$result) ? lang_get('error_deleting_req') : 'ok'; - - $ctx = array('id' => $id); - event_signal('EVENT_TEST_REQUIREMENT_DELETE', $ctx); - - return $result; - } - - - - -/** collect coverage of Requirement - * @param string $req_id ID of req. - * @return assoc_array list of test cases [id, title] - * - * Notice regarding platforms: - * When doing Requirements Based Reports, we analize report situation - * on a Context composed by: - * Test project AND Test plan. - * - * We do this because we want to have a dynamic view (i.e. want to add exec info). - * - * When a Test plan has platforms defined, user get at GUI possibility to choose - * one platform. - * IMHO (franciscom) this has to change how coverage (dynamic) is computed. - * - * Static coverage: - * depicts relation bewteen Req and test cases spec, and platforms are not considered - * - * DYNAMIC coverage: - * depicts relation bewteen Req and test cases spec and exec status of these test case, - * and platforms have to be considered - * - */ -function get_coverage($id,$context=null,$options=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('options' => array('accessKey' => 'idx')); - $my['options'] = array_merge($my['options'], (array)$options); - - - $safe_id = intval($id); - $common = array(); - - $common['join'] = " FROM {$this->tables['nodes_hierarchy']} NH_TC " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id=NH_TC.id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id=NH_TCV.id " . - " JOIN {$this->tables['req_coverage']} RC ON RC.testcase_id = NH_TC.id "; - $common['where'] = " WHERE RC.req_id={$safe_id} "; - - if(is_null($context)) - { - $sql = "/* $debugMsg - Static Coverage */ " . - " SELECT DISTINCT NH_TC.id,NH_TC.name,TCV.tc_external_id,U.login,RC.creation_ts" . - $common['join'] . - " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = RC.author_id " . - $common['where']; - } - else - { - - $sql = "/* $debugMsg - Dynamic Coverage */ " . - " SELECT DISTINCT NH_TC.id,NH_TC.name,TCV.tc_external_id" . - $common['join'] . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id " . - $common['where'] . - " AND TPTCV.testplan_id = " . intval($context['tplan_id']) . - " AND TPTCV.platform_id = " . intval($context['platform_id']); - } - $sql .= " ORDER BY tc_external_id "; - - - switch($my['options']['accessKey']) - { - case 'tcase_id': - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - break; - - case 'idx': - default: - $rs = $this->db->get_recordset($sql); - break; - } - return $rs; -} - - - /* - function: check_basic_data - do checks on title and reqdoc id, for a requirement - - Checks: - empty title - empty docid - docid already exists inside test project (DOCID is Test Project WIDE) - title alreday exists under same REQ SPEC (req. parent) - - - args: srs_id: req spec id (req parent) - title - reqdoc_id - [id]: default null - - - returns: map - keys: status_ok - msg - failure_reason - - @internal revision - 20110206 - franciscom - add new key on retval 'failure_reason' - 20110108 - franciscom - check on duplicate title under same parent - */ - function check_basic_data($srs_id,$tproject_id,$title,$reqdoc_id,$id = null) - { - - $ret['status_ok'] = 1; - $ret['msg'] = ''; - $ret['failure_reason'] = ''; - - $title = trim($title); - $reqdoc_id = trim($reqdoc_id); - - if ($title == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_req_title"); - $ret['failure_reason'] = 'empty_req_title'; - } - - if ($reqdoc_id == "") - { - $ret['status_ok'] = 0; - $ret['msg'] .= " " . lang_get("warning_empty_reqdoc_id"); - $ret['failure_reason'] = 'empty_reqdoc_id'; - } - - if($ret['status_ok']) - { - $ret['msg'] = 'ok'; - $rs = $this->getByDocID($reqdoc_id,$tproject_id); - if(!is_null($rs) && (is_null($id) || !isset($rs[$id]))) - { - $ret['msg'] = sprintf(lang_get("warning_duplicate_reqdoc_id"),$reqdoc_id); - $ret['status_ok'] = 0; - $ret['failure_reason'] = 'duplicate_reqdoc_id'; - } - } - - // check for duplicate title - // BUGID 4150 - if($ret['status_ok']) - { - $ret['msg'] = 'ok'; - $target = array('key' => 'title', 'value' => $title); - $getOptions = array('output' => 'id'); - $rs = $this->getByAttribute($target,$tproject_id,$srs_id,$getOptions); - if(!is_null($rs) && (is_null($id) || !isset($rs[$id]))) - { - $ret['failure_reason'] = 'sibling_req_with_same_title'; - $ret['msg'] = sprintf(lang_get("warning_sibling_req_with_same_title"),$title); - $ret['status_ok'] = 0; - } - } - - return $ret; - } - - - /* - function: create_tc_from_requirement - create testcases using requirements as input - - - args: - - returns: - - */ -function create_tc_from_requirement($mixIdReq,$srs_id, $user_id, $tproject_id = null, $tc_count=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $tcase_mgr = new testcase($this->db); - $tsuite_mgr = new testsuite($this->db); - - $auto_testsuite_name = $this->reqCfg->default_testsuite_name; - $node_descr_type = $this->tree_mgr->get_available_node_types(); - $empty_steps = null; - $empty_preconditions = ''; // fix for BUGID 2995 - - $labels['tc_created'] = lang_get('tc_created'); - - $output = null; - $reqSet = is_array($mixIdReq) ? $mixIdReq : array($mixIdReq); - - if( is_null($tproject_id) || $tproject_id == 0 ) { - $tproject_id = $this->tree_mgr->getTreeRoot($srs_id); - } - - if ( $this->reqCfg->use_req_spec_as_testsuite_name ) { - $full_path = $this->tree_mgr->get_path($srs_id); - $addition = " (" . lang_get("testsuite_title_addition") . ")"; - $truncate_limit = $this->fieldSize->testsuite_name - strlen($addition); - - // REQ_SPEC_A - // |-- REQ_SPEC_A1 - // |-- REQ_SPEC_A2 - // |- REQ100 - // |- REQ101 - // - // We will try to check if a test suite has already been created for - // top REQ_SPEC_A (we do search using automatic generated name as search criteria). - // If not => we need to create all path till leaves (REQ100 and REQ200) - // - // - // First search: we use test project - $parent_id = $tproject_id; - $deep_create = false; - foreach($full_path as $key => $node) { - // follow hierarchy of test suites to create - $tsuiteInfo = null; - - // deal with UTF-8 - // $testsuite_name = substr($node['name'],0,$truncate_limit). $addition; - $testsuite_name = mb_substr($node['name'],0,$truncate_limit,mb_detect_encoding($node['name'])) . $addition; - - if( !$deep_create ) { - // child test suite with this name, already exists on current parent ? - // At first a failure we will not check anymore an proceed with deep create - $sql = "/* $debugMsg */ SELECT id,name FROM {$this->tables['nodes_hierarchy']} NH " . - " WHERE name='" . $this->db->prepare_string($testsuite_name) . "' " . - " AND node_type_id=" . $node_descr_type['testsuite'] . - " AND parent_id = {$parent_id} "; - - // If returns more that one record use ALWAYS first - $tsuiteInfo = $this->db->fetchRowsIntoMap($sql,'id'); - } - - if( is_null($tsuiteInfo) ) { - $tsuiteInfo = $tsuite_mgr->create($parent_id,$testsuite_name,$this->reqCfg->testsuite_details); - $output[] = sprintf(lang_get('testsuite_name_created'), $testsuite_name); - $deep_create = true; - } - else { - $tsuiteInfo = current($tsuiteInfo); - $tsuite_id = $tsuiteInfo['id']; - } - $tsuite_id = $tsuiteInfo['id']; // last value here will be used as parent for test cases - $parent_id = $tsuite_id; - } - $output[]=sprintf(lang_get('created_on_testsuite'), $testsuite_name); - } else { - // don't use req_spec as testsuite name - // Warning: - // We are not maintaining hierarchy !!! - $sql=" SELECT id FROM {$this->tables['nodes_hierarchy']} NH " . - " WHERE name='" . $this->db->prepare_string($auto_testsuite_name) . "' " . - " AND parent_id=" . $tproject_id . " " . - " AND node_type_id=" . $node_descr_type['testsuite']; - - $result = $this->db->exec_query($sql); - if ($this->db->num_rows($result) == 1) { - $row = $this->db->fetch_array($result); - $tsuite_id = $row['id']; - $label = lang_get('created_on_testsuite'); - } else { - // not found -> create - tLog('test suite:' . $auto_testsuite_name . ' was not found.'); - $new_tsuite=$tsuite_mgr->create($tproject_id,$auto_testsuite_name,$this->reqCfg->testsuite_details); - $tsuite_id=$new_tsuite['id']; - $label = lang_get('testsuite_name_created'); - } - $output[]=sprintf($label, $auto_testsuite_name); - } - /* end contribution */ - - // create TC - $createOptions = array(); - $createOptions['check_names_for_duplicates'] = config_get('check_names_for_duplicates'); - $createOptions['action_on_duplicate_name'] = config_get('action_on_duplicate_name'); - - $testcase_importance_default = config_get('testcase_importance_default'); - - // compute test case order - $testcase_order = config_get('treemenu_default_testcase_order'); - $nt2exclude=array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me'); - - $siblings = $this->tree_mgr->get_children($tsuite_id,$nt2exclude); - if( !is_null($siblings) ) { - $dummy = end($siblings); - $testcase_order = $dummy['node_order']; - } - - foreach ($reqSet as $reqID) { - $reqData = $this->get_by_id($reqID,requirement_mgr::LATEST_VERSION); - $count = (!is_null($tc_count)) ? $tc_count[$reqID] : 1; - $reqData = $reqData[0]; - - // Generate name with progessive - $instance=1; - $getOptions = array('check_criteria' => 'like','access_key' => 'name'); - $itemSet = $tcase_mgr->getDuplicatesByName($reqData['title'],$tsuite_id,$getOptions); - - $nameSet = null; - if( !is_null($itemSet) ){ - $nameSet = array_flip(array_keys($itemSet)); - } - - for ($idx = 0; $idx < $count; $idx++) { - $testcase_order++; - - // We have a little problem to work on: - // suppose you have created: - // TC [1] - // TC [2] - // TC [3] - // If we delete TC [2] - // When I got siblings il will got 2, if I create new progressive using next, - // it will be 3 => I will get duplicated name. - // - // Seems better option can be: - // Get all siblings names, put on array, create name an check if exists, if true - // generate a new name. - // This may be at performance level is better than create name then check on db, - // because this approach will need more queries to DB - // - $tcase_name = $reqData['title'] . " [{$instance}]"; - if( !is_null($nameSet) ) { - while( isset($nameSet[$tcase_name]) ) { - $instance++; - $tcase_name = $reqData['title'] . " [{$instance}]"; - } - } - $nameSet[$tcase_name]=$tcase_name; - - $prefix = ($this->reqCfg->use_testcase_summary_prefix_with_title_and_version) - ? sprintf($this->reqCfg->testcase_summary_prefix_with_title_and_version, - $reqID, $reqData['version_id'], $reqData['title'], $reqData['version']) - : $this->reqCfg->testcase_summary_prefix; - $content = ($this->reqCfg->copy_req_scope_to_tc_summary) ? $prefix . $reqData['scope'] : $prefix; - - $tcase = $tcase_mgr->create($tsuite_id,$tcase_name,$content, - $empty_preconditions, $empty_steps,$user_id,null, - $testcase_order,testcase::AUTOMATIC_ID,TESTCASE_EXECUTION_TYPE_MANUAL, - $testcase_importance_default,$createOptions); - - $tcase_name = $tcase['new_name'] == '' ? $tcase_name : $tcase['new_name']; - $output[] = sprintf($labels['tc_created'], $tcase_name); - - // create coverage dependency - $rrv = array('id' => $reqData['id'], 'version_id' => $reqData['version_id']); - $ttcv = array('id' => $tcase['id'], 'version_id' => $tcase['tcversion_id']); - - if (!$this->assignReqVerToTCVer($rrv,$ttcv,$user_id) ) { - $output[] = 'Test case: ' . $tcase_name . " was not created"; - } - } - } - return $output; -} - - - /* - function: assign_to_tcase - assign requirement(s) to test case - Will use always latest ACTIVE Versions - - args: req_id: can be an array of requirement id - testcase_id - - returns: 1/0 - */ - function assign_to_tcase($req_id,$testcase_id,$author_id) { - - static $tcMgr; - - if(!$tcMgr) { - $tcMgr = new testcase($this->db); - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $output = 0; - $now = $this->db->db_now(); - if ($testcase_id && $req_id) { - // Get Latest Active Test Case Version - $tcv = current($tcMgr->get_last_active_version($testcase_id)); - if ($tcv == null) { - return $output; - } - } - - // Go ahead - if ($testcase_id && $req_id) { - // Need to get latest version for each requirement - $reqIDSet = (array)$req_id; - $gopt = array('output' => 'id,version'); - - $reqLatestVersionIDSet = array(); - $reqLatestVersionNumberSet = array(); - foreach( $reqIDSet as $req ) { - $isofix = $this->get_last_version_info($req, $gopt); - $reqLatestVersionIDSet[] = $isofix['id']; - $reqLatestVersionNumberSet[] = $isofix['version']; - } - - $ltcv = $tcv['tcversion_id']; - $ltcvNum = $tcv['version']; - $in_clause = implode(",",$reqLatestVersionIDSet); - - // - $sql = " /* $debugMsg */ " . - " SELECT req_id,testcase_id,req_version_id,tcversion_id " . - " FROM {$this->tables['req_coverage']} " . - " WHERE req_version_id IN ({$in_clause}) " . - " AND tcversion_id = {$ltcv}"; - - $coverage = $this->db->fetchRowsIntoMap($sql,'req_version_id'); - - // Useful for audit - $tcInfo = $this->tree_mgr->get_node_hierarchy_info($testcase_id); - - $loop2do = count($reqLatestVersionIDSet); - for($idx=0; $idx < $loop2do; $idx++) { - if( is_null($coverage) || - !isset($coverage[$reqLatestVersionIDSet[$idx]]) ) { - $sql = " INSERT INTO {$this->tables['req_coverage']} " . - " (req_id,testcase_id,req_version_id, tcversion_id," . - " author_id,creation_ts) " . - " VALUES ({$reqIDSet[$idx]},{$testcase_id}," . - " $reqLatestVersionIDSet[$idx],{$ltcv}," . - " {$author_id},{$now})"; - $result = $this->db->exec_query($sql); - if ($this->db->affected_rows() == 1) { - $output = 1; - - // For audit - $reqInfo = $this->tree_mgr->get_node_hierarchy_info($reqIDSet[$idx]); - if($tcInfo && $reqInfo) { - logAuditEvent(TLS("audit_reqv_assigned_tcv", - $reqInfo['name'], - $reqLatestVersionNumberSet[$idx], - $tcInfo['name'], - $ltcvNum), - "ASSIGN",$this->object_table); - } - } - } else { - $output = 1; - } - } - } - return $output; - } - - - /** - * - */ - function assignToTCaseUsingLatestVersions($req_id,$testcase_id,$author_id) { - return $this->assign_to_tcase($req_id,$testcase_id,$author_id); - } - - - - /* - function: get_relationships - - args : - - returns: - - */ - function get_relationships($req_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT nodes_hierarchy.id,nodes_hierarchy.name " . - " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy, " . - " {$this->tables['req_coverage']} req_coverage " . - " WHERE req_coverage.testcase_id = nodes_hierarchy.id " . - " AND req_coverage.req_id={$req_id}"; - - return ($this->db->get_recordset($sql)); - } - - - /* - function: get_all_for_tcase - get all requirements assigned to a test case - A filter can be applied to do search on all req spec, - or only on one. - - - args: testcase_id - [srs_id]: default 'all' - - returns: - - - - */ -function get_all_for_tcase($testcase_id, $srs_id = 'all') -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT REQ.id,REQ.req_doc_id,NHA.name AS title, " . - " NHB.name AS req_spec_title,REQ_COVERAGE.testcase_id " . - " FROM {$this->object_table} REQ, " . - " {$this->tables['req_coverage']} REQ_COVERAGE," . - " {$this->tables['nodes_hierarchy']} NHA," . - " {$this->tables['nodes_hierarchy']} NHB," . - " {$this->tables['req_specs']} RSPEC " ; - - $idList = implode(",",(array)$testcase_id); - $sql .= " WHERE REQ_COVERAGE.testcase_id IN (" . $idList . ")"; - $sql .= " AND REQ.srs_id=RSPEC.id AND REQ_COVERAGE.req_id=REQ.id " . - " AND NHA.id=REQ.id AND NHB.id=RSPEC.id " ; - - // if only for one specification is required - if ($srs_id != 'all') - { - $sql .= " AND REQ.srs_id=" . $srs_id; - } - if (is_array($testcase_id)) - { - return $this->db->fetchRowsIntoMap($sql,'testcase_id',true); - } - else - { - return $this->db->get_recordset($sql); - } -} - - - - - /* - function: - - args : - - returns: - - */ - function check_title($title) - { - $ret = array('status_ok' => 1, 'msg' => 'ok'); - - if ($title == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_req_title"); - } - - return $ret; - } - -/* - function: - - args : - $nodes: array with req_id in order - returns: - -*/ -function set_order($map_id_order) -{ - $this->tree_mgr->change_order_bulk($map_id_order); -} - - -/** - * exportReqToXML - * - * @param int $id requirement id - * @param int $tproject_id: optional default null. - * useful to get custom fields - * (when this feature will be developed). - * - * @return string with XML code - * - */ -function exportReqToXML($id,$tproject_id=null, $inc_attachments=false) -{ - $req = $this->get_by_id($id,requirement_mgr::LATEST_VERSION); - $reqData[] = $req[0]; - $req_version_id = $req[0]['version_id']; - - $elemTpl = "\t" . "" . - "\n\t\t" . "" . - "\n\t\t" . "<![CDATA[||TITLE||]]>" . - "\n\t\t" . "||VERSION||" . - "\n\t\t" . "||REVISION||" . - "\n\t\t" . "||NODE_ORDER||". - "\n\t\t" . "". - "\n\t\t" . "" . - "\n\t\t" . "" . - "\n\t\t" . "" . - "\n\t\t" . $this->customFieldValuesAsXML($id,$req[0]['version_id'],$tproject_id); - - // add req attachment content if checked in GUI - if ($inc_attachments) { - $attachments = null; - - // id -> req_id, but I need latest req_versionid - $attachSet = $this->attachmentRepository - ->getAttachmentInfosFor( - $req_version_id, - $this->attachmentTableName,'id'); - // get all attachments content and encode it in base64 - if ($attachSet) { - foreach ($attachSet as $attachmentInfo) { - $aID = $attachmentInfo["id"]; - $content = $this->attachmentRepository - ->getAttachmentContent($aID, $attachmentInfo); - - if ($content != null) - { - $attachments[$aID]["id"] = $aID; - $attachments[$aID]["name"] = $attachmentInfo["file_name"]; - $attachments[$aID]["file_type"] = $attachmentInfo["file_type"]; - $attachments[$aID]["title"] = $attachmentInfo["title"]; - $attachments[$aID]["date_added"] = $attachmentInfo["date_added"]; - $attachments[$aID]["content"] = base64_encode($content); - } - } - - if( !is_null($attachments) && count($attachments) > 0 ) - { - $attchRootElem = "\n{{XMLCODE}}\t\t\n"; - $attchElemTemplate = "\t\t\t\n" . - "\t\t\t\t\n" . - "\t\t\t\t\n" . - "\t\t\t\t\n" . - "\t\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . - "\t\t\t\t\n" . - "\t\t\t\t\n" . - "\t\t\t\n"; - - $attchDecode = array ("||ATTACHMENT_ID||" => "id", "||ATTACHMENT_NAME||" => "name", - "||ATTACHMENT_FILE_TYPE||" => "file_type", "||ATTACHMENT_TITLE||" => "title", - "||ATTACHMENT_DATE_ADDED||" => "date_added", "||ATTACHMENT_CONTENT||" => "content"); - $elemTpl .= exportDataToXML($attachments,$attchRootElem,$attchElemTemplate,$attchDecode,true); - } - } - } - $elemTpl .= "\n\t" . "" . "\n"; - - $info = array("||DOCID||" => "req_doc_id","||TITLE||" => "title", - "||DESCRIPTION||" => "scope","||STATUS||" => "status", - "||TYPE||" => "type","||NODE_ORDER||" => "node_order", - "||EXPECTED_COVERAGE||" => "expected_coverage", - "||VERSION||" => "version","||REVISION||" => "revision"); - - $xmlStr = exportDataToXML($reqData,"{{XMLCODE}}",$elemTpl,$info,true); - return $xmlStr; - -} - - -/** - * xmlToMapRequirement - * - */ -function xmlToMapRequirement($xml_item) -{ - // Attention: following PHP Manual SimpleXML documentation, Please remember to cast - // before using data from $xml, - if( is_null($xml_item) ) - { - return null; - } - - $dummy=array(); - foreach($xml_item->attributes() as $key => $value) - { - $dummy[$key] = (string)$value; // See PHP Manual SimpleXML documentation. - } - - $dummy['node_order'] = (int)$xml_item->node_order; - $dummy['title'] = (string)$xml_item->title; - $dummy['docid'] = (string)$xml_item->docid; - $dummy['description'] = (string)$xml_item->description; - $dummy['status'] = (string)$xml_item->status; - $dummy['type'] = (string)$xml_item->type; - $dummy['expected_coverage'] = (int)$xml_item->expected_coverage; - - if( property_exists($xml_item,'custom_fields') ) - { - $dummy['custom_fields']=array(); - foreach($xml_item->custom_fields->children() as $key) - { - $dummy['custom_fields'][(string)$key->name]= (string)$key->value; - } - } - if( property_exists($xml_item,'attachments') ) - { - $dummy['attachments'] = array(); - foreach($xml_item->attachments->children() as $attachment) - { - $attach_id = (int)$attachment->id; - $dummy['attachments'][$attach_id]['id'] = (int)$attachment->id; - $dummy['attachments'][$attach_id]['name'] = (string)$attachment->name; - $dummy['attachments'][$attach_id]['file_type'] = (string)$attachment->file_type; - $dummy['attachments'][$attach_id]['title'] = (string)$attachment->title; - $dummy['attachments'][$attach_id]['date_added'] = (string)$attachment->date_added; - $dummy['attachments'][$attach_id]['content'] = (string)$attachment->content; - } - } - return $dummy; -} - - - - - - -/** - * createFromXML - * - * @internal revisions - */ -function createFromXML($xml,$tproject_id,$parent_id,$author_id,$filters = null,$options=null) -{ - $reqAsMap = $this->xmlToMapRequirement($xml); - - // Map structure - // node_order => 0 - // title => Breaks - // docid => MAZDA3-0001 - // description => Heavy Rain Conditions - // status => [empty string] - // type => [empty string] - // expected_coverage => 0 - - return $this->createFromMap($reqAsMap,$tproject_id,$parent_id,$author_id,$filters,$options); -} - - -/** - * createFromMap - * - * Map structure - * node_order => 0 - * title => Breaks - * docid => MAZDA3-0001 - * description => Heavy Rain Conditions - * status => [empty string] - * type => [empty string] - * expected_coverage => 0 - * - * @internal revisions - */ -function createFromMap($req,$tproject_id,$parent_id,$author_id,$filters = null,$options=null) -{ - static $missingCfMsg; - static $linkedCF; - static $messages; - static $labels; - static $fieldSize; - static $doProcessCF = false; - static $debugMsg; - static $getByAttributeOpt; - static $getLastChildInfoOpt; - - if(is_null($linkedCF) ) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $fieldSize = config_get('field_size'); - - $linkedCF = $this->cfield_mgr->get_linked_cfields_at_design( - $tproject_id,cfield_mgr::CF_ENABLED,null,'requirement',null,'name'); - $doProcessCF = true; - - $messages = array(); - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['cfield'] = lang_get('cf_value_not_imported_missing_cf_on_testproject'); - - $labels = array('import_req_created' => '', - 'import_req_skipped' =>'', - 'import_req_updated' => '', - 'frozen_req_unable_to_import' => '', 'requirement' => '', - 'import_req_new_version_created' => '', - 'import_req_update_last_version_failed' => '', - 'import_req_new_version_failed' => '', - 'import_req_skipped_plain' => '', - 'req_title_lenght_exceeded' => '', - 'req_docid_lenght_exceeded' => ''); - foreach($labels as $key => $dummy) { - $labels[$key] = lang_get($key); - } - $getByAttributeOpt = array('output' => 'id'); - $getLastChildInfoOpt = array('child_type' => 'version', - 'output' => ' CHILD.is_open, CHILD.id '); - } - - $cf2insert=null; - $status_ok = true; - $user_feedback = null; - $dummy = ''; - $result = null; - - $newReq = null; - $copy_req = null; - $getOptions = array('output' => 'minimun'); - $has_filters = !is_null($filters); - $my['options'] = array( 'hitCriteria' => 'docid' , - 'actionOnHit' => "update", 'skipFrozenReq' => true); - $my['options'] = array_merge($my['options'], (array)$options); - - // Check data than can create issue when writting - // to DB due to lenght - // - $req['title'] = trim($req['title']); - $req['docid'] = trim($req['docid']); - - $checkLengthOK = true; - $what2add = ''; - if( mb_strlen($req['title'], $tlCfg->charset) > $fieldSize->req_title ) { - $checkLengthOK = false; - $what2add = $labels['req_title_lenght_exceeded'] . '/'; - } - - if( mb_strlen($req['docid'], $tlCfg->charset) > $fieldSize->req_docid ) { - $checkLengthOK = false; - $what2add .= $labels['req_docid_lenght_exceeded']; - } - - if( $checkLengthOK == FALSE ) { - $msgID = 'import_req_skipped_plain'; - $user_feedback[] = array('doc_id' => $req['docid'], - 'title' => $req['title'], - 'import_status' => sprintf($labels[$msgID],$what2add)); - - return $user_feedback; - } - - // Check: - // If item with SAME DOCID exists inside container - // If there is a hit - // We will follow user option: update,create new version - // - // If do not exist check must be repeated, but on WHOLE test project - // If there is a hit -> we can not create - // else => create - // - // $getOptions = array('output' => 'minimun'); - $msgID = 'import_req_skipped'; - - $target = array('key' => $my['options']['hitCriteria'], - 'value' => $req[$my['options']['hitCriteria']]); - - // IMPORTANT NOTICE - // When get is done by attribute that can not be unique (like seems to happen now 20110108 with - // title), we can get more than one hit and then on this context we can not continue - // with requested operation - $check_in_reqspec = $this->getByAttribute($target,$tproject_id,$parent_id,$getByAttributeOpt); - - // while working on BUGID 4210, new details came to light. - // In addition to hit criteria there are also the criteria that we use - // when creating/update item using GUI, and these criteria have to be - // checked abd fullfilled. - // - if (is_null($check_in_reqspec)) { - $check_in_tproject = $this->getByAttribute($target,$tproject_id,null,$getByAttributeOpt); - - if (is_null($check_in_tproject)) { - $importMode = 'creation'; - $newReq = $this->create($parent_id,$req['docid'], - $req['title'],$req['description'], - $author_id,$req['status'], - $req['type'], - $req['expected_coverage'], - $req['node_order'],$tproject_id, - array('quickAndDirty' => true)); - $reqID = $newReq['id']; - $fk_id = $newReq['version_id']; // for attachments - if( ($status_ok = ($newReq['status_ok'] == 1)) ){ - $msgID = 'import_req_created'; - } else { - $msgID = 'import_req_skipped_plain'; - $result['msg'] = $newReq['msg']; // done to use what2add logic far below - } - } else { - // Can not have req with same req doc id - // on another branch => BLOCK - // What to do if is Frozen ??? -> now ignore and update anyway - $msgID = 'import_req_skipped'; - $status_ok = false; - } - } else { - // IMPORTANT NOTICE - // When you - // Need to get Last Version no matter active or not. - $reqID = key($check_in_reqspec); - $last_version = $this->get_last_child_info($reqID,$getLastChildInfoOpt); - $msgID = 'frozen_req_unable_to_import'; - $status_ok = false; - - if( $last_version['is_open'] == 1 || !$my['options']['skipFrozenReq']) { - switch ($my['options']['actionOnHit']) { - case 'update_last_version': - $importMode = 'update'; - $result = $this->update($reqID,$last_version['id'], - $req['docid'],$req['title'],$req['description'], - $author_id,$req['status'],$req['type'], - $req['expected_coverage'], - $req['node_order']); - $fk_id = $last_version['id']; // for attachment management - $status_ok = ($result['status_ok'] == 1); - if( $status_ok) { - $msgID = 'import_req_updated'; - } else { - $msgID = 'import_req_update_last_version_failed'; - } - break; - - case 'create_new_version': - $newItem = $this->create_new_version($reqID,$author_id,array('notify' => true)); - - // Set always new version to NOT Frozen - $this->updateOpen($newItem['id'],1); - - // hmm wrong implementation - // Need to update ALL fields on new version then why do not use - // update() ? - $newReq['version_id'] = $newItem['id']; - $fk_id = $newReq['version_id']; // for attachment management - - // IMPORTANT NOTICE: - // We have to DO NOT UPDATE REQDOCID with info received from USER - // Because ALL VERSION HAS TO HAVE docid, or we need to improve our checks - // and if update fails => we need to delete new created version. - $title = trim_and_limit($req['title'],$fieldSize->req_title); - $importMode = 'update'; - $result = $this->update($reqID,$newItem['id'], - $req['docid'],$title,$req['description'], - $author_id,$req['status'],$req['type'], - $req['expected_coverage'], - $req['node_order']); - - $status_ok = ($result['status_ok'] == 1); - if( $status_ok) { - $msgID = 'import_req_new_version_created'; - } else { - // failed -> removed just created version - $this->delete($reqID,$newItem['id']); - $msgID = 'import_req_new_version_failed'; - } - break; - } - } - } - $what2add = is_null($result) ? $req['docid'] : $req['docid'] . ':' . $result['msg']; - - $user_feedback[] = array('doc_id' => $req['docid'], - 'title' => $req['title'], - 'import_status' => sprintf($labels[$msgID],$what2add)); - - $hasAttachments = array_key_exists('attachments',$req); - // process attachements for creation and update - if ($status_ok && $hasAttachments) { - $addAttachResp = $this->processAttachments( - $importMode, $fk_id, $req['attachments'], $feedbackMsg ); - } - - // display only problems during attachments import - if( isset($addAttachResp) && !is_null($addAttachResp) ) { - foreach($addAttachResp as $att_name) { - $user_feedback[] = - array('doc_id' => $req['docid'], - 'title' => $req['title'], - 'import_status' => - sprintf(lang_get('import_req_attachment_skipped'),$att_name)); - } - } - - if( $status_ok && $doProcessCF && isset($req['custom_fields']) && !is_null($req['custom_fields']) ) { - $req_version_id = !is_null($newReq) ? $newReq['version_id'] : $last_version['id']; - $cf2insert = null; - - foreach( $req['custom_fields'] as $cfname => $cfvalue) { - $cfname = trim($cfname); - if( isset($linkedCF[$cfname]) ) { - $cf2insert[$linkedCF[$cfname]['id']] = - array('type_id' => $linkedCF[$cfname]['type'], - 'cf_value' => $cfvalue); - } else { - if (!isset($missingCfMsg[$cfname])) { - $missingCfMsg[$cfname] = sprintf($messages['cfield'], - $cfname,$labels['requirement']); - } - $user_feedback[] = array('doc_id' => $req['docid'], - 'title' => $req['title'], - 'import_status' => $missingCfMsg[$cfname]); - } - } - if (!is_null($cf2insert)) { - $this->cfield_mgr->design_values_to_db($cf2insert,$req_version_id,null,'simple'); - } - } - - return $user_feedback; -} - - /** - * processAttachments - * - * Analyze attachments info related to requirement to define if the the attachment has to be added. - * attachments are ignored only if a attachment with the same ID is already linked to the target requirement. - * - * return an array of all attachments names of IDs already linked to target requirement (to display warning messages). - * - */ - - function processAttachments($importMode, $srs_id, $attachments, $feedbackMsg ) - { - $tables = tlObjectWithDB::getDBTables(array('req_versions','attachments')); - - $knownAttachments = array(); - foreach( $attachments as $attachment ) - { - $addAttachment = true; - if($importMode == 'update'){ - // try to bypass the importation of already known attachments. - // Check in database if the attachment with the same ID is linked to the rspec with the same internal ID - // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. - // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). - $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . - " WHERE ATT.id='{$this->db->prepare_string($attachment[id])}' " . - " AND ATT.fk_id={$srs_id} "; - $rsx=$this->db->get_recordset($sql); - $addAttachment = ( is_null($rsx) || count($rsx) < 1 ); - if( $addAttachment === false ){ // inform user that the attachment has been skipped - $knownAttachments[] = $attachment['name']; - } - } - if($addAttachment){ - $attachRepo = tlAttachmentRepository::create($this->db); - $fileInfo = $attachRepo->createAttachmentTempFile( $attachment['content'] ); - $fileInfo['name'] = $attachment['name']; - $fileInfo['type'] = $attachment['file_type']; - $attachRepo->insertAttachment( $srs_id, - $tables['req_versions'], $attachment['title'], $fileInfo); - } - } - return $knownAttachments; - } - -// ---------------------------------------------------------------------------- -// Custom field related functions -// ---------------------------------------------------------------------------- - -/* - function: get_linked_cfields - Get all linked custom fields. - Remember that custom fields are defined at system wide level, and - has to be linked to a testproject, in order to be used. - - - args: id: requirement id - $child_id: requirement version id or requirement revision id - [parent_id]: this information is vital, - to get the linked custom fields. - null -> use requirement_id as starting point. - !is_null -> use this value as testproject id - - returns: map/hash - key: custom field id - value: map with custom field definition and value assigned for choosen requirement, - with following keys: - - id: custom field id - name - label - type: custom field type - possible_values: for custom field - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - value: value assigned to custom field for this requirement - null if for this requirement custom field was never edited. - - node_id: requirement id - null if for this requirement, custom field was never edited. -*/ -function get_linked_cfields($id,$child_id,$parent_id=null,$opt=null) -{ - $options = array('access_key' => null); - $options = array_merge($options,(array)$opt); - - if( !is_null($parent_id) ) { - $tproject_id = $parent_id; - } else { - $req_info = $this->get_by_id($id); - $tproject_id = $req_info[0]['testproject_id']; - unset($req_info); - } - - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::ENABLED,null,'requirement', - $child_id,$options['access_key']); - return $cf_map; -} - - -/* - function: html_table_of_custom_field_inputs - Return html code, implementing a table with custom fields labels - and html inputs, for choosen requirement. - Used to manage user actions on custom fields values. - - - args: $id - $version_id --- BUGID - NEEDS CHANGES - [parent_id]: need to undertad to which testproject the requirement belongs. - this information is vital, to get the linked custom fields. - null -> use requirement_id as starting point. - !is_null -> use this value as starting point. - - - [$name_suffix]: must start with '_' (underscore). - Used when we display in a page several items - (example during test case execution, several test cases) - that have the same custom fields. - In this kind of situation we can use the item id as name suffix. - - - returns: html string -*/ -function html_table_of_custom_field_inputs($id,$version_id,$parent_id=null,$name_suffix='', $input_values = null) -{ - $cf_map = $this->get_linked_cfields($id,$version_id,$parent_id,$name_suffix); - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - return $cf_smarty; -} - - -/* - function: html_table_of_custom_field_values - Return html code, implementing a table with custom fields labels - and custom fields values, for choosen requirement. - You can think of this function as some sort of read only version - of html_table_of_custom_field_inputs. - - - args: $id - $child_id: req version or req revision ID - - returns: html string - -*/ -function html_table_of_custom_field_values($id,$child_id,$tproject_id=null) -{ - $NO_WARNING_IF_MISSING=true; - $cf_smarty = ''; - - $root_id = is_null($id) ? $tproject_id : null; - $cf_map = $this->get_linked_cfields($id,$child_id,$root_id); - - $show_cf = config_get('custom_fields')->show_custom_fields_without_value; - - if(!is_null($cf_map)) { - foreach($cf_map as $cf_id => $cf_info) { - // if user has assigned a value, then node_id is not null - if($cf_info['node_id'] || $show_cf) { - $label = str_replace(TL_LOCALIZE_TAG,'', - lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING)); - - $cf_smarty .= '' . - htmlspecialchars($label) . ":" . - $this->cfield_mgr->string_custom_field_value($cf_info,$child_id) . - "\n"; - } - } - - if(trim($cf_smarty) != "") - { - $cf_smarty = "" . $cf_smarty . "
    "; - } - } - return $cf_smarty; -} // function end - - - /* - function: values_to_db - write values of custom fields. - - args: $hash: - key: custom_field__. - Example custom_field_0_67 -> 0=> string field - - $node_id: - - [$cf_map]: hash -> all the custom fields linked and enabled - that are applicable to the node type of $node_id. - - For the keys not present in $hash, we will write - an appropriate value according to custom field - type. - - This is needed because when trying to udpate - with hash being $_REQUEST, $_POST or $_GET - some kind of custom fields (checkbox, list, multiple list) - when has been deselected by user. - - - rev: - */ - function values_to_db($hash,$node_id,$cf_map=null,$hash_type=null) - { - $this->cfield_mgr->design_values_to_db($hash,$node_id,$cf_map,$hash_type); - } - - - /** - * customFieldValuesAsXML - * - * @param $id: requirement spec id - * @param $tproject_id: test project id - * - * - */ - function customFieldValuesAsXML($id,$version_id,$tproject_id) - { - $xml = null; - $cfMap=$this->get_linked_cfields($id,$version_id,$tproject_id); - if( !is_null($cfMap) && count($cfMap) > 0 ) { - $xml = $this->cfield_mgr->exportValueAsXML($cfMap); - } - return $xml; - } - - - - - - /* - function: getByDocID - get req information using document ID as access key. - - args : doc_id: - [tproject_id] - [parent_id] -> req spec parent of requirement searched - default 0 -> case sensivite search - - returns: map. - key: req spec id - value: req info, map with following keys: - id - doc_id - testproject_id - title - scope - */ - function getByDocID($doc_id,$tproject_id=null,$parent_id=null, $options = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('check_criteria' => '=', 'access_key' => 'id', - 'case' => 'sensitive', 'output' => 'standard'); - $my['options'] = array_merge($my['options'], (array)$options); - - - $output=null; - $the_doc_id = $this->db->prepare_string(trim($doc_id)); - switch($my['options']['check_criteria']) - { - case '=': - default: - $check_criteria = " = '{$the_doc_id}' "; - break; - - case 'like': - $check_criteria = " LIKE '{$the_doc_id}%' "; - break; - } - - $sql = " /* $debugMsg */ SELECT "; - switch($my['options']['output']) - { - case 'standard': - $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; - break; - - case 'minimun': - $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id"; - break; - } - - $sql .= " FROM {$this->object_table} REQ " . - " /* Get Req info from NH */ " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - " WHERE REQ.req_doc_id {$check_criteria} "; - - if( !is_null($tproject_id) ) - { - $sql .= " AND REQ_SPEC.testproject_id={$tproject_id}"; - } - - if( !is_null($parent_id) ) - { - $sql .= " AND REQ.srs_id={$parent_id}"; - } - - $out = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - - return $out; - } - - /** - * Copy a requirement to a new requirement specification - * requirement DOC ID will be changed because must be unique inside - * MASTER CONTAINER (test project) - * - * @param integer $id: requirement ID - * @param integer $parent_id: target req spec id (where we want to copy) - * @param integer $user_id: who is requesting copy - * @param integer $tproject_id: FOR SOURCE ($id), optional, - * is null will be computed here - * @param array $options: map - * - */ - function copy_to($id,$parent_id,$user_id,$tproject_id=null,$options=null) { - $new_item = array('id' => -1, 'status_ok' => 0, 'msg' => 'ok', 'mappings' => null); - $my['options'] = array('copy_also' => null, 'caller' => ''); - $my['options'] = array_merge($my['options'], (array)$options); - - if( is_null($my['options']['copy_also']) ) { - $my['options']['copy_also'] = array('testcase_assignment' => true); - } - - $copyReqVTCVLinks = isset($my['options']['copy_also']['testcase_assignment']) && - $my['options']['copy_also']['testcase_assignment']; - - $root = $tproject_id; - if( is_null($root) ) { - $reqSpecMgr = new requirement_spec_mgr($this->db); - $target = $reqSpecMgr->get_by_id($parent_id); - $root = $target['testproject_id']; - } - - // NEED INLINE REFACTORING - $item_versions = $this->get_by_id($id); - if($item_versions) { - if($my['options']['caller'] == 'copy_testproject') { - $target_doc = $item_versions[0]['req_doc_id']; - $title = $item_versions[0]['title']; - } else { - // REQ DOCID is test project wide => can not exist duplicates inside - // a test project => we need to generate a new one using target as - // starting point - $target_doc = $this->generateDocID($id,$root); - - // If a sibling exists with same title => need to generate automatically - // a new one. - $title = $this->generateUniqueTitle($item_versions[0]['title'], - $parent_id,$root); - } - - $new_item = $this->create_req_only($parent_id,$target_doc,$title, - $item_versions[0]['author_id'], - $item_versions[0]['node_order']); - - if ($new_item['status_ok']) { - $ret['status_ok']=1; - $new_item['mappings']['req'][$id] = $new_item['id']; - - foreach($item_versions as &$req_version) { - $op = $this->create_version($new_item['id'],$req_version['version'], - $req_version['scope'],$req_version['author_id'], - $req_version['status'],$req_version['type'], - $req_version['expected_coverage']); - - // need to explain how this mappings are used outside this method - // first thing that can see here, we are mixing req id and - // req version id on same hash. - // - $new_item['mappings']['req_version'][$req_version['version_id']] = $op['id']; - - // 2018 - $new_item['mappings']['req_tree'][$id][$req_version['version_id']] = - $op['id']; - - - // here we have made a mistake, that help to show that - // we have some memory issue - // with copy_cfields(). - // ALWAYS when we have tproject_id we have to use it!!! - // - $this->copy_cfields(array('id' => $req_version['id'], - 'version_id' => $req_version['version_id']), - array('id' => $new_item['id'], 'version_id' => $op['id']), - $tproject_id); - - - $source = $req_version['version_id']; - $dest = $op['id']; - $this->attachmentRepository->copyAttachments($source,$dest, - $this->attachmentTableName); - - // Seems that when we call this function during Test Project Copy - // we DO NOT USE this piece - - if( $copyReqVTCVLinks ) { - $lnk = $this->getGoodForReqVersion($req_version['version_id']); - if( !is_null($lnk) ) { - $reqAndVer = array('id' => $new_item['id'], - 'version_id' => $op['id']); - foreach($lnk as $links) { - foreach($links as $value) { - $tcAndVer = array('id' => $value['testcase_id'], - 'version_id' => $value['tcversion_id']); - $this->assignReqVerToTCVer($reqAndVer,$tcAndVer,$user_id); - } - } - } - } - - unset($op); - } - - } - } - - unset($item_versions); // does this help to release memory ? - - return $new_item; - } - - - /** - * - * - */ - function copy_attachments($source_id,$target_id) { - $this->attachmentRepository->copyAttachments($source_id,$target_id,$this->attachmentTableName); - } - - - /* - function: copy_cfields - Get all cfields linked to any testcase of this testproject - with the values presents for $from_id, testcase we are using as - source for our copy. - - args: from_id: source item id - to_id: target item id - - returns: - - - */ - function copy_cfields($source,$destination,$tproject_id=null) - { - $cfmap_from = $this->get_linked_cfields($source['id'],$source['version_id'],$tproject_id); - $cfield=null; - if( !is_null($cfmap_from) ) { - foreach($cfmap_from as $key => $value) { - $cfield[$key]=array("type_id" => $value['type'], "cf_value" => $value['value']); - } - $this->cfield_mgr->design_values_to_db($cfield,$destination['version_id'],null,'reqversion_copy_cfields'); - } - } - - - - /** - * - * - */ - function generateDocID($id, $tproject_id) - { - $item_info = $this->get_by_id($id); - $item_info = $item_info[0]; - - // Check if another req with same DOC ID exists on test project (MASTER CONTAINER), - // If yes generate a new DOC ID - $getOptions = array('check_criteria' => 'like', 'access_key' => 'req_doc_id'); - $itemSet = $this->getByDocID($item_info['req_doc_id'],$tproject_id,null,$getOptions); - - $target_doc = $item_info['req_doc_id']; - $instance = 1; - if( !is_null($itemSet) ) - { - $safety_len = 2; // use t - $mask = $this->reqCfg->duplicated_docid_algorithm->text; - - // req_doc_id has limited size then we need to be sure that generated id will - // not exceed DB size - $nameSet = array_flip(array_keys($itemSet)); - $prefix = trim_and_limit($item_info['req_doc_id'], - $this->fieldSize->req_docid-strlen($mask)-$safety_len); - - // $target_doc = $prefix . " [{$instance}]"; - $target_doc = $prefix . sprintf($mask,$instance); - while( isset($nameSet[$target_doc]) ) - { - $instance++; - $target_doc = $prefix . sprintf($mask,$instance); - } - } - return $target_doc; - } - - /** - * - * - */ - function create_req_only($srs_id,$reqdoc_id,$title,$user_id,$node_order=0) - { - static $debugMsg; - - if(!$debugMsg) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - } - - $req_id = $this->tree_mgr->new_node($srs_id,$this->node_types_descr_id['requirement'], - $title,$node_order); - $sql = "/* $debugMsg */ INSERT INTO {$this->object_table} " . - " (id, srs_id, req_doc_id)" . - " VALUES ({$req_id}, {$srs_id},'" . $this->db->prepare_string($reqdoc_id) . "')"; - - if (!$this->db->exec_query($sql)) - { - $result = array( 'id' => -1, 'status_ok' => 0); - $result['msg'] = lang_get('error_inserting_req'); - } - else - { - $result = array( 'id' => $req_id, 'status_ok' => 1, 'msg' => 'ok'); - } - - unset($sql); - unset($req_id); - - return $result; - } - - /* - function: create_version - - args: - - returns: - - - */ - function create_version($id,$version,$scope, $user_id, $status = TL_REQ_STATUS_VALID, - $type = TL_REQ_TYPE_INFO, $expected_coverage=1) - { - static $debugMsg; - - if(!$debugMsg) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - } - - $item_id = $this->tree_mgr->new_node($id,$this->node_types_descr_id['requirement_version']); - - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_versions']} " . - " (id,version,scope,status,type,expected_coverage,author_id,creation_ts) " . - " VALUES({$item_id},{$version},'" . trim($this->db->prepare_string($scope)) . "','" . - $this->db->prepare_string($status) . "','" . $this->db->prepare_string($type) . "'," . - "{$expected_coverage}," . intval($user_id) . "," . $this->db->db_now() . ")"; - - $result = $this->db->exec_query($sql); - $ret = array( 'msg' => 'ok', 'id' => $item_id, 'status_ok' => 1); - if (!$result) - { - $ret['msg'] = $this->db->error_msg(); - $ret['status_ok']=0; - $ret['id']=-1; - } - unset($sql); - unset($result); - unset($item_id); - return $ret; - } - - /* - function: create_new_version() - create a new version, doing BY DEFAULT a copy of last version. - If reqVersionID is passed, then this version will be used as source data. - - args : $id: requirement id - $user_id: who is doing this operation. - $reqVersionID = default null => use last version as source - - returns: - map: id: node id of created tcversion - version: version number (i.e. 5) - msg - - */ - function create_new_version($id,$user_id,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('reqVersionID' => null,'log_msg' => null, - 'notify' => false, - 'freezeSourceVersion' => true); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $reqVersionID = $my['opt']['reqVersionID']; - $log_msg = $my['opt']['log_msg']; - $notify = $my['opt']['notify']; - - // get a new id - $version_id = $this->tree_mgr->new_node($id,$this->node_types_descr_id['requirement_version']); - - // Needed to get higher version NUMBER, to generata new VERSION NUMBER - $sourceVersionInfo = $this->get_last_child_info($id, array('child_type' => 'version')); - if( is_null($sourceVersionInfo) ) { - throw new Exception($debugMsg . ' $this->get_last_child_info() RETURNED NULL !!! - WRONG - Open Issue on mantis.testlink.org'); - } - - // Till now everything is OK - if( $notify ) { - // be optimistic send email before doing nothing - $this->notifyMonitors($id,__FUNCTION__,$user_id,$log_msg); - } - - $newVersionNumber = $sourceVersionInfo['version']+1; - - $ret = array(); - $ret['id'] = $version_id; - $ret['version'] = $newVersionNumber; - $ret['msg'] = 'ok'; - - $sourceVersionID = is_null($reqVersionID) ? $sourceVersionInfo['id'] : $reqVersionID; - - // Update Link Status To Test Case Versions for Source Version - // is done on copy_version() - $this->copy_version($id,$sourceVersionID,$version_id,$newVersionNumber,$user_id); - - // need to update log message in new created version - $sql = "/* $debugMsg */ " . - " UPDATE {$this->tables['req_versions']} " . - " SET log_message = '" . trim($this->db->prepare_string($log_msg)) . "'" . - " WHERE id={$version_id}"; - $this->db->exec_query($sql); - - if( $my['opt']['freezeSourceVersion'] ) { - $this->updateOpen($sourceVersionInfo['id'],0); - } - - return $ret; - } - - - /** - * - * - */ - function get_last_version_info($id, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $info = null; - - $sql = " /* $debugMsg */ SELECT MAX(version) AS version " . - " FROM {$this->tables['req_versions']} REQV," . - " {$this->tables['nodes_hierarchy']} NH WHERE ". - " NH.id = REQV.id ". - " AND NH.parent_id = {$id} "; - - $max_version = $this->db->fetchFirstRowSingleColumn($sql,'version'); - if ($max_version) { - $my['opt'] = array('output' => 'default'); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - switch($my['opt']['output']) { - case 'id': - $fields = ' REQV.id '; - break; - - case 'id,version': - $fields = ' REQV.id, REQV.version '; - break; - - default: - $fields = ' REQV.*'; - break; - } - $sql = "/* $debugMsg */ SELECT {$fields} " . - " FROM {$this->tables['req_versions']} REQV," . - " {$this->tables['nodes_hierarchy']} NH ". - " WHERE version = {$max_version} AND NH.id = REQV.id AND NH.parent_id = {$id}"; - - $info = $this->db->fetchFirstRow($sql); - } - return $info; - } - - /** - * get last defined req doc id for specific test project - * - * @author Julian Krien - * - * @param int $tproj_id test project id - * - * @return string last defned req doc id - */ - - function get_last_doc_id_for_testproject($tproj_id) - { - $info = null; - $tproject_mgr = new testproject($this->db); - $all_reqs = $tproject_mgr->get_all_requirement_ids($tproj_id); - - if(count($all_reqs) > 0) - { - //only use maximum value of all reqs array - $last_req = max($all_reqs); - $last_req = $this->get_by_id($last_req); - $info = $last_req[0]['req_doc_id']; - } - return $info; - } - - /** - * - * - */ - function copy_version($id,$from_version_id,$to_version_id,$as_version_number,$user_id) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $now = $this->db->db_now(); - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_versions']} " . - " (id,version,author_id,creation_ts,scope,status,type,expected_coverage) " . - " SELECT {$to_version_id} AS id, {$as_version_number} AS version, " . - " {$user_id} AS author_id, {$now} AS creation_ts," . - " scope,status,type,expected_coverage " . - " FROM {$this->tables['req_versions']} " . - " WHERE id=" . intval($from_version_id); - $result = $this->db->exec_query($sql); - - $this->copy_cfields(array('id' => $id, 'version_id' => $from_version_id), - array('id' => $id, 'version_id' => $to_version_id)); - - - $this->copy_attachments($from_version_id,$to_version_id); - - - $reqTCLinksCfg = config_get('reqTCLinks'); - $freezeLinkOnNewReqVersion = $reqTCLinksCfg->freezeLinkOnNewReqVersion; + + * @copyright 2007-2020, TestLink community + * + * Manager for requirements. + * Requirements are children of a requirement specification (requirements container) + * + * + */ + +// Needed to use extends tlObjectWithAttachments, If not present autoload fails. +require_once dirname(__FILE__) . '/attachments.inc.php'; + +class requirement_mgr extends tlObjectWithAttachments +{ + + protected $db; + + public $cfield_mgr; + + private $my_node_type; + + public $tree_mgr; + + private $node_types_descr_id; + + private $node_types_id_descr; + + public $attachmentTableName; + + // 20100220 - franciscom - I'm will work only on XML + // then remove other formats till other dev do refactor + private $import_file_types = array( + "csv" => "CSV", + "csv_doors" => "CSV (Doors)", + "XML" => "XML", + "DocBook" => "DocBook" + ); + + private $export_file_types = array( + "XML" => "XML" + ); + + private $fieldSize; + + private $reqCfg; + + private $internal_links; + + private $relationsCfg; + + private $notifyOn; + + private $reqTCLinkCfg; + + protected $debugMsg; + + const AUTOMATIC_ID = 0; + + const ALL_VERSIONS = 0; + + const LATEST_VERSION = - 1; + + const NO_REVISION = - 1; + + /* + * function: requirement_mgr + * contructor + * + * args: db: reference to db object + * + * returns: instance of requirement_mgr + * + */ + public function __construct(&$db) + { + $this->db = &$db; + $this->cfield_mgr = new cfield_mgr($this->db); + $this->tree_mgr = new tree($this->db); + + $this->attachmentTableName = 'req_versions'; + + tlObjectWithAttachments::__construct($this->db, + $this->attachmentTableName); + + $this->node_types_descr_id = $this->tree_mgr->get_available_node_types(); + $this->node_types_id_descr = array_flip($this->node_types_descr_id); + $this->my_node_type = $this->node_types_descr_id['requirement']; + $this->object_table = $this->tables['requirements']; + + $this->fieldSize = config_get('field_size'); + $this->reqCfg = config_get('req_cfg'); + $this->reqTCLinkCfg = config_get('reqTCLinks'); + + $this->relationsCfg = new stdClass(); + $this->relationsCfg->interProjectLinking = $this->reqCfg->relations->interproject_linking; + + $this->internal_links = config_get('internal_links'); + + $this->notifyOn = null; + + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /* + * function: get_export_file_types + * getter + * + * args: - + * + * returns: map + * key: export file type code + * value: export file type verbose description + * + */ + public function get_export_file_types() + { + return $this->export_file_types; + } + + /* + * function: get_impor_file_types + * getter + * + * args: - + * + * returns: map + * key: import file type code + * value: import file type verbose description + * + */ + public function get_import_file_types() + { + return $this->import_file_types; + } + + /* + * function: get_by_id + * + * + * args: id: requirement id (can be an array) + * [version_id]: requirement version id (can be an array) + * [version_number]: + * [options] + * + * + * returns: null if query fails + * map with requirement info + * + * + */ + public function get_by_id($id, $version_id = self::ALL_VERSIONS, + $version_number = 1, $options = null, $filters = null) + { + static $userCache; // key: user id, value: display name + static $user_keys; + + $debugMsg = $this->debugMsg . __FUNCTION__; + $labels['undefined'] = lang_get('undefined'); + $user_keys = array( + 'author' => 'author_id', + 'modifier' => 'modifier_id' + ); + + $my['options'] = array( + 'order_by' => " ORDER BY REQV.version DESC ", + 'output_format' => 'array', + 'renderImageInline' => false, + 'decodeUsers' => true, + 'outputLevel' => 'std' + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + // null => do not filter + $my['filters'] = array( + 'status' => null, + 'type' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $filter_clause = ''; + $dummy[] = ''; // trick to make implode() work + foreach ($my['filters'] as $field2filter => $value) { + if (! is_null($value)) { + $dummy[] = " {$field2filter} = '{$value}' "; + } + } + + if (count($dummy) > 1) { + $filter_clause = implode(" AND ", $dummy); + } + + $where_clause = " WHERE NH_REQV.parent_id "; + if ($id_is_array = is_array($id)) { + $where_clause .= "IN (" . implode(",", $id) . ") "; + } else { + $where_clause .= " = {$id} "; + } + + if (is_array($version_id)) { + $versionid_list = implode(",", $version_id); + $where_clause .= " AND REQV.id IN ({$versionid_list}) "; + } else { + if (is_null($version_id)) { + // search by "human" version number + $where_clause .= " AND REQV.version = {$version_number} "; + } else { + if ($version_id != self::ALL_VERSIONS && + $version_id != self::LATEST_VERSION) { + $where_clause .= " AND REQV.id = {$version_id} "; + } + } + } + + // added -1 AS revision_id to make some process easier + switch ($my['options']['outputLevel']) { + case 'minimal': + $outf = " /* $debugMsg */ SELECT REQ.id,REQ.req_doc_id,REQV.id AS version_id," . + " NH_REQ.name AS title "; + break; + + case 'std': + default: + $outf = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . + " REQV.scope,REQV.status,REQV.type,REQV.active," . + " REQV.is_open,REQV.is_open AS reqver_is_open,REQV.author_id,REQV.version,REQV.id AS version_id," . + " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . + " REQV.modification_ts,REQV.revision, -1 AS revision_id, " . + " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; + break; + } + + // added -1 AS revision_id to make some process easier + $sql = $outf . " FROM {$this->object_table} REQ " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . + " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + $where_clause . $filter_clause . $my['options']['order_by']; + + $decodeUserMode = 'simple'; + if ($version_id != self::LATEST_VERSION) { + switch ($my['options']['output_format']) { + case 'mapOfArray': + $recordset = $this->db->fetchRowsIntoMap($sql, 'id', + database::CUMULATIVE); + $decodeUserMode = 'complex'; + break; + + case 'array': + default: + $recordset = $this->db->get_recordset($sql); + break; + } + } else { + // But, how performance wise can be do this, + // instead of using MAX(version) and a group by? + // + // if $id was a list then this will return something USELESS + // + if (! $id_is_array) { + $recordset = array( + $this->db->fetchFirstRow($sql) + ); + } else { + // Write to event viewer ??? + // Developer Needs to user + die('use getByIDBulkLatestVersionRevision()'); + } + } + + $rs = null; + if (! is_null($recordset) && $my['options']['renderImageInline']) { + $k2l = array_keys($recordset); + foreach ($k2l as $akx) { + $this->renderImageAttachments($id, $recordset[$akx]); + } + reset($recordset); + } + + $rs = $recordset; + if (! is_null($recordset) && $my['options']['decodeUsers']) { + switch ($decodeUserMode) { + case 'complex': + // output[REQID][0] = array('id' =>, 'xx' => ...) + $flevel = array_keys($recordset); + foreach ($flevel as $flk) { + $key2loop = array_keys($recordset[$flk]); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$flk][$key][$ukey] = ''; + if (trim($rs[$flk][$key][$userid_field]) != "") { + if (! isset( + $userCache[$rs[$flk][$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$flk][$key][$userid_field]); + $rs[$flk][$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$flk][$key][$userid_field]] = $rs[$flk][$key][$ukey]; + unset($user); + } else { + $rs[$flk][$key][$ukey] = $userCache[$rs[$flk][$key][$userid_field]]; + } + } + } + } + } + break; + + case 'simple': + default: + $key2loop = array_keys($recordset); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$key][$ukey] = ''; + if (trim($rs[$key][$userid_field]) != "") { + if (! isset( + $userCache[$rs[$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$key][$userid_field]); + $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; + unset($user); + } else { + $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; + } + } + } + } + break; + } + } + + unset($recordset); + unset($my); + unset($dummy); + + return $rs; + } + + /* + * function: create + * + * args: srs_id: req spec id, parent of requirement to be created + * reqdoc_id + * title + * scope + * user_id: author + * [status] + * [type] + * [expected_coverage] + * [node_order] + * + * returns: map with following keys: + * status_ok -> 1/0 + * msg -> some simple message, useful when status_ok ==0 + * id -> id of new requirement. + * + * @internal revision + */ + public function create($srs_id, $reqdoc_id, $title, $scope, $user_id, + $status = TL_REQ_STATUS_VALID, $type = TL_REQ_TYPE_INFO, + $expected_coverage = 1, $node_order = 0, $tproject_id = null, + $options = null) + { + // This kind of saving is important when called in a loop in situations like + // copy test project + static $debugMsg; + static $log_message; + + if (! $log_message) { + $debugMsg = $this->debugMsg . __FUNCTION__; + $log_message = lang_get('req_created_automatic_log'); + } + + $tproject_id = is_null($tproject_id) ? $this->tree_mgr->getTreeRoot( + $srs_id) : $tproject_id; + + $result = array( + 'id' => 0, + 'status_ok' => 0, + 'msg' => 'ko' + ); + $my['options'] = array( + 'quickAndDirty' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + if (! $my['options']['quickAndDirty']) { + $reqdoc_id = trimAndLimit($reqdoc_id, $this->fieldSize->req_docid); + $title = trimAndLimit($title, $this->fieldSize->req_title); + $op = $this->check_basic_data($srs_id, $tproject_id, $title, + $reqdoc_id); + } else { + $op['status_ok'] = true; + } + + $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; + if ($op['status_ok']) { + $result = $this->create_req_only($srs_id, $reqdoc_id, $title, + $node_order); + if ($result["status_ok"]) { + if ($this->internal_links->enable) { + $scope = req_link_replace($this->db, $scope, $tproject_id); + } + + $op = $this->create_version($result['id'], 1, $scope, $user_id, + $status, $type, intval($expected_coverage)); + $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; + $result['version_id'] = $op['status_ok'] ? $op['id'] : - 1; + + if ($op['status_ok']) { + $sql = "/* $debugMsg */ " . + "UPDATE {$this->tables['req_versions']} " . + " SET log_message='" . + $this->db->prepare_string($log_message) . "'" . + " WHERE id = " . intval($op['id']); + $this->db->exec_query($sql); + } + } + } + $ctx = array( + 'id' => $result['id'] + ); + event_signal('EVENT_TEST_REQUIREMENT_CREATE', $ctx); + + return $result; + } + + // function end + + /* + * function: update + * + * + * args: id: requirement id + * version_id + * reqdoc_id + * title + * scope + * user_id: author + * status + * type + * $expected_coverage + * [skip_controls] + * + * + * returns: map: keys : status_ok, msg + * + * @internal revision + * 20091202 - franciscom - + * + */ + public function update($id, $version_id, $reqdoc_id, $title, $scope, + $user_id, $status, $type, $expected_coverage, $node_order = null, + $tproject_id = null, $skip_controls = 0, $create_revision = false, + $log_msg = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $result['status_ok'] = 1; + $result['msg'] = 'ok'; + + $db_now = $this->db->db_now(); + + // get SRSid, needed to do controls + $rs = $this->get_by_id($id, $version_id); + $req = $rs[0]; + $srs_id = $req['srs_id']; + + // try to avoid function calls when data is available on caller + $tproject_id = is_null($tproject_id) ? $this->tree_mgr->getTreeRoot( + $srs_id) : $tproject_id; + + if ($this->internal_links->enable) { + $scope = req_link_replace($this->db, $scope, $tproject_id); + } + + $reqdoc_id = trimAndLimit($reqdoc_id, $this->fieldSize->req_docid); + $title = trimAndLimit($title, $this->fieldSize->req_title); + $chk = $this->check_basic_data($srs_id, $tproject_id, $title, $reqdoc_id, + $id); + + if ($chk['status_ok'] || $skip_controls) { + if ($create_revision) { + $this->create_new_revision($version_id, $user_id, $tproject_id, + $req, $log_msg); + } + + $sql = array(); + + $q = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . + " SET name='" . $this->db->prepare_string($title) . "'"; + if (! is_null($node_order)) { + $q .= ', node_order= ' . abs(intval($node_order)); + } + $sql[] = $q . " WHERE id={$id}"; + + $sql[] = "/* $debugMsg */ UPDATE {$this->tables['requirements']} " . + " SET req_doc_id='" . $this->db->prepare_string($reqdoc_id) . "'" . + " WHERE id={$id}"; + + $sql_temp = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . + " SET scope='" . $this->db->prepare_string($scope) . "', " . + " status='" . $this->db->prepare_string($status) . "', " . + " expected_coverage={$expected_coverage}, " . " type='" . + $this->db->prepare_string($type) . "' "; + + // only if no new revision is created set modifier and modification ts + // otherwise those values are handled by function create_new_revision() + if (! $create_revision) { + $sql_temp .= ", modifier_id={$user_id}, modification_ts={$db_now} "; + } + + $sql[] = $sql_temp . " WHERE id=" . intval($version_id); + + foreach ($sql as $stm) { + $qres = $this->db->exec_query($stm); + if (! $qres) { + $result['status_ok'] = 0; + $result['msg'] = $this->db->error_msg; + $result['sql'] = $stm; + break; + } + } + } // if($chk['status_ok'] || $skip_controls) + else { + $result['status_ok'] = $chk['status_ok']; + $result['msg'] = $chk['msg']; + } + + $ctx = array( + 'id' => $id + ); + event_signal('EVENT_TEST_REQUIREMENT_UPDATE', $ctx); + return $result; + } + + // function end + + /* + * function: delete + * Requirement + * Requirement link to testcases + * Requirement relations + * Requirement custom fields values + * Attachments + * + * check if we are deleting the only existent version, in this case + * we need to delete the requirement. + * + * args: id: can be one id, or an array of id + * + * returns: + */ + public function delete($id, $version_id = self::ALL_VERSIONS, + $user_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $children = null; + + $where = array( + 'coverage' => '', + 'this' => '', + 'iam_parent' => '' + ); + $deleteAll = false; + $result = null; + $doIt = true; + $kaboom = false; + + if (is_array($id)) { + $id_list = implode(',', $id); + $where['coverage'] = " WHERE req_id IN ({$id_list})"; + $where['this'] = " WHERE id IN ({$id_list})"; + $where['iam_parent'] = " WHERE parent_id IN ({$id_list})"; + } else { + $safeID = intval($id); + $where['coverage'] = " WHERE req_id = " . $safeID; + $where['this'] = " WHERE id = " . $safeID; + $where['iam_parent'] = " WHERE parent_id = " . $safeID; + } + + $set2del = null; + + // if we are trying to delete ONE SPECIFIC VERSION + // of ONE REQ, and is the ONLY VERSION on DB + // then we are going to delete the req. + $checkNotify = true; + $action4notify = 'delete'; + if ($version_id != self::ALL_VERSIONS) { + // we use version id when working on ONE REQ, + // then I'm going to trust this. + // From GUI if only one version exists, + // the operation available is DELETE REQ, + // not delete version + $sql = "SELECT COUNT(0) AS VQTY, parent_id FROM " . + " {$this->tables['nodes_hierarchy']} " . $where['iam_parent'] . + ' GROUP BY parent_id'; + + $rs = $this->db->fetchRowsIntoMap($sql, 'parent_id'); + $rs = current($rs); + if (isset($rs['VQTY']) && $rs['VQTY'] > 1) { + $action4notify = 'delete_version'; + } + } + + if ($checkNotify && $this->notifyOn[__FUNCTION__]) { + // Need to save data before delete + $set2del = $this->getByIDBulkLatestVersionRevision($id); + if (! is_null($set2del)) { + foreach ($set2del as $rk => $r2d) { + $this->notifyMonitors($rk, $action4notify, $user_id); + if ($action4notify == 'delete') { + $this->monitorOff($rk); + } + } + } + } + + // When deleting only one version, we need to check + // if we need to delete requirement also. + $children[] = $version_id; + if ($version_id == self::ALL_VERSIONS) { + $deleteAll = true; + + // I'm trying to speedup the next deletes + $sql = "/* $debugMsg */ " . + "SELECT NH.id FROM {$this->tables['nodes_hierarchy']} NH " . + "WHERE NH.parent_id "; + + if (is_array($id)) { + $sql .= " IN (" . implode(',', $id) . ") "; + } else { + $sql .= " = {$id} "; + } + + $sql .= " AND node_type_id=" . + $this->node_types_descr_id['requirement_version']; + + $children_rs = $this->db->fetchRowsIntoMap($sql, 'id'); + $children = array_keys($children_rs); + + // delete dependencies with test specification + $sql = "DELETE FROM {$this->tables['req_coverage']} " . + $where['coverage']; + $result = $this->db->exec_query($sql); + + // also delete relations to other requirements + // Issue due to FK + if ($result) { + $this->delete_all_relations($id); + } + + if ($result) { + // Need to get all versions for all requirements + $doIt = true; + $reqIDSet = (array) $id; + $reqVerSet = $this->getAllReqVersionIDForReq($reqIDSet); + + foreach ($reqVerSet as $reqVerElem) { + foreach ($reqVerElem as $reqVID2Del) { + $result = $this->attachmentRepository->deleteAttachmentsFor( + $reqVID2Del, $this->attachmentTableName); + } + } + } + } + + // Delete version info + $target = null; + if ($doIt) { + // As usual working with MySQL makes easier to be lazy and forget that + // agregate functions need GROUP BY + // How many versions are there? + // we will delete req also for all with COUNT(0) == 1 + $sql = "SELECT COUNT(0) AS VQTY, parent_id " . + " FROM {$this->tables['nodes_hierarchy']} " . + $where['iam_parent'] . ' GROUP BY parent_id'; + + $rs = $this->db->fetchRowsIntoMap($sql, 'parent_id'); + foreach ($rs as $el) { + if (isset($el['VQTY']) && $el['VQTY'] == 1) { + $target[] = $el['parent_id']; + } + } + + if ($kaboom = ! is_null($target)) { + $where['this'] = " WHERE id IN (" . implode(',', $target) . ")"; + } + + // Attachments are related to VERSION + foreach ($children as $reqVID) { + $this->attachmentRepository->deleteAttachmentsFor($reqVID, + $this->attachmentTableName); + } + + // Going to work on REVISIONS + $implosion = implode(',', $children); + $sql = "/* $debugMsg */ " . + " SELECT id from {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id IN ( {$implosion} ) " . " AND node_type_id=" . + $this->node_types_descr_id['requirement_revision']; + + $revisionSet = $this->db->fetchRowsIntoMap($sql, 'id'); + if (! is_null($revisionSet)) { + $this->cfield_mgr->remove_all_design_values_from_node( + array_keys($revisionSet)); + + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['req_revisions']} + WHERE parent_id IN ( {$implosion} ) "; + $this->db->exec_query($sql); + + $sql = "/* $debugMsg */ + DELETE FROM {$this->tables['nodes_hierarchy']} + WHERE parent_id IN ( {$implosion} ) + AND node_type_id=" . + $this->node_types_descr_id['requirement_revision']; + $this->db->exec_query($sql); + } + $this->cfield_mgr->remove_all_design_values_from_node( + (array) $children); + + $where['children'] = " WHERE id IN ( {$implosion} ) "; + + $sql = "DELETE FROM {$this->tables['req_versions']} " . + $where['children']; + $this->db->exec_query($sql); + + $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + $where['children'] . " AND node_type_id=" . + $this->node_types_descr_id['requirement_version']; + $result = $this->db->exec_query($sql); + } + + $kaboom = $kaboom || ($deleteAll && $result); + if ($kaboom) { + $sql = "DELETE FROM {$this->object_table} " . $where['this']; + $this->db->exec_query($sql); + + $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + $where['this'] . " AND node_type_id=" . + $this->node_types_descr_id['requirement']; + + $result = $this->db->exec_query($sql); + } + + $result = (! $result) ? lang_get('error_deleting_req') : 'ok'; + + $ctx = array( + 'id' => $id + ); + event_signal('EVENT_TEST_REQUIREMENT_DELETE', $ctx); + + return $result; + } + + /** + * collect coverage of Requirement + * + * @param string $req_id + * ID of req. + * @return array list of test cases [id, title] + * + * Notice regarding platforms: + * When doing Requirements Based Reports, we analize report situation + * on a Context composed by: + * Test project AND Test plan. + * + * We do this because we want to have a dynamic view (i.e. want to add exec info). + * + * When a Test plan has platforms defined, user get at GUI possibility to choose + * one platform. + * IMHO (franciscom) this has to change how coverage (dynamic) is computed. + * + * Static coverage: + * depicts relation bewteen Req and test cases spec, and platforms are not considered + * + * DYNAMIC coverage: + * depicts relation bewteen Req and test cases spec and exec status of these test case, + * and platforms have to be considered + * + */ + public function get_coverage($id, $context = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my = array( + 'options' => array( + 'accessKey' => 'idx' + ) + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $safe_id = intval($id); + $common = array(); + + $common['join'] = " FROM {$this->tables['nodes_hierarchy']} NH_TC " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id=NH_TC.id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id=NH_TCV.id " . + " JOIN {$this->tables['req_coverage']} RC ON RC.testcase_id = NH_TC.id "; + $common['where'] = " WHERE RC.req_id={$safe_id} "; + + if (is_null($context)) { + $sql = "/* $debugMsg - Static Coverage */ " . + " SELECT DISTINCT NH_TC.id,NH_TC.name,TCV.tc_external_id,U.login,RC.creation_ts" . + $common['join'] . + " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = RC.author_id " . + $common['where']; + } else { + + $sql = "/* $debugMsg - Dynamic Coverage */ " . + " SELECT DISTINCT NH_TC.id,NH_TC.name,TCV.tc_external_id" . + $common['join'] . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id " . + $common['where'] . " AND TPTCV.testplan_id = " . + intval($context['tplan_id']) . " AND TPTCV.platform_id = " . + intval($context['platform_id']); + } + $sql .= " ORDER BY tc_external_id "; + + switch ($my['options']['accessKey']) { + case 'tcase_id': + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + break; + + case 'idx': + default: + $rs = $this->db->get_recordset($sql); + break; + } + return $rs; + } + + /* + * function: check_basic_data + * do checks on title and reqdoc id, for a requirement + * + * Checks: + * empty title + * empty docid + * docid already exists inside test project (DOCID is Test Project WIDE) + * title alreday exists under same REQ SPEC (req. parent) + * + * + * args: srs_id: req spec id (req parent) + * title + * reqdoc_id + * [id]: default null + * + * + * returns: map + * keys: status_ok + * msg + * failure_reason + * + * @internal revision + * 20110206 - franciscom - add new key on retval 'failure_reason' + * 20110108 - franciscom - check on duplicate title under same parent + */ + private function check_basic_data($srs_id, $tproject_id, $title, $reqdoc_id, + $id = null) + { + $ret['status_ok'] = 1; + $ret['msg'] = ''; + $ret['failure_reason'] = ''; + + $title = trim($title); + $reqdoc_id = trim($reqdoc_id); + + if ($title == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_req_title"); + $ret['failure_reason'] = 'empty_req_title'; + } + + if ($reqdoc_id == "") { + $ret['status_ok'] = 0; + $ret['msg'] .= " " . lang_get("warning_empty_reqdoc_id"); + $ret['failure_reason'] = 'empty_reqdoc_id'; + } + + if ($ret['status_ok']) { + $ret['msg'] = 'ok'; + $rs = $this->getByDocID($reqdoc_id, $tproject_id); + if (! is_null($rs) && (is_null($id) || ! isset($rs[$id]))) { + $ret['msg'] = sprintf(lang_get("warning_duplicate_reqdoc_id"), + $reqdoc_id); + $ret['status_ok'] = 0; + $ret['failure_reason'] = 'duplicate_reqdoc_id'; + } + } + + // check for duplicate title + // BUGID 4150 + if ($ret['status_ok']) { + $ret['msg'] = 'ok'; + $target = array( + 'key' => 'title', + 'value' => $title + ); + $getOptions = array( + 'output' => 'id' + ); + $rs = $this->getByAttribute($target, $tproject_id, $srs_id, + $getOptions); + if (! is_null($rs) && (is_null($id) || ! isset($rs[$id]))) { + $ret['failure_reason'] = 'sibling_req_with_same_title'; + $ret['msg'] = sprintf( + lang_get("warning_sibling_req_with_same_title"), $title); + $ret['status_ok'] = 0; + } + } + + return $ret; + } + + /* + * function: create_tc_from_requirement + * create testcases using requirements as input + * + * + * args: + * + * returns: + */ + public function create_tc_from_requirement($mixIdReq, $srs_id, $user_id, + $tproject_id = null, $tc_count = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $tcaseMgr = new testcase($this->db); + $tsuite_mgr = new testsuite($this->db); + + $auto_testsuite_name = $this->reqCfg->default_testsuite_name; + $node_descr_type = $this->tree_mgr->get_available_node_types(); + $empty_steps = null; + $empty_preconditions = ''; // fix for BUGID 2995 + + $labels['tc_created'] = lang_get('tc_created'); + + $output = null; + $reqSet = is_array($mixIdReq) ? $mixIdReq : array( + $mixIdReq + ); + + if (is_null($tproject_id) || $tproject_id == 0) { + $tproject_id = $this->tree_mgr->getTreeRoot($srs_id); + } + + if ($this->reqCfg->use_req_spec_as_testsuite_name) { + $full_path = $this->tree_mgr->get_path($srs_id); + $addition = " (" . lang_get("testsuite_title_addition") . ")"; + $truncate_limit = $this->fieldSize->testsuite_name - + strlen($addition); + + // REQ_SPEC_A + // |-- REQ_SPEC_A1 + // |-- REQ_SPEC_A2 + // |- REQ100 + // |- REQ101 + // + // We will try to check if a test suite has already been created for + // top REQ_SPEC_A (we do search using automatic generated name as search criteria). + // If not => we need to create all path till leaves (REQ100 and REQ200) + // + // + // First search: we use test project + $parent_id = $tproject_id; + $deep_create = false; + foreach ($full_path as $node) { + // follow hierarchy of test suites to create + $tsuiteInfo = null; + + // deal with UTF-8 + $testsuite_name = mb_substr($node['name'], 0, $truncate_limit, + mb_detect_encoding($node['name'])) . $addition; + + if (! $deep_create) { + // child test suite with this name, already exists on current parent ? + // At first a failure we will not check anymore an proceed with deep create + $sql = "/* $debugMsg */ SELECT id,name FROM {$this->tables['nodes_hierarchy']} NH " . + " WHERE name='" . + $this->db->prepare_string($testsuite_name) . "' " . + " AND node_type_id=" . $node_descr_type['testsuite'] . + " AND parent_id = {$parent_id} "; + + // If returns more that one record use ALWAYS first + $tsuiteInfo = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + if (is_null($tsuiteInfo)) { + $tsuiteInfo = $tsuite_mgr->create($parent_id, + $testsuite_name, $this->reqCfg->testsuite_details); + $output[] = sprintf(lang_get('testsuite_name_created'), + $testsuite_name); + $deep_create = true; + } else { + $tsuiteInfo = current($tsuiteInfo); + } + $tsuite_id = $tsuiteInfo['id']; // last value here will be used as parent for test cases + $parent_id = $tsuite_id; + } + $output[] = sprintf(lang_get('created_on_testsuite'), + $testsuite_name); + } else { + // don't use req_spec as testsuite name + // Warning: + // We are not maintaining hierarchy !!! + $sql = " SELECT id FROM {$this->tables['nodes_hierarchy']} NH " . + " WHERE name='" . $this->db->prepare_string( + $auto_testsuite_name) . "' " . " AND parent_id=" . + $tproject_id . " " . " AND node_type_id=" . + $node_descr_type['testsuite']; + + $result = $this->db->exec_query($sql); + if ($this->db->num_rows($result) == 1) { + $row = $this->db->fetch_array($result); + $tsuite_id = $row['id']; + $label = lang_get('created_on_testsuite'); + } else { + // not found -> create + tLog('test suite:' . $auto_testsuite_name . ' was not found.'); + $new_tsuite = $tsuite_mgr->create($tproject_id, + $auto_testsuite_name, $this->reqCfg->testsuite_details); + $tsuite_id = $new_tsuite['id']; + $label = lang_get('testsuite_name_created'); + } + $output[] = sprintf($label, $auto_testsuite_name); + } + + // create TC + $createOptions = array(); + $createOptions['check_names_for_duplicates'] = config_get( + 'check_names_for_duplicates'); + $createOptions['action_on_duplicate_name'] = config_get( + 'action_on_duplicate_name'); + + $testcase_importance_default = config_get('testcase_importance_default'); + + // compute test case order + $testcase_order = config_get('treemenu_default_testcase_order'); + $nt2exclude = array( + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + $siblings = $this->tree_mgr->get_children($tsuite_id, $nt2exclude); + if (! is_null($siblings)) { + $dummy = end($siblings); + $testcase_order = $dummy['node_order']; + } + + foreach ($reqSet as $reqID) { + $reqData = $this->get_by_id($reqID, requirement_mgr::LATEST_VERSION); + $count = (! is_null($tc_count)) ? $tc_count[$reqID] : 1; + $reqData = $reqData[0]; + + // Generate name with progessive + $instance = 1; + $getOptions = array( + 'check_criteria' => 'like', + 'access_key' => 'name' + ); + $itemSet = $tcaseMgr->getDuplicatesByName($reqData['title'], + $tsuite_id, $getOptions); + + $nameSet = null; + if (! is_null($itemSet)) { + $nameSet = array_flip(array_keys($itemSet)); + } + + for ($idx = 0; $idx < $count; $idx ++) { + $testcase_order ++; + + // We have a little problem to work on: + // suppose you have created: + // TC [1] + // TC [2] + // TC [3] + // If we delete TC [2] + // When I got siblings il will got 2, if I create new progressive using next, + // it will be 3 => I will get duplicated name. + // + // Seems better option can be: + // Get all siblings names, put on array, create name an check if exists, if true + // generate a new name. + // This may be at performance level is better than create name then check on db, + // because this approach will need more queries to DB + // + $tcase_name = $reqData['title'] . " [{$instance}]"; + if (! is_null($nameSet)) { + while (isset($nameSet[$tcase_name])) { + $instance ++; + $tcase_name = $reqData['title'] . " [{$instance}]"; + } + } + $nameSet[$tcase_name] = $tcase_name; + + $prefix = ($this->reqCfg->use_testcase_summary_prefix_with_title_and_version) ? sprintf( + $this->reqCfg->testcase_summary_prefix_with_title_and_version, + $reqID, $reqData['version_id'], $reqData['title'], + $reqData['version']) : $this->reqCfg->testcase_summary_prefix; + $content = ($this->reqCfg->copy_req_scope_to_tc_summary) ? $prefix . + $reqData['scope'] : $prefix; + + $tcase = $tcaseMgr->create($tsuite_id, $tcase_name, $content, + $empty_preconditions, $empty_steps, $user_id, null, + $testcase_order, testcase::AUTOMATIC_ID, + TESTCASE_EXECUTION_TYPE_MANUAL, $testcase_importance_default, + $createOptions); + + $tcase_name = $tcase['new_name'] == '' ? $tcase_name : $tcase['new_name']; + $output[] = sprintf($labels['tc_created'], $tcase_name); + + // create coverage dependency + $rrv = array( + 'id' => $reqData['id'], + 'version_id' => $reqData['version_id'] + ); + $ttcv = array( + 'id' => $tcase['id'], + 'version_id' => $tcase['tcversion_id'] + ); + + if (! $this->assignReqVerToTCVer($rrv, $ttcv, $user_id)) { + $output[] = 'Test case: ' . $tcase_name . " was not created"; + } + } + } + return $output; + } + + /* + * function: assign_to_tcase + * assign requirement(s) to test case + * Will use always latest ACTIVE Versions + * + * args: req_id: can be an array of requirement id + * testcase_id + * + * returns: 1/0 + */ + public function assign_to_tcase($req_id, $testcase_id, $author_id) + { + static $tcMgr; + + if (! $tcMgr) { + $tcMgr = new testcase($this->db); + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + + $output = 0; + $now = $this->db->db_now(); + if ($testcase_id && $req_id) { + // Get Latest Active Test Case Version + $tcv = current($tcMgr->get_last_active_version($testcase_id)); + if ($tcv == null) { + return $output; + } + } + + // Go ahead + if ($testcase_id && $req_id) { + // Need to get latest version for each requirement + $reqIDSet = (array) $req_id; + $gopt = array( + 'output' => 'id,version' + ); + + $reqLatestVersionIDSet = array(); + $reqLatestVersionNumberSet = array(); + foreach ($reqIDSet as $req) { + $isofix = $this->getLastVersionInfo($req, $gopt); + $reqLatestVersionIDSet[] = $isofix['id']; + $reqLatestVersionNumberSet[] = $isofix['version']; + } + + $ltcv = $tcv['tcversion_id']; + $ltcvNum = $tcv['version']; + $in_clause = implode(",", $reqLatestVersionIDSet); + + // + $sql = " /* $debugMsg */ " . + " SELECT req_id,testcase_id,req_version_id,tcversion_id " . + " FROM {$this->tables['req_coverage']} " . + " WHERE req_version_id IN ({$in_clause}) " . + " AND tcversion_id = {$ltcv}"; + + $coverage = $this->db->fetchRowsIntoMap($sql, 'req_version_id'); + + // Useful for audit + $tcInfo = $this->tree_mgr->get_node_hierarchy_info($testcase_id); + + $loop2do = count($reqLatestVersionIDSet); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if (is_null($coverage) || + ! isset($coverage[$reqLatestVersionIDSet[$idx]])) { + $sql = " INSERT INTO {$this->tables['req_coverage']} " . + " (req_id,testcase_id,req_version_id, tcversion_id," . + " author_id,creation_ts) " . + " VALUES ({$reqIDSet[$idx]},{$testcase_id}," . + " $reqLatestVersionIDSet[$idx],{$ltcv}," . + " {$author_id},{$now})"; + $this->db->exec_query($sql); + if ($this->db->affected_rows() == 1) { + $output = 1; + + // For audit + $reqInfo = $this->tree_mgr->get_node_hierarchy_info( + $reqIDSet[$idx]); + if ($tcInfo && $reqInfo) { + logAuditEvent( + TLS("audit_reqv_assigned_tcv", $reqInfo['name'], + $reqLatestVersionNumberSet[$idx], + $tcInfo['name'], $ltcvNum), "ASSIGN", + $this->object_table); + } + } + } else { + $output = 1; + } + } + } + return $output; + } + + /** + */ + public function assignToTCaseUsingLatestVersions($req_id, $testcase_id, + $author_id) + { + return $this->assign_to_tcase($req_id, $testcase_id, $author_id); + } + + /** + * + * @todo delete the unused function if necessary + */ + private function get_relationships($req_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = " /* $debugMsg */ SELECT nodes_hierarchy.id,nodes_hierarchy.name " . + " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy, " . + " {$this->tables['req_coverage']} req_coverage " . + " WHERE req_coverage.testcase_id = nodes_hierarchy.id " . + " AND req_coverage.req_id={$req_id}"; + + return $this->db->get_recordset($sql); + } + + /* + * function: get_all_for_tcase + * get all requirements assigned to a test case + * A filter can be applied to do search on all req spec, + * or only on one. + * + * args: testcase_id + * [srs_id]: default 'all' + * + * returns: + */ + public function get_all_for_tcase($testcase_id, $srs_id = 'all') + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = " /* $debugMsg */ SELECT REQ.id,REQ.req_doc_id,NHA.name AS title, " . + " NHB.name AS req_spec_title,REQ_COVERAGE.testcase_id " . + " FROM {$this->object_table} REQ, " . + " {$this->tables['req_coverage']} REQ_COVERAGE," . + " {$this->tables['nodes_hierarchy']} NHA," . + " {$this->tables['nodes_hierarchy']} NHB," . + " {$this->tables['req_specs']} RSPEC "; + + $idList = implode(",", (array) $testcase_id); + $sql .= " WHERE REQ_COVERAGE.testcase_id IN (" . $idList . ")"; + $sql .= " AND REQ.srs_id=RSPEC.id AND REQ_COVERAGE.req_id=REQ.id " . + " AND NHA.id=REQ.id AND NHB.id=RSPEC.id "; + + // if only for one specification is required + if ($srs_id != 'all') { + $sql .= " AND REQ.srs_id=" . $srs_id; + } + if (is_array($testcase_id)) { + return $this->db->fetchRowsIntoMap($sql, 'testcase_id', true); + } else { + return $this->db->get_recordset($sql); + } + } + + /** + * + * @todo delete the unused function if necessary + */ + private function check_title($title) + { + $ret = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + + if ($title == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_req_title"); + } + + return $ret; + } + + /* + * function: + * + * args : + * $nodes: array with req_id in order + * returns: + */ + public function set_order($map_id_order) + { + $this->tree_mgr->change_order_bulk($map_id_order); + } + + /** + * exportReqToXML + * + * @param int $id + * requirement id + * @param int $tproject_id: + * optional default null. + * useful to get custom fields + * (when this feature will be developed). + * + * @return string with XML code + * + */ + public function exportReqToXML($id, $tproject_id = null, + $inc_attachments = false) + { + $req = $this->get_by_id($id, requirement_mgr::LATEST_VERSION); + $reqData[] = $req[0]; + $req_version_id = $req[0]['version_id']; + + $elemTpl = "\t" . "" . "\n\t\t" . + "" . "\n\t\t" . + "<![CDATA[||TITLE||]]>" . "\n\t\t" . + "||VERSION||" . "\n\t\t" . + "||REVISION||" . "\n\t\t" . + "||NODE_ORDER||" . "\n\t\t" . + "" . "\n\t\t" . + "" . "\n\t\t" . + "" . "\n\t\t" . + "" . + "\n\t\t" . + $this->customFieldValuesAsXML($id, $req[0]['version_id'], + $tproject_id); + + // add req attachment content if checked in GUI + if ($inc_attachments) { + $attachments = null; + + // id -> req_id, but I need latest req_versionid + $attachSet = $this->attachmentRepository->getAttachmentInfosFor( + $req_version_id, $this->attachmentTableName, 'id'); + // get all attachments content and encode it in base64 + if ($attachSet) { + foreach ($attachSet as $attachmentInfo) { + $aID = $attachmentInfo["id"]; + $content = $this->attachmentRepository->getAttachmentContent( + $aID, $attachmentInfo); + + if ($content != null) { + $attachments[$aID]["id"] = $aID; + $attachments[$aID]["name"] = $attachmentInfo["file_name"]; + $attachments[$aID]["file_type"] = $attachmentInfo["file_type"]; + $attachments[$aID]["title"] = $attachmentInfo["title"]; + $attachments[$aID]["date_added"] = $attachmentInfo["date_added"]; + $attachments[$aID]["content"] = base64_encode($content); + } + } + + if (! empty($attachments)) { + $attchRootElem = "\n{{XMLCODE}}\t\t\n"; + $attchElemTemplate = "\t\t\t\n" . + "\t\t\t\t\n" . + "\t\t\t\t\n" . + "\t\t\t\t\n" . + "\t\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . + "\t\t\t\t\n" . + "\t\t\t\t\n" . + "\t\t\t\n"; + + $attchDecode = array( + "||ATTACHMENT_ID||" => "id", + "||ATTACHMENT_NAME||" => "name", + "||ATTACHMENT_FILE_TYPE||" => "file_type", + "||ATTACHMENT_TITLE||" => "title", + "||ATTACHMENT_DATE_ADDED||" => "date_added", + "||ATTACHMENT_CONTENT||" => "content" + ); + $elemTpl .= exportDataToXML($attachments, $attchRootElem, + $attchElemTemplate, $attchDecode, true); + } + } + } + $elemTpl .= "\n\t" . "" . "\n"; + + $info = array( + "||DOCID||" => "req_doc_id", + "||TITLE||" => "title", + "||DESCRIPTION||" => "scope", + "||STATUS||" => "status", + "||TYPE||" => "type", + "||NODE_ORDER||" => "node_order", + "||EXPECTED_COVERAGE||" => "expected_coverage", + "||VERSION||" => "version", + "||REVISION||" => "revision" + ); + + return exportDataToXML($reqData, "{{XMLCODE}}", $elemTpl, $info, true); + } + + /** + * xmlToMapRequirement + */ + public function xmlToMapRequirement($xml_item) + { + // Attention: following PHP Manual SimpleXML documentation, Please remember to cast + // before using data from $xml, + if (is_null($xml_item)) { + return null; + } + + $dummy = array(); + foreach ($xml_item->attributes() as $key => $value) { + $dummy[$key] = (string) $value; // See PHP Manual SimpleXML documentation. + } + + $dummy['node_order'] = (int) $xml_item->node_order; + $dummy['title'] = (string) $xml_item->title; + $dummy['docid'] = (string) $xml_item->docid; + $dummy['description'] = (string) $xml_item->description; + $dummy['status'] = (string) $xml_item->status; + $dummy['type'] = (string) $xml_item->type; + $dummy['expected_coverage'] = (int) $xml_item->expected_coverage; + + if (property_exists($xml_item, 'custom_fields')) { + $dummy['custom_fields'] = array(); + foreach ($xml_item->custom_fields->children() as $key) { + $dummy['custom_fields'][(string) $key->name] = (string) $key->value; + } + } + if (property_exists($xml_item, 'attachments')) { + $dummy['attachments'] = array(); + foreach ($xml_item->attachments->children() as $attachment) { + $attach_id = (int) $attachment->id; + $dummy['attachments'][$attach_id]['id'] = (int) $attachment->id; + $dummy['attachments'][$attach_id]['name'] = (string) $attachment->name; + $dummy['attachments'][$attach_id]['file_type'] = (string) $attachment->file_type; + $dummy['attachments'][$attach_id]['title'] = (string) $attachment->title; + $dummy['attachments'][$attach_id]['date_added'] = (string) $attachment->date_added; + $dummy['attachments'][$attach_id]['content'] = (string) $attachment->content; + } + } + return $dummy; + } + + /** + * createFromXML + * + * @internal revisions + */ + public function createFromXML($xml, $tproject_id, $parent_id, $author_id, + $filters = null, $options = null) + { + $reqAsMap = $this->xmlToMapRequirement($xml); + + // Map structure + // node_order => 0 + // title => Breaks + // docid => MAZDA3-0001 + // description => Heavy Rain Conditions + // status => [empty string] + // type => [empty string] + // expected_coverage => 0 + + return $this->createFromMap($reqAsMap, $tproject_id, $parent_id, + $author_id, $filters, $options); + } + + /** + * createFromMap + * + * Map structure + * node_order => 0 + * title => Breaks + * docid => MAZDA3-0001 + * description => Heavy Rain Conditions + * status => [empty string] + * type => [empty string] + * expected_coverage => 0 + * + * @internal revisions + */ + public function createFromMap($req, $tproject_id, $parent_id, $author_id, + $filters = null, $options = null) + { + static $missingCfMsg; + static $linkedCF; + static $messages; + static $labels; + static $fieldSize; + static $doProcessCF = false; + static $getByAttributeOpt; + static $getLastChildInfoOpt; + + if (is_null($linkedCF)) { + $fieldSize = config_get('field_size'); + + $linkedCF = $this->cfield_mgr->get_linked_cfields_at_design( + $tproject_id, cfield_mgr::CF_ENABLED, null, 'requirement', null, + 'name'); + $doProcessCF = true; + + $messages = array(); + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + + $labels = array( + 'import_req_created' => '', + 'import_req_skipped' => '', + 'import_req_updated' => '', + 'frozen_req_unable_to_import' => '', + 'requirement' => '', + 'import_req_new_version_created' => '', + 'import_req_update_last_version_failed' => '', + 'import_req_new_version_failed' => '', + 'import_req_skipped_plain' => '', + 'req_title_lenght_exceeded' => '', + 'req_docid_lenght_exceeded' => '' + ); + foreach ($labels as $key => $dummy) { + $labels[$key] = lang_get($key); + } + $getByAttributeOpt = array( + 'output' => 'id' + ); + $getLastChildInfoOpt = array( + 'child_type' => 'version', + 'output' => ' CHILD.is_open, CHILD.id ' + ); + } + + $cf2insert = null; + $status_ok = true; + $user_feedback = null; + $dummy = ''; + $result = null; + $newReq = null; + + $my['options'] = array( + 'hitCriteria' => 'docid', + 'actionOnHit' => "update", + 'skipFrozenReq' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // Check data than can create issue when writting to DB due to lenght + $req['title'] = trim($req['title']); + $req['docid'] = trim($req['docid']); + + $checkLengthOK = true; + $what2add = ''; + if (mb_strlen($req['title'], $tlCfg->charset) > $fieldSize->req_title) { + $checkLengthOK = false; + $what2add = $labels['req_title_lenght_exceeded'] . '/'; + } + + if (mb_strlen($req['docid'], $tlCfg->charset) > $fieldSize->req_docid) { + $checkLengthOK = false; + $what2add .= $labels['req_docid_lenght_exceeded']; + } + + if (! $checkLengthOK) { + $msgID = 'import_req_skipped_plain'; + $user_feedback[] = array( + 'doc_id' => $req['docid'], + 'title' => $req['title'], + 'import_status' => sprintf($labels[$msgID], $what2add) + ); + + return $user_feedback; + } + + // Check: + // If item with SAME DOCID exists inside container + // If there is a hit + // We will follow user option: update,create new version + // + // If do not exist check must be repeated, but on WHOLE test project + // If there is a hit -> we can not create + // else => create + $target = array( + 'key' => $my['options']['hitCriteria'], + 'value' => $req[$my['options']['hitCriteria']] + ); + + // IMPORTANT NOTICE + // When get is done by attribute that can not be unique (like seems to happen now 20110108 with + // title), we can get more than one hit and then on this context we can not continue + // with requested operation + $check_in_reqspec = $this->getByAttribute($target, $tproject_id, + $parent_id, $getByAttributeOpt); + + // while working on BUGID 4210, new details came to light. + // In addition to hit criteria there are also the criteria that we use + // when creating/update item using GUI, and these criteria have to be + // checked abd fullfilled. + // + if (is_null($check_in_reqspec)) { + $check_in_tproject = $this->getByAttribute($target, $tproject_id, + null, $getByAttributeOpt); + + if (is_null($check_in_tproject)) { + $importMode = 'creation'; + $newReq = $this->create($parent_id, $req['docid'], $req['title'], + $req['description'], $author_id, $req['status'], + $req['type'], $req['expected_coverage'], $req['node_order'], + $tproject_id, array( + 'quickAndDirty' => true + )); + // $reqID = $newReq['id']; + $fk_id = $newReq['version_id']; // for attachments + if ($status_ok = ($newReq['status_ok'] == 1)) { + $msgID = 'import_req_created'; + } else { + $msgID = 'import_req_skipped_plain'; + $result['msg'] = $newReq['msg']; // done to use what2add logic far below + } + } else { + // Can not have req with same req doc id + // on another branch => BLOCK + // What to do if is Frozen ??? -> now ignore and update anyway + $msgID = 'import_req_skipped'; + $status_ok = false; + } + } else { + // IMPORTANT NOTICE + // When you + // Need to get Last Version no matter active or not. + $reqID = key($check_in_reqspec); + $last_version = $this->get_last_child_info($reqID, + $getLastChildInfoOpt); + $msgID = 'frozen_req_unable_to_import'; + $status_ok = false; + + if ($last_version['is_open'] == 1 || + ! $my['options']['skipFrozenReq']) { + switch ($my['options']['actionOnHit']) { + case 'update_last_version': + $importMode = 'update'; + $result = $this->update($reqID, $last_version['id'], + $req['docid'], $req['title'], $req['description'], + $author_id, $req['status'], $req['type'], + $req['expected_coverage'], $req['node_order']); + $fk_id = $last_version['id']; // for attachment management + $status_ok = ($result['status_ok'] == 1); + if ($status_ok) { + $msgID = 'import_req_updated'; + } else { + $msgID = 'import_req_update_last_version_failed'; + } + break; + + case 'create_new_version': + $newItem = $this->create_new_version($reqID, $author_id, + array( + 'notify' => true + )); + + // Set always new version to NOT Frozen + $this->updateOpen($newItem['id'], 1); + + // hmm wrong implementation + // Need to update ALL fields on new version then why do not use + // update() ? + $newReq['version_id'] = $newItem['id']; + $fk_id = $newReq['version_id']; // for attachment management + + // IMPORTANT NOTICE: + // We have to DO NOT UPDATE REQDOCID with info received from USER + // Because ALL VERSION HAS TO HAVE docid, or we need to improve our checks + // and if update fails => we need to delete new created version. + $title = trimAndLimit($req['title'], + $fieldSize->req_title); + $importMode = 'update'; + $result = $this->update($reqID, $newItem['id'], + $req['docid'], $title, $req['description'], + $author_id, $req['status'], $req['type'], + $req['expected_coverage'], $req['node_order']); + + $status_ok = ($result['status_ok'] == 1); + if ($status_ok) { + $msgID = 'import_req_new_version_created'; + } else { + // failed -> removed just created version + $this->delete($reqID, $newItem['id']); + $msgID = 'import_req_new_version_failed'; + } + break; + } + } + } + $what2add = is_null($result) ? $req['docid'] : $req['docid'] . ':' . + $result['msg']; + + $user_feedback[] = array( + 'doc_id' => $req['docid'], + 'title' => $req['title'], + 'import_status' => sprintf($labels[$msgID], $what2add) + ); + + $hasAttachments = array_key_exists('attachments', $req); + // process attachements for creation and update + if ($status_ok && $hasAttachments) { + $addAttachResp = $this->processAttachments($importMode, $fk_id, + $req['attachments']); + } + + // display only problems during attachments import + if (isset($addAttachResp) && ! is_null($addAttachResp)) { + foreach ($addAttachResp as $att_name) { + $user_feedback[] = array( + 'doc_id' => $req['docid'], + 'title' => $req['title'], + 'import_status' => sprintf( + lang_get('import_req_attachment_skipped'), $att_name) + ); + } + } + + if ($status_ok && $doProcessCF && isset($req['custom_fields']) && + ! is_null($req['custom_fields'])) { + $req_version_id = ! is_null($newReq) ? $newReq['version_id'] : $last_version['id']; + $cf2insert = null; + + foreach ($req['custom_fields'] as $cfname => $cfvalue) { + $cfname = trim($cfname); + if (isset($linkedCF[$cfname])) { + $cf2insert[$linkedCF[$cfname]['id']] = array( + 'type_id' => $linkedCF[$cfname]['type'], + 'cf_value' => $cfvalue + ); + } else { + if (! isset($missingCfMsg[$cfname])) { + $missingCfMsg[$cfname] = sprintf($messages['cfield'], + $cfname, $labels['requirement']); + } + $user_feedback[] = array( + 'doc_id' => $req['docid'], + 'title' => $req['title'], + 'import_status' => $missingCfMsg[$cfname] + ); + } + } + if (! is_null($cf2insert)) { + $this->cfield_mgr->design_values_to_db($cf2insert, + $req_version_id, null, 'simple'); + } + } + + return $user_feedback; + } + + /** + * processAttachments + * + * Analyze attachments info related to requirement to define if the the attachment has to be added. + * attachments are ignored only if a attachment with the same ID is already linked to the target requirement. + * + * return an array of all attachments names of IDs already linked to target requirement (to display warning messages). + */ + private function processAttachments($importMode, $srs_id, $attachments) + { + $tables = tlObjectWithDB::getDBTables( + array( + 'req_versions', + 'attachments' + )); + + $knownAttachments = array(); + foreach ($attachments as $attachment) { + $addAttachment = true; + if ($importMode == 'update') { + // try to bypass the importation of already known attachments. + // Check in database if the attachment with the same ID is linked to the rspec with the same internal ID + // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. + // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). + $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . + " WHERE ATT.id='{$this->db->prepare_string($attachment[id])}' " . + " AND ATT.fk_id={$srs_id} "; + $rsx = $this->db->get_recordset($sql); + $addAttachment = (is_null($rsx) || count($rsx) < 1); + if ($addAttachment === false) { // inform user that the attachment has been skipped + $knownAttachments[] = $attachment['name']; + } + } + if ($addAttachment) { + $attachRepo = tlAttachmentRepository::create($this->db); + $fileInfo = $attachRepo->createAttachmentTempFile( + $attachment['content']); + $fileInfo['name'] = $attachment['name']; + $fileInfo['type'] = $attachment['file_type']; + $attachRepo->insertAttachment($srs_id, $tables['req_versions'], + $attachment['title'], $fileInfo); + } + } + return $knownAttachments; + } + + // ---------------------------------------------------------------------------- + // Custom field related functions + // ---------------------------------------------------------------------------- + + /* + * function: get_linked_cfields + * Get all linked custom fields. + * Remember that custom fields are defined at system wide level, and + * has to be linked to a testproject, in order to be used. + * + * + * args: id: requirement id + * $child_id: requirement version id or requirement revision id + * [parent_id]: this information is vital, + * to get the linked custom fields. + * null -> use requirement_id as starting point. + * !is_null -> use this value as testproject id + * + * returns: map/hash + * key: custom field id + * value: map with custom field definition and value assigned for choosen requirement, + * with following keys: + * + * id: custom field id + * name + * label + * type: custom field type + * possible_values: for custom field + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * value: value assigned to custom field for this requirement + * null if for this requirement custom field was never edited. + * + * node_id: requirement id + * null if for this requirement, custom field was never edited. + */ + public function get_linked_cfields($id, $child_id, $parent_id = null, + $opt = null) + { + $options = array( + 'access_key' => null + ); + $options = array_merge($options, (array) $opt); + + if (! is_null($parent_id)) { + $tproject_id = $parent_id; + } else { + $req_info = $this->get_by_id($id); + $tproject_id = $req_info[0]['testproject_id']; + unset($req_info); + } + + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + cfield_mgr::ENABLED, null, 'requirement', $child_id, + $options['access_key']); + } + + /* + * function: html_table_of_custom_field_inputs + * Return html code, implementing a table with custom fields labels + * and html inputs, for choosen requirement. + * Used to manage user actions on custom fields values. + * + * + * args: $id + * $version_id --- BUGID - NEEDS CHANGES + * [parent_id]: need to undertad to which testproject the requirement belongs. + * this information is vital, to get the linked custom fields. + * null -> use requirement_id as starting point. + * !is_null -> use this value as starting point. + * + * + * [$name_suffix]: must start with '_' (underscore). + * Used when we display in a page several items + * (example during test case execution, several test cases) + * that have the same custom fields. + * In this kind of situation we can use the item id as name suffix. + * + * returns: html string + */ + public function html_table_of_custom_field_inputs($id, $version_id, + $parent_id = null, $name_suffix = '', $input_values = null) + { + $cf_map = $this->get_linked_cfields($id, $version_id, $parent_id, + $name_suffix); + return $this->cfield_mgr->html_table_inputs($cf_map, $name_suffix, + $input_values); + } + + /* + * function: html_table_of_custom_field_values + * Return html code, implementing a table with custom fields labels + * and custom fields values, for choosen requirement. + * You can think of this function as some sort of read only version + * of html_table_of_custom_field_inputs. + * + * + * args: $id + * $child_id: req version or req revision ID + * + * returns: html string + */ + public function html_table_of_custom_field_values($id, $child_id, + $tproject_id = null) + { + $NO_WARNING_IF_MISSING = true; + $cf_smarty = ''; + + $root_id = is_null($id) ? $tproject_id : null; + $cf_map = $this->get_linked_cfields($id, $child_id, $root_id); + + $show_cf = config_get('custom_fields')->show_custom_fields_without_value; + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + // if user has assigned a value, then node_id is not null + if ($cf_info['node_id'] || $show_cf) { + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, $NO_WARNING_IF_MISSING)); + + $cf_smarty .= '' . + htmlspecialchars($label) . ":" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $child_id) . "\n"; + } + } + + if (trim($cf_smarty) != "") { + $cf_smarty = "" . $cf_smarty . "
    "; + } + } + return $cf_smarty; + } + + /* + * function: values_to_db + * write values of custom fields. + * + * args: $hash: + * key: custom_field__. + * Example custom_field_0_67 -> 0=> string field + * + * $node_id: + * + * [$cf_map]: hash -> all the custom fields linked and enabled + * that are applicable to the node type of $node_id. + * + * For the keys not present in $hash, we will write + * an appropriate value according to custom field + * type. + * + * This is needed because when trying to udpate + * with hash being $_REQUEST, $_POST or $_GET + * some kind of custom fields (checkbox, list, multiple list) + * when has been deselected by user. + * + * + * rev: + */ + public function values_to_db($hash, $node_id, $cf_map = null, + $hash_type = null) + { + $this->cfield_mgr->design_values_to_db($hash, $node_id, $cf_map, + $hash_type); + } + + /** + * customFieldValuesAsXML + * + * @param int $id: + * requirement spec id + * @param int $version_id + * @param int $tproject_id: + * test project id + * @return array + * + */ + private function customFieldValuesAsXML($id, $version_id, $tproject_id) + { + $xml = null; + $cfMap = $this->get_linked_cfields($id, $version_id, $tproject_id); + if (! empty($cfMap)) { + $xml = $this->cfield_mgr->exportValueAsXML($cfMap); + } + return $xml; + } + + /* + * function: getByDocID + * get req information using document ID as access key. + * + * args : doc_id: + * [tproject_id] + * [parent_id] -> req spec parent of requirement searched + * default 0 -> case sensivite search + * + * returns: map. + * key: req spec id + * value: req info, map with following keys: + * id + * doc_id + * testproject_id + * title + * scope + */ + public function getByDocID($doc_id, $tproject_id = null, $parent_id = null, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'check_criteria' => '=', + 'access_key' => 'id', + 'case' => 'sensitive', + 'output' => 'standard' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $the_doc_id = $this->db->prepare_string(trim($doc_id)); + switch ($my['options']['check_criteria']) { + case 'like': + $check_criteria = " LIKE '{$the_doc_id}%' "; + break; + + case '=': + default: + $check_criteria = " = '{$the_doc_id}' "; + break; + } + + $sql = " /* $debugMsg */ SELECT "; + switch ($my['options']['output']) { + case 'standard': + $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; + break; + + case 'minimun': + $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id"; + break; + } + + $sql .= " FROM {$this->object_table} REQ " . + " /* Get Req info from NH */ " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + " WHERE REQ.req_doc_id {$check_criteria} "; + + if (! is_null($tproject_id)) { + $sql .= " AND REQ_SPEC.testproject_id={$tproject_id}"; + } + + if (! is_null($parent_id)) { + $sql .= " AND REQ.srs_id={$parent_id}"; + } + + return $this->db->fetchRowsIntoMap($sql, $my['options']['access_key']); + } + + /** + * Copy a requirement to a new requirement specification + * requirement DOC ID will be changed because must be unique inside + * MASTER CONTAINER (test project) + * + * @param integer $id: + * requirement ID + * @param integer $parent_id: + * target req spec id (where we want to copy) + * @param integer $user_id: + * who is requesting copy + * @param integer $tproject_id: + * FOR SOURCE ($id), optional, + * is null will be computed here + * @param array $options: + * map + * + */ + public function copy_to($id, $parent_id, $user_id, $tproject_id = null, + $options = null) + { + $new_item = array( + 'id' => - 1, + 'status_ok' => 0, + 'msg' => 'ok', + 'mappings' => null + ); + $my['options'] = array( + 'copy_also' => null, + 'caller' => '' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + if (is_null($my['options']['copy_also'])) { + $my['options']['copy_also'] = array( + 'testcase_assignment' => true + ); + } + + $copyReqVTCVLinks = isset( + $my['options']['copy_also']['testcase_assignment']) && + $my['options']['copy_also']['testcase_assignment']; + + $root = $tproject_id; + if (is_null($root)) { + $reqSpecMgr = new requirement_spec_mgr($this->db); + $target = $reqSpecMgr->get_by_id($parent_id); + $root = $target['testproject_id']; + } + + // NEED INLINE REFACTORING + $item_versions = $this->get_by_id($id); + if ($item_versions) { + if ($my['options']['caller'] == 'copy_testproject') { + $target_doc = $item_versions[0]['req_doc_id']; + $title = $item_versions[0]['title']; + } else { + // REQ DOCID is test project wide => can not exist duplicates inside + // a test project => we need to generate a new one using target as + // starting point + $target_doc = $this->generateDocID($id, $root); + + // If a sibling exists with same title => need to generate automatically + // a new one. + $title = $this->generateUniqueTitle($item_versions[0]['title'], + $parent_id, $root); + } + + $new_item = $this->create_req_only($parent_id, $target_doc, $title, + $item_versions[0]['node_order']); + + if ($new_item['status_ok']) { + $ret['status_ok'] = 1; + $new_item['mappings']['req'][$id] = $new_item['id']; + + foreach ($item_versions as &$req_version) { + $op = $this->create_version($new_item['id'], + $req_version['version'], $req_version['scope'], + $req_version['author_id'], $req_version['status'], + $req_version['type'], $req_version['expected_coverage']); + + // need to explain how this mappings are used outside this method + // first thing that can see here, we are mixing req id and + // req version id on same hash. + $new_item['mappings']['req_version'][$req_version['version_id']] = $op['id']; + $new_item['mappings']['req_tree'][$id][$req_version['version_id']] = $op['id']; + + // here we have made a mistake, that help to show that + // we have some memory issue + // with copy_cfields(). + // ALWAYS when we have tproject_id we have to use it!!! + $this->copy_cfields( + array( + 'id' => $req_version['id'], + 'version_id' => $req_version['version_id'] + ), + array( + 'id' => $new_item['id'], + 'version_id' => $op['id'] + ), $tproject_id); + + $source = $req_version['version_id']; + $dest = $op['id']; + $this->attachmentRepository->copyAttachments($source, $dest, + $this->attachmentTableName); + + // Seems that when we call this function during Test Project Copy + // we DO NOT USE this piece + + if ($copyReqVTCVLinks) { + $lnk = $this->getGoodForReqVersion( + $req_version['version_id']); + if (! is_null($lnk)) { + $reqAndVer = array( + 'id' => $new_item['id'], + 'version_id' => $op['id'] + ); + foreach ($lnk as $links) { + foreach ($links as $value) { + $tcAndVer = array( + 'id' => $value['testcase_id'], + 'version_id' => $value['tcversion_id'] + ); + $this->assignReqVerToTCVer($reqAndVer, + $tcAndVer, $user_id); + } + } + } + } + + unset($op); + } + } + } + + unset($item_versions); // does this help to release memory ? + + return $new_item; + } + + /** + * Copy attachments from source to target + */ + private function copyAttachments($source_id, $target_id) + { + $this->attachmentRepository->copyAttachments($source_id, $target_id, + $this->attachmentTableName); + } + + /* + * function: copy_cfields + * Get all cfields linked to any testcase of this testproject + * with the values presents for $from_id, testcase we are using as + * source for our copy. + * + * args: from_id: source item id + * to_id: target item id + * + * returns: - + */ + private function copy_cfields($source, $destination, $tproject_id = null) + { + $cfmap_from = $this->get_linked_cfields($source['id'], + $source['version_id'], $tproject_id); + $cfield = null; + if (! is_null($cfmap_from)) { + foreach ($cfmap_from as $key => $value) { + $cfield[$key] = array( + "type_id" => $value['type'], + "cf_value" => $value['value'] + ); + } + $this->cfield_mgr->design_values_to_db($cfield, + $destination['version_id'], null, 'reqversion_copy_cfields'); + } + } + + /** + */ + private function generateDocID($id, $tproject_id) + { + $item_info = $this->get_by_id($id); + $item_info = $item_info[0]; + + // Check if another req with same DOC ID exists on test project (MASTER CONTAINER), + // If yes generate a new DOC ID + $getOptions = array( + 'check_criteria' => 'like', + 'access_key' => 'req_doc_id' + ); + $itemSet = $this->getByDocID($item_info['req_doc_id'], $tproject_id, + null, $getOptions); + + $target_doc = $item_info['req_doc_id']; + $instance = 1; + if (! is_null($itemSet)) { + $safety_len = 2; // use t + $mask = $this->reqCfg->duplicated_docid_algorithm->text; + + // req_doc_id has limited size then we need to be sure that generated id will + // not exceed DB size + $nameSet = array_flip(array_keys($itemSet)); + $prefix = trimAndLimit($item_info['req_doc_id'], + $this->fieldSize->req_docid - strlen($mask) - $safety_len); + + $target_doc = $prefix . sprintf($mask, $instance); + while (isset($nameSet[$target_doc])) { + $instance ++; + $target_doc = $prefix . sprintf($mask, $instance); + } + } + return $target_doc; + } + + /** + */ + private function create_req_only($srs_id, $reqdoc_id, $title, + $node_order = 0) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $req_id = $this->tree_mgr->new_node($srs_id, + $this->node_types_descr_id['requirement'], $title, $node_order); + $sql = "/* $debugMsg */ INSERT INTO {$this->object_table} " . + " (id, srs_id, req_doc_id)" . " VALUES ({$req_id}, {$srs_id},'" . + $this->db->prepare_string($reqdoc_id) . "')"; + + if (! $this->db->exec_query($sql)) { + $result = array( + 'id' => - 1, + 'status_ok' => 0 + ); + $result['msg'] = lang_get('error_inserting_req'); + } else { + $result = array( + 'id' => $req_id, + 'status_ok' => 1, + 'msg' => 'ok' + ); + } + + unset($sql); + unset($req_id); + + return $result; + } + + /* + * function: create_version + * + * args: + * + * returns: + */ + private function create_version($id, $version, $scope, $user_id, + $status = TL_REQ_STATUS_VALID, $type = TL_REQ_TYPE_INFO, + $expected_coverage = 1) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $item_id = $this->tree_mgr->new_node($id, + $this->node_types_descr_id['requirement_version']); + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_versions']} " . + " (id,version,scope,status,type,expected_coverage,author_id,creation_ts) " . + " VALUES({$item_id},{$version},'" . + trim($this->db->prepare_string($scope)) . "','" . + $this->db->prepare_string($status) . "','" . + $this->db->prepare_string($type) . "'," . "{$expected_coverage}," . + intval($user_id) . "," . $this->db->db_now() . ")"; + + $result = $this->db->exec_query($sql); + $ret = array( + 'msg' => 'ok', + 'id' => $item_id, + 'status_ok' => 1 + ); + if (! $result) { + $ret['msg'] = $this->db->error_msg(); + $ret['status_ok'] = 0; + $ret['id'] = - 1; + } + unset($sql); + unset($result); + unset($item_id); + return $ret; + } + + /* + * function: create_new_version() + * create a new version, doing BY DEFAULT a copy of last version. + * If reqVersionID is passed, then this version will be used as source data. + * + * args : $id: requirement id + * $user_id: who is doing this operation. + * $reqVersionID = default null => use last version as source + * + * returns: + * map: id: node id of created tcversion + * version: version number (i.e. 5) + * msg + * + */ + public function create_new_version($id, $user_id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['opt'] = array( + 'reqVersionID' => null, + 'log_msg' => null, + 'notify' => false, + 'freezeSourceVersion' => true + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $reqVersionID = $my['opt']['reqVersionID']; + $log_msg = $my['opt']['log_msg']; + $notify = $my['opt']['notify']; + + // get a new id + $version_id = $this->tree_mgr->new_node($id, + $this->node_types_descr_id['requirement_version']); + + // Needed to get higher version NUMBER, to generata new VERSION NUMBER + $sourceVersionInfo = $this->get_last_child_info($id, + array( + 'child_type' => 'version' + )); + if (is_null($sourceVersionInfo)) { + throw new Exception( + $debugMsg . + ' $this->get_last_child_info() RETURNED NULL !!! - WRONG - Open Issue on mantis.testlink.org'); + } + + // Till now everything is OK + if ($notify) { + // be optimistic send email before doing nothing + $this->notifyMonitors($id, __FUNCTION__, $user_id, $log_msg); + } + + $newVersionNumber = $sourceVersionInfo['version'] + 1; + + $ret = array(); + $ret['id'] = $version_id; + $ret['version'] = $newVersionNumber; + $ret['msg'] = 'ok'; + + $sourceVersionID = is_null($reqVersionID) ? $sourceVersionInfo['id'] : $reqVersionID; + + // Update Link Status To Test Case Versions for Source Version + // is done on copy_version() + $this->copy_version($id, $sourceVersionID, $version_id, + $newVersionNumber, $user_id); + + // need to update log message in new created version + $sql = "/* $debugMsg */ " . " UPDATE {$this->tables['req_versions']} " . + " SET log_message = '" . trim($this->db->prepare_string($log_msg)) . + "'" . " WHERE id={$version_id}"; + $this->db->exec_query($sql); + + if ($my['opt']['freezeSourceVersion']) { + $this->updateOpen($sourceVersionInfo['id'], 0); + } + + return $ret; + } + + /** + */ + public function getLastVersionInfo($id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $info = null; + $sql = " /* $debugMsg */ SELECT MAX(version) AS version " . + " FROM {$this->tables['req_versions']} REQV," . + " {$this->tables['nodes_hierarchy']} NH WHERE " . " NH.id = REQV.id " . + " AND NH.parent_id = {$id} "; + + $max_version = $this->db->fetchFirstRowSingleColumn($sql, 'version'); + if ($max_version) { + $my['opt'] = array( + 'output' => 'default' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + switch ($my['opt']['output']) { + case 'id': + $fields = ' REQV.id '; + break; + + case 'id,version': + $fields = ' REQV.id, REQV.version '; + break; + + default: + $fields = ' REQV.*'; + break; + } + $sql = "/* $debugMsg */ SELECT {$fields} " . + " FROM {$this->tables['req_versions']} REQV," . + " {$this->tables['nodes_hierarchy']} NH " . + " WHERE version = {$max_version} AND NH.id = REQV.id AND NH.parent_id = {$id}"; + + $info = $this->db->fetchFirstRow($sql); + } + return $info; + } + + /** + * get last defined req doc id for specific test project + * + * @author Julian Krien + * + * @param int $tproj_id + * test project id + * + * @return string last defned req doc id + */ + public function get_last_doc_id_for_testproject($tproj_id) + { + $info = null; + $tproject_mgr = new testproject($this->db); + $all_reqs = $tproject_mgr->get_all_requirement_ids($tproj_id); + + if (! empty($all_reqs)) { + // only use maximum value of all reqs array + $last_req = max($all_reqs); + $last_req = $this->get_by_id($last_req); + $info = $last_req[0]['req_doc_id']; + } + return $info; + } + + /** + */ + private function copy_version($id, $from_version_id, $to_version_id, + $as_version_number, $user_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $now = $this->db->db_now(); + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_versions']} " . + " (id,version,author_id,creation_ts,scope,status,type,expected_coverage) " . + " SELECT {$to_version_id} AS id, {$as_version_number} AS version, " . + " {$user_id} AS author_id, {$now} AS creation_ts," . + " scope,status,type,expected_coverage " . + " FROM {$this->tables['req_versions']} " . " WHERE id=" . + intval($from_version_id); + $this->db->exec_query($sql); + + $this->copy_cfields( + array( + 'id' => $id, + 'version_id' => $from_version_id + ), array( + 'id' => $id, + 'version_id' => $to_version_id + )); + + $this->copyAttachments($from_version_id, $to_version_id); + + $reqTCLinksCfg = config_get('reqTCLinks'); + $freezeLinkOnNewReqVersion = $reqTCLinksCfg->freezeLinkOnNewReqVersion; $freezeLinkedTCases = $freezeLinkOnNewReqVersion & - $reqTCLinksCfg->freezeBothEndsOnNewREQVersion; - - if( $freezeLinkedTCases ) { - $this->closeOpenTCVersionOnOpenLinks( $from_version_id ); - } - - $signature = array('user_id' => $user_id, 'when' => $now); - - if( $freezeLinkOnNewReqVersion ) { - $this->updateTCVLinkStatus($from_version_id,LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION); - } - - } - - /** - * - */ - function closeOpenTCVersionOnOpenLinks( $reqVersionID ) { - - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; - - $commonWhere = " WHERE req_version_id = " . intval($reqVersionID) . - " AND link_status = " . LINK_TC_REQ_OPEN; - - $sql = " $debugMsg UPDATE {$this->tables['tcversions']} - SET is_open = 0 - WHERE id IN ( - SELECT tcversion_id - FROM {$this->tables['req_coverage']} - $commonWhere - ) AND is_open = 1"; - - $this->db->exec_query($sql); - } - - /** - * - * - */ - function updateOpen($reqVersionID,$value) { - $this->updateBoolean($reqVersionID,'is_open',$value); - } - - - /** - * - * - */ - function updateActive($reqVersionID,$value) { - $this->updateBoolean($reqVersionID,'active',$value); - } - - /** - * - * - */ - private function updateBoolean($reqVersionID,$field,$value) - { - $booleanValue = $value; - if( is_bool($booleanValue) ) { - $booleanValue = $booleanValue ? 1 : 0; - } else if( !is_numeric($booleanValue) || is_null($booleanValue)) { - $booleanValue = 1; - } - $booleanValue = $booleanValue > 0 ? 1 : 0; - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . - " SET {$field}={$booleanValue} WHERE id={$reqVersionID}"; - - $result = $this->db->exec_query($sql); - - } - - - /** - * get relations for a given requirement ID - * - * @author Andreas Simon - * - * @param int $id Requirement ID - * - * @return array $relations in which this req is either source or destination - */ - public function get_relations($id) - { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $relations = array(); - $relations['num_relations'] = 0; - $relations['req'] = current($this->get_by_id($id)); - $relations['relations'] = array(); - - $tproject_mgr = new testproject($this->db); - - $sql = " $debugMsg SELECT id, source_id, destination_id, relation_type, author_id, creation_ts " . - " FROM {$this->tables['req_relations']} " . - " WHERE source_id=$id OR destination_id=$id " . - " ORDER BY id ASC "; - - $relations['relations']= $this->db->get_recordset($sql); - if( !is_null($relations['relations']) && count($relations['relations']) > 0 ) - { - $labels = $this->get_all_relation_labels(); - $label_keys = array_keys($labels); - foreach($relations['relations'] as $key => $rel) - { - - // is this relation type is configured? - if( ($relTypeAllowed = in_array($rel['relation_type'],$label_keys)) ) - { - $relations['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; - $relations['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; - - if ($id == $rel['source_id']) - { - $type_localized = 'source_localized'; - $other_key = 'destination_id'; - } - else - { - $type_localized = 'destination_localized'; - $other_key = 'source_id'; - } - $relations['relations'][$key]['type_localized'] = $relations['relations'][$key][$type_localized]; - $other_req = $this->get_by_id($rel[$other_key]); - - // only add it, if either interproject linking is on or if it is in the same project - $relTypeAllowed = false; - if ($this->relationsCfg->interProjectLinking || ($other_req[0]['testproject_id'] == $relations['req']['testproject_id'])) - { - $relTypeAllowed = true; - $relations['relations'][$key]['related_req'] = $other_req[0]; - $other_tproject = $tproject_mgr->get_by_id($other_req[0]['testproject_id']); - $relations['relations'][$key]['related_req']['testproject_name'] = $other_tproject['name']; - - $user = tlUser::getByID($this->db,$rel['author_id']); - $relations['relations'][$key]['author'] = $user->getDisplayName(); - } - } - - if( !$relTypeAllowed ) - { - unset($relations['relations'][$key]); - } - - } // end foreach - - $relations['num_relations'] = count($relations['relations']); - } - return $relations; - } - - - /** - * checks if there is a relation of a given type between two requirements - * - * @author Andreas Simon - * - * @param integer $first_id requirement ID to check - * @param integer $second_id another requirement ID to check - * @param integer $rel_type_id relation type ID to check - * - * @return true, if relation already exists, false if not - */ - public function check_if_relation_exists($first_id, $second_id, $rel_type_id) { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $sql = " $debugMsg SELECT COUNT(0) AS qty " . - " FROM {$this->tables['req_relations']} " . - " WHERE ((source_id=$first_id AND destination_id=$second_id) " . - " OR (source_id=$second_id AND destination_id=$first_id)) " . - " AND relation_type=$rel_type_id"; - $rs = $this->db->get_recordset($sql); - return($rs[0]['qty'] > 0); - } - - - /** - * Get count of all relations for a requirement, no matter if it is source or destination - * or what type of relation it is. - * - * @author Andreas Simon - * - * @param integer $id requirement ID to check - * - * @return integer $count - */ - public function count_relations($id) - { - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $safeID = intval($id); - $sql = " $debugMsg SELECT COUNT(*) AS qty " . - " FROM {$this->tables['req_relations']} " . - " WHERE source_id={$safeID} OR destination_id={$safeID} "; - $rs = $this->db->get_recordset($sql); - return($rs[0]['qty']); - } - - - /** - * add a relation of a given type between two requirements - * - * @author Andreas Simon - * - * @param integer $source_id ID of source requirement - * @param integer $destination_id ID of destination requirement - * @param integer $type_id relation type ID to set - * @param integer $author_id user's ID - */ - public function add_relation($source_id, $destination_id, $type_id, $author_id) { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $time = $this->db->db_now(); - $sql = " $debugMsg INSERT INTO {$this->tables['req_relations']} " . - " (source_id, destination_id, relation_type, author_id, creation_ts) " . - " values ($source_id, $destination_id, $type_id, $author_id, $time)"; - $this->db->exec_query($sql); - } - - - /** - * delete an existing relation with between two requirements - * - * @author Andreas Simon - * - * @param int $id requirement relation id - */ - public function delete_relation($id) { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $sql = " $debugMsg DELETE FROM {$this->tables['req_relations']} WHERE id=$id "; - $this->db->exec_query($sql); - } - - - /** - * delete all existing relations for (from or to) a given req id, no matter which project - * they belong to or which other requirement they are related to - * - * @author Andreas Simon - * - * @param int $id requirement ID (can be array of IDs) - */ - public function delete_all_relations($id) { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $id_list = implode(",", (array)$id); - $sql = " $debugMsg DELETE FROM {$this->tables['req_relations']} " . - " WHERE source_id IN ($id_list) OR destination_id IN ($id_list) "; - $this->db->exec_query($sql); - } - - - /** - * initialize the requirement relation labels - * - * @author Andreas Simon - * - * @return array $labels a map with all labels in following form: - * Array - * ( - * [1] => Array - * ( - * [source] => parent of - * [destination] => child of - * ) - * [2] => Array - * ( - * [source] => blocks - * [destination] => depends on - * ) - * [3] => Array - * ( - * [source] => related to - * [destination] => related to - * ) - * ) - */ - public static function get_all_relation_labels() - { - - $labels = config_get('req_cfg')->rel_type_labels; - - foreach ($labels as $key => $label) { - $labels[$key] = init_labels($label); - } - - return $labels; - } - - - /** - * Initializes the select field for the localized requirement relation types. - * - * @author Andreas Simon - * - * @return array $htmlSelect info needed to create select box on multiple templates - */ - function init_relation_type_select() - { - - $htmlSelect = array('items' => array(), 'selected' => null, 'equal_relations' => array()); - $labels = $this->get_all_relation_labels(); - - foreach ($labels as $key => $lab) - { - $htmlSelect['items'][$key . "_source"] = $lab['source']; - if ($lab['source'] != $lab['destination']) - { - // relation is not equal as labels for source and dest are different - $htmlSelect['items'][$key . "_destination"] = $lab['destination']; - } - else - { - // mark this as equal relation - no parent/child, makes searching simpler - $htmlSelect['equal_relations'][] = $key . "_source"; - } - } - - // set "related to" as default preselected value in forms - if (defined('TL_REQ_REL_TYPE_RELATED') && isset($htmlSelect[TL_REQ_REL_TYPE_RELATED . "_source"])) - { - $selected_key = TL_REQ_REL_TYPE_RELATED . "_source"; - } - else - { - // "related to" is not configured, so take last element as selected one - $keys = array_keys($htmlSelect['items']); - $selected_key = end($keys); - } - $htmlSelect['selected'] = $selected_key; - - return $htmlSelect; - } - - - - /** - * getByAttribute - * allows search (on this version) by one of following attributes - * - title - * - docid - * - */ - function getByAttribute($attr,$tproject_id=null,$parent_id=null, $options = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array( 'check_criteria' => '=', 'access_key' => 'id', - 'case' => 'sensitive', 'output' => 'standard'); - $my['options'] = array_merge($my['options'], (array)$options); - - $output=null; - $target = $this->db->prepare_string(trim($attr['value'])); - - $where_clause = $attr['key'] == 'title' ? " NH_REQ.name " : " REQ.req_doc_id "; - - switch($my['options']['check_criteria']) - { - case '=': - default: - $check_criteria = " = '{$target}' "; - break; - - case 'like': - case 'likeLeft': - $check_criteria = " LIKE '{$target}%' "; - break; - } - - $sql = " /* $debugMsg */ SELECT "; - switch($my['options']['output']) - { - case 'standard': - $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; - break; - - case 'minimun': - $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id"; - break; - - case 'id': - $sql .= " REQ.id"; - break; - - - } - $sql .= " FROM {$this->object_table} REQ " . - " /* Get Req info from NH */ " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - " WHERE {$where_clause} {$check_criteria} "; - - if( !is_null($tproject_id) ) - { - $sql .= " AND REQ_SPEC.testproject_id={$tproject_id}"; - } - - if( !is_null($parent_id) ) - { - $sql .= " AND REQ.srs_id={$parent_id}"; - } - - $output = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - return $output; - } - - /** - * @param id: parent id: can be REQ ID or REQ VERSION ID depending of $child_type - * @param child_type: 'req_versions', 'req_revisions' - * - * @return - */ - function get_last_child_info($id, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('child_type' => 'revision', 'output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - - $info = null; - $target_cfg = array('version' => array('table' => 'req_versions', 'field' => 'version'), - 'revision' => array('table'=> 'req_revisions', 'field' => 'revision')); - - $child_type = $my['options']['child_type']; // just for readability - $table = $target_cfg[$child_type]['table']; - $field = $target_cfg[$child_type]['field']; - - $sql = " /* $debugMsg */ SELECT COALESCE(MAX($field),-1) AS $field " . - " FROM {$this->tables[$table]} CHILD," . - " {$this->tables['nodes_hierarchy']} NH WHERE ". - " NH.id = CHILD.id ". - " AND NH.parent_id = {$id} "; - - $max_verbose = $this->db->fetchFirstRowSingleColumn($sql,$field); - - if ($max_verbose >= 0) - { - $sql = "/* $debugMsg */ SELECT "; - - switch($my['options']['output']) - { - case 'credentials': - $sql .= " CHILD.parent_id,CHILD.id,CHILD.revision,CHILD.doc_id "; - break; - - case 'full': - $sql .= " CHILD.* "; - break; - - default: - $sql .= $my['options']['output']; - break; - } - - $sql .= " FROM {$this->tables[$table]} CHILD," . - " {$this->tables['nodes_hierarchy']} NH ". - " WHERE $field = {$max_verbose} AND NH.id = CHILD.id AND NH.parent_id = {$id}"; - - $info = $this->db->fetchFirstRow($sql); - } - return $info; - } - - - - /** - * - * - * @internal revision - * 20110115 - franciscom - fixed insert of null on timestamp field - */ - function create_new_revision($parent_id,$user_id,$tproject_id,$req = null,$log_msg = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $item_id = $this->tree_mgr->new_node($parent_id,$this->node_types_descr_id['requirement_revision']); - - // Needed to get higher revision NUMBER, to generata new NUMBER - $source_info = $this->get_last_child_info($parent_id,array('child_type' => 'revision')); - $current_rev = 0; - if( !is_null($source_info) ) - { - $current_rev = $source_info['revision']; - } - $current_rev++; - - // Info regarding new record created on req_revisions table - $ret = array(); - $ret['id'] = $item_id; - $ret['revision'] = $current_rev; - $ret['msg'] = 'ok'; - - $this->copy_version_as_revision($parent_id,$item_id,$current_rev,$user_id,$tproject_id); - $sql = "/* $debugMsg */ " . - " UPDATE {$this->tables['req_revisions']} " . - " SET name ='" . $this->db->prepare_string($req['title']) . "'," . - " req_doc_id ='" . $this->db->prepare_string($req['req_doc_id']) . "'" . - " WHERE id = {$item_id} "; - $this->db->exec_query($sql); - - $new_rev = $current_rev+1; - $db_now = $this->db->db_now(); - $sql = " /* $debugMsg */ " . - " UPDATE {$this->tables['req_versions']} " . - " SET revision = {$new_rev}, log_message=' " . $this->db->prepare_string($log_msg) . "'," . - " creation_ts = {$db_now} ,author_id = {$user_id}, modifier_id = NULL"; - - $nullTS = $this->db->db_null_timestamp(); - if (!is_null($nullTS)) { - $sql .= ",modification_ts = {$nullTS} "; - } - - $sql .= " WHERE id = {$parent_id} "; - $this->db->exec_query($sql); - return $ret; - } - - - /** - * - * - */ - function copy_version_as_revision($parent_id,$item_id,$revision,$user_id,$tproject_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = '/* $debugMsg */' . - " INSERT INTO {$this->tables['req_revisions']} " . - " (parent_id,id,revision,scope,status,type,active,is_open, " . - " expected_coverage,author_id,creation_ts,modifier_id,modification_ts,log_message) " . - " SELECT REQV.id, {$item_id}, {$revision}, " . - " REQV.scope,REQV.status,REQV.type,REQV.active,REQV.is_open, " . - " REQV.expected_coverage,REQV.author_id,REQV.creation_ts,REQV.modifier_id," . - " REQV.modification_ts,REQV.log_message" . - " FROM {$this->tables['req_versions']} REQV " . - " WHERE REQV.id = {$parent_id} "; - $this->db->exec_query($sql); - - // need to copy Custom Fields ALSO - // BAD NAME -> version_id is REALLY NODE ID - $source = array('id' => 0, 'version_id' => $parent_id); - $dest = array('id' => 0, 'version_id' => $item_id); - $this->copy_cfields($source,$dest,$tproject_id); - - } - - - /** - * used to create overwiew of changes between revisions - * 20110116 - franciscom - BUGID 4172 - MSSQL UNION text field issue - */ - function get_history($id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => "map", 'decode_user' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - // - // Why can I use these common fields ? - // explain better - $common_fields = " REQV.id AS version_id, REQV.version,REQV.creation_ts, REQV.author_id, " . - " REQV.modification_ts, REQV.modifier_id "; - - // needs a double coalesce not too elegant but... - - // Two steps algorithm - // First understand is we already have a revision - $sql = " /* $debugMsg */" . - " SELECT COUNT(0) AS qta_rev " . - " FROM {$this->tables['req_revisions']} REQRV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQRV.parent_id " . - " WHERE NH_REQV.parent_id = {$id} "; - - $rs = $this->db->get_recordset($sql); - - $sql = "/* $debugMsg */" . - " SELECT REQV.id AS version_id, REQV.version," . - " REQV.creation_ts, REQV.author_id, " . - " REQV.modification_ts, REQV.modifier_id, " . - self::NO_REVISION . " AS revision_id, " . - " REQV.revision, REQV.scope, " . - " REQV.status,REQV.type,REQV.expected_coverage,NH_REQ.name, REQ.req_doc_id, " . - " COALESCE(REQV.log_message,'') AS log_message" . - " FROM {$this->tables['req_versions']} REQV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " WHERE NH_REQV.parent_id = {$id} "; - - if( $rs[0]['qta_rev'] > 0 ) - { - // - // Important NOTICE - MSSQL - // - // text fields can be used on union ONLY IF YOU USE UNION ALL - // - // UNION ALL returns ALSO duplicated rows. - // In this situation this is NOT A PROBLEM (because we will not have dups) - // - $sql .= " UNION ALL ( " . - " SELECT REQV.id AS version_id, REQV.version, " . - " REQRV.creation_ts, REQRV.author_id, " . - " REQRV.modification_ts, REQRV.modifier_id, " . - " REQRV.id AS revision_id, " . - " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . - " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . - " COALESCE(REQRV.log_message,'') as log_message" . - " FROM {$this->tables['req_versions']} REQV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " JOIN {$this->tables['req_revisions']} REQRV " . - " ON REQRV.parent_id = REQV.id " . - " WHERE NH_REQV.parent_id = {$id} " . - " ) " . - " ORDER BY version_id DESC,version DESC,revision DESC "; - } - - switch($my['options']['output']) - { - case 'map': - $rs = $this->db->fetchRowsIntoMap($sql,'version_id'); - break; - - case 'array': - $rs = $this->db->get_recordset($sql); - break; - } - - if( !is_null($rs) ) - { - $lbl = init_labels(array('undefined' => 'undefined')); - $key2loop = array_keys($rs); - foreach($key2loop as $ap) - { - $rs[$ap]['item_id'] = ($rs[$ap]['revision_id'] > 0) ? $rs[$ap]['revision_id'] : $rs[$ap]['version_id']; - - // IMPORTANT NOTICE - // each DBMS uses a different (unfortunatelly) way to signal NULL DATE - // - // We need to Check with ALL DB types - // MySQL NULL DATE -> "0000-00-00 00:00:00" - // Postgres NULL DATE -> NULL - // MSSQL NULL DATE - ??? - $key4date = 'creation_ts'; - $key4user = 'author_id'; - $nullTS = $this->db->db_null_timestamp(); - if( ($rs[$ap]['modification_ts'] != $nullTS) - && !is_null($rs[$ap]['modification_ts']) - && !is_null($rs[$ap]['modifier_id'])) { - $key4date = 'modification_ts'; - $key4user = 'modifier_id'; - } - $rs[$ap]['timestamp'] = $rs[$ap][$key4date]; - $rs[$ap]['last_editor'] = $rs[$ap][$key4user]; - // decode user_id for last_editor - $user = tlUser::getByID($this->db,$rs[$ap]['last_editor']); - $rs[$ap]['last_editor'] = $user ? $user->getDisplayName() : $lbl['undefined']; - } - } - - $history = $rs; - if( $my['options']['decode_user'] && !is_null($history) ) - { - $this->decode_users($history); - } - - return $history; - } - - - /** - * - * - */ - function get_version($version_id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('renderImageInline' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . - " REQV.scope,REQV.status,REQV.type,REQV.active," . - " REQV.is_open,REQV.author_id,REQV.version,REQV.revision,REQV.id AS version_id," . - " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . - " REQV.modification_ts,REQV.revision,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . - " FROM {$this->object_table} REQ " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id ". - " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - " WHERE REQV.id = " . intval($version_id); - - $dummy = $this->db->get_recordset($sql); - - if( !is_null($dummy) ) - { - $this->decode_users($dummy); - $dummy = $dummy[0]; - } - - if(!is_null($dummy) && $my['opt']['renderImageInline']) - { - $this->renderImageAttachments($dummy['id'],$dummy); - } - - return $dummy; - } - - - - /** - * - * - * @internal revision - * - */ - function get_revision($revision_id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('renderImageInline' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " /* $debugMsg */ " . - " SELECT REQV.id AS req_version_id,REQ.id,REQ.srs_id, + $reqTCLinksCfg->freezeBothEndsOnNewREQVersion; + + if ($freezeLinkedTCases) { + $this->closeOpenTCVersionOnOpenLinks($from_version_id); + } + + if ($freezeLinkOnNewReqVersion) { + $this->updateTCVLinkStatus($from_version_id, + LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION); + } + } + + /** + */ + private function closeOpenTCVersionOnOpenLinks($reqVersionID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $commonWhere = " WHERE req_version_id = " . intval($reqVersionID) . + " AND link_status = " . LINK_TC_REQ_OPEN; + $sql = "/* $debugMsg */ UPDATE {$this->tables['tcversions']} " . + " SET is_open = 0" . " WHERE id IN ( SELECT tcversion_id " . + " FROM {$this->tables['req_coverage']} $commonWhere " . + " ) AND is_open = 1"; + + $this->db->exec_query($sql); + } + + /** + */ + public function updateOpen($reqVersionID, $value) + { + $this->updateBoolean($reqVersionID, 'is_open', $value); + } + + /** + * + * @todo delete the unused function if necessary + */ + private function updateActive($reqVersionID, $value) + { + $this->updateBoolean($reqVersionID, 'active', $value); + } + + /** + */ + private function updateBoolean($reqVersionID, $field, $value) + { + $booleanValue = $value; + if (is_bool($booleanValue)) { + $booleanValue = $booleanValue ? 1 : 0; + } elseif (! is_numeric($booleanValue) || is_null($booleanValue)) { + $booleanValue = 1; + } + $booleanValue = $booleanValue > 0 ? 1 : 0; + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . + " SET {$field}={$booleanValue} WHERE id={$reqVersionID}"; + + $this->db->exec_query($sql); + } + + /** + * get relations for a given requirement ID + * + * @author Andreas Simon + * + * @param int $id + * Requirement ID + * + * @return array $relations in which this req is either source or destination + */ + public function get_relations($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $relations = array(); + $relations['num_relations'] = 0; + $relations['req'] = current($this->get_by_id($id)); + + $tproject_mgr = new testproject($this->db); + + $sql = "/* $debugMsg */ SELECT id, source_id, destination_id, relation_type, author_id, creation_ts " . + " FROM {$this->tables['req_relations']} " . + " WHERE source_id=$id OR destination_id=$id " . " ORDER BY id ASC "; + + $relations['relations'] = $this->db->get_recordset($sql); + if (! empty($relations['relations'])) { + $labels = $this->get_all_relation_labels(); + $label_keys = array_keys($labels); + foreach ($relations['relations'] as $key => $rel) { + + // is this relation type is configured? + if ($relTypeAllowed = in_array($rel['relation_type'], + $label_keys)) { + $relations['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; + $relations['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; + + if ($id == $rel['source_id']) { + $type_localized = 'source_localized'; + $other_key = 'destination_id'; + } else { + $type_localized = 'destination_localized'; + $other_key = 'source_id'; + } + $relations['relations'][$key]['type_localized'] = $relations['relations'][$key][$type_localized]; + $other_req = $this->get_by_id($rel[$other_key]); + + // only add it, if either interproject linking is on or if it is in the same project + $relTypeAllowed = false; + if ($this->relationsCfg->interProjectLinking || + ($other_req[0]['testproject_id'] == + $relations['req']['testproject_id'])) { + $relTypeAllowed = true; + $relations['relations'][$key]['related_req'] = $other_req[0]; + $other_tproject = $tproject_mgr->get_by_id( + $other_req[0]['testproject_id']); + $relations['relations'][$key]['related_req']['testproject_name'] = $other_tproject['name']; + + $user = tlUser::getByID($this->db, $rel['author_id']); + $relations['relations'][$key]['author'] = $user->getDisplayName(); + } + } + + if (! $relTypeAllowed) { + unset($relations['relations'][$key]); + } + } + + $relations['num_relations'] = count($relations['relations']); + } + return $relations; + } + + /** + * checks if there is a relation of a given type between two requirements + * + * @author Andreas Simon + * + * @param integer $first_id + * requirement ID to check + * @param integer $second_id + * another requirement ID to check + * @param integer $rel_type_id + * relation type ID to check + * + * @return true, if relation already exists, false if not + */ + public function check_if_relation_exists($first_id, $second_id, $rel_type_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT COUNT(0) AS qty " . + " FROM {$this->tables['req_relations']} " . + " WHERE ((source_id=$first_id AND destination_id=$second_id) " . + " OR (source_id=$second_id AND destination_id=$first_id)) " . + " AND relation_type=$rel_type_id"; + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty'] > 0; + } + + /** + * Get count of all relations for a requirement, no matter if it is source or destination + * or what type of relation it is. + * + * @author Andreas Simon + * + * @param integer $id + * requirement ID to check + * + * @return integer $count + */ + public function count_relations($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $safeID = intval($id); + $sql = "/* $debugMsg */ SELECT COUNT(*) AS qty " . + " FROM {$this->tables['req_relations']} " . + " WHERE source_id={$safeID} OR destination_id={$safeID} "; + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + /** + * add a relation of a given type between two requirements + * + * @author Andreas Simon + * + * @param integer $source_id + * ID of source requirement + * @param integer $destination_id + * ID of destination requirement + * @param integer $type_id + * relation type ID to set + * @param integer $author_id + * user's ID + */ + public function add_relation($source_id, $destination_id, $type_id, + $author_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $time = $this->db->db_now(); + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_relations']} " . + " (source_id, destination_id, relation_type, author_id, creation_ts) " . + " values ($source_id, $destination_id, $type_id, $author_id, $time)"; + $this->db->exec_query($sql); + } + + /** + * delete an existing relation with between two requirements + * + * @author Andreas Simon + * + * @param int $id + * requirement relation id + */ + public function delete_relation($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['req_relations']} WHERE id=$id "; + $this->db->exec_query($sql); + } + + /** + * delete all existing relations for (from or to) a given req id, no matter which project + * they belong to or which other requirement they are related to + * + * @author Andreas Simon + * + * @param int $id + * requirement ID (can be array of IDs) + */ + public function delete_all_relations($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $id_list = implode(",", (array) $id); + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['req_relations']} " . + " WHERE source_id IN ($id_list) OR destination_id IN ($id_list) "; + $this->db->exec_query($sql); + } + + /** + * initialize the requirement relation labels + * + * @author Andreas Simon + * + * @return array $labels a map with all labels in following form: + * Array + * ( + * [1] => Array + * ( + * [source] => parent of + * [destination] => child of + * ) + * [2] => Array + * ( + * [source] => blocks + * [destination] => depends on + * ) + * [3] => Array + * ( + * [source] => related to + * [destination] => related to + * ) + * ) + */ + public static function get_all_relation_labels() + { + $labels = config_get('req_cfg')->rel_type_labels; + foreach ($labels as $key => $label) { + $labels[$key] = init_labels($label); + } + + return $labels; + } + + /** + * Initializes the select field for the localized requirement relation types. + * + * @author Andreas Simon + * + * @return array $htmlSelect info needed to create select box on multiple templates + */ + public function init_relation_type_select() + { + $htmlSelect = array( + 'items' => array(), + 'selected' => null, + 'equal_relations' => array() + ); + $labels = $this->get_all_relation_labels(); + + foreach ($labels as $key => $lab) { + $htmlSelect['items'][$key . "_source"] = $lab['source']; + if ($lab['source'] != $lab['destination']) { + // relation is not equal as labels for source and dest are different + $htmlSelect['items'][$key . "_destination"] = $lab['destination']; + } else { + // mark this as equal relation - no parent/child, makes searching simpler + $htmlSelect['equal_relations'][] = $key . "_source"; + } + } + + // set "related to" as default preselected value in forms + if (defined('TL_REQ_REL_TYPE_RELATED') && + isset($htmlSelect[TL_REQ_REL_TYPE_RELATED . "_source"])) { + $selected_key = TL_REQ_REL_TYPE_RELATED . "_source"; + } else { + // "related to" is not configured, so take last element as selected one + $keys = array_keys($htmlSelect['items']); + $selected_key = end($keys); + } + $htmlSelect['selected'] = $selected_key; + + return $htmlSelect; + } + + /** + * getByAttribute + * allows search (on this version) by one of following attributes + * - title + * - docid + */ + private function getByAttribute($attr, $tproject_id = null, + $parent_id = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'check_criteria' => '=', + 'access_key' => 'id', + 'case' => 'sensitive', + 'output' => 'standard' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $target = $this->db->prepare_string(trim($attr['value'])); + + $where_clause = $attr['key'] == 'title' ? " NH_REQ.name " : " REQ.req_doc_id "; + + switch ($my['options']['check_criteria']) { + case 'like': + case 'likeLeft': + $check_criteria = " LIKE '{$target}%' "; + break; + + case '=': + default: + $check_criteria = " = '{$target}' "; + break; + } + + $sql = " /* $debugMsg */ SELECT "; + switch ($my['options']['output']) { + case 'standard': + $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order "; + break; + + case 'minimun': + $sql .= " REQ.id,REQ.srs_id,REQ.req_doc_id,NH_REQ.name AS title, REQ_SPEC.testproject_id"; + break; + + case 'id': + $sql .= " REQ.id"; + break; + } + $sql .= " FROM {$this->object_table} REQ " . + " /* Get Req info from NH */ " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + " WHERE {$where_clause} {$check_criteria} "; + + if (! is_null($tproject_id)) { + $sql .= " AND REQ_SPEC.testproject_id={$tproject_id}"; + } + + if (! is_null($parent_id)) { + $sql .= " AND REQ.srs_id={$parent_id}"; + } + + return $this->db->fetchRowsIntoMap($sql, $my['options']['access_key']); + } + + /** + * + * @param + * id: parent id: can be REQ ID or REQ VERSION ID depending of $child_type + * @param + * child_type: 'req_versions', 'req_revisions' + * + * @return + */ + private function get_last_child_info($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'child_type' => 'revision', + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $info = null; + $target_cfg = array( + 'version' => array( + 'table' => 'req_versions', + 'field' => 'version' + ), + 'revision' => array( + 'table' => 'req_revisions', + 'field' => 'revision' + ) + ); + + $child_type = $my['options']['child_type']; // just for readability + $table = $target_cfg[$child_type]['table']; + $field = $target_cfg[$child_type]['field']; + + $sql = " /* $debugMsg */ SELECT COALESCE(MAX($field),-1) AS $field " . + " FROM {$this->tables[$table]} CHILD," . + " {$this->tables['nodes_hierarchy']} NH WHERE " . + " NH.id = CHILD.id " . " AND NH.parent_id = {$id} "; + + $max_verbose = $this->db->fetchFirstRowSingleColumn($sql, $field); + + if ($max_verbose >= 0) { + $sql = "/* $debugMsg */ SELECT "; + + switch ($my['options']['output']) { + case 'credentials': + $sql .= " CHILD.parent_id,CHILD.id,CHILD.revision,CHILD.doc_id "; + break; + + case 'full': + $sql .= " CHILD.* "; + break; + + default: + $sql .= $my['options']['output']; + break; + } + + $sql .= " FROM {$this->tables[$table]} CHILD," . + " {$this->tables['nodes_hierarchy']} NH " . + " WHERE $field = {$max_verbose} AND NH.id = CHILD.id AND NH.parent_id = {$id}"; + + $info = $this->db->fetchFirstRow($sql); + } + return $info; + } + + /** + * + * @internal revision + * 20110115 - franciscom - fixed insert of null on timestamp field + */ + public function create_new_revision($parent_id, $user_id, $tproject_id, + $req = null, $log_msg = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $item_id = $this->tree_mgr->new_node($parent_id, + $this->node_types_descr_id['requirement_revision']); + + // Needed to get higher revision NUMBER, to generata new NUMBER + $source_info = $this->get_last_child_info($parent_id, + array( + 'child_type' => 'revision' + )); + $current_rev = 0; + if (! is_null($source_info)) { + $current_rev = $source_info['revision']; + } + $current_rev ++; + + // Info regarding new record created on req_revisions table + $ret = array(); + $ret['id'] = $item_id; + $ret['revision'] = $current_rev; + $ret['msg'] = 'ok'; + + $this->copy_version_as_revision($parent_id, $item_id, $current_rev, + $tproject_id); + $sql = "/* $debugMsg */ " . " UPDATE {$this->tables['req_revisions']} " . + " SET name ='" . $this->db->prepare_string($req['title']) . "'," . + " req_doc_id ='" . $this->db->prepare_string($req['req_doc_id']) . + "'" . " WHERE id = {$item_id} "; + $this->db->exec_query($sql); + + $new_rev = $current_rev + 1; + $db_now = $this->db->db_now(); + $sql = " /* $debugMsg */ " . " UPDATE {$this->tables['req_versions']} " . + " SET revision = {$new_rev}, log_message=' " . + $this->db->prepare_string($log_msg) . "'," . + " creation_ts = {$db_now} ,author_id = {$user_id}, modifier_id = NULL"; + + $nullTS = $this->db->db_null_timestamp(); + if (! is_null($nullTS)) { + $sql .= ",modification_ts = {$nullTS} "; + } + + $sql .= " WHERE id = {$parent_id} "; + $this->db->exec_query($sql); + return $ret; + } + + /** + */ + private function copy_version_as_revision($parent_id, $item_id, $revision, + $tproject_id) + { + $sql = '/* $debugMsg */' . + " INSERT INTO {$this->tables['req_revisions']} " . + " (parent_id,id,revision,scope,status,type,active,is_open, " . + " expected_coverage,author_id,creation_ts,modifier_id,modification_ts,log_message) " . + " SELECT REQV.id, {$item_id}, {$revision}, " . + " REQV.scope,REQV.status,REQV.type,REQV.active,REQV.is_open, " . + " REQV.expected_coverage,REQV.author_id,REQV.creation_ts,REQV.modifier_id," . + " REQV.modification_ts,REQV.log_message" . + " FROM {$this->tables['req_versions']} REQV " . + " WHERE REQV.id = {$parent_id} "; + $this->db->exec_query($sql); + + // need to copy Custom Fields ALSO + // BAD NAME -> version_id is REALLY NODE ID + $source = array( + 'id' => 0, + 'version_id' => $parent_id + ); + $dest = array( + 'id' => 0, + 'version_id' => $item_id + ); + $this->copy_cfields($source, $dest, $tproject_id); + } + + /** + * used to create overwiew of changes between revisions + * 20110116 - franciscom - BUGID 4172 - MSSQL UNION text field issue + */ + public function get_history($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'output' => "map", + 'decode_user' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // Why can I use these common fields ? + // explain better + // $common_fields = " REQV.id AS version_id, REQV.version,REQV.creation_ts, REQV.author_id, " . + // " REQV.modification_ts, REQV.modifier_id "; + + // needs a double coalesce not too elegant but... + + // Two steps algorithm + // First understand is we already have a revision + $sql = " /* $debugMsg */" . " SELECT COUNT(0) AS qta_rev " . + " FROM {$this->tables['req_revisions']} REQRV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQRV.parent_id " . + " WHERE NH_REQV.parent_id = {$id} "; + + $rs = $this->db->get_recordset($sql); + + $sql = "/* $debugMsg */" . " SELECT REQV.id AS version_id, REQV.version," . + " REQV.creation_ts, REQV.author_id, " . + " REQV.modification_ts, REQV.modifier_id, " . self::NO_REVISION . + " AS revision_id, " . " REQV.revision, REQV.scope, " . + " REQV.status,REQV.type,REQV.expected_coverage,NH_REQ.name, REQ.req_doc_id, " . + " COALESCE(REQV.log_message,'') AS log_message" . + " FROM {$this->tables['req_versions']} REQV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " WHERE NH_REQV.parent_id = {$id} "; + + if ($rs[0]['qta_rev'] > 0) { + // Important NOTICE - MSSQL + // + // text fields can be used on union ONLY IF YOU USE UNION ALL + // + // UNION ALL returns ALSO duplicated rows. + // In this situation this is NOT A PROBLEM (because we will not have dups) + // + $sql .= " UNION ALL ( " . + " SELECT REQV.id AS version_id, REQV.version, " . + " REQRV.creation_ts, REQRV.author_id, " . + " REQRV.modification_ts, REQRV.modifier_id, " . + " REQRV.id AS revision_id, " . + " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . + " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . + " COALESCE(REQRV.log_message,'') as log_message" . + " FROM {$this->tables['req_versions']} REQV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " JOIN {$this->tables['req_revisions']} REQRV " . + " ON REQRV.parent_id = REQV.id " . + " WHERE NH_REQV.parent_id = {$id} " . " ) " . + " ORDER BY version_id DESC,version DESC,revision DESC "; + } + + switch ($my['options']['output']) { + case 'map': + $rs = $this->db->fetchRowsIntoMap($sql, 'version_id'); + break; + + case 'array': + $rs = $this->db->get_recordset($sql); + break; + } + + if (! is_null($rs)) { + $lbl = init_labels(array( + 'undefined' => 'undefined' + )); + $key2loop = array_keys($rs); + foreach ($key2loop as $ap) { + $rs[$ap]['item_id'] = ($rs[$ap]['revision_id'] > 0) ? $rs[$ap]['revision_id'] : $rs[$ap]['version_id']; + + // IMPORTANT NOTICE + // each DBMS uses a different (unfortunatelly) way to signal NULL DATE + // + // We need to Check with ALL DB types + // MySQL NULL DATE -> "0000-00-00 00:00:00" + // Postgres NULL DATE -> NULL + // MSSQL NULL DATE - ??? + $key4date = 'creation_ts'; + $key4user = 'author_id'; + $nullTS = $this->db->db_null_timestamp(); + if (($rs[$ap]['modification_ts'] != $nullTS) && + ! is_null($rs[$ap]['modification_ts']) && + ! is_null($rs[$ap]['modifier_id'])) { + $key4date = 'modification_ts'; + $key4user = 'modifier_id'; + } + $rs[$ap]['timestamp'] = $rs[$ap][$key4date]; + $rs[$ap]['last_editor'] = $rs[$ap][$key4user]; + // decode user_id for last_editor + $user = tlUser::getByID($this->db, $rs[$ap]['last_editor']); + $rs[$ap]['last_editor'] = $user ? $user->getDisplayName() : $lbl['undefined']; + } + } + + $history = $rs; + if ($my['options']['decode_user'] && ! is_null($history)) { + $this->decode_users($history); + } + + return $history; + } + + /** + */ + public function get_version($version_id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['opt'] = array( + 'renderImageInline' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . + " REQV.scope,REQV.status,REQV.type,REQV.active," . + " REQV.is_open,REQV.author_id,REQV.version,REQV.revision,REQV.id AS version_id," . + " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . + " REQV.modification_ts,REQV.revision,NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . + " FROM {$this->object_table} REQ " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . + " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + " WHERE REQV.id = " . intval($version_id); + + $dummy = $this->db->get_recordset($sql); + + if (! is_null($dummy)) { + $this->decode_users($dummy); + $dummy = $dummy[0]; + } + + if (! is_null($dummy) && $my['opt']['renderImageInline']) { + $this->renderImageAttachments($dummy['id'], $dummy); + } + + return $dummy; + } + + /** + * + * @internal revision + * + */ + public function get_revision($revision_id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['opt'] = array( + 'renderImageInline' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " /* $debugMsg */ " . + " SELECT REQV.id AS req_version_id,REQ.id,REQ.srs_id, REQ.req_doc_id,REQRV.scope,REQRV.status,REQRV.type, - REQRV.active," . - " REQRV.is_open,REQRV.author_id,REQV.version,REQRV.parent_id AS version_id," . - " REQRV.expected_coverage,REQRV.creation_ts,REQRV.modifier_id," . - " REQRV.modification_ts,REQRV.revision, REQRV.id AS revision_id," . - " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . - " FROM {$this->tables['req_revisions']} REQRV " . - " JOIN {$this->tables['req_versions']} REQV ON REQV.id = REQRV.parent_id ". - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQRV.parent_id ". - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - " WHERE REQRV.id = " . intval($revision_id); - $dummy = $this->db->get_recordset($sql); - - if( !is_null($dummy) ) - { - $this->decode_users($dummy); - $dummy = $dummy[0]; - } - - if(!is_null($dummy) && $my['opt']['renderImageInline']) - { - $this->renderImageAttachments($dummy['id'],$dummy); - } - - return $dummy; - } - - - /** - * get info regarding a req version, using also revision as access criteria. - * - * @int version_id - * @array revision_access possible keys 'id', 'number' - * - * @uses print.inc.php - * @uses renderReqForPrinting() - * - * - */ - function get_version_revision($version_id,$revision_access,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('renderImageInline' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = "/* $debugMsg */"; - - if( isset($revision_access['number']) ) { - $rev_number = intval($revision_access['number']); - - // we have to tables to search on - // Req Versions -> holds LATEST revision - // Req Revisions -> holds other revisions - $sql .= " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version," . - " REQV.creation_ts, REQV.author_id, " . - " REQV.modification_ts, REQV.modifier_id, " . - self::NO_REVISION . " AS revision_id, " . - " REQV.revision, REQV.scope, " . - " REQV.status,REQV.type,REQV.expected_coverage,NH_REQ.name, REQ.req_doc_id, " . - " COALESCE(REQV.log_message,'') AS log_message, NH_REQ.name AS title " . - " FROM {$this->tables['req_versions']} REQV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " WHERE NH_REQV.id = {$version_id} AND REQV.revision = {$rev_number} "; - - $sql .= " UNION ALL ( " . - " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version, " . - " REQRV.creation_ts, REQRV.author_id, " . - " REQRV.modification_ts, REQRV.modifier_id, " . - " REQRV.id AS revision_id, " . - " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . - " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . - " COALESCE(REQRV.log_message,'') as log_message, NH_REQ.name AS title " . - " FROM {$this->tables['req_versions']} REQV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " JOIN {$this->tables['req_revisions']} REQRV " . - " ON REQRV.parent_id = REQV.id " . - " WHERE NH_REQV.id = {$version_id} AND REQRV.revision = {$rev_number} ) "; - - } else { - // revision_id is present ONLY on req revisions table, then we do not need UNION - $sql .= " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version, " . - " REQRV.creation_ts, REQRV.author_id, " . - " REQRV.modification_ts, REQRV.modifier_id, " . - " REQRV.id AS revision_id, " . - " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . - " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . - " COALESCE(REQRV.log_message,'') as log_message, NH_REQ.name AS title " . - " FROM {$this->tables['req_versions']} REQV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . - " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . - " JOIN {$this->tables['req_revisions']} REQRV " . - " ON REQRV.parent_id = REQV.id " . - " WHERE NH_REQV.id = {$version_id} AND REQRV.revision_id = " . intval($revision_access['id']); - } - - $rs = $this->db->get_recordset($sql); - - if(!is_null($rs) && $my['opt']['renderImageInline']) { - $k2l = array_keys($rs); - foreach($k2l as $akx) { - $this->renderImageAttachments($rs[$akx]['req_id'],$rs[$akx]); - } - reset($rs); - } - return $rs; - } - - - - /** - * - * - */ - function decode_users(&$rs) - { - $userCache = null; // key: user id, value: display name - $key2loop = array_keys($rs); - $labels['undefined'] = lang_get('undefined'); - $user_keys = array('author' => 'author_id', 'modifier' => 'modifier_id'); - foreach( $key2loop as $key ) - { - foreach( $user_keys as $ukey => $userid_field) - { - $rs[$key][$ukey] = ''; - if(trim($rs[$key][$userid_field]) != "") - { - if( !isset($userCache[$rs[$key][$userid_field]]) ) - { - $user = tlUser::getByID($this->db,$rs[$key][$userid_field]); - $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; - } - else - { - $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; - } - } - } - } - } - - - - /** - * - * - */ - function generateUniqueTitle($title2check, $parent_id, $tproject_id) - { - - static $fieldSize; - static $getOptions; - static $reqCfg; - static $mask; - static $title_max_len; - - if( !$fieldSize ) - { - $fieldSize = config_get('field_size'); - $reqCfg = config_get('req_cfg'); - - $mask = $reqCfg->duplicated_name_algorithm->text; - $title_max_len = $fieldSize->requirement_title; - - $getOptions = array('output' => 'minimun', 'check_criteria' => 'likeLeft'); - } - - $generated = $title2check; - $attr = array('key' => 'title', 'value' => $title2check); - - // search need to be done in like to the left - $itemSet = $this->getByAttribute($attr,$tproject_id,$parent_id,$getOptions); - - // we borrow logic (may be one day we can put it on a central place) from - // testcase class create_tcase_only() - if( !is_null($itemSet) && ($siblingQty=count($itemSet)) > 0 ) - { - $nameSet = array_flip(array_keys($itemSet)); - $target = $title2check . ($suffix = sprintf($mask,++$siblingQty)); - $final_len = strlen($target); - if( $final_len > $title_max_len) - { - $target = substr($target,strlen($suffix),$title_max_len); - } - // Need to recheck if new generated name does not crash with existent name - // why? Suppose you have created: - // REQ [1] - // REQ [2] - // REQ [3] - // Then you delete REQ [2]. - // When I got siblings il will got 2 siblings, if I create new progressive using next, - // it will be 3 => I will get duplicated name. - while( isset($nameSet[$target]) ) - { - $target = $title2check . ($suffix = sprintf($mask,++$siblingQty)); - $final_len = strlen($target); - if( $final_len > $title_max_len) - { - $target = substr($target,strlen($suffix),$title_max_len); - } - } - $generated = $target; - } - - return $generated; - } - - - /** - * - * - */ - function getTestProjectID($id, $reqSpecID=null) - { - $reqSpecMgr = new requirement_spec_mgr($this->db); - $parent = $reqSpecID; - if( is_null($parent) ) - { - $dummy = $this->tree_mgr->get_node_hierarchy_info($id); - $parent = $dummy['parent_id']; - } - $target = $reqSpecMgr->get_by_id($parent); - return $target['testproject_id']; - } - - - /** - * @param $context map with following keys - * tproject_id => REQUIRED - * tplan_id => OPTIONAL - * platform_id => OPTIONAL, will be used ONLY - * if tplan_id is provided. - * - */ - function getAllByContext($context,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if( !isset($context['tproject_id']) ) - { - throw new Exception($debugMsg . ' : $context[\'tproject_id\'] is needed'); - } - - $where = "WHERE RSPEC.testproject_id = " . intval($context['tproject_id']); - $sql = "/* $debugMsg */ " . - "SELECT DISTINCT REQ.id,REQ.req_doc_id FROM {$this->tables['requirements']} REQ " . - "JOIN {$this->tables['req_specs']} RSPEC ON RSPEC.id = REQ.srs_id "; - - - if( isset($context['tplan_id']) ) - { - - $sql .= "JOIN {$this->tables['req_coverage']} REQCOV ON REQCOV.req_id = REQ.id " . - "JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = REQCOV.testcase_id " . - "JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id "; - - $where .= " AND TPTCV.testplan_id = " . intval($context['tplan_id']); - if( isset($context['platform_id']) && intval($context['platform_id']) > 0 ) - { - $where .= " AND TPTCV.platform_id = " . intval($context['platform_id']); - } - } - - - $sql .= $where; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - - return $rs; - } - - /** - * - * @used-by - */ - function getFileUploadRelativeURL($req_id,$req_version_id) { - $sfReqID = intval($req_id); - $sfVersion = intval($req_version_id); - - $url = "lib/requirements/reqEdit.php" . - "?doAction=fileUpload&requirement_id=" . $sfReqID . - "&req_id=" . $sfReqID ."&req_version_id=" . $sfVersion; - - return $url; - } - - /** - * - * @used-by - */ - function getDeleteAttachmentRelativeURL($req_id,$req_version_id) { - $url = "lib/requirements/reqEdit.php?doAction=deleteFile" . - "&requirement_id=" . intval($req_id) . - "&req_version_id=" . intval($req_version_id) . - "&file_id=" ; - return $url; - } - - - - /** - * exportRelationToXML - * - * Function to export a requirement relation to XML. - * - * @param int $relation relation data array - * @param string $troject_id - * @param boolean check_for_req_project - * - * @return string with XML code - * - * doc_id - * prj - * doc2_id - * prj2 - * 0 - * - * - * @internal revisions - * - */ - function exportRelationToXML( $relation, $tproject_id = null, $check_for_req_project = false) - { - $xmlStr = ''; - $source_docid = null; $destination_docid = null; - $source_project = null; $destination_project = null; - - if( !is_null($relation) ) - { - // FRL : interproject linking support - $tproject_mgr = new testproject($this->db); - $reqs = $this->get_by_id($relation['source_id'],requirement_mgr::LATEST_VERSION); - if ( ! is_null ( $reqs ) && count($reqs) > 0 ) - { - $source_docid = $reqs[0]['req_doc_id']; - if ($check_for_req_project) - { - $tproject = $tproject_mgr->get_by_id($reqs[0]['testproject_id']); - if ($tproject['id'] != $tproject_id) - { - $source_project = $tproject['name']; - } - } - } - - $reqs = $this->get_by_id($relation['destination_id'],requirement_mgr::LATEST_VERSION); - if( !is_null($reqs) && count($reqs) > 0 ) - { - $destination_docid = $reqs[0]['req_doc_id']; - if ($check_for_req_project) - { - $tproject = $tproject_mgr->get_by_id($reqs[0]['testproject_id']); - if ($tproject['id'] != $tproject_id) - { - $destination_project = $tproject['name']; - } - } - - } - - if ( !is_null($source_docid) && !is_null($destination_docid) ) - { - $relation['source_doc_id'] = $source_docid; - $relation['destination_doc_id'] = $destination_docid; - - $info = array("||SOURCE||" => "source_doc_id","||DESTINATION||" => "destination_doc_id", - "||TYPE||" => "relation_type"); - - $elemTpl = "\t" . "" . "\n\t\t" . "||SOURCE||" ; - if (!is_null($source_project)) - { - $elemTpl .= "\n\t\t" . "||SRC_PROJECT||"; - $relation['source_project'] = $source_project; - $info["||SRC_PROJECT||"] = "source_project"; - } - - $elemTpl .= "\n\t\t" . "||DESTINATION||"; - if (!is_null($destination_project)) - { - $elemTpl .= "\n\t\t" . "||DST_PROJECT||"; - $relation['destination_project'] = $destination_project; - $info["||DST_PROJECT||"] = "destination_project"; - } - $elemTpl .= "\n\t\t" . "||TYPE||" . "\n\t" . "" . "\n"; - - $relations[] = $relation; - $xmlStr = exportDataToXML($relations,"{{XMLCODE}}",$elemTpl,$info,true); - } - } - - return $xmlStr; - } - - /** - * Converts a XML relation into a Map that represents relation. - * - * The XML should be in the following format: - * - * - * doc_id - * prj - * doc2_id - * prj2 - * 0 - * - * - * And here is an example of an output map of this function. - * - * [ - * 'source_doc_id' => 'doc_id', - * 'destination_doc_id' => 'doc2_id', - * 'type'=> 0, - * 'source_id' => 100, - * 'destination_id' => 101 - * ] - * - * The source_id and the destination_id are set here to null but are used in - * other parts of the system. When you add a relation to the database you - * have to provide the source_id and destination_id. - * - * @internal revisions - * 20120110 - frl - add project info if interproject_linking is set - * 20110314 - kinow - Created function. - */ - function convertRelationXmlToRelationMap($xml_item) - { - // Attention: following PHP Manual SimpleXML documentation, Please remember to cast - // before using data from $xml, - if( is_null($xml_item) ) - { - return null; - } - - $dummy=array(); - foreach($xml_item->attributes() as $key => $value) - { - $dummy[$key] = (string)$value; // See PHP Manual SimpleXML documentation. - } - - $dummy['source_doc_id'] = (string)$xml_item->source; - $dummy['destination_doc_id'] = (string)$xml_item->destination; - $dummy['type'] = (string)$xml_item->type; - $dummy['source_id'] = null; - $dummy['destination_id'] = null; - // FRL : interproject linking support - $dummy['source_tproject'] = property_exists($xml_item,'source_project') ? (string)$xml_item->source_project : null; - $dummy['destination_tproject'] = property_exists($xml_item,'destination_project') ? (string)$xml_item->destination_project : null; - - return $dummy; - } - - /** - * This function receives a relation XML node, converts it into a map and - * then adds this relation to database if it doesn't exist yet. - * - * @internal revisions - * 20110314 - kinow - Created function. - */ - function createRelationFromXML($xml,$tproject_id,$author_id) - { - $relationAsMap = $this->convertRelationXmlToRelationMap($xml); - $user_feedback = $this->createRelationFromMap($relationAsMap, $tproject_id, $author_id); - return $user_feedback; - } - - /** - * Adds a relation into database. Before adding it checks whether it - * exists or not. If it exists than the relation is not added, otherwise - * it is. - * - * Map structure - * source_doc_id => doc_id - * destination_doc_id => doc_id - * type => 10 - * source_id => 0 - * destination_id = 0 - * - * @internal revisions - * 20110314 - kinow - Created function. - */ - function createRelationFromMap($rel, $tproject_id, $authorId) - { - $status_ok = true; - - // get internal source id / destination id - $options = array('access_key' => 'req_doc_id', 'output' =>'minimun'); - $reqs = null; - $source_doc_id = $rel['source_doc_id']; - - // FRL : interproject linking support (look for req in defined project and req must be found - // in current project if interproject_linking is not set) - $reqs = $this->getByDocIDInProject($source_doc_id, $rel['source_tproject'], $tproject_id, null, $options); - $source = ( ! is_null($reqs) ) ? $reqs[$source_doc_id] : null; - if( !is_null($source) && ($this->relationsCfg->interProjectLinking || $source['testproject_id'] == $tproject_id) ) - { - $rel['source_id'] = $source['id']; - } - - $destination_doc_id = $rel['destination_doc_id']; - $reqs = $this->getByDocIDInProject($destination_doc_id, $rel['destination_tproject'], $tproject_id, null, $options); - $destination = ( ! is_null($reqs) ) ? $reqs[$destination_doc_id] : null; - if( !is_null($destination) && - ($this->relationsCfg->interProjectLinking || $destination['testproject_id'] == $tproject_id) ) - { - $rel['destination_id'] = $destination['id']; - } - - // 2 - check if relation is valid - $source_id = $rel['source_id']; - $destination_id = $rel['destination_id']; - $source_doc_id .= (is_null($rel['source_tproject']) ? '' : (' [' . $rel['source_tproject'] . ']')); - $destination_doc_id .= (is_null($rel['destination_tproject']) ? '' : (' [' . $rel['destination_tproject'] . ']')); - $rel_types_desc = config_get('req_cfg')->rel_type_description; - - // check if given type is a valid one for rel_type_description defined in config - $type_desc = array_key_exists(intval($rel['type']), $rel_types_desc) ? $rel_types_desc[intval($rel['type'])] : null; - $user_feedback = array('doc_id' => $source_doc_id . ' - ' . $destination_doc_id, - 'title' => lang_get('relation_type') . ' : ' . (is_null($type_desc) ? $rel['type'] : $type_desc)); - - if ( is_null($source_id ) ) - { - $user_feedback['import_status'] = lang_get('rel_add_error_src_id') ." [".$source_doc_id."]."; - } - else if ( is_null($destination_id ) ) - { - $user_feedback['import_status'] = lang_get('rel_add_error_dest_id') ." [".$destination_doc_id."]."; - } - else if ($source_id == $destination_id) - { - $user_feedback['import_status'] = lang_get('rel_add_error_self'); - } - else if ( ($source['testproject_id'] != $tproject_id) && ($destination['testproject_id'] != $tproject_id) ) - { - $user_feedback['import_status'] = lang_get('rel_add_not_in_project'); - } - else if (is_null($type_desc)) - { - $user_feedback['import_status'] = lang_get('rel_add_invalid_type'); - } - else if ($this->check_if_relation_exists($source_id, $destination_id, $rel['type'])) - { - $user_feedback['import_status'] = sprintf(lang_get('rel_add_error_exists_already'), $type_desc); - } - else // all checks are ok => create it - { - $this->add_relation($source_id, $destination_id, $rel['type'], $authorId); - $user_feedback['import_status'] = lang_get('new_rel_add_success'); - } - - return array ($user_feedback); - } - - /** - * This function retrieves a requirement by doc_id with a specifed project - * @param string $doc_id - * @param string $req_project name of req's project - * @param string $tproject_id used only if $req_project is null - * @param string $parent_id - * @param array $options (same as original $options getByDocID method) - * - * @internal revisions - * 20110314 - kinow - Created function. - */ - function getByDocIDInProject($doc_id, $req_project=null, $tproject_id=null,$parent_id=null, $options = null) - { - $reqs = null; - if ( !is_null($req_project) ) - { - $tproject_mgr = new testproject($this->db); - $info=$tproject_mgr->get_by_name($req_project); - if ( !is_null($info) ) // is project found ? - { - $tproject_id = $info[0]['id']; - $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, $options); - } - //else $req = null; // project not found => no req - } - else - { - $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, $options); - } - return $reqs; - } - - -/* - function: getByIDBulkLatestVersionRevision - - @used by reqOverView - - args: id: requirement id (can be an array) - [version_id]: requirement version id (can be an array) - [version_number]: - [options] - - - returns: null if query fails - map with requirement info - - @internal revisions - @since 1.9.12 - -*/ -function getByIDBulkLatestVersionRevision($id,$opt=null) -{ - static $debugMsg; - static $userCache; // key: user id, value: display name - static $lables; - static $user_keys; - - if(!$debugMsg) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $labels['undefined'] = lang_get('undefined'); - $user_keys = array('author' => 'author_id', 'modifier' => 'modifier_id'); - } - - $my['opt'] = array('outputFormat' => 'map'); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $in_clause = "IN (" . implode(",",(array)$id) . ") "; - $where_clause = " WHERE NH_REQV.parent_id " . $in_clause; - - // added -1 AS revision_id to make some process easier - $sql = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . - " REQV.scope,REQV.status,REQV.type,REQV.active," . - " REQV.is_open,REQV.author_id,REQV.version,REQV.id AS version_id," . - " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . - " REQV.modification_ts,REQV.revision, -1 AS revision_id, " . - " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . - " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . - - " FROM {$this->tables['nodes_hierarchy']} NH_REQV JOIN " . - "( SELECT XNH_REQV.parent_id,MAX(XNH_REQV.id) AS LATEST_VERSION_ID " . - " FROM {$this->tables['nodes_hierarchy']} XNH_REQV " . - " WHERE XNH_REQV.parent_id {$in_clause} " . - " GROUP BY XNH_REQV.parent_id ) ZAZA ON NH_REQV.id = ZAZA.LATEST_VERSION_ID " . - - " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . - " JOIN {$this->object_table} REQ ON REQ.id = NH_REQV.parent_id " . - - " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - $where_clause; - - $sqlOpt = ($my['opt']['outputFormat'] == 'map' ? 0 : database::CUMULATIVE); - $recordset = $this->db->fetchRowsIntoMap($sql,'id',$sqlOpt); - - - $rs = null; - - if(!is_null($recordset)) { - // Decode users - $rs = $recordset; - - // try to guess output structure - $x = array_keys(current($rs)); - if( is_int($x[0]) ) - { - // output[REQID][0] = array('id' =>, 'xx' => ...) - $flevel = array_keys($recordset); - foreach($flevel as $flk) - { - $key2loop = array_keys($recordset[$flk]); - foreach( $key2loop as $key ) - { - foreach( $user_keys as $ukey => $userid_field) - { - $rs[$flk][$key][$ukey] = ''; - if(trim($rs[$flk][$key][$userid_field]) != "") - { - if( !isset($userCache[$rs[$flk][$key][$userid_field]]) ) - { - $user = tlUser::getByID($this->db,$rs[$flk][$key][$userid_field]); - $rs[$flk][$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$flk][$key][$userid_field]] = $rs[$flk][$key][$ukey]; - unset($user); - } - else - { - $rs[$flk][$key][$ukey] = $userCache[$rs[$flk][$key][$userid_field]]; - } - } - } - } - } - } - else - { - // output[REQID] = array('id' =>, 'xx' => ...) - $key2loop = array_keys($recordset); - foreach( $key2loop as $key ) - { - foreach( $user_keys as $ukey => $userid_field) - { - $rs[$key][$ukey] = ''; - if(trim($rs[$key][$userid_field]) != "") - { - if( !isset($userCache[$rs[$key][$userid_field]]) ) - { - $user = tlUser::getByID($this->db,$rs[$key][$userid_field]); - $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; - unset($user); - } - else - { - $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; - } - } - } - } - } - - } - - unset($recordset); - unset($my); - unset($dummy); - - return $rs; -} - -/** - * - * @internal revisions - * @since 1.9.12 - */ -function getCoverageCounter($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe_id = intval($id); - $sql = "/* $debugMsg */ " . - " SELECT COUNT(0) AS qty " . - " FROM {$this->tables['req_coverage']} " . - " WHERE req_id = " . $safe_id; - - - $rs = $this->db->get_recordset($sql); - return $rs[0]['qty']; -} - - - /** - * - * @internal revisions - * @since 1.9.12 - */ - function getCoverageCounterSet($itemSet) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT req_id, COUNT(0) AS qty " . - " FROM {$this->tables['req_coverage']} " . - " WHERE req_id IN (" . implode(',', $itemSet) . ")" . - " GROUP BY req_id "; - - $rs = $this->db->fetchRowsIntoMap($sql,'req_id'); - return $rs; - } - - - /** - * - * @internal revisions - * @since 1.9.12 - */ - public function getRelationsCounters($itemSet) { - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $inSet = implode(',',$itemSet); - - $sqlS = " $debugMsg SELECT COUNT(*) AS qty, source_id AS req_id " . - " FROM {$this->tables['req_relations']} " . - " WHERE source_id IN ({$inSet}) "; - $sqlS .= (DB_TYPE == 'mssql') ? ' GROUP BY source_id ' : ' GROUP BY req_id '; - - $sqlD = " $debugMsg SELECT COUNT(*) AS qty, destination_id AS req_id " . - " FROM {$this->tables['req_relations']} " . - " WHERE destination_id IN ({$inSet}) "; - $sqlD .= (DB_TYPE == 'mssql') ? ' GROUP BY destination_id ' : ' GROUP BY req_id '; - - $sqlT = " SELECT SUM(qty) AS qty, req_id " . - " FROM ($sqlS UNION ALL $sqlD) D ". - ' GROUP BY req_id '; - - $rs = $this->db->fetchColumnsIntoMap($sqlT,'req_id','qty'); - return $rs; - } - - - /** - * - * - */ - function updateScope($reqVersionID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . - " SET scope='" . $this->db->prepare_string($scope) . "'" . - " WHERE id=" . intval($reqVersionID); - $this->db->exec_query($sql); - } - - - /** - * render Image Attachments INLINE - * - */ - function renderImageAttachments($id,&$item2render,$basehref=null) { - static $attSet; - static $targetTag; - - $version_id = intval($item2render['version_id']); - if(!$attSet || !isset($attSet[$id])) { - $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor($version_id,$this->attachmentTableName,'id'); - $beginTag = '[tlInlineImage]'; - $endTag = '[/tlInlineImage]'; - } - - if(is_null($attSet[$id])) { - return; - } - - // $href = '%s:%s' . " $versionTag (link)

    "; - // second \'%s\' needed if I want to use Latest as indication, need to understand - // Javascript instead of javascript, because CKeditor sometimes complains - $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; - $img = '

    '; - - $key2check = array('scope'); - $rse = &$item2render; - foreach($key2check as $item_key) { - $start = strpos($rse[$item_key],$beginTag); - $ghost = $rse[$item_key]; - - // There is at least one request to replace ? - if($start !== FALSE) { - $xx = explode($beginTag,$rse[$item_key]); - - // How many requests to replace ? - $xx2do = count($xx); - $ghost = ''; - for($xdx=0; $xdx < $xx2do; $xdx++) { - // Hope was not a false request. - if( strpos($xx[$xdx],$endTag) !== FALSE) { - // Separate command string from other text - // Theorically can be just ONE, but it depends - // is user had not messed things. - $yy = explode($endTag,$xx[$xdx]); - if( ($elc = count($yy)) > 0) { - $atx = $yy[0]; - try { - if(isset($attSet[$id][$atx]) && $attSet[$id][$atx]['is_image']) { - $ghost .= str_replace('%id%',$atx,$img); - } - $lim = $elc-1; - for($cpx=1; $cpx <= $lim; $cpx++) { - $ghost .= $yy[$cpx]; - } - } catch (Exception $e) { - $ghost .= $rse[$item_key]; - } - } - } else { - // nothing to do - $ghost .= $xx[$xdx]; - } - } - } - - // reconstruct field contents - if($ghost != '') { - $rse[$item_key] = $ghost; - } - } - } - - - - /** - * scope is managed at revision and version level - * @since 1.9.13 - */ - function inlineImageProcessing($idCard,$scope,$rosettaStone) { - // get all attachments, then check is there are images - $att = $this->attachmentRepository->getAttachmentInfosFor($idCard->id,$this->attachmentTableName,'id'); - foreach($rosettaStone as $oid => $nid) - { - if($att[$nid]['is_image']) - { - $needle = str_replace($nid,$oid,$att[$nid]['inlineString']); - $inlineImg[] = array('needle' => $needle, 'rep' => $att[$nid]['inlineString']); - } - } - - if( !is_null($inlineImg) ) - { - $dex = $scope; - foreach($inlineImg as $elem) - { - $dex = str_replace($elem['needle'],$elem['rep'],$dex); - } - $this->updateScope($idCard->versionID,$dex); - } - } - - /** - * - */ - function monitorOn($req_id,$user_id,$tproject_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // simple checks - // key = column name!! - $safe = array(); - $safe['req_id'] = intval($req_id); - $safe['user_id'] = intval($user_id); - $safe['testproject_id'] = intval($tproject_id); - - $fields = implode(',',array_keys($safe)); - - foreach($safe as $key => $val) - { - if( $val <= 0 ) - { - throw new Exception("$key invalid value", 1); - } - } - - try - { - // check before insert - $sql = "/* $debugMsg */ " . - " SELECT req_id FROM {$this->tables['req_monitor']} " . - " WHERE req_id = {$safe['req_id']} " . - " AND user_id = {$safe['user_id']} " . - " AND testproject_id = {$safe['testproject_id']}"; - $rs = $this->db->get_recordset($sql); - - if( is_null($rs) ) - { - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['req_monitor']} ($fields) " . - " VALUES ({$safe['req_id']},{$safe['user_id']},{$safe['testproject_id']})"; - $this->db->exec_query($sql); - } - } - catch (Exception $e) - { - echo $e->getMessage(); - } - } - - /** - * - */ - function monitorOff($req_id,$user_id=null,$tproject_id=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // simple checks - $safe = array(); - $safe['req_id'] = intval($req_id); - $safe['user_id'] = intval($user_id); - $safe['tproject_id'] = intval($tproject_id); - - $key2check = array('req_id'); - foreach($key2check as $key) - { - $val = $safe[$key]; - if( $val <= 0 ) - { - throw new Exception("$key invalid value", 1); - } - } - - // Blind delete - try - { - $sql = "/* $debugMsg */ " . - " DELETE FROM {$this->tables['req_monitor']} " . - " WHERE req_id = {$safe['req_id']} "; - - if($safe['user_id'] >0) - { - $sql .= " AND user_id = {$safe['user_id']} "; - } - - if($safe['tproject_id'] >0) - { - $sql .= " AND testproject_id = {$safe['tproject_id']}"; - } - $this->db->exec_query($sql); - } - catch (Exception $e) - { - echo $e->getMessage(); - } - } - - /** - * - */ - function getMonitoredByUser($user_id,$tproject_id,$opt=null,$filters=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('reqSpecID' => null); - $my['filters'] = array(); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - $my['filters'] = array_merge($my['opt'],(array)$filters); - - // simple checks - $safe = array(); - $safe['user_id'] = intval($user_id); - $safe['tproject_id'] = intval($tproject_id); - - foreach($safe as $key => $val) - { - if( $val <= 0 ) - { - throw new Exception("$key invalid value", 1); - } - } - - $rs = null; - - if( is_null($my['opt']['reqSpecID']) ) - { - $sql = "/* $debugMsg */ " . - " SELECT RQM.* FROM {$this->tables['req_monitor']} RQM " . - " WHERE RQM.user_id = {$safe['user_id']} " . - " AND RQM.testproject_id = {$safe['tproject_id']}"; - } - else - { - $sql = "/* $debugMsg */ " . - " SELECT RQM.* FROM {$this->tables['req_monitor']} RQM " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ " . - " ON NH_REQ.id = RQM.req_id " . - " WHERE RQM.user_id = {$safe['user_id']} " . - " AND RQM.testproject_id = {$safe['tproject_id']} " . - " AND NH_REQ.parent_id = " . intval($my['opt']['reqSpecID']); - } - - try - { - $rs = $this->db->fetchRowsIntoMap($sql,'req_id'); - } - catch (Exception $e) - { - echo $e->getMessage(); - } - - - - - return $rs; - } - - /** - * - * - */ - function getReqMonitors($req_id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('tproject_id' => 0, 'output' => 'map'); - $options = array_merge($options,(array)$opt); - - // simple checks - $safe = array(); - $safe['req_id'] = intval($req_id); - $safe['tproject_id'] = intval($options['tproject_id']); - - $sql = "/* $debugMsg */ " . - " SELECT RMON.user_id,U.login,U.email,U.locale " . - " FROM {$this->tables['req_monitor']} RMON " . - " JOIN {$this->tables['users']} U " . - " ON U.id = RMON.user_id ". - " WHERE req_id = {$safe['req_id']} "; - - if($safe['tproject_id'] > 0) - { - $sql .= " AND testproject_id = {$safe['tproject_id']}"; - } - - switch($options['output']) - { - case 'array': - $rs = $this->db->get_recordset($sql); - break; - - case 'map': - default: - $rs = $this->db->fetchRowsIntoMap($sql,'user_id'); - break; - } - return $rs; - } - - /** - * - */ - function notifyMonitors($req_id,$action,$user_id,$log_msg=null) - { - static $user; - $mailBodyCache = ''; - $mailSubjectCache = ''; - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe = array(); - $safe['req_id'] = intval($req_id); - - // who is monitoring? - $iuSet = $this->getReqMonitors($safe['req_id']); - if( is_null($iuSet) ) - { - return; - } - - if( !$user ) - { - $user = new tlUser($this->db); - } - - $author = $user->getNames($this->db,$user_id); - $author = $author[$user_id]; - $idCard = $author['login'] . - " ({$author['first']} {$author['last']})"; - - // use specific query because made things simpler - $sql = "/* $debugMsg */ " . - " SELECT REQ.id,REQ.req_doc_id,REQV.scope," . - " NH_REQ.name AS title, REQV.version " . - " FROM {$this->object_table} REQ " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id ". - " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . - " WHERE REQ.id = {$safe['req_id']} " . - " ORDER BY REQV.version DESC "; - - if( !is_null($rs = $this->db->get_recordset($sql)) ) - { - $req = $rs[0]; - } - - $mailCfg = $this->getMonitorMailCfg($action); - - $from = config_get('from_email'); - $trf = array("%docid%" => $req['req_doc_id'], - "%title%" => $req['title'], - "%scope%" => $req['scope'], - "%user%" => $idCard, - "%logmsg%" => $log_msg, - "%version%" => $req['version'], - "%timestamp%" => date("D M j G:i:s T Y")); - $body['target'] = array_keys($trf); - $body['values'] = array_values($trf); - $subj['target'] = array_keys($trf); - $subj['values'] = array_values($trf); - - foreach($iuSet as $ue) - { - if( !isset($mailBodyCache[$ue['locale']]) ) - { - $lang = $ue['locale']; - $mailBodyCache[$lang] = mailBodyGet($mailCfg['bodyAccessKey']); - - // set values - $mailBodyCache[$lang] = - str_replace($body['target'],$body['values'],$mailBodyCache[$lang]); - - $mailSubjectCache[$lang] = - lang_get($mailCfg['subjectAccessKey'],$lang); - - $mailSubjectCache[$lang] = - str_replace($subj['target'],$subj['values'],$mailSubjectCache[$lang]); - - } - - // send mail - $auditMsg = 'Requirement - ' . $action . ' - mail to user: ' . $ue["login"] . - ' using address:' . $ue["email"]; - try - { - $xmail = array(); - $xmail['cc'] = ''; - $xmail['attachment'] = null; - $xmail['exit_on_error'] = false; - $xmail['htmlFormat'] = true; - - - $rmx = @email_send($from,$ue["email"], - $mailSubjectCache[$ue['locale']],$mailBodyCache[$ue['locale']], - $xmail['cc'],$xmail['attachment'],$xmail['exit_on_error'], - $xmail['htmlFormat'],null); - $apx = $rmx->status_ok ? 'Succesful - ' : 'ERROR -'; - } - catch (Exception $e) - { - $apx = 'ERROR - '; - } - $auditMsg = $apx . $auditMsg; - logAuditEvent($auditMsg); - } - } - - /** - * - */ - function getMonitorMailCfg($action) { - $cfg = null; - switch( $action ) { - case 'create_new_version': - $cfg['subjectAccessKey'] = 'mail_subject_req_new_version'; - $cfg['bodyAccessKey'] = 'requirements/req_create_new_version.txt'; - break; - - case 'delete': - $cfg['subjectAccessKey'] = 'mail_subject_req_delete'; - $cfg['bodyAccessKey'] = 'requirements/req_delete.txt'; - break; - - case 'delete_version': - $cfg['subjectAccessKey'] = 'mail_subject_req_delete_version'; - $cfg['bodyAccessKey'] = 'requirements/req_delete_version.txt'; - break; - } - return $cfg; - } - - /** - * - */ - function setNotifyOn($cfg) - { - foreach($cfg as $key => $val) - { - $this->notifyOn[$key] = $val; - } - } - - /** - * - */ - function getNotifyOn($key=null) { - if( !is_null($key) && isset($this->notifyOn['key']) ) { - return $this->notifyOn['key']; - } - return $this->notifyOn; - } - - /** - * - */ - function updateCoverage($link,$whoWhen,$opt=null) { - - // Set coverage for previous version to FROZEN & INACTIVE ? - // Create coverage for NEW Version - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('freezePrevious' => true); - $options = array_merge($options,(array)$opt); - - $safeF = intval($link['source']); - $safeT = intval($link['dest']); - - // Set coverage for previous version to FROZEN & INACTIVE ? - if( $options['freezePrevious'] ) { - $sql = " /* $debugMsg */ " . - " UPDATE {$this->tables['req_coverage']} " . - " SET link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION . "," . - " is_active=0 " . - " WHERE req_version_id=" . $safeF; - $this->db->exec_query($sql); - } - - // Create coverage for NEW Version - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['req_coverage']} " . - " (testcase_id,tcversion_id,req_id," . - " req_version_id,author_id,creation_ts) " . - - " SELECT testcase_id,tcversion_id,req_id, " . - " {$safeT} AS req_version_id," . - " {$whoWhen['user_id']} AS author_id, " . - " {$whoWhen['when']} AS creation_ts" . - " FROM {$this->tables['req_coverage']} " . - " WHERE req_version_id=" . $safeF; - $this->db->exec_query($sql); - - } - - - /** - * - */ - function updateTCVLinkStatus($from_version_id,$reason) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safeF = intval($from_version_id); - - $sql = " /* $debugMsg */ " . - " UPDATE {$this->tables['req_coverage']} " . - " SET link_status = " . $reason . "," . - " is_active=0 " . - " WHERE req_version_id=" . $safeF; - $this->db->exec_query($sql); - - } - - - /** - * - */ - function getAllReqVersionIDForReq( $idSet ) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $idList = implode(",", (array)$idSet); - $sql = " /* $debugMsg */ - SELECT REQ.id AS req_id, NHREQVER.id AS req_version_id - FROM {$this->object_table} REQ - JOIN {$this->tables['nodes_hierarchy']} NHREQVER - ON NHREQVER.parent_id = REQ.id "; - $sql .= " WHERE REQ.id IN ($idList)"; - - return $this->db->fetchColumnsIntoMap( - $sql,'req_id','req_version_id',database::CUMULATIVE); - - - } - - - /** - * - */ - function getActiveForTCVersion($tcversion_id, $srs_id = 'all') { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ " . - " SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id,NHREQ.name AS title, RCOV.is_active," . - " NHRS.name AS req_spec_title,RCOV.testcase_id," . - " REQV.id AS req_version_id, REQV.version " . - " FROM {$this->object_table} REQ " . - " JOIN {$this->tables['req_specs']} RSPEC " . - " ON REQ.srs_id = RSPEC.id " . - " JOIN {$this->tables['req_coverage']} RCOV " . - " ON RCOV.req_id = REQ.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHRS " . - " ON NHRS.id=RSPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHREQ " . - " ON NHREQ.id=REQ.id " . - " JOIN {$this->tables['req_versions']} REQV " . - " ON RCOV.req_version_id=REQV.id "; - - $idList = implode(",",(array)$tcversion_id); - - $sql .= " WHERE RCOV.tcversion_id IN (" . $idList . ")" . - " AND RCOV.is_active=1 "; - - // if only for one specification is required - if ($srs_id != 'all') { - $sql .= " AND REQ.srs_id=" . intval($srs_id); - } - - if ( is_array($tcversion_id) ) { - return $this->db->fetchRowsIntoMap($sql,'tcversion_id',true); - } - else { - return $this->db->get_recordset($sql); - } - } - - /** - * what is meaning of Good? - * - */ - function getGoodForTCVersion($tcversion_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ " . - " SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id, + REQRV.active," . + " REQRV.is_open,REQRV.author_id,REQV.version,REQRV.parent_id AS version_id," . + " REQRV.expected_coverage,REQRV.creation_ts,REQRV.modifier_id," . + " REQRV.modification_ts,REQRV.revision, REQRV.id AS revision_id," . + " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . + " FROM {$this->tables['req_revisions']} REQRV " . + " JOIN {$this->tables['req_versions']} REQV ON REQV.id = REQRV.parent_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQRV.parent_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + " WHERE REQRV.id = " . intval($revision_id); + $dummy = $this->db->get_recordset($sql); + + if (! is_null($dummy)) { + $this->decode_users($dummy); + $dummy = $dummy[0]; + } + + if (! is_null($dummy) && $my['opt']['renderImageInline']) { + $this->renderImageAttachments($dummy['id'], $dummy); + } + + return $dummy; + } + + /** + * get info regarding a req version, using also revision as access criteria. + * + * @int version_id + * @array revision_access possible keys 'id', 'number' + * + * @uses print.inc.php + * @uses renderReqForPrinting() + * + * + */ + public function get_version_revision($version_id, $revision_access, + $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['opt'] = array( + 'renderImageInline' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "/* $debugMsg */"; + + if (isset($revision_access['number'])) { + $rev_number = intval($revision_access['number']); + + // we have to tables to search on + // Req Versions -> holds LATEST revision + // Req Revisions -> holds other revisions + $sql .= " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version," . + " REQV.creation_ts, REQV.author_id, " . + " REQV.modification_ts, REQV.modifier_id, " . + self::NO_REVISION . " AS revision_id, " . + " REQV.revision, REQV.scope, " . + " REQV.status,REQV.type,REQV.expected_coverage,NH_REQ.name, REQ.req_doc_id, " . + " COALESCE(REQV.log_message,'') AS log_message, NH_REQ.name AS title " . + " FROM {$this->tables['req_versions']} REQV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " WHERE NH_REQV.id = {$version_id} AND REQV.revision = {$rev_number} "; + + $sql .= " UNION ALL ( " . + " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version, " . + " REQRV.creation_ts, REQRV.author_id, " . + " REQRV.modification_ts, REQRV.modifier_id, " . + " REQRV.id AS revision_id, " . + " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . + " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . + " COALESCE(REQRV.log_message,'') as log_message, NH_REQ.name AS title " . + " FROM {$this->tables['req_versions']} REQV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " JOIN {$this->tables['req_revisions']} REQRV " . + " ON REQRV.parent_id = REQV.id " . + " WHERE NH_REQV.id = {$version_id} AND REQRV.revision = {$rev_number} ) "; + } else { + // revision_id is present ONLY on req revisions table, then we do not need UNION + $sql .= " SELECT NH_REQV.parent_id AS req_id, REQV.id AS version_id, REQV.version, " . + " REQRV.creation_ts, REQRV.author_id, " . + " REQRV.modification_ts, REQRV.modifier_id, " . + " REQRV.id AS revision_id, " . + " REQRV.revision,REQRV.scope,REQRV.status,REQRV.type, " . + " REQRV.expected_coverage,REQRV.name,REQRV.req_doc_id, " . + " COALESCE(REQRV.log_message,'') as log_message, NH_REQ.name AS title " . + " FROM {$this->tables['req_versions']} REQV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.id = REQV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['requirements']} REQ ON REQ.id = NH_REQ.id " . + " JOIN {$this->tables['req_revisions']} REQRV " . + " ON REQRV.parent_id = REQV.id " . + " WHERE NH_REQV.id = {$version_id} AND REQRV.revision_id = " . + intval($revision_access['id']); + } + + $rs = $this->db->get_recordset($sql); + + if (! is_null($rs) && $my['opt']['renderImageInline']) { + $k2l = array_keys($rs); + foreach ($k2l as $akx) { + $this->renderImageAttachments($rs[$akx]['req_id'], $rs[$akx]); + } + reset($rs); + } + return $rs; + } + + /** + */ + private function decode_users(&$rs) + { + $userCache = null; // key: user id, value: display name + $key2loop = array_keys($rs); + $labels['undefined'] = lang_get('undefined'); + $user_keys = array( + 'author' => 'author_id', + 'modifier' => 'modifier_id' + ); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$key][$ukey] = ''; + if (trim($rs[$key][$userid_field]) != "") { + if (! isset($userCache[$rs[$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$key][$userid_field]); + $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; + } else { + $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; + } + } + } + } + } + + /** + */ + private function generateUniqueTitle($title2check, $parent_id, $tproject_id) + { + static $fieldSize; + static $getOptions; + static $reqCfg; + static $mask; + static $title_max_len; + + if (! $fieldSize) { + $fieldSize = config_get('field_size'); + $reqCfg = config_get('req_cfg'); + + $mask = $reqCfg->duplicated_name_algorithm->text; + $title_max_len = $fieldSize->requirement_title; + + $getOptions = array( + 'output' => 'minimun', + 'check_criteria' => 'likeLeft' + ); + } + + $generated = $title2check; + $attr = array( + 'key' => 'title', + 'value' => $title2check + ); + + // search need to be done in like to the left + $itemSet = $this->getByAttribute($attr, $tproject_id, $parent_id, + $getOptions); + + // we borrow logic (may be one day we can put it on a central place) from + // testcase class create_tcase_only() + if (! is_null($itemSet) && ($siblingQty = count($itemSet)) > 0) { + $nameSet = array_flip(array_keys($itemSet)); + $target = $title2check . ($suffix = sprintf($mask, ++ $siblingQty)); + $final_len = strlen($target); + if ($final_len > $title_max_len) { + $target = substr($target, strlen($suffix), $title_max_len); + } + // Need to recheck if new generated name does not crash with existent name + // why? Suppose you have created: + // REQ [1] + // REQ [2] + // REQ [3] + // Then you delete REQ [2]. + // When I got siblings il will got 2 siblings, if I create new progressive using next, + // it will be 3 => I will get duplicated name. + while (isset($nameSet[$target])) { + $target = $title2check . + ($suffix = sprintf($mask, ++ $siblingQty)); + $final_len = strlen($target); + if ($final_len > $title_max_len) { + $target = substr($target, strlen($suffix), $title_max_len); + } + } + $generated = $target; + } + + return $generated; + } + + /** + */ + public function getTestProjectID($id, $reqSpecID = null) + { + $reqSpecMgr = new requirement_spec_mgr($this->db); + $parent = $reqSpecID; + if (is_null($parent)) { + $dummy = $this->tree_mgr->get_node_hierarchy_info($id); + $parent = $dummy['parent_id']; + } + $target = $reqSpecMgr->get_by_id($parent); + return $target['testproject_id']; + } + + /** + * + * @param array $context + * with following keys + * tproject_id => REQUIRED + * tplan_id => OPTIONAL + * platform_id => OPTIONAL, will be used ONLY if tplan_id is provided. + * @param unknown $opt + * @return array + */ + public function getAllByContext($context, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + if (! isset($context['tproject_id'])) { + throw new Exception( + $debugMsg . ' : $context[\'tproject_id\'] is needed'); + } + + $where = "WHERE RSPEC.testproject_id = " . + intval($context['tproject_id']); + $sql = "/* $debugMsg */ " . + "SELECT DISTINCT REQ.id,REQ.req_doc_id FROM {$this->tables['requirements']} REQ " . + "JOIN {$this->tables['req_specs']} RSPEC ON RSPEC.id = REQ.srs_id "; + + if (isset($context['tplan_id'])) { + + $sql .= "JOIN {$this->tables['req_coverage']} REQCOV ON REQCOV.req_id = REQ.id " . + "JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = REQCOV.testcase_id " . + "JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id "; + + $where .= " AND TPTCV.testplan_id = " . intval($context['tplan_id']); + if (isset($context['platform_id']) && + intval($context['platform_id']) > 0) { + $where .= " AND TPTCV.platform_id = " . + intval($context['platform_id']); + } + } + + $sql .= $where; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * + * @used-by + */ + public function getFileUploadRelativeURL($req_id, $req_version_id) + { + $sfReqID = intval($req_id); + $sfVersion = intval($req_version_id); + + return "lib/requirements/reqEdit.php" . + "?doAction=fileUpload&requirement_id=" . $sfReqID . "&req_id=" . + $sfReqID . "&req_version_id=" . $sfVersion; + } + + /** + * + * @used-by + */ + public function getDeleteAttachmentRelativeURL($req_id, $req_version_id) + { + return "lib/requirements/reqEdit.php?doAction=deleteFile" . + "&requirement_id=" . intval($req_id) . "&req_version_id=" . + intval($req_version_id) . "&file_id="; + } + + /** + * exportRelationToXML + * + * Function to export a requirement relation to XML. + * + * @param int $relation + * relation data array + * @param string $troject_id + * @param + * boolean check_for_req_project + * + * @return string with XML code + * + * doc_id + * prj + * doc2_id + * prj2 + * 0 + * + * + * @internal revisions + * + */ + public function exportRelationToXML($relation, $tproject_id = null, + $check_for_req_project = false) + { + $xmlStr = ''; + $source_docid = null; + $destination_docid = null; + $source_project = null; + $destination_project = null; + + if (! is_null($relation)) { + // FRL : interproject linking support + $tproject_mgr = new testproject($this->db); + $reqs = $this->get_by_id($relation['source_id'], + requirement_mgr::LATEST_VERSION); + if (! empty($reqs)) { + $source_docid = $reqs[0]['req_doc_id']; + if ($check_for_req_project) { + $tproject = $tproject_mgr->get_by_id( + $reqs[0]['testproject_id']); + if ($tproject['id'] != $tproject_id) { + $source_project = $tproject['name']; + } + } + } + + $reqs = $this->get_by_id($relation['destination_id'], + requirement_mgr::LATEST_VERSION); + if (! empty($reqs)) { + $destination_docid = $reqs[0]['req_doc_id']; + if ($check_for_req_project) { + $tproject = $tproject_mgr->get_by_id( + $reqs[0]['testproject_id']); + if ($tproject['id'] != $tproject_id) { + $destination_project = $tproject['name']; + } + } + } + + if (! is_null($source_docid) && ! is_null($destination_docid)) { + $relation['source_doc_id'] = $source_docid; + $relation['destination_doc_id'] = $destination_docid; + + $info = array( + "||SOURCE||" => "source_doc_id", + "||DESTINATION||" => "destination_doc_id", + "||TYPE||" => "relation_type" + ); + + $elemTpl = "\t" . "" . "\n\t\t" . + "||SOURCE||"; + if (! is_null($source_project)) { + $elemTpl .= "\n\t\t" . + "||SRC_PROJECT||"; + $relation['source_project'] = $source_project; + $info["||SRC_PROJECT||"] = "source_project"; + } + + $elemTpl .= "\n\t\t" . + "||DESTINATION||"; + if (! is_null($destination_project)) { + $elemTpl .= "\n\t\t" . + "||DST_PROJECT||"; + $relation['destination_project'] = $destination_project; + $info["||DST_PROJECT||"] = "destination_project"; + } + $elemTpl .= "\n\t\t" . "||TYPE||" . "\n\t" . + "" . "\n"; + + $relations[] = $relation; + $xmlStr = exportDataToXML($relations, "{{XMLCODE}}", $elemTpl, + $info, true); + } + } + + return $xmlStr; + } + + /** + * Converts a XML relation into a Map that represents relation. + * + * The XML should be in the following format: + * + * + * doc_id + * prj + * doc2_id + * prj2 + * 0 + * + * + * And here is an example of an output map of this function. + * + * [ + * 'source_doc_id' => 'doc_id', + * 'destination_doc_id' => 'doc2_id', + * 'type'=> 0, + * 'source_id' => 100, + * 'destination_id' => 101 + * ] + * + * The source_id and the destination_id are set here to null but are used in + * other parts of the system. When you add a relation to the database you + * have to provide the source_id and destination_id. + * + * @internal revisions + * 20120110 - frl - add project info if interproject_linking is set + * 20110314 - kinow - Created function. + */ + public function convertRelationXmlToRelationMap($xml_item) + { + // Attention: following PHP Manual SimpleXML documentation, Please remember to cast + // before using data from $xml, + if (is_null($xml_item)) { + return null; + } + + $dummy = array(); + foreach ($xml_item->attributes() as $key => $value) { + $dummy[$key] = (string) $value; // See PHP Manual SimpleXML documentation. + } + + $dummy['source_doc_id'] = (string) $xml_item->source; + $dummy['destination_doc_id'] = (string) $xml_item->destination; + $dummy['type'] = (string) $xml_item->type; + $dummy['source_id'] = null; + $dummy['destination_id'] = null; + // FRL : interproject linking support + $dummy['source_tproject'] = property_exists($xml_item, 'source_project') ? (string) $xml_item->source_project : null; + $dummy['destination_tproject'] = property_exists($xml_item, + 'destination_project') ? (string) $xml_item->destination_project : null; + + return $dummy; + } + + /** + * This function receives a relation XML node, converts it into a map and + * then adds this relation to database if it doesn't exist yet. + * + * @internal revisions + * 20110314 - kinow - Created function. + * @todo delete the unused function if necessary + */ + private function createRelationFromXML($xml, $tproject_id, $author_id) + { + $relationAsMap = $this->convertRelationXmlToRelationMap($xml); + return $this->createRelationFromMap($relationAsMap, $tproject_id, + $author_id); + } + + /** + * Adds a relation into database. + * Before adding it checks whether it + * exists or not. If it exists than the relation is not added, otherwise + * it is. + * + * Map structure + * source_doc_id => doc_id + * destination_doc_id => doc_id + * type => 10 + * source_id => 0 + * destination_id = 0 + * + * @internal revisions + * 20110314 - kinow - Created function. + */ + public function createRelationFromMap($rel, $tproject_id, $authorId) + { + // get internal source id / destination id + $options = array( + 'access_key' => 'req_doc_id', + 'output' => 'minimun' + ); + $reqs = null; + $source_doc_id = $rel['source_doc_id']; + + // FRL : interproject linking support (look for req in defined project and req must be found + // in current project if interproject_linking is not set) + $reqs = $this->getByDocIDInProject($source_doc_id, + $rel['source_tproject'], $tproject_id, null, $options); + $source = (! is_null($reqs)) ? $reqs[$source_doc_id] : null; + if (! is_null($source) && + ($this->relationsCfg->interProjectLinking || + $source['testproject_id'] == $tproject_id)) { + $rel['source_id'] = $source['id']; + } + + $destination_doc_id = $rel['destination_doc_id']; + $reqs = $this->getByDocIDInProject($destination_doc_id, + $rel['destination_tproject'], $tproject_id, null, $options); + $destination = (! is_null($reqs)) ? $reqs[$destination_doc_id] : null; + if (! is_null($destination) && + ($this->relationsCfg->interProjectLinking || + $destination['testproject_id'] == $tproject_id)) { + $rel['destination_id'] = $destination['id']; + } + + // 2 - check if relation is valid + $source_id = $rel['source_id']; + $destination_id = $rel['destination_id']; + $source_doc_id .= (is_null($rel['source_tproject']) ? '' : (' [' . + $rel['source_tproject'] . ']')); + $destination_doc_id .= (is_null($rel['destination_tproject']) ? '' : (' [' . + $rel['destination_tproject'] . ']')); + $rel_types_desc = config_get('req_cfg')->rel_type_description; + + // check if given type is a valid one for rel_type_description defined in config + $type_desc = array_key_exists(intval($rel['type']), $rel_types_desc) ? $rel_types_desc[intval( + $rel['type'])] : null; + $user_feedback = array( + 'doc_id' => $source_doc_id . ' - ' . $destination_doc_id, + 'title' => lang_get('relation_type') . ' : ' . + (is_null($type_desc) ? $rel['type'] : $type_desc) + ); + + if (is_null($source_id)) { + $user_feedback['import_status'] = lang_get('rel_add_error_src_id') . + " [" . $source_doc_id . "]."; + } elseif (is_null($destination_id)) { + $user_feedback['import_status'] = lang_get('rel_add_error_dest_id') . + " [" . $destination_doc_id . "]."; + } elseif ($source_id == $destination_id) { + $user_feedback['import_status'] = lang_get('rel_add_error_self'); + } elseif (($source['testproject_id'] != $tproject_id) && + ($destination['testproject_id'] != $tproject_id)) { + $user_feedback['import_status'] = lang_get('rel_add_not_in_project'); + } elseif (is_null($type_desc)) { + $user_feedback['import_status'] = lang_get('rel_add_invalid_type'); + } elseif ($this->check_if_relation_exists($source_id, $destination_id, + $rel['type'])) { + $user_feedback['import_status'] = sprintf( + lang_get('rel_add_error_exists_already'), $type_desc); + } else // all checks are ok => create it + { + $this->add_relation($source_id, $destination_id, $rel['type'], + $authorId); + $user_feedback['import_status'] = lang_get('new_rel_add_success'); + } + + return array( + $user_feedback + ); + } + + /** + * This function retrieves a requirement by doc_id with a specifed project + * + * @param string $doc_id + * @param string $req_project + * name of req's project + * @param string $tproject_id + * used only if $req_project is null + * @param string $parent_id + * @param array $options + * (same as original $options getByDocID method) + * + * @internal revisions + * 20110314 - kinow - Created function. + */ + private function getByDocIDInProject($doc_id, $req_project = null, + $tproject_id = null, $parent_id = null, $options = null) + { + $reqs = null; + if (! is_null($req_project)) { + $tproject_mgr = new testproject($this->db); + $info = $tproject_mgr->get_by_name($req_project); + if (! is_null($info)) // is project found ? + { + $tproject_id = $info[0]['id']; + $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, + $options); + } + // else $req = null; // project not found => no req + } else { + $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, + $options); + } + return $reqs; + } + + /* + * function: getByIDBulkLatestVersionRevision + * + * @used by reqOverView + * + * args: id: requirement id (can be an array) + * [version_id]: requirement version id (can be an array) + * [version_number]: + * [options] + * + * + * returns: null if query fails + * map with requirement info + * + * @internal revisions + * @since 1.9.12 + */ + public function getByIDBulkLatestVersionRevision($id, $opt = null) + { + static $debugMsg; + static $userCache; // key: user id, value: display name + static $user_keys; + + if (! $debugMsg) { + $debugMsg = $this->debugMsg . __FUNCTION__; + $labels['undefined'] = lang_get('undefined'); + $user_keys = array( + 'author' => 'author_id', + 'modifier' => 'modifier_id' + ); + } + + $my['opt'] = array( + 'outputFormat' => 'map' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $in_clause = "IN (" . implode(",", (array) $id) . ") "; + $where_clause = " WHERE NH_REQV.parent_id " . $in_clause; + + // added -1 AS revision_id to make some process easier + $sql = " /* $debugMsg */ SELECT REQ.id,REQ.srs_id,REQ.req_doc_id," . + " REQV.scope,REQV.status,REQV.type,REQV.active," . + " REQV.is_open,REQV.author_id,REQV.version,REQV.id AS version_id," . + " REQV.expected_coverage,REQV.creation_ts,REQV.modifier_id," . + " REQV.modification_ts,REQV.revision, -1 AS revision_id, " . + " NH_REQ.name AS title, REQ_SPEC.testproject_id, " . + " NH_RSPEC.name AS req_spec_title, REQ_SPEC.doc_id AS req_spec_doc_id, NH_REQ.node_order " . + " FROM {$this->tables['nodes_hierarchy']} NH_REQV JOIN " . + "( SELECT XNH_REQV.parent_id,MAX(XNH_REQV.id) AS LATEST_VERSION_ID " . + " FROM {$this->tables['nodes_hierarchy']} XNH_REQV " . + " WHERE XNH_REQV.parent_id {$in_clause} " . + " GROUP BY XNH_REQV.parent_id ) ZAZA ON NH_REQV.id = ZAZA.LATEST_VERSION_ID " . + " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . + " JOIN {$this->object_table} REQ ON REQ.id = NH_REQV.parent_id " . + " JOIN {$this->tables['req_specs']} REQ_SPEC ON REQ_SPEC.id = REQ.srs_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC ON NH_RSPEC.id = REQ_SPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + $where_clause; + + $sqlOpt = ($my['opt']['outputFormat'] == 'map' ? 0 : database::CUMULATIVE); + $recordset = $this->db->fetchRowsIntoMap($sql, 'id', $sqlOpt); + + $rs = null; + + if (! is_null($recordset)) { + // Decode users + $rs = $recordset; + + // try to guess output structure + $x = array_keys(current($rs)); + if (is_int($x[0])) { + // output[REQID][0] = array('id' =>, 'xx' => ...) + $flevel = array_keys($recordset); + foreach ($flevel as $flk) { + $key2loop = array_keys($recordset[$flk]); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$flk][$key][$ukey] = ''; + if (trim($rs[$flk][$key][$userid_field]) != "") { + if (! isset( + $userCache[$rs[$flk][$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$flk][$key][$userid_field]); + $rs[$flk][$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$flk][$key][$userid_field]] = $rs[$flk][$key][$ukey]; + unset($user); + } else { + $rs[$flk][$key][$ukey] = $userCache[$rs[$flk][$key][$userid_field]]; + } + } + } + } + } + } else { + // output[REQID] = array('id' =>, 'xx' => ...) + $key2loop = array_keys($recordset); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$key][$ukey] = ''; + if (trim($rs[$key][$userid_field]) != "") { + if (! isset($userCache[$rs[$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$key][$userid_field]); + $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; + unset($user); + } else { + $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; + } + } + } + } + } + } + + unset($recordset); + unset($my); + unset($dummy); + + return $rs; + } + + /** + * + * @internal revisions + * @since 1.9.12 + * @todo delete the unused function if necessary + */ + private function getCoverageCounter($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safe_id = intval($id); + $sql = "/* $debugMsg */ " . " SELECT COUNT(0) AS qty " . + " FROM {$this->tables['req_coverage']} " . " WHERE req_id = " . + $safe_id; + + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + /** + * + * @internal revisions + * @since 1.9.12 + * @todo delete the unused function if necessary + */ + private function getCoverageCounterSet($itemSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT req_id, COUNT(0) AS qty " . + " FROM {$this->tables['req_coverage']} " . " WHERE req_id IN (" . + implode(',', $itemSet) . ")" . " GROUP BY req_id "; + + return $this->db->fetchRowsIntoMap($sql, 'req_id'); + } + + /** + * + * @internal revisions + * @since 1.9.12 + */ + public function getRelationsCounters($itemSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $inSet = implode(',', $itemSet); + $sqlS = "/* $debugMsg */ SELECT COUNT(*) AS qty, source_id AS req_id " . + " FROM {$this->tables['req_relations']} " . + " WHERE source_id IN ({$inSet}) "; + $sqlS .= (DB_TYPE == 'mssql') ? ' GROUP BY source_id ' : ' GROUP BY req_id '; + + $sqlD = "/* $debugMsg */ SELECT COUNT(*) AS qty, destination_id AS req_id " . + " FROM {$this->tables['req_relations']} " . + " WHERE destination_id IN ({$inSet}) "; + $sqlD .= (DB_TYPE == 'mssql') ? ' GROUP BY destination_id ' : ' GROUP BY req_id '; + + $sqlT = " SELECT SUM(qty) AS qty, req_id " . + " FROM ($sqlS UNION ALL $sqlD) D " . ' GROUP BY req_id '; + + return $this->db->fetchColumnsIntoMap($sqlT, 'req_id', 'qty'); + } + + /** + */ + private function updateScope($reqVersionID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = "/* $debugMsg */ UPDATE {$this->tables['req_versions']} " . + " SET scope='" . $this->db->prepare_string($scope) . "'" . + " WHERE id=" . intval($reqVersionID); + $this->db->exec_query($sql); + } + + /** + * render Image Attachments INLINE + */ + public function renderImageAttachments($id, &$item2render, $basehref = null) + { + static $attSet; + + $version_id = intval($item2render['version_id']); + if (! $attSet || ! isset($attSet[$id])) { + $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor( + $version_id, $this->attachmentTableName, 'id'); + $beginTag = '[tlInlineImage]'; + $endTag = '[/tlInlineImage]'; + } + + if (is_null($attSet[$id])) { + return; + } + + // $href = '%s:%s' . " $versionTag (link)

    "; + // second \'%s\' needed if I want to use Latest as indication, need to understand + // Javascript instead of javascript, because CKeditor sometimes complains + $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; + $img = '

    '; + + $key2check = array( + 'scope' + ); + $rse = &$item2render; + foreach ($key2check as $item_key) { + $start = strpos($rse[$item_key], $beginTag); + $ghost = $rse[$item_key]; + + // There is at least one request to replace ? + if (! $start && ! empty($beginTag)) { + $xx = explode($beginTag, $rse[$item_key]); + + // How many requests to replace ? + $xx2do = count($xx); + $ghost = ''; + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + // Hope was not a false request. + if (strpos($xx[$xdx], $endTag) !== false) { + // Separate command string from other text + // Theorically can be just ONE, but it depends + // is user had not messed things. + $yy = explode($endTag, $xx[$xdx]); + if (! empty($yy)) { + $atx = $yy[0]; + try { + if (isset($attSet[$id][$atx]) && + $attSet[$id][$atx]['is_image']) { + $ghost .= str_replace('%id%', $atx, $img); + } + $lim = count($yy) - 1; + for ($cpx = 1; $cpx <= $lim; $cpx ++) { + $ghost .= $yy[$cpx]; + } + } catch (Exception $e) { + $ghost .= $rse[$item_key]; + } + } + } else { + // nothing to do + $ghost .= $xx[$xdx]; + } + } + } + + // reconstruct field contents + if ($ghost != '') { + $rse[$item_key] = $ghost; + } + } + } + + /** + * scope is managed at revision and version level + * + * @since 1.9.13 + * @todo delete the unused function if necessary + */ + private function inlineImageProcessing($idCard, $scope, $rosettaStone) + { + // get all attachments, then check is there are images + $att = $this->attachmentRepository->getAttachmentInfosFor($idCard->id, + $this->attachmentTableName, 'id'); + foreach ($rosettaStone as $oid => $nid) { + if ($att[$nid]['is_image']) { + $needle = str_replace($nid, $oid, $att[$nid]['inlineString']); + $inlineImg[] = array( + 'needle' => $needle, + 'rep' => $att[$nid]['inlineString'] + ); + } + } + + if (! is_null($inlineImg)) { + $dex = $scope; + foreach ($inlineImg as $elem) { + $dex = str_replace($elem['needle'], $elem['rep'], $dex); + } + $this->updateScope($idCard->versionID, $dex); + } + } + + /** + */ + public function monitorOn($req_id, $user_id, $tproject_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + // simple checks + // key = column name!! + $safe = array(); + $safe['req_id'] = intval($req_id); + $safe['user_id'] = intval($user_id); + $safe['testproject_id'] = intval($tproject_id); + + $fields = implode(',', array_keys($safe)); + + foreach ($safe as $key => $val) { + if ($val <= 0) { + throw new Exception("$key invalid value", 1); + } + } + + try { + // check before insert + $sql = "/* $debugMsg */ " . + " SELECT req_id FROM {$this->tables['req_monitor']} " . + " WHERE req_id = {$safe['req_id']} " . + " AND user_id = {$safe['user_id']} " . + " AND testproject_id = {$safe['testproject_id']}"; + $rs = $this->db->get_recordset($sql); + + if (is_null($rs)) { + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['req_monitor']} ($fields) " . + " VALUES ({$safe['req_id']},{$safe['user_id']},{$safe['testproject_id']})"; + $this->db->exec_query($sql); + } + } catch (Exception $e) { + echo $e->getMessage(); + } + } + + /** + */ + public function monitorOff($req_id, $user_id = null, $tproject_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + // simple checks + $safe = array(); + $safe['req_id'] = intval($req_id); + $safe['user_id'] = intval($user_id); + $safe['tproject_id'] = intval($tproject_id); + + $key2check = array( + 'req_id' + ); + foreach ($key2check as $key) { + $val = $safe[$key]; + if ($val <= 0) { + throw new Exception("$key invalid value", 1); + } + } + + // Blind delete + try { + $sql = "/* $debugMsg */ " . + " DELETE FROM {$this->tables['req_monitor']} " . + " WHERE req_id = {$safe['req_id']} "; + + if ($safe['user_id'] > 0) { + $sql .= " AND user_id = {$safe['user_id']} "; + } + + if ($safe['tproject_id'] > 0) { + $sql .= " AND testproject_id = {$safe['tproject_id']}"; + } + $this->db->exec_query($sql); + } catch (Exception $e) { + echo $e->getMessage(); + } + } + + /** + */ + public function getMonitoredByUser($user_id, $tproject_id, $opt = null, + $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['opt'] = array( + 'reqSpecID' => null + ); + $my['filters'] = array(); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + $my['filters'] = array_merge($my['opt'], (array) $filters); + + // simple checks + $safe = array(); + $safe['user_id'] = intval($user_id); + $safe['tproject_id'] = intval($tproject_id); + + foreach ($safe as $key => $val) { + if ($val <= 0) { + throw new Exception("$key invalid value", 1); + } + } + + $rs = null; + + if (is_null($my['opt']['reqSpecID'])) { + $sql = "/* $debugMsg */ " . + " SELECT RQM.* FROM {$this->tables['req_monitor']} RQM " . + " WHERE RQM.user_id = {$safe['user_id']} " . + " AND RQM.testproject_id = {$safe['tproject_id']}"; + } else { + $sql = "/* $debugMsg */ " . + " SELECT RQM.* FROM {$this->tables['req_monitor']} RQM " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ " . + " ON NH_REQ.id = RQM.req_id " . + " WHERE RQM.user_id = {$safe['user_id']} " . + " AND RQM.testproject_id = {$safe['tproject_id']} " . + " AND NH_REQ.parent_id = " . intval($my['opt']['reqSpecID']); + } + + try { + $rs = $this->db->fetchRowsIntoMap($sql, 'req_id'); + } catch (Exception $e) { + echo $e->getMessage(); + } + + return $rs; + } + + /** + */ + public function getReqMonitors($req_id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'tproject_id' => 0, + 'output' => 'map' + ); + $options = array_merge($options, (array) $opt); + + // simple checks + $safe = array(); + $safe['req_id'] = intval($req_id); + $safe['tproject_id'] = intval($options['tproject_id']); + + $sql = "/* $debugMsg */ " . + " SELECT RMON.user_id,U.login,U.email,U.locale " . + " FROM {$this->tables['req_monitor']} RMON " . + " JOIN {$this->tables['users']} U " . " ON U.id = RMON.user_id " . + " WHERE req_id = {$safe['req_id']} "; + + if ($safe['tproject_id'] > 0) { + $sql .= " AND testproject_id = {$safe['tproject_id']}"; + } + + switch ($options['output']) { + case 'array': + $rs = $this->db->get_recordset($sql); + break; + + case 'map': + default: + $rs = $this->db->fetchRowsIntoMap($sql, 'user_id'); + break; + } + return $rs; + } + + /** + */ + private function notifyMonitors($req_id, $action, $user_id, $log_msg = null) + { + static $user; + $mailBodyCache = ''; + $mailSubjectCache = ''; + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safe = array(); + $safe['req_id'] = intval($req_id); + + // who is monitoring? + $iuSet = $this->getReqMonitors($safe['req_id']); + if (is_null($iuSet)) { + return; + } + + if (! $user) { + $user = new tlUser($this->db); + } + + $author = $user->getNames($this->db, $user_id); + $author = $author[$user_id]; + $idCard = $author['login'] . " ({$author['first']} {$author['last']})"; + + // use specific query because made things simpler + $sql = "/* $debugMsg */ " . " SELECT REQ.id,REQ.req_doc_id,REQV.scope," . + " NH_REQ.name AS title, REQV.version " . + " FROM {$this->object_table} REQ " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . + " JOIN {$this->tables['req_versions']} REQV ON REQV.id = NH_REQV.id " . + " WHERE REQ.id = {$safe['req_id']} " . " ORDER BY REQV.version DESC "; + + if (! is_null($rs = $this->db->get_recordset($sql))) { + $req = $rs[0]; + } + + $mailCfg = $this->getMonitorMailCfg($action); + + $from = config_get('from_email'); + $trf = array( + "%docid%" => $req['req_doc_id'], + "%title%" => $req['title'], + "%scope%" => $req['scope'], + "%user%" => $idCard, + "%logmsg%" => $log_msg, + "%version%" => $req['version'], + "%timestamp%" => date("D M j G:i:s T Y") + ); + $body['target'] = array_keys($trf); + $body['values'] = array_values($trf); + $subj['target'] = array_keys($trf); + $subj['values'] = array_values($trf); + + foreach ($iuSet as $ue) { + if (! isset($mailBodyCache[$ue['locale']])) { + $lang = $ue['locale']; + $mailBodyCache[$lang] = mailBodyGet($mailCfg['bodyAccessKey']); + + // set values + $mailBodyCache[$lang] = str_replace($body['target'], + $body['values'], $mailBodyCache[$lang]); + + $mailSubjectCache[$lang] = lang_get( + $mailCfg['subjectAccessKey'], $lang); + + $mailSubjectCache[$lang] = str_replace($subj['target'], + $subj['values'], $mailSubjectCache[$lang]); + } + + // send mail + $auditMsg = 'Requirement - ' . $action . ' - mail to user: ' . + $ue["login"] . ' using address:' . $ue["email"]; + try { + $xmail = array(); + $xmail['cc'] = ''; + $xmail['attachment'] = null; + $xmail['exit_on_error'] = false; + $xmail['htmlFormat'] = true; + + $rmx = @email_send($from, $ue["email"], + $mailSubjectCache[$ue['locale']], + $mailBodyCache[$ue['locale']], $xmail['cc'], + $xmail['attachment'], $xmail['exit_on_error'], + $xmail['htmlFormat'], null); + $apx = $rmx->status_ok ? 'Succesful - ' : 'ERROR -'; + } catch (Exception $e) { + $apx = 'ERROR - '; + } + $auditMsg = $apx . $auditMsg; + logAuditEvent($auditMsg); + } + } + + /** + */ + private function getMonitorMailCfg($action) + { + $cfg = null; + switch ($action) { + case 'create_new_version': + $cfg['subjectAccessKey'] = 'mail_subject_req_new_version'; + $cfg['bodyAccessKey'] = 'requirements/req_create_new_version.txt'; + break; + + case 'delete': + $cfg['subjectAccessKey'] = 'mail_subject_req_delete'; + $cfg['bodyAccessKey'] = 'requirements/req_delete.txt'; + break; + + case 'delete_version': + $cfg['subjectAccessKey'] = 'mail_subject_req_delete_version'; + $cfg['bodyAccessKey'] = 'requirements/req_delete_version.txt'; + break; + } + return $cfg; + } + + /** + */ + public function setNotifyOn($cfg) + { + foreach ($cfg as $key => $val) { + $this->notifyOn[$key] = $val; + } + } + + /** + * + * @todo delete the unused function if necessary + */ + private function getNotifyOn($key = null) + { + if (! is_null($key) && isset($this->notifyOn['key'])) { + return $this->notifyOn['key']; + } + return $this->notifyOn; + } + + /** + * + * @todo delete the unused function if necessary + */ + private function updateCoverage($link, $whoWhen, $opt = null) + { + + // Set coverage for previous version to FROZEN & INACTIVE ? + // Create coverage for NEW Version + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'freezePrevious' => true + ); + $options = array_merge($options, (array) $opt); + + $safeF = intval($link['source']); + $safeT = intval($link['dest']); + + // Set coverage for previous version to FROZEN & INACTIVE ? + if ($options['freezePrevious']) { + $sql = " /* $debugMsg */ " . + " UPDATE {$this->tables['req_coverage']} " . + " SET link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_REQVERSION . + "," . " is_active=0 " . " WHERE req_version_id=" . $safeF; + $this->db->exec_query($sql); + } + + // Create coverage for NEW Version + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['req_coverage']} " . + " (testcase_id,tcversion_id,req_id," . + " req_version_id,author_id,creation_ts) " . + " SELECT testcase_id,tcversion_id,req_id, " . + " {$safeT} AS req_version_id," . + " {$whoWhen['user_id']} AS author_id, " . + " {$whoWhen['when']} AS creation_ts" . + " FROM {$this->tables['req_coverage']} " . " WHERE req_version_id=" . + $safeF; + $this->db->exec_query($sql); + } + + /** + */ + private function updateTCVLinkStatus($from_version_id, $reason) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safeF = intval($from_version_id); + + $sql = " /* $debugMsg */ " . " UPDATE {$this->tables['req_coverage']} " . + " SET link_status = " . $reason . "," . " is_active=0 " . + " WHERE req_version_id=" . $safeF; + $this->db->exec_query($sql); + } + + /** + */ + private function getAllReqVersionIDForReq($idSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $idList = implode(",", (array) $idSet); + $sql = " /* $debugMsg */ + SELECT REQ.id AS req_id, NHREQVER.id AS req_version_id + FROM {$this->object_table} REQ + JOIN {$this->tables['nodes_hierarchy']} NHREQVER + ON NHREQVER.parent_id = REQ.id "; + $sql .= " WHERE REQ.id IN ($idList)"; + + return $this->db->fetchColumnsIntoMap($sql, 'req_id', 'req_version_id', + database::CUMULATIVE); + } + + /** + */ + public function getActiveForTCVersion($tcversion_id, $srs_id = 'all') + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = " /* $debugMsg */ " . + " SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id,NHREQ.name AS title, RCOV.is_active," . + " NHRS.name AS req_spec_title,RCOV.testcase_id," . + " REQV.id AS req_version_id, REQV.version " . + " FROM {$this->object_table} REQ " . + " JOIN {$this->tables['req_specs']} RSPEC " . + " ON REQ.srs_id = RSPEC.id " . + " JOIN {$this->tables['req_coverage']} RCOV " . + " ON RCOV.req_id = REQ.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHRS " . + " ON NHRS.id=RSPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHREQ " . + " ON NHREQ.id=REQ.id " . + " JOIN {$this->tables['req_versions']} REQV " . + " ON RCOV.req_version_id=REQV.id "; + + $idList = implode(",", (array) $tcversion_id); + + $sql .= " WHERE RCOV.tcversion_id IN (" . $idList . ")" . + " AND RCOV.is_active=1 "; + + // if only for one specification is required + if ($srs_id != 'all') { + $sql .= " AND REQ.srs_id=" . intval($srs_id); + } + + if (is_array($tcversion_id)) { + return $this->db->fetchRowsIntoMap($sql, 'tcversion_id', true); + } else { + return $this->db->get_recordset($sql); + } + } + + /** + * what is meaning of Good? + */ + public function getGoodForTCVersion($tcversion_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = " /* $debugMsg */ " . + " SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id, NHREQ.name AS title, RCOV.is_active, RCOV.testcase_id,RCOV.tcversion_id, - NHRS.name AS req_spec_title," . - " REQV.id AS req_version_id, REQV.version " . - - " FROM {$this->object_table} REQ " . - " JOIN {$this->tables['req_specs']} RSPEC " . - " ON REQ.srs_id = RSPEC.id " . - " JOIN {$this->tables['req_coverage']} RCOV " . - " ON RCOV.req_id = REQ.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHRS " . - " ON NHRS.id=RSPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHREQ " . - " ON NHREQ.id=REQ.id " . - " JOIN {$this->tables['req_versions']} REQV " . - " ON RCOV.req_version_id=REQV.id "; - - $idList = implode(",",(array)$tcversion_id); - - $sql .= " WHERE RCOV.tcversion_id IN (" . $idList . ")"; - //" AND RCOV.is_active=1 "; - - if ( is_array($tcversion_id) ) { - return $this->db->fetchRowsIntoMap($sql,'tcversion_id',true); - } - else { - return $this->db->get_recordset($sql); - } - } - - /** - * - */ - function getActiveForReqVersion($req_version_id) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe_id = intval($req_version_id); - - $sql = " /* $debugMsg */ " . - " SELECT NH_TC.id, NH_TC.id AS tcase_id,NH_TC.name,NH_TC.name AS tcase_name," . - " TCV.tc_external_id,TCV.version,TCV.id AS tcversion_id, " . - " /* Seems to be compatible with MySQL,MSSQL,POSTGRES */ " . - " (CASE WHEN RC.link_status = " . LINK_TC_REQ_CLOSED_BY_EXEC . - " THEN 0 ELSE is_active END) AS can_be_deleted, " . - " (CASE WHEN RC.link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION . - " THEN 1 ELSE 0 END) AS is_obsolete " . - " FROM {$this->tables['nodes_hierarchy']} NH_TC " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV " . - " ON NH_TCV.parent_id=NH_TC.id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id " . - " JOIN {$this->tables['req_coverage']} RC ON RC.tcversion_id = NH_TCV.id "; - - $sql .= " WHERE RC.req_version_id={$safe_id} "; - - return $this->db->get_recordset($sql); - } - - /** - * - */ - function delReqVersionTCVersionLink($bond,$caller=null) { - - $safeID = array( 'req' => intval($bond['req']), - 'tc' => intval($bond['tc']) ); - $output = 0; - $sql = " DELETE FROM {$this->tables['req_coverage']} " . - " WHERE req_version_id=" . $safeID['req'] . - " AND tcversion_id=" . $safeID['tc']; - - $result = $this->db->exec_query($sql); - - if ($result && $this->db->affected_rows() == 1) { - - // Going to audit - $sql = "SELECT NHP.name,NHC.id " . - " FROM {$this->tables['nodes_hierarchy']} NHP " . - " JOIN {$this->tables['nodes_hierarchy']} NHC " . - " ON NHP.id = NHC.parent_id " . - " WHERE NHC.id IN(" . - $safeID['req'] . "," . $safeID['tc'] . ")"; - - $mx = $this->db->fetchRowsIntoMap($sql,'id'); - - $sql = " SELECT TCV.version " . - " FROM {$this->tables['tcversions']} TCV " . - " WHERE TCV.id = " . $safeID['tc']; - $tcv = current($this->db->fetchRowsIntoMap($sql,'version')); - - $sql = " SELECT RQV.version " . - " FROM {$this->tables['req_versions']} RQV " . - " WHERE RQV.id = " . $safeID['req']; - $rqv = current($this->db->fetchRowsIntoMap($sql,'version')); - - logAuditEvent(TLS("audit_reqv_assignment_removed_tcv", - $mx[$safeID['req']]['name'],$rqv['version'], - $mx[$safeID['tc']]['name'],$tcv['version']), - "ASSIGN",$this->object_table); - $output = 1; - } - return $output; - } - - - /** - * - */ - function delReqVersionTCVersionLinkByID($link_id) { - - $safeID = intval($link_id); - - // First get audit info - $sql = " SELECT TCV.version AS tcv_vernum, NHTC.name AS tcname, " . - " RQV.version AS req_vernum, NHRQ.name AS reqname " . - " FROM {$this->tables['req_coverage']} RCOV " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = RCOV.tcversion_id " . - " JOIN {$this->tables['req_versions']} RQV " . - " ON RQV.id = RCOV.req_version_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = RCOV.testcase_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHRQ " . - " ON NHRQ.id = RCOV.req_id " . - " WHERE RCOV.id = $safeID "; - - $audit = current($this->db->get_recordset($sql)); - - $sql = " DELETE FROM {$this->tables['req_coverage']} " . - " WHERE id = $safeID "; - - $result = $this->db->exec_query($sql); - if ($result && $this->db->affected_rows() == 1) { - logAuditEvent(TLS("audit_reqv_assignment_removed_tcv", - $audit['reqname'],$audit['req_vernum'], - $audit['tcname'],$audit['tcv_vernum']), - "ASSIGN",$this->object_table); - $output = 1; - } - return $output; - } - - - /** - * - */ - function getLatestReqVersionCoverageCounterSet($itemSet) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT RCOV.req_id, COUNT(0) AS qty " . - " FROM {$this->tables['req_coverage']} RCOV " . - " JOIN {$this->views['latest_req_version_id']} LRQV " . - " ON LRQV.req_version_id = RCOV.req_version_id " . - " WHERE LRQV.req_version_id IN (" . - implode(',', $itemSet) . ")" . - " AND is_active = 1" . - " GROUP BY RCOV.req_id "; - - $rs = $this->db->fetchRowsIntoMap($sql,'req_id'); - return $rs; - } - - /* - function: bulkAssignLatestREQVTCV - assign N requirements to M test cases - Do not write audit info - - args: req_id: can be an array - testcase_id: can be an array - - returns: number of assignments done - - - */ - function bulkAssignLatestREQVTCV($req_id,$testcase_id,$author_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $insertCounter=0; // just for debug - - $reqSet = (array)$req_id; - $tcaseSet = (array)$testcase_id; - - $inReqID = implode(",",$reqSet); - $inTCaseID = implode(",",$tcaseSet); - - // Get coverage for this set of requirements and testcase - // to be used to understand if insert if needed - $sql = " /* $debugMsg */ - SELECT RCOV.req_id,RCOV.testcase_id, - RCOV.req_version_id,RCOV.tcversion_id - FROM {$this->tables['req_coverage']} RCOV - JOIN {$this->views['latest_req_version_id']} LRQV - ON LRQV.req_version_id = RCOV.req_version_id - JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = RCOV.tcversion_id - WHERE LRQV.req_id IN ({$inReqID}) - AND LTCV.testcase_id IN ({$inTCaseID}) "; - - // $coverage = $this->db->get_recordset($sql); - $coverage = (array) $this->db->fetchMapRowsIntoMap($sql, - 'req_version_id','tcversion_id'); - $sql = " /* $debugMsg */ - SELECT * FROM {$this->views['latest_tcase_version_id']} - WHERE testcase_id IN ({$inTCaseID}) "; - $ltcvSet = $this->db->fetchRowsIntoMap($sql,'tcversion_id'); - - $sql = " /* $debugMsg */ - SELECT * FROM {$this->views['latest_req_version_id']} - WHERE req_id IN ({$inReqID}) "; - $lrqvSet = $this->db->fetchRowsIntoMap($sql,'req_version_id'); - - $now = $this->db->db_now(); - $ins = " INSERT INTO {$this->tables['req_coverage']} + NHRS.name AS req_spec_title," . + " REQV.id AS req_version_id, REQV.version " . + " FROM {$this->object_table} REQ " . + " JOIN {$this->tables['req_specs']} RSPEC " . + " ON REQ.srs_id = RSPEC.id " . + " JOIN {$this->tables['req_coverage']} RCOV " . + " ON RCOV.req_id = REQ.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHRS " . + " ON NHRS.id=RSPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHREQ " . + " ON NHREQ.id=REQ.id " . + " JOIN {$this->tables['req_versions']} REQV " . + " ON RCOV.req_version_id=REQV.id "; + + $idList = implode(",", (array) $tcversion_id); + + $sql .= " WHERE RCOV.tcversion_id IN (" . $idList . ")"; + + if (is_array($tcversion_id)) { + return $this->db->fetchRowsIntoMap($sql, 'tcversion_id', true); + } else { + return $this->db->get_recordset($sql); + } + } + + /** + */ + public function getActiveForReqVersion($req_version_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safe_id = intval($req_version_id); + + $sql = " /* $debugMsg */ " . + " SELECT NH_TC.id, NH_TC.id AS tcase_id,NH_TC.name,NH_TC.name AS tcase_name," . + " TCV.tc_external_id,TCV.version,TCV.id AS tcversion_id, " . + " /* Seems to be compatible with MySQL,MSSQL,POSTGRES */ " . + " (CASE WHEN RC.link_status = " . LINK_TC_REQ_CLOSED_BY_EXEC . + " THEN 0 ELSE is_active END) AS can_be_deleted, " . + " (CASE WHEN RC.link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION . + " THEN 1 ELSE 0 END) AS is_obsolete " . + " FROM {$this->tables['nodes_hierarchy']} NH_TC " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV " . + " ON NH_TCV.parent_id=NH_TC.id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id " . + " JOIN {$this->tables['req_coverage']} RC ON RC.tcversion_id = NH_TCV.id "; + + $sql .= " WHERE RC.req_version_id={$safe_id} "; + + return $this->db->get_recordset($sql); + } + + /** + */ + public function delReqVersionTCVersionLink($bond, $caller = null) + { + $safeID = array( + 'req' => intval($bond['req']), + 'tc' => intval($bond['tc']) + ); + $output = 0; + $sql = " DELETE FROM {$this->tables['req_coverage']} " . + " WHERE req_version_id=" . $safeID['req'] . " AND tcversion_id=" . + $safeID['tc']; + + $result = $this->db->exec_query($sql); + + if ($result && $this->db->affected_rows() == 1) { + + // Going to audit + $sql = "SELECT NHP.name,NHC.id " . + " FROM {$this->tables['nodes_hierarchy']} NHP " . + " JOIN {$this->tables['nodes_hierarchy']} NHC " . + " ON NHP.id = NHC.parent_id " . " WHERE NHC.id IN(" . + $safeID['req'] . "," . $safeID['tc'] . ")"; + + $mx = $this->db->fetchRowsIntoMap($sql, 'id'); + + $sql = " SELECT TCV.version " . + " FROM {$this->tables['tcversions']} TCV " . " WHERE TCV.id = " . + $safeID['tc']; + $tcv = current($this->db->fetchRowsIntoMap($sql, 'version')); + + $sql = " SELECT RQV.version " . + " FROM {$this->tables['req_versions']} RQV " . " WHERE RQV.id = " . + $safeID['req']; + $rqv = current($this->db->fetchRowsIntoMap($sql, 'version')); + + logAuditEvent( + TLS("audit_reqv_assignment_removed_tcv", + $mx[$safeID['req']]['name'], $rqv['version'], + $mx[$safeID['tc']]['name'], $tcv['version']), "ASSIGN", + $this->object_table); + $output = 1; + } + return $output; + } + + /** + */ + public function delReqVersionTCVersionLinkByID($link_id) + { + $safeID = intval($link_id); + + // First get audit info + $sql = " SELECT TCV.version AS tcv_vernum, NHTC.name AS tcname, " . + " RQV.version AS req_vernum, NHRQ.name AS reqname " . + " FROM {$this->tables['req_coverage']} RCOV " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = RCOV.tcversion_id " . + " JOIN {$this->tables['req_versions']} RQV " . + " ON RQV.id = RCOV.req_version_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = RCOV.testcase_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHRQ " . + " ON NHRQ.id = RCOV.req_id " . " WHERE RCOV.id = $safeID "; + + $audit = current($this->db->get_recordset($sql)); + + $sql = " DELETE FROM {$this->tables['req_coverage']} " . + " WHERE id = $safeID "; + + $result = $this->db->exec_query($sql); + if ($result && $this->db->affected_rows() == 1) { + logAuditEvent( + TLS("audit_reqv_assignment_removed_tcv", $audit['reqname'], + $audit['req_vernum'], $audit['tcname'], $audit['tcv_vernum']), + "ASSIGN", $this->object_table); + $output = 1; + } + return $output; + } + + /** + */ + public function getLatestReqVersionCoverageCounterSet($itemSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . " SELECT RCOV.req_id, COUNT(0) AS qty " . + " FROM {$this->tables['req_coverage']} RCOV " . + " JOIN {$this->views['latest_req_version_id']} LRQV " . + " ON LRQV.req_version_id = RCOV.req_version_id " . + " WHERE LRQV.req_version_id IN (" . implode(',', $itemSet) . ")" . + " AND is_active = 1" . " GROUP BY RCOV.req_id "; + + return $this->db->fetchRowsIntoMap($sql, 'req_id'); + } + + /* + * function: bulkAssignLatestREQVTCV + * assign N requirements to M test cases + * Do not write audit info + * + * args: req_id: can be an array + * testcase_id: can be an array + * + * returns: number of assignments done + * + * + */ + public function bulkAssignLatestREQVTCV($req_id, $testcase_id, $author_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $insertCounter = 0; // just for debug + + $reqSet = (array) $req_id; + $tcaseSet = (array) $testcase_id; + + $inReqID = implode(",", $reqSet); + $inTCaseID = implode(",", $tcaseSet); + + // Get coverage for this set of requirements and testcase + // to be used to understand if insert if needed + $sql = " /* $debugMsg */ SELECT RCOV.req_id,RCOV.testcase_id, " . + " RCOV.req_version_id,RCOV.tcversion_id " . + " FROM {$this->tables['req_coverage']} RCOV " . + " JOIN {$this->views['latest_req_version_id']} LRQV " . + " ON LRQV.req_version_id = RCOV.req_version_id " . + " JOIN {$this->views['latest_tcase_version_id']} LTCV " . + " ON LTCV.tcversion_id = RCOV.tcversion_id " . + " WHERE LRQV.req_id IN ({$inReqID}) " . + " AND LTCV.testcase_id IN ({$inTCaseID}) "; + + $coverage = (array) $this->db->fetchMapRowsIntoMap($sql, + 'req_version_id', 'tcversion_id'); + $sql = " /* $debugMsg */ SELECT * FROM {$this->views['latest_tcase_version_id']} " . + " WHERE testcase_id IN ({$inTCaseID}) "; + $ltcvSet = $this->db->fetchRowsIntoMap($sql, 'tcversion_id'); + + $sql = " /* $debugMsg */ SELECT * FROM {$this->views['latest_req_version_id']} " . + " WHERE req_id IN ({$inReqID}) "; + $lrqvSet = $this->db->fetchRowsIntoMap($sql, 'req_version_id'); + + $now = $this->db->db_now(); + $ins = " INSERT INTO {$this->tables['req_coverage']} (req_id,testcase_id,req_version_id, - tcversion_id,author_id,creation_ts) "; - - foreach( $ltcvSet as $tcversion_id => $tc ) { - $sql = $ins; - $values = array(); - foreach( $lrqvSet as $req_version_id => $req ) { - if( !isset($coverage[$req_version_id][$tcversion_id]) ) { - $insertCounter++; - $values[] = " ({$req['req_id']},{$tc['testcase_id']}, + tcversion_id,author_id,creation_ts) "; + + foreach ($ltcvSet as $tcversion_id => $tc) { + $sql = $ins; + $values = array(); + foreach ($lrqvSet as $req_version_id => $req) { + if (! isset($coverage[$req_version_id][$tcversion_id])) { + $insertCounter ++; + $values[] = " ({$req['req_id']},{$tc['testcase_id']}, $req_version_id,$tcversion_id, - {$author_id},{$now}) "; - } - } - - if( count($values) > 0 ) { - $sql .= " VALUES " . implode(',',$values); - $this->db->exec_query($sql); - } - } - - return $insertCounter; - } - - - /** - * - * reqIdentity array('id' =>,'version_id' =>); - * tcIdentity array('id' =>,'version_id' =>); - * - */ - function assignReqVerToTCVer($reqIdentity,$tcIdentity,$authorID) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $now = $this->db->db_now(); - $sql = " /* $debugMsg */ - INSERT INTO {$this->tables['req_coverage']} - (req_id,testcase_id,req_version_id, tcversion_id, - author_id,creation_ts) - VALUES ({$reqIdentity['id']},{$tcIdentity['id']}, - {$reqIdentity['version_id']}, - {$tcIdentity['version_id']}, - {$authorID},{$now})"; - - $result = $this->db->exec_query($sql); - - return 1; - } - - /** - * what is meaning of Good? - * - */ - function getGoodForReqVersion($reqVersionID, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('verbose' => false, 'tproject_id' => null); - $options = array_merge($options,(array)$opt); - - $sql = " /* $debugMsg */ " . - " SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id, - NHREQ.name AS title, RCOV.is_active, - RCOV.testcase_id,RCOV.tcversion_id, - NHRS.name AS req_spec_title," . - " REQV.id AS req_version_id, REQV.version "; - - $addJoin = ''; - if($options['verbose']) { - $addFP = " TCV.tc_external_id AS external_id"; - if( ($tprj = intval($options['tproject_id'])) > 0 ) { - $sqlP = " SELECT prefix FROM {$this->tables['testprojects']} - WHERE id=$tprj"; - $dummy = $this->db->get_recordset($sqlP); - - if( count($dummy) == 1 ) { - $prefix = $dummy[0]['prefix']; - } - $glue = config_get('testcase_cfg'); - $glue = $glue->glue_character; - $addFP = " CONCAT('$prefix','$glue',TCV.tc_external_id) AS tc_external_id "; - } - - $sql .= ",NH_TC.name AS testcase_name,$addFP"; - $addJoin = " JOIN {$this->tables['nodes_hierarchy']} NH_TC + {$author_id},{$now}) "; + } + } + + if (! empty($values)) { + $sql .= " VALUES " . implode(',', $values); + $this->db->exec_query($sql); + } + } + + return $insertCounter; + } + + /** + * reqIdentity array('id' =>,'version_id' =>); + * tcIdentity array('id' =>,'version_id' =>); + */ + public function assignReqVerToTCVer($reqIdentity, $tcIdentity, $authorID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $now = $this->db->db_now(); + $sql = " /* $debugMsg */ INSERT INTO {$this->tables['req_coverage']} " . + " (req_id,testcase_id,req_version_id, tcversion_id, " . + " author_id,creation_ts) VALUES ({$reqIdentity['id']},{$tcIdentity['id']}, " . + " {$reqIdentity['version_id']}, {$tcIdentity['version_id']}, {$authorID},{$now})"; + $this->db->exec_query($sql); + + return 1; + } + + /** + * what is meaning of Good? + */ + public function getGoodForReqVersion($reqVersionID, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'verbose' => false, + 'tproject_id' => null + ); + $options = array_merge($options, (array) $opt); + + $sql = " /* $debugMsg */ SELECT REQ.id,REQ.id AS req_id,REQ.req_doc_id, " . + " NHREQ.name AS title, RCOV.is_active, RCOV.testcase_id,RCOV.tcversion_id, " . + " NHRS.name AS req_spec_title, REQV.id AS req_version_id, REQV.version "; + + $addJoin = ''; + if ($options['verbose']) { + $addFP = " TCV.tc_external_id AS external_id"; + if (($tprj = intval($options['tproject_id'])) > 0) { + $sqlP = " SELECT prefix FROM {$this->tables['testprojects']} + WHERE id=$tprj"; + $dummy = $this->db->get_recordset($sqlP); + + if (count($dummy) == 1) { + $prefix = $dummy[0]['prefix']; + } + $glue = config_get('testcase_cfg'); + $glue = $glue->glue_character; + $addFP = " CONCAT('$prefix','$glue',TCV.tc_external_id) AS tc_external_id "; + } + + $sql .= ",NH_TC.name AS testcase_name,$addFP"; + $addJoin = " JOIN {$this->tables['nodes_hierarchy']} NH_TC ON NH_TC.id = RCOV.testcase_id JOIN {$this->tables['tcversions']} TCV - ON TCV.id = RCOV.tcversion_id "; - } - - $sql .= " FROM {$this->object_table} REQ - JOIN {$this->tables['req_specs']} RSPEC - ON REQ.srs_id = RSPEC.id - JOIN {$this->tables['req_coverage']} RCOV - ON RCOV.req_id = REQ.id - JOIN {$this->tables['nodes_hierarchy']} NHRS - ON NHRS.id=RSPEC.id - JOIN {$this->tables['nodes_hierarchy']} NHREQ - ON NHREQ.id=REQ.id - JOIN {$this->tables['req_versions']} REQV - ON RCOV.req_version_id=REQV.id $addJoin "; - - - $idList = implode(",",(array)$reqVersionID); - - $sql .= " WHERE RCOV.req_version_id IN (" . $idList . ")"; - - return $this->db->fetchRowsIntoMap($sql,'req_version_id',true); - } - - -} // class end + ON TCV.id = RCOV.tcversion_id "; + } + + $sql .= " FROM {$this->object_table} REQ + JOIN {$this->tables['req_specs']} RSPEC + ON REQ.srs_id = RSPEC.id + JOIN {$this->tables['req_coverage']} RCOV + ON RCOV.req_id = REQ.id + JOIN {$this->tables['nodes_hierarchy']} NHRS + ON NHRS.id=RSPEC.id + JOIN {$this->tables['nodes_hierarchy']} NHREQ + ON NHREQ.id=REQ.id + JOIN {$this->tables['req_versions']} REQV + ON RCOV.req_version_id=REQV.id $addJoin "; + + $idList = implode(",", (array) $reqVersionID); + + $sql .= " WHERE RCOV.req_version_id IN (" . $idList . ")"; + + return $this->db->fetchRowsIntoMap($sql, 'req_version_id', true); + } +} diff --git a/lib/functions/requirement_spec_mgr.class.php b/lib/functions/requirement_spec_mgr.class.php index 1629ab4678..17df07285a 100644 --- a/lib/functions/requirement_spec_mgr.class.php +++ b/lib/functions/requirement_spec_mgr.class.php @@ -1,2844 +1,2822 @@ - "XML"); - var $export_file_types = array("XML" => "XML"); - var $my_node_type; - var $node_types_descr_id; - var $node_types_id_descr; - var $attachmentTableName; - var $field_size; - var $req_mgr; - var $relationsCfg; - var $requirement_child_ids = array(); - - /* - contructor - - args: db: reference to db object - - returns: instance of requirement_spec_mgr - - */ - function __construct(&$db) - { - $this->db = &$db; - $this->cfield_mgr = new cfield_mgr($this->db); - $this->tree_mgr = new tree($this->db); - $this->req_mgr = new requirement_mgr($this->db); - - $this->node_types_descr_id = $this->tree_mgr->get_available_node_types(); - $this->node_types_id_descr = array_flip($this->node_types_descr_id); - $this->my_node_type = $this->node_types_descr_id['requirement_spec']; - - $this->attachmentTableName = 'req_specs'; - tlObjectWithAttachments::__construct($this->db,$this->attachmentTableName); - $this->object_table=$this->tables['req_specs']; - - $this->field_size = config_get('field_size'); - - $this->relationsCfg = new stdClass(); - $this->relationsCfg->interProjectLinking = config_get('req_cfg')->relations->interproject_linking; - } - - /* - function: get_export_file_types - getter - - args: - - - returns: map - key: export file type code - value: export file type verbose description - - */ - function get_export_file_types() - { - return $this->export_file_types; - } - - /* - function: get_impor_file_types - getter - - args: - - - returns: map - key: import file type code - value: import file type verbose description - - */ - function get_import_file_types() - { - return $this->import_file_types; - } - - - /* - function: create - - args: - tproject_id: requirement spec parent (till we will manage unlimited tree depth) - parent_id: - doc_id - title - scope - countReq - user_id: requirement spec author - [type] - [node_order] - [options] - - returns: map with following keys: - status_ok -> 1/0 - msg -> some simple message, useful when status_ok ==0 - id -> id of requirement specification - - */ - function create($tproject_id,$parent_id,$doc_id,$title, $scope, - $countReq,$user_id, $type = TL_REQ_SPEC_TYPE_FEATURE, - $node_order=null, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $result=array('status_ok' => 0, 'msg' => 'ko', 'id' => -1, 'revision_id' => -1); - $title=trim($title); - $chk=$this->check_main_data($title,$doc_id,$tproject_id,$parent_id); - $result['msg']=$chk['msg']; - - $my['options'] = array( 'actionOnDuplicate' => "block"); - $my['options'] = array_merge($my['options'], (array)$options); - - if ($chk['status_ok']) - { - if( config_get('internal_links')->enable ) - { - $scope = req_link_replace($this->db, $scope, $tproject_id); - } - $req_spec_id = $this->tree_mgr->new_node($parent_id,$this->my_node_type,$title,$node_order); - - $sql = "/* $debugMsg */ INSERT INTO {$this->object_table} " . - " (id, testproject_id, doc_id) " . - " VALUES (" . $req_spec_id . "," . $tproject_id . ",'" . $this->db->prepare_string($doc_id) . "')"; - - if (!$this->db->exec_query($sql)) - { - $result['msg']=lang_get('error_creating_req_spec'); - } - else - { - $revItem = array('revision' => 1, 'doc_id' => $doc_id, 'name' => $title, - 'scope' => $scope, 'type' => $type, 'status' => 1, - 'total_req' => $countReq,'author_id' => $user_id, - 'log_message' => lang_get('reqspec_created_automatic_log')); - - $op = $this->create_revision($req_spec_id,$revItem); - $result['status_ok'] = $op['status_ok']; - $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; - $result['revision_id'] = $op['status_ok'] ? $op['id'] : -1; - $result['id'] = $op['status_ok'] ? $req_spec_id : -1; - } - } - return $result; - } - - /* - function: get_by_id - - - args : id: requirement spec id - options: - key: output - values: 'full','credentials' - - returns: null if query fails - map with requirement spec info - */ - function get_by_id($id,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - - $my['options'] = array('output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - - // First Step get ID of LATEST revision - $info = $this->get_last_child_info($id,array('output' => 'credentials') ); - $childID = $info['id']; - - - $sql = "/* $debugMsg */ SELECT RSPEC.id,RSPEC.doc_id, RSPEC.testproject_id, " . - " RSPEC_REV.id AS revision_id, RSPEC_REV.revision "; - - switch($my['options']['output']) - { - case 'credentials': - $doUserDecode = false; - break; - - case 'full': - default: - $sql .= " , '' AS author, '' AS modifier, NH_RSPEC.node_order, " . - " RSPEC_REV.scope,RSPEC_REV.total_req,RSPEC_REV.type," . - " RSPEC_REV.author_id,RSPEC_REV.creation_ts,RSPEC_REV.modifier_id," . - " RSPEC_REV.modification_ts,NH_RSPEC.name AS title "; - $doUserDecode = true; - break; - } - $sql .= " FROM {$this->object_table} RSPEC " . - " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . - " ON RSPEC_REV.parent_id = RSPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . - " ON RSPEC.id = NH_RSPEC.id " . - " WHERE RSPEC.id = NH_RSPEC.id " . - " AND RSPEC_REV.id = {$childID} " . - " AND RSPEC.id = {$id} "; - - - // echo $sql; - $recordset = $this->db->get_recordset($sql); - $rs = null; - if(!is_null($recordset)) - { - // Decode users - $rs = $recordset[0]; - - if($doUserDecode) - { - $lbl_undef = lang_get('undefined'); - if(trim($rs['author_id']) != "") - { - $user = tlUser::getByID($this->db,$rs['author_id']); - // need to manage deleted users - $rs['author'] = $lbl_undef; - if($user) - { - $rs['author'] = $user->getDisplayName(); - } - } - - if(trim($rs['modifier_id']) != "") - { - $user = tlUser::getByID($this->db,$rs['modifier_id']); - // need to manage deleted users - $rs['modifier'] = $lbl_undef; - if($user) - { - $rs['modifier'] = $user->getDisplayName(); - } - } - } - } - return $rs; - } - - - - /** - * get analyse based on requirements and test specification - * - * @param integer $id: Req Spec id - * @return array Coverage in three internal arrays: covered, uncovered, nottestable REQ - * @author martin havlat - */ - function get_coverage($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $output = array( 'covered' => array(), 'uncovered' => array(),'nottestable' => array()); - - // function get_requirements($id, $range = 'all', $testcase_id = null, $options=null, $filters = null) - $getOptions = array('order_by' => " ORDER BY req_doc_id,title"); - $getFilters = array('status' => VALID_REQ); - $validReq = $this->get_requirements($id,'all',null,$getOptions,$getFilters); - - // get not-testable requirements - $getFilters = array('status' => NON_TESTABLE_REQ); - $output['nottestable'] = $this->get_requirements($id,'all',null,$getOptions,$getFilters); - - // get coverage - if (sizeof($validReq)) - { - foreach ($validReq as $req) - { - // collect TC for REQ - $arrCoverage = $this->req_mgr->get_coverage($req['id']); - - if (count($arrCoverage) > 0) - { - // add information about coverage - $req['coverage'] = $arrCoverage; - $output['covered'][] = $req; - } - else - { - $output['uncovered'][] = $req; - } - } - } - return $output; - } - - - /** - * get requirement coverage metrics - * - * @param integer $srs_id - * @return array results - * @author havlatm - */ - function get_metrics($id) - { - $output = array('notTestable' => 0, 'total' => 0, 'covered' => 0, 'uncovered' => 0); - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $getFilters = array('status' => NON_TESTABLE_REQ); - $output['notTestable'] = $this->get_requirements_count($id,'all',null,$getFilters); - - $sql = "/* $debugMsg */ SELECT count(0) AS cnt FROM {$this->tables['requirements']} WHERE srs_id={$id}"; - $output['total'] = $this->db->fetchFirstRowSingleColumn($sql,'cnt'); - - $sql = "/* $debugMsg */ SELECT total_req FROM {$this->object_table} WHERE id={$id}"; - $output['expectedTotal'] = $this->db->fetchFirstRowSingleColumn($sql,'total_req'); - if ($output['expectedTotal'] == 0) - { - $output['expectedTotal'] = $output['total']; - } - - $sql = "/* $debugMsg */ SELECT DISTINCT REQ.id " . - " FROM {$this->tables['requirements']} REQ " . - " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ.id=REQ_COV.req_id" . - " WHERE REQ.srs_id={$id} " ; - $rs = $this->db->get_recordset($sql); - if (!is_null($rs)) - { - $output['covered'] = count($rs); - } - $output['uncovered'] = $output['expectedTotal'] - $output['total']; - - return $output; - } - - /* - function: get_all_in_testproject - get info about all req spec defined for a testproject - - - args: tproject_id - [order_by] - - returns: null if no srs exits, or no srs exists for id - array, where each element is a map with req spec data. - - map keys: - id - testproject_id - title - scope - total_req - type - author_id - creation_ts - modifier_id - modification_ts - */ - function get_all_in_testproject($tproject_id,$order_by=" ORDER BY title") - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT RSPEC.id,testproject_id,RSPEC.scope,RSPEC.total_req,RSPEC.type," . - " RSPEC.author_id,RSPEC.creation_ts,RSPEC.modifier_id," . - " RSPEC.modification_ts,NH.name AS title,NH.node_order " . - " FROM {$this->object_table} RSPEC, {$this->tables['nodes_hierarchy']} NH " . - " WHERE NH.id=RSPEC.id" . - " AND testproject_id={$tproject_id}"; - - if (!is_null($order_by)) - { - $sql .= $order_by; - } - return $this->db->get_recordset($sql); - } - - - /* - function: update - - args: item => map with following keys - id,doc_id,name,scope,countReq,user_id,type,node_order - - returns: map with following keys: - status_ok -> 1/0 - msg -> some simple message, useful when status_ok ==0 - revision_id -> useful when user request create new revision on update - - */ - function update($item,$options=null) - { - - $result = array('status_ok' => 1, 'msg' => 'ok', 'revision_id' => -1); - $my['options'] = array('skip_controls' => false, 'create_rev' => false, 'log_message' => ''); - $my['options'] = array_merge($my['options'], (array)$options); - - $title=trim_and_limit($item['name']); - $doc_id=trim_and_limit($item['doc_id']); - - $path=$this->tree_mgr->get_path($item['id']); - $tproject_id = $path[0]['parent_id']; - $last_idx=count($path)-1; - $parent_id = $last_idx==0 ? null : $path[$last_idx]['parent_id']; - $chk=$this->check_main_data($title,$doc_id,$path[0]['parent_id'],$parent_id,$item['id']); - - - if ($chk['status_ok'] || $my['options']['skip_controls']) - { - if( config_get('internal_links')->enable ) - { - $item['scope'] = req_link_replace($this->db, $item['scope'], $tproject_id); - } - - $cnr = null; - if( $my['options']['create_rev']) - { - $cnr = $this->create_new_revision($item['id'],$item+$my['options']); - } - else - { - // missing piece, need to update all fields on last revision - $cnr = $this->update_revision($item); - } - - $db_now = $this->db->db_now(); - $sql = " UPDATE {$this->object_table} " . - " SET doc_id='" . $this->db->prepare_string($doc_id) . "' " . - " WHERE id={$item['id']}"; - - if (!$this->db->exec_query($sql)) - { - $result['msg']=lang_get('error_updating_reqspec'); - $result['status_ok'] = 0; - } - - if( $result['status_ok'] ) - { - // need to update node on tree - $sql = " UPDATE {$this->tables['nodes_hierarchy']} " . - " SET name='" . $this->db->prepare_string($title) . "'"; - if(isset($item['node_order']) && !is_null($item['node_order']) ) - { - $sql .= ",node_order=" . intval($item['node_order']); - } - $sql .= " WHERE id={$item['id']}"; - - if (!$this->db->exec_query($sql)) - { - $result['msg']=lang_get('error_updating_reqspec'); - $result['status_ok'] = 0; - } - } - - if( $result['status_ok'] && !is_null($cnr)) - { - $result['revision_id'] = $cnr['id']; - } - } - else - { - $result['status_ok']=$chk['status_ok']; - $result['msg']=$chk['msg']; - } - return $result; - } - - - - /* - function: delete - deletes: - Requirements spec - Requirements spec custom fields values - Requirements ( Requirements spec children ) - Requirements custom fields values - - IMPORTANT/CRITIC: - This function can used to delete a Req Specification that contains ONLY Requirements. - This function is needed by tree class method: delete_subtree_objects() - To delete a Req Specification that contains other Req Specification delete_deep() must be used. - - args: id: requirement spec id - - returns: message string - ok if everything is ok - - */ - function delete($unsafe_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $id = intval($unsafe_id); - - // ATTENTION: CF linked to REVISION - $this->cfield_mgr->remove_all_design_values_from_node($id); - $result = $this->attachmentRepository->deleteAttachmentsFor($id,"req_specs"); - - // delete requirements (one type req spec children) with all related data - // coverage, attachments, custom fields, etc - $requirements_info = $this->get_requirements($id); - if(!is_null($requirements_info)) - { - $items = null; - foreach($requirements_info as $req) - { - $items[] = $req["id"]; - } - $this->req_mgr->delete($items); - } - - // delete revisions - $sqlx = array(); - $sqlx[] = "DELETE FROM {$this->tables['req_specs_revisions']} " . - "WHERE parent_id = {$id}"; - - $sqlx[] = "DELETE FROM {$this->tables['nodes_hierarchy']} " . - "WHERE parent_id = {$id} " . - "AND node_type_id=" . - $this->node_types_descr_id['requirement_spec_revision']; - - foreach($sqlx as $sql) - { - $result = $this->db->exec_query("/* $debugMsg */" . $sql); - } - - // delete specification itself - $sqlx = array(); - $sqlx[] = "DELETE FROM {$this->object_table} WHERE id = {$id}"; - $sqlx[] = "DELETE FROM {$this->tables['nodes_hierarchy']} " . - "WHERE id = {$id} AND node_type_id=" . - $this->node_types_descr_id['requirement_spec']; - - foreach($sqlx as $sql) - { - $result = $this->db->exec_query("/* $debugMsg */" .$sql); - } - - // This is a poor implementation - if($result) - { - $result = 'ok'; - } - else - { - $result = 'The DELETE SRS request fails.'; - } - - return $result; - } - - - /** - * delete_deep() - * - * Delete Req Specification, removing all children (other Req. Spec and Requirements) - */ - function delete_deep($id) - { - $exclusion = ' AND NH.node_type_id <> ' . - intval($this->node_types_descr_id['requirement_spec_revision']); - $this->tree_mgr->delete_subtree_objects($id,$id,$exclusion,array('requirement' => 'exclude_my_children')); - $this->delete($id); - } - - - - /* - function: get_requirements - get LATEST VERSION OF requirements contained in a req spec - - - args: id: req spec id - [range]: default 'all' - [testcase_id]: default null - if !is_null, is used as filter - [order_by] - - returns: array of rows - */ - function get_requirements($id, $range = 'all', $testcase_id = null, $options=null, $filters = null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array( 'order_by' => - " ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id", - 'output' => 'standard', - 'outputLevel' => 'std', 'decodeUsers' => true); - - $my['options'] = array_merge($my['options'], (array)$options); - - // null => do not filter - $my['filters'] = array('status' => null, 'type' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - switch($my['options']['output']) { - case 'count': - $rs = 0; - break; - - case 'standard': - default: - $rs = null; - break; - } - - - $tcase_filter = ''; - - // First Step - get only req info - $sql = "/* $debugMsg */ SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ "; - $addFields = ''; - switch($range) { - case 'all'; - break; - - case 'assigned': - $sql .= " JOIN {$this->tables['req_coverage']} - REQ_COV ON REQ_COV.req_id = NH_REQ.id "; - - if(!is_null($testcase_id)) { - $tcase_filter = " AND REQ_COV.testcase_id = {$testcase_id}"; - } - break; - } - - $sql = sprintf($sql,$addFields); - - $sql .= " WHERE NH_REQ.parent_id={$id} " . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} {$tcase_filter}"; - $itemSet = $this->db->fetchRowsIntoMap($sql,'id'); - - if( !is_null($itemSet) ) { - $reqSet = array_keys($itemSet); - $sql = "/* $debugMsg */ SELECT MAX(NH_REQV.id) AS version_id" . - " FROM {$this->tables['nodes_hierarchy']} NH_REQV " . - " WHERE NH_REQV.parent_id IN (" . implode(",",$reqSet) . ") " . - " GROUP BY NH_REQV.parent_id "; - - $latestVersionSet = $this->db->fetchRowsIntoMap($sql,'version_id'); - $reqVersionSet = array_keys($latestVersionSet); - - $getOptions['order_by'] = $my['options']['order_by']; - $getOptions['outputLevel'] = $my['options']['outputLevel']; - $getOptions['decodeUsers'] = $my['options']['decodeUsers']; - - - $rs = $this->req_mgr->get_by_id($reqSet,$reqVersionSet,null, - $getOptions,$my['filters']); - - switch($my['options']['output']) { - case 'standard': - break; - - case 'count': - return(!is_null($rs) ? count($rs) : 0); - break; - } - } - - // get child requirements - $reqSql = "SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ WHERE NH_REQ.parent_id={$id}"; - - $itemSetAllFolder = $this->db->fetchRowsIntoMap($reqSql,'id'); - - if(!is_null($itemSetAllFolder)){ - - foreach($itemSetAllFolder as $key => $value){ - - $sql= ''; - $tcase_filter = ''; - - // First Step - get only req info - $sql = "/* $debugMsg */ SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ "; - $addFields = ''; - switch($range) - { - case 'all'; - break; - - case 'assigned': - $sql .= " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ_COV.req_id=NH_REQ.id "; - if(!is_null($testcase_id)) - { - $tcase_filter = " AND REQ_COV.testcase_id={$testcase_id}"; - } - break; - } - - $sql = sprintf($sql,$addFields); - - $sql .= " WHERE NH_REQ.parent_id=" . $value['id'] . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} {$tcase_filter}"; - $itemSet = $this->db->fetchRowsIntoMap($sql,'id'); - - if( !is_null($itemSet) ) - { - $reqSet = array_keys($itemSet); - $sql = "/* $debugMsg */ SELECT MAX(NH_REQV.id) AS version_id" . - " FROM {$this->tables['nodes_hierarchy']} NH_REQV " . - " WHERE NH_REQV.parent_id IN (" . implode(",",$reqSet) . ") " . - " GROUP BY NH_REQV.parent_id "; - - $latestVersionSet = $this->db->fetchRowsIntoMap($sql,'version_id'); - $reqVersionSet = array_keys($latestVersionSet); - - $getOptions['order_by'] = $my['options']['order_by']; - $getOptions['outputLevel'] = $my['options']['outputLevel']; - $getOptions['decodeUsers'] = $my['options']['decodeUsers']; - - if(is_null($rs)){ - $rs = $this->req_mgr->get_by_id($reqSet,$reqVersionSet,null,$getOptions,$my['filters']); - } else { - $rs = array_merge($rs, $this->req_mgr->get_by_id($reqSet,$reqVersionSet,null,$getOptions,$my['filters'])); - } - - - switch($my['options']['output']) - { - case 'standard': - break; - - case 'count': - $rs = !is_null($rs) ? count($rs) : 0; - break; - } - } - } - } - - return $rs; -} - - -/** get child requirements for get all testcase associate. - * args: id: requirement id - * - * returns: array of rows - */ -function get_requirement_child_by_id($id){ - - $children = $this->get_requirement_child_by_id_req($id); - foreach($children as $key => $child){ - array_push($this->requirement_child_ids, $child); - $this->get_requirement_child_by_id($child["destination_id"]); - } - return $this->requirement_child_ids; -} - -/** - * get child requirements by id. - * args: id: requirement spec id - * - * returns: array of rows - */ -function get_requirement_child_by_id_req($id){ - $sql = "/* $debugMsg */ SELECT REQ_REL.destination_id, REQ.req_doc_id, NH.name FROM req_relations REQ_REL INNER + "XML" + ); + + private $export_file_types = array( + "XML" => "XML" + ); + + private $my_node_type; + + private $node_types_descr_id; + + private $node_types_id_descr; + + protected $attachmentTableName; + + private $field_size; + + private $req_mgr; + + private $relationsCfg; + + private $requirement_child_ids = array(); + + protected $debugMsg; + + /* + * contructor + * + * args: db: reference to db object + * + * returns: instance of requirement_spec_mgr + * + */ + public function __construct(&$db) + { + $this->db = &$db; + $this->cfield_mgr = new cfield_mgr($this->db); + $this->tree_mgr = new tree($this->db); + $this->req_mgr = new requirement_mgr($this->db); + + $this->node_types_descr_id = $this->tree_mgr->get_available_node_types(); + $this->node_types_id_descr = array_flip($this->node_types_descr_id); + $this->my_node_type = $this->node_types_descr_id['requirement_spec']; + + $this->attachmentTableName = 'req_specs'; + tlObjectWithAttachments::__construct($this->db, + $this->attachmentTableName); + $this->object_table = $this->tables['req_specs']; + + $this->field_size = config_get('field_size'); + + $this->relationsCfg = new stdClass(); + $this->relationsCfg->interProjectLinking = config_get('req_cfg')->relations->interproject_linking; + + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /* + * function: get_export_file_types + * getter + * + * args: - + * + * returns: map + * key: export file type code + * value: export file type verbose description + * + */ + public function get_export_file_types() + { + return $this->export_file_types; + } + + /* + * function: get_impor_file_types + * getter + * + * args: - + * + * returns: map + * key: import file type code + * value: import file type verbose description + * + */ + public function get_import_file_types() + { + return $this->import_file_types; + } + + /* + * function: create + * + * args: + * tproject_id: requirement spec parent (till we will manage unlimited tree depth) + * parent_id: + * doc_id + * title + * scope + * countReq + * user_id: requirement spec author + * [type] + * [node_order] + * [options] + * + * returns: map with following keys: + * status_ok -> 1/0 + * msg -> some simple message, useful when status_ok ==0 + * id -> id of requirement specification + * + */ + public function create($tproject_id, $parent_id, $doc_id, $title, $scope, + $countReq, $user_id, $type = TL_REQ_SPEC_TYPE_FEATURE, + $node_order = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $result = array( + 'status_ok' => 0, + 'msg' => 'ko', + 'id' => - 1, + 'revision_id' => - 1 + ); + $title = trim($title); + $chk = $this->check_main_data($title, $doc_id, $tproject_id, $parent_id); + $result['msg'] = $chk['msg']; + + $my['options'] = array( + 'actionOnDuplicate' => "block" + ); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($chk['status_ok']) { + if (config_get('internal_links')->enable) { + $scope = req_link_replace($this->db, $scope, $tproject_id); + } + $req_spec_id = $this->tree_mgr->new_node($parent_id, + $this->my_node_type, $title, $node_order); + + $sql = "/* $debugMsg */ INSERT INTO {$this->object_table} " . + " (id, testproject_id, doc_id) " . " VALUES (" . $req_spec_id . + "," . $tproject_id . ",'" . $this->db->prepare_string($doc_id) . + "')"; + + if (! $this->db->exec_query($sql)) { + $result['msg'] = lang_get('error_creating_req_spec'); + } else { + $revItem = array( + 'revision' => 1, + 'doc_id' => $doc_id, + 'name' => $title, + 'scope' => $scope, + 'type' => $type, + 'status' => 1, + 'total_req' => $countReq, + 'author_id' => $user_id, + 'log_message' => lang_get('reqspec_created_automatic_log') + ); + + $op = $this->create_revision($req_spec_id, $revItem); + $result['status_ok'] = $op['status_ok']; + $result['msg'] = $op['status_ok'] ? $result['msg'] : $op['msg']; + $result['revision_id'] = $op['status_ok'] ? $op['id'] : - 1; + $result['id'] = $op['status_ok'] ? $req_spec_id : - 1; + } + } + return $result; + } + + /* + * function: get_by_id + * + * + * args : id: requirement spec id + * options: + * key: output + * values: 'full','credentials' + * + * returns: null if query fails + * map with requirement spec info + */ + public function get_by_id($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['options'] = array( + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // First Step get ID of LATEST revision + $info = $this->get_last_child_info($id, + array( + 'output' => 'credentials' + )); + $childID = $info['id']; + + $sql = "/* $debugMsg */ SELECT RSPEC.id,RSPEC.doc_id, RSPEC.testproject_id, " . + " RSPEC_REV.id AS revision_id, RSPEC_REV.revision "; + + switch ($my['options']['output']) { + case 'credentials': + $doUserDecode = false; + break; + + case 'full': + default: + $sql .= " , '' AS author, '' AS modifier, NH_RSPEC.node_order, " . + " RSPEC_REV.scope,RSPEC_REV.total_req,RSPEC_REV.type," . + " RSPEC_REV.author_id,RSPEC_REV.creation_ts,RSPEC_REV.modifier_id," . + " RSPEC_REV.modification_ts,NH_RSPEC.name AS title "; + $doUserDecode = true; + break; + } + $sql .= " FROM {$this->object_table} RSPEC " . + " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . + " ON RSPEC_REV.parent_id = RSPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . + " ON RSPEC.id = NH_RSPEC.id " . " WHERE RSPEC.id = NH_RSPEC.id " . + " AND RSPEC_REV.id = {$childID} " . " AND RSPEC.id = {$id} "; + + $recordset = $this->db->get_recordset($sql); + $rs = null; + if (! is_null($recordset)) { + // Decode users + $rs = $recordset[0]; + + if ($doUserDecode) { + $lbl_undef = lang_get('undefined'); + if (trim($rs['author_id']) != "") { + $user = tlUser::getByID($this->db, $rs['author_id']); + // need to manage deleted users + $rs['author'] = $lbl_undef; + if ($user) { + $rs['author'] = $user->getDisplayName(); + } + } + + if (trim($rs['modifier_id']) != "") { + $user = tlUser::getByID($this->db, $rs['modifier_id']); + // need to manage deleted users + $rs['modifier'] = $lbl_undef; + if ($user) { + $rs['modifier'] = $user->getDisplayName(); + } + } + } + } + return $rs; + } + + /** + * get analyse based on requirements and test specification + * + * @param integer $id: + * Req Spec id + * @return array Coverage in three internal arrays: covered, uncovered, nottestable REQ + * @author martin havlat + */ + private function get_coverage($id) + { + $output = array( + 'covered' => array(), + 'uncovered' => array(), + 'nottestable' => array() + ); + + // function get_requirements($id, $range = 'all', $testcase_id = null, $options=null, $filters = null) + $getOptions = array( + 'order_by' => " ORDER BY req_doc_id,title" + ); + $getFilters = array( + 'status' => VALID_REQ + ); + $validReq = $this->get_requirements($id, 'all', null, $getOptions, + $getFilters); + + // get not-testable requirements + $getFilters = array( + 'status' => NON_TESTABLE_REQ + ); + $output['nottestable'] = $this->get_requirements($id, 'all', null, + $getOptions, $getFilters); + + // get coverage + if (count($validReq)) { + foreach ($validReq as $req) { + // collect TC for REQ + $arrCoverage = $this->req_mgr->get_coverage($req['id']); + + if (! empty($arrCoverage)) { + // add information about coverage + $req['coverage'] = $arrCoverage; + $output['covered'][] = $req; + } else { + $output['uncovered'][] = $req; + } + } + } + return $output; + } + + /** + * get requirement coverage metrics + * + * @param integer $srs_id + * @return array results + * @author havlatm + */ + private function get_metrics($id) + { + $output = array( + 'notTestable' => 0, + 'total' => 0, + 'covered' => 0, + 'uncovered' => 0 + ); + $debugMsg = $this->debugMsg . __FUNCTION__; + $getFilters = array( + 'status' => NON_TESTABLE_REQ + ); + $output['notTestable'] = $this->get_requirements_count($id, 'all', null, + $getFilters); + + $sql = "/* $debugMsg */ SELECT count(0) AS cnt FROM {$this->tables['requirements']} WHERE srs_id={$id}"; + $output['total'] = $this->db->fetchFirstRowSingleColumn($sql, 'cnt'); + + $sql = "/* $debugMsg */ SELECT total_req FROM {$this->object_table} WHERE id={$id}"; + $output['expectedTotal'] = $this->db->fetchFirstRowSingleColumn($sql, + 'total_req'); + if ($output['expectedTotal'] == 0) { + $output['expectedTotal'] = $output['total']; + } + + $sql = "/* $debugMsg */ SELECT DISTINCT REQ.id " . + " FROM {$this->tables['requirements']} REQ " . + " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ.id=REQ_COV.req_id" . + " WHERE REQ.srs_id={$id} "; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $output['covered'] = count($rs); + } + $output['uncovered'] = $output['expectedTotal'] - $output['total']; + + return $output; + } + + /* + * function: get_all_in_testproject + * get info about all req spec defined for a testproject + * + * + * args: tproject_id + * [order_by] + * + * returns: null if no srs exits, or no srs exists for id + * array, where each element is a map with req spec data. + * + * map keys: + * id + * testproject_id + * title + * scope + * total_req + * type + * author_id + * creation_ts + * modifier_id + * modification_ts + */ + public function get_all_in_testproject($tproject_id, + $order_by = " ORDER BY title") + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT RSPEC.id,testproject_id,RSPEC.scope,RSPEC.total_req,RSPEC.type," . + " RSPEC.author_id,RSPEC.creation_ts,RSPEC.modifier_id," . + " RSPEC.modification_ts,NH.name AS title,NH.node_order " . + " FROM {$this->object_table} RSPEC, {$this->tables['nodes_hierarchy']} NH " . + " WHERE NH.id=RSPEC.id" . " AND testproject_id={$tproject_id}"; + + if (! is_null($order_by)) { + $sql .= $order_by; + } + return $this->db->get_recordset($sql); + } + + /* + * function: update + * + * args: item => map with following keys + * id,doc_id,name,scope,countReq,user_id,type,node_order + * + * returns: map with following keys: + * status_ok -> 1/0 + * msg -> some simple message, useful when status_ok ==0 + * revision_id -> useful when user request create new revision on update + * + */ + public function update($item, $options = null) + { + $result = array( + 'status_ok' => 1, + 'msg' => 'ok', + 'revision_id' => - 1 + ); + $my['options'] = array( + 'skip_controls' => false, + 'create_rev' => false, + 'log_message' => '' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $title = trimAndLimit($item['name']); + $doc_id = trimAndLimit($item['doc_id']); + + $path = $this->tree_mgr->get_path($item['id']); + $tproject_id = $path[0]['parent_id']; + $last_idx = count($path) - 1; + $parent_id = $last_idx == 0 ? null : $path[$last_idx]['parent_id']; + $chk = $this->check_main_data($title, $doc_id, $path[0]['parent_id'], + $parent_id, $item['id']); + + if ($chk['status_ok'] || $my['options']['skip_controls']) { + if (config_get('internal_links')->enable) { + $item['scope'] = req_link_replace($this->db, $item['scope'], + $tproject_id); + } + + $cnr = null; + if ($my['options']['create_rev']) { + $cnr = $this->create_new_revision($item['id'], + $item + $my['options']); + } else { + // missing piece, need to update all fields on last revision + $cnr = $this->update_revision($item); + } + + $this->db->db_now(); + $sql = " UPDATE {$this->object_table} " . " SET doc_id='" . + $this->db->prepare_string($doc_id) . "' " . + " WHERE id={$item['id']}"; + + if (! $this->db->exec_query($sql)) { + $result['msg'] = lang_get('error_updating_reqspec'); + $result['status_ok'] = 0; + } + + if ($result['status_ok']) { + // need to update node on tree + $sql = " UPDATE {$this->tables['nodes_hierarchy']} " . + " SET name='" . $this->db->prepare_string($title) . "'"; + if (isset($item['node_order']) && ! is_null($item['node_order'])) { + $sql .= ",node_order=" . intval($item['node_order']); + } + $sql .= " WHERE id={$item['id']}"; + + if (! $this->db->exec_query($sql)) { + $result['msg'] = lang_get('error_updating_reqspec'); + $result['status_ok'] = 0; + } + } + + if ($result['status_ok'] && ! is_null($cnr)) { + $result['revision_id'] = $cnr['id']; + } + } else { + $result['status_ok'] = $chk['status_ok']; + $result['msg'] = $chk['msg']; + } + return $result; + } + + /* + * function: delete + * deletes: + * Requirements spec + * Requirements spec custom fields values + * Requirements ( Requirements spec children ) + * Requirements custom fields values + * + * IMPORTANT/CRITIC: + * This function can used to delete a Req Specification that contains ONLY Requirements. + * This function is needed by tree class method: delete_subtree_objects() + * To delete a Req Specification that contains other Req Specification delete_deep() must be used. + * + * args: id: requirement spec id + * + * returns: message string + * ok if everything is ok + * + */ + public function delete($unsafe_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $id = intval($unsafe_id); + + // ATTENTION: CF linked to REVISION + $this->cfield_mgr->remove_all_design_values_from_node($id); + $result = $this->attachmentRepository->deleteAttachmentsFor($id, + "req_specs"); + + // delete requirements (one type req spec children) with all related data + // coverage, attachments, custom fields, etc + $requirements_info = $this->get_requirements($id); + if (! is_null($requirements_info)) { + $items = null; + foreach ($requirements_info as $req) { + $items[] = $req["id"]; + } + $this->req_mgr->delete($items); + } + + // delete revisions + $sqlx = array(); + $sqlx[] = "DELETE FROM {$this->tables['req_specs_revisions']} " . + "WHERE parent_id = {$id}"; + + $sqlx[] = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + "WHERE parent_id = {$id} " . "AND node_type_id=" . + $this->node_types_descr_id['requirement_spec_revision']; + + foreach ($sqlx as $sql) { + $result = $this->db->exec_query("/* $debugMsg */" . $sql); + } + + // delete specification itself + $sqlx = array(); + $sqlx[] = "DELETE FROM {$this->object_table} WHERE id = {$id}"; + $sqlx[] = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + "WHERE id = {$id} AND node_type_id=" . + $this->node_types_descr_id['requirement_spec']; + + foreach ($sqlx as $sql) { + $result = $this->db->exec_query("/* $debugMsg */" . $sql); + } + + // This is a poor implementation + if ($result) { + $result = 'ok'; + } else { + $result = 'The DELETE SRS request fails.'; + } + + return $result; + } + + /** + * delete_deep() + * + * Delete Req Specification, removing all children (other Req. Spec and Requirements) + */ + public function delete_deep($id) + { + $exclusion = ' AND NH.node_type_id <> ' . + intval($this->node_types_descr_id['requirement_spec_revision']); + $this->tree_mgr->delete_subtree_objects($id, $id, $exclusion, + array( + 'requirement' => 'exclude_my_children' + )); + $this->delete($id); + } + + /* + * function: get_requirements + * get LATEST VERSION OF requirements contained in a req spec + * + * + * args: id: req spec id + * [range]: default 'all' + * [testcase_id]: default null + * if !is_null, is used as filter + * [order_by] + * + * returns: array of rows + */ + public function get_requirements($id, $range = 'all', $testcase_id = null, + $options = null, $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'order_by' => " ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id", + 'output' => 'standard', + 'outputLevel' => 'std', + 'decodeUsers' => true + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + // null => do not filter + $my['filters'] = array( + 'status' => null, + 'type' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + switch ($my['options']['output']) { + case 'count': + $rs = 0; + break; + + case 'standard': + default: + $rs = null; + break; + } + + $tcase_filter = ''; + + // First Step - get only req info + $sql = "/* $debugMsg */ SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ "; + $addFields = ''; + switch ($range) { + case 'all': + break; + + case 'assigned': + $sql .= " JOIN {$this->tables['req_coverage']} + REQ_COV ON REQ_COV.req_id = NH_REQ.id "; + + if (! is_null($testcase_id)) { + $tcase_filter = " AND REQ_COV.testcase_id = {$testcase_id}"; + } + break; + } + + $sql = sprintf($sql, $addFields); + + $sql .= " WHERE NH_REQ.parent_id={$id} " . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} {$tcase_filter}"; + $itemSet = $this->db->fetchRowsIntoMap($sql, 'id'); + + if (! is_null($itemSet)) { + $reqSet = array_keys($itemSet); + $sql = "/* $debugMsg */ SELECT MAX(NH_REQV.id) AS version_id" . + " FROM {$this->tables['nodes_hierarchy']} NH_REQV " . + " WHERE NH_REQV.parent_id IN (" . implode(",", $reqSet) . ") " . + " GROUP BY NH_REQV.parent_id "; + + $latestVersionSet = $this->db->fetchRowsIntoMap($sql, 'version_id'); + $reqVersionSet = array_keys($latestVersionSet); + + $getOptions['order_by'] = $my['options']['order_by']; + $getOptions['outputLevel'] = $my['options']['outputLevel']; + $getOptions['decodeUsers'] = $my['options']['decodeUsers']; + + $rs = $this->req_mgr->get_by_id($reqSet, $reqVersionSet, null, + $getOptions, $my['filters']); + + switch ($my['options']['output']) { + case 'standard': + break; + + case 'count': + return ! is_null($rs) ? count($rs) : 0; + break; + } + } + + // get child requirements + $reqSql = "SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ WHERE NH_REQ.parent_id={$id}"; + + $itemSetAllFolder = $this->db->fetchRowsIntoMap($reqSql, 'id'); + + if (! is_null($itemSetAllFolder)) { + + foreach ($itemSetAllFolder as $value) { + + $sql = ''; + $tcase_filter = ''; + + // First Step - get only req info + $sql = "/* $debugMsg */ SELECT NH_REQ.id FROM {$this->tables['nodes_hierarchy']} NH_REQ "; + $addFields = ''; + switch ($range) { + case 'all': + break; + + case 'assigned': + $sql .= " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ_COV.req_id=NH_REQ.id "; + if (! is_null($testcase_id)) { + $tcase_filter = " AND REQ_COV.testcase_id={$testcase_id}"; + } + break; + } + + $sql = sprintf($sql, $addFields); + + $sql .= " WHERE NH_REQ.parent_id=" . $value['id'] . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} {$tcase_filter}"; + $itemSet = $this->db->fetchRowsIntoMap($sql, 'id'); + + if (! is_null($itemSet)) { + $reqSet = array_keys($itemSet); + $sql = "/* $debugMsg */ SELECT MAX(NH_REQV.id) AS version_id" . + " FROM {$this->tables['nodes_hierarchy']} NH_REQV " . + " WHERE NH_REQV.parent_id IN (" . implode(",", $reqSet) . + ") " . " GROUP BY NH_REQV.parent_id "; + + $latestVersionSet = $this->db->fetchRowsIntoMap($sql, + 'version_id'); + $reqVersionSet = array_keys($latestVersionSet); + + $getOptions['order_by'] = $my['options']['order_by']; + $getOptions['outputLevel'] = $my['options']['outputLevel']; + $getOptions['decodeUsers'] = $my['options']['decodeUsers']; + + if (is_null($rs)) { + $rs = $this->req_mgr->get_by_id($reqSet, $reqVersionSet, + null, $getOptions, $my['filters']); + } else { + $rs = array_merge($rs, + $this->req_mgr->get_by_id($reqSet, $reqVersionSet, + null, $getOptions, $my['filters'])); + } + + switch ($my['options']['output']) { + case 'standard': + break; + + case 'count': + $rs = ! is_null($rs) ? count($rs) : 0; + break; + } + } + } + } + + return $rs; + } + + /** + * get child requirements for get all testcase associate. + * args: id: requirement id + * + * returns: array of rows + */ + public function get_requirement_child_by_id($id) + { + $children = $this->get_requirement_child_by_id_req($id); + foreach ($children as $child) { + array_push($this->requirement_child_ids, $child); + $this->get_requirement_child_by_id($child["destination_id"]); + } + return $this->requirement_child_ids; + } + + /** + * get child requirements by id. + * args: id: requirement spec id + * + * returns: array of rows + */ + private function get_requirement_child_by_id_req($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT REQ_REL.destination_id, REQ.req_doc_id, NH.name FROM req_relations REQ_REL INNER JOIN nodes_hierarchy NH ON REQ_REL.destination_id = NH.id - JOIN {$this->tables['requirements']} REQ ON REQ_REL.destination_id = REQ.id where REQ_REL.source_id={$id}"; - $child = $this->db->get_recordset($sql); - return $child; -} - - /* - function: get_by_title - get req spec information using title as access key. - - args : title: req spec title - [tproject_id] - [parent_id] - [case_analysis]: control case sensitive search. - default 0 -> case sensivite search - - returns: map. - key: req spec id - value: srs info, map with folowing keys: - id - testproject_id - doc_id - title - scope - total_req - type - author_id - creation_ts - modifier_id - modification_ts - */ - function get_by_title($title,$tproject_id=null,$parent_id=null,$case_analysis=self::CASE_SENSITIVE) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $output=null; - $title=trim($title); - $the_title=$this->db->prepare_string($title); - $sql = "/* $debugMsg */ " . - " SELECT RSPEC.id,testproject_id,RSPEC.doc_id,RSPEC.scope,RSPEC.total_req,RSPEC.type," . - " RSPEC.author_id,RSPEC.creation_ts,RSPEC.modifier_id," . - " RSPEC.modification_ts,NH.name AS title " . - " FROM {$this->object_table} RSPEC, {$this->tables['nodes_hierarchy']} NH"; - - switch ($case_analysis) - { - case self::CASE_SENSITIVE: - $sql .= " WHERE NH.name='{$the_title}'"; - break; - - case self::CASE_INSENSITIVE: - $sql .= " WHERE UPPER(NH.name)='" . strtoupper($the_title) . "'"; - break; - } - $sql .= " AND RSPEC.id=NH.id "; - - - if( !is_null($tproject_id) ) - { - $sql .= " AND RSPEC.testproject_id={$tproject_id}"; - } - - if( !is_null($parent_id) ) - { - $sql .= " AND NH.parent_id={$parent_id}"; - } - - $sql .= " AND RSPEC.id=NH.id "; - $output = $this->db->fetchRowsIntoMap($sql,'id'); - - return $output; - } - - /* - function: check_title - Do checks on req spec title, to understand if can be used. - - Checks: - 1. title is empty ? - 2. does already exist a req spec with this title? - - args : title: req spec title - [parent_id]: default null -> do check for tile uniqueness system wide. - valid id: only inside parent_id with this id. - - [id]: req spec id. - [case_analysis]: control case sensitive search. - default 0 -> case sensivite search - - returns: - - */ - function check_title($title,$tproject_id=null,$parent_id=null,$id=null, - $case_analysis=self::CASE_SENSITIVE) - { - $ret['status_ok'] = 1; - $ret['msg'] = ''; - - $title = trim($title); - - if ($title == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_req_title"); - } - - if($ret['status_ok']) - { - $ret['msg']='ok'; - $rs = $this->get_by_title($title,$tproject_id,$parent_id,$case_analysis); - if(!is_null($rs) && (is_null($id) || !isset($rs[$id]))) - { - $ret['msg'] = sprintf(lang_get("warning_duplicate_req_title"),$title); - $ret['status_ok'] = 0; - } - } - return $ret; - } //function end - - - /* - function: check_main_data - Do checks on req spec title and doc id, to understand if can be used. - - Checks: - 1. title is empty ? - 2. doc is is empty ? - 3. does already exist a req spec with this title? - 4. does already exist a req spec with this doc id? - - VERY IMPORTANT: - $tlCfg->req_cfg->child_requirements_mgmt has effects on check on already - existent title or doc id. - - $tlCfg->req_cfg->child_requirements_mgmt == ENABLED => N level tree - title and doc id can not repited on ANY level of tree - - This is important due to unique index present on Database - ATTENTION: - Must be rethinked!!!! - - - args : title: req spec title - doc_id: req spec document id / code / short title - [parent_id]: default null -> do check for tile uniqueness system wide. - valid id: only inside parent_id with this id. - - [id]: req spec id. - [case_analysis]: control case sensitive search. - default 0 -> case sensivite search - - returns: - - */ - function check_main_data($title,$doc_id,$tproject_id=null,$parent_id=null,$id=null, - $case_analysis=self::CASE_SENSITIVE) - { - $cfg = config_get('req_cfg'); - - $my_parent_id = $parent_id; - - $ret['status_ok'] = 1; - $ret['msg'] = ''; - - $title = trim($title); - $doc_id = trim($doc_id); - - if ($title == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_req_title"); - } - - if ($doc_id == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_doc_id"); - } - - - if($ret['status_ok']) - { - $ret['msg']='ok'; - $rs = $this->getByDocID($doc_id,$tproject_id); - if(!is_null($rs) && (is_null($id) || !isset($rs[$id]))) - { - $info = current($rs); - $ret['msg'] = sprintf(lang_get("warning_duplicated_req_spec_doc_id"),$info['title'],$doc_id); - $ret['status_ok'] = 0; - } - } - - return $ret; - } //function end - - - - - - - - /* - function: - - args : - $nodes: array with req_spec in order - returns: - - */ - function set_order($map_id_order) - { - $this->tree_mgr->change_order_bulk($map_id_order); - } // set_order($map_id_order) - - - /* - function: - - args: - - returns: - - */ - function get_requirements_count($id, $range = 'all', $testcase_id = null,$filters=null) - { - // filters => array('status' => NON_TESTABLE_REQ, 'type' => 'X'); - $options = array('output' => 'count'); - $count = $this->get_requirements($id,$range,$testcase_id,$options,$filters); - return $count; - } - - - /** - * getReqTree - * - * Example of returned value ( is a recursive one ) - * ( - * [childNodes] => Array - * ([0] => Array - * ( [id] => 216 - * [parent_id] => 179 - * [node_type_id] => 6 - * [node_order] => 0 - * [node_table] => req_specs - * [name] => SUB-R - * [childNodes] => Array - * ([0] => Array - * ( [id] => 181 - * [parent_id] => 216 - * [node_type_id] => 7 - * [node_order] => 0 - * [node_table] => requirements - * [name] => Gamma Ray Emissions - * [childNodes] => - * ) - * [1] => Array - * ( [id] => 182 - * [parent_id] => 216 - * [node_type_id] => 7 - * [node_order] => 0 - * [node_table] => requirements - * [name] => Coriolis Effet - * [childNodes] => - * ) - * ) - * ) - * [1] => Array - * ( [id] => 217 - * [parent_id] => 179 - * [node_type_id] => 6 - * [node_order] => 0 - * [node_table] => req_specs - * [name] => SUB-R2 - * [childNodes] => Array - * ... - * - * - */ - function getReqTree($id) - { - $filters=null; - $options=array('recursive' => true); - $map = $this->tree_mgr->get_subtree($id,$filters,$options); - return $map; - } - - - /** - * exportReqSpecToXML - * create XML string with following req spec data - * - basic data (title, scope) - * - custom fields values - * - children: can be other req spec or requirements - * (tree leaves) - * - * Developed using exportTestSuiteDataToXML() as model - * - */ - function exportReqSpecToXML($id,$tproject_id,$optForExport=array()) - { - // manage missing keys; recursive export by default - if( !array_key_exists('RECURSIVE',$optForExport) ) { - $optForExport['RECURSIVE'] = true; - } - - $relXmlData = ''; - $relationsCache = array(); - - $cfXML = null; - $xmlData = null; - if ($optForExport['RECURSIVE']) { - $cfXML = $this->customFieldValuesAsXML($id,$tproject_id); - $containerData = $this->get_by_id($id); - $xmlData = "' . "\n". - "\t\n" . - "\t\n" . - "\t\n" . - "\t\n" . - "\t\n\t\t{$cfXML}"; - } - - // Add attachments info - if (isset($optForExport['ATTACHMENTS']) - && $optForExport['ATTACHMENTS']) { - - $attachments = null; - $attachSet = $this->attachmentRepository->getAttachmentInfosFor($id,$this->attachmentTableName,'id'); - - // get all attachments content and encode it in base64 - if ($attachSet) { - foreach ($attachSet as $attInfo) { - $aID = $attInfo["id"]; - $content = $this->attachmentRepository - ->getAttachmentContent($aID, $attInfo); - - if ($content != null) { - $attachments[$aID]["id"] = $aID; - $attachments[$aID]["name"] = $attInfo["file_name"]; - $attachments[$aID]["file_type"] = $attInfo["file_type"]; - $attachments[$aID]["title"] = $attInfo["title"]; - $attachments[$aID]["date_added"] = $attInfo["date_added"]; - $attachments[$aID]["content"] = base64_encode($content); - } - } - } - - if( !is_null($attachments) && count($attachments) > 0 ) { - $attchRootElem = - "\t\n{{XMLCODE}}\t\n"; - $attchElemTemplate = "\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\n"; - - $attchDecode = array ("||ATTACHMENT_ID||" => "id", "||ATTACHMENT_NAME||" => "name", - "||ATTACHMENT_FILE_TYPE||" => "file_type", "||ATTACHMENT_TITLE||" => "title", - "||ATTACHMENT_DATE_ADDED||" => "date_added", "||ATTACHMENT_CONTENT||" => "content"); - $xmlData .= exportDataToXML($attachments,$attchRootElem, - $attchElemTemplate,$attchDecode,true); - } - } - - $req_spec = $this->getReqTree($id); - $childNodes = isset($req_spec['childNodes']) ? $req_spec['childNodes'] : null ; - if( !is_null($childNodes) ) { - $loop_qty=sizeof($childNodes); - for($idx = 0;$idx < $loop_qty;$idx++) { - $cNode = $childNodes[$idx]; - $nTable = $cNode['node_table']; - if( $optForExport['RECURSIVE'] - && $cNode['node_table'] == 'req_specs') { - $xmlData .= $this->exportReqSpecToXML($cNode['id'], - $tproject_id,$optForExport); - } else if ($cNode['node_table'] == 'requirements') { - $xmlData .= $this->req_mgr->exportReqToXML($cNode['id'],$tproject_id,$optForExport['ATTACHMENTS']); - - $relations = $this->req_mgr->get_relations($cNode['id']); - if( !is_null($relations['relations']) && count($relations['relations']) > 0 ) - { - foreach($relations['relations'] as $key => $rel) - { - // If we have already found this relation, skip it. - if ( !in_array($rel['id'], $relationsCache) ) - { - // otherwise export it to XML. - $testproject_id = $this->relationsCfg->interProjectLinking ? $tproject_id : null; - $relXmlData .= $this->req_mgr->exportRelationToXML($rel,$tproject_id, - $this->relationsCfg->interProjectLinking); - $relationsCache[] = $rel['id']; - } - } - } - } - } - - // after we scanned all relations and exported all relations to xml, let's output it to the XML buffer - $xmlData .= $relXmlData; - } - - if ($optForExport['RECURSIVE']) - { - $xmlData .= "\n"; - } - return $xmlData; - } - - /** - * xmlToReqSpec - * - * @param object $source: - * $source->type: possible values 'string', 'file' - * $source->value: depends of $source->type - * 'string' => xml string - * 'file' => path name of XML file - * - */ - function xmlToReqSpec($source) - { - $status_ok=true; - $xml_string=null; - $req_spec=null; - switch( $source->type ) - { - case 'string': - $xml_string = $source->value; - break; - - case 'file': - $xml_file = $source->value; - $status_ok=!(($xml_object=@$this->simplexml_load_file_helper($xml_file)) === FALSE); - break; - } - - if( $status_ok ) - { - - } - - return $req_spec; - } - - /** - * xmlToMapReqSpec - * - */ - function xmlToMapReqSpec($xml_item,$level=0) - { - static $iterations=0; - static $mapped; - - // Attention: following PHP Manual SimpleXML documentation, Please remember to cast - // before using data from $xml, - if( is_null($xml_item) ) - { - return null; - } - - // used to reset static structures if calling this in loop - if($level == 0) - { - $iterations = 0; - $mapped = null; - } - - $dummy=array(); - $dummy['node_order'] = (int)$xml_item->node_order; - $dummy['scope'] = (string)$xml_item->scope; - $dummy['type'] = (int)$xml_item->type; - $dummy['total_req'] = (int)$xml_item->total_req; - $dummy['level'] = $level; - $depth=$level+1; - - foreach($xml_item->attributes() as $key => $value) - { - $dummy[$key] = (string)$value; // See PHP Manual SimpleXML documentation. - } - - - if( property_exists($xml_item,'custom_fields') ) - { - $dummy['custom_fields']=array(); - foreach($xml_item->custom_fields->children() as $key) - { - $dummy['custom_fields'][(string)$key->name]= (string)$key->value; - } - } - - if( property_exists($xml_item,'attachments') ) - { - $dummy['attachments'] = array(); - foreach($xml_item->attachments->children() as $attachment) - { - $attach_id = (int)$attachment->id; - $dummy['attachments'][$attach_id]['id'] = (int)$attachment->id; - $dummy['attachments'][$attach_id]['name'] = (string)$attachment->name; - $dummy['attachments'][$attach_id]['file_type'] = (string)$attachment->file_type; - $dummy['attachments'][$attach_id]['title'] = (string)$attachment->title; - $dummy['attachments'][$attach_id]['date_added'] = (string)$attachment->date_added; - $dummy['attachments'][$attach_id]['content'] = (string)$attachment->content; - } - } - $mapped[]=array('req_spec' => $dummy, 'requirements' => null, - 'level' => $dummy['level']); - - // Process children - if( property_exists($xml_item,'requirement') ) - { - $loop2do=count($xml_item->requirement); - for($idx=0; $idx <= $loop2do; $idx++) - { - $xml_req=$this->req_mgr->xmlToMapRequirement($xml_item->requirement[$idx]); - if(!is_null($xml_req)) - { - $fdx=count($mapped)-1; - $mapped[$fdx]['requirements'][]=$xml_req; - } - } - } - - if( property_exists($xml_item,'relation') ) - { - $loop3do=count($xml_item->relation); - for($idx=0; $idx <= $loop3do; $idx++) - { - $rel=$this->req_mgr->convertRelationXmlToRelationMap($xml_item->relation[$idx]); - if(!is_null($rel)) - { - $fdx=count($mapped)-1; - $mapped[$fdx]['relations'][]=$rel; - } - } - } - - if( property_exists($xml_item,'req_spec') ) - { - $loop2do=count($xml_item->req_spec); - for($idx=0; $idx <= $loop2do; $idx++) - { - $this->xmlToMapReqSpec($xml_item->req_spec[$idx],$depth); - } - } - - return $mapped; - } - - - // Custom field related functions - - /* - function: get_linked_cfields - Get all linked custom fields. - Remember that custom fields are defined at system wide level, and - has to be linked to a testproject, in order to be used. - - - args: credentials, map with following keys - item_id: Req. Spec REVISION ID (can be NULL if parent_id IS NOT NULL) - parent_id: Req. Spec ID (can be NULL if item_id IS NOT NULL) - tproject_id:node id of parent testproject of requirement spec. - need to understand to which testproject requirement spec belongs. - this information is vital, to get the linked custom fields. - Presence /absence of this value changes starting point - on procedure to build tree path to get testproject id. - - null -> use requirement spec id as starting point. - !is_null -> use this value as starting point. - - returns: map/hash - key: custom field id - value: map with custom field definition and value assigned for choosen req spec, - with following keys: - - id: custom field id - name - label - type: custom field type - possible_values: for custom field - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - value: value assigned to custom field for this req spec - null if for this req spec custom field was never edited. - - node_id: req spec id - null if for this req spec, custom field was never edited. - - - @internal revisions - - */ - function get_linked_cfields($credentials) - { - $who = array('item_id' => null, 'parent_id' => null, 'tproject_id' => null); - $who = array_merge($who, (array)$credentials); - - $tproject_id = $who['tproject_id']; - $hasParentInfo = !is_null($who['parent_id']) && ($who['parent_id'] > 0); - - if($hasParentInfo && (is_null($tproject_id) || is_null($who['item_id']) )) - { - // will get info for LAST revision - $info = $this->get_by_id($who['parent_id'],array('output' => 'credentials')); - $tproject_id = $info['testproject_id']; - $who['item_id'] = $info['revision_id']; - } - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::CF_ENABLED,null, - 'requirement_spec',$who['item_id']); - return $cf_map; - } - - - /* - function: html_table_of_custom_field_inputs - Return html code, implementing a table with custom fields labels - and html inputs, for choosen req spec. - Used to manage user actions on custom fields values. - - - args: $id - [tproject_id]: node id of testproject (req spec parent). - this information is vital, to get the linked custom fields, - because custom fields are system wide, but to be used are - assigned to a test project. - is null this method or other called will use get_path() - method to get test project id. - - [parent_id]: Need to e rethinked, may be remove (20090111 - franciscom) - - [$name_suffix]: must start with '_' (underscore). - Used when we display in a page several items - (example during test case execution, several test cases) - that have the same custom fields. - In this kind of situation we can use the item id as name suffix. - - - returns: html string - - */ - function html_table_of_custom_field_inputs( $id,$child_id,$tproject_id=null,$parent_id=null, - $name_suffix='',$input_values = null) - { - $NO_WARNING_IF_MISSING=true; - $cf_smarty = ''; - - $idCard = array('parent_id' => $id, 'item_id' => $child_id, 'tproject_id' => $tproject_id); - $cf_map = $this->get_linked_cfields($idCard); - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - - return $cf_smarty; - } - - - - /* - function: html_table_of_custom_field_values - Return html code, implementing a table with custom fields labels - and custom fields values, for choosen req spec. - You can think of this function as some sort of read only version - of html_table_of_custom_field_inputs. - - - args: $id - - returns: html string - - */ - function html_table_of_custom_field_values($id,$child_id,$tproject_id) - { - $NO_WARNING_IF_MISSING=true; - $cf_smarty = ''; - - // $cf_map = $this->get_linked_cfields($id,$child_id,$tproject_id); - $idCard = array('parent_id' => $id, 'item_id' => $child_id, 'tproject_id' => $tproject_id); - $cf_map = $this->get_linked_cfields($idCard); - $show_cf = config_get('custom_fields')->show_custom_fields_without_value; - - if(!is_null($cf_map)) - { - foreach($cf_map as $cf_id => $cf_info) - { - // if user has assigned a value, then node_id is not null - if($cf_info['node_id'] || $show_cf) - { - $label = str_replace(TL_LOCALIZE_TAG,'', - lang_get($cf_info['label'],null,$NO_WARNING_IF_MISSING)); - - $cf_smarty .= '' . - htmlspecialchars($label) . ":" . - $this->cfield_mgr->string_custom_field_value($cf_info,$id) . - "\n"; - } - } - - if(trim($cf_smarty) != "") - { - $cf_smarty = "" . $cf_smarty . "
    "; - } - } - return $cf_smarty; - } // function end - - - /* - function: values_to_db - write values of custom fields to db - - args: hash: - key: custom_field__. - Example custom_field_0_67 -> 0=> string field - - node_id: req spec id - - [cf_map]: hash -> all the custom fields linked and enabled - that are applicable to the node type of $node_id. - - For the keys not present in $hash, we will write - an appropriate value according to custom field - type. - - This is needed because when trying to udpate - with hash being $_REQUEST, $_POST or $_GET - some kind of custom fields (checkbox, list, multiple list) - when has been deselected by user. - - [hash_type] - - rev: - */ - function values_to_db($hash,$node_id,$cf_map=null,$hash_type=null) - { - $this->cfield_mgr->design_values_to_db($hash,$node_id,$cf_map,$hash_type); - } - - - /** - * customFieldValuesAsXML - * - * @param $id: requirement spec id - * @param $tproject_id: test project id - * - * - */ - function customFieldValuesAsXML($id,$tproject_id) - { - $xml = null; - - $idCard = array('parent_id' => $id, 'item_id' => null, 'tproject_id' => $tproject_id); - $cfMap = $this->get_linked_cfields($idCard); - if( !is_null($cfMap) && count($cfMap) > 0 ) - { - $xml = $this->cfield_mgr->exportValueAsXML($cfMap); - } - return $xml; - } - - - /** - * create a req spec tree on system from $xml data - * - * - * @internal revisions - */ - function createFromXML($xml,$tproject_id,$parent_id,$author_id,$filters = null,$options=null) - { - static $labels; - static $missingCfMsg; - static $linkedCF; - static $messages; - static $doProcessCF = false; - - // init static items - if( is_null($labels) ) - { - $labels = array('import_req_spec_created' => '', 'import_req_spec_skipped' => '', - 'import_req_spec_updated' => '', 'import_req_spec_ancestor_skipped' => '', - 'import_req_created' => '','import_req_skipped' =>'', 'import_req_updated' => ''); - foreach($labels as $key => $dummy) - { - $labels[$key] = lang_get($key); - } - - $messages = array(); - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['cfield'] = lang_get('cf_value_not_imported_missing_cf_on_testproject'); - - $linkedCF = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::CF_ENABLED,null, - 'requirement_spec',null,'name'); - $doProcessCF = true; - } - - $user_feedback = null; - $copy_reqspec = null; - $copy_req = null; - $getOptions = array('output' => 'minimun'); - $my['options'] = array('skipFrozenReq' => true); - $my['options'] = array_merge($my['options'], (array)$options); - - $items = $this->xmlToMapReqSpec($xml); - - $has_filters = !is_null($filters); - if($has_filters) - { - if(!is_null($filters['requirements'])) - { - foreach($filters['requirements'] as $reqspec_pos => $requirements_pos) - { - $copy_req[$reqspec_pos] = is_null($requirements_pos) ? null : array_keys($requirements_pos); - } - } - } - - $loop2do = count($items); - $container_id[0] = (is_null($parent_id) || $parent_id == 0) ? $tproject_id : $parent_id; - - // items is an array of req. specs - $skip_level = -1; - for($idx = 0;$idx < $loop2do; $idx++) - { - $rspec = $items[$idx]['req_spec']; - $depth = $rspec['level']; - if( $skip_level > 0 && $depth >= $skip_level) - { - $msgID = 'import_req_spec_ancestor_skipped'; - $user_feedback[] = array('doc_id' => $rspec['doc_id'],'title' => $rspec['title'], - 'import_status' => sprintf($labels[$msgID],$rspec['doc_id'])); - continue; - } - $req_spec_order = isset($rspec['node_order']) ? $rspec['node_order'] : 0; - - // Check if req spec with same DOCID exists, inside container_id - // If there is a hit - // We will go in update - // If Check fails, need to repeat check on WHOLE Testproject. - // If now there is a HIT we can not import this branch - // If Check fails => we can import creating a new one. - // - // Important thing: - // Working in this way, i.e. doing check while walking the structure to import - // we can end importing struct with 'holes'. - // - $check_in_container = $this->getByDocID($rspec['doc_id'],$tproject_id,$container_id[$depth],$getOptions); - $hasAttachments = array_key_exists('attachments',$rspec); - - $skip_level = $depth + 1; - $result['status_ok'] = 0; - $msgID = 'import_req_spec_skipped'; - - if(is_null($check_in_container)) - { - $check_in_tproject = $this->getByDocID($rspec['doc_id'],$tproject_id,null,$getOptions); - if(is_null($check_in_tproject)) - { - $importMode = 'creation'; - $msgID = 'import_req_spec_created'; - $result = $this->create($tproject_id,$container_id[$depth],$rspec['doc_id'],$rspec['title'], - $rspec['scope'],$rspec['total_req'],$author_id,$rspec['type'],$req_spec_order); - } - } - else - { - $importMode = 'update'; - $msgID = 'import_req_spec_updated'; - $reqSpecID = key($check_in_container); - $item = array('id' => $reqSpecID, 'name' => $rspec['title'],'doc_id' => $rspec['doc_id'], - 'scope' => $rspec['scope'],'total_req' => $rspec['total_req'],'modifier_id' => $author_id, - 'type' => $rspec['type'],'node_order' => $req_spec_order); - - // ATTENTION update return key => revision_id, because CF values are saved at REVISION LEVEL - $result = $this->update($item); - $result['id'] = $reqSpecID; - } - $user_feedback[] = array('doc_id' => $rspec['doc_id'],'title' => $rspec['title'], - 'import_status' => sprintf($labels[$msgID],$rspec['doc_id'])); - - // process attachements for creation and update - if($result['status_ok'] && $hasAttachments) - { - $addAttachmentsResponse = $this->processAttachments( $importMode, $result['id'], $rspec['attachments'], $feedbackMsg ); - } - // display only problems during attachments import - if( isset($addAttachmentsResponse) && !is_null($addAttachmentsResponse) ) - { - foreach($addAttachmentsResponse as $att_name){ - $user_feedback[] = array('doc_id' => $rspec['doc_id'],'title' => $rspec['title'], - 'import_status' => sprintf(lang_get('import_req_spec_attachment_skipped'),$att_name)); - } - } - if( $result['status_ok'] && $doProcessCF && isset($rspec['custom_fields']) && !is_null($rspec['custom_fields']) ) - { - $cf2insert = null; - foreach($rspec['custom_fields'] as $cfname => $cfvalue) - { - $cfname = trim($cfname); - if( isset($linkedCF[$cfname]) ) - { - $cf2insert[$linkedCF[$cfname]['id']]=array('type_id' => $linkedCF[$cfname]['type'],'cf_value' => $cfvalue); - } - else - { - if( !isset($missingCfMsg[$cfname]) ) - { - $missingCfMsg[$cfname] = sprintf($messages['cfield'],$cfname,$labels['requirement']); - } - $user_feedback[] = array('doc_id' => $rspec['docid'],'title' => $rspec['title'], - 'import_status' => $missingCfMsg[$cfname]); - } - } - if( !is_null($cf2insert) ) - { - $this->cfield_mgr->design_values_to_db($cf2insert,$result['revision_id'],null,'simple'); - } - } - - - if($result['status_ok']) - { - $skip_level = -1; - $container_id[$depth+1] = ($reqSpecID = $result['id']); - $reqSet = $items[$idx]['requirements']; - $create_req = (!$has_filters || isset($copy_req[$idx])) && !is_null($reqSet); - if($create_req) - { - $items_qty = isset($copy_req[$idx]) ? count($copy_req[$idx]) : count($reqSet); - $keys2insert = isset($copy_req[$idx]) ? $copy_req[$idx] : array_keys($reqSet); - for($jdx = 0;$jdx < $items_qty; $jdx++) - { - $req = $reqSet[$keys2insert[$jdx]]; - $dummy = $this->req_mgr->createFromMap($req,$tproject_id,$reqSpecID,$author_id, null,$my['options']); - $user_feedback = array_merge($user_feedback,$dummy); - } - } // if($create_req) - - if(isset($items[$idx]['relations'])) - { - $relationsMap = $items[$idx]['relations']; - $numberOfRelations = count($relationsMap); - for($jdx=0; $jdx < $numberOfRelations; $jdx++) - { - $rel = $relationsMap[$jdx]; - $dummy = $this->req_mgr->createRelationFromMap($rel, $tproject_id, $author_id); - $user_feedback = array_merge($user_feedback,$dummy); - } - } - } // if($result['status_ok']) - } - return $user_feedback; - } - - - - /* - function: getByDocID - get req spec information using document ID as access key. - - args : doc_id: - [tproject_id] - [parent_id] - [options]: - [case]: control case sensitive search. - default 0 -> case sensivite search - [access_key]: - [check_criteria]: - [output]: - - returns: map. - key: req spec id - value: srs info, map with folowing keys: - id - testproject_id - title - scope - total_req - type - author_id - creation_ts - modifier_id - modification_ts - - */ - function getByDocID($doc_id,$tproject_id=null,$parent_id=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array( 'check_criteria' => '=', 'access_key' => 'id', - 'case' => 'sensitive', 'output' => 'standard'); - $my['options'] = array_merge($my['options'], (array)$options); - - - $output=null; - $the_doc_id=$this->db->prepare_string(trim($doc_id)); - - switch($my['options']['check_criteria']) { - case '=': - default: - $check_criteria = " = '{$the_doc_id}' "; - break; - - case 'like': - $check_criteria = " LIKE '{$the_doc_id}%' "; - break; - } - - $where = " WHERE RSPEC.doc_id {$check_criteria} "; - if( !is_null($tproject_id) ) - { - $where .= " AND RSPEC.testproject_id={$tproject_id}"; - } - if( !is_null($parent_id) ) - { - $where .= " AND NH_RSPEC.parent_id={$parent_id}"; - } - - // Developer Note: - // a mix of SQL ignorance and MySQL relaxed SQL on GROUP BY - // Fortunatelly Postgres do the right job - // - // - // First step get MAX revision - // will trust in this that max(revision) has also always max(revision_id) - // ( but really can be on a differente way ? ), in order to use a simple logic. - // - $sql_max = " /* $debugMsg */ SELECT MAX(RSPEC_REV.id) AS rev_id" . - " FROM {$this->tables['req_specs']} RSPEC " . - " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . - " ON RSPEC_REV.parent_id = RSPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . - " ON NH_RSPEC.id = RSPEC.id " . - $where . ' GROUP BY RSPEC_REV.parent_id '; - - $maxi = (array)$this->db->fetchRowsIntoMap($sql_max,'rev_id');; - if( count($maxi) > 0) - { - $sql = " /* $debugMsg */ SELECT RSPEC.id,RSPEC.testproject_id,RSPEC.doc_id,NH_RSPEC.name AS title, " . - " RSPEC_REV.revision "; - - switch($my['options']['output']) - { - case 'standard': - $sql .= " ,RSPEC_REV.total_req, RSPEC_REV.scope,RSPEC_REV.type," . - " RSPEC_REV.author_id,RSPEC_REV.creation_ts, " . - " RSPEC_REV.modifier_id,RSPEC_REV.modification_ts"; - break; - - case 'minimun': - break; - } - - $sql .= " FROM {$this->tables['req_specs']} RSPEC " . - " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . - " ON RSPEC_REV.parent_id = RSPEC.id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . - " ON NH_RSPEC.id = RSPEC.id "; - - $sql .= $where . ' AND RSPEC_REV.id IN (' . implode(",",array_keys($maxi)) . ') '; - $output = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - } - - return $output; - } - - - /* - function: copy_to - deep copy one req spec to another parent (req spec or testproject). - - - args : id: req spec id (source or copy) - parent_id: - user_id: who is requesting copy operation - [options] - - returns: map with following keys: - status_ok: 0 / 1 - msg: 'ok' if status_ok == 1 - id: new created if everything OK, -1 if problems. - - rev : - */ - function copy_to($id, $parent_id, $tproject_id, $user_id,$options = null) { - - static $get_tree_nt2exclude; - if(!$get_tree_nt2exclude) { - $get_tree_nt2exclude = - array('req_version' => 'exclude_me','req_revision' => 'exclude_me', - 'requirement_spec_revision' => 'exclude_me'); - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $op = array('status_ok' => 1, 'msg' => 'ok', 'id' => -1 , 'mappings' => null); - $my['options'] = array('copy_also' => null); - $my['options'] = array_merge($my['options'], (array)$options); - - - $item_info = $this->get_by_id($id); - $target_doc = $this->generateDocID($id,$tproject_id); - $new_item = $this->create($tproject_id,$parent_id,$target_doc,$item_info['title'], - $item_info['scope'],$item_info['total_req'], - $item_info['author_id'],$item_info['type'],$item_info['node_order']); - - $op = $new_item; - if( $new_item['status_ok'] ) { - $op['mappings'][$id] = $new_item['id']; - $op['mappings']['req_spec'] = array(); - $op['mappings']['req'] = array(); - $op['mappings']['req_version'] = array(); - $op['mappings']['req_tree'] = array(); - - - $idCard = array('parent_id' => $id, 'tproject_id' => $tproject_id); - $this->copy_cfields($idCard,$new_item['id']); - - $this->copy_attachments($id,$new_item['id']); - - // Now loop to copy all items inside it - // null is OK, because $id is a req spec, there is no risk - // to copy/traverse wrong node types. - // Hmmm may be req_revi ??? - $my['filters']['exclude_node_types'] = $get_tree_nt2exclude; - $subtree = $this->tree_mgr->get_subtree($id,$my['filters'],array('output' => 'essential')); - - if (!is_null($subtree)) { - $reqMgr = new requirement_mgr($this->db); - $parent_decode=array(); - $parent_decode[$id]=$new_item['id']; - - // using reference has to avoid duplicate => memory consumption - // (at least this is info found on Internet) - // Few test indicates that it's true, but that using a counter - // is still better. - // - $loop2do = count($subtree); - for($sdx=0; $sdx <= $loop2do; $sdx++) { - $elem = &$subtree[$sdx]; - $the_parent_id = isset($parent_decode[$elem['parent_id']]) ? $parent_decode[$elem['parent_id']] : null; - - switch ($elem['node_type_id']) { - case $this->node_types_descr_id['requirement']: - $ret = $reqMgr->copy_to($elem['id'],$the_parent_id,$user_id, - $tproject_id,$my['options']); - - $op['status_ok'] = $ret['status_ok']; - $op['mappings']['req'] += $ret['mappings']['req']; - $op['mappings']['req_version'] += $ret['mappings']['req_version']; - $op['mappings']['req_tree'] += $ret['mappings']['req_tree']; - break; - - case $this->node_types_descr_id['requirement_spec']: - $item_info = $this->get_by_id($elem['id']); - - // hmm, when copy_to() is called because we are duplicating - // a test project, call to generateDocID(), can be avoided. - // we have IMHO an absolute inexistent risk. - $target_doc = $this->generateDocID($elem['id'],$tproject_id); - - $ret = $this->create($tproject_id,$the_parent_id,$target_doc, - $item_info['title'], - $item_info['scope'],$item_info['total_req'], - $item_info['author_id'],$item_info['type'], - $item_info['node_order']); - - $parent_decode[$elem['id']]=$ret['id']; - $op['mappings']['req_spec'][$elem['id']] = $ret['id']; - - if( ($op['status_ok'] = $ret['status_ok']) ) { - // try to reduce memory usage - // $idCard = array('parent_id' => $elem['id'], - // 'tproject_id' => $tproject_id); - $this->copy_cfields(array('parent_id' => $elem['id'], - 'tproject_id' => $tproject_id), - $ret['id']); - } - break; - } - - if( $op['status_ok'] == 0 ) { - break; - } - } - } - } - return $op; - } - - - /* - function: copy_cfields - Get all cfields linked to item with the values presents for $from_id, - item we are using as source for our copy. - - args: from_identity: source credentianls (complex type) - array('parent_id' => , 'item_id' => , 'tproject_id' => ); - - to_id: target item id (simple type) - - returns: - - - */ - function copy_cfields($from_identity,$to_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $cfmap_from=$this->get_linked_cfields($from_identity); - - $cfield=null; - if( !is_null($cfmap_from) ) { - foreach($cfmap_from as $key => $value) { - $cfield[$key]=array("type_id" => $value['type'], - "cf_value" => $value['value']); - } - } - $this->cfield_mgr->design_values_to_db($cfield,$to_id,null,'tcase_copy_cfields'); - } - - - - /** - * processAttachments - * - * Analyze attachments info related to req spec to define if the the attachment has to be added. - * attachments are ignored only if a attachment with the same ID is already linked to the target ReqSpec. - * - * return an array of all attachments names of IDs already linked to target ReqSpec. - * - */ - - function processAttachments($importMode, $rs_id, $attachments, $feedbackMsg ) - { - $tables = tlObjectWithDB::getDBTables(array('req_specs','attachments')); - - $knownAttachments = array(); - foreach( $attachments as $attachment ) - { - $addAttachment = true; - if($importMode == 'update'){ - // try to bypass the importation of already known attachments. - // Check in database if the attachment with the same ID is linked to the rspec with the same internal ID - // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. - // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). - $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . - " WHERE ATT.id='{$this->db->prepare_string($attachment[id])}' " . - " AND ATT.fk_id={$rs_id} "; - $rsx=$this->db->get_recordset($sql); - $addAttachment = ( is_null($rsx) || count($rsx) < 1 ); - if( $addAttachment === false ){ // inform user that the attachment has been skipped - $knownAttachments[] = $attachment['name']; - } - } - if($addAttachment){ - $attachRepo = tlAttachmentRepository::create($this->db); - $fileInfo = $attachRepo->createAttachmentTempFile( $attachment['content'] ); - $fileInfo['name'] = $attachment['name']; - $fileInfo['type'] = $attachment['file_type']; - $attachRepo->insertAttachment( $rs_id, $tables['req_specs'], $attachment['title'], $fileInfo); - } - } - return $knownAttachments; - } - - - /** - * - * - */ - function generateDocID($id, $tproject_id) - { - $item_info = $this->get_by_id($id); - - // Check if another req with same DOC ID exists on target container, - // If yes generate a new DOC ID - $getOptions = array('check_criteria' => 'like', 'access_key' => 'doc_id'); - $itemSet = $this->getByDocID($item_info['doc_id'],$tproject_id,null,$getOptions); - $target_doc = $item_info['doc_id']; - $instance = 1; - if( !is_null($itemSet) ) - { - // doc_id has limited size => we need to be sure that generated id - // will not exceed DB size - $nameSet = array_flip(array_keys($itemSet)); - - // 6 magic from " [xxx]" - $prefix = trim_and_limit($item_info['doc_id'],$this->field_size->docid-6); - $target_doc = $prefix . " [{$instance}]"; - while( isset($nameSet[$target_doc]) ) - { - $instance++; - $target_doc = $prefix . " [{$instance}]"; - } - } - return $target_doc; - } - - /** - * - * - */ - function getFirstLevelInTestProject($tproject_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT * from {$this->tables['nodes_hierarchy']} " . - " WHERE parent_id = {$tproject_id} " . - " AND node_type_id = {$this->node_types_descr_id['requirement_spec']} " . - " ORDER BY node_order,id"; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - return $rs; - } - - - /** - * IMPORTANT NOTICE - * Only information regarding basic tables is created. - * This means THAT NOTHING is done (example) on custom fields, or other - * items that are related/linked to revisions. - * - */ - function create_revision($rspecID,$item) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('msg' => 'ok','status_ok' => 1,'id' => -1); - $ret['id'] = $this->tree_mgr->new_node($rspecID,$this->node_types_descr_id['requirement_spec_revision']); - - $optActorPairs = array('author_id' => 'creation_ts', 'modifier_id' => 'modification_ts'); - $val2add = ''; - $fields2insert = 'parent_id,id,revision,status,doc_id,name,scope,type,log_message'; - - - foreach($optActorPairs as $main => $sec) - { - if( isset($item[$main]) && is_numeric($item[$main]) ) - { - $fields2insert .= ',' . $main . ',' . $sec; - $ts = isset($item[$sec]) ? $item[$sec] : $this->db->db_now(); - $val2add .= ',' . intval($item[$main]) . ',' . $ts; - } - } - $optIntKeys = array('status' => 1); - foreach($optIntKeys as $field => $default) - { - $item[$field] = isset($item[$field]) ? $item[$field] : $default; - } - - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_specs_revisions']} " . - " ($fields2insert) " . - " VALUES({$rspecID}" . "," . $ret['id'] . "," . intval($item['revision']) . "," . - intval($item['status']) . ",'" . - $this->db->prepare_string($item['doc_id']) . "','" . - $this->db->prepare_string($item['name']) . "','" . - $this->db->prepare_string($item['scope']) . "','" . - $this->db->prepare_string($item['type']) . "','" . - $this->db->prepare_string($item['log_message']) . "'" . $val2add . ")"; - - $result = $this->db->exec_query($sql); - if ($result) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . - " SET name='" . $this->db->prepare_string($item['name']) . "' " . - " WHERE id={$ret['id']} "; - // echo $sql . '
    '; - $this->db->exec_query($sql); - } - else - { - $ret['msg'] = $this->db->error_msg(); - $ret['status_ok'] = 0; - $ret['id'] = -1; - } - - return $ret; - } - - - /** - * - */ - function create_new_revision($rspecID,$item) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('msg' => 'ok','status_ok' => 1,'id' => -1); - - // Needed to get higher revision NUMBER, to generata new NUMBER - $source_info = $this->get_last_child_info($rspecID); - $current_rev = 0; - if( !is_null($source_info) ) - { - $current_rev = $source_info['revision']; - } - $current_rev++; - $item['revision'] = $current_rev++; - - $ret = $this->create_revision($rspecID,$item); - return $ret; - } - - /** - * @param id: parent id - * @param child_type: 'revision' - * - * @return - */ - function get_last_child_info($id, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('child_type' => 'revision', 'output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - $info = null; - $target_cfg = array('revision' => array('table'=> 'req_specs_revisions', 'field' => 'revision')); - - $child_type = $my['options']['child_type']; // just for readability - $table = $target_cfg[$child_type]['table']; - $field = $target_cfg[$child_type]['field']; - - $sql = " /* $debugMsg */ SELECT COALESCE(MAX($field),-1) AS $field " . - " FROM {$this->tables[$table]} CHILD," . - " {$this->tables['nodes_hierarchy']} NH WHERE ". - " NH.id = CHILD.id ". - " AND NH.parent_id = {$id} "; - - $max_verbose = $this->db->fetchFirstRowSingleColumn($sql,$field); - if ($max_verbose >= 0) - { - $sql = "/* $debugMsg */ SELECT "; - - switch($my['options']['output']) - { - case 'credentials': - $sql .= " CHILD.parent_id,CHILD.id,CHILD.revision,CHILD.doc_id "; - break; - - case 'full': - default: - $sql .= " CHILD.* "; - break; - } - - $sql .= " FROM {$this->tables[$table]} CHILD," . - " {$this->tables['nodes_hierarchy']} NH ". - " WHERE $field = {$max_verbose} AND NH.id = CHILD.id AND NH.parent_id = {$id}"; - - $info = $this->db->fetchFirstRow($sql); - } - return $info; - } - - /** - * @param id: parent id - * @param child_type: 'revision' - * - * @return - */ - function getRevisionsCount($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $qty = 0; - - $sql = " /* $debugMsg */ SELECT COUNT(0) AS qty" . - " FROM {$this->tables['req_specs_revisions']} RSPEC_REV" . - " WHERE RSPEC_REV.parent_id = {$id} "; - - $dummy = $this->db->get_recordset($sql); - return $dummy[0]['qty']; - } - - - /** - * used to create overwiew of changes between revisions - */ - function get_history($id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => "map", 'decode_user' => false, 'order_by_dir' => 'DESC'); - $my['options'] = array_merge($my['options'], (array)$options); - - $labels['undefined'] = lang_get('undefined'); - $sql = "/* $debugMsg */" . - " SELECT RSREV.id AS revision_id, RSREV.revision," . - " RSREV.creation_ts, RSREV.author_id, " . - " RSREV.modification_ts, RSREV.modifier_id, " . - " RSREV.revision, RSREV.scope, " . - " RSREV.status,RSREV.type,RSREV.name, RSREV.doc_id, " . - " COALESCE(RSREV.log_message,'') AS log_message" . - " FROM {$this->tables['req_specs_revisions']} RSREV " . - " WHERE RSREV.parent_id = {$id} " . - " ORDER BY RSREV.revision {$my['options']['order_by_dir']} "; - - - switch($my['options']['output']) - { - case 'map': - $rs = $this->db->fetchRowsIntoMap($sql,'revision_id'); - break; - - case 'array': - $rs = $this->db->get_recordset($sql); - break; - } - - if( !is_null($rs) ) - { - $key2loop = array_keys($rs); - foreach($key2loop as $ap) - { - $rs[$ap]['item_id'] = $rs[$ap]['revision_id']; - - // IMPORTANT NOTICE - // each DBMS uses a different (unfortunatelly) way to signal NULL DATE - // - // We need to Check with ALL DB types - // MySQL NULL DATE -> "0000-00-00 00:00:00" - // Postgres NULL DATE -> NULL - // MSSQL NULL DATE - ??? - $key4date = 'creation_ts'; - $key4user = 'author_id'; - - $nullTS = $this->db->db_null_timestamp(); - if( ($rs[$ap]['modification_ts'] != $nullTS) - && !is_null($rs[$ap]['modification_ts']) - && !is_null($rs[$ap]['modifier_id'])) { - $key4date = 'modification_ts'; - $key4user = 'modifier_id'; - } - $rs[$ap]['timestamp'] = $rs[$ap][$key4date]; - $rs[$ap]['last_editor'] = $rs[$ap][$key4user]; - - // decode user_id for last_editor - $user = tlUser::getByID($this->db,$rs[$ap]['last_editor']); - $rs[$ap]['last_editor'] = $user ? $user->getDisplayName() : $labels['undefined']; - } - } - - $history = $rs; - if( $my['options']['decode_user'] && !is_null($history) ) - { - $this->decode_users($history); - } - - return $history; - } - - /** - * - * - */ - function decode_users(&$rs) - { - $userCache = null; // key: user id, value: display name - $key2loop = array_keys($rs); - $labels['undefined'] = lang_get('undefined'); - $user_keys = array('author' => 'author_id', 'modifier' => 'modifier_id'); - foreach( $key2loop as $key ) - { - foreach( $user_keys as $ukey => $userid_field) - { - $rs[$key][$ukey] = ''; - if(trim($rs[$key][$userid_field]) != "") - { - if( !isset($userCache[$rs[$key][$userid_field]]) ) - { - $user = tlUser::getByID($this->db,$rs[$key][$userid_field]); - $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; - $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; - } - else - { - $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; - } - } - } - } - } - - /** - * - */ - function getRevisionTemplate() - { - $tpl = array('revision' => 1, 'doc_id' => null, 'name' => null, - 'scope' => null, 'type' => null, 'status' => 1, - 'total_req' => 0, 'log_message' => '', 'author_id' => -1); - return $tpl; - } - - - /** - * - */ - function clone_revision($rspecID,$item) - { - $fields2copy = "parent_id,id,revision,doc_id,name,scope,total_req,status,type,log_message"; - - // Create a new revision node on db - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('msg' => 'ok','status_ok' => 1,'id' => -1); - $ret['id'] = $this->tree_mgr->new_node($rspecID,$this->node_types_descr_id['requirement_spec_revision']); - - if( !isset($item['source_id']) || ($item['source_id'] < 0) ) - { - $dummy = $this->get_last_child_info($rspecID); - $source_id = $dummy['id']; - } - else - { - $source_id = $item['source_id']; - } - - // get data to clone - $sourceItem = $this->getRevisionByID($source_id); - $sourceItem['log_message'] = $item['log_message']; - $sourceItem['author_id'] = $item['author_id']; - $sourceItem['revision']++; - - unset($sourceItem['modifier_id']); - unset($sourceItem['modification_ts']); - unset($sourceItem['creation_ts']); - - $ret = $this->create_revision($rspecID,$sourceItem); - if( $ret['status_ok'] ) - { - $source = array('parent_id' => $rspecID, 'item_id' => $source_id, - 'tproject_id' => $sourceItem['testproject_id']); - $dest_id = $ret['id']; - $this->copy_cfields($source,$ret['id']); - } - - return $ret; - - } - - - /** - * - * - */ - function getRevisionByID($id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('decode_user' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = '/* $debugMsg */' . - " SELECT RSPEC_REV.*, RSPEC.testproject_id " . - " FROM {$this->tables['req_specs_revisions']} RSPEC_REV " . - " JOIN {$this->tables['req_specs']} RSPEC " . - " ON RSPEC.id = RSPEC_REV.parent_id " . - " WHERE RSPEC_REV.id={$id} "; - - $ret = $this->db->get_recordset($sql); - if( !is_null($ret) && $my['options']['decode_user']) - { - $this->decode_users($ret); - } - return (!is_null($ret) ? $ret[0] : null); - } - - - /** - * - * - */ - function update_revision($item) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if( !isset($item['revision_id']) || is_null($item['revision_id']) ) - { - // will go to update LATEST - $info = $this->get_last_child_info($item['id'],array('output' => 'credentials')); - $targetID = $info['id']; - } - else - { - $targetID = $item['revision_id']; - } - - $sql = '/* $debugMsg */' . - " UPDATE {$this->tables['req_specs_revisions']} " . - " SET scope = '" . $this->db->prepare_string($item['scope']) . "', " . - " modifier_id = " . $item['modifier_id'] . ", " . - " modification_ts = " . $this->db->db_now() . - " WHERE id={$targetID} "; - $stat = $this->db->exec_query($sql); - return array('id' => $targetID); - } - - - /** - * - */ - function get_all_id_in_testproject($tproject_id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => 'classic'); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = "/* $debugMsg */ " . - " SELECT RSPEC.id FROM {$this->object_table} RSPEC WHERE testproject_id={$tproject_id}"; - - $rs = $this->db->get_recordset($sql); - switch($my['options']['output']) - { - case 'id': - $rx = array(); - foreach($rs as $elem) - { - $rx[] = $elem['id']; - } - return $rx; - break; - - default: - return $rs; - break; - } - } - - - /** - * - */ - function getAssignedCoverage($id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array( 'order_by' => " ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id", - 'output' => 'standard'); - $my['options'] = array_merge($my['options'], (array)$options); - - - $sql = "/* $debugMsg */ SELECT NH_REQ.id,U.login, REQ_COV.creation_ts " . - " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . - " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ_COV.req_id=NH_REQ.id " . - " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = REQ_COV.author_id "; - $sql .= " WHERE NH_REQ.parent_id={$id} " . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']}"; - $itemSet = $this->db->fetchRowsIntoMap($sql,'id'); - return $itemSet; - } - - /** - * - */ - function simplexml_load_file_helper($filename) - { - // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html - libxml_disable_entity_loader(true); - $zebra = file_get_contents($filename); - $xml = @simplexml_load_string($zebra); - return $xml; - } - - /** - * - * @used-by - */ - function getFileUploadRelativeURL($id) - { - $url = "lib/requirements/reqSpecEdit.php?doAction=fileUpload&req_spec_id=" . intval($id); - return $url; - } - - /** - * - * @used-by - */ - function getDeleteAttachmentRelativeURL($id) - { - $url = "lib/requirements/reqSpecEdit.php?doAction=deleteFile&req_spec_id=" . intval($id) . "&file_id=" ; - return $url; - } - - /** - * Copy attachments from source to target - * - **/ - function copy_attachments($source_id,$target_id) - { - return $this->attachmentRepository->copyAttachments($source_id,$target_id,$this->attachmentTableName); - } - - - /** - * - * - * - */ - function getReqsOnSpecForLatestTCV($id, $tcase_id=null, $options=null, $filters = null) { - - static $tcMgr; - - if( !$tcMgr ) { - $tcMgr = new testcase( $this->db ); - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = - array('order_by' => ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', - 'output' => 'standard', 'outputLevel' => 'std', 'decodeUsers' => true, - 'version_string' => lang_get('version_short')); - - $my['options'] = array_merge($my['options'], (array)$options); - - // null => do not filter - $my['filters'] = array('link_status' => 1, 'type' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - - // - $ltcv = null; - if( null == $tcase_id ) { - $tcversionJoin = - " JOIN {$this->views['latest_tcase_version_id']} LTCV " . - " ON LTCV.tcversion_id = RCOV.tcversion_id "; - } else { - $tcInfo = current($tcMgr->get_last_active_version($tcase_id)); - $ltcv = intval($tcInfo['tcversion_id']); - $tcversionJoin = " AND RCOV.tcversion_id = " . $ltcv; - } - - - // Step 1 - - // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN - // - // Step 2 - - // Need to get only the Req Versions That are Assigned - // to Latest Active Test Case Version - // I'm doing this because I'm calling this function from - // the Test Spec Tree and in this context I CAN NOT choose - // test case version - // - $filters = ''; - if( null != $my['filters']['link_status'] ) { - $nu = (array)$my['filters']['link_status']; - $filters .= ' AND link_status IN(' . implode(',',$nu) . ')'; - } - - // Postgres => USER is reserved keyword !! - $lblVersion = $my['options']['version_string']; - $sql = "/* $debugMsg */ " . - " SELECT RCOV.id as link_id, NH_REQ.id,RCOV.req_version_id," . - " REQVER.scope, " . - " CONCAT(NH_REQ.name,' [{$lblVersion}',REQVER.version ,'] ' ) AS title," . - " REQ.req_doc_id, REQVER.version,TLUSER.login AS coverage_author, + JOIN {$this->tables['requirements']} REQ ON REQ_REL.destination_id = REQ.id where REQ_REL.source_id={$id}"; + return $this->db->get_recordset($sql); + } + + /* + * function: get_by_title + * get req spec information using title as access key. + * + * args : title: req spec title + * [tproject_id] + * [parent_id] + * [case_analysis]: control case sensitive search. + * default 0 -> case sensivite search + * + * returns: map. + * key: req spec id + * value: srs info, map with folowing keys: + * id + * testproject_id + * doc_id + * title + * scope + * total_req + * type + * author_id + * creation_ts + * modifier_id + * modification_ts + */ + private function get_by_title($title, $tproject_id = null, $parent_id = null, + $case_analysis = self::CASE_SENSITIVE) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $title = trim($title); + $the_title = $this->db->prepare_string($title); + $sql = "/* $debugMsg */ " . + " SELECT RSPEC.id,testproject_id,RSPEC.doc_id,RSPEC.scope,RSPEC.total_req,RSPEC.type," . + " RSPEC.author_id,RSPEC.creation_ts,RSPEC.modifier_id," . + " RSPEC.modification_ts,NH.name AS title " . + " FROM {$this->object_table} RSPEC, {$this->tables['nodes_hierarchy']} NH"; + + switch ($case_analysis) { + case self::CASE_SENSITIVE: + $sql .= " WHERE NH.name='{$the_title}'"; + break; + + case self::CASE_INSENSITIVE: + $sql .= " WHERE UPPER(NH.name)='" . strtoupper($the_title) . "'"; + break; + } + $sql .= " AND RSPEC.id=NH.id "; + + if (! is_null($tproject_id)) { + $sql .= " AND RSPEC.testproject_id={$tproject_id}"; + } + + if (! is_null($parent_id)) { + $sql .= " AND NH.parent_id={$parent_id}"; + } + + $sql .= " AND RSPEC.id=NH.id "; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /* + * function: check_title + * Do checks on req spec title, to understand if can be used. + * + * Checks: + * 1. title is empty ? + * 2. does already exist a req spec with this title? + * + * args : title: req spec title + * [parent_id]: default null -> do check for tile uniqueness system wide. + * valid id: only inside parent_id with this id. + * + * [id]: req spec id. + * [case_analysis]: control case sensitive search. + * default 0 -> case sensivite search + * + * returns: + * + */ + private function check_title($title, $tproject_id = null, $parent_id = null, + $id = null, $case_analysis = self::CASE_SENSITIVE) + { + $ret['status_ok'] = 1; + $ret['msg'] = ''; + + $title = trim($title); + + if ($title == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_req_title"); + } + + if ($ret['status_ok']) { + $ret['msg'] = 'ok'; + $rs = $this->get_by_title($title, $tproject_id, $parent_id, + $case_analysis); + if (! is_null($rs) && (is_null($id) || ! isset($rs[$id]))) { + $ret['msg'] = sprintf(lang_get("warning_duplicate_req_title"), + $title); + $ret['status_ok'] = 0; + } + } + return $ret; + } + + // function end + + /* + * function: check_main_data + * Do checks on req spec title and doc id, to understand if can be used. + * + * Checks: + * 1. title is empty ? + * 2. doc is is empty ? + * 3. does already exist a req spec with this title? + * 4. does already exist a req spec with this doc id? + * + * VERY IMPORTANT: + * $tlCfg->req_cfg->child_requirements_mgmt has effects on check on already + * existent title or doc id. + * + * $tlCfg->req_cfg->child_requirements_mgmt == ENABLED => N level tree + * title and doc id can not repited on ANY level of tree + * + * This is important due to unique index present on Database + * ATTENTION: + * Must be rethinked!!!! + * + * + * args : title: req spec title + * doc_id: req spec document id / code / short title + * [parent_id]: default null -> do check for tile uniqueness system wide. + * valid id: only inside parent_id with this id. + * + * [id]: req spec id. + * [case_analysis]: control case sensitive search. + * default 0 -> case sensivite search + * + * returns: + * + */ + public function check_main_data($title, $doc_id, $tproject_id = null, + $parent_id = null, $id = null, $case_analysis = self::CASE_SENSITIVE) + { + $ret['status_ok'] = 1; + $ret['msg'] = ''; + + $title = trim($title); + $doc_id = trim($doc_id); + + if ($title == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_req_title"); + } + + if ($doc_id == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_doc_id"); + } + + if ($ret['status_ok']) { + $ret['msg'] = 'ok'; + $rs = $this->getByDocID($doc_id, $tproject_id); + if (! is_null($rs) && (is_null($id) || ! isset($rs[$id]))) { + $info = current($rs); + $ret['msg'] = sprintf( + lang_get("warning_duplicated_req_spec_doc_id"), + $info['title'], $doc_id); + $ret['status_ok'] = 0; + } + } + + return $ret; + } + + /* + * function: + * + * args : + * $nodes: array with req_spec in order + * returns: + * + */ + public function set_order($map_id_order) + { + $this->tree_mgr->change_order_bulk($map_id_order); + } + + // set_order($map_id_order) + + /* + * function: + * + * args: + * + * returns: + * + */ + public function get_requirements_count($id, $range = 'all', + $testcase_id = null, $filters = null) + { + // filters => array('status' => NON_TESTABLE_REQ, 'type' => 'X'); + $options = array( + 'output' => 'count' + ); + return $this->get_requirements($id, $range, $testcase_id, $options, + $filters); + } + + /** + * getReqTree + * + * Example of returned value ( is a recursive one ) + * ( + * [childNodes] => Array + * ([0] => Array + * ( [id] => 216 + * [parent_id] => 179 + * [node_type_id] => 6 + * [node_order] => 0 + * [node_table] => req_specs + * [name] => SUB-R + * [childNodes] => Array + * ([0] => Array + * ( [id] => 181 + * [parent_id] => 216 + * [node_type_id] => 7 + * [node_order] => 0 + * [node_table] => requirements + * [name] => Gamma Ray Emissions + * [childNodes] => + * ) + * [1] => Array + * ( [id] => 182 + * [parent_id] => 216 + * [node_type_id] => 7 + * [node_order] => 0 + * [node_table] => requirements + * [name] => Coriolis Effet + * [childNodes] => + * ) + * ) + * ) + * [1] => Array + * ( [id] => 217 + * [parent_id] => 179 + * [node_type_id] => 6 + * [node_order] => 0 + * [node_table] => req_specs + * [name] => SUB-R2 + * [childNodes] => Array + * ... + */ + public function getReqTree($id) + { + $filters = null; + $options = array( + 'recursive' => true + ); + return $this->tree_mgr->get_subtree($id, $filters, $options); + } + + /** + * exportReqSpecToXML + * create XML string with following req spec data + * - basic data (title, scope) + * - custom fields values + * - children: can be other req spec or requirements + * (tree leaves) + * + * Developed using exportTestSuiteDataToXML() as model + */ + public function exportReqSpecToXML($id, $tproject_id, + $optForExport = array()) + { + // manage missing keys; recursive export by default + if (! array_key_exists('RECURSIVE', $optForExport)) { + $optForExport['RECURSIVE'] = true; + } + + $relXmlData = ''; + $relationsCache = array(); + + $cfXML = null; + $xmlData = null; + if ($optForExport['RECURSIVE']) { + $cfXML = $this->customFieldValuesAsXML($id, $tproject_id); + $containerData = $this->get_by_id($id); + $xmlData = "' . "\n" . + "\t\n" . + "\t\n" . + "\t\n" . + "\t\n" . + "\t\n\t\t{$cfXML}"; + } + + // Add attachments info + if (isset($optForExport['ATTACHMENTS']) && $optForExport['ATTACHMENTS']) { + + $attachments = null; + $attachSet = $this->attachmentRepository->getAttachmentInfosFor($id, + $this->attachmentTableName, 'id'); + + // get all attachments content and encode it in base64 + if ($attachSet) { + foreach ($attachSet as $attInfo) { + $aID = $attInfo["id"]; + $content = $this->attachmentRepository->getAttachmentContent( + $aID, $attInfo); + + if ($content != null) { + $attachments[$aID]["id"] = $aID; + $attachments[$aID]["name"] = $attInfo["file_name"]; + $attachments[$aID]["file_type"] = $attInfo["file_type"]; + $attachments[$aID]["title"] = $attInfo["title"]; + $attachments[$aID]["date_added"] = $attInfo["date_added"]; + $attachments[$aID]["content"] = base64_encode($content); + } + } + } + + if (! empty($attachments)) { + $attchRootElem = "\t\n{{XMLCODE}}\t\n"; + $attchElemTemplate = "\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\n"; + + $attchDecode = array( + "||ATTACHMENT_ID||" => "id", + "||ATTACHMENT_NAME||" => "name", + "||ATTACHMENT_FILE_TYPE||" => "file_type", + "||ATTACHMENT_TITLE||" => "title", + "||ATTACHMENT_DATE_ADDED||" => "date_added", + "||ATTACHMENT_CONTENT||" => "content" + ); + $xmlData .= exportDataToXML($attachments, $attchRootElem, + $attchElemTemplate, $attchDecode, true); + } + } + + $req_spec = $this->getReqTree($id); + $childNodes = isset($req_spec['childNodes']) ? $req_spec['childNodes'] : null; + if (! is_null($childNodes)) { + $loop_qty = count($childNodes); + for ($idx = 0; $idx < $loop_qty; $idx ++) { + $cNode = $childNodes[$idx]; + if ($optForExport['RECURSIVE'] && + $cNode['node_table'] == 'req_specs') { + $xmlData .= $this->exportReqSpecToXML($cNode['id'], + $tproject_id, $optForExport); + } elseif ($cNode['node_table'] == 'requirements') { + $xmlData .= $this->req_mgr->exportReqToXML($cNode['id'], + $tproject_id, $optForExport['ATTACHMENTS']); + + $relations = $this->req_mgr->get_relations($cNode['id']); + if (! empty($relations['relations'])) { + foreach ($relations['relations'] as $rel) { + // If we have already found this relation, skip it. + if (! in_array($rel['id'], $relationsCache)) { + // otherwise export it to XML. + // $testproject_id = $this->relationsCfg->interProjectLinking ? $tproject_id : null; + $relXmlData .= $this->req_mgr->exportRelationToXML( + $rel, $tproject_id, + $this->relationsCfg->interProjectLinking); + $relationsCache[] = $rel['id']; + } + } + } + } + } + + // after we scanned all relations and exported all relations to xml, let's output it to the XML buffer + $xmlData .= $relXmlData; + } + + if ($optForExport['RECURSIVE']) { + $xmlData .= "\n"; + } + return $xmlData; + } + + /** + * xmlToReqSpec + * + * @param object $source: + * $source->type: possible values 'string', 'file' + * $source->value: depends of $source->type + * 'string' => xml string + * 'file' => path name of XML file + * + */ + private function xmlToReqSpec($source) + { + $req_spec = null; + switch ($source->type) { + case 'string': + break; + + case 'file': + $xml_file = $source->value; + (@$this->simplexml_load_file_helper($xml_file)) !== false; + break; + } + + return $req_spec; + } + + /** + * xmlToMapReqSpec + */ + private function xmlToMapReqSpec($xml_item, $level = 0) + { + static $mapped; + + // Attention: following PHP Manual SimpleXML documentation, Please remember to cast + // before using data from $xml, + if (is_null($xml_item)) { + return null; + } + + // used to reset static structures if calling this in loop + if ($level == 0) { + $mapped = null; + } + + $dummy = array(); + $dummy['node_order'] = (int) $xml_item->node_order; + $dummy['scope'] = (string) $xml_item->scope; + $dummy['type'] = (int) $xml_item->type; + $dummy['total_req'] = (int) $xml_item->total_req; + $dummy['level'] = $level; + $depth = $level + 1; + + foreach ($xml_item->attributes() as $key => $value) { + $dummy[$key] = (string) $value; // See PHP Manual SimpleXML documentation. + } + + if (property_exists($xml_item, 'custom_fields')) { + $dummy['custom_fields'] = array(); + foreach ($xml_item->custom_fields->children() as $key) { + $dummy['custom_fields'][(string) $key->name] = (string) $key->value; + } + } + + if (property_exists($xml_item, 'attachments')) { + $dummy['attachments'] = array(); + foreach ($xml_item->attachments->children() as $attachment) { + $attach_id = (int) $attachment->id; + $dummy['attachments'][$attach_id]['id'] = (int) $attachment->id; + $dummy['attachments'][$attach_id]['name'] = (string) $attachment->name; + $dummy['attachments'][$attach_id]['file_type'] = (string) $attachment->file_type; + $dummy['attachments'][$attach_id]['title'] = (string) $attachment->title; + $dummy['attachments'][$attach_id]['date_added'] = (string) $attachment->date_added; + $dummy['attachments'][$attach_id]['content'] = (string) $attachment->content; + } + } + $mapped[] = array( + 'req_spec' => $dummy, + 'requirements' => null, + 'level' => $dummy['level'] + ); + + // Process children + if (property_exists($xml_item, 'requirement')) { + $loop2do = count($xml_item->requirement); + for ($idx = 0; $idx <= $loop2do; $idx ++) { + $xml_req = $this->req_mgr->xmlToMapRequirement( + $xml_item->requirement[$idx]); + if (! is_null($xml_req)) { + $fdx = count($mapped) - 1; + $mapped[$fdx]['requirements'][] = $xml_req; + } + } + } + + if (property_exists($xml_item, 'relation')) { + $loop3do = count($xml_item->relation); + for ($idx = 0; $idx <= $loop3do; $idx ++) { + $rel = $this->req_mgr->convertRelationXmlToRelationMap( + $xml_item->relation[$idx]); + if (! is_null($rel)) { + $fdx = count($mapped) - 1; + $mapped[$fdx]['relations'][] = $rel; + } + } + } + + if (property_exists($xml_item, 'req_spec')) { + $loop2do = count($xml_item->req_spec); + for ($idx = 0; $idx <= $loop2do; $idx ++) { + $this->xmlToMapReqSpec($xml_item->req_spec[$idx], $depth); + } + } + + return $mapped; + } + + // Custom field related functions + + /* + * function: get_linked_cfields + * Get all linked custom fields. + * Remember that custom fields are defined at system wide level, and + * has to be linked to a testproject, in order to be used. + * + * + * args: credentials, map with following keys + * item_id: Req. Spec REVISION ID (can be NULL if parent_id IS NOT NULL) + * parent_id: Req. Spec ID (can be NULL if item_id IS NOT NULL) + * tproject_id:node id of parent testproject of requirement spec. + * need to understand to which testproject requirement spec belongs. + * this information is vital, to get the linked custom fields. + * Presence /absence of this value changes starting point + * on procedure to build tree path to get testproject id. + * + * null -> use requirement spec id as starting point. + * !is_null -> use this value as starting point. + * + * returns: map/hash + * key: custom field id + * value: map with custom field definition and value assigned for choosen req spec, + * with following keys: + * + * id: custom field id + * name + * label + * type: custom field type + * possible_values: for custom field + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * value: value assigned to custom field for this req spec + * null if for this req spec custom field was never edited. + * + * node_id: req spec id + * null if for this req spec, custom field was never edited. + * + * + * @internal revisions + * + */ + public function get_linked_cfields($credentials) + { + $who = array( + 'item_id' => null, + 'parent_id' => null, + 'tproject_id' => null + ); + $who = array_merge($who, (array) $credentials); + + $tproject_id = $who['tproject_id']; + $hasParentInfo = ! is_null($who['parent_id']) && ($who['parent_id'] > 0); + + if ($hasParentInfo && (is_null($tproject_id) || is_null($who['item_id']))) { + // will get info for LAST revision + $info = $this->get_by_id($who['parent_id'], + array( + 'output' => 'credentials' + )); + $tproject_id = $info['testproject_id']; + $who['item_id'] = $info['revision_id']; + } + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + cfield_mgr::CF_ENABLED, null, 'requirement_spec', $who['item_id']); + } + + /* + * function: html_table_of_custom_field_inputs + * Return html code, implementing a table with custom fields labels + * and html inputs, for choosen req spec. + * Used to manage user actions on custom fields values. + * + * + * args: $id + * [tproject_id]: node id of testproject (req spec parent). + * this information is vital, to get the linked custom fields, + * because custom fields are system wide, but to be used are + * assigned to a test project. + * is null this method or other called will use get_path() + * method to get test project id. + * + * [parent_id]: Need to e rethinked, may be remove (20090111 - franciscom) + * + * [$name_suffix]: must start with '_' (underscore). + * Used when we display in a page several items + * (example during test case execution, several test cases) + * that have the same custom fields. + * In this kind of situation we can use the item id as name suffix. + * + * + * returns: html string + * + */ + public function html_table_of_custom_field_inputs($id, $child_id, + $tproject_id = null, $parent_id = null, $name_suffix = '', + $input_values = null) + { + $idCard = array( + 'parent_id' => $id, + 'item_id' => $child_id, + 'tproject_id' => $tproject_id + ); + $cf_map = $this->get_linked_cfields($idCard); + return $this->cfield_mgr->html_table_inputs($cf_map, $name_suffix, + $input_values); + } + + /* + * function: html_table_of_custom_field_values + * Return html code, implementing a table with custom fields labels + * and custom fields values, for choosen req spec. + * You can think of this function as some sort of read only version + * of html_table_of_custom_field_inputs. + * + * + * args: $id + * + * returns: html string + * + */ + public function html_table_of_custom_field_values($id, $child_id, + $tproject_id) + { + $NO_WARNING_IF_MISSING = true; + $cf_smarty = ''; + + $idCard = array( + 'parent_id' => $id, + 'item_id' => $child_id, + 'tproject_id' => $tproject_id + ); + $cf_map = $this->get_linked_cfields($idCard); + $show_cf = config_get('custom_fields')->show_custom_fields_without_value; + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + // if user has assigned a value, then node_id is not null + if ($cf_info['node_id'] || $show_cf) { + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, $NO_WARNING_IF_MISSING)); + + $cf_smarty .= '' . + htmlspecialchars($label) . ":" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $id) . "\n"; + } + } + + if (trim($cf_smarty) != "") { + $cf_smarty = "" . $cf_smarty . "
    "; + } + } + return $cf_smarty; + } + + /* + * function: values_to_db + * write values of custom fields to db + * + * args: hash: + * key: custom_field__. + * Example custom_field_0_67 -> 0=> string field + * + * node_id: req spec id + * + * [cf_map]: hash -> all the custom fields linked and enabled + * that are applicable to the node type of $node_id. + * + * For the keys not present in $hash, we will write + * an appropriate value according to custom field + * type. + * + * This is needed because when trying to udpate + * with hash being $_REQUEST, $_POST or $_GET + * some kind of custom fields (checkbox, list, multiple list) + * when has been deselected by user. + * + * [hash_type] + * + * rev: + */ + public function values_to_db($hash, $node_id, $cf_map = null, + $hash_type = null) + { + $this->cfield_mgr->design_values_to_db($hash, $node_id, $cf_map, + $hash_type); + } + + /** + * customFieldValuesAsXML + * + * @param int $id: + * requirement + * spec id + * @param int $tproject_id: + * testproject id + */ + private function customFieldValuesAsXML($id, $tproject_id) + { + $xml = null; + + $idCard = array( + 'parent_id' => $id, + 'item_id' => null, + 'tproject_id' => $tproject_id + ); + $cfMap = $this->get_linked_cfields($idCard); + if (! empty($cfMap)) { + $xml = $this->cfield_mgr->exportValueAsXML($cfMap); + } + return $xml; + } + + /** + * create a req spec tree on system from $xml data + * + * + * @internal revisions + */ + public function createFromXML($xml, $tproject_id, $parent_id, $author_id, + $filters = null, $options = null) + { + static $labels; + static $missingCfMsg; + static $linkedCF; + static $messages; + static $doProcessCF = false; + + // init static items + if (is_null($labels)) { + $labels = array( + 'import_req_spec_created' => '', + 'import_req_spec_skipped' => '', + 'import_req_spec_updated' => '', + 'import_req_spec_ancestor_skipped' => '', + 'import_req_created' => '', + 'import_req_skipped' => '', + 'import_req_updated' => '' + ); + foreach ($labels as $key => $dummy) { + $labels[$key] = lang_get($key); + } + + $messages = array(); + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + + $linkedCF = $this->cfield_mgr->get_linked_cfields_at_design( + $tproject_id, cfield_mgr::CF_ENABLED, null, 'requirement_spec', + null, 'name'); + $doProcessCF = true; + } + + $user_feedback = null; + $copy_req = null; + $getOptions = array( + 'output' => 'minimun' + ); + $my['options'] = array( + 'skipFrozenReq' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $items = $this->xmlToMapReqSpec($xml); + + $has_filters = ! is_null($filters); + if ($has_filters && ! is_null($filters['requirements'])) { + foreach ($filters['requirements'] as $reqspec_pos => $requirements_pos) { + $copy_req[$reqspec_pos] = is_null($requirements_pos) ? null : array_keys( + $requirements_pos); + } + } + + $loop2do = count($items); + $container_id[0] = (is_null($parent_id) || $parent_id == 0) ? $tproject_id : $parent_id; + + // items is an array of req. specs + $skip_level = - 1; + for ($idx = 0; $idx < $loop2do; $idx ++) { + $rspec = $items[$idx]['req_spec']; + $depth = $rspec['level']; + if ($skip_level > 0 && $depth >= $skip_level) { + $msgID = 'import_req_spec_ancestor_skipped'; + $user_feedback[] = array( + 'doc_id' => $rspec['doc_id'], + 'title' => $rspec['title'], + 'import_status' => sprintf($labels[$msgID], $rspec['doc_id']) + ); + continue; + } + $req_spec_order = isset($rspec['node_order']) ? $rspec['node_order'] : 0; + + // Check if req spec with same DOCID exists, inside container_id + // If there is a hit + // We will go in update + // If Check fails, need to repeat check on WHOLE Testproject. + // If now there is a HIT we can not import this branch + // If Check fails => we can import creating a new one. + // + // Important thing: + // Working in this way, i.e. doing check while walking the structure to import + // we can end importing struct with 'holes'. + // + $check_in_container = $this->getByDocID($rspec['doc_id'], + $tproject_id, $container_id[$depth], $getOptions); + $hasAttachments = array_key_exists('attachments', $rspec); + + $skip_level = $depth + 1; + $result['status_ok'] = 0; + $msgID = 'import_req_spec_skipped'; + + if (is_null($check_in_container)) { + $check_in_tproject = $this->getByDocID($rspec['doc_id'], + $tproject_id, null, $getOptions); + if (is_null($check_in_tproject)) { + $importMode = 'creation'; + $msgID = 'import_req_spec_created'; + $result = $this->create($tproject_id, $container_id[$depth], + $rspec['doc_id'], $rspec['title'], $rspec['scope'], + $rspec['total_req'], $author_id, $rspec['type'], + $req_spec_order); + } + } else { + $importMode = 'update'; + $msgID = 'import_req_spec_updated'; + $reqSpecID = key($check_in_container); + $item = array( + 'id' => $reqSpecID, + 'name' => $rspec['title'], + 'doc_id' => $rspec['doc_id'], + 'scope' => $rspec['scope'], + 'total_req' => $rspec['total_req'], + 'modifier_id' => $author_id, + 'type' => $rspec['type'], + 'node_order' => $req_spec_order + ); + + // ATTENTION update return key => revision_id, because CF values are saved at REVISION LEVEL + $result = $this->update($item); + $result['id'] = $reqSpecID; + } + $user_feedback[] = array( + 'doc_id' => $rspec['doc_id'], + 'title' => $rspec['title'], + 'import_status' => sprintf($labels[$msgID], $rspec['doc_id']) + ); + + // process attachements for creation and update + if ($result['status_ok'] && $hasAttachments) { + $addAttachmentsResponse = $this->processAttachments($importMode, + $result['id'], $rspec['attachments'], $feedbackMsg); + } + // display only problems during attachments import + if (isset($addAttachmentsResponse) && + ! is_null($addAttachmentsResponse)) { + foreach ($addAttachmentsResponse as $att_name) { + $user_feedback[] = array( + 'doc_id' => $rspec['doc_id'], + 'title' => $rspec['title'], + 'import_status' => sprintf( + lang_get('import_req_spec_attachment_skipped'), + $att_name) + ); + } + } + if ($result['status_ok'] && $doProcessCF && + isset($rspec['custom_fields']) && + ! is_null($rspec['custom_fields'])) { + $cf2insert = null; + foreach ($rspec['custom_fields'] as $cfname => $cfvalue) { + $cfname = trim($cfname); + if (isset($linkedCF[$cfname])) { + $cf2insert[$linkedCF[$cfname]['id']] = array( + 'type_id' => $linkedCF[$cfname]['type'], + 'cf_value' => $cfvalue + ); + } else { + if (! isset($missingCfMsg[$cfname])) { + $missingCfMsg[$cfname] = sprintf( + $messages['cfield'], $cfname, + $labels['requirement']); + } + $user_feedback[] = array( + 'doc_id' => $rspec['docid'], + 'title' => $rspec['title'], + 'import_status' => $missingCfMsg[$cfname] + ); + } + } + if (! is_null($cf2insert)) { + $this->cfield_mgr->design_values_to_db($cf2insert, + $result['revision_id'], null, 'simple'); + } + } + + if ($result['status_ok']) { + $skip_level = - 1; + $container_id[$depth + 1] = ($reqSpecID = $result['id']); + $reqSet = $items[$idx]['requirements']; + $create_req = (! $has_filters || isset($copy_req[$idx])) && + ! is_null($reqSet); + if ($create_req) { + $items_qty = isset($copy_req[$idx]) ? count($copy_req[$idx]) : count( + $reqSet); + $keys2insert = isset($copy_req[$idx]) ? $copy_req[$idx] : array_keys( + $reqSet); + for ($jdx = 0; $jdx < $items_qty; $jdx ++) { + $req = $reqSet[$keys2insert[$jdx]]; + $dummy = $this->req_mgr->createFromMap($req, + $tproject_id, $reqSpecID, $author_id, null, + $my['options']); + $user_feedback = array_merge($user_feedback, $dummy); + } + } + + if (isset($items[$idx]['relations'])) { + $relationsMap = $items[$idx]['relations']; + $numberOfRelations = count($relationsMap); + for ($jdx = 0; $jdx < $numberOfRelations; $jdx ++) { + $rel = $relationsMap[$jdx]; + $dummy = $this->req_mgr->createRelationFromMap($rel, + $tproject_id, $author_id); + $user_feedback = array_merge($user_feedback, $dummy); + } + } + } + } + return $user_feedback; + } + + /* + * function: getByDocID + * get req spec information using document ID as access key. + * + * args : doc_id: + * [tproject_id] + * [parent_id] + * [options]: + * [case]: control case sensitive search. + * default 0 -> case sensivite search + * [access_key]: + * [check_criteria]: + * [output]: + * + * returns: map. + * key: req spec id + * value: srs info, map with folowing keys: + * id + * testproject_id + * title + * scope + * total_req + * type + * author_id + * creation_ts + * modifier_id + * modification_ts + * + */ + public function getByDocID($doc_id, $tproject_id = null, $parent_id = null, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'check_criteria' => '=', + 'access_key' => 'id', + 'case' => 'sensitive', + 'output' => 'standard' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $output = null; + $the_doc_id = $this->db->prepare_string(trim($doc_id)); + + switch ($my['options']['check_criteria']) { + case 'like': + $check_criteria = " LIKE '{$the_doc_id}%' "; + break; + + case '=': + default: + $check_criteria = " = '{$the_doc_id}' "; + break; + } + + $where = " WHERE RSPEC.doc_id {$check_criteria} "; + if (! is_null($tproject_id)) { + $where .= " AND RSPEC.testproject_id={$tproject_id}"; + } + if (! is_null($parent_id)) { + $where .= " AND NH_RSPEC.parent_id={$parent_id}"; + } + + // Developer Note: + // a mix of SQL ignorance and MySQL relaxed SQL on GROUP BY + // Fortunatelly Postgres do the right job + // + // + // First step get MAX revision + // will trust in this that max(revision) has also always max(revision_id) + // ( but really can be on a differente way ? ), in order to use a simple logic. + // + $sql_max = " /* $debugMsg */ SELECT MAX(RSPEC_REV.id) AS rev_id" . + " FROM {$this->tables['req_specs']} RSPEC " . + " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . + " ON RSPEC_REV.parent_id = RSPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . + " ON NH_RSPEC.id = RSPEC.id " . $where . + ' GROUP BY RSPEC_REV.parent_id '; + + $maxi = (array) $this->db->fetchRowsIntoMap($sql_max, 'rev_id'); + if (count($maxi) > 0) { + $sql = " /* $debugMsg */ SELECT RSPEC.id,RSPEC.testproject_id,RSPEC.doc_id,NH_RSPEC.name AS title, " . + " RSPEC_REV.revision "; + + switch ($my['options']['output']) { + case 'standard': + $sql .= " ,RSPEC_REV.total_req, RSPEC_REV.scope,RSPEC_REV.type," . + " RSPEC_REV.author_id,RSPEC_REV.creation_ts, " . + " RSPEC_REV.modifier_id,RSPEC_REV.modification_ts"; + break; + + case 'minimun': + break; + } + + $sql .= " FROM {$this->tables['req_specs']} RSPEC " . + " JOIN {$this->tables['req_specs_revisions']} RSPEC_REV " . + " ON RSPEC_REV.parent_id = RSPEC.id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_RSPEC " . + " ON NH_RSPEC.id = RSPEC.id "; + + $sql .= $where . ' AND RSPEC_REV.id IN (' . + implode(",", array_keys($maxi)) . ') '; + $output = $this->db->fetchRowsIntoMap($sql, + $my['options']['access_key']); + } + + return $output; + } + + /* + * function: copy_to + * deep copy one req spec to another parent (req spec or testproject). + * + * + * args : id: req spec id (source or copy) + * parent_id: + * user_id: who is requesting copy operation + * [options] + * + * returns: map with following keys: + * status_ok: 0 / 1 + * msg: 'ok' if status_ok == 1 + * id: new created if everything OK, -1 if problems. + * + * rev : + */ + public function copy_to($id, $parent_id, $tproject_id, $user_id, + $options = null) + { + static $get_tree_nt2exclude; + if (! $get_tree_nt2exclude) { + $get_tree_nt2exclude = array( + 'req_version' => 'exclude_me', + 'req_revision' => 'exclude_me', + 'requirement_spec_revision' => 'exclude_me' + ); + } + + $my['options'] = array( + 'copy_also' => null + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $item_info = $this->get_by_id($id); + $target_doc = $this->generateDocID($id, $tproject_id); + $new_item = $this->create($tproject_id, $parent_id, $target_doc, + $item_info['title'], $item_info['scope'], $item_info['total_req'], + $item_info['author_id'], $item_info['type'], + $item_info['node_order']); + + $op = $new_item; + if ($new_item['status_ok']) { + $op['mappings'][$id] = $new_item['id']; + $op['mappings']['req_spec'] = array(); + $op['mappings']['req'] = array(); + $op['mappings']['req_version'] = array(); + $op['mappings']['req_tree'] = array(); + + $idCard = array( + 'parent_id' => $id, + 'tproject_id' => $tproject_id + ); + $this->copy_cfields($idCard, $new_item['id']); + + $this->copyAttachments($id, $new_item['id']); + + // Now loop to copy all items inside it + // null is OK, because $id is a req spec, there is no risk + // to copy/traverse wrong node types. + // Hmmm may be req_revi ??? + $my['filters']['exclude_node_types'] = $get_tree_nt2exclude; + $subtree = $this->tree_mgr->get_subtree($id, $my['filters'], + array( + 'output' => 'essential' + )); + + if (! is_null($subtree)) { + $reqMgr = new requirement_mgr($this->db); + $parent_decode = array(); + $parent_decode[$id] = $new_item['id']; + + // using reference has to avoid duplicate => memory consumption + // (at least this is info found on Internet) + // Few test indicates that it's true, but that using a counter + // is still better. + // + $loop2do = count($subtree); + for ($sdx = 0; $sdx <= $loop2do; $sdx ++) { + $elem = &$subtree[$sdx]; + $the_parent_id = isset($parent_decode[$elem['parent_id']]) ? $parent_decode[$elem['parent_id']] : null; + + switch ($elem['node_type_id']) { + case $this->node_types_descr_id['requirement']: + $ret = $reqMgr->copy_to($elem['id'], $the_parent_id, + $user_id, $tproject_id, $my['options']); + + $op['status_ok'] = $ret['status_ok']; + $op['mappings']['req'] += $ret['mappings']['req']; + $op['mappings']['req_version'] += $ret['mappings']['req_version']; + $op['mappings']['req_tree'] += $ret['mappings']['req_tree']; + break; + + case $this->node_types_descr_id['requirement_spec']: + $item_info = $this->get_by_id($elem['id']); + + // hmm, when copy_to() is called because we are duplicating + // a test project, call to generateDocID(), can be avoided. + // we have IMHO an absolute inexistent risk. + $target_doc = $this->generateDocID($elem['id'], + $tproject_id); + + $ret = $this->create($tproject_id, $the_parent_id, + $target_doc, $item_info['title'], + $item_info['scope'], $item_info['total_req'], + $item_info['author_id'], $item_info['type'], + $item_info['node_order']); + + $parent_decode[$elem['id']] = $ret['id']; + $op['mappings']['req_spec'][$elem['id']] = $ret['id']; + + if ($op['status_ok'] = $ret['status_ok']) { + $this->copy_cfields( + array( + 'parent_id' => $elem['id'], + 'tproject_id' => $tproject_id + ), $ret['id']); + } + break; + } + + if ($op['status_ok'] == 0) { + break; + } + } + } + } + return $op; + } + + /* + * function: copy_cfields + * Get all cfields linked to item with the values presents for $from_id, + * item we are using as source for our copy. + * + * args: from_identity: source credentianls (complex type) + * array('parent_id' => , 'item_id' => , 'tproject_id' => ); + * + * to_id: target item id (simple type) + * + * returns: - + * + */ + private function copy_cfields($from_identity, $to_id) + { + $cfmap_from = $this->get_linked_cfields($from_identity); + + $cfield = null; + if (! is_null($cfmap_from)) { + foreach ($cfmap_from as $key => $value) { + $cfield[$key] = array( + "type_id" => $value['type'], + "cf_value" => $value['value'] + ); + } + } + $this->cfield_mgr->design_values_to_db($cfield, $to_id, null, + 'tcase_copy_cfields'); + } + + /** + * processAttachments + * + * Analyze attachments info related to req spec to define if the the attachment has to be added. + * attachments are ignored only if a attachment with the same ID is already linked to the target ReqSpec. + * + * return an array of all attachments names of IDs already linked to target ReqSpec. + */ + private function processAttachments($importMode, $rs_id, $attachments, + $feedbackMsg) + { + $tables = tlObjectWithDB::getDBTables( + array( + 'req_specs', + 'attachments' + )); + + $knownAttachments = array(); + foreach ($attachments as $attachment) { + $addAttachment = true; + if ($importMode == 'update') { + // try to bypass the importation of already known attachments. + // Check in database if the attachment with the same ID is linked to the rspec with the same internal ID + // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. + // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). + $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . + " WHERE ATT.id='{$this->db->prepare_string($attachment[id])}' " . + " AND ATT.fk_id={$rs_id} "; + $rsx = $this->db->get_recordset($sql); + $addAttachment = (is_null($rsx) || count($rsx) < 1); + if ($addAttachment === false) { // inform user that the attachment has been skipped + $knownAttachments[] = $attachment['name']; + } + } + if ($addAttachment) { + $attachRepo = tlAttachmentRepository::create($this->db); + $fileInfo = $attachRepo->createAttachmentTempFile( + $attachment['content']); + $fileInfo['name'] = $attachment['name']; + $fileInfo['type'] = $attachment['file_type']; + $attachRepo->insertAttachment($rs_id, $tables['req_specs'], + $attachment['title'], $fileInfo); + } + } + return $knownAttachments; + } + + /** + */ + private function generateDocID($id, $tproject_id) + { + $item_info = $this->get_by_id($id); + + // Check if another req with same DOC ID exists on target container, + // If yes generate a new DOC ID + $getOptions = array( + 'check_criteria' => 'like', + 'access_key' => 'doc_id' + ); + $itemSet = $this->getByDocID($item_info['doc_id'], $tproject_id, null, + $getOptions); + $target_doc = $item_info['doc_id']; + $instance = 1; + if (! is_null($itemSet)) { + // doc_id has limited size => we need to be sure that generated id + // will not exceed DB size + $nameSet = array_flip(array_keys($itemSet)); + + // 6 magic from " [xxx]" + $prefix = trimAndLimit($item_info['doc_id'], + $this->field_size->docid - 6); + $target_doc = $prefix . " [{$instance}]"; + while (isset($nameSet[$target_doc])) { + $instance ++; + $target_doc = $prefix . " [{$instance}]"; + } + } + return $target_doc; + } + + /** + */ + public function getFirstLevelInTestProject($tproject_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT * from {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id = {$tproject_id} " . + " AND node_type_id = {$this->node_types_descr_id['requirement_spec']} " . + " ORDER BY node_order,id"; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * IMPORTANT NOTICE + * Only information regarding basic tables is created. + * This means THAT NOTHING is done (example) on custom fields, or other + * items that are related/linked to revisions. + */ + private function create_revision($rspecID, $item) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $ret = array( + 'msg' => 'ok', + 'status_ok' => 1, + 'id' => - 1 + ); + $ret['id'] = $this->tree_mgr->new_node($rspecID, + $this->node_types_descr_id['requirement_spec_revision']); + + $optActorPairs = array( + 'author_id' => 'creation_ts', + 'modifier_id' => 'modification_ts' + ); + $val2add = ''; + $fields2insert = 'parent_id,id,revision,status,doc_id,name,scope,type,log_message'; + + foreach ($optActorPairs as $main => $sec) { + if (isset($item[$main]) && is_numeric($item[$main])) { + $fields2insert .= ',' . $main . ',' . $sec; + $ts = isset($item[$sec]) ? $item[$sec] : $this->db->db_now(); + $val2add .= ',' . intval($item[$main]) . ',' . $ts; + } + } + $optIntKeys = array( + 'status' => 1 + ); + foreach ($optIntKeys as $field => $default) { + $item[$field] = isset($item[$field]) ? $item[$field] : $default; + } + + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['req_specs_revisions']} " . + " ($fields2insert) " . " VALUES({$rspecID}" . "," . $ret['id'] . "," . + intval($item['revision']) . "," . intval($item['status']) . ",'" . + $this->db->prepare_string($item['doc_id']) . "','" . + $this->db->prepare_string($item['name']) . "','" . + $this->db->prepare_string($item['scope']) . "','" . + $this->db->prepare_string($item['type']) . "','" . + $this->db->prepare_string($item['log_message']) . "'" . $val2add . + ")"; + + $result = $this->db->exec_query($sql); + if ($result) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . + " SET name='" . $this->db->prepare_string($item['name']) . "' " . + " WHERE id={$ret['id']} "; + $this->db->exec_query($sql); + } else { + $ret['msg'] = $this->db->error_msg(); + $ret['status_ok'] = 0; + $ret['id'] = - 1; + } + + return $ret; + } + + /** + */ + private function create_new_revision($rspecID, $item) + { + // Needed to get higher revision NUMBER, to generata new NUMBER + $source_info = $this->get_last_child_info($rspecID); + $current_rev = 0; + if (! is_null($source_info)) { + $current_rev = $source_info['revision']; + } + $current_rev ++; + $item['revision'] = $current_rev ++; + + return $this->create_revision($rspecID, $item); + } + + /** + * + * @param + * id: parent id + * @param + * child_type: 'revision' + * + * @return + */ + private function get_last_child_info($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['options'] = array( + 'child_type' => 'revision', + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $info = null; + $target_cfg = array( + 'revision' => array( + 'table' => 'req_specs_revisions', + 'field' => 'revision' + ) + ); + + $child_type = $my['options']['child_type']; // just for readability + $table = $target_cfg[$child_type]['table']; + $field = $target_cfg[$child_type]['field']; + + $sql = " /* $debugMsg */ SELECT COALESCE(MAX($field),-1) AS $field " . + " FROM {$this->tables[$table]} CHILD," . + " {$this->tables['nodes_hierarchy']} NH WHERE " . + " NH.id = CHILD.id " . " AND NH.parent_id = {$id} "; + + $max_verbose = $this->db->fetchFirstRowSingleColumn($sql, $field); + if ($max_verbose >= 0) { + $sql = "/* $debugMsg */ SELECT "; + + switch ($my['options']['output']) { + case 'credentials': + $sql .= " CHILD.parent_id,CHILD.id,CHILD.revision,CHILD.doc_id "; + break; + + case 'full': + default: + $sql .= " CHILD.* "; + break; + } + + $sql .= " FROM {$this->tables[$table]} CHILD," . + " {$this->tables['nodes_hierarchy']} NH " . + " WHERE $field = {$max_verbose} AND NH.id = CHILD.id AND NH.parent_id = {$id}"; + + $info = $this->db->fetchFirstRow($sql); + } + return $info; + } + + /** + * + * @param + * id: parent id + * @param + * child_type: 'revision' + * + * @return + */ + public function getRevisionsCount($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT COUNT(0) AS qty" . + " FROM {$this->tables['req_specs_revisions']} RSPEC_REV" . + " WHERE RSPEC_REV.parent_id = {$id} "; + + $dummy = $this->db->get_recordset($sql); + return $dummy[0]['qty']; + } + + /** + * used to create overwiew of changes between revisions + */ + private function get_history($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'output' => "map", + 'decode_user' => false, + 'order_by_dir' => 'DESC' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $labels['undefined'] = lang_get('undefined'); + $sql = "/* $debugMsg */" . + " SELECT RSREV.id AS revision_id, RSREV.revision," . + " RSREV.creation_ts, RSREV.author_id, " . + " RSREV.modification_ts, RSREV.modifier_id, " . + " RSREV.revision, RSREV.scope, " . + " RSREV.status,RSREV.type,RSREV.name, RSREV.doc_id, " . + " COALESCE(RSREV.log_message,'') AS log_message" . + " FROM {$this->tables['req_specs_revisions']} RSREV " . + " WHERE RSREV.parent_id = {$id} " . + " ORDER BY RSREV.revision {$my['options']['order_by_dir']} "; + + switch ($my['options']['output']) { + case 'map': + $rs = $this->db->fetchRowsIntoMap($sql, 'revision_id'); + break; + + case 'array': + $rs = $this->db->get_recordset($sql); + break; + } + + if (! is_null($rs)) { + $key2loop = array_keys($rs); + foreach ($key2loop as $ap) { + $rs[$ap]['item_id'] = $rs[$ap]['revision_id']; + + // IMPORTANT NOTICE + // each DBMS uses a different (unfortunatelly) way to signal NULL DATE + // + // We need to Check with ALL DB types + // MySQL NULL DATE -> "0000-00-00 00:00:00" + // Postgres NULL DATE -> NULL + // MSSQL NULL DATE - ??? + $key4date = 'creation_ts'; + $key4user = 'author_id'; + + $nullTS = $this->db->db_null_timestamp(); + if (($rs[$ap]['modification_ts'] != $nullTS) && + ! is_null($rs[$ap]['modification_ts']) && + ! is_null($rs[$ap]['modifier_id'])) { + $key4date = 'modification_ts'; + $key4user = 'modifier_id'; + } + $rs[$ap]['timestamp'] = $rs[$ap][$key4date]; + $rs[$ap]['last_editor'] = $rs[$ap][$key4user]; + + // decode user_id for last_editor + $user = tlUser::getByID($this->db, $rs[$ap]['last_editor']); + $rs[$ap]['last_editor'] = $user ? $user->getDisplayName() : $labels['undefined']; + } + } + + $history = $rs; + if ($my['options']['decode_user'] && ! is_null($history)) { + $this->decode_users($history); + } + + return $history; + } + + /** + */ + private function decode_users(&$rs) + { + $userCache = null; // key: user id, value: display name + $key2loop = array_keys($rs); + $labels['undefined'] = lang_get('undefined'); + $user_keys = array( + 'author' => 'author_id', + 'modifier' => 'modifier_id' + ); + foreach ($key2loop as $key) { + foreach ($user_keys as $ukey => $userid_field) { + $rs[$key][$ukey] = ''; + if (trim($rs[$key][$userid_field]) != "") { + if (! isset($userCache[$rs[$key][$userid_field]])) { + $user = tlUser::getByID($this->db, + $rs[$key][$userid_field]); + $rs[$key][$ukey] = $user ? $user->getDisplayName() : $labels['undefined']; + $userCache[$rs[$key][$userid_field]] = $rs[$key][$ukey]; + } else { + $rs[$key][$ukey] = $userCache[$rs[$key][$userid_field]]; + } + } + } + } + } + + /** + */ + private function getRevisionTemplate() + { + return array( + 'revision' => 1, + 'doc_id' => null, + 'name' => null, + 'scope' => null, + 'type' => null, + 'status' => 1, + 'total_req' => 0, + 'log_message' => '', + 'author_id' => - 1 + ); + } + + /** + */ + public function clone_revision($rspecID, $item) + { + // Create a new revision node on db + $ret = array( + 'msg' => 'ok', + 'status_ok' => 1, + 'id' => - 1 + ); + $ret['id'] = $this->tree_mgr->new_node($rspecID, + $this->node_types_descr_id['requirement_spec_revision']); + + if (! isset($item['source_id']) || ($item['source_id'] < 0)) { + $dummy = $this->get_last_child_info($rspecID); + $source_id = $dummy['id']; + } else { + $source_id = $item['source_id']; + } + + // get data to clone + $sourceItem = $this->getRevisionByID($source_id); + $sourceItem['log_message'] = $item['log_message']; + $sourceItem['author_id'] = $item['author_id']; + $sourceItem['revision'] ++; + + unset($sourceItem['modifier_id']); + unset($sourceItem['modification_ts']); + unset($sourceItem['creation_ts']); + + $ret = $this->create_revision($rspecID, $sourceItem); + if ($ret['status_ok']) { + $source = array( + 'parent_id' => $rspecID, + 'item_id' => $source_id, + 'tproject_id' => $sourceItem['testproject_id'] + ); + $this->copy_cfields($source, $ret['id']); + } + + return $ret; + } + + /** + */ + public function getRevisionByID($id, $options = null) + { + $my['options'] = array( + 'decode_user' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = '/* $debugMsg */' . " SELECT RSPEC_REV.*, RSPEC.testproject_id " . + " FROM {$this->tables['req_specs_revisions']} RSPEC_REV " . + " JOIN {$this->tables['req_specs']} RSPEC " . + " ON RSPEC.id = RSPEC_REV.parent_id " . " WHERE RSPEC_REV.id={$id} "; + + $ret = $this->db->get_recordset($sql); + if (! is_null($ret) && $my['options']['decode_user']) { + $this->decode_users($ret); + } + return ! is_null($ret) ? $ret[0] : null; + } + + /** + */ + private function update_revision($item) + { + if (! isset($item['revision_id']) || is_null($item['revision_id'])) { + // will go to update LATEST + $info = $this->get_last_child_info($item['id'], + array( + 'output' => 'credentials' + )); + $targetID = $info['id']; + } else { + $targetID = $item['revision_id']; + } + + $sql = '/* $debugMsg */' . + " UPDATE {$this->tables['req_specs_revisions']} " . " SET scope = '" . + $this->db->prepare_string($item['scope']) . "', " . + " modifier_id = " . $item['modifier_id'] . ", " . + " modification_ts = " . $this->db->db_now() . + " WHERE id={$targetID} "; + $this->db->exec_query($sql); + return array( + 'id' => $targetID + ); + } + + /** + */ + public function get_all_id_in_testproject($tproject_id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'output' => 'classic' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* $debugMsg */ " . + " SELECT RSPEC.id FROM {$this->object_table} RSPEC WHERE testproject_id={$tproject_id}"; + + $rs = $this->db->get_recordset($sql); + switch ($my['options']['output']) { + case 'id': + $rx = array(); + foreach ($rs as $elem) { + $rx[] = $elem['id']; + } + return $rx; + break; + + default: + return $rs; + break; + } + } + + /** + */ + private function getAssignedCoverage($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'order_by' => " ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id", + 'output' => 'standard' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* $debugMsg */ SELECT NH_REQ.id,U.login, REQ_COV.creation_ts " . + " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . + " JOIN {$this->tables['req_coverage']} REQ_COV ON REQ_COV.req_id=NH_REQ.id " . + " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = REQ_COV.author_id "; + $sql .= " WHERE NH_REQ.parent_id={$id} " . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']}"; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + private function simplexml_load_file_helper($filename) + { + // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html + libxml_disable_entity_loader(true); + $zebra = file_get_contents($filename); + return @simplexml_load_string($zebra); + } + + /** + * + * @used-by + */ + public function getFileUploadRelativeURL($id) + { + return "lib/requirements/reqSpecEdit.php?doAction=fileUpload&req_spec_id=" . + intval($id); + } + + /** + * + * @used-by + */ + public function getDeleteAttachmentRelativeURL($id) + { + return "lib/requirements/reqSpecEdit.php?doAction=deleteFile&req_spec_id=" . + intval($id) . "&file_id="; + } + + /** + * Copy attachments from source to target + */ + private function copyAttachments($source_id, $target_id) + { + return $this->attachmentRepository->copyAttachments($source_id, + $target_id, $this->attachmentTableName); + } + + /** + */ + public function getReqsOnSpecForLatestTCV($id, $tcase_id = null, + $options = null, $filters = null) + { + static $tcMgr; + + if (! $tcMgr) { + $tcMgr = new testcase($this->db); + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'order_by' => ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', + 'output' => 'standard', + 'outputLevel' => 'std', + 'decodeUsers' => true, + 'version_string' => lang_get('version_short') + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + // null => do not filter + $my['filters'] = array( + 'link_status' => 1, + 'type' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $ltcv = null; + if (null == $tcase_id) { + $tcversionJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV " . + " ON LTCV.tcversion_id = RCOV.tcversion_id "; + } else { + $tcInfo = current($tcMgr->get_last_active_version($tcase_id)); + $ltcv = intval($tcInfo['tcversion_id']); + $tcversionJoin = " AND RCOV.tcversion_id = " . $ltcv; + } + + // Step 1 - + // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN + // + // Step 2 - + // Need to get only the Req Versions That are Assigned + // to Latest Active Test Case Version + // I'm doing this because I'm calling this function from + // the Test Spec Tree and in this context I CAN NOT choose + // test case version + $filters = ''; + if (null != $my['filters']['link_status']) { + $nu = (array) $my['filters']['link_status']; + $filters .= ' AND link_status IN(' . implode(',', $nu) . ')'; + } + + // Postgres => USER is reserved keyword !! + $lblVersion = $my['options']['version_string']; + $sql = "/* $debugMsg */ " . + " SELECT RCOV.id as link_id, NH_REQ.id,RCOV.req_version_id," . + " REQVER.scope, " . + " CONCAT(NH_REQ.name,' [{$lblVersion}',REQVER.version ,'] ' ) AS title," . + " REQ.req_doc_id, REQVER.version,TLUSER.login AS coverage_author, RCOV.creation_ts AS coverage_ts, REQVER.is_open AS reqver_is_open, - TCVER.is_open AS tcversion_is_open," . - " CASE " . - " WHEN RCOV.link_status = " . LINK_TC_REQ_OPEN . - " THEN 1 " . - " ELSE 0 " . - " END AS can_be_removed " . - " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . - - " JOIN {$this->tables['req_coverage']} RCOV " . - - " ON RCOV.req_id = NH_REQ.id " . $tcversionJoin . - - " JOIN {$this->tables['req_versions']} REQVER " . - " ON REQVER.id = RCOV.req_version_id " . - - " JOIN {$this->tables['tcversions']} TCVER " . - " ON TCVER.id = RCOV.tcversion_id " . - - " JOIN {$this->tables['requirements']} REQ " . - " ON REQ.id = NH_REQ.id " . - - " LEFT OUTER JOIN {$this->tables['users']} TLUSER " . - " ON TLUSER.id = RCOV.author_id " . - - " WHERE NH_REQ.parent_id=" . intval($id) . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} AND RCOV.is_active = 1 {$filters} "; - - $itemSet = $this->db->get_recordset($sql); - return $itemSet; - } - - - /** - * - * - */ - function getReqsOnSpecNotLinkedToLatestTCV($id, $tcase_id=null, $opt=null, $filters = null) { - - static $tcMgr; - - if( !$tcMgr ) { - $tcMgr = new testcase( $this->db ); - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array( 'order_by' => - ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', - 'output' => 'standard', - 'outputLevel' => 'std', 'decodeUsers' => true); - - $my['options'] = array_merge($my['options'], (array)$options); - - // null => do not filter - $my['filters'] = array('status' => null, 'type' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - // - $ltcv = null; - if( null == $tcase_id ) { - $tcversionJoin = - " LEFT JOIN {$this->views['latest_tcase_version_id']} LTCV " . - " ON LTCV.tcversion_id = RCOV.tcversion_id "; - } else { - $tcInfo = current($tcMgr->get_last_active_version($tcase_id)); - $ltcv = intval($tcInfo['tcversion_id']); - $tcversionJoin = " AND RCOV.tcversion_id = " . $ltcv; - } - - // Step 1 - - // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN - // - // Step 2 - - // Need to get only the Req Versions That are Assigned - // to Latest Active Test Case Version - // I'm doing this because I'm calling this function from - // the Test Spec Tree and in this context I CAN NOT choose - // test case version - // - $sql = "/* $debugMsg */ " . - " SELECT NH_REQ.id,REQVER.scope, " . - " CONCAT(NH_REQ.name,' [v', REQVER.version ,'] ' ) AS title," . - " REQ.req_doc_id, REQVER.version," . - " (CASE WHEN REQVER.version IS NULL " . - " THEN 1 ELSE 0 END) AS can_be_deleted " . - - " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . - " JOIN {$this->tables['requirements']} REQ " . - " ON REQ.id = NH_REQ.id " . - - - " LEFT JOIN {$this->tables['req_coverage']} RCOV " . - " ON RCOV.req_id = NH_REQ.id " . - $tcversionJoin . - - " LEFT JOIN {$this->tables['req_versions']} REQVER " . - " ON REQVER.id = RCOV.req_version_id " . - - - " WHERE NH_REQ.parent_id=" . intval($id) . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']}"; - - $itemSet = $this->db->get_recordset($sql); - return $itemSet; - } - - - /** - * - */ - function getReqsOnRSpecForLTCVOnTSuite($id, $tsuite_id, $options=null, $filters = null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array( 'order_by' => - ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', - 'output' => 'standard', - 'outputLevel' => 'std', 'decodeUsers' => true); - - $my['options'] = array_merge($my['options'], (array)$options); - - // null => do not filter - $my['filters'] = array('link_status' => 1, 'type' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - - // Step 1 - - // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN - // - // Step 2 - - // Need to get only the Req Versions That are Assigned - // to Latest Active Test Case Version - // I'm doing this because I'm calling this function from - // the Test Spec Tree and in this context I CAN NOT choose - // test case version - // - $filters = ''; - if( null != $my['filters']['link_status'] ) { - $nu = (array)$my['filters']['link_status']; - $filters .= ' AND link_status IN(' . implode(',',$nu) . ')'; - } - - $getLatestTCVersion = - " SELECT LTCV.tcversion_id AS tcversion_id + TCVER.is_open AS tcversion_is_open," . " CASE " . + " WHEN RCOV.link_status = " . LINK_TC_REQ_OPEN . + " THEN 1 " . " ELSE 0 " . " END AS can_be_removed " . + " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . + " JOIN {$this->tables['req_coverage']} RCOV " . + " ON RCOV.req_id = NH_REQ.id " . $tcversionJoin . + " JOIN {$this->tables['req_versions']} REQVER " . + " ON REQVER.id = RCOV.req_version_id " . + " JOIN {$this->tables['tcversions']} TCVER " . + " ON TCVER.id = RCOV.tcversion_id " . + " JOIN {$this->tables['requirements']} REQ " . + " ON REQ.id = NH_REQ.id " . + " LEFT OUTER JOIN {$this->tables['users']} TLUSER " . + " ON TLUSER.id = RCOV.author_id " . " WHERE NH_REQ.parent_id=" . + intval($id) . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} AND RCOV.is_active = 1 {$filters} "; + + return $this->db->get_recordset($sql); + } + + /** + */ + private function getReqsOnSpecNotLinkedToLatestTCV($id, $tcase_id = null, + $opt = null, $filters = null) + { + static $tcMgr; + + if (! $tcMgr) { + $tcMgr = new testcase($this->db); + } + + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'order_by' => ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', + 'output' => 'standard', + 'outputLevel' => 'std', + 'decodeUsers' => true + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + // null => do not filter + $my['filters'] = array( + 'status' => null, + 'type' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $ltcv = null; + if (null == $tcase_id) { + $tcversionJoin = " LEFT JOIN {$this->views['latest_tcase_version_id']} LTCV " . + " ON LTCV.tcversion_id = RCOV.tcversion_id "; + } else { + $tcInfo = current($tcMgr->get_last_active_version($tcase_id)); + $ltcv = intval($tcInfo['tcversion_id']); + $tcversionJoin = " AND RCOV.tcversion_id = " . $ltcv; + } + + // Step 1 - + // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN + // + // Step 2 - + // Need to get only the Req Versions That are Assigned + // to Latest Active Test Case Version + // I'm doing this because I'm calling this function from + // the Test Spec Tree and in this context I CAN NOT choose + // test case version + $sql = "/* $debugMsg */ " . " SELECT NH_REQ.id,REQVER.scope, " . + " CONCAT(NH_REQ.name,' [v', REQVER.version ,'] ' ) AS title," . + " REQ.req_doc_id, REQVER.version," . + " (CASE WHEN REQVER.version IS NULL " . + " THEN 1 ELSE 0 END) AS can_be_deleted " . + " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . + " JOIN {$this->tables['requirements']} REQ " . + " ON REQ.id = NH_REQ.id " . + " LEFT JOIN {$this->tables['req_coverage']} RCOV " . + " ON RCOV.req_id = NH_REQ.id " . $tcversionJoin . + " LEFT JOIN {$this->tables['req_versions']} REQVER " . + " ON REQVER.id = RCOV.req_version_id " . " WHERE NH_REQ.parent_id=" . + intval($id) . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']}"; + + return $this->db->get_recordset($sql); + } + + /** + */ + private function getReqsOnRSpecForLTCVOnTSuite($id, $tsuite_id, + $options = null, $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'order_by' => ' ORDER BY NH_REQ.node_order,NH_REQ.name,REQ.req_doc_id ', + 'output' => 'standard', + 'outputLevel' => 'std', + 'decodeUsers' => true + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + // null => do not filter + $my['filters'] = array( + 'link_status' => 1, + 'type' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + // Step 1 - + // get all req inside the Req Spec Folder ONLY DIRECT CHILDREN + // + // Step 2 - + // Need to get only the Req Versions That are Assigned + // to Latest Active Test Case Version + // I'm doing this because I'm calling this function from + // the Test Spec Tree and in this context I CAN NOT choose + // test case version + $filters = ''; + if (null != $my['filters']['link_status']) { + $nu = (array) $my['filters']['link_status']; + $filters .= ' AND link_status IN(' . implode(',', $nu) . ')'; + } + + $getLatestTCVersion = " SELECT LTCV.tcversion_id AS tcversion_id FROM {$this->tables['nodes_hierarchy']} NHX_TC - JOIN {$this->tables['nodes_hierarchy']} NHX_TCV + JOIN {$this->tables['nodes_hierarchy']} NHX_TCV ON NHX_TCV.parent_id = NHX_TC.id - JOIN {$this->views['latest_tcase_version_id']} LTCV + JOIN {$this->views['latest_tcase_version_id']} LTCV ON LTCV.tcversion_id = NHX_TCV.id - WHERE NHX_TC.parent_id = $tsuite_id "; - - // Postgres => USER is reserved keyword !! - $sql = "/* $debugMsg */ " . - " SELECT RCOV.id as link_id, NH_REQ.id,RCOV.req_version_id," . - " REQVER.scope, " . - " CONCAT(NH_REQ.name,' [v', REQVER.version ,'] ' ) AS title," . - " REQ.req_doc_id, REQVER.version," . - " TLUSER.login AS coverage_author," . - " RCOV.creation_ts AS coverage_ts,REQVER.is_open, - REQVER.is_open AS reqver_is_open," . - " CASE " . - " WHEN RCOV.link_status = " . LINK_TC_REQ_OPEN . - " THEN 1 " . - " ELSE 0 " . - " END AS can_be_removed " . - " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . - - " JOIN {$this->tables['req_coverage']} RCOV " . - - " ON RCOV.req_id = NH_REQ.id " . - " AND RCOV.tcversion_id IN ( $getLatestTCVersion ) " . - - " JOIN {$this->tables['req_versions']} REQVER " . - " ON REQVER.id = RCOV.req_version_id " . - - " JOIN {$this->tables['requirements']} REQ " . - " ON REQ.id = NH_REQ.id " . - - " LEFT OUTER JOIN {$this->tables['users']} TLUSER " . - " ON TLUSER.id = RCOV.author_id " . - - " WHERE NH_REQ.parent_id=" . intval($id) . - " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} AND RCOV.is_active = 1 {$filters} "; - - $itemSet = $this->db->get_recordset($sql); - return $itemSet; - } - - - - /* - function: getAllLatestRQVOnReqSpec - get LATEST VERSION OF requirements contained in a req spec - ONLY direct children - - args: id: req spec id - - returns: array of rows - */ - function getAllLatestRQVOnReqSpec($reqSpecID, $opt=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('output' => 'mapOnReqID'); - $options = array_merge($options,(array)$opt); - - $reqNode = $this->node_types_descr_id['requirement']; - $sql = "/* $debugMsg */ + WHERE NHX_TC.parent_id = $tsuite_id "; + + // Postgres => USER is reserved keyword !! + $sql = "/* $debugMsg */ " . + " SELECT RCOV.id as link_id, NH_REQ.id,RCOV.req_version_id," . + " REQVER.scope, " . + " CONCAT(NH_REQ.name,' [v', REQVER.version ,'] ' ) AS title," . + " REQ.req_doc_id, REQVER.version," . + " TLUSER.login AS coverage_author," . + " RCOV.creation_ts AS coverage_ts,REQVER.is_open, + REQVER.is_open AS reqver_is_open," . " CASE " . + " WHEN RCOV.link_status = " . LINK_TC_REQ_OPEN . + " THEN 1 " . " ELSE 0 " . " END AS can_be_removed " . + " FROM {$this->tables['nodes_hierarchy']} NH_REQ " . + " JOIN {$this->tables['req_coverage']} RCOV " . + " ON RCOV.req_id = NH_REQ.id " . + " AND RCOV.tcversion_id IN ( $getLatestTCVersion ) " . + " JOIN {$this->tables['req_versions']} REQVER " . + " ON REQVER.id = RCOV.req_version_id " . + " JOIN {$this->tables['requirements']} REQ " . + " ON REQ.id = NH_REQ.id " . + " LEFT OUTER JOIN {$this->tables['users']} TLUSER " . + " ON TLUSER.id = RCOV.author_id " . " WHERE NH_REQ.parent_id=" . + intval($id) . + " AND NH_REQ.node_type_id = {$this->node_types_descr_id['requirement']} AND RCOV.is_active = 1 {$filters} "; + + return $this->db->get_recordset($sql); + } + + /* + * function: getAllLatestRQVOnReqSpec + * get LATEST VERSION OF requirements contained in a req spec + * ONLY direct children + * + * args: id: req spec id + * + * returns: array of rows + */ + public function getAllLatestRQVOnReqSpec($reqSpecID, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'output' => 'mapOnReqID' + ); + $options = array_merge($options, (array) $opt); + + $reqNode = $this->node_types_descr_id['requirement']; + $sql = "/* $debugMsg */ SELECT NH_REQ.id,REQV.id AS req_version_id, REQV.version, REQV.scope, NH_REQ.name AS title, CONCAT(REQ.req_doc_id,' [', REQV.version, '] ') AS req_doc_id FROM {$this->tables['nodes_hierarchy']} NH_REQ JOIN {$this->views['latest_req_version_id']} LRQV - ON LRQV.req_id = NH_REQ.id + ON LRQV.req_id = NH_REQ.id JOIN {$this->tables['requirements']} REQ - ON REQ.id = NH_REQ.id - + ON REQ.id = NH_REQ.id + JOIN {$this->tables['req_versions']} REQV ON REQV.id = LRQV.req_version_id - - WHERE NH_REQ.parent_id = {$reqSpecID} - AND NH_REQ.node_type_id = $reqNode "; - - switch($options['output']) { - case 'array': - $rs = $this->db->get_recordset($sql); - break; - case 'mapOnId': - default: - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - break; - } - return $rs; - } - -} // class end \ No newline at end of file + WHERE NH_REQ.parent_id = {$reqSpecID} + AND NH_REQ.node_type_id = $reqNode "; + + switch ($options['output']) { + case 'array': + $rs = $this->db->get_recordset($sql); + break; + + case 'mapOnId': + default: + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + break; + } + return $rs; + } +} diff --git a/lib/functions/requirements.inc.php b/lib/functions/requirements.inc.php index c95ff4418c..ce1b156e1f 100644 --- a/lib/functions/requirements.inc.php +++ b/lib/functions/requirements.inc.php @@ -1,1005 +1,998 @@ -{{XMLCODE}}"; - $elemTpl = "\t".'". - '<![CDATA['."\n||TITLE||\n]]>".''. - '".''. - ''."\n"; - $info = array("||DOCID||" => "req_doc_id","||TITLE||" => "title", - "||DESCRIPTION||" => "scope"); - return exportDataToXML($reqData,$rootElem,$elemTpl,$info); -} - - -/** Process CVS file contents with requirements into TL - * and creates an array with reports - * @return array_of_strings list of particular REQ data with resolution comment - * - * - **/ -function executeImportedReqs(&$db,$arrImportSource, $map_cur_reqdoc_id,$conflictSolution, - $emptyScope, $idSRS, $tprojectID, $userID) -{ - define('SKIP_CONTROLS',1); - - $req_mgr = new requirement_mgr($db); - $import_status = null; - $field_size = config_get('field_size'); - - foreach ($arrImportSource as $data) - { - $docID = trim_and_limit($data['docid'],$field_size->req_docid); - $title = trim_and_limit($data['title'],$field_size->req_title); - $scope = $data['description']; - $type = $data['type']; - $status = $data['status']; - $expected_coverage = $data['expected_coverage']; - $node_order = $data['node_order']; - - if (($emptyScope == 'on') && empty($scope)) - { - // skip rows with empty scope - $import_status = lang_get('req_import_result_skipped'); - } - else - { - $crash = $map_cur_reqdoc_id && array_search($docID, $map_cur_reqdoc_id); - if($crash) - { - // process conflict according to choosen solution - tLog('Conflict found. solution: ' . $conflictSolution); - $import_status['msg'] = 'Error'; - if ($conflictSolution == 'overwrite') - { - $item = current($req_mgr->getByDocID($docID,$tprojectID)); - $last_version = $req_mgr->get_last_version_info($item['id']); - - // BUGID 0003745: CSV Requirements Import Updates Frozen Requirement - if( $last_version['is_open'] == 1 ) - { - $op = $req_mgr->update($item['id'],$last_version['id'],$docID,$title,$scope,$userID, - $status,$type,$expected_coverage,$node_order,SKIP_CONTROLS); - if( $op['status_ok']) - { - $import_status['msg'] = lang_get('req_import_result_overwritten'); - } - } - else - { - $import_status['msg'] = lang_get('req_import_result_skipped_is_frozen'); - } - } - elseif ($conflictSolution == 'skip') - { - // no work - $import_status['msg'] = lang_get('req_import_result_skipped'); - } - } - else - { - // no conflict - just add requirement - $import_status = $req_mgr->create($idSRS,$docID,$title,$scope,$userID,$status,$type, - $expected_coverage,$node_order); - } - $arrImport[] = array('doc_id' => $docID, 'title' => $title, 'import_status' => $import_status['msg']); - } - } - return $arrImport; -} - -/* - On version 1.9 is NOT USED when importing from XML format -*/ -function compareImportedReqs(&$dbHandler,$arrImportSource,$tprojectID,$reqSpecID) -{ - $reqCfg = config_get('req_cfg'); - $labels = array('type' => $reqCfg->type_labels, 'status' => $reqCfg->status_labels); - $verbose = array('type' => null, 'status' => null); - $cache = array('type' => null, 'status' => null); - $cacheKeys = array_keys($cache); - - $unknown_code = lang_get('unknown_code'); - $reqMgr = new requirement_mgr($dbHandler); - $arrImport = null; - if( ($loop2do=count($arrImportSource)) ) - { - $getOptions = array('output' => 'minimun'); - $messages = array('ok' => '', 'import_req_conflicts_other_branch' => '','import_req_exists_here' => ''); - foreach($messages as $key => $dummy) - { - $messages[$key] = lang_get($key); - } - - for($idx=0 ; $idx < $loop2do; $idx++) - { - $msgID = 'ok'; - $req = $arrImportSource[$idx]; - - // Check: - // If item with SAME DOCID exists inside container - // If there is a hit - // We will follow user option: update,create new version - // - // If do not exist check must be repeated, but on WHOLE test project - // If there is a hit -> we can not create - // else => create - // - // - // 20100321 - we do not manage yet user option - $check_in_reqspec = $reqMgr->getByDocID($req['docid'],$tprojectID,$reqSpecID,$getOptions); - if(is_null($check_in_reqspec)) - { - $check_in_tproject = $reqMgr->getByDocID($req['docid'],$tprojectID,null,$getOptions); - if(!is_null($check_in_tproject)) - { - $msgID = 'import_req_conflicts_other_branch'; - } - } - else - { - $msgID = 'import_req_exists_here'; - } - - foreach($cacheKeys as $attr) - { - if( isset($labels[$attr][$req[$attr]]) ) - { - if( !isset($cache[$attr][$req[$attr]]) ) - { - $cache[$attr][$req[$attr]] = lang_get($labels[$attr][$req[$attr]]); - } - $verbose[$attr] = $cache[$attr][$req[$attr]]; - } - else - { - $verbose[$attr] = sprintf($unknown_code,$req[$attr]); - } - } - - $arrImport[] = array('req_doc_id' => $req['docid'], 'title' => trim($req['title']), - 'scope' => $req['description'], 'type' => $verbose['type'], - 'status' => $verbose['status'], 'expected_coverage' => $req['expected_coverage'], - 'node_order' => $req['order'], 'check_status' => $messages[$msgID]); - } - } - return $arrImport; -} - -function getReqDocIDs(&$db,$srs_id) -{ - $req_spec_mgr = new requirement_spec_mgr($db); - $arrCurrentReq = $req_spec_mgr->get_requirements($srs_id); - - $result = null; - if (count($arrCurrentReq)) - { - // only if some reqs exist - foreach ($arrCurrentReq as $data) - { - $result[$data['id']] = $data['req_doc_id']; - } - } - - return($result); -} - - - -/** - * load imported data from file and parse it to array - * @return array_of_array each inner array include fields title and scope (and more) - */ -function loadImportedReq($fileName, $importType) -{ - $retVal = null; - switch($importType) - { - case 'csv': - $pfn = "importReqDataFromCSV"; - break; - - case 'csv_doors': - $pfn = "importReqDataFromCSVDoors"; - break; - - case 'DocBook': - $pfn = "importReqDataFromDocBook"; - break; - } - - if ($pfn) - { - $retVal = $pfn($fileName); - if($importType == 'DocBook') - { - // this structure if useful when importing from CSV - // $retVal = array('userFeedback' => arra(),'info' => null); - // - // But we need to return same data structure ALWAYS - // for DocBook we do not use 'parsedCounter' and 'syntaxError' - // - $dummy = array('userFeedback' => null, 'info' => $retVal); - $retVal = $dummy; - } - } - - return $retVal; -} - -/** - * importReqDataFromCSV - * - */ -function importReqDataFromCSV($fileName) -{ - // CSV line format - $fieldMappings = array("docid","title","description","type","status","expected_coverage","node_order"); - - - $options = array('delimiter' => ',' , 'fieldQty' => count($fieldMappings)); - $impData = importCSVData($fileName,$fieldMappings,$options); - - $reqData = &$impData['info']; - if($reqData) - { - // lenght will be adjusted to these values - $field_size=config_get('field_size'); - $fieldLength = array("docid" => $field_size->req_docid, "title" => $field_size->req_title); - - $reqCfg = config_get('req_cfg'); - $fieldDefault = array("type" => array('check' => 'type_labels', 'value' => TL_REQ_TYPE_FEATURE), - "status" => array('check' => 'status_labels' , 'value' => TL_REQ_STATUS_VALID)); - - $loop2do = count($reqData); - for($ddx=0; $ddx < $loop2do; $ddx++) - { - foreach($reqData[$ddx] as $fieldKey => &$fieldValue) - { - // Adjust Lenght - if( isset($fieldLength[$fieldKey]) ) - { - $fieldValue = trim_and_limit($fieldValue,$fieldLength[$fieldKey]); - } - else if(isset($fieldDefault[$fieldKey])) - { - // Assign default value - $checkKey = $fieldDefault[$fieldKey]['check']; - $checkObj = &$reqCfg->$checkKey; - if( !isset($checkObj[$fieldValue]) ) - { - $fieldValue = $fieldDefault[$fieldKey]['value']; - } - } - } - } - } - return $impData; -} - -/** - * importReqDataFromCSVDoors - * - * @internal revision - * - */ -function importReqDataFromCSVDoors($fileName) -{ - // Some keys are strings, other numeric - $fieldMappings = array("Object Identifier" => "title","Object Text" => "description", - "Created By","Created On","Last Modified By","Last Modified On"); - - $options = array('delimiter' => ',', 'fieldQty' => count($fieldMappings), 'processHeader' => true); - $impData = importCSVData($fileName,$fieldMappings,$options); - - return $impData; -} - -/** - * Parses one 'informaltable' XML entry and produces HTML table as string. - * - * XML relationship: - * informaltable -> tgroup -> thead -> row -> entry - * -> tbody -> row -> entry - * - * 20081103 - sisajr - */ -function getDocBookTableAsHtmlString($docTable,$parseCfg) -{ - $resultTable = ""; - foreach ($docTable->children() as $tgroup) - { - if ($tgroup->getName() != $parseCfg->table_group) - { - continue; - } - - $table = ""; - foreach ($tgroup->children() as $tbody) - { - // get table head - $tbodyName = $tbody->getName() ; - $doIt = false; - if( $tbodyName == $parseCfg->table_head) - { - $cellTag = array('open' => '', 'close' => ''); - $doIt = true; - } - else if( $tbodyName == $parseCfg->table_body) - { - $cellTag = array('open' => '', 'close' => ''); - $doIt = true; - } - - if( $doIt ) - { - foreach ($tbody->children() as $row) - { - if( $row->getName() == $parseCfg->table_row ) - { - $table_row = ""; - foreach ($row->children() as $entry) - { - if ( ($ename = $entry->getName()) == $parseCfg->table_entry) - { - if( $entry->count() == 0 ) - { - $table_row .= $cellTag['open'] . (string)$entry . $cellTag['close']; - } - else - { - $table_row .= $cellTag['open']; - foreach($parseCfg->table_entry_children as $ck) - { - if( property_exists($entry,$ck) ) - { - $table_row .= (string)$entry->$ck; - } - } - $table_row .= $cellTag['close']; - } - } - } - - $table_row .= ""; - $table .= $table_row; - } - } - } - } - - $resultTable .= "" . $table . "
    "; - } - - return $resultTable; -} - -/** - * Imports data from DocBook XML - * - * @return array of map - * - */ -function importReqDataFromDocBook($fileName) -{ - $req_cfg = config_get('req_cfg'); - $docbookCfg = $req_cfg->importDocBook; - $xmlReqs = null; - $xmlData = null; - $field_size=config_get('field_size'); - - $simpleXMLObj = simplexml_load_file($fileName); - $num_elem = count($simpleXMLObj->{$docbookCfg->requirement}); - - $idx=0; - foreach($simpleXMLObj->{$docbookCfg->requirement} as $xmlReq) - { - // get all child elements of this requirement - $title = ""; - $description = ""; - $children = $xmlReq->children(); - foreach ($children as $child) - { - $nodeName = $child->getName(); - if ($nodeName == $docbookCfg->title ) - { - $title = (string)$child; - } - else if ($nodeName == $docbookCfg->ordered_list) - { - $list = ""; - foreach( $child->children() as $item ) - { - if( $item->getName() == $docbookCfg->list_item ) - { - if( $item->count() == 0 ) - { - $list .= "
  • " . (string)$item . "
  • "; - } - else - { - foreach($docbookCfg->list_item_children as $ck) - { - if( property_exists($item,$ck) ) - { - $list .= "
  • " . (string)$item->$ck . "
  • "; - } - } - } - } - } - $description .= "
      " . $list . "
    "; - } - else if ($nodeName == $docbookCfg->table) - { - $description .= getDocBookTableAsHtmlString($child,$docbookCfg); - } - else if ($nodeName == $docbookCfg->paragraph) - { - $description .= "

    " . (string)$child . "

    "; - } - else - { - $description .= "

    " . (string)$child . "

    "; - } - - - } - $xmlData[$idx]['description'] = $description; - $xmlData[$idx]['title'] = trim_and_limit($title,$field_size->req_title); - - // parse Doc ID from requirement title - // first remove any weird characters before the title. This could be probably omitted - $xmlData[$idx]['title'] = preg_replace("/^[^a-zA-Z_0-9]*/","",$xmlData[$idx]['title']); - - // get Doc ID - // - // this will create Doc ID as words ended with number - // Example: Req BL 20 Business Logic - // Doc ID: Req BL 20 - //if (preg_match("/[ a-zA-Z_]*[0-9]*/", $xmlData[$i]['title'], $matches)) - //{ - // $xmlData[$i]['req_doc_id'] = $matches[0]; - //} - - // this matches first two words in Title and adds counter started from 1 - // Doc ID is grouped (case insensitive), so different groups have their own counter running - // Example: Req BL Business Logic - // Doc ID: Req BL 1 - // Note: Doc ID doesn't need trim_and_limit since it is parsed from Title - // new dBug($xmlData[$idx]['title']); - - if (preg_match("/[ ]*[a-zA-Z_0-9]*[ ][a-zA-Z_0-9]*/", $xmlData[$idx]['title'], $matches)) - { - $index = strtolower($matches[0]); - if( !isset($counter[$index]) ) - { - $counter[$index] = 0; - } - $counter[$index]++; - $xmlData[$idx]['docid'] = $matches[0] . " " . $counter[$index]; - } - else - { - $xmlData[$idx]['docid'] = uniqid('REQ-'); - } - - $xmlData[$idx]['node_order'] = $idx; - $xmlData[$idx]['expected_coverage'] = 0; - $xmlData[$idx]['type'] = TL_REQ_TYPE_FEATURE; - $xmlData[$idx]['status'] = TL_REQ_STATUS_VALID; - - $idx++; - } - - return $xmlData; -} - - -/* - function: - - args : - - returns: - -*/ -function doReqImport(&$dbHandler,$tprojectID,$userID,$reqSpecID,$fileName,$importType,$emptyScope, - $conflictSolution,$doImport) -{ - $arrImportSource = loadImportedReq($fileName, $importType); - $arrImport = null; - - if (count($arrImportSource)) - { - $map_cur_reqdoc_id = getReqDocIDs($dbHandler,$reqSpecID); - if ($doImport) - { - $arrImport = executeImportedReqs($dbHandler,$arrImportSource, $map_cur_reqdoc_id, - $conflictSolution, $emptyScope, $reqSpecID, $tprojectID, $userID); - } - else - { - $arrImport = compareImportedReqs($dbHandler,$arrImportSource,$tprojectID,$reqSpecID); - } - } - return $arrImport; -} - -/* - function: - - args : - - returns: - -*/ -function exportReqDataToCSV($reqData) -{ - $sKeys = array("req_doc_id","title","scope"); - return exportDataToCSV($reqData,$sKeys,$sKeys,0,','); -} - - -/** - * getReqCoverage - * - */ -function getReqCoverage(&$dbHandler,$reqs,&$execMap) -{ - $tree_mgr = new tree($dbHandler); - - $coverageAlgorithm=config_get('req_cfg')->coverageStatusAlgorithm; - $resultsCfg=config_get('results'); - $status2check=array_keys($resultsCfg['status_label_for_exec_ui']); - - // $coverage['byStatus']=null; - $coverage['withTestCase']=null; - $coverage['withoutTestCase']=null; - $coverage['byStatus']=$resultsCfg['status_label_for_exec_ui']; - $status_counters=array(); - foreach($coverage['byStatus'] as $status_code => $value) - { - $coverage['byStatus'][$status_code]=array(); - $status_counters[$resultsCfg['status_code'][$status_code]]=0; - } - - $reqs_qty=count($reqs); - if($reqs_qty > 0) - { - foreach($reqs as $requirement_id => $req_tcase_set) - { - $first_key=key($req_tcase_set); - $item_qty = count($req_tcase_set); - $req = array("id" => $requirement_id, "title" => $req_tcase_set[$first_key]['req_title'], - "req_doc_id" => $req_tcase_set[$first_key]["req_doc_id"]); - - foreach($status_counters as $key => $value) - { - $status_counters[$key]=0; - } - if( $req_tcase_set[$first_key]['testcase_id'] > 0 ) - { - $coverage['withTestCase'][$requirement_id] = 1; - } - else - { - $coverage['withoutTestCase'][$requirement_id] = $req; - } - - for($idx = 0; $idx < $item_qty; $idx++) - { - $item_info=$req_tcase_set[$idx]; - if( $idx==0 ) // just to avoid useless assignments - { - $req['title']=$item_info['req_title']; - } - - // BUGID 1063 - if( $item_info['testcase_id'] > 0 ) - { - $exec_status = $resultsCfg['status_code']['not_run']; - $tcase_path=''; - if (isset($execMap[$item_info['testcase_id']]) && sizeof($execMap[$item_info['testcase_id']])) - { - $execInfo = end($execMap[$item_info['testcase_id']]); - $tcase_path=$execInfo['tcase_path']; - if( isset($execInfo['status']) && trim($execInfo['status']) !='') - { - $exec_status = $execInfo['status']; - } - } - else - { - $path_info=$tree_mgr->get_full_path_verbose($item_info['testcase_id']); - unset($path_info[$item_info['testcase_id']][0]); // remove test project name - $path_info[$item_info['testcase_id']][]=''; - $tcase_path=implode(' / ',$path_info[$item_info['testcase_id']]); - } - $status_counters[$exec_status]++; - $req['tcList'][] = array("tcID" => $item_info['testcase_id'], - "title" => $item_info['testcase_name'], - "tcaseExternalID" => $item_info['testcase_external_id'], - "version" => $item_info['testcase_version'], - "tcase_path" => $tcase_path, - "status" => $exec_status, - "status_label" => $resultsCfg['status_label'][$resultsCfg['code_status'][$exec_status]]); - } - } // for($idx = 0; $idx < $item_qty; $idx++) - - - // We analyse counters - $go_away=0; - foreach( $coverageAlgorithm['checkOrder'] as $checkKey ) - { - foreach( $coverageAlgorithm['checkType'][$checkKey] as $tcase_status ) - { - if($checkKey == 'atLeastOne') - { - if($status_counters[$resultsCfg['status_code'][$tcase_status]] > 0 ) - { - $coverage['byStatus'][$tcase_status][] = $req; - $go_away=1; - break; - } - } - if($checkKey == 'all') - { - if($status_counters[$resultsCfg['status_code'][$tcase_status]] == $item_qty ) - { - $coverage['byStatus'][$tcase_status][] = $req; - $go_away=1; - break; - } - //-amitkhullar - 20090331 - BUGFIX 2292 - elseif ($status_counters[$resultsCfg['status_code'][$tcase_status]] > 0 ) - { - $coverage['byStatus'][$tcase_status][] = $req; - $go_away=1; - break; - } - elseif ( isset($coverageAlgorithm['checkFail']) && - isset($coverageAlgorithm['checkFail'][$checkKey]) && - isset($req['tcList']) ) - { - - // BUGID 2171 - // ($coverageAlgorithm['checkFail'][$checkKey]==$tcase_status) - // If particular requirement has assigned more than one test cases, and: - // - at least one of assigned test cases was not yet executed - // - the rest of assigned test cases was executed and passed - // then on the "Requirements based report" this particular requirement - // is not shown at all (in any section). - $coverage['byStatus'][$coverageAlgorithm['checkFail'][$checkKey]][] = $req; - $go_away=1; - break; - } - } - } - if($go_away) - { - break; - } - } - } // foreach($reqs as $requirement_id => $req_tcase_set) - } - return $coverage; -} - - -/* - function: - - args : - - returns: - - rev: 20090716 - franciscom - get_last_execution() interface changes -*/ -function getLastExecutions(&$db,$tcaseSet,$tplanId) -{ - $execMap = array(); - if (sizeof($tcaseSet)) - { - $tcase_mgr = new testcase($db); - $items=array_keys($tcaseSet); - $path_info=$tcase_mgr->tree_manager->get_full_path_verbose($items); - $options=array('getNoExecutions' => 1, 'groupByBuild' => 0); - foreach($tcaseSet as $tcaseId => $tcInfo) - { - $execMap[$tcaseId] = $tcase_mgr->get_last_execution($tcaseId,$tcInfo['tcversion_id'], - $tplanId,testcase::ANY_BUILD, - testcase::ANY_PLATFORM,$options); - - unset($path_info[$tcaseId][0]); // remove test project name - $path_info[$tcaseId][]=''; - $execMap[$tcaseId][$tcInfo['tcversion_id']]['tcase_path']=implode(' / ',$path_info[$tcaseId]); - } - - unset($tcase_mgr); - } - return $execMap; -} - - -// 20061014 - franciscom -function check_syntax($fileName,$importType) -{ - switch($importType) - { - case 'csv': - $pfn = "check_syntax_csv"; - break; - - case 'csv_doors': - $pfn = "check_syntax_csv_doors"; - break; - - case 'XML': - $pfn = "check_syntax_xml"; - break; - - // 20081103 - sisajr - case 'DocBook': - $pfn = "check_syntax_xml"; - break; - } - if ($pfn) - { - $data = $pfn($fileName); - return $data; - } - return; -} - -/* - function: - - args: - - returns: - -*/ -function check_syntax_xml($fileName) -{ - $ret=array(); - $ret['status_ok']=1; - $ret['msg']='ok'; - return($ret); -} - - -function check_syntax_csv($fileName) -{ - $ret=array(); - $ret['status_ok']=1; - $ret['msg']='ok'; - return($ret); -} - -// Must be implemented !!! -function check_syntax_csv_doors($fileName) -{ - $ret=array(); - $ret['status_ok']=1; - $ret['msg']='ok'; - - return($ret); -} - -/** - * replace BBCode-link tagged links in req/reqspec scope with actual links - * - * @internal revisions: - * 20110525 - Julian - BUGID 4487 - allow to specify requirement version for internal links - * 20100301 - asimon - added anchor and tproj parameters to tags - * - * @param resource $dbHandler database handle - * @param string $scope text in which to replace tags with links - * @param integer $tprojectID ID of testproject to which req/reqspec belongs - * @return string $scope text with generated links - */ -function req_link_replace($dbHandler, $scope, $tprojectID) -{ - - // Use this to improve performance when is called in loops - static $tree_mgr; - static $tproject_mgr; - static $req_mgr; - static $cfg; - static $l18n; - static $title; - static $tables; - - if(!$tproject_mgr) - { - $tproject_mgr = new testproject($dbHandler); - $tree_mgr = new tree($dbHandler); - $req_mgr = new requirement_mgr($dbHandler); - - $tables = tlObjectWithDB::getDBTables(array('requirements', 'req_specs')); - - $cfg = config_get('internal_links'); - $l18n['version'] = lang_get('tcversion_indicator'); - - $prop2loop = array('req' => array('prop' => 'req_link_title', 'default_lbl' => 'requirement'), - 'req_spec' => array('prop' => 'req_spec_link_title','default_lbl' => 'req_spec_short')); - - - // configure link title (first part of the generated link) - $title = array(); - foreach($prop2loop as $key => $elem) - { - $prop = $elem['prop']; - if ($cfg->$prop->type == 'string' && $cfg->$prop->value != '') - { - $title[$key] = lang_get($cfg->$prop->value); - } - else if ($cfg->$prop->type == 'none') - { - $title[$key] = ''; - } - else - { - $title[$key] = lang_get($elem['default_lbl']) . ": "; - } - } - - } - - $prefix = $tproject_mgr->getTestCasePrefix($tprojectID); - $string2replace = array(); - - // configure target in which link shall open - // use a reasonable default value if nothing is set in config - $cfg->target = isset($cfg->target) ? $cfg->target :'popup'; - - switch($cfg->target) - { - case 'popup': - // use javascript to open popup window - $string2replace['req'] = '%s%s%s'; - $string2replace['req_spec'] = '%s%s'; - break; - - case 'window': - case 'frame':// open in same frame - $target = ($cfg->target == 'window') ? 'target="_blank"' : 'target="_self"'; - $string2replace['req'] = '%s%s%s'; - $string2replace['req_spec'] = '%s%s'; - break; - } - - // now the actual replacing - $patterns2search = array(); - $patterns2search['req'] = "#\[req(.*)\](.*)\[/req\]#iU"; - $patterns2search['req_spec'] = "#\[req_spec(.*)\](.*)\[/req_spec\]#iU"; - $patternPositions = array('complete_string' => 0,'attributes' => 1,'doc_id' => 2); - - $items2search['req'] = array('tproj','anchor','version'); - $items2search['req_spec'] = array('tproj','anchor'); - $itemPositions = array ('item' => 0,'item_value' => 1); - - $sql2exec = array(); - $sql2exec['req'] = " SELECT id, req_doc_id AS doc_id " . - " FROM {$tables['requirements']} WHERE req_doc_id="; - - $sql2exec['req_spec'] = " SELECT id, doc_id FROM {$tables['req_specs']} " . - " WHERE doc_id=" ; - - foreach($patterns2search as $accessKey => $pattern ) - { - - $matches = array(); - preg_match_all($pattern, $scope, $matches); - - // if no req_doc_id is set skip loop - if( count($matches[$patternPositions['doc_id']]) == 0 ) - { - continue; - } - - foreach ($matches[$patternPositions['complete_string']] as $key => $matched_string) - { - - $matched = array (); - $matched['tproj'] = ''; - $matched['anchor'] = ''; - $matched['version'] = ''; - - // only look for attributes if any found - if ($matches[$patternPositions['attributes']][$key] != '') { - foreach ($items2search[$accessKey] as $item) { - $matched_item = array(); - preg_match('/'.$item.'=([\w]+)/',$matched_string,$matched_item); - $matched[$item] = (isset($matched_item[$itemPositions['item_value']])) ? - $matched_item[$itemPositions['item_value']] : ''; - } - } - // set tproj to current project if tproj is not specified in attributes - if (!isset($matched['tproj']) || $matched['tproj'] == '') - { - $matched['tproj'] = $prefix; - } - - // get all reqs / req specs with the specified doc_id - $sql = $sql2exec[$accessKey] . "'{$matches[$patternPositions['doc_id']][$key]}'"; - $rs = $dbHandler->get_recordset($sql); - - if (count($rs) > 0) - { - - foreach($rs as $key => $value) - { - // get root of linked node and check - $real_root = $tree_mgr->getTreeRoot($value['id']); - $matched_root_info = $tproject_mgr->get_by_prefix($matched['tproj']); - - // do only continue if project with the specified project exists and - // if the requirement really belongs to the specified project (requirements - // with the same doc_id may exist within different projects) - if ($real_root == $matched_root_info['id']) - { - if($accessKey == 'req') - { - // add version to link title if set - $version = ''; - $req_version_id = 'null'; - if ($matched['version'] != '') - { - // get requirement version_id of the specified version - $req_version = $req_mgr->get_by_id($value['id'],null,$matched['version']); - - // if version is not set or wrong version was set - // -> show latest version by setting version_id to null - $req_version_id = isset($req_version[0]['version_id']) ? $req_version[0]['version_id'] :'null'; - - // if req_version_id exists set the version to show on hyperlink text - if ($req_version_id != 'null') - { - $version = sprintf($l18n['version'],$matched['version']); - } - } - $urlString = sprintf($string2replace[$accessKey], $value['id'], $req_version_id, - $matched['anchor'], $title[$accessKey], $value['doc_id'], $version); - } - else - { - // build urlString for req specs which do not have a version - $urlString = sprintf($string2replace[$accessKey], $value['id'], - $matched['anchor'], $title[$accessKey], $value['doc_id']); - } - $scope = str_replace($matched_string,$urlString,$scope); - } - } - } - } - } - - return $scope; -} - -?> \ No newline at end of file +{{XMLCODE}}"; + $elemTpl = "\t" . '" . + '<![CDATA[' . "\n||TITLE||\n]]>" . '' . + '" . '' . + '' . "\n"; + $info = array( + "||DOCID||" => "req_doc_id", + "||TITLE||" => "title", + "||DESCRIPTION||" => "scope" + ); + return exportDataToXML($reqData, $rootElem, $elemTpl, $info); +} + +/** + * Process CVS file contents with requirements into TL + * and creates an array with reports + * + * @return array of strings list of particular REQ data with resolution comment + * + * + */ +function executeImportedReqs(&$db, $arrImportSource, $map_cur_reqdoc_id, + $conflictSolution, $emptyScope, $idSRS, $tprojectID, $userID) +{ + define('SKIP_CONTROLS', 1); + + $req_mgr = new requirement_mgr($db); + $import_status = null; + $field_size = config_get('field_size'); + + foreach ($arrImportSource as $data) { + $docID = trimAndLimit($data['docid'], $field_size->req_docid); + $title = trimAndLimit($data['title'], $field_size->req_title); + $scope = $data['description']; + $type = $data['type']; + $status = $data['status']; + $expected_coverage = $data['expected_coverage']; + $node_order = $data['node_order']; + + if (($emptyScope == 'on') && empty($scope)) { + // skip rows with empty scope + $import_status = lang_get('req_import_result_skipped'); + } else { + $crash = $map_cur_reqdoc_id && + array_search($docID, $map_cur_reqdoc_id); + if ($crash) { + // process conflict according to choosen solution + tLog('Conflict found. solution: ' . $conflictSolution); + $import_status['msg'] = 'Error'; + if ($conflictSolution == 'overwrite') { + $item = current($req_mgr->getByDocID($docID, $tprojectID)); + $last_version = $req_mgr->getLastVersionInfo($item['id']); + + // BUGID 0003745: CSV Requirements Import Updates Frozen Requirement + if ($last_version['is_open'] == 1) { + $op = $req_mgr->update($item['id'], $last_version['id'], + $docID, $title, $scope, $userID, $status, $type, + $expected_coverage, $node_order, SKIP_CONTROLS); + if ($op['status_ok']) { + $import_status['msg'] = lang_get( + 'req_import_result_overwritten'); + } + } else { + $import_status['msg'] = lang_get( + 'req_import_result_skipped_is_frozen'); + } + } elseif ($conflictSolution == 'skip') { + // no work + $import_status['msg'] = lang_get( + 'req_import_result_skipped'); + } + } else { + // no conflict - just add requirement + $import_status = $req_mgr->create($idSRS, $docID, $title, $scope, + $userID, $status, $type, $expected_coverage, $node_order); + } + $arrImport[] = array( + 'doc_id' => $docID, + 'title' => $title, + 'import_status' => $import_status['msg'] + ); + } + } + return $arrImport; +} + +/* + * On version 1.9 is NOT USED when importing from XML format + */ +function compareImportedReqs(&$dbHandler, $arrImportSource, $tprojectID, + $reqSpecID) +{ + $reqCfg = config_get('req_cfg'); + $labels = array( + 'type' => $reqCfg->type_labels, + 'status' => $reqCfg->status_labels + ); + $verbose = array( + 'type' => null, + 'status' => null + ); + $cache = array( + 'type' => null, + 'status' => null + ); + $cacheKeys = array_keys($cache); + + $unknown_code = lang_get('unknown_code'); + $reqMgr = new requirement_mgr($dbHandler); + $arrImport = null; + if ($loop2do = count($arrImportSource)) { + $getOptions = array( + 'output' => 'minimun' + ); + $messages = array( + 'ok' => '', + 'import_req_conflicts_other_branch' => '', + 'import_req_exists_here' => '' + ); + foreach ($messages as $key => $dummy) { + $messages[$key] = lang_get($key); + } + + for ($idx = 0; $idx < $loop2do; $idx ++) { + $msgID = 'ok'; + $req = $arrImportSource[$idx]; + + // Check: + // If item with SAME DOCID exists inside container + // If there is a hit + // We will follow user option: update,create new version + // + // If do not exist check must be repeated, but on WHOLE test project + // If there is a hit -> we can not create + // else => create + // + // + // 20100321 - we do not manage yet user option + $check_in_reqspec = $reqMgr->getByDocID($req['docid'], $tprojectID, + $reqSpecID, $getOptions); + if (is_null($check_in_reqspec)) { + $check_in_tproject = $reqMgr->getByDocID($req['docid'], + $tprojectID, null, $getOptions); + if (! is_null($check_in_tproject)) { + $msgID = 'import_req_conflicts_other_branch'; + } + } else { + $msgID = 'import_req_exists_here'; + } + + foreach ($cacheKeys as $attr) { + if (isset($labels[$attr][$req[$attr]])) { + if (! isset($cache[$attr][$req[$attr]])) { + $cache[$attr][$req[$attr]] = lang_get( + $labels[$attr][$req[$attr]]); + } + $verbose[$attr] = $cache[$attr][$req[$attr]]; + } else { + $verbose[$attr] = sprintf($unknown_code, $req[$attr]); + } + } + + $arrImport[] = array( + 'req_doc_id' => $req['docid'], + 'title' => trim($req['title']), + 'scope' => $req['description'], + 'type' => $verbose['type'], + 'status' => $verbose['status'], + 'expected_coverage' => $req['expected_coverage'], + 'node_order' => $req['order'], + 'check_status' => $messages[$msgID] + ); + } + } + return $arrImport; +} + +function getReqDocIDs(&$db, $srs_id) +{ + $req_spec_mgr = new requirement_spec_mgr($db); + $arrCurrentReq = $req_spec_mgr->get_requirements($srs_id); + + $result = null; + if (count($arrCurrentReq)) { + // only if some reqs exist + foreach ($arrCurrentReq as $data) { + $result[$data['id']] = $data['req_doc_id']; + } + } + + return $result; +} + +/** + * load imported data from file and parse it to array + * + * @return array of array each inner array include fields title and scope (and more) + */ +function loadImportedReq($fileName, $importType) +{ + $retVal = null; + switch ($importType) { + case 'csv': + $pfn = "importReqDataFromCSV"; + break; + + case 'csv_doors': + $pfn = "importReqDataFromCSVDoors"; + break; + + case 'DocBook': + $pfn = "importReqDataFromDocBook"; + break; + } + + if ($pfn) { + $retVal = $pfn($fileName); + if ($importType == 'DocBook') { + // this structure if useful when importing from CSV + // $retVal = array('userFeedback' => arra(),'info' => null); + // + // But we need to return same data structure ALWAYS + // for DocBook we do not use 'parsedCounter' and 'syntaxError' + // + $dummy = array( + 'userFeedback' => null, + 'info' => $retVal + ); + $retVal = $dummy; + } + } + + return $retVal; +} + +/** + * importReqDataFromCSV + */ +function importReqDataFromCSV($fileName) +{ + // CSV line format + $fieldMappings = array( + "docid", + "title", + "description", + "type", + "status", + "expected_coverage", + "node_order" + ); + + $options = array( + 'delimiter' => ',', + 'fieldQty' => count($fieldMappings) + ); + $impData = importCSVData($fileName, $fieldMappings, $options); + + $reqData = &$impData['info']; + if ($reqData) { + // lenght will be adjusted to these values + $field_size = config_get('field_size'); + $fieldLength = array( + "docid" => $field_size->req_docid, + "title" => $field_size->req_title + ); + + $reqCfg = config_get('req_cfg'); + $fieldDefault = array( + "type" => array( + 'check' => 'type_labels', + 'value' => TL_REQ_TYPE_FEATURE + ), + "status" => array( + 'check' => 'status_labels', + 'value' => TL_REQ_STATUS_VALID + ) + ); + + $loop2do = count($reqData); + for ($ddx = 0; $ddx < $loop2do; $ddx ++) { + foreach ($reqData[$ddx] as $fieldKey => &$fieldValue) { + // Adjust Lenght + if (isset($fieldLength[$fieldKey])) { + $fieldValue = trimAndLimit($fieldValue, + $fieldLength[$fieldKey]); + } elseif (isset($fieldDefault[$fieldKey])) { + // Assign default value + $checkKey = $fieldDefault[$fieldKey]['check']; + $checkObj = &$reqCfg->$checkKey; + if (! isset($checkObj[$fieldValue])) { + $fieldValue = $fieldDefault[$fieldKey]['value']; + } + } + } + } + } + return $impData; +} + +/** + * importReqDataFromCSVDoors + * + * @internal revision + * + */ +function importReqDataFromCSVDoors($fileName) +{ + // Some keys are strings, other numeric + $fieldMappings = array( + "Object Identifier" => "title", + "Object Text" => "description", + "Created By", + "Created On", + "Last Modified By", + "Last Modified On" + ); + + $options = array( + 'delimiter' => ',', + 'fieldQty' => count($fieldMappings), + 'processHeader' => true + ); + return importCSVData($fileName, $fieldMappings, $options); +} + +/** + * Parses one 'informaltable' XML entry and produces HTML table as string. + * + * XML relationship: + * informaltable -> tgroup -> thead -> row -> entry + * -> tbody -> row -> entry + * + * 20081103 - sisajr + */ +function getDocBookTableAsHtmlString($docTable, $parseCfg) +{ + $resultTable = ""; + foreach ($docTable->children() as $tgroup) { + if ($tgroup->getName() != $parseCfg->table_group) { + continue; + } + + $table = ""; + foreach ($tgroup->children() as $tbody) { + // get table head + $tbodyName = $tbody->getName(); + $doIt = false; + if ($tbodyName == $parseCfg->table_head) { + $cellTag = array( + 'open' => '', + 'close' => '' + ); + $doIt = true; + } elseif ($tbodyName == $parseCfg->table_body) { + $cellTag = array( + 'open' => '', + 'close' => '' + ); + $doIt = true; + } + + if ($doIt) { + foreach ($tbody->children() as $row) { + if ($row->getName() == $parseCfg->table_row) { + $table_row = ""; + foreach ($row->children() as $entry) { + if (($entry->getName()) == $parseCfg->table_entry) { + if ($entry->count() == 0) { + $table_row .= $cellTag['open'] . + (string) $entry . $cellTag['close']; + } else { + $table_row .= $cellTag['open']; + foreach ($parseCfg->table_entry_children as $ck) { + if (property_exists($entry, $ck)) { + $table_row .= (string) $entry->$ck; + } + } + $table_row .= $cellTag['close']; + } + } + } + + $table_row .= ""; + $table .= $table_row; + } + } + } + } + + $resultTable .= "" . $table . "
    "; + } + + return $resultTable; +} + +/** + * Imports data from DocBook XML + * + * @return array of map + * + */ +function importReqDataFromDocBook($fileName) +{ + $req_cfg = config_get('req_cfg'); + $docbookCfg = $req_cfg->importDocBook; + $xmlData = null; + $field_size = config_get('field_size'); + + $simpleXMLObj = simplexml_load_file($fileName); + + $idx = 0; + foreach ($simpleXMLObj->{$docbookCfg->requirement} as $xmlReq) { + // get all child elements of this requirement + $title = ""; + $description = ""; + $children = $xmlReq->children(); + foreach ($children as $child) { + $nodeName = $child->getName(); + if ($nodeName == $docbookCfg->title) { + $title = (string) $child; + } elseif ($nodeName == $docbookCfg->ordered_list) { + $list = ""; + foreach ($child->children() as $item) { + if ($item->getName() == $docbookCfg->list_item) { + if ($item->count() == 0) { + $list .= "
  • " . (string) $item . "
  • "; + } else { + foreach ($docbookCfg->list_item_children as $ck) { + if (property_exists($item, $ck)) { + $list .= "
  • " . (string) $item->$ck . + "
  • "; + } + } + } + } + } + $description .= "
      " . $list . "
    "; + } elseif ($nodeName == $docbookCfg->table) { + $description .= getDocBookTableAsHtmlString($child, $docbookCfg); + } elseif ($nodeName == $docbookCfg->paragraph) { + $description .= "

    " . (string) $child . "

    "; + } else { + $description .= "

    " . (string) $child . "

    "; + } + } + $xmlData[$idx]['description'] = $description; + $xmlData[$idx]['title'] = trimAndLimit($title, $field_size->req_title); + + // parse Doc ID from requirement title + // first remove any weird characters before the title. This could be probably omitted + $xmlData[$idx]['title'] = preg_replace("/^[^a-zA-Z_0-9]*/", "", + $xmlData[$idx]['title']); + + // get Doc ID + // + // this will create Doc ID as words ended with number + // Example: Req BL 20 Business Logic + // Doc ID: Req BL 20 + // if (preg_match("/[ a-zA-Z_]*[0-9]*/", $xmlData[$i]['title'], $matches)) + // { + // $xmlData[$i]['req_doc_id'] = $matches[0]; + // } + + // this matches first two words in Title and adds counter started from 1 + // Doc ID is grouped (case insensitive), so different groups have their own counter running + // Example: Req BL Business Logic + // Doc ID: Req BL 1 + // Note: Doc ID doesn't need trim_and_limit since it is parsed from Title + // new dBug($xmlData[$idx]['title']); + + if (preg_match("/[ ]*[a-zA-Z_0-9]*[ ][a-zA-Z_0-9]*/", + $xmlData[$idx]['title'], $matches)) { + $index = strtolower($matches[0]); + if (! isset($counter[$index])) { + $counter[$index] = 0; + } + $counter[$index] ++; + $xmlData[$idx]['docid'] = $matches[0] . " " . $counter[$index]; + } else { + $xmlData[$idx]['docid'] = uniqid('REQ-'); + } + + $xmlData[$idx]['node_order'] = $idx; + $xmlData[$idx]['expected_coverage'] = 0; + $xmlData[$idx]['type'] = TL_REQ_TYPE_FEATURE; + $xmlData[$idx]['status'] = TL_REQ_STATUS_VALID; + + $idx ++; + } + + return $xmlData; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function doReqImport(&$dbHandler, $tprojectID, $userID, $reqSpecID, $fileName, + $importType, $emptyScope, $conflictSolution, $doImport) +{ + $arrImportSource = loadImportedReq($fileName, $importType); + $arrImport = null; + + if (count($arrImportSource)) { + $map_cur_reqdoc_id = getReqDocIDs($dbHandler, $reqSpecID); + if ($doImport) { + $arrImport = executeImportedReqs($dbHandler, $arrImportSource, + $map_cur_reqdoc_id, $conflictSolution, $emptyScope, $reqSpecID, + $tprojectID, $userID); + } else { + $arrImport = compareImportedReqs($dbHandler, $arrImportSource, + $tprojectID, $reqSpecID); + } + } + return $arrImport; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function exportReqDataToCSV($reqData) +{ + $sKeys = array( + "req_doc_id", + "title", + "scope" + ); + return exportDataToCSV($reqData, $sKeys, $sKeys, 0, ','); +} + +/** + * getReqCoverage + */ +function getReqCoverage(&$dbHandler, $reqs, &$execMap) +{ + $tree_mgr = new tree($dbHandler); + + $coverageAlgorithm = config_get('req_cfg')->coverageStatusAlgorithm; + $resultsCfg = config_get('results'); + + $coverage['withTestCase'] = null; + $coverage['withoutTestCase'] = null; + $coverage['byStatus'] = $resultsCfg['status_label_for_exec_ui']; + $status_counters = array(); + foreach ($coverage['byStatus'] as $status_code => $value) { + $coverage['byStatus'][$status_code] = array(); + $status_counters[$resultsCfg['status_code'][$status_code]] = 0; + } + + $reqs_qty = count($reqs); + if ($reqs_qty > 0) { + foreach ($reqs as $requirement_id => $req_tcase_set) { + $first_key = key($req_tcase_set); + $item_qty = count($req_tcase_set); + $req = array( + "id" => $requirement_id, + "title" => $req_tcase_set[$first_key]['req_title'], + "req_doc_id" => $req_tcase_set[$first_key]["req_doc_id"] + ); + + foreach ($status_counters as $key => $value) { + $status_counters[$key] = 0; + } + if ($req_tcase_set[$first_key]['testcase_id'] > 0) { + $coverage['withTestCase'][$requirement_id] = 1; + } else { + $coverage['withoutTestCase'][$requirement_id] = $req; + } + + for ($idx = 0; $idx < $item_qty; $idx ++) { + $item_info = $req_tcase_set[$idx]; + if ($idx == 0) // just to avoid useless assignments + { + $req['title'] = $item_info['req_title']; + } + + // BUGID 1063 + if ($item_info['testcase_id'] > 0) { + $exec_status = $resultsCfg['status_code']['not_run']; + $tcase_path = ''; + if (isset($execMap[$item_info['testcase_id']]) && + count($execMap[$item_info['testcase_id']])) { + $execInfo = end($execMap[$item_info['testcase_id']]); + $tcase_path = $execInfo['tcase_path']; + if (isset($execInfo['status']) && + trim($execInfo['status']) != '') { + $exec_status = $execInfo['status']; + } + } else { + $path_info = $tree_mgr->get_full_path_verbose( + $item_info['testcase_id']); + unset($path_info[$item_info['testcase_id']][0]); // remove test project name + $path_info[$item_info['testcase_id']][] = ''; + $tcase_path = implode(' / ', + $path_info[$item_info['testcase_id']]); + } + $status_counters[$exec_status] ++; + $req['tcList'][] = array( + "tcID" => $item_info['testcase_id'], + "title" => $item_info['testcase_name'], + "tcaseExternalID" => $item_info['testcase_external_id'], + "version" => $item_info['testcase_version'], + "tcase_path" => $tcase_path, + "status" => $exec_status, + "status_label" => $resultsCfg['status_label'][$resultsCfg['code_status'][$exec_status]] + ); + } + } // for($idx = 0; $idx < $item_qty; $idx++) + + // We analyse counters + $go_away = 0; + foreach ($coverageAlgorithm['checkOrder'] as $checkKey) { + foreach ($coverageAlgorithm['checkType'][$checkKey] as $tcase_status) { + if ($checkKey == 'atLeastOne' && + $status_counters[$resultsCfg['status_code'][$tcase_status]] > + 0) { + $coverage['byStatus'][$tcase_status][] = $req; + $go_away = 1; + break; + } + if ($checkKey == 'all') { + if ($status_counters[$resultsCfg['status_code'][$tcase_status]] == + $item_qty) { + $coverage['byStatus'][$tcase_status][] = $req; + $go_away = 1; + break; + } // -amitkhullar - 20090331 - BUGFIX 2292 + elseif ($status_counters[$resultsCfg['status_code'][$tcase_status]] > + 0) { + $coverage['byStatus'][$tcase_status][] = $req; + $go_away = 1; + break; + } elseif (isset($coverageAlgorithm['checkFail']) && + isset($coverageAlgorithm['checkFail'][$checkKey]) && + isset($req['tcList'])) { + + // BUGID 2171 + // ($coverageAlgorithm['checkFail'][$checkKey]==$tcase_status) + // If particular requirement has assigned more than one test cases, and: + // - at least one of assigned test cases was not yet executed + // - the rest of assigned test cases was executed and passed + // then on the "Requirements based report" this particular requirement + // is not shown at all (in any section). + $coverage['byStatus'][$coverageAlgorithm['checkFail'][$checkKey]][] = $req; + $go_away = 1; + break; + } + } + } + if ($go_away) { + break; + } + } + } // foreach($reqs as $requirement_id => $req_tcase_set) + } + return $coverage; +} + +/* + * function: + * + * args : + * + * returns: + * + * rev: 20090716 - franciscom - getLastExecution() interface changes + */ +function getLastExecutions(&$db, $tcaseSet, $tplanId) +{ + $execMap = array(); + if (count($tcaseSet)) { + $tcaseMgr = new testcase($db); + $items = array_keys($tcaseSet); + $path_info = $tcaseMgr->tree_manager->get_full_path_verbose($items); + $options = array( + 'getNoExecutions' => 1, + 'groupByBuild' => 0 + ); + foreach ($tcaseSet as $tcaseId => $tcInfo) { + $execMap[$tcaseId] = $tcaseMgr->getLastExecution($tcaseId, + $tcInfo['tcversion_id'], $tplanId, testcase::ANY_BUILD, + testcase::ANY_PLATFORM, $options); + + unset($path_info[$tcaseId][0]); // remove test project name + $path_info[$tcaseId][] = ''; + $execMap[$tcaseId][$tcInfo['tcversion_id']]['tcase_path'] = implode( + ' / ', $path_info[$tcaseId]); + } + + unset($tcaseMgr); + } + return $execMap; +} + +// 20061014 - franciscom +function check_syntax($fileName, $importType) +{ + switch ($importType) { + case 'csv': + $pfn = "check_syntax_csv"; + break; + + case 'csv_doors': + $pfn = "check_syntax_csv_doors"; + break; + + case 'XML': + $pfn = "check_syntax_xml"; + break; + + case 'DocBook': + $pfn = "check_syntax_xml"; + break; + } + if ($pfn) { + return $pfn($fileName); + } +} + +/* + * function: + * + * args: + * + * returns: + * + */ +function check_syntax_xml($fileName) +{ + $ret = array(); + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + return $ret; +} + +function check_syntax_csv($fileName) +{ + $ret = array(); + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + return $ret; +} + +// Must be implemented !!! +function check_syntax_csv_doors($fileName) +{ + $ret = array(); + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + + return $ret; +} + +/** + * replace BBCode-link tagged links in req/reqspec scope with actual links + * + * @internal revisions: + * 20110525 - Julian - BUGID 4487 - allow to specify requirement version for internal links + * 20100301 - asimon - added anchor and tproj parameters to tags + * + * @param resource $dbHandler + * database handle + * @param string $scope + * text in which to replace tags with links + * @param integer $tprojectID + * ID of testproject to which req/reqspec belongs + * @return string $scope text with generated links + */ +function req_link_replace($dbHandler, $scope, $tprojectID) +{ + + // Use this to improve performance when is called in loops + static $tree_mgr; + static $tproject_mgr; + static $req_mgr; + static $cfg; + static $l18n; + static $title; + static $tables; + + if (! $tproject_mgr) { + $tproject_mgr = new testproject($dbHandler); + $tree_mgr = new tree($dbHandler); + $req_mgr = new requirement_mgr($dbHandler); + + $tables = tlObjectWithDB::getDBTables( + array( + 'requirements', + 'req_specs' + )); + + $cfg = config_get('internal_links'); + $l18n['version'] = lang_get('tcversion_indicator'); + + $prop2loop = array( + 'req' => array( + 'prop' => 'req_link_title', + 'default_lbl' => 'requirement' + ), + 'req_spec' => array( + 'prop' => 'req_spec_link_title', + 'default_lbl' => 'req_spec_short' + ) + ); + + // configure link title (first part of the generated link) + $title = array(); + foreach ($prop2loop as $key => $elem) { + $prop = $elem['prop']; + if ($cfg->$prop->type == 'string' && $cfg->$prop->value != '') { + $title[$key] = lang_get($cfg->$prop->value); + } elseif ($cfg->$prop->type == 'none') { + $title[$key] = ''; + } else { + $title[$key] = lang_get($elem['default_lbl']) . ": "; + } + } + } + + $prefix = $tproject_mgr->getTestCasePrefix($tprojectID); + $string2replace = array(); + + // configure target in which link shall open + // use a reasonable default value if nothing is set in config + $cfg->target = isset($cfg->target) ? $cfg->target : 'popup'; + + switch ($cfg->target) { + case 'popup': + // use javascript to open popup window + $string2replace['req'] = '%s%s%s'; + $string2replace['req_spec'] = '%s%s'; + break; + + case 'window': + case 'frame': // open in same frame + $target = ($cfg->target == 'window') ? 'target="_blank"' : 'target="_self"'; + $string2replace['req'] = '%s%s%s'; + $string2replace['req_spec'] = '%s%s'; + break; + } + + // now the actual replacing + $patterns2search = array(); + $patterns2search['req'] = "#\[req(.*)\](.*)\[/req\]#iU"; + $patterns2search['req_spec'] = "#\[req_spec(.*)\](.*)\[/req_spec\]#iU"; + $patternPositions = array( + 'complete_string' => 0, + 'attributes' => 1, + 'doc_id' => 2 + ); + + $items2search['req'] = array( + 'tproj', + 'anchor', + 'version' + ); + $items2search['req_spec'] = array( + 'tproj', + 'anchor' + ); + $itemPositions = array( + 'item' => 0, + 'item_value' => 1 + ); + + $sql2exec = array(); + $sql2exec['req'] = " SELECT id, req_doc_id AS doc_id " . + " FROM {$tables['requirements']} WHERE req_doc_id="; + + $sql2exec['req_spec'] = " SELECT id, doc_id FROM {$tables['req_specs']} " . + " WHERE doc_id="; + + foreach ($patterns2search as $accessKey => $pattern) { + + $matches = array(); + preg_match_all($pattern, $scope, $matches); + + // if no req_doc_id is set skip loop + if (count($matches[$patternPositions['doc_id']]) == 0) { + continue; + } + + foreach ($matches[$patternPositions['complete_string']] as $key => $matched_string) { + + $matched = array(); + $matched['tproj'] = ''; + $matched['anchor'] = ''; + $matched['version'] = ''; + + // only look for attributes if any found + if ($matches[$patternPositions['attributes']][$key] != '') { + foreach ($items2search[$accessKey] as $item) { + $matched_item = array(); + preg_match('/' . $item . '=([\w]+)/', $matched_string, + $matched_item); + $matched[$item] = (isset( + $matched_item[$itemPositions['item_value']])) ? $matched_item[$itemPositions['item_value']] : ''; + } + } + // set tproj to current project if tproj is not specified in attributes + if (! isset($matched['tproj']) || $matched['tproj'] == '') { + $matched['tproj'] = $prefix; + } + + // get all reqs / req specs with the specified doc_id + $sql = $sql2exec[$accessKey] . + "'{$matches[$patternPositions['doc_id']][$key]}'"; + $rs = $dbHandler->get_recordset($sql); + + if (count($rs) > 0) { + + foreach ($rs as $value) { + // get root of linked node and check + $real_root = $tree_mgr->getTreeRoot($value['id']); + $matched_root_info = $tproject_mgr->get_by_prefix( + $matched['tproj']); + + // do only continue if project with the specified project exists and + // if the requirement really belongs to the specified project (requirements + // with the same doc_id may exist within different projects) + if ($real_root == $matched_root_info['id']) { + if ($accessKey == 'req') { + // add version to link title if set + $version = ''; + $req_version_id = 'null'; + if ($matched['version'] != '') { + // get requirement version_id of the specified version + $req_version = $req_mgr->get_by_id($value['id'], + null, $matched['version']); + + // if version is not set or wrong version was set + // -> show latest version by setting version_id to null + $req_version_id = isset( + $req_version[0]['version_id']) ? $req_version[0]['version_id'] : 'null'; + + // if req_version_id exists set the version to show on hyperlink text + if ($req_version_id != 'null') { + $version = sprintf($l18n['version'], + $matched['version']); + } + } + $urlString = sprintf($string2replace[$accessKey], + $value['id'], $req_version_id, + $matched['anchor'], $title[$accessKey], + $value['doc_id'], $version); + } else { + // build urlString for req specs which do not have a version + $urlString = sprintf($string2replace[$accessKey], + $value['id'], $matched['anchor'], + $title[$accessKey], $value['doc_id']); + } + $scope = str_replace($matched_string, $urlString, $scope); + } + } + } + } + } + + return $scope; +} + +?> diff --git a/lib/functions/roles.inc.php b/lib/functions/roles.inc.php index ca8b1ca0d6..dac37649bf 100644 --- a/lib/functions/roles.inc.php +++ b/lib/functions/roles.inc.php @@ -1,480 +1,491 @@ - HAS EFFECTS ONLY ON LAYOUT - global $g_rights_tp; - global $g_rights_mgttc; - global $g_rights_kw; - global $g_rights_req; - global $g_rights_product; - global $g_rights_cf; - global $g_rights_users_global; - global $g_rights_users; - global $g_rights_system; - global $g_rights_platforms; - global $g_rights_issuetrackers; - global $g_rights_codetrackers; - global $g_rights_executions; - - // global $g_rights_reqmgrsystems; - - global $g_propRights_global; - global $g_propRights_product; - - - // @since 1.9.7 - $l18nCfg = - array('desc_testplan_execute' => null, - 'desc_testplan_create_build' => null, - 'desc_testplan_metrics' => null, - 'desc_testplan_planning' => null, - 'desc_mgt_view_tc' => null, - 'desc_mgt_modify_tc' => null, - 'mgt_testplan_create' => null, - 'desc_mgt_view_key' => null, - 'desc_mgt_modify_key' => null, - 'desc_keyword_assignment' => null, - 'desc_mgt_view_req' => null, - 'desc_monitor_requirement' => null, - 'desc_mgt_modify_req' => null, - 'desc_req_tcase_link_management' => null, - 'desc_mgt_modify_product' => null, - 'desc_project_inventory_management' => null, - 'desc_project_inventory_view' => null, - 'desc_cfield_view' => null, - 'desc_cfield_management' => null, - 'desc_cfield_assignment' => null, - 'desc_exec_assign_testcases' => null, - 'desc_platforms_view' => null, - 'desc_platforms_management' => null, - 'desc_issuetrackers_view' => null, - 'desc_issuetrackers_management' => null, - 'desc_codetrackers_view' => null, - 'desc_codetrackers_management' => null, - 'desc_mgt_modify_users' => null, - 'desc_role_management' => null, - 'desc_user_role_assignment' => null, - 'desc_testproject_user_role_assignment' => null, - 'desc_testplan_user_role_assignment' => null, - 'desc_mgt_view_events' => null, - 'desc_events_mgt' => null, - 'desc_mgt_unfreeze_req' => null, - 'desc_mgt_plugins' => null, - 'right_exec_edit_notes' => null, - 'right_exec_delete' => null, - 'right_testplan_unlink_executed_testcases' => null, - 'right_testproject_delete_executed_testcases' => null, - 'right_testproject_edit_executed_testcases' => null, - 'right_testplan_milestone_overview' => null, - 'right_exec_testcases_assigned_to_me' => null, - 'right_testproject_metrics_dashboard' => null, - 'right_testplan_add_remove_platforms' => null, - 'right_testplan_update_linked_testcase_versions' => null, - 'right_testplan_set_urgent_testcases' => null, - 'right_testplan_show_testcases_newest_versions' => null, - 'right_testcase_freeze' => null, - 'right_exec_ro_access' => null, - 'right_testproject_add_remove_keywords_executed_tcversions' => null, - 'right_delete_frozen_tcversion' => null); - - - - $l18n = init_labels($l18nCfg); - - $g_rights_executions = - array('exec_edit_notes' => $l18n['right_exec_edit_notes'], - 'exec_delete' => $l18n['right_exec_delete'], - 'exec_ro_access' => $l18n['right_exec_ro_access']); - - // order is important ? - $g_rights_tp = - array("mgt_testplan_create" => $l18n['mgt_testplan_create'], - "testplan_create_build" => $l18n['desc_testplan_create_build'], - "testplan_planning" => $l18n['desc_testplan_planning'], - "testplan_execute" => $l18n['desc_testplan_execute'], - "testplan_metrics" => $l18n['desc_testplan_metrics'], - // "testplan_user_role_assignment" => $l18n['desc_user_role_assignment'], - "exec_assign_testcases" => $l18n['desc_exec_assign_testcases'], - "testplan_unlink_executed_testcases" => $l18n['right_testplan_unlink_executed_testcases'], - "testplan_milestone_overview" => $l18n['right_testplan_milestone_overview'], - "exec_testcases_assigned_to_me" => $l18n['right_exec_testcases_assigned_to_me'], - 'testplan_add_remove_platforms' => $l18n['right_testplan_add_remove_platforms'], - 'testplan_update_linked_testcase_versions' => $l18n['right_testplan_update_linked_testcase_versions'], - 'testplan_set_urgent_testcases' => $l18n['right_testplan_set_urgent_testcases'], - 'testplan_show_testcases_newest_versions' => $l18n['right_testplan_show_testcases_newest_versions']); - - - $g_rights_mgttc = - array("mgt_view_tc" => $l18n['desc_mgt_view_tc'], - "mgt_modify_tc" => $l18n['desc_mgt_modify_tc'], - "testproject_delete_executed_testcases" => null, - "testproject_edit_executed_testcases" => null , - "testproject_add_remove_keywords_executed_tcversions" => null, - "testcase_freeze" => null, - "delete_frozen_tcversion" => null); - - foreach( $g_rights_mgttc as $tr => $lbl ) { - if( null == $lbl ) { - $g_rights_mgttc[$tr] = $l18n['right_' . $tr]; - } - } - - - $g_rights_kw = array("mgt_view_key" => $l18n['desc_mgt_view_key'], - "keyword_assignment" => $l18n['desc_keyword_assignment'], - "mgt_modify_key" => $l18n['desc_mgt_modify_key']); - - $g_rights_req = array("mgt_view_req" => $l18n['desc_mgt_view_req'], - "monitor_requirement" => $l18n['desc_monitor_requirement'], - "mgt_modify_req" => $l18n['desc_mgt_modify_req'], - "mgt_unfreeze_req" => $l18n['desc_mgt_unfreeze_req'], - "req_tcase_link_management" => $l18n['desc_req_tcase_link_management']); - - $g_rights_product = - array("mgt_modify_product" => $l18n['desc_mgt_modify_product'], - "cfield_assignment" => $l18n['desc_cfield_assignment'], - "project_inventory_management" => $l18n['desc_project_inventory_management'], - "project_inventory_view" => $l18n['desc_project_inventory_view'] ); - - $g_rights_cf = array("cfield_view" => $l18n['desc_cfield_view'], - "cfield_management" => $l18n['desc_cfield_management']); - - - $g_rights_platforms = array("platform_view" => $l18n['desc_platforms_view'], - "platform_management" => $l18n['desc_platforms_management']); - - $g_rights_issuetrackers = array("issuetracker_view" => $l18n['desc_issuetrackers_view'], - "issuetracker_management" => $l18n['desc_issuetrackers_management']); - - $g_rights_codetrackers = array("codetracker_view" => $l18n['desc_codetrackers_view'], - "codetracker_management" => $l18n['desc_codetrackers_management']); - - - // $g_rights_reqmgrsystems = array("reqmgrsystem_view" => $l18n['desc_reqmgrsystems_view'], - // "reqmgrsystem_management" => $l18n['desc_reqmgrsystems_management']); - - - // Global means test project independent. - $g_rights_users_global = array("mgt_users" => $l18n['desc_mgt_modify_users'], - "role_management" => $l18n['desc_role_management'], - "user_role_assignment" => $l18n['desc_testproject_user_role_assignment'], - "testplan_user_role_assignment" => $l18n['desc_testplan_user_role_assignment'], - ); - - $g_rights_users = $g_rights_users_global; - - $g_rights_system = array ("mgt_view_events" => $l18n['desc_mgt_view_events'], - "events_mgt" => $l18n['desc_events_mgt'], - "mgt_plugins" => $l18n['desc_mgt_plugins']); - - - - $g_propRights_global = array_merge($g_rights_users_global,$g_rights_system,$g_rights_product); - unset($g_propRights_global["testproject_user_role_assignment"]); - - $g_propRights_product = array_merge($g_propRights_global,$g_rights_mgttc,$g_rights_kw,$g_rights_req); -} - - -/** - * function takes a roleQuestion from a specified link and returns whether - * the user has rights to view it - * - * @param resource &$db reference to database handler - * @param string $roleQuestion a right identifier - * @param integer $tprojectID (optional) - * @param integer $tplanID (optional) - * - * @see tlUser - */ -function has_rights(&$db,$roleQuestion,$tprojectID = null,$tplanID = null) { - return $_SESSION['currentUser']->hasRight($db,$roleQuestion,$tprojectID,$tplanID); -} - - -/** - * - */ -function propagateRights($fromRights,$propRights,&$toRights) { - // the mgt_users right isn't test project related so this right is inherited from - // the global role (if set) - foreach($propRights as $right => $desc) { - if (in_array($right,$fromRights) && !in_array($right,$toRights)) { - $toRights[] = $right; - } - } -} - - -/** - * TBD - * - * @param string $rights - * @param mixed $roleQuestion - * @param boolean $bAND [default = 1] - * @return mixed 'yes' or null - * - * @author Andreas Morsing - * @since 20.02.2006, 20:30:07 - * - **/ -function checkForRights($rights,$roleQuestion,$bAND = 1) { - $ret = null; - //check to see if the $roleQuestion variable appears in the $roles variable - if (is_array($roleQuestion)) { - $r = array_intersect($roleQuestion,$rights); - if ($bAND) { - //for AND all rights must be present - if (sizeof($r) == sizeof($roleQuestion)) { - $ret = 'yes'; - } - } else { - //for OR one of all must be present - if (sizeof($r)) { - $ret = 'yes'; - } - } - } else { - $ret = (in_array($roleQuestion,$rights) ? 'yes' : null); - } - return $ret; -} - -/** - * Get info about user(s) role at test project level, - * with indication about the nature of role: inherited or assigned. - * - * To get a user role we consider a 3 layer model: - * layer 1 - user <--- uplayer - * layer 2 - test project <--- in this fuction we are interested in this level. - * layer 3 - test plan - * - * args : $tproject_id - * [$user_id] - * - * @return array map with effetive_role in context ($tproject_id) - * key: user_id - * value: map with keys: - * login (from users table - useful for debug) - * user_role_id (from users table - useful for debug) - * uplayer_role_id (always = user_role_id) - * uplayer_is_inherited - * effective_role_id user role for test project - * is_inherited - */ -function get_tproject_effective_role(&$db,$tproject,$user_id = null,$users = null) { - $effective_role = array(); - $tproject_id = $tproject['id']; - if (!is_null($user_id)) - { - $users = tlUser::getByIDs($db,(array)$user_id); - } - else if (is_null($users)) - { - $users = tlUser::getAll($db); - } - - if ($users) - { - foreach($users as $id => $user) - { - // manage admin exception - $isInherited = 1; - $effectiveRoleID = $user->globalRoleID; - $effectiveRole = $user->globalRole; - if( ($user->globalRoleID != TL_ROLES_ADMIN) && !$tproject['is_public']) - { - $isInherited = $tproject['is_public']; - $effectiveRoleID = TL_ROLES_NO_RIGHTS; - $effectiveRole = ''; - } - - if(isset($user->tprojectRoles[$tproject_id])) - { - $isInherited = 0; - $effectiveRoleID = $user->tprojectRoles[$tproject_id]->dbID; - $effectiveRole = $user->tprojectRoles[$tproject_id]; - } - - $effective_role[$id] = array('login' => $user->login, - 'user' => $user, - 'user_role_id' => $user->globalRoleID, - 'uplayer_role_id' => $user->globalRoleID, - 'uplayer_is_inherited' => 0, - 'effective_role_id' => $effectiveRoleID, - 'effective_role' => $effectiveRole, - 'is_inherited' => $isInherited); - } - } - return $effective_role; -} - - -/** - * Get info about user(s) role at test plan level, - * with indication about the nature of role: inherited or assigned. - * - * To get a user role we consider a 3 layer model: - * layer 1 - user <--- uplayer - * layer 2 - test project <--- in this fuction we are interested in this level. - * layer 3 - test plan - - args : $tplan_id - $tproject_id - [$user_id] - - * @return array map with effetive_role in context ($tplan_id) - key: user_id - value: map with keys: - login (from users table - useful for debug) - user_role_id (from users table - useful for debug) - uplayer_role_id user role for test project - uplayer_is_inherited 1 -> uplayer role is inherited - 0 -> uplayer role is written in table - effective_role_id user role for test plan - is_inherited - - @internal revisions - 20101111 - franciscom - BUGID 4006: test plan is_public - */ -function get_tplan_effective_role(&$db,$tplan_id,$tproject,$user_id = null,$users = null,$inheritanceMode = null) -{ - $tplan_mgr = new testplan($db); - $tplan = $tplan_mgr->get_by_id($tplan_id); - unset($tplan_mgr); - - $roleInhMode = !is_null($inheritanceMode) ? $inheritanceMode : - config_get('testplan_role_inheritance_mode'); - - /** - * key: user_id - * value: map with keys: - * login (from users table - useful for debug) - * user_role_id (from users table - useful for debug) - * uplayer_role_id (always = user_role_id) - * uplayer_is_inherited - * effective_role_id user role for test project - * is_inherited - */ - $effective_role = get_tproject_effective_role($db,$tproject,$user_id,$users); - - foreach($effective_role as $user_id => $row) { - - $doNextStep = true; - - // Step 1 - If I've role specified for Test Plan, get and skip - if( isset($row['user']->tplanRoles[$tplan_id]) ) { - $isInherited = 0; - $doNextStep = false; - - $effective_role[$user_id]['effective_role_id'] = $row['user']->tplanRoles[$tplan_id]->dbID; - $effective_role[$user_id]['effective_role'] = $row['user']->tplanRoles[$tplan_id]; - } - - // For Private Test Plans specific role is NEEDED for users with - // global role !? ADMIN - if( $doNextStep && - ($row['user']->globalRoleID != TL_ROLES_ADMIN) && !$tplan['is_public']) { - $isInherited = 0; - $doNextStep = false; - - $effective_role[$user_id]['effective_role_id'] = TL_ROLES_NO_RIGHTS; - $effective_role[$user_id]['effective_role'] = ''; - } - - if( $doNextStep ) { - $isInherited = 1; - - switch($roleInhMode) { - case 'testproject': - $effective_role[$user_id]['uplayer_role_id'] = $effective_role[$user_id]['effective_role_id']; - $effective_role[$user_id]['uplayer_is_inherited'] = $effective_role[$user_id]['is_inherited']; - break; - - case 'global': - $effective_role[$user_id]['effective_role_id'] = $row['user']->globalRoleID; - $effective_role[$user_id]['effective_role'] = $row['user']->globalRole; - break; - } - } - - $effective_role[$user_id]['is_inherited'] = $isInherited; - } - return $effective_role; -} - - -function getRoleErrorMessage($code) -{ - $msg = 'ok'; - switch($code) - { - case tlRole::E_NAMEALREADYEXISTS: - $msg = lang_get('error_duplicate_rolename'); - break; - - case tlRole::E_NAMELENGTH: - $msg = lang_get('error_role_no_rolename'); - break; - - case tlRole::E_EMPTYROLE: - $msg = lang_get('error_role_no_rights'); - break; - - case tl::OK: - break; - - case ERROR: - case tlRole::E_DBERROR: - default: - $msg = lang_get('error_role_not_updated'); - } - return $msg; -} - - -function deleteRole(&$db,$roleID) -{ - $userFeedback = ''; - $role = new tlRole($roleID); - $role->readFromDb($db); - if ($role->deleteFromDB($db) < tl::OK) - $userFeedback = lang_get("error_role_deletion"); - else - logAuditEvent(TLS("audit_role_deleted",$role->getDisplayName()),"DELETE",$roleID,"roles"); - - return $userFeedback; + HAS EFFECTS ONLY ON LAYOUT + global $g_rights_tp; + global $g_rights_mgttc; + global $g_rights_kw; + global $g_rights_req; + global $g_rights_product; + global $g_rights_cf; + global $g_rights_users_global; + global $g_rights_users; + global $g_rights_system; + global $g_rights_platforms; + global $g_rights_issuetrackers; + global $g_rights_codetrackers; + global $g_rights_executions; + global $g_propRights_global; + global $g_propRights_product; + + // @since 1.9.7 + $l18nCfg = array( + 'desc_testplan_execute' => null, + 'desc_testplan_create_build' => null, + 'desc_testplan_metrics' => null, + 'desc_testplan_planning' => null, + 'desc_mgt_view_tc' => null, + 'desc_mgt_modify_tc' => null, + 'mgt_testplan_create' => null, + 'desc_mgt_view_key' => null, + 'desc_mgt_modify_key' => null, + 'desc_keyword_assignment' => null, + 'desc_mgt_view_req' => null, + 'desc_monitor_requirement' => null, + 'desc_mgt_modify_req' => null, + 'desc_req_tcase_link_management' => null, + 'desc_mgt_modify_product' => null, + 'desc_project_inventory_management' => null, + 'desc_project_inventory_view' => null, + 'desc_cfield_view' => null, + 'desc_cfield_management' => null, + 'desc_cfield_assignment' => null, + 'desc_exec_assign_testcases' => null, + 'desc_platforms_view' => null, + 'desc_platforms_management' => null, + 'desc_issuetrackers_view' => null, + 'desc_issuetrackers_management' => null, + 'desc_codetrackers_view' => null, + 'desc_codetrackers_management' => null, + 'desc_mgt_modify_users' => null, + 'desc_role_management' => null, + 'desc_user_role_assignment' => null, + 'desc_testproject_user_role_assignment' => null, + 'desc_testplan_user_role_assignment' => null, + 'desc_mgt_view_events' => null, + 'desc_events_mgt' => null, + 'desc_mgt_unfreeze_req' => null, + 'desc_mgt_plugins' => null, + 'right_exec_edit_notes' => null, + 'right_exec_delete' => null, + 'right_testplan_unlink_executed_testcases' => null, + 'right_testproject_delete_executed_testcases' => null, + 'right_testproject_edit_executed_testcases' => null, + 'right_testplan_milestone_overview' => null, + 'right_exec_testcases_assigned_to_me' => null, + 'right_testproject_metrics_dashboard' => null, + 'right_testplan_add_remove_platforms' => null, + 'right_testplan_update_linked_testcase_versions' => null, + 'right_testplan_set_urgent_testcases' => null, + 'right_testplan_show_testcases_newest_versions' => null, + 'right_testcase_freeze' => null, + 'right_exec_ro_access' => null, + 'right_testproject_add_remove_keywords_executed_tcversions' => null, + 'right_delete_frozen_tcversion' => null + ); + + $l18n = init_labels($l18nCfg); + + $g_rights_executions = array( + 'exec_edit_notes' => $l18n['right_exec_edit_notes'], + 'exec_delete' => $l18n['right_exec_delete'], + 'exec_ro_access' => $l18n['right_exec_ro_access'] + ); + + // order is important ? + $g_rights_tp = array( + "mgt_testplan_create" => $l18n['mgt_testplan_create'], + "testplan_create_build" => $l18n['desc_testplan_create_build'], + "testplan_planning" => $l18n['desc_testplan_planning'], + "testplan_execute" => $l18n['desc_testplan_execute'], + "testplan_metrics" => $l18n['desc_testplan_metrics'], + // "testplan_user_role_assignment" => $l18n['desc_user_role_assignment'], + "exec_assign_testcases" => $l18n['desc_exec_assign_testcases'], + "testplan_unlink_executed_testcases" => $l18n['right_testplan_unlink_executed_testcases'], + "testplan_milestone_overview" => $l18n['right_testplan_milestone_overview'], + "exec_testcases_assigned_to_me" => $l18n['right_exec_testcases_assigned_to_me'], + 'testplan_add_remove_platforms' => $l18n['right_testplan_add_remove_platforms'], + 'testplan_update_linked_testcase_versions' => $l18n['right_testplan_update_linked_testcase_versions'], + 'testplan_set_urgent_testcases' => $l18n['right_testplan_set_urgent_testcases'], + 'testplan_show_testcases_newest_versions' => $l18n['right_testplan_show_testcases_newest_versions'] + ); + + $g_rights_mgttc = array( + "mgt_view_tc" => $l18n['desc_mgt_view_tc'], + "mgt_modify_tc" => $l18n['desc_mgt_modify_tc'], + "testproject_delete_executed_testcases" => null, + "testproject_edit_executed_testcases" => null, + "testproject_add_remove_keywords_executed_tcversions" => null, + "testcase_freeze" => null, + "delete_frozen_tcversion" => null + ); + + foreach ($g_rights_mgttc as $tr => $lbl) { + if (null == $lbl) { + $g_rights_mgttc[$tr] = $l18n['right_' . $tr]; + } + } + + $g_rights_kw = array( + "mgt_view_key" => $l18n['desc_mgt_view_key'], + "keyword_assignment" => $l18n['desc_keyword_assignment'], + "mgt_modify_key" => $l18n['desc_mgt_modify_key'] + ); + + $g_rights_req = array( + "mgt_view_req" => $l18n['desc_mgt_view_req'], + "monitor_requirement" => $l18n['desc_monitor_requirement'], + "mgt_modify_req" => $l18n['desc_mgt_modify_req'], + "mgt_unfreeze_req" => $l18n['desc_mgt_unfreeze_req'], + "req_tcase_link_management" => $l18n['desc_req_tcase_link_management'] + ); + + $g_rights_product = array( + "mgt_modify_product" => $l18n['desc_mgt_modify_product'], + "cfield_assignment" => $l18n['desc_cfield_assignment'], + "project_inventory_management" => $l18n['desc_project_inventory_management'], + "project_inventory_view" => $l18n['desc_project_inventory_view'] + ); + + $g_rights_cf = array( + "cfield_view" => $l18n['desc_cfield_view'], + "cfield_management" => $l18n['desc_cfield_management'] + ); + + $g_rights_platforms = array( + "platform_view" => $l18n['desc_platforms_view'], + "platform_management" => $l18n['desc_platforms_management'] + ); + + $g_rights_issuetrackers = array( + "issuetracker_view" => $l18n['desc_issuetrackers_view'], + "issuetracker_management" => $l18n['desc_issuetrackers_management'] + ); + + $g_rights_codetrackers = array( + "codetracker_view" => $l18n['desc_codetrackers_view'], + "codetracker_management" => $l18n['desc_codetrackers_management'] + ); + + // Global means test project independent. + $g_rights_users_global = array( + "mgt_users" => $l18n['desc_mgt_modify_users'], + "role_management" => $l18n['desc_role_management'], + "user_role_assignment" => $l18n['desc_testproject_user_role_assignment'], + "testplan_user_role_assignment" => $l18n['desc_testplan_user_role_assignment'] + ); + + $g_rights_users = $g_rights_users_global; + + $g_rights_system = array( + "mgt_view_events" => $l18n['desc_mgt_view_events'], + "events_mgt" => $l18n['desc_events_mgt'], + "mgt_plugins" => $l18n['desc_mgt_plugins'] + ); + + $g_propRights_global = array_merge($g_rights_users_global, $g_rights_system, + $g_rights_product); + unset($g_propRights_global["testproject_user_role_assignment"]); + + $g_propRights_product = array_merge($g_propRights_global, $g_rights_mgttc, + $g_rights_kw, $g_rights_req); +} + +/** + * function takes a roleQuestion from a specified link and returns whether + * the user has rights to view it + * + * @param + * resource &$db reference to database handler + * @param string $roleQuestion + * a right identifier + * @param integer $tprojectID + * (optional) + * @param integer $tplanID + * (optional) + * + * @see tlUser + */ +function has_rights(&$db, $roleQuestion, $tprojectID = null, $tplanID = null) +{ + return $_SESSION['currentUser']->hasRight($db, $roleQuestion, $tprojectID, + $tplanID); +} + +/** + */ +function propagateRights($fromRights, $propRights, &$toRights) +{ + // the mgt_users right isn't test project related so this right is inherited from + // the global role (if set) + foreach ($propRights as $right => $desc) { + if (in_array($right, $fromRights) && ! in_array($right, $toRights)) { + $toRights[] = $right; + } + } +} + +/** + * TBD + * + * @param string $rights + * @param mixed $roleQuestion + * @param boolean $bAND + * [default = 1] + * @return mixed 'yes' or null + * + * @author Andreas Morsing + * @since 20.02.2006, 20:30:07 + * + */ +function checkForRights($rights, $roleQuestion, $bAND = 1) +{ + $ret = null; + // check to see if the $roleQuestion variable appears in the $roles variable + if (is_array($roleQuestion)) { + $r = array_intersect($roleQuestion, $rights); + if ($bAND) { + // for AND all rights must be present + if (count($r) == count($roleQuestion)) { + $ret = 'yes'; + } + } else { + // for OR one of all must be present + if (count($r)) { + $ret = 'yes'; + } + } + } else { + $ret = (in_array($roleQuestion, $rights) ? 'yes' : null); + } + return $ret; +} + +/** + * Get info about user(s) role at test project level, + * with indication about the nature of role: inherited or assigned. + * + * To get a user role we consider a 3 layer model: + * layer 1 - user <--- uplayer + * layer 2 - test project <--- in this fuction we are interested in this level. + * layer 3 - test plan + * + * args : $tproject_id + * [$user_id] + * + * @return array map with effetive_role in context ($tproject_id) + * key: user_id + * value: map with keys: + * login (from users table - useful for debug) + * user_role_id (from users table - useful for debug) + * uplayer_role_id (always = user_role_id) + * uplayer_is_inherited + * effective_role_id user role for test project + * is_inherited + */ +function get_tproject_effective_role(&$db, $tproject, $user_id = null, + $users = null) +{ + $effective_role = array(); + $tproject_id = $tproject['id']; + if (! is_null($user_id)) { + $users = tlUser::getByIDs($db, (array) $user_id); + } elseif (is_null($users)) { + $users = tlUser::getAll($db); + } + + if ($users) { + foreach ($users as $id => $user) { + // manage admin exception + $isInherited = 1; + $effectiveRoleID = $user->globalRoleID; + $effectiveRole = $user->globalRole; + if (($user->globalRoleID != TL_ROLES_ADMIN) && + ! $tproject['is_public']) { + $isInherited = $tproject['is_public']; + $effectiveRoleID = TL_ROLES_NO_RIGHTS; + $effectiveRole = ''; + } + + if (isset($user->tprojectRoles[$tproject_id])) { + $isInherited = 0; + $effectiveRoleID = $user->tprojectRoles[$tproject_id]->dbID; + $effectiveRole = $user->tprojectRoles[$tproject_id]; + } + + $effective_role[$id] = array( + 'login' => $user->login, + 'user' => $user, + 'user_role_id' => $user->globalRoleID, + 'uplayer_role_id' => $user->globalRoleID, + 'uplayer_is_inherited' => 0, + 'effective_role_id' => $effectiveRoleID, + 'effective_role' => $effectiveRole, + 'is_inherited' => $isInherited + ); + } + } + return $effective_role; +} + +/** + * Get info about user(s) role at test plan level, + * with indication about the nature of role: inherited or assigned. + * + * To get a user role we consider a 3 layer model: + * layer 1 - user <--- uplayer + * layer 2 - test project <--- in this fuction we are interested in this level. + * layer 3 - test plan + * + * args : $tplan_id + * $tproject_id + * [$user_id] + * + * @return array map with effetive_role in context ($tplan_id) + * key: user_id + * value: map with keys: + * login (from users table - useful for debug) + * user_role_id (from users table - useful for debug) + * uplayer_role_id user role for test project + * uplayer_is_inherited 1 -> uplayer role is inherited + * 0 -> uplayer role is written in table + * effective_role_id user role for test plan + * is_inherited + * + * @internal revisions + * 20101111 - franciscom - BUGID 4006: test plan is_public + */ +function get_tplan_effective_role(&$db, $tplan_id, $tproject, $user_id = null, + $users = null, $inheritanceMode = null) +{ + $tplan_mgr = new testplan($db); + $tplan = $tplan_mgr->get_by_id($tplan_id); + unset($tplan_mgr); + + $roleInhMode = ! is_null($inheritanceMode) ? $inheritanceMode : config_get( + 'testplan_role_inheritance_mode'); + + /** + * key: user_id + * value: map with keys: + * login (from users table - useful for debug) + * user_role_id (from users table - useful for debug) + * uplayer_role_id (always = user_role_id) + * uplayer_is_inherited + * effective_role_id user role for test project + * is_inherited + */ + $effective_role = get_tproject_effective_role($db, $tproject, $user_id, + $users); + + foreach ($effective_role as $user_id => $row) { + + $doNextStep = true; + + // Step 1 - If I've role specified for Test Plan, get and skip + if (isset($row['user']->tplanRoles[$tplan_id])) { + $isInherited = 0; + $doNextStep = false; + + $effective_role[$user_id]['effective_role_id'] = $row['user']->tplanRoles[$tplan_id]->dbID; + $effective_role[$user_id]['effective_role'] = $row['user']->tplanRoles[$tplan_id]; + } + + // For Private Test Plans specific role is NEEDED for users with + // global role !? ADMIN + if ($doNextStep && ($row['user']->globalRoleID != TL_ROLES_ADMIN) && + ! $tplan['is_public']) { + $isInherited = 0; + $doNextStep = false; + + $effective_role[$user_id]['effective_role_id'] = TL_ROLES_NO_RIGHTS; + $effective_role[$user_id]['effective_role'] = ''; + } + + if ($doNextStep) { + $isInherited = 1; + + switch ($roleInhMode) { + case 'testproject': + $effective_role[$user_id]['uplayer_role_id'] = $effective_role[$user_id]['effective_role_id']; + $effective_role[$user_id]['uplayer_is_inherited'] = $effective_role[$user_id]['is_inherited']; + break; + + case 'global': + $effective_role[$user_id]['effective_role_id'] = $row['user']->globalRoleID; + $effective_role[$user_id]['effective_role'] = $row['user']->globalRole; + break; + } + } + + $effective_role[$user_id]['is_inherited'] = $isInherited; + } + return $effective_role; +} + +function getRoleErrorMessage($code) +{ + $msg = 'ok'; + switch ($code) { + case tlRole::E_NAMEALREADYEXISTS: + $msg = lang_get('error_duplicate_rolename'); + break; + + case tlRole::E_NAMELENGTH: + $msg = lang_get('error_role_no_rolename'); + break; + + case tlRole::E_EMPTYROLE: + $msg = lang_get('error_role_no_rights'); + break; + + case tl::OK: + break; + + case tl::ERROR: + case tlRole::E_DBERROR: + default: + $msg = lang_get('error_role_not_updated'); + } + return $msg; +} + +function deleteRole(&$db, $roleID) +{ + $userFeedback = ''; + $role = new tlRole($roleID); + $role->readFromDb($db); + if ($role->deleteFromDB($db) < tl::OK) { + $userFeedback = lang_get("error_role_deletion"); + } else { + logAuditEvent(TLS("audit_role_deleted", $role->getDisplayName()), + "DELETE", $roleID, "roles"); + } + + return $userFeedback; } diff --git a/lib/functions/specview.php b/lib/functions/specview.php index a2ec8351e9..f01900d7a9 100644 --- a/lib/functions/specview.php +++ b/lib/functions/specview.php @@ -1,1791 +1,1851 @@ - 2732 - * [tc_id] => 2733 - * [z] => 100 ---> nodes_hierarchy.order - * [name] => TC1 - * [tcversion_id] => 2734 - * [feature_id] => 9 --->> testplan_tcversions.ID - * [execution_order] => 10 - * [version] => 1 - * [active] => 1 - * [external_id] => 1 - * [exec_id] => 1 - * [tcversion_number] => 1 - * [executed] => 2734 - * [exec_on_tplan] => 2735 - * [user_id] => - * [type] => - * [status] => - * [assigner_id] => - * [urgency] => 2 IMPORTANT: exists ONLY FOR LINKED TEST CASES - * [exec_status] => b - * [priority] => 4 // urgency*importance IMPORTANT: exists ONLY FOR LINKED TEST CASES - * - * @param array $map_node_tccount - * @TODO probably this argument ($map_node_tccount) is not needed, but it will depend - * of how this feature (gen_spec_view) will be used on other TL areas. - * - * @param map $filters keys - * [keyword_id] default 0 - * [tcase_id] default null, can be an array - * - * @param map $options keys - * [write_button_only_if_linked] default 0 - * [prune_unlinked_tcversions]: default 0. - * Useful when working on spec_view_type='testplan'. - * 1 -> will return only linked tcversion - * 0 -> returns all test cases specs. - * [add_custom_fields]: default=0 - * useful when working on spec_view_type='testproject' - * when doing test case assign to test plans. - * 1 -> for every test case cfields of area 'testplan_design' - * will be fetched and displayed. - * 0 -> do nothing - * - * [$tproject_id]: default = null - * useful to improve performance in custom field method calls - * when add_custom_fields=1. - * - * - * @return array every element is an associative array with the following - * structure: (to get last updated info add debug code and print_r returned value) - * [testsuite] => Array( [id] => 28 - * [name] => TS1 ) - * [testcases] => Array( [2736] => Array - * ( - * [id] => 2736 - * [name] => TC2 - * [tcversions] => Array - * ( - * [2738] => 2 // key=tcversion id,value=version - * [2737] => 1 - * ) - * [tcversions_active_status] => Array - * ( - * [2738] => 1 // key=tcversion id,value=active status - * [2737] => 1 - * ) - * [tcversions_execution_type] => Array - * ( - * [2738] => 1 - * [2737] => 2 - * ) - * [tcversions_qty] => 2 - * [linked_version_id] => 2737 - * [executed] => no - * [user_id] => 0 ---> !=0 if execution has been assigned - * [feature_id] => 12 ---> testplan_tcversions.id - * [execution_order] => 20 - * [external_id] => 2 - * [linked_ts] => 2009-06-10 23:00 - * [linked_by] => 2 - * [priority] => HIGH, MEDIUM or LOW - * ) - * [81] => Array( [id] => 81 - * [name] => TC88) - * ... - * ) - * [level] = - * [write_buttons] => yes or no - * level and write_buttons are used to generate the user interface - * - * Warning: - * if the root element of the spec_view, has 0 test => then the default - * structure is returned ( $result = array('spec_view'=>array(), 'num_tc' => 0)) - * - * - */ - -function gen_spec_view(&$db, $specViewType, $tobj_id, $id, $name, &$linked_items, - $map_node_tccount, $filters=null, $options = null, $tproject_id = null) -{ - - $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; - $out = array(); - $result = array('spec_view'=>array(), 'num_tc' => 0, 'has_linked_items' => 0); - - $my = array(); - $my['options'] = array('write_button_only_if_linked' => 0, - 'prune_unlinked_tcversions' => 0, - 'add_custom_fields' => 0) + (array)$options; - - $my['filters'] = array('keywords' => 0, 'testcases' => null , - 'exec_type' => null, - 'importance' => null, 'cfields' => null, - 'platforms' => null); - - foreach( $my as $key => $settings) { - if( !is_null($$key) && is_array($$key) ) { - $my[$key] = array_merge($my[$key],$$key); - } - } - - $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; - $is_tplan_view_type=$spec_view_type == 'testplan' ? 1 : 0; - $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; - - if (!$is_tplan_view_type && is_null($tproject_id)) { - $tproject_id = $tobj_id; - } - - $testplan_id = $is_tplan_view_type ? $tobj_id : null; - - $tcase_mgr = new testcase($db); - $hash_descr_id = $tcase_mgr->tree_manager->get_available_node_types(); - $hash_id_descr = array_flip($hash_descr_id); - - $key2map = array('keyword_id' => 'keywords', 'tcase_id' => 'testcases', - 'execution_type' => 'exec_type', - 'importance' => 'importance', - 'cfields' => 'cfields', - 'tcase_name' => 'tcase_name', - 'status' => 'workflow_status', - 'platform_id' => 'platforms'); - - $pfFilters = array('tcase_node_type_id' => $hash_descr_id['testcase']); - foreach($key2map as $tk => $fk) { - $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; - } - - // transform in array to be gentle with getTestSpecFromNode() - $t2a = array('importance','status'); - foreach($t2a as $tortuga) { - if(!is_null($pfFilters[$tortuga])) { - $pfFilters[$tortuga] = (array)$pfFilters[$tortuga]; - } - } - - $test_spec = getTestSpecFromNode($db,$tcase_mgr,$linked_items,$tobj_id,$id,$spec_view_type,$pfFilters); - - $platforms = getPlatforms($db,$tproject_id,$testplan_id); - $idx = 0; - $a_tcid = array(); - $a_tsuite_idx = array(); - if (count($test_spec)) { - $cfg = array('node_types' => $hash_id_descr, - 'write_status' => $write_status, - 'is_uncovered_view_type' => $is_uncovered_view_type); - - // $a_tsuite_idx - // key: test case version id - // value: index inside $out, where parent test suite of test case version id is located. - // - list($a_tcid,$a_tsuite_idx,$tsuite_tcqty,$out) = buildSkeleton($id,$name,$cfg,$test_spec,$platforms); - } - - // This code has been replace (see below on Remove empty branches) - // Once we have created array with testsuite and children testsuites - // we are trying to remove nodes that has 0 test case count. - // May be this can be done (as noted by schlundus during performance - // analisys done on october 2008) in a better way, or better can be absolutely avoided. - // - // This process is needed to prune whole branches that are empty - // Need to look for every call in TL and understand if this can be removed - // - if (!is_null($map_node_tccount)) { - foreach($out as $key => $elem) { - if (isset($map_node_tccount[$elem['testsuite']['id']]) - && $map_node_tccount[$elem['testsuite']['id']]['testcount'] == 0) { - // why not unset ? - $out[$key]=null; - } - } - } - - // Collect information related to linked testcase versions - if(!is_null($out) && count($out) > 0 && !is_null($out[0]) && count($a_tcid)) - { - $optGBI = array('output' => 'full_without_users', - 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC "); - - $tcaseVersionSet = $tcase_mgr->get_by_id($a_tcid,testcase::ALL_VERSIONS,null,$optGBI); - $result = addLinkedVersionsInfo($tcaseVersionSet,$a_tsuite_idx,$out,$linked_items,$options); - } - - // Try to prune empty test suites, to reduce memory usage and - // to remove elements - // that do not need to be displayed on user interface. - if (count($result['spec_view']) > 0) { - removeEmptyTestSuites($result['spec_view'],$tcase_mgr->tree_manager, - ($my['options']['prune_unlinked_tcversions'] && $is_tplan_view_type),$hash_descr_id); - } - - // Remove empty branches - // Loop to compute test case qty ($tsuite_tcqty) on every level and prune test suite branchs that are empty - if (count($result['spec_view']) > 0) { - removeEmptyBranches($result['spec_view'],$tsuite_tcqty); - } - - /** @TODO: maybe we can integrate this into already present loops above? */ - // This is not right condition for identifing an empty test suite for the porpouse - // of gen_spec_view(), because for following structure - // TS1 - // \--- TS2 - // \--TC1 - // \--TC2 - // - // \--- TS3 - // \-- TXX - // - // When we are displaying a Test Specification we want to see previous structure - // But if we apply this criteria for empty test suite, TS1 results empty and will - // be removed -> WRONG - // - // Need to understand when this feature will be needed and then reimplement - // - // if ($prune_empty_tsuites) - // { - // foreach($result['spec_view'] as $key => $value) - // { - // if(is_null($value) || !isset($value['testcases']) || !count($value['testcases'])) - // unset($result['spec_view'][$key]); - // } - // } - - // #1650 We want to manage custom fields when user is doing test case execution assigment - if( count($result['spec_view']) > 0 && $my['options']['add_custom_fields']) - { - addCustomFieldsToView($result['spec_view'],$tproject_id,$tcase_mgr); - } - // ------------------------------------------------------------------------ - unset($tcase_mgr); - - // with array_values() we reindex array to avoid "holes" - $result['spec_view']= array_values($result['spec_view']); - return $result; -} - -/** -* -*/ -function gen_coverage_view(&$db, $specViewType, $tobj_id, $id, $name, &$linked_items, -$map_node_tccount, $filters=null, $options = null, $tproject_id = null) -{ - $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; - - $out = array(); - $result = array('spec_view'=>array(), 'num_tc' => 0, 'has_linked_items' => 0); - - $my = array(); - $my['options'] = array('write_button_only_if_linked' => 0,'prune_unlinked_tcversions' => 0, - 'add_custom_fields' => 0) + (array)$options; - - $my['filters'] = array('keywords' => 0, 'testcases' => null ,'exec_type' => null, - 'importance' => null, 'cfields' => null); - foreach( $my as $key => $settings) - { - if( !is_null($$key) && is_array($$key) ) - { - $my[$key] = array_merge($my[$key],$$key); - } - } - - $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; - $is_tplan_view_type=$spec_view_type == 'testplan' ? 1 : 0; - $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; - - if( !$is_tplan_view_type && is_null($tproject_id) ) - { - $tproject_id = $tobj_id; - } - - $testplan_id = $is_tplan_view_type ? $tobj_id : null; - - - $tcase_mgr = new testcase($db); - $hash_descr_id = $tcase_mgr->tree_manager->get_available_node_types(); - $hash_id_descr = array_flip($hash_descr_id); - - $key2map = array('keyword_id' => 'keywords', 'tcase_id' => 'testcases', - 'execution_type' => 'exec_type', 'importance' => 'importance', - 'cfields' => 'cfields','tcase_name' => 'tcase_name' ); - - $pfFilters = array('tcase_node_type_id' => $hash_descr_id['testcase']); - foreach($key2map as $tk => $fk) - { - $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; - } - - $test_spec = getTestSpecFromNode($db,$tcase_mgr,$linked_items,$tobj_id,$id,$spec_view_type,$pfFilters,'req_order'); - - $platforms = getPlatforms($db,$tproject_id,$testplan_id); - $idx = 0; - $a_tcid = array(); - $a_tsuite_idx = array(); - if (count($test_spec)) { - $cfg = array('node_types' => $hash_id_descr, - 'write_status' => $write_status, - 'is_uncovered_view_type' => $is_uncovered_view_type); - - // $a_tsuite_idx - // key: test case version id - // value: index inside $out, where parent test suite of test case version id is located. - // - list($a_tcid,$a_tsuite_idx,$tsuite_tcqty,$out) = buildSkeleton($id,$name,$cfg,$test_spec,$platforms); - } - - // This code has been replace (see below on Remove empty branches) - // Once we have created array with testsuite and children testsuites - // we are trying to remove nodes that has 0 test case count. - // May be this can be done (as noted by schlundus during performance - // analisys done on october 2008) in a better way, or better can be absolutely avoided. - // - // This process is needed to prune whole branches that are empty - // Need to look for every call in TL and understand if this can be removed - // - if(!is_null($map_node_tccount)) - { - foreach($out as $key => $elem) - { - if(isset($map_node_tccount[$elem['testsuite']['id']]) && - $map_node_tccount[$elem['testsuite']['id']]['testcount'] == 0) - { - $out[$key]=null; - } - } - } - - // Collect information related to linked testcase versions - if(!is_null($out) && count($out) > 0 && !is_null($out[0]) && count($a_tcid)) - { - $optGBI = array('output' => 'full_without_users', - 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC "); - - $tcaseVersionSet = $tcase_mgr->get_by_id($a_tcid,testcase::ALL_VERSIONS,null,$optGBI); - $result = addLinkedVersionsInfo($tcaseVersionSet,$a_tsuite_idx,$out,$linked_items); - - } - - // Try to prune empty test suites, to reduce memory usage and to remove elements - // that do not need to be displayed on user interface. - if( count($result['spec_view']) > 0) - { - //removeEmptyTestSuites($result['spec_view'],$tcase_mgr->tree_manager, - //($my['options']['prune_unlinked_tcversions'] && $is_tplan_view_type),$hash_descr_id); - } - - // Remove empty branches - // Loop to compute test case qty ($tsuite_tcqty) on every level and prune test suite branchs that are empty - if( count($result['spec_view']) > 0) - { - //removeEmptyBranches($result['spec_view'],$tsuite_tcqty); -} - - - - /** @TODO: maybe we can integrate this into already present loops above? */ - // This is not right condition for identifing an empty test suite for the porpouse - // of gen_spec_view(), because for following structure - // TS1 - // \--- TS2 - // \--TC1 - // \--TC2 - // - // \--- TS3 - // \-- TXX - // - // When we are displaying a Test Specification we want to see previous structure - // But if we apply this criteria for empty test suite, TS1 results empty and will - // be removed -> WRONG - // - // Need to understand when this feature will be needed and then reimplement - // - // if ($prune_empty_tsuites) - // { - // foreach($result['spec_view'] as $key => $value) - // { - // if(is_null($value) || !isset($value['testcases']) || !count($value['testcases'])) - // unset($result['spec_view'][$key]); - // } - // } - - // #1650 We want to manage custom fields when user is doing test case execution assigment - if( count($result['spec_view']) > 0 && $my['options']['add_custom_fields']) - { - addCustomFieldsToView($result['spec_view'],$tproject_id,$tcase_mgr); -} -// -------------------------------------------------------------------------------------------- -unset($tcase_mgr); - - // with array_values() we reindex array to avoid "holes" -$result['spec_view']= array_values($result['spec_view']); -return $result; -} - -/** - * get linked versions filtered by Keyword ID - * Filter is done ONLY on attributes THAT ARE COMMON to ALL test case versions, - * because (till now) while adding/removing test cases user works on Test Spec Tree - * and filter applied to this tree acts on: - * - * 1. attributes COMMON to all versions - * 2. attributes present ON LAST ACTIVE version. - * - * But do no make considerations regarding versions linked to test plan - * DEV NOTE: may be this has to be changed in future ? - * - * @param ref $dbHandler: - * @param ref $argsObj: stdClass object with information about filters - * @param ref $tplanMgr: test plan manager object - * @param ref $tcaseMgr: test case manager object - * @param map $options: default null (at today 20110820 seems not be used). - * @param boolean $isTestSuite: filter testGroupBy, default true - * - */ -function getFilteredLinkedVersions(&$dbHandler,&$argsObj, &$tplanMgr, - &$tcaseMgr, - $options = null, $isTestSuite=true) -{ - static $tsuite_mgr; - $doFilterByKeyword = (!is_null($argsObj->keyword_id) - && $argsObj->keyword_id > 0) ? true : false; - - // Multiple step algoritm to apply keyword filter on type=AND - // get_*_tcversions filters by keyword ALWAYS in OR mode. - // - $filters = array('keyword_id' => $argsObj->keyword_id, - 'platform_id' => null); - if( property_exists($argsObj,'control_panel') && - isset($argsObj->control_panel['setting_platform']) && - intval($argsObj->control_panel['setting_platform']) > 0 ) { - $filters['platform_id'] = intval($argsObj->control_panel['setting_platform']); - } - - if( isset($options['assigned_on_build']) - && $options['assigned_on_build'] > 0) { - $filters['assigned_on_build'] = $options['assigned_on_build']; - } - - // get test suites in branch to limit search - if($isTestSuite) { - $itemID = property_exists($argsObj,'object_id') ? $argsObj->object_id : $argsObj->id; - if( !is_null($itemID) ) { - // will get all test suites in this branch, in order to limit amount of data returned by - // get_*_tcversions - if (!$tsuite_mgr) { - $tsuite_mgr = new testsuite($dbHandler); - } - $xx = $tsuite_mgr->get_branch($itemID); - $xx .= ($xx == '') ? $itemID : ',' . $itemID; - $filters['tsuites_id'] = explode(',',$xx); - } - } - - // $opx = array('addExecInfo' => true, 'specViewFields' => true) + (array)$options; - $opx = array_merge( array('addExecInfo' => true, 'specViewFields' => true, - 'tlFeature' => 'none'), - (array)$options ); - - switch ($opx['tlFeature']) { - case 'testCaseExecTaskAssignment': - $method2call = 'getLinkedTCVXmen'; - break; - - case 'testCaseTestPlanAssignment': - default: - $method2call = 'getLTCVNewGeneration'; - break; - } - - if (isset($argsObj->testcases_to_show) - && !is_null($argsObj->testcases_to_show)) { - $filters['tcase_id'] = $argsObj->testcases_to_show; - } - - if (isset($argsObj->platform_id) - && $argsObj->platform_id > 0) { - $filters['platform_id'] = $argsObj->platform_id; - } - - $tplan_tcases = $tplanMgr->$method2call($argsObj->tplan_id, $filters, $opx); - - if( !is_null($tplan_tcases) && $doFilterByKeyword && $argsObj->keywordsFilterType == 'AND') - { - $filteredSet = $tcaseMgr->filterByKeyword(array_keys($tplan_tcases), - $argsObj->keyword_id,$argsObj->keywordsFilterType); - - $filters = array('tcase_id' => array_keys($filteredSet)); - - // HERE WE CAN HAVE AN ISSUE - $tplan_tcases = $tplanMgr->getLTCVNewGeneration($argsObj->tplan_id, $filters, $opx); - } - return $tplan_tcases; -} - - -/** - * - * @param obj $dbHandler - * @param obj $argsObj: user input - * @param obj $argsObj: user input - * @param obj $tplanMgr: test plan manager - * @param obj $tcaseMgr: test case manager - * @param map $filters: keys keywordsFilter, testcaseFilter,assignedToFilter, - * executionTypeFilter, cfieldsFilter - * - * IMPORTANT NOTICE: not all filters are here, - * other arrive via argsObj - * @param map $options: keys ?? - * USED TO PASS options to other method called here - * -> see these method docs. - * - */ -function getFilteredSpecView(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, $filters=null, $options=null) -{ - $tprojectMgr = new testproject($dbHandler); - $tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->id); - - $my = array(); // some sort of local scope - $my['filters'] = array('keywordsFilter' => null, 'testcaseFilter' => null, - 'assignedToFilter' => null,'executionTypeFilter' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $my['options'] = array('write_button_only_if_linked' => 1, 'prune_unlinked_tcversions' => 1); - $my['options'] = array_merge($my['options'],(array)$options); - - // This does filter on keywords ALWAYS in OR mode. - $tplan_linked_tcversions = - getFilteredLinkedVersions($dbHandler,$argsObj, $tplanMgr, $tcaseMgr, $options); - - // With these pieces we implement the AND type of keyword filter. - $testCaseSet = null; - $tryNextFilter = true; - $filterApplied = false; - if(!is_null($my['filters']['keywordsFilter']) && !is_null($my['filters']['keywordsFilter']->items)) { - - /* - $keywordsTestCases = $tprojectMgr->get_keywords_tcases($argsObj->tproject_id, - $my['filters']['keywordsFilter']->items, - $my['filters']['keywordsFilter']->type); - - */ - $keywordsTestCases = $tprojectMgr->getKeywordsLatestTCV($argsObj->tproject_id, - $my['filters']['keywordsFilter']->items, - $my['filters']['keywordsFilter']->type); - - $testCaseSet = array_keys((array)$keywordsTestCases); - $tryNextFilter = !is_null($testCaseSet); - $filterApplied = true; - } - - if( $tryNextFilter && !is_null($my['filters']['testcaseFilter'])) - { - $filterApplied = true; - if (is_null($testCaseSet)) { - $testCaseSet = $my['filters']['testcaseFilter']; - } else { - // wrong use of array() instead of (array) - $testCaseSet = array_intersect($testCaseSet, (array)$my['filters']['testcaseFilter']); - } - } - - // when $testCaseSet is null because we have - // applied filters => we do not need to call other - // method because we know we are going to get NOTHING - $testCaseSet = !is_null($testCaseSet) ? - array_combine($testCaseSet, $testCaseSet) : null; - if ($filterApplied && is_null($testCaseSet)) { - return null; - } - - $genSpecFilters = array('keywords' => $argsObj->keyword_id, - 'testcases' => $testCaseSet, - 'exec_type' => $my['filters']['executionTypeFilter'], - 'cfields' => null); - - - if( isset($my['filters']['cfieldsFilter']) ) { - $genSpecFilters['cfields'] = $my['filters']['cfieldsFilter']; - } - - $out = gen_spec_view($dbHandler, 'testplan', - $argsObj->tplan_id, $argsObj->id, $tsuite_data['name'], - $tplan_linked_tcversions, null, $genSpecFilters, $my['options']); - return $out; -} - - -/** - * get Test Specification data within a Node - * - * using nodeId (that normally is a test suite id) as starting point - * will return subtree that start at nodeId. - * If filters are given, the subtree returned is filtered. - * - * Important Notice regaring keyword filtering - * Keyword filter logic inside this function seems to work ONLY on OR mode. - * Then how the AND mode is implemented ? - * Filter for test case id is used, and the test case set has been generated - * applying AND or OR logic (following user's choice). - * Then seems that logic regarding keywords here, may be can be removed - * - * @param integer $masterContainerId can be a Test Project Id, or a Test Plan id. - * is used only if keyword id filter has been specified - * to get all keyword defined on masterContainer. - * - * @param integer $nodeId node that will be root of the view we want to build. - * - * @param string $specViewType: type of view requested - * - * @param array $filters - * filters['keyword_id']: array of keywords - * filters['tcase_id']: - * filters['execution_type']: - * filters['importance']: - * filters['cfields']: - * filters['tcase_name']: - * - * @param string $type: request selected for create tree - * - * @return array map with view (test cases subtree) - * - * - */ -function getTestSpecFromNode(&$dbHandler,&$tcaseMgr,&$linkedItems,$masterContainerId,$nodeId,$specViewType,$filters, $type='spec_order') -{ - $applyFilters = false; - $testCaseSet = null; - $tck_map = null; - $tobj_mgr = new testproject($dbHandler); - - $opt = array('order_cfg' => array("type" =>$type)); - if($specViewType =='testplan') { - $opt['order_cfg']=array("type" =>'exec_order', 'tplan_id' => $masterContainerId); - } - $test_spec = $tobj_mgr->get_subtree($nodeId,null,$opt); - - $key2loop = null; - $useAllowed = false; - - $nullCheckFilter = array('tcase_id' => false, - 'importance' => false, - 'tcase_name' => false, - 'cfields' => false, 'status' => false); - - $zeroNullCheckFilter = array('execution_type' => false); - $useFilter = array('keyword_id' => false, 'platform_id' => false) - + $nullCheckFilter + $zeroNullCheckFilter; - - $applyFilters = false; - - foreach($nullCheckFilter as $key => $value) { - $useFilter[$key] = !is_null($filters[$key]); - $applyFilters = $applyFilters || $useFilter[$key]; - } - - // more specif analisys - if( ($useFilter['status']=($filters['status'][0] > 0)) ) { - $applyFilters = true; - $filtersByValue['status'] = array_flip((array)$filters['status']); - } - - if( ($useFilter['importance']=($filters['importance'][0] > 0)) ) { - $applyFilters = true; - $filtersByValue['importance'] = array_flip((array)$filters['importance']); - } - - - foreach($zeroNullCheckFilter as $key => $value) { - // need to check for > 0, because for some items 0 has same meaning that null -> no filter - $useFilter[$key] = (!is_null($filters[$key]) && ($filters[$key] > 0)); - $applyFilters = $applyFilters || $useFilter[$key]; - } - - if( $useFilter['tcase_id'] ) { - $testCaseSet = is_array($filters['tcase_id']) ? $filters['tcase_id'] : array($filters['tcase_id']); - } - - if(!is_array($filters['keyword_id']) ) { - $filters['keyword_id'] = array($filters['keyword_id']); - } - - if(($useFilter['keyword_id']=$filters['keyword_id'][0] > 0)) { - $applyFilters = true; - switch ($specViewType) { - case 'testplan': - $tobj_mgr = new testplan($dbHandler); - $tck_map = $tobj_mgr->getKeywordsLinkedTCVersions($masterContainerId, - $filters['keyword_id']); - break; - - default: - $tck_map = $tobj_mgr->getKeywordsLatestTCV($masterContainerId, - $filters['keyword_id']); - break; - } - } - - $tcpl_map = null; - if(($useFilter['platforms']=$filters['platform_id'][0] > 0)) { - $applyFilters = true; - switch ($specViewType) { - case 'testplan': - $tobj_mgr = new testplan($dbHandler); - $tcpl_map = $tobj_mgr->getPlatformsLinkedTCVersions($masterContainerId, - $filters['platforms']); - break; - - default: - $tcpl_map = $tobj_mgr->getPlatformsLatestTCV($masterContainerId, - $filters['platforms']); - break; - } - } - - - - if( $applyFilters ) { - $key2loop = array_keys($test_spec); - - // first step: generate list of TEST CASE NODES - $itemSet = null ; - foreach($key2loop as $key) { - if( ($test_spec[$key]['node_type_id'] == $filters['tcase_node_type_id']) ) { - $itemSet[$test_spec[$key]['id']] = $key; - } - } - $itemKeys = $itemSet; - - foreach($itemKeys as $key => $tspecKey) { - // case insensitive search - if( ($useFilter['keyword_id'] - && !isset($tck_map[$test_spec[$tspecKey]['id']]) ) - - || ($useFilter['platforms'] - && !isset($tcpl_map[$test_spec[$tspecKey]['id']]) ) - - || ($useFilter['tcase_id'] - && !in_array($test_spec[$tspecKey]['id'],$testCaseSet)) - || ($useFilter['tcase_name'] - && (stripos($test_spec[$tspecKey]['name'],$filters['tcase_name']) === false)) - ) { - $test_spec[$tspecKey]=null; - unset($itemSet[$key]); - } - } - - if( count($itemSet) > 0 && - ($useFilter['execution_type'] || $useFilter['importance'] || $useFilter['cfields'] || - $useFilter['status']) - ) { - // This logic can have some Potential Performance ISSUE - 20120619 - fman - $targetSet = array_keys($itemSet); - $options = ($specViewType == 'testPlanLinking') ? array( 'access_key' => 'testcase_id') : null; - - $getFilters = $useFilter['cfields'] ? array('cfields' => $filters['cfields']) : null; - $s2h = config_get('tplanDesign')->hideTestCaseWithStatusIn; - if( !is_null($s2h) ) { - $getFilters['status'] = array('not_in' => array_keys($s2h)); - } - - $tcversionSet = $tcaseMgr->get_last_active_version($targetSet,$getFilters,$options); - - switch($specViewType) { - case 'testPlanLinking': - // We need to analise linked items and spec - foreach($targetSet as $idx => $key) { - $targetTestCase = isset($tcversionSet[$key]) ? $tcversionSet[$key]['testcase_id'] : null; - - if( is_null($targetTestCase) ) { - $test_spec[$itemSet[$key]]=null; - $item = null; - } else { - if( isset($linkedItems[$targetTestCase]) ) { - $item = current($linkedItems[$targetTestCase]); - } else { - // hmmm, does not understand this logic. - $item = null; - if( isset($test_spec[$itemSet[$targetTestCase]]) ) { - $item = $tcversionSet[$targetTestCase]; - } - } - } - - if( !is_null($item) ) { - if( $useFilter['execution_type'] && - ($item['execution_type'] != $filters['execution_type']) || - $useFilter['importance'] && - (!isset($filtersByValue['importance'][$item['importance']])) || - $useFilter['status'] && - (!isset($filtersByValue['status'][$item['status']])) - ) { - $tspecKey = $itemSet[$targetTestCase]; - $test_spec[$tspecKey]=null; - } - } - } - break; - - default: - $tcvidSet = array_keys($tcversionSet); - foreach($tcvidSet as $zx) { - $tcidSet[$tcversionSet[$zx]['testcase_id']] = $zx; - } - - $options = null; - $doFilter = true; - $allowedSet = null; - $emptySet = false; - - // a first clean will not be bad, ok may be we are going to do more - // loops that needed, but think logic will be more clear - // (at least @20130426 is a little bit confusing ;) ) - foreach($targetSet as $idx => $key) { - if( !isset($tcidSet[$key]) ) { - $test_spec[$itemSet[$key]]=null; - } - } - - if ($useFilter['execution_type']) { - // Potential Performance ISSUE - $allowedSet = $tcaseMgr->filter_tcversions_by_exec_type($tcvidSet,$filters['execution_type'],$options); - - $doFilter = (!is_null($allowedSet) && count($allowedSet) > 0); - $emptySet = !$doFilter; - } - - if ((false == $emptySet) && $doFilter) { - // Add another filter on cascade mode - // @20130426 - seems we are applying TWICE the Custom Fields Filter - // because we have applied it before on: - // $tcversionSet = $tcaseMgr->get_last_active_version() - if( $useFilter['cfields'] ) { - $filteredSet = (!is_null($allowedSet) && count($allowedSet) > 0) ? array_keys($allowedSet) : $tcvidSet; - $dummySet = $tcaseMgr->filter_tcversions_by_cfields($filteredSet,$filters['cfields'],$options); - - // transform to make compatible with filter_tcversions_by_exec_type() return type - if( !is_null($dummySet) && count($dummySet) > 0 ) { - $allowedSet = null; - $work2do = array_keys($dummySet); - foreach($work2do as $wkey) { - $allowedSet[$wkey] = $dummySet[$wkey][0]; - } - unset($dummySet); - } - } - $doFilter = (!is_null($allowedSet) && count($allowedSet) > 0); - $emptySet = !$doFilter; - } - - if( $doFilter && !is_null($allowedSet) && count($allowedSet) > 0 ) { - $useAllowed = true; - foreach($allowedSet as $key => $value) { - $tspecKey = $itemSet[$value['testcase_id']]; - $test_spec[$tspecKey]['version']=$value['version']; - } - reset($allowedSet); - } - - if ($emptySet) { - $test_spec = null; - } - - $setToRemove = array_diff_key($tcversionSet,$allowedSet); - if( !is_null($setToRemove) && count($setToRemove) > 0 ) { - foreach($setToRemove as $key => $value) { - $tspecKey = $itemSet[$value['testcase_id']]; - $test_spec[$tspecKey]=null; - } - } - break; - } // end switch - } - } // if apply filters - return $test_spec; -} - - -/** - * remove empty Test Suites - * - * @param array $testSuiteSet reference to set to analyse and clean. - * @param object $treeMgr reference to object - * @param TBD $pruneUnlinkedTcversions useful when working on test plans - * @param TBD $nodeTypes hash key: node type description, value: code - */ -function removeEmptyTestSuites(&$testSuiteSet,&$treeMgr,$pruneUnlinkedTcversions,$nodeTypes) -{ - foreach($testSuiteSet as $key => $value) - { - // We will remove test suites that meet the empty conditions: - // - do not contain other test suites OR - // - do not contain test cases - if( is_null($value) ) - { - unset($testSuiteSet[$key]); - } - - else if ($pruneUnlinkedTcversions && - (isset($value['testcase_qty']) && $value['testcase_qty'] > 0) ) - { - // only linked tcversion must be returned, but this analisys must be done - // for test suites that has test cases. - if( isset($value['linked_testcase_qty']) && $value['linked_testcase_qty']== 0) - { - unset($testSuiteSet[$key]); - } - else - { - // Only if test suite has children test cases we need to understand - // if they are linked or not - if( isset($value['testcases']) && count($value['testcases']) > 0 ) - { - foreach($value['testcases'] as $skey => $svalue) - { - if( $svalue['linked_version_id'] == 0) - { - unset($testSuiteSet[$key]['testcases'][$skey]); - } - } - } - } // is_null($value) - } - - else - { - // list of children test suites if useful on smarty template, in order - // to draw nested div. - $tsuite_id=$value['testsuite']['id']; - $testSuiteSet[$key]['children_testsuites']= - $treeMgr->get_subtree_list($tsuite_id,$nodeTypes['testsuite']); - - if( $value['testcase_qty'] == 0 && $testSuiteSet[$key]['children_testsuites']=='' ) - { - unset($testSuiteSet[$key]); - } - } - } - -} - - -/** - * - * - */ -function removeEmptyBranches(&$testSuiteSet,&$tsuiteTestCaseQty) -{ - foreach($testSuiteSet as $key => $elem) - { - $tsuite_id=$elem['testsuite']['id']; - - if( !isset($tsuiteTestCaseQty[$tsuite_id]) ) - { - $tsuiteTestCaseQty[$tsuite_id]=0; - } - - if( isset($elem['children_testsuites']) && $elem['children_testsuites'] != '' ) - { - $children=explode(',',$elem['children_testsuites']); - foreach($children as $access_id) - { - if( isset($tsuiteTestCaseQty[$access_id]) ) - { - $tsuiteTestCaseQty[$tsuite_id] += $tsuiteTestCaseQty[$access_id]; - } - } - } - - if( $tsuiteTestCaseQty[$tsuite_id]== 0 ) - { - unset($testSuiteSet[$key]); - } - } -} // function end - - -/** - * @param array &$testSuiteSet: changes will be done to this array - * to add custom fields info. - * Custom field info will be indexed by platform id - * - * @param integer $tprojectId - * @param object &$tcaseMgr reference to testCase class instance - * - * - * @internal revisions - * 20100119 - franciscom - start fixing missing platform refactoring - * - */ -function addCustomFieldsToView(&$testSuiteSet,$tprojectId,&$tcaseMgr) -{ - // Important: - // testplan_tcversions.id value, that is used to link to manage custom fields that are used - // during testplan_design is present on key 'feature_id' (only is linked_version_id != 0) - foreach($testSuiteSet as $key => $value) - { - if( !is_null($value) ) - { - if( isset($value['testcases']) && count($value['testcases']) > 0 ) - { - foreach($value['testcases'] as $skey => $svalue) - { - if( ($linked_version_id=$svalue['linked_version_id']) > 0 ) - { - $platformSet = array_keys($svalue['feature_id']); - foreach($platformSet as $platform_id) - { - $testSuiteSet[$key]['testcases'][$skey]['custom_fields'][$platform_id]=''; - if( $linked_version_id != 0 ) - { - $cf_name_suffix = "_" . $svalue['feature_id'][$platform_id]; - $cf_map = $tcaseMgr->html_table_of_custom_field_inputs($linked_version_id,null,'testplan_design', - $cf_name_suffix,$svalue['feature_id'][$platform_id], - null,$tprojectId); - $testSuiteSet[$key]['testcases'][$skey]['custom_fields'][$platform_id] = $cf_map; - } - } - } - } - } - - } // is_null($value) - } -} // function end - - -/** - * - * Developer Notice - * key 'user_id' is JUST initialized - */ -function buildSkeleton($id,$name,$config,&$test_spec,&$platforms) -{ - $parent_idx=-1; - $pivot_tsuite = $test_spec[0]; - $level = array(); - $tcase_memory = null; - - $node_types = $config['node_types']; - $write_status = $config['write_status']; - $is_uncovered_view_type = $config['is_uncovered_view_type']; - - $out=array(); - $idx = 0; - $a_tcid = array(); - $a_tsuite_idx = array(); - $hash_id_pos[$id] = $idx; - $out[$idx]['testsuite'] = array('id' => $id, 'name' => $name); - $out[$idx]['testcases'] = array(); - $out[$idx]['write_buttons'] = 'no'; - $out[$idx]['testcase_qty'] = 0; - $out[$idx]['level'] = 1; - $out[$idx]['linked_testcase_qty'] = 0; - $out[$idx]['linked_ts'] = null; - $out[$idx]['linked_by'] = 0; - $out[$idx]['priority'] = 0; - - $the_level = $out[0]['level']+1; - $idx++; - $tsuite_tcqty=array($id => 0); - - foreach ($test_spec as $current) - { - if(is_null($current)) - { - continue; - } - // In some situations during processing of testcase, a change of parent can - // exists, then we need to update $tsuite_tcqty - if($node_types[$current['node_type_id']] == "testcase") - { - $tc_id = $current['id']; - $parent_idx = $hash_id_pos[$current['parent_id']]; - $a_tsuite_idx[$tc_id] = $parent_idx; - $out[$parent_idx]['testcases'][$tc_id] = array('id' => $tc_id,'name' => $current['name']); - - // Reference to make code reading more human friendly - $outRef = &$out[$parent_idx]['testcases'][$tc_id]; - - if($is_uncovered_view_type) - { - // @TODO understand impacts of platforms - $outRef['external_id'] = $test_spec[$tc_id]['external_id']; - } - else - { - $out[$parent_idx]['write_buttons'] = $write_status; - $out[$parent_idx]['linked_testcase_qty'] = 0; - - $outRef['tcversions'] = array(); - $outRef['tcversions_active_status'] = array(); - $outRef['tcversions_execution_type'] = array(); - $outRef['tcversions_qty'] = 0; - $outRef['linked_version_id'] = 0; - $outRef['executed'] = null; // 'no'; - - // useful for tc_exec_assignment.php - $outRef['platforms'] = $platforms; - $outRef['feature_id'] = null; //0; - $outRef['linked_by'] = null; //0; - $outRef['linked_ts'] = null; - $outRef['priority'] = 0; - $outRef['user_id'] = array(); - } - $out[$parent_idx]['testcase_qty']++; - $a_tcid[] = $current['id']; - - // This piece is needed initialize in right way $tsuite_tcqty - // in this kind of situation, for SubSuite2 - // - // Tsuite 1 - // |__ SubSuite1 - // | |__TCX1 - // | |__TCX2 - // | - // |__ SubSuite2 - // | |__TCY1 - // | |__TCY2 - // | - // |__ TCZ1 - // - // - if( $tcase_memory['parent_id'] != $current['parent_id'] ) - { - if( !is_null($tcase_memory) ) - { - $pidx = $hash_id_pos[$tcase_memory['parent_id']]; - $xdx=$out[$pidx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$pidx]['testcase_qty']; - } - $tcase_memory=$current; - } - } - else - { - // This node is a Test Suite - $the_level = 0; - if($parent_idx >= 0) - { - $xdx=$out[$parent_idx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$parent_idx]['testcase_qty']; - } - - if($pivot_tsuite['parent_id'] != $current['parent_id']) - { - if ($pivot_tsuite['id'] == $current['parent_id']) - { - $the_level++; - $level[$current['parent_id']] = $the_level; - } - else - { - if( isset($level[$current['parent_id']]) ) - { - $the_level = $level[$current['parent_id']]; - } - } - } - $out[$idx]['testsuite']=array('id' => $current['id'], 'name' => $current['name']); - $out[$idx]['testcases'] = array(); - $out[$idx]['testcase_qty'] = 0; - $out[$idx]['linked_testcase_qty'] = 0; - $out[$idx]['level'] = $the_level; - $out[$idx]['write_buttons'] = 'no'; - $hash_id_pos[$current['id']] = $idx; - $idx++; - - // update pivot. - $level[$current['parent_id']] = $the_level; - $pivot_tsuite = $current; - } - } // foreach - - // Update after finished loop - if($parent_idx >= 0) - { - $xdx=$out[$parent_idx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$parent_idx]['testcase_qty']; - } - - unset($tcase_memory); - $tsuite_tcqty[$id] = $out[$hash_id_pos[$id]]['testcase_qty']; - return array($a_tcid,$a_tsuite_idx,$tsuite_tcqty,$out); -} - - -/** - * VERY IMPORTANT NOTICE - * - * You can be a little bit confused regarding What will be returned on 'testcases' =>[]['tcversions'] - * You will see JUST ON tcversion with active status = 0, ONLY if the version is LINKED to test plan. - * Otherwise you will get ONLY ACTIVE test case versions. - * - * - * @internal revisions: - */ -function addLinkedVersionsInfo($testCaseVersionSet,$a_tsuite_idx,&$out,&$linked_items,$opt=null) -{ - $my['opt'] = array('useOptionalArrayFields' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $tcStatus2exclude = config_get('tplanDesign')->hideTestCaseWithStatusIn; - $optionalIntegerFields = array('feature_id','linked_by'); - $optionalArrayFields = array('user_id'); - - $result = array('spec_view'=>array(), 'num_tc' => 0, 'has_linked_items' => 0); - $pivot_id=-1; - $firstElemIDX = key($out); - - foreach($testCaseVersionSet as $the_k => $testCase) - { - $tc_id = $testCase['testcase_id']; - - // Needed when having multiple platforms - if ($pivot_id != $tc_id ) { - $pivot_id = $tc_id; - $result['num_tc']++; - } - $parent_idx = $a_tsuite_idx[$tc_id]; - - // Reference to make code reading more human friendly - $outRef = &$out[$parent_idx]['testcases'][$tc_id]; - - // Is not clear (need explanation) why we process in this part ONLY ACTIVE - // also we need to explain !is_null($out[$parent_idx]) - // - if($testCase['active'] == 1 && !isset($tcStatus2exclude[$testCase['status']]) && - !is_null($out[$parent_idx]) ) { - - if( !isset($outRef['execution_order']) ){ - // Doing this I will set order for test cases that still are not linked. - // But Because I loop over all versions (linked and not) if I always write, - // will overwrite right execution order of linked tcversion. - // - // N.B.: - // As suggested by Martin Havlat order will be set to external_id * 10 - $outRef['execution_order'] = $testCase['node_order'] * 10; - } - $outRef['tcversions'][$testCase['id']] = $testCase['version']; - $outRef['tcversions_active_status'][$testCase['id']] = 1; - $outRef['external_id'] = $testCase['tc_external_id']; - $outRef['tcversions_execution_type'][$testCase['id']] = $testCase['execution_type']; - $outRef['importance'][$testCase['id']] = $testCase['importance']; - $outRef['status'][$testCase['id']] = $testCase['status']; - - if (!isset($outRef['tcversions_qty'])) { - $outRef['tcversions_qty']=0; - } - $outRef['tcversions_qty']++; - } - - if (!is_null($linked_items)) { - foreach($linked_items as $linked_testcase) { - $target = current($linked_testcase); - if(($target['tc_id'] == $testCase['testcase_id']) && - ($target['tcversion_id'] == $testCase['id']) ) { - // This can be written only once no matter platform qty - if( !isset($outRef['tcversions'][$testCase['id']]) ) { - $outRef['tcversions'][$testCase['id']] = $testCase['version']; - $outRef['tcversions_active_status'][$testCase['id']] = 0; - $outRef['external_id'] = $testCase['tc_external_id']; - $outRef['tcversions_execution_type'][$testCase['id']] = $testCase['execution_type']; - $outRef['importance'][$testCase['id']] = $testCase['importance']; - } - $outRef['execution_order'] = isset($target['execution_order'])? $target['execution_order'] : 0; - if( isset($target['priority']) ) - { - $outRef['priority'] = priority_to_level($target['priority']); - } - $outRef['linked_version_id']= $testCase['id']; - $out[$parent_idx]['write_buttons'] = 'yes'; - $out[$parent_idx]['linked_testcase_qty']++; - $result['has_linked_items'] = 1; - - foreach($linked_testcase as $item) - { - // 20120714 - franciscom - need t check if this info is needed. - if(isset($item['executed']) && (intval($item['executed']) >0) || - isset($item['exec_id']) && (intval($item['exec_id']) >0)) - { - $outRef['executed'][$item['platform_id']]='yes'; - } - - if( isset($item['linked_ts'])) - { - $outRef['linked_ts'][$item['platform_id']]=$item['linked_ts']; - } - - foreach ($optionalIntegerFields as $fieldKey ) - { - if( isset($item[$fieldKey])) - { - $outRef[$fieldKey][$item['platform_id']]=intval($item[$fieldKey]); - } - } - - // this logic has been created to cope with multiple tester assignment - if($my['opt']['useOptionalArrayFields']) - { - - foreach ($optionalArrayFields as $fieldKey ) - { - // We have issues when no user is assigned because is - if(is_array($item[$fieldKey])) - { - // this seems to be the path we follow when trying to work on test suite - $outRef[$fieldKey][$item['platform_id']]=$item[$fieldKey]; - } - else - { - // this seems to be the path we follow when trying to work on SINGLE test case - $outRef[$fieldKey][$item['platform_id']][]=intval($item[$fieldKey]); - } - } - } - } - break; - } - } - } - } //foreach - - // Again DAMM 0!! - if (!is_null($out[$firstElemIDX])) { - $result['spec_view'] = $out; - } - return $result; -} - -/** - * - * changed return type when there are no platforms - */ -function getPlatforms($db,$tproject_id,$testplan_id) -{ - $platform_mgr = new tlPlatform($db, $tproject_id); - - if (is_null($testplan_id)) { - $opx = array('enable_on_design' => null, - 'enable_on_execution' => true); - $platforms = $platform_mgr->getAll($opx); - } else { - $platforms = $platform_mgr->getLinkedToTestplan($testplan_id); - } - - if (is_null($platforms)) { - // need to create fake data for platform 0 in order - // to have only simple logic - // $platforms= array( 'id' => 0, 'name' => ''); - $platforms[0] = array( 'id' => 0, 'name' => ''); - } - return $platforms; -} - -/** - * - */ -function getFilteredSpecViewFlat(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, $filters=null, $options=null) -{ - $tprojectMgr = new testproject($dbHandler); - $tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->id); - - $my = array(); // some sort of local scope - $my['filters'] = array('keywordsFilter' => null, - 'testcaseFilter' => null, - 'assignedToFilter' => null, - 'executionTypeFilter' => null, - 'platformsFilter' => null,); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $my['options'] = array('write_button_only_if_linked' => 1, - 'prune_unlinked_tcversions' => 1); - $my['options'] = array_merge($my['options'],(array)$options); - - - // This does filter on keywords ALWAYS in OR mode. - $tplan_linked_tcversions = - getFilteredLinkedVersions($dbHandler,$argsObj,$tplanMgr, $tcaseMgr, $options); - - // With these pieces we implement the AND type of keyword filter. - $testCaseSet = null; - $tryNextFilter = true; - $filterApplied = false; - if(!is_null($my['filters']['keywordsFilter']) && !is_null($my['filters']['keywordsFilter']->items)) { - $keywordsTestCases = $tprojectMgr->getKeywordsLatestTCV( - $argsObj->tproject_id, - $my['filters']['keywordsFilter']->items, - $my['filters']['keywordsFilter']->type); - - $testCaseSet = array_keys((array)$keywordsTestCases); - $tryNextFilter = !is_null($testCaseSet); - $filterApplied = true; - } - - if( $tryNextFilter && !is_null($my['filters']['testcaseFilter'])) { - $filterApplied = true; - if( is_null($testCaseSet) ) { - $testCaseSet = $my['filters']['testcaseFilter']; - } else { - // wrong use of array() instead of (array) - $testCaseSet = array_intersect($testCaseSet, (array)$my['filters']['testcaseFilter']); - } - } - - // when $testCaseSet is null because we have applied filters - // => we do not need to call other - // method because we know we are going to get NOTHING - $testCaseSet = !is_null($testCaseSet) ? array_combine($testCaseSet, $testCaseSet) : null; - if ($filterApplied && is_null($testCaseSet)) { - return null; - } - - $genSpecFilters = array('keywords' => $argsObj->keyword_id, - 'testcases' => $testCaseSet, - 'exec_type' => $my['filters']['executionTypeFilter'], - 'cfields' => null, - 'platforms' => $argsObj->platform_id); - - if (isset($my['filters']['cfieldsFilter'])) { - $genSpecFilters['cfields'] = $my['filters']['cfieldsFilter']; - } - - $out = genSpecViewFlat($dbHandler, 'testplan', - $argsObj->tplan_id, $argsObj->id, - $tsuite_data['name'], - $tplan_linked_tcversions, null, - $genSpecFilters, $my['options']); - return $out; -} - -/** - * - */ -function genSpecViewFlat(&$db, $specViewType, $tobj_id, $id, $name, &$linked_items, - $map_node_tccount, $filters=null, $options = null, $tproject_id = null) -{ - - $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; - - $out = array(); - $result = array('spec_view'=>array(), 'num_tc' => 0, 'has_linked_items' => 0); - - $my = array(); - $my['options'] = array('write_button_only_if_linked' => 0, - 'prune_unlinked_tcversions' => 0, - 'add_custom_fields' => 0) + (array)$options; - - $my['filters'] = array('keywords' => 0, 'testcases' => null , - 'exec_type' => null, - 'importance' => null, 'cfields' => null); - - foreach( $my as $key => $settings) { - if( !is_null($$key) && is_array($$key) ) { - $my[$key] = array_merge($my[$key],$$key); - } - } - - $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; - $is_tplan_view_type=$spec_view_type == 'testplan' ? 1 : 0; - $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; - - if( !$is_tplan_view_type && is_null($tproject_id) ) { - $tproject_id = $tobj_id; - } - - $testplan_id = $is_tplan_view_type ? $tobj_id : null; - - - $tcase_mgr = new testcase($db); - $hash_descr_id = $tcase_mgr->tree_manager->get_available_node_types(); - $hash_id_descr = array_flip($hash_descr_id); - - $key2map = array('keyword_id' => 'keywords', 'tcase_id' => 'testcases', - 'execution_type' => 'exec_type', 'importance' => 'importance', - 'cfields' => 'cfields','tcase_name' => 'tcase_name', - 'status' => 'workflow_status'); - - $pfFilters = array('tcase_node_type_id' => $hash_descr_id['testcase']); - foreach($key2map as $tk => $fk) - { - $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; - } - - $test_spec = getTestSpecFromNode($db,$tcase_mgr,$linked_items,$tobj_id,$id,$spec_view_type,$pfFilters); - - $platforms = getPlatforms($db,$tproject_id,$testplan_id); - $idx = 0; - $a_tcid = array(); - $a_tsuite_idx = array(); - if(count($test_spec)) { - $cfg = array('node_types' => $hash_id_descr, - 'write_status' => $write_status, - 'is_uncovered_view_type' => $is_uncovered_view_type); - - // $a_tsuite_idx - // key: test case version id - // value: index inside $out, where parent test suite of test case version id is located. - // - list($a_tcid,$a_tsuite_idx,$tsuite_tcqty,$out) = buildSkeletonFlat($id,$name,$cfg,$test_spec,$platforms); - } - - // Collect information related to linked testcase versions - // DAMMED 0!!!! - $firtsElemIDX = key($out); - if(!is_null($out) && count($out) > 0 && !is_null($out[$firtsElemIDX]) && count($a_tcid)) { - $optGBI = array('output' => 'full_without_users', - 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC "); - - if (isset($options['onlyLatestTCV']) - && $options['onlyLatestTCV']) { - $whatSet = testcase::LATEST_VERSION; - $tcaseVersionSet = $tcase_mgr->getLTCVInfo($a_tcid); - } else { - $whatSet = testcase::ALL_VERSIONS; - $tcaseVersionSet = $tcase_mgr->get_by_id($a_tcid,$whatSet,null,$optGBI); - } - - $result = addLinkedVersionsInfo($tcaseVersionSet,$a_tsuite_idx,$out,$linked_items,$options); - } - - if( count($result['spec_view']) > 0 && $my['options']['add_custom_fields']) { - addCustomFieldsToView($result['spec_view'],$tproject_id,$tcase_mgr); - } - - // ------------------------------------------------------------------ - // with array_values() we reindex array to avoid "holes" - $result['spec_view']= array_values($result['spec_view']); - return $result; -} - - -/** - * - * Developer Notice - * key 'user_id' is JUST initialized - */ -function buildSkeletonFlat($branchRootID,$name,$config,&$test_spec,&$platforms) -{ - $parent_idx=-1; - $pivot_tsuite = $test_spec[0]; - $levelSet = array(); - $tcase_memory = null; - - $node_types = $config['node_types']; - $write_status = $config['write_status']; - $is_uncovered_view_type = $config['is_uncovered_view_type']; - - $out=array(); - $a_tcid = array(); - $a_tsuite_idx = array(); - - $rootIDX = 0; - $hash_id_pos[$branchRootID] = $rootIDX; - $out[$rootIDX]['testsuite'] = array('id' => $branchRootID, 'name' => $name); - $out[$rootIDX]['testcases'] = array(); - $out[$rootIDX]['write_buttons'] = 'no'; - $out[$rootIDX]['testcase_qty'] = 0; - $out[$rootIDX]['level'] = 1; - $out[$rootIDX]['linked_testcase_qty'] = 0; - $out[$rootIDX]['linked_ts'] = null; - $out[$rootIDX]['linked_by'] = 0; - $out[$rootIDX]['priority'] = 0; - - // $familyNames[$branchRootID] = $name; - $nameAtLevel[$out[0]['level']] = $name; - - - $level = $out[0]['level']+1; - $idx = 0; - $idx++; - $tsuite_tcqty=array($branchRootID => 0); - - $rdx = 0; - foreach ($test_spec as $current) - { - // it will be interesting to understand if this can happen due to filtering - if(is_null($current)) - { - continue; - } - - // pivot is updated each time I find a Test Suite. - switch($node_types[$current['node_type_id']]) - { - case 'testsuite': - // $familyNames[$current['id']] = $current['name']; - - - // parent_idx is setted ONLY when a test case is found - // this logic is used just to have test case count inside test suite. - if($parent_idx >= 0) - { - $xdx=$out[$parent_idx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$parent_idx]['testcase_qty']; - } - - if($pivot_tsuite['parent_id'] != $current['parent_id']) - { - // echo 'May be we are doing one Step Down Walking on Tree? Let\'s check - ' . __LINE__ . '
    '; - if ($pivot_tsuite['id'] == $current['parent_id']) - { - // echo 'Yes!, we are stepping down and ...
    '; - // echo 'Luke I\'m Your FATHER
    '; - $level++; - $levelSet[$current['parent_id']] = $level; - } - else - { - // echo 'Oops!. What will be next level ? UP or Down?'; - $level = $levelSet[$current['parent_id']]; - } - $nameAtLevel[$level] = $current['name']; - } - else - { - $nameAtLevel[$level] = $current['name']; - } - - - $whoiam = ''; - for($ldx=$out[$rootIDX]['level']; $ldx <= $level; $ldx++) - { - $whoiam .= $nameAtLevel[$ldx] . '/'; - } - // echo 'What is my name NOW? -> ' . $whoiam .'
    '; - - $out[$idx]['testsuite']=array('id' => $current['id'], 'name' => $whoiam); - $out[$idx]['testcases'] = array(); - $out[$idx]['testcase_qty'] = 0; - $out[$idx]['linked_testcase_qty'] = 0; - $out[$idx]['level'] = $level; - $out[$idx]['write_buttons'] = 'no'; - $hash_id_pos[$current['id']] = $idx; - $idx++; - - // update pivot. - $levelSet[$current['parent_id']] = $level; - $pivot_tsuite = $current; - break; - - case 'testcase': - break; - - } - - // In some situations during processing of testcase, a change of parent can - // exists, then we need to update $tsuite_tcqty - if($node_types[$current['node_type_id']] == "testcase") - { - $tc_id = $current['id']; - $parent_idx = $hash_id_pos[$current['parent_id']]; - $a_tsuite_idx[$tc_id] = $parent_idx; - $out[$parent_idx]['testcases'][$tc_id] = array('id' => $tc_id,'name' => $current['name']); - - // Reference to make code reading more human friendly - $outRef = &$out[$parent_idx]['testcases'][$tc_id]; - - if($is_uncovered_view_type) - { - // @TODO understand impacts of platforms - $outRef['external_id'] = $test_spec[$tc_id]['external_id']; - } - else - { - $out[$parent_idx]['write_buttons'] = $write_status; - $out[$parent_idx]['linked_testcase_qty'] = 0; - - $outRef['tcversions'] = array(); - $outRef['tcversions_active_status'] = array(); - $outRef['tcversions_execution_type'] = array(); - $outRef['tcversions_qty'] = 0; - $outRef['linked_version_id'] = 0; - $outRef['executed'] = null; // 'no'; - - // useful for tc_exec_assignment.php - $outRef['platforms'] = $platforms; - $outRef['feature_id'] = null; //0; - $outRef['linked_by'] = null; //0; - $outRef['linked_ts'] = null; - $outRef['priority'] = 0; - $outRef['user_id'] = array(); - } - $out[$parent_idx]['testcase_qty']++; - $a_tcid[] = $current['id']; - - // This piece is needed initialize in right way $tsuite_tcqty - // in this kind of situation, for SubSuite2 - // - // Tsuite 1 - // |__ SubSuite1 - // | |__TCX1 - // | |__TCX2 - // | - // |__ SubSuite2 - // | |__TCY1 - // | |__TCY2 - // | - // |__ TCZ1 - // - // - if( $tcase_memory['parent_id'] != $current['parent_id'] ) - { - if( !is_null($tcase_memory) ) - { - $pidx = $hash_id_pos[$tcase_memory['parent_id']]; - $xdx=$out[$pidx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$pidx]['testcase_qty']; - } - $tcase_memory=$current; - } - } - } // foreach - - // Update after finished loop - if($parent_idx >= 0) - { - $xdx=$out[$parent_idx]['testsuite']['id']; - $tsuite_tcqty[$xdx]=$out[$parent_idx]['testcase_qty']; - } - - unset($tcase_memory); - $tsuite_tcqty[$branchRootID] = $out[$hash_id_pos[$branchRootID]]['testcase_qty']; - - // Clean up - $loop2do = count($out); - $toUnset = null; - for($lzx=0; $lzx < $loop2do; $lzx++) - { - if(count($out[$lzx]['testcases']) == 0) - { - $toUnset[$lzx]=$lzx; - } - } - if(!is_null($toUnset)) - { - foreach($toUnset as $kill) - { - unset($out[$kill]); - } - } - return array($a_tcid,$a_tsuite_idx,$tsuite_tcqty,$out); + 2732 + * [tc_id] => 2733 + * [z] => 100 ---> nodes_hierarchy.order + * [name] => TC1 + * [tcversion_id] => 2734 + * [feature_id] => 9 --->> testplan_tcversions.ID + * [execution_order] => 10 + * [version] => 1 + * [active] => 1 + * [external_id] => 1 + * [exec_id] => 1 + * [tcversion_number] => 1 + * [executed] => 2734 + * [exec_on_tplan] => 2735 + * [user_id] => + * [type] => + * [status] => + * [assigner_id] => + * [urgency] => 2 IMPORTANT: exists ONLY FOR LINKED TEST CASES + * [exec_status] => b + * [priority] => 4 // urgency*importance IMPORTANT: exists ONLY FOR LINKED TEST CASES + * + * @param array $map_node_tccount + * @todo probably this argument ($map_node_tccount) is not needed, but it will depend + * of how this feature (gen_spec_view) will be used on other TL areas. + * + * @param array $filters + * keys + * [keyword_id] default 0 + * [tcase_id] default null, can be an array + * + * @param array $options + * keys + * [write_button_only_if_linked] default 0 + * [prune_unlinked_tcversions]: default 0. + * Useful when working on spec_view_type='testplan'. + * 1 -> will return only linked tcversion + * 0 -> returns all test cases specs. + * [add_custom_fields]: default=0 + * useful when working on spec_view_type='testproject' + * when doing test case assign to test plans. + * 1 -> for every test case cfields of area 'testplan_design' + * will be fetched and displayed. + * 0 -> do nothing + * + * [$tproject_id]: default = null + * useful to improve performance in custom field method calls + * when add_custom_fields=1. + * + * + * @return array every element is an associative array with the following + * structure: (to get last updated info add debug code and print_r returned value) + * [testsuite] => Array( [id] => 28 + * [name] => TS1 ) + * [testcases] => Array( [2736] => Array + * ( + * [id] => 2736 + * [name] => TC2 + * [tcversions] => Array + * ( + * [2738] => 2 // key=tcversion id,value=version + * [2737] => 1 + * ) + * [tcversions_active_status] => Array + * ( + * [2738] => 1 // key=tcversion id,value=active status + * [2737] => 1 + * ) + * [tcversions_execution_type] => Array + * ( + * [2738] => 1 + * [2737] => 2 + * ) + * [tcversions_qty] => 2 + * [linked_version_id] => 2737 + * [executed] => no + * [user_id] => 0 ---> !=0 if execution has been assigned + * [feature_id] => 12 ---> testplan_tcversions.id + * [execution_order] => 20 + * [external_id] => 2 + * [linked_ts] => 2009-06-10 23:00 + * [linked_by] => 2 + * [priority] => HIGH, MEDIUM or LOW + * ) + * [81] => Array( [id] => 81 + * [name] => TC88) + * ... + * ) + * [level] = + * [write_buttons] => yes or no + * level and write_buttons are used to generate the user interface + * + * Warning: + * if the root element of the spec_view, has 0 test => then the default + * structure is returned ( $result = array('spec_view'=>array(), 'num_tc' => 0)) + * + * + */ +function gen_spec_view(&$db, $specViewType, $tobj_id, $id, $name, &$linked_items, + $map_node_tccount, $filters = null, $options = null, $tproject_id = null) +{ + $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; + $out = array(); + $result = array( + 'spec_view' => array(), + 'num_tc' => 0, + 'has_linked_items' => 0 + ); + + $my = array(); + $my['options'] = array( + 'write_button_only_if_linked' => 0, + 'prune_unlinked_tcversions' => 0, + 'add_custom_fields' => 0 + ) + (array) $options; + + $my['filters'] = array( + 'keywords' => 0, + 'testcases' => null, + 'exec_type' => null, + 'importance' => null, + 'cfields' => null, + 'platforms' => null + ); + + foreach ($my as $key => $settings) { + if (! is_null($$key) && is_array($$key)) { + $my[$key] = array_merge($my[$key], $$key); + } + } + + $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; + $is_tplan_view_type = $spec_view_type == 'testplan' ? 1 : 0; + $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; + + if (! $is_tplan_view_type && is_null($tproject_id)) { + $tproject_id = $tobj_id; + } + + $testplan_id = $is_tplan_view_type ? $tobj_id : null; + + $tcaseMgr = new testcase($db); + $hash_descr_id = $tcaseMgr->tree_manager->get_available_node_types(); + $hash_id_descr = array_flip($hash_descr_id); + + $key2map = array( + 'keyword_id' => 'keywords', + 'tcase_id' => 'testcases', + 'execution_type' => 'exec_type', + 'importance' => 'importance', + 'cfields' => 'cfields', + 'tcase_name' => 'tcase_name', + 'status' => 'workflow_status', + 'platform_id' => 'platforms' + ); + + $pfFilters = array( + 'tcase_node_type_id' => $hash_descr_id['testcase'] + ); + foreach ($key2map as $tk => $fk) { + $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; + } + + // transform in array to be gentle with getTestSpecFromNode() + $t2a = array( + 'importance', + 'status' + ); + foreach ($t2a as $tortuga) { + if (! is_null($pfFilters[$tortuga])) { + $pfFilters[$tortuga] = (array) $pfFilters[$tortuga]; + } + } + + $test_spec = getTestSpecFromNode($db, $tcaseMgr, $linked_items, $tobj_id, + $id, $spec_view_type, $pfFilters); + + $platforms = getPlatforms($db, $tproject_id, $testplan_id); + $a_tcid = array(); + $a_tsuite_idx = array(); + if (count($test_spec)) { + $cfg = array( + 'node_types' => $hash_id_descr, + 'write_status' => $write_status, + 'is_uncovered_view_type' => $is_uncovered_view_type + ); + + // $a_tsuite_idx + // key: test case version id + // value: index inside $out, where parent test suite of test case version id is located. + // + list ($a_tcid, $a_tsuite_idx, $tsuite_tcqty, $out) = buildSkeleton($id, + $name, $cfg, $test_spec, $platforms); + } + + // This code has been replace (see below on Remove empty branches) + // Once we have created array with testsuite and children testsuites + // we are trying to remove nodes that has 0 test case count. + // May be this can be done (as noted by schlundus during performance + // analisys done on october 2008) in a better way, or better can be absolutely avoided. + // + // This process is needed to prune whole branches that are empty + // Need to look for every call in TL and understand if this can be removed + // + if (! is_null($map_node_tccount)) { + foreach ($out as $key => $elem) { + if (isset($map_node_tccount[$elem['testsuite']['id']]) && + $map_node_tccount[$elem['testsuite']['id']]['testcount'] == 0) { + // why not unset ? + $out[$key] = null; + } + } + } + + // Collect information related to linked testcase versions + if (! empty($out) && ! is_null($out[0]) && count($a_tcid)) { + $optGBI = array( + 'output' => 'full_without_users', + 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC " + ); + + $tcaseVersionSet = $tcaseMgr->get_by_id($a_tcid, testcase::ALL_VERSIONS, + null, $optGBI); + $result = addLinkedVersionsInfo($tcaseVersionSet, $a_tsuite_idx, $out, + $linked_items, $options); + } + + // Try to prune empty test suites, to reduce memory usage and + // to remove elements + // that do not need to be displayed on user interface. + if (! empty($result['spec_view'])) { + removeEmptyTestSuites($result['spec_view'], $tcaseMgr->tree_manager, + ($my['options']['prune_unlinked_tcversions'] && $is_tplan_view_type), + $hash_descr_id); + } + + // Remove empty branches + // Loop to compute test case qty ($tsuite_tcqty) on every level and prune test suite branchs that are empty + if (! empty($result['spec_view'])) { + removeEmptyBranches($result['spec_view'], $tsuite_tcqty); + } + + /** + * + * @TODO: maybe we can integrate this into already present loops above? + */ + // This is not right condition for identifing an empty test suite for the porpouse + // of gen_spec_view(), because for following structure + // TS1 + // \--- TS2 + // \--TC1 + // \--TC2 + // + // \--- TS3 + // \-- TXX + // + // When we are displaying a Test Specification we want to see previous structure + // But if we apply this criteria for empty test suite, TS1 results empty and will + // be removed -> WRONG + // + // Need to understand when this feature will be needed and then reimplement + // + // if ($prune_empty_tsuites) + // { + // foreach($result['spec_view'] as $key => $value) + // { + // if(is_null($value) || !isset($value['testcases']) || !count($value['testcases'])) + // unset($result['spec_view'][$key]); + // } + // } + + // #1650 We want to manage custom fields when user is doing test case execution assigment + if (! empty($result['spec_view']) && $my['options']['add_custom_fields']) { + addCustomFieldsToView($result['spec_view'], $tproject_id, $tcaseMgr); + } + unset($tcaseMgr); + + // with array_values() we reindex array to avoid "holes" + $result['spec_view'] = array_values($result['spec_view']); + return $result; +} + +/** + */ +function gen_coverage_view(&$db, $specViewType, $tobj_id, $id, $name, + &$linked_items, $map_node_tccount, $filters = null, $options = null, + $tproject_id = null) +{ + $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; + + $out = array(); + $result = array( + 'spec_view' => array(), + 'num_tc' => 0, + 'has_linked_items' => 0 + ); + + $my = array(); + $my['options'] = array( + 'write_button_only_if_linked' => 0, + 'prune_unlinked_tcversions' => 0, + 'add_custom_fields' => 0 + ) + (array) $options; + + $my['filters'] = array( + 'keywords' => 0, + 'testcases' => null, + 'exec_type' => null, + 'importance' => null, + 'cfields' => null + ); + foreach ($my as $key => $settings) { + if (! is_null($$key) && is_array($$key)) { + $my[$key] = array_merge($my[$key], $$key); + } + } + + $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; + $is_tplan_view_type = $spec_view_type == 'testplan' ? 1 : 0; + $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; + + if (! $is_tplan_view_type && is_null($tproject_id)) { + $tproject_id = $tobj_id; + } + + $testplan_id = $is_tplan_view_type ? $tobj_id : null; + + $tcaseMgr = new testcase($db); + $hash_descr_id = $tcaseMgr->tree_manager->get_available_node_types(); + $hash_id_descr = array_flip($hash_descr_id); + + $key2map = array( + 'keyword_id' => 'keywords', + 'tcase_id' => 'testcases', + 'execution_type' => 'exec_type', + 'importance' => 'importance', + 'cfields' => 'cfields', + 'tcase_name' => 'tcase_name' + ); + + $pfFilters = array( + 'tcase_node_type_id' => $hash_descr_id['testcase'] + ); + foreach ($key2map as $tk => $fk) { + $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; + } + + $test_spec = getTestSpecFromNode($db, $tcaseMgr, $linked_items, $tobj_id, + $id, $spec_view_type, $pfFilters, 'req_order'); + + $platforms = getPlatforms($db, $tproject_id, $testplan_id); + $a_tcid = array(); + $a_tsuite_idx = array(); + if (count($test_spec)) { + $cfg = array( + 'node_types' => $hash_id_descr, + 'write_status' => $write_status, + 'is_uncovered_view_type' => $is_uncovered_view_type + ); + + // $a_tsuite_idx + // key: test case version id + // value: index inside $out, where parent test suite of test case version id is located. + // + list ($a_tcid, $a_tsuite_idx, , $out) = buildSkeleton($id, $name, $cfg, + $test_spec, $platforms); + } + + // This code has been replace (see below on Remove empty branches) + // Once we have created array with testsuite and children testsuites + // we are trying to remove nodes that has 0 test case count. + // May be this can be done (as noted by schlundus during performance + // analisys done on october 2008) in a better way, or better can be absolutely avoided. + // + // This process is needed to prune whole branches that are empty + // Need to look for every call in TL and understand if this can be removed + // + if (! is_null($map_node_tccount)) { + foreach ($out as $key => $elem) { + if (isset($map_node_tccount[$elem['testsuite']['id']]) && + $map_node_tccount[$elem['testsuite']['id']]['testcount'] == 0) { + $out[$key] = null; + } + } + } + + // Collect information related to linked testcase versions + if (! empty($out) && ! is_null($out[0]) && count($a_tcid)) { + $optGBI = array( + 'output' => 'full_without_users', + 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC " + ); + + $tcaseVersionSet = $tcaseMgr->get_by_id($a_tcid, testcase::ALL_VERSIONS, + null, $optGBI); + $result = addLinkedVersionsInfo($tcaseVersionSet, $a_tsuite_idx, $out, + $linked_items); + } + + /** + * + * @TODO: maybe we can integrate this into already present loops above? + */ + // This is not right condition for identifing an empty test suite for the porpouse + // of gen_spec_view(), because for following structure + // TS1 + // \--- TS2 + // \--TC1 + // \--TC2 + // + // \--- TS3 + // \-- TXX + // + // When we are displaying a Test Specification we want to see previous structure + // But if we apply this criteria for empty test suite, TS1 results empty and will + // be removed -> WRONG + // + // Need to understand when this feature will be needed and then reimplement + // + // if ($prune_empty_tsuites) + // { + // foreach($result['spec_view'] as $key => $value) + // { + // if(is_null($value) || !isset($value['testcases']) || !count($value['testcases'])) + // unset($result['spec_view'][$key]); + // } + // } + + // #1650 We want to manage custom fields when user is doing test case execution assigment + if (count($result['spec_view']) > 0 && $my['options']['add_custom_fields']) { + addCustomFieldsToView($result['spec_view'], $tproject_id, $tcaseMgr); + } + // -------------------------------------------------------------------------------------------- + unset($tcaseMgr); + + // with array_values() we reindex array to avoid "holes" + $result['spec_view'] = array_values($result['spec_view']); + return $result; +} + +/** + * get linked versions filtered by Keyword ID + * Filter is done ONLY on attributes THAT ARE COMMON to ALL test case versions, + * because (till now) while adding/removing test cases user works on Test Spec Tree + * and filter applied to this tree acts on: + * + * 1. attributes COMMON to all versions + * 2. attributes present ON LAST ACTIVE version. + * + * But do no make considerations regarding versions linked to test plan + * DEV NOTE: may be this has to be changed in future ? + * + * @param database $dbHandler: + * @param stdClass $argsObj: + * stdClass object with information about filters + * @param testplan $tplanMgr: + * test plan manager object + * @param testcase $tcaseMgr: + * test case manager object + * @param array $options: + * default null (at today 20110820 seems not be used). + * @param boolean $isTestSuite: + * filter testGroupBy, default true + * + */ +function getFilteredLinkedVersions(&$dbHandler, &$argsObj, &$tplanMgr, + &$tcaseMgr, $options = null, $isTestSuite = true) +{ + static $tsuite_mgr; + $doFilterByKeyword = (! is_null($argsObj->keyword_id) && + $argsObj->keyword_id > 0) ? true : false; + + // Multiple step algoritm to apply keyword filter on type=AND + // get_*_tcversions filters by keyword ALWAYS in OR mode. + // + $filters = array( + 'keyword_id' => $argsObj->keyword_id, + 'platform_id' => null + ); + if (property_exists($argsObj, 'control_panel') && + isset($argsObj->control_panel['setting_platform']) && + intval($argsObj->control_panel['setting_platform']) > 0) { + $filters['platform_id'] = intval( + $argsObj->control_panel['setting_platform']); + } + + if (isset($options['assigned_on_build']) && $options['assigned_on_build'] > 0) { + $filters['assigned_on_build'] = $options['assigned_on_build']; + } + + // get test suites in branch to limit search + if ($isTestSuite) { + $itemID = property_exists($argsObj, 'object_id') ? $argsObj->object_id : $argsObj->id; + if (! is_null($itemID)) { + // will get all test suites in this branch, in order to limit amount of data returned by + // get_*_tcversions + if (! $tsuite_mgr) { + $tsuite_mgr = new testsuite($dbHandler); + } + $xx = $tsuite_mgr->get_branch($itemID); + $xx .= ($xx == '') ? $itemID : ',' . $itemID; + $filters['tsuites_id'] = explode(',', $xx); + } + } + + $opx = array_merge( + array( + 'addExecInfo' => true, + 'specViewFields' => true, + 'tlFeature' => 'none' + ), (array) $options); + + switch ($opx['tlFeature']) { + case 'testCaseExecTaskAssignment': + $method2call = 'getLinkedTCVXmen'; + break; + + case 'testCaseTestPlanAssignment': + default: + $method2call = 'getLTCVNewGeneration'; + break; + } + + if (isset($argsObj->testcases_to_show) && + ! is_null($argsObj->testcases_to_show)) { + $filters['tcase_id'] = $argsObj->testcases_to_show; + } + + if (isset($argsObj->platform_id) && $argsObj->platform_id > 0) { + $filters['platform_id'] = $argsObj->platform_id; + } + + $tplan_tcases = $tplanMgr->$method2call($argsObj->tplan_id, $filters, $opx); + + if (! is_null($tplan_tcases) && $doFilterByKeyword && + $argsObj->keywordsFilterType == 'AND') { + $filteredSet = $tcaseMgr->filterByKeyword(array_keys($tplan_tcases), + $argsObj->keyword_id, $argsObj->keywordsFilterType); + + $filters = array( + 'tcase_id' => array_keys($filteredSet) + ); + + // HERE WE CAN HAVE AN ISSUE + $tplan_tcases = $tplanMgr->getLTCVNewGeneration($argsObj->tplan_id, + $filters, $opx); + } + return $tplan_tcases; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj: + * user input + * @param testplan $tplanMgr: + * test plan manager + * @param testcase $tcaseMgr: + * test case manager + * @param array $filters: + * keys keywordsFilter, testcaseFilter,assignedToFilter, + * executionTypeFilter, cfieldsFilter + * + * IMPORTANT NOTICE: not all filters are here, + * other arrive via argsObj + * @param array $options: + * keys ?? + * USED TO PASS options to other method called here + * -> see these method docs. + */ +function getFilteredSpecView(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, + $filters = null, $options = null) +{ + $tprojectMgr = new testproject($dbHandler); + $tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $argsObj->id); + + $my = array(); // some sort of local scope + $my['filters'] = array( + 'keywordsFilter' => null, + 'testcaseFilter' => null, + 'assignedToFilter' => null, + 'executionTypeFilter' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'write_button_only_if_linked' => 1, + 'prune_unlinked_tcversions' => 1 + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // This does filter on keywords ALWAYS in OR mode. + $tplan_linked_tcversions = getFilteredLinkedVersions($dbHandler, $argsObj, + $tplanMgr, $tcaseMgr, $options); + + // With these pieces we implement the AND type of keyword filter. + $testCaseSet = null; + $tryNextFilter = true; + $filterApplied = false; + if (! is_null($my['filters']['keywordsFilter']) && + ! is_null($my['filters']['keywordsFilter']->items)) { + + $keywordsTestCases = $tprojectMgr->getKeywordsLatestTCV( + $argsObj->tproject_id, $my['filters']['keywordsFilter']->items, + $my['filters']['keywordsFilter']->type); + + $testCaseSet = array_keys((array) $keywordsTestCases); + $tryNextFilter = ! is_null($testCaseSet); + $filterApplied = true; + } + + if ($tryNextFilter && ! is_null($my['filters']['testcaseFilter'])) { + $filterApplied = true; + if (is_null($testCaseSet)) { + $testCaseSet = $my['filters']['testcaseFilter']; + } else { + // wrong use of array() instead of (array) + $testCaseSet = array_intersect($testCaseSet, + (array) $my['filters']['testcaseFilter']); + } + } + + // when $testCaseSet is null because we have + // applied filters => we do not need to call other + // method because we know we are going to get NOTHING + $testCaseSet = ! is_null($testCaseSet) ? array_combine($testCaseSet, + $testCaseSet) : null; + if ($filterApplied && is_null($testCaseSet)) { + return null; + } + + $genSpecFilters = array( + 'keywords' => $argsObj->keyword_id, + 'testcases' => $testCaseSet, + 'exec_type' => $my['filters']['executionTypeFilter'], + 'cfields' => null + ); + + if (isset($my['filters']['cfieldsFilter'])) { + $genSpecFilters['cfields'] = $my['filters']['cfieldsFilter']; + } + + return gen_spec_view($dbHandler, 'testplan', $argsObj->tplan_id, + $argsObj->id, $tsuite_data['name'], $tplan_linked_tcversions, null, + $genSpecFilters, $my['options']); +} + +/** + * get Test Specification data within a Node + * + * using nodeId (that normally is a test suite id) as starting point + * will return subtree that start at nodeId. + * If filters are given, the subtree returned is filtered. + * + * Important Notice regaring keyword filtering + * Keyword filter logic inside this function seems to work ONLY on OR mode. + * Then how the AND mode is implemented ? + * Filter for test case id is used, and the test case set has been generated + * applying AND or OR logic (following user's choice). + * Then seems that logic regarding keywords here, may be can be removed + * + * @param integer $masterContainerId + * can be a Test Project Id, or a Test Plan id. + * is used only if keyword id filter has been specified + * to get all keyword defined on masterContainer. + * + * @param integer $nodeId + * node that will be root of the view we want to build. + * + * @param string $specViewType: + * type of view requested + * + * @param array $filters + * filters['keyword_id']: array of keywords + * filters['tcase_id']: + * filters['execution_type']: + * filters['importance']: + * filters['cfields']: + * filters['tcase_name']: + * + * @param string $type: + * request selected for create tree + * + * @return array map with view (test cases subtree) + * + * + */ +function getTestSpecFromNode(&$dbHandler, &$tcaseMgr, &$linkedItems, + $masterContainerId, $nodeId, $specViewType, $filters, $type = 'spec_order') +{ + $applyFilters = false; + $testCaseSet = null; + $tck_map = null; + $tobj_mgr = new testproject($dbHandler); + + $opt = array( + 'order_cfg' => array( + "type" => $type + ) + ); + if ($specViewType == 'testplan') { + $opt['order_cfg'] = array( + "type" => 'exec_order', + 'tplan_id' => $masterContainerId + ); + } + $test_spec = $tobj_mgr->get_subtree($nodeId, null, $opt); + + $key2loop = null; + + $nullCheckFilter = array( + 'tcase_id' => false, + 'importance' => false, + 'tcase_name' => false, + 'cfields' => false, + 'status' => false + ); + + $zeroNullCheckFilter = array( + 'execution_type' => false + ); + $useFilter = array( + 'keyword_id' => false, + 'platform_id' => false + ) + $nullCheckFilter + $zeroNullCheckFilter; + + $applyFilters = false; + + foreach ($nullCheckFilter as $key => $value) { + $useFilter[$key] = ! is_null($filters[$key]); + $applyFilters = $applyFilters || $useFilter[$key]; + } + + // more specif analisys + if (! empty($filters['status'][0])) { + $useFilter['status'] = $filters['status'][0]; + $applyFilters = true; + $filtersByValue['status'] = array_flip((array) $filters['status']); + } + + if (! empty($filters['importance'][0])) { + $useFilter['importance'] = $filters['importance'][0]; + $applyFilters = true; + $filtersByValue['importance'] = array_flip( + (array) $filters['importance']); + } + + foreach ($zeroNullCheckFilter as $key => $value) { + // need to check for > 0, because for some items 0 has same meaning that null -> no filter + $useFilter[$key] = (! is_null($filters[$key]) && ($filters[$key] > 0)); + $applyFilters = $applyFilters || $useFilter[$key]; + } + + if ($useFilter['tcase_id']) { + $testCaseSet = is_array($filters['tcase_id']) ? $filters['tcase_id'] : array( + $filters['tcase_id'] + ); + } + + if (! is_array($filters['keyword_id'])) { + $filters['keyword_id'] = array( + $filters['keyword_id'] + ); + } + + if (! empty($filters['keyword_id'][0])) { + $useFilter['keyword_id'] = $filters['keyword_id'][0]; + $applyFilters = true; + switch ($specViewType) { + case 'testplan': + $tobj_mgr = new testplan($dbHandler); + $tck_map = $tobj_mgr->getKeywordsLinkedTCVersions( + $masterContainerId, $filters['keyword_id']); + break; + + default: + $tck_map = $tobj_mgr->getKeywordsLatestTCV($masterContainerId, + $filters['keyword_id']); + break; + } + } + + $tcpl_map = null; + if (! empty($filters['platform_id'][0])) { + $useFilter['platforms'] = $filters['platform_id'][0]; + $applyFilters = true; + switch ($specViewType) { + case 'testplan': + $tobj_mgr = new testplan($dbHandler); + $tcpl_map = $tobj_mgr->getPlatformsLinkedTCVersions( + $masterContainerId, $filters['platforms']); + break; + + default: + $tcpl_map = $tobj_mgr->getPlatformsLatestTCV($masterContainerId, + $filters['platforms']); + break; + } + } + + if ($applyFilters) { + $key2loop = array_keys($test_spec); + + // first step: generate list of TEST CASE NODES + $itemSet = null; + foreach ($key2loop as $key) { + if ($test_spec[$key]['node_type_id'] == + $filters['tcase_node_type_id']) { + $itemSet[$test_spec[$key]['id']] = $key; + } + } + $itemKeys = $itemSet; + + foreach ($itemKeys as $key => $tspecKey) { + // case insensitive search + if (($useFilter['keyword_id'] && + ! isset($tck_map[$test_spec[$tspecKey]['id']])) || + ($useFilter['platforms'] && + ! isset($tcpl_map[$test_spec[$tspecKey]['id']])) || + ($useFilter['tcase_id'] && + ! in_array($test_spec[$tspecKey]['id'], $testCaseSet)) || + ($useFilter['tcase_name'] && + (stripos($test_spec[$tspecKey]['name'], $filters['tcase_name']) === + false))) { + $test_spec[$tspecKey] = null; + unset($itemSet[$key]); + } + } + + if (! empty($itemSet) && + ($useFilter['execution_type'] || $useFilter['importance'] || + $useFilter['cfields'] || $useFilter['status'])) { + // This logic can have some Potential Performance ISSUE - 20120619 - fman + $targetSet = array_keys($itemSet); + $options = ($specViewType == 'testPlanLinking') ? array( + 'access_key' => 'testcase_id' + ) : null; + + $getFilters = $useFilter['cfields'] ? array( + 'cfields' => $filters['cfields'] + ) : null; + $s2h = config_get('tplanDesign')->hideTestCaseWithStatusIn; + if (! is_null($s2h)) { + $getFilters['status'] = array( + 'not_in' => array_keys($s2h) + ); + } + + $tcversionSet = $tcaseMgr->get_last_active_version($targetSet, + $getFilters, $options); + + switch ($specViewType) { + case 'testPlanLinking': + // We need to analise linked items and spec + foreach ($targetSet as $key) { + $targetTestCase = isset($tcversionSet[$key]) ? $tcversionSet[$key]['testcase_id'] : null; + + if (is_null($targetTestCase)) { + $test_spec[$itemSet[$key]] = null; + $item = null; + } else { + if (isset($linkedItems[$targetTestCase])) { + $item = current($linkedItems[$targetTestCase]); + } else { + // hmmm, does not understand this logic. + $item = null; + if (isset($test_spec[$itemSet[$targetTestCase]])) { + $item = $tcversionSet[$targetTestCase]; + } + } + } + + if (! is_null($item) && $useFilter['execution_type'] && + ($item['execution_type'] != + $filters['execution_type']) || + $useFilter['importance'] && + (! isset( + $filtersByValue['importance'][$item['importance']])) || + $useFilter['status'] && + (! isset($filtersByValue['status'][$item['status']]))) { + $tspecKey = $itemSet[$targetTestCase]; + $test_spec[$tspecKey] = null; + } + } + break; + + default: + $tcvidSet = array_keys($tcversionSet); + foreach ($tcvidSet as $zx) { + $tcidSet[$tcversionSet[$zx]['testcase_id']] = $zx; + } + + $options = null; + $doFilter = true; + $allowedSet = null; + $emptySet = false; + + // a first clean will not be bad, ok may be we are going to do more + // loops that needed, but think logic will be more clear + // (at least @20130426 is a little bit confusing ;) ) + foreach ($targetSet as $key) { + if (! isset($tcidSet[$key])) { + $test_spec[$itemSet[$key]] = null; + } + } + + if ($useFilter['execution_type']) { + // Potential Performance ISSUE + $allowedSet = $tcaseMgr->filter_tcversions_by_exec_type( + $tcvidSet, $filters['execution_type'], $options); + + $doFilter = (! empty($allowedSet)); + $emptySet = ! $doFilter; + } + + if ((! $emptySet) && $doFilter) { + // Add another filter on cascade mode + // @20130426 - seems we are applying TWICE the Custom Fields Filter + // because we have applied it before on: + // $tcversionSet = $tcaseMgr->get_last_active_version() + if ($useFilter['cfields']) { + $filteredSet = (! empty($allowedSet)) ? array_keys( + $allowedSet) : $tcvidSet; + $dummySet = $tcaseMgr->filter_tcversions_by_cfields( + $filteredSet, $filters['cfields'], $options); + + // transform to make compatible with filter_tcversions_by_exec_type() return type + if (! empty($dummySet)) { + $allowedSet = null; + $work2do = array_keys($dummySet); + foreach ($work2do as $wkey) { + $allowedSet[$wkey] = $dummySet[$wkey][0]; + } + unset($dummySet); + } + } + $doFilter = (! empty($allowedSet)); + $emptySet = ! $doFilter; + } + + if ($doFilter && ! empty($allowedSet)) { + foreach ($allowedSet as $value) { + $tspecKey = $itemSet[$value['testcase_id']]; + $test_spec[$tspecKey]['version'] = $value['version']; + } + reset($allowedSet); + } + + if ($emptySet) { + $test_spec = null; + } + + $setToRemove = array_diff_key($tcversionSet, $allowedSet); + if (! empty($setToRemove)) { + foreach ($setToRemove as $value) { + $tspecKey = $itemSet[$value['testcase_id']]; + $test_spec[$tspecKey] = null; + } + } + break; + } + } + } + return $test_spec; +} + +/** + * remove empty Test Suites + * + * @param array $testSuiteSet + * reference to set to analyse and clean. + * @param tree $treeMgr + * reference to object + * @param array $pruneUnlinkedTcversions + * useful when working on test plans + * @param array $nodeTypes + * hash key: node type description, value: code + */ +function removeEmptyTestSuites(&$testSuiteSet, &$treeMgr, + $pruneUnlinkedTcversions, $nodeTypes) +{ + foreach ($testSuiteSet as $key => $value) { + // We will remove test suites that meet the empty conditions: + // - do not contain other test suites OR + // - do not contain test cases + if (is_null($value)) { + unset($testSuiteSet[$key]); + } elseif ($pruneUnlinkedTcversions && + (isset($value['testcase_qty']) && $value['testcase_qty'] > 0)) { + // only linked tcversion must be returned, but this analisys must be done + // for test suites that has test cases. + if (isset($value['linked_testcase_qty']) && + $value['linked_testcase_qty'] == 0) { + unset($testSuiteSet[$key]); + } else { + // Only if test suite has children test cases we need to understand + // if they are linked or not + if (! empty($value['testcases'])) { + foreach ($value['testcases'] as $skey => $svalue) { + if ($svalue['linked_version_id'] == 0) { + unset($testSuiteSet[$key]['testcases'][$skey]); + } + } + } + } + } else { + // list of children test suites if useful on smarty template, in order + // to draw nested div. + $tsuite_id = $value['testsuite']['id']; + $testSuiteSet[$key]['children_testsuites'] = $treeMgr->get_subtree_list( + $tsuite_id, $nodeTypes['testsuite']); + + if ($value['testcase_qty'] == 0 && + $testSuiteSet[$key]['children_testsuites'] == '') { + unset($testSuiteSet[$key]); + } + } + } +} + +/** + */ +function removeEmptyBranches(&$testSuiteSet, &$tsuiteTestCaseQty) +{ + foreach ($testSuiteSet as $key => $elem) { + $tsuite_id = $elem['testsuite']['id']; + + if (! isset($tsuiteTestCaseQty[$tsuite_id])) { + $tsuiteTestCaseQty[$tsuite_id] = 0; + } + + if (isset($elem['children_testsuites']) && + $elem['children_testsuites'] != '') { + $children = explode(',', $elem['children_testsuites']); + foreach ($children as $access_id) { + if (isset($tsuiteTestCaseQty[$access_id])) { + $tsuiteTestCaseQty[$tsuite_id] += $tsuiteTestCaseQty[$access_id]; + } + } + } + + if ($tsuiteTestCaseQty[$tsuite_id] == 0) { + unset($testSuiteSet[$key]); + } + } +} + +// function end + +/** + * + * @param + * array &$testSuiteSet: changes will be done to this array to add custom fields info. + * Custom field info will be indexed by platform id + * @param integer $tprojectId + * @param + * testcase &$tcaseMgr reference to testCase class instance + * @internal revisions + * 20100119 - franciscom - start fixing missing platform refactoring + * + */ +function addCustomFieldsToView(&$testSuiteSet, $tprojectId, &$tcaseMgr) +{ + // Important: + // testplan_tcversions.id value, that is used to link to manage custom fields that are used + // during testplan_design is present on key 'feature_id' (only is linked_version_id != 0) + foreach ($testSuiteSet as $key => $value) { + if (! is_null($value) && isset($value['testcases']) && + ! empty($value['testcases'])) { + foreach ($value['testcases'] as $skey => $svalue) { + if (($linked_version_id = $svalue['linked_version_id']) > 0) { + $platformSet = array_keys($svalue['feature_id']); + foreach ($platformSet as $platform_id) { + $testSuiteSet[$key]['testcases'][$skey]['custom_fields'][$platform_id] = ''; + if ($linked_version_id != 0) { + $cf_name_suffix = "_" . + $svalue['feature_id'][$platform_id]; + $cf_map = $tcaseMgr->html_table_of_custom_field_inputs( + $linked_version_id, null, 'testplan_design', + $cf_name_suffix, + $svalue['feature_id'][$platform_id], null, + $tprojectId); + $testSuiteSet[$key]['testcases'][$skey]['custom_fields'][$platform_id] = $cf_map; + } + } + } + } + } + } +} + +/** + * Developer Notice + * key 'user_id' is JUST initialized + */ +function buildSkeleton($id, $name, $config, &$test_spec, &$platforms) +{ + $parent_idx = - 1; + $pivot_tsuite = $test_spec[0]; + $level = array(); + $tcase_memory = null; + + $node_types = $config['node_types']; + $write_status = $config['write_status']; + $is_uncovered_view_type = $config['is_uncovered_view_type']; + + $out = array(); + $idx = 0; + $a_tcid = array(); + $a_tsuite_idx = array(); + $hash_id_pos[$id] = $idx; + $out[$idx]['testsuite'] = array( + 'id' => $id, + 'name' => $name + ); + $out[$idx]['testcases'] = array(); + $out[$idx]['write_buttons'] = 'no'; + $out[$idx]['testcase_qty'] = 0; + $out[$idx]['level'] = 1; + $out[$idx]['linked_testcase_qty'] = 0; + $out[$idx]['linked_ts'] = null; + $out[$idx]['linked_by'] = 0; + $out[$idx]['priority'] = 0; + + $idx ++; + $tsuite_tcqty = array( + $id => 0 + ); + + foreach ($test_spec as $current) { + if (is_null($current)) { + continue; + } + // In some situations during processing of testcase, a change of parent can + // exists, then we need to update $tsuite_tcqty + if ($node_types[$current['node_type_id']] == "testcase") { + $tc_id = $current['id']; + $parent_idx = $hash_id_pos[$current['parent_id']]; + $a_tsuite_idx[$tc_id] = $parent_idx; + $out[$parent_idx]['testcases'][$tc_id] = array( + 'id' => $tc_id, + 'name' => $current['name'] + ); + + // Reference to make code reading more human friendly + $outRef = &$out[$parent_idx]['testcases'][$tc_id]; + + if ($is_uncovered_view_type) { + // @TODO understand impacts of platforms + $outRef['external_id'] = $test_spec[$tc_id]['external_id']; + } else { + $out[$parent_idx]['write_buttons'] = $write_status; + $out[$parent_idx]['linked_testcase_qty'] = 0; + + $outRef['tcversions'] = array(); + $outRef['tcversions_active_status'] = array(); + $outRef['tcversions_execution_type'] = array(); + $outRef['tcversions_qty'] = 0; + $outRef['linked_version_id'] = 0; + $outRef['executed'] = null; + + // useful for tc_exec_assignment.php + $outRef['platforms'] = $platforms; + $outRef['feature_id'] = null; + $outRef['linked_by'] = null; + $outRef['linked_ts'] = null; + $outRef['priority'] = 0; + $outRef['user_id'] = array(); + } + $out[$parent_idx]['testcase_qty'] ++; + $a_tcid[] = $current['id']; + + // This piece is needed initialize in right way $tsuite_tcqty + // in this kind of situation, for SubSuite2 + // + // Tsuite 1 + // |__ SubSuite1 + // | |__TCX1 + // | |__TCX2 + // | + // |__ SubSuite2 + // | |__TCY1 + // | |__TCY2 + // | + // |__ TCZ1 + // + if ($tcase_memory['parent_id'] != $current['parent_id']) { + if (! is_null($tcase_memory)) { + $pidx = $hash_id_pos[$tcase_memory['parent_id']]; + $xdx = $out[$pidx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$pidx]['testcase_qty']; + } + $tcase_memory = $current; + } + } else { + // This node is a Test Suite + $the_level = 0; + if ($parent_idx >= 0) { + $xdx = $out[$parent_idx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$parent_idx]['testcase_qty']; + } + + if ($pivot_tsuite['parent_id'] != $current['parent_id']) { + if ($pivot_tsuite['id'] == $current['parent_id']) { + $the_level ++; + $level[$current['parent_id']] = $the_level; + } else { + if (isset($level[$current['parent_id']])) { + $the_level = $level[$current['parent_id']]; + } + } + } + $out[$idx]['testsuite'] = array( + 'id' => $current['id'], + 'name' => $current['name'] + ); + $out[$idx]['testcases'] = array(); + $out[$idx]['testcase_qty'] = 0; + $out[$idx]['linked_testcase_qty'] = 0; + $out[$idx]['level'] = $the_level; + $out[$idx]['write_buttons'] = 'no'; + $hash_id_pos[$current['id']] = $idx; + $idx ++; + + // update pivot. + $level[$current['parent_id']] = $the_level; + $pivot_tsuite = $current; + } + } // foreach + + // Update after finished loop + if ($parent_idx >= 0) { + $xdx = $out[$parent_idx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$parent_idx]['testcase_qty']; + } + + unset($tcase_memory); + $tsuite_tcqty[$id] = $out[$hash_id_pos[$id]]['testcase_qty']; + return array( + $a_tcid, + $a_tsuite_idx, + $tsuite_tcqty, + $out + ); +} + +/** + * VERY IMPORTANT NOTICE + * + * You can be a little bit confused regarding What will be returned on 'testcases' =>[]['tcversions'] + * You will see JUST ON tcversion with active status = 0, ONLY if the version is LINKED to test plan. + * Otherwise you will get ONLY ACTIVE test case versions. + * + * + * @internal revisions: + */ +function addLinkedVersionsInfo($testCaseVersionSet, $a_tsuite_idx, &$out, + &$linked_items, $opt = null) +{ + $my['opt'] = array( + 'useOptionalArrayFields' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $tcStatus2exclude = config_get('tplanDesign')->hideTestCaseWithStatusIn; + $optionalIntegerFields = array( + 'feature_id', + 'linked_by' + ); + $optionalArrayFields = array( + 'user_id' + ); + + $result = array( + 'spec_view' => array(), + 'num_tc' => 0, + 'has_linked_items' => 0 + ); + $pivot_id = - 1; + $firstElemIDX = key($out); + + foreach ($testCaseVersionSet as $testCase) { + $tc_id = $testCase['testcase_id']; + + // Needed when having multiple platforms + if ($pivot_id != $tc_id) { + $pivot_id = $tc_id; + $result['num_tc'] ++; + } + $parent_idx = $a_tsuite_idx[$tc_id]; + + // Reference to make code reading more human friendly + $outRef = &$out[$parent_idx]['testcases'][$tc_id]; + + // Is not clear (need explanation) why we process in this part ONLY ACTIVE + // also we need to explain !is_null($out[$parent_idx]) + // + if ($testCase['active'] == 1 && + ! isset($tcStatus2exclude[$testCase['status']]) && + ! is_null($out[$parent_idx])) { + + if (! isset($outRef['execution_order'])) { + // Doing this I will set order for test cases that still are not linked. + // But Because I loop over all versions (linked and not) if I always write, + // will overwrite right execution order of linked tcversion. + // + // N.B.: + // As suggested by Martin Havlat order will be set to external_id * 10 + $outRef['execution_order'] = $testCase['node_order'] * 10; + } + $outRef['tcversions'][$testCase['id']] = $testCase['version']; + $outRef['tcversions_active_status'][$testCase['id']] = 1; + $outRef['external_id'] = $testCase['tc_external_id']; + $outRef['tcversions_execution_type'][$testCase['id']] = $testCase['execution_type']; + $outRef['importance'][$testCase['id']] = $testCase['importance']; + $outRef['status'][$testCase['id']] = $testCase['status']; + + if (! isset($outRef['tcversions_qty'])) { + $outRef['tcversions_qty'] = 0; + } + $outRef['tcversions_qty'] ++; + } + + if (! is_null($linked_items)) { + foreach ($linked_items as $linked_testcase) { + $target = current($linked_testcase); + if (($target['tc_id'] == $testCase['testcase_id']) && + ($target['tcversion_id'] == $testCase['id'])) { + // This can be written only once no matter platform qty + if (! isset($outRef['tcversions'][$testCase['id']])) { + $outRef['tcversions'][$testCase['id']] = $testCase['version']; + $outRef['tcversions_active_status'][$testCase['id']] = 0; + $outRef['external_id'] = $testCase['tc_external_id']; + $outRef['tcversions_execution_type'][$testCase['id']] = $testCase['execution_type']; + $outRef['importance'][$testCase['id']] = $testCase['importance']; + } + $outRef['execution_order'] = isset( + $target['execution_order']) ? $target['execution_order'] : 0; + if (isset($target['priority'])) { + $outRef['priority'] = priority_to_level( + $target['priority']); + } + $outRef['linked_version_id'] = $testCase['id']; + $out[$parent_idx]['write_buttons'] = 'yes'; + $out[$parent_idx]['linked_testcase_qty'] ++; + $result['has_linked_items'] = 1; + + foreach ($linked_testcase as $item) { + // 20120714 - franciscom - need t check if this info is needed. + if (isset($item['executed']) && + (intval($item['executed']) > 0) || + isset($item['exec_id']) && + (intval($item['exec_id']) > 0)) { + $outRef['executed'][$item['platform_id']] = 'yes'; + } + + if (isset($item['linked_ts'])) { + $outRef['linked_ts'][$item['platform_id']] = $item['linked_ts']; + } + + foreach ($optionalIntegerFields as $fieldKey) { + if (isset($item[$fieldKey])) { + $outRef[$fieldKey][$item['platform_id']] = intval( + $item[$fieldKey]); + } + } + + // this logic has been created to cope with multiple tester assignment + if ($my['opt']['useOptionalArrayFields']) { + + foreach ($optionalArrayFields as $fieldKey) { + // We have issues when no user is assigned because is + if (is_array($item[$fieldKey])) { + // this seems to be the path we follow when trying to work on test suite + $outRef[$fieldKey][$item['platform_id']] = $item[$fieldKey]; + } else { + // this seems to be the path we follow when trying to work on SINGLE test case + $outRef[$fieldKey][$item['platform_id']][] = intval( + $item[$fieldKey]); + } + } + } + } + break; + } + } + } + } // foreach + + // Again DAMM 0!! + if (! is_null($out[$firstElemIDX])) { + $result['spec_view'] = $out; + } + return $result; +} + +/** + * changed return type when there are no platforms + */ +function getPlatforms($db, $tproject_id, $testplan_id) +{ + $platform_mgr = new tlPlatform($db, $tproject_id); + + if (is_null($testplan_id)) { + $opx = array( + 'enable_on_design' => null, + 'enable_on_execution' => true + ); + $platforms = $platform_mgr->getAll($opx); + } else { + $platforms = $platform_mgr->getLinkedToTestplan($testplan_id); + } + + if (is_null($platforms)) { + // need to create fake data for platform 0 in order + // to have only simple logic + // $platforms= array( 'id' => 0, 'name' => ''); + $platforms[0] = array( + 'id' => 0, + 'name' => '' + ); + } + return $platforms; +} + +/** + */ +function getFilteredSpecViewFlat(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, + $filters = null, $options = null) +{ + $tprojectMgr = new testproject($dbHandler); + $tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $argsObj->id); + + $my = array(); // some sort of local scope + $my['filters'] = array( + 'keywordsFilter' => null, + 'testcaseFilter' => null, + 'assignedToFilter' => null, + 'executionTypeFilter' => null, + 'platformsFilter' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'write_button_only_if_linked' => 1, + 'prune_unlinked_tcversions' => 1 + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // This does filter on keywords ALWAYS in OR mode. + $tplan_linked_tcversions = getFilteredLinkedVersions($dbHandler, $argsObj, + $tplanMgr, $tcaseMgr, $options); + + // With these pieces we implement the AND type of keyword filter. + $testCaseSet = null; + $tryNextFilter = true; + $filterApplied = false; + if (! is_null($my['filters']['keywordsFilter']) && + ! is_null($my['filters']['keywordsFilter']->items)) { + $keywordsTestCases = $tprojectMgr->getKeywordsLatestTCV( + $argsObj->tproject_id, $my['filters']['keywordsFilter']->items, + $my['filters']['keywordsFilter']->type); + + $testCaseSet = array_keys((array) $keywordsTestCases); + $tryNextFilter = ! is_null($testCaseSet); + $filterApplied = true; + } + + if ($tryNextFilter && ! is_null($my['filters']['testcaseFilter'])) { + $filterApplied = true; + if (is_null($testCaseSet)) { + $testCaseSet = $my['filters']['testcaseFilter']; + } else { + // wrong use of array() instead of (array) + $testCaseSet = array_intersect($testCaseSet, + (array) $my['filters']['testcaseFilter']); + } + } + + // when $testCaseSet is null because we have applied filters + // => we do not need to call other + // method because we know we are going to get NOTHING + $testCaseSet = ! is_null($testCaseSet) ? array_combine($testCaseSet, + $testCaseSet) : null; + if ($filterApplied && is_null($testCaseSet)) { + return null; + } + + $genSpecFilters = array( + 'keywords' => $argsObj->keyword_id, + 'testcases' => $testCaseSet, + 'exec_type' => $my['filters']['executionTypeFilter'], + 'cfields' => null, + 'platforms' => $argsObj->platform_id + ); + + if (isset($my['filters']['cfieldsFilter'])) { + $genSpecFilters['cfields'] = $my['filters']['cfieldsFilter']; + } + + return genSpecViewFlat($dbHandler, 'testplan', $argsObj->tplan_id, + $argsObj->id, $tsuite_data['name'], $tplan_linked_tcversions, null, + $genSpecFilters, $my['options']); +} + +/** + */ +function genSpecViewFlat(&$db, $specViewType, $tobj_id, $id, $name, + &$linked_items, $map_node_tccount, $filters = null, $options = null, + $tproject_id = null) +{ + $spec_view_type = is_null($specViewType) ? 'testproject' : $specViewType; + + $out = array(); + $result = array( + 'spec_view' => array(), + 'num_tc' => 0, + 'has_linked_items' => 0 + ); + + $my = array(); + $my['options'] = array( + 'write_button_only_if_linked' => 0, + 'prune_unlinked_tcversions' => 0, + 'add_custom_fields' => 0 + ) + (array) $options; + + $my['filters'] = array( + 'keywords' => 0, + 'testcases' => null, + 'exec_type' => null, + 'importance' => null, + 'cfields' => null + ); + + foreach ($my as $key => $settings) { + if (! is_null($$key) && is_array($$key)) { + $my[$key] = array_merge($my[$key], $$key); + } + } + + $write_status = $my['options']['write_button_only_if_linked'] ? 'no' : 'yes'; + $is_tplan_view_type = $spec_view_type == 'testplan' ? 1 : 0; + $is_uncovered_view_type = ($spec_view_type == 'uncoveredtestcases') ? 1 : 0; + + if (! $is_tplan_view_type && is_null($tproject_id)) { + $tproject_id = $tobj_id; + } + + $testplan_id = $is_tplan_view_type ? $tobj_id : null; + + $tcaseMgr = new testcase($db); + $hash_descr_id = $tcaseMgr->tree_manager->get_available_node_types(); + $hash_id_descr = array_flip($hash_descr_id); + + $key2map = array( + 'keyword_id' => 'keywords', + 'tcase_id' => 'testcases', + 'execution_type' => 'exec_type', + 'importance' => 'importance', + 'cfields' => 'cfields', + 'tcase_name' => 'tcase_name', + 'status' => 'workflow_status' + ); + + $pfFilters = array( + 'tcase_node_type_id' => $hash_descr_id['testcase'] + ); + foreach ($key2map as $tk => $fk) { + $pfFilters[$tk] = isset($my['filters'][$fk]) ? $my['filters'][$fk] : null; + } + + $test_spec = getTestSpecFromNode($db, $tcaseMgr, $linked_items, $tobj_id, + $id, $spec_view_type, $pfFilters); + + $platforms = getPlatforms($db, $tproject_id, $testplan_id); + $a_tcid = array(); + $a_tsuite_idx = array(); + if (count($test_spec)) { + $cfg = array( + 'node_types' => $hash_id_descr, + 'write_status' => $write_status, + 'is_uncovered_view_type' => $is_uncovered_view_type + ); + + // $a_tsuite_idx + // key: test case version id + // value: index inside $out, where parent test suite of test case version id is located. + // + list ($a_tcid, $a_tsuite_idx, , $out) = buildSkeletonFlat($id, $name, + $cfg, $test_spec, $platforms); + } + + // Collect information related to linked testcase versions + // DAMMED 0!!!! + $firtsElemIDX = key($out); + if (! empty($out) && ! is_null($out[$firtsElemIDX]) && count($a_tcid)) { + $optGBI = array( + 'output' => 'full_without_users', + 'order_by' => " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC " + ); + + if (isset($options['onlyLatestTCV']) && $options['onlyLatestTCV']) { + $tcaseVersionSet = $tcaseMgr->getLTCVInfo($a_tcid); + } else { + $whatSet = testcase::ALL_VERSIONS; + $tcaseVersionSet = $tcaseMgr->get_by_id($a_tcid, $whatSet, null, + $optGBI); + } + $result = addLinkedVersionsInfo($tcaseVersionSet, $a_tsuite_idx, $out, + $linked_items, $options); + } + + if (count($result['spec_view']) > 0 && $my['options']['add_custom_fields']) { + addCustomFieldsToView($result['spec_view'], $tproject_id, $tcaseMgr); + } + + // with array_values() we reindex array to avoid "holes" + $result['spec_view'] = array_values($result['spec_view']); + return $result; +} + +/** + * Developer Notice + * key 'user_id' is JUST initialized + */ +function buildSkeletonFlat($branchRootID, $name, $config, &$test_spec, + &$platforms) +{ + $parent_idx = - 1; + $pivot_tsuite = $test_spec[0]; + $levelSet = array(); + $tcase_memory = null; + + $node_types = $config['node_types']; + $write_status = $config['write_status']; + $is_uncovered_view_type = $config['is_uncovered_view_type']; + + $out = array(); + $a_tcid = array(); + $a_tsuite_idx = array(); + + $rootIDX = 0; + $hash_id_pos[$branchRootID] = $rootIDX; + $out[$rootIDX]['testsuite'] = array( + 'id' => $branchRootID, + 'name' => $name + ); + $out[$rootIDX]['testcases'] = array(); + $out[$rootIDX]['write_buttons'] = 'no'; + $out[$rootIDX]['testcase_qty'] = 0; + $out[$rootIDX]['level'] = 1; + $out[$rootIDX]['linked_testcase_qty'] = 0; + $out[$rootIDX]['linked_ts'] = null; + $out[$rootIDX]['linked_by'] = 0; + $out[$rootIDX]['priority'] = 0; + + $nameAtLevel[$out[0]['level']] = $name; + + $level = $out[0]['level'] + 1; + $idx = 0; + $idx ++; + $tsuite_tcqty = array( + $branchRootID => 0 + ); + + foreach ($test_spec as $current) { + // it will be interesting to understand if this can happen due to filtering + if (is_null($current)) { + continue; + } + + // pivot is updated each time I find a Test Suite. + switch ($node_types[$current['node_type_id']]) { + case 'testsuite': + // parent_idx is setted ONLY when a test case is found + // this logic is used just to have test case count inside test suite. + if ($parent_idx >= 0) { + $xdx = $out[$parent_idx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$parent_idx]['testcase_qty']; + } + + if ($pivot_tsuite['parent_id'] != $current['parent_id']) { + if ($pivot_tsuite['id'] == $current['parent_id']) { + $level ++; + $levelSet[$current['parent_id']] = $level; + } else { + $level = $levelSet[$current['parent_id']]; + } + $nameAtLevel[$level] = $current['name']; + } else { + $nameAtLevel[$level] = $current['name']; + } + + $whoiam = ''; + for ($ldx = $out[$rootIDX]['level']; $ldx <= $level; $ldx ++) { + $whoiam .= $nameAtLevel[$ldx] . '/'; + } + + $out[$idx]['testsuite'] = array( + 'id' => $current['id'], + 'name' => $whoiam + ); + $out[$idx]['testcases'] = array(); + $out[$idx]['testcase_qty'] = 0; + $out[$idx]['linked_testcase_qty'] = 0; + $out[$idx]['level'] = $level; + $out[$idx]['write_buttons'] = 'no'; + $hash_id_pos[$current['id']] = $idx; + $idx ++; + + // update pivot. + $levelSet[$current['parent_id']] = $level; + $pivot_tsuite = $current; + break; + + case 'testcase': + break; + } + + // In some situations during processing of testcase, a change of parent can + // exists, then we need to update $tsuite_tcqty + if ($node_types[$current['node_type_id']] == "testcase") { + $tc_id = $current['id']; + $parent_idx = $hash_id_pos[$current['parent_id']]; + $a_tsuite_idx[$tc_id] = $parent_idx; + $out[$parent_idx]['testcases'][$tc_id] = array( + 'id' => $tc_id, + 'name' => $current['name'] + ); + + // Reference to make code reading more human friendly + $outRef = &$out[$parent_idx]['testcases'][$tc_id]; + + if ($is_uncovered_view_type) { + // @TODO understand impacts of platforms + $outRef['external_id'] = $test_spec[$tc_id]['external_id']; + } else { + $out[$parent_idx]['write_buttons'] = $write_status; + $out[$parent_idx]['linked_testcase_qty'] = 0; + + $outRef['tcversions'] = array(); + $outRef['tcversions_active_status'] = array(); + $outRef['tcversions_execution_type'] = array(); + $outRef['tcversions_qty'] = 0; + $outRef['linked_version_id'] = 0; + $outRef['executed'] = null; + + // useful for tc_exec_assignment.php + $outRef['platforms'] = $platforms; + $outRef['feature_id'] = null; + $outRef['linked_by'] = null; + $outRef['linked_ts'] = null; + $outRef['priority'] = 0; + $outRef['user_id'] = array(); + } + $out[$parent_idx]['testcase_qty'] ++; + $a_tcid[] = $current['id']; + + // This piece is needed initialize in right way $tsuite_tcqty + // in this kind of situation, for SubSuite2 + // + // Tsuite 1 + // |__ SubSuite1 + // | |__TCX1 + // | |__TCX2 + // | + // |__ SubSuite2 + // | |__TCY1 + // | |__TCY2 + // | + // |__ TCZ1 + // + // + if ($tcase_memory['parent_id'] != $current['parent_id']) { + if (! is_null($tcase_memory)) { + $pidx = $hash_id_pos[$tcase_memory['parent_id']]; + $xdx = $out[$pidx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$pidx]['testcase_qty']; + } + $tcase_memory = $current; + } + } + } // foreach + + // Update after finished loop + if ($parent_idx >= 0) { + $xdx = $out[$parent_idx]['testsuite']['id']; + $tsuite_tcqty[$xdx] = $out[$parent_idx]['testcase_qty']; + } + + unset($tcase_memory); + $tsuite_tcqty[$branchRootID] = $out[$hash_id_pos[$branchRootID]]['testcase_qty']; + + // Clean up + $loop2do = count($out); + $toUnset = null; + for ($lzx = 0; $lzx < $loop2do; $lzx ++) { + if (count($out[$lzx]['testcases']) == 0) { + $toUnset[$lzx] = $lzx; + } + } + if (! is_null($toUnset)) { + foreach ($toUnset as $kill) { + unset($out[$kill]); + } + } + return array( + $a_tcid, + $a_tsuite_idx, + $tsuite_tcqty, + $out + ); } diff --git a/lib/functions/string_api.php b/lib/functions/string_api.php index 44f4720e88..9ce43cd6f2 100644 --- a/lib/functions/string_api.php +++ b/lib/functions/string_api.php @@ -1,543 +1,528 @@ - - **/ -function string_preserve_spaces_at_bol( $p_string ) -{ - $lines = explode( "\n", $p_string ); - $line_count = count( $lines ); - for ( $i = 0; $i < $line_count; $i++ ) { - $count = 0; - $prefix = ''; - - $t_char = substr( $lines[$i], $count, 1 ); - $spaces = 0; - while ( ( $t_char == ' ' ) || ( $t_char == "\t" ) ) { - if ( $t_char == ' ' ) - $spaces++; - else - $spaces += 4; // 1 tab = 4 spaces, can be configurable. - - $count++; - $t_char = substr( $lines[$i], $count, 1 ); - } - - for ( $j = 0; $j < $spaces; $j++ ) { - $prefix .= ' '; - } - - $lines[$i] = $prefix . substr( $lines[$i], $count ); - } - return implode( "\n", $lines ); -} - - -/** - * Prepare a string to be printed without being broken into multiple lines - **/ -function string_no_break( $p_string ) { - if ( strpos( $p_string, ' ' ) !== false ) { - return '' . $p_string . ""; - } else { - return $p_string; - } -} - -/** - * Similar to nl2br, but fixes up a problem where new lines are doubled between < pre > tags. - * additionally, wrap the text an $p_wrap character intervals if the config is set - * - * @author Mantis BT team - */ -function string_nl2br( $p_string, $p_wrap = 100 ) -{ - $p_string = nl2br( $p_string ); - - // fix up eols within
     tags
    -		$pre2 = array();
    -		preg_match_all("/]*?>(.|\n)*?<\/pre>/", $p_string, $pre1);
    -		for ( $x = 0; $x < count($pre1[0]); $x++ ) 
    -		{
    -			$pre2[$x] = preg_replace("/]*?>/", "", $pre1[0][$x]);
    -			// this may want to be replaced by html_entity_decode (or equivalent)
    -			//     if other encoded characters are a problem
    -			$pre2[$x] = preg_replace("/ /", " ", $pre2[$x]);
    -			if ( ON == config_get( 'wrap_in_preformatted_text' ) ) 
    -			{
    -				$pre2[$x] = preg_replace("/([^\n]{".$p_wrap."})(?!<\/pre>)/", "$1\n", $pre2[$x]);
    -			}
    -			$pre1[0][$x] = "/" . preg_quote($pre1[0][$x], "/") . "/";
    -		}
    -
    -		return preg_replace( $pre1[0], $pre2, $p_string );
    -}
    -
    -
    -/** 
    - * Prepare a multiple line string for display to HTML 
    - **/
    -function string_display( $p_string ) 
    -{	
    -	$p_string = string_strip_hrefs( $p_string );
    -	$p_string = string_html_specialchars( $p_string );
    -	$p_string = string_restore_valid_html_tags( $p_string, /* multiline = */ true );
    -	$p_string = string_preserve_spaces_at_bol( $p_string );
    -	$p_string = string_nl2br( $p_string );
    -
    -	return $p_string;
    -}
    -
    -
    -/** Prepare a single line string for display to HTML */
    -function string_display_line( $p_string ) 
    -{
    -	$p_string = string_strip_hrefs( $p_string );
    -	$p_string = string_html_specialchars( $p_string );
    -	$p_string = string_restore_valid_html_tags( $p_string, /* multiline = */ false );
    -	
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * Prepare a string for display to HTML and add href anchors for URLs, emails,
    - * bug references, and cvs references
    - */
    -function string_display_links( $p_string ) 
    -{
    -	$p_string = string_display( $p_string );
    -	$p_string = string_insert_hrefs( $p_string );
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * Prepare a single line string for display to HTML and add href anchors for
    - * URLs, emails, bug references, and cvs references
    - */ 
    -function string_display_line_links( $p_string ) 
    -{
    -	$p_string = string_display_line( $p_string );
    -	$p_string = string_insert_hrefs( $p_string );
    -
    -	return $p_string;
    -}
    -
    -
    -/** Prepare a string for display in rss */
    -function string_rss_links( $p_string ) 
    -{
    -	// rss can not start with   which spaces will be replaced into by string_display().
    -	$t_string = trim( $p_string );
    -
    -	// same steps as string_display_links() without the preservation of spaces since   is undefined in XML.
    -	$t_string = string_strip_hrefs( $t_string );
    -	$t_string = string_html_specialchars( $t_string );
    -	$t_string = string_restore_valid_html_tags( $t_string );
    -	$t_string = string_nl2br( $t_string );
    -	$t_string = string_insert_hrefs( $t_string );
    -	$t_string = string_process_bug_link( $t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true );
    -	$t_string = string_process_bugnote_link( $t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true );
    -	$t_string = string_process_cvs_link( $t_string );
    -	# another escaping to escape the special characters created by the generated links
    -	$t_string = string_html_specialchars( $t_string );
    -
    -	return $t_string;
    -}
    -
    -   
    -/** 
    - * Prepare a string for plain text display in email 
    - **/
    -function string_email( $p_string ) 
    -{
    -	$p_string = string_strip_hrefs( $p_string );
    -	return $p_string;
    -}
    - 
    -  
    -/**  
    - * Prepare a string for plain text display in email and add URLs for bug
    - * links and cvs links
    - */     
    -function string_email_links( $p_string ) {
    -	$p_string = string_email( $p_string );
    -  return $p_string;
    -}
    -
    -
    -/** 
    - * Process a string for display in a textarea box 
    - **/
    -function string_textarea( $p_string ) 
    -{
    -	$p_string = string_html_specialchars( $p_string );
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * Process a string for display in a text box
    - */
    -function string_attribute( $p_string ) 
    -{
    -	$p_string = string_html_specialchars( $p_string );
    -
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * Process a string for inclusion in a URL as a GET parameter 
    - */
    -function string_url( $p_string ) 
    -{
    -	$p_string = rawurlencode( $p_string );
    -
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * validate the url as part of this site before continuing 
    - **/
    -function string_sanitize_url( $p_url ) {
    -
    -	$t_url = strip_tags( urldecode( $p_url ) );
    -	if ( preg_match( '?http(s)*://?', $t_url ) > 0 ) { 
    -		// no embedded addresses
    -		if ( preg_match( '?^' . config_get( 'path' ) . '?', $t_url ) == 0 ) { 
    -			// url is ok if it begins with our path, if not, replace it
    -			$t_url = 'index.php';
    -		}
    -	}
    -	if ( $t_url == '' ) {
    -		$t_url = 'index.php';
    -	}
    -	
    -	// split and encode parameters
    -	if ( strpos( $t_url, '?' ) !== FALSE ) {
    -		list( $t_path, $t_param ) = split( '\?', $t_url, 2 );
    -		if ( $t_param !== "" ) {
    -			$t_vals = array();
    -			parse_str( $t_param, $t_vals );
    -			$t_param = '';
    -			foreach($t_vals as $k => $v) {
    -				if ($t_param != '') {
    -					$t_param .= '&'; 
    -				}
    -				$t_param .= "$k=" . urlencode( strip_tags( urldecode( $v ) ) );
    -			}
    -			return $t_path . '?' . $t_param;
    -		} else {
    -			return $t_path;
    -		}
    -	} else {
    -		return $t_url;
    -	}
    -}
    -	
    -
    -// ----- Tag Processing -------------------------------------------------------
    -
    -/**
    - * Search email addresses and URLs for a few common protocols in the given
    - * string, and replace occurences with href anchors.
    - * @param string $p_string
    - * @return string
    - */
    -function string_insert_hrefs( $p_string ) {
    -	static $s_url_regex = null;
    -	static $s_email_regex = null;
    -	static $s_anchor_regex = '/(]*>.*?<\/a>)/is';
    -
    -	if( !config_get( 'html_make_links' ) ) {
    -		return $p_string;
    -	}
    -
    -	$t_change_quotes = false;
    -	if( ini_get_bool( 'magic_quotes_sybase' ) && function_exists( 'ini_set' ) ) {
    -		$t_change_quotes = true;
    -		ini_set( 'magic_quotes_sybase', false );
    -	}
    -
    -	# Initialize static variables
    -	if ( is_null( $s_url_regex ) ) {
    -		# URL protocol. The regex accepts a small subset from the list of valid
    -		# IANA permanent and provisional schemes defined in
    -		# http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
    -		$t_url_protocol = '(?:https?|s?ftp|file|irc[6s]?|ssh|telnet|nntp|git|svn(?:\+ssh)?|cvs):\/\/';
    -
    -		# %2A notation in url's
    -		$t_url_hex = '%[[:digit:]A-Fa-f]{2}';
    -
    -		# valid set of characters that may occur in url scheme. Note: - should be first (A-F != -AF).
    -		$t_url_valid_chars       = '-_.,!~*\';\/?%^\\\\:@&={\|}+$#[:alnum:]\pL';
    -		$t_url_chars             = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)\[\]])";
    -		$t_url_chars2            = "(?:{$t_url_hex}|[{$t_url_valid_chars}])";
    -		$t_url_chars_in_brackets = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)])";
    -		$t_url_chars_in_parens   = "(?:{$t_url_hex}|[{$t_url_valid_chars}\[\]])";
    -
    -		$t_url_part1 = "{$t_url_chars}";
    -		$t_url_part2 = "(?:\({$t_url_chars_in_parens}*\)|\[{$t_url_chars_in_brackets}*\]|{$t_url_chars2})";
    -
    -		$s_url_regex = "/({$t_url_protocol}({$t_url_part1}*?{$t_url_part2}+))/su";
    -
    -		# e-mail regex
    -		$s_email_regex = substr_replace( email_regex_simple(), '(?:mailto:)?', 1, 0 );
    -	}
    -
    -	# Find any URL in a string and replace it by a clickable link
    -	/*
    -	$t_function = create_function( '$p_match', '
    -		$t_url_href = \'href="\' . rtrim( $p_match[1], \'.\' ) . \'"\';
    -		return "{$p_match[1]} [^]";
    -	' );
    -	$p_string = preg_replace_callback( $s_url_regex, $t_function, $p_string );
    -	if( $t_change_quotes ) {
    -		ini_set( 'magic_quotes_sybase', true );
    -	}*/
    -
    -	# Find any URL in a string and replace it with a clickable link
    -	# From MantisBT 2.25.2
    -	$p_string = preg_replace_callback(
    -		$s_url_regex,
    -		function ( $p_match ) {
    -			$t_url_href = 'href="' . rtrim( $p_match[1], '.' ) . '"';
    -			if( config_get( 'html_make_links' ) == LINKS_NEW_WINDOW ) {
    -				$t_url_target = ' target="_blank"';
    -			} else {
    -				$t_url_target = '';
    -			}
    -			return "{$p_match[1]}";
    -		},
    -		$p_string
    -	);
    -	
    -
    -
    -
    -
    -	# Find any email addresses in the string and replace them with a clickable
    -	# mailto: link, making sure that we skip processing of any existing anchor
    -	# tags, to avoid parts of URLs such as https://user@example.com/ or
    -	# http://user:password@example.com/ to be not treated as an email.
    -	$t_pieces = preg_split( $s_anchor_regex, $p_string, null, PREG_SPLIT_DELIM_CAPTURE );
    -	$p_string = '';
    -	foreach( $t_pieces as $piece ) {
    -		if( preg_match( $s_anchor_regex, $piece ) ) {
    -			$p_string .= $piece;
    -		} else {
    -			$p_string .= preg_replace( $s_email_regex, '\0', $piece );
    -		}
    -	}
    -
    -	return $p_string;
    -}
    -
    -
    -/** 
    - * Detect href anchors in the string and replace them with URLs and email addresses 
    - **/
    -function string_strip_hrefs( $p_string ) 
    -{
    -	# First grab mailto: hrefs.  We don't care whether the URL is actually
    -	# correct - just that it's inside an href attribute.
    -	$p_string = preg_replace( '/]*href="mailto:([^\"]+)"[^\>]*>[^\<]*<\/a>/si',
    -								'\1', $p_string);
    -
    -	# Then grab any other href
    -	$p_string = preg_replace( '/]*href="([^\"]+)"[^\>]*>[^\<]*<\/a>/si',
    -								'\1', $p_string);
    -	return $p_string;
    -}
    -
    -
    -/**
    - * This function looks for text with htmlentities
    - * like <b> and converts is into corresponding
    - * html <b> based on the configuration presets
    - */
    -function string_restore_valid_html_tags( $p_string, $p_multiline = true ) 
    -{
    -	$t_html_valid_tags = config_get( $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line' );
    -
    -	if ( OFF === $t_html_valid_tags || is_blank( $t_html_valid_tags ) ) {
    -		return $p_string;
    -	}
    -
    -	$tags = explode( ',', $t_html_valid_tags );
    -	foreach ($tags as $key => $value) 
    -	{ 
    -    	if ( !is_blank( $value ) ) {
    -        	$tags[$key] = trim($value); 
    -        }
    -    }
    -    $tags = implode( '|', $tags);
    -
    -	$p_string = preg_replace( '/<(' . $tags . ')\s*>/ui', '<\\1>', $p_string );
    -	$p_string = preg_replace( '/<\/(' . $tags . ')\s*>/ui', '', $p_string );
    -	$p_string = preg_replace( '/<(' . $tags . ')\s*\/>/ui', '<\\1 />', $p_string );
    -
    -
    -	return $p_string;
    -}
    -
    -
    -/**	
    - * Return a string with the $p_character pattern repeated N times.
    - * 
    - * @param string $p_character - pattern to repeat
    - * @param integer $p_repeats - number of times to repeat.
    - */
    -function string_repeat_char( $p_character, $p_repeats ) {
    -	return str_pad( '', $p_repeats, $p_character );
    -}
    -
    -
    -/**
    - * Format date for display
    - */ 
    -function string_format_complete_date( $p_date ) {
    -	$t_timestamp = db_unixtimestamp( $p_date );
    -	return date( config_get( 'complete_date_format' ), $t_timestamp );
    -}
    -
    -
    -/** 
    - * Shorten a string for display on a dropdown to prevent the page rendering too wide
    - */
    -function string_shorten( $p_string ) {
    -	$t_max = config_get( 'max_dropdown_length' );
    -	if ( ( tlStrLen($p_string ) > $t_max ) && ( $t_max > 0 ) ){
    -		$t_pattern = '/([\s|.|,|\-|_|\/|\?]+)/';
    -		$t_bits = preg_split( $t_pattern, $p_string, -1, PREG_SPLIT_DELIM_CAPTURE );
    -
    -		$t_string = '';
    -		$t_last = $t_bits[ count( $t_bits ) - 1 ];
    -		$t_last_len = tlStrLen( $t_last );
    -
    -		foreach ( $t_bits as $t_bit ) {
    -			if ( ( tlStrLen( $t_string ) + tlStrLen( $t_bit ) + $t_last_len + 3 <= $t_max )
    -				|| ( strpos( $t_bit, '.,-/?' ) > 0 ) ) {
    -				$t_string .= $t_bit;
    -			} else {
    -				break;
    -			}
    -		}
    -		$t_string .= '...' . $t_last;
    -		return $t_string;
    -	} else {
    -		return $p_string;
    -	}
    -}
    -
    -
    -/**
    - * remap a field name to a string name (for sort filter)
    - */
    -function string_get_field_name( $p_string ) {
    -
    -	$t_map = array(
    -			'last_updated' => 'last_update',
    -			'id' => 'email_bug'
    -			);
    -
    -	$t_string = $p_string;
    -	if ( isset( $t_map[ $p_string ] ) ) {
    -		$t_string = $t_map[ $p_string ];
    -	}
    -	return lang_get_defaulted( $t_string );
    -}
    -
    -
    -/** 
    - * Calls htmlentities on the specified string, passing along
    - * the current charset.
    - */
    -function string_html_entities( $p_string ) {
    -	return htmlentities( $p_string, ENT_COMPAT, config_get('charset') );
    -}
    -
    -
    -/** 
    - * Calls htmlspecialchars on the specified string, passing along
    - * the current charset, if the current PHP version supports it.
    - */
    -function string_html_specialchars( $p_string ) {
    -	# achumakov: @ added to avoid warning output in unsupported codepages
    -	# e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.
    -	# This is VERY important for Eastern European, Baltic and Korean languages
    -	return preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", @htmlspecialchars( $p_string, ENT_COMPAT, config_get('charset') ) );
    -}
    -
    -
    -/** 
    - * Prepares a string to be used as part of header().
    - */
    -function string_prepare_header( $p_string ) {
    -	$t_string = $p_string;
    -
    -	$t_truncate_pos = strpos($p_string, "\n");
    -	if ($t_truncate_pos !== false ) {
    -		$t_string = substr($t_string, 0, $t_truncate_pos);
    -	}
    -
    -	$t_truncate_pos = strpos($p_string, "\r");
    -	if ($t_truncate_pos !== false ) {
    -		$t_string = substr($t_string, 0, $t_truncate_pos);
    -	}
    -
    -	return $t_string;
    -}
    -
    -
    -/** 
    - * Checks the supplied string for scripting characters, if it contains any, then return true, otherwise return false.
    - * 
    - * @param string $p_string
    - * @return boolean
    - */
    -function string_contains_scripting_chars( $p_string ) {
    -	if ( ( strstr( $p_string, '<' ) !== false ) || ( strstr( $p_string, '>' ) !== false ) ) {
    -		return true;
    -	}
    -
    -	return false;
    -}
    -
    -/**
    - * Use a simple perl regex for valid email addresses.  This is not a complete regex,
    - * as it does not cover quoted addresses or domain literals, but it is simple and
    - * covers the vast majority of all email addresses without being overly complex.
    - * @return string
    - */
    -function email_regex_simple() {
    -	static $s_email_regex = null;
    -
    -	if( is_null( $s_email_regex ) ) {
    -		$t_recipient = "([a-z0-9!#*+\/=?^_{|}~-]+(?:\.[a-z0-9!#*+\/=?^_{|}~-]+)*)";
    -
    -		# a domain is one or more subdomains
    -		$t_subdomain = "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)";
    -		$t_domain    = "({$t_subdomain}(?:\.{$t_subdomain})*)";
    -
    -		$s_email_regex = "/{$t_recipient}\@{$t_domain}/i";
    -	}
    -	return $s_email_regex;
    +
    + */
    +use function database\db_unixtimestamp;
    +
    +require_once 'common.php';
    +
    +function string_preserve_spaces_at_bol($p_string)
    +{
    +    $lines = explode("\n", $p_string);
    +    $line_count = count($lines);
    +    for ($i = 0; $i < $line_count; $i ++) {
    +        $count = 0;
    +        $prefix = '';
    +
    +        $t_char = substr($lines[$i], $count, 1);
    +        $spaces = 0;
    +        while (($t_char == ' ') || ($t_char == "\t")) {
    +            if ($t_char == ' ') {
    +                $spaces ++;
    +            } else {
    +                $spaces += 4;
    +            } // 1 tab = 4 spaces, can be configurable.
    +
    +            $count ++;
    +            $t_char = substr($lines[$i], $count, 1);
    +        }
    +
    +        for ($j = 0; $j < $spaces; $j ++) {
    +            $prefix .= ' ';
    +        }
    +
    +        $lines[$i] = $prefix . substr($lines[$i], $count);
    +    }
    +    return implode("\n", $lines);
    +}
    +
    +/**
    + * Prepare a string to be printed without being broken into multiple lines
    + */
    +function string_no_break($p_string)
    +{
    +    if (strpos($p_string, ' ') !== false) {
    +        return '' . $p_string . "";
    +    } else {
    +        return $p_string;
    +    }
    +}
    +
    +/**
    + * Similar to nl2br, but fixes up a problem where new lines are doubled between < pre > tags.
    + * additionally, wrap the text an $p_wrap character intervals if the config is set
    + *
    + * @author Mantis BT team
    + */
    +function string_nl2br($p_string, $p_wrap = 100)
    +{
    +    $p_string = nl2br($p_string);
    +
    +    // fix up eols within 
     tags
    +    $pre2 = array();
    +    preg_match_all("/]*?>(.|\n)*?<\/pre>/", $p_string, $pre1);
    +    for ($x = 0; $x < count($pre1[0]); $x ++) {
    +        $pre2[$x] = preg_replace("/]*?>/", "", $pre1[0][$x]);
    +        // this may want to be replaced by html_entity_decode (or equivalent)
    +        // if other encoded characters are a problem
    +        $pre2[$x] = str_replace("/ /", " ", $pre2[$x]);
    +        if (tl::ON == config_get('wrap_in_preformatted_text')) {
    +            $pre2[$x] = preg_replace("/([^\n]{" . $p_wrap . "})(?!<\/pre>)/",
    +                "$1\n", $pre2[$x]);
    +        }
    +        $pre1[0][$x] = "/" . preg_quote($pre1[0][$x], "/") . "/";
    +    }
    +
    +    return preg_replace($pre1[0], $pre2, $p_string);
    +}
    +
    +/**
    + * Prepare a multiple line string for display to HTML
    + */
    +function string_display($p_string)
    +{
    +    $p_string = string_strip_hrefs($p_string);
    +    $p_string = string_html_specialchars($p_string);
    +    $p_string = string_restore_valid_html_tags($p_string, /* multiline = */ true);
    +    $p_string = string_preserve_spaces_at_bol($p_string);
    +    $p_string = string_nl2br($p_string);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Prepare a single line string for display to HTML
    + */
    +function string_display_line($p_string)
    +{
    +    $p_string = string_strip_hrefs($p_string);
    +    $p_string = string_html_specialchars($p_string);
    +    $p_string = string_restore_valid_html_tags($p_string, /* multiline = */ false);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Prepare a string for display to HTML and add href anchors for URLs, emails,
    + * bug references, and cvs references
    + */
    +function string_display_links($p_string)
    +{
    +    $p_string = string_display($p_string);
    +    $p_string = string_insert_hrefs($p_string);
    +    return $p_string;
    +}
    +
    +/**
    + * Prepare a single line string for display to HTML and add href anchors for
    + * URLs, emails, bug references, and cvs references
    + */
    +function string_display_line_links($p_string)
    +{
    +    $p_string = string_display_line($p_string);
    +    $p_string = string_insert_hrefs($p_string);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Prepare a string for display in rss
    + */
    +function string_rss_links($p_string)
    +{
    +    // rss can not start with   which spaces will be replaced into by string_display().
    +    $t_string = trim($p_string);
    +
    +    // same steps as string_display_links() without the preservation of spaces since   is undefined in XML.
    +    $t_string = string_strip_hrefs($t_string);
    +    $t_string = string_html_specialchars($t_string);
    +    $t_string = string_restore_valid_html_tags($t_string);
    +    $t_string = string_nl2br($t_string);
    +    $t_string = string_insert_hrefs($t_string);
    +    $t_string = string_process_bug_link($t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true);
    +    $t_string = string_process_bugnote_link($t_string, /* anchor */ true, /* detailInfo */ false, /* fqdn */ true);
    +    $t_string = string_process_cvs_link($t_string);
    +    # another escaping to escape the special characters created by the generated links
    +    $t_string = string_html_specialchars($t_string);
    +
    +    return $t_string;
    +}
    +
    +/**
    + * Prepare a string for plain text display in email
    + */
    +function string_email($p_string)
    +{
    +    $p_string = string_strip_hrefs($p_string);
    +    return $p_string;
    +}
    +
    +/**
    + * Prepare a string for plain text display in email and add URLs for bug
    + * links and cvs links
    + */
    +function string_email_links($p_string)
    +{
    +    $p_string = string_email($p_string);
    +    return $p_string;
    +}
    +
    +/**
    + * Process a string for display in a textarea box
    + */
    +function string_textarea($p_string)
    +{
    +    $p_string = string_html_specialchars($p_string);
    +    return $p_string;
    +}
    +
    +/**
    + * Process a string for display in a text box
    + */
    +function string_attribute($p_string)
    +{
    +    $p_string = string_html_specialchars($p_string);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Process a string for inclusion in a URL as a GET parameter
    + */
    +function string_url($p_string)
    +{
    +    $p_string = rawurlencode($p_string);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * validate the url as part of this site before continuing
    + */
    +function string_sanitize_url($p_url)
    +{
    +    $t_url = strip_tags(urldecode($p_url));
    +    if (preg_match('?http(s)*://?', $t_url) > 0 &&
    +        preg_match('?^' . config_get('path') . '?', $t_url) == 0) {
    +        // url is ok if it begins with our path, if not, replace it
    +        $t_url = 'index.php';
    +    }
    +    if ($t_url == '') {
    +        $t_url = 'index.php';
    +    }
    +
    +    // explode and encode parameters
    +    if (strpos($t_url, '?') !== false) {
    +        list ($t_path, $t_param) = explode('\?', $t_url, 2);
    +        if ($t_param !== "") {
    +            $t_vals = array();
    +            parse_str($t_param, $t_vals);
    +            $t_param = '';
    +            foreach ($t_vals as $k => $v) {
    +                if ($t_param != '') {
    +                    $t_param .= '&';
    +                }
    +                $t_param .= "$k=" . urlencode(strip_tags(urldecode($v)));
    +            }
    +            return $t_path . '?' . $t_param;
    +        } else {
    +            return $t_path;
    +        }
    +    } else {
    +        return $t_url;
    +    }
    +}
    +
    +/**
    + * Search email addresses and URLs for a few common protocols in the given
    + * string, and replace occurences with href anchors.
    + *
    + * @param string $p_string
    + * @return string
    + */
    +function string_insert_hrefs($p_string)
    +{
    +    static $s_url_regex = null;
    +    static $s_email_regex = null;
    +    static $s_anchor_regex = '/(]*>.*?<\/a>)/is';
    +
    +    if (! config_get('html_make_links')) {
    +        return $p_string;
    +    }
    +
    +    if (ini_get_bool('magic_quotes_sybase') && function_exists('ini_set')) {
    +        ini_set('magic_quotes_sybase', false);
    +    }
    +
    +    # Initialize static variables
    +    if (is_null($s_url_regex)) {
    +        # URL protocol. The regex accepts a small subset from the list of valid
    +        # IANA permanent and provisional schemes defined in
    +        # http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
    +        $t_url_protocol = '(?:https?|s?ftp|file|irc[6s]?|ssh|telnet|nntp|git|svn(?:\+ssh)?|cvs):\/\/';
    +
    +        # %2A notation in url's
    +        $t_url_hex = '%[[:digit:]A-Fa-f]{2}';
    +
    +        # valid set of characters that may occur in url scheme. Note: - should be first (A-F != -AF).
    +        $t_url_valid_chars = '-_.,!~*\';\/?%^\\\\:@&={\|}+$#[:alnum:]\pL';
    +        $t_url_chars = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)\[\]])";
    +        $t_url_chars2 = "(?:{$t_url_hex}|[{$t_url_valid_chars}])";
    +        $t_url_chars_in_brackets = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)])";
    +        $t_url_chars_in_parens = "(?:{$t_url_hex}|[{$t_url_valid_chars}\[\]])";
    +
    +        $t_url_part1 = "{$t_url_chars}";
    +        $t_url_part2 = "(?:\({$t_url_chars_in_parens}*\)|\[{$t_url_chars_in_brackets}*\]|{$t_url_chars2})";
    +
    +        $s_url_regex = "/({$t_url_protocol}({$t_url_part1}*?{$t_url_part2}+))/su";
    +
    +        # e-mail regex
    +        $s_email_regex = substr_replace(email_regex_simple(), '(?:mailto:)?', 1,
    +            0);
    +    }
    +
    +    # Find any URL in a string and replace it with a clickable link
    +    # From MantisBT 2.25.2
    +    $p_string = preg_replace_callback($s_url_regex,
    +        function ($p_match) {
    +            $t_url_href = 'href="' . rtrim($p_match[1], '.') . '"';
    +            if (config_get('html_make_links') == LINKS_NEW_WINDOW) {
    +                $t_url_target = ' target="_blank"';
    +            } else {
    +                $t_url_target = '';
    +            }
    +            return "{$p_match[1]}";
    +        }, $p_string);
    +
    +    # Find any email addresses in the string and replace them with a clickable
    +    # mailto: link, making sure that we skip processing of any existing anchor
    +    # tags, to avoid parts of URLs such as https://user@example.com/ or
    +    # http://user:password@example.com/ to be not treated as an email.
    +    $t_pieces = preg_split($s_anchor_regex, $p_string, null,
    +        PREG_SPLIT_DELIM_CAPTURE);
    +    $p_string = '';
    +    foreach ($t_pieces as $piece) {
    +        if (preg_match($s_anchor_regex, $piece)) {
    +            $p_string .= $piece;
    +        } else {
    +            $p_string .= preg_replace($s_email_regex,
    +                '\0', $piece);
    +        }
    +    }
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Detect href anchors in the string and replace them with URLs and email addresses
    + */
    +function string_strip_hrefs($p_string)
    +{
    +    # First grab mailto: hrefs. We don't care whether the URL is actually
    +    # correct - just that it's inside an href attribute.
    +    $p_string = preg_replace(
    +        '/]*href="mailto:([^\"]+)"[^\>]*>[^\<]*<\/a>/si', '\1',
    +        $p_string);
    +
    +    # Then grab any other href
    +    $p_string = preg_replace('/]*href="([^\"]+)"[^\>]*>[^\<]*<\/a>/si',
    +        '\1', $p_string);
    +    return $p_string;
    +}
    +
    +/**
    + * This function looks for text with htmlentities
    + * like <b> and converts is into corresponding
    + * html <b> based on the configuration presets
    + */
    +function string_restore_valid_html_tags($p_string, $p_multiline = true)
    +{
    +    $t_html_valid_tags = config_get(
    +        $p_multiline ? 'html_valid_tags' : 'html_valid_tags_single_line');
    +
    +    if (0 === $t_html_valid_tags || isBlank($t_html_valid_tags)) {
    +        return $p_string;
    +    }
    +
    +    $tags = explode(',', $t_html_valid_tags);
    +    foreach ($tags as $key => $value) {
    +        if (! isBlank($value)) {
    +            $tags[$key] = trim($value);
    +        }
    +    }
    +    $tags = implode('|', $tags);
    +
    +    $p_string = preg_replace('/<(' . $tags . ')\s*>/ui', '<\\1>',
    +        $p_string);
    +    $p_string = preg_replace('/<\/(' . $tags . ')\s*>/ui', '',
    +        $p_string);
    +    $p_string = preg_replace('/<(' . $tags . ')\s*\/>/ui', '<\\1 />',
    +        $p_string);
    +
    +    return $p_string;
    +}
    +
    +/**
    + * Return a string with the $p_character pattern repeated N times.
    + *
    + * @param string $p_character
    + *            - pattern to repeat
    + * @param integer $p_repeats
    + *            - number of times to repeat.
    + */
    +function string_repeat_char($p_character, $p_repeats)
    +{
    +    return str_pad('', $p_repeats, $p_character);
    +}
    +
    +/**
    + * Format date for display
    + */
    +function string_format_complete_date($p_date)
    +{
    +    $t_timestamp = db_unixtimestamp($p_date);
    +    return date(config_get('complete_date_format'), $t_timestamp);
    +}
    +
    +/**
    + * Shorten a string for display on a dropdown to prevent the page rendering too wide
    + */
    +function string_shorten($p_string)
    +{
    +    $t_max = config_get('max_dropdown_length');
    +    if ((tlStrLen($p_string) > $t_max) && ($t_max > 0)) {
    +        $t_pattern = '/([\s|.|,|\-|_|\/|\?]+)/';
    +        $t_bits = preg_split($t_pattern, $p_string, - 1,
    +            PREG_SPLIT_DELIM_CAPTURE);
    +
    +        $t_string = '';
    +        $t_last = $t_bits[count($t_bits) - 1];
    +        $t_last_len = tlStrLen($t_last);
    +
    +        foreach ($t_bits as $t_bit) {
    +            if ((tlStrLen($t_string) + tlStrLen($t_bit) + $t_last_len + 3 <=
    +                $t_max) || (strpos($t_bit, '.,-/?') > 0)) {
    +                $t_string .= $t_bit;
    +            } else {
    +                break;
    +            }
    +        }
    +        $t_string .= '...' . $t_last;
    +        return $t_string;
    +    } else {
    +        return $p_string;
    +    }
    +}
    +
    +/**
    + * remap a field name to a string name (for sort filter)
    + */
    +function string_get_field_name($p_string)
    +{
    +    $t_map = array(
    +        'last_updated' => 'last_update',
    +        'id' => 'email_bug'
    +    );
    +
    +    $t_string = $p_string;
    +    if (isset($t_map[$p_string])) {
    +        $t_string = $t_map[$p_string];
    +    }
    +    return lang_get_defaulted($t_string);
    +}
    +
    +/**
    + * Calls htmlentities on the specified string, passing along
    + * the current charset.
    + */
    +function string_html_entities($p_string)
    +{
    +    return htmlentities($p_string, ENT_COMPAT, config_get('charset'));
    +}
    +
    +/**
    + * Calls htmlspecialchars on the specified string, passing along
    + * the current charset, if the current PHP version supports it.
    + */
    +function string_html_specialchars($p_string)
    +{
    +    # achumakov: @ added to avoid warning output in unsupported codepages
    +    # e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1.
    +    # This is VERY important for Eastern European, Baltic and Korean languages
    +    return preg_replace("/&(#[\d]+|[a-z]+);/i", "&$1;",
    +        @htmlspecialchars($p_string, ENT_COMPAT, config_get('charset')));
    +}
    +
    +/**
    + * Prepares a string to be used as part of header().
    + */
    +function string_prepare_header($p_string)
    +{
    +    $t_string = $p_string;
    +
    +    $t_truncate_pos = strpos($p_string, "\n");
    +    if ($t_truncate_pos !== false) {
    +        $t_string = substr($t_string, 0, $t_truncate_pos);
    +    }
    +
    +    $t_truncate_pos = strpos($p_string, "\r");
    +    if ($t_truncate_pos !== false) {
    +        $t_string = substr($t_string, 0, $t_truncate_pos);
    +    }
    +
    +    return $t_string;
    +}
    +
    +/**
    + * Checks the supplied string for scripting characters, if it contains any, then return true, otherwise return false.
    + *
    + * @param string $p_string
    + * @return boolean
    + */
    +function string_contains_scripting_chars($p_string)
    +{
    +    if ((strstr($p_string, '<') !== false) || (strstr($p_string, '>') !== false)) {
    +        return true;
    +    }
    +
    +    return false;
    +}
    +
    +/**
    + * Use a simple perl regex for valid email addresses.
    + * This is not a complete regex,
    + * as it does not cover quoted addresses or domain literals, but it is simple and
    + * covers the vast majority of all email addresses without being overly complex.
    + *
    + * @return string
    + */
    +function email_regex_simple()
    +{
    +    static $s_email_regex = null;
    +
    +    if (is_null($s_email_regex)) {
    +        $t_recipient = "([a-z0-9!#*+\/=?^_{|}~-]+(?:\.[a-z0-9!#*+\/=?^_{|}~-]+)*)";
    +
    +        # a domain is one or more subdomains
    +        $t_subdomain = "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)";
    +        $t_domain = "({$t_subdomain}(?:\.{$t_subdomain})*)";
    +
    +        $s_email_regex = "/{$t_recipient}\@{$t_domain}/i";
    +    }
    +    return $s_email_regex;
     }
    diff --git a/lib/functions/table.class.php b/lib/functions/table.class.php
    index 01f24986a8..5c5c498ef8 100644
    --- a/lib/functions/table.class.php
    +++ b/lib/functions/table.class.php
    @@ -1,186 +1,194 @@
    - 'My column',
    -   *              'col_id' => 'id_Mycolumn',
    -   *              'width' => 150,
    -   *              'type' => 'status'
    -   *            );
    -   *            It is up to the derived class to use this information on
    -   *            rendering. The col_id key is used to identify the data
    -   *            field when using ext js.
    -   *            @see tlTable::titleToColumnName()
    -   */
    -  protected $columns;
    -
    -  /**
    -   * @var array that holds the row data to be displayed. Every row is
    -   *      an array with the column data as describled in $columns.
    -   *      If the data type is status the value should be an array like
    -   *      array('value' => 'f', 'text' => 'Failed', 'cssClass' => 'failed_text')
    -   *      to allow coloring and sorting in table.
    -   */
    -  protected $data;
    -
    -  /**
    -   * A unique id that is used to render the table and to remember state via
    -   * cookie (requires CookieProvider to be set in Ext.onReady);
    -   */
    -  public $tableID = null;
    -
    -  /** @var The title header for the whole table. Default: null (no title) */
    -  public $title = null;
    -
    -  /** @var Width of the table. Default: null (full width) */
    -  public $width = null;
    -
    -  /** @var Height of the table. Default: null
    -   * @see $autoHeight
    -   */
    -  public $height = null;
    -
    -  /** @var autoHeight determines if the table should have a fixed height, or
    -   *       if the height depends on the content.
    -   *       Default: true (height = height of content)
    -   */
    -  public $autoHeight = true;
    -
    -  /*
    -   * Used by titleToColumnName() to create unique column identifiers.
    -   */
    -  protected $usedNames = array();
    -
    -  /**
    -   * @param $columns is either an array of column titles
    -   *        (i.e. array('Title 1', 'Title 2')) or an array where each value
    -   *        is an array('title' => 'Column title 1',
    -   *                    'type' => 'string',
    -   *                    'width' => 150);
    -   *
    -   *        Let the constructor do localization:
    -   *        array('title_key' => 'title_test_case_title', 'width' => 150)
    -   *
    -   *        Explicitly set column id:
    -   *        array('title' => '[%]', 'col_id' => 'passed_percent')
    -   *
    -   *        It is possible to set title_key instead of title: this will mean
    -   *        the localization is done within the constructor and that title_key
    -   *        can be used as column id. If title key is not given then create a
    -   *        column id based on the localized title.
    -   *
    -   *        It is possible to override the generated column id by passing a
    -   *        value as col_id.
    -   *
    -   *        Internally the columns will always be saved in the full format
    -   *        (array-of-arrays).
    -   *
    -   *        @see tlTable::$columns
    -   *        @see tlTable::$data
    -   */
    -  public function __construct($columns, $data, $tableID)
    -  {
    -    // Expand the simple column format (array-of-titles) to full
    -    // array-of-arrays and compute js friendly column names.
    -    $this->columns = array();
    -    foreach ($columns as $column) {
    -      if (is_array($column)) {
    -        if (isset($column['title_key'])) {
    -          if (isset($column['title'])) {
    -            throw new Exception("Both title and title_key are set: use only one of them");
    -          }
    -          $column['title'] = lang_get($column['title_key']);
    -        }
    -
    -        // If $title_key was given, use that for col_id, otherwise use $title
    -        if (!isset($column['col_id'])) {
    -          $key = $column['title'];
    -          if (isset($column['title_key'])) {
    -            $key = $column['title_key'];
    -          }
    -          $column['col_id'] = $this->titleToColumnName($key);
    -        }
    -        $this->columns[] = $column;
    -      }
    -      else if (is_string($column)) {
    -        $this->columns[] = array(
    -          'title' => $column,
    -          'col_id' => $this->titleToColumnName($column)
    -        );
    -      }
    -      else {
    -        throw new Exception("Invalid column header: " . $column);
    -      }
    -    }
    -    $this->data = $data;
    -    $this->tableID = $tableID;
    -  }
    -
    -  /**
    -   * Outputs the code that all tables shares
    -   */
    -  public abstract function renderCommonGlobals();
    -
    -  /**
    -   * Outputs the code that should be in 
    -   */
    -  public abstract function renderHeadSection();
    -
    -  /**
    -   * Outputs the code that should be in 
    -   */
    -  public abstract function renderBodySection();
    -
    -
    -  /**
    -   * Transforms a column title (localized string) to a unique valid
    -   * js identifier by removing all invalid chars.
    -   *
    -   * Note: The result is unique so passing the same $title twice will
    -   * return different column ids. Only meant to be called from constructor.
    -   */
    -  private function titleToColumnName($title) {
    -    static $allowedChars = "_abcdefghijklmnopqrstuvwxyz0123456789";
    -    // always start with this to avoid number in beginning
    -    $js_safe = 'id_';
    -    $chars = str_split($title);
    -    foreach ($chars as $char) {
    -      if (stripos($allowedChars, $char) !== FALSE) {
    -        $js_safe .= $char;
    -      }
    -    }
    -    // If the name is already used append a number
    -    if (in_array($js_safe, $this->usedNames)) {
    -      $i = 1;
    -      // Find next available number
    -      while (in_array($js_safe . $i, $this->usedNames)) {
    -        $i++;
    -      }
    -      $js_safe .= $i;
    -    }
    -    $this->usedNames[] = $js_safe;
    -    return $js_safe;
    -  }
    + 'My column',
    +     *      'col_id' => 'id_Mycolumn',
    +     *      'width' => 150,
    +     *      'type' => 'status'
    +     *      );
    +     *      It is up to the derived class to use this information on
    +     *      rendering. The col_id key is used to identify the data
    +     *      field when using ext js.
    +     * @see tlTable::titleToColumnName()
    +     */
    +    protected $columns;
    +
    +    /**
    +     *
    +     * @var array that holds the row data to be displayed. Every row is
    +     *      an array with the column data as describled in $columns.
    +     *      If the data type is status the value should be an array like
    +     *      array('value' => 'f', 'text' => 'Failed', 'cssClass' => 'failed_text')
    +     *      to allow coloring and sorting in table.
    +     */
    +    protected $data;
    +
    +    /**
    +     * A unique id that is used to render the table and to remember state via
    +     * cookie (requires CookieProvider to be set in Ext.onReady);
    +     */
    +    public $tableID = null;
    +
    +    /** @var The title header for the whole table. Default: null (no title) */
    +    public $title = null;
    +
    +    /** @var Width of the table. Default: null (full width) */
    +    public $width = null;
    +
    +    /**
    +     *
    +     * @var Height of the table. Default: null
    +     * @see $autoHeight
    +     */
    +    public $height = null;
    +
    +    /**
    +     *
    +     * @var autoHeight determines if the table should have a fixed height, or
    +     *      if the height depends on the content.
    +     *      Default: true (height = height of content)
    +     */
    +    public $autoHeight = true;
    +
    +    /*
    +     * Used by titleToColumnName() to create unique column identifiers.
    +     */
    +    protected $usedNames = array();
    +
    +    /**
    +     *
    +     * @param array $columns
    +     *            is either an array of column titles
    +     *            (i.e. array('Title 1', 'Title 2')) or an array where each value
    +     *            is an array('title' => 'Column title 1',
    +     *            'type' => 'string',
    +     *            'width' => 150);
    +     *
    +     *            Let the constructor do localization:
    +     *            array('title_key' => 'title_test_case_title', 'width' => 150)
    +     *
    +     *            Explicitly set column id:
    +     *            array('title' => '[%]', 'col_id' => 'passed_percent')
    +     *
    +     *            It is possible to set title_key instead of title: this will mean
    +     *            the localization is done within the constructor and that title_key
    +     *            can be used as column id. If title key is not given then create a
    +     *            column id based on the localized title.
    +     *
    +     *            It is possible to override the generated column id by passing a
    +     *            value as col_id.
    +     *
    +     *            Internally the columns will always be saved in the full format
    +     *            (array-of-arrays).
    +     *
    +     * @see tlTable::$columns
    +     * @see tlTable::$data
    +     */
    +    public function __construct($columns, $data, $tableID)
    +    {
    +        // Expand the simple column format (array-of-titles) to full
    +        // array-of-arrays and compute js friendly column names.
    +        $this->columns = array();
    +        foreach ($columns as $column) {
    +            if (is_array($column)) {
    +                if (isset($column['title_key'])) {
    +                    if (isset($column['title'])) {
    +                        throw new Exception(
    +                            "Both title and title_key are set: use only one of them");
    +                    }
    +                    $column['title'] = lang_get($column['title_key']);
    +                }
    +
    +                // If $title_key was given, use that for col_id, otherwise use $title
    +                if (! isset($column['col_id'])) {
    +                    $key = $column['title'];
    +                    if (isset($column['title_key'])) {
    +                        $key = $column['title_key'];
    +                    }
    +                    $column['col_id'] = $this->titleToColumnName($key);
    +                }
    +                $this->columns[] = $column;
    +            } elseif (is_string($column)) {
    +                $this->columns[] = array(
    +                    'title' => $column,
    +                    'col_id' => $this->titleToColumnName($column)
    +                );
    +            } else {
    +                throw new Exception("Invalid column header: " . $column);
    +            }
    +        }
    +        $this->data = $data;
    +        $this->tableID = $tableID;
    +    }
    +
    +    /**
    +     * Outputs the code that all tables shares
    +     */
    +    abstract public function renderCommonGlobals();
    +
    +    /**
    +     * Outputs the code that should be in 
    +     */
    +    abstract public function renderHeadSection();
    +
    +    /**
    +     * Outputs the code that should be in 
    +     */
    +    abstract public function renderBodySection();
    +
    +    /**
    +     * Transforms a column title (localized string) to a unique valid
    +     * js identifier by removing all invalid chars.
    +     *
    +     * Note: The result is unique so passing the same $title twice will
    +     * return different column ids. Only meant to be called from constructor.
    +     */
    +    private function titleToColumnName($title)
    +    {
    +        static $allowedChars = "_abcdefghijklmnopqrstuvwxyz0123456789";
    +        // always start with this to avoid number in beginning
    +        $js_safe = 'id_';
    +        $chars = str_split($title);
    +        foreach ($chars as $char) {
    +            if (stripos($allowedChars, $char) !== false) {
    +                $js_safe .= $char;
    +            }
    +        }
    +        // If the name is already used append a number
    +        if (in_array($js_safe, $this->usedNames)) {
    +            $i = 1;
    +            // Find next available number
    +            while (in_array($js_safe . $i, $this->usedNames)) {
    +                $i ++;
    +            }
    +            $js_safe .= $i;
    +        }
    +        $this->usedNames[] = $js_safe;
    +        return $js_safe;
    +    }
     }
    diff --git a/lib/functions/testPlanUrgency.class.php b/lib/functions/testPlanUrgency.class.php
    index f9cf5cd2cf..c3c712756b 100644
    --- a/lib/functions/testPlanUrgency.class.php
    +++ b/lib/functions/testPlanUrgency.class.php
    @@ -1,264 +1,272 @@
    -tables['testplan_tcversions']} 
    -             SET urgency=" 
    -             . $this->db->prepare_int($urgency) . 
    -           " WHERE testplan_id=" 
    -             . $this->db->prepare_int($testplan_id) .
    -           " AND tcversion_id=" . $this->db->prepare_int($tc_id);
    -
    -    $result = $this->db->exec_query($sql);
    -
    -    return $result ? tl::OK : tl::ERROR;
    -  }
    -
    -  /**
    -   * Set urgency for TCs (direct child only) within a Test Suite and Test Plan
    -   * 
    -   * @param integer $testplan_id Test Plan ID
    -   * @param integer $node_id Test Suite to set Urgency
    -   * @param integer $urgency
    -   * 
    -   * @return integer result code
    -   * 
    -   * @internal 
    -   * 20081212 - franciscom - Postgres do not like SQL syntax with JOIN
    -   *  $sql = 'UPDATE testplan_tcversions ' .
    -   *  ' JOIN nodes_hierarchy NHA ON testplan_tcversions.tcversion_id = NHA.id '.
    -   *  ' JOIN nodes_hierarchy NHB ON NHA.parent_id = NHB.id' .
    -   *  ' SET urgency=' . $urgency .
    -   *  ' WHERE testplan_tcversions.testplan_id=' . $testplan_id .
    -   *  ' AND NHB.parent_id=' . $node_id; 
    -   */ 
    -  public function setSuiteUrgency($testplan_id, $node_id, $urgency)
    -  {
    -    $sql = " UPDATE {$this->tables['testplan_tcversions']} " . 
    -           " SET urgency=" . $this->db->prepare_int($urgency) .
    -           " WHERE testplan_id= " . $this->db->prepare_int($testplan_id) .
    -           " AND tcversion_id IN (" .
    -           " SELECT NHB.id " . 
    -           " FROM {$this->tables['nodes_hierarchy']}  NHA, " .
    -           " {$this->tables['nodes_hierarchy']} NHB, {$this->tables['node_types']} NT " .
    -           " WHERE NHA.node_type_id = NT.id " .
    -           " AND NT.description='testcase' " . 
    -           " AND NHB.parent_id = NHA.id " . 
    -           " AND NHA.parent_id = " . $this->db->prepare_int($node_id) . " )";
    -
    -    $result = $this->db->exec_query($sql);
    -    return $result ? OK : ERROR;;
    -  }
    -  
    -  /**
    -   * Collect urgency for a Test Suite within a Test Plan
    -   * 
    -   * @used-by planUrgency.php
    -   *
    -   *
    -   * @param integer $testplan_id Test Plan ID
    -   * @param integer $node_id Test Suite 
    -   * @param integer $testproject_id
    -   *
    -   * @return array of array testcase_id, name, urgency, tcprefix, tc_external_id 
    -   * 
    -   * @internal revisions
    -   */
    -  public function getSuiteUrgency($context,$options=null,$filters=null)
    -  {
    -
    -    $node_id = intval($context->tsuite_id); 
    -    $testplan_id = intval($context->tplan_id);
    -    $platform_id = property_exists($context, 'platform_id') ? intval($context->platform_id) : 0;
    -    $testproject_id = property_exists($context, 'tproject_id') ? intval($context->tproject_id) : null;
    -
    -    $testcase_cfg = config_get('testcase_cfg');  
    -    $moreFields = '';
    -    $moreJoins = '';
    -
    -    $my['options'] = array('build4testers' => 0);
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    $my['filters'] = array('testcases' => null);
    -    $my['filters'] = array_merge($my['filters'], (array)$filters);
    -
    -    if( $my['options']['build4testers'] != 0 )
    -    {
    -      $tasks = $this->assignment_types;
    -
    -      // ATTENTION:
    -      // Remember that test case execution task can be assigned to MULTIPLE USERS
    -      $moreFields = ',USERS.login AS assigned_to, USERS.first, USERS.last ';
    -
    -      $moreJoins = " LEFT JOIN {$this->tables['user_assignments']} UA " .
    -                    " ON UA.feature_id = TPTCV.id " .
    -                    " AND UA.type = " . $tasks['testcase_execution']['id'] .
    -                    " AND UA.build_id = " . $my['options']['build4testers'] .
    -                    " LEFT JOIN {$this->tables['users']} USERS " .
    -                    " ON USERS.id = UA.user_id ";
    -    }     
    -
    -
    -
    -    $sql = " SELECT testprojects.prefix  FROM {$this->tables['testprojects']} testprojects " .
    -           " WHERE testprojects.id = ";
    -    
    -    if( !is_null($testproject_id) )
    -    {
    -      $sql .= intval($testproject_id);  
    -    }      
    -    else
    -    {
    -      $sql .= "( SELECT parent_id AS testproject_id FROM {$this->tables['nodes_hierarchy']} " .
    -              "  WHERE id=" . intval($testplan_id) . " ) ";
    -    }
    -    
    -    $tcprefix = $this->db->fetchOneValue($sql) . $testcase_cfg->glue_character;
    -    $tcprefix = $this->db->prepare_string($tcprefix);
    -    
    -    $sql = " SELECT DISTINCT '{$tcprefix}' AS tcprefix, NHB.name, NHB.node_order," .
    -           " NHA.parent_id AS testcase_id, TCV.tc_external_id, TPTCV.tcversion_id,".
    -           " TPTCV.urgency, TCV.importance, (TCV.importance * TPTCV.urgency) AS priority" .
    -           $moreFields .
    -           " FROM {$this->tables['nodes_hierarchy']} NHA " .
    -           " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " .
    -           " JOIN {$this->tables['testplan_tcversions']} TPTCV " .
    -           " ON TPTCV.tcversion_id=NHA.id " .
    -           " JOIN {$this->tables['tcversions']}  TCV ON TCV.id = TPTCV.tcversion_id " .
    -           $moreJoins;
    -
    -    $sql .= " WHERE TPTCV.testplan_id=" . $this->db->prepare_int($testplan_id) .
    -            " AND NHB.parent_id=" . $this->db->prepare_int($node_id);
    -
    -    if($platform_id > 0)
    -    {
    -      $sql .= " AND TPTCV.platform_id=" . $this->db->prepare_int($platform_id);
    -    }        
    -
    -    if( !is_null($my['filters']['testcases']) )
    -    {
    -      // sanitize
    -      $loop2do = count($my['filters']['testcases']);
    -      for($gdx=0; $gdx < $loop2do; $gdx++)
    -      {
    -        $my['filters']['testcases'][$gdx] = intval($my['filters']['testcases'][$gdx]);
    -      }  
    -      $sql .= " AND NHB.id IN (" . implode(",", $my['filters']['testcases']) . ") ";
    -    }  
    -
    -    $sql .= " ORDER BY NHB.node_order";
    -
    -    return $this->db->fetchRowsIntoMap($sql,'tcversion_id',database::CUMULATIVE);
    -  }
    -  
    -  /**
    -   * Returns priority (urgency * importance) as HIGH, MEDUIM or LOW depending on value
    -   * 
    -   *
    -   * @param integer $testplan_id Test Plan ID
    -   * @param  $filters: optional, map with following keys
    -   * @param  $options: optional, map with following keys
    -   *
    -   * @return 
    -   */
    -  public function getPriority($testplan_id, $filters=null, $options=null)
    -  {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $rs = null;
    -    $my = array ('filters' => array('platform_id' => null, 'tcversion_id' =>null), 
    -                 'options' => array('details' => 'tcversion'));
    -    $my['filters'] = array_merge($my['filters'], (array)$filters);
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    $sqlFilter = '';
    -    if( !is_null($my['filters']['platform_id']) )
    -    {
    -      $sqlFilter .= " AND TPTCV.platform_id = {$my['filters']['platform_id']} ";
    -    }
    -
    -    if( !is_null($my['filters']['tcversion_id']) )
    -    {
    -      $dummy = implode(',',(array)$my['filters']['tcversion_id']);
    -      $sqlFilter .= " AND TPTCV.tcversion_id IN ({$dummy}) ";
    -    }
    -        
    -    $sql = "/* $debugMsg */ ";
    -    $sql .= " SELECT (urgency * importance) AS priority,  " .
    -            " urgency,importance, " .
    -            LOW . " AS priority_level, TPTCV.tcversion_id %CLAUSE%" .
    -            " FROM {$this->tables['testplan_tcversions']} TPTCV " .
    -            " JOIN {$this->tables['tcversions']} TCV ON TPTCV.tcversion_id = TCV.id " .
    -            " WHERE TPTCV.testplan_id = {$testplan_id} {$sqlFilter}";
    -          
    -    switch($my['options']['details'])
    -    {
    -      case 'tcversion':
    -        $sql = str_ireplace("%CLAUSE%", "", $sql);
    -        $rs = $this->db->fetchRowsIntoMap($sql,'tcversion_id');
    -      break;
    -
    -      case 'platform':
    -        $sql = str_ireplace("%CLAUSE%", ", TPTCV.platform_id", $sql);
    -        $rs = $this->db->fetchMapRowsIntoMap($sql,'tcversion_id','platform_id');
    -      break;
    -    }       
    -    
    -    if( !is_null($rs) )
    -    {
    -      $key2loop = array_keys($rs);
    -      switch($my['options']['details'])
    -      {
    -        case 'tcversion':
    -          foreach($key2loop as $key)
    -          {
    -            $rs[$key]['priority_level'] = priority_to_level($rs[$key]['priority']);
    -          }
    -        break;
    -
    -        case 'platform':
    -          foreach($key2loop as  $key)
    -          {
    -            $platformSet = array_keys($rs[$key]);
    -            foreach($platformSet as $platform_id) 
    -            {
    -              $rs[$key][$platform_id]['priority_level'] = priority_to_level($rs[$key][$platform_id]['priority']);
    -            }
    -          }
    -        break;
    -      } // switch
    -    } // !is_null
    -
    -    return $rs;
    -  } 
    -  
    -} // end of class
    \ No newline at end of file
    +tables['testplan_tcversions']}
    +             SET urgency=" . $this->db->prepare_int($urgency) .
    +            " WHERE testplan_id=" . $this->db->prepare_int($testplan_id) .
    +            " AND tcversion_id=" . $this->db->prepare_int($tc_id);
    +
    +        $result = $this->db->exec_query($sql);
    +
    +        return $result ? tl::OK : tl::ERROR;
    +    }
    +
    +    /**
    +     * Set urgency for TCs (direct child only) within a Test Suite and Test Plan
    +     *
    +     * @param integer $testplan_id
    +     *            Test Plan ID
    +     * @param integer $node_id
    +     *            Test Suite to set Urgency
    +     * @param integer $urgency
    +     *
    +     * @return integer result code
    +     *
    +     * @internal 20081212 - franciscom - Postgres do not like SQL syntax with JOIN
    +     *           $sql = 'UPDATE testplan_tcversions ' .
    +     *           ' JOIN nodes_hierarchy NHA ON testplan_tcversions.tcversion_id = NHA.id '.
    +     *           ' JOIN nodes_hierarchy NHB ON NHA.parent_id = NHB.id' .
    +     *           ' SET urgency=' . $urgency .
    +     *           ' WHERE testplan_tcversions.testplan_id=' . $testplan_id .
    +     *           ' AND NHB.parent_id=' . $node_id;
    +     */
    +    public function setSuiteUrgency($testplan_id, $node_id, $urgency)
    +    {
    +        $sql = " UPDATE {$this->tables['testplan_tcversions']} " .
    +            " SET urgency=" . $this->db->prepare_int($urgency) .
    +            " WHERE testplan_id= " . $this->db->prepare_int($testplan_id) .
    +            " AND tcversion_id IN (" . " SELECT NHB.id " .
    +            " FROM {$this->tables['nodes_hierarchy']}  NHA, " .
    +            " {$this->tables['nodes_hierarchy']} NHB, {$this->tables['node_types']} NT " .
    +            " WHERE NHA.node_type_id = NT.id " .
    +            " AND NT.description='testcase' " . " AND NHB.parent_id = NHA.id " .
    +            " AND NHA.parent_id = " . $this->db->prepare_int($node_id) . " )";
    +
    +        $result = $this->db->exec_query($sql);
    +        return $result ? OK : ERROR;
    +    }
    +
    +    /**
    +     * Collect urgency for a Test Suite within a Test Plan
    +     *
    +     * @used-by planUrgency.php
    +     *
    +     *
    +     * @param integer $testplan_id
    +     *            Test Plan ID
    +     * @param integer $node_id
    +     *            Test Suite
    +     * @param integer $testproject_id
    +     *
    +     * @return array of array testcase_id, name, urgency, tcprefix, tc_external_id
    +     *
    +     * @internal revisions
    +     */
    +    public function getSuiteUrgency($context, $options = null, $filters = null)
    +    {
    +        $node_id = intval($context->tsuite_id);
    +        $testplan_id = intval($context->tplan_id);
    +        $platform_id = property_exists($context, 'platform_id') ? intval(
    +            $context->platform_id) : 0;
    +        $testproject_id = property_exists($context, 'tproject_id') ? intval(
    +            $context->tproject_id) : null;
    +
    +        $testcase_cfg = config_get('testcase_cfg');
    +        $moreFields = '';
    +        $moreJoins = '';
    +
    +        $my['options'] = array(
    +            'build4testers' => 0
    +        );
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $my['filters'] = array(
    +            'testcases' => null
    +        );
    +        $my['filters'] = array_merge($my['filters'], (array) $filters);
    +
    +        if ($my['options']['build4testers'] != 0) {
    +            $tasks = $this->assignment_types;
    +
    +            // ATTENTION:
    +            // Remember that test case execution task can be assigned to MULTIPLE USERS
    +            $moreFields = ',USERS.login AS assigned_to, USERS.first, USERS.last ';
    +
    +            $moreJoins = " LEFT JOIN {$this->tables['user_assignments']} UA " .
    +                " ON UA.feature_id = TPTCV.id " . " AND UA.type = " .
    +                $tasks['testcase_execution']['id'] . " AND UA.build_id = " .
    +                $my['options']['build4testers'] .
    +                " LEFT JOIN {$this->tables['users']} USERS " .
    +                " ON USERS.id = UA.user_id ";
    +        }
    +
    +        $sql = " SELECT testprojects.prefix  FROM {$this->tables['testprojects']} testprojects " .
    +            " WHERE testprojects.id = ";
    +
    +        if (! is_null($testproject_id)) {
    +            $sql .= intval($testproject_id);
    +        } else {
    +            $sql .= "( SELECT parent_id AS testproject_id FROM {$this->tables['nodes_hierarchy']} " .
    +                "  WHERE id=" . intval($testplan_id) . " ) ";
    +        }
    +
    +        $tcprefix = $this->db->fetchOneValue($sql) .
    +            $testcase_cfg->glue_character;
    +        $tcprefix = $this->db->prepare_string($tcprefix);
    +
    +        $sql = " SELECT DISTINCT '{$tcprefix}' AS tcprefix, NHB.name, NHB.node_order," .
    +            " NHA.parent_id AS testcase_id, TCV.tc_external_id, TPTCV.tcversion_id," .
    +            " TPTCV.urgency, TCV.importance, (TCV.importance * TPTCV.urgency) AS priority" .
    +            $moreFields . " FROM {$this->tables['nodes_hierarchy']} NHA " .
    +            " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " .
    +            " JOIN {$this->tables['testplan_tcversions']} TPTCV " .
    +            " ON TPTCV.tcversion_id=NHA.id " .
    +            " JOIN {$this->tables['tcversions']}  TCV ON TCV.id = TPTCV.tcversion_id " .
    +            $moreJoins;
    +
    +        $sql .= " WHERE TPTCV.testplan_id=" .
    +            $this->db->prepare_int($testplan_id) . " AND NHB.parent_id=" .
    +            $this->db->prepare_int($node_id);
    +
    +        if ($platform_id > 0) {
    +            $sql .= " AND TPTCV.platform_id=" .
    +                $this->db->prepare_int($platform_id);
    +        }
    +
    +        if (! is_null($my['filters']['testcases'])) {
    +            // sanitize
    +            $loop2do = count($my['filters']['testcases']);
    +            for ($gdx = 0; $gdx < $loop2do; $gdx ++) {
    +                $my['filters']['testcases'][$gdx] = intval(
    +                    $my['filters']['testcases'][$gdx]);
    +            }
    +            $sql .= " AND NHB.id IN (" .
    +                implode(",", $my['filters']['testcases']) . ") ";
    +        }
    +
    +        $sql .= " ORDER BY NHB.node_order";
    +
    +        return $this->db->fetchRowsIntoMap($sql, 'tcversion_id',
    +            database::CUMULATIVE);
    +    }
    +
    +    /**
    +     * Returns priority (urgency * importance) as HIGH, MEDUIM or LOW depending on value
    +     *
    +     *
    +     * @param integer $testplan_id
    +     *            Test Plan ID
    +     * @param $filters: optional,
    +     *            map with following keys
    +     * @param $options: optional,
    +     *            map with following keys
    +     *
    +     * @return
    +     */
    +    public function getPriority($testplan_id, $filters = null, $options = null)
    +    {
    +        $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    +        $rs = null;
    +        $my = array(
    +            'filters' => array(
    +                'platform_id' => null,
    +                'tcversion_id' => null
    +            ),
    +            'options' => array(
    +                'details' => 'tcversion'
    +            )
    +        );
    +        $my['filters'] = array_merge($my['filters'], (array) $filters);
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $sqlFilter = '';
    +        if (! is_null($my['filters']['platform_id'])) {
    +            $sqlFilter .= " AND TPTCV.platform_id = {$my['filters']['platform_id']} ";
    +        }
    +
    +        if (! is_null($my['filters']['tcversion_id'])) {
    +            $dummy = implode(',', (array) $my['filters']['tcversion_id']);
    +            $sqlFilter .= " AND TPTCV.tcversion_id IN ({$dummy}) ";
    +        }
    +
    +        $sql = "/* $debugMsg */ ";
    +        $sql .= " SELECT (urgency * importance) AS priority,  " .
    +            " urgency,importance, " . LOW .
    +            " AS priority_level, TPTCV.tcversion_id %CLAUSE%" .
    +            " FROM {$this->tables['testplan_tcversions']} TPTCV " .
    +            " JOIN {$this->tables['tcversions']} TCV ON TPTCV.tcversion_id = TCV.id " .
    +            " WHERE TPTCV.testplan_id = {$testplan_id} {$sqlFilter}";
    +
    +        switch ($my['options']['details']) {
    +            case 'tcversion':
    +                $sql = str_ireplace("%CLAUSE%", "", $sql);
    +                $rs = $this->db->fetchRowsIntoMap($sql, 'tcversion_id');
    +                break;
    +
    +            case 'platform':
    +                $sql = str_ireplace("%CLAUSE%", ", TPTCV.platform_id", $sql);
    +                $rs = $this->db->fetchMapRowsIntoMap($sql, 'tcversion_id',
    +                    'platform_id');
    +                break;
    +        }
    +
    +        if (! is_null($rs)) {
    +            $key2loop = array_keys($rs);
    +            switch ($my['options']['details']) {
    +                case 'tcversion':
    +                    foreach ($key2loop as $key) {
    +                        $rs[$key]['priority_level'] = priority_to_level(
    +                            $rs[$key]['priority']);
    +                    }
    +                    break;
    +
    +                case 'platform':
    +                    foreach ($key2loop as $key) {
    +                        $platformSet = array_keys($rs[$key]);
    +                        foreach ($platformSet as $platform_id) {
    +                            $rs[$key][$platform_id]['priority_level'] = priority_to_level(
    +                                $rs[$key][$platform_id]['priority']);
    +                        }
    +                    }
    +                    break;
    +            }
    +        }
    +
    +        return $rs;
    +    }
    +}
    diff --git a/lib/functions/testcase.class.php b/lib/functions/testcase.class.php
    index 06818dcf0e..522fa82081 100644
    --- a/lib/functions/testcase.class.php
    +++ b/lib/functions/testcase.class.php
    @@ -1,2714 +1,2850 @@
    - lang_get('the_format_tc_xml_import'));
    -
    -/**
    - * class for Test case CRUD
    - * @package   TestLink
    - */
    -class testcase extends tlObjectWithAttachments {
    -  const AUTOMATIC_ID=0;
    -  const DEFAULT_ORDER=0;
    -  const ALL_VERSIONS=0;
    -  const LATEST_VERSION=-1;
    -  const AUDIT_OFF=0;
    -  const AUDIT_ON=1;
    -  const CHECK_DUPLICATE_NAME=1;
    -  const DONT_CHECK_DUPLICATE_NAME=0;
    -  const ENABLED=1;
    -  const ALL_TESTPLANS=null;
    -  const ANY_BUILD=null;
    -  const GET_NO_EXEC=1;
    -  const ANY_PLATFORM=null;
    -  const NOXMLHEADER=true;
    -  const EXECUTION_TYPE_MANUAL = 1;
    -  const EXECUTION_TYPE_AUTO = 2;
    -
    -  const NAME_PHOPEN = '[[';
    -  const NAME_PHCLOSE = ']]';
    -  const NAME_DIVIDE = '::';
    -
    -  const GHOSTBEGIN = '[ghost]';
    -  const GHOSTEND = '[/ghost]';
    -  const GHOST_TC_VERSION = '"TestCase":"%s","Version":"%s"';
    -  const GHOSTMASK = self::GHOSTBEGIN . self::GHOST_TC_VERSION . self::GHOSTEND;
    -  const GHOSTSTEPMASK = self::GHOSTBEGIN .'"Step":"%s",' . self::GHOST_TC_VERSION . self::GHOSTEND;
    -  const GHOSTPRECONDITIONSMASK = self::GHOSTBEGIN . '"Preconditions":"x",' . self::GHOST_TC_VERSION . self::GHOSTEND;
    -
    -  /** @var database handler */
    -  var $db;
    -  var $tree_manager;
    -  var $tproject_mgr;
    -
    -  var $node_types_descr_id;
    -  var $node_types_id_descr;
    -  var $my_node_type;
    -
    -  var $assignment_mgr;
    -  var $assignment_types;
    -  var $assignment_status;
    -
    -  var $cfield_mgr;
    -
    -  var $import_file_types = array("XML" => "XML");
    -  var $export_file_types = array("XML" => "XML");
    -  var $execution_types = array();
    -  var $cfg;
    -  var $debugMsg;
    -  var $layout;
    -  var $XMLCfg;
    -  var $tproject_id;
    -
    -  var $keywordAnnotations = [];
    -
    -  /**
    -   * testcase class constructor
    -   *
    -   * @param resource &$db reference to database handler
    -   */
    -  function __construct(&$db) {
    -    $this->db = &$db;
    -    $this->tproject_mgr = new testproject($this->db);
    -    $this->tree_manager = &$this->tproject_mgr->tree_manager;
    -
    -    $this->node_types_descr_id=$this->tree_manager->get_available_node_types();
    -    $this->node_types_id_descr=array_flip($this->node_types_descr_id);
    -    $this->my_node_type=$this->node_types_descr_id['testcase'];
    -
    -    $this->assignment_mgr=New assignment_mgr($this->db);
    -    $this->assignment_types=$this->assignment_mgr->get_available_types();
    -    $this->assignment_status=$this->assignment_mgr->get_available_status();
    -
    -    $this->cfield_mgr = new cfield_mgr($this->db);
    -
    -    $this->execution_types = $this->getExecutionTypes();
    -
    -    $this->layout = $this->getLayout();
    -
    -    $this->cfg = new stdClass();
    -    $this->cfg->testcase = config_get('testcase_cfg');
    -    $this->cfg->execution = config_get('exec_cfg');
    -    $this->cfg->cfield = config_get('custom_fields');
    -
    -    $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: ';
    -
    -
    -    $this->XMLCfg = new stdClass();
    -    $this->XMLCfg->att = $this->getAttXMLCfg();
    -    $this->XMLCfg->req = $this->getReqXMLCfg();
    -
    -    $this->keywordAnnotations = config_get("keywords")->annotations;
    -
    -    // ATTENTION:
    -    // second argument is used to set $this->attachmentTableName,property that this calls
    -    // get from his parent
    -    // ORIGINAL
    -    // parent::__construct($this->db,"nodes_hierarchy");
    -    parent::__construct($this->db,"tcversions");
    -  }
    -
    -  /**
    -   *
    -   */
    -  function setTestProject($tproject_id) {
    -    $this->tproject_id = intval($tproject_id);
    -  }
    -
    -  /**
    -   *
    -   */
    -  static function getExecutionTypes() {
    -    $stdSet = array(self::EXECUTION_TYPE_MANUAL => lang_get('manual'),
    -                    self::EXECUTION_TYPE_AUTO => lang_get('automated'));
    -
    -    if( !is_null($customSet = config_get('custom_execution_types')) )
    -    {
    -      foreach($customSet as $code => $lbl)
    -      {
    -        $stdSet[$code] = lang_get($lbl);
    -      }
    -    }
    -    return $stdSet;
    -  }
    -
    -
    -  /**
    -   *
    -   */
    -  function getName($tcase_id) {
    -    $info  = $this->tree_manager->get_node_hierarchy_info($tcase_id);
    -    return $info['name'];
    -  }
    -
    -  /**
    -   *
    -   */
    -  function getFileUploadRelativeURL($identity) {
    -    $url = "lib/testcases/tcEdit.php?doAction=fileUpload&" . 
    -           "&tcase_id=" . intval($identity->tcase_id) .
    -           "&tcversion_id=" . intval($identity->tcversion_id) .
    -           "&tproject_id=" . intval($identity->tproject_id);
    -    return $url;
    -  }
    -
    -  /**
    -   *
    -   */
    -  function getDeleteAttachmentRelativeURL($identity) {
    -    $url = "lib/testcases/tcEdit.php?doAction=deleteFile&tcase_id=" . intval($identity->tcase_id) .
    -           "&tcversion_id=" . intval($identity->tcversion_id) .
    -           "&tproject_id=" . intval($identity->tproject_id) . "&file_id=" ;
    -
    -    return $url;
    -  }
    -
    -
    -  /**
    -   *
    -   */
    -  function getDeleteAttachmentByIDRelativeURL($identity,&$guiObj=null) {
    -    $url = "lib/testcases/tcEdit.php?doAction=deleteFile&tcase_id=" . 
    -           intval($identity->tcase_id) .
    -           "&tproject_id=" . intval($identity->tproject_id) . "&file_id=" ;
    -
    -    // needed for IVU 2019 implementation
    -    if( null != $guiObj ) {
    -      $p2l = array('show_mode','tplan_id');
    -      foreach($p2l as $pr) {
    -        if( property_exists($guiObj, $pr) ) {
    -          $url .= "&$pr=" . $guiObj->$pr;
    -        }        
    -      }
    -    }        
    -
    -    $url .= "&file_id=" ;
    -    return $url;
    -  }
    -
    -  /**
    -   *
    -   */
    -  function getDeleteTCVRelationRelativeURL($identity,&$guiObj=null) {
    -    $url = "lib/testcases/tcEdit.php?doAction=doDeleteRelation";
    -
    -    // needed for IVU 2019 implementation
    -    if( null != $guiObj ) {
    -      $p2l = array('show_mode','tplan_id');
    -      foreach($p2l as $pr) {
    -        if( property_exists($guiObj, $pr) ) {
    -          $url .= "&$pr=" . $guiObj->$pr;
    -        }        
    -      }
    -    }        
    -           
    -    $url .= '&tcase_id=%1&relation_id=%2';
    -
    -    return $url;
    -  }
    -
    -  /**
    -   *
    -   */
    -  function getDeleteTCVKeywordRelativeURL($identity,&$guiObj=null) {
    -    $url = "lib/testcases/tcEdit.php?doAction=removeKeyword";
    -
    -    // needed for IVU 2019 implementation
    -    if( null != $guiObj ) {
    -      $p2l = array('show_mode','tplan_id');
    -      foreach($p2l as $pr) {
    -        if( property_exists($guiObj, $pr) ) {
    -          $url .= "&$pr=" . $guiObj->$pr;
    -        }        
    -      }
    -    }        
    -           
    -    $url .= '&tcase_id=%1&tckw_link_id=%2';
    -    return $url;
    -  }
    -
    -
    -  /*
    -    function: get_export_file_types
    -              getter
    -
    -    args: -
    -
    -    returns: map
    -             key: export file type code
    -             value: export file type verbose description
    -
    -  */
    -  function get_export_file_types()
    -  {
    -    return $this->export_file_types;
    -  }
    -
    -  /*
    -    function: get_impor_file_types
    -              getter
    -
    -    args: -
    -
    -    returns: map
    -             key: import file type code
    -             value: import file type verbose description
    -
    -  */
    -  function get_import_file_types()
    -  {
    -    return $this->import_file_types;
    -  }
    -
    -  /*
    -     function: get_execution_types
    -               getter
    -
    -     args: -
    -
    -     returns: map
    -              key: execution type code
    -              value: execution type verbose description
    -
    -  */
    -  function get_execution_types()
    -  {
    -    return $this->execution_types;
    -  }
    -
    -
    -  /**
    -   *  just a wrapper
    -   *
    -   */
    -  function createFromObject($item) {
    -    static $wkfstatus;
    -
    -    if(is_null($wkfstatus)) {
    -      $wkfstatus = config_get('testCaseStatus');
    -    }
    -    $options = array('check_duplicate_name' => self::CHECK_DUPLICATE_NAME,
    -                     'action_on_duplicate_name' => 'block',
    -                     'estimatedExecDuration' => 0,
    -                     'status' => $wkfstatus['draft'], 'importLogic' => null);
    -
    -    if(property_exists($item, 'estimatedExecDuration')) {
    -      $options['estimatedExecDuration'] = floatval($item->estimatedExecDuration);
    -    }
    -
    -    if(property_exists($item, 'status')) {
    -      $options['status'] = intval($item->status);
    -    }
    -
    -
    -    if(property_exists($item, 'importLogic')) {
    -      $options['importLogic'] = $item->importLogic;
    -    }
    -
    -    $ret = $this->create($item->testSuiteID,$item->name,$item->summary,$item->preconditions,
    -                         $item->steps,$item->authorID,'',$item->order,self::AUTOMATIC_ID,
    -                         $item->executionType,$item->importance,$options);
    -    return $ret;
    -  }
    -
    -  /**
    -   * create a test case
    -   *
    -   */
    -  function create($parent_id,$name,$summary,$preconditions,$steps,$author_id,
    -                  $keywords_id='',$tc_order=self::DEFAULT_ORDER,$id=self::AUTOMATIC_ID,
    -                  $execution_type = TESTCASE_EXECUTION_TYPE_MANUAL,
    -                  $importance=2,$options=null) {
    -    $status_ok = 1;
    -
    -    $my['options'] = array( 'check_duplicate_name' => self::DONT_CHECK_DUPLICATE_NAME,
    -                            'action_on_duplicate_name' => 'generate_new',
    -                            'estimatedExecDuration' => null,'status' => null,'active' => null,'is_open' => null,
    -                            'importLogic' => null);
    -
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    if( trim($summary) != '' ) {
    -      if( strpos($summary,self::NAME_PHOPEN) !== FALSE && strpos($summary,self::NAME_PHCLOSE) !== FALSE ) {
    -        $name = $this->buildTCName($name,$summary);
    -      }
    -    }
    -
    -    if( trim($preconditions) != '' ) {
    -      if( strpos($preconditions,self::NAME_PHOPEN) !== FALSE && 
    -          strpos($preconditions,self::NAME_PHCLOSE) !== FALSE ) {
    -        $name = $this->buildTCName($name,$preconditions);
    -      }
    -    }
    -
    -    $ret = $this->create_tcase_only($parent_id,$name,$tc_order,$id,$my['options']);
    -
    -
    -    $tcase_id = $ret['id'];
    -    $ix = new stdClass();
    -
    -    if($ret["status_ok"]) {
    -      $ix->version = 1;
    -      if(isset($ret['version_number']) && $ret['version_number'] < 0) {
    -        // We are in the special situation we are only creating a new version,
    -        // useful when importing test cases. Need to get last version number.
    -        // I do not use create_new_version() because it does a copy ot last version
    -        // and do not allow to set new values in different fields while doing this operation.
    -        $last_version_info = $this->get_last_version_info($ret['id'],array('output' => 'minimun'));
    -
    -        $ix->version = $last_version_info['version']+1;
    -        $ret['msg'] = sprintf($ret['msg'],$ix->version);
    -        $ret['version_number'] = $ix->version;
    -      }
    -
    -      // Multiple Test Case Steps Feature
    -      $version_number = $ret['version_number'];
    -
    -      $ix->id = $tcase_id;
    -      $ix->externalID = $ret['external_id'];
    -      $ix->summary = $summary;
    -      $ix->preconditions = $preconditions;
    -      $ix->steps = $steps;
    -      $ix->authorID = $author_id;
    -      $ix->executionType = $execution_type;
    -      $ix->importance = $importance;
    -      $ix->status = $my['options']['status'];
    -      $ix->active = $my['options']['active'];
    -      $ix->is_open = $my['options']['is_open'];
    -      $ix->estimatedExecDuration = $my['options']['estimatedExecDuration'];
    -
    -
    -      $op = $this->createVersion($ix);
    -      if(trim($keywords_id) != "") {
    -        $a_keywords = explode(",",$keywords_id);
    -        $auditContext = array('on' => self::AUDIT_ON, 
    -                              'version' => $version_number);
    -        $this->addKeywords($tcase_id,$op['id'],$a_keywords,$auditContext);
    -      }
    -
    -      if($ret['update_name']) {
    -        $sql = " UPDATE {$this->tables['nodes_hierarchy']} SET name='" .
    -               $this->db->prepare_string($name) . "' WHERE id= " . intval($ret['id']);
    -        $this->db->exec_query($sql);
    -      }
    -
    -      $ret['msg'] = $op['status_ok'] ? $ret['msg'] : $op['msg'];
    -      $ret['tcversion_id'] = $op['status_ok'] ? $op['id'] : -1;
    -
    -      $ctx = array('test_suite_id' => $parent_id,'id' => $id,'name' => $name,
    -                   'summary' => $summary,'preconditions' => $preconditions,
    -                   'steps' => $steps,'author_id' => $author_id,
    -                   'keywords_id' => $keywords_id,
    -                   'order' => $tc_order, 'exec_type' => $execution_type,
    -                   'importance' => $importance,'options' => $options);
    -      event_signal('EVENT_TEST_CASE_CREATE', $ctx);
    -    }
    -    return $ret;
    -  }
    -
    -  /*
    -    [$check_duplicate_name]
    -    [$action_on_duplicate_name]
    -    [$order]
    -
    -    [$id]
    -         0 -> the id will be assigned by dbms
    -         x -> this will be the id
    -              Warning: no check is done before insert => can got error.
    -
    -  return:
    -         $ret['id']
    -         $ret['external_id']
    -         $ret['status_ok']
    -         $ret['msg'] = 'ok';
    -         $ret['new_name']
    -
    -  rev:
    -
    -  */
    -  function create_tcase_only($parent_id,$name,$order=self::DEFAULT_ORDER,$id=self::AUTOMATIC_ID,
    -                             $options=null) {
    -    $dummy = config_get('field_size');
    -    $name_max_len = $dummy->testcase_name;
    -    $name = trim($name);
    -    $originalNameLen = tlStringLen($name);
    -
    -    $getOptions = array();
    -    $ret = array('id' => -1,'external_id' => 0, 'status_ok' => 1,'msg' => 'ok',
    -                 'new_name' => '', 'version_number' => 1, 'has_duplicate' => false,
    -                 'external_id_already_exists' => false, 'update_name' => false);
    -
    -    $my['options'] = array('check_duplicate_name' => self::DONT_CHECK_DUPLICATE_NAME,
    -                           'action_on_duplicate_name' => 'generate_new',
    -                           'external_id' => null, 'importLogic' => null);
    -
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    $doCreate=true;
    -    $forceGenerateExternalID = false;
    -
    -    $algo_cfg = config_get('testcase_cfg')->duplicated_name_algorithm;
    -    $getDupOptions['check_criteria'] = ($algo_cfg->type == 'counterSuffix') ? 'like' : '=';
    -    $getDupOptions['access_key'] = ($algo_cfg->type == 'counterSuffix') ? 'name' : 'id';
    -
    -
    -
    -    // If external ID has been provided, check if exists.
    -    // If answer is yes, then
    -    // 1. collect current info
    -    // 2. if $my['options']['check_duplicate_name'] is create new version
    -    //    change to BLOCK
    -    //
    -    if( !is_null($my['options']['importLogic']) ) {
    -      $doQuickReturn = false;
    -      switch($my['options']['importLogic']['hitCriteria']) {
    -        case 'externalID':
    -          if( ($sf = intval($my['options']['external_id'])) > 0 ) {
    -            // check if already exists a test case with this external id
    -            $info = $this->get_by_external($sf, $parent_id);
    -            if( !is_null($info)) {
    -              if( count($info) > 1) {
    -                // abort
    -                throw new Exception("More than one test case with same external ID");
    -              }
    -
    -              $doQuickReturn = true;
    -              $ret['id'] = key($info);
    -              $ret['external_id'] = $sf;
    -              $ret['version_number'] = -1;
    -              $ret['external_id_already_exists'] = true;
    -            }
    -          }
    -
    -          switch($my['options']['importLogic']['actionOnHit']) {
    -            case 'create_new_version':
    -              if($doQuickReturn) {
    -                // I this situation we will need to also update test case name, if user
    -                // has provided one on import file.
    -                // Then we need to check that new name will not conflict with an existing one
    -                $doCreate = false;
    -                if( strcmp($info[key($info)]['name'],$name) != 0) {
    -                  $itemSet = $this->getDuplicatesByName($name,$parent_id,$getDupOptions);
    -                  if( is_null($itemSet) ) {
    -                    $ret['name'] = $name;
    -                    $ret['update_name'] = true;
    -                  }
    -                }
    -                return $ret;
    -              }
    -            break;
    -
    -            case 'generate_new':
    -              // on GUI => create a new test case with a different title
    -              // IMPORTANT:
    -              // if name provided on import file does not hit an existent one
    -              // then I'm going to use it, instead of generating a NEW NAME
    -              $forceGenerateExternalID = true;
    -            break;
    -          }
    -        break;
    -      }
    -    }
    -
    -
    -    if ($my['options']['check_duplicate_name']) {
    -      $itemSet = $this->getDuplicatesByName($name,$parent_id,$getDupOptions);
    -
    -      if( !is_null($itemSet) && ($siblingQty=count($itemSet)) > 0 ) {
    -        $ret['has_duplicate'] = true;
    -
    -        switch($my['options']['action_on_duplicate_name']) {
    -            case 'block':
    -              $doCreate=false;
    -              $ret['status_ok'] = 0;
    -              $ret['msg'] = sprintf(lang_get('testcase_name_already_exists'),$name);
    -            break;
    -
    -            case 'generate_new':
    -              $doCreate=true;
    -
    -              // TICKET 5159: importing duplicate test suites
    -              // Need to force use of generated External ID
    -              // (this seems the best alternative)
    -              $my['options']['external_id'] = null;
    -
    -              switch($algo_cfg->type) {
    -                case 'stringPrefix':
    -                  $doIt = true;
    -                  while($doIt) {
    -                    if( $doIt = !is_null($itemSet) ) {
    -                      $prefix = @strftime($algo_cfg->text,time());
    -                      $target = $prefix . " " . $name ;
    -                      $final_len = strlen($target);
    -                      if( $final_len > $name_max_len)
    -                      {
    -                        $target = substr($target,0,$name_max_len);
    -                      }
    -
    -                      // Check new generated name
    -                      $itemSet = $this->getDuplicatesByName($target,$parent_id,$getDupOptions);
    -                    }
    -                  }
    -                  $name = $target;
    -                break;
    -
    -                case 'counterSuffix':
    -                  $mask =  !is_null($algo_cfg->text) ? $algo_cfg->text : '#%s';
    -                  $nameSet = array_flip(array_keys($itemSet));
    -
    -                  // 20110109 - franciscom
    -                  // does not understand why I've choosen time ago
    -                  // to increment $siblingQty before using it
    -                  // This way if TC X exists on target parent
    -                  // I will create TC X [2] insteand of TC X [1]
    -                  // Anyway right now I will not change.
    -                  $target = $name . ($suffix = sprintf($mask,++$siblingQty));
    -                  $final_len = strlen($target);
    -                  if( $final_len > $name_max_len) {
    -                    $target = substr($target,strlen($suffix),$name_max_len);
    -                  }
    -
    -                  // Need to recheck if new generated name does not crash with existent name
    -                  // why? Suppose you have created:
    -                  // TC [1]
    -                  // TC [2]
    -                  // TC [3]
    -                  // Then you delete TC [2].
    -                  // When I got siblings  il will got 2 siblings, if I create new progressive using next,
    -                  // it will be 3 => I will get duplicated name.
    -                  while( isset($nameSet[$target]) )
    -                  {
    -                    $target = $name . ($suffix = sprintf($mask,++$siblingQty));
    -                    $final_len = strlen($target);
    -                    if( $final_len > $name_max_len) {
    -                      $target = substr($target,strlen($suffix),$name_max_len);
    -                    }
    -                  }
    -                  $name = $target;
    -                break;
    -              }
    -
    -              $ret['status_ok'] = 1;
    -              $ret['new_name'] = $name;
    -              $ret['msg'] = sprintf(lang_get('created_with_title'),$name);
    -            break;
    -
    -            case 'create_new_version':
    -              $doCreate = false;
    -
    -              // If we found more that one with same name and same parent,
    -              // will take the first one.
    -              $xx = current($itemSet);
    -              $ret['id'] = $xx['id'];
    -              $ret['external_id']=$xx['tc_external_id'];
    -              $ret['status_ok'] = 1;
    -              $ret['new_name'] = $name;
    -              $ret['version_number'] = -1;
    -              $ret['msg'] = lang_get('create_new_version');
    -            break;
    -
    -            default:
    -            break;
    -        }
    -      }
    -    }
    -
    -    // 20120822 - think we have potencial issue, because we never check if
    -    // duplicated EXTERNAL ID exists.
    -    // Right now there is no time to try a fix
    -    if( $ret['status_ok'] && $doCreate)
    -    {
    -
    -      $safeLenName = tlSubStr($name, 0, $name_max_len);
    -
    -      // Get tproject id
    -      $path2root = $this->tree_manager->get_path($parent_id);
    -      $tproject_id = $path2root[0]['parent_id'];
    -
    -      $tcase_id = $this->tree_manager->new_node($parent_id,$this->my_node_type,$safeLenName,$order,$id);
    -      $ret['id'] = $tcase_id;
    -
    -      $generateExtID = false;
    -      if( $forceGenerateExternalID || is_null($my['options']['external_id']) )
    -      {
    -        $generateExtID = true;
    -      }
    -      else
    -      {
    -        // this need more work and checks (20140209)
    -        $sf = intval($my['options']['external_id']);
    -        if( is_null($this->get_by_external($sf, $parent_id)) )
    -        {
    -          $ret['external_id'] = $sf;
    -
    -          // CRITIC: setTestCaseCounter() will update only if new provided value > current value
    -          $this->tproject_mgr->setTestCaseCounter($tproject_id,$ret['external_id']);
    -
    -        }
    -        else
    -        {
    -          $generateExtID = true;
    -        }
    -
    -      }
    -      if( $generateExtID )
    -      {
    -        $ret['external_id'] = $this->tproject_mgr->generateTestCaseNumber($tproject_id);
    -      }
    -
    -      if( !$ret['has_duplicate'] && ($originalNameLen > $name_max_len) )
    -      {
    -        $ret['new_name'] = $safeLenName;
    -        $ret['msg'] = sprintf(lang_get('testcase_name_length_exceeded'),$originalNameLen,$name_max_len);
    -      }
    -    }
    -
    -    return $ret;
    -  }
    -
    -
    -  /**
    -   *  trying to solve tree_manager->new_node($item->id,
    -                        $this->node_types_descr_id['testcase_version']);
    -
    -    $this->CKEditorCopyAndPasteCleanUp($item,array('summary','preconditions')); 
    -
    -    $sql = "/* $debugMsg */ INSERT INTO {$this->tables['tcversions']} " .
    -           " (id,tc_external_id,version,summary,preconditions," .
    -           "  author_id,creation_ts,execution_type,importance ";
    -
    -    $sqlValues = " VALUES({$tcase_version_id},{$item->externalID},{$item->version},'" .
    -                 $this->db->prepare_string($item->summary) . "','" .
    -                 $this->db->prepare_string($item->preconditions) . "'," .
    -                 $this->db->prepare_int($item->authorID) . "," . $this->db->db_now() .
    -                 ", {$item->executionType},{$item->importance} ";
    -
    -
    -    if( !is_null($item->status) ) {
    -      $wf = intval($item->status);
    -      $sql .= ',status';
    -      $sqlValues .= ",{$wf}";
    -    }
    -
    -    if( !is_null($item->estimatedExecDuration) ) {
    -      $v = trim($item->estimatedExecDuration);
    -      if($v != '') {
    -        $sql .= ", estimated_exec_duration";
    -        $sqlValues .= "," . floatval($v);
    -      }
    -    }
    -
    -    if( property_exists($item,'active') && !is_null($item->active) ) {
    -      $v = intval($item->active) > 0 ? 1 : 0;
    -      $sql .= ", active";
    -      $sqlValues .= "," . $v;
    -    }
    -	  
    -    if( property_exists($item,'is_open') && !is_null($item->is_open) ) {
    -      $v = intval($item->is_open) > 0 ? 1 : 0;
    -      $sql .= ", is_open";
    -      $sqlValues .= "," . $v;
    -    }
    -
    -    $sql .= " )" . $sqlValues . " )";
    -
    -
    -
    -    $result = $this->db->exec_query($sql);
    -
    -    $ret['msg']='ok';
    -    $ret['id'] = $tcase_version_id;
    -    $ret['status_ok']=1;
    -
    -    if ($result && ( !is_null($item->steps) && is_array($item->steps) ) ) {
    -      $steps2create = count($item->steps);
    -      $op['status_ok'] = 1;
    -
    -      // need to this to manage call to this method for REST API.
    -      $stepIsObject =  is_object($item->steps[0]);
    -      for($jdx=0 ; ($jdx < $steps2create && $op['status_ok']); $jdx++) {
    -        if($stepIsObject) {
    -          $item->steps[$jdx] = (array)$item->steps[$jdx];
    -        }
    -
    -        $this->create_step($tcase_version_id,
    -                           $item->steps[$jdx]['step_number'],
    -                           $item->steps[$jdx]['actions'],
    -                           $item->steps[$jdx]['expected_results'],
    -                           $item->steps[$jdx]['execution_type']);
    -      }
    -    }
    -
    -    if (!$result) {
    -      $ret['msg'] = $this->db->error_msg();
    -      $ret['status_ok']=0;
    -      $ret['id']=-1;
    -    }
    -
    -    return $ret;
    -  }
    -
    -
    -  /*
    -    function: getDuplicatesByname
    -
    -    args: $name
    -          $parent_id
    -
    -    returns: hash
    -  */
    -  function getDuplicatesByName($name, $parent_id, $options=null) {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -
    -    $my['options'] = array( 'check_criteria' => '=', 'access_key' => 'id', 'id2exclude' => null);
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    $target = $this->db->prepare_string($name);
    -    switch($my['options']['check_criteria']) {
    -      case '=':
    -      default:
    -        $check_criteria = " AND NHA.name = '{$target}' ";
    -      break;
    -
    -      case 'like':
    -        // % and _ need to be escaped, but method is different
    -        // according DBMS
    -        $check_criteria = " AND NHA.name LIKE '{$target}%' ";
    -      break;
    -
    -    }
    -
    -    $sql = " SELECT DISTINCT NHA.id,NHA.name,TCV.tc_external_id" .
    -           " FROM {$this->tables['nodes_hierarchy']} NHA, " .
    -           " {$this->tables['nodes_hierarchy']} NHB, {$this->tables['tcversions']} TCV  " .
    -           " WHERE NHA.node_type_id = {$this->my_node_type} " .
    -           " AND NHB.parent_id=NHA.id " .
    -           " AND TCV.id=NHB.id " .
    -           " AND NHB.node_type_id = {$this->node_types_descr_id['testcase_version']} " .
    -           " AND NHA.parent_id=" . $this->db->prepare_int($parent_id) . " {$check_criteria}";
    -
    -    if( !is_null($my['options']['id2exclude']) ) {
    -      $sql .= " AND NHA.id <> " . intval($my['options']['id2exclude']);
    -    }
    -
    -    $rs = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']);
    -
    -    if( is_null($rs) || count($rs) == 0 ) {
    -      $rs=null;
    -    }
    -    return $rs;
    -  }
    -
    -
    -
    -
    -  /*
    -    function: get_by_name
    -
    -    args: $name
    -          [$tsuite_name]: name of parent test suite
    -          [$tproject_name]
    -
    -    returns: hash
    -
    -    @internal revisions
    -    20100831 - franciscom - BUGID 3729
    -
    -  */
    -  function get_by_name($name, $tsuite_name = '', $tproject_name = '')
    -  {
    -
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -
    -    $recordset = null;
    -    $filters_on = array('tsuite_name' => false, 'tproject_name' => false);
    -    $field_size = config_get('field_size');
    -    $tsuite_name = tlSubStr(trim($tsuite_name),0, $field_size->testsuite_name);
    -    $tproject_name = tlSubStr(trim($tproject_name),0,$field_size->testproject_name);
    -    $name = tlSubStr(trim($name), 0, $field_size->testcase_name);
    -
    -    $sql = "/* $debugMsg */ " .
    -           " SELECT DISTINCT NH_TCASE.id,NH_TCASE.name,NH_TCASE_PARENT.id AS parent_id," .
    -           " NH_TCASE_PARENT.name AS tsuite_name, TCV.tc_external_id " .
    -           " FROM {$this->tables['nodes_hierarchy']} NH_TCASE, " .
    -           " {$this->tables['nodes_hierarchy']} NH_TCASE_PARENT, " .
    -           " {$this->tables['nodes_hierarchy']} NH_TCVERSIONS," .
    -           " {$this->tables['tcversions']}  TCV  " .
    -           " WHERE NH_TCASE.node_type_id = {$this->my_node_type} " .
    -           " AND NH_TCASE.name = '{$this->db->prepare_string($name)}' " .
    -           " AND TCV.id=NH_TCVERSIONS.id " .
    -           " AND NH_TCVERSIONS.parent_id=NH_TCASE.id " .
    -           " AND NH_TCASE_PARENT.id=NH_TCASE.parent_id ";
    -
    -    if($tsuite_name != "")
    -    {
    -      $sql .= " AND NH_TCASE_PARENT.name = '{$this->db->prepare_string($tsuite_name)}' " .
    -              " AND NH_TCASE_PARENT.node_type_id = {$this->node_types_descr_id['testsuite']} ";
    -    }
    -    $recordset = $this->db->get_recordset($sql);
    -    if(count($recordset) && $tproject_name != "")
    -    {
    -      list($tproject_info)=$this->tproject_mgr->get_by_name($tproject_name);
    -      foreach($recordset as $idx => $tcase_info)
    -      {
    -        if( $this->get_testproject($tcase_info['id']) != $tproject_info['id'] )
    -        {
    -          unset($recordset[$idx]);
    -        }
    -      }
    -    }
    -    return $recordset;
    -  }
    -
    -
    -  /*
    -  get array of info for every test case
    -  without any kind of filter.
    -  Every array element contains an assoc array with testcase info
    -
    -  */
    -  function get_all() {
    -    $sql = " SELECT nodes_hierarchy.name, nodes_hierarchy.id
    + lang_get('the_format_tc_xml_import')
    +);
    +
    +/**
    + * class for Test case CRUD
    + *
    + * @package TestLink
    + */
    +class testcase extends tlObjectWithAttachments
    +{
    +
    +    const AUTOMATIC_ID = 0;
    +
    +    const DEFAULT_ORDER = 0;
    +
    +    const ALL_VERSIONS = 0;
    +
    +    const LATEST_VERSION = - 1;
    +
    +    const AUDIT_OFF = 0;
    +
    +    const AUDIT_ON = 1;
    +
    +    const CHECK_DUPLICATE_NAME = 1;
    +
    +    const DONT_CHECK_DUPLICATE_NAME = 0;
    +
    +    const ENABLED = 1;
    +
    +    const ALL_TESTPLANS = null;
    +
    +    const ANY_BUILD = null;
    +
    +    const GET_NO_EXEC = 1;
    +
    +    const ANY_PLATFORM = null;
    +
    +    const NOXMLHEADER = true;
    +
    +    const EXECUTION_TYPE_MANUAL = 1;
    +
    +    const EXECUTION_TYPE_AUTO = 2;
    +
    +    const NAME_PHOPEN = '[[';
    +
    +    const NAME_PHCLOSE = ']]';
    +
    +    const NAME_DIVIDE = '::';
    +
    +    const GHOSTBEGIN = '[ghost]';
    +
    +    const GHOSTEND = '[/ghost]';
    +
    +    const GHOST_TC_VERSION = '"TestCase":"%s","Version":"%s"';
    +
    +    const GHOSTMASK = self::GHOSTBEGIN . self::GHOST_TC_VERSION . self::GHOSTEND;
    +
    +    const GHOSTSTEPMASK = self::GHOSTBEGIN . '"Step":"%s",' .
    +        self::GHOST_TC_VERSION . self::GHOSTEND;
    +
    +    const GHOSTPRECONDITIONSMASK = self::GHOSTBEGIN . '"Preconditions":"x",' .
    +        self::GHOST_TC_VERSION . self::GHOSTEND;
    +
    +    /**
    +     *
    +     * @var database handler
    +     */
    +    protected $db;
    +
    +    public $tree_manager;
    +
    +    /**
    +     *
    +     * @var \testproject
    +     */
    +    public $tproject_mgr;
    +
    +    private array $node_types_descr_id;
    +
    +    private array $node_types_id_descr;
    +
    +    public $my_node_type;
    +
    +    private \assignment_mgr $assignment_mgr;
    +
    +    private array $assignment_types;
    +
    +    private array $assignment_status;
    +
    +    /**
    +     *
    +     * @var \cfield_mgr
    +     */
    +    public $cfield_mgr;
    +
    +    private array $import_file_types = array(
    +        "XML" => "XML"
    +    );
    +
    +    private array $export_file_types = array(
    +        "XML" => "XML"
    +    );
    +
    +    private $execution_types = array();
    +
    +    private \stdClass $cfg;
    +
    +    private string $debugMsg;
    +
    +    private $layout;
    +
    +    private \stdClass $XMLCfg;
    +
    +    private int $tproject_id;
    +
    +    private $keywordAnnotations = [];
    +
    +    /**
    +     * testcase class constructor
    +     *
    +     * @param
    +     *            resource &$db reference to database handler
    +     */
    +    public function __construct(&$db)
    +    {
    +        $this->db = &$db;
    +        $this->tproject_mgr = new testproject($this->db);
    +        $this->tree_manager = &$this->tproject_mgr->tree_manager;
    +
    +        $this->node_types_descr_id = $this->tree_manager->get_available_node_types();
    +        $this->node_types_id_descr = array_flip($this->node_types_descr_id);
    +        $this->my_node_type = $this->node_types_descr_id['testcase'];
    +
    +        $this->assignment_mgr = new assignment_mgr($this->db);
    +        $this->assignment_types = $this->assignment_mgr->get_available_types();
    +        $this->assignment_status = $this->assignment_mgr->get_available_status();
    +
    +        $this->cfield_mgr = new cfield_mgr($this->db);
    +
    +        $this->execution_types = $this->getExecutionTypes();
    +
    +        $this->layout = $this->getLayout();
    +
    +        $this->cfg = new stdClass();
    +        $this->cfg->testcase = config_get('testcase_cfg');
    +        $this->cfg->execution = config_get('exec_cfg');
    +        $this->cfg->cfield = config_get('custom_fields');
    +
    +        $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: ';
    +
    +        $this->XMLCfg = new stdClass();
    +        $this->XMLCfg->att = $this->getAttXMLCfg();
    +        $this->XMLCfg->req = $this->getReqXMLCfg();
    +
    +        $this->keywordAnnotations = config_get("keywords")->annotations;
    +
    +        // ATTENTION:
    +        // second argument is used to set $this->attachmentTableName,property that this calls
    +        // get from his parent
    +        // ORIGINAL
    +        // parent::__construct($this->db,"nodes_hierarchy");
    +        parent::__construct($this->db, "tcversions");
    +    }
    +
    +    /**
    +     *
    +     * @param int $tproject_id
    +     */
    +    public function setTestProject($tproject_id): void
    +    {
    +        $this->tproject_id = intval($tproject_id);
    +    }
    +
    +    /**
    +     *
    +     * @return array
    +     */
    +    private static function getExecutionTypes(): array
    +    {
    +        $stdSet = array(
    +            self::EXECUTION_TYPE_MANUAL => lang_get('manual'),
    +            self::EXECUTION_TYPE_AUTO => lang_get('automated')
    +        );
    +
    +        if (! is_null($customSet = config_get('custom_execution_types'))) {
    +            foreach ($customSet as $code => $lbl) {
    +                $stdSet[$code] = lang_get($lbl);
    +            }
    +        }
    +        return $stdSet;
    +    }
    +
    +    /**
    +     */
    +    public function getName($tcase_id)
    +    {
    +        $info = $this->tree_manager->get_node_hierarchy_info($tcase_id);
    +        return $info['name'];
    +    }
    +
    +    /**
    +     */
    +    public function getFileUploadRelativeURL($identity)
    +    {
    +        return "lib/testcases/tcEdit.php?doAction=fileUpload&" . "&tcase_id=" .
    +            intval($identity->tcase_id) . "&tcversion_id=" .
    +            intval($identity->tcversion_id) . "&tproject_id=" .
    +            intval($identity->tproject_id);
    +    }
    +
    +    /**
    +     */
    +    private function getDeleteAttachmentRelativeURL($identity)
    +    {
    +        return "lib/testcases/tcEdit.php?doAction=deleteFile&tcase_id=" .
    +            intval($identity->tcase_id) . "&tcversion_id=" .
    +            intval($identity->tcversion_id) . "&tproject_id=" .
    +            intval($identity->tproject_id) . "&file_id=";
    +    }
    +
    +    /**
    +     */
    +    private function getDeleteAttachmentByIDRelativeURL($identity,
    +        &$guiObj = null): string
    +    {
    +        $url = "lib/testcases/tcEdit.php?doAction=deleteFile&tcase_id=" .
    +            intval($identity->tcase_id) . "&tproject_id=" .
    +            intval($identity->tproject_id) . "&file_id=";
    +
    +        // needed for IVU 2019 implementation
    +        if (null != $guiObj) {
    +            $p2l = array(
    +                'show_mode',
    +                'tplan_id'
    +            );
    +            foreach ($p2l as $pr) {
    +                if (property_exists($guiObj, $pr)) {
    +                    $url .= "&$pr=" . $guiObj->$pr;
    +                }
    +            }
    +        }
    +
    +        $url .= "&file_id=";
    +        return $url;
    +    }
    +
    +    /**
    +     */
    +    private function getDeleteTCVRelationRelativeURL(&$guiObj = null): string
    +    {
    +        $url = "lib/testcases/tcEdit.php?doAction=doDeleteRelation";
    +
    +        // needed for IVU 2019 implementation
    +        if (null != $guiObj) {
    +            $p2l = array(
    +                'show_mode',
    +                'tplan_id'
    +            );
    +            foreach ($p2l as $pr) {
    +                if (property_exists($guiObj, $pr)) {
    +                    $url .= "&$pr=" . $guiObj->$pr;
    +                }
    +            }
    +        }
    +
    +        $url .= '&tcase_id=%1&relation_id=%2';
    +
    +        return $url;
    +    }
    +
    +    /**
    +     */
    +    private function getDeleteTCVKeywordRelativeURL(&$guiObj = null): string
    +    {
    +        $url = "lib/testcases/tcEdit.php?doAction=removeKeyword";
    +
    +        // needed for IVU 2019 implementation
    +        if (null != $guiObj) {
    +            $p2l = array(
    +                'show_mode',
    +                'tplan_id'
    +            );
    +            foreach ($p2l as $pr) {
    +                if (property_exists($guiObj, $pr)) {
    +                    $url .= "&$pr=" . $guiObj->$pr;
    +                }
    +            }
    +        }
    +
    +        $url .= '&tcase_id=%1&tckw_link_id=%2';
    +        return $url;
    +    }
    +
    +    /*
    +     * function: get_export_file_types
    +     * getter
    +     *
    +     * args: -
    +     *
    +     * returns: map
    +     * key: export file type code
    +     * value: export file type verbose description
    +     *
    +     */
    +    public function get_export_file_types()
    +    {
    +        return $this->export_file_types;
    +    }
    +
    +    /*
    +     * function: get_impor_file_types
    +     * getter
    +     *
    +     * args: -
    +     *
    +     * returns: map
    +     * key: import file type code
    +     * value: import file type verbose description
    +     *
    +     */
    +    public function get_import_file_types()
    +    {
    +        return $this->import_file_types;
    +    }
    +
    +    /*
    +     * function: get_execution_types
    +     * getter
    +     *
    +     * args: -
    +     *
    +     * returns: map
    +     * key: execution type code
    +     * value: execution type verbose description
    +     *
    +     */
    +    public function get_execution_types()
    +    {
    +        return $this->execution_types;
    +    }
    +
    +    /**
    +     * just a wrapper
    +     */
    +    public function createFromObject($item)
    +    {
    +        static $wkfstatus;
    +
    +        if (is_null($wkfstatus)) {
    +            $wkfstatus = config_get('testCaseStatus');
    +        }
    +        $options = array(
    +            'check_duplicate_name' => self::CHECK_DUPLICATE_NAME,
    +            'action_on_duplicate_name' => 'block',
    +            'estimatedExecDuration' => 0,
    +            'status' => $wkfstatus['draft'],
    +            'importLogic' => null
    +        );
    +
    +        if (property_exists($item, 'estimatedExecDuration')) {
    +            $options['estimatedExecDuration'] = floatval(
    +                $item->estimatedExecDuration);
    +        }
    +
    +        if (property_exists($item, 'status')) {
    +            $options['status'] = intval($item->status);
    +        }
    +
    +        if (property_exists($item, 'importLogic')) {
    +            $options['importLogic'] = $item->importLogic;
    +        }
    +
    +        return $this->create($item->testSuiteID, $item->name, $item->summary,
    +            $item->preconditions, $item->steps, $item->authorID, '',
    +            $item->order, self::AUTOMATIC_ID, $item->executionType,
    +            $item->importance, $options);
    +    }
    +
    +    /**
    +     * create a test case
    +     */
    +    public function create($parent_id, $name, $summary, $preconditions, $steps,
    +        $author_id, $keywords_id = '', $tc_order = self::DEFAULT_ORDER,
    +        $id = self::AUTOMATIC_ID,
    +        $execution_type = TESTCASE_EXECUTION_TYPE_MANUAL, $importance = 2,
    +        $options = null)
    +    {
    +        $my['options'] = array(
    +            'check_duplicate_name' => self::DONT_CHECK_DUPLICATE_NAME,
    +            'action_on_duplicate_name' => 'generate_new',
    +            'estimatedExecDuration' => null,
    +            'status' => null,
    +            'active' => null,
    +            'is_open' => null,
    +            'importLogic' => null
    +        );
    +
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        if (trim($summary) != '' && strpos($summary, self::NAME_PHOPEN) !== false &&
    +            strpos($summary, self::NAME_PHCLOSE) !== false) {
    +            $name = $this->buildTCName($name, $summary);
    +        }
    +
    +        if (trim($preconditions) != '' &&
    +            strpos($preconditions, self::NAME_PHOPEN) !== false &&
    +            strpos($preconditions, self::NAME_PHCLOSE) !== false) {
    +            $name = $this->buildTCName($name, $preconditions);
    +        }
    +
    +        $ret = $this->create_tcase_only($parent_id, $name, $tc_order, $id,
    +            $my['options']);
    +
    +        $tcase_id = $ret['id'];
    +        $ix = new stdClass();
    +
    +        if ($ret["status_ok"]) {
    +            $ix->version = 1;
    +            if (isset($ret['version_number']) && $ret['version_number'] < 0) {
    +                // We are in the special situation we are only creating a new version,
    +                // useful when importing test cases. Need to get last version number.
    +                // I do not use create_new_version() because it does a copy ot last version
    +                // and do not allow to set new values in different fields while doing this operation.
    +                $last_version_info = $this->getLastVersionInfo($ret['id'],
    +                    array(
    +                        'output' => 'minimun'
    +                    ));
    +
    +                $ix->version = $last_version_info['version'] + 1;
    +                $ret['msg'] = sprintf($ret['msg'], $ix->version);
    +                $ret['version_number'] = $ix->version;
    +            }
    +
    +            // Multiple Test Case Steps Feature
    +            $version_number = $ret['version_number'];
    +
    +            $ix->id = $tcase_id;
    +            $ix->externalID = $ret['external_id'];
    +            $ix->summary = $summary;
    +            $ix->preconditions = $preconditions;
    +            $ix->steps = $steps;
    +            $ix->authorID = $author_id;
    +            $ix->executionType = $execution_type;
    +            $ix->importance = $importance;
    +            $ix->status = $my['options']['status'];
    +            $ix->active = $my['options']['active'];
    +            $ix->is_open = $my['options']['is_open'];
    +            $ix->estimatedExecDuration = $my['options']['estimatedExecDuration'];
    +
    +            $op = $this->createVersion($ix);
    +            if (trim($keywords_id) != "") {
    +                $a_keywords = explode(",", $keywords_id);
    +                $auditContext = array(
    +                    'on' => self::AUDIT_ON,
    +                    'version' => $version_number
    +                );
    +                $this->addKeywords($tcase_id, $op['id'], $a_keywords,
    +                    $auditContext);
    +            }
    +
    +            if ($ret['update_name']) {
    +                $sql = " UPDATE {$this->tables['nodes_hierarchy']} SET name='" .
    +                    $this->db->prepare_string($name) . "' WHERE id= " .
    +                    intval($ret['id']);
    +                $this->db->exec_query($sql);
    +            }
    +
    +            $ret['msg'] = $op['status_ok'] ? $ret['msg'] : $op['msg'];
    +            $ret['tcversion_id'] = $op['status_ok'] ? $op['id'] : - 1;
    +
    +            $ctx = array(
    +                'test_suite_id' => $parent_id,
    +                'id' => $id,
    +                'name' => $name,
    +                'summary' => $summary,
    +                'preconditions' => $preconditions,
    +                'steps' => $steps,
    +                'author_id' => $author_id,
    +                'keywords_id' => $keywords_id,
    +                'order' => $tc_order,
    +                'exec_type' => $execution_type,
    +                'importance' => $importance,
    +                'options' => $options
    +            );
    +            event_signal('EVENT_TEST_CASE_CREATE', $ctx);
    +        }
    +        return $ret;
    +    }
    +
    +    /*
    +     * [$check_duplicate_name]
    +     * [$action_on_duplicate_name]
    +     * [$order]
    +     *
    +     * [$id]
    +     * 0 -> the id will be assigned by dbms
    +     * x -> this will be the id
    +     * Warning: no check is done before insert => can got error.
    +     *
    +     * return:
    +     * $ret['id']
    +     * $ret['external_id']
    +     * $ret['status_ok']
    +     * $ret['msg'] = 'ok';
    +     * $ret['new_name']
    +     *
    +     * rev:
    +     *
    +     */
    +    public function create_tcase_only($parent_id, $name,
    +        $order = self::DEFAULT_ORDER, $id = self::AUTOMATIC_ID, $options = null)
    +    {
    +        $dummy = config_get('field_size');
    +        $name_max_len = $dummy->testcase_name;
    +        $name = trim($name);
    +        $originalNameLen = tlStringLen($name);
    +
    +        $ret = array(
    +            'id' => - 1,
    +            'external_id' => 0,
    +            'status_ok' => 1,
    +            'msg' => 'ok',
    +            'new_name' => '',
    +            'version_number' => 1,
    +            'has_duplicate' => false,
    +            'external_id_already_exists' => false,
    +            'update_name' => false
    +        );
    +
    +        $my['options'] = array(
    +            'check_duplicate_name' => self::DONT_CHECK_DUPLICATE_NAME,
    +            'action_on_duplicate_name' => 'generate_new',
    +            'external_id' => null,
    +            'importLogic' => null
    +        );
    +
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $doCreate = true;
    +        $forceGenerateExternalID = false;
    +
    +        $algo_cfg = config_get('testcase_cfg')->duplicated_name_algorithm;
    +        $getDupOptions['check_criteria'] = ($algo_cfg->type == 'counterSuffix') ? 'like' : '=';
    +        $getDupOptions['access_key'] = ($algo_cfg->type == 'counterSuffix') ? 'name' : 'id';
    +
    +        // If external ID has been provided, check if exists.
    +        // If answer is yes, then
    +        // 1. collect current info
    +        // 2. if $my['options']['check_duplicate_name'] is create new version
    +        // change to BLOCK
    +        //
    +        if (! is_null($my['options']['importLogic'])) {
    +            $doQuickReturn = false;
    +            switch ($my['options']['importLogic']['hitCriteria']) {
    +                case 'externalID':
    +                    if (($sf = intval($my['options']['external_id'])) > 0) {
    +                        // check if already exists a test case with this external id
    +                        $info = $this->get_by_external($sf, $parent_id);
    +                        if (! is_null($info)) {
    +                            if (count($info) > 1) {
    +                                // abort
    +                                throw new Exception(
    +                                    "More than one test case with same external ID");
    +                            }
    +
    +                            $doQuickReturn = true;
    +                            $ret['id'] = key($info);
    +                            $ret['external_id'] = $sf;
    +                            $ret['version_number'] = - 1;
    +                            $ret['external_id_already_exists'] = true;
    +                        }
    +                    }
    +
    +                    switch ($my['options']['importLogic']['actionOnHit']) {
    +                        case 'create_new_version':
    +                            if ($doQuickReturn) {
    +                                // I this situation we will need to also update test case name, if user
    +                                // has provided one on import file.
    +                                // Then we need to check that new name will not conflict with an existing one
    +                                $doCreate = false;
    +                                if (strcmp($info[key($info)]['name'], $name) != 0) {
    +                                    $itemSet = $this->getDuplicatesByName($name,
    +                                        $parent_id, $getDupOptions);
    +                                    if (is_null($itemSet)) {
    +                                        $ret['name'] = $name;
    +                                        $ret['update_name'] = true;
    +                                    }
    +                                }
    +                                return $ret;
    +                            }
    +                            break;
    +
    +                        case 'generate_new':
    +                            // on GUI => create a new test case with a different title
    +                            // IMPORTANT:
    +                            // if name provided on import file does not hit an existent one
    +                            // then I'm going to use it, instead of generating a NEW NAME
    +                            $forceGenerateExternalID = true;
    +                            break;
    +                    }
    +                    break;
    +            }
    +        }
    +
    +        if ($my['options']['check_duplicate_name']) {
    +            $itemSet = $this->getDuplicatesByName($name, $parent_id,
    +                $getDupOptions);
    +
    +            if (! is_null($itemSet) && ($siblingQty = count($itemSet)) > 0) {
    +                $ret['has_duplicate'] = true;
    +
    +                switch ($my['options']['action_on_duplicate_name']) {
    +                    case 'block':
    +                        $doCreate = false;
    +                        $ret['status_ok'] = 0;
    +                        $ret['msg'] = sprintf(
    +                            lang_get('testcase_name_already_exists'), $name);
    +                        break;
    +
    +                    case 'generate_new':
    +                        $doCreate = true;
    +
    +                        // TICKET 5159: importing duplicate test suites
    +                        // Need to force use of generated External ID
    +                        // (this seems the best alternative)
    +                        $my['options']['external_id'] = null;
    +
    +                        switch ($algo_cfg->type) {
    +                            case 'stringPrefix':
    +                                $doIt = true;
    +                                while ($doIt) {
    +                                    if ($doIt = ! is_null($itemSet)) {
    +                                        $prefix = @strftime($algo_cfg->text,
    +                                            time());
    +                                        $target = $prefix . " " . $name;
    +                                        $final_len = strlen($target);
    +                                        if ($final_len > $name_max_len) {
    +                                            $target = substr($target, 0,
    +                                                $name_max_len);
    +                                        }
    +
    +                                        // Check new generated name
    +                                        $itemSet = $this->getDuplicatesByName(
    +                                            $target, $parent_id, $getDupOptions);
    +                                    }
    +                                }
    +                                $name = $target;
    +                                break;
    +
    +                            case 'counterSuffix':
    +                                $mask = ! is_null($algo_cfg->text) ? $algo_cfg->text : '#%s';
    +                                $nameSet = array_flip(array_keys($itemSet));
    +
    +                                // 20110109 - franciscom
    +                                // does not understand why I've choosen time ago
    +                                // to increment $siblingQty before using it
    +                                // This way if TC X exists on target parent
    +                                // I will create TC X [2] insteand of TC X [1]
    +                                // Anyway right now I will not change.
    +                                $target = $name .
    +                                    ($suffix = sprintf($mask, ++ $siblingQty));
    +                                $final_len = strlen($target);
    +                                if ($final_len > $name_max_len) {
    +                                    $target = substr($target, strlen($suffix),
    +                                        $name_max_len);
    +                                }
    +
    +                                // Need to recheck if new generated name does not crash with existent name
    +                                // why? Suppose you have created:
    +                                // TC [1]
    +                                // TC [2]
    +                                // TC [3]
    +                                // Then you delete TC [2].
    +                                // When I got siblings il will got 2 siblings, if I create new progressive using next,
    +                                // it will be 3 => I will get duplicated name.
    +                                while (isset($nameSet[$target])) {
    +                                    $target = $name .
    +                                        ($suffix = sprintf($mask, ++ $siblingQty));
    +                                    $final_len = strlen($target);
    +                                    if ($final_len > $name_max_len) {
    +                                        $target = substr($target,
    +                                            strlen($suffix), $name_max_len);
    +                                    }
    +                                }
    +                                $name = $target;
    +                                break;
    +                        }
    +
    +                        $ret['status_ok'] = 1;
    +                        $ret['new_name'] = $name;
    +                        $ret['msg'] = sprintf(lang_get('created_with_title'),
    +                            $name);
    +                        break;
    +
    +                    case 'create_new_version':
    +                        $doCreate = false;
    +
    +                        // If we found more that one with same name and same parent,
    +                        // will take the first one.
    +                        $xx = current($itemSet);
    +                        $ret['id'] = $xx['id'];
    +                        $ret['external_id'] = $xx['tc_external_id'];
    +                        $ret['status_ok'] = 1;
    +                        $ret['new_name'] = $name;
    +                        $ret['version_number'] = - 1;
    +                        $ret['msg'] = lang_get('create_new_version');
    +                        break;
    +
    +                    default:
    +                        break;
    +                }
    +            }
    +        }
    +
    +        // 20120822 - think we have potencial issue, because we never check if
    +        // duplicated EXTERNAL ID exists.
    +        // Right now there is no time to try a fix
    +        if ($ret['status_ok'] && $doCreate) {
    +
    +            $safeLenName = tlSubStr($name, 0, $name_max_len);
    +
    +            // Get tproject id
    +            $path2root = $this->tree_manager->get_path($parent_id);
    +            $tproject_id = $path2root[0]['parent_id'];
    +
    +            $tcase_id = $this->tree_manager->new_node($parent_id,
    +                $this->my_node_type, $safeLenName, $order, $id);
    +            $ret['id'] = $tcase_id;
    +
    +            $generateExtID = false;
    +            if ($forceGenerateExternalID ||
    +                is_null($my['options']['external_id'])) {
    +                $generateExtID = true;
    +            } else {
    +                // this need more work and checks (20140209)
    +                $sf = intval($my['options']['external_id']);
    +                if (is_null($this->get_by_external($sf, $parent_id))) {
    +                    $ret['external_id'] = $sf;
    +
    +                    // CRITIC: setTestCaseCounter() will update only if new provided value > current value
    +                    $this->tproject_mgr->setTestCaseCounter($tproject_id,
    +                        $ret['external_id']);
    +                } else {
    +                    $generateExtID = true;
    +                }
    +            }
    +            if ($generateExtID) {
    +                $ret['external_id'] = $this->tproject_mgr->generateTestCaseNumber(
    +                    $tproject_id);
    +            }
    +
    +            if (! $ret['has_duplicate'] && ($originalNameLen > $name_max_len)) {
    +                $ret['new_name'] = $safeLenName;
    +                $ret['msg'] = sprintf(lang_get('testcase_name_length_exceeded'),
    +                    $originalNameLen, $name_max_len);
    +            }
    +        }
    +
    +        return $ret;
    +    }
    +
    +    /**
    +     * trying to solve debugMsg . __FUNCTION__;
    +        $tcase_version_id = $this->tree_manager->new_node($item->id,
    +            $this->node_types_descr_id['testcase_version']);
    +
    +        $this->ckEditorCopyAndPasteCleanUp($item,
    +            array(
    +                'summary',
    +                'preconditions'
    +            ));
    +
    +        $sql = "/* $debugMsg */ INSERT INTO {$this->tables['tcversions']} " .
    +            " (id,tc_external_id,version,summary,preconditions," .
    +            "  author_id,creation_ts,execution_type,importance ";
    +
    +        $sqlValues = " VALUES({$tcase_version_id},{$item->externalID},{$item->version},'" .
    +            $this->db->prepare_string($item->summary) . "','" .
    +            $this->db->prepare_string($item->preconditions) . "'," .
    +            $this->db->prepare_int($item->authorID) . "," . $this->db->db_now() .
    +            ", {$item->executionType},{$item->importance} ";
    +
    +        if (! is_null($item->status)) {
    +            $wf = intval($item->status);
    +            $sql .= ',status';
    +            $sqlValues .= ",{$wf}";
    +        }
    +
    +        if (! is_null($item->estimatedExecDuration)) {
    +            $v = trim($item->estimatedExecDuration);
    +            if ($v != '') {
    +                $sql .= ", estimated_exec_duration";
    +                $sqlValues .= "," . floatval($v);
    +            }
    +        }
    +
    +        if (property_exists($item, 'active') && ! is_null($item->active)) {
    +            $v = intval($item->active) > 0 ? 1 : 0;
    +            $sql .= ", active";
    +            $sqlValues .= "," . $v;
    +        }
    +
    +        if (property_exists($item, 'is_open') && ! is_null($item->is_open)) {
    +            $v = intval($item->is_open) > 0 ? 1 : 0;
    +            $sql .= ", is_open";
    +            $sqlValues .= "," . $v;
    +        }
    +
    +        $sql .= " )" . $sqlValues . " )";
    +
    +        $result = $this->db->exec_query($sql);
    +
    +        $ret['msg'] = 'ok';
    +        $ret['id'] = $tcase_version_id;
    +        $ret['status_ok'] = 1;
    +
    +        if ($result && (! is_null($item->steps) && is_array($item->steps))) {
    +            $steps2create = count($item->steps);
    +            $op['status_ok'] = 1;
    +
    +            // need to this to manage call to this method for REST API.
    +            $stepIsObject = is_object($item->steps[0]);
    +            for ($jdx = 0; ($jdx < $steps2create && $op['status_ok']); $jdx ++) {
    +                if ($stepIsObject) {
    +                    $item->steps[$jdx] = (array) $item->steps[$jdx];
    +                }
    +
    +                $this->create_step($tcase_version_id,
    +                    $item->steps[$jdx]['step_number'],
    +                    $item->steps[$jdx]['actions'],
    +                    $item->steps[$jdx]['expected_results'],
    +                    $item->steps[$jdx]['execution_type']);
    +            }
    +        }
    +
    +        if (! $result) {
    +            $ret['msg'] = $this->db->error_msg();
    +            $ret['status_ok'] = 0;
    +            $ret['id'] = - 1;
    +        }
    +
    +        return $ret;
    +    }
    +
    +    /*
    +     * function: getDuplicatesByname
    +     *
    +     * args: $name
    +     * $parent_id
    +     *
    +     * returns: hash
    +     */
    +    public function getDuplicatesByName($name, $parent_id, $options = null)
    +    {
    +        $my['options'] = array(
    +            'check_criteria' => '=',
    +            'access_key' => 'id',
    +            'id2exclude' => null
    +        );
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $target = $this->db->prepare_string($name);
    +        switch ($my['options']['check_criteria']) {
    +            case 'like':
    +                // % and _ need to be escaped, but method is different
    +                // according DBMS
    +                $check_criteria = " AND NHA.name LIKE '{$target}%' ";
    +                break;
    +
    +            case '=':
    +            default:
    +                $check_criteria = " AND NHA.name = '{$target}' ";
    +                break;
    +        }
    +
    +        $sql = " SELECT DISTINCT NHA.id,NHA.name,TCV.tc_external_id" .
    +            " FROM {$this->tables['nodes_hierarchy']} NHA, " .
    +            " {$this->tables['nodes_hierarchy']} NHB, {$this->tables['tcversions']} TCV  " .
    +            " WHERE NHA.node_type_id = {$this->my_node_type} " .
    +            " AND NHB.parent_id=NHA.id " . " AND TCV.id=NHB.id " .
    +            " AND NHB.node_type_id = {$this->node_types_descr_id['testcase_version']} " .
    +            " AND NHA.parent_id=" . $this->db->prepare_int($parent_id) .
    +            " {$check_criteria}";
    +
    +        if (! is_null($my['options']['id2exclude'])) {
    +            $sql .= " AND NHA.id <> " . intval($my['options']['id2exclude']);
    +        }
    +
    +        $rs = $this->db->fetchRowsIntoMap($sql, $my['options']['access_key']);
    +
    +        if (is_null($rs) || count($rs) == 0) {
    +            $rs = null;
    +        }
    +        return $rs;
    +    }
    +
    +    /*
    +     * function: get_by_name
    +     *
    +     * args: $name
    +     * [$tsuite_name]: name of parent test suite
    +     * [$tproject_name]
    +     *
    +     * returns: hash
    +     *
    +     * @internal revisions
    +     * 20100831 - franciscom - BUGID 3729
    +     *
    +     */
    +    public function get_by_name($name, $tsuite_name = '', $tproject_name = '')
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +
    +        $recordset = null;
    +        $field_size = config_get('field_size');
    +        $tsuite_name = tlSubStr(trim($tsuite_name), 0,
    +            $field_size->testsuite_name);
    +        $tproject_name = tlSubStr(trim($tproject_name), 0,
    +            $field_size->testproject_name);
    +        $name = tlSubStr(trim($name), 0, $field_size->testcase_name);
    +
    +        $sql = "/* $debugMsg */ " .
    +            " SELECT DISTINCT NH_TCASE.id,NH_TCASE.name,NH_TCASE_PARENT.id AS parent_id," .
    +            " NH_TCASE_PARENT.name AS tsuite_name, TCV.tc_external_id " .
    +            " FROM {$this->tables['nodes_hierarchy']} NH_TCASE, " .
    +            " {$this->tables['nodes_hierarchy']} NH_TCASE_PARENT, " .
    +            " {$this->tables['nodes_hierarchy']} NH_TCVERSIONS," .
    +            " {$this->tables['tcversions']}  TCV  " .
    +            " WHERE NH_TCASE.node_type_id = {$this->my_node_type} " .
    +            " AND NH_TCASE.name = '{$this->db->prepare_string($name)}' " .
    +            " AND TCV.id=NH_TCVERSIONS.id " .
    +            " AND NH_TCVERSIONS.parent_id=NH_TCASE.id " .
    +            " AND NH_TCASE_PARENT.id=NH_TCASE.parent_id ";
    +
    +        if ($tsuite_name != "") {
    +            $sql .= " AND NH_TCASE_PARENT.name = '{$this->db->prepare_string($tsuite_name)}' " .
    +                " AND NH_TCASE_PARENT.node_type_id = {$this->node_types_descr_id['testsuite']} ";
    +        }
    +        $recordset = $this->db->get_recordset($sql);
    +        if (count($recordset) && $tproject_name != "") {
    +            list ($tproject_info) = $this->tproject_mgr->get_by_name(
    +                $tproject_name);
    +            foreach ($recordset as $idx => $tcase_info) {
    +                if ($this->get_testproject($tcase_info['id']) !=
    +                    $tproject_info['id']) {
    +                    unset($recordset[$idx]);
    +                }
    +            }
    +        }
    +        return $recordset;
    +    }
    +
    +    /*
    +     * get array of info for every test case
    +     * without any kind of filter.
    +     * Every array element contains an assoc array with testcase info
    +     *
    +     */
    +    public function get_all()
    +    {
    +        $sql = " SELECT nodes_hierarchy.name, nodes_hierarchy.id
                  FROM  {$this->tables['nodes_hierarchy']} nodes_hierarchy
    -             WHERE nodes_hierarchy.node_type_id={$my_node_type}";
    -    $recordset = $this->db->get_recordset($sql);
    -
    -    return $recordset;
    -  }
    -
    -
    -  /**
    -   * Show Test Case
    -   *
    -   *
    -   */
    -  function show(&$smarty,$guiObj,$identity,$grants,$opt=null) {
    -    static $cfg;
    -    static $reqMgr;
    -    static $hidePreconditions;
    -    static $hideSummary;
    -
    -    if(!$cfg) {
    -      $cfg = config_get('spec_cfg');
    -      $reqMgr = new requirement_mgr($this->db);
    -
    -      // Investigate if special keywords are defined in the test project
    -      $tproject_id = intval($identity->tproject_id);
    -      $hidePreconditions = tlKeyword::doesKeywordExist($this->db,'@#HIDE_PRECONDITIONS_IF_EMPTY',$tproject_id);
    -      $hideSummary = tlKeyword::doesKeywordExist($this->db,'@#HIDE_SUMMARY_IF_EMPTY',$tproject_id);
    -      $hidePreconditions = ($hidePreconditions['kwID'] != null);
    -      $hideSummary = ($hideSummary['kwID'] != null);
    -    }
    -
    -    $status_ok = ($identity->id > 0);
    -    if( !$status_ok ) {
    -      throw new Exception(__METHOD__ . ' EXCEPTION: Test Case ID is invalid ( <= 0)' );
    -    }
    -    
    -    $my = array('opt' => array('getAttachments' => false));
    -    $my['opt'] = array_merge($my['opt'],(array)$opt);
    -
    -    $id = $identity->id;
    -    $idSet = (array)$id;
    -
    -    $idCard = new stdClass();
    -    $idCard->tcase_id = intval($id);
    -    $idCard->tproject_id = intval($identity->tproject_id);
    -
    -    $idCard->tcversion_id = isset($identity->version_id) ? $identity->version_id : self::ALL_VERSIONS;
    -
    -    $getVersionID = $idCard->tcversion_id;
    -
    -    $gui = $this->initShowGui($guiObj,$grants,$idCard);
    -
    -    $gui->hidePreconditions = $hidePreconditions;
    -    $gui->hideSummary = $hideSummary;
    -
    -    // When editing on execution, it's important to understand
    -    // is current displayed version is LINKED to Test Plan 
    -    // to add or remove some features
    -    //
    -    $gui->candidateToUpd = 0;
    -    switch( $gui->show_mode ) {
    -      case 'editOnExec':
    -        $gui->candidateToUpd = 
    -          !$this->isLinkedTCVersion($idCard->tcversion_id,$gui->tplan_id);
    -        $gui->new_version_source = 'latest'; 
    -      break;
    -
    -      default:
    -      break;
    -    }
    -
    -    
    -    $userIDSet = array();
    -
    -    if($status_ok && sizeof($idSet)) {
    -
    -      $cfPlaces = $this->buildCFLocationMap();
    -      $gui->linked_versions = null;
    -      $gopt = [
    -        'withGhostString' => true,
    -        'renderGhost' => true,
    -        'renderImageInline' => true,
    -        'renderVariables' => true,
    -        'renderSpecialKW' => true,
    -        'caller' => 'show()',
    -        'tproject_id' => $idCard->tproject_id
    -      ];
    -
    -      $cfx = 0;
    -      $gui->otherVersionsKeywords = array();
    -
    -      $gui->fileUploadURL = array();
    -      foreach($idSet as $key => $tc_id) {
    -        // IMPORTANT NOTICE
    -        // Deep Analysis is need to understand if there is an use case
    -        // where this method really receive an array of test case ID.
    -        // 
    -        // using an specific value for test case version id has sense 
    -        // only when we are working on ONE SPECIFIC Test Case.
    -        // 
    -        // if we are working on a set of test cases, because this method 
    -        // does not manage in input couple of (test case, versio id),
    -        // the only chance is to get ALL VERSIONS
    -        //
    -        if( !$tcvSet = $this->get_by_id($tc_id,$getVersionID,null,$gopt) ) {
    -          continue;
    -        }
    -
    -        if($cfg->show_tplan_usage) {
    -          $gui->linked_versions[] = $this->get_linked_versions($tc_id);
    -        }
    -
    -        // Position 0 is latest active version
    -        $tcvSet[0]['tc_external_id'] = 
    -          $gui->tcasePrefix . $tcvSet[0]['tc_external_id'];
    -        $tcvSet[0]['ghost'] = 
    -          sprintf(self::GHOSTMASK,$tcvSet[0]['tc_external_id'],$tcvSet[0]['version']);
    -
    -        $tcvSet[0]['ghost_preconditions'] = 
    -          sprintf(self::GHOSTPRECONDITIONSMASK,$tcvSet[0]['tc_external_id'],$tcvSet[0]['version']);
    -
    -        // status quo of execution and links of tc versions
    -        $gui->status_quo[] = $this->get_versions_status_quo($tc_id);
    -
    -        // Logic on Current/Latest Test Case Version
    -        $tc_current = $tcvSet[0];
    -        $tc_current['isTheLatest'] = 1;
    -        $currentVersionID = $tc_current['id'];
    -
    -        $io = $idCard;
    -        $io->tcversion_id = $currentVersionID;
    -
    -        
    -        $gui->delAttachmentURL = $_SESSION['basehref'] . 
    -          $this->getDeleteAttachmentByIDRelativeURL($io,$gui);
    -
    -
    -        $gui->delTCVRelationURL = $_SESSION['basehref'] . 
    -          $this->getDeleteTCVRelationRelativeURL($io,$gui);
    -
    -        $gui->delTCVKeywordURL = $_SESSION['basehref'] . 
    -          $this->getDeleteTCVKeywordRelativeURL($io,$gui);
    -
    -        $gui->delTCVPlatformURL = $_SESSION['basehref'] . 
    -          $this->getDeleteTCVPlatformRelativeURL($io,$gui);
    -
    -
    -        // Impacted for version management
    -        $gui->fileUploadURL[$currentVersionID] = 
    -          $_SESSION['basehref'] . $this->getFileUploadRelativeURL($io);
    -
    -        $gui->tc_current_version[] = array($tc_current);
    -
    -        //  
    -        // REFACTORING - Following code uses tc_current!!!
    -        //
    -
    -        // Get UserID and Updater ID for current Version
    -        $userIDSet[$tc_current['author_id']] = null;
    -        $userIDSet[$tc_current['updater_id']] = null;
    -
    -        $gui->req4current_version = 
    -          $reqMgr->getGoodForTCVersion($currentVersionID);
    -
    -        
    -        $gui->currentVersionKeywords = 
    -          $this->getKeywords($tc_id,$currentVersionID);
    -
    -          
    -        $gui->currentVersionPlatforms = 
    -          $this->getPlatforms($tc_id,$currentVersionID);
    -
    -
    -        $whoami = array('tcase_id' => $tc_id, 
    -                        'tcversion_id' => $currentVersionID);
    -
    -        $of = array('output' => 'html_options','add_blank' => true);
    -        $gui->currentVersionFreeKeywords = $this->getFreeKeywords($whoami,$of);
    -
    -
    -        $gui->currentVersionFreePlatforms = 
    -          $this->getFreePlatforms($whoami,$of);
    -
    -
    -        if( $my['opt']['getAttachments'] ) {
    -          $gui->attachments[$currentVersionID] = 
    -            getAttachmentInfosFrom($this,$currentVersionID);
    -        }
    -
    -        // get linked testcase scripts
    -        if($gui->codeTrackerEnabled) {
    -          $scripts = $this->getScriptsForTestCaseVersion($gui->cts,$currentVersionID);
    -          if(!is_null($scripts)) {
    -            $gui->scripts[$currentVersionID] = $scripts;
    -          }
    -        }
    -
    -        if($this->cfg->testcase->relations->enable) {
    -          $xm = array('tcase_id' => $tc_id, 'tcversion_id' => $currentVersionID);
    -          $gui->relationSet[] = $this->getTCVersionRelations($xm);
    -        }
    -
    -        $cfCtx = [
    -          'scope' => 'design',
    -          'tproject_id' => $gui->tproject_id,
    -          'link_id' => $tc_current['id']
    -        ];
    -
    -        foreach($cfPlaces as $cfpKey => $cfpFilter) {
    -          // we need to do this when in display mode
    -          switch ($cfpKey) {
    -            case 'hide_because_is_used_as_variable':
    -            break;  
    -
    -            default:
    -              $gui->cf_current_version[$cfx][$cfpKey] = $this->htmlTableOfCFValues($tc_id,$cfCtx,$cfpFilter);
    -            break;  
    -          } 
    -        }
    -
    -        // Other versions (if exists)
    -        if(count($tcvSet) > 1) {
    -          $gui->testcase_other_versions[] = array_slice($tcvSet,1);
    -
    -          $target_idx = count($gui->testcase_other_versions) - 1;
    -          $loop2do = count($gui->testcase_other_versions[$target_idx]);
    -
    -          $cfCtx = array('scope' => 'design','tproject_id' => $gui->tproject_id);
    -
    -          $ref = &$gui->testcase_other_versions[$target_idx];
    -          for($qdx=0; $qdx < $loop2do; $qdx++) {
    -
    -            $gui->testcase_other_versions[$target_idx][$qdx]['isTheLatest'] = 0;
    -            
    -            $ref[$qdx]['ghost'] = 
    -              sprintf(self::GHOSTMASK,$tcvSet[0]['tc_external_id'],
    -                                      $ref[$qdx]['version']);
    -
    -            $cfCtx['link_id'] = $gui->testcase_other_versions[$target_idx][$qdx]['id'];
    -            foreach($cfPlaces as $locKey => $locFilter) {
    -              switch ($cfpKey) {
    -                case 'hide_because_is_used_as_variable':
    -                break;  
    -
    -                default:
    -                  $gui->cf_other_versions[$cfx][$qdx][$locKey] = $this->htmlTableOfCFValues($tc_id,$cfCtx,$locFilter);
    -                  break;  
    -              } 
    -            }
    -          }
    -        }
    -        else {
    -          $gui->testcase_other_versions[] = null;
    -          $gui->otherVersionsRelations[] = null;
    -          $gui->cf_other_versions[$cfx]=null;
    -        }
    -
    -        $cfx++;
    -
    -        if ($gui->testcase_other_versions[0]) {
    -          
    -          // Get author and updater id for each version
    -          foreach($gui->testcase_other_versions[0] as $key => $version) {
    -
    -            $userIDSet[$version['author_id']] = null;
    -            $userIDSet[$version['updater_id']] = null;
    -
    -            if($this->cfg->testcase->relations->enable) {
    -              $xm = array('tcase_id' => $version['testcase_id'], 
    -                          'tcversion_id' => $version['id'],
    -                          'other' => 'other');
    -              $gui->otherVersionsRelations[] = $this->getTCVersionRelations($xm);
    -            }
    -
    -            // get linked testcase scripts
    -            if($gui->codeTrackerEnabled) {
    -              $scripts = $this->getScriptsForTestCaseVersion($gui->cts,$version['id']);
    -              if(!is_null($scripts)) {
    -                $gui->scripts[$version['id']] = $scripts;
    -              }
    -            }
    -
    -            if( $my['opt']['getAttachments'] ) {
    -              $gui->attachments[$version['id']] = 
    -                getAttachmentInfosFrom($this,$version['id']);
    -            }
    -
    -
    -            $io = $idCard;
    -            $io->tcversion_id = $version['id'];
    -
    -            $gui->fileUploadURL[$version['id']] = 
    -              $_SESSION['basehref'] . $this->getFileUploadRelativeURL($io);
    -
    -            // Requirements
    -            $gui->req4OtherVersions[] = 
    -              $reqMgr->getGoodForTCVersion($version['id']);
    -            
    -
    -            $gui->otherVersionsKeywords[] = 
    -              $this->getKeywords($version['testcase_id'],$version['id']);
    -
    -            $gui->otherVersionsPlatforms[] = 
    -              $this->getPlatforms($version['testcase_id'],$version['id']);
    -
    -          }
    -        } // Other versions exist
    -      }
    -    }
    -
    -    $gui->relations = $gui->relationSet;
    -    $gui->relation_domain = '';
    -    if($this->cfg->testcase->relations->enable) {
    -      $gui->relation_domain = $this->getRelationTypeDomainForHTMLSelect();
    -    }
    -
    -    // Removing duplicate and NULL id's
    -    unset($userIDSet['']);
    -    $gui->users = tlUser::getByIDs($this->db,array_keys($userIDSet));
    -    $gui->cf = null;
    -
    -    $this->initShowGuiActions($gui);
    -    $tplCfg = templateConfiguration('tcView');
    -
    -
    -    $gui->additionalMessages = [];
    -    if ($gui->currentVersionKeywords != null && count($gui->currentVersionKeywords) > 0) {
    -      // look for annotations in notes
    -      foreach($gui->currentVersionKeywords as $kwEntity) {
    -        foreach($this->keywordAnnotations as $kwAnnot) {
    -          if (strpos($kwEntity['notes'],$kwAnnot) !== false) {
    -            $gui->additionalMessages[] =
    -              json_decode(str_replace($kwAnnot,'',explode("/@",$kwEntity['notes'])[0]));
    -           break;
    -          }
    -        }
    -      }
    -    }
    -    $smarty->assign('gui',$gui);
    -    $smarty->display($tplCfg->template_dir . $tplCfg->default_template);
    -  }
    -
    -
    -
    -  /**
    -   * update test case specification
    -   *
    -   * @param integer $id Test case unique identifier (node_hierarchy table)
    -   * @param integer $tcversion_id Test Case Version unique ID (node_hierarchy table)
    -   * @param string $name name/title
    -   * @param string $summary
    -   * @param string $preconditions
    -   * @param array $steps steps + expected results
    -   * @param integer $user_id who is doing the update
    -   * @param string $keywords_id optional list of keyword id to be linked to test case
    -   *         this list will override previous keyword links (delete + insert).
    -   *
    -   * @param integer $tc_order optional order inside parent test suite
    -   * @param integer $execution_type optional
    -   * @param integer $importance optional
    -   *
    -   *
    -   *
    -   */
    -  function update($id,$tcversion_id,$name,$summary,$preconditions,$steps,
    -                  $user_id,$keywords_id='',$tc_order=self::DEFAULT_ORDER,
    -                  $execution_type=TESTCASE_EXECUTION_TYPE_MANUAL,$importance=2,
    -                  $attr=null,$opt=null)
    -  {
    -    $ret['status_ok'] = 1;
    -    $ret['msg'] = '';
    -    $ret['reason'] = '';
    -
    -    $my['opt'] = array('blockIfExecuted' => false);
    -    $my['opt'] = array_merge($my['opt'],(array)$opt);
    -
    -
    -    $attrib = array('status' => null, 'is_open' => null, 'active' => null, 'estimatedExecDuration' => null);
    -    $attrib = array_merge($attrib,(array)$attr);
    -
    -
    -    tLog("TC UPDATE ID=($id): exec_type=$execution_type importance=$importance");
    -
    -    if( trim($summary) != '' ) {
    -      if( strpos($summary,self::NAME_PHOPEN) !== FALSE && strpos($summary,self::NAME_PHCLOSE) !== FALSE ) {
    -        $name = $this->buildTCName($name,$summary);
    -      }
    -    }
    -    
    -    // Check if new name will be create a duplicate testcase under same parent
    -    if( ($checkDuplicates = config_get('check_names_for_duplicates')) )
    -    {
    -      // get my parent
    -      $mi = $this->tree_manager->get_node_hierarchy_info($id);
    -      $itemSet = $this->getDuplicatesByName($name,$mi['parent_id'],array('id2exclude' => $id));
    -
    -      if(!is_null($itemSet)) {
    -        $ret['status_ok'] = false;
    -        $ret['msg'] = sprintf(lang_get('name_already_exists'),$name);
    -        $ret['reason'] = 'already_exists';
    -        $ret['hit_on'] = current($itemSet);
    -      }
    -
    -      if( $ret['status_ok'] == false ) {
    -        // get more info for feedback
    -      }
    -    }
    -
    -    if($ret['status_ok']) {
    -      if($my['opt']['blockIfExecuted']) {
    -        // When tcversion is updated on test plan after an executio exists
    -        // execution tcversion_number keeps the version of test case executed
    -        // will EX.tcversion_id is updated with id requested by user.
    -        // That's why when importing we need to check HUMAN READEABLE version numbers.
    -        $sql = " SELECT EX.id, EX.tcversion_number,TCV.version " .  
    -               " FROM {$this->tables['executions']} EX " .
    -               " JOIN {$this->tables['tcversions']} TCV " .
    -               " ON TCV.id = EX.tcversion_id " .
    -               " WHERE tcversion_id=" . $this->db->prepare_int($tcversion_id);
    -
    -        $rs = $this->db->get_recordset($sql);
    -        if(!is_null($rs))
    -        {
    -          foreach($rs as $rwx)
    -          {
    -            if( $rwx['tcversion_number'] == $rwx['version'] )
    -            {
    -              $ret['status_ok'] = false;
    -              $ret['msg'] = lang_get('block_ltcv_hasbeenexecuted');
    -              $ret['reason'] = 'blockIfExecuted';
    -              return $ret;
    -            }
    -          }  
    -        }
    -      }
    -
    -      $sql=array();
    -      $sql[] = " UPDATE {$this->tables['nodes_hierarchy']} SET name='" .
    -               $this->db->prepare_string($name) . "' WHERE id= {$id}";
    -
    -
    -      $k2e = array('summary','preconditions');
    -      $item = new stdClass();
    -      $item->summary = $summary;
    -      $item->preconditions = $preconditions;
    -      $this->CKEditorCopyAndPasteCleanUp($item,$k2e); 
    -      
    -      $dummy = " UPDATE {$this->tables['tcversions']} " .
    -               " SET summary='" . 
    -                 $this->db->prepare_string($item->summary) . "'," .
    -               " updater_id=" . $this->db->prepare_int($user_id) . ", " .
    -               " modification_ts = " . $this->db->db_now() . "," .
    -               " execution_type=" . $this->db->prepare_int($execution_type) . ", " .
    -               " importance=" . $this->db->prepare_int($importance) . "," .
    -               " preconditions='" . 
    -                 $this->db->prepare_string($item->preconditions) . "' ";
    -
    -
    -      if( !is_null($attrib['status']) )
    -      {
    -        $dummy .= ", status=" . intval($attrib['status']);
    -      }
    -
    -	    if( !is_null($attrib['is_open']) )    
    -      {
    -        $dummy .= ", is_open=" . intval($attrib['is_open']); 
    -      }
    -	  
    -	    if( !is_null($attrib['active']) )    
    -      {
    -        $dummy .= ", active=" . intval($attrib['active']); 
    -      }
    -
    -      if( !is_null($attrib['estimatedExecDuration']) )
    -      {
    -        $dummy .= ", estimated_exec_duration=";
    -        $v = trim($attrib['estimatedExecDuration']);
    -
    -        $dummy .= ($v == '') ? "NULL" : floatval($v);
    -      }
    -
    -      $dummy .= " WHERE id = " . $this->db->prepare_int($tcversion_id);
    -      $sql[] = $dummy;
    -
    -
    -      foreach($sql as $stm)
    -      {
    -        $result = $this->db->exec_query($stm);
    -        if( !$result )
    -        {
    -          $ret['status_ok'] = 0;
    -          $ret['msg'] = $this->db->error_msg;
    -          break;
    -        }
    -      }
    -
    -      if( $ret['status_ok'] && !is_null($steps) )
    -      {
    -        $this->update_tcversion_steps($tcversion_id,$steps);
    -      }
    -
    -      if( $ret['status_ok'] )
    -      {
    -        
    -        $idCard = array('id' => $id, 'version_id' => $tcversion_id,
    -                        'version' => $this->getVersionNumber($tcversion_id));
    -
    -        $this->updateKeywordAssignment($idCard,$keywords_id);
    -      }
    -
    -      $ctx = array('id' => $id,'version_id' => $tcversion_id,'name' => $name,
    -                   'summary' => $summary,'preconditions' => $preconditions,
    -                   'steps' => $steps,'user_id' => $user_id,
    -                   'keywords_id' => $keywords_id,'order' => $tc_order,
    -                   'exec_type' => $execution_type, 'importance' => $importance,
    -                   'attr' => $attr,'options' => $opt);
    -      event_signal('EVENT_TEST_CASE_UPDATE', $ctx);
    -    }
    -
    -    return $ret;
    -  }
    -
    -
    -  /**
    -   * used when updating a test case
    -   *
    -   */
    -  private function updateKeywordAssignment($idCard,$keywords_id) {
    -    // To avoid false loggings, check is delete is needed
    -    $id = intval($idCard['id']);
    -    $version_id = intval($idCard['version_id']);
    -    $version = intval($idCard['version']);
    -
    -    $items = array();
    -    $items['stored'] = $this->get_keywords_map($id,$version_id);
    -    if (is_null($items['stored'])) {
    -      $items['stored'] = array();
    -    }
    -
    -    $items['requested'] = array();
    -    if(trim($keywords_id) != "")
    -    {
    -      $a_keywords = explode(",",trim($keywords_id));
    -      $sql = " SELECT id,keyword " .
    -             " FROM {$this->tables['keywords']} " .
    -             " WHERE id IN (" . implode(',',$a_keywords) . ")";
    -
    -      $items['requested'] = $this->db->fetchColumnsIntoMap($sql,'id','keyword');
    -    }
    -
    -    $items['common'] = array_intersect_assoc($items['stored'],$items['requested']);
    -    $items['new'] = array_diff_assoc($items['requested'],$items['common']);
    -    $items['todelete'] = array_diff_assoc($items['stored'],$items['common']);
    -
    -    $auditContext = array('on' => self::AUDIT_ON, 'version' => $version);
    -    
    -    if(!is_null($items['todelete']) && count($items['todelete'])) {
    -      $this->deleteKeywords($id,$version_id,array_keys($items['todelete']),$auditContext);
    -    }
    -
    -    if(!is_null($items['new']) && count($items['new']))
    -    {
    -      $this->addKeywords($id,$version_id,array_keys($items['new']),$auditContext);
    -    }
    -  }
    -
    -
    -  /*
    -    function: logKeywordChanges
    -
    -    args:
    -
    -    returns:
    -
    -  */
    -  function logKeywordChanges($old,$new)
    -  {
    -
    -     // try to understand the really new
    -
    -  }
    -
    -
    -
    -
    -
    -
    -
    -  /*
    -    function: check_link_and_exec_status
    -              Fore every version of testcase (id), do following checks:
    -
    -              1. testcase is linked to one of more test plans ?
    -              2. if anwser is yes then,check if has been executed => has records on executions table
    -
    -    args : id: testcase id
    -
    -    returns: string with following values:
    -             no_links: testcase is not linked to any testplan
    -             linked_but_not_executed: testcase is linked at least to a testplan
    -                                      but has not been executed.
    -
    -             linked_and_executed: testcase is linked at least to a testplan and
    -                                  has been executed => has records on executions table.
    -
    -
    -  */
    -  function check_link_and_exec_status($id)
    -  {
    -    $status = 'no_links';
    -
    -    // get linked versions
    -    // ATTENTION TO PLATFORMS
    -    $linked_tcversions = $this->get_linked_versions($id);
    -    $has_links_to_testplans = is_null($linked_tcversions) ? 0 : 1;
    -
    -    if($has_links_to_testplans)
    -    {
    -      // check if executed
    -      $linked_not_exec = $this->get_linked_versions($id,array('exec_status' => 'NOT_EXECUTED'));
    -
    -      $status='linked_and_executed';
    -      if(count($linked_tcversions) == count($linked_not_exec))
    -      {
    -        $status = 'linked_but_not_executed';
    -      }
    -    }
    -    return $status;
    -  }
    -
    -
    -  /**
    -   *
    -   */
    -  function delete($id,$version_id = self::ALL_VERSIONS) {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $children=null;
    -    $do_it=true;
    -
    -    // I'm trying to speedup the next deletes
    -    $sql = "/* $debugMsg */ " .
    -           " SELECT NH_TCV.id AS tcversion_id, NH_TCSTEPS.id AS step_id " .
    -           " FROM {$this->tables['nodes_hierarchy']} NH_TCV " .
    -           " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NH_TCSTEPS " .
    -           " ON NH_TCSTEPS.parent_id = NH_TCV.id ";
    -
    -    $parent = (array)($id);
    -    $sql .= " WHERE NH_TCV.parent_id IN (" .implode(',',$parent) . ") ";
    -    if($version_id != self::ALL_VERSIONS) {
    -      $sql .= " AND NH_TCV.id = {$version_id}";
    -    }
    -
    -    $children_rs = $this->db->get_recordset($sql);
    -    $do_it = !is_null($children_rs);
    -    if($do_it) {
    -      foreach($children_rs as $value) {
    -        $children['tcversion'][]=$value['tcversion_id'];
    -        $children['step'][]=$value['step_id'];
    -      }
    -      $this->_execution_delete($id,$version_id,$children);
    -      $this->deleteAllTestCaseRelations($id);
    -      $this->_blind_delete($id,$version_id,$children);
    -    }
    -
    -    $ctx = array('id' => $id);
    -    event_signal('EVENT_TEST_CASE_DELETE', $ctx);
    -
    -    return 1;
    -  }
    -
    -  /*
    -    function: get_linked_versions
    -              For a test case get information about versions linked to testplans.
    -              Filters can be applied on:
    -                                        execution status
    -                                        active status
    -
    -    args : id: testcase id
    -           [filters]
    -            [exec_status]: default: ALL, range: ALL,EXECUTED,NOT_EXECUTED
    -            [active_status]: default: ALL, range: ALL,ACTIVE,INACTIVE
    -            [tplan_id]
    -            [platform_id]
    -
    -           [options]
    -            [output] 'full', 'nosteps', 'simple' (no info about steps)
    -
    -      returns: map.
    -             key: version id
    -             value: map with following structure:
    -                    key: testplan id
    -                    value: map with following structure:
    -
    -                    testcase_id
    -                    tcversion_id
    -                    id -> tcversion_id (node id)
    -                    version
    -                    summary
    -                    importance
    -                    author_id
    -                    creation_ts
    -                    updater_id
    -                    modification_ts
    -                    active
    -                    is_open
    -                    testplan_id
    -                    tplan_name
    -  */
    -  function get_linked_versions($id,$filters=null,$options=null)
    -  {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -
    -    $my['filters'] = array( 'exec_status' => "ALL", 'active_status' => 'ALL',
    -                            'tplan_id' => null, 'platform_id' => null);
    -    $my['filters'] = array_merge($my['filters'], (array)$filters);
    -
    -    // 'output' => 'full', 'nosteps', 'simple' (no info about steps)
    -    //
    -    $my['options'] = array('output' => "full");
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -
    -    $exec_status = strtoupper($my['filters']['exec_status']);
    -    $active_status = strtoupper($my['filters']['active_status']);
    -    $tplan_id = $my['filters']['tplan_id'];
    -    $platform_id = $my['filters']['platform_id'];
    -
    -    $active_filter='';
    -    if($active_status !='ALL')
    -    {
    -      $active_filter=' AND tcversions.active=' . $active_status=='ACTIVE' ? 1 : 0;
    -    }
    -
    -    $fields2get = 'tc_external_id,version,status,importance,active, is_open,execution_type,';
    -
    -    switch($my['options']['output'])
    -    {
    -      case 'full':
    -      case 'nosteps':
    -      $fields2get .=  'layout,summary,preconditions,tcversions.author_id,tcversions.creation_ts,' .
    -                      'tcversions.updater_id,tcversions.modification_ts,';
    -      break;
    -
    -      case 'simple':
    -      break;
    -
    -      case 'feature_id':
    -        $fields2get .=  'TTC.id AS feature_id,';
    -      break;
    -
    -    }
    -
    -    switch ($exec_status)
    -    {
    -      case "ALL":
    -            $sql = "/* $debugMsg */ " .
    -               " SELECT NH.parent_id AS testcase_id, TTC.tcversion_id, TTC.testplan_id,  TTC.platform_id," .
    -               " tcversions.id, {$fields2get} " .
    -             " NHB.name AS tplan_name " .
    -             " FROM   {$this->tables['nodes_hierarchy']} NH," .
    -             " {$this->tables['tcversions']} tcversions," .
    -             " {$this->tables['testplan_tcversions']} TTC, " .
    -             " {$this->tables['nodes_hierarchy']} NHB    " .
    -             " WHERE  TTC.tcversion_id = tcversions.id {$active_filter} " .
    -             " AND    tcversions.id = NH.id " .
    -             " AND    NHB.id = TTC.testplan_id " .
    -             " AND    NH.parent_id = {$id}";
    -
    -            if (!is_null($tplan_id)) {
    -              $sql .= " AND TTC.testplan_id = {$tplan_id} ";
    -            }
    -
    -            if (!is_null($platform_id)) {
    -              $sql .= " AND TTC.platform_id = {$platform_id} ";
    -            }
    -
    -            $recordset = $this->db->fetchMapRowsIntoMap($sql,'tcversion_id','testplan_id',database::CUMULATIVE);
    -
    -        if (!is_null($recordset)) {
    -          // changes third access key from sequential index to platform_id
    -          foreach ($recordset as $accessKey => $testplan) {
    -            foreach ($testplan as $tplanKey => $testcases) {
    -              // Use a temporary array to avoid key collisions
    -              $newArray = array();
    -              foreach ($testcases as $elemKey => $element) {
    -                $platform_id = $element['platform_id'];
    -                $newArray[$platform_id] = $element;
    -              }
    -              $recordset[$accessKey][$tplanKey] = $newArray;
    -            }
    -          }
    -        }
    -      break;
    -
    -      case "EXECUTED":
    -      case "NOT_EXECUTED":
    -        $getFilters = array('exec_status' => $exec_status,
    -                            'active_status' => $active_status,
    -                            'tplan_id' => $tplan_id, 
    -                            'platform_id' => $platform_id);
    -        $recordset=$this->get_exec_status($id,$getFilters);
    -      break;
    -    }
    -
    -    // Multiple Test Case Steps
    -    if( !is_null($recordset) && ($my['options']['output'] == 'full') ) {
    -      $version2loop = array_keys($recordset);
    -      foreach( $version2loop as $accessKey) {
    -        // no options => will renderd Ghost Steps
    -        $step_set = $this->get_steps($accessKey);
    -        $tplan2loop = array_keys($recordset[$accessKey]);
    -        foreach( $tplan2loop as $tplanKey) {
    -          $elem2loop = array_keys($recordset[$accessKey][$tplanKey]);
    -          foreach( $elem2loop as $elemKey) {
    -            $recordset[$accessKey][$tplanKey][$elemKey]['steps'] = $step_set;
    -          }
    -        }
    -
    -      }
    -    }
    -
    -    return $recordset;
    -  }
    -
    -  /*
    -    Delete the following info:
    -    req_coverage
    -    risk_assignment
    -    custom fields
    -    keywords
    -    links to test plans
    -    tcversions
    -    nodes from hierarchy
    -    testcase_script_links
    -
    -  */
    -  function _blind_delete($id,$version_id=self::ALL_VERSIONS,$children=null) {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $sql = array();
    -
    -    $destroyTC = false;
    -    $item_id = $version_id;
    -    $tcversion_list = $version_id;
    -    $target_nodes = $version_id;
    -    if( $version_id == self::ALL_VERSIONS) {
    -      $destroyTC = true;
    -      $item_id = $id;
    -      $tcversion_list = implode(',',$children['tcversion']);
    -      $target_nodes = $children['tcversion'];
    -    }
    -
    -    $this->cfield_mgr->remove_all_design_values_from_node($target_nodes);
    -
    -    $sql[] = "/* $debugMsg */ 
    -              DELETE FROM {$this->tables['user_assignments']} 
    -              WHERE feature_id in (" .
    -             " SELECT id FROM {$this->tables['testplan_tcversions']}  " .
    -             " WHERE tcversion_id IN ({$tcversion_list}))";
    -
    -    $sql[]="/* $debugMsg */ 
    -            DELETE FROM {$this->tables['testplan_tcversions']} 
    -            WHERE tcversion_id IN ({$tcversion_list})";
    -
    -    // Multiple Test Case Steps Feature
    -    if( !is_null($children['step']) ) {
    -      // remove null elements
    -      foreach($children['step'] as $key => $value) {
    -        if(is_null($value)) {
    -          unset($children['step'][$key]);
    -        }
    -      }
    -
    -      if( count($children['step']) > 0) {
    -        $step_list=trim(implode(',',$children['step']));
    -        $sql[]="/* $debugMsg */ DELETE FROM {$this->tables['tcsteps']}  " .
    -               " WHERE id IN ({$step_list})";
    -      }
    -    }
    -    // -----------------------------------------------------------------------
    -
    -    $sql[]="/* $debugMsg */  
    -            DELETE FROM {$this->tables['testcase_script_links']} 
    -            WHERE tcversion_id IN ({$tcversion_list})";
    -
    -    $sql[]="/* $debugMsg */ 
    -             DELETE FROM {$this->tables['testcase_keywords']} 
    -             WHERE testcase_id = {$id} 
    -             AND tcversion_id IN ({$tcversion_list})";
    -
    -    $sql[]="/* $debugMsg */ 
    -            DELETE FROM {$this->tables['req_coverage']}  
    +             WHERE nodes_hierarchy.node_type_id={$my_node_type}";
    +        return $this->db->get_recordset($sql);
    +    }
    +
    +    /**
    +     * Show Test Case
    +     */
    +    public function show(&$smarty, $guiObj, $identity, $grants, $opt = null)
    +    {
    +        static $cfg;
    +        static $reqMgr;
    +        static $hidePreconditions;
    +        static $hideSummary;
    +
    +        if (! $cfg) {
    +            $cfg = config_get('spec_cfg');
    +            $reqMgr = new requirement_mgr($this->db);
    +
    +            // Investigate if special keywords are defined in the test project
    +            $tproject_id = intval($identity->tproject_id);
    +            $hidePreconditions = tlKeyword::doesKeywordExist($this->db,
    +                '@#HIDE_PRECONDITIONS_IF_EMPTY', $tproject_id);
    +            $hideSummary = tlKeyword::doesKeywordExist($this->db,
    +                '@#HIDE_SUMMARY_IF_EMPTY', $tproject_id);
    +            $hidePreconditions = ($hidePreconditions['kwID'] != null);
    +            $hideSummary = ($hideSummary['kwID'] != null);
    +        }
    +
    +        $status_ok = ($identity->id > 0);
    +        if (! $status_ok) {
    +            throw new Exception(
    +                __METHOD__ . ' EXCEPTION: Test Case ID is invalid ( <= 0)');
    +        }
    +
    +        $my = array(
    +            'opt' => array(
    +                'getAttachments' => false
    +            )
    +        );
    +        $my['opt'] = array_merge($my['opt'], (array) $opt);
    +
    +        $id = $identity->id;
    +        $idSet = (array) $id;
    +
    +        $idCard = new stdClass();
    +        $idCard->tcase_id = intval($id);
    +        $idCard->tproject_id = intval($identity->tproject_id);
    +
    +        $idCard->tcversion_id = isset($identity->version_id) ? $identity->version_id : self::ALL_VERSIONS;
    +
    +        $getVersionID = $idCard->tcversion_id;
    +
    +        $gui = $this->initShowGui($guiObj, $grants, $idCard);
    +
    +        $gui->hidePreconditions = $hidePreconditions;
    +        $gui->hideSummary = $hideSummary;
    +
    +        // When editing on execution, it's important to understand
    +        // is current displayed version is LINKED to Test Plan
    +        // to add or remove some features
    +        //
    +        $gui->candidateToUpd = 0;
    +        switch ($gui->show_mode) {
    +            case 'editOnExec':
    +                $gui->candidateToUpd = ! $this->isLinkedTCVersion(
    +                    $idCard->tcversion_id, $gui->tplan_id);
    +                $gui->new_version_source = 'latest';
    +                break;
    +
    +            default:
    +                break;
    +        }
    +
    +        $userIDSet = array();
    +
    +        if ($status_ok && count($idSet)) {
    +
    +            $cfPlaces = $this->buildCFLocationMap();
    +            $gui->linked_versions = null;
    +            $gopt = [
    +                'withGhostString' => true,
    +                'renderGhost' => true,
    +                'renderImageInline' => true,
    +                'renderVariables' => true,
    +                'renderSpecialKW' => true,
    +                'caller' => 'show()',
    +                'tproject_id' => $idCard->tproject_id
    +            ];
    +
    +            $cfx = 0;
    +            $gui->otherVersionsKeywords = array();
    +
    +            $gui->fileUploadURL = array();
    +            foreach ($idSet as $tc_id) {
    +                // IMPORTANT NOTICE
    +                // Deep Analysis is need to understand if there is an use case
    +                // where this method really receive an array of test case ID.
    +                //
    +                // using an specific value for test case version id has sense
    +                // only when we are working on ONE SPECIFIC Test Case.
    +                //
    +                // if we are working on a set of test cases, because this method
    +                // does not manage in input couple of (test case, versio id),
    +                // the only chance is to get ALL VERSIONS
    +                //
    +                if (! $tcvSet = $this->get_by_id($tc_id, $getVersionID, null,
    +                    $gopt)) {
    +                    continue;
    +                }
    +
    +                if ($cfg->show_tplan_usage) {
    +                    $gui->linked_versions[] = $this->get_linked_versions($tc_id);
    +                }
    +
    +                // Position 0 is latest active version
    +                $tcvSet[0]['tc_external_id'] = $gui->tcasePrefix .
    +                    $tcvSet[0]['tc_external_id'];
    +                $tcvSet[0]['ghost'] = sprintf(self::GHOSTMASK,
    +                    $tcvSet[0]['tc_external_id'], $tcvSet[0]['version']);
    +
    +                $tcvSet[0]['ghost_preconditions'] = sprintf(
    +                    self::GHOSTPRECONDITIONSMASK, $tcvSet[0]['tc_external_id'],
    +                    $tcvSet[0]['version']);
    +
    +                // status quo of execution and links of tc versions
    +                $gui->status_quo[] = $this->getVersionsStatusQuo($tc_id);
    +
    +                // Logic on Current/Latest Test Case Version
    +                $tc_current = $tcvSet[0];
    +                $tc_current['isTheLatest'] = 1;
    +                $currentVersionID = $tc_current['id'];
    +
    +                $io = $idCard;
    +                $io->tcversion_id = $currentVersionID;
    +
    +                $gui->delAttachmentURL = $_SESSION['basehref'] .
    +                    $this->getDeleteAttachmentByIDRelativeURL($io, $gui);
    +
    +                $gui->delTCVRelationURL = $_SESSION['basehref'] .
    +                    $this->getDeleteTCVRelationRelativeURL($gui);
    +
    +                $gui->delTCVKeywordURL = $_SESSION['basehref'] .
    +                    $this->getDeleteTCVKeywordRelativeURL($gui);
    +
    +                $gui->delTCVPlatformURL = $_SESSION['basehref'] .
    +                    $this->getDeleteTCVPlatformRelativeURL($gui);
    +
    +                // Impacted for version management
    +                $gui->fileUploadURL[$currentVersionID] = $_SESSION['basehref'] .
    +                    $this->getFileUploadRelativeURL($io);
    +
    +                $gui->tc_current_version[] = array(
    +                    $tc_current
    +                );
    +
    +                //
    +                // REFACTORING - Following code uses tc_current!!!
    +                //
    +
    +                // Get UserID and Updater ID for current Version
    +                $userIDSet[$tc_current['author_id']] = null;
    +                $userIDSet[$tc_current['updater_id']] = null;
    +
    +                $gui->req4current_version = $reqMgr->getGoodForTCVersion(
    +                    $currentVersionID);
    +
    +                $gui->currentVersionKeywords = $this->getKeywords($tc_id,
    +                    $currentVersionID);
    +
    +                $gui->currentVersionPlatforms = $this->getPlatforms($tc_id,
    +                    $currentVersionID);
    +
    +                $whoami = array(
    +                    'tcase_id' => $tc_id,
    +                    'tcversion_id' => $currentVersionID
    +                );
    +
    +                $of = array(
    +                    'output' => 'html_options',
    +                    'add_blank' => true
    +                );
    +                $gui->currentVersionFreeKeywords = $this->getFreeKeywords(
    +                    $whoami, $of);
    +
    +                $gui->currentVersionFreePlatforms = $this->getFreePlatforms(
    +                    $whoami, $of);
    +
    +                if ($my['opt']['getAttachments']) {
    +                    $gui->attachments[$currentVersionID] = getAttachmentInfosFrom(
    +                        $this, $currentVersionID);
    +                }
    +
    +                // get linked testcase scripts
    +                if ($gui->codeTrackerEnabled) {
    +                    $scripts = $this->getScriptsForTestCaseVersion($gui->cts,
    +                        $currentVersionID);
    +                    if (! is_null($scripts)) {
    +                        $gui->scripts[$currentVersionID] = $scripts;
    +                    }
    +                }
    +
    +                if ($this->cfg->testcase->relations->enable) {
    +                    $xm = array(
    +                        'tcase_id' => $tc_id,
    +                        'tcversion_id' => $currentVersionID
    +                    );
    +                    $gui->relationSet[] = $this->getTCVersionRelations($xm);
    +                }
    +
    +                $cfCtx = [
    +                    'scope' => 'design',
    +                    'tproject_id' => $gui->tproject_id,
    +                    'link_id' => $tc_current['id']
    +                ];
    +
    +                foreach ($cfPlaces as $cfpKey => $cfpFilter) {
    +                    // we need to do this when in display mode
    +                    switch ($cfpKey) {
    +                        case 'hide_because_is_used_as_variable':
    +                            break;
    +
    +                        default:
    +                            $gui->cf_current_version[$cfx][$cfpKey] = $this->htmlTableOfCFValues(
    +                                $tc_id, $cfCtx, $cfpFilter);
    +                            break;
    +                    }
    +                }
    +
    +                // Other versions (if exists)
    +                if (count($tcvSet) > 1) {
    +                    $gui->testcase_other_versions[] = array_slice($tcvSet, 1);
    +
    +                    $target_idx = count($gui->testcase_other_versions) - 1;
    +                    $loop2do = count($gui->testcase_other_versions[$target_idx]);
    +
    +                    $cfCtx = array(
    +                        'scope' => 'design',
    +                        'tproject_id' => $gui->tproject_id
    +                    );
    +
    +                    $ref = &$gui->testcase_other_versions[$target_idx];
    +                    for ($qdx = 0; $qdx < $loop2do; $qdx ++) {
    +
    +                        $gui->testcase_other_versions[$target_idx][$qdx]['isTheLatest'] = 0;
    +
    +                        $ref[$qdx]['ghost'] = sprintf(self::GHOSTMASK,
    +                            $tcvSet[0]['tc_external_id'], $ref[$qdx]['version']);
    +
    +                        $cfCtx['link_id'] = $gui->testcase_other_versions[$target_idx][$qdx]['id'];
    +                        foreach ($cfPlaces as $locKey => $locFilter) {
    +                            switch ($cfpKey) {
    +                                case 'hide_because_is_used_as_variable':
    +                                    break;
    +
    +                                default:
    +                                    $gui->cf_other_versions[$cfx][$qdx][$locKey] = $this->htmlTableOfCFValues(
    +                                        $tc_id, $cfCtx, $locFilter);
    +                                    break;
    +                            }
    +                        }
    +                    }
    +                } else {
    +                    $gui->testcase_other_versions[] = null;
    +                    $gui->otherVersionsRelations[] = null;
    +                    $gui->cf_other_versions[$cfx] = null;
    +                }
    +
    +                $cfx ++;
    +
    +                if ($gui->testcase_other_versions[0]) {
    +
    +                    // Get author and updater id for each version
    +                    foreach ($gui->testcase_other_versions[0] as $version) {
    +
    +                        $userIDSet[$version['author_id']] = null;
    +                        $userIDSet[$version['updater_id']] = null;
    +
    +                        if ($this->cfg->testcase->relations->enable) {
    +                            $xm = array(
    +                                'tcase_id' => $version['testcase_id'],
    +                                'tcversion_id' => $version['id'],
    +                                'other' => 'other'
    +                            );
    +                            $gui->otherVersionsRelations[] = $this->getTCVersionRelations(
    +                                $xm);
    +                        }
    +
    +                        // get linked testcase scripts
    +                        if ($gui->codeTrackerEnabled) {
    +                            $scripts = $this->getScriptsForTestCaseVersion(
    +                                $gui->cts, $version['id']);
    +                            if (! is_null($scripts)) {
    +                                $gui->scripts[$version['id']] = $scripts;
    +                            }
    +                        }
    +
    +                        if ($my['opt']['getAttachments']) {
    +                            $gui->attachments[$version['id']] = getAttachmentInfosFrom(
    +                                $this, $version['id']);
    +                        }
    +
    +                        $io = $idCard;
    +                        $io->tcversion_id = $version['id'];
    +
    +                        $gui->fileUploadURL[$version['id']] = $_SESSION['basehref'] .
    +                            $this->getFileUploadRelativeURL($io);
    +
    +                        // Requirements
    +                        $gui->req4OtherVersions[] = $reqMgr->getGoodForTCVersion(
    +                            $version['id']);
    +
    +                        $gui->otherVersionsKeywords[] = $this->getKeywords(
    +                            $version['testcase_id'], $version['id']);
    +
    +                        $gui->otherVersionsPlatforms[] = $this->getPlatforms(
    +                            $version['testcase_id'], $version['id']);
    +                    }
    +                } // Other versions exist
    +            }
    +        }
    +
    +        $gui->relations = $gui->relationSet;
    +        $gui->relation_domain = '';
    +        if ($this->cfg->testcase->relations->enable) {
    +            $gui->relation_domain = $this->getRelationTypeDomainForHTMLSelect();
    +        }
    +
    +        // Removing duplicate and NULL id's
    +        unset($userIDSet['']);
    +        $gui->users = tlUser::getByIDs($this->db, array_keys($userIDSet));
    +        $gui->cf = null;
    +
    +        $this->initShowGuiActions($gui);
    +        $tplCfg = templateConfiguration('tcView');
    +
    +        $gui->additionalMessages = [];
    +        if ($gui->currentVersionKeywords != null &&
    +            count($gui->currentVersionKeywords) > 0) {
    +            // look for annotations in notes
    +            foreach ($gui->currentVersionKeywords as $kwEntity) {
    +                foreach ($this->keywordAnnotations as $kwAnnot) {
    +                    if (strpos($kwEntity['notes'], $kwAnnot) !== false) {
    +                        $gui->additionalMessages[] = json_decode(
    +                            str_replace($kwAnnot, '',
    +                                explode("/@", $kwEntity['notes'])[0]));
    +                        break;
    +                    }
    +                }
    +            }
    +        }
    +        $smarty->assign('gui', $gui);
    +        $smarty->display($tplCfg->template_dir . $tplCfg->default_template);
    +    }
    +
    +    /**
    +     * update test case specification
    +     *
    +     * @param integer $id
    +     *            Test case unique identifier (node_hierarchy table)
    +     * @param integer $tcversion_id
    +     *            Test Case Version unique ID (node_hierarchy table)
    +     * @param string $name
    +     *            name/title
    +     * @param string $summary
    +     * @param string $preconditions
    +     * @param array $steps
    +     *            steps + expected results
    +     * @param integer $user_id
    +     *            who is doing the update
    +     * @param string $keywords_id
    +     *            optional list of keyword id to be linked to test case
    +     *            this list will override previous keyword links (delete + insert).
    +     *
    +     * @param integer $tc_order
    +     *            optional order inside parent test suite
    +     * @param integer $execution_type
    +     *            optional
    +     * @param integer $importance
    +     *            optional
    +     *
    +     *
    +     *
    +     */
    +    public function update($id, $tcversion_id, $name, $summary, $preconditions,
    +        $steps, $user_id, $keywords_id = '', $tc_order = self::DEFAULT_ORDER,
    +        $execution_type = TESTCASE_EXECUTION_TYPE_MANUAL, $importance = 2,
    +        $attr = null, $opt = null)
    +    {
    +        $ret['status_ok'] = 1;
    +        $ret['msg'] = '';
    +        $ret['reason'] = '';
    +
    +        $my['opt'] = array(
    +            'blockIfExecuted' => false
    +        );
    +        $my['opt'] = array_merge($my['opt'], (array) $opt);
    +
    +        $attrib = array(
    +            'status' => null,
    +            'is_open' => null,
    +            'active' => null,
    +            'estimatedExecDuration' => null
    +        );
    +        $attrib = array_merge($attrib, (array) $attr);
    +
    +        tLog(
    +            "TC UPDATE ID=($id): exec_type=$execution_type importance=$importance");
    +
    +        if (trim($summary) != '' && strpos($summary, self::NAME_PHOPEN) !== false &&
    +            strpos($summary, self::NAME_PHCLOSE) !== false) {
    +            $name = $this->buildTCName($name, $summary);
    +        }
    +
    +        // Check if new name will be create a duplicate testcase under same parent
    +        if (config_get('check_names_for_duplicates')) {
    +            // get my parent
    +            $mi = $this->tree_manager->get_node_hierarchy_info($id);
    +            $itemSet = $this->getDuplicatesByName($name, $mi['parent_id'],
    +                array(
    +                    'id2exclude' => $id
    +                ));
    +
    +            if (! is_null($itemSet)) {
    +                $ret['status_ok'] = false;
    +                $ret['msg'] = sprintf(lang_get('name_already_exists'), $name);
    +                $ret['reason'] = 'already_exists';
    +                $ret['hit_on'] = current($itemSet);
    +            }
    +
    +            if (! $ret['status_ok']) {
    +                // get more info for feedback
    +            }
    +        }
    +
    +        if ($ret['status_ok']) {
    +            if ($my['opt']['blockIfExecuted']) {
    +                // When tcversion is updated on test plan after an executio exists
    +                // execution tcversion_number keeps the version of test case executed
    +                // will EX.tcversion_id is updated with id requested by user.
    +                // That's why when importing we need to check HUMAN READEABLE version numbers.
    +                $sql = " SELECT EX.id, EX.tcversion_number,TCV.version " .
    +                    " FROM {$this->tables['executions']} EX " .
    +                    " JOIN {$this->tables['tcversions']} TCV " .
    +                    " ON TCV.id = EX.tcversion_id " . " WHERE tcversion_id=" .
    +                    $this->db->prepare_int($tcversion_id);
    +
    +                $rs = $this->db->get_recordset($sql);
    +                if (! is_null($rs)) {
    +                    foreach ($rs as $rwx) {
    +                        if ($rwx['tcversion_number'] == $rwx['version']) {
    +                            $ret['status_ok'] = false;
    +                            $ret['msg'] = lang_get('block_ltcv_hasbeenexecuted');
    +                            $ret['reason'] = 'blockIfExecuted';
    +                            return $ret;
    +                        }
    +                    }
    +                }
    +            }
    +
    +            $sql = array();
    +            $sql[] = " UPDATE {$this->tables['nodes_hierarchy']} SET name='" .
    +                $this->db->prepare_string($name) . "' WHERE id= {$id}";
    +
    +            $k2e = array(
    +                'summary',
    +                'preconditions'
    +            );
    +            $item = new stdClass();
    +            $item->summary = $summary;
    +            $item->preconditions = $preconditions;
    +            $this->ckEditorCopyAndPasteCleanUp($item, $k2e);
    +
    +            $dummy = " UPDATE {$this->tables['tcversions']} " . " SET summary='" .
    +                $this->db->prepare_string($item->summary) . "'," . " updater_id=" .
    +                $this->db->prepare_int($user_id) . ", " . " modification_ts = " .
    +                $this->db->db_now() . "," . " execution_type=" .
    +                $this->db->prepare_int($execution_type) . ", " . " importance=" .
    +                $this->db->prepare_int($importance) . "," . " preconditions='" .
    +                $this->db->prepare_string($item->preconditions) . "' ";
    +
    +            if (! is_null($attrib['status'])) {
    +                $dummy .= ", status=" . intval($attrib['status']);
    +            }
    +
    +            if (! is_null($attrib['is_open'])) {
    +                $dummy .= ", is_open=" . intval($attrib['is_open']);
    +            }
    +
    +            if (! is_null($attrib['active'])) {
    +                $dummy .= ", active=" . intval($attrib['active']);
    +            }
    +
    +            if (! is_null($attrib['estimatedExecDuration'])) {
    +                $dummy .= ", estimated_exec_duration=";
    +                $v = trim($attrib['estimatedExecDuration']);
    +
    +                $dummy .= ($v == '') ? "NULL" : floatval($v);
    +            }
    +
    +            $dummy .= " WHERE id = " . $this->db->prepare_int($tcversion_id);
    +            $sql[] = $dummy;
    +
    +            foreach ($sql as $stm) {
    +                $result = $this->db->exec_query($stm);
    +                if (! $result) {
    +                    $ret['status_ok'] = 0;
    +                    $ret['msg'] = $this->db->error_msg;
    +                    break;
    +                }
    +            }
    +
    +            if ($ret['status_ok'] && ! is_null($steps)) {
    +                $this->update_tcversion_steps($tcversion_id, $steps);
    +            }
    +
    +            if ($ret['status_ok']) {
    +
    +                $idCard = array(
    +                    'id' => $id,
    +                    'version_id' => $tcversion_id,
    +                    'version' => $this->getVersionNumber($tcversion_id)
    +                );
    +
    +                $this->updateKeywordAssignment($idCard, $keywords_id);
    +            }
    +
    +            $ctx = array(
    +                'id' => $id,
    +                'version_id' => $tcversion_id,
    +                'name' => $name,
    +                'summary' => $summary,
    +                'preconditions' => $preconditions,
    +                'steps' => $steps,
    +                'user_id' => $user_id,
    +                'keywords_id' => $keywords_id,
    +                'order' => $tc_order,
    +                'exec_type' => $execution_type,
    +                'importance' => $importance,
    +                'attr' => $attr,
    +                'options' => $opt
    +            );
    +            event_signal('EVENT_TEST_CASE_UPDATE', $ctx);
    +        }
    +
    +        return $ret;
    +    }
    +
    +    /**
    +     * used when updating a test case
    +     */
    +    private function updateKeywordAssignment($idCard, $keywords_id)
    +    {
    +        // To avoid false loggings, check is delete is needed
    +        $id = intval($idCard['id']);
    +        $version_id = intval($idCard['version_id']);
    +        $version = intval($idCard['version']);
    +
    +        $items = array();
    +        $items['stored'] = $this->get_keywords_map($id, $version_id);
    +        if (is_null($items['stored'])) {
    +            $items['stored'] = array();
    +        }
    +
    +        $items['requested'] = array();
    +        if (trim($keywords_id) != "") {
    +            $a_keywords = explode(",", trim($keywords_id));
    +            $sql = " SELECT id,keyword " . " FROM {$this->tables['keywords']} " .
    +                " WHERE id IN (" . implode(',', $a_keywords) . ")";
    +
    +            $items['requested'] = $this->db->fetchColumnsIntoMap($sql, 'id',
    +                'keyword');
    +        }
    +
    +        $items['common'] = array_intersect_assoc($items['stored'],
    +            $items['requested']);
    +        $items['new'] = array_diff_assoc($items['requested'], $items['common']);
    +        $items['todelete'] = array_diff_assoc($items['stored'], $items['common']);
    +
    +        $auditContext = array(
    +            'on' => self::AUDIT_ON,
    +            'version' => $version
    +        );
    +
    +        if (! is_null($items['todelete']) && count($items['todelete'])) {
    +            $this->deleteKeywords($id, $version_id,
    +                array_keys($items['todelete']), $auditContext);
    +        }
    +
    +        if (! is_null($items['new']) && count($items['new'])) {
    +            $this->addKeywords($id, $version_id, array_keys($items['new']),
    +                $auditContext);
    +        }
    +    }
    +
    +    /*
    +     * function: check_link_and_exec_status
    +     * Fore every version of testcase (id), do following checks:
    +     *
    +     * 1. testcase is linked to one of more test plans ?
    +     * 2. if anwser is yes then,check if has been executed => has records on executions table
    +     *
    +     * args : id: testcase id
    +     *
    +     * returns: string with following values:
    +     * no_links: testcase is not linked to any testplan
    +     * linked_but_not_executed: testcase is linked at least to a testplan
    +     * but has not been executed.
    +     *
    +     * linked_and_executed: testcase is linked at least to a testplan and
    +     * has been executed => has records on executions table.
    +     *
    +     *
    +     */
    +    private function checkLinkAndExecStatus($id)
    +    {
    +        $status = 'no_links';
    +
    +        // get linked versions
    +        // ATTENTION TO PLATFORMS
    +        $linked_tcversions = $this->get_linked_versions($id);
    +        $has_links_to_testplans = is_null($linked_tcversions) ? 0 : 1;
    +
    +        if ($has_links_to_testplans) {
    +            // check if executed
    +            $linked_not_exec = $this->get_linked_versions($id,
    +                array(
    +                    'exec_status' => 'NOT_EXECUTED'
    +                ));
    +
    +            $status = 'linked_and_executed';
    +            if (count($linked_tcversions) == count($linked_not_exec)) {
    +                $status = 'linked_but_not_executed';
    +            }
    +        }
    +        return $status;
    +    }
    +
    +    /**
    +     */
    +    public function delete($id, $version_id = self::ALL_VERSIONS)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $children = null;
    +        $do_it = true;
    +
    +        // I'm trying to speedup the next deletes
    +        $sql = "/* $debugMsg */ " .
    +            " SELECT NH_TCV.id AS tcversion_id, NH_TCSTEPS.id AS step_id " .
    +            " FROM {$this->tables['nodes_hierarchy']} NH_TCV " .
    +            " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NH_TCSTEPS " .
    +            " ON NH_TCSTEPS.parent_id = NH_TCV.id ";
    +
    +        $parent = (array) ($id);
    +        $sql .= " WHERE NH_TCV.parent_id IN (" . implode(',', $parent) . ") ";
    +        if ($version_id != self::ALL_VERSIONS) {
    +            $sql .= " AND NH_TCV.id = {$version_id}";
    +        }
    +
    +        $children_rs = $this->db->get_recordset($sql);
    +        $do_it = ! is_null($children_rs);
    +        if ($do_it) {
    +            foreach ($children_rs as $value) {
    +                $children['tcversion'][] = $value['tcversion_id'];
    +                $children['step'][] = $value['step_id'];
    +            }
    +            $this->_execution_delete($id, $version_id, $children);
    +            $this->deleteAllTestCaseRelations($id);
    +            $this->_blind_delete($id, $version_id, $children);
    +        }
    +
    +        $ctx = array(
    +            'id' => $id
    +        );
    +        event_signal('EVENT_TEST_CASE_DELETE', $ctx);
    +
    +        return 1;
    +    }
    +
    +    /*
    +     * function: get_linked_versions
    +     * For a test case get information about versions linked to testplans.
    +     * Filters can be applied on:
    +     * execution status
    +     * active status
    +     *
    +     * args : id: testcase id
    +     * [filters]
    +     * [exec_status]: default: ALL, range: ALL,EXECUTED,NOT_EXECUTED
    +     * [active_status]: default: ALL, range: ALL,ACTIVE,INACTIVE
    +     * [tplan_id]
    +     * [platform_id]
    +     *
    +     * [options]
    +     * [output] 'full', 'nosteps', 'simple' (no info about steps)
    +     *
    +     * returns: map.
    +     * key: version id
    +     * value: map with following structure:
    +     * key: testplan id
    +     * value: map with following structure:
    +     *
    +     * testcase_id
    +     * tcversion_id
    +     * id -> tcversion_id (node id)
    +     * version
    +     * summary
    +     * importance
    +     * author_id
    +     * creation_ts
    +     * updater_id
    +     * modification_ts
    +     * active
    +     * is_open
    +     * testplan_id
    +     * tplan_name
    +     */
    +    public function get_linked_versions($id, $filters = null, $options = null)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +
    +        $my['filters'] = array(
    +            'exec_status' => "ALL",
    +            'active_status' => 'ALL',
    +            'tplan_id' => null,
    +            'platform_id' => null
    +        );
    +        $my['filters'] = array_merge($my['filters'], (array) $filters);
    +
    +        // 'output' => 'full', 'nosteps', 'simple' (no info about steps)
    +        //
    +        $my['options'] = array(
    +            'output' => "full"
    +        );
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $exec_status = strtoupper($my['filters']['exec_status']);
    +        $active_status = strtoupper($my['filters']['active_status']);
    +        $tplan_id = $my['filters']['tplan_id'];
    +        $platform_id = $my['filters']['platform_id'];
    +
    +        $active_filter = '';
    +        if ($active_status != 'ALL') {
    +            $active_filter = ' AND tcversions.active=' . $active_status ==
    +                'ACTIVE' ? 1 : 0;
    +        }
    +
    +        $fields2get = 'tc_external_id,version,status,importance,active, is_open,execution_type,';
    +
    +        switch ($my['options']['output']) {
    +            case 'full':
    +            case 'nosteps':
    +                $fields2get .= 'layout,summary,preconditions,tcversions.author_id,tcversions.creation_ts,' .
    +                    'tcversions.updater_id,tcversions.modification_ts,';
    +                break;
    +
    +            case 'simple':
    +                break;
    +
    +            case 'feature_id':
    +                $fields2get .= 'TTC.id AS feature_id,';
    +                break;
    +        }
    +
    +        switch ($exec_status) {
    +            case "ALL":
    +                $sql = "/* $debugMsg */ " .
    +                    " SELECT NH.parent_id AS testcase_id, TTC.tcversion_id, TTC.testplan_id,  TTC.platform_id," .
    +                    " tcversions.id, {$fields2get} " . " NHB.name AS tplan_name " .
    +                    " FROM   {$this->tables['nodes_hierarchy']} NH," .
    +                    " {$this->tables['tcversions']} tcversions," .
    +                    " {$this->tables['testplan_tcversions']} TTC, " .
    +                    " {$this->tables['nodes_hierarchy']} NHB    " .
    +                    " WHERE  TTC.tcversion_id = tcversions.id {$active_filter} " .
    +                    " AND    tcversions.id = NH.id " .
    +                    " AND    NHB.id = TTC.testplan_id " .
    +                    " AND    NH.parent_id = {$id}";
    +
    +                if (! is_null($tplan_id)) {
    +                    $sql .= " AND TTC.testplan_id = {$tplan_id} ";
    +                }
    +
    +                if (! is_null($platform_id)) {
    +                    $sql .= " AND TTC.platform_id = {$platform_id} ";
    +                }
    +
    +                $recordset = $this->db->fetchMapRowsIntoMap($sql, 'tcversion_id',
    +                    'testplan_id', database::CUMULATIVE);
    +
    +                if (! is_null($recordset)) {
    +                    // changes third access key from sequential index to platform_id
    +                    foreach ($recordset as $accessKey => $testplan) {
    +                        foreach ($testplan as $tplanKey => $testcases) {
    +                            // Use a temporary array to avoid key collisions
    +                            $newArray = array();
    +                            foreach ($testcases as $element) {
    +                                $platform_id = $element['platform_id'];
    +                                $newArray[$platform_id] = $element;
    +                            }
    +                            $recordset[$accessKey][$tplanKey] = $newArray;
    +                        }
    +                    }
    +                }
    +                break;
    +
    +            case "EXECUTED":
    +            case "NOT_EXECUTED":
    +                $getFilters = array(
    +                    'exec_status' => $exec_status,
    +                    'active_status' => $active_status,
    +                    'tplan_id' => $tplan_id,
    +                    'platform_id' => $platform_id
    +                );
    +                $recordset = $this->getExecStatus($id, $getFilters);
    +                break;
    +        }
    +
    +        // Multiple Test Case Steps
    +        if (! is_null($recordset) && ($my['options']['output'] == 'full')) {
    +            $version2loop = array_keys($recordset);
    +            foreach ($version2loop as $accessKey) {
    +                // no options => will renderd Ghost Steps
    +                $step_set = $this->get_steps($accessKey);
    +                $tplan2loop = array_keys($recordset[$accessKey]);
    +                foreach ($tplan2loop as $tplanKey) {
    +                    $elem2loop = array_keys($recordset[$accessKey][$tplanKey]);
    +                    foreach ($elem2loop as $elemKey) {
    +                        $recordset[$accessKey][$tplanKey][$elemKey]['steps'] = $step_set;
    +                    }
    +                }
    +            }
    +        }
    +
    +        return $recordset;
    +    }
    +
    +    /*
    +     * Delete the following info:
    +     * req_coverage
    +     * risk_assignment
    +     * custom fields
    +     * keywords
    +     * links to test plans
    +     * tcversions
    +     * nodes from hierarchy
    +     * testcase_script_links
    +     *
    +     */
    +    private function _blind_delete($id, $version_id = self::ALL_VERSIONS,
    +        $children = null)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $sql = array();
    +
    +        $destroyTC = false;
    +        $item_id = $version_id;
    +        $tcversion_list = $version_id;
    +        $target_nodes = $version_id;
    +        if ($version_id == self::ALL_VERSIONS) {
    +            $destroyTC = true;
    +            $item_id = $id;
    +            $tcversion_list = implode(',', $children['tcversion']);
    +            $target_nodes = $children['tcversion'];
    +        }
    +
    +        $this->cfield_mgr->remove_all_design_values_from_node($target_nodes);
    +
    +        $sql[] = "/* $debugMsg */
    +              DELETE FROM {$this->tables['user_assignments']}
    +              WHERE feature_id in (" .
    +            " SELECT id FROM {$this->tables['testplan_tcversions']}  " .
    +            " WHERE tcversion_id IN ({$tcversion_list}))";
    +
    +        $sql[] = "/* $debugMsg */
    +            DELETE FROM {$this->tables['testplan_tcversions']}
    +            WHERE tcversion_id IN ({$tcversion_list})";
    +
    +        // Multiple Test Case Steps Feature
    +        if (! is_null($children['step'])) {
    +            // remove null elements
    +            foreach ($children['step'] as $key => $value) {
    +                if (is_null($value)) {
    +                    unset($children['step'][$key]);
    +                }
    +            }
    +
    +            if (count($children['step']) > 0) {
    +                $step_list = trim(implode(',', $children['step']));
    +                $sql[] = "/* $debugMsg */ DELETE FROM {$this->tables['tcsteps']}  " .
    +                    " WHERE id IN ({$step_list})";
    +            }
    +        }
    +
    +        $sql[] = "/* $debugMsg */
    +            DELETE FROM {$this->tables['testcase_script_links']}
    +            WHERE tcversion_id IN ({$tcversion_list})";
    +
    +        $sql[] = "/* $debugMsg */
    +             DELETE FROM {$this->tables['testcase_keywords']}
    +             WHERE testcase_id = {$id}
    +             AND tcversion_id IN ({$tcversion_list})";
    +
    +        $sql[] = "/* $debugMsg */
    +            DELETE FROM {$this->tables['req_coverage']}
                 WHERE testcase_id = {$id}
    -            AND tcversion_id IN ({$tcversion_list})";
    -
    -
    -    // This has to be the last, to avoid FK issues
    -    $sql[]="/* $debugMsg */ 
    -            DELETE FROM {$this->tables['tcversions']} 
    -            WHERE id IN ({$tcversion_list})";
    -
    -
    -    foreach ($sql as $the_stm) {
    -      $result = $this->db->exec_query($the_stm);
    -    }
    -
    -    if( !$destroyTC ) {
    -      $toloop = array( $version_id );
    -      foreach( $toloop as $nu ) {
    -        $this->deleteAttachments($nu);
    -      }
    -    }
    -
    -    if($destroyTC) {
    -      // Remove data that is related to Test Case => must be deleted when there is no more trace
    -      // of test case => when all version are deleted
    -      $sql = null;
    -      $sql[]="/* $debugMsg */ 
    -             DELETE FROM {$this->tables['testcase_keywords']} 
    -             WHERE testcase_id = {$id}";
    -
    -      $sql[]="/* $debugMsg */ 
    -              DELETE FROM {$this->tables['req_coverage']}  
    -              WHERE testcase_id = {$id}";
    -
    -      foreach ($sql as $the_stm) {
    -        $result = $this->db->exec_query($the_stm);
    -      }
    -
    -      // $this->deleteAttachments($id);
    -      if( $version_id == self::ALL_VERSIONS ) {
    -        $toloop = explode(',',$tcversion_list);
    -      } 
    -      foreach( $toloop as $nu ) {
    -        $this->deleteAttachments($nu);
    -      }
    -    }
    -
    -    // Attention:
    -    // After addition of test case steps feature, a test case version can be root of
    -    // a subtree that contains the steps.
    -    $this->tree_manager->delete_subtree($item_id);
    -  }
    -
    -
    -  /*
    -    Delete the following info:
    -    bugs
    -    executions
    -    cfield_execution_values
    -  */
    -  function _execution_delete($id,$version_id=self::ALL_VERSIONS,$children=null) {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $sql = array();
    -
    -    // ------------------------------------------------------------------------------
    -    $step_list = ''; 
    -    if( !is_null($children['step']) ) {
    -        // remove null elements
    -        foreach($children['step'] as $key => $value) {
    -          if(is_null($value)) {
    -            unset($children['step'][$key]);
    -          }
    -        }
    -
    -        if( count($children['step']) > 0) {
    -          $step_list=trim(implode(',',$children['step']));
    -       }
    -    }
    -    // ------------------------------------------------------------------------------
    -  
    -    if( $version_id == self::ALL_VERSIONS ) {
    -      // ------------------------------------------------------------------------------
    -      if( $step_list != '' ) {
    -        $sql[] = "/* $debugMsg */ 
    -                  DELETE FROM {$this->tables['execution_tcsteps_wip']} 
    -                  WHERE tcstep_id IN ({$step_list})";
    -      }
    -      // ------------------------------------------------------------------------------
    -
    -
    -      // ------------------------------------------------------------------------------
    -      $tcversion_list = implode(',',$children['tcversion']);
    -
    -      $sql[]="/* $debugMsg */ DELETE FROM {$this->tables['execution_tcsteps']} " .
    -             " WHERE execution_id IN (SELECT id FROM {$this->tables['executions']} " .
    -             " WHERE tcversion_id IN ({$tcversion_list}))";
    -
    -      $sql[]="/* $debugMsg */ DELETE FROM {$this->tables['execution_bugs']} " .
    -             " WHERE execution_id IN (SELECT id FROM {$this->tables['executions']} " .
    -             " WHERE tcversion_id IN ({$tcversion_list}))";
    -
    -      $sql[] = "/* $debugMsg */ 
    +            AND tcversion_id IN ({$tcversion_list})";
    +
    +        // This has to be the last, to avoid FK issues
    +        $sql[] = "/* $debugMsg */
    +            DELETE FROM {$this->tables['tcversions']}
    +            WHERE id IN ({$tcversion_list})";
    +
    +        foreach ($sql as $the_stm) {
    +            $this->db->exec_query($the_stm);
    +        }
    +
    +        if (! $destroyTC) {
    +            $toloop = array(
    +                $version_id
    +            );
    +            foreach ($toloop as $nu) {
    +                $this->deleteAttachments($nu);
    +            }
    +        }
    +
    +        if ($destroyTC) {
    +            // Remove data that is related to Test Case => must be deleted when there is no more trace
    +            // of test case => when all version are deleted
    +            $sql = null;
    +            $sql[] = "/* $debugMsg */
    +             DELETE FROM {$this->tables['testcase_keywords']}
    +             WHERE testcase_id = {$id}";
    +
    +            $sql[] = "/* $debugMsg */
    +              DELETE FROM {$this->tables['req_coverage']}
    +              WHERE testcase_id = {$id}";
    +
    +            foreach ($sql as $the_stm) {
    +                $this->db->exec_query($the_stm);
    +            }
    +
    +            if ($version_id == self::ALL_VERSIONS) {
    +                $toloop = explode(',', $tcversion_list);
    +            }
    +            foreach ($toloop as $nu) {
    +                $this->deleteAttachments($nu);
    +            }
    +        }
    +
    +        // Attention:
    +        // After addition of test case steps feature, a test case version can be root of
    +        // a subtree that contains the steps.
    +        $this->tree_manager->delete_subtree($item_id);
    +    }
    +
    +    /*
    +     * Delete the following info:
    +     * bugs
    +     * executions
    +     * cfield_execution_values
    +     */
    +    private function _execution_delete($id, $version_id = self::ALL_VERSIONS,
    +        $children = null)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $sql = array();
    +
    +        $step_list = '';
    +        if (! is_null($children['step'])) {
    +            // remove null elements
    +            foreach ($children['step'] as $key => $value) {
    +                if (is_null($value)) {
    +                    unset($children['step'][$key]);
    +                }
    +            }
    +
    +            if (count($children['step']) > 0) {
    +                $step_list = trim(implode(',', $children['step']));
    +            }
    +        }
    +
    +        if ($version_id == self::ALL_VERSIONS) {
    +
    +            if ($step_list != '') {
    +                $sql[] = "/* $debugMsg */
    +                  DELETE FROM {$this->tables['execution_tcsteps_wip']}
    +                  WHERE tcstep_id IN ({$step_list})";
    +            }
    +
    +            $tcversion_list = implode(',', $children['tcversion']);
    +
    +            $sql[] = "/* $debugMsg */ DELETE FROM {$this->tables['execution_tcsteps']} " .
    +                " WHERE execution_id IN (SELECT id FROM {$this->tables['executions']} " .
    +                " WHERE tcversion_id IN ({$tcversion_list}))";
    +
    +            $sql[] = "/* $debugMsg */ DELETE FROM {$this->tables['execution_bugs']} " .
    +                " WHERE execution_id IN (SELECT id FROM {$this->tables['executions']} " .
    +                " WHERE tcversion_id IN ({$tcversion_list}))";
    +
    +            $sql[] = "/* $debugMsg */
                     DELETE FROM {$this->tables['cfield_execution_values']}
    -                WHERE tcversion_id IN ({$tcversion_list}) ";
    -
    -      $sql[]="/* $debugMsg */ DELETE FROM {$this->tables['executions']}  " .
    -             " WHERE tcversion_id IN ({$tcversion_list})";
    -
    -      foreach ($sql as $the_stm) {
    -        $result = $this->db->exec_query($the_stm);
    -      }
    -      
    -    } else {
    -
    -      // Long explanation
    -      // executions table has following fields
    -      // tcversion_id
    -      // tcversion_number
    -      // 
    -      // 1) why?	
    -      // 2) how are used?
    -      //
    -      // Detailed original analisys is not available anymore, but:
    -      // probably the right thing to do is to use here the field
    -      // testplan_tcversions.id, because we can have ONLY ONE tcversion
    -      // linked to a testplan.
    -      // What to do when a new tcversion is created and LINKED to a testplan ?
    -      // How to get information about all executions in every tcversion ?
    -      // 
    -      // The method used is explained with this example:
    -      // 1. create testcase TC1
    -      // 2. tcversion with number 1 will be created (internal ID 77755)
    -      // 3. add to testplan + platform
    -      // 4. execute on build X
    -      // 5. executions table -> exec_id=9543, tcversion_id=77755, tcversion_number=1
    -      // 6. create new version for TC1 -> numer=2 , internal ID 78888
    -      // 7. update link for TC1 version in testplan to version 2
    -      //    this generates this effect in executions table:
    -      //    exec_id=9787, tcversion_id=78888, tcversion_number=1
    -      // 8. execute on build X
    -      // 9. in executions table -> 
    -      //    exec_id=9543, tcversion_id=78888, tcversion_number=1  
    -      //    exec_id=9787, tcversion_id=78888, tcversion_number=2
    -      //  
    -      //  
    -      // Then after user report on forum.testlink.org on 20210810
    -      // this logic need to be changed. 
    -      //
    -      // - get the tcversion_number (VNUM) for the tcversion_id (TARGET_TCVID) 
    -      // - analize  executions table to understand if we have executions   
    -      //   for other versions inspecting the tcversion_number field
    -      //   NO: 
    -      //       no more checks are needed.
    -      //   
    -      //   YES:
    -      //       we need to delete ONLY the records with:
    -      //       tcversion_number = VNUM && tcversion_id = TARGET_TCVID
    -      //
    -      // - get the tcversion_number (VNUM) for the tcversion_id (TARGET_TCVID) 
    -      $myVersionNum = $this->getVersionNumber($version_id);
    -
    -      // --------------------------------------------------------------------------
    -      if( $step_list != '' ) {
    -        
    -        /*
    -        $execTestPLan = " SELECT testplan_id FROM {$this->tables['executions']}
    -                          WHERE tcversion_id = {$version_id}  
    -                          AND tcversion_number = {$myVersionNum} ";
    -        */
    -        $sql[] = "/* $debugMsg */ 
    +                WHERE tcversion_id IN ({$tcversion_list}) ";
    +
    +            $sql[] = "/* $debugMsg */ DELETE FROM {$this->tables['executions']}  " .
    +                " WHERE tcversion_id IN ({$tcversion_list})";
    +
    +            foreach ($sql as $the_stm) {
    +                $this->db->exec_query($the_stm);
    +            }
    +        } else {
    +
    +            // Long explanation
    +            // executions table has following fields
    +            // tcversion_id
    +            // tcversion_number
    +            //
    +            // 1) why?
    +            // 2) how are used?
    +            //
    +            // Detailed original analisys is not available anymore, but:
    +            // probably the right thing to do is to use here the field
    +            // testplan_tcversions.id, because we can have ONLY ONE tcversion
    +            // linked to a testplan.
    +            // What to do when a new tcversion is created and LINKED to a testplan ?
    +            // How to get information about all executions in every tcversion ?
    +            //
    +            // The method used is explained with this example:
    +            // 1. create testcase TC1
    +            // 2. tcversion with number 1 will be created (internal ID 77755)
    +            // 3. add to testplan + platform
    +            // 4. execute on build X
    +            // 5. executions table -> exec_id=9543, tcversion_id=77755, tcversion_number=1
    +            // 6. create new version for TC1 -> numer=2 , internal ID 78888
    +            // 7. update link for TC1 version in testplan to version 2
    +            // this generates this effect in executions table:
    +            // exec_id=9787, tcversion_id=78888, tcversion_number=1
    +            // 8. execute on build X
    +            // 9. in executions table ->
    +            // exec_id=9543, tcversion_id=78888, tcversion_number=1
    +            // exec_id=9787, tcversion_id=78888, tcversion_number=2
    +            //
    +            //
    +            // Then after user report on forum.testlink.org on 20210810
    +            // this logic need to be changed.
    +            //
    +            // - get the tcversion_number (VNUM) for the tcversion_id (TARGET_TCVID)
    +            // - analize executions table to understand if we have executions
    +            // for other versions inspecting the tcversion_number field
    +            // NO:
    +            // no more checks are needed.
    +            //
    +            // YES:
    +            // we need to delete ONLY the records with:
    +            // tcversion_number = VNUM && tcversion_id = TARGET_TCVID
    +            //
    +            // - get the tcversion_number (VNUM) for the tcversion_id (TARGET_TCVID)
    +            $myVersionNum = $this->getVersionNumber($version_id);
    +
    +            if ($step_list != '') {
    +
    +                $sql[] = "/* $debugMsg */
                       DELETE FROM {$this->tables['execution_tcsteps_wip']}
    -                  WHERE tcstep_id IN ({$step_list}) ";
    -      }
    -      // --------------------------------------------------------------------------
    -
    -
    -      // --------------------------------------------------------------------------
    -      $execSQL = " SELECT id FROM {$this->tables['executions']}
    -                   WHERE tcversion_id = {$version_id}  
    -                   AND tcversion_number = {$myVersionNum} ";
    -
    -
    -      $sql[] = "/* $debugMsg */ 
    +                  WHERE tcstep_id IN ({$step_list}) ";
    +            }
    +
    +            $execSQL = " SELECT id FROM {$this->tables['executions']}
    +                   WHERE tcversion_id = {$version_id}
    +                   AND tcversion_number = {$myVersionNum} ";
    +
    +            $sql[] = "/* $debugMsg */
                     DELETE FROM {$this->tables['execution_tcsteps']}
    -                WHERE execution_id IN ($execSQL)";
    -
    -      $sql[] = "/* $debugMsg */  
    -                DELETE FROM {$this->tables['execution_bugs']} 
    -                WHERE execution_id IN ($execSQL)";
    -
    -      $sql[] = "/* $debugMsg */ 
    +                WHERE execution_id IN ($execSQL)";
    +
    +            $sql[] = "/* $debugMsg */
    +                DELETE FROM {$this->tables['execution_bugs']}
    +                WHERE execution_id IN ($execSQL)";
    +
    +            $sql[] = "/* $debugMsg */
                     DELETE FROM {$this->tables['cfield_execution_values']}
    -                WHERE execution_id IN ($execSQL)";
    -
    -      $sql[] = "/* $debugMsg */ 
    -                   DELETE FROM {$this->tables['executions']} 
    +                WHERE execution_id IN ($execSQL)";
    +
    +            $sql[] = "/* $debugMsg */
    +                   DELETE FROM {$this->tables['executions']}
                        WHERE tcversion_id = {$version_id}
    -                   AND tcversion_number = {$myVersionNum} ";
    -
    -
    -      foreach ($sql as $the_stm) {
    -        $result = $this->db->exec_query($the_stm);
    -      }
    -
    -
    -      $sqlCheckExec = "/* $debugMsg */ 
    -                       SELECT tcversion_number, tcversion_id 
    -                       FROM {$this->tables['executions']} 
    -                       WHERE tcversion_id = {$version_id} 
    -                       AND tcversion_number <> {$myVersionNum}";
    -      $rs = (array)$this->db->get_recordset($sqlCheckExec);
    -
    -      if (count($rs) != 0) {
    -        // Get latest execution to get the version number and then tcversion_id 
    -        // to update the testplan_tcversions.
    -        // We need to get version number for EACH TEST PLAN!!
    -
    -        // If platforms exists on testplan, anyway same testcase version 
    -        // MUST BE used in each platform.
    -        $sqlLE = "/* $debugMsg */ 
    +                   AND tcversion_number = {$myVersionNum} ";
    +
    +            foreach ($sql as $the_stm) {
    +                $this->db->exec_query($the_stm);
    +            }
    +
    +            $sqlCheckExec = "/* $debugMsg */
    +                       SELECT tcversion_number, tcversion_id
    +                       FROM {$this->tables['executions']}
    +                       WHERE tcversion_id = {$version_id}
    +                       AND tcversion_number <> {$myVersionNum}";
    +            $rs = (array) $this->db->get_recordset($sqlCheckExec);
    +
    +            if (count($rs) != 0) {
    +                // Get latest execution to get the version number and then tcversion_id
    +                // to update the testplan_tcversions.
    +                // We need to get version number for EACH TEST PLAN!!
    +
    +                // If platforms exists on testplan, anyway same testcase version
    +                // MUST BE used in each platform.
    +                $sqlLE = "/* $debugMsg */
                       SELECT latest_exec FROM (
    -                    SELECT MAX(id) AS latest_exec,testplan_id 
    -                    FROM {$this->tables['executions']} 
    -                    WHERE tcversion_id = {$version_id} 
    +                    SELECT MAX(id) AS latest_exec,testplan_id
    +                    FROM {$this->tables['executions']}
    +                    WHERE tcversion_id = {$version_id}
                         AND tcversion_number <> {$myVersionNum}
    -                    GROUP BY testplan_id 
    -                  ) SQLLE ";
    -
    -        $sqlExecForUpd = "/* $debugMsg */
    +                    GROUP BY testplan_id
    +                  ) SQLLE ";
    +
    +                $sqlExecForUpd = "/* $debugMsg */
                              SELECT id AS execution_id,testplan_id,tcversion_id,tcversion_number
                              FROM {$this->tables['executions']}
    -                         WHERE id IN ($sqlLE) ";   
    -        $rs = (array)$this->db->get_recordset($sqlExecForUpd);
    -
    -        //
    -        $execContext = new stdClass();
    -        $execContext->target = new stdClass();
    -        $execContext->update = new stdClass();
    -        foreach ($rs as $elem) {
    -          // - update executions
    -          $nvrs = $this->get_basic_info($id, array('number' => $elem['tcversion_number']));
    -          $execContext->update->tcversionID = $nvrs[0]['tcversion_id'];
    -          $execContext->target->tcversionID = $elem['tcversion_id'];
    -          $execContext->target->tplanID = $elem['testplan_id'];
    -          $this->updateTPlanLinkTCV($execContext);
    -        }
    -      } 
    -      // -------------------------------------------------------------------------------------
    -    }
    -  }
    -
    -
    -  /*
    -    function: formatTestCaseIdentity
    -
    -    args: id: testcase id
    -          external_id
    -
    -    returns: testproject id
    -
    -  */
    -  function formatTestCaseIdentity($id,$external_id=null)
    -  {
    -    $path2root = $this->tree_manager->get_path($tc_id);
    -    $tproject_id = $path2root[0]['parent_id'];
    -    $tcasePrefix = $this->tproject_mgr->getTestCasePrefix($tproject_id);
    -  }
    -
    -
    -  /*
    -    function: getPrefix
    -
    -    args: id: testcase id
    -          [$tproject_id]
    -
    -    returns: array(prefix,testproject id)
    -
    -  */
    -  function getPrefix($id, $tproject_id=null)
    -  {
    -    $root = $tproject_id;
    -    if( is_null($root) )
    -    {
    -      $path2root=$this->tree_manager->get_path($id);
    -      $root=$path2root[0]['parent_id'];
    -    }
    -    $tcasePrefix = $this->tproject_mgr->getTestCasePrefix($root);
    -    return array($tcasePrefix,$root);
    -  }
    -
    -
    -
    -
    -
    -  /*
    -    @internal revisions
    -  */
    -  function copy_to($id,$parent_id,$user_id,$options=null,$mappings=null) 
    -  {
    -    $newTCObj = array('id' => -1, 'status_ok' => 0, 
    -                      'msg' => 'ok', 'mappings' => null);
    -    $my['options'] = array('check_duplicate_name' => 
    -                             self::DONT_CHECK_DUPLICATE_NAME,
    -                           'action_on_duplicate_name' => 'generate_new',
    -                           'use_this_name' => null,
    -                           'copy_also' => null, 
    -                           'preserve_external_id' => false,
    -                           'renderGhostSteps' => false, 
    -                           'stepAsGhost' => false,
    -                           'copyOnlyLatest' => false);
    -
    -    // needed when Test Case is copied to a DIFFERENT Test Project,
    -    // added during Test Project COPY Feature implementation
    -    $my['mappings']['keywords'] = null;
    -    $my['mappings']['requirements'] = null;
    -
    -    $my['mappings'] = array_merge($my['mappings'], (array)$mappings);
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -
    -    if( is_null($my['options']['copy_also']) ) {
    -      $my['options']['copy_also'] = array('keyword_assignments' => true,'requirement_assignments' => true);
    -    }
    -
    -    $copyKW = ( isset($my['options']['copy_also']['keyword_assignments']) &&
    -                $my['options']['copy_also']['keyword_assignments'] );
    -
    -    $copyPL = ( isset($my['options']['copy_also']['platform_assignments']) &&
    -                $my['options']['copy_also']['platform_assignments'] );
    -
    -    $uglyKey = 'requirement_assignments';
    -    $copyReqLinks = ( isset($my['options']['copy_also'][$uglyKey]) &&
    -                      $my['options']['copy_also'][$uglyKey]);
    -    // ==================================================================
    -
    -    $useLatest = $my['options']['stepAsGhost'] 
    -                 || $my['options']['copyOnlyLatest'];
    -
    -    $tcVersionID = $useLatest ? self::LATEST_VERSION : self::ALL_VERSIONS;
    -    $tcase_info = $this->get_by_id($id,$tcVersionID);
    -    if ($tcase_info) {
    -      $callme = !is_null($my['options']['use_this_name']) ? 
    -                $my['options']['use_this_name'] : $tcase_info[0]['name'];
    -      $callme = $this->trim_and_limit($callme);
    -
    -      $newTCObj = $this->create_tcase_only($parent_id,
    -                    $callme,$tcase_info[0]['node_order'],
    -                    self::AUTOMATIC_ID,$my['options']);
    -
    -      $ix = new stdClass();
    -      $ix->authorID = $user_id;
    -      $ix->status = null;
    -      $ix->steps = null;
    -
    -      if($newTCObj['status_ok']) {
    -
    -        $ret['status_ok']=1;
    -        $newTCObj['mappings'][$id] = $newTCObj['id'];
    -
    -        $ix->id = $newTCObj['id'];
    -        $ix->externalID = $newTCObj['external_id'];
    -        if( $my['options']['preserve_external_id'] ) {
    -          $ix->externalID = $tcase_info[0]['tc_external_id'];
    -        }
    -
    -        foreach($tcase_info as $tcversion) {
    -
    -          // IMPORTANT NOTICE:
    -          // In order to implement COPY to another test project, WE CAN NOT ASK
    -          // to method create_tcversion() to create inside itself THE STEPS.
    -          // Passing NULL as steps we instruct create_tcversion() TO DO NOT CREATE STEPS
    -
    -          $ix->executionType = $tcversion['execution_type'];
    -          $ix->importance = $tcversion['importance'];
    -          
    -          $ix->version = $tcversion['version'];
    -          if ($my['options']['copyOnlyLatest']) {
    -            $ix->version = 1;
    -          }
    -
    -          $ix->status = $tcversion['status'];
    -          $ix->estimatedExecDuration = $tcversion['estimated_exec_duration'];
    -          $ix->is_open = $tcversion['is_open'];
    -
    -          // Further processing will be needed to manage inline 
    -          // image attachments
    -          // updateSimpleFields() will be used.
    -          $ix->summary = $tcversion['summary'];
    -          $ix->preconditions = $tcversion['preconditions'];
    -
    -          $opCV = $this->createVersion($ix);
    -          if( $opCV['status_ok'] ) {
    -              $alienTCV = $newTCObj['mappings'][$tcversion['id']] = $opCV['id'];
    -
    -              $inlineImg = null;
    -              $attNewRef = $this->copy_attachments($tcversion['id'],$alienTCV);      
    -              if(!is_null($attNewRef)) {
    -                // get all attachments, then check is there are images
    -                $att = $this->attachmentRepository->getAttachmentInfosFor(
    -                         $alienTCV,$this->attachmentTableName,'id');
    -                foreach($attNewRef as $oid => $nid) {
    -                  if($att[$nid]['is_image']) {
    -                    $needle = str_replace($nid,$oid,$att[$nid]['inlineString']);
    -                    $inlineImg[] = 
    -                      array('needle' => $needle, 'rep' => $att[$nid]['inlineString']);
    -                  }
    -                }
    -              }
    -
    -              $doInline = !is_null($inlineImg);
    -              if($doInline) {
    -                foreach($inlineImg as $elem) {
    -                  $ix->summary = str_replace($elem['needle'],$elem['rep'],
    -                                             $ix->summary);
    -                  $ix->preconditions = str_replace($elem['needle'],$elem['rep'],
    -                                                   $ix->preconditions);
    -                }
    -                // updateSimpleFields() will be used.
    -                $usf = array('summary' => $ix->summary,
    -                             'preconditions' => $ix->preconditions);
    -
    -                $this->updateSimpleFields($alienTCV,$usf);
    -              }        
    -
    -              // ATTENTION:  NEED TO UNDERSTAND HOW TO MANAGE COPY TO OTHER TEST PROJECTS
    -              $this->copy_cfields_design_values(
    -                array('id' => $id, 'tcversion_id' => $tcversion['id']),
    -                array('id' => $newTCObj['id'], 'tcversion_id' => $opCV['id']));
    -
    -              // Need to get all steps
    -              $steps_options = $my['options'];
    -              // Add the option renderImageInline to keep Inline Images
    -              $steps_options['renderImageInline'] = false;
    -              $stepsSet = $this->get_steps($tcversion['id'],0,$steps_options);
    -
    -              $to_tcversion_id = $opCV['id'];
    -              if( !is_null($stepsSet) ) {
    -
    -                // not elegant but ...
    -                if($my['options']['stepAsGhost']) {
    -                  $pfx = $this->getPrefix($id);
    -                  $pfx = $pfx[0] . $this->cfg->testcase->glue_character . $tcversion['tc_external_id'];
    -
    -                  foreach($stepsSet as $key => $step) {
    -                    $act = sprintf(self::GHOSTSTEPMASK,$step['step_number'],
    -                                   $pfx,$tcversion['version']); 
    -
    -                    $this->create_step($to_tcversion_id,
    -                                       $step['step_number'],$act,$act,
    -                                       $step['execution_type']);
    -                  }
    -                } else {
    -                  foreach($stepsSet as $key => $step) {
    -                    // update inline references
    -                    if($doInline) {
    -                      foreach($inlineImg as $elem) {
    -                        $step['actions'] = str_replace($elem['needle'],$elem['rep'],
    -                                                       $step['actions']);
    -                        $step['expected_results'] = str_replace($elem['needle'],$elem['rep'],
    -                                                                $step['expected_results']);
    -                      }
    -                    }
    -
    -                    $this->create_step($to_tcversion_id,
    -                                       $step['step_number'],
    -                                       $step['actions'],
    -                                       $step['expected_results'],
    -                                       $step['execution_type']);
    -                  }
    -                }
    -              }
    -          }
    -
    -          // Conditional copies
    -          if( $opCV['status_ok'] ) {
    -            $source = array('id' => $id, 'version_id' => $tcversion['id']);
    -            $dest = array('id' => $newTCObj['id'], 'version_id' => $opCV['id'] ,
    -                          'version' => $tcversion['version']);
    -          }
    -
    -          if( $opCV['status_ok'] && $copyKW ) {
    -            $this->copyKeywordsTo($source,$dest,$my['mappings']['keywords']);
    -          }
    -
    -          if( $opCV['status_ok'] && $copyPL ) {
    -            $this->copyPlatformsTo($source,$dest,$my['mappings']['platforms']);
    -          }
    -
    -          if( $opCV['status_ok'] && $copyReqLinks ) {
    -            $this->copyReqVersionLinksTo($source,$dest,
    -              $my['mappings']['requirements'],$ix->authorID);
    -          }
    -        }  // foreach($tcase_info ...
    -      } // $newTCObj['status_ok']
    -    }
    -
    -    return $newTCObj ;
    -  }
    -
    -
    -  /*
    -    function: create_new_version()
    -              create a new test case version,
    -              doing a copy of source test case version
    -
    -
    -    args : $id: testcase id
    -           $user_id: who is doing this operation.
    -           [$source_version_id]: default null -> source is LATEST TCVERSION
    -
    -    returns:
    -            map:  id: node id of created tcversion
    -                  version: version number (i.e. 5)
    -                  msg
    -
    -  */
    -  function create_new_version($id,$user_id,$source_version_id=null, $options=null) {
    -
    -    // Before working on requirements it will be useful
    -    // to understand if req management is enabled
    -    // for the Test Project
    -    //
    -    $freezeLinkOnNewTCVersion = false;
    -    $freezeLinkedRequirements = false;
    -    $freezeTCVRelationsOnNewTCVersion =false;
    -    $reqTCLinksCfg = config_get('reqTCLinks'); 
    -
    -    if( $this->tproject_id > 0 ) {
    -
    -      $po = $this->tproject_mgr->getOptions($this->tproject_id);
    -      if($po->requirementsEnabled) {
    -        $freezeLinkOnNewTCVersion = $reqTCLinksCfg->freezeLinkOnNewTCVersion;
    -        $freezeLinkedRequirements = $freezeLinkOnNewTCVersion && 
    -          $reqTCLinksCfg->freezeBothEndsOnNewTCVersion;
    -
    -        $freezeTCVRelationsOnNewTCVersion = 
    -          $this->cfg->testcase->freezeTCVRelationsOnNewTCVersion;
    -      }
    -    }
    -    
    -    $now = $this->db->db_now();
    -    $opt = array('is_open' => 1, 
    -                 'freezeLinkedRequirements' => $freezeLinkedRequirements,
    -                 'freezeLinkOnNewTCVersion' => $freezeLinkOnNewTCVersion,
    -                 'freezeTCVRelationsOnNewTCVersion' =>
    -                   $freezeTCVRelationsOnNewTCVersion);
    -
    -    $opt = array_merge($opt,(array)$options);
    -
    -    $tcversion_id = $this->tree_manager->new_node($id,$this->node_types_descr_id['testcase_version']);
    -
    -    // get last version for this test case (need to get new version number)
    -    $last_version_info =  $this->get_last_version_info($id, array('output' => 'minimun'));
    -
    -    $from = $source_version_id;
    -    if( is_null($source_version_id) || $source_version_id <= 0) {
    -      $from = $last_version_info['id'];
    -    }
    -    $this->copy_tcversion($id,$from,$tcversion_id,$last_version_info['version']+1,$user_id);
    -
    -    $ret['id'] = $tcversion_id;
    -    $ret['version'] = $last_version_info['version']+1;
    -    $ret['msg'] = 'ok';
    -
    -    $this->setIsOpen(null,$tcversion_id,$opt['is_open']);
    -
    -    // Keywords managed @version level.
    -    $source = array('id' => $id, 'version_id' => $from);
    -    $dest = array('id' => $id, 'version_id' => $tcversion_id);
    -    $auditContext = array('on' => self::AUDIT_OFF);
    -    
    -    $this->copyKeywordsTo($source,$dest,null,$auditContext,array('delete' => false));
    -    $this->copy_attachments($source['version_id'],$dest['version_id']);
    -    $this->copyTCVRelations($source['version_id'],$dest['version_id']);
    -
    -    $this->copyPlatformsTo($source,$dest,null,$auditContext,array('delete' => false));
    -
    -
    -    if( $this->cfg->testcase->relations->enable && 
    -        $freezeTCVRelationsOnNewTCVersion ) {
    -      $oldVerRel = $this->getTCVRelationsRaw($source['version_id']);
    -      if( null != $oldVerRel && count($oldVerRel) > 0 ) {
    -        $i2c = array_keys($oldVerRel);
    -        $this->closeOpenTCVRelation($i2c,LINK_TC_RELATION_CLOSED_BY_NEW_TCVERSION);
    -      }
    -    }
    -
    -
    -    if( $opt['freezeLinkedRequirements'] ) {
    -       $this->closeOpenReqVersionOnOpenLinks($source['version_id']);
    -    }
    -
    -    $signature = array('user_id' => $user_id, 'when' => $now);
    -    $link = array('source' => $source['version_id'],
    -                  'dest' => $dest['version_id']);
    -    $optUC = array('freezePrevious' => $opt['freezeLinkOnNewTCVersion']);
    -    $this->updateCoverage($link,$signature,$optUC);
    -
    -
    -    $ret['id'] = $tcversion_id;
    -    $ret['version'] = $last_version_info['version']+1;
    -    $ret['msg'] = 'ok';
    -    
    -    return $ret;
    -  }
    -
    -
    -
    -  /*
    -    function: get_last_version_info
    -              Get information about last version (greater number) of a testcase.
    -
    -    args : id: testcase id
    -           [options]
    -
    -    returns: map with keys  that depends of options['output']:
    -
    -             id -> tcversion_id
    -             version
    -             summary
    -             importance
    -             author_id
    -             creation_ts
    -             updater_id
    -             modification_ts
    -             active
    -             is_open
    -    @internal revisions
    -    @since 1.9.9
    -    'active' => values 1,0, null => do not apply filter
    -  */
    -  function get_last_version_info($id,$options=null) {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $my['options'] = array( 'get_steps' => false, 'output' => 'full','active' => null);
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -
    -    $tcInfo = null;
    -    switch($my['options']['output']) {
    -
    -      case 'thin':
    -        $fields2get = " TCV.id AS tcversion_id";
    -      break;
    -
    -      case 'minimun':
    -        $fields2get = " TCV.id, TCV.id AS tcversion_id, TCV.version, TCV.tc_external_id,NH_TC.name ";
    -      break;
    -
    -      case 'full':
    -      default:
    -        $fields2get = " TCV.*,TCV.id AS tcversion_id, NH_TC.name ";
    -      break;
    -    }
    -
    -
    -    $sql = "/* $debugMsg */ SELECT MAX(version) AS version " .
    -           " FROM {$this->tables['tcversions']} TCV " .
    -           " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TCV.id ".
    -           " WHERE NH_TCV.parent_id = {$id} ";
    -
    -    if( !is_null($my['options']['active']) ) {
    -      $sql .= " AND TCV.active=" . (intval($my['options']['active']) > 0 ? 1 : 0);
    -    }
    -
    -    $max_version = $this->db->fetchFirstRowSingleColumn($sql,'version');
    -
    -    $tcInfo = null;
    -    if ($max_version) {
    -      $sql = " SELECT {$fields2get} FROM {$this->tables['tcversions']} TCV " .
    -             " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TCV.id ".
    -             " JOIN {$this->tables['nodes_hierarchy']} NH_TC ON NH_TC.id = NH_TCV.parent_id ".
    -             " WHERE TCV.version = {$max_version} ".
    -             " AND NH_TCV.parent_id = {$id}";
    -
    -      $tcInfo = $this->db->fetchFirstRow($sql);
    -    }
    -
    -    // Multiple Test Case Steps Feature
    -    if( !is_null($tcInfo) && $my['options']['get_steps'] ) {
    -      $step_set = $this->get_steps($tcInfo['id']);
    -      $tcInfo['steps'] = $step_set;
    -    }
    -
    -    return $tcInfo;
    -  }
    -
    -
    -  /*
    -    function: copy_tcversion
    -
    -    args:
    -
    -    returns:
    -
    -    rev:
    -
    -  */
    -  function copy_tcversion($id,$from_tcversion_id,$to_tcversion_id,$as_version_number,$user_id)
    -  {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $now = $this->db->db_now();
    -    $sql = "/* $debugMsg */ " .
    -           " INSERT INTO {$this->tables['tcversions']} " .
    -           " (id,version,tc_external_id,author_id,creation_ts,summary, " .
    -           "  importance,execution_type,preconditions,estimated_exec_duration) " .
    -           " SELECT {$to_tcversion_id} AS id, {$as_version_number} AS version, " .
    -           "        tc_external_id, " .
    -           "        {$user_id} AS author_id, {$now} AS creation_ts," .
    -           "        summary,importance,execution_type, preconditions,estimated_exec_duration " .
    -           " FROM {$this->tables['tcversions']} " .
    -           " WHERE id={$from_tcversion_id} ";
    -    $result = $this->db->exec_query($sql);
    -
    -    // copy custom fields values JUST DESIGN AREA
    -    $this->copy_cfields_design_values(array('id' => $id, 'tcversion_id' => $from_tcversion_id),
    -                                      array('id' => $id, 'tcversion_id' => $to_tcversion_id));
    -
    -
    -    // Need to get all steps
    -    $gso = array('renderGhostSteps' => false, 'renderImageInline' => false);
    -    $stepsSet = $this->get_steps($from_tcversion_id,0,$gso);
    -    if( !is_null($stepsSet) && count($stepsSet) > 0) {
    -      foreach($stepsSet as $key => $step) {
    -        $op = $this->create_step($to_tcversion_id,$step['step_number'],
    -                                 $step['actions'],$step['expected_results'],
    -                                 $step['execution_type']);
    -      }
    -    }
    -  }
    -
    -
    -  /*
    -    function: get_by_id_bulk
    -
    -              IMPORTANT CONSIDERATION:
    -              how may elements can be used in an SQL IN CLAUSE?
    -              Think there is a limit ( on MSSQL 1000 ?)
    -
    -    args :
    -
    -    returns:
    -
    -  */
    -  function get_by_id_bulk($id,$version_id=self::ALL_VERSIONS, $get_active=0, $get_open=0)
    -  {
    -    $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__;
    -    $where_clause="";
    -    $where_clause_names="";
    -    $tcid_list ="";
    -    $tcversion_id_filter="";
    -    $sql = "";
    -    $the_names = null;
    -    if( is_array($id) ) {
    -      $tcid_list = implode(",",$id);
    -      $where_clause = " WHERE nodes_hierarchy.parent_id IN ($tcid_list) ";
    -      $where_clause_names = " WHERE nodes_hierarchy.id IN ($tcid_list) ";
    -    }
    -    else
    -    {
    -      $where_clause = " WHERE nodes_hierarchy.parent_id = {$id} ";
    -      $where_clause_names = " WHERE nodes_hierarchy.id = {$id} ";
    -    }
    -      if( $version_id != self::ALL_VERSIONS )
    -      {
    -          $tcversion_id_filter=" AND tcversions.id IN (" . implode(",",(array)$version_id) . ") ";
    -      }
    -
    -    $sql = " /* $debugMsg */ SELECT nodes_hierarchy.parent_id AS testcase_id, ".
    -           " tcversions.*, users.first AS author_first_name, users.last AS author_last_name, " .
    -           " '' AS updater_first_name, '' AS updater_last_name " .
    -           " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy " .
    -           " JOIN {$this->tables['tcversions']} tcversions ON nodes_hierarchy.id = tcversions.id " .
    -             " LEFT OUTER JOIN {$this->tables['users']} users ON tcversions.author_id = users.id " .
    -             " {$where_clause} {$tcversion_id_filter} ORDER BY tcversions.version DESC";
    -    $recordset = $this->db->get_recordset($sql);
    -
    -    if($recordset)
    -    {
    -       // get the names
    -     $sql = " /* $debugMsg */ " .
    -            " SELECT nodes_hierarchy.id AS testcase_id, nodes_hierarchy.name " .
    -            " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy {$where_clause_names} ";
    -
    -     $the_names = $this->db->get_recordset($sql);
    -       if($the_names)
    -       {
    -          foreach ($recordset as  $the_key => $row )
    -          {
    -              reset($the_names);
    -              foreach($the_names as $row_n)
    -              {
    -                  if( $row['testcase_id'] == $row_n['testcase_id'])
    -                  {
    -                    $recordset[$the_key]['name']= $row_n['name'];
    -                    break;
    -                  }
    -              }
    -          }
    -       }
    -
    -
    -     $sql = " /* $debugMsg */ " .
    -            " SELECT updater_id, users.first AS updater_first_name, users.last  AS updater_last_name " .
    -            " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy " .
    -            " JOIN {$this->tables['tcversions']} tcversions ON nodes_hierarchy.id = tcversions.id " .
    -              " LEFT OUTER JOIN {$this->tables['users']} users ON tcversions.updater_id = users.id " .
    -              " {$where_clause} and tcversions.updater_id IS NOT NULL ";
    -
    -      $updaters = $this->db->get_recordset($sql);
    -
    -      if($updaters)
    -      {
    -        reset($recordset);
    -        foreach ($recordset as  $the_key => $row )
    -        {
    -          if ( !is_null($row['updater_id']) )
    -          {
    -            foreach ($updaters as $row_upd)
    -            {
    -              if ( $row['updater_id'] == $row_upd['updater_id'] )
    -              {
    -                $recordset[$the_key]['updater_last_name'] = $row_upd['updater_last_name'];
    -                $recordset[$the_key]['updater_first_name'] = $row_upd['updater_first_name'];
    -                break;
    -              }
    -            }
    -          }
    -        }
    -      }
    -
    -    }
    -
    -
    -    return($recordset ? $recordset : null);
    -  }
    -
    -
    -
    -
    -  /*
    -    function: get_by_id
    -
    -    args : id: can be a single testcase id or an array od testcase id.
    -
    -           [version_id]: default self::ALL_VERSIONS => all versions
    -                         can be an array.
    -                         Useful to retrieve only a subset of versions.
    -                         null => means use version_number argument
    -
    -       [filters]:
    -                [active_status]: default 'ALL', range: 'ALL','ACTIVE','INACTIVE'
    -                                 has effect for the following version_id values:
    -                                 self::ALL_VERSIONS,TC_LAST_VERSION, version_id is NOT an array
    -
    -                [open_status]: default 'ALL'
    -                               currently not used.
    -
    -                [version_number]: default 1, version number displayed at User Interface
    -
    -       [options]:
    -                [output]: default 'full'
    -          domain 'full','essential','full_without_steps','full_without_users'
    -
    -    returns: array
    -
    -  */
    -  function get_by_id($id,$version_id = self::ALL_VERSIONS, $filters = null, $options=null) {
    -    $my['filters'] = array('active_status' => 'ALL', 'open_status' => 'ALL', 'version_number' => 1);
    -    $my['filters'] = array_merge($my['filters'], (array)$filters);
    -
    -    $my['options'] = [
    -      'output' => 'full', 
    -      'access_key' => 'tcversion_id', 
    -      'getPrefix' => false,
    -      'order_by' => null, 
    -      'withGhostString' => false,
    -      'renderGhost' => false, 
    -      'renderImageInline' => false, 
    -      'renderVariables' => false,
    -      'renderSpecialKW' => false
    -    ];
    -                      
    -
    -    $my['options'] = array_merge($my['options'], (array)$options);
    -
    -    $tcid_list = null;
    -    $where_clause = '';
    -    $active_filter = '';
    -    $versionSQLOp = ' AND ';
    -
    -    if( ($accessByVersionID = is_null($id) && !is_null($version_id)) ) {
    -      $versionSQLOp = ' WHERE ';
    -    }
    -    else if(is_array($id)) {
    -      $tcid_list = implode(",",$id);
    -      $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) ";
    -    }
    -    else {
    -      $where_clause = " WHERE NHTCV.parent_id = {$id} ";
    -    }
    -
    -    if( ($version_id_is_array=is_array($version_id)) ) {
    -        $versionid_list = implode(",",$version_id);
    -        $where_clause .= $versionSQLOp . " TCV.id IN ({$versionid_list}) ";
    -    }
    -    else {
    -      if( is_null($version_id) ) {
    -          // when tcase ID has not been provided this can not be used
    -          // will not do any check => leave it CRASH
    -            $where_clause .= " AND TCV.version = {$my['filters']['version_number']} ";
    -      }
    -      else {
    -        if($version_id != self::ALL_VERSIONS && $version_id != self::LATEST_VERSION) {
    -          $where_clause .= $versionSQLOp .  " TCV.id = {$version_id} ";
    -        }
    -      }
    -
    -      $active_status = strtoupper($my['filters']['active_status']);
    -      if($active_status != 'ALL') {
    -        $active_filter =' AND TCV.active=' . ($active_status=='ACTIVE' ? 1 : 0) . ' ';
    -      }
    -    }
    -
    -    switch($my['options']['output']) {
    -      case 'full':
    -      case 'full_without_steps':
    -        $sql = "SELECT UA.login AS updater_login,UB.login AS author_login,
    +                         WHERE id IN ($sqlLE) ";
    +                $rs = (array) $this->db->get_recordset($sqlExecForUpd);
    +
    +                //
    +                $execContext = new stdClass();
    +                $execContext->target = new stdClass();
    +                $execContext->update = new stdClass();
    +                foreach ($rs as $elem) {
    +                    // - update executions
    +                    $nvrs = $this->get_basic_info($id,
    +                        array(
    +                            'number' => $elem['tcversion_number']
    +                        ));
    +                    $execContext->update->tcversionID = $nvrs[0]['tcversion_id'];
    +                    $execContext->target->tcversionID = $elem['tcversion_id'];
    +                    $execContext->target->tplanID = $elem['testplan_id'];
    +                    $this->updateTPlanLinkTCV($execContext);
    +                }
    +            }
    +        }
    +    }
    +
    +    /*
    +     * function: formatTestCaseIdentity
    +     *
    +     * args: id: testcase id
    +     * external_id
    +     *
    +     * returns: testproject id
    +     *
    +     */
    +    private function formatTestCaseIdentity($tc_id)
    +    {
    +        $path2root = $this->tree_manager->get_path($tc_id);
    +        $tproject_id = $path2root[0]['parent_id'];
    +        $this->tproject_mgr->getTestCasePrefix($tproject_id);
    +    }
    +
    +    /*
    +     * function: getPrefix
    +     *
    +     * args: id: testcase id
    +     * [$tproject_id]
    +     *
    +     * returns: array(prefix,testproject id)
    +     *
    +     */
    +    public function getPrefix($id, $tproject_id = null)
    +    {
    +        $root = $tproject_id;
    +        if (is_null($root)) {
    +            $path2root = $this->tree_manager->get_path($id);
    +            $root = $path2root[0]['parent_id'];
    +        }
    +        $tcasePrefix = $this->tproject_mgr->getTestCasePrefix($root);
    +        return array(
    +            $tcasePrefix,
    +            $root
    +        );
    +    }
    +
    +    /*
    +     * @internal revisions
    +     */
    +    public function copy_to($id, $parent_id, $user_id, $options = null,
    +        $mappings = null)
    +    {
    +        $newTCObj = array(
    +            'id' => - 1,
    +            'status_ok' => 0,
    +            'msg' => 'ok',
    +            'mappings' => null
    +        );
    +        $my['options'] = array(
    +            'check_duplicate_name' => self::DONT_CHECK_DUPLICATE_NAME,
    +            'action_on_duplicate_name' => 'generate_new',
    +            'use_this_name' => null,
    +            'copy_also' => null,
    +            'preserve_external_id' => false,
    +            'renderGhostSteps' => false,
    +            'stepAsGhost' => false,
    +            'copyOnlyLatest' => false
    +        );
    +
    +        // needed when Test Case is copied to a DIFFERENT Test Project,
    +        // added during Test Project COPY Feature implementation
    +        $my['mappings']['keywords'] = null;
    +        $my['mappings']['requirements'] = null;
    +
    +        $my['mappings'] = array_merge($my['mappings'], (array) $mappings);
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        if (is_null($my['options']['copy_also'])) {
    +            $my['options']['copy_also'] = array(
    +                'keyword_assignments' => true,
    +                'requirement_assignments' => true
    +            );
    +        }
    +
    +        $copyKW = (isset($my['options']['copy_also']['keyword_assignments']) &&
    +            $my['options']['copy_also']['keyword_assignments']);
    +
    +        $copyPL = (isset($my['options']['copy_also']['platform_assignments']) &&
    +            $my['options']['copy_also']['platform_assignments']);
    +
    +        $uglyKey = 'requirement_assignments';
    +        $copyReqLinks = (isset($my['options']['copy_also'][$uglyKey]) &&
    +            $my['options']['copy_also'][$uglyKey]);
    +
    +        $useLatest = $my['options']['stepAsGhost'] ||
    +            $my['options']['copyOnlyLatest'];
    +
    +        $tcVersionID = $useLatest ? self::LATEST_VERSION : self::ALL_VERSIONS;
    +        $tcase_info = $this->get_by_id($id, $tcVersionID);
    +        if ($tcase_info) {
    +            $callme = ! is_null($my['options']['use_this_name']) ? $my['options']['use_this_name'] : $tcase_info[0]['name'];
    +            $callme = $this->trimAndLimit($callme);
    +
    +            $newTCObj = $this->create_tcase_only($parent_id, $callme,
    +                $tcase_info[0]['node_order'], self::AUTOMATIC_ID, $my['options']);
    +
    +            $ix = new stdClass();
    +            $ix->authorID = $user_id;
    +            $ix->status = null;
    +            $ix->steps = null;
    +
    +            if ($newTCObj['status_ok']) {
    +
    +                $ret['status_ok'] = 1;
    +                $newTCObj['mappings'][$id] = $newTCObj['id'];
    +
    +                $ix->id = $newTCObj['id'];
    +                $ix->externalID = $newTCObj['external_id'];
    +                if ($my['options']['preserve_external_id']) {
    +                    $ix->externalID = $tcase_info[0]['tc_external_id'];
    +                }
    +
    +                foreach ($tcase_info as $tcversion) {
    +
    +                    // IMPORTANT NOTICE:
    +                    // In order to implement COPY to another test project, WE CAN NOT ASK
    +                    // to method create_tcversion() to create inside itself THE STEPS.
    +                    // Passing NULL as steps we instruct create_tcversion() TO DO NOT CREATE STEPS
    +
    +                    $ix->executionType = $tcversion['execution_type'];
    +                    $ix->importance = $tcversion['importance'];
    +
    +                    $ix->version = $tcversion['version'];
    +                    if ($my['options']['copyOnlyLatest']) {
    +                        $ix->version = 1;
    +                    }
    +
    +                    $ix->status = $tcversion['status'];
    +                    $ix->estimatedExecDuration = $tcversion['estimated_exec_duration'];
    +                    $ix->is_open = $tcversion['is_open'];
    +
    +                    // Further processing will be needed to manage inline
    +                    // image attachments
    +                    // updateSimpleFields() will be used.
    +                    $ix->summary = $tcversion['summary'];
    +                    $ix->preconditions = $tcversion['preconditions'];
    +
    +                    $opCV = $this->createVersion($ix);
    +                    if ($opCV['status_ok']) {
    +                        $alienTCV = $newTCObj['mappings'][$tcversion['id']] = $opCV['id'];
    +
    +                        $inlineImg = null;
    +                        $attNewRef = $this->copyAttachments($tcversion['id'],
    +                            $alienTCV);
    +                        if (! is_null($attNewRef)) {
    +                            // get all attachments, then check is there are images
    +                            $att = $this->attachmentRepository->getAttachmentInfosFor(
    +                                $alienTCV, $this->attachmentTableName, 'id');
    +                            foreach ($attNewRef as $oid => $nid) {
    +                                if ($att[$nid]['is_image']) {
    +                                    $needle = str_replace($nid, $oid,
    +                                        $att[$nid]['inlineString']);
    +                                    $inlineImg[] = array(
    +                                        'needle' => $needle,
    +                                        'rep' => $att[$nid]['inlineString']
    +                                    );
    +                                }
    +                            }
    +                        }
    +
    +                        $doInline = ! is_null($inlineImg);
    +                        if ($doInline) {
    +                            foreach ($inlineImg as $elem) {
    +                                $ix->summary = str_replace($elem['needle'],
    +                                    $elem['rep'], $ix->summary);
    +                                $ix->preconditions = str_replace(
    +                                    $elem['needle'], $elem['rep'],
    +                                    $ix->preconditions);
    +                            }
    +                            // updateSimpleFields() will be used.
    +                            $usf = array(
    +                                'summary' => $ix->summary,
    +                                'preconditions' => $ix->preconditions
    +                            );
    +
    +                            $this->updateSimpleFields($alienTCV, $usf);
    +                        }
    +
    +                        // ATTENTION: NEED TO UNDERSTAND HOW TO MANAGE COPY TO OTHER TEST PROJECTS
    +                        $this->copyCfieldsDesignValues(
    +                            array(
    +                                'id' => $id,
    +                                'tcversion_id' => $tcversion['id']
    +                            ),
    +                            array(
    +                                'id' => $newTCObj['id'],
    +                                'tcversion_id' => $opCV['id']
    +                            ));
    +
    +                        // Need to get all steps
    +                        $steps_options = $my['options'];
    +                        // Add the option renderImageInline to keep Inline Images
    +                        $steps_options['renderImageInline'] = false;
    +                        $stepsSet = $this->get_steps($tcversion['id'], 0,
    +                            $steps_options);
    +
    +                        $to_tcversion_id = $opCV['id'];
    +                        if (! is_null($stepsSet)) {
    +
    +                            // not elegant but ...
    +                            if ($my['options']['stepAsGhost']) {
    +                                $pfx = $this->getPrefix($id);
    +                                $pfx = $pfx[0] .
    +                                    $this->cfg->testcase->glue_character .
    +                                    $tcversion['tc_external_id'];
    +
    +                                foreach ($stepsSet as $step) {
    +                                    $act = sprintf(self::GHOSTSTEPMASK,
    +                                        $step['step_number'], $pfx,
    +                                        $tcversion['version']);
    +
    +                                    $this->create_step($to_tcversion_id,
    +                                        $step['step_number'], $act, $act,
    +                                        $step['execution_type']);
    +                                }
    +                            } else {
    +                                foreach ($stepsSet as $step) {
    +                                    // update inline references
    +                                    if ($doInline) {
    +                                        foreach ($inlineImg as $elem) {
    +                                            $step['actions'] = str_replace(
    +                                                $elem['needle'], $elem['rep'],
    +                                                $step['actions']);
    +                                            $step['expected_results'] = str_replace(
    +                                                $elem['needle'], $elem['rep'],
    +                                                $step['expected_results']);
    +                                        }
    +                                    }
    +
    +                                    $this->create_step($to_tcversion_id,
    +                                        $step['step_number'], $step['actions'],
    +                                        $step['expected_results'],
    +                                        $step['execution_type']);
    +                                }
    +                            }
    +                        }
    +                    }
    +
    +                    // Conditional copies
    +                    if ($opCV['status_ok']) {
    +                        $source = array(
    +                            'id' => $id,
    +                            'version_id' => $tcversion['id']
    +                        );
    +                        $dest = array(
    +                            'id' => $newTCObj['id'],
    +                            'version_id' => $opCV['id'],
    +                            'version' => $tcversion['version']
    +                        );
    +                    }
    +
    +                    if ($opCV['status_ok'] && $copyKW) {
    +                        $this->copyKeywordsTo($source, $dest,
    +                            $my['mappings']['keywords']);
    +                    }
    +
    +                    if ($opCV['status_ok'] && $copyPL) {
    +                        $this->copyPlatformsTo($source, $dest,
    +                            $my['mappings']['platforms']);
    +                    }
    +
    +                    if ($opCV['status_ok'] && $copyReqLinks) {
    +                        $this->copyReqVersionLinksTo($source, $dest,
    +                            $my['mappings']['requirements'], $ix->authorID);
    +                    }
    +                } // foreach($tcase_info ...
    +            } // $newTCObj['status_ok']
    +        }
    +
    +        return $newTCObj;
    +    }
    +
    +    /*
    +     * function: create_new_version()
    +     * create a new test case version,
    +     * doing a copy of source test case version
    +     *
    +     *
    +     * args : $id: testcase id
    +     * $user_id: who is doing this operation.
    +     * [$source_version_id]: default null -> source is LATEST TCVERSION
    +     *
    +     * returns:
    +     * map: id: node id of created tcversion
    +     * version: version number (i.e. 5)
    +     * msg
    +     *
    +     */
    +    public function create_new_version($id, $user_id, $source_version_id = null,
    +        $options = null)
    +    {
    +
    +        // Before working on requirements it will be useful
    +        // to understand if req management is enabled
    +        // for the Test Project
    +        //
    +        $freezeLinkOnNewTCVersion = false;
    +        $freezeLinkedRequirements = false;
    +        $freezeTCVRelationsOnNewTCVersion = false;
    +        $reqTCLinksCfg = config_get('reqTCLinks');
    +
    +        if ($this->tproject_id > 0) {
    +
    +            $po = $this->tproject_mgr->getOptions($this->tproject_id);
    +            if ($po->requirementsEnabled) {
    +                $freezeLinkOnNewTCVersion = $reqTCLinksCfg->freezeLinkOnNewTCVersion;
    +                $freezeLinkedRequirements = $freezeLinkOnNewTCVersion &&
    +                    $reqTCLinksCfg->freezeBothEndsOnNewTCVersion;
    +
    +                $freezeTCVRelationsOnNewTCVersion = $this->cfg->testcase->freezeTCVRelationsOnNewTCVersion;
    +            }
    +        }
    +
    +        $now = $this->db->db_now();
    +        $opt = array(
    +            'is_open' => 1,
    +            'freezeLinkedRequirements' => $freezeLinkedRequirements,
    +            'freezeLinkOnNewTCVersion' => $freezeLinkOnNewTCVersion,
    +            'freezeTCVRelationsOnNewTCVersion' => $freezeTCVRelationsOnNewTCVersion
    +        );
    +
    +        $opt = array_merge($opt, (array) $options);
    +
    +        $tcversion_id = $this->tree_manager->new_node($id,
    +            $this->node_types_descr_id['testcase_version']);
    +
    +        // get last version for this test case (need to get new version number)
    +        $last_version_info = $this->getLastVersionInfo($id,
    +            array(
    +                'output' => 'minimun'
    +            ));
    +
    +        $from = $source_version_id;
    +        if (is_null($source_version_id) || $source_version_id <= 0) {
    +            $from = $last_version_info['id'];
    +        }
    +        $this->copyTestcaseVersion($id, $from, $tcversion_id,
    +            $last_version_info['version'] + 1, $user_id);
    +
    +        $this->setIsOpen(null, $tcversion_id, $opt['is_open']);
    +
    +        // Keywords managed @version level.
    +        $source = array(
    +            'id' => $id,
    +            'version_id' => $from
    +        );
    +        $dest = array(
    +            'id' => $id,
    +            'version_id' => $tcversion_id
    +        );
    +        $auditContext = array(
    +            'on' => self::AUDIT_OFF
    +        );
    +
    +        $this->copyKeywordsTo($source, $dest, null, $auditContext,
    +            array(
    +                'delete' => false
    +            ));
    +        $this->copyAttachments($source['version_id'], $dest['version_id']);
    +        $this->copyTCVRelations($source['version_id'], $dest['version_id']);
    +
    +        $this->copyPlatformsTo($source, $dest, null, $auditContext,
    +            array(
    +                'delete' => false
    +            ));
    +
    +        if ($this->cfg->testcase->relations->enable &&
    +            $freezeTCVRelationsOnNewTCVersion) {
    +            $oldVerRel = $this->getTCVRelationsRaw($source['version_id']);
    +            if (! empty($oldVerRel)) {
    +                $i2c = array_keys($oldVerRel);
    +                $this->closeOpenTCVRelation($i2c,
    +                    LINK_TC_RELATION_CLOSED_BY_NEW_TCVERSION);
    +            }
    +        }
    +
    +        if ($opt['freezeLinkedRequirements']) {
    +            $this->closeOpenReqVersionOnOpenLinks($source['version_id']);
    +        }
    +
    +        $signature = array(
    +            'user_id' => $user_id,
    +            'when' => $now
    +        );
    +        $link = array(
    +            'source' => $source['version_id'],
    +            'dest' => $dest['version_id']
    +        );
    +        $optUC = array(
    +            'freezePrevious' => $opt['freezeLinkOnNewTCVersion']
    +        );
    +        $this->updateCoverage($link, $signature, $optUC);
    +
    +        $ret['id'] = $tcversion_id;
    +        $ret['version'] = $last_version_info['version'] + 1;
    +        $ret['msg'] = 'ok';
    +
    +        return $ret;
    +    }
    +
    +    /*
    +     * function: getLastVersionInfo
    +     * Get information about last version (greater number) of a testcase.
    +     *
    +     * args : id: testcase id
    +     * [options]
    +     *
    +     * returns: map with keys that depends of options['output']:
    +     *
    +     * id -> tcversion_id
    +     * version
    +     * summary
    +     * importance
    +     * author_id
    +     * creation_ts
    +     * updater_id
    +     * modification_ts
    +     * active
    +     * is_open
    +     * @internal revisions
    +     * @since 1.9.9
    +     * 'active' => values 1,0, null => do not apply filter
    +     */
    +    public function getLastVersionInfo($id, $options = null)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $my['options'] = array(
    +            'get_steps' => false,
    +            'output' => 'full',
    +            'active' => null
    +        );
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $tcInfo = null;
    +        switch ($my['options']['output']) {
    +
    +            case 'thin':
    +                $fields2get = " TCV.id AS tcversion_id";
    +                break;
    +
    +            case 'minimun':
    +                $fields2get = " TCV.id, TCV.id AS tcversion_id, TCV.version, TCV.tc_external_id,NH_TC.name ";
    +                break;
    +
    +            case 'full':
    +            default:
    +                $fields2get = " TCV.*,TCV.id AS tcversion_id, NH_TC.name ";
    +                break;
    +        }
    +
    +        $sql = "/* $debugMsg */ SELECT MAX(version) AS version " .
    +            " FROM {$this->tables['tcversions']} TCV " .
    +            " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TCV.id " .
    +            " WHERE NH_TCV.parent_id = {$id} ";
    +
    +        if (! is_null($my['options']['active'])) {
    +            $sql .= " AND TCV.active=" .
    +                (intval($my['options']['active']) > 0 ? 1 : 0);
    +        }
    +
    +        $max_version = $this->db->fetchFirstRowSingleColumn($sql, 'version');
    +
    +        $tcInfo = null;
    +        if ($max_version) {
    +            $sql = " SELECT {$fields2get} FROM {$this->tables['tcversions']} TCV " .
    +                " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TCV.id " .
    +                " JOIN {$this->tables['nodes_hierarchy']} NH_TC ON NH_TC.id = NH_TCV.parent_id " .
    +                " WHERE TCV.version = {$max_version} " .
    +                " AND NH_TCV.parent_id = {$id}";
    +
    +            $tcInfo = $this->db->fetchFirstRow($sql);
    +        }
    +
    +        // Multiple Test Case Steps Feature
    +        if (! is_null($tcInfo) && $my['options']['get_steps']) {
    +            $step_set = $this->get_steps($tcInfo['id']);
    +            $tcInfo['steps'] = $step_set;
    +        }
    +
    +        return $tcInfo;
    +    }
    +
    +    /*
    +     * function: copy_tcversion
    +     *
    +     * args:
    +     *
    +     * returns:
    +     *
    +     * rev:
    +     *
    +     */
    +    public function copyTestcaseVersion($id, $from_tcversion_id,
    +        $to_tcversion_id, $as_version_number, $user_id)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $now = $this->db->db_now();
    +        $sql = "/* $debugMsg */ " . " INSERT INTO {$this->tables['tcversions']} " .
    +            " (id,version,tc_external_id,author_id,creation_ts,summary, " .
    +            "  importance,execution_type,preconditions,estimated_exec_duration) " .
    +            " SELECT {$to_tcversion_id} AS id, {$as_version_number} AS version, " .
    +            "        tc_external_id, " .
    +            "        {$user_id} AS author_id, {$now} AS creation_ts," .
    +            "        summary,importance,execution_type, preconditions,estimated_exec_duration " .
    +            " FROM {$this->tables['tcversions']} " .
    +            " WHERE id={$from_tcversion_id} ";
    +        $this->db->exec_query($sql);
    +
    +        // copy custom fields values JUST DESIGN AREA
    +        $this->copyCfieldsDesignValues(
    +            array(
    +                'id' => $id,
    +                'tcversion_id' => $from_tcversion_id
    +            ), array(
    +                'id' => $id,
    +                'tcversion_id' => $to_tcversion_id
    +            ));
    +
    +        // Need to get all steps
    +        $gso = array(
    +            'renderGhostSteps' => false,
    +            'renderImageInline' => false
    +        );
    +        $stepsSet = $this->get_steps($from_tcversion_id, 0, $gso);
    +        if (! empty($stepsSet)) {
    +            foreach ($stepsSet as $step) {
    +                $this->create_step($to_tcversion_id, $step['step_number'],
    +                    $step['actions'], $step['expected_results'],
    +                    $step['execution_type']);
    +            }
    +        }
    +    }
    +
    +    /*
    +     * function: get_by_id_bulk
    +     *
    +     * IMPORTANT CONSIDERATION:
    +     * how may elements can be used in an SQL IN CLAUSE?
    +     * Think there is a limit ( on MSSQL 1000 ?)
    +     *
    +     * args :
    +     *
    +     * returns:
    +     *
    +     */
    +    public function get_by_id_bulk($id, $version_id = self::ALL_VERSIONS,
    +        $get_active = 0, $get_open = 0)
    +    {
    +        $debugMsg = $this->debugMsg . __FUNCTION__;
    +        $where_clause = "";
    +        $where_clause_names = "";
    +        $tcid_list = "";
    +        $tcversion_id_filter = "";
    +        $sql = "";
    +        $the_names = null;
    +        if (is_array($id)) {
    +            $tcid_list = implode(",", $id);
    +            $where_clause = " WHERE nodes_hierarchy.parent_id IN ($tcid_list) ";
    +            $where_clause_names = " WHERE nodes_hierarchy.id IN ($tcid_list) ";
    +        } else {
    +            $where_clause = " WHERE nodes_hierarchy.parent_id = {$id} ";
    +            $where_clause_names = " WHERE nodes_hierarchy.id = {$id} ";
    +        }
    +        if ($version_id != self::ALL_VERSIONS) {
    +            $tcversion_id_filter = " AND tcversions.id IN (" .
    +                implode(",", (array) $version_id) . ") ";
    +        }
    +
    +        $sql = " /* $debugMsg */ SELECT nodes_hierarchy.parent_id AS testcase_id, " .
    +            " tcversions.*, users.first AS author_first_name, users.last AS author_last_name, " .
    +            " '' AS updater_first_name, '' AS updater_last_name " .
    +            " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy " .
    +            " JOIN {$this->tables['tcversions']} tcversions ON nodes_hierarchy.id = tcversions.id " .
    +            " LEFT OUTER JOIN {$this->tables['users']} users ON tcversions.author_id = users.id " .
    +            " {$where_clause} {$tcversion_id_filter} ORDER BY tcversions.version DESC";
    +        $recordset = $this->db->get_recordset($sql);
    +
    +        if ($recordset) {
    +            // get the names
    +            $sql = " /* $debugMsg */ " .
    +                " SELECT nodes_hierarchy.id AS testcase_id, nodes_hierarchy.name " .
    +                " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy {$where_clause_names} ";
    +
    +            $the_names = $this->db->get_recordset($sql);
    +            if ($the_names) {
    +                foreach ($recordset as $the_key => $row) {
    +                    reset($the_names);
    +                    foreach ($the_names as $row_n) {
    +                        if ($row['testcase_id'] == $row_n['testcase_id']) {
    +                            $recordset[$the_key]['name'] = $row_n['name'];
    +                            break;
    +                        }
    +                    }
    +                }
    +            }
    +
    +            $sql = " /* $debugMsg */ " .
    +                " SELECT updater_id, users.first AS updater_first_name, users.last  AS updater_last_name " .
    +                " FROM {$this->tables['nodes_hierarchy']} nodes_hierarchy " .
    +                " JOIN {$this->tables['tcversions']} tcversions ON nodes_hierarchy.id = tcversions.id " .
    +                " LEFT OUTER JOIN {$this->tables['users']} users ON tcversions.updater_id = users.id " .
    +                " {$where_clause} and tcversions.updater_id IS NOT NULL ";
    +
    +            $updaters = $this->db->get_recordset($sql);
    +
    +            if ($updaters) {
    +                reset($recordset);
    +                foreach ($recordset as $the_key => $row) {
    +                    if (! is_null($row['updater_id'])) {
    +                        foreach ($updaters as $row_upd) {
    +                            if ($row['updater_id'] == $row_upd['updater_id']) {
    +                                $recordset[$the_key]['updater_last_name'] = $row_upd['updater_last_name'];
    +                                $recordset[$the_key]['updater_first_name'] = $row_upd['updater_first_name'];
    +                                break;
    +                            }
    +                        }
    +                    }
    +                }
    +            }
    +        }
    +
    +        return $recordset ? $recordset : null;
    +    }
    +
    +    /*
    +     * function: get_by_id
    +     *
    +     * args : id: can be a single testcase id or an array od testcase id.
    +     *
    +     * [version_id]: default self::ALL_VERSIONS => all versions
    +     * can be an array.
    +     * Useful to retrieve only a subset of versions.
    +     * null => means use version_number argument
    +     *
    +     * [filters]:
    +     * [active_status]: default 'ALL', range: 'ALL','ACTIVE','INACTIVE'
    +     * has effect for the following version_id values:
    +     * self::ALL_VERSIONS,TC_LAST_VERSION, version_id is NOT an array
    +     *
    +     * [open_status]: default 'ALL'
    +     * currently not used.
    +     *
    +     * [version_number]: default 1, version number displayed at User Interface
    +     *
    +     * [options]:
    +     * [output]: default 'full'
    +     * domain 'full','essential','full_without_steps','full_without_users'
    +     *
    +     * returns: array
    +     *
    +     */
    +    public function get_by_id($id, $version_id = self::ALL_VERSIONS,
    +        $filters = null, $options = null)
    +    {
    +        $my['filters'] = array(
    +            'active_status' => 'ALL',
    +            'open_status' => 'ALL',
    +            'version_number' => 1
    +        );
    +        $my['filters'] = array_merge($my['filters'], (array) $filters);
    +
    +        $my['options'] = [
    +            'output' => 'full',
    +            'access_key' => 'tcversion_id',
    +            'getPrefix' => false,
    +            'order_by' => null,
    +            'withGhostString' => false,
    +            'renderGhost' => false,
    +            'renderImageInline' => false,
    +            'renderVariables' => false,
    +            'renderSpecialKW' => false
    +        ];
    +
    +        $my['options'] = array_merge($my['options'], (array) $options);
    +
    +        $tcid_list = null;
    +        $where_clause = '';
    +        $active_filter = '';
    +        $versionSQLOp = ' AND ';
    +
    +        if (is_null($id) && ! is_null($version_id)) {
    +            $versionSQLOp = ' WHERE ';
    +        } elseif (is_array($id)) {
    +            $tcid_list = implode(",", $id);
    +            $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) ";
    +        } else {
    +            $where_clause = " WHERE NHTCV.parent_id = {$id} ";
    +        }
    +
    +        if ($version_id_is_array = is_array($version_id)) {
    +            $versionid_list = implode(",", $version_id);
    +            $where_clause .= $versionSQLOp . " TCV.id IN ({$versionid_list}) ";
    +        } else {
    +            if (is_null($version_id)) {
    +                // when tcase ID has not been provided this can not be used
    +                // will not do any check => leave it CRASH
    +                $where_clause .= " AND TCV.version = {$my['filters']['version_number']} ";
    +            } else {
    +                if ($version_id != self::ALL_VERSIONS &&
    +                    $version_id != self::LATEST_VERSION) {
    +                    $where_clause .= $versionSQLOp . " TCV.id = {$version_id} ";
    +                }
    +            }
    +
    +            $active_status = strtoupper($my['filters']['active_status']);
    +            if ($active_status != 'ALL') {
    +                $active_filter = ' AND TCV.active=' .
    +                    ($active_status == 'ACTIVE' ? 1 : 0) . ' ';
    +            }
    +        }
    +
    +        switch ($my['options']['output']) {
    +            case 'full':
    +            case 'full_without_steps':
    +                $sql = "SELECT UA.login AS updater_login,UB.login AS author_login,
                     NHTC.name,NHTC.node_order,NHTC.parent_id AS testsuite_id,
                     NHTCV.parent_id AS testcase_id, TCV.*,
                     UB.first AS author_first_name,UB.last AS author_last_name,
    @@ -2718,1200 +2854,1171 @@ function get_by_id($id,$version_id = self::ALL_VERSIONS, $filters = null, $optio
                     JOIN {$this->tables['tcversions']} TCV ON NHTCV.id = TCV.id
                     LEFT OUTER JOIN {$this->tables['users']} UB ON TCV.author_id = UB.id
                     LEFT OUTER JOIN {$this->tables['users']} UA ON TCV.updater_id = UA.id
    -                $where_clause $active_filter";
    -
    -            if(is_null($my['options']['order_by'])) {
    -              $sql .= " ORDER BY TCV.version DESC";
    -            }
    -            else {
    -              $sql .= $my['options']['order_by'];
    -            }
    -            break;
    -
    -      case 'full_without_users':
    -        $tcversionFields = 'TCV.id,TCV.tc_external_id,TCV.version,TCV.status,TCV.active,TCV.is_open,' .
    -                           'TCV.execution_type,TCV.importance';
    -
    -        // ATTENTION:
    -        // Order is critical for functions that use this recordset
    -        // (see specview.php).
    -        //
    -        $sql = "SELECT NHTC.name,NHTC.node_order,NHTC.parent_id AS testsuite_id,
    +                $where_clause $active_filter";
    +
    +                if (is_null($my['options']['order_by'])) {
    +                    $sql .= " ORDER BY TCV.version DESC";
    +                } else {
    +                    $sql .= $my['options']['order_by'];
    +                }
    +                break;
    +
    +            case 'full_without_users':
    +                $tcversionFields = 'TCV.id,TCV.tc_external_id,TCV.version,TCV.status,TCV.active,TCV.is_open,' .
    +                    'TCV.execution_type,TCV.importance';
    +
    +                // ATTENTION:
    +                // Order is critical for functions that use this recordset
    +                // (see specview.php).
    +                $sql = "SELECT NHTC.name,NHTC.node_order,NHTC.parent_id AS testsuite_id,
                     NHTCV.parent_id AS testcase_id, {$tcversionFields}
                     FROM {$this->tables['nodes_hierarchy']} NHTCV
                     JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTCV.parent_id = NHTC.id
                     JOIN {$this->tables['tcversions']} TCV ON NHTCV.id = TCV.id
    -                $where_clause $active_filter";
    -
    -            if(is_null($my['options']['order_by'])) {
    -              $sql .= " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC ";
    -            }
    -            else {
    -              $sql .= $my['options']['order_by'];
    -            }
    -            break;
    -
    -      case 'essential':
    -        $sql = " SELECT NHTC.name,NHTC.node_order,NHTCV.parent_id AS testcase_id, " .
    -               " NHTC.parent_id AS testsuite_id, " .
    -               " TCV.version, TCV.id, TCV.tc_external_id " .
    -               " FROM {$this->tables['nodes_hierarchy']} NHTCV " .
    -               " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTCV.parent_id = NHTC.id " .
    -               " JOIN {$this->tables['tcversions']} TCV ON NHTCV.id = TCV.id " .
    -               " {$where_clause} {$active_filter} ";
    -
    -        if(is_null($my['options']['order_by'])) {
    -          $sql .= " ORDER BY TCV.version DESC ";
    -        } else {
    -          $sql .= $my['options']['order_by'];
    -        }
    -      break;
    -    }
    -
    -    $render = array();
    -    $render['ghost'] = false;
    -    $render['ghostSteps'] = false;
    -    $render['imageInline'] = $my['options']['renderImageInline'];
    -    $render['variables'] = $my['options']['renderVariables'];
    -    $render['specialKW'] = $my['options']['renderSpecialKW'];
    -
    -    switch($my['options']['output']) {
    -      case 'full':
    -      case 'full_without_users':
    -        $render['ghost'] = $my['options']['renderGhost'];
    -        $render['ghostSteps'] = true;
    -      break;
    -
    -      case 'full_without_steps':
    -        $render['ghost'] = $my['options']['renderGhost'];
    -        $render['ghostSteps'] = false;
    -      break;
    -
    -      case 'essential':
    -        $render['imageInline'] = false;
    -        $render['variables'] = false;
    -      break;
    -    }
    -
    -    $recordset = null;
    -
    -    // Control improvements
    -    if( !$version_id_is_array && $version_id == self::LATEST_VERSION) {
    -      // But, how performance wise can be do this, instead of using MAX(version)
    -      // and a group by?
    -      //
    -      // if $id was a list then this will return something USELESS
    -      //
    -      if( is_null($tcid_list) ) {
    -        $recordset = array($this->db->fetchFirstRow($sql));
    -      }
    -      else {
    -        // Write to event viewer ???
    -        // throw exception ??
    -      }
    -    }
    -    else {
    -      $recordset = $this->db->get_recordset($sql);
    -    }
    -
    -    $canProcess = !is_null($recordset);
    -
    -    if( $canProcess && $render['variables'] ) {
    -      $key2loop = array_keys($recordset);
    -      foreach( $key2loop as $accessKey) {
    -        try {
    -          $this->renderVariables($recordset[$accessKey],$my['options']['tproject_id']);
    -        } catch (Exception $e) {
    -          echo '
    ';debug_print_backtrace();  echo '
    '; die(); - } - } - reset($recordset); - } - - if( $canProcess && $render['specialKW'] ) { - $key2loop = array_keys($recordset); - foreach( $key2loop as $accessKey) { - $this->renderSpecialTSuiteKeywords($recordset[$accessKey]); - } - reset($recordset); - } - - - // ghost on preconditions and summary - if( $canProcess && $my['options']['renderGhost'] ) { - $key2loop = array_keys($recordset); - foreach( $key2loop as $accessKey) { - $this->renderGhost($recordset[$accessKey]); - } - reset($recordset); - } - - if( $canProcess && $render['imageInline']) { - $key2loop = array_keys($recordset); - foreach( $key2loop as $accessKey) { - $pVersion = $recordset[$accessKey]['id']; - $this->renderImageAttachments($pVersion,$recordset[$accessKey]); - } - reset($recordset); - } - - - // Multiple Test Case Steps - if( $canProcess && $my['options']['output'] == 'full') { - $gsOpt['renderGhostSteps'] = $my['options']['renderGhost']; - - $key2loop = array_keys($recordset); - foreach( $key2loop as $accessKey) { - $step_set = $this->get_steps($recordset[$accessKey]['id'],0,$gsOpt); - if($my['options']['withGhostString']) { - // need to get test case prefix test project info - $pfx = $this->getPrefix($recordset[$accessKey]['testcase_id']); - $pfx = $pfx[0] . $this->cfg->testcase->glue_character . $recordset[$accessKey]['tc_external_id']; - - $k2l = array_keys((array)$step_set); - foreach($k2l as $kx) { - $step_set[$kx]['ghost_action'] = - sprintf(self::GHOSTSTEPMASK,$step_set[$kx]['step_number'], - $pfx,$recordset[$accessKey]['version']); - - $step_set[$kx]['ghost_result'] = $step_set[$kx]['ghost_action']; - } - } - $recordset[$accessKey]['steps'] = $step_set; - } - } - - if( $canProcess && $my['options']['getPrefix'] ) { - $key2loop = array_keys($recordset); - foreach( $key2loop as $accessKey) { - $pfx = $this->getPrefix($recordset[$accessKey]['testcase_id']); - $recordset[$accessKey]['fullExternalID'] = $pfx[0] . $this->cfg->testcase->glue_character . - $recordset[$accessKey]['tc_external_id']; - } - } - - return ($recordset ? $recordset : null); - } - - - /* - function: get_versions_status_quo - Get linked and executed status quo. - - IMPORTANT: - NO INFO SPECIFIC TO TESTPLAN ITEMS where testacase can be linked to - is returned. - - - args : id: test case id - [tcversion_id]: default: null -> get info about all versions. - can be a single value or an array. - - - [testplan_id]: default: null -> all testplans where testcase is linked, - are analised to generate results. - - when not null, filter for testplan_id, to analise for - generating results. - - - - returns: map. - key: tcversion_id. - value: map with the following keys: - - tcversion_id, linked , executed - - linked field: will take the following values - if $testplan_id == null - NULL if the tc version is not linked to ANY TEST PLAN - tcversion_id if linked - - if $testplan_id != null - NULL if the tc version is not linked to $testplan_id - - - executed field: will take the following values - if $testplan_id == null - NULL if the tc version has not been executed in ANY TEST PLAN - tcversion_id if has executions. - - if $testplan_id != null - NULL if the tc version has not been executed in $testplan_id - - rev : - - */ - function get_versions_status_quo($id, $tcversion_id=null, $testplan_id=null) { - $testplan_filter=''; - $tcversion_filter=''; - if(!is_null($tcversion_id)) { - if(is_array($tcversion_id)) { - $tcversion_filter=" AND NH.id IN (" . implode(",",$tcversion_id) . ") "; - } else { - $tcversion_filter=" AND NH.id={$tcversion_id} "; - } - } - - $testplan_filter=''; - if(!is_null($testplan_id)){ - $testplan_filter=" AND E.testplan_id = {$testplan_id} "; - } - $execution_join=" LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON (E.tcversion_id = NH.id {$testplan_filter})"; - - $sqlx= " SELECT TCV.id,TCV.version + $where_clause $active_filter"; + + if (is_null($my['options']['order_by'])) { + $sql .= " ORDER BY NHTC.node_order, NHTC.name, TCV.version DESC "; + } else { + $sql .= $my['options']['order_by']; + } + break; + + case 'essential': + $sql = " SELECT NHTC.name,NHTC.node_order,NHTCV.parent_id AS testcase_id, " . + " NHTC.parent_id AS testsuite_id, " . + " TCV.version, TCV.id, TCV.tc_external_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTCV.parent_id = NHTC.id " . + " JOIN {$this->tables['tcversions']} TCV ON NHTCV.id = TCV.id " . + " {$where_clause} {$active_filter} "; + + if (is_null($my['options']['order_by'])) { + $sql .= " ORDER BY TCV.version DESC "; + } else { + $sql .= $my['options']['order_by']; + } + break; + } + + $render = array(); + $render['ghost'] = false; + $render['ghostSteps'] = false; + $render['imageInline'] = $my['options']['renderImageInline']; + $render['variables'] = $my['options']['renderVariables']; + $render['specialKW'] = $my['options']['renderSpecialKW']; + + switch ($my['options']['output']) { + case 'full': + case 'full_without_users': + $render['ghost'] = $my['options']['renderGhost']; + $render['ghostSteps'] = true; + break; + + case 'full_without_steps': + $render['ghost'] = $my['options']['renderGhost']; + $render['ghostSteps'] = false; + break; + + case 'essential': + $render['imageInline'] = false; + $render['variables'] = false; + break; + } + + $recordset = null; + + // Control improvements + if (! $version_id_is_array && $version_id == self::LATEST_VERSION) { + // But, how performance wise can be do this, instead of using MAX(version) + // and a group by? + // + // if $id was a list then this will return something USELESS + if (is_null($tcid_list)) { + $recordset = array( + $this->db->fetchFirstRow($sql) + ); + } + } else { + $recordset = $this->db->get_recordset($sql); + } + + $canProcess = ! is_null($recordset); + + if ($canProcess && $render['variables']) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + try { + $this->renderVariables($recordset[$accessKey], + $my['options']['tproject_id']); + } catch (Exception $e) { + echo '
    ';
    +                    debug_print_backtrace();
    +                    echo '
    '; + die(); + } + } + reset($recordset); + } + + if ($canProcess && $render['specialKW']) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + $this->renderSpecialTSuiteKeywords($recordset[$accessKey]); + } + reset($recordset); + } + + // ghost on preconditions and summary + if ($canProcess && $my['options']['renderGhost']) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + $this->renderGhost($recordset[$accessKey]); + } + reset($recordset); + } + + if ($canProcess && $render['imageInline']) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + $pVersion = $recordset[$accessKey]['id']; + $this->renderImageAttachments($pVersion, $recordset[$accessKey]); + } + reset($recordset); + } + + // Multiple Test Case Steps + if ($canProcess && $my['options']['output'] == 'full') { + $gsOpt['renderGhostSteps'] = $my['options']['renderGhost']; + + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + $step_set = $this->get_steps($recordset[$accessKey]['id'], 0, + $gsOpt); + if ($my['options']['withGhostString']) { + // need to get test case prefix test project info + $pfx = $this->getPrefix( + $recordset[$accessKey]['testcase_id']); + $pfx = $pfx[0] . $this->cfg->testcase->glue_character . + $recordset[$accessKey]['tc_external_id']; + + $k2l = array_keys((array) $step_set); + foreach ($k2l as $kx) { + $step_set[$kx]['ghost_action'] = sprintf( + self::GHOSTSTEPMASK, $step_set[$kx]['step_number'], + $pfx, $recordset[$accessKey]['version']); + + $step_set[$kx]['ghost_result'] = $step_set[$kx]['ghost_action']; + } + } + $recordset[$accessKey]['steps'] = $step_set; + } + } + + if ($canProcess && $my['options']['getPrefix']) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $accessKey) { + $pfx = $this->getPrefix($recordset[$accessKey]['testcase_id']); + $recordset[$accessKey]['fullExternalID'] = $pfx[0] . + $this->cfg->testcase->glue_character . + $recordset[$accessKey]['tc_external_id']; + } + } + + return $recordset ? $recordset : null; + } + + /* + * function: get_versions_status_quo + * Get linked and executed status quo. + * + * IMPORTANT: + * NO INFO SPECIFIC TO TESTPLAN ITEMS where testacase can be linked to + * is returned. + * + * + * args : id: test case id + * [tcversion_id]: default: null -> get info about all versions. + * can be a single value or an array. + * + * + * [testplan_id]: default: null -> all testplans where testcase is linked, + * are analised to generate results. + * + * when not null, filter for testplan_id, to analise for + * generating results. + * + * + * + * returns: map. + * key: tcversion_id. + * value: map with the following keys: + * + * tcversion_id, linked , executed + * + * linked field: will take the following values + * if $testplan_id == null + * NULL if the tc version is not linked to ANY TEST PLAN + * tcversion_id if linked + * + * if $testplan_id != null + * NULL if the tc version is not linked to $testplan_id + * + * + * executed field: will take the following values + * if $testplan_id == null + * NULL if the tc version has not been executed in ANY TEST PLAN + * tcversion_id if has executions. + * + * if $testplan_id != null + * NULL if the tc version has not been executed in $testplan_id + * + * rev : + * + */ + public function getVersionsStatusQuo($id, $tcversion_id = null, + $testplan_id = null) + { + $testplan_filter = ''; + $tcversion_filter = ''; + if (! is_null($tcversion_id)) { + if (is_array($tcversion_id)) { + $tcversion_filter = " AND NH.id IN (" . + implode(",", $tcversion_id) . ") "; + } else { + $tcversion_filter = " AND NH.id={$tcversion_id} "; + } + } + + $testplan_filter = ''; + if (! is_null($testplan_id)) { + $testplan_filter = " AND E.testplan_id = {$testplan_id} "; + } + $execution_join = " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON (E.tcversion_id = NH.id {$testplan_filter})"; + + $sqlx = " SELECT TCV.id,TCV.version FROM {$this->tables['nodes_hierarchy']} NHA - JOIN {$this->tables['nodes_hierarchy']} NHB + JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id - JOIN {$this->tables['tcversions']} TCV ON NHA.id = TCV.id - WHERE NHA.parent_id = " . intval($id); - - $version_id = $this->db->fetchRowsIntoMap($sqlx,'version'); - - $sql="SELECT DISTINCT NH.id AS tcversion_id,T.tcversion_id AS linked, " . - " E.tcversion_id AS executed,E.tcversion_number,TCV.version " . - " FROM {$this->tables['nodes_hierarchy']} NH " . - " JOIN {$this->tables['tcversions']} TCV ON (TCV.id = NH.id ) " . - " LEFT OUTER JOIN {$this->tables['testplan_tcversions']} T ON T.tcversion_id = NH.id " . - " {$execution_join} WHERE NH.parent_id = {$id} {$tcversion_filter} ORDER BY executed DESC"; - - $rs = $this->db->get_recordset($sql); - - $recordset=array(); - $template=array('tcversion_id' => '','linked' => '','executed' => ''); - foreach($rs as $elem) { - $recordset[$elem['tcversion_id']]=$template; - $recordset[$elem['tcversion_id']]['tcversion_id']=$elem['tcversion_id']; - $recordset[$elem['tcversion_id']]['linked']=$elem['linked']; - $recordset[$elem['tcversion_id']]['version']=$elem['version']; - } - - foreach($rs as $elem) { - $tcvid=null; - if( $elem['tcversion_number'] != $elem['version']) { - if( !is_null($elem['tcversion_number']) ) { - $tcvid=$version_id[$elem['tcversion_number']]['id']; - } - } else { - $tcvid=$elem['tcversion_id']; - } - - if( !is_null($tcvid) ) { - $recordset[$tcvid]['executed']=$tcvid; - $recordset[$tcvid]['version']=$elem['tcversion_number']; - } - } - - return $recordset; - } - - - - /* - function: get_exec_status - Get information about executed and linked status in - every testplan, a testcase is linked to. - - args : id : testcase id - [exec_status]: default: ALL, range: ALL,EXECUTED,NOT_EXECUTED - [active_status]: default: ALL, range: ALL,ACTIVE,INACTIVE - - - returns: map - key: tcversion_id - value: map: - key: testplan_id - value: map with following keys: - - tcase_id - tcversion_id - version - testplan_id - tplan_name - linked if linked to testplan -> tcversion_id - executed if executed in testplan -> tcversion_id - exec_on_tplan if executed in testplan -> testplan_id - - - rev: - 20100908 - franciscom - added platform name in output recordset - - 20080531 - franciscom - Because we allow people to update test case version linked to test plan, - and to do this we update tcversion_id on executions to new version - maintaining the really executed version in tcversion_number (version number displayed - on User Interface) field we need to change algorithm. - */ - function get_exec_status($id,$filters=null, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array(); - $my['filters'] = array( 'exec_status' => "ALL", 'active_status' => 'ALL', - 'tplan_id' => null, 'platform_id' => null); - $my['options'] = array('addExecIndicator' => false); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - - $active_status = strtoupper($my['filters']['active_status']); - $exec_status = strtoupper($my['filters']['exec_status']); - $tplan_id = $my['filters']['tplan_id']; - $platform_id = $my['filters']['platform_id']; - - // Get info about tcversions of this test case - $sqlx = "/* $debugMsg */ " . - " SELECT TCV.id,TCV.version,TCV.active" . - " FROM {$this->tables['nodes_hierarchy']} NHA " . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . - " JOIN {$this->tables['tcversions']} TCV ON NHA.id = TCV.id "; - - $where_clause = " WHERE NHA.parent_id = " . $this->db->prepare_int($id); - - if(!is_null($tplan_id)) - { - $sqlx .= " JOIN {$this->tables['testplan_tcversions']} TTCV ON TTCV.tcversion_id = TCV.id "; - $where_clause .= " AND TTCV.tplan_id = " . $this->db->prepare_int($tplan_id); - } - $sqlx .= $where_clause; - $version_id = $this->db->fetchRowsIntoMap($sqlx,'version'); - - $sql = "/* $debugMsg */ " . - " SELECT DISTINCT NH.parent_id AS tcase_id, NH.id AS tcversion_id, " . - " T.tcversion_id AS linked, T.platform_id, TCV.active, E.tcversion_id AS executed, " . - " E.testplan_id AS exec_on_tplan, E.tcversion_number, " . - " T.testplan_id, NHB.name AS tplan_name, TCV.version, PLAT.name AS platform_name " . - " FROM {$this->tables['nodes_hierarchy']} NH " . - " JOIN {$this->tables['testplan_tcversions']} T ON T.tcversion_id = NH.id " . - " JOIN {$this->tables['tcversions']} TCV ON T.tcversion_id = TCV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON T.testplan_id = NHB.id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT " . - " ON T.platform_id = PLAT.id " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON (E.tcversion_id = NH.id AND E.testplan_id=T.testplan_id AND E.platform_id=T.platform_id ) " . - " WHERE NH.parent_id = " . $this->db->prepare_int($id); - - if(!is_null($tplan_id)) - { - $sql .= " AND T.tplan_id = " . $this->db->prepare_int($tplan_id); - } - if(!is_null($platform_id)) - { - $sql .= " AND T.platform_id = " . $this->db->prepare_int($platform_id); - } - - $sql .= " ORDER BY version,tplan_name"; - $rs = (array)$this->db->get_recordset($sql); - - // set right tcversion_id, based on tcversion_number,version comparison - $item_not_executed = null; - $item_executed = null; - $link_info = null; - $in_set = null; - - if (sizeof($rs)) - { - foreach($rs as $idx => $elem) - { - if( $elem['tcversion_number'] != $elem['version']) - { - // Save to generate record for linked but not executed if needed - // (see below fix not executed section) - // access key => (version,test plan, platform) - $link_info[$elem['tcversion_id']][$elem['testplan_id']][$elem['platform_id']]=$elem; - - // We are working with a test case version, that was used in a previous life of this test plan - // information about his tcversion_id is not anymore present in tables: - // - // testplan_tcversions - // executions - // cfield_execution_values. - // - // if has been executed, but after this operation User has choosen to upgrade tcversion - // linked to testplan to a different (may be a newest) test case version. - // - // We can get this information using table tcversions using tcase id and version number - // (value displayed at User Interface) as search key. - // - // Important: - // executions.tcversion_number: maintain info about RIGHT TEST case version executed - // executions.tcversion_id : test case version linked to test plan. - // - // - if( is_null($elem['tcversion_number']) ) - { - // Not Executed - $rs[$idx]['executed']=null; - $rs[$idx]['tcversion_id']=$elem['tcversion_id']; - $rs[$idx]['version']=$elem['version']; - $rs[$idx]['linked']=$elem['tcversion_id']; - $item_not_executed[]=$idx; - } - else - { - // Get right tcversion_id - $rs[$idx]['executed']=$version_id[$elem['tcversion_number']]['id']; - $rs[$idx]['tcversion_id']=$rs[$idx]['executed']; - $rs[$idx]['version']=$elem['tcversion_number']; - $rs[$idx]['linked']=$rs[$idx]['executed']; - $item_executed[]=$idx; - } - $version=$rs[$idx]['version']; - $rs[$idx]['active']=$version_id[$version]['active']; - } - else - { - $item_executed[]=$idx; - } - - // needed for logic to avoid miss not executed (see below fix not executed) - $in_set[$rs[$idx]['tcversion_id']][$rs[$idx]['testplan_id']][$rs[$idx]['platform_id']]=$rs[$idx]['tcversion_id']; - } - } - else - { - $rs = array(); - } - - // fix not executed - // - // need to add record for linked but not executed, that due to new - // logic to upate testplan-tcversions link can be absent - if(!is_null($link_info)) - { - foreach($link_info as $tcversion_id => $elem) - { - foreach($elem as $testplan_id => $platform_link) - { - foreach($platform_link as $platform_id => $value) - { - if( !isset($in_set[$tcversion_id][$testplan_id][$platform_id]) ) - { - // missing record - $value['executed']=null; - $value['exec_on_tplan']=null; - $value['tcversion_number']=null; - $rs[]=$value; - - // Must Update list of not executed - $kix=count($rs); - $item_not_executed[]=$kix > 0 ? $kix-1 : $kix; - } - - } - } - } - } - - // Convert to result map. - switch ($exec_status) - { - case 'NOT_EXECUTED': - $target=$item_not_executed; - break; - - case 'EXECUTED': - $target=$item_executed; - break; - - default: - $target = array_keys($rs); - break; - } - - $recordset = null; - - if( !is_null($target) ) - { - foreach($target as $idx) - { - $wkitem=$rs[$idx]; - if( $active_status=='ALL' || - $active_status='ACTIVE' && $wkitem['active'] || - $active_status='INACTIVE' && $wkitem['active']==0 ) - { - $recordset[$wkitem['tcversion_id']][$wkitem['testplan_id']][$wkitem['platform_id']]=$wkitem; - - if( $my['options']['addExecIndicator'] ) - { - if( !isset($recordset['executed']) ) - { - $recordset['executed'] = 0; - } - - if( $recordset['executed'] == 0 ) - { - if( !is_null($wkitem['executed']) ) - { - $recordset['executed'] = 1; - } - } - } - } - } - } - - if( !is_null($recordset) ) - { - // Natural name sort - ksort($recordset); - } - return $recordset; - } - // ------------------------------------------------------------------------------- - - - /** - * @param string stringID external test case ID - * a string on the form XXXXXGNN where: - * XXXXX: test case prefix, exists one for each test project - * G: glue character - * NN: test case number (generated using testprojects.tc_counter field) - * - * @return internal id (node id in nodes_hierarchy) - * 0 -> test case prefix OK, but external id does not exists - * 1 -> test case prefix KO - * - * 20080818 - franciscom - Dev Note - * I'm a feeling regarding performance of this function. - * Surelly adding a new column to tcversions (prefix) will simplify a lot this function. - * Other choice (that I refuse to implement time ago) is to add prefix field - * as a new nodes_hierarchy column. - * This must be discussed with dev team if we got performance bottleneck trying - * to get internal id from external one. - * - * @internal revisions - */ - function getInternalID($stringID,$opt = null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $internalID = 0; - $my['opt'] = array('glue' => $this->cfg->testcase->glue_character, - 'tproject_id' => null, 'output' => null); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - $status_ok = false; - $tproject_info = null; - - // When using this method on a context where caller certifies that - // test project is OK, we will skip this check. - $tproject_id = $my['opt']['tproject_id']; - if( !is_null($tproject_id) && !is_null($my['opt']['output']) ) { - $sql = " SELECT id,is_public FROM {$this->tables['testprojects']} " . - " WHERE id = " . intval($tproject_id); - - $tproject_info = $this->db->get_recordset($sql); - if( !is_null($tproject_info) ) { - $tproject_info = current($tproject_info); - } - } - - - // Find the last glue char - $gluePos = strrpos($stringID, $my['opt']['glue']); - $isFullExternal = ($gluePos !== false); - if($isFullExternal) { - $rawTestCasePrefix = substr($stringID, 0, $gluePos); - $rawExternalID = substr($stringID, $gluePos+1); - $status_ok = ($externalID = is_numeric($rawExternalID) ? intval($rawExternalID) : 0) > 0; - } else { - $status_ok = (($externalID = intval($stringID)) > 0); - } - - if( $status_ok && is_null($tproject_id) ) { - $status_ok = false; - if($isFullExternal) { - // Check first if Test Project prefix is valid, if not abort - $testCasePrefix = $this->db->prepare_string($rawTestCasePrefix); - $sql = "SELECT id,is_public FROM {$this->tables['testprojects']} " . - "WHERE prefix = '" . $this->db->prepare_string($testCasePrefix) . "'"; - - $tproject_info = $this->db->get_recordset($sql); - if( $status_ok = !is_null($tproject_info) ) { - $tproject_info = current($tproject_info); - $tproject_id = $tproject_info['id']; - // $tproject_id = $tproject_info[0]['id']; - } - } else { - throw new Exception(__METHOD__ . - ' EXCEPTION: When using just numeric part of External ID, test project ID, is mandatory'); - } - } - - if( $status_ok ) { - $internalID = 0; - - // get all test cases with requested external ID on all test projects. - // we do not have way to work only on one test project. - $sql = " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON TCV.id = NHTCV.id " . - " WHERE TCV.tc_external_id = " . intval($externalID); - - $testCases = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - if(!is_null($testCases)) { - foreach($testCases as $tcaseID => $value) { - $path2root = $this->tree_manager->get_path($tcaseID); - if($tproject_id == $path2root[0]['parent_id']) { - $internalID = $tcaseID; - break; - } - } - } - } - return is_null($my['opt']['output']) ? $internalID : - array('id' => $internalID,'tproject' => $tproject_info); - } - - /* - function: filterByKeyword - given a test case id (or an array of test case id) - and a keyword filter, returns for the test cases given in input - only which pass the keyword filter criteria. - - - args : - - returns: - - */ - function filterByKeyword($id,$keyword_id=0, $keyword_filter_type='OR') - { - $keyword_filter= '' ; - $subquery=''; - - // test case filter - if( is_array($id) ) - { - $testcase_filter = " AND testcase_id IN (" . implode(',',$id) . ")"; - } - else - { - $testcase_filter = " AND testcase_id = {$id} "; - } - - if( is_array($keyword_id) ) - { - $keyword_filter = " AND keyword_id IN (" . implode(',',$keyword_id) . ")"; - - if($keyword_filter_type == 'AND') - { - $subquery = "AND testcase_id IN (" . - " SELECT MAFALDA.testcase_id FROM + JOIN {$this->tables['tcversions']} TCV ON NHA.id = TCV.id + WHERE NHA.parent_id = " . intval($id); + + $version_id = $this->db->fetchRowsIntoMap($sqlx, 'version'); + + $sql = "SELECT DISTINCT NH.id AS tcversion_id,T.tcversion_id AS linked, " . + " E.tcversion_id AS executed,E.tcversion_number,TCV.version " . + " FROM {$this->tables['nodes_hierarchy']} NH " . + " JOIN {$this->tables['tcversions']} TCV ON (TCV.id = NH.id ) " . + " LEFT OUTER JOIN {$this->tables['testplan_tcversions']} T ON T.tcversion_id = NH.id " . + " {$execution_join} WHERE NH.parent_id = {$id} {$tcversion_filter} ORDER BY executed DESC"; + + $rs = $this->db->get_recordset($sql); + + $recordset = array(); + $template = array( + 'tcversion_id' => '', + 'linked' => '', + 'executed' => '' + ); + foreach ($rs as $elem) { + $recordset[$elem['tcversion_id']] = $template; + $recordset[$elem['tcversion_id']]['tcversion_id'] = $elem['tcversion_id']; + $recordset[$elem['tcversion_id']]['linked'] = $elem['linked']; + $recordset[$elem['tcversion_id']]['version'] = $elem['version']; + } + + foreach ($rs as $elem) { + $tcvid = null; + if ($elem['tcversion_number'] != $elem['version']) { + if (! is_null($elem['tcversion_number'])) { + $tcvid = $version_id[$elem['tcversion_number']]['id']; + } + } else { + $tcvid = $elem['tcversion_id']; + } + + if (! is_null($tcvid)) { + $recordset[$tcvid]['executed'] = $tcvid; + $recordset[$tcvid]['version'] = $elem['tcversion_number']; + } + } + + return $recordset; + } + + /* + * function: get_exec_status + * Get information about executed and linked status in + * every testplan, a testcase is linked to. + * + * args : id : testcase id + * [exec_status]: default: ALL, range: ALL,EXECUTED,NOT_EXECUTED + * [active_status]: default: ALL, range: ALL,ACTIVE,INACTIVE + * + * + * returns: map + * key: tcversion_id + * value: map: + * key: testplan_id + * value: map with following keys: + * + * tcase_id + * tcversion_id + * version + * testplan_id + * tplan_name + * linked if linked to testplan -> tcversion_id + * executed if executed in testplan -> tcversion_id + * exec_on_tplan if executed in testplan -> testplan_id + * + * + * rev: + * 20100908 - franciscom - added platform name in output recordset + * + * 20080531 - franciscom + * Because we allow people to update test case version linked to test plan, + * and to do this we update tcversion_id on executions to new version + * maintaining the really executed version in tcversion_number (version number displayed + * on User Interface) field we need to change algorithm. + */ + public function getExecStatus($id, $filters = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my = array(); + $my['filters'] = array( + 'exec_status' => "ALL", + 'active_status' => 'ALL', + 'tplan_id' => null, + 'platform_id' => null + ); + $my['options'] = array( + 'addExecIndicator' => false + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $active_status = strtoupper($my['filters']['active_status']); + $exec_status = strtoupper($my['filters']['exec_status']); + $tplan_id = $my['filters']['tplan_id']; + $platform_id = $my['filters']['platform_id']; + + // Get info about tcversions of this test case + $sqlx = "/* $debugMsg */ " . " SELECT TCV.id,TCV.version,TCV.active" . + " FROM {$this->tables['nodes_hierarchy']} NHA " . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id " . + " JOIN {$this->tables['tcversions']} TCV ON NHA.id = TCV.id "; + + $where_clause = " WHERE NHA.parent_id = " . $this->db->prepare_int($id); + + if (! is_null($tplan_id)) { + $sqlx .= " JOIN {$this->tables['testplan_tcversions']} TTCV ON TTCV.tcversion_id = TCV.id "; + $where_clause .= " AND TTCV.tplan_id = " . + $this->db->prepare_int($tplan_id); + } + $sqlx .= $where_clause; + $version_id = $this->db->fetchRowsIntoMap($sqlx, 'version'); + + $sql = "/* $debugMsg */ " . + " SELECT DISTINCT NH.parent_id AS tcase_id, NH.id AS tcversion_id, " . + " T.tcversion_id AS linked, T.platform_id, TCV.active, E.tcversion_id AS executed, " . + " E.testplan_id AS exec_on_tplan, E.tcversion_number, " . + " T.testplan_id, NHB.name AS tplan_name, TCV.version, PLAT.name AS platform_name " . + " FROM {$this->tables['nodes_hierarchy']} NH " . + " JOIN {$this->tables['testplan_tcversions']} T ON T.tcversion_id = NH.id " . + " JOIN {$this->tables['tcversions']} TCV ON T.tcversion_id = TCV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON T.testplan_id = NHB.id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT " . + " ON T.platform_id = PLAT.id " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON (E.tcversion_id = NH.id AND E.testplan_id=T.testplan_id AND E.platform_id=T.platform_id ) " . + " WHERE NH.parent_id = " . $this->db->prepare_int($id); + + if (! is_null($tplan_id)) { + $sql .= " AND T.tplan_id = " . $this->db->prepare_int($tplan_id); + } + if (! is_null($platform_id)) { + $sql .= " AND T.platform_id = " . + $this->db->prepare_int($platform_id); + } + + $sql .= " ORDER BY version,tplan_name"; + $rs = (array) $this->db->get_recordset($sql); + + // set right tcversion_id, based on tcversion_number,version comparison + $item_not_executed = null; + $item_executed = null; + $link_info = null; + $in_set = null; + + if (count($rs)) { + foreach ($rs as $idx => $elem) { + if ($elem['tcversion_number'] != $elem['version']) { + // Save to generate record for linked but not executed if needed + // (see below fix not executed section) + // access key => (version,test plan, platform) + $link_info[$elem['tcversion_id']][$elem['testplan_id']][$elem['platform_id']] = $elem; + + // We are working with a test case version, that was used in a previous life of this test plan + // information about his tcversion_id is not anymore present in tables: + // + // testplan_tcversions + // executions + // cfield_execution_values. + // + // if has been executed, but after this operation User has choosen to upgrade tcversion + // linked to testplan to a different (may be a newest) test case version. + // + // We can get this information using table tcversions using tcase id and version number + // (value displayed at User Interface) as search key. + // + // Important: + // executions.tcversion_number: maintain info about RIGHT TEST case version executed + // executions.tcversion_id : test case version linked to test plan. + if (is_null($elem['tcversion_number'])) { + // Not Executed + $rs[$idx]['executed'] = null; + $rs[$idx]['tcversion_id'] = $elem['tcversion_id']; + $rs[$idx]['version'] = $elem['version']; + $rs[$idx]['linked'] = $elem['tcversion_id']; + $item_not_executed[] = $idx; + } else { + // Get right tcversion_id + $rs[$idx]['executed'] = $version_id[$elem['tcversion_number']]['id']; + $rs[$idx]['tcversion_id'] = $rs[$idx]['executed']; + $rs[$idx]['version'] = $elem['tcversion_number']; + $rs[$idx]['linked'] = $rs[$idx]['executed']; + $item_executed[] = $idx; + } + $version = $rs[$idx]['version']; + $rs[$idx]['active'] = $version_id[$version]['active']; + } else { + $item_executed[] = $idx; + } + + // needed for logic to avoid miss not executed (see below fix not executed) + $in_set[$rs[$idx]['tcversion_id']][$rs[$idx]['testplan_id']][$rs[$idx]['platform_id']] = $rs[$idx]['tcversion_id']; + } + } else { + $rs = array(); + } + + // fix not executed + // + // need to add record for linked but not executed, that due to new + // logic to upate testplan-tcversions link can be absent + if (! is_null($link_info)) { + foreach ($link_info as $tcversion_id => $elem) { + foreach ($elem as $testplan_id => $platform_link) { + foreach ($platform_link as $platform_id => $value) { + if (! isset( + $in_set[$tcversion_id][$testplan_id][$platform_id])) { + // missing record + $value['executed'] = null; + $value['exec_on_tplan'] = null; + $value['tcversion_number'] = null; + $rs[] = $value; + + // Must Update list of not executed + $kix = count($rs); + $item_not_executed[] = $kix > 0 ? $kix - 1 : $kix; + } + } + } + } + } + + // Convert to result map. + switch ($exec_status) { + case 'NOT_EXECUTED': + $target = $item_not_executed; + break; + + case 'EXECUTED': + $target = $item_executed; + break; + + default: + $target = array_keys($rs); + break; + } + + $recordset = null; + + if (! is_null($target)) { + foreach ($target as $idx) { + $wkitem = $rs[$idx]; + if ($active_status == 'ALL' || + $active_status = 'ACTIVE' && $wkitem['active'] || + $active_status = 'INACTIVE' && $wkitem['active'] == 0) { + $recordset[$wkitem['tcversion_id']][$wkitem['testplan_id']][$wkitem['platform_id']] = $wkitem; + + if ($my['options']['addExecIndicator']) { + if (! isset($recordset['executed'])) { + $recordset['executed'] = 0; + } + + if ($recordset['executed'] == 0 && + ! is_null($wkitem['executed'])) { + $recordset['executed'] = 1; + } + } + } + } + } + + if (! is_null($recordset)) { + ksort($recordset); + } + return $recordset; + } + + /** + * + * @param + * string stringID external test case ID + * a string on the form XXXXXGNN where: + * XXXXX: test case prefix, exists one for each test project + * G: glue character + * NN: test case number (generated using testprojects.tc_counter field) + * + * @return int id (node id in nodes_hierarchy) + * 0 -> test case prefix OK, but external id does not exists + * 1 -> test case prefix KO + * + * 20080818 - franciscom - Dev Note + * I'm a feeling regarding performance of this function. + * Surelly adding a new column to tcversions (prefix) will simplify a lot this function. + * Other choice (that I refuse to implement time ago) is to add prefix field + * as a new nodes_hierarchy column. + * This must be discussed with dev team if we got performance bottleneck trying + * to get internal id from external one. + * + * @internal revisions + */ + public function getInternalID($stringID, $opt = null) + { + $internalID = 0; + $my['opt'] = array( + 'glue' => $this->cfg->testcase->glue_character, + 'tproject_id' => null, + 'output' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $status_ok = false; + $tproject_info = null; + + // When using this method on a context where caller certifies that + // test project is OK, we will skip this check. + $tproject_id = $my['opt']['tproject_id']; + if (! is_null($tproject_id) && ! is_null($my['opt']['output'])) { + $sql = " SELECT id,is_public FROM {$this->tables['testprojects']} " . + " WHERE id = " . intval($tproject_id); + + $tproject_info = $this->db->get_recordset($sql); + if (! is_null($tproject_info)) { + $tproject_info = current($tproject_info); + } + } + + // Find the last glue char + $gluePos = strrpos($stringID, $my['opt']['glue']); + $isFullExternal = ($gluePos !== false); + if ($isFullExternal) { + $rawTestCasePrefix = substr($stringID, 0, $gluePos); + $rawExternalID = substr($stringID, $gluePos + 1); + $status_ok = ($externalID = is_numeric($rawExternalID) ? intval( + $rawExternalID) : 0) > 0; + } else { + $status_ok = (($externalID = intval($stringID)) > 0); + } + + if ($status_ok && is_null($tproject_id)) { + $status_ok = false; + if ($isFullExternal) { + // Check first if Test Project prefix is valid, if not abort + $testCasePrefix = $this->db->prepare_string($rawTestCasePrefix); + $sql = "SELECT id,is_public FROM {$this->tables['testprojects']} " . + "WHERE prefix = '" . + $this->db->prepare_string($testCasePrefix) . "'"; + + $tproject_info = $this->db->get_recordset($sql); + if ($status_ok = ! is_null($tproject_info)) { + $tproject_info = current($tproject_info); + $tproject_id = $tproject_info['id']; + } + } else { + throw new Exception( + __METHOD__ . + ' EXCEPTION: When using just numeric part of External ID, test project ID, is mandatory'); + } + } + + if ($status_ok) { + $internalID = 0; + + // get all test cases with requested external ID on all test projects. + // we do not have way to work only on one test project. + $sql = " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON TCV.id = NHTCV.id " . " WHERE TCV.tc_external_id = " . + intval($externalID); + + $testCases = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + if (! is_null($testCases)) { + foreach ($testCases as $tcaseID => $value) { + $path2root = $this->tree_manager->get_path($tcaseID); + if ($tproject_id == $path2root[0]['parent_id']) { + $internalID = $tcaseID; + break; + } + } + } + } + return is_null($my['opt']['output']) ? $internalID : array( + 'id' => $internalID, + 'tproject' => $tproject_info + ); + } + + /* + * function: filterByKeyword + * given a test case id (or an array of test case id) + * and a keyword filter, returns for the test cases given in input + * only which pass the keyword filter criteria. + * + * + * args : + * + * returns: + * + */ + public function filterByKeyword($id, $keyword_id = 0, + $keyword_filter_type = 'OR') + { + $keyword_filter = ''; + $subquery = ''; + + if (is_array($id)) { + $testcase_filter = " AND testcase_id IN (" . implode(',', $id) . ")"; + } else { + $testcase_filter = " AND testcase_id = {$id} "; + } + + if (is_array($keyword_id)) { + $keyword_filter = " AND keyword_id IN (" . implode(',', $keyword_id) . + ")"; + + if ($keyword_filter_type == 'AND') { + $subquery = "AND testcase_id IN (" . + " SELECT MAFALDA.testcase_id FROM ( SELECT COUNT(testcase_id) AS HITS,testcase_id FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} WHERE keyword_id = K.id {$keyword_filter} - GROUP BY testcase_id ) AS MAFALDA " . - " WHERE MAFALDA.HITS=" . count($keyword_id) . ")"; - - $keyword_filter =''; - } - } - else if( $keyword_id > 0 ) - { - $keyword_filter = " AND keyword_id = {$keyword_id} "; - } - - $map_keywords = null; - $sql = " SELECT testcase_id,keyword_id,keyword + GROUP BY testcase_id ) AS MAFALDA " . + " WHERE MAFALDA.HITS=" . count($keyword_id) . ")"; + + $keyword_filter = ''; + } + } elseif ($keyword_id > 0) { + $keyword_filter = " AND keyword_id = {$keyword_id} "; + } + + $sql = " SELECT testcase_id,keyword_id,keyword FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} WHERE keyword_id = K.id {$testcase_filter} {$keyword_filter} {$subquery} - ORDER BY keyword ASC "; - - // $map_keywords = $this->db->fetchRowsIntoMap($sql,'testcase_id'); - $map_keywords = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','keyword_id'); - - return($map_keywords); - } //end function - - - - // ------------------------------------------------------------------------ - // Keyword related methods - // ------------------------------------------------------------------------ - /* - function: getKeywords - - args : - - returns: - - */ - function getKeywords($tcID,$versionID,$kwID = null,$opt = null) { - $my['opt'] = array('accessKey' => 'keyword_id', 'fields' => null, - 'orderBy' => null); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $f2g = is_null($my['opt']['fields']) ? - ' TCKW.id AS tckw_link,keyword_id,KW.keyword,KW.notes, - testcase_id,tcversion_id ' : - $my['opt']['fields']; - - $sql = " SELECT {$f2g} + ORDER BY keyword ASC "; + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', 'keyword_id'); + } + + /* + * function: getKeywords + * + * args : + * + * returns: + * + */ + public function getKeywords($tcID, $versionID, $kwID = null, $opt = null) + { + $my['opt'] = array( + 'accessKey' => 'keyword_id', + 'fields' => null, + 'orderBy' => null + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $f2g = is_null($my['opt']['fields']) ? ' TCKW.id AS tckw_link,keyword_id,KW.keyword,KW.notes, + testcase_id,tcversion_id ' : $my['opt']['fields']; + + $sql = " SELECT {$f2g} FROM {$this->tables['testcase_keywords']} TCKW JOIN {$this->tables['keywords']} KW - ON keyword_id = KW.id "; - - $sql .= " WHERE testcase_id = " . intval($tcID) . - " AND tcversion_id=" . intval($versionID); - - if (!is_null($kwID)) { - $sql .= " AND keyword_id = " . intval($kwID); - } - - if (!is_null($my['opt']['orderBy'])) { - $sql .= ' ' . $my['opt']['orderBy']; - } - - switch( $my['opt']['accessKey'] ) { - case 'testcase_id,tcversion_id'; - $items = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','tcversion_id',database::CUMULATIVE); - break; - - default: - $items = $this->db->fetchRowsIntoMap($sql,$my['opt']['accessKey']); - break; - } - - return $items; - } - - /** - * - */ - function getKeywordsByIdCard($idCard,$opt=null) { - return $this->get_keywords_map($idCard['tcase_id'],$idCard['tcversion_id'],$opt); - } - - - - /* - function: get_keywords_map - - args: id: testcase id - version_id - opt: 'orderByClause' => '' -> no order choosen - must be an string with complete clause, - i.e. 'ORDER BY keyword' - - 'output' => null => array[keyword_id] = keyword - 'kwfull' => - array[keyword_id] = array('keyword_id' => value, - 'keyword' => value, - 'notes' => value) - - returns: map with keywords information - - - */ - function get_keywords_map($id,$version_id,$opt=null) { - $my['opt'] = array('orderByClause' => '', 'output' => null); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - - switch($my['opt']['output']) { - case 'kwfull': - $sql = "SELECT TCKW.keyword_id,KW.keyword,KW.notes"; - break; - - default: - $sql = "SELECT TCKW.keyword_id,KW.keyword"; - break; - } - $sql .= " FROM {$this->tables['testcase_keywords']} TCKW, " . - " {$this->tables['keywords']} KW WHERE keyword_id = KW.id "; - - $sql .= " AND TCKW.testcase_id = " . intval($id) . - " AND TCKW.tcversion_id = " . intval($version_id); - - $sql .= $my['opt']['orderByClause']; - - - switch($my['opt']['output']) { - case 'kwfull': - $map_keywords = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - break; - - default: - $map_keywords = $this->db->fetchColumnsIntoMap($sql,'keyword_id','keyword'); - break; - } - - return $map_keywords; - } - - /** - * add keywords without checking if exist. - * - */ - function addKeywords($id,$version_id,$kw_ids,$audit=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $adt = array('on' => self::AUDIT_ON, 'version' => null); - $adt = array_merge($adt, (array)$audit); - - if( count($kw_ids) == 0 ) { - return true; - } - - $safeID = array('tc' => intval($id), 'tcv' => intval($version_id)); - foreach($safeID as $key => $val ) { - if($val <= 0) { - throw new Exception(__METHOD__ . " $key cannot be $val ", 1); - } - } - - // Firts check if records exist - $sql = "/* $debugMsg */ - SELECT keyword_id FROM {$this->tables['testcase_keywords']} - WHERE testcase_id = {$safeID['tc']} - AND tcversion_id = {$safeID['tcv']} - AND keyword_id IN (" . implode(',',$kw_ids) . ")"; - - $kwCheck = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - - $sql = "/* $debugMsg */" . - " INSERT INTO {$this->tables['testcase_keywords']} " . - " (testcase_id,tcversion_id,keyword_id) VALUES "; - - $dummy = array(); - foreach( $kw_ids as $kiwi ) { - if( !isset($kwCheck[$kiwi]) ) { - $dummy[] = "($id,$version_id,$kiwi)"; - } - } - - if( count($dummy) <= 0 ) { - return; - } - - // Go ahead - $sql .= implode(',', $dummy); - $this->db->exec_query($sql); - - // Now AUDIT - if ( $adt['on'] == self::AUDIT_ON ) { - - // Audit Context - $tcPath = $this->getPathName( $id ); - $kwOpt = array('cols' => 'id,keyword', - 'accessKey' => 'id', 'kwSet' => $kw_ids); - $keywordSet = tlKeyword::getSimpleSet($this->db,$kwOpt); - - foreach($keywordSet as $elem ) { - logAuditEvent(TLS("audit_keyword_assigned_tc",$elem['keyword'], - $tcPath,$adt['version']), - "ASSIGN",$version_id,"nodes_hierarchy"); - } - } - - return true; - } - - - /* - function: set's the keywords of the given testcase to the passed keywords - - args : - - returns: - - */ - function setKeywords($id,$version_id,$kw_ids,$audit = self::AUDIT_ON) { - - if( null == $version_id) { - - } - - $result = $this->deleteKeywords($id,$version_id); - if ($result && sizeof((array)$kw_ids)) { - $result = $this->addKeywords($id,$version_id,$kw_ids); - } - return $result; - } - - /** - * - * mappings is only useful when source_id and target_id do not belong - * to same Test Project. - * Because keywords are defined INSIDE a Test Project, - * ID will be different for same keyword - * in a different Test Project. - * - */ - function copyKeywordsTo($source,$dest,$kwMappings,$auditContext=null,$opt=null) { - - $adt = array('on' => self::AUDIT_ON); - if( isset($dest['version']) ) { - $adt['version'] = $dest['version']; - } - $adt = array_merge($adt,(array)$auditContext); - - $what = array('delete' => true); - $what = array_merge($what,(array)$opt); - - // Not sure that this delete is needed (@20180610) - if( $what['delete'] ) { - $this->deleteKeywords($dest['id'],$dest['version_id'],null,$auditContext); - } - - $sourceKW = $this->getKeywords($source['id'],$source['version_id']); - - if( !is_null($sourceKW) ) { - - // build item id list - $keySet = array_keys($sourceKW); - if( null != $kwMappings ) { - foreach($keySet as $itemPos => $itemID) { - if( isset($mappings[$itemID]) ) { - $keySet[$itemPos] = $mappings[$itemID]; - } - } - } - - $this->addKeywords($dest['id'],$dest['version_id'],$keySet,$adt); - } - - return true; - } - - /* - function: - - args : - - returns: - - */ - function deleteKeywords($tcID,$versionID,$kwID = null,$audit=null) { - - $sql = " DELETE FROM {$this->tables['testcase_keywords']} " . - " WHERE testcase_id = " . intval($tcID) . - " AND tcversion_id = " . intval($versionID); - - $adt = array('on' => self::AUDIT_ON); - $adt = array_merge($adt,(array)$audit); - - if (!is_null($kwID)) { - if(is_array($kwID)) { - $sql .= " AND keyword_id IN (" . implode(',',$kwID) . ")"; - $key4log=$kwID; - } - else { - $sql .= " AND keyword_id = {$kwID}"; - $key4log = array($kwID); - } - } - else { - $key4log = array_keys((array)$this->get_keywords_map($tcID,$versionID)); - } - - $result = $this->db->exec_query($sql); - if ($result) { - $tcInfo = $this->tree_manager->get_node_hierarchy_info($tcID); - if ($tcInfo && $key4log) { - foreach($key4log as $key2get) { - - $keyword = tlKeyword::getByID($this->db,$key2get); - if ($keyword && $adt['on']==self::AUDIT_ON) { - logAuditEvent(TLS("audit_keyword_assignment_removed_tc",$keyword->name,$tcInfo['name']), - "ASSIGN",$tcID,"nodes_hierarchy"); - } - } - } - } - - return $result; - } - - - /** - * - */ - function deleteKeywordsByLink($tcID, $tckwLinkID, $audit=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeTCID = intval($tcID); - - $links = (array)$tckwLinkID; - $inClause = implode(',',$links); - - $sql = " /* $debugMsg */ + ON keyword_id = KW.id "; + + $sql .= " WHERE testcase_id = " . intval($tcID) . " AND tcversion_id=" . + intval($versionID); + + if (! is_null($kwID)) { + $sql .= " AND keyword_id = " . intval($kwID); + } + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + switch ($my['opt']['accessKey']) { + case 'testcase_id,tcversion_id': + $items = $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', + 'tcversion_id', database::CUMULATIVE); + break; + + default: + $items = $this->db->fetchRowsIntoMap($sql, + $my['opt']['accessKey']); + break; + } + + return $items; + } + + /** + */ + public function getKeywordsByIdCard($idCard, $opt = null) + { + return $this->get_keywords_map($idCard['tcase_id'], + $idCard['tcversion_id'], $opt); + } + + /* + * function: get_keywords_map + * + * args: id: testcase id + * version_id + * opt: 'orderByClause' => '' -> no order choosen + * must be an string with complete clause, + * i.e. 'ORDER BY keyword' + * + * 'output' => null => array[keyword_id] = keyword + * 'kwfull' => + * array[keyword_id] = array('keyword_id' => value, + * 'keyword' => value, + * 'notes' => value) + * + * returns: map with keywords information + * + * + */ + public function get_keywords_map($id, $version_id, $opt = null) + { + $my['opt'] = array( + 'orderByClause' => '', + 'output' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + switch ($my['opt']['output']) { + case 'kwfull': + $sql = "SELECT TCKW.keyword_id,KW.keyword,KW.notes"; + break; + + default: + $sql = "SELECT TCKW.keyword_id,KW.keyword"; + break; + } + $sql .= " FROM {$this->tables['testcase_keywords']} TCKW, " . + " {$this->tables['keywords']} KW WHERE keyword_id = KW.id "; + + $sql .= " AND TCKW.testcase_id = " . intval($id) . + " AND TCKW.tcversion_id = " . intval($version_id); + + $sql .= $my['opt']['orderByClause']; + + switch ($my['opt']['output']) { + case 'kwfull': + $map_keywords = $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + break; + + default: + $map_keywords = $this->db->fetchColumnsIntoMap($sql, + 'keyword_id', 'keyword'); + break; + } + + return $map_keywords; + } + + /** + * add keywords without checking if exist. + */ + public function addKeywords($id, $version_id, $kw_ids, $audit = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $adt = array( + 'on' => self::AUDIT_ON, + 'version' => null + ); + $adt = array_merge($adt, (array) $audit); + + if (count($kw_ids) == 0) { + return true; + } + + $safeID = array( + 'tc' => intval($id), + 'tcv' => intval($version_id) + ); + foreach ($safeID as $key => $val) { + if ($val <= 0) { + throw new Exception(__METHOD__ . " $key cannot be $val ", 1); + } + } + + // Firts check if records exist + $sql = "/* $debugMsg */ + SELECT keyword_id FROM {$this->tables['testcase_keywords']} + WHERE testcase_id = {$safeID['tc']} + AND tcversion_id = {$safeID['tcv']} + AND keyword_id IN (" . implode(',', $kw_ids) . ")"; + + $kwCheck = $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + + $sql = "/* $debugMsg */" . + " INSERT INTO {$this->tables['testcase_keywords']} " . + " (testcase_id,tcversion_id,keyword_id) VALUES "; + + $dummy = array(); + foreach ($kw_ids as $kiwi) { + if (! isset($kwCheck[$kiwi])) { + $dummy[] = "($id,$version_id,$kiwi)"; + } + } + + if (empty($dummy)) { + return; + } + + // Go ahead + $sql .= implode(',', $dummy); + $this->db->exec_query($sql); + + // Now AUDIT + if ($adt['on'] == self::AUDIT_ON) { + + // Audit Context + $tcPath = $this->getPathName($id); + $kwOpt = array( + 'cols' => 'id,keyword', + 'accessKey' => 'id', + 'kwSet' => $kw_ids + ); + $keywordSet = tlKeyword::getSimpleSet($this->db, $kwOpt); + + foreach ($keywordSet as $elem) { + logAuditEvent( + TLS("audit_keyword_assigned_tc", $elem['keyword'], $tcPath, + $adt['version']), "ASSIGN", $version_id, + "nodes_hierarchy"); + } + } + + return true; + } + + /* + * function: set's the keywords of the given testcase to the passed keywords + * + * args : + * + * returns: + * + */ + public function setKeywords($id, $version_id, $kw_ids, + $audit = self::AUDIT_ON) + { + $result = $this->deleteKeywords($id, $version_id); + if ($result && count((array) $kw_ids)) { + $result = $this->addKeywords($id, $version_id, $kw_ids); + } + return $result; + } + + /** + * mappings is only useful when source_id and target_id do not belong + * to same Test Project. + * Because keywords are defined INSIDE a Test Project, + * ID will be different for same keyword + * in a different Test Project. + */ + private function copyKeywordsTo($source, $dest, $kwMappings, + $auditContext = null, $opt = null) + { + $adt = array( + 'on' => self::AUDIT_ON + ); + if (isset($dest['version'])) { + $adt['version'] = $dest['version']; + } + $adt = array_merge($adt, (array) $auditContext); + + $what = array( + 'delete' => true + ); + $what = array_merge($what, (array) $opt); + + // Not sure that this delete is needed (@20180610) + if ($what['delete']) { + $this->deleteKeywords($dest['id'], $dest['version_id'], null, + $auditContext); + } + + $sourceKW = $this->getKeywords($source['id'], $source['version_id']); + + if (! is_null($sourceKW)) { + + // build item id list + $keySet = array_keys($sourceKW); + if (null != $kwMappings) { + foreach ($keySet as $itemPos => $itemID) { + if (isset($mappings[$itemID])) { + $keySet[$itemPos] = $mappings[$itemID]; + } + } + } + + $this->addKeywords($dest['id'], $dest['version_id'], $keySet, $adt); + } + + return true; + } + + /* + * function: + * + * args : + * + * returns: + * + */ + public function deleteKeywords($tcID, $versionID, $kwID = null, + $audit = null) + { + $sql = " DELETE FROM {$this->tables['testcase_keywords']} " . + " WHERE testcase_id = " . intval($tcID) . " AND tcversion_id = " . + intval($versionID); + + $adt = array( + 'on' => self::AUDIT_ON + ); + $adt = array_merge($adt, (array) $audit); + + if (! is_null($kwID)) { + if (is_array($kwID)) { + $sql .= " AND keyword_id IN (" . implode(',', $kwID) . ")"; + $key4log = $kwID; + } else { + $sql .= " AND keyword_id = {$kwID}"; + $key4log = array( + $kwID + ); + } + } else { + $key4log = array_keys( + (array) $this->get_keywords_map($tcID, $versionID)); + } + + $result = $this->db->exec_query($sql); + if ($result) { + $tcInfo = $this->tree_manager->get_node_hierarchy_info($tcID); + if ($tcInfo && $key4log) { + foreach ($key4log as $key2get) { + + $keyword = tlKeyword::getByID($this->db, $key2get); + if ($keyword && $adt['on'] == self::AUDIT_ON) { + logAuditEvent( + TLS("audit_keyword_assignment_removed_tc", + $keyword->name, $tcInfo['name']), "ASSIGN", + $tcID, "nodes_hierarchy"); + } + } + } + } + + return $result; + } + + /** + */ + public function deleteKeywordsByLink($tcID, $tckwLinkID, $audit = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $safeTCID = intval($tcID); + + $links = (array) $tckwLinkID; + $inClause = implode(',', $links); + + $sql = " /* $debugMsg */ SELECT TCKW.tcversion_id, TCKW.keyword_id FROM {$this->tables['testcase_keywords']} TCKW WHERE TCKW.testcase_id = {$safeTCID} - AND TCKW.id IN ($inClause) "; - - - $rs = $this->db->get_recordset($sql); - - foreach($rs as $link) { - $this->deleteKeywords($safeTCID, $link['tcversion_id'], $link['keyword_id'],$audit); - } - - } - - - /** - * - */ - function getKeywordsAllTCVersions($id,$opt=null) { - $my['opt'] = array('orderBy' => null); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $f2g = ' keyword_id,KW.keyword,KW.notes,' . - ' testcase_id,tcversion_id '; - - $sql = " SELECT {$f2g} + AND TCKW.id IN ($inClause) "; + + $rs = $this->db->get_recordset($sql); + + foreach ($rs as $link) { + $this->deleteKeywords($safeTCID, $link['tcversion_id'], + $link['keyword_id'], $audit); + } + } + + /** + */ + private function getKeywordsAllTCVersions($id, $opt = null) + { + $my['opt'] = array( + 'orderBy' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $f2g = ' keyword_id,KW.keyword,KW.notes,' . ' testcase_id,tcversion_id '; + + $sql = " SELECT {$f2g} FROM {$this->tables['testcase_keywords']} TCKW JOIN {$this->tables['keywords']} KW - ON keyword_id = KW.id "; - - $sql .= " WHERE testcase_id = " . intval($id); - - if (!is_null($my['opt']['orderBy'])) - { - $sql .= ' ' . $my['opt']['orderBy']; - } - - $items = $this->db->fetchMapRowsIntoMap($sql, - 'testcase_id','tcversion_id',database::CUMULATIVE); - return $items; - } - - - // ------------------------------------------------------------------------------- - // END Keyword related methods - // ------------------------------------------------------------------------------- - - /* - function: get_executions - get information about all executions for a testcase version, - on a testplan, platform, build. - Execution results are ordered by execution timestamp. - - Is possible to filter certain executions - Is possible to choose Ascending/Descending order of results. (order by exec timestamp). - - @used-by execSetResults.php - - args : id: testcase (node id) - can be single value or array. - version_id: tcversion id (node id) - can be single value or array. - tplan_id: testplan id - build_id: if null -> do not filter by build_id - platform_id: if null -> do not filter by platform_id - options: default null, map with options. - [exec_id_order] default: 'DESC' - range: ASC,DESC - [exec_to_exclude]: default: null -> no filter - can be single value or array, this exec id will be EXCLUDED. - - - returns: map - key: tcversion id - value: array where every element is a map with following keys - - name: testcase name - testcase_id - id: tcversion_id - version - summary: testcase spec. summary - steps: testcase spec. steps - expected_results: testcase spec. expected results - execution_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants - importance - author_id: tcversion author - creation_ts: timestamp of creation - updater_id: last updater of specification - modification_ts: - active: tcversion active status - is_open: tcversion open status - tester_login - tester_first_name - tester_last_name - tester_id - execution_id - status: execution status - execution_notes - execution_ts - execution_run_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants - build_id - build_name - build_is_active - build_is_open - platform_id - platform_name - - */ - function get_executions($id,$version_id,$tplan_id,$build_id,$platform_id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('exec_id_order' => 'DESC', 'exec_to_exclude' => null); - $my['options'] = array_merge($my['options'], (array)$options); - - $filterKeys = array('build_id','platform_id'); - foreach($filterKeys as $key) - { - $filterBy[$key] = ''; - if( !is_null($$key) ) - { - $itemSet = implode(',', (array)$$key); - $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; - } - } - - // -------------------------------------------------------------------- - if( is_array($id) ) - { - $tcid_list = implode(",",$id); - $where_clause = " WHERE NHA.parent_id IN ({$tcid_list}) "; - } - else - { - $where_clause = " WHERE NHA.parent_id = {$id} "; - } - - if( is_array($version_id) ) - { - $versionid_list = implode(",",$version_id); - $where_clause .= " AND tcversions.id IN ({$versionid_list}) "; - } - else - { - if($version_id != self::ALL_VERSIONS) - { - $where_clause .= " AND tcversions.id = {$version_id} "; - } - } - - if( !is_null($my['options']['exec_to_exclude']) ) - { - - if( is_array($my['options']['exec_to_exclude'])) - { - if(count($my['options']['exec_to_exclude']) > 0 ) - { - $exec_id_list = implode(",",$my['options']['exec_to_exclude']); - $where_clause .= " AND e.id NOT IN ({$exec_id_list}) "; - } - } - else - { - $where_clause .= " AND e.id <> {$exec_id_list} "; - } - } - // -------------------------------------------------------------------- - // 20090517 - to manage deleted users i need to change: - // users.id AS tester_id => e.tester_id AS tester_id - // 20090214 - franciscom - e.execution_type -> e.execution_run_type - // - $sql="/* $debugMsg */ SELECT NHB.name,NHA.parent_id AS testcase_id, tcversions.*, + ON keyword_id = KW.id "; + + $sql .= " WHERE testcase_id = " . intval($id); + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', + 'tcversion_id', database::CUMULATIVE); + } + + /* + * function: get_executions + * get information about all executions for a testcase version, + * on a testplan, platform, build. + * Execution results are ordered by execution timestamp. + * + * Is possible to filter certain executions + * Is possible to choose Ascending/Descending order of results. (order by exec timestamp). + * + * @used-by execSetResults.php + * + * args : id: testcase (node id) - can be single value or array. + * version_id: tcversion id (node id) - can be single value or array. + * tplan_id: testplan id + * build_id: if null -> do not filter by build_id + * platform_id: if null -> do not filter by platform_id + * options: default null, map with options. + * [exec_id_order] default: 'DESC' - range: ASC,DESC + * [exec_to_exclude]: default: null -> no filter + * can be single value or array, this exec id will be EXCLUDED. + * + * + * returns: map + * key: tcversion id + * value: array where every element is a map with following keys + * + * name: testcase name + * testcase_id + * id: tcversion_id + * version + * summary: testcase spec. summary + * steps: testcase spec. steps + * expected_results: testcase spec. expected results + * execution_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants + * importance + * author_id: tcversion author + * creation_ts: timestamp of creation + * updater_id: last updater of specification + * modification_ts: + * active: tcversion active status + * is_open: tcversion open status + * tester_login + * tester_first_name + * tester_last_name + * tester_id + * execution_id + * status: execution status + * execution_notes + * execution_ts + * execution_run_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants + * build_id + * build_name + * build_is_active + * build_is_open + * platform_id + * platform_name + * + */ + public function get_executions($id, $version_id, $tplan_id, $build_id, + $platform_id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['options'] = array( + 'exec_id_order' => 'DESC', + 'exec_to_exclude' => null + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $filterKeys = array( + 'build_id', + 'platform_id' + ); + foreach ($filterKeys as $key) { + $filterBy[$key] = ''; + if (! is_null($$key)) { + $itemSet = implode(',', (array) $$key); + $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; + } + } + + if (is_array($id)) { + $tcid_list = implode(",", $id); + $where_clause = " WHERE NHA.parent_id IN ({$tcid_list}) "; + } else { + $where_clause = " WHERE NHA.parent_id = {$id} "; + } + + if (is_array($version_id)) { + $versionid_list = implode(",", $version_id); + $where_clause .= " AND tcversions.id IN ({$versionid_list}) "; + } else { + if ($version_id != self::ALL_VERSIONS) { + $where_clause .= " AND tcversions.id = {$version_id} "; + } + } + + if (! is_null($my['options']['exec_to_exclude'])) { + + if (is_array($my['options']['exec_to_exclude'])) { + if (! empty($my['options']['exec_to_exclude'])) { + $exec_id_list = implode(",", + $my['options']['exec_to_exclude']); + $where_clause .= " AND e.id NOT IN ({$exec_id_list}) "; + } + } else { + $where_clause .= " AND e.id <> {$exec_id_list} "; + } + } + // 20090517 - to manage deleted users i need to change: + // users.id AS tester_id => e.tester_id AS tester_id + // 20090214 - franciscom - e.execution_type -> e.execution_run_type + $sql = "/* $debugMsg */ SELECT NHB.name,NHA.parent_id AS testcase_id, tcversions.*, users.login AS tester_login, users.first AS tester_first_name, users.last AS tester_last_name, @@ -3931,6072 +4038,6055 @@ function get_executions($id,$version_id,$tplan_id,$build_id,$platform_id,$option LEFT OUTER JOIN {$this->tables['users']} users ON users.id = e.tester_id LEFT OUTER JOIN {$this->tables['platforms']} p ON p.id = e.platform_id $where_clause - ORDER BY NHA.node_order ASC, NHA.parent_id ASC, execution_id {$my['options']['exec_id_order']}"; - - - $recordset = $this->db->fetchArrayRowsIntoMap($sql,'id'); - return($recordset ? $recordset : null); - } - - - /* - function: get_last_execution - - args : - - - returns: map: - key: tcversions.id - value: map with following keys: - execution_id - status: execution status - execution_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants - name: testcase name - testcase_id - tsuite_id: parent testsuite of testcase (node id) - id: tcversion id (node id) - version - summary: testcase spec. summary - steps: testcase spec. steps - expected_results: testcase spec. expected results - execution_type: type of execution desired - importance - author_id: tcversion author - creation_ts: timestamp of creation - updater_id: last updater of specification. - modification_ts - active: tcversion active status - is_open: tcversion open status - tester_login - tester_first_name - tester_last_name - tester_id - execution_notes - execution_ts - execution_run_type: how the execution was really done - build_id - build_name - build_is_active - build_is_open - - */ - function get_last_execution($id,$version_id,$tplan_id,$build_id,$platform_id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $resultsCfg = config_get('results'); - $status_not_run = $resultsCfg['status_code']['not_run']; - - $filterKeys = array('build_id','platform_id'); - foreach($filterKeys as $key) { - $filterBy[$key] = ''; - if(!is_null($$key) && intval($$key) > 0) { // 20230826 - $itemSet = implode(',', (array)$$key); - $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; - } - } - - $where_clause_1 = ''; - $where_clause_2 = ''; - $add_columns=''; - $add_groupby=''; - $cumulativeMode=0; - $group_by = ''; - - // getNoExecutions: 1 -> if testcase/version_id has not been executed return anyway - // standard return structure. - // 0 -> default - // - // groupByBuild: 0 -> default, get last execution on ANY BUILD, then for a testcase/version_id - // only a record will be present on return struture. - // GROUP BY must be done ONLY BY tcversion_id - // - // 1 -> get last execution on EACH BUILD. - // GROUP BY must be done BY tcversion_id,build_id - // - $localOptions=array('getNoExecutions' => 0, 'groupByBuild' => 0, 'getSteps' => 1, - 'getStepsExecInfo' => 0, 'output' => 'std'); - if(!is_null($options) && is_array($options)) { - $localOptions=array_merge($localOptions,$options); - } - - if( is_array($id) ) { - $tcid_list = implode(",",$id); - $where_clause = " WHERE NHA.parent_id IN ({$tcid_list}) "; - } else { - $where_clause = " WHERE NHA.parent_id = {$id} "; - } - - if( is_array($version_id) ) { - $versionid_list = implode(",",$version_id); - $where_clause_1 = $where_clause . " AND NHA.id IN ({$versionid_list}) "; - $where_clause_2 = $where_clause . " AND tcversions.id IN ({$versionid_list}) "; - } else { - if($version_id != self::ALL_VERSIONS) { - $where_clause_1 = $where_clause . " AND NHA.id = {$version_id} "; - $where_clause_2 = $where_clause . " AND tcversions.id = {$version_id} "; - } - } - - // This logic (is mine - franciscom) must be detailed better!!!!! - $group_by = ' GROUP BY tcversion_id '; - $add_fields = ', e.tcversion_id AS tcversion_id'; - if( $localOptions['groupByBuild'] ) { - $add_fields .= ', e.build_id'; - $group_by .= ', e.build_id'; - $cumulativeMode = 1; - - // Hummm!!! I do not understand why this can be needed - $where_clause_1 = $where_clause; - $where_clause_2 = $where_clause; - } - - // we may be need to remove tcversion filter ($set_group_by==false) - // $add_field = $set_group_by ? ', e.tcversion_id AS tcversion_id' : ''; - // $add_field = $localOptions['groupByBuild'] ? '' : ', e.tcversion_id AS tcversion_id'; - // $where_clause_1 = $localOptions['groupByBuild'] ? $where_clause : $where_clause_1; - // $where_clause_2 = $localOptions['groupByBuild'] ? $where_clause : $where_clause_2; - - // get list of max exec id, to be used filter in next query - // Here we can get: - // a) one record for each tcversion_id (ignoring build) - // b) one record for each tcversion_id,build - // - - // 20101212 - franciscom - may be not the best logic but ... - $where_clause_1 = ($where_clause_1 == '') ? $where_clause : $where_clause_1; - $where_clause_2 = ($where_clause_2 == '') ? $where_clause : $where_clause_2; - - $sql="/* $debugMsg */ " . - " SELECT COALESCE(MAX(e.id),0) AS execution_id {$add_fields}" . - " FROM {$this->tables['nodes_hierarchy']} NHA " . - " JOIN {$this->tables['executions']} e ON NHA.id = e.tcversion_id AND e.testplan_id = {$tplan_id} " . - " {$filterBy['build_id']} {$filterBy['platform_id']}" . - " AND e.status IS NOT NULL " . - " $where_clause_1 {$group_by}"; - - $recordset = $this->db->fetchColumnsIntoMap($sql,'execution_id','tcversion_id'); - $and_exec_id=''; - if( !is_null($recordset) && count($recordset) > 0) { - $the_list = implode(",", array_keys($recordset)); - if($the_list != '') { - if( count($recordset) > 1 ) { - $and_exec_id = " AND e.id IN ($the_list) "; - } else { - $and_exec_id = " AND e.id = $the_list "; - } - } - } - - $executions_join = - " JOIN {$this->tables['executions']} e ON NHA.id = e.tcversion_id " . - " AND e.testplan_id = {$tplan_id} {$and_exec_id} {$filterBy['build_id']} " . - " {$filterBy['platform_id']} "; - - if( $localOptions['getNoExecutions'] ) { - $executions_join = " LEFT OUTER " . $executions_join; - } else { - // @TODO understand if this condition is really needed - 20090716 - franciscom - $executions_join .= " AND e.status IS NOT NULL "; - } - - // - switch ($localOptions['output']) { - case 'timestamp': - $sql= "/* $debugMsg */ SELECT e.id AS execution_id, " . - " COALESCE(e.status,'{$status_not_run}') AS status, " . - " e.execution_ts, e.build_id,e.tcversion_number," . - " FROM {$this->tables['nodes_hierarchy']} NHA" . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id" . - " JOIN {$this->tables['tcversions']} tcversions ON NHA.id = tcversions.id" . - " {$executions_join}" . - " $where_clause_2" . - " ORDER BY NHB.parent_id ASC, NHA.parent_id ASC, execution_id DESC"; - break; - - case 'std': - default: - $sql= "/* $debugMsg */ SELECT e.id AS execution_id, " . - " COALESCE(e.status,'{$status_not_run}') AS status, " . - " e.execution_type AS execution_run_type,e.execution_duration, " . - " NHB.name,NHA.parent_id AS testcase_id, NHB.parent_id AS tsuite_id," . - " tcversions.id,tcversions.tc_external_id,tcversions.version,tcversions.summary," . - " tcversions.preconditions," . - " tcversions.importance,tcversions.author_id," . - " tcversions.creation_ts,tcversions.updater_id,tcversions.modification_ts,tcversions.active," . - " tcversions.is_open,tcversions.execution_type," . - " tcversions.estimated_exec_duration,tcversions.status AS wkfstatus," . - " users.login AS tester_login,users.first AS tester_first_name," . - " users.last AS tester_last_name, e.tester_id AS tester_id," . - " e.notes AS execution_notes, e.execution_ts, e.build_id,e.tcversion_number," . - " builds.name AS build_name, builds.active AS build_is_active, builds.is_open AS build_is_open," . - " e.platform_id,p.name AS platform_name" . - " FROM {$this->tables['nodes_hierarchy']} NHA" . - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id" . - " JOIN {$this->tables['tcversions']} tcversions ON NHA.id = tcversions.id" . - " {$executions_join}" . - " LEFT OUTER JOIN {$this->tables['builds']} builds ON builds.id = e.build_id" . - " AND builds.testplan_id = {$tplan_id}" . - " LEFT OUTER JOIN {$this->tables['users']} users ON users.id = e.tester_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} p ON p.id = e.platform_id" . - " $where_clause_2" . - " ORDER BY NHB.parent_id ASC, NHA.node_order ASC, NHA.parent_id ASC, execution_id DESC"; - break; - } - - $recordset = $this->db->fetchRowsIntoMap($sql,'id',$cumulativeMode); - - // Multiple Test Case Steps Feature - if( !is_null($recordset) && $localOptions['getSteps'] ) { - $xx = null; - if( $localOptions['getStepsExecInfo'] && - ($this->cfg->execution->steps_exec_notes_default == 'latest' || - $this->cfg->execution->steps_exec_status_default == 'latest') - ) { - $tg = current($recordset); - $xx = $this->getStepsExecInfo($tg['execution_id']); - } - - $itemSet = array_keys($recordset); - foreach( $itemSet as $sdx) { - $step_set = $this->get_steps($recordset[$sdx]['id']); - if($localOptions['getStepsExecInfo']) { - if(!is_null($step_set)) { - $key_set = array_keys($step_set); - foreach($key_set as $kyx) { - $step_set[$kyx]['execution_notes'] = ''; - $step_set[$kyx]['execution_status'] = ''; - - if( isset($xx[$step_set[$kyx]['id']]) ) { - if($this->cfg->execution->steps_exec_notes_default == 'latest') { - $step_set[$kyx]['execution_notes'] = - $xx[$step_set[$kyx]['id']]['notes']; - } - - if($this->cfg->execution->steps_exec_status_default == 'latest') { - $step_set[$kyx]['execution_status'] = - $xx[$step_set[$kyx]['id']]['status']; - } - } - } - } - } - $recordset[$sdx]['steps'] = $step_set; - } - - } - - // ghost Test Case processing in summary & preconditions - if( !is_array($id) ) { - if(!is_null($recordset)) { - $key2loop = array_keys($recordset); - - // get test project from test plan - $tplanInfo = $this->tree_manager->get_node_hierarchy_info($tplan_id); - $tproj_id = intval($tplanInfo['parent_id']); - - foreach( $key2loop as $accessKey) { - $this->renderGhost($recordset[$accessKey]); - $this->renderVariables($recordset[$accessKey],$tproj_id); - $this->renderSpecialTSuiteKeywords($recordset[$accessKey]); - $this->renderImageAttachments($id,$recordset[$accessKey]); - - // render exec variables only if we have just one build - if( intval($build_id) > 0 && intval($tplan_id) >0 ) { - $context = array('tplan_id' => $tplan_id, 'build_id' => $build_id); - $this->renderBuildExecVars($context,$recordset[$accessKey]); - } - } - reset($recordset); - } - } - - return($recordset ? $recordset : null); - } - - - - /* - function: exportTestCaseDataToXML - - args : - - $tcversion_id: can be testcase::LATEST_VERSION - - returns: - - - */ - function exportTestCaseDataToXML($tcase_id,$tcversion_id, - $tproject_id=null,$bNoXMLHeader = false,$optExport = array()) { - - static $reqMgr; - static $keywordMgr; - static $cfieldMgr; - if( is_null($reqMgr) ) { - $reqMgr = new requirement_mgr($this->db); - $keywordMgr = new tlKeyword(); - $cfieldMgr = new cfield_mgr($this->db); - } - - // Useful when you need to get info but do not have tcase id - $tcase_id = intval((int)($tcase_id)); - $tcversion_id = intval((int)($tcversion_id)); - if( $tcase_id <= 0 && $tcversion_id > 0) { - $info = $this->tree_manager->get_node_hierarchy_info($tcversion_id); - $tcase_id = $info['parent_id']; - } - - $opt = array('getPrefix' => false); - if(!isset($optExport['EXTERNALID']) || $optExport['EXTERNALID']) { - $opt = array('getPrefix' => (isset($optExport['ADDPREFIX']) && $optExport['ADDPREFIX'])); - } - $tc_data = $this->get_by_id($tcase_id,$tcversion_id,null,$opt); - $testCaseVersionID = intval($tc_data[0]['id']); - - if (!$tproject_id) { - $tproject_id = $this->getTestProjectFromTestCase($tcase_id); - } - - - $tc_data[0]['xmlplatforms_on_design'] = $this->getPlatformsAsXMLString($tcase_id,$testCaseVersionID); - - if (isset($optExport['CFIELDS']) && $optExport['CFIELDS']) { - $cfMap = $this->get_linked_cfields_at_design($tcase_id,$testCaseVersionID,null,null,$tproject_id); - - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map KEY, MUST HAVE AN OCCURENCE on $elemTpl - // value is a key inside $tc_data[0] - // - if( !is_null($cfMap) && count($cfMap) > 0 ) { - $tc_data[0]['xmlcustomfields'] = $cfieldMgr->exportValueAsXML($cfMap); - } - } - - if (isset($optExport['KEYWORDS']) && $optExport['KEYWORDS']) { - // 20180610 - Will export Only for latest version? - $keywords = $this->getKeywords($tcase_id,$testCaseVersionID); - if(!is_null($keywords)) { - $xmlKW = "" . $keywordMgr->toXMLString($keywords,true) . - ""; - $tc_data[0]['xmlkeywords'] = $xmlKW; - } - } - - if (isset($optExport['REQS']) && $optExport['REQS']) { - - // $requirements = $reqMgr->get_all_for_tcase($tcase_id); - // Need to get only for test case version - - $req4version = $reqMgr->getGoodForTCVersion($testCaseVersionID); - - if( !is_null($req4version) && count($req4version) > 0 ) { - $tc_data[0]['xmlrequirements'] = - exportDataToXML($req4version,$this->XMLCfg->req->root, - $this->XMLCfg->req->elemTPL,$this->XMLCfg->req->decode,true); - } - } - - if (isset($optExport['ATTACHMENTS']) && $optExport['ATTACHMENTS']) { - - $attachments=null; - - $library = $this->attachmentRepository->getAttachmentInfosFor($tcversion_id,$this->attachmentTableName,'id'); - - // get all attachments content and encode it in base64 - if ($library) { - foreach ($library as $file) { - $aID = $file["id"]; - $content = $this->attachmentRepository->getAttachmentContent($aID, $file); - - if ($content != null) { - $attachments[$aID]["id"] = $aID; - $attachments[$aID]["name"] = $file["file_name"]; - $attachments[$aID]["file_type"] = $file["file_type"]; - $attachments[$aID]["file_size"] = $file["file_size"]; - $attachments[$aID]["title"] = $file["title"]; - $attachments[$aID]["date_added"] = $file["date_added"]; - $attachments[$aID]["content"] = base64_encode($content); - } - } - } - - if( !is_null($attachments) && count($attachments) > 0 ) { - $tc_data[0]['xmlattachments'] = - exportDataToXML($attachments,$this->XMLCfg->att->root, - $this->XMLCfg->att->elemTPL,$this->XMLCfg->att->decode,true); - } - } - - // ----------------------------------------------------------------------------- - if(!isset($optExport['TCSTEPS']) || $optExport['TCSTEPS']) { - $stepRootElem = "{{XMLCODE}}"; - $stepTemplate = "\n" . '' . "\n" . - "\t\n" . - "\t\n" . - "\t\n" . - "\t\n" . - "\n"; - $stepInfo = array("||STEP_NUMBER||" => "step_number", "||ACTIONS||" => "actions", - "||EXPECTEDRESULTS||" => "expected_results","||EXECUTIONTYPE||" => "execution_type" ); - - $stepSet = $tc_data[0]['steps']; - $xmlsteps = exportDataToXML($stepSet,$stepRootElem,$stepTemplate,$stepInfo,true); - $tc_data[0]['xmlsteps'] = $xmlsteps; - } - // -------------------------------------------------------------------------------- - - - $tc_data[0]['xmlrelations'] = null; - $addElemTpl = ''; - - // When exporting JUST a test case, exporting relations can be used - // as documentation. - // When exporting a Test Suite, format can be different as has been done - // with requirements. - // While ideas become clear , i prefer to add this option for testing - if( isset($optExport['RELATIONS']) && $optExport['RELATIONS'] ) { - $xmlRel = null; - $addElemTpl .= "||RELATIONS||"; - $relSet = $this->getRelations($tcase_id); - if($relSet['num_relations'] > 0 ) { - foreach($relSet['relations'] as $rk => $rv) { - $xmlRel .= $this->exportRelationToXML($rv,$relSet['item']); - } - $tc_data[0]['xmlrelations'] = $xmlRel; - } - } - - $rootElem = "{{XMLCODE}}"; - if (isset($optExport['ROOTELEM'])) { - $rootElem = $optExport['ROOTELEM']; - } - $elemTpl = "\n".'' . "\n" . - "\t\n"; - - - // Export the Execution Order in a TestPlan for each testcase - if(isset($optExport['EXEC_ORDER'])) { - $elemTpl .= "\t\n"; - - $tc_data[0]['exec_order'] = $optExport['EXEC_ORDER']; - } - - // Export assigned_users into "Export Test Plan" XML content - // table with all users assigned to an execution - if(isset($optExport['ASSIGNED_USER'])) { - $elemTpl .= "\t\n"; - foreach ($optExport['ASSIGNED_USER'] as $key => $username){ - $elemTpl .= "\t\t\n"; - } - $elemTpl .= "\t\n"; - } - - if(!isset($optExport['EXTERNALID']) || $optExport['EXTERNALID']) { - $elemTpl .= "\t\n"; - } - - if(!isset($optExport['ADDPREFIX']) || $optExport['ADDPREFIX']) { - $elemTpl .= "\t\n"; - } - - $optElem = ''; - if( !isset($optExport['TCSUMMARY']) || $optExport['TCSUMMARY'] ) { - $optElem .= "\t\n"; - } - if( !isset($optExport['TCPRECONDITIONS']) || $optExport['TCPRECONDITIONS'] ) { - $optElem .= "\t\n"; - } - - $elemTpl .= "\t\n" . - $optElem . - "\t\n" . - "\t\n" . - "\t||ESTIMATED_EXEC_DURATION||\n" . - "\t||STATUS||\n" . - "\t||ISOPEN||\n" . - "\t||ACTIVE||\n" . - "||STEPS||\n" . - "||KEYWORDS||||CUSTOMFIELDS||||PLATFORMS_ON_DESIGN||\n" . - "||REQUIREMENTS||||ATTACHMENTS||{$addElemTpl}\n"; - - - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map KEY, MUST HAVE AN OCCURENCE on $elemTpl - // value is a key inside $tc_data[0] - // - $info = array("{{TESTCASE_ID}}" => "testcase_id", - "{{NAME}}" => "name", - "||NODE_ORDER||" => "node_order", - "||EXEC_ORDER||" => "exec_order", - "||EXTERNALID||" => "tc_external_id", - "||FULLEXTERNALID||" => "fullExternalID", - "||VERSION||" => "version", - "||SUMMARY||" => "summary", - "||PRECONDITIONS||" => "preconditions", - "||EXECUTIONTYPE||" => "execution_type", - "||IMPORTANCE||" => "importance", - "||ESTIMATED_EXEC_DURATION||" => "estimated_exec_duration", - "||STATUS||" => "status", - "||ISOPEN||" => "is_open", - "||ACTIVE||" => "active", - "||STEPS||" => "xmlsteps", - "||KEYWORDS||" => "xmlkeywords", - "||CUSTOMFIELDS||" => "xmlcustomfields", - "||PLATFORMS_ON_DESIGN||" => "xmlplatforms_on_design", - "||REQUIREMENTS||" => "xmlrequirements", - "||ATTACHMENTS||" => "xmlattachments", - "||RELATIONS||" => "xmlrelations"); - - - $xmlTC = exportDataToXML($tc_data,$rootElem,$elemTpl,$info,$bNoXMLHeader); - return $xmlTC; - } - - - /* - function: get_version_exec_assignment - get information about user that has been assigned - test case version for execution on a testplan - - args : tcversion_id: test case version id - tplan_id - - - - returns: map - key: tcversion_id - value: map with following keys: - tcversion_id - feature_id: identifies row on table testplan_tcversions. - - - user_id: user that has reponsibility to execute this tcversion_id. - null/empty string is nodoby has been assigned - - type type of assignment. - 1 -> testcase_execution. - See assignment_types tables for updated information - about other types of assignemt available. - - status assignment status - See assignment_status tables for updated information. - 1 -> open - 2 -> closed - 3 -> completed - 4 -> todo_urgent - 5 -> todo - - assigner_id: who has assigned execution to user_id. - - - - */ - function get_version_exec_assignment($tcversion_id, $tplan_id, $build_id) - { - $sql = "SELECT T.tcversion_id AS tcversion_id,T.id AS feature_id,T.platform_id, " . - " UA.user_id,UA.type,UA.status,UA.assigner_id ". - " FROM {$this->tables['testplan_tcversions']} T " . - " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON UA.feature_id = T.id " . - " WHERE T.testplan_id={$tplan_id} AND UA.build_id = {$build_id} " . - " AND T.tcversion_id = {$tcversion_id} " . - " AND (UA.type=" . $this->assignment_types['testcase_execution']['id'] . - " OR UA.type IS NULL) "; - - - // $recordset = $this->db->fetchRowsIntoMap($sql,'tcversion_id'); - $recordset = $this->db->fetchMapRowsIntoMap($sql,'tcversion_id','platform_id',database::CUMULATIVE); - - return $recordset; - } - - - /** - * get_assigned_to_user() - * Given a user and a tesplan id, get all test case version id linked to - * test plan, that has been assigned for execution to user. - * - * @param int user_id - * - * @param mixed tproject_id list of test project id to search. - * int or array - * - * @param array [tplan_id] list of test plan id to search. - * null => all test plans - * - * @param map [options] mode='full_path' - * testcase name full path will be returned - * Only available when acces_keys ='testplan_testcase' - * - * access_keys - * possible values: 'testplan_testcase','testcase_testplan' - * changes access key in result map of maps. - * if not defined or null -> 'testplan_testcase' - * - * @param map [filters] 'tplan_status' => 'active','inactive','all' - * - * - * @return map key: (test plan id or test case id depending on options->access_keys, - * default is test plan). - * - * value: map key: (test case id or test plan id depending on options->access_keys, - * default is test case). - * value: - * - * @internal revision - */ - function get_assigned_to_user($user_id,$tproject_id,$tplan_id=null,$options=null, $filters=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('mode' => null, 'order_by' => '', - 'access_keys' => 'testplan_testcase'); - $my['opt'] = array_merge($my['opt'],(array)$options); - - $my['filters'] = array( 'tplan_status' => 'all'); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - // to load assignments for all users OR one given user - $user_sql = ($user_id != TL_USER_ANYBODY) ? " AND UA.user_id = {$user_id} " : ""; - - $filters = ""; - $access_key=array('testplan_id','testcase_id'); - - $sql="/* $debugMsg */ SELECT TPROJ.id as testproject_id,TPTCV.testplan_id,TPTCV.tcversion_id, " . - " TCV.version,TCV.tc_external_id, NHTC.id AS testcase_id, NHTC.name, TPROJ.prefix, " . - " UA.creation_ts ,UA.deadline_ts, UA.user_id as user_id, " . - " COALESCE(PLAT.name,'') AS platform_name, COALESCE(PLAT.id,0) AS platform_id, " . - " (TPTCV.urgency * TCV.importance) AS priority, BUILDS.name as build_name, " . - " BUILDS.id as build_id " . - " FROM {$this->tables['user_assignments']} UA " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.id = UA.feature_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id=TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TCV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id=TPTCV.testplan_id " . - " JOIN {$this->tables['testprojects']} TPROJ ON TPROJ.id = NHTPLAN.parent_id " . - " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = TPTCV.testplan_id " . - " JOIN {$this->tables['builds']} BUILDS ON BUILDS.id = UA.build_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - " WHERE UA.type={$this->assignment_types['testcase_execution']['id']} " . - " {$user_sql} " . - " AND TPROJ.id IN (" . implode(',', array($tproject_id)) .") " ; - - if( !is_null($tplan_id) ) - { - $filters .= " AND TPTCV.testplan_id IN (" . implode(',',$tplan_id) . ") "; - } - - if (isset($my['filters']['build_id'])) - { - $filters .= " AND UA.build_id = {$my['filters']['build_id']} "; - } - - switch($my['filters']['tplan_status']) - { - case 'all': - break; - - case 'active': - $filters .= " AND TPLAN.active = 1 "; - break; - - case 'inactive': - $filters .= " AND TPLAN.active = 0 "; - break; - } - - if(isset($my['filters']['build_status'])) - { - switch($my['filters']['build_status']) - { - case 'open': - $filters .= " AND BUILDS.is_open = 1 "; - break; - - case 'closed': - $filters .= " AND BUILDS.is_open = 0 "; - break; - - case 'all': - default: - break; - } - } - - $sql .= $filters; - - if( isset($my['opt']['access_keys']) ) - { - switch($my['opt']['access_keys']) - { - case 'testplan_testcase': - break; - - case 'testcase_testplan': - $access_key=array('testcase_id','testplan_id'); - break; - } - } - - $sql .= $my['opt']['order_by']; - - $rs = $this->db->fetchMapRowsIntoMap($sql,$access_key[0],$access_key[1],database::CUMULATIVE); - - if( !is_null($rs) ) - { - if( !is_null($my['opt']['mode']) ) - { - switch($my['opt']['mode']) - { - case 'full_path': - if($my['opt']['access_keys'] == 'testplan_testcase') - { - $tcaseSet=null; - $main_keys = array_keys($rs); - - foreach($main_keys as $maccess_key) - { - $sec_keys = array_keys($rs[$maccess_key]); - foreach($sec_keys as $saccess_key) - { - // is enough I process first element - $item = $rs[$maccess_key][$saccess_key][0]; - if(!isset($tcaseSet[$item['testcase_id']])) - { - $tcaseSet[$item['testcase_id']]=$item['testcase_id']; - } - } - } - - $path_info = $this->tree_manager->get_full_path_verbose($tcaseSet); - - // Remove test project piece and convert to string - $flat_path=null; - foreach($path_info as $tcase_id => $pieces) - { - unset($pieces[0]); - // 20100813 - asimon - deactivated last slash on path - // to remove it from test suite name in "tc assigned to user" tables - $flat_path[$tcase_id]=implode('/',$pieces); - } - $main_keys = array_keys($rs); - - foreach($main_keys as $idx) - { - $sec_keys = array_keys($rs[$idx]); - foreach($sec_keys as $jdx) - { - $third_keys = array_keys($rs[$idx][$jdx]); - foreach($third_keys as $tdx) - { - $fdx = $rs[$idx][$jdx][$tdx]['testcase_id']; - $rs[$idx][$jdx][$tdx]['tcase_full_path']=$flat_path[$fdx]; - } - } - } - } - break; - } - } - } - - return $rs; - } - - - - /* - function: update_active_status - - args : id: testcase id - tcversion_id - active_status: 1 -> active / 0 -> inactive - - returns: 1 -> everything ok. - 0 -> some error - rev: - */ - function update_active_status($id,$tcversion_id,$active_status) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ UPDATE {$this->tables['tcversions']} + ORDER BY NHA.node_order ASC, NHA.parent_id ASC, execution_id {$my['options']['exec_id_order']}"; + + $recordset = $this->db->fetchArrayRowsIntoMap($sql, 'id'); + return $recordset ? $recordset : null; + } + + /* + * function: getLastExecution + * + * args : + * + * + * returns: map: + * key: tcversions.id + * value: map with following keys: + * execution_id + * status: execution status + * execution_type: see const.inc.php TESTCASE_EXECUTION_TYPE_ constants + * name: testcase name + * testcase_id + * tsuite_id: parent testsuite of testcase (node id) + * id: tcversion id (node id) + * version + * summary: testcase spec. summary + * steps: testcase spec. steps + * expected_results: testcase spec. expected results + * execution_type: type of execution desired + * importance + * author_id: tcversion author + * creation_ts: timestamp of creation + * updater_id: last updater of specification. + * modification_ts + * active: tcversion active status + * is_open: tcversion open status + * tester_login + * tester_first_name + * tester_last_name + * tester_id + * execution_notes + * execution_ts + * execution_run_type: how the execution was really done + * build_id + * build_name + * build_is_active + * build_is_open + * + */ + public function getLastExecution($id, $version_id, $tplan_id, $build_id, + $platform_id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $resultsCfg = config_get('results'); + $status_not_run = $resultsCfg['status_code']['not_run']; + + $filterKeys = array( + 'build_id', + 'platform_id' + ); + foreach ($filterKeys as $key) { + $filterBy[$key] = ''; + if (! is_null($$key) && intval($$key) > 0) { // 20230826 + $itemSet = implode(',', (array) $$key); + $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; + } + } + + $where_clause_1 = ''; + $where_clause_2 = ''; + $cumulativeMode = 0; + $group_by = ''; + + // getNoExecutions: 1 -> if testcase/version_id has not been executed return anyway + // standard return structure. + // 0 -> default + // + // groupByBuild: 0 -> default, get last execution on ANY BUILD, then for a testcase/version_id + // only a record will be present on return struture. + // GROUP BY must be done ONLY BY tcversion_id + // + // 1 -> get last execution on EACH BUILD. + // GROUP BY must be done BY tcversion_id,build_id + $localOptions = array( + 'getNoExecutions' => 0, + 'groupByBuild' => 0, + 'getSteps' => 1, + 'getStepsExecInfo' => 0, + 'output' => 'std' + ); + if (! is_null($options) && is_array($options)) { + $localOptions = array_merge($localOptions, $options); + } + + if (is_array($id)) { + $tcid_list = implode(",", $id); + $where_clause = " WHERE NHA.parent_id IN ({$tcid_list}) "; + } else { + $where_clause = " WHERE NHA.parent_id = {$id} "; + } + + if (is_array($version_id)) { + $versionid_list = implode(",", $version_id); + $where_clause_1 = $where_clause . + " AND NHA.id IN ({$versionid_list}) "; + $where_clause_2 = $where_clause . + " AND tcversions.id IN ({$versionid_list}) "; + } else { + if ($version_id != self::ALL_VERSIONS) { + $where_clause_1 = $where_clause . " AND NHA.id = {$version_id} "; + $where_clause_2 = $where_clause . + " AND tcversions.id = {$version_id} "; + } + } + + // This logic (is mine - franciscom) must be detailed better!!!!! + $group_by = ' GROUP BY tcversion_id '; + $add_fields = ', e.tcversion_id AS tcversion_id'; + if ($localOptions['groupByBuild']) { + $add_fields .= ', e.build_id'; + $group_by .= ', e.build_id'; + $cumulativeMode = 1; + + // Hummm!!! I do not understand why this can be needed + $where_clause_1 = $where_clause; + $where_clause_2 = $where_clause; + } + + // we may be need to remove tcversion filter ($set_group_by==false) + // $add_field = $set_group_by ? ', e.tcversion_id AS tcversion_id' : ''; + // $add_field = $localOptions['groupByBuild'] ? '' : ', e.tcversion_id AS tcversion_id'; + // $where_clause_1 = $localOptions['groupByBuild'] ? $where_clause : $where_clause_1; + // $where_clause_2 = $localOptions['groupByBuild'] ? $where_clause : $where_clause_2; + + // get list of max exec id, to be used filter in next query + // Here we can get: + // a) one record for each tcversion_id (ignoring build) + // b) one record for each tcversion_id,build + + // 20101212 - franciscom - may be not the best logic but ... + $where_clause_1 = ($where_clause_1 == '') ? $where_clause : $where_clause_1; + $where_clause_2 = ($where_clause_2 == '') ? $where_clause : $where_clause_2; + + $sql = "/* $debugMsg */ " . + " SELECT COALESCE(MAX(e.id),0) AS execution_id {$add_fields}" . + " FROM {$this->tables['nodes_hierarchy']} NHA " . + " JOIN {$this->tables['executions']} e ON NHA.id = e.tcversion_id AND e.testplan_id = {$tplan_id} " . + " {$filterBy['build_id']} {$filterBy['platform_id']}" . + " AND e.status IS NOT NULL " . " $where_clause_1 {$group_by}"; + + $recordset = $this->db->fetchColumnsIntoMap($sql, 'execution_id', + 'tcversion_id'); + $and_exec_id = ''; + if (! empty($recordset)) { + $the_list = implode(",", array_keys($recordset)); + if ($the_list != '') { + if (count($recordset) > 1) { + $and_exec_id = " AND e.id IN ($the_list) "; + } else { + $and_exec_id = " AND e.id = $the_list "; + } + } + } + + $executions_join = " JOIN {$this->tables['executions']} e ON NHA.id = e.tcversion_id " . + " AND e.testplan_id = {$tplan_id} {$and_exec_id} {$filterBy['build_id']} " . + " {$filterBy['platform_id']} "; + + if ($localOptions['getNoExecutions']) { + $executions_join = " LEFT OUTER " . $executions_join; + } else { + // @TODO understand if this condition is really needed - 20090716 - franciscom + $executions_join .= " AND e.status IS NOT NULL "; + } + + switch ($localOptions['output']) { + case 'timestamp': + $sql = "/* $debugMsg */ SELECT e.id AS execution_id, " . + " COALESCE(e.status,'{$status_not_run}') AS status, " . + " e.execution_ts, e.build_id,e.tcversion_number," . + " FROM {$this->tables['nodes_hierarchy']} NHA" . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id" . + " JOIN {$this->tables['tcversions']} tcversions ON NHA.id = tcversions.id" . + " {$executions_join}" . " $where_clause_2" . + " ORDER BY NHB.parent_id ASC, NHA.parent_id ASC, execution_id DESC"; + break; + + case 'std': + default: + $sql = "/* $debugMsg */ SELECT e.id AS execution_id, " . + " COALESCE(e.status,'{$status_not_run}') AS status, " . + " e.execution_type AS execution_run_type,e.execution_duration, " . + " NHB.name,NHA.parent_id AS testcase_id, NHB.parent_id AS tsuite_id," . + " tcversions.id,tcversions.tc_external_id,tcversions.version,tcversions.summary," . + " tcversions.preconditions," . + " tcversions.importance,tcversions.author_id," . + " tcversions.creation_ts,tcversions.updater_id,tcversions.modification_ts,tcversions.active," . + " tcversions.is_open,tcversions.execution_type," . + " tcversions.estimated_exec_duration,tcversions.status AS wkfstatus," . + " users.login AS tester_login,users.first AS tester_first_name," . + " users.last AS tester_last_name, e.tester_id AS tester_id," . + " e.notes AS execution_notes, e.execution_ts, e.build_id,e.tcversion_number," . + " builds.name AS build_name, builds.active AS build_is_active, builds.is_open AS build_is_open," . + " e.platform_id,p.name AS platform_name" . + " FROM {$this->tables['nodes_hierarchy']} NHA" . + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHA.parent_id = NHB.id" . + " JOIN {$this->tables['tcversions']} tcversions ON NHA.id = tcversions.id" . + " {$executions_join}" . + " LEFT OUTER JOIN {$this->tables['builds']} builds ON builds.id = e.build_id" . + " AND builds.testplan_id = {$tplan_id}" . + " LEFT OUTER JOIN {$this->tables['users']} users ON users.id = e.tester_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} p ON p.id = e.platform_id" . + " $where_clause_2" . + " ORDER BY NHB.parent_id ASC, NHA.node_order ASC, NHA.parent_id ASC, execution_id DESC"; + break; + } + + $recordset = $this->db->fetchRowsIntoMap($sql, 'id', $cumulativeMode); + + // Multiple Test Case Steps Feature + if (! is_null($recordset) && $localOptions['getSteps']) { + $xx = null; + if ($localOptions['getStepsExecInfo'] && + ($this->cfg->execution->steps_exec_notes_default == 'latest' || + $this->cfg->execution->steps_exec_status_default == 'latest')) { + $tg = current($recordset); + $xx = $this->getStepsExecInfo($tg['execution_id']); + } + + $itemSet = array_keys($recordset); + foreach ($itemSet as $sdx) { + $step_set = $this->get_steps($recordset[$sdx]['id']); + if ($localOptions['getStepsExecInfo'] && ! is_null($step_set)) { + $key_set = array_keys($step_set); + foreach ($key_set as $kyx) { + $step_set[$kyx]['execution_notes'] = ''; + $step_set[$kyx]['execution_status'] = ''; + + if (isset($xx[$step_set[$kyx]['id']])) { + if ($this->cfg->execution->steps_exec_notes_default == + 'latest') { + $step_set[$kyx]['execution_notes'] = $xx[$step_set[$kyx]['id']]['notes']; + } + + if ($this->cfg->execution->steps_exec_status_default == + 'latest') { + $step_set[$kyx]['execution_status'] = $xx[$step_set[$kyx]['id']]['status']; + } + } + } + } + $recordset[$sdx]['steps'] = $step_set; + } + } + + // ghost Test Case processing in summary & preconditions + if (! is_array($id) && ! is_null($recordset)) { + $key2loop = array_keys($recordset); + + // get test project from test plan + $tplanInfo = $this->tree_manager->get_node_hierarchy_info($tplan_id); + $tproj_id = intval($tplanInfo['parent_id']); + + foreach ($key2loop as $accessKey) { + $this->renderGhost($recordset[$accessKey]); + $this->renderVariables($recordset[$accessKey], $tproj_id); + $this->renderSpecialTSuiteKeywords($recordset[$accessKey]); + $this->renderImageAttachments($id, $recordset[$accessKey]); + + // render exec variables only if we have just one build + if (intval($build_id) > 0 && intval($tplan_id) > 0) { + $context = array( + 'tplan_id' => $tplan_id, + 'build_id' => $build_id + ); + $this->renderBuildExecVars($context, $recordset[$accessKey]); + } + } + reset($recordset); + } + + return $recordset ? $recordset : null; + } + + /* + * function: exportTestCaseDataToXML + * + * args : + * + * $tcversion_id: can be testcase::LATEST_VERSION + * + * returns: + * + * + */ + public function exportTestCaseDataToXML($tcase_id, $tcversion_id, + $tproject_id = null, $bNoXMLHeader = false, $optExport = array()) + { + static $reqMgr; + static $keywordMgr; + static $cfieldMgr; + if (is_null($reqMgr)) { + $reqMgr = new requirement_mgr($this->db); + $keywordMgr = new tlKeyword(); + $cfieldMgr = new cfield_mgr($this->db); + } + + // Useful when you need to get info but do not have tcase id + $tcase_id = intval((int) ($tcase_id)); + $tcversion_id = intval((int) ($tcversion_id)); + if ($tcase_id <= 0 && $tcversion_id > 0) { + $info = $this->tree_manager->get_node_hierarchy_info($tcversion_id); + $tcase_id = $info['parent_id']; + } + + $opt = array( + 'getPrefix' => false + ); + if (! isset($optExport['EXTERNALID']) || $optExport['EXTERNALID']) { + $opt = array( + 'getPrefix' => (isset($optExport['ADDPREFIX']) && + $optExport['ADDPREFIX']) + ); + } + $tc_data = $this->get_by_id($tcase_id, $tcversion_id, null, $opt); + $testCaseVersionID = intval($tc_data[0]['id']); + + if (! $tproject_id) { + $tproject_id = $this->getTestProjectFromTestCase($tcase_id); + } + + $tc_data[0]['xmlplatforms_on_design'] = $this->getPlatformsAsXMLString( + $tcase_id, $testCaseVersionID); + + if (isset($optExport['CFIELDS']) && $optExport['CFIELDS']) { + $cfMap = $this->get_linked_cfields_at_design($tcase_id, + $testCaseVersionID, null, null, $tproject_id); + + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map KEY, MUST HAVE AN OCCURENCE on $elemTpl + // value is a key inside $tc_data[0] + if (! is_null($cfMap) && count($cfMap) > 0) { + $tc_data[0]['xmlcustomfields'] = $cfieldMgr->exportValueAsXML( + $cfMap); + } + } + + if (isset($optExport['KEYWORDS']) && $optExport['KEYWORDS']) { + // 20180610 - Will export Only for latest version? + $keywords = $this->getKeywords($tcase_id, $testCaseVersionID); + if (! is_null($keywords)) { + $xmlKW = "" . $keywordMgr->toXMLString($keywords, true) . + ""; + $tc_data[0]['xmlkeywords'] = $xmlKW; + } + } + + if (isset($optExport['REQS']) && $optExport['REQS']) { + // Need to get only for test case version + $req4version = $reqMgr->getGoodForTCVersion($testCaseVersionID); + + if (! empty($req4version)) { + $tc_data[0]['xmlrequirements'] = exportDataToXML($req4version, + $this->XMLCfg->req->root, $this->XMLCfg->req->elemTPL, + $this->XMLCfg->req->decode, true); + } + } + + if (isset($optExport['ATTACHMENTS']) && $optExport['ATTACHMENTS']) { + + $attachments = null; + + $library = $this->attachmentRepository->getAttachmentInfosFor( + $tcversion_id, $this->attachmentTableName, 'id'); + + // get all attachments content and encode it in base64 + if ($library) { + foreach ($library as $file) { + $aID = $file["id"]; + $content = $this->attachmentRepository->getAttachmentContent( + $aID, $file); + + if ($content != null) { + $attachments[$aID]["id"] = $aID; + $attachments[$aID]["name"] = $file["file_name"]; + $attachments[$aID]["file_type"] = $file["file_type"]; + $attachments[$aID]["file_size"] = $file["file_size"]; + $attachments[$aID]["title"] = $file["title"]; + $attachments[$aID]["date_added"] = $file["date_added"]; + $attachments[$aID]["content"] = base64_encode($content); + } + } + } + + if (! empty($attachments)) { + $tc_data[0]['xmlattachments'] = exportDataToXML($attachments, + $this->XMLCfg->att->root, $this->XMLCfg->att->elemTPL, + $this->XMLCfg->att->decode, true); + } + } + + if (! isset($optExport['TCSTEPS']) || $optExport['TCSTEPS']) { + $stepRootElem = "{{XMLCODE}}"; + $stepTemplate = "\n" . '' . "\n" . + "\t\n" . + "\t\n" . + "\t\n" . + "\t\n" . + "\n"; + $stepInfo = array( + "||STEP_NUMBER||" => "step_number", + "||ACTIONS||" => "actions", + "||EXPECTEDRESULTS||" => "expected_results", + "||EXECUTIONTYPE||" => "execution_type" + ); + + $stepSet = $tc_data[0]['steps']; + $xmlsteps = exportDataToXML($stepSet, $stepRootElem, $stepTemplate, + $stepInfo, true); + $tc_data[0]['xmlsteps'] = $xmlsteps; + } + + $tc_data[0]['xmlrelations'] = null; + $addElemTpl = ''; + + // When exporting JUST a test case, exporting relations can be used + // as documentation. + // When exporting a Test Suite, format can be different as has been done + // with requirements. + // While ideas become clear , i prefer to add this option for testing + if (isset($optExport['RELATIONS']) && $optExport['RELATIONS']) { + $xmlRel = null; + $addElemTpl .= "||RELATIONS||"; + $relSet = $this->getRelations($tcase_id); + if ($relSet['num_relations'] > 0) { + foreach ($relSet['relations'] as $rv) { + $xmlRel .= $this->exportRelationToXML($rv, $relSet['item']); + } + $tc_data[0]['xmlrelations'] = $xmlRel; + } + } + + $rootElem = "{{XMLCODE}}"; + if (isset($optExport['ROOTELEM'])) { + $rootElem = $optExport['ROOTELEM']; + } + $elemTpl = "\n" . + '' . "\n" . + "\t\n"; + + // Export the Execution Order in a TestPlan for each testcase + if (isset($optExport['EXEC_ORDER'])) { + $elemTpl .= "\t\n"; + + $tc_data[0]['exec_order'] = $optExport['EXEC_ORDER']; + } + + // Export assigned_users into "Export Test Plan" XML content + // table with all users assigned to an execution + if (isset($optExport['ASSIGNED_USER'])) { + $elemTpl .= "\t\n"; + foreach ($optExport['ASSIGNED_USER'] as $username) { + $elemTpl .= "\t\t\n"; + } + $elemTpl .= "\t\n"; + } + + if (! isset($optExport['EXTERNALID']) || $optExport['EXTERNALID']) { + $elemTpl .= "\t\n"; + } + + if (! isset($optExport['ADDPREFIX']) || $optExport['ADDPREFIX']) { + $elemTpl .= "\t\n"; + } + + $optElem = ''; + if (! isset($optExport['TCSUMMARY']) || $optExport['TCSUMMARY']) { + $optElem .= "\t\n"; + } + if (! isset($optExport['TCPRECONDITIONS']) || + $optExport['TCPRECONDITIONS']) { + $optElem .= "\t\n"; + } + + $elemTpl .= "\t\n" . $optElem . + "\t\n" . + "\t\n" . + "\t||ESTIMATED_EXEC_DURATION||\n" . + "\t||STATUS||\n" . + "\t||ISOPEN||\n" . + "\t||ACTIVE||\n" . "||STEPS||\n" . + "||KEYWORDS||||CUSTOMFIELDS||||PLATFORMS_ON_DESIGN||\n" . + "||REQUIREMENTS||||ATTACHMENTS||{$addElemTpl}\n"; + + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map KEY, MUST HAVE AN OCCURENCE on $elemTpl + // value is a key inside $tc_data[0] + // + $info = array( + "{{TESTCASE_ID}}" => "testcase_id", + "{{NAME}}" => "name", + "||NODE_ORDER||" => "node_order", + "||EXEC_ORDER||" => "exec_order", + "||EXTERNALID||" => "tc_external_id", + "||FULLEXTERNALID||" => "fullExternalID", + "||VERSION||" => "version", + "||SUMMARY||" => "summary", + "||PRECONDITIONS||" => "preconditions", + "||EXECUTIONTYPE||" => "execution_type", + "||IMPORTANCE||" => "importance", + "||ESTIMATED_EXEC_DURATION||" => "estimated_exec_duration", + "||STATUS||" => "status", + "||ISOPEN||" => "is_open", + "||ACTIVE||" => "active", + "||STEPS||" => "xmlsteps", + "||KEYWORDS||" => "xmlkeywords", + "||CUSTOMFIELDS||" => "xmlcustomfields", + "||PLATFORMS_ON_DESIGN||" => "xmlplatforms_on_design", + "||REQUIREMENTS||" => "xmlrequirements", + "||ATTACHMENTS||" => "xmlattachments", + "||RELATIONS||" => "xmlrelations" + ); + + return exportDataToXML($tc_data, $rootElem, $elemTpl, $info, + $bNoXMLHeader); + } + + /* + * function: get_version_exec_assignment + * get information about user that has been assigned + * test case version for execution on a testplan + * + * args : tcversion_id: test case version id + * tplan_id + * + * + * + * returns: map + * key: tcversion_id + * value: map with following keys: + * tcversion_id + * feature_id: identifies row on table testplan_tcversions. + * + * + * user_id: user that has reponsibility to execute this tcversion_id. + * null/empty string is nodoby has been assigned + * + * type type of assignment. + * 1 -> testcase_execution. + * See assignment_types tables for updated information + * about other types of assignemt available. + * + * status assignment status + * See assignment_status tables for updated information. + * 1 -> open + * 2 -> closed + * 3 -> completed + * 4 -> todo_urgent + * 5 -> todo + * + * assigner_id: who has assigned execution to user_id. + * + * + * + */ + public function getVersionExecAssignment($tcversion_id, $tplan_id, $build_id) + { + $sql = "SELECT T.tcversion_id AS tcversion_id,T.id AS feature_id,T.platform_id, " . + " UA.user_id,UA.type,UA.status,UA.assigner_id " . + " FROM {$this->tables['testplan_tcversions']} T " . + " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON UA.feature_id = T.id " . + " WHERE T.testplan_id={$tplan_id} AND UA.build_id = {$build_id} " . + " AND T.tcversion_id = {$tcversion_id} " . " AND (UA.type=" . + $this->assignment_types['testcase_execution']['id'] . + " OR UA.type IS NULL) "; + + return $this->db->fetchMapRowsIntoMap($sql, 'tcversion_id', + 'platform_id', database::CUMULATIVE); + } + + /** + * get_assigned_to_user() + * Given a user and a tesplan id, get all test case version id linked to + * test plan, that has been assigned for execution to user. + * + * @param + * int user_id + * + * @param + * mixed tproject_id list of test project id to search. + * int or array + * + * @param + * array [tplan_id] list of test plan id to search. + * null => all test plans + * + * @param + * map [options] mode='full_path' + * testcase name full path will be returned + * Only available when acces_keys ='testplan_testcase' + * + * access_keys + * possible values: 'testplan_testcase','testcase_testplan' + * changes access key in result map of maps. + * if not defined or null -> 'testplan_testcase' + * + * @param + * map [filters] 'tplan_status' => 'active','inactive','all' + * + * + * @return array key: (test plan id or test case id depending on options->access_keys, + * default is test plan). + * + * value: map key: (test case id or test plan id depending on options->access_keys, + * default is test case). + * value: + * + * @internal revision + */ + public function getAssignedToUser($user_id, $tproject_id, $tplan_id = null, + $options = null, $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['opt'] = array( + 'mode' => null, + 'order_by' => '', + 'access_keys' => 'testplan_testcase' + ); + $my['opt'] = array_merge($my['opt'], (array) $options); + + $my['filters'] = array( + 'tplan_status' => 'all' + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + // to load assignments for all users OR one given user + $user_sql = ($user_id != TL_USER_ANYBODY) ? " AND UA.user_id = {$user_id} " : ""; + + $filters = ""; + $access_key = array( + 'testplan_id', + 'testcase_id' + ); + + $sql = "/* $debugMsg */ SELECT TPROJ.id as testproject_id,TPTCV.testplan_id,TPTCV.tcversion_id, " . + " TCV.version,TCV.tc_external_id, NHTC.id AS testcase_id, NHTC.name, TPROJ.prefix, " . + " UA.creation_ts ,UA.deadline_ts, UA.user_id as user_id, " . + " COALESCE(PLAT.name,'') AS platform_name, COALESCE(PLAT.id,0) AS platform_id, " . + " (TPTCV.urgency * TCV.importance) AS priority, BUILDS.name as build_name, " . + " BUILDS.id as build_id " . + " FROM {$this->tables['user_assignments']} UA " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.id = UA.feature_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id=TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TCV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id=TPTCV.testplan_id " . + " JOIN {$this->tables['testprojects']} TPROJ ON TPROJ.id = NHTPLAN.parent_id " . + " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = TPTCV.testplan_id " . + " JOIN {$this->tables['builds']} BUILDS ON BUILDS.id = UA.build_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + " WHERE UA.type={$this->assignment_types['testcase_execution']['id']} " . + " {$user_sql} " . " AND TPROJ.id IN (" . + implode(',', array( + $tproject_id + )) . ") "; + + if (! is_null($tplan_id)) { + $filters .= " AND TPTCV.testplan_id IN (" . implode(',', $tplan_id) . + ") "; + } + + if (isset($my['filters']['build_id'])) { + $filters .= " AND UA.build_id = {$my['filters']['build_id']} "; + } + + switch ($my['filters']['tplan_status']) { + case 'all': + break; + + case 'active': + $filters .= " AND TPLAN.active = 1 "; + break; + + case 'inactive': + $filters .= " AND TPLAN.active = 0 "; + break; + } + + if (isset($my['filters']['build_status'])) { + switch ($my['filters']['build_status']) { + case 'open': + $filters .= " AND BUILDS.is_open = 1 "; + break; + + case 'closed': + $filters .= " AND BUILDS.is_open = 0 "; + break; + + case 'all': + default: + break; + } + } + + $sql .= $filters; + + if (isset($my['opt']['access_keys'])) { + switch ($my['opt']['access_keys']) { + case 'testplan_testcase': + break; + + case 'testcase_testplan': + $access_key = array( + 'testcase_id', + 'testplan_id' + ); + break; + } + } + + $sql .= $my['opt']['order_by']; + + $rs = $this->db->fetchMapRowsIntoMap($sql, $access_key[0], + $access_key[1], database::CUMULATIVE); + + if (! is_null($rs) && ! is_null($my['opt']['mode'])) { + switch ($my['opt']['mode']) { + case 'full_path': + if ($my['opt']['access_keys'] == 'testplan_testcase') { + $tcaseSet = null; + $main_keys = array_keys($rs); + + foreach ($main_keys as $maccess_key) { + $sec_keys = array_keys($rs[$maccess_key]); + foreach ($sec_keys as $saccess_key) { + // is enough I process first element + $item = $rs[$maccess_key][$saccess_key][0]; + if (! isset($tcaseSet[$item['testcase_id']])) { + $tcaseSet[$item['testcase_id']] = $item['testcase_id']; + } + } + } + + $path_info = $this->tree_manager->get_full_path_verbose( + $tcaseSet); + + // Remove test project piece and convert to string + $flat_path = null; + foreach ($path_info as $tcase_id => $pieces) { + unset($pieces[0]); + // 20100813 - asimon - deactivated last slash on path + // to remove it from test suite name in "tc assigned to user" tables + $flat_path[$tcase_id] = implode('/', $pieces); + } + $main_keys = array_keys($rs); + + foreach ($main_keys as $idx) { + $sec_keys = array_keys($rs[$idx]); + foreach ($sec_keys as $jdx) { + $third_keys = array_keys($rs[$idx][$jdx]); + foreach ($third_keys as $tdx) { + $fdx = $rs[$idx][$jdx][$tdx]['testcase_id']; + $rs[$idx][$jdx][$tdx]['tcase_full_path'] = $flat_path[$fdx]; + } + } + } + } + break; + } + } + + return $rs; + } + + /* + * function: update_active_status + * + * args : id: testcase id + * tcversion_id + * active_status: 1 -> active / 0 -> inactive + * + * returns: 1 -> everything ok. + * 0 -> some error + * rev: + */ + public function updateActiveStatus($id, $tcversion_id, $active_status) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = " /* $debugMsg */ UPDATE {$this->tables['tcversions']} SET active={$active_status} - WHERE id = {$tcversion_id} "; - - $result = $this->db->exec_query($sql); - return $result ? 1: 0; - } - - /* - function: update_order - - args : id: testcase id - order - - returns: - - - */ - function update_order($id,$order) - { - $result=$this->tree_manager->change_order_bulk(array($order => $id)); - return $result ? 1: 0; - } - - - /* - function: update_external_id - - args : id: testcase id - external_id - - returns: - - - */ - function update_external_id($id,$external_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ UPDATE {$this->tables['tcversions']} " . - " SET tc_external_id={$external_id} " . - " WHERE id IN (" . - " SELECT id FROM {$this->tables['nodes_hierarchy']} WHERE parent_id={$id} ) "; - - $result=$this->db->exec_query($sql); - return $result ? 1: 0; - } - - - /** - * Copy attachments from source testcase to target testcase - * - **/ - function copy_attachments($source_id,$target_id) { - return $this->attachmentRepository->copyAttachments($source_id,$target_id,$this->attachmentTableName); - } - - - /** - * copyReqAssignmentTo - * copy requirement assignments for $from test case id to $to test case id - * - * mappings is only useful when source_id and target_id do not belong to same Test Project. - * - * - */ - function copyReqAssignmentTo($from,$to,$mappings,$userID) { - static $req_mgr; - if( is_null($req_mgr) ) { - $req_mgr=new requirement_mgr($this->db); - } - - $itemSet=$req_mgr->get_all_for_tcase($from); - if( !is_null($itemSet) ) { - $loop2do=count($itemSet); - for($idx=0; $idx < $loop2do; $idx++) { - if( isset($mappings[$itemSet[$idx]['id']]) ) { - $items[$idx]=$mappings[$itemSet[$idx]['id']]; - } else { - $items[$idx]=$itemSet[$idx]['id']; - } - } - $req_mgr->assign_to_tcase($items,$to,$userID); - } - } - - /** - * - * - */ - private function getShowViewerActions($mode) { - // fine grain control of operations - $viewerActions= new stdClass(); - $viewerActions->edit='no'; - $viewerActions->delete_testcase='no'; - $viewerActions->delete_version='no'; - $viewerActions->deactivate='no'; - $viewerActions->create_new_version='no'; - $viewerActions->export='no'; - $viewerActions->move='no'; - $viewerActions->copy='no'; - $viewerActions->add2tplan='no'; - $viewerActions->freeze='no'; - $viewerActions->updTplanTCV='no'; - - switch ($mode) { - case 'editOnExec': - $viewerActions->edit='yes'; - $viewerActions->create_new_version='yes'; - $viewerActions->updTplanTCV='yes'; - break; - - case 'editDisabled': - break; - - default: - foreach($viewerActions as $key => $value) { - $viewerActions->$key='yes'; - } - break; - } - return $viewerActions; - } - - /** - * given an executio id delete execution and related data. - * - */ - function deleteExecution($executionID) - { - $whereClause = " WHERE execution_id = {$executionID} "; - $sql = array("DELETE FROM {$this->tables['execution_bugs']} {$whereClause} ", - "DELETE FROM {$this->tables['cfield_execution_values']} {$whereClause} ", - "DELETE FROM {$this->tables['executions']} WHERE id = {$executionID}" ); - - foreach ($sql as $the_stm) - { - $result = $this->db->exec_query($the_stm); - if (!$result) - { - break; - } - } - } - - - - - // --------------------------------------------------------------------------------------- - // Custom field related functions - // --------------------------------------------------------------------------------------- - - /* - function: get_linked_cfields_at_design - Get all linked custom fields that must be available at design time. - Remember that custom fields are defined at system wide level, and - has to be linked to a testproject, in order to be used. - - args: id: testcase id - tcversion_id: testcase version id ---- BUGID 3431 - [parent_id]: node id of parent testsuite of testcase. - need to understand to which testproject the testcase belongs. - this information is vital, to get the linked custom fields. - Presence /absence of this value changes starting point - on procedure to build tree path to get testproject id. - - null -> use testcase_id as starting point. - !is_null -> use this value as starting point. - - [$filters]:default: null - - map with keys: - - [show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - include ONLY custom fields that can be viewed - while user is execution testcases. - - 0 or null -> don't filter - - [show_on_testplan_design]: default: null - 1 -> filter on field show_on_testplan_design=1 - include ONLY custom fields that can be viewed - while user is designing test plan. - - 0 or null -> don't filter - - [location] new concept used to define on what location on screen - custom field will be designed. - Initally used with CF available for Test cases, to - implement pre-requisites. - null => no filtering - - - More comments/instructions on cfield_mgr->get_linked_cfields_at_design() - - returns: map/hash - key: custom field id - value: map with custom field definition and value assigned for choosen testcase, - with following keys: - - id: custom field id - name - label - type: custom field type - possible_values: for custom field - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - value: value assigned to custom field for this testcase - null if for this testcase custom field was never edited. - - node_id: testcase id - null if for this testcase, custom field was never edited. - - - rev : - 20070302 - check for $id not null, is not enough, need to check is > 0 - - */ - function get_linked_cfields_at_design($id,$tcversion_id,$parent_id=null,$filters=null,$tproject_id = null) - { - if (!$tproject_id) - { - $tproject_id = $this->getTestProjectFromTestCase($id,$parent_id); - } - - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, - self::ENABLED,$filters,'testcase',$tcversion_id); - return $cf_map; - } - - - - /* - function: getTestProjectFromTestCase - - args: id: testcase id - [parent_id]: node id of parent testsuite of testcase. - need to understand to which testproject the testcase belongs. - this information is vital, to get the linked custom fields. - Presence /absence of this value changes starting point - on procedure to build tree path to get testproject id. - - null -> use testcase_id as starting point. - !is_null -> use this value as starting point. - */ - function getTestProjectFromTestCase($id,$parent_id=null) - { - $the_path = $this->tree_manager->get_path( (!is_null($id) && $id > 0) ? $id : $parent_id); - $path_len = count($the_path); - $tproject_id = ($path_len > 0)? $the_path[0]['parent_id'] : $parent_id; - - return $tproject_id; - } - - /* - function: get_testproject - Given a testcase id get node id of testproject to which testcase belongs. - args :id: testcase id - - returns: testproject id - */ - function get_testproject($id) { - $a_path = $this->tree_manager->get_path($id); - return $a_path[0]['parent_id']; - } - - - /* - function: html_table_of_custom_field_inputs - Return html code, implementing a table with custom fields labels - and html inputs, for choosen testcase. - Used to manage user actions on custom fields values. - - - args: $id: IMPORTANT: - we can receive 0 in this arguments and THERE IS NOT A problem - if parent_id arguments has a value. - Because argument id or parent_id are used to understand what is - testproject where test case belong, in order to get custom fields - assigned/linked to test project. - - - [parent_id]: node id of parent testsuite of testcase. - need to undertad to which testproject the testcase belongs. - this information is vital, to get the linked custom fields. - Presence /absence of this value changes starting point - on procedure to build tree path to get testproject id. - - null -> use testcase_id as starting point. - !is_null -> use this value as starting point. - - [$scope]: 'design' -> use custom fields that can be used at design time (specification) - 'execution' -> use custom fields that can be used at execution time. - - [$name_suffix]: must start with '_' (underscore). - Used when we display in a page several items - example: - during test case execution, several test cases - during testplan design (assign test case to testplan). - - that have the same custom fields. - In this kind of situation we can use the item id as name suffix. - - [link_id]: default null - scope='testplan_design'. - link_id=testplan_tcversions.id this value is also part of key - to access CF values on new table that hold values assigned - to CF used on the 'tesplan_design' scope. - - scope='execution' - link_id=execution id - - BUGID 3431 - scope='design' - link_id=tcversion id - - - [tplan_id]: default null - used when scope='execution' and YOU NEED to get input with value - related to link_id - - [tproject_id]: default null - used to speedup feature when this value is available. - - - returns: html string - - rev: 20080811 - franciscom - BUGID 1650 (REQ) - - BUGID 3431 - - - */ - function html_table_of_custom_field_inputs($id,$parent_id=null, - $scope='design',$name_suffix='',$link_id=null,$tplan_id=null, - $tproject_id = null,$filters=null, $input_values = null) { - $cf_smarty = ''; - $cf_scope=trim($scope); - $method_name='get_linked_cfields_at_' . $cf_scope; - - switch($cf_scope) - { - case 'testplan_design': - $cf_map = $this->$method_name($id,$parent_id,null,$link_id,null,$tproject_id); - break; - - case 'design': - $cf_map = $this->$method_name($id,$link_id,$parent_id,$filters,$tproject_id); - break; - - case 'execution': - $cf_map = $this->$method_name($id,$parent_id,null,$link_id,$tplan_id,$tproject_id); - break; - - } - - if(!is_null($cf_map)) { - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - } - return $cf_smarty; - } - - /** - * Just a Wrapper to improve, sometimes code layout - */ - function htmlTableOfCFValues($id,$context,$filters=null, - $formatOptions=null) - { - - // $context - $ctx = array('scope' => 'design', 'execution_id' => null, - 'testplan_id' => null,'tproject_id' => null, - 'link_id' => null); - - $ctx = array_merge($ctx,$context); - extract($ctx); - - return $this->html_table_of_custom_field_values($id,$scope, - $filters,$execution_id, - $testplan_id,$tproject_id, - $formatOptions,$link_id); - - } - - - /* - function: html_table_of_custom_field_values - Return html code, implementing a table with custom fields labels - and custom fields values, for choosen testcase. - You can think of this function as some sort of read only version - of html_table_of_custom_field_inputs. - - - args: $id: Very Important!!! - scope='design' -> this is a testcase id - scope='execution' -> this is a testcase VERSION id - scope='testplan_design' -> this is a testcase VERSION id - - [$scope]: 'design' -> use custom fields that can be used at design time (specification) - 'execution' -> use custom fields that can be used at execution time. - 'testplan_design' - - [$filters]:default: null - - map with keys: - - [show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - include ONLY custom fields that can be viewed - while user is execution testcases. - - 0 or null -> don't filter - - [show_on_testplan_design]: default: null - 1 -> filter on field show_on_testplan_design=1 - include ONLY custom fields that can be viewed - while user is designing test plan. - - 0 or null -> don't filter - - [location] new concept used to define on what location on screen - custom field will be designed. - Initally used with CF available for Test cases, to - implement pre-requisites. - null => no filtering - - More comments/instructions on cfield_mgr->get_linked_cfields_at_design() - - - [$execution_id]: null -> get values for all executions availables for testcase - !is_null -> only get values or this execution_id - - [$testplan_id]: null -> get values for any tesplan to with testcase is linked - !is_null -> get values only for this testplan. - - [$tproject_id] - [$formatOptions] - [$link_id]: default null - scope='testplan_design'. - link_id=testplan_tcversions.id this value is also part of key - to access CF values on new table that hold values assigned - to CF used on the 'tesplan_design' scope. - - BUGID 3431 - scope='design'. - link_id=tcversion_id - - - - - returns: html string - - */ - function html_table_of_custom_field_values($id,$scope='design', - $filters=null,$execution_id=null, - $testplan_id=null,$tproject_id = null, - $formatOptions=null,$link_id=null) - { - $label_css_style = ' class="labelHolder" '; - $value_css_style = ' '; - - $add_table=true; - $table_style=''; - if (!is_null($formatOptions)) { - $label_css_style = isset($formatOptions['label_css_style']) ? - $formatOptions['label_css_style'] : $label_css_style; - - $value_css_style = isset($formatOptions['value_css_style']) ? - $formatOptions['value_css_style'] : $value_css_style; - - $add_table = isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; - $table_style = isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; - } - - $cf_smarty = ''; - - $location = null; // no filter - $filterKey='location'; - if( isset($filters[$filterKey]) - && !is_null($filters[$filterKey]) ) { - $location = $filters[$filterKey]; - } - - switch($scope) { - case 'design': - $cf_map = $this->get_linked_cfields_at_design($id,$link_id,null,$filters,$tproject_id); - break; - - case 'testplan_design': - $cf_map = $this->get_linked_cfields_at_testplan_design($id,null,$filters,$link_id, - $testplan_id,$tproject_id); - break; - - case 'execution': - $cf_map = $this->get_linked_cfields_at_execution($id,null,$filters,$execution_id, - $testplan_id,$tproject_id,$location); - break; - } - - if (!is_null($cf_map)) { - foreach ($cf_map as $cf_id => $cf_info) { - // if user has assigned a value, then node_id is not null - if(isset($cf_info['node_id']) || - $this->cfg->cfield->show_custom_fields_without_value) { - // true => do not create input in audit log - $label = str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true)); - - $cf_smarty .= " " . htmlspecialchars($label) . ":" . - "" . - $this->cfield_mgr->string_custom_field_value($cf_info,$id) . - "\n"; - } - } - - if( (trim($cf_smarty) != "") && $add_table) { - $cf_smarty = "" . $cf_smarty . "
    "; - } - } - return $cf_smarty; - } // function end - - - /* - function: get_linked_cfields_at_execution - - - args: $id - [$parent_id] - [$show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - 0 or null -> don't filter - //@TODO - 20090718 - franciscom - // this filter has any sense ? - // review and remove if needed - - - [$execution_id]: null -> get values for all executions availables for testcase - !is_null -> only get values or this execution_id - - [$testplan_id]: null -> get values for any tesplan to with testcase is linked - !is_null -> get values only for this testplan. - - [$tproject_id]: - - returns: hash - key: custom field id - value: map with custom field definition, with keys: - - id: custom field id - name - label - type - possible_values - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - - */ - function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null, - $execution_id=null,$testplan_id=null, - $tproject_id = null, $location=null) - { - $thisMethod=__FUNCTION__; - if (!$tproject_id) - { - $tproject_id = $this->getTestProjectFromTestCase($id,$parent_id); - } - - // VERY IMPORTANT WARNING: - // I'm setting node type to test case, but $id is the tcversion_id, because - // execution data is related to tcversion NO testcase - // - $cf_map = $this->cfield_mgr->$thisMethod($tproject_id,self::ENABLED,'testcase', - $id,$execution_id,$testplan_id,'id',$location); - return $cf_map; - } - - - /* - function: copy_cfields_design_values - Get all cfields linked to any testcase of this testproject - with the values presents for $from_id, testcase we are using as - source for our copy. - - args: source: map('id' => testcase id, 'tcversion_id' => testcase id) - destination: map('id' => testcase id, 'tcversion_id' => testcase id) - - returns: - - - - */ - function copy_cfields_design_values($source,$destination) { - // Get all cfields linked to any testcase of this test project - // with the values presents for $from_id, testcase we are using as - // source for our copy - $cfmap_from = $this->get_linked_cfields_at_design($source['id'],$source['tcversion_id']); - - $cfield=null; - if( !is_null($cfmap_from) ) { - foreach($cfmap_from as $key => $value) { - $cfield[$key]=array("type_id" => $value['type'], "cf_value" => $value['value']); - } - } - $this->cfield_mgr->design_values_to_db($cfield,$destination['tcversion_id'],null,'tcase_copy_cfields'); - } - - - /* - function: get_linked_cfields_at_testplan_design - - - args: $id - [$parent_id] - - [$filters]:default: null - - map with keys: - - [show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - include ONLY custom fields that can be viewed - while user is execution testcases. - - 0 or null -> don't filter - - [show_on_testplan_design]: default: null - 1 -> filter on field show_on_testplan_design=1 - include ONLY custom fields that can be viewed - while user is designing test plan. - - 0 or null -> don't filter - - More comments/instructions on cfield_mgr->get_linked_cfields_at_design() - - [$link_id]: - - [$testplan_id]: null -> get values for any tesplan to with testcase is linked - !is_null -> get values only for this testplan. - - returns: hash - key: custom field id - value: map with custom field definition, with keys: - - id: custom field id - name - label - type - possible_values - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - - - */ - function get_linked_cfields_at_testplan_design($id,$parent_id=null,$filters=null, - $link_id=null,$testplan_id=null,$tproject_id = null) - { - if (!$tproject_id) - { - $tproject_id = $this->getTestProjectFromTestCase($id,$parent_id); - } - - // Warning: - // I'm setting node type to test case, but $id is the tcversion_id, because - // link data is related to tcversion NO testcase - // - $cf_map = $this->cfield_mgr->get_linked_cfields_at_testplan_design($tproject_id,self::ENABLED,'testcase', - $id,$link_id,$testplan_id); - return $cf_map; - } - - - /** - * returns map with key: - * verbose location (see custom field class $locations) - * value: array with fixed key 'location' - * value: location code - * - */ - function buildCFLocationMap() { - $ret = $this->cfield_mgr->buildLocationMap('testcase'); - return $ret; - } - - - /** - * given a set of test cases, will return a map with - * test suites name that form test case path to root test suite. - * - * example: - * - * communication devices [ID 4] - * |__ Subspace channels [ID 20] - * | - * |__ TestCase100 - * | - * |__ short range devices [ID 21] - * |__ TestCase1 - * |__ TestCase2 - * - * if test case set: TestCase100,TestCase1 - * - * 4 Communications - * 20 Communications/Subspace channels - * 21 Communications/Subspace channels/short range devices - * - * - * returns map with key: test suite id - * value: test suite path to root - * - * - */ - function getPathLayered($tcaseSet, $opt=null) { - - static $tsuiteMgr; - if( !$tsuiteMgr ) { - $tsuiteMgr = new testsuite($this->db); - } - - $xtree=null; - - $options = array('getTSuiteKeywords' => false); - $options = array_merge($options, (array)$opt); - - $idSet = (array)$tcaseSet; - foreach($idSet as $item) { - $path_info = $this->tree_manager->get_path($item); - $testcase = end($path_info); - - // This check is useful when you have several test cases with same parent test suite - if( !isset($xtree[$testcase['parent_id']]['value']) ) { - $level=0; - - foreach($path_info as $elem) { - $level++; - $prefix = isset($xtree[$elem['parent_id']]['value']) ? ($xtree[$elem['parent_id']]['value'] . '/') : ''; - if( $elem['node_table'] == 'testsuites' ) { - $xtree[$elem['id']]['value'] = $prefix . $elem['name']; - $xtree[$elem['id']]['level']=$level; - $xtree[$elem['id']]['data_management'] = null; - } - } - } - - if( null != $xtree && $options['getTSuiteKeywords'] ) { - $tsSet = array_keys($xtree); - $opkw = array('output' => 'kwname'); - $fkw = array('keywordsLikeStart' => '@#'); - $iset = (array) $tsuiteMgr->getTSuitesFilteredByKWSet($tsSet,$opkw,$fkw); - - foreach( $iset as $tsuite_id => $elem ) { - foreach( $elem as $e ) { - if( null != $e ) { - $xtree[$tsuite_id]['data_management'][$e['keyword']] = $e['dyn_string']; - } - } - } - } - } - return $xtree; - } // getPathLayered($tcaseSet) - - - - /** - * - * - */ - function getPathTopSuite($tcaseSet) - { - $xtmas=null; - foreach($tcaseSet as $item) - { - $path_info = $this->tree_manager->get_path($item); - $top = current($path_info); - $xtmas[$item] = array( 'name' => $top['name'], 'id' => $top['id']); - } - return $xtmas; - } // getPathTopSuite($tcaseSet) - - - - /* - function: getByPathName - pathname format - Test Project Name::SuiteName::SuiteName::...::Test case name - - args: $pathname - returns: hash - */ - function getByPathName($pathName,$pathSeparator='::') - { - $recordset = null; - $retval=null; - - // First get root -> test project name and leaf => test case name - $parts = explode($pathSeparator,$pathName); - $partsQty = count($parts); - $tprojectName = $parts[0]; - $tsuiteName = $parts[$partsQty-2]; - $tcaseName = end($parts); - - // get all testcases on test project with this name and parent test suite - $recordset = $this->get_by_name($tcaseName, $tsuiteName ,$tprojectName); - if( !is_null($recordset) && count($recordset) > 0 ) - { - foreach($recordset as $value) - { - $dummy = $this->tree_manager->get_full_path_verbose($value['id']); - $sx = implode($pathSeparator,current($dummy)) . $pathSeparator . $tcaseName; - if( strcmp($pathName,$sx ) == 0 ) - { - $retval = $value; - break; - } - } - } - return $retval; - } - - /** - * - * - */ - function buildDirectWebLink($base_href,$id,$tproject_id=null) - { - list($external_id,$prefix,$glue,$tc_number) = $this->getExternalID($id,$tproject_id); - - $dl = $base_href . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . - '&item=testcase&id=' . urlencode($external_id); - return $dl; - } - - /** - * - * - */ - function getExternalID($id,$tproject_id=null,$prefix=null) - { - static $root; - static $tcase_prefix; - - if( is_null($prefix) ) - { - if( is_null($root) || ($root != $tproject_id) ) - { - list($tcase_prefix,$root) = $this->getPrefix($id,$tproject_id); - } - } - else - { - $tcase_prefix = $prefix; - } - $info = $this->get_last_version_info($id, array('output' => 'minimun')); - if (is_null($info)) { - return []; - } - - $external = $info['tc_external_id']; - $identity = $tcase_prefix . $this->cfg->testcase->glue_character . $external; - return array($identity,$tcase_prefix,$this->cfg->testcase->glue_character,$external); - } - - - - /** - * returns just name, tc_external_id, version. - * this info is normally enough for user feednack. - * - * @param int $id test case id - * @param array $accessVersionBy 'number' => contains test case version number - * 'id' => contains test case version ID - * - * @param array moreFields -> fields from tcversions table - * - * @return array with one element with keys: name,version,tc_external_id - */ - function get_basic_info($id,$accessVersionBy,$moreFields=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $additionalFields = ''; - if ($moreFields != null) { - $additionalFields = "," . implode(",",$moreFields); - } - - $sql = "/* $debugMsg */ " . - " SELECT NH_TCASE.id, NH_TCASE.name, TCV.version, TCV.tc_external_id, " . - " TCV.id AS tcversion_id, TCV.status $additionalFields" . - " FROM {$this->tables['nodes_hierarchy']} NH_TCASE " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TCASE.id" . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id "; - - $accessBy = array('number' => 'version', 'id' => 'id'); - $where_clause = ''; - foreach( $accessBy as $key => $field) - { - if( isset($accessVersionBy[$key]) ) - { - $where_clause = " WHERE TCV.{$field} = " . intval($accessVersionBy[$key]) ; - break; - } - } - $where_clause .= " AND NH_TCASE .id = {$id} "; - $sql .= $where_clause; - $result = $this->db->get_recordset($sql); - return $result; - } - - - - - - /** - * - * - */ - function create_step($tcversion_id,$step_number,$actions,$expected_results, - $execution_type=TESTCASE_EXECUTION_TYPE_MANUAL) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array(); - - // defensive programming - $dummy = $this->db->prepare_int($execution_type); - $dummy = (isset($this->execution_types[$dummy])) ? $dummy : TESTCASE_EXECUTION_TYPE_MANUAL; - - $item_id = $this->tree_manager->new_node($tcversion_id,$this->node_types_descr_id['testcase_step']); - - $k2e = array('actions','expected_results'); - $item = new stdClass(); - $item->actions = $actions; - $item->expected_results = $expected_results; - $this->CKEditorCopyAndPasteCleanUp($item,$k2e); - - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['tcsteps']} " . - " (id,step_number,actions,expected_results,execution_type) " . - " VALUES({$item_id},{$step_number},'" . - $this->db->prepare_string($item->actions) . "','" . - $this->db->prepare_string($item->expected_results) . "', " . - $this->db->prepare_int($dummy) . ")"; - - $result = $this->db->exec_query($sql); - $ret = array('msg' => 'ok', 'id' => $item_id, 'status_ok' => 1, - 'sql' => $sql); - if (!$result) - { - $ret['msg'] = $this->db->error_msg(); - $ret['status_ok']=0; - $ret['id']=-1; - } - return $ret; - } - - /** - * - * - */ - function get_steps($tcversion_id,$step_number=0,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array( 'fields2get' => '*', 'accessKey' => null, - 'renderGhostSteps' => true, 'renderImageInline' => true); - - $my['options'] = array_merge($my['options'], (array)$options); - - $step_filter = $step_number > 0 ? " AND step_number = {$step_number} " : ""; - $safe_tcversion_id = $this->db->prepare_int($tcversion_id); - - // build - $f2g = "TCSTEPS.{$my['options']['fields2get']}"; - if($my['options']['fields2get'] != '*') { - $sof = explode(',',$my['options']['fields2get']); - foreach($sof as &$ele) { - $ele = 'TCSTEPS.' . $ele; - } - $f2g = implode(',',$sof); - } - $sql = "/* $debugMsg */ " . - " SELECT {$f2g} " . - " FROM {$this->tables['tcsteps']} TCSTEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . - " ON NH_STEPS.id = TCSTEPS.id " . - " WHERE NH_STEPS.parent_id = {$safe_tcversion_id} {$step_filter} ORDER BY step_number"; - - if( is_null($my['options']['accessKey']) ) { - $result = $this->db->get_recordset($sql); - } else { - $result = $this->db->fetchRowsIntoMap($sql,$my['options']['accessKey']); - } - - if(!is_null($result) && $my['options']['renderGhostSteps']) { - $sql = "/* $debugMsg */ - SELECT summary,preconditions - FROM {$this->tables['tcversions']} TCV - WHERE TCV.id = $safe_tcversion_id "; - $scan = current($this->db->get_recordset($sql)); - - $xrayScan = null; - foreach($scan as $fn => $vf) { - if( trim($vf) != '' ) { - if( strpos($vf,self::NAME_PHOPEN) !== FALSE && - strpos($vf,self::NAME_PHCLOSE) !== FALSE ) { - $xrayScan[$fn] = $vf; - } - } - } - $this->renderGhostSteps($result, $xrayScan); - } - - if(!is_null($result) && $my['options']['renderImageInline']) { - // for attachments we need the Test Case Version ID - // (time ago we used the Test Case ID) - $k2l = count($result); - $gaga = array('actions','expected_results'); - for($idx=0; $idx < $k2l; $idx++) { - $this->renderImageAttachments($tcversion_id,$result[$idx],$gaga); - } - } - - return $result; - } - - /** - * - */ - function getStepsSimple($tcversion_id,$step_number=0,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('fields2get' => 'TCSTEPS.*', 'accessKey' => null, - 'renderGhostSteps' => true, 'renderImageInline' => true); - $my['options'] = array_merge($my['options'], (array)$options); - - $step_filter = $step_number > 0 ? " AND step_number = {$step_number} " : ""; - $safe_tcversion_id = $this->db->prepare_int($tcversion_id); - - $sql = "/* $debugMsg */ " . - " SELECT {$my['options']['fields2get']} " . - " FROM {$this->tables['tcsteps']} TCSTEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . - " ON NH_STEPS.id = TCSTEPS.id " . - " WHERE NH_STEPS.parent_id = {$safe_tcversion_id} {$step_filter} ORDER BY step_number"; - - if( is_null($my['options']['accessKey']) ) - { - $result = $this->db->get_recordset($sql); - } - else - { - $result = $this->db->fetchRowsIntoMap($sql,$my['options']['accessKey']); - } - - return $result; - } - - - - /** - * - * - */ - function get_step_by_id($step_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT TCSTEPS.* FROM {$this->tables['tcsteps']} TCSTEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . - " ON NH_STEPS.id = TCSTEPS.id " . - " WHERE TCSTEPS.id = {$step_id} "; - $result = $this->db->get_recordset($sql); - - return is_null($result) ? $result : $result[0]; - } - - - function get_step_numbers($tcversion_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT TCSTEPS.id, TCSTEPS.step_number FROM {$this->tables['tcsteps']} TCSTEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . - " ON NH_STEPS.id = TCSTEPS.id " . - " WHERE NH_STEPS.parent_id = {$tcversion_id} ORDER BY step_number"; - - $result = $this->db->fetchRowsIntoMap($sql,'step_number'); - return $result; - } - - - - /** - * - * - */ - function get_latest_step_number($tcversion_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT MAX(TCSTEPS.step_number) AS max_step FROM {$this->tables['tcsteps']} TCSTEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . - " ON NH_STEPS.id = TCSTEPS.id " . - " WHERE NH_STEPS.parent_id = {$tcversion_id} "; - - $result = $this->db->get_recordset($sql); - $max_step = (!is_null($result) && isset($result[0]['max_step']) )? $result[0]['max_step'] : 0; - return $max_step; - } - - - /** - * - * $step_id can be an array - */ - function delete_step_by_id($step_id) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $idSet = implode(',',(array)$step_id); - - // Try to delete any children entity - // Execution Attachment - // Execution result - // - $dummy = " /* $debugMsg */ SELECT id FROM - {$this->tables['attachments']} - WHERE fk_table = 'execution_tcsteps' + WHERE id = {$tcversion_id} "; + + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /* + * function: update_order + * + * args : id: testcase id + * order + * + * returns: - + * + */ + private function updateOrder($id, $order) + { + $result = $this->tree_manager->change_order_bulk(array( + $order => $id + )); + return $result ? 1 : 0; + } + + /* + * function: update_external_id + * + * args : id: testcase id + * external_id + * + * returns: - + * + */ + private function updateExternalID($id, $external_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ UPDATE {$this->tables['tcversions']} " . + " SET tc_external_id={$external_id} " . " WHERE id IN (" . + " SELECT id FROM {$this->tables['nodes_hierarchy']} WHERE parent_id={$id} ) "; + + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /** + * Copy attachments from source testcase to target testcase + */ + private function copyAttachments($source_id, $target_id) + { + return $this->attachmentRepository->copyAttachments($source_id, + $target_id, $this->attachmentTableName); + } + + /** + * copyReqAssignmentTo + * copy requirement assignments for $from test case id to $to test case id + * + * mappings is only useful when source_id and target_id do not belong to same Test Project. + */ + private function copyReqAssignmentTo($from, $to, $mappings, $userID) + { + static $req_mgr; + if (is_null($req_mgr)) { + $req_mgr = new requirement_mgr($this->db); + } + + $itemSet = $req_mgr->get_all_for_tcase($from); + if (! is_null($itemSet)) { + $loop2do = count($itemSet); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if (isset($mappings[$itemSet[$idx]['id']])) { + $items[$idx] = $mappings[$itemSet[$idx]['id']]; + } else { + $items[$idx] = $itemSet[$idx]['id']; + } + } + $req_mgr->assign_to_tcase($items, $to, $userID); + } + } + + /** + */ + private function getShowViewerActions($mode) + { + // fine grain control of operations + $viewerActions = new stdClass(); + $viewerActions->edit = 'no'; + $viewerActions->delete_testcase = 'no'; + $viewerActions->delete_version = 'no'; + $viewerActions->deactivate = 'no'; + $viewerActions->create_new_version = 'no'; + $viewerActions->export = 'no'; + $viewerActions->move = 'no'; + $viewerActions->copy = 'no'; + $viewerActions->add2tplan = 'no'; + $viewerActions->freeze = 'no'; + $viewerActions->updTplanTCV = 'no'; + + switch ($mode) { + case 'editOnExec': + $viewerActions->edit = 'yes'; + $viewerActions->create_new_version = 'yes'; + $viewerActions->updTplanTCV = 'yes'; + break; + + case 'editDisabled': + break; + + default: + foreach ($viewerActions as $key => $value) { + $viewerActions->$key = 'yes'; + } + break; + } + return $viewerActions; + } + + /** + * given an executio id delete execution and related data. + */ + public function deleteExecution($executionID) + { + $whereClause = " WHERE execution_id = {$executionID} "; + $sql = array( + "DELETE FROM {$this->tables['execution_bugs']} {$whereClause} ", + "DELETE FROM {$this->tables['cfield_execution_values']} {$whereClause} ", + "DELETE FROM {$this->tables['executions']} WHERE id = {$executionID}" + ); + + foreach ($sql as $the_stm) { + $result = $this->db->exec_query($the_stm); + if (! $result) { + break; + } + } + } + + // --------------------------------------------------------------------------------------- + // Custom field related functions + // --------------------------------------------------------------------------------------- + + /* + * function: get_linked_cfields_at_design + * Get all linked custom fields that must be available at design time. + * Remember that custom fields are defined at system wide level, and + * has to be linked to a testproject, in order to be used. + * + * args: id: testcase id + * tcversion_id: testcase version id ---- BUGID 3431 + * [parent_id]: node id of parent testsuite of testcase. + * need to understand to which testproject the testcase belongs. + * this information is vital, to get the linked custom fields. + * Presence /absence of this value changes starting point + * on procedure to build tree path to get testproject id. + * + * null -> use testcase_id as starting point. + * !is_null -> use this value as starting point. + * + * [$filters]:default: null + * + * map with keys: + * + * [show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * include ONLY custom fields that can be viewed + * while user is execution testcases. + * + * 0 or null -> don't filter + * + * [show_on_testplan_design]: default: null + * 1 -> filter on field show_on_testplan_design=1 + * include ONLY custom fields that can be viewed + * while user is designing test plan. + * + * 0 or null -> don't filter + * + * [location] new concept used to define on what location on screen + * custom field will be designed. + * Initally used with CF available for Test cases, to + * implement pre-requisites. + * null => no filtering + * + * + * More comments/instructions on cfield_mgr->get_linked_cfields_at_design() + * + * returns: map/hash + * key: custom field id + * value: map with custom field definition and value assigned for choosen testcase, + * with following keys: + * + * id: custom field id + * name + * label + * type: custom field type + * possible_values: for custom field + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * value: value assigned to custom field for this testcase + * null if for this testcase custom field was never edited. + * + * node_id: testcase id + * null if for this testcase, custom field was never edited. + * + * + * rev : + * 20070302 - check for $id not null, is not enough, need to check is > 0 + * + */ + public function get_linked_cfields_at_design($id, $tcversion_id, + $parent_id = null, $filters = null, $tproject_id = null) + { + if (! $tproject_id) { + $tproject_id = $this->getTestProjectFromTestCase($id, $parent_id); + } + + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + self::ENABLED, $filters, 'testcase', $tcversion_id); + } + + /* + * function: getTestProjectFromTestCase + * + * args: id: testcase id + * [parent_id]: node id of parent testsuite of testcase. + * need to understand to which testproject the testcase belongs. + * this information is vital, to get the linked custom fields. + * Presence /absence of this value changes starting point + * on procedure to build tree path to get testproject id. + * + * null -> use testcase_id as starting point. + * !is_null -> use this value as starting point. + */ + public function getTestProjectFromTestCase($id, $parent_id = null) + { + $the_path = $this->tree_manager->get_path( + (! empty($id)) ? $id : $parent_id); + return (! empty($the_path)) ? $the_path[0]['parent_id'] : $parent_id; + } + + /* + * function: get_testproject + * Given a testcase id get node id of testproject to which testcase belongs. + * args :id: testcase id + * + * returns: testproject id + */ + public function get_testproject($id) + { + $a_path = $this->tree_manager->get_path($id); + return $a_path[0]['parent_id']; + } + + /* + * function: html_table_of_custom_field_inputs + * Return html code, implementing a table with custom fields labels + * and html inputs, for choosen testcase. + * Used to manage user actions on custom fields values. + * + * + * args: $id: IMPORTANT: + * we can receive 0 in this arguments and THERE IS NOT A problem + * if parent_id arguments has a value. + * Because argument id or parent_id are used to understand what is + * testproject where test case belong, in order to get custom fields + * assigned/linked to test project. + * + * + * [parent_id]: node id of parent testsuite of testcase. + * need to undertad to which testproject the testcase belongs. + * this information is vital, to get the linked custom fields. + * Presence /absence of this value changes starting point + * on procedure to build tree path to get testproject id. + * + * null -> use testcase_id as starting point. + * !is_null -> use this value as starting point. + * + * [$scope]: 'design' -> use custom fields that can be used at design time (specification) + * 'execution' -> use custom fields that can be used at execution time. + * + * [$name_suffix]: must start with '_' (underscore). + * Used when we display in a page several items + * example: + * during test case execution, several test cases + * during testplan design (assign test case to testplan). + * + * that have the same custom fields. + * In this kind of situation we can use the item id as name suffix. + * + * [link_id]: default null + * scope='testplan_design'. + * link_id=testplan_tcversions.id this value is also part of key + * to access CF values on new table that hold values assigned + * to CF used on the 'tesplan_design' scope. + * + * scope='execution' + * link_id=execution id + * + * BUGID 3431 + * scope='design' + * link_id=tcversion id + * + * + * [tplan_id]: default null + * used when scope='execution' and YOU NEED to get input with value + * related to link_id + * + * [tproject_id]: default null + * used to speedup feature when this value is available. + * + * + * returns: html string + * + * rev: 20080811 - franciscom - BUGID 1650 (REQ) + * + * BUGID 3431 - + * + */ + public function html_table_of_custom_field_inputs($id, $parent_id = null, + $scope = 'design', $name_suffix = '', $link_id = null, $tplan_id = null, + $tproject_id = null, $filters = null, $input_values = null) + { + $cf_smarty = ''; + $cf_scope = trim($scope); + $method_name = 'get_linked_cfields_at_' . $cf_scope; + + switch ($cf_scope) { + case 'testplan_design': + $cf_map = $this->$method_name($id, $parent_id, null, $link_id, + null, $tproject_id); + break; + + case 'design': + $cf_map = $this->$method_name($id, $link_id, $parent_id, + $filters, $tproject_id); + break; + + case 'execution': + $cf_map = $this->$method_name($id, $parent_id, null, $link_id, + $tplan_id, $tproject_id); + break; + } + + if (! is_null($cf_map)) { + $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map, + $name_suffix, $input_values); + } + return $cf_smarty; + } + + /** + * Just a Wrapper to improve, sometimes code layout + */ + public function htmlTableOfCFValues($id, $context, $filters = null, + $formatOptions = null) + { + + // $context + $ctx = array( + 'scope' => 'design', + 'execution_id' => null, + 'testplan_id' => null, + 'tproject_id' => null, + 'link_id' => null + ); + + $ctx = array_merge($ctx, $context); + extract($ctx); + + return $this->html_table_of_custom_field_values($id, $scope, $filters, + $execution_id, $testplan_id, $tproject_id, $formatOptions, $link_id); + } + + /* + * function: html_table_of_custom_field_values + * Return html code, implementing a table with custom fields labels + * and custom fields values, for choosen testcase. + * You can think of this function as some sort of read only version + * of html_table_of_custom_field_inputs. + * + * + * args: $id: Very Important!!! + * scope='design' -> this is a testcase id + * scope='execution' -> this is a testcase VERSION id + * scope='testplan_design' -> this is a testcase VERSION id + * + * [$scope]: 'design' -> use custom fields that can be used at design time (specification) + * 'execution' -> use custom fields that can be used at execution time. + * 'testplan_design' + * + * [$filters]:default: null + * + * map with keys: + * + * [show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * include ONLY custom fields that can be viewed + * while user is execution testcases. + * + * 0 or null -> don't filter + * + * [show_on_testplan_design]: default: null + * 1 -> filter on field show_on_testplan_design=1 + * include ONLY custom fields that can be viewed + * while user is designing test plan. + * + * 0 or null -> don't filter + * + * [location] new concept used to define on what location on screen + * custom field will be designed. + * Initally used with CF available for Test cases, to + * implement pre-requisites. + * null => no filtering + * + * More comments/instructions on cfield_mgr->get_linked_cfields_at_design() + * + * + * [$execution_id]: null -> get values for all executions availables for testcase + * !is_null -> only get values or this execution_id + * + * [$testplan_id]: null -> get values for any tesplan to with testcase is linked + * !is_null -> get values only for this testplan. + * + * [$tproject_id] + * [$formatOptions] + * [$link_id]: default null + * scope='testplan_design'. + * link_id=testplan_tcversions.id this value is also part of key + * to access CF values on new table that hold values assigned + * to CF used on the 'tesplan_design' scope. + * + * BUGID 3431 + * scope='design'. + * link_id=tcversion_id + * + * + * + * + * returns: html string + * + */ + public function html_table_of_custom_field_values($id, $scope = 'design', + $filters = null, $execution_id = null, $testplan_id = null, + $tproject_id = null, $formatOptions = null, $link_id = null) + { + $label_css_style = ' class="labelHolder" '; + $value_css_style = ' '; + + $add_table = true; + $table_style = ''; + if (! is_null($formatOptions)) { + $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; + + $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; + + $add_table = isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; + $table_style = isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; + } + + $cf_smarty = ''; + + $location = null; // no filter + $filterKey = 'location'; + if (isset($filters[$filterKey]) && ! is_null($filters[$filterKey])) { + $location = $filters[$filterKey]; + } + + switch ($scope) { + case 'design': + $cf_map = $this->get_linked_cfields_at_design($id, $link_id, + null, $filters, $tproject_id); + break; + + case 'testplan_design': + $cf_map = $this->get_linked_cfields_at_testplan_design($id, null, + $filters, $link_id, $testplan_id, $tproject_id); + break; + + case 'execution': + $cf_map = $this->get_linked_cfields_at_execution($id, null, + $filters, $execution_id, $testplan_id, $tproject_id, + $location); + break; + } + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + // if user has assigned a value, then node_id is not null + if (isset($cf_info['node_id']) || + $this->cfg->cfield->show_custom_fields_without_value) { + // true => do not create input in audit log + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, true)); + + $cf_smarty .= " " . + htmlspecialchars($label) . ":" . + "" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $id) . "\n"; + } + } + + if ((trim($cf_smarty) != "") && $add_table) { + $cf_smarty = "" . $cf_smarty . "
    "; + } + } + return $cf_smarty; + } + + // function end + + /* + * function: get_linked_cfields_at_execution + * + * + * args: $id + * [$parent_id] + * [$show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * 0 or null -> don't filter + * //@TODO - 20090718 - franciscom + * // this filter has any sense ? + * // review and remove if needed + * + * + * [$execution_id]: null -> get values for all executions availables for testcase + * !is_null -> only get values or this execution_id + * + * [$testplan_id]: null -> get values for any tesplan to with testcase is linked + * !is_null -> get values only for this testplan. + * + * [$tproject_id]: + * + * returns: hash + * key: custom field id + * value: map with custom field definition, with keys: + * + * id: custom field id + * name + * label + * type + * possible_values + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * + */ + public function get_linked_cfields_at_execution($id, $parent_id = null, + $show_on_execution = null, $execution_id = null, $testplan_id = null, + $tproject_id = null, $location = null) + { + $thisMethod = __FUNCTION__; + if (! $tproject_id) { + $tproject_id = $this->getTestProjectFromTestCase($id, $parent_id); + } + + // VERY IMPORTANT WARNING: + // I'm setting node type to test case, but $id is the tcversion_id, because + // execution data is related to tcversion NO testcase + return $this->cfield_mgr->$thisMethod($tproject_id, self::ENABLED, + 'testcase', $id, $execution_id, $testplan_id, 'id', $location); + } + + /* + * function: copyCfieldsDesignValues + * Get all cfields linked to any testcase of this testproject + * with the values presents for $from_id, testcase we are using as + * source for our copy. + * + * args: source: map('id' => testcase id, 'tcversion_id' => testcase id) + * destination: map('id' => testcase id, 'tcversion_id' => testcase id) + * + */ + public function copyCfieldsDesignValues($source, $destination) + { + // Get all cfields linked to any testcase of this test project + // with the values presents for $from_id, testcase we are using as + // source for our copy + $cfmap_from = $this->get_linked_cfields_at_design($source['id'], + $source['tcversion_id']); + + $cfield = null; + if (! is_null($cfmap_from)) { + foreach ($cfmap_from as $key => $value) { + $cfield[$key] = array( + "type_id" => $value['type'], + "cf_value" => $value['value'] + ); + } + } + $this->cfield_mgr->design_values_to_db($cfield, + $destination['tcversion_id'], null, 'tcase_copy_cfields'); + } + + /* + * function: get_linked_cfields_at_testplan_design + * + * + * args: $id + * [$parent_id] + * + * [$filters]:default: null + * + * map with keys: + * + * [show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * include ONLY custom fields that can be viewed + * while user is execution testcases. + * + * 0 or null -> don't filter + * + * [show_on_testplan_design]: default: null + * 1 -> filter on field show_on_testplan_design=1 + * include ONLY custom fields that can be viewed + * while user is designing test plan. + * + * 0 or null -> don't filter + * + * More comments/instructions on cfield_mgr->get_linked_cfields_at_design() + * + * [$link_id]: + * + * [$testplan_id]: null -> get values for any tesplan to with testcase is linked + * !is_null -> get values only for this testplan. + * + * returns: hash + * key: custom field id + * value: map with custom field definition, with keys: + * + * id: custom field id + * name + * label + * type + * possible_values + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * + * + */ + public function get_linked_cfields_at_testplan_design($id, $parent_id = null, + $filters = null, $link_id = null, $testplan_id = null, + $tproject_id = null) + { + if (! $tproject_id) { + $tproject_id = $this->getTestProjectFromTestCase($id, $parent_id); + } + + // Warning: + // I'm setting node type to test case, but $id is the tcversion_id, because + // link data is related to tcversion NO testcase + return $this->cfield_mgr->get_linked_cfields_at_testplan_design( + $tproject_id, self::ENABLED, 'testcase', $id, $link_id, $testplan_id); + } + + /** + * returns map with key: + * verbose location (see custom field class $locations) + * value: array with fixed key 'location' + * value: location code + */ + public function buildCFLocationMap() + { + return $this->cfield_mgr->buildLocationMap('testcase'); + } + + /** + * given a set of test cases, will return a map with + * test suites name that form test case path to root test suite. + * + * example: + * + * communication devices [ID 4] + * |__ Subspace channels [ID 20] + * | + * |__ TestCase100 + * | + * |__ short range devices [ID 21] + * |__ TestCase1 + * |__ TestCase2 + * + * if test case set: TestCase100,TestCase1 + * + * 4 Communications + * 20 Communications/Subspace channels + * 21 Communications/Subspace channels/short range devices + * + * + * returns map with key: test suite id + * value: test suite path to root + */ + public function getPathLayered($tcaseSet, $opt = null) + { + static $tsuiteMgr; + if (! $tsuiteMgr) { + $tsuiteMgr = new testsuite($this->db); + } + + $xtree = null; + + $options = array( + 'getTSuiteKeywords' => false + ); + $options = array_merge($options, (array) $opt); + + $idSet = (array) $tcaseSet; + foreach ($idSet as $item) { + $path_info = $this->tree_manager->get_path($item); + $testcase = end($path_info); + + // This check is useful when you have several test cases with same parent test suite + if (! isset($xtree[$testcase['parent_id']]['value'])) { + $level = 0; + + foreach ($path_info as $elem) { + $level ++; + $prefix = isset($xtree[$elem['parent_id']]['value']) ? ($xtree[$elem['parent_id']]['value'] . + '/') : ''; + if ($elem['node_table'] == 'testsuites') { + $xtree[$elem['id']]['value'] = $prefix . $elem['name']; + $xtree[$elem['id']]['level'] = $level; + $xtree[$elem['id']]['data_management'] = null; + } + } + } + + if (null != $xtree && $options['getTSuiteKeywords']) { + $tsSet = array_keys($xtree); + $opkw = array( + 'output' => 'kwname' + ); + $fkw = array( + 'keywordsLikeStart' => '@#' + ); + $iset = (array) $tsuiteMgr->getTSuitesFilteredByKWSet($tsSet, + $opkw, $fkw); + + foreach ($iset as $tsuite_id => $elem) { + foreach ($elem as $e) { + if (null != $e) { + $xtree[$tsuite_id]['data_management'][$e['keyword']] = $e['dyn_string']; + } + } + } + } + } + return $xtree; + } + + // getPathLayered($tcaseSet) + + /** + */ + private function getPathTopSuite($tcaseSet) + { + $xtmas = null; + foreach ($tcaseSet as $item) { + $path_info = $this->tree_manager->get_path($item); + $top = current($path_info); + $xtmas[$item] = array( + 'name' => $top['name'], + 'id' => $top['id'] + ); + } + return $xtmas; + } + + // getPathTopSuite($tcaseSet) + + /* + * function: getByPathName + * pathname format + * Test Project Name::SuiteName::SuiteName::...::Test case name + * + * args: $pathname + * returns: hash + */ + public function getByPathName($pathName, $pathSeparator = '::') + { + $recordset = null; + $retval = null; + + // First get root -> test project name and leaf => test case name + $parts = explode($pathSeparator, $pathName); + $partsQty = count($parts); + $tprojectName = $parts[0]; + $tsuiteName = $parts[$partsQty - 2]; + $tcaseName = end($parts); + + // get all testcases on test project with this name and parent test suite + $recordset = $this->get_by_name($tcaseName, $tsuiteName, $tprojectName); + if (! empty($recordset)) { + foreach ($recordset as $value) { + $dummy = $this->tree_manager->get_full_path_verbose( + $value['id']); + $sx = implode($pathSeparator, current($dummy)) . $pathSeparator . + $tcaseName; + if (strcmp($pathName, $sx) == 0) { + $retval = $value; + break; + } + } + } + return $retval; + } + + /** + */ + public function buildDirectWebLink($base_href, $id, $tproject_id = null) + { + list ($external_id, $prefix, ,) = $this->getExternalID($id, $tproject_id); + + return $base_href . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . + '&item=testcase&id=' . urlencode($external_id); + } + + /** + */ + public function getExternalID($id, $tproject_id = null, $prefix = null) + { + static $root; + static $tcase_prefix; + + if (is_null($prefix)) { + if (is_null($root) || ($root != $tproject_id)) { + list ($tcase_prefix, $root) = $this->getPrefix($id, $tproject_id); + } + } else { + $tcase_prefix = $prefix; + } + $info = $this->getLastVersionInfo($id, array( + 'output' => 'minimun' + )); + if (is_null($info)) { + return []; + } + + $external = $info['tc_external_id']; + $identity = $tcase_prefix . $this->cfg->testcase->glue_character . + $external; + return array( + $identity, + $tcase_prefix, + $this->cfg->testcase->glue_character, + $external + ); + } + + /** + * returns just name, tc_external_id, version. + * this info is normally enough for user feednack. + * + * @param int $id + * test case id + * @param array $accessVersionBy + * 'number' => contains test case version number + * 'id' => contains test case version ID + * + * @param + * array moreFields -> fields from tcversions table + * + * @return array with one element with keys: name,version,tc_external_id + */ + public function get_basic_info($id, $accessVersionBy, $moreFields = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $additionalFields = ''; + if ($moreFields != null) { + $additionalFields = "," . implode(",", $moreFields); + } + + $sql = "/* $debugMsg */ " . + " SELECT NH_TCASE.id, NH_TCASE.name, TCV.version, TCV.tc_external_id, " . + " TCV.id AS tcversion_id, TCV.status $additionalFields" . + " FROM {$this->tables['nodes_hierarchy']} NH_TCASE " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TCASE.id" . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id "; + + $accessBy = array( + 'number' => 'version', + 'id' => 'id' + ); + $where_clause = ''; + foreach ($accessBy as $key => $field) { + if (isset($accessVersionBy[$key])) { + $where_clause = " WHERE TCV.{$field} = " . + intval($accessVersionBy[$key]); + break; + } + } + $where_clause .= " AND NH_TCASE .id = {$id} "; + $sql .= $where_clause; + return $this->db->get_recordset($sql); + } + + /** + */ + public function create_step($tcversion_id, $step_number, $actions, + $expected_results, $execution_type = TESTCASE_EXECUTION_TYPE_MANUAL) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $ret = array(); + + // defensive programming + $dummy = $this->db->prepare_int($execution_type); + $dummy = (isset($this->execution_types[$dummy])) ? $dummy : TESTCASE_EXECUTION_TYPE_MANUAL; + + $item_id = $this->tree_manager->new_node($tcversion_id, + $this->node_types_descr_id['testcase_step']); + + $k2e = array( + 'actions', + 'expected_results' + ); + $item = new stdClass(); + $item->actions = $actions; + $item->expected_results = $expected_results; + $this->ckEditorCopyAndPasteCleanUp($item, $k2e); + + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['tcsteps']} " . + " (id,step_number,actions,expected_results,execution_type) " . + " VALUES({$item_id},{$step_number},'" . + $this->db->prepare_string($item->actions) . "','" . + $this->db->prepare_string($item->expected_results) . "', " . + $this->db->prepare_int($dummy) . ")"; + + $result = $this->db->exec_query($sql); + $ret = array( + 'msg' => 'ok', + 'id' => $item_id, + 'status_ok' => 1, + 'sql' => $sql + ); + if (! $result) { + $ret['msg'] = $this->db->error_msg(); + $ret['status_ok'] = 0; + $ret['id'] = - 1; + } + return $ret; + } + + /** + */ + public function get_steps($tcversion_id, $step_number = 0, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['options'] = array( + 'fields2get' => '*', + 'accessKey' => null, + 'renderGhostSteps' => true, + 'renderImageInline' => true + ); + + $my['options'] = array_merge($my['options'], (array) $options); + + $step_filter = $step_number > 0 ? " AND step_number = {$step_number} " : ""; + $safe_tcversion_id = $this->db->prepare_int($tcversion_id); + + // build + $f2g = "TCSTEPS.{$my['options']['fields2get']}"; + if ($my['options']['fields2get'] != '*') { + $sof = explode(',', $my['options']['fields2get']); + foreach ($sof as &$ele) { + $ele = 'TCSTEPS.' . $ele; + } + $f2g = implode(',', $sof); + } + $sql = "/* $debugMsg */ " . " SELECT {$f2g} " . + " FROM {$this->tables['tcsteps']} TCSTEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . + " ON NH_STEPS.id = TCSTEPS.id " . + " WHERE NH_STEPS.parent_id = {$safe_tcversion_id} {$step_filter} ORDER BY step_number"; + + if (is_null($my['options']['accessKey'])) { + $result = $this->db->get_recordset($sql); + } else { + $result = $this->db->fetchRowsIntoMap($sql, + $my['options']['accessKey']); + } + + if (! is_null($result) && $my['options']['renderGhostSteps']) { + $sql = "/* $debugMsg */ + SELECT summary,preconditions + FROM {$this->tables['tcversions']} TCV + WHERE TCV.id = $safe_tcversion_id "; + $scan = current($this->db->get_recordset($sql)); + + $xrayScan = null; + foreach ($scan as $fn => $vf) { + if (trim($vf) != '' && strpos($vf, self::NAME_PHOPEN) !== false && + strpos($vf, self::NAME_PHCLOSE) !== false) { + $xrayScan[$fn] = $vf; + } + } + $this->renderGhostSteps($result, $xrayScan); + } + + if (! is_null($result) && $my['options']['renderImageInline']) { + // for attachments we need the Test Case Version ID + // (time ago we used the Test Case ID) + $k2l = count($result); + $gaga = array( + 'actions', + 'expected_results' + ); + for ($idx = 0; $idx < $k2l; $idx ++) { + $this->renderImageAttachments($tcversion_id, $result[$idx], + $gaga); + } + } + + return $result; + } + + /** + */ + public function getStepsSimple($tcversion_id, $step_number = 0, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['options'] = array( + 'fields2get' => 'TCSTEPS.*', + 'accessKey' => null, + 'renderGhostSteps' => true, + 'renderImageInline' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $step_filter = $step_number > 0 ? " AND step_number = {$step_number} " : ""; + $safe_tcversion_id = $this->db->prepare_int($tcversion_id); + + $sql = "/* $debugMsg */ " . " SELECT {$my['options']['fields2get']} " . + " FROM {$this->tables['tcsteps']} TCSTEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . + " ON NH_STEPS.id = TCSTEPS.id " . + " WHERE NH_STEPS.parent_id = {$safe_tcversion_id} {$step_filter} ORDER BY step_number"; + + if (is_null($my['options']['accessKey'])) { + $result = $this->db->get_recordset($sql); + } else { + $result = $this->db->fetchRowsIntoMap($sql, + $my['options']['accessKey']); + } + + return $result; + } + + /** + */ + public function get_step_by_id($step_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT TCSTEPS.* FROM {$this->tables['tcsteps']} TCSTEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . + " ON NH_STEPS.id = TCSTEPS.id " . " WHERE TCSTEPS.id = {$step_id} "; + $result = $this->db->get_recordset($sql); + + return is_null($result) ? $result : $result[0]; + } + + public function get_step_numbers($tcversion_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT TCSTEPS.id, TCSTEPS.step_number FROM {$this->tables['tcsteps']} TCSTEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . + " ON NH_STEPS.id = TCSTEPS.id " . + " WHERE NH_STEPS.parent_id = {$tcversion_id} ORDER BY step_number"; + + return $this->db->fetchRowsIntoMap($sql, 'step_number'); + } + + /** + */ + public function get_latest_step_number($tcversion_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT MAX(TCSTEPS.step_number) AS max_step FROM {$this->tables['tcsteps']} TCSTEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_STEPS " . + " ON NH_STEPS.id = TCSTEPS.id " . + " WHERE NH_STEPS.parent_id = {$tcversion_id} "; + + $result = $this->db->get_recordset($sql); + return (! is_null($result) && isset($result[0]['max_step'])) ? $result[0]['max_step'] : 0; + } + + /** + * $step_id can be an array + */ + public function delete_step_by_id($step_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $idSet = implode(',', (array) $step_id); + + // Try to delete any children entity + // Execution Attachment + // Execution result + // + $dummy = " /* $debugMsg */ SELECT id FROM + {$this->tables['attachments']} + WHERE fk_table = 'execution_tcsteps' AND fk_id IN ( SELECT id FROM {$this->tables['execution_tcsteps']} - WHERE tcstep_id IN ($idSet) )"; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - // Order is CRITIC due to Foreing Keys - $sqlSet = array(); - $sqlSet[] = "/* $debugMsg */ - DELETE FROM {$this->tables['execution_tcsteps']} - WHERE tcstep_id IN ($idSet)"; - - $whereClause = " WHERE id IN ($idSet) "; - $sqlSet[] = "/* $debugMsg */ DELETE FROM {$this->tables['tcsteps']} {$whereClause} "; - $sqlSet[] = "/* $debugMsg */ DELETE FROM {$this->tables['nodes_hierarchy']} " . - " {$whereClause} AND node_type_id = " . - $this->node_types_descr_id['testcase_step']; - - foreach($sqlSet as $sql) { - $this->db->exec_query($sql); - } - } - - - /** - * - * - * @internal revision - * BUGID 4207 - MSSQL - */ - function set_step_number($step_number) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - foreach($step_number as $step_id => $value) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['tcsteps']} " . - " SET step_number = {$value} WHERE id = {$step_id} "; - $this->db->exec_query($sql); - } - - } - - /** - * - * - */ - function update_step($step_id,$step_number,$actions,$expected_results,$execution_type) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array(); - - $k2e = array('actions','expected_results'); - $item = new stdClass(); - $item->actions = $actions; - $item->expected_results = $expected_results; - $this->CKEditorCopyAndPasteCleanUp($item,$k2e); - - $sql = "/* $debugMsg */ UPDATE {$this->tables['tcsteps']} " . - " SET step_number=" . $this->db->prepare_int($step_number) . "," . - " actions='" . $this->db->prepare_string($item->actions) . "', " . - " expected_results='" . - $this->db->prepare_string($item->expected_results) . "', " . - " execution_type = " . $this->db->prepare_int($execution_type) . - " WHERE id = " . $this->db->prepare_int($step_id); - - $result = $this->db->exec_query($sql); - $ret = array('msg' => 'ok', 'status_ok' => 1, 'sql' => $sql); - if (!$result) - { - $ret['msg'] = $this->db->error_msg(); - $ret['status_ok']=0; - } - return $ret; - } - - /** - * get by external id - * - * @param mixed filters: - */ - function get_by_external($external_id, $parent_id,$filters=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $recordset = null; - - $my = array(); - $my['filters'] = array('version' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $sql = "/* $debugMsg */ " . - " SELECT DISTINCT NH_TCASE.id,NH_TCASE.name,NH_TCASE_PARENT.id AS parent_id," . - " NH_TCASE_PARENT.name AS tsuite_name, TCV.tc_external_id " . - " FROM {$this->tables['nodes_hierarchy']} NH_TCASE, " . - " {$this->tables['nodes_hierarchy']} NH_TCASE_PARENT, " . - " {$this->tables['nodes_hierarchy']} NH_TCVERSIONS," . - " {$this->tables['tcversions']} TCV " . - " WHERE NH_TCVERSIONS.id=TCV.id " . - " AND NH_TCVERSIONS.parent_id=NH_TCASE.id " . - " AND NH_TCASE_PARENT.id=NH_TCASE.parent_id " . - " AND NH_TCASE.node_type_id = {$this->my_node_type} " . - " AND TCV.tc_external_id=$external_id "; - - $add_filters = ' '; - foreach($my['filters'] as $field => $value) - { - switch($my['filters']) - { - case 'version': - if( !is_null($value) ) - { - $add_filters .= ' AND TCV.version = intval($value) '; - } - } - } - - $sql .= $add_filters; - $sql .= " AND NH_TCASE_PARENT.id = {$parent_id}" ; - $recordset = $this->db->fetchRowsIntoMap($sql,'id'); - return $recordset; - } - - - /** - * for a given set of test cases, search on the ACTIVE version set, - * and returns for each test case, - * a map with: the corresponding MAX(version number), other info - * - * @param mixed $id: test case id can be an array - * @param map $filters OPTIONAL - now only 'cfields' key is supported - * @param map $options OPTIONAL - * - */ - function get_last_active_version($id,$filters=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $recordset = null; - $itemSet = implode(',',(array)$id); - - $my = array(); - $my['filters'] = array( 'cfields' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $my['options'] = array( 'max_field' => 'tcversion_id', 'access_key' => 'tcversion_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - - - switch($my['options']['max_field']) { - case 'version': - $maxClause = " SELECT MAX(TCV.version) AS version "; - $selectClause = " SELECT TCV.version AS version "; - break; - - case 'tcversion_id': - $maxClause = " SELECT MAX(TCV.id) AS tcversion_id "; - $selectClause = " SELECT TCV.id AS tcversion_id "; - break; - } - - $sql = "/* $debugMsg */ " . - " {$maxClause}, NH_TCVERSION.parent_id AS testcase_id " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . - " ON NH_TCVERSION.id = TCV.id AND TCV.active=1 " . - " AND NH_TCVERSION.parent_id IN ({$itemSet}) " . - " GROUP BY NH_TCVERSION.parent_id " . - " ORDER BY NH_TCVERSION.parent_id "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcversion_id'); - - $cfSelect = ''; - $cfJoin = ''; - $cfQuery = ''; - $cfQty = 0; - - if( !is_null($recordset) ) { - $or_clause = ''; - $cf_query = ''; - - if( !is_null($my['filters']['cfields']) ) { - $cf_hash = &$my['filters']['cfields']; - $cfQty = count($cf_hash); - $countmain = 1; - - // Build custom fields filter - // do not worry!! it seems that filter criteria is OR, - // but really is an AND, - // OR is needed to do a simple query. - // with processing on recordset becomes an AND - foreach ($cf_hash as $cf_id => $cf_value) { - if ( $countmain != 1 ) { - $cfQuery .= " OR "; - } - if (is_array($cf_value)) { - $count = 1; - - foreach ($cf_value as $value) { - if ($count > 1) { - $cfQuery .= " AND "; - } - $cfQuery .= " ( CFDV.value LIKE '%{$value}%' AND CFDV.field_id = {$cf_id} )"; - $count++; - } - } - else { - $cfQuery .= " ( CFDV.value LIKE '%{$cf_value}%' AND CFDV.field_id = {$cf_id} )"; - } - $countmain++; - } - $cfSelect = ", CFDV.field_id, CFDV.value "; - $cfJoin = " JOIN {$this->tables['cfield_design_values']} CFDV ON CFDV.node_id = TCV.id "; - $cfQuery = " AND ({$cfQuery}) "; - } - - $keySet = implode(',',array_keys($recordset)); - $sql = "/* $debugMsg */ " . - " {$selectClause}, NH_TCVERSION.parent_id AS testcase_id, " . - " TCV.version,TCV.execution_type,TCV.importance,TCV.status {$cfSelect} " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . - " ON NH_TCVERSION.id = TCV.id {$cfJoin} " . - " AND NH_TCVERSION.id IN ({$keySet}) {$cfQuery}"; - - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key'],database::CUMULATIVE); - - // now loop over result, - // Processing has to be done no matter value of cfQty - // (not doing this has produced in part TICKET 4704,4708) - // entries whose count() < number of custom fields has to be removed - if( !is_null($recordset) ) { - $key2loop = array_keys($recordset); - if($cfQty > 0) { - foreach($key2loop as $key) { - if( count($recordset[$key]) < $cfQty) { - unset($recordset[$key]); - } - else { - $recordset[$key] = $recordset[$key][0]; - unset($recordset[$key]['value']); - unset($recordset[$key]['field_id']); - } - } - } - else { - foreach($key2loop as $key) { - $recordset[$key] = $recordset[$key][0]; - } - } - - if( count($recordset) <= 0 ) { - $recordset = null; - } - } - } - - return $recordset; - } - - - /** - * - */ - function filter_tcversions_by_exec_type($tcversion_id,$exec_type,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $recordset = null; - $itemSet = implode(',',(array)$tcversion_id); - - $my['options'] = array( 'access_key' => 'tcversion_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - - - $sql = "/* $debugMsg */ " . - " SELECT TCV.id AS tcversion_id, NH_TCVERSION.parent_id AS testcase_id, TCV.version " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . - " ON NH_TCVERSION.id = TCV.id AND TCV.execution_type={$exec_type}" . - " AND NH_TCVERSION.id IN ({$itemSet}) "; - - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - return $recordset; - } - - /** - * - * - */ - function filter_tcversions($tcversion_id,$filters,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $recordset = null; - $itemSet = implode(',',(array)$tcversion_id); - - $my['options'] = array( 'access_key' => 'tcversion_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = "/* $debugMsg */ " . - " SELECT TCV.id AS tcversion_id, NH_TCVERSION.parent_id AS testcase_id, TCV.version " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . - " ON NH_TCVERSION.id = TCV.id "; - - if ( !is_null($filters) ) - { - foreach($filters as $key => $value) - { - if( !is_null($value) ) - { - $sql .= " AND TCV.{$key}={$value} "; // Hmmm some problems coming with strings - } - } - } - $sql .= " AND NH_TCVERSION.id IN ({$itemSet}) "; - - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - return $recordset; - } - - - - /** - * given a test case version id, the provided steps will be analized in order - * to update whole steps/expected results structure for test case version. - * This can result in some step removed, other updated and other new created. - * - */ - function update_tcversion_steps($tcversion_id,$steps) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // delete all current steps (if any exists) - // Attention: - // After addition of test case steps feature, a test case version - // can be root of a subtree that contains the steps. - // Remember we are using (at least on Postgres FK => we need to delete - // in a precise order. - - $stepSet = (array)$this->get_steps($tcversion_id,0, - array('fields2get' => 'id', 'accessKey' => 'id')); - if( count($stepSet) > 0 ) - { - $this->delete_step_by_id(array_keys($stepSet)); - } - - // Now insert steps - $loop2do = count($steps); - for($idx=0; $idx < $loop2do; $idx++) - { - $this->create_step($tcversion_id,$steps[$idx]['step_number'], - $steps[$idx]['actions'], - $steps[$idx]['expected_results'], - $steps[$idx]['execution_type']); - } - } - - /** - * update_last_modified - * - * @internal revision - * 20101016 - franciscom - refixing of BUGID 3849 - */ - function update_last_modified($tcversion_id,$user_id,$time_stamp=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $changed_ts = !is_null($time_stamp) ? $time_stamp : $this->db->db_now(); - $sql = " UPDATE {$this->tables['tcversions']} " . - " SET updater_id=" . $this->db->prepare_int($user_id) . ", " . - " modification_ts = " . $changed_ts . - " WHERE id = " . $this->db->prepare_int($tcversion_id); - $this->db->exec_query($sql); - } - - - /** - * Given a tcversion set, returns a modified set, where only tcversion id - * that has requested values on Custom fields are returned. - * - * @param mixed tcversion_id: can be a single value or an array - * @param map cf_hash: custom fields id plus values - * @param map options: OPTIONAL - * - * @return map key: tcversion_id , - * element: array numerical index with as much element as custom fields - * - * @20170325: Ay! this search on EXACT VALUE not LIKE! - * changed! - */ - function filter_tcversions_by_cfields($tcversion_id,$cf_hash,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $recordset = null; - $itemSet = implode(',',(array)$tcversion_id); - - $my['options'] = array( 'access_key' => 'tcversion_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - $or_clause = ''; - $cf_query = ''; - $cf_qty = count($cf_hash); - - // do not worry!! it seems that filter criteria is OR, but really is an AND, - // OR is needed to do a simple query. - // with processing on recordset becomes an AND - foreach ($cf_hash as $cf_id => $cf_value) - { - $cf_query .= $or_clause . " (CFDV.field_id=" . $cf_id . - " AND CFDV.value LIKE '%{$cf_value}%') "; - $or_clause = ' OR '; - } - - $sql = "/* $debugMsg */ " . - " SELECT TCV.id AS tcversion_id, " . - " NH_TCVERSION.parent_id AS testcase_id, TCV.version," . - " CFDV.field_id,CFDV.value " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . - " ON NH_TCVERSION.id = TCV.id " . - " JOIN {$this->tables['cfield_design_values']} CFDV " . - " ON CFDV.node_id = TCV.id " . - " AND NH_TCVERSION.id IN ({$itemSet}) AND ({$cf_query}) "; - - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key'],database::CUMULATIVE); - - // now loop over result, entries whose count() < number of custom fields has to be removed - if( !is_null($recordset) ) - { - $key2loop = array_keys($recordset); - foreach($key2loop as $key) - { - if( count($recordset[$key]) < $cf_qty) - { - unset($recordset[$key]); - } - } - if( count($recordset) <= 0 ) - { - $recordset = null; - } - } - return $recordset; - } - - /** - * - * @used-by execSetResults.php - */ - function getExecutionSet($id,$version_id=null,$filters=null,$options=null) - { - // need to understand if possibility of choosing order by - // allow us to replace completely code that seems duplicate - // get_executions. - // - // NHA.node_order ASC, NHA.parent_id ASC, execution_id DESC - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // IMPORTANT NOTICE: keys are field names of executions tables - $my['filters'] = [ - 'tcversion_id' => null, - 'testplan_id' => null, - 'platform_id' => null, - 'build_id' => null - ]; - - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $my['options'] = array('exec_id_order' => 'DESC'); - $my['options'] = array_merge($my['options'], (array)$options); - - $filterBy = array(); - $filterKeys = [ - 'build_id', - 'platform_id', - 'testplan_id', - 'tcversion_id' - ]; - - - foreach($filterKeys as $fieldName) - { - $filterBy[$fieldName] = ''; // default -> no filter - - if ($fieldName == 'platform_id' && $my['filters'][$fieldName] == -1) { - continue; - } - - if( !is_null($my['filters'][$fieldName]) ) - { - $itemSet = implode(',', (array)($my['filters'][$fieldName])); - $filterBy[$fieldName] = " AND E.{$fieldName} IN ({$itemSet}) "; - } - } - - - - - // -------------------------------------------------------------------- - if( is_array($id) ) - { - $tcid_list = implode(",",$id); - $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) "; - } - else - { - $where_clause = " WHERE NHTCV.parent_id = {$id} "; - } - - if(!is_null($version_id)) - { - if( is_array($version_id) ) - { - foreach($version_id as &$elem) - { - $elem = intval($elem); - } - $where_clause .= ' AND TCV.id IN (' . implode(",",$version_id) . ') '; - } - else - { - if($version_id != self::ALL_VERSIONS) - { - $where_clause .= ' AND TCV.id = ' .intval($version_id); - } - } - } - - - - - $sql = "/* $debugMsg */ SELECT NHTC.name,NHTCV.parent_id AS testcase_id, NHTCV.id AS tcversion_id, " . - " TCV.*, " . - " U.login AS tester_login, U.first AS tester_first_name, U.last AS tester_last_name," . - " E.tester_id AS tester_id,E.id AS execution_id, E.status,E.tcversion_number," . - " E.notes AS execution_notes, E.execution_ts, E.execution_type AS execution_run_type," . - " E.execution_duration," . - " E.build_id AS build_id, B.name AS build_name, B.active AS build_is_active, " . - " B.is_open AS build_is_open,E.platform_id, PLATF.name AS platform_name," . - " E.testplan_id,NHTPLAN.name AS testplan_name,TPTCV.id AS feature_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - - " JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = NHTCV.id " . - $filterBy['testplan_id'] . $filterBy['build_id'] . - $filterBy['platform_id'] . $filterBy['tcversion_id'] . - - " /* To get build name */ " . - " JOIN {$this->tables['builds']} B ON B.id=E.build_id " . - - " /* To get test plan name */ " . - // " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = E.testplan_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id = E.testplan_id " . - - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.testplan_id = E.testplan_id " . - " AND TPTCV.tcversion_id = E.tcversion_id " . - " AND TPTCV.platform_id = E.platform_id " . - " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = E.platform_id " . - $where_clause . - " ORDER BY execution_id {$my['options']['exec_id_order']} "; - - $recordset = $this->db->fetchArrayRowsIntoMap($sql,'id'); - return($recordset ? $recordset : null); - } - - - - /** - * for test case id and filter criteria return set with platforms - * where test case has a version that has been executed. - * - */ - function getExecutedPlatforms($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['filters'] = array( 'version_id' => null,'tplan_id' => null, - 'platform_id' => null, 'build_id' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $my['options'] = array('exec_id_order' => 'DESC'); - $my['options'] = array_merge($my['options'], (array)$options); - - $filterKeys = array('build_id','platform_id','tplan_id'); - foreach($filterKeys as $key) - { - $filterBy[$key] = ''; - if( !is_null($my['filters'][$key]) ) - { - $itemSet = implode(',', (array)$$key); - $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; - } - } - - // -------------------------------------------------------------------- - if( is_array($id) ) - { - $tcid_list = implode(",",$id); - $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) "; - } - else - { - $where_clause = " WHERE NHTCV.parent_id = {$id} "; - } - - // if( is_array($version_id) ) - // { - // $versionid_list = implode(",",$version_id); - // $where_clause .= " AND tcversions.id IN ({$versionid_list}) "; - // } - // else - // { - // if($version_id != self::ALL_VERSIONS) - // { - // $where_clause .= " AND tcversions.id = {$version_id} "; - // } - // } - - $sql = "/* $debugMsg */ SELECT DISTINCT e.platform_id,p.name " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['tcversions']} tcversions ON NHTCV.id = tcversions.id " . - " JOIN {$this->tables['executions']} e ON NHTCV.id = e.tcversion_id " . - " {$filterBy['tplan_id']} {$filterBy['build_id']} {$filterBy['platform_id']} " . - " JOIN {$this->tables['builds']} b ON e.build_id=b.id " . - " LEFT OUTER JOIN {$this->tables['platforms']} p ON p.id = e.platform_id " . - $where_clause; - - $recordset = $this->db->fetchRowsIntoMap($sql,'platform_id'); - return($recordset ? $recordset : null); - } - - - - /** - * - * Solve point to my self - * - *

    added by web rich editor create some layout issues - */ - function renderGhostSteps(&$steps2render, $scan = null) { - $warningRenderException = lang_get('unable_to_render_ghost'); - $loop2do = count($steps2render); - - $tlBeginMark = self::GHOSTBEGIN; - $tlEndMark = self::GHOSTEND; - $tlEndMarkLen = strlen($tlEndMark); - - $key2check = array('actions','expected_results'); - - // I've discovered that working with Web Rich Editor generates - // some additional not wanted entities, that disturb a lot - // when trying to use json_decode(). - // Hope this set is enough. - $replaceSet = array($tlEndMark, '

    ', '

    ',' '); - $replaceSetWebRichEditor = array('

    ', '

    ',' '); - - $rse = &$steps2render; - for($gdx=0; $gdx < $loop2do; $gdx++) { - foreach($key2check as $item_key) { - $deghosted = false; - $start = FALSE; - - if(isset($rse[$gdx][$item_key])) { - $start = strpos($rse[$gdx][$item_key],$tlBeginMark); - $ghost = $rse[$gdx][$item_key]; - } - - if($start !== FALSE) { - $xx = explode($tlBeginMark,$rse[$gdx][$item_key]); - $xx2do = count($xx); - $ghost = ''; - $deghosted = false; - for($xdx=0; $xdx < $xx2do; $xdx++) { - try { - if( ($cutting_point = strpos($xx[$xdx],$tlEndMark)) !== FALSE) { - // here I've made a mistake - // Look at this situation: - // - // ** Original String - // [ghost]"Step":1,"TestCase":"BABA-1","Version":1[/ghost] RIGHT - // - // ** $xx[$xdx] - // "Step":1,"TestCase":"BABA-1","Version":1[/ghost] RIGHT - // Then $ydx = trim(str_replace($replaceSet,'',$xx[$xdx])); - // - // WRONG!!! => "Step":1,"TestCase":"BABA-1","Version":1 - // - // Need to CUT WHERE I have found $tlEndMark - // - $leftside = trim(substr($xx[$xdx],0,$cutting_point)); - $rightside = trim(substr($xx[$xdx],$cutting_point+$tlEndMarkLen)); - $dx = '{' . html_entity_decode(trim($leftside,'\n')) . '}'; - $dx = json_decode($dx,true); - - if(isset($dx['Step'])) { - if( ($xid = $this->getInternalID($dx['TestCase'])) > 0 ) { - // Start looking initially just for ACTIVE Test Case Versions - $vn = isset($dx['Version']) ? intval($dx['Version']) : 0; - if($vn == 0) { - // User wants to follow latest ACTIVE VERSION - $yy = $this->get_last_version_info($xid,array('output' => 'full','active' => 1)); - if(is_null($yy)) { - // seems all versions are inactive, in this situation will get latest - $yy = $this->get_last_version_info($xid,array('output' => 'full')); - } - $vn = intval($yy['version']); - } - - $fi = $this->get_basic_info($xid,array('number' => $vn)); - if(!is_null($fi)) { - if(intval($dx['Step']) > 0) { - $deghosted = true; - $stx = $this->get_steps($fi[0]['tcversion_id'],$dx['Step']); - $ghost .= str_replace($replaceSetWebRichEditor,'',$stx[0][$item_key]) . $rightside; - } - } - } - } else { - // seems we have found a ghost test case INSTEAD OF a GHOST test case STEP - // Then I do a trick creating an artificial 'summary' member - $zorro = array('summary' => $tlBeginMark . $leftside . $tlEndMark); - $this->renderGhost($zorro); - $deghosted = true; - $ghost .= $zorro['summary'] . $rightside; - } - } else { - $ghost = $xx[$xdx]; // 20131022 - } - } catch (Exception $e) { - $deghosted = true; - $ghost .= $warningRenderException . $rse[$gdx][$item_key]; - } - } - } // $start - - if($deghosted) { - $rse[$gdx][$item_key] = $ghost; - } - - if(null != $scan) { - $gaga = implode(',',$scan); - $rse[$gdx][$item_key] = - $this->replaceTextBTWTags($rse[$gdx][$item_key],$gaga); - } - - } - } - } - - /** - * Gets test cases created per user. The test cases are restricted to a - * test plan of a test project. This method performs a query to database - * using the given arguments. - * - * Optional values may be passed in the options array. These optional - * values include tplan_id - Test plan ID. - * - * @param integer $user_id User ID - * @param integer $tproject_id Test Project ID - * @param mixed $options Optional array of options - * @return mixed Array of test cases created per user - */ - function get_created_per_user($user_id, $tproject_id, $options) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $has_options=!is_null($options); - - $sql = "/* $debugMsg */ SELECT ". - "TPROJ.id AS testproject_id, TPTCV.testplan_id, TCV.id AS tcversion_id," . - "TCV.version, TCV.tc_external_id, NHTC.id AS testcase_id, NHTC.name, ". - "TCV.creation_ts, TCV.modification_ts, TPROJ.prefix, U.first AS first_name,". - "U.last AS last_name, U.login, (TPTCV.urgency * TCV.importance) AS priority " . - "FROM testprojects TPROJ, users U JOIN tcversions TCV ON U.id = TCV.author_id " . - "JOIN nodes_hierarchy NHTCV ON TCV.id = NHTCV.id " . - "JOIN nodes_hierarchy NHTC ON NHTCV.parent_id = NHTC.id " . - "LEFT OUTER JOIN testplan_tcversions TPTCV ON TCV.id = TPTCV.tcversion_id " . - "LEFT OUTER JOIN testplans TPLAN ON TPTCV.testplan_id = TPLAN.id " . - "LEFT OUTER JOIN testprojects TPROJ_TPLAN ON TPLAN.testproject_id = TPROJ_TPLAN.id " . - "WHERE TPROJ.id = {$tproject_id}"; - - if($user_id !== 0) { - $sql .= " AND U.id = {$user_id}"; - } - - if( $has_options && isset($options->tplan_id)) { - $sql .= " AND TPTCV.testplan_id = {$options->tplan_id}"; - } - - if( $has_options && isset($options->startTime) ) { - $sql .= " AND TCV.creation_ts >= '{$options->startTime}'"; - } - - if( $has_options && isset($options->endTime) ) { - $sql .= " AND TCV.creation_ts <= '{$options->endTime}'"; - } - - $access_key=array('testplan_id','testcase_id'); - if( $has_options && isset($options->access_keys) ) - { - switch($options->access_keys) - { - case 'testplan_testcase': - $access_key=array('testplan_id','testcase_id'); - break; - - case 'testcase_testplan': - $access_key=array('testcase_id','testplan_id'); - break; - - default: - $access_key=array('testplan_id','testcase_id'); - break; - } - } - - $rs=$this->db->fetchMapRowsIntoMap($sql,$access_key[0],$access_key[1],database::CUMULATIVE); - - if( $has_options && !is_null($rs)) // TBD: Check if we can remove it - { - if( !isset($options->access_keys) || - (is_null($options->access_keys) || $options->access_keys='testplan_testcase') ) - { - $tcaseSet=null; - $main_keys = array_keys($rs); - foreach($main_keys as $maccess_key) - { - $sec_keys = array_keys($rs[$maccess_key]); - foreach($sec_keys as $saccess_key) - { - // is enough I process first element - $item = $rs[$maccess_key][$saccess_key][0]; - if(!isset($tcaseSet[$item['testcase_id']])) - { - $tcaseSet[$item['testcase_id']]=$item['testcase_id']; - } - } - } - - $path_info = $this->tree_manager->get_full_path_verbose($tcaseSet); - - // Remove test project piece and convert to string - $flat_path=null; - foreach($path_info as $tcase_id => $pieces) - { - unset($pieces[0]); - $flat_path[$tcase_id]=implode('/',$pieces); - } - $main_keys = array_keys($rs); - - foreach($main_keys as $idx) - { - $sec_keys = array_keys($rs[$idx]); - foreach($sec_keys as $jdx) - { - $third_keys = array_keys($rs[$idx][$jdx]); - foreach($third_keys as $tdx) - { - $fdx = $rs[$idx][$jdx][$tdx]['testcase_id']; - $rs[$idx][$jdx][$tdx]['tcase_full_path']=$flat_path[$fdx]; - } - } - break; - } - } - } - - return $rs; - } - - /** - * - * - */ - function setExecutionType($tcversionID,$value,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('updSteps' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $execType = $this->db->prepare_int(intval($value)); - $safeTCVID = $this->db->prepare_int($tcversionID); - - $sql = "/* $debugMsg */ " . - " UPDATE {$this->tables['tcversions']} " . - " SET execution_type={$execType} WHERE id = {$safeTCVID} "; - $this->db->exec_query($sql); - - if( $my['opt']['updSteps'] ) - { - $opx = array('fields2get' => 'id'); - $stepIDSet = $this->get_steps($safeTCVID,null,$opx); - - if( !is_null($stepIDSet) ) - { - $target = array(); - foreach($stepIDSet as $elem ) - { - $target[] = $elem['id']; - } - $inClause = implode(',',$target); - $sqlX = " UPDATE {$this->tables['tcsteps']} " . - " SET execution_type={$execType} WHERE id IN (" . $inClause . ")"; - $this->db->exec_query($sqlX); - } - } - - return array($value,$execType,$sql); - } - - - /** - * - * - */ - function setEstimatedExecDuration($tcversionID,$value) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe = trim($value); - $safe = is_numeric($safe) ? $safe : null; - - $sql = "/* $debugMsg */ " . - " UPDATE {$this->tables['tcversions']} " . - " SET estimated_exec_duration=" . ((is_null($safe) || $safe == '') ? 'NULL' : $safe) . - " WHERE id = " . $this->db->prepare_int($tcversionID); - $this->db->exec_query($sql); - return array($value,$safe,$sql); - } - - - - /** - * @param map $identity: id, version_id - * @param map $execContext: tplan_id, platform_id,build_id - * @internal revisions - * - * @since 1.9.4 - **/ - function getLatestExecSingleContext($identity,$execContext,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $cfg = config_get('results'); - $status_not_run = $cfg['status_code']['not_run']; - - $my = array('opt' => array('output' => 'full')); - $my['opt'] = array_merge($my['opt'],(array)$options); - $safeContext = $execContext; - $safeIdentity = $identity; - foreach($safeContext as &$ele) { - $ele = intval($ele); - } - - foreach($safeIdentity as &$ele) - { - $ele = intval($ele); - } - - // dammed names!!! - $safeContext['tplan_id'] = isset($safeContext['tplan_id']) ? $safeContext['tplan_id'] : $safeContext['testplan_id']; - if ($safeContext['platform_id'] < 0) { - $safeContext['platform_id'] = 0; - } - - - // we have to manage following situations - // 1. we do not know test case version id. - if($safeIdentity['version_id'] > 0) - { - $addJoinLEX = ''; - $addWhereLEX = " AND EE.tcversion_id = " . $safeIdentity['version_id']; - $addWhere = " AND TPTCV.tcversion_id = " . $safeIdentity['version_id']; - } - else - { - $addJoinLEX = " JOIN {$this->tables['nodes_hierarchy']} H2O " . - " ON H2O.id = EE.tcversion_id "; - $addWhereLEX = " AND H2O.parent_id = " . $safeIdentity['id']; - $addWhere = " AND NHTC.id = " . $safeIdentity['id']; - } - - - $sqlLEX = ' SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id,' . - ' MAX(EE.id) AS id ' . - " FROM {$this->tables['executions']} EE " . - $addJoinLEX . - ' WHERE EE.testplan_id = ' . $safeContext['tplan_id'] . - ' AND EE.platform_id = ' . $safeContext['platform_id'] . - ' AND EE.build_id = ' . $safeContext['build_id'] . - $addWhereLEX . - ' GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id ,EE.build_id '; - - $out = null; - switch($my['opt']['output']) - { - case 'exec_id': - $dummy = $this->db->get_recordset($sqlLEX); - $out = (!is_null($dummy) ? $dummy[0]['id'] : null); - break; - - case 'timestamp': - $sql= "/* $debugMsg */ SELECT E.id AS execution_id, " . - " COALESCE(E.status,'{$status_not_run}') AS status," . - " NHTC.id AS testcase_id, TCV.id AS tcversion_id, E.execution_ts" . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - - " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.platform_id = TPTCV.platform_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.build_id = {$safeContext['build_id']} " . - - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - - " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . - " AND TPTCV.platform_id = {$safeContext['platform_id']} " . - $addWhere . - " AND (E.build_id = {$safeContext['build_id']} OR E.build_id IS NULL)"; - - // using database::CUMULATIVE is just a trick to return data structure - // that will be liked on execSetResults.php - $out = $this->db->fetchRowsIntoMap($sql,'testcase_id',database::CUMULATIVE); - break; - - - case 'full': - default: - $sql= "/* $debugMsg */ SELECT E.id AS execution_id, " . - " COALESCE(E.status,'{$status_not_run}') AS status, E.execution_type AS execution_run_type," . - " NHTC.name, NHTC.id AS testcase_id, NHTC.parent_id AS tsuite_id," . - " TCV.id AS tcversion_id,TCV.tc_external_id,TCV.version,TCV.summary," . - " TCV.preconditions,TCV.importance,TCV.author_id," . - " TCV.creation_ts,TCV.updater_id,TCV.modification_ts,TCV.active," . - " TCV.is_open,TCV.execution_type," . - " U.login AS tester_login,U.first AS tester_first_name," . - " U.last AS tester_last_name, E.tester_id AS tester_id," . - " E.notes AS execution_notes, E.execution_ts, E.build_id,E.tcversion_number," . - " B.name AS build_name, B.active AS build_is_active, B.is_open AS build_is_open," . - " COALESCE(PLATF.id,0) AS platform_id,PLATF.name AS platform_name, TPTCV.id AS feature_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - - " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.platform_id = TPTCV.platform_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.build_id = {$safeContext['build_id']} " . - - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - - " JOIN {$this->tables['builds']} B ON B.id = {$safeContext['build_id']} " . - " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = {$safeContext['platform_id']} " . - " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . - " AND TPTCV.platform_id = {$safeContext['platform_id']} " . - $addWhere . - " AND (E.build_id = {$safeContext['build_id']} OR E.build_id IS NULL)"; - - // using database::CUMULATIVE is just a trick to return data structure - // that will be liked on execSetResults.php - $out = $this->db->fetchRowsIntoMap($sql,'testcase_id',database::CUMULATIVE); - break; - } - return $out; - } - - /** - * - * DBExec means we do not considered NOT RUN, because are not written to DB. - * @param map $identity: id, version_id - * @param map $execContext: tplan_id, platform_id - * @internal revisions - * - * @since 1.9.4 - **/ - function getLatestDBExecPlatformContext($identity,$execContext,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $cfg = config_get('results'); - $status_not_run = $cfg['status_code']['not_run']; - - $my = array('opt' => array('output' => 'full')); - $my['opt'] = array_merge($my['opt'],(array)$options); - $safeContext = $execContext; - $safeIdentity = $identity; - foreach($safeContext as &$ele) - { - $ele = intval($ele); - } - foreach($safeIdentity as &$ele) - { - $ele = intval($ele); - } - - // we have to manage following situations - // 1. we do not know test case version id. - if($safeIdentity['version_id'] > 0) - { - $addJoinLEX = ''; - $addWhereLEX = " AND EE.tcversion_id = " . $safeIdentity['version_id']; - $addWhere = " AND TPTCV.tcversion_id = " . $safeIdentity['version_id']; - } - else - { - $addJoinLEX = " JOIN {$this->tables['nodes_hierarchy']} H2O " . - " ON H2O.id = EE.tcversion_id "; - $addWhereLEX = " AND H2O.parent_id = " . $safeIdentity['id']; - $addWhere = " AND NHTC.id = " . $safeIdentity['id']; - } - - $sqlLEX = ' SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,' . - ' MAX(EE.id) AS id ' . - " FROM {$this->tables['executions']} EE " . - $addJoinLEX . - ' WHERE EE.testplan_id = ' . $safeContext['tplan_id'] . - ' AND EE.platform_id = ' . $safeContext['platform_id'] . - $addWhereLEX . - ' GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id'; - - $out = null; - switch($my['opt']['output']) - { - case 'exec_id': - $dummy = $this->db->get_recordset($sqlLEX); - $out = (!is_null($dummy) ? $dummy[0]['id'] : null); - break; - - case 'full': - default: - $sql= "/* $debugMsg */ SELECT E.id AS execution_id, " . - " COALESCE(E.status,'{$status_not_run}') AS status, E.execution_type AS execution_run_type," . - " NHTC.name, NHTC.id AS testcase_id, NHTC.parent_id AS tsuite_id," . - " TCV.id AS tcversion_id,TCV.tc_external_id,TCV.version,TCV.summary," . - " TCV.preconditions,TCV.importance,TCV.author_id," . - " TCV.creation_ts,TCV.updater_id,TCV.modification_ts,TCV.active," . - " TCV.is_open,TCV.execution_type," . - " U.login AS tester_login,U.first AS tester_first_name," . - " U.last AS tester_last_name, E.tester_id AS tester_id," . - " E.notes AS execution_notes, E.execution_ts, E.build_id,E.tcversion_number," . - " B.name AS build_name, B.active AS build_is_active, B.is_open AS build_is_open," . - " COALESCE(PLATF.id,0) AS platform_id,PLATF.name AS platform_name, TPTCV.id AS feature_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.platform_id = TPTCV.platform_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - - " JOIN {$this->tables['builds']} B ON B.id = E.build_id " . - " JOIN {$this->tables['users']} U ON U.id = E.tester_id " . - - " /* Left outer on Platforms because Test plan can have NO PLATFORMS */ " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLATF " . - " ON PLATF.id = {$safeContext['platform_id']} " . - " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . - " AND TPTCV.platform_id = {$safeContext['platform_id']} " . - $addWhere; - - // using database::CUMULATIVE is just a trick to return data structure - // that will be liked on execSetResults.php - $out = $this->db->fetchRowsIntoMap($sql,'testcase_id',database::CUMULATIVE); - break; - } - - return $out; - } - - /** - * - */ - function getExecution($execID,$tcversionID) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT NHTC.name,NHTCV.parent_id AS testcase_id, NHTCV.id AS tcversion_id, " . - " TCV.*, " . - " U.login AS tester_login, U.first AS tester_first_name, U.last AS tester_last_name," . - " E.tester_id AS tester_id,E.id AS execution_id, E.status,E.tcversion_number," . - " E.notes AS execution_notes, E.execution_ts, E.execution_type AS execution_run_type," . - " E.build_id AS build_id, B.name AS build_name, B.active AS build_is_active, " . - " B.is_open AS build_is_open,E.platform_id, PLATF.name AS platform_name," . - " E.testplan_id,NHTPLAN.name AS testplan_name,TPTCV.id AS feature_id, TPLAN.api_key AS testplan_api_key" . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - " JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = NHTCV.id " . - " /* To get build name */ " . - " JOIN {$this->tables['builds']} B ON B.id=E.build_id " . - " /* To get test plan name */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id = E.testplan_id " . - - " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = E.testplan_id " . - - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.testplan_id = E.testplan_id " . - " AND TPTCV.tcversion_id = E.tcversion_id " . - " AND TPTCV.platform_id = E.platform_id " . - " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = E.platform_id " . - " WHERE E.id = " . intval($execID) . " AND E.tcversion_id = " . intval($tcversionID); - $rs = $this->db->get_recordset($sql); - return ($rs ? $rs : null); - } - - - /** - * - */ - public function getAuditSignature($context,$options = null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $key2check = array('tcversion_id','id'); - $safeID = array(); - foreach($key2check as $idx => $key ) { - if( property_exists($context, $key) ) { - $safeID[$key] = intval($context->$key); - } - else { - $safeID[$key] = -1; - } - } - - if( $safeID['id'] <= 0 && $safeID['tcversion_id'] > 0 ) { - $node = $this->tree_manager->get_node_hierarchy_info($safeID['tcversion_id']); - $safeID['id'] = $node['parent_id']; - } - - // we need: - // Test Case External ID - // Test Case Name - // Test Case Path - // What about test case version ID ? => only if argument provided - // - $pathInfo = $this->tree_manager->get_full_path_verbose($safeID['id'],array('output_format' => 'id_name')); - $pathInfo = current($pathInfo); - $path = '/' . implode('/',$pathInfo['name']) . '/'; - $tcase_prefix = $this->getPrefix($safeID['id'], $pathInfo['node_id'][0]); - $info = $this->get_last_version_info($safeID['id'], array('output' => 'medium')); - $signature = $path . $tcase_prefix[0] . $this->cfg->testcase->glue_character . - $info['tc_external_id'] . ':' . $info['name']; - - return $signature; - } - - /** - * - */ - public function getTestSuite($id) - { - $dummy = $this->tree_manager->get_node_hierarchy_info($id); - return $dummy['parent_id']; - } - - - function getIdCardByStepID($step_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT NH_TCV.parent_id AS tcase_id, NH_STEPS.parent_id AS tcversion_id" . - " FROM {$this->tables['nodes_hierarchy']} NH_STEPS " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = NH_STEPS.parent_id " . - " WHERE NH_STEPS.id = " . intval($step_id); - $rs = $this->db->get_recordset($sql); - return is_null($rs) ? $rs : $rs[0]; - } - - - /** - * - */ - private function initShowGui($guiObj,$grantsObj,$idCard) { - $id = $idCard->tcase_id; - $goo = is_null($guiObj) ? new stdClass() : $guiObj; - - if( !property_exists($goo, 'closeMyWindow') ) { - $goo->closeMyWindow = 0; - } - - if( !property_exists($goo, 'uploadOp') ) { - $goo->uploadOp = null; - } - - $goo->new_version_source = 'this'; - - $goo->execution_types = $this->execution_types; - $goo->tcase_cfg = $this->cfg->testcase; - $goo->import_limit = TL_REPOSITORY_MAXFILESIZE; - $goo->msg = ''; - $goo->fileUploadMsg = ''; - - $goo->requirement_mgmt = property_exists($grantsObj, 'mgt_modify_req' ) ? $grantsObj->mgt_modify_req : null; - if( is_null($goo->requirement_mgmt)) { - $goo->requirement_mgmt = property_exists($grantsObj, 'requirement_mgmt' ) ? $grantsObj->requirement_mgmt : 0; - } - - // some config options have been migrated to rights - // In order to refactor less code, we will remap to OLD config options present on config file. - $goo->tcase_cfg->can_edit_executed = $grantsObj->testproject_edit_executed_testcases == 'yes' ? 1 : 0; - $goo->tcase_cfg->can_delete_executed = $grantsObj->testproject_delete_executed_testcases == 'yes' ? 1 : 0; - - - $goo->tcase_cfg->can_add_remove_kw_on_executed = 0; - $g2c = 'testproject_add_remove_keywords_executed_tcversions'; - if( property_exists($grantsObj,$g2c) ) { - $goo->tcase_cfg->can_add_remove_kw_on_executed = - ($grantsObj->$g2c == 'yes' ? 1 : 0); - } - - - $goo->view_req_rights = property_exists($grantsObj, 'mgt_view_req') ? $grantsObj->mgt_view_req : 0; - $goo->assign_keywords = property_exists($grantsObj, 'keyword_assignment') ? $grantsObj->keyword_assignment : 0; - $goo->req_tcase_link_management = property_exists($grantsObj, 'req_tcase_link_management') ? $grantsObj->req_tcase_link_management : 0; - - $goo->parentTestSuiteName = ''; - $goo->tprojectName = ''; - $goo->submitCode = ""; - $goo->dialogName = ''; - $goo->bodyOnLoad = ""; - $goo->bodyOnUnload = "storeWindowSize('TCEditPopup')"; - - - $goo->tableColspan = $this->layout->tableToDisplayTestCaseSteps->colspan; - - $goo->tc_current_version = array(); - $goo->status_quo = array(); - $goo->keywords_map = array(); - $goo->arrReqs = array(); - - $goo->cf_current_version = null; - $goo->cf_other_versions = null; - $goo->linked_versions=null; - $goo->platforms = null; - - // add_relation_feedback_msg @used-by testcaseCommands.class.php:doAddRelation() - $viewer_defaults = array('title' => lang_get('title_test_case'),'show_title' => 'no', - 'action' => '', 'msg_result' => '','user_feedback' => '', - 'refreshTree' => 1, 'disable_edit' => 0, - 'display_testproject' => 0,'display_parent_testsuite' => 0, - 'hilite_testcase_name' => 0,'show_match_count' => 0, - 'add_relation_feedback_msg' => ''); - - $viewer_defaults = array_merge($viewer_defaults, (array)$guiObj->viewerArgs); - - $goo->display_testproject = $viewer_defaults['display_testproject']; - $goo->display_parent_testsuite = $viewer_defaults['display_parent_testsuite']; - $goo->show_title = $viewer_defaults['show_title']; - $goo->hilite_testcase_name = $viewer_defaults['hilite_testcase_name']; - $goo->action = $viewer_defaults['action']; - $goo->user_feedback = $viewer_defaults['user_feedback']; - $goo->add_relation_feedback_msg = $viewer_defaults['add_relation_feedback_msg']; - - - $goo->pageTitle = $viewer_defaults['title']; - $goo->display_testcase_path = !is_null($goo->path_info); - $goo->show_match_count = $viewer_defaults['show_match_count']; - if($goo->show_match_count && $goo->display_testcase_path ) { - $goo->pageTitle .= '-' . lang_get('match_count') . ':' . ($goo->match_count = count($goo->path_info)); - } - - $goo->refreshTree = isset($goo->refreshTree) ? $goo->refreshTree : $viewer_defaults['refreshTree']; - $goo->sqlResult = $viewer_defaults['msg_result']; - - // fine grain control of operations - if( $viewer_defaults['disable_edit'] == 1 || ($grantsObj->mgt_modify_tc == false) ) - { - $goo->show_mode = 'editDisabled'; - } - else if( !is_null($goo->show_mode) && $goo->show_mode == 'editOnExec' ) - { - // refers to two javascript functions present in testlink_library.js - // and logic used to refresh both frames when user call this - // method to edit a test case while executing it. - $goo->dialogName='tcview_dialog'; - $goo->bodyOnLoad="dialog_onLoad($guiObj->dialogName)"; - $goo->bodyOnUnload="dialog_onUnload($guiObj->dialogName)"; - $goo->submitCode="return dialog_onSubmit($guiObj->dialogName)"; - - if( !property_exists($goo, 'additionalURLPar') ) { - $goo->additionalURLPar = ''; - } - } - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $goo->domainTCStatus = $dummy['lbl']; - $goo->TCWKFStatusVerboseCode = config_get('testCaseStatus'); - $goo->TCWKFStatusDisplayHintOnTestDesign = config_get('testCaseStatusDisplayHintOnTestDesign'); - - // editOnExec is part of show_mode Domain - $goo->can_do = $this->getShowViewerActions($goo->show_mode); - $key = 'testcase_freeze'; - if(property_exists($grantsObj, $key)) { - $goo->can_do->freeze = $grantsObj->$key; - } - - $key = 'delete_frozen_tcversion'; - if(property_exists($grantsObj, $key)) { - $goo->can_do->delete_frozen_tcversion = $grantsObj->$key; - } - - $path2root = $this->tree_manager->get_path($id); - $goo->tproject_id = $path2root[0]['parent_id']; - $info = $this->tproject_mgr->get_by_id($goo->tproject_id); - $goo->requirementsEnabled = $info['opt']->requirementsEnabled; - - if( $goo->display_testproject ) { - $goo->tprojectName = $info['name']; - } - - if( $goo->display_parent_testsuite ) { - $parent = count($path2root)-2; - $goo->parentTestSuiteName = $path2root[$parent]['name']; - } - - - $testplans = $this->tproject_mgr->get_all_testplans($goo->tproject_id,array('plan_status' =>1) ); - $goo->has_testplans = !is_null($testplans) && count($testplans) > 0 ? 1 : 0; - - - $platformMgr = new tlPlatform($this->db,$goo->tproject_id); - - $opx = array('enable_on_design' => true, - 'enable_on_execution' => false); - $goo->platforms = $platformMgr->getAllAsMap($opx); - - $goo->tcasePrefix = $this->tproject_mgr->getTestCasePrefix($goo->tproject_id) . $this->cfg->testcase->glue_character; - - $goo->scripts = null; - $goo->tcase_id = $idCard->tcase_id; - $goo->tcversion_id = $idCard->tcversion_id; - $goo->allowStepAttachments = false; - $designEditorCfg = getWebEditorCfg('design'); - $goo->designEditorType = $designEditorCfg['type']; - $stepDesignEditorCfg = getWebEditorCfg('steps_design'); - $goo->stepDesignEditorType = $stepDesignEditorCfg['type']; - - // Add To Testplan button will be disabled if - // the testcase doesn't belong to the current selected testproject - if($idCard->tproject_id == $goo->tproject_id) { - $goo->can_do->add2tplan = ($goo->can_do->add2tplan == 'yes') ? $grantsObj->testplan_planning : 'no'; - } else { - $goo->can_do->add2tplan = 'no'; - } - - return $goo; - } - - /** - * - */ - private function initShowGuiActions(&$gui) - { - - $gui->deleteStepAction = "lib/testcases/tcEdit.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode" . - "&doAction=doDeleteStep&step_id="; - - $gui->tcExportAction = "lib/testcases/tcExport.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode"; - $gui->tcViewAction = "lib/testcases/archiveData.php?tproject_id={$gui->tproject_id}" . - "&show_mode=$gui->show_mode&tcase_id="; - - $gui->printTestCaseAction = "lib/testcases/tcPrint.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode"; - - - $gui->keywordsViewHREF = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id} " . - ' target="mainframe" class="bold" title="' . lang_get('menu_manage_keywords') . '"'; - - - $gui->reqSpecMgmtHREF = "lib/general/frmWorkArea.php?tproject_id={$gui->tproject_id}&feature=reqSpecMgmt"; - $gui->reqMgmtHREF = "lib/requirements/reqView.php?tproject_id={$gui->tproject_id}" . - "&showReqSpecTitle=1&requirement_id="; - - $gui->addTc2TplanHREF = "lib/testcases/tcAssign2Tplan.php?tproject_id={$gui->tproject_id}"; - - - } - - - /** - * render Ghost Test Case - * - * - * @used by this.get_by_id(), this.get_last_execution() - * @used by this.renderGhostSteps() - */ - function renderGhost(&$item2render) { - $versionTag = '[version:%s]'; - $hint = "(link%s"; - - // $href = '%s:%s' . " $versionTag (link)

    "; - // second \'%s\' needed if I want to use Latest as indication, need to understand - // Javascript instead of javascript, because CKeditor sometimes complains - $href = '%s:%s' . " $versionTag $hint

    "; - $tlBeginMark = self::GHOSTBEGIN; - $tlEndMark = self::GHOSTEND; - $tlEndMarkLen = strlen($tlEndMark); - - - // I've discovered that working with Web Rich Editor generates - // some additional not wanted entities, that disturb a lot - // when trying to use json_decode(). - // Hope this set is enough. - // 20130605 - after algorithm change, this seems useless - //$replaceSet = array($tlEndMark, '

    ', '

    ',' '); - // $replaceSetWebRichEditor = array('

    ', '

    ',' '); - $key2check = array('summary','preconditions'); - $rse = &$item2render; - foreach($key2check as $item_key) - { - if (!isset($rse[$item_key])) { - continue; - } - $start = strpos($rse[$item_key],$tlBeginMark); - $ghost = $rse[$item_key]; - - // There is at least one request to replace ? - if ($start !== FALSE) { - $xx = explode($tlBeginMark,$rse[$item_key]); - - // How many requests to replace ? - $xx2do = count($xx); - $ghost = ''; - for($xdx=0; $xdx < $xx2do; $xdx++) { - $isTestCaseGhost = true; - - // Hope was not a false request. - // if( strpos($xx[$xdx],$tlEndMark) !== FALSE) - if( ($cutting_point = strpos($xx[$xdx],$tlEndMark)) !== FALSE) - { - // Separate command string from other text - // Theorically can be just ONE, but it depends - // is user had not messed things. - $yy = explode($tlEndMark,$xx[$xdx]); - - if( ($elc = count($yy)) > 0) - { - $dx = $yy[0]; - - // trick to convert to array - $dx = '{' . html_entity_decode(trim($dx,'\n')) . '}'; - $dx = json_decode($dx,true); - - try - { - $xid = $this->getInternalID($dx['TestCase']); - if( $xid > 0 ) - { - $linkFeedback=")"; - $addInfo=""; - $vn = isset($dx['Version']) ? intval($dx['Version']) : 0; - if($vn == 0) - { - // User wants to follow latest ACTIVE VERSION - $zorro = $this->get_last_version_info($xid,array('output' => 'full','active' => 1)); - $linkFeedback=" to Latest ACTIVE Version)"; - if(is_null($zorro)) - { - // seems all versions are inactive, in this situation will get latest - $zorro = $this->get_last_version_info($xid,array('output' => 'full')); - $addInfo = " - All versions are inactive!!"; - $linkFeedback=" to Latest Version{$addInfo})"; - } - $vn = intval($zorro['version']); - } - - $fi = $this->get_basic_info($xid,array('number' => $vn)); - if(!is_null($fi)) { - if( isset($dx['Step']) ) { - $isTestCaseGhost = false; - - // ghost for rendering Test Case Step (string display) - // [ghost]"Step":1,"TestCase":"MOK-2","Version":1[/ghost] - // - // ATTENTION REMEMBER THAT ALSO CAN BE: - // [ghost]"Step":1,"TestCase":"MOK-2","Version":""[/ghost] - // [ghost]"Step":1,"TestCase":"MOK-2"[/ghost] - // - if(intval($dx['Step']) > 0) { - $deghosted = true; - $rightside = trim(substr($xx[$xdx],$cutting_point+$tlEndMarkLen)); - $stx = $this->get_steps($fi[0]['tcversion_id'],$dx['Step']); - - $ghost .= $stx[0]['actions'] . $rightside; - } - } else if ($dx['Preconditions']) { - $withPrecond = $this->get_basic_info($xid,['number' => $vn],['preconditions']); - $isTestCaseGhost = false; - $deghosted = true; - $rightside = trim(substr($xx[$xdx],$cutting_point+$tlEndMarkLen)); - $ghost .= $withPrecond[0]['preconditions'] . $rightside; - - } else { - // ghost for rendering Test Case (create link) - $ghost .= sprintf($href,$dx['TestCase'],$vn,$dx['TestCase'],$fi[0]['name'],$vn,$linkFeedback); - } - } - } - - if($isTestCaseGhost) - { - $lim = $elc-1; - for($cpx=1; $cpx <= $lim; $cpx++) - { - $ghost .= $yy[$cpx]; - } - } - } - catch (Exception $e) - { - $ghost .= $rse[$item_key]; - } - } - - } - else - { - $ghost .= $xx[$xdx]; - } - } - } - - if($ghost != '') { - $rse[$item_key] = $ghost; - } - } - } - - /** - * - * - * - */ - function setImportance($tcversionID,$value) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " UPDATE {$this->tables['tcversions']} " . - " SET importance=" . $this->db->prepare_int($value) . - " WHERE id = " . $this->db->prepare_int($tcversionID); - $this->db->exec_query($sql); - } - - /** - * - * - * - */ - function setStatus($tcversionID,$value) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " UPDATE {$this->tables['tcversions']} " . - " SET status=" . $this->db->prepare_int($value) . - " WHERE id = " . $this->db->prepare_int($tcversionID); - $this->db->exec_query($sql); - } - - - /** - * updateSimpleFields - * used to update fields of type int, string on test case version - * - * @param int $tcversionID item ID to update - * @param hash $fieldsValues key DB field to update - * supported fields: - * summary,preconditions,execution_type,importance,status, - * updater_id,estimated_exec_duration - * - * @internal revisions - * - */ - function updateSimpleFields($tcversionID,$fieldsValues) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $fieldsConvertions = array('summary' => 'prepare_string','preconditions' => 'prepare_string', - 'execution_type' => 'prepare_int', 'importance' => 'prepare_int', - 'status' => 'prepare_int', 'estimated_exec_duration' => null, - 'updater_id' => null); - $dummy = null; - $sql = null; - $ddx = 0; - foreach($fieldsConvertions as $fkey => $fmethod) - { - if( isset($fieldsValues[$fkey]) ) - { - $dummy[$ddx] = $fkey . " = "; - if( !is_null($fmethod) ) - { - $sep = ($fmethod == 'prepare_string') ? "'" : ""; - $dummy[$ddx] .= $sep . $this->db->$fmethod($fieldsValues[$fkey]) . $sep; - } - else - { - $dummy[$ddx] .= $fieldsValues[$fkey]; - } - $ddx++; - } - } - if( !is_null($dummy) ) - { - $sqlSET = implode(",",$dummy); - $sql = "/* {$debugMsg} */ UPDATE {$this->tables['tcversions']} " . - "SET {$sqlSET} WHERE id={$tcversionID}"; - - $this->db->exec_query($sql); - } - return $sql; - } - - - /** - * updateName - * check for duplicate name under same parent - * - * @param int $id test case id - * @param string $name - * - * @used-by XML-RPC API - */ - function updateName($id,$name) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret['status_ok'] = true; - $ret['msg'] = 'ok'; - $ret['debug'] = ''; - $ret['API_error_code'] = 0; - - $field_size = config_get('field_size'); - $new_name = trim($name); - - if( ($nl = mb_strlen($new_name)) <= 0 ) { - $ret['status_ok'] = false; - $ret['API_error_code'] = 'TESTCASE_EMPTY_NAME'; - $ret['msg'] = lang_get('API_' . $ret['API_error_code']); - } - - if( $ret['status_ok'] && $nl > $field_size->testcase_name) { - $ret['status_ok'] = false; - $ret['API_error_code'] = 'TESTCASE_NAME_LEN_EXCEEDED'; - $ret['msg'] = sprintf(lang_get('API_' . $ret['API_error_code']),$nl,$field_size->testcase_name); - } - - if( $ret['status_ok'] ) { - // Go ahead - $check = $this->tree_manager->nodeNameExists($name,$this->my_node_type,$id); - $ret['status_ok'] = !$check['status']; - $ret['API_error_code'] = 'TESTCASE_SIBLING_WITH_SAME_NAME_EXISTS'; - $ret['msg'] = sprintf(lang_get('API_' . $ret['API_error_code']),$name); - $ret['debug'] = ''; - } - - if($ret['status_ok']) { - $rs = $this->tree_manager->get_node_hierarchy_info($id); - if( !is_null($rs) && $rs['node_type_id'] == $this->my_node_type) { - $sql = "/* {$debugMsg} */ UPDATE {$this->tables['nodes_hierarchy']} " . - " SET name='" . $this->db->prepare_string($name) . "' " . - " WHERE id= {$id}"; - $this->db->exec_query($sql); - $ret['debug'] = "Old name:{$rs['name']} - new name:{$name}"; - } - } - return $ret; - } - - function getAttachmentTable() { - return $this->attachmentTableName; - } - - /** - * - */ - function updateChangeAuditTrial($tcversion_id,$user_id) - { - $sql = " UPDATE {$this->tables['tcversions']} " . - " SET updater_id=" . $this->db->prepare_int($user_id) . ", " . - " modification_ts = " . $this->db->db_now() . - " WHERE id = " . $this->db->prepare_int(intval($tcversion_id)); - $this->db->exec_query($sql); - } - - /** - * - */ - function getStepsExecInfo($execution_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* {$debugMsg} */ " . - " SELECT id, execution_id,tcstep_id,notes,status FROM {$this->tables['execution_tcsteps']} " . - " WHERE execution_id = " . intval($execution_id); - - $rs = $this->db->fetchRowsIntoMap($sql,'tcstep_id'); - return $rs; - } - - /** - * - */ - function getWorkFlowStatusDomain() { - $dummy = getConfigAndLabels('testCaseStatus','code'); - return $dummy['lbl']; - } - - - /** - * - */ - public function getRelations($id) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - $relSet = array(); - $relSet['num_relations'] = 0; - - $dummy = $this->get_by_id($id,self::LATEST_VERSION,null, - array('output' => 'essential','getPrefix' => true, - 'caller' => __FUNCTION__)); - // Get the TC version ID - $versionID = intval($dummy[0]['id']); - - $relSet['item'] = (null != $dummy) ? current($dummy) : null; - $relSet['relations'] = array(); - - // $tproject_mgr = new testproject($this->db); - - $sql = " $debugMsg SELECT id, source_id, destination_id, relation_type, author_id, creation_ts " . - " FROM {$this->tables['testcase_relations']} " . - " WHERE source_id=$versionID OR destination_id=$versionID " . - " ORDER BY id ASC "; - - $relSet['relations']= $this->db->get_recordset($sql); - - if( !is_null($relSet['relations']) && count($relSet['relations']) > 0 ) { - $labels = $this->getRelationLabels(); - $label_keys = array_keys($labels); - foreach($relSet['relations'] as $key => $rel) - { - // is this relation type is configured? - if( ($relTypeAllowed = in_array($rel['relation_type'],$label_keys)) ) - { - $relSet['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; - $relSet['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; - - $type_localized = 'destination_localized'; - $other_key = 'source_id'; - if ($versionID == $rel['source_id']) - { - $type_localized = 'source_localized'; - $other_key = 'destination_id'; - } - $relSet['relations'][$key]['type_localized'] = $relSet['relations'][$key][$type_localized]; - $otherItem = $this->get_by_id(null,$rel[$other_key],null, - array('output' => 'full_without_users','getPrefix' => true)); - - - // only add it, if either interproject linking is on or if it is in the same project - $relTypeAllowed = true; - $relSet['relations'][$key]['related_tcase'] = $otherItem[0]; - - $user = tlUser::getByID($this->db,$rel['author_id']); - $relSet['relations'][$key]['author'] = $user->getDisplayName(); - } - - if( !$relTypeAllowed ) - { - unset($relSet['relations'][$key]); - } - - } // end foreach - - $relSet['num_relations'] = count($relSet['relations']); - } - - return $relSet; - } - - - /** - * idCard['tcase_id'] - * idCard['tcversion_id'] - */ - public function getTCVersionRelations($idCard) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - $safeID = $idCard; - foreach($safeID as $prop => $val) { - $safeID[$prop] = intval($val); - } - - $getOpt = array('output' => 'essential','getPrefix' => true, - 'caller' => __FUNCTION__); - $relSet = array('num_relations' => 0, 'relations' => array()); - - - $relSet['item'] = current($this->get_by_id($safeID['tcase_id'], - $safeID['tcversion_id'],null,$getOpt)); - - $sql = " $debugMsg " . - " SELECT TR.id, source_id, destination_id, relation_type, " . - " TR.author_id, TR.creation_ts,TR.link_status, " . - " NHTCV_S.parent_id AS tcase_source, " . - " NHTCV_D.parent_id AS tcase_destination " . - " FROM {$this->tables['testcase_relations']} TR " . - " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_D " . - " ON NHTCV_D.id = destination_id " . - " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_S " . - " ON NHTCV_S.id = source_id " . - " WHERE source_id = {$safeID['tcversion_id']} OR " . - " destination_id = {$safeID['tcversion_id']} " . - " ORDER BY id ASC "; - - $relSet['relations']= $this->db->get_recordset($sql); - - if( !is_null($relSet['relations']) && count($relSet['relations']) > 0 ) { - $labels = $this->getRelationLabels(); - $label_keys = array_keys($labels); - - foreach($relSet['relations'] as $key => $rel) { - // is this relation type is configured? - if( ($relTypeAllowed = in_array($rel['relation_type'],$label_keys)) ) { - $relSet['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; - $relSet['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; - - $type_localized = 'destination_localized'; - $oKeyTCVID = 'source_id'; - $oKeyTCID = 'tcase_source'; - if( $safeID['tcversion_id'] == $rel['source_id'] ) { - $type_localized = 'source_localized'; - $oKeyTCVID = 'destination_id'; - $oKeyTCID = 'tcase_destination'; - } - $otherTCID = $rel[$oKeyTCID]; - $otherTCVID = $rel[$oKeyTCVID]; - - $relSet['relations'][$key]['type_localized'] = $relSet['relations'][$key][$type_localized]; - - $otherItem = $this->get_by_id($otherTCID,$otherTCVID,null, - array('output' => 'full_without_users','getPrefix' => true)); - - - // only add it to output set, if either interproject linking is on - // or if it is in the same project - $relTypeAllowed = true; - $relSet['relations'][$key]['related_tcase'] = $otherItem[0]; - - $user = tlUser::getByID($this->db,$rel['author_id']); - $relSet['relations'][$key]['author'] = $user->getDisplayName(); - } - - if( !$relTypeAllowed ) { - unset($relSet['relations'][$key]); - } - - } // end foreach - - $relSet['num_relations'] = count($relSet['relations']); - } - - return $relSet; - } - - /** - * - */ - public function getTCVRelationsRaw($tcversionID, $opt=null) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - $safeID['tcversion_id'] = intval($tcversionID); - - $my = array('opt' => array('side' => null)); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " $debugMsg " . - " SELECT TR.id, source_id, destination_id, relation_type, " . - " TR.author_id, TR.creation_ts,TR.link_status, " . - " NHTCV_S.parent_id AS tcase_source, " . - " NHTCV_D.parent_id AS tcase_destination " . - " FROM {$this->tables['testcase_relations']} TR " . - " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_D " . - " ON NHTCV_D.id = destination_id " . - " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_S " . - " ON NHTCV_S.id = source_id "; - - switch($my['opt']['side']) { - case 'source': - $where = " WHERE source_id = {$safeID['tcversion_id']} "; - break; - - case 'destination': - case 'dest': - $where = " WHERE destination_id = {$safeID['tcversion_id']} "; - break; - - default: - $where = " WHERE source_id = {$safeID['tcversion_id']} OR " . - " destination_id = {$safeID['tcversion_id']} "; - break; - } - - $sql .= $where; - $relSet= $this->db->fetchRowsIntoMap($sql,'id'); - - return $relSet; - } - - /** - * - */ - public static function getRelationLabels() { - $cfg = config_get('testcase_cfg'); - $labels = $cfg->relations->type_labels; - foreach ($labels as $key => $label) { - $labels[$key] = init_labels($label); - } - return $labels; - } - - - /** - * - */ - public function deleteAllTestCaseRelations($id) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - $tcaseSet = (array)$id; - array_walk($tcaseSet,'intval'); - - // @since 1.9.18 - // Relations on test case versions - $tcVIDSet = $this->getAllVersionsID($tcaseSet); - $inValues = implode(',', $tcVIDSet); - $sql = " $debugMsg DELETE FROM {$this->tables['testcase_relations']} " . - " WHERE source_id IN ($inValues) OR " . - " destination_id IN ($inValues) "; - $this->db->exec_query($sql); - } - - - - /** - * checks if there is a relation of a given type between two requirements - * - * @author Andreas Simon - * - * @param integer $first_id ID to check - * @param integer $second_id ID to check - * @param integer $rel_type_id relation type ID to check - * - * @return true, if relation already exists, false if not - */ - public function relationExits($first_id, $second_id, $rel_type_id) - { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - $safe_first_id = intval($first_id); - $safe_second_id = intval($second_id); - - $sql = " $debugMsg SELECT COUNT(0) AS qty " . - " FROM {$this->tables['testcase_relations']} " . - " WHERE ((source_id=" . $safe_first_id . " AND destination_id=" . $safe_second_id . ") " . - " OR (source_id=" . $safe_second_id . " AND destination_id=" . $safe_first_id . ")) " . - " AND relation_type=" . intval($rel_type_id); - - $rs = $this->db->get_recordset($sql); - return($rs[0]['qty'] > 0); - } - - /** - * Get count of all relations, no matter if it is source or destination - * or what type of relation it is. - * - * @param integer $id requirement ID to check - * - * @return integer $count - */ - public function getRelationsCount($id) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - $safeID = intval($id); - $sql = " $debugMsg SELECT COUNT(*) AS qty " . - " FROM {$this->tables['testcase_relations']} " . - " WHERE source_id=$safeID OR destination_id=$safeID "; - $rs = $this->db->get_recordset($sql); - return($rs[0]['qty']); - } - - /** - * add a relation of a given type between Test Case Versions - * - * @param integer $source_id: - * ID of source test case version or test case. - * If test case is provided, latest active version - * will be used. - * - * @param integer $destination_id: - * ID of destination test case version or test case - * If test case is provided, latest active version - * will be used. - * - * @param integer $type_id relation type ID to set - * @param integer $author_id user's ID - */ - public function addRelation($source_id, $destination_id, $type_id, $author_id, $ts=null) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - - // Check if items are test cases or test case versions - // Will check only source - $safeID = array('s' => intval($source_id), - 'd' => intval($destination_id)); - - $extr = array($safeID['s']); - $sql = " SELECT node_type_id,id " . - " FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id IN(" . implode(',', $extr) . ")"; - - $nu = current($this->db->get_recordset($sql)); - - if( $nu['node_type_id'] == $this->node_types_descr_id['testcase'] ) { - // Need to get latest active version for source and dest - $tcvSet = $this->get_last_active_version( - array($safeID['s'],$safeID['d']), null, - array('access_key' => 'testcase_id')); - - // Overwrite - $safeID['s'] = intval($tcvSet[$safeID['s']]['tcversion_id']); - $safeID['d'] = intval($tcvSet[$safeID['d']]['tcversion_id']); - } - - // check if exists before trying to add - if( !$this->relationExits($source_id, $destination_id, $type_id) ) { - // check if related testcase is open - $dummy = $this->get_by_id($destination_id,self::LATEST_VERSION); - if(($dummy[0]['is_open']) == 1){ - $time = is_null($ts) ? $this->db->db_now() : $ts; - $sql = " $debugMsg INSERT INTO {$this->tables['testcase_relations']} " . - " (source_id, destination_id, relation_type, author_id, creation_ts) " . - " values ({$safeID['s']},{$safeID['d']}, $type_id, $author_id, $time)"; - $this->db->exec_query($sql); - $ret = array('status_ok' => true, 'msg' => 'relation_added'); - } else { - $ret = array('status_ok' => false, 'msg' => 'related_tcase_not_open'); - } - } else { - $ret = array('status_ok' => false, 'msg' => 'relation_already_exists'); - } - - return $ret; - } - - - - - - /** - * delete an existing relation - * - * @author Andreas Simon - * - * @param int $id relation id - */ - public function deleteRelationByID($relID) { - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; - $sql = " $debugMsg DELETE FROM {$this->tables['testcase_relations']} WHERE id=" . intval($relID); - $this->db->exec_query($sql); - } - - /** - * - * @return array $htmlSelect info needed to create select box on multiple templates - */ - function getRelationTypeDomainForHTMLSelect() { - $htmlSelect = array('items' => array(), 'selected' => null, 'equal_relations' => array()); - $labels = $this->getRelationLabels(); - - foreach ($labels as $key => $lab) - { - $htmlSelect['items'][$key . "_source"] = $lab['source']; - if ($lab['source'] != $lab['destination']) - { - // relation is not equal as labels for source and dest are different - $htmlSelect['items'][$key . "_destination"] = $lab['destination']; - } - else - { - // mark this as equal relation - no parent/child, makes searching simpler - $htmlSelect['equal_relations'][] = $key . "_source"; - } - } - - // set "related to" as default preselected value in forms - if (defined('TL_REL_TYPE_RELATED') && isset($htmlSelect[TL_REL_TYPE_RELATED . "_source"])) - { - $selected_key = TL_REL_TYPE_RELATED . "_source"; - } - else - { - // "related to" is not configured, so take last element as selected one - $keys = array_keys($htmlSelect['items']); - $selected_key = end($keys); - } - $htmlSelect['selected'] = $selected_key; - - return $htmlSelect; - } - - /** - * exportRelationToXML - * - * Function to export a test case relation to XML. - * - * @param int $relation relation data array - * @param string $troject_id - * - * @return string with XML code - * - * - * testcase external id - * prj - * doc2_id - * testcase external id - * 0 - * - * - * @internal revisions - * - */ - function exportRelationToXML($relation,$item) - { - $xmlStr = ''; - - if(!is_null($relation)) - { - // need to understand if swap is needed, this happens when - // relation type is - // - child_of - // - depends_on - // where item is DESTINATION and NOT SOURCE - if( $relation['source_id'] == $item['id']) - { - $ele['source_ext_id'] = $item['fullExternalID']; - $ele['source_version'] = $item['version']; - $ele['destination_ext_id'] = $relation['related_tcase']['fullExternalID']; - $ele['destination_version'] = $relation['related_tcase']['version']; - } - else - { - // SWAP - $ele['source_ext_id'] = $relation['related_tcase']['fullExternalID']; - $ele['source_version'] = $relation['related_tcase']['version']; - $ele['destination_ext_id'] = $item['fullExternalID']; - $ele['destination_version'] = $item['version']; - } - $ele['relation_type'] = $relation['relation_type']; - - $info = array("||SOURCE||" => "source_ext_id", "||SOURCE_VERSION||" => "source_version", - "||DESTINATION||" => "destination_ext_id", "||DESTINATION_VERSION||" => "destination_version", - "||TYPE||" => "relation_type"); - - $elemTpl = "\t" . "" . "\n\t\t" . "||SOURCE||" ; - $elemTpl .= "\n\t\t" . "||DESTINATION||"; - $elemTpl .= "\n\t\t" . "||TYPE||" . "\n\t" . "" . "\n"; - - $work[] = $ele; - $xmlStr = exportDataToXML($work,"{{XMLCODE}}",$elemTpl,$info,true); - } - - return $xmlStr; - } - - - /** - * Will do analisys IGNORING test plan, platform and build - * get info of execution WRITTEN to DB. - * - */ - function getSystemWideLastestExecutionID($tcversion_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT MAX(e.id) AS execution_id " . - " FROM {$this->tables['executions']} e " . - " WHERE e.tcversion_id = " . intval($tcversion_id); - - - $rs = $this->db->get_recordset($sql); - return intval($rs[0]['execution_id']); - } - - - /** - * render Image Attachments INLINE - * - */ - private function renderImageAttachments($id,&$item2render,$key2check=array('summary','preconditions'),$basehref=null) { - - static $attSet; - static $beginTag; - static $endTag; - static $repoDir; - - if(!$attSet || !isset($attSet[$id])) { - $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor($id,$this->attachmentTableName,'id'); - $beginTag = '[tlInlineImage]'; - $endTag = '[/tlInlineImage]'; - $repoDir = config_get('repositoryPath'); - } - - if(is_null($attSet[$id])) { - return; - } - - // $href = '%s:%s' . " $versionTag (link)

    "; - // second \'%s\' needed if I want to use Latest as indication, need to understand - // Javascript instead of javascript, because CKeditor sometimes complains - // - // CRITIC: skipCheck is needed to render OK when creating report on Pseudo-Word format. - $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; - - $src = ' src="' . $bhref . - '/lib/attachments/attachmentdownload.php?skipCheck=%sec%&id=%id%">

    '; - $img = '

    0) { - - $atx = $yy[0]; - if( intval($atx) == 0 ) { - $atx = - $this->getTCVersionAttachIDFromTitle($id,$atx); - } - - try { - if(isset($attSet[$id][$atx]) && $attSet[$id][$atx]['is_image']) { - $sec = hash('sha256', $attSet[$id][$atx]['file_name']); - - // Need file dimension!!! - $pathname = $repoDir . $attSet[$id][$atx]['file_path']; - list($iWidth, $iHeight, $iT, $iA) = - getimagesize($pathname); - - $iDim = ' width=' . $iWidth . ' height=' . $iHeight; - $icarus = str_replace(array('%id%','%sec%'),array($atx,$sec), $img); - $ghost .= sprintf($icarus,$iDim); - } - $lim = $elc-1; - for($cpx=1; $cpx <= $lim; $cpx++) { - $ghost .= $yy[$cpx]; - } - } - catch (Exception $e) { - $ghost .= $rse[$item_key]; - } - } - } - else { - // nothing to do - $ghost .= $xx[$xdx]; - } - } - } - - // reconstruct field contents - if($ghost != '') { - $rse[$item_key] = $ghost; - } - } - } - - - /** - * - */ - function trim_and_limit($s, $len = 100) - { - $s = trim($s); - if (tlStringLen($s) > $len) - { - $s = tlSubStr($s, 0, $len); - } - - return $s; - } - - /** - * - */ - function generateTimeStampName($name) - { - return @strftime("%Y%m%d-%H:%M:%S", time()) . ' ' . $name; - } - - /** - * - */ - static function getLayout() { - $ly = new stdClass(); - $ly->tableToDisplayTestCaseSteps = new stdClass(); - - // MAGIC: columns are: - //column for reorder, action, expected results, exec type, delete, insert - $ly->tableToDisplayTestCaseSteps->colspan = 6; - - return $ly; - } - - /** - * - */ - function setIntAttrForAllVersions($id,$attr,$value,$forceFrozenVersions=false) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; -// $children = - - - $sql = " UPDATE {$this->tables['tcversions']} " . - " SET {$attr} = " . $this->db->prepare_int($value) ; - - if($forceFrozenVersions==false){ - $sql .= " WHERE is_open=1 AND "; - } - else{ - $sql .= " WHERE "; - } - $sql .= " id IN (" . - " SELECT NHTCV.id FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " WHERE NHTCV.parent_id = " . intval($id) . ")"; - $this->db->exec_query($sql); - } - - - - /** - * - */ - function getTcSearchSkeleton($userInput=null) { - $sk = new stdClass(); - - $sk->creation_date_from = null; - $sk->creation_date_to = null; - $sk->modification_date_from = null; - $sk->modification_date_to = null; - $sk->search_important_notice = ''; - $sk->design_cf = ''; - $sk->keywords = ''; - $sk->filter_by['design_scope_custom_fields'] = false; - $sk->filter_by['keyword'] = false; - $sk->filter_by['requirement_doc_id'] = false; - $sk->option_importance = array(0 => '',HIGH => lang_get('high_importance'),MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $sk->domainTCStatus = array(0 => '') + $dummy['lbl']; - $sk->importance = null; - $sk->status = null; - $sk->tcversion = null; - $sk->tcasePrefix = ''; - $sk->targetTestCase = ''; - - $txtin = array("created_by","edited_by","jolly"); - $jollyKilled = array("summary","steps","expected_results","preconditions","name"); - $txtin = array_merge($txtin, $jollyKilled); - - foreach($txtin as $key ) - { - $sk->$key = !is_null($userInput) ? $userInput->$key : ''; - } - - if(!is_null($userInput) && $userInput->jolly != '') - { - foreach($jollyKilled as $key) - { - $sk->$key = ''; - } - } - - return $sk; - } - - /** - * - * - */ - function setIsOpen($id,$tcversion_id,$value) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $bv = (intval($value) > 0) ? 1 : 0; - $sql = " /* $debugMsg */ UPDATE {$this->tables['tcversions']} " . - " SET is_open = {$bv}" . - " WHERE id = " . intval($tcversion_id) ; - - $this->db->exec_query($sql); - } - - /** - * render CF values - * - *

    added by web rich editor create some layout issues - * - * @used by this.get_by_id(), this.get_last_execution() - * - */ - function renderVariables(&$item2render,$tproj_id) { - $tcase_id = $item2render['testcase_id']; - $tcversion_id = $item2render['id']; - $cfSet = $this->get_linked_cfields_at_design($tcase_id,$tcversion_id); - $kwSet = $this->getTestProjectKeywords($tproj_id); - - if( is_null($cfSet) && is_null($kwSet)) { - return; - } - - $key2check = [ - 'summary', - 'preconditions' - ]; - $tlBeginTag = '[tlVar]'; - $tlEndTag = '[/tlVar]'; - $tlEndTagLen = strlen($tlEndTag); - - $rse = &$item2render; - foreach($key2check as $item_key) { - $start = strpos($rse[$item_key],$tlBeginTag); - // There is at least one request to replace ? - if($start !== FALSE) { - // This way remove may be the

    that webrich editor adds - $play = substr($rse[$item_key],$start); - $xx = explode($tlBeginTag,$play); - - // How many requests to replace ? - $xx2do = count($xx); - for($xdx=0; $xdx < $xx2do; $xdx++) { - - // Hope was not a false request. - if( ($es=strpos($xx[$xdx],$tlEndTag)) !== FALSE) { - - // Separate command string from other text - // Theorically can be just ONE, but it depends - // is user had not messed things. - $yy = explode($tlEndTag,$xx[$xdx]); - if( ($elc = count($yy)) > 0) { - $markAsIS = $tlBeginTag . $yy[0] . $tlEndTag; - $variableName = trim($yy[0]); - - try { - // ----------------------------------------------------------- - // Step #1 Look in Custom Fields - // ----------------------------------------------------------- - // look for the custom field - if (!is_null($cfSet)) { - foreach ($cfSet as $cfID => $cfDef) { - if( $cfDef['name'] === $variableName ) { - $duckTape = $this->cfield_mgr->string_custom_field_value($cfDef,$tcversion_id); - $rse[$item_key] = str_replace($tlBeginTag . $variableName . $tlEndTag,$duckTape,$rse[$item_key]); - } - } - } - // ----------------------------------------------------------- - - // ----------------------------------------------------------- - // Step #2 Look in Keywords - // ----------------------------------------------------------- - if (!is_null($kwSet)) { - foreach ($kwSet as $kw => $kwNotes) { - if( $kw === $variableName ) { - $rse[$item_key] = str_replace($tlBeginTag . $variableName . $tlEndTag,$kwNotes,$rse[$item_key]); - } - } - } - // ----------------------------------------------------------- - } catch (Exception $e) { - // Do nothing - } - } - } - } - } - } - } - - /** - * get data about code links from external tool - * - * @param resource &$db reference to database handler - * @param object &$code_interface reference to instance of bugTracker class - * @param integer $tcversion_id Identifier of test case version - * - * @return array list of 'script_name' with values: link_to_cts, - * project_key, repository_name, code_path, branch_name - */ - function getScriptsForTestCaseVersion(&$code_interface,$tcversion_id) { - $tables = tlObjectWithDB::getDBTables(array('tcversions','testcase_script_links')); - $script_list=array(); - - $debugMsg = 'FILE:: ' . __FILE__ . ' :: FUNCTION:: ' . __FUNCTION__; - if( is_object($code_interface) ) - { - - $sql = "/* $debugMsg */ SELECT TSL.*,TCV.version " . - " FROM {$tables['testcase_script_links']} TSL, {$tables['tcversions']} TCV " . - " WHERE TSL.tcversion_id = " . intval($tcversion_id) . - " AND TSL.tcversion_id = TCV.id " . - " ORDER BY TSL.code_path"; - - $map = $this->db->get_recordset($sql); - if( !is_null($map) ) - { - $opt = array(); - foreach($map as $elem) - { - $script_id = $elem['project_key'].'&&'.$elem['repository_name'].'&&'.$elem['code_path']; - if(!isset($script_list[$script_id])) - { - $opt['branch'] = $elem['branch_name']; - $opt['commit_id'] = $elem['commit_id']; - $dummy = $code_interface->buildViewCodeLink($elem['project_key'], - $elem['repository_name'],$elem['code_path'],$opt); - $script_list[$script_id]['link_to_cts'] = $dummy->link; - $script_list[$script_id]['project_key'] = $elem['project_key']; - $script_list[$script_id]['repository_name'] = $elem['repository_name']; - $script_list[$script_id]['code_path'] = $elem['code_path']; - $script_list[$script_id]['branch_name'] = $elem['branch_name']; - $script_list[$script_id]['commit_id'] = $elem['commit_id']; - $script_list[$script_id]['tcversion_id'] = $elem['tcversion_id']; - } - unset($dummy); - } - } - } - - if(count($script_list) === 0) - { - $script_list = null; - } - return($script_list); - } - - - /** - * - */ - function CKEditorCopyAndPasteCleanUp(&$items,$keys) - { - $offending = array(''); - $good = array('<body id="cke_pastebin"','</body>'); - foreach($keys as $fi) - { - $items->$fi = str_ireplace($offending,$good,$items->$fi); - } - } - - /** - * - * - */ - function getPathName($tcase_id) { - - $pathInfo = $this->tree_manager->get_full_path_verbose($tcase_id,array('output_format' => 'id_name')); - $pathInfo = current($pathInfo); - $path = '/' . implode('/',$pathInfo['name']) . '/'; - - $pfx = $this->tproject_mgr->getTestCasePrefix($pathInfo['node_id'][0]); - - $info = $this->get_last_version_info($tcase_id, array('output' => 'medium')); - - $path .= $pfx . $this->cfg->testcase->glue_character . - $info['tc_external_id'] . ':' . $info['name']; - - return $path; - } - - - - /** - * build Test Case Name getting information - * from special marked text inside string - * - * string can be test case summary or test case precondition - */ - function buildTCName($name, $text2scan) { - - $taglen = strlen(self::NAME_PHOPEN); - $whomai = array('l' => '','r' => ''); - - $where['open'] = strpos($name, self::NAME_PHOPEN); - $where['close'] = strpos($name, self::NAME_PHCLOSE); - - if( FALSE !== $where['open'] ) { - $whoami['l'] = substr($name, 0, $where['open']); - $meat = substr($name,$where['open']+$taglen, ($where['close'] - $where['open']-$taglen) ); - - - $dummy = strstr($name,self::NAME_PHCLOSE); - $whoami['r'] = ''; - if( $dummy !== FALSE ) { - $whoami['r'] = ltrim($dummy,self::NAME_PHCLOSE); - } - - $dm = explode(self::NAME_DIVIDE, $meat); - $name = $whoami['l'] . self::NAME_PHOPEN; - - $juice = $this->orangeJuice($text2scan); - $name .= ( count($dm) > 0 ) ? $dm[0] : $meat; - $name .= self::NAME_DIVIDE . $juice . self::NAME_PHCLOSE . $whoami['r']; - } - return $name; - } - - /** - * target => [[All you need]] - * scan4values => [[is Love]] - * - * returned text => All you need::is Love - * - */ - function replaceTextBTWTags($target, $scan4values) { - - $taglen = strlen(self::NAME_PHOPEN); - $side = array('l' => '','r' => ''); - - $where['open'] = strpos($target,self::NAME_PHOPEN); - $where['close'] = strpos($target,self::NAME_PHCLOSE); - - // Both tags present or ... skip - if( FALSE !== $where['open'] && FALSE !== $where['close']) { - - // the needle will NOT BE replaced. - $needle = substr($target, - $where['open'] + $taglen, - ($where['close'] - $where['open'] - $taglen) ); - - // start disecting the target - // first to the left - $side['l'] = substr($target, 0, $where['open']); - - // haystack = $target - // needle = self::NAME_PHCLOSE - $dummy = strstr($target,self::NAME_PHCLOSE); - $whoami['r'] = ''; - - if( $dummy !== FALSE ) { - // dummy => ]]xxxxxxxxxxx - $side['r'] = ltrim($dummy,self::NAME_PHCLOSE); - } - - $dm = explode(self::NAME_DIVIDE, $needle); - $target = $side['l'] . ((count($dm) > 0) ? $dm[0] : $needle); - - $juice = $this->orangeJuice($scan4values); - $target .= self::NAME_DIVIDE . $juice . $side['r']; - } - return $target; - } - - - - /** - * - */ - function orangeJuice($str) { - - $juice = ''; - $taglen = strlen(self::NAME_PHOPEN); - - $where['open'] = strpos($str, self::NAME_PHOPEN); - $where['close'] = strpos($str, self::NAME_PHCLOSE); - - if( FALSE !== $where['open'] ) { - $juice = substr($str,$where['open']+$taglen, ($where['close'] - $where['open']-$taglen) ); - } - return $juice; - } - - /** - * - */ - function getVersionNumber($version_id) { - - $sql = " SELECT version FROM {$this->tables['tcversions']} " . - " WHERE id=" . intval($version_id); - - $rs = $this->db->get_recordset($sql); - return intval($rs[0]['version']); - } - - /** - * - */ - function getAllVersionsID( $id ) { - - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; - - $target = (array)$id; - array_walk($target,'intval'); - - $sql = $debugMsg . - " SELECT id AS tcversion_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " WHERE NHTCV.parent_id =" . implode(',',$target) . - " AND NHTCV.node_type_id = " . - $this->node_types_descr_id['testcase_version']; - - $xx = $this->db->fetchRowsIntoMap( $sql, 'tcversion_id' ); - - if( null != $xx && count($xx) > 0 ) { - return array_keys($xx); - } - - return null; - } - - - /** - * - */ - function getAttXMLCfg() { - $attXML = new stdClass(); - - $attXML->root = "\t\n{{XMLCODE}}\t\n"; - $attXML->elemTPL = "\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\n"; - - $attXML->decode = array ("||ATTACHMENT_ID||" => "id", - "||ATTACHMENT_NAME||" => "name", - "||ATTACHMENT_FILE_TYPE||" => "file_type", - "||ATTACHMENT_FILE_SIZE||" => "file_size", - "||ATTACHMENT_TITLE||" => "title", - "||ATTACHMENT_DATE_ADDED||" => "date_added", - "||ATTACHMENT_CONTENT||" => "content"); - - return $attXML; - } - - - /** - * - */ - function closeOpenTCVRelation( $relationID, $reason ) { - - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; - $sql = " $debugMsg UPDATE {$this->tables['testcase_relations']} " . - " SET link_status = " . intval($reason) . - " WHERE id IN(" . implode(',',$relationID) . ")" . - " AND link_status = " . LINK_TC_RELATION_OPEN; - - $this->db->exec_query($sql); - - // No audit yet - } - - - /** - * - **/ - function copyTCVRelations($source_id,$dest_id) { - - // Step 1 - get existent relations - $relSource = $this->getTCVRelationsRaw($source_id,array('side' => 'source')); - $relDest = $this->getTCVRelationsRaw($source_id,array('side' => 'dest')); - - $ins = "(source_id,destination_id,relation_type," . - " link_status,author_id) "; - - $values = array(); - if( null != $relSource && count($relSource) > 0) { - foreach ($relSource as $key => $elem) { - $stm = "($dest_id,{$elem['destination_id']}," . - "{$elem['relation_type']},{$elem['link_status']}," . - "{$elem['author_id']})"; - $values[] = $stm; - } - } - - if( null != $relDest && count($relDest) > 0) { - foreach ($relDest as $key => $elem) { - $stm = "({$elem['source_id']},$dest_id," . - "{$elem['relation_type']},{$elem['link_status']}," . - "{$elem['author_id']})"; - $values[] = $stm; - } - } - - if( count($values) > 0 ) { - $sql = 'INSERT INTO ' . $this->tables['testcase_relations'] . - $ins . ' VALUES ' . implode(',',$values); - - $this->db->exec_query($sql); - } - - - // public function addRelation($source_id, $destination_id, $type_id, $author_id, $ts=null) { - - } - - - /** - * - */ - function updateCoverage($link,$whoWhen,$opt=null) { - - // Set coverage for previous version to FROZEN & INACTIVE - // Create coverage for NEW Version - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('freezePrevious' => true); - $options = array_merge($options,(array)$opt); - $safeF = intval($link['source']); - $safeT = intval($link['dest']); - - // Set coverage for previous version to FROZEN & INACTIVE ? - if( $options['freezePrevious'] ) { - $sql = " /* $debugMsg */ " . - " UPDATE {$this->tables['req_coverage']} " . - " SET link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION . "," . - " is_active=0 " . - " WHERE tcversion_id=" . $safeF; - $this->db->exec_query($sql); - } - - // Create coverage for NEW Version - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['req_coverage']} " . - " (req_id,req_version_id,testcase_id,tcversion_id," . - " author_id,creation_ts) " . - - " SELECT req_id,req_version_id,testcase_id, " . - " {$safeT} AS tcversion_id," . - " {$whoWhen['user_id']} AS author_id, " . - " {$whoWhen['when']} AS creation_ts" . - " FROM {$this->tables['req_coverage']} " . - " WHERE tcversion_id=" . $safeF; - - $this->db->exec_query($sql); - - } - - /** - * - */ - function closeOpenReqLinks( $tcversion_id, $reason, $opt=null ) { - - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; - - $options = array('freeze_req_version' => false); - $options = array_merge($options,(array)$opt); - - $commonWhere = " WHERE tcversion_id = " . intval($tcversion_id) . - " AND link_status = " . LINK_TC_REQ_OPEN; - - - // This has to be done BEFORE changing link_status - if( $options['freeze_req_version'] ) { - - /* execution time issues - $sql = " $debugMsg UPDATE {$this->tables['req_versions']} - SET is_open = 0 - WHERE id IN ( - SELECT req_version_id - FROM {$this->tables['req_coverage']} - $commonWhere - ) "; - */ - switch( DB_TYPE ) { - case 'mysql': - $sql = " $debugMsg + WHERE tcstep_id IN ($idSet) )"; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // Order is CRITIC due to Foreing Keys + $sqlSet = array(); + $sqlSet[] = "/* $debugMsg */ + DELETE FROM {$this->tables['execution_tcsteps']} + WHERE tcstep_id IN ($idSet)"; + + $whereClause = " WHERE id IN ($idSet) "; + $sqlSet[] = "/* $debugMsg */ DELETE FROM {$this->tables['tcsteps']} {$whereClause} "; + $sqlSet[] = "/* $debugMsg */ DELETE FROM {$this->tables['nodes_hierarchy']} " . + " {$whereClause} AND node_type_id = " . + $this->node_types_descr_id['testcase_step']; + + foreach ($sqlSet as $sql) { + $this->db->exec_query($sql); + } + } + + /** + * + * @internal revision + * BUGID 4207 - MSSQL + */ + public function set_step_number($step_number) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + foreach ($step_number as $step_id => $value) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['tcsteps']} " . + " SET step_number = {$value} WHERE id = {$step_id} "; + $this->db->exec_query($sql); + } + } + + /** + */ + public function update_step($step_id, $step_number, $actions, + $expected_results, $execution_type) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $ret = array(); + + $k2e = array( + 'actions', + 'expected_results' + ); + $item = new stdClass(); + $item->actions = $actions; + $item->expected_results = $expected_results; + $this->ckEditorCopyAndPasteCleanUp($item, $k2e); + + $sql = "/* $debugMsg */ UPDATE {$this->tables['tcsteps']} " . + " SET step_number=" . $this->db->prepare_int($step_number) . "," . + " actions='" . $this->db->prepare_string($item->actions) . "', " . + " expected_results='" . + $this->db->prepare_string($item->expected_results) . "', " . + " execution_type = " . $this->db->prepare_int($execution_type) . + " WHERE id = " . $this->db->prepare_int($step_id); + + $result = $this->db->exec_query($sql); + $ret = array( + 'msg' => 'ok', + 'status_ok' => 1, + 'sql' => $sql + ); + if (! $result) { + $ret['msg'] = $this->db->error_msg(); + $ret['status_ok'] = 0; + } + return $ret; + } + + /** + * get by external id + * + * @param + * mixed filters: + */ + public function get_by_external($external_id, $parent_id, $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my = array(); + $my['filters'] = array( + 'version' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $sql = "/* $debugMsg */ " . + " SELECT DISTINCT NH_TCASE.id,NH_TCASE.name,NH_TCASE_PARENT.id AS parent_id," . + " NH_TCASE_PARENT.name AS tsuite_name, TCV.tc_external_id " . + " FROM {$this->tables['nodes_hierarchy']} NH_TCASE, " . + " {$this->tables['nodes_hierarchy']} NH_TCASE_PARENT, " . + " {$this->tables['nodes_hierarchy']} NH_TCVERSIONS," . + " {$this->tables['tcversions']} TCV " . + " WHERE NH_TCVERSIONS.id=TCV.id " . + " AND NH_TCVERSIONS.parent_id=NH_TCASE.id " . + " AND NH_TCASE_PARENT.id=NH_TCASE.parent_id " . + " AND NH_TCASE.node_type_id = {$this->my_node_type} " . + " AND TCV.tc_external_id=$external_id "; + + $add_filters = ' '; + foreach ($my['filters'] as $value) { + switch ($my['filters']) { + case 'version': + if (! is_null($value)) { + $add_filters .= ' AND TCV.version = intval($value) '; + } + } + } + + $sql .= $add_filters; + $sql .= " AND NH_TCASE_PARENT.id = {$parent_id}"; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * for a given set of test cases, search on the ACTIVE version set, + * and returns for each test case, + * a map with: the corresponding MAX(version number), other info + * + * @param mixed $id: + * test case id can be an array + * @param array $filters + * OPTIONAL - now only 'cfields' key is supported + * @param array $options + * OPTIONAL + * + */ + public function get_last_active_version($id, $filters = null, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $recordset = null; + $itemSet = implode(',', (array) $id); + + $my = array(); + $my['filters'] = array( + 'cfields' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'max_field' => 'tcversion_id', + 'access_key' => 'tcversion_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + switch ($my['options']['max_field']) { + case 'version': + $maxClause = " SELECT MAX(TCV.version) AS version "; + $selectClause = " SELECT TCV.version AS version "; + break; + + case 'tcversion_id': + $maxClause = " SELECT MAX(TCV.id) AS tcversion_id "; + $selectClause = " SELECT TCV.id AS tcversion_id "; + break; + } + + $sql = "/* $debugMsg */ " . + " {$maxClause}, NH_TCVERSION.parent_id AS testcase_id " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . + " ON NH_TCVERSION.id = TCV.id AND TCV.active=1 " . + " AND NH_TCVERSION.parent_id IN ({$itemSet}) " . + " GROUP BY NH_TCVERSION.parent_id " . + " ORDER BY NH_TCVERSION.parent_id "; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcversion_id'); + + $cfSelect = ''; + $cfJoin = ''; + $cfQuery = ''; + $cfQty = 0; + + if (! is_null($recordset)) { + if (! is_null($my['filters']['cfields'])) { + $cf_hash = &$my['filters']['cfields']; + $cfQty = count($cf_hash); + $countmain = 1; + + // Build custom fields filter + // do not worry!! it seems that filter criteria is OR, + // but really is an AND, + // OR is needed to do a simple query. + // with processing on recordset becomes an AND + foreach ($cf_hash as $cf_id => $cf_value) { + if ($countmain != 1) { + $cfQuery .= " OR "; + } + if (is_array($cf_value)) { + $count = 1; + + foreach ($cf_value as $value) { + if ($count > 1) { + $cfQuery .= " AND "; + } + $cfQuery .= " ( CFDV.value LIKE '%{$value}%' AND CFDV.field_id = {$cf_id} )"; + $count ++; + } + } else { + $cfQuery .= " ( CFDV.value LIKE '%{$cf_value}%' AND CFDV.field_id = {$cf_id} )"; + } + $countmain ++; + } + $cfSelect = ", CFDV.field_id, CFDV.value "; + $cfJoin = " JOIN {$this->tables['cfield_design_values']} CFDV ON CFDV.node_id = TCV.id "; + $cfQuery = " AND ({$cfQuery}) "; + } + + $keySet = implode(',', array_keys($recordset)); + $sql = "/* $debugMsg */ " . + " {$selectClause}, NH_TCVERSION.parent_id AS testcase_id, " . + " TCV.version,TCV.execution_type,TCV.importance,TCV.status {$cfSelect} " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . + " ON NH_TCVERSION.id = TCV.id {$cfJoin} " . + " AND NH_TCVERSION.id IN ({$keySet}) {$cfQuery}"; + + $recordset = $this->db->fetchRowsIntoMap($sql, + $my['options']['access_key'], database::CUMULATIVE); + + // now loop over result, + // Processing has to be done no matter value of cfQty + // (not doing this has produced in part TICKET 4704,4708) + // entries whose count() < number of custom fields has to be removed + if (! is_null($recordset)) { + $key2loop = array_keys($recordset); + if ($cfQty > 0) { + foreach ($key2loop as $key) { + if (count($recordset[$key]) < $cfQty) { + unset($recordset[$key]); + } else { + $recordset[$key] = $recordset[$key][0]; + unset($recordset[$key]['value']); + unset($recordset[$key]['field_id']); + } + } + } else { + foreach ($key2loop as $key) { + $recordset[$key] = $recordset[$key][0]; + } + } + + if (empty($recordset)) { + $recordset = null; + } + } + } + + return $recordset; + } + + /** + */ + public function filter_tcversions_by_exec_type($tcversion_id, $exec_type, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $itemSet = implode(',', (array) $tcversion_id); + + $my['options'] = array( + 'access_key' => 'tcversion_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* $debugMsg */ " . + " SELECT TCV.id AS tcversion_id, NH_TCVERSION.parent_id AS testcase_id, TCV.version " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . + " ON NH_TCVERSION.id = TCV.id AND TCV.execution_type={$exec_type}" . + " AND NH_TCVERSION.id IN ({$itemSet}) "; + + return $this->db->fetchRowsIntoMap($sql, $my['options']['access_key']); + } + + /** + */ + public function filter_tcversions($tcversion_id, $filters, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $itemSet = implode(',', (array) $tcversion_id); + + $my['options'] = array( + 'access_key' => 'tcversion_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* $debugMsg */ " . + " SELECT TCV.id AS tcversion_id, NH_TCVERSION.parent_id AS testcase_id, TCV.version " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . + " ON NH_TCVERSION.id = TCV.id "; + + if (! is_null($filters)) { + foreach ($filters as $key => $value) { + if (! is_null($value)) { + $sql .= " AND TCV.{$key}={$value} "; // Hmmm some problems coming with strings + } + } + } + $sql .= " AND NH_TCVERSION.id IN ({$itemSet}) "; + + return $this->db->fetchRowsIntoMap($sql, $my['options']['access_key']); + } + + /** + * given a test case version id, the provided steps will be analized in order + * to update whole steps/expected results structure for test case version. + * This can result in some step removed, other updated and other new created. + */ + public function update_tcversion_steps($tcversion_id, $steps) + { + // delete all current steps (if any exists) + // Attention: + // After addition of test case steps feature, a test case version + // can be root of a subtree that contains the steps. + // Remember we are using (at least on Postgres FK => we need to delete + // in a precise order. + $stepSet = (array) $this->get_steps($tcversion_id, 0, + array( + 'fields2get' => 'id', + 'accessKey' => 'id' + )); + if (! empty($stepSet)) { + $this->delete_step_by_id(array_keys($stepSet)); + } + + // Now insert steps + $loop2do = count($steps); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $this->create_step($tcversion_id, $steps[$idx]['step_number'], + $steps[$idx]['actions'], $steps[$idx]['expected_results'], + $steps[$idx]['execution_type']); + } + } + + /** + * update_last_modified + * + * @internal revision + * 20101016 - franciscom - refixing of BUGID 3849 + */ + public function update_last_modified($tcversion_id, $user_id, + $time_stamp = null) + { + $changed_ts = ! is_null($time_stamp) ? $time_stamp : $this->db->db_now(); + $sql = " UPDATE {$this->tables['tcversions']} " . " SET updater_id=" . + $this->db->prepare_int($user_id) . ", " . " modification_ts = " . + $changed_ts . " WHERE id = " . $this->db->prepare_int($tcversion_id); + $this->db->exec_query($sql); + } + + /** + * Given a tcversion set, returns a modified set, where only tcversion id + * that has requested values on Custom fields are returned. + * + * @param + * mixed tcversion_id: can be a single value or an array + * @param + * map cf_hash: custom fields id plus values + * @param + * map options: OPTIONAL + * + * @return array key: tcversion_id , + * element: array numerical index with as much element as custom fields + * + * @20170325: Ay! this search on EXACT VALUE not LIKE! + * changed! + */ + public function filter_tcversions_by_cfields($tcversion_id, $cf_hash, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $recordset = null; + $itemSet = implode(',', (array) $tcversion_id); + + $my['options'] = array( + 'access_key' => 'tcversion_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $or_clause = ''; + $cf_query = ''; + $cf_qty = count($cf_hash); + + // do not worry!! it seems that filter criteria is OR, but really is an AND, + // OR is needed to do a simple query. + // with processing on recordset becomes an AND + foreach ($cf_hash as $cf_id => $cf_value) { + $cf_query .= $or_clause . " (CFDV.field_id=" . $cf_id . + " AND CFDV.value LIKE '%{$cf_value}%') "; + $or_clause = ' OR '; + } + + $sql = "/* $debugMsg */ " . " SELECT TCV.id AS tcversion_id, " . + " NH_TCVERSION.parent_id AS testcase_id, TCV.version," . + " CFDV.field_id,CFDV.value " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCVERSION " . + " ON NH_TCVERSION.id = TCV.id " . + " JOIN {$this->tables['cfield_design_values']} CFDV " . + " ON CFDV.node_id = TCV.id " . + " AND NH_TCVERSION.id IN ({$itemSet}) AND ({$cf_query}) "; + + $recordset = $this->db->fetchRowsIntoMap($sql, + $my['options']['access_key'], database::CUMULATIVE); + + // now loop over result, entries whose count() < number of custom fields has to be removed + if (! is_null($recordset)) { + $key2loop = array_keys($recordset); + foreach ($key2loop as $key) { + if (count($recordset[$key]) < $cf_qty) { + unset($recordset[$key]); + } + } + if (empty($recordset)) { + $recordset = null; + } + } + return $recordset; + } + + /** + * + * @used-by execSetResults.php + */ + public function getExecutionSet($id, $version_id = null, $filters = null, + $options = null) + { + // need to understand if possibility of choosing order by + // allow us to replace completely code that seems duplicate + // get_executions. + // + // NHA.node_order ASC, NHA.parent_id ASC, execution_id DESC + $debugMsg = $this->debugMsg . __FUNCTION__; + + // IMPORTANT NOTICE: keys are field names of executions tables + $my['filters'] = [ + 'tcversion_id' => null, + 'testplan_id' => null, + 'platform_id' => null, + 'build_id' => null + ]; + + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'exec_id_order' => 'DESC' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $filterBy = array(); + $filterKeys = [ + 'build_id', + 'platform_id', + 'testplan_id', + 'tcversion_id' + ]; + + foreach ($filterKeys as $fieldName) { + $filterBy[$fieldName] = ''; // default -> no filter + + if ($fieldName == 'platform_id' && $my['filters'][$fieldName] == - 1) { + continue; + } + + if (! is_null($my['filters'][$fieldName])) { + $itemSet = implode(',', (array) ($my['filters'][$fieldName])); + $filterBy[$fieldName] = " AND E.{$fieldName} IN ({$itemSet}) "; + } + } + + // -------------------------------------------------------------------- + if (is_array($id)) { + $tcid_list = implode(",", $id); + $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) "; + } else { + $where_clause = " WHERE NHTCV.parent_id = {$id} "; + } + + if (! is_null($version_id)) { + if (is_array($version_id)) { + foreach ($version_id as &$elem) { + $elem = intval($elem); + } + $where_clause .= ' AND TCV.id IN (' . implode(",", $version_id) . + ') '; + } else { + if ($version_id != self::ALL_VERSIONS) { + $where_clause .= ' AND TCV.id = ' . intval($version_id); + } + } + } + + $sql = "/* $debugMsg */ SELECT NHTC.name,NHTCV.parent_id AS testcase_id, NHTCV.id AS tcversion_id, " . + " TCV.*, " . + " U.login AS tester_login, U.first AS tester_first_name, U.last AS tester_last_name," . + " E.tester_id AS tester_id,E.id AS execution_id, E.status,E.tcversion_number," . + " E.notes AS execution_notes, E.execution_ts, E.execution_type AS execution_run_type," . + " E.execution_duration," . + " E.build_id AS build_id, B.name AS build_name, B.active AS build_is_active, " . + " B.is_open AS build_is_open,E.platform_id, PLATF.name AS platform_name," . + " E.testplan_id,NHTPLAN.name AS testplan_name,TPTCV.id AS feature_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = NHTCV.id " . $filterBy['testplan_id'] . + $filterBy['build_id'] . $filterBy['platform_id'] . + $filterBy['tcversion_id'] . " /* To get build name */ " . + " JOIN {$this->tables['builds']} B ON B.id=E.build_id " . + " /* To get test plan name */ " . + // " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = E.testplan_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id = E.testplan_id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.testplan_id = E.testplan_id " . + " AND TPTCV.tcversion_id = E.tcversion_id " . + " AND TPTCV.platform_id = E.platform_id " . + " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = E.platform_id " . + $where_clause . + " ORDER BY execution_id {$my['options']['exec_id_order']} "; + + $recordset = $this->db->fetchArrayRowsIntoMap($sql, 'id'); + return $recordset ? $recordset : null; + } + + /** + * for test case id and filter criteria return set with platforms + * where test case has a version that has been executed. + */ + public function getExecutedPlatforms($id, $filters = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['filters'] = array( + 'version_id' => null, + 'tplan_id' => null, + 'platform_id' => null, + 'build_id' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'exec_id_order' => 'DESC' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $filterKeys = array( + 'build_id', + 'platform_id', + 'tplan_id' + ); + foreach ($filterKeys as $key) { + $filterBy[$key] = ''; + if (! is_null($my['filters'][$key])) { + $itemSet = implode(',', (array) $$key); + $filterBy[$key] = " AND e.{$key} IN ({$itemSet}) "; + } + } + + // -------------------------------------------------------------------- + if (is_array($id)) { + $tcid_list = implode(",", $id); + $where_clause = " WHERE NHTCV.parent_id IN ({$tcid_list}) "; + } else { + $where_clause = " WHERE NHTCV.parent_id = {$id} "; + } + + $sql = "/* $debugMsg */ SELECT DISTINCT e.platform_id,p.name " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['tcversions']} tcversions ON NHTCV.id = tcversions.id " . + " JOIN {$this->tables['executions']} e ON NHTCV.id = e.tcversion_id " . + " {$filterBy['tplan_id']} {$filterBy['build_id']} {$filterBy['platform_id']} " . + " JOIN {$this->tables['builds']} b ON e.build_id=b.id " . + " LEFT OUTER JOIN {$this->tables['platforms']} p ON p.id = e.platform_id " . + $where_clause; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'platform_id'); + return $recordset ? $recordset : null; + } + + /** + * Solve point to my self + * + *

    added by web rich editor create some layout issues + */ + public function renderGhostSteps(&$steps2render, $scan = null) + { + $warningRenderException = lang_get('unable_to_render_ghost'); + $loop2do = count($steps2render); + + $tlBeginMark = self::GHOSTBEGIN; + $tlEndMark = self::GHOSTEND; + $tlEndMarkLen = strlen($tlEndMark); + + $key2check = array( + 'actions', + 'expected_results' + ); + + // I've discovered that working with Web Rich Editor generates + // some additional not wanted entities, that disturb a lot + // when trying to use json_decode(). + // Hope this set is enough. + // $replaceSet = array($tlEndMark, '

    ', '

    ',' '); + $replaceSetWebRichEditor = array( + '

    ', + '

    ', + ' ' + ); + + $rse = &$steps2render; + for ($gdx = 0; $gdx < $loop2do; $gdx ++) { + foreach ($key2check as $item_key) { + $deghosted = false; + $start = false; + + if (isset($rse[$gdx][$item_key])) { + $start = strpos($rse[$gdx][$item_key], $tlBeginMark); + $ghost = $rse[$gdx][$item_key]; + } + + if ($start !== false) { + $xx = explode($tlBeginMark, $rse[$gdx][$item_key]); + $xx2do = count($xx); + $ghost = ''; + $deghosted = false; + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + try { + if (($cutting_point = strpos($xx[$xdx], $tlEndMark)) !== + false) { + // here I've made a mistake + // Look at this situation: + // + // ** Original String + // [ghost]"Step":1,"TestCase":"BABA-1","Version":1[/ghost] RIGHT + // + // ** $xx[$xdx] + // "Step":1,"TestCase":"BABA-1","Version":1[/ghost] RIGHT + // Then $ydx = trim(str_replace($replaceSet,'',$xx[$xdx])); + // + // WRONG!!! => "Step":1,"TestCase":"BABA-1","Version":1 + // + // Need to CUT WHERE I have found $tlEndMark + // + $leftside = trim( + substr($xx[$xdx], 0, $cutting_point)); + $rightside = trim( + substr($xx[$xdx], + $cutting_point + $tlEndMarkLen)); + $dx = '{' . + html_entity_decode(trim($leftside, '\n')) . + '}'; + $dx = json_decode($dx, true); + + if (isset($dx['Step'])) { + if (($xid = $this->getInternalID( + $dx['TestCase'])) > 0) { + // Start looking initially just for ACTIVE Test Case Versions + $vn = isset($dx['Version']) ? intval( + $dx['Version']) : 0; + if ($vn == 0) { + // User wants to follow latest ACTIVE VERSION + $yy = $this->getLastVersionInfo( + $xid, + array( + 'output' => 'full', + 'active' => 1 + )); + if (is_null($yy)) { + // seems all versions are inactive, in this situation will get latest + $yy = $this->getLastVersionInfo( + $xid, + array( + 'output' => 'full' + )); + } + $vn = intval($yy['version']); + } + + $fi = $this->get_basic_info($xid, + array( + 'number' => $vn + )); + if (! is_null($fi) && + intval($dx['Step']) > 0) { + $deghosted = true; + $stx = $this->get_steps( + $fi[0]['tcversion_id'], + $dx['Step']); + $ghost .= str_replace( + $replaceSetWebRichEditor, '', + $stx[0][$item_key]) . $rightside; + } + } + } else { + // seems we have found a ghost test case INSTEAD OF a GHOST test case STEP + // Then I do a trick creating an artificial 'summary' member + $zorro = array( + 'summary' => $tlBeginMark . $leftside . + $tlEndMark + ); + $this->renderGhost($zorro); + $deghosted = true; + $ghost .= $zorro['summary'] . $rightside; + } + } else { + $ghost = $xx[$xdx]; // 20131022 + } + } catch (Exception $e) { + $deghosted = true; + $ghost .= $warningRenderException . + $rse[$gdx][$item_key]; + } + } + } // $start + + if ($deghosted) { + $rse[$gdx][$item_key] = $ghost; + } + + if (null != $scan) { + $gaga = implode(',', $scan); + $rse[$gdx][$item_key] = $this->replaceTextBTWTags( + $rse[$gdx][$item_key], $gaga); + } + } + } + } + + /** + * Gets test cases created per user. + * The test cases are restricted to a + * test plan of a test project. This method performs a query to database + * using the given arguments. + * + * Optional values may be passed in the options array. These optional + * values include tplan_id - Test plan ID. + * + * @param integer $user_id + * User ID + * @param integer $tproject_id + * Test Project ID + * @param mixed $options + * Optional array of options + * @return mixed Array of test cases created per user + */ + private function getCreatedPerUser($user_id, $tproject_id, $options) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $has_options = ! is_null($options); + + $sql = "/* $debugMsg */ SELECT " . + "TPROJ.id AS testproject_id, TPTCV.testplan_id, TCV.id AS tcversion_id," . + "TCV.version, TCV.tc_external_id, NHTC.id AS testcase_id, NHTC.name, " . + "TCV.creation_ts, TCV.modification_ts, TPROJ.prefix, U.first AS first_name," . + "U.last AS last_name, U.login, (TPTCV.urgency * TCV.importance) AS priority " . + "FROM testprojects TPROJ, users U JOIN tcversions TCV ON U.id = TCV.author_id " . + "JOIN nodes_hierarchy NHTCV ON TCV.id = NHTCV.id " . + "JOIN nodes_hierarchy NHTC ON NHTCV.parent_id = NHTC.id " . + "LEFT OUTER JOIN testplan_tcversions TPTCV ON TCV.id = TPTCV.tcversion_id " . + "LEFT OUTER JOIN testplans TPLAN ON TPTCV.testplan_id = TPLAN.id " . + "LEFT OUTER JOIN testprojects TPROJ_TPLAN ON TPLAN.testproject_id = TPROJ_TPLAN.id " . + "WHERE TPROJ.id = {$tproject_id}"; + + if ($user_id !== 0) { + $sql .= " AND U.id = {$user_id}"; + } + + if ($has_options && isset($options->tplan_id)) { + $sql .= " AND TPTCV.testplan_id = {$options->tplan_id}"; + } + + if ($has_options && isset($options->startTime)) { + $sql .= " AND TCV.creation_ts >= '{$options->startTime}'"; + } + + if ($has_options && isset($options->endTime)) { + $sql .= " AND TCV.creation_ts <= '{$options->endTime}'"; + } + + $access_key = array( + 'testplan_id', + 'testcase_id' + ); + if ($has_options && isset($options->access_keys)) { + switch ($options->access_keys) { + case 'testplan_testcase': + $access_key = array( + 'testplan_id', + 'testcase_id' + ); + break; + + case 'testcase_testplan': + $access_key = array( + 'testcase_id', + 'testplan_id' + ); + break; + + default: + $access_key = array( + 'testplan_id', + 'testcase_id' + ); + break; + } + } + + $rs = $this->db->fetchMapRowsIntoMap($sql, $access_key[0], + $access_key[1], database::CUMULATIVE); + + if ($has_options && ! is_null($rs) && ! isset($options->access_keys) || + (is_null($options->access_keys) || + $options->access_keys = 'testplan_testcase')) { + $tcaseSet = null; + $main_keys = array_keys($rs); + foreach ($main_keys as $maccess_key) { + $sec_keys = array_keys($rs[$maccess_key]); + foreach ($sec_keys as $saccess_key) { + // is enough I process first element + $item = $rs[$maccess_key][$saccess_key][0]; + if (! isset($tcaseSet[$item['testcase_id']])) { + $tcaseSet[$item['testcase_id']] = $item['testcase_id']; + } + } + } + + $path_info = $this->tree_manager->get_full_path_verbose($tcaseSet); + + // Remove test project piece and convert to string + $flat_path = null; + foreach ($path_info as $tcase_id => $pieces) { + unset($pieces[0]); + $flat_path[$tcase_id] = implode('/', $pieces); + } + $main_keys = array_keys($rs); + + foreach ($main_keys as $idx) { + $sec_keys = array_keys($rs[$idx]); + foreach ($sec_keys as $jdx) { + $third_keys = array_keys($rs[$idx][$jdx]); + foreach ($third_keys as $tdx) { + $fdx = $rs[$idx][$jdx][$tdx]['testcase_id']; + $rs[$idx][$jdx][$tdx]['tcase_full_path'] = $flat_path[$fdx]; + } + } + break; + } + } + + return $rs; + } + + /** + */ + public function setExecutionType($tcversionID, $value, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['opt'] = array( + 'updSteps' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $execType = $this->db->prepare_int(intval($value)); + $safeTCVID = $this->db->prepare_int($tcversionID); + + $sql = "/* $debugMsg */ " . " UPDATE {$this->tables['tcversions']} " . + " SET execution_type={$execType} WHERE id = {$safeTCVID} "; + $this->db->exec_query($sql); + + if ($my['opt']['updSteps']) { + $opx = array( + 'fields2get' => 'id' + ); + $stepIDSet = $this->get_steps($safeTCVID, null, $opx); + + if (! is_null($stepIDSet)) { + $target = array(); + foreach ($stepIDSet as $elem) { + $target[] = $elem['id']; + } + $inClause = implode(',', $target); + $sqlX = " UPDATE {$this->tables['tcsteps']} " . + " SET execution_type={$execType} WHERE id IN (" . $inClause . + ")"; + $this->db->exec_query($sqlX); + } + } + + return array( + $value, + $execType, + $sql + ); + } + + /** + */ + public function setEstimatedExecDuration($tcversionID, $value) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $safe = trim($value); + $safe = is_numeric($safe) ? $safe : null; + + $sql = "/* $debugMsg */ " . " UPDATE {$this->tables['tcversions']} " . + " SET estimated_exec_duration=" . + ((is_null($safe) || $safe == '') ? 'NULL' : $safe) . " WHERE id = " . + $this->db->prepare_int($tcversionID); + $this->db->exec_query($sql); + return array( + $value, + $safe, + $sql + ); + } + + /** + * + * @param array $identity: + * id, version_id + * @param array $execContext: + * tplan_id, platform_id,build_id + * @internal revisions + * + * @since 1.9.4 + */ + public function getLatestExecSingleContext($identity, $execContext, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $cfg = config_get('results'); + $status_not_run = $cfg['status_code']['not_run']; + + $my = array( + 'opt' => array( + 'output' => 'full' + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $options); + $safeContext = $execContext; + $safeIdentity = $identity; + foreach ($safeContext as &$ele) { + $ele = intval($ele); + } + + foreach ($safeIdentity as &$ele) { + $ele = intval($ele); + } + + // dammed names!!! + $safeContext['tplan_id'] = isset($safeContext['tplan_id']) ? $safeContext['tplan_id'] : $safeContext['testplan_id']; + if ($safeContext['platform_id'] < 0) { + $safeContext['platform_id'] = 0; + } + + // we have to manage following situations + // 1. we do not know test case version id. + if ($safeIdentity['version_id'] > 0) { + $addJoinLEX = ''; + $addWhereLEX = " AND EE.tcversion_id = " . + $safeIdentity['version_id']; + $addWhere = " AND TPTCV.tcversion_id = " . + $safeIdentity['version_id']; + } else { + $addJoinLEX = " JOIN {$this->tables['nodes_hierarchy']} H2O " . + " ON H2O.id = EE.tcversion_id "; + $addWhereLEX = " AND H2O.parent_id = " . $safeIdentity['id']; + $addWhere = " AND NHTC.id = " . $safeIdentity['id']; + } + + $sqlLEX = ' SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id,' . + ' MAX(EE.id) AS id ' . " FROM {$this->tables['executions']} EE " . + $addJoinLEX . ' WHERE EE.testplan_id = ' . $safeContext['tplan_id'] . + ' AND EE.platform_id = ' . $safeContext['platform_id'] . + ' AND EE.build_id = ' . $safeContext['build_id'] . $addWhereLEX . + ' GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id ,EE.build_id '; + + $out = null; + switch ($my['opt']['output']) { + case 'exec_id': + $dummy = $this->db->get_recordset($sqlLEX); + $out = (! is_null($dummy) ? $dummy[0]['id'] : null); + break; + + case 'timestamp': + $sql = "/* $debugMsg */ SELECT E.id AS execution_id, " . + " COALESCE(E.status,'{$status_not_run}') AS status," . + " NHTC.id AS testcase_id, TCV.id AS tcversion_id, E.execution_ts" . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.platform_id = TPTCV.platform_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.build_id = {$safeContext['build_id']} " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.id = LEX.id " . + " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . + " AND TPTCV.platform_id = {$safeContext['platform_id']} " . + $addWhere . + " AND (E.build_id = {$safeContext['build_id']} OR E.build_id IS NULL)"; + + // using database::CUMULATIVE is just a trick to return data structure + // that will be liked on execSetResults.php + $out = $this->db->fetchRowsIntoMap($sql, 'testcase_id', + database::CUMULATIVE); + break; + + case 'full': + default: + $sql = "/* $debugMsg */ SELECT E.id AS execution_id, " . + " COALESCE(E.status,'{$status_not_run}') AS status, E.execution_type AS execution_run_type," . + " NHTC.name, NHTC.id AS testcase_id, NHTC.parent_id AS tsuite_id," . + " TCV.id AS tcversion_id,TCV.tc_external_id,TCV.version,TCV.summary," . + " TCV.preconditions,TCV.importance,TCV.author_id," . + " TCV.creation_ts,TCV.updater_id,TCV.modification_ts,TCV.active," . + " TCV.is_open,TCV.execution_type," . + " U.login AS tester_login,U.first AS tester_first_name," . + " U.last AS tester_last_name, E.tester_id AS tester_id," . + " E.notes AS execution_notes, E.execution_ts, E.build_id,E.tcversion_number," . + " B.name AS build_name, B.active AS build_is_active, B.is_open AS build_is_open," . + " COALESCE(PLATF.id,0) AS platform_id,PLATF.name AS platform_name, TPTCV.id AS feature_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.platform_id = TPTCV.platform_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.build_id = {$safeContext['build_id']} " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.id = LEX.id " . + " JOIN {$this->tables['builds']} B ON B.id = {$safeContext['build_id']} " . + " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = {$safeContext['platform_id']} " . + " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . + " AND TPTCV.platform_id = {$safeContext['platform_id']} " . + $addWhere . + " AND (E.build_id = {$safeContext['build_id']} OR E.build_id IS NULL)"; + + // using database::CUMULATIVE is just a trick to return data structure + // that will be liked on execSetResults.php + $out = $this->db->fetchRowsIntoMap($sql, 'testcase_id', + database::CUMULATIVE); + break; + } + return $out; + } + + /** + * + * DBExec means we do not considered NOT RUN, because are not written to DB. + * + * @param array $identity: + * id, version_id + * @param array $execContext: + * tplan_id, platform_id + * @internal revisions + * + * @since 1.9.4 + */ + private function getLatestDBExecPlatformContext($identity, $execContext, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $cfg = config_get('results'); + $status_not_run = $cfg['status_code']['not_run']; + + $my = array( + 'opt' => array( + 'output' => 'full' + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $options); + $safeContext = $execContext; + $safeIdentity = $identity; + foreach ($safeContext as &$ele) { + $ele = intval($ele); + } + foreach ($safeIdentity as &$ele) { + $ele = intval($ele); + } + + // we have to manage following situations + // 1. we do not know test case version id. + if ($safeIdentity['version_id'] > 0) { + $addJoinLEX = ''; + $addWhereLEX = " AND EE.tcversion_id = " . + $safeIdentity['version_id']; + $addWhere = " AND TPTCV.tcversion_id = " . + $safeIdentity['version_id']; + } else { + $addJoinLEX = " JOIN {$this->tables['nodes_hierarchy']} H2O " . + " ON H2O.id = EE.tcversion_id "; + $addWhereLEX = " AND H2O.parent_id = " . $safeIdentity['id']; + $addWhere = " AND NHTC.id = " . $safeIdentity['id']; + } + + $sqlLEX = ' SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,' . + ' MAX(EE.id) AS id ' . " FROM {$this->tables['executions']} EE " . + $addJoinLEX . ' WHERE EE.testplan_id = ' . $safeContext['tplan_id'] . + ' AND EE.platform_id = ' . $safeContext['platform_id'] . $addWhereLEX . + ' GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id'; + + $out = null; + switch ($my['opt']['output']) { + case 'exec_id': + $dummy = $this->db->get_recordset($sqlLEX); + $out = (! is_null($dummy) ? $dummy[0]['id'] : null); + break; + + case 'full': + default: + $sql = "/* $debugMsg */ SELECT E.id AS execution_id, " . + " COALESCE(E.status,'{$status_not_run}') AS status, E.execution_type AS execution_run_type," . + " NHTC.name, NHTC.id AS testcase_id, NHTC.parent_id AS tsuite_id," . + " TCV.id AS tcversion_id,TCV.tc_external_id,TCV.version,TCV.summary," . + " TCV.preconditions,TCV.importance,TCV.author_id," . + " TCV.creation_ts,TCV.updater_id,TCV.modification_ts,TCV.active," . + " TCV.is_open,TCV.execution_type," . + " U.login AS tester_login,U.first AS tester_first_name," . + " U.last AS tester_last_name, E.tester_id AS tester_id," . + " E.notes AS execution_notes, E.execution_ts, E.build_id,E.tcversion_number," . + " B.name AS build_name, B.active AS build_is_active, B.is_open AS build_is_open," . + " COALESCE(PLATF.id,0) AS platform_id,PLATF.name AS platform_name, TPTCV.id AS feature_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id" . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.platform_id = TPTCV.platform_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " JOIN {$this->tables['executions']} E " . + " ON E.id = LEX.id " . + " JOIN {$this->tables['builds']} B ON B.id = E.build_id " . + " JOIN {$this->tables['users']} U ON U.id = E.tester_id " . + " /* Left outer on Platforms because Test plan can have NO PLATFORMS */ " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLATF " . + " ON PLATF.id = {$safeContext['platform_id']} " . + " WHERE TPTCV.testplan_id = {$safeContext['tplan_id']} " . + " AND TPTCV.platform_id = {$safeContext['platform_id']} " . + $addWhere; + + // using database::CUMULATIVE is just a trick to return data structure + // that will be liked on execSetResults.php + $out = $this->db->fetchRowsIntoMap($sql, 'testcase_id', + database::CUMULATIVE); + break; + } + + return $out; + } + + /** + */ + public function getExecution($execID, $tcversionID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT NHTC.name,NHTCV.parent_id AS testcase_id, NHTCV.id AS tcversion_id, " . + " TCV.*, " . + " U.login AS tester_login, U.first AS tester_first_name, U.last AS tester_last_name," . + " E.tester_id AS tester_id,E.id AS execution_id, E.status,E.tcversion_number," . + " E.notes AS execution_notes, E.execution_ts, E.execution_type AS execution_run_type," . + " E.build_id AS build_id, B.name AS build_name, B.active AS build_is_active, " . + " B.is_open AS build_is_open,E.platform_id, PLATF.name AS platform_name," . + " E.testplan_id,NHTPLAN.name AS testplan_name,TPTCV.id AS feature_id, TPLAN.api_key AS testplan_api_key" . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = NHTCV.id " . " /* To get build name */ " . + " JOIN {$this->tables['builds']} B ON B.id=E.build_id " . + " /* To get test plan name */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN ON NHTPLAN.id = E.testplan_id " . + " JOIN {$this->tables['testplans']} TPLAN ON TPLAN.id = E.testplan_id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.testplan_id = E.testplan_id " . + " AND TPTCV.tcversion_id = E.tcversion_id " . + " AND TPTCV.platform_id = E.platform_id " . + " LEFT OUTER JOIN {$this->tables['users']} U ON U.id = E.tester_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLATF ON PLATF.id = E.platform_id " . + " WHERE E.id = " . intval($execID) . " AND E.tcversion_id = " . + intval($tcversionID); + $rs = $this->db->get_recordset($sql); + return $rs ? $rs : null; + } + + /** + */ + public function getAuditSignature($context, $options = null) + { + $key2check = array( + 'tcversion_id', + 'id' + ); + $safeID = array(); + foreach ($key2check as $key) { + if (property_exists($context, $key)) { + $safeID[$key] = intval($context->$key); + } else { + $safeID[$key] = - 1; + } + } + + if ($safeID['id'] <= 0 && $safeID['tcversion_id'] > 0) { + $node = $this->tree_manager->get_node_hierarchy_info( + $safeID['tcversion_id']); + $safeID['id'] = $node['parent_id']; + } + + // we need: + // Test Case External ID + // Test Case Name + // Test Case Path + // What about test case version ID ? => only if argument provided + // + $pathInfo = $this->tree_manager->get_full_path_verbose($safeID['id'], + array( + 'output_format' => 'id_name' + )); + $pathInfo = current($pathInfo); + $path = '/' . implode('/', $pathInfo['name']) . '/'; + $tcase_prefix = $this->getPrefix($safeID['id'], $pathInfo['node_id'][0]); + $info = $this->getLastVersionInfo($safeID['id'], + array( + 'output' => 'medium' + )); + return $path . $tcase_prefix[0] . $this->cfg->testcase->glue_character . + $info['tc_external_id'] . ':' . $info['name']; + } + + /** + */ + public function getTestSuite($id) + { + $dummy = $this->tree_manager->get_node_hierarchy_info($id); + return $dummy['parent_id']; + } + + public function getIdCardByStepID($step_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT NH_TCV.parent_id AS tcase_id, NH_STEPS.parent_id AS tcversion_id" . + " FROM {$this->tables['nodes_hierarchy']} NH_STEPS " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = NH_STEPS.parent_id " . + " WHERE NH_STEPS.id = " . intval($step_id); + $rs = $this->db->get_recordset($sql); + return is_null($rs) ? $rs : $rs[0]; + } + + /** + */ + private function initShowGui($guiObj, $grantsObj, $idCard) + { + $id = $idCard->tcase_id; + $goo = is_null($guiObj) ? new stdClass() : $guiObj; + + if (! property_exists($goo, 'closeMyWindow')) { + $goo->closeMyWindow = 0; + } + + if (! property_exists($goo, 'uploadOp')) { + $goo->uploadOp = null; + } + + $goo->new_version_source = 'this'; + + $goo->execution_types = $this->execution_types; + $goo->tcase_cfg = $this->cfg->testcase; + $goo->import_limit = TL_REPOSITORY_MAXFILESIZE; + $goo->msg = ''; + $goo->fileUploadMsg = ''; + + $goo->requirement_mgmt = property_exists($grantsObj, 'mgt_modify_req') ? $grantsObj->mgt_modify_req : null; + if (is_null($goo->requirement_mgmt)) { + $goo->requirement_mgmt = property_exists($grantsObj, + 'requirement_mgmt') ? $grantsObj->requirement_mgmt : 0; + } + + // some config options have been migrated to rights + // In order to refactor less code, we will remap to OLD config options present on config file. + $goo->tcase_cfg->can_edit_executed = $grantsObj->testproject_edit_executed_testcases == + 'yes' ? 1 : 0; + $goo->tcase_cfg->can_delete_executed = $grantsObj->testproject_delete_executed_testcases == + 'yes' ? 1 : 0; + + $goo->tcase_cfg->can_add_remove_kw_on_executed = 0; + $g2c = 'testproject_add_remove_keywords_executed_tcversions'; + if (property_exists($grantsObj, $g2c)) { + $goo->tcase_cfg->can_add_remove_kw_on_executed = ($grantsObj->$g2c == + 'yes' ? 1 : 0); + } + + $goo->view_req_rights = property_exists($grantsObj, 'mgt_view_req') ? $grantsObj->mgt_view_req : 0; + $goo->assign_keywords = property_exists($grantsObj, 'keyword_assignment') ? $grantsObj->keyword_assignment : 0; + $goo->req_tcase_link_management = property_exists($grantsObj, + 'req_tcase_link_management') ? $grantsObj->req_tcase_link_management : 0; + + $goo->parentTestSuiteName = ''; + $goo->tprojectName = ''; + $goo->submitCode = ""; + $goo->dialogName = ''; + $goo->bodyOnLoad = ""; + $goo->bodyOnUnload = "storeWindowSize('TCEditPopup')"; + + $goo->tableColspan = $this->layout->tableToDisplayTestCaseSteps->colspan; + + $goo->tc_current_version = array(); + $goo->status_quo = array(); + $goo->keywords_map = array(); + $goo->arrReqs = array(); + + $goo->cf_current_version = null; + $goo->cf_other_versions = null; + $goo->linked_versions = null; + $goo->platforms = null; + + // add_relation_feedback_msg @used-by testcaseCommands.class.php:doAddRelation() + $viewer_defaults = array( + 'title' => lang_get('title_test_case'), + 'show_title' => 'no', + 'action' => '', + 'msg_result' => '', + 'user_feedback' => '', + 'refreshTree' => 1, + 'disable_edit' => 0, + 'display_testproject' => 0, + 'display_parent_testsuite' => 0, + 'hilite_testcase_name' => 0, + 'show_match_count' => 0, + 'add_relation_feedback_msg' => '' + ); + + $viewer_defaults = array_merge($viewer_defaults, + (array) $guiObj->viewerArgs); + + $goo->display_testproject = $viewer_defaults['display_testproject']; + $goo->display_parent_testsuite = $viewer_defaults['display_parent_testsuite']; + $goo->show_title = $viewer_defaults['show_title']; + $goo->hilite_testcase_name = $viewer_defaults['hilite_testcase_name']; + $goo->action = $viewer_defaults['action']; + $goo->user_feedback = $viewer_defaults['user_feedback']; + $goo->add_relation_feedback_msg = $viewer_defaults['add_relation_feedback_msg']; + + $goo->pageTitle = $viewer_defaults['title']; + $goo->display_testcase_path = ! is_null($goo->path_info); + $goo->show_match_count = $viewer_defaults['show_match_count']; + if ($goo->show_match_count && $goo->display_testcase_path) { + $goo->pageTitle .= '-' . lang_get('match_count') . ':' . + ($goo->match_count = count($goo->path_info)); + } + + $goo->refreshTree = isset($goo->refreshTree) ? $goo->refreshTree : $viewer_defaults['refreshTree']; + $goo->sqlResult = $viewer_defaults['msg_result']; + + // fine grain control of operations + if ($viewer_defaults['disable_edit'] == 1 || + (! $grantsObj->mgt_modify_tc)) { + $goo->show_mode = 'editDisabled'; + } elseif (! is_null($goo->show_mode) && $goo->show_mode == 'editOnExec') { + // refers to two javascript functions present in testlink_library.js + // and logic used to refresh both frames when user call this + // method to edit a test case while executing it. + $goo->dialogName = 'tcview_dialog'; + $goo->bodyOnLoad = "dialog_onLoad($guiObj->dialogName)"; + $goo->bodyOnUnload = "dialog_onUnload($guiObj->dialogName)"; + $goo->submitCode = "return dialog_onSubmit($guiObj->dialogName)"; + + if (! property_exists($goo, 'additionalURLPar')) { + $goo->additionalURLPar = ''; + } + } + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $goo->domainTCStatus = $dummy['lbl']; + $goo->TCWKFStatusVerboseCode = config_get('testCaseStatus'); + $goo->TCWKFStatusDisplayHintOnTestDesign = config_get( + 'testCaseStatusDisplayHintOnTestDesign'); + + // editOnExec is part of show_mode Domain + $goo->can_do = $this->getShowViewerActions($goo->show_mode); + $key = 'testcase_freeze'; + if (property_exists($grantsObj, $key)) { + $goo->can_do->freeze = $grantsObj->$key; + } + + $key = 'delete_frozen_tcversion'; + if (property_exists($grantsObj, $key)) { + $goo->can_do->delete_frozen_tcversion = $grantsObj->$key; + } + + $path2root = $this->tree_manager->get_path($id); + $goo->tproject_id = $path2root[0]['parent_id']; + $info = $this->tproject_mgr->get_by_id($goo->tproject_id); + $goo->requirementsEnabled = $info['opt']->requirementsEnabled; + + if ($goo->display_testproject) { + $goo->tprojectName = $info['name']; + } + + if ($goo->display_parent_testsuite) { + $parent = count($path2root) - 2; + $goo->parentTestSuiteName = $path2root[$parent]['name']; + } + + $testplans = $this->tproject_mgr->get_all_testplans($goo->tproject_id, + array( + 'plan_status' => 1 + )); + $goo->has_testplans = ! empty($testplans) ? 1 : 0; + + $platformMgr = new tlPlatform($this->db, $goo->tproject_id); + + $opx = array( + 'enable_on_design' => true, + 'enable_on_execution' => false + ); + $goo->platforms = $platformMgr->getAllAsMap($opx); + + $goo->tcasePrefix = $this->tproject_mgr->getTestCasePrefix( + $goo->tproject_id) . $this->cfg->testcase->glue_character; + + $goo->scripts = null; + $goo->tcase_id = $idCard->tcase_id; + $goo->tcversion_id = $idCard->tcversion_id; + $goo->allowStepAttachments = false; + $designEditorCfg = getWebEditorCfg('design'); + $goo->designEditorType = $designEditorCfg['type']; + $stepDesignEditorCfg = getWebEditorCfg('steps_design'); + $goo->stepDesignEditorType = $stepDesignEditorCfg['type']; + + // Add To Testplan button will be disabled if + // the testcase doesn't belong to the current selected testproject + if ($idCard->tproject_id == $goo->tproject_id) { + $goo->can_do->add2tplan = ($goo->can_do->add2tplan == 'yes') ? $grantsObj->testplan_planning : 'no'; + } else { + $goo->can_do->add2tplan = 'no'; + } + + return $goo; + } + + /** + */ + private function initShowGuiActions(&$gui) + { + $gui->deleteStepAction = "lib/testcases/tcEdit.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode" . + "&doAction=doDeleteStep&step_id="; + + $gui->tcExportAction = "lib/testcases/tcExport.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode"; + $gui->tcViewAction = "lib/testcases/archiveData.php?tproject_id={$gui->tproject_id}" . + "&show_mode=$gui->show_mode&tcase_id="; + + $gui->printTestCaseAction = "lib/testcases/tcPrint.php?tproject_id=$gui->tproject_id&show_mode=$gui->show_mode"; + + $gui->keywordsViewHREF = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id} " . + ' target="mainframe" class="bold" title="' . + lang_get('menu_manage_keywords') . '"'; + + $gui->reqSpecMgmtHREF = "lib/general/frmWorkArea.php?tproject_id={$gui->tproject_id}&feature=reqSpecMgmt"; + $gui->reqMgmtHREF = "lib/requirements/reqView.php?tproject_id={$gui->tproject_id}" . + "&showReqSpecTitle=1&requirement_id="; + + $gui->addTc2TplanHREF = "lib/testcases/tcAssign2Tplan.php?tproject_id={$gui->tproject_id}"; + } + + /** + * render Ghost Test Case + * + * + * @used by this.get_by_id(), this.getLastExecution() + * @used by this.renderGhostSteps() + */ + public function renderGhost(&$item2render) + { + $versionTag = '[version:%s]'; + $hint = "(link%s"; + + // $href = '%s:%s' . " $versionTag (link)

    "; + // second \'%s\' needed if I want to use Latest as indication, need to understand + // Javascript instead of javascript, because CKeditor sometimes complains + $href = '%s:%s' . + " $versionTag $hint

    "; + $tlBeginMark = self::GHOSTBEGIN; + $tlEndMark = self::GHOSTEND; + $tlEndMarkLen = strlen($tlEndMark); + + // I've discovered that working with Web Rich Editor generates + // some additional not wanted entities, that disturb a lot + // when trying to use json_decode(). + // Hope this set is enough. + // 20130605 - after algorithm change, this seems useless + // $replaceSet = array($tlEndMark, '

    ', '

    ',' '); + // $replaceSetWebRichEditor = array('

    ', '

    ',' '); + $key2check = array( + 'summary', + 'preconditions' + ); + $rse = &$item2render; + foreach ($key2check as $item_key) { + if (! isset($rse[$item_key])) { + continue; + } + $start = strpos($rse[$item_key], $tlBeginMark); + $ghost = $rse[$item_key]; + + // There is at least one request to replace ? + if ($start !== false) { + $xx = explode($tlBeginMark, $rse[$item_key]); + + // How many requests to replace ? + $xx2do = count($xx); + $ghost = ''; + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + $isTestCaseGhost = true; + + // Hope was not a false request. + // if( strpos($xx[$xdx],$tlEndMark) !== FALSE) + if (($cutting_point = strpos($xx[$xdx], $tlEndMark)) !== + false) { + // Separate command string from other text + // Theorically can be just ONE, but it depends + // is user had not messed things. + $yy = explode($tlEndMark, $xx[$xdx]); + + if (($elc = count($yy)) > 0) { + $dx = $yy[0]; + + // trick to convert to array + $dx = '{' . html_entity_decode(trim($dx, '\n')) . '}'; + $dx = json_decode($dx, true); + + try { + $xid = $this->getInternalID($dx['TestCase']); + if ($xid > 0) { + $linkFeedback = ")"; + $addInfo = ""; + $vn = isset($dx['Version']) ? intval( + $dx['Version']) : 0; + if ($vn == 0) { + // User wants to follow latest ACTIVE VERSION + $zorro = $this->getLastVersionInfo($xid, + array( + 'output' => 'full', + 'active' => 1 + )); + $linkFeedback = " to Latest ACTIVE Version)"; + if (is_null($zorro)) { + // seems all versions are inactive, in this situation will get latest + $zorro = $this->getLastVersionInfo( + $xid, + array( + 'output' => 'full' + )); + $addInfo = " - All versions are inactive!!"; + $linkFeedback = " to Latest Version{$addInfo})"; + } + $vn = intval($zorro['version']); + } + + $fi = $this->get_basic_info($xid, + array( + 'number' => $vn + )); + if (! is_null($fi)) { + if (isset($dx['Step'])) { + $isTestCaseGhost = false; + + // ghost for rendering Test Case Step (string display) + // [ghost]"Step":1,"TestCase":"MOK-2","Version":1[/ghost] + // + // ATTENTION REMEMBER THAT ALSO CAN BE: + // [ghost]"Step":1,"TestCase":"MOK-2","Version":""[/ghost] + // [ghost]"Step":1,"TestCase":"MOK-2"[/ghost] + // + if (intval($dx['Step']) > 0) { + $rightside = trim( + substr($xx[$xdx], + $cutting_point + + $tlEndMarkLen)); + $stx = $this->get_steps( + $fi[0]['tcversion_id'], + $dx['Step']); + + $ghost .= $stx[0]['actions'] . + $rightside; + } + } elseif ($dx['Preconditions']) { + $withPrecond = $this->get_basic_info( + $xid, [ + 'number' => $vn + ], [ + 'preconditions' + ]); + $isTestCaseGhost = false; + $rightside = trim( + substr($xx[$xdx], + $cutting_point + + $tlEndMarkLen)); + $ghost .= $withPrecond[0]['preconditions'] . + $rightside; + } else { + // ghost for rendering Test Case (create link) + $ghost .= sprintf($href, + $dx['TestCase'], $vn, + $dx['TestCase'], $fi[0]['name'], + $vn, $linkFeedback); + } + } + } + + if ($isTestCaseGhost) { + $lim = $elc - 1; + for ($cpx = 1; $cpx <= $lim; $cpx ++) { + $ghost .= $yy[$cpx]; + } + } + } catch (Exception $e) { + $ghost .= $rse[$item_key]; + } + } + } else { + $ghost .= $xx[$xdx]; + } + } + } + + if ($ghost != '') { + $rse[$item_key] = $ghost; + } + } + } + + /** + */ + public function setImportance($tcversionID, $value) + { + $sql = " UPDATE {$this->tables['tcversions']} " . " SET importance=" . + $this->db->prepare_int($value) . " WHERE id = " . + $this->db->prepare_int($tcversionID); + $this->db->exec_query($sql); + } + + /** + */ + public function setStatus($tcversionID, $value) + { + $sql = " UPDATE {$this->tables['tcversions']} " . " SET status=" . + $this->db->prepare_int($value) . " WHERE id = " . + $this->db->prepare_int($tcversionID); + $this->db->exec_query($sql); + } + + /** + * updateSimpleFields + * used to update fields of type int, string on test case version + * + * @param int $tcversionID + * item ID to update + * @param array $fieldsValues + * key DB field to update + * supported fields: + * summary,preconditions,execution_type,importance,status, + * updater_id,estimated_exec_duration + * + * @internal revisions + * + */ + public function updateSimpleFields($tcversionID, $fieldsValues) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $fieldsConvertions = array( + 'summary' => 'prepare_string', + 'preconditions' => 'prepare_string', + 'execution_type' => 'prepare_int', + 'importance' => 'prepare_int', + 'status' => 'prepare_int', + 'estimated_exec_duration' => null, + 'updater_id' => null + ); + $dummy = null; + $sql = null; + $ddx = 0; + foreach ($fieldsConvertions as $fkey => $fmethod) { + if (isset($fieldsValues[$fkey])) { + $dummy[$ddx] = $fkey . " = "; + if (! is_null($fmethod)) { + $sep = ($fmethod == 'prepare_string') ? "'" : ""; + $dummy[$ddx] .= $sep . + $this->db->$fmethod($fieldsValues[$fkey]) . $sep; + } else { + $dummy[$ddx] .= $fieldsValues[$fkey]; + } + $ddx ++; + } + } + if (! is_null($dummy)) { + $sqlSET = implode(",", $dummy); + $sql = "/* {$debugMsg} */ UPDATE {$this->tables['tcversions']} " . + "SET {$sqlSET} WHERE id={$tcversionID}"; + + $this->db->exec_query($sql); + } + return $sql; + } + + /** + * updateName + * check for duplicate name under same parent + * + * @param int $id + * test case id + * @param string $name + * + * @used-by XML-RPC API + */ + public function updateName($id, $name) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $ret['status_ok'] = true; + $ret['msg'] = 'ok'; + $ret['debug'] = ''; + $ret['API_error_code'] = 0; + + $field_size = config_get('field_size'); + $new_name = trim($name); + + if (($nl = mb_strlen($new_name)) <= 0) { + $ret['status_ok'] = false; + $ret['API_error_code'] = 'TESTCASE_EMPTY_NAME'; + $ret['msg'] = lang_get('API_' . $ret['API_error_code']); + } + + if ($ret['status_ok'] && $nl > $field_size->testcase_name) { + $ret['status_ok'] = false; + $ret['API_error_code'] = 'TESTCASE_NAME_LEN_EXCEEDED'; + $ret['msg'] = sprintf(lang_get('API_' . $ret['API_error_code']), $nl, + $field_size->testcase_name); + } + + if ($ret['status_ok']) { + // Go ahead + $check = $this->tree_manager->nodeNameExists($name, + $this->my_node_type, $id); + $ret['status_ok'] = ! $check['status']; + $ret['API_error_code'] = 'TESTCASE_SIBLING_WITH_SAME_NAME_EXISTS'; + $ret['msg'] = sprintf(lang_get('API_' . $ret['API_error_code']), + $name); + $ret['debug'] = ''; + } + + if ($ret['status_ok']) { + $rs = $this->tree_manager->get_node_hierarchy_info($id); + if (! is_null($rs) && $rs['node_type_id'] == $this->my_node_type) { + $sql = "/* {$debugMsg} */ UPDATE {$this->tables['nodes_hierarchy']} " . + " SET name='" . $this->db->prepare_string($name) . "' " . + " WHERE id= {$id}"; + $this->db->exec_query($sql); + $ret['debug'] = "Old name:{$rs['name']} - new name:{$name}"; + } + } + return $ret; + } + + public function getAttachmentTable() + { + return $this->attachmentTableName; + } + + /** + */ + public function updateChangeAuditTrial($tcversion_id, $user_id) + { + $sql = " UPDATE {$this->tables['tcversions']} " . " SET updater_id=" . + $this->db->prepare_int($user_id) . ", " . " modification_ts = " . + $this->db->db_now() . " WHERE id = " . + $this->db->prepare_int(intval($tcversion_id)); + $this->db->exec_query($sql); + } + + /** + */ + public function getStepsExecInfo($execution_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* {$debugMsg} */ " . + " SELECT id, execution_id,tcstep_id,notes,status FROM {$this->tables['execution_tcsteps']} " . + " WHERE execution_id = " . intval($execution_id); + + return $this->db->fetchRowsIntoMap($sql, 'tcstep_id'); + } + + /** + */ + public function getWorkFlowStatusDomain() + { + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + return $dummy['lbl']; + } + + /** + */ + public function getRelations($id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + $relSet = array(); + $relSet['num_relations'] = 0; + + $dummy = $this->get_by_id($id, self::LATEST_VERSION, null, + array( + 'output' => 'essential', + 'getPrefix' => true, + 'caller' => __FUNCTION__ + )); + // Get the TC version ID + $versionID = intval($dummy[0]['id']); + + $relSet['item'] = (null != $dummy) ? current($dummy) : null; + + $sql = " $debugMsg SELECT id, source_id, destination_id, relation_type, author_id, creation_ts " . + " FROM {$this->tables['testcase_relations']} " . + " WHERE source_id=$versionID OR destination_id=$versionID " . + " ORDER BY id ASC "; + + $relSet['relations'] = $this->db->get_recordset($sql); + + if (! empty($relSet['relations'])) { + $labels = $this->getRelationLabels(); + $label_keys = array_keys($labels); + foreach ($relSet['relations'] as $key => $rel) { + // is this relation type is configured? + if ($relTypeAllowed = in_array($rel['relation_type'], + $label_keys)) { + $relSet['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; + $relSet['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; + + $type_localized = 'destination_localized'; + $other_key = 'source_id'; + if ($versionID == $rel['source_id']) { + $type_localized = 'source_localized'; + $other_key = 'destination_id'; + } + $relSet['relations'][$key]['type_localized'] = $relSet['relations'][$key][$type_localized]; + $otherItem = $this->get_by_id(null, $rel[$other_key], null, + array( + 'output' => 'full_without_users', + 'getPrefix' => true + )); + + // only add it, if either interproject linking is on or if it is in the same project + $relTypeAllowed = true; + $relSet['relations'][$key]['related_tcase'] = $otherItem[0]; + + $user = tlUser::getByID($this->db, $rel['author_id']); + $relSet['relations'][$key]['author'] = $user->getDisplayName(); + } + + if (! $relTypeAllowed) { + unset($relSet['relations'][$key]); + } + } // end foreach + + $relSet['num_relations'] = count($relSet['relations']); + } + + return $relSet; + } + + /** + * idCard['tcase_id'] + * idCard['tcversion_id'] + */ + public function getTCVersionRelations($idCard) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + $safeID = $idCard; + foreach ($safeID as $prop => $val) { + $safeID[$prop] = intval($val); + } + + $getOpt = array( + 'output' => 'essential', + 'getPrefix' => true, + 'caller' => __FUNCTION__ + ); + $relSet = array( + 'num_relations' => 0, + 'relations' => array() + ); + + $relSet['item'] = current( + $this->get_by_id($safeID['tcase_id'], $safeID['tcversion_id'], null, + $getOpt)); + + $sql = " $debugMsg " . + " SELECT TR.id, source_id, destination_id, relation_type, " . + " TR.author_id, TR.creation_ts,TR.link_status, " . + " NHTCV_S.parent_id AS tcase_source, " . + " NHTCV_D.parent_id AS tcase_destination " . + " FROM {$this->tables['testcase_relations']} TR " . + " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_D " . + " ON NHTCV_D.id = destination_id " . + " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_S " . + " ON NHTCV_S.id = source_id " . + " WHERE source_id = {$safeID['tcversion_id']} OR " . + " destination_id = {$safeID['tcversion_id']} " . " ORDER BY id ASC "; + + $relSet['relations'] = $this->db->get_recordset($sql); + + if (! empty($relSet['relations'])) { + $labels = $this->getRelationLabels(); + $label_keys = array_keys($labels); + + foreach ($relSet['relations'] as $key => $rel) { + // is this relation type is configured? + if ($relTypeAllowed = in_array($rel['relation_type'], + $label_keys)) { + $relSet['relations'][$key]['source_localized'] = $labels[$rel['relation_type']]['source']; + $relSet['relations'][$key]['destination_localized'] = $labels[$rel['relation_type']]['destination']; + + $type_localized = 'destination_localized'; + $oKeyTCVID = 'source_id'; + $oKeyTCID = 'tcase_source'; + if ($safeID['tcversion_id'] == $rel['source_id']) { + $type_localized = 'source_localized'; + $oKeyTCVID = 'destination_id'; + $oKeyTCID = 'tcase_destination'; + } + $otherTCID = $rel[$oKeyTCID]; + $otherTCVID = $rel[$oKeyTCVID]; + + $relSet['relations'][$key]['type_localized'] = $relSet['relations'][$key][$type_localized]; + + $otherItem = $this->get_by_id($otherTCID, $otherTCVID, null, + array( + 'output' => 'full_without_users', + 'getPrefix' => true + )); + + // only add it to output set, if either interproject linking is on + // or if it is in the same project + $relTypeAllowed = true; + $relSet['relations'][$key]['related_tcase'] = $otherItem[0]; + + $user = tlUser::getByID($this->db, $rel['author_id']); + $relSet['relations'][$key]['author'] = $user->getDisplayName(); + } + + if (! $relTypeAllowed) { + unset($relSet['relations'][$key]); + } + } // end foreach + + $relSet['num_relations'] = count($relSet['relations']); + } + + return $relSet; + } + + /** + */ + public function getTCVRelationsRaw($tcversionID, $opt = null) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + $safeID['tcversion_id'] = intval($tcversionID); + + $my = array( + 'opt' => array( + 'side' => null + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " $debugMsg " . + " SELECT TR.id, source_id, destination_id, relation_type, " . + " TR.author_id, TR.creation_ts,TR.link_status, " . + " NHTCV_S.parent_id AS tcase_source, " . + " NHTCV_D.parent_id AS tcase_destination " . + " FROM {$this->tables['testcase_relations']} TR " . + " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_D " . + " ON NHTCV_D.id = destination_id " . + " JOIN {$this->tables['nodes_hierarchy']} AS NHTCV_S " . + " ON NHTCV_S.id = source_id "; + + switch ($my['opt']['side']) { + case 'source': + $where = " WHERE source_id = {$safeID['tcversion_id']} "; + break; + + case 'destination': + case 'dest': + $where = " WHERE destination_id = {$safeID['tcversion_id']} "; + break; + + default: + $where = " WHERE source_id = {$safeID['tcversion_id']} OR " . + " destination_id = {$safeID['tcversion_id']} "; + break; + } + + $sql .= $where; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + public static function getRelationLabels() + { + $cfg = config_get('testcase_cfg'); + $labels = $cfg->relations->type_labels; + foreach ($labels as $key => $label) { + $labels[$key] = init_labels($label); + } + return $labels; + } + + /** + */ + public function deleteAllTestCaseRelations($id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + $tcaseSet = (array) $id; + array_walk($tcaseSet, 'intval'); + + // @since 1.9.18 + // Relations on test case versions + $tcVIDSet = $this->getAllVersionsID($tcaseSet); + $inValues = implode(',', $tcVIDSet); + $sql = " $debugMsg DELETE FROM {$this->tables['testcase_relations']} " . + " WHERE source_id IN ($inValues) OR " . + " destination_id IN ($inValues) "; + $this->db->exec_query($sql); + } + + /** + * checks if there is a relation of a given type between two requirements + * + * @author Andreas Simon + * + * @param integer $first_id + * ID to check + * @param integer $second_id + * ID to check + * @param integer $rel_type_id + * relation type ID to check + * + * @return true, if relation already exists, false if not + */ + public function relationExits($first_id, $second_id, $rel_type_id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + $safe_first_id = intval($first_id); + $safe_second_id = intval($second_id); + + $sql = " $debugMsg SELECT COUNT(0) AS qty " . + " FROM {$this->tables['testcase_relations']} " . + " WHERE ((source_id=" . $safe_first_id . " AND destination_id=" . + $safe_second_id . ") " . " OR (source_id=" . $safe_second_id . + " AND destination_id=" . $safe_first_id . ")) " . + " AND relation_type=" . intval($rel_type_id); + + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty'] > 0; + } + + /** + * Get count of all relations, no matter if it is source or destination + * or what type of relation it is. + * + * @param integer $id + * requirement ID to check + * + * @return integer $count + */ + public function getRelationsCount($id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + $safeID = intval($id); + $sql = " $debugMsg SELECT COUNT(*) AS qty " . + " FROM {$this->tables['testcase_relations']} " . + " WHERE source_id=$safeID OR destination_id=$safeID "; + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + /** + * add a relation of a given type between Test Case Versions + * + * @param integer $source_id: + * ID of source test case version or test case. + * If test case is provided, latest active version + * will be used. + * + * @param integer $destination_id: + * ID of destination test case version or test case + * If test case is provided, latest active version + * will be used. + * + * @param integer $type_id + * relation type ID to set + * @param integer $author_id + * user's ID + */ + public function addRelation($source_id, $destination_id, $type_id, + $author_id, $ts = null) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + + // Check if items are test cases or test case versions + // Will check only source + $safeID = array( + 's' => intval($source_id), + 'd' => intval($destination_id) + ); + + $extr = array( + $safeID['s'] + ); + $sql = " SELECT node_type_id,id " . + " FROM {$this->tables['nodes_hierarchy']} " . " WHERE id IN(" . + implode(',', $extr) . ")"; + + $nu = current($this->db->get_recordset($sql)); + + if ($nu['node_type_id'] == $this->node_types_descr_id['testcase']) { + // Need to get latest active version for source and dest + $tcvSet = $this->get_last_active_version( + array( + $safeID['s'], + $safeID['d'] + ), null, array( + 'access_key' => 'testcase_id' + )); + + // Overwrite + $safeID['s'] = intval($tcvSet[$safeID['s']]['tcversion_id']); + $safeID['d'] = intval($tcvSet[$safeID['d']]['tcversion_id']); + } + + // check if exists before trying to add + if (! $this->relationExits($source_id, $destination_id, $type_id)) { + // check if related testcase is open + $dummy = $this->get_by_id($destination_id, self::LATEST_VERSION); + if (($dummy[0]['is_open']) == 1) { + $time = is_null($ts) ? $this->db->db_now() : $ts; + $sql = " $debugMsg INSERT INTO {$this->tables['testcase_relations']} " . + " (source_id, destination_id, relation_type, author_id, creation_ts) " . + " values ({$safeID['s']},{$safeID['d']}, $type_id, $author_id, $time)"; + $this->db->exec_query($sql); + $ret = array( + 'status_ok' => true, + 'msg' => 'relation_added' + ); + } else { + $ret = array( + 'status_ok' => false, + 'msg' => 'related_tcase_not_open' + ); + } + } else { + $ret = array( + 'status_ok' => false, + 'msg' => 'relation_already_exists' + ); + } + + return $ret; + } + + /** + * delete an existing relation + * + * @author Andreas Simon + * + * @param int $id + * relation id + */ + public function deleteRelationByID($relID) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */'; + $sql = " $debugMsg DELETE FROM {$this->tables['testcase_relations']} WHERE id=" . + intval($relID); + $this->db->exec_query($sql); + } + + /** + * + * @return array $htmlSelect info needed to create select box on multiple templates + */ + private function getRelationTypeDomainForHTMLSelect() + { + $htmlSelect = array( + 'items' => array(), + 'selected' => null, + 'equal_relations' => array() + ); + $labels = $this->getRelationLabels(); + + foreach ($labels as $key => $lab) { + $htmlSelect['items'][$key . "_source"] = $lab['source']; + if ($lab['source'] != $lab['destination']) { + // relation is not equal as labels for source and dest are different + $htmlSelect['items'][$key . "_destination"] = $lab['destination']; + } else { + // mark this as equal relation - no parent/child, makes searching simpler + $htmlSelect['equal_relations'][] = $key . "_source"; + } + } + + // set "related to" as default preselected value in forms + if (defined('TL_REL_TYPE_RELATED') && + isset($htmlSelect[TL_REL_TYPE_RELATED . "_source"])) { + $selected_key = TL_REL_TYPE_RELATED . "_source"; + } else { + // "related to" is not configured, so take last element as selected one + $keys = array_keys($htmlSelect['items']); + $selected_key = end($keys); + } + $htmlSelect['selected'] = $selected_key; + + return $htmlSelect; + } + + /** + * exportRelationToXML + * + * Function to export a test case relation to XML. + * + * @param int $relation + * relation data array + * @param string $troject_id + * + * @return string with XML code + * + * + * testcase external id + * prj + * doc2_id + * testcase external id + * 0 + * + * + * @internal revisions + * + */ + public function exportRelationToXML($relation, $item) + { + $xmlStr = ''; + + if (! is_null($relation)) { + // need to understand if swap is needed, this happens when + // relation type is + // - child_of + // - depends_on + // where item is DESTINATION and NOT SOURCE + if ($relation['source_id'] == $item['id']) { + $ele['source_ext_id'] = $item['fullExternalID']; + $ele['source_version'] = $item['version']; + $ele['destination_ext_id'] = $relation['related_tcase']['fullExternalID']; + $ele['destination_version'] = $relation['related_tcase']['version']; + } else { + // SWAP + $ele['source_ext_id'] = $relation['related_tcase']['fullExternalID']; + $ele['source_version'] = $relation['related_tcase']['version']; + $ele['destination_ext_id'] = $item['fullExternalID']; + $ele['destination_version'] = $item['version']; + } + $ele['relation_type'] = $relation['relation_type']; + + $info = array( + "||SOURCE||" => "source_ext_id", + "||SOURCE_VERSION||" => "source_version", + "||DESTINATION||" => "destination_ext_id", + "||DESTINATION_VERSION||" => "destination_version", + "||TYPE||" => "relation_type" + ); + + $elemTpl = "\t" . "" . "\n\t\t" . + "||SOURCE||"; + $elemTpl .= "\n\t\t" . + "||DESTINATION||"; + $elemTpl .= "\n\t\t" . "||TYPE||" . "\n\t" . + "" . "\n"; + + $work[] = $ele; + $xmlStr = exportDataToXML($work, "{{XMLCODE}}", $elemTpl, $info, + true); + } + + return $xmlStr; + } + + /** + * Will do analisys IGNORING test plan, platform and build + * get info of execution WRITTEN to DB. + */ + public function getSystemWideLastestExecutionID($tcversion_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . " SELECT MAX(e.id) AS execution_id " . + " FROM {$this->tables['executions']} e " . " WHERE e.tcversion_id = " . + intval($tcversion_id); + + $rs = $this->db->get_recordset($sql); + return intval($rs[0]['execution_id']); + } + + /** + * render Image Attachments INLINE + */ + private function renderImageAttachments($id, &$item2render, + $key2check = array( + 'summary', + 'preconditions' + ), $basehref = null) + { + static $attSet; + static $beginTag; + static $endTag; + static $repoDir; + + if (! $attSet || ! isset($attSet[$id])) { + $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor( + $id, $this->attachmentTableName, 'id'); + $beginTag = '[tlInlineImage]'; + $endTag = '[/tlInlineImage]'; + $repoDir = config_get('repositoryPath'); + } + + if (is_null($attSet[$id])) { + return; + } + + // $href = '%s:%s' . " $versionTag (link)

    "; + // second \'%s\' needed if I want to use Latest as indication, need to understand + // Javascript instead of javascript, because CKeditor sometimes complains + // + // CRITIC: skipCheck is needed to render OK when creating report on Pseudo-Word format. + $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; + + $src = ' src="' . $bhref . + '/lib/attachments/attachmentdownload.php?skipCheck=%sec%&id=%id%">

    '; + $img = '

    0) { + + $atx = $yy[0]; + if (intval($atx) == 0) { + $atx = $this->getTCVersionAttachIDFromTitle($id, + $atx); + } + + try { + if (isset($attSet[$id][$atx]) && + $attSet[$id][$atx]['is_image']) { + $sec = hash('sha256', + $attSet[$id][$atx]['file_name']); + + // Need file dimension!!! + $pathname = $repoDir . + $attSet[$id][$atx]['file_path']; + list ($iWidth, $iHeight, ,) = getimagesize( + $pathname); + + $iDim = ' width=' . $iWidth . ' height=' . + $iHeight; + $icarus = str_replace( + array( + '%id%', + '%sec%' + ), array( + $atx, + $sec + ), $img); + $ghost .= sprintf($icarus, $iDim); + } + $lim = $elc - 1; + for ($cpx = 1; $cpx <= $lim; $cpx ++) { + $ghost .= $yy[$cpx]; + } + } catch (Exception $e) { + $ghost .= $rse[$item_key]; + } + } + } else { + // nothing to do + $ghost .= $xx[$xdx]; + } + } + } + + // reconstruct field contents + if ($ghost != '') { + $rse[$item_key] = $ghost; + } + } + } + + /** + */ + private function trimAndLimit($s, $len = 100) + { + $s = trim($s); + if (tlStringLen($s) > $len) { + $s = tlSubStr($s, 0, $len); + } + + return $s; + } + + /** + */ + public function generateTimeStampName($name) + { + return @strftime("%Y%m%d-%H:%M:%S", time()) . ' ' . $name; + } + + /** + */ + public static function getLayout() + { + $ly = new stdClass(); + $ly->tableToDisplayTestCaseSteps = new stdClass(); + + // MAGIC: columns are: + // column for reorder, action, expected results, exec type, delete, insert + $ly->tableToDisplayTestCaseSteps->colspan = 6; + + return $ly; + } + + /** + */ + public function setIntAttrForAllVersions($id, $attr, $value, + $forceFrozenVersions = false) + { + $sql = " UPDATE {$this->tables['tcversions']} " . " SET {$attr} = " . + $this->db->prepare_int($value); + + if (! $forceFrozenVersions) { + $sql .= " WHERE is_open=1 AND "; + } else { + $sql .= " WHERE "; + } + $sql .= " id IN (" . + " SELECT NHTCV.id FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " WHERE NHTCV.parent_id = " . intval($id) . ")"; + $this->db->exec_query($sql); + } + + /** + */ + public function getTcSearchSkeleton($userInput = null) + { + $sk = new stdClass(); + + $sk->creation_date_from = null; + $sk->creation_date_to = null; + $sk->modification_date_from = null; + $sk->modification_date_to = null; + $sk->search_important_notice = ''; + $sk->design_cf = ''; + $sk->keywords = ''; + $sk->filter_by['design_scope_custom_fields'] = false; + $sk->filter_by['keyword'] = false; + $sk->filter_by['requirement_doc_id'] = false; + $sk->option_importance = array( + 0 => '', + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $sk->domainTCStatus = array( + 0 => '' + ) + $dummy['lbl']; + $sk->importance = null; + $sk->status = null; + $sk->tcversion = null; + $sk->tcasePrefix = ''; + $sk->targetTestCase = ''; + + $txtin = array( + "created_by", + "edited_by", + "jolly" + ); + $jollyKilled = array( + "summary", + "steps", + "expected_results", + "preconditions", + "name" + ); + $txtin = array_merge($txtin, $jollyKilled); + + foreach ($txtin as $key) { + $sk->$key = ! is_null($userInput) ? $userInput->$key : ''; + } + + if (! is_null($userInput) && $userInput->jolly != '') { + foreach ($jollyKilled as $key) { + $sk->$key = ''; + } + } + + return $sk; + } + + /** + */ + public function setIsOpen($id, $tcversion_id, $value) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $bv = (intval($value) > 0) ? 1 : 0; + $sql = " /* $debugMsg */ UPDATE {$this->tables['tcversions']} " . + " SET is_open = {$bv}" . " WHERE id = " . intval($tcversion_id); + + $this->db->exec_query($sql); + } + + /** + * render CF values + * + *

    added by web rich editor create some layout issues + * + * @used by this.get_by_id(), this.getLastExecution() + * + */ + public function renderVariables(&$item2render, $tproj_id) + { + $tcase_id = $item2render['testcase_id']; + $tcversion_id = $item2render['id']; + $cfSet = $this->get_linked_cfields_at_design($tcase_id, $tcversion_id); + $kwSet = $this->getTestProjectKeywords($tproj_id); + + if (is_null($cfSet) && is_null($kwSet)) { + return; + } + + $key2check = [ + 'summary', + 'preconditions' + ]; + $tlBeginTag = '[tlVar]'; + $tlEndTag = '[/tlVar]'; + + $rse = &$item2render; + foreach ($key2check as $item_key) { + $start = strpos($rse[$item_key], $tlBeginTag); + // There is at least one request to replace ? + if ($start !== false) { + // This way remove may be the

    that webrich editor adds + $play = substr($rse[$item_key], $start); + $xx = explode($tlBeginTag, $play); + + // How many requests to replace ? + $xx2do = count($xx); + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + + // Hope was not a false request. + if ((strpos($xx[$xdx], $tlEndTag)) !== false) { + + // Separate command string from other text + // Theorically can be just ONE, but it depends + // is user had not messed things. + $yy = explode($tlEndTag, $xx[$xdx]); + if (! empty($yy)) { + $variableName = trim($yy[0]); + + try { + // Step #1 Look in Custom Fields + // look for the custom field + if (! is_null($cfSet)) { + foreach ($cfSet as $cfDef) { + if ($cfDef['name'] === $variableName) { + $duckTape = $this->cfield_mgr->string_custom_field_value( + $cfDef, $tcversion_id); + $rse[$item_key] = str_replace( + $tlBeginTag . $variableName . + $tlEndTag, $duckTape, + $rse[$item_key]); + } + } + } + + // Step #2 Look in Keywords + if (! is_null($kwSet)) { + foreach ($kwSet as $kw => $kwNotes) { + if ($kw === $variableName) { + $rse[$item_key] = str_replace( + $tlBeginTag . $variableName . + $tlEndTag, $kwNotes, + $rse[$item_key]); + } + } + } + } catch (Exception $e) { + // Do nothing + } + } + } + } + } + } + } + + /** + * get data about code links from external tool + * + * @param + * resource &$db reference to database handler + * @param + * object &$code_interface reference to instance of bugTracker class + * @param integer $tcversion_id + * Identifier of test case version + * + * @return array list of 'script_name' with values: link_to_cts, + * project_key, repository_name, code_path, branch_name + */ + public function getScriptsForTestCaseVersion(&$code_interface, $tcversion_id) + { + $tables = tlObjectWithDB::getDBTables( + array( + 'tcversions', + 'testcase_script_links' + )); + $script_list = array(); + + $debugMsg = 'FILE:: ' . __FILE__ . ' :: FUNCTION:: ' . __FUNCTION__; + if (is_object($code_interface)) { + + $sql = "/* $debugMsg */ SELECT TSL.*,TCV.version " . + " FROM {$tables['testcase_script_links']} TSL, {$tables['tcversions']} TCV " . + " WHERE TSL.tcversion_id = " . intval($tcversion_id) . + " AND TSL.tcversion_id = TCV.id " . " ORDER BY TSL.code_path"; + + $map = $this->db->get_recordset($sql); + if (! is_null($map)) { + $opt = array(); + foreach ($map as $elem) { + $script_id = $elem['project_key'] . '&&' . + $elem['repository_name'] . '&&' . $elem['code_path']; + if (! isset($script_list[$script_id])) { + $opt['branch'] = $elem['branch_name']; + $opt['commit_id'] = $elem['commit_id']; + $dummy = $code_interface->buildViewCodeLink( + $elem['project_key'], $elem['repository_name'], + $elem['code_path'], $opt); + $script_list[$script_id]['link_to_cts'] = $dummy->link; + $script_list[$script_id]['project_key'] = $elem['project_key']; + $script_list[$script_id]['repository_name'] = $elem['repository_name']; + $script_list[$script_id]['code_path'] = $elem['code_path']; + $script_list[$script_id]['branch_name'] = $elem['branch_name']; + $script_list[$script_id]['commit_id'] = $elem['commit_id']; + $script_list[$script_id]['tcversion_id'] = $elem['tcversion_id']; + } + unset($dummy); + } + } + } + + if (empty($script_list)) { + $script_list = null; + } + return $script_list; + } + + /** + */ + private function ckEditorCopyAndPasteCleanUp(&$items, $keys) + { + $offending = array( + '' + ); + $good = array( + '<body id="cke_pastebin"', + '</body>' + ); + foreach ($keys as $fi) { + $items->$fi = str_ireplace($offending, $good, $items->$fi); + } + } + + /** + */ + public function getPathName($tcase_id) + { + $pathInfo = $this->tree_manager->get_full_path_verbose($tcase_id, + array( + 'output_format' => 'id_name' + )); + $pathInfo = current($pathInfo); + $path = '/' . implode('/', $pathInfo['name']) . '/'; + + $pfx = $this->tproject_mgr->getTestCasePrefix($pathInfo['node_id'][0]); + + $info = $this->getLastVersionInfo($tcase_id, + array( + 'output' => 'medium' + )); + + $path .= $pfx . $this->cfg->testcase->glue_character . + $info['tc_external_id'] . ':' . $info['name']; + + return $path; + } + + /** + * build Test Case Name getting information + * from special marked text inside string + * + * string can be test case summary or test case precondition + */ + private function buildTCName($name, $text2scan) + { + $taglen = strlen(self::NAME_PHOPEN); + + $where['open'] = strpos($name, self::NAME_PHOPEN); + $where['close'] = strpos($name, self::NAME_PHCLOSE); + + if (false !== $where['open']) { + $whoami['l'] = substr($name, 0, $where['open']); + $meat = substr($name, $where['open'] + $taglen, + ($where['close'] - $where['open'] - $taglen)); + + $dummy = strstr($name, self::NAME_PHCLOSE); + $whoami['r'] = ''; + if ($dummy !== false) { + $whoami['r'] = ltrim($dummy, self::NAME_PHCLOSE); + } + + $dm = explode(self::NAME_DIVIDE, $meat); + $name = $whoami['l'] . self::NAME_PHOPEN; + + $juice = $this->orangeJuice($text2scan); + $name .= (! empty($dm)) ? $dm[0] : $meat; + $name .= self::NAME_DIVIDE . $juice . self::NAME_PHCLOSE . + $whoami['r']; + } + return $name; + } + + /** + * target => [[All you need]] + * scan4values => [[is Love]] + * + * returned text => All you need::is Love + */ + private function replaceTextBTWTags($target, $scan4values) + { + $taglen = strlen(self::NAME_PHOPEN); + $side = array( + 'l' => '', + 'r' => '' + ); + + $where['open'] = strpos($target, self::NAME_PHOPEN); + $where['close'] = strpos($target, self::NAME_PHCLOSE); + + // Both tags present or ... skip + if (false !== $where['open'] && false !== $where['close']) { + + // the needle will NOT BE replaced. + $needle = substr($target, $where['open'] + $taglen, + ($where['close'] - $where['open'] - $taglen)); + + // start disecting the target + // first to the left + $side['l'] = substr($target, 0, $where['open']); + + // haystack = $target + // needle = self::NAME_PHCLOSE + $dummy = strstr($target, self::NAME_PHCLOSE); + $whoami['r'] = ''; + + if ($dummy !== false) { + // dummy => ]]xxxxxxxxxxx + $side['r'] = ltrim($dummy, self::NAME_PHCLOSE); + } + + $dm = explode(self::NAME_DIVIDE, $needle); + $target = $side['l'] . ((! empty($dm)) ? $dm[0] : $needle); + + $juice = $this->orangeJuice($scan4values); + $target .= self::NAME_DIVIDE . $juice . $side['r']; + } + return $target; + } + + /** + */ + private function orangeJuice($str) + { + $juice = ''; + $taglen = strlen(self::NAME_PHOPEN); + + $where['open'] = strpos($str, self::NAME_PHOPEN); + $where['close'] = strpos($str, self::NAME_PHCLOSE); + + if (false !== $where['open']) { + $juice = substr($str, $where['open'] + $taglen, + ($where['close'] - $where['open'] - $taglen)); + } + return $juice; + } + + /** + */ + private function getVersionNumber($version_id) + { + $sql = " SELECT version FROM {$this->tables['tcversions']} " . + " WHERE id=" . intval($version_id); + + $rs = $this->db->get_recordset($sql); + return intval($rs[0]['version']); + } + + /** + */ + public function getAllVersionsID($id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; + + $target = (array) $id; + array_walk($target, 'intval'); + + $sql = $debugMsg . " SELECT id AS tcversion_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " WHERE NHTCV.parent_id =" . implode(',', $target) . + " AND NHTCV.node_type_id = " . + $this->node_types_descr_id['testcase_version']; + + $xx = $this->db->fetchRowsIntoMap($sql, 'tcversion_id'); + + if (null != $xx && count($xx) > 0) { + return array_keys($xx); + } + + return null; + } + + /** + */ + private function getAttXMLCfg() + { + $attXML = new stdClass(); + + $attXML->root = "\t\n{{XMLCODE}}\t\n"; + $attXML->elemTPL = "\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\n"; + + $attXML->decode = array( + "||ATTACHMENT_ID||" => "id", + "||ATTACHMENT_NAME||" => "name", + "||ATTACHMENT_FILE_TYPE||" => "file_type", + "||ATTACHMENT_FILE_SIZE||" => "file_size", + "||ATTACHMENT_TITLE||" => "title", + "||ATTACHMENT_DATE_ADDED||" => "date_added", + "||ATTACHMENT_CONTENT||" => "content" + ); + + return $attXML; + } + + /** + */ + public function closeOpenTCVRelation($relationID, $reason) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; + $sql = " $debugMsg UPDATE {$this->tables['testcase_relations']} " . + " SET link_status = " . intval($reason) . " WHERE id IN(" . + implode(',', $relationID) . ")" . " AND link_status = " . + LINK_TC_RELATION_OPEN; + + $this->db->exec_query($sql); + } + + /** + */ + private function copyTCVRelations($source_id, $dest_id) + { + + // Step 1 - get existent relations + $relSource = $this->getTCVRelationsRaw($source_id, + array( + 'side' => 'source' + )); + $relDest = $this->getTCVRelationsRaw($source_id, + array( + 'side' => 'dest' + )); + + $ins = "(source_id,destination_id,relation_type," . + " link_status,author_id) "; + + $values = array(); + if (! empty($relSource)) { + foreach ($relSource as $elem) { + $stm = "($dest_id,{$elem['destination_id']}," . + "{$elem['relation_type']},{$elem['link_status']}," . + "{$elem['author_id']})"; + $values[] = $stm; + } + } + + if (! empty($relDest)) { + foreach ($relDest as $elem) { + $stm = "({$elem['source_id']},$dest_id," . + "{$elem['relation_type']},{$elem['link_status']}," . + "{$elem['author_id']})"; + $values[] = $stm; + } + } + + if (! empty($values)) { + $sql = 'INSERT INTO ' . $this->tables['testcase_relations'] . $ins . + ' VALUES ' . implode(',', $values); + + $this->db->exec_query($sql); + } + } + + /** + */ + private function updateCoverage($link, $whoWhen, $opt = null) + { + + // Set coverage for previous version to FROZEN & INACTIVE + // Create coverage for NEW Version + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'freezePrevious' => true + ); + $options = array_merge($options, (array) $opt); + $safeF = intval($link['source']); + $safeT = intval($link['dest']); + + // Set coverage for previous version to FROZEN & INACTIVE ? + if ($options['freezePrevious']) { + $sql = " /* $debugMsg */ " . + " UPDATE {$this->tables['req_coverage']} " . + " SET link_status = " . LINK_TC_REQ_CLOSED_BY_NEW_TCVERSION . "," . + " is_active=0 " . " WHERE tcversion_id=" . $safeF; + $this->db->exec_query($sql); + } + + // Create coverage for NEW Version + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['req_coverage']} " . + " (req_id,req_version_id,testcase_id,tcversion_id," . + " author_id,creation_ts) " . + " SELECT req_id,req_version_id,testcase_id, " . + " {$safeT} AS tcversion_id," . + " {$whoWhen['user_id']} AS author_id, " . + " {$whoWhen['when']} AS creation_ts" . + " FROM {$this->tables['req_coverage']} " . " WHERE tcversion_id=" . + $safeF; + + $this->db->exec_query($sql); + } + + /** + */ + public function closeOpenReqLinks($tcversion_id, $reason, $opt = null) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; + + $options = array( + 'freeze_req_version' => false + ); + $options = array_merge($options, (array) $opt); + + $commonWhere = " WHERE tcversion_id = " . intval($tcversion_id) . + " AND link_status = " . LINK_TC_REQ_OPEN; + + // This has to be done BEFORE changing link_status + if ($options['freeze_req_version']) { + + /* + * execution time issues + * $sql = " $debugMsg UPDATE {$this->tables['req_versions']} + * SET is_open = 0 + * WHERE id IN ( + * SELECT req_version_id + * FROM {$this->tables['req_coverage']} + * $commonWhere + * ) "; + */ + switch (DB_TYPE) { + case 'mysql': + $sql = " $debugMsg UPDATE {$this->tables['req_versions']} RQV INNER JOIN {$this->tables['req_coverage']} RC ON RQV.id = RC.req_version_id - SET is_open = 0 $commonWhere "; - break; - - - case 'postgres': - // https://stackoverflow.com/questions/11369757/ - // postgres-wont-accept-table-alias-before-column-name - // - $sql = " $debugMsg + SET is_open = 0 $commonWhere "; + break; + + case 'postgres': + // https://stackoverflow.com/questions/11369757/ + // postgres-wont-accept-table-alias-before-column-name + // + $sql = " $debugMsg UPDATE {$this->tables['req_versions']} RQV - SET is_open = 0 + SET is_open = 0 FROM {$this->tables['req_coverage']} RC - $commonWhere AND RQV.id = RC.req_version_id"; - break; - } - - $this->db->exec_query($sql); - } - - - // Work on Coverage - $sql = " $debugMsg UPDATE {$this->tables['req_coverage']} " . - " SET link_status = " . intval($reason) . $commonWhere; - $this->db->exec_query($sql); - - // No audit yet - } - - /** - * - */ - function closeOpenReqVersionOnOpenLinks( $tcversion_id ) { - - $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; - - $commonWhere = " WHERE tcversion_id = " . intval($tcversion_id) . - " AND link_status = " . LINK_TC_REQ_OPEN; - - // https://stackoverflow.com/questions/11369757/postgres-wont-accept-table-alias-before-column-name - $sql = " $debugMsg UPDATE {$this->tables['req_versions']} + $commonWhere AND RQV.id = RC.req_version_id"; + break; + } + + $this->db->exec_query($sql); + } + + // Work on Coverage + $sql = " $debugMsg UPDATE {$this->tables['req_coverage']} " . + " SET link_status = " . intval($reason) . $commonWhere; + $this->db->exec_query($sql); + + // No audit yet + } + + /** + */ + private function closeOpenReqVersionOnOpenLinks($tcversion_id) + { + $debugMsg = "/* {$this->debugMsg}" . __FUNCTION__ . ' */ '; + + $commonWhere = " WHERE tcversion_id = " . intval($tcversion_id) . + " AND link_status = " . LINK_TC_REQ_OPEN; + + // https://stackoverflow.com/questions/11369757/postgres-wont-accept-table-alias-before-column-name + $sql = " $debugMsg UPDATE {$this->tables['req_versions']} SET is_open = 0 WHERE id IN ( - SELECT req_version_id - FROM {$this->tables['req_coverage']} + SELECT req_version_id + FROM {$this->tables['req_coverage']} $commonWhere - ) AND is_open = 1"; - - $this->db->exec_query($sql); - } - - - /** - * copyReqVersionLinksTo - * $source test case info. - * $dest test case info. - * - */ - function copyReqVersionLinksTo($source,$dest,$mappings,$userID) { - - static $reqMgr; - if( is_null($reqMgr) ) { - $reqMgr=new requirement_mgr($this->db); - } - - $itemSet = $reqMgr->getGoodForTCVersion($source['version_id']); - - if( !is_null($itemSet) ) { - - $reqSet = null; - $reqVerSet = null; - - $loop2do=count($itemSet); - for($idx=0; $idx < $loop2do; $idx++) { - - $reqID = $itemSet[$idx]['req_id']; - $reqVerID = $itemSet[$idx]['req_version_id']; - - if( isset($mappings['req'][$reqID]) ) { - $reqSet[$idx] = $mappings['req'][$reqID]; - $reqVerSet[$idx] = $mappings['req_version'][$reqVerID]; - } else { - $reqSet[$idx] = $reqID; - $reqVerSet[$idx] = $reqVerID; - } - - $reqIdCard = array('id' => $reqSet[$idx], - 'version_id' => $reqVerSet[$idx]); - $reqMgr->assignReqVerToTCVer($reqIdCard, $dest, $userID); - } - } - } - - - /** - * - */ - function getReqXMLCfg() { - - $cfgXML = new stdClass(); - - $cfgXML->root = "\t\n{{XMLCODE}}\t\n"; - $cfgXML->elemTPL = - "\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t\n" . - "\t\t\t<![CDATA[||REQ_TITLE||]]>\n" . - "\t\t\n"; - - $cfgXML->decode = array( "||REQ_SPEC_TITLE||" => "req_spec_title", - "||REQ_DOC_ID||" => "req_doc_id", - "||REQ_VERSION||" => "version", - "||REQ_TITLE||" => "title"); - - return $cfgXML; - } - - - - /** - * - */ - function getLatestVersionID($tcaseID) { - $sql = "SELECT LTCV.tcversion_id + ) AND is_open = 1"; + + $this->db->exec_query($sql); + } + + /** + * copyReqVersionLinksTo + * $source test case info. + * $dest test case info. + */ + private function copyReqVersionLinksTo($source, $dest, $mappings, $userID) + { + static $reqMgr; + if (is_null($reqMgr)) { + $reqMgr = new requirement_mgr($this->db); + } + + $itemSet = $reqMgr->getGoodForTCVersion($source['version_id']); + + if (! is_null($itemSet)) { + + $reqSet = null; + $reqVerSet = null; + + $loop2do = count($itemSet); + for ($idx = 0; $idx < $loop2do; $idx ++) { + + $reqID = $itemSet[$idx]['req_id']; + $reqVerID = $itemSet[$idx]['req_version_id']; + + if (isset($mappings['req'][$reqID])) { + $reqSet[$idx] = $mappings['req'][$reqID]; + $reqVerSet[$idx] = $mappings['req_version'][$reqVerID]; + } else { + $reqSet[$idx] = $reqID; + $reqVerSet[$idx] = $reqVerID; + } + + $reqIdCard = array( + 'id' => $reqSet[$idx], + 'version_id' => $reqVerSet[$idx] + ); + $reqMgr->assignReqVerToTCVer($reqIdCard, $dest, $userID); + } + } + } + + /** + */ + private function getReqXMLCfg() + { + $cfgXML = new stdClass(); + + $cfgXML->root = "\t\n{{XMLCODE}}\t\n"; + $cfgXML->elemTPL = "\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t\n" . + "\t\t\t<![CDATA[||REQ_TITLE||]]>\n" . + "\t\t\n"; + + $cfgXML->decode = array( + "||REQ_SPEC_TITLE||" => "req_spec_title", + "||REQ_DOC_ID||" => "req_doc_id", + "||REQ_VERSION||" => "version", + "||REQ_TITLE||" => "title" + ); + + return $cfgXML; + } + + /** + */ + public function getLatestVersionID($tcaseID) + { + $sql = "SELECT LTCV.tcversion_id FROM {$this->views['latest_tcase_version_id']} LTCV - WHERE LTCV.testcase_id=" . intval($tcaseID); - - $rs = current($this->db->get_recordset($sql)); - - return $rs['tcversion_id']; - } - - /** - * render CF BUILD values with a defined name prefix - * - *

    added by web rich editor create some layout issues - */ - function renderBuildExecVars($context,&$item2render) { - - static $execVars; - - $tplan_id = $context['tplan_id']; - $build_id = $context['build_id']; - - $sql = " SELECT parent_id FROM {$this->tables['nodes_hierarchy']} NHTP - WHERE NHTP.id = $tplan_id - AND NHTP.node_type_id = {$this->node_types_descr_id['testplan']} "; - $dummy = current($this->db->get_recordset($sql)); - - $tproject_id = $dummy['parent_id']; - - if( !($execVars) ) { - $cfx = array('tproject_id' => $tproject_id, 'node_type' => 'build', - 'node_id' => $build_id); - $CFSet = $this->cfield_mgr->getLinkedCfieldsAtDesign($cfx); - - $execVars = array(); - if( null != $CFSet ) { - foreach($CFSet as $cfDef) { - $execVars[$cfDef['name']] = - $this->cfield_mgr->string_custom_field_value($cfDef,$build_id); - } - } - } - - $tcase_id = $item2render['testcase_id']; - $tcversion_id = $item2render['id']; - if( is_null($execVars) ) { - return; - } - - $key2check = array('summary','preconditions'); - $tlBeginTag = '[tlExecVar]'; - $tlEndTag = '[/tlExecVar]'; - $tlEndTagLen = strlen($tlEndTag); - - // I've discovered that working with Web Rich Editor generates - // some additional not wanted entities, that disturb a lot - // when trying to use json_decode(). - // Hope this set is enough. - // $replaceSet = array($tlEndTag, '

    ', '

    ',' '); - // $replaceSetWebRichEditor = array('

    ', '

    ',' '); - - $rse = &$item2render; - foreach($key2check as $item_key) { - $start = strpos($rse[$item_key],$tlBeginTag); - $ghost = $rse[$item_key]; - - // There is at least one request to replace ? - if($start !== FALSE) { - // This way remove may be the

    that webrich editor adds - $play = $rse[$item_key]; - $xx = explode($tlBeginTag,$play); - - // How many requests to replace ? - $xx2do = count($xx); - $ghost = ''; - for($xdx=0; $xdx < $xx2do; $xdx++) { - - // Hope was not a false request. - if( ($es=strpos($xx[$xdx],$tlEndTag)) !== FALSE) { - // Separate command string from other text - // Theorically can be just ONE, but it depends - // is user had not messed things. - $yy = explode($tlEndTag,$xx[$xdx]); - if( ($elc = count($yy)) > 0) { - $cfname = trim($yy[0]); - try { - // look for the custom field - foreach ($execVars as $cfn => $cfv ) { - if( $cfn === $cfname ) { - $ghost .= $execVars[$cfname]; - } - } - - // reconstruct the contect with the other pieces - $lim = $elc-1; - for($cpx=1; $cpx <= $lim; $cpx++) { - $ghost .= $yy[$cpx]; - } - } catch (Exception $e) { - $ghost .= $rse[$item_key]; - } - } - } else { - $ghost .= $xx[$xdx]; - } - } - } - - // reconstruct field contents - if($ghost != '') { - $rse[$item_key] = $ghost; - } - } - } - - /** - * render Special Test Suite Keywords - * - *

    added by web rich editor create some layout issues - */ - function renderSpecialTSuiteKeywords(&$item2render) { - - static $skwSet; - static $key2check; - - $tcase_id = $item2render['testcase_id']; - $tcversion_id = $item2render['id']; - - if( !$key2check ) { - $key2check = array('summary','preconditions'); - } - - if( null==$skwSet || !isset($skwSet[$tcase_id]) ) { - $optSKW = array('getTSuiteKeywords' => true); - $skwSet[$tcase_id] = $this->getPathLayered($tcase_id,$optSKW); - } - - if( is_null($skwSet) ) { - return; - } - - $rse = &$item2render; - - // From PHP Documentation - // $phrase = "You should eat fruits, vegetables, and fiber every day."; - // $healthy = array("fruits", "vegetables", "fiber"); - // $yummy = array("pizza", "beer", "ice cream"); - // - // $newphrase = str_replace($healthy, $yummy, $phrase); - // Provides: You should eat pizza, beer, and ice cream every day - // - $searchSet = null; - $replaceSet = null; - foreach($skwSet as $xdx => $eSet ) { - foreach($eSet as $dm) { - if( null != $dm['data_management'] ) { - foreach($dm['data_management'] as $search => $replace ) { - $searchSet[] = $search; - $replaceSet[] = $replace; - } - } - } - } - - foreach($key2check as $item_key) { - $rse[$item_key] = str_replace($searchSet,$replaceSet,$rse[$item_key]); - } - - } - - /** - * - */ - function getTCVersionAttachIDFromTitle($tcversion_id,$target) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $id = 0; - $sql = " /* $debugMsg */ - SELECT id + WHERE LTCV.testcase_id=" . intval($tcaseID); + + $rs = current($this->db->get_recordset($sql)); + + return $rs['tcversion_id']; + } + + /** + * render CF BUILD values with a defined name prefix + * + *

    added by web rich editor create some layout issues + */ + public function renderBuildExecVars($context, &$item2render) + { + static $execVars; + + $tplan_id = $context['tplan_id']; + $build_id = $context['build_id']; + + $sql = " SELECT parent_id FROM {$this->tables['nodes_hierarchy']} NHTP + WHERE NHTP.id = $tplan_id + AND NHTP.node_type_id = {$this->node_types_descr_id['testplan']} "; + $dummy = current($this->db->get_recordset($sql)); + + $tproject_id = $dummy['parent_id']; + + if (! ($execVars)) { + $cfx = array( + 'tproject_id' => $tproject_id, + 'node_type' => 'build', + 'node_id' => $build_id + ); + $CFSet = $this->cfield_mgr->getLinkedCfieldsAtDesign($cfx); + + $execVars = array(); + if (null != $CFSet) { + foreach ($CFSet as $cfDef) { + $execVars[$cfDef['name']] = $this->cfield_mgr->string_custom_field_value( + $cfDef, $build_id); + } + } + } + + if (is_null($execVars)) { + return; + } + + $key2check = array( + 'summary', + 'preconditions' + ); + $tlBeginTag = '[tlExecVar]'; + $tlEndTag = '[/tlExecVar]'; + + // I've discovered that working with Web Rich Editor generates + // some additional not wanted entities, that disturb a lot + // when trying to use json_decode(). + // Hope this set is enough. + // $replaceSet = array($tlEndTag, '

    ', '

    ',' '); + // $replaceSetWebRichEditor = array('

    ', '

    ',' '); + + $rse = &$item2render; + foreach ($key2check as $item_key) { + $start = strpos($rse[$item_key], $tlBeginTag); + $ghost = $rse[$item_key]; + + // There is at least one request to replace ? + if ($start !== false) { + // This way remove may be the

    that webrich editor adds + $play = $rse[$item_key]; + $xx = explode($tlBeginTag, $play); + + // How many requests to replace ? + $xx2do = count($xx); + $ghost = ''; + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + + // Hope was not a false request. + if ((strpos($xx[$xdx], $tlEndTag)) !== false) { + // Separate command string from other text + // Theorically can be just ONE, but it depends + // is user had not messed things. + $yy = explode($tlEndTag, $xx[$xdx]); + if (($elc = count($yy)) > 0) { + $cfname = trim($yy[0]); + try { + // look for the custom field + foreach ($execVars as $cfn => $cfv) { + if ($cfn === $cfname) { + $ghost .= $execVars[$cfname]; + } + } + + // reconstruct the contect with the other pieces + $lim = $elc - 1; + for ($cpx = 1; $cpx <= $lim; $cpx ++) { + $ghost .= $yy[$cpx]; + } + } catch (Exception $e) { + $ghost .= $rse[$item_key]; + } + } + } else { + $ghost .= $xx[$xdx]; + } + } + } + + // reconstruct field contents + if ($ghost != '') { + $rse[$item_key] = $ghost; + } + } + } + + /** + * render Special Test Suite Keywords + * + *

    added by web rich editor create some layout issues + */ + private function renderSpecialTSuiteKeywords(&$item2render) + { + static $skwSet; + static $key2check; + + $tcase_id = $item2render['testcase_id']; + + if (! $key2check) { + $key2check = array( + 'summary', + 'preconditions' + ); + } + + if (null == $skwSet || ! isset($skwSet[$tcase_id])) { + $optSKW = array( + 'getTSuiteKeywords' => true + ); + $skwSet[$tcase_id] = $this->getPathLayered($tcase_id, $optSKW); + } + + if (is_null($skwSet)) { + return; + } + + $rse = &$item2render; + + // From PHP Documentation + // $phrase = "You should eat fruits, vegetables, and fiber every day."; + // $healthy = array("fruits", "vegetables", "fiber"); + // $yummy = array("pizza", "beer", "ice cream"); + // + // $newphrase = str_replace($healthy, $yummy, $phrase); + // Provides: You should eat pizza, beer, and ice cream every day + // + $searchSet = null; + $replaceSet = null; + foreach ($skwSet as $eSet) { + foreach ($eSet as $dm) { + if (null != $dm['data_management']) { + foreach ($dm['data_management'] as $search => $replace) { + $searchSet[] = $search; + $replaceSet[] = $replace; + } + } + } + } + + foreach ($key2check as $item_key) { + $rse[$item_key] = str_replace($searchSet, $replaceSet, + $rse[$item_key]); + } + } + + /** + */ + private function getTCVersionAttachIDFromTitle($tcversion_id, $target) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $id = 0; + $sql = " /* $debugMsg */ + SELECT id FROM {$this->tables['attachments']} - WHERE fk_id=" . intval($tcversion_id) . - " AND title = '" . - $this->db->prepare_string($target) . "'"; - - $rs = $this->db->get_recordset($sql); - if( null != $rs ) { - $id = intval($rs[0]['id']); - } - - return $id; - } - - /** - * - * - */ - function getFreeKeywords($idCard,$opt = null) { - $my['opt'] = array('accessKey' => 'keyword_id', 'fields' => null, - 'orderBy' => null, 'tproject_id' => null, - 'output' => 'std', 'add_blank' => false); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $safe = array(); - foreach($idCard as $key => $val) { - $safe[$key] = intval($val); - } - - // CRITIC - $tproject_id = $my['opt']['tproject_id']; - if( null == $tproject_id ) { - $tproject_id = $this->get_testproject($safe['tcase_id']); - } - $tproject_id = intval($tproject_id); - - $sql = " SELECT KW.id AS keyword_id, KW.keyword + WHERE fk_id=" . intval($tcversion_id) . " AND title = '" . + $this->db->prepare_string($target) . "'"; + + $rs = $this->db->get_recordset($sql); + if (null != $rs) { + $id = intval($rs[0]['id']); + } + + return $id; + } + + /** + */ + private function getFreeKeywords($idCard, $opt = null) + { + $my['opt'] = array( + 'accessKey' => 'keyword_id', + 'fields' => null, + 'orderBy' => null, + 'tproject_id' => null, + 'output' => 'std', + 'add_blank' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $safe = array(); + foreach ($idCard as $key => $val) { + $safe[$key] = intval($val); + } + + // CRITIC + $tproject_id = $my['opt']['tproject_id']; + if (null == $tproject_id) { + $tproject_id = $this->get_testproject($safe['tcase_id']); + } + $tproject_id = intval($tproject_id); + + $sql = " SELECT KW.id AS keyword_id, KW.keyword FROM {$this->tables['keywords']} KW WHERE KW.testproject_id = {$tproject_id} - AND KW.id NOT IN + AND KW.id NOT IN ( - SELECT TCKW.keyword_id + SELECT TCKW.keyword_id FROM {$this->tables['testcase_keywords']} TCKW WHERE TCKW.testcase_id = {$safe['tcase_id']} AND TCKW.tcversion_id = {$safe['tcversion_id']} - ) "; - - if (!is_null($my['opt']['orderBy'])) { - $sql .= ' ' . $my['opt']['orderBy']; - } - - switch($my['opt']['output']) { - case 'html_options': - $items = $this->db->fetchColumnsIntoMap($sql,'keyword_id','keyword'); - if( null != $items && $my['opt']['add_blank']) { - $items = array(0 => '') + $items; - } - - break; - - default: - $items = $this->db->fetchRowsIntoMap($sql,$my['opt']['accessKey']); - break; - } - - return $items; - } - - /** - * - */ - function getTCVersionIDFromVersion($tcaseID,$version) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safeTCID = intval($tcaseID); - $safeVersion = intval($version); - - $sql = " SELECT TCV.tcversion_id + ) "; + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + switch ($my['opt']['output']) { + case 'html_options': + $items = $this->db->fetchColumnsIntoMap($sql, 'keyword_id', + 'keyword'); + if (null != $items && $my['opt']['add_blank']) { + $items = array( + 0 => '' + ) + $items; + } + + break; + + default: + $items = $this->db->fetchRowsIntoMap($sql, + $my['opt']['accessKey']); + break; + } + + return $items; + } + + /** + */ + public function getTCVersionIDFromVersion($tcaseID, $version) + { + $safeTCID = intval($tcaseID); + $safeVersion = intval($version); + + $sql = " SELECT TCV.tcversion_id FROM {$this->tables['nodes_hierarcy']} NHTC JOIN {$this->tables['nodes_hierarcy']} NHTCV ON NHTCV.parent_id = NHTC.id JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id - WHERE NHTC.id = $safeTCID AND TCV.version = $safeVersion"; - - - $rs = current($this->db->get_recordset($sql)); - - return $rs['tcversion_id']; - } - - /** - * - */ - function latestVersionHasBeenExecuted($tcaseID) { - $sql = "SELECT COALESCE(E.tcversion_id,0) AS executed + WHERE NHTC.id = $safeTCID AND TCV.version = $safeVersion"; + + $rs = current($this->db->get_recordset($sql)); + + return $rs['tcversion_id']; + } + + /** + */ + public function latestVersionHasBeenExecuted($tcaseID) + { + $sql = "SELECT COALESCE(E.tcversion_id,0) AS executed FROM {$this->views['latest_tcase_version_id']} LTCV - LEFT OUTER JOIN {$this->tables['executions']} E + LEFT OUTER JOIN {$this->tables['executions']} E ON E.tcversion_id = LTCV.tcversion_id - WHERE LTCV.testcase_id=" . intval($tcaseID); - - $rs = current($this->db->get_recordset($sql)); - - return ($rs['executed'] != 0); - } - - - - /** - * ATTENTION: work done here need to be fixed when deleting the latest executed tcversion - * @see https://forum.testlink.org/viewtopic.php?f=11&p=21038#p21038 - * - * @see _execution_delete() - * - * @TODO 20210901 - understand differences with updateLatestTPlanLinkToTCV(); - * - */ - function updateTPlanLinkToLatestTCV($tcversionID,$tplanID,$platformID=null,$auditContext=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $execContext = new stdClass(); - $execContext->target = new stdClass(); - $execContext->target->tplanID = intval($tplanID); - $execContext->target->tcversionID = intval($tcversionID); - $execContext->target->platformID = intval($platformID); - - $ltcv = $this->updateTPlanLinkTCV($execContext,$auditContext); - return $ltcv; - } - - /** - * @used by testcaseCommanda.class -> updateTPlanLinkToTCV() - * - * - * @TODO 20210901 - understand differences with updateTPlanLinkToLatestTCV(); - * - */ - function updateLatestTPlanLinkToTCV($tcversionID,$tplanID,$auditContext=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // What is the linked version ? - // Need to get all siblings - $sqlA = " SELECT NH_SIB.id + WHERE LTCV.testcase_id=" . intval($tcaseID); + + $rs = current($this->db->get_recordset($sql)); + + return $rs['executed'] != 0; + } + + /** + * ATTENTION: work done here need to be fixed when deleting the latest executed tcversion + * + * @see https://forum.testlink.org/viewtopic.php?f=11&p=21038#p21038 + * + * @see _execution_delete() + * + * @todo 20210901 - understand differences with updateLatestTPlanLinkToTCV(); + * + */ + public function updateTPlanLinkToLatestTCV($tcversionID, $tplanID, + $platformID = null, $auditContext = null) + { + $execContext = new stdClass(); + $execContext->target = new stdClass(); + $execContext->target->tplanID = intval($tplanID); + $execContext->target->tcversionID = intval($tcversionID); + $execContext->target->platformID = intval($platformID); + + return $this->updateTPlanLinkTCV($execContext); + } + + /** + * + * @used by testcaseCommanda.class -> updateTPlanLinkToTCV() + * + * + * @todo 20210901 - understand differences with updateTPlanLinkToLatestTCV(); + * + */ + public function updateLatestTPlanLinkToTCV($tcversionID, $tplanID, + $auditContext = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + // What is the linked version ? + // Need to get all siblings + $sqlA = " SELECT NH_SIB.id FROM {$this->tables['nodes_hierarchy']} NH_SIB WHERE parent_id IN ( - SELECT NH_TCV.parent_id + SELECT NH_TCV.parent_id FROM {$this->tables['nodes_hierarchy']} NH_TCV WHERE id = $tcversionID - ) "; - - $sql = " SELECT TPTCV.id AS link_id + ) "; + + $sql = " SELECT TPTCV.id AS link_id FROM {$this->tables['testplan_tcversions']} TPTCV WHERE testplan_id = $tplanID - AND tcversion_id IN ($sqlA) "; - - $linkSet = $this->db->fetchRowsIntoMap($sql,'link_id'); - - $sql = " SELECT TPTCV.tcversion_id - FROM {$this->tables['testplan_tcversions']} TPTCV - WHERE testplan_id = $tplanID - AND tcversion_id IN ($sqlA) "; - - $tcvSet = $this->db->fetchRowsIntoMap($sqlA,'id'); - - if( count($linkSet) > 0 ) { - - $safeTP = intval($tplanID); - $linkItems = array_keys($linkSet); - $inClause = implode(',',$linkItems); - - - // @TODO 20210901 Understand if order is OK if we add Foreing Keys - // Links to testplan - $sql = "/* $debugMsg */ + AND tcversion_id IN ($sqlA) "; + + $linkSet = $this->db->fetchRowsIntoMap($sql, 'link_id'); + + $tcvSet = $this->db->fetchRowsIntoMap($sqlA, 'id'); + + if (! empty($linkSet)) { + + $safeTP = intval($tplanID); + $linkItems = array_keys($linkSet); + $inClause = implode(',', $linkItems); + + // @TODO 20210901 Understand if order is OK if we add Foreing Keys + // Links to testplan + $sql = "/* $debugMsg */ UPDATE {$this->tables['testplan_tcversions']} - SET tcversion_id = $tcversionID - WHERE testplan_id = $safeTP - AND id IN( $inClause ) "; - - $this->db->exec_query($sql); - - // Access by test case version id - $tcvItems = array_keys($tcvSet); - $inClause = implode(',',$tcvItems); - - // Execution results - $sql = "UPDATE {$this->tables['executions']} - SET tcversion_id = $tcversionID + SET tcversion_id = $tcversionID + WHERE testplan_id = $safeTP + AND id IN( $inClause ) "; + + $this->db->exec_query($sql); + + // Access by test case version id + $tcvItems = array_keys($tcvSet); + $inClause = implode(',', $tcvItems); + + // Execution results + $sql = "UPDATE {$this->tables['executions']} + SET tcversion_id = $tcversionID WHERE testplan_id = $safeTP - AND tcversion_id IN( $inClause )"; - $this->db->exec_query($sql); - - // Update link in cfields values - $sql = "UPDATE {$this->tables['cfield_execution_values']} - SET tcversion_id = $tcversionID + AND tcversion_id IN( $inClause )"; + $this->db->exec_query($sql); + + // Update link in cfields values + $sql = "UPDATE {$this->tables['cfield_execution_values']} + SET tcversion_id = $tcversionID WHERE testplan_id = $safeTP - AND tcversion_id IN( $inClause )"; - $this->db->exec_query($sql); - } - } - - - - /** - * ATTENTION: work done here need to be fixed when deleting the latest executed tcversion - * @see https://forum.testlink.org/viewtopic.php?f=11&p=21038#p21038 - * - * @see _execution_delete() - * - * execContext->target->tplanID - * ->platformID (can be null => any platform) MAY BE is USELESS - * ->tcversionID - * - * ->update->tcversionID - * if update property does not exists -> Latest TC Version - * - */ - function updateTPlanLinkTCV($execContext,$auditContext=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - - $fromTCV = intval($execContext->target->tcversionID); - $sql = "SELECT parent_id AS tc_id - FROM {$this->tables['nodes_hierarchy']} - WHERE id = $fromTCV"; - $rs = current($this->db->get_recordset($sql)); - - if ( property_exists($execContext,'update') == false ) { - $newTCV = $this->getLatestVersionID($rs['tc_id']); - } else { - $newTCV = $execContext->update->tcversionID; - } - - $safeTP = intval($execContext->target->tplanID); - $whereClause = " WHERE testplan_id = {$safeTP} - AND tcversion_id = $fromTCV "; - - if (property_exists($execContext->target,'platformID')) { - if( ($plat = intval($execContext->target->platformID)) > 0 ) { - $whereClause .= " AND platform_id=$plat "; - } - } - - $sql = "/* $debugMsg */ + AND tcversion_id IN( $inClause )"; + $this->db->exec_query($sql); + } + } + + /** + * ATTENTION: work done here need to be fixed when deleting the latest executed tcversion + * + * @see https://forum.testlink.org/viewtopic.php?f=11&p=21038#p21038 + * + * @see _execution_delete() execContext->target->tplanID + * ->platformID (can be null => any platform) MAY BE is USELESS + * ->tcversionID + * + * ->update->tcversionID + * if update property does not exists -> Latest TC Version + * + */ + private function updateTPlanLinkTCV($execContext) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $fromTCV = intval($execContext->target->tcversionID); + $sql = "SELECT parent_id AS tc_id + FROM {$this->tables['nodes_hierarchy']} + WHERE id = $fromTCV"; + $rs = current($this->db->get_recordset($sql)); + + if (! property_exists($execContext, 'update')) { + $newTCV = $this->getLatestVersionID($rs['tc_id']); + } else { + $newTCV = $execContext->update->tcversionID; + } + + $safeTP = intval($execContext->target->tplanID); + $whereClause = " WHERE testplan_id = {$safeTP} + AND tcversion_id = $fromTCV "; + + if (property_exists($execContext->target, 'platformID') && + ($plat = intval($execContext->target->platformID)) > 0) { + $whereClause .= " AND platform_id=$plat "; + } + + $sql = "/* $debugMsg */ UPDATE {$this->tables['testplan_tcversions']} - SET tcversion_id = " . $newTCV . $whereClause; - $this->db->exec_query($sql); - - - // Execution results - $sql = "/* $debugMsg */ - UPDATE {$this->tables['executions']} - SET tcversion_id = " . $newTCV . $whereClause; - $this->db->exec_query($sql); - - // Update link in cfields values for executions - // ATTENTION: - // platform seems not to be important because - // each execution in each platform has a new id. - // mmm, maybe this will create some minor issue - // in the future. - // - $sql = "/* $debugMsg */ - UPDATE {$this->tables['cfield_execution_values']} - SET tcversion_id = $newTCV + SET tcversion_id = " . $newTCV . $whereClause; + $this->db->exec_query($sql); + + // Execution results + $sql = "/* $debugMsg */ + UPDATE {$this->tables['executions']} + SET tcversion_id = " . $newTCV . $whereClause; + $this->db->exec_query($sql); + + // Update link in cfields values for executions + // ATTENTION: + // platform seems not to be important because + // each execution in each platform has a new id. + // mmm, maybe this will create some minor issue + // in the future. + // + $sql = "/* $debugMsg */ + UPDATE {$this->tables['cfield_execution_values']} + SET tcversion_id = $newTCV WHERE testplan_id = {$safeTP} - AND tcversion_id = $fromTCV "; - - $this->db->exec_query($sql); - - return $newTCV; - } - - - - - - - /** - * Insert note and status for steps to DB - * Delete data before insert => this way we will not add duplicates - * - * IMPORTANT NOTICE: - * if status is not a valid one, blank will be written - * - */ - public function saveStepsPartialExec($partialExec,$context) - { - if (!is_null($partialExec) && count($partialExec) > 0) { - $stepsIDSet = array_keys($partialExec['notes']); - $this->deleteStepsPartialExec($stepsIDSet,$context); - - $prop = get_object_vars($context); - $safeID = array(); - foreach($prop as $key => $value) { - $safeID[$key] = $this->db->prepare_int($value); - } - - $rCfg = config_get('results'); - $statusSet = $rCfg['status_code']; - $not_run = $statusSet['not_run']; - $statusSet = array_flip($statusSet); - - $statusToExclude = (array)$rCfg['execStatusToExclude']['step']; - $statusToExclude[] = $not_run; - $statusToExclude = array_flip($statusToExclude); - - foreach( $partialExec['notes'] as $stepID => $note ) { - $s2w = $partialExec['status'][$stepID]; - if( isset($statusToExclude[$s2w]) || - !isset($statusSet[$s2w]) ) { - $s2w = ''; - } - - $safeID['platform_id'] = ($safeID['platform_id'] == -1) ? 0 : $safeID['platform_id']; - $sql = " INSERT INTO {$this->tables['execution_tcsteps_wip']} + AND tcversion_id = $fromTCV "; + + $this->db->exec_query($sql); + + return $newTCV; + } + + /** + * Insert note and status for steps to DB + * Delete data before insert => this way we will not add duplicates + * + * IMPORTANT NOTICE: + * if status is not a valid one, blank will be written + */ + public function saveStepsPartialExec($partialExec, $context) + { + if (! empty($partialExec)) { + $stepsIDSet = array_keys($partialExec['notes']); + $this->deleteStepsPartialExec($stepsIDSet, $context); + + $prop = get_object_vars($context); + $safeID = array(); + foreach ($prop as $key => $value) { + $safeID[$key] = $this->db->prepare_int($value); + } + + $rCfg = config_get('results'); + $statusSet = $rCfg['status_code']; + $not_run = $statusSet['not_run']; + $statusSet = array_flip($statusSet); + + $statusToExclude = (array) $rCfg['execStatusToExclude']['step']; + $statusToExclude[] = $not_run; + $statusToExclude = array_flip($statusToExclude); + + foreach ($partialExec['notes'] as $stepID => $note) { + $s2w = $partialExec['status'][$stepID]; + if (isset($statusToExclude[$s2w]) || ! isset($statusSet[$s2w])) { + $s2w = ''; + } + + $safeID['platform_id'] = ($safeID['platform_id'] == - 1) ? 0 : $safeID['platform_id']; + $sql = " INSERT INTO {$this->tables['execution_tcsteps_wip']} (tcstep_id,testplan_id,platform_id,build_id,tester_id, - notes,status) VALUES - ({$stepID} ,{$safeID['testplan_id']}, + notes,status) VALUES + ({$stepID} ,{$safeID['testplan_id']}, {$safeID['platform_id']},{$safeID['build_id']}, - {$safeID['tester_id']},'" . - $this->db->prepare_string(htmlspecialchars($note)) . - "', '" . - $this->db->prepare_string($s2w) . - "');"; - $this->db->exec_query($sql); - } - } - } - - - - /** - * - */ - function isLinkedTCVersion($tcVersionID,$tplanID) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe = array('tcVersionID' => intval($tcVersionID), - 'tplanID' => intval($tplanID)); - - $sql = "/* $debugMsg */ + {$safeID['tester_id']},'" . + $this->db->prepare_string(htmlspecialchars($note)) . "', '" . + $this->db->prepare_string($s2w) . "');"; + $this->db->exec_query($sql); + } + } + } + + /** + */ + private function isLinkedTCVersion($tcVersionID, $tplanID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safe = array( + 'tcVersionID' => intval($tcVersionID), + 'tplanID' => intval($tplanID) + ); + + $sql = "/* $debugMsg */ SELECT id FROM {$this->tables['testplan_tcversions']} - WHERE testplan_id = {$safe['tplanID']} - AND tcversion_id = {$safe['tcVersionID']}"; - - $rs = (array)$this->db->get_recordset($sql); - - return (count($rs) > 0); - } - - - /** - * Get Steps Partial Execution record - * - * - * @return array map of result with "tcstep_id" in keys. - * - */ - public function getStepsPartialExec($stepsIds,$context) { - $rs = null; - if (!is_null($stepsIds) && count($stepsIds) > 0) { - - $fields2get = "tcstep_id,testplan_id,platform_id,build_id, - tester_id,notes,status,creation_ts"; - - $sql = "SELECT {$fields2get} - FROM {$this->tables['execution_tcsteps_wip']} - WHERE tcstep_id IN (" . implode(",", $stepsIds) . ") " . - " AND testplan_id = " . - $this->db->prepare_int($context->testplan_id) . - " AND platform_id = " . - $this->db->prepare_int($context->platform_id) . - " AND build_id = " . - $this->db->prepare_int($context->build_id); - $rs = $this->db->fetchRowsIntoMap($sql,"tcstep_id"); - } - return $rs; - } - - /** - * - */ - public function deleteStepsPartialExec($stepsIds,$context) { - if( count($stepsIds) > 0 ) { - // https://github.com/TestLinkOpenSourceTRMS/testlink-code/pull/327 - // Security - $inClause = $this->db->prepare_string(implode(",",$stepsIds)); - - $sql = " DELETE FROM {$this->tables['execution_tcsteps_wip']} - WHERE tcstep_id IN (" . $inClause . ") " . - " AND testplan_id = " . - $this->db->prepare_int($context->testplan_id) . - " AND platform_id = " . - $this->db->prepare_int($context->platform_id) . - " AND build_id = " . - $this->db->prepare_int($context->build_id); - $this->db->exec_query($sql); - } - } - - /** - * - */ - function getLatestExecIDInContext($tcversion_id,$ctx) { - - $tplan_id = -1; - $p2c = array('tplan_id','testplan_id'); - foreach( $p2c as $pp ) { - if( property_exists($ctx, $pp) ) { - $tplan_id = $ctx->$pp; - break; - } - } - - $sql = "SELECT id - FROM {$this->views['latest_exec_by_context']} - WHERE tcversion_id= $tcversion_id - AND testplan_id = $tplan_id - AND platform_id = $ctx->platform_id - AND build_id = $ctx->build_id"; - - $rs = $this->db->get_recordset($sql); - - if( null != $rs ) { - return $rs[0]['id']; - } - return -1; - } - - /** - * - * - */ - function getFreePlatforms($idCard,$opt = null) { - $my['opt'] = array('accessKey' => 'platform_id', 'fields' => null, - 'orderBy' => null, 'tproject_id' => null, - 'output' => 'std', 'add_blank' => false); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $safe = array(); - foreach($idCard as $key => $val) { - $safe[$key] = intval($val); - } - - // CRITIC - $tproject_id = $my['opt']['tproject_id']; - if( null == $tproject_id ) { - $tproject_id = $this->get_testproject($safe['tcase_id']); - } - $tproject_id = intval($tproject_id); - - $sql = " SELECT PL.id AS platform_id, PL.name AS platform - FROM {$this->tables['platforms']} PL - WHERE PL.testproject_id = {$tproject_id} - AND PL.enable_on_design = 1 - AND PL.id NOT IN - ( - SELECT TCPL.platform_id - FROM {$this->tables['testcase_platforms']} TCPL - WHERE TCPL.testcase_id = {$safe['tcase_id']} - AND TCPL.tcversion_id = {$safe['tcversion_id']} - ) "; - - if (!is_null($my['opt']['orderBy'])) { - $sql .= ' ' . $my['opt']['orderBy']; - } - - switch($my['opt']['output']) { - case 'html_options': - $items = $this->db->fetchColumnsIntoMap($sql,'platform_id','platform'); - if( null != $items && $my['opt']['add_blank']) { - $items = array(0 => '') + $items; - } - - break; - - default: - $items = $this->db->fetchRowsIntoMap($sql,$my['opt']['accessKey']); - break; - } - - return $items; - } - - /** - * - */ - function deletePlatformsByLink($tcID, $linkID, $audit=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeTCID = intval($tcID); - - $links = (array)$linkID; - $inClause = implode(',',$links); - - $sql = " /* $debugMsg */ - SELECT TCPL.tcversion_id, TCPL.platform_id - FROM {$this->tables['testcase_platforms']} TCPL - WHERE TCPL.testcase_id = {$safeTCID} - AND TCPL.id IN ($inClause) "; - - - $rs = $this->db->get_recordset($sql); - - foreach($rs as $link) { - $this->deletePlatforms($safeTCID, $link['tcversion_id'], - $link['platform_id'],$audit); - } - } - - /** - * - */ - function deletePlatforms($tcID,$versionID,$platID=null,$audit=null) { - - $sql = " DELETE FROM {$this->tables['testcase_platforms']} " . - " WHERE testcase_id = " . intval($tcID) . - " AND tcversion_id = " . intval($versionID); - - $adt = array('on' => self::AUDIT_ON); - $adt = array_merge($adt,(array)$audit); - - if (!is_null($platID)) { - if(is_array($platID)) { - $sql .= " AND platform_id IN (" . implode(',',$platID) . ")"; - $key4log=$platID; - } - else { - $sql .= " AND platform_id = {$platID}"; - $key4log = array($platID); - } - } - else { - $key4log = - array_keys((array)$this->getPlatformsMap($tcID,$versionID)); - } - - $result = $this->db->exec_query($sql); - - /* - if ($result) { - $tcInfo = $this->tree_manager->get_node_hierarchy_info($tcID); - if ($tcInfo && $key4log) { - foreach($key4log as $key2get) { - $keyword = tlKeyword::getByID($this->db,$key2get); - if ($keyword && $adt['on']==self::AUDIT_ON) { - logAuditEvent(TLS("audit_keyword_assignment_removed_tc",$keyword->name,$tcInfo['name']), - "ASSIGN",$tcID,"nodes_hierarchy"); - } - } - } - } - */ - - return $result; - } - - /** - * - */ - function getPlatformsMap($id,$version_id,$opt=null) { - $my['opt'] = array('orderByClause' => '', 'output' => null); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - - switch($my['opt']['output']) { - case 'full': + WHERE testplan_id = {$safe['tplanID']} + AND tcversion_id = {$safe['tcVersionID']}"; + + $rs = (array) $this->db->get_recordset($sql); + + return count($rs) > 0; + } + + /** + * Get Steps Partial Execution record + * + * + * @return array map of result with "tcstep_id" in keys. + * + */ + public function getStepsPartialExec($stepsIds, $context) + { + $rs = null; + if (! empty($stepsIds)) { + $fields2get = "tcstep_id,testplan_id,platform_id,build_id, + tester_id,notes,status,creation_ts"; + + $sql = "SELECT {$fields2get} " . + " FROM {$this->tables['execution_tcsteps_wip']} " . + " WHERE tcstep_id IN (" . implode(",", $stepsIds) . ") " . + " AND testplan_id = " . + $this->db->prepare_int($context->testplan_id) . + " AND platform_id = " . + $this->db->prepare_int($context->platform_id) . + " AND build_id = " . $this->db->prepare_int($context->build_id); + $rs = $this->db->fetchRowsIntoMap($sql, "tcstep_id"); + } + return $rs; + } + + /** + */ + public function deleteStepsPartialExec($stepsIds, $context) + { + if (count($stepsIds) > 0) { + // https://github.com/TestLinkOpenSourceTRMS/testlink-code/pull/327 + // Security + $inClause = $this->db->prepare_string(implode(",", $stepsIds)); + + $sql = " DELETE FROM {$this->tables['execution_tcsteps_wip']} " . + " WHERE tcstep_id IN (" . $inClause . ") " . + " AND testplan_id = " . + $this->db->prepare_int($context->testplan_id) . + " AND platform_id = " . + $this->db->prepare_int($context->platform_id) . + " AND build_id = " . $this->db->prepare_int($context->build_id); + $this->db->exec_query($sql); + } + } + + /** + */ + public function getLatestExecIDInContext($tcversion_id, $ctx) + { + $tplan_id = - 1; + $p2c = array( + 'tplan_id', + 'testplan_id' + ); + foreach ($p2c as $pp) { + if (property_exists($ctx, $pp)) { + $tplan_id = $ctx->$pp; + break; + } + } + + $sql = "SELECT id " . " FROM {$this->views['latest_exec_by_context']} " . + " WHERE tcversion_id= $tcversion_id " . + " AND testplan_id = $tplan_id " . + " AND platform_id = $ctx->platform_id " . + " AND build_id = $ctx->build_id"; + + $rs = $this->db->get_recordset($sql); + + if (null != $rs) { + return $rs[0]['id']; + } + return - 1; + } + + /** + */ + private function getFreePlatforms($idCard, $opt = null) + { + $my['opt'] = array( + 'accessKey' => 'platform_id', + 'fields' => null, + 'orderBy' => null, + 'tproject_id' => null, + 'output' => 'std', + 'add_blank' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $safe = array(); + foreach ($idCard as $key => $val) { + $safe[$key] = intval($val); + } + + // CRITIC + $tproject_id = $my['opt']['tproject_id']; + if (null == $tproject_id) { + $tproject_id = $this->get_testproject($safe['tcase_id']); + } + $tproject_id = intval($tproject_id); + + $sql = " SELECT PL.id AS platform_id, PL.name AS platform " . + " FROM {$this->tables['platforms']} PL " . + " WHERE PL.testproject_id = {$tproject_id} " . + " AND PL.enable_on_design = 1 " . " AND PL.id NOT IN " . + " ( SELECT TCPL.platform_id " . + " FROM {$this->tables['testcase_platforms']} TCPL " . + " WHERE TCPL.testcase_id = {$safe['tcase_id']} " . + " AND TCPL.tcversion_id = {$safe['tcversion_id']} ) "; + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + switch ($my['opt']['output']) { + case 'html_options': + $items = $this->db->fetchColumnsIntoMap($sql, 'platform_id', + 'platform'); + if (null != $items && $my['opt']['add_blank']) { + $items = array( + 0 => '' + ) + $items; + } + + break; + + default: + $items = $this->db->fetchRowsIntoMap($sql, + $my['opt']['accessKey']); + break; + } + + return $items; + } + + /** + */ + public function deletePlatformsByLink($tcID, $linkID, $audit = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $safeTCID = intval($tcID); + + $links = (array) $linkID; + $inClause = implode(',', $links); + + $sql = " /* $debugMsg */ SELECT TCPL.tcversion_id, TCPL.platform_id " . + " FROM {$this->tables['testcase_platforms']} TCPL " . + " WHERE TCPL.testcase_id = {$safeTCID} " . + " AND TCPL.id IN ($inClause) "; + + $rs = $this->db->get_recordset($sql); + + foreach ($rs as $link) { + $this->deletePlatforms($safeTCID, $link['tcversion_id'], + $link['platform_id'], $audit); + } + } + + /** + */ + public function deletePlatforms($tcID, $versionID, $platID = null, + $audit = null) + { + $adt = array( + 'on' => self::AUDIT_ON + ); + $adt = array_merge($adt, (array) $audit); + + $sql = " DELETE FROM {$this->tables['testcase_platforms']} " . + " WHERE testcase_id = " . intval($tcID) . " AND tcversion_id = " . + intval($versionID); + if (! is_null($platID)) { + if (is_array($platID)) { + $sql .= " AND platform_id IN (" . implode(',', $platID) . ")"; + } else { + $sql .= " AND platform_id = {$platID}"; + } + } + + return $this->db->exec_query($sql); + } + + /** + */ + private function getPlatformsMap($id, $version_id, $opt = null) + { + $my['opt'] = array( + 'orderByClause' => '', + 'output' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + switch ($my['opt']['output']) { + case 'full': + $sql = "SELECT TCPL.platform_id,PL.name,PL.notes, + PL.enable_on_design,PL.enable_on_execution"; + break; + + default: + $sql = "SELECT TCPL.platform_id,PL.name"; + break; + } + $sql .= " FROM {$this->tables['testcase_platforms']} TCPL, + {$this->tables['platforms']} PL + WHERE platform_id = PL.id "; + + $sql .= " AND TCPL.testcase_id = " . intval($id) . + " AND TCPL.tcversion_id = " . intval($version_id); + + $sql .= $my['opt']['orderByClause']; + + switch ($my['opt']['output']) { + case 'full': + $items = $this->db->fetchRowsIntoMap($sql, 'platform_id'); + break; + + default: + $items = $this->db->fetchColumnsIntoMap($sql, 'platform_id', + 'name'); + break; + } + + return $items; + } + + /** + */ + private function getPlatformsAsXMLString($id, $version_id) + { + require_once '../../third_party/adodb_xml/class.ADODB_XML.php'; + $sql = "SELECT TCPL.platform_id,PL.name,PL.notes, - PL.enable_on_design,PL.enable_on_execution"; - break; - - default: - $sql = "SELECT TCPL.platform_id,PL.name"; - break; - } - $sql .= " FROM {$this->tables['testcase_platforms']} TCPL, - {$this->tables['platforms']} PL - WHERE platform_id = PL.id "; - - $sql .= " AND TCPL.testcase_id = " . intval($id) . - " AND TCPL.tcversion_id = " . intval($version_id); - - $sql .= $my['opt']['orderByClause']; - - switch($my['opt']['output']) { - case 'full': - $items = $this->db->fetchRowsIntoMap($sql,'platform_id'); - break; - - default: - $items = $this->db->fetchColumnsIntoMap($sql,'platform_id','name'); - break; - } - - return $items; - } - - /** - * - * - */ - function getPlatformsAsXMLString($id,$version_id) - { - require_once('../../third_party/adodb_xml/class.ADODB_XML.php'); - - - $sql = "SELECT TCPL.platform_id,PL.name,PL.notes, PL.enable_on_design,PL.enable_on_execution FROM {$this->tables['testcase_platforms']} TCPL, - {$this->tables['platforms']} PL - WHERE platform_id = PL.id "; - $sql .= " AND TCPL.testcase_id = " . intval($id) . - " AND TCPL.tcversion_id = " . intval($version_id); - - - $adodbXML = new ADODB_XML(); // it's ok because we do not want to write the header - $adodbXML->setRootTagName('platforms'); - $adodbXML->setRowTagName('platform'); - $xmlString = $adodbXML->ConvertToXMLString($this->db->db, $sql, ('write_header' == 'no')); - return $xmlString; - } - - - - - - /** - * - */ - function addPlatforms($id,$version_id,$idSet,$audit=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $adt = array('on' => self::AUDIT_ON, 'version' => null); - $adt = array_merge($adt, (array)$audit); - - if( count($idSet) == 0 ) { - return true; - } - - $safeID = array('tc' => intval($id), 'tcv' => intval($version_id)); - foreach($safeID as $key => $val ) { - if($val <= 0) { - throw new Exception(__METHOD__ . " $key cannot be $val ", 1); - } - } - - // Firts check if records exist - $sql = "/* $debugMsg */ - SELECT platform_id FROM - {$this->tables['testcase_platforms']} - WHERE testcase_id = {$safeID['tc']} - AND tcversion_id = {$safeID['tcv']} - AND platform_id IN (" . implode(',',$idSet) . ")"; - - $nuCheck = $this->db->fetchRowsIntoMap($sql,'platform_id'); - - $sql = "/* $debugMsg */" . - " INSERT INTO {$this->tables['testcase_platforms']} " . - " (testcase_id,tcversion_id,platform_id) VALUES "; - - $dummy = array(); - foreach( $idSet as $kiwi ) { - if( !isset($nuCheck[$kiwi]) ) { - $dummy[] = "($id,$version_id,$kiwi)"; - } - } - - if( count($dummy) <= 0 ) { - return; - } - - // Go ahead - $sql .= implode(',', $dummy); - $this->db->exec_query($sql); - - // Now AUDIT - if ( $adt['on'] == self::AUDIT_ON ) { - - // Audit Context - $tcPath = $this->getPathName( $id ); - - /* - $kwOpt = array('cols' => 'id,keyword', - 'accessKey' => 'id', 'kwSet' => $kw_ids); - $keywordSet = tlKeyword::getSimpleSet($this->db,$kwOpt); - */ - - /* - foreach($keywordSet as $elem ) { - logAuditEvent(TLS("audit_keyword_assigned_tc",$elem['keyword'], - $tcPath,$adt['version']), - "ASSIGN",$version_id,"nodes_hierarchy"); - } - */ - } - - return true; - } - - /** - * - */ - function getPlatforms($tcID,$versionID,$platID = null,$opt = null) { - $my['opt'] = array('accessKey' => 'platform_id', 'fields' => null, - 'orderBy' => null); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $f2g = is_null($my['opt']['fields']) ? - ' TCPL.id AS tcplat_link,platform_id,PL.name,PL.notes, - testcase_id,tcversion_id ' : - $my['opt']['fields']; - - $sql = " SELECT {$f2g} + {$this->tables['platforms']} PL + WHERE platform_id = PL.id "; + $sql .= " AND TCPL.testcase_id = " . intval($id) . + " AND TCPL.tcversion_id = " . intval($version_id); + + $adodbXML = new ADODB_XML(); // it's ok because we do not want to write the header + $adodbXML->setRootTagName('platforms'); + $adodbXML->setRowTagName('platform'); + return $adodbXML->ConvertToXMLString($this->db->db, $sql, + ('write_header' == 'no')); + } + + /** + */ + public function addPlatforms($id, $version_id, $idSet, $audit = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $adt = array( + 'on' => self::AUDIT_ON, + 'version' => null + ); + $adt = array_merge($adt, (array) $audit); + + if (count($idSet) == 0) { + return true; + } + + $safeID = array( + 'tc' => intval($id), + 'tcv' => intval($version_id) + ); + foreach ($safeID as $key => $val) { + if ($val <= 0) { + throw new Exception(__METHOD__ . " $key cannot be $val ", 1); + } + } + + // Firts check if records exist + $sql = "/* $debugMsg */ + SELECT platform_id FROM + {$this->tables['testcase_platforms']} + WHERE testcase_id = {$safeID['tc']} + AND tcversion_id = {$safeID['tcv']} + AND platform_id IN (" . implode(',', $idSet) . ")"; + + $nuCheck = $this->db->fetchRowsIntoMap($sql, 'platform_id'); + + $sql = "/* $debugMsg */" . + " INSERT INTO {$this->tables['testcase_platforms']} " . + " (testcase_id,tcversion_id,platform_id) VALUES "; + + $dummy = array(); + foreach ($idSet as $kiwi) { + if (! isset($nuCheck[$kiwi])) { + $dummy[] = "($id,$version_id,$kiwi)"; + } + } + + if (empty($dummy)) { + return; + } + + // Go ahead + $sql .= implode(',', $dummy); + $this->db->exec_query($sql); + + // Now AUDIT + if ($adt['on'] == self::AUDIT_ON) { + // Audit Context + $this->getPathName($id); + } + + return true; + } + + /** + */ + public function getPlatforms($tcID, $versionID, $platID = null, $opt = null) + { + $my['opt'] = array( + 'accessKey' => 'platform_id', + 'fields' => null, + 'orderBy' => null + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $f2g = is_null($my['opt']['fields']) ? ' TCPL.id AS tcplat_link,platform_id,PL.name,PL.notes, + testcase_id,tcversion_id ' : $my['opt']['fields']; + + $sql = " SELECT {$f2g} FROM {$this->tables['testcase_platforms']} TCPL JOIN {$this->tables['platforms']} PL - ON platform_id = PL.id "; - - $sql .= " WHERE testcase_id = " . intval($tcID) . - " AND tcversion_id=" . intval($versionID); - - if (!is_null($platID)) { - $sql .= " AND platform_id = " . intval($platID); - } - - if (!is_null($my['opt']['orderBy'])) { - $sql .= ' ' . $my['opt']['orderBy']; - } - - switch( $my['opt']['accessKey'] ) { - case 'testcase_id,tcversion_id'; - $items = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','tcversion_id',database::CUMULATIVE); - break; - - default: - $items = $this->db->fetchRowsIntoMap($sql,$my['opt']['accessKey']); - break; - } - - return $items; - } - - - /** - * - */ - function getDeleteTCVPlatformRelativeURL($identity,&$guiObj=null) { - $url = "lib/testcases/tcEdit.php?doAction=removePlatform"; - - if( null != $guiObj ) { - $p2l = array('show_mode','tplan_id'); - foreach($p2l as $pr) { - if( property_exists($guiObj, $pr) ) { - $url .= "&$pr=" . $guiObj->$pr; - } - } - } - - $url .= '&tcase_id=%1&tcplat_link_id=%2'; - return $url; - } - - /** - * mappings is only useful when source_id and target_id do not belong - * to same Test Project. - * Because platforms are defined INSIDE a Test Project, - * ID will be different for same keyword - * in a different Test Project. - * - */ - function copyPlatformsTo($source,$dest,$platMap,$auditContext=null,$opt=null) { - - $adt = array('on' => self::AUDIT_ON); - if( isset($dest['version']) ) { - $adt['version'] = $dest['version']; - } - $adt = array_merge($adt,(array)$auditContext); - - $what = array('delete' => true); - $what = array_merge($what,(array)$opt); - - // Not sure that this delete is needed (@20180610) - if( $what['delete'] ) { - $this->deletePlatforms($dest['id'],$dest['version_id'],null,$auditContext); - } - - $sourceIT = $this->getPlatforms($source['id'],$source['version_id']); - - if( !is_null($sourceIT) ) { - - // build item id list - $itSet = array_keys($sourceIT); - if( null != $platMap ) { - foreach($itSet as $itemPos => $itemID) { - if( isset($mappings[$itemID]) ) { - $itSet[$itemPos] = $mappings[$itemID]; - } - } - } - - $this->addPlatforms($dest['id'],$dest['version_id'],$itSet,$adt); - } - - return true; - } - - /** - * - */ - function getLTCVInfo($tcaseID) { - $parentSet = (array)$tcaseID; - $sql = "SELECT + ON platform_id = PL.id "; + + $sql .= " WHERE testcase_id = " . intval($tcID) . " AND tcversion_id=" . + intval($versionID); + + if (! is_null($platID)) { + $sql .= " AND platform_id = " . intval($platID); + } + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + switch ($my['opt']['accessKey']) { + case 'testcase_id,tcversion_id': + $items = $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', + 'tcversion_id', database::CUMULATIVE); + break; + + default: + $items = $this->db->fetchRowsIntoMap($sql, + $my['opt']['accessKey']); + break; + } + + return $items; + } + + /** + */ + private function getDeleteTCVPlatformRelativeURL(&$guiObj = null) + { + $url = "lib/testcases/tcEdit.php?doAction=removePlatform"; + + if (null != $guiObj) { + $p2l = array( + 'show_mode', + 'tplan_id' + ); + foreach ($p2l as $pr) { + if (property_exists($guiObj, $pr)) { + $url .= "&$pr=" . $guiObj->$pr; + } + } + } + + $url .= '&tcase_id=%1&tcplat_link_id=%2'; + return $url; + } + + /** + * mappings is only useful when source_id and target_id do not belong + * to same Test Project. + * Because platforms are defined INSIDE a Test Project, + * ID will be different for same keyword + * in a different Test Project. + */ + private function copyPlatformsTo(array $source, $dest, $platMap, + $auditContext = null, $opt = null): bool + { + $adt = array( + 'on' => self::AUDIT_ON + ); + if (isset($dest['version'])) { + $adt['version'] = $dest['version']; + } + $adt = array_merge($adt, (array) $auditContext); + + $what = array( + 'delete' => true + ); + $what = array_merge($what, (array) $opt); + + // Not sure that this delete is needed (@20180610) + if ($what['delete']) { + $this->deletePlatforms($dest['id'], $dest['version_id'], null, + $auditContext); + } + + $sourceIT = $this->getPlatforms($source['id'], $source['version_id']); + + if (! is_null($sourceIT)) { + + // build item id list + $itSet = array_keys($sourceIT); + if (null != $platMap) { + foreach ($itSet as $itemPos => $itemID) { + if (isset($mappings[$itemID])) { + $itSet[$itemPos] = $mappings[$itemID]; + } + } + } + + $this->addPlatforms($dest['id'], $dest['version_id'], $itSet, $adt); + } + + return true; + } + + /** + */ + public function getLTCVInfo($tcaseID) + { + $parentSet = (array) $tcaseID; + $sql = "SELECT NHTC.name, NHTCV.node_order, NHTC.parent_id AS testsuite_id, - LTCV.tcversion_id, TCV.id, TCV.version, + LTCV.tcversion_id, TCV.id, TCV.version, NHTCV.parent_id AS testcase_id, TCV.active, TCV.tc_external_id, TCV.execution_type, TCV.importance, @@ -10008,19 +10098,15 @@ function getLTCVInfo($tcaseID) { ON NHTCV.id = TCV.id JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id - WHERE LTCV.testcase_id IN (" . - implode(',',$parentSet) . ")"; - - // $rs = $this->db->fetchRowsIntoMap($sql,'testcase_id'); - $rs = $this->db->get_recordset($sql); - return $rs; - } - - /** - * - */ - function getTestProjectKeywords($tproj_id) { - return $this->tproject_mgr->getKeywordsAsMapByName($tproj_id); - } - -} // Class end + WHERE LTCV.testcase_id IN (" . implode(',', $parentSet) . ")"; + + return $this->db->get_recordset($sql); + } + + /** + */ + private function getTestProjectKeywords($tproj_id) + { + return $this->tproject_mgr->getKeywordsAsMapByName($tproj_id); + } +} diff --git a/lib/functions/testplan.class.php b/lib/functions/testplan.class.php index c08cb51358..597bee26d6 100644 --- a/lib/functions/testplan.class.php +++ b/lib/functions/testplan.class.php @@ -1,9024 +1,8645 @@ - "XML"); // array("XML" => "XML", "XLS" => "XLS" ); - - var $resultsCfg; - var $tcaseCfg; - - var $notRunStatusCode; - var $execTaskCode; - - - // Nodes to exclude when do test plan tree traversal - var $nt2exclude=array('testplan' => 'exclude_me', - 'requirement_spec'=> 'exclude_me', - 'requirement'=> 'exclude_me'); - - var $nt2exclude_children=array('testcase' => 'exclude_my_children', - 'requirement_spec'=> 'exclude_my_children'); - - /** - * testplan class constructor - * - * @param resource &$db reference to database handler - */ - function __construct(&$db) - { - $this->db = &$db; - $this->tree_manager = new tree($this->db); - $this->node_types_descr_id = $this->tree_manager->get_available_node_types(); - $this->node_types_id_descr = array_flip($this->node_types_descr_id); - - $this->assignment_mgr = new assignment_mgr($this->db); - $this->assignment_types = $this->assignment_mgr->get_available_types(); - $this->assignment_status = $this->assignment_mgr->get_available_status(); - - $this->cfield_mgr = new cfield_mgr($this->db); - $this->tcase_mgr = New testcase($this->db); - $this->platform_mgr = new tlPlatform($this->db); - $this->tproject_mgr = new testproject($this->db); - - - $this->resultsCfg = config_get('results'); - $this->tcaseCfg = config_get('testcase_cfg'); - - - // special values used too many times - $this->notRunStatusCode = $this->resultsCfg['status_code']['not_run']; - $this->execTaskCode = intval($this->assignment_types['testcase_execution']['id']); - - tlObjectWithAttachments::__construct($this->db,'testplans'); - } - - /** - * getter for import types - * @return array key: import file type code, value: import file type verbose description - */ - function get_import_file_types() - { - return $this->import_file_types; - } - - /** - * creates a tesplan on Database, for a testproject. - * - * @param string $name: testplan name - * @param string $notes: testplan notes - * @param string $testproject_id: testplan parent - * - * @return integer status code - * if everything ok -> id of new testplan (node id). - * if problems -> 0. - */ - function create($name,$notes,$testproject_id,$is_active=1,$is_public=1) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $node_types=$this->tree_manager->get_available_node_types(); - $tplan_id = $this->tree_manager->new_node($testproject_id,$node_types['testplan'],$name); - - $active_status=intval($is_active) > 0 ? 1 : 0; - $public_status=intval($is_public) > 0 ? 1 : 0; - - $api_key = md5(rand()) . md5(rand()); - - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['testplans']} (id,notes,api_key,testproject_id,active,is_public) " . - " VALUES ( {$tplan_id} " . ", '" . $this->db->prepare_string($notes) . "'," . - "'" . $this->db->prepare_string($api_key) . "'," . - $testproject_id . "," . $active_status . "," . $public_status . ")"; - $result = $this->db->exec_query($sql); - $id = 0; - if ($result) - { - $id = $tplan_id; - } - - return $id; - } - - - /** - * - */ - function createFromObject($item,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('doChecks' => false, 'setSessionProject' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - try { - // mandatory checks - if(strlen($item->name)==0) { - throw new Exception('Empty name is not allowed'); - } - - // what checks need to be done ? - // 1. test project exist - $pinfo = null; - if( is_numeric($item->testProjectID) ) { - $pinfo = $this->tproject_mgr->get_by_id(intval($item->testProjectID)); - } - - if( null == $pinfo || count($pinfo) == 0 ) { - $pinfo = $this->tproject_mgr->get_by_prefix($item->testProjectID); - } - - if( is_null($pinfo) || count($pinfo) == 0 ) { - throw new Exception('Test project ID does not exist'); - } - - $tproject_id = intval($pinfo['id']); - - // 2. there is NO other test plan on test project with same name - $name = trim($item->name); - $op = $this->checkNameExistence($name,$tproject_id); - if(!$op['status_ok']) { - throw new Exception('Test plan name is already in use on Test project'); - } - } catch (Exception $e) { - throw $e; // rethrow - } - - // seems OK => go - $active_status = intval($item->active) > 0 ? 1 : 0; - $public_status = intval($item->is_public) > 0 ? 1 : 0; - - $api_key = md5(rand()) . md5(rand()); - - $id = $this->tree_manager->new_node($tproject_id,$this->node_types_descr_id['testplan'],$name); - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['testplans']} (id,notes,api_key,testproject_id,active,is_public) " . - " VALUES ( {$id} " . ", '" . $this->db->prepare_string($item->notes) . "'," . - "'" . $this->db->prepare_string($api_key) . "'," . - $tproject_id . "," . - $active_status . "," . $public_status . ")"; - $result = $this->db->exec_query($sql); - return $result ? $id : 0; - } - - - /** - * - */ - function updateFromObject($item,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('doChecks' => false, 'setSessionProject' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - if( !property_exists($item, 'id') ) { - throw new Exception('Test plan ID is missing'); - } - - if( ($safeID = intval($item->id)) == 0 ) { - throw new Exception('Test plan ID 0 is not allowed'); - } - - $pinfo = $this->get_by_id($safeID, array( 'output' => 'minimun')); - if(is_null($pinfo)) { - throw new Exception('Test plan ID does not exist'); - } - - $attr = array(); - $upd = ''; - try { - if( property_exists($item, 'name') ) { - $name = trim($item->name); - if(strlen($name)==0) { - throw new Exception('Empty name is not allowed'); - } - - // 1. NO other test plan on test project with same name - $op = $this->checkNameExistence($name,$pinfo['testproject_id'],$safeID); - if(!$op['status_ok']) { - throw new Exception('Test plan name is already in use on Test project'); - } - - $sql = "/* $debugMsg */ " . - " UPDATE {$this->tables['nodes_hierarchy']} " . - " SET name='" . $this->db->prepare_string($name) . "'" . - " WHERE id={$safeID}"; - $result = $this->db->exec_query($sql); - } - - if( property_exists($item, 'notes') ) { - $upd .= ($upd != '' ? ',' : '') . " notes = '" . $this->db->prepare_string($item->notes) . "' "; - } - - $intAttr = array('active','is_public'); - foreach($intAttr as $key) { - if( property_exists($item, $key) ) { - $upd .= ($upd != '' ? ',' : '') . $key . ' = ' . (intval($item->$key) > 0 ? 1 : 0); - } - } - - if($upd != '') { - $sql = " UPDATE {$this->tables['testplans']} " . - " SET {$upd} WHERE id=" . $safeID; - $result = $this->db->exec_query($sql); - } - } catch (Exception $e) { - throw $e; // rethrow - } - return $safeID; - } - - - - /** - * Checks is there is another test plan inside test project - * with different id but same name - * - **/ - function checkNameExistence($name,$tprojectID,$id=0) { - $check_op['msg'] = ''; - $check_op['status_ok'] = 1; - - if($this->get_by_name($name,intval($tprojectID), array('id' => intval($id))) ) { - $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'),$name); - $check_op['status_ok'] = 0; - } - return $check_op; - } - - - /** - * update testplan information - * - * @param integer $id Test plan identifier - * @param string $name: testplan name - * @param string $notes: testplan notes - * @param boolean $is_active - * - * @return integer result code (1=ok) - */ - function update($id,$name,$notes,$is_active=null,$is_public=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $do_update = 1; - $result = null; - // $active = to_boolean($is_active); - $name = trim($name); - - // two tables to update and we have no transaction yet. - $rsa = $this->get_by_id($id); - $duplicate_check = (strcmp($rsa['name'],$name) != 0 ); - - if($duplicate_check) - { - $rs = $this->get_by_name($name,$rsa['parent_id']); - $do_update = is_null($rs); - } - - if($do_update) - { - // Update name - $sql = "/* $debugMsg */ "; - $sql .= "UPDATE {$this->tables['nodes_hierarchy']} " . - "SET name='" . $this->db->prepare_string($name) . "'" . - "WHERE id={$id}"; - $result = $this->db->exec_query($sql); - - if($result) - { - $add_upd=''; - if( !is_null($is_active) ) - { - $add_upd .=',active=' . (intval($is_active) > 0 ? 1 : 0); - } - if( !is_null($is_public) ) - { - $add_upd .=',is_public=' . (intval($is_public) > 0 ? 1:0); - } - - $sql = " UPDATE {$this->tables['testplans']} " . - " SET notes='" . $this->db->prepare_string($notes). "' " . - " {$add_upd} WHERE id=" . $id; - $result = $this->db->exec_query($sql); - } - } - return ($result ? 1 : 0); - } - - - /* - function: get_by_name - get information about a testplan using name as access key. - Search can be narrowed, givin a testproject id as filter criteria. - - args: name: testplan name - [tproject_id]: default:0 -> system wide search i.e. inside all testprojects - - returns: if nothing found -> null - if found -> array where every element is a map with following keys: - id: testplan id - notes: - active: active status - is_open: open status - name: testplan name - testproject_id - */ - function get_by_name($name,$tproject_id=0,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my = array(); - $my['opt'] = array('output' => 'full', 'id' => 0); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = "/* $debugMsg */ "; - - switch($my['opt']['output']) - { - case 'minimun': - $sql .= " SELECT testplans.id, NH.name "; - break; - - case 'full': - default: - $sql .= " SELECT testplans.*, NH.name "; - break; - } - - $sql .= " FROM {$this->tables['testplans']} testplans, " . - " {$this->tables['nodes_hierarchy']} NH" . - " WHERE testplans.id = NH.id " . - " AND NH.name = '" . $this->db->prepare_string($name) . "'"; - - if( ($safe_id = intval($tproject_id)) > 0 ) - { - $sql .= " AND NH.parent_id={$safe_id} "; - } - - // useful when trying to check for duplicates ? - if( ($my['opt']['id'] = intval($my['opt']['id'])) > 0) - { - $sql .= " AND testplans.id != {$my['opt']['id']} "; - } - - $rs = $this->db->get_recordset($sql); - return($rs); - } - - - /* - function: get_by_id - - args : id: testplan id - - returns: map with following keys: - id: testplan id - name: testplan name - notes: testplan notes - testproject_id - active - is_open - parent_id - */ - function get_by_id($id, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array(); - $my['opt'] = array('output' => 'full','active' => null, 'testPlanFields' => ''); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $safe_id = intval($id); - switch($my['opt']['output']) { - case 'testPlanFields': - $sql = "/* $debugMsg */ " . - " SELECT {$my['opt']['testPlanFields']} FROM {$this->tables['testplans']} " . - " WHERE id = " . $safe_id; - break; - - case 'minimun': - $sql = "/* $debugMsg */ " . - " SELECT NH_TPLAN.name," . - " NH_TPROJ.id AS tproject_id, NH_TPROJ.name AS tproject_name,TPROJ.prefix" . - " FROM {$this->tables['nodes_hierarchy']} NH_TPLAN " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TPROJ ON NH_TPROJ.id = NH_TPLAN.parent_id " . - " JOIN {$this->tables['testprojects']} TPROJ ON TPROJ.ID = NH_TPROJ.id " . - " WHERE NH_TPLAN.id = " . $safe_id; - break; - - case 'full': - default: - $sql = "/* $debugMsg */ " . - " SELECT TPLAN.*,NH_TPLAN.name,NH_TPLAN.parent_id, - NH_TPROJ.id AS tproject_id, - NH_TPROJ.name AS tproject_name,TPROJ.prefix - FROM {$this->tables['testplans']} TPLAN, + "XML" + ); + + private $resultsCfg; + + private $tcaseCfg; + + protected $notRunStatusCode; + + protected $execTaskCode; + + // Nodes to exclude when do test plan tree traversal + private $nt2exclude = array( + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + private $nt2exclude_children = array( + 'testcase' => 'exclude_my_children', + 'requirement_spec' => 'exclude_my_children' + ); + + /** + * testplan class constructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + $this->db = &$db; + $this->tree_manager = new tree($this->db); + $this->node_types_descr_id = $this->tree_manager->get_available_node_types(); + $this->node_types_id_descr = array_flip($this->node_types_descr_id); + + $this->assignment_mgr = new assignment_mgr($this->db); + $this->assignment_types = $this->assignment_mgr->get_available_types(); + $this->assignment_status = $this->assignment_mgr->get_available_status(); + + $this->cfield_mgr = new cfield_mgr($this->db); + $this->tcaseMgr = new testcase($this->db); + $this->platform_mgr = new tlPlatform($this->db); + $this->tproject_mgr = new testproject($this->db); + + $this->resultsCfg = config_get('results'); + $this->tcaseCfg = config_get('testcase_cfg'); + + // special values used too many times + $this->notRunStatusCode = $this->resultsCfg['status_code']['not_run']; + $this->execTaskCode = intval( + $this->assignment_types['testcase_execution']['id']); + + tlObjectWithAttachments::__construct($this->db, 'testplans'); + } + + /** + * getter for import types + * + * @return array key: import file type code, value: import file type verbose description + */ + public function get_import_file_types() + { + return $this->import_file_types; + } + + /** + * creates a tesplan on Database, for a testproject. + * + * @param string $name: + * testplan name + * @param string $notes: + * testplan notes + * @param string $testproject_id: + * testplan parent + * + * @return integer status code + * if everything ok -> id of new testplan (node id). + * if problems -> 0. + */ + public function create($name, $notes, $testproject_id, $is_active = 1, + $is_public = 1) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $node_types = $this->tree_manager->get_available_node_types(); + $tplan_id = $this->tree_manager->new_node($testproject_id, + $node_types['testplan'], $name); + + $active_status = intval($is_active) > 0 ? 1 : 0; + $public_status = intval($is_public) > 0 ? 1 : 0; + + $api_key = md5(rand()) . md5(rand()); + + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['testplans']} (id,notes,api_key,testproject_id,active,is_public) " . + " VALUES ( {$tplan_id} " . ", '" . $this->db->prepare_string($notes) . + "'," . "'" . $this->db->prepare_string($api_key) . "'," . + $testproject_id . "," . $active_status . "," . $public_status . ")"; + $result = $this->db->exec_query($sql); + $id = 0; + if ($result) { + $id = $tplan_id; + } + + return $id; + } + + /** + */ + public function createFromObject($item, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $my['opt'] = array( + 'doChecks' => false, + 'setSessionProject' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + try { + // mandatory checks + if (strlen($item->name) == 0) { + throw new Exception('Empty name is not allowed'); + } + + // what checks need to be done ? + // 1. test project exist + $pinfo = null; + if (is_numeric($item->testProjectID)) { + $pinfo = $this->tproject_mgr->get_by_id( + intval($item->testProjectID)); + } + + if (null == $pinfo || empty($pinfo)) { + $pinfo = $this->tproject_mgr->get_by_prefix( + $item->testProjectID); + } + + if (is_null($pinfo) || empty($pinfo)) { + throw new Exception('Test project ID does not exist'); + } + + $tproject_id = intval($pinfo['id']); + + // 2. there is NO other test plan on test project with same name + $name = trim($item->name); + $op = $this->checkNameExistence($name, $tproject_id); + if (! $op['status_ok']) { + throw new Exception( + 'Test plan name is already in use on Test project'); + } + } catch (Exception $e) { + throw $e; + } + + // seems OK => go + $active_status = intval($item->active) > 0 ? 1 : 0; + $public_status = intval($item->is_public) > 0 ? 1 : 0; + + $api_key = md5(rand()) . md5(rand()); + + $id = $this->tree_manager->new_node($tproject_id, + $this->node_types_descr_id['testplan'], $name); + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['testplans']} (id,notes,api_key,testproject_id,active,is_public) " . + " VALUES ( {$id} " . ", '" . $this->db->prepare_string($item->notes) . + "'," . "'" . $this->db->prepare_string($api_key) . "'," . + $tproject_id . "," . $active_status . "," . $public_status . ")"; + $result = $this->db->exec_query($sql); + return $result ? $id : 0; + } + + /** + */ + public function updateFromObject($item, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $my['opt'] = array( + 'doChecks' => false, + 'setSessionProject' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if (! property_exists($item, 'id')) { + throw new Exception('Test plan ID is missing'); + } + + if (($safeID = intval($item->id)) == 0) { + throw new Exception('Test plan ID 0 is not allowed'); + } + + $pinfo = $this->get_by_id($safeID, array( + 'output' => 'minimun' + )); + if (is_null($pinfo)) { + throw new Exception('Test plan ID does not exist'); + } + + $upd = ''; + try { + if (property_exists($item, 'name')) { + $name = trim($item->name); + if (strlen($name) == 0) { + throw new Exception('Empty name is not allowed'); + } + + // 1. NO other test plan on test project with same name + $op = $this->checkNameExistence($name, $pinfo['testproject_id'], + $safeID); + if (! $op['status_ok']) { + throw new Exception( + 'Test plan name is already in use on Test project'); + } + + $sql = "/* $debugMsg */ " . + " UPDATE {$this->tables['nodes_hierarchy']} " . " SET name='" . + $this->db->prepare_string($name) . "'" . + " WHERE id={$safeID}"; + $this->db->exec_query($sql); + } + + if (property_exists($item, 'notes')) { + $upd .= ($upd != '' ? ',' : '') . " notes = '" . + $this->db->prepare_string($item->notes) . "' "; + } + + $intAttr = array( + 'active', + 'is_public' + ); + foreach ($intAttr as $key) { + if (property_exists($item, $key)) { + $upd .= ($upd != '' ? ',' : '') . $key . ' = ' . + (intval($item->$key) > 0 ? 1 : 0); + } + } + + if ($upd != '') { + $sql = " UPDATE {$this->tables['testplans']} " . + " SET {$upd} WHERE id=" . $safeID; + $this->db->exec_query($sql); + } + } catch (Exception $e) { + throw $e; // rethrow + } + return $safeID; + } + + /** + * Checks is there is another test plan inside test project + * with different id but same name + */ + private function checkNameExistence($name, $tprojectID, $id = 0) + { + $check_op['msg'] = ''; + $check_op['status_ok'] = 1; + + if ($this->get_by_name($name, intval($tprojectID), + array( + 'id' => intval($id) + ))) { + $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'), + $name); + $check_op['status_ok'] = 0; + } + return $check_op; + } + + /** + * update testplan information + * + * @param integer $id + * Test plan identifier + * @param string $name: + * testplan name + * @param string $notes: + * testplan notes + * @param boolean $is_active + * + * @return integer result code (1=ok) + */ + public function update($id, $name, $notes, $is_active = null, + $is_public = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $do_update = 1; + $result = null; + $name = trim($name); + + // two tables to update and we have no transaction yet. + $rsa = $this->get_by_id($id); + $duplicate_check = (strcmp($rsa['name'], $name) != 0); + + if ($duplicate_check) { + $rs = $this->get_by_name($name, $rsa['parent_id']); + $do_update = is_null($rs); + } + + if ($do_update) { + // Update name + $sql = "/* $debugMsg */ "; + $sql .= "UPDATE {$this->tables['nodes_hierarchy']} " . "SET name='" . + $this->db->prepare_string($name) . "'" . "WHERE id={$id}"; + $result = $this->db->exec_query($sql); + + if ($result) { + $add_upd = ''; + if (! is_null($is_active)) { + $add_upd .= ',active=' . (intval($is_active) > 0 ? 1 : 0); + } + if (! is_null($is_public)) { + $add_upd .= ',is_public=' . (intval($is_public) > 0 ? 1 : 0); + } + + $sql = " UPDATE {$this->tables['testplans']} " . " SET notes='" . + $this->db->prepare_string($notes) . "' " . + " {$add_upd} WHERE id=" . $id; + $result = $this->db->exec_query($sql); + } + } + return $result ? 1 : 0; + } + + /* + * function: get_by_name + * get information about a testplan using name as access key. + * Search can be narrowed, givin a testproject id as filter criteria. + * + * args: name: testplan name + * [tproject_id]: default:0 -> system wide search i.e. inside all testprojects + * + * returns: if nothing found -> null + * if found -> array where every element is a map with following keys: + * id: testplan id + * notes: + * active: active status + * is_open: open status + * name: testplan name + * testproject_id + */ + public function get_by_name($name, $tproject_id = 0, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $my = array(); + $my['opt'] = array( + 'output' => 'full', + 'id' => 0 + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "/* $debugMsg */ "; + + switch ($my['opt']['output']) { + case 'minimun': + $sql .= " SELECT testplans.id, NH.name "; + break; + + case 'full': + default: + $sql .= " SELECT testplans.*, NH.name "; + break; + } + + $sql .= " FROM {$this->tables['testplans']} testplans, " . + " {$this->tables['nodes_hierarchy']} NH" . + " WHERE testplans.id = NH.id " . " AND NH.name = '" . + $this->db->prepare_string($name) . "'"; + + if (($safe_id = intval($tproject_id)) > 0) { + $sql .= " AND NH.parent_id={$safe_id} "; + } + + // useful when trying to check for duplicates ? + if (($my['opt']['id'] = intval($my['opt']['id'])) > 0) { + $sql .= " AND testplans.id != {$my['opt']['id']} "; + } + + return $this->db->get_recordset($sql); + } + + /* + * function: get_by_id + * + * args : id: testplan id + * + * returns: map with following keys: + * id: testplan id + * name: testplan name + * notes: testplan notes + * testproject_id + * active + * is_open + * parent_id + */ + public function get_by_id($id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array(); + $my['opt'] = array( + 'output' => 'full', + 'active' => null, + 'testPlanFields' => '' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $safe_id = intval($id); + switch ($my['opt']['output']) { + case 'testPlanFields': + $sql = "/* $debugMsg */ " . + " SELECT {$my['opt']['testPlanFields']} FROM {$this->tables['testplans']} " . + " WHERE id = " . $safe_id; + break; + + case 'minimun': + $sql = "/* $debugMsg */ " . " SELECT NH_TPLAN.name," . + " NH_TPROJ.id AS tproject_id, NH_TPROJ.name AS tproject_name,TPROJ.prefix" . + " FROM {$this->tables['nodes_hierarchy']} NH_TPLAN " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TPROJ ON NH_TPROJ.id = NH_TPLAN.parent_id " . + " JOIN {$this->tables['testprojects']} TPROJ ON TPROJ.ID = NH_TPROJ.id " . + " WHERE NH_TPLAN.id = " . $safe_id; + break; + + case 'full': + default: + $sql = "/* $debugMsg */ " . + " SELECT TPLAN.*,NH_TPLAN.name,NH_TPLAN.parent_id, + NH_TPROJ.id AS tproject_id, + NH_TPROJ.name AS tproject_name,TPROJ.prefix + FROM {$this->tables['testplans']} TPLAN, {$this->tables['nodes_hierarchy']} NH_TPLAN - JOIN {$this->tables['nodes_hierarchy']} NH_TPROJ - ON NH_TPROJ.id = NH_TPLAN.parent_id - JOIN {$this->tables['testprojects']} TPROJ - ON TPROJ.ID = NH_TPROJ.id - WHERE TPLAN.id = NH_TPLAN.id AND - TPLAN.id = " . $safe_id; - break; - } - - if(!is_null($my['opt']['active'])) { - $sql .= " AND active=" . (intval($my['opt']['active']) > 0 ? 1 : 0) . " "; - } - - $rs = $this->db->get_recordset($sql); - return ($rs ? $rs[0] : null); - } - - - /* - function: get_all - get array of info for every test plan, - without considering Test Project and any other kind of filter. - Every array element contains an assoc array - - args : - - - returns: array, every element is a map with following keys: - id: testplan id - name: testplan name - notes: testplan notes - testproject_id - active - is_open - parent_id - */ - function get_all() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . " SELECT testplans.*, NH.name " . - " FROM {$this->tables['testplans']} testplans, " . - " {$this->tables['nodes_hierarchy']} NH " . - " WHERE testplans.id=NH.id"; - $recordset = $this->db->get_recordset($sql); - return $recordset; - } - - /* - function: count_testcases - get number of testcases linked to a testplan - - args: id: testplan id, can be array of id, - - [platform_id]: null => do not filter by platform - can be array of platform id - - returns: number - */ - public function count_testcases($id,$platform_id=null,$opt=null) - { - // output: - // 'number', just the count - // 'groupByTestPlan' => map: key test plan id - // element: count - // - // 'groupByTestPlanPlatform' => map: first level key test plan id - // second level key platform id - // - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // protect yourself :) - 20140607 - if( is_null($id) || (is_int($id) && intval($id) <= 0 ) || (is_array($id) && count($id) == 0) ) - { - return 0; // >>>----> Bye - } - - - $my['opt'] = array('output' => 'number'); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql_filter = ''; - if( !is_null($platform_id) ) - { - $sql_filter = ' AND platform_id IN (' . implode(',',(array)$platform_id) . ')'; - } - - - - $out = null; - $outfields = "/* $debugMsg */ " . ' SELECT COUNT(testplan_id) AS qty '; - $dummy = " FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id IN (" . implode(',',(array)$id) . ") {$sql_filter}"; - - switch( $my['opt']['output'] ) - { - case 'groupByTestPlan': - $sql = $outfields . ', testplan_id' . $dummy . ' GROUP BY testplan_id '; - $out = $this->db->fetchRowsIntoMap($sql,'testplan_id'); - break; - - case 'groupByTestPlanPlatform': - $groupBy = ' GROUP BY testplan_id, platform_id '; - $sql = $outfields . ', testplan_id, platform_id' . $dummy . - ' GROUP BY testplan_id,platform_id '; - $out = $this->db->fetchMapsRowsIntoMap($sql,'testplan_id','platform_id'); - break; - - case 'number': - default: - $sql = $outfields . $dummy; - $rs = $this->db->get_recordset($sql); - - $out = 0; - if(!is_null($rs)) - { - $out = $rs[0]['qty']; - } - break; - } - - return $out; - } - - - - - /* - function: tcversionInfoForAudit - get info regarding tcversions, to generate useful audit messages - - - args : - $tplan_id: test plan id - $items_to_link: map key=tc_id - value: tcversion_id - returns: - - - rev: 20080629 - franciscom - audit message improvements - */ - function tcversionInfoForAudit($tplan_id,&$items) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // Get human readeable info for audit - $ret=array(); - // $tcase_cfg = config_get('testcase_cfg'); - $dummy=reset($items); - - list($ret['tcasePrefix'],$tproject_id) = $this->tcase_mgr->getPrefix($dummy); - $ret['tcasePrefix'] .= $this->tcaseCfg->glue_character; - - $sql = "/* $debugMsg */ " . - " SELECT TCV.id, tc_external_id, version, NHB.name " . - " FROM {$this->tables['tcversions']} TCV,{$this->tables['nodes_hierarchy']} NHA, " . - " {$this->tables['nodes_hierarchy']} NHB " . - " WHERE NHA.id=TCV.id " . - " AND NHB.id=NHA.parent_id " . - " AND TCV.id IN (" . implode(',',$items) . ")"; - - $ret['info']=$this->db->fetchRowsIntoMap($sql,'id'); - $ret['tplanInfo']=$this->get_by_id($tplan_id); - - return $ret; - } - - - /** - * associates version of different test cases to a test plan. - * this is the way to populate a test plan - - args : - $id: test plan id - $items_to_link: map key=tc_id - value= map with - key: platform_id (can be 0) - value: tcversion_id - passed by reference for speed - returns: - - - rev: 20080629 - franciscom - audit message improvements - */ - function link_tcversions($id,&$items_to_link,$userId) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // Get human readeable info for audit - $title_separator = config_get('gui_title_separator_1'); - $auditInfo=$this->tcversionInfoForAudit($id,$items_to_link['tcversion']); - - $optLTT = null; - $platformInfo = $this->platform_mgr->getLinkedToTestplanAsMap($id,$optLTT); - $platformLabel = lang_get('platform'); - - // Important: MySQL do not support default values on datetime columns that are functions - // that's why we are using db_now(). - $sql = "/* $debugMsg */ " . - "INSERT INTO {$this->tables['testplan_tcversions']} " . - "(testplan_id,author_id,creation_ts,tcversion_id,platform_id) " . - " VALUES ({$id},{$userId},{$this->db->db_now()},"; - $features=null; - foreach($items_to_link['items'] as $tcase_id => $items) - { - foreach($items as $platform_id => $tcversion) - { - $addInfo=''; - $result = $this->db->exec_query($sql . "{$tcversion}, {$platform_id})"); - if ($result) - { - $features[$platform_id][$tcversion]=$this->db->insert_id($this->tables['testplan_tcversions']); - if( isset($platformInfo[$platform_id]) ) - { - $addInfo = ' - ' . $platformLabel . ':' . $platformInfo[$platform_id]; - } - $auditMsg=TLS("audit_tc_added_to_testplan", - $auditInfo['tcasePrefix'] . $auditInfo['info'][$tcversion]['tc_external_id'] . - $title_separator . $auditInfo['info'][$tcversion]['name'], - $auditInfo['info'][$tcversion]['version'], - $auditInfo['tplanInfo']['name'] . $addInfo ); - - logAuditEvent($auditMsg,"ASSIGN",$id,"testplans"); - } - } - } - return $features; - } - - - /* - function: setExecutionOrder - - args : - $id: test plan id - $executionOrder: assoc array key=tcversion_id value=order - passed by reference for speed - - returns: - - */ - function setExecutionOrder($id,&$executionOrder) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - foreach($executionOrder as $tcVersionID => $execOrder) - { - $execOrder=intval($execOrder); - $sql="/* $debugMsg */ UPDATE {$this->tables['testplan_tcversions']} " . - "SET node_order={$execOrder} " . - "WHERE testplan_id={$id} " . - "AND tcversion_id={$tcVersionID}"; - $result = $this->db->exec_query($sql); - } - } - - - /** - * Ignores Platforms, then if a test case version is linked to a test plan - * and two platforms, we will get item once. - * Need to understand if in context where we want to use this method this is - * a problem - * - * - * @internal revisions: - */ - function get_linked_items_id($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ ". - " SELECT DISTINCT parent_id FROM {$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . - " WHERE TPTCV.testplan_id = " . intval($id); - - $linked_items = $this->db->fetchRowsIntoMap($sql,'parent_id'); - return $linked_items; - } - - - /** - * @internal revisions - * - */ - function get_linked_tcvid($id,$platformID,$opt=null){ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $options = array('addEstimatedExecDuration' => false, - 'tcase_id' => 0); - $options = array_merge($options,(array)$opt); - - $addFields = ''; - $addSql = ''; - $addWhere = ''; - - if($options['addEstimatedExecDuration']) - { - $addFields = ',TCV.estimated_exec_duration '; - $addSql .= " JOIN {$this->tables['tcversions']} TCV ON TCV.id = tcversion_id "; - } - - if($options['tcase_id'] > 0) - { - $addFields = ', NHTCV.parent_id AS tcase_id '; - $addSql .= " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = tcversion_id "; - - $addWhere = ' AND NHTCV.parent_id = ' . - intval($options['tcase_id']); - } - - $sql = " /* $debugMsg */ " . - " SELECT tcversion_id {$addFields} " . - " FROM {$this->tables['testplan_tcversions']} " . - $addSql; - - $sql .= " WHERE testplan_id = " . intval($id) . - " AND platform_id = " . intval($platformID) . - $addWhere; - - $items = $this->db->fetchRowsIntoMap($sql,'tcversion_id'); - return $items; - } - - - /** - * - * - */ - function getLinkedCount($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ ". - " SELECT COUNT( DISTINCT(TPTCV.tcversion_id) ) AS qty " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " WHERE TPTCV.testplan_id = " . intval($id); - - $rs = $this->db->get_recordset($sql); - return $rs[0]['qty']; - } - - - - /** - * @internal revisions: - * - */ - function getFeatureID($id,$platformID,$tcversionID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ ". - " SELECT id FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id = " . intval($id) . - " AND tcversion_id = " . intval($tcversionID) . - " AND platform_id = " . intval($platformID) ; - - $linked_items = $this->db->fetchRowsIntoMap($sql,'id'); - return !is_null($linked_items) ? key($linked_items) : -1; - } - - - /** - * @internal revisions: - * - */ - function getRootTestSuites($id,$tproject_id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('opt' => array('output' => 'std')); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " /* $debugMsg */ ". - " SELECT DISTINCT NHTCASE.parent_id AS tsuite_id" . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.tcversion_id = NHTCV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCASE " . - " ON NHTCASE.id = NHTCV.parent_id " . - " WHERE TPTCV.testplan_id = {$id} "; - - $items = $this->db->fetchRowsIntoMap($sql,'tsuite_id',database::CUMULATIVE); - $xsql = " SELECT COALESCE(parent_id,0) AS parent_id,id,name" . - " FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id IN (" . implode(',',array_keys($items)) . ") AND parent_id IS NOT NULL"; - - unset($items); - $xmen = $this->db->fetchMapRowsIntoMap($xsql,'parent_id','id'); - $tlnodes = array(); - foreach($xmen as $parent_id => &$children) - { - if($parent_id == $tproject_id) - { - foreach($children as $item_id => &$elem) - { - $tlnodes[$item_id] = ''; - } - } - else - { - $paty = $this->tree_manager->get_path($parent_id); - if( !isset($tlnodes[$paty[0]['id']]) ) - { - $tlnodes[$paty[0]['id']] = ''; - } - unset($paty); - } - } - unset($xmen); - - // Now with node list get order - $xsql = " SELECT id,name,node_order " . - " FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id IN (" . implode(',',array_keys($tlnodes)) . ")" . - " ORDER BY node_order,name "; - $xmen = $this->db->fetchRowsIntoMap($xsql,'id'); - switch($my['opt']['output']) - { - case 'std': - foreach($xmen as $xid => $elem) - { - $xmen[$xid] = $elem['name']; - } - break; - } - unset($tlnodes); - return $xmen; - } - - - - - - - - /** - * - * - */ - function helper_keywords_sql($filter,$options=null) { - - $sql = array('filter' => '', 'join' => ''); - - if( is_array($filter) ) { - // 0 -> no keyword, remove - if( $filter[0] == 0 ) { - array_shift($filter); - } - - if(count($filter)) { - $sql['filter'] = " AND TK.keyword_id IN (" . implode(',',$filter) . ")"; - } - } - else if($filter > 0) { - $sql['filter'] = " AND TK.keyword_id = {$filter} "; - } - - if( $sql['filter'] != '' ) { - $sql['join'] = " JOIN {$this->tables['testcase_keywords']} TK - ON TK.tcversion_id = NH_TCV.id "; - } - - // mmm, here there is missing documentation - $ret = is_null($options) ? $sql : array($sql['join'],$sql['filter']); - return $ret; - } - - - /** - * - * - */ - function helper_urgency_sql($filter) - { - - $cfg = config_get("urgencyImportance"); - $sql = ''; - if ($filter == HIGH) - { - $sql .= " AND (urgency * importance) >= " . $cfg->threshold['high']; - } - else if($filter == LOW) - { - $sql .= " AND (urgency * importance) < " . $cfg->threshold['low']; - } - else - { - $sql .= " AND ( ((urgency * importance) >= " . $cfg->threshold['low'] . - " AND ((urgency * importance) < " . $cfg->threshold['high']."))) "; - } - - return $sql; - } - - - /** - * - * - */ - function helper_assigned_to_sql($filter,$opt,$build_id) - { - - $join = " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = " . $build_id . - " AND UA.type = {$this->execTaskCode} "; - - // Warning!!!: - // If special user id TL_USER_NOBODY is present in set of user id - // we will ignore any other user id present on set. - $ff = (array)$filter; - $sql = " UA.user_id "; - if( in_array(TL_USER_NOBODY,$ff) ) - { - $sql .= " IS NULL "; - $join = ' LEFT OUTER ' . $join; - } - else if( in_array(TL_USER_SOMEBODY,$ff) ) - { - $sql .= " IS NOT NULL "; - } - else - { - $sql_unassigned=""; - $sql = ''; - if( $opt['include_unassigned'] ) - { - $join = ' LEFT OUTER ' . $join; // 20130729 - - $sql = "("; - $sql_unassigned=" OR UA.user_id IS NULL)"; - } - $sql .= " UA.user_id IN (" . implode(",",$ff) . ") " . $sql_unassigned; - } - - return array($join, ' AND ' . $sql); - } - - - - - /** - * - * - */ - function helper_exec_status_filter($filter,$lastExecSql) - { - $notRunFilter = null; - $execFilter = ''; - - $notRunPresent = array_search($this->notRunStatusCode,$filter); - if($notRunPresent !== false) - { - $notRunFilter = " E.status IS NULL "; - unset($filter[$this->notRunStatusCode]); - } - - if(count($filter) > 0) - { - $dummy = " E.status IN ('" . implode("','",$filter) . "') "; - $execFilter = " ( {$dummy} {$lastExecSql} ) "; - } - - if( !is_null($notRunFilter) ) - { - if($execFilter != "") - { - $execFilter .= " OR "; - } - $execFilter .= $notRunFilter; - } - - if( $execFilter != "") - { - // Just add the AND - $execFilter = " AND ({$execFilter} )"; - } - return array($execFilter,$notRunFilter); - } - - /** - * - * - */ - function helper_bugs_sql($filter) - { - $sql = array('filter' => '', 'join' => ''); - $dummy = explode(',',$filter); - $items = null; - foreach($dummy as $v) - { - $x = trim($v); - if($x != '') - { - $items[] = $x; - } - } - if(!is_null($items)) - { - $sql['filter'] = " AND EB.bug_id IN ('" . implode("','",$items) . "')"; - $sql['join'] = " JOIN {$this->tables['execution_bugs']} EB ON EB.execution_id = E.id "; - } - return array($sql['join'],$sql['filter']); - } - - - - - /* - function: get_linked_and_newest_tcversions - returns for every test case in a test plan - the tc version linked and the newest available version - - args: id: testplan id - [tcase_id]: default null => all testcases linked to testplan - - returns: map key: testcase internal id - values: map with following keys: - - [name] - [tc_id] (internal id) - [tcversion_id] - [newest_tcversion_id] - [tc_external_id] - [version] (for humans) - [newest_version] (for humans) - - */ - function get_linked_and_newest_tcversions($id,$tcase_id=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $tc_id_filter = " "; - if (!is_null($tcase_id) ) - { - if( is_array($tcase_id) ) - { - // ??? implement as in ? - } - else if ($tcase_id > 0 ) - { - $tc_id_filter = " AND NHA.parent_id = {$tcase_id} "; - } - } - - // Peter Rooms found bug due to wrong SQL, accepted by MySQL but not by PostGres - // Missing column in GROUP BY Clause - - $sql = " /* $debugMsg */ SELECT MAX(NHB.id) AS newest_tcversion_id, " . - " NHA.parent_id AS tc_id, NHC.name, T.tcversion_id AS tcversion_id," . - " TCVA.tc_external_id AS tc_external_id, TCVA.version AS version " . - " FROM {$this->tables['nodes_hierarchy']} NHA " . - - // NHA - will contain ONLY nodes of type testcase_version that are LINKED to test plan - " JOIN {$this->tables['testplan_tcversions']} T ON NHA.id = T.tcversion_id " . - - // Get testcase_version data for LINKED VERSIONS - " JOIN {$this->tables['tcversions']} TCVA ON TCVA.id = T.tcversion_id" . - - // Work on Sibblings - Start - // NHB - Needed to get ALL testcase_version sibblings nodes - " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.parent_id = NHA.parent_id " . - - // Want only ACTIVE Sibblings - " JOIN {$this->tables['tcversions']} TCVB ON TCVB.id = NHB.id AND TCVB.active=1 " . - // Work on Sibblings - STOP - - // NHC will contain - nodes of type TESTCASE (parent of testcase versions we are working on) - // we use NHC to get testcase NAME ( testcase version nodes have EMPTY NAME) - " JOIN {$this->tables['nodes_hierarchy']} NHC ON NHC.id = NHA.parent_id " . - - // Want to get only testcase version with id (NHB.id) greater than linked one (NHA.id) - " WHERE T.testplan_id={$id} AND NHB.id > NHA.id" . $tc_id_filter . - " GROUP BY NHA.parent_id, NHC.name, T.tcversion_id, TCVA.tc_external_id, TCVA.version "; - - // BUGID 4682 - phidotnet - Newest version is smaller than Linked version - $sql2 = " SELECT SUBQ.name, SUBQ.newest_tcversion_id, SUBQ.tc_id, " . - " SUBQ.tcversion_id, SUBQ.version, SUBQ.tc_external_id, " . - " TCV.version AS newest_version " . - " FROM {$this->tables['tcversions']} TCV, ( $sql ) AS SUBQ " . - " WHERE SUBQ.newest_tcversion_id = TCV.id AND SUBQ.version < TCV.version " . - " ORDER BY SUBQ.tc_id "; - - return $this->db->fetchRowsIntoMap($sql2,'tc_id'); - } - - - /** - * Remove of records from user_assignments table - * @author franciscom - * - * @param integer $id : test plan id - * @param array $items: assoc array key=tc_id value=tcversion_id - * - */ - function unlink_tcversions($id,&$items) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($items)) { - return; - } - - // Get human readeable info for audit - $gui_cfg = config_get('gui'); - $title_separator = config_get('gui_title_separator_1'); - $auditInfo=$this->tcversionInfoForAudit($id,$items['tcversion']); - $platformInfo = $this->platform_mgr->getLinkedToTestplanAsMap($id); - $platformLabel = lang_get('platform'); - - $dummy = null; - foreach($items['items'] as $tcase_id => $elem) { - foreach($elem as $platform_id => $tcversion_id) { - $dummy[] = "(tcversion_id = {$tcversion_id} AND platform_id = {$platform_id})"; - } - } - $where_clause = implode(" OR ", $dummy); - - /* - * asimon - BUGID 3497 and hopefully also 3530 - * A very litte error, missing braces in the $where_clause, was causing this bug. - * When one set of testcases is linked to two testplans, this statement should check - * that the combination of testplan_id, tcversion_id and platform_id was the same, - * but instead it checked for either testplan_id OR tcversion_id and platform_id. - * So every linked testcase with fitting tcversion_id and platform_id without execution - * was deleted, regardless of testplan_id. - * Simply adding braces around the where clause solves this. - * So innstead of: - * SELECT id AS link_id FROM testplan_tcversions - * WHERE testplan_id=12 AND (tcversion_id = 5 AND platform_id = 0) - * OR (tcversion_id = 7 AND platform_id = 0) - * OR (tcversion_id = 9 AND platform_id = 0) - * OR (tcversion_id = 11 AND platform_id = 0) - * we need this: - * SELECT ... WHERE testplan_id=12 AND (... OR ...) - */ - $where_clause = " ( {$where_clause} ) "; - - // First get the executions id if any exist - $sql = " /* $debugMsg */ SELECT id AS execution_id + JOIN {$this->tables['nodes_hierarchy']} NH_TPROJ + ON NH_TPROJ.id = NH_TPLAN.parent_id + JOIN {$this->tables['testprojects']} TPROJ + ON TPROJ.ID = NH_TPROJ.id + WHERE TPLAN.id = NH_TPLAN.id AND + TPLAN.id = " . $safe_id; + break; + } + + if (! is_null($my['opt']['active'])) { + $sql .= " AND active=" . (intval($my['opt']['active']) > 0 ? 1 : 0) . + " "; + } + + $rs = $this->db->get_recordset($sql); + return $rs ? $rs[0] : null; + } + + /* + * function: get_all + * get array of info for every test plan, + * without considering Test Project and any other kind of filter. + * Every array element contains an assoc array + * + * args : - + * + * returns: array, every element is a map with following keys: + * id: testplan id + * name: testplan name + * notes: testplan notes + * testproject_id + * active + * is_open + * parent_id + */ + private function getAll() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ " . " SELECT testplans.*, NH.name " . + " FROM {$this->tables['testplans']} testplans, " . + " {$this->tables['nodes_hierarchy']} NH " . + " WHERE testplans.id=NH.id"; + return $this->db->get_recordset($sql); + } + + /* + * function: count_testcases + * get number of testcases linked to a testplan + * + * args: id: testplan id, can be array of id, + * + * [platform_id]: null => do not filter by platform + * can be array of platform id + * + * returns: number + */ + public function count_testcases($id, $platform_id = null, $opt = null) + { + // output: + // 'number', just the count + // 'groupByTestPlan' => map: key test plan id + // element: count + // + // 'groupByTestPlanPlatform' => map: first level key test plan id + // second level key platform id + // + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + // protect yourself :) - 20140607 + if (is_null($id) || (is_int($id) && intval($id) <= 0) || + (is_array($id) && count($id) == 0)) { + return 0; // >>>----> Bye + } + + $my['opt'] = array( + 'output' => 'number' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql_filter = ''; + if (! is_null($platform_id)) { + $sql_filter = ' AND platform_id IN (' . + implode(',', (array) $platform_id) . ')'; + } + + $out = null; + $outfields = "/* $debugMsg */ " . ' SELECT COUNT(testplan_id) AS qty '; + $dummy = " FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id IN (" . implode(',', (array) $id) . + ") {$sql_filter}"; + + switch ($my['opt']['output']) { + case 'groupByTestPlan': + $sql = $outfields . ', testplan_id' . $dummy . + ' GROUP BY testplan_id '; + $out = $this->db->fetchRowsIntoMap($sql, 'testplan_id'); + break; + + case 'groupByTestPlanPlatform': + $sql = $outfields . ', testplan_id, platform_id' . $dummy . + ' GROUP BY testplan_id,platform_id '; + $out = $this->db->fetchMapsRowsIntoMap($sql, 'testplan_id', + 'platform_id'); + break; + + case 'number': + default: + $sql = $outfields . $dummy; + $rs = $this->db->get_recordset($sql); + + $out = 0; + if (! is_null($rs)) { + $out = $rs[0]['qty']; + } + break; + } + + return $out; + } + + /* + * function: tcversionInfoForAudit + * get info regarding tcversions, to generate useful audit messages + * + * + * args : + * $tplan_id: test plan id + * $items_to_link: map key=tc_id + * value: tcversion_id + * returns: - + * + * rev: 20080629 - franciscom - audit message improvements + */ + private function tcversionInfoForAudit($tplan_id, &$items) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + // Get human readeable info for audit + $ret = array(); + $dummy = reset($items); + + list ($ret['tcasePrefix'],) = $this->tcaseMgr->getPrefix($dummy); + $ret['tcasePrefix'] .= $this->tcaseCfg->glue_character; + + $sql = "/* $debugMsg */ " . + " SELECT TCV.id, tc_external_id, version, NHB.name " . + " FROM {$this->tables['tcversions']} TCV,{$this->tables['nodes_hierarchy']} NHA, " . + " {$this->tables['nodes_hierarchy']} NHB " . " WHERE NHA.id=TCV.id " . + " AND NHB.id=NHA.parent_id " . " AND TCV.id IN (" . + implode(',', $items) . ")"; + + $ret['info'] = $this->db->fetchRowsIntoMap($sql, 'id'); + $ret['tplanInfo'] = $this->get_by_id($tplan_id); + + return $ret; + } + + /** + * associates version of different test cases to a test plan. + * this is the way to populate a test plan + * + * args : + * $id: test plan id + * $items_to_link: map key=tc_id + * value= map with + * key: platform_id (can be 0) + * value: tcversion_id + * passed by reference for speed + * returns: - + * + * rev: 20080629 - franciscom - audit message improvements + */ + public function link_tcversions($id, &$items_to_link, $userId) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + // Get human readeable info for audit + $title_separator = config_get('gui_title_separator_1'); + $auditInfo = $this->tcversionInfoForAudit($id, + $items_to_link['tcversion']); + + $optLTT = null; + $platformInfo = $this->platform_mgr->getLinkedToTestplanAsMap($id, + $optLTT); + $platformLabel = lang_get('platform'); + + // Important: MySQL do not support default values on datetime columns that are functions + // that's why we are using db_now(). + $sql = "/* $debugMsg */ " . + "INSERT INTO {$this->tables['testplan_tcversions']} " . + "(testplan_id,author_id,creation_ts,tcversion_id,platform_id) " . + " VALUES ({$id},{$userId},{$this->db->db_now()},"; + $features = null; + foreach ($items_to_link['items'] as $items) { + foreach ($items as $platform_id => $tcversion) { + $addInfo = ''; + $result = $this->db->exec_query( + $sql . "{$tcversion}, {$platform_id})"); + if ($result) { + $features[$platform_id][$tcversion] = $this->db->insert_id( + $this->tables['testplan_tcversions']); + if (isset($platformInfo[$platform_id])) { + $addInfo = ' - ' . $platformLabel . ':' . + $platformInfo[$platform_id]; + } + $auditMsg = TLS("audit_tc_added_to_testplan", + $auditInfo['tcasePrefix'] . + $auditInfo['info'][$tcversion]['tc_external_id'] . + $title_separator . $auditInfo['info'][$tcversion]['name'], + $auditInfo['info'][$tcversion]['version'], + $auditInfo['tplanInfo']['name'] . $addInfo); + + logAuditEvent($auditMsg, "ASSIGN", $id, "testplans"); + } + } + } + return $features; + } + + /* + * function: setExecutionOrder + * + * args : + * $id: test plan id + * $executionOrder: assoc array key=tcversion_id value=order + * passed by reference for speed + * + * returns: - + */ + public function setExecutionOrder($id, &$executionOrder) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + foreach ($executionOrder as $tcVersionID => $execOrder) { + $execOrder = intval($execOrder); + $sql = "/* $debugMsg */ UPDATE {$this->tables['testplan_tcversions']} " . + "SET node_order={$execOrder} " . "WHERE testplan_id={$id} " . + "AND tcversion_id={$tcVersionID}"; + $this->db->exec_query($sql); + } + } + + /** + * Ignores Platforms, then if a test case version is linked to a test plan + * and two platforms, we will get item once. + * Need to understand if in context where we want to use this method this is + * a problem + * + * @internal revisions: + */ + public function get_linked_items_id($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT parent_id FROM {$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . + " WHERE TPTCV.testplan_id = " . intval($id); + + return $this->db->fetchRowsIntoMap($sql, 'parent_id'); + } + + /** + * + * @internal revisions + * + */ + public function get_linked_tcvid($id, $platformID, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $options = array( + 'addEstimatedExecDuration' => false, + 'tcase_id' => 0 + ); + $options = array_merge($options, (array) $opt); + + $addFields = ''; + $addSql = ''; + $addWhere = ''; + + if ($options['addEstimatedExecDuration']) { + $addFields = ',TCV.estimated_exec_duration '; + $addSql .= " JOIN {$this->tables['tcversions']} TCV ON TCV.id = tcversion_id "; + } + + if ($options['tcase_id'] > 0) { + $addFields = ', NHTCV.parent_id AS tcase_id '; + $addSql .= " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = tcversion_id "; + + $addWhere = ' AND NHTCV.parent_id = ' . intval($options['tcase_id']); + } + + $sql = " /* $debugMsg */ " . " SELECT tcversion_id {$addFields} " . + " FROM {$this->tables['testplan_tcversions']} " . $addSql; + + $sql .= " WHERE testplan_id = " . intval($id) . " AND platform_id = " . + intval($platformID) . $addWhere; + + return $this->db->fetchRowsIntoMap($sql, 'tcversion_id'); + } + + /** + */ + public function getLinkedCount($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ " . + " SELECT COUNT( DISTINCT(TPTCV.tcversion_id) ) AS qty " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " WHERE TPTCV.testplan_id = " . intval($id); + + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + /** + * + * @internal revisions: + * + */ + public function getFeatureID($id, $platformID, $tcversionID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ " . + " SELECT id FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id = " . intval($id) . " AND tcversion_id = " . + intval($tcversionID) . " AND platform_id = " . intval($platformID); + + $linked_items = $this->db->fetchRowsIntoMap($sql, 'id'); + return ! is_null($linked_items) ? key($linked_items) : - 1; + } + + /** + * + * @internal revisions: + * + */ + public function getRootTestSuites($id, $tproject_id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'opt' => array( + 'output' => 'std' + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCASE.parent_id AS tsuite_id" . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.tcversion_id = NHTCV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCASE " . + " ON NHTCASE.id = NHTCV.parent_id " . + " WHERE TPTCV.testplan_id = {$id} "; + + $items = $this->db->fetchRowsIntoMap($sql, 'tsuite_id', + database::CUMULATIVE); + $xsql = " SELECT COALESCE(parent_id,0) AS parent_id,id,name" . + " FROM {$this->tables['nodes_hierarchy']} " . " WHERE id IN (" . + implode(',', array_keys($items)) . ") AND parent_id IS NOT NULL"; + + unset($items); + $xmen = $this->db->fetchMapRowsIntoMap($xsql, 'parent_id', 'id'); + $tlnodes = array(); + foreach ($xmen as $parent_id => &$children) { + if ($parent_id == $tproject_id) { + foreach ($children as $item_id => &$elem) { + $tlnodes[$item_id] = ''; + } + } else { + $paty = $this->tree_manager->get_path($parent_id); + if (! isset($tlnodes[$paty[0]['id']])) { + $tlnodes[$paty[0]['id']] = ''; + } + unset($paty); + } + } + unset($xmen); + + // Now with node list get order + $xsql = " SELECT id,name,node_order " . + " FROM {$this->tables['nodes_hierarchy']} " . " WHERE id IN (" . + implode(',', array_keys($tlnodes)) . ")" . + " ORDER BY node_order,name "; + $xmen = $this->db->fetchRowsIntoMap($xsql, 'id'); + switch ($my['opt']['output']) { + case 'std': + foreach ($xmen as $xid => $elem) { + $xmen[$xid] = $elem['name']; + } + break; + } + unset($tlnodes); + return $xmen; + } + + /** + */ + protected function helper_keywords_sql($filter, $options = null) + { + $sql = array( + 'filter' => '', + 'join' => '' + ); + + if (is_array($filter)) { + // 0 -> no keyword, remove + if ($filter[0] == 0) { + array_shift($filter); + } + + if (count($filter)) { + $sql['filter'] = " AND TK.keyword_id IN (" . + implode(',', $filter) . ")"; + } + } elseif ($filter > 0) { + $sql['filter'] = " AND TK.keyword_id = {$filter} "; + } + + if ($sql['filter'] != '') { + $sql['join'] = " JOIN {$this->tables['testcase_keywords']} TK + ON TK.tcversion_id = NH_TCV.id "; + } + + // mmm, here there is missing documentation + return is_null($options) ? $sql : array( + $sql['join'], + $sql['filter'] + ); + } + + /** + */ + private function helperUrgencySQL($filter) + { + $cfg = config_get("urgencyImportance"); + $sql = ''; + if ($filter == HIGH) { + $sql .= " AND (urgency * importance) >= " . $cfg->threshold['high']; + } elseif ($filter == LOW) { + $sql .= " AND (urgency * importance) < " . $cfg->threshold['low']; + } else { + $sql .= " AND ( ((urgency * importance) >= " . $cfg->threshold['low'] . + " AND ((urgency * importance) < " . $cfg->threshold['high'] . + "))) "; + } + + return $sql; + } + + /** + */ + private function helperAssignedToSQL($filter, $opt, $build_id) + { + $join = " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . " AND UA.build_id = " . $build_id . + " AND UA.type = {$this->execTaskCode} "; + + // Warning!!!: + // If special user id TL_USER_NOBODY is present in set of user id + // we will ignore any other user id present on set. + $ff = (array) $filter; + $sql = " UA.user_id "; + if (in_array(TL_USER_NOBODY, $ff)) { + $sql .= " IS NULL "; + $join = ' LEFT OUTER ' . $join; + } elseif (in_array(TL_USER_SOMEBODY, $ff)) { + $sql .= " IS NOT NULL "; + } else { + $sql_unassigned = ""; + $sql = ''; + if ($opt['include_unassigned']) { + $join = ' LEFT OUTER ' . $join; // 20130729 + + $sql = "("; + $sql_unassigned = " OR UA.user_id IS NULL)"; + } + $sql .= " UA.user_id IN (" . implode(",", $ff) . ") " . + $sql_unassigned; + } + + return array( + $join, + ' AND ' . $sql + ); + } + + /** + */ + private function helperExecStatusFilter($filter, $lastExecSql) + { + $notRunFilter = null; + $execFilter = ''; + + $notRunPresent = array_search($this->notRunStatusCode, $filter); + if ($notRunPresent !== false) { + $notRunFilter = " E.status IS NULL "; + unset($filter[$this->notRunStatusCode]); + } + + if (! empty($filter)) { + $dummy = " E.status IN ('" . implode("','", $filter) . "') "; + $execFilter = " ( {$dummy} {$lastExecSql} ) "; + } + + if (! is_null($notRunFilter)) { + if ($execFilter != "") { + $execFilter .= " OR "; + } + $execFilter .= $notRunFilter; + } + + if ($execFilter != "") { + // Just add the AND + $execFilter = " AND ({$execFilter} )"; + } + return array( + $execFilter, + $notRunFilter + ); + } + + /** + */ + private function helperBugsSQL($filter) + { + $sql = array( + 'filter' => '', + 'join' => '' + ); + $dummy = explode(',', $filter); + $items = null; + foreach ($dummy as $v) { + $x = trim($v); + if ($x != '') { + $items[] = $x; + } + } + if (! is_null($items)) { + $sql['filter'] = " AND EB.bug_id IN ('" . implode("','", $items) . + "')"; + $sql['join'] = " JOIN {$this->tables['execution_bugs']} EB ON EB.execution_id = E.id "; + } + return array( + $sql['join'], + $sql['filter'] + ); + } + + /* + * function: get_linked_and_newest_tcversions + * returns for every test case in a test plan + * the tc version linked and the newest available version + * + * args: id: testplan id + * [tcase_id]: default null => all testcases linked to testplan + * + * returns: map key: testcase internal id + * values: map with following keys: + * + * [name] + * [tc_id] (internal id) + * [tcversion_id] + * [newest_tcversion_id] + * [tc_external_id] + * [version] (for humans) + * [newest_version] (for humans) + * + */ + public function get_linked_and_newest_tcversions($id, $tcase_id = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $tc_id_filter = " "; + if (! is_null($tcase_id) && $tcase_id > 0) { + $tc_id_filter = " AND NHA.parent_id = {$tcase_id} "; + } + + // Peter Rooms found bug due to wrong SQL, accepted by MySQL but not by PostGres + // Missing column in GROUP BY Clause + + $sql = " /* $debugMsg */ SELECT MAX(NHB.id) AS newest_tcversion_id, " . + " NHA.parent_id AS tc_id, NHC.name, T.tcversion_id AS tcversion_id," . + " TCVA.tc_external_id AS tc_external_id, TCVA.version AS version " . + " FROM {$this->tables['nodes_hierarchy']} NHA " . + + // NHA - will contain ONLY nodes of type testcase_version that are LINKED to test plan + " JOIN {$this->tables['testplan_tcversions']} T ON NHA.id = T.tcversion_id " . + + // Get testcase_version data for LINKED VERSIONS + " JOIN {$this->tables['tcversions']} TCVA ON TCVA.id = T.tcversion_id" . + + // Work on Sibblings - Start + // NHB - Needed to get ALL testcase_version sibblings nodes + " JOIN {$this->tables['nodes_hierarchy']} NHB ON NHB.parent_id = NHA.parent_id " . + + // Want only ACTIVE Sibblings + " JOIN {$this->tables['tcversions']} TCVB ON TCVB.id = NHB.id AND TCVB.active=1 " . + // Work on Sibblings - STOP + + // NHC will contain - nodes of type TESTCASE (parent of testcase versions we are working on) + // we use NHC to get testcase NAME ( testcase version nodes have EMPTY NAME) + " JOIN {$this->tables['nodes_hierarchy']} NHC ON NHC.id = NHA.parent_id " . + + // Want to get only testcase version with id (NHB.id) greater than linked one (NHA.id) + " WHERE T.testplan_id={$id} AND NHB.id > NHA.id" . $tc_id_filter . + " GROUP BY NHA.parent_id, NHC.name, T.tcversion_id, TCVA.tc_external_id, TCVA.version "; + + // BUGID 4682 - phidotnet - Newest version is smaller than Linked version + $sql2 = " SELECT SUBQ.name, SUBQ.newest_tcversion_id, SUBQ.tc_id, " . + " SUBQ.tcversion_id, SUBQ.version, SUBQ.tc_external_id, " . + " TCV.version AS newest_version " . + " FROM {$this->tables['tcversions']} TCV, ( $sql ) AS SUBQ " . + " WHERE SUBQ.newest_tcversion_id = TCV.id AND SUBQ.version < TCV.version " . + " ORDER BY SUBQ.tc_id "; + + return $this->db->fetchRowsIntoMap($sql2, 'tc_id'); + } + + /** + * Remove of records from user_assignments table + * + * @author franciscom + * + * @param integer $id + * : test plan id + * @param array $items: + * assoc array key=tc_id value=tcversion_id + * + */ + public function unlink_tcversions($id, &$items) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($items)) { + return; + } + + // Get human readeable info for audit + config_get('gui'); + $title_separator = config_get('gui_title_separator_1'); + $auditInfo = $this->tcversionInfoForAudit($id, $items['tcversion']); + $platformInfo = $this->platform_mgr->getLinkedToTestplanAsMap($id); + $platformLabel = lang_get('platform'); + + $dummy = null; + foreach ($items['items'] as $tcase_id => $elem) { + foreach ($elem as $platform_id => $tcversion_id) { + $dummy[] = "(tcversion_id = {$tcversion_id} AND platform_id = {$platform_id})"; + } + } + $where_clause = implode(" OR ", $dummy); + + /* + * asimon - BUGID 3497 and hopefully also 3530 + * A very litte error, missing braces in the $where_clause, was causing this bug. + * When one set of testcases is linked to two testplans, this statement should check + * that the combination of testplan_id, tcversion_id and platform_id was the same, + * but instead it checked for either testplan_id OR tcversion_id and platform_id. + * So every linked testcase with fitting tcversion_id and platform_id without execution + * was deleted, regardless of testplan_id. + * Simply adding braces around the where clause solves this. + * So innstead of: + * SELECT id AS link_id FROM testplan_tcversions + * WHERE testplan_id=12 AND (tcversion_id = 5 AND platform_id = 0) + * OR (tcversion_id = 7 AND platform_id = 0) + * OR (tcversion_id = 9 AND platform_id = 0) + * OR (tcversion_id = 11 AND platform_id = 0) + * we need this: + * SELECT ... WHERE testplan_id=12 AND (... OR ...) + */ + $where_clause = " ( {$where_clause} ) "; + + // First get the executions id if any exist + $sql = " /* $debugMsg */ SELECT id AS execution_id FROM {$this->tables['executions']} - WHERE testplan_id = {$id} AND ${where_clause}"; - - $exec_ids = $this->db->fetchRowsIntoMap($sql,'execution_id'); - - if( !is_null($exec_ids) and count($exec_ids) > 0 ) { - // has executions - $exec_ids = array_keys($exec_ids); - $exec_id_list = implode(",",$exec_ids); - $exec_id_where= " WHERE execution_id IN ($exec_id_list)"; - - // Remove bugs if any exist - // This will remove the bug @step level if any exists. - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['execution_bugs']} - {$exec_id_where} "; - $result = $this->db->exec_query($sql); - - // Remove CF exec values - $sql = " /* $debugMsg */ - DELETE FROM {$this->tables['cfield_execution_values']} - {$exec_id_where} "; - $result = $this->db->exec_query($sql); - - // execution attachments - $dummy = " /* $debugMsg */ SELECT id FROM {$this->tables['attachments']} + WHERE testplan_id = {$id} AND ${where_clause}"; + + $exec_ids = $this->db->fetchRowsIntoMap($sql, 'execution_id'); + + if (! empty($exec_ids)) { + // has executions + $exec_ids = array_keys($exec_ids); + $exec_id_list = implode(",", $exec_ids); + $exec_id_where = " WHERE execution_id IN ($exec_id_list)"; + + // Remove bugs if any exist + // This will remove the bug @step level if any exists. + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['execution_bugs']} + {$exec_id_where} "; + $this->db->exec_query($sql); + + // Remove CF exec values + $sql = " /* $debugMsg */ + DELETE FROM {$this->tables['cfield_execution_values']} + {$exec_id_where} "; + $this->db->exec_query($sql); + + // execution attachments + $dummy = " /* $debugMsg */ SELECT id FROM {$this->tables['attachments']} WHERE fk_table = 'executions' - AND fk_id IN ({$exec_id_list}) "; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - - // Work on Execution on Test Case Steps - // Attachments - $dummy = " /* $debugMsg */ SELECT id FROM {$this->tables['attachments']} - WHERE fk_table = 'execution_tcsteps' + AND fk_id IN ({$exec_id_list}) "; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // Work on Execution on Test Case Steps + // Attachments + $dummy = " /* $debugMsg */ SELECT id FROM {$this->tables['attachments']} + WHERE fk_table = 'execution_tcsteps' AND fk_id IN ( SELECT id FROM {$this->tables['execution_tcsteps']} - {$exec_id_where} )"; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - // Remove test case STEP executions if any exists - // execution_id is an attribute. - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['execution_tcsteps']} - {$exec_id_where} "; - $result = $this->db->exec_query($sql); - - - // Grand Finale now remove executions - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['executions']} - WHERE testplan_id = {$id} AND ${where_clause}"; - $result = $this->db->exec_query($sql); - } - - // ---------------------------------------------------------------- - // to remove the assignment to users (if any exists) we need the list of id - $sql=" SELECT id AS link_id FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id={$id} AND {$where_clause} "; - $link_ids = $this->db->fetchRowsIntoMap($sql,'link_id'); - $features = array_keys($link_ids); - if( count($features) == 1) { - $features=$features[0]; - } - $this->assignment_mgr->delete_by_feature_id($features); - // ---------------------------------------------------------------- - - // Delete from link table - $sql=" DELETE FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id={$id} AND {$where_clause} "; - $result = $this->db->exec_query($sql); - - foreach($items['items'] as $tcase_id => $elem) { - foreach($elem as $platform_id => $tcversion) { - $addInfo=''; - if( isset($platformInfo[$platform_id]) ) { - $addInfo = ' - ' . $platformLabel . ':' . $platformInfo[$platform_id]; - } - $auditMsg=TLS("audit_tc_removed_from_testplan", - $auditInfo['tcasePrefix'] . $auditInfo['info'][$tcversion]['tc_external_id'] . - $title_separator . $auditInfo['info'][$tcversion]['name'], - $auditInfo['info'][$tcversion]['version'], - $auditInfo['tplanInfo']['name'] . $addInfo ); - - logAuditEvent($auditMsg,"UNASSIGN",$id,"testplans"); - } - } - - } // end function unlink_tcversions - - - - /** - * - */ - function get_keywords_map($id,$order_by_clause='') { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $keywords = null; - - $sql = " /* $debugMsg */ "; - $sql .= " SELECT TCKW.keyword_id,KW.keyword " . - " FROM {$this->tables['keywords']} KW " . - " JOIN {$this->tables['testcase_keywords']} TCKW " . - " ON KW.id = TCKW.keyword_id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TCKW.tcversion_id = TPTCV.tcversion_id " . - " WHERE TPTCV.testplan_id = " . intval($id) . - $order_by_clause; - - $keywords = $this->db->fetchColumnsIntoMap($sql,'keyword_id','keyword'); - - return $keywords; - } - - - /** - * args : - * [$keyword_id]: can be an array - */ - function DEPRECATED_get_keywords_tcases($id,$keyword_id=0) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $CUMULATIVE=1; - $map_keywords=null; - - // keywords are associated to testcase id, then first - // we need to get the list of testcases linked to the testplan - $linked_items = $this->get_linked_items_id($id); - if( !is_null($linked_items) ) - { - $keyword_filter= '' ; - - if( is_array($keyword_id) ) - { - $keyword_filter = " AND keyword_id IN (" . implode(',',$keyword_id) . ")"; - } - else if( $keyword_id > 0 ) - { - $keyword_filter = " AND keyword_id = {$keyword_id} "; - } - - - $tc_id_list = implode(",",array_keys($linked_items)); - - // 20081116 - franciscom - - // Does DISTINCT is needed ? Humm now I think no. - $sql = "SELECT DISTINCT testcase_id,keyword_id,keyword + {$exec_id_where} )"; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // Remove test case STEP executions if any exists + // execution_id is an attribute. + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['execution_tcsteps']} + {$exec_id_where} "; + $this->db->exec_query($sql); + + // Grand Finale now remove executions + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['executions']} + WHERE testplan_id = {$id} AND ${where_clause}"; + $this->db->exec_query($sql); + } + + // to remove the assignment to users (if any exists) we need the list of id + $sql = " SELECT id AS link_id FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id={$id} AND {$where_clause} "; + $link_ids = $this->db->fetchRowsIntoMap($sql, 'link_id'); + $features = array_keys($link_ids); + if (count($features) == 1) { + $features = $features[0]; + } + $this->assignment_mgr->delete_by_feature_id($features); + + // Delete from link table + $sql = " DELETE FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id={$id} AND {$where_clause} "; + $this->db->exec_query($sql); + + foreach ($items['items'] as $elem) { + foreach ($elem as $platform_id => $tcversion) { + $addInfo = ''; + if (isset($platformInfo[$platform_id])) { + $addInfo = ' - ' . $platformLabel . ':' . + $platformInfo[$platform_id]; + } + $auditMsg = TLS("audit_tc_removed_from_testplan", + $auditInfo['tcasePrefix'] . + $auditInfo['info'][$tcversion]['tc_external_id'] . + $title_separator . $auditInfo['info'][$tcversion]['name'], + $auditInfo['info'][$tcversion]['version'], + $auditInfo['tplanInfo']['name'] . $addInfo); + + logAuditEvent($auditMsg, "UNASSIGN", $id, "testplans"); + } + } + } + + /** + */ + public function get_keywords_map($id, $order_by_clause = '') + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ "; + $sql .= " SELECT TCKW.keyword_id,KW.keyword " . + " FROM {$this->tables['keywords']} KW " . + " JOIN {$this->tables['testcase_keywords']} TCKW " . + " ON KW.id = TCKW.keyword_id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TCKW.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . intval($id) . $order_by_clause; + + return $this->db->fetchColumnsIntoMap($sql, 'keyword_id', 'keyword'); + } + + /** + * args : + * [$keyword_id]: can be an array + * + * @deprecated + */ + private function getKeywordsTestcases($id, $keyword_id = 0) + { + $cumulative = 1; + $map_keywords = null; + + // keywords are associated to testcase id, then first + // we need to get the list of testcases linked to the testplan + $linked_items = $this->get_linked_items_id($id); + if (! is_null($linked_items)) { + $keyword_filter = ''; + + if (is_array($keyword_id)) { + $keyword_filter = " AND keyword_id IN (" . + implode(',', $keyword_id) . ")"; + } elseif ($keyword_id > 0) { + $keyword_filter = " AND keyword_id = {$keyword_id} "; + } + + $tc_id_list = implode(",", array_keys($linked_items)); + + // 20081116 - franciscom - + // Does DISTINCT is needed ? Humm now I think no. + $sql = "SELECT DISTINCT testcase_id,keyword_id,keyword FROM {$this->tables['testcase_keywords']} testcase_keywords, {$this->tables['keywords']} keywords WHERE keyword_id = keywords.id AND testcase_id IN ( {$tc_id_list} ) {$keyword_filter} - ORDER BY keyword ASC "; - - // 20081116 - franciscom - // CUMULATIVE is needed to get all keywords assigned to each testcase linked to testplan - $map_keywords = $this->db->fetchRowsIntoMap($sql,'testcase_id',$CUMULATIVE); - } - - return ($map_keywords); - } // end function - - - - /** - * args : - * [$keyword_id]: can be an array - */ - function getKeywordsLinkedTCVersions($id,$keyword_id=0) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $keywords=null; - $safeID = intval($id); - - $kwFilter= '' ; - if( is_array($keyword_id) ) { - $kwFilter = " AND keyword_id IN (" . implode(',',$keyword_id) . ")"; - } - else if( $keyword_id > 0 ) { - $kwFilter = " AND keyword_id = {$keyword_id} "; - } - - $sql = " /* $debugMsg */ "; - $sql .= " SELECT TCKW.testcase_id,TCKW.keyword_id,KW.keyword " . - " FROM {$this->tables['keywords']} KW " . - " JOIN {$this->tables['testcase_keywords']} TCKW " . - " ON KW.id = TCKW.keyword_id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TCKW.tcversion_id = TPTCV.tcversion_id " . - " WHERE TPTCV.testplan_id = " . intval($id) . - " {$kwFilter} ORDER BY keyword ASC "; - - // CUMULATIVE is needed to get all keywords assigned - // to each testcase linked to testplan - $keywords = - $this->db->fetchRowsIntoMap($sql,'testcase_id',database::CUMULATIVE); - - return $keywords; - } // end function - - /** - * args : - * [$platform_id]: can be an array - */ - function getPlatformsLinkedTCVersions($id,$platform_id=0) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $platforms = null; - $safeID = intval($id); - - $platFilter= '' ; - if (is_array($platform_id) ) { - $platFilter = " AND platform_id IN (" . implode(',',$platform_id) . ")"; - } - else if( $platform_id > 0 ) { - $platFilter = " AND $platform_id = {$platform_id} "; - } - - $sql = " /* $debugMsg */ "; - $sql .= " SELECT TCPL.testcase_id,TCPL.platform_id,PL.name + ORDER BY keyword ASC "; + + // 20081116 - franciscom + // CUMULATIVE is needed to get all keywords assigned to each testcase linked to testplan + $map_keywords = $this->db->fetchRowsIntoMap($sql, 'testcase_id', + $cumulative); + } + + return $map_keywords; + } + + /** + * args : + * [$keyword_id]: can be an array + */ + public function getKeywordsLinkedTCVersions($id, $keyword_id = 0) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $kwFilter = ''; + if (is_array($keyword_id)) { + $kwFilter = " AND keyword_id IN (" . implode(',', $keyword_id) . ")"; + } elseif ($keyword_id > 0) { + $kwFilter = " AND keyword_id = {$keyword_id} "; + } + + $sql = " /* $debugMsg */ "; + $sql .= " SELECT TCKW.testcase_id,TCKW.keyword_id,KW.keyword " . + " FROM {$this->tables['keywords']} KW " . + " JOIN {$this->tables['testcase_keywords']} TCKW " . + " ON KW.id = TCKW.keyword_id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TCKW.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . intval($id) . + " {$kwFilter} ORDER BY keyword ASC "; + + // CUMULATIVE is needed to get all keywords assigned + // to each testcase linked to testplan + return $this->db->fetchRowsIntoMap($sql, 'testcase_id', + database::CUMULATIVE); + } + + /** + * args : + * [$platform_id]: can be an array + */ + public function getPlatformsLinkedTCVersions($id, $platform_id = 0) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $platFilter = ''; + if (is_array($platform_id)) { + $platFilter = " AND platform_id IN (" . implode(',', $platform_id) . + ")"; + } elseif ($platform_id > 0) { + $platFilter = " AND $platform_id = {$platform_id} "; + } + + $sql = " /* $debugMsg */ "; + $sql .= " SELECT TCPL.testcase_id,TCPL.platform_id,PL.name FROM {$this->tables['platforms']} PL JOIN {$this->tables['testcase_platforms']} TCPL ON PL.id = TCPL.platform_id JOIN {$this->tables['testplan_tcversions']} TPTCV ON TCPL.tcversion_id = TPTCV.tcversion_id - WHERE TPTCV.testplan_id = " . intval($id) . - " {$platFilter} ORDER BY name ASC "; - - // CUMULATIVE is needed to get all platforms assigned - // to each testcase linked to testplan - $platforms = - $this->db->fetchRowsIntoMap($sql,'testcase_id',database::CUMULATIVE); - - return $platforms; - } // end function - - - /* - function: copy_as - creates a new test plan using an existent one as source. - Note: copy_test_urgency is not appropriate to copy - - - args: id: source testplan id - new_tplan_id: destination - [tplan_name]: default null. - != null => set this as the new name - - [tproject_id]: default null. - != null => set this as the new testproject for the testplan - this allow us to copy testplans to differents test projects. - - [user_id] - [options]: default null - allowed keys: - items2copy: - null: do a deep copy => copy following test plan child elements: - builds,linked tcversions,milestones,user_roles,priorities, - platforms,execution assignment. - - != null, a map with keys that controls what child elements to copy - - copy_assigned_to: - tcversion_type: - null/'current' -> use same version present on source testplan - 'lastest' -> for every testcase linked to source testplan - use lastest available version - - [mappings]: need to be documented - returns: N/A - - - 20101114 - franciscom - Because user assignment is done at BUILD Level, we will force - BUILD COPY no matter user choice if user choose to copy - Test Case assignment. - - - */ - function copy_as($id,$new_tplan_id,$tplan_name=null,$tproject_id=null,$user_id=null, - $options=null,$mappings=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $cp_methods = array('copy_milestones' => 'copy_milestones', - 'copy_user_roles' => 'copy_user_roles', - 'copy_platforms_links' => 'copy_platforms_links', - 'copy_attachments' => 'copy_attachments'); - - $mapping_methods = array('copy_platforms_links' => 'platforms'); - - $my['options'] = array(); - - // Configure here only elements that has his own table. - $my['options']['items2copy']= array('copy_tcases' => 1,'copy_milestones' => 1, 'copy_user_roles' => 1, - 'copy_builds' => 1, 'copy_platforms_links' => 1, - 'copy_attachments' => 1, 'copy_priorities' => 1); - - $my['options']['copy_assigned_to'] = 0; - $my['options']['tcversion_type'] = null; - - $my['options'] = array_merge($my['options'], (array)$options); - - $safe['new_tplan_id'] = intval($new_tplan_id); - - // get source testplan general info - $rs_source=$this->get_by_id($id); - - if(!is_null($tplan_name)) - { - $sql="/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . - "SET name='" . $this->db->prepare_string(trim($tplan_name)) . "' " . - "WHERE id=" . $safe['new_tplan_id']; - $this->db->exec_query($sql); - } - - if(!is_null($tproject_id)) - { - $sql="/* $debugMsg */ UPDATE {$this->tables['testplans']} SET testproject_id={$tproject_id} " . - "WHERE id=" . $safe['new_tplan_id']; - $this->db->exec_query($sql); - } - - // copy builds and tcversions out of following loop, because of the user assignments per build - // special measures have to be taken - $build_id_mapping = null; - if($my['options']['items2copy']['copy_builds']) - { - $build_id_mapping = $this->copy_builds($id,$safe['new_tplan_id']); - } - - // Important Notice: - // Since the addition of Platforms, test case versions are linked to Test Plan AND Platforms - // this means, that not matter user choice, we will force Platforms COPY. - // This is a lazy approach, instead of complex one that requires understand what Platforms - // have been used on SOURCE Test Plan. - // - // copy test cases is an special copy - if( $my['options']['items2copy']['copy_tcases'] ) - { - $my['options']['items2copy']['copy_platforms_links'] = 1; - $this->copy_linked_tcversions($id,$new_tplan_id,$user_id,$my['options'],$mappings, $build_id_mapping); - } - - foreach( $my['options']['items2copy'] as $key => $do_copy ) - { - if( $do_copy ) - { - if( isset($cp_methods[$key]) ) - { - $copy_method=$cp_methods[$key]; - if( isset($mapping_methods[$key]) && isset($mappings[$mapping_methods[$key]])) - { - $this->$copy_method($id,$new_tplan_id,$mappings[$mapping_methods[$key]]); - } - else - { - $this->$copy_method($id,$new_tplan_id); - } - } - } - } - } // end function copy_as - - - - /** - * $id: source testplan id - * $new_tplan_id: destination - */ - private function copy_builds($id,$new_tplan_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs=$this->get_builds($id); - - $id_mapping = array(); - if(!is_null($rs)) - { - foreach($rs as $build) - { - $add2sql = ''; - $fields = 'name,notes,'; - if(strlen(trim($build['release_date'])) > 0) - { - $fields .= 'release_date,'; - $add2sql = "'" . $this->db->prepare_string($build['release_date']) . "',"; - } - $fields .= 'testplan_id'; - - $sql = " /* $debugMsg */ INSERT INTO {$this->tables['builds']} " . - " ({$fields}) " . - "VALUES ('" . $this->db->prepare_string($build['name']) ."'," . - "'" . $this->db->prepare_string($build['notes']) . "', {$add2sql} {$new_tplan_id})"; - - $this->db->exec_query($sql); - $new_id = $this->db->insert_id($this->tables['builds']); - $id_mapping[$build['id']] = $new_id; - } - } - return $id_mapping; - } - - - /* - function: copy_linked_tcversions - - args: id: source testplan id - new_tplan_id: destination - [options] - [tcversion_type]: default null -> use same version present on source testplan - 'lastest' -> for every testcase linked to source testplan - use lastest available version - [copy_assigned_to]: 1 -> copy execution assignments without role control - - [$mappings] useful when this method is called due to a Test Project COPY AS (yes PROJECT no PLAN) - - returns: - - Note: test urgency is set to default in the new Test plan (not copied) - - */ - private function copy_linked_tcversions($id,$new_tplan_id,$user_id=-1, $options=null,$mappings=null, $build_id_mapping=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options']['tcversion_type'] = null; - $my['options']['copy_assigned_to'] = 0; - $my['options'] = array_merge($my['options'], (array)$options); - $now_ts = $this->db->db_now(); - - $sql="/* $debugMsg */ "; - if($my['options']['copy_assigned_to']) - { - $sql .= " SELECT TPTCV.*, COALESCE(UA.user_id,-1) AS tester, " . - " COALESCE(UA.build_id,0) as assigned_build " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON " . - " UA.feature_id = TPTCV.id " . - " WHERE testplan_id={$id} "; - } - else - { - $sql .= " SELECT TPTCV.* FROM {$this->tables['testplan_tcversions']} TPTCV" . - " WHERE testplan_id={$id} "; - } - - $rs=$this->db->get_recordset($sql); - if(!is_null($rs)) - { - $tcase_mgr = new testcase($this->db); - $doMappings = !is_null($mappings); - $already_linked_versions = array(); - - foreach($rs as $elem) - { - $tcversion_id = $elem['tcversion_id']; - - // Seems useless - 20100204 - $feature_id = $elem['id']; - if( !is_null($my['options']['tcversion_type']) ) - { - $sql="/* $debugMsg */ SELECT * FROM {$this->tables['nodes_hierarchy']} WHERE id={$tcversion_id} "; - $rs2=$this->db->get_recordset($sql); - // Ticket 4696 - if tcversion_type is set to latest -> update linked version - if ($my['options']['tcversion_type'] == 'latest') - { - $last_version_info = $tcase_mgr->get_last_version_info($rs2[0]['parent_id']); - $tcversion_id = $last_version_info ? $last_version_info['id'] : $tcversion_id ; - } - } - - // mapping need to be done with: - // platforms - // test case versions - $platform_id = $elem['platform_id']; - if( $doMappings ) - { - if( isset($mappings['platforms'][$platform_id]) ) - { - $platform_id = $mappings['platforms'][$platform_id]; - } - if( isset($mappings['test_spec'][$tcversion_id]) ) - { - $tcversion_id = $mappings['test_spec'][$tcversion_id]; - } - } - - // Create plan as copy - Priorities are ALWAYS COPIED - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['testplan_tcversions']} " . - " (testplan_id,tcversion_id,platform_id,node_order "; - $sql_values = " VALUES({$new_tplan_id},{$tcversion_id},{$platform_id}," . - " {$elem['node_order']} "; - - if($my['options']['items2copy']['copy_priorities']) - { - $sql .= ",urgency "; - $sql_values .= ",{$elem['urgency']}"; - } - $sql .= " ) " . $sql_values . " ) "; - - // to avoid warnings - $doIt = !isset($already_linked_versions[$platform_id]); - if ($doIt || !in_array($tcversion_id, $already_linked_versions[$platform_id])) - { - $this->db->exec_query($sql); - $new_feature_id = $this->db->insert_id($this->tables['testplan_tcversions']); - $already_linked_versions[$platform_id][] = $tcversion_id; - } - - if($my['options']['copy_assigned_to'] && $elem['tester'] > 0) - { - $features_map = array(); - $feature_id=$new_feature_id; - $features_map[$feature_id]['user_id'] = $elem['tester']; - $features_map[$feature_id]['build_id'] = $build_id_mapping[$elem['assigned_build']]; - $features_map[$feature_id]['type'] = $this->assignment_types['testcase_execution']['id']; - $features_map[$feature_id]['status'] = $this->assignment_status['open']['id']; - $features_map[$feature_id]['creation_ts'] = $now_ts; - $features_map[$feature_id]['assigner_id'] = $user_id; - - if ($features_map[$feature_id]['build_id'] != 0) { - $this->assignment_mgr->assign($features_map); - } - } - - } - } - } - - -/* - function: copy_milestones - - args: id: source testplan id - new_tplan_id: destination - - returns: - - rev : - 20090910 - franciscom - added start_date - - 20070519 - franciscom - changed date to target_date, because date is an Oracle reverved word. -*/ - private function copy_milestones($tplan_id,$new_tplan_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs=$this->get_milestones($tplan_id); - if(!is_null($rs)) - { - foreach($rs as $mstone) - { - // BUGID 3430 - need to check if start date is NOT NULL - $add2fields = ''; - $add2values = ''; - $use_start_date = strlen(trim($mstone['start_date'])) > 0; - if( $use_start_date ) - { - $add2fields = 'start_date,'; - $add2values = "'" . $mstone['start_date'] . "',"; - } - - $sql = "INSERT INTO {$this->tables['milestones']} (name,a,b,c,target_date,{$add2fields} testplan_id)"; - $sql .= " VALUES ('" . $this->db->prepare_string($mstone['name']) ."'," . - $mstone['high_percentage'] . "," . $mstone['medium_percentage'] . "," . - $mstone['low_percentage'] . ",'" . $mstone['target_date'] . "', {$add2values}{$new_tplan_id})"; - $this->db->exec_query($sql); - } - } - } - - - /** - * Get all milestones for a Test Plan - * @param int $tplan_id Test Plan identificator - * @return array of arrays TBD fields description - */ - function get_milestones($tplan_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql=" /* $debugMsg */ SELECT id, name, a AS high_percentage, b AS medium_percentage, c AS low_percentage, " . - "target_date, start_date,testplan_id " . - "FROM {$this->tables['milestones']} " . - "WHERE testplan_id={$tplan_id} ORDER BY target_date,name"; - return $this->db->get_recordset($sql); - } - - - /** - * Copy user roles to a new Test Plan - * - * @param int $source_id original Test Plan id - * @param int $target_id new Test Plan id - */ - private function copy_user_roles($source_id, $target_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT user_id,role_id FROM {$this->tables['user_testplan_roles']} " . - " WHERE testplan_id={$source_id} "; - $rs = $this->db->get_recordset($sql); - if(!is_null($rs)) - { - foreach($rs as $elem) - { - $sql="INSERT INTO {$this->tables['user_testplan_roles']} " . - "(testplan_id,user_id,role_id) " . - "VALUES({$target_id}," . $elem['user_id'] ."," . $elem['role_id'] . ")"; - $this->db->exec_query($sql); - } - } - } - - - /** - * Gets all testplan related user roles - * - * @param integer $id the testplan id - * @return array assoc map with keys taken from the user_id column - **/ - function getUserRoleIDs($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT user_id,role_id FROM {$this->tables['user_testplan_roles']} " . - "WHERE testplan_id = {$id}"; - $roles = $this->db->fetchRowsIntoMap($sql,'user_id'); - return $roles; - } - - - /** - * Inserts a testplan related role for a given user - * - * @param int $userID the id of the user - * @param int $id the testplan id - * @param int $roleID the role id - * - * @return integer returns tl::OK on success, tl::ERROR else - **/ - - function addUserRole($userID,$id,$roleID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $status = tl::ERROR; - $sql = " /* $debugMsg */ INSERT INTO {$this->tables['user_testplan_roles']} (user_id,testplan_id,role_id) VALUES " . - " ({$userID},{$id},{$roleID})"; - if ($this->db->exec_query($sql)) - { - $testPlan = $this->get_by_id($id); - $role = tlRole::getByID($this->db,$roleID,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - $user = tlUser::getByID($this->db,$userID,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); - if ($user && $testPlan && $role) - { - logAuditEvent(TLS("audit_users_roles_added_testplan",$user->getDisplayName(), - $testPlan['name'],$role->name),"ASSIGN",$id,"testplans"); - } - $status = tl::OK; - } - return $status; - } - - - /** - * Deletes all testplan related role assignments for a given testplan - * - * @param int $id the testplan id - * @return tl::OK on success, tl::FALSE else - **/ - function deleteUserRoles($id,$users=null,$opt=null) - { - $my['opt'] = array('auditlog' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $status = tl::ERROR; - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['user_testplan_roles']} " . - " WHERE testplan_id = " . intval($id); - if(!is_null($users)) - { - $sql .= " AND user_id IN(" . implode(',',$users) . ")"; - } - - if ($this->db->exec_query($sql) && $my['opt']['auditlog']) - { - $testPlan = $this->get_by_id($id); - if ($testPlan) - { - if(is_null($users)) - { - logAuditEvent(TLS("audit_all_user_roles_removed_testplan", - $testPlan['name']),"ASSIGN",$id,"testplans"); - } - else - { - // TBD - } - } - $status = tl::OK; - } - return $status; - } - - - /** - * Delete test plan and all related link to other items - * - */ - function delete($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $id = intval($id); - - $the_sql=array(); - $main_sql=array(); - - $this->deleteUserRoles($id); - $getFeaturesSQL = " /* $debugMsg */ SELECT id FROM {$this->tables['testplan_tcversions']} WHERE testplan_id={$id} "; - $the_sql[]="DELETE FROM {$this->tables['milestones']} WHERE testplan_id={$id}"; - - // CF used on testplan_design are linked by testplan_tcversions.id - $the_sql[]="DELETE FROM {$this->tables['cfield_testplan_design_values']} WHERE link_id ". - "IN ({$getFeaturesSQL})"; - - $the_sql[]="DELETE FROM {$this->tables['user_assignments']} WHERE feature_id ". - "IN ({$getFeaturesSQL})"; - - $the_sql[]="DELETE FROM {$this->tables['testplan_platforms']} WHERE testplan_id={$id}"; - - $the_sql[]="DELETE FROM {$this->tables['testplan_tcversions']} WHERE testplan_id={$id}"; - - $the_sql[]="DELETE FROM {$this->tables['cfield_execution_values']} WHERE testplan_id={$id}"; - $the_sql[]="DELETE FROM {$this->tables['user_testplan_roles']} WHERE testplan_id={$id}"; - - - - // When deleting from executions, we need to clean related tables - $execIDSetSQL = " SELECT id FROM {$this->tables['executions']} WHERE testplan_id={$id} "; - - // get test step exec attachments if any exists - $dummy = " SELECT id FROM {$this->tables['execution_tcsteps']} " . - " WHERE execution_id IN ({$execIDSetSQL}) "; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - // execution attachments - $dummy = " SELECT id FROM {$this->tables['attachments']} " . - " WHERE fk_table = 'executions' " . - " AND fk_id IN ({$execIDSetSQL}) "; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - - $the_sql[]="DELETE FROM {$this->tables['execution_bugs']} WHERE execution_id ". - "IN ($execIDSetSQL)"; - $the_sql[]="DELETE FROM {$this->tables['execution_tcsteps_wip']} WHERE testplan_id={$id}"; - $the_sql[]="DELETE FROM {$this->tables['execution_tcsteps']} WHERE execution_id ". - "IN ($execIDSetSQL) "; - $the_sql[]="DELETE FROM {$this->tables['executions']} WHERE testplan_id={$id}"; - $the_sql[]="DELETE FROM {$this->tables['builds']} WHERE testplan_id={$id}"; - - - foreach($the_sql as $sql) { - $this->db->exec_query($sql); - } - - $this->deleteAttachments($id); - - $this->cfield_mgr->remove_all_design_values_from_node($id); - // ------------------------------------------------------------------------ - - // Finally delete from main table - $main_sql[]="DELETE FROM {$this->tables['testplans']} WHERE id={$id}"; - $main_sql[]="DELETE FROM {$this->tables['nodes_hierarchy']} " . - "WHERE id={$id} AND node_type_id=" . - $this->node_types_descr_id['testplan']; - - foreach($main_sql as $sql) - { - $this->db->exec_query($sql); - } - } // end delete() - - - - // -------------------------------------------------------------------------------------- - // Build related methods - // -------------------------------------------------------------------------------------- - - /* - function: get_builds_for_html_options() - - - args : - $id : test plan id. - [active]: default:null -> all, 1 -> active, 0 -> inactive BUILDS - [open] : default:null -> all, 1 -> open , 0 -> closed/completed BUILDS - [opt] - - returns: - - rev : - */ - function get_builds_for_html_options($id,$active=null,$open=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my = array(); - $my['opt'] = array('orderByDir' => null,'excludeBuild' => 0); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " /* $debugMsg */ SELECT id, name " . - " FROM {$this->tables['builds']} WHERE testplan_id = {$id} "; - - if( !is_null($active) ) - { - $sql .= " AND active=" . intval($active) . " "; - } - - if( !is_null($open) ) - { - $sql .= " AND is_open=" . intval($open) . " "; - } - - if( $my['opt']['excludeBuild'] > 0) - { - $sql .= " AND id <> " . intval($my['opt']['excludeBuild']) . " "; - } - - $orderClause = " ORDER BY name ASC"; - if( !is_null($my['opt']['orderByDir']) ) - { - $xx = explode(':',$my['opt']['orderByDir']); - $orderClause = 'ORDER BY ' . $xx[0] . ' ' . $xx[1]; - } - $sql .= $orderClause; - - $recordset=$this->db->fetchColumnsIntoMap($sql,'id','name'); - - // we will apply natsort only if order by name was requested - if( !is_null($recordset) && stripos($orderClause, 'name') !== FALSE) - { - natsort($recordset); - } - - return $recordset; - } - - - /* - function: get_max_build_id - - args : - $id : test plan id. - - returns: - */ - function get_max_build_id($id,$active = null,$open = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT MAX(id) AS maxbuildid " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id = {$id}"; - - if(!is_null($active)) - { - $sql .= " AND active = " . intval($active) . " "; - } - if( !is_null($open) ) - { - $sql .= " AND is_open = " . intval($open) . " "; - } - - $recordset = $this->db->get_recordset($sql); - $maxBuildID = 0; - if ($recordset) - { - $maxBuildID = intval($recordset[0]['maxbuildid']); - } - return $maxBuildID; - } - - /* - function: get_testsuites - args : - $id : test plan id. - returns: returns flat list of names of test suites (including nest test suites) No particular Order. - */ - function get_testsuites($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ SELECT NHTSUITE.name, NHTSUITE.id, NHTSUITE.parent_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV, {$this->tables['nodes_hierarchy']} NHTCV, " . - " {$this->tables['nodes_hierarchy']} NHTCASE, {$this->tables['nodes_hierarchy']} NHTSUITE " . - " WHERE TPTCV.tcversion_id = NHTCV.id " . - " AND NHTCV.parent_id = NHTCASE.id " . - " AND NHTCASE.parent_id = NHTSUITE.id " . - " AND TPTCV.testplan_id = " . $id . " " . - " GROUP BY NHTSUITE.name,NHTSUITE.id,NHTSUITE.parent_id " . - " ORDER BY NHTSUITE.name" ; - - $recordset = $this->db->get_recordset($sql); - - // Now the recordset contains testsuites that have child test cases. - // However there could potentially be testsuites that only have grandchildren/greatgrandchildren - // this will iterate through found test suites and check for - $superset = $recordset; - foreach($recordset as $value) - { - $superset = array_merge($superset, $this->get_parenttestsuites($value['id'])); - } - - // At this point there may be duplicates - $dup_track = array(); - foreach($superset as $value) - { - if (!array_key_exists($value['id'],$dup_track)) - { - $dup_track[$value['id']] = true; - $finalset[] = $value; - } - } - - // Needs to be alphabetical based upon name attribute - usort($finalset, array("testplan", "compare_name")); - return $finalset; - } - - - /* - function: compare_name - Used for sorting a list by nest name attribute - - args : - $a : first array to compare - $b : second array to compare - - returns: an integer indicating the result of the comparison - */ - static private function compare_name($a, $b) - { - return strcasecmp($a['name'], $b['name']); - } - - - /* - function: get_parenttestsuites - - Used by get_testsuites - - Recursive function used to get all the parent test suites of potentially testcase free testsuites. - If passed node id isn't the product then it's merged into result set. - - args : - $id : $id of potential testsuite - - returns: an array of all testsuite ancestors of $id - */ - private function get_parenttestsuites($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT name, id, parent_id " . - "FROM {$this->tables['nodes_hierarchy']} NH " . - "WHERE NH.node_type_id <> {$this->node_types_descr_id['testproject']} " . - "AND NH.id = " . $id; - - $recordset = (array)$this->db->get_recordset($sql); - $myarray = array(); - if (count($recordset) > 0) { - $myarray = array($recordset[0]); - $myarray = array_merge($myarray, $this->get_parenttestsuites($recordset[0]['parent_id'])); - } - - return $myarray; - } - - - /* - function: get_builds - get info about builds defined for a testlan. - Build can be filtered by active and open status. - - args : - id: test plan id. - [active]: default:null -> all, 1 -> active, 0 -> inactive BUILDS - [open]: default:null -> all, 1 -> open , 0 -> closed/completed BUILDS - [opt] - - returns: opt['getCount'] == false - map, where elements are ordered by build name, using variant of nasort php function. - key: build id - value: map with following keys - id: build id - name: build name - notes: build notes - active: build active status - is_open: build open status - testplan_id - release_date - - opt['getCount'] == true - map key: test plan id - values: map with following key testplan_id, build_qty - rev : - */ - function get_builds($id,$active=null,$open=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('fields' => - 'id,testplan_id, name, notes, active, is_open,release_date,closed_on_date,creation_ts', - 'orderBy' => " ORDER BY name ASC", 'getCount' => false, 'buildID' => null); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - if( $my['opt']['getCount'] ) - { - $my['opt']['orderBy'] = null; - - $accessField = 'testplan_id'; - $groupBy = " GROUP BY testplan_id "; - $itemSet = (array)$id; - - $sql = " /* $debugMsg */ " . - " SELECT testplan_id, count(0) AS build_qty " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id IN ('" . implode("','", $itemSet) . "') "; - } - else - { - $accessField = 'id'; - $groupBy = ''; - $sql = " /* $debugMsg */ " . - " SELECT {$my['opt']['fields']} " . - " FROM {$this->tables['builds']} WHERE testplan_id = {$id} " ; - - if( !is_null($my['opt']['buildID']) ) - { - $sql .= " AND id=" . intval($my['opt']['buildID']) . " "; - } - } - - - if( !is_null($active) ) - { - $sql .= " AND active=" . intval($active) . " "; - } - if( !is_null($open) ) - { - $sql .= " AND is_open=" . intval($open) . " "; - } - - $sql .= $groupBy; - $sql .= ($doOrderBy = !is_null($my['opt']['orderBy'])) ? $my['opt']['orderBy'] : ''; - - $rs = $this->db->fetchRowsIntoMap($sql,$accessField); - - // _natsort_builds() has to be used ONLY if name is used on ORDER BY - if( !is_null($rs) && $doOrderBy && strpos($my['opt']['orderBy'],'name') !== FALSE) - { - $rs = $this->_natsort_builds($rs); - } - - return $rs; - } - - - /** - * Get a build belonging to a test plan, using build name as access key - * - * @param int $id test plan id - * @param string $build_name - * - * @return array [id,testplan_id, name, notes, active, is_open] - */ - function get_build_by_name($id,$build_name) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe_build_name=$this->db->prepare_string(trim($build_name)); - - $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id = {$id} AND name='{$safe_build_name}'"; - - - $recordset = $this->db->get_recordset($sql); - $rs=null; - if( !is_null($recordset) ) - { - $rs=$recordset[0]; - } - return $rs; - } - - - /** - * Get a build belonging to a test plan, using build id as access key - * - * @param int $id test plan id - * @param int $build_id - * - * @return array [id,testplan_id, name, notes, active, is_open] - */ - function get_build_by_id($id,$build_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . - " FROM {$this->tables['builds']} BUILDS " . - " WHERE testplan_id = {$id} AND BUILDS.id={$build_id}"; - - $recordset = $this->db->get_recordset($sql); - $rs=null; - if( !is_null($recordset) ) - { - $rs=$recordset[0]; - } - return $rs; - } - - - /** - * Get the number of builds of a given Testplan - * - * @param int tplanID test plan id - * - * @return int number of builds - * - * @internal revisions: - * 20100217 - asimon - added parameters active and open to get only number of active/open builds - */ - function getNumberOfBuilds($tplanID, $active = null, $open = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ SELECT count(id) AS num_builds FROM {$this->tables['builds']} builds " . - "WHERE builds.testplan_id = " . $tplanID; - - if( !is_null($active) ) - { - $sql .= " AND builds.active=" . intval($active) . " "; - } - if( !is_null($open) ) - { - $sql .= " AND builds.is_open=" . intval($open) . " "; - } - - return $this->db->fetchOneValue($sql); - } - - /** - * - */ - function _natsort_builds($builds_map) { - // sort in natural order (see natsort in PHP manual) - foreach($builds_map as $key => $value) { - $build_names[$key] = $value['name']; - } - - natsort($build_names); - foreach($build_names as $key => $value) { - $dummy[$key] = $builds_map[$key]; - } - return $dummy; - } - - - /* - function: check_build_name_existence - - args: - tplan_id: test plan id. - build_name - [build_id}: default: null - when is not null we add build_id as filter, this is useful - to understand if is really a duplicate when using this method - while managing update operations via GUI - - returns: 1 => name exists - - */ - function check_build_name_existence($tplan_id,$build_name,$build_id=null,$case_sensitive=0) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT id, name, notes " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id = {$tplan_id} "; - - - if($case_sensitive) { - $sql .= " AND name="; - } else { - $build_name=strtoupper($build_name); - $sql .= " AND UPPER(name)="; - } - $sql .= "'" . $this->db->prepare_string($build_name) . "'"; - - if( !is_null($build_id) ) { - $sql .= " AND id <> " . $this->db->prepare_int($build_id); - } - - $result = $this->db->exec_query($sql); - $status= $this->db->num_rows($result) ? 1 : 0; - - return $status; - } - - - /* - function: get_build_id_by_name - - Ignores case - - args : - $tplan_id : test plan id. - $build_name : build name. - - returns: - The ID of the build name specified regardless of case. - - rev : - */ - function get_build_id_by_name($tplan_id,$build_name) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT builds.id, builds.name, builds.notes " . - " FROM {$this->tables['builds']} builds " . - " WHERE builds.testplan_id = {$tplan_id} "; - - $build_name=strtoupper($build_name); - $sql .= " AND UPPER(builds.name)="; - $sql .= "'" . $this->db->prepare_string($build_name) . "'"; - - $recordset = $this->db->get_recordset($sql); - $BuildID = $recordset ? intval($recordset[0]['id']) : 0; - - return $BuildID; - } - - - // -------------------------------------------------------------------------------------- - // Custom field related methods - // -------------------------------------------------------------------------------------- - /* - function: get_linked_cfields_at_design - - args: $id - [$parent_id]: testproject id - [$show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - 0 or null -> don't filter - - returns: hash - - rev : - */ - function get_linked_cfields_at_design($id,$parent_id=null,$show_on_execution=null) - { - $path_len=0; - if( is_null($parent_id) ) - { - // Need to get testplan parent (testproject id) in order to get custom fields - // 20081122 - franciscom - need to check when we can call this with ID=NULL - $the_path = $this->tree_manager->get_path(!is_null($id) ? $id : $parent_id); - $path_len = count($the_path); - } - $tproject_id = ($path_len > 0)? $the_path[$path_len-1]['parent_id'] : $parent_id; - - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,self::ENABLED, - $show_on_execution,'testplan',$id); - - return $cf_map; - } - - - /* - function: get_linked_cfields_at_execution - - args: $id - [$parent_id]: if present is testproject id - [$show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - 0 or null -> don't filter - - returns: hash - - rev : - */ - function get_linked_cfields_at_execution($id,$parent_id=null,$show_on_execution=null) - { - $path_len=0; - if( is_null($parent_id) ) - { - // Need to get testplan parent (testproject id) in order to get custom fields - // 20081122 - franciscom - need to check when we can call this with ID=NULL - $the_path = $this->tree_manager->get_path(!is_null($id) ? $id : $parent_id); - $path_len = count($the_path); - } - $tproject_id = ($path_len > 0)? $the_path[$path_len-1]['parent_id'] : $parent_id; - - // 20081122 - franciscom - humm!! need to look better IMHO this call is done to wrong function - $cf_map=$this->cfield_mgr->get_linked_cfields_at_execution($tproject_id,self::ENABLED, - $show_on_execution,'testplan',$id); - return($cf_map); - } - - - /* Get Custom Fields Detail which are enabled on Execution of a TestCase/TestProject. - function: get_linked_cfields_id - - args: $testproject_id - - returns: hash map of id : label - - rev : - - */ - - function get_linked_cfields_id($tproject_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $field_map = new stdClass(); - - $sql = " /* $debugMsg */ SELECT field_id,label - FROM {$this->tables['cfield_testprojects']} cfield_testprojects, + WHERE TPTCV.testplan_id = " . intval($id) . + " {$platFilter} ORDER BY name ASC "; + + // CUMULATIVE is needed to get all platforms assigned + // to each testcase linked to testplan + return $this->db->fetchRowsIntoMap($sql, 'testcase_id', + database::CUMULATIVE); + } + + /* + * function: copy_as + * creates a new test plan using an existent one as source. + * Note: copy_test_urgency is not appropriate to copy + * + * + * args: id: source testplan id + * new_tplan_id: destination + * [tplan_name]: default null. + * != null => set this as the new name + * + * [tproject_id]: default null. + * != null => set this as the new testproject for the testplan + * this allow us to copy testplans to differents test projects. + * + * [user_id] + * [options]: default null + * allowed keys: + * items2copy: + * null: do a deep copy => copy following test plan child elements: + * builds,linked tcversions,milestones,user_roles,priorities, + * platforms,execution assignment. + * + * != null, a map with keys that controls what child elements to copy + * + * copy_assigned_to: + * tcversion_type: + * null/'current' -> use same version present on source testplan + * 'lastest' -> for every testcase linked to source testplan + * use lastest available version + * + * [mappings]: need to be documented + * returns: N/A + * + * + * 20101114 - franciscom - Because user assignment is done at BUILD Level, we will force + * BUILD COPY no matter user choice if user choose to copy + * Test Case assignment. + * + * + */ + public function copy_as($id, $new_tplan_id, $tplan_name = null, + $tproject_id = null, $user_id = null, $options = null, $mappings = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $cp_methods = array( + 'copyMilestones' => 'copyMilestones', + 'copyUserRoles' => 'copyUserRoles', + 'copyPlatformsLinks' => 'copyPlatformsLinks', + 'copyAttachments' => 'copyAttachments' + ); + + $mapping_methods = array( + 'copyPlatformsLinks' => 'platforms' + ); + + $my['options'] = array(); + + // Configure here only elements that has his own table. + $my['options']['items2copy'] = array( + 'copyTcases' => 1, + 'copyMilestones' => 1, + 'copyUserRoles' => 1, + 'copyBuilds' => 1, + 'copyPlatformsLinks' => 1, + 'copyAttachments' => 1, + 'copyPriorities' => 1 + ); + + $my['options']['copy_assigned_to'] = 0; + $my['options']['tcversion_type'] = null; + + $my['options'] = array_merge($my['options'], (array) $options); + + $safe['new_tplan_id'] = intval($new_tplan_id); + + if (! is_null($tplan_name)) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . + "SET name='" . $this->db->prepare_string(trim($tplan_name)) . + "' " . "WHERE id=" . $safe['new_tplan_id']; + $this->db->exec_query($sql); + } + + if (! is_null($tproject_id)) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['testplans']} SET testproject_id={$tproject_id} " . + "WHERE id=" . $safe['new_tplan_id']; + $this->db->exec_query($sql); + } + + // copy builds and tcversions out of following loop, because of the user assignments per build + // special measures have to be taken + $build_id_mapping = null; + if ($my['options']['items2copy']['copyBuilds']) { + $build_id_mapping = $this->copyBuilds($id, $safe['new_tplan_id']); + } + + // Important Notice: + // Since the addition of Platforms, test case versions are linked to Test Plan AND Platforms + // this means, that not matter user choice, we will force Platforms COPY. + // This is a lazy approach, instead of complex one that requires understand what Platforms + // have been used on SOURCE Test Plan. + // + // copy test cases is an special copy + if ($my['options']['items2copy']['copyTcases']) { + $my['options']['items2copy']['copy_platforms_links'] = 1; + $this->copyLinkedTestcaseVersions($id, $new_tplan_id, $user_id, + $my['options'], $mappings, $build_id_mapping); + } + + foreach ($my['options']['items2copy'] as $key => $do_copy) { + if ($do_copy && isset($cp_methods[$key])) { + $copy_method = $cp_methods[$key]; + if (isset($mapping_methods[$key]) && + isset($mappings[$mapping_methods[$key]])) { + $this->$copy_method($id, $new_tplan_id, + $mappings[$mapping_methods[$key]]); + } else { + $this->$copy_method($id, $new_tplan_id); + } + } + } + } + + /** + * $id: source testplan id + * $new_tplan_id: destination + */ + private function copyBuilds($id, $new_tplan_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $rs = $this->get_builds($id); + + $id_mapping = array(); + if (! is_null($rs)) { + foreach ($rs as $build) { + $add2sql = ''; + $fields = 'name,notes,'; + if (strlen(trim($build['release_date'])) > 0) { + $fields .= 'release_date,'; + $add2sql = "'" . + $this->db->prepare_string($build['release_date']) . "',"; + } + $fields .= 'testplan_id'; + + $sql = " /* $debugMsg */ INSERT INTO {$this->tables['builds']} " . + " ({$fields}) " . "VALUES ('" . + $this->db->prepare_string($build['name']) . "'," . "'" . + $this->db->prepare_string($build['notes']) . + "', {$add2sql} {$new_tplan_id})"; + + $this->db->exec_query($sql); + $new_id = $this->db->insert_id($this->tables['builds']); + $id_mapping[$build['id']] = $new_id; + } + } + return $id_mapping; + } + + /* + * function: copy_linked_tcversions + * + * args: id: source testplan id + * new_tplan_id: destination + * [options] + * [tcversion_type]: default null -> use same version present on source testplan + * 'lastest' -> for every testcase linked to source testplan + * use lastest available version + * [copy_assigned_to]: 1 -> copy execution assignments without role control + * + * [$mappings] useful when this method is called due to a Test Project COPY AS (yes PROJECT no PLAN) + * + * returns: + * + * Note: test urgency is set to default in the new Test plan (not copied) + * + */ + private function copyLinkedTestcaseVersions($id, $new_tplan_id, + $user_id = - 1, $options = null, $mappings = null, + $build_id_mapping = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['options']['tcversion_type'] = null; + $my['options']['copy_assigned_to'] = 0; + $my['options'] = array_merge($my['options'], (array) $options); + $now_ts = $this->db->db_now(); + + $sql = "/* $debugMsg */ "; + if ($my['options']['copy_assigned_to']) { + $sql .= " SELECT TPTCV.*, COALESCE(UA.user_id,-1) AS tester, " . + " COALESCE(UA.build_id,0) as assigned_build " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON " . + " UA.feature_id = TPTCV.id " . " WHERE testplan_id={$id} "; + } else { + $sql .= " SELECT TPTCV.* FROM {$this->tables['testplan_tcversions']} TPTCV" . + " WHERE testplan_id={$id} "; + } + + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $tcaseMgr = new testcase($this->db); + $doMappings = ! is_null($mappings); + $already_linked_versions = array(); + + foreach ($rs as $elem) { + $tcversion_id = $elem['tcversion_id']; + + if (! is_null($my['options']['tcversion_type'])) { + $sql = "/* $debugMsg */ SELECT * FROM {$this->tables['nodes_hierarchy']} WHERE id={$tcversion_id} "; + $rs2 = $this->db->get_recordset($sql); + // Ticket 4696 - if tcversion_type is set to latest -> update linked version + if ($my['options']['tcversion_type'] == 'latest') { + $last_version_info = $tcaseMgr->getLastVersionInfo( + $rs2[0]['parent_id']); + $tcversion_id = $last_version_info ? $last_version_info['id'] : $tcversion_id; + } + } + + // mapping need to be done with: + // platforms + // test case versions + $platform_id = $elem['platform_id']; + if ($doMappings) { + if (isset($mappings['platforms'][$platform_id])) { + $platform_id = $mappings['platforms'][$platform_id]; + } + if (isset($mappings['test_spec'][$tcversion_id])) { + $tcversion_id = $mappings['test_spec'][$tcversion_id]; + } + } + + // Create plan as copy - Priorities are ALWAYS COPIED + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['testplan_tcversions']} " . + " (testplan_id,tcversion_id,platform_id,node_order "; + $sql_values = " VALUES({$new_tplan_id},{$tcversion_id},{$platform_id}," . + " {$elem['node_order']} "; + + if ($my['options']['items2copy']['copyPriorities']) { + $sql .= ",urgency "; + $sql_values .= ",{$elem['urgency']}"; + } + $sql .= " ) " . $sql_values . " ) "; + + // to avoid warnings + $doIt = ! isset($already_linked_versions[$platform_id]); + if ($doIt || + ! in_array($tcversion_id, + $already_linked_versions[$platform_id])) { + $this->db->exec_query($sql); + $new_feature_id = $this->db->insert_id( + $this->tables['testplan_tcversions']); + $already_linked_versions[$platform_id][] = $tcversion_id; + } + + if ($my['options']['copy_assigned_to'] && $elem['tester'] > 0) { + $features_map = array(); + $feature_id = $new_feature_id; + $features_map[$feature_id]['user_id'] = $elem['tester']; + $features_map[$feature_id]['build_id'] = $build_id_mapping[$elem['assigned_build']]; + $features_map[$feature_id]['type'] = $this->assignment_types['testcase_execution']['id']; + $features_map[$feature_id]['status'] = $this->assignment_status['open']['id']; + $features_map[$feature_id]['creation_ts'] = $now_ts; + $features_map[$feature_id]['assigner_id'] = $user_id; + + if ($features_map[$feature_id]['build_id'] != 0) { + $this->assignment_mgr->assign($features_map); + } + } + } + } + } + + /* + * function: copy_milestones + * + * args: id: source testplan id + * new_tplan_id: destination + * + * returns: + * + * rev : + * 20090910 - franciscom - added start_date + * + * 20070519 - franciscom + * changed date to target_date, because date is an Oracle reverved word. + */ + private function copyMilestones($tplan_id, $new_tplan_id) + { + $rs = $this->get_milestones($tplan_id); + if (! is_null($rs)) { + foreach ($rs as $mstone) { + // BUGID 3430 - need to check if start date is NOT NULL + $add2fields = ''; + $add2values = ''; + $use_start_date = strlen(trim($mstone['start_date'])) > 0; + if ($use_start_date) { + $add2fields = 'start_date,'; + $add2values = "'" . $mstone['start_date'] . "',"; + } + + $sql = "INSERT INTO {$this->tables['milestones']} (name,a,b,c,target_date,{$add2fields} testplan_id)"; + $sql .= " VALUES ('" . + $this->db->prepare_string($mstone['name']) . "'," . + $mstone['high_percentage'] . "," . + $mstone['medium_percentage'] . "," . + $mstone['low_percentage'] . ",'" . $mstone['target_date'] . + "', {$add2values}{$new_tplan_id})"; + $this->db->exec_query($sql); + } + } + } + + /** + * Get all milestones for a Test Plan + * + * @param int $tplan_id + * Test Plan identificator + * @return array of arrays TBD fields description + */ + public function get_milestones($tplan_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT id, name, a AS high_percentage, b AS medium_percentage, c AS low_percentage, " . + "target_date, start_date,testplan_id " . + "FROM {$this->tables['milestones']} " . + "WHERE testplan_id={$tplan_id} ORDER BY target_date,name"; + return $this->db->get_recordset($sql); + } + + /** + * Copy user roles to a new Test Plan + * + * @param int $source_id + * original Test Plan id + * @param int $target_id + * new Test Plan id + */ + private function copyUserRoles($source_id, $target_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT user_id,role_id FROM {$this->tables['user_testplan_roles']} " . + " WHERE testplan_id={$source_id} "; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + foreach ($rs as $elem) { + $sql = "INSERT INTO {$this->tables['user_testplan_roles']} " . + "(testplan_id,user_id,role_id) " . "VALUES({$target_id}," . + $elem['user_id'] . "," . $elem['role_id'] . ")"; + $this->db->exec_query($sql); + } + } + } + + /** + * Gets all testplan related user roles + * + * @param integer $id + * the testplan id + * @return array assoc map with keys taken from the user_id column + */ + private function getUserRoleIDs($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT user_id,role_id FROM {$this->tables['user_testplan_roles']} " . + "WHERE testplan_id = {$id}"; + return $this->db->fetchRowsIntoMap($sql, 'user_id'); + } + + /** + * Inserts a testplan related role for a given user + * + * @param int $userID + * the id of the user + * @param int $id + * the testplan id + * @param int $roleID + * the role id + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function addUserRole($userID, $id, $roleID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $status = tl::ERROR; + $sql = " /* $debugMsg */ INSERT INTO {$this->tables['user_testplan_roles']} (user_id,testplan_id,role_id) VALUES " . + " ({$userID},{$id},{$roleID})"; + if ($this->db->exec_query($sql)) { + $testPlan = $this->get_by_id($id); + $role = tlRole::getByID($this->db, $roleID, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + $user = tlUser::getByID($this->db, $userID, + tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); + if ($user && $testPlan && $role) { + logAuditEvent( + TLS("audit_users_roles_added_testplan", + $user->getDisplayName(), $testPlan['name'], $role->name), + "ASSIGN", $id, "testplans"); + } + $status = tl::OK; + } + return $status; + } + + /** + * Deletes all testplan related role assignments for a given testplan + * + * @param int $id + * the testplan id + * @return tl::OK on success, tl::FALSE else + */ + public function deleteUserRoles($id, $users = null, $opt = null) + { + $my['opt'] = array( + 'auditlog' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $status = tl::ERROR; + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['user_testplan_roles']} " . + " WHERE testplan_id = " . intval($id); + if (! is_null($users)) { + $sql .= " AND user_id IN(" . implode(',', $users) . ")"; + } + + if ($this->db->exec_query($sql) && $my['opt']['auditlog']) { + $testPlan = $this->get_by_id($id); + if ($testPlan && is_null($users)) { + logAuditEvent( + TLS("audit_all_user_roles_removed_testplan", + $testPlan['name']), "ASSIGN", $id, "testplans"); + } + $status = tl::OK; + } + return $status; + } + + /** + * Delete test plan and all related link to other items + */ + public function delete($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $id = intval($id); + + $the_sql = array(); + $main_sql = array(); + + $this->deleteUserRoles($id); + $getFeaturesSQL = " /* $debugMsg */ SELECT id FROM {$this->tables['testplan_tcversions']} WHERE testplan_id={$id} "; + $the_sql[] = "DELETE FROM {$this->tables['milestones']} WHERE testplan_id={$id}"; + + // CF used on testplan_design are linked by testplan_tcversions.id + $the_sql[] = "DELETE FROM {$this->tables['cfield_testplan_design_values']} WHERE link_id " . + "IN ({$getFeaturesSQL})"; + + $the_sql[] = "DELETE FROM {$this->tables['user_assignments']} WHERE feature_id " . + "IN ({$getFeaturesSQL})"; + + $the_sql[] = "DELETE FROM {$this->tables['testplan_platforms']} WHERE testplan_id={$id}"; + + $the_sql[] = "DELETE FROM {$this->tables['testplan_tcversions']} WHERE testplan_id={$id}"; + + $the_sql[] = "DELETE FROM {$this->tables['cfield_execution_values']} WHERE testplan_id={$id}"; + $the_sql[] = "DELETE FROM {$this->tables['user_testplan_roles']} WHERE testplan_id={$id}"; + + // When deleting from executions, we need to clean related tables + $execIDSetSQL = " SELECT id FROM {$this->tables['executions']} WHERE testplan_id={$id} "; + + // get test step exec attachments if any exists + $dummy = " SELECT id FROM {$this->tables['execution_tcsteps']} " . + " WHERE execution_id IN ({$execIDSetSQL}) "; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // execution attachments + $dummy = " SELECT id FROM {$this->tables['attachments']} " . + " WHERE fk_table = 'executions' " . + " AND fk_id IN ({$execIDSetSQL}) "; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + $the_sql[] = "DELETE FROM {$this->tables['execution_bugs']} WHERE execution_id " . + "IN ($execIDSetSQL)"; + $the_sql[] = "DELETE FROM {$this->tables['execution_tcsteps_wip']} WHERE testplan_id={$id}"; + $the_sql[] = "DELETE FROM {$this->tables['execution_tcsteps']} WHERE execution_id " . + "IN ($execIDSetSQL) "; + $the_sql[] = "DELETE FROM {$this->tables['executions']} WHERE testplan_id={$id}"; + $the_sql[] = "DELETE FROM {$this->tables['builds']} WHERE testplan_id={$id}"; + + foreach ($the_sql as $sql) { + $this->db->exec_query($sql); + } + + $this->deleteAttachments($id); + + $this->cfield_mgr->remove_all_design_values_from_node($id); + + // Finally delete from main table + $main_sql[] = "DELETE FROM {$this->tables['testplans']} WHERE id={$id}"; + $main_sql[] = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + "WHERE id={$id} AND node_type_id=" . + $this->node_types_descr_id['testplan']; + + foreach ($main_sql as $sql) { + $this->db->exec_query($sql); + } + } + + // Build related methods + + /* + * function: get_builds_for_html_options() + * + * + * args : + * $id : test plan id. + * [active]: default:null -> all, 1 -> active, 0 -> inactive BUILDS + * [open] : default:null -> all, 1 -> open , 0 -> closed/completed BUILDS + * [opt] + * + * returns: + * + * rev : + */ + public function get_builds_for_html_options($id, $active = null, + $open = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $my = array(); + $my['opt'] = array( + 'orderByDir' => null, + 'excludeBuild' => 0 + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " /* $debugMsg */ SELECT id, name " . + " FROM {$this->tables['builds']} WHERE testplan_id = {$id} "; + + if (! is_null($active)) { + $sql .= " AND active=" . intval($active) . " "; + } + + if (! is_null($open)) { + $sql .= " AND is_open=" . intval($open) . " "; + } + + if ($my['opt']['excludeBuild'] > 0) { + $sql .= " AND id <> " . intval($my['opt']['excludeBuild']) . " "; + } + + $orderClause = " ORDER BY name ASC"; + if (! is_null($my['opt']['orderByDir'])) { + $xx = explode(':', $my['opt']['orderByDir']); + $orderClause = 'ORDER BY ' . $xx[0] . ' ' . $xx[1]; + } + $sql .= $orderClause; + + $recordset = $this->db->fetchColumnsIntoMap($sql, 'id', 'name'); + + // we will apply natsort only if order by name was requested + if (! is_null($recordset) && stripos($orderClause, 'name') !== false) { + natsort($recordset); + } + + return $recordset; + } + + /* + * function: get_max_build_id + * + * args : + * $id : test plan id. + * + * returns: + */ + public function get_max_build_id($id, $active = null, $open = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT MAX(id) AS maxbuildid " . + " FROM {$this->tables['builds']} " . " WHERE testplan_id = {$id}"; + + if (! is_null($active)) { + $sql .= " AND active = " . intval($active) . " "; + } + if (! is_null($open)) { + $sql .= " AND is_open = " . intval($open) . " "; + } + + $recordset = $this->db->get_recordset($sql); + $maxBuildID = 0; + if ($recordset) { + $maxBuildID = intval($recordset[0]['maxbuildid']); + } + return $maxBuildID; + } + + /* + * function: get_testsuites + * args : + * $id : test plan id. + * returns: returns flat list of names of test suites (including nest test suites) No particular Order. + */ + public function get_testsuites($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ SELECT NHTSUITE.name, NHTSUITE.id, NHTSUITE.parent_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV, {$this->tables['nodes_hierarchy']} NHTCV, " . + " {$this->tables['nodes_hierarchy']} NHTCASE, {$this->tables['nodes_hierarchy']} NHTSUITE " . + " WHERE TPTCV.tcversion_id = NHTCV.id " . + " AND NHTCV.parent_id = NHTCASE.id " . + " AND NHTCASE.parent_id = NHTSUITE.id " . " AND TPTCV.testplan_id = " . + $id . " " . " GROUP BY NHTSUITE.name,NHTSUITE.id,NHTSUITE.parent_id " . + " ORDER BY NHTSUITE.name"; + + $recordset = $this->db->get_recordset($sql); + + // Now the recordset contains testsuites that have child test cases. + // However there could potentially be testsuites that only have grandchildren/greatgrandchildren + // this will iterate through found test suites and check for + $superset = $recordset; + foreach ($recordset as $value) { + $superset = array_merge($superset, + $this->getParentTestsuites($value['id'])); + } + + // At this point there may be duplicates + $dup_track = array(); + foreach ($superset as $value) { + if (! array_key_exists($value['id'], $dup_track)) { + $dup_track[$value['id']] = true; + $finalset[] = $value; + } + } + + // Needs to be alphabetical based upon name attribute + usort($finalset, array( + "testplan", + "compareName" + )); + return $finalset; + } + + /* + * function: compare_name + * Used for sorting a list by nest name attribute + * + * args : + * $a : first array to compare + * $b : second array to compare + * + * returns: an integer indicating the result of the comparison + */ + private static function compareName($a, $b) + { + return strcasecmp($a['name'], $b['name']); + } + + /* + * function: get_parenttestsuites + * + * Used by get_testsuites + * + * Recursive function used to get all the parent test suites of potentially testcase free testsuites. + * If passed node id isn't the product then it's merged into result set. + * + * args : + * $id : $id of potential testsuite + * + * returns: an array of all testsuite ancestors of $id + */ + private function getParentTestsuites($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT name, id, parent_id " . + "FROM {$this->tables['nodes_hierarchy']} NH " . + "WHERE NH.node_type_id <> {$this->node_types_descr_id['testproject']} " . + "AND NH.id = " . $id; + + $recordset = (array) $this->db->get_recordset($sql); + $myarray = array(); + if (! empty($recordset)) { + $myarray = array( + $recordset[0] + ); + $myarray = array_merge($myarray, + $this->getParentTestsuites($recordset[0]['parent_id'])); + } + + return $myarray; + } + + /* + * function: get_builds + * get info about builds defined for a testlan. + * Build can be filtered by active and open status. + * + * args : + * id: test plan id. + * [active]: default:null -> all, 1 -> active, 0 -> inactive BUILDS + * [open]: default:null -> all, 1 -> open , 0 -> closed/completed BUILDS + * [opt] + * + * returns: opt['getCount'] == false + * map, where elements are ordered by build name, using variant of nasort php function. + * key: build id + * value: map with following keys + * id: build id + * name: build name + * notes: build notes + * active: build active status + * is_open: build open status + * testplan_id + * release_date + * + * opt['getCount'] == true + * map key: test plan id + * values: map with following key testplan_id, build_qty + * rev : + */ + public function get_builds($id, $active = null, $open = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'fields' => 'id,testplan_id, name, notes, active, is_open,release_date,closed_on_date,creation_ts', + 'orderBy' => " ORDER BY name ASC", + 'getCount' => false, + 'buildID' => null + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + if ($my['opt']['getCount']) { + $my['opt']['orderBy'] = null; + + $accessField = 'testplan_id'; + $groupBy = " GROUP BY testplan_id "; + $itemSet = (array) $id; + + $sql = " /* $debugMsg */ " . + " SELECT testplan_id, count(0) AS build_qty " . + " FROM {$this->tables['builds']} " . " WHERE testplan_id IN ('" . + implode("','", $itemSet) . "') "; + } else { + $accessField = 'id'; + $groupBy = ''; + $sql = " /* $debugMsg */ " . " SELECT {$my['opt']['fields']} " . + " FROM {$this->tables['builds']} WHERE testplan_id = {$id} "; + + if (! is_null($my['opt']['buildID'])) { + $sql .= " AND id=" . intval($my['opt']['buildID']) . " "; + } + } + + if (! is_null($active)) { + $sql .= " AND active=" . intval($active) . " "; + } + if (! is_null($open)) { + $sql .= " AND is_open=" . intval($open) . " "; + } + + $sql .= $groupBy; + $sql .= ($doOrderBy = ! is_null($my['opt']['orderBy'])) ? $my['opt']['orderBy'] : ''; + + $rs = $this->db->fetchRowsIntoMap($sql, $accessField); + + // _natsort_builds() has to be used ONLY if name is used on ORDER BY + if (! is_null($rs) && $doOrderBy && + strpos($my['opt']['orderBy'], 'name') !== false) { + $rs = $this->natsortBuilds($rs); + } + + return $rs; + } + + /** + * Get a build belonging to a test plan, using build name as access key + * + * @param int $id + * test plan id + * @param string $build_name + * + * @return array [id,testplan_id, name, notes, active, is_open] + */ + public function get_build_by_name($id, $build_name) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe_build_name = $this->db->prepare_string(trim($build_name)); + + $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . + " FROM {$this->tables['builds']} " . + " WHERE testplan_id = {$id} AND name='{$safe_build_name}'"; + + $recordset = $this->db->get_recordset($sql); + $rs = null; + if (! is_null($recordset)) { + $rs = $recordset[0]; + } + return $rs; + } + + /** + * Get a build belonging to a test plan, using build id as access key + * + * @param int $id + * test plan id + * @param int $build_id + * + * @return array [id,testplan_id, name, notes, active, is_open] + */ + public function get_build_by_id($id, $build_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . + " FROM {$this->tables['builds']} BUILDS " . + " WHERE testplan_id = {$id} AND BUILDS.id={$build_id}"; + + $recordset = $this->db->get_recordset($sql); + $rs = null; + if (! is_null($recordset)) { + $rs = $recordset[0]; + } + return $rs; + } + + /** + * Get the number of builds of a given Testplan + * + * @param + * int tplanID test plan id + * + * @return int number of builds + * + * @internal revisions: + * 20100217 - asimon - added parameters active and open to get only number of active/open builds + */ + public function getNumberOfBuilds($tplanID, $active = null, $open = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ SELECT count(id) AS num_builds FROM {$this->tables['builds']} builds " . + "WHERE builds.testplan_id = " . $tplanID; + + if (! is_null($active)) { + $sql .= " AND builds.active=" . intval($active) . " "; + } + if (! is_null($open)) { + $sql .= " AND builds.is_open=" . intval($open) . " "; + } + + return $this->db->fetchOneValue($sql); + } + + /** + */ + private function natsortBuilds($builds_map) + { + // sort in natural order (see natsort in PHP manual) + foreach ($builds_map as $key => $value) { + $build_names[$key] = $value['name']; + } + + natsort($build_names); + foreach ($build_names as $key => $value) { + $dummy[$key] = $builds_map[$key]; + } + return $dummy; + } + + /* + * function: check_build_name_existence + * + * args: + * tplan_id: test plan id. + * build_name + * [build_id}: default: null + * when is not null we add build_id as filter, this is useful + * to understand if is really a duplicate when using this method + * while managing update operations via GUI + * + * returns: 1 => name exists + * + */ + public function check_build_name_existence($tplan_id, $build_name, + $build_id = null, $case_sensitive = 0) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT id, name, notes " . + " FROM {$this->tables['builds']} " . + " WHERE testplan_id = {$tplan_id} "; + + if ($case_sensitive) { + $sql .= " AND name="; + } else { + $build_name = strtoupper($build_name); + $sql .= " AND UPPER(name)="; + } + $sql .= "'" . $this->db->prepare_string($build_name) . "'"; + + if (! is_null($build_id)) { + $sql .= " AND id <> " . $this->db->prepare_int($build_id); + } + + $result = $this->db->exec_query($sql); + + return $this->db->num_rows($result) ? 1 : 0; + } + + /* + * function: get_build_id_by_name + * + * Ignores case + * + * args : + * $tplan_id : test plan id. + * $build_name : build name. + * + * returns: + * The ID of the build name specified regardless of case. + * + * rev : + */ + public function get_build_id_by_name($tplan_id, $build_name) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT builds.id, builds.name, builds.notes " . + " FROM {$this->tables['builds']} builds " . + " WHERE builds.testplan_id = {$tplan_id} "; + + $build_name = strtoupper($build_name); + $sql .= " AND UPPER(builds.name)="; + $sql .= "'" . $this->db->prepare_string($build_name) . "'"; + + $recordset = $this->db->get_recordset($sql); + return $recordset ? intval($recordset[0]['id']) : 0; + } + + // Custom field related methods + /* + * function: get_linked_cfields_at_design + * + * args: $id + * [$parent_id]: testproject id + * [$show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * 0 or null -> don't filter + * + * returns: hash + * + * rev : + */ + public function get_linked_cfields_at_design($id, $parent_id = null, + $show_on_execution = null) + { + $path_len = 0; + if (is_null($parent_id)) { + // Need to get testplan parent (testproject id) in order to get custom fields + // 20081122 - franciscom - need to check when we can call this with ID=NULL + $the_path = $this->tree_manager->get_path( + ! is_null($id) ? $id : $parent_id); + $path_len = count($the_path); + } + $tproject_id = ($path_len > 0) ? $the_path[$path_len - 1]['parent_id'] : $parent_id; + + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + self::ENABLED, $show_on_execution, 'testplan', $id); + } + + /* + * function: get_linked_cfields_at_execution + * + * args: $id + * [$parent_id]: if present is testproject id + * [$show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * 0 or null -> don't filter + * + * returns: hash + * + * rev : + */ + private function getLinkedCfieldsAtExecution($id, $parent_id = null, + $show_on_execution = null) + { + $path_len = 0; + if (is_null($parent_id)) { + // Need to get testplan parent (testproject id) in order to get custom fields + // 20081122 - franciscom - need to check when we can call this with ID=NULL + $the_path = $this->tree_manager->get_path( + ! is_null($id) ? $id : $parent_id); + $path_len = count($the_path); + } + $tproject_id = ($path_len > 0) ? $the_path[$path_len - 1]['parent_id'] : $parent_id; + + // 20081122 - franciscom - humm!! need to look better IMHO this call is done to wrong function + return $this->cfield_mgr->get_linked_cfields_at_execution($tproject_id, + self::ENABLED, $show_on_execution, 'testplan', $id); + } + + /* + * Get Custom Fields Detail which are enabled on Execution of a TestCase/TestProject. + * function: get_linked_cfields_id + * + * args: $testproject_id + * + * returns: hash map of id : label + * + * rev : + * + */ + private function getLinkedCfieldsID($tproject_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT field_id,label + FROM {$this->tables['cfield_testprojects']} cfield_testprojects, {$this->tables['custom_fields']} custom_fields WHERE - custom_fields.id = cfield_testprojects.field_id - and cfield_testprojects.active = 1 - and custom_fields.enable_on_execution = 1 - and custom_fields.show_on_execution = 1 - and cfield_testprojects.testproject_id = " . $this->db->prepare_int($tproject_id) . - "order by field_id"; - - $field_map = $this->db->fetchColumnsIntoMap($sql,'field_id','label'); - return($field_map); - } - - /* - function: html_table_of_custom_field_inputs - - - args: $id - [$parent_id]: need when you call this method during the creation - of a test suite, because the $id will be 0 or null. - - [$scope]: 'design','execution' - - returns: html string - - */ - function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design',$name_suffix='',$input_values=null) - { - $cf_smarty=''; - $method_suffix = $scope=='design' ? $scope : 'execution'; - $method_name = "get_linked_cfields_at_{$method_suffix}"; - $cf_map=$this->$method_name($id,$parent_id); - - if(!is_null($cf_map)) - { - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - } - return($cf_smarty); - } - - - /* - function: html_table_of_custom_field_values - - args: $id - [$scope]: 'design','execution' - - [$filters]:default: null - - map with keys: - - [show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - include ONLY custom fields that can be viewed - while user is execution testcases. - - 0 or null -> don't filter - - returns: html string - - rev : - 20080811 - franciscom - BUGID 1650 (REQ) - 20070701 - franciscom - fixed return string when there are no custom fields. - */ - function html_table_of_custom_field_values($id,$scope='design',$filters=null,$formatOptions=null) - { - $cf_smarty=''; - $parent_id=null; - $label_css_style=' class="labelHolder" ' ; - $value_css_style = ' '; - - $add_table=true; - $table_style=''; - if( !is_null($formatOptions) ) - { - $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; - $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; - - $add_table=isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; - $table_style=isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; - } - - $show_cf = config_get('custom_fields')->show_custom_fields_without_value; - if( $scope=='design' ) - { - $cf_map=$this->get_linked_cfields_at_design($id,$parent_id,$filters); - } - else - { - $cf_map=$this->get_linked_cfields_at_execution($id); - } - - if( !is_null($cf_map) ) - { - foreach($cf_map as $cf_id => $cf_info) - { - // if user has assigned a value, then node_id is not null - // BUGID 3989 - if(isset($cf_info['node_id']) || $cf_info['node_id'] || $show_cf) - { - // true => do not create input in audit log - $label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true)); - $cf_smarty .= "" . htmlspecialchars($label) . "" . - "" . - $this->cfield_mgr->string_custom_field_value($cf_info,$id) . "\n"; - } - } - } - - if($cf_smarty != '' && $add_table) - { - $cf_smarty = "" . $cf_smarty . "
    "; - } - return($cf_smarty); - } // function end - - - /* - function: filterByOnDesignCustomFields - Filter on values of custom fields that are managed - ON DESIGN Area (i.e. when creating Test Specification). - - @used by getLinkedItems() in file execSetResults.php - - args : - $tp_tcs - key: test case ID - value: map with keys tcase_id,tcversion_id,... - - $cf_hash [cf_id] = value of cfields to filter by. - - returns: array filtered by selected custom fields. - - @internal revisions - - */ - function filterByOnDesignCustomFields($tp_tcs, $cf_hash) - { - $new_tp_tcs = null; - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $or_clause = ''; - $cf_query = ''; - $ignored = 0; - $doFilter = false; - $doIt = true; - - if (isset($cf_hash)) - { - $countmain = 1; - foreach ($cf_hash as $cf_id => $cf_value) - { - // single value or array? - if (is_array($cf_value)) - { - $count = 1; - $cf_query .= $or_clause; - foreach ($cf_value as $value) - { - if ($count > 1) - { - $cf_query .= " AND "; - } - $cf_query .= " ( CFD.value LIKE '%{$value}%' AND CFD.field_id = {$cf_id} )"; - $count++; - } - } - else - { - // Because cf value can NOT exists on DB depending on system config. - if( trim($cf_value) != '') - { - $cf_query .= $or_clause; - $cf_query .= " ( CFD.value LIKE '%{$cf_value}%' AND CFD.field_id = {$cf_id} ) "; - } - else - { - $ignored++; - } - } - - if($or_clause == '') - { - $or_clause = ' OR '; - } - } - - // grand finale - if( $cf_query != '') - { - $cf_query = " AND ({$cf_query}) "; - $doFilter = true; - } - } - $cf_qty = count($cf_hash) - $ignored; - $doIt = !$doFilter; - foreach ($tp_tcs as $tc_id => $tc_value) - { - if( $doFilter ) - { - $sql = " /* $debugMsg */ SELECT CFD.value FROM {$this->tables['cfield_design_values']} CFD," . - " {$this->tables['nodes_hierarchy']} NH" . - " WHERE CFD.node_id = NH.id " . - " AND NH.parent_id = {$tc_value['tcase_id']} " . - " {$cf_query} "; - - $rows = $this->db->fetchColumnsIntoArray($sql,'value'); //BUGID 4115 - - // if there exist as many rows as custom fields to be filtered by => tc does meet the criteria - // TO CHECK - 20140126 - Give a look to treeMenu.inc.php - filter_by_cf_values() - // to understand if both logics are coerent. - // - $doIt = (count($rows) == $cf_qty); - } - if( $doIt ) - { - $new_tp_tcs[$tc_id] = $tp_tcs[$tc_id]; - } - } - return ($new_tp_tcs); - } - - - - - - /* - function: get_estimated_execution_time - - Takes all testcases linked to testplan and computes - SUM of values assigned AT DESIGN TIME to customa field - named CF_ESTIMATED_EXEC_TIME - - IMPORTANT: - 1. at time of this writting (20080820) this CF can be of type: string,numeric or float. - 2. YOU NEED TO USE . (dot) as decimal separator (US decimal separator?) or - sum will be wrong. - - - - args:id testplan id - itemSet: default null - can be an arry with test case VERSION ID - - returns: sum of CF values for all testcases linked to testplan - - rev: - - */ - function get_estimated_execution_time($id,$itemSet=null,$platformID=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - - // check if cf exist and is assigned and active intest plan parent (TEST PROJECT) - $pinfo = $this->tree_manager->get_node_hierarchy_info($id); - $cf_info = $this->cfield_mgr->get_linked_to_testproject($pinfo['parent_id'],1,array('name' => 'CF_ESTIMATED_EXEC_TIME')); - if( is_null($cf_info) ) - { - return $this->getEstimatedExecutionTime($id,$itemSet,$platformID); - } - else - { - return $this->getEstimatedExecutionTimeFromCF($id,$itemSet,$platformID); - } - - } - - /** - * - */ - function getEstimatedExecutionTime($id,$itemSet=null,$platformID=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - - $tcVersionIDSet = array(); - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => true); - $platformSet = array_keys($this->getPlatforms($id,$getOpt)); - - if( is_null($itemSet) ) - { - // we need to loop over all linked PLATFORMS (if any) - $tcVersionIDSet = array(); - foreach($platformSet as $platfID) - { - if(is_null($platformID) || $platformID == $platfID ) - { - $linkedItems = $this->get_linked_tcvid($id,$platfID,array('addEstimatedExecDuration' => true)); - if( (!is_null($linkedItems)) ) - { - $tcVersionIDSet[$platfID]= $linkedItems; - } - } - } - } - else - { - // Important NOTICE - // we can found SOME LIMITS on number of elements on IN CLAUSE - // need to make as many set as platforms linked to test plan - $sql4tplantcv = " /* $debugMsg */ SELECT tcversion_id, platform_id,TCV.estimated_exec_duration " . - " FROM {$this->tables['testplan_tcversions']} " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = tcversion_id " . - " WHERE testplan_id=" . intval($id) . - " AND tcversion_id IN (" . implode(',',$itemSet) . ")"; - if( !is_null($platformID) ) - { - $sql4tplantcv .= " AND platform_id= " . intval($platformID); - } - - $rs = $this->db->fetchRowsIntoMap($sql4tplantcv,'platform_id',database::CUMULATIVE); - foreach($rs as $platfID => $elem) - { - $tcVersionIDSet[$platfID] = $elem; - } - } - - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - foreach($tcVersionIDSet as $platfID => $items) - { - $estimated['platform'][$platfID]['minutes'] = 0; - $estimated['platform'][$platfID]['tcase_qty'] = count($items); - foreach($items as $dx) - { - if(!is_null($dx['estimated_exec_duration'])) - { - $estimated['platform'][$platfID]['minutes'] += $dx['estimated_exec_duration']; - } - } - $estimated['totalMinutes'] += $estimated['platform'][$platfID]['minutes']; - $estimated['totalTestCases'] += $estimated['platform'][$platfID]['tcase_qty']; - } - - return $estimated; - } - - - /** - * - */ - function getEstimatedExecutionTimeFromCF($id,$itemSet=null,$platformID=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - $cf_info = $this->cfield_mgr->get_by_name('CF_ESTIMATED_EXEC_TIME'); - - // CF exists ? - if( ($status_ok=!is_null($cf_info)) ) - { - $cfield_id=key($cf_info); - } - - if( $status_ok) - { - $tcVersionIDSet = array(); - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => true); - $platformSet = array_keys($this->getPlatforms($id,$getOpt)); - - $sql = " /* $debugMsg */ "; - if( DB_TYPE == 'mysql') - { - $sql .= " SELECT SUM(value) "; - } - else if ( DB_TYPE == 'postgres' || DB_TYPE == 'mssql' ) - { - $sql .= " SELECT SUM(CAST(value AS NUMERIC)) "; - } - - $sql .= " AS SUM_VALUE FROM {$this->tables['cfield_design_values']} CFDV " . - " WHERE CFDV.field_id={$cfield_id} "; - - if( is_null($itemSet) ) - { - // 20110112 - franciscom - // we need to loop over all linked PLATFORMS (if any) - $tcVersionIDSet = array(); - foreach($platformSet as $platfID) - { - if(is_null($platformID) || $platformID == $platfID ) - { - $linkedItems = $this->get_linked_tcvid($id,$platfID); - if( (!is_null($linkedItems)) ) - { - $tcVersionIDSet[$platfID]= array_keys($linkedItems); - } - } - } - } - else - { - // Important NOTICE - // we can found SOME LIMITS on number of elements on IN CLAUSE - // - // need to make as many set as platforms linked to test plan - $sql4tplantcv = " /* $debugMsg */ SELECT tcversion_id, platform_id " . - " FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id=" . intval($id) . - " AND tcversion_id IN (" . implode(',',$itemSet) . ")"; - - if( !is_null($platformID) ) - { - $sql4tplantcv .= " AND platform_id= " . intval($platformID); - } - - $rs = $this->db->fetchColumnsIntoMap($sql4tplantcv,'platform_id','tcversion_id', - database::CUMULATIVE); - foreach($rs as $platfID => $elem) - { - $tcVersionIDSet[$platfID] = array_values($elem); - } - } - } - - if($status_ok) - { - // Important NOTICE - // we can found SOME LIMITS on number of elements on IN CLAUSE - // - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - foreach($tcVersionIDSet as $platfID => $items) - { - $sql2exec = $sql . " AND node_id IN (" . implode(',',$items) . ")"; - $dummy = $this->db->fetchOneValue($sql2exec); - $estimated['platform'][$platfID]['minutes'] = is_null($dummy) ? 0 : $dummy; - $estimated['platform'][$platfID]['tcase_qty'] = count($items); - - $estimated['totalMinutes'] += $estimated['platform'][$platfID]['minutes']; - $estimated['totalTestCases'] += $estimated['platform'][$platfID]['tcase_qty']; - } - } - return $estimated; - } - - - /* - function: get_execution_time - Takes all executions or a subset of executions, regarding a testplan and - computes SUM of values assigned AT EXECUTION TIME to custom field named CF_EXEC_TIME - - IMPORTANT: - 1. at time of this writting (20081207) this CF can be of type: string,numeric or float. - 2. YOU NEED TO USE . (dot) as decimal separator (US decimal separator?) or - sum will be wrong. - - args:id testplan id - $execIDSet: default null - - returns: sum of CF values for all testcases linked to testplan - - rev: - @internal revision - */ - function get_execution_time($context,$execIDSet=null) - { - // check if cf exist and is assigned and active intest plan parent (TEST PROJECT) - $pinfo = $this->tree_manager->get_node_hierarchy_info($id); - $cf_info = $this->cfield_mgr->get_linked_to_testproject($pinfo['parent_id'],1,array('name' => 'CF_EXEC_TIME')); - if( is_null($cf_info) ) - { - return $this->getExecutionTime($context,$execIDSet); - } - else - { - return $this->getExecutionTimeFromCF($context->tplan_id,$execIDSet, - $context->platform_id); - } - } - - - /** - * - */ - function getExecutionTime($context,$execIDSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $total_time = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - $targetSet = array(); - - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => true); - $platformSet = array_keys($this->getPlatforms($context->tplan_id,$getOpt)); - - if( is_null($execIDSet) ) - { - $filters = null; - if( !is_null($context->platform_id) ) - { - $filters = array('platform_id' => $context->platform_id); - } - - if( !is_null($context->build_id) && $context->build_id > 0) - { - $filters['build_id'] = $context->build_id; - } - - - // we will compute time for ALL linked and executed test cases, - // BUT USING ONLY TIME SPEND for LATEST executed TCVERSION - $options = array('addExecInfo' => true); - $executed = $this->getLTCVNewGeneration($context->tplan_id,$filters,$options); - - if( ($status_ok = !is_null($executed)) ) - { - $tc2loop = array_keys($executed); - foreach($tc2loop as $tcase_id) - { - $p2loop = array_keys($executed[$tcase_id]); - foreach($p2loop as $platf_id) - { - $targetSet[$platf_id][]=array('id' => $executed[$tcase_id][$platf_id]['exec_id'], - 'duration' => $executed[$tcase_id][$platf_id]['execution_duration']); - } - } - } - } - else - { - // If user has passed in a set of exec id, we assume that - // he has make a good work, i.e. if he/she wanted just analize - // executions for just a PLATFORM he/she has filtered BEFORE - // passing in input to this method the item set. - // Then we will IGNORE value of argument platformID to avoid - // run a second (and probably useless query). - // We will use platformID JUST as index for output result - if( is_null($context->platform_id) ) - { - throw new Exception(__FUNCTION__ . ' When you pass $execIDSet an YOU NEED TO PROVIDE a platform ID'); - } - $targetSet[$context->platform_id] = $this->getExecutionDurationForSet($execIDSet); - } - - foreach($targetSet as $platfID => $itemSet) - { - $total_time['platform'][$platfID]['minutes'] = 0; - $total_time['platform'][$platfID]['tcase_qty'] = count($itemSet); - foreach($itemSet as $dx) - { - if(!is_null($dx['duration'])) - { - $total_time['platform'][$platfID]['minutes'] += $dx['duration']; - } - } - - $total_time['totalMinutes'] += $total_time['platform'][$platfID]['minutes']; - $total_time['totalTestCases'] += $total_time['platform'][$platfID]['tcase_qty']; - } - return $total_time; - } - - - /** - * - */ - function getExecutionTimeFromCF($id,$execIDSet=null,$platformID=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $total_time = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - $targetSet = array(); - $cf_info = $this->cfield_mgr->get_by_name('CF_EXEC_TIME'); - - // CF exists ? - if( ($status_ok=!is_null($cf_info)) ) - { - $cfield_id=key($cf_info); - } - - - if( $status_ok) - { - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => true); - $platformSet = array_keys($this->getPlatforms($id,$getOpt)); - - // ---------------------------------------------------------------------------- - $sql="SELECT SUM(CAST(value AS NUMERIC)) "; - if( DB_TYPE == 'mysql') - { - $sql="SELECT SUM(value) "; - } - else if ( DB_TYPE == 'postgres' || DB_TYPE == 'mssql' ) - { - $sql="SELECT SUM(CAST(value AS NUMERIC)) "; - } - $sql .= " AS SUM_VALUE FROM {$this->tables['cfield_execution_values']} CFEV " . - " WHERE CFEV.field_id={$cfield_id} " . - " AND testplan_id={$id} "; - // ---------------------------------------------------------------------------- - - if( is_null($execIDSet) ) - { - - $filters = null; - if( !is_null($platformID) ) - { - $filters = array('platform_id' => $platformID); - } - - // we will compute time for ALL linked and executed test cases, - // BUT USING ONLY TIME SPEND for LAST executed TCVERSION - // $options = array('only_executed' => true, 'output' => 'mapOfMap'); - $options = array('addExecInfo' => true); - $executed = $this->getLTCVNewGeneration($id,$filters,$options); - if( ($status_ok = !is_null($executed)) ) - { - $tc2loop = array_keys($executed); - foreach($tc2loop as $tcase_id) - { - $p2loop = array_keys($executed[$tcase_id]); - foreach($p2loop as $platf_id) - { - $targetSet[$platf_id][]=$executed[$tcase_id][$platf_id]['exec_id']; - } - } - } - } - else - { - // If user has passed in a set of exec id, we assume that - // he has make a good work, i.e. if he/she wanted just analize - // executions for just a PLATFORM he/she has filtered BEFORE - // passing in input to this method the item set. - // Then we will IGNORE value of argument platformID to avoid - // run a second (and probably useless query). - // We will use platformID JUST as index for output result - - if( is_null($platformID) ) - { - throw new Exception(__FUNCTION__ . ' When you pass $execIDSet an YOU NEED TO PROVIDE a platform ID'); - } - $targetSet[$platformID] = $execIDSet; - } - } - - if($status_ok) - { - // Important NOTICE - // we can found SOME LIMITS on number of elements on IN CLAUSE - // - $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); - foreach($targetSet as $platfID => $items) - { - $sql2exec = $sql . " AND execution_id IN (" . implode(',',$items) . ")"; - - $dummy = $this->db->fetchOneValue($sql2exec); - $total_time['platform'][$platfID]['minutes'] = is_null($dummy) ? 0 : $dummy; - $total_time['platform'][$platfID]['tcase_qty'] = count($items); - - $total_time['totalMinutes'] += $total_time['platform'][$platfID]['minutes']; - $total_time['totalTestCases'] += $total_time['platform'][$platfID]['tcase_qty']; - } - } - - - - return $total_time; - } - - - - - - - /* - function: get_prev_builds() - - args: id: testplan id - build_id: all builds belonging to choosen testplan, - with id < build_id will be retreived. - [active]: default null -> do not filter on active status - - returns: - - */ - function get_prev_builds($id,$build_id,$active=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id = {$id} AND id < {$build_id}" ; - - if( !is_null($active) ) - { - $sql .= " AND active=" . intval($active) . " "; - } - - $recordset = $this->db->fetchRowsIntoMap($sql,'id'); - return $recordset; - } - - - /** - * returns set of tcversions that has same execution status - * in every build present on buildSet for selected Platform. - * - * id: testplan id - * buildSet: builds to analise. - * status: status code (can be an array) - * - */ - function get_same_status_for_build_set($id, $buildSet, $status, $platformID=NULL) - { - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $node_types = $this->tree_manager->get_available_node_types(); - $num_exec = count($buildSet); - $build_in = implode(",", $buildSet); - $status_in = implode("',", (array)$status); - - $tcversionPlatformString = ""; - $executionPlatformString = ""; - if($platformid) { - $tcversionPlatformString = "AND T.platform_id=$platformid"; - $executionPlatformString = "AND E.platform_id=$platformid"; - } - - $first_results = null; - if( in_array($this->notRunStatusCode, (array)$status) ) - { - - $sql = " /* $debugMsg */ SELECT distinct T.tcversion_id,E.build_id,NH.parent_id AS tcase_id " . - " FROM {$this->tables['testplan_tcversions']} T " . - " JOIN {$this->tables['nodes_hierarchy']} NH ON T.tcversion_id=NH.id " . - " AND NH.node_type_id={$node_types['testcase_version']} " . - " LEFT OUTER JOIN {$this->tables['executions']} E ON T.tcversion_id = E.tcversion_id " . - " AND T.testplan_id=E.testplan_id AND E.build_id IN ({$build_in}) " . - " WHERE T.testplan_id={$id} AND E.build_id IS NULL "; - - $first_results = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - } - - $sql = " SELECT EE.status,SQ1.tcversion_id, NH.parent_id AS tcase_id, COUNT(EE.status) AS exec_qty " . - " FROM {$this->tables['executions']} EE, {$this->tables['nodes_hierarchy']} NH," . - " (SELECT E.tcversion_id,E.build_id,MAX(E.id) AS last_exec_id " . - " FROM {$this->tables['executions']} E " . - " WHERE E.build_id IN ({$build_in}) " . - " GROUP BY E.tcversion_id,E.build_id) AS SQ1 " . - " WHERE EE.build_id IN ({$build_in}) " . - " AND EE.status IN ('" . $status . "') AND NH.node_type_id={$node_types['testcase_version']} " . - " AND SQ1.last_exec_id=EE.id AND SQ1.tcversion_id=NH.id " . - " GROUP BY status,SQ1.tcversion_id,NH.parent_id" . - " HAVING COUNT(EE.status)= {$num_exec} " ; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - - if (count($first_results)) { - foreach ($first_results as $key => $value) { - $recordset[$key] = $value; - } - } - - return $recordset; - } - - - - /** - * BUGID 2455, BUGID 3026 - * find all builds for which a testcase has not been executed - * - * @author asimon - * @param integer $id Build ID - * @param array $buildSet build set to check - * @return array $new_set set of builds which match the search criterium - * @internal revisions - * 20101215 - asimon - BUGID 4023: correct filtering also with platforms - */ - function get_not_run_for_any_build($id, $buildSet, $platformid=NULL) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $node_types=$this->tree_manager->get_available_node_types(); - - $results = array(); - - $tcversionPlatformString = ""; - $executionPlatformString = ""; - if($platformid) { - $tcversionPlatformString = "AND T.platform_id=$platformid"; - $executionPlatformString = "AND E.platform_id=$platformid"; - } - - foreach ($buildSet as $build) { - $sql = "/* $debugMsg */ SELECT distinct T.tcversion_id, E.build_id, E.status, NH.parent_id AS tcase_id " . - " FROM {$this->tables['testplan_tcversions']} T " . - " JOIN {$this->tables['nodes_hierarchy']} NH ON T.tcversion_id=NH.id AND NH.node_type_id=4 " . - " LEFT OUTER JOIN {$this->tables['executions']} E ON T.tcversion_id = E.tcversion_id " . - " AND T.testplan_id=E.testplan_id AND E.build_id=$build $executionPlatformString" . - " WHERE T.testplan_id={$id} AND E.status IS NULL $tcversionPlatformString"; - $results[] = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - } - - $recordset = array(); - foreach ($results as $result) - { - if (!is_null($result) && (is_array($result)) ) //BUGID 3806 - { - $recordset = array_merge_recursive($recordset, $result); - } - } - $new_set = array(); - foreach ($recordset as $key => $val) { - $new_set[$val['tcase_id']] = $val; - } - - return $new_set; - } - - - /** - * link platforms to a new Test Plan - * - * @param int $source_id original Test Plan id - * @param int $target_id new Test Plan id - * @param array $mappings: key source platform id, target platform id - * USED when copy is done to a test plan that BELONGS to - * another Test Project. - */ - private function copy_platforms_links($source_id, $target_id, $mappings = null) - { - $sourceLinks = $this->platform_mgr->getLinkedToTestplanAsMap($source_id); - if( !is_null($sourceLinks) ) - { - $sourceLinks = array_keys($sourceLinks); - if( !is_null($mappings) ) - { - foreach($sourceLinks as $key => $value) - { - $sourceLinks[$key] = $mappings[$value]; - } - } - $this->platform_mgr->linkToTestplan($sourceLinks,$target_id); - } - } - - /** - * link attachments to a new Test Plan - * - * @param int $source_id original Test Plan id - * @param int $target_id new Test Plan id - */ - private function copy_attachments($source_id, $target_id) - { - $this->attachmentRepository->copyAttachments($source_id,$target_id,$this->attachmentTableName); - } - - /** - * - * - * outputFormat: - * 'array', - * 'map', - * 'mapAccessByID' => map access key: id - * 'mapAccessByName' => map access key: name - * - */ - function getPlatforms($id,$options=null) { - $my['options'] = array('outputFormat' => 'array', 'outputDetails' => 'full', 'addIfNull' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - switch($my['options']['outputFormat']) { - case 'map': - $platforms = $this->platform_mgr->getLinkedToTestplanAsMap($id); - break; - - default: - $opt = array('outputFormat' => $my['options']['outputFormat']); - $platforms = $this->platform_mgr->getLinkedToTestplan($id,$opt); - break; - } - - if( !is_null($platforms) ) { - switch($my['options']['outputDetails']) { - case 'name': - foreach($platforms as $id => $elem) { - $platforms[$id] = $elem['name']; - } - break; - - default: - break; - } - } else if( $my['options']['addIfNull'] ) { - $platforms = array( 0 => ''); - } - return $platforms; - } - - /** - * Logic to determine if platforms should be visible for a given testplan. - * @return bool true if the testplan has one or more linked platforms; - * otherwise false. - */ - function hasLinkedPlatforms($id) { - return $this->platform_mgr->platformsActiveForTestplan($id); - } - - - - /** - * changes platform id on a test plan linked test case versions for - * a target platform. - * Corresponding executions information is also updated - * - * @param id: test plan id - * @param from: plaftorm id to update (used as filter criteria). - * @param to: new plaftorm id value - * @param tcversionSet: default null, can be array with tcversion id - * (used as filter criteria). - * - * - */ - function changeLinkedTCVersionsPlatform($id,$from,$to,$tcversionSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sqlFilter = ''; - if( !is_null($tcversionSet) ) - { - $sqlFilter = " AND tcversion_id IN (" . implode(',',(array)$tcversionSet) . " ) "; - } - $whereClause = " WHERE testplan_id = {$id} AND platform_id = {$from} {$sqlFilter}"; - - $sqlStm = array(); - $sqlStm[] = "/* {$debugMsg} */ " . - " UPDATE {$this->tables['testplan_tcversions']} " . - " SET platform_id = {$to} " . $whereClause; - - $sqlStm[] = "/* {$debugMsg} */" . - " UPDATE {$this->tables['executions']} " . - " SET platform_id = {$to} " . $whereClause; - - foreach($sqlStm as $sql) - { - $this->db->exec_query($sql); - } - } - - /** - * - * @param id: test plan id - * @param platformSet: default null, used as filter criteria. - * @return map: key platform id, values count,platform_id - */ - public function countLinkedTCVersionsByPlatform($id,$platformSet=null) - { - $sqlFilter = ''; - if( !is_null($platformSet) ) - { - $sqlFilter = " AND platform_id IN (" . implode(',',(array)$platformSet). ") "; - } - $sql = " SELECT COUNT(testplan_id) AS qty,platform_id " . - " FROM {$this->tables['testplan_tcversions']} " . - " WHERE testplan_id={$id} {$sqlFilter} " . - " GROUP BY platform_id "; - $rs = $this->db->fetchRowsIntoMap($sql,'platform_id'); - return $rs; - } - - - - /** - * - * - */ - public function getStatusForReports() - { - // 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) - { - $code_verbose[$this->resultsCfg['status_code'][$tc_status_verbose]] = $tc_status_verbose; - } - if( !isset($this->resultsCfg['status_label_for_exec_ui']['not_run']) ) - { - $code_verbose[$this->resultsCfg['status_code']['not_run']] = 'not_run'; - } - return $code_verbose; - } - - - - /** - * getTestCaseSiblings() - * - * @internal revisions - */ - function getTestCaseSiblings($id,$tcversion_id,$platform_id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('assigned_to' => null); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = " SELECT NHTSET.name as testcase_name,NHTSET.id AS testcase_id , NHTCVSET.id AS tcversion_id," . - " NHTC.parent_id AS testsuite_id, " . - " TPTCVX.id AS feature_id, TPTCVX.node_order, TCV.tc_external_id " . - " from {$this->tables['testplan_tcversions']} TPTCVMAIN " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCVMAIN.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTSET ON NHTSET.parent_id = NHTC.parent_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCVSET ON NHTCVSET.parent_id = NHTSET.id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCVSET.id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCVX " . - " ON TPTCVX.tcversion_id = NHTCVSET.id " . - " AND TPTCVX.testplan_id = TPTCVMAIN.testplan_id " . - " AND TPTCVX.platform_id = TPTCVMAIN.platform_id "; - - if( !is_null($my['opt']['assigned_to']) ) - { - $user_id = intval($my['opt']['assigned_to']['user_id']); - $build_id = intval($my['opt']['assigned_to']['build_id']); - - $addJoin = " /* Analise user assignment to get sibling */ " . - " JOIN {$this->tables['user_assignments']} UAMAIN " . - " ON UAMAIN.feature_id = TPTCVMAIN.id " . - " AND UAMAIN.build_id = " . $build_id . - " AND UAMAIN.user_id = " . $user_id . - " AND UAMAIN.type = {$this->execTaskCode} " . - " JOIN {$this->tables['user_assignments']} UAX " . - " ON UAX.feature_id = TPTCVX.id " . - " AND UAX.build_id = " . $build_id . - " AND UAX.user_id = " . $user_id . - " AND UAX.type = {$this->execTaskCode} "; - $sql .= $addJoin; - - } - - $sql .= " WHERE TPTCVMAIN.testplan_id = {$id} AND TPTCVMAIN.tcversion_id = {$tcversion_id} " . - " AND TPTCVMAIN.platform_id = {$platform_id} " . - " ORDER BY node_order,tc_external_id "; - - // " ORDER BY node_order,external_id,testcase_name "; - - $siblings = $this->db->fetchRowsIntoMap($sql,'tcversion_id'); - return $siblings; - } - - - /** - * getTestCaseNextSibling() - * - * @used-by execSetResults.php - * - */ - function getTestCaseNextSibling($id,$tcversion_id,$platform_id,$opt=null) - { - $my['opt'] = array('move' => 'forward', 'scope' => 'local'); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - - $sibling = null; - switch($my['opt']['scope']) - { - case 'world': - $tptcv = $this->tables['testplan_tcversions']; - - $subq = " SELECT node_order FROM {$this->tables['testplan_tcversions']} TX " . - " WHERE TX.testplan_id = {$id} AND " . - " TX.tcversion_id = {$tcversion_id} "; - - if( $platform_id > 0) - { - $subq .= " AND TX.platform_id = {$platform_id} "; - } - $sql= " SELECT tcversion_id,node_order " . - " FROM {$tptcv} TZ " . - " WHERE TZ.testplan_id = {$id} AND " . - " TZ.tcversion_id <> {$tcversion_id} "; - if( $platform_id > 0) - { - $sql .= " AND TZ.platform_id = {$platform_id} "; - } - - $sql .= " ORDER BY TZ.node_order >= ($subq) "; - break; - - case 'local': - default: - $sib = $this->getTestCaseSiblings($id,$tcversion_id,$platform_id,$my['opt']); - break; - } - $tcversionSet = array_keys($sib); - $elemQty = count($tcversionSet); - $dummy = array_flip($tcversionSet); - - $pos = $dummy[$tcversion_id]; - switch($my['opt']['move']) - { - case 'backward': - $pos--; - $pos = $pos < 0 ? 0 : $pos; - break; - - case 'forward': - default: - $pos++; - break; - } - - $sibling_tcversion = $pos < $elemQty ? $tcversionSet[$pos] : 0; - if( $sibling_tcversion > 0 ) - { - $sibling = array('tcase_id' => $sib[$sibling_tcversion]['testcase_id'], - 'tcversion_id' => $sibling_tcversion); - } - return $sibling; - } - - /** - * Convert a given urgency and importance to a priority level using - * threshold values in $tlCfg->priority_levels. - * - * @param mixed $urgency Urgency of the testcase. - * If this is the only parameter given then interpret it as - * $urgency*$importance. - * @param mixed $importance Importance of the testcase. (Optional) - * - * @return int HIGH, MEDIUM or LOW - */ - public function urgencyImportanceToPriorityLevel($urgency, $importance=null) - { - $urgencyImportance = intval($urgency) * (is_null($importance) ? 1 : intval($importance)) ; - return priority_to_level($urgencyImportance); - } - - - /** - * create XML string with following structure - * - * - * - * - * - * - * - * - * - * - * ... - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * ... - * - * - * - * - * - */ - function exportLinkedItemsToXML($id) - { - $item_info = $this->get_by_id($id); - - // Linked platforms - $xml_root = "{{XMLCODE}}\n"; - - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl - // - $xml_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - - $xml_mapping = null; - $xml_mapping = array("||PLATFORMNAME||" => "platform_name", "||PLATFORMID||" => 'id'); - - $mm = (array)$this->platform_mgr->getLinkedToTestplanAsMap($id); - $loop2do = count($mm); - if( $loop2do > 0 ) - { - $items2loop = array_keys($mm); - foreach($items2loop as $itemkey) - { - $mm[$itemkey] = array('platform_name' => $mm[$itemkey], 'id' => $itemkey); - } - } - $linked_platforms = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping,('noXMLHeader'=='noXMLHeader')); - - // Linked test cases - $xml_root = "\n{{XMLCODE}}\n"; - $xml_template = "\n\t" . - "" . "\n" . - "\t\t" . "" . "\n" . - "\t\t\t" . "" . "\n" . - "\t\t" . "" . "\n" . - "\t\t" . "" . "\n" . - "\t\t\t" . "\n" . - "\t\t\t" . "\n" . - "\t\t\t" . "\n" . - "\t\t\t" . "\n" . - "\t\t" . "" . "\n" . - "" . "\n" . - - $xml_mapping = null; - $xml_mapping = array("||PLATFORMNAME||" => "platform_name","||EXTERNALID||" => "external_id", - "||NAME||" => "name","||VERSION||" => "version", - "||EXECUTION_ORDER||" => "execution_order"); - - $mm = $this->getLinkedStaticView($id,null,array('output' => 'array')); - $linked_testcases = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping,('noXMLHeader'=='noXMLHeader')); - - - $item_info['linked_platforms'] = $linked_platforms; - $item_info['linked_testcases'] = $linked_testcases; - $xml_root = "\n\t{{XMLCODE}}\n\t"; - $xml_template = "\n\t\t" . "" . "\n" . - "\t\t||LINKED_PLATFORMS||\n" . "\t\t||LINKED_TESTCASES||\n"; - - $xml_mapping = null; - $xml_mapping = array("||TESTPLANNAME||" => "name","||LINKED_PLATFORMS||" => "linked_platforms", - "||LINKED_TESTCASES||" => "linked_testcases"); - - $xml = exportDataToXML(array($item_info),$xml_root,$xml_template,$xml_mapping); - - return $xml; - } - - - - - /** - * create XML string with following structure - * - * - * - * @param mixed context: map with following keys - * platform_id: MANDATORY - * build_id: OPTIONAL - * tproject_id: OPTIONAL - */ - function exportTestPlanDataToXML($id,$context,$optExport = array()) - { - $platform_id = $context['platform_id']; - if( !isset($context['tproject_id']) || is_null($context['tproject_id']) ) - { - $dummy = $this->tree_manager->get_node_hierarchy_info($id); - $context['tproject_id'] = $dummy['parent_id']; - } - $context['tproject_id'] = intval($context['tproject_id']); - - $xmlTC = null; - - - // CRITIC - this has to be firt population of item_info. - // Other processes adds info to this map. - $item_info = $this->get_by_id($id); - - // Need to get family - $nt2exclude = array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me', - 'requirement'=> 'exclude_me'); - $nt2exclude_children = array('testcase' => 'exclude_my_children', - 'requirement_spec'=> 'exclude_my_children'); - - $my = array(); - - // this can be a litte weird but ... - // when - // 'order_cfg' => array("type" =>'exec_order' - // additional info test plan id, and platform id are used to get - // a filtered view of tree. - // - $order_cfg = array("type" =>'exec_order',"tplan_id" => $id); - if( $context['platform_id'] > 0 ) - { - $order_cfg['platform_id'] = $context['platform_id']; - } - $my['options']=array('recursive' => true, 'order_cfg' => $order_cfg, - 'remove_empty_nodes_of_type' => $this->tree_manager->node_descr_id['testsuite']); - $my['filters'] = array('exclude_node_types' => $nt2exclude,'exclude_children_of' => $nt2exclude_children); - $tplan_spec = $this->tree_manager->get_subtree($context['tproject_id'],$my['filters'],$my['options']); - - // ----------------------------------------------------------------------------------------------------- - // Generate test project info - $tproject_mgr = new testproject($this->db); - $tproject_info = $tproject_mgr->get_by_id($context['tproject_id']); - - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl - // - $xml_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - - $xml_root = "{{XMLCODE}}"; - $xml_mapping = null; - $xml_mapping = array("||TESTPROJECTNAME||" => "name", "||TESTPROJECTPREFIX||" => "prefix","||TESTPROJECTID||" => 'id'); - $mm = array(); - $mm[$context['tproject_id']] = array('name' => $tproject_info['name'],'prefix' => $tproject_info['prefix'], - 'id' => $context['tproject_id']); - $item_info['testproject'] = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping,('noXMLHeader'=='noXMLHeader')); - // ----------------------------------------------------------------------------------------------------- - - // ----------------------------------------------------------------------------------------------------- - // get target platform (if exists) - $target_platform = ''; - if( $context['platform_id'] > 0) - { - $info = $this->platform_mgr->getByID($context['platform_id']); - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl - // - $xml_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - - $xml_root = "{{XMLCODE}}"; - $xml_mapping = null; - $xml_mapping = array("||PLATFORMNAME||" => "platform_name", "||PLATFORMID||" => 'id'); - - $mm = array(); - $mm[$context['platform_id']] = array('platform_name' => $info['name'], 'id' => $context['platform_id']); - $item_info['target_platform'] = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping, - ('noXMLHeader'=='noXMLHeader')); - $target_platform = "\t\t||TARGET_PLATFORM||\n"; - } - // ----------------------------------------------------------------------------------------------------- - - // ----------------------------------------------------------------------------------------------------- - // get Build info (if possible) - $target_build = ''; - if( isset($context['build_id']) && $context['build_id'] > 0) - { - $dummy = $this->get_builds($id); - $info = $dummy[$context['build_id']]; - - // ||yyy||-> tags, {{xxx}} -> attribute - // tags and attributes receive different treatment on exportDataToXML() - // - // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl - // - $xml_template = "\n\t" . - "" . - "\t\t" . "" . - "\t\t" . "" . - "\n\t" . ""; - - $xml_root = "{{XMLCODE}}"; - $xml_mapping = null; - $xml_mapping = array("||BUILDNAME||" => "name", "||BUILDID||" => 'id'); - - $mm = array(); - $mm[$context['build_id']] = array('name' => $info['name'], 'id' => $context['build_id']); - $item_info['target_build'] = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping, - ('noXMLHeader'=='noXMLHeader')); - $target_build = "\t\t||TARGET_BUILD||\n"; - } - // ----------------------------------------------------------------------------------------------------- - - // ----------------------------------------------------------------------------------------------------- - // get test plan contents (test suites and test cases) - $item_info['testsuites'] = null; - if( !is_null($tplan_spec) && isset($tplan_spec['childNodes']) && ($loop2do = count($tplan_spec['childNodes'])) > 0) - { - $item_info['testsuites'] = '' . - $this->exportTestSuiteDataToXML($tplan_spec,$context['tproject_id'],$id, - $context['platform_id'],$context['build_id']) . - ''; - } - - $xml_root = "\n\t{{XMLCODE}}\n\t"; - $xml_template = "\n\t\t" . "" . "\n" . - "\t\t||TESTPROJECT||\n" . $target_platform . $target_build . "\t\t||TESTSUITES||\n"; - - $xml_mapping = null; - $xml_mapping = array("||TESTPLANNAME||" => "name", "||TESTPROJECT||" => "testproject", - "||TARGET_PLATFORM||" => "target_platform","||TARGET_BUILD||" => "target_build", - "||TESTSUITES||" => "testsuites"); - - $zorba = exportDataToXML(array($item_info),$xml_root,$xml_template,$xml_mapping); - - return $zorba; - } - - - /** - * - * - */ - private function exportTestSuiteDataToXML($container,$tproject_id,$tplan_id,$platform_id,$build_id) - { - static $keywordMgr; - static $getLastVersionOpt = array('output' => 'minimun'); - static $tcaseMgr; - static $tsuiteMgr; - static $tcaseExportOptions; - static $linkedItems; - - if(is_null($keywordMgr)) - { - $tcaseExportOptions = array('CFIELDS' => true, 'KEYWORDS' => true, 'EXEC_ORDER' => 0); - $keywordMgr = new tlKeyword(); - $tsuiteMgr = new testsuite($this->db); - $linkedItems = $this->getLinkedItems($tplan_id); - } - - $xmlTC = null; - $cfXML = null; - $kwXML = null; - - if( isset($container['id']) ) - { - $kwMap = $tsuiteMgr->getKeywords($container['id']); - if ($kwMap) - { - $kwXML = "" . $keywordMgr->toXMLString($kwMap,true) . ""; - } - - $cfMap = (array)$tsuiteMgr->get_linked_cfields_at_design($container['id'],null,null,$tproject_id); - if( count($cfMap) > 0 ) - { - $cfXML = $this->cfield_mgr->exportValueAsXML($cfMap); - } - - $tsuiteData = $tsuiteMgr->get_by_id($container['id']); - $xmlTC = "\n\t' . - "\n\t\t" . - "\n\t\t
    " . - "\n\t\t{$kwXML}{$cfXML}
    "; - } - $childNodes = isset($container['childNodes']) ? $container['childNodes'] : null ; - if( !is_null($childNodes) ) - { - $loop_qty=sizeof($childNodes); - for($idx = 0;$idx < $loop_qty;$idx++) - { - $cNode = $childNodes[$idx]; - switch($cNode['node_table']) - { - case 'testsuites': - $xmlTC .= $this->exportTestSuiteDataToXML($cNode,$tproject_id,$tplan_id,$platform_id,$build_id); - break; - - case 'testcases': - if( is_null($tcaseMgr) ) - { - $tcaseMgr = new testcase($this->db); - } - // testcase::LATEST_VERSION, - $tcaseExportOptions['EXEC_ORDER'] = $linkedItems[$cNode['id']][$platform_id]['node_order']; - - $filter_lv = array( 'exec_status' => 'ALL', 'active_status' => 'ALL','tplan_id' => $tplan_id, 'platform_id' => $platform_id ); - $output_lv = array( 'output' => 'simple' ); - // get tc versions linked in current testplan for current platform - $info = $tcaseMgr->get_linked_versions($cNode['id'],$filter_lv,$output_lv); - if( !is_null($info) ) - { - $tcversID = key($info); - } - - // get users assigned to tc version in current testplan for the current build - $versionAssignInfo = $tcaseMgr->get_version_exec_assignment($tcversID, $tplan_id, $build_id ); - $userList = array(); - // extract user names - if(!is_null($versionAssignInfo)) - { - foreach($versionAssignInfo[$tcversID][$platform_id] as $vaInfo) - { - $assignedTesterId = intval($vaInfo['user_id']); - if($assignedTesterId) - { - $user = tlUser::getByID($this->db,$assignedTesterId); - if ($user) - { - $userList[] = $user->getDisplayName(); - } - } - } - } - (count($userList) > 0) ? $tcaseExportOptions['ASSIGNED_USER'] = $userList : $tcaseExportOptions['ASSIGNED_USER'] = null; - - $xmlTC .= $tcaseMgr->exportTestCaseDataToXML($cNode['id'],$cNode['tcversion_id'], - $tproject_id,testcase::NOXMLHEADER, - $tcaseExportOptions); - break; - } - } - } - - if( isset($container['id']) ) - { - $xmlTC .= "
    "; - } - return $xmlTC; - } - - - - /** - * - */ - function getFeatureAssignments($tplan_id,$filters=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ "; - - $my['filters'] = array('build' => null, 'tcversion' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $sql .= " SELECT COALESCE(UA.user_id,-1) AS user_id, " . - " TPTCV.id AS feature_id, B.id AS build_id, TPTCV.platform_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - - " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id AND UA.build_id = B.id " . - " WHERE TPTCV.testplan_id={$tplan_id} "; - - if(!is_null($my['filters']['build'])) - { - $sql .= " AND B.id IN (" . implode(',',(array)$my['filters']['build']) . ") "; - } - if(!is_null($my['filters']['tcversion'])) - { - $sql .= " AND TPTCV.tcversion_id IN (" . implode(',',(array)$my['filters']['tcversion']) . ") "; - } - - $rs = $this->db->fetchMapRowsIntoMap($sql,'feature_id','build_id'); - return $rs; - } // end function - - - - /** - * getSkeleton - * - * get structure with Test suites and Test Cases - * Filters that act on test cases work on attributes that are common to all - * test cases versions: test case name - * - * Development Note: - * Due to the tree structure is not so easy to try to do as much as filter as - * possibile using SQL. - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getSkeleton($id,$tprojectID,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $items = array(); - $my['options'] = array('recursive' => false, 'exclude_testcases' => false, - 'remove_empty_branches' => false); - - $my['filters'] = array('exclude_node_types' => $this->nt2exclude, - 'exclude_children_of' => $this->nt2exclude_children, - 'exclude_branches' => null, - 'testcase_name' => null,'testcase_id' => null, - 'execution_type' => null, 'platform_id' => null, - 'additionalWhereClause' => null); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - if( $my['options']['exclude_testcases'] ) - { - $my['filters']['exclude_node_types']['testcase']='exclude me'; - } - - // transform some of our options/filters on something the 'worker' will understand - // when user has request filter by test case name, we do not want to display empty branches - - // If we have choose any type of filter, we need to force remove empty test suites - // - if( !is_null($my['filters']['testcase_name']) || !is_null($my['filters']['testcase_id']) || - !is_null($my['filters']['execution_type']) || !is_null($my['filters']['exclude_branches']) || - !is_null($my['filters']['platform_id']) || $my['options']['remove_empty_branches'] ) - { - $my['options']['remove_empty_nodes_of_type'] = 'testsuite'; - } - - $method2call = $my['options']['recursive'] ? '_get_subtree_rec' : '_get_subtree'; - $tcaseSet = array(); - if($my['options']['recursive']) - { - $qnum = $this->$method2call($id,$tprojectID,$items,$tcaseSet, - $my['filters'],$my['options']); - } - else - { - $qnum = $this->$method2call($id,$tprojectID,$items,$my['filters'],$my['options']); - } - return array($items,$tcaseSet); - } - - - - /** - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function _get_subtree_rec($tplan_id,$node_id,&$pnode,&$itemSet,$filters = null, $options = null) - { - static $qnum; - static $my; - static $exclude_branches; - static $exclude_children_of; - static $node_types; - static $tcaseFilter; - static $tcversionFilter; - static $pltaformFilter; - - static $childFilterOn; - static $staticSql; - static $debugMsg; - - if (!$my) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $qnum=0; - $node_types = array_flip($this->tree_manager->get_available_node_types()); - $my['filters'] = array('exclude_children_of' => null,'exclude_branches' => null, - 'additionalWhereClause' => '', 'testcase_name' => null, - 'platform_id' => null, - 'testcase_id' => null,'active_testcase' => false); - - $my['options'] = array('remove_empty_nodes_of_type' => null); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - $exclude_branches = $my['filters']['exclude_branches']; - $exclude_children_of = $my['filters']['exclude_children_of']; - - - $tcaseFilter['name'] = !is_null($my['filters']['testcase_name']); - $tcaseFilter['id'] = !is_null($my['filters']['testcase_id']); - - $tcaseFilter['is_active'] = !is_null($my['filters']['active_testcase']) && $my['filters']['active_testcase']; - $tcaseFilter['enabled'] = $tcaseFilter['name'] || $tcaseFilter['id'] || $tcaseFilter['is_active']; - - - $tcversionFilter['execution_type'] = !is_null($my['filters']['execution_type']); - $tcversionFilter['enabled'] = $tcversionFilter['execution_type']; - - $childFilterOn = $tcaseFilter['enabled'] || $tcversionFilter['enabled']; - - - - if( !is_null($my['options']['remove_empty_nodes_of_type']) ) - { - // this way I can manage code or description - if( !is_numeric($my['options']['remove_empty_nodes_of_type']) ) - { - $my['options']['remove_empty_nodes_of_type'] = - $this->tree_manager->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; - } - } - - - $platformFilter = ""; - if( !is_null($my['filters']['platform_id']) && $my['filters']['platform_id'] > 0 ) - { - $platformFilter = " AND T.platform_id = " . intval($my['filters']['platform_id']) ; - } - - // Create invariant sql sentences - $staticSql[0] = " /* $debugMsg - Get ONLY TestSuites */ " . - " SELECT NHTS.node_order AS spec_order," . - " NHTS.node_order AS node_order, NHTS.id, NHTS.parent_id," . - " NHTS.name, NHTS.node_type_id, 0 AS tcversion_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTS" . - " WHERE NHTS.node_type_id = {$this->tree_manager->node_descr_id['testsuite']} " . - " AND NHTS.parent_id = "; - - $staticSql[1] = " /* $debugMsg - Get ONLY Test Cases with version linked to (testplan,platform) */ " . - " SELECT NHTC.node_order AS spec_order, " . - " TPTCV.node_order AS node_order, NHTC.id, NHTC.parent_id, " . - " NHTC.name, NHTC.node_type_id, TPTCV.tcversion_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id " . - " WHERE NHTC.node_type_id = {$this->tree_manager->node_descr_id['testcase']} " . - " AND TPTCV.testplan_id = " . intval($tplan_id) . " {$platformFilter} " . - " AND NHTC.parent_id = "; - - } // End init static area - - $target = intval($node_id); - $sql = $staticSql[0] . $target . " UNION " . $staticSql[1] . $target; - - if( $tcaseFilter['enabled'] ) - { - foreach($tcaseFilter as $key => $apply) - { - if( $apply ) - { - switch($key) - { - case 'name': - $sql .= " AND NHTC.name LIKE '%{$my['filters']['testcase_name']}%' "; - break; - - case 'id': - $sql .= " AND NHTC.id = {$my['filters']['testcase_id']} "; - break; - } - } - } - } - - $sql .= " ORDER BY node_order,id"; - - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - if( null == $rs || count($rs) == 0 ) { - return $qnum; - } - - - foreach($rs as $row) { - if(!isset($exclude_branches[$row['id']])) { - $node = $row + - array('node_type' => $this->tree_manager->node_types[$row['node_type_id']], - 'node_table' => $this->tree_manager->node_tables_by['id'][$row['node_type_id']]); - $node['childNodes'] = null; - - if($node['node_table'] == 'testcases') { - $node['leaf'] = true; - $node['external_id'] = ''; - $itemSet['nindex'][] = $node['id']; - } - - - // why we use exclude_children_of ? - // 1. Sometimes we don't want the children if the parent is a testcase, - // due to the version management - // - if(!isset($exclude_children_of[$node_types[$row['node_type_id']]])) { - // Keep walking (Johny Walker Whisky) - $this->_get_subtree_rec($tplan_id,$row['id'],$node,$itemSet,$my['filters'],$my['options']); - } - - - // Have added this logic, because when export test plan will be developed - // having a test spec tree where test suites that do not contribute to test plan - // are pruned/removed is very important, to avoid additional processing - // - // If node has no childNodes, we check if this kind of node without children - // can be removed. - // - $doRemove = is_null($node['childNodes']) && - ($node['node_type_id'] == $my['options']['remove_empty_nodes_of_type']); - if(!$doRemove) { - $pnode['childNodes'][] = $node; - } - } // if(!isset($exclude_branches[$rowID])) - } //while - return $qnum; - } - - - /** - * - * - */ - function getNotRunAllBuildsForPlatform($id,$platformID,$buildSet=null) { - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $sql = "/* $debugMsg */ " . - " SELECT count(0) AS COUNTER ,NHTCV.parent_id AS tcase_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - " LEFT OUTER JOIN {$this->tables['executions']} E ON " . - " E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = B.id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id " . $safe_id['platform'] . - " AND E.status IS NULL "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy . - " HAVING COUNT(0) = " . intval($buildsCfg['count']) ; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunForBuildAndPlatform($id,$platformID,$buildID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - // list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $safe_id['tplan'] = intval($id); - $safe_id['platform'] = intval($platformID); - $safe_id['build'] = intval($buildID); - - $sql = "/* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.status, B.id AS build_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - - " /* Needed to get TEST CASE ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Need to Get Execution Info on REQUESTED build set */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = B.id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id = " . $safe_id['platform'] . - " AND B.id = " . $safe_id['build'] . - " AND E.status IS NULL "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getNotRunAtLeastOneBuildForPlatform($id,$platformID,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $sql = "/* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Needed to get TEST CASE ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Need to Get Execution Info on REQUESTED build set */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = B.id " . - " AND E.build_in IN ({$buildsCfg['inClause']}) " . - - " WHERE TPTCV.testplan_id = $id " . - " AND TPTCV.platform_id={$platformID} " . - " AND E.build_in IN ({$buildsCfg['inClause']}) " . - " AND E.status IS NULL "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * returns recordset with test cases that has requested status - * (only statuses that are written to DB => this does not work for not run) - * for LAST EXECUTION on build Set provided, for a platform. - * - * FULL means that we have to have SAME STATUS on all builds present on set. - * If build set is NOT PROVIDED, we will use ALL ACTIVE BUILDS - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsSingleStatusFull($id,$platformID,$status,$buildSet=null) - { - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $sql = " /* $debugMsg */ " . - " /* Count() to be used on HAVING */ " . - " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD and PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.build_id = B.id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.tcversion_id = LEBBP.tcversion_id " . - " AND E.testplan_id = LEBBP.testplan_id " . - " AND E.platform_id = LEBBP.platform_id " . - " AND E.build_id = LEBBP.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id=" . $safe_id['platform'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status ='" .$this->db->prepare_string($status) . "'"; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy . - " HAVING COUNT(0) = " . intval($buildsCfg['count']) ; - - unset($safe_id,$buildsCfg,$sqlLEBBP); - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * getHitsNotRunFullOnPlatform($id,$platformID,$buildSet) - * - * returns recordset with: - * test cases with NOT RUN status on ALL builds in build set (full), for a platform. - * - * If build set is null - * test cases with NOT RUN status on ALL ACTIVE builds (full), for a platform. - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunFullOnPlatform($id,$platformID,$buildSet=null) - { - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $sql = " /* $debugMsg */ " . - " /* Count() to be used on HAVING */ " . - " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " LEFT OUTER JOIN {$this->tables['executions']} E ON " . - " E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = B.id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id = " . $safe_id['platform'] . - " AND E.status IS NULL "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy . - " HAVING COUNT(0) = " . intval($buildsCfg['count']) ; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * getHitsStatusSetFullOnPlatform($id,$platformID,$statusSet,$buildQty=0) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON ALL builds in set (full) , for a platform - * - * If build set is not provided, thena analisys will be done on - * ALL ACTIVE BUILDS - * - * - * IMPORTANT / CRITIC: This has NOT BE USED FOR NOT RUN, - * there is an special method for NOT RUN status. - * - * Example: - * - * Test Plan: PLAN B - * Builds: B1,B2,B3 - * Test Cases: TC-100, TC-200,TC-300 - * - * Test Case - Build - LAST Execution status - * TC-100 B1 Passed - * TC-100 B2 FAILED - * TC-100 B3 Not Run - * - * TC-200 B1 FAILED - * TC-200 B2 FAILED - * TC-200 B3 BLOCKED - * - * TC-300 B1 Passed - * TC-300 B2 Passed - * TC-300 B3 BLOCKED - * - * TC-400 B1 FAILED - * TC-400 B2 BLOCKED - * TC-400 B3 FAILED - * - * Request 1: - * Provide test cases with status (LAST EXECUTION) in ('Passed','BLOCKED') - * ON ALL ACTIVE Builds - * - * ANSWER: - * TC-300 - * - * Request 2: - * Provide test cases with status in ('FAILED','BLOCKED') - * ON ALL ACTIVE Builds - * - * ANSWER: - * TC-300, TC-400 - * - * @return - * - * @internal revisions - * @since 1.9.4 - * 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches - */ - function getHitsStatusSetFullOnPlatform($id,$platformID,$statusSet,$buildSet=null) - { - - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $dummy = $this->sanitizeExecStatus( (array)$statusSet ); - $statusInClause = implode("','",$dummy); - - // ATTENTION: - // if I've requested (Passed or Blocked) on ALL BUILDS - // Have 2 results for build number. - // - // That logic is wrong when filtering for the SAME STATUS on ALL builds. - // Maybe copy/paste-error on refactoring? - // Example: With 3 builds and filtering for FAILED or BLOCKED on ALL builds - // we have to get 3 hits for each test case to be shown, not six hits. - // $countTarget = intval($buildsCfg['count']) * count($dummy); - $countTarget = intval($buildsCfg['count']); - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql = " /* $debugMsg */ " . - " /* Count() to be used on HAVING */ " . - " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD and PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.build_id = B.id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.tcversion_id = LEBBP.tcversion_id " . - " AND E.testplan_id = LEBBP.testplan_id " . - " AND E.platform_id = LEBBP.platform_id " . - " AND E.build_id = LEBBP.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id=" . $safe_id['platform'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN ('{$statusInClause}')" . - $groupBy . " HAVING COUNT(0) = " . $countTarget ; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - /** - * getHitsNotRunPartialOnPlatform($id,$platformID,buildSet) - * - * returns recordset with: - * test cases with NOT RUN status at LEAST ON ONE off ALL ACTIVE builds (Partial), - * for a platform. - * - * Example: - * - * Test Plan: PLAN B - * Builds: B1,B2,B3 - * Test Cases: TC-100, TC-200,TC-300 - * - * Test Case - Build - LAST Execution status - * TC-100 B1 Passed - * TC-100 B2 FAILED - * TC-100 B3 Not Run => to have this status means THAT HAS NEVER EXECUTED ON B3 - * - * TC-200 B1 FAILED - * TC-200 B2 FAILED - * TC-200 B3 BLOCKED - * - * TC-300 B1 Passed - * TC-300 B2 Passed - * TC-300 B3 BLOCKED - * - * TC-400 B1 FAILED - * TC-400 B2 BLOCKED - * TC-400 B3 FAILED - * - * Request : - * Provide test cases with status 'NOT RUN' - * ON At Least ON OF all ACTIVE Builds - * - * ANSWER: - * TC-100 - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunPartialOnPlatform($id,$platformID,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " /* Executions, looking for status NULL (remember NOT RUN is not written on DB) */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = B.id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id = " . $safe_id['platform'] . - " AND E.status IS NULL "; - - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - /** - * getHitsStatusSetPartialOnPlatform($id,$platformID,$statusSet,$buildSet) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * on LAST EXECUTION ON At Least ONE of builds present on Build Set (Partial), for a platform - * - * If build set is EMPTY - * on LAST EXECUTION ON At Least ONE of ALL ACTIVE builds (full), for a platform - * - * Example: - * - * Test Plan: PLAN B - * Builds: B1,B2,B3 - * Test Cases: TC-100, TC-200,TC-300 - * - * Test Case - Build - LAST Execution status - * TC-100 B1 Passed - * TC-100 B2 FAILED - * TC-100 B3 Not Run - * - * TC-200 B1 FAILED - * TC-200 B2 FAILED - * TC-200 B3 BLOCKED - * - * TC-300 B1 Passed - * TC-300 B2 Passed - * TC-300 B3 BLOCKED - * - * TC-400 B1 FAILED - * TC-400 B2 BLOCKED - * TC-400 B3 FAILED - * - * Request 1: - * Provide test cases with status in ('Passed','BLOCKED') - * ON At Least ONE, OF ALL ACTIVE Builds - * - * ANSWER: - * TC-200, TC300, TC400 - * - * Request 2: ???? - * Provide test cases with status in ('FAILED','BLOCKED') - * ON ALL ACTIVE Builds - * - * ANSWER: - * TC-300, TC-400 - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetPartialOnPlatform($id,$platformID,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $statusSet = $this->sanitizeExecStatus( $statusSet ); - $statusInClause = implode("','",$statusSet); - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,$buildSet); - - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD and PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.build_id = B.id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.tcversion_id = LEBBP.tcversion_id " . - " AND E.testplan_id = LEBBP.testplan_id " . - " AND E.platform_id = LEBBP.platform_id " . - " AND E.build_id = LEBBP.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id=" . $safe_id['platform'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN('{$statusInClause}') "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy; - - unset($safe_id,$buildsCfg,$sqlLEBBP); - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - - - } - - /** - * getHitsSameStatusFullOnPlatform($id,$platformID,$statusSet,$buildSet) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON ALL builds on buils set (full) , for a platform - * - * If build set is NULL => ON LAST EXECUTION ON ALL ACTIVE builds (full), for a platform - */ - function getHitsSameStatusFullOnPlatform($id,$platformID,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $statusSet = $this->sanitizeExecStatus( $statusSet ); - - return $this->helperGetHitsSameStatusOnPlatform('full',$id,$platformID,$statusSet,$buildSet); - } - - - - - /** - * getHitsSameStatusFullALOP($id,$statusSet,$buildSet) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON ALL builds on buils set (full) , for a platform - * - * If build set is NULL => ON LAST EXECUTION ON ALL ACTIVE builds (full), for a platform - * - */ - function getHitsSameStatusFullALOP($id,$statusSet,$buildSet=null,$opt=null) { - // On Postgresql - // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, - // but not in the WHERE or HAVING clauses; there you must write out the expression instead. - - $options = array('onlyActiveBuilds' => true); - $options = array_merge($options,(array)$opt); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,$buildSet, - array('ignorePlatform' => true)); - if( $options['onlyActiveBuilds'] ) { - $buildsCfg['statusClause'] = " AND B.active = 1 "; - } - - // TICKET 5226: Filtering by test result did not always show the correct matches - // The filtering for "not run" status was simply not implemented for the case - // of not using platforms. - // Maybe that part was forgotten when refactoring the filters. - // - // I adopted logic from helperGetHitsSameStatusOnPlatform() to get this working. - // - $flippedStatusSet = array_flip($statusSet); // (code => idx) - $get = array('notRun' => isset($flippedStatusSet[$this->notRunStatusCode]), 'otherStatus' => false); - $hits = array('notRun' => array(), 'otherStatus' => array()); - - if($get['notRun']) { - $notRunSQL = " /* $debugMsg */ " . - " /* COUNT() is needed as parameter for HAVING clause */ " . - " SELECT COUNT(0) AS COUNTER, NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " LEFT OUTER JOIN {$this->tables['executions']} E ON " . - " E.testplan_id = TPTCV.testplan_id " . - " AND E.build_id = B.id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND E.status IS NULL "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $notRunSQL .= $groupBy . - " HAVING COUNT(0) = " . intval($buildsCfg['count']) ; - - $hits['notRun'] = $this->db->fetchRowsIntoMap($notRunSQL,'tcase_id'); - - unset($statusSet[$flippedStatusSet[$this->notRunStatusCode]]); - } - - $get['otherStatus'] = count($statusSet) > 0; - if($get['otherStatus']) { - $statusSet = $this->sanitizeExecStatus($statusSet); - $statusInClause = implode("','",$statusSet); - - // ATTENTION: - // if I've requested (Passed or Blocked) on ALL BUILDS - // Have 2 results for build number. - - // That logic is wrong when filtering for the SAME STATUS on ALL builds. - // Maybe copy/paste-error on refactoring? - // Example: With 3 builds and filtering for FAILED or BLOCKED on ALL builds - // we have to get 3 hits for each test case to be shown, not six hits. - // $countTarget = intval($buildsCfg['count']) * count($statusSet); - $countTarget = intval($buildsCfg['count']); - - $otherStatusSQL = " /* $debugMsg */ " . - " /* Count() to be used on HAVING - ALOP */ " . - " SELECT COUNT(0) AS COUNTER ,tcase_id " . - " FROM ( " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.build_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD IGNORE PLATFORM */ " . - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.build_id = B.id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - " AND E.tcversion_id = LEX.tcversion_id " . - " AND E.testplan_id = LEX.testplan_id " . - " AND E.build_id = LEX.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN ('{$statusInClause}')" . - " ) SQX "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $otherStatusSQL .= $groupBy . - " HAVING COUNT(0) = " . $countTarget ; - - $hits['otherStatus'] = $this->db->fetchRowsIntoMap($otherStatusSQL,'tcase_id'); - } - - // build results record set - $hitsFoundOn = array(); - $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; - $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; - - if($hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus']) { - $items = array_merge(array_keys($hits['notRun']), array_keys($hits['otherStatus'])); - } else if($hitsFoundOn['notRun']) { - $items = array_keys($hits['notRun']); - } else if($hitsFoundOn['otherStatus']) { - $items = array_keys($hits['otherStatus']); - } - - - return is_null($items) ? $items : array_flip($items); - } - - - - /** - * getHitsNotRunOnBuildPlatform($id,$platformID,$buildID) - * - * returns recordset with: - * test cases with NOT RUN status on SPECIFIC build for a PLATFORM. - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunOnBuildPlatform($id,$platformID,$buildID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ " . - " SELECT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " /* Work on Executions */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E ON " . - " E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = " . intval($buildID) . - - " WHERE TPTCV.testplan_id = " . intval($id) . - " AND TPTCV.platform_id = " . intval($platformID) . - " AND E.status IS NULL "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - } - - - /** - * getHitsNotRunOnBuildALOP($id,$buildID) - * - * returns recordset with: - * test cases with NOT RUN status on SPECIFIC build On AT LEAST ONE PLATFORM. (ALOP) - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunOnBuildALOP($id,$buildID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " /* Work on Executions */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E ON " . - " E.testplan_id = TPTCV.testplan_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = " . intval($buildID) . - - " WHERE TPTCV.testplan_id = " . intval($id) . - " AND E.status IS NULL "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - } - - - - /** - * getHitsStatusSetOnBuildPlatform($id,$platformID,$buildID,$statusSet) - * - * returns recordset with: - * test cases with LAST EXECUTION STATUS on SPECIFIC build for a PLATFORM, IN status SET. - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetOnBuildPlatform($id,$platformID,$buildID,$statusSet) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEBBP) = $this->helperGetHits($id,$platformID,null,array('buildID' => $buildID)); - - $safe_id['build'] = intval($buildID); - $statusList = $this->sanitizeExecStatus( (array)$statusSet ); - - // Manage also not run - $notRunHits = null; - $dummy = array_flip($statusList); - if( isset($dummy[$this->notRunStatusCode]) ) { - tLog(__FUNCTION__ . ':: getHitsNotRunOnBuildPlatform','DEBUG'); - $notRunHits = $this->getHitsNotRunOnBuildPlatform($safe_id['tplan'],$safe_id['platform'],$safe_id['build']); - unset($statusList[$dummy[$this->notRunStatusCode]]); - } - - $statusInClause = implode("','",$statusList); - $sql = " /* $debugMsg */ " . - " SELECT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD and PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.build_id = " . $safe_id['build'] . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.tcversion_id = LEBBP.tcversion_id " . - " AND E.testplan_id = LEBBP.testplan_id " . - " AND E.platform_id = LEBBP.platform_id " . - " AND E.build_id = LEBBP.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id = " . $safe_id['platform'] . - " AND E.build_id = " . $safe_id['build'] . - " AND E.status IN('{$statusInClause}')"; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - $hits = is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - - $items = (array)$hits + (array)$notRunHits; - return count($items) > 0 ? $items : null; - } - - - /** - * getHitsStatusSetOnBuildALOP($id,$buildID,$statusSet) - * - * returns recordset with: - * test cases with LAST EXECUTION STATUS on SPECIFIC build for At Least One PLATFORM, - * IN status SET. - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetOnBuildALOP($id,$buildID,$statusSet) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,null, - array('buildID' => $buildID, - 'ignorePlatform' => true)); - - $safe_id['build'] = intval($buildID); - $statusList = $this->sanitizeExecStatus( (array)$statusSet ); - - // Manage also not run - $notRunHits = null; - $dummy = array_flip($statusList); - if( isset($dummy[$this->notRunStatusCode]) ) { - $notRunHits = $this->getHitsNotRunOnBuildALOP($safe_id['tplan'],$safe_id['build']); - unset($statusList[$dummy[$this->notRunStatusCode]]); - } - - $statusInClause = implode("','",$statusList); - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by BUILD IGNORE PLATFORM */ " . - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.build_id = " . $safe_id['build'] . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - " AND E.tcversion_id = LEX.tcversion_id " . - " AND E.testplan_id = LEX.testplan_id " . - " AND E.build_id = LEX.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND E.build_id = " . $safe_id['build'] . - " AND E.status IN('{$statusInClause}')"; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - $hits = is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - - $items = (array)$hits + (array)$notRunHits; - return count($items) > 0 ? $items : null; - } - - - /** - * getHitsStatusSetOnLatestExecALOP($id,$statusSet,$buildSet) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * on ABSOLUTE LASTEST EXECUTION considering all builds on build set IGNORING platform. - * - * If build set is NULL, we will analyse ALL ACTIVE builds (full) IGNORING platform. - * - * IMPORTANT / CRITIC: THIS DOES NOT WORK for Not Run STATUS - * HAS NO SENSE, because Not Run IN NOT SAVED to DB - * => we can not find LATEST NON RUN - * Example: - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetOnLatestExecALOP($id,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,$buildSet, - array('ignorePlatform' => true, - 'ignoreBuild' => true)); - - // Check if 'not run' in present in statusSet => throw exception - $statusList = $this->sanitizeExecStatus( (array)$statusSet ); - $dummy = array_flip($statusList); - if( isset($dummy[$this->notRunStatusCode]) ) - { - throw new Exception (__METHOD__ . ':: Status Not Run can not be used'); - } - $statusInClause = implode("','",$statusList); - - $sql = " /* $debugMsg */ " . - " SELECT MAX(LEX.id) AS latest_exec_id ,NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution IGNORE BUILD, PLATFORM */ " . - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - " AND E.tcversion_id = LEX.tcversion_id " . - " AND E.testplan_id = LEX.testplan_id " . - " AND E.build_id = B.id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN('{$statusInClause}') "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy; - - unset($safe_id,$buildsCfg,$sqlLEX); - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - } - - - - /** - * getHitsStatusSetOnLatestExecOnPlatform($id,$platformID,$statusSet,$buildSet) - * - * returns recordset with: - * test cases that has at least ONE of requested status - * on ABSOLUTE LASTEST EXECUTION considering all builds on build set, for a platform - * - * If build set is NULL, we will analyse ALL ACTIVE builds (full), for a platform - * - * IMPORTANT / CRITIC: THIS DOES NOT WORK for Not Run STATUS - * HAS NO SENSE, because Not Run IN NOT SAVED to DB - * => we can not find LATEST NON RUN - * Example: - * - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetOnLatestExecOnPlatform($id,$platformID,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - list($safe_id,$buildsCfg,$sqlLEBP) = $this->helperGetHits($id,$platformID,$buildSet, - array('ignoreBuild' => true)); - - // Check if 'not run' in present in statusSet => throw exception - $statusList = $this->sanitizeExecStatus( (array)$statusSet ); - $dummy = array_flip($statusList); - if( isset($dummy[$this->notRunStatusCode]) ) - { - throw new Exception (__METHOD__ . ':: Status Not Run can not be used'); - } - $statusInClause = implode("','",$statusList); - - // -------------------------------------------------------------------------------------- - $sql = " /* $debugMsg */ " . - " SELECT MAX(LEBP.id) AS latest_exec_id ,NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution on PLATFORM IGNORE BUILD */ " . - " JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - // " AND LEBP.build_id = B.id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBP.id " . - " AND E.tcversion_id = LEBP.tcversion_id " . - " AND E.testplan_id = LEBP.testplan_id " . - " AND E.platform_id = LEBP.platform_id " . - // " AND E.build_id = LEBBP.build_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND TPTCV.platform_id=" . $safe_id['platform'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN ('{$statusInClause}') "; - - $groupBy = ' GROUP BY ' . ((DB_TYPE == 'mssql') ? 'parent_id ':'tcase_id'); - $sql .= $groupBy; - - unset($safe_id,$buildsCfg,$sqlLEBP); - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return is_null($recordset) ? $recordset : array_flip(array_keys($recordset)); - } - - - - /** - * getHitsSameStatusPartialOnPlatform($id,$platformID,$statusSet,$buildSet) - * - * returns recordset with: - * - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON AT LEAST ONE OF builds on build set, for a platform - * - * If build set is empty - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON AT LEAST ONE OF ALL ACTIVE builds, for a platform - * - */ - function getHitsSameStatusPartialOnPlatform($id,$platformID,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $statusSet = $this->sanitizeExecStatus( (array)$statusSet ); - return $this->helperGetHitsSameStatusOnPlatform('partial',$id,$platformID,$statusSet,$buildSet); - } - - - /** - * getHitsSameStatusPartialALOP($id,$statusSet) - * - * returns recordset with: - * - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON AT LEAST ONE OF builds on build set, for a platform - * - * If build set is empty - * test cases that has at least ONE of requested status - * ON LAST EXECUTION ON AT LEAST ONE OF ALL ACTIVE builds, for a platform - * - */ - function getHitsSameStatusPartialALOP($id,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $getHitsNotRunMethod = 'getHitsNotRunPartialALOP'; - $getHitsStatusSetMethod = 'getHitsStatusSetPartialALOP'; - - // Needed because, may be we will need to remove an element - $statusSetLocal = $this->sanitizeExecStatus( (array)$statusSet ); - - $items = null; - $hits = array('notRun' => array(), 'otherStatus' => array()); - $dummy = array_flip($statusSetLocal); // (code => idx) - $get = array('notRun' => isset($dummy[$this->notRunStatusCode]), 'otherStatus' => false); - - - if($get['notRun']) - { - tLog(__METHOD__ . ":: \$tplan_mgr->$getHitsNotRunMethod", 'DEBUG'); - $hits['notRun'] = (array)$this->$getHitsNotRunMethod($id,$buildSet); - unset($statusSetLocal[$dummy[$this->notRunStatusCode]]); - } - - if( ($get['otherStatus']=(count($statusSetLocal) > 0)) ) - { - tLog(__METHOD__ . ":: \$tplan_mgr->$getHitsStatusSetMethod", 'DEBUG'); - $hits['otherStatus'] = (array)$this->$getHitsStatusSetMethod($id,$statusSetLocal,$buildSet); - } - - // build results recordset - $hitsFoundOn = array(); - $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; - $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; - - - if($get['notRun'] && $get['otherStatus']) - { - if( $hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus'] ) - { - $items = array_keys($hits['notRun']) + array_keys($hits['otherStatus']); - } - } - else if($get['notRun'] && $hitsFoundOn['notRun']) - { - $items = array_keys($hits['notRun']); - } - else if($get['otherStatus'] && $hitsFoundOn['otherStatus']) - { - $items = array_keys($hits['otherStatus']); - } - - return is_null($items) ? $items : array_flip($items); - } - - - - /** - * getHitsStatusSetPartialALOP($id,$platformID,$statusSet,$buildSet) - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsStatusSetPartialALOP($id,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $statusSet = $this->sanitizeExecStatus( $statusSet ); - $statusInClause = implode("','",$statusSet); - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,$buildSet, - array('ignorePlatform' => true)); - - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Latest Execution by JUST BUILD IGNORE PLATFORM */ " . - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.build_id = B.id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - - // " AND LEX.platform_id = TPTCV.platform_id " . - - " /* Get STATUS INFO From Executions */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEX.id " . - " AND E.tcversion_id = LEX.tcversion_id " . - " AND E.testplan_id = LEX.testplan_id " . - " AND E.build_id = LEX.build_id " . - - // " AND E.platform_id = LEX.platform_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND E.build_id IN ({$buildsCfg['inClause']}) " . - " AND E.status IN ('{$statusInClause}') "; - - - unset($safe_id,$buildsCfg,$sqlLEX); - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - - /** - * getHitsNotRunPartialALOP($id,buildSet) - * - * returns recordset with: - * - * test cases with NOT RUN status at LEAST ON ONE of builds - * present on build set (Partial), IGNORING Platforms - * - * If build set is empty: - * test cases with NOT RUN status at LEAST ON ONE of builds - * present on ACTIVE BUILDS set (Partial), IGNORING Platforms - * - * - * Example: (TO BE REWORKED) - * - * Test Plan: PLAN B - * Builds: B1,B2,B3 - * Test Cases: TC-100, TC-200,TC-300 - * - * Test Case - Build - LAST Execution status - * TC-100 B1 Passed - * TC-100 B2 FAILED - * TC-100 B3 Not Run => to have this status means THAT HAS NEVER EXECUTED ON B3 - * - * TC-200 B1 FAILED - * TC-200 B2 FAILED - * TC-200 B3 BLOCKED - * - * TC-300 B1 Passed - * TC-300 B2 Passed - * TC-300 B3 BLOCKED - * - * TC-400 B1 FAILED - * TC-400 B2 BLOCKED - * TC-400 B3 FAILED - * - * Request : - * Provide test cases with status 'NOT RUN' - * ON At Least ON OF all ACTIVE Builds - * - * ANSWER: - * TC-100 - * - * @return - * - * @internal revisions - * @since 1.9.4 - * - */ - function getHitsNotRunPartialALOP($id,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,$buildSet, - array('ignorePlatform' => true)); - - $sql = " /* $debugMsg */ " . - " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . - $buildsCfg['statusClause'] . - - " /* Get Test Case ID */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . - " NHTCV.id = TPTCV.tcversion_id " . - - " /* Executions, looking for status NULL (remember NOT RUN is not written on DB) */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = B.id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . - " AND B.id IN ({$buildsCfg['inClause']}) " . - " AND E.status IS NULL "; - - $recordset = $this->db->fetchRowsIntoMap($sql,'tcase_id'); - return $recordset; - } - - - - /** - * helperGetHitsSameStatusOnPlatform($mode,$id,$platformID,$statusSet,$buildSet) - * - * @internal revisions: - * 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches - */ - function helperGetHitsSameStatusOnPlatform($mode,$id,$platformID,$statusSet,$buildSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - switch($mode) - { - case 'partial': - $getHitsNotRunMethod = 'getHitsNotRunPartialOnPlatform'; - $getHitsStatusSetMethod = 'getHitsStatusSetPartialOnPlatform'; - - break; - - case 'full': - $getHitsNotRunMethod = 'getHitsNotRunFullOnPlatform'; - $getHitsStatusSetMethod = 'getHitsStatusSetFullOnPlatform'; - break; - } - - // Needed because, may be we will need to remove an element - $statusSetLocal = $this->sanitizeExecStatus( $statusSet ); - - $items = null; - $hits = array('notRun' => array(), 'otherStatus' => array()); - - $dummy = array_flip($statusSetLocal); // (code => idx) - $get = array('notRun' => isset($dummy[$this->notRunStatusCode]), 'otherStatus' => false); - - - if($get['notRun']) - { - $hits['notRun'] = (array)$this->$getHitsNotRunMethod($id,$platformID,$buildSet); - unset($statusSetLocal[$dummy[$this->notRunStatusCode]]); - } - if( ($get['otherStatus']=(count($statusSetLocal) > 0)) ) - { - $hits['otherStatus'] = (array)$this->$getHitsStatusSetMethod($id,$platformID,$statusSetLocal,$buildSet); - } - - // build results recordset - $hitsFoundOn = array(); - $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; - $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; - - //20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches - //if($get['notRun'] && $get['otherStatus']) - //{ - //if( $hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus'] ) - // The problem with this if clause: - // When $get['notRun'] && $get['otherStatus'] evaluated as TRUE but there were no hits - // in one of $hitsFoundOn['notRun'] or $hitsFoundOn['otherStatus'], then no results were returned at all. - - if($hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus']) - { - // THIS DOES NOT WORK with numeric keys - // $items = array_merge(array_keys($hits['notRun']),array_keys($hits['otherStatus'])); - //$items = array_keys($hits['notRun']) + array_keys($hits['otherStatus']); - - // 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches - // - // ATTENTION: Using the + operator instead of array_merge() for numeric keys is wrong! - // - // Quotes from documentation http://www.php.net/manual/en/function.array-merge.php: - // - // array_merge(): "If the input arrays have the same string keys, then the later value for that key - // will overwrite the previous one. If, however, the arrays contain numeric keys, - // the later value will not overwrite the original value, but will be appended." - // - // + operator: "The keys from the first array will be preserved. - // If an array key exists in both arrays, then the element from the first array will be used - // and the matching key's element from the second array will be ignored." - // - // That means if there were 5 results in $hits['notRun']) and 10 results in $hits['otherStatus']), - // the first 5 testcases from $hits['otherStatus']) were not in the result set because of the + operator. - // - // After using array_keys() we have numeric keys => we HAVE TO USE array_merge(). - $items = array_merge(array_keys($hits['notRun']), array_keys($hits['otherStatus'])); - } - else if($hitsFoundOn['notRun']) - { - $items = array_keys($hits['notRun']); - } - else if($hitsFoundOn['otherStatus']) - { - $items = array_keys($hits['otherStatus']); - } - - return is_null($items) ? $items : array_flip($items); - } - - - /** - * helperGetHits($id,$platformID,$buildSet,$options) - * - * - */ - function helperGetHits($id,$platformID,$buildSet=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('buildID' => 0, 'ignorePlatform' => false, 'ignoreBuild' => false); - $my['options'] = array_merge($my['options'],(array)$options); - - - $safe_id['tplan'] = intval($id); - $safe_id['platform'] = intval($platformID); - - $buildsCfg['statusClause'] = ""; - $buildsCfg['inClause'] = ""; - $buildsCfg['count'] = 0; - - if($my['options']['buildID'] <= 0) { - if( is_null($buildSet) ) { - $buildSet = array_keys($this->get_builds($id, self::ACTIVE_BUILDS)); - $buildsCfg['statusClause'] = " AND B.active = 1 "; - } - $buildsCfg['count'] = count($buildSet); - $buildsCfg['inClause'] = implode(",",$buildSet); - } else { - $buildsCfg['inClause'] = intval($my['options']['buildID']); - } - - $platformClause = " AND EE.platform_id = " . $safe_id['platform']; - $platformField = " ,EE.platform_id "; - if( $my['options']['ignorePlatform'] || $safe_id['platform'] == -1) { //20230826 - $platformClause = " "; - $platformField = " "; - } - - $buildField = " ,EE.build_id "; - if( $my['options']['ignoreBuild'] ) { - $buildField = " "; - } - - - - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id + custom_fields.id = cfield_testprojects.field_id + and cfield_testprojects.active = 1 + and custom_fields.enable_on_execution = 1 + and custom_fields.show_on_execution = 1 + and cfield_testprojects.testproject_id = " . + $this->db->prepare_int($tproject_id) . "order by field_id"; + + return $this->db->fetchColumnsIntoMap($sql, 'field_id', 'label'); + } + + /* + * function: html_table_of_custom_field_inputs + * + * + * args: $id + * [$parent_id]: need when you call this method during the creation + * of a test suite, because the $id will be 0 or null. + * + * [$scope]: 'design','execution' + * + * returns: html string + * + */ + public function html_table_of_custom_field_inputs($id, $parent_id = null, + $scope = 'design', $name_suffix = '', $input_values = null) + { + $cf_smarty = ''; + $method_suffix = $scope == 'design' ? $scope : 'execution'; + $method_name = "get_linked_cfields_at_{$method_suffix}"; + $cf_map = $this->$method_name($id, $parent_id); + + if (! is_null($cf_map)) { + $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map, + $name_suffix, $input_values); + } + return $cf_smarty; + } + + /* + * function: html_table_of_custom_field_values + * + * args: $id + * [$scope]: 'design','execution' + * + * [$filters]:default: null + * + * map with keys: + * + * [show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * include ONLY custom fields that can be viewed + * while user is execution testcases. + * + * 0 or null -> don't filter + * + * returns: html string + * + * rev : + * 20080811 - franciscom - BUGID 1650 (REQ) + * 20070701 - franciscom - fixed return string when there are no custom fields. + */ + public function html_table_of_custom_field_values($id, $scope = 'design', + $filters = null, $formatOptions = null) + { + $cf_smarty = ''; + $parent_id = null; + $label_css_style = ' class="labelHolder" '; + $value_css_style = ' '; + + $add_table = true; + $table_style = ''; + if (! is_null($formatOptions)) { + $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; + $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; + + $add_table = isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; + $table_style = isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; + } + + $show_cf = config_get('custom_fields')->show_custom_fields_without_value; + if ($scope == 'design') { + $cf_map = $this->get_linked_cfields_at_design($id, $parent_id, + $filters); + } else { + $cf_map = $this->getLinkedCfieldsAtExecution($id); + } + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + // if user has assigned a value, then node_id is not null + // BUGID 3989 + if (isset($cf_info['node_id']) || $cf_info['node_id'] || $show_cf) { + // true => do not create input in audit log + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, true)); + $cf_smarty .= "" . + htmlspecialchars($label) . "" . + "" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $id) . "\n"; + } + } + } + + if ($cf_smarty != '' && $add_table) { + $cf_smarty = "" . $cf_smarty . "
    "; + } + return $cf_smarty; + } + + // function end + + /* + * function: filterByOnDesignCustomFields + * Filter on values of custom fields that are managed + * ON DESIGN Area (i.e. when creating Test Specification). + * + * @used by getLinkedItems() in file execSetResults.php + * + * args : + * $tp_tcs - key: test case ID + * value: map with keys tcase_id,tcversion_id,... + * + * $cf_hash [cf_id] = value of cfields to filter by. + * + * returns: array filtered by selected custom fields. + * + * @internal revisions + * + */ + public function filterByOnDesignCustomFields($tp_tcs, $cf_hash) + { + $new_tp_tcs = null; + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $or_clause = ''; + $cf_query = ''; + $ignored = 0; + $doFilter = false; + $doIt = true; + + if (isset($cf_hash)) { + foreach ($cf_hash as $cf_id => $cf_value) { + // single value or array? + if (is_array($cf_value)) { + $count = 1; + $cf_query .= $or_clause; + foreach ($cf_value as $value) { + if ($count > 1) { + $cf_query .= " AND "; + } + $cf_query .= " ( CFD.value LIKE '%{$value}%' AND CFD.field_id = {$cf_id} )"; + $count ++; + } + } else { + // Because cf value can NOT exists on DB depending on system config. + if (trim($cf_value) != '') { + $cf_query .= $or_clause; + $cf_query .= " ( CFD.value LIKE '%{$cf_value}%' AND CFD.field_id = {$cf_id} ) "; + } else { + $ignored ++; + } + } + + if ($or_clause == '') { + $or_clause = ' OR '; + } + } + + // grand finale + if ($cf_query != '') { + $cf_query = " AND ({$cf_query}) "; + $doFilter = true; + } + } + $cf_qty = count($cf_hash) - $ignored; + $doIt = ! $doFilter; + foreach ($tp_tcs as $tc_id => $tc_value) { + if ($doFilter) { + $sql = " /* $debugMsg */ SELECT CFD.value FROM {$this->tables['cfield_design_values']} CFD," . + " {$this->tables['nodes_hierarchy']} NH" . + " WHERE CFD.node_id = NH.id " . + " AND NH.parent_id = {$tc_value['tcase_id']} " . + " {$cf_query} "; + + $rows = $this->db->fetchColumnsIntoArray($sql, 'value'); // BUGID 4115 + + // if there exist as many rows as custom fields to be filtered by => tc does meet the criteria + // TO CHECK - 20140126 - Give a look to treeMenu.inc.php - filter_by_cf_values() + // to understand if both logics are coerent. + $doIt = (count($rows) == $cf_qty); + } + if ($doIt) { + $new_tp_tcs[$tc_id] = $tp_tcs[$tc_id]; + } + } + return $new_tp_tcs; + } + + /* + * function: get_estimated_execution_time + * + * Takes all testcases linked to testplan and computes + * SUM of values assigned AT DESIGN TIME to customa field + * named CF_ESTIMATED_EXEC_TIME + * + * IMPORTANT: + * 1. at time of this writting (20080820) this CF can be of type: string,numeric or float. + * 2. YOU NEED TO USE . (dot) as decimal separator (US decimal separator?) or + * sum will be wrong. + * + * + * + * args:id testplan id + * itemSet: default null - can be an arry with test case VERSION ID + * + * returns: sum of CF values for all testcases linked to testplan + * + * rev: + * + */ + public function get_estimated_execution_time($id, $itemSet = null, + $platformID = null) + { + // check if cf exist and is assigned and active intest plan parent (TEST PROJECT) + $pinfo = $this->tree_manager->get_node_hierarchy_info($id); + $cf_info = $this->cfield_mgr->get_linked_to_testproject( + $pinfo['parent_id'], 1, array( + 'name' => 'CF_ESTIMATED_EXEC_TIME' + )); + if (is_null($cf_info)) { + return $this->getEstimatedExecutionTime($id, $itemSet, $platformID); + } else { + return $this->getEstimatedExecutionTimeFromCF($id, $itemSet, + $platformID); + } + } + + /** + */ + private function getEstimatedExecutionTime($id, $itemSet = null, + $platformID = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $tcVersionIDSet = array(); + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => true + ); + $platformSet = array_keys($this->getPlatforms($id, $getOpt)); + + if (is_null($itemSet)) { + // we need to loop over all linked PLATFORMS (if any) + $tcVersionIDSet = array(); + foreach ($platformSet as $platfID) { + if (is_null($platformID) || $platformID == $platfID) { + $linkedItems = $this->get_linked_tcvid($id, $platfID, + array( + 'addEstimatedExecDuration' => true + )); + if (! is_null($linkedItems)) { + $tcVersionIDSet[$platfID] = $linkedItems; + } + } + } + } else { + // Important NOTICE + // we can found SOME LIMITS on number of elements on IN CLAUSE + // need to make as many set as platforms linked to test plan + $sql4tplantcv = " /* $debugMsg */ SELECT tcversion_id, platform_id,TCV.estimated_exec_duration " . + " FROM {$this->tables['testplan_tcversions']} " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = tcversion_id " . + " WHERE testplan_id=" . intval($id) . " AND tcversion_id IN (" . + implode(',', $itemSet) . ")"; + if (! is_null($platformID)) { + $sql4tplantcv .= " AND platform_id= " . intval($platformID); + } + + $rs = $this->db->fetchRowsIntoMap($sql4tplantcv, 'platform_id', + database::CUMULATIVE); + foreach ($rs as $platfID => $elem) { + $tcVersionIDSet[$platfID] = $elem; + } + } + + $estimated = array( + 'platform' => array(), + 'totalMinutes' => 0, + 'totalTestCases' => 0 + ); + foreach ($tcVersionIDSet as $platfID => $items) { + $estimated['platform'][$platfID]['minutes'] = 0; + $estimated['platform'][$platfID]['tcase_qty'] = count($items); + foreach ($items as $dx) { + if (! is_null($dx['estimated_exec_duration'])) { + $estimated['platform'][$platfID]['minutes'] += $dx['estimated_exec_duration']; + } + } + $estimated['totalMinutes'] += $estimated['platform'][$platfID]['minutes']; + $estimated['totalTestCases'] += $estimated['platform'][$platfID]['tcase_qty']; + } + + return $estimated; + } + + /** + */ + private function getEstimatedExecutionTimeFromCF($id, $itemSet = null, + $platformID = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $estimated = array( + 'platform' => array(), + 'totalMinutes' => 0, + 'totalTestCases' => 0 + ); + $cf_info = $this->cfield_mgr->get_by_name('CF_ESTIMATED_EXEC_TIME'); + + // CF exists ? + if ($status_ok = ! is_null($cf_info)) { + $cfield_id = key($cf_info); + } + + if ($status_ok) { + $tcVersionIDSet = array(); + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => true + ); + $platformSet = array_keys($this->getPlatforms($id, $getOpt)); + + $sql = " /* $debugMsg */ "; + if (DB_TYPE == 'mysql') { + $sql .= " SELECT SUM(value) "; + } elseif (DB_TYPE == 'postgres' || DB_TYPE == 'mssql') { + $sql .= " SELECT SUM(CAST(value AS NUMERIC)) "; + } + + $sql .= " AS SUM_VALUE FROM {$this->tables['cfield_design_values']} CFDV " . + " WHERE CFDV.field_id={$cfield_id} "; + + if (is_null($itemSet)) { + // 20110112 - franciscom + // we need to loop over all linked PLATFORMS (if any) + $tcVersionIDSet = array(); + foreach ($platformSet as $platfID) { + if (is_null($platformID) || $platformID == $platfID) { + $linkedItems = $this->get_linked_tcvid($id, $platfID); + if (! is_null($linkedItems)) { + $tcVersionIDSet[$platfID] = array_keys($linkedItems); + } + } + } + } else { + // Important NOTICE + // we can found SOME LIMITS on number of elements on IN CLAUSE + // + // need to make as many set as platforms linked to test plan + $sql4tplantcv = " /* $debugMsg */ SELECT tcversion_id, platform_id " . + " FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id=" . intval($id) . + " AND tcversion_id IN (" . implode(',', $itemSet) . ")"; + + if (! is_null($platformID)) { + $sql4tplantcv .= " AND platform_id= " . intval($platformID); + } + + $rs = $this->db->fetchColumnsIntoMap($sql4tplantcv, + 'platform_id', 'tcversion_id', database::CUMULATIVE); + foreach ($rs as $platfID => $elem) { + $tcVersionIDSet[$platfID] = array_values($elem); + } + } + } + + if ($status_ok) { + // Important NOTICE + // we can found SOME LIMITS on number of elements on IN CLAUSE + $estimated = array( + 'platform' => array(), + 'totalMinutes' => 0, + 'totalTestCases' => 0 + ); + foreach ($tcVersionIDSet as $platfID => $items) { + $sql2exec = $sql . " AND node_id IN (" . implode(',', $items) . + ")"; + $dummy = $this->db->fetchOneValue($sql2exec); + $estimated['platform'][$platfID]['minutes'] = is_null($dummy) ? 0 : $dummy; + $estimated['platform'][$platfID]['tcase_qty'] = count($items); + + $estimated['totalMinutes'] += $estimated['platform'][$platfID]['minutes']; + $estimated['totalTestCases'] += $estimated['platform'][$platfID]['tcase_qty']; + } + } + return $estimated; + } + + /* + * function: get_execution_time + * Takes all executions or a subset of executions, regarding a testplan and + * computes SUM of values assigned AT EXECUTION TIME to custom field named CF_EXEC_TIME + * + * IMPORTANT: + * 1. at time of this writting (20081207) this CF can be of type: string,numeric or float. + * 2. YOU NEED TO USE . (dot) as decimal separator (US decimal separator?) or + * sum will be wrong. + * + * args:id testplan id + * $execIDSet: default null + * + * returns: sum of CF values for all testcases linked to testplan + * + * rev: + * @internal revision + */ + private function getExecutionTime2($context, $execIDSet = null) + { + // check if cf exist and is assigned and active intest plan parent (TEST PROJECT) + $pinfo = $this->tree_manager->get_node_hierarchy_info($id); + $cf_info = $this->cfield_mgr->get_linked_to_testproject( + $pinfo['parent_id'], 1, array( + 'name' => 'CF_EXEC_TIME' + )); + if (is_null($cf_info)) { + return $this->getExecutionTime($context, $execIDSet); + } else { + return $this->getExecutionTimeFromCF($context->tplan_id, $execIDSet, + $context->platform_id); + } + } + + /** + */ + public function getExecutionTime($context, $execIDSet = null) + { + $total_time = array( + 'platform' => array(), + 'totalMinutes' => 0, + 'totalTestCases' => 0 + ); + $targetSet = array(); + + if (is_null($execIDSet)) { + $filters = null; + if (! is_null($context->platform_id)) { + $filters = array( + 'platform_id' => $context->platform_id + ); + } + + if (! is_null($context->build_id) && $context->build_id > 0) { + $filters['build_id'] = $context->build_id; + } + + // we will compute time for ALL linked and executed test cases, + // BUT USING ONLY TIME SPEND for LATEST executed TCVERSION + $options = array( + 'addExecInfo' => true + ); + $executed = $this->getLTCVNewGeneration($context->tplan_id, $filters, + $options); + + // if( $status_ok = !is_null($executed) ) + if (! is_null($executed)) { + $tc2loop = array_keys($executed); + foreach ($tc2loop as $tcase_id) { + $p2loop = array_keys($executed[$tcase_id]); + foreach ($p2loop as $platf_id) { + $targetSet[$platf_id][] = array( + 'id' => $executed[$tcase_id][$platf_id]['exec_id'], + 'duration' => $executed[$tcase_id][$platf_id]['execution_duration'] + ); + } + } + } + } else { + // If user has passed in a set of exec id, we assume that + // he has make a good work, i.e. if he/she wanted just analize + // executions for just a PLATFORM he/she has filtered BEFORE + // passing in input to this method the item set. + // Then we will IGNORE value of argument platformID to avoid + // run a second (and probably useless query). + // We will use platformID JUST as index for output result + if (is_null($context->platform_id)) { + throw new Exception( + __FUNCTION__ . + ' When you pass $execIDSet an YOU NEED TO PROVIDE a platform ID'); + } + $targetSet[$context->platform_id] = $this->getExecutionDurationForSet( + $execIDSet); + } + + foreach ($targetSet as $platfID => $itemSet) { + $total_time['platform'][$platfID]['minutes'] = 0; + $total_time['platform'][$platfID]['tcase_qty'] = count($itemSet); + foreach ($itemSet as $dx) { + if (! is_null($dx['duration'])) { + $total_time['platform'][$platfID]['minutes'] += $dx['duration']; + } + } + + $total_time['totalMinutes'] += $total_time['platform'][$platfID]['minutes']; + $total_time['totalTestCases'] += $total_time['platform'][$platfID]['tcase_qty']; + } + return $total_time; + } + + /** + */ + private function getExecutionTimeFromCF($id, $execIDSet = null, + $platformID = null) + { + $total_time = array( + 'platform' => array(), + 'totalMinutes' => 0, + 'totalTestCases' => 0 + ); + $targetSet = array(); + $cf_info = $this->cfield_mgr->get_by_name('CF_EXEC_TIME'); + + // CF exists ? + if ($status_ok = ! is_null($cf_info)) { + $cfield_id = key($cf_info); + } + + if ($status_ok) { + $sql = "SELECT SUM(CAST(value AS NUMERIC)) "; + if (DB_TYPE == 'mysql') { + $sql = "SELECT SUM(value) "; + } elseif (DB_TYPE == 'postgres' || DB_TYPE == 'mssql') { + $sql = "SELECT SUM(CAST(value AS NUMERIC)) "; + } + $sql .= " AS SUM_VALUE FROM {$this->tables['cfield_execution_values']} CFEV " . + " WHERE CFEV.field_id={$cfield_id} " . " AND testplan_id={$id} "; + + if (is_null($execIDSet)) { + + $filters = null; + if (! is_null($platformID)) { + $filters = array( + 'platform_id' => $platformID + ); + } + + // we will compute time for ALL linked and executed test cases, + // BUT USING ONLY TIME SPEND for LAST executed TCVERSION + // $options = array('only_executed' => true, 'output' => 'mapOfMap'); + $options = array( + 'addExecInfo' => true + ); + $executed = $this->getLTCVNewGeneration($id, $filters, $options); + if ($status_ok = ! is_null($executed)) { + $tc2loop = array_keys($executed); + foreach ($tc2loop as $tcase_id) { + $p2loop = array_keys($executed[$tcase_id]); + foreach ($p2loop as $platf_id) { + $targetSet[$platf_id][] = $executed[$tcase_id][$platf_id]['exec_id']; + } + } + } + } else { + // If user has passed in a set of exec id, we assume that + // he has make a good work, i.e. if he/she wanted just analize + // executions for just a PLATFORM he/she has filtered BEFORE + // passing in input to this method the item set. + // Then we will IGNORE value of argument platformID to avoid + // run a second (and probably useless query). + // We will use platformID JUST as index for output result + + if (is_null($platformID)) { + throw new Exception( + __FUNCTION__ . + ' When you pass $execIDSet an YOU NEED TO PROVIDE a platform ID'); + } + $targetSet[$platformID] = $execIDSet; + } + } + + if ($status_ok) { + // Important NOTICE + // we can found SOME LIMITS on number of elements on IN CLAUSE + // + // $estimated = array('platform' => array(), 'totalMinutes' => 0, 'totalTestCases' => 0); + foreach ($targetSet as $platfID => $items) { + $sql2exec = $sql . " AND execution_id IN (" . + implode(',', $items) . ")"; + + $dummy = $this->db->fetchOneValue($sql2exec); + $total_time['platform'][$platfID]['minutes'] = is_null($dummy) ? 0 : $dummy; + $total_time['platform'][$platfID]['tcase_qty'] = count($items); + + $total_time['totalMinutes'] += $total_time['platform'][$platfID]['minutes']; + $total_time['totalTestCases'] += $total_time['platform'][$platfID]['tcase_qty']; + } + } + + return $total_time; + } + + /* + * function: get_prev_builds() + * + * args: id: testplan id + * build_id: all builds belonging to choosen testplan, + * with id < build_id will be retreived. + * [active]: default null -> do not filter on active status + * + * returns: + * + */ + private function getPrevBuilds($id, $build_id, $active = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT id,testplan_id, name, notes, active, is_open " . + " FROM {$this->tables['builds']} " . + " WHERE testplan_id = {$id} AND id < {$build_id}"; + + if (! is_null($active)) { + $sql .= " AND active=" . intval($active) . " "; + } + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * returns set of tcversions that has same execution status + * in every build present on buildSet for selected Platform. + * + * id: testplan id + * buildSet: builds to analise. + * status: status code (can be an array) + */ + private function getSameStatusForBuildSet($id, $buildSet, $status) + { + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $node_types = $this->tree_manager->get_available_node_types(); + $num_exec = count($buildSet); + $build_in = implode(",", $buildSet); + + $first_results = null; + if (in_array($this->notRunStatusCode, (array) $status)) { + + $sql = " /* $debugMsg */ SELECT distinct T.tcversion_id,E.build_id,NH.parent_id AS tcase_id " . + " FROM {$this->tables['testplan_tcversions']} T " . + " JOIN {$this->tables['nodes_hierarchy']} NH ON T.tcversion_id=NH.id " . + " AND NH.node_type_id={$node_types['testcase_version']} " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON T.tcversion_id = E.tcversion_id " . + " AND T.testplan_id=E.testplan_id AND E.build_id IN ({$build_in}) " . + " WHERE T.testplan_id={$id} AND E.build_id IS NULL "; + + $first_results = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + $sql = " SELECT EE.status,SQ1.tcversion_id, NH.parent_id AS tcase_id, COUNT(EE.status) AS exec_qty " . + " FROM {$this->tables['executions']} EE, {$this->tables['nodes_hierarchy']} NH," . + " (SELECT E.tcversion_id,E.build_id,MAX(E.id) AS last_exec_id " . + " FROM {$this->tables['executions']} E " . + " WHERE E.build_id IN ({$build_in}) " . + " GROUP BY E.tcversion_id,E.build_id) AS SQ1 " . + " WHERE EE.build_id IN ({$build_in}) " . " AND EE.status IN ('" . + $status . "') AND NH.node_type_id={$node_types['testcase_version']} " . + " AND SQ1.last_exec_id=EE.id AND SQ1.tcversion_id=NH.id " . + " GROUP BY status,SQ1.tcversion_id,NH.parent_id" . + " HAVING COUNT(EE.status)= {$num_exec} "; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + + if (count($first_results)) { + foreach ($first_results as $key => $value) { + $recordset[$key] = $value; + } + } + + return $recordset; + } + + /** + * BUGID 2455, BUGID 3026 + * find all builds for which a testcase has not been executed + * + * @author asimon + * @param integer $id + * Build ID + * @param array $buildSet + * build set to check + * @return array $new_set set of builds which match the search criterium + * @internal revisions + * 20101215 - asimon - BUGID 4023: correct filtering also with platforms + */ + private function getNotRunForAnyBuild($id, $buildSet, $platformid = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $results = array(); + + $tcversionPlatformString = ""; + $executionPlatformString = ""; + if ($platformid) { + $tcversionPlatformString = "AND T.platform_id=$platformid"; + $executionPlatformString = "AND E.platform_id=$platformid"; + } + + foreach ($buildSet as $build) { + $sql = "/* $debugMsg */ SELECT distinct T.tcversion_id, E.build_id, E.status, NH.parent_id AS tcase_id " . + " FROM {$this->tables['testplan_tcversions']} T " . + " JOIN {$this->tables['nodes_hierarchy']} NH ON T.tcversion_id=NH.id AND NH.node_type_id=4 " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON T.tcversion_id = E.tcversion_id " . + " AND T.testplan_id=E.testplan_id AND E.build_id=$build $executionPlatformString" . + " WHERE T.testplan_id={$id} AND E.status IS NULL $tcversionPlatformString"; + $results[] = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + $recordset = array(); + foreach ($results as $result) { + if (! is_null($result) && (is_array($result))) // BUGID 3806 + { + $recordset = array_merge_recursive($recordset, $result); + } + } + $new_set = array(); + foreach ($recordset as $val) { + $new_set[$val['tcase_id']] = $val; + } + + return $new_set; + } + + /** + * link platforms to a new Test Plan + * + * @param int $source_id + * original Test Plan id + * @param int $target_id + * new Test Plan id + * @param array $mappings: + * key source platform id, target platform id + * USED when copy is done to a test plan that BELONGS to + * another Test Project. + */ + private function copyPlatformsLinks($source_id, $target_id, $mappings = null) + { + $sourceLinks = $this->platform_mgr->getLinkedToTestplanAsMap($source_id); + if (! is_null($sourceLinks)) { + $sourceLinks = array_keys($sourceLinks); + if (! is_null($mappings)) { + foreach ($sourceLinks as $key => $value) { + $sourceLinks[$key] = $mappings[$value]; + } + } + $this->platform_mgr->linkToTestplan($sourceLinks, $target_id); + } + } + + /** + * link attachments to a new Test Plan + * + * @param int $source_id + * original Test Plan id + * @param int $target_id + * new Test Plan id + */ + private function copyAttachments($source_id, $target_id) + { + $this->attachmentRepository->copyAttachments($source_id, $target_id, + $this->attachmentTableName); + } + + /** + * outputFormat: + * 'array', + * 'map', + * 'mapAccessByID' => map access key: id + * 'mapAccessByName' => map access key: name + */ + public function getPlatforms($id, $options = null) + { + $my['options'] = array( + 'outputFormat' => 'array', + 'outputDetails' => 'full', + 'addIfNull' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + switch ($my['options']['outputFormat']) { + case 'map': + $platforms = $this->platform_mgr->getLinkedToTestplanAsMap($id); + break; + + default: + $opt = array( + 'outputFormat' => $my['options']['outputFormat'] + ); + $platforms = $this->platform_mgr->getLinkedToTestplan($id, $opt); + break; + } + + if (! is_null($platforms)) { + switch ($my['options']['outputDetails']) { + case 'name': + foreach ($platforms as $id => $elem) { + $platforms[$id] = $elem['name']; + } + break; + + default: + break; + } + } elseif ($my['options']['addIfNull']) { + $platforms = array( + 0 => '' + ); + } + return $platforms; + } + + /** + * Logic to determine if platforms should be visible for a given testplan. + * + * @return bool true if the testplan has one or more linked platforms; + * otherwise false. + */ + public function hasLinkedPlatforms($id) + { + return $this->platform_mgr->platformsActiveForTestplan($id); + } + + /** + * changes platform id on a test plan linked test case versions for + * a target platform. + * Corresponding executions information is also updated + * + * @param + * id: test plan id + * @param + * from: plaftorm id to update (used as filter criteria). + * @param + * to: new plaftorm id value + * @param + * tcversionSet: default null, can be array with tcversion id + * (used as filter criteria). + * + * + */ + public function changeLinkedTCVersionsPlatform($id, $from, $to, + $tcversionSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sqlFilter = ''; + if (! is_null($tcversionSet)) { + $sqlFilter = " AND tcversion_id IN (" . + implode(',', (array) $tcversionSet) . " ) "; + } + $whereClause = " WHERE testplan_id = {$id} AND platform_id = {$from} {$sqlFilter}"; + + $sqlStm = array(); + $sqlStm[] = "/* {$debugMsg} */ " . + " UPDATE {$this->tables['testplan_tcversions']} " . + " SET platform_id = {$to} " . $whereClause; + + $sqlStm[] = "/* {$debugMsg} */" . + " UPDATE {$this->tables['executions']} " . + " SET platform_id = {$to} " . $whereClause; + + foreach ($sqlStm as $sql) { + $this->db->exec_query($sql); + } + } + + /** + * + * @param + * id: test plan id + * @param + * platformSet: default null, used as filter criteria. + * @return map: key platform id, values count,platform_id + */ + public function countLinkedTCVersionsByPlatform($id, $platformSet = null) + { + $sqlFilter = ''; + if (! is_null($platformSet)) { + $sqlFilter = " AND platform_id IN (" . + implode(',', (array) $platformSet) . ") "; + } + $sql = " SELECT COUNT(testplan_id) AS qty,platform_id " . + " FROM {$this->tables['testplan_tcversions']} " . + " WHERE testplan_id={$id} {$sqlFilter} " . " GROUP BY platform_id "; + return $this->db->fetchRowsIntoMap($sql, 'platform_id'); + } + + /** + */ + public function getStatusForReports() + { + // 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) { + $code_verbose[$this->resultsCfg['status_code'][$tc_status_verbose]] = $tc_status_verbose; + } + if (! isset($this->resultsCfg['status_label_for_exec_ui']['not_run'])) { + $code_verbose[$this->resultsCfg['status_code']['not_run']] = 'not_run'; + } + return $code_verbose; + } + + /** + * getTestCaseSiblings() + * + * @internal revisions + */ + private function getTestCaseSiblings($id, $tcversion_id, $platform_id, + $opt = null) + { + $my['opt'] = array( + 'assigned_to' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = " SELECT NHTSET.name as testcase_name,NHTSET.id AS testcase_id , NHTCVSET.id AS tcversion_id," . + " NHTC.parent_id AS testsuite_id, " . + " TPTCVX.id AS feature_id, TPTCVX.node_order, TCV.tc_external_id " . + " from {$this->tables['testplan_tcversions']} TPTCVMAIN " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCVMAIN.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTSET ON NHTSET.parent_id = NHTC.parent_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCVSET ON NHTCVSET.parent_id = NHTSET.id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCVSET.id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCVX " . + " ON TPTCVX.tcversion_id = NHTCVSET.id " . + " AND TPTCVX.testplan_id = TPTCVMAIN.testplan_id " . + " AND TPTCVX.platform_id = TPTCVMAIN.platform_id "; + + if (! is_null($my['opt']['assigned_to'])) { + $user_id = intval($my['opt']['assigned_to']['user_id']); + $build_id = intval($my['opt']['assigned_to']['build_id']); + + $addJoin = " /* Analise user assignment to get sibling */ " . + " JOIN {$this->tables['user_assignments']} UAMAIN " . + " ON UAMAIN.feature_id = TPTCVMAIN.id " . + " AND UAMAIN.build_id = " . $build_id . " AND UAMAIN.user_id = " . + $user_id . " AND UAMAIN.type = {$this->execTaskCode} " . + " JOIN {$this->tables['user_assignments']} UAX " . + " ON UAX.feature_id = TPTCVX.id " . " AND UAX.build_id = " . + $build_id . " AND UAX.user_id = " . $user_id . + " AND UAX.type = {$this->execTaskCode} "; + $sql .= $addJoin; + } + + $sql .= " WHERE TPTCVMAIN.testplan_id = {$id} AND TPTCVMAIN.tcversion_id = {$tcversion_id} " . + " AND TPTCVMAIN.platform_id = {$platform_id} " . + " ORDER BY node_order,tc_external_id "; + + return $this->db->fetchRowsIntoMap($sql, 'tcversion_id'); + } + + /** + * getTestCaseNextSibling() + * + * @used-by execSetResults.php + * + */ + public function getTestCaseNextSibling($id, $tcversion_id, $platform_id, + $opt = null) + { + $my['opt'] = array( + 'move' => 'forward', + 'scope' => 'local' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sibling = null; + switch ($my['opt']['scope']) { + case 'world': + $tptcv = $this->tables['testplan_tcversions']; + + $subq = " SELECT node_order FROM {$this->tables['testplan_tcversions']} TX " . + " WHERE TX.testplan_id = {$id} AND " . + " TX.tcversion_id = {$tcversion_id} "; + + if ($platform_id > 0) { + $subq .= " AND TX.platform_id = {$platform_id} "; + } + $sql = " SELECT tcversion_id,node_order " . " FROM {$tptcv} TZ " . + " WHERE TZ.testplan_id = {$id} AND " . + " TZ.tcversion_id <> {$tcversion_id} "; + if ($platform_id > 0) { + $sql .= " AND TZ.platform_id = {$platform_id} "; + } + + $sql .= " ORDER BY TZ.node_order >= ($subq) "; + break; + + case 'local': + default: + $sib = $this->getTestCaseSiblings($id, $tcversion_id, + $platform_id, $my['opt']); + break; + } + $tcversionSet = array_keys($sib); + $elemQty = count($tcversionSet); + $dummy = array_flip($tcversionSet); + + $pos = $dummy[$tcversion_id]; + switch ($my['opt']['move']) { + case 'backward': + $pos --; + $pos = $pos < 0 ? 0 : $pos; + break; + + case 'forward': + default: + $pos ++; + break; + } + + $sibling_tcversion = $pos < $elemQty ? $tcversionSet[$pos] : 0; + if ($sibling_tcversion > 0) { + $sibling = array( + 'tcase_id' => $sib[$sibling_tcversion]['testcase_id'], + 'tcversion_id' => $sibling_tcversion + ); + } + return $sibling; + } + + /** + * Convert a given urgency and importance to a priority level using + * threshold values in $tlCfg->priority_levels. + * + * @param mixed $urgency + * Urgency of the testcase. + * If this is the only parameter given then interpret it as + * $urgency*$importance. + * @param mixed $importance + * Importance of the testcase. (Optional) + * + * @return int HIGH, MEDIUM or LOW + */ + public function urgencyImportanceToPriorityLevel($urgency, + $importance = null) + { + $urgencyImportance = intval($urgency) * + (is_null($importance) ? 1 : intval($importance)); + return priority_to_level($urgencyImportance); + } + + /** + * create XML string with following structure + * + * + * + * + * + * + * + * + * + * + * ... + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ... + * + * + * + * + */ + public function exportLinkedItemsToXML($id) + { + $item_info = $this->get_by_id($id); + + // Linked platforms + $xml_root = "{{XMLCODE}}\n"; + + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl + // + $xml_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + + $xml_mapping = null; + $xml_mapping = array( + "||PLATFORMNAME||" => "platform_name", + "||PLATFORMID||" => 'id' + ); + + $mm = (array) $this->platform_mgr->getLinkedToTestplanAsMap($id); + $loop2do = count($mm); + if ($loop2do > 0) { + $items2loop = array_keys($mm); + foreach ($items2loop as $itemkey) { + $mm[$itemkey] = array( + 'platform_name' => $mm[$itemkey], + 'id' => $itemkey + ); + } + } + $linked_platforms = exportDataToXML($mm, $xml_root, $xml_template, + $xml_mapping, true); + + // Linked test cases + $xml_root = "\n{{XMLCODE}}\n"; + $xml_template = "\n\t" . "" . "\n" . "\t\t" . "" . "\n" . + "\t\t\t" . "" . "\n" . + "\t\t" . "" . "\n" . "\t\t" . "" . "\n" . + "\t\t\t" . "\n" . "\t\t\t" . + "\n" . "\t\t\t" . + "\n" . "\t\t\t" . + "\n" . + "\t\t" . "" . "\n" . "" . "\n" . + $xml_mapping = array( + "||PLATFORMNAME||" => "platform_name", + "||EXTERNALID||" => "external_id", + "||NAME||" => "name", + "||VERSION||" => "version", + "||EXECUTION_ORDER||" => "execution_order" + ); + + $mm = $this->getLinkedStaticView($id, null, array( + 'output' => 'array' + )); + $linked_testcases = exportDataToXML($mm, $xml_root, $xml_template, + $xml_mapping, true); + + $item_info['linked_platforms'] = $linked_platforms; + $item_info['linked_testcases'] = $linked_testcases; + $xml_root = "\n\t{{XMLCODE}}\n\t"; + $xml_template = "\n\t\t" . "" . + "\n" . "\t\t||LINKED_PLATFORMS||\n" . "\t\t||LINKED_TESTCASES||\n"; + + $xml_mapping = null; + $xml_mapping = array( + "||TESTPLANNAME||" => "name", + "||LINKED_PLATFORMS||" => "linked_platforms", + "||LINKED_TESTCASES||" => "linked_testcases" + ); + + return exportDataToXML(array( + $item_info + ), $xml_root, $xml_template, $xml_mapping); + } + + /** + * create XML string with following structure + * + * + * + * @param + * mixed context: map with following keys + * platform_id: MANDATORY + * build_id: OPTIONAL + * tproject_id: OPTIONAL + */ + public function exportTestPlanDataToXML($id, $context, $optExport = array()) + { + if (! isset($context['tproject_id']) || is_null($context['tproject_id'])) { + $dummy = $this->tree_manager->get_node_hierarchy_info($id); + $context['tproject_id'] = $dummy['parent_id']; + } + $context['tproject_id'] = intval($context['tproject_id']); + + // CRITIC - this has to be firt population of item_info. + // Other processes adds info to this map. + $item_info = $this->get_by_id($id); + + // Need to get family + $nt2exclude = array( + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + $nt2exclude_children = array( + 'testcase' => 'exclude_my_children', + 'requirement_spec' => 'exclude_my_children' + ); + + $my = array(); + + // this can be a litte weird but ... + // when + // 'order_cfg' => array("type" =>'exec_order' + // additional info test plan id, and platform id are used to get + // a filtered view of tree. + // + $order_cfg = array( + "type" => 'exec_order', + "tplan_id" => $id + ); + if ($context['platform_id'] > 0) { + $order_cfg['platform_id'] = $context['platform_id']; + } + $my['options'] = array( + 'recursive' => true, + 'order_cfg' => $order_cfg, + 'remove_empty_nodes_of_type' => $this->tree_manager->node_descr_id['testsuite'] + ); + $my['filters'] = array( + 'exclude_node_types' => $nt2exclude, + 'exclude_children_of' => $nt2exclude_children + ); + $tplan_spec = $this->tree_manager->get_subtree($context['tproject_id'], + $my['filters'], $my['options']); + + // Generate test project info + $tproject_mgr = new testproject($this->db); + $tproject_info = $tproject_mgr->get_by_id($context['tproject_id']); + + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl + // + $xml_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + + $xml_root = "{{XMLCODE}}"; + $xml_mapping = null; + $xml_mapping = array( + "||TESTPROJECTNAME||" => "name", + "||TESTPROJECTPREFIX||" => "prefix", + "||TESTPROJECTID||" => 'id' + ); + $mm = array(); + $mm[$context['tproject_id']] = array( + 'name' => $tproject_info['name'], + 'prefix' => $tproject_info['prefix'], + 'id' => $context['tproject_id'] + ); + $item_info['testproject'] = exportDataToXML($mm, $xml_root, + $xml_template, $xml_mapping, true); + + // get target platform (if exists) + $target_platform = ''; + if ($context['platform_id'] > 0) { + $info = $this->platform_mgr->getByID($context['platform_id']); + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl + // + $xml_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + + $xml_root = "{{XMLCODE}}"; + $xml_mapping = null; + $xml_mapping = array( + "||PLATFORMNAME||" => "platform_name", + "||PLATFORMID||" => 'id' + ); + + $mm = array(); + $mm[$context['platform_id']] = array( + 'platform_name' => $info['name'], + 'id' => $context['platform_id'] + ); + $item_info['target_platform'] = exportDataToXML($mm, $xml_root, + $xml_template, $xml_mapping, true); + $target_platform = "\t\t||TARGET_PLATFORM||\n"; + } + + // get Build info (if possible) + $target_build = ''; + if (isset($context['build_id']) && $context['build_id'] > 0) { + $dummy = $this->get_builds($id); + $info = $dummy[$context['build_id']]; + + // ||yyy||-> tags, {{xxx}} -> attribute + // tags and attributes receive different treatment on exportDataToXML() + // + // each UPPER CASE word in this map is a KEY, that MUST HAVE AN OCCURENCE on $elemTpl + // + $xml_template = "\n\t" . "" . "\t\t" . + "" . "\t\t" . + "" . "\n\t" . + ""; + + $xml_root = "{{XMLCODE}}"; + $xml_mapping = null; + $xml_mapping = array( + "||BUILDNAME||" => "name", + "||BUILDID||" => 'id' + ); + + $mm = array(); + $mm[$context['build_id']] = array( + 'name' => $info['name'], + 'id' => $context['build_id'] + ); + $item_info['target_build'] = exportDataToXML($mm, $xml_root, + $xml_template, $xml_mapping, true); + $target_build = "\t\t||TARGET_BUILD||\n"; + } + + // get test plan contents (test suites and test cases) + $item_info['testsuites'] = null; + if (! is_null($tplan_spec) && isset($tplan_spec['childNodes']) && + ! empty($tplan_spec['childNodes'])) { + $item_info['testsuites'] = '' . + $this->exportTestSuiteDataToXML($tplan_spec, + $context['tproject_id'], $id, $context['platform_id'], + $context['build_id']) . ''; + } + + $xml_root = "\n\t{{XMLCODE}}\n\t"; + $xml_template = "\n\t\t" . "" . + "\n" . "\t\t||TESTPROJECT||\n" . $target_platform . $target_build . + "\t\t||TESTSUITES||\n"; + + $xml_mapping = null; + $xml_mapping = array( + "||TESTPLANNAME||" => "name", + "||TESTPROJECT||" => "testproject", + "||TARGET_PLATFORM||" => "target_platform", + "||TARGET_BUILD||" => "target_build", + "||TESTSUITES||" => "testsuites" + ); + + return exportDataToXML(array( + $item_info + ), $xml_root, $xml_template, $xml_mapping); + } + + /** + */ + private function exportTestSuiteDataToXML($container, $tproject_id, + $tplan_id, $platform_id, $build_id) + { + static $keywordMgr; + static $tcaseMgr; + static $tsuiteMgr; + static $tcaseExportOptions; + static $linkedItems; + + if (is_null($keywordMgr)) { + $tcaseExportOptions = array( + 'CFIELDS' => true, + 'KEYWORDS' => true, + 'EXEC_ORDER' => 0 + ); + $keywordMgr = new tlKeyword(); + $tsuiteMgr = new testsuite($this->db); + $linkedItems = $this->getLinkedItems($tplan_id); + } + + $xmlTC = null; + $cfXML = null; + $kwXML = null; + + if (isset($container['id'])) { + $kwMap = $tsuiteMgr->getKeywords($container['id']); + if ($kwMap) { + $kwXML = "" . $keywordMgr->toXMLString($kwMap, true) . + ""; + } + + $cfMap = (array) $tsuiteMgr->get_linked_cfields_at_design( + $container['id'], null, null, $tproject_id); + if (count($cfMap) > 0) { + $cfXML = $this->cfield_mgr->exportValueAsXML($cfMap); + } + + $tsuiteData = $tsuiteMgr->get_by_id($container['id']); + $xmlTC = "\n\t' . + "\n\t\t" . + "\n\t\t
    " . + "\n\t\t{$kwXML}{$cfXML}
    "; + } + $childNodes = isset($container['childNodes']) ? $container['childNodes'] : null; + if (! is_null($childNodes)) { + $loop_qty = count($childNodes); + for ($idx = 0; $idx < $loop_qty; $idx ++) { + $cNode = $childNodes[$idx]; + switch ($cNode['node_table']) { + case 'testsuites': + $xmlTC .= $this->exportTestSuiteDataToXML($cNode, + $tproject_id, $tplan_id, $platform_id, $build_id); + break; + + case 'testcases': + if (is_null($tcaseMgr)) { + $tcaseMgr = new testcase($this->db); + } + // testcase::LATEST_VERSION, + $tcaseExportOptions['EXEC_ORDER'] = $linkedItems[$cNode['id']][$platform_id]['node_order']; + + $filter_lv = array( + 'exec_status' => 'ALL', + 'active_status' => 'ALL', + 'tplan_id' => $tplan_id, + 'platform_id' => $platform_id + ); + $output_lv = array( + 'output' => 'simple' + ); + // get tc versions linked in current testplan for current platform + $info = $tcaseMgr->get_linked_versions($cNode['id'], + $filter_lv, $output_lv); + if (! is_null($info)) { + $tcversID = key($info); + } + + // get users assigned to tc version in current testplan for the current build + $versionAssignInfo = $tcaseMgr->getVersionExecAssignment( + $tcversID, $tplan_id, $build_id); + $userList = array(); + // extract user names + if (! is_null($versionAssignInfo)) { + foreach ($versionAssignInfo[$tcversID][$platform_id] as $vaInfo) { + $assignedTesterId = intval($vaInfo['user_id']); + if ($assignedTesterId) { + $user = tlUser::getByID($this->db, + $assignedTesterId); + if ($user) { + $userList[] = $user->getDisplayName(); + } + } + } + } + (! empty($userList)) ? $tcaseExportOptions['ASSIGNED_USER'] = $userList : $tcaseExportOptions['ASSIGNED_USER'] = null; + + $xmlTC .= $tcaseMgr->exportTestCaseDataToXML( + $cNode['id'], $cNode['tcversion_id'], $tproject_id, + testcase::NOXMLHEADER, $tcaseExportOptions); + break; + } + } + } + + if (isset($container['id'])) { + $xmlTC .= "
    "; + } + return $xmlTC; + } + + /** + */ + private function getFeatureAssignments($tplan_id, $filters = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ "; + + $my['filters'] = array( + 'build' => null, + 'tcversion' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $sql .= " SELECT COALESCE(UA.user_id,-1) AS user_id, " . + " TPTCV.id AS feature_id, B.id AS build_id, TPTCV.platform_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id AND UA.build_id = B.id " . + " WHERE TPTCV.testplan_id={$tplan_id} "; + + if (! is_null($my['filters']['build'])) { + $sql .= " AND B.id IN (" . + implode(',', (array) $my['filters']['build']) . ") "; + } + if (! is_null($my['filters']['tcversion'])) { + $sql .= " AND TPTCV.tcversion_id IN (" . + implode(',', (array) $my['filters']['tcversion']) . ") "; + } + + return $this->db->fetchMapRowsIntoMap($sql, 'feature_id', 'build_id'); + } + + /** + * getSkeleton + * + * get structure with Test suites and Test Cases + * Filters that act on test cases work on attributes that are common to all + * test cases versions: test case name + * + * Development Note: + * Due to the tree structure is not so easy to try to do as much as filter as + * possibile using SQL. + * + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getSkeleton($id, $tprojectID, $filters = null, + $options = null) + { + $items = array(); + $my['options'] = array( + 'recursive' => false, + 'exclude_testcases' => false, + 'remove_empty_branches' => false + ); + + $my['filters'] = array( + 'exclude_node_types' => $this->nt2exclude, + 'exclude_children_of' => $this->nt2exclude_children, + 'exclude_branches' => null, + 'testcase_name' => null, + 'testcase_id' => null, + 'execution_type' => null, + 'platform_id' => null, + 'additionalWhereClause' => null + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($my['options']['exclude_testcases']) { + $my['filters']['exclude_node_types']['testcase'] = 'exclude me'; + } + + // transform some of our options/filters on something the 'worker' will understand + // when user has request filter by test case name, we do not want to display empty branches + + // If we have choose any type of filter, we need to force remove empty test suites + // + if (! is_null($my['filters']['testcase_name']) || + ! is_null($my['filters']['testcase_id']) || + ! is_null($my['filters']['execution_type']) || + ! is_null($my['filters']['exclude_branches']) || + ! is_null($my['filters']['platform_id']) || + $my['options']['remove_empty_branches']) { + $my['options']['remove_empty_nodes_of_type'] = 'testsuite'; + } + + $method2call = $my['options']['recursive'] ? 'getSubtreeRec' : '_get_subtree'; + $tcaseSet = array(); + if ($my['options']['recursive']) { + $this->$method2call($id, $tprojectID, $items, $tcaseSet, + $my['filters'], $my['options']); + } else { + $this->$method2call($id, $tprojectID, $items, $my['filters'], + $my['options']); + } + return array( + $items, + $tcaseSet + ); + } + + /** + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getSubtreeRec($tplan_id, $node_id, &$pnode, &$itemSet, + $filters = null, $options = null) + { + static $qnum; + static $my; + static $exclude_branches; + static $exclude_children_of; + static $node_types; + static $tcaseFilter; + static $tcversionFilter; + static $staticSql; + static $debugMsg; + + if (! $my) { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $qnum = 0; + $node_types = array_flip( + $this->tree_manager->get_available_node_types()); + $my['filters'] = array( + 'exclude_children_of' => null, + 'exclude_branches' => null, + 'additionalWhereClause' => '', + 'testcase_name' => null, + 'platform_id' => null, + 'testcase_id' => null, + 'active_testcase' => false + ); + + $my['options'] = array( + 'remove_empty_nodes_of_type' => null + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $exclude_branches = $my['filters']['exclude_branches']; + $exclude_children_of = $my['filters']['exclude_children_of']; + + $tcaseFilter['name'] = ! is_null($my['filters']['testcase_name']); + $tcaseFilter['id'] = ! is_null($my['filters']['testcase_id']); + + $tcaseFilter['is_active'] = ! is_null( + $my['filters']['active_testcase']) && + $my['filters']['active_testcase']; + $tcaseFilter['enabled'] = $tcaseFilter['name'] || $tcaseFilter['id'] || + $tcaseFilter['is_active']; + + $tcversionFilter['execution_type'] = ! is_null( + $my['filters']['execution_type']); + $tcversionFilter['enabled'] = $tcversionFilter['execution_type']; + + // this way I can manage code or description + if (! is_null($my['options']['remove_empty_nodes_of_type']) && + ! is_numeric($my['options']['remove_empty_nodes_of_type'])) { + $my['options']['remove_empty_nodes_of_type'] = $this->tree_manager->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; + } + + $platformFilter = ""; + if (! is_null($my['filters']['platform_id']) && + $my['filters']['platform_id'] > 0) { + $platformFilter = " AND T.platform_id = " . + intval($my['filters']['platform_id']); + } + + // Create invariant sql sentences + $staticSql[0] = " /* $debugMsg - Get ONLY TestSuites */ " . + " SELECT NHTS.node_order AS spec_order," . + " NHTS.node_order AS node_order, NHTS.id, NHTS.parent_id," . + " NHTS.name, NHTS.node_type_id, 0 AS tcversion_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTS" . + " WHERE NHTS.node_type_id = {$this->tree_manager->node_descr_id['testsuite']} " . + " AND NHTS.parent_id = "; + $staticSql[1] = " /* $debugMsg - Get ONLY Test Cases with version linked to (testplan,platform) */ " . + " SELECT NHTC.node_order AS spec_order, " . + " TPTCV.node_order AS node_order, NHTC.id, NHTC.parent_id, " . + " NHTC.name, NHTC.node_type_id, TPTCV.tcversion_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTCV.id " . + " WHERE NHTC.node_type_id = {$this->tree_manager->node_descr_id['testcase']} " . + " AND TPTCV.testplan_id = " . intval($tplan_id) . + " {$platformFilter} " . " AND NHTC.parent_id = "; + } + + $target = intval($node_id); + $sql = $staticSql[0] . $target . " UNION " . $staticSql[1] . $target; + + if ($tcaseFilter['enabled']) { + foreach ($tcaseFilter as $key => $apply) { + if ($apply) { + switch ($key) { + case 'name': + $sql .= " AND NHTC.name LIKE '%{$my['filters']['testcase_name']}%' "; + break; + + case 'id': + $sql .= " AND NHTC.id = {$my['filters']['testcase_id']} "; + break; + } + } + } + } + + $sql .= " ORDER BY node_order,id"; + + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + if (null == $rs || count($rs) == 0) { + return $qnum; + } + + foreach ($rs as $row) { + if (! isset($exclude_branches[$row['id']])) { + $node = $row + + array( + 'node_type' => $this->tree_manager->node_types[$row['node_type_id']], + 'node_table' => $this->tree_manager->node_tables_by['id'][$row['node_type_id']] + ); + $node['childNodes'] = null; + + if ($node['node_table'] == 'testcases') { + $node['leaf'] = true; + $node['external_id'] = ''; + $itemSet['nindex'][] = $node['id']; + } + + // why we use exclude_children_of ? + // 1. Sometimes we don't want the children if the parent is a testcase, + // due to the version management + // + if (! isset( + $exclude_children_of[$node_types[$row['node_type_id']]])) { + // Keep walking (Johny Walker Whisky) + $this->getSubtreeRec($tplan_id, $row['id'], $node, $itemSet, + $my['filters'], $my['options']); + } + + // Have added this logic, because when export test plan will be developed + // having a test spec tree where test suites that do not contribute to test plan + // are pruned/removed is very important, to avoid additional processing + // + // If node has no childNodes, we check if this kind of node without children + // can be removed. + // + $doRemove = is_null($node['childNodes']) && + ($node['node_type_id'] == + $my['options']['remove_empty_nodes_of_type']); + if (! $doRemove) { + $pnode['childNodes'][] = $node; + } + } + } + + return $qnum; + } + + /** + */ + private function getNotRunAllBuildsForPlatform($id, $platformID, + $buildSet = null) + { + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($safe_id, $buildsCfg,) = $this->helperGetHits($id, $platformID, + $buildSet); + + $sql = "/* $debugMsg */ " . + " SELECT count(0) AS COUNTER ,NHTCV.parent_id AS tcase_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON " . + " E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND TPTCV.platform_id " . $safe_id['platform'] . + " AND E.status IS NULL "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy . " HAVING COUNT(0) = " . intval($buildsCfg['count']); + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsNotRunForBuildAndPlatform($id, $platformID, $buildID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe_id['tplan'] = intval($id); + $safe_id['platform'] = intval($platformID); + $safe_id['build'] = intval($buildID); + + $sql = "/* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.status, B.id AS build_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + " /* Needed to get TEST CASE ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Need to Get Execution Info on REQUESTED build set */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = B.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND TPTCV.platform_id = " . $safe_id['platform'] . " AND B.id = " . + $safe_id['build'] . " AND E.status IS NULL "; + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getNotRunAtLeastOneBuildForPlatform($id, $platformID, + $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list (, $buildsCfg,) = $this->helperGetHits($id, $platformID, $buildSet); + + $sql = "/* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Needed to get TEST CASE ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Need to Get Execution Info on REQUESTED build set */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . + " AND E.build_in IN ({$buildsCfg['inClause']}) " . + " WHERE TPTCV.testplan_id = $id " . + " AND TPTCV.platform_id={$platformID} " . + " AND E.build_in IN ({$buildsCfg['inClause']}) " . + " AND E.status IS NULL "; + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * returns recordset with test cases that has requested status + * (only statuses that are written to DB => this does not work for not run) + * for LAST EXECUTION on build Set provided, for a platform. + * + * FULL means that we have to have SAME STATUS on all builds present on set. + * If build set is NOT PROVIDED, we will use ALL ACTIVE BUILDS + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsSingleStatusFull($id, $platformID, $status, + $buildSet = null) + { + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($safe_id, $buildsCfg, $sqlLEBBP) = $this->helperGetHits($id, + $platformID, $buildSet); + + $sql = " /* $debugMsg */ " . " /* Count() to be used on HAVING */ " . + " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD and PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.build_id = B.id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.tcversion_id = LEBBP.tcversion_id " . + " AND E.testplan_id = LEBBP.testplan_id " . + " AND E.platform_id = LEBBP.platform_id " . + " AND E.build_id = LEBBP.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND TPTCV.platform_id=" . $safe_id['platform'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . " AND E.status ='" . + $this->db->prepare_string($status) . "'"; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy . " HAVING COUNT(0) = " . intval($buildsCfg['count']); + + unset($safe_id, $buildsCfg, $sqlLEBBP); + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsNotRunFullOnPlatform($id,$platformID,$buildSet) + * + * returns recordset with: + * test cases with NOT RUN status on ALL builds in build set (full), for a platform. + * + * If build set is null + * test cases with NOT RUN status on ALL ACTIVE builds (full), for a platform. + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getHitsNotRunFullOnPlatform($id, $platformID, + $buildSet = null) + { + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($safe_id, $buildsCfg,) = $this->helperGetHits($id, $platformID, + $buildSet); + + $sql = " /* $debugMsg */ " . " /* Count() to be used on HAVING */ " . + " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON " . + " E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = B.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND TPTCV.platform_id = " . $safe_id['platform'] . + " AND E.status IS NULL "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy . " HAVING COUNT(0) = " . intval($buildsCfg['count']); + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsStatusSetFullOnPlatform($id,$platformID,$statusSet,$buildQty=0) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON ALL builds in set (full) , for a platform + * + * If build set is not provided, thena analisys will be done on + * ALL ACTIVE BUILDS + * + * + * IMPORTANT / CRITIC: This has NOT BE USED FOR NOT RUN, + * there is an special method for NOT RUN status. + * + * Example: + * + * Test Plan: PLAN B + * Builds: B1,B2,B3 + * Test Cases: TC-100, TC-200,TC-300 + * + * Test Case - Build - LAST Execution status + * TC-100 B1 Passed + * TC-100 B2 FAILED + * TC-100 B3 Not Run + * + * TC-200 B1 FAILED + * TC-200 B2 FAILED + * TC-200 B3 BLOCKED + * + * TC-300 B1 Passed + * TC-300 B2 Passed + * TC-300 B3 BLOCKED + * + * TC-400 B1 FAILED + * TC-400 B2 BLOCKED + * TC-400 B3 FAILED + * + * Request 1: + * Provide test cases with status (LAST EXECUTION) in ('Passed','BLOCKED') + * ON ALL ACTIVE Builds + * + * ANSWER: + * TC-300 + * + * Request 2: + * Provide test cases with status in ('FAILED','BLOCKED') + * ON ALL ACTIVE Builds + * + * ANSWER: + * TC-300, TC-400 + * + * @return + * + * @internal revisions + * @since 1.9.4 + * 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches + */ + private function getHitsStatusSetFullOnPlatform($id, $platformID, $statusSet, + $buildSet = null) + { + + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, $buildsCfg, $sqlLEBBP) = $this->helperGetHits($id, + $platformID, $buildSet); + + $dummy = $this->sanitizeExecStatus((array) $statusSet); + $statusInClause = implode("','", $dummy); + + // ATTENTION: + // if I've requested (Passed or Blocked) on ALL BUILDS + // Have 2 results for build number. + // + // That logic is wrong when filtering for the SAME STATUS on ALL builds. + // Maybe copy/paste-error on refactoring? + // Example: With 3 builds and filtering for FAILED or BLOCKED on ALL builds + // we have to get 3 hits for each test case to be shown, not six hits. + // $countTarget = intval($buildsCfg['count']) * count($dummy); + $countTarget = intval($buildsCfg['count']); + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql = " /* $debugMsg */ " . " /* Count() to be used on HAVING */ " . + " SELECT COUNT(0) AS COUNTER ,NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD and PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.build_id = B.id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.tcversion_id = LEBBP.tcversion_id " . + " AND E.testplan_id = LEBBP.testplan_id " . + " AND E.platform_id = LEBBP.platform_id " . + " AND E.build_id = LEBBP.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND TPTCV.platform_id=" . $safe_id['platform'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN ('{$statusInClause}')" . $groupBy . + " HAVING COUNT(0) = " . $countTarget; + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsNotRunPartialOnPlatform($id,$platformID,buildSet) + * + * returns recordset with: + * test cases with NOT RUN status at LEAST ON ONE off ALL ACTIVE builds (Partial), + * for a platform. + * + * Example: + * + * Test Plan: PLAN B + * Builds: B1,B2,B3 + * Test Cases: TC-100, TC-200,TC-300 + * + * Test Case - Build - LAST Execution status + * TC-100 B1 Passed + * TC-100 B2 FAILED + * TC-100 B3 Not Run => to have this status means THAT HAS NEVER EXECUTED ON B3 + * + * TC-200 B1 FAILED + * TC-200 B2 FAILED + * TC-200 B3 BLOCKED + * + * TC-300 B1 Passed + * TC-300 B2 Passed + * TC-300 B3 BLOCKED + * + * TC-400 B1 FAILED + * TC-400 B2 BLOCKED + * TC-400 B3 FAILED + * + * Request : + * Provide test cases with status 'NOT RUN' + * ON At Least ON OF all ACTIVE Builds + * + * ANSWER: + * TC-100 + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsNotRunPartialOnPlatform($id, $platformID, + $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($safe_id, $buildsCfg,) = $this->helperGetHits($id, $platformID, + $buildSet); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . + " /* Executions, looking for status NULL (remember NOT RUN is not written on DB) */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = B.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND TPTCV.platform_id = " . $safe_id['platform'] . + " AND E.status IS NULL "; + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsStatusSetPartialOnPlatform($id,$platformID,$statusSet,$buildSet) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * on LAST EXECUTION ON At Least ONE of builds present on Build Set (Partial), for a platform + * + * If build set is EMPTY + * on LAST EXECUTION ON At Least ONE of ALL ACTIVE builds (full), for a platform + * + * Example: + * + * Test Plan: PLAN B + * Builds: B1,B2,B3 + * Test Cases: TC-100, TC-200,TC-300 + * + * Test Case - Build - LAST Execution status + * TC-100 B1 Passed + * TC-100 B2 FAILED + * TC-100 B3 Not Run + * + * TC-200 B1 FAILED + * TC-200 B2 FAILED + * TC-200 B3 BLOCKED + * + * TC-300 B1 Passed + * TC-300 B2 Passed + * TC-300 B3 BLOCKED + * + * TC-400 B1 FAILED + * TC-400 B2 BLOCKED + * TC-400 B3 FAILED + * + * Request 1: + * Provide test cases with status in ('Passed','BLOCKED') + * ON At Least ONE, OF ALL ACTIVE Builds + * + * ANSWER: + * TC-200, TC300, TC400 + * + * Request 2: ???? + * Provide test cases with status in ('FAILED','BLOCKED') + * ON ALL ACTIVE Builds + * + * ANSWER: + * TC-300, TC-400 + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getHitsStatusSetPartialOnPlatform($id, $platformID, + $statusSet, $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $statusSet = $this->sanitizeExecStatus($statusSet); + $statusInClause = implode("','", $statusSet); + list ($safe_id, $buildsCfg, $sqlLEBBP) = $this->helperGetHits($id, + $platformID, $buildSet); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD and PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.build_id = B.id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.tcversion_id = LEBBP.tcversion_id " . + " AND E.testplan_id = LEBBP.testplan_id " . + " AND E.platform_id = LEBBP.platform_id " . + " AND E.build_id = LEBBP.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND TPTCV.platform_id=" . $safe_id['platform'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN('{$statusInClause}') "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy; + + unset($safe_id, $buildsCfg, $sqlLEBBP); + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsSameStatusFullOnPlatform($id,$platformID,$statusSet,$buildSet) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON ALL builds on buils set (full) , for a platform + * + * If build set is NULL => ON LAST EXECUTION ON ALL ACTIVE builds (full), for a platform + */ + public function getHitsSameStatusFullOnPlatform($id, $platformID, $statusSet, + $buildSet = null) + { + $statusSet = $this->sanitizeExecStatus($statusSet); + + return $this->helperGetHitsSameStatusOnPlatform('full', $id, $platformID, + $statusSet, $buildSet); + } + + /** + * getHitsSameStatusFullALOP($id,$statusSet,$buildSet) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON ALL builds on buils set (full) , for a platform + * + * If build set is NULL => ON LAST EXECUTION ON ALL ACTIVE builds (full), for a platform + */ + public function getHitsSameStatusFullALOP($id, $statusSet, $buildSet = null, + $opt = null) + { + // On Postgresql + // An output column’s name can be used to refer to the column’s value in ORDER BY and GROUP BY clauses, + // but not in the WHERE or HAVING clauses; there you must write out the expression instead. + $options = array( + 'onlyActiveBuilds' => true + ); + $options = array_merge($options, (array) $opt); + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, $buildsCfg, $sqlLEX) = $this->helperGetHits($id, null, + $buildSet, array( + 'ignorePlatform' => true + )); + if ($options['onlyActiveBuilds']) { + $buildsCfg['statusClause'] = " AND B.active = 1 "; + } + + // TICKET 5226: Filtering by test result did not always show the correct matches + // The filtering for "not run" status was simply not implemented for the case + // of not using platforms. + // Maybe that part was forgotten when refactoring the filters. + // + // I adopted logic from helperGetHitsSameStatusOnPlatform() to get this working. + // + $flippedStatusSet = array_flip($statusSet); // (code => idx) + $get = array( + 'notRun' => isset($flippedStatusSet[$this->notRunStatusCode]), + 'otherStatus' => false + ); + $hits = array( + 'notRun' => array(), + 'otherStatus' => array() + ); + + if ($get['notRun']) { + $notRunSQL = " /* $debugMsg */ " . + " /* COUNT() is needed as parameter for HAVING clause */ " . + " SELECT COUNT(0) AS COUNTER, NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON " . + " E.testplan_id = TPTCV.testplan_id " . " AND E.build_id = B.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND E.status IS NULL "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $notRunSQL .= $groupBy . " HAVING COUNT(0) = " . + intval($buildsCfg['count']); + + $hits['notRun'] = $this->db->fetchRowsIntoMap($notRunSQL, 'tcase_id'); + + unset($statusSet[$flippedStatusSet[$this->notRunStatusCode]]); + } + + $get['otherStatus'] = ! empty($statusSet); + if ($get['otherStatus']) { + $statusSet = $this->sanitizeExecStatus($statusSet); + $statusInClause = implode("','", $statusSet); + + // ATTENTION: + // if I've requested (Passed or Blocked) on ALL BUILDS + // Have 2 results for build number. + + // That logic is wrong when filtering for the SAME STATUS on ALL builds. + // Maybe copy/paste-error on refactoring? + // Example: With 3 builds and filtering for FAILED or BLOCKED on ALL builds + // we have to get 3 hits for each test case to be shown, not six hits. + // $countTarget = intval($buildsCfg['count']) * count($statusSet); + $countTarget = intval($buildsCfg['count']); + + $otherStatusSQL = " /* $debugMsg */ " . + " /* Count() to be used on HAVING - ALOP */ " . + " SELECT COUNT(0) AS COUNTER ,tcase_id " . " FROM ( " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id, E.build_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD IGNORE PLATFORM */ " . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.build_id = B.id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEX.id " . + " AND E.tcversion_id = LEX.tcversion_id " . + " AND E.testplan_id = LEX.testplan_id " . + " AND E.build_id = LEX.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN ('{$statusInClause}')" . " ) SQX "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $otherStatusSQL .= $groupBy . " HAVING COUNT(0) = " . $countTarget; + + $hits['otherStatus'] = $this->db->fetchRowsIntoMap($otherStatusSQL, + 'tcase_id'); + } + + // build results record set + $hitsFoundOn = array(); + $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; + $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; + + if ($hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus']) { + $items = array_merge(array_keys($hits['notRun']), + array_keys($hits['otherStatus'])); + } elseif ($hitsFoundOn['notRun']) { + $items = array_keys($hits['notRun']); + } elseif ($hitsFoundOn['otherStatus']) { + $items = array_keys($hits['otherStatus']); + } + + return is_null($items) ? $items : array_flip($items); + } + + /** + * getHitsNotRunOnBuildPlatform($id,$platformID,$buildID) + * + * returns recordset with: + * test cases with NOT RUN status on SPECIFIC build for a PLATFORM. + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getHitsNotRunOnBuildPlatform($id, $platformID, $buildID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ " . " SELECT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . " /* Work on Executions */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON " . + " E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . " AND E.build_id = " . + intval($buildID) . " WHERE TPTCV.testplan_id = " . intval($id) . + " AND TPTCV.platform_id = " . intval($platformID) . + " AND E.status IS NULL "; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + return is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + } + + /** + * getHitsNotRunOnBuildALOP($id,$buildID) + * + * returns recordset with: + * test cases with NOT RUN status on SPECIFIC build On AT LEAST ONE PLATFORM. (ALOP) + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getHitsNotRunOnBuildALOP($id, $buildID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . " /* Work on Executions */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E ON " . + " E.testplan_id = TPTCV.testplan_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . " AND E.build_id = " . + intval($buildID) . " WHERE TPTCV.testplan_id = " . intval($id) . + " AND E.status IS NULL "; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + return is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + } + + /** + * getHitsStatusSetOnBuildPlatform($id,$platformID,$buildID,$statusSet) + * + * returns recordset with: + * test cases with LAST EXECUTION STATUS on SPECIFIC build for a PLATFORM, IN status SET. + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsStatusSetOnBuildPlatform($id, $platformID, $buildID, + $statusSet) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, , $sqlLEBBP) = $this->helperGetHits($id, $platformID, + null, array( + 'buildID' => $buildID + )); + + $safe_id['build'] = intval($buildID); + $statusList = $this->sanitizeExecStatus((array) $statusSet); + + // Manage also not run + $notRunHits = null; + $dummy = array_flip($statusList); + if (isset($dummy[$this->notRunStatusCode])) { + tLog(__FUNCTION__ . ':: getHitsNotRunOnBuildPlatform', 'DEBUG'); + $notRunHits = $this->getHitsNotRunOnBuildPlatform($safe_id['tplan'], + $safe_id['platform'], $safe_id['build']); + unset($statusList[$dummy[$this->notRunStatusCode]]); + } + + $statusInClause = implode("','", $statusList); + $sql = " /* $debugMsg */ " . " SELECT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD and PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.build_id = " . $safe_id['build'] . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.tcversion_id = LEBBP.tcversion_id " . + " AND E.testplan_id = LEBBP.testplan_id " . + " AND E.platform_id = LEBBP.platform_id " . + " AND E.build_id = LEBBP.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND TPTCV.platform_id = " . + $safe_id['platform'] . " AND E.build_id = " . $safe_id['build'] . + " AND E.status IN('{$statusInClause}')"; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + $hits = is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + + $items = (array) $hits + (array) $notRunHits; + return count($items) > 0 ? $items : null; + } + + /** + * getHitsStatusSetOnBuildALOP($id,$buildID,$statusSet) + * + * returns recordset with: + * test cases with LAST EXECUTION STATUS on SPECIFIC build for At Least One PLATFORM, + * IN status SET. + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsStatusSetOnBuildALOP($id, $buildID, $statusSet) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, , $sqlLEX) = $this->helperGetHits($id, null, null, + array( + 'buildID' => $buildID, + 'ignorePlatform' => true + )); + + $safe_id['build'] = intval($buildID); + $statusList = $this->sanitizeExecStatus((array) $statusSet); + + // Manage also not run + $notRunHits = null; + $dummy = array_flip($statusList); + if (isset($dummy[$this->notRunStatusCode])) { + $notRunHits = $this->getHitsNotRunOnBuildALOP($safe_id['tplan'], + $safe_id['build']); + unset($statusList[$dummy[$this->notRunStatusCode]]); + } + + $statusInClause = implode("','", $statusList); + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by BUILD IGNORE PLATFORM */ " . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.build_id = " . $safe_id['build'] . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEX.id " . + " AND E.tcversion_id = LEX.tcversion_id " . + " AND E.testplan_id = LEX.testplan_id " . + " AND E.build_id = LEX.build_id " . " WHERE TPTCV.testplan_id = " . + $safe_id['tplan'] . " AND E.build_id = " . $safe_id['build'] . + " AND E.status IN('{$statusInClause}')"; + + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + $hits = is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + + $items = (array) $hits + (array) $notRunHits; + return count($items) > 0 ? $items : null; + } + + /** + * getHitsStatusSetOnLatestExecALOP($id,$statusSet,$buildSet) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * on ABSOLUTE LASTEST EXECUTION considering all builds on build set IGNORING platform. + * + * If build set is NULL, we will analyse ALL ACTIVE builds (full) IGNORING platform. + * + * IMPORTANT / CRITIC: THIS DOES NOT WORK for Not Run STATUS + * HAS NO SENSE, because Not Run IN NOT SAVED to DB + * => we can not find LATEST NON RUN + * Example: + * + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsStatusSetOnLatestExecALOP($id, $statusSet, + $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, $buildsCfg, $sqlLEX) = $this->helperGetHits($id, null, + $buildSet, array( + 'ignorePlatform' => true, + 'ignoreBuild' => true + )); + + // Check if 'not run' in present in statusSet => throw exception + $statusList = $this->sanitizeExecStatus((array) $statusSet); + $dummy = array_flip($statusList); + if (isset($dummy[$this->notRunStatusCode])) { + throw new Exception( + __METHOD__ . ':: Status Not Run can not be used'); + } + $statusInClause = implode("','", $statusList); + + $sql = " /* $debugMsg */ " . + " SELECT MAX(LEX.id) AS latest_exec_id ,NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution IGNORE BUILD, PLATFORM */ " . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEX.id " . + " AND E.tcversion_id = LEX.tcversion_id " . + " AND E.testplan_id = LEX.testplan_id " . " AND E.build_id = B.id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN('{$statusInClause}') "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy; + + unset($safe_id, $buildsCfg, $sqlLEX); + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + return is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + } + + /** + * getHitsStatusSetOnLatestExecOnPlatform($id,$platformID,$statusSet,$buildSet) + * + * returns recordset with: + * test cases that has at least ONE of requested status + * on ABSOLUTE LASTEST EXECUTION considering all builds on build set, for a platform + * + * If build set is NULL, we will analyse ALL ACTIVE builds (full), for a platform + * + * IMPORTANT / CRITIC: THIS DOES NOT WORK for Not Run STATUS + * HAS NO SENSE, because Not Run IN NOT SAVED to DB + * => we can not find LATEST NON RUN + * Example: + * + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsStatusSetOnLatestExecOnPlatform($id, $platformID, + $statusSet, $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + list ($safe_id, $buildsCfg, $sqlLEBP) = $this->helperGetHits($id, + $platformID, $buildSet, array( + 'ignoreBuild' => true + )); + + // Check if 'not run' in present in statusSet => throw exception + $statusList = $this->sanitizeExecStatus((array) $statusSet); + $dummy = array_flip($statusList); + if (isset($dummy[$this->notRunStatusCode])) { + throw new Exception( + __METHOD__ . ':: Status Not Run can not be used'); + } + $statusInClause = implode("','", $statusList); + + $sql = " /* $debugMsg */ " . + " SELECT MAX(LEBP.id) AS latest_exec_id ,NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution on PLATFORM IGNORE BUILD */ " . + " JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + // " AND LEBP.build_id = B.id " . + + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBP.id " . + " AND E.tcversion_id = LEBP.tcversion_id " . + " AND E.testplan_id = LEBP.testplan_id " . + " AND E.platform_id = LEBP.platform_id " . + // " AND E.build_id = LEBBP.build_id " . + + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND TPTCV.platform_id=" . $safe_id['platform'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN ('{$statusInClause}') "; + + $groupBy = ' GROUP BY ' . + ((DB_TYPE == 'mssql') ? 'parent_id ' : 'tcase_id'); + $sql .= $groupBy; + + unset($safe_id, $buildsCfg, $sqlLEBP); + $recordset = $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + return is_null($recordset) ? $recordset : array_flip( + array_keys($recordset)); + } + + /** + * getHitsSameStatusPartialOnPlatform($id,$platformID,$statusSet,$buildSet) + * + * returns recordset with: + * + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON AT LEAST ONE OF builds on build set, for a platform + * + * If build set is empty + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON AT LEAST ONE OF ALL ACTIVE builds, for a platform + */ + public function getHitsSameStatusPartialOnPlatform($id, $platformID, + $statusSet, $buildSet = null) + { + $statusSet = $this->sanitizeExecStatus((array) $statusSet); + return $this->helperGetHitsSameStatusOnPlatform('partial', $id, + $platformID, $statusSet, $buildSet); + } + + /** + * getHitsSameStatusPartialALOP($id,$statusSet) + * + * returns recordset with: + * + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON AT LEAST ONE OF builds on build set, for a platform + * + * If build set is empty + * test cases that has at least ONE of requested status + * ON LAST EXECUTION ON AT LEAST ONE OF ALL ACTIVE builds, for a platform + */ + public function getHitsSameStatusPartialALOP($id, $statusSet, + $buildSet = null) + { + $getHitsNotRunMethod = 'getHitsNotRunPartialALOP'; + $getHitsStatusSetMethod = 'getHitsStatusSetPartialALOP'; + + // Needed because, may be we will need to remove an element + $statusSetLocal = $this->sanitizeExecStatus((array) $statusSet); + + $items = null; + $hits = array( + 'notRun' => array(), + 'otherStatus' => array() + ); + $dummy = array_flip($statusSetLocal); // (code => idx) + $get = array( + 'notRun' => isset($dummy[$this->notRunStatusCode]), + 'otherStatus' => false + ); + + if ($get['notRun']) { + tLog(__METHOD__ . ":: \$tplan_mgr->$getHitsNotRunMethod", 'DEBUG'); + $hits['notRun'] = (array) $this->$getHitsNotRunMethod($id, $buildSet); + unset($statusSetLocal[$dummy[$this->notRunStatusCode]]); + } + + if ($get['otherStatus'] = (! empty($statusSetLocal))) { + tLog(__METHOD__ . ":: \$tplan_mgr->$getHitsStatusSetMethod", 'DEBUG'); + $hits['otherStatus'] = (array) $this->$getHitsStatusSetMethod($id, + $statusSetLocal, $buildSet); + } + + // build results recordset + $hitsFoundOn = array(); + $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; + $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; + + if ($get['notRun'] && $get['otherStatus']) { + if ($hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus']) { + $items = array_keys($hits['notRun']) + + array_keys($hits['otherStatus']); + } + } elseif ($get['notRun'] && $hitsFoundOn['notRun']) { + $items = array_keys($hits['notRun']); + } elseif ($get['otherStatus'] && $hitsFoundOn['otherStatus']) { + $items = array_keys($hits['otherStatus']); + } + + return is_null($items) ? $items : array_flip($items); + } + + /** + * getHitsStatusSetPartialALOP($id,$platformID,$statusSet,$buildSet) + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + private function getHitsStatusSetPartialALOP($id, $statusSet, + $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $statusSet = $this->sanitizeExecStatus($statusSet); + $statusInClause = implode("','", $statusSet); + list ($safe_id, $buildsCfg, $sqlLEX) = $this->helperGetHits($id, null, + $buildSet, array( + 'ignorePlatform' => true + )); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Latest Execution by JUST BUILD IGNORE PLATFORM */ " . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.build_id = B.id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + + // " AND LEX.platform_id = TPTCV.platform_id " . + + " /* Get STATUS INFO From Executions */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEX.id " . + " AND E.tcversion_id = LEX.tcversion_id " . + " AND E.testplan_id = LEX.testplan_id " . + " AND E.build_id = LEX.build_id " . + + // " AND E.platform_id = LEX.platform_id " . + + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND E.build_id IN ({$buildsCfg['inClause']}) " . + " AND E.status IN ('{$statusInClause}') "; + + unset($safe_id, $buildsCfg, $sqlLEX); + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * getHitsNotRunPartialALOP($id,buildSet) + * + * returns recordset with: + * + * test cases with NOT RUN status at LEAST ON ONE of builds + * present on build set (Partial), IGNORING Platforms + * + * If build set is empty: + * test cases with NOT RUN status at LEAST ON ONE of builds + * present on ACTIVE BUILDS set (Partial), IGNORING Platforms + * + * + * Example: (TO BE REWORKED) + * + * Test Plan: PLAN B + * Builds: B1,B2,B3 + * Test Cases: TC-100, TC-200,TC-300 + * + * Test Case - Build - LAST Execution status + * TC-100 B1 Passed + * TC-100 B2 FAILED + * TC-100 B3 Not Run => to have this status means THAT HAS NEVER EXECUTED ON B3 + * + * TC-200 B1 FAILED + * TC-200 B2 FAILED + * TC-200 B3 BLOCKED + * + * TC-300 B1 Passed + * TC-300 B2 Passed + * TC-300 B3 BLOCKED + * + * TC-400 B1 FAILED + * TC-400 B2 BLOCKED + * TC-400 B3 FAILED + * + * Request : + * Provide test cases with status 'NOT RUN' + * ON At Least ON OF all ACTIVE Builds + * + * ANSWER: + * TC-100 + * + * @return + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getHitsNotRunPartialALOP($id, $buildSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($safe_id, $buildsCfg,) = $this->helperGetHits($id, null, $buildSet, + array( + 'ignorePlatform' => true + )); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT NHTCV.parent_id AS tcase_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B ON B.testplan_id = TPTCV.testplan_id " . + $buildsCfg['statusClause'] . " /* Get Test Case ID */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON " . + " NHTCV.id = TPTCV.tcversion_id " . + " /* Executions, looking for status NULL (remember NOT RUN is not written on DB) */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = B.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " WHERE TPTCV.testplan_id = " . $safe_id['tplan'] . + " AND B.id IN ({$buildsCfg['inClause']}) " . " AND E.status IS NULL "; + + return $this->db->fetchRowsIntoMap($sql, 'tcase_id'); + } + + /** + * helperGetHitsSameStatusOnPlatform($mode,$id,$platformID,$statusSet,$buildSet) + * + * @internal revisions: + * 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches + */ + private function helperGetHitsSameStatusOnPlatform($mode, $id, $platformID, + $statusSet, $buildSet = null) + { + switch ($mode) { + case 'partial': + $getHitsNotRunMethod = 'getHitsNotRunPartialOnPlatform'; + $getHitsStatusSetMethod = 'getHitsStatusSetPartialOnPlatform'; + + break; + + case 'full': + $getHitsNotRunMethod = 'getHitsNotRunFullOnPlatform'; + $getHitsStatusSetMethod = 'getHitsStatusSetFullOnPlatform'; + break; + } + + // Needed because, may be we will need to remove an element + $statusSetLocal = $this->sanitizeExecStatus($statusSet); + + $items = null; + $hits = array( + 'notRun' => array(), + 'otherStatus' => array() + ); + + $dummy = array_flip($statusSetLocal); // (code => idx) + $get = array( + 'notRun' => isset($dummy[$this->notRunStatusCode]), + 'otherStatus' => false + ); + + if ($get['notRun']) { + $hits['notRun'] = (array) $this->$getHitsNotRunMethod($id, + $platformID, $buildSet); + unset($statusSetLocal[$dummy[$this->notRunStatusCode]]); + } + if ($get['otherStatus'] = (! empty($statusSetLocal))) { + $hits['otherStatus'] = (array) $this->$getHitsStatusSetMethod($id, + $platformID, $statusSetLocal, $buildSet); + } + + // build results recordset + $hitsFoundOn = array(); + $hitsFoundOn['notRun'] = count($hits['notRun']) > 0; + $hitsFoundOn['otherStatus'] = count($hits['otherStatus']) > 0; + + // 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches + // if($get['notRun'] && $get['otherStatus']) + // { + // if( $hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus'] ) + // The problem with this if clause: + // When $get['notRun'] && $get['otherStatus'] evaluated as TRUE but there were no hits + // in one of $hitsFoundOn['notRun'] or $hitsFoundOn['otherStatus'], then no results were returned at all. + + if ($hitsFoundOn['notRun'] && $hitsFoundOn['otherStatus']) { + // THIS DOES NOT WORK with numeric keys + // $items = array_merge(array_keys($hits['notRun']),array_keys($hits['otherStatus'])); + // $items = array_keys($hits['notRun']) + array_keys($hits['otherStatus']); + + // 20120919 - asimon - TICKET 5226: Filtering by test result did not always show the correct matches + // + // ATTENTION: Using the + operator instead of array_merge() for numeric keys is wrong! + // + // Quotes from documentation http://www.php.net/manual/en/function.array-merge.php: + // + // array_merge(): "If the input arrays have the same string keys, then the later value for that key + // will overwrite the previous one. If, however, the arrays contain numeric keys, + // the later value will not overwrite the original value, but will be appended." + // + // + operator: "The keys from the first array will be preserved. + // If an array key exists in both arrays, then the element from the first array will be used + // and the matching key's element from the second array will be ignored." + // + // That means if there were 5 results in $hits['notRun']) and 10 results in $hits['otherStatus']), + // the first 5 testcases from $hits['otherStatus']) were not in the result set because of the + operator. + // + // After using array_keys() we have numeric keys => we HAVE TO USE array_merge(). + $items = array_merge(array_keys($hits['notRun']), + array_keys($hits['otherStatus'])); + } elseif ($hitsFoundOn['notRun']) { + $items = array_keys($hits['notRun']); + } elseif ($hitsFoundOn['otherStatus']) { + $items = array_keys($hits['otherStatus']); + } + + return is_null($items) ? $items : array_flip($items); + } + + /** + * helperGetHits($id,$platformID,$buildSet,$options) + */ + protected function helperGetHits($id, $platformID, $buildSet = null, + $options = null) + { + $my['options'] = array( + 'buildID' => 0, + 'ignorePlatform' => false, + 'ignoreBuild' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $safe_id['tplan'] = intval($id); + $safe_id['platform'] = intval($platformID); + + $buildsCfg['statusClause'] = ""; + $buildsCfg['inClause'] = ""; + $buildsCfg['count'] = 0; + + if ($my['options']['buildID'] <= 0) { + if (is_null($buildSet)) { + $buildSet = array_keys( + $this->get_builds($id, self::ACTIVE_BUILDS)); + $buildsCfg['statusClause'] = " AND B.active = 1 "; + } + $buildsCfg['count'] = count($buildSet); + $buildsCfg['inClause'] = implode(",", $buildSet); + } else { + $buildsCfg['inClause'] = intval($my['options']['buildID']); + } + + $platformClause = " AND EE.platform_id = " . $safe_id['platform']; + $platformField = " ,EE.platform_id "; + if ($my['options']['ignorePlatform'] || $safe_id['platform'] == - 1) { // 20230826 + $platformClause = " "; + $platformField = " "; + } + + $buildField = " ,EE.build_id "; + if ($my['options']['ignoreBuild']) { + $buildField = " "; + } + + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id {$platformField} {$buildField} , - MAX(EE.id) AS id - FROM {$this->tables['executions']} EE - WHERE EE.testplan_id = " . $safe_id['tplan'] . - " AND EE.build_id IN ({$buildsCfg['inClause']}) - $platformClause - GROUP BY EE.tcversion_id,EE.testplan_id - {$platformField} {$buildField} "; - - return array($safe_id,$buildsCfg,$sqlLEX); - } - - - /** - * - * - * - */ - function helperConcatTCasePrefix($id) - { - // Get test case prefix - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $io = $this->tree_manager->get_node_hierarchy_info($id); - - list($prefix,$garbage) = $this->tcase_mgr->getPrefix(null,$io['parent_id']); - $prefix .= $this->tcaseCfg->glue_character; - $concat = $this->db->db->concat("'{$prefix}'",'TCV.tc_external_id'); - - unset($io); - unset($garbage); - unset($prefix); - - return $concat; - } - - - /** - * - * - * - */ - function helperColumns($tplanID,&$filters,&$opt) - { - $safe_id = intval($tplanID); - - $join['tsuite'] = ''; - $join['builds'] = ''; - - $order_by['exec'] = ''; - - $fields['tcase'] = ''; - $fields['tsuite'] = ''; - $fields['priority'] = " (urgency * importance) AS priority "; - - - $fields['ua'] = " UA.build_id AS assigned_build_id, UA.user_id,UA.type,UA.status,UA.assigner_id "; - - $default_fields['exec'] = " E.id AS exec_id, E.tcversion_number," . - " E.tcversion_id AS executed, E.testplan_id AS exec_on_tplan, {$more_exec_fields}" . - " E.execution_type AS execution_run_type, " . - " E.execution_ts, E.tester_id, E.notes as execution_notes," . - " E.build_id as exec_on_build, "; - - $fields['exec'] = $default_fields['exec']; - if($opt['execution_details'] == 'add_build') - { - $fields['exec'] .= 'E.build_id,B.name AS build_name, B.active AS build_is_active,'; - } - if( is_null($opt['forced_exec_status']) ) - { - $fields['exec'] .= " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status "; - } - else - { - $fields['exec'] .= " '{$opt['forced_exec_status']}' AS exec_status "; - } - - switch($opt['details']) - { - case 'full': - $fields['tcase'] = 'TCV.summary,'; - $fields['tsuite'] = 'NH_TSUITE.name as tsuite_name,'; - $join['tsuite'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . - " ON NH_TCASE.parent_id = NH_TSUITE.id "; - $opt['steps_info'] = true; - break; - - - case 'summary': - $fields['tcase'] = 'TCV.summary,'; - break; - - case 'spec_essential': // TICKET 4710 - $fields['exec'] = ''; - $fields['ua'] = ''; - $join['builds'] = ''; - $filters['ua'] = ''; - break; - - - case 'exec_tree_optimized': // TICKET 4710 - // if all following filters are NOT USED, then we will REMOVE executions JOIN - if( $filters['builds'] == '' && $filters['executions'] == '') - { - $join['builds'] = ''; - $join['executions'] = ''; - - $fields['exec'] = ''; - $fields['ua'] = ''; - - $filters['executions'] = ''; - $filters['ua'] = ''; - $order_by['exec'] = ''; - } - break; - - case 'report': // Results Performance - $fields['ua'] = ''; - $filters['ua'] = ''; - break; - } - - if( !is_null($opt['exclude_info']) ) - { - foreach($opt['exclude_info'] as $victim) - { - switch($victim) - { - case 'exec_info': - $fields['exec'] = ''; - $order_by['exec'] = " "; - $join['executions'] = ''; - break; - - case 'priority': - $fields['priority'] = ''; - break; - - case 'assigned_on_build': - case 'assigned_to': - $fields['ua'] = ''; - $filters['ua'] = ''; - break; - - } - - } - - } - - $fullEID = $this->helperConcatTCasePrefix($safe_id); - $sql = " SELECT NH_TCASE.parent_id AS testsuite_id, {$fields['tcase']} {$fields['tsuite']} " . - " NH_TCV.parent_id AS tc_id, NH_TCASE.node_order AS z, NH_TCASE.name," . - " TPTCV.platform_id, PLAT.name as platform_name ,TPTCV.id AS feature_id, " . - " TPTCV.tcversion_id AS tcversion_id, " . - " TPTCV.node_order AS execution_order, TPTCV.creation_ts AS linked_ts, " . - " TPTCV.author_id AS linked_by,TPTCV.urgency," . - " TCV.version AS version, TCV.active, TCV.tc_external_id AS external_id, " . - " TCV.execution_type,TCV.importance," . - " $fullEID AS full_external_id"; - - $dummy = array('exec','priority','ua'); - foreach($dummy as $ki) - { - $sql .= ($fields[$ki] != '' ? ',' . $fields[$ki] : ''); - } - - if( $fields['ua'] != '' ) - { - $join['ua'] = " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON " . - " UA.feature_id = TPTCV.id " . - " AND UA.build_id IN (" . $this->helperBuildInClause($tplanID,$filters,$opt) . ")"; - } - - - return array($sql,$join,$order_by); - } - - - /** - * - * - * - */ - function helperLastExecution($tplanID,$filters,$options) - { - $safe_id = intval($tplanID); - - $filterBuildActiveStatus = ''; - $activeStatus = null; - $domain = array('active' => 1, 'inactive' => 0 , 'any' => null); - if( !is_null($domain[$options['build_active_status']]) ) - { - $activeStatus = intval($domain[$options['build_active_status']]); - $filterBuildActiveStatus = " AND BB.active = " . $activeStatus; - } - - $buildsInClause = $this->helperBuildInClause($tplanID,$filters,$options); - - // Last Executions By Build and Platform (LEBBP) - $sqlLEBBP = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " /* use builds table to filter on active status */ " . - " JOIN {$this->tables['builds']} BB " . - " ON BB.id = EE.build_id " . - " WHERE EE.testplan_id=" . $safe_id . - " AND EE.build_id IN ({$buildsInClause}) " . - $filterBuildActiveStatus . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; - - unset($dummy); - unset($buildsInClause); - unset($filterBuildActiveStatus); - - return $sqlLEBBP; - } - - - - /** - * - * - * - */ - function helperBuildInClause($tplanID,$filters,$options) - { - $safe_id = intval($tplanID); - if(!is_null($filters['builds'])) - { - $dummy = $filters['builds']; - } - else - { - $activeStatus = null; - $domain = array('active' => 1, 'inactive' => 0 , 'any' => null); - if( !is_null($domain[$options['build_active_status']]) ) - { - $activeStatus = intval($domain[$options['build_active_status']]); - } - $dummy = array_keys($this->get_builds($safe_id,$activeStatus)); - } - - return implode(",",$dummy); - } - - - /** - * - * - * - */ - function helperBuildActiveStatus($filters,$options) - { - $activeStatus = null; - $domain = array('active' => 1, 'inactive' => 0 , 'any' => null); - if( !is_null($domain[$options['build_active_status']]) ) - { - $activeStatus = intval($domain[$options['build_active_status']]); - } - - return $activeStatus; - } - - - // This method is intended to return minimal data useful - // to create Execution Tree. - // Status on Latest execution on Build,Platform is needed - // - // @param int $id test plan id - // @param mixed $filters - // @param mixed $options - // - // [tcase_id]: default null => get any testcase - // numeric => just get info for this testcase - // - // - // [keyword_id]: default 0 => do not filter by keyword id - // numeric/array() => filter by keyword id - // - // - // [assigned_to]: default NULL => do not filter by user assign. - // array() with user id to be used on filter - // IMPORTANT NOTICE: this argument is affected by - // [assigned_on_build] - // - // [build_id]: default 0 or null => do not filter by build id - // numeric => filter by build id - // - // - // [cf_hash]: default null => do not filter by Custom Fields values - // - // - // [urgencyImportance] : filter only Tc's with certain (urgency*importance)-value - // - // [tsuites_id]: default null. - // If present only tcversions that are children of this testsuites - // will be included - // - // [exec_type] default null -> all types. - // [platform_id] - // - function getLinkedForExecTree($id,$filters=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - - $safe['tplan_id'] = intval($id); - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - - if( $my['filters']['build_id'] <= 0 ) - { - // CRASH IMMEDIATELY - throw new Exception( $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); - } - - if( !$my['green_light'] ) - { - // No query has to be run, because we know in advance that we are - // going to get NO RECORDS - return null; - } - - $platform4EE = " "; - if( !is_null($my['filters']['platform_id']) && (intval($my['filters']['platform_id'])) >0 ) - { - $platform4EE = " AND EE.platform_id = " . intval($my['filters']['platform_id']); - } - - $sqlLEBBP = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . - " AND EE.build_id = " . intval($my['filters']['build_id']) . - $platform4EE . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; - - - // When there is request to filter by BUG ID, because till now (@20131216) BUGS are linked - // only to EXECUTED test case versions, the not_run piece of union is USELESS - $union['not_run'] = null; - - // if(isset($my['filters']['bug_id']) - - if(!isset($my['filters']['bug_id'])) - { - // adding tcversion on output can be useful for Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - // - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . - // $fullEIDClause . - " TCV.tc_external_id AS external_id, " . - " TPTCV.node_order AS exec_order," . - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status " . - $my['fields']['tsuites'] . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['ua'] . - $my['join']['keywords'] . - $my['join']['cf'] . - $my['join']['tsuites'] . - - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.testplan_id = " . $safe['tplan_id'] . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = " . $my['filters']['build_id'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['not_run'] . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBBP.id IS NULL"; - } - - - $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . - // $fullEIDClause . - " TCV.tc_external_id AS external_id, " . - " TPTCV.node_order AS exec_order," . - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status " . - $my['fields']['tsuites'] . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['ua'] . - $my['join']['keywords'] . - $my['join']['cf'] . - $my['join']['tsuites'] . - - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.testplan_id = " . $safe['tplan_id'] . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . // TICKET 5191 - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = " . $my['filters']['build_id'] . - - $my['join']['bugs'] . // need to be here because uses join with E table alias - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['where']; - - return (is_null($union['not_run']) ? $union['exec'] : $union); - } - - - /* - * - * @used-by - * getLinkedForExecTree() - * getLinkedForTesterAssignmentTree() - * getLinkedTCVersionsSQL() - * getLinkedForExecTreeCross() - * getLinkedForExecTreeIVU() - * - * filters => - * 'tcase_id','keyword_id','assigned_to','exec_status','build_id', - * 'cf_hash','urgencyImportance', 'tsuites_id','platform_id', - * 'exec_type','tcase_name' - * - * - * CRITIC: - * cf_hash can contains Custom Fields that are applicable to DESIGN and - * TESTPLAN_DESIGN. - * - * Here we are generating SQL that will be used ON TESTPLAN - * related tables NOT ON TEST SPEC related tables. - * Due to this we are going to consider while building - * the query ONLY CF for TESTPLAN DESING - * - */ - function initGetLinkedForTree($tplanID,$filtersCfg,$optionsCfg) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $dummy = array('exec_type','tc_id','builds','keywords','executions','platforms'); - - $ic['fields']['tsuites'] = ''; - - $ic['join'] = array(); - $ic['join']['ua'] = ''; - $ic['join']['bugs'] = ''; - $ic['join']['cf'] = ''; - $ic['join']['tsuites'] = ''; - - - $ic['where'] = array(); - $ic['where']['where'] = ''; - $ic['where']['platforms'] = ''; - $ic['where']['not_run'] = ''; - $ic['where']['cf'] = ''; - - $ic['green_light'] = true; - $ic['filters'] = array('tcase_id' => null, 'keyword_id' => 0, - 'assigned_to' => null, 'exec_status' => null, - 'build_id' => 0, 'cf_hash' => null, - 'urgencyImportance' => null, - 'tsuites_id' => null, - 'platform_id' => null, 'exec_type' => null, - 'tcase_name' => null); - - $ic['options'] = array('hideTestCases' => 0, - 'include_unassigned' => false, - 'allow_empty_build' => 0, - 'addTSuiteOrder' => false, - 'addImportance' => false, 'addPriority' => false); - $ic['filters'] = array_merge($ic['filters'], (array)$filtersCfg); - $ic['options'] = array_merge($ic['options'], (array)$optionsCfg); - - - $ic['filters']['build_id'] = intval($ic['filters']['build_id']); - - if($ic['options']['addTSuiteOrder']) { - // PREFIX ALWAYS with COMMA - $ic['fields']['tsuites'] = ', NH_TSUITE.node_order AS tsuite_order '; - $ic['join']['tsuites'] = - " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . - " ON NH_TSUITE.id = NH_TCASE.parent_id "; - } - - // This NEVER HAPPENS for Execution Tree, but if we want to reuse - // this method for Tester Assignment Tree, we need to add this check - // - if( !is_null($ic['filters']['platform_id']) && $ic['filters']['platform_id'] > 0) { - $ic['filters']['platform_id'] = intval($ic['filters']['platform_id']); - $ic['where']['platforms'] = " AND TPTCV.platform_id = {$ic['filters']['platform_id']} "; - } - - - $ic['where']['where'] .= $ic['where']['platforms']; - - $dk = 'exec_type'; - if( !is_null($ic['filters'][$dk]) ) { - $ic['where'][$dk]= " AND TCV.execution_type IN (" . - implode(",",(array)$ic['filters'][$dk]) . " ) "; - $ic['where']['where'] .= $ic['where'][$dk]; - } - - $dk = 'tcase_id'; - if (!is_null($ic['filters'][$dk]) ) { - if( is_array($ic['filters'][$dk]) ) { - $ic['where'][$dk] = " AND NH_TCV.parent_id IN (" . implode(',',$ic['filters'][$dk]) . ")"; - } - else if ($ic['filters'][$dk] > 0) { - $ic['where'][$dk] = " AND NH_TCV.parent_id = " . intval($ic['filters'][$dk]); - } - else { - // Best Option on this situation will be signal - // that query will fail => NO SENSE run the query - $ic['green_light'] = false; - } - $ic['where']['where'] .= $ic['where'][$dk]; - } - - if (!is_null($ic['filters']['tsuites_id'])) { - $dummy = (array)$ic['filters']['tsuites_id']; - $ic['where']['where'] .= " AND NH_TCASE.parent_id IN (" . implode(',',$dummy) . ")"; - } - - if (!is_null($ic['filters']['urgencyImportance'])) { - $ic['where']['where'] .= $this->helper_urgency_sql($ic['filters']['urgencyImportance']); - } - - if( !is_null($ic['filters']['keyword_id']) ) { - - list($ic['join']['keywords'],$ic['where']['keywords']) = - $this->helper_keywords_sql($ic['filters']['keyword_id'],array('output' => 'array')); - - // **** // CHECK THIS CAN BE NON OK - $ic['where']['where'] .= $ic['where']['keywords']; - } - - - // If special user id TL_USER_ANYBODY is present in set of user id, - // we will DO NOT FILTER by user ID - if( !is_null($ic['filters']['assigned_to']) && - !in_array(TL_USER_ANYBODY,(array)$ic['filters']['assigned_to']) ) { - list($ic['join']['ua'],$ic['where']['ua']) = - $this->helper_assigned_to_sql($ic['filters']['assigned_to'], - $ic['options'],$ic['filters']['build_id']); - - $ic['where']['where'] .= $ic['where']['ua']; - - } - - if( isset($ic['options']['assigned_on_build']) && - !is_null($ic['options']['assigned_on_build']) ) { - $ic['join']['ua'] = - " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = " . $ic['options']['assigned_on_build'] . - " AND UA.type = {$this->execTaskCode} "; - } - - - if( !is_null($ic['filters']['tcase_name']) && - ($dummy = trim($ic['filters']['tcase_name'])) != '' ) { - $ic['where']['where'] .= " AND NH_TCASE.name LIKE '%{$dummy}%' "; - } - - - // Custom fields on testplan_design ONLY => AFFECTS run and NOT RUN. - if( isset($ic['filters']['cf_hash']) && !is_null($ic['filters']['cf_hash']) ) { - $ic['where']['cf'] = ''; - - list($ic['filters']['cf_hash'],$cf_sql) = $this->helperTestPlanDesignCustomFields($ic['filters']['cf_hash']); - - if(strlen(trim($cf_sql)) > 0) { - $ic['where']['cf'] .= " AND ({$cf_sql}) "; - $ic['join']['cf'] = - " JOIN {$this->tables['cfield_testplan_design_values']} CFTPD " . - " ON CFTPD.link_id = TPTCV.id "; - } - $ic['where']['where'] .= $ic['where']['cf']; - } - - - // I've made the choice to create the not_run key, - // to manage the not_run part of UNION on getLinkedForExecTree(). - // - // ATTENTION: - // on other methods: - // getLinkedForTesterAssignmentTree() - // getLinkedTCVersionsSQL() - // Still is used $ic['where']['where'] on BOTH components of UNION - // - // TICKET 5566: "Assigned to" does not work in "test execution" page - // TICKET 5572: Filter by Platforms - Wrong test case state count in test plan execution - $ic['where']['not_run'] = $ic['where']['where']; - - - // ************************************************************************ - // CRITIC - CRITIC - CRITIC - // Position on code flow is CRITIC - // CRITIC - CRITIC - CRITIC - // ************************************************************************ - if (!is_null($ic['filters']['exec_status'])) { - // $ic['where']['not_run'] = $ic['where']['where']; - $dummy = (array)$ic['filters']['exec_status']; - - $ic['where']['where'] .= " AND E.status IN ('" . implode("','",$dummy) . "')"; - - if( in_array($this->notRunStatusCode,$dummy) ) { - $ic['where']['not_run'] .= ' AND E.status IS NULL '; - } - else { - $ic['where']['not_run'] = $ic['where']['where']; - } - } - - // BUG ID HAS NO EFFECT ON NOT RUN (at least @20140126) - // bug_id => will be a list to create an IN() clause - if( isset($ic['filters']['bug_id']) && !is_null($ic['filters']['bug_id']) ) { - list($ic['join']['bugs'],$ic['where']['bugs']) = $this->helper_bugs_sql($ic['filters']['bug_id']); - $ic['where']['where'] .= $ic['where']['bugs']; - } - - return $ic; - } - - - /** - * - */ - function helperTestPlanDesignCustomFields($cfSet) - { - $type_domain = $this->cfield_mgr->get_available_types(); - $ret = null; - $cf_type = null; - foreach($cfSet as $id => $val) - { - $xx = $this->cfield_mgr->get_by_id($id); - if( $xx[$id]['enable_on_testplan_design'] ) - { - $ret[$id] = $val; - $cf_type[$id] = $type_domain[$xx[$id]['type']]; - } - } - - - $cf_sql = ''; - if( !is_null($ret) ) - { - $countmain = 1; - foreach( $ret as $cf_id => $cf_value) - { - if ( $countmain != 1 ) - { - $cf_sql .= " AND "; - } - - if (is_array($cf_value)) - { - $count = 1; - switch($cf_type[$cf_id]) - { - case 'multiselection list': - // - if( count($cf_value) > 1) - { - $combo = implode('|',$cf_value); - $cf_sql .= "( CFTPD.value = '{$combo}' AND CFTPD.field_id = {$cf_id} )"; - } - else - { - // close set, open set, is sandwiched, is alone - //$cf_sql .= "( (CFTPD.value LIKE '%|{$cf_value[0]}' AND CFTPD.field_id = {$cf_id}) OR " . - // " (CFTPD.value LIKE '{$cf_value[0]}|%' AND CFTPD.field_id = {$cf_id}) OR " . - // " (CFTPD.value LIKE '%|{$cf_value[0]}|%' AND CFTPD.field_id = {$cf_id}) OR " . - // " (CFTPD.value = '{$cf_value[0]}' AND CFTPD.field_id = {$cf_id}) )"; - - $cf_sql .= "( CFTPD.field_id = {$cf_id} AND " . - " (CFTPD.value LIKE '%|{$cf_value[0]}' OR " . - " CFTPD.value LIKE '{$cf_value[0]}|%' OR " . - " CFTPD.value LIKE '%|{$cf_value[0]}|%' OR " . - " CFTPD.value = '{$cf_value[0]}') )"; - } - break; - - default: - foreach ($cf_value as $value) - { - if ($count > 1) - { - $cf_sql .= " AND "; - } - - // When ARRAY NO LIKE but EQUAL - // Need to document what type of CF are managed as ARRAY - $cf_sql .= "( CFTPD.value = '{$value}' AND CFTPD.field_id = {$cf_id} )"; - $count++; - } - break; - } - - } - else - { - $cf_sql .= " ( CFTPD.value LIKE '%{$cf_value}%' AND CFTPD.field_id = {$cf_id} ) "; - } - $countmain++; - } - } - - return array($ret,$cf_sql); - } - - - - - - // This method is intended to return minimal data useful to create Test Plan Tree, - // for feature: - // test case tester execution assignment: - // PLATFORM IS NOT USED TO NAVIGATE => is not present on Settings Section. - // ONLY BUILD IS PRESENT on settings area - // - // - // Status on Latest execution on Build ANY PLATFORM is needed - // - // @param int $id test plan id - // @param mixed $filters - // @param mixed $options - // - // [tcase_id]: default null => get any testcase - // numeric => just get info for this testcase - // - // - // [keyword_id]: default 0 => do not filter by keyword id - // numeric/array() => filter by keyword id - // - // - // [assigned_to]: default NULL => do not filter by user assign. - // array() with user id to be used on filter - // IMPORTANT NOTICE: this argument is affected by - // [assigned_on_build] - // - // [build_id]: default 0 or null => do not filter by build id - // numeric => filter by build id - // - // - // [cf_hash]: default null => do not filter by Custom Fields values - // - // - // [urgencyImportance] : filter only Tc's with certain (urgency*importance)-value - // - // [tsuites_id]: default null. - // If present only tcversions that are children of this testsuites - // will be included - // - // [exec_type] default null -> all types. - // - function getLinkedForTesterAssignmentTree($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe['tplan_id'] = intval($id); - - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - // Need to detail better, origin of build_id. - // is got from GUI Filters area ? - if( ($my['options']['allow_empty_build'] == 0) && $my['filters']['build_id'] <= 0 ) - { - // CRASH IMMEDIATELY - throw new Exception( $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); - } - if( !$my['green_light'] ) - { - // No query has to be run, because we know in advance that we are - // going to get NO RECORDS - return null; - } - - $buildClause = array('lex' => (' AND EE.build_id = ' . $my['filters']['build_id']), - 'exec_join' => (" AND E.build_id = " . $my['filters']['build_id'])); - if( $my['options']['allow_empty_build'] && $my['filters']['build_id'] <= 0 ) - { - $buildClause = array('lex' => '','exec_join' => ''); - } - - // - // Platforms have NOTHING TO DO HERE - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . - $buildClause['lex'] . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.build_id "; - - // ------------------------------------------------------------------------------------- - // adding tcversion on output can be useful for Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - // - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . - " TCV.tc_external_id AS external_id, " . - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status " . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['ua'] . - $my['join']['keywords'] . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.testplan_id = " . $safe['tplan_id'] . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.id = LEX.id " . // 20120903 - $buildClause['exec_join'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['where'] . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEX.id IS NULL"; - - - $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . - " TCV.tc_external_id AS external_id, " . - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status " . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['ua'] . - $my['join']['keywords'] . - - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.testplan_id = " . $safe['tplan_id'] . - " JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.id = LEX.id " . // 20120903 - $buildClause['exec_join'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['where']; - - return $union; - } - - - /** - * - * - */ - function getLinkInfo($id,$tcase_id,$platform_id=null,$opt=null) - { - $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; - $safe_id = array('tplan_id' => 0, 'platform_id' => 0, 'tcase_id' => 0); - $safe_id['tplan_id'] = intval($id); - $safe_id['tcase_id'] = intval($tcase_id); - - // check and die? - $my = array('opt' => array('output' => 'version_info','tproject_id' => null, - 'build4assignment' => null, 'collapse' => false)); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = "/* $debugMsg */ " . - " SELECT TCV.id AS tcversion_id,TCV.version %%needle%% " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id "; - - $more_cols = ' '; - switch($my['opt']['output']) - { - case 'tcase_info': - if(is_null($my['opt']['tproject_id'])) - { - $dummy = $this->tree_manager->get_node_hierarchy_info($safe_id['tplan_id']); - $my['opt']['tproject_id'] = $dummy['parent_id']; - } - $pp = $this->tcase_mgr->getPrefix($safe_id['tcase_id'],$my['opt']['tproject_id']); - $prefix = $pp[0] . $this->tcaseCfg->glue_character; - $more_cols = ', NHTC.name, NHTC.id AS tc_id, ' . - $this->db->db->concat("'{$prefix}'",'TCV.tc_external_id') . ' AS full_external_id '; - - $sql .= " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id "; - break; - - case 'assignment_info': - if(is_null($my['opt']['build4assignment'])) - { - // CRASH IMMEDIATELY - throw new Exception(__METHOD__ . - ' When your choice is to get assignment_info ' . - " you need to provide build id using 'build4assignment'"); - } - // Go ahead - $safe_id['build_id'] = intval($my['opt']['build4assignment']); - - $more_cols = ',USERS.login,USERS.first,USERS.last' . - ',TPTCV.id AS feature_id,TPTCV.platform_id,PLAT.name AS platform_name' . - ',NHTCV.parent_id AS tc_id,UA.user_id,TCV.importance,TPTCV.urgency' . - ',(TCV.importance * TPTCV.urgency) AS priority '; - $sql .= " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . - " ON UA.build_id = " . $safe_id['build_id'] . - " AND UA.feature_id = TPTCV.id "; - - $sql .= " LEFT OUTER JOIN {$this->tables['platforms']} PLAT " . - " ON PLAT.id = TPTCV.platform_id "; - - $sql .= " LEFT OUTER JOIN {$this->tables['users']} USERS " . - " ON USERS.id = UA.user_id "; - - break; - - - case 'version_info': - $more_cols = ',TPTCV.platform_id'; - default: - break; - } - $sql = str_replace('%%needle%%',$more_cols,$sql) . - " WHERE TPTCV.testplan_id = {$safe_id['tplan_id']} " . - " AND NHTCV.parent_id = {$safe_id['tcase_id']} "; - - if( !is_null($platform_id) ) - { - if( ($safe_id['platform_id'] = intval($platform_id)) > 0) - { - $sql .= " AND TPTCV.platform_id = " . $safe_id['platform_id']; - } - } - - $rs = $this->db->get_recordset($sql); - if(!is_null($rs)) - { - $rs = $my['opt']['collapse'] ? $rs[0] : $rs; - } - return $rs; - } - - - - /** - * @used-by printDocument.php - * testplan.class.exportLinkedItemsToXML() - * testplan.class.exportForResultsToXML - */ - public function getLinkedStaticView($id,$filters=null,$options=null) - { - $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; - $my = array('filters' => '', 'options' => ''); - - $my['filters'] = array('platform_id' => null,'tsuites_id' => null, - 'tcaseSet' => null, 'build_id' => null); - $my['filters'] = array_merge($my['filters'],(array)$filters); - - $my['options'] = array('output' => 'map','order_by' => null, 'detail' => 'full'); - $my['options'] = array_merge($my['options'],(array)$options); - - $safe['tplan'] = intval($id); - $io = $this->tree_manager->get_node_hierarchy_info($safe['tplan']); - list($prefix,$garbage) = $this->tcase_mgr->getPrefix(null,$io['parent_id']); - unset($io); - $prefix .= $this->tcaseCfg->glue_character; - $feid = $this->db->db->concat("'{$prefix}'",'TCV.tc_external_id'); - - - $addWhere = array('platform' => '','tsuite' => '', 'tcases' => '', 'build' => ''); - $platQty = 0; - if( !is_null($my['filters']['platform_id']) ) - { - $dummy = (array)$my['filters']['platform_id']; - array_walk($dummy,'intval'); - $addWhere['platform'] = 'AND TPTCV.platform_id IN (' . implode(',',$dummy) . ')'; - $platQty = count((array)$my['filters']['platform_id']); - } - - if( !is_null($my['filters']['tsuites_id']) ) - { - $dummy = (array)$my['filters']['tsuites_id']; - array_walk($dummy,'intval'); - $addWhere['tsuite'] = 'AND NH_TCASE.parent_id IN (' . implode(',',$dummy) . ')'; - } - - if( !is_null($my['filters']['tcaseSet']) ) - { - $dummy = (array)$my['filters']['tcaseSet']; - array_walk($dummy,'intval'); - $addWhere['tsuite'] = 'AND NH_TCASE.id IN (' . implode(',',$dummy) . ')'; - } - - $join['build'] = ''; - $addField = '-1 AS assigned_to, '; - if( !is_null($my['filters']['build_id']) ) - { - $dummy = intval($my['filters']['build_id']); - $addWhere['build'] = 'AND UA.build_id =' . $dummy; - - $join['build'] = " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id "; - - $addField = " UA.user_id AS assigned_to,"; - } - - - - switch($my['options']['detail']) - { - case '4results': - $my['options']['output'] = 'array'; // FORCED - // have had some issues with query and ADODB on MySQL if only - // $sql = " SELECT NH_TCV.parent_id AS tc_id, {$feid} AS full_external_id,TCV.tc_external_id "; - // Need to understand why in future - $sql = "/* $debugMsg */ " . - " SELECT {$addField} NH_TCV.parent_id AS tc_id, TPTCV.platform_id, TPTCV.id AS feature_id, " . - " TCV.tc_external_id AS external_id, {$feid} AS full_external_id, TPTCV.tcversion_id "; - break; - - case 'full': - default: - $sql = "/* $debugMsg */ " . - " SELECT {$addField} NH_TCASE.parent_id AS testsuite_id, NH_TCV.parent_id AS tc_id, " . - " NH_TCASE.node_order AS spec_order, NH_TCASE.name," . - " TPTCV.platform_id, PLAT.name as platform_name, TPTCV.id AS feature_id, " . - " TPTCV.tcversion_id AS tcversion_id, " . - " TPTCV.node_order AS execution_order, TPTCV.urgency," . - " TCV.version AS version, TCV.active, TCV.summary," . - " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.importance," . - " {$feid} AS full_external_id, (TPTCV.urgency * TCV.importance) AS priority "; - break; - } - - $sql .=" FROM {$this->tables['nodes_hierarchy']} NH_TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCV.parent_id = NH_TCASE.id " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id " . - $join['build'] . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id "; - - $sql .= " WHERE TPTCV.testplan_id={$safe['tplan']} " . - " {$addWhere['platform']} {$addWhere['tsuite']} {$addWhere['build']}"; - - - switch($my['options']['output']) - { - case 'array': - $rs = $this->db->get_recordset($sql); - break; - - case 'map': - if($platQty == 1) - { - $rs = $this->db->fetchRowsIntoMap($sql,'tc_id',0,-1,'assigned_to'); - } - else - { - $rs = $this->db->fetchMapRowsIntoMap($sql,'platform_id','tc_id'); - } - break; - } - - return $rs; - } - - - // need to recheck, because probably we need to be able - // to work without build id provided - // has to be based on TREE USED on features like: - // assign test case execution or set test case urgency - // - public function getLTCVNewGeneration($id,$filters=null,$options=null) - { - $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; - $my = array('filters' => array(), - 'options' => array('allow_empty_build' => 1,'addPriority' => false, - 'accessKeyType' => 'tcase+platform', - 'addImportance' => false,'addExecInfo' => true, - 'assigned_on_build' => null, - 'ua_user_alias' => '', 'includeNotRun' => true, - 'ua_force_join' => false, - 'orderBy' => null)); - $amk = array('filters','options'); - foreach($amk as $mk) - { - $my[$mk] = array_merge($my[$mk], (array)$$mk); - } - - if( !is_null($sql2do = $this->getLinkedTCVersionsSQL($id,$my['filters'],$my['options'])) ) - { - // need to document better - if( is_array($sql2do) ) - { - $sql2run = $sql2do['exec']; - if($my['options']['includeNotRun']) - { - $sql2run .= ' UNION ' . $sql2do['not_run']; - } - } - else - { - $sql2run = $sql2do; - } - - // added when trying to fix: - // TICKET 5788: test case execution order not working on RIGHT PANE - // Anyway this did not help - if( !is_null($my['options']['orderBy']) ) - { - $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . $my['options']['orderBy']; - } - - switch($my['options']['accessKeyType']) - { - case 'tcase+platform': - $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run,'tcase_id','platform_id'); // ,0,-1,'user_id'); - break; - - case 'tcase+platform+stackOnUser': - $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol($sql2run,'tcase_id','platform_id','user_id'); - break; - - case 'index': - $tplan_tcases = $this->db->get_recordset($sql2run); - break; - - default: - $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run,'tcase_id'); - break; - } - } - return $tplan_tcases; - } - - - - - /** - * - * @used-by testplan::getLTCVNewGeneration() - * @use initGetLinkedForTree() - * - * @parameter map filters - * keys: - * 'tcase_id','keyword_id','assigned_to','exec_status','build_id', 'cf_hash', - * 'urgencyImportance', 'tsuites_id','platform_id', 'exec_type','tcase_name' - * filters defaults values are setted on initGetLinkedForTree() - * - * @parameter map options - * some defaults are managed here - * - * defaults for keys: 'hideTestCases','include_unassigned','allow_empty_build' - * are setted on initGetLinkedForTree(). - * - * - * - * @internal revisions - * @since 1.9.13 - */ - function getLinkedTCVersionsSQL($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe['tplan_id'] = intval($id); - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - - $mop = array('options' => array('addExecInfo' => false,'specViewFields' => false, - 'assigned_on_build' => null, 'testSuiteInfo' => false, - 'addPriority' => false,'addImportance' => false, - 'ignorePlatformAndBuild' => false, - 'ignoreBuild' => false, 'ignorePlatform' => false, - 'ua_user_alias' => '', 'ua_force_join' => false, - 'build_is_active' => false)); - - $my['options'] = array_merge($mop['options'],$my['options']); - - if( ($my['options']['allow_empty_build'] == 0) && $my['filters']['build_id'] <= 0 ) - { - // CRASH IMMEDIATELY - throw new Exception( $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); - } - if( !$my['green_light'] ) - { - // No query has to be run, because we know in advance that we are - // going to get NO RECORDS - return null; - } - - $buildClause = array('lex' => (' AND EE.build_id = ' . $my['filters']['build_id']), - 'exec_join' => (" AND E.build_id = " . $my['filters']['build_id'])); - if( $my['options']['allow_empty_build'] && $my['filters']['build_id'] <= 0 ) - { - $buildClause = array('lex' => '','exec_join' => ''); - } - - // TICKET 5182: Add/Remove Test Cases -> Trying to assign new platform to executed test cases - // Before this ticket LEX was just on BUILD => ignoring platforms - // Need to understand if will create side effects. - // - if($my['options']['ignorePlatformAndBuild']) - { - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . - " GROUP BY EE.tcversion_id,EE.testplan_id "; - - $platformLEX = " "; - $platformEXEC = " "; - - } - else if ($my['options']['ignoreBuild'] && $my['options']['build_is_active']) - { - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " JOIN {$this->tables['builds']} B " . - " ON B.id = EE.build_id " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . " AND B.active = 1" . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id, B.id"; - - $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; - $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; - - } - else if ($my['options']['ignoreBuild']) - { - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id"; - - // TICKET 5182 - $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; - $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; - - } - else - { - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $safe['tplan_id'] . - $buildClause['lex'] . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; - - // TICKET 5182 - $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; - $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; - - } - - // ------------------------------------------------------------------------------------- - // adding tcversion on output can be useful for Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - // - - // TICKET 5165: Issues with DISTINCT CLAUSE on TEXT field - // Do not know if other usages are going to cry due to missing fields - // - // $commonFields = " SELECT NH_TCASE.id AS tcase_id,NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . - // " TCV.tc_external_id AS external_id, TCV.execution_type," . - // " TCV.summary, TCV.preconditions,TPTCV.id AS feature_id," . - // " TPTCV.platform_id,PLAT.name AS platform_name,TPTCV.node_order AS execution_order,". - // " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status "; - // - // $fullEID = $this->helperConcatTCasePrefix($safe['tplan_id']); - $commonFields = " SELECT NH_TCASE.name AS tcase_name, NH_TCASE.id AS tcase_id, " . - " NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . - " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.status," . - " TPTCV.id AS feature_id," . - ($my['options']['addPriority'] ? "(TPTCV.urgency * TCV.importance) AS priority," : '') . - " TPTCV.platform_id,PLAT.name AS platform_name,TPTCV.node_order AS execution_order,". - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status, " . - " E.execution_duration, " . - ($my['options']['addImportance'] ? " TCV.importance," : '') . - $this->helperConcatTCasePrefix($safe['tplan_id']) . " AS full_external_id "; - - // used on tester assignment feature when working at test suite level - if( !is_null($my['options']['assigned_on_build']) ) - { - $commonFields .= ",UA.user_id {$my['options']['ua_user_alias']} "; - } - - if($my['options']['addExecInfo']) - { - $commonFields .= ",COALESCE(E.id,0) AS exec_id,E.tcversion_number,E.build_id AS exec_on_build,E.testplan_id AS exec_on_tplan"; - } - - if($my['options']['specViewFields']) - { - $commonFields .= ",NH_TCASE.name,TPTCV.creation_ts AS linked_ts,TPTCV.author_id AS linked_by" . - ",NH_TCASE.parent_id AS testsuite_id"; - } - - $my['join']['tsuites'] = ''; - if($my['options']['testSuiteInfo']) - { - $commonFields .= ",NH_TSUITE.name AS tsuite_name "; - $my['join']['tsuites'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . - " ON NH_TSUITE.id = NH_TCASE.parent_id "; - } - - if($my['options']['ua_force_join']) - { - $my['join']['ua'] = str_replace('LEFT OUTER',' ', $my['join']['ua']); - } - - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . $commonFields . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['tsuites'] . - $my['join']['ua'] . - $my['join']['keywords'] . - - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - $platformLEX . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.testplan_id = " . $safe['tplan_id'] . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - $platformEXEC . - " AND E.id = LEX.id " . // TICKET 6159 - $buildClause['exec_join'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . ' ' . - $my['where']['where'] . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEX.id IS NULL"; - - - $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . $commonFields . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - $my['join']['tsuites'] . - $my['join']['ua'] . - $my['join']['keywords'] . - - " JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - $platformLEX . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.testplan_id = " . $safe['tplan_id'] . - - " JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - $platformEXEC . - " AND E.id = LEX.id " . // TICKET 6159 - $buildClause['exec_join'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . ' ' . - $my['where']['where']; - - return $union; - } - - - /** - * - * - */ - function getPublicAttr($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT is_public FROM {$this->tables['testplans']} " . - " WHERE id =" . intval($id); - $ret = $this->db->get_recordset($sql); - return $ret[0]['is_public']; - } - - - - /** - * - * - */ - function getBuildByCriteria($id, $criteria, $filters=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('active' => null, 'open' => null); - $my['opt'] = array_merge($my['opt'],(array)$options); - - - switch($criteria) - { - case 'maxID': - $sql = " /* $debugMsg */ " . - " SELECT MAX(id) AS id,testplan_id, name, notes, active, is_open," . - " release_date,closed_on_date " . - " FROM {$this->tables['builds']} WHERE testplan_id = {$id} " ; - break; - } - - if(!is_null($my['opt']['active'])) - { - $sql .= " AND active = " . intval($my['opt']['active']) . " "; - } - if( !is_null($my['opt']['open']) ) - { - $sql .= " AND is_open = " . intval($my['opt']['open']) . " "; - } - - $rs = $this->db->get_recordset($sql); - - return $rs; - } - - - /** - * - * - */ - function writeExecution($ex) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $execNotes = $this->db->prepare_string($ex->notes); - if(property_exists($ex, 'executionTimeStampISO')) - { - $execTS = "'" . $ex->executionTimeStampISO . "'"; - } - else - { - $execTS = $this->db->db_now(); - } - - $sql = "/* {$debugMsg} */ " . - "INSERT INTO {$this->tables['executions']} " . - " (testplan_id, platform_id, build_id, " . - " tcversion_id, tcversion_number, status, " . - " tester_id, execution_ts, execution_type, notes) " . - " VALUES(" . - " {$ex->testPlanID},{$ex->platformID},{$ex->buildID}," . - " {$ex->testCaseVersionID}, {$ex->testCaseVersionNumber},'{$ex->statusCode}'," . - " {$ex->testerID},{$execTS}, {$ex->executionType}, '{$execNotes}')"; - - $this->db->exec_query($sql); - $execID = $this->db->insert_id($this->tables['executions']); - - // Do we have steps exec info? - if (property_exists($ex,'steps')) { - // steps [] of stepExec - // - // Same execution ts that WHOLE Testcase, the field do not exists in table - // - // Here as JSON - // { - // "stepNumber":1, - // "notes":"This is an execution created via REST API", - // "statusCode":"b", - // } - // - // Brute force approach: - // Get all steps from specification - $ALLSTEPS=0; - $gssOpt = ['fields2get' => 'TCSTEPS.id,TCSTEPS.step_number', - 'accessKey' => "step_number", - 'renderGhostSteps' => false, - 'renderImageInline' => false]; - $stepsSpec = $this->tcase_mgr->getStepsSimple($ex->testCaseVersionID,$ALLSTEPS,$gssOpt); - - foreach ($ex->steps as $stepExec) { - // if step number does not exist -> ignore it in silence - if (isset($stepsSpec[$stepExec->stepNumber])) { - $stepID = intval($stepsSpec[$stepExec->stepNumber]["id"]); - $sql = " INSERT INTO {$this->tables['execution_tcsteps']} - (execution_id,tcstep_id,notes,status) "; - $values = " VALUES ( {$execID}, {$stepID}," . - "'" . $this->db->prepare_string($stepExec->notes) . "'," . - "'" . $this->db->prepare_string($stepExec->statusCode) . "')"; - $sql .= " " . $values; - - $this->db->exec_query($sql); - } - } - } - - - return $execID; - } - - /** - * - */ - function getExecutionDurationForSet($execIDSet) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - "SELECT E.id, E.execution_duration AS duration ". - "FROM {$this->tables['executions']} E " . - "WHERE id IN (" . implode(',',$execIDSet) . ')'; - return $this->db->get_recordset($sql); - } - - /** - * - */ - function exportForResultsToXML($id,$context,$optExport = array(),$filters=null) - { - $my['filters'] = array('platform_id' => null, 'tcaseSet' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - - $item = $this->get_by_id($id,array('output' => 'minimun','caller' => __METHOD__)); - - $xmlString = "\n" . - "\n"; - $xmlString .= "\n"; - $xmlString .= "\t\n"; - - $xmlString .= "\t\n"; - - if( isset($context['build_id']) && $context['build_id'] > 0) - { - $dummy = $this->get_builds($id); - $info = $dummy[$context['build_id']]; - $xmlString .= "\t\n"; - } - - // get target platform (if exists) - if( $context['platform_id'] > 0) - { - $info = $this->platform_mgr->getByID($context['platform_id']); - $xmlString .= "\t\n"; - $my['filters']['platform_id'] = $context['platform_id']; - } - - // - // - // - // u0113 - // - // 2008-09-08 14:00:00 - // p - // functionality works great - // - $mm = $this->getLinkedStaticView($id,$my['filters'],array('output' => 'array','detail' => '4results')); - - - if(!is_null($mm) && ($tcaseQty=count($mm)) > 0) - { - - // Custom fields processing - $xcf = $this->cfield_mgr->get_linked_cfields_at_execution($item['tproject_id'],1,'testcase'); - if(!is_null($xcf) && ($cfQty=count($xcf)) > 0) - { - for($gdx=0; $gdx < $tcaseQty; $gdx++) - { - $mm[$gdx]['xmlcustomfields'] = $this->cfield_mgr->exportValueAsXML($xcf); - } - } - - // Test Case Steps - $gso = array('fields2get' => 'TCSTEPS.id,TCSTEPS.step_number', 'renderGhostSteps' => false, 'renderImageInline' => false); - $stepRootElem = "{{XMLCODE}}"; - $stepTemplate = "\n" . '' . "\n" . - "\t||STEP_NUMBER||\n" . - "\tp\n" . - "\t||NOTES||\n" . - "\n"; - $stepInfo = array("||STEP_NUMBER||" => "step_number", "||NOTES||" => "notes"); - - for($gdx=0; $gdx < $tcaseQty; $gdx++) - { - $mm[$gdx]['steps'] = $this->tcase_mgr->getStepsSimple($mm[$gdx]['tcversion_id'],0,$gso); - if(!is_null($mm[$gdx]['steps'])) - { - $qs = count($mm[$gdx]['steps']); - for($scx=0; $scx < $qs; $scx++) - { - $mm[$gdx]['steps'][$scx]['notes'] = 'your step exec notes'; - } - $mm[$gdx]['xmlsteps'] = exportDataToXML($mm[$gdx]['steps'],$stepRootElem,$stepTemplate,$stepInfo,true); - } - } - } - - - $xml_root = null; - $xml_template = "\n" . - "\t" . "\n" . - "\t\t" . "X" . "\n" . - "\t\t" . "test link rocks " . "\n" . - "\t\t" . "put login here" . "\n" . - "\t\t" . "" . "\n" . - "\t\t" . "YYYY-MM-DD HH:MM:SS" . "\n" . - "\t\t" . "put one of your bugs id here (repeat the line as many times you need)" . "\n" . - "\t\t" . "put another of your bugs id here" . "\n" . - "\t\t" . "||STEPS||" . "\n" . - "\t\t" . "||CUSTOMFIELDS||" . "\n" . - "\t" . "\n"; - - $xml_mapping = null; - $xml_mapping = array("{{FULLEXTERNALID}}" => "full_external_id", "||CUSTOMFIELDS||" => "xmlcustomfields", - "||STEPS||" => "xmlsteps"); - - $linked_testcases = exportDataToXML($mm,$xml_root,$xml_template,$xml_mapping,('noXMLHeader'=='noXMLHeader')); - $zorba = $xmlString .= $linked_testcases . "\n\n"; - - return $zorba; - } - - - /** - * - */ - function setActive($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . "UPDATE {$this->tables['testplans']} SET active=1 WHERE id=" . intval($id); - $this->db->exec_query($sql); - } - - /** - * - */ - function setInactive($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . "UPDATE {$this->tables['testplans']} SET active=0 WHERE id=" . intval($id); - $this->db->exec_query($sql); - } - - - - /** - * - */ - function getByAPIKey($apiKey,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('checkIsValid' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - $fields2get = $my['opt']['checkIsValid'] ? 'id' : '*'; - - $safe = $this->db->prepare_string($apiKey); - - $sql = "/* $debugMsg */ " . - " SELECT {$fields2get} FROM {$this->tables['testplans']} " . - " WHERE api_key = '{$safe}'"; - - $rs = $this->db->get_recordset($sql); - return ($rs ? $rs[0] : null); - } - - - - /** - * - * @used-by planEdit.php - */ - function getFileUploadRelativeURL($id) - { - // do_action,tplan_id as expected in planEdit.php - $url = "lib/plan/planEdit.php?do_action=fileUpload&tplan_id=" . intval($id); - return $url; - } - - /** - * @used-by planEdit.php - */ - function getDeleteAttachmentRelativeURL($id) - { - // do_action,tplan_id as expected in planEdit.php - $url = "lib/plan/planEdit.php?do_action=deleteFile&tplan_id=" . intval($id) . "&file_id=" ; - return $url; - } - - - /** - * @used-by - */ - function getAllExecutionsWithBugs($id,$platform_id=null,$build_id=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe['tplan_id'] = intval($id); - $fullEID = $this->helperConcatTCasePrefix($safe['tplan_id']); - - $sql = " /* $debugMsg */ ". - " SELECT DISTINCT E.id AS exec_id,EB.bug_id,NHTC.id AS tcase_id, NHTC.id AS tc_id, " . - " NHTC.name AS name, NHTSUITE.name AS tsuite_name, TCV.tc_external_id AS external_id," . - " $fullEID AS full_external_id " . - " FROM {$this->tables['executions']} E " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.tcversion_id = E.tcversion_id " . - " AND TPTCV.testplan_id = E.testplan_id " . - " JOIN {$this->tables['execution_bugs']} EB " . - " ON EB.execution_id = E.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = E.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = E.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTSUITE " . - " ON NHTSUITE.id = NHTC.parent_id " . - " WHERE TPTCV.testplan_id = " . $safe['tplan_id']; - - $items = $this->db->get_recordset($sql); - return $items; - } - - - /** - * - */ - public function getLTCVOnTestPlan($id,$filters=null,$options=null) - { - $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; - $my = array('filters' => array(), - 'options' => array('allow_empty_build' => 1,'addPriority' => false, - 'accessKeyType' => 'tcase+platform', - 'addImportance' => false, - 'includeNotRun' => true, 'orderBy' => null)); - $amk = array('filters','options'); - foreach($amk as $mk) - { - $my[$mk] = array_merge($my[$mk], (array)$$mk); - } - - $my['options']['ignorePlatformAndBuild'] = true; - if( !is_null($sql2do = $this->getLinkedTCVersionsSQL($id,$my['filters'],$my['options'])) ) - { - // need to document better - if( is_array($sql2do) ) - { - $sql2run = $sql2do['exec']; - if($my['options']['includeNotRun']) - { - $sql2run .= ' UNION ' . $sql2do['not_run']; - } - } - else - { - $sql2run = $sql2do; - } - - // added when trying to fix: - // TICKET 5788: test case execution order not working on RIGHT PANE - // Anyway this did not help - if( !is_null($my['options']['orderBy']) ) - { - $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . $my['options']['orderBy']; - } - - switch($my['options']['accessKeyType']) - { - case 'tcase+platform': - $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run,'tcase_id','platform_id'); // ,0,-1,'user_id'); - break; - - case 'tcase+platform+stackOnUser': - $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol($sql2run,'tcase_id','platform_id','user_id'); - break; - - case 'index': - $tplan_tcases = $this->db->get_recordset($sql2run); - break; - - default: - $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run,'tcase_id'); - break; - } - } - return $tplan_tcases; - } - - - /** - * - */ - public function getLTCVOnTestPlanPlatform($id,$filters=null,$options=null) - { - $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; - $my = array('filters' => array(), - 'options' => array('allow_empty_build' => 1,'addPriority' => false, - 'accessKeyType' => 'tcase+platform', - 'addImportance' => false, - 'includeNotRun' => true, 'orderBy' => null)); - $amk = array('filters','options'); - foreach($amk as $mk) - { - $my[$mk] = array_merge($my[$mk], (array)$$mk); - } - - $my['options']['ignoreBuild'] = true; - if( !is_null($sql2do = $this->getLinkedTCVersionsSQL($id,$my['filters'],$my['options'])) ) - { - // need to document better - if( is_array($sql2do) ) - { - $sql2run = $sql2do['exec']; - if($my['options']['includeNotRun']) - { - $sql2run .= ' UNION ' . $sql2do['not_run']; - } - } - else - { - $sql2run = $sql2do; - } - - // added when trying to fix: - // TICKET 5788: test case execution order not working on RIGHT PANE - // Anyway this did not help - if( !is_null($my['options']['orderBy']) ) - { - $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . $my['options']['orderBy']; - } - - switch($my['options']['accessKeyType']) - { - case 'tcase+platform': - $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run,'tcase_id','platform_id'); // ,0,-1,'user_id'); - break; - - case 'tcase+platform+stackOnUser': - $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol($sql2run,'tcase_id','platform_id','user_id'); - break; - - case 'index': - $tplan_tcases = $this->db->get_recordset($sql2run); - break; - - default: - $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run,'tcase_id'); - break; - } - } - return $tplan_tcases; - } - - - - /** - * - */ - function getLinkedItems($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ ". - " SELECT parent_id AS tcase_id,TPTCV.platform_id,TPTCV.node_order " . - " FROM {$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . - " WHERE TPTCV.testplan_id = " . intval($id); - - $items = $this->db->fetchMapRowsIntoMap($sql,'tcase_id','platform_id'); - - return $items; - } - - - - /** - * - * @since 1.9.14 - */ - function getLinkedFeatures($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('filters' => array(), $options => array()); - $my['filters'] = array('platform_id' => null); - $my['options'] = array('accessKey' => array('tcase_id','platform_id')); - - $my['filters'] = array_merge($my['filters'],(array)$filters); - $my['options'] = array_merge($my['options'],(array)$options); - - $sql = " /* $debugMsg */ ". - " SELECT parent_id AS tcase_id,TPTCV.platform_id,TPTCV.id AS feature_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . - " WHERE TPTCV.testplan_id = " . intval($id); - - if(!is_null($my['filters']['platform_id'])) - { - $sql .= " AND TPTCV.platform_id = " . intval($my['filters']['platform_id']); - } - - if(!is_null($my['filters']['tcase_id'])) - { - $sql .= " AND NHTC.parent_id IN (" . implode(',',$my['filters']['tcase_id']) . ") "; - } - - $items = $this->db->fetchMapRowsIntoMap($sql,$my['options']['accessKey'][0], - $my['options']['accessKey'][1]); - - return $items; - } - - /** - * @used-by getFilteredLinkedVersions() - specview.php - * @used-by indirectly on tc_exec_assigment.php for test suites - * - */ - function getLinkedTCVXmen($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe['tplan_id'] = intval($id); - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - // adding tcversion on output can be useful for Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - $commonFields = "/* $debugMsg */ " . - " SELECT NH_TCASE.name AS tcase_name, NH_TCASE.id AS tcase_id, " . - " NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . - " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.status," . - " TPTCV.id AS feature_id," . - ($my['options']['addPriority'] ? "(TPTCV.urgency * TCV.importance) AS priority," : '') . - " TPTCV.platform_id,TPTCV.node_order AS execution_order,". - ($my['options']['addImportance'] ? " TCV.importance," : '') . - $this->helperConcatTCasePrefix($safe['tplan_id']) . " AS full_external_id "; - - $commonFields .= ",UA.user_id"; - $commonFields .= ",NH_TCASE.name,TPTCV.creation_ts AS linked_ts,TPTCV.author_id AS linked_by" . - ",NH_TCASE.parent_id AS testsuite_id"; - - $commonFields .= ",NH_TSUITE.name AS tsuite_name "; - - $my['join']['tsuites'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . - " ON NH_TSUITE.id = NH_TCASE.parent_id "; - - - - $sql = $commonFields . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['tsuites'] . - $my['join']['ua'] . - $my['join']['keywords'] . - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['where']; - - $items = $this->db->fetchMapRowsIntoMapStackOnCol($sql,'tcase_id','platform_id','user_id'); - return $items; - } - - /** - * - */ - function getExecCountOnBuild($id,$build_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe['tplan_id'] = intval($id); - $safe['build_id'] = intval($build_id); - - $sql = "/* debugMsg */ SELECT COUNT(0) AS qty " . - " FROM {$this->tables['executions']} E " . - " WHERE E.testplan_id = {$safe['tplan_id']} " . - " AND E.build_id = {$safe['build_id']}"; - - $rs = $this->db->get_recordset($sql); - - return $rs[0]['qty']; - } - - /** - * - */ - function getFeatureByID($feature_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $target = (array)$feature_id; - foreach($target as $idx => $tg) - { - $target[$idx] = intval($tg); - } - $inSet = implode(',', $target); - - $sql = " /* $debugMsg */ ". - " SELECT parent_id AS tcase_id,tcversion_id,platform_id,TPTCV.id " . - " FROM {$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.tcversion_id = NHTC.id " . - " WHERE TPTCV.id IN (" . $inSet . ")"; - - $items = $this->db->fetchRowsIntoMap($sql,'id'); - return $items; - } - - - /** - * - */ - function getVersionLinked($tplan_id, $tcase_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ - SELECT tcversion_id + MAX(EE.id) AS id + FROM {$this->tables['executions']} EE + WHERE EE.testplan_id = " . $safe_id['tplan'] . + " AND EE.build_id IN ({$buildsCfg['inClause']}) + $platformClause + GROUP BY EE.tcversion_id,EE.testplan_id + {$platformField} {$buildField} "; + + return array( + $safe_id, + $buildsCfg, + $sqlLEX + ); + } + + /** + */ + public function helperConcatTCasePrefix($id) + { + // Get test case prefix + // $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $io = $this->tree_manager->get_node_hierarchy_info($id); + + list ($prefix, $garbage) = $this->tcaseMgr->getPrefix(null, + $io['parent_id']); + $prefix .= $this->tcaseCfg->glue_character; + $concat = $this->db->db->concat("'{$prefix}'", 'TCV.tc_external_id'); + + unset($io); + unset($garbage); + unset($prefix); + + return $concat; + } + + /** + */ + private function helperColumns($tplanID, &$filters, &$opt) + { + $safe_id = intval($tplanID); + + $join['tsuite'] = ''; + $join['builds'] = ''; + + $order_by['exec'] = ''; + + $fields['tcase'] = ''; + $fields['tsuite'] = ''; + $fields['priority'] = " (urgency * importance) AS priority "; + + $fields['ua'] = " UA.build_id AS assigned_build_id, UA.user_id,UA.type,UA.status,UA.assigner_id "; + + $default_fields['exec'] = " E.id AS exec_id, E.tcversion_number," . + " E.tcversion_id AS executed, E.testplan_id AS exec_on_tplan, {$more_exec_fields}" . + " E.execution_type AS execution_run_type, " . + " E.execution_ts, E.tester_id, E.notes as execution_notes," . + " E.build_id as exec_on_build, "; + + $fields['exec'] = $default_fields['exec']; + if ($opt['execution_details'] == 'add_build') { + $fields['exec'] .= 'E.build_id,B.name AS build_name, B.active AS build_is_active,'; + } + if (is_null($opt['forced_exec_status'])) { + $fields['exec'] .= " COALESCE(E.status,'" . $this->notRunStatusCode . + "') AS exec_status "; + } else { + $fields['exec'] .= " '{$opt['forced_exec_status']}' AS exec_status "; + } + + switch ($opt['details']) { + case 'full': + $fields['tcase'] = 'TCV.summary,'; + $fields['tsuite'] = 'NH_TSUITE.name as tsuite_name,'; + $join['tsuite'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . + " ON NH_TCASE.parent_id = NH_TSUITE.id "; + $opt['steps_info'] = true; + break; + + case 'summary': + $fields['tcase'] = 'TCV.summary,'; + break; + + case 'spec_essential': // TICKET 4710 + $fields['exec'] = ''; + $fields['ua'] = ''; + $join['builds'] = ''; + $filters['ua'] = ''; + break; + + case 'exec_tree_optimized': // TICKET 4710 + // if all following filters are NOT USED, then we will REMOVE executions JOIN + if ($filters['builds'] == '' && $filters['executions'] == '') { + $join['builds'] = ''; + $join['executions'] = ''; + + $fields['exec'] = ''; + $fields['ua'] = ''; + + $filters['executions'] = ''; + $filters['ua'] = ''; + $order_by['exec'] = ''; + } + break; + + case 'report': // Results Performance + $fields['ua'] = ''; + $filters['ua'] = ''; + break; + } + + if (! is_null($opt['exclude_info'])) { + foreach ($opt['exclude_info'] as $victim) { + switch ($victim) { + case 'exec_info': + $fields['exec'] = ''; + $order_by['exec'] = " "; + $join['executions'] = ''; + break; + + case 'priority': + $fields['priority'] = ''; + break; + + case 'assigned_on_build': + case 'assigned_to': + $fields['ua'] = ''; + $filters['ua'] = ''; + break; + } + } + } + + $fullEID = $this->helperConcatTCasePrefix($safe_id); + $sql = " SELECT NH_TCASE.parent_id AS testsuite_id, {$fields['tcase']} {$fields['tsuite']} " . + " NH_TCV.parent_id AS tc_id, NH_TCASE.node_order AS z, NH_TCASE.name," . + " TPTCV.platform_id, PLAT.name as platform_name ,TPTCV.id AS feature_id, " . + " TPTCV.tcversion_id AS tcversion_id, " . + " TPTCV.node_order AS execution_order, TPTCV.creation_ts AS linked_ts, " . + " TPTCV.author_id AS linked_by,TPTCV.urgency," . + " TCV.version AS version, TCV.active, TCV.tc_external_id AS external_id, " . + " TCV.execution_type,TCV.importance," . + " $fullEID AS full_external_id"; + + $dummy = array( + 'exec', + 'priority', + 'ua' + ); + foreach ($dummy as $ki) { + $sql .= ($fields[$ki] != '' ? ',' . $fields[$ki] : ''); + } + + if ($fields['ua'] != '') { + $join['ua'] = " LEFT OUTER JOIN {$this->tables['user_assignments']} UA ON " . + " UA.feature_id = TPTCV.id " . " AND UA.build_id IN (" . + $this->helperBuildInClause($tplanID, $filters, $opt) . ")"; + } + + return array( + $sql, + $join, + $order_by + ); + } + + /** + */ + private function helperLastExecution($tplanID, $filters, $options) + { + $safe_id = intval($tplanID); + + $filterBuildActiveStatus = ''; + $activeStatus = null; + $domain = array( + 'active' => 1, + 'inactive' => 0, + 'any' => null + ); + if (! is_null($domain[$options['build_active_status']])) { + $activeStatus = intval($domain[$options['build_active_status']]); + $filterBuildActiveStatus = " AND BB.active = " . $activeStatus; + } + + $buildsInClause = $this->helperBuildInClause($tplanID, $filters, + $options); + + // Last Executions By Build and Platform (LEBBP) + $sqlLEBBP = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " /* use builds table to filter on active status */ " . + " JOIN {$this->tables['builds']} BB " . " ON BB.id = EE.build_id " . + " WHERE EE.testplan_id=" . $safe_id . + " AND EE.build_id IN ({$buildsInClause}) " . $filterBuildActiveStatus . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; + + unset($dummy); + unset($buildsInClause); + unset($filterBuildActiveStatus); + + return $sqlLEBBP; + } + + /** + */ + private function helperBuildInClause($tplanID, $filters, $options) + { + $safe_id = intval($tplanID); + if (! is_null($filters['builds'])) { + $dummy = $filters['builds']; + } else { + $activeStatus = null; + $domain = array( + 'active' => 1, + 'inactive' => 0, + 'any' => null + ); + if (! is_null($domain[$options['build_active_status']])) { + $activeStatus = intval($domain[$options['build_active_status']]); + } + $dummy = array_keys($this->get_builds($safe_id, $activeStatus)); + } + + return implode(",", $dummy); + } + + /** + */ + private function helperBuildActiveStatus($options) + { + $activeStatus = null; + $domain = array( + 'active' => 1, + 'inactive' => 0, + 'any' => null + ); + if (! is_null($domain[$options['build_active_status']])) { + $activeStatus = intval($domain[$options['build_active_status']]); + } + + return $activeStatus; + } + + // This method is intended to return minimal data useful + // to create Execution Tree. + // Status on Latest execution on Build,Platform is needed + // + // @param int $id test plan id + // @param mixed $filters + // @param mixed $options + // + // [tcase_id]: default null => get any testcase + // numeric => just get info for this testcase + // + // + // [keyword_id]: default 0 => do not filter by keyword id + // numeric/array() => filter by keyword id + // + // + // [assigned_to]: default NULL => do not filter by user assign. + // array() with user id to be used on filter + // IMPORTANT NOTICE: this argument is affected by + // [assigned_on_build] + // + // [build_id]: default 0 or null => do not filter by build id + // numeric => filter by build id + // [cf_hash]: default null => do not filter by Custom Fields values + // + // + // [urgencyImportance] : filter only Tc's with certain (urgency*importance)-value + // + // [tsuites_id]: default null. + // If present only tcversions that are children of this testsuites + // will be included + // + // [exec_type] default null -> all types. + // [platform_id] + public function getLinkedForExecTree($id, $filters = null, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe['tplan_id'] = intval($id); + $my = $this->initGetLinkedForTree($filters, $options); + + if ($my['filters']['build_id'] <= 0) { + // CRASH IMMEDIATELY + throw new Exception( + $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); + } + + if (! $my['green_light']) { + // No query has to be run, because we know in advance that we are + // going to get NO RECORDS + return null; + } + + $platform4EE = " "; + if (! is_null($my['filters']['platform_id']) && + (intval($my['filters']['platform_id'])) > 0) { + $platform4EE = " AND EE.platform_id = " . + intval($my['filters']['platform_id']); + } + + $sqlLEBBP = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . + " AND EE.build_id = " . intval($my['filters']['build_id']) . + $platform4EE . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; + + // When there is request to filter by BUG ID, because till now (@20131216) BUGS are linked + // only to EXECUTED test case versions, the not_run piece of union is USELESS + $union['not_run'] = null; + + // if(isset($my['filters']['bug_id']) + + if (! isset($my['filters']['bug_id'])) { + // adding tcversion on output can be useful for Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . + // $fullEIDClause . + " TCV.tc_external_id AS external_id, " . + " TPTCV.node_order AS exec_order," . " COALESCE(E.status,'" . + $this->notRunStatusCode . "') AS exec_status " . + $my['fields']['tsuites'] . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['ua'] . $my['join']['keywords'] . $my['join']['cf'] . + $my['join']['tsuites'] . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.testplan_id = " . $safe['tplan_id'] . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = " . + $my['filters']['build_id'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . $my['where']['not_run'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBBP.id IS NULL"; + } + + $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . + // $fullEIDClause . + " TCV.tc_external_id AS external_id, " . + " TPTCV.node_order AS exec_order," . " COALESCE(E.status,'" . + $this->notRunStatusCode . "') AS exec_status " . + $my['fields']['tsuites'] . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['ua'] . $my['join']['keywords'] . $my['join']['cf'] . + $my['join']['tsuites'] . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.testplan_id = " . $safe['tplan_id'] . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = " . + $my['filters']['build_id'] . $my['join']['bugs'] . // need to be here because uses join with E table alias + + " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . + $my['where']['where']; + + return is_null($union['not_run']) ? $union['exec'] : $union; + } + + /* + * + * @used-by + * getLinkedForExecTree() + * getLinkedForTesterAssignmentTree() + * getLinkedTCVersionsSQL() + * getLinkedForExecTreeCross() + * getLinkedForExecTreeIVU() + * + * filters => + * 'tcase_id','keyword_id','assigned_to','exec_status','build_id', + * 'cf_hash','urgencyImportance', 'tsuites_id','platform_id', + * 'exec_type','tcase_name' + * + * + * CRITIC: + * cf_hash can contains Custom Fields that are applicable to DESIGN and + * TESTPLAN_DESIGN. + * + * Here we are generating SQL that will be used ON TESTPLAN + * related tables NOT ON TEST SPEC related tables. + * Due to this we are going to consider while building + * the query ONLY CF for TESTPLAN DESING + * + */ + private function initGetLinkedForTree($filtersCfg, $optionsCfg) + { + $ic['fields']['tsuites'] = ''; + + $ic['join'] = array(); + $ic['join']['ua'] = ''; + $ic['join']['bugs'] = ''; + $ic['join']['cf'] = ''; + $ic['join']['tsuites'] = ''; + + $ic['where'] = array(); + $ic['where']['where'] = ''; + $ic['where']['platforms'] = ''; + $ic['where']['not_run'] = ''; + $ic['where']['cf'] = ''; + + $ic['green_light'] = true; + $ic['filters'] = array( + 'tcase_id' => null, + 'keyword_id' => 0, + 'assigned_to' => null, + 'exec_status' => null, + 'build_id' => 0, + 'cf_hash' => null, + 'urgencyImportance' => null, + 'tsuites_id' => null, + 'platform_id' => null, + 'exec_type' => null, + 'tcase_name' => null + ); + + $ic['options'] = array( + 'hideTestCases' => 0, + 'include_unassigned' => false, + 'allow_empty_build' => 0, + 'addTSuiteOrder' => false, + 'addImportance' => false, + 'addPriority' => false + ); + $ic['filters'] = array_merge($ic['filters'], (array) $filtersCfg); + $ic['options'] = array_merge($ic['options'], (array) $optionsCfg); + + $ic['filters']['build_id'] = intval($ic['filters']['build_id']); + + if ($ic['options']['addTSuiteOrder']) { + // PREFIX ALWAYS with COMMA + $ic['fields']['tsuites'] = ', NH_TSUITE.node_order AS tsuite_order '; + $ic['join']['tsuites'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . + " ON NH_TSUITE.id = NH_TCASE.parent_id "; + } + + // This NEVER HAPPENS for Execution Tree, but if we want to reuse + // this method for Tester Assignment Tree, we need to add this check + // + if (! is_null($ic['filters']['platform_id']) && + $ic['filters']['platform_id'] > 0) { + $ic['filters']['platform_id'] = intval( + $ic['filters']['platform_id']); + $ic['where']['platforms'] = " AND TPTCV.platform_id = {$ic['filters']['platform_id']} "; + } + + $ic['where']['where'] .= $ic['where']['platforms']; + + $dk = 'exec_type'; + if (! is_null($ic['filters'][$dk])) { + $ic['where'][$dk] = " AND TCV.execution_type IN (" . + implode(",", (array) $ic['filters'][$dk]) . " ) "; + $ic['where']['where'] .= $ic['where'][$dk]; + } + + $dk = 'tcase_id'; + if (! is_null($ic['filters'][$dk])) { + if (is_array($ic['filters'][$dk])) { + $ic['where'][$dk] = " AND NH_TCV.parent_id IN (" . + implode(',', $ic['filters'][$dk]) . ")"; + } elseif ($ic['filters'][$dk] > 0) { + $ic['where'][$dk] = " AND NH_TCV.parent_id = " . + intval($ic['filters'][$dk]); + } else { + // Best Option on this situation will be signal + // that query will fail => NO SENSE run the query + $ic['green_light'] = false; + } + $ic['where']['where'] .= $ic['where'][$dk]; + } + + if (! is_null($ic['filters']['tsuites_id'])) { + $dummy = (array) $ic['filters']['tsuites_id']; + $ic['where']['where'] .= " AND NH_TCASE.parent_id IN (" . + implode(',', $dummy) . ")"; + } + + if (! is_null($ic['filters']['urgencyImportance'])) { + $ic['where']['where'] .= $this->helperUrgencySQL( + $ic['filters']['urgencyImportance']); + } + + if (! is_null($ic['filters']['keyword_id'])) { + + list ($ic['join']['keywords'], $ic['where']['keywords']) = $this->helper_keywords_sql( + $ic['filters']['keyword_id'], array( + 'output' => 'array' + )); + + // **** // CHECK THIS CAN BE NON OK + $ic['where']['where'] .= $ic['where']['keywords']; + } + + // If special user id TL_USER_ANYBODY is present in set of user id, + // we will DO NOT FILTER by user ID + if (! is_null($ic['filters']['assigned_to']) && + ! in_array(TL_USER_ANYBODY, (array) $ic['filters']['assigned_to'])) { + list ($ic['join']['ua'], $ic['where']['ua']) = $this->helperAssignedToSQL( + $ic['filters']['assigned_to'], $ic['options'], + $ic['filters']['build_id']); + + $ic['where']['where'] .= $ic['where']['ua']; + } + + if (isset($ic['options']['assigned_on_build']) && + ! is_null($ic['options']['assigned_on_build'])) { + $ic['join']['ua'] = " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . " AND UA.build_id = " . + $ic['options']['assigned_on_build'] . + " AND UA.type = {$this->execTaskCode} "; + } + + if (! is_null($ic['filters']['tcase_name']) && + ($dummy = trim($ic['filters']['tcase_name'])) != '') { + $ic['where']['where'] .= " AND NH_TCASE.name LIKE '%{$dummy}%' "; + } + + // Custom fields on testplan_design ONLY => AFFECTS run and NOT RUN. + if (isset($ic['filters']['cf_hash']) && + ! is_null($ic['filters']['cf_hash'])) { + $ic['where']['cf'] = ''; + + list ($ic['filters']['cf_hash'], $cf_sql) = $this->helperTestPlanDesignCustomFields( + $ic['filters']['cf_hash']); + + if (strlen(trim($cf_sql)) > 0) { + $ic['where']['cf'] .= " AND ({$cf_sql}) "; + $ic['join']['cf'] = " JOIN {$this->tables['cfield_testplan_design_values']} CFTPD " . + " ON CFTPD.link_id = TPTCV.id "; + } + $ic['where']['where'] .= $ic['where']['cf']; + } + + // I've made the choice to create the not_run key, + // to manage the not_run part of UNION on getLinkedForExecTree(). + // + // ATTENTION: + // on other methods: + // getLinkedForTesterAssignmentTree() + // getLinkedTCVersionsSQL() + // Still is used $ic['where']['where'] on BOTH components of UNION + // + // TICKET 5566: "Assigned to" does not work in "test execution" page + // TICKET 5572: Filter by Platforms - Wrong test case state count in test plan execution + $ic['where']['not_run'] = $ic['where']['where']; + + // ************************************************************************ + // CRITIC - CRITIC - CRITIC + // Position on code flow is CRITIC + // CRITIC - CRITIC - CRITIC + // ************************************************************************ + if (! is_null($ic['filters']['exec_status'])) { + $dummy = (array) $ic['filters']['exec_status']; + + $ic['where']['where'] .= " AND E.status IN ('" . + implode("','", $dummy) . "')"; + + if (in_array($this->notRunStatusCode, $dummy)) { + $ic['where']['not_run'] .= ' AND E.status IS NULL '; + } else { + $ic['where']['not_run'] = $ic['where']['where']; + } + } + + // BUG ID HAS NO EFFECT ON NOT RUN (at least @20140126) + // bug_id => will be a list to create an IN() clause + if (isset($ic['filters']['bug_id']) && + ! is_null($ic['filters']['bug_id'])) { + list ($ic['join']['bugs'], $ic['where']['bugs']) = $this->helperBugsSQL( + $ic['filters']['bug_id']); + $ic['where']['where'] .= $ic['where']['bugs']; + } + + return $ic; + } + + /** + */ + private function helperTestPlanDesignCustomFields($cfSet) + { + $type_domain = $this->cfield_mgr->get_available_types(); + $ret = null; + $cf_type = null; + foreach ($cfSet as $id => $val) { + $xx = $this->cfield_mgr->get_by_id($id); + if ($xx[$id]['enable_on_testplan_design']) { + $ret[$id] = $val; + $cf_type[$id] = $type_domain[$xx[$id]['type']]; + } + } + + $cf_sql = ''; + if (! is_null($ret)) { + $countmain = 1; + foreach ($ret as $cf_id => $cf_value) { + if ($countmain != 1) { + $cf_sql .= " AND "; + } + + if (is_array($cf_value)) { + $count = 1; + switch ($cf_type[$cf_id]) { + case 'multiselection list': + if (count($cf_value) > 1) { + $combo = implode('|', $cf_value); + $cf_sql .= "( CFTPD.value = '{$combo}' AND CFTPD.field_id = {$cf_id} )"; + } else { + // close set, open set, is sandwiched, is alone + // $cf_sql .= "( (CFTPD.value LIKE '%|{$cf_value[0]}' AND CFTPD.field_id = {$cf_id}) OR " . + // " (CFTPD.value LIKE '{$cf_value[0]}|%' AND CFTPD.field_id = {$cf_id}) OR " . + // " (CFTPD.value LIKE '%|{$cf_value[0]}|%' AND CFTPD.field_id = {$cf_id}) OR " . + // " (CFTPD.value = '{$cf_value[0]}' AND CFTPD.field_id = {$cf_id}) )"; + + $cf_sql .= "( CFTPD.field_id = {$cf_id} AND " . + " (CFTPD.value LIKE '%|{$cf_value[0]}' OR " . + " CFTPD.value LIKE '{$cf_value[0]}|%' OR " . + " CFTPD.value LIKE '%|{$cf_value[0]}|%' OR " . + " CFTPD.value = '{$cf_value[0]}') )"; + } + break; + + default: + foreach ($cf_value as $value) { + if ($count > 1) { + $cf_sql .= " AND "; + } + + // When ARRAY NO LIKE but EQUAL + // Need to document what type of CF are managed as ARRAY + $cf_sql .= "( CFTPD.value = '{$value}' AND CFTPD.field_id = {$cf_id} )"; + $count ++; + } + break; + } + } else { + $cf_sql .= " ( CFTPD.value LIKE '%{$cf_value}%' AND CFTPD.field_id = {$cf_id} ) "; + } + $countmain ++; + } + } + + return array( + $ret, + $cf_sql + ); + } + + // This method is intended to return minimal data useful to create Test Plan Tree, + // for feature: + // test case tester execution assignment: + // PLATFORM IS NOT USED TO NAVIGATE => is not present on Settings Section. + // ONLY BUILD IS PRESENT on settings area + // + // Status on Latest execution on Build ANY PLATFORM is needed + // + // @param int $id test plan id + // @param mixed $filters + // @param mixed $options + // + // [tcase_id]: default null => get any testcase + // numeric => just get info for this testcase + // + // [keyword_id]: default 0 => do not filter by keyword id + // numeric/array() => filter by keyword id + // + // [assigned_to]: default NULL => do not filter by user assign. + // array() with user id to be used on filter + // IMPORTANT NOTICE: this argument is affected by + // [assigned_on_build] + // + // [build_id]: default 0 or null => do not filter by build id + // numeric => filter by build id + // + // [cf_hash]: default null => do not filter by Custom Fields values + // + // + // [urgencyImportance] : filter only Tc's with certain (urgency*importance)-value + // + // [tsuites_id]: default null. + // If present only tcversions that are children of this testsuites + // will be included + // + // [exec_type] default null -> all types. + public function getLinkedForTesterAssignmentTree($id, $filters = null, + $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe['tplan_id'] = intval($id); + + $my = $this->initGetLinkedForTree($filters, $options); + + // Need to detail better, origin of build_id. + // is got from GUI Filters area ? + if (($my['options']['allow_empty_build'] == 0) && + $my['filters']['build_id'] <= 0) { + // CRASH IMMEDIATELY + throw new Exception( + $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); + } + if (! $my['green_light']) { + // No query has to be run, because we know in advance that we are + // going to get NO RECORDS + return null; + } + + $buildClause = array( + 'lex' => (' AND EE.build_id = ' . $my['filters']['build_id']), + 'exec_join' => (" AND E.build_id = " . $my['filters']['build_id']) + ); + if ($my['options']['allow_empty_build'] && + $my['filters']['build_id'] <= 0) { + $buildClause = array( + 'lex' => '', + 'exec_join' => '' + ); + } + + // + // Platforms have NOTHING TO DO HERE + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . $buildClause['lex'] . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.build_id "; + + // ------------------------------------------------------------------------------------- + // adding tcversion on output can be useful for Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . + " TCV.tc_external_id AS external_id, " . " COALESCE(E.status,'" . + $this->notRunStatusCode . "') AS exec_status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['ua'] . $my['join']['keywords'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.testplan_id = " . $safe['tplan_id'] . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . " AND E.id = LEX.id " . + $buildClause['exec_join'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . $my['where']['where'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEX.id IS NULL"; + + $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . + " TCV.tc_external_id AS external_id, " . " COALESCE(E.status,'" . + $this->notRunStatusCode . "') AS exec_status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['ua'] . $my['join']['keywords'] . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.testplan_id = " . $safe['tplan_id'] . + " JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . " AND E.id = LEX.id " . // 20120903 + $buildClause['exec_join'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . $my['where']['where']; + + return $union; + } + + /** + */ + public function getLinkInfo($id, $tcase_id, $platform_id = null, $opt = null) + { + $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; + $safe_id = array( + 'tplan_id' => 0, + 'platform_id' => 0, + 'tcase_id' => 0 + ); + $safe_id['tplan_id'] = intval($id); + $safe_id['tcase_id'] = intval($tcase_id); + + // check and die? + $my = array( + 'opt' => array( + 'output' => 'version_info', + 'tproject_id' => null, + 'build4assignment' => null, + 'collapse' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "/* $debugMsg */ " . + " SELECT TCV.id AS tcversion_id,TCV.version %%needle%% " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id "; + + $more_cols = ' '; + switch ($my['opt']['output']) { + case 'tcase_info': + if (is_null($my['opt']['tproject_id'])) { + $dummy = $this->tree_manager->get_node_hierarchy_info( + $safe_id['tplan_id']); + $my['opt']['tproject_id'] = $dummy['parent_id']; + } + $pp = $this->tcaseMgr->getPrefix($safe_id['tcase_id'], + $my['opt']['tproject_id']); + $prefix = $pp[0] . $this->tcaseCfg->glue_character; + $more_cols = ', NHTC.name, NHTC.id AS tc_id, ' . + $this->db->db->concat("'{$prefix}'", 'TCV.tc_external_id') . + ' AS full_external_id '; + + $sql .= " JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id "; + break; + + case 'assignment_info': + if (is_null($my['opt']['build4assignment'])) { + // CRASH IMMEDIATELY + throw new Exception( + __METHOD__ . + ' When your choice is to get assignment_info ' . + " you need to provide build id using 'build4assignment'"); + } + // Go ahead + $safe_id['build_id'] = intval($my['opt']['build4assignment']); + + $more_cols = ',USERS.login,USERS.first,USERS.last' . + ',TPTCV.id AS feature_id,TPTCV.platform_id,PLAT.name AS platform_name' . + ',NHTCV.parent_id AS tc_id,UA.user_id,TCV.importance,TPTCV.urgency' . + ',(TCV.importance * TPTCV.urgency) AS priority '; + $sql .= " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . + " ON UA.build_id = " . $safe_id['build_id'] . + " AND UA.feature_id = TPTCV.id "; + + $sql .= " LEFT OUTER JOIN {$this->tables['platforms']} PLAT " . + " ON PLAT.id = TPTCV.platform_id "; + + $sql .= " LEFT OUTER JOIN {$this->tables['users']} USERS " . + " ON USERS.id = UA.user_id "; + + break; + + case 'version_info': + $more_cols = ',TPTCV.platform_id'; + default: + break; + } + $sql = str_replace('%%needle%%', $more_cols, $sql) . + " WHERE TPTCV.testplan_id = {$safe_id['tplan_id']} " . + " AND NHTCV.parent_id = {$safe_id['tcase_id']} "; + + if (! is_null($platform_id) && + ($safe_id['platform_id'] = intval($platform_id)) > 0) { + $sql .= " AND TPTCV.platform_id = " . $safe_id['platform_id']; + } + + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $rs = $my['opt']['collapse'] ? $rs[0] : $rs; + } + return $rs; + } + + /** + * + * @used-by printDocument.php + * testplan.class.exportLinkedItemsToXML() + * testplan.class.exportForResultsToXML + */ + public function getLinkedStaticView($id, $filters = null, $options = null) + { + $debugMsg = 'Class: ' . __CLASS__ . ' - Method:' . __FUNCTION__; + $my = array( + 'filters' => '', + 'options' => '' + ); + + $my['filters'] = array( + 'platform_id' => null, + 'tsuites_id' => null, + 'tcaseSet' => null, + 'build_id' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $my['options'] = array( + 'output' => 'map', + 'order_by' => null, + 'detail' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $safe['tplan'] = intval($id); + $io = $this->tree_manager->get_node_hierarchy_info($safe['tplan']); + list ($prefix,) = $this->tcaseMgr->getPrefix(null, $io['parent_id']); + unset($io); + $prefix .= $this->tcaseCfg->glue_character; + $feid = $this->db->db->concat("'{$prefix}'", 'TCV.tc_external_id'); + + $addWhere = array( + 'platform' => '', + 'tsuite' => '', + 'tcases' => '', + 'build' => '' + ); + $platQty = 0; + if (! is_null($my['filters']['platform_id'])) { + $dummy = (array) $my['filters']['platform_id']; + array_walk($dummy, 'intval'); + $addWhere['platform'] = 'AND TPTCV.platform_id IN (' . + implode(',', $dummy) . ')'; + $platQty = count((array) $my['filters']['platform_id']); + } + + if (! is_null($my['filters']['tsuites_id'])) { + $dummy = (array) $my['filters']['tsuites_id']; + array_walk($dummy, 'intval'); + $addWhere['tsuite'] = 'AND NH_TCASE.parent_id IN (' . + implode(',', $dummy) . ')'; + } + + if (! is_null($my['filters']['tcaseSet'])) { + $dummy = (array) $my['filters']['tcaseSet']; + array_walk($dummy, 'intval'); + $addWhere['tsuite'] = 'AND NH_TCASE.id IN (' . implode(',', $dummy) . + ')'; + } + + $join['build'] = ''; + $addField = '-1 AS assigned_to, '; + if (! is_null($my['filters']['build_id'])) { + $dummy = intval($my['filters']['build_id']); + $addWhere['build'] = 'AND UA.build_id =' . $dummy; + + $join['build'] = " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id "; + + $addField = " UA.user_id AS assigned_to,"; + } + + switch ($my['options']['detail']) { + case '4results': + $my['options']['output'] = 'array'; // FORCED + // have had some issues with query and ADODB on MySQL if only + // $sql = " SELECT NH_TCV.parent_id AS tc_id, {$feid} AS full_external_id,TCV.tc_external_id "; + // Need to understand why in future + $sql = "/* $debugMsg */ " . + " SELECT {$addField} NH_TCV.parent_id AS tc_id, TPTCV.platform_id, TPTCV.id AS feature_id, " . + " TCV.tc_external_id AS external_id, {$feid} AS full_external_id, TPTCV.tcversion_id "; + break; + + case 'full': + default: + $sql = "/* $debugMsg */ " . + " SELECT {$addField} NH_TCASE.parent_id AS testsuite_id, NH_TCV.parent_id AS tc_id, " . + " NH_TCASE.node_order AS spec_order, NH_TCASE.name," . + " TPTCV.platform_id, PLAT.name as platform_name, TPTCV.id AS feature_id, " . + " TPTCV.tcversion_id AS tcversion_id, " . + " TPTCV.node_order AS execution_order, TPTCV.urgency," . + " TCV.version AS version, TCV.active, TCV.summary," . + " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.importance," . + " {$feid} AS full_external_id, (TPTCV.urgency * TCV.importance) AS priority "; + break; + } + + $sql .= " FROM {$this->tables['nodes_hierarchy']} NH_TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCV.parent_id = NH_TCASE.id " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NH_TCV.id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id " . + $join['build'] . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id "; + + $sql .= " WHERE TPTCV.testplan_id={$safe['tplan']} " . + " {$addWhere['platform']} {$addWhere['tsuite']} {$addWhere['build']}"; + + switch ($my['options']['output']) { + case 'array': + $rs = $this->db->get_recordset($sql); + break; + + case 'map': + if ($platQty == 1) { + $rs = $this->db->fetchRowsIntoMap($sql, 'tc_id', 0, - 1, + 'assigned_to'); + } else { + $rs = $this->db->fetchMapRowsIntoMap($sql, 'platform_id', + 'tc_id'); + } + break; + } + + return $rs; + } + + // need to recheck, because probably we need to be able + // to work without build id provided + // has to be based on TREE USED on features like: + // assign test case execution or set test case urgency + // + public function getLTCVNewGeneration($id, $filters = null, $options = null) + { + $my = array( + 'filters' => array(), + 'options' => array( + 'allow_empty_build' => 1, + 'addPriority' => false, + 'accessKeyType' => 'tcase+platform', + 'addImportance' => false, + 'addExecInfo' => true, + 'assigned_on_build' => null, + 'ua_user_alias' => '', + 'includeNotRun' => true, + 'ua_force_join' => false, + 'orderBy' => null + ) + ); + $amk = array( + 'filters', + 'options' + ); + foreach ($amk as $mk) { + $my[$mk] = array_merge($my[$mk], (array) $$mk); + } + + if (! is_null( + $sql2do = $this->getLinkedTCVersionsSQL($id, $my['filters'], + $my['options']))) { + // need to document better + if (is_array($sql2do)) { + $sql2run = $sql2do['exec']; + if ($my['options']['includeNotRun']) { + $sql2run .= ' UNION ' . $sql2do['not_run']; + } + } else { + $sql2run = $sql2do; + } + + // added when trying to fix: + // TICKET 5788: test case execution order not working on RIGHT PANE + // Anyway this did not help + if (! is_null($my['options']['orderBy'])) { + $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . + $my['options']['orderBy']; + } + + switch ($my['options']['accessKeyType']) { + case 'tcase+platform': + $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run, + 'tcase_id', 'platform_id'); // ,0,-1,'user_id'); + break; + + case 'tcase+platform+stackOnUser': + $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol( + $sql2run, 'tcase_id', 'platform_id', 'user_id'); + break; + + case 'index': + $tplan_tcases = $this->db->get_recordset($sql2run); + break; + + default: + $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run, + 'tcase_id'); + break; + } + } + return $tplan_tcases; + } + + /** + * + * @used-by testplan::getLTCVNewGeneration() + * @use initGetLinkedForTree() + * + * @parameter map filters + * keys: + * 'tcase_id','keyword_id','assigned_to','exec_status','build_id', 'cf_hash', + * 'urgencyImportance', 'tsuites_id','platform_id', 'exec_type','tcase_name' + * filters defaults values are setted on initGetLinkedForTree() + * + * @parameter map options + * some defaults are managed here + * + * defaults for keys: 'hideTestCases','include_unassigned','allow_empty_build' + * are setted on initGetLinkedForTree(). + * + * + * + * @internal revisions + * @since 1.9.13 + */ + private function getLinkedTCVersionsSQL($id, $filters = null, + $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe['tplan_id'] = intval($id); + $my = $this->initGetLinkedForTree($filters, $options); + + $mop = array( + 'options' => array( + 'addExecInfo' => false, + 'specViewFields' => false, + 'assigned_on_build' => null, + 'testSuiteInfo' => false, + 'addPriority' => false, + 'addImportance' => false, + 'ignorePlatformAndBuild' => false, + 'ignoreBuild' => false, + 'ignorePlatform' => false, + 'ua_user_alias' => '', + 'ua_force_join' => false, + 'build_is_active' => false + ) + ); + + $my['options'] = array_merge($mop['options'], $my['options']); + + if (($my['options']['allow_empty_build'] == 0) && + $my['filters']['build_id'] <= 0) { + // CRASH IMMEDIATELY + throw new Exception( + $debugMsg . " Can NOT WORK with \$my['filters']['build_id'] <= 0"); + } + if (! $my['green_light']) { + // No query has to be run, because we know in advance that we are + // going to get NO RECORDS + return null; + } + + $buildClause = array( + 'lex' => (' AND EE.build_id = ' . $my['filters']['build_id']), + 'exec_join' => (" AND E.build_id = " . $my['filters']['build_id']) + ); + if ($my['options']['allow_empty_build'] && + $my['filters']['build_id'] <= 0) { + $buildClause = array( + 'lex' => '', + 'exec_join' => '' + ); + } + + // TICKET 5182: Add/Remove Test Cases -> Trying to assign new platform to executed test cases + // Before this ticket LEX was just on BUILD => ignoring platforms + // Need to understand if will create side effects. + // + if ($my['options']['ignorePlatformAndBuild']) { + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . + " GROUP BY EE.tcversion_id,EE.testplan_id "; + + $platformLEX = " "; + $platformEXEC = " "; + } elseif ($my['options']['ignoreBuild'] && + $my['options']['build_is_active']) { + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " JOIN {$this->tables['builds']} B " . " ON B.id = EE.build_id " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . + " AND B.active = 1" . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id, B.id"; + + $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; + $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; + } elseif ($my['options']['ignoreBuild']) { + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id"; + + // TICKET 5182 + $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; + $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; + } else { + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $safe['tplan_id'] . + $buildClause['lex'] . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; + + // TICKET 5182 + $platformLEX = " AND LEX.platform_id = TPTCV.platform_id "; + $platformEXEC = " AND E.platform_id = TPTCV.platform_id "; + } + + // ------------------------------------------------------------------------------------- + // adding tcversion on output can be useful for Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + // + + // TICKET 5165: Issues with DISTINCT CLAUSE on TEXT field + // Do not know if other usages are going to cry due to missing fields + // + // $commonFields = " SELECT NH_TCASE.id AS tcase_id,NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . + // " TCV.tc_external_id AS external_id, TCV.execution_type," . + // " TCV.summary, TCV.preconditions,TPTCV.id AS feature_id," . + // " TPTCV.platform_id,PLAT.name AS platform_name,TPTCV.node_order AS execution_order,". + // " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status "; + // + // $fullEID = $this->helperConcatTCasePrefix($safe['tplan_id']); + $commonFields = " SELECT NH_TCASE.name AS tcase_name, NH_TCASE.id AS tcase_id, " . + " NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . + " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.status," . + " TPTCV.id AS feature_id," . + ($my['options']['addPriority'] ? "(TPTCV.urgency * TCV.importance) AS priority," : '') . + " TPTCV.platform_id,PLAT.name AS platform_name,TPTCV.node_order AS execution_order," . + " COALESCE(E.status,'" . $this->notRunStatusCode . + "') AS exec_status, " . " E.execution_duration, " . + ($my['options']['addImportance'] ? " TCV.importance," : '') . + $this->helperConcatTCasePrefix($safe['tplan_id']) . + " AS full_external_id "; + + // used on tester assignment feature when working at test suite level + if (! is_null($my['options']['assigned_on_build'])) { + $commonFields .= ",UA.user_id {$my['options']['ua_user_alias']} "; + } + + if ($my['options']['addExecInfo']) { + $commonFields .= ",COALESCE(E.id,0) AS exec_id,E.tcversion_number,E.build_id AS exec_on_build,E.testplan_id AS exec_on_tplan"; + } + + if ($my['options']['specViewFields']) { + $commonFields .= ",NH_TCASE.name,TPTCV.creation_ts AS linked_ts,TPTCV.author_id AS linked_by" . + ",NH_TCASE.parent_id AS testsuite_id"; + } + + $my['join']['tsuites'] = ''; + if ($my['options']['testSuiteInfo']) { + $commonFields .= ",NH_TSUITE.name AS tsuite_name "; + $my['join']['tsuites'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . + " ON NH_TSUITE.id = NH_TCASE.parent_id "; + } + + if ($my['options']['ua_force_join']) { + $my['join']['ua'] = str_replace('LEFT OUTER', ' ', $my['join']['ua']); + } + + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + $commonFields . " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['tsuites'] . $my['join']['ua'] . $my['join']['keywords'] . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . $platformLEX . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.testplan_id = " . $safe['tplan_id'] . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . $platformEXEC . + " AND E.id = LEX.id " . // TICKET 6159 + $buildClause['exec_join'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . ' ' . $my['where']['where'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEX.id IS NULL"; + + $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + $commonFields . " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + $my['join']['tsuites'] . $my['join']['ua'] . $my['join']['keywords'] . + " JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . $platformLEX . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.testplan_id = " . $safe['tplan_id'] . + " JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . $platformEXEC . + " AND E.id = LEX.id " . // TICKET 6159 + $buildClause['exec_join'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . ' ' . $my['where']['where']; + + return $union; + } + + /** + */ + public function getPublicAttr($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT is_public FROM {$this->tables['testplans']} " . + " WHERE id =" . intval($id); + $ret = $this->db->get_recordset($sql); + return $ret[0]['is_public']; + } + + /** + */ + private function getBuildByCriteria($id, $criteria) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'active' => null, + 'open' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $options); + + switch ($criteria) { + case 'maxID': + $sql = " /* $debugMsg */ " . + " SELECT MAX(id) AS id,testplan_id, name, notes, active, is_open," . + " release_date,closed_on_date " . + " FROM {$this->tables['builds']} WHERE testplan_id = {$id} "; + break; + } + + if (! is_null($my['opt']['active'])) { + $sql .= " AND active = " . intval($my['opt']['active']) . " "; + } + if (! is_null($my['opt']['open'])) { + $sql .= " AND is_open = " . intval($my['opt']['open']) . " "; + } + + return $this->db->get_recordset($sql); + } + + /** + */ + public function writeExecution($ex) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $execNotes = $this->db->prepare_string($ex->notes); + if (property_exists($ex, 'executionTimeStampISO')) { + $execTS = "'" . $ex->executionTimeStampISO . "'"; + } else { + $execTS = $this->db->db_now(); + } + + $sql = "/* {$debugMsg} */ " . + "INSERT INTO {$this->tables['executions']} " . + " (testplan_id, platform_id, build_id, " . + " tcversion_id, tcversion_number, status, " . + " tester_id, execution_ts, execution_type, notes) " . " VALUES(" . + " {$ex->testPlanID},{$ex->platformID},{$ex->buildID}," . + " {$ex->testCaseVersionID}, {$ex->testCaseVersionNumber},'{$ex->statusCode}'," . + " {$ex->testerID},{$execTS}, {$ex->executionType}, '{$execNotes}')"; + + $this->db->exec_query($sql); + $execID = $this->db->insert_id($this->tables['executions']); + + // Do we have steps exec info? + if (property_exists($ex, 'steps')) { + // steps [] of stepExec + // + // Same execution ts that WHOLE Testcase, the field do not exists in table + // + // Here as JSON + // { + // "stepNumber":1, + // "notes":"This is an execution created via REST API", + // "statusCode":"b", + // } + // + // Brute force approach: + // Get all steps from specification + $allsteps = 0; + $gssOpt = [ + 'fields2get' => 'TCSTEPS.id,TCSTEPS.step_number', + 'accessKey' => "step_number", + 'renderGhostSteps' => false, + 'renderImageInline' => false + ]; + $stepsSpec = $this->tcaseMgr->getStepsSimple($ex->testCaseVersionID, + $allsteps, $gssOpt); + + foreach ($ex->steps as $stepExec) { + // if step number does not exist -> ignore it in silence + if (isset($stepsSpec[$stepExec->stepNumber])) { + $stepID = intval($stepsSpec[$stepExec->stepNumber]["id"]); + $sql = " INSERT INTO {$this->tables['execution_tcsteps']} + (execution_id,tcstep_id,notes,status) "; + $values = " VALUES ( {$execID}, {$stepID}," . "'" . + $this->db->prepare_string($stepExec->notes) . "'," . "'" . + $this->db->prepare_string($stepExec->statusCode) . "')"; + $sql .= " " . $values; + + $this->db->exec_query($sql); + } + } + } + + return $execID; + } + + /** + */ + private function getExecutionDurationForSet($execIDSet) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ " . + "SELECT E.id, E.execution_duration AS duration " . + "FROM {$this->tables['executions']} E " . "WHERE id IN (" . + implode(',', $execIDSet) . ')'; + return $this->db->get_recordset($sql); + } + + /** + */ + public function exportForResultsToXML($id, $context, $optExport = array(), + $filters = null) + { + $my['filters'] = array( + 'platform_id' => null, + 'tcaseSet' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $item = $this->get_by_id($id, + array( + 'output' => 'minimun', + 'caller' => __METHOD__ + )); + + $xmlString = "\n" . + "\n"; + $xmlString .= "\n"; + $xmlString .= "\t\n"; + + $xmlString .= "\t\n"; + + if (isset($context['build_id']) && $context['build_id'] > 0) { + $dummy = $this->get_builds($id); + $info = $dummy[$context['build_id']]; + $xmlString .= "\t\n"; + } + + // get target platform (if exists) + if ($context['platform_id'] > 0) { + $info = $this->platform_mgr->getByID($context['platform_id']); + $xmlString .= "\t\n"; + $my['filters']['platform_id'] = $context['platform_id']; + } + + // + // + // + // u0113 + // + // 2008-09-08 14:00:00 + // p + // functionality works great + // + $mm = $this->getLinkedStaticView($id, $my['filters'], + array( + 'output' => 'array', + 'detail' => '4results' + )); + + if (! is_null($mm) && ($tcaseQty = count($mm)) > 0) { + + // Custom fields processing + $xcf = $this->cfield_mgr->get_linked_cfields_at_execution( + $item['tproject_id'], 1, 'testcase'); + if (! is_null($xcf) && ! empty($xcf)) { + for ($gdx = 0; $gdx < $tcaseQty; $gdx ++) { + $mm[$gdx]['xmlcustomfields'] = $this->cfield_mgr->exportValueAsXML( + $xcf); + } + } + + // Test Case Steps + $gso = array( + 'fields2get' => 'TCSTEPS.id,TCSTEPS.step_number', + 'renderGhostSteps' => false, + 'renderImageInline' => false + ); + $stepRootElem = "{{XMLCODE}}"; + $stepTemplate = "\n" . '' . "\n" . + "\t||STEP_NUMBER||\n" . + "\tp\n" . "\t||NOTES||\n" . + "\n"; + $stepInfo = array( + "||STEP_NUMBER||" => "step_number", + "||NOTES||" => "notes" + ); + + for ($gdx = 0; $gdx < $tcaseQty; $gdx ++) { + $mm[$gdx]['steps'] = $this->tcaseMgr->getStepsSimple( + $mm[$gdx]['tcversion_id'], 0, $gso); + if (! is_null($mm[$gdx]['steps'])) { + $qs = count($mm[$gdx]['steps']); + for ($scx = 0; $scx < $qs; $scx ++) { + $mm[$gdx]['steps'][$scx]['notes'] = 'your step exec notes'; + } + $mm[$gdx]['xmlsteps'] = exportDataToXML($mm[$gdx]['steps'], + $stepRootElem, $stepTemplate, $stepInfo, true); + } + } + } + + $xml_root = null; + $xml_template = "\n" . "\t" . + "\n" . "\t\t" . "X" . "\n" . "\t\t" . + "test link rocks " . "\n" . "\t\t" . + "put login here" . "\n" . "\t\t" . + "" . "\n" . "\t\t" . + "YYYY-MM-DD HH:MM:SS" . "\n" . "\t\t" . + "put one of your bugs id here (repeat the line as many times you need)" . + "\n" . "\t\t" . "put another of your bugs id here" . + "\n" . "\t\t" . "||STEPS||" . "\n" . "\t\t" . "||CUSTOMFIELDS||" . + "\n" . "\t" . "\n"; + + $xml_mapping = null; + $xml_mapping = array( + "{{FULLEXTERNALID}}" => "full_external_id", + "||CUSTOMFIELDS||" => "xmlcustomfields", + "||STEPS||" => "xmlsteps" + ); + + $linked_testcases = exportDataToXML($mm, $xml_root, $xml_template, + $xml_mapping, true); + return $xmlString .= $linked_testcases . "\n\n"; + } + + /** + */ + public function setActive($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ " . + "UPDATE {$this->tables['testplans']} SET active=1 WHERE id=" . + intval($id); + $this->db->exec_query($sql); + } + + /** + */ + public function setInactive($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ " . + "UPDATE {$this->tables['testplans']} SET active=0 WHERE id=" . + intval($id); + $this->db->exec_query($sql); + } + + /** + */ + public function getByAPIKey($apiKey, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'checkIsValid' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + $fields2get = $my['opt']['checkIsValid'] ? 'id' : '*'; + + $safe = $this->db->prepare_string($apiKey); + + $sql = "/* $debugMsg */ " . + " SELECT {$fields2get} FROM {$this->tables['testplans']} " . + " WHERE api_key = '{$safe}'"; + + $rs = $this->db->get_recordset($sql); + return $rs ? $rs[0] : null; + } + + /** + * + * @used-by planEdit.php + */ + public function getFileUploadRelativeURL($id) + { + // do_action,tplan_id as expected in planEdit.php + return "lib/plan/planEdit.php?do_action=fileUpload&tplan_id=" . + intval($id); + } + + /** + * + * @used-by planEdit.php + */ + public function getDeleteAttachmentRelativeURL($id) + { + // do_action,tplan_id as expected in planEdit.php + return "lib/plan/planEdit.php?do_action=deleteFile&tplan_id=" . + intval($id) . "&file_id="; + } + + /** + * + * @used-by + */ + public function getAllExecutionsWithBugs($id, $platform_id = null, + $build_id = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe['tplan_id'] = intval($id); + $fullEID = $this->helperConcatTCasePrefix($safe['tplan_id']); + + $sql = " /* $debugMsg */ " . + " SELECT DISTINCT E.id AS exec_id,EB.bug_id,NHTC.id AS tcase_id, NHTC.id AS tc_id, " . + " NHTC.name AS name, NHTSUITE.name AS tsuite_name, TCV.tc_external_id AS external_id," . + " $fullEID AS full_external_id " . + " FROM {$this->tables['executions']} E " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.tcversion_id = E.tcversion_id " . + " AND TPTCV.testplan_id = E.testplan_id " . + " JOIN {$this->tables['execution_bugs']} EB " . + " ON EB.execution_id = E.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = E.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = E.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTSUITE " . + " ON NHTSUITE.id = NHTC.parent_id " . " WHERE TPTCV.testplan_id = " . + $safe['tplan_id']; + + return $this->db->get_recordset($sql); + } + + /** + */ + public function getLTCVOnTestPlan($id, $filters = null, $options = null) + { + $my = array( + 'filters' => array(), + 'options' => array( + 'allow_empty_build' => 1, + 'addPriority' => false, + 'accessKeyType' => 'tcase+platform', + 'addImportance' => false, + 'includeNotRun' => true, + 'orderBy' => null + ) + ); + $amk = array( + 'filters', + 'options' + ); + foreach ($amk as $mk) { + $my[$mk] = array_merge($my[$mk], (array) $$mk); + } + + $my['options']['ignorePlatformAndBuild'] = true; + if (! is_null( + $sql2do = $this->getLinkedTCVersionsSQL($id, $my['filters'], + $my['options']))) { + // need to document better + if (is_array($sql2do)) { + $sql2run = $sql2do['exec']; + if ($my['options']['includeNotRun']) { + $sql2run .= ' UNION ' . $sql2do['not_run']; + } + } else { + $sql2run = $sql2do; + } + + // added when trying to fix: + // TICKET 5788: test case execution order not working on RIGHT PANE + // Anyway this did not help + if (! is_null($my['options']['orderBy'])) { + $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . + $my['options']['orderBy']; + } + + switch ($my['options']['accessKeyType']) { + case 'tcase+platform': + $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run, + 'tcase_id', 'platform_id'); // ,0,-1,'user_id'); + break; + + case 'tcase+platform+stackOnUser': + $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol( + $sql2run, 'tcase_id', 'platform_id', 'user_id'); + break; + + case 'index': + $tplan_tcases = $this->db->get_recordset($sql2run); + break; + + default: + $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run, + 'tcase_id'); + break; + } + } + return $tplan_tcases; + } + + /** + */ + public function getLTCVOnTestPlanPlatform($id, $filters = null, + $options = null) + { + $my = array( + 'filters' => array(), + 'options' => array( + 'allow_empty_build' => 1, + 'addPriority' => false, + 'accessKeyType' => 'tcase+platform', + 'addImportance' => false, + 'includeNotRun' => true, + 'orderBy' => null + ) + ); + $amk = array( + 'filters', + 'options' + ); + foreach ($amk as $mk) { + $my[$mk] = array_merge($my[$mk], (array) $$mk); + } + + $my['options']['ignoreBuild'] = true; + if (! is_null( + $sql2do = $this->getLinkedTCVersionsSQL($id, $my['filters'], + $my['options']))) { + // need to document better + if (is_array($sql2do)) { + $sql2run = $sql2do['exec']; + if ($my['options']['includeNotRun']) { + $sql2run .= ' UNION ' . $sql2do['not_run']; + } + } else { + $sql2run = $sql2do; + } + + // added when trying to fix: + // TICKET 5788: test case execution order not working on RIGHT PANE + // Anyway this did not help + if (! is_null($my['options']['orderBy'])) { + $sql2run = " SELECT * FROM ($sql2run) XX ORDER BY " . + $my['options']['orderBy']; + } + + switch ($my['options']['accessKeyType']) { + case 'tcase+platform': + $tplan_tcases = $this->db->fetchMapRowsIntoMap($sql2run, + 'tcase_id', 'platform_id'); // ,0,-1,'user_id'); + break; + + case 'tcase+platform+stackOnUser': + $tplan_tcases = $this->db->fetchMapRowsIntoMapStackOnCol( + $sql2run, 'tcase_id', 'platform_id', 'user_id'); + break; + + case 'index': + $tplan_tcases = $this->db->get_recordset($sql2run); + break; + + default: + $tplan_tcases = $this->db->fetchRowsIntoMap($sql2run, + 'tcase_id'); + break; + } + } + return $tplan_tcases; + } + + /** + */ + public function getLinkedItems($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ " . + " SELECT parent_id AS tcase_id,TPTCV.platform_id,TPTCV.node_order " . + " FROM {$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . + " WHERE TPTCV.testplan_id = " . intval($id); + + return $this->db->fetchMapRowsIntoMap($sql, 'tcase_id', 'platform_id'); + } + + /** + * + * @since 1.9.14 + */ + public function getLinkedFeatures($id, $filters = null, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'filters' => array(), + $options => array() + ); + $my['filters'] = array( + 'platform_id' => null + ); + $my['options'] = array( + 'accessKey' => array( + 'tcase_id', + 'platform_id' + ) + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = " /* $debugMsg */ " . + " SELECT parent_id AS tcase_id,TPTCV.platform_id,TPTCV.id AS feature_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.tcversion_id = NHTC.id " . + " WHERE TPTCV.testplan_id = " . intval($id); + + if (! is_null($my['filters']['platform_id'])) { + $sql .= " AND TPTCV.platform_id = " . + intval($my['filters']['platform_id']); + } + + if (! is_null($my['filters']['tcase_id'])) { + $sql .= " AND NHTC.parent_id IN (" . + implode(',', $my['filters']['tcase_id']) . ") "; + } + + return $this->db->fetchMapRowsIntoMap($sql, + $my['options']['accessKey'][0], $my['options']['accessKey'][1]); + } + + /** + * + * @used-by getFilteredLinkedVersions() - specview.php + * @used-by indirectly on tc_exec_assigment.php for test suites + * + */ + public function getLinkedTCVXmen($id, $filters = null, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe['tplan_id'] = intval($id); + $my = $this->initGetLinkedForTree($filters, $options); + + // adding tcversion on output can be useful for Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + $commonFields = "/* $debugMsg */ " . + " SELECT NH_TCASE.name AS tcase_name, NH_TCASE.id AS tcase_id, " . + " NH_TCASE.id AS tc_id,TPTCV.tcversion_id,TCV.version," . + " TCV.tc_external_id AS external_id, TCV.execution_type,TCV.status," . + " TPTCV.id AS feature_id," . + ($my['options']['addPriority'] ? "(TPTCV.urgency * TCV.importance) AS priority," : '') . + " TPTCV.platform_id,TPTCV.node_order AS execution_order," . + ($my['options']['addImportance'] ? " TCV.importance," : '') . + $this->helperConcatTCasePrefix($safe['tplan_id']) . + " AS full_external_id "; + + $commonFields .= ",UA.user_id"; + $commonFields .= ",NH_TCASE.name,TPTCV.creation_ts AS linked_ts,TPTCV.author_id AS linked_by" . + ",NH_TCASE.parent_id AS testsuite_id"; + + $commonFields .= ",NH_TSUITE.name AS tsuite_name "; + + $my['join']['tsuites'] = " JOIN {$this->tables['nodes_hierarchy']} NH_TSUITE " . + " ON NH_TSUITE.id = NH_TCASE.parent_id "; + + $sql = $commonFields . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['tsuites'] . $my['join']['ua'] . $my['join']['keywords'] . + " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . + $my['where']['where']; + + return $this->db->fetchMapRowsIntoMapStackOnCol($sql, 'tcase_id', + 'platform_id', 'user_id'); + } + + /** + */ + public function getExecCountOnBuild($id, $build_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe['tplan_id'] = intval($id); + $safe['build_id'] = intval($build_id); + + $sql = "/* $debugMsg */ SELECT COUNT(0) AS qty " . + " FROM {$this->tables['executions']} E " . + " WHERE E.testplan_id = {$safe['tplan_id']} " . + " AND E.build_id = {$safe['build_id']}"; + + $rs = $this->db->get_recordset($sql); + + return $rs[0]['qty']; + } + + /** + */ + public function getFeatureByID($feature_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $target = (array) $feature_id; + foreach ($target as $idx => $tg) { + $target[$idx] = intval($tg); + } + $inSet = implode(',', $target); + + $sql = " /* $debugMsg */ " . + " SELECT parent_id AS tcase_id,tcversion_id,platform_id,TPTCV.id " . + " FROM {$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.tcversion_id = NHTC.id " . " WHERE TPTCV.id IN (" . $inSet . + ")"; + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + public function getVersionLinked($tplan_id, $tcase_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ + SELECT tcversion_id FROM {$this->tables['testplan_tcversions']} TPTCV JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id - WHERE TPTCV.testplan_id = $tplan_id - AND NH_TCV.parent_id = $tcase_id"; - - $rs = $this->db->get_recordset($sql); - - // We trust DB is OK => no matter the record I use - // testcase version id will be the same. - // - return $rs[0]['tcversion_id']; - - } - - // - // This method is intended to return minimal data useful - // to create Execution Tree. - // - // The Status on Latest execution: - // is computed considering only the selected Platform - // - // @param int $id test plan id - // @param mixed $filters - // @param mixed $options - // - // [tcase_id]: default null => get any testcase - // numeric => just get info for this testcase - // - // - // [keyword_id]: default 0 => do not filter by keyword id - // numeric/array() => filter by keyword id - // - // - // [assigned_to]: default NULL => do not filter by user assign. - // array() with user id to be used on filter - // IMPORTANT NOTICE: this argument is affected by - // [assigned_on_build] - // - // [build_id]: default 0 or null => do not filter by build id - // numeric => filter by build id - // - // - // [cf_hash]: default null => do not filter by Custom Fields values - // - // - // [urgencyImportance] : - // filter only Tc's with certain (urgency*importance)-value - // - // [tsuites_id]: default null. - // If present only tcversions that are children - // of this testsuites will be included - // - // [exec_type] default null -> all types. - // [platform_id] - // - function getLinkedForExecTreeIVU($id,$filters=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - - $safe['tplan_id'] = intval($id); - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - if( !isset($my['filters']['platform_id']) || - $my['filters']['platform_id'] == 0 ) { - throw new Exception(__FUNCTION__ . " Needs Platform ID", 1); - } - - - if( !$my['green_light'] ) { - // No query has to be run, because we know in advance that we are - // going to get NO RECORDS - return null; - } - - $safe['platform_id'] = intval($my['filters']['platform_id']); - - $sqlLExecOnTPLANPL = - " SELECT LEBTPPL.tcversion_id,LEBTPPL.testplan_id, - LEBTPPL.platform_id, LEBTPPL.id - FROM {$this->views['latest_exec_by_testplan_plat']} LEBTPPL - WHERE LEBTPPL.testplan_id = {$safe['tplan_id']} - AND LEBTPPL.platform_id = {$safe['platform_id']} "; - - // When there is request to filter by BUG ID, - // because BUGS are linked only to EXECUTED test case versions, - // the not_run piece of union is USELESS - $union['not_run'] = null; - - $nht = $this->tables['nodes_hierarchy']; - - $theView = $this->views['latest_exec_by_testplan_plat']; - - if(!isset($my['filters']['bug_id'])) { - // adding tcversion on output can be useful for - // Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - // - - - // no need to add - // " AND TPTCV.platform_id =" . $safe['platform_id'] . - // Because is added in $where - // - $notrun = $this->notRunStatusCode; - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, - '" . $this->notRunStatusCode . "' AS exec_status - FROM {$this->tables['testplan_tcversions']} TPTCV - JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id - JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['keywords'] . - $my['join']['ua'] . - $my['join']['cf'] . - - " /* Get REALLY NOT RUN => - BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ - LEFT OUTER JOIN {$theView} AS LEXBTPLANPL - ON LEXBTPLANPL.testplan_id = TPTCV.testplan_id - AND LEXBTPLANPL.tcversion_id = TPTCV.tcversion_id " . - - "/* - mmm, we want not run => why to use Executions? - LEFT OUTER JOIN {$this->tables['executions']} E - ON E.tcversion_id = TPTCV.tcversion_id - AND E.testplan_id = TPTCV.testplan_id - */ " . - - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['not_run'] . - " AND LEXBTPLANPL.id IS NULL"; - } - - $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, - E.status AS exec_status + WHERE TPTCV.testplan_id = $tplan_id + AND NH_TCV.parent_id = $tcase_id"; + + $rs = $this->db->get_recordset($sql); + + // We trust DB is OK => no matter the record I use + // testcase version id will be the same. + // + return $rs[0]['tcversion_id']; + } + + // This method is intended to return minimal data useful + // to create Execution Tree. + // + // The Status on Latest execution: + // is computed considering only the selected Platform + // + // @param int $id test plan id + // @param mixed $filters + // @param mixed $options + // + // [tcase_id]: default null => get any testcase + // numeric => just get info for this testcase + // + // [keyword_id]: default 0 => do not filter by keyword id + // numeric/array() => filter by keyword id + // + // [assigned_to]: default NULL => do not filter by user assign. + // array() with user id to be used on filter + // IMPORTANT NOTICE: this argument is affected by + // [assigned_on_build] + // + // [build_id]: default 0 or null => do not filter by build id + // numeric => filter by build id + // + // + // [cf_hash]: default null => do not filter by Custom Fields values + // + // + // [urgencyImportance] : + // filter only Tc's with certain (urgency*importance)-value + // + // [tsuites_id]: default null. + // If present only tcversions that are children + // of this testsuites will be included + // + // [exec_type] default null -> all types. + // [platform_id] + public function getLinkedForExecTreeIVU($id, $filters = null, + $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe['tplan_id'] = intval($id); + $my = $this->initGetLinkedForTree($filters, $options); + + if (! isset($my['filters']['platform_id']) || + $my['filters']['platform_id'] == 0) { + throw new Exception(__FUNCTION__ . " Needs Platform ID", 1); + } + + if (! $my['green_light']) { + // No query has to be run, because we know in advance that we are + // going to get NO RECORDS + return null; + } + + $safe['platform_id'] = intval($my['filters']['platform_id']); + + // When there is request to filter by BUG ID, + // because BUGS are linked only to EXECUTED test case versions, + // the not_run piece of union is USELESS + $union['not_run'] = null; + + $nht = $this->tables['nodes_hierarchy']; + + $theView = $this->views['latest_exec_by_testplan_plat']; + + if (! isset($my['filters']['bug_id'])) { + // adding tcversion on output can be useful for + // Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + + // no need to add + // " AND TPTCV.platform_id =" . $safe['platform_id'] . + // Because is added in $where + // $notrun = $this->notRunStatusCode; + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, + '" . $this->notRunStatusCode . + "' AS exec_status + FROM {$this->tables['testplan_tcversions']} TPTCV + JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id + JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['keywords'] . $my['join']['ua'] . $my['join']['cf'] . + " /* Get REALLY NOT RUN => + BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ + LEFT OUTER JOIN {$theView} AS LEXBTPLANPL + ON LEXBTPLANPL.testplan_id = TPTCV.testplan_id + AND LEXBTPLANPL.tcversion_id = TPTCV.tcversion_id " . + "/* + mmm, we want not run => why to use Executions? + LEFT OUTER JOIN {$this->tables['executions']} E + ON E.tcversion_id = TPTCV.tcversion_id + AND E.testplan_id = TPTCV.testplan_id + */ " . " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . + $my['where']['not_run'] . " AND LEXBTPLANPL.id IS NULL"; + } + + $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, + E.status AS exec_status FROM {$this->tables['testplan_tcversions']} TPTCV JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id - JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['keywords'] . - $my['join']['ua'] . - $my['join']['cf'] . - - " JOIN {$theView} AS LEXBTPLANPL - ON LEXBTPLANPL.testplan_id = TPTCV.testplan_id + JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['keywords'] . $my['join']['ua'] . $my['join']['cf'] . + " JOIN {$theView} AS LEXBTPLANPL + ON LEXBTPLANPL.testplan_id = TPTCV.testplan_id AND LEXBTPLANPL.platform_id = TPTCV.platform_id AND LEXBTPLANPL.tcversion_id = TPTCV.tcversion_id - JOIN {$this->tables['executions']} E - ON E.id = LEXBTPLANPL.id - AND E.testplan_id = LEXBTPLANPL.testplan_id - AND E.platform_id = LEXBTPLANPL.platform_id " . - $my['join']['bugs'] . - - " WHERE TPTCV.testplan_id = {$safe['tplan_id']} " . - $my['where']['where']; - - $xql = is_null($union['not_run']) ? $union['exec'] : $union; - - return $xql; - } - - // - // This method is intended to return minimal data useful - // to create Execution Tree. - // - // The Status on Latest execution: - // is computed considering only the test plan, doing - // logic ignoring selected build & selected platform - // - // @param int $id test plan id - // @param mixed $filters - // @param mixed $options - // - // [tcase_id]: default null => get any testcase - // numeric => just get info for this testcase - // - // - // [keyword_id]: default 0 => do not filter by keyword id - // numeric/array() => filter by keyword id - // - // - // [assigned_to]: default NULL => do not filter by user assign. - // array() with user id to be used on filter - // IMPORTANT NOTICE: this argument is affected by - // [assigned_on_build] - // - // [build_id]: default 0 or null => do not filter by build id - // numeric => filter by build id - // - // - // [cf_hash]: default null => do not filter by Custom Fields values - // - // - // [urgencyImportance] : - // filter only Tc's with certain (urgency*importance)-value - // - // [tsuites_id]: default null. - // If present only tcversions that are children - // of this testsuites will be included - // - // [exec_type] default null -> all types. - // [platform_id] - // - function getLinkedForExecTreeCross($id,$filters=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - - $safe['tplan_id'] = intval($id); - $my = $this->initGetLinkedForTree($safe['tplan_id'],$filters,$options); - - if( !$my['green_light'] ) { - // No query has to be run, because we know in advance that we are - // going to get NO RECORDS - return null; - } - - - $sqlLatestExecOnTPLAN = - " SELECT LEBTP.tcversion_id,LEBTP.testplan_id, LEBTP.id - FROM {$this->views['latest_exec_by_testplan']} LEBTP - WHERE LEBTP.testplan_id = {$safe['tplan_id']} "; - - // When there is request to filter by BUG ID, - // because BUGS are linked only to EXECUTED test case versions, - // the not_run piece of union is USELESS - $union['not_run'] = null; - - $nht = $this->tables['nodes_hierarchy']; - - if(!isset($my['filters']['bug_id'])) { - // adding tcversion on output can be useful for - // Filter on Custom Field values, - // because we are saving values at TCVERSION LEVEL - // - - $notrun = $this->notRunStatusCode; - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, - COALESCE(E.status,'" . $notrun . "') AS exec_status - FROM {$this->tables['testplan_tcversions']} TPTCV - JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id + JOIN {$this->tables['executions']} E + ON E.id = LEXBTPLANPL.id + AND E.testplan_id = LEXBTPLANPL.testplan_id + AND E.platform_id = LEXBTPLANPL.platform_id " . $my['join']['bugs'] . + " WHERE TPTCV.testplan_id = {$safe['tplan_id']} " . + $my['where']['where']; + + return is_null($union['not_run']) ? $union['exec'] : $union; + } + + // This method is intended to return minimal data useful + // to create Execution Tree. + // + // The Status on Latest execution: + // is computed considering only the test plan, doing + // logic ignoring selected build & selected platform + // + // @param int $id test plan id + // @param mixed $filters + // @param mixed $options + // + // [tcase_id]: default null => get any testcase + // numeric => just get info for this testcase + // + // + // [keyword_id]: default 0 => do not filter by keyword id + // numeric/array() => filter by keyword id + // + // + // [assigned_to]: default NULL => do not filter by user assign. + // array() with user id to be used on filter + // IMPORTANT NOTICE: this argument is affected by + // [assigned_on_build] + // + // [build_id]: default 0 or null => do not filter by build id + // numeric => filter by build id + // + // + // [cf_hash]: default null => do not filter by Custom Fields values + // + // + // [urgencyImportance] : + // filter only Tc's with certain (urgency*importance)-value + // + // [tsuites_id]: default null. + // If present only tcversions that are children + // of this testsuites will be included + // + // [exec_type] default null -> all types. + // [platform_id] + public function getLinkedForExecTreeCross($id, $filters = null, + $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe['tplan_id'] = intval($id); + $my = $this->initGetLinkedForTree($filters, $options); + + if (! $my['green_light']) { + // No query has to be run, because we know in advance that we are + // going to get NO RECORDS + return null; + } + + $sqlLatestExecOnTPLAN = " SELECT LEBTP.tcversion_id,LEBTP.testplan_id, LEBTP.id + FROM {$this->views['latest_exec_by_testplan']} LEBTP + WHERE LEBTP.testplan_id = {$safe['tplan_id']} "; + + // When there is request to filter by BUG ID, + // because BUGS are linked only to EXECUTED test case versions, + // the not_run piece of union is USELESS + $union['not_run'] = null; + + $nht = $this->tables['nodes_hierarchy']; + + if (! isset($my['filters']['bug_id'])) { + // adding tcversion on output can be useful for + // Filter on Custom Field values, + // because we are saving values at TCVERSION LEVEL + + $notrun = $this->notRunStatusCode; + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, + COALESCE(E.status,'" . $notrun . + "') AS exec_status + FROM {$this->tables['testplan_tcversions']} TPTCV + JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH_TCV.id - JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['keywords'] . - $my['join']['ua'] . - $my['join']['cf'] . - - " /* Get REALLY NOT RUN => - BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLatestExecOnTPLAN}) AS LEXBTPLAN " . - " ON LEXBTPLAN.testplan_id = TPTCV.testplan_id " . - " AND LEXBTPLAN.tcversion_id = TPTCV.tcversion_id " . - " AND LEXBTPLAN.testplan_id = " . $safe['tplan_id'] . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['not_run'] . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND LEXBTPLAN.id IS NULL"; - } - - $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, - COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status + JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['keywords'] . $my['join']['ua'] . $my['join']['cf'] . + " /* Get REALLY NOT RUN => + BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLatestExecOnTPLAN}) AS LEXBTPLAN " . + " ON LEXBTPLAN.testplan_id = TPTCV.testplan_id " . + " AND LEXBTPLAN.tcversion_id = TPTCV.tcversion_id " . + " AND LEXBTPLAN.testplan_id = " . $safe['tplan_id'] . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . + $my['where']['not_run'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND LEXBTPLAN.id IS NULL"; + } + + $union['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id, + COALESCE(E.status,'" . $this->notRunStatusCode . + "') AS exec_status FROM {$this->tables['testplan_tcversions']} TPTCV JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id JOIN $nht NH_TCV ON NH_TCV.id = TPTCV.tcversion_id - JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['keywords'] . - $my['join']['ua'] . - $my['join']['cf'] . - - " JOIN ({$sqlLatestExecOnTPLAN}) AS LEXBTPLAN " . - " ON LEXBTPLAN.testplan_id = TPTCV.testplan_id " . - " AND LEXBTPLAN.tcversion_id = TPTCV.tcversion_id " . - " AND LEXBTPLAN.testplan_id = " . $safe['tplan_id'] . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEXBTPLAN.id " . - " AND E.testplan_id = LEXBTPLAN.testplan_id " . - $my['join']['bugs'] . - - $my['where']['where']; - - $xql = is_null($union['not_run']) ? $union['exec'] : $union; - return $xql; - } - - - /** - * Rules - * 1. code is a string of length = 1 => one character - * 2. domain will be a-z - * - */ - function sanitizeExecStatus( $status ) { - - $statusSet = (array)$status; - $sane = array(); - foreach ($statusSet as $code) { - $oascii = ord($code[0]); - if( $oascii >= ord('a') && $oascii <= ord('z') ) { - $sane[] = $code[0]; - } - } - return $sane; - } - - /** - * - */ - static function getName(&$dbh,$id) { - $sch = tlDBObject::getDBTables(array('nodes_hierarchy','testplans')); - $sql = "SELECT name FROM {$sch['nodes_hierarchy']} NH + JOIN $nht NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['keywords'] . $my['join']['ua'] . $my['join']['cf'] . + " JOIN ({$sqlLatestExecOnTPLAN}) AS LEXBTPLAN " . + " ON LEXBTPLAN.testplan_id = TPTCV.testplan_id " . + " AND LEXBTPLAN.tcversion_id = TPTCV.tcversion_id " . + " AND LEXBTPLAN.testplan_id = " . $safe['tplan_id'] . + " JOIN {$this->tables['executions']} E " . + " ON E.id = LEXBTPLAN.id " . + " AND E.testplan_id = LEXBTPLAN.testplan_id " . $my['join']['bugs'] . + $my['where']['where']; + + return is_null($union['not_run']) ? $union['exec'] : $union; + } + + /** + * Rules + * 1. + * code is a string of length = 1 => one character + * 2. domain will be a-z + */ + private function sanitizeExecStatus($status) + { + $statusSet = (array) $status; + $sane = array(); + foreach ($statusSet as $code) { + $oascii = ord($code[0]); + if ($oascii >= ord('a') && $oascii <= ord('z')) { + $sane[] = $code[0]; + } + } + return $sane; + } + + /** + */ + public static function getName(&$dbh, $id) + { + $sch = tlDBObject::getDBTables(array( + 'nodes_hierarchy', + 'testplans' + )); + $sql = "SELECT name FROM {$sch['nodes_hierarchy']} NH JOIN {$sch['testplans']} TPLAN ON TPLAN.id = NH.id - WHERE TPLAN.id=" . intval($id); - $rs = $dbh->get_recordset($sql); - return is_null($rs) ? $rs : $rs[0]['name']; - } - - - /** - * - */ - function getCustomFieldsValues($id,$tproject_id,$scope='design',$filters=null) - { - $cf_map = $this->get_linked_cfields_at_design($id,$tproject_id,$filters); - $cf = []; - if( !is_null($cf_map) ) { - foreach($cf_map as $cf_id => $cf_info) { - $value = ''; - if (isset($cf_info['node_id']) || $cf_info['node_id']) { - $value = $this->cfield_mgr->string_custom_field_value($cf_info,$id); - } - $cf[] = ["label" => $cf_info['label'], - "name" => $cf_info['name'], - "type" => trim($this->cfield_mgr->custom_field_types[$cf_info['type']]), - "value" => $value]; - } - } - return $cf; - } - - -} // end class testplan - - -// ###################################################################################### -/** - * Build Manager Class - * @package TestLink - **/ -class build_mgr extends tlObject { - /** @var database handler */ - var $db; - var $cfield_mgr; - - /** - * Build Manager class constructor - * - * @param resource &$db reference to database handler - **/ - function __construct(&$db) { - parent::__construct(); - $this->db = &$db; - $this->cfield_mgr = new cfield_mgr($this->db); - } - - /** - * builds - */ - function getCustomFieldsValues($build_id,$tproject_id,$scope='design',$filters=null) - { - $cf_map = $this->get_linked_cfields_at_design($build_id,$tproject_id,$filters); - $cf = []; - if( !is_null($cf_map) ) { - foreach($cf_map as $cf_id => $cf_info) { - $value = ''; - if (isset($cf_info['node_id']) || $cf_info['node_id']) { - $value = $this->cfield_mgr->string_custom_field_value($cf_info,$build_id); - } - $cf[] = ["label" => $cf_info['label'], - "name" => $cf_info['name'], - "type" => trim($this->cfield_mgr->custom_field_types[$cf_info['type']]), - "value" => $value]; - } - } - return $cf; - } - - - /** - * Build Manager - */ - function setZeroOneAttr($id,$attr,$zeroOne) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ " . - "UPDATE {$this->tables['builds']} SET {$attr}=" . ($zeroOne ? 1 : 0) . " WHERE id=" . intval($id); - $this->db->exec_query($sql); - } - - - /** - * Build Manager - */ - function setActive($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $this->setZeroOneAttr($id,'active',1); - } - - /** - * Build Manager - */ - function setInactive($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $this->setZeroOneAttr($id,'active',0); - } - - /** - * Build Manager - */ - function setOpen($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $this->setZeroOneAttr($id,'is_open',1); - $this->setClosedOnDate($id,null); - } - - /** - * Build Manager - */ - function setClosed($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $this->setZeroOneAttr($id,'is_open',0); - $timestamp = explode(' ',trim($this->db->db_now(),"'")); - $this->setClosedOnDate($id,$timestamp[0]); - } - - - - /** - * Build Manager - * - * createFromObject - */ - function createFromObject($item,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - try { - // mandatory checks - if(strlen($item->name)==0) { - throw new Exception('Build - Empty name is not allowed'); - } - - // what checks need to be done ? - // 1. does test plan exist? - $item->tplan_id = intval($item->tplan_id); - $tm = new tree($this->db); - $ntv = array_flip($tm->get_available_node_types()); - $pinfo = $tm->get_node_hierarchy_info($item->tplan_id); - if(is_null($pinfo) || - $ntv[$pinfo['node_type_id']] != 'testplan') { - throw new Exception( - "Build - Test Plan ID {$item->tplan_id} does not exist"); - } - - // 2. there is NO other build on test plan with same name - $name = trim($item->name); - $op = $this->checkNameExistence($item->tplan_id,$name); - if(!$op['status_ok']) { - throw new Exception( - "Build name {$name} is already in use on Test Plan {$item->tplan_id}"); - } - } catch (Exception $e) { - throw $e; // rethrow - } - - // seems OK => check all optional attributes - $build = new stdClass(); - $prop = array('release_date' => '','notes' => '', - 'commit_id' => '', 'tag' => '', - 'branch' => '', 'release_candidate' => '', - 'is_active' => 1,'is_open' => 1, - 'creation_ts' => $this->db->db_now()); - - $build->name = $item->name; - $build->tplan_id = $item->tplan_id; - foreach( $prop as $nu => $value ) { - $build->$nu = $value; - if( property_exists($item, $nu) ) { - switch( $nu ) { - case 'creation_ts': - if(null != $item->$nu && '' == trim($item->$nu) ) { - $build->$nu = $item->$nu; - } - break; - - case 'is_active': - case 'is_open': - $build->$nu = intval($item->$nu) > 0 ? 1 : 0; - break; - - default: - $build->$nu = $item->$nu; - break; - } - } - } - $build->release_date = trim($build->release_date); - $ps = 'prepare_string'; - $sql = " INSERT INTO {$this->tables['builds']} " . - " (testplan_id,name,notes, + WHERE TPLAN.id=" . intval($id); + $rs = $dbh->get_recordset($sql); + return is_null($rs) ? $rs : $rs[0]['name']; + } + + /** + */ + public function getCustomFieldsValues($id, $tproject_id, $scope = 'design', + $filters = null) + { + $cf_map = $this->get_linked_cfields_at_design($id, $tproject_id, + $filters); + $cf = []; + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + $value = ''; + if (isset($cf_info['node_id']) || $cf_info['node_id']) { + $value = $this->cfield_mgr->string_custom_field_value( + $cf_info, $id); + } + $cf[] = [ + "label" => $cf_info['label'], + "name" => $cf_info['name'], + "type" => trim( + $this->cfield_mgr->custom_field_types[$cf_info['type']]), + "value" => $value + ]; + } + } + return $cf; + } +} + +// ###################################################################################### +/** + * Build Manager Class + * + * @package TestLink + */ +class build_mgr extends tlObject +{ + + /** @var database handler */ + protected $db; + + public $cfield_mgr; + + /** + * Build Manager class constructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + parent::__construct(); + $this->db = &$db; + $this->cfield_mgr = new cfield_mgr($this->db); + } + + /** + * builds + */ + public function getCustomFieldsValues($build_id, $tproject_id, + $scope = 'design', $filters = null) + { + $cf_map = $this->get_linked_cfields_at_design($build_id, $tproject_id, + $filters); + $cf = []; + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + $value = ''; + if (isset($cf_info['node_id']) || $cf_info['node_id']) { + $value = $this->cfield_mgr->string_custom_field_value( + $cf_info, $build_id); + } + $cf[] = [ + "label" => $cf_info['label'], + "name" => $cf_info['name'], + "type" => trim( + $this->cfield_mgr->custom_field_types[$cf_info['type']]), + "value" => $value + ]; + } + } + return $cf; + } + + /** + * Build Manager + */ + private function setZeroOneAttr($id, $attr, $zeroOne) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ " . + "UPDATE {$this->tables['builds']} SET {$attr}=" . ($zeroOne ? 1 : 0) . + " WHERE id=" . intval($id); + $this->db->exec_query($sql); + } + + /** + * Build Manager + */ + public function setActive($id) + { + $this->setZeroOneAttr($id, 'active', 1); + } + + /** + * Build Manager + */ + public function setInactive($id) + { + $this->setZeroOneAttr($id, 'active', 0); + } + + /** + * Build Manager + */ + public function setOpen($id) + { + $this->setZeroOneAttr($id, 'is_open', 1); + $this->setClosedOnDate($id, null); + } + + /** + * Build Manager + */ + public function setClosed($id) + { + $this->setZeroOneAttr($id, 'is_open', 0); + $timestamp = explode(' ', trim($this->db->db_now(), "'")); + $this->setClosedOnDate($id, $timestamp[0]); + } + + /** + * Build Manager + * + * createFromObject + */ + public function createFromObject($item, $opt = null) + { + try { + // mandatory checks + if (strlen($item->name) == 0) { + throw new Exception('Build - Empty name is not allowed'); + } + + // what checks need to be done ? + // 1. does test plan exist? + $item->tplan_id = intval($item->tplan_id); + $tm = new tree($this->db); + $ntv = array_flip($tm->get_available_node_types()); + $pinfo = $tm->get_node_hierarchy_info($item->tplan_id); + if (is_null($pinfo) || $ntv[$pinfo['node_type_id']] != 'testplan') { + throw new Exception( + "Build - Test Plan ID {$item->tplan_id} does not exist"); + } + + // 2. there is NO other build on test plan with same name + $name = trim($item->name); + $op = $this->checkNameExistence($item->tplan_id, $name); + if (! $op['status_ok']) { + throw new Exception( + "Build name {$name} is already in use on Test Plan {$item->tplan_id}"); + } + } catch (Exception $e) { + throw $e; // rethrow + } + + // seems OK => check all optional attributes + $build = new stdClass(); + $prop = array( + 'release_date' => '', + 'notes' => '', + 'commit_id' => '', + 'tag' => '', + 'branch' => '', + 'release_candidate' => '', + 'is_active' => 1, + 'is_open' => 1, + 'creation_ts' => $this->db->db_now() + ); + + $build->name = $item->name; + $build->tplan_id = $item->tplan_id; + foreach ($prop as $nu => $value) { + $build->$nu = $value; + if (property_exists($item, $nu)) { + switch ($nu) { + case 'creation_ts': + if (null != $item->$nu && '' == trim($item->$nu)) { + $build->$nu = $item->$nu; + } + break; + + case 'is_active': + case 'is_open': + $build->$nu = intval($item->$nu) > 0 ? 1 : 0; + break; + + default: + $build->$nu = $item->$nu; + break; + } + } + } + $build->release_date = trim($build->release_date); + $ps = 'prepare_string'; + $sql = " INSERT INTO {$this->tables['builds']} " . + " (testplan_id,name,notes, commit_id,tag,branch,release_candidate, - active,is_open,creation_ts,release_date) " . - " VALUES ('". $build->tplan_id . "','" . - $this->db->$ps($build->name) . "','" . - $this->db->$ps($build->notes) . "',"; - - $sql .= "'" . $this->db->$ps($build->commit_id) . "'," . - "'" . $this->db->$ps($build->tag) . "'," . - "'" . $this->db->$ps($build->branch) . "'," . - "'" . $this->db->$ps($build->release_candidate) . "',"; - - $sql .= "{$build->is_active},{$build->is_open},{$build->creation_ts}"; - - if($build->release_date == '') { - $sql .= ",NULL)"; - } else { - $sql .= ",'" . $this->db->$ps($build->release_date) . "')"; - } - - $id = 0; - $result = $this->db->exec_query($sql); - if ($result) { - $id = $this->db->insert_id($this->tables['builds']); - } - - return $id; - } - - - /* - Build Manager - - function: create - - args : - $tplan_id - $name - $notes - [$active]: default: 1 - [$open]: default: 1 - [release_date]: YYYY-MM-DD - - - returns: - - rev : - */ - function create($tplan_id,$name,$notes = '',$active=1,$open=1,$release_date='') - { - $targetDate = trim($release_date); - $sql = " INSERT INTO {$this->tables['builds']} " . - " (testplan_id,name,notes,release_date,active,is_open,creation_ts) " . - " VALUES ('". $tplan_id . "','" . $this->db->prepare_string($name) . "','" . - $this->db->prepare_string($notes) . "',"; - - if($targetDate == '') { - $sql .= "NULL,"; - } - else { - $sql .= "'" . $this->db->prepare_string($targetDate) . "',"; - } - - $sql .= "{$active},{$open},{$this->db->db_now()})"; - - $id = 0; - $result = $this->db->exec_query($sql); - if ($result) { - $id = $this->db->insert_id($this->tables['builds']); - } - - return $id; - } - - - /* - function: update - - args : - $id - $name - $notes - [$active]: default: null - [$open]: default: null - [$release_date]='' FORMAT YYYY-MM-DD - [$closed_on_date]='' FORMAT YYYY-MM-DD - - returns: - - rev : - */ - function update($id,$name,$notes,$attr=null) { - - $members = array('is_active' => null, 'is_open' => null, - 'release_date' => '', 'closed_on_date=' => '', - 'commit_id' => '', 'tag' => '', - 'branch' => '', 'release_candidate' => ''); - - $members = array_merge($members,(array)$attr); - - $closure_date = ''; - $targetDate = trim($members['release_date']); - $sql = " UPDATE {$this->tables['builds']} " . - " SET name='" . $this->db->prepare_string($name) . "'," . - " notes='" . $this->db->prepare_string($notes) . "'"; - - if($targetDate == '') { - $sql .= ",release_date=NULL"; - } else { - $sql .= ",release_date='" . $this->db->prepare_string($targetDate) . "'"; - } - - if( !is_null($members['is_active']) ) { - $sql .=" , active=" . intval($members['is_active']); - } - - if( !is_null($members['is_open']) ) { - $open_status=intval($members['is_open']) ? 1 : 0; - $sql .=" , is_open=" . $open_status; - - if($open_status == 1) { - $closure_date = ''; - } - } - - // New attributes - $ps = 'prepare_string'; - $ax = array('commit_id','tag','branch','release_candidate'); - foreach( $ax as $fi ) { - $sql .= ", $fi='" . $this->db->$ps($members[$fi]) . "'"; - } - - if($closure_date == '') { - $sql .= ",closed_on_date=NULL"; - } else { - // may be will be useful validate date format - $sql .= ",closed_on_date='" . $this->db->prepare_string($closure_date) . "'"; - } - - $sql .= " WHERE id={$id}"; - $result = $this->db->exec_query($sql); - return $result ? 1 : 0; - } - - /** - * Delete a build - * - * @param integer $id - * @return integer status code - * - */ - function delete($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe_id = intval($id); - $where = " WHERE build_id={$safe_id}"; - $execIDSetSQL = " SELECT id FROM {$this->tables['executions']} {$where} "; - - - // Attachments NEED special processing. - - // get test step exec attachments if any exists - $dummy = " SELECT id FROM {$this->tables['execution_tcsteps']} " . - " WHERE execution_id IN ({$execIDSetSQL}) "; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - // execution attachments - $dummy = " SELECT id FROM {$this->tables['attachments']} " . - " WHERE fk_table = 'executions' " . - " AND fk_id IN ({$execIDSetSQL}) "; - - $rs = $this->db->fetchRowsIntoMap($dummy,'id'); - if(!is_null($rs)) { - foreach($rs as $fik => $v) { - deleteAttachment($this->db,$fik,false); - } - } - - - // Execution Bugs - $sql = " DELETE FROM {$this->tables['execution_bugs']} " . - " WHERE execution_id IN ({$execIDSetSQL}) "; - $result = $this->db->exec_query($sql); - - // Execution tcsteps results - $sql = "DELETE FROM {$this->tables['execution_tcsteps']} " . - " WHERE execution_id IN ({$execIDSetSQL}) "; - $result = $this->db->exec_query($sql); - - $sql = "DELETE FROM {$this->tables['cfield_execution_values']} " . - " WHERE execution_id IN ({$execIDSetSQL}) "; - $result = $this->db->exec_query($sql); - - - // Finally Executions table - $sql = " DELETE FROM {$this->tables['executions']} {$where}"; - $result = $this->db->exec_query($sql); - - - // Build ID is the Access Key - // User Task Assignment - $sql = " DELETE FROM {$this->tables['user_assignments']} {$where}"; - $result=$this->db->exec_query($sql); - - // Custom fields - $this->cfield_mgr->remove_all_design_values_from_node($safe_id,'build'); - - $sql = " DELETE FROM {$this->tables['builds']} WHERE id={$safe_id}"; - $result=$this->db->exec_query($sql); - return $result ? 1 : 0; - } - - - /* - function: get_by_id - get information about a build - - args : id: build id - - returns: map with following keys - id: build id - name: build name - notes: build notes - active: build active status - is_open: build open status - testplan_id - */ - function get_by_id($id,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('options' => - array('tplan_id' => null, 'output' => 'full', 'fields' => '*')); - $my['options'] = array_merge($my['options'],(array)$opt); - - $safe_id = intval($id); - - $sql = "/* {$debugMsg} */"; - switch($my['options']['output']) { - case 'minimun': - $sql .= " SELECT id,is_open,active,active AS is_active "; - break; - - case 'fields': - $sql .= " SELECT {$my['options']['fields']} "; - break; - - case 'full': - default: - $sql .= " SELECT *, active AS is_active "; - break; - } - - $sql .= " FROM {$this->tables['builds']} WHERE id = {$safe_id} "; - if(!is_null($my['options']['tplan_id']) && ($safe_tplan = intval($my['options']['tplan_id'])) > 0) { - $sql .= " AND testplan_id = {$safe_tplan} "; - } - - $result = $this->db->exec_query($sql); - $myrow = $this->db->fetch_array($result); - return $myrow; - } - - - - /* - function: get_by_name - get information about a build by name - */ - - function get_by_name($name,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('options' => array('tplan_id' => null, 'output' => 'full')); - $my['options'] = array_merge($my['options'],(array)$opt); - - $sql = "/* {$debugMsg} */"; - switch($my['options']['output']) - { - case 'minimun': - $sql .= " SELECT B.id, B.name, B.is_open, B.active "; - break; - - case 'full': - default: - $sql .= " SELECT B.* "; - break; - } - - $sql .= " FROM {$this->tables['builds']} B " . - " WHERE B.name = '" . $this->db->prepare_string($name) . "'"; - - if(!is_null($my['options']['tplan_id']) && ($safe_tplan = intval($my['options']['tplan_id'])) > 0) - { - $sql .= " AND B.testplan_id = {$safe_tplan} "; - } - - $rs = $this->db->get_recordset($sql); - return($rs); - } - - - - /** - * Set date of closing build - * - * @param integer $id Build identifier - * @param string $targetDate, format YYYY-MM-DD. can be null - * - * @return TBD TBD - */ - function setClosedOnDate($id,$targetDate) - { - $sql = " UPDATE {$this->tables['builds']} "; - - if( is_null($targetDate) ) - { - $sql .= " SET closed_on_date=NULL "; - } - else - { - $sql .= " SET closed_on_date='" . $this->db->prepare_string($targetDate) . "'"; - } - $sql .= " WHERE id={$id} "; - - $result = $this->db->exec_query($sql); - } - - - /** - * - * NEWNEW - */ - function get_linked_cfields_at_design($build_id,$tproject_id,$filters=null,$access_key='id') - { - $safeID = $build_id == 0 ? null : intval($build_id); - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::CF_ENABLED, - $filters,'build',$safeID,$access_key); - return $cf_map; - } - - /* - function: html_table_of_custom_field_inputs - - - args: $id - returns: html string - - */ - function html_table_of_custom_field_inputs($id,$tproject_id,$scope='design',$name_suffix='',$input_values=null) - { - $cf_smarty=''; - $method_suffix = $scope=='design' ? $scope : 'execution'; - $method_name = "get_linked_cfields_at_{$method_suffix}"; - $cf_map=$this->$method_name($id,$tproject_id); - if(!is_null($cf_map)) - { - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - } - return($cf_smarty); - } - - - /* - function: html_table_of_custom_field_inputs - - - args: $id - [$parent_id]: need when you call this method during the creation - of a test suite, because the $id will be 0 or null. - - [$scope]: 'design','execution' - - returns: html string - - */ - function html_custom_field_inputs($id,$tproject_id,$scope='design',$name_suffix='',$input_values=null) - { - $itemSet=''; - $method_suffix = $scope=='design' ? $scope : 'execution'; - $method_name = "get_linked_cfields_at_{$method_suffix}"; - $cf_map=$this->$method_name($id,$tproject_id); - if(!is_null($cf_map)) - { - $itemSet = $this->cfield_mgr->html_inputs($cf_map,$name_suffix,$input_values); - } - return $itemSet; - } - - /* - function: html_table_of_custom_field_values - - args: $id - [$scope]: 'design','execution' - - [$filters]:default: null - - map with keys: - - [show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - include ONLY custom fields that can be viewed - while user is execution testcases. - - 0 or null -> don't filter - - returns: html string - - rev : - */ - function html_table_of_custom_field_values($id,$tproject_id,$scope='design',$filters=null,$formatOptions=null) - { - $cf_smarty=''; - $parent_id=null; - $label_css_style=' class="labelHolder" ' ; - $value_css_style = ' '; - - $add_table=true; - $table_style=''; - if( !is_null($formatOptions) ) - { - $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; - $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; - - $add_table=isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; - $table_style=isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; - } - - $show_cf = config_get('custom_fields')->show_custom_fields_without_value; - $cf_map=$this->get_linked_cfields_at_design($id,$tproject_id,$filters); - - if( !is_null($cf_map) ) - { - foreach($cf_map as $cf_id => $cf_info) - { - if(isset($cf_info['node_id']) || $cf_info['node_id'] || $show_cf) - { - $label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true)); - $cf_smarty .= "" . htmlspecialchars($label) . "" . - "" . - $this->cfield_mgr->string_custom_field_value($cf_info,$id) . "\n"; - } - } - } - - if($cf_smarty != '' && $add_table) - { - $cf_smarty = "" . $cf_smarty . "
    "; - } - - return $cf_smarty; - } - - - - /** - * Build Manager - * - */ - function checkNameExistence($tplan_id,$build_name,$build_id=null, - $caseSens=0) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = " /* $debugMsg */ SELECT id, name, notes " . - " FROM {$this->tables['builds']} " . - " WHERE testplan_id = {$tplan_id} "; - - if($caseSens) { - $sql .= " AND name="; - } else { - $build_name = strtoupper($build_name); - $sql .= " AND UPPER(name)="; - } - $sql .= "'" . $this->db->prepare_string($build_name) . "'"; - - if( !is_null($build_id) ) { - $sql .= " AND id <> " . $this->db->prepare_int($build_id); - } - - $result = $this->db->exec_query($sql); - $rn = $this->db->num_rows($result); - $status = array(); - $status['status_ok'] = $rn == 0 ? 1 : 0; - return $status; - } - - - - -} // end class build_mgr - - -// ################################################################################## -/** - * Milestone Manager Class - * @package TestLink - **/ -class milestone_mgr extends tlObject -{ - /** @var database handler */ - var $db; - - /** - * class constructor - * - * @param resource &$db reference to database handler - **/ - function __construct(&$db) - { - parent::__construct(); - $this->db = &$db; - } - - /* - function: create() - - args : keys - $tplan_id - $name - $target_date: string with format: - $start_date: - $low_priority: percentage - $medium_priority: percentage - $high_priority: percentage - - returns: - - */ - function create($mi) - { - $item_id=0; - $dateFields=null; - $dateValues=null; - $dateKeys=array('target_date','start_date'); - - // check dates - foreach($dateKeys as $varname) - { - $value= trim($mi->$varname); - if($value != '') - { - if (($time = strtotime($value)) == -1 || $time === false) - { - die (__FUNCTION__ . ' Abort - Invalid date'); - } - $dateFields[]=$varname; - $dateValues[]=" '{$this->db->prepare_string($value)}' "; - } - } - $additionalFields=''; - if( !is_null($dateFields) ) - { - $additionalFields= ',' . implode(',',$dateFields) ; - $additionalValues= ',' . implode(',',$dateValues) ; - } - /* for future - $sql = "INSERT INTO {$this->tables['milestones']} " . - " (testplan_id,name,platform_id,build_id,a,b,c{$additionalFields}) " . - " VALUES (" . intval($mi->tplan_id) . "," . - "'{$this->db->prepare_string($mi->name)}'," . - intval($mi->platform_id) . "," . intval($mi->build_id) . "," . - $mi->low_priority . "," . $mi->medium_priority . "," . $mi->high_priority . - $additionalValues . ")"; - */ - $sql = "INSERT INTO {$this->tables['milestones']} " . - " (testplan_id,name,a,b,c{$additionalFields}) " . - " VALUES (" . intval($mi->tplan_id) . "," . - "'{$this->db->prepare_string($mi->name)}'," . - $mi->low_priority . "," . $mi->medium_priority . "," . $mi->high_priority . - $additionalValues . ")"; - - $result = $this->db->exec_query($sql); - - if ($result) - { - $item_id = $this->db->insert_id($this->tables['milestones']); - } - - return $item_id; - } - - /* - function: update - - args : - $id - $name - $notes - [$active]: default: 1 - [$open]: default: 1 - - - - returns: - - rev : - */ - function update($id,$name,$target_date,$start_date,$low_priority,$medium_priority,$high_priority) - { - $sql = "UPDATE {$this->tables['milestones']} " . - " SET name='{$this->db->prepare_string($name)}', " . - " target_date='{$this->db->prepare_string($target_date)}', " . - " start_date='{$this->db->prepare_string($start_date)}', " . - " a={$low_priority}, b={$medium_priority}, c={$high_priority} WHERE id={$id}"; - $result = $this->db->exec_query($sql); - return $result ? 1 : 0; - } - - - - /* - function: delete - - args : - $id - - - returns: - - */ - function delete($id) - { - $sql = "DELETE FROM {$this->tables['milestones']} WHERE id={$id}"; - $result=$this->db->exec_query($sql); - return $result ? 1 : 0; - } - - - /* - function: get_by_id - - args : - $id - returns: - - */ - function get_by_id($id) - { - $sql=" SELECT M.id, M.name, M.a AS high_percentage, " . - " M.b AS medium_percentage, M.c AS low_percentage, " . - " M.target_date, M.start_date, " . - " M.testplan_id, NH_TPLAN.name AS testplan_name " . - // " M.build_id, B.name AS build_name, " . - // " M.platform_id, P.name AS platform_name " . - " FROM {$this->tables['milestones']} M " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TPLAN " . - " ON NH_TPLAN.id=M.testplan_id " . - // " LEFT OUTER JOIN {$this->tables['builds']} B " . - // " ON B.id=M.build_id " . - // " LEFT OUTER JOIN {$this->tables['platforms']} P " . - // " ON P.id=M.platform_id " . - " WHERE M.id = " . $this->db->prepare_int($id); - - $row = $this->db->fetchRowsIntoMap($sql,'id'); - return $row; - } - - /** - * check existence of milestone name in Test Plan - * - * @param integer $tplan_id test plan id. - * @param string $milestone_name milestone name - * @param integer $milestone_id default: null - * when is not null we add milestone_id as filter, this is useful - * to understand if is really a duplicate when using this method - * while managing update operations via GUI - * - * @return integer 1 => name exists - */ - function check_name_existence($tplan_id,$milestone_name,$milestone_id=null,$case_sensitive=0) - { - $sql = " SELECT id, name FROM {$this->tables['milestones']} " . - " WHERE testplan_id = " . $this->db->prepare_int($tplan_id); - - if($case_sensitive) - { - $sql .= " AND name="; - } - else - { - $milestone_name=strtoupper($milestone_name); - $sql .= " AND UPPER(name)="; - } - $sql .= "'{$this->db->prepare_string($milestone_name)}'"; - - if( !is_null($milestone_id) ) - { - $sql .= " AND id <> " . $this->db->prepare_int($milestone_id); - } - - $result = $this->db->exec_query($sql); - $status= $this->db->num_rows($result) ? 1 : 0; - - return $status; - } - - - /* - function: get_all_by_testplan - get info about all milestones defined for a testlan - args : - tplan_id - - - returns: - - rev : - */ - function get_all_by_testplan($tplan_id) - { - $sql=" SELECT M.id, M.name, M.a AS high_percentage, M.b AS medium_percentage, M.c AS low_percentage, " . - " M.target_date, M.start_date, M.testplan_id, NH.name as testplan_name " . - " FROM {$this->tables['milestones']} M, {$this->tables['nodes_hierarchy']} NH " . - " WHERE testplan_id={$tplan_id} AND NH.id = testplan_id " . - " ORDER BY M.target_date,M.name"; - $rs=$this->db->get_recordset($sql); - return $rs; - } - - -} // end class milestone_mgr \ No newline at end of file + active,is_open,creation_ts,release_date) " . " VALUES ('" . + $build->tplan_id . "','" . $this->db->$ps($build->name) . "','" . + $this->db->$ps($build->notes) . "',"; + + $sql .= "'" . $this->db->$ps($build->commit_id) . "'," . "'" . + $this->db->$ps($build->tag) . "'," . "'" . + $this->db->$ps($build->branch) . "'," . "'" . + $this->db->$ps($build->release_candidate) . "',"; + + $sql .= "{$build->is_active},{$build->is_open},{$build->creation_ts}"; + + if ($build->release_date == '') { + $sql .= ",NULL)"; + } else { + $sql .= ",'" . $this->db->$ps($build->release_date) . "')"; + } + + $id = 0; + $result = $this->db->exec_query($sql); + if ($result) { + $id = $this->db->insert_id($this->tables['builds']); + } + + return $id; + } + + /* + * Build Manager + * + * function: create + * + * args : + * $tplan_id + * $name + * $notes + * [$active]: default: 1 + * [$open]: default: 1 + * [release_date]: YYYY-MM-DD + * + * + * returns: + * + * rev : + */ + public function create($tplan_id, $name, $notes = '', $active = 1, $open = 1, + $release_date = '') + { + $targetDate = trim($release_date); + $sql = " INSERT INTO {$this->tables['builds']} " . + " (testplan_id,name,notes,release_date,active,is_open,creation_ts) " . + " VALUES ('" . $tplan_id . "','" . $this->db->prepare_string($name) . + "','" . $this->db->prepare_string($notes) . "',"; + + if ($targetDate == '') { + $sql .= "NULL,"; + } else { + $sql .= "'" . $this->db->prepare_string($targetDate) . "',"; + } + + $sql .= "{$active},{$open},{$this->db->db_now()})"; + + $id = 0; + $result = $this->db->exec_query($sql); + if ($result) { + $id = $this->db->insert_id($this->tables['builds']); + } + + return $id; + } + + /* + * function: update + * + * args : + * $id + * $name + * $notes + * [$active]: default: null + * [$open]: default: null + * [$release_date]='' FORMAT YYYY-MM-DD + * [$closed_on_date]='' FORMAT YYYY-MM-DD + * + * returns: + * + * rev : + */ + public function update($id, $name, $notes, $attr = null) + { + $members = array( + 'is_active' => null, + 'is_open' => null, + 'release_date' => '', + 'closed_on_date=' => '', + 'commit_id' => '', + 'tag' => '', + 'branch' => '', + 'release_candidate' => '' + ); + + $members = array_merge($members, (array) $attr); + + $closure_date = ''; + $targetDate = trim($members['release_date']); + $sql = " UPDATE {$this->tables['builds']} " . " SET name='" . + $this->db->prepare_string($name) . "'," . " notes='" . + $this->db->prepare_string($notes) . "'"; + + if ($targetDate == '') { + $sql .= ",release_date=NULL"; + } else { + $sql .= ",release_date='" . $this->db->prepare_string($targetDate) . + "'"; + } + + if (! is_null($members['is_active'])) { + $sql .= " , active=" . intval($members['is_active']); + } + + if (! is_null($members['is_open'])) { + $open_status = intval($members['is_open']) ? 1 : 0; + $sql .= " , is_open=" . $open_status; + + if ($open_status == 1) { + $closure_date = ''; + } + } + + // New attributes + $ps = 'prepare_string'; + $ax = array( + 'commit_id', + 'tag', + 'branch', + 'release_candidate' + ); + foreach ($ax as $fi) { + $sql .= ", $fi='" . $this->db->$ps($members[$fi]) . "'"; + } + + if ($closure_date == '') { + $sql .= ",closed_on_date=NULL"; + } else { + // may be will be useful validate date format + $sql .= ",closed_on_date='" . + $this->db->prepare_string($closure_date) . "'"; + } + + $sql .= " WHERE id={$id}"; + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /** + * Delete a build + * + * @param integer $id + * @return integer status code + * + */ + public function delete($id) + { + $safe_id = intval($id); + $where = " WHERE build_id={$safe_id}"; + $execIDSetSQL = " SELECT id FROM {$this->tables['executions']} {$where} "; + + // Attachments NEED special processing. + + // get test step exec attachments if any exists + $dummy = " SELECT id FROM {$this->tables['execution_tcsteps']} " . + " WHERE execution_id IN ({$execIDSetSQL}) "; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // execution attachments + $dummy = " SELECT id FROM {$this->tables['attachments']} " . + " WHERE fk_table = 'executions' " . + " AND fk_id IN ({$execIDSetSQL}) "; + + $rs = $this->db->fetchRowsIntoMap($dummy, 'id'); + if (! is_null($rs)) { + foreach ($rs as $fik => $v) { + deleteAttachment($this->db, $fik, false); + } + } + + // Execution Bugs + $sql = " DELETE FROM {$this->tables['execution_bugs']} " . + " WHERE execution_id IN ({$execIDSetSQL}) "; + $this->db->exec_query($sql); + + // Execution tcsteps results + $sql = "DELETE FROM {$this->tables['execution_tcsteps']} " . + " WHERE execution_id IN ({$execIDSetSQL}) "; + $this->db->exec_query($sql); + + $sql = "DELETE FROM {$this->tables['cfield_execution_values']} " . + " WHERE execution_id IN ({$execIDSetSQL}) "; + $this->db->exec_query($sql); + + // Finally Executions table + $sql = " DELETE FROM {$this->tables['executions']} {$where}"; + $this->db->exec_query($sql); + + // Build ID is the Access Key + // User Task Assignment + $sql = " DELETE FROM {$this->tables['user_assignments']} {$where}"; + $this->db->exec_query($sql); + + // Custom fields + $this->cfield_mgr->remove_all_design_values_from_node($safe_id, 'build'); + + $sql = " DELETE FROM {$this->tables['builds']} WHERE id={$safe_id}"; + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /* + * function: get_by_id + * get information about a build + * + * args : id: build id + * + * returns: map with following keys + * id: build id + * name: build name + * notes: build notes + * active: build active status + * is_open: build open status + * testplan_id + */ + public function get_by_id($id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'options' => array( + 'tplan_id' => null, + 'output' => 'full', + 'fields' => '*' + ) + ); + $my['options'] = array_merge($my['options'], (array) $opt); + + $safe_id = intval($id); + + $sql = "/* {$debugMsg} */"; + switch ($my['options']['output']) { + case 'minimun': + $sql .= " SELECT id,is_open,active,active AS is_active "; + break; + + case 'fields': + $sql .= " SELECT {$my['options']['fields']} "; + break; + + case 'full': + default: + $sql .= " SELECT *, active AS is_active "; + break; + } + + $sql .= " FROM {$this->tables['builds']} WHERE id = {$safe_id} "; + if (! is_null($my['options']['tplan_id']) && + ($safe_tplan = intval($my['options']['tplan_id'])) > 0) { + $sql .= " AND testplan_id = {$safe_tplan} "; + } + + $result = $this->db->exec_query($sql); + return $this->db->fetch_array($result); + } + + /* + * function: get_by_name + * get information about a build by name + */ + public function get_by_name($name, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'options' => array( + 'tplan_id' => null, + 'output' => 'full' + ) + ); + $my['options'] = array_merge($my['options'], (array) $opt); + + $sql = "/* {$debugMsg} */"; + switch ($my['options']['output']) { + case 'minimun': + $sql .= " SELECT B.id, B.name, B.is_open, B.active "; + break; + + case 'full': + default: + $sql .= " SELECT B.* "; + break; + } + + $sql .= " FROM {$this->tables['builds']} B " . " WHERE B.name = '" . + $this->db->prepare_string($name) . "'"; + + if (! is_null($my['options']['tplan_id']) && + ($safe_tplan = intval($my['options']['tplan_id'])) > 0) { + $sql .= " AND B.testplan_id = {$safe_tplan} "; + } + + return $this->db->get_recordset($sql); + } + + /** + * Set date of closing build + * + * @param integer $id + * Build identifier + * @param string $targetDate, + * format YYYY-MM-DD. can be null + * + * @return array TBD + */ + public function setClosedOnDate($id, $targetDate) + { + $sql = " UPDATE {$this->tables['builds']} "; + + if (is_null($targetDate)) { + $sql .= " SET closed_on_date=NULL "; + } else { + $sql .= " SET closed_on_date='" . + $this->db->prepare_string($targetDate) . "'"; + } + $sql .= " WHERE id={$id} "; + + $this->db->exec_query($sql); + } + + /** + * NEWNEW + */ + public function get_linked_cfields_at_design($build_id, $tproject_id, + $filters = null, $access_key = 'id') + { + $safeID = $build_id == 0 ? null : intval($build_id); + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + cfield_mgr::CF_ENABLED, $filters, 'build', $safeID, $access_key); + } + + /* + * function: html_table_of_custom_field_inputs + * + * + * args: $id + * returns: html string + * + */ + public function html_table_of_custom_field_inputs($id, $tproject_id, + $scope = 'design', $name_suffix = '', $input_values = null) + { + $cf_smarty = ''; + $method_suffix = $scope == 'design' ? $scope : 'execution'; + $method_name = "get_linked_cfields_at_{$method_suffix}"; + $cf_map = $this->$method_name($id, $tproject_id); + if (! is_null($cf_map)) { + $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map, + $name_suffix, $input_values); + } + return $cf_smarty; + } + + /* + * function: html_table_of_custom_field_inputs + * + * + * args: $id + * [$parent_id]: need when you call this method during the creation + * of a test suite, because the $id will be 0 or null. + * + * [$scope]: 'design','execution' + * + * returns: html string + * + */ + public function html_custom_field_inputs($id, $tproject_id, + $scope = 'design', $name_suffix = '', $input_values = null) + { + $itemSet = ''; + $method_suffix = $scope == 'design' ? $scope : 'execution'; + $method_name = "get_linked_cfields_at_{$method_suffix}"; + $cf_map = $this->$method_name($id, $tproject_id); + if (! is_null($cf_map)) { + $itemSet = $this->cfield_mgr->html_inputs($cf_map, $name_suffix, + $input_values); + } + return $itemSet; + } + + /* + * function: html_table_of_custom_field_values + * + * args: $id + * [$scope]: 'design','execution' + * + * [$filters]:default: null + * + * map with keys: + * + * [show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * include ONLY custom fields that can be viewed + * while user is execution testcases. + * + * 0 or null -> don't filter + * + * returns: html string + * + * rev : + */ + public function html_table_of_custom_field_values($id, $tproject_id, + $scope = 'design', $filters = null, $formatOptions = null) + { + $cf_smarty = ''; + $label_css_style = ' class="labelHolder" '; + $value_css_style = ' '; + + $add_table = true; + $table_style = ''; + if (! is_null($formatOptions)) { + $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; + $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; + + $add_table = isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; + $table_style = isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; + } + + $show_cf = config_get('custom_fields')->show_custom_fields_without_value; + $cf_map = $this->get_linked_cfields_at_design($id, $tproject_id, + $filters); + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + if (isset($cf_info['node_id']) || $cf_info['node_id'] || $show_cf) { + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, true)); + $cf_smarty .= "" . + htmlspecialchars($label) . "" . + "" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $id) . "\n"; + } + } + } + + if ($cf_smarty != '' && $add_table) { + $cf_smarty = "" . $cf_smarty . "
    "; + } + + return $cf_smarty; + } + + /** + * Build Manager + */ + private function checkNameExistence($tplan_id, $build_name, $build_id = null, + $caseSens = 0) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = " /* $debugMsg */ SELECT id, name, notes " . + " FROM {$this->tables['builds']} " . + " WHERE testplan_id = {$tplan_id} "; + + if ($caseSens) { + $sql .= " AND name="; + } else { + $build_name = strtoupper($build_name); + $sql .= " AND UPPER(name)="; + } + $sql .= "'" . $this->db->prepare_string($build_name) . "'"; + + if (! is_null($build_id)) { + $sql .= " AND id <> " . $this->db->prepare_int($build_id); + } + + $result = $this->db->exec_query($sql); + $rn = $this->db->num_rows($result); + $status = array(); + $status['status_ok'] = $rn == 0 ? 1 : 0; + return $status; + } +} + +/** + * Milestone Manager Class + * + * @package TestLink + */ +class milestone_mgr extends tlObject +{ + + /** @var database handler */ + protected $db; + + /** + * class constructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + parent::__construct(); + $this->db = &$db; + } + + /* + * function: create() + * + * args : keys + * $tplan_id + * $name + * $target_date: string with format: + * $start_date: + * $low_priority: percentage + * $medium_priority: percentage + * $high_priority: percentage + * + * returns: + * + */ + public function create($mi) + { + $item_id = 0; + $dateFields = null; + $dateValues = null; + $dateKeys = array( + 'target_date', + 'start_date' + ); + + // check dates + foreach ($dateKeys as $varname) { + $value = trim($mi->$varname); + if ($value != '') { + if (($time = strtotime($value)) == - 1 || $time === false) { + die(__FUNCTION__ . ' Abort - Invalid date'); + } + $dateFields[] = $varname; + $dateValues[] = " '{$this->db->prepare_string($value)}' "; + } + } + $additionalFields = ''; + if (! is_null($dateFields)) { + $additionalFields = ',' . implode(',', $dateFields); + $additionalValues = ',' . implode(',', $dateValues); + } + /* + * for future + * $sql = "INSERT INTO {$this->tables['milestones']} " . + * " (testplan_id,name,platform_id,build_id,a,b,c{$additionalFields}) " . + * " VALUES (" . intval($mi->tplan_id) . "," . + * "'{$this->db->prepare_string($mi->name)}'," . + * intval($mi->platform_id) . "," . intval($mi->build_id) . "," . + * $mi->low_priority . "," . $mi->medium_priority . "," . $mi->high_priority . + * $additionalValues . ")"; + */ + $sql = "INSERT INTO {$this->tables['milestones']} " . + " (testplan_id,name,a,b,c{$additionalFields}) " . " VALUES (" . + intval($mi->tplan_id) . "," . + "'{$this->db->prepare_string($mi->name)}'," . $mi->low_priority . "," . + $mi->medium_priority . "," . $mi->high_priority . $additionalValues . + ")"; + + $result = $this->db->exec_query($sql); + + if ($result) { + $item_id = $this->db->insert_id($this->tables['milestones']); + } + + return $item_id; + } + + /* + * function: update + * + * args : + * $id + * $name + * $notes + * [$active]: default: 1 + * [$open]: default: 1 + * + * + * + * returns: + * + * rev : + */ + public function update($id, $name, $target_date, $start_date, $low_priority, + $medium_priority, $high_priority) + { + $sql = "UPDATE {$this->tables['milestones']} " . + " SET name='{$this->db->prepare_string($name)}', " . + " target_date='{$this->db->prepare_string($target_date)}', " . + " start_date='{$this->db->prepare_string($start_date)}', " . + " a={$low_priority}, b={$medium_priority}, c={$high_priority} WHERE id={$id}"; + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /* + * function: delete + * + * args : + * $id + * + * + * returns: + * + */ + public function delete($id) + { + $sql = "DELETE FROM {$this->tables['milestones']} WHERE id={$id}"; + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /* + * function: get_by_id + * + * args : + * $id + * returns: + * + */ + public function get_by_id($id) + { + $sql = " SELECT M.id, M.name, M.a AS high_percentage, " . + " M.b AS medium_percentage, M.c AS low_percentage, " . + " M.target_date, M.start_date, " . + " M.testplan_id, NH_TPLAN.name AS testplan_name " . + " FROM {$this->tables['milestones']} M " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TPLAN " . + " ON NH_TPLAN.id=M.testplan_id " . " WHERE M.id = " . + $this->db->prepare_int($id); + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + * check existence of milestone name in Test Plan + * + * @param integer $tplan_id + * test plan id. + * @param string $milestone_name + * milestone name + * @param integer $milestone_id + * default: null + * when is not null we add milestone_id as filter, this is useful + * to understand if is really a duplicate when using this method + * while managing update operations via GUI + * + * @return integer 1 => name exists + */ + public function check_name_existence($tplan_id, $milestone_name, + $milestone_id = null, $case_sensitive = 0) + { + $sql = " SELECT id, name FROM {$this->tables['milestones']} " . + " WHERE testplan_id = " . $this->db->prepare_int($tplan_id); + + if ($case_sensitive) { + $sql .= " AND name="; + } else { + $milestone_name = strtoupper($milestone_name); + $sql .= " AND UPPER(name)="; + } + $sql .= "'{$this->db->prepare_string($milestone_name)}'"; + + if (! is_null($milestone_id)) { + $sql .= " AND id <> " . $this->db->prepare_int($milestone_id); + } + + $result = $this->db->exec_query($sql); + return $this->db->num_rows($result) ? 1 : 0; + } + + /* + * function: get_all_by_testplan + * get info about all milestones defined for a testlan + * args : + * tplan_id + * + * + * returns: + * + * rev : + */ + public function get_all_by_testplan($tplan_id) + { + $sql = " SELECT M.id, M.name, M.a AS high_percentage, M.b AS medium_percentage, M.c AS low_percentage, " . + " M.target_date, M.start_date, M.testplan_id, NH.name as testplan_name " . + " FROM {$this->tables['milestones']} M, {$this->tables['nodes_hierarchy']} NH " . + " WHERE testplan_id={$tplan_id} AND NH.id = testplan_id " . + " ORDER BY M.target_date,M.name"; + return $this->db->get_recordset($sql); + } +} diff --git a/lib/functions/testproject.class.php b/lib/functions/testproject.class.php index 37b75194c3..7ff575db65 100644 --- a/lib/functions/testproject.class.php +++ b/lib/functions/testproject.class.php @@ -1,3402 +1,3453 @@ - 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me'); - - var $nt2exclude_children=array('testcase' => 'exclude_my_children','requirement_spec'=> 'exclude_my_children'); - - var $debugMsg; - var $tmp_dir; - var $node_types_descr_id; - var $my_node_type; - var $cfg; - - /** - * Class constructor - * - * @param resource &$db reference to database handler - */ - function __construct(&$db) { - - $this->tmp_dir = config_get('temp_dir'); - - $this->db = &$db; - $this->tree_manager = new tree($this->db); - $this->cfield_mgr=new cfield_mgr($this->db); - $this->debugMsg = 'Class:' . __CLASS__ . ' - Method: '; - tlObjectWithAttachments::__construct($this->db,'nodes_hierarchy'); - $this->object_table = $this->tables['testprojects']; - - $this->node_types_descr_id = &$this->tree_manager->node_descr_id; - $this->my_node_type = $this->tree_manager->node_descr_id['testproject']; - - $this->cfg = new stdClass(); - $this->cfg->keywords = config_get('keywords'); - } - -/** - * Create a new Test project - * - * @param string $name Name of project - * @param string $color value according to CSS color definition - * @param string $notes project description (HTML text) - * @param array $options project features/options - * bolean keys: inventoryEnabled, automationEnabled, - * testPriorityEnabled, requirementsEnabled - * @param boolean $active [1,0] optional - * @param string $tcasePrefix [''] - * @param boolean $is_public [1,0] optional - * - * @return integer test project id or 0 (if fails) - * - * @internal revisions - * - */ -function create($item,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('doChecks' => false, 'setSessionProject' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $serOptions = serialize($item->options); - - try { - $tcPrefix = $this->formatTcPrefix($item->prefix); // will truncate prefix is len() > limit - - // mandatory checks - if(strlen($item->name)==0) { - throw new Exception('Empty name is not allowed'); - } - - if($my['opt']['doChecks']) { - $check = $this->checkNameSintax($item->name); - if($check['status_ok']) { - $check = $this->checkNameExistence($item->name); - } - if($check['status_ok']) { - $check = $this->checkTestCasePrefixExistence($tcPrefix); - } - - if(!$check['status_ok']) { - throw new Exception($check['msg']); - } - } - } - catch (Exception $e) { - throw $e; // rethrow - } - - // Create API KEY 64 bit long - $api_key = md5(rand()) . md5(rand()); - - // Create Node and get the id - $id = $this->tree_manager->new_root_node($item->name); - $sql = " INSERT INTO {$this->object_table} (id,color," . - " options,notes,active,is_public,prefix,api_key) " . - " VALUES (" . $id . ", '" . - $this->db->prepare_string($item->color) . "','" . - $serOptions . "','" . - $this->db->prepare_string($item->notes) . "'," . - $item->active . "," . $item->is_public . ",'" . - $this->db->prepare_string($tcPrefix) . "','" . - $this->db->prepare_string($api_key) . "')"; - $result = $this->db->exec_query($sql); - - $evt = new stdClass(); - $evt->message = TLS("audit_testproject_created", $item->name); - $evt->code = "CREATE"; - $evt->source = $this->auditCfg->eventSource; - $evt->objectType = 'testprojects'; - - if ($result) { - // set project to session if not defined (the first project) or update the current - if (!isset($_SESSION['testprojectID']) && $my['opt']['setSessionProject']) { - $this->setSessionProject($id); - } - $evt->logLevel = 'AUDIT'; - - // Send Event - $ctx = array('id' => $id, 'name' => $item->name, 'prefix' => $tcPrefix); - event_signal('EVENT_TEST_PROJECT_CREATE', $ctx); - } - else { - $id = 0; - $evt->logLevel = 'ERROR'; - } - - $evt->objectID = $id; - - logEvent($evt); - - return $id; -} - -/** - * Update Test project data in DB and (if applicable) current session data - * - * @param integer $id project Identifier - * @param string $name Name of project - * @param string $color value according to CSS color definition - * @param string $notes project description (HTML text) - * @param array $options project features/options - * bolean keys: inventoryEnabled, automationEnabled, - * testPriorityEnabled, requirementsEnabled - * - * @return boolean result of DB update - * - * @internal - * - **/ -function update($id, $name, $color, $notes,$options,$active=null, - $tcasePrefix=null,$is_public=null) -{ - $status_ok=1; - $status_msg = 'ok'; - $log_msg = 'Test project ' . $name . ' update: Ok.'; - $log_level = 'INFO'; - $safeID = intval($id); - - $add_upd=''; - if( !is_null($active) ) - { - $add_upd .=',active=' . (intval($active) > 0 ? 1:0); - } - - if( !is_null($is_public) ) - { - $add_upd .=',is_public=' . (intval($is_public) > 0 ? 1:0); - } - - if( !is_null($tcasePrefix) ) - { - $tcprefix=$this->formatTcPrefix($tcasePrefix); - $add_upd .=",prefix='" . $this->db->prepare_string($tcprefix) . "'" ; - } - $serOptions = serialize($options); - - $sql = " UPDATE {$this->object_table} SET color='" . $this->db->prepare_string($color) . "', ". - " options='" . $serOptions . "', " . - " notes='" . $this->db->prepare_string($notes) . "' {$add_upd} " . - " WHERE id=" . $safeID; - $result = $this->db->exec_query($sql); - - if ($result) - { - // update related node - $sql = "UPDATE {$this->tables['nodes_hierarchy']} SET name='" . - $this->db->prepare_string($name) . "' WHERE id= {$safeID}"; - $result = $this->db->exec_query($sql); - } - - if ($result) - { - // update session data - $this->setSessionProject($safeID); - - // Send Event - $ctx = array('id' => $id, 'name' => $name, 'prefix' => $tcprefix); - event_signal('EVENT_TEST_PROJECT_UPDATE', $ctx); - } - else - { - $status_msg = 'Update FAILED!'; - $status_ok = 0; - $log_level ='ERROR'; - $log_msg = $status_msg; - } - - tLog($log_msg,$log_level); - return ($status_ok); -} - -/** - * Set session data related to a Test project - * - * @param integer $projectId Project ID; zero causes unset data - */ -public function setSessionProject($projectId) -{ - $tproject_info = null; - - if ($projectId) - { - $tproject_info = $this->get_by_id($projectId); - } - - if ($tproject_info) { - $_SESSION['testprojectID'] = $tproject_info['id']; - $_SESSION['testprojectName'] = $tproject_info['name']; - $_SESSION['testprojectColor'] = $tproject_info['color']; - $_SESSION['testprojectPrefix'] = $tproject_info['prefix']; - - $_SESSION['testprojectOptions'] = new stdClass(); - $_SESSION['testprojectOptions']->requirementsEnabled = - isset($tproject_info['opt']->requirementsEnabled) - ? $tproject_info['opt']->requirementsEnabled : 0; - $_SESSION['testprojectOptions']->testPriorityEnabled = - isset($tproject_info['opt']->testPriorityEnabled) - ? $tproject_info['opt']->testPriorityEnabled : 0; - $_SESSION['testprojectOptions']->automationEnabled = - isset($tproject_info['opt']->automationEnabled) - ? $tproject_info['opt']->automationEnabled : 0; - $_SESSION['testprojectOptions']->inventoryEnabled = - isset($tproject_info['opt']->inventoryEnabled) - ? $tproject_info['opt']->inventoryEnabled : 0; - - tLog("Test Project was activated: [" . $tproject_info['id'] . "]" . - $tproject_info['name'], 'INFO'); - } - else - { - if (isset($_SESSION['testprojectID'])) - { - tLog("Test Project deactivated: [" . $_SESSION['testprojectID'] . "] " . - $_SESSION['testprojectName'], 'INFO'); - } - unset($_SESSION['testprojectID']); - unset($_SESSION['testprojectName']); - unset($_SESSION['testprojectColor']); - unset($_SESSION['testprojectOptions']); - unset($_SESSION['testprojectPrefix']); - } - -} - - -/** - * Unserialize project options - * - * @param array $recorset produced by getTestProject() - */ -protected function parseTestProjectRecordset(&$recordset) { - if (null != $recordset && count($recordset) > 0) { - foreach ($recordset as $number => $row) { - $recordset[$number]['opt'] = unserialize($row['options']); - } - } else { - $recordset = null; - tLog('parseTestProjectRecordset: No project on query', 'DEBUG'); - } -} - - -/** - * Get Test project data according to parameter with unique value - * - * @param string $condition (optional) additional SQL condition(s) - * @return array map with test project info; null if query fails - */ -protected function getTestProject($condition = null, $opt=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('options' => array('output' => 'full')); - $my['options'] = array_merge($my['options'],(array)$opt); - - $doParse = true; - $tprojCols = ' testprojects.* '; - - switch($my['options']['output']) { - case 'existsByID': - $doParse = false; - $sql = "/* debugMsg */ SELECT testprojects.id ". - " FROM {$this->object_table} testprojects " . - " WHERE 1=1 "; - break; - - case 'existsByName': - $doParse = false; - $sql = "/* debugMsg */ SELECT testprojects.id ". - " FROM {$this->object_table} testprojects, " . - " {$this->tables['nodes_hierarchy']} nodes_hierarchy". - " WHERE testprojects.id = nodes_hierarchy.id " . - " AND nodes_hierarchy.node_type_id = " . - $this->tree_manager->node_descr_id['testproject']; - break; - - case 'name': - $doParse = false; - $tprojCols = 'testprojects.id'; - - case 'full': - default: - $sql = "/* debugMsg */ SELECT {$tprojCols}, nodes_hierarchy.name ". - " FROM {$this->object_table} testprojects, " . - " {$this->tables['nodes_hierarchy']} nodes_hierarchy". - " WHERE testprojects.id = nodes_hierarchy.id "; - " AND nodes_hierarchy.node_type_id = " . - $this->tree_manager->node_descr_id['testproject']; - break; - } - if (!is_null($condition) ) - { - $sql .= " AND " . $condition; - } - - $rs = $this->db->get_recordset($sql); - if($doParse) - { - $this->parseTestProjectRecordset($rs); - } - return $rs; -} - - -/** - * Get Test project data according to name - * - * @param string $name - * @param string $addClause (optional) additional SQL condition(s) - * - * @return array map with test project info; null if query fails - */ -public function get_by_name($name, $addClause = null, $opt=null) -{ - $condition = "nodes_hierarchy.name='" . $this->db->prepare_string($name) . "'"; - $condition .= is_null($addClause) ? '' : " AND {$addClause} "; - - return $this->getTestProject($condition); -} - - -/** - * Get Test project data according to ID - * - * @param integer $id test project - * @return array map with test project info; null if query fails - */ -public function get_by_id($id, $opt=null) -{ - $condition = "testprojects.id=". intval($id); - $result = $this->getTestProject($condition,$opt); - return $result[0]; -} - - -/** - * Get Test project data according to prefix - * - * @param string $prefix - * @param string $addClause optional additional SQL 'AND filter' clause - * - * @return array map with test project info; null if query fails - */ -public function get_by_prefix($prefix, $addClause = null) { - $safe_prefix = $this->db->prepare_string($prefix); - $condition = "testprojects.prefix='{$safe_prefix}'"; - $condition .= is_null($addClause) ? '' : " AND {$addClause} "; - - $rs = $this->getTestProject($condition); - return $rs != null ? $rs[0] : null; -} - - -/** - * Get Test project data according to APIKEY - * - * @param string 64 chars - * @return array map with test project info; null if query fails - */ -public function getByAPIKey($apiKey, $opt=null) { - $condition = "testprojects.api_key='{$apiKey}'"; - $result = $this->getTestProject($condition,$opt); - return $result[0]; -} - - -/* - function: get_all - get array of info for every test project - without any kind of filter. - Every array element contains an assoc array with test project info - -args:[order_by]: default " ORDER BY nodes_hierarchy.name " -> testproject name - - -*/ -function get_all($filters=null,$options=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my = array ('filters' => '', 'options' => ''); - - - $my['filters'] = array('active' => null); - $my['options'] = array('order_by' => " ORDER BY nodes_hierarchy.name ", - 'access_key' => null, 'output' => 'std'); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - - if($my['options']['output'] == 'count') - { - $sql = "/* $debugMsg */ SELECT COUNT(testprojects.id) AS qty ". - " FROM {$this->object_table} testprojects"; - - $rs = $this->db->get_recordset($sql); - return $rs[0]['qty']; - } - - // - $sql = "/* $debugMsg */ SELECT testprojects.*, nodes_hierarchy.name ". - " FROM {$this->object_table} testprojects, " . - " {$this->tables['nodes_hierarchy']} nodes_hierarchy ". - " WHERE testprojects.id = nodes_hierarchy.id "; - - if (!is_null($my['filters']['active']) ) - { - $sql .= " AND active=" . intval($my['filters']['active']) . " "; - } - - if( !is_null($my['options']['order_by']) ) - { - $sql .= $my['options']['order_by']; - } - - if( is_null($my['options']['access_key'])) { - $recordset = $this->db->get_recordset($sql); - $this->parseTestProjectRecordset($recordset); - } else { - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['access_key']); - if (null != $recordset && count($recordset) > 0) { - foreach ($recordset as $number => $row) { - $recordset[$number]['opt'] = unserialize($row['options']); - } - } - } - - return $recordset; -} - - -/* -function: get_accessible_for_user - get list of testprojects, considering user roles. - Remember that user has: - 1. one default role, assigned when user was created - 2. a different role can be assigned for every testproject. - - For users roles that has not rigth to modify testprojects - only active testprojects are returned. - -args: - user_id - [output_type]: choose the output data structure. - possible values: map, map_of_map - map: key -> test project id - value -> test project name - - map_of_map: key -> test project id - value -> array ('name' => test project name, - 'active' => active status) - - array_of_map: value -> array with all testproject table fields plus name. - - - default: map - [order_by]: default: ORDER BY name - -*/ -function get_accessible_for_user($user_id,$opt = null,$filters = null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my = array(); - $my['opt'] = array('output' => 'map', 'order_by' => ' ORDER BY name ', 'field_set' => 'full', - 'format' => 'std', 'add_issuetracker' => false, 'add_codetracker' => false, - 'add_reqmgrsystem' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - // key = field name - // value = array('op' => Domain ('=','like'), 'value' => the value) - $my['filters'] = array('name' => null, 'id' => null, 'prefix' => null); - $my['filters'] = array_merge($my['filters'],(array)$filters); - - - $items = array(); - $safe_user_id = intval($user_id); - - // Get default/global role - $sql = "/* $debugMsg */ SELECT id,role_id FROM {$this->tables['users']} where id=" . $safe_user_id; - $user_info = $this->db->get_recordset($sql); - $globalRoleID = intval($user_info[0]['role_id']); - - $itsql = ''; - $itf = ''; - if($my['opt']['add_issuetracker']) { - $itsql = " LEFT OUTER JOIN {$this->tables['testproject_issuetracker']} AS TIT " . - " ON TIT.testproject_id = TPROJ.id " . - " LEFT OUTER JOIN {$this->tables['issuetrackers']} AS ITMD " . - " ON ITMD.id = TIT.issuetracker_id "; - $itf = ",ITMD.name AS itname,ITMD.type AS ittype"; - } - - $ctsql = ''; - $ctf = ''; - if($my['opt']['add_codetracker']) { - $ctsql = " LEFT OUTER JOIN {$this->tables['testproject_codetracker']} AS TCT " . - " ON TCT.testproject_id = TPROJ.id " . - " LEFT OUTER JOIN {$this->tables['codetrackers']} AS CTMD " . - " ON CTMD.id = TCT.codetracker_id "; - $ctf = ",CTMD.name AS ctname,CTMD.type AS cttype"; - } - - - $rmssql = ''; - $rmsf = ''; - if($my['opt']['add_reqmgrsystem']) { - $rmssql = " LEFT OUTER JOIN {$this->tables['testproject_reqmgrsystem']} AS TRMS " . - " ON TRMS.testproject_id = TPROJ.id " . - " LEFT OUTER JOIN {$this->tables['reqmgrsystems']} AS RMSMD " . - " ON RMSMD.id = TRMS.reqmgrsystem_id "; - $rmsf = ",RMSMD.name AS rmsname,RMSMD.type AS rmstype"; - } - - switch($my['opt']['field_set']) { - case 'id': - $cols = ' TPROJ.id,NHTPROJ.name '; - $my['opt']['format'] = 'do not parse'; - break; - - case 'prefix': - $cols = ' TPROJ.id,TPROJ.prefix,TPROJ.active,NHTPROJ.name '; - $my['opt']['format'] = 'do not parse'; - break; - - case 'full': - default: - $cols = ' TPROJ.*,NHTPROJ.name,COALESCE(UTR.role_id,U.role_id) AS effective_role '; - break; - } - - $sql = " /* $debugMsg */ SELECT {$cols} {$itf} {$ctf} {$rmsf} " . - " FROM {$this->tables['nodes_hierarchy']} NHTPROJ " . - " JOIN {$this->object_table} TPROJ ON NHTPROJ.id=TPROJ.id " . - " JOIN {$this->tables['users']} U ON U.id = {$safe_user_id} " . - " LEFT OUTER JOIN {$this->tables['user_testproject_roles']} UTR " . - " ON TPROJ.id = UTR.testproject_id " . - " AND UTR.user_id =" . $safe_user_id . $itsql . $ctsql . $rmssql . - " WHERE 1=1 "; - - // Private test project feature - if( $globalRoleID != TL_ROLES_ADMIN ) { - if ($globalRoleID != TL_ROLES_NO_RIGHTS) { - $sql .= " AND "; - $sql_public = " ( TPROJ.is_public = 1 AND (UTR.role_id IS NULL OR UTR.role_id != " . TL_ROLES_NO_RIGHTS. ") )"; - $sql_private = " ( TPROJ.is_public = 0 AND UTR.role_id != " . TL_ROLES_NO_RIGHTS. ") "; - $sql .= " ( {$sql_public} OR {$sql_private} ) "; - } else { - // User needs specific role - $sql .= " AND (UTR.role_id IS NOT NULL AND UTR.role_id != ".TL_ROLES_NO_RIGHTS.")"; - } - } - - $userObj = tlUser::getByID($this->db,$safe_user_id,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); - if ($userObj->hasRight($this->db,'mgt_modify_product') != 'yes') { - $sql .= " AND TPROJ.active=1 "; - } - unset($userObj); - - foreach($my['filters'] as $fname => $fspec) { - if(!is_null($fspec)) { - switch($fname) { - case 'prefix': - $sql .= " AND TPROJ.$fname"; - $sm = 'prepare_string'; - break; - - case 'name': - $sql .= " AND NHTPROJ.$fname"; - $sm = 'prepare_string'; - break; - - case 'id': - $sql .= " AND NHTPROJ.$fname"; - $sm = 'prepare_int'; - break; - } - - $safe = $this->db->$sm($fspec['value']); - switch($fspec['op']) { - case '=': - if($sm == 'prepare_string') { - $sql .= "='" . $safe . "'"; - } else { - $sql .= "=" . $safe; - } - break; - - case 'like': - $sql .= " LIKE '%" . $safe ."%'"; - break; - } - } - } - - - $sql .= str_replace('nodes_hierarchy','NHTPROJ',$my['opt']['order_by']); - $parseOpt = false; - $do_post_process = 0; - $arrTemp = array(); - switch($my['opt']['output']) { - case 'array_of_map': - $items = $this->db->get_recordset($sql); //,null,3,1); - $parseOpt = true; - break; - - case 'map_of_map_full': - $items = $this->db->fetchRowsIntoMap($sql,'id'); - $parseOpt = true; - break; - - case 'map': - $items = $this->db->fetchRowsIntoMap($sql,'id'); - break; - - case 'map_with_inactive_mark': - default: - $arrTemp = (array)$this->db->fetchRowsIntoMap($sql,'id'); - $do_post_process = (count($arrTemp) > 0); - break; - } - - if($my['opt']['format'] == 'std' && $parseOpt) { - $this->parseTestProjectRecordset($items); - } - - if ($do_post_process) { - switch ($my['opt']['output']) { - case 'map_name_with_inactive_mark': - foreach($arrTemp as $id => $row) { - $noteActive = ''; - if (!$row['active']) { - $noteActive = TL_INACTIVE_MARKUP; - } - $items[$id] = $noteActive . - ( ($my['opt']['field_set'] =='prefix') ? ($row['prefix'] . ':') : '' ) . $row['name']; - } - break; - - case 'map_of_map': - foreach($arrTemp as $id => $row) { - $items[$id] = array('name' => $row['name'],'active' => $row['active']); - } - break; - } - unset($arrTemp); - } - - return $items; -} - - -/* - function: get_subtree - Get subtree that has choosen testproject as root. - Only nodes of type: - testsuite and testcase are explored and retrieved. - - args: id: testsuite id - [recursive_mode]: default false - [exclude_testcases]: default: false - [exclude_branches] - [additionalWhereClause]: - - - returns: map - see tree->get_subtree() for details. - - -*/ -function get_subtree($id,$filters=null,$opt=null) -{ - $my = array(); - $my['options'] = array('recursive' => false, 'exclude_testcases' => false, 'output' => 'full'); - $my['filters'] = array('exclude_node_types' => $this->nt2exclude, - 'exclude_children_of' => $this->nt2exclude_children, - 'exclude_branches' => null, - 'additionalWhereClause' => ''); - - $my['options'] = array_merge($my['options'],(array)$opt); - $my['filters'] = array_merge($my['filters'],(array)$filters); - - if($my['options']['exclude_testcases']) - { - $my['filters']['exclude_node_types']['testcase']='exclude me'; - } - - $subtree = $this->tree_manager->get_subtree(intval($id),$my['filters'],$my['options']); - return $subtree; -} - - -/** - * Displays smarty template to show test project info to users. - * - * @param type $smarty [ref] smarty object - * @param type $id test project - * @param type $sqlResult [default = ''] - * @param type $action [default = 'update'] - * @param type $modded_item_id [default = 0] - * - * @internal revisions - * - **/ -function show(&$smarty,$guiObj,$template_dir,$id,$sqlResult='', $action = 'update',$modded_item_id = 0) -{ - $gui = $guiObj; - - if (!property_exists($gui, 'uploadOp')) { - $gui->uploadOp = null; - } - - $gui->sqlResult = ''; - $gui->sqlAction = ''; - if ($sqlResult) { - $gui->sqlResult = $sqlResult; - } - - $p2ow = array('refreshTree' => false, 'user_feedback' => ''); - foreach ($p2ow as $prop => $value) { - if (!property_exists($gui,$prop)) { - $gui->$prop = $value; - } - } - - $safeID = intval($id); - $gui->tproject_id = $safeID; - $gui->modify_tc_rights = has_rights($this->db,"mgt_modify_tc",$safeID); - $gui->mgt_modify_product = has_rights($this->db,"mgt_modify_product"); - - - - $gui->container_data = $this->get_by_id($safeID); - $gui->moddedItem = $gui->container_data; - $gui->level = 'testproject'; - $gui->page_title = lang_get('testproject'); - $gui->refreshTree = property_exists($gui,'refreshTree') ? $gui->refreshTree : false; - $gui->attachmentInfos = getAttachmentInfosFrom($this,$safeID); - - // attachments management on page - $gui->fileUploadURL = $_SESSION['basehref'] . $this->getFileUploadRelativeURL($safeID); - $gui->delAttachmentURL = $_SESSION['basehref'] . $this->getDeleteAttachmentRelativeURL($safeID); - $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; - $gui->fileUploadMsg = ''; - - $exclusion = array( 'testcase', 'me', 'testplan' => 'me', 'requirement_spec' => 'me'); - $gui->canDoExport = count((array)$this->tree_manager->get_children($safeID,$exclusion)) > 0; - if ($modded_item_id) { - $gui->moddedItem = $this->get_by_id(intval($modded_item_id)); - } - $cfg = getWebEditorCfg('testproject'); - $gui->testProjectEditorType = $cfg['type']; - - $smarty->assign('gui', $gui); - $smarty->display($template_dir . 'containerView.tpl'); -} - - -/** - * Count testcases without considering active/inactive status. - * - * @param integer $id: test project identifier - * @return integer count of test cases presents on test project. - */ -function count_testcases($id) -{ - $tcIDs = array(); - $this->get_all_testcases_id($id,$tcIDs); - $qty = sizeof($tcIDs); - return $qty; -} - - - /* - function: gen_combo_test_suites - create array with test suite names - test suites are ordered in parent-child way, means - order on array is creating traversing tree branches, reaching end - of branch, and starting again. (recursive algorithim). - - - args : $id: test project id - [$exclude_branches]: array with testsuite id to exclude - useful to exclude myself ($id) - [$mode]: dotted -> $level number of dot characters are appended to - the left of test suite name to create an indent effect. - Level indicates on what tree layer testsuite is positioned. - Example: - - null - \ - id=1 <--- Tree Root = Level 0 - | - + ------+ - / \ \ - id=9 id=2 id=8 <----- Level 1 - \ - id=3 <----- Level 2 - \ - id=4 <----- Level 3 - - - key: testsuite id (= node id on tree). - value: every array element is an string, containing testsuite name. - - Result example: - - 2 .TS1 - 3 ..TS2 - 9 .20071014-16:22:07 TS1 - 10 ..TS2 - - - array -> key: testsuite id (= node id on tree). - value: every array element is a map with the following keys - 'name', 'level' - - 2 array(name => 'TS1',level => 1) - 3 array(name => 'TS2',level => 2) - 9 array(name => '20071014-16:22:07 TS1',level =>1) - 10 array(name => 'TS2', level => 2) - - - returns: map , structure depens on $mode argument. - - */ - function gen_combo_test_suites($id,$exclude_branches=null,$mode='dotted') - { - $ret = array(); - $test_spec = $this->get_subtree($id, array('exclude_branches' => $exclude_branches), - array('recursive' => !self::RECURSIVE_MODE, - 'exclude_testcases' => self::EXCLUDE_TESTCASES)); - - if(count($test_spec)) - { - $ret = $this->_createHierarchyMap($test_spec,$mode); - } - return $ret; - } - - /** - * Checks a test project name for correctness - * - * @param string $name the name to check - * @return map with keys: status_ok, msg - **/ - function checkName($name) - { - $forbidden_pattern = config_get('ereg_forbidden'); - $ret['status_ok'] = 1; - $ret['msg'] = 'ok'; - - if ($name == "") - { - $ret['msg'] = lang_get('info_product_name_empty'); - $ret['status_ok'] = 0; - } - if ($ret['status_ok'] && !check_string($name,$forbidden_pattern)) - { - $ret['msg'] = lang_get('string_contains_bad_chars'); - $ret['status_ok'] = 0; - } - return $ret; - } - - /** - * Checks a test project name for sintax correctness - * - * @param string $name the name to check - * @return map with keys: status_ok, msg - **/ - function checkNameSintax($name) - { - $forbidden_pattern = config_get('ereg_forbidden'); - $ret['status_ok'] = 1; - $ret['msg'] = 'ok'; - - if ($name == "") - { - $ret['msg'] = lang_get('info_product_name_empty'); - $ret['status_ok'] = 0; - } - if ($ret['status_ok'] && !check_string($name,$forbidden_pattern)) - { - $ret['msg'] = lang_get('string_contains_bad_chars'); - $ret['status_ok'] = 0; - } - return $ret; - } - - /** - * Checks is there is another testproject with different id but same name - * - **/ - function checkNameExistence($name,$id=0) - { - $check_op['msg'] = ''; - $check_op['status_ok'] = 1; - - if($this->get_by_name($name,"testprojects.id <> {$id}") ) - { - $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'),$name); - $check_op['status_ok'] = 0; - } - return $check_op; - } - - /** - * Checks is there is another testproject with different id but same prefix - * - **/ - function checkTestCasePrefixExistence($prefix,$id=0) - { - $check_op = array('msg' => '', 'status_ok' => 1); - $sql = " SELECT id FROM {$this->object_table} " . - " WHERE prefix='" . $this->db->prepare_string($prefix) . "'"; - " AND id <> {$id}"; - - $rs = $this->db->get_recordset($sql); - if(!is_null($rs)) - { - $check_op['msg'] = sprintf(lang_get('error_tcase_prefix_exists'),$prefix); - $check_op['status_ok'] = 0; - } - - return $check_op; - } - - - - /** - * allow activate or deactivate a test project - * - * @param integer $id test project ID - * @param integer $status 1=active || 0=inactive - */ - function activate($id, $status) - { - $sql = "UPDATE {$this->tables['testprojects']} SET active=" . $status . " WHERE id=" . $id; - $result = $this->db->exec_query($sql); - - return $result ? 1 : 0; - } - - /** @TODO add description */ - function formatTcPrefix($str) - { - $fstr = trim($str); - if(tlStringLen($fstr) == 0) - { - throw new Exception('Empty prefix is not allowed'); - } - - // limit tcasePrefix len. - if(tlStringLen($fstr) > self::TESTCASE_PREFIX_MAXLEN) - { - $fstr = substr($fstr, 0, self::TESTCASE_PREFIX_MAXLEN); - } - return $fstr; - } - - - /* - args : id: test project - returns: null if query fails - string - */ - function getTestCasePrefix($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret=null; - $sql = "/* $debugMsg */ SELECT prefix FROM {$this->object_table} WHERE id = {$id}"; - $ret = $this->db->fetchOneValue($sql); - return ($ret); - } - - - /* - args: id: test project - returns: null if query fails - a new test case number - */ - function generateTestCaseNumber($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $retry = 3; - $lockfile = $this->tmp_dir . __FUNCTION__ . '.lock'; - $lock = fopen($lockfile, 'a'); - - $gotLock = false; - while( $retry > 0 && !$gotLock ) - { - if( flock($lock,LOCK_EX) ) - { - $gotLock = true; - } - else - { - $retry--; - usleep(20); - } - } - - if( $gotLock || $retry == 0 ) - { - $safeID = intval($id); - - $ret=null; - $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . - " SET tc_counter=tc_counter+1 WHERE id = {$safeID}"; - $rs = $this->db->exec_query($sql); - - $sql = " SELECT tc_counter FROM {$this->object_table} WHERE id = {$safeID}"; - $rs = $this->db->get_recordset($sql); - $ret = $rs[0]['tc_counter']; - - if( $gotLock ) - { - flock($lock, LOCK_UN); - } - fclose($lock); - - return $ret; - } - - } - - /** - * - * - */ - function setTestCaseCounter($id,$value,$force=false) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safeValue = intval($value); - $ret=null; - $sql = " /* $debugMsg */ UPDATE {$this->object_table} " . - ' SET tc_counter=' . $safeValue . - ' WHERE id =' . intval($id); - - if(!$force) - { - $sql .= ' AND tc_counter < ' . $safeValue; - } - $rs = $this->db->exec_query($sql); - } - - - -/** - * @param integer $id test project ID - */ -function setPublicStatus($id,$status) -{ - $isPublic = val($status) > 0 ? 1 : 0; - $sql = "UPDATE {$this->object_table} SET is_public={$isPublic} WHERE id={$id}"; - $result = $this->db->exec_query($sql); - return $result ? 1 : 0; -} - - - - /* Keywords related methods */ - /** - * Adds a new keyword to the given test project - * - * @param int $testprojectID - * @param string $keyword - * @param string $notes - * - **/ - public function addKeyword($testprojectID,$keyword,$notes) { - $kw = new tlKeyword(); - $kw->initialize(null,$testprojectID,$keyword,$notes); - $op = array('status' => tlKeyword::E_DBERROR, 'id' => -1, - 'msg' => 'ko DB Error'); - - $op['status'] = $kw->writeToDB($this->db); - $op['id'] = $kw->dbID; - - if ($op['status'] >= tl::OK) { - logAuditEvent(TLS("audit_keyword_created",$keyword),"CREATE",$op['id'],"keywords"); - } else { - $op['msg'] = tlKeyword::getError($op['status']); - } - - return $op; - } - - /** - * updates the keyword with the given id - * - * @param type $testprojectID - * @param type $id - * @param type $keyword - * @param type $notes - * - **/ - function updateKeyword($testprojectID,$id,$keyword,$notes) { - $kw = new tlKeyword($id); - $kw->initialize($id,$testprojectID,$keyword,$notes); - $result = $kw->writeToDB($this->db); - if ($result >= tl::OK) { - logAuditEvent(TLS("audit_keyword_saved",$keyword),"SAVE",$kw->dbID,"keywords"); - } - return $result; - } - - /** - * gets the keyword with the given id - * - * @param type $kwid - **/ - public function getKeyword($id) { - return tlKeyword::getByID($this->db,$id); - } - - /** - * Gets the keywords of the given test project - * - * @param int $tprojectID the test project id - * @param int $keywordID [default = null] the optional keyword id - * - * @return array, every elemen is map with following structure: - * id - * keyword - * notes - **/ - public function getKeywords($testproject_id) { - $ids = $this->getKeywordIDsFor($testproject_id); - return tlKeyword::getByIDs($this->db,$ids); - } - - /** - * Deletes the keyword with the given id - * - * @param int $id the keywordID - * @return int returns 1 on success, 0 else - * - **/ - function deleteKeyword($id, $opt=null) { - $result = tl::ERROR; - $my['opt'] = array('checkBeforeDelete' => true, 'nameForAudit' => null, - 'context' => '', 'tproject_id' => null); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $doIt = !$my['opt']['checkBeforeDelete']; - $keyword = $my['opt']['nameForAudit']; - - if($my['opt']['checkBeforeDelete']) { - $doIt = true; - if( $this->cfg->keywords->onDeleteCheckExecutedTCVersions ) { - $linkedAndNotExec = $this->checkKeywordIsLinkedAndNotExecuted($id); - $doIt = $doIt && $linkedAndNotExec; - } - - if( $this->cfg->keywords->onDeleteCheckFrozenTCVersions ) { - $linkedToFrozen = $this->checkKeywordIsLinkedToFrozenVersions($id); - $doIt = $doIt && !$linkedToFrozen; - } - } - - if( $doIt ) { - if( $this->auditCfg->logEnabled ) { - $keyword = $this->getKeywordSimple($id); - } - $result = tlDBObject::deleteObjectFromDB($this->db,$id,"tlKeyword"); - } - - if ($result >= tl::OK && $this->auditCfg->logEnabled) { - - switch($my['opt']['context']) { - case 'getTestProjectName': - $dummy = $this->get_by_id($my['opt']['tproject_id'],array('output'=>'name')); - $my['opt']['context'] = $dummy['name']; - break; - } - - logAuditEvent(TLS("audit_keyword_deleted",$keyword,$my['opt']['context']), - "DELETE",$id,"keywords"); - } - return $result; - } - - /** - * delete Keywords - */ - function deleteKeywords($tproject_id,$tproject_name=null) { - $result = tl::OK; - - $itemSet = (array)$this->getKeywordSet($tproject_id); - $kwIDs = array_keys($itemSet); - - $opt = array('checkBeforeDelete' => false, - 'context' => $tproject_name); - - $loop2do = sizeof($kwIDs); - for($idx = 0;$idx < $loop2do; $idx++) { - $opt['nameForAudit'] = $itemSet[$kwIDs[$idx]]['keyword']; - - $resultKw = $this->deleteKeyword($kwIDs[$idx],$opt); - if ($resultKw != tl::OK) { - $result = $resultKw; - } - } - return $result; - } - - - /** - * - * - */ - protected function getKeywordIDsFor($testproject_id) { - $query = " SELECT id FROM {$this->tables['keywords']} " . - " WHERE testproject_id = {$testproject_id}" . - " ORDER BY keyword ASC"; - $keywordIDs = $this->db->fetchColumnsIntoArray($query,'id'); - return $keywordIDs; - } - - /** - * - * - */ - function getKeywordSet($tproject_id) { - $sql = " SELECT id,keyword FROM {$this->tables['keywords']} " . - " WHERE testproject_id = {$tproject_id}" . - " ORDER BY keyword ASC"; - - $items = $this->db->fetchRowsIntoMap($sql,'id'); - return $items; - } - - - /** - * - * - */ - function hasKeywords($id) { - // seems that postgres PHP driver do not manage well UPPERCASE in AS CLAUSE - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* {$debugMsg} */ SELECT COUNT(0) AS qty FROM {$this->tables['keywords']} " . - " WHERE testproject_id = " . intval($id); - $rs = $this->db->get_recordset($sql); - - return ((is_null($rs) || $rs[0]['qty'] == 0) ? false : true); - } - - - /** - * Exports the given keywords to a XML file - * - * @return strings the generated XML Code - **/ - public function exportKeywordsToXML($testproject_id,$bNoXMLHeader = false) - { - $kwIDs = $this->getKeywordIDsFor($testproject_id); - $xmlCode = ''; - if (!$bNoXMLHeader) - { - $xmlCode .= TL_XMLEXPORT_HEADER."\n"; - } - $xmlCode .= ""; - for($idx = 0;$idx < sizeof($kwIDs);$idx++) - { - $keyword = new tlKeyword($kwIDs[$idx]); - $keyword->readFromDb($this->db); - $keyword->writeToXML($xmlCode,true); - } - $xmlCode .= ""; - - return $xmlCode; - } - - /** - * Exports the given keywords to CSV - * - * @return string the generated CSV code - **/ - function exportKeywordsToCSV($testproject_id,$delim = ';') { - $kwIDs = $this->getKeywordIDsFor($testproject_id); - $csv = null; - for($idx = 0;$idx < sizeof($kwIDs);$idx++) { - $keyword = new tlKeyword($kwIDs[$idx]); - $keyword->readFromDb($this->db); - $keyword->writeToCSV($csv,$delim); - } - return $csv; - } - - function importKeywordsFromCSV($testproject_id,$fileName,$delim = ';') - { - $handle = fopen($fileName,"r"); - if ($handle) - { - while($data = fgetcsv($handle, TL_IMPORT_ROW_MAX, $delim)) - { - $kw = new tlKeyword(); - $kw->initialize(null,$testproject_id,NULL,NULL); - if ($kw->readFromCSV(implode($delim,$data)) >= tl::OK) - { - if ($kw->writeToDB($this->db) >= tl::OK) - { - logAuditEvent(TLS("audit_keyword_created",$kw->name),"CREATE",$kw->dbID,"keywords"); - } - } - } - fclose($handle); - return tl::OK; - } - else - { - return ERROR; - } - } - - /** - * @param $testproject_id - * @param $fileName - */ - function importKeywordsFromXMLFile($testproject_id,$fileName) - { - $simpleXMLObj = @$this->simplexml_load_file_helper($fileName); - return $this->importKeywordsFromSimpleXML($testproject_id,$simpleXMLObj); - } - - - /** - * @param $testproject_id - * @param $xmlString - */ - function importKeywordsFromXML($testproject_id,$xmlString) - { - $simpleXMLObj = simplexml_load_string($xmlString); - return $this->importKeywordsFromSimpleXML($testproject_id,$simpleXMLObj); - } - - /** - * @param $testproject_id - * @param $simpleXMLObj - */ - function importKeywordsFromSimpleXML($testproject_id,$simpleXMLObj) - { - $status = tl::OK; - if(!$simpleXMLObj || $simpleXMLObj->getName() != 'keywords') - { - $status = tlKeyword::E_WRONGFORMAT; - } - - if( ($status == tl::OK) && $simpleXMLObj->keyword ) - { - foreach($simpleXMLObj->keyword as $keyword) - { - $kw = new tlKeyword(); - $kw->initialize(null,$testproject_id,NULL,NULL); - $status = tlKeyword::E_WRONGFORMAT; - if ($kw->readFromSimpleXML($keyword) >= tl::OK) - { - $status = tl::OK; - if ($kw->writeToDB($this->db) >= tl::OK) - { - logAuditEvent(TLS("audit_keyword_created",$kw->name),"CREATE",$kw->dbID,"keywords"); - } - } - } - } - return $status; - } - - /** - * Returns all testproject keywords - * - * @param integer $testproject_id the ID of the testproject - * @return array map: key: keyword_id, value: keyword - */ - function get_keywords_map($testproject_id) { - $keywordMap = null; - $keywords = $this->getKeywords($testproject_id); - if ($keywords) { - foreach($keywords as $kw) { - $keywordMap[$kw->dbID] = $kw->name; - } - } - return $keywordMap; - } - - /** - * Returns keywords that are linked to test cases - * - * @param integer $id testproject - * @return array map: key: keyword_id, value: keyword - */ - function getUsedKeywordsMap($id) { - $debugMsg = $this->debugMsg . __FUNCTION__; - $sql = "/* $debugMsg */ - SELECT DISTINCT KW.id,KW.keyword - FROM {$this->tables['keywords']} KW - JOIN {$this->tables['testcase_keywords']} TCKW - ON TCKW.keyword_id = KW.id - WHERE KW.testproject_id =" . intval($id); - $sql .= " ORDER BY keyword"; - $rs = $this->db->fetchColumnsIntoMap($sql,'id','keyword'); - return $rs; - } - - - /* END KEYWORDS RELATED */ - - /* REQUIREMENTS RELATED */ - /** - * get list of all SRS for a test project, no distinction between levels - * - * - * @used-by lib/results/uncoveredTestCases.php - * lib/requirements/reqTcAssign.php - * lib/requirements/reqSpecSearchForm.php - * lib/requirements/reqSearchForm.php - * - * @author Martin Havlat - * @return associated array List of titles according to IDs - * - * @internal revisions - * - **/ - function getOptionReqSpec($tproject_id,$get_not_empty=self::GET_EMPTY_REQSPEC) - { - $additional_table=''; - $additional_join=''; - if( $get_not_empty ) - { - $additional_table=", {$this->tables['requirements']} REQ "; - $additional_join=" AND SRS.id = REQ.srs_id "; - } - $sql = " SELECT SRS.id,NH.name AS title " . - " FROM {$this->tables['req_specs']} SRS, " . - " {$this->tables['nodes_hierarchy']} NH " . - $additional_table . - " WHERE testproject_id={$tproject_id} " . - " AND SRS.id=NH.id " . - $additional_join . - " ORDER BY title"; - return $this->db->fetchColumnsIntoMap($sql,'id','title'); - //return $this->db->fetchRowsIntoMap($sql,'id'); SRS.doc_id, - } // function end - - - /** - * @author Francisco Mancardi - francisco.mancardi@gmail.com - * - * @TODO check who uses it, is duplicated of getOptionReqSpec? - * - * @used-by lib/results/uncoveredTestCases.php - * lib/requirements/reqTcAssign.php - * lib/requirements/reqSpecSearchForm.php - * lib/requirements/reqSearchForm.php - * - * @internal revisions - * - * - **/ - function genComboReqSpec($id,$mode='dotted',$dot='.') - { - $ret = array(); - $exclude_node_types=array('testplan' => 'exclude_me','testsuite' => 'exclude_me', - 'testcase'=> 'exclude_me','requirement' => 'exclude_me', - 'requirement_spec_revision' => 'exclude_me'); - - $my['filters'] = array('exclude_node_types' => $exclude_node_types); - - $my['options'] = array('order_cfg' => array('type' => 'rspec'), 'output' => 'rspec'); - $subtree = $this->tree_manager->get_subtree($id,$my['filters'],$my['options']); - if(count($subtree)) - { - $ret = $this->_createHierarchyMap($subtree,$mode,$dot,'doc_id'); - } - return $ret; - } - - /* - - [$mode]: dotted -> $level number of dot characters are appended to - the left of item name to create an indent effect. - Level indicates on what tree layer item is positioned. - Example: - - null - \ - id=1 <--- Tree Root = Level 0 - | - + ------+ - / \ \ - id=9 id=2 id=8 <----- Level 1 - \ - id=3 <----- Level 2 - \ - id=4 <----- Level 3 - - - key: item id (= node id on tree). - value: every array element is an string, containing item name. - - Result example: - - 2 .TS1 - 3 ..TS2 - 9 .20071014-16:22:07 TS1 - 10 ..TS2 - - - array -> key: item id (= node id on tree). - value: every array element is a map with the following keys - 'name', 'level' - - 2 array(name => 'TS1',level => 1) - 3 array(name => 'TS2',level => 2) - 9 array(name => '20071014-16:22:07 TS1',level =>1) - 10 array(name => 'TS2', level => 2) - - */ - protected function _createHierarchyMap($array2map,$mode='dotted',$dot='.',$addfield=null) - { - $hmap=array(); - $the_level = 1; - $level = array(); - $pivot = $array2map[0]; - - $addprefix = !is_null($addfield); - foreach($array2map as $elem) - { - $current = $elem; - - if ($pivot['id'] == $current['parent_id']) - { - $the_level++; - $level[$current['parent_id']]=$the_level; - } - else if ($pivot['parent_id'] != $current['parent_id']) - { - $the_level = $level[$current['parent_id']]; - } - - switch($mode) - { - case 'dotted': - $dm = $addprefix ? "[{$current[$addfield]}] - " : ''; - $pding = ($the_level == 1) ? 0 : $the_level+1; - $hmap[$current['id']] = str_repeat($dot,$pding) . $dm . $current['name']; - break; - - case 'array': - $hmap[$current['id']] = array('name' => $current['name'], 'level' =>$the_level); - break; - } - - // update pivot - $level[$current['parent_id']]= $the_level; - $pivot=$elem; - } - - return $hmap; - } - - - - /** - * collect information about current list of Requirements Specification - * - * @param integer $testproject_id - * @param string $id optional id of the requirement specification - * - * @return mixed - * null if no srs exits, or no srs exists for id - * array, where each element is a map with SRS data. - * - * map keys: - * id - * testproject_id - * title - * scope - * total_req - * type - * author_id - * creation_ts - * modifier_id - * modification_ts - * - * @author Martin Havlat - * @internal revisions - * - **/ - public function getReqSpec($testproject_id, $id = null, $fields=null,$access_key=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $fields2get = " RSPEC.id, RSPEC.testproject_id, RSPECREV.scope, RSPECREV.doc_id," . - " RSPECREV.total_req, RSPECREV.type, RSPECREV.author_id, RSPECREV.creation_ts, " . - " RSPECREV.modifier_id, RSPECREV.modification_ts, RSPECREV.name AS title, NH.parent_id"; - - $fields = is_null($fields) ? $fields2get : implode(',',$fields); - $sql = " /* $debugMsg */ " . - " SELECT {$fields} FROM {$this->tables['req_specs_revisions']} RSPECREV, " . - " {$this->tables['req_specs']} RSPEC, {$this->tables['nodes_hierarchy']} NH, " . - " {$this->tables['requirements']} REQ " . - " WHERE RSPECREV.parent_id=RSPEC.id " . - " AND NH.id=RSPEC.id AND REQ.srs_id = RSPEC.id " . - " AND RSPEC.testproject_id={$testproject_id} "; - - - if (!is_null($id)) - { - $sql .= " AND RSPEC.id=" . $id; - } - - $sql .= " GROUP BY RSPEC.id" ; - $sql .= " ORDER BY RSPEC.id,title"; - - $rs = is_null($access_key) ? $this->db->get_recordset($sql) - : $this->db->fetchRowsIntoMap($sql,$access_key); - return $rs; - } - - /** - * create a new System Requirements Specification - * - * @param string $title - * @param string $scope - * @param string $countReq - * @param numeric $testproject_id - * @param numeric $user_id - * @param string $type - * - * @author Martin Havlat - * - * rev: 20071106 - franciscom - changed return type - */ - function createReqSpec($testproject_id,$title, $scope, $countReq,$user_id,$type = 'n') - { - $ignore_case=1; - $result=array(); - - $result['status_ok'] = 0; - $result['msg'] = 'ko'; - $result['id'] = 0; - - $title=trim($title); - - $chk=$this->check_srs_title($testproject_id,$title,$ignore_case); - if ($chk['status_ok']) - { - $sql = "INSERT INTO {$this->tables['req_specs']} " . - " (testproject_id, title, scope, type, total_req, author_id, creation_ts) - VALUES (" . $testproject_id . ",'" . $this->db->prepare_string($title) . "','" . - $this->db->prepare_string($scope) . "','" . $this->db->prepare_string($type) . "','" . - $this->db->prepare_string($countReq) . "'," . $this->db->prepare_string($user_id) . ", " . - $this->db->db_now() . ")"; - - if (!$this->db->exec_query($sql)) - { - $result['msg']=lang_get('error_creating_req_spec'); - } - else - { - $result['id']=$this->db->insert_id($this->tables['req_specs']); - $result['status_ok'] = 1; - $result['msg'] = 'ok'; - } - } - else - { - $result['msg']=$chk['msg']; - } - return $result; - } - - - - /* - function: get_srs_by_title - get srs information using title as access key. - - args : tesproject_id - title: srs title - [ignore_case]: control case sensitive search. - default 0 -> case sensivite search - - returns: map. - key: srs id - value: srs info, map with folowing keys: - id - testproject_id - title - scope - total_req - type - author_id - creation_ts - modifier_id - modification_ts - */ - public function get_srs_by_title($testproject_id,$title,$ignore_case=0) - { - $output=null; - $title=trim($title); - - $sql = "SELECT * FROM req_specs "; - - if($ignore_case) - { - $sql .= " WHERE UPPER(title)='" . strtoupper($this->db->prepare_string($title)) . "'"; - } - else - { - $sql .= " WHERE title='" . $this->db->prepare_string($title) . "'"; - } - $sql .= " AND testproject_id={$testproject_id}"; - $output = $this->db->fetchRowsIntoMap($sql,'id'); - - return $output; - } - - - - /* - function: check_srs_title - Do checks on srs title, to understand if can be used. - - Checks: - 1. title is empty ? - 2. does already exist a srs with this title? - - args : tesproject_id - title: srs title - [ignore_case]: control case sensitive search. - default 0 -> case sensivite search - - returns: - - */ - function check_srs_title($testproject_id,$title,$ignore_case=0) - { - $ret['status_ok'] = 1; - $ret['msg'] = ''; - - $title = trim($title); - - if ($title == "") - { - $ret['status_ok'] = 0; - $ret['msg'] = lang_get("warning_empty_req_title"); - } - - if($ret['status_ok']) - { - $ret['msg'] = 'ok'; - $rs = $this->get_srs_by_title($testproject_id,$title,$ignore_case); - - if(!is_null($rs)) - { - $ret['msg'] = lang_get("warning_duplicate_req_title"); - $ret['status_ok'] = 0; - } - } - return $ret; - } -/* END REQUIREMENT RELATED */ -// ---------------------------------------------------------------------------------------- - - - /** - * Deletes all testproject related role assignments for a given testproject - * - * @param integer $tproject_id - * @return integer tl::OK on success, tl::ERROR else - **/ - function deleteUserRoles($tproject_id,$users=null,$opt=null) - { - $my['opt'] = array('auditlog' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - $query = " DELETE FROM {$this->tables['user_testproject_roles']} " . - " WHERE testproject_id = " . intval($tproject_id) ; - - if(!is_null($users)) - { - $query .= " AND user_id IN(" . implode(',',$users) . ")"; - } - - if ($this->db->exec_query($query) && $my['opt']['auditlog']) - { - $testProject = $this->get_by_id($tproject_id); - - if ($testProject) - { - if(is_null($users)) - { - logAuditEvent(TLS("audit_all_user_roles_removed_testproject",$testProject['name']), - "ASSIGN",$tproject_id,"testprojects"); - } - else - { - // TBD - } - } - return tl::OK; - } - - return tl::ERROR; - } - - /** - * Gets all testproject related role assignments - * - * @param integer $tproject_id - * @return array assoc array with keys take from the user_id column - **/ - function getUserRoleIDs($tproject_id) - { - $query = "SELECT user_id,role_id FROM {$this->tables['user_testproject_roles']} " . - "WHERE testproject_id = {$tproject_id}"; - $roles = $this->db->fetchRowsIntoMap($query,'user_id'); - - return $roles; - } - - /** - * Inserts a testproject related role for a given user - * - * @param integer $userID the id of the user - * @param integer $tproject_id - * @param integer $roleID the role id - * - * @return integer tl::OK on success, tl::ERROR else - **/ - function addUserRole($userID,$tproject_id,$roleID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $query = "/* debugMsg*/ INSERT INTO {$this->tables['user_testproject_roles']} " . - " (user_id,testproject_id,role_id) VALUES ({$userID},{$tproject_id},{$roleID})"; - if($this->db->exec_query($query)) - { - $testProject = $this->get_by_id($tproject_id); - $role = tlRole::getByID($this->db,$roleID,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - $user = tlUser::getByID($this->db,$userID,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); - if ($user && $testProject && $role) - { - logAuditEvent(TLS("audit_users_roles_added_testproject",$user->getDisplayName(), - $testProject['name'],$role->name),"ASSIGN",$tproject_id,"testprojects"); - } - unset($user); - unset($role); - unset($testProject); - return tl::OK; - } - return tl::ERROR; - } - - /** - * delete test project from system, deleting all dependent data: - * keywords, requirements, custom fields, testsuites, testplans, - * testcases, results, testproject related roles, - * - * @param integer $id test project id - * @return integer status - * - */ - function delete($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $ret['msg']='ok'; - $ret['status_ok']=1; - - $error = ''; - $reqspec_mgr = new requirement_spec_mgr($this->db); - - // get some info for audit - $info['name'] = ''; - if($this->auditCfg->logEnabled) - { - $info = $this->tree_manager->get_node_hierarchy_info($id); - $event = new stdClass(); - $event->message = TLS("audit_testproject_deleted",$info['name']); - $event->objectID = $id; - $event->objectType = 'testprojects'; - $event->source = $this->auditCfg->eventSource; - $event->logLevel = 'AUDIT'; - $event->code = 'DELETE'; - } - - // - // Notes on delete related to Foreing Keys - // All link tables has to be deleted first - // - // req_relations - // - // testplan_tcversions - // testplan_platforms - // object_keywords - // user_assignments - // builds - // milestones - // - // testplans - // keywords - // platforms - // attachtments - // testcases - // testsuites - // inventory - // - // testproject - $this->deleteKeywords($id,$info['name']); - $this->deleteAttachments($id); - - $reqSpecSet=$reqspec_mgr->get_all_id_in_testproject($id); - if( !is_null($reqSpecSet) && count($reqSpecSet) > 0 ) { - foreach($reqSpecSet as $reqSpec) { - $reqspec_mgr->delete_deep($reqSpec['id']); - } - } - - $tplanSet = $this->get_all_testplans($id); - if( !is_null($tplanSet) && count($tplanSet) > 0 ) { - $tplan_mgr = new testplan($this->db); - $items=array_keys($tplanSet); - foreach($items as $key) { - $tplan_mgr->delete($key); - } - } - - $platform_mgr = new tlPlatform($this->db,$id); - $platform_mgr->deleteByTestProject($id); - - $a_sql[] = array("/* $debugMsg */ UPDATE {$this->tables['users']} " . - " SET default_testproject_id = NULL " . - " WHERE default_testproject_id = {$id}", - 'info_resetting_default_project_fails'); - - - $inventory_mgr = new tlInventory($id,$this->db); - $invOpt = array('detailLevel' => 'minimun', 'accessKey' => 'id'); - $inventorySet = $inventory_mgr->getAll($invOpt); - if( !is_null($inventorySet) ) { - foreach($inventorySet as $key => $dummy) { - $inventory_mgr->deleteInventory($key); - } - } - - foreach ($a_sql as $oneSQL) - { - if (empty($error)) - { - $sql = $oneSQL[0]; - $result = $this->db->exec_query($sql); - if (!$result) - { - $error .= lang_get($oneSQL[1]); - } - } - } - - - if ($this->deleteUserRoles($id) < tl::OK) - { - $error .= lang_get('info_deleting_project_roles_fails'); - } - - $xSQL = array('testproject_issuetracker','testproject_codetracker', - 'testproject_reqmgrsystem'); - foreach($xSQL as $target) - { - $sql = "/* $debugMsg */ DELETE FROM " . $this->tables[$target] . - " WHERE testproject_id = " . intval($id); - $result = $this->db->exec_query($sql); - } - - // --------------------------------------------------------------------------------------- - // delete product itself and items directly related to it like: - // custom fields assignments - // custom fields values ( right now we are not using custom fields on test projects) - // attachments - if (empty($error)) - { - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testprojects']} WHERE testproject_id = {$id} "; - $this->db->exec_query($sql); - - $sql = "/* $debugMsg */ DELETE FROM {$this->object_table} WHERE id = {$id}"; - - $result = $this->db->exec_query($sql); - if ($result) - { - $tproject_id_on_session = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : $id; - if ($id == $tproject_id_on_session) - { - $this->setSessionProject(null); - } - } - else - { - $error .= lang_get('info_product_delete_fails'); - } - } - - if (empty($error)) - { - // Delete test project with requirements defined crashed with memory exhausted - $this->tree_manager->delete_subtree_objects($id,$id,'',array('testcase' => 'exclude_tcversion_nodes')); - $sql = "/* $debugMsg */ " . - " DELETE FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id = {$id} AND node_type_id=" . - $this->tree_manager->node_descr_id['testproject']; - - $this->db->exec_query($sql); - - if($this->auditCfg->logEnabled) - { - logEvent($event); - } - } - - if( !empty($error) ) - { - $ret['msg']=$error; - $ret['status_ok']=0; - } - - return $ret; - } - - -/* - function: get_all_testcases_id - All testproject testcases node id. - - args :idList: comma-separated list of IDs (should be the projectID, but could - also be an arbitrary suiteID - - returns: array with testcases node id in parameter tcIDs. - null is nothing found - -*/ - function get_all_testcases_id($idList,&$tcIDs,$options = null) - { - static $tcNodeTypeID; - static $tsuiteNodeTypeID; - static $debugMsg; - if (!$tcNodeTypeID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $tcNodeTypeID = $this->tree_manager->node_descr_id['testcase']; - $tsuiteNodeTypeID = $this->tree_manager->node_descr_id['testsuite']; - } - - $my = array(); - $my['options'] = array('output' => 'just_id'); - $my['options'] = array_merge($my['options'], (array)$options); - - switch($my['options']['output']) - { - case 'external_id': - $use_array = true; - break; - - case 'just_id': - default: - $use_array = false; - break; - } - - $sql = "/* $debugMsg */ SELECT id,node_type_id from {$this->tables['nodes_hierarchy']} " . - " WHERE parent_id IN ({$idList})"; - $sql .= " AND node_type_id IN ({$tcNodeTypeID},{$tsuiteNodeTypeID}) "; - - $result = $this->db->exec_query($sql); - if ($result) - { - $suiteIDs = array(); - while($row = $this->db->fetch_array($result)) - { - if ($row['node_type_id'] == $tcNodeTypeID) - { - if( $use_array ) - { - $sql = " SELECT DISTINCT NH.parent_id, TCV.tc_external_id " . - " FROM {$this->tables['nodes_hierarchy']} NH " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH.id " . - " WHERE NH.parent_id = {$row['id']} "; - - $rs = $this->db->fetchRowsIntoMap($sql,'parent_id'); - $tcIDs[$row['id']] = $rs[$row['id']]['tc_external_id']; - } - else - { - $tcIDs[] = $row['id']; - } - } - else - { - $suiteIDs[] = $row['id']; - } - } - if (sizeof($suiteIDs)) - { - $suiteIDs = implode(",",$suiteIDs); - $this->get_all_testcases_id($suiteIDs,$tcIDs,$options); - } - } - } - - -/* - function: DEPRECATED_get_keywords_tcases - testproject keywords (with related testcase node id), - that are used on testcases. - - args :testproject_id - [keyword_id]= 0 -> no filter - <> 0 -> look only for this keyword - can be an array. - - - - returns: map: key: testcase_id - value: map - key: keyword_id - value: testcase_id,keyword_id,keyword - - Example: - [24] => Array ( [3] => Array( [testcase_id] => 24 - [keyword_id] => 3 - [keyword] => MaxFactor ) - - [2] => Array( [testcase_id] => 24 - [keyword_id] => 2 - [keyword] => Terminator ) ) - -@internal revisions: - 20100929 - asimon - BUGID 3814: fixed keyword filtering with "and" selected as type -*/ -function DEPRECATED_get_keywords_tcases($testproject_id, $keyword_id=0, $keyword_filter_type='Or') -{ - $keyword_filter= '' ; - $subquery=''; - - if( is_array($keyword_id) ) - { - $keyword_filter = " AND keyword_id IN (" . implode(',',$keyword_id) . ")"; - if($keyword_filter_type == 'And') { - $subquery = "AND testcase_id IN (" . - " SELECT FOXDOG.testcase_id FROM - ( SELECT COUNT(testcase_id) AS HITS,testcase_id - FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} - WHERE keyword_id = K.id - AND testproject_id = {$testproject_id} - {$keyword_filter} - GROUP BY testcase_id ) AS FOXDOG " . - " WHERE FOXDOG.HITS=" . count($keyword_id) . ")"; - - $keyword_filter =''; - } - } - else if( $keyword_id > 0 ) - { - $keyword_filter = " AND keyword_id = {$keyword_id} "; - } - - $map_keywords = null; - $sql = " SELECT testcase_id,keyword_id,keyword - FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} - WHERE keyword_id = K.id - AND testproject_id = {$testproject_id} - {$keyword_filter} {$subquery} - ORDER BY keyword ASC "; - - $map_keywords = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','keyword_id'); - - return($map_keywords); -} //end function - - -/** - * - */ -function getKeywordsLatestTCV($tproject_id, $keyword_id=0, $kwFilterType='Or') { - - $kwFilter= '' ; - $subquery=''; - $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = TK.tcversion_id "; - - if( is_array($keyword_id) ) { - $kwFilter = " AND keyword_id IN (" . implode(',',$keyword_id) . ")"; - if($kwFilterType == 'And') { - $ltcvJoin = " "; - $sqlCount = " /* SQL COUNT */ " . - " SELECT COUNT(TK.tcversion_id) AS HITS,TK.tcversion_id - FROM {$this->tables['keywords']} K - JOIN {$this->tables['testcase_keywords']} TK - ON keyword_id = K.id - - JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = TK.tcversion_id - - WHERE testproject_id = {$tproject_id} - {$kwFilter} - GROUP BY TK.tcversion_id "; - - $subquery = " AND tcversion_id IN (" . - " SELECT FOXDOG.tcversion_id FROM - ( $sqlCount ) AS FOXDOG " . - " WHERE FOXDOG.HITS=" . count($keyword_id) . ")"; - $kwFilter =''; - } - } - else if( $keyword_id > 0 ) { - $kwFilter = " AND keyword_id = {$keyword_id} "; - } - - $items = null; - $sql = " SELECT TK.testcase_id,TK.keyword_id,K.keyword - FROM {$this->tables['keywords']} K - JOIN {$this->tables['testcase_keywords']} TK - ON TK.keyword_id = K.id - {$ltcvJoin} - WHERE K.testproject_id = {$tproject_id} - {$kwFilter} {$subquery} - ORDER BY keyword ASC "; - - $items = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','keyword_id'); - - return $items; -} //end function - -/** - * - * 20200117 - * it seems I've duplicated code - * designed to be used by - * @used-by specview.php - */ -function XXXgetPlatformsLatestTCV($tproject_id, $platform_id=0, $filterType='Or') { - - $platFilter= '' ; - $subquery=''; - $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = TK.tcversion_id "; - - if( is_array($platform_id) ) { - $platFilter = " AND platform_id IN (" . implode(',',$platform_id) . ")"; - if($filterType == 'And') { - $ltcvJoin = " "; - $sqlCount = " /* SQL COUNT */ " . - " SELECT COUNT(TK.tcversion_id) AS HITS,TPL.tcversion_id - FROM {$this->tables['platforms']} K - JOIN {$this->tables['testcase_platforms']} TPL - ON platform_id = PL.id - - JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = TPL.tcversion_id - - WHERE testproject_id = {$tproject_id} - {$platFilter} - GROUP BY TPL.tcversion_id "; - - $subquery = " AND tcversion_id IN (" . - " SELECT FOXDOG.tcversion_id FROM - ( $sqlCount ) AS FOXDOG " . - " WHERE FOXDOG.HITS=" . count($platform_id) . ")"; - $platFilter =''; - } - } - else if( $platform_id > 0 ) { - $platFilter = " AND platform_id = {$platform_id} "; - } - - $items = null; - $sql = " SELECT TPL.testcase_id,TPL.keyword_id,PL.name - FROM {$this->tables['platforms']} K - JOIN {$this->tables['testcase_platforms']} TPL - ON TPL.platforms = PL.id - {$ltcvJoin} - WHERE PL.testproject_id = {$tproject_id} - {$platFilter} {$subquery} - ORDER BY name ASC "; - - $items = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','platform_id'); - - return $items; -} //end function - - - -/* - function: get_all_testplans - - args : $testproject_id - - [$filters]: optional map, with optional keys - [$get_tp_without_tproject_id] - used just for backward compatibility (TL 1.5) - default: 0 -> 1.6 and up behaviour - - [$plan_status] - default: null -> no filter on test plan status - 1 -> active test plans - 0 -> inactive test plans - - [$exclude_tplans]: null -> do not apply exclusion - id -> test plan id to exclude - - [options]: - - returns: - -*/ -function get_all_testplans($id,$filters=null,$options=null) { - - $my['options'] = array('fields2get' => - 'NH.id,NH.name,notes,active, - is_public,testproject_id,api_key', - 'outputType' => null); - $my['options'] = array_merge($my['options'], (array)$options); - - $forHMLSelect = false; - if( !is_null($my['options']['outputType']) && $my['options']['outputType'] == 'forHMLSelect') { - $forHMLSelect = true; - $my['options']['fields2get'] = 'NH.id,NH.name'; - } - - $sql = " SELECT {$my['options']['fields2get']} " . - " FROM {$this->tables['nodes_hierarchy']} NH,{$this->tables['testplans']} TPLAN"; - - $where = " WHERE NH.id=TPLAN.id AND (testproject_id = " . - $this->db->prepare_int($id) . " "; - if( !is_null($filters) ) { - $key2check=array('get_tp_without_tproject_id' => 0, 'plan_status' => null,'tplan2exclude' => null); - - foreach($key2check as $varname => $defValue) { - $$varname=isset($filters[$varname]) ? $filters[$varname] : $defValue; - } - - $where .= " ) "; - - if(!is_null($plan_status)) { - $my_active = to_boolean($plan_status); - $where .= " AND active = " . $my_active; - } - - if(!is_null($tplan2exclude)) { - $where .= " AND TPLAN.id != {$tplan2exclude} "; - } - } else { - $where .= ")"; - } - - $sql .= $where . " ORDER BY name"; - if( $forHMLSelect ) { - $map = $this->db->fetchColumnsIntoMap($sql,'id','name'); - } else { - $map = $this->db->fetchRowsIntoMap($sql,'id'); - } - - return $map; -} - - -/* - function: check_tplan_name_existence - - args : - tproject_id: - tplan_id: - [case_sensitive]: 1-> do case sensitive search - default: 0 - - returns: 1 -> tplan name exists - - -*/ -function check_tplan_name_existence($tproject_id,$tplan_name,$case_sensitive=0) -{ - $sql = " SELECT NH.id, NH.name, testproject_id " . - " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['testplans']} testplans " . - " WHERE NH.id=testplans.id " . - " AND testproject_id = {$tproject_id} "; - - if($case_sensitive) - { - $sql .= " AND NH.name="; - } - else - { - $tplan_name=strtoupper($tplan_name); - $sql .= " AND UPPER(NH.name)="; - } - $sql .= "'" . $this->db->prepare_string($tplan_name) . "'"; - $result = $this->db->exec_query($sql); - $status= $this->db->num_rows($result) ? 1 : 0; - - return $status; -} - - - /* - function: gen_combo_first_level_test_suites - create array with test suite names - - args : id: testproject_id - [mode] - - returns: - array, every element is a map - - rev : - 20070219 - franciscom - fixed bug when there are no children - -*/ -function get_first_level_test_suites($tproject_id,$mode='simple',$opt=null) -{ - $fl=$this->tree_manager->get_children($tproject_id, - array( 'testcase', 'exclude_me', - 'testplan' => 'exclude_me', - 'requirement_spec' => 'exclude_me' ),$opt); - switch ($mode) - { - case 'simple': - break; - - case 'smarty_html_options': - if( !is_null($fl) && count($fl) > 0) - { - foreach($fl as $idx => $map) - { - $dummy[$map['id']]=$map['name']; - } - $fl=null; - $fl=$dummy; - } - break; - } - return($fl); -} - - - -/** - * getTCasesLinkedToAnyTPlan - * - * for target test project id ($id) get test case id of - * every test case that has been assigned at least to one of all test plans - * belonging to test project. - * - * @param int $id test project id - * - */ -function getTCasesLinkedToAnyTPlan($id) -{ - $tplanNodeType = $this->tree_manager->node_descr_id['testplan']; - - // len of lines must be <= 100/110 as stated on development standard guide. - $sql = " SELECT DISTINCT NHTCV.parent_id AS testcase_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV " . - " ON NHTCV.id = TPTCV.tcversion_id "; - - // get testplan id for target test�project, to get test case versions linked to testplan. - $sql .= " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN " . - " ON TPTCV.testplan_id = NHTPLAN.id " . - " WHERE NHTPLAN.node_type_id = {$tplanNodeType} AND NHTPLAN.parent_id = " . intval($id); - $rs = $this->db->fetchRowsIntoMap($sql,'testcase_id'); - - return $rs; -} - - -/** - * getFreeTestCases - * - * - * @param int $id test project id - * @param $options for future uses. - */ -function getFreeTestCases($id,$options=null) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $retval['items']=null; - $retval['allfree']=false; - - $all=array(); - $this->get_all_testcases_id($id,$all); - $linked=array(); - $free=null; - if(!is_null($all)) - { - $all=array_flip($all); - $linked=$this->getTCasesLinkedToAnyTPlan($id); - $retval['allfree']=is_null($linked); - $free=$retval['allfree'] ? $all : array_diff_key($all,$linked); - } - - if( !is_null($free) && count($free) > 0) - { - $in_clause=implode(',',array_keys($free)); - $sql = " /* $debugMsg */ " . - " SELECT MAX(TCV.version) AS version, TCV.tc_external_id, " . - " TCV.importance AS importance, NHTCV.parent_id AS id, NHTC.name " . - " FROM {$this->tables['tcversions']} TCV " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TCV.id " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - " WHERE NHTCV.parent_id IN ({$in_clause}) " . - " GROUP BY NHTC.name,NHTCV.parent_id,TCV.tc_external_id,TCV.importance " . - " ORDER BY NHTCV.parent_id"; - $retval['items']=$this->db->fetchRowsIntoMap($sql,'id'); - } - - - return $retval; -} - - -// ------------------------------------------------------------------------------- -// Custom field related methods -// ------------------------------------------------------------------------------- -/* - function: get_linked_custom_fields - Get custom fields that has been linked to testproject. - Search can be narrowed by: - node type - node id - - Important: - custom fields id will be sorted based on the sequence number - that can be specified at User Interface (UI) level, while - linking is done. - - args : id: testproject id - [node_type]: default: null -> no filter - verbose string that identifies a node type. - (see tree class, method get_available_node_types). - Example: - You want linked custom fields , but can be used - only on testcase -> 'testcase'. - - returns: map. - key: custom field id - value: map (custom field definition) with following keys - - id (custom field id) - name - label - type - possible_values - default_value - valid_regexp - length_min - length_max - show_on_design - enable_on_design - show_on_execution - enable_on_execution - display_order - - -*/ -function get_linked_custom_fields($id,$node_type=null,$access_key='id') -{ - $additional_table=""; - $additional_join=""; - - if( !is_null($node_type) ) - { - $hash_descr_id = $this->tree_manager->get_available_node_types(); - $node_type_id=$hash_descr_id[$node_type]; - - $additional_table=",{$this->tables['cfield_node_types']} CFNT "; - $additional_join=" AND CFNT.field_id=CF.id AND CFNT.node_type_id={$node_type_id} "; - } - - $sql="SELECT CF.*,CFTP.display_order " . - " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_testprojects']} CFTP " . - $additional_table . - " WHERE CF.id=CFTP.field_id " . - " AND CFTP.testproject_id={$id} " . - $additional_join . - " ORDER BY CFTP.display_order"; - $map = $this->db->fetchRowsIntoMap($sql,$access_key); - return($map); -} - - - -/* -function: copy_as - creates a new test project using an existent one as source. - - -args: id: source testproject id - new_id: destination - [new_name]: default null. - != null => set this as the new name - - [copy_options]: default null - null: do a deep copy => copy following child elements: - test plans - builds - linked tcversions - milestones - user_roles - priorities, - platforms - execution assignment. - - != null, a map with keys that controls what child elements to copy - - -returns: N/A - - -*/ -function copy_as($id,$new_id,$user_id,$new_name=null,$options=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('copy_requirements' => 1, - 'copy_user_roles' => 1,'copy_platforms' => 1); - $my['options'] = array_merge($my['options'], (array)$options); - - // get source test project general info - $rs_source = $this->get_by_id($id); - - if(!is_null($new_name)) { - $sql="/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . - "SET name='" . $this->db->prepare_string(trim($new_name)) . "' " . - "WHERE id={$new_id}"; - $this->db->exec_query($sql); - } - - // Copy elements that can be used by other elements - // Custom Field assignments - $this->copy_cfields_assignments($id,$new_id); - - // Keywords - $oldNewMappings['keywords'] = $this->copy_keywords($id,$new_id); - - // Platforms - $oldNewMappings['platforms'] = $this->copy_platforms($id,$new_id); - - // Requirements - if( $my['options']['copy_requirements'] ) { - list($oldNewMappings['requirements'],$onReqSet) = - $this->copy_requirements($id,$new_id,$user_id); - - // need to copy relations between requirements - $rel = null; - foreach ($oldNewMappings['requirements'] as $erek) { - foreach ($erek['req'] as $okey => $nkey) { - $sql = "/* $debugMsg */ SELECT id, source_id, destination_id," . - " relation_type, author_id, creation_ts " . - " FROM {$this->tables['req_relations']} " . - " WHERE source_id=$okey OR destination_id=$okey "; - $rel[$okey] = $this->db->get_recordset($sql); - } - } - - if(!is_null($rel)) { - $totti = $this->db->db_now(); - foreach($rel as $okey => $ir) { - if(!is_null($ir)) { - foreach ($ir as $rval) { - if( isset($done[$rval['id']]) ) { - continue; - } - - $done[$rval['id']] = $rval['id']; - $sql = "/* $debugMsg */ - INSERT INTO {$this->tables['req_relations']} " . - " (source_id, destination_id, relation_type, author_id, creation_ts) " . - " values (" . - $onReqSet[$rval['source_id']] . "," . - $onReqSet[$rval['destination_id']] . "," . - $rval['relation_type'] . "," . $rval['author_id'] . "," . - "$totti)"; - $this->db->exec_query($sql); - } - } - } - } - } - - // need to get subtree and create a new one - $filters = array(); - $filters['exclude_node_types'] = array('testplan' => 'exclude_me','requirement_spec' => 'exclude_me'); - $filters['exclude_children_of'] = array('testcase' => 'exclude_me', 'requirement' => 'exclude_me', - 'testcase_step' => 'exclude_me'); - - $elements = $this->tree_manager->get_children($id,$filters['exclude_node_types']); - - // Copy Test Specification - $item_mgr['testsuites'] = new testsuite($this->db); - $copyTSuiteOpt = array(); - $copyTSuiteOpt['preserve_external_id'] = true; - $copyTSuiteOpt['copyKeywords'] = 1; - - // Attention: - // copyRequirements really means copy requirement to testcase assignments - $copyTSuiteOpt['copyRequirements'] = $my['options']['copy_requirements']; - - $oldNewMappings['test_spec'] = array(); - foreach($elements as $piece) { - $op = $item_mgr['testsuites']->copy_to($piece['id'],$new_id,$user_id,$copyTSuiteOpt,$oldNewMappings); - $oldNewMappings['test_spec'] += $op['mappings']; - } - - // Copy Test Plans and all related information - $this->copy_testplans($id,$new_id,$user_id,$oldNewMappings); - - $this->copy_user_roles($id,$new_id); - - // need to understand if we need to change this and - // PRESERVE External Test case ID - // - // When copying a project, external TC ID is not preserved - // need to update external test case id numerator - $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . - " SET tc_counter = {$rs_source['tc_counter']} " . - " WHERE id = {$new_id}"; - $recordset = $this->db->exec_query($sql); - - -} // end function copy_as - - -/** - * function to get an array with all requirement IDs in testproject - * - * @param string $IDList commaseparated list of Container-IDs - can be testproject ID or reqspec IDs - * @return array $reqIDs result IDs - * - * @internal revisions: - * 20100310 - asimon - removed recursion logic - */ -public function get_all_requirement_ids($IDList) { - - $coupleTypes = array(); - $coupleTypes['target'] = $this->tree_manager->node_descr_id['requirement']; - $coupleTypes['container'] = $this->tree_manager->node_descr_id['requirement_spec']; - - $reqIDs = array(); - $this->tree_manager->getAllItemsID($IDList,$reqIDs,$coupleTypes); - - return $reqIDs; -} - - -/** - * uses get_all_requirements_ids() to count all requirements in testproject - * - * @param integer $tp_id ID of testproject - * @return integer count of requirements in given testproject - */ -public function count_all_requirements($tp_id) { - return count($this->get_all_requirement_ids($tp_id)); -} - -/** - * Copy user roles to a new Test Project - * - * @param int $source_id original Test Project identificator - * @param int $target_id new Test Project identificator - */ -private function copy_user_roles($source_id, $target_id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ SELECT * FROM {$this->tables['user_testproject_roles']} " . - "WHERE testproject_id={$source_id} "; - $rs=$this->db->get_recordset($sql); - - if(!is_null($rs)) - { - foreach($rs as $elem) - { - $sql="/* $debugMsg */ INSERT INTO {$this->tables['user_testproject_roles']} " . - "(testproject_id,user_id,role_id) " . - "VALUES({$target_id}," . $elem['user_id'] ."," . $elem['role_id'] . ")"; - $this->db->exec_query($sql); - } - } -} - - -/** - * Copy platforms - * - * @param int $source_id original Test Project identificator - * @param int $target_id new Test Project identificator - */ -private function copy_platforms($source_id, $target_id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $platform_mgr = new tlPlatform($this->db,$source_id); - $old_new = null; - - $platformSet = $platform_mgr->getAll(); - - if( !is_null($platformSet) ) - { - $platform_mgr->setTestProjectID($target_id); - foreach($platformSet as $platform) - { - $item = new stdClass(); - $item->name = $platform['name']; - $item->notes = (string)$platform['notes']; - $item->enable_on_design = intval($platform['enable_on_design']); - $item->enable_on_execution = intval($platform['enable_on_execution']); - - $op = $platform_mgr->create($item); - $old_new[$platform['id']] = $op['id']; - } - } - return $old_new; -} - - -/** - * Copy platforms - * - * @param int $source_id original Test Project identificator - * @param int $target_id new Test Project identificator - */ -private function copy_keywords($source_id, $target_id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $old_new = null; - $sql = "/* $debugMsg */ SELECT * FROM {$this->tables['keywords']} " . - " WHERE testproject_id = {$source_id}"; - - $itemSet = $this->db->fetchRowsIntoMap($sql,'id'); - if( !is_null($itemSet) ) { - foreach($itemSet as $item) { - $op = $this->addKeyword($target_id,$item['keyword'],$item['notes']); - $old_new[$item['id']] = $op['id']; - } - } - return $old_new; -} - - - - - -/** - * - * - */ -private function copy_cfields_assignments($source_id, $target_id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT field_id FROM {$this->tables['cfield_testprojects']} " . - " WHERE testproject_id = {$source_id}"; - $row_set = $this->db->fetchRowsIntoMap($sql,'field_id'); - if( !is_null($row_set) ) - { - $cfield_set = array_keys($row_set); - $this->cfield_mgr->link_to_testproject($target_id,$cfield_set); - } -} - - -/** - * - * - */ -private function copy_testplans($source_id,$target_id,$user_id,$mappings) -{ - static $tplanMgr; - - $tplanSet = $this->get_all_testplans($source_id); - if( !is_null($tplanSet) ) - { - $keySet = array_keys($tplanSet); - if( is_null($tplanMgr) ) - { - $tplanMgr = new testplan($this->db); - } - - foreach($keySet as $itemID) - { - $new_id = $tplanMgr->create($tplanSet[$itemID]['name'],$tplanSet[$itemID]['notes'], - $target_id,$tplanSet[$itemID]['active'],$tplanSet[$itemID]['is_public']); - - if( $new_id > 0 ) - { - // TICKET 5190: Copy Test projects - tester assignments to testplan+build are not copied - $tplanMgr->copy_as($itemID,$new_id,null,$target_id,$user_id,array('copy_assigned_to' => 1),$mappings); - } - } - - } -} - - -/** - * - * - */ -private function copy_requirements($source_id,$target_id,$user_id) { - $mappings = null; - $or = array(); - - // need to get subtree and create a new one - $filters = array(); - $filters['exclude_node_types'] = - array('testplan' => 'exclude','testcase' => 'exclude', - 'testsuite' => 'exclude','requirement' => 'exclude'); - - $elements = $this->tree_manager->get_children($source_id, - $filters['exclude_node_types']); - - if( !is_null($elements) ) { - $mappings = array(); - $reqSpecMgr = new requirement_spec_mgr($this->db); - - // Development Note - 20110817 - // why we choose to do not copy testcase_assignments ? - // Because due to order used to copy different items, - // when we ask to copy requirements WE DO NOT HAVE - // TEST CASES on new test project. - // - $options = array('copy_also' => - array('testcase_assignments' => false), - 'caller' => 'copy_testproject'); - - $rel = null; - foreach($elements as $piece) { - $op = $reqSpecMgr->copy_to($piece['id'],$target_id,$target_id,$user_id,$options); - - $mappings[] = $op['mappings']; - $or += $op['mappings']['req']; - } - } - - return array($mappings,$or); -} - - - - - - - - -/** - * getTestSpec - * - * get structure with Test suites and Test Cases - * Filters that act on test cases work on attributes that are common to all - * test cases versions: test case name - * - * Development Note: - * Due to the tree structure is not so easy to try to do as much as filter as - * possibile using SQL. - * - * - * @param int id test project ID - * @param mixed filters - * @param mixed options - * recursive true/false changes output format - * testcase_name filter in LIKE %string%, if will be case sensitive or not - * will depend of DBMS. - * - * - */ -function getTestSpec($id,$filters=null,$options=null) { - - $items = array(); - - $my['options'] = array('recursive' => false, - 'exclude_testcases' => false, - 'remove_empty_branches' => false); - - $my['filters'] = array('exclude_node_types' => $this->nt2exclude, - 'exclude_children_of' => $this->nt2exclude_children, - 'exclude_branches' => null, - 'testcase_name' => null, 'importance' => null, - 'testcase_id' => null, 'execution_type' => null, - 'status' => null, 'keywords' => null, - 'additionalWhereClause' => null, - 'platforms' => null); - - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - - if( $my['options']['exclude_testcases'] ) { - $my['filters']['exclude_node_types']['testcase']='exclude me'; - } - - // transform some of our options/filters on something the 'worker' will understand - // when user has request filter by test case name, we do not want to display empty branches - // If we have choose any type of filter, we need to force remove empty test suites - // TICKET 4217: added filter for importance - if( !is_null($my['filters']['testcase_name']) || !is_null($my['filters']['testcase_id']) || - !is_null($my['filters']['execution_type']) || !is_null($my['filters']['exclude_branches']) || - !is_null($my['filters']['importance']) || $my['options']['remove_empty_branches'] ) - { - $my['options']['remove_empty_nodes_of_type'] = 'testsuite'; - } - - $method2call = $my['options']['recursive'] ? '_get_subtree_rec' : '_get_subtree'; - - $qnum = $this->$method2call($id,$items,$my['filters'],$my['options']); - return $items; -} - - -/** - * - * @return - * - * @internal revisions - */ -function _get_subtree_rec($node_id,&$pnode,$filters = null, $options = null) { - static $qnum; - static $my; - static $exclude_branches; - static $exclude_children_of; - static $node_types; - static $tcaseFilter; - static $tcversionFilter; - static $childFilterOn; - static $staticSql; - static $inClause; - static $kwJoin; - - if (!$my) { - $qnum=0; - $node_types = array_flip($this->tree_manager->get_available_node_types()); - - $my['filters'] = array('exclude_children_of' => null,'exclude_branches' => null, - 'additionalWhereClause' => '', 'testcase_name' => null, - 'testcase_id' => null,'active_testcase' => false, - 'importance' => null, 'status' => null); - - $my['options'] = array('remove_empty_nodes_of_type' => null); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - $exclude_branches = $my['filters']['exclude_branches']; - $exclude_children_of = $my['filters']['exclude_children_of']; - - - $tcaseFilter['name'] = !is_null($my['filters']['testcase_name']); - $tcaseFilter['id'] = !is_null($my['filters']['testcase_id']); - - $tcaseFilter['is_active'] = !is_null($my['filters']['active_testcase']) && $my['filters']['active_testcase']; - $tcaseFilter['enabled'] = $tcaseFilter['name'] || $tcaseFilter['id'] || $tcaseFilter['is_active']; - - $actOnVersion = array('execution_type','importance','status', - 'keywords', 'platforms'); - foreach($actOnVersion as $ck) { - $tcversionFilter[$ck] = !is_null($my['filters'][$ck]); - } - - $tcversionFilter['enabled'] = false; - foreach($actOnVersion as $target) { - $tcversionFilter['enabled'] = $tcversionFilter['enabled'] || $tcversionFilter[$target]; - } - - - $childFilterOn = $tcaseFilter['enabled'] || $tcversionFilter['enabled']; - - if( !is_null($my['options']['remove_empty_nodes_of_type']) ) { - // this way I can manage code or description - if( !is_numeric($my['options']['remove_empty_nodes_of_type']) ) { - $my['options']['remove_empty_nodes_of_type'] = - $this->tree_manager->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; - } - } - - // Create invariant sql sentences - $tfields = "NH.id, NH.parent_id, NH.name, NH.node_type_id, NH.node_order, '' AS external_id "; - $staticSql = " SELECT DISTINCT {$tfields} " . - " FROM {$this->tables['nodes_hierarchy']} NH "; - - // Generate IN Clauses - $inClause = array('status' => ' ', 'importance' => ' '); - - foreach($inClause as $tgf => $dummy) { - if( $tcversionFilter[$tgf] ) { - $inClause[$tgf] = - " TCV.$tgf IN (" . implode(',',$my['filters'][$tgf]) . ')'; - } - } - } - - $sql = $staticSql . " WHERE NH.parent_id = " . intval($node_id) . - " AND (" . - " NH.node_type_id = {$this->tree_manager->node_descr_id['testsuite']} " . - " OR (NH.node_type_id = {$this->tree_manager->node_descr_id['testcase']} "; - - if( $tcaseFilter['enabled'] ) { - foreach($tcaseFilter as $key => $apply) { - if( $apply ) { - switch($key) { - case 'name': - $safe4DB = $this->db->prepare_string($my['filters']['testcase_name']); - $sql .= " AND NH.name LIKE '%{$safe4DB}%' "; - break; - - case 'id': - $safe4DB = intval($my['filters']['testcase_id']); - $sql .= " AND NH.id = {$safe4DB} "; - break; - } - } - } - } - $sql .= " )) "; - $sql .= " ORDER BY NH.node_order,NH.id"; - - // Approach Change - get all - $rs = (array)$this->db->fetchRowsIntoMap($sql,'id'); - if( count($rs) == 0 ) { - return $qnum; - } - - // create list with test cases nodes - $tclist = null; - $ks = array_keys($rs); - foreach($ks as $ikey) { - if( $rs[$ikey]['node_type_id'] == $this->tree_manager->node_descr_id['testcase'] ) { - $tclist[$rs[$ikey]['id']] = $rs[$ikey]['id']; - } - } - if( !is_null($tclist) ) { - $filterOnTC = false; - - // 2018, where is the active check? - - // Can be replace with a view? - $glvn = " /* Get LATEST ACTIVE tcversion NUMBER */ " . - " SELECT MAX(TCVX.version) AS version, NHTCX.parent_id AS tc_id " . - " FROM {$this->tables['tcversions']} TCVX " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCX " . - " ON NHTCX.id = TCVX.id AND TCVX.active = 1 " . - " WHERE NHTCX.parent_id IN (" . implode(',',$tclist) . ")" . - " GROUP BY NHTCX.parent_id"; - - // 2018, again where is the active check? - $ssx = " /* Get LATEST ACTIVE tcversion MAIN ATTRIBUTES */ " . - " SELECT TCV.id AS tcversion_id, TCV.tc_external_id AS external_id, SQ.tc_id " . - " FROM {$this->tables['nodes_hierarchy']} NHTCV " . - " JOIN ( $glvn ) SQ " . - " ON NHTCV.parent_id = SQ.tc_id " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON NHTCV.id = TCV.id "; - - // 2018 - $where = " WHERE SQ.version = TCV.version "; - - // We can add here keyword filtering if exist ? - if( $tcversionFilter['enabled'] || $tcaseFilter['is_active'] ) { - $addAnd = false; - if ($tcversionFilter['importance'] || $tcversionFilter['execution_type'] || - $tcversionFilter['status'] ) { - $where .= " AND "; - } - - if( $tcversionFilter['importance'] ) { - $where .= $inClause['importance']; - $filterOnTC = true; - $addAnd = true; - } - - if( $addAnd && $tcversionFilter['execution_type']) { - $where .= " AND "; - } - - if( $tcversionFilter['execution_type'] ) { - $where .= " TCV.execution_type = " . $my['filters']['execution_type']; - $filterOnTC = true; - $addAnd = true; - } - - if( $addAnd && $tcversionFilter['status']) { - $where .= " AND "; - } - - if( $tcversionFilter['status'] ) { - $where .= $inClause['status']; - $filterOnTC = true; - $addAnd = true; - } - - /* - if( $addAnd && $tcversionFilter['keywords']) { - $where .= " AND "; - } - - if( $tcversionFilter['keywords'] ) { - $kwJoin = ''; - } - */ - } - - // $ssx .= $kwJoin . $where; - $ssx .= $where; - - $highlander = $this->db->fetchRowsIntoMap($ssx,'tc_id'); - if( $filterOnTC ) { - $ky = !is_null($highlander) ? array_diff_key($tclist,$highlander) : $tclist; - if( count($ky) > 0 ) { - foreach($ky as $tcase) { - unset($rs[$tcase]); - } - } - } - - } - - foreach($rs as $row) { - if(!isset($exclude_branches[$row['id']])) { - $node = $row + array('node_table' => $this->tree_manager->node_tables_by['id'][$row['node_type_id']]); - $node['childNodes'] = null; - - if($node['node_table'] == 'testcases') { - $node['leaf'] = true; - $node['external_id'] = isset($highlander[$row['id']]) ? $highlander[$row['id']]['external_id'] : null; - } - - // why we use exclude_children_of ? - // 1. Sometimes we don't want the children if the parent is a testcase, - // due to the version management - // - if(!isset($exclude_children_of[$node_types[$row['node_type_id']]])) { - // Keep walking (Johny Walker Whisky) - $this->_get_subtree_rec($row['id'],$node,$my['filters'],$my['options']); - } - - - // Have added this logic, because when export test plan will be developed - // having a test spec tree where test suites that do not contribute to test plan - // are pruned/removed is very important, to avoid additional processing - // - // If node has no childNodes, we check if this kind of node without children - // can be removed. - // - $doRemove = is_null($node['childNodes']) && - ($node['node_type_id'] == $my['options']['remove_empty_nodes_of_type']); - if(!$doRemove) { - $pnode['childNodes'][] = $node; - } - - } // if(!isset($exclude_branches[$rowID])) - } //while - - return $qnum; -} - + 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + private $nt2exclude_children = array( + 'testcase' => 'exclude_my_children', + 'requirement_spec' => 'exclude_my_children' + ); + + private $debugMsg; + + private $tmp_dir; + + private $node_types_descr_id; + + private $my_node_type; + + private $cfg; + + /** + * Class constructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + $this->tmp_dir = config_get('temp_dir'); + + $this->db = &$db; + $this->tree_manager = new tree($this->db); + $this->cfield_mgr = new cfield_mgr($this->db); + $this->debugMsg = 'Class:' . __CLASS__ . ' - Method: '; + tlObjectWithAttachments::__construct($this->db, 'nodes_hierarchy'); + $this->object_table = $this->tables['testprojects']; + + $this->node_types_descr_id = &$this->tree_manager->node_descr_id; + $this->my_node_type = $this->tree_manager->node_descr_id['testproject']; + + $this->cfg = new stdClass(); + $this->cfg->keywords = config_get('keywords'); + } + + /** + * Create a new Test project + * + * @param string $name + * Name of project + * @param string $color + * value according to CSS color definition + * @param string $notes + * project description (HTML text) + * @param array $options + * project features/options + * bolean keys: inventoryEnabled, automationEnabled, + * testPriorityEnabled, requirementsEnabled + * @param boolean $active + * [1,0] optional + * @param string $tcasePrefix + * [''] + * @param boolean $is_public + * [1,0] optional + * + * @return integer test project id or 0 (if fails) + * + * @internal revisions + * + */ + public function create($item, $opt = null) + { + $my['opt'] = array( + 'doChecks' => false, + 'setSessionProject' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $serOptions = serialize($item->options); + + try { + $tcPrefix = $this->formatTcPrefix($item->prefix); // will truncate prefix is len() > limit + + // mandatory checks + if (strlen($item->name) == 0) { + throw new Exception('Empty name is not allowed'); + } + + if ($my['opt']['doChecks']) { + $check = $this->checkNameSintax($item->name); + if ($check['status_ok']) { + $check = $this->checkNameExistence($item->name); + } + if ($check['status_ok']) { + $check = $this->checkTestCasePrefixExistence($tcPrefix); + } + + if (! $check['status_ok']) { + throw new Exception($check['msg']); + } + } + } catch (Exception $e) { + throw $e; // rethrow + } + + // Create API KEY 64 bit long + $api_key = md5(rand()) . md5(rand()); + + // Create Node and get the id + $id = $this->tree_manager->new_root_node($item->name); + $sql = " INSERT INTO {$this->object_table} (id,color," . + " options,notes,active,is_public,prefix,api_key) " . " VALUES (" . + $id . ", '" . $this->db->prepare_string($item->color) . "','" . + $serOptions . "','" . $this->db->prepare_string($item->notes) . "'," . + $item->active . "," . $item->is_public . ",'" . + $this->db->prepare_string($tcPrefix) . "','" . + $this->db->prepare_string($api_key) . "')"; + $result = $this->db->exec_query($sql); + + $evt = new stdClass(); + $evt->message = TLS("audit_testproject_created", $item->name); + $evt->code = "CREATE"; + $evt->source = $this->auditCfg->eventSource; + $evt->objectType = 'testprojects'; + + if ($result) { + // set project to session if not defined (the first project) or update the current + if (! isset($_SESSION['testprojectID']) && + $my['opt']['setSessionProject']) { + $this->setSessionProject($id); + } + $evt->logLevel = 'AUDIT'; + + // Send Event + $ctx = array( + 'id' => $id, + 'name' => $item->name, + 'prefix' => $tcPrefix + ); + event_signal('EVENT_TEST_PROJECT_CREATE', $ctx); + } else { + $id = 0; + $evt->logLevel = 'ERROR'; + } + + $evt->objectID = $id; + + logEvent($evt); + + return $id; + } + + /** + * Update Test project data in DB and (if applicable) current session data + * + * @param integer $id + * project Identifier + * @param string $name + * Name of project + * @param string $color + * value according to CSS color definition + * @param string $notes + * project description (HTML text) + * @param array $options + * project features/options + * bolean keys: inventoryEnabled, automationEnabled, + * testPriorityEnabled, requirementsEnabled + * + * @return boolean result of DB update + * + * @internal + * + */ + public function update($id, $name, $color, $notes, $options, $active = null, + $tcasePrefix = null, $is_public = null) + { + $status_ok = 1; + $log_msg = 'Test project ' . $name . ' update: Ok.'; + $log_level = 'INFO'; + $safeID = intval($id); + + $add_upd = ''; + if (! is_null($active)) { + $add_upd .= ',active=' . (intval($active) > 0 ? 1 : 0); + } + + if (! is_null($is_public)) { + $add_upd .= ',is_public=' . (intval($is_public) > 0 ? 1 : 0); + } + + if (! is_null($tcasePrefix)) { + $tcprefix = $this->formatTcPrefix($tcasePrefix); + $add_upd .= ",prefix='" . $this->db->prepare_string($tcprefix) . "'"; + } + $serOptions = serialize($options); + + $sql = " UPDATE {$this->object_table} SET color='" . + $this->db->prepare_string($color) . "', " . " options='" . + $serOptions . "', " . " notes='" . $this->db->prepare_string($notes) . + "' {$add_upd} " . " WHERE id=" . $safeID; + $result = $this->db->exec_query($sql); + + if ($result) { + // update related node + $sql = "UPDATE {$this->tables['nodes_hierarchy']} SET name='" . + $this->db->prepare_string($name) . "' WHERE id= {$safeID}"; + $result = $this->db->exec_query($sql); + } + + if ($result) { + // update session data + $this->setSessionProject($safeID); + + // Send Event + $ctx = array( + 'id' => $id, + 'name' => $name, + 'prefix' => $tcprefix + ); + event_signal('EVENT_TEST_PROJECT_UPDATE', $ctx); + } else { + $status_msg = 'Update FAILED!'; + $status_ok = 0; + $log_level = 'ERROR'; + $log_msg = $status_msg; + } + + tLog($log_msg, $log_level); + return $status_ok; + } + + /** + * Set session data related to a Test project + * + * @param integer $projectId + * Project ID; zero causes unset data + */ + public function setSessionProject($projectId) + { + $tproject_info = null; + + if ($projectId) { + $tproject_info = $this->get_by_id($projectId); + } + + if ($tproject_info) { + $_SESSION['testprojectID'] = $tproject_info['id']; + $_SESSION['testprojectName'] = $tproject_info['name']; + $_SESSION['testprojectColor'] = $tproject_info['color']; + $_SESSION['testprojectPrefix'] = $tproject_info['prefix']; + + $_SESSION['testprojectOptions'] = new stdClass(); + $_SESSION['testprojectOptions']->requirementsEnabled = isset( + $tproject_info['opt']->requirementsEnabled) ? $tproject_info['opt']->requirementsEnabled : 0; + $_SESSION['testprojectOptions']->testPriorityEnabled = isset( + $tproject_info['opt']->testPriorityEnabled) ? $tproject_info['opt']->testPriorityEnabled : 0; + $_SESSION['testprojectOptions']->automationEnabled = isset( + $tproject_info['opt']->automationEnabled) ? $tproject_info['opt']->automationEnabled : 0; + $_SESSION['testprojectOptions']->inventoryEnabled = isset( + $tproject_info['opt']->inventoryEnabled) ? $tproject_info['opt']->inventoryEnabled : 0; + + tLog( + "Test Project was activated: [" . $tproject_info['id'] . "]" . + $tproject_info['name'], 'INFO'); + } else { + if (isset($_SESSION['testprojectID'])) { + tLog( + "Test Project deactivated: [" . $_SESSION['testprojectID'] . + "] " . $_SESSION['testprojectName'], 'INFO'); + } + unset($_SESSION['testprojectID']); + unset($_SESSION['testprojectName']); + unset($_SESSION['testprojectColor']); + unset($_SESSION['testprojectOptions']); + unset($_SESSION['testprojectPrefix']); + } + } + + /** + * Unserialize project options + * + * @param array $recorset + * produced by getTestProject() + */ + protected function parseTestProjectRecordset(&$recordset) + { + if (! empty($recordset)) { + foreach ($recordset as $number => $row) { + $recordset[$number]['opt'] = unserialize($row['options']); + } + } else { + $recordset = null; + tLog('parseTestProjectRecordset: No project on query', 'DEBUG'); + } + } + + /** + * Get Test project data according to parameter with unique value + * + * @param string $condition + * (optional) additional SQL condition(s) + * @return array map with test project info; null if query fails + */ + protected function getTestProject($condition = null, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my = array( + 'options' => array( + 'output' => 'full' + ) + ); + $my['options'] = array_merge($my['options'], (array) $opt); + + $doParse = true; + $tprojCols = ' testprojects.* '; + + switch ($my['options']['output']) { + case 'existsByID': + $doParse = false; + $sql = "/* $debugMsg */ SELECT testprojects.id " . + " FROM {$this->object_table} testprojects " . " WHERE 1=1 "; + break; + + case 'existsByName': + $doParse = false; + $sql = "/* $debugMsg */ SELECT testprojects.id " . + " FROM {$this->object_table} testprojects, " . + " {$this->tables['nodes_hierarchy']} nodes_hierarchy" . + " WHERE testprojects.id = nodes_hierarchy.id " . + " AND nodes_hierarchy.node_type_id = " . + $this->tree_manager->node_descr_id['testproject']; + break; + + case 'name': + $doParse = false; + $tprojCols = 'testprojects.id'; + case 'full': + default: + $sql = "/* $debugMsg */ SELECT {$tprojCols}, nodes_hierarchy.name " . + " FROM {$this->object_table} testprojects, " . + " {$this->tables['nodes_hierarchy']} nodes_hierarchy" . + " WHERE testprojects.id = nodes_hierarchy.id " . + " AND nodes_hierarchy.node_type_id = " . + $this->tree_manager->node_descr_id['testproject']; + break; + } + if (! is_null($condition)) { + $sql .= " AND " . $condition; + } + + $rs = $this->db->get_recordset($sql); + if ($doParse) { + $this->parseTestProjectRecordset($rs); + } + return $rs; + } + + /** + * Get Test project data according to name + * + * @param string $name + * @param string $addClause + * (optional) additional SQL condition(s) + * + * @return array map with test project info; null if query fails + */ + public function get_by_name($name, $addClause = null, $opt = null) + { + $condition = "nodes_hierarchy.name='" . $this->db->prepare_string($name) . + "'"; + $condition .= is_null($addClause) ? '' : " AND {$addClause} "; + + return $this->getTestProject($condition); + } + + /** + * Get Test project data according to ID + * + * @param integer $id + * test project + * @return array map with test project info; null if query fails + */ + public function get_by_id($id, $opt = null) + { + $condition = "testprojects.id=" . intval($id); + $result = $this->getTestProject($condition, $opt); + return $result[0]; + } + + /** + * Get Test project data according to prefix + * + * @param string $prefix + * @param string $addClause + * optional additional SQL 'AND filter' clause + * + * @return array map with test project info; null if query fails + */ + public function get_by_prefix($prefix, $addClause = null) + { + $safe_prefix = $this->db->prepare_string($prefix); + $condition = "testprojects.prefix='{$safe_prefix}'"; + $condition .= is_null($addClause) ? '' : " AND {$addClause} "; + + $rs = $this->getTestProject($condition); + return $rs != null ? $rs[0] : null; + } + + /** + * Get Test project data according to APIKEY + * + * @param + * string 64 chars + * @return array map with test project info; null if query fails + */ + public function getByAPIKey($apiKey, $opt = null) + { + $condition = "testprojects.api_key='{$apiKey}'"; + $result = $this->getTestProject($condition, $opt); + return $result[0]; + } + + /* + * function: get_all + * get array of info for every test project + * without any kind of filter. + * Every array element contains an assoc array with test project info + * + * args:[order_by]: default " ORDER BY nodes_hierarchy.name " -> testproject name + * + * + */ + public function get_all($filters = null, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my = array( + 'filters' => '', + 'options' => '' + ); + + $my['filters'] = array( + 'active' => null + ); + $my['options'] = array( + 'order_by' => " ORDER BY nodes_hierarchy.name ", + 'access_key' => null, + 'output' => 'std' + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($my['options']['output'] == 'count') { + $sql = "/* $debugMsg */ SELECT COUNT(testprojects.id) AS qty " . + " FROM {$this->object_table} testprojects"; + + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + // + $sql = "/* $debugMsg */ SELECT testprojects.*, nodes_hierarchy.name " . + " FROM {$this->object_table} testprojects, " . + " {$this->tables['nodes_hierarchy']} nodes_hierarchy " . + " WHERE testprojects.id = nodes_hierarchy.id "; + + if (! is_null($my['filters']['active'])) { + $sql .= " AND active=" . intval($my['filters']['active']) . " "; + } + + if (! is_null($my['options']['order_by'])) { + $sql .= $my['options']['order_by']; + } + + if (is_null($my['options']['access_key'])) { + $recordset = $this->db->get_recordset($sql); + $this->parseTestProjectRecordset($recordset); + } else { + $recordset = $this->db->fetchRowsIntoMap($sql, + $my['options']['access_key']); + if (! empty($recordset)) { + foreach ($recordset as $number => $row) { + $recordset[$number]['opt'] = unserialize($row['options']); + } + } + } + + return $recordset; + } + + /* + * function: get_accessible_for_user + * get list of testprojects, considering user roles. + * Remember that user has: + * 1. one default role, assigned when user was created + * 2. a different role can be assigned for every testproject. + * + * For users roles that has not rigth to modify testprojects + * only active testprojects are returned. + * + * args: + * user_id + * [output_type]: choose the output data structure. + * possible values: map, map_of_map + * map: key -> test project id + * value -> test project name + * + * map_of_map: key -> test project id + * value -> array ('name' => test project name, + * 'active' => active status) + * + * array_of_map: value -> array with all testproject table fields plus name. + * + * + * default: map + * [order_by]: default: ORDER BY name + * + */ + public function get_accessible_for_user($user_id, $opt = null, + $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my = array(); + $my['opt'] = array( + 'output' => 'map', + 'order_by' => ' ORDER BY name ', + 'field_set' => 'full', + 'format' => 'std', + 'add_issuetracker' => false, + 'add_codetracker' => false, + 'add_reqmgrsystem' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + // key = field name + // value = array('op' => Domain ('=','like'), 'value' => the value) + $my['filters'] = array( + 'name' => null, + 'id' => null, + 'prefix' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $items = array(); + $safe_user_id = intval($user_id); + + // Get default/global role + $sql = "/* $debugMsg */ SELECT id,role_id FROM {$this->tables['users']} where id=" . + $safe_user_id; + $user_info = $this->db->get_recordset($sql); + $globalRoleID = intval($user_info[0]['role_id']); + + $itsql = ''; + $itf = ''; + if ($my['opt']['add_issuetracker']) { + $itsql = " LEFT OUTER JOIN {$this->tables['testproject_issuetracker']} AS TIT " . + " ON TIT.testproject_id = TPROJ.id " . + " LEFT OUTER JOIN {$this->tables['issuetrackers']} AS ITMD " . + " ON ITMD.id = TIT.issuetracker_id "; + $itf = ",ITMD.name AS itname,ITMD.type AS ittype"; + } + + $ctsql = ''; + $ctf = ''; + if ($my['opt']['add_codetracker']) { + $ctsql = " LEFT OUTER JOIN {$this->tables['testproject_codetracker']} AS TCT " . + " ON TCT.testproject_id = TPROJ.id " . + " LEFT OUTER JOIN {$this->tables['codetrackers']} AS CTMD " . + " ON CTMD.id = TCT.codetracker_id "; + $ctf = ",CTMD.name AS ctname,CTMD.type AS cttype"; + } + + $rmssql = ''; + $rmsf = ''; + if ($my['opt']['add_reqmgrsystem']) { + $rmssql = " LEFT OUTER JOIN {$this->tables['testproject_reqmgrsystem']} AS TRMS " . + " ON TRMS.testproject_id = TPROJ.id " . + " LEFT OUTER JOIN {$this->tables['reqmgrsystems']} AS RMSMD " . + " ON RMSMD.id = TRMS.reqmgrsystem_id "; + $rmsf = ",RMSMD.name AS rmsname,RMSMD.type AS rmstype"; + } + + switch ($my['opt']['field_set']) { + case 'id': + $cols = ' TPROJ.id,NHTPROJ.name '; + $my['opt']['format'] = 'do not parse'; + break; + + case 'prefix': + $cols = ' TPROJ.id,TPROJ.prefix,TPROJ.active,NHTPROJ.name '; + $my['opt']['format'] = 'do not parse'; + break; + + case 'full': + default: + $cols = ' TPROJ.*,NHTPROJ.name,COALESCE(UTR.role_id,U.role_id) AS effective_role '; + break; + } + + $sql = " /* $debugMsg */ SELECT {$cols} {$itf} {$ctf} {$rmsf} " . + " FROM {$this->tables['nodes_hierarchy']} NHTPROJ " . + " JOIN {$this->object_table} TPROJ ON NHTPROJ.id=TPROJ.id " . + " JOIN {$this->tables['users']} U ON U.id = {$safe_user_id} " . + " LEFT OUTER JOIN {$this->tables['user_testproject_roles']} UTR " . + " ON TPROJ.id = UTR.testproject_id " . " AND UTR.user_id =" . + $safe_user_id . $itsql . $ctsql . $rmssql . " WHERE 1=1 "; + + // Private test project feature + if ($globalRoleID != TL_ROLES_ADMIN) { + if ($globalRoleID != TL_ROLES_NO_RIGHTS) { + $sql .= " AND "; + $sql_public = " ( TPROJ.is_public = 1 AND (UTR.role_id IS NULL OR UTR.role_id != " . + TL_ROLES_NO_RIGHTS . ") )"; + $sql_private = " ( TPROJ.is_public = 0 AND UTR.role_id != " . + TL_ROLES_NO_RIGHTS . ") "; + $sql .= " ( {$sql_public} OR {$sql_private} ) "; + } else { + // User needs specific role + $sql .= " AND (UTR.role_id IS NOT NULL AND UTR.role_id != " . + TL_ROLES_NO_RIGHTS . ")"; + } + } + + $userObj = tlUser::getByID($this->db, $safe_user_id, + tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); + if ($userObj->hasRight($this->db, 'mgt_modify_product') != 'yes') { + $sql .= " AND TPROJ.active=1 "; + } + unset($userObj); + + foreach ($my['filters'] as $fname => $fspec) { + if (! is_null($fspec)) { + switch ($fname) { + case 'prefix': + $sql .= " AND TPROJ.$fname"; + $sm = 'prepare_string'; + break; + + case 'name': + $sql .= " AND NHTPROJ.$fname"; + $sm = 'prepare_string'; + break; + + case 'id': + $sql .= " AND NHTPROJ.$fname"; + $sm = 'prepare_int'; + break; + } + + $safe = $this->db->$sm($fspec['value']); + switch ($fspec['op']) { + case '=': + if ($sm == 'prepare_string') { + $sql .= "='" . $safe . "'"; + } else { + $sql .= "=" . $safe; + } + break; + + case 'like': + $sql .= " LIKE '%" . $safe . "%'"; + break; + } + } + } + + $sql .= str_replace('nodes_hierarchy', 'NHTPROJ', $my['opt']['order_by']); + $parseOpt = false; + $do_post_process = 0; + $arrTemp = array(); + switch ($my['opt']['output']) { + case 'array_of_map': + $items = $this->db->get_recordset($sql); // ,null,3,1); + $parseOpt = true; + break; + + case 'map_of_map_full': + $items = $this->db->fetchRowsIntoMap($sql, 'id'); + $parseOpt = true; + break; + + case 'map': + $items = $this->db->fetchRowsIntoMap($sql, 'id'); + break; + + case 'map_with_inactive_mark': + default: + $arrTemp = (array) $this->db->fetchRowsIntoMap($sql, 'id'); + $do_post_process = ! empty($arrTemp); + break; + } + + if ($my['opt']['format'] == 'std' && $parseOpt) { + $this->parseTestProjectRecordset($items); + } + + if ($do_post_process) { + switch ($my['opt']['output']) { + case 'map_name_with_inactive_mark': + foreach ($arrTemp as $id => $row) { + $noteActive = ''; + if (! $row['active']) { + $noteActive = TL_INACTIVE_MARKUP; + } + $items[$id] = $noteActive . + (($my['opt']['field_set'] == 'prefix') ? ($row['prefix'] . + ':') : '') . $row['name']; + } + break; + + case 'map_of_map': + foreach ($arrTemp as $id => $row) { + $items[$id] = array( + 'name' => $row['name'], + 'active' => $row['active'] + ); + } + break; + } + unset($arrTemp); + } + + return $items; + } + + /* + * function: get_subtree + * Get subtree that has choosen testproject as root. + * Only nodes of type: + * testsuite and testcase are explored and retrieved. + * + * args: id: testsuite id + * [recursive_mode]: default false + * [exclude_testcases]: default: false + * [exclude_branches] + * [additionalWhereClause]: + * + * + * returns: array + * see tree->get_subtree() for details. + * + * + */ + public function get_subtree($id, $filters = null, $opt = null) + { + $my = array(); + $my['options'] = array( + 'recursive' => false, + 'exclude_testcases' => false, + 'output' => 'full' + ); + $my['filters'] = array( + 'exclude_node_types' => $this->nt2exclude, + 'exclude_children_of' => $this->nt2exclude_children, + 'exclude_branches' => null, + 'additionalWhereClause' => '' + ); + + $my['options'] = array_merge($my['options'], (array) $opt); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + if ($my['options']['exclude_testcases']) { + $my['filters']['exclude_node_types']['testcase'] = 'exclude me'; + } + + return $this->tree_manager->get_subtree(intval($id), $my['filters'], + $my['options']); + } + + /** + * Displays smarty template to show test project info to users. + * + * @param TLSmarty $smarty + * [ref] smarty object + * @param int $id + * test project + * @param string $sqlResult + * [default = ''] + * @param string $action + * [default = 'update'] + * @param int $modded_item_id + * [default = 0] + * + * @internal revisions + * + */ + public function show(&$smarty, $guiObj, $template_dir, $id, $sqlResult = '', + $action = 'update', $modded_item_id = 0) + { + $gui = $guiObj; + + if (! property_exists($gui, 'uploadOp')) { + $gui->uploadOp = null; + } + + $gui->sqlResult = ''; + $gui->sqlAction = ''; + if ($sqlResult) { + $gui->sqlResult = $sqlResult; + } + + $p2ow = array( + 'refreshTree' => false, + 'user_feedback' => '' + ); + foreach ($p2ow as $prop => $value) { + if (! property_exists($gui, $prop)) { + $gui->$prop = $value; + } + } + + $safeID = intval($id); + $gui->tproject_id = $safeID; + $gui->modify_tc_rights = has_rights($this->db, "mgt_modify_tc", $safeID); + $gui->mgt_modify_product = has_rights($this->db, "mgt_modify_product"); + + $gui->container_data = $this->get_by_id($safeID); + $gui->moddedItem = $gui->container_data; + $gui->level = 'testproject'; + $gui->page_title = lang_get('testproject'); + $gui->refreshTree = property_exists($gui, 'refreshTree') ? $gui->refreshTree : false; + $gui->attachmentInfos = getAttachmentInfosFrom($this, $safeID); + + // attachments management on page + $gui->fileUploadURL = $_SESSION['basehref'] . + $this->getFileUploadRelativeURL($safeID); + $gui->delAttachmentURL = $_SESSION['basehref'] . + $this->getDeleteAttachmentRelativeURL($safeID); + $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; + $gui->fileUploadMsg = ''; + + $exclusion = array( + 'testcase', + 'me', + 'testplan' => 'me', + 'requirement_spec' => 'me' + ); + $gui->canDoExport = count( + (array) $this->tree_manager->get_children($safeID, $exclusion)) > 0; + if ($modded_item_id) { + $gui->moddedItem = $this->get_by_id(intval($modded_item_id)); + } + $cfg = getWebEditorCfg('testproject'); + $gui->testProjectEditorType = $cfg['type']; + + $smarty->assign('gui', $gui); + $smarty->display($template_dir . 'containerView.tpl'); + } + + /** + * Count testcases without considering active/inactive status. + * + * @param integer $id: + * test project identifier + * @return integer count of test cases presents on test project. + */ + public function count_testcases($id) + { + $tcIDs = array(); + $this->get_all_testcases_id($id, $tcIDs); + return count($tcIDs); + } + + /* + * function: gen_combo_test_suites + * create array with test suite names + * test suites are ordered in parent-child way, means + * order on array is creating traversing tree branches, reaching end + * of branch, and starting again. (recursive algorithim). + * + * + * args : $id: test project id + * [$exclude_branches]: array with testsuite id to exclude + * useful to exclude myself ($id) + * [$mode]: dotted -> $level number of dot characters are appended to + * the left of test suite name to create an indent effect. + * Level indicates on what tree layer testsuite is positioned. + * Example: + * + * null + * \ + * id=1 <--- Tree Root = Level 0 + * | + * + ------+ + * / \ \ + * id=9 id=2 id=8 <----- Level 1 + * \ + * id=3 <----- Level 2 + * \ + * id=4 <----- Level 3 + * + * + * key: testsuite id (= node id on tree). + * value: every array element is an string, containing testsuite name. + * + * Result example: + * + * 2 .TS1 + * 3 ..TS2 + * 9 .20071014-16:22:07 TS1 + * 10 ..TS2 + * + * + * array -> key: testsuite id (= node id on tree). + * value: every array element is a map with the following keys + * 'name', 'level' + * + * 2 array(name => 'TS1',level => 1) + * 3 array(name => 'TS2',level => 2) + * 9 array(name => '20071014-16:22:07 TS1',level =>1) + * 10 array(name => 'TS2', level => 2) + * + * + * returns: map , structure depens on $mode argument. + * + */ + public function gen_combo_test_suites($id, $exclude_branches = null, + $mode = 'dotted') + { + $ret = array(); + $test_spec = $this->get_subtree($id, + array( + 'exclude_branches' => $exclude_branches + ), + array( + 'recursive' => ! self::RECURSIVE_MODE, + 'exclude_testcases' => self::EXCLUDE_TESTCASES + )); + + if (count($test_spec)) { + $ret = $this->_createHierarchyMap($test_spec, $mode); + } + return $ret; + } + + /** + * Checks a test project name for correctness + * + * @param string $name + * the name to check + * @return array with keys: status_ok, msg + */ + public function checkName($name) + { + $forbidden_pattern = config_get('ereg_forbidden'); + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + + if ($name == "") { + $ret['msg'] = lang_get('info_product_name_empty'); + $ret['status_ok'] = 0; + } + if ($ret['status_ok'] && ! checkString($name, $forbidden_pattern)) { + $ret['msg'] = lang_get('string_contains_bad_chars'); + $ret['status_ok'] = 0; + } + return $ret; + } + + /** + * Checks a test project name for sintax correctness + * + * @param string $name + * the name to check + * @return array with keys: status_ok, msg + */ + public function checkNameSintax($name) + { + $forbidden_pattern = config_get('ereg_forbidden'); + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + + if ($name == "") { + $ret['msg'] = lang_get('info_product_name_empty'); + $ret['status_ok'] = 0; + } + if ($ret['status_ok'] && ! checkString($name, $forbidden_pattern)) { + $ret['msg'] = lang_get('string_contains_bad_chars'); + $ret['status_ok'] = 0; + } + return $ret; + } + + /** + * Checks is there is another testproject with different id but same name + */ + public function checkNameExistence($name, $id = 0) + { + $check_op['msg'] = ''; + $check_op['status_ok'] = 1; + + if ($this->get_by_name($name, "testprojects.id <> {$id}")) { + $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'), + $name); + $check_op['status_ok'] = 0; + } + return $check_op; + } + + /** + * Checks is there is another testproject with different id but same prefix + */ + private function checkTestCasePrefixExistence($prefix, $id = 0) + { + $check_op = array( + 'msg' => '', + 'status_ok' => 1 + ); + $sql = " SELECT id FROM {$this->object_table} " . " WHERE prefix='" . + $this->db->prepare_string($prefix) . "'" . " AND id <> {$id}"; + + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $check_op['msg'] = sprintf(lang_get('error_tcase_prefix_exists'), + $prefix); + $check_op['status_ok'] = 0; + } + + return $check_op; + } + + /** + * allow activate or deactivate a test project + * + * @param integer $id + * test project ID + * @param integer $status + * 1=active || 0=inactive + */ + public function activate($id, $status) + { + $sql = "UPDATE {$this->tables['testprojects']} SET active=" . $status . + " WHERE id=" . $id; + $result = $this->db->exec_query($sql); + + return $result ? 1 : 0; + } + + /** + * + * @param string $str + * @return string + */ + private function formatTcPrefix($str) + { + $fstr = trim($str); + if (tlStringLen($fstr) == 0) { + throw new Exception('Empty prefix is not allowed'); + } + + // limit tcasePrefix len. + if (tlStringLen($fstr) > self::TESTCASE_PREFIX_MAXLEN) { + $fstr = substr($fstr, 0, self::TESTCASE_PREFIX_MAXLEN); + } + return $fstr; + } + + /* + * args : id: test project + * returns: null if query fails + * string + */ + public function getTestCasePrefix($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT prefix FROM {$this->object_table} WHERE id = {$id}"; + return $this->db->fetchOneValue($sql); + } + + /* + * args: id: test project + * returns: null if query fails + * a new test case number + */ + public function generateTestCaseNumber($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $retry = 3; + $lockfile = $this->tmp_dir . __FUNCTION__ . '.lock'; + $lock = fopen($lockfile, 'a'); + + $gotLock = false; + while ($retry > 0 && ! $gotLock) { + if (flock($lock, LOCK_EX)) { + $gotLock = true; + } else { + $retry --; + usleep(20); + } + } + + if ($gotLock || $retry == 0) { + $safeID = intval($id); + + $ret = null; + $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . + " SET tc_counter=tc_counter+1 WHERE id = {$safeID}"; + $this->db->exec_query($sql); + + $sql = " SELECT tc_counter FROM {$this->object_table} WHERE id = {$safeID}"; + $rs = $this->db->get_recordset($sql); + $ret = $rs[0]['tc_counter']; + + if ($gotLock) { + flock($lock, LOCK_UN); + } + fclose($lock); + + return $ret; + } + } + + /** + */ + protected function setTestCaseCounter($id, $value, $force = false) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $safeValue = intval($value); + $sql = " /* $debugMsg */ UPDATE {$this->object_table} " . + ' SET tc_counter=' . $safeValue . ' WHERE id =' . intval($id); + + if (! $force) { + $sql .= ' AND tc_counter < ' . $safeValue; + } + $this->db->exec_query($sql); + } + + /** + * + * @param integer $id + * test project ID + */ + private function setPublicStatus($id, $status) + { + $isPublic = val($status) > 0 ? 1 : 0; + $sql = "UPDATE {$this->object_table} SET is_public={$isPublic} WHERE id={$id}"; + $result = $this->db->exec_query($sql); + return $result ? 1 : 0; + } + + /* Keywords related methods */ + /** + * Adds a new keyword to the given test project + * + * @param int $testprojectID + * @param string $keyword + * @param string $notes + * + */ + public function addKeyword($testprojectID, $keyword, $notes) + { + $kw = new tlKeyword(); + $kw->initialize(null, $testprojectID, $keyword, $notes); + $op = array( + 'status' => tlKeyword::E_DBERROR, + 'id' => - 1, + 'msg' => 'ko DB Error' + ); + + $op['status'] = $kw->writeToDB($this->db); + $op['id'] = $kw->dbID; + + if ($op['status'] >= self::OK) { + logAuditEvent(TLS("audit_keyword_created", $keyword), "CREATE", + $op['id'], "keywords"); + } else { + $op['msg'] = tlKeyword::getError($op['status']); + } + + return $op; + } + + /** + * updates the keyword with the given id + * + * @param int $testprojectID + * @param int $id + * @param string $keyword + * @param string $notes + * + */ + public function updateKeyword($testprojectID, $id, $keyword, $notes) + { + $kw = new tlKeyword($id); + $kw->initialize($id, $testprojectID, $keyword, $notes); + $result = $kw->writeToDB($this->db); + if ($result >= self::OK) { + logAuditEvent(TLS("audit_keyword_saved", $keyword), "SAVE", + $kw->dbID, "keywords"); + } + return $result; + } + + /** + * gets the keyword with the given id + * + * @param int $id + */ + public function getKeyword($id) + { + return tlKeyword::getByID($this->db, $id); + } + + /** + * Gets the keywords of the given test project + * + * @param int $tprojectID + * the test project id + * @param int $keywordID + * [default = null] the optional keyword id + * + * @return array, every elemen is map with following structure: + * id + * keyword + * notes + */ + public function getKeywords($testproject_id) + { + $ids = $this->getKeywordIDsFor($testproject_id); + return tlKeyword::getByIDs($this->db, $ids); + } + + /** + * Deletes the keyword with the given id + * + * @param int $id + * the keywordID + * @return int returns 1 on success, 0 else + * + */ + public function deleteKeyword($id, $opt = null) + { + $result = self::ERROR; + $my['opt'] = array( + 'checkBeforeDelete' => true, + 'nameForAudit' => null, + 'context' => '', + 'tproject_id' => null + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $doIt = ! $my['opt']['checkBeforeDelete']; + $keyword = $my['opt']['nameForAudit']; + + if ($my['opt']['checkBeforeDelete']) { + $doIt = true; + if ($this->cfg->keywords->onDeleteCheckExecutedTCVersions) { + $linkedAndNotExec = $this->checkKeywordIsLinkedAndNotExecuted( + $id); + $doIt = $doIt && $linkedAndNotExec; + } + + if ($this->cfg->keywords->onDeleteCheckFrozenTCVersions) { + $linkedToFrozen = $this->checkKeywordIsLinkedToFrozenVersions( + $id); + $doIt = $doIt && ! $linkedToFrozen; + } + } + + if ($doIt) { + if ($this->auditCfg->logEnabled) { + $keyword = $this->getKeywordSimple($id); + } + $result = tlDBObject::deleteObjectFromDB($this->db, $id, "tlKeyword"); + } + + if ($result >= self::OK && $this->auditCfg->logEnabled) { + + switch ($my['opt']['context']) { + case 'getTestProjectName': + $dummy = $this->get_by_id($my['opt']['tproject_id'], + array( + 'output' => 'name' + )); + $my['opt']['context'] = $dummy['name']; + break; + } + + logAuditEvent( + TLS("audit_keyword_deleted", $keyword, $my['opt']['context']), + "DELETE", $id, "keywords"); + } + return $result; + } + + /** + * delete Keywords + */ + public function deleteKeywords($tproject_id, $tproject_name = null) + { + $result = self::OK; + + $itemSet = (array) $this->getKeywordSet($tproject_id); + $kwIDs = array_keys($itemSet); + + $opt = array( + 'checkBeforeDelete' => false, + 'context' => $tproject_name + ); + + $loop2do = count($kwIDs); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $opt['nameForAudit'] = $itemSet[$kwIDs[$idx]]['keyword']; + + $resultKw = $this->deleteKeyword($kwIDs[$idx], $opt); + if ($resultKw != self::OK) { + $result = $resultKw; + } + } + return $result; + } + + /** + */ + protected function getKeywordIDsFor($testproject_id) + { + $query = " SELECT id FROM {$this->tables['keywords']} " . + " WHERE testproject_id = {$testproject_id}" . " ORDER BY keyword ASC"; + return $this->db->fetchColumnsIntoArray($query, 'id'); + } + + /** + */ + public function getKeywordSet($tproject_id) + { + $sql = " SELECT id,keyword FROM {$this->tables['keywords']} " . + " WHERE testproject_id = {$tproject_id}" . " ORDER BY keyword ASC"; + + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + public function hasKeywords($id) + { + // seems that postgres PHP driver do not manage well UPPERCASE in AS CLAUSE + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT COUNT(0) AS qty FROM {$this->tables['keywords']} " . + " WHERE testproject_id = " . intval($id); + $rs = $this->db->get_recordset($sql); + + return (is_null($rs) || $rs[0]['qty'] == 0) ? false : true; + } + + /** + * Exports the given keywords to a XML file + * + * @return string the generated XML Code + */ + public function exportKeywordsToXML($testproject_id, $bNoXMLHeader = false) + { + $kwIDs = $this->getKeywordIDsFor($testproject_id); + $xmlCode = ''; + if (! $bNoXMLHeader) { + $xmlCode .= TL_XMLEXPORT_HEADER . "\n"; + } + $xmlCode .= ""; + for ($idx = 0; $idx < count($kwIDs); $idx ++) { + $keyword = new tlKeyword($kwIDs[$idx]); + $keyword->readFromDb($this->db); + $keyword->writeToXML($xmlCode, true); + } + $xmlCode .= ""; + + return $xmlCode; + } + + /** + * Exports the given keywords to CSV + * + * @return string the generated CSV code + */ + private function exportKeywordsToCSV($testproject_id, $delim = ';') + { + $kwIDs = $this->getKeywordIDsFor($testproject_id); + $csv = null; + for ($idx = 0; $idx < count($kwIDs); $idx ++) { + $keyword = new tlKeyword($kwIDs[$idx]); + $keyword->readFromDb($this->db); + $keyword->writeToCSV($csv, $delim); + } + return $csv; + } + + public function importKeywordsFromCSV($testproject_id, $fileName, + $delim = ';') + { + $handle = fopen($fileName, "r"); + if ($handle) { + while ($data = fgetcsv($handle, TL_IMPORT_ROW_MAX, $delim)) { + $kw = new tlKeyword(); + $kw->initialize(null, $testproject_id, null, null); + if ($kw->readFromCSV(implode($delim, $data)) >= self::OK && + $kw->writeToDB($this->db) >= self::OK) { + logAuditEvent(TLS("audit_keyword_created", $kw->name), + "CREATE", $kw->dbID, "keywords"); + } + } + fclose($handle); + return self::OK; + } else { + return self::ERROR; + } + } + + /** + * + * @param + * $testproject_id + * @param + * $fileName + */ + public function importKeywordsFromXMLFile($testproject_id, $fileName) + { + $simpleXMLObj = @$this->simplexmlLoadFileHelper($fileName); + return $this->importKeywordsFromSimpleXML($testproject_id, $simpleXMLObj); + } + + /** + * + * @param + * $testproject_id + * @param + * $xmlString + */ + public function importKeywordsFromXML($testproject_id, $xmlString) + { + $simpleXMLObj = simplexml_load_string($xmlString); + return $this->importKeywordsFromSimpleXML($testproject_id, $simpleXMLObj); + } + + /** + * + * @param + * $testproject_id + * @param + * $simpleXMLObj + */ + public function importKeywordsFromSimpleXML($testproject_id, $simpleXMLObj) + { + $status = self::OK; + if (! $simpleXMLObj || $simpleXMLObj->getName() != 'keywords') { + $status = tlKeyword::E_WRONGFORMAT; + } + + if (($status == self::OK) && $simpleXMLObj->keyword) { + foreach ($simpleXMLObj->keyword as $keyword) { + $kw = new tlKeyword(); + $kw->initialize(null, $testproject_id, null, null); + $status = tlKeyword::E_WRONGFORMAT; + if ($kw->readFromSimpleXML($keyword) >= self::OK) { + $status = self::OK; + if ($kw->writeToDB($this->db) >= self::OK) { + logAuditEvent(TLS("audit_keyword_created", $kw->name), + "CREATE", $kw->dbID, "keywords"); + } + } + } + } + return $status; + } + + /** + * Returns all testproject keywords + * + * @param integer $testproject_id + * the ID of the testproject + * @return array map: key: keyword_id, value: keyword + */ + public function get_keywords_map($testproject_id) + { + $keywordMap = null; + $keywords = $this->getKeywords($testproject_id); + if ($keywords) { + foreach ($keywords as $kw) { + $keywordMap[$kw->dbID] = $kw->name; + } + } + return $keywordMap; + } + + /** + * Returns keywords that are linked to test cases + * + * @param integer $id + * testproject + * @return array map: key: keyword_id, value: keyword + */ + public function getUsedKeywordsMap($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ + SELECT DISTINCT KW.id,KW.keyword + FROM {$this->tables['keywords']} KW + JOIN {$this->tables['testcase_keywords']} TCKW + ON TCKW.keyword_id = KW.id + WHERE KW.testproject_id =" . intval($id); + $sql .= " ORDER BY keyword"; + return $this->db->fetchColumnsIntoMap($sql, 'id', 'keyword'); + } + + /* END KEYWORDS RELATED */ + + /* REQUIREMENTS RELATED */ + /** + * get list of all SRS for a test project, no distinction between levels + * + * + * @used-by lib/results/uncoveredTestCases.php + * lib/requirements/reqTcAssign.php + * lib/requirements/reqSpecSearchForm.php + * lib/requirements/reqSearchForm.php + * + * @author Martin Havlat + * @return array List of titles according to IDs + * + * @internal revisions + * + */ + public function getOptionReqSpec($tproject_id, + $get_not_empty = self::GET_EMPTY_REQSPEC) + { + $additional_table = ''; + $additional_join = ''; + if ($get_not_empty) { + $additional_table = ", {$this->tables['requirements']} REQ "; + $additional_join = " AND SRS.id = REQ.srs_id "; + } + $sql = " SELECT SRS.id,NH.name AS title " . + " FROM {$this->tables['req_specs']} SRS, " . + " {$this->tables['nodes_hierarchy']} NH " . $additional_table . + " WHERE testproject_id={$tproject_id} " . " AND SRS.id=NH.id " . + $additional_join . " ORDER BY title"; + return $this->db->fetchColumnsIntoMap($sql, 'id', 'title'); + // return $this->db->fetchRowsIntoMap($sql,'id'); SRS.doc_id, + } + + /** + * + * @author Francisco Mancardi - francisco.mancardi@gmail.com + * + * @todo check who uses it, is duplicated of getOptionReqSpec? + * + * @used-by lib/results/uncoveredTestCases.php + * lib/requirements/reqTcAssign.php + * lib/requirements/reqSpecSearchForm.php + * lib/requirements/reqSearchForm.php + * + * @internal revisions + * + * + */ + public function genComboReqSpec($id, $mode = 'dotted', $dot = '.') + { + $ret = array(); + $exclude_node_types = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me', + 'requirement_spec_revision' => 'exclude_me' + ); + + $my['filters'] = array( + 'exclude_node_types' => $exclude_node_types + ); + + $my['options'] = array( + 'order_cfg' => array( + 'type' => 'rspec' + ), + 'output' => 'rspec' + ); + $subtree = $this->tree_manager->get_subtree($id, $my['filters'], + $my['options']); + if (count($subtree)) { + $ret = $this->_createHierarchyMap($subtree, $mode, $dot, 'doc_id'); + } + return $ret; + } + + /* + * + * [$mode]: dotted -> $level number of dot characters are appended to + * the left of item name to create an indent effect. + * Level indicates on what tree layer item is positioned. + * Example: + * + * null + * \ + * id=1 <--- Tree Root = Level 0 + * | + * + ------+ + * / \ \ + * id=9 id=2 id=8 <----- Level 1 + * \ + * id=3 <----- Level 2 + * \ + * id=4 <----- Level 3 + * + * + * key: item id (= node id on tree). + * value: every array element is an string, containing item name. + * + * Result example: + * + * 2 .TS1 + * 3 ..TS2 + * 9 .20071014-16:22:07 TS1 + * 10 ..TS2 + * + * + * array -> key: item id (= node id on tree). + * value: every array element is a map with the following keys + * 'name', 'level' + * + * 2 array(name => 'TS1',level => 1) + * 3 array(name => 'TS2',level => 2) + * 9 array(name => '20071014-16:22:07 TS1',level =>1) + * 10 array(name => 'TS2', level => 2) + * + */ + protected function _createHierarchyMap($array2map, $mode = 'dotted', + $dot = '.', $addfield = null) + { + $hmap = array(); + $the_level = 1; + $level = array(); + $pivot = $array2map[0]; + + $addprefix = ! is_null($addfield); + foreach ($array2map as $elem) { + $current = $elem; + + if ($pivot['id'] == $current['parent_id']) { + $the_level ++; + $level[$current['parent_id']] = $the_level; + } elseif ($pivot['parent_id'] != $current['parent_id']) { + $the_level = $level[$current['parent_id']]; + } + + switch ($mode) { + case 'dotted': + $dm = $addprefix ? "[{$current[$addfield]}] - " : ''; + $pding = ($the_level == 1) ? 0 : $the_level + 1; + $hmap[$current['id']] = str_repeat($dot, $pding) . $dm . + $current['name']; + break; + + case 'array': + $hmap[$current['id']] = array( + 'name' => $current['name'], + 'level' => $the_level + ); + break; + } + + // update pivot + $level[$current['parent_id']] = $the_level; + $pivot = $elem; + } + + return $hmap; + } + + /** + * collect information about current list of Requirements Specification + * + * @param integer $testproject_id + * @param string $id + * optional id of the requirement specification + * + * @return mixed null if no srs exits, or no srs exists for id + * array, where each element is a map with SRS data. + * + * map keys: + * id + * testproject_id + * title + * scope + * total_req + * type + * author_id + * creation_ts + * modifier_id + * modification_ts + * + * @author Martin Havlat + * @internal revisions + * + */ + public function getReqSpec($testproject_id, $id = null, $fields = null, + $access_key = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $fields2get = " RSPEC.id, RSPEC.testproject_id, RSPECREV.scope, RSPECREV.doc_id," . + " RSPECREV.total_req, RSPECREV.type, RSPECREV.author_id, RSPECREV.creation_ts, " . + " RSPECREV.modifier_id, RSPECREV.modification_ts, RSPECREV.name AS title, NH.parent_id"; + + $fields = is_null($fields) ? $fields2get : implode(',', $fields); + $sql = " /* $debugMsg */ " . + " SELECT {$fields} FROM {$this->tables['req_specs_revisions']} RSPECREV, " . + " {$this->tables['req_specs']} RSPEC, {$this->tables['nodes_hierarchy']} NH, " . + " {$this->tables['requirements']} REQ " . + " WHERE RSPECREV.parent_id=RSPEC.id " . + " AND NH.id=RSPEC.id AND REQ.srs_id = RSPEC.id " . + " AND RSPEC.testproject_id={$testproject_id} "; + + if (! is_null($id)) { + $sql .= " AND RSPEC.id=" . $id; + } + + $sql .= " GROUP BY RSPEC.id"; + $sql .= " ORDER BY RSPEC.id,title"; + + return is_null($access_key) ? $this->db->get_recordset($sql) : $this->db->fetchRowsIntoMap( + $sql, $access_key); + } + + /** + * create a new System Requirements Specification + * + * @param string $title + * @param string $scope + * @param string $countReq + * @param int $testproject_id + * @param int $user_id + * @param string $type + * + * @author Martin Havlat + * + * rev: 20071106 - franciscom - changed return type + */ + private function createReqSpec($testproject_id, $title, $scope, $countReq, + $user_id, $type = 'n') + { + $ignore_case = 1; + $result = array(); + + $result['status_ok'] = 0; + $result['msg'] = 'ko'; + $result['id'] = 0; + + $title = trim($title); + + $chk = $this->check_srs_title($testproject_id, $title, $ignore_case); + if ($chk['status_ok']) { + $sql = "INSERT INTO {$this->tables['req_specs']} " . + " (testproject_id, title, scope, type, total_req, author_id, creation_ts) + VALUES (" . $testproject_id . ",'" . + $this->db->prepare_string($title) . "','" . + $this->db->prepare_string($scope) . "','" . + $this->db->prepare_string($type) . "','" . + $this->db->prepare_string($countReq) . "'," . + $this->db->prepare_string($user_id) . ", " . $this->db->db_now() . + ")"; + + if (! $this->db->exec_query($sql)) { + $result['msg'] = lang_get('error_creating_req_spec'); + } else { + $result['id'] = $this->db->insert_id($this->tables['req_specs']); + $result['status_ok'] = 1; + $result['msg'] = 'ok'; + } + } else { + $result['msg'] = $chk['msg']; + } + return $result; + } + + /* + * function: get_srs_by_title + * get srs information using title as access key. + * + * args : tesproject_id + * title: srs title + * [ignore_case]: control case sensitive search. + * default 0 -> case sensivite search + * + * returns: map. + * key: srs id + * value: srs info, map with folowing keys: + * id + * testproject_id + * title + * scope + * total_req + * type + * author_id + * creation_ts + * modifier_id + * modification_ts + */ + public function get_srs_by_title($testproject_id, $title, $ignore_case = 0) + { + $title = trim($title); + + $sql = "SELECT * FROM req_specs "; + + if ($ignore_case) { + $sql .= " WHERE UPPER(title)='" . + strtoupper($this->db->prepare_string($title)) . "'"; + } else { + $sql .= " WHERE title='" . $this->db->prepare_string($title) . "'"; + } + $sql .= " AND testproject_id={$testproject_id}"; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /* + * function: check_srs_title + * Do checks on srs title, to understand if can be used. + * + * Checks: + * 1. title is empty ? + * 2. does already exist a srs with this title? + * + * args : tesproject_id + * title: srs title + * [ignore_case]: control case sensitive search. + * default 0 -> case sensivite search + * + * returns: + * + */ + public function check_srs_title($testproject_id, $title, $ignore_case = 0) + { + $ret['status_ok'] = 1; + $ret['msg'] = ''; + + $title = trim($title); + + if ($title == "") { + $ret['status_ok'] = 0; + $ret['msg'] = lang_get("warning_empty_req_title"); + } + + if ($ret['status_ok']) { + $ret['msg'] = 'ok'; + $rs = $this->get_srs_by_title($testproject_id, $title, $ignore_case); + + if (! is_null($rs)) { + $ret['msg'] = lang_get("warning_duplicate_req_title"); + $ret['status_ok'] = 0; + } + } + return $ret; + } + + /* END REQUIREMENT RELATED */ + // ---------------------------------------------------------------------------------------- + + /** + * Deletes all testproject related role assignments for a given testproject + * + * @param integer $tproject_id + * @return integer self::OK on success, self::ERROR else + */ + public function deleteUserRoles($tproject_id, $users = null, $opt = null) + { + $my['opt'] = array( + 'auditlog' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + $query = " DELETE FROM {$this->tables['user_testproject_roles']} " . + " WHERE testproject_id = " . intval($tproject_id); + + if (! is_null($users)) { + $query .= " AND user_id IN(" . implode(',', $users) . ")"; + } + + if ($this->db->exec_query($query) && $my['opt']['auditlog']) { + $testProject = $this->get_by_id($tproject_id); + + if ($testProject) { + if (is_null($users)) { + logAuditEvent( + TLS("audit_all_user_roles_removed_testproject", + $testProject['name']), "ASSIGN", $tproject_id, + "testprojects"); + } else { + // TBD + } + } + return self::OK; + } + + return self::ERROR; + } + + /** + * Gets all testproject related role assignments + * + * @param integer $tproject_id + * @return array assoc array with keys take from the user_id column + */ + private function getUserRoleIDs($tproject_id) + { + $query = "SELECT user_id,role_id FROM {$this->tables['user_testproject_roles']} " . + "WHERE testproject_id = {$tproject_id}"; + return $this->db->fetchRowsIntoMap($query, 'user_id'); + } + + /** + * Inserts a testproject related role for a given user + * + * @param integer $userID + * the id of the user + * @param integer $tproject_id + * @param integer $roleID + * the role id + * + * @return integer self::OK on success, self::ERROR else + */ + public function addUserRole($userID, $tproject_id, $roleID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $query = "/* $debugMsg */ INSERT INTO {$this->tables['user_testproject_roles']} " . + " (user_id,testproject_id,role_id) VALUES ({$userID},{$tproject_id},{$roleID})"; + if ($this->db->exec_query($query)) { + $testProject = $this->get_by_id($tproject_id); + $role = tlRole::getByID($this->db, $roleID, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + $user = tlUser::getByID($this->db, $userID, + tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); + if ($user && $testProject && $role) { + logAuditEvent( + TLS("audit_users_roles_added_testproject", + $user->getDisplayName(), $testProject['name'], + $role->name), "ASSIGN", $tproject_id, "testprojects"); + } + unset($user); + unset($role); + unset($testProject); + return self::OK; + } + return self::ERROR; + } + + /** + * delete test project from system, deleting all dependent data: + * keywords, requirements, custom fields, testsuites, testplans, + * testcases, results, testproject related roles, + * + * @param integer $id + * test project id + * @return integer status + * + */ + public function delete($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $ret['msg'] = 'ok'; + $ret['status_ok'] = 1; + + $error = ''; + $reqspec_mgr = new requirement_spec_mgr($this->db); + + // get some info for audit + $info['name'] = ''; + if ($this->auditCfg->logEnabled) { + $info = $this->tree_manager->get_node_hierarchy_info($id); + $event = new stdClass(); + $event->message = TLS("audit_testproject_deleted", $info['name']); + $event->objectID = $id; + $event->objectType = 'testprojects'; + $event->source = $this->auditCfg->eventSource; + $event->logLevel = 'AUDIT'; + $event->code = 'DELETE'; + } + + // + // Notes on delete related to Foreing Keys + // All link tables has to be deleted first + // + // req_relations + // + // testplan_tcversions + // testplan_platforms + // object_keywords + // user_assignments + // builds + // milestones + // + // testplans + // keywords + // platforms + // attachtments + // testcases + // testsuites + // inventory + // + // testproject + $this->deleteKeywords($id, $info['name']); + $this->deleteAttachments($id); + + $reqSpecSet = $reqspec_mgr->get_all_id_in_testproject($id); + if (! empty($reqSpecSet)) { + foreach ($reqSpecSet as $reqSpec) { + $reqspec_mgr->delete_deep($reqSpec['id']); + } + } + + $tplanSet = $this->get_all_testplans($id); + if (! is_null($tplanSet) && count($tplanSet) > 0) { + $tplan_mgr = new testplan($this->db); + $items = array_keys($tplanSet); + foreach ($items as $key) { + $tplan_mgr->delete($key); + } + } + + $platform_mgr = new tlPlatform($this->db, $id); + $platform_mgr->deleteByTestProject($id); + + $a_sql[] = array( + "/* $debugMsg */ UPDATE {$this->tables['users']} " . + " SET default_testproject_id = NULL " . + " WHERE default_testproject_id = {$id}", + 'info_resetting_default_project_fails' + ); + + $inventory_mgr = new tlInventory($id, $this->db); + $invOpt = array( + 'detailLevel' => 'minimun', + 'accessKey' => 'id' + ); + $inventorySet = $inventory_mgr->getAll($invOpt); + if (! is_null($inventorySet)) { + foreach ($inventorySet as $key => $dummy) { + $inventory_mgr->deleteInventory($key); + } + } + + foreach ($a_sql as $oneSQL) { + if (empty($error)) { + $sql = $oneSQL[0]; + $result = $this->db->exec_query($sql); + if (! $result) { + $error .= lang_get($oneSQL[1]); + } + } + } + + if ($this->deleteUserRoles($id) < self::OK) { + $error .= lang_get('info_deleting_project_roles_fails'); + } + + $xSQL = array( + 'testproject_issuetracker', + 'testproject_codetracker', + 'testproject_reqmgrsystem' + ); + foreach ($xSQL as $target) { + $sql = "/* $debugMsg */ DELETE FROM " . $this->tables[$target] . + " WHERE testproject_id = " . intval($id); + $this->db->exec_query($sql); + } + + // --------------------------------------------------------------------------------------- + // delete product itself and items directly related to it like: + // custom fields assignments + // custom fields values ( right now we are not using custom fields on test projects) + // attachments + if (empty($error)) { + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['cfield_testprojects']} WHERE testproject_id = {$id} "; + $this->db->exec_query($sql); + + $sql = "/* $debugMsg */ DELETE FROM {$this->object_table} WHERE id = {$id}"; + + $result = $this->db->exec_query($sql); + if ($result) { + $tproject_id_on_session = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : $id; + if ($id == $tproject_id_on_session) { + $this->setSessionProject(null); + } + } else { + $error .= lang_get('info_product_delete_fails'); + } + } + + if (empty($error)) { + // Delete test project with requirements defined crashed with memory exhausted + $this->tree_manager->delete_subtree_objects($id, $id, '', + array( + 'testcase' => 'exclude_tcversion_nodes' + )); + $sql = "/* $debugMsg */ " . + " DELETE FROM {$this->tables['nodes_hierarchy']} " . + " WHERE id = {$id} AND node_type_id=" . + $this->tree_manager->node_descr_id['testproject']; + + $this->db->exec_query($sql); + + if ($this->auditCfg->logEnabled) { + logEvent($event); + } + } + + if (! empty($error)) { + $ret['msg'] = $error; + $ret['status_ok'] = 0; + } + + return $ret; + } + + /* + * function: get_all_testcases_id + * All testproject testcases node id. + * + * args :idList: comma-separated list of IDs (should be the projectID, but could + * also be an arbitrary suiteID + * + * returns: array with testcases node id in parameter tcIDs. + * null is nothing found + * + */ + public function get_all_testcases_id($idList, &$tcIDs, $options = null) + { + static $tcNodeTypeID; + static $tsuiteNodeTypeID; + static $debugMsg; + if (! $tcNodeTypeID) { + $debugMsg = $this->debugMsg . __FUNCTION__; + $tcNodeTypeID = $this->tree_manager->node_descr_id['testcase']; + $tsuiteNodeTypeID = $this->tree_manager->node_descr_id['testsuite']; + } + + $my = array(); + $my['options'] = array( + 'output' => 'just_id' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + switch ($my['options']['output']) { + case 'external_id': + $use_array = true; + break; + + case 'just_id': + default: + $use_array = false; + break; + } + + $sql = "/* $debugMsg */ SELECT id,node_type_id from {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id IN ({$idList})"; + $sql .= " AND node_type_id IN ({$tcNodeTypeID},{$tsuiteNodeTypeID}) "; + + $result = $this->db->exec_query($sql); + if ($result) { + $suiteIDs = array(); + while ($row = $this->db->fetch_array($result)) { + if ($row['node_type_id'] == $tcNodeTypeID) { + if ($use_array) { + $sql = " SELECT DISTINCT NH.parent_id, TCV.tc_external_id " . + " FROM {$this->tables['nodes_hierarchy']} NH " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NH.id " . + " WHERE NH.parent_id = {$row['id']} "; + + $rs = $this->db->fetchRowsIntoMap($sql, 'parent_id'); + $tcIDs[$row['id']] = $rs[$row['id']]['tc_external_id']; + } else { + $tcIDs[] = $row['id']; + } + } else { + $suiteIDs[] = $row['id']; + } + } + if (count($suiteIDs)) { + $suiteIDs = implode(",", $suiteIDs); + $this->get_all_testcases_id($suiteIDs, $tcIDs, $options); + } + } + } + + /* + * function: DEPRECATED_get_keywords_tcases + * testproject keywords (with related testcase node id), + * that are used on testcases. + * + * args :testproject_id + * [keyword_id]= 0 -> no filter + * <> 0 -> look only for this keyword + * can be an array. + * + * + * + * returns: map: key: testcase_id + * value: map + * key: keyword_id + * value: testcase_id,keyword_id,keyword + * + * Example: + * [24] => Array ( [3] => Array( [testcase_id] => 24 + * [keyword_id] => 3 + * [keyword] => MaxFactor ) + * + * [2] => Array( [testcase_id] => 24 + * [keyword_id] => 2 + * [keyword] => Terminator ) ) + * + * @internal revisions: + * 20100929 - asimon - BUGID 3814: fixed keyword filtering with "and" selected as type + */ + private function DEPRECATED_get_keywords_tcases($testproject_id, + $keyword_id = 0, $keyword_filter_type = 'Or') + { + $keyword_filter = ''; + $subquery = ''; + + if (is_array($keyword_id)) { + $keyword_filter = " AND keyword_id IN (" . implode(',', $keyword_id) . + ")"; + if ($keyword_filter_type == 'And') { + $subquery = "AND testcase_id IN (" . + " SELECT FOXDOG.testcase_id FROM + ( SELECT COUNT(testcase_id) AS HITS,testcase_id + FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} + WHERE keyword_id = K.id + AND testproject_id = {$testproject_id} + {$keyword_filter} + GROUP BY testcase_id ) AS FOXDOG " . + " WHERE FOXDOG.HITS=" . count($keyword_id) . ")"; + + $keyword_filter = ''; + } + } elseif ($keyword_id > 0) { + $keyword_filter = " AND keyword_id = {$keyword_id} "; + } + + $sql = " SELECT testcase_id,keyword_id,keyword + FROM {$this->tables['keywords']} K, {$this->tables['testcase_keywords']} + WHERE keyword_id = K.id + AND testproject_id = {$testproject_id} + {$keyword_filter} {$subquery} + ORDER BY keyword ASC "; + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', 'keyword_id'); + } + + /** + */ + public function getKeywordsLatestTCV($tproject_id, $keyword_id = 0, + $kwFilterType = 'Or') + { + $kwFilter = ''; + $subquery = ''; + $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV + ON LTCV.tcversion_id = TK.tcversion_id "; + + if (is_array($keyword_id)) { + $kwFilter = " AND keyword_id IN (" . implode(',', $keyword_id) . ")"; + if ($kwFilterType == 'And') { + $ltcvJoin = " "; + $sqlCount = " /* SQL COUNT */ " . + " SELECT COUNT(TK.tcversion_id) AS HITS,TK.tcversion_id + FROM {$this->tables['keywords']} K + JOIN {$this->tables['testcase_keywords']} TK + ON keyword_id = K.id -/** - * - * -1 => WITHOUT KEYWORDS - * - */ -function getTCLatestVersionFilteredByKeywords($tproject_id, $keyword_id=0, $keyword_filter_type='Or') { - $keySet = (array)$keyword_id; - $sql = null; - $tcaseSet = array(); - $delTT = false; - $hasTCases = false; + JOIN {$this->views['latest_tcase_version_id']} LTCV + ON LTCV.tcversion_id = TK.tcversion_id - // -1 => WITHOUT KEYWORDS - $getWithOutKeywords = in_array(-1,$keySet); - if( $getWithOutKeywords || $keyword_filter_type == 'NotLinked') { + WHERE testproject_id = {$tproject_id} + {$kwFilter} + GROUP BY TK.tcversion_id "; + + $subquery = " AND tcversion_id IN (" . + " SELECT FOXDOG.tcversion_id FROM + ( $sqlCount ) AS FOXDOG " . " WHERE FOXDOG.HITS=" . + count($keyword_id) . ")"; + $kwFilter = ''; + } + } elseif ($keyword_id > 0) { + $kwFilter = " AND keyword_id = {$keyword_id} "; + } + + $sql = " SELECT TK.testcase_id,TK.keyword_id,K.keyword + FROM {$this->tables['keywords']} K + JOIN {$this->tables['testcase_keywords']} TK + ON TK.keyword_id = K.id + {$ltcvJoin} + WHERE K.testproject_id = {$tproject_id} + {$kwFilter} {$subquery} + ORDER BY keyword ASC "; + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', 'keyword_id'); + } + + /** + * + * 20200117 + * it seems I've duplicated code + * designed to be used by + * + * @used-by specview.php + */ + private function XXXgetPlatformsLatestTCV($tproject_id, $platform_id = 0, + $filterType = 'Or') + { + $platFilter = ''; + $subquery = ''; + $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV + ON LTCV.tcversion_id = TK.tcversion_id "; + + if (is_array($platform_id)) { + $platFilter = " AND platform_id IN (" . implode(',', $platform_id) . + ")"; + if ($filterType == 'And') { + $ltcvJoin = " "; + $sqlCount = " /* SQL COUNT */ " . + " SELECT COUNT(TK.tcversion_id) AS HITS,TPL.tcversion_id + FROM {$this->tables['platforms']} K + JOIN {$this->tables['testcase_platforms']} TPL + ON platform_id = PL.id - $this->get_all_testcases_id($tproject_id,$tcaseSet); - if( ($hasTCases = count($tcaseSet) > 0) ) { - $delTT = true; - $tt = 'temp_tcset_' . $tproject_id . md5(microtime()); - $sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tt AS - ( SELECT id FROM {$this->tables['nodes_hierarchy']} - LIMIT 0 )"; - $this->db->exec_query($sql); - $a4ins = array_chunk($tcaseSet, 2000); // MAGIC - foreach($a4ins as $chu) { - $sql = "INSERT INTO $tt (id) VALUES (" . - implode('),(',$chu) . ")"; - $this->db->exec_query($sql); - } - } - } + JOIN {$this->views['latest_tcase_version_id']} LTCV + ON LTCV.tcversion_id = TPL.tcversion_id - if( $getWithOutKeywords && $hasTCases) { - $sql = " /* WITHOUT KEYWORDS */ + WHERE testproject_id = {$tproject_id} + {$platFilter} + GROUP BY TPL.tcversion_id "; + + $subquery = " AND tcversion_id IN (" . + " SELECT FOXDOG.tcversion_id FROM + ( $sqlCount ) AS FOXDOG " . " WHERE FOXDOG.HITS=" . + count($platform_id) . ")"; + $platFilter = ''; + } + } elseif ($platform_id > 0) { + $platFilter = " AND platform_id = {$platform_id} "; + } + + $sql = " SELECT TPL.testcase_id,TPL.keyword_id,PL.name + FROM {$this->tables['platforms']} K + JOIN {$this->tables['testcase_platforms']} TPL + ON TPL.platforms = PL.id + {$ltcvJoin} + WHERE PL.testproject_id = {$tproject_id} + {$platFilter} {$subquery} + ORDER BY name ASC "; + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', 'platform_id'); + } + + /* + * function: get_all_testplans + * + * args : $testproject_id + * + * [$filters]: optional map, with optional keys + * [$get_tp_without_tproject_id] + * used just for backward compatibility (TL 1.5) + * default: 0 -> 1.6 and up behaviour + * + * [$plan_status] + * default: null -> no filter on test plan status + * 1 -> active test plans + * 0 -> inactive test plans + * + * [$exclude_tplans]: null -> do not apply exclusion + * id -> test plan id to exclude + * + * [options]: + * + * returns: + * + */ + public function get_all_testplans($id, $filters = null, $options = null) + { + $my['options'] = array( + 'fields2get' => 'NH.id,NH.name,notes,active, + is_public,testproject_id,api_key', + 'outputType' => null + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $forHMLSelect = false; + if (! is_null($my['options']['outputType']) && + $my['options']['outputType'] == 'forHMLSelect') { + $forHMLSelect = true; + $my['options']['fields2get'] = 'NH.id,NH.name'; + } + + $sql = " SELECT {$my['options']['fields2get']} " . + " FROM {$this->tables['nodes_hierarchy']} NH,{$this->tables['testplans']} TPLAN"; + + $where = " WHERE NH.id=TPLAN.id AND (testproject_id = " . + $this->db->prepare_int($id) . " "; + if (! is_null($filters)) { + $key2check = array( + 'get_tp_without_tproject_id' => 0, + 'plan_status' => null, + 'tplan2exclude' => null + ); + + foreach ($key2check as $varname => $defValue) { + $$varname = isset($filters[$varname]) ? $filters[$varname] : $defValue; + } + + $where .= " ) "; + + if (! is_null($plan_status)) { + $my_active = to_boolean($plan_status); + $where .= " AND active = " . $my_active; + } + + if (! is_null($tplan2exclude)) { + $where .= " AND TPLAN.id != {$tplan2exclude} "; + } + } else { + $where .= ")"; + } + + $sql .= $where . " ORDER BY name"; + if ($forHMLSelect) { + $map = $this->db->fetchColumnsIntoMap($sql, 'id', 'name'); + } else { + $map = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + return $map; + } + + /* + * function: check_tplan_name_existence + * + * args : + * tproject_id: + * tplan_id: + * [case_sensitive]: 1-> do case sensitive search + * default: 0 + * + * returns: 1 -> tplan name exists + * + * + */ + public function check_tplan_name_existence($tproject_id, $tplan_name, + $case_sensitive = 0) + { + $sql = " SELECT NH.id, NH.name, testproject_id " . + " FROM {$this->tables['nodes_hierarchy']} NH, {$this->tables['testplans']} testplans " . + " WHERE NH.id=testplans.id " . + " AND testproject_id = {$tproject_id} "; + + if ($case_sensitive) { + $sql .= " AND NH.name="; + } else { + $tplan_name = strtoupper($tplan_name); + $sql .= " AND UPPER(NH.name)="; + } + $sql .= "'" . $this->db->prepare_string($tplan_name) . "'"; + $result = $this->db->exec_query($sql); + return $this->db->num_rows($result) ? 1 : 0; + } + + /* + * function: gen_combo_first_level_test_suites + * create array with test suite names + * + * args : id: testproject_id + * [mode] + * + * returns: + * array, every element is a map + * + * rev : + * 20070219 - franciscom + * fixed bug when there are no children + * + */ + public function get_first_level_test_suites($tproject_id, $mode = 'simple', + $opt = null) + { + $fl = $this->tree_manager->get_children($tproject_id, + array( + 'testcase', + 'exclude_me', + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me' + ), $opt); + switch ($mode) { + case 'simple': + break; + + case 'smarty_html_options': + if (! empty($fl)) { + foreach ($fl as $map) { + $dummy[$map['id']] = $map['name']; + } + $fl = null; + $fl = $dummy; + } + break; + } + return $fl; + } + + /** + * getTCasesLinkedToAnyTPlan + * + * for target test project id ($id) get test case id of + * every test case that has been assigned at least to one of all test plans + * belonging to test project. + * + * @param int $id + * test project id + * + */ + private function getTCasesLinkedToAnyTPlan($id) + { + $tplanNodeType = $this->tree_manager->node_descr_id['testplan']; + + // len of lines must be <= 100/110 as stated on development standard guide. + $sql = " SELECT DISTINCT NHTCV.parent_id AS testcase_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV " . + " ON NHTCV.id = TPTCV.tcversion_id "; + + // get testplan id for target test�project, to get test case versions linked to testplan. + $sql .= " JOIN {$this->tables['nodes_hierarchy']} NHTPLAN " . + " ON TPTCV.testplan_id = NHTPLAN.id " . + " WHERE NHTPLAN.node_type_id = {$tplanNodeType} AND NHTPLAN.parent_id = " . + intval($id); + return $this->db->fetchRowsIntoMap($sql, 'testcase_id'); + } + + /** + * getFreeTestCases + * + * + * @param int $id + * test project id + * @param $options for + * future uses. + */ + public function getFreeTestCases($id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $retval['items'] = null; + $retval['allfree'] = false; + + $all = array(); + $this->get_all_testcases_id($id, $all); + $linked = array(); + $free = null; + if (! is_null($all)) { + $all = array_flip($all); + $linked = $this->getTCasesLinkedToAnyTPlan($id); + $retval['allfree'] = is_null($linked); + $free = $retval['allfree'] ? $all : array_diff_key($all, $linked); + } + + if (! empty($free)) { + $in_clause = implode(',', array_keys($free)); + $sql = " /* $debugMsg */ " . + " SELECT MAX(TCV.version) AS version, TCV.tc_external_id, " . + " TCV.importance AS importance, NHTCV.parent_id AS id, NHTC.name " . + " FROM {$this->tables['tcversions']} TCV " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TCV.id " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " WHERE NHTCV.parent_id IN ({$in_clause}) " . + " GROUP BY NHTC.name,NHTCV.parent_id,TCV.tc_external_id,TCV.importance " . + " ORDER BY NHTCV.parent_id"; + $retval['items'] = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + return $retval; + } + + // Custom field related methods + /* + * function: get_linked_custom_fields + * Get custom fields that has been linked to testproject. + * Search can be narrowed by: + * node type + * node id + * + * Important: + * custom fields id will be sorted based on the sequence number + * that can be specified at User Interface (UI) level, while + * linking is done. + * + * args : id: testproject id + * [node_type]: default: null -> no filter + * verbose string that identifies a node type. + * (see tree class, method get_available_node_types). + * Example: + * You want linked custom fields , but can be used + * only on testcase -> 'testcase'. + * + * returns: map. + * key: custom field id + * value: map (custom field definition) with following keys + * + * id (custom field id) + * name + * label + * type + * possible_values + * default_value + * valid_regexp + * length_min + * length_max + * show_on_design + * enable_on_design + * show_on_execution + * enable_on_execution + * display_order + * + * + */ + public function get_linked_custom_fields($id, $node_type = null, + $access_key = 'id') + { + $additional_table = ""; + $additional_join = ""; + + if (! is_null($node_type)) { + $hash_descr_id = $this->tree_manager->get_available_node_types(); + $node_type_id = $hash_descr_id[$node_type]; + + $additional_table = ",{$this->tables['cfield_node_types']} CFNT "; + $additional_join = " AND CFNT.field_id=CF.id AND CFNT.node_type_id={$node_type_id} "; + } + + $sql = "SELECT CF.*,CFTP.display_order " . + " FROM {$this->tables['custom_fields']} CF, {$this->tables['cfield_testprojects']} CFTP " . + $additional_table . " WHERE CF.id=CFTP.field_id " . + " AND CFTP.testproject_id={$id} " . $additional_join . + " ORDER BY CFTP.display_order"; + return $this->db->fetchRowsIntoMap($sql, $access_key); + } + + /* + * function: copy_as + * creates a new test project using an existent one as source. + * + * + * args: id: source testproject id + * new_id: destination + * [new_name]: default null. + * != null => set this as the new name + * + * [copy_options]: default null + * null: do a deep copy => copy following child elements: + * test plans + * builds + * linked tcversions + * milestones + * user_roles + * priorities, + * platforms + * execution assignment. + * + * != null, a map with keys that controls what child elements to copy + * + * + * returns: N/A + * + * + */ + public function copy_as($id, $new_id, $user_id, $new_name = null, + $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $my['options'] = array( + 'copy_requirements' => 1, + 'copyUserRoles' => 1, + 'copy_platforms' => 1 + ); + $my['options'] = array_merge($my['options'], (array) $options); + + // get source test project general info + $rs_source = $this->get_by_id($id); + + if (! is_null($new_name)) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} " . + "SET name='" . $this->db->prepare_string(trim($new_name)) . "' " . + "WHERE id={$new_id}"; + $this->db->exec_query($sql); + } + + // Copy elements that can be used by other elements + // Custom Field assignments + $this->copyCfieldsAssignments($id, $new_id); + + // Keywords + $oldNewMappings['keywords'] = $this->copyKeywords($id, $new_id); + + // Platforms + $oldNewMappings['platforms'] = $this->copyPlatforms($id, $new_id); + + // Requirements + if ($my['options']['copy_requirements']) { + list ($oldNewMappings['requirements'], $onReqSet) = $this->copyRequirements( + $id, $new_id, $user_id); + + // need to copy relations between requirements + $rel = null; + foreach ($oldNewMappings['requirements'] as $erek) { + foreach ($erek['req'] as $okey => $nkey) { + $sql = "/* $debugMsg */ SELECT id, source_id, destination_id," . + " relation_type, author_id, creation_ts " . + " FROM {$this->tables['req_relations']} " . + " WHERE source_id=$okey OR destination_id=$okey "; + $rel[$okey] = $this->db->get_recordset($sql); + } + } + + if (! is_null($rel)) { + $totti = $this->db->db_now(); + foreach ($rel as $ir) { + if (! is_null($ir)) { + foreach ($ir as $rval) { + if (isset($done[$rval['id']])) { + continue; + } + + $done[$rval['id']] = $rval['id']; + $sql = "/* $debugMsg */ + INSERT INTO {$this->tables['req_relations']} " . + " (source_id, destination_id, relation_type, author_id, creation_ts) " . + " values (" . $onReqSet[$rval['source_id']] . "," . + $onReqSet[$rval['destination_id']] . "," . + $rval['relation_type'] . "," . $rval['author_id'] . + "," . "$totti)"; + $this->db->exec_query($sql); + } + } + } + } + } + + // need to get subtree and create a new one + $filters = array(); + $filters['exclude_node_types'] = array( + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me' + ); + $filters['exclude_children_of'] = array( + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me', + 'testcase_step' => 'exclude_me' + ); + + $elements = $this->tree_manager->get_children($id, + $filters['exclude_node_types']); + + // Copy Test Specification + $item_mgr['testsuites'] = new testsuite($this->db); + $copyTSuiteOpt = array(); + $copyTSuiteOpt['preserve_external_id'] = true; + $copyTSuiteOpt['copyKeywords'] = 1; + + // Attention: + // copyRequirements really means copy requirement to testcase assignments + $copyTSuiteOpt['copyRequirements'] = $my['options']['copy_requirements']; + + $oldNewMappings['test_spec'] = array(); + foreach ($elements as $piece) { + $op = $item_mgr['testsuites']->copy_to($piece['id'], $new_id, + $user_id, $copyTSuiteOpt, $oldNewMappings); + $oldNewMappings['test_spec'] += $op['mappings']; + } + + // Copy Test Plans and all related information + $this->copyTestplans($id, $new_id, $user_id, $oldNewMappings); + + $this->copyUserRoles($id, $new_id); + + // need to understand if we need to change this and + // PRESERVE External Test case ID + // + // When copying a project, external TC ID is not preserved + // need to update external test case id numerator + $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . + " SET tc_counter = {$rs_source['tc_counter']} " . + " WHERE id = {$new_id}"; + $this->db->exec_query($sql); + } + + /** + * function to get an array with all requirement IDs in testproject + * + * @param string $idList + * commaseparated list of Container-IDs - can be testproject ID or reqspec IDs + * @return array $reqIDs result IDs + * + * @internal revisions: + * 20100310 - asimon - removed recursion logic + */ + public function get_all_requirement_ids($idList) + { + $coupleTypes = array(); + $coupleTypes['target'] = $this->tree_manager->node_descr_id['requirement']; + $coupleTypes['container'] = $this->tree_manager->node_descr_id['requirement_spec']; + + $reqIDs = array(); + $this->tree_manager->getAllItemsID($idList, $reqIDs, $coupleTypes); + + return $reqIDs; + } + + /** + * uses get_all_requirements_ids() to count all requirements in testproject + * + * @param integer $tp_id + * ID of testproject + * @return integer count of requirements in given testproject + */ + public function count_all_requirements($tp_id) + { + return count($this->get_all_requirement_ids($tp_id)); + } + + /** + * Copy user roles to a new Test Project + * + * @param int $source_id + * original Test Project identificator + * @param int $target_id + * new Test Project identificator + */ + private function copyUserRoles($source_id, $target_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = "/* $debugMsg */ SELECT * FROM {$this->tables['user_testproject_roles']} " . + "WHERE testproject_id={$source_id} "; + $rs = $this->db->get_recordset($sql); + + if (! is_null($rs)) { + foreach ($rs as $elem) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['user_testproject_roles']} " . + "(testproject_id,user_id,role_id) " . "VALUES({$target_id}," . + $elem['user_id'] . "," . $elem['role_id'] . ")"; + $this->db->exec_query($sql); + } + } + } + + /** + * Copy platforms + * + * @param int $source_id + * original Test Project identificator + * @param int $target_id + * new Test Project identificator + */ + private function copyPlatforms($source_id, $target_id) + { + $platform_mgr = new tlPlatform($this->db, $source_id); + $old_new = null; + + $platformSet = $platform_mgr->getAll(); + + if (! is_null($platformSet)) { + $platform_mgr->setTestProjectID($target_id); + foreach ($platformSet as $platform) { + $item = new stdClass(); + $item->name = $platform['name']; + $item->notes = (string) $platform['notes']; + $item->enable_on_design = intval($platform['enable_on_design']); + $item->enable_on_execution = intval( + $platform['enable_on_execution']); + + $op = $platform_mgr->create($item); + $old_new[$platform['id']] = $op['id']; + } + } + return $old_new; + } + + /** + * Copy platforms + * + * @param int $source_id + * original Test Project identificator + * @param int $target_id + * new Test Project identificator + */ + private function copyKeywords($source_id, $target_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $old_new = null; + $sql = "/* $debugMsg */ SELECT * FROM {$this->tables['keywords']} " . + " WHERE testproject_id = {$source_id}"; + + $itemSet = $this->db->fetchRowsIntoMap($sql, 'id'); + if (! is_null($itemSet)) { + foreach ($itemSet as $item) { + $op = $this->addKeyword($target_id, $item['keyword'], + $item['notes']); + $old_new[$item['id']] = $op['id']; + } + } + return $old_new; + } + + /** + */ + private function copyCfieldsAssignments($source_id, $target_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT field_id FROM {$this->tables['cfield_testprojects']} " . + " WHERE testproject_id = {$source_id}"; + $row_set = $this->db->fetchRowsIntoMap($sql, 'field_id'); + if (! is_null($row_set)) { + $cfield_set = array_keys($row_set); + $this->cfield_mgr->link_to_testproject($target_id, $cfield_set); + } + } + + /** + */ + private function copyTestplans($source_id, $target_id, $user_id, $mappings) + { + static $tplanMgr; + + $tplanSet = $this->get_all_testplans($source_id); + if (! is_null($tplanSet)) { + $keySet = array_keys($tplanSet); + if (is_null($tplanMgr)) { + $tplanMgr = new testplan($this->db); + } + + foreach ($keySet as $itemID) { + $new_id = $tplanMgr->create($tplanSet[$itemID]['name'], + $tplanSet[$itemID]['notes'], $target_id, + $tplanSet[$itemID]['active'], + $tplanSet[$itemID]['is_public']); + + if ($new_id > 0) { + // TICKET 5190: Copy Test projects - tester assignments to testplan+build are not copied + $tplanMgr->copy_as($itemID, $new_id, null, $target_id, + $user_id, array( + 'copy_assigned_to' => 1 + ), $mappings); + } + } + } + } + + /** + */ + private function copyRequirements($source_id, $target_id, $user_id) + { + $mappings = null; + $or = array(); + + // need to get subtree and create a new one + $filters = array(); + $filters['exclude_node_types'] = array( + 'testplan' => 'exclude', + 'testcase' => 'exclude', + 'testsuite' => 'exclude', + 'requirement' => 'exclude' + ); + + $elements = $this->tree_manager->get_children($source_id, + $filters['exclude_node_types']); + + if (! is_null($elements)) { + $mappings = array(); + $reqSpecMgr = new requirement_spec_mgr($this->db); + + // Development Note - 20110817 + // why we choose to do not copy testcase_assignments ? + // Because due to order used to copy different items, + // when we ask to copy requirements WE DO NOT HAVE + // TEST CASES on new test project. + // + $options = array( + 'copy_also' => array( + 'testcase_assignments' => false + ), + 'caller' => 'copy_testproject' + ); + + foreach ($elements as $piece) { + $op = $reqSpecMgr->copy_to($piece['id'], $target_id, $target_id, + $user_id, $options); + + $mappings[] = $op['mappings']; + $or += $op['mappings']['req']; + } + } + + return array( + $mappings, + $or + ); + } + + /** + * getTestSpec + * + * get structure with Test suites and Test Cases + * Filters that act on test cases work on attributes that are common to all + * test cases versions: test case name + * + * Development Note: + * Due to the tree structure is not so easy to try to do as much as filter as + * possibile using SQL. + * + * + * @param + * int id test project ID + * @param + * mixed filters + * @param + * mixed options + * recursive true/false changes output format + * testcase_name filter in LIKE %string%, if will be case sensitive or not + * will depend of DBMS. + * + * + */ + private function getTestSpec($id, $filters = null, $options = null) + { + $items = array(); + + $my['options'] = array( + 'recursive' => false, + 'exclude_testcases' => false, + 'remove_empty_branches' => false + ); + + $my['filters'] = array( + 'exclude_node_types' => $this->nt2exclude, + 'exclude_children_of' => $this->nt2exclude_children, + 'exclude_branches' => null, + 'testcase_name' => null, + 'importance' => null, + 'testcase_id' => null, + 'execution_type' => null, + 'status' => null, + 'keywords' => null, + 'additionalWhereClause' => null, + 'platforms' => null + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($my['options']['exclude_testcases']) { + $my['filters']['exclude_node_types']['testcase'] = 'exclude me'; + } + + // transform some of our options/filters on something the 'worker' will understand + // when user has request filter by test case name, we do not want to display empty branches + // If we have choose any type of filter, we need to force remove empty test suites + // TICKET 4217: added filter for importance + if (! is_null($my['filters']['testcase_name']) || + ! is_null($my['filters']['testcase_id']) || + ! is_null($my['filters']['execution_type']) || + ! is_null($my['filters']['exclude_branches']) || + ! is_null($my['filters']['importance']) || + $my['options']['remove_empty_branches']) { + $my['options']['remove_empty_nodes_of_type'] = 'testsuite'; + } + + $method2call = $my['options']['recursive'] ? 'getSubtreeRec' : '_get_subtree'; + + $this->$method2call($id, $items, $my['filters'], $my['options']); + return $items; + } + + /** + * + * @return + * + * @internal revisions + */ + private function getSubtreeRec($node_id, &$pnode, $filters = null, + $options = null) + { + static $qnum; + static $my; + static $exclude_branches; + static $exclude_children_of; + static $node_types; + static $tcaseFilter; + static $tcversionFilter; + static $staticSql; + static $inClause; + + if (! $my) { + $qnum = 0; + $node_types = array_flip( + $this->tree_manager->get_available_node_types()); + + $my['filters'] = array( + 'exclude_children_of' => null, + 'exclude_branches' => null, + 'additionalWhereClause' => '', + 'testcase_name' => null, + 'testcase_id' => null, + 'active_testcase' => false, + 'importance' => null, + 'status' => null + ); + + $my['options'] = array( + 'remove_empty_nodes_of_type' => null + ); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $exclude_branches = $my['filters']['exclude_branches']; + $exclude_children_of = $my['filters']['exclude_children_of']; + + $tcaseFilter['name'] = ! is_null($my['filters']['testcase_name']); + $tcaseFilter['id'] = ! is_null($my['filters']['testcase_id']); + + $tcaseFilter['is_active'] = ! is_null( + $my['filters']['active_testcase']) && + $my['filters']['active_testcase']; + $tcaseFilter['enabled'] = $tcaseFilter['name'] || $tcaseFilter['id'] || + $tcaseFilter['is_active']; + + $actOnVersion = array( + 'execution_type', + 'importance', + 'status', + 'keywords', + 'platforms' + ); + foreach ($actOnVersion as $ck) { + $tcversionFilter[$ck] = ! is_null($my['filters'][$ck]); + } + + $tcversionFilter['enabled'] = false; + foreach ($actOnVersion as $target) { + $tcversionFilter['enabled'] = $tcversionFilter['enabled'] || + $tcversionFilter[$target]; + } + + // this way I can manage code or description + if (! is_null($my['options']['remove_empty_nodes_of_type']) && + ! is_numeric($my['options']['remove_empty_nodes_of_type'])) { + $my['options']['remove_empty_nodes_of_type'] = $this->tree_manager->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; + } + + // Create invariant sql sentences + $tfields = "NH.id, NH.parent_id, NH.name, NH.node_type_id, NH.node_order, '' AS external_id "; + $staticSql = " SELECT DISTINCT {$tfields} " . + " FROM {$this->tables['nodes_hierarchy']} NH "; + + // Generate IN Clauses + $inClause = array( + 'status' => ' ', + 'importance' => ' ' + ); + + foreach ($inClause as $tgf => $dummy) { + if ($tcversionFilter[$tgf]) { + $inClause[$tgf] = " TCV.$tgf IN (" . + implode(',', $my['filters'][$tgf]) . ')'; + } + } + } + + $sql = $staticSql . " WHERE NH.parent_id = " . intval($node_id) . + " AND (" . + " NH.node_type_id = {$this->tree_manager->node_descr_id['testsuite']} " . + " OR (NH.node_type_id = {$this->tree_manager->node_descr_id['testcase']} "; + + if ($tcaseFilter['enabled']) { + foreach ($tcaseFilter as $key => $apply) { + if ($apply) { + switch ($key) { + case 'name': + $safe4DB = $this->db->prepare_string( + $my['filters']['testcase_name']); + $sql .= " AND NH.name LIKE '%{$safe4DB}%' "; + break; + + case 'id': + $safe4DB = intval($my['filters']['testcase_id']); + $sql .= " AND NH.id = {$safe4DB} "; + break; + } + } + } + } + $sql .= " )) "; + $sql .= " ORDER BY NH.node_order,NH.id"; + + // Approach Change - get all + $rs = (array) $this->db->fetchRowsIntoMap($sql, 'id'); + if (empty($rs)) { + return $qnum; + } + + // create list with test cases nodes + $tclist = null; + $ks = array_keys($rs); + foreach ($ks as $ikey) { + if ($rs[$ikey]['node_type_id'] == + $this->tree_manager->node_descr_id['testcase']) { + $tclist[$rs[$ikey]['id']] = $rs[$ikey]['id']; + } + } + if (! is_null($tclist)) { + $filterOnTC = false; + + // 2018, where is the active check? + + // Can be replace with a view? + $glvn = " /* Get LATEST ACTIVE tcversion NUMBER */ " . + " SELECT MAX(TCVX.version) AS version, NHTCX.parent_id AS tc_id " . + " FROM {$this->tables['tcversions']} TCVX " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCX " . + " ON NHTCX.id = TCVX.id AND TCVX.active = 1 " . + " WHERE NHTCX.parent_id IN (" . implode(',', $tclist) . ")" . + " GROUP BY NHTCX.parent_id"; + + // 2018, again where is the active check? + $ssx = " /* Get LATEST ACTIVE tcversion MAIN ATTRIBUTES */ " . + " SELECT TCV.id AS tcversion_id, TCV.tc_external_id AS external_id, SQ.tc_id " . + " FROM {$this->tables['nodes_hierarchy']} NHTCV " . + " JOIN ( $glvn ) SQ " . " ON NHTCV.parent_id = SQ.tc_id " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON NHTCV.id = TCV.id "; + + // 2018 + $where = " WHERE SQ.version = TCV.version "; + + // We can add here keyword filtering if exist ? + if ($tcversionFilter['enabled'] || $tcaseFilter['is_active']) { + $addAnd = false; + if ($tcversionFilter['importance'] || + $tcversionFilter['execution_type'] || + $tcversionFilter['status']) { + $where .= " AND "; + } + + if ($tcversionFilter['importance']) { + $where .= $inClause['importance']; + $filterOnTC = true; + $addAnd = true; + } + + if ($addAnd && $tcversionFilter['execution_type']) { + $where .= " AND "; + } + + if ($tcversionFilter['execution_type']) { + $where .= " TCV.execution_type = " . + $my['filters']['execution_type']; + $filterOnTC = true; + $addAnd = true; + } + + if ($addAnd && $tcversionFilter['status']) { + $where .= " AND "; + } + + if ($tcversionFilter['status']) { + $where .= $inClause['status']; + $filterOnTC = true; + $addAnd = true; + } + } + + $ssx .= $where; + + $highlander = $this->db->fetchRowsIntoMap($ssx, 'tc_id'); + if ($filterOnTC) { + $ky = ! is_null($highlander) ? array_diff_key($tclist, + $highlander) : $tclist; + if (! empty($ky)) { + foreach ($ky as $tcase) { + unset($rs[$tcase]); + } + } + } + } + + foreach ($rs as $row) { + if (! isset($exclude_branches[$row['id']])) { + $node = $row + + array( + 'node_table' => $this->tree_manager->node_tables_by['id'][$row['node_type_id']] + ); + $node['childNodes'] = null; + + if ($node['node_table'] == 'testcases') { + $node['leaf'] = true; + $node['external_id'] = isset($highlander[$row['id']]) ? $highlander[$row['id']]['external_id'] : null; + } + + // why we use exclude_children_of ? + // 1. Sometimes we don't want the children if the parent is a testcase, + // due to the version management + // + if (! isset( + $exclude_children_of[$node_types[$row['node_type_id']]])) { + // Keep walking (Johny Walker Whisky) + $this->getSubtreeRec($row['id'], $node, $my['filters'], + $my['options']); + } + + // Have added this logic, because when export test plan will be developed + // having a test spec tree where test suites that do not contribute to test plan + // are pruned/removed is very important, to avoid additional processing + // + // If node has no childNodes, we check if this kind of node without children + // can be removed. + // + $doRemove = is_null($node['childNodes']) && + ($node['node_type_id'] == + $my['options']['remove_empty_nodes_of_type']); + if (! $doRemove) { + $pnode['childNodes'][] = $node; + } + } // if(!isset($exclude_branches[$rowID])) + } // while + + return $qnum; + } + + /** + * -1 => WITHOUT KEYWORDS + */ + protected function getTCLatestVersionFilteredByKeywords($tproject_id, + $keyword_id = 0, $keyword_filter_type = 'Or') + { + $keySet = (array) $keyword_id; + $sql = null; + $tcaseSet = array(); + $delTT = false; + $hasTCases = false; + + // -1 => WITHOUT KEYWORDS + $getWithOutKeywords = in_array(- 1, $keySet); + if ($getWithOutKeywords || $keyword_filter_type == 'NotLinked') { + + $this->get_all_testcases_id($tproject_id, $tcaseSet); + if ($hasTCases = ! empty($tcaseSet)) { + $delTT = true; + $tt = 'temp_tcset_' . $tproject_id . md5(microtime()); + $sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tt AS + ( SELECT id FROM {$this->tables['nodes_hierarchy']} + LIMIT 0 )"; + $this->db->exec_query($sql); + $a4ins = array_chunk($tcaseSet, 2000); // MAGIC + foreach ($a4ins as $chu) { + $sql = "INSERT INTO $tt (id) VALUES (" . implode('),(', $chu) . + ")"; + $this->db->exec_query($sql); + } + } + } + + if ($getWithOutKeywords && $hasTCases) { + $sql = " /* WITHOUT KEYWORDS */ SELECT TCVNO_KW.testcase_id FROM - {$this->views['tcversions_without_keywords']} TCVNO_KW + {$this->views['tcversions_without_keywords']} TCVNO_KW JOIN {$this->views['latest_tcase_version_id']} LTVC ON LTVC.tcversion_id = TCVNO_KW.id - JOIN $tt TT ON TT.id = TCVNO_KW.testcase_id "; - } else { - $kwFilter = " keyword_id IN (" . implode(',',$keySet) . ")"; - switch($keyword_filter_type) { - case 'NotLinked': - if($hasTCases) { - $sql = " /* WITHOUT SPECIFIC KEYWORDS */ - SELECT NHTCV.parent_id AS testcase_id - FROM {$this->tables['nodes_hierarchy']} NHTCV - JOIN {$this->views['latest_tcase_version_id']} LTCV - ON NHTCV.id = LTCV.tcversion_id - JOIN $tt TT ON TT.id = NHTCV.parent_id + JOIN $tt TT ON TT.id = TCVNO_KW.testcase_id "; + } else { + $kwFilter = " keyword_id IN (" . implode(',', $keySet) . ")"; + switch ($keyword_filter_type) { + case 'NotLinked': + if ($hasTCases) { + $sql = " /* WITHOUT SPECIFIC KEYWORDS */ + SELECT NHTCV.parent_id AS testcase_id + FROM {$this->tables['nodes_hierarchy']} NHTCV + JOIN {$this->views['latest_tcase_version_id']} LTCV + ON NHTCV.id = LTCV.tcversion_id + JOIN $tt TT ON TT.id = NHTCV.parent_id WHERE NOT EXISTS - (SELECT 1 FROM {$this->tables['testcase_keywords']} TCK - WHERE TCK.tcversion_id = LTCV.tcversion_id - AND {$kwFilter} )"; - } - break; - - - case 'And': - // MAX(TK.testcase_id) needed to be able to extract - // Test case id. - $sqlCount = " /* SQL COUNT */ " . - " SELECT COUNT(TK.tcversion_id) AS HITS, + (SELECT 1 FROM {$this->tables['testcase_keywords']} TCK + WHERE TCK.tcversion_id = LTCV.tcversion_id + AND {$kwFilter} )"; + } + break; + + case 'And': + // MAX(TK.testcase_id) needed to be able to extract + // Test case id. + $sqlCount = " /* SQL COUNT */ " . + " SELECT COUNT(TK.tcversion_id) AS HITS, MAX(TK.testcase_id) AS testcase_id, TK.tcversion_id FROM {$this->tables['keywords']} KW @@ -3406,667 +3457,627 @@ function getTCLatestVersionFilteredByKeywords($tproject_id, $keyword_id=0, $keyw ON LTCV.tcversion_id = TK.tcversion_id WHERE testproject_id = {$tproject_id} AND {$kwFilter} - GROUP BY TK.tcversion_id "; - - $sql = "/* Filter Type = AND */ - SELECT FOXDOG.testcase_id - FROM ( $sqlCount ) AS FOXDOG - WHERE FOXDOG.HITS=" . count($keyword_id); - break; - - - case 'Or': - default: - $sql = " /* Filter Type = OR */ " . - " SELECT TK.testcase_id " . - " FROM {$this->tables['testcase_keywords']} TK" . - " JOIN {$this->views['latest_tcase_version_id']} LTVC " . - " ON LTVC.tcversion_id = TK.tcversion_id " . - " JOIN {$this->tables['keywords']} KW " . - " ON KW.id = TK.keyword_id " . - " WHERE {$kwFilter} " . - " AND KW.testproject_id=" . $tproject_id; - break; - } - } - - $hits = !is_null($sql) ? $this->db->fetchRowsIntoMap($sql,'testcase_id') : null; - - // clean up - if( $delTT ) { - $sql = "DROP TABLE IF EXISTS $tt"; - $this->db->exec_query($sql); - } - - return $hits; -} - - - - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - */ -function isIssueTrackerEnabled($id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - "SELECT issue_tracker_enabled FROM {$this->object_table} " . - "WHERE id =" . intval($id); - - $ret = $this->db->get_recordset($sql); - return $ret[0]['issue_tracker_enabled']; -} - - - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - */ -function enableIssueTracker($id) -{ - $this->setIssueTrackerEnabled($id,1); -} - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - */ -function disableIssueTracker($id) -{ - $this->setIssueTrackerEnabled($id,0); -} - - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - */ -function setIssueTrackerEnabled($id,$value) -{ - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " UPDATE {$this->object_table} " . - " SET issue_tracker_enabled = " . (intval($value) > 0 ? 1 : 0) . - " WHERE id =" . intval($id); - $ret = $this->db->exec_query($sql); -} - - -/** - * - * - */ -function isCodeTrackerEnabled($id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - "SELECT code_tracker_enabled FROM {$this->object_table} " . - "WHERE id =" . intval($id); - - $ret = $this->db->get_recordset($sql); - return $ret[0]['code_tracker_enabled']; -} - - - -/** - * - * - * @internal revisions - * @since 1.9.17 - * - */ -function enableCodeTracker($id) -{ - $this->setCodeTrackerEnabled($id,1); -} - -/** - * - * - * @internal revisions - * @since 1.9.17 - * - */ -function disableCodeTracker($id) -{ - $this->setCodeTrackerEnabled($id,0); -} - - -/** - * - * - * @internal revisions - * @since 1.9.17 - * - */ -function setCodeTrackerEnabled($id,$value) -{ - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " UPDATE {$this->object_table} " . - " SET code_tracker_enabled = " . (intval($value) > 0 ? 1 : 0) . - " WHERE id =" . intval($id); - $ret = $this->db->exec_query($sql); -} - -/** - * - */ -function getItemCount() { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT COUNT(0) AS qty FROM {$this->object_table} "; - $ret = $this->db->get_recordset($sql); - return $ret[0]['qty']; -} - -/** - * - */ -function getPublicAttr($id) -{ - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " SELECT is_public FROM {$this->object_table} " . - " WHERE id =" . intval($id); - - $ret = $this->db->get_recordset($sql); - if(is_null($ret)) - { - throw new Exception("Test Project ID does not exist!", 1); - } - return $ret[0]['is_public']; -} - - - - - /** - * Gets test cases created per user. - * The test cases are restricted to a test project. - * - * Optional values may be passed in the options array. - * - * @param integer $user_id User ID - * @param integer $tproject_id Test Project ID - * @param mixed $options Optional array of options - * @return mixed Array of test cases created per user - */ - function getTestCasesCreatedByUser($id,$user_id,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $opt = array('startTime' => null, 'endTime' => null); - $opt = array_merge($opt,(array)$options); - $safe = array('user_id' => intval($user_id), 'tproject_id' => intval($id)); - - $cfg = config_get('testcase_cfg'); - $eid = $this->db->db->concat('TPROJ.prefix',"'{$cfg->glue_character}'",'TCV.tc_external_id'); - - // - $target = array(); - $this->get_all_testcases_id($id,$target); - $itemQty = count($target); - - $rs = null; - if($itemQty > 0) - { - $sql = " /* $debugMsg */ SELECT TPROJ.id AS tproject_id, TCV.id AS tcversion_id," . - " TCV.version, {$eid} AS external_id, NHTC.id AS tcase_id, NHTC.name AS tcase_name, ". - " TCV.creation_ts, TCV.modification_ts, " . - " U.first AS first_name, U.last AS last_name, U.login, ". - " TCV.importance " . - " FROM {$this->tables['testprojects']} TPROJ,{$this->tables['nodes_hierarchy']} NHTC " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - " JOIN {$this->tables['users']} U ON U.id = TCV.author_id " . - " WHERE TPROJ.id = {$safe['tproject_id']} " . - " AND NHTC.id IN (" . implode(',', $target) . ")"; - - if($user_id !== 0) - { - $sql .= " AND U.id = {$safe['user_id']}"; - } - if( !is_null($opt['startTime']) ) - { - $sql .= " AND TCV.creation_ts >= '{$opt['startTime']}'"; - } - if( !is_null($opt['endTime']) ) - { - $sql .= " AND TCV.creation_ts <= '{$opt['endTime']}'"; - } - - $rs = $this->db->fetchRowsIntoMap($sql,'tcase_id',database::CUMULATIVE); - if( !is_null($rs) ) - { - $k2g = array_keys($rs); - $path_info = $this->tree_manager->get_full_path_verbose($k2g,array('output_format' => 'path_as_string')); - foreach($k2g as $tgx) - { - $rx = array_keys($rs[$tgx]); - foreach($rx as $ex) - { - $rs[$tgx][$ex]['path'] = $path_info[$tgx]; - } - } - } - } - return $rs; - } - - - /** - * - * @since 1.9.6 - * - * @internal revisions - * - */ - function isReqMgrIntegrationEnabled($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $targetField = 'reqmgr_integration_enabled'; - $sql = "/* $debugMsg */ " . - "SELECT {$targetField} FROM {$this->object_table} " . - "WHERE id =" . intval($id); - - $ret = $this->db->get_recordset($sql); - return $ret[0][$targetField]; - } - - /** - * - * @since 1.9.6 - * - * @internal revisions - * - */ - function enableReqMgrIntegration($id) - { - $this->setOneZeroField($id,'reqmgr_integration_enabled',1); - } - - /** - * - * @since 1.9.6 - * - * @internal revisions - * - */ - function disableReqMgrIntegration($id) - { - $this->setOneZeroField($id,'reqmgr_integration_enabled',0); - } - - function setReqMgrIntegrationEnabled($id,$value) - { - $this->setOneZeroField($id,'reqmgr_integration_enabled',$value); - } - - /** - * - * - * @internal revisions - * @since 1.9.4 - * - */ - function setOneZeroField($id,$field,$value) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ " . - " UPDATE {$this->object_table} " . - " SET {$field} = " . (intval($value) > 0 ? 1 : 0) . - " WHERE id =" . intval($id); - $ret = $this->db->exec_query($sql); - } - - - /** - * - * - * @internal revisions - * @since 1.9.4 - * - */ - function getByChildID($child) - { - $path = $this->tree_manager->get_path($child); - return $this->get_by_id(intval($path[0]['parent_id'])); - } - - /** - * @internal revisions - * @since 1.9.8 - */ - function setActive($id) - { - $this->setOneZeroField($id,'active',1); - } - - /** - * @internal revisions - * @since 1.9.8 - */ - function setInactive($id) - { - $this->setOneZeroField($id,'active',0); - } - - /** - * - */ - function simplexml_load_file_helper($filename) - { - // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html - libxml_disable_entity_loader(true); - $zebra = file_get_contents($filename); - $xml = @simplexml_load_string($zebra); - return $xml; - } - - - /** - * - * @used-by containerEdit.php - */ - function getFileUploadRelativeURL($id) - { - // I've to use testsuiteID because this is how is name on containerEdit.php - $url = "lib/testcases/containerEdit.php?containerType=testproject&doAction=fileUpload&tprojectID=" . intval($id); - return $url; - } - - /** - * @used-by containerEdit.php - */ - function getDeleteAttachmentRelativeURL($id) - { - // I've to use testsuiteID because this is how is name on containerEdit.php - $url = "lib/testcases/containerEdit.php?containerType=testproject&doAction=deleteFile&tprojectID=" . intval($id) . - "&file_id=" ; - return $url; - } - - - - /** - * @used-by projectEdit.php - */ - function enableRequirements($id) { - $debugMsg = $this->debugMsg . __FUNCTION__; - $opt = $this->getOptions($safeID = intval($id)); - $opt->requirementsEnabled = 1; - $this->setOptions($safeID,$opt); - } - - /** - * @used-by projectEdit.php - */ - function disableRequirements($id) - { - $debugMsg = $this->debugMsg . __FUNCTION__; - $opt = $this->getOptions($safeID = intval($id)); - $opt->requirementsEnabled = 0; - $this->setOptions($safeID,$opt); - } - - - /** - * @used-by - */ - function getOptions($id) { - $debugMsg = $this->debugMsg . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT testprojects.options ". - " FROM {$this->object_table} testprojects " . - " WHERE testprojects.id = " . intval($id); - $rs = $this->db->get_recordset($sql); - return unserialize($rs[0]['options']); - } - - /** - * @used-by - */ - function setOptions($id,$optObj) - { - $debugMsg = $this->debugMsg . __FUNCTION__; - - $nike = false; - $itemOpt = $this->getOptions( ($safeID = intval($id)) ); - foreach($itemOpt as $prop => $value) - { - if( property_exists($optObj, $prop) ) - { - $itemOpt->$prop = $optObj->$prop; - $nike = true; - } - } - - if($nike) - { - $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . - " SET options = '" . $this->db->prepare_string(serialize($itemOpt)) . "'" . - " WHERE id = " . $safeID; - - $this->db->exec_query($sql); - } - } - - -/** - * - */ -function getActiveTestPlansCount($id) -{ - $debugMsg = $this->debugMsg . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT COUNT(0) AS qty". - " FROM {$this->tables['nodes_hierarchy']} NH_TPLAN " . - " JOIN {$this->tables['testplans']} TPLAN ON NH_TPLAN.id = TPLAN.id " . - " WHERE NH_TPLAN.parent_id = " . $this->db->prepare_int($id) . - " AND TPLAN.active = 1"; - - $rs = $this->db->get_recordset($sql); - return $rs[0]['qty']; -} - - /** - * - */ - static function getAPIKey(&$dbh,$id) { - $sch = tlDBObject::getDBTables('testprojects'); - $sql = "SELECT api_key FROM {$sch['testprojects']} WHERE id=" . intval($id); - $rs = $dbh->get_recordset($sql); - - return is_null($rs) ? $rs : $rs[0]['api_key']; - } - - - /** - * - */ - function checkKeywordIsLinkedAndNotExecuted($keyword_id,$tproject_id=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $whereAdd = ''; - $sql = " SELECT id,keyword FROM {$this->tables['keywords']} KW - WHERE id = {$keyword_id} "; - - if( null != $tproject_id ) { - $whereAdd = " AND testproject_id = " . intval($tproject_id); - } - $sql .= $whereAdd; - - $rs = $this->db->get_recordset($sql); - if( is_null($rs) ) { - return null; - } - - // Now try to understand if it is linked - if( !is_null($rs) ) { - $sql = "/* $debugMsg */ + GROUP BY TK.tcversion_id "; + + $sql = "/* Filter Type = AND */ + SELECT FOXDOG.testcase_id + FROM ( $sqlCount ) AS FOXDOG + WHERE FOXDOG.HITS=" . count($keyword_id); + break; + + case 'Or': + default: + $sql = " /* Filter Type = OR */ " . " SELECT TK.testcase_id " . + " FROM {$this->tables['testcase_keywords']} TK" . + " JOIN {$this->views['latest_tcase_version_id']} LTVC " . + " ON LTVC.tcversion_id = TK.tcversion_id " . + " JOIN {$this->tables['keywords']} KW " . + " ON KW.id = TK.keyword_id " . " WHERE {$kwFilter} " . + " AND KW.testproject_id=" . $tproject_id; + break; + } + } + + $hits = ! is_null($sql) ? $this->db->fetchRowsIntoMap($sql, + 'testcase_id') : null; + + // clean up + if ($delTT) { + $sql = "DROP TABLE IF EXISTS $tt"; + $this->db->exec_query($sql); + } + + return $hits; + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + public function isIssueTrackerEnabled($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + "SELECT issue_tracker_enabled FROM {$this->object_table} " . + "WHERE id =" . intval($id); + + $ret = $this->db->get_recordset($sql); + return $ret[0]['issue_tracker_enabled']; + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + public function enableIssueTracker($id) + { + $this->setIssueTrackerEnabled($id, 1); + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + public function disableIssueTracker($id) + { + $this->setIssueTrackerEnabled($id, 0); + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + public function setIssueTrackerEnabled($id, $value) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . " UPDATE {$this->object_table} " . + " SET issue_tracker_enabled = " . (intval($value) > 0 ? 1 : 0) . + " WHERE id =" . intval($id); + $this->db->exec_query($sql); + } + + /** + */ + public function isCodeTrackerEnabled($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + "SELECT code_tracker_enabled FROM {$this->object_table} " . + "WHERE id =" . intval($id); + + $ret = $this->db->get_recordset($sql); + return $ret[0]['code_tracker_enabled']; + } + + /** + * + * @internal revisions + * @since 1.9.17 + * + */ + public function enableCodeTracker($id) + { + $this->setCodeTrackerEnabled($id, 1); + } + + /** + * + * @internal revisions + * @since 1.9.17 + * + */ + public function disableCodeTracker($id) + { + $this->setCodeTrackerEnabled($id, 0); + } + + /** + * + * @internal revisions + * @since 1.9.17 + * + */ + public function setCodeTrackerEnabled($id, $value) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . " UPDATE {$this->object_table} " . + " SET code_tracker_enabled = " . (intval($value) > 0 ? 1 : 0) . + " WHERE id =" . intval($id); + $this->db->exec_query($sql); + } + + /** + */ + public function getItemCount() + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT COUNT(0) AS qty FROM {$this->object_table} "; + $ret = $this->db->get_recordset($sql); + return $ret[0]['qty']; + } + + /** + */ + public function getPublicAttr($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . + " SELECT is_public FROM {$this->object_table} " . " WHERE id =" . + intval($id); + + $ret = $this->db->get_recordset($sql); + if (is_null($ret)) { + throw new Exception("Test Project ID does not exist!", 1); + } + return $ret[0]['is_public']; + } + + /** + * Gets test cases created per user. + * The test cases are restricted to a test project. + * + * Optional values may be passed in the options array. + * + * @param integer $user_id + * User ID + * @param integer $tproject_id + * Test Project ID + * @param mixed $options + * Optional array of options + * @return mixed Array of test cases created per user + */ + public function getTestCasesCreatedByUser($id, $user_id, $options = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $opt = array( + 'startTime' => null, + 'endTime' => null + ); + $opt = array_merge($opt, (array) $options); + $safe = array( + 'user_id' => intval($user_id), + 'tproject_id' => intval($id) + ); + + $cfg = config_get('testcase_cfg'); + $eid = $this->db->db->concat('TPROJ.prefix', "'{$cfg->glue_character}'", + 'TCV.tc_external_id'); + + // + $target = array(); + $this->get_all_testcases_id($id, $target); + $itemQty = count($target); + + $rs = null; + if ($itemQty > 0) { + $sql = " /* $debugMsg */ SELECT TPROJ.id AS tproject_id, TCV.id AS tcversion_id," . + " TCV.version, {$eid} AS external_id, NHTC.id AS tcase_id, NHTC.name AS tcase_name, " . + " TCV.creation_ts, TCV.modification_ts, " . + " U.first AS first_name, U.last AS last_name, U.login, " . + " TCV.importance " . + " FROM {$this->tables['testprojects']} TPROJ,{$this->tables['nodes_hierarchy']} NHTC " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN {$this->tables['users']} U ON U.id = TCV.author_id " . + " WHERE TPROJ.id = {$safe['tproject_id']} " . " AND NHTC.id IN (" . + implode(',', $target) . ")"; + + if ($user_id !== 0) { + $sql .= " AND U.id = {$safe['user_id']}"; + } + if (! is_null($opt['startTime'])) { + $sql .= " AND TCV.creation_ts >= '{$opt['startTime']}'"; + } + if (! is_null($opt['endTime'])) { + $sql .= " AND TCV.creation_ts <= '{$opt['endTime']}'"; + } + + $rs = $this->db->fetchRowsIntoMap($sql, 'tcase_id', + database::CUMULATIVE); + if (! is_null($rs)) { + $k2g = array_keys($rs); + $path_info = $this->tree_manager->get_full_path_verbose($k2g, + array( + 'output_format' => 'path_as_string' + )); + foreach ($k2g as $tgx) { + $rx = array_keys($rs[$tgx]); + foreach ($rx as $ex) { + $rs[$tgx][$ex]['path'] = $path_info[$tgx]; + } + } + } + } + return $rs; + } + + /** + * + * @since 1.9.6 + * + * @internal revisions + * + */ + private function isReqMgrIntegrationEnabled($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $targetField = 'reqmgr_integration_enabled'; + $sql = "/* $debugMsg */ " . + "SELECT {$targetField} FROM {$this->object_table} " . "WHERE id =" . + intval($id); + + $ret = $this->db->get_recordset($sql); + return $ret[0][$targetField]; + } + + /** + * + * @since 1.9.6 + * + * @internal revisions + * + */ + private function enableReqMgrIntegration($id) + { + $this->setOneZeroField($id, 'reqmgr_integration_enabled', 1); + } + + /** + * + * @since 1.9.6 + * + * @internal revisions + * + */ + private function disableReqMgrIntegration($id) + { + $this->setOneZeroField($id, 'reqmgr_integration_enabled', 0); + } + + public function setReqMgrIntegrationEnabled($id, $value) + { + $this->setOneZeroField($id, 'reqmgr_integration_enabled', $value); + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + private function setOneZeroField($id, $field, $value) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ " . " UPDATE {$this->object_table} " . + " SET {$field} = " . (intval($value) > 0 ? 1 : 0) . " WHERE id =" . + intval($id); + $this->db->exec_query($sql); + } + + /** + * + * @internal revisions + * @since 1.9.4 + * + */ + public function getByChildID($child) + { + $path = $this->tree_manager->get_path($child); + return $this->get_by_id(intval($path[0]['parent_id'])); + } + + /** + * + * @internal revisions + * @since 1.9.8 + */ + public function setActive($id) + { + $this->setOneZeroField($id, 'active', 1); + } + + /** + * + * @internal revisions + * @since 1.9.8 + */ + public function setInactive($id) + { + $this->setOneZeroField($id, 'active', 0); + } + + /** + */ + private function simplexmlLoadFileHelper($filename) + { + // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html + libxml_disable_entity_loader(true); + $zebra = file_get_contents($filename); + return @simplexml_load_string($zebra); + } + + /** + * + * @used-by containerEdit.php + */ + public function getFileUploadRelativeURL($id) + { + // I've to use testsuiteID because this is how is name on containerEdit.php + return "lib/testcases/containerEdit.php?containerType=testproject&doAction=fileUpload&tprojectID=" . + intval($id); + } + + /** + * + * @used-by containerEdit.php + */ + public function getDeleteAttachmentRelativeURL($id) + { + // I've to use testsuiteID because this is how is name on containerEdit.php + return "lib/testcases/containerEdit.php?containerType=testproject&doAction=deleteFile&tprojectID=" . + intval($id) . "&file_id="; + } + + /** + * + * @used-by projectEdit.php + */ + public function enableRequirements($id) + { + $opt = $this->getOptions($safeID = intval($id)); + $opt->requirementsEnabled = 1; + $this->setOptions($safeID, $opt); + } + + /** + * + * @used-by projectEdit.php + */ + public function disableRequirements($id) + { + $opt = $this->getOptions($safeID = intval($id)); + $opt->requirementsEnabled = 0; + $this->setOptions($safeID, $opt); + } + + /** + * + * @used-by + */ + public function getOptions($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT testprojects.options " . + " FROM {$this->object_table} testprojects " . + " WHERE testprojects.id = " . intval($id); + $rs = $this->db->get_recordset($sql); + return unserialize($rs[0]['options']); + } + + /** + * + * @used-by + */ + private function setOptions($id, $optObj) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $nike = false; + $itemOpt = $this->getOptions(($safeID = intval($id))); + foreach ($itemOpt as $prop => $value) { + if (property_exists($optObj, $prop)) { + $itemOpt->$prop = $optObj->$prop; + $nike = true; + } + } + + if ($nike) { + $sql = "/* $debugMsg */ UPDATE {$this->object_table} " . + " SET options = '" . + $this->db->prepare_string(serialize($itemOpt)) . "'" . + " WHERE id = " . $safeID; + + $this->db->exec_query($sql); + } + } + + /** + */ + public function getActiveTestPlansCount($id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT COUNT(0) AS qty" . + " FROM {$this->tables['nodes_hierarchy']} NH_TPLAN " . + " JOIN {$this->tables['testplans']} TPLAN ON NH_TPLAN.id = TPLAN.id " . + " WHERE NH_TPLAN.parent_id = " . $this->db->prepare_int($id) . + " AND TPLAN.active = 1"; + + $rs = $this->db->get_recordset($sql); + return $rs[0]['qty']; + } + + /** + */ + public static function getAPIKey(&$dbh, $id) + { + $sch = tlDBObject::getDBTables('testprojects'); + $sql = "SELECT api_key FROM {$sch['testprojects']} WHERE id=" . + intval($id); + $rs = $dbh->get_recordset($sql); + + return is_null($rs) ? $rs : $rs[0]['api_key']; + } + + /** + */ + private function checkKeywordIsLinkedAndNotExecuted($keyword_id, + $tproject_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $whereAdd = ''; + $sql = " SELECT id,keyword FROM {$this->tables['keywords']} KW + WHERE id = {$keyword_id} "; + + if (null != $tproject_id) { + $whereAdd = " AND testproject_id = " . intval($tproject_id); + } + $sql .= $whereAdd; + + $rs = $this->db->get_recordset($sql); + if (is_null($rs)) { + return null; + } + + // Now try to understand if it is linked + if (! is_null($rs)) { + $sql = "/* $debugMsg */ SELECT DISTINCT keyword_id,keyword, - CASE + CASE WHEN EX.status IS NULL THEN 'NOT_RUN' ELSE 'EXECUTED' - END AS exec_status + END AS exec_status FROM {$this->tables['keywords']} KW JOIN {$this->tables['testcase_keywords']} TCKW ON TCKW.keyword_id = KW.id - LEFT OUTER JOIN {$this->tables['executions']} EX + LEFT OUTER JOIN {$this->tables['executions']} EX ON EX.tcversion_id = TCKW.tcversion_id - - WHERE KW.id = {$keyword_id} {$whereAdd} "; - } - $rs = $this->db->fetchRowsIntoMap($sql,'exec_status'); - $rs = (array)$rs; - return isset($rs['EXECUTED']) ? 0 : 1; - } - - - /** - * - */ - function checkKeywordIsLinkedToFrozenVersions($keyword_id,$tproject_id=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $whereAdd = ''; - $sql = " SELECT id,keyword FROM {$this->tables['keywords']} KW - WHERE id = {$keyword_id} "; - - if( null != $tproject_id ) { - $whereAdd = " AND testproject_id = " . intval($tproject_id); - } - $sql .= $whereAdd; - - $rs = $this->db->get_recordset($sql); - if( is_null($rs) ) { - return null; - } - - if( !is_null($rs) ) { - $sql = "/* $debugMsg */ + WHERE KW.id = {$keyword_id} {$whereAdd} "; + } + $rs = $this->db->fetchRowsIntoMap($sql, 'exec_status'); + + $rs = (array) $rs; + return isset($rs['EXECUTED']) ? 0 : 1; + } + + /** + */ + private function checkKeywordIsLinkedToFrozenVersions($keyword_id, + $tproject_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $whereAdd = ''; + $sql = " SELECT id,keyword FROM {$this->tables['keywords']} KW + WHERE id = {$keyword_id} "; + + if (null != $tproject_id) { + $whereAdd = " AND testproject_id = " . intval($tproject_id); + } + $sql .= $whereAdd; + + $rs = $this->db->get_recordset($sql); + if (is_null($rs)) { + return null; + } + + if (! is_null($rs)) { + $sql = "/* $debugMsg */ SELECT DISTINCT keyword_id,keyword, - CASE + CASE WHEN TCV.is_open=0 THEN 'FROZEN' ELSE 'FRESH' - END AS freeze_status + END AS freeze_status FROM {$this->tables['keywords']} KW JOIN {$this->tables['testcase_keywords']} TCKW ON TCKW.keyword_id = KW.id - JOIN {$this->tables['tcversions']} TCV + JOIN {$this->tables['tcversions']} TCV ON TCV.id = TCKW.tcversion_id - - WHERE KW.id = {$keyword_id} {$whereAdd} "; - } - $rs = $this->db->fetchRowsIntoMap($sql,'freeze_status'); - - $rs = (array)$rs; - return isset($rs['FROZEN']) ? 1 : 0; - } - - /** - * - */ - function getKeywordSimple( $keyword_id ) { - $sql = " SELECT keyword FROM {$this->tables['keywords']} - WHERE id = " . intval($keyword_id); - $rs = current($this->db->get_recordset($sql)); - return $rs['keyword']; - } - - - /** - * - */ - function getKeywordsExecStatus($keywordSet,$tproject_id=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $whereAdd = ''; - if( null != $tproject_id ) { - $whereAdd = " AND testproject_id = " . intval($tproject_id); - } - - $idSet = implode(',', $keywordSet); - $sql = "/* $debugMsg */ + WHERE KW.id = {$keyword_id} {$whereAdd} "; + } + $rs = $this->db->fetchRowsIntoMap($sql, 'freeze_status'); + + $rs = (array) $rs; + return isset($rs['FROZEN']) ? 1 : 0; + } + + /** + */ + private function getKeywordSimple($keyword_id) + { + $sql = " SELECT keyword FROM {$this->tables['keywords']} + WHERE id = " . intval($keyword_id); + $rs = current($this->db->get_recordset($sql)); + + return $rs['keyword']; + } + + /** + */ + public function getKeywordsExecStatus($keywordSet, $tproject_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $whereAdd = ''; + if (null != $tproject_id) { + $whereAdd = " AND testproject_id = " . intval($tproject_id); + } + + $idSet = implode(',', $keywordSet); + $sql = "/* $debugMsg */ SELECT DISTINCT keyword_id,keyword, - CASE + CASE WHEN EX.status IS NULL THEN 'NOT_RUN' ELSE 'EXECUTED' - END AS exec_or_not + END AS exec_or_not FROM {$this->tables['keywords']} KW JOIN {$this->tables['testcase_keywords']} TCKW ON TCKW.keyword_id = KW.id - LEFT OUTER JOIN {$this->tables['executions']} EX + LEFT OUTER JOIN {$this->tables['executions']} EX ON EX.tcversion_id = TCKW.tcversion_id - - WHERE KW.id IN( {$idSet} ) {$whereAdd} "; - $rs = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - - return $rs; - } - - /** - * - */ - function getKeywordsFreezeStatus($keywordSet,$tproject_id=null) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $whereAdd = ''; - if( null != $tproject_id ) { - $whereAdd = " AND testproject_id = " . intval($tproject_id); - } - - $idSet = implode(',', $keywordSet); - $sql = "/* $debugMsg */ + WHERE KW.id IN( {$idSet} ) {$whereAdd} "; + + return $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + } + + /** + */ + public function getKeywordsFreezeStatus($keywordSet, $tproject_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $whereAdd = ''; + if (null != $tproject_id) { + $whereAdd = " AND testproject_id = " . intval($tproject_id); + } + + $idSet = implode(',', $keywordSet); + $sql = "/* $debugMsg */ SELECT DISTINCT keyword_id,keyword, - CASE + CASE WHEN TCV.is_open=0 THEN 'FROZEN' ELSE 'FRESH' - END AS fresh_or_frozen + END AS fresh_or_frozen FROM {$this->tables['keywords']} KW JOIN {$this->tables['testcase_keywords']} TCKW ON TCKW.keyword_id = KW.id - JOIN {$this->tables['tcversions']} TCV + JOIN {$this->tables['tcversions']} TCV ON TCV.id = TCKW.tcversion_id - - WHERE KW.id IN( {$idSet} ) {$whereAdd} "; - - $rs = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - return $rs; - } - /** - * - */ - function countKeywordUsageInTCVersions($tproject_id) { - - $pid = intval($tproject_id); - $sql = " SELECT KW.id AS keyword_id, + WHERE KW.id IN( {$idSet} ) {$whereAdd} "; + + return $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + } + + /** + */ + public function countKeywordUsageInTCVersions($tproject_id) + { + $pid = intval($tproject_id); + $sql = " SELECT KW.id AS keyword_id, CASE WHEN TCKW.keyword_id IS NULL THEN 0 ELSE count(0) @@ -4076,108 +4087,103 @@ function countKeywordUsageInTCVersions($tproject_id) { ON TCKW.keyword_id = KW.id WHERE testproject_id = {$pid} - GROUP BY KW.id,TCKW.keyword_id "; - - $rs = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - return $rs; - } - -/** - * - */ -function getPlatformsLatestTCV($tproject_id, $platform_id=0) { - - $filter = '' ; - $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV - ON LTCV.tcversion_id = TPL.tcversion_id "; - - if( is_array($platform_id) ) { - $filter = " AND platform_id IN (" . implode(',',$platform_id) . ")"; - } - else if( $platform_id > 0 ) { - $filter = " AND platform_id = {$platform_id} "; - } - - $items = null; - $sql = " SELECT TPL.testcase_id,TPL.platform_id,PL.name + GROUP BY KW.id,TCKW.keyword_id "; + + return $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + } + + /** + */ + public function getPlatformsLatestTCV($tproject_id, $platform_id = 0) + { + $filter = ''; + $ltcvJoin = " JOIN {$this->views['latest_tcase_version_id']} LTCV + ON LTCV.tcversion_id = TPL.tcversion_id "; + + if (is_array($platform_id)) { + $filter = " AND platform_id IN (" . implode(',', $platform_id) . ")"; + } elseif ($platform_id > 0) { + $filter = " AND platform_id = {$platform_id} "; + } + + $sql = " SELECT TPL.testcase_id,TPL.platform_id,PL.name FROM {$this->tables['platforms']} PL JOIN {$this->tables['testcase_platforms']} TPL ON TPL.platform_id = PL.id {$ltcvJoin} WHERE PL.testproject_id = {$tproject_id} {$filter} - ORDER BY name ASC "; - - $items = $this->db->fetchMapRowsIntoMap($sql,'testcase_id','platform_id'); - - return $items; -} //end function - - -/** - * @used-by getTestSpecTree()@treeMenu.inc.php - * -1 => WITHOUT PLATFORMS - * - */ -function getTCLatestVersionFilteredByPlatforms($tproject_id, $platform_id=0) { - $platSet = (array)$platform_id; - $sql = null; - $tcaseSet = array(); - $delTT = false; - $hasTCases = false; - - // -1 => WITHOUT PLATFORMS - $getWithOutPlatforms = in_array(-1,$platSet); - if( $getWithOutPlatforms ) { - $this->get_all_testcases_id($tproject_id,$tcaseSet); - if( ($hasTCases = count($tcaseSet) > 0) ) { - $delTT = true; - $tt = 'temp_tcset_' . $tproject_id . md5(microtime()); - $sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tt AS - ( SELECT id FROM {$this->tables['nodes_hierarchy']} - LIMIT 0 )"; - $this->db->exec_query($sql); - $a4ins = array_chunk($tcaseSet, 2000); // MAGIC - foreach($a4ins as $chu) { - $sql = "INSERT INTO $tt (id) VALUES (" . - implode('),(',$chu) . ")"; - $this->db->exec_query($sql); - } - } - } - - if( $getWithOutPlatforms && $hasTCases) { - $sql = " /* WITHOUT PLATFORMS */ + ORDER BY name ASC "; + + return $this->db->fetchMapRowsIntoMap($sql, 'testcase_id', 'platform_id'); + } + + /** + * + * @used-by getTestSpecTree()@treeMenu.inc.php + * -1 => WITHOUT PLATFORMS + * + */ + protected function getTCLatestVersionFilteredByPlatforms($tproject_id, + $platform_id = 0) + { + $platSet = (array) $platform_id; + $sql = null; + $tcaseSet = array(); + $delTT = false; + $hasTCases = false; + + // -1 => WITHOUT PLATFORMS + $getWithOutPlatforms = in_array(- 1, $platSet); + if ($getWithOutPlatforms) { + $this->get_all_testcases_id($tproject_id, $tcaseSet); + if ($hasTCases = count($tcaseSet) > 0) { + $delTT = true; + $tt = 'temp_tcset_' . $tproject_id . md5(microtime()); + $sql = "CREATE TEMPORARY TABLE IF NOT EXISTS $tt AS + ( SELECT id FROM {$this->tables['nodes_hierarchy']} + LIMIT 0 )"; + $this->db->exec_query($sql); + $a4ins = array_chunk($tcaseSet, 2000); // MAGIC + foreach ($a4ins as $chu) { + $sql = "INSERT INTO $tt (id) VALUES (" . implode('),(', $chu) . + ")"; + $this->db->exec_query($sql); + } + } + } + + if ($getWithOutPlatforms && $hasTCases) { + $sql = " /* WITHOUT PLATFORMS */ SELECT TCVNO_PL.testcase_id FROM - {$this->views['tcversions_without_platforms']} TCVNO_PL + {$this->views['tcversions_without_platforms']} TCVNO_PL JOIN {$this->views['latest_tcase_version_id']} LTVC ON LTVC.tcversion_id = TCVNO_PL.id - JOIN $tt TT ON TT.id = TCVNO_PL.testcase_id "; - } else { - $filter = " platform_id IN (" . implode(',',$platSet) . ")"; - $filter_type = 'And'; - switch($filter_type) { - case 'NotLinked': - if($hasTCases) { - $sql = " /* WITHOUT SPECIFIC KEYWORDS */ - SELECT NHTCV.parent_id AS testcase_id - FROM {$this->tables['nodes_hierarchy']} NHTCV - JOIN {$this->views['latest_tcase_version_id']} LTCV - ON NHTCV.id = LTCV.tcversion_id - JOIN $tt TT ON TT.id = NHTCV.parent_id + JOIN $tt TT ON TT.id = TCVNO_PL.testcase_id "; + } else { + $filter = " platform_id IN (" . implode(',', $platSet) . ")"; + $filter_type = 'And'; + switch ($filter_type) { + case 'NotLinked': + if ($hasTCases) { + $sql = " /* WITHOUT SPECIFIC KEYWORDS */ + SELECT NHTCV.parent_id AS testcase_id + FROM {$this->tables['nodes_hierarchy']} NHTCV + JOIN {$this->views['latest_tcase_version_id']} LTCV + ON NHTCV.id = LTCV.tcversion_id + JOIN $tt TT ON TT.id = NHTCV.parent_id WHERE NOT EXISTS - (SELECT 1 FROM {$this->tables['testcase_platforms']} TCPL - WHERE TCPL.tcversion_id = LTCV.tcversion_id - AND {$filter} )"; - } - break; - - - case 'And': - // MAX(TK.testcase_id) needed to be able to extract - // Test case id. - $sqlCount = " /* SQL COUNT */ " . - " SELECT COUNT(TPL.tcversion_id) AS HITS, + (SELECT 1 FROM {$this->tables['testcase_platforms']} TCPL + WHERE TCPL.tcversion_id = LTCV.tcversion_id + AND {$filter} )"; + } + break; + + case 'And': + // MAX(TK.testcase_id) needed to be able to extract + // Test case id. + $sqlCount = " /* SQL COUNT */ " . + " SELECT COUNT(TPL.tcversion_id) AS HITS, MAX(TPL.testcase_id) AS testcase_id, TPL.tcversion_id FROM {$this->tables['platforms']} PL @@ -4187,67 +4193,70 @@ function getTCLatestVersionFilteredByPlatforms($tproject_id, $platform_id=0) { ON LTCV.tcversion_id = TPL.tcversion_id WHERE testproject_id = {$tproject_id} AND {$filter} - GROUP BY TPL.tcversion_id "; - - $sql = "/* Filter Type = AND */ - SELECT PLTFOXDOG.testcase_id - FROM ( $sqlCount ) AS PLTFOXDOG - WHERE PLTFOXDOG.HITS=" . count($platform_id); - break; - - - case 'Or': - default: - $sql = " /* Filter Type = OR */ " . - " SELECT TK.testcase_id " . - " FROM {$this->tables['testcase_platforms']} TPL" . - " JOIN {$this->views['latest_tcase_version_id']} LTVC " . - " ON LTVC.tcversion_id = TPL.tcversion_id " . - " JOIN {$this->tables['platforms']} PL " . - " ON PL.id = TK.platform_id " . - " WHERE {$filter} " . - " AND PL.testproject_id=" . $tproject_id; - break; - } - } - - $hits = !is_null($sql) ? $this->db->fetchRowsIntoMap($sql,'testcase_id') : null; - - // clean up - if( $delTT ) { - $sql = "DROP TABLE IF EXISTS $tt"; - $this->db->exec_query($sql); - } - - return $hits; -} - - /** - * - */ - static function getName(&$dbh,$id) { - $sch = tlDBObject::getDBTables(array('nodes_hierarchy','testprojects')); - $sql = "SELECT name FROM {$sch['nodes_hierarchy']} NH - JOIN {$sch['testprojects']} TPRJ + GROUP BY TPL.tcversion_id "; + + $sql = "/* Filter Type = AND */ + SELECT PLTFOXDOG.testcase_id + FROM ( $sqlCount ) AS PLTFOXDOG + WHERE PLTFOXDOG.HITS=" . count($platform_id); + break; + + case 'Or': + default: + $sql = " /* Filter Type = OR */ " . " SELECT TK.testcase_id " . + " FROM {$this->tables['testcase_platforms']} TPL" . + " JOIN {$this->views['latest_tcase_version_id']} LTVC " . + " ON LTVC.tcversion_id = TPL.tcversion_id " . + " JOIN {$this->tables['platforms']} PL " . + " ON PL.id = TK.platform_id " . " WHERE {$filter} " . + " AND PL.testproject_id=" . $tproject_id; + break; + } + } + + $hits = ! is_null($sql) ? $this->db->fetchRowsIntoMap($sql, + 'testcase_id') : null; + + // clean up + if ($delTT) { + $sql = "DROP TABLE IF EXISTS $tt"; + $this->db->exec_query($sql); + } + + return $hits; + } + + /** + */ + public static function getName(&$dbh, $id) + { + $sch = tlDBObject::getDBTables( + array( + 'nodes_hierarchy', + 'testprojects' + )); + $sql = "SELECT name FROM {$sch['nodes_hierarchy']} NH + JOIN {$sch['testprojects']} TPRJ ON TPRJ.id = NH.id - WHERE TPRJ.id=" . intval($id); - $rs = $dbh->get_recordset($sql); - return is_null($rs) ? $rs : $rs[0]['name']; - } - - /*** - * - * @used-by testcase.class.php - */ - function getKeywordsAsMapByName($tproject_id) { - $keywordMap = null; - $keywords = $this->getKeywords($tproject_id); - if ($keywords) { - foreach($keywords as $kw) { - $keywordMap[$kw->name] = $kw->notes; - } - } - return $keywordMap; - } - -} // end class + WHERE TPRJ.id=" . intval($id); + $rs = $dbh->get_recordset($sql); + return is_null($rs) ? $rs : $rs[0]['name']; + } + + /** + * * + * + * @used-by testcase.class.php + */ + public function getKeywordsAsMapByName($tproject_id) + { + $keywordMap = null; + $keywords = $this->getKeywords($tproject_id); + if ($keywords) { + foreach ($keywords as $kw) { + $keywordMap[$kw->name] = $kw->notes; + } + } + return $keywordMap; + } +} diff --git a/lib/functions/testsuite.class.php b/lib/functions/testsuite.class.php index 7bdfd6c404..e074a07e50 100644 --- a/lib/functions/testsuite.class.php +++ b/lib/functions/testsuite.class.php @@ -1,2091 +1,2113 @@ - "XML"); - var $export_file_types = array("XML" => "XML"); - - // Node Types (NT) - var $nt2exclude = array('testplan' => 'exclude_me', - 'requirement_spec'=> 'exclude_me', - 'requirement'=> 'exclude_me'); - - - var $nt2exclude_children=array('testcase' => 'exclude_my_children', - 'requirement_spec'=> 'exclude_my_children'); - - /** - * testplan class constructor - * - * @param resource &$db reference to database handler - */ - function __construct(&$db) - { - $this->db = &$db; - - $this->tree_manager = new tree($this->db); - $this->node_types_descr_id=$this->tree_manager->get_available_node_types(); - $this->node_types_id_descr=array_flip($this->node_types_descr_id); - $this->my_node_type=$this->node_types_descr_id['testsuite']; - - $this->cfield_mgr=new cfield_mgr($this->db); - - // ATTENTION: - // second argument is used to set $this->attachmentTableName,property that this calls - // get from his parent - // tlObjectWithAttachments::__construct($this->db,'nodes_hierarchy'); - parent::__construct($this->db,"nodes_hierarchy"); - - // Must be setted AFTER call to parent constructor - $this->object_table = $this->tables['testsuites']; - - } - - - /* - returns: map - key: export file type code - value: export file type verbose description - */ - function get_export_file_types() { - return $this->export_file_types; - } - - - /* - function: get_impor_file_types - getter - - args: - - - returns: map - key: import file type code - value: import file type verbose description - - */ - function get_import_file_types() - { - return $this->import_file_types; - } - - - /* - args : - $parent_id - $name - $details - [$check_duplicate_name] - [$action_on_duplicate_name] - [$order] - returns: hash - $ret['status_ok'] -> 0/1 - $ret['msg'] - $ret['id'] -> when status_ok=1, id of the new element - rev : - */ - function create($parent_id,$name,$details,$order=null, - $check_duplicate_name=0, - $action_on_duplicate_name='allow_repeat') { - static $l18n; - static $cfg; - if(!$cfg) { - $cfg = array(); - $cfg['prefix_name_for_copy'] = config_get('prefix_name_for_copy'); - $cfg['node_order'] = config_get('treemenu_default_testsuite_order'); - - $l18n = array(); - $l18n['component_name_already_exists'] = lang_get('component_name_already_exists'); - } - - if( is_null($order) ) { - // @since 1.9.13 - // - //$node_order = isset($cfg['treemenu_default_testsuite_order']) ? - // $cfg['treemenu_default_testsuite_order'] : 0; - // get all siblings, then calculate bottom - // this way theorically each will be a different order. - // this can be good when ordering - $node_order = $this->tree_manager->getBottomOrder($parent_id,array('node_type' => 'testsuite')) + 1; - } else { - $node_order = $order; - } - - $name = trim($name); - $ret = array('status_ok' => 1, 'id' => 0, 'msg' => 'ok', - 'name' => '', 'name_changed' => false); - - if ($check_duplicate_name) { - $check = $this->tree_manager->nodeNameExists($name,$this->my_node_type,null,$parent_id); - if( $check['status'] == 1) { - if ($action_on_duplicate_name == 'block') { - $ret['status_ok'] = 0; - $ret['msg'] = sprintf($l18n['component_name_already_exists'],$name); - } else { - - $ret['status_ok'] = 1; - if ($action_on_duplicate_name == 'generate_new') { - - $desired_name = $name; - $name = $cfg['prefix_name_for_copy'] . " " . $desired_name; - - if( strlen($name) > self::MAXLEN_NAME ) { - $len2cut = strlen($cfg['prefix_name_for_copy']); - $name = $cfg['prefix_name_for_copy'] . - substr($desired_name,0,self::MAXLEN_NAME-$len2cut); - } - $ret['name'] = $name; - - $ret['msg'] = sprintf(lang_get('created_with_new_name'),$name,$desired_name); - $ret['name_changed'] = true; - } - } - } - } - - if ($ret['status_ok']) - { - // get a new id - $tsuite_id = $this->tree_manager->new_node($parent_id,$this->my_node_type, - $name,$node_order); - $sql = " INSERT INTO {$this->tables['testsuites']} (id,details) " . - " VALUES ({$tsuite_id},'" . $this->db->prepare_string($details) . "')"; - - $result = $this->db->exec_query($sql); - if ($result) - { - $ret['id'] = $tsuite_id; - - if (defined('TL_APICALL')) - { - $ctx = array('id' => $tsuite_id,'name' => $name,'details' => $details); - event_signal('EVENT_TEST_SUITE_CREATE', $ctx); - } - } - } - - return $ret; - } - - - /** - * update - * - * @internal Revisions - * 20100904 - franciscom - added node_order - */ - function update($id, $name, $details, $parent_id=null, $node_order=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret['status_ok']=0; - $ret['msg']=''; - - $safeID = intval($id); - $check = $this->tree_manager->nodeNameExists($name,$this->my_node_type,$safeID,$parent_id); - - if($check['status']==0) - { - $where = " WHERE id = {$safeID} "; - - // Work on enity table - if( !is_null($details) ) - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['testsuites']} " . - " SET details = '" . $this->db->prepare_string($details) . "'" . $where; - $result = $this->db->exec_query($sql); - } - - // Work on nodes hierarchy table - $sqlUpd = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} "; - if( !is_null($name) ) - { - $sql = " SET name='" . $this->db->prepare_string($name) . "' "; - $sql = $sqlUpd . $sql . $where; - $result = $this->db->exec_query($sql); - } - - if( !is_null($node_order) && intval($node_order) > 0 ) - { - $sql = ' SET node_order=' . $this->db->prepare_int(intval($node_order)); - $sql = $sqlUpd . $sql . $where; - $result = $this->db->exec_query($sql); - } - - $ret['status_ok']=1; - $ret['msg']='ok'; - if (!$result) { - $ret['msg'] = $this->db->error_msg(); - } else { - if (defined('TL_APICALL')) { - $ctx = array('id' => $id,'name' => $name,'details' => $details); - event_signal('EVENT_TEST_SUITE_UPDATE', $ctx); - } - } - } else { - $ret['msg']=$check['msg']; - } - return $ret; - } - - - /** - * Delete a Test suite, deleting: - * - Children Test Cases - * - Test Suite Attachments - * - Test Suite Custom fields - * - Test Suite Keywords - * - * IMPORTANT/CRITIC: - * this can used to delete a Test Suite that contains ONLY Test Cases. - * - * This function is needed by tree class method: delete_subtree_objects() - * - * To delete a Test Suite that contains other Test Suites delete_deep() - * must be used. - * - * ATTENTION: may be in future this can be refactored, and written better. - * - */ - function delete($unsafe_id) - { - $tcase_mgr = new testcase($this->db); - $id = intval($unsafe_id); - $tsuite_info = $this->get_by_id($id); - - $testcases=$this->get_children_testcases($id); - if (!is_null($testcases)) - { - foreach($testcases as $the_key => $elem) - { - $tcase_mgr->delete($elem['id']); - } - } - - // What about keywords ??? - $this->cfield_mgr->remove_all_design_values_from_node($id); - $this->deleteAttachments($id); //inherited - $this->deleteKeywords($id); - - $sql = "DELETE FROM {$this->object_table} WHERE id={$id}"; - $result = $this->db->exec_query($sql); - - $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . - "WHERE id={$id} AND node_type_id=" . $this->my_node_type; - $result = $this->db->exec_query($sql); - if ($result) - { - $ctx = array('id' => $id); - event_signal('EVENT_TEST_SUITE_DELETE', $ctx); - } - } - - - - /* - function: get_by_name - - args : name: testsuite name - - returns: array where every element is a map with following keys: - - id: testsuite id (node id) - details - name: testsuite name - - @internal revisions - */ - function get_by_name($name, $parent_id=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my = array(); - $my['opt'] = array('output' => 'full', 'id' => 0); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = "/* $debugMsg */ "; - - switch($my['opt']['output']) - { - case 'minimun': - $sql .= " SELECT TS.id, NH.name, "; - break; - - case 'full': - default: - $sql .= " SELECT TS.*, NH.name, "; - break; - } - - $sql .= " NH.parent_id " . - " FROM {$this->tables['testsuites']} TS " . - " JOIN {$this->tables['nodes_hierarchy']} NH " . - " ON NH.id = TS.id " . - " WHERE NH.name = '" . $this->db->prepare_string($name) . "'"; - - if( !is_null($parent_id) ) - { - $sql .= " AND NH.parent_id = " . $this->db->prepare_int($parent_id); - } - - // useful when trying to check for duplicates ? - if( ($my['opt']['id'] = intval($my['opt']['id'])) > 0) - { - $sql .= " AND TS.id != {$my['opt']['id']} "; - } - - - $rs = $this->db->get_recordset($sql); - return $rs; - } - - /* - function: get_by_id - get info for one (or several) test suite(s) - - args : id: testsuite id - - returns: map with following keys: - - id: testsuite id (node id) (can be an array) - details - name: testsuite name - - - rev : - - */ - function get_by_id($id,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('orderByClause' => '','renderImageInline' => false, - 'fields' => null); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $f2g = is_null($my['opt']['fields']) ? - 'TS.*, NH.name, NH.node_type_id, NH.node_order, NH.parent_id' : - $my['opt']['fields']; - - $sql = "/* $debugMsg */ SELECT {$f2g} " . - " FROM {$this->tables['testsuites']} TS " . - " JOIN {$this->tables['nodes_hierarchy']} NH ON TS.id = NH.id " . - " WHERE TS.id "; - - $sql .= is_array($id) ? " IN (" . implode(',',$id) . ")" : " = {$id} "; - $sql .= $my['opt']['orderByClause']; - - - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - if( !is_null($rs) ) - { - $rs = count($rs) == 1 ? current($rs) : $rs; - } - - // now inline image processing (if needed) - if( !is_null($rs) && $my['opt']['renderImageInline']) - { - $this->renderImageAttachments($id,$rs); - } - - return $rs; - } - - - /* - function: get_all() - get array of info for every test suite without any kind of filter. - Every array element contains an assoc array with test suite info - - args : - - - returns: array - - */ - function get_all() - { - $sql = " SELECT testsuites.*, nodes_hierarchy.name " . - " FROM {$this->tables['testsuites']} testsuites, " . - " {$this->tables['nodes_hierarchy']} nodes_hierarchy " . - " WHERE testsuites.id = nodes_hierarchy.id"; - - $recordset = $this->db->get_recordset($sql); - return($recordset); - } - - - /** - * show() - * - * args: smarty [reference] - * id - * sqlResult [default = ''] - * action [default = 'update'] - * modded_item_id [default = 0] - * - * returns: - - * - **/ - function show(&$smarty,$guiObj,$template_dir, $id, $options=null, - $sqlResult = '', $action = 'update',$modded_item_id = 0) { - - $gui = is_null($guiObj) ? new stdClass() : $guiObj; - $gui->cf = ''; - $gui->sqlResult = ''; - $gui->sqlAction = ''; - - if (!property_exists($gui, 'uploadOp')) { - $gui->uploadOp = null; - } - - $p2ow = array('refreshTree' => false, 'user_feedback' => ''); - foreach($p2ow as $prop => $value) { - if( !property_exists($gui,$prop) ) { - $gui->$prop = $value; - } - } - - - // attachments management on page - $gui->fileUploadURL = $_SESSION['basehref'] . $this->getFileUploadRelativeURL($id); - $gui->delAttachmentURL = $_SESSION['basehref'] . $this->getDeleteAttachmentRelativeURL($id); - $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; - $gui->fileUploadMsg = ''; - - - // After test suite edit, display of Test suite do not have upload button enabled for attachment - $my['options'] = array('show_mode' => 'readwrite'); - $my['options'] = array_merge($my['options'], (array)$options); - - if($sqlResult) { - $gui->sqlResult = $sqlResult; - $gui->sqlAction = $action; - } - - - $gui->item_id = $tsuite_id = $id; - if( !property_exists($gui,'tproject_id') ) { - $gui->tproject_id = $this->getTestProjectFromTestSuite($tsuite_id,null); - } - - $gui->modify_tc_rights = - has_rights($this->db,"mgt_modify_tc",$gui->tproject_id); - - if($my['options']['show_mode'] == 'readonly') { - $gui->modify_tc_rights = 'no'; - } - - - $gui->assign_keywords = 0; - if( property_exists($gui, 'user') ) { - $yn = $gui->user->hasRight($this->db,'mgt_modify_key',$gui->tproject_id); - $gui->assign_keywords = ($yn == "yes"); - } - - $gui->container_data = $this->get_by_id($id,array('renderImageInline' => true)); - $gui->moddedItem = $gui->container_data; - if ($modded_item_id) { - $gui->moddedItem = $this->get_by_id($modded_item_id,array('renderImageInline' => true)); - } - - $gui->cf = $this->html_table_of_custom_field_values($id); - $gui->attachmentInfos = getAttachmentInfosFrom($this,$id); - $gui->id = $id; - $gui->page_title = lang_get('testsuite'); - $gui->level = $gui->containerType = 'testsuite'; - $cfg = getWebEditorCfg('design'); - $gui->testDesignEditorType = $cfg['type']; - - $gui->calledByMethod = 'testsuite::show'; - - $kopt = array('order_by_clause' => ' ORDER BY keyword ASC ', - 'output' => 'with_link_id'); - $gui->keywords_map = $this->get_keywords_map($id,$kopt); - - $of = array('output' => 'html_options', - 'add_blank' => true, - 'tproject_id' => $gui->tproject_id); - $gui->freeKeywords = $this->getFreeKeywords($id,$of); - - $smarty->assign('gui',$gui); - $smarty->display($template_dir . 'containerView.tpl'); - } - - - /* - function: viewer_edit_new - Implements user interface (UI) for edit testuite and - new/create testsuite operations. - - - args : smarty [reference] - webEditorHtmlNames - oWebEditor: rich editor object (today is FCK editor) - action - parent_id: testsuite parent id on tree. - [id] - [messages]: default null - map with following keys - [result_msg]: default: null used to give information to user - [user_feedback]: default: null used to give information to user - - // [$userTemplateCfg]: configurations, Example: testsuite template usage - [$userTemplateKey]: main Key to access item template configuration - [$userInput] - - returns: - - - */ - function viewer_edit_new(&$smarty,$template_dir,$webEditorHtmlNames, $oWebEditor, - $action, $parent_id,$id=null, $messages=null, - $userTemplateKey=null, $userInput=null) - { - $internalMsg = array('result_msg' => null, 'user_feedback' => null); - $the_data = null; - $name = ''; - - if( !is_null($messages) ) { - $internalMsg = array_merge($internalMsg, $messages); - } - - $useUserInput = is_null($userInput) ? 0 : 1; - $cf_smarty=-2; // MAGIC must be explained - $pnode_info=$this->tree_manager->get_node_hierarchy_info($parent_id); - - $parent_info['description']=lang_get($this->node_types_id_descr[$pnode_info['node_type_id']]); - $parent_info['name']=$pnode_info['name']; - - - $a_tpl = array('edit_testsuite' => 'containerEdit.tpl','new_testsuite' => 'containerNew.tpl', - 'add_testsuite' => 'containerNew.tpl'); - - $the_tpl = $a_tpl[$action]; - $smarty->assign('sqlResult', $internalMsg['result_msg']); - $smarty->assign('containerID',$parent_id); - $smarty->assign('user_feedback', $internalMsg['user_feedback'] ); - - if( $useUserInput ) - { - $webEditorData = $userInput; - } - else - { - $the_data = null; - $name = ''; - if ($action == 'edit_testsuite') - { - $the_data = $this->get_by_id($id); - $name=$the_data['name']; - $smarty->assign('containerID',$id); - } - $webEditorData = $the_data; - } - - $cf_smarty = $this->html_table_of_custom_field_inputs($id,$parent_id,'design','',$userInput); - - // webeditor - // templates will be also used after 'add_testsuite', when - // presenting a new test suite with all other fields empty. - if( !$useUserInput ) - { - if( ($action == 'new_testsuite' || $action == 'add_testsuite') && !is_null($userTemplateKey) ) - { - // need to understand if need to use templates - $webEditorData=$this->_initializeWebEditors($webEditorHtmlNames,$userTemplateKey); - } - } - - foreach ($webEditorHtmlNames as $key) { - // Warning: - // the data assignment will work while the keys in $the_data are identical - // to the keys used on $oWebEditor. - $of = &$oWebEditor[$key]; - $of->Value = isset($webEditorData[$key]) ? $webEditorData[$key] : null; - $smarty->assign($key, $of->CreateHTML()); - } - - $smarty->assign('cf',$cf_smarty); - $smarty->assign('parent_info', $parent_info); - $smarty->assign('level', 'testsuite'); - $smarty->assign('name',$name); - $smarty->assign('container_data',$the_data); - $smarty->display($template_dir . $the_tpl); - } - - - /* - function: copy_to - deep copy one testsuite to another parent (testsuite or testproject). - - - args : id: testsuite id (source or copy) - parent_id: - user_id: who is requesting copy operation - [check_duplicate_name]: default: 0 -> do not check - 1 -> check for duplicate when doing copy - What to do if duplicate exists, is controlled - by action_on_duplicate_name argument. - - [action_on_duplicate_name argument]: default: 'allow_repeat'. - Used when check_duplicate_name=1. - Specifies how to react if duplicate name exists. - - - - - returns: map with foloowing keys: - status_ok: 0 / 1 - msg: 'ok' if status_ok == 1 - id: new created if everything OK, -1 if problems. - - @internal revisions - When copying a project, external TC ID is not preserved - added option 'preserve_external_id' needed by tcase copy_to() - - */ - function copy_to($id, $parent_id, $user_id,$options=null,$mappings=null) { - - $my['options'] = array('check_duplicate_name' => 0, - 'action_on_duplicate_name' => 'allow_repeat', - 'copyKeywords' => 0, 'copyRequirements' => 0, - 'preserve_external_id' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $my['mappings'] = array(); - $my['mappings'] = array_merge($my['mappings'], (array)$mappings); - - $copyTCaseOpt = array('preserve_external_id' => - $my['options']['preserve_external_id'], - 'copy_also' => - array('keyword_assignments' => - $my['options']['copyKeywords'], - 'requirement_assignments' => - $my['options']['copyRequirements']) ); - - $copyOptions = array('keyword_assignments' => $my['options']['copyKeywords']); - - $tcase_mgr = new testcase($this->db); - $tsuite_info = $this->get_by_id($id); - - $op = $this->create($parent_id,$tsuite_info['name'], - $tsuite_info['details'], - $tsuite_info['node_order'], - $my['options']['check_duplicate_name'], - $my['options']['action_on_duplicate_name']); - - $op['mappings'][$id] = $op['id']; - $new_tsuite_id = $op['id']; - - // Work on root of these subtree - // Attachments - always copied - // Keyword assignment - according to user choice - // Custom Field values - always copied - $oldToNew = $this->copy_attachments($id,$new_tsuite_id); - $inlineImg = null; - if(!is_null($oldToNew)) { - $this->inlineImageProcessing($new_tsuite_id,$tsuite_info['details'],$oldToNew); - } - - if( $my['options']['copyKeywords'] ) { - $kmap = isset($my['mappings']['keywords']) ? $my['mappings']['keywords'] : null; - $this->copy_keyword_assignment($id,$new_tsuite_id,$kmap); - } - $this->copy_cfields_values($id,$new_tsuite_id); - - - $my['filters'] = array('exclude_children_of' => array('testcase' => 'exclude my children')); - $subtree = $this->tree_manager->get_subtree($id,$my['filters']); - if (!is_null($subtree)) { - $parent_decode=array(); - $parent_decode[$id]=$new_tsuite_id; - foreach($subtree as $the_key => $elem) { - $the_parent_id=$parent_decode[$elem['parent_id']]; - switch ($elem['node_type_id']) { - case $this->node_types_descr_id['testcase']: - // forgotten parameter $mappings caused requirement assignments to use wrong IDs - $tcOp = $tcase_mgr->copy_to($elem['id'],$the_parent_id,$user_id,$copyTCaseOpt, $my['mappings']); - $op['mappings'] += $tcOp['mappings']; - break; - - case $this->node_types_descr_id['testsuite']: - $tsuite_info = $this->get_by_id($elem['id']); - $ret = $this->create($the_parent_id,$tsuite_info['name'], - $tsuite_info['details'],$tsuite_info['node_order']); - - $parent_decode[$elem['id']] = $ret['id']; - $op['mappings'][$elem['id']] = $ret['id']; - - $oldToNew = $this->copy_attachments($elem['id'],$ret['id']); - $inlineImg = null; - if(!is_null($oldToNew)) - { - $this->inlineImageProcessing($ret['id'],$tsuite_info['details'],$oldToNew); - } - - if( $my['options']['copyKeywords'] ) - { - $this->copy_keyword_assignment($elem['id'],$ret['id'],$kmap); - } - $this->copy_cfields_values($elem['id'],$ret['id']); - - break; - } - } - } - return $op; - } - - - /* - function: get_subtree - Get subtree that has choosen testsuite as root. - Only nodes of type: - testsuite and testcase are explored and retrieved. - - args: id: testsuite id - [recursive_mode]: default false - - - returns: map - see tree->get_subtree() for details. - - */ - function get_subtree($id,$opt=null) { - $my['options'] = array('recursive' => 0, 'excludeTC' => 0); - $my['options'] = array_merge($my['options'],(array)$opt); - - $my['filters'] = array('exclude_node_types' => $this->nt2exclude, - 'exclude_children_of' => $this->nt2exclude_children); - - if( $my['options']['excludeTC'] ) { - $my['filters']['exclude_node_types']['testcase'] = 'exclude_me'; - } - - $subtree = $this->tree_manager->get_subtree($id,$my['filters'],$my['options']); - return $subtree; - } - - - - /* - function: get_testcases_deep - get all test cases in the test suite and all children test suites - no info about tcversions is returned. - - args : id: testsuite id - [details]: default 'simple' - Structure of elements in returned array, changes according to - this argument: - - 'only_id' - Array that contains ONLY testcase id, no other info. - - 'simple' - Array where each element is a map with following keys. - - id: testcase id - parent_id: testcase parent (a test suite id). - node_type_id: type id, for a testcase node - node_order - node_table: node table, for a testcase. - name: testcase name - external_id: - - 'full' - Complete info about testcase for LAST TCVERSION - TO BE IMPLEMENTED - - returns: array - - */ - function get_testcases_deep($id, $details = 'simple', $options=null) { - $tcase_mgr = new testcase($this->db); - $testcases = null; - - $opt = array('getKeywords' => false); - $opt = array_merge($opt,(array)$options); - - $subtree = $this->get_subtree($id); - $only_id=($details=='only_id') ? true : false; - $doit=!is_null($subtree); - $parentSet=null; - - if($doit) - { - $testcases = array(); - $tcNodeType = $this->node_types_descr_id['testcase']; - $prefix = null; - foreach ($subtree as $the_key => $elem) - { - if($elem['node_type_id'] == $tcNodeType) - { - if ($only_id) - { - $testcases[] = $elem['id']; - } - else - { - // After first call passing $prefix with right value, avoids a function call - // inside of getExternalID(); - list($identity,$prefix,$glueChar,$external) = $tcase_mgr->getExternalID($elem['id'],null,$prefix); - $elem['external_id'] = $identity; - $testcases[]= $elem; - $parentSet[$elem['parent_id']]=$elem['parent_id']; - } - } - } - $doit = count($testcases) > 0; - } - - if($doit && $details=='full') - { - $parentNodes=$this->tree_manager->get_node_hierarchy_info($parentSet); - - $rs=array(); - foreach($testcases as $idx => $value) - { - $item=$tcase_mgr->get_last_version_info($value['id'],array('output' => 'full', 'get_steps' => true)); - $item['tcversion_id']=$item['id']; - $tsuite['tsuite_name']=$parentNodes[$value['parent_id']]['name']; - - if( $opt['getKeywords'] ) - { - $kw = $tcase_mgr->getKeywords($value['id']); - if( !is_null($kw) ) - { - $item['keywords'] = $kw; - } - } - - unset($item['id']); - $rs[]=$value+$item+$tsuite; - } - $testcases=$rs; - } - return $testcases; - } - - - /** - * get_children_testcases - * get only test cases with parent=testsuite without doing a deep search - * - */ - function get_children_testcases($id, $details = 'simple', $options=null) { - $testcases=null; - $only_id=($details=='only_id') ? true : false; - $subtree=$this->tree_manager->get_children($id,array('testsuite' => 'exclude_me')); - $doit=!is_null($subtree); - - $opt = array('getKeywords' => false); - $opt = array_merge($opt,(array)$options); - - - if($doit) - { - $tsuite=$this->get_by_id($id); - $tsuiteName=$tsuite['name']; - $testcases = array(); - foreach ($subtree as $the_key => $elem) - { - if ($only_id) - { - $testcases[] = $elem['id']; - } - else - { - $testcases[]= $elem; - } - } - $doit = count($testcases) > 0; - } - - if($doit && $details=='full') - { - $rs=array(); - $tcase_mgr = new testcase($this->db); - foreach($testcases as $idx => $value) - { - $item=$tcase_mgr->get_last_version_info($value['id'],array('output' => 'full', 'get_steps' => true)); - $item['tcversion_id']=$item['id']; - $parent['tsuite_name']=$tsuiteName; - - if( $opt['getKeywords'] ) - { - $kw = $tcase_mgr->getKeywords($value['id']); - if( !is_null($kw) ) - { - $item['keywords'] = $kw; - } - } - unset($item['id']); - $rs[]=$value+$item+$tsuite; - } - $testcases=$rs; - } - return $testcases; - } - - - - - /* - function: delete_deep - - args : $id - - returns: - - rev : - 20070602 - franciscom - added delete attachments - */ - function delete_deep($id) - { - // BUGID 3147 - Delete test project with requirements defined crashed with memory exhausted - $this->tree_manager->delete_subtree_objects($id,$id,'',array('testcase' => 'exclude_tcversion_nodes')); - $this->delete($id); - } // end function - - - - - - /* - function: initializeWebEditors - - args: - - returns: - - */ - private function _initializeWebEditors($WebEditors,$itemTemplateCfgKey) - { - $wdata=array(); - foreach ($WebEditors as $key => $html_name) - { - $wdata[$html_name] = getItemTemplateContents($itemTemplateCfgKey, $html_name, ''); - } - return $wdata; - } - - - /** - function: getKeywords - Get keyword assigned to a testsuite. - Uses table object_keywords. - - args: id: testsuite id - kw_id: [default = null] the optional keyword id - - returns: null if nothing found. - array, every elemen is map with following structure: - id - keyword - notes - - */ - function getKeywords($id,$kw_id = null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ SELECT keyword_id,keywords.keyword, notes " . - " FROM {$this->tables['object_keywords']}, {$this->tables['keywords']} keywords " . - " WHERE keyword_id = keywords.id AND fk_id = {$id}"; - if (!is_null($kw_id)) { - $sql .= " AND keyword_id = {$kw_id}"; - } - $map_keywords = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - - return $map_keywords; - } - - - /* - function: get_keywords_map - All keywords for a choosen testsuite - - Attention: - probably write on obejct_keywords has not been implemented yet, - then right now thie method can be useless. - - - args :id: testsuite id - [order_by_clause]: default: '' -> no order choosen - must be an string with complete clause, i.e. - 'ORDER BY keyword' - - - - returns: map: key: keyword_id - value: keyword - - - */ - function get_keywords_map($id,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $options = array('order_by_clause' => '', 'output' => 'std'); - $options = array_merge($options,(array)$opt); - $order_by_clause = $options['order_by_clause']; - - $sql = "/* $debugMsg */ - SELECT OKW.id AS kw_link,OKW.keyword_id,keywords.keyword - FROM {$this->tables['object_keywords']} OKW - JOIN {$this->tables['keywords']} keywords - ON OKW.keyword_id = keywords.id "; - - if (is_array($id)) { - $sql .= " AND fk_id IN (".implode(",",$id).") "; - } else { - $sql .= " AND fk_id = {$id} "; - } - - $sql .= $order_by_clause; - - switch( $options['output'] ) { - - case 'with_link_id': - $map_keywords = $this->db->fetchRowsIntoMap($sql,'keyword_id'); - break; - - case 'std': - default: - $map_keywords = $this->db->fetchColumnsIntoMap($sql,'keyword_id','keyword'); - break; - - } - - - return $map_keywords; - } - - - /** - * - * - */ - function addKeyword($id,$kw_id) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $status = 1; - $kw = $this->getKeywords($id,$kw_id); - if( ($doLink = !sizeof($kw)) ) - { - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['object_keywords']} " . - " (fk_id,fk_table,keyword_id) VALUES ($id,'nodes_hierarchy',$kw_id)"; - $status = $this->db->exec_query($sql) ? 1 : 0; - } - return $status; - } - - - /* - function: addKeywords - - args : - - returns: - - */ - function addKeywords($id,$kw_ids) { - $status = 1; - $num_kws = sizeof($kw_ids); - for($idx = 0; $idx < $num_kws; $idx++) { - $status = $status && $this->addKeyword($id,$kw_ids[$idx]); - } - return($status); - } - - - /** - * deleteKeywords - * - */ - function deleteKeywords($id,$kw_id = null) { - $sql = " DELETE FROM {$this->tables['object_keywords']} - WHERE fk_id = {$id} "; - - if (!is_null($kw_id)) { - $sql .= " AND keyword_id = {$kw_id}"; - } - return $this->db->exec_query($sql); - } - - /* - function: exportTestSuiteDataToXML - - args : - - returns: - - */ - function exportTestSuiteDataToXML($container_id,$tproject_id,$optExport = array()) { - static $keywordMgr; - static $getLastVersionOpt = array('output' => 'minimun'); - static $tcase_mgr; - - if(is_null($keywordMgr)) { - $keywordMgr = new tlKeyword(); - - - } - - $xmlTC = null; - $relCache = array(); - - $doRecursion = isset($optExport['RECURSIVE']) ? $optExport['RECURSIVE'] : 0; - - if($doRecursion) { - $cfXML = null; - $attachmentsXML = null; - $kwXML = null; - - if ($container_id == $tproject_id) { - $$tsuiteData = ['id' => '','name' => '','node_order' => 0, 'details' =>'']; - } else { - $tsuiteData = $this->get_by_id($container_id); - if( isset($optExport['KEYWORDS']) && $optExport['KEYWORDS']) { - $kwMap = $this->getKeywords($container_id); - if ($kwMap) { - $kwXML = "" . $keywordMgr->toXMLString($kwMap,true) . ""; - } - } - if (isset($optExport['CFIELDS']) && $optExport['CFIELDS']) { - $cfMap = (array)$this->get_linked_cfields_at_design($container_id,null,null,$tproject_id); - if( count($cfMap) > 0 ) { - $cfXML = $this->cfield_mgr->exportValueAsXML($cfMap); - } - } - - $attach = []; - if (isset($optExport['ATTACHMENTS']) && $optExport['ATTACHMENTS']) { - $attachments=null; - - // get all attachments - $attInfos = $this->attachmentRepository->getAttachmentInfosFor($container_id,$this->attachmentTableName,'id'); - - // get all attachments content and encode it in base64 - if ($attInfos) { - foreach ($attInfos as $axInfo) { - $aID = $axInfo["id"]; - $content = $this->attachmentRepository->getAttachmentContent($aID, $axInfo); - - if ($content != null) { - $attach[$aID]["id"] = $aID; - $attach[$aID]["name"] = $axInfo["file_name"]; - $attach[$aID]["file_type"] = $axInfo["file_type"]; - $attach[$aID]["title"] = $axInfo["title"]; - $attach[$aID]["date_added"] = $axInfo["date_added"]; - $attach[$aID]["content"] = base64_encode($content); - } - } - } - - if( !is_null($attach) && count($attach) > 0 ) { - $attchRootElem = "\n{{XMLCODE}}\n"; - $attchElemTemplate = "\t\n" . - "\t\t\n" . - "\t\t\n" . - "\t\t\n" . - "\t\t\n" . - "\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . - "\t\t\n" . - "\t\t\n" . - "\t\n"; - - $attchDecode = array ("||ATTACHMENT_ID||" => "id", "||ATTACHMENT_NAME||" => "name", - "||ATTACHMENT_FILE_TYPE||" => "file_type", - "||ATTACHMENT_FILE_SIZE||" => "file_size", - "||ATTACHMENT_TITLE||" => "title", - "||ATTACHMENT_DATE_ADDED||" => "date_added", - "||ATTACHMENT_CONTENT||" => "content"); - $attachXML = exportDataToXML($attach,$attchRootElem,$attchElemTemplate,$attchDecode,true); - } - } - } - $xmlTC = '' . - "\n\n" . - "
    \n{$kwXML}{$cfXML}{$attachXML}"; - - } else { - $xmlTC = ""; - } - - $topt = array('recursive' => self::USE_RECURSIVE_MODE); - if( isset($optExport['skeleton']) && $optExport['skeleton'] ) { - $topt['excludeTC'] = true; - } - $test_spec = $this->get_subtree($container_id,$topt); - - $childNodes = isset($test_spec['childNodes']) ? $test_spec['childNodes'] : null ; - $tcase_mgr=null; - $relXmlData = ''; - if( !is_null($childNodes) ) { - $loop_qty=sizeof($childNodes); - for($idx = 0;$idx < $loop_qty;$idx++) { - $cNode = $childNodes[$idx]; - $nTable = $cNode['node_table']; - if ($doRecursion && $nTable == 'testsuites') { - $xmlTC .= $this->exportTestSuiteDataToXML($cNode['id'],$tproject_id,$optExport); - } else if ($nTable == 'testcases') { - if( is_null($tcase_mgr) ) { - $tcase_mgr = new testcase($this->db); - } - $xmlTC .= $tcase_mgr->exportTestCaseDataToXML($cNode['id'], - testcase::LATEST_VERSION, - $tproject_id, - true, - $optExport); - - // 20140816 - // Collect and do cache of all test case relations that exists inside this test suite. - $relSet = $tcase_mgr->getRelations($cNode['id']); - if($relSet['num_relations'] >0) { - foreach($relSet['relations'] as $key => $rel) { - // If we have already found this relation, skip it. - if ( !in_array($rel['id'], $relCache) ) { - $relXmlData .= $tcase_mgr->exportRelationToXML($rel,$relSet['item']); - $relCache[] = $rel['id']; - } - } - } - } - } - } - // after we scanned all relations and exported all relations to xml, let's output it to the XML buffer - $xmlTC .= $relXmlData; - $xmlTC .= $doRecursion ? "
    " : ""; - return $xmlTC; - } - - - // ------------------------------------------------------------------------------- - // Custom field related methods - // ------------------------------------------------------------------------------- - /* - function: get_linked_cfields_at_design - - - args: $id - [$parent_id]: - [$filtesr]: default: null - - returns: hash - - rev : - */ - function get_linked_cfields_at_design($id,$parent_id=null,$filters=null,$tproject_id = null,$access_key='id') - { - if (!$tproject_id) - { - $tproject_id = $this->getTestProjectFromTestSuite($id,$parent_id); - } - $cf_map = $this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::CF_ENABLED, - $filters,'testsuite',$id,$access_key); - return $cf_map; - } - - /** - * getTestProjectFromTestSuite() - * - */ - function getTestProjectFromTestSuite($id,$parent_id) { - $tproject_id = $this->tree_manager->getTreeRoot( (!is_null($id) && $id > 0) ? $id : $parent_id); - return $tproject_id; - } - - /* - function: get_linked_cfields_at_execution - - - args: $id - [$parent_id] - [$filters] - keys: $show_on_execution: default: null - 1 -> filter on field show_on_execution=1 - 0 or null -> don't filter - - - returns: hash - - rev : - 20110129 - franciscom - BUGID 4202 - */ - function get_linked_cfields_at_execution($id,$parent_id=null,$filters=null,$tproject_id=null) - { - - if (!$tproject_id) - { - $the_path=$this->tree_manager->get_path(!is_null($id) ? $id : $parent_id); - $path_len=count($the_path); - $tproject_id=($path_len > 0)? $the_path[$path_len-1]['parent_id'] : $parent_id; - } - - $cf_map=$this->cfield_mgr->get_linked_cfields_at_design($tproject_id,cfield_mgr::CF_ENABLED, - $filters,'testsuite',$id); - return($cf_map); - } - - - - /* - function: html_table_of_custom_field_inputs - - - args: $id - [$parent_id]: need when you call this method during the creation - of a test suite, because the $id will be 0 or null. - - [$scope]: 'design','execution' - - returns: html string - - */ - function html_table_of_custom_field_inputs($id,$parent_id=null,$scope='design',$name_suffix='',$input_values=null) - { - $cf_smarty=''; - $method_suffix = $scope=='design' ? $scope : 'execution'; - $method_name = "get_linked_cfields_at_{$method_suffix}"; - $cf_map=$this->$method_name($id,$parent_id); - - if(!is_null($cf_map)) - { - $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map,$name_suffix,$input_values); - } - return($cf_smarty); - } - - - /* - function: html_table_of_custom_field_values - - - args: $id - [$scope]: 'design','execution' - [$show_on_execution]: default: null - 1 -> filter on field show_on_execution=1 - 0 or null -> don't filter - - returns: html string - - */ - function html_table_of_custom_field_values($id,$scope='design',$show_on_execution=null, - $tproject_id = null,$formatOptions=null) - { - $filters=array('show_on_execution' => $show_on_execution); - $label_css_style=' class="labelHolder" ' ; - $value_css_style = ' '; - - $add_table=true; - $table_style=''; - if( !is_null($formatOptions) ) - { - $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; - $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; - - $add_table=isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; - $table_style=isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; - } - - $cf_smarty=''; - $parent_id=null; - - // BUGID 3989 - $show_cf = config_get('custom_fields')->show_custom_fields_without_value; - - if( $scope=='design' ) - { - $cf_map = $this->get_linked_cfields_at_design($id,$parent_id,$filters,$tproject_id); - } - else - { - // Important: remember that for Test Suite, custom field value CAN NOT BE changed - // at execution time just displayed. - // 20110129 - if we know test project id is better to use it - $cf_map=$this->get_linked_cfields_at_execution($id,null,null,$tproject_id); - } - - if( !is_null($cf_map) ) - { - foreach($cf_map as $cf_id => $cf_info) - { - // if user has assigned a value, then node_id is not null - // BUGID 3989 - if($cf_info['node_id'] || $show_cf) - { - // true => do not create input in audit log - $label=str_replace(TL_LOCALIZE_TAG,'',lang_get($cf_info['label'],null,true)); - $cf_smarty .= "" . htmlspecialchars($label) . "" . - "" . - $this->cfield_mgr->string_custom_field_value($cf_info,$id) . - "\n"; - } - } - } - if((trim($cf_smarty) != "") && $add_table) - { - $cf_smarty = "" . $cf_smarty . "
    "; - } - return($cf_smarty); - } // function end - - - /** - * Copy attachments from source test suite to target test suite - * - **/ - function copy_attachments($source_id,$target_id) - { - return $this->attachmentRepository->copyAttachments($source_id,$target_id,$this->attachmentTableName); - } - - /** - * Copy keyword assignment - * mappings is only useful when source_id and target_id do not belong to same Test Project. - * Because keywords are defined INSIDE a Test Project, ID will be different for same keyword - * in a different Test Project - * - **/ - function copy_keyword_assignment($source_id,$target_id,$mappings) - { - // Get source_id keyword assignment - $sourceItems = $this->getKeywords($source_id); - if( !is_null($sourceItems) ) - { - // build item id list - $keySet = array_keys($sourceItems); - foreach($keySet as $itemPos => $itemID) - { - if( isset($mappings[$itemID]) ) - { - $keySet[$itemPos] = $mappings[$itemID]; - } - } - $this->addKeywords($target_id,$keySet); - } - } - - /** - * Copy Custom Fields values - * - **/ - function copy_cfields_values($source_id,$target_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - // Get source_id cfields assignment - $sourceItems = $this->cfield_mgr->getByLinkID($source_id,array('scope' => 'design')); - if( !is_null($sourceItems) ) - { - $sql = "/* $debugMsg */ " . - " INSERT INTO {$this->tables['cfield_design_values']} " . - " (field_id,value,node_id) " . - " SELECT field_id,value,{$target_id} AS target_id" . - " FROM {$this->tables['cfield_design_values']} " . - " WHERE node_id = {$source_id} "; - $this->db->exec_query($sql); - } - } - - - /** - * get_children - * get test suites with parent = testsuite with given id - * - */ - function get_children($id,$options=null) - { - $itemSet = null; - $my['options'] = array('details' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - $subtree = $this->tree_manager->get_children($id, array('testcase' => 'exclude_me')); - if(!is_null($subtree) && count($subtree) > 0) - { - foreach( $subtree as $the_key => $elem) - { - $itemKeys[] = $elem['id']; - } - - if($my['options']['details'] == 'full') - { - $itemSet = $this->get_by_id($itemKeys, array('orderByClause' => 'ORDER BY node_order')); - } - else - { - $itemSet = $itemKeys; - } - } - return $itemSet; - } - - /** - * get_branch - * get ONLY test suites (no other kind of node) ON BRANCH with ROOT = testsuite with given id - * - */ - function get_branch($id) { - $branch = $this->tree_manager->get_subtree_list($id,$this->my_node_type); - return $branch; - } - - - /** - * - * 'name' - * 'testProjectID' - * 'parentID' - * 'notes' - * - */ - function createFromObject($item,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['opt'] = array('doChecks' => false, 'setSessionProject' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - define('DBUG_ON',1); - try - { - // mandatory checks - if(strlen($item->name)==0) - { - throw new Exception('Empty name is not allowed'); - } - - // what checks need to be done ? - // 1. test project exist - $pinfo = $this->tree_manager->get_node_hierarchy_info($item->testProjectID); - if(is_null($pinfo) || $this->node_types_id_descr[$pinfo['node_type_id']] != 'testproject') - { - throw new Exception('Test project ID does not exist'); - } - - // 2. parentID exists and its node type can be: - // testproject,testsuite - // - $pinfo = $this->tree_manager->get_node_hierarchy_info($item->parentID); - if(is_null($pinfo)) - { - throw new Exception('Parent ID does not exist'); - } - - if($this->node_types_id_descr[$pinfo['node_type_id']] != 'testproject' && - $this->node_types_id_descr[$pinfo['node_type_id']] != 'testsuite' - ) - { - throw new Exception('Node Type for Parent ID is not valid'); - } - - - // 3. there is NO other test suite children of parent id node with same name - $name = trim($item->name); - $op = $this->checkNameExistence($name,$item->parentID); - if(!$op['status_ok']) - { - throw new Exception('Test suite name is already in use at same level'); - } - } - catch (Exception $e) - { - throw $e; // rethrow - } - - $id = $this->tree_manager->new_node($item->parentID,$this->my_node_type, - $name,intval($item->order)); - - $sql = " INSERT INTO {$this->tables['testsuites']} (id,details) " . - " VALUES ({$id},'" . $this->db->prepare_string($item->notes) . "')"; - - $result = $this->db->exec_query($sql); - return $result ? $id : 0; - } - - /** - * Checks is there is another test plan inside test project - * with different id but same name - * - **/ - function checkNameExistence($name,$parentID,$id=0) - { - $check_op['msg'] = ''; - $check_op['status_ok'] = 1; - - $getOpt = array('output' => 'minimun', 'id' => intval($id)); - if( $this->get_by_name( $name,intval($parentID), $getOpt) ) - { - $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'),$name); - $check_op['status_ok'] = 0; - } - return $check_op; - } - - /** - * - * @used-by containerEdit.php, testsuite.class.php.show - */ - function getFileUploadRelativeURL($id) - { - // I've to use testsuiteID because this is how is name on containerEdit.php - $url = "lib/testcases/containerEdit.php?containerType=testsuite&doAction=fileUpload&testsuiteID=" . intval($id); - return $url; - } - - /** - * @used-by containerEdit.php, testsuite.class.php.show - */ - function getDeleteAttachmentRelativeURL($id) - { - // I've to use testsuiteID because this is how is name on containerEdit.php - $url = "lib/testcases/containerEdit.php?containerType=testsuite&doAction=deleteFile&testsuiteID=" . intval($id) . - "&file_id=" ; - return $url; - } - - - /** - * render Image Attachments INLINE - * - * - */ - function renderImageAttachments($id,&$item2render,$basehref=null) - { - static $attSet; - static $targetTag; - - if(!$attSet || !isset($attSet[$id])) - { - $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor($id,$this->attachmentTableName,'id'); - $beginTag = '[tlInlineImage]'; - $endTag = '[/tlInlineImage]'; - } - - if(is_null($attSet[$id])) - { - return; - } - - // $href = '%s:%s' . " $versionTag (link)

    "; - // second \'%s\' needed if I want to use Latest as indication, need to understand - // Javascript instead of javascript, because CKeditor sometimes complains - // - // CRITIC: skipCheck is needed to render OK when creating report on Pseudo-Word format. - $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; - $img = '

    '; - - $key2check = array('details'); - $rse = &$item2render; - foreach($key2check as $item_key) - { - $start = strpos($rse[$item_key],$beginTag); - $ghost = $rse[$item_key]; - - // There is at least one request to replace ? - if($start !== FALSE) - { - $xx = explode($beginTag,$rse[$item_key]); - - // How many requests to replace ? - $xx2do = count($xx); - $ghost = ''; - for($xdx=0; $xdx < $xx2do; $xdx++) - { - // Hope was not a false request. - if( strpos($xx[$xdx],$endTag) !== FALSE) - { - // Separate command string from other text - // Theorically can be just ONE, but it depends - // is user had not messed things. - $yy = explode($endTag,$xx[$xdx]); - if( ($elc = count($yy)) > 0) - { - $atx = $yy[0]; - try - { - if(isset($attSet[$id][$atx]) && $attSet[$id][$atx]['is_image']) - { - $sec = hash('sha256', $attSet[$id][$atx]['file_name']); - $ghost .= str_replace(array('%id%','%sec%'),array($atx,$sec),$img); - } - $lim = $elc-1; - for($cpx=1; $cpx <= $lim; $cpx++) - { - $ghost .= $yy[$cpx]; - } - } - catch (Exception $e) - { - $ghost .= $rse[$item_key]; - } - } - } - else - { - // nothing to do - $ghost .= $xx[$xdx]; - } - } - } - - // reconstruct field contents - if($ghost != '') - { - $rse[$item_key] = $ghost; - } - } - } - - /** - * - */ - function updateDetails($id,$details) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ UPDATE {$this->tables['testsuites']} " . - " SET details = '" . $this->db->prepare_string($details) . "'" . - " WHERE id = " . intval($id); - $result = $this->db->exec_query($sql); - - } - - /** - * - * - */ - function inlineImageProcessing($id,$details,$rosettaStone) { - // get all attachments, then check is there are images - $att = $this->attachmentRepository->getAttachmentInfosFor($id,$this->attachmentTableName,'id'); - - foreach($rosettaStone as $oid => $nid) { - if($att[$nid]['is_image']) { - $needle = str_replace($nid,$oid,$att[$nid]['inlineString']); - $inlineImg[] = array('needle' => $needle, 'rep' => $att[$nid]['inlineString']); - } - } - - if( !is_null($inlineImg) ) { - $dex = $details; - foreach($inlineImg as $elem) { - $dex = str_replace($elem['needle'],$elem['rep'],$dex); - } - $this->updateDetails($id,$dex); - } - } - - - /** - * - * - */ - function buildDirectWebLink($base_href,$id,$tproject_id) { - $tproject_mgr = new testproject($this->db); - $prefix = $tproject_mgr->getTestCasePrefix($tproject_id); - $dl = $base_href . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . '&item=testsuite&id=' . $id; - return $dl; - } - - /** - * - * get only test cases with parent=testsuite without doing a deep search - * - */ - function getChildrenLatestTCVersion($id) { - - $testcases = null; - $items = null; - $subtree = - $this->tree_manager->get_children($id,array('testsuite' => 'exclude_me')); - - $doit = !is_null($subtree); - - if($doit) { - $tsuite = $this->get_by_id($id); - $tsuiteName = $tsuite['name']; - $testcases = array(); - foreach ($subtree as $the_key => $elem) { - $testcases[] = $elem['id']; - } - $doit = count($testcases) > 0; - } - - if( $doit ) { - $inClause = implode(',',$testcases); - $sql = " SELECT tcversion_id - FROM {$this->views['latest_tcase_version_id']} - WHERE testcase_id IN ($inClause) "; - - $items = $this->db->get_recordset($sql); - } - - - return $items; - } - - /** - * - */ - function getTSuitesFilteredByKWSet( $id, $opt = null, $filters = null ) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $options = array('output' => 'std'); - $options = array_merge($options, (array)$opt); - - $fil = array('keywordsIn' => null, 'keywordsLikeStart' => null); - $fil = array_merge($fil, (array)$filters); - - $fields = 'fk_id AS tsuite_id, NHTS.name AS tsuite_name,'; - - if( null != $fil['keywordsLikeStart'] ) { - $target = trim($fil['keywordsLikeStart']); - $fields .= " CONCAT(REPLACE(KW.keyword,'{$target}',''),':', NHTS.name) AS dyn_string "; - } else { - $fields .= " CONCAT(KW.keyword,':', NHTS.name) AS dyn_string "; - } - - switch($options['output']) { - case 'kwname': - $fields .= ',KW.keyword'; - break; - - default: - $fields .= ",keyword_id,KW.keyword"; - break; - } - - $sql = "/* $debugMsg */ + "XML" + ); + + private $exportFileTypes = array( + "XML" => "XML" + ); + + // Node Types (NT) + private $nt2exclude = array( + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + private $nt2excludeChildren = array( + 'testcase' => 'exclude_my_children', + 'requirement_spec' => 'exclude_my_children' + ); + + /** + * testplan class constructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + $this->db = &$db; + + $this->tree_manager = new tree($this->db); + $this->node_types_descr_id = $this->tree_manager->get_available_node_types(); + $this->nodeTypesIdDescr = array_flip($this->node_types_descr_id); + $this->my_node_type = $this->node_types_descr_id['testsuite']; + + $this->cfield_mgr = new cfield_mgr($this->db); + + // ATTENTION: + // second argument is used to set $this->attachmentTableName,property that this calls + // get from his parent + // tlObjectWithAttachments::__construct($this->db,'nodes_hierarchy'); + parent::__construct($this->db, "nodes_hierarchy"); + + // Must be setted AFTER call to parent constructor + $this->objectTable = $this->tables['testsuites']; + + $this->debugMsg = ' Class:' . __CLASS__ . ' - Method: '; + } + + /* + * returns: map + * key: export file type code + * value: export file type verbose description + */ + public function get_export_file_types() + { + return $this->exportFileTypes; + } + + /* + * function: get_impor_file_types + * getter + * + * args: - + * + * returns: map + * key: import file type code + * value: import file type verbose description + * + */ + public function get_import_file_types() + { + return $this->importFileTypes; + } + + /* + * args : + * $parent_id + * $name + * $details + * [$check_duplicate_name] + * [$action_on_duplicate_name] + * [$order] + * returns: hash + * $ret['status_ok'] -> 0/1 + * $ret['msg'] + * $ret['id'] -> when status_ok=1, id of the new element + * rev : + */ + public function create($parent_id, $name, $details, $order = null, + $check_duplicate_name = 0, $action_on_duplicate_name = 'allow_repeat') + { + static $l18n; + static $cfg; + if (! $cfg) { + $cfg = array(); + $cfg['prefix_name_for_copy'] = config_get('prefix_name_for_copy'); + $cfg['node_order'] = config_get('treemenu_default_testsuite_order'); + + $l18n = array(); + $l18n['component_name_already_exists'] = lang_get( + 'component_name_already_exists'); + } + + if (is_null($order)) { + // @since 1.9.13 + // + // $node_order = isset($cfg['treemenu_default_testsuite_order']) ? + // $cfg['treemenu_default_testsuite_order'] : 0; + // get all siblings, then calculate bottom + // this way theorically each will be a different order. + // this can be good when ordering + $node_order = $this->tree_manager->getBottomOrder($parent_id, + array( + 'node_type' => 'testsuite' + )) + 1; + } else { + $node_order = $order; + } + + $name = trim($name); + $ret = array( + 'status_ok' => 1, + 'id' => 0, + 'msg' => 'ok', + 'name' => '', + 'name_changed' => false + ); + + if ($check_duplicate_name) { + $check = $this->tree_manager->nodeNameExists($name, + $this->my_node_type, null, $parent_id); + if ($check['status'] == 1) { + if ($action_on_duplicate_name == 'block') { + $ret['status_ok'] = 0; + $ret['msg'] = sprintf( + $l18n['component_name_already_exists'], $name); + } else { + + $ret['status_ok'] = 1; + if ($action_on_duplicate_name == 'generate_new') { + + $desired_name = $name; + $name = $cfg['prefix_name_for_copy'] . " " . + $desired_name; + + if (strlen($name) > self::MAXLEN_NAME) { + $len2cut = strlen($cfg['prefix_name_for_copy']); + $name = $cfg['prefix_name_for_copy'] . + substr($desired_name, 0, + self::MAXLEN_NAME - $len2cut); + } + $ret['name'] = $name; + + $ret['msg'] = sprintf(lang_get('created_with_new_name'), + $name, $desired_name); + $ret['name_changed'] = true; + } + } + } + } + + if ($ret['status_ok']) { + // get a new id + $tsuite_id = $this->tree_manager->new_node($parent_id, + $this->my_node_type, $name, $node_order); + $sql = " INSERT INTO {$this->tables['testsuites']} (id,details) " . + " VALUES ({$tsuite_id},'" . $this->db->prepare_string($details) . + "')"; + + $result = $this->db->exec_query($sql); + if ($result) { + $ret['id'] = $tsuite_id; + + if (defined('TL_APICALL')) { + $ctx = array( + 'id' => $tsuite_id, + 'name' => $name, + 'details' => $details + ); + event_signal('EVENT_TEST_SUITE_CREATE', $ctx); + } + } + } + + return $ret; + } + + /** + * update + * + * @internal Revisions + * 20100904 - franciscom - added node_order + */ + public function update($id, $name, $details, $parent_id = null, + $node_order = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $ret['status_ok'] = 0; + $ret['msg'] = ''; + + $safeID = intval($id); + $check = $this->tree_manager->nodeNameExists($name, $this->my_node_type, + $safeID, $parent_id); + + if ($check['status'] == 0) { + $where = " WHERE id = {$safeID} "; + + // Work on enity table + if (! is_null($details)) { + $sql = "/* $debugMsg */ UPDATE {$this->tables['testsuites']} " . + " SET details = '" . $this->db->prepare_string($details) . + "'" . $where; + $result = $this->db->exec_query($sql); + } + + // Work on nodes hierarchy table + $sqlUpd = "/* $debugMsg */ UPDATE {$this->tables['nodes_hierarchy']} "; + if (! is_null($name)) { + $sql = " SET name='" . $this->db->prepare_string($name) . "' "; + $sql = $sqlUpd . $sql . $where; + $result = $this->db->exec_query($sql); + } + + if (! is_null($node_order) && intval($node_order) > 0) { + $sql = ' SET node_order=' . + $this->db->prepare_int(intval($node_order)); + $sql = $sqlUpd . $sql . $where; + $result = $this->db->exec_query($sql); + } + + $ret['status_ok'] = 1; + $ret['msg'] = 'ok'; + if (! $result) { + $ret['msg'] = $this->db->error_msg(); + } else { + if (defined('TL_APICALL')) { + $ctx = array( + 'id' => $id, + 'name' => $name, + 'details' => $details + ); + event_signal('EVENT_TEST_SUITE_UPDATE', $ctx); + } + } + } else { + $ret['msg'] = $check['msg']; + } + return $ret; + } + + /** + * Delete a Test suite, deleting: + * - Children Test Cases + * - Test Suite Attachments + * - Test Suite Custom fields + * - Test Suite Keywords + * + * IMPORTANT/CRITIC: + * this can used to delete a Test Suite that contains ONLY Test Cases. + * + * This function is needed by tree class method: delete_subtree_objects() + * + * To delete a Test Suite that contains other Test Suites delete_deep() + * must be used. + * + * ATTENTION: may be in future this can be refactored, and written better. + */ + public function delete($unsafe_id) + { + $tcaseMgr = new testcase($this->db); + $id = intval($unsafe_id); + $this->get_by_id($id); + + $testcases = $this->get_children_testcases($id); + if (! is_null($testcases)) { + foreach ($testcases as $elem) { + $tcaseMgr->delete($elem['id']); + } + } + + // What about keywords ??? + $this->cfield_mgr->remove_all_design_values_from_node($id); + $this->deleteAttachments($id); // inherited + $this->deleteKeywords($id); + + $sql = "DELETE FROM {$this->objectTable} WHERE id={$id}"; + $this->db->exec_query($sql); + + $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} " . + "WHERE id={$id} AND node_type_id=" . $this->my_node_type; + $result = $this->db->exec_query($sql); + if ($result) { + $ctx = array( + 'id' => $id + ); + event_signal('EVENT_TEST_SUITE_DELETE', $ctx); + } + } + + /* + * function: get_by_name + * + * args : name: testsuite name + * + * returns: array where every element is a map with following keys: + * + * id: testsuite id (node id) + * details + * name: testsuite name + * + * @internal revisions + */ + public function get_by_name($name, $parent_id = null, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my = array(); + $my['opt'] = array( + 'output' => 'full', + 'id' => 0 + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "/* $debugMsg */ "; + + switch ($my['opt']['output']) { + case 'minimun': + $sql .= " SELECT TS.id, NH.name, "; + break; + + case 'full': + default: + $sql .= " SELECT TS.*, NH.name, "; + break; + } + + $sql .= " NH.parent_id " . " FROM {$this->tables['testsuites']} TS " . + " JOIN {$this->tables['nodes_hierarchy']} NH " . " ON NH.id = TS.id " . + " WHERE NH.name = '" . $this->db->prepare_string($name) . "'"; + + if (! is_null($parent_id)) { + $sql .= " AND NH.parent_id = " . $this->db->prepare_int($parent_id); + } + + // useful when trying to check for duplicates ? + if (($my['opt']['id'] = intval($my['opt']['id'])) > 0) { + $sql .= " AND TS.id != {$my['opt']['id']} "; + } + + return $this->db->get_recordset($sql); + } + + /* + * function: get_by_id + * get info for one (or several) test suite(s) + * + * args : id: testsuite id + * + * returns: map with following keys: + * + * id: testsuite id (node id) (can be an array) + * details + * name: testsuite name + * + * + * rev : + * + */ + public function get_by_id($id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $my['opt'] = array( + 'orderByClause' => '', + 'renderImageInline' => false, + 'fields' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $f2g = is_null($my['opt']['fields']) ? 'TS.*, NH.name, NH.node_type_id, NH.node_order, NH.parent_id' : $my['opt']['fields']; + + $sql = "/* $debugMsg */ SELECT {$f2g} " . + " FROM {$this->tables['testsuites']} TS " . + " JOIN {$this->tables['nodes_hierarchy']} NH ON TS.id = NH.id " . + " WHERE TS.id "; + + $sql .= is_array($id) ? " IN (" . implode(',', $id) . ")" : " = {$id} "; + $sql .= $my['opt']['orderByClause']; + + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + if (! is_null($rs)) { + $rs = count($rs) == 1 ? current($rs) : $rs; + } + + // now inline image processing (if needed) + if (! is_null($rs) && $my['opt']['renderImageInline']) { + $this->renderImageAttachments($id, $rs); + } + + return $rs; + } + + /* + * function: get_all() + * get array of info for every test suite without any kind of filter. + * Every array element contains an assoc array with test suite info + * + * args : - + * + * returns: array + * + */ + public function get_all() + { + $sql = " SELECT testsuites.*, nodes_hierarchy.name " . + " FROM {$this->tables['testsuites']} testsuites, " . + " {$this->tables['nodes_hierarchy']} nodes_hierarchy " . + " WHERE testsuites.id = nodes_hierarchy.id"; + + return $this->db->get_recordset($sql); + } + + /** + * show() + * + * args: smarty [reference] + * id + * sqlResult [default = ''] + * action [default = 'update'] + * modded_item_id [default = 0] + * + * returns: - + */ + public function show(&$smarty, $guiObj, $template_dir, $id, $options = null, + $sqlResult = '', $action = 'update', $modded_item_id = 0) + { + $gui = is_null($guiObj) ? new stdClass() : $guiObj; + $gui->cf = ''; + $gui->sqlResult = ''; + $gui->sqlAction = ''; + + if (! property_exists($gui, 'uploadOp')) { + $gui->uploadOp = null; + } + + $p2ow = array( + 'refreshTree' => false, + 'user_feedback' => '' + ); + foreach ($p2ow as $prop => $value) { + if (! property_exists($gui, $prop)) { + $gui->$prop = $value; + } + } + + // attachments management on page + $gui->fileUploadURL = $_SESSION['basehref'] . + $this->getFileUploadRelativeURL($id); + $gui->delAttachmentURL = $_SESSION['basehref'] . + $this->getDeleteAttachmentRelativeURL($id); + $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; + $gui->fileUploadMsg = ''; + + // After test suite edit, display of Test suite do not have upload button enabled for attachment + $my['options'] = array( + 'show_mode' => 'readwrite' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($sqlResult) { + $gui->sqlResult = $sqlResult; + $gui->sqlAction = $action; + } + + $gui->item_id = $tsuite_id = $id; + if (! property_exists($gui, 'tproject_id')) { + $gui->tproject_id = $this->getTestProjectFromTestSuite($tsuite_id, + null); + } + + $gui->modify_tc_rights = has_rights($this->db, "mgt_modify_tc", + $gui->tproject_id); + + if ($my['options']['show_mode'] == 'readonly') { + $gui->modify_tc_rights = 'no'; + } + + $gui->assign_keywords = 0; + if (property_exists($gui, 'user')) { + $yn = $gui->user->hasRight($this->db, 'mgt_modify_key', + $gui->tproject_id); + $gui->assign_keywords = ($yn == "yes"); + } + + $gui->container_data = $this->get_by_id($id, + array( + 'renderImageInline' => true + )); + $gui->moddedItem = $gui->container_data; + if ($modded_item_id) { + $gui->moddedItem = $this->get_by_id($modded_item_id, + array( + 'renderImageInline' => true + )); + } + + $gui->cf = $this->html_table_of_custom_field_values($id); + $gui->attachmentInfos = getAttachmentInfosFrom($this, $id); + $gui->id = $id; + $gui->page_title = lang_get('testsuite'); + $gui->level = $gui->containerType = 'testsuite'; + $cfg = getWebEditorCfg('design'); + $gui->testDesignEditorType = $cfg['type']; + + $gui->calledByMethod = 'testsuite::show'; + + $kopt = array( + 'order_by_clause' => ' ORDER BY keyword ASC ', + 'output' => 'with_link_id' + ); + $gui->keywords_map = $this->get_keywords_map($id, $kopt); + + $of = array( + 'output' => 'html_options', + 'add_blank' => true, + 'tproject_id' => $gui->tproject_id + ); + $gui->freeKeywords = $this->getFreeKeywords($id, $of); + + $smarty->assign('gui', $gui); + $smarty->display($template_dir . 'containerView.tpl'); + } + + /* + * function: viewer_edit_new + * Implements user interface (UI) for edit testuite and + * new/create testsuite operations. + * + * + * args : smarty [reference] + * webEditorHtmlNames + * oWebEditor: rich editor object (today is FCK editor) + * action + * parent_id: testsuite parent id on tree. + * [id] + * [messages]: default null + * map with following keys + * [result_msg]: default: null used to give information to user + * [user_feedback]: default: null used to give information to user + * + * // [$userTemplateCfg]: configurations, Example: testsuite template usage + * [$userTemplateKey]: main Key to access item template configuration + * [$userInput] + * + * returns: - + * + */ + public function viewer_edit_new(&$smarty, $template_dir, $webEditorHtmlNames, + $oWebEditor, $action, $parent_id, $id = null, $messages = null, + $userTemplateKey = null, $userInput = null) + { + $internalMsg = array( + 'result_msg' => null, + 'user_feedback' => null + ); + $the_data = null; + $name = ''; + + if (! is_null($messages)) { + $internalMsg = array_merge($internalMsg, $messages); + } + + $useUserInput = is_null($userInput) ? 0 : 1; + $pnode_info = $this->tree_manager->get_node_hierarchy_info($parent_id); + + $parent_info['description'] = lang_get( + $this->nodeTypesIdDescr[$pnode_info['node_type_id']]); + $parent_info['name'] = $pnode_info['name']; + + $a_tpl = array( + 'edit_testsuite' => 'containerEdit.tpl', + 'new_testsuite' => 'containerNew.tpl', + 'add_testsuite' => 'containerNew.tpl' + ); + + $the_tpl = $a_tpl[$action]; + $smarty->assign('sqlResult', $internalMsg['result_msg']); + $smarty->assign('containerID', $parent_id); + $smarty->assign('user_feedback', $internalMsg['user_feedback']); + + if ($useUserInput) { + $webEditorData = $userInput; + } else { + $the_data = null; + $name = ''; + if ($action == 'edit_testsuite') { + $the_data = $this->get_by_id($id); + $name = $the_data['name']; + $smarty->assign('containerID', $id); + } + $webEditorData = $the_data; + } + + $cf_smarty = $this->html_table_of_custom_field_inputs($id, $parent_id, + 'design', '', $userInput); + + // webeditor + // templates will be also used after 'add_testsuite', when + // presenting a new test suite with all other fields empty. + if (! $useUserInput && + ($action == 'new_testsuite' || $action == 'add_testsuite') && + ! is_null($userTemplateKey)) { + // need to understand if need to use templates + $webEditorData = $this->initializeWebEditors($webEditorHtmlNames, + $userTemplateKey); + } + + foreach ($webEditorHtmlNames as $key) { + // Warning: + // the data assignment will work while the keys in $the_data are identical + // to the keys used on $oWebEditor. + $of = &$oWebEditor[$key]; + $of->Value = isset($webEditorData[$key]) ? $webEditorData[$key] : null; + $smarty->assign($key, $of->CreateHTML()); + } + + $smarty->assign('cf', $cf_smarty); + $smarty->assign('parent_info', $parent_info); + $smarty->assign('level', 'testsuite'); + $smarty->assign('name', $name); + $smarty->assign('container_data', $the_data); + $smarty->display($template_dir . $the_tpl); + } + + /* + * function: copy_to + * deep copy one testsuite to another parent (testsuite or testproject). + * + * + * args : id: testsuite id (source or copy) + * parent_id: + * user_id: who is requesting copy operation + * [check_duplicate_name]: default: 0 -> do not check + * 1 -> check for duplicate when doing copy + * What to do if duplicate exists, is controlled + * by action_on_duplicate_name argument. + * + * [action_on_duplicate_name argument]: default: 'allow_repeat'. + * Used when check_duplicate_name=1. + * Specifies how to react if duplicate name exists. + * + * + * + * + * returns: map with foloowing keys: + * status_ok: 0 / 1 + * msg: 'ok' if status_ok == 1 + * id: new created if everything OK, -1 if problems. + * + * @internal revisions + * When copying a project, external TC ID is not preserved + * added option 'preserve_external_id' needed by tcase copy_to() + * + */ + public function copy_to($id, $parent_id, $user_id, $options = null, + $mappings = null) + { + $my['options'] = array( + 'check_duplicate_name' => 0, + 'action_on_duplicate_name' => 'allow_repeat', + 'copyKeywords' => 0, + 'copyRequirements' => 0, + 'preserve_external_id' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $my['mappings'] = array(); + $my['mappings'] = array_merge($my['mappings'], (array) $mappings); + + $copyTCaseOpt = array( + 'preserve_external_id' => $my['options']['preserve_external_id'], + 'copy_also' => array( + 'keyword_assignments' => $my['options']['copyKeywords'], + 'requirement_assignments' => $my['options']['copyRequirements'] + ) + ); + + $tcaseMgr = new testcase($this->db); + $tsuite_info = $this->get_by_id($id); + + $op = $this->create($parent_id, $tsuite_info['name'], + $tsuite_info['details'], $tsuite_info['node_order'], + $my['options']['check_duplicate_name'], + $my['options']['action_on_duplicate_name']); + + $op['mappings'][$id] = $op['id']; + $new_tsuite_id = $op['id']; + + // Work on root of these subtree + // Attachments - always copied + // Keyword assignment - according to user choice + // Custom Field values - always copied + $oldToNew = $this->copyAttachments($id, $new_tsuite_id); + if (! is_null($oldToNew)) { + $this->inlineImageProcessing($new_tsuite_id, $tsuite_info['details'], + $oldToNew); + } + + if ($my['options']['copyKeywords']) { + $kmap = isset($my['mappings']['keywords']) ? $my['mappings']['keywords'] : null; + $this->copyKeywordAssignment($id, $new_tsuite_id, $kmap); + } + $this->copyCfieldsValues($id, $new_tsuite_id); + + $my['filters'] = array( + 'exclude_children_of' => array( + 'testcase' => 'exclude my children' + ) + ); + $subtree = $this->tree_manager->get_subtree($id, $my['filters']); + if (! is_null($subtree)) { + $parent_decode = array(); + $parent_decode[$id] = $new_tsuite_id; + foreach ($subtree as $elem) { + $the_parent_id = $parent_decode[$elem['parent_id']]; + switch ($elem['node_type_id']) { + case $this->node_types_descr_id['testcase']: + // forgotten parameter $mappings caused requirement assignments to use wrong IDs + $tcOp = $tcaseMgr->copy_to($elem['id'], $the_parent_id, + $user_id, $copyTCaseOpt, $my['mappings']); + $op['mappings'] += $tcOp['mappings']; + break; + + case $this->node_types_descr_id['testsuite']: + $tsuite_info = $this->get_by_id($elem['id']); + $ret = $this->create($the_parent_id, + $tsuite_info['name'], $tsuite_info['details'], + $tsuite_info['node_order']); + + $parent_decode[$elem['id']] = $ret['id']; + $op['mappings'][$elem['id']] = $ret['id']; + + $oldToNew = $this->copyAttachments($elem['id'], + $ret['id']); + if (! is_null($oldToNew)) { + $this->inlineImageProcessing($ret['id'], + $tsuite_info['details'], $oldToNew); + } + + if ($my['options']['copyKeywords']) { + $this->copyKeywordAssignment($elem['id'], $ret['id'], + $kmap); + } + $this->copyCfieldsValues($elem['id'], $ret['id']); + + break; + } + } + } + return $op; + } + + /* + * function: get_subtree + * Get subtree that has choosen testsuite as root. + * Only nodes of type: + * testsuite and testcase are explored and retrieved. + * + * args: id: testsuite id + * [recursive_mode]: default false + * + * + * returns: map + * see tree->get_subtree() for details. + * + */ + public function get_subtree($id, $opt = null) + { + $my['options'] = array( + 'recursive' => 0, + 'excludeTC' => 0 + ); + $my['options'] = array_merge($my['options'], (array) $opt); + + $my['filters'] = array( + 'exclude_node_types' => $this->nt2exclude, + 'exclude_children_of' => $this->nt2excludeChildren + ); + + if ($my['options']['excludeTC']) { + $my['filters']['exclude_node_types']['testcase'] = 'exclude_me'; + } + + return $this->tree_manager->get_subtree($id, $my['filters'], + $my['options']); + } + + /* + * function: get_testcases_deep + * get all test cases in the test suite and all children test suites + * no info about tcversions is returned. + * + * args : id: testsuite id + * [details]: default 'simple' + * Structure of elements in returned array, changes according to + * this argument: + * + * 'only_id' + * Array that contains ONLY testcase id, no other info. + * + * 'simple' + * Array where each element is a map with following keys. + * + * id: testcase id + * parent_id: testcase parent (a test suite id). + * node_type_id: type id, for a testcase node + * node_order + * node_table: node table, for a testcase. + * name: testcase name + * external_id: + * + * 'full' + * Complete info about testcase for LAST TCVERSION + * TO BE IMPLEMENTED + * + * returns: array + * + */ + public function get_testcases_deep($id, $details = 'simple', $options = null) + { + $tcaseMgr = new testcase($this->db); + $testcases = null; + + $opt = array( + 'getKeywords' => false + ); + $opt = array_merge($opt, (array) $options); + + $subtree = $this->get_subtree($id); + $only_id = ($details == 'only_id') ? true : false; + $doit = ! is_null($subtree); + $parentSet = null; + + if ($doit) { + $testcases = array(); + $tcNodeType = $this->node_types_descr_id['testcase']; + $prefix = null; + foreach ($subtree as $elem) { + if ($elem['node_type_id'] == $tcNodeType) { + if ($only_id) { + $testcases[] = $elem['id']; + } else { + // After first call passing $prefix with right value, avoids a function call + // inside of getExternalID(); + list ($identity, $prefix, ,) = $tcaseMgr->getExternalID( + $elem['id'], null, $prefix); + $elem['external_id'] = $identity; + $testcases[] = $elem; + $parentSet[$elem['parent_id']] = $elem['parent_id']; + } + } + } + $doit = ! empty($testcases); + } + + if ($doit && $details == 'full') { + $parentNodes = $this->tree_manager->get_node_hierarchy_info( + $parentSet); + + $rs = array(); + foreach ($testcases as $value) { + $item = $tcaseMgr->getLastVersionInfo($value['id'], + array( + 'output' => 'full', + 'get_steps' => true + )); + $item['tcversion_id'] = $item['id']; + $tsuite['tsuite_name'] = $parentNodes[$value['parent_id']]['name']; + + if ($opt['getKeywords']) { + $kw = $tcaseMgr->getKeywords($value['id']); + if (! is_null($kw)) { + $item['keywords'] = $kw; + } + } + + unset($item['id']); + $rs[] = $value + $item + $tsuite; + } + $testcases = $rs; + } + return $testcases; + } + + /** + * get_children_testcases + * get only test cases with parent=testsuite without doing a deep search + */ + public function get_children_testcases($id, $details = 'simple', + $options = null) + { + $testcases = null; + $only_id = ($details == 'only_id') ? true : false; + $subtree = $this->tree_manager->get_children($id, + array( + 'testsuite' => 'exclude_me' + )); + $doit = ! is_null($subtree); + + $opt = array( + 'getKeywords' => false + ); + $opt = array_merge($opt, (array) $options); + + if ($doit) { + $tsuite = $this->get_by_id($id); + $tsuiteName = $tsuite['name']; + $testcases = array(); + foreach ($subtree as $elem) { + if ($only_id) { + $testcases[] = $elem['id']; + } else { + $testcases[] = $elem; + } + } + $doit = ! empty($testcases); + } + + if ($doit && $details == 'full') { + $rs = array(); + $tcaseMgr = new testcase($this->db); + foreach ($testcases as $value) { + $item = $tcaseMgr->getLastVersionInfo($value['id'], + array( + 'output' => 'full', + 'get_steps' => true + )); + $item['tcversion_id'] = $item['id']; + $parent['tsuite_name'] = $tsuiteName; + + if ($opt['getKeywords']) { + $kw = $tcaseMgr->getKeywords($value['id']); + if (! is_null($kw)) { + $item['keywords'] = $kw; + } + } + unset($item['id']); + $rs[] = $value + $item + $tsuite; + } + $testcases = $rs; + } + return $testcases; + } + + /* + * function: delete_deep + * + * args : $id + * + * returns: + * + * rev : + * 20070602 - franciscom + * added delete attachments + */ + public function delete_deep($id) + { + // BUGID 3147 - Delete test project with requirements defined crashed with memory exhausted + $this->tree_manager->delete_subtree_objects($id, $id, '', + array( + 'testcase' => 'exclude_tcversion_nodes' + )); + $this->delete($id); + } + + // end function + + /* + * function: initializeWebEditors + * + * args: + * + * returns: + * + */ + private function initializeWebEditors($webEditors, $itemTemplateCfgKey) + { + $wdata = array(); + foreach ($webEditors as $html_name) { + $wdata[$html_name] = getItemTemplateContents($itemTemplateCfgKey, + $html_name, ''); + } + return $wdata; + } + + /** + * function: getKeywords + * Get keyword assigned to a testsuite. + * Uses table object_keywords. + * + * args: id: testsuite id + * kw_id: [default = null] the optional keyword id + * + * returns: null if nothing found. + * array, every elemen is map with following structure: + * id + * keyword + * notes + */ + public function getKeywords($id, $kw_id = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $sql = "/* $debugMsg */ SELECT keyword_id,keywords.keyword, notes " . + " FROM {$this->tables['object_keywords']}, {$this->tables['keywords']} keywords " . + " WHERE keyword_id = keywords.id AND fk_id = {$id}"; + if (! is_null($kw_id)) { + $sql .= " AND keyword_id = {$kw_id}"; + } + return $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + } + + /* + * function: get_keywords_map + * All keywords for a choosen testsuite + * + * Attention: + * probably write on obejct_keywords has not been implemented yet, + * then right now thie method can be useless. + * + * + * args :id: testsuite id + * [order_by_clause]: default: '' -> no order choosen + * must be an string with complete clause, i.e. + * 'ORDER BY keyword' + * + * + * + * returns: map: key: keyword_id + * value: keyword + * + * + */ + public function get_keywords_map($id, $opt = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $options = array( + 'order_by_clause' => '', + 'output' => 'std' + ); + $options = array_merge($options, (array) $opt); + $order_by_clause = $options['order_by_clause']; + + $sql = "/* $debugMsg */ SELECT OKW.id AS kw_link,OKW.keyword_id,keywords.keyword " . + " FROM {$this->tables['object_keywords']} OKW " . + " JOIN {$this->tables['keywords']} keywords " . + " ON OKW.keyword_id = keywords.id "; + + if (is_array($id)) { + $sql .= " AND fk_id IN (" . implode(",", $id) . ") "; + } else { + $sql .= " AND fk_id = {$id} "; + } + + $sql .= $order_by_clause; + + switch ($options['output']) { + + case 'with_link_id': + $map_keywords = $this->db->fetchRowsIntoMap($sql, 'keyword_id'); + break; + + case 'std': + default: + $map_keywords = $this->db->fetchColumnsIntoMap($sql, + 'keyword_id', 'keyword'); + break; + } + + return $map_keywords; + } + + /** + */ + private function addKeyword($id, $kw_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $status = 1; + $kw = $this->getKeywords($id, $kw_id); + if (empty($kw)) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['object_keywords']} " . + " (fk_id,fk_table,keyword_id) VALUES ($id,'nodes_hierarchy',$kw_id)"; + $status = $this->db->exec_query($sql) ? 1 : 0; + } + return $status; + } + + /* + * function: addKeywords + * + * args : + * + * returns: + * + */ + public function addKeywords($id, $kw_ids) + { + $status = 1; + $num_kws = count($kw_ids); + for ($idx = 0; $idx < $num_kws; $idx ++) { + $status = $status && $this->addKeyword($id, $kw_ids[$idx]); + } + return $status; + } + + /** + * deleteKeywords + */ + public function deleteKeywords($id, $kw_id = null) + { + $sql = " DELETE FROM {$this->tables['object_keywords']} + WHERE fk_id = {$id} "; + + if (! is_null($kw_id)) { + $sql .= " AND keyword_id = {$kw_id}"; + } + return $this->db->exec_query($sql); + } + + /* + * function: exportTestSuiteDataToXML + * + * args : + * + * returns: + * + */ + public function exportTestSuiteDataToXML($container_id, $tproject_id, + $optExport = array()) + { + static $keywordMgr; + static $tcaseMgr; + + if (is_null($keywordMgr)) { + $keywordMgr = new tlKeyword(); + } + + $xmlTC = null; + $relCache = array(); + + $doRecursion = isset($optExport['RECURSIVE']) ? $optExport['RECURSIVE'] : 0; + + if ($doRecursion) { + $cfXML = null; + $kwXML = null; + $attachXML = ''; + + if ($container_id == $tproject_id) { + $$tsuiteData = [ + 'id' => '', + 'name' => '', + 'node_order' => 0, + 'details' => '' + ]; + } else { + $tsuiteData = $this->get_by_id($container_id); + if (isset($optExport['KEYWORDS']) && $optExport['KEYWORDS']) { + $kwMap = $this->getKeywords($container_id); + if ($kwMap) { + $kwXML = "" . + $keywordMgr->toXMLString($kwMap, true) . + ""; + } + } + if (isset($optExport['CFIELDS']) && $optExport['CFIELDS']) { + $cfMap = (array) $this->get_linked_cfields_at_design( + $container_id, null, null, $tproject_id); + if (! empty($cfMap)) { + $cfXML = $this->cfield_mgr->exportValueAsXML($cfMap); + } + } + + $attach = []; + if (isset($optExport['ATTACHMENTS']) && $optExport['ATTACHMENTS']) { + // get all attachments + $attInfos = $this->attachmentRepository->getAttachmentInfosFor( + $container_id, $this->attachmentTableName, 'id'); + + // get all attachments content and encode it in base64 + if ($attInfos) { + foreach ($attInfos as $axInfo) { + $aID = $axInfo["id"]; + $content = $this->attachmentRepository->getAttachmentContent( + $aID, $axInfo); + + if ($content != null) { + $attach[$aID]["id"] = $aID; + $attach[$aID]["name"] = $axInfo["file_name"]; + $attach[$aID]["file_type"] = $axInfo["file_type"]; + $attach[$aID]["title"] = $axInfo["title"]; + $attach[$aID]["date_added"] = $axInfo["date_added"]; + $attach[$aID]["content"] = base64_encode( + $content); + } + } + } + + if (! empty($attach)) { + $attchRootElem = "\n{{XMLCODE}}\n"; + $attchElemTemplate = "\t\n" . + "\t\t\n" . + "\t\t\n" . + "\t\t\n" . + "\t\t\n" . + "\t\t<![CDATA[||ATTACHMENT_TITLE||]]>\n" . + "\t\t\n" . + "\t\t\n" . + "\t\n"; + + $attchDecode = array( + "||ATTACHMENT_ID||" => "id", + "||ATTACHMENT_NAME||" => "name", + "||ATTACHMENT_FILE_TYPE||" => "file_type", + "||ATTACHMENT_FILE_SIZE||" => "file_size", + "||ATTACHMENT_TITLE||" => "title", + "||ATTACHMENT_DATE_ADDED||" => "date_added", + "||ATTACHMENT_CONTENT||" => "content" + ); + $attachXML = exportDataToXML($attach, $attchRootElem, + $attchElemTemplate, $attchDecode, true); + } + } + } + $xmlTC = '' . + "\n\n" . + "
    \n{$kwXML}{$cfXML}{$attachXML}"; + } else { + $xmlTC = ""; + } + + $topt = array( + 'recursive' => self::USE_RECURSIVE_MODE + ); + if (isset($optExport['skeleton']) && $optExport['skeleton']) { + $topt['excludeTC'] = true; + } + $test_spec = $this->get_subtree($container_id, $topt); + + $childNodes = isset($test_spec['childNodes']) ? $test_spec['childNodes'] : null; + $tcaseMgr = null; + $relXmlData = ''; + if (! is_null($childNodes)) { + $loop_qty = count($childNodes); + for ($idx = 0; $idx < $loop_qty; $idx ++) { + $cNode = $childNodes[$idx]; + $nTable = $cNode['node_table']; + if ($doRecursion && $nTable == 'testsuites') { + $xmlTC .= $this->exportTestSuiteDataToXML($cNode['id'], + $tproject_id, $optExport); + } elseif ($nTable == 'testcases') { + if (is_null($tcaseMgr)) { + $tcaseMgr = new testcase($this->db); + } + $xmlTC .= $tcaseMgr->exportTestCaseDataToXML($cNode['id'], + testcase::LATEST_VERSION, $tproject_id, true, $optExport); + + // 20140816 + // Collect and do cache of all test case relations that exists inside this test suite. + $relSet = $tcaseMgr->getRelations($cNode['id']); + if ($relSet['num_relations'] > 0) { + foreach ($relSet['relations'] as $rel) { + // If we have already found this relation, skip it. + if (! in_array($rel['id'], $relCache)) { + $relXmlData .= $tcaseMgr->exportRelationToXML( + $rel, $relSet['item']); + $relCache[] = $rel['id']; + } + } + } + } + } + } + // after we scanned all relations and exported all relations to xml, let's output it to the XML buffer + $xmlTC .= $relXmlData; + $xmlTC .= $doRecursion ? "
    " : ""; + return $xmlTC; + } + + // Custom field related methods + /* + * function: get_linked_cfields_at_design + * + * + * args: $id + * [$parent_id]: + * [$filtesr]: default: null + * + * returns: hash + * + * rev : + */ + public function get_linked_cfields_at_design($id, $parent_id = null, + $filters = null, $tproject_id = null, $access_key = 'id') + { + if (! $tproject_id) { + $tproject_id = $this->getTestProjectFromTestSuite($id, $parent_id); + } + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + cfield_mgr::CF_ENABLED, $filters, 'testsuite', $id, $access_key); + } + + /** + * getTestProjectFromTestSuite() + */ + public function getTestProjectFromTestSuite($id, $parent_id) + { + return $this->tree_manager->getTreeRoot( + (! is_null($id) && $id > 0) ? $id : $parent_id); + } + + /* + * function: get_linked_cfields_at_execution + * + * + * args: $id + * [$parent_id] + * [$filters] + * keys: $show_on_execution: default: null + * 1 -> filter on field show_on_execution=1 + * 0 or null -> don't filter + * + * + * returns: hash + * + * rev : + * 20110129 - franciscom - BUGID 4202 + */ + private function get_linked_cfields_at_execution($id, $parent_id = null, + $filters = null, $tproject_id = null) + { + if (! $tproject_id) { + $the_path = $this->tree_manager->get_path( + ! is_null($id) ? $id : $parent_id); + $path_len = count($the_path); + $tproject_id = ($path_len > 0) ? $the_path[$path_len - 1]['parent_id'] : $parent_id; + } + + return $this->cfield_mgr->get_linked_cfields_at_design($tproject_id, + cfield_mgr::CF_ENABLED, $filters, 'testsuite', $id); + } + + /* + * function: html_table_of_custom_field_inputs + * + * + * args: $id + * [$parent_id]: need when you call this method during the creation + * of a test suite, because the $id will be 0 or null. + * + * [$scope]: 'design','execution' + * + * returns: html string + * + */ + public function html_table_of_custom_field_inputs($id, $parent_id = null, + $scope = 'design', $name_suffix = '', $input_values = null) + { + $cf_smarty = ''; + $method_suffix = $scope == 'design' ? $scope : 'execution'; + $method_name = "get_linked_cfields_at_{$method_suffix}"; + $cf_map = $this->$method_name($id, $parent_id); + + if (! is_null($cf_map)) { + $cf_smarty = $this->cfield_mgr->html_table_inputs($cf_map, + $name_suffix, $input_values); + } + return $cf_smarty; + } + + /* + * function: html_table_of_custom_field_values + * + * + * args: $id + * [$scope]: 'design','execution' + * [$show_on_execution]: default: null + * 1 -> filter on field show_on_execution=1 + * 0 or null -> don't filter + * + * returns: html string + * + */ + public function html_table_of_custom_field_values($id, $scope = 'design', + $show_on_execution = null, $tproject_id = null, $formatOptions = null) + { + $filters = array( + 'show_on_execution' => $show_on_execution + ); + $label_css_style = ' class="labelHolder" '; + $value_css_style = ' '; + + $add_table = true; + $table_style = ''; + if (! is_null($formatOptions)) { + $label_css_style = isset($formatOptions['label_css_style']) ? $formatOptions['label_css_style'] : $label_css_style; + $value_css_style = isset($formatOptions['value_css_style']) ? $formatOptions['value_css_style'] : $value_css_style; + + $add_table = isset($formatOptions['add_table']) ? $formatOptions['add_table'] : true; + $table_style = isset($formatOptions['table_css_style']) ? $formatOptions['table_css_style'] : $table_style; + } + + $cf_smarty = ''; + $parent_id = null; + + // BUGID 3989 + $show_cf = config_get('custom_fields')->show_custom_fields_without_value; + + if ($scope == 'design') { + $cf_map = $this->get_linked_cfields_at_design($id, $parent_id, + $filters, $tproject_id); + } else { + // Important: remember that for Test Suite, custom field value CAN NOT BE changed + // at execution time just displayed. + // 20110129 - if we know test project id is better to use it + $cf_map = $this->get_linked_cfields_at_execution($id, null, null, + $tproject_id); + } + + if (! is_null($cf_map)) { + foreach ($cf_map as $cf_info) { + // if user has assigned a value, then node_id is not null + // BUGID 3989 + if ($cf_info['node_id'] || $show_cf) { + // true => do not create input in audit log + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf_info['label'], null, true)); + $cf_smarty .= "" . + htmlspecialchars($label) . "" . + "" . + $this->cfield_mgr->string_custom_field_value($cf_info, + $id) . "\n"; + } + } + } + if ((trim($cf_smarty) != "") && $add_table) { + $cf_smarty = "" . $cf_smarty . "
    "; + } + return $cf_smarty; + } + + /** + * Copy attachments from source test suite to target test suite + */ + private function copyAttachments($source_id, $target_id) + { + return $this->attachmentRepository->copyAttachments($source_id, + $target_id, $this->attachmentTableName); + } + + /** + * Copy keyword assignment + * mappings is only useful when source_id and target_id do not belong to same Test Project. + * Because keywords are defined INSIDE a Test Project, ID will be different for same keyword + * in a different Test Project + */ + private function copyKeywordAssignment($source_id, $target_id, $mappings) + { + // Get source_id keyword assignment + $sourceItems = $this->getKeywords($source_id); + if (! is_null($sourceItems)) { + // build item id list + $keySet = array_keys($sourceItems); + foreach ($keySet as $itemPos => $itemID) { + if (isset($mappings[$itemID])) { + $keySet[$itemPos] = $mappings[$itemID]; + } + } + $this->addKeywords($target_id, $keySet); + } + } + + /** + * Copy Custom Fields values + */ + private function copyCfieldsValues($source_id, $target_id) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + // Get source_id cfields assignment + $sourceItems = $this->cfield_mgr->getByLinkID($source_id, + array( + 'scope' => 'design' + )); + if (! is_null($sourceItems)) { + $sql = "/* $debugMsg */ " . + " INSERT INTO {$this->tables['cfield_design_values']} " . + " (field_id,value,node_id) " . + " SELECT field_id,value,{$target_id} AS target_id" . + " FROM {$this->tables['cfield_design_values']} " . + " WHERE node_id = {$source_id} "; + $this->db->exec_query($sql); + } + } + + /** + * get_children + * get test suites with parent = testsuite with given id + */ + public function get_children($id, $options = null) + { + $itemSet = null; + $my['options'] = array( + 'details' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $subtree = $this->tree_manager->get_children($id, + array( + 'testcase' => 'exclude_me' + )); + if (! empty($subtree)) { + foreach ($subtree as $elem) { + $itemKeys[] = $elem['id']; + } + + if ($my['options']['details'] == 'full') { + $itemSet = $this->get_by_id($itemKeys, + array( + 'orderByClause' => 'ORDER BY node_order' + )); + } else { + $itemSet = $itemKeys; + } + } + return $itemSet; + } + + /** + * get_branch + * get ONLY test suites (no other kind of node) ON BRANCH with ROOT = testsuite with given id + */ + public function get_branch($id) + { + return $this->tree_manager->get_subtree_list($id, $this->my_node_type); + } + + /** + * 'name' + * 'testProjectID' + * 'parentID' + * 'notes' + */ + public function createFromObject($item, $opt = null) + { + $my['opt'] = array( + 'doChecks' => false, + 'setSessionProject' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + define('DBUG_ON', 1); + try { + // mandatory checks + if (strlen($item->name) == 0) { + throw new Exception('Empty name is not allowed'); + } + + // what checks need to be done ? + // 1. test project exist + $pinfo = $this->tree_manager->get_node_hierarchy_info( + $item->testProjectID); + if (is_null($pinfo) || + $this->nodeTypesIdDescr[$pinfo['node_type_id']] != 'testproject') { + throw new Exception('Test project ID does not exist'); + } + + // 2. parentID exists and its node type can be: + // testproject,testsuite + // + $pinfo = $this->tree_manager->get_node_hierarchy_info( + $item->parentID); + if (is_null($pinfo)) { + throw new Exception('Parent ID does not exist'); + } + + if ($this->nodeTypesIdDescr[$pinfo['node_type_id']] != 'testproject' && + $this->nodeTypesIdDescr[$pinfo['node_type_id']] != 'testsuite') { + throw new Exception('Node Type for Parent ID is not valid'); + } + + // 3. there is NO other test suite children of parent id node with same name + $name = trim($item->name); + $op = $this->checkNameExistence($name, $item->parentID); + if (! $op['status_ok']) { + throw new Exception( + 'Test suite name is already in use at same level'); + } + } catch (Exception $e) { + throw $e; // rethrow + } + + $id = $this->tree_manager->new_node($item->parentID, $this->my_node_type, + $name, intval($item->order)); + + $sql = " INSERT INTO {$this->tables['testsuites']} (id,details) " . + " VALUES ({$id},'" . $this->db->prepare_string($item->notes) . "')"; + + $result = $this->db->exec_query($sql); + return $result ? $id : 0; + } + + /** + * Checks is there is another test plan inside test project + * with different id but same name + */ + private function checkNameExistence($name, $parentID, $id = 0) + { + $check_op['msg'] = ''; + $check_op['status_ok'] = 1; + + $getOpt = array( + 'output' => 'minimun', + 'id' => intval($id) + ); + if ($this->get_by_name($name, intval($parentID), $getOpt)) { + $check_op['msg'] = sprintf(lang_get('error_product_name_duplicate'), + $name); + $check_op['status_ok'] = 0; + } + return $check_op; + } + + /** + * + * @used-by containerEdit.php, testsuite.class.php.show + */ + public function getFileUploadRelativeURL($id) + { + // I've to use testsuiteID because this is how is name on containerEdit.php + return "lib/testcases/containerEdit.php?containerType=testsuite&doAction=fileUpload&testsuiteID=" . + intval($id); + } + + /** + * + * @used-by containerEdit.php, testsuite.class.php.show + */ + private function getDeleteAttachmentRelativeURL($id) + { + // I've to use testsuiteID because this is how is name on containerEdit.php + return "lib/testcases/containerEdit.php?containerType=testsuite&doAction=deleteFile&testsuiteID=" . + intval($id) . "&file_id="; + } + + /** + * render Image Attachments INLINE + * + * + */ + public function renderImageAttachments($id, &$item2render, $basehref = null) + { + static $attSet; + if (! $attSet || ! isset($attSet[$id])) { + $attSet[$id] = $this->attachmentRepository->getAttachmentInfosFor( + $id, $this->attachmentTableName, 'id'); + $beginTag = '[tlInlineImage]'; + $endTag = '[/tlInlineImage]'; + } + + if (is_null($attSet[$id])) { + return; + } + + // $href = '%s:%s' . " $versionTag (link)

    "; + // second \'%s\' needed if I want to use Latest as indication, need to understand + // Javascript instead of javascript, because CKeditor sometimes complains + // + // CRITIC: skipCheck is needed to render OK when creating report on Pseudo-Word format. + $bhref = is_null($basehref) ? $_SESSION['basehref'] : $basehref; + $img = '

    '; + + $key2check = array( + 'details' + ); + $rse = &$item2render; + foreach ($key2check as $item_key) { + $start = strpos($rse[$item_key], $beginTag); + $ghost = $rse[$item_key]; + + // There is at least one request to replace ? + if ($start !== false) { + $xx = explode($beginTag, $rse[$item_key]); + + // How many requests to replace ? + $xx2do = count($xx); + $ghost = ''; + for ($xdx = 0; $xdx < $xx2do; $xdx ++) { + // Hope was not a false request. + if (strpos($xx[$xdx], $endTag) !== false) { + // Separate command string from other text + // Theorically can be just ONE, but it depends + // is user had not messed things. + $yy = explode($endTag, $xx[$xdx]); + if (($elc = count($yy)) > 0) { + $atx = $yy[0]; + try { + if (isset($attSet[$id][$atx]) && + $attSet[$id][$atx]['is_image']) { + $sec = hash('sha256', + $attSet[$id][$atx]['file_name']); + $ghost .= str_replace( + array( + '%id%', + '%sec%' + ), array( + $atx, + $sec + ), $img); + } + $lim = $elc - 1; + for ($cpx = 1; $cpx <= $lim; $cpx ++) { + $ghost .= $yy[$cpx]; + } + } catch (Exception $e) { + $ghost .= $rse[$item_key]; + } + } + } else { + // nothing to do + $ghost .= $xx[$xdx]; + } + } + } + + // reconstruct field contents + if ($ghost != '') { + $rse[$item_key] = $ghost; + } + } + } + + /** + */ + private function updateDetails($id, $details) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = "/* $debugMsg */ UPDATE {$this->tables['testsuites']} " . + " SET details = '" . $this->db->prepare_string($details) . "'" . + " WHERE id = " . intval($id); + $this->db->exec_query($sql); + } + + /** + */ + private function inlineImageProcessing($id, $details, $rosettaStone) + { + // get all attachments, then check is there are images + $att = $this->attachmentRepository->getAttachmentInfosFor($id, + $this->attachmentTableName, 'id'); + + foreach ($rosettaStone as $oid => $nid) { + if ($att[$nid]['is_image']) { + $needle = str_replace($nid, $oid, $att[$nid]['inlineString']); + $inlineImg[] = array( + 'needle' => $needle, + 'rep' => $att[$nid]['inlineString'] + ); + } + } + + if (! is_null($inlineImg)) { + $dex = $details; + foreach ($inlineImg as $elem) { + $dex = str_replace($elem['needle'], $elem['rep'], $dex); + } + $this->updateDetails($id, $dex); + } + } + + /** + */ + public function buildDirectWebLink($base_href, $id, $tproject_id) + { + $tproject_mgr = new testproject($this->db); + $prefix = $tproject_mgr->getTestCasePrefix($tproject_id); + return $base_href . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . + '&item=testsuite&id=' . $id; + } + + /** + * get only test cases with parent=testsuite without doing a deep search + */ + private function getChildrenLatestTCVersion($id) + { + $testcases = null; + $items = null; + $subtree = $this->tree_manager->get_children($id, + array( + 'testsuite' => 'exclude_me' + )); + + $doit = ! is_null($subtree); + + if ($doit) { + $this->get_by_id($id); + $testcases = array(); + foreach ($subtree as $elem) { + $testcases[] = $elem['id']; + } + $doit = ! empty($testcases); + } + + if ($doit) { + $inClause = implode(',', $testcases); + $sql = " SELECT tcversion_id + FROM {$this->views['latest_tcase_version_id']} + WHERE testcase_id IN ($inClause) "; + + $items = $this->db->get_recordset($sql); + } + + return $items; + } + + /** + */ + public function getTSuitesFilteredByKWSet($id, $opt = null, $filters = null) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $options = array( + 'output' => 'std' + ); + $options = array_merge($options, (array) $opt); + + $fil = array( + 'keywordsIn' => null, + 'keywordsLikeStart' => null + ); + $fil = array_merge($fil, (array) $filters); + + $fields = 'fk_id AS tsuite_id, NHTS.name AS tsuite_name,'; + + if (null != $fil['keywordsLikeStart']) { + $target = trim($fil['keywordsLikeStart']); + $fields .= " CONCAT(REPLACE(KW.keyword,'{$target}',''),':', NHTS.name) AS dyn_string "; + } else { + $fields .= " CONCAT(KW.keyword,':', NHTS.name) AS dyn_string "; + } + + switch ($options['output']) { + case 'kwname': + $fields .= ',KW.keyword'; + break; + + default: + $fields .= ",keyword_id,KW.keyword"; + break; + } + + $sql = "/* $debugMsg */ SELECT $fields FROM {$this->tables['object_keywords']} - JOIN {$this->tables['keywords']} KW - ON keyword_id = KW.id - JOIN {$this->tables['nodes_hierarchy']} NHTS - ON NHTS.id = fk_id "; - - $idSet = (array)$id; - $sql .= " WHERE fk_id IN (" . implode(",",$idSet) . ") "; - - if( null != $fil['keywordsIn'] ) { - $kwFilter = "'" . implode("','", $fil['keywordsIn']) . "'"; - $sql .= " AND KW.keyword IN (" . $kwFilter . ") "; - } - - if( null != $fil['keywordsLikeStart'] ) { - $target = $fil['keywordsLikeStart']; - $sql .= " AND KW.keyword LIKE '{$target}%' "; - } - - - $items = - $this->db->fetchRowsIntoMap($sql,'tsuite_id',database::CUMULATIVE); - - return $items; - } - - - /** - * - * - */ - function getFreeKeywords($tsuiteID, $opt = null) { - $my['opt'] = array('accessKey' => 'keyword_id', 'fields' => null, - 'orderBy' => null, 'tproject_id' => null, - 'output' => 'std', 'add_blank' => false); - - $my['opt'] = array_merge($my['opt'],(array)$opt); - - // CRITIC - $tproject_id = $my['opt']['tproject_id']; - if( null == $tproject_id ) { - $root = $this->getTestProjectFromTestSuite($tsuiteID,null); - } - $tproject_id = intval($tproject_id); - - - $safeID = intval($tsuiteID); - $sql = " SELECT KW.id AS keyword_id, KW.keyword + JOIN {$this->tables['keywords']} KW + ON keyword_id = KW.id + JOIN {$this->tables['nodes_hierarchy']} NHTS + ON NHTS.id = fk_id "; + + $idSet = (array) $id; + $sql .= " WHERE fk_id IN (" . implode(",", $idSet) . ") "; + + if (null != $fil['keywordsIn']) { + $kwFilter = "'" . implode("','", $fil['keywordsIn']) . "'"; + $sql .= " AND KW.keyword IN (" . $kwFilter . ") "; + } + + if (null != $fil['keywordsLikeStart']) { + $target = $fil['keywordsLikeStart']; + $sql .= " AND KW.keyword LIKE '{$target}%' "; + } + + return $this->db->fetchRowsIntoMap($sql, 'tsuite_id', + database::CUMULATIVE); + } + + /** + */ + private function getFreeKeywords($tsuiteID, $opt = null) + { + $my['opt'] = array( + 'accessKey' => 'keyword_id', + 'fields' => null, + 'orderBy' => null, + 'tproject_id' => null, + 'output' => 'std', + 'add_blank' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + // CRITIC + $tproject_id = $my['opt']['tproject_id']; + if (null == $tproject_id) { + $this->getTestProjectFromTestSuite($tsuiteID, null); + } + $tproject_id = intval($tproject_id); + + $safeID = intval($tsuiteID); + $sql = " SELECT KW.id AS keyword_id, KW.keyword FROM {$this->tables['keywords']} KW - WHERE KW.testproject_id = {$tproject_id} - AND KW.id NOT IN + WHERE KW.testproject_id = {$tproject_id} + AND KW.id NOT IN ( - SELECT TSKW.keyword_id + SELECT TSKW.keyword_id FROM {$this->tables['object_keywords']} TSKW WHERE TSKW.fk_id = {$safeID} AND TSKW.fk_table = 'nodes_hierarchy' - ) "; - - if (!is_null($my['opt']['orderBy'])) { - $sql .= ' ' . $my['opt']['orderBy']; - } - - switch($my['opt']['output']) { - case 'html_options': - $items = $this->db->fetchColumnsIntoMap($sql,'keyword_id','keyword'); - if( null != $items && $my['opt']['add_blank']) { - $items = array(0 => '') + $items; - } - - break; - - default: - $items = $this->db->fetchRowsIntoMap($sql,$my['opt']['accessKey']); - break; - } - - return $items; - } - - /** - * - */ - function getTestproject($tsuiteID) { - $path = $this->tree_manager->get_path($tsuiteID); - return $path[0]['parent_id']; - } - - /** - * deleteKeywordByLinkID - * - */ - function deleteKeywordByLinkID( $kwLinkID ) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeID = intval( $kwLinkID ); - $sql = " /* {$debugMsg} */ - DELETE FROM {$this->tables['object_keywords']} - WHERE id = {$kwLinkID} "; - return $this->db->exec_query($sql); - } - - - /** - * - * - */ - function addKeywordsDeep($rootTestSuiteID,$kwSet) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // Get tree of Test Suites - $tsList = $rootTestSuiteID; - - $tsSubList = trim($this->tree_manager->get_subtree_list($rootTestSuiteID,$this->my_node_type)); - - if( '' != $tsSubList ) { - $tsList .= ',' . $tsSubList; - } - - $tsSet = explode(',', $tsList); - $kwForTS = $this->getKeywordsForTSSet($tsSet); - - $vv = array(); - if( null == $kwForTS ) { - // we can add all - foreach($tsSet as $id) { - foreach($kwSet as $kaboom) { - $vv[] = "($id,'nodes_hierarchy',$kaboom)"; - } - } - } else { - // We want to avoid issue, that's why we want to get - // the difference bewteen already linked keywords and - // the new ones. - foreach($kwForTS as $tsk => $kwVenn) { - $kw2add = array_diff($kwSet,$kwVenn); - if( count($kw2add) > 0 ) { - foreach($kw2add as $kaboom) { - $vv[] = "($tsk,'nodes_hierarchy',$kaboom)"; - } - } - } - } - - if( count($vv) > 0 ) { - $sql = "/* $debugMsg */ - INSERT INTO {$this->tables['object_keywords']} - (fk_id,fk_table,keyword_id) - VALUES " . implode(',',$vv); - $this->db->exec_query($sql); - } - } - - - /** - * - */ - function getKeywordsForTSSet( $tsuiteIDSet ) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $idSet = implode(',',$tsuiteIDSet); - $sql = " /* $debugMsg */ - SELECT fk_id AS tsuite_id, OKW.keyword_id + ) "; + + if (! is_null($my['opt']['orderBy'])) { + $sql .= ' ' . $my['opt']['orderBy']; + } + + switch ($my['opt']['output']) { + case 'html_options': + $items = $this->db->fetchColumnsIntoMap($sql, 'keyword_id', + 'keyword'); + if (null != $items && $my['opt']['add_blank']) { + $items = array( + 0 => '' + ) + $items; + } + + break; + + default: + $items = $this->db->fetchRowsIntoMap($sql, + $my['opt']['accessKey']); + break; + } + + return $items; + } + + /** + */ + public function getTestproject($tsuiteID) + { + $path = $this->tree_manager->get_path($tsuiteID); + return $path[0]['parent_id']; + } + + /** + * deleteKeywordByLinkID + */ + public function deleteKeywordByLinkID($kwLinkID) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + $sql = " /* {$debugMsg} */ + DELETE FROM {$this->tables['object_keywords']} + WHERE id = {$kwLinkID} "; + return $this->db->exec_query($sql); + } + + /** + */ + public function addKeywordsDeep($rootTestSuiteID, $kwSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + // Get tree of Test Suites + $tsList = $rootTestSuiteID; + + $tsSubList = trim( + $this->tree_manager->get_subtree_list($rootTestSuiteID, + $this->my_node_type)); + + if ('' != $tsSubList) { + $tsList .= ',' . $tsSubList; + } + + $tsSet = explode(',', $tsList); + $kwForTS = $this->getKeywordsForTSSet($tsSet); + + $vv = array(); + if (null == $kwForTS) { + // we can add all + foreach ($tsSet as $id) { + foreach ($kwSet as $kaboom) { + $vv[] = "($id,'nodes_hierarchy',$kaboom)"; + } + } + } else { + // We want to avoid issue, that's why we want to get + // the difference bewteen already linked keywords and + // the new ones. + foreach ($kwForTS as $tsk => $kwVenn) { + $kw2add = array_diff($kwSet, $kwVenn); + if (! empty($kw2add)) { + foreach ($kw2add as $kaboom) { + $vv[] = "($tsk,'nodes_hierarchy',$kaboom)"; + } + } + } + } + + if (! empty($vv)) { + $sql = "/* $debugMsg */ + INSERT INTO {$this->tables['object_keywords']} + (fk_id,fk_table,keyword_id) + VALUES " . implode(',', $vv); + $this->db->exec_query($sql); + } + } + + /** + */ + private function getKeywordsForTSSet($tsuiteIDSet) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $idSet = implode(',', $tsuiteIDSet); + $sql = " /* $debugMsg */ + SELECT fk_id AS tsuite_id, OKW.keyword_id FROM {$this->tables['object_keywords']} OKW JOIN {$this->tables['keywords']} KW ON KW.id = OKW.keyword_id - WHERE fk_id IN ( {$idSet} ) - AND fk_table = 'nodes_hierarchy' "; - - $kw = $this->db->fetchColumnsIntoMap($sql,'tsuite_id','keyword_id',database::CUMULATIVE); - - return $kw; - } - - /** - * - * - */ - function keywordIsLinked($id,$kw) { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $idSet = $id; - $safeKW = "'" . $this->db->prepare_string(trim($kw)) . "'"; - $sql = " /* $debugMsg */ - SELECT fk_id AS tsuite_id, OKW.keyword_id + WHERE fk_id IN ( {$idSet} ) + AND fk_table = 'nodes_hierarchy' "; + + return $this->db->fetchColumnsIntoMap($sql, 'tsuite_id', 'keyword_id', + database::CUMULATIVE); + } + + /** + */ + public function keywordIsLinked($id, $kw) + { + $debugMsg = $this->debugMsg . __FUNCTION__; + + $idSet = $id; + $safeKW = "'" . $this->db->prepare_string(trim($kw)) . "'"; + $sql = " /* $debugMsg */ + SELECT fk_id AS tsuite_id, OKW.keyword_id FROM {$this->tables['object_keywords']} OKW JOIN {$this->tables['keywords']} KW ON KW.id = OKW.keyword_id - WHERE fk_id IN ( {$idSet} ) - AND fk_table = 'nodes_hierarchy' - AND KW.keyword = {$safeKW}"; - $rs = (array)$this->db->get_recordset($sql); - - return (count($rs) == 1); - } - - - - -} // end class + WHERE fk_id IN ( {$idSet} ) + AND fk_table = 'nodes_hierarchy' + AND KW.keyword = {$safeKW}"; + $rs = (array) $this->db->get_recordset($sql); + + return count($rs) == 1; + } +} diff --git a/lib/functions/tinymce.class.php b/lib/functions/tinymce.class.php index 60e101d278..288c531440 100644 --- a/lib/functions/tinymce.class.php +++ b/lib/functions/tinymce.class.php @@ -1,67 +1,71 @@ -InstanceName = $instanceName; - $this->Value = ''; - } - - function Create($rows = null,$cols = null) - { - echo $this->CreateHtml($rows,$cols); - } - - function CreateHtml($rows = null,$cols = null) - { - $HtmlValue = htmlspecialchars($this->Value); - - $my_rows = $rows; - $my_cols = $cols; - - if(is_null($my_rows) || $my_rows <= 0) - $my_rows = $this->rows; - if(is_null($my_cols) || $my_cols <= 0) - $my_cols = $this->cols; - - // rows must count place for toolbar !! - $Html = "" ; - return $Html ; - } - -} // class end - - -?> \ No newline at end of file +InstanceName = $instanceName; + $this->Value = ''; + } + + public function Create($rows = null, $cols = null) + { + echo $this->CreateHtml($rows, $cols); + } + + private function CreateHtml($rows = null, $cols = null) + { + $HtmlValue = htmlspecialchars($this->Value); + + $my_rows = $rows; + $my_cols = $cols; + + if (is_null($my_rows) || $my_rows <= 0) { + $my_rows = $this->rows; + } + if (is_null($my_cols) || $my_cols <= 0) { + $my_cols = $this->cols; + } + + // rows must count place for toolbar !! + return ""; + } +} +?> diff --git a/lib/functions/tlAttachment.class.php b/lib/functions/tlAttachment.class.php index a14bb0ad8e..ee6495496f 100644 --- a/lib/functions/tlAttachment.class.php +++ b/lib/functions/tlAttachment.class.php @@ -1,375 +1,413 @@ -fkID = NULL; - $this->fkTableName = NULL; - $this->fName = NULL; - $this->title = NULL; - $this->fType = NULL; - $this->fSize = NULL; - $this->destFPath = NULL; - $this->fContents = NULL; - $this->description = NULL; - $this->dateAdded = NULL; - $this->isImage = NULL; - $this->inlineString = NULL; - - if (!($options & self::TLOBJ_O_SEARCH_BY_ID)) - { - $this->dbID = null; - } - } - - /** - * Class constructor - * - * @param $dbID integer the database identifier of the attachment - */ - function __construct($dbID = null) - { - parent::__construct(); - - $this->compressionType = tlAttachmentRepository::getCompression(); - $this->repositoryPath = tlAttachmentRepository::getPathToRepository(); - $this->attachmentCfg = config_get('attachments'); - - $this->_clean(); - $this->dbID = $dbID; - } - - - /* - * Class destructor, cleans the object - */ - function __destruct() - { - parent::__destruct(); - $this->_clean(); - } - - /* - * - */ - function setID($id) - { - $this->dbID = $id; - } - - - - /* - * Initializes the attachment object - * - * @param object $db [ref] the db-object - * @param int $fkid the foreign key id (attachments.fk_id) - * @param string $fktableName the tablename to which the $id refers to (attachments.fk_table) - * @param string $fName the filename - * @param string $destFPath the file path - * @param string $fContents the contents of the file - * @param string $fType the mime-type of the file - * @param int $fSize the filesize (uncompressed) - * @param string $title the title used for the attachment - * - * @return integer returns tl::OK - */ - public function create($fkid,$fkTableName,$fName,$destFPath,$fContents,$fType, - $fSize,$title,$opt=null) - { - $this->_clean(); - - $title = trim($title); - $config = $this->attachmentCfg; - if($title == "") - { - switch($config->action_on_save_empty_title) - { - case 'use_filename': - $title = $fName; - break; - - default: - break; - } - - } - - $allowEmptyTitle = $config->allow_empty_title; - if( isset($opt['allow_empty_title']) ) - { - $allowEmptyTitle = $opt['allow_empty_title']; - } - - if( !$allowEmptyTitle && $title == "") - { - return self::E_TITLELENGTH; - } - - $this->fkID = $fkid; - $this->fkTableName = trim($fkTableName); - $this->fType = trim($fType); - $this->fSize = $fSize; - $this->fName = $fName; - $this->destFPath = trim($destFPath); - $this->fContents = $fContents; - - $this->isImage = !(strpos($this->fType,'image/') === FALSE); - $this->inlineString = NULL; - - //for FS-repository, the path to the repository itself is cut off, so the path is - // relative to the repository itself - $this->destFPath = str_replace($this->repositoryPath.DIRECTORY_SEPARATOR,"",$destFPath); - $this->title = trim($title); - - return tl::OK; - } - - /* Read the attachment information from the database, for filesystem repository this doesn't read - * the contents of the attachments - * - * @param $db [ref] the database connection - * @param $options integer null or TLOBJ_O_SEARCH_BY_ID - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function readFromDB(&$db,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - $this->_clean($options); - $query = "SELECT id,title,description,file_name,file_type,file_size,date_added,". - "compression_type,file_path,fk_id,fk_table FROM {$this->tables['attachments']} "; - - $clauses = null; - if ($options & self::TLOBJ_O_SEARCH_BY_ID) - $clauses[] = "id = {$this->dbID}"; - if ($clauses) - $query .= " WHERE " . implode(" AND ",$clauses); - - $info = $db->fetchFirstRow($query); - if ($info) - { - $this->fkID = $info['fk_id']; - $this->fkTableName = $info['fk_table']; - $this->fName = $info['file_name']; - $this->destFPath = $info['file_path']; - $this->fType = trim($info['file_type']); - $this->fSize = $info['file_size']; - $this->dbID = $info['id']; - $this->description = $info['description']; - $this->dateAdded = $info['date_added']; - $this->title = $info['title']; - $this->compressionType = $info['compression_type']; - - $this->isImage = !(strpos($this->fType,'image/') === FALSE); - $this->inlineString = NULL; - if($this->isImage) { - $this->inlineString = "[tlInlineImage]{$this->dbID}[/tlInlineImage]"; - } - } - - return $info ? tl::OK : tl::ERROR; - } - - /** - * Returns the attachment meta information in a legacy way - * - * @return array array with the attachment information - */ - public function getInfo() { - return array("id" => $this->dbID,"title" => $this->title, - "description" => $this->description, - "file_name" => $this->fName, "file_type" => $this->fType, - "file_size" => $this->fSize, "is_image" => $this->isImage, - "date_added" => $this->dateAdded, "inlineString" => $this->inlineString, - "compression_type" => $this->compressionType, - "file_path" => $this->destFPath, - "fk_id" => $this->fkID,"fk_table" => $this->fkTableName, - ); - } - - /* - * Writes the attachment into the database, for database repositories also the contents - * of the attachments are written - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function writeToDB(&$db,&$itemID=null) { - $tableName = $db->prepare_string($this->fkTableName); - $fName = $db->prepare_string($this->fName); - $title = $db->prepare_string($this->title); - $fType = $db->prepare_string($this->fType); - - $destFPath = - is_null($this->destFPath) ? 'NULL' : "'" . $db->prepare_string($this->destFPath) . "'"; - - // for FS-repository the contents are null - $fContents = is_null($this->fContents) ? 'NULL' : "'" . base64_encode($this->fContents) . "'"; - - $query = "INSERT INTO {$this->tables['attachments']} - (fk_id,fk_table,file_name,file_path,file_size,file_type, date_added,content,compression_type,title) - VALUES ({$this->fkID},'{$tableName}','{$fName}',{$destFPath},{$this->fSize},'{$this->fType}'," . $db->db_now() . - ",$fContents,{$this->compressionType},'{$title}')"; - - $result = $db->exec_query($query); - if ($result) { - $this->dbID = $db->insert_id(); - $itemID = $this->dbID; - } - - return $result ? tl::OK : tl::ERROR; - } - - /* - * Deletes an attachment from the db, for databse repositories also the contents are deleted - * - * @return integer return tl::OK on success, tl::ERROR else - */ - public function deleteFromDB(&$db) { - $query = "DELETE FROM {$this->tables['attachments']} - WHERE id = {$this->dbID}"; - $result = $db->exec_query($query); - - return $result ? tl::OK : tl::ERROR; - } - - /** - * Creates an attachment by a given database identifier - * - * @param $db [ref] the database connection - * @param $id the database identifier of the attachment - * @param $detailLevel the detailLevel - * @return tlAttachment the created attachment or null on failure - */ - static public function getByID(&$db,$id,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) { - return tlDBObject::createObjectFromDB($db,$id,__CLASS__,tlAttachment::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - } - - /** - * Creates some attachments by given database identifiers - * - * @param $db [ref] the database connection - * @param $id the database identifier of the attachment - * @param $detailLevel the detailLevel - * @return array returns an array of tlAttachment (the created attachments) or null on failure - */ - static public function getByIDs(&$db,$ids,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return self::handleNotImplementedMethod(__FUNCTION__); - } - - /** - * Currently not implemented - * - * @param $db [ref] the database connection - * @param $whereClause string and addtional where clause - * @param $column string the name of column which holds the id - * @param $orderBy string an additional ORDER BY clause - * @param $detailLevel the detailLevel - * @return unknown_type - */ - static public function getAll(&$db,$whereClause = null,$column = null,$orderBy = null,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return self::handleNotImplementedMethod(__FUNCTION__); - } -}; -?> \ No newline at end of file +fkID = null; + $this->fkTableName = null; + $this->fName = null; + $this->title = null; + $this->fType = null; + $this->fSize = null; + $this->destFPath = null; + $this->fContents = null; + $this->description = null; + $this->dateAdded = null; + $this->isImage = null; + $this->inlineString = null; + + if (! ($options & self::TLOBJ_O_SEARCH_BY_ID)) { + $this->dbID = null; + } + } + + /** + * Class constructor + * + * @param $dbID integer + * the database identifier of the attachment + */ + public function __construct($dbID = null) + { + parent::__construct(); + + $this->compressionType = tlAttachmentRepository::getCompression(); + $this->repositoryPath = tlAttachmentRepository::getPathToRepository(); + $this->attachmentCfg = config_get('attachments'); + + $this->_clean(); + $this->dbID = $dbID; + } + + /* + * Class destructor, cleans the object + */ + public function __destruct() + { + parent::__destruct(); + $this->_clean(); + } + + /* + * + */ + public function setID($id) + { + $this->dbID = $id; + } + + /* + * Initializes the attachment object + * + * @param object $db [ref] the db-object + * @param int $fkid the foreign key id (attachments.fk_id) + * @param string $fktableName the tablename to which the $id refers to (attachments.fk_table) + * @param string $fName the filename + * @param string $destFPath the file path + * @param string $fContents the contents of the file + * @param string $fType the mime-type of the file + * @param int $fSize the filesize (uncompressed) + * @param string $title the title used for the attachment + * + * @return integer returns tl::OK + */ + public function create($fkid, $fkTableName, $fName, $destFPath, $fContents, + $fType, $fSize, $title, $opt = null) + { + $this->_clean(); + + $title = trim($title); + $config = $this->attachmentCfg; + if ($title == "") { + switch ($config->action_on_save_empty_title) { + case 'use_filename': + $title = $fName; + break; + + default: + break; + } + } + + $allowEmptyTitle = $config->allow_empty_title; + if (isset($opt['allow_empty_title'])) { + $allowEmptyTitle = $opt['allow_empty_title']; + } + + if (! $allowEmptyTitle && $title == "") { + return self::E_TITLELENGTH; + } + + $this->fkID = $fkid; + $this->fkTableName = trim($fkTableName); + $this->fType = trim($fType); + $this->fSize = $fSize; + $this->fName = $fName; + $this->destFPath = trim($destFPath); + $this->fContents = $fContents; + + $this->isImage = (strpos($this->fType, 'image/') !== false); + $this->inlineString = null; + + // for FS-repository, the path to the repository itself is cut off, so the path is + // relative to the repository itself + $this->destFPath = str_replace( + $this->repositoryPath . DIRECTORY_SEPARATOR, "", $destFPath); + $this->title = trim($title); + + return tl::OK; + } + + /* + * Read the attachment information from the database, for filesystem repository this doesn't read + * the contents of the attachments + * + * @param $db [ref] the database connection + * @param $options integer null or TLOBJ_O_SEARCH_BY_ID + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function readFromDB(&$db, $options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->_clean($options); + $query = "SELECT id,title,description,file_name,file_type,file_size,date_added," . + "compression_type,file_path,fk_id,fk_table FROM {$this->tables['attachments']} "; + + $clauses = null; + if ($options & self::TLOBJ_O_SEARCH_BY_ID) { + $clauses[] = "id = {$this->dbID}"; + } + if ($clauses) { + $query .= " WHERE " . implode(" AND ", $clauses); + } + + $info = $db->fetchFirstRow($query); + if ($info) { + $this->fkID = $info['fk_id']; + $this->fkTableName = $info['fk_table']; + $this->fName = $info['file_name']; + $this->destFPath = $info['file_path']; + $this->fType = trim($info['file_type']); + $this->fSize = $info['file_size']; + $this->dbID = $info['id']; + $this->description = $info['description']; + $this->dateAdded = $info['date_added']; + $this->title = $info['title']; + $this->compressionType = $info['compression_type']; + + $this->isImage = (strpos($this->fType, 'image/') !== false); + $this->inlineString = null; + if ($this->isImage) { + $this->inlineString = "[tlInlineImage]{$this->dbID}[/tlInlineImage]"; + } + } + + return $info ? tl::OK : tl::ERROR; + } + + /** + * Returns the attachment meta information in a legacy way + * + * @return array array with the attachment information + */ + public function getInfo() + { + return array( + "id" => $this->dbID, + "title" => $this->title, + "description" => $this->description, + "file_name" => $this->fName, + "file_type" => $this->fType, + "file_size" => $this->fSize, + "is_image" => $this->isImage, + "date_added" => $this->dateAdded, + "inlineString" => $this->inlineString, + "compression_type" => $this->compressionType, + "file_path" => $this->destFPath, + "fk_id" => $this->fkID, + "fk_table" => $this->fkTableName + ); + } + + /* + * Writes the attachment into the database, for database repositories also the contents + * of the attachments are written + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function writeToDB(&$db, &$itemID = null) + { + $tableName = $db->prepare_string($this->fkTableName); + $fName = $db->prepare_string($this->fName); + $title = $db->prepare_string($this->title); + $fType = $db->prepare_string($this->fType); + + $destFPath = is_null($this->destFPath) ? 'NULL' : "'" . + $db->prepare_string($this->destFPath) . "'"; + + // for FS-repository the contents are null + $fContents = is_null($this->fContents) ? 'NULL' : "'" . + base64_encode($this->fContents) . "'"; + + $query = "INSERT INTO {$this->tables['attachments']} + (fk_id,fk_table,file_name,file_path,file_size,file_type, date_added,content,compression_type,title) + VALUES ({$this->fkID},'{$tableName}','{$fName}',{$destFPath},{$this->fSize},'{$this->fType}'," . + $db->db_now() . ",$fContents,{$this->compressionType},'{$title}')"; + + $result = $db->exec_query($query); + if ($result) { + $this->dbID = $db->insert_id(); + $itemID = $this->dbID; + } + + return $result ? tl::OK : tl::ERROR; + } + + /* + * Deletes an attachment from the db, for databse repositories also the contents are deleted + * + * @return integer return tl::OK on success, tl::ERROR else + */ + public function deleteFromDB(&$db) + { + $query = "DELETE FROM {$this->tables['attachments']} + WHERE id = {$this->dbID}"; + $result = $db->exec_query($query); + + return $result ? tl::OK : tl::ERROR; + } + + /** + * Creates an attachment by a given database identifier + * + * @param $db [ref] + * the database connection + * @param $id the + * database identifier of the attachment + * @param $detailLevel the + * detailLevel + * @return tlAttachment the created attachment or null on failure + */ + public static function getByID(&$db, $id, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectFromDB($db, $id, __CLASS__, + tlAttachment::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + } + + /** + * Creates some attachments by given database identifiers + * + * @param $db [ref] + * the database connection + * @param $id the + * database identifier of the attachment + * @param $detailLevel the + * detailLevel + * @return array returns an array of tlAttachment (the created attachments) or null on failure + */ + public static function getByIDs(&$db, $ids, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return self::handleNotImplementedMethod(__FUNCTION__); + } + + /** + * Currently not implemented + * + * @param database $db + * [ref] the database connection + * @param $whereClause string + * and addtional where clause + * @param $column string + * the name of column which holds the id + * @param $orderBy string + * an additional ORDER BY clause + * @param $detailLevel the + * detailLevel + * @return unknown_type + */ + public static function getAll(&$db, $whereClause = null, $column = null, + $orderBy = null, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return self::handleNotImplementedMethod(__FUNCTION__); + } +} +?> diff --git a/lib/functions/tlAttachmentRepository.class.php b/lib/functions/tlAttachmentRepository.class.php index d6f494e1b2..5f032ff650 100644 --- a/lib/functions/tlAttachmentRepository.class.php +++ b/lib/functions/tlAttachmentRepository.class.php @@ -1,617 +1,664 @@ -repositoryType = self::getType(); - $this->repositoryCompressionType = self::getCompression(); - $this->repositoryPath = self::getPathToRepository(); - $this->attachmentCfg = config_get('attachments'); - - $this->attmObj = new tlAttachment(); - } - - /** - * Creates the one and only repository object - * - * @param $db [ref] resource the database connection - * @return tlAttachmenRepository - */ - public static function create(&$db) - { - if (!isset(self::$s_instance)) - { - $c = __CLASS__; - self::$s_instance = new $c($db); - } - - return self::$s_instance; - } - - /** - * Returns the type of the repository, like filesystem, database,... - * - * @return integer the type of the repository - */ - public static function getType() - { - return config_get('repositoryType'); - } - /** - * returns the compression type of the repository - * - * @return integer the compression type - */ - public static function getCompression() - { - return config_get('repositoryCompressionType'); - } - /** - * returns the path to the repository - * - * @return string path to the repository - */ - public static function getPathToRepository() - { - return config_get('repositoryPath'); - } - - - /** - * Inserts the information about an attachment into the db - * - * @param int $fkid the foreign key id (attachments.fk_id) - * @param string $fktableName the tablename to which the $id refers to (attachments.fk_table) - * @param string $title the title used for the attachment - * @param array $fInfo should be $_FILES in most cases - * - * @return int returns true if the information was successfully stored, false else - * - **/ - public function insertAttachment($fkid,$fkTableName,$title,$fInfo,$opt=null) - { - $op = new stdClass(); - $op->statusOK = false; - $op->msg = ''; - $op->statusCode = 0; - - $fName = isset($fInfo['name']) ? $fInfo['name'] : null; - $fType = isset($fInfo['type']) ? $fInfo['type'] : ''; - $fSize = isset($fInfo['size']) ? $fInfo['size'] : 0; - $fTmpName = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : ''; - - if (null == $fName || '' == $fType || 0 == $fSize) { - $op->statusCode = 'fNameORfTypeOrfSize'; - return $op; - } - - // Process filename against XSS - // Thanks to http://owasp.org/index.php/Unrestricted_File_Upload - $pattern = trim($this->attachmentCfg->allowed_filenames_regexp); - if( '' != $pattern && !preg_match($pattern,$fName) ){ - $op->statusCode = 'allowed_filenames_regexp'; - $op->msg = str_replace('%filename%',$fName,lang_get('FILE_UPLOAD_' . $op->statusCode)); - return $op; - } - - $fExt = getFileExtension($fName,""); - if( '' == $fExt ) { - $op->msg = 'empty extension -> failed'; - $op->statusCode = 'empty_extension'; - return $op; - } - - $allowed = explode(',',$this->attachmentCfg->allowed_files); - if (!in_array($fExt, $allowed)) { - $op->statusCode = 'allowed_files'; - $op->msg = str_replace('%filename%',$fName,lang_get('FILE_UPLOAD_' . $op->statusCode)); - return $op; - } - - // Go ahead - $fContents = null; - $destFPath = null; - $destFName = getUniqueFileName($fExt); - - if ($this->repositoryType == TL_REPOSITORY_TYPE_FS) { - $destFPath = $this->buildRepositoryFilePath($destFName,$fkTableName,$fkid); - $op->statusOK = $this->storeFileInFSRepository($fTmpName,$destFPath); - } else { - $fContents = $this->getFileContentsForDBRepository($fTmpName,$destFName); - $op->statusOK = sizeof($fContents); - if($op->statusOK) { - @unlink($fTmpName); - } - } - - if ($op->statusOK) { - $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX,'',$fkTableName); - $op->statusOK = - ($this->attmObj->create($fkid,$stdTableUsedAsFolder,$fName,$destFPath, - $fContents,$fType,$fSize,$title,$opt) >= tl::OK); - - if ($op->statusOK) { - $op->statusOK = $this->attmObj->writeToDb($this->db); - } else { - @unlink($destFPath); - } - } - - return $op; - } - - /** - * Builds the path for a given filename according to the tablename and id - * - * @param string $destFName the fileName - * @param string $tableName the tablename to which $id referes to (attachments.fk_table) - * @param int $id the foreign key id attachments.fk_id) - * - * @return string returns the full path for the file - **/ - public function buildRepositoryFilePath($destFName,$tableName,$id) - { - $destFPath = $this->buildRepositoryFolderFor($tableName,$id,true); - $destFPath .= DIRECTORY_SEPARATOR.$destFName; - - return $destFPath; - } - - /** - * Fetches the contents of a file for storing it into the DB-repository - * - * @param string $fTmpName the filename of the attachment - * @param string $destFName a unique file name for temporary usage - * - * @return string the contents of the attachment to be stored into the db - **/ - protected function getFileContentsForDBRepository($fTmpName,$destFName) - { - $tmpGZName = null; - switch($this->repositoryCompressionType) - { - case TL_REPOSITORY_COMPRESSIONTYPE_NONE: - break; - - case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: - //copy the file into a dummy file in the repository and gz it and - //read the file contents from this new file - $tmpGZName = $this->repositoryPath.DIRECTORY_SEPARATOR.$destFName.".gz"; - gzip_compress_file($fTmpName, $tmpGZName); - $fTmpName = $tmpGZName; - break; - } - $fContents = getFileContents($fTmpName); - - //delete the dummy file if present - if (!is_null($tmpGZName)) - { - unlink($tmpGZName); - } - - return $fContents; - } - - /** - * Stores a file into the FS-repository. - * It checks if the given tmp name is of an uploaded file. - * If so, it moves the file from the temp dir to the upload destination using move_uploaded_file(). - * Else it simply rename the file through rename function. - * This process is needed to allow use of this method when uploading attachments via XML-RPC API - * - * @param string $fTmpName the filename - * @param string $destFPath [ref] the destination file name - * - * @return bool returns true if the file was uploaded, false else - * - * @internal revision - * 20100918 - francisco.mancardi@gruppotesi.com - BUGID 1890 - contribution by kinow - **/ - protected function storeFileInFSRepository($fTmpName,&$destFPath) - { - switch($this->repositoryCompressionType) - { - case TL_REPOSITORY_COMPRESSIONTYPE_NONE: - if ( is_uploaded_file($fTmpName)) - { - $fileUploaded = move_uploaded_file($fTmpName,$destFPath); - } - else - { - $fileUploaded = rename($fTmpName,$destFPath); - } - break; - - case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: - //add the gz extension and compress the file - $destFPath .= ".gz"; - $fileUploaded = gzip_compress_file($fTmpName,$destFPath); - break; - } - return $fileUploaded; - } - - /** - * Builds the repository folder for the attachment - * - * @param string $tableName the tablename to which $id referes to (attachments.fk_table) - * @param int $id the foreign key id attachments.fk_id) - * @param bool $mkDir if true then the the directory will be created, else not - * - * @return string returns the full path for the folder - **/ - protected function buildRepositoryFolderFor($tableName,$id,$mkDir = false) - { - // use always the STANDARD table name i.e. WITHOUT PREFIX - $leafFolder = str_replace(DB_TABLE_PREFIX,'',$tableName); - $path = $this->repositoryPath . DIRECTORY_SEPARATOR . $leafFolder; - if ($mkDir && !file_exists($path)) { - mkdir($path); - } - - $path .= DIRECTORY_SEPARATOR . $id; - if ($mkDir && !file_exists($path)) { - mkdir($path); - } - - return $path; - } - - /** - * Deletes an attachment from the filesystem - * - * @param $dummy not used, only there to keep the interface equal to deleteAttachmentFromDB - * @param $attachmentInfo array with information about the attachments - * @return interger returns tl::OK on success, tl::ERROR else - */ - protected function deleteAttachmentFromFS($dummy,$attachmentInfo = null) - { - $filePath = $attachmentInfo['file_path']; - - $destFPath = $this->repositoryPath.DIRECTORY_SEPARATOR.$filePath; - return @unlink($destFPath) ? tl::OK : tl::ERROR; - } - - /** - * Deletes an attachment from the database - * - * @param $id integer the database identifier of the attachment - * @param $dummy not used, only there to keep the interface equal to deleteAttachmentFromDB - * @return integer returns tl::OK on success, tl::ERROR else - */ - protected function deleteAttachmentFromDB($id,$dummy = null) - { - $this->attmObj->setID($id); - return $this->attmObj->deleteFromDB($this->db); - } - - /** - * Deletes the attachment with the given database id - * - * @param $id integer the database identifier of the attachment - * @param $attachmentInfo array, optional information about the attachment - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function deleteAttachment($id,$attachmentInfo = null) - { - $bResult = tl::ERROR; - if (is_null($attachmentInfo)) - $attachmentInfo = $this->getAttachmentInfo($id); - if ($attachmentInfo) - { - $bResult = tl::OK; - if (trim($attachmentInfo['file_path']) != "") - $bResult = $this->deleteAttachmentFromFS($id,$attachmentInfo); - $bResult = $this->deleteAttachmentFromDB($id,null) && $bResult; - } - return $bResult ? tl::OK : tl::ERROR; - } - - /** - * Gets the contents of the attachments from the repository - * - * @param $id integer the database identifier of the attachment - * @param $attachmentInfo array, optional information about the attachment - * @return string the contents of the attachment or null on error - * - * @internal revision - * 20101208 - franciscom - BUGID 4085 - */ - public function getAttachmentContent($id,$attachmentInfo = null) - { - $content = null; - if (!$attachmentInfo) { - $attachmentInfo = $this->getAttachmentInfo($id); - } - - if ($attachmentInfo) { - $fname = 'getAttachmentContentFrom'; - $fname .= ($this->repositoryType == TL_REPOSITORY_TYPE_FS) - ? 'FS' : 'DB'; - $content = $this->$fname($id); - } - return $content; - } - - /** - * Gets the contents of the attachment given by it's database identifier from the filesystem - * - * @param $id integer the database identifier of the attachment - * @return string the contents of the attachment or null on error - */ - protected function getAttachmentContentFromFS($id) - { - $query = "SELECT file_size,compression_type,file_path " . - " FROM {$this->tables['attachments']} - WHERE id = {$id}"; - $row = $this->db->fetchFirstRow($query); - - $content = null; - if ($row) { - $filePath = $row['file_path']; - $fileSize = $row['file_size']; - $destFPath = $this->repositoryPath - . DIRECTORY_SEPARATOR . $filePath; - - switch($row['compression_type']) { - case TL_REPOSITORY_COMPRESSIONTYPE_NONE: - $content = getFileContents($destFPath); - break; - - case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: - $content = gzip_readFileContent($destFPath,$fileSize); - break; - } - } - return $content; - } - - /** - * Gets some common infos about attachments - * - * @param int $id the id of the attachment (attachments.id) - * - * @return string returns the contents of the attachment - */ - //@TODO schlundus, should be protected, but blocker is testcase::copy_attachments - public function getAttachmentContentFromDB($id) - { - $query = "SELECT content,file_size,compression_type " . - " FROM {$this->tables['attachments']} WHERE id = {$id}"; - $row = $this->db->fetchFirstRow($query); - - $content = null; - if ($row) - { - $content = $row['content']; - $fileSize = $row['file_size']; - switch($row['compression_type']) - { - case TL_REPOSITORY_COMPRESSIONTYPE_NONE: - break; - - case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: - $content = gzip_uncompress_content($content,$fileSize); - break; - } - } - - return $content; - } - - /** - * Creates a temporary file and writes the attachment content into this file. - * - * @param $base64encodedContent base64 encoded file content - * - * @since 1.9.17 - * @return file handler - */ - public function createAttachmentTempFile( $base64encodedContent ) - { - $resultInfo = array(); - $filename = tempnam(sys_get_temp_dir(), 'tl-'); - - $resultInfo["tmp_name"] = $filename; - $handle = fopen( $filename, "w" ); - fwrite($handle, base64_decode( $base64encodedContent )); - fclose( $handle ); - - $filesize = filesize($filename); - $resultInfo["size"] = $filesize; - - return $resultInfo; - } - - - /** - * Deletes all attachments of a certain object of a given type - * - * @param $fkid integer the id of the object whose attachments should be deleted - * @param $fkTableName the "type" of the object, or the table the object is stored in - * - * @return boolean returns bSuccess if all attachments are deleted, false else - */ - public function deleteAttachmentsFor($fkid,$fkTableName) { - - $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX,'',$fkTableName); - $statusOK = true; - $attachmentIDs = (array)$this->getAttachmentIDsFor($fkid,$stdTableUsedAsFolder); - - for($i = 0;$i < sizeof($attachmentIDs);$i++) { - $id = $attachmentIDs[$i]; - $statusOK = ($this->deleteAttachment($id) && $statusOK); - } - - if ($statusOK) { - $folder = $this->buildRepositoryFolderFor($stdTableUsedAsFolder,$fkid); - if (is_dir($folder)) { - rmdir($folder); - } - } - return $statusOK; - } - - /** - * Reads the information about the attachment with the given database id - * - * @param $id integer the database identifier of the attachment - * @return array the information about the attachment - */ - public function getAttachmentInfo($id) - { - $info = null; - $this->attmObj->setID($id); - if ($this->attmObj->readFromDB($this->db)) - { - $info = $this->attmObj->getInfo(); - } - return $info; - } - - /** - * Reads all attachments for a certain object of a given type - * - * @param $fkid integer the id of the object whose attachments should be read - * @param $fkTableName the "type" of the object, or the table the object is stored in - * - * @return arrays returns an array with the attachments of the objects, or null on error - */ - public function getAttachmentInfosFor($fkid,$fkTableName,$accessKey='std') - { - $itemSet = null; - $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX,'',$fkTableName); - - $idSet = (array)$this->getAttachmentIDsFor($fkid,$stdTableUsedAsFolder); - $loop2do = sizeof($idSet); - for($idx = 0;$idx < $loop2do; $idx++) { - $attachmentInfo = $this->getAttachmentInfo($idSet[$idx]); - if (null != $attachmentInfo) { - // needed because on inc_attachments.tpl this test: - // {if $info.title eq ""} - // is used to undertand if icon or other handle is needed to access - // file content - $attachmentInfo['title'] = trim($attachmentInfo['title']); - switch($accessKey) { - case 'id': - $itemSet[$attachmentInfo['id']] = $attachmentInfo; - break; - - default: - $itemSet[] = $attachmentInfo; - break; - } - } - } - return $itemSet; - } - - /** - * Yields all attachmentids for a certain object of a given type - * - * @param $fkid integer the id of the object whose attachments should be read - * @param $fkTableName the "type" of the object, or the table the object is stored in - * - * @return arrays returns an array with the attachments of the objects, or null on error - */ - public function getAttachmentIDsFor($fkid,$fkTableName) - { - $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX,'',$fkTableName); - - $order_by = $this->attachmentCfg->order_by; - - $query = "SELECT id FROM {$this->tables['attachments']} WHERE fk_id = {$fkid} " . - " AND fk_table = '" . $this->db->prepare_string($stdTableUsedAsFolder). "' " . $order_by; - $attachmentIDs = $this->db->fetchColumnsIntoArray($query,'id'); - - return $attachmentIDs; - } - - /* - * @param $fkTableName the "type" of the object, or the table the object is stored in - */ - function copyAttachments($source_id,$target_id,$fkTableName) { - $mapping = null; - $f_parts = null; - $destFPath = null; - $mangled_fname = ''; - $status_ok = false; - $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX,'',$fkTableName); - - $attachments = $this->getAttachmentInfosFor($source_id,$stdTableUsedAsFolder); - if( null != $attachments && count($attachments) > 0) { - foreach($attachments as $key => $value) { - $file_contents = null; - $f_parts = explode(DIRECTORY_SEPARATOR,$value['file_path']); - $mangled_fname = $f_parts[count($f_parts)-1]; - - if ($this->repositoryType == TL_REPOSITORY_TYPE_FS) { - $destFPath = $this->buildRepositoryFilePath($mangled_fname,$stdTableUsedAsFolder,$target_id); - $status_ok = copy($this->repositoryPath . $value['file_path'],$destFPath); - } else { - $file_contents = $this->getAttachmentContentFromDB($value['id']); - $status_ok = sizeof($file_contents); - } - - if($status_ok) { - $this->attmObj->create($target_id,$stdTableUsedAsFolder,$value['file_name'], - $destFPath,$file_contents,$value['file_type'], - $value['file_size'],$value['title']); - $attID = 0; - $this->attmObj->writeToDB($this->db,$attID); - $mapping[$value['id']] = $attID; - } - } - } - - return $mapping; - } +repositoryType = self::getType(); + $this->repositoryCompressionType = self::getCompression(); + $this->repositoryPath = self::getPathToRepository(); + $this->attachmentCfg = config_get('attachments'); + + $this->attmObj = new tlAttachment(); + } + + /** + * Creates the one and only repository object + * + * @param database $db + * [ref] + * resource the database connection + * @return tlAttachmentRepository + */ + public static function create(&$db) + { + if (! isset(self::$s_instance)) { + $c = __CLASS__; + self::$s_instance = new $c($db); + } + + return self::$s_instance; + } + + /** + * Returns the type of the repository, like filesystem, database,... + * + * @return integer the type of the repository + */ + public static function getType() + { + return config_get('repositoryType'); + } + + /** + * returns the compression type of the repository + * + * @return integer the compression type + */ + public static function getCompression() + { + return config_get('repositoryCompressionType'); + } + + /** + * returns the path to the repository + * + * @return string path to the repository + */ + public static function getPathToRepository() + { + return config_get('repositoryPath'); + } + + /** + * Inserts the information about an attachment into the db + * + * @param int $fkid + * the foreign key id (attachments.fk_id) + * @param string $fktableName + * the tablename to which the $id refers to (attachments.fk_table) + * @param string $title + * the title used for the attachment + * @param array $fInfo + * should be $_FILES in most cases + * + * @return int returns true if the information was successfully stored, false else + * + */ + public function insertAttachment($fkid, $fkTableName, $title, $fInfo, + $opt = null) + { + $op = new stdClass(); + $op->statusOK = false; + $op->msg = ''; + $op->statusCode = 0; + + $fName = isset($fInfo['name']) ? $fInfo['name'] : null; + $fType = isset($fInfo['type']) ? $fInfo['type'] : ''; + $fSize = isset($fInfo['size']) ? $fInfo['size'] : 0; + $fTmpName = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : ''; + + if (null == $fName || '' == $fType || 0 == $fSize) { + $op->statusCode = 'fNameORfTypeOrfSize'; + return $op; + } + + // Process filename against XSS + // Thanks to http://owasp.org/index.php/Unrestricted_File_Upload + $pattern = trim($this->attachmentCfg->allowed_filenames_regexp); + if ('' != $pattern && ! preg_match($pattern, $fName)) { + $op->statusCode = 'allowed_filenames_regexp'; + $op->msg = str_replace('%filename%', $fName, + lang_get('FILE_UPLOAD_' . $op->statusCode)); + return $op; + } + + $fExt = getFileExtension($fName, ""); + if ('' == $fExt) { + $op->msg = 'empty extension -> failed'; + $op->statusCode = 'empty_extension'; + return $op; + } + + $allowed = explode(',', $this->attachmentCfg->allowed_files); + if (! in_array($fExt, $allowed)) { + $op->statusCode = 'allowed_files'; + $op->msg = str_replace('%filename%', $fName, + lang_get('FILE_UPLOAD_' . $op->statusCode)); + return $op; + } + + // Go ahead + $fContents = null; + $destFPath = null; + $destFName = getUniqueFileName($fExt); + + if ($this->repositoryType == TL_REPOSITORY_TYPE_FS) { + $destFPath = $this->buildRepositoryFilePath($destFName, $fkTableName, + $fkid); + $op->statusOK = $this->storeFileInFSRepository($fTmpName, $destFPath); + } else { + $fContents = $this->getFileContentsForDBRepository($fTmpName, + $destFName); + $op->statusOK = count($fContents); + if ($op->statusOK) { + @unlink($fTmpName); + } + } + + if ($op->statusOK) { + $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX, '', + $fkTableName); + $op->statusOK = ($this->attmObj->create($fkid, $stdTableUsedAsFolder, + $fName, $destFPath, $fContents, $fType, $fSize, $title, $opt) >= + tl::OK); + + if ($op->statusOK) { + $op->statusOK = $this->attmObj->writeToDb($this->db); + } else { + @unlink($destFPath); + } + } + + return $op; + } + + /** + * Builds the path for a given filename according to the tablename and id + * + * @param string $destFName + * the fileName + * @param string $tableName + * the tablename to which $id referes to (attachments.fk_table) + * @param int $id + * the foreign key id attachments.fk_id) + * + * @return string returns the full path for the file + */ + public function buildRepositoryFilePath($destFName, $tableName, $id) + { + $destFPath = $this->buildRepositoryFolderFor($tableName, $id, true); + $destFPath .= DIRECTORY_SEPARATOR . $destFName; + + return $destFPath; + } + + /** + * Fetches the contents of a file for storing it into the DB-repository + * + * @param string $fTmpName + * the filename of the attachment + * @param string $destFName + * a unique file name for temporary usage + * + * @return string the contents of the attachment to be stored into the db + */ + protected function getFileContentsForDBRepository($fTmpName, $destFName) + { + $tmpGZName = null; + switch ($this->repositoryCompressionType) { + case TL_REPOSITORY_COMPRESSIONTYPE_NONE: + break; + + case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: + // copy the file into a dummy file in the repository and gz it and + // read the file contents from this new file + $tmpGZName = $this->repositoryPath . DIRECTORY_SEPARATOR . + $destFName . ".gz"; + gzip_compress_file($fTmpName, $tmpGZName); + $fTmpName = $tmpGZName; + break; + } + $fContents = getFileContents($fTmpName); + + // delete the dummy file if present + if (! is_null($tmpGZName)) { + unlink($tmpGZName); + } + + return $fContents; + } + + /** + * Stores a file into the FS-repository. + * It checks if the given tmp name is of an uploaded file. + * If so, it moves the file from the temp dir to the upload destination using move_uploaded_file(). + * Else it simply rename the file through rename function. + * This process is needed to allow use of this method when uploading attachments via XML-RPC API + * + * @param string $fTmpName + * the filename + * @param string $destFPath + * [ref] the destination file name + * + * @return bool returns true if the file was uploaded, false else + * + * @internal revision + * 20100918 - francisco.mancardi@gruppotesi.com - BUGID 1890 - contribution by kinow + */ + protected function storeFileInFSRepository($fTmpName, &$destFPath) + { + switch ($this->repositoryCompressionType) { + case TL_REPOSITORY_COMPRESSIONTYPE_NONE: + if (is_uploaded_file($fTmpName)) { + $fileUploaded = move_uploaded_file($fTmpName, $destFPath); + } else { + $fileUploaded = rename($fTmpName, $destFPath); + } + break; + + case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: + // add the gz extension and compress the file + $destFPath .= ".gz"; + $fileUploaded = gzip_compress_file($fTmpName, $destFPath); + break; + } + return $fileUploaded; + } + + /** + * Builds the repository folder for the attachment + * + * @param string $tableName + * the tablename to which $id referes to (attachments.fk_table) + * @param int $id + * the foreign key id attachments.fk_id) + * @param bool $mkDir + * if true then the the directory will be created, else not + * + * @return string returns the full path for the folder + */ + protected function buildRepositoryFolderFor($tableName, $id, $mkDir = false) + { + // use always the STANDARD table name i.e. WITHOUT PREFIX + $leafFolder = str_replace(DB_TABLE_PREFIX, '', $tableName); + $path = $this->repositoryPath . DIRECTORY_SEPARATOR . $leafFolder; + if (! empty($path) && $mkDir && ! file_exists($path)) { + mkdir($path); + } + + $path .= DIRECTORY_SEPARATOR . $id; + if (! empty($path) && $mkDir && ! file_exists($path)) { + mkdir($path); + } + + return $path; + } + + /** + * Deletes an attachment from the filesystem + * + * @param $dummy not + * used, only there to keep the interface equal to deleteAttachmentFromDB + * @param $attachmentInfo array + * with information about the attachments + * @return interger returns tl::OK on success, tl::ERROR else + */ + protected function deleteAttachmentFromFS($dummy, $attachmentInfo = null) + { + $filePath = $attachmentInfo['file_path']; + + $destFPath = $this->repositoryPath . DIRECTORY_SEPARATOR . $filePath; + return @unlink($destFPath) ? tl::OK : tl::ERROR; + } + + /** + * Deletes an attachment from the database + * + * @param $id integer + * the database identifier of the attachment + * @param $dummy not + * used, only there to keep the interface equal to deleteAttachmentFromDB + * @return integer returns tl::OK on success, tl::ERROR else + */ + protected function deleteAttachmentFromDB($id, $dummy = null) + { + $this->attmObj->setID($id); + return $this->attmObj->deleteFromDB($this->db); + } + + /** + * Deletes the attachment with the given database id + * + * @param $id integer + * the database identifier of the attachment + * @param $attachmentInfo array, + * optional information about the attachment + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function deleteAttachment($id, $attachmentInfo = null) + { + $bResult = tl::ERROR; + if (is_null($attachmentInfo)) { + $attachmentInfo = $this->getAttachmentInfo($id); + } + if ($attachmentInfo) { + $bResult = tl::OK; + if (trim($attachmentInfo['file_path']) != "") { + $bResult = $this->deleteAttachmentFromFS($id, $attachmentInfo); + } + $bResult = $this->deleteAttachmentFromDB($id, null) && $bResult; + } + return $bResult ? tl::OK : tl::ERROR; + } + + /** + * Gets the contents of the attachments from the repository + * + * @param $id integer + * the database identifier of the attachment + * @param $attachmentInfo array, + * optional information about the attachment + * @return string the contents of the attachment or null on error + * + * @internal revision + * 20101208 - franciscom - BUGID 4085 + */ + public function getAttachmentContent($id, $attachmentInfo = null) + { + $content = null; + if (! $attachmentInfo) { + $attachmentInfo = $this->getAttachmentInfo($id); + } + + if ($attachmentInfo) { + $fname = 'getAttachmentContentFrom'; + $fname .= ($this->repositoryType == TL_REPOSITORY_TYPE_FS) ? 'FS' : 'DB'; + $content = $this->$fname($id); + } + return $content; + } + + /** + * Gets the contents of the attachment given by it's database identifier from the filesystem + * + * @param $id integer + * the database identifier of the attachment + * @return string the contents of the attachment or null on error + */ + protected function getAttachmentContentFromFS($id) + { + $query = "SELECT file_size,compression_type,file_path " . + " FROM {$this->tables['attachments']} + WHERE id = {$id}"; + $row = $this->db->fetchFirstRow($query); + + $content = null; + if ($row) { + $filePath = $row['file_path']; + $fileSize = $row['file_size']; + $destFPath = $this->repositoryPath . DIRECTORY_SEPARATOR . $filePath; + + switch ($row['compression_type']) { + case TL_REPOSITORY_COMPRESSIONTYPE_NONE: + $content = getFileContents($destFPath); + break; + + case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: + $content = gzip_readFileContent($destFPath, $fileSize); + break; + } + } + return $content; + } + + /** + * Gets some common infos about attachments + * + * @param int $id + * the id of the attachment (attachments.id) + * + * @return string the contents of the attachment + */ + // @TODO schlundus, should be protected, but blocker is testcase::copy_attachments + public function getAttachmentContentFromDB($id) + { + $query = "SELECT content,file_size,compression_type " . + " FROM {$this->tables['attachments']} WHERE id = {$id}"; + $row = $this->db->fetchFirstRow($query); + + $content = null; + if ($row) { + $content = $row['content']; + $fileSize = $row['file_size']; + switch ($row['compression_type']) { + case TL_REPOSITORY_COMPRESSIONTYPE_NONE: + break; + + case TL_REPOSITORY_COMPRESSIONTYPE_GZIP: + $content = gzip_uncompress_content($content, $fileSize); + break; + } + } + + return $content; + } + + /** + * Creates a temporary file and writes the attachment content into this file. + * + * @param $base64encodedContent base64 + * encoded file content + * + * @since 1.9.17 + * @return file handler + */ + public function createAttachmentTempFile($base64encodedContent) + { + $resultInfo = array(); + $filename = tempnam(sys_get_temp_dir(), 'tl-'); + + $resultInfo["tmp_name"] = $filename; + $handle = fopen($filename, "w"); + fwrite($handle, base64_decode($base64encodedContent)); + fclose($handle); + + $filesize = filesize($filename); + $resultInfo["size"] = $filesize; + + return $resultInfo; + } + + /** + * Deletes all attachments of a certain object of a given type + * + * @param int $fkid + * the id of the object whose attachments should be deleted + * @param string $fkTableName + * the "type" of the object, or the table the object is stored in + * + * @return boolean returns bSuccess if all attachments are deleted, false else + */ + public function deleteAttachmentsFor($fkid, $fkTableName) + { + $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX, '', $fkTableName); + $statusOK = true; + $attachmentIDs = (array) $this->getAttachmentIDsFor($fkid, + $stdTableUsedAsFolder); + + for ($i = 0; $i < count($attachmentIDs); $i ++) { + $id = $attachmentIDs[$i]; + $statusOK = ($this->deleteAttachment($id) && $statusOK); + } + + if ($statusOK) { + $folder = $this->buildRepositoryFolderFor($stdTableUsedAsFolder, + $fkid); + if (is_dir($folder)) { + rmdir($folder); + } + } + return $statusOK; + } + + /** + * Reads the information about the attachment with the given database id + * + * @param $id integer + * the database identifier of the attachment + * @return array the information about the attachment + */ + public function getAttachmentInfo($id) + { + $info = null; + $this->attmObj->setID($id); + if ($this->attmObj->readFromDB($this->db)) { + $info = $this->attmObj->getInfo(); + } + return $info; + } + + /** + * Reads all attachments for a certain object of a given type + * + * @param int $fkid + * integer + * the id of the object whose attachments should be read + * @param string $fkTableName + * the + * "type" of the object, or the table the object is stored in + * + * @return array with the attachments of the objects, or null on error + */ + public function getAttachmentInfosFor($fkid, $fkTableName, + $accessKey = 'std') + { + $itemSet = null; + $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX, '', $fkTableName); + + $idSet = (array) $this->getAttachmentIDsFor($fkid, $stdTableUsedAsFolder); + $loop2do = count($idSet); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $attachmentInfo = $this->getAttachmentInfo($idSet[$idx]); + if (null != $attachmentInfo) { + // needed because on inc_attachments.tpl this test: + // {if $info.title eq ""} + // is used to undertand if icon or other handle is needed to access + // file content + $attachmentInfo['title'] = trim($attachmentInfo['title']); + switch ($accessKey) { + case 'id': + $itemSet[$attachmentInfo['id']] = $attachmentInfo; + break; + + default: + $itemSet[] = $attachmentInfo; + break; + } + } + } + return $itemSet; + } + + /** + * Yields all attachmentids for a certain object of a given type + * + * @param int $fkid + * the id of the object whose attachments should be read + * @param string $fkTableName + * the "type" of the object, or the table the object is stored in + * + * @return array with the attachments of the objects, or null on error + */ + public function getAttachmentIDsFor($fkid, $fkTableName) + { + $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX, '', $fkTableName); + + $order_by = $this->attachmentCfg->order_by; + + $query = "SELECT id FROM {$this->tables['attachments']} WHERE fk_id = {$fkid} " . + " AND fk_table = '" . + $this->db->prepare_string($stdTableUsedAsFolder) . "' " . $order_by; + return $this->db->fetchColumnsIntoArray($query, 'id'); + } + + /* + * @param $fkTableName the "type" of the object, or the table the object is stored in + */ + public function copyAttachments($source_id, $target_id, $fkTableName) + { + $mapping = null; + $f_parts = null; + $destFPath = null; + $mangled_fname = ''; + $status_ok = false; + $stdTableUsedAsFolder = str_replace(DB_TABLE_PREFIX, '', $fkTableName); + + $attachments = $this->getAttachmentInfosFor($source_id, + $stdTableUsedAsFolder); + if (! empty($attachments)) { + foreach ($attachments as $value) { + $file_contents = null; + $f_parts = explode(DIRECTORY_SEPARATOR, $value['file_path']); + $mangled_fname = $f_parts[count($f_parts) - 1]; + + if ($this->repositoryType == TL_REPOSITORY_TYPE_FS) { + $destFPath = $this->buildRepositoryFilePath($mangled_fname, + $stdTableUsedAsFolder, $target_id); + $status_ok = copy( + $this->repositoryPath . $value['file_path'], $destFPath); + } else { + $file_contents = $this->getAttachmentContentFromDB( + $value['id']); + $status_ok = count($file_contents); + } + + if ($status_ok) { + $this->attmObj->create($target_id, $stdTableUsedAsFolder, + $value['file_name'], $destFPath, $file_contents, + $value['file_type'], $value['file_size'], + $value['title']); + $attID = 0; + $this->attmObj->writeToDB($this->db, $attID); + $mapping[$value['id']] = $attID; + } + } + } + + return $mapping; + } } diff --git a/lib/functions/tlCodeTracker.class.php b/lib/functions/tlCodeTracker.class.php index 9d22b38e77..f320249551 100644 --- a/lib/functions/tlCodeTracker.class.php +++ b/lib/functions/tlCodeTracker.class.php @@ -1,708 +1,658 @@ - array('type' => 'stash', 'api' => 'rest', 'enabled' => true, 'order' => -1)); - - - var $entitySpec = array('name' => 'string','cfg' => 'string','type' => 'int'); - - /** - * Class constructor - * - * @param resource &$db reference to the database handler - */ - function __construct(&$db) - { - parent::__construct(); - - // populate types property - $this->getTypes(); - $this->db = &$db; - } - - - - /** - * @return hash - * - * - */ - function getSystems($opt=null) - { - $my = array('options' => null); - $my['options']['status'] = 'enabled'; // enabled,disabled,all - $my['options'] = array_merge($my['options'],(array)$opt); - - switch($my['options']['status']) - { - case 'enabled': - $tval = true; - break; - - case 'disabled': - $tval = false; - break; - - default: - $tval = null; - break; - } - - $ret = array(); - foreach($this->systems as $code => $elem) - { - $idx = 0; - if($tval== null || $elem['enabled'] == $tval) - { - $ret[$code] = $elem; - } - } - return $ret; - } - - /** - * @return hash - * - * - */ - function getTypes() - { - if( is_null($this->types) ) - { - foreach($this->systems as $code => $spec) - { - if($spec['enabled']) - { - $this->types[$code] = $spec['type'] . " (Interface: {$spec['api']})"; - } - } - } - return $this->types; - } - - - /** - * @return - * - * - */ - function getImplementationForType($codeTrackerType) - { - $spec = $this->systems[$codeTrackerType]; - return $spec['type'] . $spec['api'] . 'Interface'; - } - - /** - * @return hash - * - * - */ - function getEntitySpec() - { - return $this->entitySpec; - } - - - /** - * - */ - function create($it) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => 'name already exists'); - - // Critic we need to do this before sanitize, because $it is changed - $xlmCfg = trim($it->cfg); - - // allow empty config - if(strlen($xlmCfg) > 0) - { - $ret = $this->checkXMLCfg($xlmCfg); - if(!$ret['status_ok']) - { - return $ret; // >>>---> Bye! - } - } - - - $safeobj = $this->sanitize($it); - // empty name is not allowed - if( is_null($safeobj->name) ) - { - $ret['msg'] = 'empty name is not allowed'; - return $ret; // >>>---> Bye! - } - - // need to check if name already exist - if( is_null($this->getByName($it->name,array('output' => 'id')) )) - { - $sql = "/* debugMsg */ INSERT INTO {$this->tables['codetrackers']} " . - " (name,cfg,type) " . - " VALUES('" . $safeobj->name . "','" . $safeobj->cfg . "',{$safeobj->type})"; - - if( $this->db->exec_query($sql) ) - { - // at least for Postgres DBMS table name is needed. - $itemID=$this->db->insert_id($this->tables['codetrackers']); - $ret = array('status_ok' => 1, 'id' => $itemID, 'msg' => 'ok'); - } - else - { - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => $this->db->error_msg()); - } - } - - return $ret; - } - - - /** - * - */ - function update($it) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - $msg = array(); - $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; - $msg['ok'] = "operation OK for id %s"; - - // Critic we need to do this before sanitize, because $it is changed - $xlmCfg = trim($it->cfg); - - $safeobj = $this->sanitize($it); - $ret = array('status_ok' => 1, 'id' => $it->id, 'msg' => ''); - - // allow empty config - if(strlen($xlmCfg) > 0) - { - $ret = $this->checkXMLCfg($xlmCfg); - } - - // check for duplicate name - if( $ret['status_ok'] ) - { - $info = $this->getByName($safeobj->name); - if( !is_null($info) && ($info['id'] != $it->id) ) - { - $ret['status_ok'] = 0; - $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, $info['id']); - } - } - - if( $ret['status_ok'] ) - { - $sql = "UPDATE {$this->tables['codetrackers']} " . - " SET name = '" . $safeobj->name. "'," . - " cfg = '" . $safeobj->cfg . "'," . - " type = " . $safeobj->type . - " WHERE id = " . intval($it->id); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$it->id); - - } - return $ret; - - } //function end - - - - /** - * delete can be done ONLY if ID is not linked to test project - */ - function delete($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - - $msg = array(); - $msg['linked'] = "Failure - id %s is linked to: "; - $msg['tproject_details'] = " testproject '%s' with id %s %s"; - $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; - $msg['ok'] = "operation OK for id %s"; - - $ret = array('status_ok' => 1, 'id' => $id, 'msg' => $debugMsg); - if(is_null($id) || ($safeID = intval($id)) <= 0) - { - $ret['status_ok'] = 0; - $ret['id'] = $id; - $ret['msg'] .= sprintf($msg['syntax_error'],$id); - return $ret; // >>>-----> Bye! - } - - - // check if ID is linked - $links = $this->getLinks($safeID); - if( is_null($links) ) - { - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['codetrackers']} " . - " WHERE id = " . intval($safeID); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$safeID); - - } - else - { - $ret['status_ok'] = 0; - $dummy = sprintf($msg['linked'],$safeID); - $sep = ' / '; - foreach($links as $item) - { - $dummy .= sprintf($msg['tproject_details'],$item['testproject_name'],$item['testproject_id'],$sep); - } - $ret['msg'] .= rtrim($dummy,$sep); - - } - return $ret; - - } //function end - - - - - - /** - * - */ - function getByID($id, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'id', 'value' => $id),$options); - } - - - /** - * - */ - function getByName($name, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'name', 'value' => $name),$options); - } - - - /** - * - */ - function getByAttr($attr, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = "/* debugMsg */ SELECT "; - switch($my['options']['output']) - { - case 'id': - $sql .= " id "; - break; - - case 'full': - default: - $sql .= " * "; - break; - - } - - switch($attr['key']) - { - case 'id': - $where = " WHERE id = " . intval($attr['value']); - break; - - case 'name': - default: - $where = " WHERE name = '" . $this->db->prepare_string($attr['value']) . "'"; - break; - } - - - $sql .= " FROM {$this->tables['codetrackers']} " . $where; - $rs = $this->db->get_recordset($sql); - if( !is_null($rs) ) - { - $rs = $rs[0]; - $rs['implementation'] = $this->getImplementationForType($rs['type']); - } - return $rs; - } - - - - /* - * Sanitize and do minor checks - * - * Sanitize Operations - * keys name -> trim will be applied - * type -> intval() wil be applied - * cfg - * - * For strings also db_prepare_string() will be applied - * - * - * Check Operations - * keys name -> if '' => will be set to NULL - * - */ - function sanitize($obj) - { - $sobj = $obj; - - // remove the standard set of characters considered harmful - // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab - // "\r" - carriage return - // and spaces - // fortunatelly this is trim standard behaviour - $k2san = array('name'); - foreach($k2san as $key) - { - $value = trim($obj->$key); - switch($key) - { - case 'name': - $sobj->$key = ($value == '') ? null : $value; - break; - } - - if( !is_null($sobj->$key) ) - { - $sobj->$key = $this->db->prepare_string($obj->$key); - } - - } - - // seems here is better do not touch. - $sobj->cfg = $this->db->prepare_string($obj->cfg); - $sobj->type = intval($obj->type); - - return $sobj; - } - - - - /* - * - * - */ - function link($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - - // Check if link exist for test project ID, in order to INSERT or UPDATE - $statusQuo = $this->getLinkedTo($tprojectID); - - if( is_null($statusQuo) ) - { - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_codetracker']} " . - " (testproject_id,codetracker_id) " . - " VALUES(" . intval($tprojectID) . "," . intval($id) . ")"; - } - else - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_codetracker']} " . - " SET codetracker_id = " . intval($id) . - " WHERE testproject_id = " . intval($tprojectID); - } - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function unlink($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_codetracker']} " . - " WHERE testproject_id = " . intval($tprojectID) . - " AND codetracker_id = " . intval($id); - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function getLinks($id, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('opt' => array('getDeadLinks' => false)); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - if(is_null($id)) - { - return; - } - - - $sql = "/* $debugMsg */ " . - " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name " . - " FROM {$this->tables['testproject_codetracker']} TPCT" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPCT.testproject_id " . - " WHERE TPCT.codetracker_id = " . intval($id); - - if($my['opt']['getDeadLinks']) - { - $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; - } - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - - - /* - * - * - */ - function getLinkSet() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ " . - " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name, TPCT.codetracker_id " . - " FROM {$this->tables['testproject_codetracker']} TPCT" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPCT.testproject_id "; - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - /* - * - * - */ - function getAll($options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => null, 'orderByField' => 'name', 'checkEnv' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $add_fields = ''; - if( $my['options']['output'] == 'add_link_count' ) - { - $add_fields = ", 0 AS link_count "; - } - - $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . $my['options']['orderByField']; - - $sql = "/* debugMsg */ SELECT * {$add_fields} "; - $sql .= " FROM {$this->tables['codetrackers']} {$orderByClause} "; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - - $lc = null; - if( !is_null($rs) ) - { - - if( $my['options']['output'] == 'add_link_count' ) - { - $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, CTD.id"; - $sql .= " FROM {$this->tables['codetrackers']} CTD " . - " JOIN {$this->tables['testproject_codetracker']} " . - " ON codetracker_id = CTD.id " . - " GROUP BY CTD.id "; - $lc = $this->db->fetchRowsIntoMap($sql,'id'); - } - - - foreach($rs as &$item) - { - $item['verbose'] = $item['name'] . " ( {$this->types[$item['type']]} )" ; - $item['type_descr'] = $this->types[$item['type']]; - $item['env_check_ok'] = true; - $item['env_check_msg'] = ''; - $item['connection_status'] = ''; - - if( $my['options']['checkEnv'] ) - { - $impl = $this->getImplementationForType($item['type']); - $dummy = $impl::checkEnv(); - $item['env_check_ok'] = $dummy['status']; - $item['env_check_msg'] = $dummy['msg']; - } - - - if( !is_null($lc) ) - { - if( isset($lc[$item['id']]) ) - { - $item['link_count'] = intval($lc[$item['id']]['lcount']); - } - } - } - } - return $rs; - } - - - /* - * - * - */ - function getLinkedTo($tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($tprojectID)) - { - return; - } - $sql = "/* $debugMsg */ " . - " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name, " . - " TPCT.codetracker_id,CTRK.name AS codetracker_name, CTRK.type" . - " FROM {$this->tables['testproject_codetracker']} TPCT" . - " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPCT.testproject_id " . - " JOIN {$this->tables['codetrackers']} CTRK " . - " ON CTRK.id = TPCT.codetracker_id " . - " WHERE TPCT.testproject_id = " . intval($tprojectID); - - $ret = $this->db->get_recordset($sql); - if( !is_null($ret) ) - { - $ret = $ret[0]; - $ret['verboseType'] = $this->types[$ret['type']]; - $spec = $this->systems[$ret['type']]; - $ret['api'] = $spec['api']; - } - - return $ret; - } - - - /** - * - * - */ - function getInterfaceObject($tprojectID) - { - $codeT = $this->getLinkedTo($tprojectID); - $name = $codeT['codetracker_name']; - $goodForSession = ($codeT['api'] != 'db'); - - if($goodForSession && isset($_SESSION['cts'][$name])) - { - return $_SESSION['cts'][$name]; - } - - try - { - if( !is_null($codeT) ) - { - $ctd = $this->getByID($codeT['codetracker_id']); - $cname = $ctd['implementation']; - - if($goodForSession) - { - $_SESSION['cts'][$name] = new $cname($cname,$ctd['cfg'],$ctd['name']); - } - else - { - $cxx = new $cname($cname,$ctd['cfg'],$ctd['name']); - return $cxx; - } - } - else - { - $_SESSION['cts'][$name] = null; - } - return $_SESSION['cts'][$name]; - } - catch (Exception $e) - { - echo('Probably there is some PHP Config issue regarding extension'); - echo($e->getMessage().'
    '.$e->getTraceAsString().'
    '); - } - } - - /* - * - * - */ - function checkConnection($cts) - { - $xx = $this->getByID($cts); - $class2create = $xx['implementation']; - $cts = new $class2create($xx['type'],$xx['cfg'],$xx['name']); - - $op = $cts->isConnected(); - - // because I've added simple cache on $_SESSION - // IMHO is better to update cache after this check - $_SESSION['cts'][$xx['name']] = $cts; - - return $op; - } - - /** - * - */ - function checkXMLCfg($xmlString) - { - $signature = 'Source:' . __METHOD__; - $op = array('status_ok' => true, 'msg' => ''); - - $xmlCfg = " " . trim($xmlString); - libxml_use_internal_errors(true); - try - { - $cfg = simplexml_load_string($xmlCfg); - if (!$cfg) - { - $op['status_ok'] = false; - $op['msg'] = $signature . " - Failure loading XML STRING\n"; - foreach(libxml_get_errors() as $error) - { - $op['msg'] .= "\t" . $error->message; - } - } - } - catch(Exception $e) - { - $op['status_ok'] = false; - $op['msg'] = $signature . " - Exception loading XML STRING\n" . 'Message: ' .$e->getMessage(); - } - - return $op; - } - -} // end class + array( + 'type' => 'stash', + 'api' => 'rest', + 'enabled' => true, + 'order' => - 1 + ) + ); + + private $entitySpec = array( + 'name' => 'string', + 'cfg' => 'string', + 'type' => 'int' + ); + + /** + * Class constructor + * + * @param + * resource &$db reference to the database handler + */ + public function __construct(&$db) + { + parent::__construct(); + + // populate types property + $this->getTypes(); + $this->db = &$db; + } + + /** + * + * @return array + * + * + */ + private function getSystems($opt = null) + { + $my = array( + 'options' => null + ); + $my['options']['status'] = 'enabled'; // enabled,disabled,all + $my['options'] = array_merge($my['options'], (array) $opt); + + switch ($my['options']['status']) { + case 'enabled': + $tval = true; + break; + + case 'disabled': + $tval = false; + break; + + default: + $tval = null; + break; + } + + $ret = array(); + foreach ($this->systems as $code => $elem) { + if ($tval == null || $elem['enabled'] == $tval) { + $ret[$code] = $elem; + } + } + return $ret; + } + + /** + * + * @return array + * + * + */ + public function getTypes() + { + if (is_null($this->types)) { + foreach ($this->systems as $code => $spec) { + if ($spec['enabled']) { + $this->types[$code] = $spec['type'] . + " (Interface: {$spec['api']})"; + } + } + } + return $this->types; + } + + /** + * + * @return + * + * + */ + public function getImplementationForType($codeTrackerType) + { + $spec = $this->systems[$codeTrackerType]; + return $spec['type'] . $spec['api'] . 'Interface'; + } + + /** + * + * @return array + * + * + */ + public function getEntitySpec() + { + return $this->entitySpec; + } + + /** + */ + public function create($it) + { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => 'name already exists' + ); + + // Critic we need to do this before sanitize, because $it is changed + $xlmCfg = trim($it->cfg); + + // allow empty config + if (strlen($xlmCfg) > 0) { + $ret = $this->checkXMLCfg($xlmCfg); + if (! $ret['status_ok']) { + return $ret; // >>>---> Bye! + } + } + + $safeobj = $this->sanitize($it); + // empty name is not allowed + if (is_null($safeobj->name)) { + $ret['msg'] = 'empty name is not allowed'; + return $ret; // >>>---> Bye! + } + + // need to check if name already exist + if (is_null($this->getByName($it->name, array( + 'output' => 'id' + )))) { + $sql = "/* debugMsg */ INSERT INTO {$this->tables['codetrackers']} " . + " (name,cfg,type) " . " VALUES('" . $safeobj->name . "','" . + $safeobj->cfg . "',{$safeobj->type})"; + + if ($this->db->exec_query($sql)) { + // at least for Postgres DBMS table name is needed. + $itemID = $this->db->insert_id($this->tables['codetrackers']); + $ret = array( + 'status_ok' => 1, + 'id' => $itemID, + 'msg' => 'ok' + ); + } else { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => $this->db->error_msg() + ); + } + } + + return $ret; + } + + /** + */ + public function update($it) + { + $msg = array(); + $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; + $msg['ok'] = "operation OK for id %s"; + + // Critic we need to do this before sanitize, because $it is changed + $xlmCfg = trim($it->cfg); + + $safeobj = $this->sanitize($it); + $ret = array( + 'status_ok' => 1, + 'id' => $it->id, + 'msg' => '' + ); + + // allow empty config + if (strlen($xlmCfg) > 0) { + $ret = $this->checkXMLCfg($xlmCfg); + } + + // check for duplicate name + if ($ret['status_ok']) { + $info = $this->getByName($safeobj->name); + if (! is_null($info) && ($info['id'] != $it->id)) { + $ret['status_ok'] = 0; + $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, + $info['id']); + } + } + + if ($ret['status_ok']) { + $sql = "UPDATE {$this->tables['codetrackers']} " . " SET name = '" . + $safeobj->name . "'," . " cfg = '" . $safeobj->cfg . "'," . + " type = " . $safeobj->type . " WHERE id = " . + intval($it->id); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $it->id); + } + return $ret; + } + + /** + * delete can be done ONLY if ID is not linked to test project + */ + public function delete($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; + + $msg = array(); + $msg['linked'] = "Failure - id %s is linked to: "; + $msg['tproject_details'] = " testproject '%s' with id %s %s"; + $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; + $msg['ok'] = "operation OK for id %s"; + + $ret = array( + 'status_ok' => 1, + 'id' => $id, + 'msg' => $debugMsg + ); + if (is_null($id) || ($safeID = intval($id)) <= 0) { + $ret['status_ok'] = 0; + $ret['id'] = $id; + $ret['msg'] .= sprintf($msg['syntax_error'], $id); + return $ret; // >>>-----> Bye! + } + + // check if ID is linked + $links = $this->getLinks($safeID); + if (is_null($links)) { + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['codetrackers']} " . + " WHERE id = " . intval($safeID); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $safeID); + } else { + $ret['status_ok'] = 0; + $dummy = sprintf($msg['linked'], $safeID); + $sep = ' / '; + foreach ($links as $item) { + $dummy .= sprintf($msg['tproject_details'], + $item['testproject_name'], $item['testproject_id'], $sep); + } + $ret['msg'] .= rtrim($dummy, $sep); + } + return $ret; + } + + /** + */ + public function getByID($id, $options = null) + { + return $this->getByAttr(array( + 'key' => 'id', + 'value' => $id + ), $options); + } + + /** + */ + private function getByName($name, $options = null) + { + return $this->getByAttr(array( + 'key' => 'name', + 'value' => $name + ), $options); + } + + /** + */ + private function getByAttr($attr, $options = null) + { + $my['options'] = array( + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* debugMsg */ SELECT "; + switch ($my['options']['output']) { + case 'id': + $sql .= " id "; + break; + + case 'full': + default: + $sql .= " * "; + break; + } + + switch ($attr['key']) { + case 'id': + $where = " WHERE id = " . intval($attr['value']); + break; + + case 'name': + default: + $where = " WHERE name = '" . + $this->db->prepare_string($attr['value']) . "'"; + break; + } + + $sql .= " FROM {$this->tables['codetrackers']} " . $where; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $rs = $rs[0]; + $rs['implementation'] = $this->getImplementationForType($rs['type']); + } + return $rs; + } + + /* + * Sanitize and do minor checks + * + * Sanitize Operations + * keys name -> trim will be applied + * type -> intval() wil be applied + * cfg + * + * For strings also db_prepare_string() will be applied + * + * + * Check Operations + * keys name -> if '' => will be set to NULL + * + */ + private function sanitize($obj) + { + $sobj = $obj; + + // remove the standard set of characters considered harmful + // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab + // "\r" - carriage return + // and spaces + // fortunatelly this is trim standard behaviour + $k2san = array( + 'name' + ); + foreach ($k2san as $key) { + $value = trim($obj->$key); + switch ($key) { + case 'name': + $sobj->$key = ($value == '') ? null : $value; + break; + } + + if (! is_null($sobj->$key)) { + $sobj->$key = $this->db->prepare_string($obj->$key); + } + } + + // seems here is better do not touch. + $sobj->cfg = $this->db->prepare_string($obj->cfg); + $sobj->type = intval($obj->type); + + return $sobj; + } + + /* + * + * + */ + public function link($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + + // Check if link exist for test project ID, in order to INSERT or UPDATE + $statusQuo = $this->getLinkedTo($tprojectID); + + if (is_null($statusQuo)) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_codetracker']} " . + " (testproject_id,codetracker_id) " . " VALUES(" . + intval($tprojectID) . "," . intval($id) . ")"; + } else { + $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_codetracker']} " . + " SET codetracker_id = " . intval($id) . + " WHERE testproject_id = " . intval($tprojectID); + } + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function unlink($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_codetracker']} " . + " WHERE testproject_id = " . intval($tprojectID) . + " AND codetracker_id = " . intval($id); + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function getLinks($id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'opt' => array( + 'getDeadLinks' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if (is_null($id)) { + return; + } + + $sql = "/* $debugMsg */ " . + " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name " . + " FROM {$this->tables['testproject_codetracker']} TPCT" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPCT.testproject_id " . + " WHERE TPCT.codetracker_id = " . intval($id); + + if ($my['opt']['getDeadLinks']) { + $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; + } + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + private function getLinkSet() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ " . + " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name, TPCT.codetracker_id " . + " FROM {$this->tables['testproject_codetracker']} TPCT" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPCT.testproject_id "; + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + public function getAll($options = null) + { + $my['options'] = array( + 'output' => null, + 'orderByField' => 'name', + 'checkEnv' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $add_fields = ''; + if ($my['options']['output'] == 'add_link_count') { + $add_fields = ", 0 AS link_count "; + } + + $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . + $my['options']['orderByField']; + + $sql = "/* debugMsg */ SELECT * {$add_fields} "; + $sql .= " FROM {$this->tables['codetrackers']} {$orderByClause} "; + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + + $lc = null; + if (! is_null($rs)) { + + if ($my['options']['output'] == 'add_link_count') { + $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, CTD.id"; + $sql .= " FROM {$this->tables['codetrackers']} CTD " . + " JOIN {$this->tables['testproject_codetracker']} " . + " ON codetracker_id = CTD.id " . " GROUP BY CTD.id "; + $lc = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + foreach ($rs as &$item) { + $item['verbose'] = $item['name'] . + " ( {$this->types[$item['type']]} )"; + $item['type_descr'] = $this->types[$item['type']]; + $item['env_check_ok'] = true; + $item['env_check_msg'] = ''; + $item['connection_status'] = ''; + + if ($my['options']['checkEnv']) { + $impl = $this->getImplementationForType($item['type']); + $dummy = $impl::checkEnv(); + $item['env_check_ok'] = $dummy['status']; + $item['env_check_msg'] = $dummy['msg']; + } + + if (! is_null($lc) && isset($lc[$item['id']])) { + $item['link_count'] = intval($lc[$item['id']]['lcount']); + } + } + } + return $rs; + } + + /* + * + * + */ + public function getLinkedTo($tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($tprojectID)) { + return; + } + $sql = "/* $debugMsg */ " . + " SELECT TPCT.testproject_id, NHTPR.name AS testproject_name, " . + " TPCT.codetracker_id,CTRK.name AS codetracker_name, CTRK.type" . + " FROM {$this->tables['testproject_codetracker']} TPCT" . + " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPCT.testproject_id " . + " JOIN {$this->tables['codetrackers']} CTRK " . + " ON CTRK.id = TPCT.codetracker_id " . + " WHERE TPCT.testproject_id = " . intval($tprojectID); + + $ret = $this->db->get_recordset($sql); + if (! is_null($ret)) { + $ret = $ret[0]; + $ret['verboseType'] = $this->types[$ret['type']]; + $spec = $this->systems[$ret['type']]; + $ret['api'] = $spec['api']; + } + + return $ret; + } + + /** + */ + public function getInterfaceObject($tprojectID) + { + $codeT = $this->getLinkedTo($tprojectID); + $name = $codeT['codetracker_name']; + $goodForSession = ($codeT['api'] != 'db'); + + if ($goodForSession && isset($_SESSION['cts'][$name])) { + return $_SESSION['cts'][$name]; + } + + try { + if (! is_null($codeT)) { + $ctd = $this->getByID($codeT['codetracker_id']); + $cname = $ctd['implementation']; + + if ($goodForSession) { + $_SESSION['cts'][$name] = new $cname($cname, $ctd['cfg'], + $ctd['name']); + } else { + return new $cname($cname, $ctd['cfg'], $ctd['name']); + } + } else { + $_SESSION['cts'][$name] = null; + } + return $_SESSION['cts'][$name]; + } catch (Exception $e) { + echo 'Probably there is some PHP Config issue regarding extension'; + echo $e->getMessage() . '
    ' . $e->getTraceAsString() . '
    '; + } + } + + /* + * + * + */ + public function checkConnection($cts) + { + $xx = $this->getByID($cts); + $class2create = $xx['implementation']; + $cts = new $class2create($xx['type'], $xx['cfg'], $xx['name']); + + $op = $cts->isConnected(); + + // because I've added simple cache on $_SESSION + // IMHO is better to update cache after this check + $_SESSION['cts'][$xx['name']] = $cts; + + return $op; + } + + /** + */ + private function checkXMLCfg($xmlString) + { + $signature = 'Source:' . __METHOD__; + $op = array( + 'status_ok' => true, + 'msg' => '' + ); + + $xmlCfg = " " . trim($xmlString); + libxml_use_internal_errors(true); + try { + $cfg = simplexml_load_string($xmlCfg); + if (! $cfg) { + $op['status_ok'] = false; + $op['msg'] = $signature . " - Failure loading XML STRING\n"; + foreach (libxml_get_errors() as $error) { + $op['msg'] .= "\t" . $error->message; + } + } + } catch (Exception $e) { + $op['status_ok'] = false; + $op['msg'] = $signature . " - Exception loading XML STRING\n" . + 'Message: ' . $e->getMessage(); + } + + return $op; + } +} diff --git a/lib/functions/tlFilterControl.class.php b/lib/functions/tlFilterControl.class.php index 8d5e299d75..33f857ee6d 100644 --- a/lib/functions/tlFilterControl.class.php +++ b/lib/functions/tlFilterControl.class.php @@ -33,473 +33,502 @@ * @package TestLink * @uses testproject */ -abstract class tlFilterControl extends tlObjectWithDB +abstract class tlFilterControl extends tlObjectWithDB { - /** - * Label (and name) for the button to enable simple filter mode. - * @var string - */ - const SIMPLE_FILTER_BUTTON_LABEL = "btn_simple_filters"; - - /** - * Label (and name) for the button to enable advanced filter mode. - * @var string - */ - const ADVANCED_FILTER_BUTTON_LABEL = "btn_advanced_filters"; - - /** - * how many filter items will be displayed in a multiselect box in advanced filter mode? - * @var int - */ - const ADVANCED_FILTER_ITEM_QUANTITY = 4; - - /** - * how many filter items will be displayed in a select box in simple filter mode? - * @var int - */ - const SIMPLE_FILTER_ITEM_QUANTITY = 1; - - /** - * Length of custom field inputs in filter form. - * @var int - */ - const CF_INPUT_SIZE = 32; - - /** - * Value of [ANY]-selection in advanced filter mode. - * @var int - */ - const ANY = 0; - - /** - * defines, wether the button to unassign all test cases from test plan shall be drawn on template - * @var bool - */ - public $draw_tc_unassign_button = false; - - /** - * defines, wether the button to update all linked test cases to their newest version - * shall be drawn on template - * @var bool - */ - public $draw_bulk_update_button = false; - - /** - * defines, wether the button to export test plan tree shall be drawn on template - * @var bool - */ - public $draw_export_testplan_button = false; // BUGID 3270 - Export Test Plan in XML Format - - - /** - * @var bool - */ - public $draw_import_xml_results_button = false; - - - public $draw_tc_assignment_bulk_copy_button = false; - - /** - * will hold the localized string options (any/none/somebody/...) - * @var array - */ - public $option_strings = array(); - - /** - * holds the configuration that will be read from config file - * @var stdClass - */ - public $configuration = null; - - /** - * holds the user input read from request - * @var stdClass - */ - public $args = null; - - /** - * Will hold the configuration of filters (which ones are to be shown) and their values, - * that can be selected on GUI, if active. - * @var array - */ - public $filters = array(); - - /** - * This array holds only the user selected values of active filters. It will be passed - * to the underlying tree filter functions to set the values which are to be filtered. - * @var array - */ - protected $active_filters = array(); - - /** - * will hold the configuration about settings (which ones are to be shown) and their values - * @var array - */ - public $settings = array(); - - /** - * is advanced filter mode active? - * @var bool - */ - public $advanced_filter_mode = false; - - /** - * if true, settings panel will be displayed, if false it will not be visible - * @var bool - */ - public $display_settings = false; - - /** - * if true, filter panel will be displayed, if false it will not be visible - * @var bool - */ - public $display_filters = false; - - /** - * If set to true, settings panel for requirements will be displayed. - * @var bool - */ - public $display_req_settings = false; - - /** - * If set to true, filter panel for requirements will be displayed. - * @var bool - */ - public $display_req_filters = false; - - /** - * Is it allowed to choose advanced filter mode? - * @var bool - */ - public $filter_mode_choice_enabled = true; - - /** - * Holds the label for the button used to switch between filter modes (simple and advanced). - * @var string - */ - public $filter_mode_button_label = ''; - - /** - * Holds the filter item quantity (size of user inputs) for some of the menus. - * @var int - */ - public $filter_item_quantity = 0; - - /** - * This variable marks wether filtering on the tree has to be done in PHP or if lazy loading - * can be done in Javascript. It is TRUE, when user has sent data with filter/settings forms, - * and filtering on tree has to be done. Otherwise (e.g. on first opening of forms) it is FALSE. - * Value is always FALSE by default and after filter reset. - * When one of the init_filter_* methods gets a selected value it then sets it to TRUE. - * @var bool - */ - public $do_filtering = false; - - - // used by derived classes - public $cfieldsCfg = null; - - /** - * Testproject manager object. - * Initialized not in constructor, only on first use to save resources. - * @var testproject - */ - public $testproject_mgr = null; - - // used by derived classes - protected $cfield_mgr = null; - - /** - * - * @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->init_advanced_filter_mode(); - - // init button labels - if ($this->advanced_filter_mode) + + /** + * Label (and name) for the button to enable simple filter mode. + * + * @var string + */ + const SIMPLE_FILTER_BUTTON_LABEL = "btn_simple_filters"; + + /** + * Label (and name) for the button to enable advanced filter mode. + * + * @var string + */ + const ADVANCED_FILTER_BUTTON_LABEL = "btn_advanced_filters"; + + /** + * how many filter items will be displayed in a multiselect box in advanced filter mode? + * + * @var int + */ + const ADVANCED_FILTER_ITEM_QUANTITY = 4; + + /** + * how many filter items will be displayed in a select box in simple filter mode? + * + * @var int + */ + const SIMPLE_FILTER_ITEM_QUANTITY = 1; + + /** + * Length of custom field inputs in filter form. + * + * @var int + */ + const CF_INPUT_SIZE = 32; + + /** + * Value of [ANY]-selection in advanced filter mode. + * + * @var int + */ + const ANY = 0; + + /** + * defines, wether the button to unassign all test cases from test plan shall be drawn on template + * + * @var bool + */ + public $draw_tc_unassign_button = false; + + /** + * defines, wether the button to update all linked test cases to their newest version + * shall be drawn on template + * + * @var bool + */ + public $draw_bulk_update_button = false; + + /** + * defines, wether the button to export test plan tree shall be drawn on template + * + * @var bool + */ + public $draw_export_testplan_button = false; + + // BUGID 3270 - Export Test Plan in XML Format + + /** + * + * @var bool + */ + public $draw_import_xml_results_button = false; + + public $draw_tc_assignment_bulk_copy_button = false; + + /** + * will hold the localized string options (any/none/somebody/...) + * + * @var array + */ + public $option_strings = array(); + + /** + * holds the configuration that will be read from config file + * + * @var stdClass + */ + public $configuration = null; + + /** + * holds the user input read from request + * + * @var stdClass + */ + public $args = null; + + /** + * Will hold the configuration of filters (which ones are to be shown) and their values, + * that can be selected on GUI, if active. + * + * @var array + */ + public $filters = array(); + + /** + * This array holds only the user selected values of active filters. + * It will be passed + * to the underlying tree filter functions to set the values which are to be filtered. + * + * @var array + */ + protected $active_filters = array(); + + /** + * will hold the configuration about settings (which ones are to be shown) and their values + * + * @var array + */ + public $settings = array(); + + /** + * is advanced filter mode active? + * + * @var bool + */ + public $advanced_filter_mode = false; + + /** + * if true, settings panel will be displayed, if false it will not be visible + * + * @var bool + */ + public $display_settings = false; + + /** + * if true, filter panel will be displayed, if false it will not be visible + * + * @var bool + */ + public $display_filters = false; + + /** + * If set to true, settings panel for requirements will be displayed. + * + * @var bool + */ + public $display_req_settings = false; + + /** + * If set to true, filter panel for requirements will be displayed. + * + * @var bool + */ + public $display_req_filters = false; + + /** + * Is it allowed to choose advanced filter mode? + * + * @var bool + */ + public $filter_mode_choice_enabled = true; + + /** + * Holds the label for the button used to switch between filter modes (simple and advanced). + * + * @var string + */ + public $filter_mode_button_label = ''; + + /** + * Holds the filter item quantity (size of user inputs) for some of the menus. + * + * @var int + */ + public $filter_item_quantity = 0; + + /** + * This variable marks wether filtering on the tree has to be done in PHP or if lazy loading + * can be done in Javascript. + * It is TRUE, when user has sent data with filter/settings forms, + * and filtering on tree has to be done. Otherwise (e.g. on first opening of forms) it is FALSE. + * Value is always FALSE by default and after filter reset. + * When one of the init_filter_* methods gets a selected value it then sets it to TRUE. + * + * @var bool + */ + public $do_filtering = false; + + // used by derived classes + public $cfieldsCfg = null; + + /** + * Testproject manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var testproject + */ + public $testproject_mgr = null; + + // used by derived classes + protected $cfield_mgr = null; + + /** + * + * @param database $dbHandler + * reference to database object + */ + public function __construct(&$dbHandler) { - $label = self::SIMPLE_FILTER_BUTTON_LABEL; - $qty = self::ADVANCED_FILTER_ITEM_QUANTITY; - } - else + // 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->init_advanced_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(); + } + + /** + * Destructor: deletes all member object which have to be deleted after use. + */ + public function __destruct() { - $label = self::ADVANCED_FILTER_BUTTON_LABEL; - $qty = self::SIMPLE_FILTER_ITEM_QUANTITY; + // delete member objects + unset($this->testproject_mgr); } - - $this->filter_mode_button_label = lang_get($label); - $this->filter_mode_button_name = $label; - $this->filter_item_quantity = $qty; - - $this->init_settings(); - - } // end of method - - /** - * Destructor: deletes all member object which have to be deleted after use. - * - */ - public function __destruct() { - // delete member objects - unset($this->testproject_mgr); - } // end of method - - /** - * Reads the configuration from the configuration file, which is not dependent on type of objects in tree. - * This function has to be implemented and extended also in extending classes to read specialized config - * for either test cases or requirements. - * Function has protected (in subclasses private) visibility because it will only be called by __construct(). - * @return bool - */ - protected function read_config() { - // opening and closing brackets - $go = config_get('gui_separator_open'); - $gc = config_get('gui_separator_close'); - - // configure string options for select inputs - $this->option_strings['any'] = $go . lang_get('any') . $gc; - $this->option_strings['none'] = $go . lang_get('nobody') . $gc; - $this->option_strings['somebody'] = $go . lang_get('filter_somebody') . $gc; - $this->option_strings['without_keywords'] = $go . - lang_get('without_keywords') . $gc; - - $this->option_strings['without_platforms'] = $go . - lang_get('without_platforms') . $gc; - - return tl::OK; - } // end of method - - /** - * Does what init_args() usually does in scripts: Reads the user input - * from request ($_GET and $_POST). Then it modifies configuration, - * settings and filters according to that user input. - * While the implementation here loads generic input (unrelated to choice of - * test case or requirements for the tree), it will be extended by - * child classes to load input specific for requirements and test cases. - */ - protected function init_args() { - - $this->args = new stdClass(); - $this->args->basehref = $_SESSION['basehref']; - - // get user's data - $this->user = $_SESSION['currentUser']; - $this->args->user_id = $this->user->dbID; - $this->args->user_name = $this->user->getDisplayName(); - - $this->args->testproject_id = intval(isset($_SESSION['testprojectID']) ? - $_SESSION['testprojectID'] : 0); - $this->args->testproject_name = isset($_SESSION['testprojectName']) ? - $_SESSION['testprojectName'] : 0; - - $params = array(); - $params['setting_refresh_tree_on_action'] = array("POST", tlInputParameter::CB_BOOL); - $params['hidden_setting_refresh_tree_on_action'] = - array("POST", tlInputParameter::INT_N); - - I_PARAMS($params, $this->args); - - // was a filter reset requested? - $this->args->reset_filters = false; - if (isset($_REQUEST['btn_reset_filters'])) { - $this->args->reset_filters = true; // mark filter reset in args - $this->do_filtering = false; // mark that no filtering has to be done after reset + + /** + * Reads the configuration from the configuration file, which is not dependent on type of objects in tree. + * This function has to be implemented and extended also in extending classes to read specialized config + * for either test cases or requirements. + * Function has protected (in subclasses private) visibility because it will only be called by __construct(). + * + * @return bool + */ + protected function read_config() + { + // opening and closing brackets + $go = config_get('gui_separator_open'); + $gc = config_get('gui_separator_close'); + + // configure string options for select inputs + $this->option_strings['any'] = $go . lang_get('any') . $gc; + $this->option_strings['none'] = $go . lang_get('nobody') . $gc; + $this->option_strings['somebody'] = $go . lang_get('filter_somebody') . + $gc; + $this->option_strings['without_keywords'] = $go . + lang_get('without_keywords') . $gc; + + $this->option_strings['without_platforms'] = $go . + lang_get('without_platforms') . $gc; + + return tl::OK; } - - // what filter mode has been chosen? - $this->args->simple_filter_mode = - isset($_REQUEST[self::SIMPLE_FILTER_BUTTON_LABEL]) ? true : false; - $this->args->advanced_filter_mode = - isset($_REQUEST[self::ADVANCED_FILTER_BUTTON_LABEL]) ? true : false; - - $this->args->loadExecDashboard = true; - if( isset($_REQUEST['loadExecDashboard']) ) { - $this->args->loadExecDashboard = intval($_REQUEST['loadExecDashboard']); - } - - } // end of method - - - /** - * - */ - protected function init_filter_custom_fields($application_areas=null) - { - $key = 'filter_custom_fields'; - $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; - $localesDateFormat = config_get('locales_date_format'); - $date_format = str_replace('%', '', $localesDateFormat[$locale]); - - $collapsed = isset($_SESSION['cf_filter_collapsed']) ? $_SESSION['cf_filter_collapsed'] : 0; - $collapsed = isset($_REQUEST['btn_toggle_cf']) ? !$collapsed : $collapsed; - $_SESSION['cf_filter_collapsed'] = $collapsed; - $btn_label = $collapsed ? lang_get('btn_show_cf') : lang_get('btn_hide_cf'); - - $cfields = $this->getCustomFields($application_areas); - $cf_prefix = $this->cfield_mgr->name_prefix; - - $cf_html_code = ""; - $selection = array(); - - $this->filters[$key] = false; - $this->active_filters[$key] = null; - - if (!is_null($cfields)) + + /** + * Does what init_args() usually does in scripts: Reads the user input + * from request ($_GET and $_POST). + * Then it modifies configuration, + * settings and filters according to that user input. + * While the implementation here loads generic input (unrelated to choice of + * test case or requirements for the tree), it will be extended by + * child classes to load input specific for requirements and test cases. + */ + protected function init_args() { - $cfInputOpt = array('name_suffix' => '', 'field_size' => self::CF_INPUT_SIZE, - 'show_on_filters' => true, 'remove_required' => true); - - foreach ($cfields as $cf_id => $cf) - { - // has a value been selected? - $id = $cf['id']; - $type = $cf['type']; - $verbose_type = trim($this->cfield_mgr->custom_field_types[$type]); - $cf_input_name = "{$cf_prefix}{$type}_{$id}"; - - // set special size for list inputs - if ($verbose_type == 'list' || $verbose_type == 'multiselection list') - { - $cfInputOpt['field_size'] = 3; + $this->args = new stdClass(); + $this->args->basehref = $_SESSION['basehref']; + + // get user's data + $this->user = $_SESSION['currentUser']; + $this->args->user_id = $this->user->dbID; + $this->args->user_name = $this->user->getDisplayName(); + + $this->args->testproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $this->args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + + $params = array(); + $params['setting_refresh_tree_on_action'] = array( + "POST", + tlInputParameter::CB_BOOL + ); + $params['hidden_setting_refresh_tree_on_action'] = array( + "POST", + tlInputParameter::INT_N + ); + + I_PARAMS($params, $this->args); + + // was a filter reset requested? + $this->args->reset_filters = false; + if (isset($_REQUEST['btn_reset_filters'])) { + $this->args->reset_filters = true; // mark filter reset in args + $this->do_filtering = false; // mark that no filtering has to be done after reset } - - // custom fields on test spec did not retain value after apply - // IMPORTANT/CRITIC issue: trim() on array makes array = null !!! - $value = isset($_REQUEST[$cf_input_name]) ? $_REQUEST[$cf_input_name] : null; - - if ($this->args->reset_filters) - { - $value = null; - } - else - { - if ($verbose_type == 'datetime') - { - // convert the three given values to unixtime format - if (isset($_REQUEST[$cf_input_name . '_input']) && $_REQUEST[$cf_input_name . '_input'] != '' && - isset($_REQUEST[$cf_input_name . '_hour']) && $_REQUEST[$cf_input_name . '_hour'] != '' && - isset($_REQUEST[$cf_input_name . '_minute']) && $_REQUEST[$cf_input_name . '_minute'] != '' && - isset($_REQUEST[$cf_input_name . '_second']) && $_REQUEST[$cf_input_name . '_second'] != '') - { - $date = $_REQUEST[$cf_input_name . '_input']; - $hour = $_REQUEST[$cf_input_name . '_hour']; - $minute = $_REQUEST[$cf_input_name . '_minute']; - $second = $_REQUEST[$cf_input_name . '_second']; - - $date_array = split_localized_date($date, $date_format); - $value = mktime($hour, $minute, $second, $date_array['month'], $date_array['day'], $date_array['year']); - } - } - - if ($verbose_type == 'date') - { - // convert the three given values to unixtime format, only set values if different from 0 - if (isset($_REQUEST[$cf_input_name . '_input']) && $_REQUEST[$cf_input_name . '_input'] != '') - { - $date = $_REQUEST[$cf_input_name . '_input']; - $date_array = split_localized_date($date, $date_format); - $value = mktime(0, 0, 0, $date_array['month'], $date_array['day'], $date_array['year']); - } - } - } - - $value2display = $value; - if (!is_null($value2display) && is_array($value2display)) - { - $value2display = implode("|", $value2display); - } - else - { - $value = trim($value); - $value2display = $value; - } - $cf['value'] = $value2display; - if (!is_null($value) && $value !='') - { - $this->do_filtering = true; - $selection[$id] = $value; + // what filter mode has been chosen? + $this->args->simple_filter_mode = isset( + $_REQUEST[self::SIMPLE_FILTER_BUTTON_LABEL]) ? true : false; + $this->args->advanced_filter_mode = isset( + $_REQUEST[self::ADVANCED_FILTER_BUTTON_LABEL]) ? true : false; + + $this->args->loadExecDashboard = true; + if (isset($_REQUEST['loadExecDashboard'])) { + $this->args->loadExecDashboard = intval( + $_REQUEST['loadExecDashboard']); } + } - $label = str_replace(TL_LOCALIZE_TAG, '', lang_get($cf['label'], null, LANG_GET_NO_WARNING)); - - // don't show textarea inputs here, they are too large for filterpanel - if ($verbose_type != 'text area') - { - $cf_html_code .= '' . htmlspecialchars($label) . '' . - $this->cfield_mgr->string_custom_field_input($cf,$cfInputOpt) . - ''; + /** + */ + protected function init_filter_custom_fields($application_areas = null) + { + $key = 'filter_custom_fields'; + $locale = (isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB'; + $localesDateFormat = config_get('locales_date_format'); + $date_format = str_replace('%', '', $localesDateFormat[$locale]); + + $collapsed = isset($_SESSION['cf_filter_collapsed']) ? $_SESSION['cf_filter_collapsed'] : 0; + $collapsed = isset($_REQUEST['btn_toggle_cf']) ? ! $collapsed : $collapsed; + $_SESSION['cf_filter_collapsed'] = $collapsed; + $btn_label = $collapsed ? lang_get('btn_show_cf') : lang_get( + 'btn_hide_cf'); + + $cfields = $this->getCustomFields($application_areas); + $cf_prefix = $this->cfield_mgr->name_prefix; + + $cf_html_code = ""; + $selection = array(); + + $this->filters[$key] = false; + $this->active_filters[$key] = null; + + if (! is_null($cfields)) { + $cfInputOpt = array( + 'name_suffix' => '', + 'field_size' => self::CF_INPUT_SIZE, + 'show_on_filters' => true, + 'remove_required' => true + ); + + foreach ($cfields as $cf) { + // has a value been selected? + $id = $cf['id']; + $type = $cf['type']; + $verbose_type = trim( + $this->cfield_mgr->custom_field_types[$type]); + $cf_input_name = "{$cf_prefix}{$type}_{$id}"; + + // set special size for list inputs + if ($verbose_type == 'list' || + $verbose_type == 'multiselection list') { + $cfInputOpt['field_size'] = 3; + } + + // custom fields on test spec did not retain value after apply + // IMPORTANT/CRITIC issue: trim() on array makes array = null !!! + $value = isset($_REQUEST[$cf_input_name]) ? $_REQUEST[$cf_input_name] : null; + + if ($this->args->reset_filters) { + $value = null; + } else { + // convert the three given values to unixtime format + if ($verbose_type == 'datetime' && + isset($_REQUEST[$cf_input_name . '_input']) && + $_REQUEST[$cf_input_name . '_input'] != '' && + isset($_REQUEST[$cf_input_name . '_hour']) && + $_REQUEST[$cf_input_name . '_hour'] != '' && + isset($_REQUEST[$cf_input_name . '_minute']) && + $_REQUEST[$cf_input_name . '_minute'] != '' && + isset($_REQUEST[$cf_input_name . '_second']) && + $_REQUEST[$cf_input_name . '_second'] != '') { + $date = $_REQUEST[$cf_input_name . '_input']; + $hour = $_REQUEST[$cf_input_name . '_hour']; + $minute = $_REQUEST[$cf_input_name . '_minute']; + $second = $_REQUEST[$cf_input_name . '_second']; + + $date_array = split_localized_date($date, $date_format); + $value = mktime($hour, $minute, $second, + $date_array['month'], $date_array['day'], + $date_array['year']); + } + + // convert the three given values to unixtime format, only set values if different from 0 + if ($verbose_type == 'date' && + isset($_REQUEST[$cf_input_name . '_input']) && + $_REQUEST[$cf_input_name . '_input'] != '') { + $date = $_REQUEST[$cf_input_name . '_input']; + $date_array = split_localized_date($date, $date_format); + $value = mktime(0, 0, 0, $date_array['month'], + $date_array['day'], $date_array['year']); + } + } + + $value2display = $value; + if (! is_null($value2display) && is_array($value2display)) { + $value2display = implode("|", $value2display); + } else { + $value = trim($value); + $value2display = $value; + } + $cf['value'] = $value2display; + + if (! is_null($value) && $value != '') { + $this->do_filtering = true; + $selection[$id] = $value; + } + + $label = str_replace(TL_LOCALIZE_TAG, '', + lang_get($cf['label'], null, LANG_GET_NO_WARNING)); + + // don't show textarea inputs here, they are too large for filterpanel + if ($verbose_type != 'text area') { + $cf_html_code .= '' . + htmlspecialchars($label) . '' . + $this->cfield_mgr->string_custom_field_input($cf, + $cfInputOpt) . ''; + } + } + + // show/hide CF + $this->filters[$key] = array( + 'items' => $cf_html_code, + 'btn_label' => $btn_label, + 'collapsed' => $collapsed + ); + $this->active_filters[$key] = count($selection) ? $selection : null; } - } + } - // show/hide CF - $this->filters[$key] = array('items' => $cf_html_code,'btn_label' => $btn_label,'collapsed' => $collapsed); - $this->active_filters[$key] = count($selection) ? $selection : null; + /** + */ + protected function init_advanced_filter_mode() + { + $this->advanced_filter_mode = ($this->filter_mode_choice_enabled && + $this->args->advanced_filter_mode && + ! $this->args->simple_filter_mode); } - } // end of method - - - /** - * - */ - protected function init_advanced_filter_mode() - { - $this->advanced_filter_mode = ($this->filter_mode_choice_enabled && - $this->args->advanced_filter_mode && - !$this->args->simple_filter_mode); - - } // end of method - - - - /** - * Initializes the class member array for settings - * according to the data loaded from database and user input. - * Only initializes active settings, for a better performance. - * Abstract: has to be implemented in any child class. - */ - protected abstract function init_settings(); - - /** - * Initializes the class member array for filters - * according to the data loaded from database and user input. - * Only initializes filters which are still enabled and active, for a better performance. - * Abstract: has to be implemented in each child class. - */ - protected abstract function init_filters(); - - /** - * Returns the filter array with necessary data, - * ready to be processed/used by underlying filter functions in - * test spec/exec/requirement tree generator functions. - * Has to be implemented in child class. - */ - protected abstract function get_active_filters(); - - /** - * Build the tree menu for generation of JavaScript tree of either test cases or requirements. - * Depending on user selections in user interface, - * either a completely filtered tree will be build and returned, - * or only the minimal necessary data to "lazy load" the objects in tree by later Ajax calls. - * @param object $gui Reference to GUI object (information will be written to it) - * @return object $tree_menu Tree object for display of JavaScript tree menu. - */ - public abstract function build_tree_menu(&$gui); - - - protected abstract function getCustomFields(); - - -} // end of class \ No newline at end of file + + /** + * Initializes the class member array for settings + * according to the data loaded from database and user input. + * Only initializes active settings, for a better performance. + * Abstract: has to be implemented in any child class. + */ + abstract protected function init_settings(); + + /** + * Initializes the class member array for filters + * according to the data loaded from database and user input. + * Only initializes filters which are still enabled and active, for a better performance. + * Abstract: has to be implemented in each child class. + */ + abstract protected function init_filters(); + + /** + * Returns the filter array with necessary data, + * ready to be processed/used by underlying filter functions in + * test spec/exec/requirement tree generator functions. + * Has to be implemented in child class. + */ + abstract protected function get_active_filters(); + + /** + * Build the tree menu for generation of JavaScript tree of either test cases or requirements. + * Depending on user selections in user interface, + * either a completely filtered tree will be build and returned, + * or only the minimal necessary data to "lazy load" the objects in tree by later Ajax calls. + * + * @param object $gui + * Reference to GUI object (information will be written to it) + * @return object $tree_menu Tree object for display of JavaScript tree menu. + */ + abstract public function build_tree_menu(&$gui); + + abstract protected function getCustomFields(); +} diff --git a/lib/functions/tlHTMLTable.class.php b/lib/functions/tlHTMLTable.class.php index 0371977e41..b0943395a7 100644 --- a/lib/functions/tlHTMLTable.class.php +++ b/lib/functions/tlHTMLTable.class.php @@ -1,96 +1,94 @@ -code_status = $resultsCfg['code_status']; - $this->status_color = $resultsCfg['charts']['status_colour']; - $urgencyCfg = config_get('urgency'); - $this->prio_code_label = $urgencyCfg['code_label']; - } - - /** - * Does nothing. All rendering is contained in renderBodySection() - */ - public function renderCommonGlobals() - { - return ''; - } - - /** - * Does nothing. All rendering is contained in renderBodySection() - */ - public function renderHeadSection() - { - return ''; - } - - /** - * Renders a HTML table with css class "simple" and given id - */ - public function renderBodySection() - { - $s = ''; - // Render columns - $s .= ''; - foreach ($this->columns as $column) { - $title = is_array($column) ? $column['title'] : $column; - $s .= ""; - } - $s .= ''; - foreach ($this->data as $rowData) - { - $s .= ''; - foreach ($rowData as $colIndex => $value) - { - if( isset($this->columns[$colIndex]['type']) ) - { - if ($this->columns[$colIndex]['type'] == 'priority') { - $value = $this->renderPriority($value); - } - if ($this->columns[$colIndex]['type'] == 'status') { - $value = $this->renderStatus($value); - } - } - $s .= ""; - } - $s .= ''; - } - $s .= '
    {$title}
    {$value}
    '; - return $s; - } - - // BUGID 3418 - public function renderStatus($item) - { - return "{$item['text']}"; - } - - public function renderPriority($prio) - { - $label = lang_get($this->prio_code_label[$prio]); - return $label; - } +code_status = $resultsCfg['code_status']; + $this->status_color = $resultsCfg['charts']['status_colour']; + $urgencyCfg = config_get('urgency'); + $this->prio_code_label = $urgencyCfg['code_label']; + } + + /** + * Does nothing. + * All rendering is contained in renderBodySection() + */ + public function renderCommonGlobals() + { + return ''; + } + + /** + * Does nothing. + * All rendering is contained in renderBodySection() + */ + public function renderHeadSection() + { + return ''; + } + + /** + * Renders a HTML table with css class "simple" and given id + */ + public function renderBodySection() + { + $s = ''; + // Render columns + $s .= ''; + foreach ($this->columns as $column) { + $title = is_array($column) ? $column['title'] : $column; + $s .= ""; + } + $s .= ''; + foreach ($this->data as $rowData) { + $s .= ''; + foreach ($rowData as $colIndex => $value) { + if (isset($this->columns[$colIndex]['type'])) { + if ($this->columns[$colIndex]['type'] == 'priority') { + $value = $this->renderPriority($value); + } + if ($this->columns[$colIndex]['type'] == 'status') { + $value = $this->renderStatus($value); + } + } + $s .= ""; + } + $s .= ''; + } + $s .= '
    {$title}
    {$value}
    '; + return $s; + } + + // BUGID 3418 + public function renderStatus($item) + { + return "{$item['text']}"; + } + + public function renderPriority($prio) + { + return lang_get($this->prio_code_label[$prio]); + } } diff --git a/lib/functions/tlInventory.class.php b/lib/functions/tlInventory.class.php index 3903e0efba..cfd7ad90a9 100644 --- a/lib/functions/tlInventory.class.php +++ b/lib/functions/tlInventory.class.php @@ -1,382 +1,406 @@ -testProjectID = intval($testProjectID); - } - - /** - * Class destructor - */ - function __destruct() - { - parent::__destruct(); - $this->testProjectID = null; - } - - - /** - * Initializes the inventory object - * @param array $inputData the name of the server - */ - protected function initInventoryData($inputData) - { - $this->inventoryId = intval($inputData->machineID); - $this->name = $inputData->machineName; - $this->ipAddress = $inputData->machineIp; - $this->ownerId = $inputData->machineOwner; - $this->inventoryContent['notes'] = $inputData->machineNotes; - $this->inventoryContent['purpose'] = $inputData->machinePurpose; - $this->inventoryContent['hardware'] = $inputData->machineHw; - } - - - /** - * Get the current array - * @return array data record - */ - public function getCurrentData() - { - $out = new stdClass(); - $out->machineID = $this->inventoryId; - $out->machineName = $this->name; - $out->machineIp = $this->ipAddress; - $out->machineOwner = $this->ownerId; - $out->machineNotes = $this->inventoryContent['notes']; - $out->machinePurpose = $this->inventoryContent['purpose']; - $out->machineHw = $this->inventoryContent['hardware']; - - return $out; - } - - - /** - * returns inventory data - * - * @param mixed $ids integer or array of integer - ID of inventory items - */ - protected function readDB($ids = null, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('detailLevel' => null, 'accessKey' => null); - $my['options'] = array_merge($my['options'], (array)$options); - - $doUnserialize = true; - switch($my['options']['detailLevel']) { - case 'minimun': - $fields2get = ' id '; - $doUnserialize = false; - break; - - default: - $fields2get = ' * '; - break; - } - $sql = "/* $debugMsg */ - SELECT {$fields2get} +testProjectID = intval($testProjectID); + } + + /** + * Class destructor + */ + public function __destruct() + { + parent::__destruct(); + $this->testProjectID = null; + } + + /** + * Initializes the inventory object + * + * @param array $inputData + * the name of the server + */ + protected function initInventoryData($inputData) + { + $this->inventoryId = intval($inputData->machineID); + $this->name = $inputData->machineName; + $this->ipAddress = $inputData->machineIp; + $this->ownerId = $inputData->machineOwner; + $this->inventoryContent['notes'] = $inputData->machineNotes; + $this->inventoryContent['purpose'] = $inputData->machinePurpose; + $this->inventoryContent['hardware'] = $inputData->machineHw; + } + + /** + * Get the current array + * + * @return array data record + */ + public function getCurrentData() + { + $out = new stdClass(); + $out->machineID = $this->inventoryId; + $out->machineName = $this->name; + $out->machineIp = $this->ipAddress; + $out->machineOwner = $this->ownerId; + $out->machineNotes = $this->inventoryContent['notes']; + $out->machinePurpose = $this->inventoryContent['purpose']; + $out->machineHw = $this->inventoryContent['hardware']; + + return $out; + } + + /** + * returns inventory data + * + * @param mixed $ids + * integer or array of integer - ID of inventory items + */ + protected function readDB($ids = null, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['options'] = array( + 'detailLevel' => null, + 'accessKey' => null + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $doUnserialize = true; + switch ($my['options']['detailLevel']) { + case 'minimun': + $fields2get = ' id '; + $doUnserialize = false; + break; + + default: + $fields2get = ' * '; + break; + } + $sql = "/* $debugMsg */ + SELECT {$fields2get} FROM {$this->tables['inventory']} - WHERE testproject_id={$this->testProjectID}"; - - $clauses = null; - if (!is_null($ids)) { - if (!is_array($ids)) { - $clauses[] = "id = {$ids}"; - } else { - $clauses[] = "id IN (".implode(",",$ids).")"; - } - } - if ($clauses) { - $sql .= " AND " . implode(" AND ",$clauses); - } - - - if( is_null($my['options']['accessKey']) ) { - $recordset = $this->db->get_recordset($sql); - } else { - $recordset = $this->db->fetchRowsIntoMap($sql,$my['options']['accessKey']); - } - - - if(!is_null($recordset) && $doUnserialize) { - // unserialize text parameters - foreach ($recordset as $key => $item) { - $dummy = unserialize($recordset[$key]['content']); - $recordset[$key]['content'] = null; // used for ? who knows? - $recordset[$key]['notes'] = isset($dummy['notes']) ? $dummy['notes'] : ''; - $recordset[$key]['purpose'] = isset($dummy['purpose']) ? $dummy['purpose'] : ''; - $recordset[$key]['hardware'] = isset($dummy['hardware']) ? $dummy['hardware'] : ''; - } - } - return $recordset; - } - - - /** - * Writes a device into the database - * (both create and update request are supported - based on $this->inventoryId) - * - * @param integer $db [ref] the database connection - * @return integer returns tl::OK on success, tl::E_DBERROR else - * - */ - protected function writeToDB(&$db) - { - $auditData = $this->getAuditData(); - $auditData = current($auditData); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $name = $db->prepare_string($this->name); - $ip = $db->prepare_string($this->ipAddress); - $data_serialized = $db->prepare_string(serialize($this->inventoryContent)); - if (is_null($this->inventoryId) || ($this->inventoryId == 0)) - { - $sql = "/* $debugMsg */ - INSERT INTO {$this->tables['inventory']} + WHERE testproject_id={$this->testProjectID}"; + + $clauses = null; + if (! is_null($ids)) { + if (! is_array($ids)) { + $clauses[] = "id = {$ids}"; + } else { + $clauses[] = "id IN (" . implode(",", $ids) . ")"; + } + } + if ($clauses) { + $sql .= " AND " . implode(" AND ", $clauses); + } + + if (is_null($my['options']['accessKey'])) { + $recordset = $this->db->get_recordset($sql); + } else { + $recordset = $this->db->fetchRowsIntoMap($sql, + $my['options']['accessKey']); + } + + if (! is_null($recordset) && $doUnserialize) { + // unserialize text parameters + foreach ($recordset as $key => $item) { + $dummy = unserialize($recordset[$key]['content']); + $recordset[$key]['content'] = null; // used for ? who knows? + $recordset[$key]['notes'] = isset($dummy['notes']) ? $dummy['notes'] : ''; + $recordset[$key]['purpose'] = isset($dummy['purpose']) ? $dummy['purpose'] : ''; + $recordset[$key]['hardware'] = isset($dummy['hardware']) ? $dummy['hardware'] : ''; + } + } + return $recordset; + } + + /** + * Writes a device into the database + * (both create and update request are supported - based on $this->inventoryId) + * + * @param integer $db + * [ref] the database connection + * @return integer returns tl::OK on success, tl::E_DBERROR else + * + */ + protected function writeToDB(&$db) + { + $auditData = $this->getAuditData(); + $auditData = current($auditData); + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $name = $db->prepare_string($this->name); + $ip = $db->prepare_string($this->ipAddress); + $data_serialized = $db->prepare_string( + serialize($this->inventoryContent)); + if (is_null($this->inventoryId) || ($this->inventoryId == 0)) { + $sql = "/* $debugMsg */ + INSERT INTO {$this->tables['inventory']} (name,testproject_id,content,ipaddress, - owner_id,creation_ts) " . - " VALUES ('" . $name . "'," . $this->testProjectID . ",'" . - $data_serialized . "','" . $ip . "'," . - $this->ownerId . "," . $this->db->db_now() . ")"; - - $result = $this->db->exec_query($sql); - if ($result) { - $this->inventoryId = $db->insert_id($this->tables['inventory']); - logAuditEvent(TLS("audit_inventory_created",$this->name,$auditData['tproject_name']), - "CREATE",$this->name,"inventory"); - $this->userFeedback = langGetFormated('inventory_create_success',$this->name); - } else { - $this->userFeedback = langGetFormated('inventory_create_fails',$this->name); - tLog('Internal error: An inventory device "'.$this->name.'" was not created.', 'ERROR'); - } - } else { - $sql = "/* $debugMsg */UPDATE {$this->tables['inventory']} " . - " SET name='{$name}', content='{$data_serialized}', " . - " ipaddress='{$ip}', modification_ts=" . $this->db->db_now() . - ", testproject_id={$this->testProjectID}, owner_id=" . $this->ownerId . - " WHERE id={$this->inventoryId}"; - $result = $this->db->exec_query($sql); - if ($result) { - tLog('A device "'.$this->name.'" was not updated.', 'INFO'); - $this->userFeedback = langGetFormated('inventory_update_success',$this->name); - } else { - $this->setUserFeedback(langGetFormated('inventory_update_fails',$this->name)); - tLog('Internal error: An inventory device "'.$this->name.'" was not updated.', 'ERROR'); - } - } - - return $result ? tl::OK : self::E_DBERROR; - } - - - /** - * DB request to delete a device from the database - * - * @return integer returns tl::OK on success, tl:ERROR else - */ - protected function deleteFromDB() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ - DELETE FROM {$this->tables['inventory']} - WHERE id = " . $this->inventoryId; - $result = $this->db->exec_query($sql); - return $result ? tl::OK : tl::ERROR; - } - - /** - * Deletes item from inventory on db - * - * @param int $itemID - * @return integer returns tl::OK on success, tl:ERROR else - */ - public function deleteInventory($itemID) - { - $auditData = $this->getAuditData(); - $auditData = current($auditData); - $this->inventoryId = intval($itemID); - - // check existence / get name of the record - $recordset = $this->readDB($this->inventoryId); - if(!is_null($recordset)) { - $this->name = $recordset[0]['name']; - $result = $this->deleteFromDB(); - - if ($result == tl::OK) { - logAuditEvent(TLS("audit_inventory_deleted",$this->name,$auditData['tproject_name']), - "DELETE",$this->name,"inventory"); - $this->userFeedback = langGetFormated('inventory_delete_success',$this->name); - } else { - $this->userFeedback = langGetFormated('inventory_delete_fails',$this->name); - tLog('Internal error: The device "'.$this->name.'" was not deleted.', 'ERROR'); - } - } else { - $this->userFeedback = lang_get('inventory_no_device').' ID='.$this->inventoryId; - tLog('Internal error: The device "'.$this->name.'" was not deleted.', 'ERROR'); - } - - return $result; - } - - - /** - * create or update an inventory - * - * @param array $data list of parameters - * @return boolean result of action - **/ - public function setInventory($data) - { - $this->initInventoryData($data); - $result = $this->checkInventoryData(); - if ($result == tl::OK) { - $result = $this->writeToDB($this->db); - } - return $result; - } - - - /** - * Get all inventory data for the project - * - * @param string $options: - * detailLevel - optional - indicates data you want to have - * null -> all columns - * minimun -> just the id, useful when you need to delete all inventories - * for a test project - * accessKey: field name, it's value will be used as accessKey - * - * @return array - */ - public function getAll($options=null) - { - $data = self::readDB(null,$options); - return $data; - } - - - /** - * Checks a server name and IP for a certain testproject already exists in the database - * Checking works for both create and update request - * - * @return integer return tl::OK on success, else error code like - * is tlInventory::E_NAMEALREADYEXISTS - */ - protected function checkInventoryData() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $result = tl::OK; - $name = $this->db->prepare_string(strtoupper($this->name)); - $ipAddress = $this->db->prepare_string(strtoupper($this->ipAddress)); - - if (strlen($name) == 0) { - $result = self::E_NAMELENGTH; - $this->userFeedback = - langGetFormated('inventory_name_empty',$name); - } - - if ($result == tl::OK) { - $sql = "/* $debugMsg */ - SELECT id FROM {$this->tables['inventory']} " . - " WHERE name='" . $name. - "' AND testproject_id={$this->testProjectID}"; - - if ($this->inventoryId > 0) { - $sql .= ' AND NOT id='.$this->inventoryId; - } - - if ($this->db->fetchFirstRow($sql)) { - $result = self::E_NAMEALREADYEXISTS; - $this->userFeedback = langGetFormated('inventory_name_exists',$this->name); - } - } - - if ($result == tl::OK && !empty($ipAddress)) { - $sql = "/* $debugMsg */ - SELECT id FROM {$this->tables['inventory']} " . - " WHERE ipaddress='" . $ipAddress . - "' AND testproject_id={$this->testProjectID}"; - - if ($this->inventoryId > 0) { - $sql .= ' AND NOT id='.$this->inventoryId; - } - if ($this->db->fetchFirstRow($sql)) { - $result = self::E_IPALREADYEXISTS; - $this->userFeedback = langGetFormated('inventory_ip_exists',$ipAddress); - } - } - - return $result; - } - - /** - * - * - */ - protected function getAuditData() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " /* $debugMsg */ " . - " SELECT id, name AS tproject_name FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id = {$this->testProjectID} "; - $info = $this->db->fetchRowsIntoMap($sql,'id'); - return $info; - } -} \ No newline at end of file + owner_id,creation_ts) " . " VALUES ('" . $name . "'," . + $this->testProjectID . ",'" . $data_serialized . "','" . $ip . + "'," . $this->ownerId . "," . $this->db->db_now() . ")"; + + $result = $this->db->exec_query($sql); + if ($result) { + $this->inventoryId = $db->insert_id($this->tables['inventory']); + logAuditEvent( + TLS("audit_inventory_created", $this->name, + $auditData['tproject_name']), "CREATE", $this->name, + "inventory"); + $this->userFeedback = langGetFormated( + 'inventory_create_success', $this->name); + } else { + $this->userFeedback = langGetFormated('inventory_create_fails', + $this->name); + tLog( + 'Internal error: An inventory device "' . $this->name . + '" was not created.', 'ERROR'); + } + } else { + $sql = "/* $debugMsg */UPDATE {$this->tables['inventory']} " . + " SET name='{$name}', content='{$data_serialized}', " . + " ipaddress='{$ip}', modification_ts=" . $this->db->db_now() . + ", testproject_id={$this->testProjectID}, owner_id=" . + $this->ownerId . " WHERE id={$this->inventoryId}"; + $result = $this->db->exec_query($sql); + if ($result) { + tLog('A device "' . $this->name . '" was not updated.', 'INFO'); + $this->userFeedback = langGetFormated( + 'inventory_update_success', $this->name); + } else { + $this->setUserFeedback( + langGetFormated('inventory_update_fails', $this->name)); + tLog( + 'Internal error: An inventory device "' . $this->name . + '" was not updated.', 'ERROR'); + } + } + + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * DB request to delete a device from the database + * + * @return integer returns tl::OK on success, tl:ERROR else + */ + protected function deleteFromDB() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ + DELETE FROM {$this->tables['inventory']} + WHERE id = " . $this->inventoryId; + $result = $this->db->exec_query($sql); + return $result ? tl::OK : tl::ERROR; + } + + /** + * Deletes item from inventory on db + * + * @param int $itemID + * @return integer returns tl::OK on success, tl:ERROR else + */ + public function deleteInventory($itemID) + { + $auditData = $this->getAuditData(); + $auditData = current($auditData); + $this->inventoryId = intval($itemID); + + // check existence / get name of the record + $recordset = $this->readDB($this->inventoryId); + if (! is_null($recordset)) { + $this->name = $recordset[0]['name']; + $result = $this->deleteFromDB(); + + if ($result == tl::OK) { + logAuditEvent( + TLS("audit_inventory_deleted", $this->name, + $auditData['tproject_name']), "DELETE", $this->name, + "inventory"); + $this->userFeedback = langGetFormated( + 'inventory_delete_success', $this->name); + } else { + $this->userFeedback = langGetFormated('inventory_delete_fails', + $this->name); + tLog( + 'Internal error: The device "' . $this->name . + '" was not deleted.', 'ERROR'); + } + } else { + $this->userFeedback = lang_get('inventory_no_device') . ' ID=' . + $this->inventoryId; + tLog( + 'Internal error: The device "' . $this->name . + '" was not deleted.', 'ERROR'); + } + + return $result; + } + + /** + * create or update an inventory + * + * @param array $data + * list of parameters + * @return boolean result of action + */ + public function setInventory($data) + { + $this->initInventoryData($data); + $result = $this->checkInventoryData(); + if ($result == tl::OK) { + $result = $this->writeToDB($this->db); + } + return $result; + } + + /** + * Get all inventory data for the project + * + * @param string $options: + * detailLevel - optional - indicates data you want to have + * null -> all columns + * minimun -> just the id, useful when you need to delete all inventories + * for a test project + * accessKey: field name, it's value will be used as accessKey + * + * @return array + */ + public function getAll($options = null) + { + return self::readDB(null, $options); + } + + /** + * Checks a server name and IP for a certain testproject already exists in the database + * Checking works for both create and update request + * + * @return integer return tl::OK on success, else error code like + * is tlInventory::E_NAMEALREADYEXISTS + */ + protected function checkInventoryData() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $result = tl::OK; + $name = $this->db->prepare_string(strtoupper($this->name)); + $ipAddress = $this->db->prepare_string(strtoupper($this->ipAddress)); + + if (strlen($name) == 0) { + $result = self::E_NAMELENGTH; + $this->userFeedback = langGetFormated('inventory_name_empty', $name); + } + + if ($result == tl::OK) { + $sql = "/* $debugMsg */ + SELECT id FROM {$this->tables['inventory']} " . " WHERE name='" . + $name . "' AND testproject_id={$this->testProjectID}"; + + if ($this->inventoryId > 0) { + $sql .= ' AND NOT id=' . $this->inventoryId; + } + + if ($this->db->fetchFirstRow($sql)) { + $result = self::E_NAMEALREADYEXISTS; + $this->userFeedback = langGetFormated('inventory_name_exists', + $this->name); + } + } + + if ($result == tl::OK && ! empty($ipAddress)) { + $sql = "/* $debugMsg */ + SELECT id FROM {$this->tables['inventory']} " . " WHERE ipaddress='" . + $ipAddress . "' AND testproject_id={$this->testProjectID}"; + + if ($this->inventoryId > 0) { + $sql .= ' AND NOT id=' . $this->inventoryId; + } + if ($this->db->fetchFirstRow($sql)) { + $result = self::E_IPALREADYEXISTS; + $this->userFeedback = langGetFormated('inventory_ip_exists', + $ipAddress); + } + } + + return $result; + } + + /** + */ + protected function getAuditData() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = " /* $debugMsg */ " . + " SELECT id, name AS tproject_name FROM {$this->tables['nodes_hierarchy']} " . + " WHERE id = {$this->testProjectID} "; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } +} diff --git a/lib/functions/tlIssueTracker.class.php b/lib/functions/tlIssueTracker.class.php index 6128dd9fa0..3de5c35dbe 100644 --- a/lib/functions/tlIssueTracker.class.php +++ b/lib/functions/tlIssueTracker.class.php @@ -1,763 +1,819 @@ - array('type' => 'bugzilla', - 'api' => 'xmlrpc', 'enabled' => true, - 'order' => 1), - 2 => array('type' => 'bugzilla', 'api' => 'db', - 'enabled' => true, 'order' => 2), - - 3 => array('type' => 'mantis', 'api' =>'soap', - 'enabled' => true, 'order' => 3), - 4 => array('type' => 'mantis', 'api' =>'db', - 'enabled' => true, 'order' => 4), - 24 => array('type' => 'mantis','api' =>'rest', - 'enabled' => true, 'order' => 5), - - 5 => array('type' => 'jira', 'api' =>'soap', - 'enabled' => true, 'order' => 6), - 6 => array('type' => 'jira', 'api' =>'db', - 'enabled' => true, 'order' => 7), - 7 => array('type' => 'jira', 'api' =>'rest', - 'enabled' => true, 'order' => 8), - 8 => array('type' => 'fogbugz','api' =>'rest', - 'enabled' => true, 'order' => 9), - 9 => array('type' => 'fogbugz','api' =>'db', - 'enabled' => true, 'order' => 10), - 10 => array('type' => 'gforge','api' =>'soap', - 'enabled' => false, 'order' => 11), - 11 => array('type' => 'gforge','api' =>'db', - 'enabled' => false, 'order' => 12), - 12 => array('type' => 'eventum','api' =>'db', - 'enabled' => false, 'order' => 13), - 13 => array('type' => 'polarion', 'api' =>'soap', - 'enabled' => false, 'order' => 14), - 14 => array('type' => 'youtrack','api' =>'rest', - 'enabled' => true, 'order' => 15), - 15 => array('type' => 'redmine','api' =>'rest', - 'enabled' => true, 'order' => 16), - 16 => array('type' => 'redmine','api' =>'db', - 'enabled' => false, 'order' => 17), - 17 => array('type' => 'seapine','api' =>'soap', - 'enabled' => false, 'order' => 18), - 18 => array('type' => 'seapine','api' =>'db', - 'enabled' => false, 'order' => 19), - 19 => array('type' => 'trac','api' =>'xmlrpc', - 'enabled' => true, 'order' => 20), - 20 => array('type' => 'trackplus','api' =>'soap', - 'enabled' => false, 'order' => 21), - 21 => array('type' => 'trackplus','api' =>'db', - 'enabled' => false, 'order' => 22), - 22 => array('type' => 'gitlab','api' =>'rest', - 'enabled' => true, 'order' => 23), - 23 => array('type' => 'kaiten','api' =>'rest', - 'enabled' => true, 'order' => 24), - 25 => array('type' => 'github','api' =>'rest', - 'enabled' => false, 'order' => 25), - 26 => array('type' => 'trello','api' =>'rest', - 'enabled' => true, 'order' => 26), - 27 => array('type' => 'tuleap','api' =>'rest', - 'enabled' => true, 'order' => 27) - ); - - var $entitySpec = array('name' => 'string','cfg' => 'string','type' => 'int'); - - /** - * Class constructor - * - * @param resource &$db reference to the database handler - */ - function __construct(&$db) - { - parent::__construct(); - - // populate types property - $this->getTypes(); - $this->db = &$db; - } - - - - /** - * @return hash - * - * - */ - function getSystems($opt=null) - { - $my = array('options' => null); - $my['options']['status'] = 'enabled'; // enabled,disabled,all - $my['options'] = array_merge($my['options'],(array)$opt); - - switch($my['options']['status']) - { - case 'enabled': - $tval = true; - break; - - case 'disabled': - $tval = false; - break; - - default: - $tval = null; - break; - } - - $ret = []; - $orderedSet = []; - foreach($this->systems as $code => $elem) - { - if ($tval== null || $elem['enabled'] == $tval) { - // $orderedSet[$elem['order']] = $code; - $ret[$code] = $elem; - } - } - return $ret; - } - - /** - * @return hash - * - * - */ - function getTypes() - { - if( is_null($this->types) ) { - foreach($this->systems as $code => $spec) { - if ($spec['enabled']) { - $this->types[$code] = $spec['type'] . " (Interface: {$spec['api']})"; - } - } - } - return $this->types; - } - - - /** - * @return - * - * - */ - function getImplementationForType($issueTrackerType) - { - $spec = $this->systems[$issueTrackerType]; - return $spec['type'] . $spec['api'] . 'Interface'; - } - - /** - * @return hash - * - * - */ - function getEntitySpec() - { - return $this->entitySpec; - } - - - /** - * - */ - function create($it) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => 'name already exists'); - - // Critic we need to do this before sanitize, because $it is changed - $xlmCfg = trim($it->cfg); - - // allow empty config - if(strlen($xlmCfg) > 0) - { - $ret = $this->checkXMLCfg($xlmCfg); - if(!$ret['status_ok']) - { - return $ret; // >>>---> Bye! - } - } - - - $safeobj = $this->sanitize($it); - // empty name is not allowed - if( is_null($safeobj->name) ) - { - $ret['msg'] = 'empty name is not allowed'; - return $ret; // >>>---> Bye! - } - - // need to check if name already exist - if( is_null($this->getByName($it->name,array('output' => 'id')) )) - { - $sql = "/* debugMsg */ INSERT INTO {$this->tables['issuetrackers']} " . - " (name,cfg,type) " . - " VALUES('" . $safeobj->name . "','" . $safeobj->cfg . "',{$safeobj->type})"; - - if( $this->db->exec_query($sql) ) - { - // at least for Postgres DBMS table name is needed. - $itemID=$this->db->insert_id($this->tables['issuetrackers']); - $ret = array('status_ok' => 1, 'id' => $itemID, 'msg' => 'ok'); - } - else - { - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => $this->db->error_msg()); - } - } - - return $ret; - } - - - /** - * - */ - function update($it) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - $msg = array(); - $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; - $msg['ok'] = "operation OK for id %s"; - - // Critic we need to do this before sanitize, because $it is changed - $xlmCfg = trim($it->cfg); - - $safeobj = $this->sanitize($it); - $ret = array('status_ok' => 1, 'id' => $it->id, 'msg' => ''); - - // allow empty config - if(strlen($xlmCfg) > 0) - { - $ret = $this->checkXMLCfg($xlmCfg); - } - - // check for duplicate name - if( $ret['status_ok'] ) - { - $info = $this->getByName($safeobj->name); - if( !is_null($info) && ($info['id'] != $it->id) ) - { - $ret['status_ok'] = 0; - $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, $info['id']); - } - } - - if( $ret['status_ok'] ) - { - $sql = "UPDATE {$this->tables['issuetrackers']} " . - " SET name = '" . $safeobj->name. "'," . - " cfg = '" . $safeobj->cfg . "'," . - " type = " . $safeobj->type . - " WHERE id = " . intval($it->id); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$it->id); - - } - return $ret; - - } //function end - - - - /** - * delete can be done ONLY if ID is not linked to test project - */ - function delete($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - - $msg = array(); - $msg['linked'] = "Failure - id %s is linked to: "; - $msg['tproject_details'] = " testproject '%s' with id %s %s"; - $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; - $msg['ok'] = "operation OK for id %s"; - - $ret = array('status_ok' => 1, 'id' => $id, 'msg' => $debugMsg); - if(is_null($id) || ($safeID = intval($id)) <= 0) - { - $ret['status_ok'] = 0; - $ret['id'] = $id; - $ret['msg'] .= sprintf($msg['syntax_error'],$id); - return $ret; // >>>-----> Bye! - } - - - // check if ID is linked - $links = $this->getLinks($safeID); - if( is_null($links) ) - { - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['issuetrackers']} " . - " WHERE id = " . intval($safeID); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$safeID); - - } - else - { - $ret['status_ok'] = 0; - $dummy = sprintf($msg['linked'],$safeID); - $sep = ' / '; - foreach($links as $item) - { - $dummy .= sprintf($msg['tproject_details'],$item['testproject_name'],$item['testproject_id'],$sep); - } - $ret['msg'] .= rtrim($dummy,$sep); - - } - return $ret; - - } //function end - - - - - - /** - * - */ - function getByID($id, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'id', 'value' => $id),$options); - } - - - /** - * - */ - function getByName($name, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'name', 'value' => $name),$options); - } - - - /** - * - */ - function getByAttr($attr, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = "/* debugMsg */ SELECT "; - switch($my['options']['output']) - { - case 'id': - $sql .= " id "; - break; - - case 'full': - default: - $sql .= " * "; - break; - - } - - switch($attr['key']) - { - case 'id': - $where = " WHERE id = " . intval($attr['value']); - break; - - case 'name': - default: - $where = " WHERE name = '" . $this->db->prepare_string($attr['value']) . "'"; - break; - } - - - $sql .= " FROM {$this->tables['issuetrackers']} " . $where; - $rs = $this->db->get_recordset($sql); - if( !is_null($rs) ) - { - $rs = $rs[0]; - $rs['implementation'] = $this->getImplementationForType($rs['type']); - } - return $rs; - } - - - - /* - * Sanitize and do minor checks - * - * Sanitize Operations - * keys name -> trim will be applied - * type -> intval() wil be applied - * cfg - * - * For strings also db_prepare_string() will be applied - * - * - * Check Operations - * keys name -> if '' => will be set to NULL - * - */ - function sanitize($obj) - { - $sobj = $obj; - - // remove the standard set of characters considered harmful - // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab - // "\r" - carriage return - // and spaces - // fortunatelly this is trim standard behaviour - $k2san = array('name'); - foreach($k2san as $key) - { - $value = trim($obj->$key); - switch($key) - { - case 'name': - $sobj->$key = ($value == '') ? null : $value; - break; - } - - if( !is_null($sobj->$key) ) - { - $sobj->$key = $this->db->prepare_string($obj->$key); - } - - } - - // seems here is better do not touch. - $sobj->cfg = $this->db->prepare_string($obj->cfg); - $sobj->type = intval($obj->type); - - return $sobj; - } - - - - /* - * - * - */ - function link($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - - // Check if link exist for test project ID, in order to INSERT or UPDATE - $statusQuo = $this->getLinkedTo($tprojectID); - - if( is_null($statusQuo) ) - { - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_issuetracker']} " . - " (testproject_id,issuetracker_id) " . - " VALUES(" . intval($tprojectID) . "," . intval($id) . ")"; - } - else - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_issuetracker']} " . - " SET issuetracker_id = " . intval($id) . - " WHERE testproject_id = " . intval($tprojectID); - } - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function unlink($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_issuetracker']} " . - " WHERE testproject_id = " . intval($tprojectID) . - " AND issuetracker_id = " . intval($id); - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function getLinks($id, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('opt' => array('getDeadLinks' => false)); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - if(is_null($id)) - { - return; - } - - - $sql = "/* $debugMsg */ " . - " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name " . - " FROM {$this->tables['testproject_issuetracker']} TPIT" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPIT.testproject_id " . - " WHERE TPIT.issuetracker_id = " . intval($id); - - if($my['opt']['getDeadLinks']) - { - $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; - } - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - - - /* - * - * - */ - function getLinkSet() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ " . - " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, TPIT.issuetracker_id " . - " FROM {$this->tables['testproject_issuetracker']} TPIT" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPIT.testproject_id "; - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - /* - * - * - */ - function getAll($options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => null, 'orderByField' => 'name', 'checkEnv' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $add_fields = ''; - if( $my['options']['output'] == 'add_link_count' ) - { - $add_fields = ", 0 AS link_count "; - } - - $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . $my['options']['orderByField']; - - $sql = "/* debugMsg */ SELECT * {$add_fields} "; - $sql .= " FROM {$this->tables['issuetrackers']} {$orderByClause} "; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - - $lc = null; - if( !is_null($rs) ) - { - - if( $my['options']['output'] == 'add_link_count' ) - { - $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, ITD.id"; - $sql .= " FROM {$this->tables['issuetrackers']} ITD " . - " JOIN {$this->tables['testproject_issuetracker']} " . - " ON issuetracker_id = ITD.id " . - " GROUP BY ITD.id "; - $lc = $this->db->fetchRowsIntoMap($sql,'id'); - } - - - foreach($rs as &$item) - { - $item['verbose'] = $item['name'] . " ( {$this->types[$item['type']]} )" ; - $item['type_descr'] = $this->types[$item['type']]; - $item['env_check_ok'] = true; - $item['env_check_msg'] = ''; - $item['connection_status'] = ''; - - if( $my['options']['checkEnv'] ) - { - $impl = $this->getImplementationForType($item['type']); - $dummy = $impl::checkEnv(); - $item['env_check_ok'] = $dummy['status']; - $item['env_check_msg'] = $dummy['msg']; - } - - - if( !is_null($lc) ) - { - if( isset($lc[$item['id']]) ) - { - $item['link_count'] = intval($lc[$item['id']]['lcount']); - } - } - } - } - return $rs; - } - - - /* - * - * - */ - function getLinkedTo($tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($tprojectID)) - { - return; - } - $sql = "/* $debugMsg */ " . - " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, " . - " TPIT.issuetracker_id,ITRK.name AS issuetracker_name, ITRK.type" . - " FROM {$this->tables['testproject_issuetracker']} TPIT" . - " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPIT.testproject_id " . - " JOIN {$this->tables['issuetrackers']} ITRK " . - " ON ITRK.id = TPIT.issuetracker_id " . - " WHERE TPIT.testproject_id = " . intval($tprojectID); - - $ret = $this->db->get_recordset($sql); - if (!is_null($ret)) { - $ret = $ret[0]; - $ret['verboseType'] = $this->types[$ret['type']]; - $spec = $this->systems[$ret['type']]; - $ret['api'] = $spec['api']; - } - - return $ret; - } - - - /** - * - * - */ - function getInterfaceObject($tprojectID) - { - $issueT = $this->getLinkedTo($tprojectID); - $name = $issueT['issuetracker_name']; - $goodForSession = ($issueT['api'] != 'db'); - - if($goodForSession && isset($_SESSION['its'][$name])) - { - return $_SESSION['its'][$name]; - } - - try - { - if( !is_null($issueT) ) - { - $itd = $this->getByID($issueT['issuetracker_id']); - $iname = $itd['implementation']; - - if($goodForSession) - { - $_SESSION['its'][$name] = new $iname($iname,$itd['cfg'],$itd['name']); - } - else - { - $ixx = new $iname($iname,$itd['cfg'],$itd['name']); - return $ixx; - } - } - else - { - $_SESSION['its'][$name] = null; - } - return $_SESSION['its'][$name]; - } - catch (Exception $e) - { - echo('Probably there is some PHP Config issue regarding extension'); - echo($e->getMessage().'
    '.$e->getTraceAsString().'
    '); - } - } - - /* - * - * - */ - function checkConnection($its) { - $xx = $this->getByID($its); - $class2create = $xx['implementation']; - $its = new $class2create($xx['type'],$xx['cfg'],$xx['name']); - - $op = $its->isConnected(); - - // because I've added simple cache on $_SESSION - // IMHO is better to update cache after this check - $_SESSION['its'][$xx['name']] = $its; - - return $op; - } - - /** - * - */ - function checkXMLCfg($xmlString) - { - $signature = 'Source:' . __METHOD__; - $op = array('status_ok' => true, 'msg' => ''); - - $xmlCfg = " " . trim($xmlString); - libxml_use_internal_errors(true); - try - { - $cfg = simplexml_load_string($xmlCfg); - if (!$cfg) - { - $op['status_ok'] = false; - $op['msg'] = $signature . " - Failure loading XML STRING\n"; - foreach(libxml_get_errors() as $error) - { - $op['msg'] .= "\t" . $error->message; - } - } - } - catch(Exception $e) - { - $op['status_ok'] = false; - $op['msg'] = $signature . " - Exception loading XML STRING\n" . 'Message: ' .$e->getMessage(); - } - - return $op; - } - -} // end class + array( + 'type' => 'bugzilla', + 'api' => 'xmlrpc', + 'enabled' => true, + 'order' => 1 + ), + 2 => array( + 'type' => 'bugzilla', + 'api' => 'db', + 'enabled' => true, + 'order' => 2 + ), + + 3 => array( + 'type' => 'mantis', + 'api' => 'soap', + 'enabled' => true, + 'order' => 3 + ), + 4 => array( + 'type' => 'mantis', + 'api' => 'db', + 'enabled' => true, + 'order' => 4 + ), + 24 => array( + 'type' => 'mantis', + 'api' => 'rest', + 'enabled' => true, + 'order' => 5 + ), + + 5 => array( + 'type' => 'jira', + 'api' => 'soap', + 'enabled' => true, + 'order' => 6 + ), + 6 => array( + 'type' => 'jira', + 'api' => 'db', + 'enabled' => true, + 'order' => 7 + ), + 7 => array( + 'type' => 'jira', + 'api' => 'rest', + 'enabled' => true, + 'order' => 8 + ), + 8 => array( + 'type' => 'fogbugz', + 'api' => 'rest', + 'enabled' => true, + 'order' => 9 + ), + 9 => array( + 'type' => 'fogbugz', + 'api' => 'db', + 'enabled' => true, + 'order' => 10 + ), + 10 => array( + 'type' => 'gforge', + 'api' => 'soap', + 'enabled' => false, + 'order' => 11 + ), + 11 => array( + 'type' => 'gforge', + 'api' => 'db', + 'enabled' => false, + 'order' => 12 + ), + 12 => array( + 'type' => 'eventum', + 'api' => 'db', + 'enabled' => false, + 'order' => 13 + ), + 13 => array( + 'type' => 'polarion', + 'api' => 'soap', + 'enabled' => false, + 'order' => 14 + ), + 14 => array( + 'type' => 'youtrack', + 'api' => 'rest', + 'enabled' => true, + 'order' => 15 + ), + 15 => array( + 'type' => 'redmine', + 'api' => 'rest', + 'enabled' => true, + 'order' => 16 + ), + 16 => array( + 'type' => 'redmine', + 'api' => 'db', + 'enabled' => false, + 'order' => 17 + ), + 17 => array( + 'type' => 'seapine', + 'api' => 'soap', + 'enabled' => false, + 'order' => 18 + ), + 18 => array( + 'type' => 'seapine', + 'api' => 'db', + 'enabled' => false, + 'order' => 19 + ), + 19 => array( + 'type' => 'trac', + 'api' => 'xmlrpc', + 'enabled' => true, + 'order' => 20 + ), + 20 => array( + 'type' => 'trackplus', + 'api' => 'soap', + 'enabled' => false, + 'order' => 21 + ), + 21 => array( + 'type' => 'trackplus', + 'api' => 'db', + 'enabled' => false, + 'order' => 22 + ), + 22 => array( + 'type' => 'gitlab', + 'api' => 'rest', + 'enabled' => true, + 'order' => 23 + ), + 23 => array( + 'type' => 'kaiten', + 'api' => 'rest', + 'enabled' => true, + 'order' => 24 + ), + 25 => array( + 'type' => 'github', + 'api' => 'rest', + 'enabled' => false, + 'order' => 25 + ), + 26 => array( + 'type' => 'trello', + 'api' => 'rest', + 'enabled' => true, + 'order' => 26 + ), + 27 => array( + 'type' => 'tuleap', + 'api' => 'rest', + 'enabled' => true, + 'order' => 27 + ) + ); + + private $entitySpec = array( + 'name' => 'string', + 'cfg' => 'string', + 'type' => 'int' + ); + + /** + * Class constructor + * + * @param + * resource &$db reference to the database handler + */ + public function __construct(&$db) + { + parent::__construct(); + + // populate types property + $this->getTypes(); + $this->db = &$db; + } + + /** + * + * @return array + * + * + */ + public function getSystems($opt = null) + { + $my = array( + 'options' => null + ); + $my['options']['status'] = 'enabled'; // enabled,disabled,all + $my['options'] = array_merge($my['options'], (array) $opt); + + switch ($my['options']['status']) { + case 'enabled': + $tval = true; + break; + + case 'disabled': + $tval = false; + break; + + default: + $tval = null; + break; + } + + $ret = []; + foreach ($this->systems as $code => $elem) { + if ($tval == null || $elem['enabled'] == $tval) { + $ret[$code] = $elem; + } + } + return $ret; + } + + /** + * + * @return array + * + * + */ + public function getTypes() + { + if (is_null($this->types)) { + foreach ($this->systems as $code => $spec) { + if ($spec['enabled']) { + $this->types[$code] = $spec['type'] . + " (Interface: {$spec['api']})"; + } + } + } + return $this->types; + } + + /** + * + * @return + * + * + */ + public function getImplementationForType($issueTrackerType) + { + $spec = $this->systems[$issueTrackerType]; + return $spec['type'] . $spec['api'] . 'Interface'; + } + + /** + * + * @return array + * + * + */ + public function getEntitySpec() + { + return $this->entitySpec; + } + + /** + */ + public function create($it) + { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => 'name already exists' + ); + + // Critic we need to do this before sanitize, because $it is changed + $xlmCfg = trim($it->cfg); + + // allow empty config + if (strlen($xlmCfg) > 0) { + $ret = $this->checkXMLCfg($xlmCfg); + if (! $ret['status_ok']) { + return $ret; // >>>---> Bye! + } + } + + $safeobj = $this->sanitize($it); + // empty name is not allowed + if (is_null($safeobj->name)) { + $ret['msg'] = 'empty name is not allowed'; + return $ret; // >>>---> Bye! + } + + // need to check if name already exist + if (is_null($this->getByName($it->name, array( + 'output' => 'id' + )))) { + $sql = "/* debugMsg */ INSERT INTO {$this->tables['issuetrackers']} " . + " (name,cfg,type) " . " VALUES('" . $safeobj->name . "','" . + $safeobj->cfg . "',{$safeobj->type})"; + + if ($this->db->exec_query($sql)) { + // at least for Postgres DBMS table name is needed. + $itemID = $this->db->insert_id($this->tables['issuetrackers']); + $ret = array( + 'status_ok' => 1, + 'id' => $itemID, + 'msg' => 'ok' + ); + } else { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => $this->db->error_msg() + ); + } + } + + return $ret; + } + + /** + */ + public function update($it) + { + $msg = array(); + $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; + $msg['ok'] = "operation OK for id %s"; + + // Critic we need to do this before sanitize, because $it is changed + $xlmCfg = trim($it->cfg); + + $safeobj = $this->sanitize($it); + $ret = array( + 'status_ok' => 1, + 'id' => $it->id, + 'msg' => '' + ); + + // allow empty config + if (strlen($xlmCfg) > 0) { + $ret = $this->checkXMLCfg($xlmCfg); + } + + // check for duplicate name + if ($ret['status_ok']) { + $info = $this->getByName($safeobj->name); + if (! is_null($info) && ($info['id'] != $it->id)) { + $ret['status_ok'] = 0; + $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, + $info['id']); + } + } + + if ($ret['status_ok']) { + $sql = "UPDATE {$this->tables['issuetrackers']} " . " SET name = '" . + $safeobj->name . "'," . " cfg = '" . $safeobj->cfg . "'," . + " type = " . $safeobj->type . " WHERE id = " . + intval($it->id); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $it->id); + } + return $ret; + } + + /** + * delete can be done ONLY if ID is not linked to test project + */ + public function delete($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; + + $msg = array(); + $msg['linked'] = "Failure - id %s is linked to: "; + $msg['tproject_details'] = " testproject '%s' with id %s %s"; + $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; + $msg['ok'] = "operation OK for id %s"; + + $ret = array( + 'status_ok' => 1, + 'id' => $id, + 'msg' => $debugMsg + ); + if (is_null($id) || ($safeID = intval($id)) <= 0) { + $ret['status_ok'] = 0; + $ret['id'] = $id; + $ret['msg'] .= sprintf($msg['syntax_error'], $id); + return $ret; // >>>-----> Bye! + } + + // check if ID is linked + $links = $this->getLinks($safeID); + if (is_null($links)) { + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['issuetrackers']} " . + " WHERE id = " . intval($safeID); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $safeID); + } else { + $ret['status_ok'] = 0; + $dummy = sprintf($msg['linked'], $safeID); + $sep = ' / '; + foreach ($links as $item) { + $dummy .= sprintf($msg['tproject_details'], + $item['testproject_name'], $item['testproject_id'], $sep); + } + $ret['msg'] .= rtrim($dummy, $sep); + } + return $ret; + } + + /** + */ + public function getByID($id, $options = null) + { + return $this->getByAttr(array( + 'key' => 'id', + 'value' => $id + ), $options); + } + + /** + */ + public function getByName($name, $options = null) + { + return $this->getByAttr(array( + 'key' => 'name', + 'value' => $name + ), $options); + } + + /** + */ + private function getByAttr($attr, $options = null) + { + $my['options'] = array( + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* debugMsg */ SELECT "; + switch ($my['options']['output']) { + case 'id': + $sql .= " id "; + break; + + case 'full': + default: + $sql .= " * "; + break; + } + + switch ($attr['key']) { + case 'id': + $where = " WHERE id = " . intval($attr['value']); + break; + + case 'name': + default: + $where = " WHERE name = '" . + $this->db->prepare_string($attr['value']) . "'"; + break; + } + + $sql .= " FROM {$this->tables['issuetrackers']} " . $where; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $rs = $rs[0]; + $rs['implementation'] = $this->getImplementationForType($rs['type']); + } + return $rs; + } + + /* + * Sanitize and do minor checks + * + * Sanitize Operations + * keys name -> trim will be applied + * type -> intval() wil be applied + * cfg + * + * For strings also db_prepare_string() will be applied + * + * + * Check Operations + * keys name -> if '' => will be set to NULL + * + */ + private function sanitize($obj) + { + $sobj = $obj; + + // remove the standard set of characters considered harmful + // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab + // "\r" - carriage return + // and spaces + // fortunatelly this is trim standard behaviour + $k2san = array( + 'name' + ); + foreach ($k2san as $key) { + $value = trim($obj->$key); + switch ($key) { + case 'name': + $sobj->$key = ($value == '') ? null : $value; + break; + } + + if (! is_null($sobj->$key)) { + $sobj->$key = $this->db->prepare_string($obj->$key); + } + } + + // seems here is better do not touch. + $sobj->cfg = $this->db->prepare_string($obj->cfg); + $sobj->type = intval($obj->type); + + return $sobj; + } + + /* + * + * + */ + public function link($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + + // Check if link exist for test project ID, in order to INSERT or UPDATE + $statusQuo = $this->getLinkedTo($tprojectID); + + if (is_null($statusQuo)) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_issuetracker']} " . + " (testproject_id,issuetracker_id) " . " VALUES(" . + intval($tprojectID) . "," . intval($id) . ")"; + } else { + $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_issuetracker']} " . + " SET issuetracker_id = " . intval($id) . + " WHERE testproject_id = " . intval($tprojectID); + } + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function unlink($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_issuetracker']} " . + " WHERE testproject_id = " . intval($tprojectID) . + " AND issuetracker_id = " . intval($id); + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function getLinks($id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'opt' => array( + 'getDeadLinks' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if (is_null($id)) { + return; + } + + $sql = "/* $debugMsg */ " . + " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name " . + " FROM {$this->tables['testproject_issuetracker']} TPIT" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPIT.testproject_id " . + " WHERE TPIT.issuetracker_id = " . intval($id); + + if ($my['opt']['getDeadLinks']) { + $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; + } + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + public function getLinkSet() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ " . + " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, TPIT.issuetracker_id " . + " FROM {$this->tables['testproject_issuetracker']} TPIT" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPIT.testproject_id "; + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + public function getAll($options = null) + { + $my['options'] = array( + 'output' => null, + 'orderByField' => 'name', + 'checkEnv' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $add_fields = ''; + if ($my['options']['output'] == 'add_link_count') { + $add_fields = ", 0 AS link_count "; + } + + $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . + $my['options']['orderByField']; + + $sql = "/* debugMsg */ SELECT * {$add_fields} "; + $sql .= " FROM {$this->tables['issuetrackers']} {$orderByClause} "; + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + + $lc = null; + if (! is_null($rs)) { + + if ($my['options']['output'] == 'add_link_count') { + $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, ITD.id"; + $sql .= " FROM {$this->tables['issuetrackers']} ITD " . + " JOIN {$this->tables['testproject_issuetracker']} " . + " ON issuetracker_id = ITD.id " . " GROUP BY ITD.id "; + $lc = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + foreach ($rs as &$item) { + $item['verbose'] = $item['name'] . + " ( {$this->types[$item['type']]} )"; + $item['type_descr'] = $this->types[$item['type']]; + $item['env_check_ok'] = true; + $item['env_check_msg'] = ''; + $item['connection_status'] = ''; + + if ($my['options']['checkEnv']) { + $impl = $this->getImplementationForType($item['type']); + $dummy = $impl::checkEnv(); + $item['env_check_ok'] = $dummy['status']; + $item['env_check_msg'] = $dummy['msg']; + } + + if (! is_null($lc) && isset($lc[$item['id']])) { + $item['link_count'] = intval($lc[$item['id']]['lcount']); + } + } + } + return $rs; + } + + /* + * + * + */ + public function getLinkedTo($tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($tprojectID)) { + return; + } + $sql = "/* $debugMsg */ " . + " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, " . + " TPIT.issuetracker_id,ITRK.name AS issuetracker_name, ITRK.type" . + " FROM {$this->tables['testproject_issuetracker']} TPIT" . + " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPIT.testproject_id " . + " JOIN {$this->tables['issuetrackers']} ITRK " . + " ON ITRK.id = TPIT.issuetracker_id " . + " WHERE TPIT.testproject_id = " . intval($tprojectID); + + $ret = $this->db->get_recordset($sql); + if (! is_null($ret)) { + $ret = $ret[0]; + $ret['verboseType'] = $this->types[$ret['type']]; + $spec = $this->systems[$ret['type']]; + $ret['api'] = $spec['api']; + } + + return $ret; + } + + /** + */ + public function getInterfaceObject($tprojectID) + { + $issueT = $this->getLinkedTo($tprojectID); + $name = $issueT['issuetracker_name']; + $goodForSession = ($issueT['api'] != 'db'); + + if ($goodForSession && isset($_SESSION['its'][$name])) { + return $_SESSION['its'][$name]; + } + + try { + if (! is_null($issueT)) { + $itd = $this->getByID($issueT['issuetracker_id']); + $iname = $itd['implementation']; + + if ($goodForSession) { + $_SESSION['its'][$name] = new $iname($iname, $itd['cfg'], + $itd['name']); + } else { + return new $iname($iname, $itd['cfg'], $itd['name']); + } + } else { + $_SESSION['its'][$name] = null; + } + return $_SESSION['its'][$name]; + } catch (Exception $e) { + echo 'Probably there is some PHP Config issue regarding extension'; + echo $e->getMessage() . '
    ' . $e->getTraceAsString() . '
    '; + } + } + + /* + * + * + */ + public function checkConnection($its) + { + $xx = $this->getByID($its); + $class2create = $xx['implementation']; + $its = new $class2create($xx['type'], $xx['cfg'], $xx['name']); + + $op = $its->isConnected(); + + // because I've added simple cache on $_SESSION + // IMHO is better to update cache after this check + $_SESSION['its'][$xx['name']] = $its; + + return $op; + } + + /** + */ + private function checkXMLCfg($xmlString) + { + $signature = 'Source:' . __METHOD__; + $op = array( + 'status_ok' => true, + 'msg' => '' + ); + + $xmlCfg = " " . trim($xmlString); + libxml_use_internal_errors(true); + try { + $cfg = simplexml_load_string($xmlCfg); + if (! $cfg) { + $op['status_ok'] = false; + $op['msg'] = $signature . " - Failure loading XML STRING\n"; + foreach (libxml_get_errors() as $error) { + $op['msg'] .= "\t" . $error->message; + } + } + } catch (Exception $e) { + $op['status_ok'] = false; + $op['msg'] = $signature . " - Exception loading XML STRING\n" . + 'Message: ' . $e->getMessage(); + } + + return $op; + } +} diff --git a/lib/functions/tlKeyword.class.php b/lib/functions/tlKeyword.class.php index 105fcdbc3b..d94f4d538e 100644 --- a/lib/functions/tlKeyword.class.php +++ b/lib/functions/tlKeyword.class.php @@ -1,528 +1,588 @@ -name = null; - $this->notes = null; - $this->testprojectID = null; - if (!($options & self::TLOBJ_O_SEARCH_BY_ID)) { - $this->dbID = null; - } - } - - /** - * Class constructor - * - * @param integer $dbID the database identifier of the keywords - */ - function __construct($dbID = null) { - parent::__construct($dbID); - } - - /* - * Class destructor - */ - function __destruct() { - parent::__destruct(); - $this->_clean(); - } - - /* - * error pseudo verbose - */ - static function getError($code) { - switch($code) { - case self::E_NAMENOTALLOWED: - $v = 'E_NAMENOTALLOWED'; - break; - - case self::E_NAMELENGTH: - $v = 'E_NAMENOTALLOWED'; - break; - - case self::E_NAMEALREADYEXISTS: - $v = 'E_NAMEALREADYEXISTS'; - break; - - case self::E_DBERROR: - $v = 'E_DBERROR'; - break; - - case self::E_WRONGFORMAT: - $v = 'E_WRONGFORMAT'; - break; - } - - return $v; - } - - - - - /** - * Initializes the keyword object - * - * @param integer $dbID the database id of the keyword - * @param integer $testprojectID the id of the testproject the keywords belongs to - * @param string $name the name of the keyword - * @param string $notes the notes for the keywords - */ - function initialize($dbID, $testprojectID,$name,$notes) - { - $this->dbID = $dbID; - $this->name = $name; - $this->notes = $notes; - $this->testprojectID = $testprojectID; - } - - //BEGIN interface iDBSerialization - /* Reads a keyword from the database - * - * @param resource $db [ref] the database connection - * @param integer $options any combination of TLOBJ_O_ Flags - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function readFromDB(&$db,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - $this->_clean($options); - - $query = $this->getReadFromDBQuery($this->dbID,$options); - $info = $db->fetchFirstRow($query); - if ($info) - { - $this->readFromDBRow($info); - } - - return $info ? tl::OK : tl::ERROR; - } - - /* Initializes a keyword object, from a single row read by a query obtained by getReadFromDBQuery - * @see lib/functions/iDBBulkReadSerialization#readFromDBRow($row) - * @param $row array map with keys 'id','testproject_id','keyword','notes' - */ - public function readFromDBRow($row) - { - $this->initialize($row['id'],$row['testproject_id'],$row['keyword'],$row['notes']); - } - - /* Returns a query which can be used to read one or multiple keywords from a db - * @param $ids array integer array of db ids (from keywords) - * @param integer $options any combination of TLOBJ_O_ Flags - * @see lib/functions/iDBBulkReadSerialization#getReadFromDBQuery($ids, $options) - */ - public function getReadFromDBQuery($ids,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - $query = " SELECT id,keyword,notes,testproject_id FROM {$this->tables['keywords']} "; - - $clauses = null; - if ($options & self::TLOBJ_O_SEARCH_BY_ID) - { - if (!is_array($ids)) - $clauses[] = "id = {$ids}"; - else - $clauses[] = "id IN (".implode(",",$ids).")"; - } - if ($clauses) - { - $query .= " WHERE " . implode(" AND ",$clauses); - } - - $query .= " ORDER BY keyword ASC "; - - return $query; - } - - /* - * Writes an keyword into the database - * - * @param resource $db [ref] the database connection - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function writeToDB(&$db) { - $result = $this->checkKeyword($db); - if ($result >= tl::OK) { - $name = $db->prepare_string($this->name); - $notes = $db->prepare_string($this->notes); - - if ($this->dbID) { - $query = "UPDATE {$this->tables['keywords']} " . - " SET keyword = '{$name}',notes = '{$notes}',testproject_id = {$this->testprojectID}" . - " WHERE id = {$this->dbID}"; - $result = $db->exec_query($query); - } else { - $query = " INSERT INTO {$this->tables['keywords']} (keyword,testproject_id,notes) " . - " VALUES ('" . $name . "'," . $this->testprojectID . ",'" . $notes . "')"; - - $result = $db->exec_query($query); - if ($result) { - $this->dbID = $db->insert_id($this->tables['keywords']); - } - } - $result = $result ? tl::OK : self::E_DBERROR; - } - return $result; - } - - /** - * Check if keyword name is not duplicated - * - * @param resource &$db [ref] database connection - * - * @return integer returns tl::OK on success, error code else - */ - protected function checkKeyword(&$db) { - $this->name = trim($this->name); - $this->notes = trim($this->notes); - - $op = tlKeyword::doesKeywordExist($db,$this->name,$this->testprojectID, - $this->dbID); - - $result = $op['status']; - $this->dbID = $op['kwID']; - if ($result >= tl::OK) { - $result = tlKeyword::checkKeywordName($this->name); - } - - return $result; - } - - /* - * Deletes a keyword from the database, deletes also the keywords from the testcase_keywords, and object_keywords - * tables - * - * @param resource &$db [ref] database connection - * - * @return integer returns tl::OK on success, tl:ERROR else - */ - public function deleteFromDB(&$db) - { - $sql = "DELETE FROM {$this->tables['testcase_keywords']} WHERE keyword_id = " . $this->dbID; - $result = $db->exec_query($sql); - if ($result) - { - $sql = "DELETE FROM {$this->tables['object_keywords']} WHERE keyword_id = " . $this->dbID; - $result = $db->exec_query($sql); - } - if ($result) - { - $sql = "DELETE FROM {$this->tables['keywords']} WHERE id = " . $this->dbID; - $result = $db->exec_query($sql); - } - return $result ? tl::OK : tl::ERROR; - } - - /** - * create a keyword by a given id - * - * @param resource $db [ref] the database connection - * @param integer $id the databse identifier of the keyword - * @param integer $detailLevel an optional detaillevel, any combination of TLOBJ_O_GET_DETAIL Flags - * - * @return tlKeyword returns the created keyword on success, or null else - */ - static public function getByID(&$db,$id,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return tlDBObject::createObjectFromDB($db,$id,__CLASS__,tlKeyword::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - } - - /** - * create some keywords by given ids - * - * @param resource $db [ref] the database connection - * @param array $ids the database identifiers of the keywords - * @param integer $detailLevel an optional detaillevel, any combination of TLOBJ_O_GET_DETAIL Flags - * - * @return array returns the created keywords (tlKeyword) on success, or null else - */ - static public function getByIDs(&$db,$ids,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return tlDBObject::createObjectsFromDB($db,$ids,__CLASS__,false,$detailLevel); - } - - /** - * currently not implemented - * - * @param resource $db - * @param string $whereClause - * @param string $column - * @param string $orderBy - * @param integer $detailLevel - * @return integer returns tl::E_NOT_IMPLEMENTED - */ - static public function getAll(&$db,$whereClause = null,$column = null,$orderBy = null, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return self::handleNotImplementedMethod(__FUNCTION__); - } - - //END interface iDBSerialization - /* - * returns information about the keyword - * - * @return array the keyword information - */ - public function getInfo() { - return array("id" => $this->dbID,"keyword" => $this->name, - "notes" => $this->notes,"testproject_id" => $this->testprojectID); - } - - /** - * Checks a keyword against syntactic rules - * - * @param string $name the name of the keyword which should be checked - * - * @return integer returns tl::OK if the check was sucesssful, else errorcode - **/ - static public function checkKeywordName($name) - { - $result = tl::OK; - if ($name != "") { - //we shouldnt allow " and , in keywords any longer - $dummy = null; - if (preg_match("/(\"|,)/",$name,$dummy)) - $result = self::E_NAMENOTALLOWED; - } else { - $result = self::E_NAMELENGTH; - } - return $result; - } - - /** - * checks if a keyword for a certain testproject already exists in the database - * - * @param resource $db [ref] the database connection - * @param string $name the name of the keyword - * @param integer $tprojectID the testprojectID - * @param integer $kwID an additional keyword id which is excluded in the search - * @return integer return tl::OK if the keyword is found, else tlKeyword::E_NAMEALREADYEXISTS - */ - static public function doesKeywordExist(&$db,$name,$tprojectID,$kwID = null) { - - $op = array('status' => tl::OK, 'kwID' => $kwID); - - $tables = tlObjectWithDB::getDBTables("keywords"); - - $name = $db->prepare_string(strtoupper($name)); - $query = " SELECT id FROM {$tables['keywords']} - WHERE UPPER(keyword) ='{$name}' - AND testproject_id = " . $tprojectID ; - - if ($kwID) { - $query .= " AND id <> " .$kwID; - } - - if (($rs=$db->fetchFirstRow($query))) { - $op['status'] = self::E_NAMEALREADYEXISTS; - $op['kwID'] = $rs['id']; - } - return $op; - } - - //BEGIN interface iSerializationToXML - - /** - * gets the format descriptor for XML - * - * @return string returns the XML Format description for Keyword/Export - */ - public function getFormatDescriptionForXML() - { - return "Notes"; - } - - /* - * Writes the keyword to XML representation - * - * @param string $xml [ref] the generated XML Code will be appended here - * @param boolean $noHeader set this to true if no XML Header should be generated - */ - public function writeToXML(&$xml,$noHeader = false) - { - $keywords = array($this->getInfo()); - $keywordElemTpl = '" . - ''."\n"; - $keywordInfo = array ("{{NAME}}" => "keyword","||NOTES||" => "notes"); - $xml .= exportDataToXML($keywords,"{{XMLCODE}}",$keywordElemTpl,$keywordInfo,$noHeader); - } - - - /* - */ - public function toXMLString($keywordSet=null,$noHeader = false) - { - $keywords = is_null($keywordSet) ? array($this->getInfo()) : $keywordSet; - $rootElem = "{{XMLCODE}}"; - $elemXMLTemplate = '" . - ''."\n"; - $keywordInfo = array ("{{NAME}}" => "keyword","||NOTES||" => "notes"); - $xml = exportDataToXML($keywords,$rootElem,$elemXMLTemplate,$keywordInfo,$noHeader); - return $xml; - } - - - - /* - * Reads a keyword from a given XML representation - * @param string $xml the XML representation of a keyword - * - * @return returns tl::OK on success, errorcode else - */ - public function readFromXML($xml) - { - $keyword = simplexml_load_string($xml); - return $this->readFromSimpleXML($keyword); - } - - /* - * Reads a keyword from a simpleXML Object - * - * @param object $keyword the SimpleXML Object which hold the keyword information - * - * @return returns tl::OK on success, errorcode else - */ - public function readFromSimpleXML($keyword) - { - $this->name = NULL; - $this->notes = NULL; - - if (!$keyword || $keyword->getName() != 'keyword') - { - return self::E_WRONGFORMAT; - } - - $attributes = $keyword->attributes(); - if (!isset($attributes['name'])) - { - return self::E_WRONGFORMAT; - } - - $this->name = (string)$attributes['name']; - if ($keyword->notes) - { - $this->notes = (string)$keyword->notes[0]; - } - return tl::OK; - } - //END interface iSerializationToXML - - //BEGIN interface iSerializationToCSV - /* - * gets the Format description for the CSV Import/Export Format - * - * @return string the CSV Format - */ - public function getFormatDescriptionForCSV() - { - return "keyword;notes"; - } - - /* Writes a keyword to CSV - * - * @param string $csv the CSV representation of the keyword will be appended here - * @param string $delimiter an optional delimited for the CSV format - */ - public function writeToCSV(&$csv,$delimiter = ';') { - $keyword = array($this->getInfo()); - $sKeys = array( "keyword","notes" ); - $csv .= exportDataToCSV($keyword,$sKeys,$sKeys); - } - - /* reads a keyword from a CSV string - * @param string $csv the csv string for the keyword - * @param string $delimiter an optional delimited for the CSV format - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function readFromCSV($csv,$delimiter = ';') { - $data = explode($delimiter,$csv); - - $this->name = isset($data[0]) ? $data[0] : null; - $this->notes = isset($data[1]) ? $data[1] : null; - - return sizeof($data) ? tl::OK : tl::ERROR; - } - //END interface iSerializationToCSV - - - /** - * - */ - static public function getSimpleSet(&$db,$opt=null) - { - $options = array('tproject_id' => 0, 'cols' => '*', - 'accessKey' => null, 'kwSet' => null); - - $options = array_merge($options,(array)$opt); - $tables = tlObjectWithDB::getDBTables("keywords"); - - $sql = " SELECT {$options['cols']} FROM {$tables['keywords']} "; - $where = ' WHERE 1=1 '; - - if( $options['tproject_id'] > 0 ) { - $where .= " AND testproject_id = " . intval($options['tproject_id']); - } - - if( null != $options['kwSet'] ) { - $kwFilter = (array)$options['kwSet']; - $where .= " AND id IN(" . implode(',',$kwFilter) . ")"; - } - - $sql .= $where; - if( is_null($options['accessKey']) ) - { - $rs = $db->get_recordset($sql); - } - else - { - $rs = $db->fetchRowsIntoMap($sql,$options['accessKey']); - } - - return $rs; - } - -} \ No newline at end of file +name = null; + $this->notes = null; + $this->testprojectID = null; + if (! ($options & self::TLOBJ_O_SEARCH_BY_ID)) { + $this->dbID = null; + } + } + + /** + * Class constructor + * + * @param integer $dbID + * the database identifier of the keywords + */ + public function __construct($dbID = null) + { + parent::__construct($dbID); + } + + /* + * Class destructor + */ + public function __destruct() + { + parent::__destruct(); + $this->_clean(); + } + + /* + * error pseudo verbose + */ + public static function getError($code) + { + switch ($code) { + case self::E_NAMENOTALLOWED: + $v = 'E_NAMENOTALLOWED'; + break; + + case self::E_NAMELENGTH: + $v = 'E_NAMENOTALLOWED'; + break; + + case self::E_NAMEALREADYEXISTS: + $v = 'E_NAMEALREADYEXISTS'; + break; + + case self::E_DBERROR: + $v = 'E_DBERROR'; + break; + + case self::E_WRONGFORMAT: + $v = 'E_WRONGFORMAT'; + break; + } + + return $v; + } + + /** + * Initializes the keyword object + * + * @param integer $dbID + * the database id of the keyword + * @param integer $testprojectID + * the id of the testproject the keywords belongs to + * @param string $name + * the name of the keyword + * @param string $notes + * the notes for the keywords + */ + public function initialize($dbID, $testprojectID, $name, $notes) + { + $this->dbID = $dbID; + $this->name = $name; + $this->notes = $notes; + $this->testprojectID = $testprojectID; + } + + // BEGIN interface iDBSerialization + /* + * Reads a keyword from the database + * + * @param resource $db [ref] the database connection + * @param integer $options any combination of TLOBJ_O_ Flags + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function readFromDB(&$db, $options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->_clean($options); + + $query = $this->getReadFromDBQuery($this->dbID, $options); + $info = $db->fetchFirstRow($query); + if ($info) { + $this->readFromDBRow($info); + } + + return $info ? tl::OK : tl::ERROR; + } + + /* + * Initializes a keyword object, from a single row read by a query obtained by getReadFromDBQuery + * @see lib/functions/iDBBulkReadSerialization#readFromDBRow($row) + * @param $row array map with keys 'id','testproject_id','keyword','notes' + */ + public function readFromDBRow($row) + { + $this->initialize($row['id'], $row['testproject_id'], $row['keyword'], + $row['notes']); + } + + /* + * Returns a query which can be used to read one or multiple keywords from a db + * @param $ids array integer array of db ids (from keywords) + * @param integer $options any combination of TLOBJ_O_ Flags + * @see lib/functions/iDBBulkReadSerialization#getReadFromDBQuery($ids, $options) + */ + public function getReadFromDBQuery($ids, + $options = self::TLOBJ_O_SEARCH_BY_ID) + { + $query = " SELECT id,keyword,notes,testproject_id FROM {$this->tables['keywords']} "; + + $clauses = null; + if ($options & self::TLOBJ_O_SEARCH_BY_ID) { + if (! is_array($ids)) { + $clauses[] = "id = {$ids}"; + } else { + $clauses[] = "id IN (" . implode(",", $ids) . ")"; + } + } + if ($clauses) { + $query .= " WHERE " . implode(" AND ", $clauses); + } + + $query .= " ORDER BY keyword ASC "; + + return $query; + } + + /* + * Writes an keyword into the database + * + * @param resource $db [ref] the database connection + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function writeToDB(&$db) + { + $result = $this->checkKeyword($db); + if ($result >= tl::OK) { + $name = $db->prepare_string($this->name); + $notes = $db->prepare_string($this->notes); + + if ($this->dbID) { + $query = "UPDATE {$this->tables['keywords']} " . + " SET keyword = '{$name}',notes = '{$notes}',testproject_id = {$this->testprojectID}" . + " WHERE id = {$this->dbID}"; + $result = $db->exec_query($query); + } else { + $query = " INSERT INTO {$this->tables['keywords']} (keyword,testproject_id,notes) " . + " VALUES ('" . $name . "'," . $this->testprojectID . ",'" . + $notes . "')"; + + $result = $db->exec_query($query); + if ($result) { + $this->dbID = $db->insert_id($this->tables['keywords']); + } + } + $result = $result ? tl::OK : self::E_DBERROR; + } + return $result; + } + + /** + * Check if keyword name is not duplicated + * + * @param + * resource &$db [ref] database connection + * + * @return integer returns tl::OK on success, error code else + */ + protected function checkKeyword(&$db) + { + $this->name = trim($this->name); + $this->notes = trim($this->notes); + + $op = tlKeyword::doesKeywordExist($db, $this->name, $this->testprojectID, + $this->dbID); + + $result = $op['status']; + $this->dbID = $op['kwID']; + if ($result >= tl::OK) { + $result = tlKeyword::checkKeywordName($this->name); + } + + return $result; + } + + /* + * Deletes a keyword from the database, deletes also the keywords from the testcase_keywords, and object_keywords + * tables + * + * @param resource &$db [ref] database connection + * + * @return integer returns tl::OK on success, tl:ERROR else + */ + public function deleteFromDB(&$db) + { + $sql = "DELETE FROM {$this->tables['testcase_keywords']} WHERE keyword_id = " . + $this->dbID; + $result = $db->exec_query($sql); + if ($result) { + $sql = "DELETE FROM {$this->tables['object_keywords']} WHERE keyword_id = " . + $this->dbID; + $result = $db->exec_query($sql); + } + if ($result) { + $sql = "DELETE FROM {$this->tables['keywords']} WHERE id = " . + $this->dbID; + $result = $db->exec_query($sql); + } + return $result ? tl::OK : tl::ERROR; + } + + /** + * create a keyword by a given id + * + * @param resource $db + * [ref] the database connection + * @param integer $id + * the databse identifier of the keyword + * @param integer $detailLevel + * an optional detaillevel, any combination of TLOBJ_O_GET_DETAIL Flags + * + * @return tlKeyword returns the created keyword on success, or null else + */ + public static function getByID(&$db, $id, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectFromDB($db, $id, __CLASS__, + tlKeyword::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + } + + /** + * create some keywords by given ids + * + * @param resource $db + * [ref] the database connection + * @param array $ids + * the database identifiers of the keywords + * @param integer $detailLevel + * an optional detaillevel, any combination of TLOBJ_O_GET_DETAIL Flags + * + * @return array returns the created keywords (tlKeyword) on success, or null else + */ + public static function getByIDs(&$db, $ids, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectsFromDB($db, $ids, __CLASS__, false, + $detailLevel); + } + + /** + * currently not implemented + * + * @param resource $db + * @param string $whereClause + * @param string $column + * @param string $orderBy + * @param integer $detailLevel + * @return integer returns tl::E_NOT_IMPLEMENTED + */ + public static function getAll(&$db, $whereClause = null, $column = null, + $orderBy = null, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return self::handleNotImplementedMethod(__FUNCTION__); + } + + // END interface iDBSerialization + /* + * returns information about the keyword + * + * @return array the keyword information + */ + public function getInfo() + { + return array( + "id" => $this->dbID, + "keyword" => $this->name, + "notes" => $this->notes, + "testproject_id" => $this->testprojectID + ); + } + + /** + * Checks a keyword against syntactic rules + * + * @param string $name + * the name of the keyword which should be checked + * + * @return integer returns tl::OK if the check was sucesssful, else errorcode + */ + public static function checkKeywordName($name) + { + $result = tl::OK; + if ($name != "") { + // we shouldnt allow " and , in keywords any longer + $dummy = null; + if (preg_match("/(\"|,)/", $name, $dummy)) { + $result = self::E_NAMENOTALLOWED; + } + } else { + $result = self::E_NAMELENGTH; + } + return $result; + } + + /** + * checks if a keyword for a certain testproject already exists in the database + * + * @param resource $db + * [ref] the database connection + * @param string $name + * the name of the keyword + * @param integer $tprojectID + * the testprojectID + * @param integer $kwID + * an additional keyword id which is excluded in the search + * @return integer return tl::OK if the keyword is found, else tlKeyword::E_NAMEALREADYEXISTS + */ + public static function doesKeywordExist(&$db, $name, $tprojectID, + $kwID = null) + { + $op = array( + 'status' => tl::OK, + 'kwID' => $kwID + ); + + $tables = tlObjectWithDB::getDBTables("keywords"); + + $name = $db->prepare_string(strtoupper($name)); + $query = " SELECT id FROM {$tables['keywords']} + WHERE UPPER(keyword) ='{$name}' + AND testproject_id = " . $tprojectID; + + if ($kwID) { + $query .= " AND id <> " . $kwID; + } + + if ($rs = $db->fetchFirstRow($query)) { + $op['status'] = self::E_NAMEALREADYEXISTS; + $op['kwID'] = $rs['id']; + } + return $op; + } + + // BEGIN interface iSerializationToXML + + /** + * gets the format descriptor for XML + * + * @return string returns the XML Format description for Keyword/Export + */ + public function getFormatDescriptionForXML() + { + return "Notes"; + } + + /* + * Writes the keyword to XML representation + * + * @param string $xml [ref] the generated XML Code will be appended here + * @param boolean $noHeader set this to true if no XML Header should be generated + */ + public function writeToXML(&$xml, $noHeader = false) + { + $keywords = array( + $this->getInfo() + ); + $keywordElemTpl = '" . '' . "\n"; + $keywordInfo = array( + "{{NAME}}" => "keyword", + "||NOTES||" => "notes" + ); + $xml .= exportDataToXML($keywords, "{{XMLCODE}}", $keywordElemTpl, + $keywordInfo, $noHeader); + } + + /* + */ + public function toXMLString($keywordSet = null, $noHeader = false) + { + $keywords = is_null($keywordSet) ? array( + $this->getInfo() + ) : $keywordSet; + $rootElem = "{{XMLCODE}}"; + $elemXMLTemplate = '" . '' . "\n"; + $keywordInfo = array( + "{{NAME}}" => "keyword", + "||NOTES||" => "notes" + ); + return exportDataToXML($keywords, $rootElem, $elemXMLTemplate, + $keywordInfo, $noHeader); + } + + /* + * Reads a keyword from a given XML representation + * @param string $xml the XML representation of a keyword + * + * @return returns tl::OK on success, errorcode else + */ + public function readFromXML($xml) + { + $keyword = simplexml_load_string($xml); + return $this->readFromSimpleXML($keyword); + } + + /* + * Reads a keyword from a simpleXML Object + * + * @param object $keyword the SimpleXML Object which hold the keyword information + * + * @return returns tl::OK on success, errorcode else + */ + public function readFromSimpleXML($keyword) + { + $this->name = null; + $this->notes = null; + + if (! $keyword || $keyword->getName() != 'keyword') { + return self::E_WRONGFORMAT; + } + + $attributes = $keyword->attributes(); + if (! isset($attributes['name'])) { + return self::E_WRONGFORMAT; + } + + $this->name = (string) $attributes['name']; + if ($keyword->notes) { + $this->notes = (string) $keyword->notes[0]; + } + return tl::OK; + } + + /* + * gets the Format description for the CSV Import/Export Format + * + * @return string the CSV Format + */ + public function getFormatDescriptionForCSV() + { + return "keyword;notes"; + } + + /* + * Writes a keyword to CSV + * + * @param string $csv the CSV representation of the keyword will be appended here + * @param string $delimiter an optional delimited for the CSV format + */ + public function writeToCSV(&$csv, $delimiter = ';') + { + $keyword = array( + $this->getInfo() + ); + $sKeys = array( + "keyword", + "notes" + ); + $csv .= exportDataToCSV($keyword, $sKeys, $sKeys); + } + + /* + * reads a keyword from a CSV string + * @param string $csv the csv string for the keyword + * @param string $delimiter an optional delimited for the CSV format + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function readFromCSV($csv, $delimiter = ';') + { + $data = explode($delimiter, $csv); + + $this->name = isset($data[0]) ? $data[0] : null; + $this->notes = isset($data[1]) ? $data[1] : null; + + return count($data) ? tl::OK : tl::ERROR; + } + + // END interface iSerializationToCSV + + /** + */ + public static function getSimpleSet(&$db, $opt = null) + { + $options = array( + 'tproject_id' => 0, + 'cols' => '*', + 'accessKey' => null, + 'kwSet' => null + ); + + $options = array_merge($options, (array) $opt); + $tables = tlObjectWithDB::getDBTables("keywords"); + + $sql = " SELECT {$options['cols']} FROM {$tables['keywords']} "; + $where = ' WHERE 1=1 '; + + if ($options['tproject_id'] > 0) { + $where .= " AND testproject_id = " . intval($options['tproject_id']); + } + + if (null != $options['kwSet']) { + $kwFilter = (array) $options['kwSet']; + $where .= " AND id IN(" . implode(',', $kwFilter) . ")"; + } + + $sql .= $where; + if (is_null($options['accessKey'])) { + $rs = $db->get_recordset($sql); + } else { + $rs = $db->fetchRowsIntoMap($sql, $options['accessKey']); + } + + return $rs; + } +} diff --git a/lib/functions/tlPlatform.class.php b/lib/functions/tlPlatform.class.php index 5fab3d99d1..6043ecc574 100644 --- a/lib/functions/tlPlatform.class.php +++ b/lib/functions/tlPlatform.class.php @@ -1,701 +1,734 @@ -tproject_id = $tproject_id; - $this->stdFields = "id, name, notes, testproject_id, - enable_on_design,enable_on_execution,is_open"; - } - - /** - * - * - */ - public function setTestProjectID($tproject_id) { - $this->tproject_id = intval($tproject_id); - } - - - /** - * Creates a new platform. - * @return tl::OK on success otherwise E_DBERROR; - */ - public function create($platform) { - - $op = array('status' => self::E_DBERROR, 'id' => -1); - $safeName = $this->throwIfEmptyName($platform->name); - $alreadyExists = $this->getID($safeName); - - if ($alreadyExists) { - $op = array('status' => self::E_NAMEALREADYEXISTS, 'id' => -1); - } else { - $sql = "INSERT INTO {$this->tables['platforms']} - (name, testproject_id, notes, - enable_on_design,enable_on_execution,is_open) - VALUES (" . - "'" . $this->db->prepare_string($safeName) . "'" . - "," . $this->tproject_id . - ",'" . $this->db->prepare_string($platform->notes) . "'" . - "," . ($platform->enable_on_design ? 1 : 0) . - "," . ($platform->enable_on_execution ? 1 : 0); - - if (property_exists($platform, 'is_open')) { - $sql .= "," . ($platform->is_open ? 1 : 0); - } else { - $sql .= ",1"; - } - $sql .= ")"; - - $result = $this->db->exec_query($sql); - - if( $result ) { - $op['status'] = tl::OK; - $op['id'] = $this->db->insert_id($this->tables['platforms']); - } - } - return $op; - } - - /** - * Gets info by ID - * - * @return array - */ - public function getByID($id,$opt=null) { - $idSet = implode(',',(array)$id); - $options = array('fields' => $this->stdFields, - 'accessKey' => null); - $options = array_merge($options,(array)$opt); - - $sql = " SELECT {$options['fields']} - FROM {$this->tables['platforms']} - WHERE id IN ($idSet) "; - - switch ($options['accessKey']) { - case 'id': - case 'name': - $accessKey = $options['accessKey']; - break; - - default: - if (count((array)$id) == 1) { - return $this->db->fetchFirstRow($sql); - } - $accessKey = 'id'; - break; - } - return $this->db->fetchRowsIntoMap($sql,$accessKey); - } - - - /** - * - */ - public function getByName($name) - { - $val = trim($name); - $sql = " SELECT {$this->stdFields} - FROM {$this->tables['platforms']} - WHERE name = '" . - $this->db->prepare_string($val) . "'" . - " AND testproject_id = " . intval($this->tproject_id); - - $ret = $this->db->fetchFirstRow($sql); - return is_array($ret) ? $ret : null; - } - - - - /** - * Gets all info of a platform - * @return array with keys id, name and notes - * @TODO remove - francisco - */ - public function getPlatform($id) - { - return $this->getByID($id); - } - - /** - * Updates values of a platform in database. - * @param $id the id of the platform to update - * @param $name the new name to be set - * @param $notes new notes to be set - * - * @return tl::OK on success, otherwise E_DBERROR - */ - public function update($id, $name, $notes, $enable_on_design=null, $enable_on_execution=null, $is_open=1) - { - $safeName = $this->throwIfEmptyName($name); - $sql = " UPDATE {$this->tables['platforms']} " . - " SET name = '" . $this->db->prepare_string($name) . "' " . - ", notes = '". $this->db->prepare_string($notes) . "' "; - - /* Optional */ - if (!is_null($enable_on_design)) { - $sql .= ", enable_on_design = " . ( (($enable_on_design > 0) || $enable_on_design) ? 1 : 0 ); - } - if (!is_null($enable_on_execution)) { - $sql .= ", enable_on_execution = " . ( (($enable_on_execution > 0) || $enable_on_execution) ? 1 : 0 ); - } - - $sql .= ", is_open = ". ($is_open > 0 ? 1 : 0); - /* ---------------------------- */ - - $sql .= " WHERE id = {$id}"; - - $result = $this->db->exec_query($sql); - return $result ? tl::OK : self::E_DBERROR; - } - - /** - * Removes a platform from the database. - * @TODO: remove all related data to this platform? - * YES! - * @param $id the platform_id to delete - * - * @return tl::OK on success, otherwise E_DBERROR - */ - public function delete($id) - { - $sql = "DELETE FROM {$this->tables['platforms']} WHERE id = {$id}"; - $result = $this->db->exec_query($sql); - - return $result ? tl::OK : self::E_DBERROR; - } - - /** - * links one or more platforms to a testplan - * - * @return tl::OK if successfull otherwise E_DBERROR - */ - public function linkToTestplan($id, $testplan_id) - { - $result = true; - if ( !is_null($id) ) { - $idSet = (array)$id; - foreach ($idSet as $platform_id) { - $sql = - " INSERT INTO {$this->tables['testplan_platforms']} " . - " (testplan_id, platform_id) " . - " VALUES ($testplan_id, $platform_id)"; - $result = $this->db->exec_query($sql); - if (!$result) { - break; - } - } - } - return $result ? tl::OK : self::E_DBERROR; - } - - /** - * Removes one or more platforms from a testplan - * @TODO: should this also remove testcases and executions? - * - * @return tl::OK if successfull otherwise E_DBERROR - */ - public function unlinkFromTestplan($id,$testplan_id) - { - $result = true; - if( !is_null($id) ) - { - $idSet = (array)$id; - foreach ($idSet as $platform_id) - { - $sql = " DELETE FROM {$this->tables['testplan_platforms']} " . - " WHERE testplan_id = {$testplan_id} " . - " AND platform_id = {$platform_id} "; - - $result = $this->db->exec_query($sql); - if(!$result) - { - break; - } - } - } - return $result ? tl::OK : self::E_DBERROR; - } - - /** - * Gets the id of a platform given by name - * - * @return integer platform_id - */ - public function getID($name) - { - $sql = " SELECT id FROM {$this->tables['platforms']} - WHERE name = '" . $this->db->prepare_string($name) . "'" . - " AND testproject_id = {$this->tproject_id} "; - return $this->db->fetchOneValue($sql); - } - - /** - * get all available platforms on active test project - * - * @options array $options Optional params - * ['include_linked_count'] => adds the number of - * testplans this platform is used in - * - * @return array - * - * @internal revisions - */ - public function getAll($options = null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $default = array('include_linked_count' => false, - 'enable_on_design' => false, - 'enable_on_execution' => true, - 'is_open' => true); - $options = array_merge($default, (array)$options); - - $tproject_filter = " WHERE PLAT.testproject_id = {$this->tproject_id} "; - - $filterEnableOn = ""; - $enaSet = array('enable_on_design','enable_on_execution','is_open'); - foreach ($enaSet as $ena) { - if (null == $options[$ena]) { - continue; - } - if (is_bool($options[$ena]) || is_int($options[$ena])) { - $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); - } - } - - $sql = " SELECT {$this->stdFields} - FROM {$this->tables['platforms']} PLAT +tproject_id = $tproject_id; + $this->stdFields = "id, name, notes, testproject_id, + enable_on_design,enable_on_execution,is_open"; + } + + /** + */ + public function setTestProjectID($tproject_id) + { + $this->tproject_id = intval($tproject_id); + } + + /** + * Creates a new platform. + * + * @return tl::OK on success otherwise E_DBERROR; + */ + public function create($platform) + { + $op = array( + 'status' => self::E_DBERROR, + 'id' => - 1 + ); + $safeName = $this->throwIfEmptyName($platform->name); + $alreadyExists = $this->getID($safeName); + + if ($alreadyExists) { + $op = array( + 'status' => self::E_NAMEALREADYEXISTS, + 'id' => - 1 + ); + } else { + $sql = "INSERT INTO {$this->tables['platforms']} + (name, testproject_id, notes, + enable_on_design,enable_on_execution,is_open) + VALUES (" . "'" . $this->db->prepare_string($safeName) . "'" . "," . + $this->tproject_id . ",'" . + $this->db->prepare_string($platform->notes) . "'" . "," . + ($platform->enable_on_design ? 1 : 0) . "," . + ($platform->enable_on_execution ? 1 : 0); + + if (property_exists($platform, 'is_open')) { + $sql .= "," . ($platform->is_open ? 1 : 0); + } else { + $sql .= ",1"; + } + $sql .= ")"; + + $result = $this->db->exec_query($sql); + + if ($result) { + $op['status'] = tl::OK; + $op['id'] = $this->db->insert_id($this->tables['platforms']); + } + } + return $op; + } + + /** + * Gets info by ID + * + * @return array + */ + public function getByID($id, $opt = null) + { + $idSet = implode(',', (array) $id); + $options = array( + 'fields' => $this->stdFields, + 'accessKey' => null + ); + $options = array_merge($options, (array) $opt); + + $sql = " SELECT {$options['fields']} + FROM {$this->tables['platforms']} + WHERE id IN ($idSet) "; + + switch ($options['accessKey']) { + case 'id': + case 'name': + $accessKey = $options['accessKey']; + break; + + default: + if (count((array) $id) == 1) { + return $this->db->fetchFirstRow($sql); + } + $accessKey = 'id'; + break; + } + return $this->db->fetchRowsIntoMap($sql, $accessKey); + } + + /** + */ + public function getByName($name) + { + $val = trim($name); + $sql = " SELECT {$this->stdFields} + FROM {$this->tables['platforms']} + WHERE name = '" . $this->db->prepare_string($val) . "'" . + " AND testproject_id = " . intval($this->tproject_id); + + $ret = $this->db->fetchFirstRow($sql); + return is_array($ret) ? $ret : null; + } + + /** + * Gets all info of a platform + * + * @return array with keys id, name and notes + * @todo remove - francisco + */ + public function getPlatform($id) + { + return $this->getByID($id); + } + + /** + * Updates values of a platform in database. + * + * @param int $id + * the + * id of the platform to update + * @param string $name + * the + * new name to be set + * @param string $notes + * new + * notes to be set + * + * @return tl::OK on success, otherwise E_DBERROR + */ + public function update($id, $name, $notes, $enable_on_design = null, + $enable_on_execution = null, $is_open = 1) + { + $this->throwIfEmptyName($name); + $sql = " UPDATE {$this->tables['platforms']} " . " SET name = '" . + $this->db->prepare_string($name) . "' " . ", notes = '" . + $this->db->prepare_string($notes) . "' "; + + /* Optional */ + if (! is_null($enable_on_design)) { + $sql .= ", enable_on_design = " . + ((($enable_on_design > 0) || $enable_on_design) ? 1 : 0); + } + if (! is_null($enable_on_execution)) { + $sql .= ", enable_on_execution = " . + ((($enable_on_execution > 0) || $enable_on_execution) ? 1 : 0); + } + + $sql .= ", is_open = " . ($is_open > 0 ? 1 : 0); + /* ---------------------------- */ + + $sql .= " WHERE id = {$id}"; + + $result = $this->db->exec_query($sql); + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * Removes a platform from the database. + * + * @TODO: remove all related data to this platform? + * YES! + * @param int $id + * the + * platform_id to delete + * + * @return tl::OK on success, otherwise E_DBERROR + */ + public function delete($id) + { + $sql = "DELETE FROM {$this->tables['platforms']} WHERE id = {$id}"; + $result = $this->db->exec_query($sql); + + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * links one or more platforms to a testplan + * + * @return tl::OK if successfull otherwise E_DBERROR + */ + public function linkToTestplan($id, $testplan_id) + { + $result = true; + if (! is_null($id)) { + $idSet = (array) $id; + foreach ($idSet as $platform_id) { + $sql = " INSERT INTO {$this->tables['testplan_platforms']} " . + " (testplan_id, platform_id) " . + " VALUES ($testplan_id, $platform_id)"; + $result = $this->db->exec_query($sql); + if (! $result) { + break; + } + } + } + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * Removes one or more platforms from a testplan + * + * @TODO: should this also remove testcases and executions? + * + * @return tl::OK if successfull otherwise E_DBERROR + */ + public function unlinkFromTestplan($id, $testplan_id) + { + $result = true; + if (! is_null($id)) { + $idSet = (array) $id; + foreach ($idSet as $platform_id) { + $sql = " DELETE FROM {$this->tables['testplan_platforms']} " . + " WHERE testplan_id = {$testplan_id} " . + " AND platform_id = {$platform_id} "; + + $result = $this->db->exec_query($sql); + if (! $result) { + break; + } + } + } + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * Gets the id of a platform given by name + * + * @return integer platform_id + */ + public function getID($name) + { + $sql = " SELECT id FROM {$this->tables['platforms']} + WHERE name = '" . $this->db->prepare_string($name) . "'" . + " AND testproject_id = {$this->tproject_id} "; + return $this->db->fetchOneValue($sql); + } + + /** + * get all available platforms on active test project + * + * @options array $options Optional params + * ['include_linked_count'] => adds the number of + * testplans this platform is used in + * + * @return array + * + * @internal revisions + */ + public function getAll($options = null) + { + $default = array( + 'include_linked_count' => false, + 'enable_on_design' => false, + 'enable_on_execution' => true, + 'is_open' => true + ); + $options = array_merge($default, (array) $options); + + $tproject_filter = " WHERE PLAT.testproject_id = {$this->tproject_id} "; + + $filterEnableOn = ""; + $enaSet = array( + 'enable_on_design', + 'enable_on_execution', + 'is_open' + ); + foreach ($enaSet as $ena) { + if (null == $options[$ena]) { + continue; + } + if (is_bool($options[$ena]) || is_int($options[$ena])) { + $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); + } + } + + $sql = " SELECT {$this->stdFields} + FROM {$this->tables['platforms']} PLAT {$tproject_filter} {$filterEnableOn} - ORDER BY name"; - - $rs = $this->db->get_recordset($sql); - if (!is_null($rs) && $options['include_linked_count']) { - // At least on MS SQL Server 2005 you can not do GROUP BY - // fields of type TEXT - // notes is a TEXT field - // $sql = " SELECT PLAT.id,PLAT.name,PLAT.notes, " . - // " COUNT(TPLAT.testplan_id) AS linked_count " . - // " FROM {$this->tables['platforms']} PLAT " . - // " LEFT JOIN {$this->tables['testplan_platforms']} TPLAT " . - // " ON TPLAT.platform_id = PLAT.id " . $tproject_filter . - // " GROUP BY PLAT.id, PLAT.name, PLAT.notes"; - // - $sql = " SELECT PLAT.id, COUNT(TPLAT.testplan_id) AS linked_count + ORDER BY name"; + + $rs = $this->db->get_recordset($sql); + if (! is_null($rs) && $options['include_linked_count']) { + // At least on MS SQL Server 2005 you can not do GROUP BY + // fields of type TEXT + // notes is a TEXT field + // $sql = " SELECT PLAT.id,PLAT.name,PLAT.notes, " . + // " COUNT(TPLAT.testplan_id) AS linked_count " . + // " FROM {$this->tables['platforms']} PLAT " . + // " LEFT JOIN {$this->tables['testplan_platforms']} TPLAT " . + // " ON TPLAT.platform_id = PLAT.id " . $tproject_filter . + // " GROUP BY PLAT.id, PLAT.name, PLAT.notes"; + // + $sql = " SELECT PLAT.id, COUNT(TPLAT.testplan_id) AS linked_count FROM {$this->tables['platforms']} PLAT - LEFT JOIN {$this->tables['testplan_platforms']} TPLAT + LEFT JOIN {$this->tables['testplan_platforms']} TPLAT ON TPLAT.platform_id = PLAT.id {$tproject_filter} - GROUP BY PLAT.id "; - $figures = $this->db->fetchRowsIntoMap($sql,'id'); - - $loop2do = count($rs); - for ($idx=0; $idx < $loop2do; $idx++) { - $rs[$idx]['linked_count'] = - $figures[$rs[$idx]['id']]['linked_count']; - } - } - - return $rs; - } - - /** - * get all available platforms in the active testproject ($this->tproject_id) - * @param string $orderBy - * @return array Returns - * as array($platform_id => $platform_name) - */ - public function getAllAsMap($opt=null) - { - $options = array('accessKey' => 'id', - 'output' => 'columns', - 'orderBy' => ' ORDER BY name ', - 'enable_on_design' => true, - 'enable_on_execution' => true, - 'is_open' => true); - - $options = array_merge($options,(array)$opt); - $accessKey = $options['accessKey']; - $output = $options['output']; - $orderBy = $options['orderBy']; - - $filterEnableOn = ""; - $enaSet = [ - 'enable_on_design', - 'enable_on_execution', - 'is_open' - ]; - - foreach ($enaSet as $ena) { - if (null == $options[$ena]) { - continue; - } - if (is_bool($options[$ena]) || is_int($options[$ena])) { - $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); - } - } - - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ + GROUP BY PLAT.id "; + $figures = $this->db->fetchRowsIntoMap($sql, 'id'); + + $loop2do = count($rs); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $rs[$idx]['linked_count'] = $figures[$rs[$idx]['id']]['linked_count']; + } + } + + return $rs; + } + + /** + * get all available platforms in the active testproject ($this->tproject_id) + * + * @param string $orderBy + * @return array Returns + * as array($platform_id => $platform_name) + */ + public function getAllAsMap($opt = null) + { + $options = array( + 'accessKey' => 'id', + 'output' => 'columns', + 'orderBy' => ' ORDER BY name ', + 'enable_on_design' => true, + 'enable_on_execution' => true, + 'is_open' => true + ); + + $options = array_merge($options, (array) $opt); + $accessKey = $options['accessKey']; + $output = $options['output']; + $orderBy = $options['orderBy']; + + $filterEnableOn = ""; + $enaSet = [ + 'enable_on_design', + 'enable_on_execution', + 'is_open' + ]; + + foreach ($enaSet as $ena) { + if (null == $options[$ena]) { + continue; + } + if (is_bool($options[$ena]) || is_int($options[$ena])) { + $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); + } + } + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT {$this->stdFields} - FROM {$this->tables['platforms']} - WHERE testproject_id = {$this->tproject_id} + FROM {$this->tables['platforms']} + WHERE testproject_id = {$this->tproject_id} {$filterEnableOn} - {$orderBy}"; - if( $output == 'columns' ) { - $rs = $this->db->fetchColumnsIntoMap($sql, $accessKey, 'name'); - } else { - $rs = $this->db->fetchRowsIntoMap($sql, $accessKey); - } - return $rs; - } - - /** - * Logic to determine if platforms should be visible for a given testplan. - * @return bool true if the testplan has one or more linked platforms; - * otherwise false. - */ - public function platformsActiveForTestplan($testplan_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT COUNT(0) AS num " . - " FROM {$this->tables['testplan_platforms']} " . - " WHERE testplan_id = {$testplan_id}"; - $num_tplans = $this->db->fetchOneValue($sql); - return ($num_tplans > 0); - } - - /** - * @param map $options - * @return array Returns all platforms associated to a given testplan - * - * @internal revision - * 20100705 - franciscom - interface - BUGID 3564 - * - */ - public function getLinkedToTestplan($testplanID, $options = null) - { - // output: - // array => indexed array - // mapAccessByID => map access key: id - // mapAccessByName => map access key: name - $my['options'] = array('outputFormat' => 'array', 'orderBy' => ' ORDER BY name '); - $my['options'] = array_merge($my['options'], (array)$options); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $rs = null; - $sql = "/* $debugMsg */ + {$orderBy}"; + if ($output == 'columns') { + $rs = $this->db->fetchColumnsIntoMap($sql, $accessKey, 'name'); + } else { + $rs = $this->db->fetchRowsIntoMap($sql, $accessKey); + } + return $rs; + } + + /** + * Logic to determine if platforms should be visible for a given testplan. + * + * @return bool true if the testplan has one or more linked platforms; + * otherwise false. + */ + public function platformsActiveForTestplan($testplan_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT COUNT(0) AS num " . + " FROM {$this->tables['testplan_platforms']} " . + " WHERE testplan_id = {$testplan_id}"; + $num_tplans = $this->db->fetchOneValue($sql); + return $num_tplans > 0; + } + + /** + * + * @param array $options + * @return array Returns all platforms associated to a given testplan + * + * @internal revision + * 20100705 - franciscom - interface - BUGID 3564 + * + */ + public function getLinkedToTestplan($testplanID, $options = null) + { + // output: + // array => indexed array + // mapAccessByID => map access key: id + // mapAccessByName => map access key: name + $my['options'] = array( + 'outputFormat' => 'array', + 'orderBy' => ' ORDER BY name ' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $rs = null; + $sql = "/* $debugMsg */ SELECT P.id, P.name, P.notes, P.enable_on_design, P.enable_on_execution, P.is_open - FROM {$this->tables['platforms']} P - JOIN {$this->tables['testplan_platforms']} TP - ON P.id = TP.platform_id - WHERE TP.testplan_id = {$testplanID} - {$my['options']['orderBy']}"; - - switch ($my['options']['outputFormat']) { - case 'array': - $rs = $this->db->get_recordset($sql); - break; - - case 'mapAccessByID': - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - break; - - case 'mapAccessByName': - $rs = $this->db->fetchRowsIntoMap($sql,'name'); - break; - } - return $rs; - } - - - /** - * @param string $orderBy - * @return array Returns all platforms associated - * to a given testplan - * output format: $id => $name - */ - public function getLinkedToTestplanAsMap($testplanID,$opt=null) - { - // null -> any - $options = array('orderBy' => ' ORDER BY name ', - 'enable_on_design' => null, - 'enable_on_execution' => true); - - $options = array_merge($options,(array)$opt); - - $orderBy = $options['orderBy']; - - $filterEnableOn = ""; - $enaSet = array('enable_on_design','enable_on_execution'); - foreach ($enaSet as $ena) { - if ($options[$ena] == null) { - // do not filter - continue; - } - - if (is_bool($options[$ena]) || is_int($options[$ena])) { - $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); - } - } - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = "/* $debugMsg */ SELECT P.id, P.name, P.is_open " . - " FROM {$this->tables['platforms']} P " . - " JOIN {$this->tables['testplan_platforms']} TP " . - " ON P.id = TP.platform_id " . - " WHERE TP.testplan_id = {$testplanID} - {$filterEnableOn} {$orderBy}"; - - $pset = (array)$this->db->fetchRowsIntoMap($sql, 'id'); - $itemSet = []; - foreach($pset as $pid => $elem) { - $pname = $elem['name']; - if ($elem['is_open'] == 0) { - $pname = "**closed for exec** " . $pname; - } - $itemSet[$pid] = $pname; - } - return $itemSet; - } - - - - /** - * @return - * - */ - public function throwIfEmptyName($name) - { - $safeName = trim($name); - if (tlStringLen($safeName) == 0) - { - $msg = "Class: " . __CLASS__ . " - " . "Method: " . __FUNCTION__ ; - $msg .= " Empty name "; - throw new Exception($msg); - } - return $safeName; - } - - - /** - * - * - */ - public function deleteByTestProject($tproject_id) - { - $sql = "DELETE FROM {$this->tables['platforms']} WHERE testproject_id = {$tproject_id}"; - $result = $this->db->exec_query($sql); - - return $result ? tl::OK : self::E_DBERROR; - } - - - /** - * - * @internal revisions - * @since 1.9.4 - */ - public function testProjectCount($opt=null) - { - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . '*/ '; - $my['opt'] = array('range' => 'tproject'); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - - // HINT: COALESCE(COUNT(PLAT.id),0) - // allows to get 0 on platform_qty - // - $sql = $debugMsg . " SELECT COALESCE(COUNT(PLAT.id),0) AS platform_qty, TPROJ.id AS tproject_id " . - " FROM {$this->tables['testprojects']} TPROJ " . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.testproject_id = TPROJ.id "; - - switch($my['opt']['range']) - { - case 'tproject': - $sql .= " WHERE TPROJ.id = " . $this->tproject_id ; - break; - } - $sql .= " GROUP BY TPROJ.id "; - return ($this->db->fetchRowsIntoMap($sql,'tproject_id')); - } - - public function belongsToTestProject($id,$tproject_id = null) - { - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . '*/ '; - $pid = intval(is_null($tproject_id) ? $this->tproject_id : $tproject_id); - - $sql = " SELECT id FROM {$this->tables['platforms']} " . - " WHERE id = " . intval($id) . " AND testproject_id=" . $pid; - $dummy = $this->db->fetchRowsIntoMap($sql,'id'); - return isset($dummy['id']); - } - - public function isLinkedToTestplan($id,$testplan_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " SELECT platform_id FROM {$this->tables['testplan_platforms']} " . - " WHERE testplan_id = " . intval($testplan_id) . - " AND platform_id = " . intval($id); - $rs = $this->db->fetchRowsIntoMap($sql,'platform_id'); - return !is_null($rs); - } - - /** - * - */ - function initViewGUI( &$userObj, &$argsObj ) { - $gaga = new stdClass(); - - // Context needed to avoid use of session - // then you can open multiple TABS!! - $gaga->tproject_id = $this->tproject_id; - $gaga->tplan_id = $argsObj->tplan_id; - - - - $cfg = getWebEditorCfg('platform'); - $gaga->editorType = $cfg['type']; - $gaga->user_feedback = null; - $gaga->user_feedback = array('type' => 'INFO', 'message' => ''); - - $opx = array('include_linked_count' => true, - 'enable_on_design' => null, - 'enable_on_execution' => null, - 'is_open' => null); - $gaga->platforms = $this->getAll($opx); - - $rx = array('canManage' => 'platform_management', - 'mgt_view_events' => 'mgt_view_events'); - foreach($rx as $prop => $right) { - $gaga->$prop = $userObj->hasRight($this->db->db,$right, - $this->tproject_id); - } - - return $gaga; - } - - /** - * - */ - function enableDesign($id) - { - $sql = "UPDATE {$this->tables['platforms']} + FROM {$this->tables['platforms']} P + JOIN {$this->tables['testplan_platforms']} TP + ON P.id = TP.platform_id + WHERE TP.testplan_id = {$testplanID} + {$my['options']['orderBy']}"; + + switch ($my['options']['outputFormat']) { + case 'array': + $rs = $this->db->get_recordset($sql); + break; + + case 'mapAccessByID': + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + break; + + case 'mapAccessByName': + $rs = $this->db->fetchRowsIntoMap($sql, 'name'); + break; + } + return $rs; + } + + /** + * + * @param string $orderBy + * @return array Returns all platforms associated + * to a given testplan + * output format: $id => $name + */ + public function getLinkedToTestplanAsMap($testplanID, $opt = null) + { + // null -> any + $options = array( + 'orderBy' => ' ORDER BY name ', + 'enable_on_design' => null, + 'enable_on_execution' => true + ); + + $options = array_merge($options, (array) $opt); + + $orderBy = $options['orderBy']; + + $filterEnableOn = ""; + $enaSet = array( + 'enable_on_design', + 'enable_on_execution' + ); + foreach ($enaSet as $ena) { + if ($options[$ena] == null) { + // do not filter + continue; + } + + if (is_bool($options[$ena]) || is_int($options[$ena])) { + $filterEnableOn .= " AND $ena = " . ($options[$ena] ? 1 : 0); + } + } + + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $sql = "/* $debugMsg */ SELECT P.id, P.name, P.is_open " . + " FROM {$this->tables['platforms']} P " . + " JOIN {$this->tables['testplan_platforms']} TP " . + " ON P.id = TP.platform_id " . + " WHERE TP.testplan_id = {$testplanID} + {$filterEnableOn} {$orderBy}"; + + $pset = (array) $this->db->fetchRowsIntoMap($sql, 'id'); + $itemSet = []; + foreach ($pset as $pid => $elem) { + $pname = $elem['name']; + if ($elem['is_open'] == 0) { + $pname = "**closed for exec** " . $pname; + } + $itemSet[$pid] = $pname; + } + return $itemSet; + } + + /** + * + * @return + * + */ + public function throwIfEmptyName($name) + { + $safeName = trim($name); + if (tlStringLen($safeName) == 0) { + $msg = "Class: " . __CLASS__ . " - " . "Method: " . __FUNCTION__; + $msg .= " Empty name "; + throw new Exception($msg); + } + return $safeName; + } + + /** + */ + public function deleteByTestProject($tproject_id) + { + $sql = "DELETE FROM {$this->tables['platforms']} WHERE testproject_id = {$tproject_id}"; + $result = $this->db->exec_query($sql); + + return $result ? tl::OK : self::E_DBERROR; + } + + /** + * + * @internal revisions + * @since 1.9.4 + */ + public function testProjectCount($opt = null) + { + $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . + '*/ '; + $my['opt'] = array( + 'range' => 'tproject' + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + // HINT: COALESCE(COUNT(PLAT.id),0) + // allows to get 0 on platform_qty + // + $sql = $debugMsg . + " SELECT COALESCE(COUNT(PLAT.id),0) AS platform_qty, TPROJ.id AS tproject_id " . + " FROM {$this->tables['testprojects']} TPROJ " . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.testproject_id = TPROJ.id "; + + switch ($my['opt']['range']) { + case 'tproject': + $sql .= " WHERE TPROJ.id = " . $this->tproject_id; + break; + } + $sql .= " GROUP BY TPROJ.id "; + return $this->db->fetchRowsIntoMap($sql, 'tproject_id'); + } + + public function belongsToTestProject($id, $tproject_id = null) + { + $pid = intval(is_null($tproject_id) ? $this->tproject_id : $tproject_id); + + $sql = " SELECT id FROM {$this->tables['platforms']} " . " WHERE id = " . + intval($id) . " AND testproject_id=" . $pid; + $dummy = $this->db->fetchRowsIntoMap($sql, 'id'); + return isset($dummy['id']); + } + + public function isLinkedToTestplan($id, $testplan_id) + { + $sql = " SELECT platform_id FROM {$this->tables['testplan_platforms']} " . + " WHERE testplan_id = " . intval($testplan_id) . + " AND platform_id = " . intval($id); + $rs = $this->db->fetchRowsIntoMap($sql, 'platform_id'); + return ! is_null($rs); + } + + /** + */ + public function initViewGUI(&$userObj, &$argsObj) + { + $gaga = new stdClass(); + + // Context needed to avoid use of session + // then you can open multiple TABS!! + $gaga->tproject_id = $this->tproject_id; + $gaga->tplan_id = $argsObj->tplan_id; + + $cfg = getWebEditorCfg('platform'); + $gaga->editorType = $cfg['type']; + $gaga->user_feedback = null; + $gaga->user_feedback = array( + 'type' => 'INFO', + 'message' => '' + ); + + $opx = array( + 'include_linked_count' => true, + 'enable_on_design' => null, + 'enable_on_execution' => null, + 'is_open' => null + ); + $gaga->platforms = $this->getAll($opx); + + $rx = array( + 'canManage' => 'platform_management', + 'mgt_view_events' => 'mgt_view_events' + ); + foreach ($rx as $prop => $right) { + $gaga->$prop = $userObj->hasRight($this->db->db, $right, + $this->tproject_id); + } + + return $gaga; + } + + /** + */ + public function enableDesign($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET enable_on_design = 1 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - /** - * - */ - function disableDesign($id) - { - $sql = "UPDATE {$this->tables['platforms']} + WHERE id = $id"; + $this->db->exec_query($sql); + } + + /** + */ + public function disableDesign($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET enable_on_design = 0 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - - /** - * - */ - function enableExec($id) - { - $sql = "UPDATE {$this->tables['platforms']} + WHERE id = $id"; + $this->db->exec_query($sql); + } + + /** + */ + public function enableExec($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET enable_on_execution = 1 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - /** - * - */ - function disableExec($id) - { - $sql = "UPDATE {$this->tables['platforms']} + WHERE id = $id"; + $this->db->exec_query($sql); + } + + /** + */ + public function disableExec($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET enable_on_execution = 0 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - - /** - * - */ - function openForExec($id) - { - $sql = "UPDATE {$this->tables['platforms']} + WHERE id = $id"; + $this->db->exec_query($sql); + } + + /** + */ + public function openForExec($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET is_open = 1 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - /** - * - */ - function closeForExec($id) - { - $sql = "UPDATE {$this->tables['platforms']} + WHERE id = $id"; + $this->db->exec_query($sql); + } + + /** + */ + public function closeForExec($id) + { + $sql = "UPDATE {$this->tables['platforms']} SET is_open = 0 - WHERE id = $id"; - $this->db->exec_query($sql); - } - - - function getAsXMLString($tproject_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $tables = tlObjectWithDB::getDBTables(array('platforms')); - $adodbXML = new ADODB_XML("1.0", "UTF-8"); - - $sql = "/* $debugMsg */ + WHERE id = $id"; + $this->db->exec_query($sql); + } + + private function getAsXMLString($tproject_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $tables = tlObjectWithDB::getDBTables(array( + 'platforms' + )); + $adodbXML = new ADODB_XML("1.0", "UTF-8"); + + $sql = "/* $debugMsg */ SELECT name,notes,enable_on_design, - enable_on_execution - FROM {$tables['platforms']} PLAT - WHERE PLAT.testproject_id=" . intval($tproject_id); - - $adodbXML->setRootTagName('platforms'); - $adodbXML->setRowTagName('platform'); - $content = $adodbXML->ConvertToXMLString($db->db, $sql); - downloadContentsToFile($content,$filename); - exit(); - } - - + enable_on_execution + FROM {$tables['platforms']} PLAT + WHERE PLAT.testproject_id=" . intval($tproject_id); + + $adodbXML->setRootTagName('platforms'); + $adodbXML->setRowTagName('platform'); + $content = $adodbXML->ConvertToXMLString($db->db, $sql); + downloadContentsToFile($content, $filename); + exit(); + } } diff --git a/lib/functions/tlPlugin.class.php b/lib/functions/tlPlugin.class.php index b2e27379ba..42ef33d441 100644 --- a/lib/functions/tlPlugin.class.php +++ b/lib/functions/tlPlugin.class.php @@ -1,117 +1,120 @@ -db = $db; - parent::__construct($this->db); - - $this->basename = $p_basename; - $this->register(); - } - - final public function __init() - { - plugin_config_defaults($this->config()); - plugin_event_hook_many($this->hooks()); - - $this->init(); - } - +db = $db; + parent::__construct($this->db); + + $this->basename = $p_basename; + $this->register(); + } + + final public function __init() + { + plugin_config_defaults($this->config()); + plugin_event_hook_many($this->hooks()); + + $this->init(); + } } diff --git a/lib/functions/tlReqMgrSystem.class.php b/lib/functions/tlReqMgrSystem.class.php index 835e13afa4..53ad7b19a1 100644 --- a/lib/functions/tlReqMgrSystem.class.php +++ b/lib/functions/tlReqMgrSystem.class.php @@ -1,624 +1,591 @@ - array('type' => 'contour', 'api' => 'soap', 'enabled' => true, 'order' => -1)); - var $entitySpec = array('name' => 'string','cfg' => 'string','type' => 'int'); - - /** - * Class constructor - * - * @param resource &$db reference to the database handler - */ - function __construct(&$db) - { - parent::__construct(); - $this->getTypes(); // populate types property - $this->db = &$db; - } - - - - /** - * @return hash - * - * - */ - function getSystems($opt=null) - { - $my = array('options' => null); - $my['options']['status'] = 'enabled'; // enabled,disabled,all - $my['options'] = array_merge($my['options'],(array)$opt); - - switch($my['options']['status']) - { - case 'enabled': - $tval = true; - break; - - case 'disabled': - $tval = false; - break; - - default: - $tval = null; - break; - } - - $ret = array(); - foreach($this->systems as $code => $elem) - { - $idx = 0; - if($tval== null || $elem['enabled'] == $tval) - { - $ret[$code] = $elem; - } - } - return $ret; - } - - /** - * @return hash - * - * - */ - function getTypes() - { - if( is_null($this->types) ) - { - foreach($this->systems as $code => $spec) - { - $this->types[$code] = $spec['type'] . " (Interface: {$spec['api']})"; - } - } - return $this->types; - } - - - /** - * @return - * - * - */ - function getImplementationForType($system) - { - $spec = $this->systems[$system]; - return $spec['type'] . $spec['api'] . 'Interface'; - } - - /** - * @return hash - * - * - */ - function getEntitySpec() - { - return $this->entitySpec; - } - - - /** - * - */ - function create($system) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => 'name already exists'); - $safeobj = $this->sanitize($system); - - // empty name is not allowed - if( is_null($safeobj->name) ) - { - $ret['msg'] = 'empty name is not allowed'; - return $ret; // >>>---> Bye! - } - - // need to check if name already exist - if( is_null($this->getByName($system->name,array('output' => 'id')) )) - { - $sql = "/* debugMsg */ INSERT INTO {$this->tables['reqmgrsystems']} " . - " (name,cfg,type) " . - " VALUES('" . $safeobj->name . "','" . $safeobj->cfg . "',{$safeobj->type})"; - - if( $this->db->exec_query($sql) ) - { - // at least for Postgres DBMS table name is needed. - $itemID=$this->db->insert_id($this->tables['reqmgrsystems']); - $ret = array('status_ok' => 1, 'id' => $itemID, 'msg' => 'ok'); - } - else - { - $ret = array('status_ok' => 0, 'id' => 0, 'msg' => $this->db->error_msg()); - } - } - - return $ret; - } - - - /** - * - */ - function update($system) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - $msg = array(); - $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; - $msg['ok'] = "operation OK for id %s"; - - $safeobj = $this->sanitize($system); - $ret = array('status_ok' => 1, 'id' => $system->id, 'msg' => ''); - - - // check for duplicate name - $info = $this->getByName($safeobj->name); - if( !is_null($info) && ($info['id'] != $system->id) ) - { - $ret['status_ok'] = 0; - $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, $info['id']); - } - - if( $ret['status_ok'] ) - { - $sql = "UPDATE {$this->tables['reqmgrsystems']} " . - " SET name = '" . $safeobj->name. "'," . - " cfg = '" . $safeobj->cfg . "'," . - " type = " . $safeobj->type . - " WHERE id = " . intval($system->id); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$system->id); - - } - return $ret; - - } //function end - - - - /** - * delete can be done ONLY if ID is not linked to test project - */ - function delete($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; - - $msg = array(); - $msg['linked'] = "Failure - id %s is linked to: "; - $msg['tproject_details'] = " testproject '%s' with id %s %s"; - $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; - $msg['ok'] = "operation OK for id %s"; - - $ret = array('status_ok' => 1, 'id' => $id, 'msg' => $debugMsg); - if(is_null($id) || ($safeID = intval($id)) <= 0) - { - $ret['status_ok'] = 0; - $ret['id'] = $id; - $ret['msg'] .= sprintf($msg['syntax_error'],$id); - return $ret; // >>>-----> Bye! - } - - - // check if ID is linked - $links = $this->getLinks($safeID); - if( is_null($links) ) - { - $sql = " /* $debugMsg */ DELETE FROM {$this->tables['reqmgrsystems']} " . - " WHERE id = " . intval($safeID); - $result = $this->db->exec_query($sql); - $ret['msg'] .= sprintf($msg['ok'],$safeID); - - } - else - { - $ret['status_ok'] = 0; - $dummy = sprintf($msg['linked'],$safeID); - $sep = ' / '; - foreach($links as $item) - { - $dummy .= sprintf($msg['tproject_details'],$item['testproject_name'],$item['testproject_id'],$sep); - } - $ret['msg'] .= rtrim($dummy,$sep); - - } - return $ret; - - } //function end - - - - - - /** - * - */ - function getByID($id, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'id', 'value' => $id),$options); - } - - - /** - * - */ - function getByName($name, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - return $this->getByAttr(array('key' => 'name', 'value' => $name),$options); - } - - - /** - * - */ - function getByAttr($attr, $options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['options'] = array('output' => 'full'); - $my['options'] = array_merge($my['options'], (array)$options); - - $sql = "/* debugMsg */ SELECT "; - switch($my['options']['output']) - { - case 'id': - $sql .= " id "; - break; - - case 'full': - default: - $sql .= " * "; - break; - - } - - switch($attr['key']) - { - case 'id': - $where = " WHERE id = " . intval($attr['value']); - break; - - case 'name': - default: - $where = " WHERE name = '" . $this->db->prepare_string($attr['value']) . "'"; - break; - } - - - $sql .= " FROM {$this->tables['reqmgrsystems']} " . $where; - $rs = $this->db->get_recordset($sql); - if( !is_null($rs) ) - { - $rs = $rs[0]; - $rs['implementation'] = $this->getImplementationForType($rs['type']); - } - return $rs; - } - - - - /* - * Sanitize and do minor checks - * - * Sanitize Operations - * keys name -> trim will be applied - * type -> intval() wil be applied - * cfg - * - * For strings also db_prepare_string() will be applied - * - * - * Check Operations - * keys name -> if '' => will be set to NULL - * - */ - function sanitize($obj) - { - $sobj = $obj; - - // remove the standard set of characters considered harmful - // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab - // "\r" - carriage return - // and spaces - // fortunatelly this is trim standard behaviour - $k2san = array('name'); - foreach($k2san as $key) - { - $value = trim($obj->$key); - switch($key) - { - case 'name': - $sobj->$key = ($value == '') ? null : $value; - break; - } - - if( !is_null($sobj->$key) ) - { - $sobj->$key = $this->db->prepare_string($obj->$key); - } - - } - - // seems here is better do not touch. - $sobj->cfg = $this->db->prepare_string($obj->cfg); - $sobj->type = intval($obj->type); - - return $sobj; - } - - - - /* - * - * - */ - function link($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - - // Check if link exist for test project ID, in order to INSERT or UPDATE - $statusQuo = $this->getLinkedTo($tprojectID); - - if( is_null($statusQuo) ) - { - $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_reqmgrsystem']} " . - " (testproject_id,reqmgrsystem_id) " . - " VALUES(" . intval($tprojectID) . "," . intval($id) . ")"; - } - else - { - $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_reqmgrsystem']} " . - " SET reqmgrsystem_id = " . intval($id) . - " WHERE testproject_id = " . intval($tprojectID); - } - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function unlink($id,$tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($id)) - { - return; - } - $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_reqmgrsystem']} " . - " WHERE testproject_id = " . intval($tprojectID) . - " AND reqmgrsystem_id = " . intval($id); - $this->db->exec_query($sql); - } - - - /* - * - * - */ - function getLinks($id, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array('opt' => array('getDeadLinks' => false)); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - if(is_null($id)) - { - return; - } - - - $sql = "/* $debugMsg */ " . - " SELECT TPMGR.testproject_id, NHTPR.name AS testproject_name " . - " FROM {$this->tables['testproject_reqmgrsystem']} TPMGR" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPMGR.testproject_id " . - " WHERE TPMGR.reqmgrsystem_id = " . intval($id); - - if($my['opt']['getDeadLinks']) - { - $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; - } - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - - - /* - * - * - */ - function getLinkSet() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $sql = "/* $debugMsg */ " . - " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, TPIT.reqmgrsystem_id " . - " FROM {$this->tables['testproject_reqmgrsystem']} TPIT" . - " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPIT.testproject_id "; - - $ret = $this->db->fetchRowsIntoMap($sql,'testproject_id'); - return $ret; - } - - /* - * - * - */ - function getAll($options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $my['options'] = array('output' => null, 'orderByField' => 'name', 'checkEnv' => false); - $my['options'] = array_merge($my['options'], (array)$options); - - $add_fields = ''; - if( $my['options']['output'] == 'add_link_count' ) - { - $add_fields = ", 0 AS link_count "; - } - - $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . $my['options']['orderByField']; - - $sql = "/* debugMsg */ SELECT * {$add_fields} "; - $sql .= " FROM {$this->tables['reqmgrsystems']} {$orderByClause} "; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - - $lc = null; - if( !is_null($rs) ) - { - - if( $my['options']['output'] == 'add_link_count' ) - { - $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, ITD.id"; - $sql .= " FROM {$this->tables['reqmgrsystems']} ITD " . - " JOIN {$this->tables['testproject_reqmgrsystem']} " . - " ON reqmgrsystem_id = ITD.id " . - " GROUP BY ITD.id "; - $lc = $this->db->fetchRowsIntoMap($sql,'id'); - } - - - foreach($rs as &$item) - { - $item['verbose'] = $item['name'] . " ( {$this->types[$item['type']]} )" ; - $item['type_descr'] = $this->types[$item['type']]; - $item['env_check_ok'] = true; - $item['env_check_msg'] = ''; - $item['connection_status'] = ''; - - if( $my['options']['checkEnv'] ) - { - $impl = $this->getImplementationForType($item['type']); - if( method_exists($impl,'checkEnv') ) - { - $dummy = $impl::checkEnv(); - $item['env_check_ok'] = $dummy['status']; - $item['env_check_msg'] = $dummy['msg']; - } - } - - - if( !is_null($lc) ) - { - if( isset($lc[$item['id']]) ) - { - $item['link_count'] = intval($lc[$item['id']]['lcount']); - } - } - } - } - return $rs; - } - - - /* - * - * - */ - function getLinkedTo($tprojectID) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - if(is_null($tprojectID)) - { - return; - } - $sql = "/* $debugMsg */ " . - " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, " . - " TPIT.reqmgrsystem_id,ITRK.name AS reqmgrsystem_name, ITRK.type" . - " FROM {$this->tables['testproject_reqmgrsystem']} TPIT" . - " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . - " ON NHTPR.id = TPIT.testproject_id " . - " JOIN {$this->tables['reqmgrsystems']} ITRK " . - " ON ITRK.id = TPIT.reqmgrsystem_id " . - " WHERE TPIT.testproject_id = " . intval($tprojectID); - - $ret = $this->db->get_recordset($sql); - if( !is_null($ret) ) - { - $ret = $ret[0]; - $ret['verboseType'] = $this->types[$ret['type']]; - } - - return $ret; - } - - - /* - * - * - */ - function getInterfaceObject($tprojectID) - { - $its = null; - $system = $this->getLinkedTo($tprojectID); - - try - { - if( !is_null($system) ) - { - $itd = $this->getByID($system['reqmgrsystem_id']); - $iname = $itd['implementation']; - $its = new $iname($itd['implementation'],$itd['cfg']); - } - return $its; - } - catch (Exception $e) - { - echo('Probably there is some PHP Config issue regarding extension'); - echo($e->getMessage().'
    '.$e->getTraceAsString().'
    '); - } - } - - /* - * - * - */ - function checkConnection($systemID) - { - $xx = $this->getByID($systemID); - $class2create = $xx['implementation']; - $system = new $class2create($xx['type'],$xx['cfg']); - return $system->isConnected(); - } -} // end class -?> \ No newline at end of file + array( + 'type' => 'contour', + 'api' => 'soap', + 'enabled' => true, + 'order' => - 1 + ) + ); + + private $entitySpec = array( + 'name' => 'string', + 'cfg' => 'string', + 'type' => 'int' + ); + + /** + * Class constructor + * + * @param + * resource &$db reference to the database handler + */ + public function __construct(&$db) + { + parent::__construct(); + $this->getTypes(); // populate types property + $this->db = &$db; + } + + /** + * + * @return array + * + * + */ + private function getSystems($opt = null) + { + $my = array( + 'options' => null + ); + $my['options']['status'] = 'enabled'; // enabled,disabled,all + $my['options'] = array_merge($my['options'], (array) $opt); + + switch ($my['options']['status']) { + case 'enabled': + $tval = true; + break; + + case 'disabled': + $tval = false; + break; + + default: + $tval = null; + break; + } + + $ret = array(); + foreach ($this->systems as $code => $elem) { + if ($tval == null || $elem['enabled'] == $tval) { + $ret[$code] = $elem; + } + } + return $ret; + } + + /** + * + * @return array + * + * + */ + public function getTypes() + { + if (is_null($this->types)) { + foreach ($this->systems as $code => $spec) { + $this->types[$code] = $spec['type'] . + " (Interface: {$spec['api']})"; + } + } + return $this->types; + } + + /** + * + * @return + * + * + */ + public function getImplementationForType($system) + { + $spec = $this->systems[$system]; + return $spec['type'] . $spec['api'] . 'Interface'; + } + + /** + * + * @return array + * + * + */ + public function getEntitySpec() + { + return $this->entitySpec; + } + + /** + */ + public function create($system) + { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => 'name already exists' + ); + $safeobj = $this->sanitize($system); + + // empty name is not allowed + if (is_null($safeobj->name)) { + $ret['msg'] = 'empty name is not allowed'; + return $ret; // >>>---> Bye! + } + + // need to check if name already exist + if (is_null($this->getByName($system->name, array( + 'output' => 'id' + )))) { + $sql = "/* debugMsg */ INSERT INTO {$this->tables['reqmgrsystems']} " . + " (name,cfg,type) " . " VALUES('" . $safeobj->name . "','" . + $safeobj->cfg . "',{$safeobj->type})"; + + if ($this->db->exec_query($sql)) { + // at least for Postgres DBMS table name is needed. + $itemID = $this->db->insert_id($this->tables['reqmgrsystems']); + $ret = array( + 'status_ok' => 1, + 'id' => $itemID, + 'msg' => 'ok' + ); + } else { + $ret = array( + 'status_ok' => 0, + 'id' => 0, + 'msg' => $this->db->error_msg() + ); + } + } + + return $ret; + } + + /** + */ + public function update($system) + { + $msg = array(); + $msg['duplicate_name'] = "Update can not be done - name %s already exists for id %s"; + $msg['ok'] = "operation OK for id %s"; + + $safeobj = $this->sanitize($system); + $ret = array( + 'status_ok' => 1, + 'id' => $system->id, + 'msg' => '' + ); + + // check for duplicate name + $info = $this->getByName($safeobj->name); + if (! is_null($info) && ($info['id'] != $system->id)) { + $ret['status_ok'] = 0; + $ret['msg'] .= sprintf($msg['duplicate_name'], $safeobj->name, + $info['id']); + } + + if ($ret['status_ok']) { + $sql = "UPDATE {$this->tables['reqmgrsystems']} " . " SET name = '" . + $safeobj->name . "'," . " cfg = '" . $safeobj->cfg . "'," . + " type = " . $safeobj->type . " WHERE id = " . + intval($system->id); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $system->id); + } + return $ret; + } + + /** + * delete can be done ONLY if ID is not linked to test project + */ + public function delete($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' - '; + + $msg = array(); + $msg['linked'] = "Failure - id %s is linked to: "; + $msg['tproject_details'] = " testproject '%s' with id %s %s"; + $msg['syntax_error'] = "Syntax failure - id %s seems to be an invalid value"; + $msg['ok'] = "operation OK for id %s"; + + $ret = array( + 'status_ok' => 1, + 'id' => $id, + 'msg' => $debugMsg + ); + if (is_null($id) || ($safeID = intval($id)) <= 0) { + $ret['status_ok'] = 0; + $ret['id'] = $id; + $ret['msg'] .= sprintf($msg['syntax_error'], $id); + return $ret; // >>>-----> Bye! + } + + // check if ID is linked + $links = $this->getLinks($safeID); + if (is_null($links)) { + $sql = " /* $debugMsg */ DELETE FROM {$this->tables['reqmgrsystems']} " . + " WHERE id = " . intval($safeID); + $this->db->exec_query($sql); + $ret['msg'] .= sprintf($msg['ok'], $safeID); + } else { + $ret['status_ok'] = 0; + $dummy = sprintf($msg['linked'], $safeID); + $sep = ' / '; + foreach ($links as $item) { + $dummy .= sprintf($msg['tproject_details'], + $item['testproject_name'], $item['testproject_id'], $sep); + } + $ret['msg'] .= rtrim($dummy, $sep); + } + return $ret; + } + + /** + */ + public function getByID($id, $options = null) + { + return $this->getByAttr(array( + 'key' => 'id', + 'value' => $id + ), $options); + } + + /** + */ + private function getByName($name, $options = null) + { + return $this->getByAttr(array( + 'key' => 'name', + 'value' => $name + ), $options); + } + + /** + */ + private function getByAttr($attr, $options = null) + { + $my['options'] = array( + 'output' => 'full' + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $sql = "/* debugMsg */ SELECT "; + switch ($my['options']['output']) { + case 'id': + $sql .= " id "; + break; + + case 'full': + default: + $sql .= " * "; + break; + } + + switch ($attr['key']) { + case 'id': + $where = " WHERE id = " . intval($attr['value']); + break; + + case 'name': + default: + $where = " WHERE name = '" . + $this->db->prepare_string($attr['value']) . "'"; + break; + } + + $sql .= " FROM {$this->tables['reqmgrsystems']} " . $where; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + $rs = $rs[0]; + $rs['implementation'] = $this->getImplementationForType($rs['type']); + } + return $rs; + } + + /* + * Sanitize and do minor checks + * + * Sanitize Operations + * keys name -> trim will be applied + * type -> intval() wil be applied + * cfg + * + * For strings also db_prepare_string() will be applied + * + * + * Check Operations + * keys name -> if '' => will be set to NULL + * + */ + private function sanitize($obj) + { + $sobj = $obj; + + // remove the standard set of characters considered harmful + // "\0" - NULL, "\t" - tab, "\n" - new line, "\x0B" - vertical tab + // "\r" - carriage return + // and spaces + // fortunatelly this is trim standard behaviour + $k2san = array( + 'name' + ); + foreach ($k2san as $key) { + $value = trim($obj->$key); + switch ($key) { + case 'name': + $sobj->$key = ($value == '') ? null : $value; + break; + } + + if (! is_null($sobj->$key)) { + $sobj->$key = $this->db->prepare_string($obj->$key); + } + } + + // seems here is better do not touch. + $sobj->cfg = $this->db->prepare_string($obj->cfg); + $sobj->type = intval($obj->type); + + return $sobj; + } + + /* + * + * + */ + public function link($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + + // Check if link exist for test project ID, in order to INSERT or UPDATE + $statusQuo = $this->getLinkedTo($tprojectID); + + if (is_null($statusQuo)) { + $sql = "/* $debugMsg */ INSERT INTO {$this->tables['testproject_reqmgrsystem']} " . + " (testproject_id,reqmgrsystem_id) " . " VALUES(" . + intval($tprojectID) . "," . intval($id) . ")"; + } else { + $sql = "/* $debugMsg */ UPDATE {$this->tables['testproject_reqmgrsystem']} " . + " SET reqmgrsystem_id = " . intval($id) . + " WHERE testproject_id = " . intval($tprojectID); + } + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function unlink($id, $tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($id)) { + return; + } + $sql = "/* $debugMsg */ DELETE FROM {$this->tables['testproject_reqmgrsystem']} " . + " WHERE testproject_id = " . intval($tprojectID) . + " AND reqmgrsystem_id = " . intval($id); + $this->db->exec_query($sql); + } + + /* + * + * + */ + public function getLinks($id, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array( + 'opt' => array( + 'getDeadLinks' => false + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + if (is_null($id)) { + return; + } + + $sql = "/* $debugMsg */ " . + " SELECT TPMGR.testproject_id, NHTPR.name AS testproject_name " . + " FROM {$this->tables['testproject_reqmgrsystem']} TPMGR" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPMGR.testproject_id " . + " WHERE TPMGR.reqmgrsystem_id = " . intval($id); + + if ($my['opt']['getDeadLinks']) { + $sql .= ' AND NHTPR.id IS NULL AND NHTPR.name IS NULL '; + } + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + private function getLinkSet() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $sql = "/* $debugMsg */ " . + " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, TPIT.reqmgrsystem_id " . + " FROM {$this->tables['testproject_reqmgrsystem']} TPIT" . + " LEFT OUTER JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPIT.testproject_id "; + + return $this->db->fetchRowsIntoMap($sql, 'testproject_id'); + } + + /* + * + * + */ + public function getAll($options = null) + { + $my['options'] = array( + 'output' => null, + 'orderByField' => 'name', + 'checkEnv' => false + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $add_fields = ''; + if ($my['options']['output'] == 'add_link_count') { + $add_fields = ", 0 AS link_count "; + } + + $orderByClause = is_null($my['options']['orderByField']) ? '' : 'ORDER BY ' . + $my['options']['orderByField']; + + $sql = "/* debugMsg */ SELECT * {$add_fields} "; + $sql .= " FROM {$this->tables['reqmgrsystems']} {$orderByClause} "; + $rs = $this->db->fetchRowsIntoMap($sql, 'id'); + + $lc = null; + if (! is_null($rs)) { + + if ($my['options']['output'] == 'add_link_count') { + $sql = "/* debugMsg */ SELECT COUNT(0) AS lcount, ITD.id"; + $sql .= " FROM {$this->tables['reqmgrsystems']} ITD " . + " JOIN {$this->tables['testproject_reqmgrsystem']} " . + " ON reqmgrsystem_id = ITD.id " . " GROUP BY ITD.id "; + $lc = $this->db->fetchRowsIntoMap($sql, 'id'); + } + + foreach ($rs as &$item) { + $item['verbose'] = $item['name'] . + " ( {$this->types[$item['type']]} )"; + $item['type_descr'] = $this->types[$item['type']]; + $item['env_check_ok'] = true; + $item['env_check_msg'] = ''; + $item['connection_status'] = ''; + + if ($my['options']['checkEnv']) { + $impl = $this->getImplementationForType($item['type']); + if (method_exists($impl, 'checkEnv')) { + $dummy = $impl::checkEnv(); + $item['env_check_ok'] = $dummy['status']; + $item['env_check_msg'] = $dummy['msg']; + } + } + + if (! is_null($lc) && isset($lc[$item['id']])) { + $item['link_count'] = intval($lc[$item['id']]['lcount']); + } + } + } + return $rs; + } + + /* + * + * + */ + public function getLinkedTo($tprojectID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + if (is_null($tprojectID)) { + return; + } + $sql = "/* $debugMsg */ " . + " SELECT TPIT.testproject_id, NHTPR.name AS testproject_name, " . + " TPIT.reqmgrsystem_id,ITRK.name AS reqmgrsystem_name, ITRK.type" . + " FROM {$this->tables['testproject_reqmgrsystem']} TPIT" . + " JOIN {$this->tables['nodes_hierarchy']} NHTPR " . + " ON NHTPR.id = TPIT.testproject_id " . + " JOIN {$this->tables['reqmgrsystems']} ITRK " . + " ON ITRK.id = TPIT.reqmgrsystem_id " . + " WHERE TPIT.testproject_id = " . intval($tprojectID); + + $ret = $this->db->get_recordset($sql); + if (! is_null($ret)) { + $ret = $ret[0]; + $ret['verboseType'] = $this->types[$ret['type']]; + } + + return $ret; + } + + /* + * + * + */ + public function getInterfaceObject($tprojectID) + { + $its = null; + $system = $this->getLinkedTo($tprojectID); + + try { + if (! is_null($system)) { + $itd = $this->getByID($system['reqmgrsystem_id']); + $iname = $itd['implementation']; + $its = new $iname($itd['implementation'], $itd['cfg']); + } + return $its; + } catch (Exception $e) { + echo 'Probably there is some PHP Config issue regarding extension'; + echo $e->getMessage() . '
    ' . $e->getTraceAsString() . '
    '; + } + } + + /* + * + * + */ + public function checkConnection($systemID) + { + $xx = $this->getByID($systemID); + $class2create = $xx['implementation']; + $system = new $class2create($xx['type'], $xx['cfg']); + return $system->isConnected(); + } +} +?> diff --git a/lib/functions/tlRequirementFilterControl.class.php b/lib/functions/tlRequirementFilterControl.class.php index d960d12f3b..ac9331a787 100644 --- a/lib/functions/tlRequirementFilterControl.class.php +++ b/lib/functions/tlRequirementFilterControl.class.php @@ -1,546 +1,559 @@ - array("POST", tlInputParameter::STRING_N), - 'filter_title' => array("POST", tlInputParameter::STRING_N), - 'filter_status' => array("POST", tlInputParameter::ARRAY_STRING_N), - 'filter_type' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_spec_type' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_coverage' => array("POST", tlInputParameter::INT_N), - 'filter_relation' => array("POST", tlInputParameter::ARRAY_STRING_N), - 'filter_tc_id' => array("POST", tlInputParameter::STRING_N), - 'filter_custom_fields' => null, 'filter_result' => false); - - /** - * This array contains all possible settings. It is used as a helper - * to later iterate over all possibilities in loops. - * Its keys are the names of the settings, its values the arrays for the input parser. - * @var array - */ - private $all_settings = array('setting_refresh_tree_on_action' => - array("POST", tlInputParameter::CB_BOOL)); - - - - /** - * - */ - public function __construct(&$dbHandler) - { - // Call to constructor of parent class tlFilterControl. - // This already loads configuration and user input - // and does all the remaining necessary method calls, - // so no further method call is required here for initialization. - parent::__construct($dbHandler); - $this->req_mgr = new requirement_mgr($this->db); - - // ATTENTION if you do not see it when debugging, can be because - // has been declared as PROTECTED - $this->cfield_mgr = &$this->req_mgr->cfield_mgr; - - // moved here from parent::__constructor() to be certain that - // all required objects has been created - $this->init_filters(); - } - - - public function __destruct() - { - parent::__destruct(); //destroys testproject manager - - // destroy member objects - unset($this->req_mgr); - } - - protected function read_config() - { - // some configuration reading already done in parent class - parent::read_config(); - - // load configuration for requirement filters - $this->configuration = config_get('tree_filter_cfg')->requirements; - - // load req and req spec config (for types, filters, status, ...) - $this->configuration->req_cfg = config_get('req_cfg'); - $this->configuration->req_spec_cfg = config_get('req_spec_cfg'); - - // is choice of advanced filter mode enabled? - $this->filter_mode_choice_enabled = false; - if ($this->configuration->advanced_filter_mode_choice) - { - $this->filter_mode_choice_enabled = true; - } - - return tl::OK; - } - - protected function init_args() - { - // some common user input is already read in parent class - parent::init_args(); - - // add settings and filters to parameter info array for request parsers - $params = array(); - foreach ($this->all_settings as $name => $info) - { - if (is_array($info)) - { - $params[$name] = $info; - } - } - - foreach ($this->all_filters as $name => $info) - { - if (is_array($info)) - { - $params[$name] = $info; - } - } - I_PARAMS($params, $this->args); - } // end of method - - /** - * Initializes the class member array for settings - * according to the data loaded from database and user input. - * Only initializes active settings, for a better performance. - * If no settings are active, the complete panel will be disabled and not be displayed. - */ - protected function init_settings() - { - // $at_least_one_active = false; - - foreach ($this->all_settings as $name => $info) - { - $init_method = "init_$name"; - if (method_exists($this, $init_method)) - { - // is valid, configured, exists and therefore can be used, so initialize this setting - $this->$init_method(); - // $at_least_one_active = true; - $this->display_req_settings = true; - } - else - { - // is not needed, simply deactivate it by setting it to false in main array - $this->settings[$name] = false; - } - } - - // add the important settings to active filter array - foreach ($this->all_settings as $name => $info) - { - if ($this->settings[$name]) - { - $this->active_filters[$name] = $this->settings[$name]['selected']; - } - else - { - $this->active_filters[$name] = null; - } - } - - } // end of method - - /** - * Initializes the class member array for filters - * according to the data loaded from database and user input. - * Only initializes filters which are still enabled and active, for a better performance. - * If no filters are active at all, the filters panel will be disabled and not displayed. - */ - protected function init_filters() - { - // iterate through all filters and activate the needed ones - if ($this->configuration->show_filters == ENABLED) - { - foreach ($this->all_filters as $name => $info) - { - $init_method = "init_$name"; - if (method_exists($this, $init_method) && $this->configuration->{$name} == ENABLED) - { - $this->$init_method(); - $this->display_req_filters = true; - } - else - { - // is not needed, deactivate filter by setting it to false in main array - // and of course also in active filters array - $this->filters[$name] = false; - $this->active_filters[$name] = null; - } - } - } - else - { - $this->display_req_filters = false; - } - } // end of method - - /** - * Returns the filter array with necessary data, - * ready to be processed/used by underlying filter functions in - * requirement tree generator function. - */ - protected function get_active_filters() - { - return $this->active_filters; - } - - /** - * Build the tree menu for generation of JavaScript tree of requirements. - * Depending on user selections in graphical user interface, - * either a completely filtered tree will be built and returned, - * or only the minimal necessary data to "lazy load" the objects in tree by later Ajax calls. - * @param object $gui Reference to GUI object (information will be written to it) - * @return object $tree_menu Tree object for display of JavaScript tree menu. - */ - public function build_tree_menu(&$gui) - { - $tree_menu = null; - $filters = $this->get_active_filters(); - $additional_info = null; - $options = null; - $loader = ''; - $children = "[]"; - - // enable drag and drop - $drag_and_drop = new stdClass(); - $drag_and_drop->enabled = true; - $drag_and_drop->BackEndUrl = $gui->basehref . 'lib/ajax/dragdroprequirementnodes.php'; - $drag_and_drop->useBeforeMoveNode = TRUE; - - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - - // when we use filtering, the tree will be statically built, - // otherwise it will be lazy loaded - if ($this->do_filtering) - { - $options = array('for_printing' => NOT_FOR_PRINTING,'exclude_branches' => null); - - $tree_menu = generate_reqspec_tree($this->db, $this->testproject_mgr, - $this->args->testproject_id, - $this->args->testproject_name, - $filters, $options); - - $root_node = $tree_menu->rootnode; - $root_node->name .= " ({$root_node->total_req_count})"; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - $drag_and_drop->enabled = false; - } - else - { - $loader = $gui->basehref . 'lib/ajax/getrequirementnodes.php?mode=reqspec&' . - "root_node={$this->args->testproject_id}"; - - $req_qty = count($this->testproject_mgr->get_all_requirement_ids($this->args->testproject_id)); - - $root_node = new stdClass(); - $root_node->href = "javascript:TPROJECT_REQ_SPEC_MGMT({$this->args->testproject_id})"; - $root_node->id = $this->args->testproject_id; - $root_node->name = $this->args->testproject_name . " ($req_qty)"; - $root_node->testlink_node_type = 'testproject'; - } - - $gui->ajaxTree = new stdClass(); - $gui->ajaxTree->loader = $loader; - $gui->ajaxTree->root_node = $root_node; - $gui->ajaxTree->children = $children; - $gui->ajaxTree->dragDrop = $drag_and_drop; - $gui->ajaxTree->cookiePrefix = 'req_specification_tproject_id_' . $root_node->id . "_" ; - } - - /** - * - */ - private function init_setting_refresh_tree_on_action() - { - $key = 'setting_refresh_tree_on_action'; - $hidden_key = 'hidden_setting_refresh_tree_on_action'; - $selection = 0; - - $this->settings[$key] = array(); - $this->settings[$key][$hidden_key] = 0; - - // look where we can find the setting - POST, SESSION, config? - if (isset($this->args->{$key})) - { - $selection = 1; - } - else if (isset($this->args->{$hidden_key})) - { - $selection = 0; - } - else if (isset($_SESSION[$key])) - { - $selection = $_SESSION[$key]; - } - else - { - $selection = ($this->configuration->automatic_tree_refresh == ENABLED) ? 1 : 0; - } - - $this->settings[$key]['selected'] = $selection; - $this->settings[$key][$hidden_key] = $selection; - $_SESSION[$key] = $selection; - } - - - /** - * - */ - private function init_filter_doc_id() - { - $key = 'filter_doc_id'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - - private function init_filter_title() - { - $key = 'filter_title'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - private function init_filter_status() { - $key = 'filter_status'; - $selection = $this->args->{$key}; - - // get configured statuses and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_cfg->status_labels); - - // BUGID 3852 - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array('0', $selection, true))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_type() { - $key = 'filter_type'; - $selection = $this->args->{$key}; - - // get configured types and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_cfg->type_labels); - - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array(self::ANY, $selection))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_spec_type() { - $key = 'filter_spec_type'; - $selection = $this->args->{$key}; - - // get configured types and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_spec_cfg->type_labels); - - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array(self::ANY, $selection))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_coverage() { - - $key = 'filter_coverage'; - $this->filters[$key] = false; - $this->active_filters[$key] = null; - - // is coverage management enabled? - if ($this->configuration->req_cfg->expected_coverage_management) { - $selection = $this->args->{$key}; - - if (!$selection || !is_numeric($selection) || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - } // end of method - - /** - * - */ - private function init_filter_relation() { - - $key = 'filter_relation'; - - // are relations enabled? - if ($this->configuration->req_cfg->relations->enable) { - $selection = $this->args->{$key}; - - if (!$this->req_mgr) { - $this->req_mgr = new requirement_mgr($this->db); - } - - $req_relations = $this->req_mgr->init_relation_type_select(); - - // special case here: - // for equal type relations (where it doesn't matter if we find source or destination) - // we have to remove the source identficator from the array key - foreach ($req_relations['equal_relations'] as $array_key => $old_key) - { - // set new key in array and delete old one - $new_key = (int) str_replace("_source", "", $old_key); - $req_relations['items'][$new_key] = $req_relations['items'][$old_key]; - unset($req_relations['items'][$old_key]); - } - - $items = array(self::ANY => $this->option_strings['any']) + - (array) $req_relations['items']; - - if (!$selection || $this->args->reset_filters || - (is_array($selection) && in_array(self::ANY, $selection))) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, - 'items' => $items); - $this->active_filters[$key] = $selection; - } else { - // not enabled, just nullify - $this->filters[$key] = false; - $this->active_filters[$key] = null; - } - } // end of method - - /** - * - */ - private function init_filter_tc_id() - { - $key = 'filter_tc_id'; - $selection = $this->args->{$key}; - - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - - $tc_cfg = config_get('testcase_cfg'); - $tc_prefix = $this->testproject_mgr->getTestCasePrefix($this->args->testproject_id); - $tc_prefix .= $tc_cfg->glue_character; - - if (!$selection || $selection == $tc_prefix || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection ? $selection : $tc_prefix); - $this->active_filters[$key] = $selection; - } // end of method - - - /** - * - */ - protected function getCustomFields() - { - if (!$this->req_mgr) - { - $this->req_mgr = new requirement_mgr($this->db); - $this->cfield_mgr = &$this->req_mgr->cfield_mgr; - } - - $cfields = $this->req_mgr->get_linked_cfields(null, null, $this->args->testproject_id); - return $cfields; - } - -} // end of class \ No newline at end of file + array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_title' => array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_status' => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + 'filter_type' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_spec_type' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_coverage' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_relation' => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + 'filter_tc_id' => array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_custom_fields' => null, + 'filter_result' => false + ); + + /** + * This array contains all possible settings. + * It is used as a helper + * to later iterate over all possibilities in loops. + * Its keys are the names of the settings, its values the arrays for the input parser. + * + * @var array + */ + private $all_settings = array( + 'setting_refresh_tree_on_action' => array( + "POST", + tlInputParameter::CB_BOOL + ) + ); + + /** + */ + public function __construct(&$dbHandler) + { + // Call to constructor of parent class tlFilterControl. + // This already loads configuration and user input + // and does all the remaining necessary method calls, + // so no further method call is required here for initialization. + parent::__construct($dbHandler); + $this->req_mgr = new requirement_mgr($this->db); + + // ATTENTION if you do not see it when debugging, can be because + // has been declared as PROTECTED + $this->cfield_mgr = &$this->req_mgr->cfield_mgr; + + // moved here from parent::__constructor() to be certain that + // all required objects has been created + $this->init_filters(); + } + + public function __destruct() + { + parent::__destruct(); // destroys testproject manager + + // destroy member objects + unset($this->req_mgr); + } + + protected function read_config() + { + // some configuration reading already done in parent class + parent::read_config(); + + // load configuration for requirement filters + $this->configuration = config_get('tree_filter_cfg')->requirements; + + // load req and req spec config (for types, filters, status, ...) + $this->configuration->req_cfg = config_get('req_cfg'); + $this->configuration->req_spec_cfg = config_get('req_spec_cfg'); + + // is choice of advanced filter mode enabled? + $this->filter_mode_choice_enabled = false; + if ($this->configuration->advanced_filter_mode_choice) { + $this->filter_mode_choice_enabled = true; + } + + return tl::OK; + } + + protected function init_args() + { + // some common user input is already read in parent class + parent::init_args(); + + // add settings and filters to parameter info array for request parsers + $params = array(); + foreach ($this->all_settings as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; + } + } + + foreach ($this->all_filters as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; + } + } + I_PARAMS($params, $this->args); + } + + /** + * Initializes the class member array for settings + * according to the data loaded from database and user input. + * Only initializes active settings, for a better performance. + * If no settings are active, the complete panel will be disabled and not be displayed. + */ + protected function init_settings() + { + foreach ($this->all_settings as $name => $info) { + $init_method = "init_$name"; + if (method_exists($this, $init_method)) { + // is valid, configured, exists and therefore can be used, so initialize this setting + $this->$init_method(); + $this->display_req_settings = true; + } else { + // is not needed, simply deactivate it by setting it to false in main array + $this->settings[$name] = false; + } + } + + // add the important settings to active filter array + foreach ($this->all_settings as $name => $info) { + if ($this->settings[$name]) { + $this->active_filters[$name] = $this->settings[$name]['selected']; + } else { + $this->active_filters[$name] = null; + } + } + } + + /** + * Initializes the class member array for filters + * according to the data loaded from database and user input. + * Only initializes filters which are still enabled and active, for a better performance. + * If no filters are active at all, the filters panel will be disabled and not displayed. + */ + protected function init_filters() + { + // iterate through all filters and activate the needed ones + if ($this->configuration->show_filters == ENABLED) { + foreach ($this->all_filters as $name => $info) { + $init_method = "init_$name"; + if (method_exists($this, $init_method) && + $this->configuration->{$name} == ENABLED) { + $this->$init_method(); + $this->display_req_filters = true; + } else { + // is not needed, deactivate filter by setting it to false in main array + // and of course also in active filters array + $this->filters[$name] = false; + $this->active_filters[$name] = null; + } + } + } else { + $this->display_req_filters = false; + } + } + + /** + * Returns the filter array with necessary data, + * ready to be processed/used by underlying filter functions in + * requirement tree generator function. + */ + protected function get_active_filters() + { + return $this->active_filters; + } + + /** + * Build the tree menu for generation of JavaScript tree of requirements. + * Depending on user selections in graphical user interface, + * either a completely filtered tree will be built and returned, + * or only the minimal necessary data to "lazy load" the objects in tree by later Ajax calls. + * + * @param object $gui + * Reference to GUI object (information will be written to it) + * @return object $tree_menu Tree object for display of JavaScript tree menu. + */ + public function build_tree_menu(&$gui) + { + $tree_menu = null; + $filters = $this->get_active_filters(); + $options = null; + $loader = ''; + $children = "[]"; + + // enable drag and drop + $drag_and_drop = new stdClass(); + $drag_and_drop->enabled = true; + $drag_and_drop->BackEndUrl = $gui->basehref . + 'lib/ajax/dragdroprequirementnodes.php'; + $drag_and_drop->useBeforeMoveNode = true; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + // when we use filtering, the tree will be statically built, + // otherwise it will be lazy loaded + if ($this->do_filtering) { + $options = array( + 'for_printing' => NOT_FOR_PRINTING, + 'exclude_branches' => null + ); + + $tree_menu = generate_reqspec_tree($this->db, $this->testproject_mgr, + $this->args->testproject_id, $this->args->testproject_name, + $filters, $options); + + $root_node = $tree_menu->rootnode; + $root_node->name .= " ({$root_node->total_req_count})"; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + $drag_and_drop->enabled = false; + } else { + $loader = $gui->basehref . + 'lib/ajax/getrequirementnodes.php?mode=reqspec&' . + "root_node={$this->args->testproject_id}"; + + $req_qty = count( + $this->testproject_mgr->get_all_requirement_ids( + $this->args->testproject_id)); + + $root_node = new stdClass(); + $root_node->href = "javascript:TPROJECT_REQ_SPEC_MGMT({$this->args->testproject_id})"; + $root_node->id = $this->args->testproject_id; + $root_node->name = $this->args->testproject_name . " ($req_qty)"; + $root_node->testlink_node_type = 'testproject'; + } + + $gui->ajaxTree = new stdClass(); + $gui->ajaxTree->loader = $loader; + $gui->ajaxTree->root_node = $root_node; + $gui->ajaxTree->children = $children; + $gui->ajaxTree->dragDrop = $drag_and_drop; + $gui->ajaxTree->cookiePrefix = 'req_specification_tproject_id_' . + $root_node->id . "_"; + } + + /** + */ + public function init_setting_refresh_tree_on_action() + { + $key = 'setting_refresh_tree_on_action'; + $hidden_key = 'hidden_setting_refresh_tree_on_action'; + $selection = 0; + + $this->settings[$key] = array(); + $this->settings[$key][$hidden_key] = 0; + + // look where we can find the setting - POST, SESSION, config? + if (isset($this->args->{$key})) { + $selection = 1; + } elseif (isset($this->args->{$hidden_key})) { + $selection = 0; + } elseif (isset($_SESSION[$key])) { + $selection = $_SESSION[$key]; + } else { + $selection = ($this->configuration->automatic_tree_refresh == ENABLED) ? 1 : 0; + } + + $this->settings[$key]['selected'] = $selection; + $this->settings[$key][$hidden_key] = $selection; + $_SESSION[$key] = $selection; + } + + /** + */ + public function init_filter_doc_id() + { + $key = 'filter_doc_id'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + public function init_filter_title() + { + $key = 'filter_title'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + public function init_filter_status() + { + $key = 'filter_status'; + $selection = $this->args->{$key}; + + // get configured statuses and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_cfg->status_labels); + + // BUGID 3852 + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array('0', $selection, true))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_type() + { + $key = 'filter_type'; + $selection = $this->args->{$key}; + + // get configured types and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_cfg->type_labels); + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_spec_type() + { + $key = 'filter_spec_type'; + $selection = $this->args->{$key}; + + // get configured types and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_spec_cfg->type_labels); + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_coverage() + { + $key = 'filter_coverage'; + $this->filters[$key] = false; + $this->active_filters[$key] = null; + + // is coverage management enabled? + if ($this->configuration->req_cfg->expected_coverage_management) { + $selection = $this->args->{$key}; + + if (! $selection || ! is_numeric($selection) || + $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + } + + /** + */ + public function init_filter_relation() + { + $key = 'filter_relation'; + + // are relations enabled? + if ($this->configuration->req_cfg->relations->enable) { + $selection = $this->args->{$key}; + + if (! $this->req_mgr) { + $this->req_mgr = new requirement_mgr($this->db); + } + + $req_relations = $this->req_mgr->init_relation_type_select(); + + // special case here: + // for equal type relations (where it doesn't matter if we find source or destination) + // we have to remove the source identficator from the array key + foreach ($req_relations['equal_relations'] as $old_key) { + // set new key in array and delete old one + $new_key = (int) str_replace("_source", "", $old_key); + $req_relations['items'][$new_key] = $req_relations['items'][$old_key]; + unset($req_relations['items'][$old_key]); + } + + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) $req_relations['items']; + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } else { + // not enabled, just nullify + $this->filters[$key] = false; + $this->active_filters[$key] = null; + } + } + + /** + */ + public function init_filter_tc_id() + { + $key = 'filter_tc_id'; + $selection = $this->args->{$key}; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $tc_cfg = config_get('testcase_cfg'); + $tc_prefix = $this->testproject_mgr->getTestCasePrefix( + $this->args->testproject_id); + $tc_prefix .= $tc_cfg->glue_character; + + if (! $selection || $selection == $tc_prefix || + $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection ? $selection : $tc_prefix + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + protected function getCustomFields() + { + if (! $this->req_mgr) { + $this->req_mgr = new requirement_mgr($this->db); + $this->cfield_mgr = &$this->req_mgr->cfield_mgr; + } + + return $this->req_mgr->get_linked_cfields(null, null, + $this->args->testproject_id); + } +} diff --git a/lib/functions/tlRight.class.php b/lib/functions/tlRight.class.php index bb43e1d7d2..601362bf0b 100644 --- a/lib/functions/tlRight.class.php +++ b/lib/functions/tlRight.class.php @@ -1,212 +1,233 @@ -activateCaching = true; - } - - /** - * brings the object to a clean state - * - * @param integer $options any combination of TLOBJ_O_ Flags - */ - protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) - { - $this->name = null; - if (!($options & self::TLOBJ_O_SEARCH_BY_ID)) - { - $this->dbID = null; - } - } - - /** - * Magic function, called by PHP whenever a tlRight object should be printed - * - * @return string returns the name of the right - */ - public function __toString() - { - return $this->name; - } - - /** - * Initializes the right object - * - * @param integer $dbID the database id of the right - * @param string $name the name of the right - **/ - function initialize($dbID, $name) - { - $this->dbID = $dbID; - $this->name = $name; - } - - /* Copies a tlRole object from another - * - * @param $role tlRole the role which should be used to initialize this role - * - * @return integer always returns tl::OK - * @see lib/functions/tlDBObject#copyFromCache($object) - */ - public function copyFromCache($right) - { - $this->name = $right->name; - - return tl::OK; - } - /** - * Read a right object from the database - * - * @param resource &$db reference to database handler - * @param interger $option any combination of TLOBJ_O_ flags - * - * @return integer returns tl::OK on success, tl::ERROR else - */ - public function readFromDB(&$db,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - if ($this->readFromCache() >= tl::OK) - { - return tl::OK; - } - - $readSucceeded = tl::ERROR; - $this->_clean($options); - $query = $this->getReadFromDBQuery($this->dbID,$options); - - $info = $db->fetchFirstRow($query); - if ($info) - { - $readSucceeded = $this->readFromDBRow($info); - } - - if ($readSucceeded >= tl::OK) - { - $this->addToCache(); - } - - return $info ? tl::OK : tl::ERROR; - } - - /* Initializes a right object, from a single row read by a query obtained by getReadFromDBQuery - * @see lib/functions/iDBBulkReadSerialization#readFromDBRow($row) - * @param $row array map with keys 'id',description' - */ - public function readFromDBRow($row) - { - $this->initialize($row['id'],$row['description']); - - return tl::OK; - } - - /* Returns a query which can be used to read one or multiple rights from a db - * @param $ids array integer array of db ids (from rights) - * @param integer $options any combination of TLOBJ_O_ Flags - * @see lib/functions/iDBBulkReadSerialization#getReadFromDBQuery($ids, $options) - */ - public function getReadFromDBQuery($ids,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - $tables = tlObject::getDBTables('rights'); - $query = "SELECT id,description FROM {$tables['rights']} "; - - $clauses = null; - if ($options & self::TLOBJ_O_SEARCH_BY_ID) - { - if (!is_array($ids)) - { - $clauses[] = "id = {$ids}"; - } - else - { - $clauses[] = "id IN (".implode(",",$ids).")"; - } - } - - if ($clauses) - { - $query .= " WHERE " . implode(" AND ",$clauses); - } - return $query; - } - - /** - * Get a right by its database id - * - * @param resource &$db reference to database handler - * @param integer $id the database identifier - * @param integer $detailLevel the detail level, any combination TLOBJ_O_GET_DETAIL_ flags - * - * @return tlRight returns the create right or null - */ - static public function getByID(&$db,$id,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return tlDBObject::createObjectFromDB($db,$id,__CLASS__,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - } - - /** - * Get multiple rights by their database ids - * - * @param resource &$db reference to database handler - * @param array $ids the database identifier - * @param integer $detailLevel the detail level, any combination TLOBJ_O_GET_DETAIL_ flags - * - * @return tlRight returns the create right or null - */ - static public function getByIDs(&$db,$ids,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return tlDBObject::createObjectsFromDB($db,$ids,__CLASS__,false,$detailLevel); - } - - /** - * @param resource &$db reference to database handler - **/ - static public function getAll(&$db,$whereClause = null,$column = null, - $orderBy = null,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - $tables = tlObject::getDBTables('rights'); - $sql = " SELECT id FROM {$tables['rights']} "; - if (!is_null($whereClause)) - { - $sql .= ' ' . $whereClause; - } - $sql .= is_null($orderBy) ? " ORDER BY id ASC " : $orderBy; - return tlDBObject::createObjectsFromDBbySQL($db,$sql,'id',__CLASS__,true,$detailLevel); - } - - /** - * @param resource &$db reference to database handler - **/ - public function writeToDB(&$db) - { - //@TODO schlundus, now i removed the potentially modified object from the cache - //another optimization could be read the new contents if storing was successfully into the - //cache - $this->removeFromCache(); - return self::handleNotImplementedMethod(__FUNCTION__); - } - - /** - * @param resource &$db reference to database handler - **/ - public function deleteFromDB(&$db) - { - $this->removeFromCache(); - return self::handleNotImplementedMethod(__FUNCTION__); - } -} -?> \ No newline at end of file +activateCaching = true; + } + + /** + * brings the object to a clean state + * + * @param integer $options + * any combination of TLOBJ_O_ Flags + */ + protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->name = null; + if (! ($options & self::TLOBJ_O_SEARCH_BY_ID)) { + $this->dbID = null; + } + } + + /** + * Magic function, called by PHP whenever a tlRight object should be printed + * + * @return string returns the name of the right + */ + public function __toString() + { + return $this->name; + } + + /** + * Initializes the right object + * + * @param integer $dbID + * the database id of the right + * @param string $name + * the name of the right + */ + private function initialize($dbID, $name) + { + $this->dbID = $dbID; + $this->name = $name; + } + + /* + * Copies a tlRole object from another + * + * @param $role tlRole the role which should be used to initialize this role + * + * @return integer always returns tl::OK + * @see lib/functions/tlDBObject#copyFromCache($object) + */ + public function copyFromCache($right) + { + $this->name = $right->name; + + return tl::OK; + } + + /** + * Read a right object from the database + * + * @param + * resource &$db reference to database handler + * @param integer $option + * any combination of TLOBJ_O_ flags + * + * @return integer returns tl::OK on success, tl::ERROR else + */ + public function readFromDB(&$db, $options = self::TLOBJ_O_SEARCH_BY_ID) + { + if ($this->readFromCache() >= tl::OK) { + return tl::OK; + } + + $readSucceeded = tl::ERROR; + $this->_clean($options); + $query = $this->getReadFromDBQuery($this->dbID, $options); + + $info = $db->fetchFirstRow($query); + if ($info) { + $readSucceeded = $this->readFromDBRow($info); + } + + if ($readSucceeded >= tl::OK) { + $this->addToCache(); + } + + return $info ? tl::OK : tl::ERROR; + } + + /* + * Initializes a right object, from a single row read by a query obtained by getReadFromDBQuery + * @see lib/functions/iDBBulkReadSerialization#readFromDBRow($row) + * @param $row array map with keys 'id',description' + */ + public function readFromDBRow($row) + { + $this->initialize($row['id'], $row['description']); + + return tl::OK; + } + + /* + * Returns a query which can be used to read one or multiple rights from a db + * @param $ids array integer array of db ids (from rights) + * @param integer $options any combination of TLOBJ_O_ Flags + * @see lib/functions/iDBBulkReadSerialization#getReadFromDBQuery($ids, $options) + */ + public function getReadFromDBQuery($ids, + $options = self::TLOBJ_O_SEARCH_BY_ID) + { + $tables = tlObject::getDBTables('rights'); + $query = "SELECT id,description FROM {$tables['rights']} "; + + $clauses = null; + if ($options & self::TLOBJ_O_SEARCH_BY_ID) { + if (! is_array($ids)) { + $clauses[] = "id = {$ids}"; + } else { + $clauses[] = "id IN (" . implode(",", $ids) . ")"; + } + } + + if ($clauses) { + $query .= " WHERE " . implode(" AND ", $clauses); + } + return $query; + } + + /** + * Get a right by its database id + * + * @param + * resource &$db reference to database handler + * @param integer $id + * the database identifier + * @param integer $detailLevel + * the detail level, any combination TLOBJ_O_GET_DETAIL_ flags + * + * @return tlRight returns the create right or null + */ + public static function getByID(&$db, $id, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectFromDB($db, $id, __CLASS__, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + } + + /** + * Get multiple rights by their database ids + * + * @param + * resource &$db reference to database handler + * @param array $ids + * the database identifier + * @param integer $detailLevel + * the detail level, any combination TLOBJ_O_GET_DETAIL_ flags + * + * @return tlRight returns the create right or null + */ + public static function getByIDs(&$db, $ids, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectsFromDB($db, $ids, __CLASS__, false, + $detailLevel); + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public static function getAll(&$db, $whereClause = null, $column = null, + $orderBy = null, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $tables = tlObject::getDBTables('rights'); + $sql = " SELECT id FROM {$tables['rights']} "; + if (! is_null($whereClause)) { + $sql .= ' ' . $whereClause; + } + $sql .= is_null($orderBy) ? " ORDER BY id ASC " : $orderBy; + return tlDBObject::createObjectsFromDBbySQL($db, $sql, 'id', __CLASS__, + true, $detailLevel); + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public function writeToDB(&$db) + { + // @TODO schlundus, now i removed the potentially modified object from the cache + // another optimization could be read the new contents if storing was successfully into the + // cache + $this->removeFromCache(); + return self::handleNotImplementedMethod(__FUNCTION__); + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public function deleteFromDB(&$db) + { + $this->removeFromCache(); + return self::handleNotImplementedMethod(__FUNCTION__); + } +} +?> diff --git a/lib/functions/tlRole.class.php b/lib/functions/tlRole.class.php index 9e2e854898..31f9d2755d 100644 --- a/lib/functions/tlRole.class.php +++ b/lib/functions/tlRole.class.php @@ -1,548 +1,570 @@ -object_table = $this->tables['roles']; - $this->replacementRoleID = config_get('role_replace_for_deleted_roles'); - $this->activateCaching = true; - } - - /* Used to clean up the tlRole object - * - * @param $options array any combination of TLOBJ_O_SEARCH_BY_ID or ROLE_O_SEARCH_BYNAME - * - * @return integer always returns tl::OK - * - * @see lib/functions/tlObject#_clean() - */ - protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) - { - $this->description = null; - $this->rights = null; - if (!($options & self::ROLE_O_SEARCH_BYNAME)) - { - $this->name = null; - } - if (!($options & self::TLOBJ_O_SEARCH_BY_ID)) - { - $this->dbID = null; - } - - return tl::OK; - } - - /* Copies a tlRole object from another - * - * @param $role tlRole the role which should be used to initialize this role - * - * @return integer always returns tl::OK - * @see lib/functions/tlDBObject#copyFromCache($object) - */ - public function copyFromCache($role) - { - $this->description = $role->description; - $this->rights = $role->rights; - $this->name = $role->name; - - return tl::OK; - } - - /* Read a role from the database - * @param $db resource [ref] the database connection - * @param $options integer any combination of TLOBJ_O_ or ROLE_O - Flags - * - * @return integer returns tl::OK on success, tl::ERROR else - * - * @see lib/functions/iDBSerialization#readFromDB($db, $options) - */ - public function readFromDB(&$db,$options = self::TLOBJ_O_SEARCH_BY_ID) - { - if ($this->readFromCache() >= tl::OK) - { - return tl::OK; - } - - $this->_clean($options); - $getFullDetails = ($this->detailLevel & self::TLOBJ_O_GET_DETAIL_RIGHTS); - $sql = "SELECT a.id AS role_id,a.description AS role_desc, a.notes "; - if ($getFullDetails) - { - $sql .= " ,c.id AS right_id,c.description "; - } - - $sql .= " FROM {$this->object_table} a "; - - if ($getFullDetails) - { - $sql .= " LEFT OUTER JOIN {$this->tables['role_rights']} b ON a.id = b.role_id " . - " LEFT OUTER JOIN {$this->tables['rights']} c ON b.right_id = c.id "; - } - - $clauses = null; - if ($options & self::ROLE_O_SEARCH_BYNAME) - { - $clauses[] = "a.description = '".$db->prepare_string($this->name)."'"; - } - - if ($options & self::TLOBJ_O_SEARCH_BY_ID) - { - $clauses[] = "a.id = {$this->dbID}"; - } - - if ($clauses) - { - $sql .= " WHERE " . implode(" AND ",$clauses); - } - - $rightInfo = $db->get_recordset($sql); - if ($rightInfo) - { - $this->dbID = $rightInfo[0]['role_id']; - $this->name = $rightInfo[0]['role_desc']; - $this->description = $rightInfo[0]['notes']; - - if ($getFullDetails) - { - $this->rights = $this->buildRightsArray($rightInfo); - } - } - - $readSucceeded = $rightInfo ? tl::OK : tl::ERROR; - if ($readSucceeded >= tl::OK) - { - $this->addToCache(); - } - - return $readSucceeded; - } - - /** - * @param resource &$db reference to database handler - **/ - public function writeToDB(&$db) { - //@TODO schlundus, now i removed the potentially modified object from the cache - //another optimization could be: read the new contents if storing was successfully into the - //cache - $this->removeFromCache(); - - $result = $this->checkDetails($db); - - if ($result >= tl::OK) { - if ($this->dbID) { - $result = $this->deleteRightsFromDB($db); - if ($result >= tl::OK) { - $sql = "UPDATE {$this->object_table} " . - " SET description = '".$db->prepare_string($this->name)."',". - " notes ='".$db->prepare_string($this->description)."'". - " WHERE id = {$this->dbID}"; - $result = $db->exec_query($sql); - } - } else { - $sql = "INSERT INTO {$this->object_table} (description,notes) " . - " VALUES ('".$db->prepare_string($this->name)."',". - "'" . $db->prepare_string($this->description)."')"; - $result = $db->exec_query($sql); - if($result) { - $this->dbID = $db->insert_id($this->object_table); - } - } - - $result = $result ? tl::OK : self::E_DBERROR; - if ($result >= tl::OK) { - $result = $this->addRightsToDB($db); - } - } - - return $result; - } - - /** - * @param resource &$db reference to database handler - **/ - public function checkDetails(&$db) { - $this->name = trim($this->name); - $this->description = trim($this->description); - - $result = tl::OK; - if (!sizeof($this->rights)) { - $result = self::E_EMPTYROLE; - } - - if ($result >= tl::OK) { - $result = self::checkRoleName($this->name); - } - - if ($result >= tl::OK) { - $result = self::doesRoleExist($db,$this->name,$this->dbID) ? self::E_NAMEALREADYEXISTS : tl::OK; - } - - return $result; - } - - /** - * @param resource &$db reference to database handler - **/ - static public function doesRoleExist(&$db,$name,$id) - { - $role = new tlRole(); - $role->name = $name; - if ($role->readFromDB($db,self::ROLE_O_SEARCH_BYNAME) >= tl::OK && $role->dbID != $id) - { - return $role->dbID; - } - return null; - } - - static public function checkRoleName($name) - { - return is_blank($name) ? self::E_NAMELENGTH : tl::OK; - } - - /** - * - */ - public function getDisplayName() - { - $displayName = $this->name; - if ($displayName[0] == "<") { - $roleName = str_replace(" ","_",substr($displayName,1,-1)); - $displayName = "<".lang_get($roleName).">"; - } - return $displayName; - } - - /** - * @param resource &$db reference to database handler - **/ - public function deleteFromDB(&$db) - { - $this->removeFromCache(); - - $result = $this->deleteRightsFromDB($db); - if ($result >= tl::OK) - { - //reset all affected users by replacing the deleted role with configured role - $this->replaceUserRolesWith($db,$this->replacementRoleID); - - $sql = "DELETE FROM {$this->object_table} WHERE id = {$this->dbID}"; - $result = $db->exec_query($sql) ? tl::OK : tl::ERROR; - } - return $result; - } - - /** - * @param resource &$db reference to database handler - **/ - protected function replaceUserRolesWith(&$db,$newRole) - { - $result = true; - $tables = array('users','user_testproject_roles','user_testplan_roles'); - foreach($tables as $table) - { - $sql = "UPDATE {$this->tables[$table]} SET role_id = {$newRole} WHERE role_id = {$this->dbID}"; - $result = $result && ($db->exec_query($sql) ? true : false); - } - return $result ? tl::OK : tl::ERROR; - } - - /** - * Gets all users with a certain global role - * - * @param resource &$db reference to database handler - * @return array assoc map with the user ids as the keys - **/ - public function getUsersWithGlobalRole(&$db,$opt=null) - { - $idSet = $this->getUserIDsWithGlobalRole($db,$opt); - return self::createObjectsFromDB($db,$idSet,"tlUser",true,self::TLOBJ_O_GET_DETAIL_MINIMUM); - } - - /** - * Gets all userids of users with a certain global role @TODO WRITE RIGHT COMMENTS FROM START - * - * @param resource &$db reference to database handler - * @return array of userids - **/ - protected function getUserIDsWithGlobalRole(&$db,$opt=null) - { - $my['opt'] = array('active' => -1); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $sql = "SELECT id FROM {$this->tables['users']} " . - " WHERE role_id = {$this->dbID}"; - - if($my['opt']['active'] != -1) - { - $sql .= ' and active = ' . (intval($my['opt']['active']) > 0 ? 1 : 0); - } - - $idSet = $db->fetchColumnsIntoArray($sql,"id"); - return $idSet; - } - - /** - * Gets all userids of users with a certain testproject role @TODO WRITE RIGHT COMMENTS FROM START - * - * @param resource &$db reference to database handler - * @return array returns array of userids - **/ - protected function getUserIDsWithTestProjectRole(&$db) - { - $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . - " {$this->tables['user_testproject_roles']} user_testproject_roles " . - " WHERE users.id = user_testproject_roles.user_id"; - $sql .= " AND user_testproject_roles.role_id = {$this->dbID} "; - $idSet = $db->fetchColumnsIntoArray($sql,"id"); - - return $idSet; - } - - /** - * Gets all userids of users with a certain testplan role @TODO WRITE RIGHT COMMENTS FROM START - * - * @param resource &$db reference to database handler - * @return array returns array of userids - **/ - protected function getUserIDsWithTestPlanRole(&$db) - { - $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . - " {$this->tables['user_testplan_roles']} user_testplan_roles " . - " WHERE users.id = user_testplan_roles.user_id"; - $sql .= " AND user_testplan_roles.role_id = {$this->dbID}"; - $idSet = $db->fetchColumnsIntoArray($sql,"id"); - - return $idSet; - } - - - /** - * Gets all users with a certain testproject role - * - * @param resource &$db reference to database handler - * @return array returns assoc map with the userids as the keys - **/ - protected function getUsersWithTestProjectRole(&$db) - { - $idSet = $this->getUserIDsWithTestProjectRole($db); - return self::createObjectsFromDB($db,$idSet,"tlUser",true,self::TLOBJ_O_GET_DETAIL_MINIMUM); - } - - - /** - * Gets all users with a certain testplan role - * - * @param resource &$db reference to database handler - * @return array returns assoc map with the userids as the keys - **/ - protected function getUsersWithTestPlanRole(&$db) - { - $idSet = $this->getUserIDsWithTestPlanRole($db); - return self::createObjectsFromDB($db,$idSet,"tlUser",true,self::TLOBJ_O_GET_DETAIL_MINIMUM); - } - - - /** - * Gets all users which have a certain global,testplan or testproject role - * - * @param resource &$db reference to database handler - * @return array returns assoc map with the userids as the keys - **/ - public function getAllUsersWithRole(&$db) - { - $global_users = $this->getUserIDsWithGlobalRole($db); - $tplan_users = $this->getUserIDsWithTestPlanRole($db); - $tproject_users = $this->getUserIDsWithTestProjectRole($db); - - $affectedUsers = (array)$global_users + (array)$tplan_users + (array)$tproject_users; - $affectedUsers = array_unique($affectedUsers); - return self::createObjectsFromDB($db,$affectedUsers,"tlUser",true,self::TLOBJ_O_GET_DETAIL_MINIMUM); - } - - /* - check if a role has requested right - - @param string $rightName the name of the right to check - - @return bool returns true if present, false else - */ - public function hasRight($rightName) - { - $roleRights = (array)$this->rights; - $rights = array(); - $needle = trim($rightName); - foreach($roleRights as $right) { - if (strcasecmp(trim($right->name),$needle) == 0 ) { - return true; - } - } - return false; - } - - /** - * Delete the rights of a role from the db - * - * @param resource &$db reference to database handler - * @return returns tl::OK on success, tl::ERROR else - */ - protected function deleteRightsFromDB(&$db) - { - $tablename = $this->tables['role_rights']; - $sql = "DELETE FROM {$tablename} WHERE role_id = {$this->dbID}"; - $result = $db->exec_query($sql); - - return $result ? tl::OK : tl::ERROR; - } - - /** - * - * - */ - protected function addRightsToDB(&$db) { - $status_ok = 1; - if ($this->rights) { - foreach($this->rights as $right) { - $rightID = $right->dbID; - $sql = "INSERT INTO {$this->tables['role_rights']} (role_id,right_id) " . - "VALUES ({$this->dbID},{$rightID})"; - - $status_ok = $status_ok && ($db->exec_query($sql) ? 1 : 0); - } - } - return $status_ok ? tl::OK : tl::ERROR; - } - - /** - * - * - */ - protected function readRights(&$db) { - $sql = "SELECT right_id,description FROM {$this->tables['role_rights']} a " . - "JOIN {$this->tables['rights']} b ON a.right_id = b.id " . - "WHERE role_id = {$this->dbID}"; - $rightInfo = $db->get_recordset($sql); - $this->rights = buildRightsArray($rightInfo); - - return tl::OK; - } - - protected function buildRightsArray($rightInfo) - { - $rights = null; - for($i = 0;$i < sizeof($rightInfo);$i++) - { - $id = $rightInfo[$i]; - $right = new tlRight($id['right_id']); - $right->name = $id['description']; - $rights[] = $right; - } - return $rights; - } - - static public function getByID(&$db,$id,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return tlDBObject::createObjectFromDB($db,$id,__CLASS__,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - } - - static public function getAll(&$db,$whereClause = null,$column = null, - $orderBy = null,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - $tables = tlObject::getDBTables("roles"); - $sql = "SELECT id FROM {$tables['roles']} "; - if (!is_null($whereClause)) - $sql .= ' '.$whereClause; - $sql .= is_null($orderBy) ? " ORDER BY id ASC " : $orderBy; - - $roles = tlDBObject::createObjectsFromDBbySQL($db,$sql,'id',__CLASS__,true,$detailLevel); - - $inheritedRole = new tlRole(TL_ROLES_INHERITED); - $inheritedRole->name = ""; - $roles[TL_ROLES_INHERITED] = $inheritedRole; - - return $roles; - } - - static public function getByIDs(&$db,$ids,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - return self::handleNotImplementedMethod(__FUNCTION__); - } - - - /** - * get roles present on system and return map with colour associations - * if there is no colour configured for role '' is returned as colour. - * - */ - static public function getRoleColourCfg(&$db) - { - $role_colour = config_get('role_colour'); - $tables = tlObject::getDBTables("roles"); - $sql = "SELECT description FROM {$tables['roles']} "; - $roles = $db->fetchColumnsIntoArray($sql,"description"); - foreach($roles as $description) - { - if(!isset($role_colour[$description])) - { - $role_colour[$description] = ''; - } - } - return $role_colour; - } -} +object_table = $this->tables['roles']; + $this->replacementRoleID = config_get('role_replace_for_deleted_roles'); + $this->activateCaching = true; + } + + /* + * Used to clean up the tlRole object + * + * @param $options array any combination of TLOBJ_O_SEARCH_BY_ID or ROLE_O_SEARCH_BYNAME + * + * @return integer always returns tl::OK + * + * @see lib/functions/tlObject#_clean() + */ + protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->description = null; + $this->rights = null; + if (! ($options & self::ROLE_O_SEARCH_BYNAME)) { + $this->name = null; + } + if (! ($options & self::TLOBJ_O_SEARCH_BY_ID)) { + $this->dbID = null; + } + + return tl::OK; + } + + /* + * Copies a tlRole object from another + * + * @param $role tlRole the role which should be used to initialize this role + * + * @return integer always returns tl::OK + * @see lib/functions/tlDBObject#copyFromCache($object) + */ + public function copyFromCache($role) + { + $this->description = $role->description; + $this->rights = $role->rights; + $this->name = $role->name; + + return tl::OK; + } + + /* + * Read a role from the database + * @param $db resource [ref] the database connection + * @param $options integer any combination of TLOBJ_O_ or ROLE_O - Flags + * + * @return integer returns tl::OK on success, tl::ERROR else + * + * @see lib/functions/iDBSerialization#readFromDB($db, $options) + */ + public function readFromDB(&$db, $options = self::TLOBJ_O_SEARCH_BY_ID) + { + if ($this->readFromCache() >= tl::OK) { + return tl::OK; + } + + $this->_clean($options); + $getFullDetails = ($this->detailLevel & self::TLOBJ_O_GET_DETAIL_RIGHTS); + $sql = "SELECT a.id AS role_id,a.description AS role_desc, a.notes "; + if ($getFullDetails) { + $sql .= " ,c.id AS right_id,c.description "; + } + + $sql .= " FROM {$this->object_table} a "; + + if ($getFullDetails) { + $sql .= " LEFT OUTER JOIN {$this->tables['role_rights']} b ON a.id = b.role_id " . + " LEFT OUTER JOIN {$this->tables['rights']} c ON b.right_id = c.id "; + } + + $clauses = null; + if ($options & self::ROLE_O_SEARCH_BYNAME) { + $clauses[] = "a.description = '" . $db->prepare_string($this->name) . + "'"; + } + + if ($options & self::TLOBJ_O_SEARCH_BY_ID) { + $clauses[] = "a.id = {$this->dbID}"; + } + + if ($clauses) { + $sql .= " WHERE " . implode(" AND ", $clauses); + } + + $rightInfo = $db->get_recordset($sql); + if ($rightInfo) { + $this->dbID = $rightInfo[0]['role_id']; + $this->name = $rightInfo[0]['role_desc']; + $this->description = $rightInfo[0]['notes']; + + if ($getFullDetails) { + $this->rights = $this->buildRightsArray($rightInfo); + } + } + + $readSucceeded = $rightInfo ? tl::OK : tl::ERROR; + if ($readSucceeded >= tl::OK) { + $this->addToCache(); + } + + return $readSucceeded; + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public function writeToDB(&$db) + { + // @TODO schlundus, now i removed the potentially modified object from the cache + // another optimization could be: read the new contents if storing was successfully into the + // cache + $this->removeFromCache(); + + $result = $this->checkDetails($db); + + if ($result >= tl::OK) { + if ($this->dbID) { + $result = $this->deleteRightsFromDB($db); + if ($result >= tl::OK) { + $sql = "UPDATE {$this->object_table} " . + " SET description = '" . + $db->prepare_string($this->name) . "'," . " notes ='" . + $db->prepare_string($this->description) . "'" . + " WHERE id = {$this->dbID}"; + $result = $db->exec_query($sql); + } + } else { + $sql = "INSERT INTO {$this->object_table} (description,notes) " . + " VALUES ('" . $db->prepare_string($this->name) . "'," . "'" . + $db->prepare_string($this->description) . "')"; + $result = $db->exec_query($sql); + if ($result) { + $this->dbID = $db->insert_id($this->object_table); + } + } + + $result = $result ? tl::OK : self::E_DBERROR; + if ($result >= tl::OK) { + $result = $this->addRightsToDB($db); + } + } + + return $result; + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public function checkDetails(&$db) + { + $this->name = trim($this->name); + $this->description = trim($this->description); + + $result = tl::OK; + if (! count($this->rights)) { + $result = self::E_EMPTYROLE; + } + + if ($result >= tl::OK) { + $result = self::checkRoleName($this->name); + } + + if ($result >= tl::OK) { + $result = self::doesRoleExist($db, $this->name, $this->dbID) ? self::E_NAMEALREADYEXISTS : tl::OK; + } + + return $result; + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public static function doesRoleExist(&$db, $name, $id) + { + $role = new tlRole(); + $role->name = $name; + if ($role->readFromDB($db, self::ROLE_O_SEARCH_BYNAME) >= tl::OK && + $role->dbID != $id) { + return $role->dbID; + } + return null; + } + + public static function checkRoleName($name) + { + return isBlank($name) ? self::E_NAMELENGTH : tl::OK; + } + + /** + */ + public function getDisplayName() + { + $displayName = $this->name; + if ($displayName[0] == "<") { + $roleName = str_replace(" ", "_", substr($displayName, 1, - 1)); + $displayName = "<" . lang_get($roleName) . ">"; + } + return $displayName; + } + + /** + * + * @param + * resource &$db reference to database handler + */ + public function deleteFromDB(&$db) + { + $this->removeFromCache(); + + $result = $this->deleteRightsFromDB($db); + if ($result >= tl::OK) { + // reset all affected users by replacing the deleted role with configured role + $this->replaceUserRolesWith($db, $this->replacementRoleID); + + $sql = "DELETE FROM {$this->object_table} WHERE id = {$this->dbID}"; + $result = $db->exec_query($sql) ? tl::OK : tl::ERROR; + } + return $result; + } + + /** + * + * @param + * resource &$db reference to database handler + */ + protected function replaceUserRolesWith(&$db, $newRole) + { + $result = true; + $tables = array( + 'users', + 'user_testproject_roles', + 'user_testplan_roles' + ); + foreach ($tables as $table) { + $sql = "UPDATE {$this->tables[$table]} SET role_id = {$newRole} WHERE role_id = {$this->dbID}"; + $result = $result && ($db->exec_query($sql) ? true : false); + } + return $result ? tl::OK : tl::ERROR; + } + + /** + * Gets all users with a certain global role + * + * @param + * resource &$db reference to database handler + * @return array assoc map with the user ids as the keys + */ + public function getUsersWithGlobalRole(&$db, $opt = null) + { + $idSet = $this->getUserIDsWithGlobalRole($db, $opt); + return self::createObjectsFromDB($db, $idSet, "tlUser", true, + self::TLOBJ_O_GET_DETAIL_MINIMUM); + } + + /** + * Gets all userids of users with a certain global role @TODO WRITE RIGHT COMMENTS FROM START + * + * @param + * resource &$db reference to database handler + * @return array of userids + */ + protected function getUserIDsWithGlobalRole(&$db, $opt = null) + { + $my['opt'] = array( + 'active' => - 1 + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "SELECT id FROM {$this->tables['users']} " . + " WHERE role_id = {$this->dbID}"; + + if ($my['opt']['active'] != - 1) { + $sql .= ' and active = ' . (intval($my['opt']['active']) > 0 ? 1 : 0); + } + + return $db->fetchColumnsIntoArray($sql, "id"); + } + + /** + * Gets all userids of users with a certain testproject role @TODO WRITE RIGHT COMMENTS FROM START + * + * @param + * resource &$db reference to database handler + * @return array returns array of userids + */ + protected function getUserIDsWithTestProjectRole(&$db) + { + $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . + " {$this->tables['user_testproject_roles']} user_testproject_roles " . + " WHERE users.id = user_testproject_roles.user_id"; + $sql .= " AND user_testproject_roles.role_id = {$this->dbID} "; + return $db->fetchColumnsIntoArray($sql, "id"); + } + + /** + * Gets all userids of users with a certain testplan role @TODO WRITE RIGHT COMMENTS FROM START + * + * @param + * resource &$db reference to database handler + * @return array returns array of userids + */ + protected function getUserIDsWithTestPlanRole(&$db) + { + $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . + " {$this->tables['user_testplan_roles']} user_testplan_roles " . + " WHERE users.id = user_testplan_roles.user_id"; + $sql .= " AND user_testplan_roles.role_id = {$this->dbID}"; + return $db->fetchColumnsIntoArray($sql, "id"); + } + + /** + * Gets all users with a certain testproject role + * + * @param + * resource &$db reference to database handler + * @return array returns assoc map with the userids as the keys + */ + protected function getUsersWithTestProjectRole(&$db) + { + $idSet = $this->getUserIDsWithTestProjectRole($db); + return self::createObjectsFromDB($db, $idSet, "tlUser", true, + self::TLOBJ_O_GET_DETAIL_MINIMUM); + } + + /** + * Gets all users with a certain testplan role + * + * @param + * resource &$db reference to database handler + * @return array returns assoc map with the userids as the keys + */ + protected function getUsersWithTestPlanRole(&$db) + { + $idSet = $this->getUserIDsWithTestPlanRole($db); + return self::createObjectsFromDB($db, $idSet, "tlUser", true, + self::TLOBJ_O_GET_DETAIL_MINIMUM); + } + + /** + * Gets all users which have a certain global,testplan or testproject role + * + * @param + * resource &$db reference to database handler + * @return array returns assoc map with the userids as the keys + */ + public function getAllUsersWithRole(&$db) + { + $global_users = $this->getUserIDsWithGlobalRole($db); + $tplan_users = $this->getUserIDsWithTestPlanRole($db); + $tproject_users = $this->getUserIDsWithTestProjectRole($db); + + $affectedUsers = (array) $global_users + (array) $tplan_users + + (array) $tproject_users; + $affectedUsers = array_unique($affectedUsers); + return self::createObjectsFromDB($db, $affectedUsers, "tlUser", true, + self::TLOBJ_O_GET_DETAIL_MINIMUM); + } + + /* + * check if a role has requested right + * + * @param string $rightName the name of the right to check + * + * @return bool returns true if present, false else + */ + public function hasRight($rightName) + { + $roleRights = (array) $this->rights; + $needle = trim($rightName); + foreach ($roleRights as $right) { + if (strcasecmp(trim($right->name), $needle) == 0) { + return true; + } + } + return false; + } + + /** + * Delete the rights of a role from the db + * + * @param + * resource &$db reference to database handler + * @return int returns tl::OK on success, tl::ERROR else + */ + protected function deleteRightsFromDB(&$db) + { + $tablename = $this->tables['role_rights']; + $sql = "DELETE FROM {$tablename} WHERE role_id = {$this->dbID}"; + $result = $db->exec_query($sql); + + return $result ? tl::OK : tl::ERROR; + } + + /** + */ + protected function addRightsToDB(&$db) + { + $status_ok = 1; + if ($this->rights) { + foreach ($this->rights as $right) { + $rightID = $right->dbID; + $sql = "INSERT INTO {$this->tables['role_rights']} (role_id,right_id) " . + "VALUES ({$this->dbID},{$rightID})"; + + $status_ok = $status_ok && ($db->exec_query($sql) ? 1 : 0); + } + } + return $status_ok ? tl::OK : tl::ERROR; + } + + /** + */ + protected function readRights(&$db) + { + $sql = "SELECT right_id,description FROM {$this->tables['role_rights']} a " . + "JOIN {$this->tables['rights']} b ON a.right_id = b.id " . + "WHERE role_id = {$this->dbID}"; + $rightInfo = $db->get_recordset($sql); + $this->rights = buildRightsArray($rightInfo); + + return tl::OK; + } + + protected function buildRightsArray($rightInfo) + { + $rights = null; + for ($i = 0; $i < count($rightInfo); $i ++) { + $id = $rightInfo[$i]; + $right = new tlRight($id['right_id']); + $right->name = $id['description']; + $rights[] = $right; + } + return $rights; + } + + public static function getByID(&$db, $id, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectFromDB($db, $id, __CLASS__, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + } + + public static function getAll(&$db, $whereClause = null, $column = null, + $orderBy = null, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $tables = tlObject::getDBTables("roles"); + $sql = "SELECT id FROM {$tables['roles']} "; + if (! is_null($whereClause)) { + $sql .= ' ' . $whereClause; + } + $sql .= is_null($orderBy) ? " ORDER BY id ASC " : $orderBy; + + $roles = tlDBObject::createObjectsFromDBbySQL($db, $sql, 'id', __CLASS__, + true, $detailLevel); + + $inheritedRole = new tlRole(TL_ROLES_INHERITED); + $inheritedRole->name = ""; + $roles[TL_ROLES_INHERITED] = $inheritedRole; + + return $roles; + } + + public static function getByIDs(&$db, $ids, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return self::handleNotImplementedMethod(__FUNCTION__); + } + + /** + * get roles present on system and return map with colour associations + * if there is no colour configured for role '' is returned as colour. + */ + public static function getRoleColourCfg(&$db) + { + $role_colour = config_get('role_colour'); + $tables = tlObject::getDBTables("roles"); + $sql = "SELECT description FROM {$tables['roles']} "; + $roles = $db->fetchColumnsIntoArray($sql, "description"); + foreach ($roles as $description) { + if (! isset($role_colour[$description])) { + $role_colour[$description] = ''; + } + } + return $role_colour; + } +} ?> diff --git a/lib/functions/tlTestCaseFilterByRequirementControl.class.php b/lib/functions/tlTestCaseFilterByRequirementControl.class.php index 76ebd5253e..07dd97d4d3 100644 --- a/lib/functions/tlTestCaseFilterByRequirementControl.class.php +++ b/lib/functions/tlTestCaseFilterByRequirementControl.class.php @@ -1,1751 +1,1750 @@ - add/remove test cases - * - * - * @internal revisions - * @since 1.9.13 - */ - -/* - * -------------------------------------------------------- - * An important note on request-URL too large (BUGID 3516) - * -------------------------------------------------------- - * - * That problem has been solved by attaching some data (the set of active filters, settings and - * testcase IDs to show if filtering has been done) to session. - * - * Since a user can have the same feature open in multiple tabs, that alone is not enough to - * solve this issue. When a user opens e.g. the test case execution page and sets filter options - * there, then opens the same page in another tab, the data saved in session would also be - * applied to this second tab although no filter options have been set there yet by the user. - * - * This has now been solved by a so called form token. This token is, on first opening of a - * navigator frame, generated by the method generate_form_token() and then stored in a member - * variable with the name $form_token. This token will be stored in an identically named hidden - * input field within the HTML filter form, so it gets sent by POST to every called page. - * It is also attached to the GET argument string returned by get_argument_string() that gets - * passed to multiple JavaScript functions, which are used to open nodes from the tree in the - * left frame in a new page in the right frame. - * - * So the token is used to identify (from pages within the right frame) the data that got stored - * for them in session by the navigator page in the left frame. - * If the navigator page calls itself (when the user presses one of the submit buttons in the form), - * it sends the stored token via POST to itself. So the same token can be used again to store data - * in session, instead of generating a new token blindly on every page call no matter where the - * call comes from. But if the user opens a new tab, the new navigator page knows this because - * no token has been sent to it - so it generates a new one. - * - * - * The access to this data can be done in the following way from the right frame page: - * - * $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - * $mode = 'execution_mode'; - * $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) - * ? $_SESSION[$mode][$form_token] : null; - * - * The variable $session_data then holds the array with all the active filters, - * settings and filtered test case IDs in it, or is null if nothing has been stored yet - * in the session. - * - * But now we have another problem: - * There can be one array for each mode in the session. In each of these arrays is a set of - * further arrays with the form tokens as keys and the filter information in it. - * If a user now opens the same page more than once in a row (by switching back and forth - * between features or by using the same feature in multiple tabs) there can be more and more - * arrays with filter information in this set of arrays. - * - * Because of this, an additional timestamp is written into each of these information arrays. - * On each storage process that writes information into the session triggered by a call - * to a navigator page, the timestamp gets refreshed if an old token has been reused or - * it gets created with the creation of a new data array. - * - * This timestamp can be used to delete old arrays with information that is not needed anymore. - * Since we have no means to otherwise detect the case that a user has closed the tab - * and doesn't need this information in the session anymore, we have to determine the age of - * those arrays with the timestamp and delete everything that is older than a certain given - * threshold. This is done by the method delete_old_session_data() which is automatically called - * from the contstructor of this class. It checks the age of all the saved - * arrays inside the array for the active mode and then deletes everything that's older than - * the given threshold. This threshold can be passed as a parameter to the method, otherwise a - * default value of one hour is used. - * - * If a user logs out of TestLink, of course all this data in the session is deleted, - * no matter if the one hour threshold has passed or not. - * ------------------------------------------------------------------------------------------------ - */ - -/** - * This class extends tlFilterPanel for the specific use with the testcase tree. - * It contains logic to be used at GUI level to manage - * a common set of settings and filters for testcases. - * - * @author Andreas Simon - * @package TestLink - * @uses testplan - * @uses exec_cf_mgr - * @uses tlPlatform - * @uses testcase - */ -class tlTestCaseFilterByRequirementControl extends tlFilterControl { - - - public $req_mgr = null; - - /** - * Testcase manager object. - * Initialized not in constructor, only on first use to save resources. - * @var testcase - */ - private $tc_mgr = null; - - /** - * Platform manager object. - * Initialized not in constructor, only on first use to save resources. - * @var tlPlatform - */ - private $platform_mgr = null; - - /** - * Custom field manager object. - * Initialized not in constructor, only on first use to save resources. - * @var exec_cf_mgr - */ - //public $cfield_mgr = null; - - /** - * Testplan manager object. - * Initialized not in constructor, only on first use to save resources. - * @var testplan - */ - private $testplan_mgr = null; - - /** - * This array contains all possible filters. - * It is used as a helper to iterate over all the filters in some loops. - * It also sets options how and from where to load the parameters with - * input fetching functions in init_args()-method. - * Its keys are the names of the settings (class constants are used), - * its values are the arrays for the input parser. - * @var array - */ - - /* MAGIC NUMBERS are related to field size - * filter_tc_id: 0,30 arbitrary - * filter_bugs: 240 = 60 x 4 (60 bug_id size on execution_bugs table) - */ - private $all_filters = array('filter_doc_id' => array("POST", tlInputParameter::STRING_N), - 'filter_title' => array("POST", tlInputParameter::STRING_N), - 'filter_status' => array("POST", tlInputParameter::ARRAY_STRING_N), - 'filter_type' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_spec_type' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_coverage' => array("POST", tlInputParameter::INT_N), - 'filter_relation' => array("POST", tlInputParameter::ARRAY_STRING_N), - 'filter_tc_id' => array("POST", tlInputParameter::STRING_N), - 'filter_custom_fields' => null, 'filter_result' => false); - - - - /** - * This array is used as an additional security measure. It maps all available - * filters to the mode in which they can be used. If a user tries to - * enable filters in config.inc.php which are not defined inside this array, - * this will be simply ignored instead of trying to initialize the filter - * no matter wether it has been implemented or not. - * The keys inside this array are the modes defined above as class constants. - * So it can be checked if a filter is available in a given mode without - * relying only on the config parameter. - * @var array - */ - private $mode_filter_mapping = array('plan_add_mode' => array('filter_tc_id', - 'filter_testcase_name', - 'filter_toplevel_testsuite', - 'filter_keywords', - // 'filter_active_inactive', - 'filter_importance', - 'filter_execution_type', - 'filter_workflow_status', - 'filter_custom_fields')); - - /** - * This array contains all possible settings. It is used as a helper - * to later iterate over all possibilities in loops. - * Its keys are the names of the settings, its values the arrays for the input parser. - * @var array - */ - private $all_settings = array('setting_testplan' => array("REQUEST", tlInputParameter::INT_N), - 'setting_refresh_tree_on_action' => array("POST", tlInputParameter::CB_BOOL), - 'setting_get_parent_child_relation' => array("POST", tlInputParameter::CB_BOOL), - 'hidden_setting_get_parent_child_relation' => array("POST", tlInputParameter::INT_N), - 'setting_testsgroupby' => array("REQUEST", tlInputParameter::INT_N)); - - /** - * This array is used to map the modes to their available settings. - * @var array - */ - - private $mode_setting_mapping = array('plan_add_mode' => array('setting_testplan', - 'setting_refresh_tree_on_action', - 'setting_get_parent_child_relation', - 'hidden_setting_get_parent_child_relation', - 'setting_testsgroupby')); - - /** - * The mode used. Depending on the feature for which this class will be instantiated. - * This mode defines which filter configuration will be loaded from config.inc.php - * and therefore which filters will be loaded and used for the templates. - * Value has to be one of the class constants for mode, default is edit mode. - * @var string - */ - private $mode = 'plan_add_mode'; - - - /** - * Options to be used accordin to $this->mode, to build tree - * @var array - */ - private $treeOpt = array(); - - - /** - * The token that will be used to identify the relationship between left frame - * (with navigator) and right frame (which displays execution of test case e.g.) in session. - * @var string - */ - public $form_token = null; - - - - /** - * - * @param database $dbHandler - * @param string $mode can be plan_add_mode, depending on usage - */ - public function __construct(&$dbHandler, $mode = 'plan_add_mode') - { - // set mode to define further actions before calling parent constructor - $this->mode = array_key_exists($mode,$this->mode_filter_mapping) ? $mode : 'edit_mode'; - - // Call to constructor of parent class tlFilterControl. - // This already loads configuration and user input - // and does all the remaining necessary method calls, - // so no further method call is required here for initialization. - parent::__construct($dbHandler); - $this->req_mgr = new requirement_mgr($this->db); - $this->cfield_mgr = &$this->req_mgr->cfield_mgr; - - // moved here from parent::__constructor() to be certain that - // all required objects has been created - $this->init_filters(); - - $this->initTreeOptions($this->mode); - - // delete any filter settings that may be left from previous calls in session - // Session data has been designed to provide an unidirectional channel - // between the left pane where tree lives and right pane. - // That's why delete each time our OWN session data. - $this->delete_own_session_data(); - $this->delete_old_session_data(); - - $this->save_session_data(); - - } - - /** - * - * - */ - public function __destruct() - { - parent::__destruct(); //destroys testproject manager - - unset($this->tc_mgr); - unset($this->testplan_mgr); - unset($this->platform_mgr); - unset($this->cfield_mgr); - } - - /** - * Reads the configuration from the configuration file specific for test cases, - * additionally to those parts of the config which were already loaded by parent class. - * @return bool - */ - protected function read_config() - { - // some configuration reading already done in parent class - parent::read_config(); - - // load configuration for active mode only - $this->configuration = config_get('tree_filter_cfg')->requirements; - - // load also exec config - it is not only needed in exec mode - $this->configuration->exec_cfg = config_get('exec_cfg'); - - // some additional testcase configuration - $this->configuration->tc_cfg = config_get('testcase_cfg'); - - // load req and req spec config (for types, filters, status, ...) - $this->configuration->req_cfg = config_get('req_cfg'); - $this->configuration->req_spec_cfg = config_get('req_spec_cfg'); - - // is switch filter mode enabled? - $this->filter_mode_choice_enabled = false; - switch( $this->mode ) - { - case 'edit_mode': - break; - - default: - if (isset($this->configuration->advanced_filter_mode_choice) && - $this->configuration->advanced_filter_mode_choice == ENABLED) - { - $this->filter_mode_choice_enabled = true; - } - break; - } - - return tl::OK; - } // end of method - - /** - * Does what init_args() usually does in all scripts: Reads the user input - * from request ($_GET and $_POST). - * Later configuration, settings and filters get modified according to that user input. - */ - protected function init_args() - { - // some common user input is already read in parent class - parent::init_args(); - - // add settings and filters to parameter info array for request parsers - $params = array(); - - foreach ($this->all_settings as $name => $info) - { - if (is_array($info)) - { - $params[$name] = $info; - } - } - - foreach ($this->all_filters as $name => $info) - { - if (is_array($info)) - { - $params[$name] = $info; - } - } - - I_PARAMS($params, $this->args); - } // end of method - - /** - * Initializes all settings. - * Iterates through all available settings and adds an array to $this->settings - * for the active ones, sets the rest to false so this can be - * checked from templates and elsewhere. - * Then calls the initializing method for each still active setting. - */ - protected function init_settings() - { - $at_least_one_active = false; - - foreach ($this->all_settings as $name => $info) - { - $init_method = "init_$name"; - if (in_array($name, $this->mode_setting_mapping[$this->mode]) && - method_exists($this, $init_method)) - { - // is valid, configured, exists and therefore can be used, so initialize this setting - $this->$init_method(); - $at_least_one_active = true; - } - else - { - // is not needed, simply deactivate it by setting it to false in main array - $this->settings[$name] = false; - } - } - - // special situations - // the build setting is in plan mode only needed for one feature - if ($this->mode == 'plan_mode' && - ($this->args->feature != 'tc_exec_assignment' && $this->args->feature != 'test_urgency') ) - { - $this->settings['setting_build'] = false; - $this->settings['setting_platform'] = false; - } - - // if at least one active setting is left to display, switch settings panel on - if ($at_least_one_active) - { - $this->display_settings = true; - } - } - - /** - * Initialize all filters. (called by parent::__construct()) - * I'm double checking here with loaded configuration _and_ additional array - * $mode_filter_mapping, set according to defined mode, because this can avoid errors in case - * when users try to enable a filter in config that doesn't exist for a mode. - * Effect: Only existing and implemented filters can be activated in config file. - */ - protected function init_filters() - { - // iterate through all filters and activate the needed ones - if ($this->configuration->show_filters == ENABLED) - { - foreach ($this->all_filters as $name => $info) - { - $init_method = "init_$name"; - if (method_exists($this, $init_method) && $this->configuration->{$name} == ENABLED) - { - $this->$init_method(); - $this->display_req_filters = true; - } - else - { - // is not needed, deactivate filter by setting it to false in main array - // and of course also in active filters array - $this->filters[$name] = false; - $this->active_filters[$name] = null; - } - } - - } - else - { - $this->display_req_filters = false; - } - } // end of method - - /** - * This method returns an object or array, containing all selections chosen - * by the user for filtering. - * - * @return mixed $value Return value is either an array or stdClass object, - * depending on active mode. It contains all filter values selected by the user. - */ - protected function get_active_filters() - { - static $value = null; // serves as a kind of cache if method is called more than once - - // convert array to stcClass if needed - if (!$value) - { - switch ($this->mode) - { - case 'execution_mode': - case 'plan_mode': - // these features are generating an exec tree, - // they need the filters as a stdClass object - $value = (object)$this->active_filters; - break; - - default: - // otherwise simply return the array as-is - $value = $this->active_filters; - break; - } - } - - return $value; - } // end of method - - /** - * - * - */ - public function set_testcases_to_show($value = null) - { - // update active_filters - if (!is_null($value)) { - $this->active_filters['testcases_to_show'] = $value; - } - - // Since a new filter in active_filters has been set from outside class after - // saving of session data has already happened in constructor, - // we explicitly update data in session after this change here. - $this->save_session_data(); - } - - /** - * Active filters will be saved to $_SESSION. - * If there already is data for the active mode and token, it will be overwritten. - * This data will be read from pages in the right frame. - * This solves the problems with too long URLs. - * See issue 3516 in Mantis for a little bit more information/explanation. - * The therefore caused new problem that would arise now if - * a user uses the same feature simultaneously in multiple browser tabs - * is solved be the additional measure of using a form token. - * - * @author Andreas Simon - * @return $tl::OK - */ - public function save_session_data() { - if (!isset($_SESSION[$this->mode]) || is_null($_SESSION[$this->mode]) || !is_array($_SESSION[$this->mode])) { - $_SESSION[$this->mode] = array(); - } - - $_SESSION[$this->mode][$this->form_token] = $this->active_filters; - $_SESSION[$this->mode][$this->form_token]['timestamp'] = time(); - - return tl::OK; - } - - /** - * Old filter data for active mode will be deleted from $_SESSION. - * It happens automatically after a session has expired and a user therefore - * has to log in again, but here we can configure an additional time limit - * only for this special filter part in session data. - * - * @author Andreas Simon - * @param int $token_validity_duration data older than given timespan will be deleted - */ - public function delete_old_session_data($token_validity_duration = 0) - { - - // TODO this duration could maybe also be configured in config/const.inc.php - - // how long shall the data remain in session before it will be deleted? - if (!is_numeric($token_validity_duration) || $token_validity_duration <= 0) { - $token_validity_duration = 60 * 60 * 1; // one hour as default - } - - // delete all tokens from session that are older than given age - if (isset($_SESSION[$this->mode]) && is_array($_SESSION[$this->mode])) { - foreach ($_SESSION[$this->mode] as $token => $data) { - if ($data['timestamp'] < (time() - $token_validity_duration)) { - unset($_SESSION[$this->mode][$token]); // too old, delete! - } - } - } - } - - /** - * - * - */ - public function delete_own_session_data() - { - if (isset($_SESSION[$this->mode]) && isset($_SESSION[$this->mode][$this->form_token])) - { - unset($_SESSION[$this->mode][$this->form_token]); - } - } - - /** - * Generates a form token, which will be used to identify the relationship - * between left navigator-frame with its settings and right frame. - */ - protected function generate_form_token() - { - // Notice: I am just generating an integer here for the token. - // Since this is not any security relevant stuff like a password hash or similar, - // but only a means to separate multiple tabs a single user opens, this should suffice. - // If we should some day decide that an integer is not enough, - // we just have to change this one method and everything will still work. - - $min = 1234567890; // not magic, just some large number so the tokens don't get too short - $max = mt_getrandmax(); - $token = 0; - - // generate new tokens until we find one that doesn't exist yet - do { - $token = mt_rand($min, $max); - } while (isset($_SESSION[$this->mode][$token])); - - $this->form_token = $token; - } - - /** - * Active filters will be formatted as a GET-argument string. - * - * @return string $string the formatted string with active filters - */ - public function get_argument_string() - { - static $string = null; // cache for repeated calls of this method - - if (!$string) - { - $string = ''; - - // important: the token with which the page in right frame can access data in session - $string .= '&form_token=' . $this->form_token; - - $key2loop = array('setting_build','setting_platform'); - foreach($key2loop as $kiwi) - { - if($this->settings[$kiwi]) - { - $string .= "&{$kiwi}={$this->settings[$kiwi]['selected']}"; - } - - } - if ($this->active_filters['filter_priority'] > 0) - { - $string .= '&filter_priority=' . $this->active_filters['filter_priority']; - } - - - $keyword_list = null; - if (is_array($this->active_filters['filter_keywords'])) - { - $keyword_list = implode(',', $this->active_filters['filter_keywords']); - } - else if ($this->active_filters['filter_keywords']) - { - $keyword_list = $this->active_filters['filter_keywords']; - } - - - // Need to undertand why for other filters that also are array - // we have choosen to serialize, and here not. - // may be to avoid more refactoring - if ($keyword_list) - { - $string .= '&filter_keywords=' . $keyword_list . - '&filter_keywords_filter_type=' . - $this->active_filters['filter_keywords_filter_type']; - } - - // Using serialization - if ($this->active_filters['filter_assigned_user']) - { - $string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']) . - '&filter_assigned_user_include_unassigned=' . - ($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0'); - } - - if ($this->active_filters['filter_result_result']) - { - $string .= '&filter_result_result=' . json_encode($this->active_filters['filter_result_result']) . - '&filter_result_method=' . $this->active_filters['filter_result_method'] . - '&filter_result_build=' . $this->active_filters['filter_result_build']; - } - - if( !is_null($this->active_filters['filter_bugs'])) - { - $string .= '&' . http_build_query( array('filter_bugs' => $this->active_filters['filter_bugs'])); - } - - } - - return $string; - } - - /** - * Build the tree menu for generation of JavaScript test case tree. - * Depending on mode and user's selections in user interface, - * either a completely filtered tree will be build and returned, - * or only the minimal necessary data to "lazy load" - * the objects in the tree by later Ajax calls. - * No return value - all variables will be stored in gui object - * which is passed by reference. - * - * @author Andreas Simon - * @param object $gui Reference to GUI object (data will be written to it) - */ - public function build_tree_menu(&$gui) - { - $tree_menu = null; - $filters = $this->get_active_filters(); - $loader = ''; - $children = "[]"; - $cookie_prefix = ''; - - // by default, disable drag and drop, then later enable if needed - $drag_and_drop = new stdClass(); - $drag_and_drop->enabled = false; - $drag_and_drop->BackEndUrl = ''; - $drag_and_drop->useBeforeMoveNode = FALSE; - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - $tc_prefix = $this->testproject_mgr->getTestCasePrefix($this->args->testproject_id); - - switch ($this->mode) - { - case 'plan_add_mode': - // improved cookiePrefix - - // tree in plan_add_mode is only used for add/removed test cases features - // and shows all test cases defined within test project, - // but as test cases are added to a specified test plan -> store state for each test plan - // - // usage of wrong values in $this->args->xyz for cookiePrefix instead of correct - // values in $filters->setting_xyz - $cookie_prefix = "add_remove_tc_tplan_id_{$filters['setting_testplan']}_"; - - // get filter mode - $key = 'setting_testsgroupby'; - $mode = $this->args->$key; - - - if ($this->do_filtering) - { - $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - - $options = array('forPrinting' => NOT_FOR_PRINTING, - 'hideTestCases' => HIDE_TESTCASES, - 'tc_action_enabled' => ACTION_TESTCASE_DISABLE, - 'viewType' => 'testSpecTreeForTestPlan', - 'ignore_inactive_testcases' => $ignore_inactive_testcases, - 'ignore_active_testcases' => $ignore_active_testcases); - - if ($mode == 'mode_req_coverage') - { - - $options = array('for_printing' => NOT_FOR_PRINTING,'exclude_branches' => null); - - $tree_menu = generateTestReqCoverageTree($this->db, - $this->args->testproject_id, - $this->args->testproject_name, - $gui->menuUrl, $filters, $options); - - } - - $root_node = $tree_menu->rootnode; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - } - else - { - if ($mode == 'mode_req_coverage') - { - $loader = $gui->basehref . 'lib/ajax/getreqcoveragenodes.php?mode=reqspec&' . - "root_node={$this->args->testproject_id}"; - - $req_qty = count($this->testproject_mgr->get_all_requirement_ids($this->args->testproject_id)); - - $root_node = new stdClass(); - $root_node->href = "javascript:EP({$this->args->testproject_id})"; - $root_node->id = $this->args->testproject_id; - $root_node->name = $this->args->testproject_name . " ($req_qty)"; - $root_node->testlink_node_type = 'testproject'; - } - } - break; - } - - $gui->tree = $tree_menu; - - $gui->ajaxTree = new stdClass(); - $gui->ajaxTree->loader = $loader; - $gui->ajaxTree->root_node = $root_node; - $gui->ajaxTree->children = $children; - $gui->ajaxTree->cookiePrefix = $cookie_prefix; - $gui->ajaxTree->dragDrop = $drag_and_drop; - } // end of method - - /** - * - * - */ - private function init_setting_refresh_tree_on_action() - { - - $key = 'setting_refresh_tree_on_action'; - $hidden_key = 'hidden_setting_refresh_tree_on_action'; - $selection = 0; - - $this->settings[$key] = array(); - $this->settings[$key][$hidden_key] = false; - - // look where we can find the setting - POST, SESSION, config? - if (isset($this->args->{$key})) { - $selection = 1; - } else if (isset($this->args->{$hidden_key})) { - $selection = 0; - } else if (isset($_SESSION[$key])) { - $selection = $_SESSION[$key]; - } else { - $spec_cfg = config_get('spec_cfg'); - $selection = ($spec_cfg->automatic_tree_refresh > 0) ? 1 : 0; - } - - $this->settings[$key]['selected'] = $selection; - $this->settings[$key][$hidden_key] = $selection; - $_SESSION[$key] = $selection; - } // end of method - - /** - * - * - */ - private function init_setting_get_parent_child_relation() - { - $key = 'setting_get_parent_child_relation'; - $hidden_key = 'hidden_setting_get_parent_child_relation'; - $selection = 0; - - $this->settings[$key] = array(); - $this->settings[$key][$hidden_key] = false; - - // look where we can find the setting - POST, SESSION - if (isset($this->args->{$key})) { - $selection = 1; - } else if (isset($this->args->{$hidden_key})) { - $selection = 0; - } else if (isset($_SESSION[$key])) { - $selection = $this->settings[$key]; - } else { - $selection = 0; - } - - $this->settings[$key]['selected'] = $selection; - $this->settings[$key][$hidden_key] = $selection; - $_SESSION[$key] = $selection; - } // end of method - - - /** - * - * - */ - private function init_setting_testplan() - { - - if (is_null($this->testplan_mgr)) - { - $this->testplan_mgr = new testplan($this->db); - } - - $key = 'setting_testplan'; - $testplans = $this->user->getAccessibleTestPlans($this->db, $this->args->testproject_id); - if (isset($_SESSION['testplanID']) && $_SESSION['testplanID'] != $this->args->{$key}) - { - // testplan was changed, we need to reset all filters - // --> they were chosen for another testplan, not this one! - $this->args->reset_filters = true; - - // check if user is allowed to set chosen testplan before changing - foreach ($testplans as $plan) - { - if ($plan['id'] == $this->args->{$key}) - { - setSessionTestPlan($plan); - } - } - } - - // now load info from session - $info = $this->testplan_mgr->get_by_id($_SESSION['testplanID']); - $this->args->testplan_name = $info['name']; - $this->args->testplan_id = $info['id']; - $this->args->{$key} = $info['id']; - $this->settings[$key]['selected'] = $info['id']; - - // Final filtering based on mode: - // Now get all selectable testplans for the user to display. - // For execution: - // For assign test case execution feature: - // don't take testplans into selection which have no (active/open) builds! - // - // For plan add mode: - // add every plan no matter if he has builds or not. - - foreach ($testplans as $plan) - { - $add_plan = $this->mode == 'plan_add_mode' || - ( $this->mode == 'plan_mode' && $this->args->feature != 'tc_exec_assignment' ) ; - - if(!$add_plan) - { - $builds = $this->testplan_mgr->get_builds($plan['id'],testplan::GET_ACTIVE_BUILD,testplan::GET_OPEN_BUILD); - $add_plan = (is_array($builds) && count($builds)); - } - - if ($add_plan) - { - $this->settings[$key]['items'][$plan['id']] = $plan['name']; - } - } - } - - - /** - * - */ - protected function init_setting_testsgroupby() { - $key = 'setting_testsgroupby'; - - // now load info from session - $mode = (isset($_REQUEST[$key])) ? $_REQUEST[$key] : 0; - $this->args->testsgroupedby_mode = $mode; - $this->args->{$key} = $mode; - $this->settings[$key]['selected'] = $mode; - - $k2l = array('mode_test_suite','mode_req_coverage'); - foreach( $k2l as $ak ) { - $this->settings[$key]['items'][$ak] = lang_get($ak); - } - } // end of method - - /* - * - */ - private function init_filter_tc_id() - { - $key = 'filter_tc_id'; - $selection = $this->args->{$key}; - - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - - $tc_cfg = config_get('testcase_cfg'); - $tc_prefix = $this->testproject_mgr->getTestCasePrefix($this->args->testproject_id); - $tc_prefix .= $tc_cfg->glue_character; - - if (!$selection || $selection == $tc_prefix || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection ? $selection : $tc_prefix); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - * - */ - private function init_filter_testcase_name() { - $key = 'filter_testcase_name'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - - /** - * - * - */ - private function init_filter_toplevel_testsuite() - { - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - $key = 'filter_toplevel_testsuite'; - $first_level_suites = $this->testproject_mgr->get_first_level_test_suites($this->args->testproject_id, - 'smarty_html_options'); - - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - // this filter should only be visible if there are any top level testsuites - $this->filters[$key] = null; - if ($first_level_suites) - { - $this->filters[$key] = array('items' => array(0 => ''), - 'selected' => $selection, - 'exclude_branches' => array()); - - foreach ($first_level_suites as $suite_id => $suite_name) - { - $this->filters[$key]['items'][$suite_id] = $suite_name; - if ($selection && $suite_id != $selection) - { - $this->filters[$key]['exclude_branches'][$suite_id] = 'exclude_me'; - } - } - - // Important: This is the only case in which active_filters contains the items - // which have to be deleted from tree, instead of the other way around. - $this->active_filters[$key] = $this->filters[$key]['exclude_branches']; - } - else - { - $this->active_filters[$key] = null; - } - } // end of method - - /** - * - * @internal revision - * @since 1.9.13 - * mode this affect domain - */ - private function init_filter_keywords() - { - $key = 'filter_keywords'; - $type = 'filter_keywords_filter_type'; - $this->filters[$key] = false; - $keywords = null; - $l10n = init_labels(array('logical_or' => null,'logical_and' => null, 'not_linked' => null)); - - - switch ($this->mode) - { - case 'edit_mode': - case 'plan_add_mode': - // we need the keywords for the whole testproject - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - $keywords = $this->testproject_mgr->get_keywords_map($this->args->testproject_id); - break; - - default: - // otherwise (not in edit mode), we want only keywords assigned to testplan - if (!$this->testplan_mgr) - { - $this->testplan_mgr = new testplan($this->db); - } - $tplan_id = $this->settings['setting_testplan']['selected']; - $keywords = $this->testplan_mgr->get_keywords_map($tplan_id, ' ORDER BY keyword '); - break; - } - - $special = array('domain' => array(), 'filter_mode' => array()); - switch($this->mode) - { - case 'edit_mode': - $special['domain'] = array(-1 => $this->option_strings['without_keywords'], - 0 => $this->option_strings['any']); - $special['filter_mode'] = array('NotLinked' => $l10n['not_linked']); - break; - - case 'execution_mode': - case 'plan_add_mode': - case 'plan_mode': - default: - $special['domain'] = array(0 => $this->option_strings['any']); - $special['filter_mode'] = array(); - break; - } - - $selection = $this->args->{$key}; - $type_selection = $this->args->{$type}; - - // are there any keywords? - if (!is_null($keywords) && count($keywords)) - { - $this->filters[$key] = array(); - - if (!$selection || !$type_selection || $this->args->reset_filters) - { - // default values for filter reset - $selection = null; - $type_selection = 'Or'; - } - else - { - $this->do_filtering = true; - } - - // data for the keywords themselves - $this->filters[$key]['items'] = $special['domain'] + $keywords; - $this->filters[$key]['selected'] = $selection; - $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), - self::ADVANCED_FILTER_ITEM_QUANTITY); - - // additional data for the filter type (logical and/or) - $this->filters[$key][$type] = array(); - $this->filters[$key][$type]['items'] = array('Or' => $l10n['logical_or'], - 'And' => $l10n['logical_and']) + - $special['filter_mode']; - $this->filters[$key][$type]['selected'] = $type_selection; - } - - // set the active value to filter - // delete keyword filter if "any" (0) is part of the selection - regardless of filter mode - if (is_array($this->filters[$key]['selected']) && in_array(0, $this->filters[$key]['selected'])) - { - $this->active_filters[$key] = null; - } - else - { - $this->active_filters[$key] = $this->filters[$key]['selected']; - } - $this->active_filters[$type] = $selection ? $type_selection : null; - } - - - - // TICKET 4353: added active/inactive filter - private function init_filter_active_inactive() - { - $key = 'filter_active_inactive'; - - $items = array(DO_NOT_FILTER_INACTIVE_TESTCASES => $this->option_strings['any'], - IGNORE_INACTIVE_TESTCASES => lang_get('show_only_active_testcases'), - IGNORE_ACTIVE_TESTCASES => lang_get('show_only_inactive_testcases')); - - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('items' => $items, 'selected' => $selection); - $this->active_filters[$key] = $selection; - } - - - /** - * - */ - private function init_filter_importance() - { - // show this filter only if test priority management is enabled - $key = 'filter_importance'; - $this->active_filters[$key] = null; - $this->filters[$key] = false; - - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - $tp_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - $enabled = $tp_info['opt']->testPriorityEnabled; - - if ($enabled) - { - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - - $this->filters[$key] = array('selected' => $selection); - - // Only drawback: no new user defined importance can be managed - // may be is a good design choice - $this->filters[$key]['items'] = array(0 => $this->option_strings['any'], - HIGH => lang_get('high_importance'), - MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - $this->filters[$key]['size'] = sizeof($this->filters[$key]['items']); - $this->active_filters[$key] = $selection; - } - } - - - /** - * - * - */ - private function init_filter_priority() - { - // This is a special case of filter: the menu items don't get initialized here, - // they are available as a global smarty variable. So the only thing to be managed - // here is the selection by user. - $key = 'filter_priority'; - - if (!$this->testproject_mgr) - { - $this->testproject_mgr = new testproject($this->db); - } - - $tp_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - $enabled = $tp_info['opt']->testPriorityEnabled; - - $this->active_filters[$key] = null; - $this->filters[$key] = false; - - if ($enabled) - { - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - } // end of method - - /** - * - */ - private function init_filter_execution_type() - { - if (!$this->tc_mgr) { - $this->tc_mgr = new testcase($this->db); - } - $key = 'filter_execution_type'; - - $selection = $this->args->{$key}; - // handle filter reset - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('items' => array(), 'selected' => $selection); - - // load available execution types - // add "any" string to these types at index 0 as default selection - $this->filters[$key]['items'] = $this->tc_mgr->get_execution_types(); - $this->filters[$key]['items'] = array(0 => $this->option_strings['any']) - + $this->filters[$key]['items']; - - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_assigned_user() - { - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - - $key = 'filter_assigned_user'; - $unassigned_key = 'filter_assigned_user_include_unassigned'; - $tplan_id = $this->settings['setting_testplan']['selected']; - - // set selection to default (any), only change if value is sent by user and reset is not requested - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $tproject_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - - $all_testers = getTestersForHtmlOptions($this->db, $tplan_id, $tproject_info, null, - array(TL_USER_ANYBODY => $this->option_strings['any'], - TL_USER_NOBODY => $this->option_strings['none'], - TL_USER_SOMEBODY => $this->option_strings['somebody']), - 'any'); - $visible_testers = $all_testers; - - // in execution mode the rights of the user have to be regarded - if ($this->mode == 'execution_mode') - { - $role = $this->user->getEffectiveRole($this->db, $this->args->testproject_id, $tplan_id); - - $simple_tester_roles = array_flip($this->configuration->exec_cfg->simple_tester_roles); - - // check the user's rights to see what he may do - $right_to_execute = $role->hasRight('testplan_execute'); - $right_to_manage = $role->hasRight('testplan_planning'); - - $simple = false; - if (isset($simple_tester_roles[$role->dbID]) || ($right_to_execute && !$right_to_manage)) { - // user is only simple tester and may not see/execute everything - $simple = true; - } - - $view_mode = $simple ? $this->configuration->exec_cfg->view_mode->tester : 'all'; - - if ($view_mode != 'all') { - $visible_testers = (array)$this->user->getDisplayName(); - $selection = (array)$this->user->dbID; - } - - // re-enable option "user_filter_default" - if (!$selection && $this->configuration->exec_cfg->user_filter_default == 'logged_user') { - $selection = (array)$this->user->dbID; - } - } - - $this->filters[$key] = array('items' => $visible_testers, - 'selected' => $selection, - $unassigned_key => $this->args->{$unassigned_key}); - - // which value shall be passed to tree generation class? - - if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection)) - || ($selection == TL_USER_ANYBODY)) { - // delete user assignment filter if "any user" is part of the selection - $this->active_filters[$key] = null; - $this->active_filters[$unassigned_key] = 0; - } - - if (is_array($selection)) { - // get keys of the array as values - $this->active_filters[$key] = array_flip($selection); - foreach ($this->active_filters[$key] as $user_key => $user_value) { - $this->active_filters[$key][$user_key] = $user_key; - } - $this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key]; - } - } // end of method - - - /** - * - */ - private function init_filter_result() - { - $result_key = 'filter_result_result'; - $method_key = 'filter_result_method'; - $build_key = 'filter_result_build'; - - if (is_null($this->testplan_mgr)) - { - $this->testplan_mgr = new testplan($this->db); - } - $tplan_id = $this->settings['setting_testplan']['selected']; - - $this->configuration->results = config_get('results'); - - // determine, which config to load and use for filter methods - depends on mode! - $cfg = ($this->mode == 'execution_mode') ? - 'execution_filter_methods' : 'execution_assignment_filter_methods'; - $this->configuration->filter_methods = config_get($cfg); - - // - // CRITIC - Differences bewteen this configuration and - // (file const.inc.php) - // $tlCfg->execution_filter_methods['default_type'] - // $tlCfg->execution_assignment_filter_methods['default_type'] - // - // Will create issues: you will see an string on HTML SELECT, but code - // returned on submit will not code for string you are seeing.!!!! - // - // determine which filter method shall be selected by the JS function in template, - // when only one build is selectable by the user - $js_key_to_select = 0; - if ($this->mode == 'execution_mode') - { - $js_key_to_select = $this->configuration->filter_methods['status_code']['current_build']; - } - else if ($this->mode == 'plan_mode') - { - $js_key_to_select = $this->configuration->filter_methods['status_code']['specific_build']; - } - - // values selected by user - $result_selection = $this->args->$result_key; - $method_selection = $this->args->$method_key; - $build_selection = $this->args->$build_key; - - // default values - $default_filter_method = $this->configuration->filter_methods['default_type']; - $any_result_key = $this->configuration->results['status_code']['all']; - $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, testplan::GET_ACTIVE_BUILD); - - if (is_null($method_selection)) - { - $method_selection = $default_filter_method; - } - - if (is_null($result_selection) || $this->args->reset_filters) - // if ($this->args->reset_filters) - { - // no selection yet or filter reset requested - $result_selection = $any_result_key; - $method_selection = $default_filter_method; - $build_selection = $newest_build_id; - } - else - { - $this->do_filtering = true; - } - - // init array structure - $key = 'filter_result'; - $this->filters[$key] = array($result_key => array('items' => null, - 'selected' => $result_selection), - $method_key => array('items' => array(), - 'selected' => $method_selection, - 'js_selection' => $js_key_to_select), - $build_key => array('items' => null, - 'selected' => $build_selection)); - - // init menu for result selection by function from exec.inc.php - $this->filters[$key][$result_key]['items'] = createResultsMenu(); - $this->filters[$key][$result_key]['items'][$any_result_key] = $this->option_strings['any']; - - // init menu for filter method selection - foreach ($this->configuration->filter_methods['status_code'] as $statusname => $statusshortcut) - { - $code = $this->configuration->filter_methods['status_code'][$statusname]; - $this->filters[$key][$method_key]['items'][$code] = - lang_get($this->configuration->filter_methods['status_label'][$statusname]); - } - - // init menu for build selection - $this->filters[$key][$build_key]['items'] = - $this->testplan_mgr->get_builds_for_html_options($tplan_id, testplan::GET_ACTIVE_BUILD); - - // if "any" is selected, nullify the active filters - if ((is_array($result_selection) && in_array($any_result_key, $result_selection)) || - $result_selection == $any_result_key) - { - $this->active_filters[$result_key] = null; - $this->active_filters[$method_key] = null; - $this->active_filters[$build_key] = null; - $this->filters[$key][$result_key]['selected'] = $any_result_key; - } - else - { - $this->active_filters[$result_key] = $result_selection; - $this->active_filters[$method_key] = $method_selection; - $this->active_filters[$build_key] = $build_selection; - } - } // end of method - - /** - * - */ - private function init_filter_bugs() - { - $key = str_replace('init_','',__FUNCTION__); - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - - - /** - * - * - * @internal revisions - * @since 1.9.14 - * allow multiple selection (if advanced mode) - */ - private function init_filter_workflow_status() - { - $key = 'filter_workflow_status'; - if (!$this->tc_mgr) - { - $this->tc_mgr = new testcase($this->db); - } - - // handle filter reset - $cfx = $this->configuration->{$key . "_values"}; - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - if( !is_null($this->args->caller) && !$selection) - { - $selection = null; - } - else if( count($cfx) > 0) - { - $selection = $cfx; - $this->do_filtering = true; - } - else - { - $selection = null; - } - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('items' => array(), 'selected' => $selection); - - // load domain - // add "any" string to these types at index 0 as default selection - $this->filters[$key]['items'] = array(0 => $this->option_strings['any']) + - $this->tc_mgr->getWorkFlowStatusDomain(); - - $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), - self::ADVANCED_FILTER_ITEM_QUANTITY); - - $this->active_filters[$key] = $selection; - } - - - - /** - * - * @used-by __construct - */ - private function initTreeOptions() - { - $this->treeOpt['plan_mode'] = new stdClass(); - $this->treeOpt['plan_mode']->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; - $this->treeOpt['plan_mode']->useColours = COLOR_BY_TC_STATUS_OFF; - $this->treeOpt['plan_mode']->testcases_colouring_by_selected_build = DISABLED; - $this->treeOpt['plan_mode']->absolute_last_execution = true; // hmm probably useless - - } - - /** - * - */ - protected function init_advanced_filter_mode() - { - switch( $this->mode ) - { - case 'edit_mode': - $this->advanced_filter_mode = TRUE; - break; - - default: - $m2c = __FUNCTION__; - parent::$m2c(); - break; - } - } // end of method - - - - - //--------------------- - /** - * - */ - private function init_filter_doc_id() - { - $key = 'filter_doc_id'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - - /** - * - */ - private function init_filter_title() - { - $key = 'filter_title'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - /* - * - */ - private function init_filter_status() { - $key = 'filter_status'; - $selection = $this->args->{$key}; - - // get configured statuses and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_cfg->status_labels); - - // BUGID 3852 - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array('0', $selection, true))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_type() { - $key = 'filter_type'; - $selection = $this->args->{$key}; - - // get configured types and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_cfg->type_labels); - - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array(self::ANY, $selection))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_spec_type() { - $key = 'filter_spec_type'; - $selection = $this->args->{$key}; - - // get configured types and add "any" string to menu - $items = array(self::ANY => $this->option_strings['any']) + - (array) init_labels($this->configuration->req_spec_cfg->type_labels); - - if (!$selection || $this->args->reset_filters - || (is_array($selection) && in_array(self::ANY, $selection))) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, 'items' => $items); - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_coverage() { - - $key = 'filter_coverage'; - $this->filters[$key] = false; - $this->active_filters[$key] = null; - - // is coverage management enabled? - if ($this->configuration->req_cfg->expected_coverage_management) { - $selection = $this->args->{$key}; - - if (!$selection || !is_numeric($selection) || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - } // end of method - - /** - * - */ - private function init_filter_relation() { - - $key = 'filter_relation'; - - // are relations enabled? - if ($this->configuration->req_cfg->relations->enable) { - $selection = $this->args->{$key}; - - if (!$this->req_mgr) { - $this->req_mgr = new requirement_mgr($this->db); - } - - $req_relations = $this->req_mgr->init_relation_type_select(); - - // special case here: - // for equal type relations (where it doesn't matter if we find source or destination) - // we have to remove the source identficator from the array key - foreach ($req_relations['equal_relations'] as $array_key => $old_key) - { - // set new key in array and delete old one - $new_key = (int) str_replace("_source", "", $old_key); - $req_relations['items'][$new_key] = $req_relations['items'][$old_key]; - unset($req_relations['items'][$old_key]); - } - - $items = array(self::ANY => $this->option_strings['any']) + - (array) $req_relations['items']; - - if (!$selection || $this->args->reset_filters || - (is_array($selection) && in_array(self::ANY, $selection))) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection, - 'items' => $items); - $this->active_filters[$key] = $selection; - } else { - // not enabled, just nullify - $this->filters[$key] = false; - $this->active_filters[$key] = null; - } - } // end of method - - - /** - * - */ - protected function getCustomFields() - { - if (!$this->req_mgr) - { - $this->req_mgr = new requirement_mgr($this->db); - $this->cfield_mgr = &$this->req_mgr->cfield_mgr; - } - - $cfields = $this->req_mgr->get_linked_cfields(null, null, $this->args->testproject_id); - return $cfields; - } - -} \ No newline at end of file + add/remove test cases + * + * + * @internal revisions + * @since 1.9.13 + */ + +/* + * -------------------------------------------------------- + * An important note on request-URL too large (BUGID 3516) + * -------------------------------------------------------- + * + * That problem has been solved by attaching some data (the set of active filters, settings and + * testcase IDs to show if filtering has been done) to session. + * + * Since a user can have the same feature open in multiple tabs, that alone is not enough to + * solve this issue. When a user opens e.g. the test case execution page and sets filter options + * there, then opens the same page in another tab, the data saved in session would also be + * applied to this second tab although no filter options have been set there yet by the user. + * + * This has now been solved by a so called form token. This token is, on first opening of a + * navigator frame, generated by the method generate_form_token() and then stored in a member + * variable with the name $form_token. This token will be stored in an identically named hidden + * input field within the HTML filter form, so it gets sent by POST to every called page. + * It is also attached to the GET argument string returned by get_argument_string() that gets + * passed to multiple JavaScript functions, which are used to open nodes from the tree in the + * left frame in a new page in the right frame. + * + * So the token is used to identify (from pages within the right frame) the data that got stored + * for them in session by the navigator page in the left frame. + * If the navigator page calls itself (when the user presses one of the submit buttons in the form), + * it sends the stored token via POST to itself. So the same token can be used again to store data + * in session, instead of generating a new token blindly on every page call no matter where the + * call comes from. But if the user opens a new tab, the new navigator page knows this because + * no token has been sent to it - so it generates a new one. + * + * + * The access to this data can be done in the following way from the right frame page: + * + * $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + * $mode = 'execution_mode'; + * $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) + * ? $_SESSION[$mode][$form_token] : null; + * + * The variable $session_data then holds the array with all the active filters, + * settings and filtered test case IDs in it, or is null if nothing has been stored yet + * in the session. + * + * But now we have another problem: + * There can be one array for each mode in the session. In each of these arrays is a set of + * further arrays with the form tokens as keys and the filter information in it. + * If a user now opens the same page more than once in a row (by switching back and forth + * between features or by using the same feature in multiple tabs) there can be more and more + * arrays with filter information in this set of arrays. + * + * Because of this, an additional timestamp is written into each of these information arrays. + * On each storage process that writes information into the session triggered by a call + * to a navigator page, the timestamp gets refreshed if an old token has been reused or + * it gets created with the creation of a new data array. + * + * This timestamp can be used to delete old arrays with information that is not needed anymore. + * Since we have no means to otherwise detect the case that a user has closed the tab + * and doesn't need this information in the session anymore, we have to determine the age of + * those arrays with the timestamp and delete everything that is older than a certain given + * threshold. This is done by the method delete_old_session_data() which is automatically called + * from the contstructor of this class. It checks the age of all the saved + * arrays inside the array for the active mode and then deletes everything that's older than + * the given threshold. This threshold can be passed as a parameter to the method, otherwise a + * default value of one hour is used. + * + * If a user logs out of TestLink, of course all this data in the session is deleted, + * no matter if the one hour threshold has passed or not. + * ------------------------------------------------------------------------------------------------ + */ + +/** + * This class extends tlFilterPanel for the specific use with the testcase tree. + * It contains logic to be used at GUI level to manage + * a common set of settings and filters for testcases. + * + * @author Andreas Simon + * @package TestLink + * @uses testplan + * @uses exec_cf_mgr + * @uses tlPlatform + * @uses testcase + */ +class tlTestCaseFilterByRequirementControl extends tlFilterControl +{ + + public $req_mgr = null; + + /** + * Testcase manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var testcase + */ + private $tc_mgr = null; + + /** + * Platform manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var tlPlatform + */ + private $platform_mgr = null; + + /** + * Testplan manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var testplan + */ + private $testplan_mgr = null; + + /** + * This array contains all possible filters. + * It is used as a helper to iterate over all the filters in some loops. + * It also sets options how and from where to load the parameters with + * input fetching functions in init_args()-method. + * Its keys are the names of the settings (class constants are used), + * its values are the arrays for the input parser. + * + * @var array + */ + + /* + * MAGIC NUMBERS are related to field size + * filter_tc_id: 0,30 arbitrary + * filter_bugs: 240 = 60 x 4 (60 bug_id size on execution_bugs table) + */ + private $all_filters = array( + 'filter_doc_id' => array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_title' => array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_status' => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + 'filter_type' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_spec_type' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_coverage' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_relation' => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + 'filter_tc_id' => array( + "POST", + tlInputParameter::STRING_N + ), + 'filter_custom_fields' => null, + 'filter_result' => false + ); + + /** + * This array is used as an additional security measure. + * It maps all available + * filters to the mode in which they can be used. If a user tries to + * enable filters in config.inc.php which are not defined inside this array, + * this will be simply ignored instead of trying to initialize the filter + * no matter wether it has been implemented or not. + * The keys inside this array are the modes defined above as class constants. + * So it can be checked if a filter is available in a given mode without + * relying only on the config parameter. + * + * @var array + */ + private $mode_filter_mapping = array( + 'plan_add_mode' => array( + 'filter_tc_id', + 'filter_testcase_name', + 'filter_toplevel_testsuite', + 'filter_keywords', + // 'filter_active_inactive', + 'filter_importance', + 'filter_execution_type', + 'filter_workflow_status', + 'filter_custom_fields' + ) + ); + + /** + * This array contains all possible settings. + * It is used as a helper + * to later iterate over all possibilities in loops. + * Its keys are the names of the settings, its values the arrays for the input parser. + * + * @var array + */ + private $all_settings = array( + 'setting_testplan' => array( + "REQUEST", + tlInputParameter::INT_N + ), + 'setting_refresh_tree_on_action' => array( + "POST", + tlInputParameter::CB_BOOL + ), + 'setting_get_parent_child_relation' => array( + "POST", + tlInputParameter::CB_BOOL + ), + 'hidden_setting_get_parent_child_relation' => array( + "POST", + tlInputParameter::INT_N + ), + 'setting_testsgroupby' => array( + "REQUEST", + tlInputParameter::INT_N + ) + ); + + /** + * This array is used to map the modes to their available settings. + * + * @var array + */ + private $mode_setting_mapping = array( + 'plan_add_mode' => array( + 'setting_testplan', + 'setting_refresh_tree_on_action', + 'setting_get_parent_child_relation', + 'hidden_setting_get_parent_child_relation', + 'setting_testsgroupby' + ) + ); + + /** + * The mode used. + * Depending on the feature for which this class will be instantiated. + * This mode defines which filter configuration will be loaded from config.inc.php + * and therefore which filters will be loaded and used for the templates. + * Value has to be one of the class constants for mode, default is edit mode. + * + * @var string + */ + private $mode = 'plan_add_mode'; + + /** + * Options to be used accordin to $this->mode, to build tree + * + * @var array + */ + private $treeOpt = array(); + + /** + * The token that will be used to identify the relationship between left frame + * (with navigator) and right frame (which displays execution of test case e.g.) in session. + * + * @var string + */ + public $form_token = null; + + /** + * + * @param database $dbHandler + * @param string $mode + * can be plan_add_mode, depending on usage + */ + public function __construct(&$dbHandler, $mode = 'plan_add_mode') + { + // set mode to define further actions before calling parent constructor + $this->mode = array_key_exists($mode, $this->mode_filter_mapping) ? $mode : 'edit_mode'; + + // Call to constructor of parent class tlFilterControl. + // This already loads configuration and user input + // and does all the remaining necessary method calls, + // so no further method call is required here for initialization. + parent::__construct($dbHandler); + $this->req_mgr = new requirement_mgr($this->db); + $this->cfield_mgr = &$this->req_mgr->cfield_mgr; + + // moved here from parent::__constructor() to be certain that + // all required objects has been created + $this->init_filters(); + + $this->initTreeOptions($this->mode); + + // delete any filter settings that may be left from previous calls in session + // Session data has been designed to provide an unidirectional channel + // between the left pane where tree lives and right pane. + // That's why delete each time our OWN session data. + $this->delete_own_session_data(); + $this->delete_old_session_data(); + + $this->save_session_data(); + } + + /** + */ + public function __destruct() + { + parent::__destruct(); // destroys testproject manager + + unset($this->tc_mgr); + unset($this->testplan_mgr); + unset($this->platform_mgr); + unset($this->cfield_mgr); + } + + /** + * Reads the configuration from the configuration file specific for test cases, + * additionally to those parts of the config which were already loaded by parent class. + * + * @return bool + */ + protected function read_config() + { + // some configuration reading already done in parent class + parent::read_config(); + + // load configuration for active mode only + $this->configuration = config_get('tree_filter_cfg')->requirements; + + // load also exec config - it is not only needed in exec mode + $this->configuration->exec_cfg = config_get('exec_cfg'); + + // some additional testcase configuration + $this->configuration->tc_cfg = config_get('testcase_cfg'); + + // load req and req spec config (for types, filters, status, ...) + $this->configuration->req_cfg = config_get('req_cfg'); + $this->configuration->req_spec_cfg = config_get('req_spec_cfg'); + + // is switch filter mode enabled? + $this->filter_mode_choice_enabled = false; + switch ($this->mode) { + case 'edit_mode': + break; + + default: + if (isset($this->configuration->advanced_filter_mode_choice) && + $this->configuration->advanced_filter_mode_choice == ENABLED) { + $this->filter_mode_choice_enabled = true; + } + break; + } + + return tl::OK; + } + + /** + * Does what init_args() usually does in all scripts: Reads the user input + * from request ($_GET and $_POST). + * Later configuration, settings and filters get modified according to that user input. + */ + protected function init_args() + { + // some common user input is already read in parent class + parent::init_args(); + + // add settings and filters to parameter info array for request parsers + $params = array(); + + foreach ($this->all_settings as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; + } + } + + foreach ($this->all_filters as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; + } + } + + I_PARAMS($params, $this->args); + } + + /** + * Initializes all settings. + * Iterates through all available settings and adds an array to $this->settings + * for the active ones, sets the rest to false so this can be + * checked from templates and elsewhere. + * Then calls the initializing method for each still active setting. + */ + protected function init_settings() + { + $at_least_one_active = false; + + foreach ($this->all_settings as $name => $info) { + $init_method = "init_$name"; + if (in_array($name, $this->mode_setting_mapping[$this->mode]) && + method_exists($this, $init_method)) { + // is valid, configured, exists and therefore can be used, so initialize this setting + $this->$init_method(); + $at_least_one_active = true; + } else { + // is not needed, simply deactivate it by setting it to false in main array + $this->settings[$name] = false; + } + } + + // special situations + // the build setting is in plan mode only needed for one feature + if ($this->mode == 'plan_mode' && + ($this->args->feature != 'tc_exec_assignment' && + $this->args->feature != 'test_urgency')) { + $this->settings['setting_build'] = false; + $this->settings['setting_platform'] = false; + } + + // if at least one active setting is left to display, switch settings panel on + if ($at_least_one_active) { + $this->display_settings = true; + } + } + + /** + * Initialize all filters. + * (called by parent::__construct()) + * I'm double checking here with loaded configuration _and_ additional array + * $mode_filter_mapping, set according to defined mode, because this can avoid errors in case + * when users try to enable a filter in config that doesn't exist for a mode. + * Effect: Only existing and implemented filters can be activated in config file. + */ + protected function init_filters() + { + // iterate through all filters and activate the needed ones + if ($this->configuration->show_filters == ENABLED) { + foreach ($this->all_filters as $name => $info) { + $init_method = "init_$name"; + if (method_exists($this, $init_method) && + $this->configuration->{$name} == ENABLED) { + $this->$init_method(); + $this->display_req_filters = true; + } else { + // is not needed, deactivate filter by setting it to false in main array + // and of course also in active filters array + $this->filters[$name] = false; + $this->active_filters[$name] = null; + } + } + } else { + $this->display_req_filters = false; + } + } + + /** + * This method returns an object or array, containing all selections chosen + * by the user for filtering. + * + * @return mixed $value Return value is either an array or stdClass object, + * depending on active mode. It contains all filter values selected by the user. + */ + protected function get_active_filters() + { + static $value = null; // serves as a kind of cache if method is called more than once + + // convert array to stcClass if needed + if (! $value) { + switch ($this->mode) { + case 'execution_mode': + case 'plan_mode': + // these features are generating an exec tree, + // they need the filters as a stdClass object + $value = (object) $this->active_filters; + break; + + default: + // otherwise simply return the array as-is + $value = $this->active_filters; + break; + } + } + + return $value; + } + + /** + */ + public function set_testcases_to_show($value = null) + { + // update active_filters + if (! is_null($value)) { + $this->active_filters['testcases_to_show'] = $value; + } + + // Since a new filter in active_filters has been set from outside class after + // saving of session data has already happened in constructor, + // we explicitly update data in session after this change here. + $this->save_session_data(); + } + + /** + * Active filters will be saved to $_SESSION. + * If there already is data for the active mode and token, it will be overwritten. + * This data will be read from pages in the right frame. + * This solves the problems with too long URLs. + * See issue 3516 in Mantis for a little bit more information/explanation. + * The therefore caused new problem that would arise now if + * a user uses the same feature simultaneously in multiple browser tabs + * is solved be the additional measure of using a form token. + * + * @author Andreas Simon + * @return $tl::OK + */ + public function save_session_data() + { + if (! isset($_SESSION[$this->mode]) || is_null($_SESSION[$this->mode]) || + ! is_array($_SESSION[$this->mode])) { + $_SESSION[$this->mode] = array(); + } + + $_SESSION[$this->mode][$this->form_token] = $this->active_filters; + $_SESSION[$this->mode][$this->form_token]['timestamp'] = time(); + + return tl::OK; + } + + /** + * Old filter data for active mode will be deleted from $_SESSION. + * It happens automatically after a session has expired and a user therefore + * has to log in again, but here we can configure an additional time limit + * only for this special filter part in session data. + * + * @author Andreas Simon + * @param int $token_validity_duration + * data older than given timespan will be deleted + */ + public function delete_old_session_data($token_validity_duration = 0) + { + + // TODO this duration could maybe also be configured in config/const.inc.php + + // how long shall the data remain in session before it will be deleted? + if (! is_numeric($token_validity_duration) || + $token_validity_duration <= 0) { + $token_validity_duration = 60 * 60 * 1; // one hour as default + } + + // delete all tokens from session that are older than given age + if (isset($_SESSION[$this->mode]) && is_array($_SESSION[$this->mode])) { + foreach ($_SESSION[$this->mode] as $token => $data) { + if ($data['timestamp'] < (time() - $token_validity_duration)) { + unset($_SESSION[$this->mode][$token]); // too old, delete! + } + } + } + } + + /** + */ + public function delete_own_session_data() + { + if (isset($_SESSION[$this->mode]) && + isset($_SESSION[$this->mode][$this->form_token])) { + unset($_SESSION[$this->mode][$this->form_token]); + } + } + + /** + * Generates a form token, which will be used to identify the relationship + * between left navigator-frame with its settings and right frame. + */ + protected function generate_form_token() + { + // Notice: I am just generating an integer here for the token. + // Since this is not any security relevant stuff like a password hash or similar, + // but only a means to separate multiple tabs a single user opens, this should suffice. + // If we should some day decide that an integer is not enough, + // we just have to change this one method and everything will still work. + $min = 1234567890; // not magic, just some large number so the tokens don't get too short + $max = mt_getrandmax(); + $token = 0; + + // generate new tokens until we find one that doesn't exist yet + do { + $token = mt_rand($min, $max); + } while (isset($_SESSION[$this->mode][$token])); + + $this->form_token = $token; + } + + /** + * Active filters will be formatted as a GET-argument string. + * + * @return string $string the formatted string with active filters + */ + public function get_argument_string() + { + static $string = null; // cache for repeated calls of this method + + if (! $string) { + $string = ''; + + // important: the token with which the page in right frame can access data in session + $string .= '&form_token=' . $this->form_token; + + $key2loop = array( + 'setting_build', + 'setting_platform' + ); + foreach ($key2loop as $kiwi) { + if ($this->settings[$kiwi]) { + $string .= "&{$kiwi}={$this->settings[$kiwi]['selected']}"; + } + } + if ($this->active_filters['filter_priority'] > 0) { + $string .= '&filter_priority=' . + $this->active_filters['filter_priority']; + } + + $keyword_list = null; + if (is_array($this->active_filters['filter_keywords'])) { + $keyword_list = implode(',', + $this->active_filters['filter_keywords']); + } elseif ($this->active_filters['filter_keywords']) { + $keyword_list = $this->active_filters['filter_keywords']; + } + + // Need to undertand why for other filters that also are array + // we have choosen to serialize, and here not. + // may be to avoid more refactoring + if ($keyword_list) { + $string .= '&filter_keywords=' . $keyword_list . + '&filter_keywords_filter_type=' . + $this->active_filters['filter_keywords_filter_type']; + } + + // Using serialization + if ($this->active_filters['filter_assigned_user']) { + $string .= '&filter_assigned_user=' . + json_encode($this->active_filters['filter_assigned_user']) . + '&filter_assigned_user_include_unassigned=' . + ($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0'); + } + + if ($this->active_filters['filter_result_result']) { + $string .= '&filter_result_result=' . + json_encode($this->active_filters['filter_result_result']) . + '&filter_result_method=' . + $this->active_filters['filter_result_method'] . + '&filter_result_build=' . + $this->active_filters['filter_result_build']; + } + + if (! is_null($this->active_filters['filter_bugs'])) { + $string .= '&' . + http_build_query( + array( + 'filter_bugs' => $this->active_filters['filter_bugs'] + )); + } + } + + return $string; + } + + /** + * Build the tree menu for generation of JavaScript test case tree. + * Depending on mode and user's selections in user interface, + * either a completely filtered tree will be build and returned, + * or only the minimal necessary data to "lazy load" + * the objects in the tree by later Ajax calls. + * No return value - all variables will be stored in gui object + * which is passed by reference. + * + * @author Andreas Simon + * @param object $gui + * Reference to GUI object (data will be written to it) + */ + public function build_tree_menu(&$gui) + { + $tree_menu = null; + $filters = $this->get_active_filters(); + $loader = ''; + $children = "[]"; + $cookie_prefix = ''; + + // by default, disable drag and drop, then later enable if needed + $drag_and_drop = new stdClass(); + $drag_and_drop->enabled = false; + $drag_and_drop->BackEndUrl = ''; + $drag_and_drop->useBeforeMoveNode = false; + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + switch ($this->mode) { + case 'plan_add_mode': + // improved cookiePrefix - + // tree in plan_add_mode is only used for add/removed test cases features + // and shows all test cases defined within test project, + // but as test cases are added to a specified test plan -> store state for each test plan + // + // usage of wrong values in $this->args->xyz for cookiePrefix instead of correct + // values in $filters->setting_xyz + $cookie_prefix = "add_remove_tc_tplan_id_{$filters['setting_testplan']}_"; + + // get filter mode + $key = 'setting_testsgroupby'; + $mode = $this->args->$key; + + if ($this->do_filtering) { + if ($mode == 'mode_req_coverage') { + + $options = array( + 'for_printing' => NOT_FOR_PRINTING, + 'exclude_branches' => null + ); + + $tree_menu = generateTestReqCoverageTree($this->db, + $this->args->testproject_id, + $this->args->testproject_name, $filters, $options); + } + + $root_node = $tree_menu->rootnode; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + } else { + if ($mode == 'mode_req_coverage') { + $loader = $gui->basehref . + 'lib/ajax/getreqcoveragenodes.php?mode=reqspec&' . + "root_node={$this->args->testproject_id}"; + + $req_qty = count( + $this->testproject_mgr->get_all_requirement_ids( + $this->args->testproject_id)); + + $root_node = new stdClass(); + $root_node->href = "javascript:EP({$this->args->testproject_id})"; + $root_node->id = $this->args->testproject_id; + $root_node->name = $this->args->testproject_name . + " ($req_qty)"; + $root_node->testlink_node_type = 'testproject'; + } + } + break; + } + + $gui->tree = $tree_menu; + + $gui->ajaxTree = new stdClass(); + $gui->ajaxTree->loader = $loader; + $gui->ajaxTree->root_node = $root_node; + $gui->ajaxTree->children = $children; + $gui->ajaxTree->cookiePrefix = $cookie_prefix; + $gui->ajaxTree->dragDrop = $drag_and_drop; + } + + /** + */ + public function init_setting_refresh_tree_on_action() + { + $key = 'setting_refresh_tree_on_action'; + $hidden_key = 'hidden_setting_refresh_tree_on_action'; + $selection = 0; + + $this->settings[$key] = array(); + $this->settings[$key][$hidden_key] = false; + + // look where we can find the setting - POST, SESSION, config? + if (isset($this->args->{$key})) { + $selection = 1; + } elseif (isset($this->args->{$hidden_key})) { + $selection = 0; + } elseif (isset($_SESSION[$key])) { + $selection = $_SESSION[$key]; + } else { + $spec_cfg = config_get('spec_cfg'); + $selection = ($spec_cfg->automatic_tree_refresh > 0) ? 1 : 0; + } + + $this->settings[$key]['selected'] = $selection; + $this->settings[$key][$hidden_key] = $selection; + $_SESSION[$key] = $selection; + } + + /** + */ + public function init_setting_get_parent_child_relation() + { + $key = 'setting_get_parent_child_relation'; + $hidden_key = 'hidden_setting_get_parent_child_relation'; + $selection = 0; + + $this->settings[$key] = array(); + $this->settings[$key][$hidden_key] = false; + + // look where we can find the setting - POST, SESSION + if (isset($this->args->{$key})) { + $selection = 1; + } elseif (isset($this->args->{$hidden_key})) { + $selection = 0; + } elseif (isset($_SESSION[$key])) { + $selection = $this->settings[$key]; + } else { + $selection = 0; + } + + $this->settings[$key]['selected'] = $selection; + $this->settings[$key][$hidden_key] = $selection; + $_SESSION[$key] = $selection; + } + + /** + */ + public function init_setting_testplan() + { + if (is_null($this->testplan_mgr)) { + $this->testplan_mgr = new testplan($this->db); + } + + $key = 'setting_testplan'; + $testplans = $this->user->getAccessibleTestPlans($this->db, + $this->args->testproject_id); + if (isset($_SESSION['testplanID']) && + $_SESSION['testplanID'] != $this->args->{$key}) { + // testplan was changed, we need to reset all filters + // --> they were chosen for another testplan, not this one! + $this->args->reset_filters = true; + + // check if user is allowed to set chosen testplan before changing + foreach ($testplans as $plan) { + if ($plan['id'] == $this->args->{$key}) { + setSessionTestPlan($plan); + } + } + } + + // now load info from session + $info = $this->testplan_mgr->get_by_id($_SESSION['testplanID']); + $this->args->testplan_name = $info['name']; + $this->args->testplan_id = $info['id']; + $this->args->{$key} = $info['id']; + $this->settings[$key]['selected'] = $info['id']; + + // Final filtering based on mode: + // Now get all selectable testplans for the user to display. + // For execution: + // For assign test case execution feature: + // don't take testplans into selection which have no (active/open) builds! + // + // For plan add mode: + // add every plan no matter if he has builds or not. + + foreach ($testplans as $plan) { + $add_plan = $this->mode == 'plan_add_mode' || + ($this->mode == 'plan_mode' && + $this->args->feature != 'tc_exec_assignment'); + + if (! $add_plan) { + $builds = $this->testplan_mgr->get_builds($plan['id'], + testplan::GET_ACTIVE_BUILD, testplan::GET_OPEN_BUILD); + $add_plan = (is_array($builds) && count($builds)); + } + + if ($add_plan) { + $this->settings[$key]['items'][$plan['id']] = $plan['name']; + } + } + } + + /** + */ + protected function init_setting_testsgroupby() + { + $key = 'setting_testsgroupby'; + + // now load info from session + $mode = (isset($_REQUEST[$key])) ? $_REQUEST[$key] : 0; + $this->args->testsgroupedby_mode = $mode; + $this->args->{$key} = $mode; + $this->settings[$key]['selected'] = $mode; + + $k2l = array( + 'mode_test_suite', + 'mode_req_coverage' + ); + foreach ($k2l as $ak) { + $this->settings[$key]['items'][$ak] = lang_get($ak); + } + } + + /* + * + */ + public function init_filter_tc_id() + { + $key = 'filter_tc_id'; + $selection = $this->args->{$key}; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $tc_cfg = config_get('testcase_cfg'); + $tc_prefix = $this->testproject_mgr->getTestCasePrefix( + $this->args->testproject_id); + $tc_prefix .= $tc_cfg->glue_character; + + if (! $selection || $selection == $tc_prefix || + $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection ? $selection : $tc_prefix + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_testcase_name() + { + $key = 'filter_testcase_name'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_toplevel_testsuite() + { + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $key = 'filter_toplevel_testsuite'; + $first_level_suites = $this->testproject_mgr->get_first_level_test_suites( + $this->args->testproject_id, 'smarty_html_options'); + + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + // this filter should only be visible if there are any top level testsuites + $this->filters[$key] = null; + if ($first_level_suites) { + $this->filters[$key] = array( + 'items' => array( + 0 => '' + ), + 'selected' => $selection, + 'exclude_branches' => array() + ); + + foreach ($first_level_suites as $suite_id => $suite_name) { + $this->filters[$key]['items'][$suite_id] = $suite_name; + if ($selection && $suite_id != $selection) { + $this->filters[$key]['exclude_branches'][$suite_id] = 'exclude_me'; + } + } + + // Important: This is the only case in which active_filters contains the items + // which have to be deleted from tree, instead of the other way around. + $this->active_filters[$key] = $this->filters[$key]['exclude_branches']; + } else { + $this->active_filters[$key] = null; + } + } + + /** + * + * @internal revision + * @since 1.9.13 + * mode this affect domain + */ + public function init_filter_keywords() + { + $key = 'filter_keywords'; + $type = 'filter_keywords_filter_type'; + $this->filters[$key] = false; + $keywords = null; + $l10n = init_labels( + array( + 'logical_or' => null, + 'logical_and' => null, + 'not_linked' => null + )); + + switch ($this->mode) { + case 'edit_mode': + case 'plan_add_mode': + // we need the keywords for the whole testproject + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $keywords = $this->testproject_mgr->get_keywords_map( + $this->args->testproject_id); + break; + + default: + // otherwise (not in edit mode), we want only keywords assigned to testplan + if (! $this->testplan_mgr) { + $this->testplan_mgr = new testplan($this->db); + } + $tplan_id = $this->settings['setting_testplan']['selected']; + $keywords = $this->testplan_mgr->get_keywords_map($tplan_id, + ' ORDER BY keyword '); + break; + } + + $special = array( + 'domain' => array(), + 'filter_mode' => array() + ); + switch ($this->mode) { + case 'edit_mode': + $special['domain'] = array( + - 1 => $this->option_strings['without_keywords'], + 0 => $this->option_strings['any'] + ); + $special['filter_mode'] = array( + 'NotLinked' => $l10n['not_linked'] + ); + break; + + case 'execution_mode': + case 'plan_add_mode': + case 'plan_mode': + default: + $special['domain'] = array( + 0 => $this->option_strings['any'] + ); + $special['filter_mode'] = array(); + break; + } + + $selection = $this->args->{$key}; + $type_selection = $this->args->{$type}; + + // are there any keywords? + if (! is_null($keywords) && count($keywords)) { + $this->filters[$key] = array(); + + if (! $selection || ! $type_selection || $this->args->reset_filters) { + // default values for filter reset + $selection = null; + $type_selection = 'Or'; + } else { + $this->do_filtering = true; + } + + // data for the keywords themselves + $this->filters[$key]['items'] = $special['domain'] + $keywords; + $this->filters[$key]['selected'] = $selection; + $this->filters[$key]['size'] = min( + count($this->filters[$key]['items']), + self::ADVANCED_FILTER_ITEM_QUANTITY); + + // additional data for the filter type (logical and/or) + $this->filters[$key][$type] = array(); + $this->filters[$key][$type]['items'] = array( + 'Or' => $l10n['logical_or'], + 'And' => $l10n['logical_and'] + ) + $special['filter_mode']; + $this->filters[$key][$type]['selected'] = $type_selection; + } + + // set the active value to filter + // delete keyword filter if "any" (0) is part of the selection - regardless of filter mode + if (is_array($this->filters[$key]['selected']) && + in_array(0, $this->filters[$key]['selected'])) { + $this->active_filters[$key] = null; + } else { + $this->active_filters[$key] = $this->filters[$key]['selected']; + } + $this->active_filters[$type] = $selection ? $type_selection : null; + } + + // TICKET 4353: added active/inactive filter + public function init_filter_active_inactive() + { + $key = 'filter_active_inactive'; + + $items = array( + DO_NOT_FILTER_INACTIVE_TESTCASES => $this->option_strings['any'], + IGNORE_INACTIVE_TESTCASES => lang_get('show_only_active_testcases'), + IGNORE_ACTIVE_TESTCASES => lang_get('show_only_inactive_testcases') + ); + + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => $items, + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_importance() + { + // show this filter only if test priority management is enabled + $key = 'filter_importance'; + $this->active_filters[$key] = null; + $this->filters[$key] = false; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $tp_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + $enabled = $tp_info['opt']->testPriorityEnabled; + + if ($enabled) { + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + + // Only drawback: no new user defined importance can be managed + // may be is a good design choice + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'], + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $this->filters[$key]['size'] = count($this->filters[$key]['items']); + $this->active_filters[$key] = $selection; + } + } + + /** + */ + public function init_filter_priority() + { + // This is a special case of filter: the menu items don't get initialized here, + // they are available as a global smarty variable. So the only thing to be managed + // here is the selection by user. + $key = 'filter_priority'; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $tp_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + $enabled = $tp_info['opt']->testPriorityEnabled; + + $this->active_filters[$key] = null; + $this->filters[$key] = false; + + if ($enabled) { + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + } + + /** + */ + public function init_filter_execution_type() + { + if (! $this->tc_mgr) { + $this->tc_mgr = new testcase($this->db); + } + $key = 'filter_execution_type'; + + $selection = $this->args->{$key}; + // handle filter reset + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => array(), + 'selected' => $selection + ); + + // load available execution types + // add "any" string to these types at index 0 as default selection + $this->filters[$key]['items'] = $this->tc_mgr->get_execution_types(); + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'] + ) + $this->filters[$key]['items']; + + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_assigned_user() + { + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $key = 'filter_assigned_user'; + $unassigned_key = 'filter_assigned_user_include_unassigned'; + $tplan_id = $this->settings['setting_testplan']['selected']; + + // set selection to default (any), only change if value is sent by user and reset is not requested + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $tproject_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + + $all_testers = getTestersForHtmlOptions($this->db, $tplan_id, + $tproject_info, null, + array( + TL_USER_ANYBODY => $this->option_strings['any'], + TL_USER_NOBODY => $this->option_strings['none'], + TL_USER_SOMEBODY => $this->option_strings['somebody'] + ), 'any'); + $visible_testers = $all_testers; + + // in execution mode the rights of the user have to be regarded + if ($this->mode == 'execution_mode') { + $role = $this->user->getEffectiveRole($this->db, + $this->args->testproject_id, $tplan_id); + + $simple_tester_roles = array_flip( + $this->configuration->exec_cfg->simple_tester_roles); + + // check the user's rights to see what he may do + $right_to_execute = $role->hasRight('testplan_execute'); + $right_to_manage = $role->hasRight('testplan_planning'); + + $simple = false; + if (isset($simple_tester_roles[$role->dbID]) || + ($right_to_execute && ! $right_to_manage)) { + // user is only simple tester and may not see/execute everything + $simple = true; + } + + $view_mode = $simple ? $this->configuration->exec_cfg->view_mode->tester : 'all'; + + if ($view_mode != 'all') { + $visible_testers = (array) $this->user->getDisplayName(); + $selection = (array) $this->user->dbID; + } + + // re-enable option "user_filter_default" + if (! $selection && + $this->configuration->exec_cfg->user_filter_default == + 'logged_user') { + $selection = (array) $this->user->dbID; + } + } + + $this->filters[$key] = array( + 'items' => $visible_testers, + 'selected' => $selection, + $unassigned_key => $this->args->{$unassigned_key} + ); + + // which value shall be passed to tree generation class? + + if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection)) || + ($selection == TL_USER_ANYBODY)) { + // delete user assignment filter if "any user" is part of the selection + $this->active_filters[$key] = null; + $this->active_filters[$unassigned_key] = 0; + } + + if (is_array($selection)) { + // get keys of the array as values + $this->active_filters[$key] = array_flip($selection); + foreach ($this->active_filters[$key] as $user_key => $user_value) { + $this->active_filters[$key][$user_key] = $user_key; + } + $this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key]; + } + } + + /** + */ + public function init_filter_result() + { + $result_key = 'filter_result_result'; + $method_key = 'filter_result_method'; + $build_key = 'filter_result_build'; + + if (is_null($this->testplan_mgr)) { + $this->testplan_mgr = new testplan($this->db); + } + $tplan_id = $this->settings['setting_testplan']['selected']; + + $this->configuration->results = config_get('results'); + + // determine, which config to load and use for filter methods - depends on mode! + $cfg = ($this->mode == 'execution_mode') ? 'execution_filter_methods' : 'execution_assignment_filter_methods'; + $this->configuration->filter_methods = config_get($cfg); + + // + // CRITIC - Differences bewteen this configuration and + // (file const.inc.php) + // $tlCfg->execution_filter_methods['default_type'] + // $tlCfg->execution_assignment_filter_methods['default_type'] + // + // Will create issues: you will see an string on HTML SELECT, but code + // returned on submit will not code for string you are seeing.!!!! + // + // determine which filter method shall be selected by the JS function in template, + // when only one build is selectable by the user + $js_key_to_select = 0; + if ($this->mode == 'execution_mode') { + $js_key_to_select = $this->configuration->filter_methods['status_code']['current_build']; + } elseif ($this->mode == 'plan_mode') { + $js_key_to_select = $this->configuration->filter_methods['status_code']['specific_build']; + } + + // values selected by user + $result_selection = $this->args->$result_key; + $method_selection = $this->args->$method_key; + $build_selection = $this->args->$build_key; + + // default values + $default_filter_method = $this->configuration->filter_methods['default_type']; + $any_result_key = $this->configuration->results['status_code']['all']; + $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, + testplan::GET_ACTIVE_BUILD); + + if (is_null($method_selection)) { + $method_selection = $default_filter_method; + } + + if (is_null($result_selection) || $this->args->reset_filters) + // if ($this->args->reset_filters) + { + // no selection yet or filter reset requested + $result_selection = $any_result_key; + $method_selection = $default_filter_method; + $build_selection = $newest_build_id; + } else { + $this->do_filtering = true; + } + + // init array structure + $key = 'filter_result'; + $this->filters[$key] = array( + $result_key => array( + 'items' => null, + 'selected' => $result_selection + ), + $method_key => array( + 'items' => array(), + 'selected' => $method_selection, + 'js_selection' => $js_key_to_select + ), + $build_key => array( + 'items' => null, + 'selected' => $build_selection + ) + ); + + // init menu for result selection by function from exec.inc.php + $this->filters[$key][$result_key]['items'] = createResultsMenu(); + $this->filters[$key][$result_key]['items'][$any_result_key] = $this->option_strings['any']; + + // init menu for filter method selection + foreach ($this->configuration->filter_methods['status_code'] as $statusname => $statusshortcut) { + $code = $this->configuration->filter_methods['status_code'][$statusname]; + $this->filters[$key][$method_key]['items'][$code] = lang_get( + $this->configuration->filter_methods['status_label'][$statusname]); + } + + // init menu for build selection + $this->filters[$key][$build_key]['items'] = $this->testplan_mgr->get_builds_for_html_options( + $tplan_id, testplan::GET_ACTIVE_BUILD); + + // if "any" is selected, nullify the active filters + if ((is_array($result_selection) && + in_array($any_result_key, $result_selection)) || + $result_selection == $any_result_key) { + $this->active_filters[$result_key] = null; + $this->active_filters[$method_key] = null; + $this->active_filters[$build_key] = null; + $this->filters[$key][$result_key]['selected'] = $any_result_key; + } else { + $this->active_filters[$result_key] = $result_selection; + $this->active_filters[$method_key] = $method_selection; + $this->active_filters[$build_key] = $build_selection; + } + } + + /** + */ + public function init_filter_bugs() + { + $key = str_replace('init_', '', __FUNCTION__); + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + /** + * + * @internal revisions + * @since 1.9.14 + * allow multiple selection (if advanced mode) + */ + public function init_filter_workflow_status() + { + $key = 'filter_workflow_status'; + if (! $this->tc_mgr) { + $this->tc_mgr = new testcase($this->db); + } + + // handle filter reset + $cfx = $this->configuration->{$key . "_values"}; + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + if (! is_null($this->args->caller) && ! $selection) { + $selection = null; + } elseif (count($cfx) > 0) { + $selection = $cfx; + $this->do_filtering = true; + } else { + $selection = null; + } + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => array(), + 'selected' => $selection + ); + + // load domain + // add "any" string to these types at index 0 as default selection + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'] + ) + $this->tc_mgr->getWorkFlowStatusDomain(); + + $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), + self::ADVANCED_FILTER_ITEM_QUANTITY); + + $this->active_filters[$key] = $selection; + } + + /** + * + * @used-by __construct + */ + public function initTreeOptions() + { + $this->treeOpt['plan_mode'] = new stdClass(); + $this->treeOpt['plan_mode']->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; + $this->treeOpt['plan_mode']->useColours = COLOR_BY_TC_STATUS_OFF; + $this->treeOpt['plan_mode']->testcases_colouring_by_selected_build = DISABLED; + $this->treeOpt['plan_mode']->absolute_last_execution = true; // hmm probably useless + } + + /** + */ + protected function init_advanced_filter_mode() + { + switch ($this->mode) { + case 'edit_mode': + $this->advanced_filter_mode = true; + break; + + default: + $m2c = __FUNCTION__; + parent::$m2c(); + break; + } + } + + /** + */ + public function init_filter_doc_id() + { + $key = 'filter_doc_id'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_title() + { + $key = 'filter_title'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + + /* + * + */ + public function init_filter_status() + { + $key = 'filter_status'; + $selection = $this->args->{$key}; + + // get configured statuses and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_cfg->status_labels); + + // BUGID 3852 + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array('0', $selection, true))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_type() + { + $key = 'filter_type'; + $selection = $this->args->{$key}; + + // get configured types and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_cfg->type_labels); + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_spec_type() + { + $key = 'filter_spec_type'; + $selection = $this->args->{$key}; + + // get configured types and add "any" string to menu + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) init_labels($this->configuration->req_spec_cfg->type_labels); + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } + + /** + */ + public function init_filter_coverage() + { + $key = 'filter_coverage'; + $this->filters[$key] = false; + $this->active_filters[$key] = null; + + // is coverage management enabled? + if ($this->configuration->req_cfg->expected_coverage_management) { + $selection = $this->args->{$key}; + + if (! $selection || ! is_numeric($selection) || + $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } + } + + /** + */ + public function init_filter_relation() + { + $key = 'filter_relation'; + + // are relations enabled? + if ($this->configuration->req_cfg->relations->enable) { + $selection = $this->args->{$key}; + + if (! $this->req_mgr) { + $this->req_mgr = new requirement_mgr($this->db); + } + + $req_relations = $this->req_mgr->init_relation_type_select(); + + // special case here: + // for equal type relations (where it doesn't matter if we find source or destination) + // we have to remove the source identficator from the array key + foreach ($req_relations['equal_relations'] as $old_key) { + // set new key in array and delete old one + $new_key = (int) str_replace("_source", "", $old_key); + $req_relations['items'][$new_key] = $req_relations['items'][$old_key]; + unset($req_relations['items'][$old_key]); + } + + $items = array( + self::ANY => $this->option_strings['any'] + ) + (array) $req_relations['items']; + + if (! $selection || $this->args->reset_filters || + (is_array($selection) && in_array(self::ANY, $selection))) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection, + 'items' => $items + ); + $this->active_filters[$key] = $selection; + } else { + // not enabled, just nullify + $this->filters[$key] = false; + $this->active_filters[$key] = null; + } + } + + /** + */ + protected function getCustomFields() + { + if (! $this->req_mgr) { + $this->req_mgr = new requirement_mgr($this->db); + $this->cfield_mgr = &$this->req_mgr->cfield_mgr; + } + + return $this->req_mgr->get_linked_cfields(null, null, + $this->args->testproject_id); + } +} diff --git a/lib/functions/tlTestCaseFilterControl.class.php b/lib/functions/tlTestCaseFilterControl.class.php index 7074463b7a..e6c7c98a2c 100644 --- a/lib/functions/tlTestCaseFilterControl.class.php +++ b/lib/functions/tlTestCaseFilterControl.class.php @@ -1,4 +1,5 @@ assign test case execution * --> update linked test case versions * --> set urgent tests - * - * - execNavigator.php/tpl in "execution_mode" + * + * - execNavigator.php/tpl in "execution_mode" * --> test execution - * + * * - planAddTCNavigator.php/tpl in "plan_add_mode" * --> add/remove test cases - * + * * - listTestCases.php/tcTree.tpl in "edit_mode" * --> edit test specification * --> assign keywords @@ -39,23 +40,23 @@ * -------------------------------------------------------- * An important note on request-URL too large (BUGID 3516) * -------------------------------------------------------- - * + * * That problem has been solved by attaching some data (the set of active filters, settings and * testcase IDs to show if filtering has been done) to session. - * + * * Since a user can have the same feature open in multiple tabs, that alone is not enough to * solve this issue. When a user opens e.g. the test case execution page and sets filter options * there, then opens the same page in another tab, the data saved in session would also be * applied to this second tab although no filter options have been set there yet by the user. - * + * * This has now been solved by a so called form token. This token is, on first opening of a * navigator frame, generated by the method generate_form_token() and then stored in a member - * variable with the name $form_token. This token will be stored in an identically named hidden + * variable with the name $form_token. This token will be stored in an identically named hidden * input field within the HTML filter form, so it gets sent by POST to every called page. - * It is also attached to the GET argument string returned by get_argument_string() that gets - * passed to multiple JavaScript functions, which are used to open nodes from the tree in the + * It is also attached to the GET argument string returned by get_argument_string() that gets + * passed to multiple JavaScript functions, which are used to open nodes from the tree in the * left frame in a new page in the right frame. - * + * * So the token is used to identify (from pages within the right frame) the data that got stored * for them in session by the navigator page in the left frame. * If the navigator page calls itself (when the user presses one of the submit buttons in the form), @@ -63,84 +64,84 @@ * in session, instead of generating a new token blindly on every page call no matter where the * call comes from. But if the user opens a new tab, the new navigator page knows this because * no token has been sent to it - so it generates a new one. - * + * * The data is saved in session in the form of an array like this example: - * - * [execution_mode] => Array // "mode" used by navigator - * ( - * [1986901204] => Array // form token to identify the correct tab - * ( - * [filter_keywords_filter_type] => Or // the active filters and settings, - * [filter_result_result] => f // prefixed with "filter_" and "setting_" - * [filter_result_method] => 3 - * [filter_result_build] => 71 - * [filter_assigned_user_include_unassigned] => 1 - * [filter_testcase_name] => - * [filter_toplevel_testsuite] => Array - * ( - * ) * - * [filter_keywords] => - * [filter_priority] => 3 - * [filter_execution_type] => 2 - * [filter_assigned_user] => Array - * ( - * [3] => 3 - * ) - * - * [filter_custom_fields] => - * [setting_testplan] => 4990 - * [setting_build] => 71 - * [setting_platform] => - * [setting_refresh_tree_on_action] => 1 - * [testcases_to_show] => Array // The internal IDs of the test cases which - * ( // where not filtered out by user's choices. - * [0] => 1852 // This was the part which earlier caused - * [1] => 60 // the error because of the too long URL. - * [2] => 2039 - * [3] => 2033 - * [4] => 2065 - * [5] => 2159 - * [6] => 3733 - * ) + * [execution_mode] => Array // "mode" used by navigator + * ( + * [1986901204] => Array // form token to identify the correct tab + * ( + * [filter_keywords_filter_type] => Or // the active filters and settings, + * [filter_result_result] => f // prefixed with "filter_" and "setting_" + * [filter_result_method] => 3 + * [filter_result_build] => 71 + * [filter_assigned_user_include_unassigned] => 1 + * [filter_testcase_name] => + * [filter_toplevel_testsuite] => Array + * ( + * ) + * + * [filter_keywords] => + * [filter_priority] => 3 + * [filter_execution_type] => 2 + * [filter_assigned_user] => Array + * ( + * [3] => 3 + * ) + * + * [filter_custom_fields] => + * [setting_testplan] => 4990 + * [setting_build] => 71 + * [setting_platform] => + * [setting_refresh_tree_on_action] => 1 + * [testcases_to_show] => Array // The internal IDs of the test cases which + * ( // where not filtered out by user's choices. + * [0] => 1852 // This was the part which earlier caused + * [1] => 60 // the error because of the too long URL. + * [2] => 2039 + * [3] => 2033 + * [4] => 2065 + * [5] => 2159 + * [6] => 3733 + * ) + * + * [timestamp] => 1277727920 // additional means to check age of session data + * ) + * ) * - * [timestamp] => 1277727920 // additional means to check age of session data - * ) - * ) - * * The access to this data can be done in the following way from the right frame page: - * + * * $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; * $mode = 'execution_mode'; * $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) - * ? $_SESSION[$mode][$form_token] : null; - * + * ? $_SESSION[$mode][$form_token] : null; + * * The variable $session_data then holds the array with all the active filters, * settings and filtered test case IDs in it, or is null if nothing has been stored yet * in the session. - * + * * But now we have another problem: * There can be one array for each mode in the session. In each of these arrays is a set of * further arrays with the form tokens as keys and the filter information in it. - * If a user now opens the same page more than once in a row (by switching back and forth + * If a user now opens the same page more than once in a row (by switching back and forth * between features or by using the same feature in multiple tabs) there can be more and more * arrays with filter information in this set of arrays. - * + * * Because of this, an additional timestamp is written into each of these information arrays. - * On each storage process that writes information into the session triggered by a call + * On each storage process that writes information into the session triggered by a call * to a navigator page, the timestamp gets refreshed if an old token has been reused or * it gets created with the creation of a new data array. - * + * * This timestamp can be used to delete old arrays with information that is not needed anymore. - * Since we have no means to otherwise detect the case that a user has closed the tab - * and doesn't need this information in the session anymore, we have to determine the age of - * those arrays with the timestamp and delete everything that is older than a certain given + * Since we have no means to otherwise detect the case that a user has closed the tab + * and doesn't need this information in the session anymore, we have to determine the age of + * those arrays with the timestamp and delete everything that is older than a certain given * threshold. This is done by the method delete_old_session_data() which is automatically called - * from the contstructor of this class. It checks the age of all the saved + * from the contstructor of this class. It checks the age of all the saved * arrays inside the array for the active mode and then deletes everything that's older than * the given threshold. This threshold can be passed as a parameter to the method, otherwise a * default value of one hour is used. - * + * * If a user logs out of TestLink, of course all this data in the session is deleted, * no matter if the one hour threshold has passed or not. * ------------------------------------------------------------------------------------------------ @@ -158,2048 +159,2174 @@ * @uses tlPlatform * @uses testcase */ -class tlTestCaseFilterControl extends tlFilterControl { - - /** - * Testcase manager object. - * Initialized not in constructor, only on first use to save resources. - * @var testcase - */ - private $tc_mgr = null; - - /** - * Platform manager object. - * Initialized not in constructor, only on first use to save resources. - * @var tlPlatform - */ - private $platform_mgr = null; - - - /** - * Testplan manager object. - * Initialized not in constructor, only on first use to save resources. - * @var testplan - */ - private $testplan_mgr = null; - - /** - * This array contains all possible filters. - * It is used as a helper to iterate over all the filters in some loops. - * It also sets options how and from where to load the parameters with - * input fetching functions in init_args()-method. - * Its keys are the names of the settings (class constants are used), - * its values are the arrays for the input parser. - * @var array - */ - - /* MAGIC NUMBERS are related to field size - * filter_tc_id: 0,30 arbitrary - * filter_bugs: 240 = 60 x 4 (60 bug_id size on execution_bugs table) - */ - private $all_filters; - - /** - * This array is used as an additional security measure. It maps all available - * filters to the mode in which they can be used. If a user tries to - * enable filters in config.inc.php which are not defined inside this array, - * this will be simply ignored instead of trying to initialize the filter - * no matter wether it has been implemented or not. - * The keys inside this array are the modes defined above as class constants. - * So it can be checked if a filter is available in a given mode without - * relying only on the config parameter. - * @var array - */ - private $mode_filter_mapping = - array('edit_mode' => array('filter_tc_id', - 'filter_testcase_name', - 'filter_toplevel_testsuite', - 'filter_keywords', - 'filter_workflow_status', - 'filter_importance', - 'filter_execution_type', - 'filter_custom_fields', - 'filter_platforms'), - 'execution_mode' => array('filter_tc_id', - 'filter_testcase_name', - 'filter_toplevel_testsuite', - 'filter_keywords', - 'filter_priority', - 'filter_execution_type', - 'filter_assigned_user', - 'filter_custom_fields', - 'filter_result', - 'filter_bugs'), - 'plan_mode' => array('filter_tc_id', - 'filter_testcase_name', - 'filter_toplevel_testsuite', - 'filter_keywords', - 'filter_priority', - 'filter_execution_type', - // enabled user filter when assigning testcases - 'filter_assigned_user', - 'filter_custom_fields', - 'filter_result'), - 'plan_add_mode' => array('filter_tc_id', - 'filter_testcase_name', - 'filter_toplevel_testsuite', - 'filter_keywords', - 'filter_importance', - 'filter_execution_type', - 'filter_workflow_status', - 'filter_custom_fields', - 'filter_platforms')); - - /** - * This array contains all possible settings. It is used as a helper - * to later iterate over all possibilities in loops. - * Its keys are the names of the settings, its values the arrays for the input parser. - * @var array - */ - private $all_settings = [ - 'setting_testplan' => ["REQUEST", tlInputParameter::INT_N], - 'setting_build' => ["REQUEST", tlInputParameter::INT_N], - 'setting_platform' => ["REQUEST", tlInputParameter::INT_N], - 'setting_testsgroupby' => ["REQUEST", tlInputParameter::INT_N], - 'setting_refresh_tree_on_action' => ["POST", tlInputParameter::CB_BOOL], - 'setting_exec_tree_counters_logic' => ["REQUEST", tlInputParameter::INT_N] - ]; - - /** - * This array is used to map the modes to their available settings. - * @var array - */ - - private $mode_setting_mapping = - array('edit_mode' => array('setting_refresh_tree_on_action'), - 'execution_mode' => array('setting_testplan','setting_build', - 'setting_platform', - 'setting_exec_tree_counters_logic', - 'setting_refresh_tree_on_action'), - 'plan_mode' => array('setting_testplan','setting_build', - 'setting_platform', - 'setting_refresh_tree_on_action'), - 'plan_add_mode' => array('setting_testplan','setting_testsgroupby', - 'setting_refresh_tree_on_action')); - - /** - * The mode used. Depending on the feature for which this class will be instantiated. - * This mode defines which filter configuration will be loaded from config.inc.php - * and therefore which filters will be loaded and used for the templates. - * Value has to be one of the class constants for mode, default is edit mode. - * @var string - */ - private $mode = 'edit_mode'; - - - /** - * Options to be used accordin to $this->mode, to build tree - * @var array - */ - private $treeOpt = array(); - - - /** - * The token that will be used to identify the relationship between left frame - * (with navigator) and right frame (which displays execution of test case e.g.) in session. - * @var string - */ - public $form_token = null; - - - - /** - * - * @param database $dbHandler - * @param string $mode can be edit_mode/execution_mode/plan_mode/plan_add_mode, depending on usage - */ - public function __construct(&$dbHandler, $mode = 'edit_mode') { - - // execution order is CRITIC - $this->setFiltersDefinition(); - - // set mode to define further actions before calling parent constructor - $this->mode = array_key_exists($mode,$this->mode_filter_mapping) ? $mode : 'edit_mode'; - - // Call to constructor of parent class tlFilterControl. - // This already loads configuration and user input - // and does all the remaining necessary method calls, - // so no further method call is required here for initialization. - parent::__construct($dbHandler); - - $this->cfield_mgr = new cfield_mgr($this->db); - - - $this->settings['setting_get_parent_child_relation'] = false; - - // moved here from parent::__constructor() to be certain that - // all required objects has been created - $this->init_filters(); - - $this->initTreeOptions($this->mode); - - // delete any filter settings that may be left from previous calls in session - // Session data has been designed to provide an unidirectional channel - // between the left pane where tree lives and right pane. - // That's why delete each time our OWN session data. - $this->delete_own_session_data(); - $this->delete_old_session_data(); - - $this->save_session_data(); - - } - - /** - * - * - */ - public function __destruct() { - parent::__destruct(); //destroys testproject manager - - unset($this->tc_mgr); - unset($this->testplan_mgr); - unset($this->platform_mgr); - unset($this->cfield_mgr); - } - - /** - * Reads the configuration from the configuration file specific for test cases, - * additionally to those parts of the config which were already loaded by parent class. - * @return bool - */ - protected function read_config() { - // some configuration reading already done in parent class - parent::read_config(); - - // load configuration for active mode only - $this->configuration = config_get('tree_filter_cfg')->testcases->{$this->mode}; - - // load also exec config - it is not only needed in exec mode - $this->configuration->exec_cfg = config_get('exec_cfg'); - - // some additional testcase configuration - $this->configuration->tc_cfg = config_get('testcase_cfg'); - - // is switch filter mode enabled? - $this->filter_mode_choice_enabled = false; - switch( $this->mode ) - { - case 'edit_mode': - break; +class tlTestCaseFilterControl extends tlFilterControl +{ + + /** + * Testcase manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var testcase + */ + private $tc_mgr = null; + + /** + * Platform manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var tlPlatform + */ + private $platform_mgr = null; + + /** + * Testplan manager object. + * Initialized not in constructor, only on first use to save resources. + * + * @var testplan + */ + private $testplan_mgr = null; + + /** + * This array contains all possible filters. + * It is used as a helper to iterate over all the filters in some loops. + * It also sets options how and from where to load the parameters with + * input fetching functions in init_args()-method. + * Its keys are the names of the settings (class constants are used), + * its values are the arrays for the input parser. + * + * @var array + */ + + /* + * MAGIC NUMBERS are related to field size + * filter_tc_id: 0,30 arbitrary + * filter_bugs: 240 = 60 x 4 (60 bug_id size on execution_bugs table) + */ + private $all_filters; + + /** + * This array is used as an additional security measure. + * It maps all available + * filters to the mode in which they can be used. If a user tries to + * enable filters in config.inc.php which are not defined inside this array, + * this will be simply ignored instead of trying to initialize the filter + * no matter wether it has been implemented or not. + * The keys inside this array are the modes defined above as class constants. + * So it can be checked if a filter is available in a given mode without + * relying only on the config parameter. + * + * @var array + */ + private $mode_filter_mapping = array( + 'edit_mode' => array( + 'filter_tc_id', + 'filter_testcase_name', + 'filter_toplevel_testsuite', + 'filter_keywords', + 'filter_workflow_status', + 'filter_importance', + 'filter_execution_type', + 'filter_custom_fields', + 'filter_platforms' + ), + 'execution_mode' => array( + 'filter_tc_id', + 'filter_testcase_name', + 'filter_toplevel_testsuite', + 'filter_keywords', + 'filter_priority', + 'filter_execution_type', + 'filter_assigned_user', + 'filter_custom_fields', + 'filter_result', + 'filter_bugs' + ), + 'plan_mode' => array( + 'filter_tc_id', + 'filter_testcase_name', + 'filter_toplevel_testsuite', + 'filter_keywords', + 'filter_priority', + 'filter_execution_type', + // enabled user filter when assigning testcases + 'filter_assigned_user', + 'filter_custom_fields', + 'filter_result' + ), + 'plan_add_mode' => array( + 'filter_tc_id', + 'filter_testcase_name', + 'filter_toplevel_testsuite', + 'filter_keywords', + 'filter_importance', + 'filter_execution_type', + 'filter_workflow_status', + 'filter_custom_fields', + 'filter_platforms' + ) + ); + + /** + * This array contains all possible settings. + * It is used as a helper + * to later iterate over all possibilities in loops. + * Its keys are the names of the settings, its values the arrays for the input parser. + * + * @var array + */ + private $all_settings = [ + 'setting_testplan' => [ + "REQUEST", + tlInputParameter::INT_N + ], + 'setting_build' => [ + "REQUEST", + tlInputParameter::INT_N + ], + 'setting_platform' => [ + "REQUEST", + tlInputParameter::INT_N + ], + 'setting_testsgroupby' => [ + "REQUEST", + tlInputParameter::INT_N + ], + 'setting_refresh_tree_on_action' => [ + "POST", + tlInputParameter::CB_BOOL + ], + 'setting_exec_tree_counters_logic' => [ + "REQUEST", + tlInputParameter::INT_N + ] + ]; - default: - if (isset($this->configuration->advanced_filter_mode_choice) && - $this->configuration->advanced_filter_mode_choice == ENABLED) - { - $this->filter_mode_choice_enabled = true; - } - break; - } + /** + * This array is used to map the modes to their available settings. + * + * @var array + */ + private $mode_setting_mapping = array( + 'edit_mode' => array( + 'setting_refresh_tree_on_action' + ), + 'execution_mode' => array( + 'setting_testplan', + 'setting_build', + 'setting_platform', + 'setting_exec_tree_counters_logic', + 'setting_refresh_tree_on_action' + ), + 'plan_mode' => array( + 'setting_testplan', + 'setting_build', + 'setting_platform', + 'setting_refresh_tree_on_action' + ), + 'plan_add_mode' => array( + 'setting_testplan', + 'setting_testsgroupby', + 'setting_refresh_tree_on_action' + ) + ); + + /** + * The mode used. + * Depending on the feature for which this class will be instantiated. + * This mode defines which filter configuration will be loaded from config.inc.php + * and therefore which filters will be loaded and used for the templates. + * Value has to be one of the class constants for mode, default is edit mode. + * + * @var string + */ + private $mode = 'edit_mode'; + + /** + * Options to be used accordin to $this->mode, to build tree + * + * @var array + */ + private $treeOpt = array(); + + /** + * The token that will be used to identify the relationship between left frame + * (with navigator) and right frame (which displays execution of test case e.g.) in session. + * + * @var string + */ + public $form_token = null; + + const DISABLED = 0; + + const ENABLED = 1; + + /** + * + * @param database $dbHandler + * @param string $mode + * can be edit_mode/execution_mode/plan_mode/plan_add_mode, depending on usage + */ + public function __construct(&$dbHandler, $mode = 'edit_mode') + { - return tl::OK; - } // end of method + // execution order is CRITIC + $this->setFiltersDefinition(); - /** - * Does what init_args() usually does in all scripts: Reads the user input - * from request ($_GET and $_POST). - * Later configuration, settings and filters get modified according to that user input. - */ - protected function init_args() { + // set mode to define further actions before calling parent constructor + $this->mode = array_key_exists($mode, $this->mode_filter_mapping) ? $mode : 'edit_mode'; - // some common user input is already read in parent class - parent::init_args(); + // Call to constructor of parent class tlFilterControl. + // This already loads configuration and user input + // and does all the remaining necessary method calls, + // so no further method call is required here for initialization. + parent::__construct($dbHandler); - // add settings and filters to parameter info array for request parsers - $params = array(); + $this->cfield_mgr = new cfield_mgr($this->db); - foreach ($this->all_settings as $name => $info) { - if (is_array($info)) { - $params[$name] = $info; - } - } - - // Do first get, to have info that can change config - I_PARAMS($params, $this->args); - - switch( $this->mode ) { - case 'edit_mode': - $this->args->advanced_filter_mode = TRUE; - break; - } + $this->settings['setting_get_parent_child_relation'] = false; + // moved here from parent::__constructor() to be certain that + // all required objects has been created + $this->init_filters(); - if($this->args->advanced_filter_mode) { - // 20160106 - fman - // it's not clear why we have choosen to do - // this check, because this makes that - // config option advanced_filter_mode_choice - // does not work as expected. - switch($this->mode) { - case 'plan_add_mode': - case 'edit_mode': - $this->all_filters['filter_workflow_status'] = - array("POST", tlInputParameter::ARRAY_INT); + $this->initTreeOptions($this->mode); - $this->all_filters['filter_importance'] = - array("POST", tlInputParameter::ARRAY_INT); - break; - } + // delete any filter settings that may be left from previous calls in session + // Session data has been designed to provide an unidirectional channel + // between the left pane where tree lives and right pane. + // That's why delete each time our OWN session data. + $this->delete_own_session_data(); + $this->delete_old_session_data(); + $this->save_session_data(); } - foreach ($this->all_filters as $name => $info) { - if (is_array($info)) { - $params[$name] = $info; - } - } + /** + */ + public function __destruct() + { + parent::__destruct(); // destroys testproject manager - I_PARAMS($params, $this->args); - $type = 'filter_keywords_filter_type'; - $this->args->{$type} = (isset($_REQUEST[$type])) ? trim($_REQUEST[$type]) : 'Or'; + unset($this->tc_mgr); + unset($this->testplan_mgr); + unset($this->platform_mgr); + unset($this->cfield_mgr); + } - // caller is needed for the logic to apply default values to filters when accessing - // from desktop/main page - $extra_keys = array('caller','filter_result_result','filter_result_method','filter_result_build'); + /** + * Reads the configuration from the configuration file specific for test cases, + * additionally to those parts of the config which were already loaded by parent class. + * + * @return bool + */ + protected function read_config() + { + // some configuration reading already done in parent class + parent::read_config(); + + // load configuration for active mode only + $this->configuration = config_get('tree_filter_cfg')->testcases->{$this->mode}; + + // load also exec config - it is not only needed in exec mode + $this->configuration->exec_cfg = config_get('exec_cfg'); + + // some additional testcase configuration + $this->configuration->tc_cfg = config_get('testcase_cfg'); + + // is switch filter mode enabled? + $this->filter_mode_choice_enabled = false; + switch ($this->mode) { + case 'edit_mode': + break; + + default: + if (isset($this->configuration->advanced_filter_mode_choice) && + $this->configuration->advanced_filter_mode_choice == + self::ENABLED) { + $this->filter_mode_choice_enabled = true; + } + break; + } - foreach ($extra_keys as $ek) { - $this->args->{$ek} = (isset($_REQUEST[$ek])) ? $_REQUEST[$ek] : null; + return tl::OK; } - $this->args->{'filter_assigned_user_include_unassigned'} = - isset($_REQUEST['filter_assigned_user_include_unassigned']) ? 1 : 0; + /** + * Does what init_args() usually does in all scripts: Reads the user input + * from request ($_GET and $_POST). + * Later configuration, settings and filters get modified according to that user input. + */ + protected function init_args() + { - // got session token sent by form or do we have to generate a new one? - $sent_token = null; - $this->args->form_token = null; - if (isset($_REQUEST['form_token'])) { - $sent_token = $_REQUEST['form_token']; - } + // some common user input is already read in parent class + parent::init_args(); - if (!is_null($sent_token) && isset($_SESSION[$this->mode][$sent_token])) { - // sent token is valid - $this->form_token = $sent_token; - $this->args->form_token = $sent_token; - } else { - $this->generate_form_token(); - } - - // "feature" is needed for plan and edit modes - $this->args->feature = isset($_REQUEST['feature']) ? trim($_REQUEST['feature']) : null; - $doLog = false; - switch ($this->mode) { - case 'plan_mode': - switch($this->args->feature) { - case 'planUpdateTC': - case 'test_urgency': - case 'tc_exec_assignment': - break; - - default: - $doLog = true; - break; - } - break; - - case 'edit_mode': - switch($this->args->feature) { - case 'edit_tc': - case 'keywordsAssign': - case 'assignReqs': - break; - - default: - $doLog = true; - break; - } - break; - } - if($doLog) { - tLog( __CLASS__ . ' :: Mode:' . $this->mode . ' - Wrong or missing GET argument: feature', 'ERROR'); - exit(); - } - - - } // end of method - - /** - * Initializes all settings. - * Iterates through all available settings and - * 1) adds an array to $this->settings for the active ones, - * 2) sets the rest to false - * - * so this can be checked from templates and elsewhere. - * Then calls the initializing method (init_$$$$) - * for each still active setting. - * - */ - protected function init_settings() { - - $at_least_one_active = false; - - foreach ($this->all_settings as $name => $info) { - $init_method = "init_$name"; - if (in_array($name, $this->mode_setting_mapping[$this->mode]) && - method_exists($this, $init_method)) { - // is valid, configured, exists and therefore can be used, so initialize this setting - $this->$init_method(); - $at_least_one_active = true; - } else { - // is not needed, simply deactivate - $this->settings[$name] = [ - "items" => null, - "selected" => -1 - ]; - } - } - - // special situations - // the build setting is in plan mode only needed for one feature - if ($this->mode == 'plan_mode' && - ($this->args->feature != 'tc_exec_assignment' && $this->args->feature != 'test_urgency') ) { - $this->settings['setting_build'] = [ - "items" => null, - "selected" => -1 - ]; - $this->settings['setting_platform'] = [ - "items" => null, - "selected" => -1 - ]; - } - - // if at least one active setting is left to display, switch settings panel on - if ($at_least_one_active) { - $this->display_settings = true; - } - } - - /** - * Initialize all filters. (called by parent::__construct()) - * I'm double checking here with loaded configuration _and_ additional array - * $mode_filter_mapping, set according to defined mode, because this can avoid errors in case - * when users try to enable a filter in config that doesn't exist for a mode. - * Effect: Only existing and implemented filters can be activated in config file. - */ - protected function init_filters() { - // In resulting data structure, all values have to be defined (at least initialized), - // no matter wether they are wanted for filtering or not. - $dummy = [ - 'filter_keywords_filter_type', - 'filter_result_result', - 'filter_result_method', - 'filter_result_build', - 'filter_assigned_user_include_unassigned' - ]; - - foreach ($dummy as $filtername) { - $this->active_filters[$filtername] = null; - } - - - // iterate through all filters and activate the needed ones - $this->display_filters = false; - foreach ($this->all_filters as $name => $info) { - $init_method = "init_$name"; - - if( $this->configuration->show_filters == ENABLED && - property_exists($this->configuration, $name) && $this->configuration->{$name} == ENABLED && - in_array($name, $this->mode_filter_mapping[$this->mode]) && method_exists($this, $init_method) ) - { - - switch($name) { - case 'filter_custom_fields': - $params = $this->mode == 'execution_mode' ? array('design' => true, 'testplan_design' => true) : null; - break; - - default: - $params=null; - break; - } - - // there is at least one filter item to display => switch panel on - $this->display_filters = true; - $this->$init_method($params); - } else { - // is not needed, deactivate filter by setting it to false in main array - // and of course also in active filters array - $this->filters[$name] = false; - $this->active_filters[$name] = null; - } - } + // add settings and filters to parameter info array for request parsers + $params = array(); - // special situation: the assigned user filter is in plan mode only needed for one feature - if ($this->mode == 'plan_mode' && $this->args->feature != 'tc_exec_assignment') { - $this->settings['filter_assigned_user'] = false; - } + foreach ($this->all_settings as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; + } + } - // add the important settings to active filter array - foreach ($this->all_settings as $name => $info) { - if ($this->settings[$name]) { - $this->active_filters[$name] = - $this->settings[$name]['selected']; - } else { - $this->active_filters[$name] = null; - } - } - } // end of method - - /** - * This method returns an object or array, containing all selections chosen - * by the user for filtering. - * - * @return mixed $value Return value is either an array or stdClass object, - * depending on active mode. It contains all filter values selected by the user. - */ - protected function get_active_filters() - { - static $value = null; // serves as a kind of cache if method is called more than once - - // convert array to stcClass if needed - if (!$value) - { - switch ($this->mode) - { - case 'execution_mode': - case 'plan_mode': - // these features are generating an exec tree, - // they need the filters as a stdClass object - $value = (object)$this->active_filters; - break; - - default: - // otherwise simply return the array as-is - $value = $this->active_filters; - break; - } - } - - return $value; - } // end of method - - /** - * - * - */ - public function set_testcases_to_show($value = null) { - // update active_filters - if (!is_null($value)) { - $this->active_filters['testcases_to_show'] = $value; - } - - // Since a new filter in active_filters has been set from outside class after - // saving of session data has already happened in constructor, - // we explicitly update data in session after this change here. - $this->save_session_data(); - } - - /** - * Active filters will be saved to $_SESSION. - * If there already is data for the active mode and token, it will be overwritten. - * This data will be read from pages in the right frame. - * This solves the problems with too long URLs. - * See issue 3516 in Mantis for a little bit more information/explanation. - * The therefore caused new problem that would arise now if - * a user uses the same feature simultaneously in multiple browser tabs - * is solved be the additional measure of using a form token. - * - * @author Andreas Simon - * @return $tl::OK - */ - public function save_session_data() { - if (!isset($_SESSION[$this->mode]) || is_null($_SESSION[$this->mode]) || !is_array($_SESSION[$this->mode])) { - $_SESSION[$this->mode] = array(); - } - - $_SESSION[$this->mode][$this->form_token] = $this->active_filters; - $_SESSION[$this->mode][$this->form_token]['timestamp'] = time(); - - return tl::OK; - } - - /** - * Old filter data for active mode will be deleted from $_SESSION. - * It happens automatically after a session has expired and a user therefore - * has to log in again, but here we can configure an additional time limit - * only for this special filter part in session data. - * - * @author Andreas Simon - * @param int $token_validity_duration data older than given timespan will be deleted - */ - public function delete_old_session_data($token_validity_duration = 0) - { - - // TODO this duration could maybe also be configured in config/const.inc.php - - // how long shall the data remain in session before it will be deleted? - if (!is_numeric($token_validity_duration) || $token_validity_duration <= 0) { - $token_validity_duration = 60 * 60 * 1; // one hour as default - } - - // delete all tokens from session that are older than given age - if (isset($_SESSION[$this->mode]) && is_array($_SESSION[$this->mode])) { - foreach ($_SESSION[$this->mode] as $token => $data) { - if ($data['timestamp'] < (time() - $token_validity_duration)) { - unset($_SESSION[$this->mode][$token]); // too old, delete! - } - } - } - } - - /** - * - * - */ - public function delete_own_session_data() - { - if (isset($_SESSION[$this->mode]) && isset($_SESSION[$this->mode][$this->form_token])) - { - unset($_SESSION[$this->mode][$this->form_token]); - } - } - - /** - * Generates a form token, which will be used to identify the relationship - * between left navigator-frame with its settings and right frame. - */ - protected function generate_form_token() - { - // Notice: I am just generating an integer here for the token. - // Since this is not any security relevant stuff like a password hash or similar, - // but only a means to separate multiple tabs a single user opens, this should suffice. - // If we should some day decide that an integer is not enough, - // we just have to change this one method and everything will still work. - - $min = 1234567890; // not magic, just some large number so the tokens don't get too short - $max = mt_getrandmax(); - $token = 0; - - // generate new tokens until we find one that doesn't exist yet - do { - $token = mt_rand($min, $max); - } while (isset($_SESSION[$this->mode][$token])); - - $this->form_token = $token; - } - - /** - * Active filters will be formatted as a GET-argument string. - * - * @return string $string the formatted string with active filters - */ - public function get_argument_string() { - static $string = null; // cache for repeated calls of this method - - if (!$string) { - $string = ''; - - // important: the token with which the page in right frame can access data in session - $string .= '&form_token=' . $this->form_token; - - $key2loop = [ - 'setting_build', - 'setting_platform' - ]; - foreach($key2loop as $kiwi) { - if($this->settings[$kiwi]) { - $string .= "&{$kiwi}={$this->settings[$kiwi]['selected']}"; - } - } - - if ($this->active_filters['filter_priority'] > 0) { - $string .= '&filter_priority=' . $this->active_filters['filter_priority']; - } - - - $keyword_list = null; - if (is_array($this->active_filters['filter_keywords'])) { - $keyword_list = implode(',', $this->active_filters['filter_keywords']); - } - else if ($this->active_filters['filter_keywords']) - { - $keyword_list = $this->active_filters['filter_keywords']; - } - - - // Need to undertand why for other filters that also are array - // we have choosen to serialize, and here not. - // may be to avoid more refactoring - if ($keyword_list) - { - $string .= '&filter_keywords=' . $keyword_list . - '&filter_keywords_filter_type=' . - $this->active_filters['filter_keywords_filter_type']; - } - - // Using serialization - if ($this->active_filters['filter_assigned_user']) - { - $string .= '&filter_assigned_user='. json_encode($this->active_filters['filter_assigned_user']) . - '&filter_assigned_user_include_unassigned=' . - ($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0'); - } - - if ($this->active_filters['filter_result_result']) - { - $string .= '&filter_result_result=' . json_encode($this->active_filters['filter_result_result']) . - '&filter_result_method=' . $this->active_filters['filter_result_method'] . - '&filter_result_build=' . $this->active_filters['filter_result_build']; - } - - if( !is_null($this->active_filters['filter_bugs'])) - { - $string .= '&' . http_build_query( array('filter_bugs' => $this->active_filters['filter_bugs'])); - } + // Do first get, to have info that can change config + I_PARAMS($params, $this->args); - } - - return $string; - } - - /** - * Build the tree menu for generation of JavaScript test case tree. - * Depending on mode and user's selections in user interface, - * either a completely filtered tree will be build and returned, - * or only the minimal necessary data to "lazy load" - * the objects in the tree by later Ajax calls. - * No return value - all variables will be stored in gui object - * which is passed by reference. - * - * @author Andreas Simon - * @param object $gui Reference to GUI object (data will be written to it) - */ - public function build_tree_menu(&$gui) { - $tree_menu = null; - $filters = $this->get_active_filters(); - $loader = ''; - $children = "[]"; - $cookie_prefix = ''; - $root_node = new stdClass(); - - // by default, disable drag and drop, then later enable if needed - $drag_and_drop = new stdClass(); - $drag_and_drop->enabled = false; - $drag_and_drop->BackEndUrl = ''; - $drag_and_drop->useBeforeMoveNode = FALSE; - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - $tc_prefix = $this->testproject_mgr->getTestCasePrefix($this->args->testproject_id); - - switch ($this->mode) { - case 'plan_mode': - // No lazy loading here. - $opt_etree = $this->treeOpt[$this->mode]; - $filters->show_testsuite_contents = 1; - switch($this->args->feature) { - case 'test_urgency': - $filters->hide_testcases = 1; // ?? - $opt_etree->allow_empty_build = 1; - $opt_etree->hideTestCases = 1; - $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; - break; - - case 'tc_exec_assignment': - $filters->hide_testcases = 0; - $opt_etree->hideTestCases = 0; - $opt_etree->allow_empty_build = 0; - $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; - - // TICKET 4905: Test Case Tester Assignment - filters dont work properly - // for 'Assigned to' Field - // This way we are GOING TO IGNORE SETTING BUILD - $opt_etree->buildIDKeyMap = 'filter_result_build'; - - break; - - case 'planUpdateTC': - $filters->hide_testcases = 0; - $opt_etree->hideTestCases = 0; - $opt_etree->allow_empty_build = 1; - $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; - break; - - } - list($tree_menu, $testcases_to_show) = testPlanTree($this->db,$gui->menuUrl, - $this->args->testproject_id, - $this->args->testproject_name, - $this->args->testplan_id, - $this->args->testplan_name, - $filters,$opt_etree); - $this->set_testcases_to_show($testcases_to_show); - - $root_node = $tree_menu->rootnode; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - - // improved cookiePrefix - all trees in plan mode show test cases - // assigned to a specified test plan -> store state for each feature and each project - // - // usage of wrong values in $this->args->xyz for cookiePrefix - // instead of correct values in $filters->setting_xyz - $cookie_prefix = $this->args->feature . "_tplan_id_" . $filters->setting_testplan ."_"; - break; - - case 'edit_mode': - if ($gui->tree_drag_and_drop_enabled[$this->args->feature]) { - $drag_and_drop->enabled = true; - $drag_and_drop->BackEndUrl = $this->args->basehref . - 'lib/ajax/dragdroptprojectnodes.php'; - $drag_and_drop->useBeforeMoveNode = true; - } - // improved cookiePrefix - - // all trees in edit mode show test cases of whole test project - // -> store state for each feature and each project - $cookie_prefix = $this->args->feature . "_tproject_id_" . $this->args->testproject_id ."_"; - - if ($this->do_filtering) { - // TICKET 4353: added active/inactive filter - $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - if (isset($filters['filter_active_inactive'])) { - if ($filters['filter_active_inactive'] == IGNORE_INACTIVE_TESTCASES) { - $ignore_inactive_testcases = IGNORE_INACTIVE_TESTCASES; + switch ($this->mode) { + case 'edit_mode': + $this->args->advanced_filter_mode = true; + break; + } + + if ($this->args->advanced_filter_mode) { + // 20160106 - fman + // it's not clear why we have choosen to do + // this check, because this makes that + // config option advanced_filter_mode_choice + // does not work as expected. + switch ($this->mode) { + case 'plan_add_mode': + case 'edit_mode': + $this->all_filters['filter_workflow_status'] = array( + "POST", + tlInputParameter::ARRAY_INT + ); + + $this->all_filters['filter_importance'] = array( + "POST", + tlInputParameter::ARRAY_INT + ); + break; } - if ($filters['filter_active_inactive'] == IGNORE_ACTIVE_TESTCASES) - { - $ignore_active_testcases = IGNORE_ACTIVE_TESTCASES; + } + + foreach ($this->all_filters as $name => $info) { + if (is_array($info)) { + $params[$name] = $info; } - } - $options = array('forPrinting' => NOT_FOR_PRINTING, - 'hideTestCases' => SHOW_TESTCASES, - 'tc_action_enabled' => DO_ON_TESTCASE_CLICK, - 'exclude_branches' => null, - 'ignore_inactive_testcases' => $ignore_inactive_testcases, - 'ignore_active_testcases' => $ignore_active_testcases); - - $forrest = generateTestSpecTree($this->db, - $this->args->testproject_id, - $this->args->testproject_name, - $gui->menuUrl, $filters, $options); - - - $this->set_testcases_to_show($forrest['leaves']); - $tree_menu = $forrest['menu']; - $root_node = $tree_menu->rootnode; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - } - else - { - $loader = $this->args->basehref . 'lib/ajax/gettprojectnodes.php?' . - "root_node={$this->args->testproject_id}&" . - "tcprefix=" . urlencode($tc_prefix . - $this->configuration->tc_cfg->glue_character); - - $tcase_qty = $this->testproject_mgr->count_testcases($this->args->testproject_id); - - $root_node = new stdClass(); - $root_node->href = "javascript:EP({$this->args->testproject_id})"; - $root_node->id = $this->args->testproject_id; - $root_node->name = $this->args->testproject_name . " ($tcase_qty)"; - $root_node->wrapOpen = $root_node->wrapClose = ''; - $root_node->testlink_node_type='testproject'; - } - break; - - case 'plan_add_mode': - // improved cookiePrefix - - // tree in plan_add_mode is only used for add/removed test cases features - // and shows all test cases defined within test project, - // but as test cases are added to a specified test plan -> store state for each test plan - // - // usage of wrong values in $this->args->xyz for cookiePrefix instead of correct - // values in $filters->setting_xyz - $cookie_prefix = "add_remove_tc_tplan_id_{$filters['setting_testplan']}_"; - - // get filter mode - $key = 'setting_testsgroupby'; - $mode = $this->args->$key; - - if ($this->do_filtering) { - // TICKET 4496: added active/inactive filter - // Will be refactored in future versions - // $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - // $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - // if ($filters['filter_active_inactive'] == IGNORE_INACTIVE_TESTCASES) - // { - // $ignore_inactive_testcases = IGNORE_INACTIVE_TESTCASES; - // } - // if ($filters['filter_active_inactive'] == IGNORE_ACTIVE_TESTCASES) - // { - // $ignore_active_testcases = IGNORE_ACTIVE_TESTCASES; - // } - // need to be refactored - $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; - - $options = array('forPrinting' => NOT_FOR_PRINTING, - 'hideTestCases' => HIDE_TESTCASES, - 'tc_action_enabled' => ACTION_TESTCASE_DISABLE, - 'viewType' => 'testSpecTreeForTestPlan', - 'ignore_inactive_testcases' => $ignore_inactive_testcases, - 'ignore_active_testcases' => $ignore_active_testcases); - - - if ($mode == 'mode_test_suite') { - $tree_menu = generateTestSpecTree($this->db, - $this->args->testproject_id, - $this->args->testproject_name, - $gui->menuUrl,$filters,$options); - } - - $tree_menu = $tree_menu['menu']; - $root_node = $tree_menu->rootnode; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - } - else - { - if ($mode == 'mode_test_suite') - { - $loader = $this->args->basehref . 'lib/ajax/gettprojectnodes.php?' . - "root_node={$this->args->testproject_id}&show_tcases=0" . - "&" . http_build_query(array('tsuiteHelp' => lang_get('display_tsuite_contents'))); - - $root_node = new stdClass(); - $root_node->href = "javascript:EP({$this->args->testproject_id})"; - $root_node->id = $this->args->testproject_id; - $root_node->name = $this->args->testproject_name; - $root_node->wrapOpen = ''; - $root_node->wrapClose = ''; - $root_node->testlink_node_type = 'testproject'; - } - } - break; - - case 'execution_mode': - default: - // No lazy loading here. - // Filtering is always done in execution mode, no matter if user enters data or not, - // since the user should usually never see the whole tree here. - $filters->hide_testcases = false; - $filters->show_testsuite_contents = $this->configuration->exec_cfg->show_testsuite_contents; - - $exec_cfg = &$this->configuration->exec_cfg; - $opt_etree = new stdClass(); - $opt_etree->useCounters = $exec_cfg->enable_tree_testcase_counters; - - $opt_etree->useColours = new stdClass(); - $opt_etree->useColours->testcases = $exec_cfg->enable_tree_testcases_colouring; - $opt_etree->useColours->counters = $exec_cfg->enable_tree_counters_colouring; - $opt_etree->testcases_colouring_by_selected_build = $exec_cfg->testcases_colouring_by_selected_build; - - if($this->mode == 'execution_mode') { - $opt_etree->actionJS['testproject'] = 'EXDS'; - $opt_etree->exec_tree_counters_logic = - $this->args->setting_exec_tree_counters_logic; - } - - list($tree_menu, $testcases_to_show) = - execTree($this->db,$gui->menuUrl, - array('tproject_id' => $this->args->testproject_id, - 'tproject_name' => $this->args->testproject_name, - 'tplan_id' => $this->args->testplan_id, - 'tplan_name' => $this->args->testplan_name), - $filters,$opt_etree); - - $this->set_testcases_to_show($testcases_to_show); - - $root_node = $tree_menu->rootnode; - $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; - - // - // improved cookiePrefix - - // tree on test execution shows test cases depending on test plan, platform and build. - // Because test plan is implicitily given with build -> store state for each (platform-build) - // combination - // - // Usage of wrong values in $this->args->xyz for cookiePrefix - // instead of correct values in $filters->setting_xyz - // + } - // does this plan has platforms? - $cookie_prefix = 'test_exec_build_id_' . $filters->setting_build . '_'; - if (isset($filters->setting_platform)) { - $cookie_prefix .= 'platform_id_' . $filters->setting_platform . '_'; + I_PARAMS($params, $this->args); + $type = 'filter_keywords_filter_type'; + $this->args->{$type} = (isset($_REQUEST[$type])) ? trim($_REQUEST[$type]) : 'Or'; + + // caller is needed for the logic to apply default values to filters when accessing + // from desktop/main page + $extra_keys = array( + 'caller', + 'filter_result_result', + 'filter_result_method', + 'filter_result_build' + ); + + foreach ($extra_keys as $ek) { + $this->args->{$ek} = (isset($_REQUEST[$ek])) ? $_REQUEST[$ek] : null; } - break; - } - - $gui->tree = $tree_menu; - - $gui->ajaxTree = new stdClass(); - $gui->ajaxTree->loader = $loader; - $gui->ajaxTree->root_node = $root_node; - $gui->ajaxTree->children = $children; - $gui->ajaxTree->cookiePrefix = $cookie_prefix; - $gui->ajaxTree->dragDrop = $drag_and_drop; - } // end of method - - /** - * - * - */ - private function init_setting_refresh_tree_on_action() { - $key = 'setting_refresh_tree_on_action'; - $hidden_key = 'hidden_setting_refresh_tree_on_action'; - $selection = 0; - - $this->settings[$key] = array(); - $this->settings[$key][$hidden_key] = false; - - // look where we can find the setting - POST, SESSION, config? - if (isset($this->args->{$key})) { - $selection = 1; - } else if (isset($this->args->{$hidden_key})) { - $selection = 0; - } else if (isset($_SESSION[$key])) { - $selection = $_SESSION[$key]; - } else { - $spec_cfg = config_get('spec_cfg'); - $selection = ($spec_cfg->automatic_tree_refresh > 0) ? 1 : 0; - } - - $this->settings[$key]['selected'] = $selection; - $this->settings[$key][$hidden_key] = $selection; - $_SESSION[$key] = $selection; - } // end of method + $this->args->{'filter_assigned_user_include_unassigned'} = isset( + $_REQUEST['filter_assigned_user_include_unassigned']) ? 1 : 0; + // got session token sent by form or do we have to generate a new one? + $sent_token = null; + $this->args->form_token = null; + if (isset($_REQUEST['form_token'])) { + $sent_token = $_REQUEST['form_token']; + } - /** - * - * - */ - private function init_setting_build() { + if (! is_null($sent_token) && isset($_SESSION[$this->mode][$sent_token])) { + // sent token is valid + $this->form_token = $sent_token; + $this->args->form_token = $sent_token; + } else { + $this->generate_form_token(); + } - $key = 'setting_build'; - if (is_null($this->testplan_mgr)) { - $this->testplan_mgr = new testplan($this->db); + // "feature" is needed for plan and edit modes + $this->args->feature = isset($_REQUEST['feature']) ? trim( + $_REQUEST['feature']) : null; + $doLog = false; + switch ($this->mode) { + case 'plan_mode': + switch ($this->args->feature) { + case 'planUpdateTC': + case 'test_urgency': + case 'tc_exec_assignment': + break; + + default: + $doLog = true; + break; + } + break; + + case 'edit_mode': + switch ($this->args->feature) { + case 'edit_tc': + case 'keywordsAssign': + case 'assignReqs': + break; + + default: + $doLog = true; + break; + } + break; + } + if ($doLog) { + tLog( + __CLASS__ . ' :: Mode:' . $this->mode . + ' - Wrong or missing GET argument: feature', 'ERROR'); + exit(); + } } - $tplan_id = $this->settings['setting_testplan']['selected']; - - switch( $this->mode ) { - case 'plan_mode': - $active = $open = null; - if( $this->configuration->setting_build_inactive_out ) { - $active = testplan::GET_ACTIVE_BUILD; - } + /** + * Initializes all settings. + * Iterates through all available settings and + * 1) adds an array to $this->settings for the active ones, + * 2) sets the rest to false + * + * so this can be checked from templates and elsewhere. + * Then calls the initializing method (init_$$$$) + * for each still active setting. + */ + protected function init_settings() + { + $at_least_one_active = false; + + foreach ($this->all_settings as $name => $info) { + $init_method = "init_$name"; + if (in_array($name, $this->mode_setting_mapping[$this->mode]) && + method_exists($this, $init_method)) { + // is valid, configured, exists and therefore can be used, so initialize this setting + $this->$init_method(); + $at_least_one_active = true; + } else { + // is not needed, simply deactivate + $this->settings[$name] = [ + "items" => null, + "selected" => - 1 + ]; + } + } - if( $this->configuration->setting_build_close_out ) { - $open = testplan::GET_OPEN_BUILD; - } - break; + // special situations + // the build setting is in plan mode only needed for one feature + if ($this->mode == 'plan_mode' && + ($this->args->feature != 'tc_exec_assignment' && + $this->args->feature != 'test_urgency')) { + $this->settings['setting_build'] = [ + "items" => null, + "selected" => - 1 + ]; + $this->settings['setting_platform'] = [ + "items" => null, + "selected" => - 1 + ]; + } - default: - $active = testplan::GET_ACTIVE_BUILD; - $open = testplan::GET_OPEN_BUILD; - break; + // if at least one active setting is left to display, switch settings panel on + if ($at_least_one_active) { + $this->display_settings = true; + } } - - $this->settings[$key]['items'] = $this->testplan_mgr->get_builds_for_html_options($tplan_id, $active, $open); - $tplan_builds = array_keys((array)$this->settings[$key]['items']); - // According to mode, we need different labels for this selector on GUI - $label = ($this->mode == 'plan_mode') ? 'assign_build' : 'exec_build'; - $this->settings[$key]['label'] = lang_get($label); - - // if no build has been chosen by user, select newest build by default - $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, $active, $open); + /** + * Initialize all filters. + * (called by parent::__construct()) + * I'm double checking here with loaded configuration _and_ additional array + * $mode_filter_mapping, set according to defined mode, because this can avoid errors in case + * when users try to enable a filter in config that doesn't exist for a mode. + * Effect: Only existing and implemented filters can be activated in config file. + */ + protected function init_filters() + { + // In resulting data structure, all values have to be defined (at least initialized), + // no matter wether they are wanted for filtering or not. + $dummy = [ + 'filter_keywords_filter_type', + 'filter_result_result', + 'filter_result_method', + 'filter_result_build', + 'filter_assigned_user_include_unassigned' + ]; + + foreach ($dummy as $filtername) { + $this->active_filters[$filtername] = null; + } - $session_key = $tplan_id . '_stored_setting_build'; - $session_selection = isset($_SESSION[$session_key]) ? $_SESSION[$session_key] : null; + // iterate through all filters and activate the needed ones + $this->display_filters = false; + foreach ($this->all_filters as $name => $info) { + $init_method = "init_$name"; + + if ($this->configuration->show_filters == self::ENABLED && + property_exists($this->configuration, $name) && + $this->configuration->{$name} == self::ENABLED && + in_array($name, $this->mode_filter_mapping[$this->mode]) && + method_exists($this, $init_method)) { + + switch ($name) { + case 'filter_custom_fields': + $params = $this->mode == 'execution_mode' ? array( + 'design' => true, + 'testplan_design' => true + ) : null; + break; + + default: + $params = null; + break; + } + + // there is at least one filter item to display => switch panel on + $this->display_filters = true; + $this->$init_method($params); + } else { + // is not needed, deactivate filter by setting it to false in main array + // and of course also in active filters array + $this->filters[$name] = false; + $this->active_filters[$name] = null; + } + } - $this->args->{$key} = $this->args->{$key} > 0 ? $this->args->{$key} : $session_selection; + // special situation: the assigned user filter is in plan mode only needed for one feature + if ($this->mode == 'plan_mode' && + $this->args->feature != 'tc_exec_assignment') { + $this->settings['filter_assigned_user'] = false; + } - if (!$this->args->$key) - { - $this->args->$key = $newest_build_id; + // add the important settings to active filter array + foreach ($this->all_settings as $name => $info) { + if ($this->settings[$name]) { + $this->active_filters[$name] = $this->settings[$name]['selected']; + } else { + $this->active_filters[$name] = null; + } + } } - - // only take build ID into account if it really is a build from this testplan - $this->settings[$key]['selected'] = (in_array($this->args->$key, (array)$tplan_builds)) ? - $this->args->$key : $newest_build_id; - // still no build selected? take first one from selection. - if (!$this->settings[$key]['selected'] && sizeof($this->settings[$key]['items'])) + /** + * This method returns an object or array, containing all selections chosen + * by the user for filtering. + * + * @return mixed $value Return value is either an array or stdClass object, + * depending on active mode. It contains all filter values selected by the user. + */ + protected function get_active_filters() { - $this->settings[$key]['selected'] = end($tplan_builds); + static $value = null; // serves as a kind of cache if method is called more than once + + // convert array to stcClass if needed + if (! $value) { + switch ($this->mode) { + case 'execution_mode': + case 'plan_mode': + // these features are generating an exec tree, + // they need the filters as a stdClass object + $value = (object) $this->active_filters; + break; + + default: + // otherwise simply return the array as-is + $value = $this->active_filters; + break; + } + } + + return $value; } - $_SESSION[$session_key] = $this->settings[$key]['selected']; - } // end of method + /** + */ + public function set_testcases_to_show($value = null) + { + // update active_filters + if (! is_null($value)) { + $this->active_filters['testcases_to_show'] = $value; + } + + // Since a new filter in active_filters has been set from outside class after + // saving of session data has already happened in constructor, + // we explicitly update data in session after this change here. + $this->save_session_data(); + } + + /** + * Active filters will be saved to $_SESSION. + * If there already is data for the active mode and token, it will be overwritten. + * This data will be read from pages in the right frame. + * This solves the problems with too long URLs. + * See issue 3516 in Mantis for a little bit more information/explanation. + * The therefore caused new problem that would arise now if + * a user uses the same feature simultaneously in multiple browser tabs + * is solved be the additional measure of using a form token. + * + * @author Andreas Simon + * @return $tl::OK + */ + public function save_session_data() + { + if (! isset($_SESSION[$this->mode]) || is_null($_SESSION[$this->mode]) || + ! is_array($_SESSION[$this->mode])) { + $_SESSION[$this->mode] = array(); + } + $_SESSION[$this->mode][$this->form_token] = $this->active_filters; + $_SESSION[$this->mode][$this->form_token]['timestamp'] = time(); - /** - * - * @used-by: tlTestCaseFilterControl->init_settings() - */ - private function init_setting_testplan() { - if (is_null($this->testplan_mgr)) { - $this->testplan_mgr = new testplan($this->db); + return tl::OK; } - - $key = 'setting_testplan'; - $testplans = $this->user->getAccessibleTestPlans($this->db, $this->args->testproject_id); - if (isset($_SESSION['testplanID']) && $_SESSION['testplanID'] != $this->args->{$key}) { - // testplan was changed, we need to reset all filters - // --> they were chosen for another testplan, not this one! - $this->args->reset_filters = true; + /** + * Old filter data for active mode will be deleted from $_SESSION. + * It happens automatically after a session has expired and a user therefore + * has to log in again, but here we can configure an additional time limit + * only for this special filter part in session data. + * + * @author Andreas Simon + * @param int $token_validity_duration + * data older than given timespan will be deleted + */ + public function delete_old_session_data($token_validity_duration = 0) + { - // check if user is allowed to set chosen testplan before changing - foreach ($testplans as $plan) { - if ($plan['id'] == $this->args->{$key}) { - setSessionTestPlan($plan); + // TODO this duration could maybe also be configured in config/const.inc.php + + // how long shall the data remain in session before it will be deleted? + if (! is_numeric($token_validity_duration) || + $token_validity_duration <= 0) { + $token_validity_duration = 60 * 60 * 1; // one hour as default } - } - } - // now load info from session - $info = $this->testplan_mgr->get_by_id($_SESSION['testplanID']); - $this->args->testplan_name = $info['name']; - $this->args->testplan_id = $info['id']; - $this->args->{$key} = $info['id']; - $this->settings[$key]['selected'] = $info['id']; - - // Final filtering based on mode: - // Now get all selectable testplans for the user to display. - // For execution: - // For assign test case execution feature: - // don't take testplans into selection which have no (active/open) builds! - // - // For plan add mode: - // add every plan no matter if he has builds or not. - - foreach ($testplans as $plan) { - $add_plan = $this->mode == 'plan_add_mode' || - ( $this->mode == 'plan_mode' && $this->args->feature != 'tc_exec_assignment' ) ; - - if(!$add_plan) - { - $builds = $this->testplan_mgr->get_builds($plan['id'],testplan::GET_ACTIVE_BUILD,testplan::GET_OPEN_BUILD); - $add_plan = (is_array($builds) && count($builds)); - } - - if ($add_plan) - { - $this->settings[$key]['items'][$plan['id']] = $plan['name']; - } + // delete all tokens from session that are older than given age + if (isset($_SESSION[$this->mode]) && is_array($_SESSION[$this->mode])) { + foreach ($_SESSION[$this->mode] as $token => $data) { + if ($data['timestamp'] < (time() - $token_validity_duration)) { + unset($_SESSION[$this->mode][$token]); // too old, delete! + } + } + } } - } - - /** - * - * Possibility to filter by Platform: - * according mode we need to add [Any] option - * it's really a filter? - * - */ - private function init_setting_platform() { - if (!$this->platform_mgr) { - $this->platform_mgr = new tlPlatform($this->db); + + /** + */ + public function delete_own_session_data() + { + if (isset($_SESSION[$this->mode]) && + isset($_SESSION[$this->mode][$this->form_token])) { + unset($_SESSION[$this->mode][$this->form_token]); + } } - $testplan_id = $this->settings['setting_testplan']['selected']; - $session_key = $testplan_id . '_stored_setting_platform'; - $session_selection = isset($_SESSION[$session_key]) ? $_SESSION[$session_key] : null; - $key = 'setting_platform'; + /** + * Generates a form token, which will be used to identify the relationship + * between left navigator-frame with its settings and right frame. + */ + protected function generate_form_token() + { + // Notice: I am just generating an integer here for the token. + // Since this is not any security relevant stuff like a password hash or similar, + // but only a means to separate multiple tabs a single user opens, this should suffice. + // If we should some day decide that an integer is not enough, + // we just have to change this one method and everything will still work. + $min = 1234567890; // not magic, just some large number so the tokens don't get too short + $max = mt_getrandmax(); + $token = 0; + + // generate new tokens until we find one that doesn't exist yet + do { + $token = mt_rand($min, $max); + } while (isset($_SESSION[$this->mode][$token])); + + $this->form_token = $token; + } + + /** + * Active filters will be formatted as a GET-argument string. + * + * @return string $string the formatted string with active filters + */ + public function get_argument_string() + { + static $string = null; // cache for repeated calls of this method + + if (! $string) { + $string = ''; + + // important: the token with which the page in right frame can access data in session + $string .= '&form_token=' . $this->form_token; + + $key2loop = [ + 'setting_build', + 'setting_platform' + ]; + foreach ($key2loop as $kiwi) { + if ($this->settings[$kiwi]) { + $string .= "&{$kiwi}={$this->settings[$kiwi]['selected']}"; + } + } - $optx = null; - switch ($this->mode) { - case 'edit_mode': - case 'plan_add_mode': - break; - } - - $platformSet = $this->platform_mgr->getLinkedToTestplanAsMap($testplan_id); - if( is_null($platformSet) || count($platformSet) == 0) { - // Brute force bye, bye !! >>---> - $this->settings[$key] = [ - 'items' => null, - 'selected' => -1 - ]; - $_SESSION[$session_key] = null; - return; - } - - // Ok, there are platforms, go ahead - $this->settings[$key] = [ - 'items' => null, - 'selected' => -1 - ]; - - if( is_null($this->args->$key) ) { - $this->args->$key = intval($session_selection); - } - - - switch($this->mode) { - case 'plan_mode': - $this->settings[$key]['items'] = [0 => $this->option_strings['any']]; - $this->settings[$key]['items'] += $platformSet; - break; - - case 'execution_mode': - $this->settings[$key]['items'] = $platformSet; - break; - - default: - throw new Exception(__METHOD__ . "Mode:" . $this->mode . 'Do not know what to do', 1); - break; - } + if ($this->active_filters['filter_priority'] > 0) { + $string .= '&filter_priority=' . + $this->active_filters['filter_priority']; + } - // If this platform is NOT valid for Test plan, I will set the first one - // (is any exists). - if( !isset($this->settings[$key]['items']) ) { - $this->args->$key = key($this->settings[$key]['items']); - } - - $this->settings[$key]['selected'] = $this->args->$key; - if($this->args->$key <= 0) { - $this->settings[$key]['selected'] = key($this->settings[$key]['items']); - } - - $_SESSION[$session_key] = $this->settings[$key]['selected']; - } // end of method - - /** - * - * - */ - private function init_filter_tc_id() { - $key = 'filter_tc_id'; - $selection = $this->args->{$key}; - $internal_id = null; - - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - if (!$this->tc_mgr) { - $this->tc_mgr = new testcase($this->db); - } - - $tc_prefix = $this->testproject_mgr->getTestCasePrefix($this->args->testproject_id); - $tc_prefix .= $this->configuration->tc_cfg->glue_character; - - if (!$selection || $selection == $tc_prefix || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - // we got the external ID here when filtering, - // but need the internal one - $oget = ['tproject_id' => $this->args->testproject_id]; - $internal_id = $this->tc_mgr->getInternalID($selection,$oget); - } - - $this->filters[$key] = array('selected' => $selection ? $selection : $tc_prefix); - $this->active_filters[$key] = $internal_id; - } // end of method - - /** - * - * - */ - private function init_filter_testcase_name() { - $key = 'filter_testcase_name'; - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } // end of method - - - /** - * - * - */ - private function init_filter_toplevel_testsuite() - { - if (!$this->testproject_mgr) + $keyword_list = null; + if (is_array($this->active_filters['filter_keywords'])) { + $keyword_list = implode(',', + $this->active_filters['filter_keywords']); + } elseif ($this->active_filters['filter_keywords']) { + $keyword_list = $this->active_filters['filter_keywords']; + } + + // Need to undertand why for other filters that also are array + // we have choosen to serialize, and here not. + // may be to avoid more refactoring + if ($keyword_list) { + $string .= '&filter_keywords=' . $keyword_list . + '&filter_keywords_filter_type=' . + $this->active_filters['filter_keywords_filter_type']; + } + + // Using serialization + if ($this->active_filters['filter_assigned_user']) { + $string .= '&filter_assigned_user=' . + json_encode($this->active_filters['filter_assigned_user']) . + '&filter_assigned_user_include_unassigned=' . + ($this->active_filters['filter_assigned_user_include_unassigned'] ? '1' : '0'); + } + + if ($this->active_filters['filter_result_result']) { + $string .= '&filter_result_result=' . + json_encode($this->active_filters['filter_result_result']) . + '&filter_result_method=' . + $this->active_filters['filter_result_method'] . + '&filter_result_build=' . + $this->active_filters['filter_result_build']; + } + + if (! is_null($this->active_filters['filter_bugs'])) { + $string .= '&' . + http_build_query( + array( + 'filter_bugs' => $this->active_filters['filter_bugs'] + )); + } + } + + return $string; + } + + /** + * Build the tree menu for generation of JavaScript test case tree. + * Depending on mode and user's selections in user interface, + * either a completely filtered tree will be build and returned, + * or only the minimal necessary data to "lazy load" + * the objects in the tree by later Ajax calls. + * No return value - all variables will be stored in gui object + * which is passed by reference. + * + * @author Andreas Simon + * @param object $gui + * Reference to GUI object (data will be written to it) + */ + public function build_tree_menu(&$gui) { - $this->testproject_mgr = new testproject($this->db); + $tree_menu = null; + $filters = $this->get_active_filters(); + $loader = ''; + $children = "[]"; + $cookie_prefix = ''; + $root_node = new stdClass(); + + // by default, disable drag and drop, then later enable if needed + $drag_and_drop = new stdClass(); + $drag_and_drop->enabled = false; + $drag_and_drop->BackEndUrl = ''; + $drag_and_drop->useBeforeMoveNode = false; + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $tc_prefix = $this->testproject_mgr->getTestCasePrefix( + $this->args->testproject_id); + + switch ($this->mode) { + case 'plan_mode': + // No lazy loading here. + $opt_etree = $this->treeOpt[$this->mode]; + $filters->show_testsuite_contents = 1; + switch ($this->args->feature) { + case 'test_urgency': + $filters->hide_testcases = 1; // ?? + $opt_etree->allow_empty_build = 1; + $opt_etree->hideTestCases = 1; + $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; + break; + + case 'tc_exec_assignment': + $filters->hide_testcases = 0; + $opt_etree->hideTestCases = 0; + $opt_etree->allow_empty_build = 0; + $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; + + // TICKET 4905: Test Case Tester Assignment - filters dont work properly + // for 'Assigned to' Field + // This way we are GOING TO IGNORE SETTING BUILD + $opt_etree->buildIDKeyMap = 'filter_result_build'; + + break; + + case 'planUpdateTC': + $filters->hide_testcases = 0; + $opt_etree->hideTestCases = 0; + $opt_etree->allow_empty_build = 1; + $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; + break; + } + list ($tree_menu, $testcases_to_show) = testPlanTree($this->db, + $gui->menuUrl, $this->args->testproject_id, + $this->args->testproject_name, $this->args->testplan_id, + $this->args->testplan_name, $filters, $opt_etree); + $this->set_testcases_to_show($testcases_to_show); + + $root_node = $tree_menu->rootnode; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + + // improved cookiePrefix - all trees in plan mode show test cases + // assigned to a specified test plan -> store state for each feature and each project + // + // usage of wrong values in $this->args->xyz for cookiePrefix + // instead of correct values in $filters->setting_xyz + $cookie_prefix = $this->args->feature . "_tplan_id_" . + $filters->setting_testplan . "_"; + break; + + case 'edit_mode': + if ($gui->tree_drag_and_drop_enabled[$this->args->feature]) { + $drag_and_drop->enabled = true; + $drag_and_drop->BackEndUrl = $this->args->basehref . + 'lib/ajax/dragdroptprojectnodes.php'; + $drag_and_drop->useBeforeMoveNode = true; + } + // improved cookiePrefix - + // all trees in edit mode show test cases of whole test project + // -> store state for each feature and each project + $cookie_prefix = $this->args->feature . "_tproject_id_" . + $this->args->testproject_id . "_"; + + if ($this->do_filtering) { + // TICKET 4353: added active/inactive filter + $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + if (isset($filters['filter_active_inactive'])) { + if ($filters['filter_active_inactive'] == + IGNORE_INACTIVE_TESTCASES) { + $ignore_inactive_testcases = IGNORE_INACTIVE_TESTCASES; + } + if ($filters['filter_active_inactive'] == + IGNORE_ACTIVE_TESTCASES) { + $ignore_active_testcases = IGNORE_ACTIVE_TESTCASES; + } + } + $options = array( + 'forPrinting' => NOT_FOR_PRINTING, + 'hideTestCases' => SHOW_TESTCASES, + 'tc_action_enabled' => DO_ON_TESTCASE_CLICK, + 'exclude_branches' => null, + 'ignore_inactive_testcases' => $ignore_inactive_testcases, + 'ignore_active_testcases' => $ignore_active_testcases + ); + + $forrest = generateTestSpecTree($this->db, + $this->args->testproject_id, + $this->args->testproject_name, $gui->menuUrl, $filters, + $options); + + $this->set_testcases_to_show($forrest['leaves']); + $tree_menu = $forrest['menu']; + $root_node = $tree_menu->rootnode; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + } else { + $loader = $this->args->basehref . + 'lib/ajax/gettprojectnodes.php?' . + "root_node={$this->args->testproject_id}&" . "tcprefix=" . + urlencode( + $tc_prefix . + $this->configuration->tc_cfg->glue_character); + + $tcase_qty = $this->testproject_mgr->count_testcases( + $this->args->testproject_id); + + $root_node = new stdClass(); + $root_node->href = "javascript:EP({$this->args->testproject_id})"; + $root_node->id = $this->args->testproject_id; + $root_node->name = $this->args->testproject_name . + " ($tcase_qty)"; + $root_node->wrapOpen = $root_node->wrapClose = ''; + $root_node->testlink_node_type = 'testproject'; + } + break; + + case 'plan_add_mode': + // improved cookiePrefix - + // tree in plan_add_mode is only used for add/removed test cases features + // and shows all test cases defined within test project, + // but as test cases are added to a specified test plan -> store state for each test plan + // + // usage of wrong values in $this->args->xyz for cookiePrefix instead of correct + // values in $filters->setting_xyz + $cookie_prefix = "add_remove_tc_tplan_id_{$filters['setting_testplan']}_"; + + // get filter mode + $key = 'setting_testsgroupby'; + $mode = $this->args->$key; + + if ($this->do_filtering) { + // TICKET 4496: added active/inactive filter + // Will be refactored in future versions + // $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + // $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + // if ($filters['filter_active_inactive'] == IGNORE_INACTIVE_TESTCASES) + // { + // $ignore_inactive_testcases = IGNORE_INACTIVE_TESTCASES; + // } + // if ($filters['filter_active_inactive'] == IGNORE_ACTIVE_TESTCASES) + // { + // $ignore_active_testcases = IGNORE_ACTIVE_TESTCASES; + // } + // need to be refactored + $ignore_inactive_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + $ignore_active_testcases = DO_NOT_FILTER_INACTIVE_TESTCASES; + + $options = array( + 'forPrinting' => NOT_FOR_PRINTING, + 'hideTestCases' => HIDE_TESTCASES, + 'tc_action_enabled' => ACTION_TESTCASE_DISABLE, + 'viewType' => 'testSpecTreeForTestPlan', + 'ignore_inactive_testcases' => $ignore_inactive_testcases, + 'ignore_active_testcases' => $ignore_active_testcases + ); + + if ($mode == 'mode_test_suite') { + $tree_menu = generateTestSpecTree($this->db, + $this->args->testproject_id, + $this->args->testproject_name, $gui->menuUrl, + $filters, $options); + } + + $tree_menu = $tree_menu['menu']; + $root_node = $tree_menu->rootnode; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + } else { + if ($mode == 'mode_test_suite') { + $loader = $this->args->basehref . + 'lib/ajax/gettprojectnodes.php?' . + "root_node={$this->args->testproject_id}&show_tcases=0" . + "&" . + http_build_query( + array( + 'tsuiteHelp' => lang_get( + 'display_tsuite_contents') + )); + + $root_node = new stdClass(); + $root_node->href = "javascript:EP({$this->args->testproject_id})"; + $root_node->id = $this->args->testproject_id; + $root_node->name = $this->args->testproject_name; + $root_node->wrapOpen = ''; + $root_node->wrapClose = ''; + $root_node->testlink_node_type = 'testproject'; + } + } + break; + + case 'execution_mode': + default: + // No lazy loading here. + // Filtering is always done in execution mode, no matter if user enters data or not, + // since the user should usually never see the whole tree here. + $filters->hide_testcases = false; + $filters->show_testsuite_contents = $this->configuration->exec_cfg->show_testsuite_contents; + + $exec_cfg = &$this->configuration->exec_cfg; + $opt_etree = new stdClass(); + $opt_etree->useCounters = $exec_cfg->enable_tree_testcase_counters; + + $opt_etree->useColours = new stdClass(); + $opt_etree->useColours->testcases = $exec_cfg->enable_tree_testcases_colouring; + $opt_etree->useColours->counters = $exec_cfg->enable_tree_counters_colouring; + $opt_etree->testcases_colouring_by_selected_build = $exec_cfg->testcases_colouring_by_selected_build; + + if ($this->mode == 'execution_mode') { + $opt_etree->actionJS['testproject'] = 'EXDS'; + $opt_etree->exec_tree_counters_logic = $this->args->setting_exec_tree_counters_logic; + } + + list ($tree_menu, $testcases_to_show) = execTree($this->db, + $gui->menuUrl, + array( + 'tproject_id' => $this->args->testproject_id, + 'tproject_name' => $this->args->testproject_name, + 'tplan_id' => $this->args->testplan_id, + 'tplan_name' => $this->args->testplan_name + ), $filters, $opt_etree); + + $this->set_testcases_to_show($testcases_to_show); + + $root_node = $tree_menu->rootnode; + $children = $tree_menu->menustring ? $tree_menu->menustring : "[]"; + + // + // improved cookiePrefix - + // tree on test execution shows test cases depending on test plan, platform and build. + // Because test plan is implicitily given with build -> store state for each (platform-build) + // combination + // + // Usage of wrong values in $this->args->xyz for cookiePrefix + // instead of correct values in $filters->setting_xyz + // + + // does this plan has platforms? + $cookie_prefix = 'test_exec_build_id_' . $filters->setting_build . + '_'; + if (isset($filters->setting_platform)) { + $cookie_prefix .= 'platform_id_' . $filters->setting_platform . + '_'; + } + break; + } + + $gui->tree = $tree_menu; + + $gui->ajaxTree = new stdClass(); + $gui->ajaxTree->loader = $loader; + $gui->ajaxTree->root_node = $root_node; + $gui->ajaxTree->children = $children; + $gui->ajaxTree->cookiePrefix = $cookie_prefix; + $gui->ajaxTree->dragDrop = $drag_and_drop; } - $key = 'filter_toplevel_testsuite'; - $first_level_suites = $this->testproject_mgr->get_first_level_test_suites($this->args->testproject_id, - 'smarty_html_options'); - - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else + + /** + */ + public function init_setting_refresh_tree_on_action() { - $this->do_filtering = true; + $key = 'setting_refresh_tree_on_action'; + $hidden_key = 'hidden_setting_refresh_tree_on_action'; + $selection = 0; + + $this->settings[$key] = array(); + $this->settings[$key][$hidden_key] = false; + + // look where we can find the setting - POST, SESSION, config? + if (isset($this->args->{$key})) { + $selection = 1; + } elseif (isset($this->args->{$hidden_key})) { + $selection = 0; + } elseif (isset($_SESSION[$key])) { + $selection = $_SESSION[$key]; + } else { + $spec_cfg = config_get('spec_cfg'); + $selection = ($spec_cfg->automatic_tree_refresh > 0) ? 1 : 0; + } + + $this->settings[$key]['selected'] = $selection; + $this->settings[$key][$hidden_key] = $selection; + $_SESSION[$key] = $selection; } - - // this filter should only be visible if there are any top level testsuites - $this->filters[$key] = null; - if ($first_level_suites) - { - $this->filters[$key] = array('items' => array(0 => ''), - 'selected' => $selection, - 'exclude_branches' => array()); - - foreach ($first_level_suites as $suite_id => $suite_name) - { - $this->filters[$key]['items'][$suite_id] = $suite_name; - if ($selection && $suite_id != $selection) - { - $this->filters[$key]['exclude_branches'][$suite_id] = 'exclude_me'; - } - } - - // Important: This is the only case in which active_filters contains the items - // which have to be deleted from tree, instead of the other way around. - $this->active_filters[$key] = $this->filters[$key]['exclude_branches']; - } - else + + /** + */ + public function init_setting_build() { - $this->active_filters[$key] = null; - } - } // end of method - - /** - * - * mode this affect domain - */ - private function init_filter_keywords() { - $key = 'filter_keywords'; - $type = 'filter_keywords_filter_type'; - $this->filters[$key] = false; - $keywords = null; - $l10n = init_labels(array('logical_or' => null,'logical_and' => null, 'not_linked' => null)); - - switch ($this->mode) { - case 'edit_mode': - case 'plan_add_mode': - // we need the keywords for the whole testproject - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } - $keywords = $this->testproject_mgr->getUsedKeywordsMap($this->args->testproject_id); - break; - - default: - // otherwise (not in edit mode), we want only keywords assigned to testplan - if (!$this->testplan_mgr) { - $this->testplan_mgr = new testplan($this->db); + $key = 'setting_build'; + if (is_null($this->testplan_mgr)) { + $this->testplan_mgr = new testplan($this->db); } + $tplan_id = $this->settings['setting_testplan']['selected']; - $keywords = $this->testplan_mgr->get_keywords_map($tplan_id, ' ORDER BY keyword '); - break; - } - $special = array('domain' => array(), 'filter_mode' => array()); - switch($this->mode) { - case 'edit_mode': - $special['domain'] = - array(-1 => $this->option_strings['without_keywords'], - 0 => $this->option_strings['any']); - $special['filter_mode'] = array('NotLinked' => $l10n['not_linked']); - break; - - case 'execution_mode': - case 'plan_add_mode': - case 'plan_mode': - default: - $special['domain'] = array(0 => $this->option_strings['any']); - $special['filter_mode'] = array(); - break; - } + switch ($this->mode) { + case 'plan_mode': + $active = $open = null; + if ($this->configuration->setting_build_inactive_out) { + $active = testplan::GET_ACTIVE_BUILD; + } + + if ($this->configuration->setting_build_close_out) { + $open = testplan::GET_OPEN_BUILD; + } + break; + + default: + $active = testplan::GET_ACTIVE_BUILD; + $open = testplan::GET_OPEN_BUILD; + break; + } + + $this->settings[$key]['items'] = $this->testplan_mgr->get_builds_for_html_options( + $tplan_id, $active, $open); + $tplan_builds = array_keys((array) $this->settings[$key]['items']); + + // According to mode, we need different labels for this selector on GUI + $label = ($this->mode == 'plan_mode') ? 'assign_build' : 'exec_build'; + $this->settings[$key]['label'] = lang_get($label); + + // if no build has been chosen by user, select newest build by default + $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, + $active, $open); + + $session_key = $tplan_id . '_stored_setting_build'; + $session_selection = isset($_SESSION[$session_key]) ? $_SESSION[$session_key] : null; - $selection = $this->args->{$key}; - $type_selection = $this->args->{$type}; - - // are there any keywords? - $atLeastOneKW = !is_null($keywords) && count($keywords); - if ($atLeastOneKW) { - $this->filters[$key] = array(); - - if (!$selection || !$type_selection || $this->args->reset_filters) { - // default values for filter reset - $selection = null; - $type_selection = 'Or'; - } else { - $this->do_filtering = true; - } - - // data for the keywords themselves - $this->filters[$key]['items'] = $special['domain'] + $keywords; - $this->filters[$key]['selected'] = $selection; - $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), - self::ADVANCED_FILTER_ITEM_QUANTITY); - - // additional data for the filter type (logical and/or) - $this->filters[$key][$type] = array(); - $this->filters[$key][$type]['items'] = array('Or' => $l10n['logical_or'], - 'And' => $l10n['logical_and']) + - $special['filter_mode']; - $this->filters[$key][$type]['selected'] = $type_selection; + $this->args->{$key} = $this->args->{$key} > 0 ? $this->args->{$key} : $session_selection; + + if (! $this->args->$key) { + $this->args->$key = $newest_build_id; + } + + // only take build ID into account if it really is a build from this testplan + $this->settings[$key]['selected'] = (in_array($this->args->$key, + (array) $tplan_builds)) ? $this->args->$key : $newest_build_id; + + // still no build selected? take first one from selection. + if (empty($this->settings[$key]['selected']) && + empty($this->settings[$key]['items'])) { + $this->settings[$key]['selected'] = end($tplan_builds); + } + + $_SESSION[$session_key] = $this->settings[$key]['selected']; } - - if ($atLeastOneKW) { - // set the active value to filter - // delete keyword filter if: - // - "any" (0) is part of the selection AND - // - there are several elements in the array (user selection) - // !!Regardless of filter mode!! - // - if (is_array($this->filters[$key]['selected']) && - count($this->filters[$key]['selected']) > 1 && - in_array(0, $this->filters[$key]['selected'])) { - $this->active_filters[$key] = null; - } else { - $this->active_filters[$key] = $this->filters[$key]['selected']; - } - $this->active_filters[$type] = $selection ? $type_selection : null; - } else { - $this->active_filters[$key] = 0; - } - } - - - - // TICKET 4353: added active/inactive filter - private function init_filter_active_inactive() { - $key = 'filter_active_inactive'; - - $items = array(DO_NOT_FILTER_INACTIVE_TESTCASES => $this->option_strings['any'], - IGNORE_INACTIVE_TESTCASES => lang_get('show_only_active_testcases'), - IGNORE_ACTIVE_TESTCASES => lang_get('show_only_inactive_testcases')); - - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else + + /** + * + * @used-by: tlTestCaseFilterControl->init_settings() + */ + public function init_setting_testplan() { - $this->do_filtering = true; + if (is_null($this->testplan_mgr)) { + $this->testplan_mgr = new testplan($this->db); + } + + $key = 'setting_testplan'; + $testplans = $this->user->getAccessibleTestPlans($this->db, + $this->args->testproject_id); + + if (isset($_SESSION['testplanID']) && + $_SESSION['testplanID'] != $this->args->{$key}) { + // testplan was changed, we need to reset all filters + // --> they were chosen for another testplan, not this one! + $this->args->reset_filters = true; + + // check if user is allowed to set chosen testplan before changing + foreach ($testplans as $plan) { + if ($plan['id'] == $this->args->{$key}) { + setSessionTestPlan($plan); + } + } + } + + // now load info from session + $info = $this->testplan_mgr->get_by_id($_SESSION['testplanID']); + $this->args->testplan_name = $info['name']; + $this->args->testplan_id = $info['id']; + $this->args->{$key} = $info['id']; + $this->settings[$key]['selected'] = $info['id']; + + // Final filtering based on mode: + // Now get all selectable testplans for the user to display. + // For execution: + // For assign test case execution feature: + // don't take testplans into selection which have no (active/open) builds! + // + // For plan add mode: + // add every plan no matter if he has builds or not. + + foreach ($testplans as $plan) { + $add_plan = $this->mode == 'plan_add_mode' || + ($this->mode == 'plan_mode' && + $this->args->feature != 'tc_exec_assignment'); + + if (! $add_plan) { + $builds = $this->testplan_mgr->get_builds($plan['id'], + testplan::GET_ACTIVE_BUILD, testplan::GET_OPEN_BUILD); + $add_plan = (is_array($builds) && count($builds)); + } + + if ($add_plan) { + $this->settings[$key]['items'][$plan['id']] = $plan['name']; + } + } } - $this->filters[$key] = array('items' => $items, 'selected' => $selection); - $this->active_filters[$key] = $selection; - } - - - /** - * - */ - private function init_filter_importance() - { - // show this filter only if test priority management is enabled - $key = 'filter_importance'; - $this->active_filters[$key] = null; - $this->filters[$key] = false; - - if (!$this->testproject_mgr) + /** + * Possibility to filter by Platform: + * according mode we need to add [Any] option + * it's really a filter? + */ + public function init_setting_platform() { - $this->testproject_mgr = new testproject($this->db); + if (! $this->platform_mgr) { + $this->platform_mgr = new tlPlatform($this->db); + } + + $testplan_id = $this->settings['setting_testplan']['selected']; + $session_key = $testplan_id . '_stored_setting_platform'; + $session_selection = isset($_SESSION[$session_key]) ? $_SESSION[$session_key] : null; + $key = 'setting_platform'; + + switch ($this->mode) { + case 'edit_mode': + case 'plan_add_mode': + break; + } + + $platformSet = $this->platform_mgr->getLinkedToTestplanAsMap( + $testplan_id); + if (is_null($platformSet) || count($platformSet) == 0) { + // Brute force bye, bye !! >>---> + $this->settings[$key] = [ + 'items' => null, + 'selected' => - 1 + ]; + $_SESSION[$session_key] = null; + return; + } + + // Ok, there are platforms, go ahead + $this->settings[$key] = [ + 'items' => null, + 'selected' => - 1 + ]; + + if (is_null($this->args->$key)) { + $this->args->$key = intval($session_selection); + } + + switch ($this->mode) { + case 'plan_mode': + $this->settings[$key]['items'] = [ + 0 => $this->option_strings['any'] + ]; + $this->settings[$key]['items'] += $platformSet; + break; + + case 'execution_mode': + $this->settings[$key]['items'] = $platformSet; + break; + + default: + throw new Exception( + __METHOD__ . "Mode:" . $this->mode . 'Do not know what to do', + 1); + break; + } + + // If this platform is NOT valid for Test plan, I will set the first one + // (is any exists). + if (! isset($this->settings[$key]['items'])) { + $this->args->$key = key($this->settings[$key]['items']); + } + + $this->settings[$key]['selected'] = $this->args->$key; + if ($this->args->$key <= 0) { + $this->settings[$key]['selected'] = key( + $this->settings[$key]['items']); + } + + $_SESSION[$session_key] = $this->settings[$key]['selected']; } - $tp_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - $enabled = $tp_info['opt']->testPriorityEnabled; - if ($enabled) + /** + */ + public function init_filter_tc_id() { - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - - $this->filters[$key] = array('selected' => $selection); - - // Only drawback: no new user defined importance can be managed - // may be is a good design choice - $this->filters[$key]['items'] = array(0 => $this->option_strings['any'], - HIGH => lang_get('high_importance'), - MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - $this->filters[$key]['size'] = sizeof($this->filters[$key]['items']); - $this->active_filters[$key] = $selection; + $key = 'filter_tc_id'; + $selection = $this->args->{$key}; + $internal_id = null; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + if (! $this->tc_mgr) { + $this->tc_mgr = new testcase($this->db); + } + + $tc_prefix = $this->testproject_mgr->getTestCasePrefix( + $this->args->testproject_id); + $tc_prefix .= $this->configuration->tc_cfg->glue_character; + + if (! $selection || $selection == $tc_prefix || + $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + // we got the external ID here when filtering, + // but need the internal one + $oget = [ + 'tproject_id' => $this->args->testproject_id + ]; + $internal_id = $this->tc_mgr->getInternalID($selection, $oget); + } + + $this->filters[$key] = array( + 'selected' => $selection ? $selection : $tc_prefix + ); + $this->active_filters[$key] = $internal_id; } - } - - - /** - * - * - */ - private function init_filter_priority() - { - // This is a special case of filter: the menu items don't get initialized here, - // they are available as a global smarty variable. So the only thing to be managed - // here is the selection by user. - $key = 'filter_priority'; - - if (!$this->testproject_mgr) + + /** + */ + public function init_filter_testcase_name() { - $this->testproject_mgr = new testproject($this->db); + $key = 'filter_testcase_name'; + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; } - - $tp_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - $enabled = $tp_info['opt']->testPriorityEnabled; - - $this->active_filters[$key] = null; - $this->filters[$key] = false; - - if ($enabled) + + /** + */ + public function init_filter_toplevel_testsuite() { - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else - { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - } // end of method - - /** - * - */ - private function init_filter_execution_type() - { - if (!$this->tc_mgr) { - $this->tc_mgr = new testcase($this->db); - } - $key = 'filter_execution_type'; - - $selection = $this->args->{$key}; - // handle filter reset - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; - } - - $this->filters[$key] = array('items' => array(), 'selected' => $selection); - - // load available execution types - // add "any" string to these types at index 0 as default selection - $this->filters[$key]['items'] = $this->tc_mgr->get_execution_types(); - $this->filters[$key]['items'] = array(0 => $this->option_strings['any']) - + $this->filters[$key]['items']; - - $this->active_filters[$key] = $selection; - } // end of method - - /** - * - */ - private function init_filter_assigned_user() { - if (!$this->testproject_mgr) { - $this->testproject_mgr = new testproject($this->db); - } + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $key = 'filter_toplevel_testsuite'; + $first_level_suites = $this->testproject_mgr->get_first_level_test_suites( + $this->args->testproject_id, 'smarty_html_options'); + + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } - $key = 'filter_assigned_user'; - $unassigned_key = 'filter_assigned_user_include_unassigned'; - $tplan_id = $this->settings['setting_testplan']['selected']; + // this filter should only be visible if there are any top level testsuites + $this->filters[$key] = null; + if ($first_level_suites) { + $this->filters[$key] = array( + 'items' => array( + 0 => '' + ), + 'selected' => $selection, + 'exclude_branches' => array() + ); + + foreach ($first_level_suites as $suite_id => $suite_name) { + $this->filters[$key]['items'][$suite_id] = $suite_name; + if ($selection && $suite_id != $selection) { + $this->filters[$key]['exclude_branches'][$suite_id] = 'exclude_me'; + } + } - // set selection to default (any), only change if value is sent by user and reset is not requested - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; + // Important: This is the only case in which active_filters contains the items + // which have to be deleted from tree, instead of the other way around. + $this->active_filters[$key] = $this->filters[$key]['exclude_branches']; + } else { + $this->active_filters[$key] = null; + } } - $tproject_info = $this->testproject_mgr->get_by_id($this->args->testproject_id); - - $all_testers = getTestersForHtmlOptions($this->db, $tplan_id, $tproject_info, null, - array(TL_USER_ANYBODY => $this->option_strings['any'], - TL_USER_NOBODY => $this->option_strings['none'], - TL_USER_SOMEBODY => $this->option_strings['somebody']), - 'any'); - $visible_testers = $all_testers; - - // in execution mode the rights of the user have to be regarded - if ($this->mode == 'execution_mode') + /** + * mode this affect domain + */ + public function init_filter_keywords() { - $role = $this->user->getEffectiveRole($this->db, $this->args->testproject_id, $tplan_id); - - $simple_tester_roles = array_flip($this->configuration->exec_cfg->simple_tester_roles); - - // check the user's rights to see what he may do - $right_to_execute = $role->hasRight('testplan_execute'); - $right_to_manage = $role->hasRight('testplan_planning'); - - $simple = false; - if (isset($simple_tester_roles[$role->dbID]) || ($right_to_execute && !$right_to_manage)) { - // user is only simple tester and may not see/execute everything - $simple = true; - } - - $view_mode = $simple ? $this->configuration->exec_cfg->view_mode->tester : 'all'; - - if ($view_mode != 'all') { - $visible_testers = (array)$this->user->getDisplayName(); - $selection = (array)$this->user->dbID; - } - - // re-enable option "user_filter_default" - if (!$selection && $this->configuration->exec_cfg->user_filter_default == 'logged_user') { - $selection = (array)$this->user->dbID; - } - } - - $this->filters[$key] = array('items' => $visible_testers, - 'selected' => $selection, - $unassigned_key => $this->args->{$unassigned_key}); - - // which value shall be passed to tree generation class? - - if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection)) - || ($selection == TL_USER_ANYBODY)) { - // delete user assignment filter if "any user" is part of the selection - $this->active_filters[$key] = null; - $this->active_filters[$unassigned_key] = 0; - } - - if (is_array($selection)) { - // get keys of the array as values - $this->active_filters[$key] = array_flip($selection); - foreach ($this->active_filters[$key] as $user_key => $user_value) { - $this->active_filters[$key][$user_key] = $user_key; - } - $this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key]; + $key = 'filter_keywords'; + $type = 'filter_keywords_filter_type'; + $this->filters[$key] = false; + $keywords = null; + $l10n = init_labels( + array( + 'logical_or' => null, + 'logical_and' => null, + 'not_linked' => null + )); + + switch ($this->mode) { + case 'edit_mode': + case 'plan_add_mode': + // we need the keywords for the whole testproject + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $keywords = $this->testproject_mgr->getUsedKeywordsMap( + $this->args->testproject_id); + break; + + default: + // otherwise (not in edit mode), we want only keywords assigned to testplan + if (! $this->testplan_mgr) { + $this->testplan_mgr = new testplan($this->db); + } + $tplan_id = $this->settings['setting_testplan']['selected']; + $keywords = $this->testplan_mgr->get_keywords_map($tplan_id, + ' ORDER BY keyword '); + break; + } + + $special = array( + 'domain' => array(), + 'filter_mode' => array() + ); + switch ($this->mode) { + case 'edit_mode': + $special['domain'] = array( + - 1 => $this->option_strings['without_keywords'], + 0 => $this->option_strings['any'] + ); + $special['filter_mode'] = array( + 'NotLinked' => $l10n['not_linked'] + ); + break; + + case 'execution_mode': + case 'plan_add_mode': + case 'plan_mode': + default: + $special['domain'] = array( + 0 => $this->option_strings['any'] + ); + $special['filter_mode'] = array(); + break; + } + + $selection = $this->args->{$key}; + $type_selection = $this->args->{$type}; + + // are there any keywords? + $atLeastOneKW = ! is_null($keywords) && count($keywords); + if ($atLeastOneKW) { + $this->filters[$key] = array(); + + if (! $selection || ! $type_selection || $this->args->reset_filters) { + // default values for filter reset + $selection = null; + $type_selection = 'Or'; + } else { + $this->do_filtering = true; + } + + // data for the keywords themselves + $this->filters[$key]['items'] = $special['domain'] + $keywords; + $this->filters[$key]['selected'] = $selection; + $this->filters[$key]['size'] = min( + count($this->filters[$key]['items']), + self::ADVANCED_FILTER_ITEM_QUANTITY); + + // additional data for the filter type (logical and/or) + $this->filters[$key][$type] = array(); + $this->filters[$key][$type]['items'] = array( + 'Or' => $l10n['logical_or'], + 'And' => $l10n['logical_and'] + ) + $special['filter_mode']; + $this->filters[$key][$type]['selected'] = $type_selection; + } + + if ($atLeastOneKW) { + // set the active value to filter + // delete keyword filter if: + // - "any" (0) is part of the selection AND + // - there are several elements in the array (user selection) + // !!Regardless of filter mode!! + // + if (is_array($this->filters[$key]['selected']) && + count($this->filters[$key]['selected']) > 1 && + in_array(0, $this->filters[$key]['selected'])) { + $this->active_filters[$key] = null; + } else { + $this->active_filters[$key] = $this->filters[$key]['selected']; + } + $this->active_filters[$type] = $selection ? $type_selection : null; + } else { + $this->active_filters[$key] = 0; + } } - } // end of method - - - /** - * - */ - private function init_filter_result() { - $result_key = 'filter_result_result'; - $method_key = 'filter_result_method'; - $build_key = 'filter_result_build'; - - if (is_null($this->testplan_mgr)) + + // TICKET 4353: added active/inactive filter + public function init_filter_active_inactive() { - $this->testplan_mgr = new testplan($this->db); + $key = 'filter_active_inactive'; + + $items = array( + DO_NOT_FILTER_INACTIVE_TESTCASES => $this->option_strings['any'], + IGNORE_INACTIVE_TESTCASES => lang_get('show_only_active_testcases'), + IGNORE_ACTIVE_TESTCASES => lang_get('show_only_inactive_testcases') + ); + + $selection = $this->args->{$key}; + + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => $items, + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; } - $tplan_id = $this->settings['setting_testplan']['selected']; - - $this->configuration->results = config_get('results'); - - // determine, which config to load and use for filter methods - depends on mode! - $cfg = ($this->mode == 'execution_mode') ? - 'execution_filter_methods' : 'execution_assignment_filter_methods'; - $this->configuration->filter_methods = config_get($cfg); - - // - // CRITIC - Differences bewteen this configuration and - // (file const.inc.php) - // $tlCfg->execution_filter_methods['default_type'] - // $tlCfg->execution_assignment_filter_methods['default_type'] - // - // Will create issues: you will see an string on HTML SELECT, but code - // returned on submit will not code for string you are seeing.!!!! - // - // determine which filter method shall be selected by the JS function in template, - // when only one build is selectable by the user - $js_key_to_select = 0; - if ($this->mode == 'execution_mode') - { - $js_key_to_select = $this->configuration->filter_methods['status_code']['current_build']; - } - else if ($this->mode == 'plan_mode') + + /** + */ + public function init_filter_importance() { - $js_key_to_select = $this->configuration->filter_methods['status_code']['specific_build']; + // show this filter only if test priority management is enabled + $key = 'filter_importance'; + $this->active_filters[$key] = null; + $this->filters[$key] = false; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + $tp_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + $enabled = $tp_info['opt']->testPriorityEnabled; + + if ($enabled) { + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + + // Only drawback: no new user defined importance can be managed + // may be is a good design choice + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'], + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $this->filters[$key]['size'] = count($this->filters[$key]['items']); + $this->active_filters[$key] = $selection; + } } - - // values selected by user - $result_selection = $this->args->$result_key; - $method_selection = $this->args->$method_key; - $build_selection = $this->args->$build_key; - - // default values - $default_filter_method = $this->configuration->filter_methods['default_type']; - $any_result_key = $this->configuration->results['status_code']['all']; - $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, testplan::GET_ACTIVE_BUILD); - - if (is_null($method_selection)) + + /** + */ + public function init_filter_priority() { - $method_selection = $default_filter_method; + // This is a special case of filter: the menu items don't get initialized here, + // they are available as a global smarty variable. So the only thing to be managed + // here is the selection by user. + $key = 'filter_priority'; + + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $tp_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + $enabled = $tp_info['opt']->testPriorityEnabled; + + $this->active_filters[$key] = null; + $this->filters[$key] = false; + + if ($enabled) { + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; + } } - if (is_null($result_selection) || $this->args->reset_filters) - // if ($this->args->reset_filters) + /** + */ + public function init_filter_execution_type() { - // no selection yet or filter reset requested - $result_selection = $any_result_key; - $method_selection = $default_filter_method; - $build_selection = $newest_build_id; - } - else - { - $this->do_filtering = true; + if (! $this->tc_mgr) { + $this->tc_mgr = new testcase($this->db); + } + $key = 'filter_execution_type'; + + $selection = $this->args->{$key}; + // handle filter reset + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => array(), + 'selected' => $selection + ); + + // load available execution types + // add "any" string to these types at index 0 as default selection + $this->filters[$key]['items'] = $this->tc_mgr->get_execution_types(); + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'] + ) + $this->filters[$key]['items']; + + $this->active_filters[$key] = $selection; } - - // init array structure - $key = 'filter_result'; - $this->filters[$key] = array($result_key => array('items' => null, - 'selected' => $result_selection), - $method_key => array('items' => array(), - 'selected' => $method_selection, - 'js_selection' => $js_key_to_select), - $build_key => array('items' => null, - 'selected' => $build_selection)); - - // init menu for result selection by function from exec.inc.php - $this->filters[$key][$result_key]['items'] = createResultsMenu(); - $this->filters[$key][$result_key]['items'][$any_result_key] = $this->option_strings['any']; - - // init menu for filter method selection - foreach ($this->configuration->filter_methods['status_code'] as $statusname => $statusshortcut) + + /** + */ + public function init_filter_assigned_user() { - $code = $this->configuration->filter_methods['status_code'][$statusname]; - $this->filters[$key][$method_key]['items'][$code] = - lang_get($this->configuration->filter_methods['status_label'][$statusname]); + if (! $this->testproject_mgr) { + $this->testproject_mgr = new testproject($this->db); + } + + $key = 'filter_assigned_user'; + $unassigned_key = 'filter_assigned_user_include_unassigned'; + $tplan_id = $this->settings['setting_testplan']['selected']; + + // set selection to default (any), only change if value is sent by user and reset is not requested + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + + $tproject_info = $this->testproject_mgr->get_by_id( + $this->args->testproject_id); + + $all_testers = getTestersForHtmlOptions($this->db, $tplan_id, + $tproject_info, null, + array( + TL_USER_ANYBODY => $this->option_strings['any'], + TL_USER_NOBODY => $this->option_strings['none'], + TL_USER_SOMEBODY => $this->option_strings['somebody'] + ), 'any'); + $visible_testers = $all_testers; + + // in execution mode the rights of the user have to be regarded + if ($this->mode == 'execution_mode') { + $role = $this->user->getEffectiveRole($this->db, + $this->args->testproject_id, $tplan_id); + + $simple_tester_roles = array_flip( + $this->configuration->exec_cfg->simple_tester_roles); + + // check the user's rights to see what he may do + $right_to_execute = $role->hasRight('testplan_execute'); + $right_to_manage = $role->hasRight('testplan_planning'); + + $simple = false; + if (isset($simple_tester_roles[$role->dbID]) || + ($right_to_execute && ! $right_to_manage)) { + // user is only simple tester and may not see/execute everything + $simple = true; + } + + $view_mode = $simple ? $this->configuration->exec_cfg->view_mode->tester : 'all'; + + if ($view_mode != 'all') { + $visible_testers = (array) $this->user->getDisplayName(); + $selection = (array) $this->user->dbID; + } + + // re-enable option "user_filter_default" + if (! $selection && + $this->configuration->exec_cfg->user_filter_default == + 'logged_user') { + $selection = (array) $this->user->dbID; + } + } + + $this->filters[$key] = array( + 'items' => $visible_testers, + 'selected' => $selection, + $unassigned_key => $this->args->{$unassigned_key} + ); + + // which value shall be passed to tree generation class? + + if ((is_array($selection) && in_array(TL_USER_ANYBODY, $selection)) || + ($selection == TL_USER_ANYBODY)) { + // delete user assignment filter if "any user" is part of the selection + $this->active_filters[$key] = null; + $this->active_filters[$unassigned_key] = 0; + } + + if (is_array($selection)) { + // get keys of the array as values + $this->active_filters[$key] = array_flip($selection); + foreach ($this->active_filters[$key] as $user_key => $user_value) { + $this->active_filters[$key][$user_key] = $user_key; + } + $this->active_filters[$unassigned_key] = $this->filters[$key][$unassigned_key]; + } } - - // init menu for build selection - $this->filters[$key][$build_key]['items'] = - $this->testplan_mgr->get_builds_for_html_options($tplan_id, testplan::GET_ACTIVE_BUILD); - - // if "any" is selected, nullify the active filters - if ((is_array($result_selection) && in_array($any_result_key, $result_selection)) || - $result_selection == $any_result_key) - { - $this->active_filters[$result_key] = null; - $this->active_filters[$method_key] = null; - $this->active_filters[$build_key] = null; - $this->filters[$key][$result_key]['selected'] = $any_result_key; - } - else + + /** + */ + public function init_filter_result() { - $this->active_filters[$result_key] = $result_selection; - $this->active_filters[$method_key] = $method_selection; - $this->active_filters[$build_key] = $build_selection; + $result_key = 'filter_result_result'; + $method_key = 'filter_result_method'; + $build_key = 'filter_result_build'; + + if (is_null($this->testplan_mgr)) { + $this->testplan_mgr = new testplan($this->db); + } + $tplan_id = $this->settings['setting_testplan']['selected']; + + $this->configuration->results = config_get('results'); + + // determine, which config to load and use for filter methods - depends on mode! + $cfg = ($this->mode == 'execution_mode') ? 'execution_filter_methods' : 'execution_assignment_filter_methods'; + $this->configuration->filter_methods = config_get($cfg); + + // + // CRITIC - Differences bewteen this configuration and + // (file const.inc.php) + // $tlCfg->execution_filter_methods['default_type'] + // $tlCfg->execution_assignment_filter_methods['default_type'] + // + // Will create issues: you will see an string on HTML SELECT, but code + // returned on submit will not code for string you are seeing.!!!! + // + // determine which filter method shall be selected by the JS function in template, + // when only one build is selectable by the user + $js_key_to_select = 0; + if ($this->mode == 'execution_mode') { + $js_key_to_select = $this->configuration->filter_methods['status_code']['current_build']; + } elseif ($this->mode == 'plan_mode') { + $js_key_to_select = $this->configuration->filter_methods['status_code']['specific_build']; + } + + // values selected by user + $result_selection = $this->args->$result_key; + $method_selection = $this->args->$method_key; + $build_selection = $this->args->$build_key; + + // default values + $default_filter_method = $this->configuration->filter_methods['default_type']; + $any_result_key = $this->configuration->results['status_code']['all']; + $newest_build_id = $this->testplan_mgr->get_max_build_id($tplan_id, + testplan::GET_ACTIVE_BUILD); + + if (is_null($method_selection)) { + $method_selection = $default_filter_method; + } + + if (is_null($result_selection) || $this->args->reset_filters) + // if ($this->args->reset_filters) + { + // no selection yet or filter reset requested + $result_selection = $any_result_key; + $method_selection = $default_filter_method; + $build_selection = $newest_build_id; + } else { + $this->do_filtering = true; + } + + // init array structure + $key = 'filter_result'; + $this->filters[$key] = array( + $result_key => array( + 'items' => null, + 'selected' => $result_selection + ), + $method_key => array( + 'items' => array(), + 'selected' => $method_selection, + 'js_selection' => $js_key_to_select + ), + $build_key => array( + 'items' => null, + 'selected' => $build_selection + ) + ); + + // init menu for result selection by function from exec.inc.php + $this->filters[$key][$result_key]['items'] = createResultsMenu(); + $this->filters[$key][$result_key]['items'][$any_result_key] = $this->option_strings['any']; + + // init menu for filter method selection + foreach ($this->configuration->filter_methods['status_code'] as $statusname => $statusshortcut) { + $code = $this->configuration->filter_methods['status_code'][$statusname]; + $this->filters[$key][$method_key]['items'][$code] = lang_get( + $this->configuration->filter_methods['status_label'][$statusname]); + } + + // init menu for build selection + $this->filters[$key][$build_key]['items'] = $this->testplan_mgr->get_builds_for_html_options( + $tplan_id, testplan::GET_ACTIVE_BUILD); + + // if "any" is selected, nullify the active filters + if ((is_array($result_selection) && + in_array($any_result_key, $result_selection)) || + $result_selection == $any_result_key) { + $this->active_filters[$result_key] = null; + $this->active_filters[$method_key] = null; + $this->active_filters[$build_key] = null; + $this->filters[$key][$result_key]['selected'] = $any_result_key; + } else { + $this->active_filters[$result_key] = $result_selection; + $this->active_filters[$method_key] = $method_selection; + $this->active_filters[$build_key] = $build_selection; + } } - } // end of method - - /** - * - */ - private function init_filter_bugs() - { - $key = str_replace('init_','',__FUNCTION__); - $selection = $this->args->{$key}; - - if (!$selection || $this->args->reset_filters) - { - $selection = null; - } - else + + /** + */ + public function init_filter_bugs() { - $this->do_filtering = true; - } - - $this->filters[$key] = array('selected' => $selection); - $this->active_filters[$key] = $selection; - } - - - /** - * - * - * @internal revisions - * @since 1.9.14 - * allow multiple selection (if advanced mode) - */ - private function init_filter_workflow_status() { - $key = 'filter_workflow_status'; - if (!$this->tc_mgr) { - $this->tc_mgr = new testcase($this->db); - } + $key = str_replace('init_', '', __FUNCTION__); + $selection = $this->args->{$key}; - // handle filter reset - $ak = $key . "_values"; - $cfx = array(); - if( property_exists($this->configuration, $ak) ) { - $cfx = $this->configuration->{$key . "_values"}; - } + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) { - if( !is_null($this->args->caller) && !$selection) { - $selection = null; - } else if( count($cfx) > 0) { - $selection = $cfx; - $this->do_filtering = true; - } else { - $selection = null; - } - } else { - $this->do_filtering = true; + $this->filters[$key] = array( + 'selected' => $selection + ); + $this->active_filters[$key] = $selection; } - - $this->filters[$key] = array('items' => array(), 'selected' => $selection); - - // load domain - // add "any" string to these types at index 0 as default selection - $this->filters[$key]['items'] = array(0 => $this->option_strings['any']) + - $this->tc_mgr->getWorkFlowStatusDomain(); - - $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), - self::ADVANCED_FILTER_ITEM_QUANTITY); - - $this->active_filters[$key] = $selection; - } - - - - /** - * - * @used-by __construct - */ - private function initTreeOptions() { - $this->treeOpt['plan_mode'] = new stdClass(); - $this->treeOpt['plan_mode']->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; - $this->treeOpt['plan_mode']->useColours = COLOR_BY_TC_STATUS_OFF; - $this->treeOpt['plan_mode']->testcases_colouring_by_selected_build = DISABLED; - $this->treeOpt['plan_mode']->absolute_last_execution = true; // hmm probably useless - - } - - /** - * - */ - protected function getCustomFields($application_area=null) - { - if (!$this->cfield_mgr) + + /** + * + * @internal revisions + * @since 1.9.14 + * allow multiple selection (if advanced mode) + */ + public function init_filter_workflow_status() { - $this->cfield_mgr = new cfield_mgr($this->db); + $key = 'filter_workflow_status'; + if (! $this->tc_mgr) { + $this->tc_mgr = new testcase($this->db); + } + + // handle filter reset + $ak = $key . "_values"; + $cfx = array(); + if (property_exists($this->configuration, $ak)) { + $cfx = $this->configuration->{$key . "_values"}; + } + + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + if (! is_null($this->args->caller) && ! $selection) { + $selection = null; + } elseif (count($cfx) > 0) { + $selection = $cfx; + $this->do_filtering = true; + } else { + $selection = null; + } + } else { + $this->do_filtering = true; + } + + $this->filters[$key] = array( + 'items' => array(), + 'selected' => $selection + ); + + // load domain + // add "any" string to these types at index 0 as default selection + $this->filters[$key]['items'] = array( + 0 => $this->option_strings['any'] + ) + $this->tc_mgr->getWorkFlowStatusDomain(); + + $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), + self::ADVANCED_FILTER_ITEM_QUANTITY); + + $this->active_filters[$key] = $selection; } - $scope = array('design' => true,'execution' => false, 'testplan_design' => false); - $scope = array_merge($scope,(array)$application_area); - $cfields = array('design' => null,'execution' => null, 'testplan_design' => null); - if($scope['design']) + /** + * + * @used-by __construct + */ + public function initTreeOptions() { - $cfields['design'] = $this->cfield_mgr->get_linked_cfields_at_design($this->args->testproject_id, 1, null, 'testcase'); - } + $this->treeOpt['plan_mode'] = new stdClass(); + $this->treeOpt['plan_mode']->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; + $this->treeOpt['plan_mode']->useColours = COLOR_BY_TC_STATUS_OFF; + $this->treeOpt['plan_mode']->testcases_colouring_by_selected_build = self::DISABLED; + $this->treeOpt['plan_mode']->absolute_last_execution = true; // hmm probably useless + } - if($scope['testplan_design']) + /** + */ + protected function getCustomFields($application_area = null) { - $cfields['testplan_design'] = $this->cfield_mgr->get_linked_cfields_at_testplan_design($this->args->testproject_id,1,'testcase'); - } + if (! $this->cfield_mgr) { + $this->cfield_mgr = new cfield_mgr($this->db); + } + $scope = array( + 'design' => true, + 'execution' => false, + 'testplan_design' => false + ); + $scope = array_merge($scope, (array) $application_area); + + $cfields = array( + 'design' => null, + 'execution' => null, + 'testplan_design' => null + ); + if ($scope['design']) { + $cfields['design'] = $this->cfield_mgr->get_linked_cfields_at_design( + $this->args->testproject_id, 1, null, 'testcase'); + } - $cf = (array)$cfields['design'] + (array)$cfields['testplan_design']; + if ($scope['testplan_design']) { + $cfields['testplan_design'] = $this->cfield_mgr->get_linked_cfields_at_testplan_design( + $this->args->testproject_id, 1, 'testcase'); + } - // Because I'm using these as filters, need a special processing - // for CF types that present a domain like LIST, then if the blank option is - // not present will be added as FIRST OPTION + $cf = (array) $cfields['design'] + (array) $cfields['testplan_design']; + + // Because I'm using these as filters, need a special processing + // for CF types that present a domain like LIST, then if the blank option is + // not present will be added as FIRST OPTION + + if (! empty($cf)) { + $cfTypes = array_flip($this->cfield_mgr->get_available_types()); + $key2loop = array_keys($cf); + foreach ($key2loop as $cfID) { + // we will use these CF as filter => required property has to be + // set to false + $cf[$cfID]['required'] = 0; + + if ($cf[$cfID]['type'] == $cfTypes['list']) { + $addBlank = true; + $vv = explode('|', $cf[$cfID]['possible_values']); + foreach ($vv as $value) { + if (trim($value) == '') { + $addBlank = false; + break; + } + } + + if ($addBlank) { + $cf[$cfID]['possible_values'] = ' |' . + $cf[$cfID]['possible_values']; + } + } + } + return $cf; + } else { + return null; + } + } - if(count($cf) > 0) + /** + */ + protected function init_advanced_filter_mode() { - $cfTypes = array_flip($this->cfield_mgr->get_available_types()); - $key2loop = array_keys($cf); - foreach($key2loop as $cfID) - { - // we will use these CF as filter => required property has to be - // set to false - $cf[$cfID]['required'] = 0; - - if($cf[$cfID]['type'] == $cfTypes['list']) - { - $addBlank = true; - $vv = explode('|',$cf[$cfID]['possible_values']); - foreach($vv as $value) - { - if(trim($value) == '') - { - $addBlank = false; - break; - } - } - - if($addBlank) - { - $cf[$cfID]['possible_values'] = ' |' . $cf[$cfID]['possible_values']; - } - } - } - return $cf; - } - else - { - return null; - } - } - - /** - * - */ - protected function init_advanced_filter_mode() { - switch( $this->mode ) { - case 'edit_mode': - $this->advanced_filter_mode = TRUE; - break; - - default: - $m2c = __FUNCTION__; - parent::$m2c(); - break; - } - } // end of method - - - /** - * - */ - protected function init_setting_testsgroupby() { - $key = 'setting_testsgroupby'; - - $mode = (isset($_REQUEST[$key])) ? $_REQUEST[$key] : 'mode_test_suite'; - $this->args->testsgroupedby_mode = $mode; - $this->args->{$key} = $mode; - $this->settings[$key]['selected'] = $mode; - - $this->settings[$key]['items']['mode_test_suite'] = lang_get('mode_test_suite'); - $this->settings[$key]['items']['mode_req_coverage'] = lang_get('mode_req_coverage'); - } // end of method - - /** - * - * @used-by tlTestCaseFilterControl->init_settings() - * - */ - protected function init_setting_exec_tree_counters_logic() { - $key = str_replace('init_','',__FUNCTION__); - - // we need to understand if select Test Plan has platforms - $cfx = $this->configuration->exec_cfg->tcases_counters_mode_domain; - $logic = $this->configuration->exec_cfg->tcases_counters_mode; - $wow = 'without_platforms'; - if( $this->settings['setting_platform']["items"] != null ) { - $wow = 'with_platforms'; - } - $defaultAlgo = $logic[$wow]; - $lblKS = $cfx[$wow]; - $flipper = array(); - foreach($cfx[$wow] as $def ) { - $flipper[constant($def)] = $def; + switch ($this->mode) { + case 'edit_mode': + $this->advanced_filter_mode = true; + break; + + default: + $m2c = __FUNCTION__; + parent::$m2c(); + break; + } } - foreach( $lblKS as $lblKey ) { - $code = constant($lblKey); - $ak = strtolower($lblKey); - $this->settings[$key]['items'][$code] = lang_get($ak); - } - - $algo = intval( isset($_REQUEST[$key]) ? $_REQUEST[$key] : 0); - if( $algo == 0 ) { - if( isset($_SESSION[$key]) ) { - $algo = intval($_SESSION[$key]); - } - } + /** + */ + protected function init_setting_testsgroupby() + { + $key = 'setting_testsgroupby'; - // Validate Domain - if( !isset($flipper[$algo]) ) { - $algo = intval($defaultAlgo); - } + $mode = (isset($_REQUEST[$key])) ? $_REQUEST[$key] : 'mode_test_suite'; + $this->args->testsgroupedby_mode = $mode; + $this->args->{$key} = $mode; + $this->settings[$key]['selected'] = $mode; - $_SESSION[$key] = $this->args->{$key} = - $this->settings[$key]['selected'] = $algo; - - } // end of method - - - /** - * - */ - function setFiltersDefinition() { - - $this->all_filters = - array('filter_tc_id' => array("POST", tlInputParameter::STRING_N,0,30), - 'filter_testcase_name' => array("POST", tlInputParameter::STRING_N,0,100), - 'filter_toplevel_testsuite' => array("POST", tlInputParameter::STRING_N,0,100), - 'filter_keywords' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_workflow_status' => array("POST", tlInputParameter::INT_N), - 'filter_importance' => array("POST", tlInputParameter::INT_N), - 'filter_priority' => array("POST", tlInputParameter::INT_N), - 'filter_execution_type' => array("POST", tlInputParameter::INT_N), - 'filter_assigned_user' => array("POST", tlInputParameter::ARRAY_INT), - 'filter_custom_fields' => array("POST", tlInputParameter::ARRAY_STRING_N), - 'filter_result' => null, - 'filter_bugs' => array("POST", tlInputParameter::STRING_N,0,240), - 'filter_platforms' => array("POST", tlInputParameter::ARRAY_INT)); - - - } - - /** - * - * - */ - private function init_filter_platforms() { - if (!$this->platform_mgr) { - $this->platform_mgr = new tlPlatform($this->db); - } - $key = 'filter_platforms'; - $special = array(-1 => $this->option_strings['without_platforms'], - 0 => $this->option_strings['any']); - - // set selection to default (any), only change - // if value is sent by user and reset is not requested - $selection = $this->args->{$key}; - if (!$selection || $this->args->reset_filters) { - $selection = null; - } else { - $this->do_filtering = true; + $this->settings[$key]['items']['mode_test_suite'] = lang_get( + 'mode_test_suite'); + $this->settings[$key]['items']['mode_req_coverage'] = lang_get( + 'mode_req_coverage'); } - $this->platform_mgr->setTestProjectID($this->args->testproject_id); + /** + * + * @used-by tlTestCaseFilterControl->init_settings() + * + */ + protected function init_setting_exec_tree_counters_logic() + { + $key = str_replace('init_', '', __FUNCTION__); + + // we need to understand if select Test Plan has platforms + $cfx = $this->configuration->exec_cfg->tcases_counters_mode_domain; + $logic = $this->configuration->exec_cfg->tcases_counters_mode; + $wow = 'without_platforms'; + if ($this->settings['setting_platform']["items"] != null) { + $wow = 'with_platforms'; + } + $defaultAlgo = $logic[$wow]; + $lblKS = $cfx[$wow]; + $flipper = array(); + foreach ($cfx[$wow] as $def) { + $flipper[constant($def)] = $def; + } + foreach ($lblKS as $lblKey) { + $code = constant($lblKey); + $ak = strtolower($lblKey); + $this->settings[$key]['items'][$code] = lang_get($ak); + } - $opx = null; - switch ($this->mode) { - case 'edit_mode': - case 'plan_add_mode': - $opxy = array('enable_on_design' => true, - 'enable_on_execution' => false); - break; + $algo = intval(isset($_REQUEST[$key]) ? $_REQUEST[$key] : 0); + if ($algo == 0 && isset($_SESSION[$key])) { + $algo = intval($_SESSION[$key]); + } - } + // Validate Domain + if (! isset($flipper[$algo])) { + $algo = intval($defaultAlgo); + } - $platformSet = (array)$this->platform_mgr->getAllAsMap($opxy); - $this->filters[$key] = array('items' => $platformSet, - 'selected' => $selection); - $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), - self::ADVANCED_FILTER_ITEM_QUANTITY); - - // set the active value to filter - // delete filter if "any" (0) is part of the selection - regardless of filter mode - if (is_array($this->filters[$key]['selected']) && in_array(0, $this->filters[$key]['selected'])) { - $this->active_filters[$key] = null; - } else { - $this->active_filters[$key] = $this->filters[$key]['selected']; + $_SESSION[$key] = $this->args->{$key} = $this->settings[$key]['selected'] = $algo; } - - - - } // end of method + /** + */ + private function setFiltersDefinition() + { + $this->all_filters = array( + 'filter_tc_id' => array( + "POST", + tlInputParameter::STRING_N, + 0, + 30 + ), + 'filter_testcase_name' => array( + "POST", + tlInputParameter::STRING_N, + 0, + 100 + ), + 'filter_toplevel_testsuite' => array( + "POST", + tlInputParameter::STRING_N, + 0, + 100 + ), + 'filter_keywords' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_workflow_status' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_importance' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_priority' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_execution_type' => array( + "POST", + tlInputParameter::INT_N + ), + 'filter_assigned_user' => array( + "POST", + tlInputParameter::ARRAY_INT + ), + 'filter_custom_fields' => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + 'filter_result' => null, + 'filter_bugs' => array( + "POST", + tlInputParameter::STRING_N, + 0, + 240 + ), + 'filter_platforms' => array( + "POST", + tlInputParameter::ARRAY_INT + ) + ); + } + + /** + */ + public function init_filter_platforms() + { + if (! $this->platform_mgr) { + $this->platform_mgr = new tlPlatform($this->db); + } + $key = 'filter_platforms'; + + // set selection to default (any), only change + // if value is sent by user and reset is not requested + $selection = $this->args->{$key}; + if (! $selection || $this->args->reset_filters) { + $selection = null; + } else { + $this->do_filtering = true; + } + $this->platform_mgr->setTestProjectID($this->args->testproject_id); + switch ($this->mode) { + case 'edit_mode': + case 'plan_add_mode': + $opxy = array( + 'enable_on_design' => true, + 'enable_on_execution' => false + ); + break; + } -} \ No newline at end of file + $platformSet = (array) $this->platform_mgr->getAllAsMap($opxy); + $this->filters[$key] = array( + 'items' => $platformSet, + 'selected' => $selection + ); + $this->filters[$key]['size'] = min(count($this->filters[$key]['items']), + self::ADVANCED_FILTER_ITEM_QUANTITY); + + // set the active value to filter + // delete filter if "any" (0) is part of the selection - regardless of filter mode + if (is_array($this->filters[$key]['selected']) && + in_array(0, $this->filters[$key]['selected'])) { + $this->active_filters[$key] = null; + } else { + $this->active_filters[$key] = $this->filters[$key]['selected']; + } + } +} diff --git a/lib/functions/tlTestPlanMetrics.class.php b/lib/functions/tlTestPlanMetrics.class.php index 9742c1f39a..1b2a2bb309 100644 --- a/lib/functions/tlTestPlanMetrics.class.php +++ b/lib/functions/tlTestPlanMetrics.class.php @@ -1,3188 +1,3083 @@ -resultsCfg = config_get('results'); - $this->testCaseCfg = config_get('testcase_cfg'); - - $this->db = $db; - parent::__construct($db); - - $this->map_tc_status = $this->resultsCfg['status_code']; - - // 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->notRunStatusCode = $this->tc_status_for_statistics['not_run']; - - $this->statusCode = array_flip(array_keys($this->resultsCfg['status_label_for_exec_ui'])); - foreach($this->statusCode as $key => $dummy) - { - $this->statusCode[$key] = $this->resultsCfg['status_code'][$key]; - } - - // $this->execTaskCode = intval($this->assignment_types['testcase_execution']['id']); - - } // end results constructor - - - - public function getStatusConfig() - { - return $this->tc_status_for_statistics; - } - - - /** - * Function returns prioritized test result counter - * - * @param timestamp $milestoneTargetDate - (optional) milestone deadline - * @param timestamp $milestoneStartDate - (optional) milestone start date - * @return array with three priority counters - */ - public function getPrioritizedResults($tplanID,$milestoneTargetDate = null, $milestoneStartDate = null) - { - $output = array (HIGH=>0,MEDIUM=>0,LOW=>0); - - - for($urgency=1; $urgency <= 3; $urgency++) - { - for($importance=1; $importance <= 3; $importance++) - { - $sql = "SELECT COUNT(DISTINCT(TPTCV.id )) " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['executions']} E ON " . - " TPTCV.tcversion_id = E.tcversion_id " . - " JOIN {$this->tables['tcversions']} TCV ON " . - " TPTCV.tcversion_id = TCV.id " . - " WHERE TPTCV.testplan_id = {$tplanID} " . - " AND TPTCV.platform_id = E.platform_id " . - " AND E.testplan_id = {$tplanID} " . - " AND NOT E.status = '{$this->map_tc_status['not_run']}' " . - " AND TCV.importance={$importance} AND TPTCV.urgency={$urgency}"; - - // Milestones did not handle start and target date properly - $end_of_the_day = " 23:59:59"; - $beginning_of_the_day = " 00:00:00"; - - if( !is_null($milestoneTargetDate) ) - { - $sql .= " AND execution_ts < '" . $milestoneTargetDate . $end_of_the_day ."'"; - } - - if( !is_null($milestoneStartDate) ) - { - $sql .= " AND execution_ts > '" . $milestoneStartDate . $beginning_of_the_day ."'"; - } - - $tmpResult = $this->db->fetchOneValue($sql); - - // parse results into three levels of priority - $priority = priority_to_level($urgency*$importance); - $output[$priority] = $output[$priority] + $tmpResult; - } - } - - return $output; - } - - /** - * Function returns prioritized test case counter (in Test Plan) - * - * @return array with three priority counters - */ - public function getPrioritizedTestCaseCounters($tplanID) - { - $output = array (HIGH=>0,MEDIUM=>0,LOW=>0); - - /** @TODO - REFACTOR IS OUT OF STANDARD MAGIC NUMBERS */ - for($urgency=1; $urgency <= 3; $urgency++) - { - for($importance=1; $importance <= 3; $importance++) - { - // get total count of related TCs - $sql = "SELECT COUNT( TPTCV.id ) FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TPTCV.tcversion_id = TCV.id " . - " WHERE TPTCV.testplan_id = " . $tplanID . - " AND TCV.importance={$importance} AND TPTCV.urgency={$urgency}"; - - $tmpResult = $this->db->fetchOneValue($sql); - - // clean up priority usage - $priority = priority_to_level($urgency*$importance); - $output[$priority] = $output[$priority] + $tmpResult; - } - } - - return $output; - } - - - /** - * - */ - function getMilestonesMetrics($tplanID, $milestoneSet=null) - { - $results = array(); - - // get amount of test cases for each execution result + total amount of test cases - $planMetrics = $this->getExecCountersByExecStatus($tplanID); - - $milestones = is_null($milestoneSet) ? $this->get_milestones($tplanID) : $milestoneSet; - - // get amount of test cases for each priority for test plan - $priorityCounters = $this->getPrioritizedTestCaseCounters($tplanID); - $pc = array(LOW => 'result_low_percentage', MEDIUM => 'result_medium_percentage', - HIGH => 'result_high_percentage' ); - - $checks = array(LOW => 'low_percentage', MEDIUM => 'medium_percentage', - HIGH => 'high_percentage' ); - - $on_off = array(LOW => 'low_incomplete', MEDIUM => 'medium_incomplete', - HIGH => 'high_incomplete' ); - - // Important: - // key already defined on item: high_percentage,medium_percentage,low_percentage - foreach($milestones as $item) - { - $item['tcs_priority'] = $priorityCounters; - $item['tc_total'] = $planMetrics['total']; - - // get amount of executed test cases for each priority before target_date - $item['results'] = $this->getPrioritizedResults($tplanID, $item['target_date'], $item['start_date']); - $item['tc_completed'] = 0; - - // calculate percentage of executed test cases for each priority - foreach( $pc as $key => $item_key) - { - $target_key = $checks[$key]; - if( $item[$target_key] == 0 ) - { - $item[$item_key] = 100; - } - else - { - $item[$item_key] = ($priorityCounters[$key] > 0) ? - $this->get_percentage($priorityCounters[$key], $item['results'][$key]) : 0; - } - $item['tc_completed'] += $item['results'][$key]; - } - - // amount of all executed tc with any priority before target_date / all test cases - $item['percentage_completed'] = $this->get_percentage($item['tc_total'], $item['tc_completed']); - - foreach( $checks as $key => $item_key) { - // add 1 decimal places to expected percentages - $item[$checks[$key]] = number_format($item[$checks[$key]], 1); - - // check if target for each priority is reached - // show target as reached if expected percentage is greater than executed percentage - $item[$on_off[$key]] = ($item[$checks[$key]] > $item[$pc[$key]]) ? ON : OFF; - } - $results[$item['id']] = $item; - } - return $results; - } - - - /** - * calculate percentage and format - * - * @param int $total Total count - * @param int $parameter a parameter count - * @return string formatted percentage - */ - function get_percentage($total, $parameter) - { - $percentCompleted = ($total > 0) ? (($parameter / $total) * 100) : 100; - return number_format($percentCompleted,1); - } - - - - /** - * @used-by getOverallBuildStatusForRender() - * XML-RPC getExecCountersByBuild() - * - * - * No matter we are trying to calculate metrics for BUILDS, - * we need to consider execution status at Build and Platform level. - * - * Why? - * Let's review help we provide on GUI: - * - * The use of platforms has impact on metrics, because - * a test case that must be executed for N platforms is considered - * as N test cases on metrics. - * - * Example: Platform X and Y - * - * Test Case - Tester Assigned - * TC1 U1 - * - * user U1 has to execute TWO test cases, NOT ONE. - * This means that we HAVE to consider execution status ON (BUILD,PLATFORM), - * but we are not going to display results with BUILD and PLATFORM, - * but ONLY with BUILD indication. - * - * opt => array('getOnlyAssigned' => false, 'tprojectID' => 0, - * 'getPlatformSet' => false, 'processClosedBuilds' => true); - * filters => array('buildSet' => null); - * - */ - function getExecCountersByBuildExecStatus($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm) = - $this->helperGetExecCounters($safe_id, $filters, $opt); - - $fields = ""; - if( $my['opt']['groupByPlatform'] ) { - $fields = ",platform_id"; - } - - // This subquery is BETTER than the VIEW, need to understand why - // Last Executions By Build and Platform (LEBBP) - $sqlLEBBP = $sqlStm['LEBBP']; - - $sqlUnionAB = "/* {$debugMsg} sqlUnionAB - executions */" . - " SELECT DISTINCT UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . - - " /* GO FOR Absolute LATEST exec ID ON BUILD and PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.build_id = UA.build_id " . - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND UA.build_id IN ({$builds->inClause}) "; - - $sqlUnionBB = "/* {$debugMsg} sqlUnionBB - NOT RUN */" . - " SELECT DISTINCT UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - - // Without this I've created issue 5272 - " AND LEBBP.build_id = UA.build_id " . - - " AND LEBBP.testplan_id = " . $safe_id . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - - // Without this I've created issue 5272 - " AND E.build_id = LEBBP.build_id " . - - " /* FILTER BUILDS in set on target test plan (not alway can be applied) */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND UA.build_id IN ({$builds->inClause}) " . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBBP.id IS NULL"; - - - // 20140819 - I've not documented why I've use UNION ALL - // UNION ALL includes duplicates, but now (@20140819) because I've implemented - // test case exec assignment to MULTIPLE TESTERS, I need to remove duplicates - // to avoid wrong exec_qty. - // My choice was: add DISTINCT to each union piece. - // May be is a wrong choice, but I need to read and test more to understand - $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */" . - " SELECT count(0) AS exec_qty, build_id,status $fields " . - " FROM ($sqlUnionAB UNION ALL $sqlUnionBB ) AS SQBU " . - " GROUP BY build_id,status $fields"; - // 366 - if( $my['opt']['groupByPlatform'] ) { - $kol = array('platform_id','build_id','status'); - $exec['with_tester'] = - (array)$this->db->fetchRowsIntoMap3l($sql,$kol); - - // Need to Add info regarding: - // - Add info for ACTIVE BUILD WITHOUT any execution. ??? - // Hmm, think about Need to check is this way is better that request DBMS to do it. - // - Execution status that have not happened - foreach($exec as $dum => &$elem) { - $platSet = array_keys($elem); - foreach($platSet as $platId ) { - $itemSet = array_keys($elem[$platId]); - foreach($itemSet as $itemID) { - foreach($this->statusCode as $verbose => $code) { - if(!isset($elem[$platId][$itemID][$code])) { - $elem[$platId][$itemID][$code] = - array('build_id' => $itemID,'status' => $code, 'exec_qty' => 0); - } - } - } - } - } - } else { - $exec['with_tester'] = - (array)$this->db->fetchMapRowsIntoMap($sql,'build_id','status'); - // Need to Add info regarding: - // - Add info for ACTIVE BUILD WITHOUT any execution. ??? - // Hmm, think about Need to check is this way is better that request DBMS to do it. - // - Execution status that have not happened - foreach($exec as &$elem) { - $itemSet = array_keys($elem); - foreach($itemSet as $itemID) { - foreach($this->statusCode as $verbose => $code) { - if(!isset($elem[$itemID][$code])) { - $elem[$itemID][$code] = - array('build_id' => $itemID,'status' => $code, 'exec_qty' => 0); - } - } - } - } - } - - // get total assignments by BUILD ID - // changes due to test case exec assignment to MULTIPLE TESTERS - - if( $my['opt']['groupByPlatform'] ) { - - $sql = " /* $debugMsg */ - SELECT COUNT(0) AS qty, TT.build_id, TT.platform_id - FROM ( +resultsCfg = config_get('results'); + $this->testCaseCfg = config_get('testcase_cfg'); + + $this->db = $db; + parent::__construct($db); + + $this->map_tc_status = $this->resultsCfg['status_code']; + + // 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->statusCode = array_flip( + array_keys($this->resultsCfg['status_label_for_exec_ui'])); + foreach ($this->statusCode as $key => $dummy) { + $this->statusCode[$key] = $this->resultsCfg['status_code'][$key]; + } + } + + // end results constructor + public function getStatusConfig() + { + return $this->tc_status_for_statistics; + } + + /** + * Function returns prioritized test result counter + * + * @param int $milestoneTargetDate + * - (optional) milestone deadline + * @param int $milestoneStartDate + * - (optional) milestone start date + * @return array with three priority counters + */ + public function getPrioritizedResults($tplanID, $milestoneTargetDate = null, + $milestoneStartDate = null) + { + $output = array( + HIGH => 0, + MEDIUM => 0, + LOW => 0 + ); + + for ($urgency = 1; $urgency <= 3; $urgency ++) { + for ($importance = 1; $importance <= 3; $importance ++) { + $sql = "SELECT COUNT(DISTINCT(TPTCV.id )) " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['executions']} E ON " . + " TPTCV.tcversion_id = E.tcversion_id " . + " JOIN {$this->tables['tcversions']} TCV ON " . + " TPTCV.tcversion_id = TCV.id " . + " WHERE TPTCV.testplan_id = {$tplanID} " . + " AND TPTCV.platform_id = E.platform_id " . + " AND E.testplan_id = {$tplanID} " . + " AND NOT E.status = '{$this->map_tc_status['not_run']}' " . + " AND TCV.importance={$importance} AND TPTCV.urgency={$urgency}"; + + // Milestones did not handle start and target date properly + $end_of_the_day = " 23:59:59"; + $beginning_of_the_day = " 00:00:00"; + + if (! is_null($milestoneTargetDate)) { + $sql .= " AND execution_ts < '" . $milestoneTargetDate . + $end_of_the_day . "'"; + } + + if (! is_null($milestoneStartDate)) { + $sql .= " AND execution_ts > '" . $milestoneStartDate . + $beginning_of_the_day . "'"; + } + + $tmpResult = $this->db->fetchOneValue($sql); + + // parse results into three levels of priority + $priority = priority_to_level($urgency * $importance); + $output[$priority] += $tmpResult; + } + } + + return $output; + } + + /** + * Function returns prioritized test case counter (in Test Plan) + * + * @return array with three priority counters + */ + public function getPrioritizedTestCaseCounters($tplanID) + { + $output = array( + HIGH => 0, + MEDIUM => 0, + LOW => 0 + ); + + /** + * + * @todo - REFACTOR IS OUT OF STANDARD MAGIC NUMBERS + */ + for ($urgency = 1; $urgency <= 3; $urgency ++) { + for ($importance = 1; $importance <= 3; $importance ++) { + // get total count of related TCs + $sql = "SELECT COUNT( TPTCV.id ) FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TPTCV.tcversion_id = TCV.id " . + " WHERE TPTCV.testplan_id = " . $tplanID . + " AND TCV.importance={$importance} AND TPTCV.urgency={$urgency}"; + + $tmpResult = $this->db->fetchOneValue($sql); + + // clean up priority usage + $priority = priority_to_level($urgency * $importance); + $output[$priority] += $tmpResult; + } + } + + return $output; + } + + /** + */ + public function getMilestonesMetrics($tplanID, $milestoneSet = null) + { + $results = array(); + + // get amount of test cases for each execution result + total amount of test cases + $planMetrics = $this->getExecCountersByExecStatus($tplanID); + + $milestones = is_null($milestoneSet) ? $this->get_milestones($tplanID) : $milestoneSet; + + // get amount of test cases for each priority for test plan + $priorityCounters = $this->getPrioritizedTestCaseCounters($tplanID); + $pc = array( + LOW => 'result_low_percentage', + MEDIUM => 'result_medium_percentage', + HIGH => 'result_high_percentage' + ); + + $checks = array( + LOW => 'low_percentage', + MEDIUM => 'medium_percentage', + HIGH => 'high_percentage' + ); + + $on_off = array( + LOW => 'low_incomplete', + MEDIUM => 'medium_incomplete', + HIGH => 'high_incomplete' + ); + + // Important: + // key already defined on item: high_percentage,medium_percentage,low_percentage + foreach ($milestones as $item) { + $item['tcs_priority'] = $priorityCounters; + $item['tc_total'] = $planMetrics['total']; + + // get amount of executed test cases for each priority before target_date + $item['results'] = $this->getPrioritizedResults($tplanID, + $item['target_date'], $item['start_date']); + $item['tc_completed'] = 0; + + // calculate percentage of executed test cases for each priority + foreach ($pc as $key => $item_key) { + $target_key = $checks[$key]; + if ($item[$target_key] == 0) { + $item[$item_key] = 100; + } else { + $item[$item_key] = ($priorityCounters[$key] > 0) ? $this->get_percentage( + $priorityCounters[$key], $item['results'][$key]) : 0; + } + $item['tc_completed'] += $item['results'][$key]; + } + + // amount of all executed tc with any priority before target_date / all test cases + $item['percentage_completed'] = $this->get_percentage( + $item['tc_total'], $item['tc_completed']); + + foreach ($checks as $key => $item_key) { + // add 1 decimal places to expected percentages + $item[$checks[$key]] = number_format($item[$checks[$key]], 1); + + // check if target for each priority is reached + // show target as reached if expected percentage is greater than executed percentage + $item[$on_off[$key]] = ($item[$checks[$key]] > $item[$pc[$key]]) ? ON : OFF; + } + $results[$item['id']] = $item; + } + return $results; + } + + /** + * calculate percentage and format + * + * @param int $total + * Total count + * @param int $parameter + * a parameter count + * @return string formatted percentage + */ + private function get_percentage($total, $parameter) + { + $percentCompleted = ($total > 0) ? (($parameter / $total) * 100) : 100; + + return number_format($percentCompleted, 1); + } + + /** + * + * @used-by getOverallBuildStatusForRender() + * XML-RPC getExecCountersByBuild() + * + * + * No matter we are trying to calculate metrics for BUILDS, + * we need to consider execution status at Build and Platform level. + * + * Why? + * Let's review help we provide on GUI: + * + * The use of platforms has impact on metrics, because + * a test case that must be executed for N platforms is considered + * as N test cases on metrics. + * + * Example: Platform X and Y + * + * Test Case - Tester Assigned + * TC1 U1 + * + * user U1 has to execute TWO test cases, NOT ONE. + * This means that we HAVE to consider execution status ON (BUILD,PLATFORM), + * but we are not going to display results with BUILD and PLATFORM, + * but ONLY with BUILD indication. + * + * opt => array('getOnlyAssigned' => false, 'tprojectID' => 0, + * 'getPlatformSet' => false, 'processClosedBuilds' => true); + * filters => array('buildSet' => null); + * + */ + public function getExecCountersByBuildExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($safe_id, + $filters, $opt); + + $fields = ""; + if ($my['opt']['groupByPlatform']) { + $fields = ",platform_id"; + } + + // This subquery is BETTER than the VIEW, need to understand why + // Last Executions By Build and Platform (LEBBP) + $sqlLEBBP = $sqlStm['LEBBP']; + + $sqlUnionAB = "/* {$debugMsg} sqlUnionAB - executions */" . + " SELECT DISTINCT UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . + " /* GO FOR Absolute LATEST exec ID ON BUILD and PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.build_id = UA.build_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . " AND UA.build_id IN ({$builds->inClause}) "; + + $sqlUnionBB = "/* {$debugMsg} sqlUnionBB - NOT RUN */" . + " SELECT DISTINCT UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + + // Without this I've created issue 5272 + " AND LEBBP.build_id = UA.build_id " . " AND LEBBP.testplan_id = " . + $safe_id . " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + + // Without this I've created issue 5272 + " AND E.build_id = LEBBP.build_id " . + " /* FILTER BUILDS in set on target test plan (not alway can be applied) */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . + " AND UA.build_id IN ({$builds->inClause}) " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBBP.id IS NULL"; + + // 20140819 - I've not documented why I've use UNION ALL + // UNION ALL includes duplicates, but now (@20140819) because I've implemented + // test case exec assignment to MULTIPLE TESTERS, I need to remove duplicates + // to avoid wrong exec_qty. + // My choice was: add DISTINCT to each union piece. + // May be is a wrong choice, but I need to read and test more to understand + $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */" . + " SELECT count(0) AS exec_qty, build_id,status $fields " . + " FROM ($sqlUnionAB UNION ALL $sqlUnionBB ) AS SQBU " . + " GROUP BY build_id,status $fields"; + // 366 + if ($my['opt']['groupByPlatform']) { + $kol = array( + 'platform_id', + 'build_id', + 'status' + ); + $exec['with_tester'] = (array) $this->db->fetchRowsIntoMap3l($sql, + $kol); + + // Need to Add info regarding: + // - Add info for ACTIVE BUILD WITHOUT any execution. ??? + // Hmm, think about Need to check is this way is better that request DBMS to do it. + // - Execution status that have not happened + foreach ($exec as &$elem) { + $platSet = array_keys($elem); + foreach ($platSet as $platId) { + $itemSet = array_keys($elem[$platId]); + foreach ($itemSet as $itemID) { + foreach ($this->statusCode as $code) { + if (! isset($elem[$platId][$itemID][$code])) { + $elem[$platId][$itemID][$code] = array( + 'build_id' => $itemID, + 'status' => $code, + 'exec_qty' => 0 + ); + } + } + } + } + } + } else { + $exec['with_tester'] = (array) $this->db->fetchMapRowsIntoMap($sql, + 'build_id', 'status'); + // Need to Add info regarding: + // - Add info for ACTIVE BUILD WITHOUT any execution. ??? + // Hmm, think about Need to check is this way is better that request DBMS to do it. + // - Execution status that have not happened + foreach ($exec as &$elem) { + $itemSet = array_keys($elem); + foreach ($itemSet as $itemID) { + foreach ($this->statusCode as $code) { + if (! isset($elem[$itemID][$code])) { + $elem[$itemID][$code] = array( + 'build_id' => $itemID, + 'status' => $code, + 'exec_qty' => 0 + ); + } + } + } + } + } + + // get total assignments by BUILD ID + // changes due to test case exec assignment to MULTIPLE TESTERS + + if ($my['opt']['groupByPlatform']) { + + $sql = " /* $debugMsg */ + SELECT COUNT(0) AS qty, TT.build_id, TT.platform_id + FROM ( SELECT DISTINCT UA.build_id, UA.feature_id, - TPTCV.platform_id + TPTCV.platform_id FROM {$this->tables['user_assignments']} UA - JOIN {$this->tables['testplan_tcversions']} TPTCV - ON TPTCV.id = UA.feature_id + JOIN {$this->tables['testplan_tcversions']} TPTCV + ON TPTCV.id = UA.feature_id WHERE UA. build_id IN ( {$builds->inClause} ) - AND UA.type = {$this->execTaskCode} + AND UA.type = {$this->execTaskCode} GROUP BY build_id,feature_id, platform_id - ) TT - GROUP BY build_id, platform_id "; - - $exec['total'] = - (array)$this->db->fetchMapRowsIntoMap( - $sql,'platform_id','build_id'); - - } else { - $sql = " /* $debugMsg */ - SELECT COUNT(0) AS qty, TT.build_id - FROM ( - SELECT DISTINCT UA.build_id, UA.feature_id + ) TT + GROUP BY build_id, platform_id "; + + $exec['total'] = (array) $this->db->fetchMapRowsIntoMap($sql, + 'platform_id', 'build_id'); + } else { + $sql = " /* $debugMsg */ + SELECT COUNT(0) AS qty, TT.build_id + FROM ( + SELECT DISTINCT UA.build_id, UA.feature_id FROM {$this->tables['user_assignments']} UA - JOIN {$this->tables['testplan_tcversions']} TPTCV - ON TPTCV.id = UA.feature_id + JOIN {$this->tables['testplan_tcversions']} TPTCV + ON TPTCV.id = UA.feature_id WHERE UA. build_id IN ( {$builds->inClause} ) - AND UA.type = {$this->execTaskCode} + AND UA.type = {$this->execTaskCode} GROUP BY build_id,feature_id - ) TT - GROUP BY build_id "; - - $exec['total'] = - (array)$this->db->fetchRowsIntoMap($sql,'build_id'); - } - - $exec['active_builds'] = $builds->infoSet; - - return $exec; - } - - - /** - * - * - **/ - function getOverallBuildStatusForRender($id, $totalKey='total_assigned') { - $renderObj = null; - $code_verbose = $this->getStatusForReports(); - $labels = $this->resultsCfg['status_label']; - - $metrics = $this->getExecCountersByBuildExecStatus($id); - if( !is_null($metrics) ) { - $renderObj = new stdClass(); - - // Creating item list this way will generate a row also for - // ACTIVE BUILDS were ALL TEST CASES HAVE NO TESTER ASSIGNMENT - // $buildList = array_keys($metrics['active_builds']); - - // Creating item list this way will generate a row ONLY FOR - // ACTIVE BUILDS were TEST CASES HAVE TESTER ASSIGNMENT - $buildList = array_keys($metrics['with_tester']); - $renderObj->info = array(); - foreach($buildList as $buildID) - { - $totalRun = 0; - $renderObj->info[$buildID]['build_name'] = $metrics['active_builds'][$buildID]['name']; - $renderObj->info[$buildID][$totalKey] = $metrics['total'][$buildID]['qty']; - - $renderObj->info[$buildID]['details'] = array(); - - $rf = &$renderObj->info[$buildID]['details']; - foreach($code_verbose as $statusCode => $statusVerbose) - { - $rf[$statusVerbose] = array('qty' => 0, 'percentage' => 0); - $rf[$statusVerbose]['qty'] = $metrics['with_tester'][$buildID][$statusCode]['exec_qty']; - - if( $renderObj->info[$buildID][$totalKey] > 0 ) - { - $rf[$statusVerbose]['percentage'] = number_format(100 * - ($rf[$statusVerbose]['qty'] / - $renderObj->info[$buildID][$totalKey]),1); - } - - $totalRun += $statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']; - } - $renderObj->info[$buildID]['percentage_completed'] = - number_format(100 * - ($totalRun / $renderObj->info[$buildID][$totalKey]),1); - } - - foreach($code_verbose as $human) { - $l10n = isset($labels[$human]) ? lang_get($labels[$human]) : lang_get($human); - $renderObj->colDefinition[$human]['qty'] = $l10n; - $renderObj->colDefinition[$human]['percentage'] = '[%]'; - } - - } - return $renderObj; - } - - - - /** - * Important Notice about algorithm - * We are trying to provide WHOLE Test Plan metrics, - * then BUILD INFO will not be IMPORTANT. - * - * In addition, Keywords are attributes used on - * Test Case specification, for this reason, - * our choice is that platforms will be ignored for this metrics. - * - * Example: Platform X and Y - * Test Case: TC1 with one Keyword K1 - * - * we can develop this data in this way - * - * Test Case - Platform - Keyword - Build - Exec. ID - Exec. Status - * TC1 X K1 1.0 11 FAILED - * TC1 Y K1 1.0 13 BLOCKED - * TC1 X K1 2.0 16 PASSED - * TC1 Y K1 2.0 15 BLOCKED - * - * - * We have two choices: - * OPT 1. Platform multiplication - * - * consider (as was done on Builds Overall Status) - * TC1 as two test cases. - * If we proceed this way, may be user will be confused, because - * when searching test case spec according keyword, we are going to - * find ONLY ONE. - * - * OPT 2. IGNORE PLAFORMS - * Consider only LATEST execution, means we are going - * to count ONE test case no matter how many Platforms - * exists on test plan. - * - * Our design choice is on OPT 1 - * - * @used-by - * - * 20190711 - things are changing need to relaborate - * - */ - function getExecCountersByKeywordExecStatus($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm) = - $this->helperGetExecCounters($safe_id, $filters, $opt); - - - // may be too brute force but ... - if( ($tprojectID = $my['opt']['tprojectID']) == 0 ) { - $info = $this->tree_manager->get_node_hierarchy_info($safe_id); - $tprojectID = $info['parent_id']; - } - $tproject_mgr = new testproject($this->db); - $keywordSet = $tproject_mgr->get_keywords_map($tprojectID); - $tproject_mgr = null; - - - // This subquery is BETTER than a VIEW, need to understand why - // Latest Execution Ignoring Build => Cross Build - $sqlLEBP = $sqlStm['LEBP']; - - // Development Important Notice - // DISTINCT is needed when you what to get data ONLY FOR test cases with assigned testers, - // because we are (to make things worst) working on a BUILD SET, not on a SINGLE build, - // Use of IN clause, will have a NOT wanted multiplier effect on this query. - // - // This do not happens with other queries on other metric attributes, - // be careful before changing other queries. - // - $sqlUnionAK = "/* {$debugMsg} sqlUnionAK - executions */" . - " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id, TPTCV.platform_id,KW.keyword," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . - " JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBP.id " . - - " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ ". - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['testcase_keywords']} TCK " . - " ON TCK.testcase_id = NHTCV.parent_id " . - - " JOIN {$this->tables['keywords']} KW " . - " ON KW.id = TCK.keyword_id " . - - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddExec; - - // See Note about DISTINCT, on sqlUnionAK - $sqlUnionBK = "/* {$debugMsg} sqlUnionBK - NOT RUN */" . - " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id, TPTCV.platform_id,KW.keyword," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - $builds->joinAdd . - - " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ ". - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " JOIN {$this->tables['testcase_keywords']} TCK " . - " ON TCK.testcase_id = NHTCV.parent_id " . - - " JOIN {$this->tables['keywords']} KW " . - " ON KW.id = TCK.keyword_id " . - - " /* FILTER BUILDS in set on target test plan */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddNotRun . - - " /* Get REALLY NOT RUN => BOTH E.id AND LEBP.id NULL */ " . - " AND E.id IS NULL AND LEBP.id IS NULL"; - - // Due to PLATFORMS we will have MULTIPLIER EFFECT - $fields = "keyword_id"; - if( $my['opt']['groupByPlatform'] ) { - $fields = "platform_id,keyword_id"; - } - $sql = - " /* {$debugMsg} UNION Without ALL CLAUSE => DISCARD Duplicates */" . - " SELECT status,keyword,$fields,count(0) AS exec_qty " . - " FROM ($sqlUnionAK UNION $sqlUnionBK ) AS SQK " . - " GROUP BY status,keyword,$fields - ORDER BY keyword "; - - if( $my['opt']['groupByPlatform'] ) { - $kol = array('platform_id','keyword_id','status'); - $exec['with_tester'] = - (array)$this->db->fetchRowsIntoMap3l($sql,$kol); - - $this->helperStatusDomainMatrix($exec,'platform_id','keyword_id'); - - } else { - $exec['with_tester'] = - (array)$this->db->fetchMapRowsIntoMap($sql,'keyword_id','status'); - $this->helperCompleteStatusDomain($exec,'keyword_id'); - } - - // On next queries: - // we need to use distinct, because IF NOT we are going - // to get one record for each build where test case - // has TESTER ASSIGNMENT - // - // $exec['total_assigned'] = null; - $exec['total'] = null; - $exec['key4total'] = 'total'; - if( $my['opt']['getOnlyAssigned'] ) { - // $exec['key4total'] = 'total_assigned'; - $sql = "/* $debugMsg */ ". - " SELECT COUNT(0) AS qty,$fields " . - " FROM " . - " ( /* Get test case,keyword pairs */ " . - " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id,TPTCV.platform_id " . - " FROM {$this->tables['user_assignments']} UA " . - " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.id = UA.feature_id " . - - " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ ". - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['testcase_keywords']} TCK " . - " ON TCK.testcase_id = NHTCV.parent_id " . - " WHERE UA. build_id IN ( " . $builds->inClause . " ) " . - " AND UA.type = {$execCode} ) AS SQK ". - " GROUP BY $fields"; - } else { - $sql = "/* $debugMsg */ ". - " SELECT COUNT(0) AS qty, $fields" . - " FROM " . - " ( /* Get test case,keyword pairs */ " . - " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id,TPTCV.platform_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ ". - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['testcase_keywords']} TCK " . - " ON TCK.testcase_id = NHTCV.parent_id " . - " WHERE TPTCV.testplan_id = " . $safe_id . " ) AS SQK ". - " GROUP BY $fields"; - } - - if( $my['opt']['groupByPlatform'] ) { - - $exec[$exec['key4total']] = - (array)$this->db->fetchMapRowsIntoMap($sql, - 'platform_id','keyword_id'); - } else { - $exec[$exec['key4total']] = (array)$this->db->fetchRowsIntoMap($sql,'keyword_id'); - } - $exec['keywords'] = $keywordSet; - - return $exec; - } - - - /** - * - */ - function getStatusTotalsByKeywordForRender($id,$filters=null,$opt=null) { - $renderObj = $this->getStatusTotalsByItemForRender($id,'keyword',$filters,$opt); - return $renderObj; - } - - - - /** - * - * @internal revisions - * - * @since 1.9.4 - * 20120429 - franciscom - - */ - function getExecCountersByPlatformExecStatus($id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm,$union,$platformSet) = $this->helperBuildSQLExecCounters($id, $filters, $opt); - - $add2key = ''; - $addOnWhere = ''; - $addOnJoin = ''; - if( isset($opt['getOnlyActiveTCVersions']) ) - { - $add2key='Active'; - $addOnWhere = ' AND TCV.active = 1 '; - $addOnJoin = " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id "; - } - $sqlUnionAP = $union['exec' . $add2key]; - $sqlUnionBP = $union['not_run' . $add2key]; - - $sql = " /* {$debugMsg} UNION ALL CLAUSE => INCLUDE Duplicates */" . - " SELECT platform_id,status, count(0) AS exec_qty " . - " FROM ($sqlUnionAP UNION ALL $sqlUnionBP ) AS SQPL " . - " GROUP BY platform_id,status "; - - $exec['with_tester'] = (array)$this->db->fetchMapRowsIntoMap($sql,'platform_id','status'); - - $this->helperCompleteStatusDomain($exec,'platform_id'); - - // get total test cases by Platform id ON TEST PLAN (With & WITHOUT tester assignment) - $sql = "/* $debugMsg */ ". - " SELECT COUNT(0) AS qty, TPTCV.platform_id " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - $addOnJoin . - " WHERE TPTCV.testplan_id=" . $safe_id . $addOnWhere . - " GROUP BY platform_id"; - - $exec['total'] = (array)$this->db->fetchRowsIntoMap($sql,'platform_id'); - $exec['platforms'] = $platformSet; - - return $exec; - } - - - - /** - * - * @internal revisions - * - */ - function getStatusTotalsByPlatformForRender($id,$filters=null,$opt=null) { - $renderObj = $this->getStatusTotalsByItemForRender($id,'platform',$filters,$opt); - return $renderObj; - } - - - - /** - * - * If no build set provided, ONLY ACTIVE BUILDS will be considered - * - * - */ - function getExecCountersByPriorityExecStatus($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($safe_id, $filters, $opt); - - // Due to PLATFORMS we will have MULTIPLIER EFFECT - $fields = ""; - if( $my['opt']['groupByPlatform'] ) { - $fields = ",platform_id"; - } - - $sqlLEBP = $sqlStm['LEBP']; - - $sqlUnionA = "/* {$debugMsg} sqlUnionA - executions */" . - " SELECT (TPTCV.urgency * TCV.importance) AS urg_imp, " . - " TPTCV.tcversion_id, TPTCV.platform_id," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Get importance */ ". - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . - " JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - - " /* Get execution statuses that CAN BE WRITTEN TO DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBP.id " . - - // Without this we get duplicates ?? => 20121121 CONFIRMED at least with NOT RUN WE GET DUPS - $builds->joinAdd . - - " /* FILTER BUILD Set on target test plan */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddExec; - - - $sqlUnionB = "/* {$debugMsg} sqlUnionB - NOT RUN */" . - " SELECT (TPTCV.urgency * TCV.importance) AS urg_imp, " . - " TPTCV.tcversion_id, TPTCV.platform_id," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Get importance */ ". - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . intval($id) . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - $builds->joinAdd . - - " /* FILTER BUILDS in set on target test plan */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddNotRun . - - " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBP.id IS NULL"; - - - // ATTENTION: - // Each piece of UNION has 3 fields: urg_imp,status, TPTCV.tcversion_id - // There is no way we can get more that ONE record with same TUPLE - // on sqlUionA or sqlUnionB ?. - // - // If we have PLATFORM we are going to get a MULTIPLIER EFFECT - // - $sql = " /* {$debugMsg} UNION WITHOUT ALL => DISCARD Duplicates */" . - " SELECT count(0) as exec_qty, urg_imp,status $fields " . - " FROM ($sqlUnionA UNION $sqlUnionB ) AS SU " . - " GROUP BY urg_imp,status $fields"; - - if( $my['opt']['groupByPlatform'] ) { - $kol = array('platform_id','urg_imp','status'); - $rs = (array)$this->db->fetchRowsIntoMap3l($sql,$kol); - } else { - $rs = $this->db->get_recordset($sql); - } - - // Now we need to get priority LEVEL from (urgency * importance) - $out = array(); - $totals = array(); - $priorityCfg = config_get('urgencyImportance'); - if( !is_null($rs) ) { - $loop2do = count($rs); - if( $my['opt']['groupByPlatform'] ) { - // loop2do => platform Qty - foreach( $rs as $platID => $elem ) { - foreach( $elem as $urgImpVal => $statusUrgImp ) { - - if ($urgImpVal >= $priorityCfg->threshold['high']) { - $hitOn = HIGH; - } else if( $urgImpVal < $priorityCfg->threshold['low']) { - $hitOn = LOW; - } else { - $hitOn = MEDIUM; - } - - $llx = 0; - foreach( $statusUrgImp as $statusCode => $dummy ) { - - $rz = &$rs[$platID][$urgImpVal][$statusCode]; - $rz['priority_level'] = $hitOn; - - // to improve readability - if( !isset($out[$hitOn][$statusCode]) ) { - $out[$platID][$hitOn][$statusCode] = $rz; - } else { - $out[$platID][$hitOn][$statusCode]['exec_qty'] += - $rz['exec_qty']; - } - if( !isset($totals[$platID][$hitOn]) ) { - $totals[$platID][$hitOn] = - array('priority_level' => $hitOn, 'qty' => 0); - } - $totals[$platID][$hitOn]['qty'] += $rz['exec_qty']; - } - } - } - } else { - // The OLD WAY - if( !is_null($rs) ) { - for($jdx=0; $jdx < $loop2do; $jdx++) { - if ($rs[$jdx]['urg_imp'] >= $priorityCfg->threshold['high']) { - $rs[$jdx]['priority_level'] = HIGH; - $hitOn = HIGH; - } else if( $rs[$jdx]['urg_imp'] < $priorityCfg->threshold['low']) { - $rs[$jdx]['priority_level'] = LOW; - $hitOn = LOW; - } else { - $rs[$jdx]['priority_level'] = MEDIUM; - $hitOn = MEDIUM; - } - - // to improve readability - $status = $rs[$jdx]['status']; - if( !isset($out[$hitOn][$status]) ) { - $out[$hitOn][$status] = $rs[$jdx]; - } else { - $out[$hitOn][$status]['exec_qty'] += $rs[$jdx]['exec_qty']; - } - - if( !isset($totals[$hitOn]) ) { - $totals[$hitOn] = array('priority_level' => $hitOn, 'qty' => 0); - } - $totals[$hitOn]['qty'] += $rs[$jdx]['exec_qty']; - } - } - } - $exec['with_tester'] = $out; - $out = null; - - } - - // $this->helperCompleteStatusDomain($exec,'priority_level'); - if( $my['opt']['groupByPlatform'] ) { - $this->helperStatusDomainMatrix($exec,'platform_id','priority_level'); - } else { - $this->helperCompleteStatusDomain($exec,'priority_level'); - } - - $exec['total'] = $totals; - - $levels = config_get('urgency'); - foreach($levels['code_label'] as $lc => $lbl) { - $exec['priority_levels'][$lc] = lang_get($lbl); - } - - return $exec; - } - - - - /** - * - * @internal revisions - * - * @since 1.9.4 - * 20120429 - franciscom - - */ - function getStatusTotalsByPriorityForRender($id,$filters=null,$opt=null) { - $renderObj = $this->getStatusTotalsByItemForRender($id,'priority_level',$filters,$opt); - return $renderObj; - } - - - /** - * - * - */ - function getExecCountersByExecStatus($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm,$union,$platformSet) = $this->helperBuildSQLExecCounters($id, $filters, $opt); - - if(is_null($builds) || count($builds) <= 0) { - return null; // >>---> Bye! - } - - - // Latest Executions By Platform (LEBP) - $add2key = ''; - if( isset($opt['getOnlyActiveTCVersions']) ) { - $add2key='Active'; - } - - $sqlUnionAP = $union['exec' . $add2key]; //echo 'QD -
    ' . $sqlUnionAP . '
    '; - $sqlUnionBP = $union['not_run' . $add2key]; //echo 'QD -
    ' . $sqlUnionBP . '
    '; - - $sql = " /* {$debugMsg} UNION ALL CLAUSE => INCLUDE Duplicates */" . - " SELECT status, count(0) AS exec_qty " . - " FROM ($sqlUnionAP UNION ALL $sqlUnionBP ) AS SQPL " . - " GROUP BY status "; - - $dummy = (array)$this->db->fetchRowsIntoMap($sql,'status'); - - $statusCounters = array('total' => 0); - $codeVerbose = array_flip($this->map_tc_status); - foreach($dummy as $code => $elem) - { - - $statusCounters['total'] += $elem['exec_qty']; - $statusCounters[$codeVerbose[$code]] = $elem['exec_qty']; - } - - return $statusCounters; - } - - /** - * @internal revisions - * - * @since 1.9.6 - * 20130107 - franciscom - TICKET 5457: Incorrect data in "Report by tester per build" - */ - function getExecCountersByBuildUAExecStatus($id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($safe_id, $filters, $opt); - - // Last Executions By Build and Platform (LEBBP) - // Please remember that Platforms (when exists) has Multiplier effect on test cases - // - $sqlLEBBP = $sqlStm['LEBBP']; - - // 20120817 - franciscom - - // I'm not to happy with DISTINCT I've added to do this work. - // Do not understand why i get multiple identical records - // - // 20130107 - Think I've got the issue: - // was the missing clause - // " AND UA.feature_id = TPTCV.id AND UA.build_id = LEBBP.build_id " . - // - // 20140128 - do not understand why I've added DISTINT. - // without it I can add also get exec times - $sqlUnionBU = "/* {$debugMsg} */" . - " SELECT /* DISTINCT */ UA.user_id, UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " . - " COALESCE(E.execution_duration,0) AS execution_duration " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . - - " /* LEFT OUTER in order to get NOT RUN */ " . - " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.testplan_id = " . $safe_id . - - " /* Without this piece we are including results for features without tester */ ". - " AND UA.feature_id = TPTCV.id AND UA.build_id = LEBBP.build_id " . - - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.build_id = UA.build_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.id = LEBBP.id " . // TICKET 5192 - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND UA.build_id IN ({$builds->inClause}) " ; - - $sql = " /* {$debugMsg} */" . - " SELECT user_id, build_id,status, count(0) AS exec_qty, SUM(execution_duration) AS total_time" . - " FROM ($sqlUnionBU) AS SQBU " . - " GROUP BY user_id,build_id,status "; - - $keyColumns = array('build_id','user_id','status'); - $exec['with_tester'] = (array)$this->db->fetchRowsIntoMap3l($sql,$keyColumns); - - $totals = array(); - foreach($exec as &$topLevelElem) - { - $topLevelItemSet = array_keys($topLevelElem); - foreach($topLevelItemSet as $topLevelItemID) - { - $itemSet = array_keys($topLevelElem[$topLevelItemID]); - foreach($itemSet as $itemID) - { - $elem = &$topLevelElem[$topLevelItemID]; - foreach($this->statusCode as $verbose => $code) - { - if(!isset($elem[$itemID][$code])) - { - $elem[$itemID][$code] = array('build_id' => $topLevelItemID, 'user_id' => $itemID, - 'status' => $code, 'exec_qty' => 0, 'total_time' => 0); - } - - if( !isset($totals[$topLevelItemID][$itemID]) ) - { - $totals[$topLevelItemID][$itemID] = array('build_id' => $topLevelItemID, - 'user_id' => $itemID, 'qty' => 0,'total_time' => 0); - } - $totals[$topLevelItemID][$itemID]['qty'] += $elem[$itemID][$code]['exec_qty']; - $totals[$topLevelItemID][$itemID]['total_time'] += $elem[$itemID][$code]['total_time']; - } - } - } - } - $exec['total'] = $totals; - - return $exec; - } - - - - /** - * @see resultsByTesterPerBuild.php - * @internal revisions - * - * @since 1.9.6 - */ - function getStatusTotalsByBuildUAForRender($id,$opt=null) - { - $my = array('opt' => array('processClosedBuilds' => true)); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $renderObj = null; - $code_verbose = $this->getStatusForReports(); - $labels = $this->resultsCfg['status_label']; - $metrics = $this->getExecCountersByBuildUAExecStatus($id,null,$my['opt']); - - if( !is_null($metrics) ) - { - $renderObj = new stdClass(); - $topItemSet = array_keys($metrics['with_tester']); - $renderObj->info = array(); - $out = &$renderObj->info; - - $topElem = &$metrics['with_tester']; - foreach($topItemSet as $topItemID) - { - $itemSet = array_keys($topElem[$topItemID]); - foreach($itemSet as $itemID) - { - $elem = &$topElem[$topItemID][$itemID]; - - $out[$topItemID][$itemID]['total'] = $metrics['total'][$topItemID][$itemID]['qty']; - $progress = 0; - foreach($code_verbose as $statusCode => $statusVerbose) - { - $out[$topItemID][$itemID][$statusVerbose]['count'] = $elem[$statusCode]['exec_qty']; - $pc = ($elem[$statusCode]['exec_qty'] / $out[$topItemID][$itemID]['total']) * 100; - $out[$topItemID][$itemID][$statusVerbose]['percentage'] = number_format($pc, 1); - - if($statusVerbose != 'not_run') - { - $progress += $elem[$statusCode]['exec_qty']; - } - } - $progress = ($progress / $out[$topItemID][$itemID]['total']) * 100; - $out[$topItemID][$itemID]['progress'] = number_format($progress,1); - $out[$topItemID][$itemID]['total_time'] = - number_format($metrics['total'][$topItemID][$itemID]['total_time'],2,'.',''); - } - } - } - return $renderObj; - } - - - /** - * - * @used-by getStatusTotalsByKeywordForRender() - * - */ - function getStatusTotalsByItemForRender($id,$itemType,$filters=null,$opt=null) { - $renderObj = null; - $code_verbose = $this->getStatusForReports(); - $labels = $this->resultsCfg['status_label']; - - - $returnArray = false; - $byPlatform = false; - - switch($itemType) { - case 'keyword': - $metrics = $this->getExecCountersByKeywordExecStatus($id,$filters,$opt); - $setKey = 'keywords'; - $byPlatform = isset($opt['groupByPlatform']) && - $opt['groupByPlatform']; - break; - - case 'platform': - $myOpt = array_merge(array('getPlatformSet' => true),(array)$opt); - $metrics = $this->getExecCountersByPlatformExecStatus($id,$filters,$myOpt); - $setKey = 'platforms'; - break; - - case 'priority_level': - $metrics = $this->getExecCountersByPriorityExecStatus($id,$filters,$opt); - $setKey = 'priority_levels'; - $byPlatform = isset($opt['groupByPlatform']) && - $opt['groupByPlatform']; - break; - - case 'tsuite': - $metrics = $this->getExecCountersByTestSuiteExecStatus($id,$filters,$opt); - $setKey = 'tsuites'; - $returnArray = true; - $byPlatform = isset($opt['groupByPlatform']) && - $opt['groupByPlatform']; - break; - } - - if( !is_null($metrics) && !is_null($metrics[$setKey]) > 0) { - $renderObj = new stdClass(); - $renderObj->info = array(); - - if( $byPlatform == false ) { - $itemList = array_keys($metrics[$setKey]); - foreach($itemList as $itemID) { - if( isset($metrics['with_tester'][$itemID]) ) { - $totalRun = 0; - $renderObj->info[$itemID]['type'] = $itemType; - $renderObj->info[$itemID]['name'] = $metrics[$setKey][$itemID]; - $renderObj->info[$itemID]['total_tc'] = $metrics['total'][$itemID]['qty']; - $renderObj->info[$itemID]['details'] = array(); - - $rf = &$renderObj->info[$itemID]['details']; - $doPerc = ($renderObj->info[$itemID]['total_tc'] > 0); - foreach($code_verbose as $statusCode => $statusVerbose) { - $rf[$statusVerbose] = array('qty' => 0, 'percentage' => 0); - $rf[$statusVerbose]['qty'] = $metrics['with_tester'][$itemID][$statusCode]['exec_qty']; - - if($doPerc) { - $rf[$statusVerbose]['percentage'] = - number_format(100 * ($rf[$statusVerbose]['qty'] / - $renderObj->info[$itemID]['total_tc']),1); - } - $totalRun += - ($statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']); - } - if($doPerc) { - $renderObj->info[$itemID]['percentage_completed'] = number_format(100 * - ($totalRun/$renderObj->info[$itemID]['total_tc']),1); - } - } - } - } else { - // mainKey is Platform ID - $platList = array_keys($metrics['with_tester']); - $mex = &$metrics['with_tester']; - foreach($platList as $platID) { - $itemList = array_keys($mex[$platID]); - foreach($itemList as $itemID) { - if( isset($mex[$platID]) ) { - $totalRun = 0; - $renderObj->info[$platID][$itemID]['type'] = $itemType; - $renderObj->info[$platID][$itemID]['name'] = $metrics[$setKey][$itemID]; - $renderObj->info[$platID][$itemID]['total_tc'] = $metrics['total'][$platID][$itemID]['qty']; - $renderObj->info[$platID][$itemID]['details'] = array(); - - $rf = &$renderObj->info[$platID][$itemID]['details']; - $doPerc = ($renderObj->info[$platID][$itemID]['total_tc'] > 0); - foreach($code_verbose as $statusCode => $statusVerbose) { - $rf[$statusVerbose] = array('qty' => 0, 'percentage' => 0); - $rf[$statusVerbose]['qty'] = $mex[$platID][$itemID][$statusCode]['exec_qty']; - - if($doPerc) { - $rf[$statusVerbose]['percentage'] = - number_format(100 * ($rf[$statusVerbose]['qty'] / - $renderObj->info[$platID][$itemID]['total_tc']),1); - } - $totalRun += - ($statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']); - } - if($doPerc) { - $renderObj->info[$platID][$itemID]['percentage_completed'] = number_format(100 * - ($totalRun/$renderObj->info[$platID][$itemID]['total_tc']),1); - } - } - } - } - } - - // Verbosity! - foreach($code_verbose as $status_verbose) { - $l10n = isset($labels[$status_verbose]) ? lang_get($labels[$status_verbose]) : lang_get($status_verbose); - - $renderObj->colDefinition[$status_verbose]['qty'] = $l10n; - $renderObj->colDefinition[$status_verbose]['percentage'] = '[%]'; - } - } - - // How to return things - if($returnArray) { - return array($renderObj,$metrics['staircase']); - } else { - unset($metrics); - return $renderObj; - } - } - - - /** - * - * @internal revisions - * - * @since 1.9.4 - * 20120429 - franciscom - - */ - function getStatusTotalsByTestSuiteForRender($id,$filters=null,$opt=null) - { - list($renderObj,$staircase) = $this->getStatusTotalsByItemForRender($id,'tsuite',$filters,$opt); - unset($staircase); - return $renderObj; - } - - /** - * - * @internal revisions - * - * @since 1.9.4 - */ - function getStatusTotalsByTopLevelTestSuiteForRender($id,$filters=null,$opt=null) - { - - list($rx,$staircase) = $this->getStatusTotalsByItemForRender($id,'tsuite',$filters,$opt); - - // ??? $key2loop = array_keys($rx->info); - $template = array('type' => 'tsuite', 'name' => '','total_tc' => 0, - 'percentage_completed' => 0, 'details' => array()); - - foreach($this->statusCode as $verbose => $code) { - $template['details'][$verbose] = array('qty' => 0, 'percentage' => 0); - } - - $renderObj = new stdClass(); - $renderObj->colDefinition = $rx->colDefinition; - - // collect qty - $topNameCache = null; - $execQty = null; - - $key2loop = array_keys($staircase); - $wp = isset($opt['groupByPlatform']) && $opt['groupByPlatform']; - - if( $wp ) { - $plat2loop = array_keys($rx->info); - foreach($key2loop as $tsuite_id) { - // (count() == 1) => is a TOP LEVEL SUITE, - // only element contains Root node, is useless for this algorithm - // - - if( count($staircase[$tsuite_id]) > 1) { - // element at position 1 is a TOP LEVEL SUITE - //$topSuiteID = &$staircase[$tsuite_id][1]; - $topSuiteID = $staircase[$tsuite_id][1]; - $initName = false; - } else { - $topSuiteID = $tsuite_id; - $initName = true; - } - - // Over Platform - foreach( $plat2loop as $platId ) { - if( !isset($renderObj->info[$platId][$topSuiteID]) ) { - $renderObj->info[$platId][$topSuiteID] = $template; - $execQty[$platId][$topSuiteID] = 0; - $initName = true; - } - - if( $initName ) { - $dummy = $this->tree_manager->get_node_hierarchy_info($topSuiteID); - $renderObj->info[$platId][$topSuiteID]['name'] = - $dummy['name']; - unset($dummy); - } - - // Loop to get executions counters - $r2d2 = &$rx->info[$platId][$tsuite_id]; - if( null !== $r2d2 ) { - foreach($r2d2['details'] as $code => &$elem) { - $renderObj->info[$platId][$topSuiteID]['details'][$code] - ['qty'] += $elem['qty']; - $renderObj->info[$platId][$topSuiteID]['total_tc'] += - $elem['qty']; - - if( $code != 'not_run' ) { - $execQty[$platId][$topSuiteID] += $elem['qty']; - } - } - } - } - } - - // Last step: get percentages - foreach($renderObj->info as $platID => &$tsuiteMetrics) { - foreach($tsuiteMetrics as $tsuite_id => &$elem) { - if( $execQty[$platID][$tsuite_id] > 0 ) { - $elem['percentage_completed'] = number_format( 100 * - ($execQty[$platID][$tsuite_id] / $elem['total_tc']),1); - } - if( $elem['total_tc'] > 0 ) { - foreach($elem['details'] as $code => &$yumyum) { - $yumyum['percentage'] = number_format( 100 * ($yumyum['qty'] / $elem['total_tc']),1); - } - } - } - } - - } else { - - // OLD WAY - foreach($key2loop as $tsuite_id) { - // (count() == 1) => is a TOP LEVEL SUITE, - // only element contains Root node, is useless for this algorithm - // - - if( count($staircase[$tsuite_id]) > 1) { - // element at position 1 is a TOP LEVEL SUITE - $topSuiteID = &$staircase[$tsuite_id][1]; - $initName = false; - } else { - $topSuiteID = $tsuite_id; - $initName = true; - } - - if( !isset($renderObj->info[$topSuiteID]) ) { - $renderObj->info[$topSuiteID] = $template; - $execQty[$topSuiteID] = 0; - $initName = true; - } - - if( $initName ) { - $dummy = $this->tree_manager->get_node_hierarchy_info($topSuiteID); - $renderObj->info[$topSuiteID]['name'] = $dummy['name']; - unset($dummy); - } - - - // Loop to get executions counters - foreach($rx->info[$tsuite_id]['details'] as $code => &$elem) { - $renderObj->info[$topSuiteID]['details'][$code]['qty'] += $elem['qty']; - $renderObj->info[$topSuiteID]['total_tc'] += $elem['qty']; - - if( $code != 'not_run' ) { - $execQty[$topSuiteID] += $elem['qty']; - } - } - } - - // Last step: get percentages - foreach($renderObj->info as $tsuite_id => &$elem) { - if( $execQty[$tsuite_id] > 0 ) { - $elem['percentage_completed'] = number_format( 100 * ($execQty[$tsuite_id] / $elem['total_tc']),1); - } - - if( $elem['total_tc'] > 0 ) { - foreach($elem['details'] as $code => &$yumyum) { - $yumyum['percentage'] = number_format( 100 * ($yumyum['qty'] / $elem['total_tc']),1); - } - } - } - } - - - unset($topNameCache); - unset($rx); - unset($staircase); - unset($template); - unset($key2loop); - unset($execQty); - - return $renderObj; - } - - /** - * - * - * - * - */ - function getExecCountersByTestSuiteExecStatus($id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safe_id = intval($id); - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - - $fields = ""; - if( $my['opt']['groupByPlatform'] ) { - $fields = ",platform_id"; - } - - - // Latest Execution Ignoring Build - $sqlLEBP = $sqlStm['LEBP']; - - $sqlUnionAT = "/* {$debugMsg} sqlUnionAT - executions */" . - " SELECT NHTC.parent_id AS tsuite_id,TPTCV.platform_id," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . - " JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBP.id " . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddExec; - - - - $sqlUnionBT = "/* {$debugMsg} sqlUnionBK - NOT RUN */" . - " SELECT NHTC.parent_id AS tsuite_id,TPTCV.platform_id," . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - - $builds->joinAdd . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* FILTER BUILDS in set on target test plan (not alway can be applied) */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddNotRun . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBP.id IS NULL"; - - - $sql = " /* {$debugMsg} UNION ALL DO NOT DISCARD Duplicates */" . - " SELECT count(0) AS exec_qty, tsuite_id, status $fields" . - " FROM ($sqlUnionAT UNION ALL $sqlUnionBT ) AS SQT " . - " GROUP BY tsuite_id ,status $fields"; - - if( $my['opt']['groupByPlatform'] ) { - $kol = array('platform_id','tsuite_id','status'); - $exec['with_tester'] = - (array)$this->db->fetchRowsIntoMap3l($sql,$kol); - $this->helperStatusDomainMatrix($exec,'platform_id','tsuite_id'); - - } else { - $exec['with_tester'] = - (array)$this->db->fetchMapRowsIntoMap($sql,'tsuite_id','status'); - - // now we need to complete status domain - $this->helperCompleteStatusDomain($exec,'tsuite_id'); - } - - - // Build item set - $exec['tsuites_full'] = $this->get_testsuites($safe_id); - $loop2do = count($exec['tsuites_full']); - for($idx=0; $idx < $loop2do; $idx++) { - $keySet[] = $exec['tsuites_full'][$idx]['id']; - - } - $dx = $this->tree_manager->get_full_path_verbose($keySet,array('output_format' => 'stairway2heaven')); - for($idx=0; $idx < $loop2do; $idx++) { - $exec['tsuites'][$exec['tsuites_full'][$idx]['id']] = $dx['flat'][$exec['tsuites_full'][$idx]['id']]; - } - $exec['staircase'] = $dx['staircase']; - - unset($dx); - unset($keySet); - return $exec; - } - - - - - /** - * - * - * - * - */ - function getExecStatusMatrix($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array(); - $my['opt'] = array('getExecutionNotes' => false, - 'getTester' => false, - 'getUserAssignment' => false, - 'output' => null, - 'getExecutionTimestamp' => false, - 'getExecutionDuration' => false); - - $my['opt'] = array_merge($my['opt'], (array)$opt); - $safe_id = intval($id); - list($my,$builds,$sqlStm,$union) = $this->helperBuildSQLTestSuiteExecCounters($id, $filters, $my['opt']); - - $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */ " . - " {$union['exec']} UNION ALL {$union['not_run']} "; - - - $keyColumns = array('tsuite_id','tcase_id','platform_id','build_id'); - $cumulative = ($my['opt']['output'] == 'cumulative'); - $dummy = (array)$this->db->fetchRowsIntoMap4l($sql,$keyColumns,$cumulative); - - unset($sqlStm); - unset($union); - unset($my); - unset($builds); - - // now is time do some decoding - // Key is a tuple (PARENT tsuite_id, test case id, platform id) - // - $item2loop = array_keys($dummy); - $stairway2heaven = null; - $pathway = null; - $latestExec = null; - $priorityCfg = config_get('urgencyImportance'); - - foreach ($item2loop as $item_id) { - $stairway2heaven = $this->tree_manager->get_path($item_id,null,'name'); - $pathway[$item_id] = implode("/",$stairway2heaven); - unset($stairway2heaven); - - // go inside test case - $tcase2loop = array_keys($dummy[$item_id]); - foreach($tcase2loop as $tcase_id) { - $platform2loop = array_keys($dummy[$item_id][$tcase_id]); - foreach($platform2loop as $platform_id) { - $latestExec[$platform_id][$tcase_id] = - array('id' => -1, 'status' => $this->notRunStatusCode); - $rf = &$dummy[$item_id][$tcase_id][$platform_id]; - foreach($rf as $build_id => &$exec) { - $exec['suiteName'] = $pathway[$item_id]; - if($exec['executions_id'] > $latestExec[$platform_id][$tcase_id]['id']) { - $latestExec[$platform_id][$tcase_id]['id'] = $exec['executions_id']; - $latestExec[$platform_id][$tcase_id]['status'] = $exec['status']; - $latestExec[$platform_id][$tcase_id]['build_id'] = $exec['build_id']; - $latestExec[$platform_id][$tcase_id]['execution_notes'] = $exec['execution_notes']; - } - - // --------------------------------------------------- - // Now we need to get priority LEVEL from - // (urgency * impact) - // we do not use a function to improve performance - if ($exec['urg_imp'] >= $priorityCfg->threshold['high']) { - $exec['priority_level'] = HIGH; - } else if( $exec['urg_imp'] < $priorityCfg->threshold['low']) { - $exec['priority_level'] = LOW; - } else { - $exec['priority_level'] = MEDIUM; - } - // ------------------------------------------------------ - } // $rf - } // $platform2loop - } // $tcase2loop - - unset($tcase2loop); - unset($platform2loop); - } // - - unset($pathway); - return array('metrics' => $dummy, 'latestExec' => $latestExec); - } - - - - /** - * - * @used-by - * getExecutionsByStatus() - * getNotRunWithTesterAssigned() - * getNotRunWOTesterAssigned() - * getExecCountersByBuildExecStatus() - * getExecCountersByKeywordExecStatus() - * getExecCountersByPriorityExecStatus() - * getExecCountersByBuildUAExecStatus() - * getExecCountersByTestSuiteExecStatus() - * - * - * - */ - function helperGetExecCounters($id, $filters, $opt) { - $sql = array(); - $my = array(); - $my['opt'] = array('getOnlyAssigned' => false, - 'tprojectID' => 0, - 'getUserAssignment' => false, - 'getPlatformSet' => false, - 'processClosedBuilds' => true, - 'groupByPlatform' => false); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - $my['filters'] = array('buildSet' => null); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - // Build Info - $bi = new stdClass(); - $bi->idSet = $my['filters']['buildSet']; - $bi->inClause = ''; - $bi->infoSet = null; - - if (is_null($bi->idSet)) { - $openStatus = $my['opt']['processClosedBuilds'] ? null : 1; - - $bi->infoSet = $this->get_builds($id,testplan::ACTIVE_BUILDS, - $openStatus); - if (!is_null($bi->infoSet)) { - $bi->idSet = array_keys($bi->infoSet); - } - } - - // ========================================================= - // Emergency Exit !!! - if ( is_null($bi->idSet) ) { - throw new Exception(__METHOD__ . " - Can not work with empty build set"); - } - // ========================================================= - - - // Things seems to be OK - $bi->inClause = implode(",",$bi->idSet); - if( $my['opt']['getOnlyAssigned'] ) { - $sql['getAssignedFeatures'] = " /* Get feature id with Tester Assignment */ " . - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id IN ({$bi->inClause}) " . - " AND UA.type = {$this->execTaskCode} "; - $bi->source = "UA"; - $bi->joinAdd = " AND E.build_id = UA.build_id "; - $bi->whereAddExec = " AND {$bi->source}.build_id IN ({$bi->inClause}) "; - $bi->whereAddNotRun = $bi->whereAddExec; - } - else - { - $sql['getAssignedFeatures'] = ''; - $bi->source = "E"; - - // TICKET 5353 - // $bi->joinAdd = ""; - $bi->joinAdd = " AND E.build_id IN ({$bi->inClause}) "; - - // Why ? - // If I'm consider test cases WITH and WITHOUT Tester assignment, - // I will have no place to go to filter for builds. - // Well at least when trying to get EXECUTED test case, I will be able - // to apply filter on Executions table. - // Why then I choose to have this blank ANYWAY ? - // Because I will get filtering on Build set through - // the Latest Execution queries (see below sql['LE'], sql['LEBP']. - // - // Anyway we need to backup all these thoughts with a long, long test run - // on test link itself. - $bi->whereAddExec = " AND {$bi->source}.build_id IN ({$bi->inClause}) "; - $bi->whereAddNotRun = ""; - } - - $sql['getUserAssignment']['not_run'] = ""; - $sql['getUserAssignment']['exec'] = ""; - - if( $my['opt']['getUserAssignment'] ) - { - $sql['getUserAssignment']['not_run'] = - " LEFT JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = BU.id " . - " AND UA.type = {$this->execTaskCode} "; - - $sql['getUserAssignment']['exec'] = - " LEFT JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = E.build_id " . - " AND UA.type = {$this->execTaskCode} "; - } - - - // Latest Execution IGNORING Build and Platform - $sql['LE'] = " SELECT EE.tcversion_id,EE.testplan_id,MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id=" . intval($id) . - " AND EE.build_id IN ({$bi->inClause}) " . - " GROUP BY EE.tcversion_id,EE.testplan_id "; - - - // Latest Execution By Platform (ignore build) - $sql['LEBP'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id=" . intval($id) . - " AND EE.build_id IN ({$bi->inClause}) " . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id "; - - // Last Executions By Build (LEBB) (ignore platform) - $sql['LEBB'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.build_id,MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id=" . intval($id) . - " AND EE.build_id IN ({$bi->inClause}) " . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.build_id "; - - - // Last Executions By Build and Platform (LEBBP) - $sql['LEBBP'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id=" . intval($id) . - " AND EE.build_id IN ({$bi->inClause}) " . - " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; - - - return array($my,$bi,$sql); - } - - - - /** - * - * - * - * - */ - function helperCompleteStatusDomain(&$out,$key) { - $totalByItemID = array(); - - // refence is critic - foreach($out as &$elem) { - $itemSet = array_keys($elem); - foreach($itemSet as $itemID) { - $totalByItemID[$itemID]['qty'] = 0; - foreach($this->statusCode as $verbose => $code) { - if(!isset($elem[$itemID][$code])) { - $elem[$itemID][$code] = array($key => $itemID,'status' => $code, 'exec_qty' => 0); - } - $totalByItemID[$itemID]['qty'] += $elem[$itemID][$code]['exec_qty']; - } - } - } - $out['total'] = $totalByItemID; - } - - - - /** - * - * - */ - function helperBuildSQLExecCounters($id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - try - { - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - } - catch(Exception $e) - { - return null; - } - - - $safe_id = intval($id); - $platformSet = null; - if( $my['opt']['getPlatformSet'] ) { - $getOpt = array('outputFormat' => 'mapAccessByID', 'outputDetails' => 'name', 'addIfNull' => true); - $platformSet = $this->getPlatforms($safe_id,$getOpt); - } - - // Latest Executions By Platform (LEBP) - $sqlLEBP = $sqlStm['LEBP']; - - - // 20121121 - franciscom - // Need to understand if this sentence is right: - // - // GO FOR Absolute LATEST exec ID IGNORE BUILD - // Is this right for each use of this method ? - // - $dummy['exec'] = "/* {$debugMsg} sqlUnion - executions */" . - " SELECT TPTCV.tcversion_id,TPTCV.platform_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . - " JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBP.id "; - - - $union['exec'] = $dummy['exec'] . " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddExec; - - $union['execActive'] = $dummy['exec'] . - " /* Used to filter ON ACTIVE TCVersion */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddExec . - " AND TCV.active = 1 "; - - - // 20121121 - An issue was reported in this scenario: - // Test Plan with Platforms (ONE) - // Two Build: - // B1 with TC1 passed, TC2 failed, TC3 not run - BUT B1 INACTIVE - // B3 ALL TEST CASES NOT RUN - // - // we got WRONG figures if build set is NOT USING when trying to access Executions TABLE - // - $dummy['not_run'] = "/* {$debugMsg} sqlUnion - NOT RUN */" . - " SELECT TPTCV.tcversion_id,TPTCV.platform_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . - " ON LEBP.testplan_id = TPTCV.testplan_id " . - " AND LEBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBP.platform_id = TPTCV.platform_id " . - " AND LEBP.testplan_id = " . $safe_id . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - $builds->joinAdd; - - - $union['not_run'] = $dummy['not_run'] . - " /* FILTER BUILDS in set on target test plan (not always can be applied) */ " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddNotRun . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBP.id IS NULL"; - - - $union['not_runActive'] = $dummy['not_run'] . - " /* Used to filter ON ACTIVE TCVersion */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddNotRun . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBP.id IS NULL" . - " AND TCV.active = 1 "; - - - //echo 'QD -
    ' . $sqlUnionBP . '
    '; - return array($my,$builds,$sqlStm,$union,$platformSet); - } - - - /** - * - * - * - * @internal revision - * @since 1.9.8 - * 20130713 - franciscom - - * when getting info for executed test cases, RIGHT version number for execution - * is on EXECUTIONS TABLE not on testplan_tcversions TABLE. - * - * REMEMBER that when we update TCVERSION for executed Test Cases, we HAVE TO UPDATE - * testplan_tcversions table. - * - * We also need to use E.tcversion_id and NOT TPTCV.tcversion_id. - * - */ - function helperBuildSQLTestSuiteExecCounters($id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('getExecutionNotes' => false, - 'getTester' => false, - 'getUserAssignment' => false, - 'getExecutionTimestamp' => false, - 'getExecutionDuration' => false); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - - $safe_id = intval($id); - - - // Additional Execution fields - $moreExecFields = ""; - if ($my['opt']['getExecutionNotes']) { - $moreExecFields .= "COALESCE(E.notes,'') AS execution_notes,"; - } - - if ($my['opt']['getTester']) { - $moreExecFields .= "E.tester_id,"; - } - - if ($my['opt']['getExecutionTimestamp']) { - $moreExecFields .= "E.execution_ts,"; - } - - if ($my['opt']['getExecutionDuration']) { - $moreExecFields .= "E.execution_duration,"; - } - - if ($my['opt']['getUserAssignment']) { - $moreExecFields .= "UA.user_id,"; - } - - // Latest Executions By Build Platform (LEBBP) - $sqlLEBBP = $sqlStm['LEBBP']; - - $union['exec'] = "/* {$debugMsg} sqlUnion Test suites - executions */" . - " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . - " TPTCV.tcversion_id,TPTCV.platform_id," . - " E.build_id,E.tcversion_number AS version,TCV.tc_external_id AS external_id, " . - " E.id AS executions_id, E.status AS status, " . - $moreExecFields . - " E.execution_type AS exec_type," . - - " (TPTCV.urgency * TCV.importance) AS urg_imp " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.build_id = LEBBP.build_id " . - - $sqlStm['getUserAssignment']['exec'] . - - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - // " ON TCV.id = TPTCV.tcversion_id " . - " ON TCV.id = E.tcversion_id " . - - " WHERE TPTCV.testplan_id=" . $safe_id . - $builds->whereAddExec; - - $union['not_run'] = - "/* {$debugMsg} sqlUnion Test suites - not run */" . - " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . - " TPTCV.tcversion_id, TPTCV.platform_id," . - " BU.id AS build_id,TCV.version,TCV.tc_external_id AS external_id, " . - " COALESCE(E.id,-1) AS executions_id, " . - " COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " . - $moreExecFields . - " TCV.execution_type AS exec_type," . - " (TPTCV.urgency * TCV.importance) AS urg_imp " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* Needed to be able to put a value on build_id on output set */ " . - " JOIN {$this->tables['builds']} BU " . - " ON BU.id IN ({$builds->inClause}) " . - - $sqlStm['getUserAssignment']['not_run'] . - - " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . - " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.build_id = BU.id " . - " AND LEBBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.build_id = LEBBP.build_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND BU.id IN ({$builds->inClause}) " . - $builds->whereAddNotRun . - - " /* Get REALLY NOT RUN => BOTH LEBBP.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEBBP.id IS NULL"; - - //echo 'QD -
    ' . $union['not_run'] . '
    '; - return array($my,$builds,$sqlStm,$union); - } - - - /** - * get executions (Not Run is not included) - * - * @param int $id test plan id - * @param char $status status code (one char) - * @param mixed $filters - * keys: 'buildSet' - * - * @param mixed opt - * keys: 'output' elem domain 'map','array' - * - */ - function getExecutionsByStatus($id,$status,$filters=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - - // particular options - $options = array('output' => 'map', - 'add2fields' => ''); - $my['opt'] = array_merge($options,$my['opt']); - $safe_id = intval($id); - - $fullEID = $this->helperConcatTCasePrefix($safe_id); - - $addFields = ''; - if ( '' != $my['opt']['add2fields']) { - $addFields = ',' . $my['opt']['add2fields']; - } - - $sqlLEBBP = $sqlStm['LEBBP']; - $sql = "/* {$debugMsg} executions with status WRITTEN on DB => not run is not present */" . - " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . - " TPTCV.tcversion_id,TPTCV.platform_id," . - " E.tcversion_number, E.build_id,E.id AS executions_id, E.status AS status, " . - " E.notes AS execution_notes, E.tester_id,E.execution_ts," . - " TCV.version,TCV.tc_external_id AS external_id, " . - " $fullEID AS full_external_id," . - " (TPTCV.urgency * TCV.importance) AS urg_imp " . - $addFields . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . - " JOIN ({$sqlLEBBP}) AS LEBBP " . - " ON LEBBP.testplan_id = TPTCV.testplan_id " . - " AND LEBBP.platform_id = TPTCV.platform_id " . - " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . - " AND LEBBP.testplan_id = " . $safe_id . - - $sqlStm['getAssignedFeatures'] . - - " /* Get execution status WRITTEN on DB */ " . - " JOIN {$this->tables['executions']} E " . - " ON E.id = LEBBP.id " . - " AND E.build_id = LEBBP.build_id " . - $builds->joinAdd . - - - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + ) TT + GROUP BY build_id "; + + $exec['total'] = (array) $this->db->fetchRowsIntoMap($sql, + 'build_id'); + } + + $exec['active_builds'] = $builds->infoSet; + + return $exec; + } + + /** + */ + public function getOverallBuildStatusForRender($id, + $totalKey = 'total_assigned') + { + $renderObj = null; + $code_verbose = $this->getStatusForReports(); + $labels = $this->resultsCfg['status_label']; + + $metrics = $this->getExecCountersByBuildExecStatus($id); + if (! is_null($metrics)) { + $renderObj = new stdClass(); + + // Creating item list this way will generate a row also for + // ACTIVE BUILDS were ALL TEST CASES HAVE NO TESTER ASSIGNMENT + // $buildList = array_keys($metrics['active_builds']); + + // Creating item list this way will generate a row ONLY FOR + // ACTIVE BUILDS were TEST CASES HAVE TESTER ASSIGNMENT + $buildList = array_keys($metrics['with_tester']); + $renderObj->info = array(); + foreach ($buildList as $buildID) { + $totalRun = 0; + $renderObj->info[$buildID]['build_name'] = $metrics['active_builds'][$buildID]['name']; + $renderObj->info[$buildID][$totalKey] = $metrics['total'][$buildID]['qty']; + + $renderObj->info[$buildID]['details'] = array(); + + $rf = &$renderObj->info[$buildID]['details']; + foreach ($code_verbose as $statusCode => $statusVerbose) { + $rf[$statusVerbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + $rf[$statusVerbose]['qty'] = $metrics['with_tester'][$buildID][$statusCode]['exec_qty']; + + if ($renderObj->info[$buildID][$totalKey] > 0) { + $rf[$statusVerbose]['percentage'] = number_format( + 100 * + ($rf[$statusVerbose]['qty'] / + $renderObj->info[$buildID][$totalKey]), 1); + } + + $totalRun += $statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']; + } + $renderObj->info[$buildID]['percentage_completed'] = number_format( + 100 * ($totalRun / $renderObj->info[$buildID][$totalKey]), 1); + } + + foreach ($code_verbose as $human) { + $l10n = isset($labels[$human]) ? lang_get($labels[$human]) : lang_get( + $human); + $renderObj->colDefinition[$human]['qty'] = $l10n; + $renderObj->colDefinition[$human]['percentage'] = '[%]'; + } + } + return $renderObj; + } + + /** + * Important Notice about algorithm + * We are trying to provide WHOLE Test Plan metrics, + * then BUILD INFO will not be IMPORTANT. + * + * In addition, Keywords are attributes used on + * Test Case specification, for this reason, + * our choice is that platforms will be ignored for this metrics. + * + * Example: Platform X and Y + * Test Case: TC1 with one Keyword K1 + * + * we can develop this data in this way + * + * Test Case - Platform - Keyword - Build - Exec. ID - Exec. Status + * TC1 X K1 1.0 11 FAILED + * TC1 Y K1 1.0 13 BLOCKED + * TC1 X K1 2.0 16 PASSED + * TC1 Y K1 2.0 15 BLOCKED + * + * + * We have two choices: + * OPT 1. Platform multiplication + * + * consider (as was done on Builds Overall Status) + * TC1 as two test cases. + * If we proceed this way, may be user will be confused, because + * when searching test case spec according keyword, we are going to + * find ONLY ONE. + * + * OPT 2. IGNORE PLAFORMS + * Consider only LATEST execution, means we are going + * to count ONE test case no matter how many Platforms + * exists on test plan. + * + * Our design choice is on OPT 1 + * + * @used-by + * + * 20190711 - things are changing need to relaborate + * + */ + private function getExecCountersByKeywordExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($safe_id, + $filters, $opt); + + // may be too brute force but ... + if (($tprojectID = $my['opt']['tprojectID']) == 0) { + $info = $this->tree_manager->get_node_hierarchy_info($safe_id); + $tprojectID = $info['parent_id']; + } + $tproject_mgr = new testproject($this->db); + $keywordSet = $tproject_mgr->get_keywords_map($tprojectID); + $tproject_mgr = null; + + // This subquery is BETTER than a VIEW, need to understand why + // Latest Execution Ignoring Build => Cross Build + $sqlLEBP = $sqlStm['LEBP']; + + // Development Important Notice + // DISTINCT is needed when you what to get data ONLY FOR test cases with assigned testers, + // because we are (to make things worst) working on a BUILD SET, not on a SINGLE build, + // Use of IN clause, will have a NOT wanted multiplier effect on this query. + // + // This do not happens with other queries on other metric attributes, + // be careful before changing other queries. + // + $sqlUnionAK = "/* {$debugMsg} sqlUnionAK - executions */" . + " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id, TPTCV.platform_id,KW.keyword," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . + " JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBP.id " . + " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['testcase_keywords']} TCK " . + " ON TCK.testcase_id = NHTCV.parent_id " . + " JOIN {$this->tables['keywords']} KW " . + " ON KW.id = TCK.keyword_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . $builds->whereAddExec; + + // See Note about DISTINCT, on sqlUnionAK + $sqlUnionBK = "/* {$debugMsg} sqlUnionBK - NOT RUN */" . + " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id, TPTCV.platform_id,KW.keyword," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . $builds->joinAdd . + " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['testcase_keywords']} TCK " . + " ON TCK.testcase_id = NHTCV.parent_id " . + " JOIN {$this->tables['keywords']} KW " . + " ON KW.id = TCK.keyword_id " . + " /* FILTER BUILDS in set on target test plan */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH E.id AND LEBP.id NULL */ " . + " AND E.id IS NULL AND LEBP.id IS NULL"; + + // Due to PLATFORMS we will have MULTIPLIER EFFECT + $fields = "keyword_id"; + if ($my['opt']['groupByPlatform']) { + $fields = "platform_id,keyword_id"; + } + $sql = " /* {$debugMsg} UNION Without ALL CLAUSE => DISCARD Duplicates */" . + " SELECT status,keyword,$fields,count(0) AS exec_qty " . + " FROM ($sqlUnionAK UNION $sqlUnionBK ) AS SQK " . + " GROUP BY status,keyword,$fields + ORDER BY keyword "; + + if ($my['opt']['groupByPlatform']) { + $kol = array( + 'platform_id', + 'keyword_id', + 'status' + ); + $exec['with_tester'] = (array) $this->db->fetchRowsIntoMap3l($sql, + $kol); + + $this->helperStatusDomainMatrix($exec, 'platform_id', 'keyword_id'); + } else { + $exec['with_tester'] = (array) $this->db->fetchMapRowsIntoMap($sql, + 'keyword_id', 'status'); + $this->helperCompleteStatusDomain($exec, 'keyword_id'); + } + + // On next queries: + // we need to use distinct, because IF NOT we are going + // to get one record for each build where test case + // has TESTER ASSIGNMENT + // + // $exec['total_assigned'] = null; + $exec['total'] = null; + $exec['key4total'] = 'total'; + if ($my['opt']['getOnlyAssigned']) { + + $sql = "/* $debugMsg */ " . " SELECT COUNT(0) AS qty,$fields " . + " FROM " . " ( /* Get test case,keyword pairs */ " . + " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id,TPTCV.platform_id " . + " FROM {$this->tables['user_assignments']} UA " . + " JOIN {$this->tables['testplan_tcversions']} TPTCV ON TPTCV.id = UA.feature_id " . + " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['testcase_keywords']} TCK " . + " ON TCK.testcase_id = NHTCV.parent_id " . + " WHERE UA. build_id IN ( " . $builds->inClause . " ) " . + " AND UA.type = {$execCode} ) AS SQK " . " GROUP BY $fields"; + } else { + $sql = "/* $debugMsg */ " . " SELECT COUNT(0) AS qty, $fields" . + " FROM " . " ( /* Get test case,keyword pairs */ " . + " SELECT DISTINCT NHTCV.parent_id, TCK.keyword_id,TPTCV.platform_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* Get ONLY Test case versions that has AT LEAST one Keyword assigned */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['testcase_keywords']} TCK " . + " ON TCK.testcase_id = NHTCV.parent_id " . + " WHERE TPTCV.testplan_id = " . $safe_id . " ) AS SQK " . + " GROUP BY $fields"; + } + + if ($my['opt']['groupByPlatform']) { + + $exec[$exec['key4total']] = (array) $this->db->fetchMapRowsIntoMap( + $sql, 'platform_id', 'keyword_id'); + } else { + $exec[$exec['key4total']] = (array) $this->db->fetchRowsIntoMap( + $sql, 'keyword_id'); + } + $exec['keywords'] = $keywordSet; + + return $exec; + } + + /** + */ + public function getStatusTotalsByKeywordForRender($id, $filters = null, + $opt = null) + { + return $this->getStatusTotalsByItemForRender($id, 'keyword', $filters, + $opt); + } + + /** + * + * @internal revisions + * + * @since 1.9.4 + * 20120429 - franciscom - + */ + public function getExecCountersByPlatformExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list (, , , $union, $platformSet) = $this->helperBuildSQLExecCounters( + $id, $filters, $opt); + + $add2key = ''; + $addOnWhere = ''; + $addOnJoin = ''; + if (isset($opt['getOnlyActiveTCVersions'])) { + $add2key = 'Active'; + $addOnWhere = ' AND TCV.active = 1 '; + $addOnJoin = " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id "; + } + $sqlUnionAP = $union['exec' . $add2key]; + $sqlUnionBP = $union['not_run' . $add2key]; + + $sql = " /* {$debugMsg} UNION ALL CLAUSE => INCLUDE Duplicates */" . + " SELECT platform_id,status, count(0) AS exec_qty " . + " FROM ($sqlUnionAP UNION ALL $sqlUnionBP ) AS SQPL " . + " GROUP BY platform_id,status "; + + $exec['with_tester'] = (array) $this->db->fetchMapRowsIntoMap($sql, + 'platform_id', 'status'); + + $this->helperCompleteStatusDomain($exec, 'platform_id'); + + // get total test cases by Platform id ON TEST PLAN (With & WITHOUT tester assignment) + $sql = "/* $debugMsg */ " . " SELECT COUNT(0) AS qty, TPTCV.platform_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . $addOnJoin . + " WHERE TPTCV.testplan_id=" . $safe_id . $addOnWhere . + " GROUP BY platform_id"; + + $exec['total'] = (array) $this->db->fetchRowsIntoMap($sql, 'platform_id'); + $exec['platforms'] = $platformSet; + + return $exec; + } + + /** + * + * @internal revisions + * + */ + public function getStatusTotalsByPlatformForRender($id, $filters = null, + $opt = null) + { + return $this->getStatusTotalsByItemForRender($id, 'platform', $filters, + $opt); + } + + /** + * If no build set provided, ONLY ACTIVE BUILDS will be considered + */ + private function getExecCountersByPriorityExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($safe_id, + $filters, $opt); + + // Due to PLATFORMS we will have MULTIPLIER EFFECT + $fields = ""; + if ($my['opt']['groupByPlatform']) { + $fields = ",platform_id"; + } + + $sqlLEBP = $sqlStm['LEBP']; + + $sqlUnionA = "/* {$debugMsg} sqlUnionA - executions */" . + " SELECT (TPTCV.urgency * TCV.importance) AS urg_imp, " . + " TPTCV.tcversion_id, TPTCV.platform_id," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . " /* Get importance */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . + " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . + " JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " /* Get execution statuses that CAN BE WRITTEN TO DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBP.id " . + + // Without this we get duplicates ?? => 20121121 CONFIRMED at least with NOT RUN WE GET DUPS + $builds->joinAdd . " /* FILTER BUILD Set on target test plan */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddExec; + + $sqlUnionB = "/* {$debugMsg} sqlUnionB - NOT RUN */" . + " SELECT (TPTCV.urgency * TCV.importance) AS urg_imp, " . + " TPTCV.tcversion_id, TPTCV.platform_id," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . " /* Get importance */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . intval($id) . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . $builds->joinAdd . + " /* FILTER BUILDS in set on target test plan */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBP.id IS NULL"; + + // ATTENTION: + // Each piece of UNION has 3 fields: urg_imp,status, TPTCV.tcversion_id + // There is no way we can get more that ONE record with same TUPLE + // on sqlUionA or sqlUnionB ?. + // + // If we have PLATFORM we are going to get a MULTIPLIER EFFECT + // + $sql = " /* {$debugMsg} UNION WITHOUT ALL => DISCARD Duplicates */" . + " SELECT count(0) as exec_qty, urg_imp,status $fields " . + " FROM ($sqlUnionA UNION $sqlUnionB ) AS SU " . + " GROUP BY urg_imp,status $fields"; + + if ($my['opt']['groupByPlatform']) { + $kol = array( + 'platform_id', + 'urg_imp', + 'status' + ); + $rs = (array) $this->db->fetchRowsIntoMap3l($sql, $kol); + } else { + $rs = $this->db->get_recordset($sql); + } + + // Now we need to get priority LEVEL from (urgency * importance) + $out = array(); + $totals = array(); + $priorityCfg = config_get('urgencyImportance'); + if (! is_null($rs)) { + $loop2do = count($rs); + if ($my['opt']['groupByPlatform']) { + // loop2do => platform Qty + foreach ($rs as $platID => $elem) { + foreach ($elem as $urgImpVal => $statusUrgImp) { + + if ($urgImpVal >= $priorityCfg->threshold['high']) { + $hitOn = HIGH; + } elseif ($urgImpVal < $priorityCfg->threshold['low']) { + $hitOn = LOW; + } else { + $hitOn = MEDIUM; + } + + foreach ($statusUrgImp as $statusCode => $dummy) { + + $rz = &$rs[$platID][$urgImpVal][$statusCode]; + $rz['priority_level'] = $hitOn; + + // to improve readability + if (! isset($out[$hitOn][$statusCode])) { + $out[$platID][$hitOn][$statusCode] = $rz; + } else { + $out[$platID][$hitOn][$statusCode]['exec_qty'] += $rz['exec_qty']; + } + if (! isset($totals[$platID][$hitOn])) { + $totals[$platID][$hitOn] = array( + 'priority_level' => $hitOn, + 'qty' => 0 + ); + } + $totals[$platID][$hitOn]['qty'] += $rz['exec_qty']; + } + } + } + } else { + // The OLD WAY + if (! is_null($rs)) { + for ($jdx = 0; $jdx < $loop2do; $jdx ++) { + if ($rs[$jdx]['urg_imp'] >= + $priorityCfg->threshold['high']) { + $rs[$jdx]['priority_level'] = HIGH; + $hitOn = HIGH; + } elseif ($rs[$jdx]['urg_imp'] < + $priorityCfg->threshold['low']) { + $rs[$jdx]['priority_level'] = LOW; + $hitOn = LOW; + } else { + $rs[$jdx]['priority_level'] = MEDIUM; + $hitOn = MEDIUM; + } + + // to improve readability + $status = $rs[$jdx]['status']; + if (! isset($out[$hitOn][$status])) { + $out[$hitOn][$status] = $rs[$jdx]; + } else { + $out[$hitOn][$status]['exec_qty'] += $rs[$jdx]['exec_qty']; + } + + if (! isset($totals[$hitOn])) { + $totals[$hitOn] = array( + 'priority_level' => $hitOn, + 'qty' => 0 + ); + } + $totals[$hitOn]['qty'] += $rs[$jdx]['exec_qty']; + } + } + } + $exec['with_tester'] = $out; + $out = null; + } + if ($my['opt']['groupByPlatform']) { + $this->helperStatusDomainMatrix($exec, 'platform_id', + 'priority_level'); + } else { + $this->helperCompleteStatusDomain($exec, 'priority_level'); + } + + $exec['total'] = $totals; + + $levels = config_get('urgency'); + foreach ($levels['code_label'] as $lc => $lbl) { + $exec['priority_levels'][$lc] = lang_get($lbl); + } + + return $exec; + } + + /** + * + * @internal revisions + * + * @since 1.9.4 + * 20120429 - franciscom - + */ + public function getStatusTotalsByPriorityForRender($id, $filters = null, + $opt = null) + { + return $this->getStatusTotalsByItemForRender($id, 'priority_level', + $filters, $opt); + } + + /** + */ + public function getExecCountersByExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list (, $builds, , $union,) = $this->helperBuildSQLExecCounters($id, + $filters, $opt); + + if (is_null($builds) || empty($builds)) { + return null; // >>---> Bye! + } + + // Latest Executions By Platform (LEBP) + $add2key = ''; + if (isset($opt['getOnlyActiveTCVersions'])) { + $add2key = 'Active'; + } + + $sqlUnionAP = $union['exec' . $add2key]; + $sqlUnionBP = $union['not_run' . $add2key]; + + $sql = " /* {$debugMsg} UNION ALL CLAUSE => INCLUDE Duplicates */" . + " SELECT status, count(0) AS exec_qty " . + " FROM ($sqlUnionAP UNION ALL $sqlUnionBP ) AS SQPL " . + " GROUP BY status "; + + $dummy = (array) $this->db->fetchRowsIntoMap($sql, 'status'); + + $statusCounters = array( + 'total' => 0 + ); + $codeVerbose = array_flip($this->map_tc_status); + foreach ($dummy as $code => $elem) { + + $statusCounters['total'] += $elem['exec_qty']; + $statusCounters[$codeVerbose[$code]] = $elem['exec_qty']; + } + + return $statusCounters; + } + + /** + * + * @internal revisions + * + * @since 1.9.6 + * 20130107 - franciscom - TICKET 5457: Incorrect data in "Report by tester per build" + */ + private function getExecCountersByBuildUAExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list (, $builds, $sqlStm) = $this->helperGetExecCounters($safe_id, + $filters, $opt); + + // Last Executions By Build and Platform (LEBBP) + // Please remember that Platforms (when exists) has Multiplier effect on test cases + // + $sqlLEBBP = $sqlStm['LEBBP']; + + // 20120817 - franciscom - + // I'm not to happy with DISTINCT I've added to do this work. + // Do not understand why i get multiple identical records + // + // 20130107 - Think I've got the issue: + // was the missing clause + // " AND UA.feature_id = TPTCV.id AND UA.build_id = LEBBP.build_id " . + // + // 20140128 - do not understand why I've added DISTINT. + // without it I can add also get exec times + $sqlUnionBU = "/* {$debugMsg} */" . + " SELECT /* DISTINCT */ UA.user_id, UA.build_id, TPTCV.tcversion_id, TPTCV.platform_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " . + " COALESCE(E.execution_duration,0) AS execution_duration " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id IN ({$builds->inClause}) AND UA.type = {$this->execTaskCode} " . + " /* LEFT OUTER in order to get NOT RUN */ " . + " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.testplan_id = " . $safe_id . + " /* Without this piece we are including results for features without tester */ " . + " AND UA.feature_id = TPTCV.id AND UA.build_id = LEBBP.build_id " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.build_id = UA.build_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . " AND E.id = LEBBP.id " . // TICKET 5192 + " WHERE TPTCV.testplan_id=" . $safe_id . + " AND UA.build_id IN ({$builds->inClause}) "; + + $sql = " /* {$debugMsg} */" . + " SELECT user_id, build_id,status, count(0) AS exec_qty, SUM(execution_duration) AS total_time" . + " FROM ($sqlUnionBU) AS SQBU " . " GROUP BY user_id,build_id,status "; + + $keyColumns = array( + 'build_id', + 'user_id', + 'status' + ); + $exec['with_tester'] = (array) $this->db->fetchRowsIntoMap3l($sql, + $keyColumns); + + $totals = array(); + foreach ($exec as &$topLevelElem) { + $topLevelItemSet = array_keys($topLevelElem); + foreach ($topLevelItemSet as $topLevelItemID) { + $itemSet = array_keys($topLevelElem[$topLevelItemID]); + foreach ($itemSet as $itemID) { + $elem = &$topLevelElem[$topLevelItemID]; + foreach ($this->statusCode as $code) { + if (! isset($elem[$itemID][$code])) { + $elem[$itemID][$code] = array( + 'build_id' => $topLevelItemID, + 'user_id' => $itemID, + 'status' => $code, + 'exec_qty' => 0, + 'total_time' => 0 + ); + } + + if (! isset($totals[$topLevelItemID][$itemID])) { + $totals[$topLevelItemID][$itemID] = array( + 'build_id' => $topLevelItemID, + 'user_id' => $itemID, + 'qty' => 0, + 'total_time' => 0 + ); + } + $totals[$topLevelItemID][$itemID]['qty'] += $elem[$itemID][$code]['exec_qty']; + $totals[$topLevelItemID][$itemID]['total_time'] += $elem[$itemID][$code]['total_time']; + } + } + } + } + $exec['total'] = $totals; + + return $exec; + } + + /** + * + * @see resultsByTesterPerBuild.php + * @internal revisions + * + * @since 1.9.6 + */ + public function getStatusTotalsByBuildUAForRender($id, $opt = null) + { + $my = array( + 'opt' => array( + 'processClosedBuilds' => true + ) + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $renderObj = null; + $code_verbose = $this->getStatusForReports(); + $metrics = $this->getExecCountersByBuildUAExecStatus($id, null, + $my['opt']); + + if (! is_null($metrics)) { + $renderObj = new stdClass(); + $topItemSet = array_keys($metrics['with_tester']); + $renderObj->info = array(); + $out = &$renderObj->info; + + $topElem = &$metrics['with_tester']; + foreach ($topItemSet as $topItemID) { + $itemSet = array_keys($topElem[$topItemID]); + foreach ($itemSet as $itemID) { + $elem = &$topElem[$topItemID][$itemID]; + + $out[$topItemID][$itemID]['total'] = $metrics['total'][$topItemID][$itemID]['qty']; + $progress = 0; + foreach ($code_verbose as $statusCode => $statusVerbose) { + $out[$topItemID][$itemID][$statusVerbose]['count'] = $elem[$statusCode]['exec_qty']; + $pc = ($elem[$statusCode]['exec_qty'] / + $out[$topItemID][$itemID]['total']) * 100; + $out[$topItemID][$itemID][$statusVerbose]['percentage'] = number_format( + $pc, 1); + + if ($statusVerbose != 'not_run') { + $progress += $elem[$statusCode]['exec_qty']; + } + } + $progress = ($progress / $out[$topItemID][$itemID]['total']) * + 100; + $out[$topItemID][$itemID]['progress'] = number_format( + $progress, 1); + $out[$topItemID][$itemID]['total_time'] = number_format( + $metrics['total'][$topItemID][$itemID]['total_time'], 2, + '.', ''); + } + } + } + return $renderObj; + } + + /** + * + * @used-by getStatusTotalsByKeywordForRender() + * + */ + private function getStatusTotalsByItemForRender($id, $itemType, + $filters = null, $opt = null) + { + $renderObj = null; + $code_verbose = $this->getStatusForReports(); + $labels = $this->resultsCfg['status_label']; + + $returnArray = false; + $byPlatform = false; + + switch ($itemType) { + case 'keyword': + $metrics = $this->getExecCountersByKeywordExecStatus($id, + $filters, $opt); + $setKey = 'keywords'; + $byPlatform = isset($opt['groupByPlatform']) && + $opt['groupByPlatform']; + break; + + case 'platform': + $myOpt = array_merge(array( + 'getPlatformSet' => true + ), (array) $opt); + $metrics = $this->getExecCountersByPlatformExecStatus($id, + $filters, $myOpt); + $setKey = 'platforms'; + break; + + case 'priority_level': + $metrics = $this->getExecCountersByPriorityExecStatus($id, + $filters, $opt); + $setKey = 'priority_levels'; + $byPlatform = isset($opt['groupByPlatform']) && + $opt['groupByPlatform']; + break; + + case 'tsuite': + $metrics = $this->getExecCountersByTestSuiteExecStatus($id, + $filters, $opt); + $setKey = 'tsuites'; + $returnArray = true; + $byPlatform = isset($opt['groupByPlatform']) && + $opt['groupByPlatform']; + break; + } + + if (! is_null($metrics) && ! is_null($metrics[$setKey]) > 0) { + $renderObj = new stdClass(); + $renderObj->info = array(); + + if (! $byPlatform) { + $itemList = array_keys($metrics[$setKey]); + foreach ($itemList as $itemID) { + if (isset($metrics['with_tester'][$itemID])) { + $totalRun = 0; + $renderObj->info[$itemID]['type'] = $itemType; + $renderObj->info[$itemID]['name'] = $metrics[$setKey][$itemID]; + $renderObj->info[$itemID]['total_tc'] = $metrics['total'][$itemID]['qty']; + $renderObj->info[$itemID]['details'] = array(); + + $rf = &$renderObj->info[$itemID]['details']; + $doPerc = ($renderObj->info[$itemID]['total_tc'] > 0); + foreach ($code_verbose as $statusCode => $statusVerbose) { + $rf[$statusVerbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + $rf[$statusVerbose]['qty'] = $metrics['with_tester'][$itemID][$statusCode]['exec_qty']; + + if ($doPerc) { + $rf[$statusVerbose]['percentage'] = number_format( + 100 * + ($rf[$statusVerbose]['qty'] / + $renderObj->info[$itemID]['total_tc']), 1); + } + $totalRun += ($statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']); + } + if ($doPerc) { + $renderObj->info[$itemID]['percentage_completed'] = number_format( + 100 * + ($totalRun / + $renderObj->info[$itemID]['total_tc']), 1); + } + } + } + } else { + // mainKey is Platform ID + $platList = array_keys($metrics['with_tester']); + $mex = &$metrics['with_tester']; + foreach ($platList as $platID) { + $itemList = array_keys($mex[$platID]); + foreach ($itemList as $itemID) { + if (isset($mex[$platID])) { + $totalRun = 0; + $renderObj->info[$platID][$itemID]['type'] = $itemType; + $renderObj->info[$platID][$itemID]['name'] = $metrics[$setKey][$itemID]; + $renderObj->info[$platID][$itemID]['total_tc'] = $metrics['total'][$platID][$itemID]['qty']; + $renderObj->info[$platID][$itemID]['details'] = array(); + + $rf = &$renderObj->info[$platID][$itemID]['details']; + $doPerc = ($renderObj->info[$platID][$itemID]['total_tc'] > + 0); + foreach ($code_verbose as $statusCode => $statusVerbose) { + $rf[$statusVerbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + $rf[$statusVerbose]['qty'] = $mex[$platID][$itemID][$statusCode]['exec_qty']; + + if ($doPerc) { + $rf[$statusVerbose]['percentage'] = number_format( + 100 * + ($rf[$statusVerbose]['qty'] / + $renderObj->info[$platID][$itemID]['total_tc']), + 1); + } + $totalRun += ($statusVerbose == 'not_run' ? 0 : $rf[$statusVerbose]['qty']); + } + if ($doPerc) { + $renderObj->info[$platID][$itemID]['percentage_completed'] = number_format( + 100 * + ($totalRun / + $renderObj->info[$platID][$itemID]['total_tc']), + 1); + } + } + } + } + } + + // Verbosity! + foreach ($code_verbose as $status_verbose) { + $l10n = isset($labels[$status_verbose]) ? lang_get( + $labels[$status_verbose]) : lang_get($status_verbose); + + $renderObj->colDefinition[$status_verbose]['qty'] = $l10n; + $renderObj->colDefinition[$status_verbose]['percentage'] = '[%]'; + } + } + + // How to return things + if ($returnArray) { + return array( + $renderObj, + $metrics['staircase'] + ); + } else { + unset($metrics); + return $renderObj; + } + } + + /** + * + * @internal revisions + * + * @since 1.9.4 + * 20120429 - franciscom - + */ + private function getStatusTotalsByTestSuiteForRender($id, $filters = null, + $opt = null) + { + list ($renderObj, $staircase) = $this->getStatusTotalsByItemForRender( + $id, 'tsuite', $filters, $opt); + unset($staircase); + return $renderObj; + } + + /** + * + * @internal revisions + * + * @since 1.9.4 + */ + public function getStatusTotalsByTopLevelTestSuiteForRender($id, + $filters = null, $opt = null) + { + list ($rx, $staircase) = $this->getStatusTotalsByItemForRender($id, + 'tsuite', $filters, $opt); + + // ??? $key2loop = array_keys($rx->info); + $template = array( + 'type' => 'tsuite', + 'name' => '', + 'total_tc' => 0, + 'percentage_completed' => 0, + 'details' => array() + ); + + foreach ($this->statusCode as $verbose => $code) { + $template['details'][$verbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + } + + $renderObj = new stdClass(); + $renderObj->colDefinition = $rx->colDefinition; + + // collect qty + $topNameCache = null; + $execQty = null; + + $key2loop = array_keys($staircase); + $wp = isset($opt['groupByPlatform']) && $opt['groupByPlatform']; + + if ($wp) { + $plat2loop = array_keys($rx->info); + foreach ($key2loop as $tsuite_id) { + // (count() == 1) => is a TOP LEVEL SUITE, + // only element contains Root node, is useless for this algorithm + // + + if (count($staircase[$tsuite_id]) > 1) { + // element at position 1 is a TOP LEVEL SUITE + // $topSuiteID = &$staircase[$tsuite_id][1]; + $topSuiteID = $staircase[$tsuite_id][1]; + $initName = false; + } else { + $topSuiteID = $tsuite_id; + $initName = true; + } + + // Over Platform + foreach ($plat2loop as $platId) { + if (! isset($renderObj->info[$platId][$topSuiteID])) { + $renderObj->info[$platId][$topSuiteID] = $template; + $execQty[$platId][$topSuiteID] = 0; + $initName = true; + } + + if ($initName) { + $dummy = $this->tree_manager->get_node_hierarchy_info( + $topSuiteID); + $renderObj->info[$platId][$topSuiteID]['name'] = $dummy['name']; + unset($dummy); + } + + // Loop to get executions counters + $r2d2 = &$rx->info[$platId][$tsuite_id]; + if (null !== $r2d2) { + foreach ($r2d2['details'] as $code => &$elem) { + $renderObj->info[$platId][$topSuiteID]['details'][$code]['qty'] += $elem['qty']; + $renderObj->info[$platId][$topSuiteID]['total_tc'] += $elem['qty']; + + if ($code != 'not_run') { + $execQty[$platId][$topSuiteID] += $elem['qty']; + } + } + } + } + } + + // Last step: get percentages + foreach ($renderObj->info as $platID => &$tsuiteMetrics) { + foreach ($tsuiteMetrics as $tsuite_id => &$elem) { + if ($execQty[$platID][$tsuite_id] > 0) { + $elem['percentage_completed'] = number_format( + 100 * + ($execQty[$platID][$tsuite_id] / $elem['total_tc']), + 1); + } + if ($elem['total_tc'] > 0) { + foreach ($elem['details'] as &$yumyum) { + $yumyum['percentage'] = number_format( + 100 * ($yumyum['qty'] / $elem['total_tc']), 1); + } + } + } + } + } else { + + // OLD WAY + foreach ($key2loop as $tsuite_id) { + // (count() == 1) => is a TOP LEVEL SUITE, + // only element contains Root node, is useless for this algorithm + // + + if (count($staircase[$tsuite_id]) > 1) { + // element at position 1 is a TOP LEVEL SUITE + $topSuiteID = &$staircase[$tsuite_id][1]; + $initName = false; + } else { + $topSuiteID = $tsuite_id; + $initName = true; + } + + if (! isset($renderObj->info[$topSuiteID])) { + $renderObj->info[$topSuiteID] = $template; + $execQty[$topSuiteID] = 0; + $initName = true; + } + + if ($initName) { + $dummy = $this->tree_manager->get_node_hierarchy_info( + $topSuiteID); + $renderObj->info[$topSuiteID]['name'] = $dummy['name']; + unset($dummy); + } + + // Loop to get executions counters + if (isset($rx->info[$tsuite_id]['details'])) { + foreach ($rx->info[$tsuite_id]['details'] as $code => &$elem) { + $renderObj->info[$topSuiteID]['details'][$code]['qty'] += $elem['qty']; + $renderObj->info[$topSuiteID]['total_tc'] += $elem['qty']; + + if ($code != 'not_run') { + $execQty[$topSuiteID] += $elem['qty']; + } + } + } + } + + // Last step: get percentages + foreach ($renderObj->info as $tsuite_id => &$elem) { + if ($execQty[$tsuite_id] > 0) { + $elem['percentage_completed'] = number_format( + 100 * ($execQty[$tsuite_id] / $elem['total_tc']), 1); + } + + if ($elem['total_tc'] > 0) { + foreach ($elem['details'] as &$yumyum) { + $yumyum['percentage'] = number_format( + 100 * ($yumyum['qty'] / $elem['total_tc']), 1); + } + } + } + } + + unset($topNameCache); + unset($rx); + unset($staircase); + unset($template); + unset($key2loop); + unset($execQty); + + return $renderObj; + } + + /** + */ + private function getExecCountersByTestSuiteExecStatus($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safe_id = intval($id); + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($id, + $filters, $opt); + + $fields = ""; + if ($my['opt']['groupByPlatform']) { + $fields = ",platform_id"; + } + + // Latest Execution Ignoring Build + $sqlLEBP = $sqlStm['LEBP']; + + $sqlUnionAT = "/* {$debugMsg} sqlUnionAT - executions */" . + " SELECT NHTC.parent_id AS tsuite_id,TPTCV.platform_id," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . + " JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBP.id " . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . $builds->whereAddExec; + + $sqlUnionBT = "/* {$debugMsg} sqlUnionBK - NOT RUN */" . + " SELECT NHTC.parent_id AS tsuite_id,TPTCV.platform_id," . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* Get REALLY NOT RUN => BOTH LEBP.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . $builds->joinAdd . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* FILTER BUILDS in set on target test plan (not alway can be applied) */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBP.id IS NULL"; + + $sql = " /* {$debugMsg} UNION ALL DO NOT DISCARD Duplicates */" . + " SELECT count(0) AS exec_qty, tsuite_id, status $fields" . + " FROM ($sqlUnionAT UNION ALL $sqlUnionBT ) AS SQT " . + " GROUP BY tsuite_id ,status $fields"; + + if ($my['opt']['groupByPlatform']) { + $kol = array( + 'platform_id', + 'tsuite_id', + 'status' + ); + $exec['with_tester'] = (array) $this->db->fetchRowsIntoMap3l($sql, + $kol); + $this->helperStatusDomainMatrix($exec, 'platform_id', 'tsuite_id'); + } else { + $exec['with_tester'] = (array) $this->db->fetchMapRowsIntoMap($sql, + 'tsuite_id', 'status'); + + // now we need to complete status domain + $this->helperCompleteStatusDomain($exec, 'tsuite_id'); + } + + // Build item set + $exec['tsuites_full'] = $this->get_testsuites($safe_id); + $loop2do = count($exec['tsuites_full']); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $keySet[] = $exec['tsuites_full'][$idx]['id']; + } + $dx = $this->tree_manager->get_full_path_verbose($keySet, + array( + 'output_format' => 'stairway2heaven' + )); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $exec['tsuites'][$exec['tsuites_full'][$idx]['id']] = $dx['flat'][$exec['tsuites_full'][$idx]['id']]; + } + $exec['staircase'] = $dx['staircase']; + + unset($dx); + unset($keySet); + return $exec; + } + + /** + */ + public function getExecStatusMatrix($id, $filters = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array(); + $my['opt'] = array( + 'getExecutionNotes' => false, + 'getTester' => false, + 'getUserAssignment' => false, + 'output' => null, + 'getExecutionTimestamp' => false, + 'getExecutionDuration' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + list ($my, $builds, $sqlStm, $union) = $this->helperBuildSQLTestSuiteExecCounters( + $id, $filters, $my['opt']); + + $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */ " . + " {$union['exec']} UNION ALL {$union['not_run']} "; + + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id', + 'build_id' + ); + $cumulative = ($my['opt']['output'] == 'cumulative'); + $dummy = (array) $this->db->fetchRowsIntoMap4l($sql, $keyColumns, + $cumulative); + + unset($sqlStm); + unset($union); + unset($my); + unset($builds); + + // now is time do some decoding + // Key is a tuple (PARENT tsuite_id, test case id, platform id) + // + $item2loop = array_keys($dummy); + $stairway2heaven = null; + $pathway = null; + $latestExec = null; + $priorityCfg = config_get('urgencyImportance'); + + foreach ($item2loop as $item_id) { + $stairway2heaven = $this->tree_manager->get_path($item_id, null, + 'name'); + $pathway[$item_id] = implode("/", $stairway2heaven); + unset($stairway2heaven); + + // go inside test case + $tcase2loop = array_keys($dummy[$item_id]); + foreach ($tcase2loop as $tcase_id) { + $platform2loop = array_keys($dummy[$item_id][$tcase_id]); + foreach ($platform2loop as $platform_id) { + $latestExec[$platform_id][$tcase_id] = array( + 'id' => - 1, + 'status' => $this->notRunStatusCode + ); + $rf = &$dummy[$item_id][$tcase_id][$platform_id]; + foreach ($rf as &$exec) { + $exec['suiteName'] = $pathway[$item_id]; + if ($exec['executions_id'] > + $latestExec[$platform_id][$tcase_id]['id']) { + $latestExec[$platform_id][$tcase_id]['id'] = $exec['executions_id']; + $latestExec[$platform_id][$tcase_id]['status'] = $exec['status']; + $latestExec[$platform_id][$tcase_id]['build_id'] = $exec['build_id']; + $latestExec[$platform_id][$tcase_id]['execution_notes'] = $exec['execution_notes']; + } + + // --------------------------------------------------- + // Now we need to get priority LEVEL from + // (urgency * impact) + // we do not use a function to improve performance + if ($exec['urg_imp'] >= $priorityCfg->threshold['high']) { + $exec['priority_level'] = HIGH; + } elseif ($exec['urg_imp'] < + $priorityCfg->threshold['low']) { + $exec['priority_level'] = LOW; + } else { + $exec['priority_level'] = MEDIUM; + } + } + } + } + + unset($tcase2loop); + unset($platform2loop); + } + + unset($pathway); + return array( + 'metrics' => $dummy, + 'latestExec' => $latestExec + ); + } + + /** + * + * @used-by + * getExecutionsByStatus() + * getNotRunWithTesterAssigned() + * getNotRunWOTesterAssigned() + * getExecCountersByBuildExecStatus() + * getExecCountersByKeywordExecStatus() + * getExecCountersByPriorityExecStatus() + * getExecCountersByBuildUAExecStatus() + * getExecCountersByTestSuiteExecStatus() + * + * + * + */ + private function helperGetExecCounters($id, $filters, $opt) + { + $sql = array(); + $my = array(); + $my['opt'] = array( + 'getOnlyAssigned' => false, + 'tprojectID' => 0, + 'getUserAssignment' => false, + 'getPlatformSet' => false, + 'processClosedBuilds' => true, + 'groupByPlatform' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $my['filters'] = array( + 'buildSet' => null + ); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + // Build Info + $bi = new stdClass(); + $bi->idSet = $my['filters']['buildSet']; + $bi->inClause = ''; + $bi->infoSet = null; + + if (is_null($bi->idSet)) { + $openStatus = $my['opt']['processClosedBuilds'] ? null : 1; + + $bi->infoSet = $this->get_builds($id, testplan::ACTIVE_BUILDS, + $openStatus); + if (! is_null($bi->infoSet)) { + $bi->idSet = array_keys($bi->infoSet); + } + } + + // ========================================================= + // Emergency Exit !!! + if (is_null($bi->idSet)) { + throw new Exception( + __METHOD__ . " - Can not work with empty build set"); + } + // ========================================================= + + // Things seems to be OK + $bi->inClause = implode(",", $bi->idSet); + if ($my['opt']['getOnlyAssigned']) { + $sql['getAssignedFeatures'] = " /* Get feature id with Tester Assignment */ " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id IN ({$bi->inClause}) " . + " AND UA.type = {$this->execTaskCode} "; + $bi->source = "UA"; + $bi->joinAdd = " AND E.build_id = UA.build_id "; + $bi->whereAddExec = " AND {$bi->source}.build_id IN ({$bi->inClause}) "; + $bi->whereAddNotRun = $bi->whereAddExec; + } else { + $sql['getAssignedFeatures'] = ''; + $bi->source = "E"; + + // TICKET 5353 + // $bi->joinAdd = ""; + $bi->joinAdd = " AND E.build_id IN ({$bi->inClause}) "; + + // Why ? + // If I'm consider test cases WITH and WITHOUT Tester assignment, + // I will have no place to go to filter for builds. + // Well at least when trying to get EXECUTED test case, I will be able + // to apply filter on Executions table. + // Why then I choose to have this blank ANYWAY ? + // Because I will get filtering on Build set through + // the Latest Execution queries (see below sql['LE'], sql['LEBP']. + // + // Anyway we need to backup all these thoughts with a long, long test run + // on test link itself. + $bi->whereAddExec = " AND {$bi->source}.build_id IN ({$bi->inClause}) "; + $bi->whereAddNotRun = ""; + } + + $sql['getUserAssignment']['not_run'] = ""; + $sql['getUserAssignment']['exec'] = ""; + + if ($my['opt']['getUserAssignment']) { + $sql['getUserAssignment']['not_run'] = " LEFT JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . " AND UA.build_id = BU.id " . + " AND UA.type = {$this->execTaskCode} "; + + $sql['getUserAssignment']['exec'] = " LEFT JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id = E.build_id " . + " AND UA.type = {$this->execTaskCode} "; + } + + // Latest Execution IGNORING Build and Platform + $sql['LE'] = " SELECT EE.tcversion_id,EE.testplan_id,MAX(EE.id) AS id " . + " FROM {$this->tables['executions']} EE " . " WHERE EE.testplan_id=" . + intval($id) . " AND EE.build_id IN ({$bi->inClause}) " . + " GROUP BY EE.tcversion_id,EE.testplan_id "; + + // Latest Execution By Platform (ignore build) + $sql['LEBP'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,MAX(EE.id) AS id " . + " FROM {$this->tables['executions']} EE " . " WHERE EE.testplan_id=" . + intval($id) . " AND EE.build_id IN ({$bi->inClause}) " . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id "; + + // Last Executions By Build (LEBB) (ignore platform) + $sql['LEBB'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.build_id,MAX(EE.id) AS id " . + " FROM {$this->tables['executions']} EE " . " WHERE EE.testplan_id=" . + intval($id) . " AND EE.build_id IN ({$bi->inClause}) " . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.build_id "; + + // Last Executions By Build and Platform (LEBBP) + $sql['LEBBP'] = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id=" . intval($id) . + " AND EE.build_id IN ({$bi->inClause}) " . + " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; + + return array( + $my, + $bi, + $sql + ); + } + + /** + */ + private function helperCompleteStatusDomain(&$out, $key) + { + $totalByItemID = array(); + + // refence is critic + foreach ($out as &$elem) { + $itemSet = array_keys($elem); + foreach ($itemSet as $itemID) { + $totalByItemID[$itemID]['qty'] = 0; + foreach ($this->statusCode as $code) { + if (! isset($elem[$itemID][$code])) { + $elem[$itemID][$code] = array( + $key => $itemID, + 'status' => $code, + 'exec_qty' => 0 + ); + } + $totalByItemID[$itemID]['qty'] += $elem[$itemID][$code]['exec_qty']; + } + } + } + $out['total'] = $totalByItemID; + } + + /** + */ + private function helperBuildSQLExecCounters($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + try { + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($id, + $filters, $opt); + } catch (Exception $e) { + return null; + } + + $safe_id = intval($id); + $platformSet = null; + if ($my['opt']['getPlatformSet']) { + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'outputDetails' => 'name', + 'addIfNull' => true + ); + $platformSet = $this->getPlatforms($safe_id, $getOpt); + } + + // Latest Executions By Platform (LEBP) + $sqlLEBP = $sqlStm['LEBP']; + + // 20121121 - franciscom + // Need to understand if this sentence is right: + // + // GO FOR Absolute LATEST exec ID IGNORE BUILD + // Is this right for each use of this method ? + // + $dummy['exec'] = "/* {$debugMsg} sqlUnion - executions */" . + " SELECT TPTCV.tcversion_id,TPTCV.platform_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* GO FOR Absolute LATEST exec ID IGNORE BUILD */ " . + " JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBP.id "; + + $union['exec'] = $dummy['exec'] . " WHERE TPTCV.testplan_id=" . $safe_id . + $builds->whereAddExec; + + $union['execActive'] = $dummy['exec'] . + " /* Used to filter ON ACTIVE TCVersion */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . $builds->whereAddExec . " AND TCV.active = 1 "; + + // 20121121 - An issue was reported in this scenario: + // Test Plan with Platforms (ONE) + // Two Build: + // B1 with TC1 passed, TC2 failed, TC3 not run - BUT B1 INACTIVE + // B3 ALL TEST CASES NOT RUN + // + // we got WRONG figures if build set is NOT USING when trying to access Executions TABLE + // + $dummy['not_run'] = "/* {$debugMsg} sqlUnion - NOT RUN */" . + " SELECT TPTCV.tcversion_id,TPTCV.platform_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEBP}) AS LEBP " . + " ON LEBP.testplan_id = TPTCV.testplan_id " . + " AND LEBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBP.platform_id = TPTCV.platform_id " . + " AND LEBP.testplan_id = " . $safe_id . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . $builds->joinAdd; + + $union['not_run'] = $dummy['not_run'] . + " /* FILTER BUILDS in set on target test plan (not always can be applied) */ " . + " WHERE TPTCV.testplan_id=" . $safe_id . $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBP.id IS NULL"; + + $union['not_runActive'] = $dummy['not_run'] . + " /* Used to filter ON ACTIVE TCVersion */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBP.id IS NULL" . " AND TCV.active = 1 "; + + return array( + $my, + $builds, + $sqlStm, + $union, + $platformSet + ); + } + + /** + * + * @internal revision + * @since 1.9.8 + * 20130713 - franciscom - + * when getting info for executed test cases, RIGHT version number for execution + * is on EXECUTIONS TABLE not on testplan_tcversions TABLE. + * + * REMEMBER that when we update TCVERSION for executed Test Cases, we HAVE TO UPDATE + * testplan_tcversions table. + * + * We also need to use E.tcversion_id and NOT TPTCV.tcversion_id. + * + */ + private function helperBuildSQLTestSuiteExecCounters($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'getExecutionNotes' => false, + 'getTester' => false, + 'getUserAssignment' => false, + 'getExecutionTimestamp' => false, + 'getExecutionDuration' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($id, + $filters, $opt); + + $safe_id = intval($id); + + // Additional Execution fields + $moreExecFields = ""; + if ($my['opt']['getExecutionNotes']) { + $moreExecFields .= "COALESCE(E.notes,'') AS execution_notes,"; + } + + if ($my['opt']['getTester']) { + $moreExecFields .= "E.tester_id,"; + } + + if ($my['opt']['getExecutionTimestamp']) { + $moreExecFields .= "E.execution_ts,"; + } + + if ($my['opt']['getExecutionDuration']) { + $moreExecFields .= "E.execution_duration,"; + } + + if ($my['opt']['getUserAssignment']) { + $moreExecFields .= "UA.user_id,"; + } + + // Latest Executions By Build Platform (LEBBP) + $sqlLEBBP = $sqlStm['LEBBP']; + + $union['exec'] = "/* {$debugMsg} sqlUnion Test suites - executions */" . + " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . + " TPTCV.tcversion_id,TPTCV.platform_id," . + " E.build_id,E.tcversion_number AS version,TCV.tc_external_id AS external_id, " . + " E.id AS executions_id, E.status AS status, " . $moreExecFields . + " E.execution_type AS exec_type," . + " (TPTCV.urgency * TCV.importance) AS urg_imp " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.build_id = LEBBP.build_id " . + $sqlStm['getUserAssignment']['exec'] . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + // " ON TCV.id = TPTCV.tcversion_id " . + " ON TCV.id = E.tcversion_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . $builds->whereAddExec; + + $union['not_run'] = "/* {$debugMsg} sqlUnion Test suites - not run */" . + " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . + " TPTCV.tcversion_id, TPTCV.platform_id," . + " BU.id AS build_id,TCV.version,TCV.tc_external_id AS external_id, " . + " COALESCE(E.id,-1) AS executions_id, " . + " COALESCE(E.status,'{$this->notRunStatusCode}') AS status, " . + $moreExecFields . " TCV.execution_type AS exec_type," . + " (TPTCV.urgency * TCV.importance) AS urg_imp " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* Needed to be able to put a value on build_id on output set */ " . + " JOIN {$this->tables['builds']} BU " . + " ON BU.id IN ({$builds->inClause}) " . + $sqlStm['getUserAssignment']['not_run'] . + " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . + " LEFT OUTER JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.build_id = BU.id " . " AND LEBBP.testplan_id = " . + $safe_id . " /* Get execution status WRITTEN on DB */ " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.build_id = LEBBP.build_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . " AND BU.id IN ({$builds->inClause}) " . + $builds->whereAddNotRun . + " /* Get REALLY NOT RUN => BOTH LEBBP.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEBBP.id IS NULL"; + + return array( + $my, + $builds, + $sqlStm, + $union + ); + } + + /** + * get executions (Not Run is not included) + * + * @param int $id + * test plan id + * @param string $status + * status code (one char) + * @param mixed $filters + * keys: 'buildSet' + * + * @param + * mixed opt + * keys: 'output' elem domain 'map','array' + * + */ + public function getExecutionsByStatus($id, $status, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($id, + $filters, $opt); + + // particular options + $options = array( + 'output' => 'map', + 'add2fields' => '' + ); + $my['opt'] = array_merge($options, $my['opt']); + $safe_id = intval($id); + + $fullEID = $this->helperConcatTCasePrefix($safe_id); + + $addFields = ''; + if ('' != $my['opt']['add2fields']) { + $addFields = ',' . $my['opt']['add2fields']; + } + + $sqlLEBBP = $sqlStm['LEBBP']; + $sql = "/* {$debugMsg} executions with status WRITTEN on DB => not run is not present */" . + " SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . + " TPTCV.tcversion_id,TPTCV.platform_id," . + " E.tcversion_number, E.build_id,E.id AS executions_id, E.status AS status, " . + " E.notes AS execution_notes, E.tester_id,E.execution_ts," . + " TCV.version,TCV.tc_external_id AS external_id, " . + " $fullEID AS full_external_id," . + " (TPTCV.urgency * TCV.importance) AS urg_imp " . $addFields . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " /* GO FOR Absolute LATEST exec ID On BUILD,PLATFORM */ " . + " JOIN ({$sqlLEBBP}) AS LEBBP " . + " ON LEBBP.testplan_id = TPTCV.testplan_id " . + " AND LEBBP.platform_id = TPTCV.platform_id " . + " AND LEBBP.tcversion_id = TPTCV.tcversion_id " . + " AND LEBBP.testplan_id = " . $safe_id . + $sqlStm['getAssignedFeatures'] . + " /* Get execution status WRITTEN on DB */ " . + " JOIN {$this->tables['executions']} E " . " ON E.id = LEBBP.id " . + " AND E.build_id = LEBBP.build_id " . $builds->joinAdd . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . " WHERE TPTCV.testplan_id=" . + $safe_id . " AND E.status='{$status}' " . $builds->whereAddExec; + + switch ($my['opt']['output']) { + case 'array': + $dummy = (array) $this->db->get_recordset($sql); + break; + + case 'mapByExecID': + $dummy = (array) $this->db->fetchRowsIntoMap($sql, + 'executions_id'); + break; + + case 'map': + default: + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id', + 'build_id' + ); + $dummy = (array) $this->db->fetchRowsIntoMap4l($sql, $keyColumns); + break; + } + + return $dummy; + } + + /** + * get just Not Run test case on test plan, but ONLY THESE + * that has tester assigned. + * This is critic: + * + * example: + * test plan with 11 test cases linked. + * two Builds B1, B2 + * 1. Assign tester to all test cases on BUILD B1 + * 2. run getNotRunWithTesterAssigned() + * you will get 11 records all for B1 + * + * 3. Assign tester to 4 test cases on BUILD B2 + * 4. run getNotRunWithTesterAssigned() + * you will get: 15 records + * 11 records for B1 + * 4 records for B2 + * + * @param int $id + * test plan id + * @param string $status + * status code (one char) + * @param mixed $filters + * keys: 'buildSet' + * + * @param + * mixed opt + * keys: 'output' elem domain 'map','array' + * + */ + public function getNotRunWithTesterAssigned($id, $filters = null, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($my, $builds,) = $this->helperGetExecCounters($id, $filters, $opt); + + // particular options + $my['opt'] = array_merge(array( + 'output' => 'map' + ), $my['opt']); + $safe_id = intval($id); + + $fullEID = $this->helperConcatTCasePrefix($safe_id); + + // Because we now allow assignment of MULTIPLE testers to same test case + // we need to remove UA.user_id, in order to avoid duplication + // UA.user_id, + // we will need a second step to populate this info. + // + $sql = "/* {$debugMsg} Not Run */" . + " SELECT DISTINCT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . + " TPTCV.tcversion_id,TPTCV.platform_id,TPTCV.id AS feature_id," . + " TCV.version AS tcversion_number, B.id AS build_id," . + " '{$this->notRunStatusCode}' AS status, " . + " TCV.version,TCV.tc_external_id AS external_id, " . + " $fullEID AS full_external_id," . + " (TPTCV.urgency * TCV.importance) AS urg_imp, TCV.summary " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B " . + " ON B.testplan_id = TPTCV.testplan_id " . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . " AND UA.build_id = B.id " . + " AND UA.type = {$this->execTaskCode} " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . " WHERE TPTCV.testplan_id=" . $safe_id . + " AND E.id IS NULL " . " AND B.id IN ({$builds->inClause}) "; + + switch ($my['opt']['output']) { + case 'array': + $dummy = (array) $this->db->get_recordset($sql); + + // Second Loop + // get features to get testers + if (! is_null($dummy)) { + // will try with a query + $sql = "/* {$debugMsg} Not Run */" . + " SELECT UA.user_id, UA.feature_id,UA.build_id" . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B " . + " ON B.testplan_id = TPTCV.testplan_id " . + " JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . + " AND UA.build_id = B.id " . + " AND UA.type = {$this->execTaskCode} " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . " WHERE TPTCV.testplan_id=" . + $safe_id . " AND E.id IS NULL " . + " AND B.id IN ({$builds->inClause}) "; + + $dx = (array) $this->db->get_recordset($sql); + + $l2do = count($dx); + $loop2do = count($dummy); + for ($vdx = 0; $vdx < $l2do; $vdx ++) { + for ($fdx = 0; $fdx < $loop2do; $fdx ++) { + if ($dummy[$fdx]['feature_id'] == + $dx[$vdx]['feature_id'] && + $dummy[$fdx]['build_id'] == $dx[$vdx]['build_id']) { + $dummy[$fdx]['user_id'][$dx[$vdx]['user_id']] = $dx[$vdx]['user_id']; + break; + } + } + } + } + + break; + + case 'map': + default: + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id', + 'build_id' + ); + $dummy = (array) $this->db->fetchRowsIntoMap4l($sql, $keyColumns); + throw new Exception("NOT REFACTORED YET for output 'map'", 1); + + break; + } + + return $dummy; + } + + /* + * + * @used-by lib/results/testCasesWithoutTester.php + * + * IMPORTANT NOTICE + * When doing count() with having, if there are platforms defined + * we have to consider for having clause BuildQty * PlatformQty, + * or we are going to get WRONG results. + */ + public function getNotRunWOTesterAssigned($id, $buildSet = null, + $filters = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + list ($my, $builds,) = $this->helperGetExecCounters($id, $filters, $opt); + list (, $buildsCfg,) = $this->helperGetHits($id, null, $buildSet, + array( + 'ignorePlatform' => true + )); + // particular options + $my['opt'] = array_merge( + array( + 'output' => 'map', + 'ignoreBuild' => false + ), $my['opt']); + $safe_id = intval($id); + + $fullEID = $this->helperConcatTCasePrefix($safe_id); + + $add2select = ' DISTINCT '; + $buildInfo = ''; + + // 20130106 - TICKET 5451 - added A_TPTCV.platform_id on GROUP BY + // this query try to indentify test cases that has NO ASSIGNMENT ON ALL Builds + // for EACH PLATFORM. + $sqlc = "/* $debugMsg */ " . + " SELECT count(0) AS TESTER_COUNTER ,A_NHTCV.parent_id AS tcase_id,A_TPTCV.platform_id " . + " FROM {$this->tables['testplan_tcversions']} A_TPTCV " . + " JOIN {$this->tables['builds']} A_B ON A_B.testplan_id = A_TPTCV.testplan_id " . + str_replace('B.active', 'A_B.active', $buildsCfg['statusClause']) . + " JOIN {$this->tables['nodes_hierarchy']} A_NHTCV ON " . + " A_NHTCV.id = A_TPTCV.tcversion_id " . + " LEFT OUTER JOIN {$this->tables['executions']} A_E " . + " ON A_E.testplan_id = A_TPTCV.testplan_id " . + " AND A_E.platform_id = A_TPTCV.platform_id " . + " AND A_E.tcversion_id = A_TPTCV.tcversion_id " . + " AND A_E.build_id = A_B.id " . + " LEFT OUTER JOIN {$this->tables['user_assignments']} A_UA " . + " ON A_UA.feature_id = A_TPTCV.id " . " AND A_UA.build_id = A_B.id " . + " AND A_UA.type = {$this->execTaskCode} " . + " WHERE A_TPTCV.testplan_id = " . $safe_id . + " AND A_E.status IS NULL " . " AND A_UA.user_id IS NULL "; + + // http://stackoverflow.com/questions/7511064/postresql-aliases-column-and-having + // + // if( DB_TYPE == 'mssql' ) + // { + // $sqlc .= " GROUP BY tcase_id " . + // " HAVING TESTER_COUNTER = " . intval($buildsCfg['count']) ; + // } + // else + // { + // $sqlc .= " GROUP BY A_NHTCV.parent_id " . + // " HAVING count(0) = " . intval($buildsCfg['count']) ; + // } + $sqlc .= " GROUP BY A_NHTCV.parent_id, A_TPTCV.platform_id " . + " HAVING count(0) = " . intval($buildsCfg['count']); + + $sql = "/* {$debugMsg} Not Run */" . + " SELECT $add2select NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . + " TPTCV.tcversion_id,TPTCV.platform_id," . + " TCV.version AS tcversion_number, {$buildInfo}" . + " '{$this->notRunStatusCode}' AS status, " . + " TCV.version,TCV.tc_external_id AS external_id, " . + " $fullEID AS full_external_id,UA.user_id," . + " (TPTCV.urgency * TCV.importance) AS urg_imp, TCV.summary " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['builds']} B " . + " ON B.testplan_id = TPTCV.testplan_id " . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . " JOIN ({$sqlc}) AS NR " . + " ON NR.tcase_id = NHTC.id " . + " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . + " ON UA.feature_id = TPTCV.id " . " AND UA.build_id = B.id " . + " AND UA.type = {$this->execTaskCode} " . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . " WHERE TPTCV.testplan_id=" . $safe_id . + " AND E.id IS NULL AND UA.user_id IS NULL " . + + // 20130106 - TICKET 5451 - added CONDITION ON NR.platform_id + " AND B.id IN ({$builds->inClause}) AND TPTCV.platform_id = NR.platform_id "; + + switch ($my['opt']['output']) { + case 'array': + $dummy = $this->db->get_recordset($sql); + break; + + case 'map': + default: + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id', + 'build_id' + ); + $dummy = $this->db->fetchRowsIntoMap4l($sql, $keyColumns); + break; + } + return (array) $dummy; + } + + /** + * + * @internal revisions + * + * @since 1.9.4 + */ + private function helperGetUserIdentity($idSet = null) + { + $sql = " SELECT id,login,first,last " . " FROM {$this->tables['users']}"; + + $inClause = ''; + if (! is_null($idSet) && ((array) $idSet > 0) && + ($dummy = implode(',', (array) $idSet)) != '') { + $inClause = " WHERE id IN ({$dummy}) "; + } + + return $this->db->fetchRowsIntoMap($sql . $inClause, 'id'); + } + + /** + * + * @used-by /lib/results/resultsMoreBuilds.php + * + * @internal revisions + * + * @since 1.9.4 + */ + private function queryMetrics($id, $filters = null, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $safe = array(); + $safe['tplan_id'] = intval($id); + + $my = array(); + list ($my, $sqlLEX) = $this->initQueryMetrics($safe['tplan_id'], + $filters, $options); + + // ------------------------------------------------------------------------------------------- + // We will work always using last execution result as filter criteria. + // ------------------------------------------------------------------------------------------- + + // we will need a union to manage 'not run' (remember this status is NEVER WRITTEN to DB) + // and other statuses + // This logic have been borrowed from testplan.class.php - getLinkedForExecTree(). + // + $key2check = array( + 'builds' => 'build_id', + 'platforms' => 'platform_id' + ); + $ejoin = array(); + foreach ($key2check as $check => $field) { + $ejoin[$check] = is_null($my['filters'][$check]) ? '' : " AND E.$field IN (" . + implode(',', (array) $my['filters'][$check]) . ')'; + } + + $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . + " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . + " TCV.tc_external_id AS external_id, " . " COALESCE(E.status,'" . + $this->notRunStatusCode . "') AS exec_status " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . + " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . + $my['join']['ua'] . $my['join']['keywords'] . + " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . + " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . + " ON LEX.testplan_id = TPTCV.testplan_id " . + " AND LEX.tcversion_id = TPTCV.tcversion_id " . + " AND LEX.platform_id = TPTCV.platform_id " . + " AND LEX.testplan_id = " . $safe['tplan_id'] . + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.tcversion_id = TPTCV.tcversion_id " . + " AND E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . " AND E.build_id = " . + $my['filters']['build_id'] . " WHERE TPTCV.testplan_id =" . + $safe['tplan_id'] . $my['where']['where'] . + " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . + " AND E.id IS NULL AND LEX.id IS NULL"; + + // executions + $sex = "/* $debugMsg */" . + "SELECT E.status,E.notes,E.tcversion_number,E.execution_ts,E.build_id,E.platform_id " . + "FROM {$this->tables['testplan_tcversions']} TPTCV " . + "JOIN {$this->tables['executions']} E " . + "ON E.tcversion_id = TPTCV.tcversion_id " . + "AND E.testplan_id = TPTCV.testplan_id " . + "AND E.platform_id = TPTCV.platform_id "; + + // build up where clause + $where = "WHERE TPTCV.testplan_id = " . $safe['tplan_id']; + + $key2check = array( + 'builds' => 'build_id', + 'platforms' => 'platform_id' + ); + foreach ($key2check as $check => $field) { + if (! is_null($my['filters'][$check])) { + $where .= " AND E.$field IN (" . + implode(',', (array) $my['filters'][$check]) . ')'; + } + } + + $sql = $sex . $where; + + return $this->db->get_recordset($sql); + } + + /* + * + * @used-by + * + * + * @internal revisions + * @since 1.9.4 + */ + private function initQueryMetrics($tplanID, $filtersCfg, $optionsCfg) + { + $ic = array(); + + $ic['join'] = array(); + $ic['join']['ua'] = ''; + + $ic['where'] = array(); + $ic['where']['where'] = ''; + $ic['where']['platforms'] = ''; + + $ic['green_light'] = true; + + $ic['filters'] = array( + 'exec_ts_from' => null, + 'exec_ts_to' => null, + 'assigned_to' => null, + 'tester_id' => null, + 'keywords' => null, + 'builds' => null, + 'platforms' => null, + 'top_level_tsuites' => null + ); + + $ic['filters'] = array_merge($ic['filters'], (array) $filtersCfg); + + $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . + " MAX(EE.id) AS id " . " FROM {$this->tables['executions']} EE " . + " WHERE EE.testplan_id = " . $tplanID; + + $key2check = array( + 'builds' => 'build_id', + 'platforms' => 'platform_id' + ); + foreach ($key2check as $check => $field) { + $ic['where'][$check] = ''; + if (! is_null($ic['filters'][$check])) { + $sqlLEX .= " AND EE.$field IN (" . + implode(',', (array) $ic['filters'][$check]) . ')'; + $ic['where'][$check] = " AND TPTCV.$field IN (" . + implode(',', (array) $ic['filters'][$check]) . ')'; + } + } + $sqlLEX .= " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; + + if (! is_null($ic['filters']['keywords'])) { + list ($ic['join']['keywords'], $ic['where']['keywords']) = $this->helper_keywords_sql( + $ic['filters']['keywords'], array( + 'output' => 'array' + )); + + $ic['where']['where'] .= $ic['where']['keywords']; // **** // CHECK THIS CAN BE NON OK + } + + return array( + $ic, + $sqlLEX + ); + } + + /** + */ + public function getExecStatusMatrixFlat($id, $filters = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array(); + $my['opt'] = array( + 'getExecutionNotes' => false, + 'getTester' => false, + 'getUserAssignment' => false, + 'output' => null, + 'getExecutionTimestamp' => false, + 'getExecutionDuration' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + + list ($my, , , $union) = $this->helperBuildSQLTestSuiteExecCounters($id, + $filters, $my['opt']); + + $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */ " . + " {$union['exec']} UNION ALL {$union['not_run']} "; + + $rs = $this->db->get_recordset($sql); + + $ltx = null; + if (! is_null($rs)) { + $priorityCfg = config_get('urgencyImportance'); + $cache = array( + 'tsuite' => null, + 'tcase' => null + ); + + $loop2do = count($rs); + + for ($adx = 0; $adx < $loop2do; $adx ++) { + if (! isset($cache['tsuite'][$rs[$adx]['tsuite_id']])) { + $stairway2heaven = $this->tree_manager->get_path( + $rs[$adx]['tsuite_id'], null, 'name'); + $cache['tsuite'][$rs[$adx]['tsuite_id']] = implode("/", + $stairway2heaven); + } + $rs[$adx]['suiteName'] = $cache['tsuite'][$rs[$adx]['tsuite_id']]; + + if ($rs[$adx]['urg_imp'] >= $priorityCfg->threshold['high']) { + $rs[$adx]['priority_level'] = HIGH; + } elseif ($rs[$adx]['urg_imp'] < $priorityCfg->threshold['low']) { + $rs[$adx]['priority_level'] = LOW; + } else { + $rs[$adx]['priority_level'] = MEDIUM; + } + + $keyExists = isset( + $ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']]); + $doSet = ! $keyExists; + if ($keyExists) { + $doSet = ($ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']]['id'] < + $rs[$adx]['executions_id']); + } + if ($doSet) { + $ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']] = array( + 'id' => $rs[$adx]['executions_id'], + 'build_id' => $rs[$adx]['build_id'], + 'status' => $rs[$adx]['status'] + ); + } + } + } + + return array( + 'metrics' => $rs, + 'latestExec' => $ltx + ); + } + + /** + */ + private function helperStatusDomainMatrix(&$out, $rowKey, $colKey) + { + $totalByMatrix = array(); + + foreach ($out as &$elem) { + + $rowSet = array_keys($elem); + foreach ($rowSet as $rowID) { + + $colSet = array_keys($elem[$rowID]); + foreach ($colSet as $colID) { + $totalByMatrix[$rowID][$colID]['qty'] = 0; + foreach ($this->statusCode as $code) { + if (! isset($elem[$rowID][$colID][$code])) { + $elem[$rowID][$colID][$code] = array( + $rowKey => $rowID, + $colKey => $colID, + 'status' => $code, + 'exec_qty' => 0 + ); + } + $totalByMatrix[$rowID][$colID]['qty'] += $elem[$rowID][$colID][$code]['exec_qty']; + } + } + } + } + $out['total'] = $totalByMatrix; + } + + /** + */ + public function getBuildByPlatStatusForRender($id, + $totalKey = 'total_assigned') + { + $codeSet = $this->getStatusForReports(); + $labels = $this->resultsCfg['status_label']; + + $opt = array( + 'groupByPlatform' => true + ); + $metrics = $this->getExecCountersByBuildExecStatus($id, null, $opt); + + // Creating item list this way will generate a row also for + // ACTIVE BUILDS were ALL TEST CASES HAVE NO TESTER ASSIGNMENT + // $buildList = array_keys($metrics['active_builds']); + + // Creating item list this way will generate a row ONLY FOR + // ACTIVE BUILDS were TEST CASES HAVE TESTER ASSIGNMENT + if (! is_null($metrics)) { + $renObj = new stdClass(); + $renObj->info = array(); + + $mwt = &$metrics['with_tester']; + foreach ($mwt as $platID => $buildMetrics) { + foreach ($buildMetrics as $buildID => $met) { + $totalRun = 0; + $yo = &$renObj->info[$platID][$buildID]; + $yo['build_name'] = $metrics['active_builds'][$buildID]['name']; + $yo[$totalKey] = $metrics['total'][$platID][$buildID]['qty']; + $yo['details'] = array(); + + $rf = &$yo['details']; + foreach ($codeSet as $cCode => $code4h) { + $rf[$code4h] = array( + 'qty' => 0, + 'percentage' => 0 + ); + $rf[$code4h]['qty'] = $buildMetrics[$buildID][$cCode]['exec_qty']; + + if ($yo[$totalKey] > 0) { + $rf[$code4h]['percentage'] = number_format( + 100 * ($rf[$code4h]['qty'] / $yo[$totalKey]), 1); + } + } + } + } + + foreach ($codeSet as $human) { + $l10n = isset($labels[$human]) ? lang_get($labels[$human]) : lang_get( + $human); + $renObj->colDefinition[$human]['qty'] = $l10n; + $renObj->colDefinition[$human]['percentage'] = '[%]'; + } + + // Last step: get completness percentages + $platList = array_keys($renObj->info); + $tk = 'total_assigned'; + foreach ($platList as $platID) { + $itemList = array_keys($renObj->info[$platID]); + foreach ($itemList as $itemID) { + if (isset($renObj->info[$platID])) { + $totalRun = 0; + $rf = &$renObj->info[$platID][$itemID]['details']; + $doPerc = ($renObj->info[$platID][$itemID][$tk] > 0); + foreach ($codeSet as $c4human) { + $totalRun += ($c4human == 'not_run' ? 0 : $rf[$c4human]['qty']); + } + if ($doPerc) { + $renObj->info[$platID][$itemID]['percentage_completed'] = number_format( + 100 * + ($totalRun / $renObj->info[$platID][$itemID][$tk]), + 1); + } + } + } + } + } + return $renObj; + } + + /** + */ + public function getNeverRunByPlatform($tplanID, $platformSet = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safeID = intval($tplanID); + + $fullEID = $this->helperConcatTCasePrefix($safeID); + + // Because we now allow assignment of MULTIPLE testers to same test case + // we need to remove UA.user_id, in order to avoid duplication + // UA.user_id, + // we will need a second step to populate this info. + // + $sql = "/* {$debugMsg} Not Run */" . "SELECT COUNT(0) AS qty, " . + " NHTC.parent_id AS tsuite_id, " . + " NHTC.id AS tcase_id, TPTCV.platform_id, " . + " NHTC.name AS name, PLAT.name AS platform_name, " . + " $fullEID AS full_external_id " . + " FROM {$this->tables['testplan_tcversions']} TPTCV " . + + " JOIN {$this->tables['builds']} B " . + " ON B.testplan_id = TPTCV.testplan_id " . + + /* Get Test Case info from Test Case Version */ + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND E.status='{$status}' " . - $builds->whereAddExec; - - - switch($my['opt']['output']) - { - case 'array': - $dummy = (array)$this->db->get_recordset($sql); - break; - - case 'mapByExecID': - $dummy = (array)$this->db->fetchRowsIntoMap($sql,'executions_id'); - break; - - - case 'map': - default: - $keyColumns = array('tsuite_id','tcase_id','platform_id','build_id'); - $dummy = (array)$this->db->fetchRowsIntoMap4l($sql,$keyColumns); - break; - } - - return $dummy; - - } - - - /** - * get just Not Run test case on test plan, but ONLY THESE - * that has tester assigned. - * This is critic: - * - * example: - * test plan with 11 test cases linked. - * two Builds B1, B2 - * 1. Assign tester to all test cases on BUILD B1 - * 2. run getNotRunWithTesterAssigned() - * you will get 11 records all for B1 - * - * 3. Assign tester to 4 test cases on BUILD B2 - * 4. run getNotRunWithTesterAssigned() - * you will get: 15 records - * 11 records for B1 - * 4 records for B2 - * - * @param int $id test plan id - * @param char $status status code (one char) - * @param mixed $filters - * keys: 'buildSet' - * - * @param mixed opt - * keys: 'output' elem domain 'map','array' - * - */ - function getNotRunWithTesterAssigned($id,$filters=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - - - // particular options - $my['opt'] = array_merge(array('output' => 'map'),$my['opt']); - $safe_id = intval($id); - - $fullEID = $this->helperConcatTCasePrefix($safe_id); - // $sqlLEBBP = $sqlStm['LEBBP']; - - // Because we now allow assignment of MULTIPLE testers to same test case - // we need to remove UA.user_id, in order to avoid duplication - // UA.user_id, - // we will need a second step to populate this info. - // - $sql = "/* {$debugMsg} Not Run */" . - " SELECT DISTINCT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . - " TPTCV.tcversion_id,TPTCV.platform_id,TPTCV.id AS feature_id," . - " TCV.version AS tcversion_number, B.id AS build_id," . - " '{$this->notRunStatusCode}' AS status, " . - " TCV.version,TCV.tc_external_id AS external_id, " . - " $fullEID AS full_external_id," . - " (TPTCV.urgency * TCV.importance) AS urg_imp, TCV.summary " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B " . - " ON B.testplan_id = TPTCV.testplan_id " . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = B.id " . - " AND UA.type = {$this->execTaskCode} " . - - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = B.id ". - - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND E.id IS NULL " . - " AND B.id IN ({$builds->inClause}) "; - - - switch($my['opt']['output']) - { - case 'array': - $dummy = (array)$this->db->get_recordset($sql); - - // Second Loop - // get features to get testers - if(!is_null($dummy)) - { - // will try with a query - $sql = "/* {$debugMsg} Not Run */" . - " SELECT UA.user_id, UA.feature_id,UA.build_id" . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B " . - " ON B.testplan_id = TPTCV.testplan_id " . - - " JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = B.id " . - " AND UA.type = {$this->execTaskCode} " . - - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = B.id ". - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND E.id IS NULL " . - " AND B.id IN ({$builds->inClause}) "; - - $dx = (array)$this->db->get_recordset($sql); - - $l2do = count($dx); - $loop2do = count($dummy); - for($vdx=0; $vdx < $l2do; $vdx++) - { - for($fdx=0; $fdx < $loop2do; $fdx++) - { - if($dummy[$fdx]['feature_id'] == $dx[$vdx]['feature_id'] && - $dummy[$fdx]['build_id'] == $dx[$vdx]['build_id'] - ) - { - $dummy[$fdx]['user_id'][$dx[$vdx]['user_id']] = $dx[$vdx]['user_id']; - break; - } - } - } - - } - - - break; - - case 'map': - default: - throw new Exception("NOT REFACTORED YET for output 'map'", 1); - $keyColumns = array('tsuite_id','tcase_id','platform_id','build_id'); - $dummy = (array)$this->db->fetchRowsIntoMap4l($sql,$keyColumns); - break; - } - - return $dummy; - - } - - - /* - * - * @used-by lib/results/testCasesWithoutTester.php - * - * IMPORTANT NOTICE - * When doing count() with having, if there are platforms defined - * we have to consider for having clause BuildQty * PlatformQty, - * or we are going to get WRONG results. - */ - function getNotRunWOTesterAssigned($id,$buildSet=null,$filters=null,$opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - list($safe_id,$buildsCfg,$sqlLEX) = $this->helperGetHits($id,null,$buildSet, - array('ignorePlatform' => true)); - // particular options - $my['opt'] = array_merge(array('output' => 'map','ignoreBuild' => false),$my['opt']); - $safe_id = intval($id); - - $fullEID = $this->helperConcatTCasePrefix($safe_id); - - // $sqlLEBBP = $sqlStm['LEBBP']; - $add2select = ' DISTINCT '; - $buildInfo = ''; - - // 20130106 - TICKET 5451 - added A_TPTCV.platform_id on GROUP BY - // this query try to indentify test cases that has NO ASSIGNMENT ON ALL Builds - // for EACH PLATFORM. - $sqlc = "/* $debugMsg */ " . - " SELECT count(0) AS TESTER_COUNTER ,A_NHTCV.parent_id AS tcase_id,A_TPTCV.platform_id " . - " FROM {$this->tables['testplan_tcversions']} A_TPTCV " . - " JOIN {$this->tables['builds']} A_B ON A_B.testplan_id = A_TPTCV.testplan_id " . - str_replace('B.active','A_B.active',$buildsCfg['statusClause']) . - - " JOIN {$this->tables['nodes_hierarchy']} A_NHTCV ON " . - " A_NHTCV.id = A_TPTCV.tcversion_id " . - - " LEFT OUTER JOIN {$this->tables['executions']} A_E " . - " ON A_E.testplan_id = A_TPTCV.testplan_id " . - " AND A_E.platform_id = A_TPTCV.platform_id " . - " AND A_E.tcversion_id = A_TPTCV.tcversion_id " . - " AND A_E.build_id = A_B.id " . - - " LEFT OUTER JOIN {$this->tables['user_assignments']} A_UA " . - " ON A_UA.feature_id = A_TPTCV.id " . - " AND A_UA.build_id = A_B.id " . - " AND A_UA.type = {$this->execTaskCode} " . - - " WHERE A_TPTCV.testplan_id = " . $safe_id . - " AND A_E.status IS NULL " . - " AND A_UA.user_id IS NULL "; - - - // http://stackoverflow.com/questions/7511064/postresql-aliases-column-and-having - // - //if( DB_TYPE == 'mssql' ) - //{ - // $sqlc .= " GROUP BY tcase_id " . - // " HAVING TESTER_COUNTER = " . intval($buildsCfg['count']) ; - //} - //else - //{ - // $sqlc .= " GROUP BY A_NHTCV.parent_id " . - // " HAVING count(0) = " . intval($buildsCfg['count']) ; - //} - $sqlc .= " GROUP BY A_NHTCV.parent_id, A_TPTCV.platform_id " . - " HAVING count(0) = " . intval($buildsCfg['count']) ; - - - $sql = "/* {$debugMsg} Not Run */" . - " SELECT $add2select NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name," . - " TPTCV.tcversion_id,TPTCV.platform_id," . - " TCV.version AS tcversion_number, {$buildInfo}" . - " '{$this->notRunStatusCode}' AS status, " . - " TCV.version,TCV.tc_external_id AS external_id, " . - " $fullEID AS full_external_id,UA.user_id," . - " (TPTCV.urgency * TCV.importance) AS urg_imp, TCV.summary " . - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - - " JOIN {$this->tables['builds']} B " . - " ON B.testplan_id = TPTCV.testplan_id " . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = TPTCV.tcversion_id " . - - " JOIN ({$sqlc}) AS NR " . - " ON NR.tcase_id = NHTC.id " . - - " LEFT OUTER JOIN {$this->tables['user_assignments']} UA " . - " ON UA.feature_id = TPTCV.id " . - " AND UA.build_id = B.id " . - " AND UA.type = {$this->execTaskCode} " . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.tcversion_id = TPTCV.tcversion_id " . - " AND E.build_id = B.id ". - - - " WHERE TPTCV.testplan_id=" . $safe_id . - " AND E.id IS NULL AND UA.user_id IS NULL " . - - // 20130106 - TICKET 5451 - added CONDITION ON NR.platform_id - " AND B.id IN ({$builds->inClause}) AND TPTCV.platform_id = NR.platform_id "; - - switch($my['opt']['output']) - { - case 'array': - $dummy = $this->db->get_recordset($sql); - break; - - case 'map': - default: - $keyColumns = array('tsuite_id','tcase_id','platform_id','build_id'); - $dummy = $this->db->fetchRowsIntoMap4l($sql,$keyColumns); - break; - } - return (array)$dummy; - } - - - - /** - * - * @internal revisions - * - * @since 1.9.4 - */ - function helperGetUserIdentity($idSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " SELECT id,login,first,last " . - " FROM {$this->tables['users']}"; - - $inClause = ''; - if( !is_null($idSet) && ((array)$idSet >0)) - { - if( ($dummy=implode(',',(array)$idSet)) != '' ) - { - $inClause = " WHERE id IN ({$dummy}) "; - } - } - - $rs = $this->db->fetchRowsIntoMap($sql . $inClause,'id'); - return $rs; - } - - - /** - * - * @used-by /lib/results/resultsMoreBuilds.php - * - * @internal revisions - * - * @since 1.9.4 - */ - function queryMetrics($id,$filters=null,$options=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $safe = array(); - $safe['tplan_id'] = intval($id); - - $my = array(); - list($my,$sqlLEX) = $this->initQueryMetrics($safe['tplan_id'],$filters,$options); - - - // ------------------------------------------------------------------------------------------- - // We will work always using last execution result as filter criteria. - // ------------------------------------------------------------------------------------------- - - // we will need a union to manage 'not run' (remember this status is NEVER WRITTEN to DB) - // and other statuses - // This logic have been borrowed from testplan.class.php - getLinkedForExecTree(). - // - $key2check = array('builds' => 'build_id', 'platforms' => 'platform_id'); - $ejoin = array(); - foreach($key2check as $check => $field) - { - $ejoin[$check] = is_null($my['filters'][$check]) ? '' : - " AND E.$field IN (" . implode(',',(array)$my['filters'][$check]) . ')'; - } - - - - $union['not_run'] = "/* {$debugMsg} sqlUnion - not run */" . - " SELECT NH_TCASE.id AS tcase_id,TPTCV.tcversion_id,TCV.version," . - " TCV.tc_external_id AS external_id, " . - " COALESCE(E.status,'" . $this->notRunStatusCode . "') AS exec_status " . - - " FROM {$this->tables['testplan_tcversions']} TPTCV " . - " JOIN {$this->tables['tcversions']} TCV ON TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = TPTCV.tcversion_id " . - " JOIN {$this->tables['nodes_hierarchy']} NH_TCASE ON NH_TCASE.id = NH_TCV.parent_id " . - $my['join']['ua'] . - $my['join']['keywords'] . - " LEFT OUTER JOIN {$this->tables['platforms']} PLAT ON PLAT.id = TPTCV.platform_id " . - - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id ON LEFT OUTER see WHERE */ " . - " LEFT OUTER JOIN ({$sqlLEX}) AS LEX " . - " ON LEX.testplan_id = TPTCV.testplan_id " . - " AND LEX.tcversion_id = TPTCV.tcversion_id " . - " AND LEX.platform_id = TPTCV.platform_id " . - " AND LEX.testplan_id = " . $safe['tplan_id'] . - " LEFT OUTER JOIN {$this->tables['executions']} E " . - " ON E.tcversion_id = TPTCV.tcversion_id " . - " AND E.testplan_id = TPTCV.testplan_id " . - " AND E.platform_id = TPTCV.platform_id " . - " AND E.build_id = " . $my['filters']['build_id'] . - - " WHERE TPTCV.testplan_id =" . $safe['tplan_id'] . - $my['where']['where'] . - " /* Get REALLY NOT RUN => BOTH LE.id AND E.id NULL */ " . - " AND E.id IS NULL AND LEX.id IS NULL"; - - - // executions - $sex = "/* $debugMsg */" . - "SELECT E.status,E.notes,E.tcversion_number,E.execution_ts,E.build_id,E.platform_id " . - "FROM {$this->tables['testplan_tcversions']} TPTCV " . - "JOIN {$this->tables['executions']} E " . - "ON E.tcversion_id = TPTCV.tcversion_id " . - "AND E.testplan_id = TPTCV.testplan_id " . - "AND E.platform_id = TPTCV.platform_id "; - - - - // build up where clause - $where = "WHERE TPTCV.testplan_id = " . $safe['tplan_id']; - - $key2check = array('builds' => 'build_id', 'platforms' => 'platform_id'); - foreach($key2check as $check => $field) - { - if( !is_null($my['filters'][$check]) ) - { - $where .= " AND E.$field IN (" . implode(',',(array)$my['filters'][$check]) . ')'; - } - } - - $sql = $sex . $where; - - // echo $sql; - $rs = $this->db->get_recordset($sql); - return $rs; - } - - - - /* - * - * @used-by - * - * - * @internal revisions - * @since 1.9.4 - */ - function initQueryMetrics($tplanID,$filtersCfg,$optionsCfg) - { - $ic = array(); - - $ic['join'] = array(); - $ic['join']['ua'] = ''; - - $ic['where'] = array(); - $ic['where']['where'] = ''; - $ic['where']['platforms'] = ''; - - $ic['green_light'] = true; - - $ic['filters'] = array('exec_ts_from' => null, 'exec_ts_to' => null, - 'assigned_to' => null, 'tester_id' => null, - 'keywords' => null, 'builds' => null, - 'platforms' => null, 'top_level_tsuites' => null); - - $ic['filters'] = array_merge($ic['filters'],(array)$filtersCfg); - - - // --------------------------------------------------------------------------------------------- - $sqlLEX = " SELECT EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id," . - " MAX(EE.id) AS id " . - " FROM {$this->tables['executions']} EE " . - " WHERE EE.testplan_id = " . $tplanID; - - $key2check = array('builds' => 'build_id', 'platforms' => 'platform_id'); - foreach($key2check as $check => $field) - { - $ic['where'][$check] = ''; - if( !is_null($ic['filters'][$check]) ) - { - $sqlLEX .= " AND EE.$field IN (" . implode(',',(array)$ic['filters'][$check]) . ')'; - $ic['where'][$check] = " AND TPTCV.$field IN (" . implode(',',(array)$ic['filters'][$check]) . ')'; - } - } - $sqlLEX .= " GROUP BY EE.tcversion_id,EE.testplan_id,EE.platform_id,EE.build_id "; - // --------------------------------------------------------------------------------------------- - - if( !is_null($ic['filters']['keywords']) ) - { - list($ic['join']['keywords'],$ic['where']['keywords']) = - $this->helper_keywords_sql($ic['filters']['keywords'],array('output' => 'array')); - - $ic['where']['where'] .= $ic['where']['keywords']; // **** // CHECK THIS CAN BE NON OK - } - - - return array($ic,$sqlLEX); - } - - /** - * - * - */ - function getExecStatusMatrixFlat($id, $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array(); - $my['opt'] = array('getExecutionNotes' => false, 'getTester' => false, - 'getUserAssignment' => false, 'output' => null, - 'getExecutionTimestamp' => false, 'getExecutionDuration' => false); - - $my['opt'] = array_merge($my['opt'], (array)$opt); - $safe_id = intval($id); - list($my,$builds,$sqlStm,$union) = $this->helperBuildSQLTestSuiteExecCounters($id, $filters, $my['opt']); - - $sql = " /* {$debugMsg} UNION WITH ALL CLAUSE */ " . - " {$union['exec']} UNION ALL {$union['not_run']} "; - - //echo $sql; - $rs = $this->db->get_recordset($sql); - // new dBug($rs); - - $ltx = null; - if(!is_null($rs)) - { - $priorityCfg = config_get('urgencyImportance'); - $cache = array('tsuite' => null, 'tcase' => null); - - $loop2do = count($rs); - $gnOpt = array('fields' => 'name'); - - for($adx=0; $adx < $loop2do; $adx++) - { - if(!isset($cache['tsuite'][$rs[$adx]['tsuite_id']])) - { - $stairway2heaven = $this->tree_manager->get_path($rs[$adx]['tsuite_id'],null,'name'); - $cache['tsuite'][$rs[$adx]['tsuite_id']] = implode("/",$stairway2heaven); - } - $rs[$adx]['suiteName'] = $cache['tsuite'][$rs[$adx]['tsuite_id']]; - - if($rs[$adx]['urg_imp'] >= $priorityCfg->threshold['high']) - { - $rs[$adx]['priority_level'] = HIGH; - } - else if( $rs[$adx]['urg_imp'] < $priorityCfg->threshold['low']) - { - $rs[$adx]['priority_level'] = LOW; - } - else - { - $rs[$adx]['priority_level'] = MEDIUM; - } - - $kyy = $rs[$adx]['platform_id'] . '-' . $rs[$adx]['tcase_id']; - - // $keyExists = isset($ltx[$kyy]); - $keyExists = isset($ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']]); - $doSet = !$keyExists; - if( $keyExists ) - { - $doSet = ($ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']]['id'] < - $rs[$adx]['executions_id']); - } - if( $doSet ) - { - $ltx[$rs[$adx]['platform_id']][$rs[$adx]['tcase_id']] = - array('id' => $rs[$adx]['executions_id'],'build_id' => $rs[$adx]['build_id'], - 'status' => $rs[$adx]['status']); - } - } - } - //new dBug($cache); - //new dBug($rs); - //new dBug($ltx); - - return array('metrics' => $rs, 'latestExec' => $ltx); - } - - - /** - * - * - * - * - */ - function helperStatusDomainMatrix(&$out,$rowKey,$colKey) { - $totalByMatrix = array(); - - foreach($out as &$elem) { - - $rowSet = array_keys($elem); - foreach($rowSet as $rowID) { - - $colSet = array_keys($elem[$rowID]); - foreach($colSet as $colID) { - $totalByMatrix[$rowID][$colID]['qty'] = 0; - foreach($this->statusCode as $verbose => $code) { - if(!isset($elem[$rowID][$colID][$code])) { - $elem[$rowID][$colID][$code] = - array($rowKey => $rowID, $colKey => $colID, - 'status' => $code, 'exec_qty' => 0); - } - $totalByMatrix[$rowID][$colID]['qty'] += - $elem[$rowID][$colID][$code]['exec_qty']; - } - } - } - } - $out['total'] = $totalByMatrix; - } - - /** - * - * NEWZ - **/ - function getBuildByPlatStatusForRender($id, $totalKey='total_assigned') { - - $renderObj = null; - $codeSet = $this->getStatusForReports(); - $labels = $this->resultsCfg['status_label']; - - $opt = array('groupByPlatform' => true); - $metrics = $this->getExecCountersByBuildExecStatus($id,null,$opt); - - // Creating item list this way will generate a row also for - // ACTIVE BUILDS were ALL TEST CASES HAVE NO TESTER ASSIGNMENT - // $buildList = array_keys($metrics['active_builds']); - - // Creating item list this way will generate a row ONLY FOR - // ACTIVE BUILDS were TEST CASES HAVE TESTER ASSIGNMENT - if( !is_null($metrics) ) { - $renObj = new stdClass(); - $renObj->info = array(); - - $platList = array_keys($metrics['with_tester']); - $mwt = &$metrics['with_tester']; - foreach( $mwt as $platID => $buildMetrics ) { - foreach($buildMetrics as $buildID => $met ) { - $totalRun = 0; - $yo = &$renObj->info[$platID][$buildID]; - $yo['build_name'] = - $metrics['active_builds'][$buildID]['name']; - $yo[$totalKey] = - $metrics['total'][$platID][$buildID]['qty']; - $yo['details'] = array(); - - $rf = &$yo['details']; - foreach($codeSet as $cCode => $code4h) { - $rf[$code4h] = array('qty' => 0, 'percentage' => 0); - $rf[$code4h]['qty'] = $buildMetrics[$buildID][$cCode]['exec_qty']; - - if( $yo[$totalKey] > 0 ) { - $rf[$code4h]['percentage'] = - number_format(100 * ($rf[$code4h]['qty'] / $yo[$totalKey]),1); - } - //$totalRun += - // $code4h == 'not_run' ? 0 : $rf[$code4h]['qty']; - } - } - } - - foreach($codeSet as $human) { - $l10n = isset($labels[$human]) ? lang_get($labels[$human]) : lang_get($human); - $renObj->colDefinition[$human]['qty'] = $l10n; - $renObj->colDefinition[$human]['percentage'] = '[%]'; - } - - // Last step: get completness percentages - $platList = array_keys($renObj->info); - $tk = 'total_assigned'; - foreach($platList as $platID) { - $itemList = array_keys($renObj->info[$platID]); - foreach($itemList as $itemID) { - if( isset($renObj->info[$platID]) ) { - $totalRun = 0; - $rf = &$renObj->info[$platID][$itemID]['details']; - $doPerc = ($renObj->info[$platID][$itemID][$tk] > 0); - foreach($codeSet as $sCode => $c4human) { - $totalRun += ($c4human == 'not_run' ? 0 : - $rf[$c4human]['qty']); - } - if($doPerc) { - $renObj->info[$platID][$itemID]['percentage_completed'] = - number_format(100 * - ($totalRun/$renObj->info[$platID][$itemID][$tk]),1); - } - } - } - } - } - return $renObj; - } - - /** - * - * - */ - function getNeverRunByPlatform($tplanID,$platformSet=null) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeID = intval($tplanID); - - $fullEID = $this->helperConcatTCasePrefix($safeID); - - // Because we now allow assignment of MULTIPLE testers to same test case - // we need to remove UA.user_id, in order to avoid duplication - // UA.user_id, - // we will need a second step to populate this info. - // - $sql = "/* {$debugMsg} Not Run */" . - "SELECT COUNT(0) AS qty, - NHTC.parent_id AS tsuite_id, - NHTC.id AS tcase_id, TPTCV.platform_id, - NHTC.name AS name, PLAT.name AS platform_name, - $fullEID AS full_external_id - FROM {$this->tables['testplan_tcversions']} TPTCV - - JOIN {$this->tables['builds']} B - ON B.testplan_id = TPTCV.testplan_id + /* Get Test Suite info from Test Case */ + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . - /* Get Test Case info from Test Case Version */ - JOIN {$this->tables['nodes_hierarchy']} NHTCV - ON NHTCV.id = TPTCV.tcversion_id - - /* Get Test Suite info from Test Case */ - JOIN {$this->tables['nodes_hierarchy']} NHTC - ON NHTC.id = NHTCV.parent_id - /* Get Test Case Version attributes */ - JOIN {$this->tables['tcversions']} TCV - ON TCV.id = TPTCV.tcversion_id - - JOIN {$this->tables['platforms']} PLAT - ON PLAT.id = TPTCV.platform_id - - - LEFT OUTER JOIN {$this->tables['executions']} E - ON E.testplan_id = TPTCV.testplan_id - AND E.platform_id = TPTCV.platform_id - AND E.tcversion_id = TPTCV.tcversion_id - AND E.build_id = B.id - - WHERE TPTCV.testplan_id=$safeID - AND E.id IS NULL"; - - if( null != $platformSet ) { - $sql .= " AND TPTCV.platform_id IN (" . - implode(",", $platformSet) . ")"; - } - $sql .= " GROUP BY tsuite_id, tcase_id, - TPTCV.platform_id,NHTC.name,platform_name, - full_external_id "; - - $buildSet = $this->get_builds($safeID,testplan::ACTIVE_BUILDS, - testplan::OPEN_BUILDS); - - $sql .= " HAVING COUNT(0) = " . count($buildSet); - $sql .= " ORDER BY platform_name,full_external_id "; - - return $this->db->get_recordset($sql); - } - - - /** - * - * - * - * - */ - function getLatestExecOnSinglePlatformMatrix($id, $platform_id, - $filters=null, $opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my = array(); - $my['opt'] = array('getExecutionNotes' => TRUE, - 'getTester' => false, - 'getUserAssignment' => false, - 'output' => null, - 'getExecutionTimestamp' => false, - 'getExecutionDuration' => false); - - $my['opt'] = array_merge($my['opt'], (array)$opt); - $safe_id = intval($id); - list($my,$builds,$sqlStm,$union) = $this->buildSQLTSLatestExecOneSinglePlatform($id, $platform_id,$filters, $my['opt']); - - $sql = " /* {$debugMsg} {$union['exec']} "; - - $keyColumns = array('tsuite_id','tcase_id','platform_id'); - $cumulative = true; - $dummy = (array)$this->db->fetchRowsIntoMap3l($sql,$keyColumns,$cumulative); - - unset($sqlStm); - unset($union); - unset($my); - unset($builds); - - // now is time do some decoding - // Key is a tuple (PARENT tsuite_id, test case id, platform id) - // - $item2loop = array_keys($dummy); - $stairway2heaven = null; - $pathway = null; - $latestExec = null; - $priorityCfg = config_get('urgencyImportance'); - - foreach ($item2loop as $item_id) { - $stairway2heaven = $this->tree_manager->get_path($item_id,null,'name'); - $pathway[$item_id] = implode("/",$stairway2heaven); - unset($stairway2heaven); - - // go inside test case - $tcase2loop = array_keys($dummy[$item_id]); - foreach($tcase2loop as $tcase_id) { - $platform2loop = array_keys($dummy[$item_id][$tcase_id]); - foreach($platform2loop as $platform_id) { - $rf = &$dummy[$item_id][$tcase_id][$platform_id][0]; - $rf['suiteName'] = $pathway[$item_id]; - - // --------------------------------------------------- - // Now we need to get priority LEVEL from - // (urgency * impact) - // we do not use a function to improve performance - if ($rf['urg_imp'] >= $priorityCfg->threshold['high']) { - $rf['priority_level'] = HIGH; - } else if($rf['urg_imp'] < $priorityCfg->threshold['low']) { - $rf['priority_level'] = LOW; - } else { - $rf['priority_level'] = MEDIUM; - } - } // $platform2loop - } // $tcase2loop - - unset($tcase2loop); - unset($platform2loop); - } // - - unset($pathway); - return $dummy; - } - - /** - * - * - */ - function getNeverRunOnTestPlanWithoutPlatforms($tplanID) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeID = intval($tplanID); - - $fullEID = $this->helperConcatTCasePrefix($safeID); - - // Because we now allow assignment of MULTIPLE testers to same test case - // we need to remove UA.user_id, in order to avoid duplication - // UA.user_id, - // we will need a second step to populate this info. - // - $sql = "/* {$debugMsg} Not Run */ + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = TPTCV.tcversion_id " . + + " JOIN {$this->tables['platforms']} PLAT " . + " ON PLAT.id = TPTCV.platform_id " . + + " LEFT OUTER JOIN {$this->tables['executions']} E " . + " ON E.testplan_id = TPTCV.testplan_id " . + " AND E.platform_id = TPTCV.platform_id " . + " AND E.tcversion_id = TPTCV.tcversion_id " . + " AND E.build_id = B.id " . " WHERE TPTCV.testplan_id=$safeID " . + " AND E.id IS NULL"; + + if (null != $platformSet) { + $sql .= " AND TPTCV.platform_id IN (" . implode(",", $platformSet) . + ")"; + } + $sql .= " GROUP BY tsuite_id, tcase_id, " . + " TPTCV.platform_id,NHTC.name,platform_name, " . " full_external_id "; + + $buildSet = $this->get_builds($safeID, testplan::ACTIVE_BUILDS, + testplan::OPEN_BUILDS); + + $sql .= " HAVING COUNT(0) > " . count($buildSet) - 1; + $sql .= " ORDER BY platform_name,full_external_id "; + + return $this->db->get_recordset($sql); + } + + /** + */ + public function getLatestExecOnSinglePlatformMatrix($id, $platform_id, + $filters = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my = array(); + $my['opt'] = array( + 'getExecutionNotes' => true, + 'getTester' => false, + 'getUserAssignment' => false, + 'output' => null, + 'getExecutionTimestamp' => false, + 'getExecutionDuration' => false + ); + + $my['opt'] = array_merge($my['opt'], (array) $opt); + list ($my, $builds, $sqlStm, $union) = $this->buildSQLTSLatestExecOneSinglePlatform( + $id, $platform_id, $filters, $my['opt']); + + $sql = " /* {$debugMsg} {$union['exec']} "; + + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id' + ); + $cumulative = true; + $dummy = (array) $this->db->fetchRowsIntoMap3l($sql, $keyColumns, + $cumulative); + + unset($sqlStm); + unset($union); + unset($my); + unset($builds); + + // now is time do some decoding + // Key is a tuple (PARENT tsuite_id, test case id, platform id) + // + $item2loop = array_keys($dummy); + $stairway2heaven = null; + $pathway = null; + $priorityCfg = config_get('urgencyImportance'); + + foreach ($item2loop as $item_id) { + $stairway2heaven = $this->tree_manager->get_path($item_id, null, + 'name'); + $pathway[$item_id] = implode("/", $stairway2heaven); + unset($stairway2heaven); + + // go inside test case + $tcase2loop = array_keys($dummy[$item_id]); + foreach ($tcase2loop as $tcase_id) { + $platform2loop = array_keys($dummy[$item_id][$tcase_id]); + foreach ($platform2loop as $platform_id) { + $rf = &$dummy[$item_id][$tcase_id][$platform_id][0]; + $rf['suiteName'] = $pathway[$item_id]; + + // Now we need to get priority LEVEL from + // (urgency * impact) + // we do not use a function to improve performance + if ($rf['urg_imp'] >= $priorityCfg->threshold['high']) { + $rf['priority_level'] = HIGH; + } elseif ($rf['urg_imp'] < $priorityCfg->threshold['low']) { + $rf['priority_level'] = LOW; + } else { + $rf['priority_level'] = MEDIUM; + } + } + } + + unset($tcase2loop); + unset($platform2loop); + } + + unset($pathway); + return $dummy; + } + + /** + */ + private function getNeverRunOnTestPlanWithoutPlatforms($tplanID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safeID = intval($tplanID); + + $fullEID = $this->helperConcatTCasePrefix($safeID); + + // Because we now allow assignment of MULTIPLE testers to same test case + // we need to remove UA.user_id, in order to avoid duplication + // UA.user_id, + // we will need a second step to populate this info. + // + $sql = "/* {$debugMsg} Not Run */ SELECT COUNT(0) AS qty, NHTC.parent_id AS tsuite_id, NHTC.id AS tcase_id, NHTC.name AS name, $fullEID AS full_external_id - FROM {$this->tables['testplan_tcversions']} TPTCV - + FROM {$this->tables['testplan_tcversions']} TPTCV + JOIN {$this->tables['builds']} B - ON B.testplan_id = TPTCV.testplan_id + ON B.testplan_id = TPTCV.testplan_id - /* Get Test Case info from Test Case Version */ - JOIN {$this->tables['nodes_hierarchy']} NHTCV + /* Get Test Case info from Test Case Version */ + JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id - - /* Get Test Suite info from Test Case */ + + /* Get Test Suite info from Test Case */ JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id - + /* Get Test Case Version attributes */ JOIN {$this->tables['tcversions']} TCV - ON TCV.id = TPTCV.tcversion_id + ON TCV.id = TPTCV.tcversion_id - LEFT OUTER JOIN {$this->tables['executions']} E + LEFT OUTER JOIN {$this->tables['executions']} E ON E.testplan_id = TPTCV.testplan_id AND E.tcversion_id = TPTCV.tcversion_id AND E.build_id = B.id - - WHERE TPTCV.testplan_id=$safeID - AND E.id IS NULL"; - - $sql .= " GROUP BY tsuite_id, tcase_id, NHTC.name, - full_external_id "; - - $buildSet = $this->get_builds($safeID,testplan::ACTIVE_BUILDS, - testplan::OPEN_BUILDS); - - $sql .= " HAVING COUNT(0) = " . count($buildSet); - - // echo $sql; - return $this->db->get_recordset($sql); - } - - - /** - * - * - */ - function getNeverRunOnSinglePlatform($tplanID,$platformID,$opt=null) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $safeID = intval($tplanID); - - $fullEID = $this->helperConcatTCasePrefix($safeID); - $notRunCode = $this->resultsCfg['status_code']['not_run']; - // Because we now allow assignment of MULTIPLE testers to same test case - // we need to remove UA.user_id, in order to avoid duplication - // UA.user_id, - // we will need a second step to populate this info. - // - $sql = "/* {$debugMsg} Not Run */" . - "SELECT COUNT(0) AS qty, + WHERE TPTCV.testplan_id=$safeID + AND E.id IS NULL"; + + $sql .= " GROUP BY tsuite_id, tcase_id, NHTC.name, + full_external_id "; + + $buildSet = $this->get_builds($safeID, testplan::ACTIVE_BUILDS, + testplan::OPEN_BUILDS); + + $sql .= " HAVING COUNT(0) = " . count($buildSet); + + return $this->db->get_recordset($sql); + } + + /** + */ + public function getNeverRunOnSinglePlatform($tplanID, $platformID, + $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + $safeID = intval($tplanID); + + $fullEID = $this->helperConcatTCasePrefix($safeID); + $notRunCode = $this->resultsCfg['status_code']['not_run']; + + // Because we now allow assignment of MULTIPLE testers to same test case + // we need to remove UA.user_id, in order to avoid duplication + // UA.user_id, + // we will need a second step to populate this info. + // + $sql = "/* {$debugMsg} Not Run */" . + "SELECT COUNT(0) AS qty, NHTC.parent_id AS tsuite_id, NHTC.id AS tcase_id, TPTCV.platform_id, NHTC.name AS name, PLAT.name AS platform_name, @@ -3191,468 +3086,460 @@ function getNeverRunOnSinglePlatform($tplanID,$platformID,$opt=null) TCV.version,TCV.execution_type AS exec_type, (TPTCV.urgency * TCV.importance) AS urg_imp, '{$notRunCode}' AS status - FROM {$this->tables['testplan_tcversions']} TPTCV - + FROM {$this->tables['testplan_tcversions']} TPTCV + JOIN {$this->tables['builds']} B - ON B.testplan_id = TPTCV.testplan_id + ON B.testplan_id = TPTCV.testplan_id - /* Get Test Case info from Test Case Version */ - JOIN {$this->tables['nodes_hierarchy']} NHTCV + /* Get Test Case info from Test Case Version */ + JOIN {$this->tables['nodes_hierarchy']} NHTCV ON NHTCV.id = TPTCV.tcversion_id - - /* Get Test Suite info from Test Case */ + + /* Get Test Suite info from Test Case */ JOIN {$this->tables['nodes_hierarchy']} NHTC ON NHTC.id = NHTCV.parent_id - + /* Get Test Case Version attributes */ JOIN {$this->tables['tcversions']} TCV - ON TCV.id = TPTCV.tcversion_id + ON TCV.id = TPTCV.tcversion_id JOIN {$this->tables['platforms']} PLAT - ON PLAT.id = TPTCV.platform_id + ON PLAT.id = TPTCV.platform_id - LEFT OUTER JOIN {$this->tables['executions']} E + LEFT OUTER JOIN {$this->tables['executions']} E ON E.testplan_id = TPTCV.testplan_id AND E.platform_id = TPTCV.platform_id AND E.tcversion_id = TPTCV.tcversion_id AND E.build_id = B.id - - WHERE TPTCV.testplan_id=$safeID - AND E.id IS NULL"; - $sql .= " AND TPTCV.platform_id=" . intval($platformID); - $sql .= " GROUP BY tsuite_id, tcase_id, + WHERE TPTCV.testplan_id=$safeID + AND E.id IS NULL"; + + $sql .= " AND TPTCV.platform_id=" . intval($platformID); + $sql .= " GROUP BY tsuite_id, tcase_id, TPTCV.platform_id,NHTC.name,platform_name, full_external_id,external_id, - TCV.version,exec_type,urg_imp,status"; - - //echo $sql; - $buildSet = $this->get_builds($safeID,testplan::ACTIVE_BUILDS, - testplan::OPEN_BUILDS); - - $sql .= " HAVING COUNT(0) = " . count($buildSet); - // $sql .= " ORDER BY platform_name,full_external_id "; - - // echo $sql; - $keyColumns = array('tsuite_id','tcase_id','platform_id'); - $cumulative = true; - $dummy = (array)$this->db->fetchRowsIntoMap3l($sql,$keyColumns,$cumulative); - - return $dummy; - } - - - /** - * - * when getting info for executed test cases, RIGHT version number - * for execution is on EXECUTIONS TABLE not on testplan_tcversions TABLE. - * - * REMEMBER that when we update TCVERSION for executed Test Cases, - * we HAVE TO UPDATE testplan_tcversions table. - * - * We also need to use E.tcversion_id and NOT TPTCV.tcversion_id. - * - */ - function buildSQLTSLatestExecOneSinglePlatform($id, $platform_id, $filters=null, $opt=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('getExecutionNotes' => false, - 'getTester' => false, - 'getUserAssignment' => false, - 'getExecutionTimestamp' => false, - 'getExecutionDuration' => false); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - - list($my,$builds,$sqlStm) = $this->helperGetExecCounters($id, $filters, $opt); - - $safe_id = intval($id); - - - // Additional Execution fields - $moreExecFields = ""; - if ($my['opt']['getExecutionNotes']) { - $moreExecFields .= "E.notes AS execution_notes,"; - } - - if ($my['opt']['getTester']) { - $moreExecFields .= "E.tester_id,"; - } - - if ($my['opt']['getExecutionTimestamp']) { - $moreExecFields .= "E.execution_ts,"; - } - - if ($my['opt']['getExecutionDuration']) { - $moreExecFields .= "E.execution_duration,"; - } - - if ($my['opt']['getUserAssignment']) { - $moreExecFields .= "UA.user_id,"; - } - - // Latest Executions By Platform (LEBP) - $sqlLEBP = $sqlStm['LEBP']; - - $union['exec'] = - "/* {$debugMsg} sqlUnion Test suites - executions */ - SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, + TCV.version,exec_type,urg_imp,status"; + + $buildSet = $this->get_builds($safeID, testplan::ACTIVE_BUILDS, + testplan::OPEN_BUILDS); + + $sql .= " HAVING COUNT(0) = " . count($buildSet); + + $keyColumns = array( + 'tsuite_id', + 'tcase_id', + 'platform_id' + ); + $cumulative = true; + return (array) $this->db->fetchRowsIntoMap3l($sql, $keyColumns, + $cumulative); + } + + /** + * when getting info for executed test cases, RIGHT version number + * for execution is on EXECUTIONS TABLE not on testplan_tcversions TABLE. + * + * REMEMBER that when we update TCVERSION for executed Test Cases, + * we HAVE TO UPDATE testplan_tcversions table. + * + * We also need to use E.tcversion_id and NOT TPTCV.tcversion_id. + */ + private function buildSQLTSLatestExecOneSinglePlatform($id, $platform_id, + $filters = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'getExecutionNotes' => false, + 'getTester' => false, + 'getUserAssignment' => false, + 'getExecutionTimestamp' => false, + 'getExecutionDuration' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + list ($my, $builds, $sqlStm) = $this->helperGetExecCounters($id, + $filters, $opt); + + $safe_id = intval($id); + + // Additional Execution fields + $moreExecFields = ""; + if ($my['opt']['getExecutionNotes']) { + $moreExecFields .= "E.notes AS execution_notes,"; + } + + if ($my['opt']['getTester']) { + $moreExecFields .= "E.tester_id,"; + } + + if ($my['opt']['getExecutionTimestamp']) { + $moreExecFields .= "E.execution_ts,"; + } + + if ($my['opt']['getExecutionDuration']) { + $moreExecFields .= "E.execution_duration,"; + } + + if ($my['opt']['getUserAssignment']) { + $moreExecFields .= "UA.user_id,"; + } + + // Latest Executions By Platform (LEBP) + $sqlLEBP = $sqlStm['LEBP']; + + $union['exec'] = "/* {$debugMsg} sqlUnion Test suites - executions */ + SELECT NHTC.parent_id AS tsuite_id,NHTC.id AS tcase_id, NHTC.name AS name, TPTCV.tcversion_id,TPTCV.platform_id, E.build_id,E.tcversion_number AS version, TCV.tc_external_id AS external_id, - E.id AS executions_id, E.status AS status, + E.id AS executions_id, E.status AS status, {$moreExecFields} E.execution_type AS exec_type, (TPTCV.urgency * TCV.importance) AS urg_imp - FROM {$this->tables['testplan_tcversions']} TPTCV " . - - $sqlStm['getAssignedFeatures'] . - - " /* GO FOR Absolute LATEST exec ID On PLATFORM */ - JOIN ({$sqlLEBP}) AS LEBP + FROM {$this->tables['testplan_tcversions']} TPTCV " . + $sqlStm['getAssignedFeatures'] . + " /* GO FOR Absolute LATEST exec ID On PLATFORM */ + JOIN ({$sqlLEBP}) AS LEBP ON LEBP.testplan_id = TPTCV.testplan_id AND LEBP.platform_id = TPTCV.platform_id AND LEBP.tcversion_id = TPTCV.tcversion_id - AND LEBP.testplan_id = " . $safe_id . - - " /* Get execution status WRITTEN on DB */ + AND LEBP.testplan_id = " . $safe_id . + " /* Get execution status WRITTEN on DB */ JOIN {$this->tables['executions']} E - ON E.id = LEBP.id " . - - " /* getUserAssignment */ " . - $sqlStm['getUserAssignment']['exec'] . - - " /* Get Test Case info from Test Case Version */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.id = TPTCV.tcversion_id " . - - " /* Get Test Suite info from Test Case */ " . - " JOIN {$this->tables['nodes_hierarchy']} NHTC " . - " ON NHTC.id = NHTCV.parent_id " . - - " /* Get Test Case Version attributes */ " . - " JOIN {$this->tables['tcversions']} TCV " . - " ON TCV.id = E.tcversion_id " . - - " WHERE TPTCV.testplan_id={$safe_id} " . - " AND TPTCV.platform_id=" . intval($platform_id); - - return array($my,$builds,$sqlStm,$union); - } - - - /** - * - * getStatusTotalsTSuiteDepth2ForRender - * - */ - function getStatusTotalsTSuiteDepth2ForRender($id,$filters=null,$opt=null) - { - list($rx,$staircase) = - $this->getStatusTotalsByItemForRender($id,'tsuite',$filters,$opt); - - // ??? $key2loop = array_keys($rx->info); - $template = array('type' => 'tsuite', - 'name' => '', - 'parent_id' => 0, - 'total_tc' => 0, - 'percentage_completed' => 0, - 'details' => array()); - - foreach($this->statusCode as $verbose => $code) { - $template['details'][$verbose] = array('qty' => 0, 'percentage' => 0); - } - - $renderObj = new stdClass(); - $renderObj->colDefinition = $rx->colDefinition; - $renderObj->info = array(); - $renderObj->infoL2 = array(); - $renderObj->idNameMap = array(); - - // collect qty - $execQty = null; - $execQtyL2 = null; - - $key2loop = array_keys($staircase); - $wp = isset($opt['groupByPlatform']) && $opt['groupByPlatform']; - - if( $wp ) { - $tsNameCache = array(); - $plat2loop = array_keys($rx->info); - - // In order to get SUM() for each Top (Level 1) Test Suite - // using the specific test suite we get the Level 1 - // test suite of it's branch - // - foreach($key2loop as $tsuite_id) { - /* staircase - array(2) { - // ELEMENT #1 - [33934]=> (Test Suite -> Elenco agenda) - array(1) { - [0]=> string(5) "33933" (Test Project - Academy) - } - - // ELEMENT #2 - [49238]=> (Test Suite -> SOTTO Elenco agenda) - array(2) { - [0]=> string(5) "33933" (Test Project - Academy) - [1]=> string(5) "33934" (Test Suite -> Elenco agenda) - } - } - */ - - $tsuiteDepth = count($staircase[$tsuite_id]); - - $l2id = -1; - if ($tsuiteDepth > 1) { - // element at position 1 on starcaise - // is a TOP LEVEL SUITE - $topSuiteID = $staircase[$tsuite_id][1]; - $initName = false; - if ($tsuiteDepth > 2) { - $l2id = $staircase[$tsuite_id][2]; - $initNameL2 = false; - } else { - $l2id = $tsuite_id; - $initNameL2 = true; - } - } else { - $topSuiteID = $tsuite_id; - $initName = true; - } - - // Over Platform - foreach( $plat2loop as $platId ) { - - // Level 1 - if (!isset($renderObj->info[$platId][$topSuiteID])) { - $renderObj->info[$platId][$topSuiteID] = $template; - $execQty[$platId][$topSuiteID] = 0; - $initName = true; - } - - // Level 2 - if ($l2id > 0 && !isset($renderObj->infoL2[$platId][$l2id])) { - $renderObj->infoL2[$platId][$l2id] = $template; - $renderObj->infoL2[$platId][$l2id]['parent_id'] = $topSuiteID; - $execQtyL2[$platId][$l2id] = 0; - $initNameL2 = true; - } - - - if ($initName) { - if (!isset($tsNameCache[$topSuiteID])) { - $dummy = $this->tree_manager->get_node_hierarchy_info($topSuiteID); - $tsNameCache[$topSuiteID] = $dummy['name']; - unset($dummy); - } - $renderObj->info[$platId][$topSuiteID]['name'] = - $tsNameCache[$topSuiteID]; - } - - if ($l2id > 0 && $initNameL2) { - if (!isset($tsNameCache[$l2id])) { - // , array('l2CutFirst' => 10) - // $dummy = $this->tree_manager->getNameL2($l2id); - $tsNameCache[$l2id] = - $this->tree_manager->getNameL2($l2id); - } - $renderObj->infoL2[$platId][$l2id]['name'] = - $tsNameCache[$l2id]; - $renderObj->idNameMap[$l2id] = $tsNameCache[$l2id]; - } - - - - // Loop to get executions counters - $r2d2 = &$rx->info[$platId][$tsuite_id]; - if( null !== $r2d2 ) { - foreach($r2d2['details'] as $code => &$elem) { - $renderObj->info[$platId][$topSuiteID]['details'][$code] - ['qty'] += $elem['qty']; - $renderObj->info[$platId][$topSuiteID]['total_tc'] += - $elem['qty']; - - if ($l2id > 0) { - $renderObj->infoL2[$platId][$l2id]['details'][$code] - ['qty'] += $elem['qty']; - $renderObj->infoL2[$platId][$l2id]['total_tc'] += - $elem['qty']; - } - - if( $code != 'not_run' ) { - $execQty[$platId][$topSuiteID] += $elem['qty']; - if ($l2id > 0) { - $execQtyL2[$platId][$l2id] += $elem['qty']; - } - } - } - } - } - } - - // Last step: get percentages - foreach($renderObj->info as $platID => &$tsuiteMetrics) { - foreach($tsuiteMetrics as $tsuite_id => &$elem) { - if( $execQty[$platID][$tsuite_id] > 0 ) { - $elem['percentage_completed'] = number_format( 100 * - ($execQty[$platID][$tsuite_id] / $elem['total_tc']),1); - } - if( $elem['total_tc'] > 0 ) { - foreach($elem['details'] as $code => &$yumyum) { - $yumyum['percentage'] = number_format( 100 * ($yumyum['qty'] / $elem['total_tc']),1); - } - } - } - } - - // Level 2 - foreach($renderObj->infoL2 as $platID => &$tsuiteMetrics) { - foreach($tsuiteMetrics as $tsuite_id => &$elem) { - if( $execQtyL2[$platID][$tsuite_id] > 0 ) { - $elem['percentage_completed'] = number_format( 100 * - ($execQtyL2[$platID][$tsuite_id] / $elem['total_tc']),1); - } - if( $elem['total_tc'] > 0 ) { - foreach($elem['details'] as $code => &$yumyum) { - $yumyum['percentage'] = number_format( 100 * ($yumyum['qty'] / $elem['total_tc']),1); - } - } - } - } - - - - } - return $renderObj; - } - - - /** - * - * getExecTimelineStats - * - */ - function getExecTimelineStats($id,$filters=null,$opt=null) - { - $flt = array('yyyy_mm_dd' => null); - $flt = array_merge($flt,(array)$filters); - - // timeline - // day -> sum by date - // day_hour -> sum by date & hour - // month -> sum by month - // - $options = array('timeline' => 'day', 'workforce' => false); - $options = array_merge($options,(array)$opt); - - switch ($options['timeline']) { - case 'day_hour': - $fields = 'yyyy_mm_dd,hh'; - break; - - case 'month': - $fields = 'yyyy_mm'; - break; - - case 'day': - default: - $fields = 'yyyy_mm_dd'; - break; - } - - $safeID = intval($id); - $sqlX = " SELECT COUNT(0) as qty,{$fields},tester_id + ON E.id = LEBP.id " . " /* getUserAssignment */ " . + $sqlStm['getUserAssignment']['exec'] . + " /* Get Test Case info from Test Case Version */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.id = TPTCV.tcversion_id " . + " /* Get Test Suite info from Test Case */ " . + " JOIN {$this->tables['nodes_hierarchy']} NHTC " . + " ON NHTC.id = NHTCV.parent_id " . + " /* Get Test Case Version attributes */ " . + " JOIN {$this->tables['tcversions']} TCV " . + " ON TCV.id = E.tcversion_id " . + " WHERE TPTCV.testplan_id={$safe_id} " . " AND TPTCV.platform_id=" . + intval($platform_id); + + return array( + $my, + $builds, + $sqlStm, + $union + ); + } + + /** + * getStatusTotalsTSuiteDepth2ForRender + */ + public function getStatusTotalsTSuiteDepth2ForRender($id, $filters = null, + $opt = null) + { + list ($rx, $staircase) = $this->getStatusTotalsByItemForRender($id, + 'tsuite', $filters, $opt); + + // ??? $key2loop = array_keys($rx->info); + $template = array( + 'type' => 'tsuite', + 'name' => '', + 'parent_id' => 0, + 'total_tc' => 0, + 'percentage_completed' => 0, + 'details' => array() + ); + + foreach ($this->statusCode as $verbose => $code) { + $template['details'][$verbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + } + + $renderObj = new stdClass(); + $renderObj->colDefinition = $rx->colDefinition; + $renderObj->info = array(); + $renderObj->infoL2 = array(); + $renderObj->idNameMap = array(); + + // collect qty + $execQty = null; + $execQtyL2 = null; + + $key2loop = array_keys($staircase); + $wp = isset($opt['groupByPlatform']) && $opt['groupByPlatform']; + + if ($wp) { + $tsNameCache = array(); + $plat2loop = array_keys($rx->info); + + // In order to get SUM() for each Top (Level 1) Test Suite + // using the specific test suite we get the Level 1 + // test suite of it's branch + // + foreach ($key2loop as $tsuite_id) { + /* + * staircase + * array(2) { + * // ELEMENT #1 + * [33934]=> (Test Suite -> Elenco agenda) + * array(1) { + * [0]=> string(5) "33933" (Test Project - Academy) + * } + * + * // ELEMENT #2 + * [49238]=> (Test Suite -> SOTTO Elenco agenda) + * array(2) { + * [0]=> string(5) "33933" (Test Project - Academy) + * [1]=> string(5) "33934" (Test Suite -> Elenco agenda) + * } + * } + */ + + $tsuiteDepth = count($staircase[$tsuite_id]); + + $l2id = - 1; + if ($tsuiteDepth > 1) { + // element at position 1 on starcaise + // is a TOP LEVEL SUITE + $topSuiteID = $staircase[$tsuite_id][1]; + $initName = false; + if ($tsuiteDepth > 2) { + $l2id = $staircase[$tsuite_id][2]; + $initNameL2 = false; + } else { + $l2id = $tsuite_id; + $initNameL2 = true; + } + } else { + $topSuiteID = $tsuite_id; + $initName = true; + } + + // Over Platform + foreach ($plat2loop as $platId) { + + // Level 1 + if (! isset($renderObj->info[$platId][$topSuiteID])) { + $renderObj->info[$platId][$topSuiteID] = $template; + $execQty[$platId][$topSuiteID] = 0; + $initName = true; + } + + // Level 2 + if ($l2id > 0 && ! isset($renderObj->infoL2[$platId][$l2id])) { + $renderObj->infoL2[$platId][$l2id] = $template; + $renderObj->infoL2[$platId][$l2id]['parent_id'] = $topSuiteID; + $execQtyL2[$platId][$l2id] = 0; + $initNameL2 = true; + } + + if ($initName) { + if (! isset($tsNameCache[$topSuiteID])) { + $dummy = $this->tree_manager->get_node_hierarchy_info( + $topSuiteID); + $tsNameCache[$topSuiteID] = $dummy['name']; + unset($dummy); + } + $renderObj->info[$platId][$topSuiteID]['name'] = $tsNameCache[$topSuiteID]; + } + + if ($l2id > 0 && $initNameL2) { + if (! isset($tsNameCache[$l2id])) { + // , array('l2CutFirst' => 10) + // $dummy = $this->tree_manager->getNameL2($l2id); + $tsNameCache[$l2id] = $this->tree_manager->getNameL2( + $l2id); + } + $renderObj->infoL2[$platId][$l2id]['name'] = $tsNameCache[$l2id]; + $renderObj->idNameMap[$l2id] = $tsNameCache[$l2id]; + } + + // Loop to get executions counters + $r2d2 = &$rx->info[$platId][$tsuite_id]; + if (null !== $r2d2) { + foreach ($r2d2['details'] as $code => &$elem) { + $renderObj->info[$platId][$topSuiteID]['details'][$code]['qty'] += $elem['qty']; + $renderObj->info[$platId][$topSuiteID]['total_tc'] += $elem['qty']; + + if ($l2id > 0) { + $renderObj->infoL2[$platId][$l2id]['details'][$code]['qty'] += $elem['qty']; + $renderObj->infoL2[$platId][$l2id]['total_tc'] += $elem['qty']; + } + + if ($code != 'not_run') { + $execQty[$platId][$topSuiteID] += $elem['qty']; + if ($l2id > 0) { + $execQtyL2[$platId][$l2id] += $elem['qty']; + } + } + } + } + } + } + + // Last step: get percentages + foreach ($renderObj->info as $platID => &$tsuiteMetrics) { + foreach ($tsuiteMetrics as $tsuite_id => &$elem) { + if ($execQty[$platID][$tsuite_id] > 0) { + $elem['percentage_completed'] = number_format( + 100 * + ($execQty[$platID][$tsuite_id] / $elem['total_tc']), + 1); + } + if ($elem['total_tc'] > 0) { + foreach ($elem['details'] as &$yumyum) { + $yumyum['percentage'] = number_format( + 100 * ($yumyum['qty'] / $elem['total_tc']), 1); + } + } + } + } + + // Level 2 + foreach ($renderObj->infoL2 as $platID => &$tsuiteMetrics) { + foreach ($tsuiteMetrics as $tsuite_id => &$elem) { + if ($execQtyL2[$platID][$tsuite_id] > 0) { + $elem['percentage_completed'] = number_format( + 100 * + ($execQtyL2[$platID][$tsuite_id] / $elem['total_tc']), + 1); + } + if ($elem['total_tc'] > 0) { + foreach ($elem['details'] as &$yumyum) { + $yumyum['percentage'] = number_format( + 100 * ($yumyum['qty'] / $elem['total_tc']), 1); + } + } + } + } + } + return $renderObj; + } + + /** + * getExecTimelineStats + */ + public function getExecTimelineStats($id, $filters = null, $opt = null) + { + $flt = array( + 'yyyy_mm_dd' => null + ); + $flt = array_merge($flt, (array) $filters); + + // timeline + // day -> sum by date + // day_hour -> sum by date & hour + // month -> sum by month + // + $options = array( + 'timeline' => 'day', + 'workforce' => false + ); + $options = array_merge($options, (array) $opt); + + switch ($options['timeline']) { + case 'day_hour': + $fields = 'yyyy_mm_dd,hh'; + break; + + case 'month': + $fields = 'yyyy_mm'; + break; + + case 'day': + default: + $fields = 'yyyy_mm_dd'; + break; + } + + $safeID = intval($id); + $sqlX = " SELECT COUNT(0) as qty,{$fields},tester_id FROM {$this->views['exec_by_date_time']} EBDT WHERE EBDT.testplan_id = {$safeID} - GROUP BY {$fields},tester_id"; - $sqlA = str_ireplace(',tester_id','', $sqlX); - $sql = $sqlA . " ORDER BY {$fields}"; - - switch ($options['timeline']) { - case 'day_hour': - $rs = $this->db->fetchMapRowsIntoMap($sql,'yyyy_mm_dd','hh'); - break; - - case 'month': - $rs = $this->db->fetchRowsIntoMap($sql,'yyyy_mm'); - break; - - case 'day': - default: - $rs = $this->db->fetchRowsIntoMap($sql,'yyyy_mm_dd'); - break; - } - - $rswf = null; - if ($options['workforce']) { - $sqlwf = " SELECT COUNT(0) AS testers, {$fields} - FROM ($sqlX) SQLBASE - GROUP BY {$fields}"; - - switch ($options['timeline']) { - case 'day_hour': - $rswf = $this->db->fetchMapRowsIntoMap($sqlwf,'yyyy_mm_dd','hh'); - break; - - case 'month': - $rswf = $this->db->fetchRowsIntoMap($sqlwf,'yyyy_mm'); - break; - - case 'day': - default: - $rswf = $this->db->fetchRowsIntoMap($sqlwf,'yyyy_mm_dd'); - break; - } - - foreach ($rswf as $rt => $elem) { - $rs[$rt]['testers'] = $elem['testers']; - } - } - - return array($rs,$rswf); - } - - /** - * get execution time span for context: - * Test Plan - * Platform (if any) - * Build - * - * - */ - function getExecTimeSpan($id,$context) { - - $fieldList .= implode(',', $context); - - $sql = "SELECT MIN(execution_ts) AS begin, - MAX(execution_ts) AS end, {$fieldList} - FROM {$this->tables['executions']} - WHERE testplan_id = $id - GROUP BY {$fieldList}"; - - $levels = count($context); - switch ($levels) { - case 1: - $rs = $this->db->fetchRowsIntoMap($sql,'testplan_id'); - break; - - case 2: - $rs = $this->db->fetchRowsIntoMap2l($sql,$context); - break; - - case 3: - $rs = $this->db->fetchRowsIntoMap3l($sql,$context); - break; - } - - return $rs; - } - - -} \ No newline at end of file + GROUP BY {$fields},tester_id"; + $sqlA = str_ireplace(',tester_id', '', $sqlX); + $sql = $sqlA . " ORDER BY {$fields}"; + + switch ($options['timeline']) { + case 'day_hour': + $rs = $this->db->fetchMapRowsIntoMap($sql, 'yyyy_mm_dd', 'hh'); + break; + + case 'month': + $rs = $this->db->fetchRowsIntoMap($sql, 'yyyy_mm'); + break; + + case 'day': + default: + $rs = $this->db->fetchRowsIntoMap($sql, 'yyyy_mm_dd'); + break; + } + + $rswf = null; + if ($options['workforce']) { + $sqlwf = " SELECT COUNT(0) AS testers, {$fields} + FROM ($sqlX) SQLBASE + GROUP BY {$fields}"; + + switch ($options['timeline']) { + case 'day_hour': + $rswf = $this->db->fetchMapRowsIntoMap($sqlwf, 'yyyy_mm_dd', + 'hh'); + break; + + case 'month': + $rswf = $this->db->fetchRowsIntoMap($sqlwf, 'yyyy_mm'); + break; + + case 'day': + default: + $rswf = $this->db->fetchRowsIntoMap($sqlwf, 'yyyy_mm_dd'); + break; + } + + foreach ($rswf as $rt => $elem) { + $rs[$rt]['testers'] = $elem['testers']; + } + } + + return array( + $rs, + $rswf + ); + } + + /** + * get execution time span for context: + * Test Plan + * Platform (if any) + * Build + */ + public function getExecTimeSpan($id, $context) + { + $fieldList = implode(',', $context); + $sql = "SELECT MIN(execution_ts) AS begin, MAX(execution_ts) AS end, {$fieldList}" . + " FROM {$this->tables['executions']} WHERE testplan_id = $id " . + " GROUP BY {$fieldList}"; + + $levels = count($context); + switch ($levels) { + case 1: + $rs = $this->db->fetchRowsIntoMap($sql, 'testplan_id'); + break; + + case 2: + $rs = $this->db->fetchRowsIntoMap2l($sql, $context); + break; + + case 3: + $rs = $this->db->fetchRowsIntoMap3l($sql, $context); + break; + } + + return $rs; + } +} diff --git a/lib/functions/tlUser.class.php b/lib/functions/tlUser.class.php index 6da99bdb3f..d2bfc31295 100644 --- a/lib/functions/tlUser.class.php +++ b/lib/functions/tlUser.class.php @@ -1,1537 +1,1574 @@ -object_table = $this->tables['users']; - - $authCfg = config_get('authentication'); - $this->usernameFormat = config_get('username_format'); - $this->loginRegExp = config_get('validation_cfg')->user_login_valid_regex; - $this->maxLoginLength = 100; - $this->loginMethod = $authCfg['method']; - - $this->globalRoleID = config_get('default_roleid'); - $this->locale = config_get('default_language'); - $this->isActive = 1; - $this->tprojectRoles = null; - $this->tplanRoles = null; - } - - /** - * Cleans the object by resetting the members to default values - * - * @param mixed $options tlUser/tlObject options - */ - protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) { - $this->firstName = null; - $this->lastName = null; - $this->locale = null; - $this->password = null; - $this->isActive = null; - $this->defaultTestprojectID = null; - $this->globalRoleID = null; - $this->tprojectRoles = null; - $this->tplanRoles = null; - $this->userApiKey = null; - $this->securityCookie = null; - $this->authentication = null; - $this->expiration_date = null; - - if (!($options & self::TLOBJ_O_SEARCH_BY_ID)) { - $this->dbID = null; - } - - if (!($options & self::USER_O_SEARCH_BYLOGIN)) { - $this->login = null; - } - - if (!($options & self::USER_O_SEARCH_BYEMAIL)) { - $this->emailAddress = null; - } - - - } - - /** - * Checks if password management is external (like LDAP)... - * - * @param string $method2check must be one of the keys of configuration $tlCfg->authentication['domain'] - * - * @return boolean return true if password management is external, else false - */ - static public function isPasswordMgtExternal($method2check=null) - { - $target = $method2check; - - // Contains Domain and Default Method - $authCfg = config_get('authentication'); - - if( is_null($target) || $target=='') - { - $target = $authCfg['method']; - } - - $ret = true; - if( isset($authCfg['domain'][$target]) ) - { - $ret = !$authCfg['domain'][$target]['allowPasswordManagement']; - } - return $ret; - } - - /** - * Obtain a secure password. - * You can choose the number of alphanumeric characters to add and - * the number of non-alphanumeric characters. - * You can add another characters to the non-alphanumeric list if you need. - * - * @param integer $numAlpha number alphanumeric characters in generated password - * @param integer $numNonAlpha number special characters in generated password - * - * @return string the generated password - */ - static public function generatePassword($numAlpha = 6,$numNonAlpha = 2) - { - $listAlpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; - $listNonAlpha = ',;:!?.$/*-+&@_+;./*&?$-!,'; - - return str_shuffle(substr(str_shuffle($listAlpha),0,$numAlpha) . - substr(str_shuffle($listNonAlpha),0,$numNonAlpha)); - } - - /** - * not used at the moment, only placeholder - * - * @return void - * @TODO implement - **/ - function create() - { - } - - //----- BEGIN interface iDBSerialization ----- - /** - * Reads an user object identified by its database id from the given database - * - * @param resource &$db reference to database handler - * @param mixed $options (optional) tlUser/tlObject options - * - * @return integer tl::OK if the object could be read from the db, else tl::ERROR - */ - public function readFromDB(&$db,$options = self::TLOBJ_O_SEARCH_BY_ID) { - $this->_clean($options); - $sql = " SELECT id,login,password,cookie_string,first,last,email," . - " role_id,locale, " . - " login AS fullname, active,default_testproject_id, script_key,auth_method,creation_ts,expiration_date " . - " FROM {$this->object_table}"; - $clauses = null; - - if ($options & self::TLOBJ_O_SEARCH_BY_ID) { - $clauses[] = "id = " . intval($this->dbID); - } - - if ($options & self::USER_O_SEARCH_BYLOGIN) { - $clauses[] = "login = '".$db->prepare_string($this->login)."'"; - } - - if ($options & self::USER_O_SEARCH_BYEMAIL) { - $clauses[] = "email = '".$db->prepare_string($this->emailAddress)."'"; - } - - if ($clauses) { - $sql .= " WHERE " . implode(" AND ",$clauses); - } - $info = $db->fetchFirstRow($sql); - if ($info) { - $this->dbID = $info['id']; - $this->firstName = $info['first']; - $this->lastName = $info['last']; - $this->login = $info['login']; - $this->emailAddress = $info['email']; - $this->globalRoleID = $info['role_id']; - $this->userApiKey = $info['script_key']; - $this->securityCookie = $info['cookie_string']; - $this->authentication = $info['auth_method']; - $this->expiration_date = $info['expiration_date']; - $this->creation_ts = $info['creation_ts']; - - if ($this->globalRoleID) { - $this->globalRole = new tlRole($this->globalRoleID); - $this->globalRole->readFromDB($db); - } - - if ($this->detailLevel & self::TLOBJ_O_GET_DETAIL_ROLES) { - $this->readTestProjectRoles($db); - $this->readTestPlanRoles($db); - } - - $this->locale = $info['locale']; - $this->password = $info['password']; - $this->isActive = $info['active']; - $this->defaultTestprojectID = $info['default_testproject_id']; - } - return $info ? tl::OK : tl::ERROR; - } - - /** - * Fetches all the testproject roles of of the user, and store them into the object. - * Result could be limited to a certain testproject - * - * @param resource &$db reference to database handler - * @param integer $testProjectID Identifier of the testproject to read the roles for, - * if null all roles are read - * - * @return integer returns tl::OK - */ - public function readTestProjectRoles(&$db,$testProjectID = null) { - $sql = "SELECT testproject_id,role_id " . - " FROM {$this->tables['user_testproject_roles']} user_testproject_roles " . - " WHERE user_id = " . intval($this->dbID); - - if ($testProjectID) { - $sql .= " AND testproject_id = " . intval($testProjectID); - } - $allRoles = $db->fetchColumnsIntoMap($sql,'testproject_id','role_id'); - $this->tprojectRoles = null; - if (null != $allRoles && sizeof($allRoles)) { - $roleCache = null; - foreach($allRoles as $tprojectID => $roleID) { - if (!isset($roleCache[$roleID])) { - $tprojectRole = tlRole::createObjectFromDB($db,$roleID,"tlRole",true); - $roleCache[$roleID] = $tprojectRole; - } else { - $tprojectRole = clone($roleCache[$roleID]); - } - - if ($tprojectRole) { - $this->tprojectRoles[$tprojectID] = $tprojectRole; - } - } - } - return tl::OK; - } - - /** - * Fetches all the testplan roles of of the user, and store them into the object. - * Result could be limited to a certain testplan - * - * @param resource &$db reference to database handler - * @param integer $testPlanID Identifier of the testplan to read the roles for, if null all roles are read - * - * @return integer returns tl::OK - */ - public function readTestPlanRoles(&$db,$testPlanID = null) { - $sql = "SELECT testplan_id,role_id " . - " FROM {$this->tables['user_testplan_roles']} user_testplan_roles " . - " WHERE user_id = " . intval($this->dbID); - if ($testPlanID) { - $sql .= " AND testplan_id = " . intval($testPlanID); - } - - $allRoles = $db->fetchColumnsIntoMap($sql,'testplan_id','role_id'); - $this->tplanRoles = null; - if (null != $allRoles && sizeof($allRoles)) { - $roleCache = null; - foreach($allRoles as $tplanID => $roleID) { - if (!isset($roleCache[$roleID])) { - $tplanRole = tlRole::createObjectFromDB($db,$roleID,"tlRole",true); - $roleCache[$roleID] = $tplanRole; - } else { - $tplanRole = clone($roleCache[$roleID]); - } - - if ($tplanRole) { - $this->tplanRoles[$tplanID] = $tplanRole; - } - } - } - return tl::OK; - } - - /** - * Writes the object into the database - * - * @param resource &$db reference to database handler - * @return integer tl::OK if the object could be written to the db, else error code - */ - public function writeToDB(&$db) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $result = $this->checkDetails($db); - if ($result >= tl::OK) - { - $t_cookie_string = $this->auth_generate_unique_cookie_string($db); - - // After addition of cookie_string, and following Mantisbt pattern, - // seems we need to check if password has changed. - // - // IMPORTANT NOTICE: - // this implementation works ONLY when password is under TestLink control - // i.e. is present on TestLink Database. - // - // if answer is yes => change also cookie_string. - if($this->dbID) - { - $gsql = " /* debugMsg */ SELECT password FROM {$this->object_table} WHERE id = " . $this->dbID; - $rs = $db->get_recordset($gsql); - if(strcmp($rs[0]['password'],$this->password) == 0) - { - // NO password change - $t_cookie_string = null; - } - - $sql = "/* debugMsg */ UPDATE {$this->tables['users']} " . - " SET first = '" . $db->prepare_string($this->firstName) . "'" . - ", last = '" . $db->prepare_string($this->lastName) . "'" . - ", email = '" . $db->prepare_string($this->emailAddress) . "'" . - ", locale = ". "'" . $db->prepare_string($this->locale) . "'" . - ", password = " . "'" . $db->prepare_string($this->password) . "'" . - ", role_id = ". $db->prepare_int($this->globalRoleID) . - ", active = ". $db->prepare_string($this->isActive) . - ", auth_method = ". "'" . $db->prepare_string($this->authentication) . "'"; - - if(!is_null($t_cookie_string) ) - { - $sql .= ", cookie_string = " . "'" . $db->prepare_string($t_cookie_string) . "'"; - } - $sql .= " WHERE id = " . intval($this->dbID); - $result = $db->exec_query($sql); - } - else - { - $sql = "/* debugMsg */ INSERT INTO {$this->tables['users']} " . - " (login,password,cookie_string,first,last,email,role_id,locale,active,auth_method) " . - " VALUES ('" . - $db->prepare_string($this->login) . "','" . $db->prepare_string($this->password) . "','" . - $db->prepare_string($t_cookie_string) . "','" . - $db->prepare_string($this->firstName) . "','" . $db->prepare_string($this->lastName) . "','" . - $db->prepare_string($this->emailAddress) . "'," . $db->prepare_int($this->globalRoleID) . ",'". - $db->prepare_string($this->locale). "'," . $this->isActive . "," . - "'" . $db->prepare_string($this->authentication). "'" . ")"; - - $result = $db->exec_query($sql); - if($result) - { - $this->dbID = $db->insert_id($this->tables['users']); - } - } - $result = $result ? tl::OK : self::E_DBERROR; - } - return $result; - } - - /** - * WARNING: DO NOT USE THE FUNCTION - CAUSES DB INCONSISTENCE! - * - * @deprecated 1.8.3 - * @see #2407 - **/ - public function deleteFromDB(&$db) - { - $safeUserID = intval($this->dbID); - $sqlSet = array(); - $sqlSet[] = "DELETE FROM {$this->table['user_assignments']} WHERE user_id = {$safeUserID}"; - $sqlSet[] = "DELETE FROM {$this->table['users']} WHERE id = {$safeUserID}"; - - foreach($sqlSet as $sql) - { - $result = $db->exec_query($sql) ? tl::OK : tl::ERROR; - if($result == tl::ERROR) - { - break; - } - } - - if ($result == tl::OK) - { - $result = $this->deleteTestProjectRoles($db); - } - return $result; - } - - /** - * Deletes all testproject related role assignments for a given user - * - * @param resource &$db reference to database handler - * @param integer $userID the user ID - * - * @return integer tl::OK on success, tl:ERROR else - **/ - protected function deleteTestProjectRoles(&$db) - { - $sql = "DELETE FROM {$this->tables['user_testproject_roles']} WHERE user_id = " . intval($this->dbID); - return $db->exec_query($sql) ? tl::OK : tl::ERROR; - } - - /** - * Returns a user friendly representation of the user name - * - * @return string the display nmae - */ - public function getDisplayName($format=null) - { - $keys = array('%first%','%last%','%login%','%email%'); - $values = array($this->firstName, $this->lastName,$this->login,$this->emailAddress); - - $fmt = is_null($format) ? $this->usernameFormat : $format; - $displayName = trim(str_replace($keys,$values,$fmt)); - - return $displayName; - } - - /** - * Encrypts a given password with MD5 - * - * @param $pwd the password to encrypt - * @return string the encrypted password - */ - protected function encryptPassword($pwd,$authentication=null) - { - if (self::isPasswordMgtExternal($authentication)) { - return self::S_PWDMGTEXTERNAL; - } - - return password_hash($pwd,PASSWORD_DEFAULT); - } - - /** - * Set encrypted password - * - * @param string $pwd the new password - * @return integer return tl::OK is the password is stored, else errorcode - */ - public function setPassword($pwd,$authentication=null) - { - if (self::isPasswordMgtExternal($authentication)) - { - return self::S_PWDMGTEXTERNAL; - } - $pwd = trim($pwd); - if ($pwd == "") { - return self::E_PWDEMPTY; - } - $this->password = $this->encryptPassword($pwd,$authentication); - return tl::OK; - } - - /** - * Getter for the password of the user - * - * @return string the password of the user - */ - public function getPassword() - { - return $this->password; - } - - /** - * compares a given password with the current password of the user - * - * @param string $pwd the password to compate with the password actually set - * @return integer returns tl::OK if the password's match, else errorcode - */ - public function comparePassword(&$dbH,$pwd) - { - if (self::isPasswordMgtExternal($this->authentication)) { - return self::S_PWDMGTEXTERNAL; - } - - // If we are here this means that we are using - // internal password management. - // - // Manage migration from MD5 - // MD5 hash check - // This is valid ONLY for internal password management - $encriptedPWD = $this->getPassword(); - if (strlen($encriptedPWD) == 32) { - /* Update the old MD5 hash to the new bcrypt */ - if ($encriptedPWD === md5($pwd)) { - $this->password = $this->encryptPassword($pwd,$this->authentication); - $this->writePasswordToDB($dbH); - return tl::OK; - } - } - - if (password_verify($pwd,$encriptedPWD)) { - return tl::OK; - } - - return self::E_PWDDONTMATCH; - } - - - /** - * - */ - public function checkDetails(&$db) { - $this->firstName = trim($this->firstName); - $this->lastName = trim($this->lastName); - $this->emailAddress = trim($this->emailAddress); - $this->locale = trim($this->locale); - $this->isActive = intval($this->isActive); - $this->login = trim($this->login); - - $result = self::checkEmailAddress($this->emailAddress); - if ($result >= tl::OK) - { - $result = $this->checkLogin($this->login); - } - if ($result >= tl::OK && !$this->dbID) - { - $result = self::doesUserExist($db,$this->login) ? self::E_LOGINALREADYEXISTS : tl::OK; - } - if ($result >= tl::OK) - { - $result = self::checkFirstName($this->firstName); - } - if ($result >= tl::OK) - { - $result = self::checkLastName($this->lastName); - } - return $result; - } - - - public function checkLogin($login) - { - $result = tl::OK; - $login = trim($login); - - if ($login == "" || (tlStringLen($login) > $this->maxLoginLength)) - { - $result = self::E_LOGINLENGTH; - } - else if (!preg_match($this->loginRegExp,$login)) - { - //Only allow a basic set of characters - $result = self::E_NOTALLOWED; - } - return $result; - } - - /** - * Returns the id of the effective role in the context of ($tproject_id,$tplan_id) - * - * @param resource &$db reference to database handler - * @param integer $tproject_id the testproject id - * @param integer $tplan_id the plan id - * - * @return integer tlRole the effective role - */ - function getEffectiveRole(&$db,$tproject_id,$tplan_id) - { - $tprojects_role = $this->tprojectRoles; - $tplans_role = $this->tplanRoles; - $effective_role = $this->globalRole; - - if(!is_null($tplans_role) && isset($tplans_role[$tplan_id])) { - $effective_role = $tplans_role[$tplan_id]; - } - else if(!is_null($tprojects_role) && isset($tprojects_role[$tproject_id])) { - $effective_role = $tprojects_role[$tproject_id]; - } - return $effective_role; - } - - /** - * Gets all userids of users with a certain testplan role @TODO WRITE RIGHT COMMENTS FROM START - * - * @param resource &$db reference to database handler - * @return array returns array of userids - **/ - protected function getUserNamesWithTestPlanRole(&$db) - { - $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . - " {$this->tables['user_testplan_roles']} user_testplan_roles " . - " WHERE users.id = user_testplan_roles.user_id"; - $sql .= " AND user_testplan_roles.role_id = " . intval($this->dbID); - $idSet = $db->fetchColumnsIntoArray($sql,"id"); - - return $idSet; - } - - - /** - * Get a list of names with a defined project right (for example for combo-box) - * used by ajax script getUsersWithRight.php - * - * @param integer $db DB Identifier - * @param string $rightNick key corresponding with description in rights table - * @param integer $testprojectID Identifier of project - * - * @return array list of user IDs and names - * - * @todo fix the case that user has default role with a right but project role without - * i.e. he should be listed - */ - public function getNamesForProjectRight(&$db,$rightNick,$testprojectID = null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if (is_null($testprojectID)) - { - tLog( $debugMsg . ' requires Test Project ID defined','ERROR'); - return null; - } - - $output = array(); - - //get users for default roles - $sql = "/* $debugMsg */ SELECT DISTINCT u.id,u.login,u.first,u.last FROM {$this->tables['users']} u" . - " JOIN {$this->tables['role_rights']} a ON a.role_id=u.role_id" . - " JOIN {$this->tables['rights']} b ON a.right_id = b.id " . - " WHERE b.description='" . $db->prepare_string($rightNick) . "'"; - $defaultRoles = $db->fetchRowsIntoMap($sql,'id'); - - // get users for project roles - $sql = "/* $debugMsg */ SELECT DISTINCT u.id,u.login,u.first,u.last FROM {$this->tables['users']} u" . - " JOIN {$this->tables['user_testproject_roles']} p ON p.user_id=u.id" . - " AND p.testproject_id=" . intval($testprojectID) . - " JOIN {$this->tables['role_rights']} a ON a.role_id=p.role_id" . - " JOIN {$this->tables['rights']} b ON a.right_id = b.id " . - " WHERE b.description='" . $db->prepare_string($rightNick) . "'"; - $projectRoles = $db->fetchRowsIntoMap($sql,'id'); - - // merge arrays - // the next function is available from php53 but we support php52 - // $output = array_replace($output1, $output2); - if( !is_null($projectRoles) ) - { - foreach($projectRoles as $k => $v) - { - if( !isset($defaultRoles[$k]) ) - { - $defaultRoles[$k] = $v; - } - } - } - - // format for ext-js combo-box (remove associated array) - // foreach($defaultRoles as $k => $v) - // { - // $output[] = $v; - // } - $output = array_values($defaultRoles); - - return $output; - } - - - /** - * Get a list of all names - * used for replacement user ID by user login - * - * @param integer $db DB Identifier - * @return array list of user IDs and names - */ - public function getNames(&$db,$idSet=null) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $sql = " SELECT id,login,first,last FROM {$this->tables['users']}"; - - $inClause = ''; - if( !is_null($idSet) ) - { - $inClause = " WHERE id IN (" . implode(',',(array)$idSet) . ") "; - } - - $output = $db->fetchRowsIntoMap($sql . $inClause,'id'); - return $output; - } - - - /** - * check right on effective role for user, using test project and test plan, - * means that check right on effective role. - * - * @return string|null 'yes' or null - * - * @internal revisions - */ - function hasRight(&$db,$roleQuestion,$tprojectID = null,$tplanID = null,$getAccess=false) - { - global $g_propRights_global; - global $g_propRights_product; - - $testprojectID = 0; - $testPlanID = 0; - - if (!is_null($tplanID)) { - $testPlanID = $tplanID; - } - - if (!is_null($tprojectID)) { - $testprojectID = $tprojectID; - } - - $accessPublic = null; - if ($getAccess) { - if($testprojectID > 0) { - $mgr = new testproject($db); - $accessPublic['tproject'] = $mgr->getPublicAttr($testprojectID); - unset($mgr); - } - - if($testPlanID > 0) { - $mgr = new testplan($db); - $accessPublic['tplan'] = $mgr->getPublicAttr($testPlanID); - unset($mgr); - } - } - - $userGlobalRights = (array)$this->globalRole->rights; - - $globalRights = array(); - foreach($userGlobalRights as $right) { - $globalRights[] = $right->name; - } - $allRights = $globalRights; - - $userTestProjectRoles = $this->tprojectRoles; - $userTestPlanRoles = $this->tplanRoles; - - if (isset($userTestProjectRoles[$testprojectID])) { - $userTestProjectRights = (array)$userTestProjectRoles[$testprojectID]->rights; - - // Special situation => just one right - $doMoreAnalysis = true; - if( count($userTestProjectRights) == 1) { - $doMoreAnalysis = !is_null($userTestProjectRights[0]->dbID); - } - - $allRights = null; - if( $doMoreAnalysis ) { - $testProjectRights = array(); - foreach($userTestProjectRights as $right) { - $testProjectRights[] = $right->name; - } - - // subtract global rights - $testProjectRights = array_diff($testProjectRights,array_keys($g_propRights_global)); - propagateRights($globalRights,$g_propRights_global,$testProjectRights); - $allRights = $testProjectRights; - } else { - return false; - } - } else { - if(!is_null($accessPublic) && $accessPublic['tproject'] == 0) { - return false; - } - } - - if( $testPlanID > 0) { - if (isset($userTestPlanRoles[$testPlanID])) { - $userTestPlanRights = (array) $userTestPlanRoles[$testPlanID]->rights; - $testPlanRights = array(); - foreach($userTestPlanRights as $right) { - $testPlanRights[] = $right->name; - } - - //subtract test projects rights - $testPlanRights = array_diff($testPlanRights,array_keys($g_propRights_product)); - - propagateRights($allRights,$g_propRights_product,$testPlanRights); - $allRights = $testPlanRights; - } else { - if(!is_null($accessPublic) && $accessPublic['tplan'] == 0) { - return false; - } - } - } - - $what = checkForRights($allRights,$roleQuestion); - - return $what; - } - - /** - * get array with accessible test plans for user on a test project, - * analising user roles. - * - * @param resource $db database handler - * @param int testprojectID - * @param int testplanID: default null. - * Used as filter when you want to check if this test plan - * is accessible. - * - * @param map options keys : - * 'output' => null -> get numeric array - * => map => map indexed by testplan id - * => combo => map indexed by testplan id and only returns name - * 'active' => ACTIVE (get active test plans) - * => INACTIVE (get inactive test plans) - * => TP_ALL_STATUS (get all test plans) - * - * @return array if 0 accessible test plans => null - * - * @internal revisions - * - */ - function getAccessibleTestPlans(&$db,$testprojectID,$testplanID=null, $options=null) { - $debugTag = 'Class:' . __CLASS__ . '- Method:' . __FUNCTION__ . '-'; - - $my['options'] = array( 'output' => null, 'active' => ACTIVE); - $my['options'] = array_merge($my['options'], (array)$options); - - $fields2get = ' NH.id, NH.name, TPLAN.is_public, ' . - ' COALESCE(USER_TPLAN_ROLES.testplan_id,0) AS has_role, ' . - ' USER_TPLAN_ROLES.role_id AS user_testplan_role, TPLAN.active, 0 AS selected '; - - if( $my['options']['output'] == 'mapfull' ) { - $fields2get .= ' ,TPLAN.notes, TPLAN.testproject_id '; - } - - $sql = " /* $debugTag */ SELECT {$fields2get} " . - " FROM {$this->tables['nodes_hierarchy']} NH" . - " JOIN {$this->tables['testplans']} TPLAN ON NH.id=TPLAN.id " . - " LEFT OUTER JOIN {$this->tables['user_testplan_roles']} USER_TPLAN_ROLES" . - " ON TPLAN.id = USER_TPLAN_ROLES.testplan_id " . - " AND USER_TPLAN_ROLES.user_id = " . intval($this->dbID); - - - // Construct where sentence - $where = " WHERE testproject_id = " . intval($testprojectID); - if (!is_null($my['options']['active'])) { - $where .= " AND active = {$my['options']['active']}"; - } - - if (!is_null($testplanID)) { - $where .= " AND NH.id = " . intval($testplanID); - } - - $analyseGlobalRole = 1; - $userGlobalRoleIsNoRights = ($this->globalRoleID == TL_ROLES_NO_RIGHTS); - - // Role at Test Project level is defined? - $userProjectRoleIsNoRights = 0; - if( isset($this->tprojectRoles[$testprojectID]->dbID) ) { - $userProjectRoleIsNoRights = - ($this->tprojectRoles[$testprojectID]->dbID == TL_ROLES_NO_RIGHTS); - } - - // according to new configuration option - // - // testplan_role_inheritance_mode - // - // this logic will be different - $joins = ''; - switch ( config_get('testplan_role_inheritance_mode') ) { - - case 'testproject': - // If user has a role for $testprojectID, then we DO NOT HAVE - // to check for globalRole - if( isset($this->tprojectRoles[$testprojectID]->dbID) ) { - $analyseGlobalRole = 0; - } - - // User can have NO RIGHT on test project under analisys ($testprojectID), - // in this situation he/she - // has to have a role at Test Plan level in order to access one or more test plans - // that belong to $testprojectID. - // - // Other situation: he/she has been created with role without rights ($globalNoRights) - // - if( $userProjectRoleIsNoRights || - ($analyseGlobalRole && $userGlobalRoleIsNoRights) ) { - // In order to access he/she needs specific configuration. - $where .= " AND (USER_TPLAN_ROLES.role_id IS NOT NULL AND "; - } - else { - // in this situation: - // We can use what we have inherited from test project - // OR - // We can use specific test plan role if defined - $where .= " AND (USER_TPLAN_ROLES.role_id IS NULL OR "; - } - $where .= " USER_TPLAN_ROLES.role_id != " . TL_ROLES_NO_RIGHTS .")"; - - break; - - - case 'global': - - // Because inheritance is from GLOBAL Role, do not need to care - // about existence of specific role defined AT TEST PROJECT LEVEL - - // If User has NO RIGHTS at GLOBAL Level he/she need specific - // on test plan - if( $userGlobalRoleIsNoRights ) { - // In order to access he/she needs specific configuration. - $where .= " AND (USER_TPLAN_ROLES.role_id IS NOT NULL AND "; - } - else { - // in this situation: - // We can use what we have inherited from GLOBAL - // - // OR - // We can use specific test plan role if defined - $where .= " AND (USER_TPLAN_ROLES.role_id IS NULL OR "; - } - $where .= " USER_TPLAN_ROLES.role_id != " . TL_ROLES_NO_RIGHTS .")"; - break; - } - - $sql .= $joins . $where; - - $sql .= " ORDER BY name"; - $numericIndex = false; - switch($my['options']['output']) { - case 'map': - case 'mapfull': - $testPlanSet = $db->fetchRowsIntoMap($sql,'id'); - break; - - case 'combo': - $testPlanSet = $db->fetchRowsIntoMap($sql,'id'); - break; - - default: - $testPlanSet = $db->get_recordset($sql); - $numericIndex = true; - break; - } - - // Admin exception - $doReindex = false; - if( $this->globalRoleID != TL_ROLES_ADMIN && null != $testPlanSet - && count($testPlanSet) > 0 ) { - foreach($testPlanSet as $idx => $item) { - if( $item['is_public'] == 0 && $item['has_role'] == 0 ) { - unset($testPlanSet[$idx]); - $doReindex = true; - } - } - } - - if($my['options']['output'] == 'combo') { - $dummy = array(); - foreach($testPlanSet as $idx => $item) { - $dummy[$idx] = $item['name']; - } - $testPlanSet = $dummy; - } - if( $doReindex && $numericIndex) - { - $testPlanSet = array_values($testPlanSet); - } - return $testPlanSet; - } - - - /** - * Checks the correctness of an email address - * - * @param string $email - * @return integer returns tl::OK on success, errorcode else - */ - static public function checkEmailAddress($email) - { - $result = is_blank($email) ? self::E_EMAILLENGTH : tl::OK; - if ($result == tl::OK) - { - $matches = array(); - $email_regex = config_get('validation_cfg')->user_email_valid_regex_php; - if (!preg_match($email_regex,$email,$matches)) - { - $result = self::E_EMAILFORMAT; - } - } - return $result; - } - - static public function checkFirstName($first) - { - return is_blank($first) ? self::E_FIRSTNAMELENGTH : tl::OK; - } - - static public function checkLastName($last) - { - return is_blank($last) ? self::E_LASTNAMELENGTH : tl::OK; - } - - /** - * - */ - static public function doesUserExist(&$db,$login) - { - $user = new tlUser(); - $user->login = $login; - if ($user->readFromDB($db,self::USER_O_SEARCH_BYLOGIN) >= tl::OK) { - return $user->dbID; - } - return null; - } - - /** - * - */ - static public function doesUserExistByEmail(&$db,$email) { - $user = new tlUser(); - $user->emailAddress = $email; - if ($user->readFromDB($db,self::USER_O_SEARCH_BYEMAIL) >= tl::OK) { - return $user->dbID; - } - return null; - } - - - /** - * - */ - static public function getByID(&$db,$id,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) { - return tlDBObject::createObjectFromDB($db,$id,__CLASS__,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - } - - - /** - * - */ - static public function getByIDs(&$db,$ids,$detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) { - $users = null; - - if( null == $ids ) { - return null; - } - - for($idx = 0;$idx < sizeof($ids);$idx++) { - $id = $ids[$idx]; - $user = tlDBObject::createObjectFromDB($db,$id,__CLASS__,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel); - if ($user) { - $users[$id] = $user; - } - } - return $users ? $users : null; - } - - static public function getAll(&$db,$whereClause = null,$column = null,$orderBy = null, - $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) - { - $tables = tlObject::getDBTables('users'); - $sql = " SELECT id FROM {$tables['users']} "; - if (!is_null($whereClause)) - { - $sql .= ' '.$whereClause; - } - $sql .= is_null($orderBy) ? " ORDER BY login " : $orderBy; - - return tlDBObject::createObjectsFromDBbySQL($db,$sql,'id',__CLASS__,true,$detailLevel); - } - - /** - */ - public function setActive(&$db,$value) - { - $booleanVal = intval($value) > 0 ? 1 : 0; - $sql = " UPDATE {$this->tables['users']} SET active = {$booleanVal} " . - " WHERE id = " . intval($this->dbID); - $result = $db->exec_query($sql); - return tl::OK; - } - - - /** - * Writes user password into the database - * - * @param resource &$db reference to database handler - * @return integer tl::OK if no problem written to the db, else error code - * - * (ideas regarding cookie_string -> from Mantisbt). - * - * @internal revisions - */ - public function writePasswordToDB(&$db) - { - if($this->dbID) - { - // After addition of cookie_string, and following Mantisbt pattern, - // seems we need to check if password has changed. - // - // IMPORTANT NOTICE: - // this implementation works ONLY when password is under TestLink control - // i.e. is present on TestLink Database. - // - // if answer is yes => change also cookie_string. - $t_cookie_string = null; - - $gsql = " SELECT password FROM {$this->object_table} WHERE id = " . intval($this->dbID); - $rs = $db->get_recordset($gsql); - if(strcmp($rs[0]['password'],$this->password) != 0) - { - // Password HAS CHANGED - $t_cookie_string = $this->auth_generate_unique_cookie_string($db); - } - - $sql = "UPDATE {$this->tables['users']} " . - " SET password = ". "'" . $db->prepare_string($this->password) . "'"; - - if(!is_null($t_cookie_string) ) - { - $sql .= ", cookie_string = " . "'" . $db->prepare_string($t_cookie_string) . "'"; - } - $sql .= " WHERE id = " . intval($this->dbID); - $result = $db->exec_query($sql); - } - $result = $result ? tl::OK : self::E_DBERROR; - return $result; - } - - - /** - * (from Mantisbt) - * - * Generate a string to use as the identifier for the login cookie - * It is not guaranteed to be unique and should be checked - * The string returned should be 64 characters in length - * @return string 64 character cookie string - * @access public - */ - function auth_generate_cookie_string() - { - $t_val = mt_rand( 0, mt_getrandmax() ) + mt_rand( 0, mt_getrandmax() ); - $t_val = md5( $t_val ) . md5( time() ); - return $t_val; - } - - /** - * (from Mantisbt) - * - * Return true if the cookie login identifier is unique, false otherwise - * @param string $p_cookie_string - * @return bool indicating whether cookie string is unique - * @access public - */ - function auth_is_cookie_string_unique(&$db,$p_cookie_string) - { - $sql = "SELECT COUNT(0) AS hits FROM $this->object_table " . - "WHERE cookie_string = '" . $db->prepare_string($p_cookie_string) . "'" ; - $rs = $db->fetchFirstRow($sql); - - if( !is_array($rs) ) - { - // better die because this method is used in a do/while - // that can create infinite loop - die(__METHOD__); - } - $status = ($rs['hits'] == 0); - return $status; - } - - /** - * (from Mantisbt) - * - * Generate a UNIQUE string to use as the identifier for the login cookie - * The string returned should be 64 characters in length - * - * @return string 64 character cookie string - * @access public - * - * @since 1.9.4 - */ - function auth_generate_unique_cookie_string(&$db) - { - do { - $t_cookie_string = $this->auth_generate_cookie_string(); - } - while( !$this->auth_is_cookie_string_unique($db,$t_cookie_string ) ); - - return $t_cookie_string; - } - - - /** - * (from Mantisbt) - * - * @since 1.9.4 - */ - static function auth_get_current_user_cookie() - { - $t_cookie_name = config_get('auth_cookie'); - $t_cookie = isset($_COOKIE[$t_cookie_name]) ? $_COOKIE[$t_cookie_name] : null; - return $t_cookie; - } - - /** - * (from Mantisbt) - * - * is cookie valid? - * @param string $p_cookie_string - * @return bool - * @access public - * - * @since 1.9.4 - */ - function auth_is_cookie_valid(&$db,$p_cookie_string) - { - # fail if cookie is blank - $status = ('' === $p_cookie_string) ? false : true; - - if( $status ) - { - # look up cookie in the database to see if it is valid - $sql = "SELECT COUNT(0) AS hits FROM $this->object_table " . - "WHERE cookie_string = '" . $db->prepare_string($p_cookie_string) . "'" ; - $rs = $db->fetchFirstRow($sql); - - if( !is_array($rs) ) - { - // better die because this method is used in a do/while - // that can create infinite loop - die(__METHOD__); - } - $status = ($rs['hits'] == 1); - } - return $status; - } - - /** - * (from Mantisbt) - * - * Getter - * - * @return string - * - * @since 1.9.4 - */ - public function getSecurityCookie() - { - return $this->securityCookie; - } - - /** - * - */ - static function hasRoleOnTestProject(&$dbHandler,$id,$tprojectID) - { - $tables = tlObject::getDBTables('user_testproject_roles'); - $sql = " SELECT user_id FROM {$tables['user_testproject_roles']} " . - ' WHERE testproject_id=' . intval($tprojectID) . ' AND user_id=' . intval($id); - $rs = $dbHandler->fetchRowsIntoMap($sql, "user_id"); - return !is_null($rs); - } - - /** - * - */ - static function hasRoleOnTestPlan(&$dbHandler,$id,$tplanID) - { - $tables = tlObject::getDBTables('user_testplan_roles'); - $sql = " SELECT user_id FROM {$tables['user_testplan_roles']} " . - ' WHERE testplan_id=' . intval($tplanID) . ' AND user_id=' . intval($id); - $rs = $dbHandler->fetchRowsIntoMap($sql, "user_id"); - return !is_null($rs); - } - - - /** - * - */ - static public function getByAPIKey(&$dbHandler,$value) - { - $tables = tlObject::getDBTables('users'); - $target = $dbHandler->prepare_string($value); - $sql = "SELECT * FROM {$tables['users']} WHERE script_key='" . $dbHandler->prepare_string($target) . "'"; - - $rs = $dbHandler->fetchRowsIntoMap($sql, "id"); - return $rs; - } - - /** - * @use _SESSION - * - */ - function checkGUISecurityClearance(&$dbHandler,$context,$rightsToCheck,$checkMode) - { - $doExit = false; - $action = 'any'; - $myContext = array('tproject_id' => 0, 'tplan_id' => 0); - $myContext = array_merge($myContext, $context); - - if( $doExit = (is_null($myContext) || $myContext['tproject_id'] == 0) ) - { - logAuditEvent(TLS("audit_security_no_environment",$myContext['script']), $action,$this->dbID,"users"); - } - - if( !$doExit ) - { - foreach($rightsToCheck as $verboseRight) - { - $status = $this->hasRight($dbHandler,$verboseRight,$myContext['tproject_id'],$myContext['tplan_id']); - - if( ($doExit = !$status) && ($checkMode == 'and')) - { - $action = 'any'; - logAuditEvent(TLS("audit_security_user_right_missing",$this->login,$myContext['script'],$action), - $action,$this->dbID,"users"); - break; - } - } - } - - if ($doExit){ - redirect($_SESSION['basehref'],"top.location"); - exit(); - } - } - - - /** - * - */ - static function checkPasswordQuality($password) - { - $ret = array('status_ok' => tl::OK, 'msg' => 'ok'); - $cfg = config_get('passwordChecks'); - if( is_null($cfg) ) - { - return $ret; // >>---> Bye! - } - - $regexp['number'] = "#[0-9]+#"; - $regexp['letter'] = "#[a-z]+#"; - $regexp['capital'] = "#[A-Z]+#"; - $regexp['symbol'] = "#\W+#"; - - $pl = strlen($password); - - foreach($cfg as $attr => $val) - { - $base_msg = lang_get('bad_password_' . $attr); - switch($attr) - { - case 'minlen': - if( $pl < intval($val) ) - { - $ret['status_ok'] = tl::ERROR; - $ret['msg'] = sprintf($base_msg,intval($val), $pl); - } - break; - - case 'maxlen': - if( $pl > intval($val) ) - { - $ret['status_ok'] = tl::ERROR; - $ret['msg'] = sprintf($base_msg, intval($val), $pl); - } - break; - - case 'number': - case 'letter': - case 'capital': - case 'symbol': - if( !preg_match($regexp[$attr], $password) ) - { - $ret['status_ok'] = tl::ERROR; - $ret['msg'] = $base_msg; - } - break; - } - - if($ret['status_ok'] == tl::ERROR) - { - break; - } - } - return $ret; - - } - - /** - */ - static public function setExpirationDate(&$dbHandler,$userID,$ISODate) - { - $sch = tlObject::getDBTables(array('users')); - - $setClause = " SET expiration_date = "; - if( is_null($ISODate) || trim($ISODate) == '' ) - { - $setClause .= " NULL "; - } - else - { - // it's really a date? - // if not => do nothing - try { - $xx = new DateTime($ISODate); - $setClause .= "'" . $dbHandler->prepare_string($ISODate) . "'"; - } - catch (Exception $e) { - return; - } - } - - $sql = " UPDATE {$sch['users']} {$setClause} " . - " WHERE id = " . intval($userID); - - $rx = $dbHandler->exec_query($sql); - return tl::OK; - } - - /** - * - */ - function hasRightWrap(&$db,$roleQuestion,$context=null) { - - $cx = array('tproject_id' => null,'tplan_id' => null, - 'checkPublicPrivateAttr' => false); - $cx = array_merge($cx,(array)$context); - return $this->hasRight($db,$roleQuestion, - $cx['tproject_id'],$cx['tplan_id'], - $cx['checkPublicPrivateAttr']); - } - - /** - * - */ - function hasRightOnProj(&$db,$roleQuestion) { - $tproj = null; - if (isset($_SESSION['testprojectID'])) { - $tproj = intval($_SESSION['testprojectID']); - } - return $this->hasRight($db,$roleQuestion,$tproj); - } - - +object_table = $this->tables['users']; + + $authCfg = config_get('authentication'); + $this->usernameFormat = config_get('username_format'); + $this->loginRegExp = config_get('validation_cfg')->user_login_valid_regex; + $this->maxLoginLength = 100; + $this->loginMethod = $authCfg['method']; + + $this->globalRoleID = config_get('default_roleid'); + $this->locale = config_get('default_language'); + $this->isActive = 1; + $this->tprojectRoles = null; + $this->tplanRoles = null; + } + + /** + * Cleans the object by resetting the members to default values + * + * @param mixed $options + * tlUser/tlObject options + */ + protected function _clean($options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->firstName = null; + $this->lastName = null; + $this->locale = null; + $this->password = null; + $this->isActive = null; + $this->defaultTestprojectID = null; + $this->globalRoleID = null; + $this->tprojectRoles = null; + $this->tplanRoles = null; + $this->userApiKey = null; + $this->securityCookie = null; + $this->authentication = null; + $this->expiration_date = null; + + if (! ($options & self::TLOBJ_O_SEARCH_BY_ID)) { + $this->dbID = null; + } + + if (! ($options & self::USER_O_SEARCH_BYLOGIN)) { + $this->login = null; + } + + if (! ($options & self::USER_O_SEARCH_BYEMAIL)) { + $this->emailAddress = null; + } + } + + /** + * Checks if password management is external (like LDAP)... + * + * @param string $method2check + * must be one of the keys of configuration $tlCfg->authentication['domain'] + * + * @return boolean return true if password management is external, else false + */ + public static function isPasswordMgtExternal($method2check = null) + { + $target = $method2check; + + // Contains Domain and Default Method + $authCfg = config_get('authentication'); + + if (is_null($target) || $target == '') { + $target = $authCfg['method']; + } + + $ret = true; + if (isset($authCfg['domain'][$target])) { + $ret = ! $authCfg['domain'][$target]['allowPasswordManagement']; + } + return $ret; + } + + /** + * Obtain a secure password. + * You can choose the number of alphanumeric characters to add and + * the number of non-alphanumeric characters. + * You can add another characters to the non-alphanumeric list if you need. + * + * @param integer $numAlpha + * number alphanumeric characters in generated password + * @param integer $numNonAlpha + * number special characters in generated password + * + * @return string the generated password + */ + public static function generatePassword($numAlpha = 6, $numNonAlpha = 2) + { + $listAlpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + $listNonAlpha = ',;:!?.$/*-+&@_+;./*&?$-!,'; + + return str_shuffle( + substr(str_shuffle($listAlpha), 0, $numAlpha) . + substr(str_shuffle($listNonAlpha), 0, $numNonAlpha)); + } + + /** + * not used at the moment, only placeholder + * + * @return void + * @todo implement + */ + private function create() + {} + + // ----- BEGIN interface iDBSerialization ----- + /** + * Reads an user object identified by its database id from the given database + * + * @param + * resource &$db reference to database handler + * @param mixed $options + * (optional) tlUser/tlObject options + * + * @return integer tl::OK if the object could be read from the db, else tl::ERROR + */ + public function readFromDB(&$db, $options = self::TLOBJ_O_SEARCH_BY_ID) + { + $this->_clean($options); + $sql = " SELECT id,login,password,cookie_string,first,last,email," . + " role_id,locale, " . + " login AS fullname, active,default_testproject_id, script_key,auth_method,creation_ts,expiration_date " . + " FROM {$this->object_table}"; + $clauses = null; + + if ($options & self::TLOBJ_O_SEARCH_BY_ID) { + $clauses[] = "id = " . intval($this->dbID); + } + + if ($options & self::USER_O_SEARCH_BYLOGIN) { + $clauses[] = "login = '" . $db->prepare_string($this->login) . "'"; + } + + if ($options & self::USER_O_SEARCH_BYEMAIL) { + $clauses[] = "email = '" . $db->prepare_string($this->emailAddress) . + "'"; + } + + if ($clauses) { + $sql .= " WHERE " . implode(" AND ", $clauses); + } + $info = $db->fetchFirstRow($sql); + if ($info) { + $this->dbID = $info['id']; + $this->firstName = $info['first']; + $this->lastName = $info['last']; + $this->login = $info['login']; + $this->emailAddress = $info['email']; + $this->globalRoleID = $info['role_id']; + $this->userApiKey = $info['script_key']; + $this->securityCookie = $info['cookie_string']; + $this->authentication = $info['auth_method']; + $this->expiration_date = $info['expiration_date']; + $this->creation_ts = $info['creation_ts']; + + if ($this->globalRoleID) { + $this->globalRole = new tlRole($this->globalRoleID); + $this->globalRole->readFromDB($db); + } + + if ($this->detailLevel & self::TLOBJ_O_GET_DETAIL_ROLES) { + $this->readTestProjectRoles($db); + $this->readTestPlanRoles($db); + } + + $this->locale = $info['locale']; + $this->password = $info['password']; + $this->isActive = $info['active']; + $this->defaultTestprojectID = $info['default_testproject_id']; + } + return $info ? tl::OK : tl::ERROR; + } + + /** + * Fetches all the testproject roles of of the user, and store them into the object. + * Result could be limited to a certain testproject + * + * @param + * resource &$db reference to database handler + * @param integer $testProjectID + * Identifier of the testproject to read the roles for, + * if null all roles are read + * + * @return integer returns tl::OK + */ + public function readTestProjectRoles(&$db, $testProjectID = null) + { + $sql = "SELECT testproject_id,role_id " . + " FROM {$this->tables['user_testproject_roles']} user_testproject_roles " . + " WHERE user_id = " . intval($this->dbID); + + if ($testProjectID) { + $sql .= " AND testproject_id = " . intval($testProjectID); + } + $allRoles = $db->fetchColumnsIntoMap($sql, 'testproject_id', 'role_id'); + $this->tprojectRoles = null; + if (null != $allRoles && count($allRoles)) { + $roleCache = null; + foreach ($allRoles as $tprojectID => $roleID) { + if (! isset($roleCache[$roleID])) { + $tprojectRole = tlRole::createObjectFromDB($db, $roleID, + "tlRole", true); + $roleCache[$roleID] = $tprojectRole; + } else { + $tprojectRole = clone $roleCache[$roleID]; + } + + if ($tprojectRole) { + $this->tprojectRoles[$tprojectID] = $tprojectRole; + } + } + } + return tl::OK; + } + + /** + * Fetches all the testplan roles of of the user, and store them into the object. + * Result could be limited to a certain testplan + * + * @param + * resource &$db reference to database handler + * @param integer $testPlanID + * Identifier of the testplan to read the roles for, if null all roles are read + * + * @return integer returns tl::OK + */ + public function readTestPlanRoles(&$db, $testPlanID = null) + { + $sql = "SELECT testplan_id,role_id " . + " FROM {$this->tables['user_testplan_roles']} user_testplan_roles " . + " WHERE user_id = " . intval($this->dbID); + if ($testPlanID) { + $sql .= " AND testplan_id = " . intval($testPlanID); + } + + $allRoles = $db->fetchColumnsIntoMap($sql, 'testplan_id', 'role_id'); + $this->tplanRoles = null; + if (null != $allRoles && count($allRoles)) { + $roleCache = null; + foreach ($allRoles as $tplanID => $roleID) { + if (! isset($roleCache[$roleID])) { + $tplanRole = tlRole::createObjectFromDB($db, $roleID, + "tlRole", true); + $roleCache[$roleID] = $tplanRole; + } else { + $tplanRole = clone $roleCache[$roleID]; + } + + if ($tplanRole) { + $this->tplanRoles[$tplanID] = $tplanRole; + } + } + } + return tl::OK; + } + + /** + * Writes the object into the database + * + * @param + * resource &$db reference to database handler + * @return integer tl::OK if the object could be written to the db, else error code + */ + public function writeToDB(&$db) + { + $result = $this->checkDetails($db); + if ($result >= tl::OK) { + $t_cookie_string = $this->auth_generate_unique_cookie_string($db); + + // After addition of cookie_string, and following Mantisbt pattern, + // seems we need to check if password has changed. + // + // IMPORTANT NOTICE: + // this implementation works ONLY when password is under TestLink control + // i.e. is present on TestLink Database. + // + // if answer is yes => change also cookie_string. + if ($this->dbID) { + $gsql = " /* debugMsg */ SELECT password FROM {$this->object_table} WHERE id = " . + $this->dbID; + $rs = $db->get_recordset($gsql); + if (strcmp($rs[0]['password'], $this->password) == 0) { + // NO password change + $t_cookie_string = null; + } + + $sql = "/* debugMsg */ UPDATE {$this->tables['users']} " . + " SET first = '" . $db->prepare_string($this->firstName) . + "'" . ", last = '" . $db->prepare_string($this->lastName) . + "'" . ", email = '" . + $db->prepare_string($this->emailAddress) . "'" . + ", locale = " . "'" . $db->prepare_string($this->locale) . + "'" . ", password = " . "'" . + $db->prepare_string($this->password) . "'" . ", role_id = " . + $db->prepare_int($this->globalRoleID) . ", active = " . + $db->prepare_string($this->isActive) . ", auth_method = " . + "'" . $db->prepare_string($this->authentication) . "'"; + + if (! is_null($t_cookie_string)) { + $sql .= ", cookie_string = " . "'" . + $db->prepare_string($t_cookie_string) . "'"; + } + $sql .= " WHERE id = " . intval($this->dbID); + $result = $db->exec_query($sql); + } else { + $sql = "/* debugMsg */ INSERT INTO {$this->tables['users']} " . + " (login,password,cookie_string,first,last,email,role_id,locale,active,auth_method) " . + " VALUES ('" . $db->prepare_string($this->login) . "','" . + $db->prepare_string($this->password) . "','" . + $db->prepare_string($t_cookie_string) . "','" . + $db->prepare_string($this->firstName) . "','" . + $db->prepare_string($this->lastName) . "','" . + $db->prepare_string($this->emailAddress) . "'," . + $db->prepare_int($this->globalRoleID) . ",'" . + $db->prepare_string($this->locale) . "'," . $this->isActive . + "," . "'" . $db->prepare_string($this->authentication) . "'" . + ")"; + + $result = $db->exec_query($sql); + if ($result) { + $this->dbID = $db->insert_id($this->tables['users']); + } + } + $result = $result ? tl::OK : self::E_DBERROR; + } + return $result; + } + + /** + * WARNING: DO NOT USE THE FUNCTION - CAUSES DB INCONSISTENCE! + * + * @deprecated 1.8.3 + * @see #2407 + */ + public function deleteFromDB(&$db) + { + $safeUserID = intval($this->dbID); + $sqlSet = array(); + $sqlSet[] = "DELETE FROM {$this->table['user_assignments']} WHERE user_id = {$safeUserID}"; + $sqlSet[] = "DELETE FROM {$this->table['users']} WHERE id = {$safeUserID}"; + + foreach ($sqlSet as $sql) { + $result = $db->exec_query($sql) ? tl::OK : tl::ERROR; + if ($result == tl::ERROR) { + break; + } + } + + if ($result == tl::OK) { + $result = $this->deleteTestProjectRoles($db); + } + return $result; + } + + /** + * Deletes all testproject related role assignments for a given user + * + * @param + * resource &$db reference to database handler + * @param integer $userID + * the user ID + * + * @return integer tl::OK on success, tl:ERROR else + */ + protected function deleteTestProjectRoles(&$db) + { + $sql = "DELETE FROM {$this->tables['user_testproject_roles']} WHERE user_id = " . + intval($this->dbID); + return $db->exec_query($sql) ? tl::OK : tl::ERROR; + } + + /** + * Returns a user friendly representation of the user name + * + * @return string the display nmae + */ + public function getDisplayName($format = null) + { + $keys = array( + '%first%', + '%last%', + '%login%', + '%email%' + ); + $values = array( + $this->firstName, + $this->lastName, + $this->login, + $this->emailAddress + ); + + $fmt = is_null($format) ? $this->usernameFormat : $format; + return trim(str_replace($keys, $values, $fmt)); + } + + /** + * Encrypts a given password with MD5 + * + * @param string $pwd + * the password to encrypt + * @return string the encrypted password + */ + protected function encryptPassword($pwd, $authentication = null) + { + if (self::isPasswordMgtExternal($authentication)) { + return self::S_PWDMGTEXTERNAL; + } + + return password_hash($pwd, PASSWORD_DEFAULT); + } + + /** + * Set encrypted password + * + * @param string $pwd + * the new password + * @return integer return tl::OK is the password is stored, else errorcode + */ + public function setPassword($pwd, $authentication = null) + { + if (self::isPasswordMgtExternal($authentication)) { + return self::S_PWDMGTEXTERNAL; + } + $pwd = trim($pwd); + if ($pwd == "") { + return self::E_PWDEMPTY; + } + $this->password = $this->encryptPassword($pwd, $authentication); + return tl::OK; + } + + /** + * Getter for the password of the user + * + * @return string the password of the user + */ + public function getPassword() + { + return $this->password; + } + + /** + * compares a given password with the current password of the user + * + * @param string $pwd + * the password to compate with the password actually set + * @return integer returns tl::OK if the password's match, else errorcode + */ + public function comparePassword(&$dbH, $pwd) + { + if (self::isPasswordMgtExternal($this->authentication)) { + return self::S_PWDMGTEXTERNAL; + } + + // If we are here this means that we are using + // internal password management. + // + // Manage migration from MD5 + // MD5 hash check + // This is valid ONLY for internal password management + $encriptedPWD = $this->getPassword(); + /* Update the old MD5 hash to the new bcrypt */ + if (strlen($encriptedPWD) == 32 && $encriptedPWD === md5($pwd)) { + $this->password = $this->encryptPassword($pwd, $this->authentication); + $this->writePasswordToDB($dbH); + return tl::OK; + } + + if (password_verify($pwd, $encriptedPWD)) { + return tl::OK; + } + + return self::E_PWDDONTMATCH; + } + + /** + */ + public function checkDetails(&$db) + { + $this->firstName = trim($this->firstName); + $this->lastName = trim($this->lastName); + $this->emailAddress = trim($this->emailAddress); + $this->locale = trim($this->locale); + $this->isActive = intval($this->isActive); + $this->login = trim($this->login); + + $result = self::checkEmailAddress($this->emailAddress); + if ($result >= tl::OK) { + $result = $this->checkLogin($this->login); + } + if ($result >= tl::OK && ! $this->dbID) { + $result = self::doesUserExist($db, $this->login) ? self::E_LOGINALREADYEXISTS : tl::OK; + } + if ($result >= tl::OK) { + $result = self::checkFirstName($this->firstName); + } + if ($result >= tl::OK) { + $result = self::checkLastName($this->lastName); + } + return $result; + } + + public function checkLogin($login) + { + $result = tl::OK; + $login = trim($login); + + if ($login == "" || (tlStringLen($login) > $this->maxLoginLength)) { + $result = self::E_LOGINLENGTH; + } elseif (! preg_match($this->loginRegExp, $login)) { + // Only allow a basic set of characters + $result = self::E_NOTALLOWED; + } + return $result; + } + + /** + * Returns the id of the effective role in the context of ($tproject_id,$tplan_id) + * + * @param + * resource &$db reference to database handler + * @param integer $tproject_id + * the testproject id + * @param integer $tplan_id + * the plan id + * + * @return integer tlRole the effective role + */ + public function getEffectiveRole(&$db, $tproject_id, $tplan_id) + { + $tprojects_role = $this->tprojectRoles; + $tplans_role = $this->tplanRoles; + $effective_role = $this->globalRole; + + if (! is_null($tplans_role) && isset($tplans_role[$tplan_id])) { + $effective_role = $tplans_role[$tplan_id]; + } elseif (! is_null($tprojects_role) && + isset($tprojects_role[$tproject_id])) { + $effective_role = $tprojects_role[$tproject_id]; + } + return $effective_role; + } + + /** + * Gets all userids of users with a certain testplan role + * + * @todo WRITE RIGHT COMMENTS FROM START + * + * @param + * resource &$db reference to database handler + * @return array returns array of userids + */ + protected function getUserNamesWithTestPlanRole(&$db) + { + $sql = "SELECT DISTINCT id FROM {$this->tables['users']} users," . + " {$this->tables['user_testplan_roles']} user_testplan_roles " . + " WHERE users.id = user_testplan_roles.user_id"; + $sql .= " AND user_testplan_roles.role_id = " . intval($this->dbID); + return $db->fetchColumnsIntoArray($sql, "id"); + } + + /** + * Get a list of names with a defined project right (for example for combo-box) + * used by ajax script getUsersWithRight.php + * + * @param integer $db + * DB Identifier + * @param string $rightNick + * key corresponding with description in rights table + * @param integer $testprojectID + * Identifier of project + * + * @return array list of user IDs and names + * + * @todo fix the case that user has default role with a right but project role without + * i.e. he should be listed + */ + public function getNamesForProjectRight(&$db, $rightNick, + $testprojectID = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (is_null($testprojectID)) { + tLog($debugMsg . ' requires Test Project ID defined', 'ERROR'); + return null; + } + + // get users for default roles + $sql = "/* $debugMsg */ SELECT DISTINCT u.id,u.login,u.first,u.last FROM {$this->tables['users']} u" . + " JOIN {$this->tables['role_rights']} a ON a.role_id=u.role_id" . + " JOIN {$this->tables['rights']} b ON a.right_id = b.id " . + " WHERE b.description='" . $db->prepare_string($rightNick) . "'"; + $defaultRoles = $db->fetchRowsIntoMap($sql, 'id'); + + // get users for project roles + $sql = "/* $debugMsg */ SELECT DISTINCT u.id,u.login,u.first,u.last FROM {$this->tables['users']} u" . + " JOIN {$this->tables['user_testproject_roles']} p ON p.user_id=u.id" . + " AND p.testproject_id=" . intval($testprojectID) . + " JOIN {$this->tables['role_rights']} a ON a.role_id=p.role_id" . + " JOIN {$this->tables['rights']} b ON a.right_id = b.id " . + " WHERE b.description='" . $db->prepare_string($rightNick) . "'"; + $projectRoles = $db->fetchRowsIntoMap($sql, 'id'); + + // merge arrays + // the next function is available from php53 but we support php52 + // $output = array_replace($output1, $output2); + if (! is_null($projectRoles)) { + foreach ($projectRoles as $k => $v) { + if (! isset($defaultRoles[$k])) { + $defaultRoles[$k] = $v; + } + } + } + + // format for ext-js combo-box (remove associated array) + // foreach($defaultRoles as $k => $v) + // { + // $output[] = $v; + // } + return array_values($defaultRoles); + } + + /** + * Get a list of all names + * used for replacement user ID by user login + * + * @param integer $db + * DB Identifier + * @return array list of user IDs and names + */ + public function getNames(&$db, $idSet = null) + { + $sql = " SELECT id,login,first,last FROM {$this->tables['users']}"; + + $inClause = ''; + if (! is_null($idSet)) { + $inClause = " WHERE id IN (" . implode(',', (array) $idSet) . ") "; + } + + return $db->fetchRowsIntoMap($sql . $inClause, 'id'); + } + + /** + * check right on effective role for user, using test project and test plan, + * means that check right on effective role. + * + * @return string|null 'yes' or null + * + * @internal revisions + */ + public function hasRight(&$db, $roleQuestion, $tprojectID = null, + $tplanID = null, $getAccess = false) + { + global $g_propRights_global; + global $g_propRights_product; + + $testprojectID = 0; + $testPlanID = 0; + + if (! is_null($tplanID)) { + $testPlanID = $tplanID; + } + + if (! is_null($tprojectID)) { + $testprojectID = $tprojectID; + } + + $accessPublic = null; + if ($getAccess) { + if ($testprojectID > 0) { + $mgr = new testproject($db); + $accessPublic['tproject'] = $mgr->getPublicAttr($testprojectID); + unset($mgr); + } + + if ($testPlanID > 0) { + $mgr = new testplan($db); + $accessPublic['tplan'] = $mgr->getPublicAttr($testPlanID); + unset($mgr); + } + } + + $userGlobalRights = (array) $this->globalRole->rights; + + $globalRights = array(); + foreach ($userGlobalRights as $right) { + $globalRights[] = $right->name; + } + $allRights = $globalRights; + + $userTestProjectRoles = $this->tprojectRoles; + $userTestPlanRoles = $this->tplanRoles; + + if (isset($userTestProjectRoles[$testprojectID])) { + $userTestProjectRights = (array) $userTestProjectRoles[$testprojectID]->rights; + + // Special situation => just one right + $doMoreAnalysis = true; + if (count($userTestProjectRights) == 1) { + $doMoreAnalysis = ! is_null($userTestProjectRights[0]->dbID); + } + + $allRights = null; + if ($doMoreAnalysis) { + $testProjectRights = array(); + foreach ($userTestProjectRights as $right) { + $testProjectRights[] = $right->name; + } + + // subtract global rights + $testProjectRights = array_diff($testProjectRights, + array_keys($g_propRights_global)); + propagateRights($globalRights, $g_propRights_global, + $testProjectRights); + $allRights = $testProjectRights; + } else { + return false; + } + } else { + if (! is_null($accessPublic) && $accessPublic['tproject'] == 0) { + return false; + } + } + + if ($testPlanID > 0) { + if (isset($userTestPlanRoles[$testPlanID])) { + $userTestPlanRights = (array) $userTestPlanRoles[$testPlanID]->rights; + $testPlanRights = array(); + foreach ($userTestPlanRights as $right) { + $testPlanRights[] = $right->name; + } + + // subtract test projects rights + $testPlanRights = array_diff($testPlanRights, + array_keys($g_propRights_product)); + + propagateRights($allRights, $g_propRights_product, + $testPlanRights); + $allRights = $testPlanRights; + } else { + if (! is_null($accessPublic) && $accessPublic['tplan'] == 0) { + return false; + } + } + } + + return checkForRights($allRights, $roleQuestion); + } + + /** + * get array with accessible test plans for user on a test project, + * analising user roles. + * + * @param resource $db + * database handler + * @param + * int testprojectID + * @param + * int testplanID: default null. + * Used as filter when you want to check if this test plan + * is accessible. + * + * @param + * map options keys : + * 'output' => null -> get numeric array + * => map => map indexed by testplan id + * => combo => map indexed by testplan id and only returns name + * 'active' => ACTIVE (get active test plans) + * => INACTIVE (get inactive test plans) + * => TP_ALL_STATUS (get all test plans) + * + * @return array if 0 accessible test plans => null + * + * @internal revisions + * + */ + public function getAccessibleTestPlans(&$db, $testprojectID, + $testplanID = null, $options = null) + { + $debugTag = 'Class:' . __CLASS__ . '- Method:' . __FUNCTION__ . '-'; + + $my['options'] = array( + 'output' => null, + 'active' => ACTIVE + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $fields2get = ' NH.id, NH.name, TPLAN.is_public, ' . + ' COALESCE(USER_TPLAN_ROLES.testplan_id,0) AS has_role, ' . + ' USER_TPLAN_ROLES.role_id AS user_testplan_role, TPLAN.active, 0 AS selected '; + + if ($my['options']['output'] == 'mapfull') { + $fields2get .= ' ,TPLAN.notes, TPLAN.testproject_id '; + } + + $sql = " /* $debugTag */ SELECT {$fields2get} " . + " FROM {$this->tables['nodes_hierarchy']} NH" . + " JOIN {$this->tables['testplans']} TPLAN ON NH.id=TPLAN.id " . + " LEFT OUTER JOIN {$this->tables['user_testplan_roles']} USER_TPLAN_ROLES" . + " ON TPLAN.id = USER_TPLAN_ROLES.testplan_id " . + " AND USER_TPLAN_ROLES.user_id = " . intval($this->dbID); + + // Construct where sentence + $where = " WHERE testproject_id = " . intval($testprojectID); + if (! is_null($my['options']['active'])) { + $where .= " AND active = {$my['options']['active']}"; + } + + if (! is_null($testplanID)) { + $where .= " AND NH.id = " . intval($testplanID); + } + + $analyseGlobalRole = 1; + $userGlobalRoleIsNoRights = ($this->globalRoleID == TL_ROLES_NO_RIGHTS); + + // Role at Test Project level is defined? + $userProjectRoleIsNoRights = 0; + if (isset($this->tprojectRoles[$testprojectID]->dbID)) { + $userProjectRoleIsNoRights = ($this->tprojectRoles[$testprojectID]->dbID == + TL_ROLES_NO_RIGHTS); + } + + // according to new configuration option + // + // testplan_role_inheritance_mode + // + // this logic will be different + $joins = ''; + switch (config_get('testplan_role_inheritance_mode')) { + + case 'testproject': + // If user has a role for $testprojectID, then we DO NOT HAVE + // to check for globalRole + if (isset($this->tprojectRoles[$testprojectID]->dbID)) { + $analyseGlobalRole = 0; + } + + // User can have NO RIGHT on test project under analisys ($testprojectID), + // in this situation he/she + // has to have a role at Test Plan level in order to access one or more test plans + // that belong to $testprojectID. + // + // Other situation: he/she has been created with role without rights ($globalNoRights) + // + if ($userProjectRoleIsNoRights || + ($analyseGlobalRole && $userGlobalRoleIsNoRights)) { + // In order to access he/she needs specific configuration. + $where .= " AND (USER_TPLAN_ROLES.role_id IS NOT NULL AND "; + } else { + // in this situation: + // We can use what we have inherited from test project + // OR + // We can use specific test plan role if defined + $where .= " AND (USER_TPLAN_ROLES.role_id IS NULL OR "; + } + $where .= " USER_TPLAN_ROLES.role_id != " . TL_ROLES_NO_RIGHTS . + ")"; + + break; + + case 'global': + + // Because inheritance is from GLOBAL Role, do not need to care + // about existence of specific role defined AT TEST PROJECT LEVEL + + // If User has NO RIGHTS at GLOBAL Level he/she need specific + // on test plan + if ($userGlobalRoleIsNoRights) { + // In order to access he/she needs specific configuration. + $where .= " AND (USER_TPLAN_ROLES.role_id IS NOT NULL AND "; + } else { + // in this situation: + // We can use what we have inherited from GLOBAL + // + // OR + // We can use specific test plan role if defined + $where .= " AND (USER_TPLAN_ROLES.role_id IS NULL OR "; + } + $where .= " USER_TPLAN_ROLES.role_id != " . TL_ROLES_NO_RIGHTS . + ")"; + break; + } + + $sql .= $joins . $where; + + $sql .= " ORDER BY name"; + $numericIndex = false; + switch ($my['options']['output']) { + case 'map': + case 'mapfull': + $testPlanSet = $db->fetchRowsIntoMap($sql, 'id'); + break; + + case 'combo': + $testPlanSet = $db->fetchRowsIntoMap($sql, 'id'); + break; + + default: + $testPlanSet = $db->get_recordset($sql); + $numericIndex = true; + break; + } + + // Admin exception + $doReindex = false; + if ($this->globalRoleID != TL_ROLES_ADMIN && null != $testPlanSet && + ! empty($testPlanSet)) { + foreach ($testPlanSet as $idx => $item) { + if ($item['is_public'] == 0 && $item['has_role'] == 0) { + unset($testPlanSet[$idx]); + $doReindex = true; + } + } + } + + if ($my['options']['output'] == 'combo') { + $dummy = array(); + foreach ($testPlanSet as $idx => $item) { + $dummy[$idx] = $item['name']; + } + $testPlanSet = $dummy; + } + if ($doReindex && $numericIndex) { + $testPlanSet = array_values($testPlanSet); + } + return $testPlanSet; + } + + /** + * Checks the correctness of an email address + * + * @param string $email + * @return integer returns tl::OK on success, errorcode else + */ + public static function checkEmailAddress($email) + { + $result = isBlank($email) ? self::E_EMAILLENGTH : tl::OK; + if ($result == tl::OK) { + $matches = array(); + $email_regex = config_get('validation_cfg')->user_email_valid_regex_php; + if (! preg_match($email_regex, $email, $matches)) { + $result = self::E_EMAILFORMAT; + } + } + return $result; + } + + public static function checkFirstName($first) + { + return isBlank($first) ? self::E_FIRSTNAMELENGTH : tl::OK; + } + + public static function checkLastName($last) + { + return isBlank($last) ? self::E_LASTNAMELENGTH : tl::OK; + } + + /** + */ + public static function doesUserExist(&$db, $login) + { + $user = new tlUser(); + $user->login = $login; + if ($user->readFromDB($db, self::USER_O_SEARCH_BYLOGIN) >= tl::OK) { + return $user->dbID; + } + return null; + } + + /** + */ + public static function doesUserExistByEmail(&$db, $email) + { + $user = new tlUser(); + $user->emailAddress = $email; + if ($user->readFromDB($db, self::USER_O_SEARCH_BYEMAIL) >= tl::OK) { + return $user->dbID; + } + return null; + } + + /** + */ + public static function getByID(&$db, $id, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + return tlDBObject::createObjectFromDB($db, $id, __CLASS__, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + } + + /** + */ + public static function getByIDs(&$db, $ids, + $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $users = null; + + if (null == $ids) { + return null; + } + + for ($idx = 0; $idx < count($ids); $idx ++) { + $id = $ids[$idx]; + $user = tlDBObject::createObjectFromDB($db, $id, __CLASS__, + self::TLOBJ_O_SEARCH_BY_ID, $detailLevel); + if ($user) { + $users[$id] = $user; + } + } + return $users ? $users : null; + } + + public static function getAll(&$db, $whereClause = null, $column = null, + $orderBy = null, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL) + { + $tables = tlObject::getDBTables('users'); + $sql = " SELECT id FROM {$tables['users']} "; + if (! is_null($whereClause)) { + $sql .= ' ' . $whereClause; + } + $sql .= is_null($orderBy) ? " ORDER BY login " : $orderBy; + + return tlDBObject::createObjectsFromDBbySQL($db, $sql, 'id', __CLASS__, + true, $detailLevel); + } + + /** + */ + public function setActive(&$db, $value) + { + $booleanVal = intval($value) > 0 ? 1 : 0; + $sql = " UPDATE {$this->tables['users']} SET active = {$booleanVal} " . + " WHERE id = " . intval($this->dbID); + $db->exec_query($sql); + return tl::OK; + } + + /** + * Writes user password into the database + * + * @param + * resource &$db reference to database handler + * @return integer tl::OK if no problem written to the db, else error code + * + * (ideas regarding cookie_string -> from Mantisbt). + * + * @internal revisions + */ + public function writePasswordToDB(&$db) + { + if ($this->dbID) { + // After addition of cookie_string, and following Mantisbt pattern, + // seems we need to check if password has changed. + // + // IMPORTANT NOTICE: + // this implementation works ONLY when password is under TestLink control + // i.e. is present on TestLink Database. + // + // if answer is yes => change also cookie_string. + $t_cookie_string = null; + + $gsql = " SELECT password FROM {$this->object_table} WHERE id = " . + intval($this->dbID); + $rs = $db->get_recordset($gsql); + if (strcmp($rs[0]['password'], $this->password) != 0) { + // Password HAS CHANGED + $t_cookie_string = $this->auth_generate_unique_cookie_string( + $db); + } + + $sql = "UPDATE {$this->tables['users']} " . " SET password = " . "'" . + $db->prepare_string($this->password) . "'"; + + if (! is_null($t_cookie_string)) { + $sql .= ", cookie_string = " . "'" . + $db->prepare_string($t_cookie_string) . "'"; + } + $sql .= " WHERE id = " . intval($this->dbID); + $result = $db->exec_query($sql); + } + $result = $result ? tl::OK : self::E_DBERROR; + return $result; + } + + /** + * (from Mantisbt) + * + * Generate a string to use as the identifier for the login cookie + * It is not guaranteed to be unique and should be checked + * The string returned should be 64 characters in length + * + * @return string 64 character cookie string + * @access public + */ + private function auth_generate_cookie_string() + { + $t_val = mt_rand(0, mt_getrandmax()) + mt_rand(0, mt_getrandmax()); + $t_val = md5($t_val) . md5(time()); + return $t_val; + } + + /** + * (from Mantisbt) + * + * Return true if the cookie login identifier is unique, false otherwise + * + * @param string $p_cookie_string + * @return bool indicating whether cookie string is unique + * @access public + */ + private function auth_is_cookie_string_unique(&$db, $p_cookie_string) + { + $sql = "SELECT COUNT(0) AS hits FROM $this->object_table " . + "WHERE cookie_string = '" . $db->prepare_string($p_cookie_string) . + "'"; + $rs = $db->fetchFirstRow($sql); + + if (! is_array($rs)) { + // better die because this method is used in a do/while + // that can create infinite loop + die(__METHOD__); + } + return $rs['hits'] == 0; + } + + /** + * (from Mantisbt) + * + * Generate a UNIQUE string to use as the identifier for the login cookie + * The string returned should be 64 characters in length + * + * @return string 64 character cookie string + * @access public + * + * @since 1.9.4 + */ + private function auth_generate_unique_cookie_string(&$db) + { + do { + $t_cookie_string = $this->auth_generate_cookie_string(); + } while (! $this->auth_is_cookie_string_unique($db, $t_cookie_string)); + + return $t_cookie_string; + } + + /** + * (from Mantisbt) + * + * @since 1.9.4 + */ + public static function auth_get_current_user_cookie() + { + $t_cookie_name = config_get('auth_cookie'); + return isset($_COOKIE[$t_cookie_name]) ? $_COOKIE[$t_cookie_name] : null; + } + + /** + * (from Mantisbt) + * + * is cookie valid? + * + * @param string $p_cookie_string + * @return bool + * @access public + * + * @since 1.9.4 + */ + private function auth_is_cookie_valid(&$db, $p_cookie_string) + { + # fail if cookie is blank + $status = ('' === $p_cookie_string) ? false : true; + + if ($status) { + # look up cookie in the database to see if it is valid + $sql = "SELECT COUNT(0) AS hits FROM $this->object_table " . + "WHERE cookie_string = '" . + $db->prepare_string($p_cookie_string) . "'"; + $rs = $db->fetchFirstRow($sql); + + if (! is_array($rs)) { + // better die because this method is used in a do/while + // that can create infinite loop + die(__METHOD__); + } + $status = ($rs['hits'] == 1); + } + return $status; + } + + /** + * (from Mantisbt) + * + * Getter + * + * @return string + * + * @since 1.9.4 + */ + public function getSecurityCookie() + { + return $this->securityCookie; + } + + /** + */ + public static function hasRoleOnTestProject(&$dbHandler, $id, $tprojectID) + { + $tables = tlObject::getDBTables('user_testproject_roles'); + $sql = " SELECT user_id FROM {$tables['user_testproject_roles']} " . + ' WHERE testproject_id=' . intval($tprojectID) . ' AND user_id=' . + intval($id); + $rs = $dbHandler->fetchRowsIntoMap($sql, "user_id"); + return ! is_null($rs); + } + + /** + */ + public static function hasRoleOnTestPlan(&$dbHandler, $id, $tplanID) + { + $tables = tlObject::getDBTables('user_testplan_roles'); + $sql = " SELECT user_id FROM {$tables['user_testplan_roles']} " . + ' WHERE testplan_id=' . intval($tplanID) . ' AND user_id=' . + intval($id); + $rs = $dbHandler->fetchRowsIntoMap($sql, "user_id"); + return ! is_null($rs); + } + + /** + */ + public static function getByAPIKey(&$dbHandler, $value) + { + $tables = tlObject::getDBTables('users'); + $target = $dbHandler->prepare_string($value); + $sql = "SELECT * FROM {$tables['users']} WHERE script_key='" . + $dbHandler->prepare_string($target) . "'"; + + return $dbHandler->fetchRowsIntoMap($sql, "id"); + } + + /** + * + * @use _SESSION + * + */ + public function checkGUISecurityClearance(&$dbHandler, $context, + $rightsToCheck, $checkMode) + { + $doExit = false; + $action = 'any'; + $myContext = array( + 'tproject_id' => 0, + 'tplan_id' => 0 + ); + $myContext = array_merge($myContext, $context); + + if ($doExit = (is_null($myContext) || $myContext['tproject_id'] == 0)) { + logAuditEvent( + TLS("audit_security_no_environment", $myContext['script']), + $action, $this->dbID, "users"); + } + + if (! $doExit) { + foreach ($rightsToCheck as $verboseRight) { + $status = $this->hasRight($dbHandler, $verboseRight, + $myContext['tproject_id'], $myContext['tplan_id']); + + if (($doExit = ! $status) && ($checkMode == 'and')) { + $action = 'any'; + logAuditEvent( + TLS("audit_security_user_right_missing", $this->login, + $myContext['script'], $action), $action, $this->dbID, + "users"); + break; + } + } + } + + if ($doExit) { + redirect($_SESSION['basehref'], "top.location"); + exit(); + } + } + + /** + */ + public static function checkPasswordQuality($password) + { + $ret = array( + 'status_ok' => tl::OK, + 'msg' => 'ok' + ); + $cfg = config_get('passwordChecks'); + if (is_null($cfg)) { + return $ret; // >>---> Bye! + } + + $regexp['number'] = "#[0-9]+#"; + $regexp['letter'] = "#[a-z]+#"; + $regexp['capital'] = "#[A-Z]+#"; + $regexp['symbol'] = "#\W+#"; + + $pl = strlen($password); + + foreach ($cfg as $attr => $val) { + $base_msg = lang_get('bad_password_' . $attr); + switch ($attr) { + case 'minlen': + if ($pl < intval($val)) { + $ret['status_ok'] = tl::ERROR; + $ret['msg'] = sprintf($base_msg, intval($val), $pl); + } + break; + + case 'maxlen': + if ($pl > intval($val)) { + $ret['status_ok'] = tl::ERROR; + $ret['msg'] = sprintf($base_msg, intval($val), $pl); + } + break; + + case 'number': + case 'letter': + case 'capital': + case 'symbol': + if (! preg_match($regexp[$attr], $password)) { + $ret['status_ok'] = tl::ERROR; + $ret['msg'] = $base_msg; + } + break; + } + + if ($ret['status_ok'] == tl::ERROR) { + break; + } + } + return $ret; + } + + /** + */ + public static function setExpirationDate(&$dbHandler, $userID, $isoDate) + { + $sch = tlObject::getDBTables(array( + 'users' + )); + + $setClause = " SET expiration_date = "; + if (is_null($isoDate) || trim($isoDate) == '') { + $setClause .= " NULL "; + } else { + // it's really a date? + // if not => do nothing + try { + $setClause .= "'" . $dbHandler->prepare_string($isoDate) . "'"; + } catch (Exception $e) { + return; + } + } + + $sql = " UPDATE {$sch['users']} {$setClause} " . " WHERE id = " . + intval($userID); + + $dbHandler->exec_query($sql); + return tl::OK; + } + + /** + */ + private function hasRightWrap(&$db, $roleQuestion, $context = null) + { + $cx = array( + 'tproject_id' => null, + 'tplan_id' => null, + 'checkPublicPrivateAttr' => false + ); + $cx = array_merge($cx, (array) $context); + return $this->hasRight($db, $roleQuestion, $cx['tproject_id'], + $cx['tplan_id'], $cx['checkPublicPrivateAttr']); + } + + /** + */ + public function hasRightOnProj(&$db, $roleQuestion) + { + $tproj = null; + if (isset($_SESSION['testprojectID'])) { + $tproj = intval($_SESSION['testprojectID']); + } + return $this->hasRight($db, $roleQuestion, $tproj); + } } diff --git a/lib/functions/tlsmarty.inc.php b/lib/functions/tlsmarty.inc.php index 08371cf016..c1d6a6a761 100644 --- a/lib/functions/tlsmarty.inc.php +++ b/lib/functions/tlsmarty.inc.php @@ -1,462 +1,478 @@ -assign($params['var'], $the_ret); + } else { + return $the_ret; + } +} + +/** + * Should be used to prevent certain templates to only get included once per page load. + * For example javascript includes, such as ext-js. + * + * Usage (in template): + * + * {if guard_header_smarty(__FILE__)} + * template code + * + * {/if} + * + */ +function guard_header_smarty($file) +{ + static $guarded = array(); + $status_ok = false; + + if (! isset($guarded[$file])) { + $guarded[$file] = true; + $status_ok = true; + } + return $status_ok; +} + +/** + * TestLink wrapper for external Smarty class + * + * @package TestLink + */ +class TLSmarty extends Smarty +{ + + private $tlImages; + + public $tlTemplateCfg; + + public function __construct() + { + global $tlCfg; + global $g_tpl; + + parent::__construct(); + + $this->template_dir = [ + 'main' => TL_ABS_PATH . 'gui/templates/' . $tlCfg->gui->ux . '/' + ]; + + $this->config_dir = TL_ABS_PATH . 'gui/templates/conf'; + $this->compile_dir = TL_TEMP_PATH; + + $testproject_coloring = $tlCfg->gui->testproject_coloring; + $testprojectColor = $tlCfg->gui->background_color; + + if (isset($_SESSION['testprojectColor'])) { + $testprojectColor = $_SESSION['testprojectColor']; + if ($testprojectColor == "") { + $testprojectColor = $tlCfg->gui->background_color; + } + } + $this->assign('testprojectColor', $testprojectColor); + + $my_locale = isset($_SESSION['locale']) ? $_SESSION['locale'] : TL_DEFAULT_LOCALE; + $basehref = isset($_SESSION['basehref']) ? $_SESSION['basehref'] : TL_BASE_HREF; + + if ($tlCfg->smarty_debug) { + $this->debugging = true; + tLog("Smarty debug window = ON"); + } + + // ---------------------------------------------------------------------- + // Must be initialized to avoid log on TestLink Event Viewer due to undefined variable. + // This means that optional/missing parameters on include can not be used. + // + // Good refactoring must be done in future, to create group of this variable + // with clear names that must be a hint for developers, to understand where this + // variables are used. + + // inc_head.tpl + $this->assign('SP_html_help_file', null); + $this->assign('menuUrl', null); + $this->assign('args', null); + $this->assign('additionalArgs', null); + $this->assign('pageTitle', null); + $this->assign('printPreferences', null); + + $this->assign('css_only', null); + $this->assign('body_onload', null); + + // inc_attachments.tpl + $this->assign('attach_tableStyles', "font-size:12px"); + $this->assign('attach_tableClassName', "simple"); + $this->assign('attach_inheritStyle', 0); + $this->assign('attach_show_upload_btn', 1); + $this->assign('attach_show_title', 1); + $this->assign('attach_downloadOnly', false); + + // inc_help.tpl + $this->assign('inc_help_alt', null); + $this->assign('inc_help_title', null); + $this->assign('inc_help_style', null); + $this->assign('show_help_icon', true); + + $this->assign('tplan_name', null); + $this->assign('name', null); + + $this->assign('basehref', $basehref); + $this->assign('css', $basehref . TL_TESTLINK_CSS); + $this->assign('use_custom_css', 0); + if (! is_null($tlCfg->custom_css) && $tlCfg->custom_css != '') { + $this->assign('use_custom_css', 1); + $this->assign('custom_css', + $basehref . TL_THEME_CSS_DIR . $tlCfg->custom_css); + } + + $this->assign('locale', $my_locale); + + // + $stdTPLCfg = array(); + $stdTPLCfg['inc_tcbody'] = 'testcases/inc_tcbody.tpl'; + $stdTPLCfg['inc_steps'] = 'testcases/inc_steps.tpl'; + + $stdTPLCfg['inc_show_scripts_table'] = 'inc_show_scripts_table.tpl'; + + $stdTPLCfg['keywords.inc'] = 'testcases/keywords.inc.tpl'; + + $stdTPLCfg['attributesLinearForViewer.inc'] = 'testcases/attributesLinearForViewer.inc.tpl'; + + $stdTPLCfg['relations.inc'] = 'testcases/relations.inc.tpl'; + $stdTPLCfg['quickexec.inc'] = 'testcases/quickexec.inc.tpl'; + + $stdTPLCfg['steps_horizontal.inc'] = 'testcases/steps_horizontal.inc.tpl'; + $stdTPLCfg['steps_vertical.inc'] = 'testcases/steps_vertical.inc.tpl'; + + $stdTPLCfg['platforms.inc'] = 'testcases/platforms.inc.tpl'; + + // load configuration + $this->assign('session', isset($_SESSION) ? $_SESSION : null); + $this->assign('tlCfg', $tlCfg); + $this->assign('tplConfig', array_merge($stdTPLCfg, (array) $g_tpl)); + $this->assign('gsmarty_gui', $tlCfg->gui); + $this->assign('gsmarty_spec_cfg', config_get('spec_cfg')); + $this->assign('gsmarty_attachments', config_get('attachments')); + + $this->assign('pageCharset', $tlCfg->charset); + $this->assign('tlVersion', TL_VERSION); + $this->assign('testproject_coloring', $testproject_coloring); + + // define a select structure for {html_options ...} + $this->assign('gsmarty_option_yes_no', + array( + 0 => lang_get('No'), + 1 => lang_get('Yes') + )); + $this->assign('gsmarty_option_priority', + array( + HIGH => lang_get('high_priority'), + MEDIUM => lang_get('medium_priority'), + LOW => lang_get('low_priority') + )); + + $this->assign('gsmarty_option_importance', + array( + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + )); + + $wkf = array(); + $xcfg = config_get('testCaseStatus'); + foreach ($xcfg as $human => $key) { + $wkf[$key] = lang_get('testCaseStatus_' . $human); + } + $this->assign('gsmarty_option_wkfstatus', $wkf); + + // this allows unclosed tag to add more information and link; see inc_head.tpl + $this->assign('openHead', 'no'); + + // there are some variables which should not be assigned for template but must be initialized + // inc_head.tpl + $this->assign('jsValidate', null); + $this->assign('jsTree', null); + $this->assign('editorType', null); + + // user feedback variables (used in inc_update.tpl) + $this->assign('user_feedback', null); + $this->assign('feedback_type', ''); // Possibile values: soft + $this->assign('action', 'updated'); // todo: simplify (remove) - use user_feedback + $this->assign('sqlResult', null); // todo: simplify (remove) - use user_feedback + + $this->assign('refresh', 'no'); + $this->assign('result', null); + + $this->assign('gsmarty_href_keywordsView', + ' "lib/keywords/keywordsView.php?tproject_id=%s%" ' . + ' target="mainframe" class="bold" ' . ' title="' . + lang_get('menu_manage_keywords') . '"'); + + $this->assign('gsmarty_href_platformsView', + ' "lib/platforms/platformsView.php?tproject_id=%s%" ' . + ' target="mainframe" class="bold" ' . ' title="' . + lang_get('menu_manage_platforms') . '"'); + + $this->assign('gsmarty_html_select_date_field_order', + $tlCfg->locales_html_select_date_field_order[$my_locale]); + + $this->assign('gsmarty_date_format', + $tlCfg->locales_date_format[$my_locale]); + + // add smarty variable to be able to set localized date format on datepicker + $this->assign('gsmarty_datepicker_format', + str_replace('%', '', $tlCfg->locales_date_format[$my_locale])); + + $this->assign('gsmarty_timestamp_format', + $tlCfg->locales_timestamp_format[$my_locale]); + + // Images + $this->tlImages = tlSmarty::getImageSet(); + + $msg = lang_get('show_hide_api_info'); + $this->tlImages['toggle_api_info'] = "\"{$msg}\"tlImages['api_info']}\" align=\"left\" />"; + + $msg = lang_get('show_hide_direct_link'); + $this->tlImages['toggle_direct_link'] = "\"{$msg}\"tlImages['direct_link']}\" align=\"left\" />"; + + // Some useful values for Sort Table Engine + $this->tlImages['sort_hint'] = ''; + switch (TL_SORT_TABLE_ENGINE) { + case 'kryogenix.org': + $sort_table_by_column = lang_get('sort_table_by_column'); + $this->tlImages['sort_hint'] = "\"{$sort_table_by_column}\"tlImages['sort']}\" align=\"left\" />"; + + $this->assign("noSortableColumnClass", "sorttable_nosort"); + break; + + default: + $this->assign("noSortableColumnClass", ''); + break; + } + + // Do not move!!! + $this->assign("tlImages", $this->tlImages); + + // Register functions + $this->registerPlugin("function", "lang_get", "lang_get_smarty"); + $this->registerPlugin("function", "localize_date", + "localize_date_smarty"); + $this->registerPlugin("function", "localize_timestamp", + "localize_timestamp_smarty"); + $this->registerPlugin("function", "localize_tc_status", + "translate_tc_status_smarty"); + + $this->registerPlugin("modifier", "basename", "basename"); + $this->registerPlugin("modifier", "dirname", "dirname"); + + // Call to smarty filter that adds a CSRF filter to all form elements + if ($tlCfg->csrf_filter_enabled && function_exists('smarty_csrf_filter')) { + $this->registerFilter('output', 'smarty_csrf_filter'); + } + } + + /** + */ + public function getImages() + { + return $this->tlImages; + } + + /** + */ + public static function getImageSet() + { + $burl = isset($_SESSION['basehref']) ? $_SESSION['basehref'] : TL_BASE_HREF; + $imgLoc = $burl . TL_THEME_IMG_DIR; + + $dummy = array( + 'active' => $imgLoc . 'flag_green.png', + 'activity' => $imgLoc . 'information.png', + 'account' => $imgLoc . 'user_edit.png', + 'add' => $imgLoc . 'add.png', + 'add2set' => $imgLoc . 'basket_put.png', + 'api_info' => $imgLoc . 'brick.png', + 'assign_task' => $imgLoc . 'assign_exec_task_to_me.png', + 'bug' => $imgLoc . 'bug.png', + 'bug_link_tl_to_bts' => $imgLoc . 'bug_link_famfamfam.png', + 'bug_create_into_bts' => $imgLoc . 'bug_add_famfamfam.png', + 'bug_link_tl_to_bts_disabled' => $imgLoc . + 'bug_link_disabled_famfamfam.png', + 'bug_create_into_bts_disabled' => $imgLoc . + 'bug_add_disabled_famfamfam.png', + 'bug_add_note' => $imgLoc . 'bug_edit.png', + 'bullet' => $imgLoc . 'slide_gripper.gif', + 'bulkOperation' => $imgLoc . 'bulkAssignTransparent.png', + 'calendar' => $imgLoc . 'calendar.gif', + 'checked' => $imgLoc . 'apply_f2_16.png', + 'choiceOn' => $imgLoc . 'accept.png', + 'clear' => $imgLoc . 'trash.png', + 'clear_notes' => $imgLoc . 'font_delete.png', + 'clipboard' => $imgLoc . 'page_copy.png', + 'check_ok' => $imgLoc . 'lightbulb.png', + 'check_ko' => $imgLoc . 'link_error.png', + 'cog' => $imgLoc . 'cog.png', + 'copyAttachments' => $imgLoc . 'folder_add.png', + 'create_copy' => $imgLoc . 'application_double.png', + 'create_from_xml' => $imgLoc . 'wand.png', + 'date' => $imgLoc . 'date.png', + 'delete' => $imgLoc . 'trash.png', + 'demo_mode' => $imgLoc . 'emoticon_tongue.png', + 'delete_disabled' => $imgLoc . 'trash_greyed.png', + 'disconnect' => $imgLoc . 'disconnect.png', + 'disconnect_small' => $imgLoc . 'disconnect_small.png', + 'direct_link' => $imgLoc . 'world_link.png', + 'duplicate' => $imgLoc . 'application_double.png', + 'edit' => $imgLoc . 'icon_edit.png', + 'edit_icon' => $imgLoc . 'edit_icon.png', + 'email' => $imgLoc . 'email.png', + 'events' => $imgLoc . 'bell.png', + 'eye' => $imgLoc . 'eye.png', + 'vorsicht' => $imgLoc . 'exclamation.png', + 'export' => $imgLoc . 'export.png', + 'export_import' => $imgLoc . 'export_import.png', + 'execute' => $imgLoc . 'lightning.png', + 'executed' => $imgLoc . 'lightning.png', + 'exec_icon' => $imgLoc . 'exec_icon.png', + 'exec_passed' => $imgLoc . 'emoticon_smile.png', + 'exec_failed' => $imgLoc . 'emoticon_unhappy.png', + 'exec_blocked' => $imgLoc . 'emoticon_surprised.png', + 'execution' => $imgLoc . 'controller.png', + 'execution_order' => $imgLoc . 'timeline_marker.png', + 'execution_duration' => $imgLoc . 'hourglass.png', + 'export_excel' => $imgLoc . 'page_excel.png', + 'export_for_results_import' => $imgLoc . 'brick_go.png', + 'ghost_item' => $imgLoc . 'ghost16x16.png', + 'user_group' => $imgLoc . 'group.png', + 'heads_up' => $imgLoc . 'lightbulb.png', + 'help' => $imgLoc . 'question.gif', + 'history' => $imgLoc . 'history.png', + 'history_small' => $imgLoc . 'history_small.png', + 'home' => $imgLoc . 'application_home.png', + 'import' => $imgLoc . 'door_in.png', + 'import_results' => $imgLoc . 'monitor_lightning.png', + 'inactive' => $imgLoc . 'flag_yellow.png', + 'info' => $imgLoc . 'question.gif', + 'info_small' => $imgLoc . 'information_small.png', + 'insert_step' => $imgLoc . 'insert_step.png', + 'item_link' => $imgLoc . 'folder_link.png', + 'link_to_report' => $imgLoc . 'link.png', + 'lock' => $imgLoc . 'lock.png', + 'lock_open' => $imgLoc . 'lock_open.png', + 'log_message' => $imgLoc . 'history.png', + 'log_message_small' => $imgLoc . 'history_small.png', + 'logout' => $imgLoc . 'computer_go.png', + 'magnifier' => $imgLoc . 'magnifier.png', + 'move_copy' => $imgLoc . 'application_double.png', + 'new_f2_16' => $imgLoc . 'new_f2_16.png', + 'note_edit' => $imgLoc . 'note_edit.png', + 'note_edit_greyed' => $imgLoc . 'note_edit_greyed.png', + 'on' => $imgLoc . 'lightbulb.png', + 'off' => $imgLoc . 'lightbulb_off.png', + 'order_alpha' => $imgLoc . 'style.png', + 'plugins' => $imgLoc . 'connect.png', + 'public' => $imgLoc . 'door_open.png', + 'private' => $imgLoc . 'door.png', + 'relations' => $imgLoc . 'asterisk_yellow.png', + 'remove' => $imgLoc . 'delete.png', + 'reorder' => $imgLoc . 'arrow_switch.png', + 'report' => $imgLoc . 'report.png', + 'report_test_automation' => $imgLoc . 'lightning.png', + 'report_word' => $imgLoc . 'page_word.png', + 'requirements' => $imgLoc . 'cart.png', + 'resequence' => $imgLoc . 'control_equalizer.png', + 'reset' => $imgLoc . 'arrow_undo.png', + 'saveForBaseline' => $imgLoc . 'lock.png', + 'summary_small' => $imgLoc . 'information_small.png', + 'sort' => $imgLoc . 'sort_hint.png', + 'steps' => $imgLoc . 'bricks.png', + 'table' => $imgLoc . 'application_view_columns.png', + 'testcases_table_view' => $imgLoc . 'application_view_columns.png', + 'testcase_execution_type_automatic' => $imgLoc . 'bullet_wrench.png', + 'testcase_execution_type_manual' => $imgLoc . 'user.png', + 'test_specification' => $imgLoc . 'chart_organisation.png', + 'toggle_all' => $imgLoc . 'toggle_all.gif', + 'user' => $imgLoc . 'user.png', + 'upload' => $imgLoc . 'upload_16.png', + 'upload_greyed' => $imgLoc . 'upload_16_greyed.png', + 'warning' => $imgLoc . 'error_triangle.png', + 'wrench' => $imgLoc . 'wrench.png', + 'test_status_not_run' => $imgLoc . 'test_status_not_run.png', + 'test_status_passed' => $imgLoc . 'test_status_passed.png', + 'test_status_failed' => $imgLoc . 'test_status_failed.png', + 'test_status_blocked' => $imgLoc . 'test_status_blocked.png', + 'test_status_passed_next' => $imgLoc . 'test_status_passed_next.png', + 'test_status_failed_next' => $imgLoc . 'test_status_failed_next.png', + 'test_status_blocked_next' => $imgLoc . + 'test_status_blocked_next.png', + 'keyword_add' => $imgLoc . 'tag_blue_add.png' + ); + + $imi = config_get('images'); + if (! empty($imi)) { + foreach ($imi as $key => $img) { + + // You need to configure in your custom config something like this + // $tlCfg->images['test_status_passed_with_remarks'] = + // '%imgLoc%test_status_passed_with_remarks.png'; + // PAY ATTENTION to the place holder %imgLoc% + $imi[$key] = str_replace('%imgLoc%', $imgLoc, $img); + } + $dummy = array_merge($dummy, $imi); + } + return $dummy; + } } - -if(!defined('TL_USE_LOG4JAVASCRIPT') ) { - define('TL_USE_LOG4JAVASCRIPT',0); -} - - -/** - * The next two functions was moved here from common.php */ -function translate_tc_status($status_code) { - $resultsCfg = config_get('results'); - $verbose = lang_get('test_status_not_run'); - if( $status_code != '') { - $suffix = $resultsCfg['code_status'][$status_code]; - $verbose = lang_get('test_status_' . $suffix); - } - return $verbose; -} - -/** - * function is registered in tlSmarty class - * @uses function translate_tc_status - * @todo should be moved to tlSmarty class - */ -function translate_tc_status_smarty($params, $smarty) { - $the_ret = translate_tc_status($params['s']); - if( isset($params['var']) ) { - $smarty->assign($params['var'], $the_ret); - } else { - return $the_ret; - } -} - -/** - * Should be used to prevent certain templates to only get included once per page load. - * For example javascript includes, such as ext-js. - * - * Usage (in template): - * - * {if guard_header_smarty(__FILE__)} - * template code - * - * {/if} - * - */ -function guard_header_smarty($file) { - static $guarded = array(); - $status_ok = false; - - if (!isset($guarded[$file])) { - $guarded[$file] = true; - $status_ok = true; - } - return $status_ok; -} - -/** - * TestLink wrapper for external Smarty class - * @package TestLink - */ -class TLSmarty extends Smarty { - private $tlImages; - var $tlTemplateCfg; - - function __construct() { - global $tlCfg; - global $g_tpl; - - parent::__construct(); - - $this->template_dir = [ - 'main' => TL_ABS_PATH . 'gui/templates/' . $tlCfg->gui->ux . '/' - ]; - - $this->config_dir = TL_ABS_PATH . 'gui/templates/conf'; - $this->compile_dir = TL_TEMP_PATH; - - - - $testproject_coloring = $tlCfg->gui->testproject_coloring; - $testprojectColor = $tlCfg->gui->background_color ; - - if (isset($_SESSION['testprojectColor'])) { - $testprojectColor = $_SESSION['testprojectColor']; - if ($testprojectColor == "") { - $testprojectColor = $tlCfg->gui->background_color; - } - } - $this->assign('testprojectColor', $testprojectColor); - - $my_locale = isset($_SESSION['locale']) ? $_SESSION['locale'] : TL_DEFAULT_LOCALE; - $basehref = isset($_SESSION['basehref']) ? $_SESSION['basehref'] : TL_BASE_HREF; - - if ($tlCfg->smarty_debug) { - $this->debugging = true; - tLog("Smarty debug window = ON"); - } - - // ---------------------------------------------------------------------- - // Must be initialized to avoid log on TestLink Event Viewer due to undefined variable. - // This means that optional/missing parameters on include can not be used. - // - // Good refactoring must be done in future, to create group of this variable - // with clear names that must be a hint for developers, to understand where this - // variables are used. - - // inc_head.tpl - $this->assign('SP_html_help_file',null); - $this->assign('menuUrl',null); - $this->assign('args',null); - $this->assign('additionalArgs',null); - $this->assign('pageTitle',null); - $this->assign('printPreferences',null); - - $this->assign('css_only',null); - $this->assign('body_onload',null); - - // inc_attachments.tpl - $this->assign('attach_tableStyles',"font-size:12px"); - $this->assign('attach_tableClassName',"simple"); - $this->assign('attach_inheritStyle',0); - $this->assign('attach_show_upload_btn',1); - $this->assign('attach_show_title',1); - $this->assign('attach_downloadOnly',false); - - // inc_help.tpl - $this->assign('inc_help_alt',null); - $this->assign('inc_help_title',null); - $this->assign('inc_help_style',null); - $this->assign('show_help_icon',true); - - $this->assign('tplan_name',null); - $this->assign('name',null); - // ----------------------------------------------------------------------------- - - $this->assign('basehref', $basehref); - $this->assign('css', $basehref . TL_TESTLINK_CSS); - $this->assign('use_custom_css', 0); - if(!is_null($tlCfg->custom_css) && $tlCfg->custom_css != '') { - $this->assign('use_custom_css', 1); - $this->assign('custom_css', - $basehref . TL_THEME_CSS_DIR . $tlCfg->custom_css); - } - - $this->assign('locale', $my_locale); - - // - $stdTPLCfg = array(); - $stdTPLCfg['inc_tcbody'] = 'testcases/inc_tcbody.tpl'; - $stdTPLCfg['inc_steps'] = 'testcases/inc_steps.tpl'; - - $stdTPLCfg['inc_show_scripts_table'] = 'inc_show_scripts_table.tpl'; - - $stdTPLCfg['keywords.inc'] = 'testcases/keywords.inc.tpl'; - - $stdTPLCfg['attributesLinearForViewer.inc'] = - 'testcases/attributesLinearForViewer.inc.tpl'; - - $stdTPLCfg['relations.inc'] = 'testcases/relations.inc.tpl'; - $stdTPLCfg['quickexec.inc'] = 'testcases/quickexec.inc.tpl'; - - $stdTPLCfg['steps_horizontal.inc'] = 'testcases/steps_horizontal.inc.tpl'; - $stdTPLCfg['steps_vertical.inc'] = 'testcases/steps_vertical.inc.tpl'; - - $stdTPLCfg['platforms.inc'] = 'testcases/platforms.inc.tpl'; - - - // ----------------------------------------------------------------------------- - // load configuration - $this->assign('session',isset($_SESSION) ? $_SESSION : null); - $this->assign('tlCfg',$tlCfg); - $this->assign('tplConfig',array_merge($stdTPLCfg,(array)$g_tpl)); - $this->assign('gsmarty_gui',$tlCfg->gui); - $this->assign('gsmarty_spec_cfg',config_get('spec_cfg')); - $this->assign('gsmarty_attachments',config_get('attachments')); - - $this->assign('pageCharset',$tlCfg->charset); - $this->assign('tlVersion',TL_VERSION); - $this->assign('testproject_coloring',null); - - - // ----------------------------------------------------------------------------- - // define a select structure for {html_options ...} - $this->assign('gsmarty_option_yes_no', array(0 => lang_get('No'), 1 => lang_get('Yes'))); - $this->assign('gsmarty_option_priority', array(HIGH => lang_get('high_priority'), - MEDIUM => lang_get('medium_priority'), - LOW => lang_get('low_priority'))); - - $this->assign('gsmarty_option_importance', array(HIGH => lang_get('high_importance'), - MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance'))); - - $wkf = array(); - $xcfg = config_get('testCaseStatus'); - foreach($xcfg as $human => $key) { - $wkf[$key] = lang_get('testCaseStatus_' . $human); - } - $this->assign('gsmarty_option_wkfstatus',$wkf); - - - // this allows unclosed tag to add more information and link; see inc_head.tpl - $this->assign('openHead', 'no'); - - // there are some variables which should not be assigned for template but must be initialized - // inc_head.tpl - $this->assign('jsValidate', null); - $this->assign('jsTree', null); - $this->assign('editorType', null); - - - // user feedback variables (used in inc_update.tpl) - $this->assign('user_feedback', null); - $this->assign('feedback_type', ''); // Possibile values: soft - $this->assign('action', 'updated'); //todo: simplify (remove) - use user_feedback - $this->assign('sqlResult', null); //todo: simplify (remove) - use user_feedback - - $this->assign('refresh', 'no'); - $this->assign('result', null); - - // $this->assign('optLocale',config_get('locales')); - $this->assign('gsmarty_href_keywordsView', - ' "lib/keywords/keywordsView.php?tproject_id=%s%" ' . ' target="mainframe" class="bold" ' . - ' title="' . lang_get('menu_manage_keywords') . '"'); - - - $this->assign('gsmarty_href_platformsView', - ' "lib/platforms/platformsView.php?tproject_id=%s%" ' . ' target="mainframe" class="bold" ' . - ' title="' . lang_get('menu_manage_platforms') . '"'); - - $this->assign('gsmarty_html_select_date_field_order', - $tlCfg->locales_html_select_date_field_order[$my_locale]); - - $this->assign('gsmarty_date_format',$tlCfg->locales_date_format[$my_locale]); - - // add smarty variable to be able to set localized date format on datepicker - $this->assign('gsmarty_datepicker_format', - str_replace('%','',$tlCfg->locales_date_format[$my_locale])); - - $this->assign('gsmarty_timestamp_format',$tlCfg->locales_timestamp_format[$my_locale]); - - // ----------------------------------------------------------------------------- - // Images - $this->tlImages = tlSmarty::getImageSet(); - - $msg = lang_get('show_hide_api_info'); - $this->tlImages['toggle_api_info'] = "\"{$msg}\"tlImages['api_info']}\" align=\"left\" />"; - - $msg = lang_get('show_hide_direct_link'); - $this->tlImages['toggle_direct_link'] = "\"{$msg}\"tlImages['direct_link']}\" align=\"left\" />"; - - // Some useful values for Sort Table Engine - $this->tlImages['sort_hint'] = ''; - switch (TL_SORT_TABLE_ENGINE) - { - case 'kryogenix.org': - $sort_table_by_column = lang_get('sort_table_by_column'); - $this->tlImages['sort_hint'] = "\"{$sort_table_by_column}\"tlImages['sort']}\" align=\"left\" />"; - - $this->assign("noSortableColumnClass","sorttable_nosort"); - break; - - default: - $this->assign("noSortableColumnClass",''); - break; - } - - // Do not move!!! - $this->assign("tlImages",$this->tlImages); - - // Register functions - $this->registerPlugin("function","lang_get", "lang_get_smarty"); - $this->registerPlugin("function","localize_date", "localize_date_smarty"); - $this->registerPlugin("function","localize_timestamp", "localize_timestamp_smarty"); - $this->registerPlugin("function","localize_tc_status","translate_tc_status_smarty"); - - $this->registerPlugin("modifier","basename","basename"); - $this->registerPlugin("modifier","dirname","dirname"); - - // Call to smarty filter that adds a CSRF filter to all form elements - if(isset($tlCfg->csrf_filter_enabled) && - $tlCfg->csrf_filter_enabled === TRUE && function_exists('smarty_csrf_filter')) { - $this->registerFilter('output','smarty_csrf_filter'); - } - - } // end of function TLSmarty() - - /** - * - */ - function getImages() { - return $this->tlImages; - } - - /** - * - */ - static function getImageSet() { - $burl = isset($_SESSION['basehref']) ? $_SESSION['basehref'] : TL_BASE_HREF; - $imgLoc = $burl . TL_THEME_IMG_DIR; - - $dummy = array('active' => $imgLoc . 'flag_green.png', - 'activity' => $imgLoc . 'information.png', - 'account' => $imgLoc . 'user_edit.png', - 'add' => $imgLoc . 'add.png', - 'add2set' => $imgLoc . 'basket_put.png', - 'api_info' => $imgLoc . 'brick.png', - 'assign_task' => $imgLoc . 'assign_exec_task_to_me.png', - 'bug' => $imgLoc . 'bug.png', - 'bug_link_tl_to_bts' => $imgLoc . 'bug_link_famfamfam.png', - 'bug_create_into_bts' => $imgLoc . 'bug_add_famfamfam.png', - 'bug_link_tl_to_bts_disabled' => $imgLoc . 'bug_link_disabled_famfamfam.png', - 'bug_create_into_bts_disabled' => $imgLoc . 'bug_add_disabled_famfamfam.png', - 'bug_add_note' => $imgLoc . 'bug_edit.png', - 'bullet' => $imgLoc . 'slide_gripper.gif', - 'bulkOperation' => $imgLoc . 'bulkAssignTransparent.png', - 'calendar' => $imgLoc . 'calendar.gif', - 'checked' => $imgLoc . 'apply_f2_16.png', - 'choiceOn' => $imgLoc . 'accept.png', - 'clear' => $imgLoc . 'trash.png', - 'clear_notes' => $imgLoc . 'font_delete.png', - 'clipboard' => $imgLoc . 'page_copy.png', - 'check_ok' => $imgLoc . 'lightbulb.png', - 'check_ko' => $imgLoc . 'link_error.png', - 'cog' => $imgLoc . 'cog.png', - 'copy_attachments' => $imgLoc . 'folder_add.png', - 'create_copy' => $imgLoc . 'application_double.png', - 'create_from_xml' => $imgLoc . 'wand.png', - 'date' => $imgLoc . 'date.png', - 'delete' => $imgLoc . 'trash.png', - 'demo_mode' => $imgLoc . 'emoticon_tongue.png', - 'delete_disabled' => $imgLoc . 'trash_greyed.png', - 'disconnect' => $imgLoc . 'disconnect.png', - 'disconnect_small' => $imgLoc . 'disconnect_small.png', - 'direct_link' => $imgLoc . 'world_link.png', - 'duplicate' => $imgLoc . 'application_double.png', - 'edit' => $imgLoc . 'icon_edit.png', - 'edit_icon' => $imgLoc . 'edit_icon.png', - 'email' => $imgLoc . 'email.png', - 'events' => $imgLoc . 'bell.png', - 'eye' => $imgLoc . 'eye.png', - 'vorsicht' => $imgLoc . 'exclamation.png', - 'export' => $imgLoc . 'export.png', - 'export_import' => $imgLoc . 'export_import.png', - 'execute' => $imgLoc . 'lightning.png', - 'executed' => $imgLoc . 'lightning.png', - 'exec_icon' => $imgLoc . 'exec_icon.png', - 'exec_passed' => $imgLoc . 'emoticon_smile.png', - 'exec_failed' => $imgLoc . 'emoticon_unhappy.png', - 'exec_blocked' => $imgLoc . 'emoticon_surprised.png', - 'execution' => $imgLoc . 'controller.png', - 'execution_order' => $imgLoc . 'timeline_marker.png', - 'execution_duration' => $imgLoc . 'hourglass.png', - 'export_excel' => $imgLoc . 'page_excel.png', - 'export_for_results_import' => $imgLoc . 'brick_go.png', - 'ghost_item' => $imgLoc . 'ghost16x16.png', - 'user_group' => $imgLoc . 'group.png', - 'heads_up' => $imgLoc . 'lightbulb.png', - 'help' => $imgLoc . 'question.gif', - 'history' => $imgLoc . 'history.png', - 'history_small' => $imgLoc . 'history_small.png', - 'home' => $imgLoc . 'application_home.png', - 'import' => $imgLoc . 'door_in.png', - 'import_results' => $imgLoc . 'monitor_lightning.png', - 'inactive' => $imgLoc . 'flag_yellow.png', - 'info' => $imgLoc . 'question.gif', - 'info_small' => $imgLoc . 'information_small.png', - 'insert_step' => $imgLoc . 'insert_step.png', - 'item_link' => $imgLoc . 'folder_link.png', - 'link_to_report' => $imgLoc . 'link.png', - 'lock' => $imgLoc . 'lock.png', - 'lock_open' => $imgLoc . 'lock_open.png', - 'log_message' => $imgLoc . 'history.png', - 'log_message_small' => $imgLoc . 'history_small.png', - 'logout' => $imgLoc . 'computer_go.png', - 'magnifier' => $imgLoc . 'magnifier.png', - 'move_copy' => $imgLoc . 'application_double.png', - 'new_f2_16' => $imgLoc . 'new_f2_16.png', - 'note_edit' => $imgLoc . 'note_edit.png', - 'note_edit_greyed' => $imgLoc . 'note_edit_greyed.png', - 'on' => $imgLoc . 'lightbulb.png', - 'off' => $imgLoc . 'lightbulb_off.png', - 'order_alpha' => $imgLoc . 'style.png', - 'plugins' => $imgLoc . 'connect.png', - 'public' => $imgLoc . 'door_open.png', - 'private' => $imgLoc . 'door.png', - 'relations' => $imgLoc . 'asterisk_yellow.png', - 'remove' => $imgLoc . 'delete.png', - 'reorder' => $imgLoc . 'arrow_switch.png', - 'report' => $imgLoc . 'report.png', - 'report_test_automation' => $imgLoc . 'lightning.png', - 'report_word' => $imgLoc . 'page_word.png', - 'requirements' => $imgLoc . 'cart.png', - 'resequence' => $imgLoc . 'control_equalizer.png', - 'reset' => $imgLoc . 'arrow_undo.png', - 'saveForBaseline' => $imgLoc . 'lock.png', - 'summary_small' => $imgLoc . 'information_small.png', - 'sort' => $imgLoc . 'sort_hint.png', - 'steps' => $imgLoc . 'bricks.png', - 'table' => $imgLoc . 'application_view_columns.png', - 'testcases_table_view' => $imgLoc . 'application_view_columns.png', - 'testcase_execution_type_automatic' => $imgLoc . 'bullet_wrench.png', - 'testcase_execution_type_manual' => $imgLoc . 'user.png', - 'test_specification' => $imgLoc . 'chart_organisation.png', - 'toggle_all' => $imgLoc .'toggle_all.gif', - 'user' => $imgLoc . 'user.png', - 'upload' => $imgLoc . 'upload_16.png', - 'upload_greyed' => $imgLoc . 'upload_16_greyed.png', - 'warning' => $imgLoc . 'error_triangle.png', - 'wrench' => $imgLoc . 'wrench.png', - 'test_status_not_run' => $imgLoc . 'test_status_not_run.png', - 'test_status_passed' => $imgLoc . 'test_status_passed.png', - 'test_status_failed' => $imgLoc . 'test_status_failed.png', - 'test_status_blocked' => $imgLoc . 'test_status_blocked.png', - 'test_status_passed_next' => $imgLoc . 'test_status_passed_next.png', - 'test_status_failed_next' => $imgLoc . 'test_status_failed_next.png', - 'test_status_blocked_next' => $imgLoc . 'test_status_blocked_next.png', - 'keyword_add' => $imgLoc . 'tag_blue_add.png'); - - $imi = config_get('images'); - if(count($imi) >0) { - foreach($imi as $key => $img) { - - // You need to configure in your custom config something like this - // $tlCfg->images['test_status_passed_with_remarks'] = - // '%imgLoc%test_status_passed_with_remarks.png'; - // PAY ATTENTION to the place holder %imgLoc% - $imi[$key] = str_replace('%imgLoc%', $imgLoc, $img); - } - $dummy = array_merge($dummy,$imi); - } - return $dummy; - } - -} diff --git a/lib/functions/tree.class.php b/lib/functions/tree.class.php index 5058312207..6307329c6e 100644 --- a/lib/functions/tree.class.php +++ b/lib/functions/tree.class.php @@ -1,1718 +1,1658 @@ - build - var $node_types = array( 1 => 'testproject','testsuite', - 'testcase','tcversion','testplan', - 'requirement_spec','requirement','req_version', - 'testcase_step','req_revision','requirement_spec_revision', - 'build'); - - // key: node type id, value: class name - var $class_name = array( 1 => 'testproject','testsuite', - 'testcase',null,'testplan', - 'requirement_spec_mgr','requirement_mgr',null, - null,null,null,null); - - var $nodeWithoutClass = null; - - var $node_descr_id = array(); - - - // Order here means NOTHING - var $node_tables_by = array('id' => array(), - 'name' => - array('testproject' => 'testprojects', - 'testsuite' => 'testsuites', - 'testplan' => 'testplans', - 'testcase' => 'testcases', - 'tcversion' => 'tcversions', - 'requirement_spec' =>'req_specs', - 'requirement' => 'requirements', - 'req_version' => 'req_versions', - 'req_revision' => 'req_versions', - 'requirement_spec_revision' => 'req_specs_revisions')); - - var $node_tables; - - var $ROOT_NODE_TYPE_ID = 1; - var $ROOT_NODE_PARENT_ID = NULL; - - /** @var resource database handler */ - var $db; - - /** - * Class costructor - * @param resource &$db reference to database handler - */ - function __construct(&$db) - { - if( !is_object($db) ) - { - $msg = __METHOD__ . ' :: FATAL Error $db IS NOT AN Object'; - throw new Exception($msg); - } - - parent::__construct(); - $this->db = &$db; - $this->object_table = $this->tables['nodes_hierarchy']; - - $this->node_tables = $this->node_tables_by['name']; - $this->node_descr_id = array_flip($this->node_types); - foreach($this->node_tables_by['name'] as $key => $tbl) - { - $this->node_tables_by['id'][$this->node_descr_id[$key]] = $tbl; - } - - $nodeCodeId = array_flip($this->node_types); - $this->nodeWithoutClass[$nodeCodeId['requirement_spec_revision']] = 'deleted when reqspec is deleted'; - - - } - - /** - * get info from node_types table, regarding node types that can be used in a tree. - * - * @return array map - * key: description: single human friendly string describing node type - * value: numeric code used to identify a node type - * - */ - function get_available_node_types() { - static $nodeTypes; - if( !$nodeTypes ) { - $sql = " SELECT * FROM {$this->tables['node_types']} "; - $nodeTypes = $this->db->fetchColumnsIntoMap($sql,'description','id'); - } - return $nodeTypes; - } - - /** - * creates a new root node in the hierarchy table. - * root node is tree starting point. - * - * @param string $name node name; default='' - * @return integer node ID - */ - function new_root_node($name = '') - { - $this->new_node(null,$this->ROOT_NODE_TYPE_ID,$name,1); - return $this->db->insert_id($this->object_table); - } - - /* - function: new_node - creates a new node in the hierarchy table. - root node is tree starting point. - - args : parent_id: node id of new node parent - node_type_id: node type - [name]: node name. default='' - [node_order]= order on tree structure. default=0 - [node_id]= id to assign to new node, if you don't want - id bein created automatically. - default=0 -> id must be created automatically. - - returns: node_id of the new node created - - */ - function new_node($parent_id,$node_type_id,$name='',$node_order=0,$node_id=0) - { - $sql = "INSERT INTO {$this->object_table} " . - "(name,node_type_id,node_order"; - - $values=" VALUES('" . $this->db->prepare_string($name). "'," . - " {$node_type_id}," . intval($node_order); - if ($node_id) - { - $sql .= ",id"; - $values .= ",{$node_id}"; - } - - if(is_null($parent_id)) - { - $sql .= ") {$values} )"; - } - else - { - $sql .= ",parent_id) {$values},{$parent_id})"; - } - - $this->db->exec_query($sql); - return ($this->db->insert_id($this->object_table)); - } - - /* - get all node hierarchy info from hierarchy table - returns: node_id of the new node created - - - */ - /* - function: get_node_hierarchy_info - returns the row from nodes_hierarchy table that has - node_id as id. - - get all node hierarchy info from hierarchy table - - args : node_id: node id - can be an array - [parent_id] - - returns: - - */ - function get_node_hierarchy_info($node_id,$parent_id = null,$options=null) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - $opt = array('nodeTypeID' => null, 'nodeType' => null, - 'fields' => 'id,name,parent_id,node_type_id,node_order'); - $opt = array_merge($opt, (array)$options); - $sql = "SELECT {$opt['fields']} " . - "FROM {$this->object_table} WHERE id"; - - $result=null; - - if( is_array($node_id) ) - { - $sql .= " IN (" . implode(",",$node_id) . ") "; - $result=$this->db->fetchRowsIntoMap($sql,'id'); - } - else - { - $sql .= "= " . intval($node_id); - if( !is_null($parent_id) ) - { - $sql .= " AND parent_id=" . intval($parent_id); - } - - if( !is_null($opt['nodeTypeID']) ) - { - $sql .= " AND node_type_id=" . intval($opt['nodeTypeID']); - } - - if( !is_null($opt['nodeType']) ) - { - $sql .= " AND node_type_id=" . intval($this->node_descr_id[$opt['nodeType']]); - } - - $rs = $this->db->get_recordset($sql); - $result = !is_null($rs) ? $rs[0] : null; - } - return $result; - } - - /* - function: get_subtree_list() - get a string representing a list, where elements are separated - by comma, with all nodes in tree starting on node_id. - node is can be considered as root of subtree. - - args : node_id: root of subtree - node_type_id: null => no filter - if present ONLY NODES OF this type will be ANALIZED and traversed - Example: - TREE - |__ TSUITE_1 - | - |__TSUITE_2 - | |__TC_XZ - | - |__TC1 - |__TC2 - - node_type_id = TC and ROOT=Tree => output=NULL - node_type_id = TC and ROOT=TSUITE_1 => output=TC1,TC2 - - - output: null => list, not null => array - - - returns: output=null => list (string with nodes_id, using ',' as list separator). - output != null => array - - */ - function get_subtree_list($node_id,$node_type_id=null,$output=null) { - $nodes = array(); - $this->_get_subtree_list($node_id,$nodes,$node_type_id); - $node_list = is_null($output) ? implode(',',$nodes) : $nodes; - return($node_list); - } - - - /* - function: _get_subtree_list() - private function (name start with _), that using recursion - get an array with all nodes in tree starting on node_id. - node is can be considered as root of subtree. - - - args : node_id: root of subtree - - returns: array with nodes_id - - */ - function _get_subtree_list($node_id,&$node_list,$node_type_id=null) - { - $sql = "SELECT id from {$this->object_table} WHERE parent_id = {$node_id}"; - if( !is_null($node_type_id) ) - { - $sql .= " AND node_type_id = {$node_type_id} "; - } - $result = $this->db->exec_query($sql); - - if (!$result || !$this->db->num_rows($result)) - { - return; - } - - while($row = $this->db->fetch_array($result)) - { - $node_list[] = $row['id']; - $this->_get_subtree_list($row['id'],$node_list,$node_type_id); - } - } - - /* - function: delete_subtree - delete all element on tree structure that forms a subtree - that has as root or starting point node_id. - - args : node_id: root of subtree - - returns: array with nodes_id - - */ - function delete_subtree($node_id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $children = $this->get_subtree_list($node_id); - $id2del = $node_id; - if($children != "") - { - $id2del .= ",{$children}"; - } - $sql = "/* $debugMsg */ DELETE FROM {$this->object_table} WHERE id IN ({$id2del})"; - - $result = $this->db->exec_query($sql); - } - - - /* - function: get_path - get list of nodes to traverse when you want to move - from node A (node at level N) to node B (node at level M), - where MUST BE ALLWAYS M < N, and remembering that level for root node is the minimun. - This means path on tree backwards (to the upper levels). - An array is used to represent list. - Last array element contains data regarding Node A, first element (element with index 0) - is data regarding child of node B. - What data is returned depends on value of optional argument 'format'. - - Attention: - 1 - destination node (node B) will be NOT INCLUDED in result. - 2 - This is refactoring of original get_path method. - - args : node_id: start of path - [to_node_id]: destination node. default null -> path to tree root. - [format]: default 'full' - defines type of elements of result array. - - format='full' - Element is a map with following keys: - id - parent_id - node_type_id - node_order - node_table - name - - Example - Is tree is : - - null - \ - id=1 <--- Tree Root - | - + ------+ - / \ \ - id=9 id=2 id=8 - \ - id=3 - \ - id=4 - - - get_path(4), returns: - - ( - [0] => Array([id] => 2 - [parent_id] => 1 - [node_type_id] => 2 - [node_order] => 1 - [node_table] => testsuites - [name] => TS1) - - [1] => Array([id] => 3 - [parent_id] => 2 - [node_type_id] => 2 - [node_order] => 1 - [node_table] => testsuites - [name] => TS2) - - [2] => Array([id] => 4 - [parent_id] => 3 - [node_type_id] => 3 - [node_order] => 0 - [node_table] => testcases - [name] => TC1) - ) - - - - format='simple' - every element is a number=PARENT ID, array index = value - For the above example result will be: - ( - [1] => 1 - [2] => 2 - [3] => 3 - ) - - - - returns: array - - */ - function get_path($node_id,$to_node_id = null,$format = 'full') { - $the_path = array(); - $this->_get_path($node_id,$the_path,$to_node_id,$format); - if( !is_null($the_path) && count($the_path) > 0 ) { - $the_path = array_reverse($the_path); - } - return $the_path; - } - - /** - * - */ - function get_path_new($node_id,$to_node_id = null,$format = 'full') { - $the_path = array(); - $trip=''; - $matrioska = array(); - $this->_get_path($node_id,$the_path,$to_node_id,$format); - - if( !is_null($the_path) && ($loop2do=count($the_path)) > 0 ) { - $the_path=array_reverse($the_path); - $matrioska = $the_path[0]; - $matrioska['childNodes']=array(); - $target = &$matrioska['childNodes']; - - $trip = ''; - for($idx=0; $idx < ($loop2do-1); $idx++) - { - $trip[] = $the_path[$idx]['id']; // . "({$idx})"; - $target[0] = $the_path[$idx+1]; - if($the_path[$idx+1]['node_table'] != 'testcases') - { - $target = &$target[0]['childNodes']; - } - } - } - - return array($trip,$the_path); - } - - - - /* - function: _get_path - This is refactoring of original get_path method. - Attention: - returns node in inverse order, that was done for original get_path - - args : node_id: start of path - node_list: passed by reference, to build the result. - [to_node_id]: destination node. default null -> path to tree root. - [format]: default 'full' - - returns: array - */ - function _get_path($node_id,&$node_list,$to_node_id=null,$format='full') - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - // look up the parent of this node - $sql = "/* $debugMsg */ " . - " SELECT id,name,parent_id,node_type_id,node_order " . - " FROM {$this->object_table} WHERE id = " . intval($node_id); - - $result = $this->db->exec_query($sql); - if( $this->db->num_rows($result) == 0 ) { - $node_list=null; - return; - } - - while ( $row = $this->db->fetch_array($result) ) { - // check & abort - if ($row['parent_id'] == $row['id']) { - throw new Exception("id = parent_id = " . $row['id'], 1); - } - - // only continue if this $node isn't the root node - // (that's the node with no parent) - if ($row['parent_id'] != '' && $row['id'] != $to_node_id) { - // the last part of the path to $node, is the name - // of the parent of $node - switch($format) { - case 'full': - $row['node_table'] = $this->node_tables_by['id'][$row['node_type_id']]; - $node_list[] = $row; - break; - - case 'simple': - // Warning: starting node is NOT INCLUDED in node_list - $node_list[$row['parent_id']] = $row['parent_id']; - break; - - case 'points': - $node_list[] = $row['id']; - break; - - case 'simple_me': - if( is_null($node_list) ) { - $node_list[$row['id']] = $row['id']; - } else { - $node_list[$row['parent_id']] = $row['parent_id']; - } - break; - - case 'name': - $node_list[] = $row['name']; - break; - - } - - // we should add the path to the parent of this node to the path - $this->_get_path($row['parent_id'],$node_list,$to_node_id,$format); - } - } - } - - - - - /* - function: change_parent - change node parent, using this method you implement move operation. - - args : node_id: node/nodes that need(s) to changed. - mixed type: single id or array containing set of id. - - parent_id: new parent - - returns: 1 -> operation OK - - */ - function change_parent($node_id, $parent_id) - { - $debugMsg = 'Class:' .__CLASS__ . ' - Method:' - . __FUNCTION__ . ' :: '; - - if (is_array($node_id)) { - $safeSet = array_map('intval',$node_id); - $id_list = implode(",",$safeSet); - $where_clause = " WHERE id IN ($id_list) "; - } else { - $safe = intval($node_id); - if ($safe <= 0) { - throw new Exception("BAD node_id", 1); - } - $where_clause=" WHERE id = $safe"; - } - - $safeP = $this->db->prepare_int($parent_id); - $sql = "/* $debugMsg */ + build + public $node_types = array( + 1 => 'testproject', + 'testsuite', + 'testcase', + 'tcversion', + 'testplan', + 'requirement_spec', + 'requirement', + 'req_version', + 'testcase_step', + 'req_revision', + 'requirement_spec_revision', + 'build' + ); + + // key: node type id, value: class name + public $class_name = array( + 1 => 'testproject', + 'testsuite', + 'testcase', + null, + 'testplan', + 'requirement_spec_mgr', + 'requirement_mgr', + null, + null, + null, + null, + null + ); + + private $nodeWithoutClass = null; + + public $node_descr_id = array(); + + // Order here means NOTHING + public $node_tables_by = array( + 'id' => array(), + 'name' => array( + 'testproject' => 'testprojects', + 'testsuite' => 'testsuites', + 'testplan' => 'testplans', + 'testcase' => 'testcases', + 'tcversion' => 'tcversions', + 'requirement_spec' => 'req_specs', + 'requirement' => 'requirements', + 'req_version' => 'req_versions', + 'req_revision' => 'req_versions', + 'requirement_spec_revision' => 'req_specs_revisions' + ) + ); + + private $node_tables; + + private $ROOT_NODE_TYPE_ID = 1; + + private $ROOT_NODE_PARENT_ID = null; + + /** @var resource database handler */ + public $db; + + /** + * Class costructor + * + * @param + * resource &$db reference to database handler + */ + public function __construct(&$db) + { + if (! is_object($db)) { + $msg = __METHOD__ . ' :: FATAL Error $db IS NOT AN Object'; + throw new Exception($msg); + } + + parent::__construct(); + $this->db = &$db; + $this->object_table = $this->tables['nodes_hierarchy']; + + $this->node_tables = $this->node_tables_by['name']; + $this->node_descr_id = array_flip($this->node_types); + foreach ($this->node_tables_by['name'] as $key => $tbl) { + $this->node_tables_by['id'][$this->node_descr_id[$key]] = $tbl; + } + + $nodeCodeId = array_flip($this->node_types); + $this->nodeWithoutClass[$nodeCodeId['requirement_spec_revision']] = 'deleted when reqspec is deleted'; + } + + /** + * get info from node_types table, regarding node types that can be used in a tree. + * + * @return array map + * key: description: single human friendly string describing node type + * value: numeric code used to identify a node type + * + */ + public function get_available_node_types() + { + static $nodeTypes; + if (! $nodeTypes) { + $sql = " SELECT * FROM {$this->tables['node_types']} "; + $nodeTypes = $this->db->fetchColumnsIntoMap($sql, 'description', + 'id'); + } + return $nodeTypes; + } + + /** + * creates a new root node in the hierarchy table. + * root node is tree starting point. + * + * @param string $name + * node name; default='' + * @return integer node ID + */ + public function new_root_node($name = '') + { + $this->new_node(null, $this->ROOT_NODE_TYPE_ID, $name, 1); + return $this->db->insert_id($this->object_table); + } + + /* + * function: new_node + * creates a new node in the hierarchy table. + * root node is tree starting point. + * + * args : parent_id: node id of new node parent + * node_type_id: node type + * [name]: node name. default='' + * [node_order]= order on tree structure. default=0 + * [node_id]= id to assign to new node, if you don't want + * id bein created automatically. + * default=0 -> id must be created automatically. + * + * returns: node_id of the new node created + * + */ + public function new_node($parent_id, $node_type_id, $name = '', + $node_order = 0, $node_id = 0) + { + $sql = "INSERT INTO {$this->object_table} " . + "(name,node_type_id,node_order"; + + $values = " VALUES('" . $this->db->prepare_string($name) . "'," . + " {$node_type_id}," . intval($node_order); + if ($node_id) { + $sql .= ",id"; + $values .= ",{$node_id}"; + } + + if (is_null($parent_id)) { + $sql .= ") {$values} )"; + } else { + $sql .= ",parent_id) {$values},{$parent_id})"; + } + + $this->db->exec_query($sql); + return $this->db->insert_id($this->object_table); + } + + /* + * get all node hierarchy info from hierarchy table + * function: get_node_hierarchy_info + * returns the row from nodes_hierarchy table that has + * node_id as id. + * + * get all node hierarchy info from hierarchy table + * + * args : node_id: node id + * can be an array + * [parent_id] + * + * returns: node_id of the new node created + */ + public function get_node_hierarchy_info($node_id, $parent_id = null, + $options = null) + { + $opt = array( + 'nodeTypeID' => null, + 'nodeType' => null, + 'fields' => 'id,name,parent_id,node_type_id,node_order' + ); + $opt = array_merge($opt, (array) $options); + $sql = "SELECT {$opt['fields']} " . "FROM {$this->object_table} WHERE id"; + + $result = null; + + if (is_array($node_id)) { + $sql .= " IN (" . implode(",", $node_id) . ") "; + $result = $this->db->fetchRowsIntoMap($sql, 'id'); + } else { + $sql .= "= " . intval($node_id); + if (! is_null($parent_id)) { + $sql .= " AND parent_id=" . intval($parent_id); + } + + if (! is_null($opt['nodeTypeID'])) { + $sql .= " AND node_type_id=" . intval($opt['nodeTypeID']); + } + + if (! is_null($opt['nodeType'])) { + $sql .= " AND node_type_id=" . + intval($this->node_descr_id[$opt['nodeType']]); + } + + $rs = $this->db->get_recordset($sql); + $result = ! is_null($rs) ? $rs[0] : null; + } + return $result; + } + + /* + * function: get_subtree_list() + * get a string representing a list, where elements are separated + * by comma, with all nodes in tree starting on node_id. + * node is can be considered as root of subtree. + * + * args : node_id: root of subtree + * node_type_id: null => no filter + * if present ONLY NODES OF this type will be ANALIZED and traversed + * Example: + * TREE + * |__ TSUITE_1 + * | + * |__TSUITE_2 + * | |__TC_XZ + * | + * |__TC1 + * |__TC2 + * + * node_type_id = TC and ROOT=Tree => output=NULL + * node_type_id = TC and ROOT=TSUITE_1 => output=TC1,TC2 + * + * output: null => list, not null => array + * + * returns: output=null => list (string with nodes_id, using ',' as list separator). + * output != null => array + * + */ + public function get_subtree_list($node_id, $node_type_id = null, + $output = null) + { + $nodes = array(); + $this->_get_subtree_list($node_id, $nodes, $node_type_id); + return is_null($output) ? implode(',', $nodes) : $nodes; + } + + /* + * function: _get_subtree_list() + * private function (name start with _), that using recursion + * get an array with all nodes in tree starting on node_id. + * node is can be considered as root of subtree. + * + * args : node_id: root of subtree + * + * returns: array with nodes_i + */ + private function _get_subtree_list($node_id, &$node_list, + $node_type_id = null) + { + $sql = "SELECT id from {$this->object_table} WHERE parent_id = {$node_id}"; + if (! is_null($node_type_id)) { + $sql .= " AND node_type_id = {$node_type_id} "; + } + $result = $this->db->exec_query($sql); + + if (! $result || ! $this->db->num_rows($result)) { + return; + } + + while ($row = $this->db->fetch_array($result)) { + $node_list[] = $row['id']; + $this->_get_subtree_list($row['id'], $node_list, $node_type_id); + } + } + + /* + * function: delete_subtree + * delete all element on tree structure that forms a subtree + * that has as root or starting point node_id. + * + * args : node_id: root of subtree + * + * returns: array with nodes_id + */ + public function delete_subtree($node_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $children = $this->get_subtree_list($node_id); + $id2del = $node_id; + if ($children != "") { + $id2del .= ",{$children}"; + } + $sql = "/* $debugMsg */ DELETE FROM {$this->object_table} WHERE id IN ({$id2del})"; + + $this->db->exec_query($sql); + } + + /* + * function: get_path + * get list of nodes to traverse when you want to move + * from node A (node at level N) to node B (node at level M), + * where MUST BE ALLWAYS M < N, and remembering that level for root node is the minimun. + * This means path on tree backwards (to the upper levels). + * An array is used to represent list. + * Last array element contains data regarding Node A, first element (element with index 0) + * is data regarding child of node B. + * What data is returned depends on value of optional argument 'format'. + * + * Attention: + * 1 - destination node (node B) will be NOT INCLUDED in result. + * 2 - This is refactoring of original get_path method. + * + * args : node_id: start of path + * [to_node_id]: destination node. default null -> path to tree root. + * [format]: default 'full' + * defines type of elements of result array. + * + * format='full' + * Element is a map with following keys: + * id + * parent_id + * node_type_id + * node_order + * node_table + * name + * + * Example + * Is tree is : + * + * null + * \ + * id=1 <--- Tree Root + * | + * + ------+ + * / \ \ + * id=9 id=2 id=8 + * \ + * id=3 + * \ + * id=4 + * + * + * get_path(4), returns: + * + * ( + * [0] => Array([id] => 2 + * [parent_id] => 1 + * [node_type_id] => 2 + * [node_order] => 1 + * [node_table] => testsuites + * [name] => TS1) + * + * [1] => Array([id] => 3 + * [parent_id] => 2 + * [node_type_id] => 2 + * [node_order] => 1 + * [node_table] => testsuites + * [name] => TS2) + * + * [2] => Array([id] => 4 + * [parent_id] => 3 + * [node_type_id] => 3 + * [node_order] => 0 + * [node_table] => testcases + * [name] => TC1) + * ) + * + * + * + * format='simple' + * every element is a number=PARENT ID, array index = value + * For the above example result will be: + * ( + * [1] => 1 + * [2] => 2 + * [3] => 3 + * ) + * + * + * + * returns: array + */ + public function get_path($node_id, $to_node_id = null, $format = 'full') + { + $the_path = array(); + $this->_get_path($node_id, $the_path, $to_node_id, $format); + if (! is_null($the_path) && count($the_path) > 0) { + $the_path = array_reverse($the_path); + } + return $the_path; + } + + /** + */ + private function get_path_new($node_id, $to_node_id = null, $format = 'full') + { + $the_path = array(); + $trip = ''; + $matrioska = array(); + $this->_get_path($node_id, $the_path, $to_node_id, $format); + + if (! is_null($the_path) && ($loop2do = count($the_path)) > 0) { + $the_path = array_reverse($the_path); + $matrioska = $the_path[0]; + $matrioska['childNodes'] = array(); + $target = &$matrioska['childNodes']; + + $trip = ''; + for ($idx = 0; $idx < ($loop2do - 1); $idx ++) { + $trip[] = $the_path[$idx]['id']; // . "({$idx})"; + $target[0] = $the_path[$idx + 1]; + if ($the_path[$idx + 1]['node_table'] != 'testcases') { + $target = &$target[0]['childNodes']; + } + } + } + + return array( + $trip, + $the_path + ); + } + + /* + * function: _get_path + * This is refactoring of original get_path method. + * Attention: + * returns node in inverse order, that was done for original get_path + * + * args : node_id: start of path + * node_list: passed by reference, to build the result. + * [to_node_id]: destination node. default null -> path to tree root. + * [format]: default 'full' + * + * returns: array + */ + private function _get_path($node_id, &$node_list, $to_node_id = null, + $format = 'full') + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + // look up the parent of this node + $sql = "/* $debugMsg */ " . + " SELECT id,name,parent_id,node_type_id,node_order " . + " FROM {$this->object_table} WHERE id = " . intval($node_id); + + $result = $this->db->exec_query($sql); + if ($this->db->num_rows($result) == 0) { + $node_list = null; + return; + } + + while ($row = $this->db->fetch_array($result)) { + // check & abort + if ($row['parent_id'] == $row['id']) { + throw new Exception("id = parent_id = " . $row['id'], 1); + } + + // only continue if this $node isn't the root node + // (that's the node with no parent) + if ($row['parent_id'] != '' && $row['id'] != $to_node_id) { + // the last part of the path to $node, is the name + // of the parent of $node + switch ($format) { + case 'full': + $row['node_table'] = $this->node_tables_by['id'][$row['node_type_id']]; + $node_list[] = $row; + break; + + case 'simple': + // Warning: starting node is NOT INCLUDED in node_list + $node_list[$row['parent_id']] = $row['parent_id']; + break; + + case 'points': + $node_list[] = $row['id']; + break; + + case 'simple_me': + if (is_null($node_list)) { + $node_list[$row['id']] = $row['id']; + } else { + $node_list[$row['parent_id']] = $row['parent_id']; + } + break; + + case 'name': + $node_list[] = $row['name']; + break; + } + + // we should add the path to the parent of this node to the path + $this->_get_path($row['parent_id'], $node_list, $to_node_id, + $format); + } + } + } + + /* + * function: change_parent + * change node parent, using this method you implement move operation. + * + * args : node_id: node/nodes that need(s) to changed. + * mixed type: single id or array containing set of id. + * + * parent_id: new parent + * + * returns: 1 -> operation OK + */ + public function change_parent($node_id, $parent_id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; + + if (is_array($node_id)) { + $safeSet = array_map('intval', $node_id); + $id_list = implode(",", $safeSet); + $where_clause = " WHERE id IN ($id_list) "; + } else { + $safe = intval($node_id); + if ($safe <= 0) { + throw new Exception("BAD node_id", 1); + } + $where_clause = " WHERE id = $safe"; + } + + $safeP = $this->db->prepare_int($parent_id); + $sql = "/* $debugMsg */ UPDATE {$this->object_table} - SET parent_id = $safeP - $where_clause "; - - $result = $this->db->exec_query($sql); - - return $result ? 1 : 0; - } - - - /* - function: get_children - get nodes that have id as parent node. - Children can be filtering according to node type. - - args : id: node - [exclude_node_types]: map - key: verbose description of node type to exclude. - see get_available_node_types. - value: anything is ok - - returns: array of maps that contain children nodes. - map structure: - id - name - parent_id - node_type_id - node_order - node_table - - - */ - function get_children($id,$exclude_node_types=null,$opt=null) { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $my['opt'] = array('accessKey' => null); - $my['opt'] = array_merge($my['opt'], (array)$opt); - - $sql = "/* $debugMsg */ " . - " SELECT id,name,parent_id,node_type_id,node_order FROM {$this->object_table} " . - " WHERE parent_id = " . $this->db->prepare_int($id) . " ORDER BY node_order,id"; - - $node_list=array(); - $result = $this->db->exec_query($sql); - - if( $this->db->num_rows($result) == 0 ) - { - return(null); - } - - $xdx = 0; - while ( $row = $this->db->fetch_array($result) ) - { - if( !isset($exclude_node_types[$this->node_types[$row['node_type_id']]])) - { - $node_table = $this->node_tables_by['id'][$row['node_type_id']]; - - $ak = is_null($my['opt']['accessKey']) ? $xdx : $row[$my['opt']['accessKey']]; - $node_list[$ak] = array('id' => $row['id'], 'parent_id' => $row['parent_id'], - 'node_type_id' => $row['node_type_id'], - 'node_order' => $row['node_order'], - 'node_table' => $node_table,'name' => $row['name']); - $xdx++; - } - } - return $node_list; - } - - - /* - function: change_order_bulk - change order for all nodes is present in nodes array. - Order of node in tree, is set to position node has in nodes array. - - args : - nodes: array where value is node_id. Node order = node position on array - - returns: - - - */ - function change_order_bulk($nodes) - { - foreach($nodes as $order => $node_id) - { - $order = abs(intval($order)); - $node_id = intval($node_id); - $sql = "UPDATE {$this->object_table} SET node_order = {$order} WHERE id = {$node_id}"; - $result = $this->db->exec_query($sql); - } - } - - - /* - function: change_child_order - will change order of children of parent id, to position - choosen node on top or bottom of children. - - args: - parent_id: node used as root of a tree. - node_id: node which we want to reposition - $top_bottom: possible values 'top', 'bottom' - [exclude_node_types]: map - key: verbose description of node type to exclude. - see get_available_node_types. - value: anything is ok - - - returns: - - - */ - function change_child_order($parent_id,$node_id,$top_bottom,$exclude_node_types=null) - { - $node_type_filter=''; - if( !is_null($exclude_node_types) ) - { - $types=implode("','",array_keys($exclude_node_types)); - $node_type_filter=" AND NT.description NOT IN ('{$types}') "; - } - - $sql = " SELECT NH.id, NH.node_order, NH.name " . - " FROM {$this->object_table} NH, {$this->tables['node_types']} NT " . - " WHERE NH.node_type_id=NT.id " . - " AND NH.parent_id = {$parent_id} AND NH.id <> {$node_id} " . - $node_type_filter . - " ORDER BY NH.node_order,NH.id"; - $children=$this->db->get_recordset($sql); - - switch ($top_bottom) - { - case 'top': - $no[]=$node_id; - if( !is_null($children) ) - { - foreach($children as $key => $value) - { - $no[]=$value['id']; - } - } - break; - - case 'bottom': - $new_order=$this->getBottomOrder($parent_id)+1; - $no[$new_order]=$node_id; - break; - } - $this->change_order_bulk($no); - } - - /* - function: getBottomOrder - given a node id to be used as parent, returns the max(node_order) from the children nodes. - We consider this bottom order. - - args: parentID: - - returns: order - - */ - function getBottomOrder($parentID,$opt=null) { - $debugMsg='Class:' .__CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; - - $my['opt'] = []; - $my['opt'] = array_merge(['node_type' => null],(array)$opt); - - - $sql = "SELECT MAX(node_order) AS max_order" . - " FROM {$this->object_table} " . - " WHERE parent_id={$parentID} "; - - if(!is_null($my['opt']['node_type'])) { - $sql .= " AND node_type_id = " . $this->node_descr_id[$my['opt']['node_type']]; - } - - $sql .= " GROUP BY parent_id "; - $rs = (array)$this->db->get_recordset($sql); - - return (count($rs) > 0 ? $rs[0]['max_order']: 0); - } - - - - - /* - function: get_subtree - Giving a node_id, get the nodes that forma s subtree that - has node_id as root or starting point. - - Is possible to exclude: - branches that has as staring node, node of certain types. - children of some node types. - full branches. - - - args : - [filters] map with following keys - - [exclude_node_types]: map/hash. - default: null -> no exclusion filter will be applied. - Branches starting with nodes of type detailed, will not be - visited => no information will be returned. - key: verbose description of node type to exclude. - (see get_available_node_types). - value: can be any value, because is not used,anyway is suggested - to use 'exclude_me' as value. - - Example: - array('testplan' => 'exclude_me') - Node of type tesplan, will be excluded. - - - - [exclude_children_of]: map/hash - default: null -> no exclusion filter will be applied. - When traversing tree if the type of a node child, of node under analisys, - is contained in this map, traversing of branch starting with this child node - will not be done. - key: verbose description of node type to exclude. - (see get_available_node_types). - value: can be any value, because is not used,anyway is suggested - to use 'exclude_my_children' as value. - - Example: - array('testcase' => 'exclude_my_children') - Children of testcase nodes, (tcversion nodes) will be EXCLUDED. - - [exclude_branches]: map/hash. - default: null -> no exclusion filter will be applied. - key: node id. - value: anything is ok. - - When traversing tree branches that have these node is, will - not be visited => no information will be retrieved. - - - [additionalWhereClause]: sql filter to include in sql sentence used to retrieve nodes. - default: null -> no action taken. - - [family]: used to include guide the tree traversal. - map where key = node_id TO INCLUDE ON traversal - value = map where each key is a CHILD that HAS TO BE INCLUDED in return set. - - [options]: map with following keys - - [recursive]: changes structure of returned structure. - default: false -> a flat array will be generated - true -> a map with recursive structure will be generated. - - false returns array, every element is a map with following keys: - - id - parent_id - node_type_id - node_order - node_table - name - - - true returns a map, with only one element - key: childNodes. - value: array, that represents a tree branch. - Array elements are maps with following keys: - - id - parent_id - node_type_id - node_order - node_table - name - childNodes -> (array) - - - returns: array or map - - - */ - function get_subtree($node_id,$filters=null,$options=null) { - $my['filters'] = array('exclude_node_types' => null, 'exclude_children_of' => null, - 'exclude_branches' => null,'additionalWhereClause' => '', 'family' => null); - - $my['options'] = array('recursive' => false, 'order_cfg' => array("type" =>'spec_order'), - 'output' => 'essential', 'key_type' => 'std', 'addJoin' => '', 'addFields' => ''); - - // Cast to array to handle $options = null - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - $the_subtree = array(); - - // Generate NOT IN CLAUSE to exclude some node types - // $not_in_clause = $my['filters']['additionalWhereClause']; - if(!is_null($my['filters']['exclude_node_types'])) - { - $exclude = array(); - foreach($my['filters']['exclude_node_types'] as $the_key => $elem) - { - $exclude[] = $this->node_descr_id[$the_key]; - } - $my['filters']['additionalWhereClause'] .= " AND node_type_id NOT IN (" . implode(",",$exclude) . ")"; - } - - $method2call = $my['options']['recursive'] ? '_get_subtree_rec' : '_get_subtree'; - $qnum = $this->$method2call($node_id,$the_subtree,$my['filters'],$my['options']); - return $the_subtree; - } - - /** - * - */ - function _get_subtree($node_id,&$node_list,$filters = null, $options = null) - { - static $my; - if(!$my) - { - $my['filters'] = array('exclude_children_of' => null,'exclude_branches' => null, - 'additionalWhereClause' => '', 'family' => null); - - $my['options'] = array('order_cfg' => array("type" =>'spec_order'), - 'output' => 'full', 'key_type' => 'std', - 'addJoin' => '', 'addFields' => ''); - - } - - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - switch($my['options']['order_cfg']['type']) - { - case 'spec_order': - $sql = " SELECT id,name,parent_id,node_type_id,node_order " . - $my['options']['addFields'] . - " FROM {$this->object_table} {$my['options']['addJoin']} " . - " WHERE parent_id = {$node_id} " . - " {$my['filters']['additionalWhereClause']}" . - " ORDER BY node_order,id"; - break; - - case 'rspec': - $sql = " SELECT OBT.id,name,parent_id,node_type_id,node_order," . - " RSPEC.doc_id " . - " FROM {$this->object_table} AS OBT " . - " JOIN {$this->tables['req_specs']} AS RSPEC " . - " ON RSPEC.id = OBT.id " . - " WHERE parent_id = {$node_id} " . - " {$my['filters']['additionalWhereClause']}" . - " ORDER BY node_order,OBT.id"; - break; - - case 'exec_order': - // REMEMBER THAT DISTINCT IS NOT NEEDED when you does UNION WITHOUT ALL - // - // First query get Nodes that ARE NOT test case => test suites - // Second query get the TEST CASES - // - $sql = "SELECT * FROM ( SELECT NH.node_order AS spec_order," . - " NH.node_order AS node_order, NH.id, NH.parent_id," . - " NH.name, NH.node_type_id, 0 AS tcversion_id" . - " FROM {$this->object_table} NH, {$this->tables['node_types']} NT" . - " WHERE parent_id = {$node_id}" . - " AND NH.node_type_id=NT.id" . - " AND NT.description <> 'testcase' {$my['filters']['additionalWhereClause']}" . - " UNION" . - " SELECT NHA.node_order AS spec_order, " . - " T.node_order AS node_order, NHA.id, NHA.parent_id, " . - " NHA.name, NHA.node_type_id, T.tcversion_id" . - " FROM {$this->object_table} NHA, {$this->object_table} NHB," . - " {$this->tables['testplan_tcversions']} T,{$this->tables['node_types']} NT" . - " WHERE NHA.id=NHB.parent_id " . - " AND NHA.node_type_id=NT.id" . - " AND NHB.id=T.tcversion_id " . - " AND NT.description = 'testcase'" . - " AND NHA.parent_id = {$node_id}" . - " AND T.testplan_id = {$my['options']['order_cfg']['tplan_id']}) AC" . - " ORDER BY node_order,spec_order,id"; - break; - - case 'req_order': - $sql = " SELECT NH_TC.id,NH_TC.name,NH_TC.parent_id," . - " NH_TC.node_type_id,NH_TC.node_order " . - " {$my['options']['addFields']}" . - " FROM {$this->object_table} AS NH_TC " . - " {$my['options']['addJoin']} " . - " JOIN {$this->tables['req_coverage']} RC " . - " ON RC.testcase_id = NH_TC.id " . - " WHERE RC.req_id = {$node_id} " . - " {$my['filters']['additionalWhereClause']}" . - " ORDER BY NH_TC.node_order,NH_TC.id"; - break; - - } - - $result = $this->db->exec_query($sql); - - if( $this->db->num_rows($result) == 0 ) - { - return; - } - - while ( $row = $this->db->fetch_array($result) ) - { - if( !isset($my['filters']['exclude_branches'][$row['id']]) ) - { - - $node_table = $this->node_tables[$this->node_types[$row['node_type_id']]]; - - - switch($my['options']['output']) - { - case 'id': - $node_list[] = $row['id']; - break; - - case 'essential': - $node_list[] = array('id' => $row['id'], - 'parent_id' => $row['parent_id'], - 'node_type_id' => $row['node_type_id'], - 'node_order' => $row['node_order'], - 'node_table' => $node_table, - 'name' => $row['name']); - break; - - case 'rspec': - $node_list[] = array('id' => $row['id'], - 'parent_id' => $row['parent_id'], - 'doc_id' => $row['doc_id'], - 'node_type_id' => $row['node_type_id'], - 'node_order' => $row['node_order'], - 'node_table' => $node_table, - 'name' => $row['name']); - break; - - - case 'full': - default: - // this choice - // 'tcversion_id' => (isset($row['parent_id']) ? $row['parent_id'] : -1), - // need to be documented and REVIEWED, because can generate confusion - $node_list[] = array('id' => $row['id'], - 'parent_id' => $row['parent_id'], - 'tcversion_id' => (isset($row['parent_id']) ? $row['parent_id'] : -1), - 'node_type_id' => $row['node_type_id'], - 'node_order' => $row['node_order'], - 'node_table' => $node_table, - 'name' => $row['name']); - break; - } - // Basically we use this because: - // 1. Sometimes we don't want the children if the parent is a testcase, - // due to the version management - // - // 2. Sometime we want to exclude all descendants (branch) of a node. - // - // [franciscom]: - // I think ( but I have no figures to backup my thoughts) doing this check and - // avoiding the function call is better that passing a condition that will result - // in a null result set. - // - // - if( !isset($my['filters']['exclude_children_of'][$this->node_types[$row['node_type_id']]]) && - !isset($my['filters']['exclude_branches'][$row['id']]) ) - { - $this->_get_subtree($row['id'],$node_list,$filters,$options); - } - } - } - } // function end - - /** - * - */ - function _get_subtree_rec($node_id,&$pnode,$filters = null, $options = null) - { - static $tcNodeTypeID; - static $qnum; - static $my; - static $platform_filter; - static $fclause; - static $exclude_branches; - static $exclude_children_of; - - if (!$tcNodeTypeID) - { - $tcNodeTypeID = $this->node_descr_id['testcase']; - - $qnum=0; - - $my['filters'] = array('exclude_children_of' => null,'exclude_branches' => null, - 'additionalWhereClause' => '', 'family' => null); - - $my['options'] = array('order_cfg' => array("type" =>'spec_order'),'key_type' => 'std', - 'remove_empty_nodes_of_type' => null); - - // Cast to array to handle $options = null - $my['filters'] = array_merge($my['filters'], (array)$filters); - $my['options'] = array_merge($my['options'], (array)$options); - - $platform_filter = ""; - if( isset($my['options']['order_cfg']['platform_id']) && - ($safe_pid = intval($my['options']['order_cfg']['platform_id']) ) > 0 ) - { - $platform_filter = " /* Platform filter */ " . - " AND T.platform_id = " . $safe_pid; - } - - $fclause = " AND node_type_id <> {$tcNodeTypeID} {$my['filters']['additionalWhereClause']} "; - - - if( !is_null($my['options']['remove_empty_nodes_of_type']) ) - { - // this way I can manage code or description - if( !is_numeric($my['options']['remove_empty_nodes_of_type']) ) - { - $my['options']['remove_empty_nodes_of_type'] = - $this->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; - } - } - - - $exclude_branches = $my['filters']['exclude_branches']; - $exclude_children_of = $my['filters']['exclude_children_of']; - } - - switch($my['options']['order_cfg']['type']) - { - case 'spec_order': - $sql = " SELECT id,name,parent_id,node_type_id,node_order FROM {$this->object_table} " . - " WHERE parent_id = {$node_id} {$my['filters']['additionalWhereClause']}" . - " ORDER BY node_order,id"; - break; - - case 'exec_order': - // Hmmm, no action regarding platforms. is OK ?? - // - // REMEMBER THAT DISTINCT IS NOT NEEDED when you does UNION - // - // Important Notice: - // Second part of UNION, allows to get from nodes hierarchy, - // only test cases that has a version linked to test plan. - // - $sql="SELECT * FROM ( SELECT NH.node_order AS spec_order," . - " NH.node_order AS node_order, NH.id, NH.parent_id," . - " NH.name, NH.node_type_id, 0 AS tcversion_id " . - " FROM {$this->tables['nodes_hierarchy']} NH" . - " WHERE parent_id = {$node_id} {$fclause} " . - " UNION" . - " SELECT NHA.node_order AS spec_order, " . - " T.node_order AS node_order, NHA.id, NHA.parent_id, " . - " NHA.name, NHA.node_type_id, T.tcversion_id " . - " FROM {$this->tables['nodes_hierarchy']} NHA, " . - " {$this->tables['nodes_hierarchy']} NHB," . - " {$this->tables['testplan_tcversions']} T" . - " WHERE NHA.id=NHB.parent_id " . - " AND NHA.node_type_id = {$tcNodeTypeID}" . - " AND NHB.id=T.tcversion_id " . - " AND NHA.parent_id = {$node_id} {$platform_filter} " . - " AND T.testplan_id = {$my['options']['order_cfg']['tplan_id']}) AC" . - " ORDER BY node_order,spec_order,id"; - break; - - } - - $result = $this->db->exec_query($sql); - $qnum++; - while($row = $this->db->fetch_array($result)) - { - if(!isset($exclude_branches[$row['id']])) - { - switch($my['options']['key_type']) - { - case 'std': - $node = array('parent_id' => $row['parent_id'], - 'id' => $row['id'], - 'name' => $row['name'], - 'childNodes' => null, - 'node_table' => $this->node_tables_by['id'][$row['node_type_id']], - 'node_type_id' => $row['node_type_id'], - 'node_order' => $row['node_order']); - - if( isset($row['tcversion_id']) && $row['tcversion_id'] > 0) - { - $node['tcversion_id'] = $row['tcversion_id']; - } - break; - - case 'extjs': - $node = array('text' => $row['name'], - 'id' => $row['id'], - 'parent_id' => $row['parent_id'], - 'node_type_id' => $row['node_type_id'], - 'position' => $row['node_order'], - 'childNodes' => null, - 'leaf' => false); - - switch($this->node_types[$row['node_type_id']]) - { - case 'testproject': - case 'testsuite': - $node['childNodes'] = null; - break; - - case 'testcase': - $node['leaf'] = true; - break; - } - break; - } - - // Basically we use this because: - // 1. Sometimes we don't want the children if the parent is a testcase, - // due to the version management - // - // 2. Sometime we want to exclude all descendants (branch) of a node. - // - // [franciscom]: - // I think ( but I have no figures to backup my thoughts) doing this check and - // avoiding the function call is better that passing a condition that will result - // in a null result set. - // - // - if(!isset($exclude_children_of[$this->node_types[$row['node_type_id']]]) && - !isset($exclude_branches[$row['id']])) - { - $this->_get_subtree_rec($row['id'],$node,$my['filters'],$my['options']); - } - - // Have added this logic, because when export test plan will be developed - // having a test spec tree where test suites that do not contribute to test plan - // are pruned/removed is very important, to avoid additional processing - // - $doRemove = is_null($node['childNodes']) && - $node['node_type_id'] == $my['options']['remove_empty_nodes_of_type']; - - if(!$doRemove) - { - $pnode['childNodes'][] = $node; - } - } // if(!isset($exclude_branches[$rowID])) - } //while - return $qnum; - } - - /** - * function: get_full_path_verbose - * when path can not be found instead of null, anyway a map will be returned, with key=itemID value=NULL - * @internal revisions - **/ - function get_full_path_verbose(&$items,$options=null) { - $debugMsg='Class:' .__CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; - $goto_root=null; - $path_to=null; - $all_nodes=array(); - $path_format = 'simple'; - $output_format = 'simple'; - - if( !is_null($options) ) - { - // not a good solution, but Quick & Dirty - $path_format = isset($options['path_format']) ? $options['path_format'] : $path_format; - if( !isset($options['path_format']) ) - { - $path_format = isset($options['include_starting_point']) ? 'points' : $path_format; - } - $output_format = isset($options['output_format']) ? $options['output_format'] : $output_format; - } - - // according to count($items) we will try to optimize, sorry for magic number - if( count((array)$items) > 200) - { - $xitems = array_flip((array)$items); - $xsql = " SELECT parent_id,id " . - " FROM {$this->tables['nodes_hierarchy']} " . - " WHERE id IN (" . implode(',',array_keys($xitems)) . ")"; - - $xmen = $this->db->fetchRowsIntoMap($xsql,'parent_id',database::CUMULATIVE); - $all_nodes = array(); - foreach($xmen as $parent_id => &$children) - { - $paty = $this->get_path($parent_id,$goto_root,$path_format); - $paty[] = $parent_id; - - $all_nodes = array_merge($all_nodes,$paty); - foreach($children as &$item) - { - $path_to[$item['id']]['name'] = $stairway2heaven[$item['id']] = $paty; - $all_nodes[] = $item['id']; - } - } - unset($xmen); - } - else - { - foreach((array)$items as $item_id) - { - $stairway2heaven[$item_id] = $this->get_path($item_id,$goto_root,$path_format); - $path_to[$item_id]['name'] = $stairway2heaven[$item_id]; - $all_nodes = array_merge($all_nodes,(array)$path_to[$item_id]['name']); - } - } - - $status_ok = (!is_null($all_nodes) && count($all_nodes) > 0); - if( $status_ok ) - { - // get only different items, to get descriptions - $unique_nodes=implode(',',array_unique($all_nodes)); - - $sql="/* $debugMsg */ " . - " SELECT id,name FROM {$this->tables['nodes_hierarchy']} WHERE id IN ({$unique_nodes})"; - $decode=$this->db->fetchRowsIntoMap($sql,'id'); - - foreach($path_to as $key => $elem) - { - foreach($elem['name'] as $idx => $node_id) - { - $path_to[$key]['name'][$idx]=$decode[$node_id]['name']; - $path_to[$key]['node_id'][$idx]=$node_id; - } - } - unset($decode); - } - else - { - $path_to=null; - } - - if( !is_null($path_to) ) - { - switch ($output_format) - { - case 'path_as_string': - case 'stairway2heaven': - $flat_path=null; - foreach($path_to as $item_id => $pieces) - { - // remove root node - unset($pieces['name'][0]); - $flat_path[$item_id]=implode('/',$pieces['name']); - } - if($output_format == 'path_as_string') - { - $path_to = $flat_path; - } - else - { - $path_to = null; - $path_to['flat'] = $flat_path; - $path_to['staircase'] = $stairway2heaven; - } - break; - - case 'id_name': - break; - - case 'simple': - default: - $keySet = array_keys($path_to); - foreach($keySet as $key) - { - $path_to[$key] = $path_to[$key]['name']; - } - break; - } - } - unset($stairway2heaven); - return $path_to; - } - - - /** - * check if there is a sibbling node of same type that has same name - * - * @param string name: name to check - * @param int node_type_id: node types to check. - * @param int id: optional. exclude this node id from result set - * this is useful when you want to check for name - * existence during an update operation. - * Using id you get node parent, to get sibblings. - * If null parent_id argument must be present - * - * @param int parent_id: optional. Mandatory if id is null - * Used to get children nodes to check for - * name existence. - * - * - * @return map ret: ret['status']=1 if name exists - * 0 if name does not exist - * ret['msg']= localized message - * - */ - function nodeNameExists($name,$node_type_id,$id=null,$parent_id=null) - { - $debugMsg='Class:' .__CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; - $ret['status'] = 0; - $ret['msg'] = ''; - if( is_null($id) && is_null($parent_id) ) - { - $msg = $debugMsg . 'Error on call $id and $parent_id can not be both null'; - throw new Exception($msg); - } - - - $additionalFilters = ''; - $parentNodeID = intval($parent_id); - if( !is_null($id) ) - { - // Try to get parent id if not provided on method call. - if( is_null($parentNodeID) || $parentNodeID <= 0) - { - $sql = "/* {$debugMsg} */ " . - " SELECT parent_id FROM {$this->object_table} NHA " . - " WHERE NHA.id = " . $this->db->prepare_int($id); - $rs = $this->db->get_recordset($sql); - $parentNodeID = intval($rs[0]['parent_id']); - - } - $additionalFilters = " AND NHA.id <> " . $this->db->prepare_int($id); - } - - if( $parentNodeID <= 0) - { - $msg = $debugMsg . ' FATAL Error $parentNodeID can not be <= 0'; - throw new Exception($msg); - } - - - $sql = "/* {$debugMsg} */ " . - " SELECT count(0) AS qty FROM {$this->object_table} NHA " . - " WHERE NHA.node_type_id = {$node_type_id} " . - " AND NHA.name = '" . $this->db->prepare_string($name) . "'" . - " AND NHA.parent_id = " . $this->db->prepare_int($parentNodeID) . " {$additionalFilters} "; - - $rs = $this->db->get_recordset($sql); - if( $rs[0]['qty'] > 0) - { - $ret['status'] = 1; - $ret['msg'] = sprintf(lang_get('name_already_exists'),$name); - } - - return $ret; - } - - /** - * getTreeRoot() - * - */ - function getTreeRoot($node_id) { - $path = (array)$this->get_path($node_id); - $path_len = count($path); - $root_node_id = ($path_len > 0)? $path[0]['parent_id'] : $node_id; - return $root_node_id; - } - - - /** - * delete_subtree_objects() - * - * ATTENTION: subtree root node ($node_id?? or root_id?) IS NOT DELETED. - * - */ - function delete_subtree_objects($root_id,$node_id,$additionalWhereClause = '',$exclude_children_of = null, - $exclude_branches = null) - { - static $debugMsg; - if( is_null($debugMsg) ) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - } - - $sql = "/* $debugMsg */ SELECT NH.* FROM {$this->object_table} NH " . - " WHERE NH.parent_id = " . $this->db->prepare_int($node_id) . " {$additionalWhereClause} "; - $rs = $this->db->get_recordset($sql); - if( !is_null($rs) ) - { - foreach($rs as $row) - { - $rowID = $row['id']; - $nodeTypeID = $row['node_type_id']; - $nodeType = $this->node_types[$nodeTypeID]; - $nodeClassName = $this->class_name[$nodeTypeID]; - if(!isset($exclude_branches[$rowID])) - { - // Basically we use this because: - // 1. Sometimes we don't want the children if the parent is a testcase, - // due to the version management - // - // 2. Sometime we want to exclude all descendants (branch) of a node. - // - if(!isset($exclude_children_of[$nodeType]) && !isset($exclude_branches[$rowID])) - { - // I'm paying not having commented this well - // Why I've set root_id to null ? - // doing this when traversing a tree, containers under level of subtree root - // will not be deleted => and this seems to be wrong. - $this->delete_subtree_objects($root_id,$rowID,$additionalWhereClause,$exclude_children_of,$exclude_branches); - } - else - { - // For us in this method context this node is a leaf => just delete - if( !is_null($nodeClassName) ) - { - $item_mgr = new $nodeClassName($this->db); - $item_mgr->delete($rowID); - } - else if (isset($this->nodeWithoutClass[$nodeTypeID])) - { - } - else - { - // need to signal error - TO BE DONE - // echo '
    AUCH!!!'; - } - } - } // if(!isset($exclude_branches[$rowID])) - } //while - } - - // Must delete myself if I'm empty, only if I'm not subtree root. - // Done this way to avoid infinte recursion for some type of nodes - // that use this method as it's delete method. (example testproject). - - // Hmmm, need to recheck if this condition is ok - // - if( !is_null($root_id) && ($node_id != $root_id) ) - { - $children = (array)$this->db->get_recordset($sql); - if( count($children) == 0 ) - { - $sql2 = "/* $debugMsg */ SELECT NH.* FROM {$this->object_table} NH " . - " WHERE NH.id = " . $this->db->prepare_int($node_id); - $node_info = $this->db->get_recordset($sql2); - if( isset($this->class_name[$node_info[0]['node_type_id']]) ) - { - $className = $this->class_name[$node_info[0]['node_type_id']]; - if( !is_null($className) ) - { - $item_mgr = new $className($this->db); - $item_mgr->delete($node_id); - } - } - else if (isset($this->nodeWithoutClass[$node_info[0]['node_type_id']])) - { - } - else - { - // need to signal error - TO BE DONE - // echo '
    AUCH!!!'; - } - } - } // if( $node_id != $root_id ) - } - - - /* - - [$mode]: dotted -> $level number of dot characters are appended to - the left of item name to create an indent effect. - Level indicates on what tree layer item is positioned. - Example: - - null - \ - id=1 <--- Tree Root = Level 0 - | - + ------+ - / \ \ - id=9 id=2 id=8 <----- Level 1 - \ - id=3 <----- Level 2 - \ - id=4 <----- Level 3 - - - key: item id (= node id on tree). - value: every array element is an string, containing item name. - - Result example: - - 2 .TS1 - 3 ..TS2 - 9 .20071014-16:22:07 TS1 - 10 ..TS2 - - - array -> key: item id (= node id on tree). - value: every array element is a map with the following keys - 'name', 'level' - - 2 array(name => 'TS1',level => 1) - 3 array(name => 'TS2',level => 2) - 9 array(name => '20071014-16:22:07 TS1',level =>1) - 10 array(name => 'TS2', level => 2) - - */ - function createHierarchyMap($array2map,$mode='dotted',$field2add=null) - { - $hmap=array(); - $the_level = 1; - $level = array(); - $pivot = $array2map[0]; - $addField = !is_null($field2add); - $mode = is_null($mode) ? 'dotted' : $mode; - - foreach($array2map as $elem) - { - $current = $elem; - if ($pivot['id'] == $current['parent_id']) - { - $the_level++; - $level[$current['parent_id']]=$the_level; - } - else if ($pivot['parent_id'] != $current['parent_id']) - { - $the_level = $level[$current['parent_id']]; - } - - switch($mode) - { - case 'dotted': - $hmap[$current['id']] = str_repeat('.',$the_level); - if($addField) - { - $hmap[$current['id']] .= sprintf($field2add['format'],$current[$field2add['field']]); - } - $hmap[$current['id']] .= $current['name']; - break; - - case 'array': - $str = ($addField ? $current[$field2add] : '') . $current['name']; - $hmap[$current['id']] = array('name' => $str, 'level' => $the_level); - break; - } - - // update pivot - $level[$current['parent_id']]= $the_level; - $pivot=$elem; - } - - return $hmap; - } - - /** - * getAllItemsID - * - * @internal revisions - * based on code from testproject->get_all_testcases_id - * - */ - function getAllItemsID($parentList,&$itemSet,$coupleTypes) - { - static $debugMsg; - if (!$debugMsg) - { - } - $sql = "/* $debugMsg */ " . - " SELECT id,node_type_id from {$this->tables['nodes_hierarchy']} " . - " WHERE parent_id IN ({$parentList})"; - $sql .= " AND node_type_id IN ({$coupleTypes['target']},{$coupleTypes['container']}) "; - - $result = $this->db->exec_query($sql); - if ($result) - { - $containerSet = array(); - while($row = $this->db->fetch_array($result)) - { - if ($row['node_type_id'] == $coupleTypes['target']) - { - $itemSet[] = $row['id']; - } - else - { - $containerSet[] = $row['id']; - } - } - if (sizeof($containerSet)) - { - $containerSet = implode(",",$containerSet); - $this->getAllItemsID($containerSet,$itemSet,$coupleTypes); - } - } - } - - /** - * - */ - function getNodeByAttributes($attr) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $addJoin = ''; - $sql = "/* $debugMsg */ "; - $sql .= " SELECT NH_MAIN.id,NH_MAIN.parent_id,NH_MAIN.name,NH_MAIN.node_type_id " . - " FROM {$this->object_table} AS NH_MAIN " . - " JOIN {$this->tables['node_types']} AS NT ON NT.id = NH_MAIN.node_type_id "; - - $where = " WHERE 1=1 "; - foreach($attr as $key => $value) - { - switch($key) - { - case 'type': - $where .= " AND NT.description = '" . $this->db->prepare_string($value) . "'"; - break; - - case 'id': - $where .= " AND NH_MAIN.is = " . $this->db->prepare_int($value); - break; - - case 'name': - $where .= " AND NH_MAIN.name = '" . $this->db->prepare_string($value) . "'"; - break; - - case 'parent_id': - $where .= " AND NH_MAIN.parent_id = " . $this->db->prepare_int($value); - $addJoin = " JOIN {$this->object_table} AS NH_PARENT ON NH_PARENT.id = NH_MAIN.parent_id "; - break; - } - } - - $sql .= $addJoin . $where; - $rs = $this->db->fetchRowsIntoMap($sql,'id'); - return $rs; - } - - /** - * - */ - function getNodeType($id) { - $sql = " SELECT node_type_id, NT.description AS node_type + SET parent_id = $safeP + $where_clause "; + + $result = $this->db->exec_query($sql); + + return $result ? 1 : 0; + } + + /* + * function: get_children + * get nodes that have id as parent node. + * Children can be filtering according to node type. + * + * args : id: node + * [exclude_node_types]: map + * key: verbose description of node type to exclude. + * see get_available_node_types. + * value: anything is ok + * + * returns: array of maps that contain children nodes. + * map structure: + * id + * name + * parent_id + * node_type_id + * node_order + * node_table + */ + public function get_children($id, $exclude_node_types = null, $opt = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $my['opt'] = array( + 'accessKey' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $sql = "/* $debugMsg */ " . + " SELECT id,name,parent_id,node_type_id,node_order FROM {$this->object_table} " . + " WHERE parent_id = " . $this->db->prepare_int($id) . + " ORDER BY node_order,id"; + + $node_list = array(); + $result = $this->db->exec_query($sql); + + if ($this->db->num_rows($result) == 0) { + return null; + } + + $xdx = 0; + while ($row = $this->db->fetch_array($result)) { + if (! isset( + $exclude_node_types[$this->node_types[$row['node_type_id']]])) { + $node_table = $this->node_tables_by['id'][$row['node_type_id']]; + + $ak = is_null($my['opt']['accessKey']) ? $xdx : $row[$my['opt']['accessKey']]; + $node_list[$ak] = array( + 'id' => $row['id'], + 'parent_id' => $row['parent_id'], + 'node_type_id' => $row['node_type_id'], + 'node_order' => $row['node_order'], + 'node_table' => $node_table, + 'name' => $row['name'] + ); + $xdx ++; + } + } + return $node_list; + } + + /* + * function: change_order_bulk + * change order for all nodes is present in nodes array. + * Order of node in tree, is set to position node has in nodes array. + * + * args : + * nodes: array where value is node_id. Node order = node position on array + * + * returns: - + */ + public function change_order_bulk($nodes) + { + foreach ($nodes as $order => $node_id) { + $order = abs(intval($order)); + $node_id = intval($node_id); + $sql = "UPDATE {$this->object_table} SET node_order = {$order} WHERE id = {$node_id}"; + $this->db->exec_query($sql); + } + } + + /* + * function: change_child_order + * will change order of children of parent id, to position + * choosen node on top or bottom of children. + * + * args: + * parent_id: node used as root of a tree. + * node_id: node which we want to reposition + * $top_bottom: possible values 'top', 'bottom' + * [exclude_node_types]: map + * key: verbose description of node type to exclude. + * see get_available_node_types. + * value: anything is ok + * returns: - + * + */ + public function change_child_order($parent_id, $node_id, $top_bottom, + $exclude_node_types = null) + { + $node_type_filter = ''; + if (! is_null($exclude_node_types)) { + $types = implode("','", array_keys($exclude_node_types)); + $node_type_filter = " AND NT.description NOT IN ('{$types}') "; + } + + $sql = " SELECT NH.id, NH.node_order, NH.name " . + " FROM {$this->object_table} NH, {$this->tables['node_types']} NT " . + " WHERE NH.node_type_id=NT.id " . + " AND NH.parent_id = {$parent_id} AND NH.id <> {$node_id} " . + $node_type_filter . " ORDER BY NH.node_order,NH.id"; + $children = $this->db->get_recordset($sql); + + switch ($top_bottom) { + case 'top': + $no[] = $node_id; + if (! is_null($children)) { + foreach ($children as $value) { + $no[] = $value['id']; + } + } + break; + + case 'bottom': + $new_order = $this->getBottomOrder($parent_id) + 1; + $no[$new_order] = $node_id; + break; + } + $this->change_order_bulk($no); + } + + /* + * function: getBottomOrder + * given a node id to be used as parent, returns the max(node_order) from the children nodes. + * We consider this bottom order. + * + * args: parentID: + * + * returns: order + */ + public function getBottomOrder($parentID, $opt = null) + { + $my['opt'] = array_merge([ + 'node_type' => null + ], (array) $opt); + + $sql = "SELECT MAX(node_order) AS max_order" . + " FROM {$this->object_table} " . " WHERE parent_id={$parentID} "; + + if (! is_null($my['opt']['node_type'])) { + $sql .= " AND node_type_id = " . + $this->node_descr_id[$my['opt']['node_type']]; + } + + $sql .= " GROUP BY parent_id "; + $rs = (array) $this->db->get_recordset($sql); + + return ! empty($rs) ? $rs[0]['max_order'] : 0; + } + + /* + * function: get_subtree + * Giving a node_id, get the nodes that forma s subtree that + * has node_id as root or starting point. + * + * Is possible to exclude: + * branches that has as staring node, node of certain types. + * children of some node types. + * full branches. + * + * + * args : + * [filters] map with following keys + * + * [exclude_node_types]: map/hash. + * default: null -> no exclusion filter will be applied. + * Branches starting with nodes of type detailed, will not be + * visited => no information will be returned. + * key: verbose description of node type to exclude. + * (see get_available_node_types). + * value: can be any value, because is not used,anyway is suggested + * to use 'exclude_me' as value. + * + * Example: + * array('testplan' => 'exclude_me') + * Node of type tesplan, will be excluded. + * + * + * + * [exclude_children_of]: map/hash + * default: null -> no exclusion filter will be applied. + * When traversing tree if the type of a node child, of node under analisys, + * is contained in this map, traversing of branch starting with this child node + * will not be done. + * key: verbose description of node type to exclude. + * (see get_available_node_types). + * value: can be any value, because is not used,anyway is suggested + * to use 'exclude_my_children' as value. + * + * Example: + * array('testcase' => 'exclude_my_children') + * Children of testcase nodes, (tcversion nodes) will be EXCLUDED. + * + * [exclude_branches]: map/hash. + * default: null -> no exclusion filter will be applied. + * key: node id. + * value: anything is ok. + * + * When traversing tree branches that have these node is, will + * not be visited => no information will be retrieved. + * + * + * [additionalWhereClause]: sql filter to include in sql sentence used to retrieve nodes. + * default: null -> no action taken. + * + * [family]: used to include guide the tree traversal. + * map where key = node_id TO INCLUDE ON traversal + * value = map where each key is a CHILD that HAS TO BE INCLUDED in return set. + * + * [options]: map with following keys + * + * [recursive]: changes structure of returned structure. + * default: false -> a flat array will be generated + * true -> a map with recursive structure will be generated. + * + * false returns array, every element is a map with following keys: + * + * id + * parent_id + * node_type_id + * node_order + * node_table + * name + * + * + * true returns a map, with only one element + * key: childNodes. + * value: array, that represents a tree branch. + * Array elements are maps with following keys: + * + * id + * parent_id + * node_type_id + * node_order + * node_table + * name + * childNodes -> (array) + * + * + * returns: array or map + */ + public function get_subtree($node_id, $filters = null, $options = null) + { + $my['filters'] = array( + 'exclude_node_types' => null, + 'exclude_children_of' => null, + 'exclude_branches' => null, + 'additionalWhereClause' => '', + 'family' => null + ); + + $my['options'] = array( + 'recursive' => false, + 'order_cfg' => array( + "type" => 'spec_order' + ), + 'output' => 'essential', + 'key_type' => 'std', + 'addJoin' => '', + 'addFields' => '' + ); + + // Cast to array to handle $options = null + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $the_subtree = array(); + + // Generate NOT IN CLAUSE to exclude some node types + // $not_in_clause = $my['filters']['additionalWhereClause']; + if (! is_null($my['filters']['exclude_node_types'])) { + $exclude = array(); + foreach ($my['filters']['exclude_node_types'] as $the_key => $elem) { + $exclude[] = $this->node_descr_id[$the_key]; + } + $my['filters']['additionalWhereClause'] .= " AND node_type_id NOT IN (" . + implode(",", $exclude) . ")"; + } + + $method2call = $my['options']['recursive'] ? 'getSubtreeRec' : '_get_subtree'; + $this->$method2call($node_id, $the_subtree, $my['filters'], + $my['options']); + return $the_subtree; + } + + /** + */ + private function _get_subtree($node_id, &$node_list, $filters = null, + $options = null) + { + static $my; + if (! $my) { + $my['filters'] = array( + 'exclude_children_of' => null, + 'exclude_branches' => null, + 'additionalWhereClause' => '', + 'family' => null + ); + + $my['options'] = array( + 'order_cfg' => array( + "type" => 'spec_order' + ), + 'output' => 'full', + 'key_type' => 'std', + 'addJoin' => '', + 'addFields' => '' + ); + } + + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + switch ($my['options']['order_cfg']['type']) { + case 'spec_order': + $sql = " SELECT id,name,parent_id,node_type_id,node_order " . + $my['options']['addFields'] . + " FROM {$this->object_table} {$my['options']['addJoin']} " . + " WHERE parent_id = {$node_id} " . + " {$my['filters']['additionalWhereClause']}" . + " ORDER BY node_order,id"; + break; + + case 'rspec': + $sql = " SELECT OBT.id,name,parent_id,node_type_id,node_order," . + " RSPEC.doc_id " . " FROM {$this->object_table} AS OBT " . + " JOIN {$this->tables['req_specs']} AS RSPEC " . + " ON RSPEC.id = OBT.id " . " WHERE parent_id = {$node_id} " . + " {$my['filters']['additionalWhereClause']}" . + " ORDER BY node_order,OBT.id"; + break; + + case 'exec_order': + // REMEMBER THAT DISTINCT IS NOT NEEDED when you does UNION WITHOUT ALL + // + // First query get Nodes that ARE NOT test case => test suites + // Second query get the TEST CASES + // + $sql = "SELECT * FROM ( SELECT NH.node_order AS spec_order," . + " NH.node_order AS node_order, NH.id, NH.parent_id," . + " NH.name, NH.node_type_id, 0 AS tcversion_id" . + " FROM {$this->object_table} NH, {$this->tables['node_types']} NT" . + " WHERE parent_id = {$node_id}" . + " AND NH.node_type_id=NT.id" . + " AND NT.description <> 'testcase' {$my['filters']['additionalWhereClause']}" . + " UNION" . + " SELECT NHA.node_order AS spec_order, " . + " T.node_order AS node_order, NHA.id, NHA.parent_id, " . + " NHA.name, NHA.node_type_id, T.tcversion_id" . + " FROM {$this->object_table} NHA, {$this->object_table} NHB," . + " {$this->tables['testplan_tcversions']} T,{$this->tables['node_types']} NT" . + " WHERE NHA.id=NHB.parent_id " . + " AND NHA.node_type_id=NT.id" . + " AND NHB.id=T.tcversion_id " . + " AND NT.description = 'testcase'" . + " AND NHA.parent_id = {$node_id}" . + " AND T.testplan_id = {$my['options']['order_cfg']['tplan_id']}) AC" . + " ORDER BY node_order,spec_order,id"; + break; + + case 'req_order': + $sql = " SELECT NH_TC.id,NH_TC.name,NH_TC.parent_id," . + " NH_TC.node_type_id,NH_TC.node_order " . + " {$my['options']['addFields']}" . + " FROM {$this->object_table} AS NH_TC " . + " {$my['options']['addJoin']} " . + " JOIN {$this->tables['req_coverage']} RC " . + " ON RC.testcase_id = NH_TC.id " . + " WHERE RC.req_id = {$node_id} " . + " {$my['filters']['additionalWhereClause']}" . + " ORDER BY NH_TC.node_order,NH_TC.id"; + break; + } + + $result = $this->db->exec_query($sql); + + if ($this->db->num_rows($result) == 0) { + return; + } + + while ($row = $this->db->fetch_array($result)) { + if (! isset($my['filters']['exclude_branches'][$row['id']])) { + + $node_table = $this->node_tables[$this->node_types[$row['node_type_id']]]; + + switch ($my['options']['output']) { + case 'id': + $node_list[] = $row['id']; + break; + + case 'essential': + $node_list[] = array( + 'id' => $row['id'], + 'parent_id' => $row['parent_id'], + 'node_type_id' => $row['node_type_id'], + 'node_order' => $row['node_order'], + 'node_table' => $node_table, + 'name' => $row['name'] + ); + break; + + case 'rspec': + $node_list[] = array( + 'id' => $row['id'], + 'parent_id' => $row['parent_id'], + 'doc_id' => $row['doc_id'], + 'node_type_id' => $row['node_type_id'], + 'node_order' => $row['node_order'], + 'node_table' => $node_table, + 'name' => $row['name'] + ); + break; + + case 'full': + default: + // this choice + // 'tcversion_id' => (isset($row['parent_id']) ? $row['parent_id'] : -1), + // need to be documented and REVIEWED, because can generate confusion + $node_list[] = array( + 'id' => $row['id'], + 'parent_id' => $row['parent_id'], + 'tcversion_id' => (isset($row['parent_id']) ? $row['parent_id'] : - 1), + 'node_type_id' => $row['node_type_id'], + 'node_order' => $row['node_order'], + 'node_table' => $node_table, + 'name' => $row['name'] + ); + break; + } + // Basically we use this because: + // 1. Sometimes we don't want the children if the parent is a testcase, + // due to the version management + // + // 2. Sometime we want to exclude all descendants (branch) of a node. + // + // [franciscom]: + // I think ( but I have no figures to backup my thoughts) doing this check and + // avoiding the function call is better that passing a condition that will result + // in a null result set. + if (! isset( + $my['filters']['exclude_children_of'][$this->node_types[$row['node_type_id']]]) && + ! isset($my['filters']['exclude_branches'][$row['id']])) { + $this->_get_subtree($row['id'], $node_list, $filters, + $options); + } + } + } + } + + /** + */ + public function getSubtreeRec($node_id, &$pnode, $filters = null, + $options = null) + { + static $tcNodeTypeID; + static $qnum; + static $my; + static $platform_filter; + static $fclause; + static $exclude_branches; + static $exclude_children_of; + + if (! $tcNodeTypeID) { + $tcNodeTypeID = $this->node_descr_id['testcase']; + + $qnum = 0; + + $my['filters'] = array( + 'exclude_children_of' => null, + 'exclude_branches' => null, + 'additionalWhereClause' => '', + 'family' => null + ); + + $my['options'] = array( + 'order_cfg' => array( + "type" => 'spec_order' + ), + 'key_type' => 'std', + 'remove_empty_nodes_of_type' => null + ); + + // Cast to array to handle $options = null + $my['filters'] = array_merge($my['filters'], (array) $filters); + $my['options'] = array_merge($my['options'], (array) $options); + + $platform_filter = ""; + if (isset($my['options']['order_cfg']['platform_id']) && + ($safe_pid = intval($my['options']['order_cfg']['platform_id'])) > + 0) { + $platform_filter = " /* Platform filter */ " . + " AND T.platform_id = " . $safe_pid; + } + + $fclause = " AND node_type_id <> {$tcNodeTypeID} {$my['filters']['additionalWhereClause']} "; + + // this way I can manage code or description + if (! is_null($my['options']['remove_empty_nodes_of_type']) && + ! is_numeric($my['options']['remove_empty_nodes_of_type'])) { + $my['options']['remove_empty_nodes_of_type'] = $this->node_descr_id[$my['options']['remove_empty_nodes_of_type']]; + } + + $exclude_branches = $my['filters']['exclude_branches']; + $exclude_children_of = $my['filters']['exclude_children_of']; + } + + switch ($my['options']['order_cfg']['type']) { + case 'spec_order': + $sql = " SELECT id,name,parent_id,node_type_id,node_order FROM {$this->object_table} " . + " WHERE parent_id = {$node_id} {$my['filters']['additionalWhereClause']}" . + " ORDER BY node_order,id"; + break; + + case 'exec_order': + // Hmmm, no action regarding platforms. is OK ?? + // + // REMEMBER THAT DISTINCT IS NOT NEEDED when you does UNION + // + // Important Notice: + // Second part of UNION, allows to get from nodes hierarchy, + // only test cases that has a version linked to test plan. + // + $sql = "SELECT * FROM ( SELECT NH.node_order AS spec_order," . + " NH.node_order AS node_order, NH.id, NH.parent_id," . + " NH.name, NH.node_type_id, 0 AS tcversion_id " . + " FROM {$this->tables['nodes_hierarchy']} NH" . + " WHERE parent_id = {$node_id} {$fclause} " . + " UNION" . + " SELECT NHA.node_order AS spec_order, " . + " T.node_order AS node_order, NHA.id, NHA.parent_id, " . + " NHA.name, NHA.node_type_id, T.tcversion_id " . + " FROM {$this->tables['nodes_hierarchy']} NHA, " . + " {$this->tables['nodes_hierarchy']} NHB," . + " {$this->tables['testplan_tcversions']} T" . + " WHERE NHA.id=NHB.parent_id " . + " AND NHA.node_type_id = {$tcNodeTypeID}" . + " AND NHB.id=T.tcversion_id " . + " AND NHA.parent_id = {$node_id} {$platform_filter} " . + " AND T.testplan_id = {$my['options']['order_cfg']['tplan_id']}) AC" . + " ORDER BY node_order,spec_order,id"; + break; + } + + $result = $this->db->exec_query($sql); + $qnum ++; + while ($row = $this->db->fetch_array($result)) { + if (! isset($exclude_branches[$row['id']])) { + switch ($my['options']['key_type']) { + case 'std': + $node = array( + 'parent_id' => $row['parent_id'], + 'id' => $row['id'], + 'name' => $row['name'], + 'childNodes' => null, + 'node_table' => $this->node_tables_by['id'][$row['node_type_id']], + 'node_type_id' => $row['node_type_id'], + 'node_order' => $row['node_order'] + ); + + if (isset($row['tcversion_id']) && + $row['tcversion_id'] > 0) { + $node['tcversion_id'] = $row['tcversion_id']; + } + break; + + case 'extjs': + $node = array( + 'text' => $row['name'], + 'id' => $row['id'], + 'parent_id' => $row['parent_id'], + 'node_type_id' => $row['node_type_id'], + 'position' => $row['node_order'], + 'childNodes' => null, + 'leaf' => false + ); + + switch ($this->node_types[$row['node_type_id']]) { + case 'testproject': + case 'testsuite': + $node['childNodes'] = null; + break; + + case 'testcase': + $node['leaf'] = true; + break; + } + break; + } + + // Basically we use this because: + // 1. Sometimes we don't want the children if the parent is a testcase, + // due to the version management + // + // 2. Sometime we want to exclude all descendants (branch) of a node. + // + // [franciscom]: + // I think ( but I have no figures to backup my thoughts) doing this check and + // avoiding the function call is better that passing a condition that will result + // in a null result set. + if (! isset( + $exclude_children_of[$this->node_types[$row['node_type_id']]]) && + ! isset($exclude_branches[$row['id']])) { + $this->getSubtreeRec($row['id'], $node, $my['filters'], + $my['options']); + } + + // Have added this logic, because when export test plan will be developed + // having a test spec tree where test suites that do not contribute to test plan + // are pruned/removed is very important, to avoid additional processing + $doRemove = is_null($node['childNodes']) && + $node['node_type_id'] == + $my['options']['remove_empty_nodes_of_type']; + + if (! $doRemove) { + $pnode['childNodes'][] = $node; + } + } + } + return $qnum; + } + + /** + * function: get_full_path_verbose + * when path can not be found instead of null, anyway a map will be returned, with key=itemID value=NULL + * + * @internal revisions + */ + public function get_full_path_verbose(&$items, $options = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; + $goto_root = null; + $path_to = null; + $all_nodes = array(); + $path_format = 'simple'; + $output_format = 'simple'; + + if (! is_null($options)) { + // not a good solution, but Quick & Dirty + $path_format = isset($options['path_format']) ? $options['path_format'] : $path_format; + if (! isset($options['path_format'])) { + $path_format = isset($options['include_starting_point']) ? 'points' : $path_format; + } + $output_format = isset($options['output_format']) ? $options['output_format'] : $output_format; + } + + // according to count($items) we will try to optimize, sorry for magic number + if (count((array) $items) > 200) { + $xitems = array_flip((array) $items); + $xsql = " SELECT parent_id,id " . + " FROM {$this->tables['nodes_hierarchy']} " . " WHERE id IN (" . + implode(',', array_keys($xitems)) . ")"; + + $xmen = $this->db->fetchRowsIntoMap($xsql, 'parent_id', + database::CUMULATIVE); + $all_nodes = array(); + foreach ($xmen as $parent_id => &$children) { + $paty = $this->get_path($parent_id, $goto_root, $path_format); + $paty[] = $parent_id; + + $all_nodes = array_merge($all_nodes, $paty); + foreach ($children as &$item) { + $path_to[$item['id']]['name'] = $stairway2heaven[$item['id']] = $paty; + $all_nodes[] = $item['id']; + } + } + unset($xmen); + } else { + foreach ((array) $items as $item_id) { + $stairway2heaven[$item_id] = $this->get_path($item_id, + $goto_root, $path_format); + $path_to[$item_id]['name'] = $stairway2heaven[$item_id]; + $all_nodes = array_merge($all_nodes, + (array) $path_to[$item_id]['name']); + } + } + + $status_ok = (! is_null($all_nodes) && ! empty($all_nodes)); + if ($status_ok) { + // get only different items, to get descriptions + $unique_nodes = implode(',', array_unique($all_nodes)); + + $sql = "/* $debugMsg */ " . + " SELECT id,name FROM {$this->tables['nodes_hierarchy']} WHERE id IN ({$unique_nodes})"; + $decode = $this->db->fetchRowsIntoMap($sql, 'id'); + + foreach ($path_to as $key => $elem) { + foreach ($elem['name'] as $idx => $node_id) { + $path_to[$key]['name'][$idx] = $decode[$node_id]['name']; + $path_to[$key]['node_id'][$idx] = $node_id; + } + } + unset($decode); + } else { + $path_to = null; + } + + if (! is_null($path_to)) { + switch ($output_format) { + case 'path_as_string': + case 'stairway2heaven': + $flat_path = null; + foreach ($path_to as $item_id => $pieces) { + // remove root node + unset($pieces['name'][0]); + $flat_path[$item_id] = implode('/', $pieces['name']); + } + if ($output_format == 'path_as_string') { + $path_to = $flat_path; + } else { + $path_to = null; + $path_to['flat'] = $flat_path; + $path_to['staircase'] = $stairway2heaven; + } + break; + + case 'id_name': + break; + + case 'simple': + default: + $keySet = array_keys($path_to); + foreach ($keySet as $key) { + $path_to[$key] = $path_to[$key]['name']; + } + break; + } + } + unset($stairway2heaven); + return $path_to; + } + + /** + * check if there is a sibbling node of same type that has same name + * + * @param + * string name: name to check + * @param + * int node_type_id: node types to check. + * @param + * int id: optional. exclude this node id from result set + * this is useful when you want to check for name + * existence during an update operation. + * Using id you get node parent, to get sibblings. + * If null parent_id argument must be present + * + * @param + * int parent_id: optional. Mandatory if id is null + * Used to get children nodes to check for + * name existence. + * + * @return array ret: ret['status']=1 if name exists + * 0 if name does not exist + * ret['msg']= localized message + * + */ + public function nodeNameExists($name, $node_type_id, $id = null, + $parent_id = null) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; + $ret['status'] = 0; + $ret['msg'] = ''; + if (is_null($id) && is_null($parent_id)) { + $msg = $debugMsg . + 'Error on call $id and $parent_id can not be both null'; + throw new Exception($msg); + } + + $additionalFilters = ''; + $parentNodeID = intval($parent_id); + if (! is_null($id)) { + // Try to get parent id if not provided on method call. + if (is_null($parentNodeID) || $parentNodeID <= 0) { + $sql = "/* {$debugMsg} */ " . + " SELECT parent_id FROM {$this->object_table} NHA " . + " WHERE NHA.id = " . $this->db->prepare_int($id); + $rs = $this->db->get_recordset($sql); + $parentNodeID = intval($rs[0]['parent_id']); + } + $additionalFilters = " AND NHA.id <> " . $this->db->prepare_int($id); + } + + if ($parentNodeID <= 0) { + $msg = $debugMsg . ' FATAL Error $parentNodeID can not be <= 0'; + throw new Exception($msg); + } + + $sql = "/* {$debugMsg} */ " . + " SELECT count(0) AS qty FROM {$this->object_table} NHA " . + " WHERE NHA.node_type_id = {$node_type_id} " . " AND NHA.name = '" . + $this->db->prepare_string($name) . "'" . " AND NHA.parent_id = " . + $this->db->prepare_int($parentNodeID) . " {$additionalFilters} "; + + $rs = $this->db->get_recordset($sql); + if ($rs[0]['qty'] > 0) { + $ret['status'] = 1; + $ret['msg'] = sprintf(lang_get('name_already_exists'), $name); + } + + return $ret; + } + + /** + * getTreeRoot() + */ + public function getTreeRoot($node_id) + { + $path = (array) $this->get_path($node_id); + $path_len = count($path); + return ($path_len > 0) ? $path[0]['parent_id'] : $node_id; + } + + /** + * delete_subtree_objects() + * + * ATTENTION: subtree root node ($node_id?? or root_id?) IS NOT DELETED. + */ + public function delete_subtree_objects($root_id, $node_id, + $additionalWhereClause = '', $exclude_children_of = null, + $exclude_branches = null) + { + static $debugMsg; + if (is_null($debugMsg)) { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + } + + $sql = "/* $debugMsg */ SELECT NH.* FROM {$this->object_table} NH " . + " WHERE NH.parent_id = " . $this->db->prepare_int($node_id) . + " {$additionalWhereClause} "; + $rs = $this->db->get_recordset($sql); + if (! is_null($rs)) { + foreach ($rs as $row) { + $rowID = $row['id']; + $nodeTypeID = $row['node_type_id']; + $nodeType = $this->node_types[$nodeTypeID]; + $nodeClassName = $this->class_name[$nodeTypeID]; + if (! isset($exclude_branches[$rowID])) { + // Basically we use this because: + // 1. Sometimes we don't want the children if the parent is a testcase, + // due to the version management + // + // 2. Sometime we want to exclude all descendants (branch) of a node. + if (! isset($exclude_children_of[$nodeType]) && + ! isset($exclude_branches[$rowID])) { + // I'm paying not having commented this well + // Why I've set root_id to null ? + // doing this when traversing a tree, containers under level of subtree root + // will not be deleted => and this seems to be wrong. + $this->delete_subtree_objects($root_id, $rowID, + $additionalWhereClause, $exclude_children_of, + $exclude_branches); + } else { + // For us in this method context this node is a leaf => just delete + if (! is_null($nodeClassName)) { + $item_mgr = new $nodeClassName($this->db); + $item_mgr->delete($rowID); + } + } + } + } + } + + // Must delete myself if I'm empty, only if I'm not subtree root. + // Done this way to avoid infinte recursion for some type of nodes + // that use this method as it's delete method. (example testproject). + + // Hmmm, need to recheck if this condition is ok + if (! is_null($root_id) && ($node_id != $root_id)) { + $children = (array) $this->db->get_recordset($sql); + if (count($children) == 0) { + $sql2 = "/* $debugMsg */ SELECT NH.* FROM {$this->object_table} NH " . + " WHERE NH.id = " . $this->db->prepare_int($node_id); + $node_info = $this->db->get_recordset($sql2); + if (isset($this->class_name[$node_info[0]['node_type_id']])) { + $className = $this->class_name[$node_info[0]['node_type_id']]; + if (! is_null($className)) { + $item_mgr = new $className($this->db); + $item_mgr->delete($node_id); + } + } + } + } + } + + /* + * + * [$mode]: dotted -> $level number of dot characters are appended to + * the left of item name to create an indent effect. + * Level indicates on what tree layer item is positioned. + * Example: + * + * null + * \ + * id=1 <--- Tree Root = Level 0 + * | + * + ------+ + * / \ \ + * id=9 id=2 id=8 <----- Level 1 + * \ + * id=3 <----- Level 2 + * \ + * id=4 <----- Level 3 + * + * + * key: item id (= node id on tree). + * value: every array element is an string, containing item name. + * + * Result example: + * + * 2 .TS1 + * 3 ..TS2 + * 9 .20071014-16:22:07 TS1 + * 10 ..TS2 + * + * + * array -> key: item id (= node id on tree). + * value: every array element is a map with the following keys + * 'name', 'level' + * + * 2 array(name => 'TS1',level => 1) + * 3 array(name => 'TS2',level => 2) + * 9 array(name => '20071014-16:22:07 TS1',level =>1) + * 10 array(name => 'TS2', level => 2) + * + */ + public function createHierarchyMap($array2map, $mode = 'dotted', + $field2add = null) + { + $hmap = array(); + $the_level = 1; + $level = array(); + $pivot = $array2map[0]; + $addField = ! is_null($field2add); + $mode = is_null($mode) ? 'dotted' : $mode; + + foreach ($array2map as $elem) { + $current = $elem; + if ($pivot['id'] == $current['parent_id']) { + $the_level ++; + $level[$current['parent_id']] = $the_level; + } elseif ($pivot['parent_id'] != $current['parent_id']) { + $the_level = $level[$current['parent_id']]; + } + + switch ($mode) { + case 'dotted': + $hmap[$current['id']] = str_repeat('.', $the_level); + if ($addField) { + $hmap[$current['id']] .= sprintf($field2add['format'], + $current[$field2add['field']]); + } + $hmap[$current['id']] .= $current['name']; + break; + + case 'array': + $str = ($addField ? $current[$field2add] : '') . + $current['name']; + $hmap[$current['id']] = array( + 'name' => $str, + 'level' => $the_level + ); + break; + } + + // update pivot + $level[$current['parent_id']] = $the_level; + $pivot = $elem; + } + + return $hmap; + } + + /** + * getAllItemsID + * + * @internal revisions + * based on code from testproject->get_all_testcases_id + * + */ + public function getAllItemsID($parentList, &$itemSet, $coupleTypes) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method:' . __FUNCTION__ . ' :: '; + $sql = "/* $debugMsg */ " . + " SELECT id,node_type_id from {$this->tables['nodes_hierarchy']} " . + " WHERE parent_id IN ({$parentList})"; + $sql .= " AND node_type_id IN ({$coupleTypes['target']},{$coupleTypes['container']}) "; + + $result = $this->db->exec_query($sql); + if ($result) { + $containerSet = array(); + while ($row = $this->db->fetch_array($result)) { + if ($row['node_type_id'] == $coupleTypes['target']) { + $itemSet[] = $row['id']; + } else { + $containerSet[] = $row['id']; + } + } + if (count($containerSet)) { + $containerSet = implode(",", $containerSet); + $this->getAllItemsID($containerSet, $itemSet, $coupleTypes); + } + } + } + + /** + */ + public function getNodeByAttributes($attr) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + + $addJoin = ''; + $sql = "/* $debugMsg */ "; + $sql .= " SELECT NH_MAIN.id,NH_MAIN.parent_id,NH_MAIN.name,NH_MAIN.node_type_id " . + " FROM {$this->object_table} AS NH_MAIN " . + " JOIN {$this->tables['node_types']} AS NT ON NT.id = NH_MAIN.node_type_id "; + + $where = " WHERE 1=1 "; + foreach ($attr as $key => $value) { + switch ($key) { + case 'type': + $where .= " AND NT.description = '" . + $this->db->prepare_string($value) . "'"; + break; + + case 'id': + $where .= " AND NH_MAIN.is = " . + $this->db->prepare_int($value); + break; + + case 'name': + $where .= " AND NH_MAIN.name = '" . + $this->db->prepare_string($value) . "'"; + break; + + case 'parent_id': + $where .= " AND NH_MAIN.parent_id = " . + $this->db->prepare_int($value); + $addJoin = " JOIN {$this->object_table} AS NH_PARENT ON NH_PARENT.id = NH_MAIN.parent_id "; + break; + } + } + + $sql .= $addJoin . $where; + return $this->db->fetchRowsIntoMap($sql, 'id'); + } + + /** + */ + private function getNodeType($id) + { + $sql = " SELECT node_type_id, NT.description AS node_type FROM {$this->tables['nodes_hierarchy']} NH - JOIN {$this->tables['node_types']} NT - ON NT.id = NH.node_type_id - WHERE NH.id = " . intval($id); - $rs = $this->db->get_recordset($sql); - - return null != $rs ? current($rs) : null; - } - - /** - * - */ - function getNameL2($node_id,$opt=null) - { - $options = array('l2CutFirst' => 0); - - $options = array_merge($options,(array)$opt); - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - - $concat = " CONCAT(NHL1.name,':',NHL2.name) "; - if ($options['l2CutFirst'] > 0) { - $where2cut = $options['l2CutFirst']; - $concat = " CONCAT(NHL1.name,':'," . - " SUBSTRING(NHL2.name,{$where2cut}) )"; - } - $sql = "SELECT $concat AS name + JOIN {$this->tables['node_types']} NT + ON NT.id = NH.node_type_id + WHERE NH.id = " . intval($id); + $rs = $this->db->get_recordset($sql); + + return null != $rs ? current($rs) : null; + } + + /** + */ + public function getNameL2($node_id, $opt = null) + { + $options = array( + 'l2CutFirst' => 0 + ); + + $options = array_merge($options, (array) $opt); + + $concat = " CONCAT(NHL1.name,':',NHL2.name) "; + if ($options['l2CutFirst'] > 0) { + $where2cut = $options['l2CutFirst']; + $concat = " CONCAT(NHL1.name,':'," . + " SUBSTRING(NHL2.name,{$where2cut}) )"; + } + $sql = "SELECT $concat AS name FROM {$this->tables['nodes_hierarchy']} NHL2 JOIN {$this->tables['nodes_hierarchy']} NHL1 ON NHL1.id = NHL2.parent_id - WHERE NHL2.id = " . intval($node_id); - $rs = $this->db->get_recordset($sql); - $result = !is_null($rs) ? $rs[0]['name'] : ''; - return $result; - } -}// end class \ No newline at end of file + WHERE NHL2.id = " . intval($node_id); + $rs = $this->db->get_recordset($sql); + return ! is_null($rs) ? $rs[0]['name'] : ''; + } +} diff --git a/lib/functions/treeMenu.inc.php b/lib/functions/treeMenu.inc.php index e7f818c43e..9909d1a947 100644 --- a/lib/functions/treeMenu.inc.php +++ b/lib/functions/treeMenu.inc.php @@ -1,2749 +1,2734 @@ - viewType='testSpecTree' - * - * planAddTCNavigator.php => viewType=testSpecTreeForTestPlan - * - * --> tlTestCaseFilterControl->build_tree_menu() - WHEN FILTER ADDED - */ -function generateTestSpecTree(&$db,$tproject_id, $tproject_name,$linkto,$filters=null,$options=null) -{ - - $chronos[] = microtime(true); - - $tables = tlObjectWithDB::getDBTables(array('tcversions','nodes_hierarchy')); - - $my = array(); - $my['options'] = array('forPrinting' => 0, 'hideTestCases' => 0, - 'tc_action_enabled' => 1, - 'viewType' => 'testSpecTree', - 'ignore_inactive_testcases' => null, - 'ignore_active_testcases' => null); - - // testplan => - // only used if opetions['viewType'] == 'testSpecTreeForTestPlan' - // - // 20120205 - franciscom - hmm seems this code is INCOMPLETE - // may be we can remove ? - - // keys -> filter_* come from tlTestCaseFilterControl.class.php - $my['filters'] = [ - 'keywords' => null, - 'executionType' => null, - 'importance' => null, - 'testplan' => null, - 'filter_tc_id' => null, - 'filter_platforms' => null - ]; - - $my['options'] = array_merge($my['options'], (array)$options); - $my['options']['showTestCaseID'] = config_get('treemenu_show_testcase_id'); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - - // CRITIC: call with immediate return!!! - if( $my['options']['viewType'] == 'testSpecTree' ) { - - // Special processing for keywords - if ($filters['filter_keywords'] != null && - count($filters['filter_keywords']) == 1 && - $filters['filter_keywords'][0] == 0 - ) { - // Get all available keywords on test project and apply these set - // will be affected by mode ? - // TODOD - $tproject_mgr = new testproject($db); - $usedKeywordsByKeyID = $tproject_mgr->getUsedKeywordsMap($tproject_id); - $filters['filter_keywords'] = array_keys($usedKeywordsByKeyID); - } - - $rr = generateTestSpecTreeNew($db,$tproject_id,$tproject_name,$linkto,$filters,$options); - return $rr; - } - - - // --------------------------------------------------------------------------------- - // OK - Go ahead here we have other type of features - $treeMenu = new stdClass(); - $treeMenu->rootnode = null; - $treeMenu->menustring = ''; - - $resultsCfg = config_get('results'); - $glueChar = config_get('testcase_cfg')->glue_character; - $menustring = null; - - $tproject_mgr = new testproject($db); - $tree_manager = &$tproject_mgr->tree_manager; - - $hash_descr_id = $tree_manager->get_available_node_types(); - $hash_id_descr = array_flip($hash_descr_id); - $status_descr_code = $resultsCfg['status_code']; - $status_code_descr = $resultsCfg['code_status']; - - - // IMPORTANT NOTICE - // $filters['filter_toplevel_testsuite'] is managed in REVERSE form - // it contains NOT WHAT user wants, but all that we need to exclude - // in order provide what user WANTS. - // This is right way to go. - // - $exclude_branches = isset($filters['filter_toplevel_testsuite']) && - is_array($filters['filter_toplevel_testsuite']) ? - $filters['filter_toplevel_testsuite'] : null; - - $tcase_prefix = $tproject_mgr->getTestCasePrefix($tproject_id) . - $glueChar; - - $test_spec = getTestSpecTree($tproject_id,$tproject_mgr,$filters); - - // where the Keyword filter will be applied? - - // Added root node for test specification -> testproject - $test_spec['name'] = $tproject_name; - $test_spec['id'] = $tproject_id; - $test_spec['node_type_id'] = $hash_descr_id['testproject']; - - - $map_node_tccount=array(); - $tplan_tcs=null; - $tc2show = null; - - // MORE FILTERS - if($test_spec) { - $attr_map['keywords'] = null; // means no filter - if(!is_null($my['filters']['filter_keywords'])) { - - // if - $attr_map['keywords'] = - $tproject_mgr->getKeywordsLatestTCV($tproject_id, - $my['filters']['filter_keywords'], - $my['filters']['filter_keywords_filter_type']); - - if( is_null($attr_map['keywords']) ) { - // means that tree will be EMPTY - $attr_map['keywords'] = array(); - } - } - - $attr_map['platforms'] = null; // means no filter - if(!is_null($my['filters']['filter_platforms'])) { - $attr_map['platforms'] = - $tproject_mgr->getPlatformsLatestTCV($tproject_id, - $my['filters']['filter_platforms']); - - if( is_null($attr_map['platforms']) ) { - // means that tree will be EMPTY - $attr_map['platforms'] = array(); - } - } - - // Important: prepareNode() will make changes to - // $test_spec like filtering by test case - // keywords using $attr_map['keywords']; - $pnFilters = null; - $keys2init = array('filter_testcase_name', - 'filter_execution_type', - 'filter_priority', - 'filter_tc_id'); - foreach ($keys2init as $keyname) { - $pnFilters[$keyname] = isset($my['filters'][$keyname]) ? $my['filters'][$keyname] : null; - } - - $pnFilters['setting_testplan'] = $my['filters']['setting_testplan']; - if (isset($my['filters']['filter_custom_fields']) && isset($test_spec['childNodes'])) { - $test_spec['childNodes'] = filter_by_cf_values($db, - $test_spec['childNodes'], - $my['filters']['filter_custom_fields'],$hash_descr_id); - } - - // TICKET 4496: added inactive testcase filter - $pnOptions = array('hideTestCases' => $my['options']['hideTestCases'], - 'viewType' => $my['options']['viewType'], - 'ignoreInactiveTestCases' => - $my['options']['ignore_inactive_testcases'], - 'ignoreActiveTestCases' => - $my['options']['ignore_active_testcases']); - - $testcase_counters = prepareNode($db,$test_spec, - $map_node_tccount,$attr_map,$tplan_tcs,$pnFilters,$pnOptions); - - foreach($testcase_counters as $key => $value) { - $test_spec[$key] = $testcase_counters[$key]; - } - - $tc2show = renderTreeNode(1,$test_spec,$hash_id_descr, - $linkto,$tcase_prefix,$my['options']); - } - - $menustring =''; - $treeMenu->rootnode = new stdClass(); - $treeMenu->rootnode->name = $test_spec['text']; - $treeMenu->rootnode->id = $test_spec['id']; - $treeMenu->rootnode->leaf = isset($test_spec['leaf']) ? $test_spec['leaf'] : false; - $treeMenu->rootnode->text = $test_spec['text']; - $treeMenu->rootnode->position = $test_spec['position']; - $treeMenu->rootnode->href = $test_spec['href']; - - - // 20090328 - franciscom - BUGID 2299 - // More details about problem found on 20090308 and fixed IN WRONG WAY - // TPROJECT - // |______ TSA - // |__ TC1 - // |__ TC2 - // | - // |______ TSB - // |______ TSC - // - // Define Keyword K1,K2 - // - // NO TEST CASE HAS KEYWORD ASSIGNED - // Filter by K1 - // Tree will show root that spins Forever - // menustring before str_ireplace : [null,null] - // menustring AFTER [null] - // - // Now fixed. - // - // Some minor fix to do - // Il would be important exclude Top Level Test suites. - // - // - // 20090308 - franciscom - // Changed because found problem on: - // Test Specification tree when applying Keyword filter using a keyword NOT PRESENT - // in test cases => Tree root shows loading icon and spin never stops. - // - // Attention: do not know if in other situation this will generate a different bug - // - // Change key ('childNodes') to the one required by Ext JS tree. - if(isset($test_spec['childNodes'])) - { - $menustring = str_ireplace('childNodes', 'children', json_encode($test_spec['childNodes'])); - } - - if(!is_null($menustring)) - { - // Remove null elements (Ext JS tree do not like it ). - // :null happens on -> "children":null,"text" that must become "children":[],"text" - // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); - // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); - $menustring = str_ireplace(array(':' . REMOVEME, - ',"' . REMOVEME .'"', - '"' . REMOVEME . '",', - '"' . REMOVEME . '"'), - array(':[]','','',''), $menustring); - } - $treeMenu->menustring = $menustring; - - $tc2show = !is_null($tc2show) ? explode(",",trim($tc2show,",")) : null; - return array('menu' => $treeMenu, 'leaves' => $tc2show, 'tree' => $test_spec); -} - - -/** - * Prepares a Node to be displayed in a navigation tree. - * This function is used in the construction of: - * - Test project specification -> we want ALL test cases defined in test project. - * - Test execution -> we only want the test cases linked to a test plan. - * - * IMPORTANT: - * when analising a container node (Test Suite) if it is empty and we have requested - * some sort of filtering NODE WILL BE PRUNED. - * - * - * status: one of the possible execution status of a test case. - * - * - * tplan_tcases: map with testcase versions linked to test plan. - * due to the multiples uses of this function, null has several meanings - * - * When we want to build a Test Project specification tree, - * WE SET it to NULL, because we are not interested in a test plan. - * - * When we want to build a Test execution tree, we dont set it deliverately - * to null, but null can be the result of NO tcversion linked => EMPTY TEST PLAN - * - * - * status can be an array with multple values, to do OR search. - * added version info from test cases in return data structure. - * ignore_inactive_testcases: useful when building a Test Project Specification tree - * to be used in the add/link test case to Test Plan. - * - * attr_map['keywords']: Test Case Keyword map: - * null => no filter - * empty map => filter out ALL test case ALWAYS - * initialized map => filter out test case ONLY if NOT present in map. - * - * attr_map['platforms']: Test Case platforms map: - * null => no filter - * empty map => filter out ALL test case ALWAYS - * initialized map => filter out test case ONLY if NOT present in map. - * - * added argument: - * $map_node_tccount - * key => node_id - * values => node test case count - * node name (useful only for debug purpouses - * - * IMPORTANT: this new argument is not useful for tree rendering - * but to avoid duplicating logic to get test case count - * - * - * return: map with keys: - * 'total_count' - * 'passed' - * 'failed' - * 'blocked' - * 'not run' - * - * @internal revisions - */ -function prepareNode(&$db,&$node,&$map_node_tccount,$attr_map = null, - &$tplan_tcases = null,$filters=null, $options=null) -{ - static $status_descr_list; - static $debugMsg; - static $tables; - static $my; - static $enabledFiltersOn; - static $activeVersionClause; - static $filterOnTCVersionAttribute; - static $filtersApplied; - static $users2filter; - static $results2filter; - static $testPlanIsNotEmpty; - static $nodesTypeCode; - static $nodesCodeType; - - $tpNode = null; - if (!$tables) { - - $debugMsg = 'Class: ' . __CLASS__ . ' - ' . 'Method: ' . __FUNCTION__ . ' - '; - $tables = tlObjectWithDB::getDBTables(array('tcversions','nodes_hierarchy','node_types','testplan_tcversions')); - - $sql = " SELECT * FROM {$tables['node_types']} "; - $nodesTypeCode = $db->fetchColumnsIntoMap($sql,'description','id'); - $nodesCodeType = array_flip($nodesTypeCode); - - $resultsCfg = config_get('results'); - $status_descr_list = array_keys($resultsCfg['status_code']); - $status_descr_list[] = 'testcase_count'; - - $my = array(); - $my['options'] = array('hideTestCases' => 0, 'showTestCaseID' => 1, - 'viewType' => 'testSpecTree', - 'getExternalTestCaseID' => 1, - 'ignoreInactiveTestCases' => 0, - 'ignoreActiveTestCases' => 0, - 'setAssignedTo' => false); - - // added importance here because of "undefined" error in event log - $my['filters'] = array('status' => null, - 'assignedTo' => null, - 'importance' => null, 'executionType' => null, - 'filter_tc_id' => null, - 'filter_platforms' => null); - - $my['options'] = array_merge($my['options'], (array)$options); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $enabledFiltersOn['importance'] = isset($my['filters']['filter_priority']); - $enabledFiltersOn['testcase_id'] = isset($my['filters']['filter_tc_id']); - - $enabledFiltersOn['testcase_name'] = - isset($my['filters']['filter_testcase_name']); - $enabledFiltersOn['executionType'] = - isset($my['filters']['filter_execution_type']); - $enabledFiltersOn['custom_fields'] = - isset($my['filters']['filter_custom_fields']); - - - $enabledFiltersOn['keywords'] = - (null != $attr_map && isset($attr_map['keywords']) - && null != $attr_map['keywords'] - && count($attr_map['keywords']) > 0); - - $enabledFiltersOn['platforms'] = - (null != $attr_map - && isset($attr_map['platforms']) - && null != $attr_map['platforms'] - && count($attr_map['platforms']) > 0); - - - $filterOnTCVersionAttribute = $enabledFiltersOn['executionType'] || $enabledFiltersOn['importance']; - - $filtersApplied = false; - foreach($enabledFiltersOn as $filterValue) { - $filtersApplied = $filtersApplied || $filterValue; - } - - $activeVersionClause = $filterOnTCVersionAttribute ? " AND TCV.active=1 " : ''; - - $users2filter = isset($my['filters']['filter_assigned_user']) ? - $my['filters']['filter_assigned_user'] : null; - - $results2filter = isset($my['filters']['filter_result_result']) ? - $my['filters']['filter_result_result'] : null; - - - $testPlanIsNotEmpty = (!is_null($tplan_tcases) && count($tplan_tcases) > 0); - } - - $tcase_counters = array_fill_keys($status_descr_list, 0); - $nodeV = - $node_type = isset($node['node_type_id']) ? - $nodesCodeType[$node['node_type_id']] : null; - - if($node_type == 'testcase') { - // ABSOLUTELY First implicit filter to be applied when test plan is not empty. - // is our test case present on Test Spec linked to Test Plan ? - - if( $testPlanIsNotEmpty && !isset($tplan_tcases[$node['id']])) { - $node = null; - } - else if( - ($enabledFiltersOn['keywords'] && - !isset($attr_map['keywords'][$node['id']])) || - - ($enabledFiltersOn['platforms'] && - !isset($attr_map['platforms'][$node['id']])) || - - ($enabledFiltersOn['testcase_name'] && - stripos($node['name'], $my['filters']['filter_testcase_name']) === FALSE) || - ($enabledFiltersOn['testcase_id'] && ($node['id'] != $my['filters']['filter_tc_id'])) ) { - unset($tplan_tcases[$node['id']]); - $node = null; // OK - 20150129 - } - else { - if ($my['options']['viewType'] == 'executionTree') { - $tpNode = isset($tplan_tcases[$node['id']]) ? $tplan_tcases[$node['id']] : null; - if (!($delete_node=is_null($tpNode))) { - $delete_node = !is_null($results2filter) - && !isset($results2filter[$tpNode['exec_status']]); - - if (!$delete_node && !is_null($users2filter)) { - $somebody_wanted_but_nobody_there = - isset($users2filter[TL_USER_SOMEBODY]) - && !is_numeric($tpNode['user_id']); - - $unassigned_wanted_but_someone_assigned = - isset($users2filter[TL_USER_NOBODY]) - && !is_null($tpNode['user_id']); - - $wrong_user = !isset($users2filter[TL_USER_NOBODY]) - && !isset($users2filter[TL_USER_SOMEBODY]) - && !isset($users2filter[$tpNode['user_id']]); - - $delete_node = $unassigned_wanted_but_someone_assigned - || $wrong_user - || $somebody_wanted_but_nobody_there; - } - } - - if ($delete_node) { - unset($tplan_tcases[$node['id']]); - $node = null; - // $node = REMOVEME; - } else { - $externalID=''; - $node['tcversion_id'] = $tpNode['tcversion_id']; - $node['version'] = $tpNode['version']; - if ($my['options']['setAssignedTo']) { - $node['assigned_to'] = $tplan_tcases[$node['id']]['assigned_to']; - } - - if ($my['options']['getExternalTestCaseID']) { - if (!isset($tpNode['external_id'])) { - $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT TCV.tc_external_id AS external_id " . - " FROM {$tables['tcversions']} TCV " . - " WHERE TCV.id=" . $node['tcversion_id']; - - $result = $db->exec_query($sql); - $myrow = $db->fetch_array($result); - $externalID = $myrow['external_id']; - } else { - $externalID = $tpNode['external_id']; - } - } - $node['external_id'] = $externalID; - } - } - - if ($node != REMOVEME && $my['options']['ignoreInactiveTestCases']) - { - // there are active tcversions for this node ??? - // I'm doing this instead of creating a test case manager object, because - // I think is better for performance. - // - // ======================================================================================= - // 20070106 - franciscom - // Postgres Problems - // ======================================================================================= - // Problem 1 - SQL Syntax - // While testing with postgres - // SELECT count(TCV.id) NUM_ACTIVE_VERSIONS -> Error - // - // At least for what I remember using AS to create COLUMN ALIAS IS REQUIRED and Standard - // while AS is NOT REQUIRED (and with some DBMS causes errors) when you want to give a - // TABLE ALIAS - // - // Problem 2 - alias case - // At least in my installation the aliases column name is returned lower case, then - // PHP fails when: - // if($myrow['NUM_ACTIVE_VERSIONS'] == 0) - // - // - $sql=" /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT count(TCV.id) AS num_active_versions " . - " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . - " WHERE NH.parent_id=" . $node['id'] . - " AND NH.id = TCV.id AND TCV.active=1"; - - $result = $db->exec_query($sql); - $myrow = $db->fetch_array($result); - if($myrow['num_active_versions'] == 0) - { - $node = null; - //$node = REMOVEME; - } - } - - // TICKET 4496: added inactive testcase filter - if ($node !== REMOVEME && $my['options']['ignoreActiveTestCases']) - { - $sql=" /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT count(TCV.id) AS num_active_versions " . - " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . - " WHERE NH.parent_id=" . $node['id'] . - " AND NH.id = TCV.id AND TCV.active=1"; - - $result = $db->exec_query($sql); - $myrow = $db->fetch_array($result); - if($myrow['num_active_versions'] != 0) - { - $node = null; - //$node = REMOVEME; - } - } - } - // ------------------------------------------------------------------- - - // ------------------------------------------------------------------- - if (!is_null($node) && ($my['options']['viewType']=='testSpecTree' || - $my['options']['viewType'] =='testSpecTreeForTestPlan') ) - { - $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT COALESCE(MAX(TCV.id),0) AS targetid, TCV.tc_external_id AS external_id" . - " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . - " WHERE NH.id = TCV.id {$activeVersionClause} AND NH.parent_id={$node['id']} " . - " GROUP BY TCV.tc_external_id "; - - $rs = $db->get_recordset($sql); - if( is_null($rs) ) - { - $node = null; // OK 20150129 - } - else - { - $node['external_id'] = $rs[0]['external_id']; - $target_id = $rs[0]['targetid']; - - if( $filterOnTCVersionAttribute ) - { - switch ($my['options']['viewType']) - { - case 'testSpecTreeForTestPlan': - // Try to get info from linked tcversions - // Platform is not needed - $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT DISTINCT TPTCV.tcversion_id AS targetid " . - " FROM {$tables['tcversions']} TCV " . - " JOIN {$tables['nodes_hierarchy']} NH " . - " ON NH.id = TCV.id {$activeVersionClause} " . - " AND NH.parent_id={$node['id']} " . - " JOIN {$tables['testplan_tcversions']} TPTCV " . - " ON TPTCV.tcversion_id = TCV.id " . - " AND TPTCV.testplan_id = " . - " {$my['filters']['setting_testplan']}"; - $rs = $db->get_recordset($sql); - $target_id = !is_null($rs) ? $rs[0]['targetid'] : $target_id; - break; - } - - $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . - " SELECT TCV.execution_type " . - " FROM {$tables['tcversions']} TCV " . - " WHERE TCV.id = {$target_id} "; - - if( $enabledFiltersOn['executionType'] ) - { - $sql .= " AND TCV.execution_type = " . - " {$my['filters']['filter_execution_type']} "; - } - - if( $enabledFiltersOn['importance'] ) - { - $sql .= " AND TCV.importance = " . - " {$my['filters']['filter_priority']} "; - } - - $rs = $db->fetchRowsIntoMap($sql,'execution_type'); - if(is_null($rs)) - { - $node = null; // OK - 20150129 - } - } - } - - // if( !is_null($node) ) - if(!is_null($node) && $node != REMOVEME) - { - // needed to avoid problems when using json_encode with EXTJS - unset($node['childNodes']); - $node['leaf']=true; - } - } - // ------------------------------------------------------------------- - - // ======================================================================== - foreach($tcase_counters as $key => $value) - { - $tcase_counters[$key]=0; - } - - if(isset($tpNode['exec_status']) ) - { - $tc_status_descr = $decoding_info['status_code_descr'][$tpNode['exec_status']]; - } - else - { - $tc_status_descr = "not_run"; - } - - $init_value = $node ? 1 : 0; - $tcase_counters[$tc_status_descr] = $init_value; - $tcase_counters['testcase_count'] = $init_value; - if ( $my['options']['hideTestCases'] ) - { - $node = REMOVEME; - } - // ======================================================================== - } // if($node_type == 'testcase') - - - // ======================================================================== - if (isset($node['childNodes']) && is_array($node['childNodes'])) - { - // node has to be a Test Suite ? - $childNodes = &$node['childNodes']; - $childNodesQty = count($childNodes); - - for($idx = 0;$idx < $childNodesQty ;$idx++) - { - $current = &$childNodes[$idx]; - // I use set an element to null to filter out leaf menu items - if(is_null($current) || $current == REMOVEME) - { - $childNodes[$idx] = REMOVEME; - continue; - } - $counters_map = prepareNode($db,$current,$map_node_tccount, - $attr_map,$tplan_tcases,$my['filters'],$my['options']); - foreach($counters_map as $key => $value) - { - $tcase_counters[$key] += $counters_map[$key]; - } - } - foreach($tcase_counters as $key => $value) - { - $node[$key] = $tcase_counters[$key]; - } - - if (isset($node['id'])) - { - $map_node_tccount[$node['id']] = array( 'testcount' => $node['testcase_count'], - 'name' => $node['name']); - } - - // node must be destroyed if empty had we have using filtering conditions - if( ($filtersApplied || !is_null($tplan_tcases)) && - !$tcase_counters['testcase_count'] && ($node_type != 'testproject')) - { - $node = REMOVEME; // OK 20150129 - } - } - else if ($node_type == 'testsuite') - { - // does this means is an empty test suite ??? - franciscom 20080328 - $map_node_tccount[$node['id']] = array( 'testcount' => 0,'name' => $node['name']); - - // If is an EMPTY Test suite and we have added filtering conditions, - // We will destroy it. - if ($filtersApplied || !is_null($tplan_tcases) ) - { - $node = REMOVEME; // OK - 20150129 - } - } - - return $tcase_counters; -} - - -/** - * Create the string representation suitable to create a graphic visualization - * of a node, for the type of menu selected. - * - * Used when LAZY Rendering can not be used. - * - * @internal revisions - */ -function renderTreeNode($level,&$node,$hash_id_descr,$linkto,$testCasePrefix,$opt) -{ - - static $f2call; - static $forbidden_parents; - - $testCasesIDList=''; - - // ------------------------------------------------------------------------------- - // Choice for PERFORMANCE: - // Some pieces of code on TL < 1.9.4 has been wrapped in a function, but when working - // with BIG amount of testcases (> 5000) impact on performance was high. - if(!$f2call) - { - $f2call['testproject'] = 'EP'; - $f2call['testsuite'] = 'ETS'; - if( isset($opt['forPrinting']) && $opt['forPrinting'] ) - { - $f2call['testproject'] = 'TPROJECT_PTP'; - $f2call['testsuite'] = 'TPROJECT_PTS'; - } - - $f2call['testcase'] = $opt['tc_action_enabled'] ? 'ET' : 'void'; - - // Design allow JUST ONE forbidden, probably other measures - // like a leaf (test case) can not have other leaf as parent - // are already in place (need to check code better) - // - // IMPORTANT NOTICE: - // @20130407 - // this extended attribute need to be setted also on - // logic used when lazy tree build is used - // (gettprojectnodes.php) - // In addition tree config option useBeforeMoveNode must be set to true - $forbidden_parents['testproject'] = 'none'; - $forbidden_parents['testcase'] = 'testproject'; - $forbidden_parents['testsuite'] = 'testcase'; - } - - if( !isset($node['name']) ) - { - return $testCasesIDList; - } - - // custom Property that will be accessed by EXT-JS using node.attributes - // strip potential newlines and other unwanted chars from strings - // Mainly for stripping out newlines, carriage returns, and quotes that were - // causing problems in javascript using jtree - $node['testlink_node_name'] = str_replace(array("\n","\r"), array("",""), $node['name']); - $node['testlink_node_name'] = htmlspecialchars($node['testlink_node_name'], ENT_QUOTES); - - $node['testlink_node_type'] = $hash_id_descr[$node['node_type_id']]; - $node['forbidden_parent'] = $forbidden_parents[$node['testlink_node_type']]; - - $testcase_count = isset($node['testcase_count']) ? $node['testcase_count'] : 0; - $pfn = $f2call[$node['testlink_node_type']]; - - switch($node['testlink_node_type']) - { - case 'testproject': - case 'testsuite': - $node['text'] = $node['testlink_node_name'] . " (" . $testcase_count . ")"; - if(isset($opt['nodeHelpText'][$node['testlink_node_type']])) - { - $node['text'] = '' . - $node['text'] . ''; - } - break; - - case 'testcase': - $node['text'] = ""; - if($opt['showTestCaseID']) - { - $node['text'] .= "{$testCasePrefix}{$node['external_id']}:"; - } - $node['text'] .= $node['testlink_node_name']; - $testCasesIDList .= $node['id'] . ','; - break; - } // switch - - $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; - $node['href'] = "javascript:{$pfn}({$node['id']})"; - // ------------------------------------------------------------------------------- - - if (isset($node['childNodes']) && $node['childNodes']) - { - // need to work always original object - // in order to change it's values using reference . - // Can not assign anymore to intermediate variables. - // - $nChildren = sizeof($node['childNodes']); - for($idx = 0;$idx < $nChildren;$idx++) - { - // asimon - replaced is_null by !isset because of warnings in event log - if(!isset($node['childNodes'][$idx])) - { - continue; - } - $testCasesIDList .= renderTreeNode($level+1,$node['childNodes'][$idx],$hash_id_descr, - $linkto,$testCasePrefix,$opt); - } - } - - return $testCasesIDList; -} - - - -/** - * - * - * @param integer $level - * @param array &$node reference to recursive map - * @param array &$tcases_map reference to map that contains info about testcase exec status - * when node is of testcase type. - * - * @return datatype description - * @used-by execTreeMenu.inc.php - * - */ -function renderExecTreeNode($level,&$node,&$tcase_node,$hash_id_descr,$linkto,$testCasePrefix,$opt) -{ - static $resultsCfg; - static $l18n; - static $pf; - static $doColouringOn; - static $cssClasses; - - $node_type = $hash_id_descr[$node['node_type_id']]; - - if(!$resultsCfg) - { - $doColouringOn['testcase'] = 1; - $doColouringOn['counters'] = 1; - if( !is_null($opt['useColors']) ) - { - $doColouringOn['testcase'] = $opt['useColors']->testcases; - $doColouringOn['counters'] = $opt['useColors']->counters; - } - - $resultsCfg = config_get('results'); - $status_descr_code = $resultsCfg['status_code']; - - - foreach($resultsCfg['status_label'] as $key => $value) - { - $l18n[$status_descr_code[$key]] = lang_get($value); - - // here we use ONLY key - $cssClasses[$status_descr_code[$key]] = $doColouringOn['testcase'] ? ('class="light_' . $key . '"') : ''; - } - - // Very BAD CHOICE => SIDE EFFECT - $pf['testsuite'] = $opt['hideTestCases'] ? 'TPLAN_PTS' : ($opt['showTestSuiteContents'] ? 'STS' : null); - $pf['testproject'] = $opt['hideTestCases'] ? 'TPLAN_PTP' : 'SP'; - - if( isset($opt['actionJS']) ) { - $k2l = array('testproject','testsuite','testcase','testplan','default'); - foreach($k2l as $kiki) { - if( isset($opt['actionJS'][$kiki]) ){ - $pf[$kiki] = null; - if( '' != $opt['actionJS'][$kiki] ) { - $pf[$kiki] = $opt['actionJS'][$kiki]; - } - } - } - } - - // manage defaults - $opt['showTestCaseExecStatus'] = isset($opt['showTestCaseExecStatus']) ? $opt['showTestCaseExecStatus'] : true; - $opt['nodeHelpText'] = isset($opt['nodeHelpText']) ? $opt['nodeHelpText'] : array(); - } - - $name = htmlspecialchars($node['name'], ENT_QUOTES); - - - // custom Property that will be accessed by EXT-JS using node.attributes - $node['testlink_node_name'] = $name; - $node['testlink_node_type'] = $node_type; - - switch($node_type) { - case 'testproject': - case 'testsuite': - $node['leaf'] = false; - - $testcase_count = isset($node['testcase_count']) ? $node['testcase_count'] : 0; - $node['text'] = $name ." (" . $testcase_count . ")"; - if($opt['useCounters']) - { - $node['text'] .= create_counters_info($node,$doColouringOn['counters']); - } - - if( isset($opt['nodeHelpText'][$node_type]) ) - { - $node['text'] = '' . $node['text'] . ''; - } - - $pfn = !is_null($pf[$node_type]) ? $pf[$node_type] . "({$node['id']})" : null; - if( 'testsuite' == $node_type && ($opt['alertOnTestSuiteTCQty'] >0) ) { - if( $testcase_count > $opt['alertOnTestSuiteTCQty'] ) { - $jfn = config_get('jsAlertOnTestSuiteTCQty'); - $pfn = $jfn; - } - } - - - break; - - case 'testcase': - $node['leaf'] = true; - $pfn = null; - if($opt['tc_action_enabled']) { - $pfx = "ST"; - if(isset($pf[$node_type])) { - $pfx = "$pf[$node_type]"; - } - $pfn = $pfx . "({$node['id']},{$node['tcversion_id']})"; - } - - $node['text'] = "'; - } - } - - - if($opt['showTestCaseID']) - { - // optimizable - $node['text'] .= "" . htmlspecialchars($testCasePrefix . $node['external_id']) . ":"; - } - $node['text'] .= "{$name}"; - break; - - case 'testplan': - $pfn = "ST({$node['id']})"; - if( isset($pf[$node_type]) ){ - $pfn = null; - if( '' != $pf[$node_type] ) { - $pfn = $pf[$node_type] . "({$node['id']})"; - } - } - break; - - default: - $pfn = "ST({$node['id']})"; - if( isset($pf['default']) ){ - $pfn = null; - if( '' != $pf['default'] ) { - $pfn = $pf['default'] . "({$node['id']})"; - } - } - break; - } - - $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; - $node['href'] = is_null($pfn)? '' : "javascript:{$pfn}"; - - // ---------------------------------------------------------------------------------------------- - if( isset($tcase_node[$node['id']]) ) - { - unset($tcase_node[$node['id']]); // dam it NO COMMENT! - } - - if (isset($node['childNodes']) && $node['childNodes']) - { - // need to work always original object in order to change it's values using reference . - // Can not assign anymore to intermediate variables. - $nodes_qty = sizeof($node['childNodes']); - for($idx = 0;$idx <$nodes_qty ;$idx++) - { - if(is_null($node['childNodes'][$idx]) || $node['childNodes'][$idx]==REMOVEME) - { - continue; - } - renderExecTreeNode($level+1,$node['childNodes'][$idx],$tcase_node, - $hash_id_descr,$linkto,$testCasePrefix,$opt); - } - } - return; -} - - - -/** - * - * - * - */ -function create_counters_info(&$node,$useColors) -{ - static $keys2display; - static $labelCache; - - if(!$labelCache) - { - $resultsCfg = config_get('results'); - $status_label = $resultsCfg['status_label']; - - // I will add not_run if not exists - $keys2display = array('not_run' => 'not_run'); - foreach( $resultsCfg['status_label_for_exec_ui'] as $key => $value) - { - if( $key != 'not_run') - { - $keys2display[$key]=$key; - } - $labelCache[$key] = lang_get($status_label[$key]); - } - } - - $add_html=''; - foreach($keys2display as $key) - { - if( isset($node[$key]) ) - { - $css_class = $useColors ? (" class=\"light_{$key}\" ") : ''; - $add_html .= "' . $node[$key] . ","; - } - } - - $add_html = "(" . rtrim($add_html,",") . ")"; - return $add_html; -} - - - - -/** - * Filter out the testcases that don't have the given value - * in their custom field(s) from the tree. - * Recursive function. - * - * @author Andreas Simon - * @since 1.9 - * - * @param resource &$db reference to DB handler object - * @param array &$tcase_tree reference to test case set/tree to filter - * @param array &$cf_hash reference to selected custom field information - * @param int $node_types IDs of node types - * - * @return array $tcase_tree filtered tree structure - * - * @internal revisions - */ -function filter_by_cf_values(&$db, &$tcase_tree, &$cf_hash, $node_types) -{ - static $tables = null; - static $debugMsg = null; - - $rows = null; - if (!$debugMsg) - { - $tables = tlObject::getDBTables(array('cfield_design_values','nodes_hierarchy','tcversions')); - $debugMsg = 'Function: ' . __FUNCTION__; - } - - $node_deleted = false; - - // This code is in parts based on (NOT simply copy/pasted) - // some filter code used in testplan class. - // Implemented because we have a tree here, - // not simple one-dimensional array of testcases like in tplan class. - - foreach ($tcase_tree as $key => $node) - { - // TICKET 5186: Filtering by the value of custom fields on test specification is not working - if ($node['node_type_id'] == $node_types['testsuite']) - { - $delete_suite = false; - - if (isset($node['childNodes']) && is_array($node['childNodes'])) - { - // node is a suite and has children, so recurse one level deeper - $tcase_tree[$key]['childNodes'] = filter_by_cf_values($db,$tcase_tree[$key]['childNodes'], - $cf_hash,$node_types); - - // now remove testsuite node if it is empty after coming back from recursion - if (!count($tcase_tree[$key]['childNodes'])) - { - $delete_suite = true; - } - } - else - { - // nothing in here, suite was already empty - $delete_suite = true; - } - - if ($delete_suite) - { - unset($tcase_tree[$key]); - $node_deleted = true; - } - } - else if ($node['node_type_id'] == $node_types['testcase']) - { - // node is testcase, check if we need to delete it - $passed = false; - - // TICKET 5186: added "DISTINCT" to SQL clause, detailed explanation follows at the end of function - // Note: SQL statement has been adopted to filter by latest active tc version. - // That is a better solution for the explained problem than using the distinct keyword. - $latest_active_version_sql = " /* get latest active TC version ID */ " . - " SELECT MAX(TCVX.id) AS max_tcv_id, NHTCX.parent_id AS tc_id " . - " FROM {$tables['tcversions']} TCVX " . - " JOIN {$tables['nodes_hierarchy']} NHTCX " . - " ON NHTCX.id = TCVX.id AND TCVX.active = 1 " . - " WHERE NHTCX.parent_id = {$node['id']} " . - " GROUP BY NHTCX.parent_id, TCVX.tc_external_id "; - - $sql = " /* $debugMsg */ SELECT CFD.value " . - " FROM {$tables['cfield_design_values']} CFD, {$tables['nodes_hierarchy']} NH " . - " JOIN ( $latest_active_version_sql ) LAVSQL ON NH.id = LAVSQL.max_tcv_id " . - " WHERE CFD.node_id = NH.id "; - - // IMPORTANT DEV NOTES - // Query uses OR, but final processing makes that CF LOGIC work in AND MODE as expected - if (isset($cf_hash)) - { - $countmain = 1; - $cf_sql = ''; - foreach ($cf_hash as $cf_id => $cf_value) - { - if ( $countmain != 1 ) - { - $cf_sql .= " OR "; - } - - $safeID = intval($cf_id); - // single value or array? - if (is_array($cf_value)) - { - $count = 1; - foreach ($cf_value as $value) - { - if ($count > 1) - { - $cf_sql .= " AND "; - } - $safeValue = $db->prepare_string($value); - $cf_sql .= "( CFD.value LIKE '%{$safeValue}%' AND CFD.field_id = {$safeID} )"; - $count++; - } - } - else - { - $safeValue = $db->prepare_string($cf_value); - $cf_sql .= " ( CFD.value LIKE '%{$safeValue}%' AND CFD.field_id = {$safeID} ) "; - } - $countmain++; - } - $sql .= " AND ({$cf_sql}) "; - } - - $rows = (array)$db->fetchColumnsIntoArray($sql,'value'); - - //if there exist as many rows as custom fields to be filtered by - //the tc does meet the criteria - - /* NOTE by asimon: This assumption was wrong! If there are multiple versions of a TC, - * then the row number here can be larger than the number of custom fields with the correct value. - * - * Example: - * Custom field "color" has possible values "red", "blue", "green", default empty. - * Custom field "status" has possible values "draft", "ready", "needs review", "needs rework", default empty. - * TC Version 1: cfield "color" has value "red", cfield "status" has no value yet. - * TC Version 2: cfield "color" has value "red", cfield "status" has no value yet. - * TC Version 3: cfield "color" and value "red", cfield "status" has value "ready". - * TC Version 4: cfield "color" has value "red", cfield "status" has value "ready". - * - * Filter by color GREEN and status READY, then $rows looks like this: Array ( [0] => red, [1] => red ) - * => count($rows) returns 2, which matches the number of custom fields we want to filter by. - * So TC lands in the result set instead of being filtered out. - * That is wrong, because TC matches only one of the fields we were filtering by! - * - * Because of this I extended the SQL statement above with the DISTINCT keyword, - * so that each custom field only is contained ONCE in the result set. - */ - - $passed = (count($rows) == count($cf_hash)) ? true : false; - // now delete node if no match was found - if (!$passed) - { - unset($tcase_tree[$key]); - $node_deleted = true; - } - } - } - - // 20100702 - asimon - // if we deleted a note, the numeric indexes of this array do have missing numbers, - // which causes problems in later loop constructs in other functions that assume numeric keys - // in these arrays without missing numbers in between - crashes JS tree! - // -> so I have to fix the array indexes here starting from 0 without missing a key - if ($node_deleted) { - $tcase_tree = array_values($tcase_tree); - } - - return $tcase_tree; -} - - -/** - * - * @param object &$tplan_mgr reference to test plan manager object - * @param array &$tcase_set reference to test case set to filter - * @param integer $tplan_id ID of test plan - * @param array $filters filters to apply to test case set - * @return array new tcase_set - */ -function filterStatusSetAtLeastOneOfActiveBuilds(&$tplan_mgr,&$tcase_set,$tplan_id,$filters) -{ - $safe_platform = intval($filters->setting_platform); - $buildSet = array_keys($tplan_mgr->get_builds($tplan_id, testplan::ACTIVE_BUILDS)); - if( !is_null($buildSet) ) - { - if( $safe_platform > 0 ) - { - tLog(basename(__FILE__) . __FUNCTION__ . ':: $tplan_mgr->getHitsSameStatusPartialOnPlatform', 'DEBUG'); - $hits = $tplan_mgr->getHitsSameStatusPartialOnPlatform($tplan_id,$safe_platform, - (array)$filters->filter_result_result); - } - else - { - tLog(basename(__FILE__) . __FUNCTION__ . ':: $tplan_mgr->getHitsSameStatusPartialALOP', 'DEBUG'); - $hits = $tplan_mgr->getHitsSameStatusPartialALOP($tplan_id,(array)$filters->filter_result_result); - } - - if( is_null($hits) ) - { - $tcase_set = array(); - } - else - { - helper_filter_cleanup($tcase_set,$hits); - } - } - - return $tcase_set; -} - - -/** - * filterStatusSetAllActiveBuilds() - * - * returns: - * - * test cases that has AT LEAST ONE of requested status - * or combinations of requested status - * ON LAST EXECUTION ON ALL ACTIVE builds, for a PLATFORM - * - * For examples and more info read documentation regarding - * getHits*() methods on testplan class. - * - * - * @param object &$tplan_mgr reference to test plan manager object - * @param array &$tcase_set reference to test case set to filter - * WILL BE MODIFIED HERE - * - * @param integer $tplan_id ID of test plan - * @param array $filters filters to apply to test case set - * - * @return array new tcase_set - */ -function filterStatusSetAllActiveBuilds(&$tplan_mgr,&$tcase_set,$tplan_id,$filters) { - $buildSet = array_keys($tplan_mgr->get_builds($tplan_id, testplan::ACTIVE_BUILDS)); - if( !is_null($buildSet) ) { - - $safe_platform = intval($filters->setting_platform); - if( $safe_platform > 0 ) { - tLog(basename(__FILE__) . __FUNCTION__ . ':: $tplan_mgr->getHitsSameStatusFullOnPlatform', 'DEBUG'); - $hits = $tplan_mgr->getHitsSameStatusFullOnPlatform($tplan_id,$safe_platform, - (array)$filters->filter_result_result,$buildSet); - } else { - tLog(basename(__FILE__) .__FUNCTION__ . ':: $tplan_mgr->getHitsSameStatusFullALOP', 'DEBUG'); - - $hits = $tplan_mgr->getHitsSameStatusFullALOP($tplan_id, - (array)$filters->filter_result_result,$buildSet); - } - - if( is_null($hits) ) { - $tcase_set = array(); - } else { - helper_filter_cleanup($tcase_set,$hits); - unset($hits); - } - } - return $tcase_set; -} - -/** - * used by filter options: - * result on specific build - * result on current build - * - * - * @param object &$tplan_mgr reference to test plan manager object - * @param array &$tcase_set reference to test case set to filter - * @param integer $tplan_id ID of test plan - * @param array $filters filters to apply to test case set - * - * @return array new tcase_set - */ -function filter_by_status_for_build(&$tplan_mgr,&$tcase_set,$tplan_id,$filters) -{ - $safe_platform = intval($filters->setting_platform); - $safe_build = intval($filters->filter_result_build); - if( $safe_platform > 0) - { - tLog(__FUNCTION__ . ':: $tplan_mgr->getHitsStatusSetOnBuildPlatform', 'DEBUG'); - $hits = $tplan_mgr->getHitsStatusSetOnBuildPlatform($tplan_id,$safe_platform,$safe_build, - (array)$filters->filter_result_result); - } - else - { - tLog(__FUNCTION__ . ':: $tplan_mgr->getHitsStatusSetOnBuildALOP', 'DEBUG'); - $hits = $tplan_mgr->getHitsStatusSetOnBuildALOP($tplan_id,$safe_build, - (array)$filters->filter_result_result); - } - - if( is_null($hits) ) - { - $tcase_set = array(); - } - else - { - helper_filter_cleanup($tcase_set,$hits); - } - - return $tcase_set; -} - -/** - * filter testcases by the result of their latest execution - * - * CAN NOT BE USED FOR NOT RUN because Not run is not saved on DB - * - * @param object &$db reference to database handler - * @param object &$tplan_mgr reference to test plan manager object - * @param array &$tcase_set reference to test case set to filter - * @param integer $tplan_id ID of test plan - * @param array $filters filters to apply to test case set - * @return array new tcase_set - */ -function filter_by_status_for_latest_execution(&$tplan_mgr,&$tcase_set,$tplan_id,$filters) -{ - - $safe_tplan = intval($tplan_id); - $safe_platform = intval($filters->setting_platform); - - if($safe_platform > 0) - { - $hits = $tplan_mgr->getHitsStatusSetOnLatestExecOnPlatform($safe_tplan,$safe_platform, - (array)$filters->filter_result_result); - } - else - { - $hits = $tplan_mgr->getHitsStatusSetOnLatestExecALOP($safe_tplan,(array)$filters->filter_result_result); - } - - if( is_null($hits) ) - { - $tcase_set = array(); - } - else - { - helper_filter_cleanup($tcase_set,$hits); - } - - return $tcase_set; -} - - -/** - * - * @param object &$tplan_mgr reference to test plan manager object - * @param array &$tcase_set reference to test case set to filter - * @param integer $tplan_id ID of test plan - * @param array $filters filters to apply to test case set - * @return array new tcase_set - */ -function filter_not_run_for_any_build(&$tplan_mgr,&$tcase_set,$tplan_id,$filters) -{ - - $safe_platform = intval($filters->setting_platform); - if( $safe_platform > 0) - { - $hits = $tplan_mgr->getHitsNotRunPartialOnPlatform($tplan_id,intval($filters->setting_platform)); - } - else - { - $hits = $tplan_mgr->getHitsNotRunPartialALOP($tplan_id); - } - - if( is_null($hits) ) - { - $tcase_set = array(); - } - else - { - helper_filter_cleanup($tcase_set,$hits); - } - - return $tcase_set; -} - - -/** - * generate array with Keywords for a filter - * - */ -function buildKeywordsFilter($keywordsId,&$guiObj) -{ - $keywordsFilter = null; - - if(!is_null($keywordsId)) - { - $items = array_flip((array)$keywordsId); - if(!isset($items[0])) - { - $keywordsFilter = new stdClass(); - $keywordsFilter->items = $keywordsId; - $keywordsFilter->type = isset($guiObj->keywordsFilterTypes) ? $guiObj->keywordsFilterTypes->selected: 'OR'; - } - } - - return $keywordsFilter; -} - - -/** - * generate object with test case execution type for a filter - * - */ -function buildExecTypeFilter($execTypeSet) -{ - $itemsFilter = null; - - if(!is_null($execTypeSet)) - { - $items = array_flip((array)$execTypeSet); - if(!isset($items[0])) - { - $itemsFilter = new stdClass(); - $itemsFilter->items = $execTypeSet; - } - } - - return $itemsFilter; -} - -/** - * generate object with test case importance for a filter - * - */ -function buildImportanceFilter($importance) -{ - $itemsFilter = null; - - if(!is_null($importance)) - { - $items = array_flip((array)$importance); - if(!isset($items[0])) - { - $itemsFilter = new stdClass(); - $itemsFilter->items = $importance; - } - } - - return $itemsFilter; -} - -/** - * Generate the necessary data object for the filtered requirement specification tree. - * - * @author Andreas Simon - * @param Database $db reference to database handler object - * @param testproject $testproject_mgr reference to testproject manager object - * @param int $testproject_id ID of the project for which the tree shall be generated - * @param string $testproject_name Name of the test project - * @param array $filters Filter settings which shall be applied to the tree, possible values are: - * 'filter_doc_id', - * 'filter_title', - * 'filter_status', - * 'filter_type', - * 'filter_spec_type', - * 'filter_coverage', - * 'filter_relation', - * 'filter_tc_id', - * 'filter_custom_fields' - * @param array $options Further options which shall be applied on generating the tree - * @return stdClass $treeMenu object with which ExtJS can generate the graphical tree - */ -function generate_reqspec_tree(&$db, &$testproject_mgr, $testproject_id, $testproject_name, - $filters = null, $options = null) -{ - - $tables = tlObjectWithDB::getDBTables(array('requirements', 'req_versions', - 'req_specs', 'req_relations', - 'req_specs_revisions', - 'req_coverage', 'nodes_hierarchy')); - - $tree_manager = &$testproject_mgr->tree_manager; - - $glue_char = config_get('testcase_cfg')->glue_character; - $tcase_prefix=$testproject_mgr->getTestCasePrefix($testproject_id) . $glue_char; - - $req_node_type = $tree_manager->node_descr_id['testcase']; - $req_spec_node_type = $tree_manager->node_descr_id['testsuite']; - - $map_nodetype_id = $tree_manager->get_available_node_types(); - $map_id_nodetype = array_flip($map_nodetype_id); - - $my = array(); - - $my['options'] = array('for_printing' => 0,'exclude_branches' => null, - 'recursive' => true,'order_cfg' => array('type' => 'spec_order')); - - $my['filters'] = array('exclude_node_types' => array('testplan' => 'exclude me', - 'testsuite' => 'exclude me', - 'testcase' => 'exclude me', - 'requirement_spec_revision' => 'exclude me'), - 'exclude_children_of' => array('testcase' => 'exclude my children', - 'requirement' => 'exclude my children', - 'testsuite' => 'exclude my children'), - 'filter_doc_id' => null, 'filter_title' => null, - 'filter_status' => null, 'filter_type' => null, - 'filter_spec_type' => null, 'filter_coverage' => null, - 'filter_relation' => null, 'filter_tc_id' => null, - 'filter_custom_fields' => null); - - // merge with given parameters - $my['options'] = array_merge($my['options'], (array) $options); - $my['filters'] = array_merge($my['filters'], (array) $filters); - - $req_spec = $tree_manager->get_subtree($testproject_id, $my['filters'], $my['options']); - - $req_spec['name'] = $testproject_name; - $req_spec['id'] = $testproject_id; - $req_spec['node_type_id'] = $map_nodetype_id['testproject']; - - $filtered_map = get_filtered_req_map($db, $testproject_id, $testproject_mgr, - $my['filters'], $my['options']); - - $level = 1; - $req_spec = prepare_reqspec_treenode($db, $level, $req_spec, $filtered_map, $map_id_nodetype, - $map_nodetype_id, $my['filters'], $my['options']); - - $menustring = null; - $treeMenu = new stdClass(); - $treeMenu->rootnode = new stdClass(); - $treeMenu->rootnode->total_req_count = $req_spec['total_req_count']; - $treeMenu->rootnode->name = $req_spec['name']; - $treeMenu->rootnode->id = $req_spec['id']; - $treeMenu->rootnode->leaf = isset($req_spec['leaf']) ? $req_spec['leaf'] : false; - $treeMenu->rootnode->position = $req_spec['position']; - $treeMenu->rootnode->href = $req_spec['href']; - - // replace key ('childNodes') to 'children' - if (isset($req_spec['childNodes'])) - { - $menustring = str_ireplace('childNodes', 'children', json_encode($req_spec['childNodes'])); - } - - if (!is_null($menustring)) - { - $menustring = str_ireplace(array(',"' . REMOVEME .'"', '"' . REMOVEME . '",'), - array('',''), $menustring); - - $menustring = str_ireplace(array(':' . REMOVEME, '"' . REMOVEME .'"'), - array(':[]',''), $menustring); - } - $treeMenu->menustring = $menustring; - - return $treeMenu; -} - -/** - * Generate the necessary data object for the filtered requirement specification tree. - * - * @author Andreas Simon - * @param Database $db reference to database handler object - * @param testproject $testproject_mgr reference to testproject manager object - * @param int $testproject_id ID of the project for which the tree shall be generated - * @param string $testproject_name Name of the test project - * @param array $filters Filter settings which shall be applied to the tree, possible values are: - * 'filter_doc_id', - * 'filter_title', - * 'filter_status', - * 'filter_type', - * 'filter_spec_type', - * 'filter_coverage', - * 'filter_relation', - * 'filter_tc_id', - * 'filter_custom_fields' - * @param array $options Further options which shall be applied on generating the tree - * @return stdClass $treeMenu object with which ExtJS can generate the graphical tree - */ -function generateTestReqCoverageTree(&$db,$tproject_id, $tproject_name,$linkto,$filters=null,$options=null) -{ - - $tables = tlObjectWithDB::getDBTables(array('requirements', 'req_versions', - 'req_specs', 'req_relations', - 'req_specs_revisions', - 'req_coverage', 'nodes_hierarchy')); - - $tproject_mgr = new testproject($db); - $tree_manager = &$tproject_mgr->tree_manager; - - $glue_char = config_get('testcase_cfg')->glue_character; - $tcase_prefix=$tproject_mgr->getTestCasePrefix($tproject_id) . $glue_char; - - $req_node_type = $tree_manager->node_descr_id['testcase']; - $req_spec_node_type = $tree_manager->node_descr_id['testsuite']; - - $map_nodetype_id = $tree_manager->get_available_node_types(); - $map_id_nodetype = array_flip($map_nodetype_id); - - $my = array(); - - $my['options'] = array('for_printing' => 0, - 'exclude_branches' => null, - 'recursive' => true, - 'order_cfg' => array('type' => 'spec_order')); - - $my['filters'] = array('exclude_node_types' => array('testplan' => 'exclude me', - 'testsuite' => 'exclude me', - 'testcase' => 'exclude me', - 'requirement_spec_revision' => 'exclude me'), - 'exclude_children_of' => array('testcase' => 'exclude my children', - 'requirement' => 'exclude my children', - 'testsuite' => 'exclude my children'), - 'filter_doc_id' => null, - 'filter_title' => null, - 'filter_status' => null, - 'filter_type' => null, - 'filter_spec_type' => null, - 'filter_coverage' => null, - 'filter_relation' => null, - 'filter_tc_id' => null, - 'filter_custom_fields' => null); - - // merge with given parameters - $my['options'] = array_merge($my['options'], (array) $options); - $my['filters'] = array_merge($my['filters'], (array) $filters); - - $req_spec = $tree_manager->get_subtree($tproject_id, $my['filters'], $my['options']); - - $req_spec['name'] = $tproject_name; - $req_spec['id'] = $tproject_id; - $req_spec['node_type_id'] = $map_nodetype_id['testproject']; - - $filtered_map = get_filtered_req_map($db, $tproject_id, $tproject_mgr, - $my['filters'], $my['options']); - - $level = 1; - $req_spec = prepare_reqspeccoverage_treenode($db, $level, $req_spec, $filtered_map, $map_id_nodetype, - $map_nodetype_id, $my['filters'], $my['options']); - - $menustring = null; - $treeMenu = new stdClass(); - $treeMenu->rootnode = new stdClass(); - $treeMenu->rootnode->total_req_count = $req_spec['total_req_count']; - $treeMenu->rootnode->name = $req_spec['name']; - $treeMenu->rootnode->id = $req_spec['id']; - $treeMenu->rootnode->leaf = isset($req_spec['leaf']) ? $req_spec['leaf'] : false; - //$treeMenu->rootnode->text = $req_spec['name']; //not needed, accidentally duplicated - $treeMenu->rootnode->position = $req_spec['position']; - $treeMenu->rootnode->href = $req_spec['href']; - - // replace key ('childNodes') to 'children' - if (isset($req_spec['childNodes'])) - { - $menustring = str_ireplace('childNodes', 'children', - json_encode($req_spec['childNodes'])); - } - - if (!is_null($menustring)) - { - // delete null elements for Ext JS - $menustring = str_ireplace(array(':null',',null','null,','null'), - array(':[]','','',''), - $menustring); - } - $treeMenu->menustring = $menustring; - - return $treeMenu; -} - -/** - * Generate a filtered map with all fitting requirements in it. - * - * @author Andreas Simon - * @param Database $db reference to database handler object - * @param int $testproject_id ID of the project for which the tree shall be generated - * @param testproject $testproject_mgr reference to testproject manager object - * @param array $filters Filter settings which shall be applied to the tree - * @param array $options Further options which shall be applied on generating the tree - * @return array $filtered_map map with all fitting requirements - * - * @internal revisions - * @since 1.9.4 - * 20120827 - franciscom - TICKET 5178: Requirement Specification->"Req. Spec. Type" Filter-> KO - * - */ -function get_filtered_req_map(&$db, $testproject_id, &$testproject_mgr, $filters, $options) { - $filtered_map = null; - $tables = tlObjectWithDB::getDBTables(array('nodes_hierarchy', 'requirements', 'req_specs', - 'req_relations', 'req_versions', 'req_coverage', - 'tcversions', 'cfield_design_values','req_specs_revisions')); - - $sql = " SELECT R.id, R.req_doc_id, NH_R.name AS title, R.srs_id, " . - " RS.doc_id AS req_spec_doc_id, NH_RS.name AS req_spec_title, " . - " RV.version, RV.id AS version_id, NH_R.node_order, " . - " RV.expected_coverage, RV.status, RV.type, RV.active, RV.is_open " . - " FROM {$tables['requirements']} R " . - " JOIN {$tables['nodes_hierarchy']} NH_R ON NH_R.id = R.id " . - " JOIN {$tables['nodes_hierarchy']} NH_RV ON NH_RV.parent_id = NH_R.id " . - " JOIN {$tables['req_versions']} RV ON RV.id = NH_RV.id " . - " JOIN {$tables['req_specs']} RS ON RS.id = R.srs_id " . - " JOIN {$tables['req_specs_revisions']} RSPECREV ON RSPECREV.parent_id = RS.id " . - " JOIN {$tables['nodes_hierarchy']} NH_RS ON NH_RS.id = RS.id "; - - if (isset($filters['filter_relation'])) - { - $sql .= " JOIN {$tables['req_relations']} RR " . - " ON (RR.destination_id = R.id OR RR.source_id = R.id) "; - } - - if (isset($filters['filter_tc_id'])) - { - $tc_cfg = config_get('testcase_cfg'); - $tc_prefix = $testproject_mgr->getTestCasePrefix($testproject_id); - $tc_prefix .= $tc_cfg->glue_character; - - $tc_ext_id = $db->prepare_int(str_replace($tc_prefix, '', $filters['filter_tc_id'])); - - $sql .= " JOIN {$tables['req_coverage']} RC ON RC.req_id = R.id " . - " JOIN {$tables['nodes_hierarchy']} NH_T ON NH_T.id = RC.testcase_id " . - " JOIN {$tables['nodes_hierarchy']} NH_TV on NH_TV.parent_id = NH_T.id " . - " JOIN {$tables['tcversions']} TV ON TV.id = NH_TV.id " . - " AND TV.tc_external_id = {$tc_ext_id} "; - } - - if (isset($filters['filter_custom_fields'])) - { - $suffix = 1; - - foreach ($filters['filter_custom_fields'] as $cf_id => $cf_value) - { - $sql .= " JOIN {$tables['cfield_design_values']} CF{$suffix} " . - " ON CF{$suffix}.node_id = RV.id " . - " AND CF{$suffix}.field_id = {$cf_id} "; - - // single value or array? - if (is_array($cf_value)) - { - $sql .= " AND ( "; - $count = 1; - foreach ($cf_value as $value) - { - if ($count > 1) - { - $sql .= " OR "; - } - $sql .= " CF{$suffix}.value LIKE '%{$value}%' "; - $count++; - } - $sql .= " ) "; - } - else - { - $sql .= " AND CF{$suffix}.value LIKE '%{$cf_value}%' "; - } - - $suffix ++; - } - } - - $sql .= " WHERE RS.testproject_id = {$testproject_id} "; - - if (isset($filters['filter_doc_id'])) - { - $doc_id = $db->prepare_string($filters['filter_doc_id']); - $sql .= " AND R.req_doc_id LIKE '%{$doc_id}%' OR RS.doc_id LIKE '%{$doc_id}%' "; - } - - if (isset($filters['filter_title'])) - { - $title = $db->prepare_string($filters['filter_title']); - $sql .= " AND NH_R.name LIKE '%{$title}%' "; - } - - if (isset($filters['filter_coverage'])) - { - $coverage = $db->prepare_int($filters['filter_coverage']); - $sql .= " AND expected_coverage = {$coverage} "; - } - - if (isset($filters['filter_status'])) - { - $statuses = (array) $filters['filter_status']; - foreach ($statuses as $key => $status) - { - $statuses[$key] = "'" . $db->prepare_string($status) . "'"; - } - $statuses = implode(",", $statuses); - $sql .= " AND RV.status IN ({$statuses}) "; - } - - if (isset($filters['filter_type'])) - { - $types = (array) $filters['filter_type']; - - foreach ($types as $key => $type) - { - $types[$key] = $db->prepare_string($type); - } - $types = implode("','", $types); - $sql .= " AND RV.type IN ('{$types}') "; - } - - if (isset($filters['filter_spec_type'])) - { - $spec_types = (array) $filters['filter_spec_type']; - - foreach ($spec_types as $key => $type) - { - $spec_types[$key] = $db->prepare_string($type); - } - $spec_types = implode("','", $spec_types); - $sql .= " AND RSPECREV.type IN ('{$spec_types}') "; - } - - if (isset($filters['filter_relation'])) - { - $sql .= " AND ( "; - $count = 1; - foreach ($filters['filter_relation'] as $key => $rel_filter) - { - $relation_info = explode('_', $rel_filter); - $relation_type = $db->prepare_int($relation_info[0]); - $relation_side = isset($relation_info[1]) ? $relation_info[1] : null; - $sql .= ($count == 1) ? " ( " : " OR ( "; - - if ($relation_side == "destination") - { - $sql .= " RR.destination_id = R.id "; - } - else if ($relation_side == "source") - { - $sql .= " RR.source_id = R.id "; - } - else - { - $sql .= " (RR.destination_id = R.id OR RR.source_id = R.id) "; - } - - $sql .= " AND RR.relation_type = {$relation_type} ) "; - $count++; - } - - $sql .= " ) "; - } - - $sql .= " ORDER BY RV.version DESC "; - $filtered_map = $db->fetchRowsIntoMap($sql, 'id'); - return $filtered_map; -} - -/** - * Prepares nodes for the filtered requirement tree. - * Filters out those nodes which are not in the given map and counts the remaining subnodes. - * @author Andreas Simn - * @param Database $db reference to database handler object - * @param int $level gets increased by one for each sublevel in recursion - * @param array $node the tree structure to traverse - * @param array $filtered_map a map of filtered requirements, req that are not in this map will be deleted - * @param array $map_id_nodetype array with node type IDs as keys, node type descriptions as values - * @param array $map_nodetype_id array with node type descriptions as keys, node type IDs as values - * @param array $filters - * @param array $options - * @return array tree structure after filtering out unneeded nodes - */ -function prepare_reqspec_treenode(&$db, $level, &$node, &$filtered_map, &$map_id_nodetype, - &$map_nodetype_id, &$filters, &$options) -{ - $child_req_count = 0; - if (isset($node['childNodes']) && is_array($node['childNodes'])) - { - // node has childs, must be a specification (or testproject) - foreach ($node['childNodes'] as $key => $childnode) - { - $current_childnode = &$node['childNodes'][$key]; - $current_childnode = prepare_reqspec_treenode($db, $level + 1, $current_childnode, - $filtered_map, $map_id_nodetype, - $map_nodetype_id, - $filters, $options); - - // now count childnodes that have not been deleted and are requirements - if(!is_null($current_childnode) && $current_childnode != REMOVEME) - { - switch($current_childnode['node_type_id']) - { - case $map_nodetype_id['requirement']: - $child_req_count ++; - break; - - case $map_nodetype_id['requirement_spec']: - $child_req_count += $current_childnode['child_req_count']; - break; - } - } - } - } - - $node_type = $map_id_nodetype[$node['node_type_id']]; - - $delete_node = false; - switch ($node_type) - { - case 'testproject': - $node['total_req_count'] = $child_req_count; - break; - - case 'requirement_spec': - // add requirement count - // delete empty specs - $node['child_req_count'] = $child_req_count; - $delete_node = !$child_req_count; - break; - - case 'requirement': - // delete node from tree if it is not in $filtered_map - $delete_node = (is_null($filtered_map) || !array_key_exists($node['id'], $filtered_map)); - break; - } - - if ($delete_node) - { - unset($node); - $node = REMOVEME; - } - else - { - $node = render_reqspec_treenode($db, $node, $filtered_map, $map_id_nodetype); - } - - return $node; -} - -/** - * Prepares nodes for the filtered requirement tree. - * Filters out those nodes which are not in the given map and counts the remaining subnodes. - * @author Andreas Simn - * @param Database $db reference to database handler object - * @param int $level gets increased by one for each sublevel in recursion - * @param array $node the tree structure to traverse - * @param array $filtered_map a map of filtered requirements, req that are not in this map will be deleted - * @param array $map_id_nodetype array with node type IDs as keys, node type descriptions as values - * @param array $map_nodetype_id array with node type descriptions as keys, node type IDs as values - * @param array $filters - * @param array $options - * @return array tree structure after filtering out unneeded nodes - */ -function prepare_reqspeccoverage_treenode(&$db, $level, &$node, &$filtered_map, &$map_id_nodetype, - &$map_nodetype_id, &$filters, &$options) { - $child_req_count = 0; - - if (isset($node['childNodes']) && is_array($node['childNodes'])) { - // node has childs, must be a specification (or testproject) - foreach ($node['childNodes'] as $key => $childnode) { - $current_childnode = &$node['childNodes'][$key]; - $current_childnode = prepare_reqspeccoverage_treenode($db, $level + 1, $current_childnode, - $filtered_map, $map_id_nodetype, - $map_nodetype_id, - $filters, $options); - - // now count childnodes that have not been deleted and are requirements - if (!is_null($current_childnode)) { - switch ($current_childnode['node_type_id']) { - case $map_nodetype_id['requirement']: - $child_req_count ++; - break; - - case $map_nodetype_id['requirement_spec']: - $child_req_count += $current_childnode['child_req_count']; - break; - } - } - } - } - - $node_type = $map_id_nodetype[$node['node_type_id']]; - - $delete_node = false; - - switch ($node_type) { - case 'testproject': - $node['total_req_count'] = $child_req_count; - break; - - case 'requirement_spec': - // add requirement count - $node['child_req_count'] = $child_req_count; - // delete empty specs - if (!$child_req_count) { - $delete_node = true; - } - break; - - case 'requirement': - // delete node from tree if it is not in $filtered_map - if (is_null($filtered_map) || !array_key_exists($node['id'], $filtered_map)) { - $delete_node = true; - } - break; - } - - if ($delete_node) { - unset($node); - $node = null; - } else { - $node = render_reqspeccoverage_treenode($db, $node, $filtered_map, $map_id_nodetype); - } - - return $node; -} - -/** - * Prepares nodes in the filtered requirement tree for displaying with ExtJS. - * @author Andreas Simon - * @param Database $db reference to database handler object - * @param array $node the object to prepare - * @param array $filtered_map a map of filtered requirements, req that are not in this map will be deleted - * @param array $map_id_nodetype array with node type IDs as keys, node type descriptions as values - * @return array tree object with all needed data for ExtJS tree - */ -function render_reqspec_treenode(&$db, &$node, &$filtered_map, &$map_id_nodetype) { - static $js_functions; - static $forbidden_parents; - - if (!$js_functions) { - $js_functions = array('testproject' => 'TPROJECT_REQ_SPEC_MGMT', - 'requirement_spec' =>'REQ_SPEC_MGMT', - 'requirement' => 'REQ_MGMT'); - - $req_cfg = config_get('req_cfg'); - $forbidden_parents['testproject'] = 'none'; - $forbidden_parents['requirement'] = 'testproject'; - - // Hmm is ok ? (see next lines, may be it's time to remove this code) - $forbidden_parents['requirement_spec'] = 'requirement_spec'; - if($req_cfg->child_requirements_mgmt) - { - $forbidden_parents['requirement_spec'] = 'none'; - } - } - - $node_type = $map_id_nodetype[$node['node_type_id']]; - $node_id = $node['id']; - - $node['href'] = "javascript:{$js_functions[$node_type]}({$node_id});"; - $node['text'] = htmlspecialchars($node['name']); - $node['leaf'] = false; // will be set to true later for requirement nodes - $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; - $node['cls'] = 'folder'; - - // custom Properties that will be accessed by EXT-JS using node.attributes - $node['testlink_node_type'] = $node_type; - $node['forbidden_parent'] = $forbidden_parents[$node_type]; - $node['testlink_node_name'] = $node['text']; - - switch ($node_type) { - case 'testproject': - break; - - case 'requirement_spec': - // get doc id from filtered array, it's already stored in there - $doc_id = ''; - foreach($node['childNodes'] as $child) { - if ( is_array($child) ) { - $child_id = $child['id']; - if (isset($filtered_map[$child_id])) { - $doc_id = htmlspecialchars($filtered_map[$child_id]['req_spec_doc_id']); - } - break; // only need to get one child for this - } - } - // BUGID 3765: load doc ID with if this req spec has no direct req child nodes. - // Reason: in these cases we do not have a parent doc ID in $filtered_map - if ($doc_id == '') { - static $req_spec_mgr = null; - if (!$req_spec_mgr) { - $req_spec_mgr = new requirement_spec_mgr($db); - } - $tmp_spec = $req_spec_mgr->get_by_id($node_id); - $doc_id = $tmp_spec['doc_id']; - unset($tmp_spec); - } - - $count = $node['child_req_count']; - $node['text'] = "{$doc_id}:{$node['text']} ({$count})"; - break; - - case 'requirement': - $node['leaf'] = true; - $doc_id = htmlspecialchars($filtered_map[$node_id]['req_doc_id']); - $node['text'] = "{$doc_id}:{$node['text']}"; - break; - } - - return $node; -} - - - - -/** - * Prepares nodes in the filtered requirement tree for displaying with ExtJS. - * @author Andreas Simon - * @param Database $db reference to database handler object - * @param array $node the object to prepare - * @param array $filtered_map a map of filtered requirements, req that are not in this map will be deleted - * @param array $map_id_nodetype array with node type IDs as keys, node type descriptions as values - * @return array tree object with all needed data for ExtJS tree - */ -function render_reqspeccoverage_treenode(&$db, &$node, &$filtered_map, &$map_id_nodetype) { - static $js_functions; - static $forbidden_parents; - - if (!$js_functions) - { - $js_functions = array('testproject' => 'EP', - 'requirement_spec' =>'ERS', - 'requirement' => 'ER'); - - $req_cfg = config_get('req_cfg'); - $forbidden_parents['testproject'] = 'none'; - $forbidden_parents['requirement'] = 'testproject'; - - // Hmm is ok ? (see next lines, may be it's time to remove this code) - $forbidden_parents['requirement_spec'] = 'requirement_spec'; - if($req_cfg->child_requirements_mgmt) - { - $forbidden_parents['requirement_spec'] = 'none'; - } - } - - $node_type = $map_id_nodetype[$node['node_type_id']]; - $node_id = $node['id']; - - $node['href'] = "javascript:{$js_functions[$node_type]}({$node_id});"; - $node['text'] = htmlspecialchars($node['name']); - $node['leaf'] = false; // will be set to true later for requirement nodes - $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; - $node['cls'] = 'folder'; - - // custom Properties that will be accessed by EXT-JS using node.attributes - $node['testlink_node_type'] = $node_type; - $node['forbidden_parent'] = $forbidden_parents[$node_type]; - $node['testlink_node_name'] = $node['text']; - - switch ($node_type) { - case 'testproject': - break; - - case 'requirement_spec': - // get doc id from filtered array, it's already stored in there - $doc_id = ''; - foreach($node['childNodes'] as $child) { - if (!is_null($child)) { - $child_id = $child['id']; - if (isset($filtered_map[$child_id])) { - $doc_id = htmlspecialchars($filtered_map[$child_id]['req_spec_doc_id']); - } - break; // only need to get one child for this - } - } - // BUGID 3765: load doc ID with if this req spec has no direct req child nodes. - // Reason: in these cases we do not have a parent doc ID in $filtered_map - if ($doc_id == '') { - static $req_spec_mgr = null; - if (!$req_spec_mgr) { - $req_spec_mgr = new requirement_spec_mgr($db); - } - $tmp_spec = $req_spec_mgr->get_by_id($node_id); - $doc_id = $tmp_spec['doc_id']; - unset($tmp_spec); - } - - $count = $node['child_req_count']; - $node['text'] = "{$doc_id}:{$node['text']} ({$count})"; - break; - - case 'requirement': - $node['leaf'] = true; - $doc_id = htmlspecialchars($filtered_map[$node_id]['req_doc_id']); - $node['text'] = "{$doc_id}:{$node['text']}"; - break; - } - - return $node; -} - - -/** - * - * - */ -function apply_status_filters($tplan_id,&$items,&$fobj,&$tplan_mgr,$statusCfg) -{ - $fm = config_get('execution_filter_methods'); - $methods = $fm['status_code']; - - - $ffn = array($methods['any_build'] => 'filterStatusSetAtLeastOneOfActiveBuilds', - $methods['all_builds'] => 'filterStatusSetAllActiveBuilds', - $methods['specific_build'] => 'filter_by_status_for_build', - $methods['current_build'] => 'filter_by_status_for_build', - $methods['latest_execution'] => 'filter_by_status_for_latest_execution'); - - $f_method = isset($fobj->filter_result_method) ? $fobj->filter_result_method : null; - $f_result = isset($fobj->filter_result_result) ? $fobj->filter_result_result : null; - $f_result = (array)$f_result; - - // if "any" was selected as filtering status, don't filter by status - if (in_array($statusCfg['all'], $f_result)) - { - $f_result = null; - } - - if (!is_null($f_method) && isset($ffn[$f_method])) - { - // special case: - // filtering by "not run" status in any build - // filtering by "not run" status in specific - // - // we change filter function - if (in_array($statusCfg['not_run'], $f_result)) - { - $ffn[$methods['any_build']] = 'filter_not_run_for_any_build'; - $ffn[$methods['specific_build']] = 'filter_by_status_for_build'; - } - - // special case: when filtering by "current build", we set the build to filter with - // to the build chosen in settings instead of the one in filters - if ($f_method == $methods['current_build']) - { - $fobj->filter_result_build = $fobj->setting_build; - } - - $items = $ffn[$f_method]($tplan_mgr, $items, $tplan_id, $fobj); - } - return $items; -} - -/** - * - * - */ -function update_status_for_colors(&$dbHandler,&$items,$context,$statusCfg) -{ - $tables = tlObject::getDBTables(array('executions','nodes_hierarchy')); - $dummy = current($items); - $key2scan = array_keys($items); - $keySet = null; - foreach($key2scan as $fx) - { - $keySet[] = $items[$fx]['tcversion_id']; - } - - extract($context); // magic to create single variables - - $sql = " SELECT E.status, NH_TCV.parent_id AS tcase_id " . - " FROM {$tables['executions']} E " . - " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = E.tcversion_id " . - " JOIN " . - " ( SELECT MAX(E2.id) AS last_exec_id " . - " FROM {$tables['executions']} E2 " . - " WHERE testplan_id = {$tplanID} " . - " AND tcversion_id IN (" . implode(',', $keySet) . ") " . - " AND platform_id = {$dummy['platform_id']} " . - " AND build_id = {$buildID} " . - " GROUP BY testplan_id,tcversion_id,platform_id,build_id ) AS EY " . - " ON E.id = EY.last_exec_id "; - - $result = null; - $rs = $dbHandler->fetchRowsIntoMap($sql,'tcase_id'); - - if( !is_null($rs) ) - { - foreach($key2scan as $tcase_id) - { - $rr = isset($rs[$tcase_id]['status']) && !is_null($rs[$tcase_id]['status']) ? - $rs[$tcase_id]['status'] : $statusCfg['not_run']; - - if ($rr != $items[$tcase_id]['exec_status']) - { - $items[$tcase_id]['exec_status'] = $rr; - } - } - } - -} - - -/** - * Used when ['viewType'] == 'testSpecTree' - */ -function generateTestSpecTreeNew(&$db,$tproject_id, $tproject_name,$linkto,$filters=null,$options=null) -{ - $chronos[] = microtime(true); - $tables = tlObjectWithDB::getDBTables(array('tcversions','nodes_hierarchy')); - - $my = array(); - - $my['options'] = array('forPrinting' => 0, 'hideTestCases' => 0, - 'tc_action_enabled' => 1, - 'viewType' => 'testSpecTree'); - - - $my['filters'] = array('keywords' => null, - 'plaftorms' => null,'testplan' => null); - - $my['options'] = array_merge($my['options'], (array)$options); - $my['options']['showTestCaseID'] = config_get('treemenu_show_testcase_id'); - - $my['filters'] = array_merge($my['filters'], (array)$filters); - - - $treeMenu = new stdClass(); - $treeMenu->rootnode = null; - $treeMenu->menustring = ''; - - $resultsCfg = config_get('results'); - $glueChar = config_get('testcase_cfg')->glue_character; - $menustring = null; - - $tproject_mgr = new testproject($db); - $tree_manager = &$tproject_mgr->tree_manager; - - $hash_descr_id = $tree_manager->get_available_node_types(); - $hash_id_descr = array_flip($hash_descr_id); - $status_descr_code=$resultsCfg['status_code']; - $status_code_descr=$resultsCfg['code_status']; - - $tcase_prefix = $tproject_mgr->getTestCasePrefix($tproject_id) . $glueChar; - $test_spec = getTestSpecTree($tproject_id,$tproject_mgr,$filters); - - // Added root node for test specification -> testproject - $test_spec['name'] = $tproject_name; - $test_spec['id'] = $tproject_id; - $test_spec['node_type_id'] = $hash_descr_id['testproject']; - - $map_node_tccount=array(); - $tc2show = null; - - if($test_spec) { - if (isset($my['filters']['filter_custom_fields']) - && isset($test_spec['childNodes'])) { - $test_spec['childNodes'] = filter_by_cf_values($db, - $test_spec['childNodes'], - $my['filters']['filter_custom_fields'],$hash_descr_id); - } - - $pnFilters = array('keywords' => $my['filters']['filter_keywords'], - 'keywords_filter_type' => - $my['filters']['filter_keywords_filter_type'], - 'platforms' => $my['filters']['filter_platforms'], - ); - - $pnOptions = array('hideTestCases' => $my['options']['hideTestCases'], - 'ignoreInactiveTestCases' => - $my['options']['ignore_inactive_testcases'], - 'ignoreActiveTestCases' => - $my['options']['ignore_active_testcases']); - - // Important/CRITIC: - // prepareTestSpecNode() will make changes - // to $test_spec like filtering by test case keywords. - $testcase_counters = prepareTestSpecNode($db, $tproject_mgr,$tproject_id,$test_spec,$map_node_tccount,$pnFilters,$pnOptions); - - if( is_null($test_spec) ) { - $test_spec['name'] = $tproject_name; - $test_spec['id'] = $tproject_id; - $test_spec['node_type_id'] = $hash_descr_id['testproject']; - } - - foreach($testcase_counters as $key => $value) { - $test_spec[$key] = $testcase_counters[$key]; - } - - $tc2show = renderTreeNode(1,$test_spec,$hash_id_descr,$linkto,$tcase_prefix,$my['options']); - } - - $menustring =''; - $treeMenu->rootnode = new stdClass(); - $treeMenu->rootnode->name = $test_spec['text']; - $treeMenu->rootnode->id = $test_spec['id']; - $treeMenu->rootnode->leaf = isset($test_spec['leaf']) ? $test_spec['leaf'] : false; - $treeMenu->rootnode->text = $test_spec['text']; - $treeMenu->rootnode->position = $test_spec['position']; - $treeMenu->rootnode->href = $test_spec['href']; - - - - // 20090328 - franciscom - BUGID 2299 - // More details about problem found on 20090308 and fixed IN WRONG WAY - // TPROJECT - // |______ TSA - // |__ TC1 - // |__ TC2 - // | - // |______ TSB - // |______ TSC - // - // Define Keyword K1,K2 - // - // NO TEST CASE HAS KEYWORD ASSIGNED - // Filter by K1 - // Tree will show root that spins Forever - // menustring before str_ireplace : [null,null] - // menustring AFTER [null] - // - // Now fixed. - // - // Some minor fix to do - // Il would be important exclude Top Level Test suites. - // - // - // 20090308 - franciscom - // Changed because found problem on: - // Test Specification tree when applying Keyword filter using a keyword NOT PRESENT - // in test cases => Tree root shows loading icon and spin never stops. - // - // Attention: do not know if in other situation this will generate a different bug - // - // - // Change key ('childNodes') to the one required by Ext JS tree. - if(isset($test_spec['childNodes'])) - { - $menustring = str_ireplace('childNodes', 'children', json_encode($test_spec['childNodes'])); - } - - if(!is_null($menustring)) - { - // Remove null elements (Ext JS tree do not like it ). - // :null happens on -> "children":null,"text" that must become "children":[],"text" - // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); - // $menustring = str_ireplace(array(':null',',null','null,','null'),array(':[]','','',''), $menustring); - // $menustring = preg_replace('/,\s*"[^"]+":null|"[^"]+":null,?/', '', $menustring); - $menustring = str_ireplace(array(':' . REMOVEME, ',"' . REMOVEME .'"', '"' . REMOVEME . '",'), - array(':[]','',''), $menustring); - } - $treeMenu->menustring = $menustring; - - $tc2show = !is_null($tc2show) ? explode(",",trim($tc2show,",")) : null; - return array('menu' => $treeMenu, 'leaves' => $tc2show, 'tree' => $test_spec); -} - - -/** - * - * importance & status (workflow status) can be array - */ -function getTestSpecTree($tprojectID,&$tprojectMgr,&$fObj) { - - $flt = array(); - $flt['exclude_branches'] = - isset($fObj['filter_toplevel_testsuite']) && - is_array($fObj['filter_toplevel_testsuite']) ? - $fObj['filter_toplevel_testsuite'] : null; - - $flt['testcase_name'] = null; - $flt['testcase_id'] = null; - $flt['execution_type'] = null; - $flt['importance'] = null; - $flt['status'] = null; - $flt['keywords'] = null; - $flt['platforms'] = null; - - if( isset($fObj['filter_testcase_name']) && !is_null($fObj['filter_testcase_name']) ) { - if( ($dummy = trim($fObj['filter_testcase_name'])) != '' ) { - $flt['testcase_name'] = $dummy; - } - } - - if( isset($fObj['filter_tc_id']) && !is_null($fObj['filter_tc_id']) ) { - $flt['testcase_id'] = intval($fObj['filter_tc_id']); - } - - if( isset($fObj['filter_execution_type']) && !is_null($fObj['filter_execution_type']) ) { - $flt['execution_type'] = intval($fObj['filter_execution_type']); - } - - if( isset($fObj['filter_importance']) && !is_null($fObj['filter_importance']) ) { - $xx = (array)$fObj['filter_importance']; - if($xx[0] >0) { - $flt['importance'] = $xx; - } - } - - if( isset($fObj['filter_workflow_status']) && !is_null($fObj['filter_workflow_status']) ) { - $xx = (array)$fObj['filter_workflow_status']; - if($xx[0]>0) { - $flt['status'] = $xx; - } - } - - $piece = 'platforms'; - $full = 'filter_' . $piece; - if( isset($fObj[$full]) - && !is_null($fObj[$full]) ) { - $xx = (array)$fObj[$full]; - if($xx[0]>0) { - $flt[$piece] = $xx; - } - } - - $opt = array('recursive' => true,'exclude_testcases' => false); - $items = $tprojectMgr->getTestSpec($tprojectID,$flt,$opt); - - return $items; -} - - -/** - * - * - */ -function prepareTestSpecNode(&$db, &$tprojectMgr,$tprojectID,&$node,&$map_node_tccount,$filters=null,$options=null) { - - static $status_descr_list; - static $debugMsg; - static $tables; - static $my; - static $filtersApplied; - static $decoding_info; - static $tcFilterByKeywords; - static $doFilterOn; - static $tcFilterByPlatforms; - - if (!$tables) { - $debugMsg = 'Class: ' . __CLASS__ . ' - ' . 'Method: ' . __FUNCTION__ . ' - '; - $tables = tlObjectWithDB::getDBTables( - array('tcversions','nodes_hierarchy','testplan_tcversions')); - $decoding_info = array('node_id_descr' => - array_flip($tprojectMgr->tree_manager->get_available_node_types())); - $my = array(); - $my['options'] = array('hideTestCases' => 0); - $my['filters'] = array('keywords' => null, 'platforms' => null); - - $my['options'] = array_merge($my['options'], (array)$options); - $my['filters'] = array_merge($my['filters'], (array)$filters); - - $doFilterOn['keywords'] = !is_null($my['filters']['keywords']) - && (intval($my['filters']['keywords']) > 0); - - if ($doFilterOn['keywords']) { - $tcFilterByKeywords = $tprojectMgr->getTCLatestVersionFilteredByKeywords( - $tprojectID, - $my['filters']['keywords'], - $my['filters']['keywords_filter_type']); - - if( is_null($tcFilterByKeywords) ) { - // tree will be empty - $node = null; - $tcase_counters['testcase_count'] = 0; - return($tcase_counters); - } - } - - $doFilterOn['platforms'] = !is_null($my['filters']['platforms']) - && (intval($my['filters']['platforms']) > 0); - if ($doFilterOn['platforms']) { - $tcFilterByPlatforms = - $tprojectMgr->getTCLatestVersionFilteredByPlatforms( - $tprojectID,$my['filters']['platforms']); - - if( is_null($tcFilterByPlatforms) ) { - // tree will be empty - $node = null; - $tcase_counters['testcase_count'] = 0; - return($tcase_counters); - } - } - - - // Critic for logic that prune empty branches - // TICKET 4353: added active/inactive filter - $filtersApplied = $doFilterOn['keywords'] || - $my['options']['ignoreInactiveTestCases'] || - $my['options']['ignoreActiveTestCases'] || - $doFilterOn['platforms']; - } - - $tcase_counters['testcase_count'] = 0; - $node_type = isset($node['node_type_id']) ? $decoding_info['node_id_descr'][$node['node_type_id']] : null; - - if($node_type == 'testcase') { - $remove_node = false; - - if ($my['options']['ignoreInactiveTestCases']) { - $sql = " SELECT COUNT(TCV.id) AS count_active_versions " . - " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . - " WHERE NH.parent_id=" . $node['id'] . - " AND NH.id = TCV.id AND TCV.active=1"; - $result = $db->exec_query($sql); - $row = $db->fetch_array($result); - if ($row['count_active_versions'] == 0) { - $remove_node = true; - } - } - else if ($my['options']['ignoreActiveTestCases']) - { - $sql = " SELECT COUNT(TCV.id) AS count_active_versions " . - " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . - " WHERE NH.parent_id=" . $node['id'] . - " AND NH.id = TCV.id AND TCV.active=1"; - $result = $db->exec_query($sql); - $row = $db->fetch_array($result); - if ($row['count_active_versions'] != 0) { - $remove_node = true; - } - } - - if( $my['options']['hideTestCases'] || $remove_node || - ($doFilterOn['keywords'] && - !isset($tcFilterByKeywords[$node['id']])) || - ($doFilterOn['platforms'] && - !isset($tcFilterByPlatforms[$node['id']])) ) { - $node = REMOVEME; - } else { - // needed to avoid problems when using json_encode with EXTJS - unset($node['childNodes']); - $node['leaf']=true; - $tcase_counters['testcase_count'] = 1; - } - } // if($node_type == 'testcase') - - - // ================================================================ - if( !is_null($node) && isset($node['childNodes']) && is_array($node['childNodes']) ) { - - // node has to be a Test Suite ? - $childNodes = &$node['childNodes']; - $childNodesQty = count($childNodes); - - //$pos2unset = array(); - for($idx = 0;$idx < $childNodesQty ;$idx++) { - $current = &$childNodes[$idx]; - // I use set an element to null to filter out leaf menu items - if(is_null($current) || $current== REMOVEME) { - $childNodes[$idx] = REMOVEME; - continue; - } - - $counters_map = prepareTestSpecNode($db, $tprojectMgr,$tprojectID,$current,$map_node_tccount); - - // 20120831 - - // to be analized carefully, because this can be solution - // to null issue with json and ext-js - if( is_null($current) ) { - $childNodes[$idx] = REMOVEME; - } - - $tcase_counters['testcase_count'] += $counters_map['testcase_count']; - } - $node['testcase_count'] = $tcase_counters['testcase_count']; - - if (isset($node['id'])) { - $map_node_tccount[$node['id']] = array('testcount' => $node['testcase_count'], - 'name' => $node['name']); - } - - // node must be destroyed if empty had we have using filtering conditions - if( $filtersApplied && !$tcase_counters['testcase_count'] && ($node_type != 'testproject')) { - $node = null; - } - } else if ($node_type == 'testsuite') { - // does this means is an empty test suite ??? - franciscom 20080328 - $map_node_tccount[$node['id']] = array( 'testcount' => 0,'name' => $node['name']); - - // If is an EMPTY Test suite and we have added filtering conditions, - // We will destroy it. - if( $filtersApplied ) { - $node = null; - } - } - - return $tcase_counters; -} - -/** - * - * - */ -function helper_filter_cleanup(&$itemSet,$hits) -{ - $key2remove = null; - foreach($itemSet as $tcase_id => $dummy) - { - if( !isset($hits[$tcase_id]) ) - { - $key2remove[]=$tcase_id; - } - } - if( !is_null($key2remove) ) - { - foreach($key2remove as $key) - { - unset($itemSet[$key]); - } - } -} + viewType='testSpecTree' + * + * planAddTCNavigator.php => viewType=testSpecTreeForTestPlan + * + * --> tlTestCaseFilterControl->build_tree_menu() - WHEN FILTER ADDED + */ +function generateTestSpecTree(&$db, $tproject_id, $tproject_name, $linkto, + $filters = null, $options = null) +{ + $chronos[] = microtime(true); + + $my = array(); + $my['options'] = array( + 'forPrinting' => 0, + 'hideTestCases' => 0, + 'tc_action_enabled' => 1, + 'viewType' => 'testSpecTree', + 'ignore_inactive_testcases' => null, + 'ignore_active_testcases' => null + ); + + // testplan => + // only used if opetions['viewType'] == 'testSpecTreeForTestPlan' + // + // 20120205 - franciscom - hmm seems this code is INCOMPLETE + // may be we can remove ? + + // keys -> filter_* come from tlTestCaseFilterControl.class.php + $my['filters'] = [ + 'keywords' => null, + 'executionType' => null, + 'importance' => null, + 'testplan' => null, + 'filter_tc_id' => null, + 'filter_platforms' => null + ]; + + $my['options'] = array_merge($my['options'], (array) $options); + $my['options']['showTestCaseID'] = config_get('treemenu_show_testcase_id'); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + + // CRITIC: call with immediate return!!! + if ($my['options']['viewType'] == 'testSpecTree') { + + // Special processing for keywords + if ($filters['filter_keywords'] != null && + count($filters['filter_keywords']) == 1 && + $filters['filter_keywords'][0] == 0) { + // Get all available keywords on test project and apply these set + // will be affected by mode ? + // TODOD + $tproject_mgr = new testproject($db); + $usedKeywordsByKeyID = $tproject_mgr->getUsedKeywordsMap( + $tproject_id); + $filters['filter_keywords'] = array_keys($usedKeywordsByKeyID); + } + + return generateTestSpecTreeNew($db, $tproject_id, $tproject_name, + $linkto, $filters, $options); + } + + // OK - Go ahead here we have other type of features + $treeMenu = new stdClass(); + $treeMenu->rootnode = null; + $treeMenu->menustring = ''; + + $glueChar = config_get('testcase_cfg')->glue_character; + $menustring = null; + + $tproject_mgr = new testproject($db); + $tree_manager = &$tproject_mgr->tree_manager; + + $hash_descr_id = $tree_manager->get_available_node_types(); + $hash_id_descr = array_flip($hash_descr_id); + + // IMPORTANT NOTICE + // $filters['filter_toplevel_testsuite'] is managed in REVERSE form + // it contains NOT WHAT user wants, but all that we need to exclude + // in order provide what user WANTS. + // This is right way to go. + // $exclude_branches = isset($filters['filter_toplevel_testsuite']) && is_array($filters['filter_toplevel_testsuite']) ? $filters['filter_toplevel_testsuite'] : null; + + $tcase_prefix = $tproject_mgr->getTestCasePrefix($tproject_id) . $glueChar; + + $test_spec = getTestSpecTree($tproject_id, $tproject_mgr, $filters); + + // where the Keyword filter will be applied? + + // Added root node for test specification -> testproject + $test_spec['name'] = $tproject_name; + $test_spec['id'] = $tproject_id; + $test_spec['node_type_id'] = $hash_descr_id['testproject']; + + $map_node_tccount = array(); + $tplan_tcs = null; + $tc2show = null; + + // MORE FILTERS + if ($test_spec) { + $attr_map['keywords'] = null; // means no filter + if (! is_null($my['filters']['filter_keywords'])) { + + // if + $attr_map['keywords'] = $tproject_mgr->getKeywordsLatestTCV( + $tproject_id, $my['filters']['filter_keywords'], + $my['filters']['filter_keywords_filter_type']); + + if (is_null($attr_map['keywords'])) { + // means that tree will be EMPTY + $attr_map['keywords'] = array(); + } + } + + $attr_map['platforms'] = null; // means no filter + if (! is_null($my['filters']['filter_platforms'])) { + $attr_map['platforms'] = $tproject_mgr->getPlatformsLatestTCV( + $tproject_id, $my['filters']['filter_platforms']); + + if (is_null($attr_map['platforms'])) { + // means that tree will be EMPTY + $attr_map['platforms'] = array(); + } + } + + // Important: prepareNode() will make changes to + // $test_spec like filtering by test case + // keywords using $attr_map['keywords']; + $pnFilters = null; + $keys2init = array( + 'filter_testcase_name', + 'filter_execution_type', + 'filter_priority', + 'filter_tc_id' + ); + foreach ($keys2init as $keyname) { + $pnFilters[$keyname] = isset($my['filters'][$keyname]) ? $my['filters'][$keyname] : null; + } + + $pnFilters['setting_testplan'] = $my['filters']['setting_testplan']; + if (isset($my['filters']['filter_custom_fields']) && + isset($test_spec['childNodes'])) { + $test_spec['childNodes'] = filter_by_cf_values($db, + $test_spec['childNodes'], $my['filters']['filter_custom_fields'], + $hash_descr_id); + } + + // TICKET 4496: added inactive testcase filter + $pnOptions = array( + 'hideTestCases' => $my['options']['hideTestCases'], + 'viewType' => $my['options']['viewType'], + 'ignoreInactiveTestCases' => $my['options']['ignore_inactive_testcases'], + 'ignoreActiveTestCases' => $my['options']['ignore_active_testcases'] + ); + + $testcase_counters = prepareNode($db, $test_spec, $map_node_tccount, + $attr_map, $tplan_tcs, $pnFilters, $pnOptions); + + foreach ($testcase_counters as $key => $value) { + $test_spec[$key] = $testcase_counters[$key]; + } + + $tc2show = renderTreeNode(1, $test_spec, $hash_id_descr, $linkto, + $tcase_prefix, $my['options']); + } + + $menustring = ''; + $treeMenu->rootnode = new stdClass(); + $treeMenu->rootnode->name = $test_spec['text']; + $treeMenu->rootnode->id = $test_spec['id']; + $treeMenu->rootnode->leaf = isset($test_spec['leaf']) ? $test_spec['leaf'] : false; + $treeMenu->rootnode->text = $test_spec['text']; + $treeMenu->rootnode->position = $test_spec['position']; + $treeMenu->rootnode->href = $test_spec['href']; + + // 20090328 - franciscom - BUGID 2299 + // More details about problem found on 20090308 and fixed IN WRONG WAY + // TPROJECT + // |______ TSA + // |__ TC1 + // |__ TC2 + // | + // |______ TSB + // |______ TSC + // + // Define Keyword K1,K2 + // + // NO TEST CASE HAS KEYWORD ASSIGNED + // Filter by K1 + // Tree will show root that spins Forever + // menustring before str_ireplace : [null,null] + // menustring AFTER [null] + // + // Now fixed. + // + // Some minor fix to do + // Il would be important exclude Top Level Test suites. + // + // + // 20090308 - franciscom + // Changed because found problem on: + // Test Specification tree when applying Keyword filter using a keyword NOT PRESENT + // in test cases => Tree root shows loading icon and spin never stops. + // + // Attention: do not know if in other situation this will generate a different bug + // + // Change key ('childNodes') to the one required by Ext JS tree. + if (isset($test_spec['childNodes'])) { + $menustring = str_ireplace('childNodes', 'children', + json_encode($test_spec['childNodes'])); + } + + if (! is_null($menustring)) { + // Remove null elements (Ext JS tree do not like it ). + // :null happens on -> "children":null,"text" that must become "children":[],"text" + // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); + // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); + $menustring = str_ireplace( + array( + ':' . REMOVEME, + ',"' . REMOVEME . '"', + '"' . REMOVEME . '",', + '"' . REMOVEME . '"' + ), array( + ':[]', + '', + '', + '' + ), $menustring); + } + $treeMenu->menustring = $menustring; + + $tc2show = ! is_null($tc2show) ? explode(",", trim($tc2show, ",")) : null; + return array( + 'menu' => $treeMenu, + 'leaves' => $tc2show, + 'tree' => $test_spec + ); +} + +/** + * Prepares a Node to be displayed in a navigation tree. + * This function is used in the construction of: + * - Test project specification -> we want ALL test cases defined in test project. + * - Test execution -> we only want the test cases linked to a test plan. + * + * IMPORTANT: + * when analising a container node (Test Suite) if it is empty and we have requested + * some sort of filtering NODE WILL BE PRUNED. + * + * + * status: one of the possible execution status of a test case. + * + * + * tplan_tcases: map with testcase versions linked to test plan. + * due to the multiples uses of this function, null has several meanings + * + * When we want to build a Test Project specification tree, + * WE SET it to NULL, because we are not interested in a test plan. + * + * When we want to build a Test execution tree, we dont set it deliverately + * to null, but null can be the result of NO tcversion linked => EMPTY TEST PLAN + * + * + * status can be an array with multple values, to do OR search. + * added version info from test cases in return data structure. + * ignore_inactive_testcases: useful when building a Test Project Specification tree + * to be used in the add/link test case to Test Plan. + * + * attr_map['keywords']: Test Case Keyword map: + * null => no filter + * empty map => filter out ALL test case ALWAYS + * initialized map => filter out test case ONLY if NOT present in map. + * + * attr_map['platforms']: Test Case platforms map: + * null => no filter + * empty map => filter out ALL test case ALWAYS + * initialized map => filter out test case ONLY if NOT present in map. + * + * added argument: + * $map_node_tccount + * key => node_id + * values => node test case count + * node name (useful only for debug purpouses + * + * IMPORTANT: this new argument is not useful for tree rendering + * but to avoid duplicating logic to get test case count + * + * + * return: map with keys: + * 'total_count' + * 'passed' + * 'failed' + * 'blocked' + * 'not run' + * + * @internal revisions + */ +function prepareNode(&$db, &$node, &$map_node_tccount, $attr_map = null, + &$tplan_tcases = null, $filters = null, $options = null) +{ + static $status_descr_list; + static $debugMsg; + static $tables; + static $my; + static $enabledFiltersOn; + static $activeVersionClause; + static $filterOnTCVersionAttribute; + static $filtersApplied; + static $users2filter; + static $results2filter; + static $testPlanIsNotEmpty; + static $nodesTypeCode; + static $nodesCodeType; + + $tpNode = null; + if (! $tables) { + + $debugMsg = 'Class: ' . __CLASS__ . ' - ' . 'Method: ' . __FUNCTION__ . + ' - '; + $tables = tlObjectWithDB::getDBTables( + array( + 'tcversions', + 'nodes_hierarchy', + 'node_types', + 'testplan_tcversions' + )); + + $sql = " SELECT * FROM {$tables['node_types']} "; + $nodesTypeCode = $db->fetchColumnsIntoMap($sql, 'description', 'id'); + $nodesCodeType = array_flip($nodesTypeCode); + + $resultsCfg = config_get('results'); + $status_descr_list = array_keys($resultsCfg['status_code']); + $status_descr_list[] = 'testcase_count'; + + $my = array(); + $my['options'] = array( + 'hideTestCases' => 0, + 'showTestCaseID' => 1, + 'viewType' => 'testSpecTree', + 'getExternalTestCaseID' => 1, + 'ignoreInactiveTestCases' => 0, + 'ignoreActiveTestCases' => 0, + 'setAssignedTo' => false + ); + + // added importance here because of "undefined" error in event log + $my['filters'] = array( + 'status' => null, + 'assignedTo' => null, + 'importance' => null, + 'executionType' => null, + 'filter_tc_id' => null, + 'filter_platforms' => null + ); + + $my['options'] = array_merge($my['options'], (array) $options); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $enabledFiltersOn['importance'] = isset( + $my['filters']['filter_priority']); + $enabledFiltersOn['testcase_id'] = isset($my['filters']['filter_tc_id']); + + $enabledFiltersOn['testcase_name'] = isset( + $my['filters']['filter_testcase_name']); + $enabledFiltersOn['executionType'] = isset( + $my['filters']['filter_execution_type']); + $enabledFiltersOn['custom_fields'] = isset( + $my['filters']['filter_custom_fields']); + + $enabledFiltersOn['keywords'] = (null != $attr_map && + isset($attr_map['keywords']) && null != $attr_map['keywords'] && + count($attr_map['keywords']) > 0); + + $enabledFiltersOn['platforms'] = (null != $attr_map && + isset($attr_map['platforms']) && null != $attr_map['platforms'] && + count($attr_map['platforms']) > 0); + + $filterOnTCVersionAttribute = $enabledFiltersOn['executionType'] || + $enabledFiltersOn['importance']; + + $filtersApplied = false; + foreach ($enabledFiltersOn as $filterValue) { + $filtersApplied = $filtersApplied || $filterValue; + } + + $activeVersionClause = $filterOnTCVersionAttribute ? " AND TCV.active=1 " : ''; + + $users2filter = isset($my['filters']['filter_assigned_user']) ? $my['filters']['filter_assigned_user'] : null; + + $results2filter = isset($my['filters']['filter_result_result']) ? $my['filters']['filter_result_result'] : null; + + $testPlanIsNotEmpty = (! empty($tplan_tcases)); + } + + $tcase_counters = array_fill_keys($status_descr_list, 0); + $node_type = isset($node['node_type_id']) ? $nodesCodeType[$node['node_type_id']] : null; + + if ($node_type == 'testcase') { + // ABSOLUTELY First implicit filter to be applied when test plan is not empty. + // is our test case present on Test Spec linked to Test Plan ? + + if ($testPlanIsNotEmpty && ! isset($tplan_tcases[$node['id']])) { + $node = null; + } elseif (($enabledFiltersOn['keywords'] && + ! isset($attr_map['keywords'][$node['id']])) || + ($enabledFiltersOn['platforms'] && + ! isset($attr_map['platforms'][$node['id']])) || + ($enabledFiltersOn['testcase_name'] && + stripos($node['name'], $my['filters']['filter_testcase_name']) === + false) || + ($enabledFiltersOn['testcase_id'] && + ($node['id'] != $my['filters']['filter_tc_id']))) { + unset($tplan_tcases[$node['id']]); + $node = null; // OK - 20150129 + } else { + if ($my['options']['viewType'] == 'executionTree') { + $tpNode = isset($tplan_tcases[$node['id']]) ? $tplan_tcases[$node['id']] : null; + if (! ($delete_node = is_null($tpNode))) { + $delete_node = ! is_null($results2filter) && + ! isset($results2filter[$tpNode['exec_status']]); + + if (! $delete_node && ! is_null($users2filter)) { + $somebody_wanted_but_nobody_there = isset( + $users2filter[TL_USER_SOMEBODY]) && + ! is_numeric($tpNode['user_id']); + + $unassigned_wanted_but_someone_assigned = isset( + $users2filter[TL_USER_NOBODY]) && + ! is_null($tpNode['user_id']); + + $wrong_user = ! isset($users2filter[TL_USER_NOBODY]) && + ! isset($users2filter[TL_USER_SOMEBODY]) && + ! isset($users2filter[$tpNode['user_id']]); + + $delete_node = $unassigned_wanted_but_someone_assigned || + $wrong_user || $somebody_wanted_but_nobody_there; + } + } + + if ($delete_node) { + unset($tplan_tcases[$node['id']]); + $node = null; + } else { + $externalID = ''; + $node['tcversion_id'] = $tpNode['tcversion_id']; + $node['version'] = $tpNode['version']; + if ($my['options']['setAssignedTo']) { + $node['assigned_to'] = $tplan_tcases[$node['id']]['assigned_to']; + } + + if ($my['options']['getExternalTestCaseID']) { + if (! isset($tpNode['external_id'])) { + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT TCV.tc_external_id AS external_id " . + " FROM {$tables['tcversions']} TCV " . + " WHERE TCV.id=" . $node['tcversion_id']; + + $result = $db->exec_query($sql); + $myrow = $db->fetch_array($result); + $externalID = $myrow['external_id']; + } else { + $externalID = $tpNode['external_id']; + } + } + $node['external_id'] = $externalID; + } + } + + if ($node != REMOVEME && $my['options']['ignoreInactiveTestCases']) { + // there are active tcversions for this node ??? + // I'm doing this instead of creating a test case manager object, because + // I think is better for performance. + // + // 20070106 - franciscom + // Postgres Problems + // Problem 1 - SQL Syntax + // While testing with postgres + // SELECT count(TCV.id) NUM_ACTIVE_VERSIONS -> Error + // + // At least for what I remember using AS to create COLUMN ALIAS IS REQUIRED and Standard + // while AS is NOT REQUIRED (and with some DBMS causes errors) when you want to give a + // TABLE ALIAS + // + // Problem 2 - alias case + // At least in my installation the aliases column name is returned lower case, then + // PHP fails when: + // if($myrow['NUM_ACTIVE_VERSIONS'] == 0) + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT count(TCV.id) AS num_active_versions " . + " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . + " WHERE NH.parent_id=" . $node['id'] . + " AND NH.id = TCV.id AND TCV.active=1"; + + $result = $db->exec_query($sql); + $myrow = $db->fetch_array($result); + if ($myrow['num_active_versions'] == 0) { + $node = null; + } + } + + // TICKET 4496: added inactive testcase filter + if ($node !== REMOVEME && $my['options']['ignoreActiveTestCases']) { + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT count(TCV.id) AS num_active_versions " . + " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . + " WHERE NH.parent_id=" . $node['id'] . + " AND NH.id = TCV.id AND TCV.active=1"; + + $result = $db->exec_query($sql); + $myrow = $db->fetch_array($result); + if ($myrow['num_active_versions'] != 0) { + $node = null; + } + } + } + + if (! is_null($node) && + ($my['options']['viewType'] == 'testSpecTree' || + $my['options']['viewType'] == 'testSpecTreeForTestPlan')) { + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT COALESCE(MAX(TCV.id),0) AS targetid, TCV.tc_external_id AS external_id" . + " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . + " WHERE NH.id = TCV.id {$activeVersionClause} AND NH.parent_id={$node['id']} " . + " GROUP BY TCV.tc_external_id "; + + $rs = $db->get_recordset($sql); + if (is_null($rs)) { + $node = null; // OK 20150129 + } else { + $node['external_id'] = $rs[0]['external_id']; + $target_id = $rs[0]['targetid']; + + if ($filterOnTCVersionAttribute) { + switch ($my['options']['viewType']) { + case 'testSpecTreeForTestPlan': + // Try to get info from linked tcversions + // Platform is not needed + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT DISTINCT TPTCV.tcversion_id AS targetid " . + " FROM {$tables['tcversions']} TCV " . + " JOIN {$tables['nodes_hierarchy']} NH " . + " ON NH.id = TCV.id {$activeVersionClause} " . + " AND NH.parent_id={$node['id']} " . + " JOIN {$tables['testplan_tcversions']} TPTCV " . + " ON TPTCV.tcversion_id = TCV.id " . + " AND TPTCV.testplan_id = " . + " {$my['filters']['setting_testplan']}"; + $rs = $db->get_recordset($sql); + $target_id = ! is_null($rs) ? $rs[0]['targetid'] : $target_id; + break; + } + + $sql = " /* $debugMsg - line:" . __LINE__ . " */ " . + " SELECT TCV.execution_type " . + " FROM {$tables['tcversions']} TCV " . + " WHERE TCV.id = {$target_id} "; + + if ($enabledFiltersOn['executionType']) { + $sql .= " AND TCV.execution_type = " . + " {$my['filters']['filter_execution_type']} "; + } + + if ($enabledFiltersOn['importance']) { + $sql .= " AND TCV.importance = " . + " {$my['filters']['filter_priority']} "; + } + + $rs = $db->fetchRowsIntoMap($sql, 'execution_type'); + if (is_null($rs)) { + $node = null; // OK - 20150129 + } + } + } + + // if( !is_null($node) ) + if (! is_null($node) && $node != REMOVEME) { + // needed to avoid problems when using json_encode with EXTJS + unset($node['childNodes']); + $node['leaf'] = true; + } + } + + foreach ($tcase_counters as $key => $value) { + $tcase_counters[$key] = 0; + } + + if (isset($decoding_info['status_code_descr'][$tpNode['exec_status']])) { + $tc_status_descr = $decoding_info['status_code_descr'][$tpNode['exec_status']]; + } else { + $tc_status_descr = "not_run"; + } + + $init_value = $node ? 1 : 0; + $tcase_counters[$tc_status_descr] = $init_value; + $tcase_counters['testcase_count'] = $init_value; + if ($my['options']['hideTestCases']) { + $node = REMOVEME; + } + } + + if (isset($node['childNodes']) && is_array($node['childNodes'])) { + // node has to be a Test Suite ? + $childNodes = &$node['childNodes']; + $childNodesQty = count($childNodes); + + for ($idx = 0; $idx < $childNodesQty; $idx ++) { + $current = &$childNodes[$idx]; + // I use set an element to null to filter out leaf menu items + if (is_null($current) || $current == REMOVEME) { + $childNodes[$idx] = REMOVEME; + continue; + } + $counters_map = prepareNode($db, $current, $map_node_tccount, + $attr_map, $tplan_tcases, $my['filters'], $my['options']); + foreach ($counters_map as $key => $value) { + $tcase_counters[$key] += $counters_map[$key]; + } + } + foreach ($tcase_counters as $key => $value) { + $node[$key] = $tcase_counters[$key]; + } + + if (isset($node['id'])) { + $map_node_tccount[$node['id']] = array( + 'testcount' => $node['testcase_count'], + 'name' => $node['name'] + ); + } + + // node must be destroyed if empty had we have using filtering conditions + if (($filtersApplied || ! is_null($tplan_tcases)) && + ! $tcase_counters['testcase_count'] && ($node_type != 'testproject')) { + $node = REMOVEME; // OK 20150129 + } + } elseif ($node_type == 'testsuite') { + // does this means is an empty test suite ??? - franciscom 20080328 + $map_node_tccount[$node['id']] = array( + 'testcount' => 0, + 'name' => $node['name'] + ); + + // If is an EMPTY Test suite and we have added filtering conditions, + // We will destroy it. + if ($filtersApplied || ! is_null($tplan_tcases)) { + $node = REMOVEME; // OK - 20150129 + } + } + + return $tcase_counters; +} + +/** + * Create the string representation suitable to create a graphic visualization + * of a node, for the type of menu selected. + * + * Used when LAZY Rendering can not be used. + * + * @internal revisions + */ +function renderTreeNode($level, &$node, $hash_id_descr, $linkto, $testCasePrefix, + $opt) +{ + static $f2call; + static $forbidden_parents; + + $testCasesIDList = ''; + + // Choice for PERFORMANCE: + // Some pieces of code on TL < 1.9.4 has been wrapped in a function, but when working + // with BIG amount of testcases (> 5000) impact on performance was high. + if (! $f2call) { + $f2call['testproject'] = 'EP'; + $f2call['testsuite'] = 'ETS'; + if (isset($opt['forPrinting']) && $opt['forPrinting']) { + $f2call['testproject'] = 'TPROJECT_PTP'; + $f2call['testsuite'] = 'TPROJECT_PTS'; + } + + $f2call['testcase'] = $opt['tc_action_enabled'] ? 'ET' : 'void'; + + // Design allow JUST ONE forbidden, probably other measures + // like a leaf (test case) can not have other leaf as parent + // are already in place (need to check code better) + // + // IMPORTANT NOTICE: + // @20130407 + // this extended attribute need to be setted also on + // logic used when lazy tree build is used + // (gettprojectnodes.php) + // In addition tree config option useBeforeMoveNode must be set to true + $forbidden_parents['testproject'] = 'none'; + $forbidden_parents['testcase'] = 'testproject'; + $forbidden_parents['testsuite'] = 'testcase'; + } + + if (! isset($node['name'])) { + return $testCasesIDList; + } + + // custom Property that will be accessed by EXT-JS using node.attributes + // strip potential newlines and other unwanted chars from strings + // Mainly for stripping out newlines, carriage returns, and quotes that were + // causing problems in javascript using jtree + $node['testlink_node_name'] = str_replace(array( + "\n", + "\r" + ), array( + "", + "" + ), $node['name']); + $node['testlink_node_name'] = htmlspecialchars($node['testlink_node_name'], + ENT_QUOTES); + + $node['testlink_node_type'] = $hash_id_descr[$node['node_type_id']]; + $node['forbidden_parent'] = $forbidden_parents[$node['testlink_node_type']]; + + $testcase_count = isset($node['testcase_count']) ? $node['testcase_count'] : 0; + $pfn = $f2call[$node['testlink_node_type']]; + + switch ($node['testlink_node_type']) { + case 'testproject': + case 'testsuite': + $node['text'] = $node['testlink_node_name'] . " (" . $testcase_count . + ")"; + if (isset($opt['nodeHelpText'][$node['testlink_node_type']])) { + $node['text'] = '' . + $node['text'] . ''; + } + break; + + case 'testcase': + $node['text'] = ""; + if ($opt['showTestCaseID']) { + $node['text'] .= "{$testCasePrefix}{$node['external_id']}:"; + } + $node['text'] .= $node['testlink_node_name']; + $testCasesIDList .= $node['id'] . ','; + break; + } // switch + + $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; + $node['href'] = "javascript:{$pfn}({$node['id']})"; + + if (isset($node['childNodes']) && $node['childNodes']) { + // need to work always original object + // in order to change it's values using reference . + // Can not assign anymore to intermediate variables. + // + $nChildren = count($node['childNodes']); + for ($idx = 0; $idx < $nChildren; $idx ++) { + // asimon - replaced is_null by !isset because of warnings in event log + if (! isset($node['childNodes'][$idx])) { + continue; + } + $testCasesIDList .= renderTreeNode($level + 1, + $node['childNodes'][$idx], $hash_id_descr, $linkto, + $testCasePrefix, $opt); + } + } + + return $testCasesIDList; +} + +/** + * + * @param integer $level + * @param + * array &$node reference to recursive map + * @param + * array &$tcases_node reference to map that contains info about testcase exec status + * when node is of testcase type. + * @param array $hash_id_descr + * @param string $linkto + * @param string $testCasePrefix + * @param array $opt + * @used-by execTreeMenu.inc.php + * + */ +function renderExecTreeNode($level, &$node, &$tcase_node, $hash_id_descr, + $linkto, $testCasePrefix, $opt) +{ + static $resultsCfg; + static $l18n; + static $pf; + static $doColouringOn; + static $cssClasses; + + $node_type = $hash_id_descr[$node['node_type_id']]; + + if (! $resultsCfg) { + $doColouringOn['testcase'] = 1; + $doColouringOn['counters'] = 1; + if (! is_null($opt['useColors'])) { + $doColouringOn['testcase'] = $opt['useColors']->testcases; + $doColouringOn['counters'] = $opt['useColors']->counters; + } + + $resultsCfg = config_get('results'); + $status_descr_code = $resultsCfg['status_code']; + + foreach ($resultsCfg['status_label'] as $key => $value) { + $l18n[$status_descr_code[$key]] = lang_get($value); + + // here we use ONLY key + $cssClasses[$status_descr_code[$key]] = $doColouringOn['testcase'] ? ('class="light_' . + $key . '"') : ''; + } + + // Very BAD CHOICE => SIDE EFFECT + $pf['testsuite'] = $opt['hideTestCases'] ? 'TPLAN_PTS' : ($opt['showTestSuiteContents'] ? 'STS' : null); + $pf['testproject'] = $opt['hideTestCases'] ? 'TPLAN_PTP' : 'SP'; + + if (isset($opt['actionJS'])) { + $k2l = array( + 'testproject', + 'testsuite', + 'testcase', + 'testplan', + 'default' + ); + foreach ($k2l as $kiki) { + if (isset($opt['actionJS'][$kiki])) { + $pf[$kiki] = null; + if ('' != $opt['actionJS'][$kiki]) { + $pf[$kiki] = $opt['actionJS'][$kiki]; + } + } + } + } + + // manage defaults + $opt['showTestCaseExecStatus'] = isset($opt['showTestCaseExecStatus']) ? $opt['showTestCaseExecStatus'] : true; + $opt['nodeHelpText'] = isset($opt['nodeHelpText']) ? $opt['nodeHelpText'] : array(); + } + + $name = htmlspecialchars($node['name'], ENT_QUOTES); + + // custom Property that will be accessed by EXT-JS using node.attributes + $node['testlink_node_name'] = $name; + $node['testlink_node_type'] = $node_type; + + switch ($node_type) { + case 'testproject': + case 'testsuite': + $node['leaf'] = false; + + $testcase_count = isset($node['testcase_count']) ? $node['testcase_count'] : 0; + $node['text'] = $name . " (" . $testcase_count . ")"; + if ($opt['useCounters']) { + $node['text'] .= create_counters_info($node, + $doColouringOn['counters']); + } + + if (isset($opt['nodeHelpText'][$node_type])) { + $node['text'] = '' . $node['text'] . + ''; + } + + $pfn = ! is_null($pf[$node_type]) ? $pf[$node_type] . + "({$node['id']})" : null; + if ('testsuite' == $node_type && ($opt['alertOnTestSuiteTCQty'] > 0) && + $testcase_count > $opt['alertOnTestSuiteTCQty']) { + $jfn = config_get('jsAlertOnTestSuiteTCQty'); + $pfn = $jfn; + } + + break; + + case 'testcase': + $node['leaf'] = true; + $pfn = null; + if ($opt['tc_action_enabled']) { + $pfx = "ST"; + if (isset($pf[$node_type])) { + $pfx = "$pf[$node_type]"; + } + $pfn = $pfx . "({$node['id']},{$node['tcversion_id']})"; + } + + $node['text'] = "'; + } + + if ($opt['showTestCaseID']) { + // optimizable + $node['text'] .= "" . + htmlspecialchars($testCasePrefix . $node['external_id']) . + ":"; + } + $node['text'] .= "{$name}"; + break; + + case 'testplan': + $pfn = "ST({$node['id']})"; + if (isset($pf[$node_type])) { + $pfn = null; + if ('' != $pf[$node_type]) { + $pfn = $pf[$node_type] . "({$node['id']})"; + } + } + break; + + default: + $pfn = "ST({$node['id']})"; + if (isset($pf['default'])) { + $pfn = null; + if ('' != $pf['default']) { + $pfn = $pf['default'] . "({$node['id']})"; + } + } + break; + } + + $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; + $node['href'] = is_null($pfn) ? '' : "javascript:{$pfn}"; + + if (isset($tcase_node[$node['id']])) { + unset($tcase_node[$node['id']]); // dam it NO COMMENT! + } + + if (isset($node['childNodes']) && $node['childNodes']) { + // need to work always original object in order to change it's values using reference . + // Can not assign anymore to intermediate variables. + $nodes_qty = count($node['childNodes']); + for ($idx = 0; $idx < $nodes_qty; $idx ++) { + if (is_null($node['childNodes'][$idx]) || + $node['childNodes'][$idx] == REMOVEME) { + continue; + } + renderExecTreeNode($level + 1, $node['childNodes'][$idx], + $tcase_node, $hash_id_descr, $linkto, $testCasePrefix, $opt); + } + } +} + +/** + */ +function create_counters_info(&$node, $useColors) +{ + static $keys2display; + static $labelCache; + + if (! $labelCache) { + $resultsCfg = config_get('results'); + $status_label = $resultsCfg['status_label']; + + // I will add not_run if not exists + $keys2display = array( + 'not_run' => 'not_run' + ); + foreach ($resultsCfg['status_label_for_exec_ui'] as $key => $value) { + if ($key != 'not_run') { + $keys2display[$key] = $key; + } + $labelCache[$key] = lang_get($status_label[$key]); + } + } + + $add_html = ''; + foreach ($keys2display as $key) { + if (isset($node[$key])) { + $css_class = $useColors ? (" class=\"light_{$key}\" ") : ''; + $add_html .= "' . $node[$key] . ","; + } + } + + $add_html = "(" . rtrim($add_html, ",") . ")"; + return $add_html; +} + +/** + * Filter out the testcases that don't have the given value + * in their custom field(s) from the tree. + * Recursive function. + * + * @author Andreas Simon + * @since 1.9 + * + * @param + * resource &$db reference to DB handler object + * @param + * array &$tcase_tree reference to test case set/tree to filter + * @param + * array &$cf_hash reference to selected custom field information + * @param int $node_types + * IDs of node types + * + * @return array $tcase_tree filtered tree structure + * + * @internal revisions + */ +function filter_by_cf_values(&$db, &$tcase_tree, &$cf_hash, $node_types) +{ + static $tables = null; + static $debugMsg = null; + + $rows = null; + if (! $debugMsg) { + $tables = tlObject::getDBTables( + array( + 'cfield_design_values', + 'nodes_hierarchy', + 'tcversions' + )); + $debugMsg = 'Function: ' . __FUNCTION__; + } + + $node_deleted = false; + + // This code is in parts based on (NOT simply copy/pasted) + // some filter code used in testplan class. + // Implemented because we have a tree here, + // not simple one-dimensional array of testcases like in tplan class. + + foreach ($tcase_tree as $key => $node) { + // TICKET 5186: Filtering by the value of custom fields on test specification is not working + if ($node['node_type_id'] == $node_types['testsuite']) { + $delete_suite = false; + + if (isset($node['childNodes']) && is_array($node['childNodes'])) { + // node is a suite and has children, so recurse one level deeper + $tcase_tree[$key]['childNodes'] = filter_by_cf_values($db, + $tcase_tree[$key]['childNodes'], $cf_hash, $node_types); + + // now remove testsuite node if it is empty after coming back from recursion + if (! count($tcase_tree[$key]['childNodes'])) { + $delete_suite = true; + } + } else { + // nothing in here, suite was already empty + $delete_suite = true; + } + + if ($delete_suite) { + unset($tcase_tree[$key]); + $node_deleted = true; + } + } elseif ($node['node_type_id'] == $node_types['testcase']) { + // node is testcase, check if we need to delete it + $passed = false; + + // TICKET 5186: added "DISTINCT" to SQL clause, detailed explanation follows at the end of function + // Note: SQL statement has been adopted to filter by latest active tc version. + // That is a better solution for the explained problem than using the distinct keyword. + $latest_active_version_sql = " /* get latest active TC version ID */ " . + " SELECT MAX(TCVX.id) AS max_tcv_id, NHTCX.parent_id AS tc_id " . + " FROM {$tables['tcversions']} TCVX " . + " JOIN {$tables['nodes_hierarchy']} NHTCX " . + " ON NHTCX.id = TCVX.id AND TCVX.active = 1 " . + " WHERE NHTCX.parent_id = {$node['id']} " . + " GROUP BY NHTCX.parent_id, TCVX.tc_external_id "; + + $sql = " /* $debugMsg */ SELECT CFD.value " . + " FROM {$tables['cfield_design_values']} CFD, {$tables['nodes_hierarchy']} NH " . + " JOIN ( $latest_active_version_sql ) LAVSQL ON NH.id = LAVSQL.max_tcv_id " . + " WHERE CFD.node_id = NH.id "; + + // IMPORTANT DEV NOTES + // Query uses OR, but final processing makes that CF LOGIC work in AND MODE as expected + if (isset($cf_hash)) { + $countmain = 1; + $cf_sql = ''; + foreach ($cf_hash as $cf_id => $cf_value) { + if ($countmain != 1) { + $cf_sql .= " OR "; + } + + $safeID = intval($cf_id); + // single value or array? + if (is_array($cf_value)) { + $count = 1; + foreach ($cf_value as $value) { + if ($count > 1) { + $cf_sql .= " AND "; + } + $safeValue = $db->prepare_string($value); + $cf_sql .= "( CFD.value LIKE '%{$safeValue}%' AND CFD.field_id = {$safeID} )"; + $count ++; + } + } else { + $safeValue = $db->prepare_string($cf_value); + $cf_sql .= " ( CFD.value LIKE '%{$safeValue}%' AND CFD.field_id = {$safeID} ) "; + } + $countmain ++; + } + $sql .= " AND ({$cf_sql}) "; + } + + $rows = (array) $db->fetchColumnsIntoArray($sql, 'value'); + + // if there exist as many rows as custom fields to be filtered by + // the tc does meet the criteria + + /* + * NOTE by asimon: This assumption was wrong! If there are multiple versions of a TC, + * then the row number here can be larger than the number of custom fields with the correct value. + * + * Example: + * Custom field "color" has possible values "red", "blue", "green", default empty. + * Custom field "status" has possible values "draft", "ready", "needs review", "needs rework", default empty. + * TC Version 1: cfield "color" has value "red", cfield "status" has no value yet. + * TC Version 2: cfield "color" has value "red", cfield "status" has no value yet. + * TC Version 3: cfield "color" and value "red", cfield "status" has value "ready". + * TC Version 4: cfield "color" has value "red", cfield "status" has value "ready". + * + * Filter by color GREEN and status READY, then $rows looks like this: Array ( [0] => red, [1] => red ) + * => count($rows) returns 2, which matches the number of custom fields we want to filter by. + * So TC lands in the result set instead of being filtered out. + * That is wrong, because TC matches only one of the fields we were filtering by! + * + * Because of this I extended the SQL statement above with the DISTINCT keyword, + * so that each custom field only is contained ONCE in the result set. + */ + + $passed = (count($rows) == count($cf_hash)) ? true : false; + // now delete node if no match was found + if (! $passed) { + unset($tcase_tree[$key]); + $node_deleted = true; + } + } + } + + // 20100702 - asimon + // if we deleted a note, the numeric indexes of this array do have missing numbers, + // which causes problems in later loop constructs in other functions that assume numeric keys + // in these arrays without missing numbers in between - crashes JS tree! + // -> so I have to fix the array indexes here starting from 0 without missing a key + if ($node_deleted) { + $tcase_tree = array_values($tcase_tree); + } + + return $tcase_tree; +} + +/** + * + * @param + * object &$tplan_mgr reference to test plan manager object + * @param + * array &$tcase_set reference to test case set to filter + * @param integer $tplan_id + * ID of test plan + * @param array $filters + * filters to apply to test case set + * @return array new tcase_set + */ +function filterStatusSetAtLeastOneOfActiveBuilds(&$tplan_mgr, &$tcase_set, + $tplan_id, $filters) +{ + $safe_platform = intval($filters->setting_platform); + $buildSet = array_keys( + $tplan_mgr->get_builds($tplan_id, testplan::ACTIVE_BUILDS)); + if (! is_null($buildSet)) { + if ($safe_platform > 0) { + tLog( + basename(__FILE__) . __FUNCTION__ . + ':: $tplan_mgr->getHitsSameStatusPartialOnPlatform', 'DEBUG'); + $hits = $tplan_mgr->getHitsSameStatusPartialOnPlatform($tplan_id, + $safe_platform, (array) $filters->filter_result_result); + } else { + tLog( + basename(__FILE__) . __FUNCTION__ . + ':: $tplan_mgr->getHitsSameStatusPartialALOP', 'DEBUG'); + $hits = $tplan_mgr->getHitsSameStatusPartialALOP($tplan_id, + (array) $filters->filter_result_result); + } + + if (is_null($hits)) { + $tcase_set = array(); + } else { + helper_filter_cleanup($tcase_set, $hits); + } + } + + return $tcase_set; +} + +/** + * filterStatusSetAllActiveBuilds() + * + * returns: + * + * test cases that has AT LEAST ONE of requested status + * or combinations of requested status + * ON LAST EXECUTION ON ALL ACTIVE builds, for a PLATFORM + * + * For examples and more info read documentation regarding + * getHits*() methods on testplan class. + * + * + * @param + * object &$tplan_mgr reference to test plan manager object + * @param + * array &$tcase_set reference to test case set to filter + * WILL BE MODIFIED HERE + * + * @param integer $tplan_id + * ID of test plan + * @param array $filters + * filters to apply to test case set + * + * @return array new tcase_set + */ +function filterStatusSetAllActiveBuilds(&$tplan_mgr, &$tcase_set, $tplan_id, + $filters) +{ + $buildSet = array_keys( + $tplan_mgr->get_builds($tplan_id, testplan::ACTIVE_BUILDS)); + if (! is_null($buildSet)) { + + $safe_platform = intval($filters->setting_platform); + if ($safe_platform > 0) { + tLog( + basename(__FILE__) . __FUNCTION__ . + ':: $tplan_mgr->getHitsSameStatusFullOnPlatform', 'DEBUG'); + $hits = $tplan_mgr->getHitsSameStatusFullOnPlatform($tplan_id, + $safe_platform, (array) $filters->filter_result_result, + $buildSet); + } else { + tLog( + basename(__FILE__) . __FUNCTION__ . + ':: $tplan_mgr->getHitsSameStatusFullALOP', 'DEBUG'); + + $hits = $tplan_mgr->getHitsSameStatusFullALOP($tplan_id, + (array) $filters->filter_result_result, $buildSet); + } + + if (is_null($hits)) { + $tcase_set = array(); + } else { + helper_filter_cleanup($tcase_set, $hits); + unset($hits); + } + } + return $tcase_set; +} + +/** + * used by filter options: + * result on specific build + * result on current build + * + * + * @param + * object &$tplan_mgr reference to test plan manager object + * @param + * array &$tcase_set reference to test case set to filter + * @param integer $tplan_id + * ID of test plan + * @param array $filters + * filters to apply to test case set + * + * @return array new tcase_set + */ +function filter_by_status_for_build(&$tplan_mgr, &$tcase_set, $tplan_id, + $filters) +{ + $safe_platform = intval($filters->setting_platform); + $safe_build = intval($filters->filter_result_build); + if ($safe_platform > 0) { + tLog(__FUNCTION__ . ':: $tplan_mgr->getHitsStatusSetOnBuildPlatform', + 'DEBUG'); + $hits = $tplan_mgr->getHitsStatusSetOnBuildPlatform($tplan_id, + $safe_platform, $safe_build, (array) $filters->filter_result_result); + } else { + tLog(__FUNCTION__ . ':: $tplan_mgr->getHitsStatusSetOnBuildALOP', + 'DEBUG'); + $hits = $tplan_mgr->getHitsStatusSetOnBuildALOP($tplan_id, $safe_build, + (array) $filters->filter_result_result); + } + + if (is_null($hits)) { + $tcase_set = array(); + } else { + helper_filter_cleanup($tcase_set, $hits); + } + + return $tcase_set; +} + +/** + * filter testcases by the result of their latest execution + * + * CAN NOT BE USED FOR NOT RUN because Not run is not saved on DB + * + * @param + * object &$db reference to database handler + * @param + * object &$tplan_mgr reference to test plan manager object + * @param + * array &$tcase_set reference to test case set to filter + * @param integer $tplan_id + * ID of test plan + * @param array $filters + * filters to apply to test case set + * @return array new tcase_set + */ +function filter_by_status_for_latest_execution(&$tplan_mgr, &$tcase_set, + $tplan_id, $filters) +{ + $safe_tplan = intval($tplan_id); + $safe_platform = intval($filters->setting_platform); + + if ($safe_platform > 0) { + $hits = $tplan_mgr->getHitsStatusSetOnLatestExecOnPlatform($safe_tplan, + $safe_platform, (array) $filters->filter_result_result); + } else { + $hits = $tplan_mgr->getHitsStatusSetOnLatestExecALOP($safe_tplan, + (array) $filters->filter_result_result); + } + + if (is_null($hits)) { + $tcase_set = array(); + } else { + helper_filter_cleanup($tcase_set, $hits); + } + + return $tcase_set; +} + +/** + * + * @param + * object &$tplan_mgr reference to test plan manager object + * @param + * array &$tcase_set reference to test case set to filter + * @param integer $tplan_id + * ID of test plan + * @param array $filters + * filters to apply to test case set + * @return array new tcase_set + */ +function filter_not_run_for_any_build(&$tplan_mgr, &$tcase_set, $tplan_id, + $filters) +{ + $safe_platform = intval($filters->setting_platform); + if ($safe_platform > 0) { + $hits = $tplan_mgr->getHitsNotRunPartialOnPlatform($tplan_id, + intval($filters->setting_platform)); + } else { + $hits = $tplan_mgr->getHitsNotRunPartialALOP($tplan_id); + } + + if (is_null($hits)) { + $tcase_set = array(); + } else { + helper_filter_cleanup($tcase_set, $hits); + } + + return $tcase_set; +} + +/** + * generate array with Keywords for a filter + */ +function buildKeywordsFilter($keywordsId, &$guiObj) +{ + $keywordsFilter = null; + + if (! is_null($keywordsId)) { + $items = array_flip((array) $keywordsId); + if (! isset($items[0])) { + $keywordsFilter = new stdClass(); + $keywordsFilter->items = $keywordsId; + $keywordsFilter->type = isset($guiObj->keywordsFilterTypes) ? $guiObj->keywordsFilterTypes->selected : 'OR'; + } + } + + return $keywordsFilter; +} + +/** + * generate object with test case execution type for a filter + */ +function buildExecTypeFilter($execTypeSet) +{ + $itemsFilter = null; + + if (! is_null($execTypeSet)) { + $items = array_flip((array) $execTypeSet); + if (! isset($items[0])) { + $itemsFilter = new stdClass(); + $itemsFilter->items = $execTypeSet; + } + } + + return $itemsFilter; +} + +/** + * generate object with test case importance for a filter + */ +function buildImportanceFilter($importance) +{ + $itemsFilter = null; + + if (! is_null($importance)) { + $items = array_flip((array) $importance); + if (! isset($items[0])) { + $itemsFilter = new stdClass(); + $itemsFilter->items = $importance; + } + } + + return $itemsFilter; +} + +/** + * Generate the necessary data object for the filtered requirement specification tree. + * + * @author Andreas Simon + * @param Database $db + * reference to database handler object + * @param testproject $testproject_mgr + * reference to testproject manager object + * @param int $testproject_id + * ID of the project for which the tree shall be generated + * @param string $testproject_name + * Name of the test project + * @param array $filters + * Filter settings which shall be applied to the tree, possible values are: + * 'filter_doc_id', + * 'filter_title', + * 'filter_status', + * 'filter_type', + * 'filter_spec_type', + * 'filter_coverage', + * 'filter_relation', + * 'filter_tc_id', + * 'filter_custom_fields' + * @param array $options + * Further options which shall be applied on generating the tree + * @return stdClass $treeMenu object with which ExtJS can generate the graphical tree + */ +function generate_reqspec_tree(&$db, &$testproject_mgr, $testproject_id, + $testproject_name, $filters = null, $options = null) +{ + $tree_manager = &$testproject_mgr->tree_manager; + + $map_nodetype_id = $tree_manager->get_available_node_types(); + $map_id_nodetype = array_flip($map_nodetype_id); + + $my = array(); + + $my['options'] = array( + 'for_printing' => 0, + 'exclude_branches' => null, + 'recursive' => true, + 'order_cfg' => array( + 'type' => 'spec_order' + ) + ); + + $my['filters'] = array( + 'exclude_node_types' => array( + 'testplan' => 'exclude me', + 'testsuite' => 'exclude me', + 'testcase' => 'exclude me', + 'requirement_spec_revision' => 'exclude me' + ), + 'exclude_children_of' => array( + 'testcase' => 'exclude my children', + 'requirement' => 'exclude my children', + 'testsuite' => 'exclude my children' + ), + 'filter_doc_id' => null, + 'filter_title' => null, + 'filter_status' => null, + 'filter_type' => null, + 'filter_spec_type' => null, + 'filter_coverage' => null, + 'filter_relation' => null, + 'filter_tc_id' => null, + 'filter_custom_fields' => null + ); + + // merge with given parameters + $my['options'] = array_merge($my['options'], (array) $options); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $req_spec = $tree_manager->get_subtree($testproject_id, $my['filters'], + $my['options']); + + $req_spec['name'] = $testproject_name; + $req_spec['id'] = $testproject_id; + $req_spec['node_type_id'] = $map_nodetype_id['testproject']; + + $filtered_map = get_filtered_req_map($db, $testproject_id, $testproject_mgr, + $my['filters']); + + $level = 1; + $req_spec = prepare_reqspec_treenode($db, $level, $req_spec, $filtered_map, + $map_id_nodetype, $map_nodetype_id, $my['filters'], $my['options']); + + $menustring = null; + $treeMenu = new stdClass(); + $treeMenu->rootnode = new stdClass(); + $treeMenu->rootnode->total_req_count = $req_spec['total_req_count']; + $treeMenu->rootnode->name = $req_spec['name']; + $treeMenu->rootnode->id = $req_spec['id']; + $treeMenu->rootnode->leaf = isset($req_spec['leaf']) ? $req_spec['leaf'] : false; + $treeMenu->rootnode->position = $req_spec['position']; + $treeMenu->rootnode->href = $req_spec['href']; + + // replace key ('childNodes') to 'children' + if (isset($req_spec['childNodes'])) { + $menustring = str_ireplace('childNodes', 'children', + json_encode($req_spec['childNodes'])); + } + + if (! is_null($menustring)) { + $menustring = str_ireplace( + array( + ',"' . REMOVEME . '"', + '"' . REMOVEME . '",' + ), array( + '', + '' + ), $menustring); + + $menustring = str_ireplace( + array( + ':' . REMOVEME, + '"' . REMOVEME . '"' + ), array( + ':[]', + '' + ), $menustring); + } + $treeMenu->menustring = $menustring; + + return $treeMenu; +} + +/** + * Generate the necessary data object for the filtered requirement specification tree. + * + * @author Andreas Simon + * @param Database $db + * reference to database handler object + * @param testproject $testproject_mgr + * reference to testproject manager object + * @param int $testproject_id + * ID of the project for which the tree shall be generated + * @param string $testproject_name + * Name of the test project + * @param array $filters + * Filter settings which shall be applied to the tree, possible values are: + * 'filter_doc_id', + * 'filter_title', + * 'filter_status', + * 'filter_type', + * 'filter_spec_type', + * 'filter_coverage', + * 'filter_relation', + * 'filter_tc_id', + * 'filter_custom_fields' + * @param array $options + * Further options which shall be applied on generating the tree + * @return stdClass $treeMenu object with which ExtJS can generate the graphical tree + */ +function generateTestReqCoverageTree(&$db, $tproject_id, $tproject_name, + $filters = null, $options = null) +{ + $tproject_mgr = new testproject($db); + $tree_manager = &$tproject_mgr->tree_manager; + + $map_nodetype_id = $tree_manager->get_available_node_types(); + $map_id_nodetype = array_flip($map_nodetype_id); + + $my = array(); + + $my['options'] = array( + 'for_printing' => 0, + 'exclude_branches' => null, + 'recursive' => true, + 'order_cfg' => array( + 'type' => 'spec_order' + ) + ); + + $my['filters'] = array( + 'exclude_node_types' => array( + 'testplan' => 'exclude me', + 'testsuite' => 'exclude me', + 'testcase' => 'exclude me', + 'requirement_spec_revision' => 'exclude me' + ), + 'exclude_children_of' => array( + 'testcase' => 'exclude my children', + 'requirement' => 'exclude my children', + 'testsuite' => 'exclude my children' + ), + 'filter_doc_id' => null, + 'filter_title' => null, + 'filter_status' => null, + 'filter_type' => null, + 'filter_spec_type' => null, + 'filter_coverage' => null, + 'filter_relation' => null, + 'filter_tc_id' => null, + 'filter_custom_fields' => null + ); + + // merge with given parameters + $my['options'] = array_merge($my['options'], (array) $options); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $req_spec = $tree_manager->get_subtree($tproject_id, $my['filters'], + $my['options']); + + $req_spec['name'] = $tproject_name; + $req_spec['id'] = $tproject_id; + $req_spec['node_type_id'] = $map_nodetype_id['testproject']; + + $filtered_map = get_filtered_req_map($db, $tproject_id, $tproject_mgr, + $my['filters']); + + $level = 1; + $req_spec = prepare_reqspeccoverage_treenode($db, $level, $req_spec, + $filtered_map, $map_id_nodetype, $map_nodetype_id, $my['filters'], + $my['options']); + + $menustring = null; + $treeMenu = new stdClass(); + $treeMenu->rootnode = new stdClass(); + $treeMenu->rootnode->total_req_count = $req_spec['total_req_count']; + $treeMenu->rootnode->name = $req_spec['name']; + $treeMenu->rootnode->id = $req_spec['id']; + $treeMenu->rootnode->leaf = isset($req_spec['leaf']) ? $req_spec['leaf'] : false; + $treeMenu->rootnode->position = $req_spec['position']; + $treeMenu->rootnode->href = $req_spec['href']; + + // replace key ('childNodes') to 'children' + if (isset($req_spec['childNodes'])) { + $menustring = str_ireplace('childNodes', 'children', + json_encode($req_spec['childNodes'])); + } + + if (! is_null($menustring)) { + // delete null elements for Ext JS + $menustring = str_ireplace(array( + ':null', + ',null', + 'null,', + 'null' + ), array( + ':[]', + '', + '', + '' + ), $menustring); + } + $treeMenu->menustring = $menustring; + + return $treeMenu; +} + +/** + * Generate a filtered map with all fitting requirements in it. + * + * @author Andreas Simon + * @param Database $db + * reference to database handler object + * @param int $testproject_id + * ID of the project for which the tree shall be generated + * @param testproject $testproject_mgr + * reference to testproject manager object + * @param array $filters + * Filter settings which shall be applied to the tree + * @param array $options + * Further options which shall be applied on generating the tree + * @return array $filtered_map map with all fitting requirements + * + * @internal revisions + * @since 1.9.4 + * 20120827 - franciscom - TICKET 5178: Requirement Specification->"Req. Spec. Type" Filter-> KO + * + */ +function get_filtered_req_map(&$db, $testproject_id, &$testproject_mgr, $filters) +{ + $tables = tlObjectWithDB::getDBTables( + array( + 'nodes_hierarchy', + 'requirements', + 'req_specs', + 'req_relations', + 'req_versions', + 'req_coverage', + 'tcversions', + 'cfield_design_values', + 'req_specs_revisions' + )); + + $sql = " SELECT R.id, R.req_doc_id, NH_R.name AS title, R.srs_id, " . + " RS.doc_id AS req_spec_doc_id, NH_RS.name AS req_spec_title, " . + " RV.version, RV.id AS version_id, NH_R.node_order, " . + " RV.expected_coverage, RV.status, RV.type, RV.active, RV.is_open " . + " FROM {$tables['requirements']} R " . + " JOIN {$tables['nodes_hierarchy']} NH_R ON NH_R.id = R.id " . + " JOIN {$tables['nodes_hierarchy']} NH_RV ON NH_RV.parent_id = NH_R.id " . + " JOIN {$tables['req_versions']} RV ON RV.id = NH_RV.id " . + " JOIN {$tables['req_specs']} RS ON RS.id = R.srs_id " . + " JOIN {$tables['req_specs_revisions']} RSPECREV ON RSPECREV.parent_id = RS.id " . + " JOIN {$tables['nodes_hierarchy']} NH_RS ON NH_RS.id = RS.id "; + + if (isset($filters['filter_relation'])) { + $sql .= " JOIN {$tables['req_relations']} RR " . + " ON (RR.destination_id = R.id OR RR.source_id = R.id) "; + } + + if (isset($filters['filter_tc_id'])) { + $tc_cfg = config_get('testcase_cfg'); + $tc_prefix = $testproject_mgr->getTestCasePrefix($testproject_id); + $tc_prefix .= $tc_cfg->glue_character; + + $tc_ext_id = $db->prepare_int( + str_replace($tc_prefix, '', $filters['filter_tc_id'])); + + $sql .= " JOIN {$tables['req_coverage']} RC ON RC.req_id = R.id " . + " JOIN {$tables['nodes_hierarchy']} NH_T ON NH_T.id = RC.testcase_id " . + " JOIN {$tables['nodes_hierarchy']} NH_TV on NH_TV.parent_id = NH_T.id " . + " JOIN {$tables['tcversions']} TV ON TV.id = NH_TV.id " . + " AND TV.tc_external_id = {$tc_ext_id} "; + } + + if (isset($filters['filter_custom_fields'])) { + $suffix = 1; + + foreach ($filters['filter_custom_fields'] as $cf_id => $cf_value) { + $sql .= " JOIN {$tables['cfield_design_values']} CF{$suffix} " . + " ON CF{$suffix}.node_id = RV.id " . + " AND CF{$suffix}.field_id = {$cf_id} "; + + // single value or array? + if (is_array($cf_value)) { + $sql .= " AND ( "; + $count = 1; + foreach ($cf_value as $value) { + if ($count > 1) { + $sql .= " OR "; + } + $sql .= " CF{$suffix}.value LIKE '%{$value}%' "; + $count ++; + } + $sql .= " ) "; + } else { + $sql .= " AND CF{$suffix}.value LIKE '%{$cf_value}%' "; + } + + $suffix ++; + } + } + + $sql .= " WHERE RS.testproject_id = {$testproject_id} "; + + if (isset($filters['filter_doc_id'])) { + $doc_id = $db->prepare_string($filters['filter_doc_id']); + $sql .= " AND R.req_doc_id LIKE '%{$doc_id}%' OR RS.doc_id LIKE '%{$doc_id}%' "; + } + + if (isset($filters['filter_title'])) { + $title = $db->prepare_string($filters['filter_title']); + $sql .= " AND NH_R.name LIKE '%{$title}%' "; + } + + if (isset($filters['filter_coverage'])) { + $coverage = $db->prepare_int($filters['filter_coverage']); + $sql .= " AND expected_coverage = {$coverage} "; + } + + if (isset($filters['filter_status'])) { + $statuses = (array) $filters['filter_status']; + foreach ($statuses as $key => $status) { + $statuses[$key] = "'" . $db->prepare_string($status) . "'"; + } + $statuses = implode(",", $statuses); + $sql .= " AND RV.status IN ({$statuses}) "; + } + + if (isset($filters['filter_type'])) { + $types = (array) $filters['filter_type']; + + foreach ($types as $key => $type) { + $types[$key] = $db->prepare_string($type); + } + $types = implode("','", $types); + $sql .= " AND RV.type IN ('{$types}') "; + } + + if (isset($filters['filter_spec_type'])) { + $spec_types = (array) $filters['filter_spec_type']; + + foreach ($spec_types as $key => $type) { + $spec_types[$key] = $db->prepare_string($type); + } + $spec_types = implode("','", $spec_types); + $sql .= " AND RSPECREV.type IN ('{$spec_types}') "; + } + + if (isset($filters['filter_relation'])) { + $sql .= " AND ( "; + $count = 1; + foreach ($filters['filter_relation'] as $rel_filter) { + $relation_info = explode('_', $rel_filter); + $relation_type = $db->prepare_int($relation_info[0]); + $relation_side = isset($relation_info[1]) ? $relation_info[1] : null; + $sql .= ($count == 1) ? " ( " : " OR ( "; + + if ($relation_side == "destination") { + $sql .= " RR.destination_id = R.id "; + } elseif ($relation_side == "source") { + $sql .= " RR.source_id = R.id "; + } else { + $sql .= " (RR.destination_id = R.id OR RR.source_id = R.id) "; + } + + $sql .= " AND RR.relation_type = {$relation_type} ) "; + $count ++; + } + + $sql .= " ) "; + } + + $sql .= " ORDER BY RV.version DESC "; + return $db->fetchRowsIntoMap($sql, 'id'); +} + +/** + * Prepares nodes for the filtered requirement tree. + * Filters out those nodes which are not in the given map and counts the remaining subnodes. + * + * @author Andreas Simn + * @param Database $db + * reference to database handler object + * @param int $level + * gets increased by one for each sublevel in recursion + * @param array $node + * the tree structure to traverse + * @param array $filtered_map + * a map of filtered requirements, req that are not in this map will be deleted + * @param array $map_id_nodetype + * array with node type IDs as keys, node type descriptions as values + * @param array $map_nodetype_id + * array with node type descriptions as keys, node type IDs as values + * @param array $filters + * @param array $options + * @return array tree structure after filtering out unneeded nodes + */ +function prepare_reqspec_treenode(&$db, $level, &$node, &$filtered_map, + &$map_id_nodetype, &$map_nodetype_id, &$filters, &$options) +{ + $child_req_count = 0; + if (isset($node['childNodes']) && is_array($node['childNodes'])) { + // node has childs, must be a specification (or testproject) + foreach ($node['childNodes'] as $key => $childnode) { + $current_childnode = &$node['childNodes'][$key]; + $current_childnode = prepare_reqspec_treenode($db, $level + 1, + $current_childnode, $filtered_map, $map_id_nodetype, + $map_nodetype_id, $filters, $options); + + // now count childnodes that have not been deleted and are requirements + if (! is_null($current_childnode) && $current_childnode != REMOVEME) { + switch ($current_childnode['node_type_id']) { + case $map_nodetype_id['requirement']: + $child_req_count ++; + break; + + case $map_nodetype_id['requirement_spec']: + $child_req_count += $current_childnode['child_req_count']; + break; + } + } + } + } + + $node_type = $map_id_nodetype[$node['node_type_id']]; + + $delete_node = false; + switch ($node_type) { + case 'testproject': + $node['total_req_count'] = $child_req_count; + break; + + case 'requirement_spec': + // add requirement count + // delete empty specs + $node['child_req_count'] = $child_req_count; + $delete_node = ! $child_req_count; + break; + + case 'requirement': + // delete node from tree if it is not in $filtered_map + $delete_node = (is_null($filtered_map) || + ! array_key_exists($node['id'], $filtered_map)); + break; + } + + if ($delete_node) { + unset($node); + $node = REMOVEME; + } else { + $node = render_reqspec_treenode($db, $node, $filtered_map, + $map_id_nodetype); + } + + return $node; +} + +/** + * Prepares nodes for the filtered requirement tree. + * Filters out those nodes which are not in the given map and counts the remaining subnodes. + * + * @author Andreas Simn + * @param Database $db + * reference to database handler object + * @param int $level + * gets increased by one for each sublevel in recursion + * @param array $node + * the tree structure to traverse + * @param array $filtered_map + * a map of filtered requirements, req that are not in this map will be deleted + * @param array $map_id_nodetype + * array with node type IDs as keys, node type descriptions as values + * @param array $map_nodetype_id + * array with node type descriptions as keys, node type IDs as values + * @param array $filters + * @param array $options + * @return array tree structure after filtering out unneeded nodes + */ +function prepare_reqspeccoverage_treenode(&$db, $level, &$node, &$filtered_map, + &$map_id_nodetype, &$map_nodetype_id, &$filters, &$options) +{ + $child_req_count = 0; + + if (isset($node['childNodes']) && is_array($node['childNodes'])) { + // node has childs, must be a specification (or testproject) + foreach ($node['childNodes'] as $key => $childnode) { + $current_childnode = &$node['childNodes'][$key]; + $current_childnode = prepare_reqspeccoverage_treenode($db, + $level + 1, $current_childnode, $filtered_map, $map_id_nodetype, + $map_nodetype_id, $filters, $options); + + // now count childnodes that have not been deleted and are requirements + if (! is_null($current_childnode)) { + switch ($current_childnode['node_type_id']) { + case $map_nodetype_id['requirement']: + $child_req_count ++; + break; + + case $map_nodetype_id['requirement_spec']: + $child_req_count += $current_childnode['child_req_count']; + break; + } + } + } + } + + $node_type = $map_id_nodetype[$node['node_type_id']]; + + $delete_node = false; + + switch ($node_type) { + case 'testproject': + $node['total_req_count'] = $child_req_count; + break; + + case 'requirement_spec': + // add requirement count + $node['child_req_count'] = $child_req_count; + // delete empty specs + if (! $child_req_count) { + $delete_node = true; + } + break; + + case 'requirement': + // delete node from tree if it is not in $filtered_map + if (is_null($filtered_map) || + ! array_key_exists($node['id'], $filtered_map)) { + $delete_node = true; + } + break; + } + + if ($delete_node) { + unset($node); + $node = null; + } else { + $node = render_reqspeccoverage_treenode($db, $node, $filtered_map, + $map_id_nodetype); + } + + return $node; +} + +/** + * Prepares nodes in the filtered requirement tree for displaying with ExtJS. + * + * @author Andreas Simon + * @param Database $db + * reference to database handler object + * @param array $node + * the object to prepare + * @param array $filtered_map + * a map of filtered requirements, req that are not in this map will be deleted + * @param array $map_id_nodetype + * array with node type IDs as keys, node type descriptions as values + * @return array tree object with all needed data for ExtJS tree + */ +function render_reqspec_treenode(&$db, &$node, &$filtered_map, &$map_id_nodetype) +{ + static $js_functions; + static $forbidden_parents; + + if (! $js_functions) { + $js_functions = array( + 'testproject' => 'TPROJECT_REQ_SPEC_MGMT', + 'requirement_spec' => 'REQ_SPEC_MGMT', + 'requirement' => 'REQ_MGMT' + ); + + $req_cfg = config_get('req_cfg'); + $forbidden_parents['testproject'] = 'none'; + $forbidden_parents['requirement'] = 'testproject'; + + // Hmm is ok ? (see next lines, may be it's time to remove this code) + $forbidden_parents['requirement_spec'] = 'requirement_spec'; + if ($req_cfg->child_requirements_mgmt) { + $forbidden_parents['requirement_spec'] = 'none'; + } + } + + $node_type = $map_id_nodetype[$node['node_type_id']]; + $node_id = $node['id']; + + $node['href'] = "javascript:{$js_functions[$node_type]}({$node_id});"; + $node['text'] = htmlspecialchars($node['name']); + $node['leaf'] = false; // will be set to true later for requirement nodes + $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; + $node['cls'] = 'folder'; + + // custom Properties that will be accessed by EXT-JS using node.attributes + $node['testlink_node_type'] = $node_type; + $node['forbidden_parent'] = $forbidden_parents[$node_type]; + $node['testlink_node_name'] = $node['text']; + + switch ($node_type) { + case 'testproject': + break; + + case 'requirement_spec': + // get doc id from filtered array, it's already stored in there + $doc_id = ''; + foreach ($node['childNodes'] as $child) { + if (is_array($child)) { + $child_id = $child['id']; + if (isset($filtered_map[$child_id])) { + $doc_id = htmlspecialchars( + $filtered_map[$child_id]['req_spec_doc_id']); + } + break; // only need to get one child for this + } + } + // BUGID 3765: load doc ID with if this req spec has no direct req child nodes. + // Reason: in these cases we do not have a parent doc ID in $filtered_map + if ($doc_id == '') { + static $req_spec_mgr = null; + if (! $req_spec_mgr) { + $req_spec_mgr = new requirement_spec_mgr($db); + } + $tmp_spec = $req_spec_mgr->get_by_id($node_id); + $doc_id = $tmp_spec['doc_id']; + unset($tmp_spec); + } + + $count = $node['child_req_count']; + $node['text'] = "{$doc_id}:{$node['text']} ({$count})"; + break; + + case 'requirement': + $node['leaf'] = true; + $doc_id = htmlspecialchars($filtered_map[$node_id]['req_doc_id']); + $node['text'] = "{$doc_id}:{$node['text']}"; + break; + } + + return $node; +} + +/** + * Prepares nodes in the filtered requirement tree for displaying with ExtJS. + * + * @author Andreas Simon + * @param Database $db + * reference to database handler object + * @param array $node + * the object to prepare + * @param array $filtered_map + * a map of filtered requirements, req that are not in this map will be deleted + * @param array $map_id_nodetype + * array with node type IDs as keys, node type descriptions as values + * @return array tree object with all needed data for ExtJS tree + */ +function render_reqspeccoverage_treenode(&$db, &$node, &$filtered_map, + &$map_id_nodetype) +{ + static $js_functions; + static $forbidden_parents; + + if (! $js_functions) { + $js_functions = array( + 'testproject' => 'EP', + 'requirement_spec' => 'ERS', + 'requirement' => 'ER' + ); + + $req_cfg = config_get('req_cfg'); + $forbidden_parents['testproject'] = 'none'; + $forbidden_parents['requirement'] = 'testproject'; + + // Hmm is ok ? (see next lines, may be it's time to remove this code) + $forbidden_parents['requirement_spec'] = 'requirement_spec'; + if ($req_cfg->child_requirements_mgmt) { + $forbidden_parents['requirement_spec'] = 'none'; + } + } + + $node_type = $map_id_nodetype[$node['node_type_id']]; + $node_id = $node['id']; + + $node['href'] = "javascript:{$js_functions[$node_type]}({$node_id});"; + $node['text'] = htmlspecialchars($node['name']); + $node['leaf'] = false; // will be set to true later for requirement nodes + $node['position'] = isset($node['node_order']) ? $node['node_order'] : 0; + $node['cls'] = 'folder'; + + // custom Properties that will be accessed by EXT-JS using node.attributes + $node['testlink_node_type'] = $node_type; + $node['forbidden_parent'] = $forbidden_parents[$node_type]; + $node['testlink_node_name'] = $node['text']; + + switch ($node_type) { + case 'testproject': + break; + + case 'requirement_spec': + // get doc id from filtered array, it's already stored in there + $doc_id = ''; + foreach ($node['childNodes'] as $child) { + if (! is_null($child)) { + $child_id = $child['id']; + if (isset($filtered_map[$child_id])) { + $doc_id = htmlspecialchars( + $filtered_map[$child_id]['req_spec_doc_id']); + } + break; // only need to get one child for this + } + } + // BUGID 3765: load doc ID with if this req spec has no direct req child nodes. + // Reason: in these cases we do not have a parent doc ID in $filtered_map + if ($doc_id == '') { + static $req_spec_mgr = null; + if (! $req_spec_mgr) { + $req_spec_mgr = new requirement_spec_mgr($db); + } + $tmp_spec = $req_spec_mgr->get_by_id($node_id); + $doc_id = $tmp_spec['doc_id']; + unset($tmp_spec); + } + + $count = $node['child_req_count']; + $node['text'] = "{$doc_id}:{$node['text']} ({$count})"; + break; + + case 'requirement': + $node['leaf'] = true; + $doc_id = htmlspecialchars($filtered_map[$node_id]['req_doc_id']); + $node['text'] = "{$doc_id}:{$node['text']}"; + break; + } + + return $node; +} + +/** + * + * @todo delete if necessary + * @deprecated + */ +function apply_status_filters($tplan_id, &$items, &$fobj, &$tplan_mgr, + $statusCfg) +{ + $fm = config_get('execution_filter_methods'); + $methods = $fm['status_code']; + + $ffn = array( + $methods['any_build'] => 'filterStatusSetAtLeastOneOfActiveBuilds', + $methods['all_builds'] => 'filterStatusSetAllActiveBuilds', + $methods['specific_build'] => 'filter_by_status_for_build', + $methods['current_build'] => 'filter_by_status_for_build', + $methods['latest_execution'] => 'filter_by_status_for_latest_execution' + ); + + $f_method = isset($fobj->filter_result_method) ? $fobj->filter_result_method : null; + $f_result = isset($fobj->filter_result_result) ? $fobj->filter_result_result : null; + $f_result = (array) $f_result; + + // if "any" was selected as filtering status, don't filter by status + if (in_array($statusCfg['all'], $f_result)) { + $f_result = null; + } + + if (! is_null($f_method) && isset($ffn[$f_method])) { + // special case: + // filtering by "not run" status in any build + // filtering by "not run" status in specific + // + // we change filter function + if (in_array($statusCfg['not_run'], $f_result)) { + $ffn[$methods['any_build']] = 'filter_not_run_for_any_build'; + $ffn[$methods['specific_build']] = 'filter_by_status_for_build'; + } + + // special case: when filtering by "current build", we set the build to filter with + // to the build chosen in settings instead of the one in filters + if ($f_method == $methods['current_build']) { + $fobj->filter_result_build = $fobj->setting_build; + } + + $items = $ffn[$f_method]($tplan_mgr, $items, $tplan_id, $fobj); + } + return $items; +} + +/** + */ +function update_status_for_colors(&$dbHandler, &$items, $context, $statusCfg) +{ + $tables = tlObject::getDBTables(array( + 'executions', + 'nodes_hierarchy' + )); + $dummy = current($items); + $key2scan = array_keys($items); + $keySet = null; + foreach ($key2scan as $fx) { + $keySet[] = $items[$fx]['tcversion_id']; + } + + extract($context); // magic to create single variables + + $sql = " SELECT E.status, NH_TCV.parent_id AS tcase_id " . + " FROM {$tables['executions']} E " . + " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.id = E.tcversion_id " . + " JOIN " . " ( SELECT MAX(E2.id) AS last_exec_id " . + " FROM {$tables['executions']} E2 " . + " WHERE testplan_id = {$tplanID} " . " AND tcversion_id IN (" . + implode(',', $keySet) . ") " . + " AND platform_id = {$dummy['platform_id']} " . + " AND build_id = {$buildID} " . + " GROUP BY testplan_id,tcversion_id,platform_id,build_id ) AS EY " . + " ON E.id = EY.last_exec_id "; + + $rs = $dbHandler->fetchRowsIntoMap($sql, 'tcase_id'); + + if (! is_null($rs)) { + foreach ($key2scan as $tcase_id) { + $rr = isset($rs[$tcase_id]['status']) && + ! is_null($rs[$tcase_id]['status']) ? $rs[$tcase_id]['status'] : $statusCfg['not_run']; + + if ($rr != $items[$tcase_id]['exec_status']) { + $items[$tcase_id]['exec_status'] = $rr; + } + } + } +} + +/** + * Used when ['viewType'] == 'testSpecTree' + */ +function generateTestSpecTreeNew(&$db, $tproject_id, $tproject_name, $linkto, + $filters = null, $options = null) +{ + $chronos[] = microtime(true); + + $my = array(); + + $my['options'] = array( + 'forPrinting' => 0, + 'hideTestCases' => 0, + 'tc_action_enabled' => 1, + 'viewType' => 'testSpecTree' + ); + + $my['filters'] = array( + 'keywords' => null, + 'plaftorms' => null, + 'testplan' => null + ); + + $my['options'] = array_merge($my['options'], (array) $options); + $my['options']['showTestCaseID'] = config_get('treemenu_show_testcase_id'); + + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $treeMenu = new stdClass(); + $treeMenu->rootnode = null; + $treeMenu->menustring = ''; + + $glueChar = config_get('testcase_cfg')->glue_character; + $menustring = null; + + $tproject_mgr = new testproject($db); + $tree_manager = &$tproject_mgr->tree_manager; + + $hash_descr_id = $tree_manager->get_available_node_types(); + $hash_id_descr = array_flip($hash_descr_id); + + $tcase_prefix = $tproject_mgr->getTestCasePrefix($tproject_id) . $glueChar; + $test_spec = getTestSpecTree($tproject_id, $tproject_mgr, $filters); + + // Added root node for test specification -> testproject + $test_spec['name'] = $tproject_name; + $test_spec['id'] = $tproject_id; + $test_spec['node_type_id'] = $hash_descr_id['testproject']; + + $map_node_tccount = array(); + $tc2show = null; + + if ($test_spec) { + if (isset($my['filters']['filter_custom_fields']) && + isset($test_spec['childNodes'])) { + $test_spec['childNodes'] = filter_by_cf_values($db, + $test_spec['childNodes'], $my['filters']['filter_custom_fields'], + $hash_descr_id); + } + + $pnFilters = array( + 'keywords' => $my['filters']['filter_keywords'], + 'keywords_filter_type' => $my['filters']['filter_keywords_filter_type'], + 'platforms' => $my['filters']['filter_platforms'] + ); + + $pnOptions = array( + 'hideTestCases' => $my['options']['hideTestCases'], + 'ignoreInactiveTestCases' => $my['options']['ignore_inactive_testcases'], + 'ignoreActiveTestCases' => $my['options']['ignore_active_testcases'] + ); + + // Important/CRITIC: + // prepareTestSpecNode() will make changes + // to $test_spec like filtering by test case keywords. + $testcase_counters = prepareTestSpecNode($db, $tproject_mgr, + $tproject_id, $test_spec, $map_node_tccount, $pnFilters, $pnOptions); + + if (is_null($test_spec)) { + $test_spec['name'] = $tproject_name; + $test_spec['id'] = $tproject_id; + $test_spec['node_type_id'] = $hash_descr_id['testproject']; + } + + foreach ($testcase_counters as $key => $value) { + $test_spec[$key] = $testcase_counters[$key]; + } + + $tc2show = renderTreeNode(1, $test_spec, $hash_id_descr, $linkto, + $tcase_prefix, $my['options']); + } + + $menustring = ''; + $treeMenu->rootnode = new stdClass(); + $treeMenu->rootnode->name = $test_spec['text']; + $treeMenu->rootnode->id = $test_spec['id']; + $treeMenu->rootnode->leaf = isset($test_spec['leaf']) ? $test_spec['leaf'] : false; + $treeMenu->rootnode->text = $test_spec['text']; + $treeMenu->rootnode->position = $test_spec['position']; + $treeMenu->rootnode->href = $test_spec['href']; + + // 20090328 - franciscom - BUGID 2299 + // More details about problem found on 20090308 and fixed IN WRONG WAY + // TPROJECT + // |______ TSA + // |__ TC1 + // |__ TC2 + // | + // |______ TSB + // |______ TSC + // + // Define Keyword K1,K2 + // + // NO TEST CASE HAS KEYWORD ASSIGNED + // Filter by K1 + // Tree will show root that spins Forever + // menustring before str_ireplace : [null,null] + // menustring AFTER [null] + // + // Now fixed. + // + // Some minor fix to do + // Il would be important exclude Top Level Test suites. + // + // + // 20090308 - franciscom + // Changed because found problem on: + // Test Specification tree when applying Keyword filter using a keyword NOT PRESENT + // in test cases => Tree root shows loading icon and spin never stops. + // + // Attention: do not know if in other situation this will generate a different bug + // + // + // Change key ('childNodes') to the one required by Ext JS tree. + if (isset($test_spec['childNodes'])) { + $menustring = str_ireplace('childNodes', 'children', + json_encode($test_spec['childNodes'])); + } + + if (! is_null($menustring)) { + // Remove null elements (Ext JS tree do not like it ). + // :null happens on -> "children":null,"text" that must become "children":[],"text" + // $menustring = str_ireplace(array(':null',',null','null,'),array(':[]','',''), $menustring); + // $menustring = str_ireplace(array(':null',',null','null,','null'),array(':[]','','',''), $menustring); + // $menustring = preg_replace('/,\s*"[^"]+":null|"[^"]+":null,?/', '', $menustring); + $menustring = str_ireplace( + array( + ':' . REMOVEME, + ',"' . REMOVEME . '"', + '"' . REMOVEME . '",' + ), array( + ':[]', + '', + '' + ), $menustring); + } + $treeMenu->menustring = $menustring; + + $tc2show = ! is_null($tc2show) ? explode(",", trim($tc2show, ",")) : null; + return array( + 'menu' => $treeMenu, + 'leaves' => $tc2show, + 'tree' => $test_spec + ); +} + +/** + * importance & status (workflow status) can be array + */ +function getTestSpecTree($tprojectID, &$tprojectMgr, &$fObj) +{ + $flt = array(); + $flt['exclude_branches'] = isset($fObj['filter_toplevel_testsuite']) && + is_array($fObj['filter_toplevel_testsuite']) ? $fObj['filter_toplevel_testsuite'] : null; + + $flt['testcase_name'] = null; + $flt['testcase_id'] = null; + $flt['execution_type'] = null; + $flt['importance'] = null; + $flt['status'] = null; + $flt['keywords'] = null; + $flt['platforms'] = null; + + if (isset($fObj['filter_testcase_name']) && + ! is_null($fObj['filter_testcase_name']) && + ($dummy = trim($fObj['filter_testcase_name'])) != '') { + $flt['testcase_name'] = $dummy; + } + + if (isset($fObj['filter_tc_id']) && ! is_null($fObj['filter_tc_id'])) { + $flt['testcase_id'] = intval($fObj['filter_tc_id']); + } + + if (isset($fObj['filter_execution_type']) && + ! is_null($fObj['filter_execution_type'])) { + $flt['execution_type'] = intval($fObj['filter_execution_type']); + } + + if (isset($fObj['filter_importance']) && + ! is_null($fObj['filter_importance'])) { + $xx = (array) $fObj['filter_importance']; + if ($xx[0] > 0) { + $flt['importance'] = $xx; + } + } + + if (isset($fObj['filter_workflow_status']) && + ! is_null($fObj['filter_workflow_status'])) { + $xx = (array) $fObj['filter_workflow_status']; + if ($xx[0] > 0) { + $flt['status'] = $xx; + } + } + + $piece = 'platforms'; + $full = 'filter_' . $piece; + if (isset($fObj[$full]) && ! is_null($fObj[$full])) { + $xx = (array) $fObj[$full]; + if ($xx[0] > 0) { + $flt[$piece] = $xx; + } + } + + $opt = array( + 'recursive' => true, + 'exclude_testcases' => false + ); + return $tprojectMgr->getTestSpec($tprojectID, $flt, $opt); +} + +/** + */ +function prepareTestSpecNode(&$db, &$tprojectMgr, $tprojectID, &$node, + &$map_node_tccount, $filters = null, $options = null) +{ + static $tables; + static $my; + static $filtersApplied; + static $decoding_info; + static $tcFilterByKeywords; + static $doFilterOn; + static $tcFilterByPlatforms; + + if (! $tables) { + $tables = tlObjectWithDB::getDBTables( + array( + 'tcversions', + 'nodes_hierarchy', + 'testplan_tcversions' + )); + $decoding_info = array( + 'node_id_descr' => array_flip( + $tprojectMgr->tree_manager->get_available_node_types()) + ); + $my = array(); + $my['options'] = array( + 'hideTestCases' => 0 + ); + $my['filters'] = array( + 'keywords' => null, + 'platforms' => null + ); + + $my['options'] = array_merge($my['options'], (array) $options); + $my['filters'] = array_merge($my['filters'], (array) $filters); + + $doFilterOn['keywords'] = ! is_null($my['filters']['keywords']) && + (intval($my['filters']['keywords']) > 0); + + if ($doFilterOn['keywords']) { + $tcFilterByKeywords = $tprojectMgr->getTCLatestVersionFilteredByKeywords( + $tprojectID, $my['filters']['keywords'], + $my['filters']['keywords_filter_type']); + + if (is_null($tcFilterByKeywords)) { + // tree will be empty + $node = null; + $tcase_counters['testcase_count'] = 0; + return $tcase_counters; + } + } + + $doFilterOn['platforms'] = ! is_null($my['filters']['platforms']) && + (intval($my['filters']['platforms']) > 0); + if ($doFilterOn['platforms']) { + $tcFilterByPlatforms = $tprojectMgr->getTCLatestVersionFilteredByPlatforms( + $tprojectID, $my['filters']['platforms']); + + if (is_null($tcFilterByPlatforms)) { + // tree will be empty + $node = null; + $tcase_counters['testcase_count'] = 0; + return $tcase_counters; + } + } + + // Critic for logic that prune empty branches + // TICKET 4353: added active/inactive filter + $filtersApplied = $doFilterOn['keywords'] || + $my['options']['ignoreInactiveTestCases'] || + $my['options']['ignoreActiveTestCases'] || $doFilterOn['platforms']; + } + + $tcase_counters['testcase_count'] = 0; + $node_type = isset($node['node_type_id']) ? $decoding_info['node_id_descr'][$node['node_type_id']] : null; + + if ($node_type == 'testcase') { + $remove_node = false; + + if ($my['options']['ignoreInactiveTestCases']) { + $sql = " SELECT COUNT(TCV.id) AS count_active_versions " . + " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . + " WHERE NH.parent_id=" . $node['id'] . + " AND NH.id = TCV.id AND TCV.active=1"; + $result = $db->exec_query($sql); + $row = $db->fetch_array($result); + if ($row['count_active_versions'] == 0) { + $remove_node = true; + } + } elseif ($my['options']['ignoreActiveTestCases']) { + $sql = " SELECT COUNT(TCV.id) AS count_active_versions " . + " FROM {$tables['tcversions']} TCV, {$tables['nodes_hierarchy']} NH " . + " WHERE NH.parent_id=" . $node['id'] . + " AND NH.id = TCV.id AND TCV.active=1"; + $result = $db->exec_query($sql); + $row = $db->fetch_array($result); + if ($row['count_active_versions'] != 0) { + $remove_node = true; + } + } + + if ($my['options']['hideTestCases'] || $remove_node || + ($doFilterOn['keywords'] && + ! isset($tcFilterByKeywords[$node['id']])) || + ($doFilterOn['platforms'] && + ! isset($tcFilterByPlatforms[$node['id']]))) { + $node = REMOVEME; + } else { + // needed to avoid problems when using json_encode with EXTJS + unset($node['childNodes']); + $node['leaf'] = true; + $tcase_counters['testcase_count'] = 1; + } + } // if($node_type == 'testcase') + + if (! is_null($node) && isset($node['childNodes']) && + is_array($node['childNodes'])) { + + // node has to be a Test Suite ? + $childNodes = &$node['childNodes']; + $childNodesQty = count($childNodes); + + for ($idx = 0; $idx < $childNodesQty; $idx ++) { + $current = &$childNodes[$idx]; + // I use set an element to null to filter out leaf menu items + if (is_null($current) || $current == REMOVEME) { + $childNodes[$idx] = REMOVEME; + continue; + } + + $counters_map = prepareTestSpecNode($db, $tprojectMgr, $tprojectID, + $current, $map_node_tccount); + + // 20120831 - + // to be analized carefully, because this can be solution + // to null issue with json and ext-js + if (is_null($current)) { + $childNodes[$idx] = REMOVEME; + } + + $tcase_counters['testcase_count'] += $counters_map['testcase_count']; + } + $node['testcase_count'] = $tcase_counters['testcase_count']; + + if (isset($node['id'])) { + $map_node_tccount[$node['id']] = array( + 'testcount' => $node['testcase_count'], + 'name' => $node['name'] + ); + } + + // node must be destroyed if empty had we have using filtering conditions + if ($filtersApplied && ! $tcase_counters['testcase_count'] && + ($node_type != 'testproject')) { + $node = null; + } + } elseif ($node_type == 'testsuite') { + // does this means is an empty test suite ??? - franciscom 20080328 + $map_node_tccount[$node['id']] = array( + 'testcount' => 0, + 'name' => $node['name'] + ); + + // If is an EMPTY Test suite and we have added filtering conditions, + // We will destroy it. + if ($filtersApplied) { + $node = null; + } + } + + return $tcase_counters; +} + +/** + */ +function helper_filter_cleanup(&$itemSet, $hits) +{ + $key2remove = null; + foreach ($itemSet as $tcase_id => $dummy) { + if (! isset($hits[$tcase_id])) { + $key2remove[] = $tcase_id; + } + } + if (! is_null($key2remove)) { + foreach ($key2remove as $key) { + unset($itemSet[$key]); + } + } +} ?> diff --git a/lib/functions/users.inc.php b/lib/functions/users.inc.php index 4e46f6c9da..3db8f9937a 100644 --- a/lib/functions/users.inc.php +++ b/lib/functions/users.inc.php @@ -1,467 +1,471 @@ - 'map_name_with_inactive_mark', 'order_by' => $gui_cfg->tprojects_combo_order_by); - $arrProducts = $tproject_mgr->get_accessible_for_user($id,$opt); - - $tproject_cookie = config_get('cookie')->testProjectMemory . $id; - if (isset($_COOKIE[$tproject_cookie])) { - if (isset($arrProducts[$_COOKIE[$tproject_cookie]]) - && $arrProducts[$_COOKIE[$tproject_cookie]]) { - $_SESSION['testprojectID'] = $_COOKIE[$tproject_cookie]; - tLog('Cookie: {$tproject_cookie}='.$_SESSION['testprojectID']); - } - } - if (!$_SESSION['testprojectID']) { - $tpID = null; - if (sizeof($arrProducts)) - { - $tpID = key($arrProducts); - } - $_SESSION['testprojectID'] = $tpID; - } - // Validation is done in navBar.php - $tplan_cookie = 'TL_lastTestPlanForUserID_' . $id; - if (isset($_COOKIE[$tplan_cookie])) - { - $_SESSION['testplanID'] = $_COOKIE[$tplan_cookie]; - tLog("Cookie: {$tplan_cookie}=".$_SESSION['testplanID']); - } - - return 1; -} - -/* - function: getUsersForHtmlOptions - - args: db: reference to db object - [whereClause]: - [add_blank_option]: - [active_filter]: - - returns: map - - rev : -*/ -function getUsersForHtmlOptions(&$db,$whereClause = null,$additional_users = null, - $active_filter = null,$users = null, $opt=null) -{ - $users_map = null; - if (!$users) - { - $sqlWhere = $whereClause; - if(!is_null($active_filter)) - { - $whereClause .= ' AND active =' . ($active_filter > 0 ? 1 : 0) . ' '; - } - $users = tlUser::getAll($db,$sqlWhere,"id",null,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); - } - return buildUserMap($users,!is_null($additional_users),$additional_users,$opt); -} - -/* - function: buildUserMap - - args: - $users: map of user objects - [add_options]: default false. - true, elements present on additional_options arguments - will be will added to result map. - - [additional_options]: default null - map with key=user id, value=verbose description - - returns: map ready to be used on a HTML select input. - -*/ -function buildUserMap($users,$add_options = false, $additional_options=null, $opt=null) -{ - $my['opt'] = array('userDisplayFormat' => null); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $usersMap = null; - $inactivePrefix = lang_get('tag_for_inactive_users'); - if ($users) - { - if($add_options) - { - $my_options = is_null($additional_options) ? array( 0 => '') : $additional_options; - foreach($my_options as $code => $verbose_code) - { - $usersMap[$code] = $verbose_code; - } - } - $userSet = array_keys($users); - $loops2do = count($userSet); - - for( $idx=0; $idx < $loops2do ; $idx++) - { - $userID = $userSet[$idx]; - $usersMap[$userID] = $users[$userID]->getDisplayName($my['opt']['userDisplayFormat']); - if($users[$userID]->isActive == 0) - { - $usersMap[$userID] = $inactivePrefix . ' ' . $usersMap[$userID]; - } - } - } - return $usersMap; -} - - -/** - * reset user password in DB - * - * @param resource &$db reference to database handler - * @param integer $userID - * @param string $newPasswordSendMethod, default 'send_password_by_mail' - * - * @return hash - * status: integer result status code - * password: new password - * msg: error message (if any) - */ -function resetPassword(&$db,$userID,$passwordSendMethod='send_password_by_mail') -{ - $doIt = false; - $retval = array('status' => tl::OK, 'password' => '', 'msg' => ''); - - $user = new tlUser($userID); - $retval['status'] = $user->readFromDB($db); - - if ($retval['status'] >= tl::OK) - { - // Reset can be done ONLY if user authentication method allows it. - $systemCfg = config_get('authentication'); - $userAuthMethod = trim($user->authentication); - if($userAuthMethod == '' || is_null($userAuthMethod)) - { - $userAuthMethod = $systemCfg['method']; - } - - $cfg = $systemCfg['domain']; - $doIt = isset($cfg[$userAuthMethod]) && - $cfg[$userAuthMethod]['allowPasswordManagement']; - } - - if ($doIt) - { - $retval['status'] = tlUser::E_EMAILLENGTH; - - if( trim($user->emailAddress) != "") - { - $newPassword = tlUser::generatePassword(8,4); - $retval['status'] = $user->setPassword($newPassword,$userAuthMethod); - if ($retval['status'] >= tl::OK) - { - $retval['password'] = $newPassword; - $mail_op = new stdClass(); - $mail_op->status_ok = false; - if( $passwordSendMethod == 'send_password_by_mail' ) - { - $msgBody = lang_get('your_password_is') . "\n\n" . $newPassword . "\n\n" . lang_get('contact_admin'); - $mail_op = @email_send(config_get('from_email'), - $user->emailAddress,lang_get('mail_passwd_subject'),$msgBody); - } - - if ($mail_op->status_ok || ($passwordSendMethod == 'display_on_screen') ) - { - $retval['status'] = $user->writePasswordToDB($db); - } - else - { - $retval['status'] = tl::ERROR; - $retval['msg'] = $mail_op->msg; - } - } - } - } - - $retval['msg'] = ($retval['msg'] != "") ? $retval['msg'] : getUserErrorMessage($retval['status']) ; - return $retval; -} - -/* - function: getUserErrorMessage - - args : - - returns: - -*/ -function getUserErrorMessage($code) -{ - $msg = 'ok'; - switch($code) - { - case tl::OK: - break; - - case tlUser::E_LOGINLENGTH: - $msg = lang_get('error_user_login_length_error'); - break; - - case tlUser::E_EMAILLENGTH: - $msg = lang_get('empty_email_address'); - break; - - case tlUser::E_EMAILFORMAT: - $msg = lang_get('no_good_email_address'); - break; - - case tlUser::E_NOTALLOWED: - $msg = lang_get('user_login_valid_regex'); - break; - - case tlUser::E_FIRSTNAMELENGTH: - $msg = lang_get('empty_first_name'); - break; - - case tlUser::E_LOGINALREADYEXISTS: - $msg = lang_get('user_name_exists'); - break; - - case tlUser::E_LASTNAMELENGTH: - $msg = lang_get('empty_last_name'); - break; - - case tlUser::E_PWDEMPTY: - $msg = lang_get('warning_empty_pwd'); - break; - - case tlUser::E_PWDDONTMATCH: - $msg = lang_get('wrong_old_password'); - break; - - case tlUser::S_PWDMGTEXTERNAL : - $msg = lang_get('password_mgmt_is_external'); - break; - - case ERROR: - case tlUser::E_DBERROR: - default: - $msg = lang_get('error_user_not_updated'); - break; - } - return $msg; -} - - -/* - function: getAllUsersRoles - - args: - - returns: - - -*/ -function getAllUsersRoles(&$db,$order_by = null) -{ - $tables = tlObject::getDBTables(array('users','roles')); - - $sql = "SELECT users.id FROM {$tables['users']} users " . - " LEFT OUTER JOIN {$tables['roles']} roles ON users.role_id = roles.id "; - $sql .= is_null($order_by) ? " ORDER BY login " : $order_by; - - $users = tlDBObject::createObjectsFromDBbySQL($db,$sql,"id","tlUser",false,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); - - $loop2do = count($users); - $specialK = array_flip((array)config_get('demoSpecialUsers')); - $demoModeEnabled = config_get('demoMode'); - for($idx=0; $idx < $loop2do; $idx++) - { - $users[$idx]->isDemoSpecial = $demoModeEnabled ? isset($specialK[$users[$idx]->login]) : false; - } - return $users; -} - -/* - function: getTestersForHtmlOptions - - args: - - returns: - -*/ -/** - * getTestersForHtmlOptions - * returns users that have role on ($tplanID,$tprojectID) with right - * to execute a test case. - * - * @param resource &$db reference to database handler - * @param integer $tplanID test plan id - * @param integer $tprojectID test project id - * @param $users UNUSED - remove - * @param $additional_testers TBD - * @param string $activeStatus. values: 'active','inactive','any' - * - * @return array TBD - * @internal revisions - */ -function getTestersForHtmlOptions(&$db,$tplanID,$tproject,$users = null, - $additional_testers = null,$activeStatus = 'active') -{ - $orOperand = false; - $activeTarget = 1; - switch ($activeStatus) - { - case 'any': - $orOperand = true; - break; - - case 'inactive': - $activeTarget = 0; - break; - - case 'active': - default: - break; - } - - $users_roles = get_tplan_effective_role($db,$tplanID,$tproject,null,$users); - - $userFilter = array(); - foreach($users_roles as $keyUserID => $roleInfo) - { - if( is_object($roleInfo['effective_role']) ) - { - if( $roleInfo['effective_role']->hasRight('testplan_execute') && - ($orOperand || $roleInfo['user']->isActive == $activeTarget) ) - { - $userFilter[$keyUserID] = $roleInfo['user']; - } - } - } - return buildUserMap($userFilter,true,$additional_testers); -} - -/** - * - */ -function initialize_tabsmenu() -{ - $hl = new stdClass(); - $hl->view_roles = 0; - $hl->create_role = 0; - $hl->edit_role = 0; - - $hl->view_users = 0; - $hl->create_user = 0; - $hl->edit_user = 0; - - $hl->assign_users_tproject = 0; - $hl->assign_users_tplan = 0; - return $hl; -} - - -/* - function: getGrantsForUserMgmt - utility function used on all user and role pages - to pass grants to smarty templates. - Logic is: - if user has Global user management right => no control - on specific test project or test plan is done - - - args: - - returns: - -*/ -function getGrantsForUserMgmt(&$dbHandler,&$userObj,$tprojectID=null,$tplanID=null) -{ - $answers = new stdClass(); - $grants = new stdClass(); - $grants->user_mgmt = $userObj->hasRight($dbHandler,"mgt_users"); - $grants->role_mgmt = $userObj->hasRight($dbHandler,"role_management"); - - // in order to assign DEFAULT role to user, due to current implementation - // you need to access all user data => we request you can do mgt_users. - // A question arise: - // how user_role_assignment right has to be understood ? - // how it is used ? where ? - // $grants->user_role_assignment = $userObj->hasRight($dbHandler,"user_role_assignment"); - - $grants->tproject_user_role_assignment = "no"; - $grants->tplan_user_role_assignment = "no"; - - if($grants->user_mgmt == 'yes') - { - $grants->tplan_user_role_assignment = 'yes'; - $grants->tproject_user_role_assignment = 'yes'; - } - else - { - $grants->tplan_user_role_assignment = $userObj->hasRight($dbHandler,"testplan_user_role_assignment", - $tprojectID,$tplanID); - - - $answers->user_role_assignment = $userObj->hasRight($dbHandler,"user_role_assignment",null,-1); - $answers->testproject_user_role_assignment=$userObj->hasRight($dbHandler,"testproject_user_role_assignment",$tprojectID,-1); - if($answers->user_role_assignment == "yes" || $answers->testproject_user_role_assignment == "yes") - { - $grants->tproject_user_role_assignment = "yes"; - } - } - foreach($grants as $key => $value) - { - $grants->$key = $value == "yes" ? "yes" : "no"; - } - - return $grants; -} - - -/** - * just a wrapper - * - */ -function setUserSessionFromObj(&$db,$userObj) { - return setUserSession($db,$userObj->login,$userObj->dbID, - $userObj->globalRoleID,$userObj->emailAddress); + 'map_name_with_inactive_mark', + 'order_by' => $gui_cfg->tprojects_combo_order_by + ); + $arrProducts = $tproject_mgr->get_accessible_for_user($id, $opt); + + $tproject_cookie = config_get('cookie')->testProjectMemory . $id; + if (isset($_COOKIE[$tproject_cookie]) && + isset($arrProducts[$_COOKIE[$tproject_cookie]]) && + $arrProducts[$_COOKIE[$tproject_cookie]]) { + $_SESSION['testprojectID'] = $_COOKIE[$tproject_cookie]; + tLog('Cookie: {$tproject_cookie}=' . $_SESSION['testprojectID']); + } + if (! $_SESSION['testprojectID']) { + $tpID = null; + if (count($arrProducts)) { + $tpID = key($arrProducts); + } + $_SESSION['testprojectID'] = $tpID; + } + // Validation is done in navBar.php + $tplan_cookie = 'TL_lastTestPlanForUserID_' . $id; + if (isset($_COOKIE[$tplan_cookie])) { + $_SESSION['testplanID'] = $_COOKIE[$tplan_cookie]; + tLog("Cookie: {$tplan_cookie}=" . $_SESSION['testplanID']); + } + + return 1; +} + +/* + * function: getUsersForHtmlOptions + * + * args: db: reference to db object + * [whereClause]: + * [add_blank_option]: + * [active_filter]: + * + * returns: map + * + * rev : + */ +function getUsersForHtmlOptions(&$db, $whereClause = null, + $additional_users = null, $active_filter = null, $users = null, $opt = null) +{ + if (! $users) { + $sqlWhere = $whereClause; + if (! is_null($active_filter)) { + $whereClause .= ' AND active =' . ($active_filter > 0 ? 1 : 0) . ' '; + } + $users = tlUser::getAll($db, $sqlWhere, "id", null, + tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); + } + return buildUserMap($users, ! is_null($additional_users), $additional_users, + $opt); +} + +/* + * function: buildUserMap + * + * args: + * $users: map of user objects + * [add_options]: default false. + * true, elements present on additional_options arguments + * will be will added to result map. + * + * [additional_options]: default null + * map with key=user id, value=verbose description + * + * returns: map ready to be used on a HTML select input. + * + */ +function buildUserMap($users, $add_options = false, $additional_options = null, + $opt = null) +{ + $my['opt'] = array( + 'userDisplayFormat' => null + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $usersMap = null; + $inactivePrefix = lang_get('tag_for_inactive_users'); + if ($users) { + if ($add_options) { + $my_options = is_null($additional_options) ? array( + 0 => '' + ) : $additional_options; + foreach ($my_options as $code => $verbose_code) { + $usersMap[$code] = $verbose_code; + } + } + $userSet = array_keys($users); + $loops2do = count($userSet); + + for ($idx = 0; $idx < $loops2do; $idx ++) { + $userID = $userSet[$idx]; + $usersMap[$userID] = $users[$userID]->getDisplayName( + $my['opt']['userDisplayFormat']); + if ($users[$userID]->isActive == 0) { + $usersMap[$userID] = $inactivePrefix . ' ' . $usersMap[$userID]; + } + } + } + return $usersMap; +} + +/** + * reset user password in DB + * + * @param + * resource &$db reference to database handler + * @param integer $userID + * @param string $newPasswordSendMethod, + * default 'send_password_by_mail' + * + * @return array status: integer result status code + * password: new password + * msg: error message (if any) + */ +function resetPassword(&$db, $userID, + $passwordSendMethod = 'send_password_by_mail') +{ + $doIt = false; + $retval = array( + 'status' => tl::OK, + 'password' => '', + 'msg' => '' + ); + + $user = new tlUser($userID); + $retval['status'] = $user->readFromDB($db); + + if ($retval['status'] >= tl::OK) { + // Reset can be done ONLY if user authentication method allows it. + $systemCfg = config_get('authentication'); + $userAuthMethod = trim($user->authentication); + if ($userAuthMethod == '' || is_null($userAuthMethod)) { + $userAuthMethod = $systemCfg['method']; + } + + $cfg = $systemCfg['domain']; + $doIt = isset($cfg[$userAuthMethod]) && + $cfg[$userAuthMethod]['allowPasswordManagement']; + } + + if ($doIt) { + $retval['status'] = tlUser::E_EMAILLENGTH; + + if (trim($user->emailAddress) != "") { + $newPassword = tlUser::generatePassword(8, 4); + $retval['status'] = $user->setPassword($newPassword, $userAuthMethod); + if ($retval['status'] >= tl::OK) { + $retval['password'] = $newPassword; + $mail_op = new stdClass(); + $mail_op->status_ok = false; + if ($passwordSendMethod == 'send_password_by_mail') { + $msgBody = lang_get('your_password_is') . "\n\n" . + $newPassword . "\n\n" . lang_get('contact_admin'); + $mail_op = @email_send(config_get('from_email'), + $user->emailAddress, lang_get('mail_passwd_subject'), + $msgBody); + } + + if ($mail_op->status_ok || + ($passwordSendMethod == 'display_on_screen')) { + $retval['status'] = $user->writePasswordToDB($db); + } else { + $retval['status'] = tl::ERROR; + $retval['msg'] = $mail_op->msg; + } + } + } + } + + $retval['msg'] = ($retval['msg'] != "") ? $retval['msg'] : getUserErrorMessage( + $retval['status']); + return $retval; +} + +/* + * function: getUserErrorMessage + * + * args : + * + * returns: + * + */ +function getUserErrorMessage($code) +{ + $msg = 'ok'; + switch ($code) { + case tl::OK: + break; + + case tlUser::E_LOGINLENGTH: + $msg = lang_get('error_user_login_length_error'); + break; + + case tlUser::E_EMAILLENGTH: + $msg = lang_get('empty_email_address'); + break; + + case tlUser::E_EMAILFORMAT: + $msg = lang_get('no_good_email_address'); + break; + + case tlUser::E_NOTALLOWED: + $msg = lang_get('user_login_valid_regex'); + break; + + case tlUser::E_FIRSTNAMELENGTH: + $msg = lang_get('empty_first_name'); + break; + + case tlUser::E_LOGINALREADYEXISTS: + $msg = lang_get('user_name_exists'); + break; + + case tlUser::E_LASTNAMELENGTH: + $msg = lang_get('empty_last_name'); + break; + + case tlUser::E_PWDEMPTY: + $msg = lang_get('warning_empty_pwd'); + break; + + case tlUser::E_PWDDONTMATCH: + $msg = lang_get('wrong_old_password'); + break; + + case tlUser::S_PWDMGTEXTERNAL: + $msg = lang_get('password_mgmt_is_external'); + break; + + case ERROR: + case tlUser::E_DBERROR: + default: + $msg = lang_get('error_user_not_updated'); + break; + } + return $msg; +} + +/* + * function: getAllUsersRoles + * + * args: + * + * returns: + * + * + */ +function getAllUsersRoles(&$db, $order_by = null) +{ + $tables = tlObject::getDBTables(array( + 'users', + 'roles' + )); + + $sql = "SELECT users.id FROM {$tables['users']} users " . + " LEFT OUTER JOIN {$tables['roles']} roles ON users.role_id = roles.id "; + $sql .= is_null($order_by) ? " ORDER BY login " : $order_by; + + $users = tlDBObject::createObjectsFromDBbySQL($db, $sql, "id", "tlUser", + false, tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); + + $loop2do = count($users); + $specialK = array_flip((array) config_get('demoSpecialUsers')); + $demoModeEnabled = config_get('demoMode'); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $users[$idx]->isDemoSpecial = $demoModeEnabled ? isset( + $specialK[$users[$idx]->login]) : false; + } + return $users; +} + +/* + * function: getTestersForHtmlOptions + * + * args: + * + * returns: + * + */ +/** + * getTestersForHtmlOptions + * returns users that have role on ($tplanID,$tprojectID) with right + * to execute a test case. + * + * @param + * resource &$db reference to database handler + * @param integer $tplanID + * test plan id + * @param integer $tprojectID + * test project id + * @param array $users + * @param array $additional_testers + * TBD + * @param string $activeStatus. + * values: 'active','inactive','any' + * + * @return array TBD + * @internal revisions + */ +function getTestersForHtmlOptions(&$db, $tplanID, $tproject, $users = null, + $additional_testers = null, $activeStatus = 'active') +{ + $orOperand = false; + $activeTarget = 1; + switch ($activeStatus) { + case 'any': + $orOperand = true; + break; + + case 'inactive': + $activeTarget = 0; + break; + + case 'active': + default: + break; + } + + $users_roles = get_tplan_effective_role($db, $tplanID, $tproject, null, + $users); + + $userFilter = array(); + foreach ($users_roles as $keyUserID => $roleInfo) { + if (is_object($roleInfo['effective_role']) && + $roleInfo['effective_role']->hasRight('testplan_execute') && + ($orOperand || $roleInfo['user']->isActive == $activeTarget)) { + $userFilter[$keyUserID] = $roleInfo['user']; + } + } + return buildUserMap($userFilter, true, $additional_testers); +} + +/** + */ +function initializeTabsmenu() +{ + $hl = new stdClass(); + $hl->view_roles = 0; + $hl->create_role = 0; + $hl->edit_role = 0; + + $hl->view_users = 0; + $hl->create_user = 0; + $hl->edit_user = 0; + + $hl->assign_users_tproject = 0; + $hl->assign_users_tplan = 0; + return $hl; +} + +/* + * function: getGrantsForUserMgmt + * utility function used on all user and role pages + * to pass grants to smarty templates. + * Logic is: + * if user has Global user management right => no control + * on specific test project or test plan is done + * + * + * args: + * + * returns: + * + */ +function getGrantsForUserMgmt(&$dbHandler, &$userObj, $tprojectID = null, + $tplanID = null) +{ + $answers = new stdClass(); + $grants = new stdClass(); + $grants->user_mgmt = $userObj->hasRight($dbHandler, "mgt_users"); + $grants->role_mgmt = $userObj->hasRight($dbHandler, "role_management"); + + // in order to assign DEFAULT role to user, due to current implementation + // you need to access all user data => we request you can do mgt_users. + // A question arise: + // how user_role_assignment right has to be understood ? + // how it is used ? where ? + // $grants->user_role_assignment = $userObj->hasRight($dbHandler,"user_role_assignment"); + + $grants->tproject_user_role_assignment = "no"; + $grants->tplan_user_role_assignment = "no"; + + if ($grants->user_mgmt == 'yes') { + $grants->tplan_user_role_assignment = 'yes'; + $grants->tproject_user_role_assignment = 'yes'; + } else { + $grants->tplan_user_role_assignment = $userObj->hasRight($dbHandler, + "testplan_user_role_assignment", $tprojectID, $tplanID); + + $answers->user_role_assignment = $userObj->hasRight($dbHandler, + "user_role_assignment", null, - 1); + $answers->testproject_user_role_assignment = $userObj->hasRight( + $dbHandler, "testproject_user_role_assignment", $tprojectID, - 1); + if ($answers->user_role_assignment == "yes" || + $answers->testproject_user_role_assignment == "yes") { + $grants->tproject_user_role_assignment = "yes"; + } + } + foreach ($grants as $key => $value) { + $grants->$key = $value == "yes" ? "yes" : "no"; + } + + return $grants; +} + +/** + * just a wrapper + */ +function setUserSessionFromObj(&$db, $userObj) +{ + return setUserSession($db, $userObj->login, $userObj->dbID, + $userObj->globalRoleID, $userObj->emailAddress); } diff --git a/lib/functions/web_editor.php b/lib/functions/web_editor.php index d84b21bf82..760a7668e0 100644 --- a/lib/functions/web_editor.php +++ b/lib/functions/web_editor.php @@ -1,119 +1,154 @@ -Editor->basePath = $base_path . 'third_party/ckeditor/'; - $of->Editor->config['customConfig'] = $base_path . $webEditorCfg['configFile']; - $of->Editor->config['toolbar'] = $webEditorCfg['toolbar']; - $of->Editor->config['language'] = $ckeditorLang; - if (isset($webEditorCfg['height'])) { - $of->Editor->config['height'] = $webEditorCfg['height']; - } - - if (isset($webEditorCfg['width'])) { - $of->Editor->config['width'] = $webEditorCfg['width']; - } - break; - - case 'tinymce': - $of = new tinymce($html_input_id) ; - if (isset($webEditorCfg['rows'])) { - $of->rows = $webEditorCfg['rows']; - } - - if (isset($webEditorCfg['cols'])) { - $of->cols = $webEditorCfg['cols']; - } - break; - - case 'none': - default: - $of = new no_editor($html_input_id) ; - if (isset($webEditorCfg['rows'])) { - $of->rows = $webEditorCfg['rows']; - } - - if (isset($webEditorCfg['cols'])) { - $of->cols = $webEditorCfg['cols']; - } - break; - } - - return $of; -} \ No newline at end of file +Editor->basePath = $base_path . 'third_party/ckeditor/'; + $of->Editor->config['customConfig'] = $base_path . + $webEditorCfg['configFile']; + $of->Editor->config['toolbar'] = $webEditorCfg['toolbar']; + $of->Editor->config['language'] = $ckeditorLang; + if (isset($webEditorCfg['height'])) { + $of->Editor->config['height'] = $webEditorCfg['height']; + } + + if (isset($webEditorCfg['width'])) { + $of->Editor->config['width'] = $webEditorCfg['width']; + } + break; + + case 'tinymce': + $of = new tinymce($html_input_id); + if (isset($webEditorCfg['rows'])) { + $of->rows = $webEditorCfg['rows']; + } + + if (isset($webEditorCfg['cols'])) { + $of->cols = $webEditorCfg['cols']; + } + break; + + case 'none': + default: + $of = new no_editor($html_input_id); + if (isset($webEditorCfg['rows'])) { + $of->rows = $webEditorCfg['rows']; + } + + if (isset($webEditorCfg['cols'])) { + $of->cols = $webEditorCfg['cols']; + } + break; + } + + return $of; +} diff --git a/lib/functions/xml.inc.php b/lib/functions/xml.inc.php index 95911f0219..e8ee3a4dc4 100644 --- a/lib/functions/xml.inc.php +++ b/lib/functions/xml.inc.php @@ -1,185 +1,161 @@ - ]> - * - * - * &xxe; - * - * - * - * User contribution regarding XML External Entity (XXE) Processing Attacks - * - */ -function simplexml_load_file_wrapper($filename) -{ - // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html - libxml_disable_entity_loader(true); - $zebra = file_get_contents($filename); - $xml = @simplexml_load_string($zebra); - if ($xml === false) { - libxml_use_internal_errors(true); - $xml = simplexml_load_string($zebra); - echo lang_get("simplexml_load_file_wrapper_error"); - foreach (libxml_get_errors() as $error) { - echo "
    ", $error->message; - } - die(); - } - return $xml; -} - - -/** - * - * - */ -function exportDataToXML($items,$rootTpl,$elemTpl,$elemInfo,$bNoXMLHeader = false) -{ - if (!$items) - { - return; - } - - - $xmlCode = ''; - reset($items); - foreach ($items as $item) { - - $xmlElemCode = $elemTpl; - - // REMEMBER YOU NEED TO USE XMP TO DEBUG - // echo '$xmlElemCode'; echo "$xmlElemCode)"; - foreach($elemInfo as $subject => $replacement) { - $fm = substr($subject,0,2); - $content = isset($item[$replacement]) ? $item[$replacement] : null; - - switch($fm) - { - case '||': - break; - - case '{{': - default: - $content = htmlspecialchars($content); - break; - } - - $howMany = 0; - $xmlElemCode = str_replace($subject,$content,$xmlElemCode,$howMany); - } - - - $xmlCode .= $xmlElemCode; - } - reset($items); - - $result = null; - if (!$bNoXMLHeader) - { - $result .= TL_XMLEXPORT_HEADER."\n"; - } - - if($rootTpl != '' && !is_null($rootTpl)) - { - $result .= str_replace("{{XMLCODE}}",$xmlCode,$rootTpl); - return $result; - } - else - { - return $xmlCode; - } -} - - -/** - * $simpleXMLItems - * $itemStructure: keys elements, attributes - * - * both keys are maps: - * key: element/attribute type - * value: map - * key: attribute name - * value: options used to request special - * processing like trim(), intval(),etc. - * - * Example: - * $tcXML['elements'] = array('string' => array("summary" => null, - * "preconditions" => 'trim'), - * 'integer' => array("node_order" => 'intval', - * "externalid" => null, - * "execution_type" => null, - * "importance" => null)); - * - * $tcXML['attributes'] = array('string' => array("name" => 'trim'), - * 'integer' => array('internalid' => null)); - * - * - */ -function getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure) -{ - $items = null; - if($simpleXMLItems) - { - $items_counter=0; - $loop_qty = count($simpleXMLItems); - - // new dBug($loop_qty); - for($idx=0; $idx < $loop_qty; $idx++) - { - foreach($itemStructure['elements'] as $castType => $keyValues) - { - foreach($keyValues as $key => $fn2apply) - { - $dummy[$key] = null; - if( property_exists($simpleXMLItems[$idx],$key) ) - { - $dummy[$key] = $simpleXMLItems[$idx]->$key; - settype($dummy[$key],$castType); - if(!is_null($fn2apply)) - { - $dummy[$key] = $fn2apply($dummy[$key]); - } - } - } - } - - if( isset($itemStructure['attributes']) && !is_null($itemStructure['attributes']) ) - { - foreach($itemStructure['attributes'] as $castType => $keyValues) - { - foreach($keyValues as $key => $fn2apply) - { - $dummy[$key] = null; - if( isset($simpleXMLItems[$idx],$key) ) - { - $dummy[$key] = $simpleXMLItems[$idx][$key]; - settype($dummy[$key],$castType); - if(!is_null($fn2apply)) - { - $dummy[$key] = $fn2apply($dummy[$key]); - } - } - } - } - } - $items[$items_counter++] = $dummy; - } - } - - return $items; -} \ No newline at end of file + ]> + * + * + * &xxe; + * + * + * + * User contribution regarding XML External Entity (XXE) Processing Attacks + */ +function simplexml_load_file_wrapper($filename) +{ + // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html + libxml_disable_entity_loader(true); + $zebra = file_get_contents($filename); + $xml = @simplexml_load_string($zebra); + if ($xml === false) { + libxml_use_internal_errors(true); + $xml = simplexml_load_string($zebra); + echo lang_get("simplexml_load_file_wrapper_error"); + foreach (libxml_get_errors() as $error) { + echo "
    ", $error->message; + } + die(); + } + return $xml; +} + +/** + */ +function exportDataToXML($items, $rootTpl, $elemTpl, $elemInfo, + $bNoXMLHeader = false) +{ + if (! $items) { + return; + } + + $xmlCode = ''; + reset($items); + foreach ($items as $item) { + + $xmlElemCode = $elemTpl; + + // REMEMBER YOU NEED TO USE XMP TO DEBUG + // echo '$xmlElemCode'; echo "$xmlElemCode)"; + foreach ($elemInfo as $subject => $replacement) { + $fm = substr($subject, 0, 2); + $content = isset($item[$replacement]) ? $item[$replacement] : null; + + switch ($fm) { + case '||': + break; + + case '{{': + default: + $content = htmlspecialchars($content); + break; + } + + $howMany = 0; + $xmlElemCode = str_replace($subject, $content, $xmlElemCode, + $howMany); + } + + $xmlCode .= $xmlElemCode; + } + reset($items); + + $result = null; + if (! $bNoXMLHeader) { + $result .= TL_XMLEXPORT_HEADER . "\n"; + } + + if ($rootTpl != '' && ! is_null($rootTpl)) { + $result .= str_replace("{{XMLCODE}}", $xmlCode, $rootTpl); + return $result; + } else { + return $xmlCode; + } +} + +/** + * $simpleXMLItems + * $itemStructure: keys elements, attributes + * + * both keys are maps: + * key: element/attribute type + * value: map + * key: attribute name + * value: options used to request special + * processing like trim(), intval(),etc. + * + * Example: + * $tcXML['elements'] = array('string' => array("summary" => null, + * "preconditions" => 'trim'), + * 'integer' => array("node_order" => 'intval', + * "externalid" => null, + * "execution_type" => null, + * "importance" => null)); + * + * $tcXML['attributes'] = array('string' => array("name" => 'trim'), + * 'integer' => array('internalid' => null)); + */ +function getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure) +{ + $items = null; + if ($simpleXMLItems) { + $items_counter = 0; + $loop_qty = count($simpleXMLItems); + + for ($idx = 0; $idx < $loop_qty; $idx ++) { + foreach ($itemStructure['elements'] as $castType => $keyValues) { + foreach ($keyValues as $key => $fn2apply) { + $dummy[$key] = null; + if (property_exists($simpleXMLItems[$idx], $key)) { + $dummy[$key] = $simpleXMLItems[$idx]->$key; + settype($dummy[$key], $castType); + if (! is_null($fn2apply)) { + $dummy[$key] = $fn2apply($dummy[$key]); + } + } + } + } + + if (isset($itemStructure['attributes']) && + ! is_null($itemStructure['attributes'])) { + foreach ($itemStructure['attributes'] as $castType => $keyValues) { + foreach ($keyValues as $key => $fn2apply) { + $dummy[$key] = null; + if (isset($simpleXMLItems[$idx], $key)) { + $dummy[$key] = $simpleXMLItems[$idx][$key]; + settype($dummy[$key], $castType); + if (! is_null($fn2apply)) { + $dummy[$key] = $fn2apply($dummy[$key]); + } + } + } + } + } + $items[$items_counter ++] = $dummy; + } + } + + return $items; +} diff --git a/lib/general/frmWorkArea.php b/lib/general/frmWorkArea.php index 8d22408d7c..1536d8e285 100644 --- a/lib/general/frmWorkArea.php +++ b/lib/general/frmWorkArea.php @@ -1,252 +1,259 @@ - Associative Array TreeFramePath) -// key : feature -// value: page to lauch -// -$req_cfg = config_get('req_cfg'); - -// more info here -// array(0) => left pane -// array(1) => right pane -$aa_tfp = array( - 'editTc' => array('lib/testcases/listTestCases.php?feature=edit_tc', - 'lib/testcases/archiveData.php?edit=testproject&id='), - - 'assignReqs' => 'lib/testcases/listTestCases.php?feature=assignReqs', - 'searchTc' => 'lib/testcases/tcSearchForm.php', - - 'searchReq' => 'lib/requirements/reqSearchForm.php', - 'searchReqSpec' => 'lib/requirements/reqSpecSearchForm.php', - - 'printTestSpec' => 'lib/results/printDocOptions.php?type=testspec', - 'printReqSpec' => 'lib/results/printDocOptions.php?type=reqspec', - 'keywordsAssign' => 'lib/testcases/listTestCases.php?feature=keywordsAssign', - 'planAddTC' => array('lib/plan/planAddTCNavigator.php?loadRightPaneAddTC=0', - 'lib/results/printDocOptions.php?activity=addTC'), - 'planRemoveTC' => 'lib/plan/planTCNavigator.php?feature=removeTC&help_topic=planRemoveTC', - 'planUpdateTC' => 'lib/plan/planTCNavigator.php?feature=planUpdateTC', - 'show_ve' => 'lib/plan/planTCNavigator.php?feature=show_ve', - 'newest_tcversions' => '../../lib/plan/newest_tcversions.php', - 'test_urgency' => 'lib/plan/planTCNavigator.php?feature=test_urgency', - 'tc_exec_assignment' => 'lib/plan/planTCNavigator.php?feature=tc_exec_assignment', - 'executeTest' => array('lib/execute/execNavigator.php?setting_testplan=', 'lib/execute/execDashboard.php?id='), - 'showMetrics' => 'lib/results/resultsNavigator.php', - 'reqSpecMgmt' => array('lib/requirements/reqSpecListTree.php', - 'lib/project/project_req_spec_mgmt.php?id=') -); - -$full_screen = array('newest_tcversions' => 1); - -//cleanup session var -$_SESSION['currentSrsId'] = null; - -/** feature to display */ -$showFeature = $args->feature; -if (isset($aa_tfp[$showFeature]) === FALSE) { - // argument is wrong - tLog("Wrong page argument feature = ".$showFeature, 'ERROR'); - exit(); + Associative Array TreeFramePath) +// key : feature +// value: page to lauch +// +$req_cfg = config_get('req_cfg'); + +// more info here +// array(0) => left pane +// array(1) => right pane +$aa_tfp = array( + 'editTc' => array( + 'lib/testcases/listTestCases.php?feature=edit_tc', + 'lib/testcases/archiveData.php?edit=testproject&id=' + ), + + 'assignReqs' => 'lib/testcases/listTestCases.php?feature=assignReqs', + 'searchTc' => 'lib/testcases/tcSearchForm.php', + + 'searchReq' => 'lib/requirements/reqSearchForm.php', + 'searchReqSpec' => 'lib/requirements/reqSpecSearchForm.php', + + 'printTestSpec' => 'lib/results/printDocOptions.php?type=testspec', + 'printReqSpec' => 'lib/results/printDocOptions.php?type=reqspec', + 'keywordsAssign' => 'lib/testcases/listTestCases.php?feature=keywordsAssign', + 'planAddTC' => array( + 'lib/plan/planAddTCNavigator.php?loadRightPaneAddTC=0', + 'lib/plan/planAddTC.php?activity=addTC' + ), + 'planRemoveTC' => 'lib/plan/planTCNavigator.php?feature=removeTC&help_topic=planRemoveTC', + 'planUpdateTC' => 'lib/plan/planTCNavigator.php?feature=planUpdateTC', + 'show_ve' => 'lib/plan/planTCNavigator.php?feature=show_ve', + 'newest_tcversions' => '../../lib/plan/newest_tcversions.php', + 'test_urgency' => 'lib/plan/planTCNavigator.php?feature=test_urgency', + 'tc_exec_assignment' => 'lib/plan/planTCNavigator.php?feature=tc_exec_assignment', + 'executeTest' => array( + 'lib/execute/execNavigator.php?setting_testplan=', + 'lib/execute/execDashboard.php?id=' + ), + 'showMetrics' => 'lib/results/resultsNavigator.php', + 'reqSpecMgmt' => array( + 'lib/requirements/reqSpecListTree.php', + 'lib/project/project_req_spec_mgmt.php?id=' + ) +); + +$full_screen = array( + 'newest_tcversions' => 1 +); + +// cleanup session var +$_SESSION['currentSrsId'] = null; + +/** + * feature to display + */ +$showFeature = $args->feature; +if (isset($aa_tfp[$showFeature]) === false) { + // argument is wrong + tLog("Wrong page argument feature = " . $showFeature, 'ERROR'); + exit(); +} + +// features that need to run the validate build function +if (in_array($showFeature, + array( + 'executeTest', + 'showMetrics', + 'tc_exec_assignment' + ))) { + // Check if for test project selected at least a test plan exist + if (isset($_SESSION['testplanID']) || ! is_null($args->tplan_id)) { + // Filter on build attributes: ACTIVE,OPEN + switch ($showFeature) { + case 'executeTest': + $hasToBe['active'] = true; + $hasToBe['open'] = true; + $featureHint = lang_get('href_execute_test'); + break; + + case 'tc_exec_assignment': + $txcfg = config_get('tree_filter_cfg'); + $cfg = $txcfg->testcases->plan_mode; + $hasToBe['active'] = $cfg->setting_build_inactive_out ? true : null; + $hasToBe['open'] = $cfg->setting_build_close_out ? true : null; + $featureHint = lang_get('href_tc_exec_assignment'); + break; + + default: + $hasToBe['active'] = null; + $hasToBe['open'] = null; + $featureHint = lang_get('href_rep_and_metrics'); + break; + } + + $tplanIDCard = new stdClass(); + $tplanIDCard->id = intval($_SESSION['testplanID']); + $tplanIDCard->name = $_SESSION['testplanName']; + $tplanMgr = new testplan($db); + + if (! is_null($args->tplan_id)) { + $tplanIDCard->id = intval($args->tplan_id); + $dummy = $tplanMgr->tree_manager->get_node_hierarchy_info( + $tplanIDCard->id); + $tplanIDCard->name = $dummy['name']; + } + + $ctx = new stdClass(); + $ctx->tplanIDCard = $tplanIDCard; + $ctx->featureTitle = $featureHint; + + validateBuildAvailability($db, $tplanMgr, $ctx, $hasToBe); + } else { + redirect('../plan/planView.php'); + exit(); + } +} + +// / 1. get path from global var +// / 2. the URL made easier after setting some rules for help/instruction files +// / naming convention. +// / +$smarty = new TLSmarty(); + +// try to add context in order to avoid using global coupling via $_SESSION +// this will be useful to open different test projects on different browser TAB +if (is_array($aa_tfp[$showFeature])) { + $leftPane = $aa_tfp[$showFeature][0]; + $rightPane = $aa_tfp[$showFeature][1]; + + if ($rightPane[strlen($rightPane) - 1] == '=') { + $rightPane .= intval($_SESSION['testprojectID']); + } + + if ($showFeature == 'executeTest') { + $leftPane .= $args->tplan_id; + } +} else { + $leftPane = $aa_tfp[$showFeature]; + $rightPane = 'lib/general/staticPage.php?key=' . $showFeature; +} + +if (intval($args->tproject_id) > 0 || intval($args->tplan_id) > 0) { + $leftPane .= (strpos($leftPane, "?") === false) ? "?" : "&"; + $leftPane .= "tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}"; + + // for execDashboard is OK, need to understand if will be ok for other features + // or is going to create issues. + $rightPane .= (strpos($rightPane, "?") === false) ? "?" : "&"; + $rightPane .= "tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}"; +} + +if (isset($full_screen[$showFeature])) { + redirect($leftPane); +} else { + $smarty->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); + $smarty->assign('treeframe', $leftPane); + $smarty->assign('workframe', $rightPane); + $smarty->display('frmInner.tpl'); +} + +/** + * validate that some build exists (for Test Plan related features). + * If no valid build is found give feedback to user and exit. + * + * check if user can create builds, then put a link on the message page + * to create link feature + */ +function validateBuildAvailability(&$db, &$tplanMgr, $context, $attrFilter) +{ + $tpID = $context->tplanIDCard->id; + $tpName = $context->tplanIDCard->name; + + if (! $tplanMgr->getNumberOfBuilds($tpID, $attrFilter['active'], + $attrFilter['open'])) { + $msx = []; + if ($attrFilter['active']) { + $msx[] = lang_get('active'); + } + + if ($attrFilter['open']) { + $msx[] = lang_get('open'); + } + + $mzx = ''; + if (! empty($msx)) { + $mzx = "(" . implode(' & ', $msx) . ")"; + } + + $message = "

    " . $context->featureTitle . "

    " . + sprintf(lang_get('no_good_build'), $mzx) . " " . + htmlspecialchars($tpName) . ""; + + $link_to_op = ''; + $hint_text = ''; + if (has_rights($db, "testplan_create_build") == 'yes') { + // final url will be composed adding to $basehref + // (one TL variable available on smarty templates) to $link_to_op + $link_to_op = "lib/plan/buildEdit.php?do_action=create&tplan_id=$tpID"; + $hint_text = lang_get('create_a_build'); + } else { + $message .= '

    ' . lang_get('no_build_warning_part2') . '

    '; + } + + // show info and exit + $smarty = new TLSmarty(); + $smarty->assign('content', $message); + $smarty->assign('link_to_op', $link_to_op); + $smarty->assign('hint_text', $hint_text); + $smarty->display('workAreaSimple.tpl'); + exit(); + } +} + +/** + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $iParams = array( + "feature" => array( + tlInputParameter::STRING_N + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + R_PARAMS($iParams, $args); + + return $args; } - -// features that need to run the validate build function -if (in_array($showFeature,array('executeTest','showMetrics','tc_exec_assignment'))) { - // Check if for test project selected at least a test plan exist - if( isset($_SESSION['testplanID']) || !is_null($args->tplan_id)) - { - // Filter on build attributes: ACTIVE,OPEN - switch($showFeature) { - case 'executeTest': - $hasToBe['active'] = true; - $hasToBe['open'] = true; - $featureHint = lang_get('href_execute_test'); - break; - - case 'tc_exec_assignment': - $txcfg = config_get('tree_filter_cfg'); - $cfg = $txcfg->testcases->plan_mode; - $hasToBe['active'] = $cfg->setting_build_inactive_out ? true : null; - $hasToBe['open'] = $cfg->setting_build_close_out ? true : null; - $featureHint = lang_get('href_tc_exec_assignment'); - break; - - default: - $hasToBe['active'] = null; - $hasToBe['open'] = null; - $featureHint = lang_get('href_rep_and_metrics'); - break; - } - - - $tplanIDCard = new stdClass(); - $tplanIDCard->id = intval($_SESSION['testplanID']); - $tplanIDCard->name = $_SESSION['testplanName']; - $tplanMgr = new testplan($db); - - if(!is_null($args->tplan_id)) { - $tplanIDCard->id = intval($args->tplan_id); - $dummy = $tplanMgr->tree_manager->get_node_hierarchy_info($tplanIDCard->id); - $tplanIDCard->name = $dummy['name']; - } - - $ctx = new stdClass(); - $ctx->tplanIDCard = $tplanIDCard; - $ctx->featureTitle = $featureHint; - - validateBuildAvailability($db,$tplanMgr,$ctx,$hasToBe); - } - else - { - redirect('../plan/planView.php'); - exit(); - } -} - -/// 1. get path from global var -/// 2. the URL made easier after setting some rules for help/instruction files -/// naming convention. -/// -$smarty = new TLSmarty(); - -// try to add context in order to avoid using global coupling via $_SESSION -// this will be useful to open different test projects on different browser TAB -if( is_array($aa_tfp[$showFeature]) ) { - $leftPane = $aa_tfp[$showFeature][0]; - $rightPane = $aa_tfp[$showFeature][1]; - - if($rightPane[strlen($rightPane)-1] == '=') { - $rightPane .= intval($_SESSION['testprojectID']); - } - - if($showFeature == 'executeTest') { - $leftPane .= $args->tplan_id; - } - // new dBug($leftPane); - -} else { - $leftPane = $aa_tfp[$showFeature]; - $rightPane = 'lib/general/staticPage.php?key=' . $showFeature; -} - -if( intval($args->tproject_id) > 0 || intval($args->tplan_id) > 0) -{ - $leftPane .= (strpos($leftPane,"?") === false) ? "?" : "&"; - $leftPane .= "tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}"; - - // for execDashboard is OK, need to understand if will be ok for other features - // or is going to create issues. - $rightPane .= (strpos($rightPane,"?") === false) ? "?" : "&"; - $rightPane .= "tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}"; -} - -if(isset($full_screen[$showFeature])) { - redirect($leftPane); -} else { - $smarty->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); - $smarty->assign('treeframe', $leftPane); - $smarty->assign('workframe', $rightPane); - $smarty->display('frmInner.tpl'); -} - - -/** - * validate that some build exists (for Test Plan related features). - * If no valid build is found give feedback to user and exit. - * - * check if user can create builds, then put a link on the message page - * to create link feature - * - * - * - * - **/ -function validateBuildAvailability(&$db,&$tplanMgr,$context,$attrFilter) -{ - $tpID = $context->tplanIDCard->id; - $tpName = $context->tplanIDCard->name; - - if (!$tplanMgr->getNumberOfBuilds($tpID, $attrFilter['active'], $attrFilter['open'])) - { - $msx = []; - if($attrFilter['active']) - { - $msx[] = lang_get('active'); - } - - if($attrFilter['open']) - { - $msx[] = lang_get('open'); - } - - $mzx = ''; - if(count($msx) > 0) - { - $mzx = "(" . implode(' & ',$msx) . ")"; - } - - - $message = "

    " . $context->featureTitle . - "

    " . sprintf(lang_get('no_good_build'),$mzx) . - " " . htmlspecialchars($tpName) . ""; - - $link_to_op = ''; - $hint_text = ''; - if(has_rights($db,"testplan_create_build") == 'yes') - { - // final url will be composed adding to $basehref - // (one TL variable available on smarty templates) to $link_to_op - $link_to_op = "lib/plan/buildEdit.php?do_action=create&tplan_id=$tpID"; - $hint_text = lang_get('create_a_build'); - } - else - { - $message .= '

    ' . lang_get('no_build_warning_part2') . '

    '; - } - - // show info and exit - $smarty = new TLSmarty; - $smarty->assign('content', $message); - $smarty->assign('link_to_op', $link_to_op); - $smarty->assign('hint_text', $hint_text); - $smarty->display('workAreaSimple.tpl'); - exit(); - } -} - -/** - * - */ -function init_args() -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $iParams = array("feature" => array(tlInputParameter::STRING_N), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - R_PARAMS($iParams,$args); - - return $args; -} \ No newline at end of file diff --git a/lib/general/mainPage.php b/lib/general/mainPage.php index 257de3aa19..a37bdb9334 100644 --- a/lib/general/mainPage.php +++ b/lib/general/mainPage.php @@ -1,299 +1,312 @@ -get_accessible_for_user($user->dbID,array('output' => 'map_name_with_inactive_mark')); -$tprojectQty = $tproject_mgr->getItemCount(); -$userIsBlindFolded = (is_null($accessibleItems) || count($accessibleItems) == 0) && $tprojectQty > 0; - -if($userIsBlindFolded) { - $testprojectID = $testplanID = 0; - $_SESSION['testprojectTopMenu'] = ''; -} - -$tplan2check = null; -$currentUser = $_SESSION['currentUser']; -$userID = $currentUser->dbID; - -$gui = new stdClass(); -$gui->grants = getGrants($db,$user,$testprojectID,$userIsBlindFolded); - -/* -echo '
    ';
    -var_dump($gui->grants);
    -echo '
    '; -*/ - -$gui->hasTestCases = false; - -if($gui->grants['view_tc']) { - $gui->hasTestCases = $tproject_mgr->count_testcases($testprojectID) > 0 ? 1 : 0; -} - -$gui->hasKeywords = false; -if($gui->hasTestCases) { - $gui->hasKeywords = $tproject_mgr->hasKeywords($testprojectID); -} - - -// ----- Test Plan Section -------------------------------- -/** - * @TODO - franciscom - we must understand if these two calls are really needed, - * or is enough just call to getAccessibleTestPlans() - */ -$filters = array('plan_status' => ACTIVE); -$gui->num_active_tplans = $tproject_mgr->getActiveTestPlansCount($testprojectID); - -// get Test Plans available for the user -$arrPlans = (array)$currentUser->getAccessibleTestPlans($db,$testprojectID); - -if($testplanID > 0) { - // if this test plan is present on $arrPlans - // OK we will set it on $arrPlans as selected one. - // else - // need to set test plan on session - // - $index=0; - $found=0; - $loop2do=count($arrPlans); - for($idx=0; $idx < $loop2do; $idx++) { - if( $arrPlans[$idx]['id'] == $testplanID ) { - $found = 1; - $index = $idx; - break; - } - } - if( $found == 0 ) { - // update test plan id - $index = 0; - $testplanID = $arrPlans[$index]['id']; - } - - setSessionTestPlan($arrPlans[$index]); - $arrPlans[$index]['selected']=1; -} - -$gui->testplanRole = null; -if ($testplanID) { - - $rd = null; - // Role can be configured or inherited - if( isset($currentUser->tplanRoles[$testplanID]) ) { - // Configured - $role = $currentUser->tplanRoles[$testplanID]; - $rd = $role->getDisplayName(); - } else { - if( config_get('testplan_role_inheritance_mode') == 'global' ) { - $rd = $currentUser->globalRole->name; - } - } - - if( null != $rd ) { - $gui->testplanRole = $tlCfg->gui->role_separator_open .$rd . $tlCfg->gui->role_separator_close; - } -} -$rights2check = array('testplan_execute','testplan_create_build', - 'testplan_metrics','testplan_planning', - 'testplan_user_role_assignment', - 'mgt_testplan_create', - 'cfield_view', 'cfield_management', - 'testplan_milestone_overview', - 'exec_testcases_assigned_to_me', - 'exec_assign_testcases','exec_ro_access', - 'testplan_add_remove_platforms', - 'testplan_update_linked_testcase_versions', - 'testplan_set_urgent_testcases', - 'testplan_show_testcases_newest_versions'); - -foreach($rights2check as $key => $the_right) { - $gui->grants[$the_right] = $userIsBlindFolded ? 'no' : $currentUser->hasRight($db,$the_right,$testprojectID,$testplanID); -} - -$gui->grants['tproject_user_role_assignment'] = "no"; -if( $currentUser->hasRight($db,"testproject_user_role_assignment",$testprojectID,-1) == "yes" || - $currentUser->hasRight($db,"user_role_assignment",null,-1) == "yes" ) -{ - $gui->grants['tproject_user_role_assignment'] = "yes"; -} - - -$gui->url = array('metrics_dashboard' => 'lib/results/metricsDashboard.php', - 'testcase_assignments' => 'lib/testcases/tcAssignedToUser.php'); -$gui->launcher = 'lib/general/frmWorkArea.php'; -$gui->arrPlans = $arrPlans; -$gui->countPlans = count($gui->arrPlans); - - -$gui->testprojectID = $testprojectID; -$gui->testplanID = $testplanID; - -$gui->docs = config_get('userDocOnDesktop') ? getUserDocumentation() : null; - -$secCfg = config_get('config_check_warning_frequence'); -$gui->securityNotes = ''; -if( (strcmp($secCfg, 'ALWAYS') == 0) || - (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && !isset($_SESSION['getSecurityNotesOnMainPageDone'])) ) -{ - $_SESSION['getSecurityNotesOnMainPageDone'] = 1; - $gui->securityNotes = getSecurityNotes($db); -} - -$gui->opt_requirements = isset($_SESSION['testprojectOptions']->requirementsEnabled) ? - $_SESSION['testprojectOptions']->requirementsEnabled : null; - - -$gui->plugins = array(); -foreach(array('EVENT_LEFTMENU_TOP', - 'EVENT_LEFTMENU_BOTTOM', - 'EVENT_RIGHTMENU_TOP', - 'EVENT_RIGHTMENU_BOTTOM') as $menu_item) -{ - # to be compatible with PHP 5.4 - $menu_content = event_signal($menu_item); - if( !empty($menu_content) ) - { - $gui->plugins[$menu_item] = $menu_content; - } -} - -$tplKey = 'mainPage'; -$tpl = $tplKey . '.tpl'; -$tplCfg = config_get('tpl'); -if( null !== $tplCfg && isset($tplCfg[$tplKey]) ) { - $tpl = $tplCfg->$tplKey; -} - -$smarty->assign('gui',$gui); -$smarty->display($tpl); - - -/** - * Get User Documentation - * based on contribution by Eugenia Drosdezki - */ -function getUserDocumentation() -{ - $target_dir = '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'docs'; - $documents = null; - - if ($handle = opendir($target_dir)) - { - while (false !== ($file = readdir($handle))) - { - clearstatcache(); - if (($file != ".") && ($file != "..")) - { - if (is_file($target_dir . DIRECTORY_SEPARATOR . $file)) - { - $documents[] = $file; - } - } - } - closedir($handle); - } - return $documents; -} - -/** - * - */ -function getGrants($dbHandler,$user,$tproject_id,$forceToNo=false) -{ - // User has test project rights - // This talks about Default/Global - // - // key: more or less verbose - // value: string present on rights table - $right2check = - array('project_edit' => 'mgt_modify_product', - 'reqs_view' => "mgt_view_req", - 'monitor_req' => "monitor_requirement", - 'req_tcase_link_management' => "req_tcase_link_management", - 'reqs_edit' => "mgt_modify_req", - 'keywords_view' => "mgt_view_key", - 'keyword_assignment' => "keyword_assignment", - 'keywords_edit' => "mgt_modify_key", - 'platform_management' => "platform_management", - 'platform_view' => "platform_view", - 'issuetracker_management' => "issuetracker_management", - 'issuetracker_view' => "issuetracker_view", - 'codetracker_management' => "codetracker_management", - 'codetracker_view' => "codetracker_view", - 'configuration' => "system_configuraton", - 'cfield_management' => 'cfield_management', - 'cfield_view' => 'cfield_view', - 'cfield_assignment' => 'cfield_assignment', - 'usergroups' => "mgt_view_usergroups", - 'view_tc' => "mgt_view_tc", - 'view_testcase_spec' => "mgt_view_tc", - 'project_inventory_view' => 'project_inventory_view', - 'project_inventory_management' => 'project_inventory_management', - 'modify_tc' => 'mgt_modify_tc', - 'exec_edit_notes' => 'exec_edit_notes', - 'exec_delete' => 'exec_delete', - 'testplan_unlink_executed_testcases' => 'testplan_unlink_executed_testcases', - 'testproject_delete_executed_testcases' => 'testproject_delete_executed_testcases', - 'exec_ro_access' => 'exec_ro_access'); - if ($forceToNo) { - $grants = array_fill_keys(array_keys($right2check), 'no'); - return $grants; - } - - - $grants['project_edit'] = $user->hasRight($dbHandler,$right2check['project_edit'],$tproject_id); - - /** redirect admin to create testproject if not found */ - if ($grants['project_edit'] && !isset($_SESSION['testprojectID'])) { - redirect($_SESSION['basehref'] . 'lib/project/projectEdit.php?doAction=create'); - exit(); - } - - - foreach($right2check as $humankey => $right) { - $grants[$humankey] = $user->hasRight($dbHandler,$right,$tproject_id); - } - - - // check right ONLY if option is enables - if($_SESSION['testprojectOptions']->inventoryEnabled) { - $invr = array('project_inventory_view','project_inventory_management'); - foreach($invr as $r){ - $grants[$r] = ($user->hasRight($dbHandler,$r,$tproject_id) == 'yes') ? 1 : 0; - } - } - - return $grants; +get_accessible_for_user($user->dbID, + array( + 'output' => 'map_name_with_inactive_mark' + )); +$tprojectQty = $tproject_mgr->getItemCount(); +$userIsBlindFolded = (is_null($accessibleItems) || count($accessibleItems) == 0) && + $tprojectQty > 0; + +if ($userIsBlindFolded) { + $testprojectID = $testplanID = 0; + $_SESSION['testprojectTopMenu'] = ''; +} + +$tplan2check = null; +$currentUser = $_SESSION['currentUser']; +$userID = $currentUser->dbID; + +$gui = new stdClass(); +$gui->grants = getGrants($db, $user, $testprojectID, $userIsBlindFolded); + +$gui->hasTestCases = false; + +if ($gui->grants['view_tc']) { + $gui->hasTestCases = $tproject_mgr->count_testcases($testprojectID) > 0 ? 1 : 0; +} + +$gui->hasKeywords = false; +if ($gui->hasTestCases) { + $gui->hasKeywords = $tproject_mgr->hasKeywords($testprojectID); +} + +// ----- Test Plan Section -------------------------------- +/** + * + * @todo - franciscom - we must understand if these two calls are really needed, + * or is enough just call to getAccessibleTestPlans() + */ +$filters = array( + 'plan_status' => ACTIVE +); +$gui->num_active_tplans = $tproject_mgr->getActiveTestPlansCount($testprojectID); + +// get Test Plans available for the user +$arrPlans = (array) $currentUser->getAccessibleTestPlans($db, $testprojectID); + +if ($testplanID > 0) { + // if this test plan is present on $arrPlans + // OK we will set it on $arrPlans as selected one. + // else + // need to set test plan on session + // + $index = 0; + $found = 0; + $loop2do = count($arrPlans); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if ($arrPlans[$idx]['id'] == $testplanID) { + $found = 1; + $index = $idx; + break; + } + } + if ($found == 0) { + // update test plan id + $index = 0; + $testplanID = $arrPlans[$index]['id']; + } + + setSessionTestPlan($arrPlans[$index]); + $arrPlans[$index]['selected'] = 1; +} + +$gui->testplanRole = null; +if ($testplanID) { + + $rd = null; + // Role can be configured or inherited + if (isset($currentUser->tplanRoles[$testplanID])) { + // Configured + $role = $currentUser->tplanRoles[$testplanID]; + $rd = $role->getDisplayName(); + } else { + if (config_get('testplan_role_inheritance_mode') == 'global') { + $rd = $currentUser->globalRole->name; + } + } + + if (null != $rd) { + $gui->testplanRole = $tlCfg->gui->role_separator_open . $rd . + $tlCfg->gui->role_separator_close; + } +} +$rights2check = array( + 'testplan_execute', + 'testplan_create_build', + 'testplan_metrics', + 'testplan_planning', + 'testplan_user_role_assignment', + 'mgt_testplan_create', + 'cfield_view', + 'cfield_management', + 'testplan_milestone_overview', + 'exec_testcases_assigned_to_me', + 'exec_assign_testcases', + 'exec_ro_access', + 'testplan_add_remove_platforms', + 'testplan_update_linked_testcase_versions', + 'testplan_set_urgent_testcases', + 'testplan_show_testcases_newest_versions' +); + +foreach ($rights2check as $the_right) { + $gui->grants[$the_right] = $userIsBlindFolded ? 'no' : $currentUser->hasRight( + $db, $the_right, $testprojectID, $testplanID); +} + +$gui->grants['tproject_user_role_assignment'] = "no"; +if ($currentUser->hasRight($db, "testproject_user_role_assignment", + $testprojectID, - 1) == "yes" || + $currentUser->hasRight($db, "user_role_assignment", null, - 1) == "yes") { + $gui->grants['tproject_user_role_assignment'] = "yes"; +} + +$gui->url = array( + 'metrics_dashboard' => 'lib/results/metricsDashboard.php', + 'testcase_assignments' => 'lib/testcases/tcAssignedToUser.php' +); +$gui->launcher = 'lib/general/frmWorkArea.php'; +$gui->arrPlans = $arrPlans; +$gui->countPlans = count($gui->arrPlans); + +$gui->testprojectID = $testprojectID; +$gui->testplanID = $testplanID; + +$gui->docs = config_get('userDocOnDesktop') ? getUserDocumentation() : null; + +$secCfg = config_get('config_check_warning_frequence'); +$gui->securityNotes = ''; +if ((strcmp($secCfg, 'ALWAYS') == 0) || + (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && + ! isset($_SESSION['getSecurityNotesOnMainPageDone']))) { + $_SESSION['getSecurityNotesOnMainPageDone'] = 1; + $gui->securityNotes = getSecurityNotes($db); +} + +$gui->opt_requirements = isset( + $_SESSION['testprojectOptions']->requirementsEnabled) ? $_SESSION['testprojectOptions']->requirementsEnabled : null; + +$gui->plugins = array(); +foreach (array( + 'EVENT_LEFTMENU_TOP', + 'EVENT_LEFTMENU_BOTTOM', + 'EVENT_RIGHTMENU_TOP', + 'EVENT_RIGHTMENU_BOTTOM' +) as $menu_item) { + # to be compatible with PHP 5.4 + $menu_content = event_signal($menu_item); + if (! empty($menu_content)) { + $gui->plugins[$menu_item] = $menu_content; + } +} + +$tplKey = 'mainPage'; +$tpl = $tplKey . '.tpl'; +$tplCfg = config_get('tpl'); +if (null !== $tplCfg && isset($tplCfg[$tplKey])) { + $tpl = $tplCfg->$tplKey; +} + +$smarty->assign('gui', $gui); +$smarty->display($tpl); + +/** + * Get User Documentation + * based on contribution by Eugenia Drosdezki + * + * @return NULL|string|boolean + */ +function getUserDocumentation() +{ + $target_dir = '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . + 'docs'; + $documents = null; + + if ($handle = opendir($target_dir)) { + while (false !== ($file = readdir($handle))) { + clearstatcache(); + if (($file != ".") && ($file != "..") && + is_file($target_dir . DIRECTORY_SEPARATOR . $file)) { + $documents[] = $file; + } + } + closedir($handle); + } + return $documents; +} + +/** + * Get grants + * + * Returns an array with the corresponding permissions and shares + * + * @param database $dbHandler + * @param tlUser $user + * @param int $tproject_id + * @param boolean $forceToNo + * @return array|number + */ +function getGrants($dbHandler, $user, $tproject_id, $forceToNo = false) +{ + // User has test project rights + // This talks about Default/Global + // + // key: more or less verbose + // value: string present on rights table + $right2check = array( + 'project_edit' => 'mgt_modify_product', + 'reqs_view' => "mgt_view_req", + 'monitor_req' => "monitor_requirement", + 'req_tcase_link_management' => "req_tcase_link_management", + 'reqs_edit' => "mgt_modify_req", + 'keywords_view' => "mgt_view_key", + 'keyword_assignment' => "keyword_assignment", + 'keywords_edit' => "mgt_modify_key", + 'platform_management' => "platform_management", + 'platform_view' => "platform_view", + 'issuetracker_management' => "issuetracker_management", + 'issuetracker_view' => "issuetracker_view", + 'codetracker_management' => "codetracker_management", + 'codetracker_view' => "codetracker_view", + 'configuration' => "system_configuraton", + 'cfield_management' => 'cfield_management', + 'cfield_view' => 'cfield_view', + 'cfield_assignment' => 'cfield_assignment', + 'usergroups' => "mgt_view_usergroups", + 'view_tc' => "mgt_view_tc", + 'view_testcase_spec' => "mgt_view_tc", + 'project_inventory_view' => 'project_inventory_view', + 'project_inventory_management' => 'project_inventory_management', + 'modify_tc' => 'mgt_modify_tc', + 'exec_edit_notes' => 'exec_edit_notes', + 'exec_delete' => 'exec_delete', + 'testplan_unlink_executed_testcases' => 'testplan_unlink_executed_testcases', + 'testproject_delete_executed_testcases' => 'testproject_delete_executed_testcases', + 'exec_ro_access' => 'exec_ro_access' + ); + if ($forceToNo) { + return array_fill_keys(array_keys($right2check), 'no'); + } + + $grants['project_edit'] = $user->hasRight($dbHandler, + $right2check['project_edit'], $tproject_id); + + /** + * redirect admin to create testproject if not found + */ + if ($grants['project_edit'] && ! isset($_SESSION['testprojectID'])) { + redirect( + $_SESSION['basehref'] . 'lib/project/projectEdit.php?doAction=create'); + exit(); + } + + foreach ($right2check as $humankey => $right) { + $grants[$humankey] = $user->hasRight($dbHandler, $right, $tproject_id); + } + + // check right ONLY if option is enables + if ($_SESSION['testprojectOptions']->inventoryEnabled) { + $invr = array( + 'project_inventory_view', + 'project_inventory_management' + ); + foreach ($invr as $r) { + $grants[$r] = ($user->hasRight($dbHandler, $r, $tproject_id) == 'yes') ? 1 : 0; + } + } + + return $grants; } diff --git a/lib/general/navBar.php b/lib/general/navBar.php index 92a7d79249..3f07a632b1 100644 --- a/lib/general/navBar.php +++ b/lib/general/navBar.php @@ -1,230 +1,251 @@ -assign('gui',$gui); -$smarty->display('navBar.tpl'); - - -/** - * - */ -function getGrants(&$db,&$userObj) -{ - $grants = new stdClass(); - $grants->view_testcase_spec = $userObj->hasRightOnProj($db,"mgt_view_tc"); - return $grants; -} - -/** - * - */ -function init_args(&$dbH) -{ - $iParams = array("testproject" => array(tlInputParameter::INT_N), - "tproject_id" => array(tlInputParameter::INT_N), - "caller" => array(tlInputParameter::STRING_N,1,6), - "viewer" => array(tlInputParameter::STRING_N, 0, 3) - ); - $args = new stdClass(); - $pParams = G_PARAMS($iParams,$args); - - /* - if( is_null($args->viewer) || $args->viewer == '' ) - { - $args->viewer = isset($_SESSION['viewer']) ? $_SESSION['viewer'] : null; - } - */ - $args->ssodisable = getSSODisable(); - $args->user = $_SESSION['currentUser']; - - $args->testproject = intval($args->testproject); - $args->tproject_id = intval($args->tproject_id); - - // Check if any project exists to display error - $args->newInstallation = false; - if($args->testproject <= 0 || $args->tproject_id <= 0) { - $sch = tlObject::getDBTables( - array('testprojects','nodes_hierarchy')); - $sql = " SELECT NH.id, NH.name - FROM {$sch['nodes_hierarchy']} NH - JOIN {$sch['testprojects']} TPRJ - ON TPRJ.id = NH.id "; - $rs = (array)$dbH->get_recordset($sql); - - if(count($rs) == 0) { - $args->newInstallation = true; - } - } - - return $args; -} - -/** - * - */ -function initializeGui(&$db,&$args) { - $tproject_mgr = new testproject($db); - $guiCfg = config_get("gui"); - - $gui = new stdClass(); - - $opx = array('output' => 'map_name_with_inactive_mark', - 'field_set' => $guiCfg->tprojects_combo_format, - 'order_by' => $guiCfg->tprojects_combo_order_by); - - $gui->TestProjects = - $tproject_mgr->get_accessible_for_user($args->user->dbID,$opx); - - $gui->TestProjectCount = sizeof($gui->TestProjects); - if($gui->TestProjectCount == 0) { - $gui->TestProjects = null; - } - - if ($args->tproject_id >0) { - $gui->tprojectID = $args->tproject_id; - } else { - $kiki = 'testprojectID'; - $gui->tprojectID = intval(isset($_SESSION[$kiki]) - ? $_SESSION[$kiki] : 0); - } - $gui->tproject_id = $gui->tprojectID; - - if($gui->tproject_id <= 0 ) { - $ckObj = new stdClass(); - $ckCfg = config_get('cookie'); - - // Try to get from Cookie - $ckObj->name = $ckCfg->testProjectMemory . - intval($_SESSION['userID']); - - if( isset($_COOKIE[$ckObj->name]) ) { - $gui->tproject_id = $gui->tprojectID = intval($_COOKIE[$ckObj->name]); - } - } - - if($gui->tproject_id <= 0 && !$args->newInstallation) { - // Well instead of this, try to get the firts test project - // user is enabled to. - if( 0 == $gui->TestProjectCount ) { - throw new Exception("Can't work without Test Project ID", 1); - } - $theOne = current(array_keys($gui->TestProjects)); - $gui->tproject_id = $gui->tprojectID = $theOne; - } - - $gui->tcasePrefix = ''; - $gui->searchSize = 8; - $gui->tcasePrefix = - $tproject_mgr->getTestCasePrefix($gui->tproject_id) . - config_get('testcase_cfg')->glue_character; - $gui->searchSize = tlStringLen($gui->tcasePrefix) + - $guiCfg->dynamic_quick_tcase_search_input_size; - - $gui->TestPlanCount = 0; - - $tprojectQty = $tproject_mgr->getItemCount(); - if($gui->TestProjectCount == 0 && $tprojectQty > 0) { - // User rights configurations does not allow access to ANY test project - $_SESSION['testprojectTopMenu'] = ''; - $gui->tproject_id = 0; - } - - if($gui->tproject_id) { - $testPlanSet = - (array)$args->user->getAccessibleTestPlans($db,$gui->tproject_id); - $gui->TestPlanCount = sizeof($testPlanSet); - - $tplanID = isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : null; - if( !is_null($tplanID) ) { - // Need to set this info on session - // with first Test Plan from $testPlanSet - // if this test plan is present on $testPlanSet - // OK we will set it on $testPlanSet as selected one. - // else - // need to set test plan on session - // - $index=0; - $testPlanFound=0; - $loop2do=count($testPlanSet); - for($idx=0; $idx < $loop2do; $idx++) { - if( $testPlanSet[$idx]['id'] == $tplanID ) { - $testPlanFound = 1; - $index = $idx; - break; - } - } - - if( $testPlanFound == 0 && is_array($testPlanSet) && count($testPlanSet) > 0) { - $tplanID = $testPlanSet[0]['id']; - setSessionTestPlan($testPlanSet[0]); - } - $testPlanSet[$index]['selected']=1; - } - } - - if ($gui->tproject_id && isset($args->user->tprojectRoles[$gui->tproject_id])) { - // test project specific role applied - $role = $args->user->tprojectRoles[$gui->tprojectID]; - $testprojectRole = $role->getDisplayName(); - } else { - // general role applied - $testprojectRole = $args->user->globalRole->getDisplayName(); - } - $gui->whoami = $args->user->getDisplayName() . ' ' . - $guiCfg->role_separator_open . - $testprojectRole . $guiCfg->role_separator_close; - - - // only when the user has changed project - // using the combo the _GET has this key. - // Use this clue to launch a refresh of other - // frames present on the screen - // using the onload HTML body attribute - $gui->updateMainPage = 0; - // if ($args->testproject > 0 || $args->tproject_id) { - if ($gui->tproject_id >0) { - // set test project ID for the next session - $gui->updateMainPage = is_null($args->caller); - - $ckCfg = config_get('cookie'); - $ckObj = new stdClass(); - $ckObj->name = $ckCfg->testProjectMemory . $args->user->dbID; - $ckObj->value = $gui->tproject_id; - tlSetCookie($ckObj); - } - - $gui->grants = getGrants($db,$args->user); - $gui->viewer = $args->viewer; - - $gui->plugins = array(); - foreach(array('EVENT_TITLE_BAR') as $menu_item) { - $menu_content = event_signal($menu_item); - $gui->plugins[$menu_item] = !empty($menu_content) ? $menu_content : null; - } - - $gui->ssodisable = $args->ssodisable; - $sso = ($args->ssodisable ? '&ssodisable' : ''); - $gui->logout = 'logout.php?viewer=' . $sso; - - // to do not break logic - $gui->testprojectID = $gui->tproject_id; - return $gui; +assign('gui', $gui); +$smarty->display('navBar.tpl'); + +/** + * Get grants + * + * @param database $db + * @param tlUser $userObj + * @return stdClass + */ +function getGrants(&$db, &$userObj) +{ + $grants = new stdClass(); + $grants->view_testcase_spec = $userObj->hasRightOnProj($db, "mgt_view_tc"); + return $grants; +} + +/** + * Get input from user and return it in some sort of namespace + * + * @param database $dbH + * @return stdClass object returns the arguments for the page + */ +function initArgs(&$dbH) +{ + $iParams = array( + "testproject" => array( + tlInputParameter::INT_N + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "caller" => array( + tlInputParameter::STRING_N, + 1, + 6 + ), + "viewer" => array( + tlInputParameter::STRING_N, + 0, + 3 + ) + ); + $args = new stdClass(); + G_PARAMS($iParams, $args); + + $args->ssodisable = getSSODisable(); + $args->user = $_SESSION['currentUser']; + + $args->testproject = intval($args->testproject); + $args->tproject_id = intval($args->tproject_id); + + // Check if any project exists to display error + $args->newInstallation = false; + if ($args->testproject <= 0 || $args->tproject_id <= 0) { + $sch = tlObject::getDBTables(array( + 'testprojects', + 'nodes_hierarchy' + )); + $sql = " SELECT NH.id, NH.name + FROM {$sch['nodes_hierarchy']} NH + JOIN {$sch['testprojects']} TPRJ + ON TPRJ.id = NH.id "; + $rs = (array) $dbH->get_recordset($sql); + + if (count($rs) == 0) { + $args->newInstallation = true; + } + } + + return $args; +} + +/** + * Initialize GUI + * + * @param database $db + * @param stdClass $args + * @return stdClass + */ +function initializeGui(&$db, &$args) +{ + $tproject_mgr = new testproject($db); + $guiCfg = config_get("gui"); + + $gui = new stdClass(); + + $opx = array( + 'output' => 'map_name_with_inactive_mark', + 'field_set' => $guiCfg->tprojects_combo_format, + 'order_by' => $guiCfg->tprojects_combo_order_by + ); + + $gui->TestProjects = $tproject_mgr->get_accessible_for_user( + $args->user->dbID, $opx); + + $gui->TestProjectCount = count($gui->TestProjects); + if ($gui->TestProjectCount == 0) { + $gui->TestProjects = null; + } + + if ($args->tproject_id > 0) { + $gui->tprojectID = $args->tproject_id; + } else { + $kiki = 'testprojectID'; + $gui->tprojectID = intval( + isset($_SESSION[$kiki]) ? $_SESSION[$kiki] : 0); + } + $gui->tproject_id = $gui->tprojectID; + + if ($gui->tproject_id <= 0) { + $ckObj = new stdClass(); + $ckCfg = config_get('cookie'); + + // Try to get from Cookie + $ckObj->name = $ckCfg->testProjectMemory . intval($_SESSION['userID']); + + if (isset($_COOKIE[$ckObj->name])) { + $gui->tproject_id = $gui->tprojectID = intval( + $_COOKIE[$ckObj->name]); + } + } + + if ($gui->tproject_id <= 0 && ! $args->newInstallation) { + // Well instead of this, try to get the firts test project + // user is enabled to. + if (0 == $gui->TestProjectCount) { + throw new Exception("Can't work without Test Project ID", 1); + } + $theOne = current(array_keys($gui->TestProjects)); + $gui->tproject_id = $gui->tprojectID = $theOne; + } + + $gui->tcasePrefix = ''; + $gui->searchSize = 8; + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($gui->tproject_id) . + config_get('testcase_cfg')->glue_character; + $gui->searchSize = tlStringLen($gui->tcasePrefix) + + $guiCfg->dynamic_quick_tcase_search_input_size; + + $gui->TestPlanCount = 0; + + $tprojectQty = $tproject_mgr->getItemCount(); + if ($gui->TestProjectCount == 0 && $tprojectQty > 0) { + // User rights configurations does not allow access to ANY test project + $_SESSION['testprojectTopMenu'] = ''; + $gui->tproject_id = 0; + } + + if ($gui->tproject_id) { + $testPlanSet = (array) $args->user->getAccessibleTestPlans($db, + $gui->tproject_id); + $gui->TestPlanCount = count($testPlanSet); + + $tplanID = isset($_SESSION['testplanID']) ? intval( + $_SESSION['testplanID']) : null; + if (! is_null($tplanID)) { + // Need to set this info on session + // with first Test Plan from $testPlanSet + // if this test plan is present on $testPlanSet + // OK we will set it on $testPlanSet as selected one. + // else + // need to set test plan on session + // + $index = 0; + $testPlanFound = 0; + $loop2do = count($testPlanSet); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if ($testPlanSet[$idx]['id'] == $tplanID) { + $testPlanFound = 1; + $index = $idx; + break; + } + } + + if ($testPlanFound == 0 && is_array($testPlanSet) && + ! empty($testPlanSet)) { + setSessionTestPlan($testPlanSet[0]); + } + $testPlanSet[$index]['selected'] = 1; + } + } + + if ($gui->tproject_id && + isset($args->user->tprojectRoles[$gui->tproject_id])) { + // test project specific role applied + $role = $args->user->tprojectRoles[$gui->tprojectID]; + $testprojectRole = $role->getDisplayName(); + } else { + // general role applied + $testprojectRole = $args->user->globalRole->getDisplayName(); + } + $gui->whoami = $args->user->getDisplayName() . ' ' . + $guiCfg->role_separator_open . $testprojectRole . + $guiCfg->role_separator_close; + + // only when the user has changed project + // using the combo the _GET has this key. + // Use this clue to launch a refresh of other + // frames present on the screen + // using the onload HTML body attribute + $gui->updateMainPage = 0; + // if ($args->testproject > 0 || $args->tproject_id) { + if ($gui->tproject_id > 0) { + // set test project ID for the next session + $gui->updateMainPage = is_null($args->caller); + + $ckCfg = config_get('cookie'); + $ckObj = new stdClass(); + $ckObj->name = $ckCfg->testProjectMemory . $args->user->dbID; + $ckObj->value = $gui->tproject_id; + tlSetCookie($ckObj); + } + + $gui->grants = getGrants($db, $args->user); + $gui->viewer = $args->viewer; + + $gui->plugins = array(); + foreach (array( + 'EVENT_TITLE_BAR' + ) as $menu_item) { + $menu_content = event_signal($menu_item); + $gui->plugins[$menu_item] = ! empty($menu_content) ? $menu_content : null; + } + + $gui->ssodisable = $args->ssodisable; + $sso = ($args->ssodisable ? '&ssodisable' : ''); + $gui->logout = 'logout.php?viewer=' . $sso; + + // to do not break logic + $gui->testprojectID = $gui->tproject_id; + return $gui; } diff --git a/lib/general/show_help.php b/lib/general/show_help.php index bcb29d917e..4f29c192a5 100644 --- a/lib/general/show_help.php +++ b/lib/general/show_help.php @@ -1,41 +1,52 @@ -locale; -$smarty->template_dir = $td; - -$smarty->clear_compiled_tpl($args->help . ".html"); -$smarty->display($args->help . ".html"); - -function init_args() -{ - $iParams = array( - "help" => array(tlInputParameter::STRING_N), - "locale" => array(tlInputParameter::STRING_N,0,10), - ); - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - return $args; -} +locale; +$smarty->template_dir = $td; + +$smarty->clear_compiled_tpl($args->help . ".html"); +$smarty->display($args->help . ".html"); + +/** + * Initializes the arguments + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "help" => array( + tlInputParameter::STRING_N + ), + "locale" => array( + tlInputParameter::STRING_N, + 0, + 10 + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + + return $args; +} ?> diff --git a/lib/general/staticPage.php b/lib/general/staticPage.php index 81c526474a..388051dbc4 100644 --- a/lib/general/staticPage.php +++ b/lib/general/staticPage.php @@ -1,66 +1,68 @@ -pageTitle = ''; -$gui->pageContent = ''; -$gui->refreshTree = $args->refreshTree; - -$pageKey = htmlspecialchars($args->key); -if ($pageKey == "") -{ - exit ("Error: Invalid page parameter."); -} - -// link appropriate definition file and default to en_GB if not present in the current language -$locale = isset($_SESSION['locale']) ? $_SESSION['locale'] : $tlCfg->default_language; -$language = (file_exists('../../locale/' . $locale . '/texts.php')) ? $locale : 'en_GB'; -include('../../locale/'. $language .'/texts.php'); - -if (isset($TLS_htmltext[$pageKey])) -{ - $gui->pageTitle = $TLS_htmltext_title[$pageKey]; - $gui->pageContent = $TLS_htmltext[$pageKey]; -} -else -{ - $gui->pageContent = "Please, ask administrator to update localization file" . - "(<testlink_root>/locale/$locale/texts.php)" . - " - missing key: " . $pageKey; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display('staticPage.tpl'); - - -/** - * init_args() - * - */ -function init_args() -{ - $iParams = array("key" => array(tlInputParameter::STRING_N), - "refreshTree" => array(tlInputParameter::INT_N)); - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - return $args; -} +pageTitle = ''; +$gui->pageContent = ''; +$gui->refreshTree = $args->refreshTree; + +$pageKey = htmlspecialchars($args->key); +if ($pageKey == "") { + exit("Error: Invalid page parameter."); +} + +// link appropriate definition file and default to en_GB if not present in the current language +$locale = isset($_SESSION['locale']) ? $_SESSION['locale'] : $tlCfg->default_language; +$language = (file_exists('../../locale/' . $locale . '/texts.php')) ? $locale : 'en_GB'; +include_once '../../locale/' . $language . '/texts.php'; + +if (isset($TLS_htmltext[$pageKey])) { + $gui->pageTitle = $TLS_htmltext_title[$pageKey]; + $gui->pageContent = $TLS_htmltext[$pageKey]; +} else { + $gui->pageContent = "Please, ask administrator to update localization file" . + "(<testlink_root>/locale/$locale/texts.php)" . " - missing key: " . + $pageKey; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display('staticPage.tpl'); + +/** + * init_args() + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "key" => array( + tlInputParameter::STRING_N + ), + "refreshTree" => array( + tlInputParameter::INT_N + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + return $args; +} ?> diff --git a/lib/inventory/deleteInventory.php b/lib/inventory/deleteInventory.php index e25b2431fb..d04e8bc1d8 100644 --- a/lib/inventory/deleteInventory.php +++ b/lib/inventory/deleteInventory.php @@ -1,61 +1,68 @@ -hasRight($db,"project_inventory_management")) { - $tlIs = new tlInventory($args->testprojectId, $db); - $data['success'] = $tlIs->deleteInventory($args->machineID); - $data['success'] = ($data['success'] == 1 /*$tlIs->OK*/) ? true : false; - $data['userfeedback'] = $tlIs->getUserFeedback(); -} else { - tLog('User has not rights to set a device!','ERROR'); - $data['userfeedback'] = lang_get('inventory_msg_no_rights'); +hasRight($db, "project_inventory_management")) { + $tlIs = new tlInventory($args->testprojectId, $db); + $data['success'] = $tlIs->deleteInventory($args->machineID); + $data['success'] = ($data['success'] == 1 /* $tlIs->OK */) ? true : false; + $data['userfeedback'] = $tlIs->getUserFeedback(); +} else { + tLog('User has not rights to set a device!', 'ERROR'); + $data['userfeedback'] = lang_get('inventory_msg_no_rights'); +} + +echo json_encode($data); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass object returns the arguments for the page + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $iParams = array( + "machineID" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + // from session + $args->testprojectId = intval($_SESSION['testprojectID']); + $args->userId = intval($_SESSION['userID']); + + return $args; +} + +/** + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "project_inventory_management"); } - -echo json_encode($data); - -/** - * - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $iParams = array("machineID" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - // from session - $args->testprojectId = intval($_SESSION['testprojectID']); - $args->userId = intval($_SESSION['userID']); - - return $args; -} - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"project_inventory_management"); -} \ No newline at end of file diff --git a/lib/inventory/getInventory.php b/lib/inventory/getInventory.php index 6cd726bc71..fdcdf2094c 100644 --- a/lib/inventory/getInventory.php +++ b/lib/inventory/getInventory.php @@ -1,35 +1,34 @@ -getAll(); - -$tlUser = new tlUser(intval($_SESSION['userID'])); -$users = $tlUser->getNames($db); - -// fill login instead of user ID -if (!is_null($data)) { - foreach ($data as $k => $v) { - if ($v['owner_id'] != '0') { - $data[$k]['owner'] = $users[$v['owner_id']]['login']; - } else { - $data[$k]['owner'] = ''; - } - } -} -echo json_encode($data); \ No newline at end of file +getAll(); + +$tlUser = new tlUser(intval($_SESSION['userID'])); +$users = $tlUser->getNames($db); + +// fill login instead of user ID +if (! is_null($data)) { + foreach ($data as $k => $v) { + if ($v['owner_id'] != '0') { + $data[$k]['owner'] = $users[$v['owner_id']]['login']; + } else { + $data[$k]['owner'] = ''; + } + } +} +echo json_encode($data); diff --git a/lib/inventory/inventoryView.php b/lib/inventory/inventoryView.php index 3631c843f9..2f7f47265d 100644 --- a/lib/inventory/inventoryView.php +++ b/lib/inventory/inventoryView.php @@ -1,25 +1,24 @@ -rightEdit = has_rights($db,"project_inventory_management"); -$gui->rightView = has_rights($db,"project_inventory_view"); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); \ No newline at end of file +rightEdit = has_rights($db, "project_inventory_management"); +$gui->rightView = has_rights($db, "project_inventory_view"); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); diff --git a/lib/inventory/setInventory.php b/lib/inventory/setInventory.php index 4c5ccb2210..6ca16d55db 100644 --- a/lib/inventory/setInventory.php +++ b/lib/inventory/setInventory.php @@ -1,57 +1,81 @@ -hasRight($db,"project_inventory_management")) { - $tproj_id = intval($_SESSION['testprojectID']); - $tlIs = new tlInventory($tproj_id, $db); - $data['success'] = $tlIs->setInventory($args); - $data['success'] = ($data['success'] == 1 /*$tlIs->OK*/) ? true : false; - $data['userfeedback'] = $tlIs->getUserFeedback(); - $data['record'] = $tlIs->getCurrentData(); +hasRight($db, "project_inventory_management")) { + $tproj_id = intval($_SESSION['testprojectID']); + $tlIs = new tlInventory($tproj_id, $db); + $data['success'] = $tlIs->setInventory($args); + $data['success'] = ($data['success'] == 1 /* $tlIs->OK */) ? true : false; + $data['userfeedback'] = $tlIs->getUserFeedback(); + $data['record'] = $tlIs->getCurrentData(); +} else { + tLog('User has not rights to set a device!', 'ERROR'); + $data['userfeedback'] = lang_get('inventory_msg_no_rights'); +} + +echo json_encode($data); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass object returns the arguments for the page + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $iParams = array( + "machineID" => array( + tlInputParameter::INT_N + ), + "machineOwner" => array( + tlInputParameter::INT_N + ), + "machineName" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "machineIp" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "machineNotes" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ), + "machinePurpose" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ), + "machineHw" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + return $args; } -else { - tLog('User has not rights to set a device!','ERROR'); - $data['userfeedback'] = lang_get('inventory_msg_no_rights'); -} - -echo json_encode($data); - -/** - * - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $iParams = - array("machineID" => array(tlInputParameter::INT_N), - "machineOwner" => array(tlInputParameter::INT_N), - "machineName" => array(tlInputParameter::STRING_N,0,255), - "machineIp" => array(tlInputParameter::STRING_N,0,50), - "machineNotes" => array(tlInputParameter::STRING_N,0,2000), - "machinePurpose" => array(tlInputParameter::STRING_N,0,2000), - "machineHw" => array(tlInputParameter::STRING_N,0,2000), - ); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - return $args; -} \ No newline at end of file diff --git a/lib/issuetrackerintegration/bugzilladbInterface.class.php b/lib/issuetrackerintegration/bugzilladbInterface.class.php index 9d0409814a..d18c556e1a 100644 --- a/lib/issuetrackerintegration/bugzilladbInterface.class.php +++ b/lib/issuetrackerintegration/bugzilladbInterface.class.php @@ -1,157 +1,153 @@ -connected ) - { - // For bugzilla status code is not important. - // Design Choice make it equal to verbose. Important bugzilla uses UPPERCASE - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 'RESOLVED', 'verbose' => 'RESOLVED'); - $this->defaultResolvedStatus[] = array('code' => 'VERIFIED', 'verbose' => 'VERIFIED'); - $this->defaultResolvedStatus[] = array('code' => 'CLOSED', 'verbose' => 'CLOSED'); - - $this->setResolvedStatusCfg(); - - - $this->interfaceViaDB = true; - $this->guiCfg = array('use_decoration' => true); // add [] on summary - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - } - } - - - - function getissue($id) - { - if (!$this->isConnected()) - { - return null; - } - - $sql = " SELECT bug_id AS id,short_desc AS summary,bug_status AS status" . - " FROM " . ( !is_null($this->cfg->dbschema) ? " {$this->cfg->dbschema}.bugs " : 'bugs') . - " WHERE bug_id = '{$id}' "; - $rs = $this->dbConnection->fetchRowsIntoMap($sql,'id'); - $issue = null; - - if( !is_null($rs) ) - { - $issue = new stdClass(); - - $issue->id = $id; // useful on spreadsheet export - $issue->summary = $rs[$id]['summary']; // useful on spreadsheet export - - $issue->IDHTMLString = "{$id} : "; - $issue->statusCode = $issue->statusVerbose = $rs[$id]['status']; - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->statusVerbose); - $issue->statusColor = isset($this->status_color[$issue->statusVerbose]) ? - $this->status_color[$issue->statusVerbose] : 'white'; - - $issue->summaryHTMLString = $rs[$id]['summary']; - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - - } - return $issue; - } - - - /** - * Returns the status of the bug with the given id - * this function is not directly called by TestLink. - * - * @return string returns the status of the given bug (if found in the db), or null else - **/ - function getBugStatus($id) - { - if (!$this->isConnected()) - { - return null; - } - $issue = $this->getIssue($id); - - return is_null($issue) ? $issue : $issue->statusVerbose; - } - - - /** - * checks is bug id is present on BTS - * - * @return integer returns 1 if the bug with the given id exists - **/ - function checkBugIDExistence($id) - { - $status_ok = 0; - $issue = $this->getIssue($id); - - return !is_null($issue) ? 1 : 0; - } - - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - - $template = "\n" . - "\n" . - "DATABASE SERVER NAME\n" . - "DATABASE NAME\n" . - "DATABASE NAME\n" . - "mysql\n" . - "USER\n" . - "PASSWORD\n" . - "http://[bugzillaserver]/bugzilla/\n" . - "http://[bugzillaserver]/bugzilla/show_bug.cgi?id=\n" . - "\n"; - return $template; - } - - -} \ No newline at end of file +connected) { + // For bugzilla status code is not important. + // Design Choice make it equal to verbose. Important bugzilla uses UPPERCASE + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 'RESOLVED', + 'verbose' => 'RESOLVED' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'VERIFIED', + 'verbose' => 'VERIFIED' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'CLOSED', + 'verbose' => 'CLOSED' + ); + + $this->setResolvedStatusCfg(); + + $this->interfaceViaDB = true; + $this->guiCfg = array( + 'use_decoration' => true + ); // add [] on summary + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + } + } + + public function getissue($id) + { + if (! $this->isConnected()) { + return null; + } + + $sql = " SELECT bug_id AS id,short_desc AS summary,bug_status AS status" . + " FROM " . + (! is_null($this->cfg->dbschema) ? " {$this->cfg->dbschema}.bugs " : 'bugs') . + " WHERE bug_id = '{$id}' "; + $rs = $this->dbConnection->fetchRowsIntoMap($sql, 'id'); + $issue = null; + + if (! is_null($rs)) { + $issue = new stdClass(); + + $issue->id = $id; // useful on spreadsheet export + $issue->summary = $rs[$id]['summary']; // useful on spreadsheet export + + $issue->IDHTMLString = "{$id} : "; + $issue->statusCode = $issue->statusVerbose = $rs[$id]['status']; + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->statusVerbose); + $issue->statusColor = isset( + $this->status_color[$issue->statusVerbose]) ? $this->status_color[$issue->statusVerbose] : 'white'; + + $issue->summaryHTMLString = $rs[$id]['summary']; + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + } + return $issue; + } + + /** + * Returns the status of the bug with the given id + * this function is not directly called by TestLink. + * + * @return string returns the status of the given bug (if found in the db), or null else + */ + public function getBugStatus($id) + { + if (! $this->isConnected()) { + return null; + } + $issue = $this->getIssue($id); + + return is_null($issue) ? $issue : $issue->statusVerbose; + } + + /** + * checks is bug id is present on BTS + * + * @return integer returns 1 if the bug with the given id exists + */ + public function checkBugIDExistence($id) + { + $issue = $this->getIssue($id); + + return ! is_null($issue) ? 1 : 0; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "DATABASE SERVER NAME\n" . + "DATABASE NAME\n" . + "DATABASE NAME\n" . "mysql\n" . + "USER\n" . "PASSWORD\n" . + "http://[bugzillaserver]/bugzilla/\n" . + "http://[bugzillaserver]/bugzilla/show_bug.cgi?id=\n" . + "\n"; + } +} diff --git a/lib/issuetrackerintegration/bugzillaxmlrpcInterface.class.php b/lib/issuetrackerintegration/bugzillaxmlrpcInterface.class.php index 64922032e0..bd63527fc9 100644 --- a/lib/issuetrackerintegration/bugzillaxmlrpcInterface.class.php +++ b/lib/issuetrackerintegration/bugzillaxmlrpcInterface.class.php @@ -1,473 +1,468 @@ -interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - $this->guiCfg = array('use_decoration' => true); // add [] on summary - - $this->name = $name; - if( !$this->setCfg($config) ) - { - return false; - } - - $this->completeCfg(); - $this->connect(); - - // For bugzilla status code is not important. - // Design Choice make it equal to verbose. Important bugzilla uses UPPERCASE - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 'RESOLVED', 'verbose' => 'RESOLVED'); - $this->defaultResolvedStatus[] = array('code' => 'VERIFIED', 'verbose' => 'VERIFIED'); - $this->defaultResolvedStatus[] = array('code' => 'CLOSED', 'verbose' => 'CLOSED'); - - $this->setResolvedStatusCfg(); - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - if( !property_exists($this->cfg,'urixmlrpc') ) - { - $this->cfg->urixmlrpc = $base . 'xmlrpc.cgi'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'show_bug.cgi?id='; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base; - } - - $this->issueDefaults = array('version' => 'unspecified', 'severity' => 'Trivial', - 'op_sys' => 'All', 'priority' => 'Normal','platform' => "All",); - foreach($this->issueDefaults as $prop => $default) - { - $this->cfg->$prop = (string)(property_exists($this->cfg,$prop) ? $this->cfg->$prop : $default); - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $this->createAPIClient(); - $this->connected = true; - } - catch(Exception $e) - { - $logDetails = ''; - foreach(array('uribase','apikey') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - public function getIssue($issueID) - { - $issue = null; - - $resp = array(); - $login = $this->login(); - $resp = array_merge($resp,(array)$login['response']); - - - $method = 'Bug.get'; - $args = array(array('ids' => array(intval($issueID)), 'permissive' => true)); - if (isset($login['userToken'])) - { - $args[0]['Bugzilla_token'] = $login['userToken']; - } - $resp[$method] = $this->APIClient->call($method, $args); - - - $op = $this->logout($login['userToken']); - $resp = array_merge($resp,(array)$op['response']); - - - if(count($resp['Bug.get']['faults']) == 0) - { - $issue = new stdClass(); - $issue->id = $issueID; - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = $issue->statusVerbose = $resp['Bug.get']['bugs'][0]['status']; - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->statusVerbose); - $issue->summary = $issue->summaryHTMLString = $resp['Bug.get']['bugs'][0]['summary']; - } - else - { - tLog(__METHOD__ . ' :: ' . $resp['Bug.get']['faults'][0]['faultString'], 'ERROR'); - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - $str = $issue->summaryHTMLString; - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - return $str; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - - /** - * - * - **/ - function createAPIClient() - { - // echo __METHOD__ .'
    '; - try - { - $this->APIClient = new Zend_XmlRpc_Client((string)$this->cfg->urixmlrpc); - $httpClient = new Zend_Http_Client(); - $httpClient->setCookieJar(); - $this->APIClient->setHttpClient($httpClient); - } - catch(Exception $e) - { - $this->connected = false; - tLog(__METHOD__ . $e->getMessage(), 'ERROR'); - } - } - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "USERNAME\n" . - "PASSWORD\n" . - "http://bugzilla.mozilla.org/\n" . - "\n". - "BUGZILLA PRODUCT\n" . - "BUGZILLA PRODUCT\n" . - "\n". - " \n". - "\n"; - - return $template; - } - - - function getAccessibleProducts() - { - $issue = null; - - $resp = array(); - $login = $this->login(); - $resp = array_merge($resp,(array)$login['response']); - - $method = 'Product.get_accessible_products'; - $args = array(array()); - if (isset($login['userToken'])) - { - $args[0]['Bugzilla_token'] = $login['userToken']; - } - $itemSet = $this->APIClient->call($method, $args); - - $op = $this->logout($login['userToken']); - $resp = array_merge($resp,(array)$op['response']); - - return $itemSet; - } - - /** - * - */ - function getProduct($id) - { - $issue = null; - $resp = array(); - $login = $this->login(); - $resp = array_merge($resp,(array)$login['response']); - - $method = 'Product.get'; - $args = array(array('ids' => array(intval($id)))); - if (isset($login['userToken'])) - { - $args[0]['Bugzilla_token'] = $login['userToken']; - } - $itemSet = $this->APIClient->call($method,$args); - - $op = $this->logout($login['userToken']); - $resp = array_merge($resp,(array)$op['response']); - - return $itemSet; - } - - // good info from: - // http://petehowe.co.uk/2010/example-of-calling-the-bugzilla-api-using-php-zend-framework/ - // - // From BUGZILLA DOCS - // - // Returns - // A hash with one element, id. This is the id of the newly-filed bug. - // - // Errors - // - // 51 (Invalid Object) - // The component you specified is not valid for this Product. - // - // 103 (Invalid Alias) - // The alias you specified is invalid for some reason. See the error message for more details. - // - // 104 (Invalid Field) - // One of the drop-down fields has an invalid value, or a value entered in a text field is too long. - // The error message will have more detail. - // - // 105 (Invalid Component) - // You didn't specify a component. - // - // 106 (Invalid Product) - // Either you didn't specify a product, this product doesn't exist, or you don't have permission - // to enter bugs in this product. - // - // 107 (Invalid Summary) - // You didn't specify a summary for the bug. - // - // 504 (Invalid User) - // Either the QA Contact, Assignee, or CC lists have some invalid user in them. - // The error message will have more details. - // - - - function addIssue($summary,$description) - { - $issue = null; - $resp = array(); - $login = $this->login(); - $resp = array_merge($resp,(array)$login['response']); - - $method = 'Bug.create'; - $issue = array('product' => (string)$this->cfg->product, - 'component' => (string)$this->cfg->component, - 'summary' => $summary, - 'description' => $description); - - - foreach($this->issueDefaults as $prop => $default) - { - $issue[$prop] = (string)$this->cfg->$prop; - } - - $args = array($issue); - if (isset($login['userToken'])) - { - $args[0]['Bugzilla_token'] = $login['userToken']; - } - - - $op = $this->APIClient->call($method,$args); - if( ($op['status_ok'] = ($op['id'] > 0)) ) - { - $op['msg'] = sprintf(lang_get('bugzilla_bug_created'),$summary,$issue['product']); - } - else - { - $msg = "Create BUGZILLA Ticket FAILURE "; - $op= array('status_ok' => false, 'id' => -1, - 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - tLog($msg, 'WARNING'); - } - - $logout = $this->logout($login['userToken']); - $resp = array_merge($resp,(array)$logout['response']); - - return $op; - } - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'product') && property_exists($this->cfg, 'component')); - } - - - - /** - * - **/ - private function login() - { - $args = array(array('login' => (string)$this->cfg->username, - 'password' => (string)$this->cfg->password,'remember' => 1)); - $ret = array(); - $ret['response']['User.login'] = $this->APIClient->call('User.login', $args); - $ret['userToken'] = $ret['response']['User.login']['token']; - return $ret; - } - - - /** - * - **/ - private function logout($userToken=null) - { - $args = array(array()); - if( !is_null($userToken) ) - { - $args[0]['Bugzilla_token'] = $userToken; - } - - $ret = array(); - $ret['response']['User.logout'] = $this->APIClient->call('User.logout', $args); - return $ret; - } - -} \ No newline at end of file +interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + $this->guiCfg = array( + 'use_decoration' => true + ); // add [] on summary + + $this->name = $name; + if (! $this->setCfg($config)) { + return false; + } + + $this->completeCfg(); + $this->connect(); + + // For bugzilla status code is not important. + // Design Choice make it equal to verbose. Important bugzilla uses UPPERCASE + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 'RESOLVED', + 'verbose' => 'RESOLVED' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'VERIFIED', + 'verbose' => 'VERIFIED' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'CLOSED', + 'verbose' => 'CLOSED' + ); + + $this->setResolvedStatusCfg(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + if (! property_exists($this->cfg, 'urixmlrpc')) { + $this->cfg->urixmlrpc = $base . 'xmlrpc.cgi'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'show_bug.cgi?id='; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base; + } + + $this->issueDefaults = array( + 'version' => 'unspecified', + 'severity' => 'Trivial', + 'op_sys' => 'All', + 'priority' => 'Normal', + 'platform' => "All" + ); + foreach ($this->issueDefaults as $prop => $default) { + $this->cfg->$prop = (string) (property_exists($this->cfg, $prop) ? $this->cfg->$prop : $default); + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + * + */ + public function connect() + { + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $this->createAPIClient(); + $this->connected = true; + } catch (Exception $e) { + $logDetails = ''; + foreach (array( + 'uribase', + 'apikey' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + $issue = null; + + $resp = array(); + $login = $this->login(); + $resp = array_merge($resp, (array) $login['response']); + + $method = 'Bug.get'; + $args = array( + array( + 'ids' => array( + intval($issueID) + ), + 'permissive' => true + ) + ); + if (isset($login['userToken'])) { + $args[0]['Bugzilla_token'] = $login['userToken']; + } + $resp[$method] = $this->APIClient->call($method, $args); + + $op = $this->logout($login['userToken']); + $resp = array_merge($resp, (array) $op['response']); + + if (count($resp['Bug.get']['faults']) == 0) { + $issue = new stdClass(); + $issue->id = $issueID; + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = $issue->statusVerbose = $resp['Bug.get']['bugs'][0]['status']; + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->statusVerbose); + $issue->summary = $issue->summaryHTMLString = $resp['Bug.get']['bugs'][0]['summary']; + } else { + tLog( + __METHOD__ . ' :: ' . + $resp['Bug.get']['faults'][0]['faultString'], 'ERROR'); + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + * + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + $str = $issue->summaryHTMLString; + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + return $str; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + */ + private function createAPIClient() + { + try { + $this->APIClient = new Zend_XmlRpc_Client( + (string) $this->cfg->urixmlrpc); + $httpClient = new Zend_Http_Client(); + $httpClient->setCookieJar(); + $this->APIClient->setHttpClient($httpClient); + } catch (Exception $e) { + $this->connected = false; + tLog(__METHOD__ . $e->getMessage(), 'ERROR'); + } + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "USERNAME\n" . "PASSWORD\n" . + "http://bugzilla.mozilla.org/\n" . + "\n" . + "BUGZILLA PRODUCT\n" . + "BUGZILLA PRODUCT\n" . + "\n" . + " \n" . "\n"; + } + + private function getAccessibleProducts() + { + $resp = array(); + $login = $this->login(); + $resp = array_merge($resp, (array) $login['response']); + + $method = 'Product.get_accessible_products'; + $args = array( + array() + ); + if (isset($login['userToken'])) { + $args[0]['Bugzilla_token'] = $login['userToken']; + } + $itemSet = $this->APIClient->call($method, $args); + + $op = $this->logout($login['userToken']); + $resp = array_merge($resp, (array) $op['response']); + + return $itemSet; + } + + /** + */ + private function getProduct($id) + { + $resp = array(); + $login = $this->login(); + $resp = array_merge($resp, (array) $login['response']); + + $method = 'Product.get'; + $args = array( + array( + 'ids' => array( + intval($id) + ) + ) + ); + if (isset($login['userToken'])) { + $args[0]['Bugzilla_token'] = $login['userToken']; + } + $itemSet = $this->APIClient->call($method, $args); + + $op = $this->logout($login['userToken']); + $resp = array_merge($resp, (array) $op['response']); + + return $itemSet; + } + + // good info from: + // http://petehowe.co.uk/2010/example-of-calling-the-bugzilla-api-using-php-zend-framework/ + // + // From BUGZILLA DOCS + // + // Returns + // A hash with one element, id. This is the id of the newly-filed bug. + // + // Errors + // + // 51 (Invalid Object) + // The component you specified is not valid for this Product. + // + // 103 (Invalid Alias) + // The alias you specified is invalid for some reason. See the error message for more details. + // + // 104 (Invalid Field) + // One of the drop-down fields has an invalid value, or a value entered in a text field is too long. + // The error message will have more detail. + // + // 105 (Invalid Component) + // You didn't specify a component. + // + // 106 (Invalid Product) + // Either you didn't specify a product, this product doesn't exist, or you don't have permission + // to enter bugs in this product. + // + // 107 (Invalid Summary) + // You didn't specify a summary for the bug. + // + // 504 (Invalid User) + // Either the QA Contact, Assignee, or CC lists have some invalid user in them. + // The error message will have more details. + // + public function addIssue($summary, $description) + { + $issue = null; + $resp = array(); + $login = $this->login(); + $resp = array_merge($resp, (array) $login['response']); + + $method = 'Bug.create'; + $issue = array( + 'product' => (string) $this->cfg->product, + 'component' => (string) $this->cfg->component, + 'summary' => $summary, + 'description' => $description + ); + + foreach ($this->issueDefaults as $prop => $default) { + $issue[$prop] = (string) $this->cfg->$prop; + } + + $args = array( + $issue + ); + if (isset($login['userToken'])) { + $args[0]['Bugzilla_token'] = $login['userToken']; + } + + $op = $this->APIClient->call($method, $args); + if ($op['status_ok'] = ($op['id'] > 0)) { + $op['msg'] = sprintf(lang_get('bugzilla_bug_created'), $summary, + $issue['product']); + } else { + $msg = "Create BUGZILLA Ticket FAILURE "; + $op = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + tLog($msg, 'WARNING'); + } + + $logout = $this->logout($login['userToken']); + $resp = array_merge($resp, (array) $logout['response']); + + return $op; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'product') && + property_exists($this->cfg, 'component'); + } + + /** + */ + private function login() + { + $args = array( + array( + 'login' => (string) $this->cfg->username, + 'password' => (string) $this->cfg->password, + 'remember' => 1 + ) + ); + $ret = array(); + $ret['response']['User.login'] = $this->APIClient->call('User.login', + $args); + $ret['userToken'] = $ret['response']['User.login']['token']; + return $ret; + } + + /** + */ + private function logout($userToken = null) + { + $args = array( + array() + ); + if (! is_null($userToken)) { + $args[0]['Bugzilla_token'] = $userToken; + } + + $ret = array(); + $ret['response']['User.logout'] = $this->APIClient->call('User.logout', + $args); + return $ret; + } +} diff --git a/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzilladb.php b/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzilladb.php index 0366a5903a..a22ef49887 100644 --- a/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzilladb.php +++ b/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzilladb.php @@ -1,71 +1,38 @@ - \n" . - "192.168.1.88\n" . - "bugzilla3 \n" . - "bugzilla3\n" . - "mysql \n" . - "root \n" . - "mysqlroot\n" . - "http://192.168.1.88/bugzilla/\n" . - "http://192.168.1.88/bugzilla/show_bug.cgi?id=\n" . - ""; - - - -echo '

    '; -echo "Testing BTS Integration - bugzilladbInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new bugzilladbInterface(185,$cfg); -// var_dump($its); - -$bug=20; -echo '
    ';
    -var_dump($its->getIssue($bug));
    -echo '
    '; - -echo '
    Does issue ' . $bug . ' exist? ' . ($its->checkBugIDExistence($bug) ? 'YES!!!' : 'Oh No!!!'); -echo '
    Does issue 999999 exist? ' . ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); -/* */ - - -/* -if($op) -{ - $issue2check = array( array('issue' => 11776, 'exists' => true), - array('issue' => 99999, 'exists' => false)); - - $methods = array('getBugSummaryString','getBugStatus','getBugStatusString', - 'checkBugID_existence','buildViewBugLink'); - - $if = config_get('bugInterface'); - new dBug($if); - // $xx = $if->getIssue(281579); - - // echo 'Does issue 999999 exist? ' . ($if->checkBugID_existence(999999) ? 'YES!!!' : 'Oh No!!!'); - // echo 'Does issue 281579 exist? ' . ($if->checkBugID_existence(281579) ? 'YES!!!' : 'Oh No!!!'); - - //$xx = $if->getIssue(999999); - //new dBug($xx); - $xx = $if->getBugStatus(281579); - new dBug($xx); - - $xx = $if->getBugSummaryString(281579); - new dBug($xx); - -} -*/ - -?> \ No newline at end of file + \n" . "192.168.1.88\n" . + "bugzilla3 \n" . "bugzilla3\n" . + "mysql \n" . "root \n" . + "mysqlroot\n" . + "http://192.168.1.88/bugzilla/\n" . + "http://192.168.1.88/bugzilla/show_bug.cgi?id=\n" . + ""; + +echo '

    '; +echo "Testing BTS Integration - bugzilladbInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new bugzilladbInterface(185, $cfg); + +$bug = 20; +echo '
    ';
    +var_dump($its->getIssue($bug));
    +echo '
    '; + +echo '
    Does issue ' . $bug . ' exist? ' . + ($its->checkBugIDExistence($bug) ? 'YES!!!' : 'Oh No!!!'); +echo '
    Does issue 999999 exist? ' . + ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); + +?> diff --git a/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzillaxmlrpc.php b/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzillaxmlrpc.php index a797439b7e..2b661114ee 100644 --- a/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzillaxmlrpc.php +++ b/lib/issuetrackerintegration/code_testing/bugzilla/test.bugzillaxmlrpc.php @@ -1,58 +1,28 @@ -\n" . - "testlink.helpme@gmail.com\n" . - "testlink.helpme\n" . - "http://bugzilla.mozilla.org/\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - bugzillaxmlrpcInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new bugzillaxmlrpcInterface(185,$cfg); -// var_dump($its); -echo '
    Does issue 281579 exist? ' . ($its->checkBugIDExistence(281579) ? 'YES!!!' : 'Oh No!!!'); -echo '
    Does issue 999999 exist? ' . ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); - - - -/* -if($op) -{ - $issue2check = array( array('issue' => 11776, 'exists' => true), - array('issue' => 99999, 'exists' => false)); - - $methods = array('getBugSummaryString','getBugStatus','getBugStatusString', - 'checkBugID_existence','buildViewBugLink'); - - $if = config_get('bugInterface'); - new dBug($if); - // $xx = $if->getIssue(281579); - - // echo 'Does issue 999999 exist? ' . ($if->checkBugID_existence(999999) ? 'YES!!!' : 'Oh No!!!'); - // echo 'Does issue 281579 exist? ' . ($if->checkBugID_existence(281579) ? 'YES!!!' : 'Oh No!!!'); - - //$xx = $if->getIssue(999999); - //new dBug($xx); - $xx = $if->getBugStatus(281579); - new dBug($xx); - - $xx = $if->getBugSummaryString(281579); - new dBug($xx); - -} -*/ - -?> \ No newline at end of file +\n" . "testlink.helpme@gmail.com\n" . + "testlink.helpme\n" . + "http://bugzilla.mozilla.org/\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - bugzillaxmlrpcInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new bugzillaxmlrpcInterface(185, $cfg); +echo '
    Does issue 281579 exist? ' . + ($its->checkBugIDExistence(281579) ? 'YES!!!' : 'Oh No!!!'); +echo '
    Does issue 999999 exist? ' . + ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); + +?> diff --git a/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugz.api.php b/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugz.api.php index 43e2f3bfeb..1826addde6 100644 --- a/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugz.api.php +++ b/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugz.api.php @@ -1,49 +1,36 @@ -logon(); - - // You can call any FogBugz API method directly by using it's - // name as a method name on the $fogbugz object. - // It will turn the method name in to the command, - // ?cmd={method_name} and it will add the array to the - // get request automatically - - /* - $xml = $fogbugz->listProjects(); - foreach ($xml->projects->children() as $item) - { - print "Project:" . (string)$item->sProject; - print "
    "; - var_dump($item); - print "
    ======================
    "; - } - */ - - // Go for an issue - $xml = $fogbugz->search(array('q' => 3,'cols' => 'sTitle,sStatus')); - //$xml = $fogbugz->search(array('q' => 3)); - - echo (string)$xml->description . '
    '; - echo (int)$xml->cases['count'] . '
    '; - // var_dump($xml->cases); - foreach($xml->cases->children() as $item) - { - echo (int)$item['ixBug'] . '
    '; - echo (string)$item->sTitle . '
    '; - echo (string)$item->sStatus . '
    '; - } - -} -catch (Exception $e) -{ - print sprintf("FogBugz Error : [Code %d] %s\n",$e->getCode(),$e->getMessage()); -} -?> \ No newline at end of file +logon(); + + // You can call any FogBugz API method directly by using it's + // name as a method name on the $fogbugz object. + // It will turn the method name in to the command, + // ?cmd={method_name} and it will add the array to the + // get request automatically + + // Go for an issue + $xml = $fogbugz->search(array( + 'q' => 3, + 'cols' => 'sTitle,sStatus' + )); + + echo (string) $xml->description . '
    '; + echo (int) $xml->cases['count'] . '
    '; + foreach ($xml->cases->children() as $item) { + echo (int) $item['ixBug'] . '
    '; + echo (string) $item->sTitle . '
    '; + echo (string) $item->sStatus . '
    '; + } +} catch (Exception $e) { + print + sprintf("FogBugz Error : [Code %d] %s\n", $e->getCode(), + $e->getMessage()); +} +?> diff --git a/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugzrestInterface.class.php b/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugzrestInterface.class.php index e9db6e33a1..d6de6da067 100644 --- a/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugzrestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/fogbugz/test.fogbugzrestInterface.class.php @@ -1,68 +1,48 @@ -getTypes(); - -$cfg = "\n" . - "francisco.mancardi@gmail.com\n" . - "qazwsxedc\n" . - "https://fman.fogbugz.com/\n" . - "TestLink Testing\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - fogbugzrestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new fogbugzrestInterface(18,$cfg); -echo '
    ' . __FILE__ . '
    '; -echo '
    Dumping INTERFACE OBJECT
    '; -echo '
    ';
    -var_dump($its);
    -echo '
    '; - -$xx = $its->getCfg(); -//var_dump($xx); -// var_dump('<pre>' . $xx->asXML() . '</pre>'); - -if( $its->isConnected() ) -{ - $xx = $its->getIssue(3); - - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - /* - $xx = $its->addIssue('ISSUE FROM PHP', 'Que miras bolu'); - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - */ - -} - -/* -$xx->uriview = $xx->uribase . 'ffffff'; -var_dump($xx); -var_dump('<pre>' . $xx->asXML() . '</pre>'); -*/ - -?> \ No newline at end of file +getTypes(); + +$cfg = "\n" . "francisco.mancardi@gmail.com\n" . + "qazwsxedc\n" . + "https://fman.fogbugz.com/\n" . + "TestLink Testing\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - fogbugzrestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new fogbugzrestInterface(18, $cfg); +echo '
    ' . __FILE__ . '
    '; +echo '
    Dumping INTERFACE OBJECT
    '; +echo '
    ';
    +var_dump($its);
    +echo '
    '; + +$xx = $its->getCfg(); + +if ($its->isConnected()) { + $xx = $its->getIssue(3); + + echo '
    ' . __FILE__ . '
    '; + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; +} + +?> diff --git a/lib/issuetrackerintegration/code_testing/gforge/test.gforgesoapInterface.class.php b/lib/issuetrackerintegration/code_testing/gforge/test.gforgesoapInterface.class.php index 790fd787c4..5faf6da6c0 100644 --- a/lib/issuetrackerintegration/code_testing/gforge/test.gforgesoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/gforge/test.gforgesoapInterface.class.php @@ -1,46 +1,41 @@ -getTypes(); - -$cfg = "\n" . - "testlink.api\n" . - "testlinkapi\n" . - "http://gforge.com/\n" . - "http://gforge.com/gf/xmlcompatibility/soap5/?wsdl\n" . - "http://gforge.com/\n" . - "http://gforge.com/\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - gforgesoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new gforgesoapInterface(1,$cfg); -var_dump($its); - -if( $its->isConnected() ) -{ - echo 'Connected !
    '; - // $issue=$its->getIssue(7091); - $issue=$its->getIssue(8305); - - new dBug($issue); - -} -?> \ No newline at end of file +getTypes(); + +$cfg = "\n" . "testlink.api\n" . + "testlinkapi\n" . + "http://gforge.com/\n" . + "http://gforge.com/gf/xmlcompatibility/soap5/?wsdl\n" . + "http://gforge.com/\n" . + "http://gforge.com/\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - gforgesoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new gforgesoapInterface(1, $cfg); +var_dump($its); + +if ($its->isConnected()) { + echo 'Connected !
    '; + $issue = $its->getIssue(8305); + + new dBug($issue); +} +?> diff --git a/lib/issuetrackerintegration/code_testing/gitlab/test.gitlabInterface.class.php b/lib/issuetrackerintegration/code_testing/gitlab/test.gitlabInterface.class.php index 83f45e0345..ca02640df3 100644 --- a/lib/issuetrackerintegration/code_testing/gitlab/test.gitlabInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/gitlab/test.gitlabInterface.class.php @@ -1,61 +1,60 @@ -\n" . - "REPLACE_ME\n". - "https://gitlab.com\n". - "REPLACE_ME\n". - "\n"; - -echo '

    '; -echo "Testing BST Integration - gitlabrestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new gitlabrestInterface(18,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -{ - $today = date("Y-m-d H:i:s"); - $issue = array('summary' => 'Issue Via API' . $today,'description' => 'Some text'); - $resp = $its->addIssue($issue['summary'],$issue['description']); - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($resp);
    -  echo '
    '; -} - -if( $its->isConnected() ) -{ - $resp = $its->getIssue(1); - - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($resp);
    -  echo '
    '; - -} - +\n" . "REPLACE_ME\n" . + "https://gitlab.com\n" . + "REPLACE_ME\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - gitlabrestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new gitlabrestInterface(18, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +{ + $today = date("Y-m-d H:i:s"); + $issue = array( + 'summary' => 'Issue Via API' . $today, + 'description' => 'Some text' + ); + $resp = $its->addIssue($issue['summary'], $issue['description']); + echo '
    ' . __FILE__ . '
    '; + echo '
    ';
    +    var_dump($resp);
    +    echo '
    '; +} + +if ($its->isConnected()) { + $resp = $its->getIssue(1); + + echo '
    ' . __FILE__ . '
    '; + echo '
    ';
    +    var_dump($resp);
    +    echo '
    '; +} + ?> diff --git a/lib/issuetrackerintegration/code_testing/jira/db/test.jiradbInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/db/test.jiradbInterface.class.php index 54c8801609..8f42b0bbe5 100644 --- a/lib/issuetrackerintegration/code_testing/jira/db/test.jiradbInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/db/test.jiradbInterface.class.php @@ -1,70 +1,58 @@ -getTypes(); -$systems = $it_mgr->getSystems(); -new dBug($itt); -new dBug($systems); - - - -// last test ok: -$cfg = "\n" . - "192.168.1.201\n" . - "jiradb\n" . - "mysql\n" . - "root\n" . - "mysqlroot\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "\n"; - -echo '

    '; -echo "Testing BTS Integration - jiradbInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -// $safe_cfg = str_replace("\n",'',$cfg); -// echo $safe_cfg; -echo 'Creating INTERFACE
    '; - -// @20121215 -> 6 => jiradbInterface -$its = new jiradbInterface(6,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - echo 'Connected !
    '; - - echo '
    ';
    -	var_dump($its->getStatusDomain());
    -	echo '
    '; - echo 'Get Issue
    '; - new dBug($its->getIssue('DEMO-2')); - - echo 'Get Issue Summary
    '; - - echo($its->getIssueSummary('DEMO-2')); - echo '
    '; - - // echo($its->getIssueSummary('ZOFF-8')); - -} -?> \ No newline at end of file +getTypes(); +$systems = $it_mgr->getSystems(); +new dBug($itt); +new dBug($systems); + +// last test ok: +$cfg = "\n" . "192.168.1.201\n" . + "jiradb\n" . "mysql\n" . + "root\n" . "mysqlroot\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "\n"; + +echo '

    '; +echo "Testing BTS Integration - jiradbInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; +echo 'Creating INTERFACE
    '; + +// @20121215 -> 6 => jiradbInterface +$its = new jiradbInterface(6, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + echo 'Connected !
    '; + + echo '
    ';
    +    var_dump($its->getStatusDomain());
    +    echo '
    '; + echo 'Get Issue
    '; + new dBug($its->getIssue('DEMO-2')); + + echo 'Get Issue Summary
    '; + + echo $its->getIssueSummary('DEMO-2'); + echo '
    '; +} +?> diff --git a/lib/issuetrackerintegration/code_testing/jira/rest/test.addIssueComment.jiraOnDemand.jirarestInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/rest/test.addIssueComment.jiraOnDemand.jirarestInterface.class.php index 1dffc692a9..0f8c2bf82d 100644 --- a/lib/issuetrackerintegration/code_testing/jira/rest/test.addIssueComment.jiraOnDemand.jirarestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/rest/test.addIssueComment.jiraOnDemand.jirarestInterface.class.php @@ -1,70 +1,60 @@ -getTypes(); - -// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin -$username = 'testlink.forum'; -$password = 'forum'; -$uribase = 'https://testlink.atlassian.net/'; -$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; -$projectkey = 'ZOFF'; - - -$cfg = "\n" . - "{$username}\n" . - "{$password}\n" . - "{$uribase}\n" . - "{$uriapi}\n" . - "{$projectkey}\n" . - "1\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirarestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirarestInterface(7,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - // RAW - // ATTENTION interface IS COMPLETELY DIFFERENT - $issueID = 'ZOFF-1337'; - $noteText = 'I want to rock'; - $zorro = $its->getAPIClient()->addComment($noteText,$issueID); - echo 'Test - ADD an ISSUE Comment VIA REST RAW
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - // using TestLink Interface -$issueID = 'ZOFF-1337'; - $noteText = 'I want to rock VIA INTERFACE'; - $zorro = $its->addNote($issueID,$noteText); - echo 'Test - ADD an ISSUE Comment VIA REST RAW
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - +getTypes(); + +// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin +$username = 'testlink.forum'; +$password = 'forum'; +$uribase = 'https://testlink.atlassian.net/'; +$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; +$projectkey = 'ZOFF'; + +$cfg = "\n" . "{$username}\n" . + "{$password}\n" . "{$uribase}\n" . + "{$uriapi}\n" . "{$projectkey}\n" . + "1\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - jirarestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirarestInterface(7, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + // RAW + // ATTENTION interface IS COMPLETELY DIFFERENT + $issueID = 'ZOFF-1337'; + $noteText = 'I want to rock'; + $zorro = $its->getAPIClient()->addComment($noteText, $issueID); + echo 'Test - ADD an ISSUE Comment VIA REST RAW
    '; + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; + + // using TestLink Interface + $issueID = 'ZOFF-1337'; + $noteText = 'I want to rock VIA INTERFACE'; + $zorro = $its->addNote($issueID, $noteText); + echo 'Test - ADD an ISSUE Comment VIA REST RAW
    '; + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/rest/test.createIssue.jiraOnDemand.jirarestInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/rest/test.createIssue.jiraOnDemand.jirarestInterface.class.php index 4b01ea5cc4..e09122754e 100644 --- a/lib/issuetrackerintegration/code_testing/jira/rest/test.createIssue.jiraOnDemand.jirarestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/rest/test.createIssue.jiraOnDemand.jirarestInterface.class.php @@ -1,77 +1,72 @@ -getTypes(); - -// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin -$username = 'testlink.forum'; -$password = 'forum'; -$uribase = 'https://testlink.atlassian.net/'; -$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; -$projectkey = 'ZOFF'; - - -$cfg = "\n" . - "{$username}\n" . - "{$password}\n" . - "{$uribase}\n" . - "{$uriapi}\n" . - "{$projectkey}\n" . - "1\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirarestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirarestInterface(7,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - - $summary = 'Will try to create via REST RAW'; - $description = 'I WAS ABLE to create via REST RAW!!!'; - $issue = array('fields' => - array('project' => array('key' => (string)$projectkey), - 'summary' => $summary, - 'description' => $description, - 'issuetype' => array( 'id' => 1) - ) - ); - - $zorro = $its->getAPIClient()->createIssue($issue); - echo 'Test - Create an ISSUE VIA REST RAW
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - // ==================================================================== - $summary = 'Will try to create via REST TestLink Interface'; - $description = 'I WAS ABLE to create via REST TestLink Interface ****'; - $zorro = $its->addIssue($summary,$description); - echo 'Test - Create an ISSUE VIA REST TestLink Interface
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - - +getTypes(); + +// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin +$username = 'testlink.forum'; +$password = 'forum'; +$uribase = 'https://testlink.atlassian.net/'; +$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; +$projectkey = 'ZOFF'; + +$cfg = "\n" . "{$username}\n" . + "{$password}\n" . "{$uribase}\n" . + "{$uriapi}\n" . "{$projectkey}\n" . + "1\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - jirarestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirarestInterface(7, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + + $summary = 'Will try to create via REST RAW'; + $description = 'I WAS ABLE to create via REST RAW!!!'; + $issue = array( + 'fields' => array( + 'project' => array( + 'key' => (string) $projectkey + ), + 'summary' => $summary, + 'description' => $description, + 'issuetype' => array( + 'id' => 1 + ) + ) + ); + + $zorro = $its->getAPIClient()->createIssue($issue); + echo 'Test - Create an ISSUE VIA REST RAW
    '; + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; + + // ==================================================================== + $summary = 'Will try to create via REST TestLink Interface'; + $description = 'I WAS ABLE to create via REST TestLink Interface ****'; + $zorro = $its->addIssue($summary, $description); + echo 'Test - Create an ISSUE VIA REST TestLink Interface
    '; + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/rest/test.getIssue.jiraOnDemand.jirarestInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/rest/test.getIssue.jiraOnDemand.jirarestInterface.class.php index 885050545c..6009cbce8f 100644 --- a/lib/issuetrackerintegration/code_testing/jira/rest/test.getIssue.jiraOnDemand.jirarestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/rest/test.getIssue.jiraOnDemand.jirarestInterface.class.php @@ -1,76 +1,48 @@ -getTypes(); - -// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin -$username = 'testlink.forum'; -$password = 'forum'; -// $password = ''; -$uribase = 'https://testlink.atlassian.net/'; -$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; - -$cfg = "\n" . - "{$username}\n" . - "{$password}\n" . - "{$uribase}\n" . - "{$uriapi}\n" . - "ZOFF\n" . - "1\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirarestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirarestInterface(7,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - // Using RAW API - - /* - $api = $its->getAPIClient(); - $zorro = $its->getAPIClient()->getUser($username); - echo 'Test - Get Data about connected user
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - $targetIssue = 'ZOFF-129'; - echo 'Test - Get Data about Issue:' . $targetIssue . '
    '; - $zorro = $its->getAPIClient()->getIssue($targetIssue); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - */ - - $targetIssue = 'ZOFF-185'; - echo 'Test - USING TL Interface - Get Data about Issue:' . $targetIssue . '
    '; - $zorro = $its->getIssue($targetIssue); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - - +getTypes(); + +// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin +$username = 'testlink.forum'; +$password = 'forum'; +$uribase = 'https://testlink.atlassian.net/'; +$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; + +$cfg = "\n" . "{$username}\n" . + "{$password}\n" . "{$uribase}\n" . + "{$uriapi}\n" . "ZOFF\n" . + "1\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - jirarestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirarestInterface(7, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + $targetIssue = 'ZOFF-185'; + echo 'Test - USING TL Interface - Get Data about Issue:' . $targetIssue . + '
    '; + $zorro = $its->getIssue($targetIssue); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/rest/test.getMetaData.jiraOnDemand.jirarestInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/rest/test.getMetaData.jiraOnDemand.jirarestInterface.class.php index 2596047027..463fa70ba1 100644 --- a/lib/issuetrackerintegration/code_testing/jira/rest/test.getMetaData.jiraOnDemand.jirarestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/rest/test.getMetaData.jiraOnDemand.jirarestInterface.class.php @@ -1,100 +1,68 @@ -getTypes(); - -// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin -$username = 'testlink.forum'; -$password = 'forum'; -// $password = ''; -$uribase = 'https://testlink.atlassian.net/'; -$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; - -$cfg = "\n" . - "{$username}\n" . - "{$password}\n" . - "{$uribase}\n" . - "{$uriapi}\n" . - "ZOFF\n" . - "1\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirarestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirarestInterface(7,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - // Using RAW API - - /* - $api = $its->getAPIClient(); - $zorro = $its->getAPIClient()->getUser($username); - echo 'Test - Get Data about connected user
    '; - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - - $targetIssue = 'ZOFF-129'; - echo 'Test - Get Data about Issue:' . $targetIssue . '
    '; - $zorro = $its->getAPIClient()->getIssue($targetIssue); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - */ - // $api = $its->getAPIClient(); - - - $zorro = $its->getIssueTypes(); - echo '
    ';
    -  echo 'ISSUE TYPES
    '; - var_dump($zorro); - echo '
    '; - - $zorro = $its->getIssueTypesForHTMLSelect(); - echo '
    ';
    -  echo 'ISSUE TYPES
    '; - var_dump($zorro); - echo '
    '; - - - - $zorro = $its->getPriorities(); - echo '
    ';
    -  echo 'getPriorities
    '; - var_dump($zorro); - echo '
    '; - - - $zorro = $its->getVersions('ZOFF'); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - $zorro = $its->getComponents('ZOFF'); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; - - +getTypes(); + +// http://testlink.atlassian.net/rest/api/latest/user/search/?username=admin +$username = 'testlink.forum'; +$password = 'forum'; +$uribase = 'https://testlink.atlassian.net/'; +$uriapi = 'https://testlink.atlassian.net/rest/api/latest/'; + +$cfg = "\n" . "{$username}\n" . + "{$password}\n" . "{$uribase}\n" . + "{$uriapi}\n" . "ZOFF\n" . + "1\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - jirarestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirarestInterface(7, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + $zorro = $its->getIssueTypes(); + echo '
    ';
    +    echo 'ISSUE TYPES
    '; + var_dump($zorro); + echo '
    '; + + $zorro = $its->getIssueTypesForHTMLSelect(); + echo '
    ';
    +    echo 'ISSUE TYPES
    '; + var_dump($zorro); + echo '
    '; + + $zorro = $its->getPriorities(); + echo '
    ';
    +    echo 'getPriorities
    '; + var_dump($zorro); + echo '
    '; + + $zorro = $its->getVersions('ZOFF'); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; + + $zorro = $its->getComponents('ZOFF'); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssue.jiraOnDemand.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssue.jiraOnDemand.jirasoapInterface.class.php index c978c91d32..c8484a3609 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssue.jiraOnDemand.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssue.jiraOnDemand.jirasoapInterface.class.php @@ -1,54 +1,52 @@ -getTypes(); - -// 10101 -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - - "1010010101\n" . - "\n" . - - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface 'Do Androids Dream of Electric Sheep?' "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - $today = date("Y-m-d H:i:s"); - $issue = array('summary' => 'Issue Via API' . $today,'description' => 'Do Androids Dream of Electric Sheep?'); - $zorro = $its->addIssue($issue['summary'],$issue['description']); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; +getTypes(); + +// 10101 +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "ZOFF\n" . "1\n" . + + "1010010101\n" . + "\n" . + "\n"; + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface 'Do Androids Dream of Electric Sheep?' "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + $today = date("Y-m-d H:i:s"); + $issue = array( + 'summary' => 'Issue Via API' . $today, + 'description' => 'Do Androids Dream of Electric Sheep?' + ); + $zorro = $its->addIssue($issue['summary'], $issue['description']); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithAffectedVersions.jiraOnDemand.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithAffectedVersions.jiraOnDemand.jirasoapInterface.class.php index 88692a1144..6861045940 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithAffectedVersions.jiraOnDemand.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithAffectedVersions.jiraOnDemand.jirasoapInterface.class.php @@ -1,64 +1,59 @@ -getTypes(); - -// 10101 -$oneAffectedVersionSimpleValue = - "2.0 Fast Track\n" . - "1.5 Beta\n"; - - -$oneAffectedVersionSimpleValue = - "10000\n" . - "10002\n"; - -$af = $oneAffectedVersionSimpleValue; - - -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - "1010010101\n" . - "\n" . $af . "\n" . - "\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - $today = date("Y-m-d H:i:s"); - $issue = array('summary' => 'Issue Via API' . $today,'description' => 'Do Androids Dream of Electric Sheep?'); - $zorro = $its->addIssue($issue['summary'],$issue['description']); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; -} \ No newline at end of file +getTypes(); + +// 10101 +$oneAffectedVersionSimpleValue = "2.0 Fast Track\n" . + "1.5 Beta\n"; + +$oneAffectedVersionSimpleValue = "10000\n" . + "10002\n"; + +$af = $oneAffectedVersionSimpleValue; + +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "ZOFF\n" . "1\n" . + "1010010101\n" . + "\n" . $af . "\n" . "\n" . + "\n"; + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + $today = date("Y-m-d H:i:s"); + $issue = array( + 'summary' => 'Issue Via API' . $today, + 'description' => 'Do Androids Dream of Electric Sheep?' + ); + $zorro = $its->addIssue($issue['summary'], $issue['description']); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; +} diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithCustomFields.jiraOnDemand.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithCustomFields.jiraOnDemand.jirasoapInterface.class.php index 41cddc6331..d0a97f4d3f 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithCustomFields.jiraOnDemand.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.createIssueWithCustomFields.jiraOnDemand.jirasoapInterface.class.php @@ -1,142 +1,111 @@ -getTypes(); - -// 10101 -$oneCFSimpleValue = "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "12345\n" . - "\n" . - "\n"; - -$oneCFMultiListValue = "\n" . - "\n" . - "customfield_10900\n" . - "\n" . - "DucatiYamaha Factory Racing\n" . - "\n"; - - -$oneCFMultiListValue = "\n" . - "\n" . - "customfield_10900\n" . - "\n" . - "DucatiYamaha Factory Racing\n" . - "\n"; - -$cfmod03 = "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "111\n" . - "\n" . - - "\n" . // <<<< PAY ATTENTION - "\n" . - "customfield_10900\n" . - "\n" . - "Ducati\n" . - "\n"; - -// ELEM IN INPUTobject(SimpleXMLElement)#81 (1) { ["customField"]=> array(2) { [0]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } [1]=> object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10900 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(6) "Ducati" } } } } -// getCustomFieldsAttribute -// AFTER get obj vars ACCESS IN INPUT -// array(2) { [0]=> object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } [1]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10900 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(6) "Ducati" } } } -// IO SONO ITEM -// object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } ID: - - -// ELEM IN INPUTobject(SimpleXMLElement)#81 (1) { ["customField"]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } } -// getCustomFieldsAttribute -// AFTER get obj vars ACCESS IN INPUT -// object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } -//IO SONO ITEM -//object(SimpleXMLElement)#82 (0) { } ID: - -//AFTER get obj vars ACCESS IN INPUT -//array(1) { [0]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } } -//IO SONO ITEM -//object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } ID: - - -$cfmod04 = "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "111\n" . - "\n"; - -$oneOneCFMultiListValue = "\n" . - "\n" . - "customfield_10900\n" . - "\n" . - "Yamaha Factory Racing\n" . - "\n"; - -$cfmod05 = "\n" . - "\n" . - "customfield_10900\n" . - "\n" . - "Ducati\n" . - "\n"; - - -$cfmod06 = "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "111\n" . - "\n"; - -$cf = $oneCFMultiListValue; - - -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - "1010010101\n" . - "\n" . $cf . "\n" . - "\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - $today = date("Y-m-d H:i:s"); - $issue = array('summary' => 'Issue Via API' . $today,'description' => 'Do Androids Dream of Electric Sheep?'); - $zorro = $its->addIssue($issue['summary'],$issue['description']); - echo '
    ';
    -  var_dump($zorro);
    -  echo '
    '; +getTypes(); + +// 10101 +$oneCFSimpleValue = "\n" . "\n" . + "customfield_10800\n" . "\n" . + "12345\n" . "\n" . + "\n"; + +$oneCFMultiListValue = "\n" . "\n" . + "customfield_10900\n" . "\n" . + "DucatiYamaha Factory Racing\n" . + "\n"; + +$oneCFMultiListValue = "\n" . "\n" . + "customfield_10900\n" . "\n" . + "DucatiYamaha Factory Racing\n" . + "\n"; + +$cfmod03 = "\n" . "\n" . "customfield_10800\n" . + "\n" . "111\n" . + "\n" . + "\n" . // <<<< PAY ATTENTION + "\n" . "customfield_10900\n" . "\n" . + "Ducati\n" . "\n"; + +// ELEM IN INPUTobject(SimpleXMLElement)#81 (1) { ["customField"]=> array(2) { [0]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } [1]=> object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10900 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(6) "Ducati" } } } } +// getCustomFieldsAttribute +// AFTER get obj vars ACCESS IN INPUT +// array(2) { [0]=> object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } [1]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10900 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(6) "Ducati" } } } +// IO SONO ITEM +// object(SimpleXMLElement)#79 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#82 (1) { ["value"]=> string(3) "111" } } ID: + +// ELEM IN INPUTobject(SimpleXMLElement)#81 (1) { ["customField"]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } } +// getCustomFieldsAttribute +// AFTER get obj vars ACCESS IN INPUT +// object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } +// IO SONO ITEM +// object(SimpleXMLElement)#82 (0) { } ID: + +// AFTER get obj vars ACCESS IN INPUT +// array(1) { [0]=> object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } } +// IO SONO ITEM +// object(SimpleXMLElement)#78 (2) { ["customfieldId"]=> string(19) " customfield_10800 " ["values"]=> object(SimpleXMLElement)#79 (1) { ["value"]=> string(3) "111" } } ID: + +$cfmod04 = "\n" . "\n" . "customfield_10800\n" . + "\n" . "111\n" . + "\n"; + +$oneOneCFMultiListValue = "\n" . "\n" . + "customfield_10900\n" . "\n" . + "Yamaha Factory Racing\n" . + "\n"; + +$cfmod05 = "\n" . "\n" . "customfield_10900\n" . + "\n" . "Ducati\n" . + "\n"; + +$cfmod06 = "\n" . "\n" . "customfield_10800\n" . + "\n" . "111\n" . + "\n"; + +$cf = $oneCFMultiListValue; + +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "ZOFF\n" . "1\n" . + "1010010101\n" . + "\n" . $cf . "\n" . "\n" . + "\n"; + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + $today = date("Y-m-d H:i:s"); + $issue = array( + 'summary' => 'Issue Via API' . $today, + 'description' => 'Do Androids Dream of Electric Sheep?' + ); + $zorro = $its->addIssue($issue['summary'], $issue['description']); + echo '
    ';
    +    var_dump($zorro);
    +    echo '
    '; } diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.getIssue.jiraOnDemand.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.getIssue.jiraOnDemand.jirasoapInterface.class.php index 021fe7e756..ff5cf650a0 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.getIssue.jiraOnDemand.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.getIssue.jiraOnDemand.jirasoapInterface.class.php @@ -1,49 +1,45 @@ -getTypes(); - -// last test ok: 20121117 -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; -echo 'Creating INTERFACE
    '; -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - echo 'Get Issue
    '; - // $zx = $its->getIssue('ZOFF-112'); - // $zx = $its->getIssue('ZOFF-135'); - $zx = $its->getIssue('ZOFF-166'); - echo '
    ';
    -  var_dump($zx);
    -  echo '
    '; - echo '
    '; -} \ No newline at end of file +getTypes(); + +// last test ok: 20121117 +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "\n"; + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; +echo 'Creating INTERFACE
    '; +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + echo 'Get Issue
    '; + $zx = $its->getIssue('ZOFF-166'); + echo '
    ';
    +    var_dump($zx);
    +    echo '
    '; + echo '
    '; +} diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.jiraOnDemand.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.jiraOnDemand.jirasoapInterface.class.php index d8f6b70125..1f46eb1679 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.jiraOnDemand.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.jiraOnDemand.jirasoapInterface.class.php @@ -1,219 +1,178 @@ -getTypes(); - -// last test ok: 20121117 -/* -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - "1010010101\n" . - "\n" . - "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "12\n" . - "\n" . - "\n" . - "\n" . - "\n"; - -array(7) { ["project"]=> string(4) "ZOFF" ["type"]=> int(1) -["summary"]=> string(24) "Issue Via API 2013-02-04" ["description"]=> string(36) "Do Androids Dream of Electric Sheep?" ["components"]=> array(2) { [0]=> array(1) { ["id"]=> string(5) "10100" } [1]=> array(1) { ["id"]=> string(5) "10101" } } ["customFieldValues"]=> array(2) { [0]=> array(1) { ["remoteCustomFieldValue"]=> string(19) " customfield_10800 " } [1]=> array(1) { ["remoteCustomFieldValue"]=> string(0) "" } } ["issuetype"]=> int(1) } array(3) { ["status_ok"]=> bool(false) ["id"]=> int(-1) ["msg"]=> string(550) "Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: Custom field ID 'null' is invalid. - serialized issue:a:7:{s:7:"project";s:4:"ZOFF";s:4:"type";i:1;s:7:"summary";s:24:"Issue Via API 2013-02-04";s:11:"description";s:36:"Do Androids Dream of Electric Sheep?";s:10:"components";a:2:{i:0;a:1:{s:2:"id";s:5:"10100";}i:1;a:1:{s:2:"id";s:5:"10101";}}s:17:"customFieldValues";a:2:{i:0;a:1:{s:22:"remoteCustomFieldValue";s:19:" customfield_10800 ";}i:1;a:1:{s:22:"remoteCustomFieldValue";s:0:"";}}s:9:"issuetype";i:1;}" } -*/ - -/* -- snip -- -$issue_attributes = array('project' => 'FEEDBACK', 'assignee' => 'simon', -'type' => '1', 'summary' => 'test', -'customFieldValues' => -array(array('customfieldId' => 'customfield_10011', 'value' => -'a little')) -); -*/ - -/* -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - "\n"; -*/ - -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "ZOFF\n" . - "1\n" . - "1010010101\n" . - "\n" . - "\n" . - "\n" . - "customfield_10800\n" . - "\n" . - "12120\n" . - "\n" . - "\n" . - "\n" . - "\n"; - -/* -{ ["components"] => object(SimpleXMLElement)#84 (1) { ["id"]=> array(2) { [0]=> string(5) "10100" [1]=> string(5) "10101" } } - ["customFieldValues"]=> object(SimpleXMLElement)#83 (1) - { ["id"]=> object(SimpleXMLElement)#82 (2) - { ["customFieldID"]=> string(19) " customfield_10800 " - ["values"]=> object(SimpleXMLElement)#85 (1) - { ["value"]=> array(2) { [0]=> string(2) "12" [1]=> string(3) "120" } } } } } } - -This is an issue to allow people to test integration -array(7) { ["project"]=> string(4) "ZOFF" ["type"]=> int(1) - ["summary"]=> string(24) "Issue Via API 2013-02-04" - ["description"]=> string(36) "Do Androids Dream of Electric Sheep?" - ["components"]=> array(2) { [0]=> array(1) { ["id"]=> string(5) "10100" } [1]=> array(1) { ["id"]=> string(5) "10101" } } - ["customFieldValues"]=> array(2) { [0]=> array(1) { ["id"]=> string(19) " customfield_10800 " } - [1]=> array(1) { ["id"]=> string(0) "" } } - ["issuetype"]=> int(1) } array(3) { ["status_ok"]=> bool(false) ["id"]=> int(-1) - ["msg"]=> string(508) "Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: - Custom field ID 'null' is invalid. - -serialized issue:a:7:{s:7:"project";s:4:"ZOFF";s:4:"type";i:1;s:7:"summary";s:24:"Issue Via API 2013-02-04"; -s:11:"description";s:36:"Do Androids Dream of Electric Sheep?"; -s:10:"components" ;a:2:{i:0;a:1:{s:2:"id";s:5:"10100";}i:1;a:1:{s:2:"id";s:5:"10101";}} -s:17:"customFieldValues";a:2:{i:0;a:1:{s:2:"id";s:19:" customfield_10800 ";}i:1;a:1:{s:2:"id";s:0:"";}}s:9:"issuetype";i:1;}" } - - - - bread - chicken - non-veg - burger - chicken - - Zinger Burger - _< !]]> - - - 10 - 450 - - - - - IT - - - Bob - - - Jim - - - Mel - - - - - -*/ - - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -// $safe_cfg = str_replace("\n",'',$cfg); -// echo $safe_cfg; -echo 'Creating INTERFACE
    '; - -new dBug($itt); -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - echo 'Get Issue
    '; - $zx = $its->getIssue('ZOFF-112'); - var_dump($zx); - //echo $zx->asXML(); - - echo '
    '; - - // echo 'Connected !
    '; - // echo '
    ';
    -	// var_dump($its->getStatusDomain());
    -	// echo '
    '; - //echo 'Get Issue Summary
    '; - // echo($its->getIssueSummary('ZOFF-16')); - //echo '
    '; - - -// I've seen things you people wouldn't believe. -// Attack ships on fire off the shoulder of Orion. -// I watched C-beams glitter in the dark near the Tannhauser gate. -// All those moments will be lost in time... like tears in rain... Time to die. -// - //$issue = array('project' => 'ZOFF','summary' => 'My Firts ISSUE VIA API', - // 'description' => 'Do Androids Dream of Electric Sheep?', - // 'type' => 1, 'components' => array( array('id' => '10100'), array('id' => '10101'))); - // $zorro = $its->addIssueFromArray($issue); - // var_dump($zorro); - $issue = array('summary' => 'Issue Via API 2013-02-04','description' => 'Do Androids Dream of Electric Sheep?'); - // 'type' => 1, 'components' => array( array('id' => '10100'), array('id' => '10101'))); - - $zorro = $its->addIssue($issue['summary'],$issue['description']); - var_dump($zorro); - - - /* - $issue2check = array( array('issue' => 'TLJIRASOAPINTEGRATION-1', 'exists' => true), - array('issue' => 'TLJIRASOAPINTEGRATION-199999', 'exists' => false)); - - */ - - - -/* -["customFieldValues"]=> array(4) -{ [0]=> object(stdClass)#85 (3) - { ["customfieldId"]=> string(17) "customfield_10800" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "123" } } - [1]=> object(stdClass)#82 (3) - { ["customfieldId"]=> string(17) "customfield_10000" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "117" } } - [2]=> object(stdClass)#83 (3) - { ["customfieldId"]=> string(17) "customfield_10200" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "117" } } - [3]=> object(stdClass)#84 (3) { ["customfieldId"]=> string(17) "customfield_10607" ["key"]=> NULL ["values"]=> array(1) { [0]=> NULL } } } -*/ -} -?> \ No newline at end of file +getTypes(); + +// last test ok: 20121117 +/* + * $cfg = "\n" . + * "testlink.forum\n" . + * "forum\n" . + * "http://testlink.atlassian.net/\n" . + * "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + * "http://testlink.atlassian.net/browse/\n" . + * "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + * "ZOFF\n" . + * "1\n" . + * "1010010101\n" . + * "\n" . + * "\n" . + * "\n" . + * "customfield_10800\n" . + * "\n" . + * "12\n" . + * "\n" . + * "\n" . + * "\n" . + * "\n"; + * + * array(7) { ["project"]=> string(4) "ZOFF" ["type"]=> int(1) + * ["summary"]=> string(24) "Issue Via API 2013-02-04" ["description"]=> string(36) "Do Androids Dream of Electric Sheep?" ["components"]=> array(2) { [0]=> array(1) { ["id"]=> string(5) "10100" } [1]=> array(1) { ["id"]=> string(5) "10101" } } ["customFieldValues"]=> array(2) { [0]=> array(1) { ["remoteCustomFieldValue"]=> string(19) " customfield_10800 " } [1]=> array(1) { ["remoteCustomFieldValue"]=> string(0) "" } } ["issuetype"]=> int(1) } array(3) { ["status_ok"]=> bool(false) ["id"]=> int(-1) ["msg"]=> string(550) "Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: Custom field ID 'null' is invalid. - serialized issue:a:7:{s:7:"project";s:4:"ZOFF";s:4:"type";i:1;s:7:"summary";s:24:"Issue Via API 2013-02-04";s:11:"description";s:36:"Do Androids Dream of Electric Sheep?";s:10:"components";a:2:{i:0;a:1:{s:2:"id";s:5:"10100";}i:1;a:1:{s:2:"id";s:5:"10101";}}s:17:"customFieldValues";a:2:{i:0;a:1:{s:22:"remoteCustomFieldValue";s:19:" customfield_10800 ";}i:1;a:1:{s:22:"remoteCustomFieldValue";s:0:"";}}s:9:"issuetype";i:1;}" } + */ + +/* + * - snip -- + * $issue_attributes = array('project' => 'FEEDBACK', 'assignee' => 'simon', + * 'type' => '1', 'summary' => 'test', + * 'customFieldValues' => + * array(array('customfieldId' => 'customfield_10011', 'value' => + * 'a little')) + * ); + */ + +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "ZOFF\n" . "1\n" . + "1010010101\n" . + "\n" . "\n" . "\n" . + "customfield_10800\n" . "\n" . + "12120\n" . "\n" . + "\n" . "\n" . "\n"; + +/* + * { ["components"] => object(SimpleXMLElement)#84 (1) { ["id"]=> array(2) { [0]=> string(5) "10100" [1]=> string(5) "10101" } } + * ["customFieldValues"]=> object(SimpleXMLElement)#83 (1) + * { ["id"]=> object(SimpleXMLElement)#82 (2) + * { ["customFieldID"]=> string(19) " customfield_10800 " + * ["values"]=> object(SimpleXMLElement)#85 (1) + * { ["value"]=> array(2) { [0]=> string(2) "12" [1]=> string(3) "120" } } } } } } + * + * This is an issue to allow people to test integration + * array(7) { ["project"]=> string(4) "ZOFF" ["type"]=> int(1) + * ["summary"]=> string(24) "Issue Via API 2013-02-04" + * ["description"]=> string(36) "Do Androids Dream of Electric Sheep?" + * ["components"]=> array(2) { [0]=> array(1) { ["id"]=> string(5) "10100" } [1]=> array(1) { ["id"]=> string(5) "10101" } } + * ["customFieldValues"]=> array(2) { [0]=> array(1) { ["id"]=> string(19) " customfield_10800 " } + * [1]=> array(1) { ["id"]=> string(0) "" } } + * ["issuetype"]=> int(1) } array(3) { ["status_ok"]=> bool(false) ["id"]=> int(-1) + * ["msg"]=> string(508) "Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: + * Custom field ID 'null' is invalid. - + * serialized issue:a:7:{s:7:"project";s:4:"ZOFF";s:4:"type";i:1;s:7:"summary";s:24:"Issue Via API 2013-02-04"; + * s:11:"description";s:36:"Do Androids Dream of Electric Sheep?"; + * s:10:"components" ;a:2:{i:0;a:1:{s:2:"id";s:5:"10100";}i:1;a:1:{s:2:"id";s:5:"10101";}} + * s:17:"customFieldValues";a:2:{i:0;a:1:{s:2:"id";s:19:" customfield_10800 ";}i:1;a:1:{s:2:"id";s:0:"";}}s:9:"issuetype";i:1;}" } + * + * + * + * bread + * chicken + * non-veg + * burger + * chicken + * + * Zinger Burger + * _< !]]> + * + * + * 10 + * 450 + * + * + * + * + * IT + * + * + * Bob + * + * + * Jim + * + * + * Mel + * + * + * + * + * + */ + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +echo 'Creating INTERFACE
    '; + +new dBug($itt); +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + echo 'Get Issue
    '; + $zx = $its->getIssue('ZOFF-112'); + var_dump($zx); + + echo '
    '; + + // I've seen things you people wouldn't believe. + // Attack ships on fire off the shoulder of Orion. + // I watched C-beams glitter in the dark near the Tannhauser gate. + // All those moments will be lost in time... like tears in rain... Time to die. + // + // $issue = array('project' => 'ZOFF','summary' => 'My Firts ISSUE VIA API', + // 'description' => 'Do Androids Dream of Electric Sheep?', + // 'type' => 1, 'components' => array( array('id' => '10100'), array('id' => '10101'))); + // $zorro = $its->addIssueFromArray($issue); + // var_dump($zorro); + $issue = array( + 'summary' => 'Issue Via API 2013-02-04', + 'description' => 'Do Androids Dream of Electric Sheep?' + ); + // 'type' => 1, 'components' => array( array('id' => '10100'), array('id' => '10101'))); + + $zorro = $its->addIssue($issue['summary'], $issue['description']); + var_dump($zorro); + + /* + * ["customFieldValues"]=> array(4) + * { [0]=> object(stdClass)#85 (3) + * { ["customfieldId"]=> string(17) "customfield_10800" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "123" } } + * [1]=> object(stdClass)#82 (3) + * { ["customfieldId"]=> string(17) "customfield_10000" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "117" } } + * [2]=> object(stdClass)#83 (3) + * { ["customfieldId"]=> string(17) "customfield_10200" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(3) "117" } } + * [3]=> object(stdClass)#84 (3) { ["customfieldId"]=> string(17) "customfield_10607" ["key"]=> NULL ["values"]=> array(1) { [0]=> NULL } } } + */ +} +?> diff --git a/lib/issuetrackerintegration/code_testing/jira/soap/test.jirasoapInterface.class.php b/lib/issuetrackerintegration/code_testing/jira/soap/test.jirasoapInterface.class.php index ab160796a4..a31f08681e 100644 --- a/lib/issuetrackerintegration/code_testing/jira/soap/test.jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/jira/soap/test.jirasoapInterface.class.php @@ -1,90 +1,57 @@ -getTypes(); - -/* -$cfg = "\n" . - "testlink.helpme\n" . - "jira\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "\n"; -*/ -// last test ok: 20121117 -$cfg = "\n" . - "testlink.forum\n" . - "forum\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "http://testlink.atlassian.net/browse/\n" . - "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - jirasoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -// $safe_cfg = str_replace("\n",'',$cfg); -// echo $safe_cfg; -echo 'Creating INTERFACE
    '; - -new dBug($itt); -$its = new jirasoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -if( $its->isConnected() ) -{ - // echo 'Connected !
    '; - // echo '
    ';
    -	// var_dump($its->getStatusDomain());
    -	// echo '
    '; - // echo 'Get Issue Summary
    '; - // echo($its->getIssueSummary('ZOFF-8')); - // echo '
    '; - - // echo($its->getIssueSummary('ZOFF-8')); - - -// I've seen things you people wouldn't believe. -// Attack ships on fire off the shoulder of Orion. -// I watched C-beams glitter in the dark near the Tannhauser gate. -// All those moments will be lost in time... like tears in rain... Time to die. -// - $issue = array('project' => 'ZOFF','summary' => 'My Firts ISSUE VIA API', - 'description' => 'Do Androids Dream of Electric Sheep?', - 'type' => 1); - $zorro = $its->addIssue($issue); - var_dump($zorro); - - - /* - $issue2check = array( array('issue' => 'TLJIRASOAPINTEGRATION-1', 'exists' => true), - array('issue' => 'TLJIRASOAPINTEGRATION-199999', 'exists' => false)); - - */ - - - - -} -?> \ No newline at end of file +getTypes(); + +// last test ok: 20121117 +$cfg = "\n" . "testlink.forum\n" . + "forum\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "http://testlink.atlassian.net/browse/\n" . + "http://testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "\n"; + +echo '

    '; +echo "Testing BST Integration - jirasoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +echo 'Creating INTERFACE
    '; + +new dBug($itt); +$its = new jirasoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +if ($its->isConnected()) { + // I've seen things you people wouldn't believe. + // Attack ships on fire off the shoulder of Orion. + // I watched C-beams glitter in the dark near the Tannhauser gate. + // All those moments will be lost in time... like tears in rain... Time to die. + // + $issue = array( + 'project' => 'ZOFF', + 'summary' => 'My Firts ISSUE VIA API', + 'description' => 'Do Androids Dream of Electric Sheep?', + 'type' => 1 + ); + $zorro = $its->addIssue($issue); + var_dump($zorro); +} +?> diff --git a/lib/issuetrackerintegration/code_testing/kaiten/test.kaitenInterface.class.php b/lib/issuetrackerintegration/code_testing/kaiten/test.kaitenInterface.class.php index 359a577cfd..809a306513 100644 --- a/lib/issuetrackerintegration/code_testing/kaiten/test.kaitenInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/kaiten/test.kaitenInterface.class.php @@ -1,62 +1,61 @@ -\n" . - "YOR APIKEY HERE\n". - "https://yourcompany.kaiten.io\n". - "REPLACE_ME\n". - "\n"; - -echo '

    '; -echo "Testing BST Integration - kaitenrestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new kaitenrestInterface(23,$cfg,'KAITEN'); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -$issueId = null; -if( $its->isConnected() ) { - $today = date("Y-m-d H:i:s"); - $issue = array('summary' => 'New issue card Via API' . $today,'description' => 'Some text'); - $resp = $its->addIssue($issue['summary'],$issue['description']); - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($resp);
    -  echo '
    '; - $issueId = isset($resp['id']) ? $resp['id'] : null; -} - -if( $its->isConnected() ) -{ - $resp = $its->getIssue($issueId); - - echo '
    ' . __FILE__ . '
    '; - echo '
    ';
    -  var_dump($resp);
    -  echo '
    '; - -} - +\n" . "YOR APIKEY HERE\n" . + "https://yourcompany.kaiten.io\n" . + "REPLACE_ME\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - kaitenrestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new kaitenrestInterface(23, $cfg, 'KAITEN'); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +$issueId = null; +if ($its->isConnected()) { + $today = date("Y-m-d H:i:s"); + $issue = array( + 'summary' => 'New issue card Via API' . $today, + 'description' => 'Some text' + ); + $resp = $its->addIssue($issue['summary'], $issue['description']); + echo '
    ' . __FILE__ . '
    '; + echo '
    ';
    +    var_dump($resp);
    +    echo '
    '; + $issueId = isset($resp['id']) ? $resp['id'] : null; +} + +if ($its->isConnected()) { + $resp = $its->getIssue($issueId); + + echo '
    ' . __FILE__ . '
    '; + echo '
    ';
    +    var_dump($resp);
    +    echo '
    '; +} + ?> diff --git a/lib/issuetrackerintegration/code_testing/mantis/test.mantissoapInterface.class.php b/lib/issuetrackerintegration/code_testing/mantis/test.mantissoapInterface.class.php index 935c3a94f4..1e5c7d6b94 100644 --- a/lib/issuetrackerintegration/code_testing/mantis/test.mantissoapInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/mantis/test.mantissoapInterface.class.php @@ -1,68 +1,46 @@ -getTypes(); - -// last test ok: 20121210 -/* -$cfg = "\n" . - "\n" . - "u0113\n" . - "tesi\n" . - "http://localhost:8080/development/closet/mantisbt-1.2.11/\n" . - "\n" . - "\n" . - "80resolved\n" . - "90closed\n" . - "\n". - "\n"; -*/ - -$username='administrator'; -$password='root'; -$uribase='http://localhost/development/mantis/mantisbt-1.2.15/'; - - -$cfg = "\n" . - "\n" . - "$username\n" . - "$password\n" . - "$uribase\n" . - "Project ONE\n" . - "YUMO" . - "\n"; - - -echo '

    '; -echo "Testing Issue Tracker Integration - mantissoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; -echo 'Creating INTERFACE
    '; - -$its = new mantissoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); - -$issueID = 12; -$issueNote = 'SONO UNA NOTAwww!!!'; -if( $its->isConnected() ) -{ - echo 'Connected !
    '; - $xx = $its->addNote($issueID,$issueNote); - var_dump($xx); -} \ No newline at end of file +getTypes(); + +$username = 'administrator'; +$password = 'root'; +$uribase = 'http://localhost/development/mantis/mantisbt-1.2.15/'; + +$cfg = "\n" . "\n" . + "$username\n" . "$password\n" . + "$uribase\n" . "Project ONE\n" . + "YUMO" . "\n"; + +echo '

    '; +echo "Testing Issue Tracker Integration - mantissoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; +echo 'Creating INTERFACE
    '; + +$its = new mantissoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); + +$issueID = 12; +$issueNote = 'SONO UNA NOTAwww!!!'; +if ($its->isConnected()) { + echo 'Connected !
    '; + $xx = $its->addNote($issueID, $issueNote); + var_dump($xx); +} diff --git a/lib/issuetrackerintegration/code_testing/mantis/test.testlinkopensource.mantishub.com.class.php b/lib/issuetrackerintegration/code_testing/mantis/test.testlinkopensource.mantishub.com.class.php index 66aad73e38..c009865051 100644 --- a/lib/issuetrackerintegration/code_testing/mantis/test.testlinkopensource.mantishub.com.class.php +++ b/lib/issuetrackerintegration/code_testing/mantis/test.testlinkopensource.mantishub.com.class.php @@ -1,55 +1,50 @@ -getTypes(); - -// last test ok: 20121210 -$cfg = "\n" . - "\n" . - "administrator\n" . - "mantis\n" . - "http://testlinkopensource.mantishub.com\n" . - "\n" . - "\n" . - "80resolved\n" . - "90closed\n" . - "\n". - "\n"; - -echo '

    '; -echo "Testing Issue Tracker Integration - mantissoapInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; -echo 'Creating INTERFACE
    '; - -$its = new mantissoapInterface(5,$cfg); - -echo 'Connection OK?
    '; -var_dump($its->isConnected()); -if( $its->isConnected() ) -{ - echo 'Connected !
    '; - - echo 'get resolved status configuration
    '; - new dBug($its->getResolvedStatusCfg()); - - echo 'get issue
    '; - new dBug($its->getIssue(102575)); - new dBug($its->getIssue(102529)); - -} -?> \ No newline at end of file +getTypes(); + +// last test ok: 20121210 +$cfg = "\n" . "\n" . + "administrator\n" . "mantis\n" . + "http://testlinkopensource.mantishub.com\n" . + "\n" . + "\n" . + "80resolved\n" . + "90closed\n" . + "\n" . "\n"; + +echo '

    '; +echo "Testing Issue Tracker Integration - mantissoapInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; +echo 'Creating INTERFACE
    '; + +$its = new mantissoapInterface(5, $cfg); + +echo 'Connection OK?
    '; +var_dump($its->isConnected()); +if ($its->isConnected()) { + echo 'Connected !
    '; + + echo 'get resolved status configuration
    '; + new dBug($its->getResolvedStatusCfg()); + + echo 'get issue
    '; + new dBug($its->getIssue(102575)); + new dBug($its->getIssue(102529)); +} +?> diff --git a/lib/issuetrackerintegration/code_testing/mantis/test2_int_mantissoap.php b/lib/issuetrackerintegration/code_testing/mantis/test2_int_mantissoap.php index f681efb373..ad882447a4 100644 --- a/lib/issuetrackerintegration/code_testing/mantis/test2_int_mantissoap.php +++ b/lib/issuetrackerintegration/code_testing/mantis/test2_int_mantissoap.php @@ -1,78 +1,88 @@ - -testlink.helpme -testlink.helpme -http://www.mantisbt.org/ -http://www.mantisbt.org/bugs/api/soap/mantisconnect.php?wsdl -http://www.mantisbt.org/bugs/view.php?id= -http://www.mantisbt.org/bugs/ - - - -*/ - -echo '

    '; -echo "Testing BST Integration :{$g_interface_bugs} "; -echo '

    '; -echo "Configuration settings
    "; -echo "username:" . BUG_TRACK_USERNAME . '
    '; -echo "password:" . BUG_TRACK_PASSWORD . '
    '; -echo "BUG_TRACK_HREF:" . BUG_TRACK_HREF . '
    '; -echo "BUG_TRACK_SOAP_HREF:" . BUG_TRACK_SOAP_HREF . '
    '; -echo "BUG_TRACK_SHOW_ISSUE_HREF:" . BUG_TRACK_SHOW_ISSUE_HREF . '
    '; -echo "BUG_TRACK_ENTER_ISSUE_HREF:" . BUG_TRACK_ENTER_ISSUE_HREF .'
    '; -echo '


    '; - -$op = config_get('bugInterfaceOn'); -echo 'Connection Status:' . ( $op ? 'OK' : 'KO Oohhh!') . '

    '; - -if($op) -{ - $issue2check = array( array('issue' => 11776, 'exists' => true), - array('issue' => 99999, 'exists' => false)); - - $methods = array('getBugSummaryString','getBugStatus','getBugStatusString', - 'checkBugID_existence','buildViewBugLink'); - - $if = config_get('bugInterface'); - $tc=1; - foreach($issue2check as $elem) - { - $issue = $elem['issue']; - $msg = $elem['exists'] ? "
    Ask info about EXISTENT ISSUE:{$issue}
    " : - "
    Ask info about INEXISTENT ISSUE:{$issue}
    "; - - echo $msg; - foreach($methods as $call) - { - $x = $if->$call($issue); - echo '
    Test Case #' . $tc . '
    '; - echo "
    \$if->$call($issue) => " . $x .'

    '; - $tc++; - } - } -} -?> \ No newline at end of file + + * testlink.helpme + * testlink.helpme + * http://www.mantisbt.org/ + * http://www.mantisbt.org/bugs/api/soap/mantisconnect.php?wsdl + * http://www.mantisbt.org/bugs/view.php?id= + * http://www.mantisbt.org/bugs/ + * + * + * + */ + +echo '

    '; +echo "Testing BST Integration :{$g_interface_bugs} "; +echo '

    '; +echo "Configuration settings
    "; +echo "username:" . BUG_TRACK_USERNAME . '
    '; +echo "password:" . BUG_TRACK_PASSWORD . '
    '; +echo "BUG_TRACK_HREF:" . BUG_TRACK_HREF . '
    '; +echo "BUG_TRACK_SOAP_HREF:" . BUG_TRACK_SOAP_HREF . '
    '; +echo "BUG_TRACK_SHOW_ISSUE_HREF:" . BUG_TRACK_SHOW_ISSUE_HREF . '
    '; +echo "BUG_TRACK_ENTER_ISSUE_HREF:" . BUG_TRACK_ENTER_ISSUE_HREF . '
    '; +echo '


    '; + +$op = config_get('bugInterfaceOn'); +echo 'Connection Status:' . ($op ? 'OK' : 'KO Oohhh!') . '

    '; + +if ($op) { + $issue2check = array( + array( + 'issue' => 11776, + 'exists' => true + ), + array( + 'issue' => 99999, + 'exists' => false + ) + ); + + $methods = array( + 'getBugSummaryString', + 'getBugStatus', + 'getBugStatusString', + 'checkBugID_existence', + 'buildViewBugLink' + ); + + $if = config_get('bugInterface'); + $tc = 1; + foreach ($issue2check as $elem) { + $issue = $elem['issue']; + $msg = $elem['exists'] ? "
    Ask info about EXISTENT ISSUE:{$issue}
    " : "
    Ask info about INEXISTENT ISSUE:{$issue}
    "; + + echo $msg; + foreach ($methods as $call) { + $x = $if->$call($issue); + echo '
    Test Case #' . $tc . '
    '; + echo "
    \$if->$call($issue) => " . $x . '

    '; + $tc ++; + } + } +} +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-redmine.php b/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-redmine.php index 7ecb0bef14..91169c3f7e 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-redmine.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-redmine.php @@ -1,30 +1,40 @@ - 'http://192.168.1.174', - 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'https://localhost:8443/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://localhost:8888/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://testlink01.m.redmine.org', - 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d') - ); - -$siteID = 4; -$red = new redmine($site[$siteID]['url'],$site[$siteID]['apiKey']); - -$xml = new SimpleXMLElement(''); -$xml->addChild('subject', htmlentities('TEST SUBJECT - MAY 1')); - -// As you see we can use the project identifier (string) as project_id!!! Great -$xml->addChild('project_id', 'quantum-priv'); -$xml->addChild('tracker_id', 1); + 'http://192.168.1.174', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'https://localhost:8443/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://localhost:8888/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://testlink01.m.redmine.org', + 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d' + ) +); + +$siteID = 4; +$red = new redmine($site[$siteID]['url'], $site[$siteID]['apiKey']); + +$xml = new SimpleXMLElement(''); +$xml->addChild('subject', htmlentities('TEST SUBJECT - MAY 1')); + +// As you see we can use the project identifier (string) as project_id!!! Great +$xml->addChild('project_id', 'quantum-priv'); +$xml->addChild('tracker_id', 1); $red->addIssueFromSimpleXML($xml); diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-with-cf-redmine.php b/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-with-cf-redmine.php index 7ecb0bef14..91169c3f7e 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-with-cf-redmine.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.add-issue-with-cf-redmine.php @@ -1,30 +1,40 @@ - 'http://192.168.1.174', - 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'https://localhost:8443/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://localhost:8888/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://testlink01.m.redmine.org', - 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d') - ); - -$siteID = 4; -$red = new redmine($site[$siteID]['url'],$site[$siteID]['apiKey']); - -$xml = new SimpleXMLElement(''); -$xml->addChild('subject', htmlentities('TEST SUBJECT - MAY 1')); - -// As you see we can use the project identifier (string) as project_id!!! Great -$xml->addChild('project_id', 'quantum-priv'); -$xml->addChild('tracker_id', 1); + 'http://192.168.1.174', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'https://localhost:8443/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://localhost:8888/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://testlink01.m.redmine.org', + 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d' + ) +); + +$siteID = 4; +$red = new redmine($site[$siteID]['url'], $site[$siteID]['apiKey']); + +$xml = new SimpleXMLElement(''); +$xml->addChild('subject', htmlentities('TEST SUBJECT - MAY 1')); + +// As you see we can use the project identifier (string) as project_id!!! Great +$xml->addChild('project_id', 'quantum-priv'); +$xml->addChild('tracker_id', 1); $red->addIssueFromSimpleXML($xml); diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.add-note-redmine.php b/lib/issuetrackerintegration/code_testing/redmine/test.add-note-redmine.php index 88e405f3ef..969e1b9541 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.add-note-redmine.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.add-note-redmine.php @@ -1,42 +1,47 @@ - 'http://192.168.1.174', - 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'https://localhost:8443/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://localhost:8888/redmine/', - 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd'), - array('url' => 'http://testlink01.m.redmine.org', - 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d') - ); - - -// $siteID = 2; -$siteID = 4; -$issueID = 4; -$red = new redmine($site[$siteID]['url'],$site[$siteID]['apiKey']); -$issueObj = $red->getIssue($issueID); -// echo '
    ';
    -// var_dump($issueObj);
    -// echo '
    '; -// die(); - -echo '
    '; -echo 'Summary(SUBJECT):' .(string)$issueObj->subject . '
    '; -echo 'Status: Name/ID' . (string)$issueObj->status['name'] . '/' . (int)$issueObj->status['id'] . '
    '; -echo '

    ';
    -echo '
    '; - -echo '
    '; -echo 'Trying to add a NOTE'; -$issueXmlObj = new SimpleXMLElement(''); -$issueXmlObj->addChild('notes', htmlspecialchars('ciao Bello!!!')); -$red->addIssueNoteFromSimpleXML($issueID,$issueXmlObj); \ No newline at end of file + 'http://192.168.1.174', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'https://localhost:8443/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://localhost:8888/redmine/', + 'apiKey' => '81538efac88d05a1dbf77b80e793526dbd4921dd' + ), + array( + 'url' => 'http://testlink01.m.redmine.org', + 'apiKey' => '058157d55d62b632a665491abcc003aa4554673d' + ) +); + +$siteID = 4; +$issueID = 4; +$red = new redmine($site[$siteID]['url'], $site[$siteID]['apiKey']); +$issueObj = $red->getIssue($issueID); + +echo '
    '; +echo 'Summary(SUBJECT):' . (string) $issueObj->subject . '
    '; +echo 'Status: Name/ID' . (string) $issueObj->status['name'] . '/' . + (int) $issueObj->status['id'] . '
    '; +echo '

    ';
    +echo '
    '; + +echo '
    '; +echo 'Trying to add a NOTE'; +$issueXmlObj = new SimpleXMLElement(''); +$issueXmlObj->addChild('notes', htmlspecialchars('ciao Bello!!!')); +$red->addIssueNoteFromSimpleXML($issueID, $issueXmlObj); diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-cfg.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-cfg.php index dc47fa517e..535a1069a6 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-cfg.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-cfg.php @@ -1,68 +1,61 @@ -getTypes(); - - - - - -//$site = array(array('url' => 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -// $site = array(array('url' => 'http://192.168.1.2','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -$site = array(array('url' => 'http://192.168.1.74','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'project_id' => 'tl-rest', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'http://127.0.0.1:8085/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d'), - array('url' => 'https://127.0.0.1:8443/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d')); - -// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 -// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml - -$targetSite = 3; - -$cfg = '' . "\n" . -'' . "\n" . -'' . $site[$targetSite]['apiKey'] . '' . "\n" . -'' . $site[$targetSite]['url'] . '' . "\n" . -'' . $site[$targetSite]['project_id'] . -'' . "\n" . - '' . "\n" . - ' ' . "\n" . - ' SALAME' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' STRF' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ALFA' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ' ' . "\n" . - ''; - -echo '
    ';var_dump($cfg);echo '
    '; - -// var_dump($itt); -$its = new redminerestInterface(15,$cfg); -var_dump($its->getCfg()); - -echo 'ADD?'; - -$its->addIssue('SUMMARY ','TEST DESCR'); +getTypes(); + +$site = array( + array( + 'url' => 'http://192.168.1.74', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'project_id' => 'tl-rest', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'http://127.0.0.1:8085/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ), + array( + 'url' => 'https://127.0.0.1:8443/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ) +); + +// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 +// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml + +$targetSite = 3; + +$cfg = '' . "\n" . '' . "\n" . '' . + $site[$targetSite]['apiKey'] . '' . "\n" . '' . + $site[$targetSite]['url'] . '' . "\n" . '' . + $site[$targetSite]['project_id'] . '' . "\n" . + '' . "\n" . + ' ' . "\n" . + ' SALAME' . "\n" . ' ' . + "\n" . ' ' . "\n" . + ' STRF' . "\n" . ' ' . + "\n" . ' ' . + "\n" . ' ' . "\n" . + ' ALFA' . "\n" . ' ' . + "\n" . ' ' . "\n" . ' ' . "\n" . + ''; + +echo '
    ';
    +var_dump($cfg);
    +echo '
    '; + +$its = new redminerestInterface(15, $cfg); +var_dump($its->getCfg()); + +echo 'ADD?'; + +$its->addIssue('SUMMARY ', 'TEST DESCR'); diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-fman.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-fman.php index 334300c081..ce2ffef44a 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-fman.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-fman.php @@ -1,94 +1,88 @@ - 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -// $site = array(array('url' => 'http://192.168.1.2','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - -$site = array(array('url' => 'http://192.168.1.74','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922')); - -// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 -// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml - -$red = new redmine($site[0]['url'],$site[0]['apiKey']); -$issueObj = $red->getIssue(3); - -var_dump($issueObj); -die(); - -echo '
    '; -echo 'Summary(SUBJECT):' .(string)$issueObj->subject . '
    '; -echo 'Status: Name/ID' . (string)$issueObj->status['name'] . '/' . (int)$issueObj->status['id'] . '
    '; -echo '

    ';
    -echo '
    '; - - -$xml = new SimpleXMLElement(''); -$xml->addChild('subject', htmlentities('TEST SUBJECT')); -$xml->addChild('project_id', 'tl-rest'); -$xml->addChild('tracker_id', 1); -$red->addIssueFromSimpleXML($xml); - -/* -What you get when things work ok - - - 11 - - - - - - API TEST FMAN - - 2012-11-18 - - 0 - - 0.0 - Sun Nov 18 10:26:02 +0000 2012 - Sun Nov 18 10:26:02 +0000 2012 - - - - - - - -*/ - -die(); - -/* -20120328 20:44 -object(redmine)#1 (4) { ["url"]=> string(25) "http://fman.m.redmine.org" -["apiKey"]=> string(40) "b956de40bf8baf6af7344b759cd9471832f33922" -["curl"]=> resource(3) of type (curl) ["headers":"redmine":private]=> array(0) { } } -/issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922 -http://fman.m.redmine.org/issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922object(SimpleXMLElement)#2 (2) -{ ["@attributes"]=> array(4) { ["limit"]=> string(2) "25" ["type"]=> string(5) - "array" ["total_count"]=> string(1) "1" ["offset"]=> string(1) "0" } - ["issue"]=> object(SimpleXMLElement)#3 (14) { ["id"]=> string(1) "1" - ["project"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(11) "fman-prj001" ["id"]=> string(1) "1" } } - ["tracker"]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(3) "Bug" ["id"]=> string(1) "1" } } - ["status"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(3) "New" ["id"]=> string(1) "1" } } ["priority"]=> object(SimpleXMLElement)#7 (1) - { ["@attributes"]=> array(2) { ["name"]=> string(6) "Urgent" ["id"]=> string(1) "6" } } - ["author"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(13) "Redmine Admin" ["id"]=> string(1) "2" } } ["subject"]=> string(11) - "fman-prj001" ["description"]=> string(11) "fman-prj001" ["start_date"]=> string(10) "2012-03-28" - ["due_date"]=> object(SimpleXMLElement)#9 (0) { } ["done_ratio"]=> string(1) "0" - ["estimated_hours"]=> object(SimpleXMLElement)#10 (0) { } ["created_on"]=> string(25) - "2012-03-28T20:41:21+02:00" ["updated_on"]=> string(25) "2012-03-28T20:41:21+02:00" } } -*/ -?> \ No newline at end of file + 'http://192.168.1.74', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ) +); + +$red = new redmine($site[0]['url'], $site[0]['apiKey']); +$issueObj = $red->getIssue(3); + +var_dump($issueObj); +die(); + +echo '
    '; +echo 'Summary(SUBJECT):' . (string) $issueObj->subject . '
    '; +echo 'Status: Name/ID' . (string) $issueObj->status['name'] . '/' . + (int) $issueObj->status['id'] . '
    '; +echo '

    ';
    +echo '
    '; + +$xml = new SimpleXMLElement(''); +$xml->addChild('subject', htmlentities('TEST SUBJECT')); +$xml->addChild('project_id', 'tl-rest'); +$xml->addChild('tracker_id', 1); +$red->addIssueFromSimpleXML($xml); + +/* + * What you get when things work ok + * + * + * 11 + * + * + * + * + * + * API TEST FMAN + * + * 2012-11-18 + * + * 0 + * + * 0.0 + * Sun Nov 18 10:26:02 +0000 2012 + * Sun Nov 18 10:26:02 +0000 2012 + * + * + * + * + * + * + * + */ + +die(); + +/* + * 20120328 20:44 + * object(redmine)#1 (4) { ["url"]=> string(25) "http://fman.m.redmine.org" + * ["apiKey"]=> string(40) "b956de40bf8baf6af7344b759cd9471832f33922" + * ["curl"]=> resource(3) of type (curl) ["headers":"redmine":private]=> array(0) { } } + * /issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922 + * http://fman.m.redmine.org/issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922object(SimpleXMLElement)#2 (2) + * { ["@attributes"]=> array(4) { ["limit"]=> string(2) "25" ["type"]=> string(5) + * "array" ["total_count"]=> string(1) "1" ["offset"]=> string(1) "0" } + * ["issue"]=> object(SimpleXMLElement)#3 (14) { ["id"]=> string(1) "1" + * ["project"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(2) + * { ["name"]=> string(11) "fman-prj001" ["id"]=> string(1) "1" } } + * ["tracker"]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) + * { ["name"]=> string(3) "Bug" ["id"]=> string(1) "1" } } + * ["status"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) + * { ["name"]=> string(3) "New" ["id"]=> string(1) "1" } } ["priority"]=> object(SimpleXMLElement)#7 (1) + * { ["@attributes"]=> array(2) { ["name"]=> string(6) "Urgent" ["id"]=> string(1) "6" } } + * ["author"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) + * { ["name"]=> string(13) "Redmine Admin" ["id"]=> string(1) "2" } } ["subject"]=> string(11) + * "fman-prj001" ["description"]=> string(11) "fman-prj001" ["start_date"]=> string(10) "2012-03-28" + * ["due_date"]=> object(SimpleXMLElement)#9 (0) { } ["done_ratio"]=> string(1) "0" + * ["estimated_hours"]=> object(SimpleXMLElement)#10 (0) { } ["created_on"]=> string(25) + * "2012-03-28T20:41:21+02:00" ["updated_on"]=> string(25) "2012-03-28T20:41:21+02:00" } } + */ +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-localhost.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-localhost.php index d8755f8273..c77f106d82 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-localhost.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-localhost.php @@ -1,112 +1,110 @@ - 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -// $site = array(array('url' => 'http://192.168.1.2','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -$site = array(array('url' => 'http://192.168.1.74','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'project_id' => 'tl-rest', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'http://127.0.0.1:8085/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d'), - array('url' => 'https://127.0.0.1:8443/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d')); - -// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 -// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml - -$targetSite = 3; -$red = new redmine($site[$targetSite]['url'],$site[$targetSite]['apiKey']); - -echo 'Target Installation:' . $site[$targetSite]['url'] . '
    '; - -//var_dump($red); - - -$issueObj = $red->getProjects(); -//var_dump($issueObj); - -$issueNumber = 10; -echo 'Getting ISSUE #' . $issueNumber . '
    '; -$issueObj = $red->getIssue($issueNumber); - -//var_dump($issueObj); - -echo '
    '; -echo 'Summary(SUBJECT):' .(string)$issueObj->subject . '
    '; -echo 'Status: Name/ID' . (string)$issueObj->status['name'] . '/' . (int)$issueObj->status['id'] . '
    '; -echo '

    ';
    -echo '
    '; - - -$xml = new SimpleXMLElement(''); -$xml->addChild('subject', htmlentities($site[$targetSite]['url'] . ' - TEST SUBJECT - rand:' . rand())); - -// $xml->addChild('subject', -// '/PG-TestProject-TR/TS100/QA-1:TC-A - Executed ON (ISO FORMAT): 2014-02-17 11:34:56Execution ID: 3 Tester: admin Test Plan: sdsd Build: sds Executed ON (ISO FORMAT): 2014-02-17 11:34:56 Execution Status: failed fedora-201'); - -$xml->addChild('project_id', $site[$targetSite]['project_id']); -$xml->addChild('tracker_id', 1); -$red->addIssueFromSimpleXML($xml); - -/* -What you get when things work ok - - - 11 - - - - - - API TEST FMAN - - 2012-11-18 - - 0 - - 0.0 - Sun Nov 18 10:26:02 +0000 2012 - Sun Nov 18 10:26:02 +0000 2012 - - - - - - - -*/ - + 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), +// $site = array(array('url' => 'http://192.168.1.2','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), +$site = array( + array( + 'url' => 'http://192.168.1.74', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'project_id' => 'tl-rest', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'http://127.0.0.1:8085/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ), + array( + 'url' => 'https://127.0.0.1:8443/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ) +); + +// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 +// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml + +$targetSite = 3; +$red = new redmine($site[$targetSite]['url'], $site[$targetSite]['apiKey']); + +echo 'Target Installation:' . $site[$targetSite]['url'] . '
    '; + +$issueObj = $red->getProjects(); + +$issueNumber = 10; +echo 'Getting ISSUE #' . $issueNumber . '
    '; +$issueObj = $red->getIssue($issueNumber); + +echo '
    '; +echo 'Summary(SUBJECT):' . (string) $issueObj->subject . '
    '; +echo 'Status: Name/ID' . (string) $issueObj->status['name'] . '/' . + (int) $issueObj->status['id'] . '
    '; +echo '

    ';
    +echo '
    '; + +$xml = new SimpleXMLElement(''); +$xml->addChild('subject', + htmlentities($site[$targetSite]['url'] . ' - TEST SUBJECT - rand:' . rand())); + +$xml->addChild('project_id', $site[$targetSite]['project_id']); +$xml->addChild('tracker_id', 1); +$red->addIssueFromSimpleXML($xml); + +/* + * What you get when things work ok + * + * + * 11 + * + * + * + * + * + * API TEST FMAN + * + * 2012-11-18 + * + * 0 + * + * 0.0 + * Sun Nov 18 10:26:02 +0000 2012 + * Sun Nov 18 10:26:02 +0000 2012 + * + * + * + * + * + * + * + */ + die(); /* 20120328 20:44 -object(redmine)#1 (4) { ["url"]=> string(25) "http://fman.m.redmine.org" -["apiKey"]=> string(40) "b956de40bf8baf6af7344b759cd9471832f33922" -["curl"]=> resource(3) of type (curl) ["headers":"redmine":private]=> array(0) { } } +object(redmine)#1 (4) { ["url"]=> string(25) "http://fman.m.redmine.org" +["apiKey"]=> string(40) "b956de40bf8baf6af7344b759cd9471832f33922" +["curl"]=> resource(3) of type (curl) ["headers":"redmine":private]=> array(0) { } } /issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922 -http://fman.m.redmine.org/issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922object(SimpleXMLElement)#2 (2) +http://fman.m.redmine.org/issues.xml?key=b956de40bf8baf6af7344b759cd9471832f33922object(SimpleXMLElement)#2 (2) { ["@attributes"]=> array(4) { ["limit"]=> string(2) "25" ["type"]=> string(5) - "array" ["total_count"]=> string(1) "1" ["offset"]=> string(1) "0" } + "array" ["total_count"]=> string(1) "1" ["offset"]=> string(1) "0" } ["issue"]=> object(SimpleXMLElement)#3 (14) { ["id"]=> string(1) "1" ["project"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(2) { ["name"]=> string(11) "fman-prj001" ["id"]=> string(1) "1" } } - ["tracker"]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(3) "Bug" ["id"]=> string(1) "1" } } - ["status"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(3) "New" ["id"]=> string(1) "1" } } ["priority"]=> object(SimpleXMLElement)#7 (1) + ["tracker"]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) + { ["name"]=> string(3) "Bug" ["id"]=> string(1) "1" } } + ["status"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) + { ["name"]=> string(3) "New" ["id"]=> string(1) "1" } } ["priority"]=> object(SimpleXMLElement)#7 (1) { ["@attributes"]=> array(2) { ["name"]=> string(6) "Urgent" ["id"]=> string(1) "6" } } - ["author"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) - { ["name"]=> string(13) "Redmine Admin" ["id"]=> string(1) "2" } } ["subject"]=> string(11) - "fman-prj001" ["description"]=> string(11) "fman-prj001" ["start_date"]=> string(10) "2012-03-28" - ["due_date"]=> object(SimpleXMLElement)#9 (0) { } ["done_ratio"]=> string(1) "0" - ["estimated_hours"]=> object(SimpleXMLElement)#10 (0) { } ["created_on"]=> string(25) - "2012-03-28T20:41:21+02:00" ["updated_on"]=> string(25) "2012-03-28T20:41:21+02:00" } } -*/ \ No newline at end of file + ["author"]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) + { ["name"]=> string(13) "Redmine Admin" ["id"]=> string(1) "2" } } ["subject"]=> string(11) + "fman-prj001" ["description"]=> string(11) "fman-prj001" ["start_date"]=> string(10) "2012-03-28" + ["due_date"]=> object(SimpleXMLElement)#9 (0) { } ["done_ratio"]=> string(1) "0" + ["estimated_hours"]=> object(SimpleXMLElement)#10 (0) { } ["created_on"]=> string(25) + "2012-03-28T20:41:21+02:00" ["updated_on"]=> string(25) "2012-03-28T20:41:21+02:00" } } +*/ diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-raw-api.01.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-raw-api.01.php index c56ccac841..7fb7800e1d 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine-raw-api.01.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine-raw-api.01.php @@ -1,17 +1,26 @@ - 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922')); - -$red = new redmine($site[0]['url'],$site[0]['apiKey']); -$issueObj = $red->getIssue(3); -var_dump($issueObj); -die(); - -echo '
    '; -echo 'Summary(SUBJECT):' .(string)$issueObj->subject . '
    '; -echo 'Status: Name/ID' . (string)$issueObj->status['name'] . '/' . (int)$issueObj->status['id'] . '
    '; -echo '

    ';
    -echo '
    '; -?> \ No newline at end of file + 'http://192.168.1.174', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ) +); + +$red = new redmine($site[0]['url'], $site[0]['apiKey']); +$issueObj = $red->getIssue(3); +var_dump($issueObj); +die(); + +echo '
    '; +echo 'Summary(SUBJECT):' . (string) $issueObj->subject . '
    '; +echo 'Status: Name/ID' . (string) $issueObj->status['name'] . '/' . + (int) $issueObj->status['id'] . '
    '; +echo '

    ';
    +echo '
    '; +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.01.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.01.php index c56ccac841..7fb7800e1d 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.01.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.01.php @@ -1,17 +1,26 @@ - 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922')); - -$red = new redmine($site[0]['url'],$site[0]['apiKey']); -$issueObj = $red->getIssue(3); -var_dump($issueObj); -die(); - -echo '
    '; -echo 'Summary(SUBJECT):' .(string)$issueObj->subject . '
    '; -echo 'Status: Name/ID' . (string)$issueObj->status['name'] . '/' . (int)$issueObj->status['id'] . '
    '; -echo '

    ';
    -echo '
    '; -?> \ No newline at end of file + 'http://192.168.1.174', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ) +); + +$red = new redmine($site[0]['url'], $site[0]['apiKey']); +$issueObj = $red->getIssue(3); +var_dump($issueObj); +die(); + +echo '
    '; +echo 'Summary(SUBJECT):' . (string) $issueObj->subject . '
    '; +echo 'Status: Name/ID' . (string) $issueObj->status['name'] . '/' . + (int) $issueObj->status['id'] . '
    '; +echo '

    ';
    +echo '
    '; +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.getprojects.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.getprojects.php index 00bbe693a9..1ad193014e 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.getprojects.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.getprojects.php @@ -1,39 +1,39 @@ - 'http://192.168.1.174','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -// $site = array(array('url' => 'http://192.168.1.2','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), -$site = array(array('url' => 'http://192.168.1.74','apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'), - array('url' => 'http://tl.m.redmine.org', 'project_id' => 'tl-rest', - 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922'), - array('url' => 'http://127.0.0.1:8085/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d'), - array('url' => 'https://127.0.0.1:8443/redmine', 'project_id' => 'fedora-20', - 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d')); - -// e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8 -// curl -v -H "Content-Type: application/xml" -X POST --data "@issue.xml" -H "X-Redmine-API-Key: e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8" http://192.168.1.2/issues.xml - -$targetSite = 1; - -$pxy = new stdClass(); -$pxy->proxy = config_get('proxy'); -var_dump($pxy); - -$red = new redmine($site[$targetSite]['url'], - $site[$targetSite]['apiKey'],$pxy); - -echo 'Target Installation:' . $site[$targetSite]['url'] . '
    '; -$result = $red->getProjects(); + 'http://192.168.1.74', + 'apiKey' => 'e6f1cbed7469528389554cffcb0e5aa4e0fa0bc8' + ), + array( + 'url' => 'http://tl.m.redmine.org', + 'project_id' => 'tl-rest', + 'apiKey' => 'b956de40bf8baf6af7344b759cd9471832f33922' + ), + array( + 'url' => 'http://127.0.0.1:8085/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ), + array( + 'url' => 'https://127.0.0.1:8443/redmine', + 'project_id' => 'fedora-20', + 'apiKey' => '630e3a09b365757458c4039257f7ee57e87cec5d' + ) +); + +$targetSite = 1; + +$pxy = new stdClass(); +$pxy->proxy = config_get('proxy'); +var_dump($pxy); + +$red = new redmine($site[$targetSite]['url'], $site[$targetSite]['apiKey'], $pxy); + +echo 'Target Installation:' . $site[$targetSite]['url'] . '
    '; +$result = $red->getProjects(); var_dump($result); diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.rest.php b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.rest.php index b741e004c4..d9414271f5 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redmine.rest.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redmine.rest.php @@ -1,49 +1,37 @@ -find('all'); - -var_dump($x); - -//$issues = $issueMgr->find(d); -//echo '
    ' . var_dump($issues) . '
    '; -//$issuesQty = count($issues); -//for ($idx=0; $idx < $issuesQty; $idx++) -//{ -// echo $issues[$idx]->subject; -//} - -//// find and update an issue -//$issue->find (1); -//echo $issue->subject; -//$issue->set ('subject', 'This is the new subject')->save (); - -//// delete an issue -//$issue->find (1); -//$issue->destroy (); -?> \ No newline at end of file +find('all'); + +var_dump($x); + +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test.redminerestInterface.class.php b/lib/issuetrackerintegration/code_testing/redmine/test.redminerestInterface.class.php index e3a1d493c6..7e7522284b 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test.redminerestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test.redminerestInterface.class.php @@ -1,112 +1,101 @@ -getTypes(); - -// 192.168.1.174 -$cfg = "\n" . - "AAe6f1cbed7469528389554cffcb0e5aa4e0fa0bc8\n" . - "public01\n" . - "http://192.168.1.2/\n" . - "\n"; - -echo '

    '; -echo "Testing Issue Tracker Integration - redminerestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; - -echo 'Creating INTERFACE
    '; - -$user = 'admin'; -$its[$user] = new redminerestInterface(15,$cfg); - -echo 'Connection OK?
    '; -var_dump($its[$user]->isConnected()); -if( $its[$user]->isConnected() ) -{ - - echo 'Try To Get ISSUE FROM PUBLIC PROJECT with ADMIN
    '; - $xx = $its[$user]->getIssue(23); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - echo 'Try To Get ISSUE FROM PUBLIC PROJECT with ADMIN
    '; - $xx = $its[$user]->getIssue(26); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - - echo 'Try To Get ISSUE FROM PPRIVATE PROJECT with ADMIN
    '; - $xx = $its[$user]->getIssue(3); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - echo 'Try To CREATE ISSUE ON PRIVATE PROJECT with ADMIN
    '; - - $xx = $its[$user]->addIssue('Inter', 'non vince'); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - - -} - -$cfg = "\n" . - "8530912c68e5dd52416452b0b3881acb7de94944\n" . - "public01\n" . - "http://192.168.1.174/\n" . - "\n"; - -echo '

    '; -echo "Testing BST Integration - redminerestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; - -$user= 'testlink.forum4git'; -$its[$user] = new redminerestInterface(15,$cfg); - -if( $its[$user]->isConnected() ) -{ - - echo "Try To Get ISSUE FROM PUBLIC PROJECT with $user
    "; - $xx = $its[$user]->getIssue(23); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - echo "Try To Get ISSUE FROM ***Private*** PROJECT with $user THAT HAS NO ACCESS
    "; - $xx = $its[$user]->getIssue(3); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - - echo "Try To Get ISSUE FROM ***Private*** PROJECT with $user THAT HAS ACCESS OK
    "; - $xx = $its[$user]->getIssue(24); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - -} - - -?> \ No newline at end of file +getTypes(); + +// 192.168.1.174 +$cfg = "\n" . + "AAe6f1cbed7469528389554cffcb0e5aa4e0fa0bc8\n" . + "public01\n" . + "http://192.168.1.2/\n" . "\n"; + +echo '

    '; +echo "Testing Issue Tracker Integration - redminerestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; + +echo 'Creating INTERFACE
    '; + +$user = 'admin'; +$its[$user] = new redminerestInterface(15, $cfg); + +echo 'Connection OK?
    '; +var_dump($its[$user]->isConnected()); +if ($its[$user]->isConnected()) { + + echo 'Try To Get ISSUE FROM PUBLIC PROJECT with ADMIN
    '; + $xx = $its[$user]->getIssue(23); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + echo 'Try To Get ISSUE FROM PUBLIC PROJECT with ADMIN
    '; + $xx = $its[$user]->getIssue(26); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + echo 'Try To Get ISSUE FROM PPRIVATE PROJECT with ADMIN
    '; + $xx = $its[$user]->getIssue(3); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + echo 'Try To CREATE ISSUE ON PRIVATE PROJECT with ADMIN
    '; + + $xx = $its[$user]->addIssue('Inter', 'non vince'); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; +} + +$cfg = "\n" . + "8530912c68e5dd52416452b0b3881acb7de94944\n" . + "public01\n" . + "http://192.168.1.174/\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - redminerestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; + +$user = 'testlink.forum4git'; +$its[$user] = new redminerestInterface(15, $cfg); + +if ($its[$user]->isConnected()) { + + echo "Try To Get ISSUE FROM PUBLIC PROJECT with $user
    "; + $xx = $its[$user]->getIssue(23); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + echo "Try To Get ISSUE FROM ***Private*** PROJECT with $user THAT HAS NO ACCESS
    "; + $xx = $its[$user]->getIssue(3); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + echo "Try To Get ISSUE FROM ***Private*** PROJECT with $user THAT HAS ACCESS OK
    "; + $xx = $its[$user]->getIssue(24); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; +} + +?> diff --git a/lib/issuetrackerintegration/code_testing/redmine/test2.redminerestInterface.class.php b/lib/issuetrackerintegration/code_testing/redmine/test2.redminerestInterface.class.php index 2e5b292ace..5822c1c29f 100644 --- a/lib/issuetrackerintegration/code_testing/redmine/test2.redminerestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/redmine/test2.redminerestInterface.class.php @@ -1,96 +1,72 @@ -getTypes(); - -new dBug($it_mgr); - - - -// 192.168.1.174 -// 20130406 - - -$apiKey['192.168.1.174']['admin'] = 'AAe6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'; -$apiKey['192.168.1.194']['user'] = 'a67dd9575e2b870c103ebb5aa04d5d85790069ca'; - -$projectidentifier['192.168.1.194'] = 'tl-one'; - -$user = 'user'; -$redmineHost = '192.168.1.194'; - -//$authKey = $apiKey[$redmineHost]['user']; - -// "2\n" . -// "12.6\n" . - -$cfg = "\n" . - "{$apiKey[$redmineHost]['user']}\n" . - "{$projectidentifier[$redmineHost]}\n" . - "21\n" . - "12.6\n" . - "\n" . - "http://$redmineHost/redmine/\n" . - "\n"; - -echo '

    '; -echo "Testing Issue Tracker Integration - redminerestInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; -echo '


    '; - -echo 'Creating INTERFACE
    '; - -$its[$user] = new redminerestInterface(15,$cfg); -// var_dump($its[$user]); - -echo "
    Connection OK? (using apikey for user: $user)
    "; -var_dump($its[$user]->isConnected()); -if( $its[$user]->isConnected() ) -{ - - echo 'Try To CREATE ISSUE
    '; - $xx = $its[$user]->addIssue('Internazionale di Milan', 'Who loves it?'); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - // @20130406 - // Without unset() working with bitnami redmine 2.3 - // Get AFTER create takes an eternity and FAILED - unset($its[$user]); - $its[$user] = new redminerestInterface(15,$cfg); - - echo 'Try To Get ISSUE
    '; - $xx = $its[$user]->getIssue(7); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - /* - echo 'Try To Get ISSUE FROM PUBLIC PROJECT with ADMIN
    '; - $xx = $its[$user]->getIssue(26); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - - echo 'Try To Get ISSUE FROM PPRIVATE PROJECT with ADMIN
    '; - $xx = $its[$user]->getIssue(3); - echo '
    ';
    -  var_dump($xx);
    -  echo '
    '; - */ -} -?> \ No newline at end of file +getTypes(); + +new dBug($it_mgr); + +// 192.168.1.174 +// 20130406 + +$apiKey['192.168.1.174']['admin'] = 'AAe6f1cbed7469528389554cffcb0e5aa4e0fa0bc8'; +$apiKey['192.168.1.194']['user'] = 'a67dd9575e2b870c103ebb5aa04d5d85790069ca'; + +$projectidentifier['192.168.1.194'] = 'tl-one'; + +$user = 'user'; +$redmineHost = '192.168.1.194'; + +// "2\n" . +// "12.6\n" . + +$cfg = "\n" . "{$apiKey[$redmineHost]['user']}\n" . + "{$projectidentifier[$redmineHost]}\n" . + "21\n" . + "12.6\n" . "\n" . + "http://$redmineHost/redmine/\n" . "\n"; + +echo '

    '; +echo "Testing Issue Tracker Integration - redminerestInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; +echo '


    '; + +echo 'Creating INTERFACE
    '; + +$its[$user] = new redminerestInterface(15, $cfg); + +echo "
    Connection OK? (using apikey for user: $user)
    "; +var_dump($its[$user]->isConnected()); +if ($its[$user]->isConnected()) { + + echo 'Try To CREATE ISSUE
    '; + $xx = $its[$user]->addIssue('Internazionale di Milan', 'Who loves it?'); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; + + // @20130406 + // Without unset() working with bitnami redmine 2.3 + // Get AFTER create takes an eternity and FAILED + unset($its[$user]); + $its[$user] = new redminerestInterface(15, $cfg); + + echo 'Try To Get ISSUE
    '; + $xx = $its[$user]->getIssue(7); + echo '
    ';
    +    var_dump($xx);
    +    echo '
    '; +} +?> diff --git a/lib/issuetrackerintegration/code_testing/trac/test.tracxmlrpc.php b/lib/issuetrackerintegration/code_testing/trac/test.tracxmlrpc.php index 4c8aaec6e4..fdddd53532 100644 --- a/lib/issuetrackerintegration/code_testing/trac/test.tracxmlrpc.php +++ b/lib/issuetrackerintegration/code_testing/trac/test.tracxmlrpc.php @@ -1,64 +1,35 @@ -\n" . - "admin\n" . - "admin\n" . - "http://192.168.1.183/hg-helloworld/\n" . - "\n"; - -echo '

    '; -echo "Testing BTS Integration - tracxmlrpcInterface "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$fakeTestProjectID = 185; -$its = new tracxmlrpcInterface($fakeTestProjectID,$cfg); -// var_dump($its); -$issueID = 1; -echo "
    Get issue id:{$issueID}"; -$xx = $its->getIssue($issueID); -new dBug($xx); -die(); -echo '
    Does issue 281579 exist? ' . ($its->checkBugIDExistence(281579) ? 'YES!!!' : 'Oh No!!!'); -echo '
    Does issue 999999 exist? ' . ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); - - - -/* -if($op) -{ - $issue2check = array( array('issue' => 11776, 'exists' => true), - array('issue' => 99999, 'exists' => false)); - - $methods = array('getBugSummaryString','getBugStatus','getBugStatusString', - 'checkBugID_existence','buildViewBugLink'); - - $if = config_get('bugInterface'); - new dBug($if); - // $xx = $if->getIssue(281579); - - // echo 'Does issue 999999 exist? ' . ($if->checkBugID_existence(999999) ? 'YES!!!' : 'Oh No!!!'); - // echo 'Does issue 281579 exist? ' . ($if->checkBugID_existence(281579) ? 'YES!!!' : 'Oh No!!!'); - - //$xx = $if->getIssue(999999); - //new dBug($xx); - $xx = $if->getBugStatus(281579); - new dBug($xx); - - $xx = $if->getBugSummaryString(281579); - new dBug($xx); - -} -*/ - -?> \ No newline at end of file +\n" . "admin\n" . + "admin\n" . + "http://192.168.1.183/hg-helloworld/\n" . + "\n"; + +echo '

    '; +echo "Testing BTS Integration - tracxmlrpcInterface "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$fakeTestProjectID = 185; +$its = new tracxmlrpcInterface($fakeTestProjectID, $cfg); +$issueID = 1; +echo "
    Get issue id:{$issueID}"; +$xx = $its->getIssue($issueID); +new dBug($xx); +die(); +echo '
    Does issue 281579 exist? ' . + ($its->checkBugIDExistence(281579) ? 'YES!!!' : 'Oh No!!!'); +echo '
    Does issue 999999 exist? ' . + ($its->checkBugIDExistence(999999) ? 'YES!!!' : 'Oh No!!!'); + +?> diff --git a/lib/issuetrackerintegration/code_testing/youtrack/test.youtrackrestInterface.class.php b/lib/issuetrackerintegration/code_testing/youtrack/test.youtrackrestInterface.class.php index d1847a2a75..87c33b0cda 100644 --- a/lib/issuetrackerintegration/code_testing/youtrack/test.youtrackrestInterface.class.php +++ b/lib/issuetrackerintegration/code_testing/youtrack/test.youtrackrestInterface.class.php @@ -1,112 +1,74 @@ -getTypes(); - -/* -$cfg = "\n" . -"\n" . -"testlink.youtrackincloud\n" . -"youtrackincloud2012\n" . -"http://testlink.myjetbrains.com/youtrack\n" . -"http://testlink.myjetbrains.com/youtrack/rest/\n" . -"http://testlink.myjetbrains.com/youtrack/issue/\n" . -"http://testlink.myjetbrains.com/youtrack/dashboard#newissue=yes\n" . -"\n"; - -$cfg = "\n" . -"\n" . -"testlink.integration\n" . -"integration.testlink\n" . -"http://testlink.myjetbrains.com/youtrack\n" . -"\n"; - -"http://fman.myjetbrains.com/youtrack/rest/\n" . -"http://fman.myjetbrains.com/youtrack/issue/\n" . -"http://fman.myjetbrains.com/youtrack/dashboard#newissue=yes\n" . - - -*/ -$cfg = "\n" . -"\n" . -"testlink.forum@gmail.com\n" . -"qazwsxedc\n" . -"http://fman.myjetbrains.com/youtrack\n" . -"fpo\n" . -"\n"; - -echo '

    '; -echo "Testing BST Integration - $itfName "; -echo '

    '; -echo "Configuration settings
    "; -echo "
    " . $cfg . "
    "; - -echo '


    '; - -$its = new $itfName($itfName,$cfg); - -$issueID = "fpo-1"; -$issue = $its->getIssue($issueID); -echo '
    ' . var_dump($issue) . '
    '; -new dBug($issue); - - -$status = $its->getIssueStatusCode($issueID); -echo 'status:' . $status . '
    '; - -// var_dump($its); -$client = $its->getAPIClient(); -$yy = $client->get_state_bundle('States'); -echo '<pre>' . var_dump($yy) . '</pre>'; - - -/* -$project = 'fpo'; -$assignee = ''; -$summary = 'Hope this will be issue number 2'; -$description = ' Hell'; -$priority = $type = $subsystem = $state = $affectsVersion = $fixedVersion=$fixedInBuild=''; - -$xx = $client->create_issue($project, $assignee, $summary, $description, $priority, - $type, $subsystem, $state, $affectsVersion, $fixedVersion, $fixedInBuild); - -*/ - -$xx = $its->addIssue('ROTOLO', 'non è asado'); -new dBug($xx); -die(); - - -//$zz = $client->get_project_custom_field('krm','Priority'); - -//$zz = $client->get_enum_bundle('Types'); - -// $zz = $client->get_project_custom_fields('krm'); -//echo '
    ' . var_dump($zz) . '
    '; -//die(); -//$zz = $client->get_project_custom_field('YS','State'); -//echo '
    ' . var_dump($zz) . '
    '; - -// die(); - - -//$yy = $client->get_project_issue_states('YS'); -//echo '
    ' . var_dump($yy) . '
    '; - -//$yykrm = $client->get_project_issue_states('krm'); -//echo '
    ' . var_dump($yykrm) . '
    '; - -?> \ No newline at end of file +getTypes(); + +/* + * $cfg = "\n" . + * "\n" . + * "testlink.youtrackincloud\n" . + * "youtrackincloud2012\n" . + * "http://testlink.myjetbrains.com/youtrack\n" . + * "http://testlink.myjetbrains.com/youtrack/rest/\n" . + * "http://testlink.myjetbrains.com/youtrack/issue/\n" . + * "http://testlink.myjetbrains.com/youtrack/dashboard#newissue=yes\n" . + * "\n"; + * + * $cfg = "\n" . + * "\n" . + * "testlink.integration\n" . + * "integration.testlink\n" . + * "http://testlink.myjetbrains.com/youtrack\n" . + * "\n"; + * + * "http://fman.myjetbrains.com/youtrack/rest/\n" . + * "http://fman.myjetbrains.com/youtrack/issue/\n" . + * "http://fman.myjetbrains.com/youtrack/dashboard#newissue=yes\n" . + * + * + */ +$cfg = "\n" . "\n" . + "testlink.forum@gmail.com\n" . + "qazwsxedc\n" . + "http://fman.myjetbrains.com/youtrack\n" . + "fpo\n" . "\n"; + +echo '

    '; +echo "Testing BST Integration - $itfName "; +echo '

    '; +echo "Configuration settings
    "; +echo "
    " . $cfg . "
    "; + +echo '


    '; + +$its = new $itfName($itfName, $cfg); + +$issueID = "fpo-1"; +$issue = $its->getIssue($issueID); +echo '
    ' . var_dump($issue) . '
    '; +new dBug($issue); + +$status = $its->getIssueStatusCode($issueID); +echo 'status:' . $status . '
    '; + +$client = $its->getAPIClient(); +$yy = $client->get_state_bundle('States'); +echo '<pre>' . var_dump($yy) . '</pre>'; + +$xx = $its->addIssue('ROTOLO', 'non è asado'); +new dBug($xx); +die(); + +?> diff --git a/lib/issuetrackerintegration/fogbugzdbInterface.class.php b/lib/issuetrackerintegration/fogbugzdbInterface.class.php index 346afb1443..4e76fead06 100644 --- a/lib/issuetrackerintegration/fogbugzdbInterface.class.php +++ b/lib/issuetrackerintegration/fogbugzdbInterface.class.php @@ -1,191 +1,171 @@ -interfaceViaDB = true; - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => true); - $this->guiCfg = array('use_decoration' => true); - } - - - - /** - * Return the URL to the bugtracking page for viewing - * the bug with the given id. - * - * @param int id the bug id - * - * @return string returns a complete URL to view the bug - **/ - function buildViewBugURL($id) - { - return $this->cfg->uriview.urlencode($id); - } - - /** - * - **/ - function getIssue($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if (!$this->isConnected()) - { - return false; - } - $sql = "/* $debugMsg */ " . - " SELECT Bug.ixBug AS id, Bug.ixStatus AS status, Status.sStatus AS statusVerbose," . - " Bug.sTitle AS summary, Bug.fOpen AS openStatus " . - " FROM Bug JOIN Status ON Status.ixStatus = Bug.ixStatus " . - " WHERE Bug.ixBug=" . intval($id); - - $rs = $this->dbConnection->fetchRowsIntoMap($sql,'id'); - - $issue = null; - if( !is_null($rs) ) - { - $issue = new stdClass(); - $issue->id = $id; - $issue->openStatus = $rs[$id]['openStatus']; - $issue->IDHTMLString = "{$id} : "; - $issue->statusCode = $rs[$id]['status']; - $issue->statusVerbose = $rs[$id]['statusVerbose']; - - $issue->statusHTMLString = $this->buildStatusHTMLString($issue); - $issue->statusColor = isset($this->status_color[$issue->statusVerbose]) ? - $this->status_color[$issue->statusVerbose] : 'white'; - - $issue->summaryHTMLString = $rs[$id]['summary']; - } - return $issue; - } - - - /** - * Returns the status of the bug with the given id - * this function is not directly called by TestLink. - * - * @return string returns the status of the given bug (if found in the db), or false else - **/ - function getBugStatus($id) - { - if (!$this->isConnected()) - { - return false; - } - $issue = $this->getIssue($id); - return is_null($issue) ? $issue : $issue->statusVerbose; - } - - - /** - * checks is bug id is present on BTS - * - * @return integer returns 1 if the bug with the given id exists - **/ - function checkBugIDExistence($id) - { - $status_ok = 0; - $issue = $this->getIssue($id); - return !is_null($issue) ? 1 : 0; - } - - - function buildViewBugLink($bugID,$addSummary = false) - { - $linkVerbose = parent::buildViewBugLink($bugID, $addSummary); - $status = $this->getBugStatus($bugID); - $color = isset($this->status_color[$status]) ? $this->status_color[$status] : 'white'; - $title = lang_get('access_to_bts'); - return "
    $linkVerbose
    "; - } - - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * - * - **/ - function buildStatusHTMLString($issue) - { - // if the bug wasn't found the status is null and we simply display the bugID - $str = htmlspecialchars($issue->id); - if (!is_null($issue) ) - { - //strike through all bugs that have a closed status.. - if( $issue->statusCode > 1 ) - { - if( $issue->openStatus ) - { - // strike through and bold all bugs that have a resolved status - $str = "[resolv.] [$issue->statusVerbose] " . $id . ""; - } - else - { - $str = "[closed] [$issue->statusVerbose] " . $id . ""; - } - } - else - { - $str = "[$issue->statusVerbose] "; - } - } - return (!is_null($issue) && $issue) ? $str : null; - } - - - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - - - public static function getCfgTemplate() - { - - $template = "\n" . - "\n" . - "DATABASE SERVER NAME\n" . - "DATABASE NAME\n" . - "mysql\n" . - "USER\n" . - "PASSWORD\n" . - "\n" . - "http://[FOGBUGZ_HOST]/fogbugz/default.asp?pg=pgEditBug&command=view&ixbug=\n" . - "http://[FOGBUGZ_HOST]/fogbugz/default.asp?command=new&pg=pgEditBug\n" . - "\n"; - return $template; - } - -} -?> \ No newline at end of file +interfaceViaDB = true; + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => true + ); + $this->guiCfg = array( + 'use_decoration' => true + ); + } + + /** + * Return the URL to the bugtracking page for viewing + * the bug with the given id. + * + * @param + * int id the bug id + * @return string returns a complete URL to view the bug + */ + public function buildViewBugURL($id) + { + return $this->cfg->uriview . urlencode($id); + } + + /** + */ + public function getIssue($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (! $this->isConnected()) { + return false; + } + $sql = "/* $debugMsg */ " . + " SELECT Bug.ixBug AS id, Bug.ixStatus AS status, Status.sStatus AS statusVerbose," . + " Bug.sTitle AS summary, Bug.fOpen AS openStatus " . + " FROM Bug JOIN Status ON Status.ixStatus = Bug.ixStatus " . + " WHERE Bug.ixBug=" . intval($id); + + $rs = $this->dbConnection->fetchRowsIntoMap($sql, 'id'); + + $issue = null; + if (! is_null($rs)) { + $issue = new stdClass(); + $issue->id = $id; + $issue->openStatus = $rs[$id]['openStatus']; + $issue->IDHTMLString = "{$id} : "; + $issue->statusCode = $rs[$id]['status']; + $issue->statusVerbose = $rs[$id]['statusVerbose']; + + $issue->statusHTMLString = $this->buildStatusHTMLString($issue); + $issue->statusColor = isset( + $this->status_color[$issue->statusVerbose]) ? $this->status_color[$issue->statusVerbose] : 'white'; + + $issue->summaryHTMLString = $rs[$id]['summary']; + } + return $issue; + } + + /** + * Returns the status of the bug with the given id + * this function is not directly called by TestLink. + * + * @return string returns the status of the given bug (if found in the db), or false else + */ + public function getBugStatus($id) + { + if (! $this->isConnected()) { + return false; + } + $issue = $this->getIssue($id); + return is_null($issue) ? $issue : $issue->statusVerbose; + } + + /** + * checks is bug id is present on BTS + * + * @return integer returns 1 if the bug with the given id exists + */ + public function checkBugIDExistence($id) + { + $issue = $this->getIssue($id); + return ! is_null($issue) ? 1 : 0; + } + + public function buildViewBugLink($bugID, $addSummary = false) + { + $linkVerbose = parent::buildViewBugLink($bugID, $addSummary); + $status = $this->getBugStatus($bugID); + $color = isset($this->status_color[$status]) ? $this->status_color[$status] : 'white'; + $title = lang_get('access_to_bts'); + return "
    $linkVerbose
    "; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + */ + private function buildStatusHTMLString($issue) + { + // if the bug wasn't found the status is null and we simply display the bugID + $str = htmlspecialchars($issue->id); + if (! is_null($issue)) { + // strike through all bugs that have a closed status.. + if ($issue->statusCode > 1) { + if ($issue->openStatus) { + // strike through and bold all bugs that have a resolved status + $str = "[resolv.] [$issue->statusVerbose] " . $id . + ""; + } else { + $str = "[closed] [$issue->statusVerbose] " . $id . + ""; + } + } else { + $str = "[$issue->statusVerbose] "; + } + } + return (! is_null($issue) && $issue) ? $str : null; + } + + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + public static function getCfgTemplate() + { + return "\n" . "\n" . + "DATABASE SERVER NAME\n" . + "DATABASE NAME\n" . "mysql\n" . + "USER\n" . "PASSWORD\n" . + "\n" . + "http://[FOGBUGZ_HOST]/fogbugz/default.asp?pg=pgEditBug&command=view&ixbug=\n" . + "http://[FOGBUGZ_HOST]/fogbugz/default.asp?command=new&pg=pgEditBug\n" . + "\n"; + } +} +?> diff --git a/lib/issuetrackerintegration/fogbugzrestInterface.class.php b/lib/issuetrackerintegration/fogbugzrestInterface.class.php index c5b84440f6..175f1af263 100644 --- a/lib/issuetrackerintegration/fogbugzrestInterface.class.php +++ b/lib/issuetrackerintegration/fogbugzrestInterface.class.php @@ -1,279 +1,272 @@ -name = $name; - $this->interfaceViaDB = false; - $this->methodOpt = array('buildViewBugLink' => array('addSummary' => true, 'colorByStatus' => true)); - - if( !$this->setCfg($config) ) - { - return false; - } - $this->completeCfg(); - $this->connect(); - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'default.asp?command=view&pg=pgEditBug&ixbug='; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . 'default.asp?command=new&pg=pgEditBug'; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $this->APIClient = new FogBugz((string)trim($this->cfg->username),(string)trim($this->cfg->password), - (string)trim($this->cfg->uribase)); - $this->APIClient->logon(); - $this->connected = true; - } - catch(Exception $e) - { - $logDetails = ''; - foreach(array('uribase','username','password') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) - { - $msg = __METHOD__ . ' Not Connected '; - tLog($msg,'ERROR'); - return false; - } - - try - { - $target = array('q' => intval($issueID), 'cols' => 'sTitle,sStatus'); - $xml = $this->APIClient->search($target); - if( !is_null($xml) && is_object($xml) ) - { - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = (string)$xml->cases->case->sStatus; - $issue->statusVerbose = $issue->statusCode; - $issue->statusHTMLString = "[$issue->statusCode] "; - $issue->summary = $issue->summaryHTMLString = (string)$xml->cases->case->sTitle; - } - } - catch(Exception $e) - { - $msg = __METHOD__ . '/' . $e->getMessage(); - tLog($msg,'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue)) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue)) ? $issue->summaryHTMLString : null; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = !is_null($issue) && is_object($issue); - } - return $status_ok; - } - - - /** - * - */ - public function addIssue($summary,$description) - { - try - { - $projectName = (string)$this->cfg->project; - $issue = array('sProject' => htmlentities($projectName), - 'sTitle' => htmlentities($summary), - 'sEvent' => htmlentities($description)); - - // just for the record APIClient->NAME OF FogBugz command - $op = $this->APIClient->new($issue); - $ret = array('status_ok' => true, 'id' => (string)$op->case['ixBug'], - 'msg' => sprintf(lang_get('fogbugz_bug_created'),$summary,$projectName)); - } - catch (Exception $e) - { - $msg = "Create FOGBUGZ Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - - // https://testlink.fogbugz.com/fogbugz/default.asp?pg=pgEditBug&command=view&ixbug= - $template = "\n" . - "\n" . - "FOGBUGZ LOGIN NAME\n" . - "FOGBUGZ PASSWORD\n" . - "https://testlink.fogbugz.com\n" . - "\n" . - "FOGBUGZ PROJECT NAME\n" . - "\n"; - return $template; - } - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'project')); - } - -} \ No newline at end of file +name = $name; + $this->interfaceViaDB = false; + $this->methodOpt = array( + 'buildViewBugLink' => array( + 'addSummary' => true, + 'colorByStatus' => true + ) + ); + + if (! $this->setCfg($config)) { + return false; + } + $this->completeCfg(); + $this->connect(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . + 'default.asp?command=view&pg=pgEditBug&ixbug='; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . + 'default.asp?command=new&pg=pgEditBug'; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + * + */ + public function connect() + { + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $this->APIClient = new FogBugz((string) trim($this->cfg->username), + (string) trim($this->cfg->password), + (string) trim($this->cfg->uribase)); + $this->APIClient->logon(); + $this->connected = true; + } catch (Exception $e) { + $logDetails = ''; + foreach (array( + 'uribase', + 'username', + 'password' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + $msg = __METHOD__ . ' Not Connected '; + tLog($msg, 'ERROR'); + return false; + } + + try { + $target = array( + 'q' => intval($issueID), + 'cols' => 'sTitle,sStatus' + ); + $xml = $this->APIClient->search($target); + if (! is_null($xml) && is_object($xml)) { + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = (string) $xml->cases->case->sStatus; + $issue->statusVerbose = $issue->statusCode; + $issue->statusHTMLString = "[$issue->statusCode] "; + $issue->summary = $issue->summaryHTMLString = (string) $xml->cases->case->sTitle; + } + } catch (Exception $e) { + $msg = __METHOD__ . '/' . $e->getMessage(); + tLog($msg, 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + * + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->summaryHTMLString : null; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = ! is_null($issue) && is_object($issue); + } + return $status_ok; + } + + /** + */ + public function addIssue($summary, $description) + { + try { + $projectName = (string) $this->cfg->project; + $issue = array( + 'sProject' => htmlentities($projectName), + 'sTitle' => htmlentities($summary), + 'sEvent' => htmlentities($description) + ); + + // just for the record APIClient->NAME OF FogBugz command + $op = $this->APIClient->new($issue); + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->case['ixBug'], + 'msg' => sprintf(lang_get('fogbugz_bug_created'), $summary, + $projectName) + ); + } catch (Exception $e) { + $msg = "Create FOGBUGZ Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + + // https://testlink.fogbugz.com/fogbugz/default.asp?pg=pgEditBug&command=view&ixbug= + return "\n" . "\n" . + "FOGBUGZ LOGIN NAME\n" . + "FOGBUGZ PASSWORD\n" . + "https://testlink.fogbugz.com\n" . + "\n" . + "FOGBUGZ PROJECT NAME\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'project'); + } +} diff --git a/lib/issuetrackerintegration/gforgesoapInterface.class.php b/lib/issuetrackerintegration/gforgesoapInterface.class.php index 55b7aaa6e7..299e37871a 100644 --- a/lib/issuetrackerintegration/gforgesoapInterface.class.php +++ b/lib/issuetrackerintegration/gforgesoapInterface.class.php @@ -1,420 +1,364 @@ - 'its_duedate_with_separator'); - - private $soapOpt = array("connection_timeout" => 1, 'exceptions' => 1); - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - $this->name = $name; - $this->interfaceViaDB = false; - if( !$this->setCfg($config) ) - { - return false; - } - - $this->completeCfg(); - $this->connect(); - } - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/' ; - if( !property_exists($this->cfg,'uriwsdl') ) - { - $this->cfg->uriwsdl = $base . 'gf/xmlcompatibility/soap5/?wsdl'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'browse/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . 'gf/'; - } - } - - - function getAuthToken() - { - return $this->authToken; - } - - - /** - * status code (integer) for issueID - * - * - * @param string issueID - * - * @return - **/ - public function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusVerbose : null; - } - - - /** - * - * @param string issueID - * - * @return string returns the bug summary if bug is found, else null - **/ - function getIssueSummary($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->summary : null; - } - - /** - * @internal precondition: TestLink has to be connected to BTS - * - * @param string issueID - * - **/ - function getIssue($issueID) - { - try - { - $issue = $this->APIClient->getTrackerItemFull($this->authToken, $issueID); - new dBug($issue); - - echo 'QTY extra_field_data:' . count($issue->extra_field_data) . '
    '; - $target = array(); - $dataID = array(); - foreach($issue->extra_field_data as $efd) - { - $target[] = $efd->tracker_extra_field_id; - $dataID[] = $efd->tracker_extra_field_data_id; - } - - $extraFields = $this->APIClient->getTrackerExtraFieldArray($this->authToken, - $issue->tracker_id, $target); - - new dBug($extraFields); - $idx=0; - foreach($extraFields as $ef) - { - if($ef->field_name == 'Status') - { - echo 'Status FOUND on idx=' . $idx . '
    '; - $ef->tracker_extra_field_data_id = $dataID[$idx]; - $statusObj = $ef; - break; - } - $idx++; - } - new dBug($statusObj); - - $zz = $this->APIClient->getTrackerExtraField($this->authToken, - $issue->tracker_id, - $statusObj->tracker_extra_field_id); - - new dBug($zz); - - //$yy = $this->APIClient->getTrackerExtraFieldElementArray($this->authToken, - // $issue->tracker_id, (array)$statusObj->tracker_extra_field_id); - - // new dBug($yy); - // echo $statusObj->tracker_extra_field_data_id; - // $yy = $this->APIClient->getTrackerExtraFieldData($this->authToken,$issue->tracker_item_id,87191); - // // $statusObj->tracker_extra_field_data_id); - - echo $this->authToken . '
    '; - // echo '$issue->tracker_item_id:' . $issue->tracker_item_id . '
    '; - // echo '$statusObj->tracker_extra_field_data_id:' . $statusObj->tracker_extra_field_data_id . '
    '; - //echo '$statusObj->tracker_extra_field_id:' . $statusObj->tracker_extra_field_id . '
    '; - //echo '
    '; - //$yy = $this->APIClient->getTrackerExtraFieldDatas($this->authToken,$issue->tracker_item_id, - // $statusObj->tracker_extra_field_id); - - // tracker_item_id:8305 - // tracker_extra_field_id:55108 - // tracker_extra_field_data_id:87191 - $yy = $this->APIClient->getTrackerExtraFieldDatas($this->authToken,8305,55108); - echo __LINE__; - new dBug($yy); - - // getTrackerExtraField(string sessionhash, int tracker_id, int tracker_extra_field_id) - - - // We are going to have a set of standard properties - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = $issue->status_id; - $issue->statusVerbose = array_search($issue->statusCode, $this->statusDomain); - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->statusCode); - $issue->summaryHTMLString = $this->buildSummaryHTMLString($issue); - } - catch (Exception $e) - { - tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); - $issue = null; - } - - return $issue; - } - - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxString($issueID); - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = !is_null($issue); - } - return $status_ok; - } - - /** - * establishes connection to the bugtracking system - * - * @return bool returns true if the soap connection was established and the - * wsdl could be downloaded, false else - * - **/ - function connect() - { - $this->interfaceViaDB = false; - $op = $this->getClient(array('log' => true)); - if( ($this->connected = $op['connected']) ) - { - // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need - // to do a simple call with user/password only to understand if we are really connected - try - { - $this->APIClient = $op['client']; - $this->authToken = $this->APIClient->login((string)$this->cfg->username, (string)$this->cfg->password); - - $this->l18n = init_labels($this->labels); - } - catch (SoapFault $f) - { - $this->connected = false; - tLog(__CLASS__ . " - SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})","ERROR"); - } - } - return $this->connected; - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - function getClient($opt=null) - { - // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work - $res = array('client' => null, 'connected' => false, 'msg' => 'generic ko'); - $my['opt'] = array('log' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - try - { - // IMPORTANT NOTICE - // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL - // DO CAST any member before using it. - // If we do following call WITHOUT (string) CAST, SoapClient() fails - // complaining '... wsdl has to be an STRING or null ...' - $res['client'] = new SoapClient((string)$this->cfg->uriwsdl,$this->soapOpt); - $res['connected'] = true; - $res['msg'] = 'iupi!!!'; - } - catch (SoapFault $f) - { - $res['connected'] = false; - $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; - if($my['opt']['log']) - { - tLog("SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})","ERROR"); - } - } - return $res; - } - - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - private function helperParseDate($date2parse) - { - $ret = null; - if (!is_null($date2parse)) - { - $ret = date_parse($date2parse); - $ret = ((gmmktime(0, 0, 0, $ret['month'], $ret['day'], $ret['year']))); - $ret = $this->l18n['duedate'] . @gmstrftime("%d %b %Y",($ret)); - } - return $ret ; - } - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "GFORGE LOGIN NAME\n" . - "GFORGE PASSWORD\n" . - "http://gforge.org/\n" . - "\n"; - return $template; - } - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public function getStatusDomain() - { - return $this->statusDomain; - } - - /** - * - **/ - function buildStatusHTMLString($statusCode) - { - $str = array_search($statusCode, $this->statusDomain); - if (strcasecmp($str, 'closed') == 0 || strcasecmp($str, 'resolved') == 0 ) - { - $str = "" . $str . ""; - } - return "[{$str}] "; - } - - /** - * - **/ - function buildSummaryHTMLString($issue) - { - $summary = $issue->summary; - $strDueDate = $this->helperParseDate($issue->duedate); - if( !is_null($strDueDate) ) - { - $summary .= " [$strDueDate] "; - } - return $summary; - } - - public static function checkEnv() - { - $ret = array(); - $ret['status'] = extension_loaded('soap'); - $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; - return $ret; - } - - -/* -getTrackerItem() - -$issue (object) -tracker_id 371 -tracker_item_id 7091 -status_id 0 -priority 3 -submitted_by 14030 -open_date 2011-03-31 03:00:00 -close_date 2011-04-07 03:00:00 -summary Add support for Gforge6 -details Add support for Gforge As 6.0 (hierarchical tracker items) -last_modified_date 2011-05-26 20:31:40 -last_modified_by 14030 -sort_order 0 -parent_id 0 -has_subitems [empty string] -subitems_count 0 -*/ - -} -?> \ No newline at end of file + 'its_duedate_with_separator' + ); + + private $soapOpt = array( + "connection_timeout" => 1, + 'exceptions' => 1 + ); + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + if (! $this->setCfg($config)) { + return false; + } + + $this->completeCfg(); + $this->connect(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; + if (! property_exists($this->cfg, 'uriwsdl')) { + $this->cfg->uriwsdl = $base . 'gf/xmlcompatibility/soap5/?wsdl'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'browse/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . 'gf/'; + } + } + + public function getAuthToken() + { + return $this->authToken; + } + + /** + * status code (integer) for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusVerbose : null; + } + + /** + * + * @param + * string issueID + * @return string returns the bug summary if bug is found, else null + */ + public function getIssueSummary($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->summary : null; + } + + /** + * + * @internal precondition: TestLink has to be connected to BTS + * @param + * string issueID + */ + public function getIssue($issueID) + { + try { + $issue = $this->APIClient->getTrackerItemFull($this->authToken, + $issueID); + new dBug($issue); + + echo 'QTY extra_field_data:' . count($issue->extra_field_data) . + '
    '; + $target = array(); + $dataID = array(); + foreach ($issue->extra_field_data as $efd) { + $target[] = $efd->tracker_extra_field_id; + $dataID[] = $efd->tracker_extra_field_data_id; + } + + $extraFields = $this->APIClient->getTrackerExtraFieldArray( + $this->authToken, $issue->tracker_id, $target); + + new dBug($extraFields); + $idx = 0; + foreach ($extraFields as $ef) { + if ($ef->field_name == 'Status') { + echo 'Status FOUND on idx=' . $idx . '
    '; + $ef->tracker_extra_field_data_id = $dataID[$idx]; + $statusObj = $ef; + break; + } + $idx ++; + } + new dBug($statusObj); + + $zz = $this->APIClient->getTrackerExtraField($this->authToken, + $issue->tracker_id, $statusObj->tracker_extra_field_id); + + new dBug($zz); + + echo $this->authToken . '
    '; + + // tracker_item_id:8305 + // tracker_extra_field_id:55108 + // tracker_extra_field_data_id:87191 + $yy = $this->APIClient->getTrackerExtraFieldDatas($this->authToken, + 8305, 55108); + echo __LINE__; + new dBug($yy); + + // getTrackerExtraField(string sessionhash, int tracker_id, int tracker_extra_field_id) + + // We are going to have a set of standard properties + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = $issue->status_id; + $issue->statusVerbose = array_search($issue->statusCode, + $this->statusDomain); + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->statusCode); + $issue->summaryHTMLString = $this->buildSummaryHTMLString($issue); + } catch (Exception $e) { + tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); + $issue = null; + } + + return $issue; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxString($issueID); + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = ! is_null($issue); + } + return $status_ok; + } + + /** + * establishes connection to the bugtracking system + * + * @return bool returns true if the soap connection was established and the + * wsdl could be downloaded, false else + */ + public function connect() + { + $this->interfaceViaDB = false; + $op = $this->getClient(array( + 'log' => true + )); + if ($this->connected = $op['connected']) { + // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need + // to do a simple call with user/password only to understand if we are really connected + try { + $this->APIClient = $op['client']; + $this->authToken = $this->APIClient->login( + (string) $this->cfg->username, (string) $this->cfg->password); + + $this->l18n = init_labels($this->labels); + } catch (SoapFault $f) { + $this->connected = false; + tLog( + __CLASS__ . + " - SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", + "ERROR"); + } + } + return $this->connected; + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + private function getClient($opt = null) + { + // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work + $res = array( + 'client' => null, + 'connected' => false, + 'msg' => 'generic ko' + ); + $my['opt'] = array( + 'log' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + try { + // IMPORTANT NOTICE + // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL + // DO CAST any member before using it. + // If we do following call WITHOUT (string) CAST, SoapClient() fails + // complaining '... wsdl has to be an STRING or null ...' + $res['client'] = new SoapClient((string) $this->cfg->uriwsdl, + $this->soapOpt); + $res['connected'] = true; + $res['msg'] = 'iupi!!!'; + } catch (SoapFault $f) { + $res['connected'] = false; + $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; + if ($my['opt']['log']) { + tLog( + "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", + "ERROR"); + } + } + return $res; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + private function helperParseDate($date2parse) + { + $ret = null; + if (! is_null($date2parse)) { + $ret = date_parse($date2parse); + $ret = (gmmktime(0, 0, 0, $ret['month'], $ret['day'], $ret['year'])); + $ret = $this->l18n['duedate'] . @gmstrftime("%d %b %Y", ($ret)); + } + return $ret; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "GFORGE LOGIN NAME\n" . + "GFORGE PASSWORD\n" . + "http://gforge.org/\n" . "\n"; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public function getStatusDomain() + { + return $this->statusDomain; + } + + /** + */ + private function buildStatusHTMLString($statusCode) + { + $str = array_search($statusCode, $this->statusDomain); + if (strcasecmp($str, 'closed') == 0 || strcasecmp($str, 'resolved') == 0) { + $str = "" . $str . ""; + } + return "[{$str}] "; + } + + /** + */ + private function buildSummaryHTMLString($issue) + { + $summary = $issue->summary; + $strDueDate = $this->helperParseDate($issue->duedate); + if (! is_null($strDueDate)) { + $summary .= " [$strDueDate] "; + } + return $summary; + } + + public static function checkEnv() + { + $ret = array(); + $ret['status'] = extension_loaded('soap'); + $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; + return $ret; + } +} +?> diff --git a/lib/issuetrackerintegration/githubrestInterface.class.php b/lib/issuetrackerintegration/githubrestInterface.class.php index f8379915a0..9bf59aa623 100644 --- a/lib/issuetrackerintegration/githubrestInterface.class.php +++ b/lib/issuetrackerintegration/githubrestInterface.class.php @@ -1,368 +1,350 @@ - - * file derived from GITlab integration done by jlguardi - * - * @internal revisions - * @since 1.9.20-fixed - * -**/ -require_once(TL_ABS_PATH . "/third_party/github-php-api/lib/github-rest-api.php"); -class githubrestInterface extends issueTrackerInterface -{ - private $APIClient; - private $issueDefaults; - private $issueOtherAttr = null; // see - private $translate = null; - - var $defaultResolvedStatus; - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - $this->name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 'open', 'verbose' => 'open'); - $this->defaultResolvedStatus[] = array('code' => 'closed', 'verbose' => 'closed'); - - if( !$this->setCfg($config) ) - { - return false; - } - - // http://www.github.org/issues/6843 - // "Target version" is the new display name for this property, - // but it's still named fixed_version internally and thus in the API. - // $issueXmlObj->addChild('fixed_version_id', (string)2); - $this->translate['targetversion'] = 'fixed_version_id'; - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->url,"/") . '/'; // be sure no double // at end - if( property_exists($this->cfg,'attributes') ) - { - $attr = get_object_vars($this->cfg->attributes); - foreach ($attr as $name => $elem) - { - $name = (string)$name; - if( is_object($elem) ) - { - $elem = get_object_vars($elem); - $cc = current($elem); - $kk = key($elem); - foreach($cc as $value) - { - $this->issueOtherAttr[$name][] = array($kk => (string)$value); - } - } - else - { - $this->issueOtherAttr[$name] = (string)$elem; - } - } - } - - // All attributes that I do not consider mandatory - // are managed through the issueAdditionalAttributes - // - // On Redmine 1 seems to be standard for Issues/Bugs - $this->issueDefaults = array('trackerid' => 1); - foreach($this->issueDefaults as $prop => $default) - { - if(!isset($this->issueAttr[$prop])) - { - $this->issueAttr[$prop] = $default; - } - } - - } - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - $processCatch = false; - - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $url = (string)trim($this->cfg->url); - $user = (string)trim($this->cfg->user); - $apiKey = (string)trim($this->cfg->apikey); - $repo = (string)trim($this->cfg->repo); //TODO: check integer value - $owner = (string)trim($this->cfg->owner); //TODO: check integer value - $pxy = new stdClass(); - $pxy->proxy = config_get('proxy'); - $this->APIClient = new github($url, $user, $apiKey, $owner, $repo, $pxy); - - // to undestand if connection is OK, I will ask for projects. - // I've tried to ask for users but get always ERROR from github (not able to understand why). - try - { - $items = $this->APIClient->getRepo(); - $this->connected = count($items) > 0 ? true : false; - unset($items); - } - catch(Exception $e) - { - $processCatch = true; - } - } - catch(Exception $e) - { - $processCatch = true; - } - - if($processCatch) - { - $logDetails = ''; - foreach(array('url', 'user', 'apikey', 'owner', 'repo') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - function buildViewBugURL($issueID) - { - if (!$this->isConnected()) - { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - return $this->APIClient->getIssueURL($issueID); - } - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) - { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try - { - $jsonObj = $this->APIClient->getIssue((int)$issueID); - - if( !is_null($jsonObj) && is_object($jsonObj)) - { - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->id = $jsonObj->number; - $issue->url = $jsonObj->html_url; - $issue->statusCode = (string)$jsonObj->state; - $issue->statusVerbose = (string)$jsonObj->state; - $issue->statusHTMLString = "[$issue->statusVerbose] "; - $issue->summaryHTMLString = (string)$jsonObj->title.":
    ".(string)$jsonObj->body; - $issue->summary = (string)$jsonObj->title.":\n".(string)$jsonObj->body; - $Notes = $this->APIClient->getNotes((int)$issueID); - if(is_array($Notes) && count($Notes)>0){ - foreach($Notes as $key => $note){ - $issue->summaryHTMLString .= "
    [Note $key]:$note->body"; - $issue->summary .= "\n[Note $key]: $note->body"; - } - } - $issue->isResolved = $this->state == 'closed'; - } - } - catch(Exception $e) - { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - public function addIssue($summary,$description,$opt=null) - { - try - { - $op = $this->APIClient->addIssue($summary, $description); - if(is_null($op)){ - throw new Exception("Error creating issue", 1); - } - $ret = array('status_ok' => true, 'id' => (string)$op->number, - 'msg' => sprintf(lang_get('github_bug_created'), - $summary, $this->APIClient->repo)); - } - catch (Exception $e) - { - $msg = "Create github Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - - /** - * - */ - public function addNote($issueID,$noteText,$opt=null) - { - $op = $this->APIClient->addNote($issueID, $noteText); - if(is_null($op)){ - throw new Exception("Error setting note", 1); - } - $ret = array('status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('github_bug_comment'),$op->body, $this->APIClient->repo)); - return $ret; - } - - - - - /** - * - * - * - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "github user\n" . - "github TOKEN\n" . - "https://api.github.com\n" . - "GitHub Org or User\n" . - "github REPOSITORY\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return true; - } - - -} \ No newline at end of file + + * file derived from GITlab integration done by jlguardi + * + * @internal revisions + * @since 1.9.20-fixed + * + **/ +require_once TL_ABS_PATH . '/third_party/github-php-api/lib/github-rest-api.php'; + +class githubrestInterface extends issueTrackerInterface +{ + + private $APIClient; + + private $issueDefaults; + + private $issueOtherAttr = null; + + private $translate = null; + + public $defaultResolvedStatus; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 'open', + 'verbose' => 'open' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'closed', + 'verbose' => 'closed' + ); + + if (! $this->setCfg($config)) { + return false; + } + + // http://www.github.org/issues/6843 + // "Target version" is the new display name for this property, + // but it's still named fixed_version internally and thus in the API. + // $issueXmlObj->addChild('fixed_version_id', (string)2); + $this->translate['targetversion'] = 'fixed_version_id'; + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + if (property_exists($this->cfg, 'attributes')) { + $attr = get_object_vars($this->cfg->attributes); + foreach ($attr as $name => $elem) { + $name = (string) $name; + if (is_object($elem)) { + $elem = get_object_vars($elem); + $cc = current($elem); + $kk = key($elem); + foreach ($cc as $value) { + $this->issueOtherAttr[$name][] = array( + $kk => (string) $value + ); + } + } else { + $this->issueOtherAttr[$name] = (string) $elem; + } + } + } + + // All attributes that I do not consider mandatory + // are managed through the issueAdditionalAttributes + // + // On Redmine 1 seems to be standard for Issues/Bugs + $this->issueDefaults = array( + 'trackerid' => 1 + ); + foreach ($this->issueDefaults as $prop => $default) { + if (! isset($this->issueAttr[$prop])) { + $this->issueAttr[$prop] = $default; + } + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $url = (string) trim($this->cfg->url); + $user = (string) trim($this->cfg->user); + $apiKey = (string) trim($this->cfg->apikey); + $repo = (string) trim($this->cfg->repo); // TODO: check integer value + $owner = (string) trim($this->cfg->owner); // TODO: check integer value + $pxy = new stdClass(); + $pxy->proxy = config_get('proxy'); + $this->APIClient = new github($url, $user, $apiKey, $owner, $repo, + $pxy); + + // to undestand if connection is OK, I will ask for projects. + // I've tried to ask for users but get always ERROR from github (not able to understand why). + try { + $items = $this->APIClient->getRepo(); + $this->connected = count($items) > 0 ? true : false; + unset($items); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach (array( + 'url', + 'user', + 'apikey', + 'owner', + 'repo' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + public function buildViewBugURL($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + return $this->APIClient->getIssueURL($issueID); + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $jsonObj = $this->APIClient->getIssue((int) $issueID); + + if (! is_null($jsonObj) && is_object($jsonObj)) { + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->id = $jsonObj->number; + $issue->url = $jsonObj->html_url; + $issue->statusCode = (string) $jsonObj->state; + $issue->statusVerbose = (string) $jsonObj->state; + $issue->statusHTMLString = "[$issue->statusVerbose] "; + $issue->summaryHTMLString = (string) $jsonObj->title . ":
    " . + (string) $jsonObj->body; + $issue->summary = (string) $jsonObj->title . ":\n" . + (string) $jsonObj->body; + $notes = $this->APIClient->getNotes((int) $issueID); + if (is_array($notes) && count($notes) > 0) { + foreach ($notes as $key => $note) { + $issue->summaryHTMLString .= "
    [Note $key]:$note->body"; + $issue->summary .= "\n[Note $key]: $note->body"; + } + } + $issue->isResolved = $this->state == 'closed'; + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + public function addIssue($summary, $description, $opt = null) + { + try { + $op = $this->APIClient->addIssue($summary, $description); + if (is_null($op)) { + throw new Exception("Error creating issue", 1); + } + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->number, + 'msg' => sprintf(lang_get('github_bug_created'), $summary, + $this->APIClient->repo) + ); + } catch (Exception $e) { + $msg = "Create github Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + */ + public function addNote($issueID, $noteText, $opt = null) + { + $op = $this->APIClient->addNote($issueID, $noteText); + if (is_null($op)) { + throw new Exception("Error setting note", 1); + } + return array( + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('github_bug_comment'), $op->body, + $this->APIClient->repo) + ); + } + + /** + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "github user\n" . "github TOKEN\n" . + "https://api.github.com\n" . + "GitHub Org or User\n" . + "github REPOSITORY\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return true; + } +} diff --git a/lib/issuetrackerintegration/gitlabrestInterface.class.php b/lib/issuetrackerintegration/gitlabrestInterface.class.php index f3d6556b2d..dd5ea98718 100644 --- a/lib/issuetrackerintegration/gitlabrestInterface.class.php +++ b/lib/issuetrackerintegration/gitlabrestInterface.class.php @@ -1,360 +1,348 @@ - - * - * @internal revisions - * @since 1.9.16 - * -**/ -require_once(TL_ABS_PATH . "/third_party/gitlab-php-api/lib/gitlab-rest-api.php"); -class gitlabrestInterface extends issueTrackerInterface -{ - private $APIClient; - private $issueDefaults; - private $issueOtherAttr = null; // see - private $translate = null; - - var $defaultResolvedStatus; - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - $this->name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 3, 'verbose' => 'resolved'); - $this->defaultResolvedStatus[] = array('code' => 5, 'verbose' => 'closed'); - - if( !$this->setCfg($config) ) - { - return false; - } - - // http://www.gitlab.org/issues/6843 - // "Target version" is the new display name for this property, - // but it's still named fixed_version internally and thus in the API. - // $issueXmlObj->addChild('fixed_version_id', (string)2); - $this->translate['targetversion'] = 'fixed_version_id'; - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - if( property_exists($this->cfg,'attributes') ) - { - $attr = get_object_vars($this->cfg->attributes); - foreach ($attr as $name => $elem) - { - $name = (string)$name; - if( is_object($elem) ) - { - $elem = get_object_vars($elem); - $cc = current($elem); - $kk = key($elem); - foreach($cc as $value) - { - $this->issueOtherAttr[$name][] = array($kk => (string)$value); - } - } - else - { - $this->issueOtherAttr[$name] = (string)$elem; - } - } - } - - // All attributes that I do not consider mandatory - // are managed through the issueAdditionalAttributes - // - // On Redmine 1 seems to be standard for Issues/Bugs - $this->issueDefaults = array('trackerid' => 1); - foreach($this->issueDefaults as $prop => $default) - { - if(!isset($this->issueAttr[$prop])) - { - $this->issueAttr[$prop] = $default; - } - } - - if( property_exists($this->cfg,'custom_fields') ) - { - $cf = $this->cfg->custom_fields; - $this->cfg->custom_fields = (string)$cf->asXML(); - } - } - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - $processCatch = false; - - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $redUrl = (string)trim($this->cfg->uribase); - $redAK = (string)trim($this->cfg->apikey); - $projectId = (string)trim($this->cfg->projectidentifier); //TODO: check integer value - $pxy = new stdClass(); - $pxy->proxy = config_get('proxy'); - $this->APIClient = new gitlab($redUrl,$redAK,$projectId, $pxy); - - // to undestand if connection is OK, I will ask for projects. - // I've tried to ask for users but get always ERROR from gitlab (not able to understand why). - try - { - $items = $this->APIClient->getProjects(); - $this->connected = count($items) > 0 ? true : false; - unset($items); - } - catch(Exception $e) - { - $processCatch = true; - } - } - catch(Exception $e) - { - $processCatch = true; - } - - if($processCatch) - { - $logDetails = ''; - foreach(array('uribase','apikey') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - function buildViewBugURL($issueID) - { - if (!$this->isConnected()) - { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - return $this->APIClient->getIssueURL($issueID); - } - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) - { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try - { - $jsonObj = $this->APIClient->getIssue((int)$issueID); - - if( !is_null($jsonObj) && is_object($jsonObj)) - { - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = (string)$jsonObj->iid; - $issue->statusVerbose = (string)$jsonObj->state; - $issue->statusHTMLString = "[$issue->statusVerbose] "; - $issue->summary = $issue->summaryHTMLString = (string)$jsonObj->title; - $issue->gitlabProject = array('name' => (string)$jsonObj->project_id, - 'id' => (int)$jsonObj->project_id ); - - $issue->isResolved = isset($this->state); - } - } - catch(Exception $e) - { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - public function addIssue($summary,$description,$opt=null) - { - try - { - $op = $this->APIClient->addIssue($summary, $description); - if(is_null($op)){ - throw new Exception("Error creating issue", 1); - } - $ret = array('status_ok' => true, 'id' => (string)$op->iid, - 'msg' => sprintf(lang_get('gitlab_bug_created'), - $summary, $this->APIClient->projectId)); - } - catch (Exception $e) - { - $msg = "Create GITLAB Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - - /** - * - */ - public function addNote($issueID,$noteText,$opt=null) - { - $op = $this->APIClient->addNote($issueID, $noteText); - if(is_null($op)){ - throw new Exception("Error setting note", 1); - } - $ret = array('status_ok' => true, 'id' => (string)$op->iid, - 'msg' => sprintf(lang_get('gitlab_bug_comment'),$op->body, $this->APIClient->projectId)); - return $ret; - } - - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "GITLAB API KEY\n" . - "https://gitlab.mydomain.com\n" . - "GITLAB PROJECT NUMERIC IDENTIFIER\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return true; - } - - + + * + * @internal revisions + * @since 1.9.16 + * + **/ +require_once TL_ABS_PATH . '/third_party/gitlab-php-api/lib/gitlab-rest-api.php'; + +class gitlabrestInterface extends issueTrackerInterface +{ + + private $APIClient; + + private $issueDefaults; + + private $issueOtherAttr = null; + + private $translate = null; + + public $defaultResolvedStatus; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 3, + 'verbose' => 'resolved' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 5, + 'verbose' => 'closed' + ); + + if (! $this->setCfg($config)) { + return false; + } + + // http://www.gitlab.org/issues/6843 + // "Target version" is the new display name for this property, + // but it's still named fixed_version internally and thus in the API. + // $issueXmlObj->addChild('fixed_version_id', (string)2); + $this->translate['targetversion'] = 'fixed_version_id'; + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + if (property_exists($this->cfg, 'attributes')) { + $attr = get_object_vars($this->cfg->attributes); + foreach ($attr as $name => $elem) { + $name = (string) $name; + if (is_object($elem)) { + $elem = get_object_vars($elem); + $cc = current($elem); + $kk = key($elem); + foreach ($cc as $value) { + $this->issueOtherAttr[$name][] = array( + $kk => (string) $value + ); + } + } else { + $this->issueOtherAttr[$name] = (string) $elem; + } + } + } + + // All attributes that I do not consider mandatory + // are managed through the issueAdditionalAttributes + // + // On Redmine 1 seems to be standard for Issues/Bugs + $this->issueDefaults = array( + 'trackerid' => 1 + ); + foreach ($this->issueDefaults as $prop => $default) { + if (! isset($this->issueAttr[$prop])) { + $this->issueAttr[$prop] = $default; + } + } + + if (property_exists($this->cfg, 'custom_fields')) { + $cf = $this->cfg->custom_fields; + $this->cfg->custom_fields = (string) $cf->asXML(); + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $redUrl = (string) trim($this->cfg->uribase); + $redAK = (string) trim($this->cfg->apikey); + $projectId = (string) trim($this->cfg->projectidentifier); // TODO: check integer value + $pxy = new stdClass(); + $pxy->proxy = config_get('proxy'); + $this->APIClient = new gitlab($redUrl, $redAK, $projectId, $pxy); + + // to undestand if connection is OK, I will ask for projects. + // I've tried to ask for users but get always ERROR from gitlab (not able to understand why). + try { + $items = $this->APIClient->getProjects(); + $this->connected = count($items) > 0 ? true : false; + unset($items); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach (array( + 'uribase', + 'apikey' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + public function buildViewBugURL($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + return $this->APIClient->getIssueURL($issueID); + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $jsonObj = $this->APIClient->getIssue((int) $issueID); + + if (! is_null($jsonObj) && is_object($jsonObj)) { + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = (string) $jsonObj->iid; + $issue->statusVerbose = (string) $jsonObj->state; + $issue->statusHTMLString = "[$issue->statusVerbose] "; + $issue->summary = $issue->summaryHTMLString = (string) $jsonObj->title; + $issue->gitlabProject = array( + 'name' => (string) $jsonObj->project_id, + 'id' => (int) $jsonObj->project_id + ); + + $issue->isResolved = isset($this->state); + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + * + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + public function addIssue($summary, $description, $opt = null) + { + try { + $op = $this->APIClient->addIssue($summary, $description); + if (is_null($op)) { + throw new Exception("Error creating issue", 1); + } + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->iid, + 'msg' => sprintf(lang_get('gitlab_bug_created'), $summary, + $this->APIClient->projectId) + ); + } catch (Exception $e) { + $msg = "Create GITLAB Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + */ + public function addNote($issueID, $noteText, $opt = null) + { + $op = $this->APIClient->addNote($issueID, $noteText); + if (is_null($op)) { + throw new Exception("Error setting note", 1); + } + return array( + 'status_ok' => true, + 'id' => (string) $op->iid, + 'msg' => sprintf(lang_get('gitlab_bug_comment'), $op->body, + $this->APIClient->projectId) + ); + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "GITLAB API KEY\n" . + "https://gitlab.mydomain.com\n" . + "GITLAB PROJECT NUMERIC IDENTIFIER\n" . + "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return true; + } } diff --git a/lib/issuetrackerintegration/issueTrackerInterface.class.php b/lib/issuetrackerintegration/issueTrackerInterface.class.php index 2294c779ff..80300c21d2 100644 --- a/lib/issuetrackerintegration/issueTrackerInterface.class.php +++ b/lib/issuetrackerintegration/issueTrackerInterface.class.php @@ -1,624 +1,607 @@ - - array('addSummary' => false, - 'colorByStatus' => false, - 'addReporter' => false, - 'addHandler' => false)); - - var $guiCfg = array(); - var $summaryLengthLimit = 120; // Mantis max is 128. - var $forbidden_chars = '/[!|�%&()\/=?]/'; - - /** - * Construct and connect to BTS. - * Can be overloaded in specialized class - * - * @param str $type (see tlIssueTracker.class.php $systems property) - **/ - function __construct($type,$config,$name) { - - $this->tlCharSet = config_get('charset'); - $this->guiCfg = array('use_decoration' => true); // add [] on summary and statusHTMLString - $this->name = $name; - - if( $this->setCfg($config) ) { - // useful only for integration via DB - if( !property_exists($this->cfg,'dbcharset') ) { - $this->cfg->dbcharset = $this->tlCharSet; - } - $this->connect(); - } - else - { - $this->connected = false; - } - } - - /** - * - **/ - function canCreateViaAPI() - { - return false; - } - - /** - * - **/ - function canAddNoteViaAPI() - { - return false; - } - - - /** - * - **/ - function getCfg() - { - return $this->cfg; - } - - /** - * - * - **/ - function setCfg($xmlString) { - $msg = null; - $signature = 'Source:' . __METHOD__; - - // check for empty string - if(strlen(trim($xmlString)) == 0) { - // Bye,Bye - $msg = " - Issue tracker:$this->name - XML Configuration seems to be empty - please check"; - tLog(__METHOD__ . $msg, 'ERROR'); - return false; - } - - $this->xmlCfg = " " . $xmlString; - libxml_use_internal_errors(true); - try { - $this->cfg = simplexml_load_string($this->xmlCfg); - if (!$this->cfg) { - $msg = $signature . " - Failure loading XML STRING\n"; - foreach(libxml_get_errors() as $error) - { - $msg .= "\t" . $error->message; - } - } - } - catch(Exception $e) - { - $msg = $signature . " - Exception loading XML STRING\n"; - $msg .= 'Message: ' .$e->getMessage(); - } - - if( !($retval = is_null($msg)) ) - { - tLog(__METHOD__ . $msg, 'ERROR'); - } - - // - if( !property_exists($this->cfg,'userinteraction') ) - { - $this->cfg->userinteraction = 0; - } - $this->cfg->userinteraction = intval($this->cfg->userinteraction) > 0 ? 1 : 0; - - // From - // http://php.net/manual/it/function.unserialize.php#112823 - // - // After PHP 5.3 an object made by - // SimpleXML_Load_String() cannot be serialized. - // An attempt to do so will result in a run-time - // failure, throwing an exception. - // - // If you store such an object in $_SESSION, - // you will get a post-execution error that says this: - // Fatal error: Uncaught exception 'Exception' - // with message 'Serialization of 'SimpleXMLElement' - // is not allowed' in [no active file]:0 - // Stack trace: #0 {main} thrown in [no active file] - // on line 0 - // - // !!!!! The entire contents of the session will be lost. - // http://stackoverflow.com/questions/1584725/quickly-convert-simplexmlobject-to-stdclass - $this->cfg = json_decode(json_encode($this->cfg)); - return $retval; - } - - /** - * - **/ - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - /** - * return the maximum length in chars of a issue id - * used on TestLink GUI - * - * @return int the maximum length of a bugID - */ - function getBugIDMaxLength() - { - // CRITIC: - // related to execution_bugs table, you can not make it - // greater WITHOUT changing table structure. - // - return 64; - } - - - /** - * establishes the database connection to the bugtracking system - * - * @return bool returns true if the db connection was established and the - * db could be selected, false else - * - **/ - function connect() - { - if (is_null($this->cfg->dbhost) || is_null($this->cfg->dbuser)) - { - return false; - } - - // cast everything to string in order to avoid issues - // @20140604 someone has been issues trying to connect - // to JIRA on MSSQL - $this->cfg->dbtype = strtolower((string)$this->cfg->dbtype); - $this->cfg->dbhost = (string)$this->cfg->dbhost; - $this->cfg->dbuser = (string)$this->cfg->dbuser; - $this->cfg->dbpassword = (string)$this->cfg->dbpassword; - $this->cfg->dbname = (string)$this->cfg->dbname; - - $this->dbConnection = new database($this->cfg->dbtype); - $result = $this->dbConnection->connect(false, - $this->cfg->dbhost, - $this->cfg->dbuser, - $this->cfg->dbpassword, - $this->cfg->dbname); - - if (!$result['status']) { - $this->dbConnection = null; - $cnn = "(interface: - Host:{$this->cfg->dbhost} - " . - "DBName: {$this->cfg->dbname} - - User: {$this->cfg->dbuser}) "; - $msg = sprintf(lang_get('BTS_connect_to_database_fails'), - $cnn); - tLog($msg . $result['dbms_msg'], 'ERROR'); - } - elseif ($this->cfg->dbtype == 'mysql') { - if ($this->cfg->dbcharset == 'UTF-8') { - $r = $this->dbConnection->exec_query("SET CHARACTER SET utf8"); - $r = $this->dbConnection->exec_query("SET NAMES utf8"); - $r = $this->dbConnection->exec_query("SET collation_connection = 'utf8_general_ci'"); - } - else { - $r = $this->dbConnection->exec_query("SET CHARACTER SET " . $this->cfg->dbcharset); - $r = $this->dbConnection->exec_query("SET NAMES ". $this->cfg->dbcharset); - } - } - - $this->connected = $result['status'] ? true : false; - - return $this->connected; - } - - /** - * State of connection to BTS - * - * @return bool returns true if connection with BTS is established, false else - * - **/ - function isConnected() - { - - return ($this->connected && - ((!$this->interfaceViaDB ) || is_object($this->dbConnection)) ? 1 : 0); - } - - /** - * Closes the db connection (if any) - * - **/ - function disconnect() - { - if ($this->isConnected() && $this->interfaceViaDB) - { - $this->dbConnection->close(); - } - $this->connected = false; - $this->dbConnection = null; - } - - - - /** - * checks a issue id for validity (NUMERIC) - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntaxNumeric($issueID) - { - $valid = true; - $blackList = '/\D/i'; - if (preg_match($blackList, $issueID)) { - $valid = false; - } else { - $valid = (intval($issueID) > 0); - } - return $valid; - } - - /** - * checks id for validity (STRING) - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntaxString($issueID) - { - $status_ok = !(trim($issueID) == ""); - if($status_ok) - { - if (preg_match($this->forbidden_chars, $issueID)) - { - $status_ok = false; - } - } - return $status_ok; - } - - - /** - * default implementation for generating a link to the bugtracking page for viewing - * the bug with the given id in a new page - * - * @param int id the bug id - * - * @return string returns a complete HTML HREF to view the bug (if found in db) - * - **/ - function buildViewBugLink($issueID, $opt=null) { - - static $l10n; - - if( !$l10n ) { - $tg = array('issueReporter' => null, 'issueHandler' => null); - $l10n = init_labels($tg); - } - - $my['opt'] = $this->methodOpt[__FUNCTION__]; - $my['opt'] = array_merge($my['opt'],(array)$opt); - - $link = ""; - $issue = $this->getIssue($issueID); - - $ret = new stdClass(); - $ret->link = ''; - $ret->isResolved = false; - $ret->op = false; - - if( is_null($issue) || !is_object($issue) ) { - $ret->link = "TestLink Internal Message: getIssue($issueID) FAILURE on " . __METHOD__; - return $ret; - } - - $useIconv = property_exists($this->cfg,'dbcharset'); - if($useIconv) { - $link .= iconv((string)$this->cfg->dbcharset,$this->tlCharSet,$issue->IDHTMLString); - } - else { - $link .= $issue->IDHTMLString; - } - - if (!is_null($issue->statusHTMLString)) { - if($useIconv) { - $link .= iconv((string)$this->cfg->dbcharset,$this->tlCharSet,$issue->statusHTMLString); - } else { - $link .= $issue->statusHTMLString; - } - } else { - $link .= $issueID; - } - - if($my['opt']['addSummary']) { - if (!is_null($issue->summaryHTMLString)) { - $link .= " : "; - if($useIconv) { - $link .= iconv((string)$this->cfg->dbcharset,$this->tlCharSet,$issue->summaryHTMLString); - } - else { - $link .= (string)$issue->summaryHTMLString; - } - } - } - - if ($my['opt']['addReporter']) { - if( property_exists($issue, 'reportedBy') ) { - $link .= ""; - $who = trim((string)$issue->reportedBy); - if( '' != $who ) { - - $link .= '
    ' . $l10n['issueReporter'] . ': '; - if($useIconv) { - $link .= - iconv((string)$this->cfg->dbcharset,$this->tlCharSet,$who); - } - else { - $link .= $who; - } - } - } - } - - if($my['opt']['addHandler']) { - if( property_exists($issue, 'handledBy') ) { - $link .= ""; - $who = trim((string)$issue->handledBy); - if( '' != $who ) { - - $link .= '
    ' . $l10n['issueHandler'] . ': '; - if($useIconv) { - $link .= - iconv((string)$this->cfg->dbcharset,$this->tlCharSet,$who); - } - else { - $link .= $who; - } - } - } - } - - $link .= "
    "; - - if ($my['opt']['colorByStatus'] - && property_exists($issue,'statusColor') ) { - $title = lang_get('access_to_bts'); - $link = "
    statusColor;\">$link
    "; - } - - $ret = new stdClass(); - $ret->link = $link; - $ret->isResolved = $issue->isResolved; - $ret->op = true; - - if (isset($my['opt']['raw']) - && !is_null(isset($my['opt']['raw'])) ) { - foreach ($my['opt']['raw'] as $attr) { - if (property_exists($issue, $attr)) { - $ret->$attr = $issue->$attr; - } - } - } - return $ret; - } - - /** - * returns the URL which should be displayed for entering bugs - * - * @return string returns a complete URL - * - **/ - function getEnterBugURL() { - return $this->cfg->uricreate; - } - - - /** - * Returns URL to the bugtracking page for viewing ticket - * - * @param mixed issueID - * depending of BTS issueID can be a number (e.g. Mantis) - * or a string (e.g. JIRA) - * - * @return string - **/ - function buildViewBugURL($issueID) { - return $this->cfg->uriview . urlencode($issueID); - } - - - /** - * status code (always integer??) for issueID - * - * @param issueID according to BTS can be number or string - * - * @return - **/ - public function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue))? $issue->statusCode : false; - } - - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param issueID according to BTS can be number or string - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue))? $issue->statusVerbose : false; - } - - - - /** - * - * @param issueID according to BTS can be number or string - * - * @return string returns the bug summary if bug is found, else null - **/ - function getIssueSummary($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue))? $issue->summary : null; - } - - - // How to Force Extending class to define this STATIC method ? - // KO abstract public static function getCfgTemplate(); - public static function getCfgTemplate() - { - throw new RuntimeException("Unimplemented - YOU must implement it in YOUR interface Class"); - } - - /** - * - **/ - public static function checkEnv() - { - $ret = array(); - $ret['status'] = true; - $ret['msg'] = 'OK'; - return $ret; - } - - - /** - * - **/ - public function setResolvedStatusCfg() - { - if (property_exists($this->cfg,'resolvedstatus')) { - $statusCfg = (array)$this->cfg->resolvedstatus; - } else { - $statusCfg['status'] = $this->defaultResolvedStatus; - } - $this->resolvedStatus = new stdClass(); - $this->resolvedStatus->byCode = []; - $this->resolvedStatus->byName = []; - - foreach ($statusCfg['status'] as $cfx) { - $e = (array)$cfx; - $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; - } - $this->resolvedStatus->byName = array_flip($this->resolvedStatus->byCode); - } - - /** - * - **/ - public function getResolvedStatusCfg() - { - return $this->resolvedStatus; - } - - /** - * Returns the status of the bug with the given id - * this function is not directly called by TestLink. - * - * @return string returns the status of the given bug (if found in the db), or false else - **/ - function getBugStatus($id) - { - if (!$this->isConnected()) - { - return false; - } - $issue = $this->getIssue($id); - return (!is_null($issue) && $issue) ? $issue->statusVerbose : null; - } - - /** - * @param issueID (can be number of string according to specific BTS) - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = !is_null($issue) && is_object($issue); - } - return $status_ok; - } - - /** - * - **/ - function buildStatusHTMLString($statusCode) - { - $str = $statusCode; - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - return $str; - } - - /** - * return the maximum length in chars of a issue summary - * used on TestLink GUI - * - * @return int - */ - function getBugSummaryMaxLength() { - return $this->summaryLengthLimit; - } - - /** - * - **/ - function normalizeBugID($issueID) - { - return $issueID; - } - -} \ No newline at end of file + array( + 'addSummary' => false, + 'colorByStatus' => false, + 'addReporter' => false, + 'addHandler' => false + ) + ); + + private $guiCfg = array(); + + private $summaryLengthLimit = 120; + + // Mantis max is 128. + private $forbidden_chars = '/[!|�%&()\/=?]/'; + + /** + * Construct and connect to BTS. + * Can be overloaded in specialized class + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + */ + public function __construct($type, $config, $name) + { + $this->tlCharSet = config_get('charset'); + $this->guiCfg = array( + 'use_decoration' => true + ); // add [] on summary and statusHTMLString + $this->name = $name; + + if ($this->setCfg($config)) { + // useful only for integration via DB + if (! property_exists($this->cfg, 'dbcharset')) { + $this->cfg->dbcharset = $this->tlCharSet; + } + $this->connect(); + } else { + $this->connected = false; + } + } + + /** + */ + public function canCreateViaAPI() + { + return false; + } + + /** + */ + public function canAddNoteViaAPI() + { + return false; + } + + /** + */ + public function getCfg() + { + return $this->cfg; + } + + /** + */ + public function setCfg($xmlString) + { + $msg = null; + $signature = 'Source:' . __METHOD__; + + // check for empty string + if (strlen(trim($xmlString)) == 0) { + // Bye,Bye + $msg = " - Issue tracker:$this->name - XML Configuration seems to be empty - please check"; + tLog(__METHOD__ . $msg, 'ERROR'); + return false; + } + + $this->xmlCfg = " " . $xmlString; + libxml_use_internal_errors(true); + try { + $this->cfg = simplexml_load_string($this->xmlCfg); + if (! $this->cfg) { + $msg = $signature . " - Failure loading XML STRING\n"; + foreach (libxml_get_errors() as $error) { + $msg .= "\t" . $error->message; + } + } + } catch (Exception $e) { + $msg = $signature . " - Exception loading XML STRING\n"; + $msg .= 'Message: ' . $e->getMessage(); + } + + if (! ($retval = is_null($msg))) { + tLog(__METHOD__ . $msg, 'ERROR'); + } + + // + if (! property_exists($this->cfg, 'userinteraction')) { + $this->cfg->userinteraction = 0; + } + $this->cfg->userinteraction = intval($this->cfg->userinteraction) > 0 ? 1 : 0; + + // From + // http://php.net/manual/it/function.unserialize.php#112823 + // + // After PHP 5.3 an object made by + // SimpleXML_Load_String() cannot be serialized. + // An attempt to do so will result in a run-time + // failure, throwing an exception. + // + // If you store such an object in $_SESSION, + // you will get a post-execution error that says this: + // Fatal error: Uncaught exception 'Exception' + // with message 'Serialization of 'SimpleXMLElement' + // is not allowed' in [no active file]:0 + // Stack trace: #0 {main} thrown in [no active file] + // on line 0 + // + // !!!!! The entire contents of the session will be lost. + // http://stackoverflow.com/questions/1584725/quickly-convert-simplexmlobject-to-stdclass + $this->cfg = json_decode(json_encode($this->cfg)); + return $retval; + } + + /** + */ + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + /** + * return the maximum length in chars of a issue id + * used on TestLink GUI + * + * @return int the maximum length of a bugID + */ + public function getBugIDMaxLength() + { + // CRITIC: + // related to execution_bugs table, you can not make it + // greater WITHOUT changing table structure. + // + return 64; + } + + /** + * establishes the database connection to the bugtracking system + * + * @return bool returns true if the db connection was established and the + * db could be selected, false else + * + */ + public function connect() + { + if (is_null($this->cfg->dbhost) || is_null($this->cfg->dbuser)) { + return false; + } + + // cast everything to string in order to avoid issues + // @20140604 someone has been issues trying to connect + // to JIRA on MSSQL + $this->cfg->dbtype = strtolower((string) $this->cfg->dbtype); + $this->cfg->dbhost = (string) $this->cfg->dbhost; + $this->cfg->dbuser = (string) $this->cfg->dbuser; + $this->cfg->dbpassword = (string) $this->cfg->dbpassword; + $this->cfg->dbname = (string) $this->cfg->dbname; + + $this->dbConnection = new database($this->cfg->dbtype); + $result = $this->dbConnection->connect(false, $this->cfg->dbhost, + $this->cfg->dbuser, $this->cfg->dbpassword, $this->cfg->dbname); + + if (! $result['status']) { + $this->dbConnection = null; + $cnn = "(interface: - Host:{$this->cfg->dbhost} - " . + "DBName: {$this->cfg->dbname} + - User: {$this->cfg->dbuser}) "; + $msg = sprintf(lang_get('BTS_connect_to_database_fails'), $cnn); + tLog($msg . $result['dbms_msg'], 'ERROR'); + } elseif ($this->cfg->dbtype == 'mysql') { + if ($this->cfg->dbcharset == 'UTF-8') { + $this->dbConnection->exec_query("SET CHARACTER SET utf8"); + $this->dbConnection->exec_query("SET NAMES utf8"); + $this->dbConnection->exec_query( + "SET collation_connection = 'utf8_general_ci'"); + } else { + $this->dbConnection->exec_query( + "SET CHARACTER SET " . $this->cfg->dbcharset); + $this->dbConnection->exec_query( + "SET NAMES " . $this->cfg->dbcharset); + } + } + + $this->connected = $result['status'] ? true : false; + + return $this->connected; + } + + /** + * State of connection to BTS + * + * @return bool returns true if connection with BTS is established, false else + * + */ + public function isConnected() + { + return $this->connected && + ((! $this->interfaceViaDB) || is_object($this->dbConnection)) ? 1 : 0; + } + + /** + * Closes the db connection (if any) + */ + public function disconnect() + { + if ($this->isConnected() && $this->interfaceViaDB) { + $this->dbConnection->close(); + } + $this->connected = false; + $this->dbConnection = null; + } + + /** + * checks a issue id for validity (NUMERIC) + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntaxNumeric($issueID) + { + $valid = true; + $blackList = '/\D/i'; + if (preg_match($blackList, $issueID)) { + $valid = false; + } else { + $valid = (intval($issueID) > 0); + } + return $valid; + } + + /** + * checks id for validity (STRING) + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntaxString($issueID) + { + $status_ok = (trim($issueID) != ""); + if ($status_ok && preg_match($this->forbidden_chars, $issueID)) { + $status_ok = false; + } + return $status_ok; + } + + /** + * default implementation for generating a link to the bugtracking page for viewing + * the bug with the given id in a new page + * + * @param + * int id the bug id + * + * @return string returns a complete HTML HREF to view the bug (if found in db) + * + */ + public function buildViewBugLink($issueID, $opt = null) + { + static $l10n; + + if (! $l10n) { + $tg = array( + 'issueReporter' => null, + 'issueHandler' => null + ); + $l10n = init_labels($tg); + } + + $my['opt'] = $this->methodOpt[__FUNCTION__]; + $my['opt'] = array_merge($my['opt'], (array) $opt); + + $link = ""; + $issue = $this->getIssue($issueID); + + $ret = new stdClass(); + $ret->link = ''; + $ret->isResolved = false; + $ret->op = false; + + if (is_null($issue) || ! is_object($issue)) { + $ret->link = "TestLink Internal Message: getIssue($issueID) FAILURE on " . + __METHOD__; + return $ret; + } + + $useIconv = property_exists($this->cfg, 'dbcharset'); + if ($useIconv) { + $link .= iconv((string) $this->cfg->dbcharset, $this->tlCharSet, + $issue->IDHTMLString); + } else { + $link .= $issue->IDHTMLString; + } + + if (! is_null($issue->statusHTMLString)) { + if ($useIconv) { + $link .= iconv((string) $this->cfg->dbcharset, $this->tlCharSet, + $issue->statusHTMLString); + } else { + $link .= $issue->statusHTMLString; + } + } else { + $link .= $issueID; + } + + if ($my['opt']['addSummary'] && ! is_null($issue->summaryHTMLString)) { + $link .= " : "; + if ($useIconv) { + $link .= iconv((string) $this->cfg->dbcharset, $this->tlCharSet, + $issue->summaryHTMLString); + } else { + $link .= (string) $issue->summaryHTMLString; + } + } + + if ($my['opt']['addReporter'] && property_exists($issue, 'reportedBy')) { + $link .= ""; + $who = trim((string) $issue->reportedBy); + if ('' != $who) { + + $link .= '
    ' . $l10n['issueReporter'] . ': '; + if ($useIconv) { + $link .= iconv((string) $this->cfg->dbcharset, + $this->tlCharSet, $who); + } else { + $link .= $who; + } + } + } + + if ($my['opt']['addHandler'] && property_exists($issue, 'handledBy')) { + $link .= ""; + $who = trim((string) $issue->handledBy); + if ('' != $who) { + + $link .= '
    ' . $l10n['issueHandler'] . ': '; + if ($useIconv) { + $link .= iconv((string) $this->cfg->dbcharset, + $this->tlCharSet, $who); + } else { + $link .= $who; + } + } + } + + $link .= "
    "; + + if ($my['opt']['colorByStatus'] && property_exists($issue, 'statusColor')) { + $title = lang_get('access_to_bts'); + $link = "
    statusColor;\">$link
    "; + } + + $ret = new stdClass(); + $ret->link = $link; + $ret->isResolved = $issue->isResolved; + $ret->op = true; + + if (isset($my['opt']['raw']) && ! is_null(isset($my['opt']['raw']))) { + foreach ($my['opt']['raw'] as $attr) { + if (property_exists($issue, $attr)) { + $ret->$attr = $issue->$attr; + } + } + } + return $ret; + } + + /** + * returns the URL which should be displayed for entering bugs + * + * @return string returns a complete URL + * + */ + public function getEnterBugURL() + { + return $this->cfg->uricreate; + } + + /** + * Returns URL to the bugtracking page for viewing ticket + * + * @param + * mixed issueID + * depending of BTS issueID can be a number (e.g. Mantis) + * or a string (e.g. JIRA) + * + * @return string + */ + public function buildViewBugURL($issueID) + { + return $this->cfg->uriview . urlencode($issueID); + } + + /** + * status code (always integer??) for issueID + * + * @param + * issueID according to BTS can be number or string + * + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * issueID according to BTS can be number or string + * + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->statusVerbose : false; + } + + /** + * + * @param + * issueID according to BTS can be number or string + * + * @return string returns the bug summary if bug is found, else null + */ + public function getIssueSummary($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->summary : null; + } + + // How to Force Extending class to define this STATIC method ? + // KO abstract public static function getCfgTemplate(); + public static function getCfgTemplate() + { + throw new RuntimeException( + "Unimplemented - YOU must implement it in YOUR interface Class"); + } + + /** + */ + public static function checkEnv() + { + $ret = array(); + $ret['status'] = true; + $ret['msg'] = 'OK'; + return $ret; + } + + /** + */ + public function setResolvedStatusCfg() + { + if (property_exists($this->cfg, 'resolvedstatus')) { + $statusCfg = (array) $this->cfg->resolvedstatus; + } else { + $statusCfg['status'] = $this->defaultResolvedStatus; + } + $this->resolvedStatus = new stdClass(); + $this->resolvedStatus->byCode = []; + $this->resolvedStatus->byName = []; + + foreach ($statusCfg['status'] as $cfx) { + $e = (array) $cfx; + $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; + } + $this->resolvedStatus->byName = array_flip( + $this->resolvedStatus->byCode); + } + + /** + */ + public function getResolvedStatusCfg() + { + return $this->resolvedStatus; + } + + /** + * Returns the status of the bug with the given id + * this function is not directly called by TestLink. + * + * @return string returns the status of the given bug (if found in the db), or false else + */ + public function getBugStatus($id) + { + if (! $this->isConnected()) { + return false; + } + $issue = $this->getIssue($id); + return (! is_null($issue) && $issue) ? $issue->statusVerbose : null; + } + + /** + * + * @param + * issueID (can be number of string according to specific BTS) + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = ! is_null($issue) && is_object($issue); + } + return $status_ok; + } + + /** + */ + public function buildStatusHTMLString($statusCode) + { + $str = $statusCode; + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + return $str; + } + + /** + * return the maximum length in chars of a issue summary + * used on TestLink GUI + * + * @return int + */ + public function getBugSummaryMaxLength() + { + return $this->summaryLengthLimit; + } + + /** + */ + public function normalizeBugID($issueID) + { + return $issueID; + } +} diff --git a/lib/issuetrackerintegration/jiraCommons.class.php b/lib/issuetrackerintegration/jiraCommons.class.php index 95f43ae0fe..b07b690497 100644 --- a/lib/issuetrackerintegration/jiraCommons.class.php +++ b/lib/issuetrackerintegration/jiraCommons.class.php @@ -1,97 +1,101 @@ - 'its_duedate_with_separator'); - - var $defaultResolvedStatus; - var $guiCfg; - - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = !is_null($issue) && is_object($issue); - } - return $status_ok; - } - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - private function helperParseDate($date2parse) - { - $ret = null; - if (!is_null($date2parse)) - { - $ret = date_parse($date2parse); - $ret = ((gmmktime(0, 0, 0, $ret['month'], $ret['day'], $ret['year']))); - $ret = $this->l18n['duedate'] . @gmstrftime("%d %b %Y",($ret)); - } - return $ret ; - } - - /** - * - **/ - function buildStatusHTMLString($statusCode) - { - $str = $statusCode; - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - return $str; - } - - /** - * - **/ - function buildSummaryHTMLString($issue) - { - $summary = $issue->summary; - if(property_exists($issue, 'duedate')) - { - $strDueDate = $this->helperParseDate($issue->duedate); - if( !is_null($strDueDate) ) - { - $summary .= " [$strDueDate] "; - } - } - return $summary; - } - - /** - * - **/ - function initDefaultResolvedStatus($statusDomain) - { - $domain = array(); - $itemSet = array('Resolved','Closed'); // Unfortunately case is important - foreach($itemSet as $st) - { - $domain[] = array('code' => $statusDomain[$st], 'verbose' => $st); - } - return $domain; - } -} \ No newline at end of file + 'its_duedate_with_separator' + ); + + public $defaultResolvedStatus; + + public $guiCfg; + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = ! is_null($issue) && is_object($issue); + } + return $status_ok; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + private function helperParseDate($date2parse) + { + $ret = null; + if (! is_null($date2parse)) { + $ret = date_parse($date2parse); + $ret = (gmmktime(0, 0, 0, $ret['month'], $ret['day'], $ret['year'])); + $ret = $this->l18n['duedate'] . @gmstrftime("%d %b %Y", ($ret)); + } + return $ret; + } + + /** + */ + public function buildStatusHTMLString($statusCode) + { + $str = $statusCode; + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + return $str; + } + + /** + */ + public function buildSummaryHTMLString($issue) + { + $summary = $issue->summary; + if (property_exists($issue, 'duedate')) { + $strDueDate = $this->helperParseDate($issue->duedate); + if (! is_null($strDueDate)) { + $summary .= " [$strDueDate] "; + } + } + return $summary; + } + + /** + */ + public function initDefaultResolvedStatus($statusDomain) + { + $domain = array(); + $itemSet = array( + 'Resolved', + 'Closed' + ); // Unfortunately case is important + foreach ($itemSet as $st) { + $domain[] = array( + 'code' => $statusDomain[$st], + 'verbose' => $st + ); + } + return $domain; + } +} diff --git a/lib/issuetrackerintegration/jiradbInterface.class.php b/lib/issuetrackerintegration/jiradbInterface.class.php index 6a645c4ac7..eef5ccd740 100644 --- a/lib/issuetrackerintegration/jiradbInterface.class.php +++ b/lib/issuetrackerintegration/jiradbInterface.class.php @@ -1,246 +1,222 @@ -isConnected() ) - { - return false; - } - - - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => true); - $this->interfaceViaDB = true; - - $this->support = new jiraCommons(); - $this->support->guiCfg = array('use_decoration' => true); - - // Tables used - $this->dbSchema = new stdClass(); - $this->dbSchema->issues = 'jiraissue'; - $this->dbSchema->status = 'issuestatus'; - $this->dbSchema->project = 'project'; - - - $this->getStatuses(); - if( property_exists($this->cfg, 'statuscfg') ) - { - $this->setStatusCfg(); - } - - if( !property_exists($this->cfg, 'jiraversion') ) - { - // throw new Exception("jiraversion is MANDATORY - Unable to continue"); - $msg = " - Issuetracker $this->name - jiraversion is MANDATORY - Unable to continue"; - tLog(__METHOD__ . $msg, 'ERROR'); - return false; - } - else - { - $this->completeCfg(); - } - - - $this->defaultResolvedStatus = $this->support->initDefaultResolvedStatus($this->statusDomain); - $this->setResolvedStatusCfg(); - - } - - /** - * - */ - function completeCfg() - { - // when working with simpleXML objects is better to use intermediate variables - $sz = (string)$this->cfg->jiraversion; - $pieces = explode('.',$sz); - $this->cfg->majorVersionNumber = (int)$pieces[0]; - - if($this->cfg->majorVersionNumber <= 0) - { - throw new Exception("Version has to be MAJOR.MINOR" . ' - got : ' . $sz , 1); - } - } - - - - /** - * - **/ - function getIssue($issueID) - { - - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if (!$this->isConnected()) - { - return false; - } - - // ATTENTION: - // Field names on Jira tables seems to be sometimes on CAPITALS - // TICKET 6028: Integration with Jira 6.1 broken. - Due to JIRA schema changes - \Kint::dump($this->dbConnection); - if(intval($this->cfg->majorVersionNumber) >= 6) - { - $dummy = explode("-",$issueID); - $addFields = ",ISSUES.project, ISSUES.issuenum, PROJECT.originalkey, PROJECT.id "; - $addJoin = " JOIN {$this->dbSchema->project} PROJECT ON ISSUES.project = PROJECT.id "; - $where = " WHERE ISSUES.issuenum='{$this->dbConnection->prepare_string($dummy[1])}' " . - " AND PROJECT.originalkey='{$this->dbConnection->prepare_string($dummy[0])}'"; - } - else - { - $addFields = ",ISSUES.pkey "; - $addJoin = ''; - $where = " WHERE ISSUES.pkey='{$this->dbConnection->prepare_string($issueID)}'"; - } - - $sql = "/* $debugMsg */ " . - " SELECT ISSUES.ID AS id, ISSUES.summary,ISSUES.issuestatus AS status_code, " . - " ST.pname AS status_verbose " . $addFields . - " FROM {$this->dbSchema->issues} ISSUES " . - " JOIN {$this->dbSchema->status} ST ON ST.ID = ISSUES.issuestatus " . - $addJoin . $where; - - try - { - $rs = $this->dbConnection->fetchRowsIntoMap($sql,'id'); - } - catch (Exception $e) - { - $rs = null; - $msg = "JIRA DB - Ticket ID $issueID - " . $e->getMessage(); - tLog($msg, 'WARNING'); - } - - $issue = null; - if( !is_null($rs) ) - { - $issueOnDB = current($rs); - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - - $issue->summary = $issueOnDB['summary']; - $issue->statusCode = $issueOnDB['status_code']; - $issue->statusVerbose = $issueOnDB['status_verbose']; - - $issue->statusHTMLString = $this->support->buildStatusHTMLString($issue->statusVerbose); - $issue->summaryHTMLString = $this->support->buildSummaryHTMLString($issue); - - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - } - return $issue; - } - - /** - * - */ - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - /** - * - */ - function getStatuses() - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if (!$this->isConnected()) - { - return false; - } - - // ATTENTION: - // Field names on Jira tables seems to be sometimes on CAPITALS - $sql = "/* $debugMsg */ " . - " SELECT ST.ID AS id,ST.pname AS name FROM {$this->dbSchema->status} ST"; - try - { - $rs = $this->dbConnection->fetchRowsIntoMap($sql,'id'); - foreach ($rs as $id => $elem) - { - $this->statusDomain[$elem['name']]=$id; - } - } - catch (Exception $e) - { - tLog("JIRA DB " . __METHOD__ . $e->getMessage(), 'WARNING'); - } - } - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public function getStatusDomain() - { - return $this->statusDomain; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxString($issueID); - } - - - public static function getCfgTemplate() - { - - $template = "\n" . - "\n" . - "MANDATORY\n" . - "DATABASE SERVER NAME\n" . - "DATABASE NAME\n" . - "mysql\n" . - "USER\n" . - "PASSWORD\n" . - "http://localhost:8080/development/mantisbt-1.2.5/view.php?id=\n" . - "http://localhost:8080/development/mantisbt-1.2.5/\n" . - "\n" . - "\n" . - "80resolved\n" . - "90closed\n" . - "\n" . - "\n"; - return $template; - } - - /** - * - **/ - function canCreateViaAPI() - { - return false; - } +isConnected()) { + return false; + } + + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => true + ); + $this->interfaceViaDB = true; + + $this->support = new jiraCommons(); + $this->support->guiCfg = array( + 'use_decoration' => true + ); + + // Tables used + $this->dbSchema = new stdClass(); + $this->dbSchema->issues = 'jiraissue'; + $this->dbSchema->status = 'issuestatus'; + $this->dbSchema->project = 'project'; + + $this->getStatuses(); + if (property_exists($this->cfg, 'statuscfg')) { + $this->setStatusCfg(); + } + + if (! property_exists($this->cfg, 'jiraversion')) { + $msg = " - Issuetracker $this->name - jiraversion is MANDATORY - Unable to continue"; + tLog(__METHOD__ . $msg, 'ERROR'); + return false; + } else { + $this->completeCfg(); + } + + $this->defaultResolvedStatus = $this->support->initDefaultResolvedStatus( + $this->statusDomain); + $this->setResolvedStatusCfg(); + } + + /** + */ + private function completeCfg() + { + // when working with simpleXML objects is better to use intermediate variables + $sz = (string) $this->cfg->jiraversion; + $pieces = explode('.', $sz); + $this->cfg->majorVersionNumber = (int) $pieces[0]; + + if ($this->cfg->majorVersionNumber <= 0) { + throw new Exception( + "Version has to be MAJOR.MINOR" . ' - got : ' . $sz, 1); + } + } + + /** + */ + public function getIssue($issueID) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (! $this->isConnected()) { + return false; + } + + // ATTENTION: + // Field names on Jira tables seems to be sometimes on CAPITALS + // TICKET 6028: Integration with Jira 6.1 broken. - Due to JIRA schema changes + \Kint::dump($this->dbConnection); + if (intval($this->cfg->majorVersionNumber) >= 6) { + $dummy = explode("-", $issueID); + $addFields = ",ISSUES.project, ISSUES.issuenum, PROJECT.originalkey, PROJECT.id "; + $addJoin = " JOIN {$this->dbSchema->project} PROJECT ON ISSUES.project = PROJECT.id "; + $where = " WHERE ISSUES.issuenum='{$this->dbConnection->prepare_string($dummy[1])}' " . + " AND PROJECT.originalkey='{$this->dbConnection->prepare_string($dummy[0])}'"; + } else { + $addFields = ",ISSUES.pkey "; + $addJoin = ''; + $where = " WHERE ISSUES.pkey='{$this->dbConnection->prepare_string($issueID)}'"; + } + + $sql = "/* $debugMsg */ " . + " SELECT ISSUES.ID AS id, ISSUES.summary,ISSUES.issuestatus AS status_code, " . + " ST.pname AS status_verbose " . $addFields . + " FROM {$this->dbSchema->issues} ISSUES " . + " JOIN {$this->dbSchema->status} ST ON ST.ID = ISSUES.issuestatus " . + $addJoin . $where; + + try { + $rs = $this->dbConnection->fetchRowsIntoMap($sql, 'id'); + } catch (Exception $e) { + $rs = null; + $msg = "JIRA DB - Ticket ID $issueID - " . $e->getMessage(); + tLog($msg, 'WARNING'); + } + + $issue = null; + if (! is_null($rs)) { + $issueOnDB = current($rs); + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + + $issue->summary = $issueOnDB['summary']; + $issue->statusCode = $issueOnDB['status_code']; + $issue->statusVerbose = $issueOnDB['status_verbose']; + + $issue->statusHTMLString = $this->support->buildStatusHTMLString( + $issue->statusVerbose); + $issue->summaryHTMLString = $this->support->buildSummaryHTMLString( + $issue); + + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + } + return $issue; + } + + /** + */ + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + /** + */ + public function getStatuses() + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (! $this->isConnected()) { + return false; + } + + // ATTENTION: + // Field names on Jira tables seems to be sometimes on CAPITALS + $sql = "/* $debugMsg */ " . + " SELECT ST.ID AS id,ST.pname AS name FROM {$this->dbSchema->status} ST"; + try { + $rs = $this->dbConnection->fetchRowsIntoMap($sql, 'id'); + foreach ($rs as $id => $elem) { + $this->statusDomain[$elem['name']] = $id; + } + } catch (Exception $e) { + tLog("JIRA DB " . __METHOD__ . $e->getMessage(), 'WARNING'); + } + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public function getStatusDomain() + { + return $this->statusDomain; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxString($issueID); + } + + public static function getCfgTemplate() + { + return "\n" . "\n" . + "MANDATORY\n" . + "DATABASE SERVER NAME\n" . + "DATABASE NAME\n" . "mysql\n" . + "USER\n" . "PASSWORD\n" . + "http://localhost:8080/development/mantisbt-1.2.5/view.php?id=\n" . + "http://localhost:8080/development/mantisbt-1.2.5/\n" . + "\n" . + "\n" . + "80resolved\n" . + "90closed\n" . + "\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return false; + } } diff --git a/lib/issuetrackerintegration/jirarestInterface.class.php b/lib/issuetrackerintegration/jirarestInterface.class.php index 4b688260ca..7e61d1e948 100644 --- a/lib/issuetrackerintegration/jirarestInterface.class.php +++ b/lib/issuetrackerintegration/jirarestInterface.class.php @@ -1,928 +1,840 @@ -name = $name; - $this->interfaceViaDB = false; - $this->support = new jiraCommons(); - $this->support->guiCfg = array('use_decoration' => true); - - // This is the right way to overwrite ONLY - // the keys we want, and preserve the default - // configuration present in the issueTrackerInterface class - $this->methodOpt['buildViewBugLink'] = - array_merge($this->methodOpt['buildViewBugLink'], - array('addSummary' => true, - 'colorByStatus' => false) - ); - - if ($this->setCfg($config) && $this->checkCfg()) { - $this->completeCfg(); - $this->connect(); - $this->guiCfg = array('use_decoration' => true); - - if( $this->isConnected()) - { - $this->setResolvedStatusCfg(); - } - } - } - - /** - * - */ - function getIssueAttr() - { - return $this->issueAttr; - } - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - - if( !property_exists($this->cfg,'uriapi') ) - { - $this->cfg->uriapi = $base . 'rest/api/latest/'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'browse/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . ''; - } - - if( property_exists($this->cfg,'attributes') ) - { - // echo __FUNCTION__ . "::Debug::Step#$step Going To Add attributes
    ";$step++; - $this->processAttributes(); - } - - if( !property_exists($this->cfg,'userinteraction') ) { - $this->cfg->userinteraction = 0; - } - - if( !property_exists($this->cfg,'createissueviaapi') ) { - $this->cfg->createissueviaapi = 0; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxString($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - try { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $this->jiraCfg = array('username' => (string)trim($this->cfg->username), - 'password' => (string)trim($this->cfg->password), - 'host' => (string)trim($this->cfg->uriapi)); - - $this->jiraCfg['proxy'] = config_get('proxy'); - if( !is_null($this->jiraCfg['proxy']) ) { - if( is_null($this->jiraCfg['proxy']->host) ) { - $this->jiraCfg['proxy'] = null; - } - } - - $this->APIClient = new JiraApi\Jira($this->jiraCfg); - - $this->connected = $this->APIClient->testLogin(); - if($this->connected && ($this->cfg->projectkey != self::NOPROJECTKEY)) { - // Now check if can get info about the project, to understand - // if at least it exists. - $pk = trim((string)$this->cfg->projectkey); - $this->APIClient->getProject($pk); - - $statusSet = $this->APIClient->getStatuses(); - foreach ($statusSet as $statusID => $statusName) { - $this->statusDomain[$statusName] = $statusID; - } - - $this->defaultResolvedStatus = - $this->support->initDefaultResolvedStatus($this->statusDomain); - } - } catch(Exception $e) { - $this->connected = false; - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try { - $issue = $this->APIClient->getIssue($issueID); - - // IMPORTANT NOTICE - // $issue->id do not contains ISSUE ID as displayed on GUI, but what seems to be an internal value. - // $issue->key has what we want. - // Very strange is how have this worked till today ?? (2015-01-24) - if (!is_null($issue) && is_object($issue) && !property_exists($issue,'errorMessages')) { - - // We are going to have a set of standard properties - $issue->id = $issue->key; - $issue->summary = $issue->fields->summary; - $issue->statusCode = $issue->fields->status->id; - $issue->statusVerbose = $issue->fields->status->name; - - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusHTMLString = $this->support->buildStatusHTMLString($issue->statusVerbose); - $issue->summaryHTMLString = $this->support->buildSummaryHTMLString($issue); - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - - /* - for debug porpouses - $tlIssue = new stdClass(); - $tlIssue->IDHTMLString = $issue->IDHTMLString; - $tlIssue->statusCode = $issue->statusCode; - $tlIssue->statusVerbose = $issue->statusVerbose; - $tlIssue->statusHTMLString = $issue->statusHTMLString; - $tlIssue->summaryHTMLString = $issue->summaryHTMLString; - $tlIssue->isResolved = $issue->isResolved; - - var_dump($tlIssue); - */ - } else { - $issue = null; - } - } catch(Exception $e) { - tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - -/* -{ - "fields": { - "project": - { - "key": "TEST" - }, - "summary": "REST ye merry gentlemen.", - "description": "Creating of an issue using project keys and issue type names using the REST API", - "issuetype": { - "name": "Bug" - } - "priority": { - "id": 4 - } - - } -} -*/ - - /** - * - * - * JSON example: - * - * { - * "fields": { - * "project": { - * "key": "TEST" - * }, - * "summary": "REST ye merry gentlemen.", - * "description": "Creating of an issue using project keys and issue type names using the REST API", - * "issuetype": { - * "name": "Bug" - * } - * } - * } - * - * - */ - public function addIssue($summary,$description,$opt=null) - { - try { - $issue = array('fields' => - array('project' => - array('key' => (string)$this->cfg->projectkey), - 'summary' => $summary, - 'description' => $description, - 'issuetype' => 1 /*Bug*/)); - - if ( property_exists($this->cfg,'issuetype') ) { - $issue['fields']['issuetype'] = array('id' => - (int)$this->cfg->issuetype); - } - - $prio = null; - if(property_exists($this->cfg, 'issuepriority')) { - $prio = $this->cfg->issuepriority; - } - if( !is_null($opt) && property_exists($opt, 'issuePriority') ) { - $prio = $opt->issuePriority; - } - if( !is_null($prio) ) { - // CRITIC: if not casted to string, you will get following error from JIRA - // "Could not find valid 'id' or 'name' in priority object." - $issue['fields']['priority'] = array('id' => (string)$prio); - } - - - if(!is_null($this->issueAttr)) { - $issue['fields'] = array_merge($issue['fields'],$this->issueAttr); - } - - if(!is_null($opt)) { - // these can have multiple values - if(property_exists($opt, 'artifactComponent')) { - // YES is plural!! - $issue['fields']['components'] = array(); - foreach( $opt->artifactComponent as $vv) { - $issue['fields']['components'][] = array('id' => (string)$vv); - } - } - - if (property_exists($opt, 'artifactVersion')) { - // YES is plural!! - $issue['fields']['versions'] = array(); - foreach ( $opt->artifactVersion as $vv) { - $issue['fields']['versions'][] = array('id' => (string)$vv); - } - } - - - if (property_exists($opt, 'reporter')) { - - // After Atlassian GDRP Changes - // $issue['fields']['reporter'] = - // array('name' => (string)$opt->reporter); - $issue['fields']['reporter'] = - array('id' => (string)$opt->reporter); - } - - if (property_exists($opt, 'issueType')) { - $issue['fields']['issuetype'] = array('id' => $opt->issueType); - } - - // @20200531 - Will revert because it's not clear what is the intent - // - // @20200531 - documentation is needed - // accepted Pull Request #231 - /* - $matches = preg_grep("/(?:\/.*\/{1,})(.*) - Execution/", - (array)$summary); - if (count($matches) > 0 && isset($matches[1])) { - $issue['fields']['customfield_10311'] = $matches[1]; - } - */ - } - - $op = $this->APIClient->createIssue($issue); - $ret = array('status_ok' => false, 'id' => null, 'msg' => 'ko'); - if(!is_null($op)) - { - if(isset($op->errors)) - { - $ret['msg'] = __FUNCTION__ . ":Failure:JIRA Message:\n"; - foreach ($op->errors as $pk => $pv) - { - $ret['msg'] .= "$pk => $pv\n"; - } - } - else - { - $ret = array('status_ok' => true, 'id' => $op->key, - 'msg' => sprintf(lang_get('jira_bug_created'),$summary,$issue['fields']['project']['key'])); - } - } - } - catch (Exception $e) - { - $msg = "Create JIRA Ticket (REST) FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - /** - * on JIRA notes is called comment - * - */ - public function addNote($issueID,$noteText,$opt=null) - { - try - { - $op = $this->APIClient->addComment($noteText,$issueID); - $ret = array('status_ok' => false, 'id' => null, 'msg' => 'ko'); - if(!is_null($op)) - { - if(isset($op->errors)) - { - $ret['msg'] = $op->errors; - } - else - { - $ret = array('status_ok' => true, 'id' => $op->key, - 'msg' => sprintf(lang_get('jira_comment_added'),$issueID)); - } - } - } - catch (Exception $e) - { - $msg = "Add JIRA Issue Comment (REST) FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - /** - * - */ - public function getIssueTypes() - { - try - { - return $this->APIClient->getIssueTypes(); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getPriorities() - { - try - { - return $this->APIClient->getPriorities(); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - */ - public function getVersions() - { - $items = null; - try - { - $items = $this->APIClient->getVersions((string)$this->cfg->projectkey); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - return $items; - } - - /** - * - */ - public function getComponents() - { - try - { - return $this->APIClient->getComponents((string)$this->cfg->projectkey); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - - /** - * - */ - public function getCreateIssueFields() - { - try - { - return $this->APIClient->getCreateIssueFields((string)$this->cfg->projectkey); - } - catch(Exception $e) - { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - - - /** - * - */ - public function getIssueTypesForHTMLSelect() - { - return array('items' => $this->objectAttrToIDName($this->getIssueTypes()), - 'isMultiSelect' => false); - } - - /** - * - */ - public function getPrioritiesForHTMLSelect() - { - return array('items' => $this->objectAttrToIDName($this->getPriorities()), - 'isMultiSelect' => false); - } - - /** - * - */ - public function getVersionsForHTMLSelect() - { - $input = array('items' => null,'isMultiSelect' => true); - $items = $this->getVersions(); - if(!is_null($items)) - { - $input['items'] = $this->objectAttrToIDName($items); - } - else - { - $input = null; - } - return $input; - } - - /** - * - */ - public function getComponentsForHTMLSelect() - { - $items = $this->getComponents(); - $input = array('items' => null,'isMultiSelect' => true); - if(!is_null($items)) - { - $input['items'] = $this->objectAttrToIDName($items); - } - else - { - $input = null; - } - return $input; - } - - - /** - * - * - */ - private function objectAttrToIDName($attrSet) - { - $ret = null; - if(!is_null($attrSet)) - { - $ic = count($attrSet); - for($idx=0; $idx < $ic; $idx++) - { - $ret[$attrSet[$idx]->id] = $attrSet[$idx]->name; - } - } - return $ret; - } - - - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "JIRA LOGIN NAME\n" . - "JIRA PASSWORD\n" . - "https://testlink.atlassian.net/\n" . - "\n" . - "https://testlink.atlassian.net/rest/api/latest/\n" . - "https://testlink.atlassian.net/browse/\n" . - "1/0\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "JIRA PROJECT KEY\n" . - "JIRA ISSUE TYPE ID\n" . - "JIRA ISSUE PRIORITY ID\n" . - "\n" . - "\n"; - return $tpl; - } - - - - /** - * - **/ - function canCreateViaAPI() - { - $status_ok = false; - - // The VERY Mandatory KEY - if( property_exists($this->cfg, 'projectkey') ) - { - $pk = trim((string)($this->cfg->projectkey)); - $status_ok = ($pk !== ''); - } - - if($status_ok && $this->cfg->userinteraction == 0) - { - $status_ok = property_exists($this->cfg, 'issuetype'); - } - - return $status_ok; - } - - /** - * - **/ - function processAttributes() - { - $attr = get_object_vars($this->cfg->attributes); - foreach ($attr as $name => $elem) - { - $name = (string)$name; - switch($name) - { - case 'customFieldValues': - $this->getCustomFieldsAttribute($name,$elem); - break; - } - } - } - - /** - * supported types: - * (see https://developer.atlassian.com/jiradev/api-reference/ - * jira-rest-apis/jira-rest-api-tutorials/ - * jira-rest-api-example-create-issue# - * JIRARESTAPIExample-CreateIssue-Exampleofcreatinganissueusingcustomfields) - * - * --------------------------------------------------------- - * Single Value (simple) Group: - * --------------------------------------------------------- - * - * DatePickerField - * "customfield_10002": "2011-10-03" - * - * DateTimeField - * "customfield_10003": "2011-10-19T10:29:29.908+1100" * - * - * FreeTextField - * "customfield_10004": "Free text goes here. Type away!" - * - * NumberField - * "customfield_10010": 42.07 - * - * --------------------------------------------------------- - * Pair Value (simple) Group: - * --------------------------------------------------------- - * - * RadioButtons - * "customfield_10012": { "value": "red" } - * - * SelectList - * "customfield_10013": { "value": "red" } - * - * --------------------------------------------------------- - * Multiple Values (simple) Group: - * --------------------------------------------------------- - * - * Labels (PHP Array of strings) - * "customfield_10006": ["examplelabelnumber1", "examplelabelnumber2"] - * - * - * --------------------------------------------------------- - * Multiple Values (COMPLEX) Group: - * --------------------------------------------------------- - * - * MultiGroupPicker (access key -> name) - * "customfield_10007": [{ "name": "admins" }, { "name": "jira-dev" }, - * { "name": "jira-users" }] - * - * MultiUserPicker (access key -> name) - * "customfield_10009": [ {"name": "jsmith" }, {"name": "bjones" }, {"name": "tdurden" }] - * - * MultiSelect (access key -> value) - * "customfield_10008": [ {"value": "red" }, {"value": "blue" }, {"value": "green" }] - * - * - - * - * - **/ - function getCustomFieldsAttribute($name,$objCFSet) - { - $cfSet = get_object_vars($objCFSet); - $cfSet = $cfSet['customField']; - - foreach ($cfSet as $cf) - { - $cf = (array)$cf; - $cfJIRAID = $cf['customfieldId']; - $valueSet = (array)$cf['values']; - $loop2do = count($valueSet); - - $dummy = null; - $cfType = strtolower((string)$cf['type']); - switch($cfType) - { - case 'numberfield': - $dummy = (float)$valueSet['value']; - break; - - case 'datepickerfield': - case 'datetimefield': - case 'freetextfield': - $dummy = (string)$valueSet['value']; - break; - - case 'radiobutton': - $dummy = array('value' => (string)$valueSet['value']); - break; - case 'selectlist': - // "customfield_10012": { "value": "red" } - $dummy = array('id' => (string)$valueSet['value']); - break; - - case 'userpicker': - // "customfield_10012": { "value": "admin" } - $dummy = array('name' => (string)$valueSet['value']); - break; - - case 'labels': - for($vdx=0; $vdx <= $loop2do; $vdx++) - { - $dummy[] = (string)$valueSet['value'][$vdx]; - } - break; - - case 'multigrouppicker': - case 'multiuserpicker': - // access key -> name - for($vdx=0; $vdx <= $loop2do; $vdx++) - { - $dummy[] = array('name' => (string)$valueSet['value'][$vdx]); - } - break; - - case 'multiselect': - // access key -> value) - for($vdx=0; $vdx <= $loop2do; $vdx++) - { - $dummy[] = array('value' => (string)$valueSet['value'][$vdx]); - } - break; - } - $this->issueAttr[$cfJIRAID] = $dummy; - } - } - - /** - * - * - **/ - function checkCfg() - { - $status_ok = true; - if( property_exists($this->cfg, 'projectkey') ) - { - $pk = trim((string)($this->cfg->projectkey)); - if($pk == '') - { - $status_ok = false; - $msg = __CLASS__ . ' - Empty configuration: '; - } - } - else - { - // this is oK if user only wants to LINK issues - $this->cfg->projectkey = self::NOPROJECTKEY; - } - - if(!$status_ok) - { - tLog(__METHOD__ . ' / ' . $msg , 'ERROR'); - } - return $status_ok; - } - - - /** - * - * If connection fails $this->defaultResolvedStatus is null - * - */ - public function setResolvedStatusCfg() - { - if( property_exists($this->cfg,'resolvedstatus') ) - { - $statusCfg = (array)$this->cfg->resolvedstatus; - } - else - { - $statusCfg['status'] = $this->defaultResolvedStatus; - } - - $this->resolvedStatus = new stdClass(); - $this->resolvedStatus->byCode = array(); - if(!is_null($statusCfg['status'])) - { - foreach($statusCfg['status'] as $cfx) - { - $e = (array)$cfx; - $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; - } - } - $this->resolvedStatus->byName = array_flip($this->resolvedStatus->byCode); - } - - - /** - * - */ - public function getUserAccountID($email) - { - try { - $u = $this->APIClient->getUserByEmail($email); - if (null != $u) { - return $u->accountId; - } - return null; - } - catch(Exception $e) { - tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); - } - } - - - +name = $name; + $this->interfaceViaDB = false; + $this->support = new jiraCommons(); + $this->support->guiCfg = array( + 'use_decoration' => true + ); + + // This is the right way to overwrite ONLY + // the keys we want, and preserve the default + // configuration present in the issueTrackerInterface class + $this->methodOpt['buildViewBugLink'] = array_merge( + $this->methodOpt['buildViewBugLink'], + array( + 'addSummary' => true, + 'colorByStatus' => false + )); + + if ($this->setCfg($config) && $this->checkCfg()) { + $this->completeCfg(); + $this->connect(); + $this->guiCfg = array( + 'use_decoration' => true + ); + + if ($this->isConnected()) { + $this->setResolvedStatusCfg(); + } + } + } + + /** + */ + public function getIssueAttr() + { + return $this->issueAttr; + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + + if (! property_exists($this->cfg, 'uriapi')) { + $this->cfg->uriapi = $base . 'rest/api/latest/'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'browse/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . ''; + } + + if (property_exists($this->cfg, 'attributes')) { + $this->processAttributes(); + } + + if (! property_exists($this->cfg, 'userinteraction')) { + $this->cfg->userinteraction = 0; + } + + if (! property_exists($this->cfg, 'createissueviaapi')) { + $this->cfg->createissueviaapi = 0; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxString($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $this->jiraCfg = array( + 'username' => (string) trim($this->cfg->username), + 'password' => (string) trim($this->cfg->password), + 'host' => (string) trim($this->cfg->uriapi) + ); + + $this->jiraCfg['proxy'] = config_get('proxy'); + if (! is_null($this->jiraCfg['proxy']) && + is_null($this->jiraCfg['proxy']->host)) { + $this->jiraCfg['proxy'] = null; + } + + $this->APIClient = new JiraApi\Jira($this->jiraCfg); + + $this->connected = $this->APIClient->testLogin(); + if ($this->connected && + ($this->cfg->projectkey != self::NOPROJECTKEY)) { + // Now check if can get info about the project, to understand + // if at least it exists. + $pk = trim((string) $this->cfg->projectkey); + $this->APIClient->getProject($pk); + + $statusSet = $this->APIClient->getStatuses(); + foreach ($statusSet as $statusID => $statusName) { + $this->statusDomain[$statusName] = $statusID; + } + + $this->defaultResolvedStatus = $this->support->initDefaultResolvedStatus( + $this->statusDomain); + } + } catch (Exception $e) { + $this->connected = false; + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $issue = $this->APIClient->getIssue($issueID); + + // IMPORTANT NOTICE + // $issue->id do not contains ISSUE ID as displayed on GUI, but what seems to be an internal value. + // $issue->key has what we want. + // Very strange is how have this worked till today ?? (2015-01-24) + if (! is_null($issue) && is_object($issue) && + ! property_exists($issue, 'errorMessages')) { + + // We are going to have a set of standard properties + $issue->id = $issue->key; + $issue->summary = $issue->fields->summary; + $issue->statusCode = $issue->fields->status->id; + $issue->statusVerbose = $issue->fields->status->name; + + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusHTMLString = $this->support->buildStatusHTMLString( + $issue->statusVerbose); + $issue->summaryHTMLString = $this->support->buildSummaryHTMLString( + $issue); + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + + /* + * for debug porpouses + * $tlIssue = new stdClass(); + * $tlIssue->IDHTMLString = $issue->IDHTMLString; + * $tlIssue->statusCode = $issue->statusCode; + * $tlIssue->statusVerbose = $issue->statusVerbose; + * $tlIssue->statusHTMLString = $issue->statusHTMLString; + * $tlIssue->summaryHTMLString = $issue->summaryHTMLString; + * $tlIssue->isResolved = $issue->isResolved; + * + * var_dump($tlIssue); + */ + } else { + $issue = null; + } + } catch (Exception $e) { + tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + * JSON example: + * + * { + * "fields": { + * "project": { + * "key": "TEST" + * }, + * "summary": "REST ye merry gentlemen.", + * "description": "Creating of an issue using project keys and issue type names using the REST API", + * "issuetype": { + * "name": "Bug" + * } + * } + * } + */ + public function addIssue($summary, $description, $opt = null) + { + try { + $issue = array( + 'fields' => array( + 'project' => array( + 'key' => (string) $this->cfg->projectkey + ), + 'summary' => $summary, + 'description' => $description, + 'issuetype' => 1 /* Bug */ + ) + ); + + if (property_exists($this->cfg, 'issuetype')) { + $issue['fields']['issuetype'] = array( + 'id' => (int) $this->cfg->issuetype + ); + } + + $prio = null; + if (property_exists($this->cfg, 'issuepriority')) { + $prio = $this->cfg->issuepriority; + } + if (! is_null($opt) && property_exists($opt, 'issuePriority')) { + $prio = $opt->issuePriority; + } + if (! is_null($prio)) { + // CRITIC: if not casted to string, you will get following error from JIRA + // "Could not find valid 'id' or 'name' in priority object." + $issue['fields']['priority'] = array( + 'id' => (string) $prio + ); + } + + if (! is_null($this->issueAttr)) { + $issue['fields'] = array_merge($issue['fields'], + $this->issueAttr); + } + + if (! is_null($opt)) { + // these can have multiple values + if (property_exists($opt, 'artifactComponent')) { + // YES is plural!! + $issue['fields']['components'] = array(); + foreach ($opt->artifactComponent as $vv) { + $issue['fields']['components'][] = array( + 'id' => (string) $vv + ); + } + } + + if (property_exists($opt, 'artifactVersion')) { + // YES is plural!! + $issue['fields']['versions'] = array(); + foreach ($opt->artifactVersion as $vv) { + $issue['fields']['versions'][] = array( + 'id' => (string) $vv + ); + } + } + + if (property_exists($opt, 'reporter')) { + $issue['fields']['reporter'] = array( + 'id' => (string) $opt->reporter + ); + } + + if (property_exists($opt, 'issueType')) { + $issue['fields']['issuetype'] = array( + 'id' => $opt->issueType + ); + } + } + + $op = $this->APIClient->createIssue($issue); + $ret = array( + 'status_ok' => false, + 'id' => null, + 'msg' => 'ko' + ); + if (! is_null($op)) { + if (isset($op->errors)) { + $ret['msg'] = __FUNCTION__ . ":Failure:JIRA Message:\n"; + foreach ($op->errors as $pk => $pv) { + $ret['msg'] .= "$pk => $pv\n"; + } + } else { + $ret = array( + 'status_ok' => true, + 'id' => $op->key, + 'msg' => sprintf(lang_get('jira_bug_created'), $summary, + $issue['fields']['project']['key']) + ); + } + } + } catch (Exception $e) { + $msg = "Create JIRA Ticket (REST) FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + * on JIRA notes is called comment + */ + public function addNote($issueID, $noteText, $opt = null) + { + try { + $op = $this->APIClient->addComment($noteText, $issueID); + $ret = array( + 'status_ok' => false, + 'id' => null, + 'msg' => 'ko' + ); + if (! is_null($op)) { + if (isset($op->errors)) { + $ret['msg'] = $op->errors; + } else { + $ret = array( + 'status_ok' => true, + 'id' => $op->key, + 'msg' => sprintf(lang_get('jira_comment_added'), + $issueID) + ); + } + } + } catch (Exception $e) { + $msg = "Add JIRA Issue Comment (REST) FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + */ + public function getIssueTypes() + { + try { + return $this->APIClient->getIssueTypes(); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getPriorities() + { + try { + return $this->APIClient->getPriorities(); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getVersions() + { + $items = null; + try { + $items = $this->APIClient->getVersions( + (string) $this->cfg->projectkey); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + return $items; + } + + /** + */ + public function getComponents() + { + try { + return $this->APIClient->getComponents( + (string) $this->cfg->projectkey); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getCreateIssueFields() + { + try { + return $this->APIClient->getCreateIssueFields( + (string) $this->cfg->projectkey); + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function getIssueTypesForHTMLSelect() + { + return array( + 'items' => $this->objectAttrToIDName($this->getIssueTypes()), + 'isMultiSelect' => false + ); + } + + /** + */ + public function getPrioritiesForHTMLSelect() + { + return array( + 'items' => $this->objectAttrToIDName($this->getPriorities()), + 'isMultiSelect' => false + ); + } + + /** + */ + public function getVersionsForHTMLSelect() + { + $input = array( + 'items' => null, + 'isMultiSelect' => true + ); + $items = $this->getVersions(); + if (! is_null($items)) { + $input['items'] = $this->objectAttrToIDName($items); + } else { + $input = null; + } + return $input; + } + + /** + */ + public function getComponentsForHTMLSelect() + { + $items = $this->getComponents(); + $input = array( + 'items' => null, + 'isMultiSelect' => true + ); + if (! is_null($items)) { + $input['items'] = $this->objectAttrToIDName($items); + } else { + $input = null; + } + return $input; + } + + /** + */ + private function objectAttrToIDName($attrSet) + { + $ret = null; + if (! is_null($attrSet)) { + $ic = count($attrSet); + for ($idx = 0; $idx < $ic; $idx ++) { + $ret[$attrSet[$idx]->id] = $attrSet[$idx]->name; + } + } + return $ret; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "JIRA LOGIN NAME\n" . + "JIRA PASSWORD\n" . + "https://testlink.atlassian.net/\n" . + "\n" . + "https://testlink.atlassian.net/rest/api/latest/\n" . + "https://testlink.atlassian.net/browse/\n" . + "1/0\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "JIRA PROJECT KEY\n" . + "JIRA ISSUE TYPE ID\n" . + "JIRA ISSUE PRIORITY ID\n" . "\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + $status_ok = false; + + // The VERY Mandatory KEY + if (property_exists($this->cfg, 'projectkey')) { + $pk = trim((string) ($this->cfg->projectkey)); + $status_ok = ($pk !== ''); + } + + if ($status_ok && $this->cfg->userinteraction == 0) { + $status_ok = property_exists($this->cfg, 'issuetype'); + } + + return $status_ok; + } + + /** + */ + private function processAttributes() + { + $attr = get_object_vars($this->cfg->attributes); + foreach ($attr as $name => $elem) { + $name = (string) $name; + switch ($name) { + case 'customFieldValues': + $this->getCustomFieldsAttribute($name, $elem); + break; + } + } + } + + /** + * supported types: + * (see https://developer.atlassian.com/jiradev/api-reference/ + * jira-rest-apis/jira-rest-api-tutorials/ + * jira-rest-api-example-create-issue# + * JIRARESTAPIExample-CreateIssue-Exampleofcreatinganissueusingcustomfields) + * + * --------------------------------------------------------- + * Single Value (simple) Group: + * --------------------------------------------------------- + * + * DatePickerField + * "customfield_10002": "2011-10-03" + * + * DateTimeField + * "customfield_10003": "2011-10-19T10:29:29.908+1100" * + * + * FreeTextField + * "customfield_10004": "Free text goes here. Type away!" + * + * NumberField + * "customfield_10010": 42.07 + * + * --------------------------------------------------------- + * Pair Value (simple) Group: + * --------------------------------------------------------- + * + * RadioButtons + * "customfield_10012": { "value": "red" } + * + * SelectList + * "customfield_10013": { "value": "red" } + * + * --------------------------------------------------------- + * Multiple Values (simple) Group: + * --------------------------------------------------------- + * + * Labels (PHP Array of strings) + * "customfield_10006": ["examplelabelnumber1", "examplelabelnumber2"] + * + * + * --------------------------------------------------------- + * Multiple Values (COMPLEX) Group: + * --------------------------------------------------------- + * + * MultiGroupPicker (access key -> name) + * "customfield_10007": [{ "name": "admins" }, { "name": "jira-dev" }, + * { "name": "jira-users" }] + * + * MultiUserPicker (access key -> name) + * "customfield_10009": [ {"name": "jsmith" }, {"name": "bjones" }, {"name": "tdurden" }] + * + * MultiSelect (access key -> value) + * "customfield_10008": [ {"value": "red" }, {"value": "blue" }, {"value": "green" }] + */ + private function getCustomFieldsAttribute($name, $objCFSet) + { + $cfSet = get_object_vars($objCFSet); + $cfSet = $cfSet['customField']; + + foreach ($cfSet as $cf) { + $cf = (array) $cf; + $cfJIRAID = $cf['customfieldId']; + $valueSet = (array) $cf['values']; + $loop2do = count($valueSet); + + $dummy = null; + $cfType = strtolower((string) $cf['type']); + switch ($cfType) { + case 'numberfield': + $dummy = (float) $valueSet['value']; + break; + + case 'datepickerfield': + case 'datetimefield': + case 'freetextfield': + $dummy = (string) $valueSet['value']; + break; + + case 'radiobutton': + $dummy = array( + 'value' => (string) $valueSet['value'] + ); + break; + case 'selectlist': + // "customfield_10012": { "value": "red" } + $dummy = array( + 'id' => (string) $valueSet['value'] + ); + break; + + case 'userpicker': + // "customfield_10012": { "value": "admin" } + $dummy = array( + 'name' => (string) $valueSet['value'] + ); + break; + + case 'labels': + for ($vdx = 0; $vdx <= $loop2do; $vdx ++) { + $dummy[] = (string) $valueSet['value'][$vdx]; + } + break; + + case 'multigrouppicker': + case 'multiuserpicker': + // access key -> name + for ($vdx = 0; $vdx <= $loop2do; $vdx ++) { + $dummy[] = array( + 'name' => (string) $valueSet['value'][$vdx] + ); + } + break; + + case 'multiselect': + // access key -> value) + for ($vdx = 0; $vdx <= $loop2do; $vdx ++) { + $dummy[] = array( + 'value' => (string) $valueSet['value'][$vdx] + ); + } + break; + } + $this->issueAttr[$cfJIRAID] = $dummy; + } + } + + /** + */ + private function checkCfg() + { + $status_ok = true; + if (property_exists($this->cfg, 'projectkey')) { + $pk = trim((string) ($this->cfg->projectkey)); + if ($pk == '') { + $status_ok = false; + $msg = __CLASS__ . ' - Empty configuration: '; + } + } else { + // this is oK if user only wants to LINK issues + $this->cfg->projectkey = self::NOPROJECTKEY; + } + + if (! $status_ok) { + tLog(__METHOD__ . ' / ' . $msg, 'ERROR'); + } + return $status_ok; + } + + /** + * If connection fails $this->defaultResolvedStatus is null + */ + public function setResolvedStatusCfg() + { + if (property_exists($this->cfg, 'resolvedstatus')) { + $statusCfg = (array) $this->cfg->resolvedstatus; + } else { + $statusCfg['status'] = $this->defaultResolvedStatus; + } + + $this->resolvedStatus = new stdClass(); + $this->resolvedStatus->byCode = array(); + if (! is_null($statusCfg['status'])) { + foreach ($statusCfg['status'] as $cfx) { + $e = (array) $cfx; + $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; + } + } + $this->resolvedStatus->byName = array_flip( + $this->resolvedStatus->byCode); + } + + /** + */ + public function getUserAccountID($email) + { + try { + $u = $this->APIClient->getUserByEmail($email); + if (null != $u) { + return $u->accountId; + } + return null; + } catch (Exception $e) { + tLog(__METHOD__ . " " . $e->getMessage(), 'ERROR'); + } + } } diff --git a/lib/issuetrackerintegration/jirasoapInterface.class.php b/lib/issuetrackerintegration/jirasoapInterface.class.php index d1428ed459..838d3620ce 100644 --- a/lib/issuetrackerintegration/jirasoapInterface.class.php +++ b/lib/issuetrackerintegration/jirasoapInterface.class.php @@ -1,555 +1,543 @@ - 'its_duedate_with_separator'); - - private $soapOpt = array("connection_timeout" => 1, 'exceptions' => 1); - private $issueDefaults; - private $issueAttr = null; - - var $defaultResolvedStatus; - var $support; - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - $this->name = $name; - $this->interfaceViaDB = false; - $this->support = new jiraCommons(); - $this->support->guiCfg = array('use_decoration' => true); - - $proxyCfg = config_get('proxy'); - if(!is_null($proxyCfg->host)) - { - $key2loop = array('host','port','login','password'); - foreach($key2loop as $fi) - { - if(!is_null($proxyCfg->$fi)) - { - $this->soapOpt['proxy_' . $fi] = $proxyCfg->$fi; - } - } - } - - $this->methodOpt = array('buildViewBugLink' => array('addSummary' => true, 'colorByStatus' => true)); - if( $this->setCfg($config) ) - { - $this->completeCfg(); - $this->connect(); - $this->guiCfg = array('use_decoration' => true); - - // Attention has to be done AFTER CONNECT OK, because we need info setted there - if( $this->isConnected()) - { - $this->setResolvedStatusCfg(); - } - } - } - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $step = 1; // just for debug - - $base = trim($this->cfg->uribase,"/") . '/' ; - if( !property_exists($this->cfg,'uriwsdl') ) - { - //DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uriwsdl
    ";$step++; - $this->cfg->uriwsdl = $base . 'rpc/soap/jirasoapservice-v2?wsdl'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - //DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uriview
    ";$step++; - $this->cfg->uriview = $base . 'browse/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - //DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uricreate
    ";$step++; - $this->cfg->uricreate = $base . 'secure/CreateIssue!default.jspa'; - } - - - if( property_exists($this->cfg,'attributes') ) - { - // echo __FUNCTION__ . "::Debug::Step#$step Going To Add attributes
    ";$step++; - $this->processAttributes(); - } - - $this->issueDefaults = array('issuetype' => 1); - foreach($this->issueDefaults as $prop => $default) - { - if(!isset($this->issueAttr[$prop])) - { - $this->issueAttr[$prop] = $default; - } - // $this->cfg->$prop = (string)(property_exists($this->cfg,$prop) ? $this->cfg->$prop : $default); - } - - if( !property_exists($this->cfg,'userinteraction') ) { - $this->cfg->userinteraction = 0; - } - - if( !property_exists($this->cfg,'createissueviaapi') ) { - $this->cfg->createissueviaapi = 0; - } - } - - - - /** - * @internal precondition: TestLink has to be connected to Jira - * - * @param string issueID - * - **/ - function getIssue($issueID) - { - $issue = null; - try - { - $issue = $this->APIClient->getIssue($this->authToken, $issueID); - - if(!is_null($issue) && is_object($issue)) - { - // We are going to have a set of standard properties - $issue->id = $issueID; - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = $issue->status; - $issue->statusVerbose = array_search($issue->statusCode, $this->statusDomain); - $issue->statusHTMLString = $this->support->buildStatusHTMLString($issue->statusVerbose); - $issue->summaryHTMLString = $this->support->buildSummaryHTMLString($issue); - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - } - } - catch (Exception $e) - { - tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); - $issue = null; - } - - return $issue; - } - - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxString($issueID); - } - - - /** - * establishes connection to the bugtracking system - * - * @return bool returns true if the soap connection was established and the - * wsdl could be downloaded, false else - * - **/ - function connect() - { - $this->interfaceViaDB = false; - $op = $this->getClient(array('log' => true)); - // echo '
    OP
    ';var_dump($op); - - if( ($this->connected = $op['connected']) ) - { - // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need - // to do a simple call with user/password only to understand if we are really connected - try - { - $this->APIClient = $op['client']; - $this->authToken = $this->APIClient->login($this->cfg->username, $this->cfg->password); - $statusSet = $op['client']->getStatuses($this->authToken); - foreach ($statusSet as $key => $pair) - { - $this->statusDomain[$pair->name]=$pair->id; - } - - $this->defaultResolvedStatus = $this->support->initDefaultResolvedStatus($this->statusDomain); - $this->l18n = init_labels($this->labels); - } - catch (SoapFault $f) - { - $this->connected = false; - $msg = __CLASS__ . " - SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; - // echo $msg; - tLog($msg,"ERROR"); - } - } - return $this->connected; - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - function getClient($opt=null) - { - // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work - $res = array('client' => null, 'connected' => false, 'msg' => 'generic ko'); - $my['opt'] = array('log' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - try - { - // IMPORTANT NOTICE - // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL - // DO CAST any member before using it. - // If we do following call WITHOUT (string) CAST, SoapClient() fails - // complaining '... wsdl has to be an STRING or null ...' - // - - $res['client'] = new SoapClient((string)$this->cfg->uriwsdl,$this->soapOpt); - $res['connected'] = true; - $res['msg'] = 'iupi!!!'; - } - catch (SoapFault $f) - { - $res['connected'] = false; - $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; - if($my['opt']['log']) - { - tLog("SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})","ERROR"); - } - } - return $res; - } - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "JIRA LOGIN NAME\n" . - "JIRA PASSWORD\n" . - "http://testlink.atlassian.net/\n" . - "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . - "testlink.atlassian.net/browse/\n" . - "testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . - "\n" . - "JIRA PROJECT KEY\n" . - "JIRA ISSUE TYPE\n" . - "\n" . - "\n" . - " --> \n" . - " \n" . - " \n" . - " customfield_10800\n" . - " 111\n" . - " \n" . - " \n" . - " customfield_10900\n" . - " Yamaha Factory RacingDucati\n" . - " \n" . - " \n" . - " -->\n" . - "\n" . - "\n" . - "5Resolved\n" . - "6Closed\n" . - "\n" . - "\n"; - return $template; - } - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public function getStatusDomain() - { - return $this->statusDomain; - } - - public static function checkEnv() - { - $ret = array(); - $ret['status'] = extension_loaded('soap'); - $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; - return $ret; - } - - - // useful info - // https://github.com/ricardocasares/jira-soap-api - // - // CRITIC ISSUE TYPE IS MANDATORY. - // - public function addIssue($summary,$description) - { - try - { - $issue = array('project' => (string)$this->cfg->projectkey, - 'type' => (int)$this->cfg->issuetype, - 'summary' => $summary, - 'description' => $description); - - - if(!is_null($this->issueAttr)) - { - $issue = array_merge($issue,$this->issueAttr); - } - - //DEBUG-echo 'This Will Be Sent to JIRA
    ';echo '
    ';var_dump($issue);echo '
    '; - - $op = $this->APIClient->createIssue($this->authToken, $issue); - $ret = array('status_ok' => true, 'id' => $op->key, - 'msg' => sprintf(lang_get('jira_bug_created'),$summary,$issue['project'])); - } - catch (Exception $e) - { - $msg = "Create JIRA Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - - /** - * - * If connection fails $this->defaultResolvedStatus is null - * - */ - public function setResolvedStatusCfg() - { - if( property_exists($this->cfg,'resolvedstatus') ) - { - $statusCfg = (array)$this->cfg->resolvedstatus; - } - else - { - $statusCfg['status'] = $this->defaultResolvedStatus; - } - - $this->resolvedStatus = new stdClass(); - $this->resolvedStatus->byCode = array(); - if(!is_null($statusCfg['status'])) - { - foreach($statusCfg['status'] as $cfx) - { - $e = (array)$cfx; - $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; - } - } - $this->resolvedStatus->byName = array_flip($this->resolvedStatus->byCode); - } - - /** - * - */ - public function addIssueFromArray($issue) - { - try - { - - $op = $this->APIClient->createIssue($this->authToken, $issue); - $ret = array('status_ok' => true, 'id' => $op->key, - 'msg' => sprintf(lang_get('jira_bug_created'),$summary,$issue['project'])); - } - catch (Exception $e) - { - $msg = "Create JIRA Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'projectkey') && - property_exists($this->cfg, 'issuetype')); - } - - - -/** - * - **/ - function processAttributes() - { - $attr = get_object_vars($this->cfg->attributes); - foreach ($attr as $name => $elem) - { - $name = (string)$name; - switch($name) - { - case 'customFieldValues': - $this->getCustomFieldsAttribute($name,$elem); - break; - - case 'affectsVersions': - $this->getAffectsVersionsAttribute($name,$elem); - break; - - default: - $this->getRelaxedAttribute($name,$elem); - break; - } - } - } - - - /** - * - **/ - function getRelaxedAttribute($name,$elem) - { - if( is_object($elem) ) - { - $ovars = get_object_vars($elem); - $cc = (array)current($ovars); - $kk = key($ovars); - foreach($cc as $value) - { - $this->issueAttr[$name][] = array($kk => (string)$value); - } - } - else - { - $this->issueAttr[$name] = (string)$elem; - } - } - - /** - * - * - **/ - function getCustomFieldsAttribute($name,$objCFSet) - { - // loop on fields of a Custom Field - // According to JIRA Documentation and some hands on examples - // customfieldId, key, values => has to be sent as an array - // - $elem = get_object_vars($objCFSet); - $elem = $elem['customField']; - - // Because how XML works, when we have ONLY one CF we do not get an array, - // but only when we have more. - // This forces us to do this kind of processing => cast always to an array, - // but paying special attention to complex elements. - // Remember we get data from simpleXML processing - // - if(is_object($elem)) - { - $elem = array($elem); - } - - foreach ($elem as $item) - { - // dev notes - // key attribute is not managed yet - // may be trim on each $item->values->value will be good - $this->issueAttr[$name][] = array('customfieldId' => trim((string)$item->customfieldId), - 'values' => (array)$item->values->value); - } - } - - - /** - * - * - * - * 10000 - * - * - * - * - * 10002 - * - * - * - * - * - * - **/ - function getAffectsVersionsAttribute($name,$objItemSet) - { - $elem = get_object_vars($objItemSet); - $elem = $elem['version']; - - // Because how XML works, when we have ONLY one CF we do not get an array, - // but only when we have more. - // This forces us to do this kind of processing => cast always to an array, - // but paying special attention to complex elements. - // Remember we get data from simpleXML processing - // - if(is_object($elem)) - { - $elem = array($elem); - } - - foreach ($elem as $item) - { - $this->issueAttr[$name][] = array('id' => trim((string)$item->id), - 'archived' => trim((string)$item->archived), - 'released' => trim((string)$item->released)); - } - } -} \ No newline at end of file + 'its_duedate_with_separator' + ); + + private $soapOpt = array( + "connection_timeout" => 1, + 'exceptions' => 1 + ); + + private $issueDefaults; + + private $issueAttr = null; + + public $defaultResolvedStatus; + + public $support; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + $this->support = new jiraCommons(); + $this->support->guiCfg = array( + 'use_decoration' => true + ); + + $proxyCfg = config_get('proxy'); + if (! is_null($proxyCfg->host)) { + $key2loop = array( + 'host', + 'port', + 'login', + 'password' + ); + foreach ($key2loop as $fi) { + if (! is_null($proxyCfg->$fi)) { + $this->soapOpt['proxy_' . $fi] = $proxyCfg->$fi; + } + } + } + + $this->methodOpt = array( + 'buildViewBugLink' => array( + 'addSummary' => true, + 'colorByStatus' => true + ) + ); + if ($this->setCfg($config)) { + $this->completeCfg(); + $this->connect(); + $this->guiCfg = array( + 'use_decoration' => true + ); + + // Attention has to be done AFTER CONNECT OK, because we need info setted there + if ($this->isConnected()) { + $this->setResolvedStatusCfg(); + } + } + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; + if (! property_exists($this->cfg, 'uriwsdl')) { + // DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uriwsdl
    ";$step++; + $this->cfg->uriwsdl = $base . 'rpc/soap/jirasoapservice-v2?wsdl'; + } + + if (! property_exists($this->cfg, 'uriview')) { + // DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uriview
    ";$step++; + $this->cfg->uriview = $base . 'browse/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + // DEBUG-echo __FUNCTION__ . "::Debug::Step#$step Going To Add uricreate
    ";$step++; + $this->cfg->uricreate = $base . 'secure/CreateIssue!default.jspa'; + } + + if (property_exists($this->cfg, 'attributes')) { + $this->processAttributes(); + } + + $this->issueDefaults = array( + 'issuetype' => 1 + ); + foreach ($this->issueDefaults as $prop => $default) { + if (! isset($this->issueAttr[$prop])) { + $this->issueAttr[$prop] = $default; + } + } + + if (! property_exists($this->cfg, 'userinteraction')) { + $this->cfg->userinteraction = 0; + } + + if (! property_exists($this->cfg, 'createissueviaapi')) { + $this->cfg->createissueviaapi = 0; + } + } + + /** + * + * @internal precondition: TestLink has to be connected to Jira + * + * @param + * string issueID + * + */ + public function getIssue($issueID) + { + $issue = null; + try { + $issue = $this->APIClient->getIssue($this->authToken, $issueID); + + if (! is_null($issue) && is_object($issue)) { + // We are going to have a set of standard properties + $issue->id = $issueID; + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = $issue->status; + $issue->statusVerbose = array_search($issue->statusCode, + $this->statusDomain); + $issue->statusHTMLString = $this->support->buildStatusHTMLString( + $issue->statusVerbose); + $issue->summaryHTMLString = $this->support->buildSummaryHTMLString( + $issue); + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + } + } catch (Exception $e) { + tLog("JIRA Ticket ID $issueID - " . $e->getMessage(), 'WARNING'); + $issue = null; + } + + return $issue; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxString($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool returns true if the soap connection was established and the + * wsdl could be downloaded, false else + * + */ + public function connect() + { + $this->interfaceViaDB = false; + $op = $this->getClient(array( + 'log' => true + )); + + if ($this->connected = $op['connected']) { + // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need + // to do a simple call with user/password only to understand if we are really connected + try { + $this->APIClient = $op['client']; + $this->authToken = $this->APIClient->login($this->cfg->username, + $this->cfg->password); + $statusSet = $op['client']->getStatuses($this->authToken); + foreach ($statusSet as $pair) { + $this->statusDomain[$pair->name] = $pair->id; + } + + $this->defaultResolvedStatus = $this->support->initDefaultResolvedStatus( + $this->statusDomain); + $this->l18n = init_labels($this->labels); + } catch (SoapFault $f) { + $this->connected = false; + $msg = __CLASS__ . + " - SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; + tLog($msg, "ERROR"); + } + } + return $this->connected; + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getClient($opt = null) + { + // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work + $res = array( + 'client' => null, + 'connected' => false, + 'msg' => 'generic ko' + ); + $my['opt'] = array( + 'log' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + try { + // IMPORTANT NOTICE + // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL + // DO CAST any member before using it. + // If we do following call WITHOUT (string) CAST, SoapClient() fails + // complaining '... wsdl has to be an STRING or null ...' + // + + $res['client'] = new SoapClient((string) $this->cfg->uriwsdl, + $this->soapOpt); + $res['connected'] = true; + $res['msg'] = 'iupi!!!'; + } catch (SoapFault $f) { + $res['connected'] = false; + $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; + if ($my['opt']['log']) { + tLog( + "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", + "ERROR"); + } + } + return $res; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "JIRA LOGIN NAME\n" . + "JIRA PASSWORD\n" . + "http://testlink.atlassian.net/\n" . + "http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl\n" . + "testlink.atlassian.net/browse/\n" . + "testlink.atlassian.net/secure/CreateIssue!default.jspa\n" . + "\n" . + "JIRA PROJECT KEY\n" . + "JIRA ISSUE TYPE\n" . + "\n" . + "\n" . + " --> \n" . " \n" . + " \n" . + " customfield_10800\n" . + " 111\n" . + " \n" . " \n" . + " customfield_10900\n" . + " Yamaha Factory RacingDucati\n" . + " \n" . " \n" . + " -->\n" . + "\n" . + "\n" . + "5Resolved\n" . + "6Closed\n" . + "\n" . "\n"; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public function getStatusDomain() + { + return $this->statusDomain; + } + + public static function checkEnv() + { + $ret = array(); + $ret['status'] = extension_loaded('soap'); + $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; + return $ret; + } + + // useful info + // https://github.com/ricardocasares/jira-soap-api + // + // CRITIC ISSUE TYPE IS MANDATORY. + // + public function addIssue($summary, $description) + { + try { + $issue = array( + 'project' => (string) $this->cfg->projectkey, + 'type' => (int) $this->cfg->issuetype, + 'summary' => $summary, + 'description' => $description + ); + + if (! is_null($this->issueAttr)) { + $issue = array_merge($issue, $this->issueAttr); + } + + // DEBUG-echo 'This Will Be Sent to JIRA
    ';echo '
    ';var_dump($issue);echo '
    '; + + $op = $this->APIClient->createIssue($this->authToken, $issue); + $ret = array( + 'status_ok' => true, + 'id' => $op->key, + 'msg' => sprintf(lang_get('jira_bug_created'), $summary, + $issue['project']) + ); + } catch (Exception $e) { + $msg = "Create JIRA Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + * If connection fails $this->defaultResolvedStatus is null + */ + public function setResolvedStatusCfg() + { + if (property_exists($this->cfg, 'resolvedstatus')) { + $statusCfg = (array) $this->cfg->resolvedstatus; + } else { + $statusCfg['status'] = $this->defaultResolvedStatus; + } + + $this->resolvedStatus = new stdClass(); + $this->resolvedStatus->byCode = array(); + if (! is_null($statusCfg['status'])) { + foreach ($statusCfg['status'] as $cfx) { + $e = (array) $cfx; + $this->resolvedStatus->byCode[$e['code']] = $e['verbose']; + } + } + $this->resolvedStatus->byName = array_flip( + $this->resolvedStatus->byCode); + } + + /** + */ + public function addIssueFromArray($issue) + { + try { + + $op = $this->APIClient->createIssue($this->authToken, $issue); + $ret = array( + 'status_ok' => true, + 'id' => $op->key, + 'msg' => sprintf(lang_get('jira_bug_created'), $summary, + $issue['project']) + ); + } catch (Exception $e) { + $msg = "Create JIRA Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'projectkey') && + property_exists($this->cfg, 'issuetype'); + } + + /** + */ + private function processAttributes() + { + $attr = get_object_vars($this->cfg->attributes); + foreach ($attr as $name => $elem) { + $name = (string) $name; + switch ($name) { + case 'customFieldValues': + $this->getCustomFieldsAttribute($name, $elem); + break; + + case 'affectsVersions': + $this->getAffectsVersionsAttribute($name, $elem); + break; + + default: + $this->getRelaxedAttribute($name, $elem); + break; + } + } + } + + /** + */ + private function getRelaxedAttribute($name, $elem) + { + if (is_object($elem)) { + $ovars = get_object_vars($elem); + $cc = (array) current($ovars); + $kk = key($ovars); + foreach ($cc as $value) { + $this->issueAttr[$name][] = array( + $kk => (string) $value + ); + } + } else { + $this->issueAttr[$name] = (string) $elem; + } + } + + /** + */ + private function getCustomFieldsAttribute($name, $objCFSet) + { + // loop on fields of a Custom Field + // According to JIRA Documentation and some hands on examples + // customfieldId, key, values => has to be sent as an array + // + $elem = get_object_vars($objCFSet); + $elem = $elem['customField']; + + // Because how XML works, when we have ONLY one CF we do not get an array, + // but only when we have more. + // This forces us to do this kind of processing => cast always to an array, + // but paying special attention to complex elements. + // Remember we get data from simpleXML processing + // + if (is_object($elem)) { + $elem = array( + $elem + ); + } + + foreach ($elem as $item) { + // dev notes + // key attribute is not managed yet + // may be trim on each $item->values->value will be good + $this->issueAttr[$name][] = array( + 'customfieldId' => trim((string) $item->customfieldId), + 'values' => (array) $item->values->value + ); + } + } + + /** + * + * + * 10000 + * + * + * + * + * 10002 + * + * + * + * + */ + private function getAffectsVersionsAttribute($name, $objItemSet) + { + $elem = get_object_vars($objItemSet); + $elem = $elem['version']; + + // Because how XML works, when we have ONLY one CF we do not get an array, + // but only when we have more. + // This forces us to do this kind of processing => cast always to an array, + // but paying special attention to complex elements. + // Remember we get data from simpleXML processing + // + if (is_object($elem)) { + $elem = array( + $elem + ); + } + + foreach ($elem as $item) { + $this->issueAttr[$name][] = array( + 'id' => trim((string) $item->id), + 'archived' => trim((string) $item->archived), + 'released' => trim((string) $item->released) + ); + } + } +} diff --git a/lib/issuetrackerintegration/kaitenrestInterface.class.php b/lib/issuetrackerintegration/kaitenrestInterface.class.php index 59aa1fe8f7..5e743714ec 100644 --- a/lib/issuetrackerintegration/kaitenrestInterface.class.php +++ b/lib/issuetrackerintegration/kaitenrestInterface.class.php @@ -1,357 +1,388 @@ - 'archived', - '3' => 'deleted' - ]; - - public $defaultResolvedStatus; - - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) { - $this->name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = [ - 'addSummary' => true,'colorByStatus' => false, - 'addReporter' => false, 'addHandler' => false ]; - - $this->defaultResolvedStatus = []; - $this->defaultResolvedStatus[] = ['code' => 1, 'verbose' => 'queue']; - $this->defaultResolvedStatus[] = ['code' => 2, 'verbose' => 'in progress']; - $this->defaultResolvedStatus[] = ['code' => 3, 'verbose' => 'done']; - - $this->canSetReporter = true; - if( !$this->setCfg($config) ) { - return false; - } - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - /** - * - **/ - function completeCfg() { - $this->cfg->uribase = trim($this->cfg->uribase,"/"); - if(!property_exists($this->cfg, 'uricreate') ) { - $this->cfg->uricreate = $this->cfg->uribase; - } - - if( property_exists($this->cfg,'options') ) { - $option = get_object_vars($this->cfg->options); - foreach ($option as $name => $elem) { - $name = (string)$name; - $this->options[$name] = (string)$elem; - } - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() { - $processCatch = false; - - try { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $kaitenContext = [ - 'url' => (string)trim($this->cfg->uribase), - 'apikey' => (string)trim($this->cfg->apikey), - 'boardId' => (string)trim($this->cfg->boardid), - 'options' => $this->options ]; - - $tlContext = [ 'proxy' => config_get('proxy'), - 'cfg' => ['setcardowneremail' => - $this->cfg->setcardowneremail] ]; - $tlContext['cfg'] = (object)$tlContext['cfg']; - - $this->APIClient = new kaiten($kaitenContext,$tlContext); - // to undestand if connection is OK, I will ask for users. - try { - $items = $this->APIClient->getUsers(); - $this->connected = count($items) > 0 ? true : false; - unset($items); - } - catch(Exception $e) { - $processCatch = true; - } - } - catch(Exception $e) { - $processCatch = true; - } - - if($processCatch) { - $logDetails = ''; - foreach(['uribase'] as $v) { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() { - return $this->connected; - } - - /** - * - * - **/ - function buildViewBugURL($issueID) { - return $this->APIClient->getIssueURL($issueID); - } - - /** - * - * - **/ - public function getIssue($issueID) { - if (!$this->isConnected()) { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try { - $jsonObj = $this->APIClient->getIssue($issueID); - - if( !is_null($jsonObj) && is_object($jsonObj)) { - $conditionData = isset($this->conditionMap[$jsonObj->condition]) ? ' / '.$this->conditionMap[$jsonObj->condition] : ''; - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = (string)$jsonObj->state; - $issue->statusVerbose = $this->resolvedStatus->byCode[$issue->statusCode]; - $issue->statusHTMLString = "[{$issue->statusVerbose}{$conditionData}]"; - $issue->summary = $issue->summaryHTMLString = (string)$jsonObj->title; - $issue->isResolved = (int)$jsonObj->state == 3; - } - } - catch(Exception $e) { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->state : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) { - $state = $this->getIssueStatusCode($issueID); - if ($state) { - return $this->resolvedStatus->byCode[$state]; - } - return false; - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) { - if(($status_ok = $this->checkBugIDSyntax($issueID))) { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - /** - * - */ - function parseAddInfo($info) { - $result = [ 'descr' => $info, 'links' => [] ]; - - $pik = array('dl2tl' => lang_get('dl2tl'), - 'dl2tlpv' => lang_get('dl2tlpv')); - - $matches = array('dl2tl' => 0, 'dl2tlpv' => 0); - - foreach($pik as $ky => $vy ) { - preg_match('/^' . $vy . '(.+)$/imu', $info, $matches[$ky]); - if( count($matches[$ky]) > 1 ) { - $result['links'][] = [ - 'descr' => $vy, - 'url' => $matches[$ky][1] - ]; - } - } - - if (!empty($result['links'])) { - $result['descr'] = strstr($info, $result['links'][0]['descr'], true); - } - return $result; - } - - /** - * - */ - public function addIssue($summary,$moreInfo,$opt=null) { - $more = $this->parseAddInfo($moreInfo); - try { - $op = $this->APIClient->addIssue($summary, $more['descr'],$opt); - if(is_null($op)){ - throw new Exception("Error creating issue", 1); - } - - if (count($more['links']) > 0) { - $this->APIClient->addExternalLinks($op->id,$more['links']); - } - - $tags = null; - if (!empty($opt)) { - $tags = [ - ['name' => $opt->execContext['testplan_name']], - ['name' => $opt->execContext['build_name']] - ]; - } - if (null !== $tags) { - $this->APIClient->addTags($op->id,$tags); - } - - $ret = ['status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('kaiten_bug_created'), - $summary, (string)$op->board_id)]; - } - catch (Exception $e) { - $msg = "Create KAITEN Card FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; - } - return $ret; - } - - /** - * - */ - public function addNote($issueID,$noteText,$opt=null) { - $op = $this->APIClient->addNote($issueID, $noteText); - if(is_null($op)){ - throw new Exception("Error setting note", 1); - } - $ret = ['status_ok' => true, 'id' => (string)$op->iid, - 'msg' => sprintf(lang_get('kaiten_bug_comment'), - $op->body, $this->APIClient->projectId)]; - return $ret; - } - - /** - * - **/ - public static function getCfgTemplate() { - $tpl = "\n" . - "\n" . - "\n" . - "KAITEN API KEY\n" . - "https://company.kaiten.io\n" . - "BOARD IDENTIFICATOR\n" . - " \n" . - "0\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return true; - } - - + 'archived', + '3' => 'deleted' + ]; + + public $defaultResolvedStatus; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = [ + 'addSummary' => true, + 'colorByStatus' => false, + 'addReporter' => false, + 'addHandler' => false + ]; + + $this->defaultResolvedStatus = []; + $this->defaultResolvedStatus[] = [ + 'code' => 1, + 'verbose' => 'queue' + ]; + $this->defaultResolvedStatus[] = [ + 'code' => 2, + 'verbose' => 'in progress' + ]; + $this->defaultResolvedStatus[] = [ + 'code' => 3, + 'verbose' => 'done' + ]; + + $this->canSetReporter = true; + if (! $this->setCfg($config)) { + return false; + } + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + */ + private function completeCfg() + { + $this->cfg->uribase = trim($this->cfg->uribase, "/"); + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $this->cfg->uribase; + } + + if (property_exists($this->cfg, 'options')) { + $option = get_object_vars($this->cfg->options); + foreach ($option as $name => $elem) { + $name = (string) $name; + $this->options[$name] = (string) $elem; + } + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $kaitenContext = [ + 'url' => (string) trim($this->cfg->uribase), + 'apikey' => (string) trim($this->cfg->apikey), + 'boardId' => (string) trim($this->cfg->boardid), + 'options' => $this->options + ]; + + $tlContext = [ + 'proxy' => config_get('proxy'), + 'cfg' => [ + 'setcardowneremail' => $this->cfg->setcardowneremail + ] + ]; + $tlContext['cfg'] = (object) $tlContext['cfg']; + + $this->APIClient = new kaiten($kaitenContext, $tlContext); + // to undestand if connection is OK, I will ask for users. + try { + $items = $this->APIClient->getUsers(); + $this->connected = count($items) > 0 ? true : false; + unset($items); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach ([ + 'uribase' + ] as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function buildViewBugURL($issueID) + { + return $this->APIClient->getIssueURL($issueID); + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $jsonObj = $this->APIClient->getIssue($issueID); + + if (! is_null($jsonObj) && is_object($jsonObj)) { + $conditionData = isset($this->conditionMap[$jsonObj->condition]) ? ' / ' . + $this->conditionMap[$jsonObj->condition] : ''; + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = (string) $jsonObj->state; + $issue->statusVerbose = $this->resolvedStatus->byCode[$issue->statusCode]; + $issue->statusHTMLString = "[{$issue->statusVerbose}{$conditionData}]"; + $issue->summary = $issue->summaryHTMLString = (string) $jsonObj->title; + $issue->isResolved = (int) $jsonObj->state == 3; + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->state : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + $state = $this->getIssueStatusCode($issueID); + if ($state) { + return $this->resolvedStatus->byCode[$state]; + } + return false; + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + */ + private function parseAddInfo($info) + { + $result = [ + 'descr' => $info, + 'links' => [] + ]; + + $pik = array( + 'dl2tl' => lang_get('dl2tl'), + 'dl2tlpv' => lang_get('dl2tlpv') + ); + + $matches = array( + 'dl2tl' => 0, + 'dl2tlpv' => 0 + ); + + foreach ($pik as $ky => $vy) { + preg_match('/^' . $vy . '(.+)$/imu', $info, $matches[$ky]); + if (count($matches[$ky]) > 1) { + $result['links'][] = [ + 'descr' => $vy, + 'url' => $matches[$ky][1] + ]; + } + } + + if (! empty($result['links'])) { + $result['descr'] = strstr($info, $result['links'][0]['descr'], true); + } + return $result; + } + + /** + */ + public function addIssue($summary, $moreInfo, $opt = null) + { + $more = $this->parseAddInfo($moreInfo); + try { + $op = $this->APIClient->addIssue($summary, $more['descr'], $opt); + if (is_null($op)) { + throw new Exception("Error creating issue", 1); + } + + if (count($more['links']) > 0) { + $this->APIClient->addExternalLinks($op->id, $more['links']); + } + + $tags = null; + if (! empty($opt)) { + $tags = [ + [ + 'name' => $opt->execContext['testplan_name'] + ], + [ + 'name' => $opt->execContext['build_name'] + ] + ]; + } + if (null !== $tags) { + $this->APIClient->addTags($op->id, $tags); + } + + $ret = [ + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('kaiten_bug_created'), $summary, + (string) $op->board_id) + ]; + } catch (Exception $e) { + $msg = "Create KAITEN Card FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = [ + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg + ]; + } + return $ret; + } + + /** + */ + public function addNote($issueID, $noteText, $opt = null) + { + $op = $this->APIClient->addNote($issueID, $noteText); + if (is_null($op)) { + throw new Exception("Error setting note", 1); + } + return [ + 'status_ok' => true, + 'id' => (string) $op->iid, + 'msg' => sprintf(lang_get('kaiten_bug_comment'), $op->body, + $this->APIClient->projectId) + ]; + } + + /** + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "\n" . + "KAITEN API KEY\n" . + "https://company.kaiten.io\n" . + "BOARD IDENTIFICATOR\n" . + " \n" . + "0\n" . + "\n" . + "\n" . "\n" . "\n" . + "\n" . "\n" . + "\n" . "\n" . + "\n" . "\n" . + "\n" . "\n" . + "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return true; + } } diff --git a/lib/issuetrackerintegration/mantisdbInterface.class.php b/lib/issuetrackerintegration/mantisdbInterface.class.php index 814578156e..37ce99ddea 100644 --- a/lib/issuetrackerintegration/mantisdbInterface.class.php +++ b/lib/issuetrackerintegration/mantisdbInterface.class.php @@ -1,263 +1,247 @@ - 'new', - 20 => 'feedback', - 30 => 'acknowledged', - 40 => 'confirmed', - 50 => 'assigned', - 80 => 'resolved', - 90 => 'closed'); - - private $status_color = - array('new' => '#ffa0a0', # red, - 'feedback' => '#ff50a8', # purple - 'acknowledged' => '#ffd850', # orange - 'confirmed' => '#ffffb0', # yellow - 'assigned' => '#c8c8ff', # blue - 'resolved' => '#cceedd', # buish-green - 'closed' => '#e8e8e8'); # light gray - - var $defaultResolvedStatus; - - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - - parent::__construct($type,$config,$name); - if( !$this->isConnected() ) - { - return false; - } - - $this->interfaceViaDB = true; - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 80, - 'verbose' => 'resolved'); - $this->defaultResolvedStatus[] = array('code' => 90, - 'verbose' => 'closed'); - - $this->setResolvedStatusCfg(); - - $this->methodOpt['buildViewBugLink'] = - array('addSummary' => true, 'colorByStatus' => true); - - $this->guiCfg = array('use_decoration' => true); - if( property_exists($this->cfg, 'statuscfg') ) { - $this->setStatusCfg(); - } - } - - - /** - * Return the URL to the bugtracking page for viewing - * the bug with the given id. - * - * @param int id the bug id - * - * @return string returns a complete URL to view the bug - **/ - function buildViewBugURL($id) - { - return $this->cfg->uriview . urlencode($id); - } - - /** - * - **/ - function getIssue($id) - { - $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; - if (!$this->isConnected()) - { - return false; - } - $sql = "/* $debugMsg */ SELECT id,status,summary FROM mantis_bug_table " . - " WHERE id=" . intval($id); - - $rs = $this->dbConnection->fetchRowsIntoMap($sql,'id'); - $issue = null; - if( !is_null($rs) ) - { - $issueOnMantisDB = current($rs); - $issue = new stdClass(); - $issue->IDHTMLString = "{$id} : "; - $issue->summaryHTMLString = $issueOnMantisDB['summary']; - $issue->id = $issueOnMantisDB['id']; - $issue->summary = $issueOnMantisDB['summary']; - $issue->statusCode = $issueOnMantisDB['status']; - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - if( isset($this->code_status[$issue->statusCode]) ) - { - $issue->statusVerbose = $this->code_status[$issue->statusCode]; - } - else - { - // give info to user on Event Viewer - $msg = lang_get('MANTIS_status_not_configured'); - $msg = sprintf($msg,$issueOnMantisDB['status']); - logWarningEvent($msg,"MANTIS INTEGRATION"); - $issue->statusVerbose = 'custom_undefined_on_tl'; - } - - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->statusVerbose); - $issue->statusColor = isset($this->status_color[$issue->statusVerbose]) ? - $this->status_color[$issue->statusVerbose] : 'white'; - - } - return $issue; - } - - - - /** - * Returns the status of the bug with the given id - * this function is not directly called by TestLink. - * - * @return string returns the status of the given bug (if found in the db), or false else - **/ - function getBugStatus($id) - { - if (!$this->isConnected()) - { - return false; - } - $issue = $this->getIssue($id); - return (!is_null($issue) && $issue) ? $issue->statusVerbose : null; - } - - - /** - * checks is bug id is present on BTS - * - * @return integer returns 1 if the bug with the given id exists - **/ - function checkBugIDExistence($id) - { - $status_ok = 0; - $query = "SELECT status FROM mantis_bug_table WHERE id='" . $id ."'"; - $result = $this->dbConnection->exec_query($query); - if ($result && ($this->dbConnection->num_rows($result) == 1)) - { - $status_ok = 1; - } - return $status_ok; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * - * - **/ - function buildStatusHTMLString($statusVerbose) - { - $str = ''; - if ($statusVerbose !== false) - { - // status values depends on your mantis configuration at config_inc.php in $g_status_enum_string, - // below is the default: - //'10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed' - // With this replace if user configure status on mantis with blank we do not have problems - // - $tlStatus = str_replace(" ", "_", $statusVerbose); - $str = lang_get('issue_status_' . $tlStatus); - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - } - return $str; - } - - - function getMyInterface() - { - return $this->cfg->interfacePHP; - } - - - - public static function getCfgTemplate() - { - - $template = "\n" . - "\n" . - "DATABASE SERVER NAME\n" . - "DATABASE NAME\n" . - "mysql\n" . - "USER\n" . - "PASSWORD\n" . - "http://localhost:8080/development/mantisbt-1.2.5/view.php?id=\n" . - "http://localhost:8080/development/mantisbt-1.2.5/\n" . - "\n" . - "\n" . - "10new#ffa0a0\n" . - "20feedback#ff50a8\n" . - "30acknowledged#ffd850\n" . - "40confirmed#ffffb0\n" . - "50assigned#c8c8ff\n" . - "80resolved#cceedd\n" . - "90closed#e8e8e8\n" . - "\n" . - "\n" . - "\n" . - "80resolved\n" . - "90closed\n" . - "\n" . - "\n"; - "\n"; - return $template; - } - - public function setStatusCfg() - { - $statusCfg = (array)$this->cfg->statuscfg; - foreach($statusCfg['status'] as $cfx) - { - $e = (array)$cfx; - $this->code_status[$e['code']] = $e['verbose']; - $this->status_color[$e['verbose']] = $e['color']; - } - } - - - public function getCodeStatus() - { - return $this->code_status; - } - - public function getStatusColor() - { - return $this->status_color; - } - -} -?> \ No newline at end of file + 'new', + 20 => 'feedback', + 30 => 'acknowledged', + 40 => 'confirmed', + 50 => 'assigned', + 80 => 'resolved', + 90 => 'closed' + ); + + private $status_color = array( + 'new' => '#ffa0a0', # red, + 'feedback' => '#ff50a8', # purple + 'acknowledged' => '#ffd850', # orange + 'confirmed' => '#ffffb0', # yellow + 'assigned' => '#c8c8ff', # blue + 'resolved' => '#cceedd', # buish-green + 'closed' => '#e8e8e8' + ); + + # light gray + public $defaultResolvedStatus; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + parent::__construct($type, $config, $name); + if (! $this->isConnected()) { + return false; + } + + $this->interfaceViaDB = true; + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 80, + 'verbose' => 'resolved' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 90, + 'verbose' => 'closed' + ); + + $this->setResolvedStatusCfg(); + + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => true + ); + + $this->guiCfg = array( + 'use_decoration' => true + ); + if (property_exists($this->cfg, 'statuscfg')) { + $this->setStatusCfg(); + } + } + + /** + * Return the URL to the bugtracking page for viewing + * the bug with the given id. + * + * @param + * int id the bug id + * @return string returns a complete URL to view the bug + */ + public function buildViewBugURL($id) + { + return $this->cfg->uriview . urlencode($id); + } + + /** + */ + public function getIssue($id) + { + $debugMsg = 'Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__; + if (! $this->isConnected()) { + return false; + } + $sql = "/* $debugMsg */ SELECT id,status,summary FROM mantis_bug_table " . + " WHERE id=" . intval($id); + + $rs = $this->dbConnection->fetchRowsIntoMap($sql, 'id'); + $issue = null; + if (! is_null($rs)) { + $issueOnMantisDB = current($rs); + $issue = new stdClass(); + $issue->IDHTMLString = "{$id} : "; + $issue->summaryHTMLString = $issueOnMantisDB['summary']; + $issue->id = $issueOnMantisDB['id']; + $issue->summary = $issueOnMantisDB['summary']; + $issue->statusCode = $issueOnMantisDB['status']; + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + + if (isset($this->code_status[$issue->statusCode])) { + $issue->statusVerbose = $this->code_status[$issue->statusCode]; + } else { + // give info to user on Event Viewer + $msg = lang_get('MANTIS_status_not_configured'); + $msg = sprintf($msg, $issueOnMantisDB['status']); + logWarningEvent($msg, "MANTIS INTEGRATION"); + $issue->statusVerbose = 'custom_undefined_on_tl'; + } + + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->statusVerbose); + $issue->statusColor = isset( + $this->status_color[$issue->statusVerbose]) ? $this->status_color[$issue->statusVerbose] : 'white'; + } + return $issue; + } + + /** + * Returns the status of the bug with the given id + * this function is not directly called by TestLink. + * + * @return string returns the status of the given bug (if found in the db), or false else + */ + public function getBugStatus($id) + { + if (! $this->isConnected()) { + return false; + } + $issue = $this->getIssue($id); + return (! is_null($issue) && $issue) ? $issue->statusVerbose : null; + } + + /** + * checks is bug id is present on BTS + * + * @return integer returns 1 if the bug with the given id exists + */ + public function checkBugIDExistence($id) + { + $status_ok = 0; + $query = "SELECT status FROM mantis_bug_table WHERE id='" . $id . "'"; + $result = $this->dbConnection->exec_query($query); + if ($result && ($this->dbConnection->num_rows($result) == 1)) { + $status_ok = 1; + } + return $status_ok; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + */ + private function buildStatusHTMLString($statusVerbose) + { + $str = ''; + if ($statusVerbose !== false) { + // status values depends on your mantis configuration at config_inc.php in $g_status_enum_string, + // below is the default: + // '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed' + // With this replace if user configure status on mantis with blank we do not have problems + // + $tlStatus = str_replace(" ", "_", $statusVerbose); + $str = lang_get('issue_status_' . $tlStatus); + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + } + return $str; + } + + public function getMyInterface() + { + return $this->cfg->interfacePHP; + } + + public static function getCfgTemplate() + { + return "\n" . "\n" . + "DATABASE SERVER NAME\n" . + "DATABASE NAME\n" . "mysql\n" . + "USER\n" . "PASSWORD\n" . + "http://localhost:8080/development/mantisbt-1.2.5/view.php?id=\n" . + "http://localhost:8080/development/mantisbt-1.2.5/\n" . + "\n" . "\n" . + "10new#ffa0a0\n" . + "20feedback#ff50a8\n" . + "30acknowledged#ffd850\n" . + "40confirmed#ffffb0\n" . + "50assigned#c8c8ff\n" . + "80resolved#cceedd\n" . + "90closed#e8e8e8\n" . + "\n" . + "\n" . + "\n" . + "80resolved\n" . + "90closed\n" . + "\n" . "\n"; + } + + public function setStatusCfg() + { + $statusCfg = (array) $this->cfg->statuscfg; + foreach ($statusCfg['status'] as $cfx) { + $e = (array) $cfx; + $this->code_status[$e['code']] = $e['verbose']; + $this->status_color[$e['verbose']] = $e['color']; + } + } + + public function getCodeStatus() + { + return $this->code_status; + } + + public function getStatusColor() + { + return $this->status_color; + } +} +?> diff --git a/lib/issuetrackerintegration/mantisrestInterface.class.php b/lib/issuetrackerintegration/mantisrestInterface.class.php index c5d2fde605..540e2dce3b 100644 --- a/lib/issuetrackerintegration/mantisrestInterface.class.php +++ b/lib/issuetrackerintegration/mantisrestInterface.class.php @@ -1,466 +1,483 @@ - '#ffa0a0', # red, - 'feedback' => '#ff50a8', # purple - 'acknowledged' => '#ffd850', # orange - 'confirmed' => '#ffffb0', # yellow - 'assigned' => '#c8c8ff', # blue - 'resolved' => '#cceedd', # buish-green - 'closed' => '#e8e8e8'); # light gray - - public $defaultResolvedStatus; - - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) { - $this->name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = [ - 'addSummary' => true, - 'addReporter' => true, - 'addHandler' => true, - 'colorByStatus' => false - ]; - - - $this->defaultResolvedStatus = [ - [ - 'code' => 80, - 'verbose' => 'resolved' - ], - [ - 'code' => 90, - 'verbose' => 'closed' - ] - ]; - - $this->canSetReporter = true; - if( !$this->setCfg($config) ) { - return false; - } - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - /** - * - **/ - function completeCfg() { - $this->cfg->uribase = trim($this->cfg->uribase,"/"); - if(!property_exists($this->cfg, 'uricreate') ) { - $this->cfg->uricreate = $this->cfg->uribase; - } - - if (!property_exists($this->cfg,'uriview')) { - $this->cfg->uriview = $this->cfg->uribase . '/view.php?id='; - } - - if( property_exists($this->cfg,'options') ) { - $option = get_object_vars($this->cfg->options); - foreach ($option as $name => $elem) { - $name = (string)$name; - $this->options[$name] = (string)$elem; - } - } - - if( !property_exists($this->cfg,'userinteraction') ) { - $this->cfg->userinteraction = 0; - } - - if( !property_exists($this->cfg,'createissueviaapi') ) { - $this->cfg->createissueviaapi = 0; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() { - $processCatch = false; - - try { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $context = [ - 'url' => (string)trim($this->cfg->uribase), - 'apikey' => (string)trim($this->cfg->apikey) ]; - - $tlContext = [ 'proxy' => config_get('proxy') ]; - - $this->APIClient = new mantis($context,$tlContext); - - // to undestand if connection is OK, I will ask for users. - try { - $ValarMorghulis = $this->APIClient->getMyUserInfo(); - $this->connected = !is_null($ValarMorghulis); - } - catch(Exception $e) { - $processCatch = true; - } - } - catch(Exception $e) { - $processCatch = true; - } - - if($processCatch) { - $logDetails = ''; - foreach(['uribase'] as $v) { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() { - return $this->connected; - } - - /** - * Return the URL to the bugtracking page for viewing - * the bug with the given id. - * - * @param int id the bug id - * - * @return string returns a complete URL to view the bug - **/ - function buildViewBugURL($id) - { - return (string)($this->cfg->uriview . urlencode($id)); - } - - /** - * - * - **/ - public function getIssue($issueID) { - if (!$this->isConnected()) { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try { - $jsonObj = $this->APIClient->getIssue($issueID); - - if( !is_null($jsonObj) && is_object($jsonObj)) { - - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - - if (property_exists($jsonObj,'exception')) { - $issue->summary = (string)$jsonObj->reason; - $issue->summaryHTMLString = $issue->summary; - return $issue; - } - - // Normal processing - $item = $jsonObj->issues; - $item = $item[0]; - - $issue->statusCode = intval($item->status->id); - $issue->statusVerbose = (string)$item->status->label; - $issue->statusHTMLString = "[{$issue->statusVerbose}]"; - $issue->summary = $issue->summaryHTMLString = (string)$item->summary; - - // Actors - Begin - $issue->reportedBy = (string)$item->reporter->real_name; - - // Attention: when issue has not handler yet, property does not exist - $issue->handledBy = ''; - if (property_exists($item,'handler')) { - $issue->handledBy = (string)$item->handler->real_name; - } - // Actors - End - - - $cond = [ - 'version' => 'name', - 'fixed_in_version' => 'name', - 'target_version' => 'name' - ]; - $trans = [ - 'version' => 'version', - 'fixed_in_version' => 'fixedInVersion', - 'target_version' => 'targetVersion' - ]; - - foreach ($cond as $prop => $wtg) { - $ip = $trans[$prop]; - $issue->$ip = null; - if ( property_exists($item, $prop)) { - $issue->$ip = (string)$item->$prop->$wtg; - } - } - - $issue->isResolved = false; - } - } - catch(Exception $e) { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->state : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) { - $state = $this->getIssueStatusCode($issueID); - if ($state) { - return $this->resolvedStatus->byCode[$state]; - } - return false; - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) { - if(($status_ok = $this->checkBugIDSyntax($issueID))) { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - /** - * - */ - /* NOT IMPLEMENTED YET 20211130 - public function addIssue($summary,$moreInfo,$opt=null) { - $more = $moreInfo; - try { - $op = $this->APIClient->addIssue($summary, $more['descr'],$opt); - if(is_null($op)){ - throw new Exception("Error creating issue", 1); - } - - if (count($more['links']) > 0) { - $this->APIClient->addExternalLinks($op->id,$more['links']); - } - - $ret = ['status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('mantis_bug_created'), - $summary, (string)$op->board_id)]; - } - catch (Exception $e) { - $msg = "Create Mantis Issue Via REST FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; - } - return $ret; - } - */ - - /** - * - */ - - /* NOT IMPLEMENTED YET 20211130 - public function addNote($issueID,$noteText,$opt=null) { - $op = $this->APIClient->addNote($issueID, $noteText); - if(is_null($op)){ - throw new Exception("Error setting note", 1); - } - $ret = ['status_ok' => true, 'id' => (string)$op->iid, - 'msg' => sprintf(lang_get('mantis_bug_comment'), - $op->body, $this->APIClient->projectId)]; - return $ret; - } - */ - - - /** - * - * link->testCaseID - * link->testCaseName - * link->relation (verbose) - * - */ - public function addLink($issueID,$link) { - try { - $op = $this->APIClient->addLink($issueID,$link); - if(is_null($op)){ - throw new Exception("Error creating link", 1); - } - $ret = ['status_ok' => true, 'id' => (string)$op->id, - 'msg' => 'ok']; - $msg = "Create Mantis Link Via REST OK => TICKET:" . $issueID . ' >> link: ' . json_encode($link); - tLog($msg, 'WARNING'); - } - catch (Exception $e) { - $msg = "Create Mantis Link Via REST FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - - $msg = "Create Mantis Link Via REST FAILURE => TICKET -> " . $issueID . ' >> link: ' . json_encode($link); - tLog($msg, 'WARNING'); - - $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; - } - return $ret; - } - - /** - * - * link->testCaseID - * - */ - public function removeLink($issueID,$link) { - try { - $op = $this->APIClient->removeLink($issueID,$link); - if(is_null($op)){ - throw new Exception("Error removing link", 1); - } - $ret = ['status_ok' => true, 'id' => (string)$op->id, - 'msg' => 'ok']; - } - catch (Exception $e) { - $msg = "Remove Mantis Link Via REST FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; - } - return $ret; - } - - /** - * - * link->testCaseID - * link->testCaseName - * link->relation (verbose) - * link->testPlanName": "TPLAN_A", - * link->buildName": "BUILD 1", - * link->platformName": "", - * link->tester": "Mauro", - * link->execStatus": "Passed", - * link->timeStamp": "20200101-23:00" - * - */ - public function addExecLink($issueID,$link) { - try { - $op = $this->APIClient->addExecLink($issueID,$link); - /* if(is_null($op)){ - throw new Exception("Error creating exec link", 1); - }*/ - $ret = ['status_ok' => true, 'msg' => 'ok']; - } - catch (Exception $e) { - $msg = "Create Mantis Exec Link Via REST FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; - } - return $ret; - } - - - /** - * - **/ - public static function getCfgTemplate() { - $tpl = "\n" . - "\n" . - "\n" . - "API KEY\n" . - "https://www.mantisbt.org/\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "https://www.mantisbt.org/view.php?id=\n" . - "https://www.mantisbt.org/\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return true; - } + '#ffa0a0', # red, + 'feedback' => '#ff50a8', # purple + 'acknowledged' => '#ffd850', # orange + 'confirmed' => '#ffffb0', # yellow + 'assigned' => '#c8c8ff', # blue + 'resolved' => '#cceedd', # buish-green + 'closed' => '#e8e8e8' + ); + + # light gray + public $defaultResolvedStatus; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = [ + 'addSummary' => true, + 'addReporter' => true, + 'addHandler' => true, + 'colorByStatus' => false + ]; + + $this->defaultResolvedStatus = [ + [ + 'code' => 80, + 'verbose' => 'resolved' + ], + [ + 'code' => 90, + 'verbose' => 'closed' + ] + ]; + + $this->canSetReporter = true; + if (! $this->setCfg($config)) { + return false; + } + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + */ + private function completeCfg() + { + $this->cfg->uribase = trim($this->cfg->uribase, "/"); + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $this->cfg->uribase; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $this->cfg->uribase . '/view.php?id='; + } + + if (property_exists($this->cfg, 'options')) { + $option = get_object_vars($this->cfg->options); + foreach ($option as $name => $elem) { + $name = (string) $name; + $this->options[$name] = (string) $elem; + } + } + + if (! property_exists($this->cfg, 'userinteraction')) { + $this->cfg->userinteraction = 0; + } + + if (! property_exists($this->cfg, 'createissueviaapi')) { + $this->cfg->createissueviaapi = 0; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $context = [ + 'url' => (string) trim($this->cfg->uribase), + 'apikey' => (string) trim($this->cfg->apikey) + ]; + + $tlContext = [ + 'proxy' => config_get('proxy') + ]; + + $this->APIClient = new mantis($context, $tlContext); + + // to undestand if connection is OK, I will ask for users. + try { + $valarMorghulis = $this->APIClient->getMyUserInfo(); + $this->connected = ! is_null($valarMorghulis); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach ([ + 'uribase' + ] as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + * Return the URL to the bugtracking page for viewing + * the bug with the given id. + * + * @param + * int id the bug id + * @return string returns a complete URL to view the bug + */ + public function buildViewBugURL($id) + { + return (string) ($this->cfg->uriview . urlencode($id)); + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $jsonObj = $this->APIClient->getIssue($issueID); + + if (! is_null($jsonObj) && is_object($jsonObj)) { + + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + + if (property_exists($jsonObj, 'exception')) { + $issue->summary = (string) $jsonObj->reason; + $issue->summaryHTMLString = $issue->summary; + return $issue; + } + + // Normal processing + $item = $jsonObj->issues; + $item = $item[0]; + + $issue->statusCode = intval($item->status->id); + $issue->statusVerbose = (string) $item->status->label; + $issue->statusHTMLString = "[{$issue->statusVerbose}]"; + $issue->summary = $issue->summaryHTMLString = (string) $item->summary; + + // Actors - Begin + $issue->reportedBy = (string) $item->reporter->real_name; + + // Attention: when issue has not handler yet, property does not exist + $issue->handledBy = ''; + if (property_exists($item, 'handler')) { + $issue->handledBy = (string) $item->handler->real_name; + } + // Actors - End + + $cond = [ + 'version' => 'name', + 'fixed_in_version' => 'name', + 'target_version' => 'name' + ]; + $trans = [ + 'version' => 'version', + 'fixed_in_version' => 'fixedInVersion', + 'target_version' => 'targetVersion' + ]; + + foreach ($cond as $prop => $wtg) { + $ip = $trans[$prop]; + $issue->$ip = null; + if (property_exists($item, $prop)) { + $issue->$ip = (string) $item->$prop->$wtg; + } + } + + $issue->isResolved = false; + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->state : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + $state = $this->getIssueStatusCode($issueID); + if ($state) { + return $this->resolvedStatus->byCode[$state]; + } + return false; + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + */ + /* + * NOT IMPLEMENTED YET 20211130 + * public function addIssue($summary,$moreInfo,$opt=null) { + * $more = $moreInfo; + * try { + * $op = $this->APIClient->addIssue($summary, $more['descr'],$opt); + * if(is_null($op)){ + * throw new Exception("Error creating issue", 1); + * } + * + * if (count($more['links']) > 0) { + * $this->APIClient->addExternalLinks($op->id,$more['links']); + * } + * + * $ret = ['status_ok' => true, 'id' => (string)$op->id, + * 'msg' => sprintf(lang_get('mantis_bug_created'), + * $summary, (string)$op->board_id)]; + * } + * catch (Exception $e) { + * $msg = "Create Mantis Issue Via REST FAILURE => " . $e->getMessage(); + * tLog($msg, 'WARNING'); + * $ret = ['status_ok' => false, 'id' => -1, 'msg' => $msg]; + * } + * return $ret; + * } + */ + + /** + */ + + /* + * NOT IMPLEMENTED YET 20211130 + * public function addNote($issueID,$noteText,$opt=null) { + * $op = $this->APIClient->addNote($issueID, $noteText); + * if(is_null($op)){ + * throw new Exception("Error setting note", 1); + * } + * $ret = ['status_ok' => true, 'id' => (string)$op->iid, + * 'msg' => sprintf(lang_get('mantis_bug_comment'), + * $op->body, $this->APIClient->projectId)]; + * return $ret; + * } + */ + + /** + * link->testCaseID + * link->testCaseName + * link->relation (verbose) + */ + public function addLink($issueID, $link) + { + try { + $op = $this->APIClient->addLink($issueID, $link); + if (is_null($op)) { + throw new Exception("Error creating link", 1); + } + $ret = [ + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => 'ok' + ]; + $msg = "Create Mantis Link Via REST OK => TICKET:" . $issueID . + ' >> link: ' . json_encode($link); + tLog($msg, 'WARNING'); + } catch (Exception $e) { + $msg = "Create Mantis Link Via REST FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + + $msg = "Create Mantis Link Via REST FAILURE => TICKET -> " . $issueID . + ' >> link: ' . json_encode($link); + tLog($msg, 'WARNING'); + + $ret = [ + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg + ]; + } + return $ret; + } + + /** + * link->testCaseID + */ + public function removeLink($issueID, $link) + { + try { + $op = $this->APIClient->removeLink($issueID, $link); + if (is_null($op)) { + throw new Exception("Error removing link", 1); + } + $ret = [ + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => 'ok' + ]; + } catch (Exception $e) { + $msg = "Remove Mantis Link Via REST FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = [ + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg + ]; + } + return $ret; + } + + /** + * link->testCaseID + * link->testCaseName + * link->relation (verbose) + * link->testPlanName": "TPLAN_A", + * link->buildName": "BUILD 1", + * link->platformName": "", + * link->tester": "Mauro", + * link->execStatus": "Passed", + * link->timeStamp": "20200101-23:00" + */ + public function addExecLink($issueID, $link) + { + try { + $this->APIClient->addExecLink($issueID, $link); + $ret = [ + 'status_ok' => true, + 'msg' => 'ok' + ]; + } catch (Exception $e) { + $msg = "Create Mantis Exec Link Via REST FAILURE => " . + $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = [ + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg + ]; + } + return $ret; + } + + /** + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "\n" . "API KEY\n" . + "https://www.mantisbt.org/\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "https://www.mantisbt.org/view.php?id=\n" . + "https://www.mantisbt.org/\n" . + "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return true; + } } diff --git a/lib/issuetrackerintegration/mantissoapInterface.class.php b/lib/issuetrackerintegration/mantissoapInterface.class.php index 783e5a8285..786aa1c1d3 100644 --- a/lib/issuetrackerintegration/mantissoapInterface.class.php +++ b/lib/issuetrackerintegration/mantissoapInterface.class.php @@ -1,568 +1,554 @@ - '#ffa0a0', # red, - 'feedback' => '#ff50a8', # purple - 'acknowledged' => '#ffd850', # orange - 'confirmed' => '#ffffb0', # yellow - 'assigned' => '#c8c8ff', # blue - 'resolved' => '#cceedd', # buish-green - 'closed' => '#e8e8e8'); # light gray - - - private $soapOpt = array("connection_timeout" => 1, 'exceptions' => 1); - - var $defaultResolvedStatus; - - // field is nvarchar(128) at least on 1.2.14 - var $summaryLengthLimit = 120; - - /** - * Construct and connect to BTS. - * - * @param str $type (see tlIssueTracker.class.php $systems property) - * @param xml $cfg - **/ - function __construct($type,$config,$name) - { - $this->name = $name; - $this->interfaceViaDB = false; - - $this->methodOpt['buildViewBugLink'] = - array('addSummary' => true, 'colorByStatus' => true, - 'addReporter' => true, 'addHandler' => true); - - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 80, 'verbose' => 'resolved'); - $this->defaultResolvedStatus[] = array('code' => 90, 'verbose' => 'closed'); - - if( $this->setCfg($config) ) - { - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - $this->guiCfg = array('use_decoration' => true); - } - } - - - /** - * Return the URL to the bugtracking page for viewing - * the bug with the given id. - * - * @param int id the bug id - * - * @return string returns a complete URL to view the bug - **/ - function buildViewBugURL($id) - { - return (string)($this->cfg->uriview . urlencode($id)); - } - - - /** - * establishes the soap connection to the bugtracking system - * - * @return bool returns true if the soap connection was established and the - * wsdl could be downloaded, false else - * - **/ - function connect() - { - $op = $this->getClient(array('log' => true)); - if( ($this->connected = $op['connected']) ) - { - // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need - // to do a simple call with user/password only to understand if we are really connected - try { - $x = $op['client']->mc_enum_status($this->cfg->username,$this->cfg->password); - } catch (SoapFault $f) { - $this->connected = false; - tLog("SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})","ERROR"); - } - } - return $this->connected; - } - - - /** - * - * - **/ - function getClient($opt=null) - { - // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work - $res = array('client' => null, 'connected' => false, 'msg' => 'generic ko'); - $my['opt'] = array('log' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - try - { - // IMPORTANT NOTICE - // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL - // DO CAST any member before using it. - // If we do following call WITHOUT (string) CAST, SoapClient() fails - // complaining '... wsdl has to be an STRING or null ...' - $res['client'] = new SoapClient((string)$this->cfg->uriwsdl,$this->soapOpt); - - // debug trying to use proxy (20140409) - // $res['client'] = new SoapClient('/tmp/mantisconnect.php.wsdl',$this->soapOpt); - - $res['connected'] = true; - $res['msg'] = 'iupi!!!'; - } - catch (SoapFault $f) - { - $res['connected'] = false; - $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; - if($my['opt']['log']) - { - tLog("SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})","ERROR"); - } - } - return $res; - } - - /** - * checks is bug id is present on BTS - * - * @return integer returns 1 if the bug with the given id exists - **/ - function checkBugIDExistence($id) - { - static $client; - - if (!$this->isConnected()) - { - return 0; // >>>---> bye! - } - - if(is_null($client)) - { - $dummy = $this->getClient(); - $client = $dummy['client']; - } - - $status_ok = 0; - - $safe = new stdClass(); - $safe->username = (string)$this->cfg->username; - $safe->password = (string)$this->cfg->password; - $safe->id = intval($id); - - try - { - $status_ok = $client->mc_issue_exists($safe->username,$safe->password,$safe->id) ? 1 : 0; - } - catch (SoapFault $f) - { - // from http://www.w3schools.com/soap/soap_fault.asp - // VersionMismatch - Found an invalid namespace for the SOAP Envelope element - // MustUnderstand - An immediate child element of the Header element, - // with the mustUnderstand attribute set to "1", was not understood - // Client - The message was incorrectly formed or contained incorrect information - // Server - There was a problem with the server so the message ... - - // @Å¢ODO - 20120106 - need to think how to manage this situation in a better way - } - return $status_ok; - } - - - /** - * - * - * - * - **/ - function getIssue($id) - { - static $client; - - if (!$this->isConnected()) - { - return false; - } - - if(is_null($client)) - { - $dummy = $this->getClient(); - $client = $dummy['client']; - } - - $status = false; - $issue = null; - try - { - $safe = new stdClass(); - $safe->username = (string)$this->cfg->username; - $safe->password = (string)$this->cfg->password; - $safe->id = intval($id); - - - if($client->mc_issue_exists($safe->username,$safe->password,$safe->id)) - { - $issue = $client->mc_issue_get($safe->username,$safe->password,$safe->id); - if( !is_null($issue) && is_object($issue) ) { - $issue->IDHTMLString = "{$id} : "; - $issue->statusCode = $issue->status->id; - $issue->statusVerbose = $issue->status->name; - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->statusVerbose); - $issue->statusColor = isset($this->status_color[$issue->statusVerbose]) ? - $this->status_color[$issue->statusVerbose] : 'white'; - - $issue->summaryHTMLString = $issue->summary; - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - - $issue->reportedBy = (string)$issue->reporter->name; - $issue->handledBy = (string)$issue->handler->name; - } - } - } - catch (SoapFault $f) - { - // from http://www.w3schools.com/soap/soap_fault.asp - // VersionMismatch - Found an invalid namespace for the SOAP Envelope element - // MustUnderstand - An immediate child element of the Header element, - // with the mustUnderstand attribute set to "1", was not understood - // Client - The message was incorrectly formed or contained incorrect information - // Server - There was a problem with the server so the message ... - - // @Å¢ODO - 20120106 - need to think how to manage this situation in a better way - } - return $issue; - } - - - /** - * - * - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - * - * - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "MANTIS LOGIN NAME\n" . - "MANTIS PASSWORD\n" . - "http://www.mantisbt.org/\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "http://www.mantisbt.org/api/soap/mantisconnect.php?wsdl\n" . - "http://www.mantisbt.org/view.php?id=\n" . - "http://www.mantisbt.org/\n" . - "\n" . - "MANTIS PROJECT NAME\n" . - "MANTIS CATEGORY NAME\n" . - "\n" . - "\n" . - "80resolved\n" . - "90closed\n" . - "\n" . - "\n"; - return $template; - } - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/' ; - if( !property_exists($this->cfg,'uriwsdl') ) - { - $this->cfg->uriwsdl = $base . 'api/soap/mantisconnect.php?wsdl'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'view.php?id='; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base; - } - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - - - /** - * - * - **/ - function buildStatusHTMLString($statusVerbose) - { - $str = ''; - if ($statusVerbose !== false) - { - // status values depends on your mantis configuration at config_inc.php in $g_status_enum_string, - // below is the default: - //'10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed' - // With this replace if user configure status on mantis with blank we do not have problems - // - $tlStatus = str_replace(" ", "_", $statusVerbose); - $str = lang_get('issue_status_' . $tlStatus); - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - } - return $str; - } - - public function setStatusCfg() - { - $statusCfg = (array)$this->cfg->statuscfg; - foreach($statusCfg['status'] as $cfx) - { - $e = (array)$cfx; - $this->status_color[$e['verbose']] = $e['color']; - } - } - - - public function getCodeStatus() - { - return $this->code_status; - } - - public function getStatusColor() - { - return $this->status_color; - } - - public static function checkEnv() - { - $ret = array(); - $ret['status'] = extension_loaded('soap'); - $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; - return $ret; - } - - - /** - * - * from mantisconnect.php - * - * ### AccountData - * $l_oServer->wsdl->addComplexType('AccountData','complexType','struct','all','', - * array( 'id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0'), - * 'name' => array( 'name' => 'name', 'type' => 'xsd:string', 'minOccurs' => '0'), - * 'real_name' => array( 'name' => 'real_name', 'type' => 'xsd:string', 'minOccurs' => '0'), - * 'email' => array( 'name' => 'email', 'type' => 'xsd:string', 'minOccurs' => '0') - * - * - * From IssueData I want to have the example for project to understand what data structure I need to use - * - * ### IssueData - * $l_oServer->wsdl->addComplexType('IssueData','complexType','struct','all','', - * array('id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0' ), - * 'view_state' => array( 'name' => 'view_state', 'type' => 'tns:ObjectRef', 'minOccurs' => '0' ), - * 'last_updated' => array( 'name' => 'last_updated', 'type' => 'xsd:dateTime', 'minOccurs' => '0' ), - * 'project' => array( 'name' => 'project', 'type' => 'tns:ObjectRef', 'minOccurs' => '0' ), - * - * - * ### ObjectRef - * $l_oServer->wsdl->addComplexType('ObjectRef','complexType','struct','all','', - * array('id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0'), - * 'name' => array( 'name' => 'name', 'type' => 'xsd:string', 'minOccurs' => '0') - * - */ - public function addIssue($summary,$description,$opt=null) - { - static $client; - $ret = array('status_ok' => false, 'id' => -1,'msg' => ''); - if (!$this->isConnected()) - { - return $ret; - } - - if(is_null($client)) - { - $dummy = $this->getClient(); - $client = $dummy['client']; - } - $safe = new stdClass(); - $safe->username = (string)$this->cfg->username; - $safe->password = (string)$this->cfg->password; - $safe->project = (string)$this->cfg->project; - - $mpid = $client->mc_project_get_id_from_name($safe->username,$safe->password,$safe->project); - if( $mpid > 0) - { - - $safeSummary = (strlen($summary) > $this->summaryLengthLimit) ? '...' . substr($summary, -($this->summaryLengthLimit)) : $summary; - $issue = array('summary' => $safeSummary,'description' => $description,'project' => array('id' => $mpid)); - - // check category - $nameCode = $client->mc_project_get_categories($safe->username,$safe->password,$mpid); - $codeName = array_flip($nameCode); - - $categoryName = (property_exists($this->cfg,'category')) ? (string)$this->cfg->category : null; - $issue['category'] = (is_null($categoryName) || !isset($codeName[$categoryName])) ? current($nameCode) : $categoryName; - - // user tester as Reporter - if(!is_null($opt)) - { - if(property_exists($opt, 'reporter')) - { - $issue['reporter'] = array('name' => $opt->reporter); - } - } - - - // because issue id on TestLink is considered a string, - // in order to make work ORDER BY, I will format it adding 0 to left as done on Mantis GUI - // example: 6845 => 0006845 - $ret['id'] = $client->mc_issue_add($safe->username,$safe->password,$issue); - $ret['id'] = sprintf('%07u',$ret['id']); - - $ret['status_ok'] = true; - $ret['msg'] = sprintf(lang_get('mantis_bug_created'), $ret['id'],$safeSummary,$safe->project); - } - else - { - $ret['msg'] = sprintf(lang_get('bts_project_does_not_exist'),(string)$this->cfg->project); - } - return $ret; - } - - - /** - * - * Mantis API Call mc_issue_note_addR - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - */ - public function addNote($issueID,$noteText,$opt=null) { - - static $client; - $ret = array('status_ok' => false,'msg' => '', 'note_id' => -1); - if (!$this->isConnected()) { - $ret = array('status_ok' => false,'msg' => 'Connection KO', 'note_id' => -1); - return $ret; - } - - if(is_null($client)) { - $dummy = $this->getClient(); - $client = $dummy['client']; - } - - $safe = new stdClass(); - $safe->username = (string)$this->cfg->username; - $safe->password = (string)$this->cfg->password; - $safe->issueID = intval($issueID); - - - if($client->mc_issue_exists($safe->username,$safe->password,$safe->issueID)) { - - $issueNoteData = array('text' => $noteText); - if(!is_null($opt)) { - if(property_exists($opt, 'reporter')) { - $issueNoteData['reporter'] = array('name' => $opt->reporter); - } - } - - try { - $ret['note_id'] = - $client->mc_issue_note_add($safe->username,$safe->password, - $safe->issueID,$issueNoteData); - } catch (SoapFault $f) { - // "User id missing"; - // Have found no way to check code, then will check message - // MantisBT send messages only on English - $faultMsg = $f->getMessage(); - - switch( $faultMsg ) { - case "User id missing": - $ret['msg'] = - "Cannot create note, using TestLink logged user: " . - $issueNoteData['reporter']['name']; - break; - - default: - $ret['msg'] = - "Cannot create note, MantisBT message: $faultMsg"; - break; - } - } - } - else { - $ret['msg'] = "issue $safe->issueID does not exist"; - } - - return $ret; - } - - - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'project') && property_exists($this->cfg, 'category')); - } - - -} \ No newline at end of file + '#ffa0a0', # red, + 'feedback' => '#ff50a8', # purple + 'acknowledged' => '#ffd850', # orange + 'confirmed' => '#ffffb0', # yellow + 'assigned' => '#c8c8ff', # blue + 'resolved' => '#cceedd', # buish-green + 'closed' => '#e8e8e8' + ); + + # light gray + private $soapOpt = array( + "connection_timeout" => 1, + 'exceptions' => 1 + ); + + public $defaultResolvedStatus; + + // field is nvarchar(128) at least on 1.2.14 + private $summaryLengthLimit = 120; + + /** + * Construct and connect to BTS. + * + * @param string $type + * (see tlIssueTracker.class.php $systems property) + * @param xml $cfg + */ + public function __construct($type, $config, $name) + { + $this->name = $name; + $this->interfaceViaDB = false; + + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => true, + 'addReporter' => true, + 'addHandler' => true + ); + + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 80, + 'verbose' => 'resolved' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 90, + 'verbose' => 'closed' + ); + + if ($this->setCfg($config)) { + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + $this->guiCfg = array( + 'use_decoration' => true + ); + } + } + + /** + * Return the URL to the bugtracking page for viewing + * the bug with the given id. + * + * @param + * int id the bug id + * @return string returns a complete URL to view the bug + */ + public function buildViewBugURL($id) + { + return (string) ($this->cfg->uriview . urlencode($id)); + } + + /** + * establishes the soap connection to the bugtracking system + * + * @return bool returns true if the soap connection was established and the + * wsdl could be downloaded, false else + * + */ + public function connect() + { + $op = $this->getClient(array( + 'log' => true + )); + if ($this->connected = $op['connected']) { + // OK, we have got WSDL => server is up and we can do SOAP calls, but now we need + // to do a simple call with user/password only to understand if we are really connected + try { + $op['client']->mc_enum_status($this->cfg->username, + $this->cfg->password); + } catch (SoapFault $f) { + $this->connected = false; + tLog( + "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", + "ERROR"); + } + } + return $this->connected; + } + + /** + */ + public function getClient($opt = null) + { + // IMPORTANT NOTICE - 2012-01-06 - If you are using XDEBUG, Soap Fault will not work + $res = array( + 'client' => null, + 'connected' => false, + 'msg' => 'generic ko' + ); + $my['opt'] = array( + 'log' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + try { + // IMPORTANT NOTICE + // $this->cfg is a simpleXML object, then is ABSOLUTELY CRITICAL + // DO CAST any member before using it. + // If we do following call WITHOUT (string) CAST, SoapClient() fails + // complaining '... wsdl has to be an STRING or null ...' + $res['client'] = new SoapClient((string) $this->cfg->uriwsdl, + $this->soapOpt); + + // debug trying to use proxy (20140409) + // $res['client'] = new SoapClient('/tmp/mantisconnect.php.wsdl',$this->soapOpt); + + $res['connected'] = true; + $res['msg'] = 'iupi!!!'; + } catch (SoapFault $f) { + $res['connected'] = false; + $res['msg'] = "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})"; + if ($my['opt']['log']) { + tLog( + "SOAP Fault: (code: {$f->faultcode}, string: {$f->faultstring})", + "ERROR"); + } + } + return $res; + } + + /** + * checks is bug id is present on BTS + * + * @return integer returns 1 if the bug with the given id exists + */ + public function checkBugIDExistence($id) + { + static $client; + + if (! $this->isConnected()) { + return 0; // >>>---> bye! + } + + if (is_null($client)) { + $dummy = $this->getClient(); + $client = $dummy['client']; + } + + $status_ok = 0; + + $safe = new stdClass(); + $safe->username = (string) $this->cfg->username; + $safe->password = (string) $this->cfg->password; + $safe->id = intval($id); + + try { + $status_ok = $client->mc_issue_exists($safe->username, + $safe->password, $safe->id) ? 1 : 0; + } catch (SoapFault $f) { + // from http://www.w3schools.com/soap/soap_fault.asp + // VersionMismatch - Found an invalid namespace for the SOAP Envelope element + // MustUnderstand - An immediate child element of the Header element, + // with the mustUnderstand attribute set to "1", was not understood + // Client - The message was incorrectly formed or contained incorrect information + // Server - There was a problem with the server so the message ... + + // @Å¢ODO - 20120106 - need to think how to manage this situation in a better way + } + return $status_ok; + } + + /** + */ + public function getIssue($id) + { + static $client; + + if (! $this->isConnected()) { + return false; + } + + if (is_null($client)) { + $dummy = $this->getClient(); + $client = $dummy['client']; + } + + $issue = null; + try { + $safe = new stdClass(); + $safe->username = (string) $this->cfg->username; + $safe->password = (string) $this->cfg->password; + $safe->id = intval($id); + + if ($client->mc_issue_exists($safe->username, $safe->password, + $safe->id)) { + $issue = $client->mc_issue_get($safe->username, $safe->password, + $safe->id); + if (! is_null($issue) && is_object($issue)) { + $issue->IDHTMLString = "{$id} : "; + $issue->statusCode = $issue->status->id; + $issue->statusVerbose = $issue->status->name; + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->statusVerbose); + $issue->statusColor = isset( + $this->status_color[$issue->statusVerbose]) ? $this->status_color[$issue->statusVerbose] : 'white'; + + $issue->summaryHTMLString = $issue->summary; + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + + $issue->reportedBy = (string) $issue->reporter->name; + $issue->handledBy = (string) $issue->handler->name; + } + } + } catch (SoapFault $f) { + // from http://www.w3schools.com/soap/soap_fault.asp + // VersionMismatch - Found an invalid namespace for the SOAP Envelope element + // MustUnderstand - An immediate child element of the Header element, + // with the mustUnderstand attribute set to "1", was not understood + // Client - The message was incorrectly formed or contained incorrect information + // Server - There was a problem with the server so the message ... + + // @Å¢ODO - 20120106 - need to think how to manage this situation in a better way + } + return $issue; + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "MANTIS LOGIN NAME\n" . + "MANTIS PASSWORD\n" . + "http://www.mantisbt.org/\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "http://www.mantisbt.org/api/soap/mantisconnect.php?wsdl\n" . + "http://www.mantisbt.org/view.php?id=\n" . + "http://www.mantisbt.org/\n" . + "\n" . + "MANTIS PROJECT NAME\n" . + "MANTIS CATEGORY NAME\n" . + "\n" . + "\n" . + "80resolved\n" . + "90closed\n" . + "\n" . "\n"; + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; + if (! property_exists($this->cfg, 'uriwsdl')) { + $this->cfg->uriwsdl = $base . 'api/soap/mantisconnect.php?wsdl'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'view.php?id='; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base; + } + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + */ + private function buildStatusHTMLString($statusVerbose) + { + $str = ''; + if ($statusVerbose !== false) { + // status values depends on your mantis configuration at config_inc.php in $g_status_enum_string, + // below is the default: + // '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed' + // With this replace if user configure status on mantis with blank we do not have problems + // + $tlStatus = str_replace(" ", "_", $statusVerbose); + $str = lang_get('issue_status_' . $tlStatus); + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + } + return $str; + } + + public function setStatusCfg() + { + $statusCfg = (array) $this->cfg->statuscfg; + foreach ($statusCfg['status'] as $cfx) { + $e = (array) $cfx; + $this->status_color[$e['verbose']] = $e['color']; + } + } + + public function getCodeStatus() + { + return $this->code_status; + } + + public function getStatusColor() + { + return $this->status_color; + } + + public static function checkEnv() + { + $ret = array(); + $ret['status'] = extension_loaded('soap'); + $ret['msg'] = $ret['status'] ? 'OK' : 'You need to enable SOAP extension'; + return $ret; + } + + /** + * from mantisconnect.php + * + * ### AccountData + * $l_oServer->wsdl->addComplexType('AccountData','complexType','struct','all','', + * array( 'id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0'), + * 'name' => array( 'name' => 'name', 'type' => 'xsd:string', 'minOccurs' => '0'), + * 'real_name' => array( 'name' => 'real_name', 'type' => 'xsd:string', 'minOccurs' => '0'), + * 'email' => array( 'name' => 'email', 'type' => 'xsd:string', 'minOccurs' => '0') + * + * + * From IssueData I want to have the example for project to understand what data structure I need to use + * + * ### IssueData + * $l_oServer->wsdl->addComplexType('IssueData','complexType','struct','all','', + * array('id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0' ), + * 'view_state' => array( 'name' => 'view_state', 'type' => 'tns:ObjectRef', 'minOccurs' => '0' ), + * 'last_updated' => array( 'name' => 'last_updated', 'type' => 'xsd:dateTime', 'minOccurs' => '0' ), + * 'project' => array( 'name' => 'project', 'type' => 'tns:ObjectRef', 'minOccurs' => '0' ), + * + * + * ### ObjectRef + * $l_oServer->wsdl->addComplexType('ObjectRef','complexType','struct','all','', + * array('id' => array( 'name' => 'id', 'type' => 'xsd:integer', 'minOccurs' => '0'), + * 'name' => array( 'name' => 'name', 'type' => 'xsd:string', 'minOccurs' => '0') + */ + public function addIssue($summary, $description, $opt = null) + { + static $client; + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => '' + ); + if (! $this->isConnected()) { + return $ret; + } + + if (is_null($client)) { + $dummy = $this->getClient(); + $client = $dummy['client']; + } + $safe = new stdClass(); + $safe->username = (string) $this->cfg->username; + $safe->password = (string) $this->cfg->password; + $safe->project = (string) $this->cfg->project; + + $mpid = $client->mc_project_get_id_from_name($safe->username, + $safe->password, $safe->project); + if ($mpid > 0) { + + $safeSummary = (strlen($summary) > $this->summaryLengthLimit) ? '...' . + substr($summary, - ($this->summaryLengthLimit)) : $summary; + $issue = array( + 'summary' => $safeSummary, + 'description' => $description, + 'project' => array( + 'id' => $mpid + ) + ); + + // check category + $nameCode = $client->mc_project_get_categories($safe->username, + $safe->password, $mpid); + $codeName = array_flip($nameCode); + + $categoryName = (property_exists($this->cfg, 'category')) ? (string) $this->cfg->category : null; + $issue['category'] = (is_null($categoryName) || + ! isset($codeName[$categoryName])) ? current($nameCode) : $categoryName; + + // user tester as Reporter + if (! is_null($opt) && property_exists($opt, 'reporter')) { + $issue['reporter'] = array( + 'name' => $opt->reporter + ); + } + + // because issue id on TestLink is considered a string, + // in order to make work ORDER BY, I will format it adding 0 to left as done on Mantis GUI + // example: 6845 => 0006845 + $ret['id'] = $client->mc_issue_add($safe->username, $safe->password, + $issue); + $ret['id'] = sprintf('%07u', $ret['id']); + + $ret['status_ok'] = true; + $ret['msg'] = sprintf(lang_get('mantis_bug_created'), $ret['id'], + $safeSummary, $safe->project); + } else { + $ret['msg'] = sprintf(lang_get('bts_project_does_not_exist'), + (string) $this->cfg->project); + } + return $ret; + } + + /** + * Mantis API Call mc_issue_note_addR + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + public function addNote($issueID, $noteText, $opt = null) + { + static $client; + $ret = array( + 'status_ok' => false, + 'msg' => '', + 'note_id' => - 1 + ); + if (! $this->isConnected()) { + return array( + 'status_ok' => false, + 'msg' => 'Connection KO', + 'note_id' => - 1 + ); + } + + if (is_null($client)) { + $dummy = $this->getClient(); + $client = $dummy['client']; + } + + $safe = new stdClass(); + $safe->username = (string) $this->cfg->username; + $safe->password = (string) $this->cfg->password; + $safe->issueID = intval($issueID); + + if ($client->mc_issue_exists($safe->username, $safe->password, + $safe->issueID)) { + + $issueNoteData = array( + 'text' => $noteText + ); + if (! is_null($opt) && property_exists($opt, 'reporter')) { + $issueNoteData['reporter'] = array( + 'name' => $opt->reporter + ); + } + + try { + $ret['note_id'] = $client->mc_issue_note_add($safe->username, + $safe->password, $safe->issueID, $issueNoteData); + } catch (SoapFault $f) { + // "User id missing"; + // Have found no way to check code, then will check message + // MantisBT send messages only on English + $faultMsg = $f->getMessage(); + + switch ($faultMsg) { + case "User id missing": + $ret['msg'] = "Cannot create note, using TestLink logged user: " . + $issueNoteData['reporter']['name']; + break; + + default: + $ret['msg'] = "Cannot create note, MantisBT message: $faultMsg"; + break; + } + } + } else { + $ret['msg'] = "issue $safe->issueID does not exist"; + } + + return $ret; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'project') && + property_exists($this->cfg, 'category'); + } +} diff --git a/lib/issuetrackerintegration/redminerestInterface.class.php b/lib/issuetrackerintegration/redminerestInterface.class.php index 7e4a7751d5..67d8f985b1 100644 --- a/lib/issuetrackerintegration/redminerestInterface.class.php +++ b/lib/issuetrackerintegration/redminerestInterface.class.php @@ -1,514 +1,501 @@ -name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 3, 'verbose' => 'resolved'); - $this->defaultResolvedStatus[] = array('code' => 5, 'verbose' => 'closed'); - - $this->canSetReporter = true; - if( !$this->setCfg($config) ) { - return false; - } - - // http://www.redmine.org/issues/6843 - // "Target version" is the new display name for this property, - // but it's still named fixed_version internally and thus in the API. - // $issueXmlObj->addChild('fixed_version_id', (string)2); - $this->translate['targetversion'] = 'fixed_version_id'; - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - if( !property_exists($this->cfg,'uriview') ) - { - // seems this is good only for redmine 1 and 2 ?? - // $this->cfg->uriview = $base . 'issues/show/'; - $this->cfg->uriview = $base . 'issues/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base; - } - - if( property_exists($this->cfg,'attributes') ) - { - $attr = get_object_vars($this->cfg->attributes); - foreach ($attr as $name => $elem) - { - $name = (string)$name; - if( is_object($elem) ) - { - $elem = get_object_vars($elem); - $cc = current($elem); - $kk = key($elem); - foreach($cc as $value) - { - $this->issueOtherAttr[$name][] = array($kk => (string)$value); - } - } - else - { - $this->issueOtherAttr[$name] = (string)$elem; - } - } - } - - // All attributes that I do not consider mandatory - // are managed through the issueAdditionalAttributes - // - // On Redmine 1 seems to be standard for Issues/Bugs - $this->issueDefaults = array('trackerid' => 1); - foreach($this->issueDefaults as $prop => $default) - { - if(!isset($this->issueAttr[$prop])) - { - $this->issueAttr[$prop] = $default; - } - } - - if( property_exists($this->cfg,'custom_fields') ) - { - libxml_use_internal_errors(true); - $xcfg = simplexml_load_string($this->xmlCfg); - $this->cfg->custom_fields = (string)$xcfg->custom_fields->asXML(); - } - } - - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - $processCatch = false; - - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $redUrl = (string)trim($this->cfg->uribase); - $redAK = (string)trim($this->cfg->apikey); - $pxy = new stdClass(); - $pxy->proxy = config_get('proxy'); - $this->APIClient = new redmine($redUrl,$redAK,$pxy); - - // to undestand if connection is OK, I will ask for projects. - // I've tried to ask for users but get always ERROR from redmine (not able to understand why). - try - { - $items = $this->APIClient->getProjects(); - $this->connected = !is_null($items); - unset($items); - } - catch(Exception $e) - { - $processCatch = true; - } - } - catch(Exception $e) - { - $processCatch = true; - } - - if($processCatch) - { - $logDetails = ''; - foreach(array('uribase','apikey') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) - { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try - { - $xmlObj = $this->APIClient->getIssue((int)$issueID); - - if( !is_null($xmlObj) && is_object($xmlObj)) - { - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = (string)$xmlObj->status['id']; - $issue->statusVerbose = (string)$xmlObj->status['name'];; - $issue->statusHTMLString = "[$issue->statusVerbose] "; - $issue->summary = $issue->summaryHTMLString = (string)$xmlObj->subject; - $issue->redmineProject = array('name' => (string)$xmlObj->project['name'], - 'id' => (int)$xmlObj->project['id'] ); - - $issue->isResolved = isset($this->resolvedStatus->byCode[$issue->statusCode]); - } - } - catch(Exception $e) - { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - /** - * - * From Redmine API documentation (@20130406) - * Parameters: - * - * issue - A hash of the issue attributes: - * - subject - * - description - * - project_id - * - tracker_id - * - status_id - * - category_id - * - fixed_version_id - see http://www.redmine.org/issues/6843 - * - assigned_to_id - ID of the user to assign the issue to (currently no mechanism to assign by name) - * - parent_issue_id - ID of the parent issue <= aslo know as Parent Task - * - custom_fields - See Custom fields - * - watcher_user_ids - Array of user ids to add as watchers (since 2.3.0) - */ - public function addIssue($summary,$description,$opt=null) { - - $reporter = null; - if(!is_null($opt) && property_exists($opt, 'reporter')) { - $reporter = $opt->reporter; - } - - - // Check mandatory info - if( !property_exists($this->cfg,'projectidentifier') ) { - throw new exception(__METHOD__ . " project identifier is MANDATORY"); - } - - - try { - // needs json or xml - $issueXmlObj = new SimpleXMLElement(''); - - // according with user report is better to use htmlspecialchars - // TICKET 5703: Create issue with Portuguese characters produces mangled text - // - // $issueXmlObj->addChild('subject', htmlentities($summary)); - // $issueXmlObj->addChild('description', htmlentities($description)); - - // limit size to redmine max => 255 ? - $issueXmlObj->addChild('subject', substr(htmlspecialchars($summary),0,255) ); - $issueXmlObj->addChild('description', htmlspecialchars($description)); - - // Got from XML Configuration - // improvement - $pid = (string)$this->cfg->projectidentifier; - $issueXmlObj->addChild('project_id',$pid); - - if( property_exists($this->cfg,'trackerid') ) { - $issueXmlObj->addChild('tracker_id', (string)$this->cfg->trackerid); - } - - // try to be generic - if( property_exists($this->cfg,'parent_issue_id') ) { - $issueXmlObj->addChild('parent_issue_id', (string)$this->cfg->parent_issue_id); - } - - // Why issuesAttr is issue ? - // Idea was - // on XML config on TestLink provide direct access to a minimun set of MANDATORY - // attributes => without it issue can not be created. - // After first development/release of this feature people that knows better - // Redmine start asking for other attributes. - // Then to manage this other set of unknown attributes in a generic way idea was - // loop over an object property and blidly add it to request. - // - // Drawback/limitations - // I can not manage type (because I do not request this info) => will treat always as STRING - // - // * Special case Target Version - // http://www.redmine.org/issues/6843 - // "Target version" is the new display name for this property, - // but it's still named fixed_version internally and thus in the API. - // $issueXmlObj->addChild('fixed_version_id', (string)2); - // - if(!is_null($this->issueOtherAttr)) { - foreach($this->issueOtherAttr as $ka => $kv) { - // will treat everything as simple strings or can I check type - // see completeCfg() - $issueXmlObj->addChild((isset($this->translate[$ka]) ? $this->translate[$ka] : $ka), (string)$kv); - } - } - - // In order to manage custom fields in simple way, - // it seems that is better create here plain XML String - // - $xml = $issueXmlObj->asXML(); - if( property_exists($this->cfg,'custom_fields') ) { - $cf = (string)$this->cfg->custom_fields; - - // -- - // Management of Dynamic Values From XML Configuration - $safeVal = array(); - foreach($opt->tagValue->value as $val) { - array_push($safeVal, htmlentities($val, ENT_XML1)); - } - $cf = str_replace($opt->tagValue->tag,$safeVal,$cf); - // -- - - $xml = str_replace('', $cf . '', $xml); - } - - // $op = $this->APIClient->addIssueFromSimpleXML($issueXmlObj); - //file_put_contents('/var/testlink/' . __CLASS__ . '.log', $xml); - $op = $this->APIClient->addIssueFromXMLString($xml,$reporter); - - - if(is_null($op)) { - $msg = "Error Calling " . __CLASS__ . - "->APIClient->addIssueFromXMLString() " . - " check Communication TimeOut "; - throw new Exception($msg, 1); - } - - $ret = array('status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('redmine_bug_created'), - $summary,$pid)); - } - catch (Exception $e) { - $msg = "Create REDMINE Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($xml)); - } - return $ret; - } - - - /** - * - */ - public function addNote($issueID,$noteText,$opt=null) - { - try - { - // needs json or xml - $issueXmlObj = new SimpleXMLElement(''); - $issueXmlObj->addChild('notes', htmlspecialchars($noteText)); - - $reporter = null; - if(!is_null($opt) && property_exists($opt, 'reporter')) - { - $reporter = $opt->reporter; - } - $op = $this->APIClient->addIssueNoteFromSimpleXML($issueID,$issueXmlObj,$reporter); - $ret = array('status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('redmine_bug_created'),$summary,$issueXmlObj->project_id)); - } - catch (Exception $e) - { - $msg = "REDMINE Add Note to Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issueXmlObj)); - } - return $ret; - } - - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "REDMINE API KEY\n" . - "http://tl.m.remine.org\n" . - "http://tl.m.remine.org/issues/ \n" . - "\n" . - "REDMINE PROJECT IDENTIFIER\n" . - " You can use numeric id or identifier string \n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - '' . "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'projectidentifier')); - } - - +name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 3, + 'verbose' => 'resolved' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 5, + 'verbose' => 'closed' + ); + + $this->canSetReporter = true; + if (! $this->setCfg($config)) { + return false; + } + + // http://www.redmine.org/issues/6843 + // "Target version" is the new display name for this property, + // but it's still named fixed_version internally and thus in the API. + // $issueXmlObj->addChild('fixed_version_id', (string)2); + $this->translate['targetversion'] = 'fixed_version_id'; + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + if (! property_exists($this->cfg, 'uriview')) { + // seems this is good only for redmine 1 and 2 ?? + // $this->cfg->uriview = $base . 'issues/show/'; + $this->cfg->uriview = $base . 'issues/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base; + } + + if (property_exists($this->cfg, 'attributes')) { + $attr = get_object_vars($this->cfg->attributes); + foreach ($attr as $name => $elem) { + $name = (string) $name; + if (is_object($elem)) { + $elem = get_object_vars($elem); + $cc = current($elem); + $kk = key($elem); + foreach ($cc as $value) { + $this->issueOtherAttr[$name][] = array( + $kk => (string) $value + ); + } + } else { + $this->issueOtherAttr[$name] = (string) $elem; + } + } + } + + // All attributes that I do not consider mandatory + // are managed through the issueAdditionalAttributes + // + // On Redmine 1 seems to be standard for Issues/Bugs + $this->issueDefaults = array( + 'trackerid' => 1 + ); + foreach ($this->issueDefaults as $prop => $default) { + if (! isset($this->issueAttr[$prop])) { + $this->issueAttr[$prop] = $default; + } + } + + if (property_exists($this->cfg, 'custom_fields')) { + libxml_use_internal_errors(true); + $xcfg = simplexml_load_string($this->xmlCfg); + $this->cfg->custom_fields = (string) $xcfg->custom_fields->asXML(); + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + * + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $redUrl = (string) trim($this->cfg->uribase); + $redAK = (string) trim($this->cfg->apikey); + $pxy = new stdClass(); + $pxy->proxy = config_get('proxy'); + $this->APIClient = new redmine($redUrl, $redAK, $pxy); + + // to undestand if connection is OK, I will ask for projects. + // I've tried to ask for users but get always ERROR from redmine (not able to understand why). + try { + $items = $this->APIClient->getProjects(); + $this->connected = ! is_null($items); + unset($items); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach (array( + 'uribase', + 'apikey' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $xmlObj = $this->APIClient->getIssue((int) $issueID); + + if (! is_null($xmlObj) && is_object($xmlObj)) { + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = (string) $xmlObj->status['id']; + $issue->statusVerbose = (string) $xmlObj->status['name']; + $issue->statusHTMLString = "[$issue->statusVerbose] "; + $issue->summary = $issue->summaryHTMLString = (string) $xmlObj->subject; + $issue->redmineProject = array( + 'name' => (string) $xmlObj->project['name'], + 'id' => (int) $xmlObj->project['id'] + ); + + $issue->isResolved = isset( + $this->resolvedStatus->byCode[$issue->statusCode]); + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + * + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + * + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + * From Redmine API documentation (@20130406) + * Parameters: + * + * issue - A hash of the issue attributes: + * - subject + * - description + * - project_id + * - tracker_id + * - status_id + * - category_id + * - fixed_version_id - see http://www.redmine.org/issues/6843 + * - assigned_to_id - ID of the user to assign the issue to (currently no mechanism to assign by name) + * - parent_issue_id - ID of the parent issue <= aslo know as Parent Task + * - custom_fields - See Custom fields + * - watcher_user_ids - Array of user ids to add as watchers (since 2.3.0) + */ + public function addIssue($summary, $description, $opt = null) + { + $reporter = null; + if (! is_null($opt) && property_exists($opt, 'reporter')) { + $reporter = $opt->reporter; + } + + // Check mandatory info + if (! property_exists($this->cfg, 'projectidentifier')) { + throw new exception(__METHOD__ . " project identifier is MANDATORY"); + } + + try { + // needs json or xml + $issueXmlObj = new SimpleXMLElement( + ''); + + // according with user report is better to use htmlspecialchars + // TICKET 5703: Create issue with Portuguese characters produces mangled text + // + // $issueXmlObj->addChild('subject', htmlentities($summary)); + // $issueXmlObj->addChild('description', htmlentities($description)); + + // limit size to redmine max => 255 ? + $issueXmlObj->addChild('subject', + substr(htmlspecialchars($summary), 0, 255)); + $issueXmlObj->addChild('description', htmlspecialchars($description)); + + // Got from XML Configuration + // improvement + $pid = (string) $this->cfg->projectidentifier; + $issueXmlObj->addChild('project_id', $pid); + + if (property_exists($this->cfg, 'trackerid')) { + $issueXmlObj->addChild('tracker_id', + (string) $this->cfg->trackerid); + } + + // try to be generic + if (property_exists($this->cfg, 'parent_issue_id')) { + $issueXmlObj->addChild('parent_issue_id', + (string) $this->cfg->parent_issue_id); + } + + // Why issuesAttr is issue ? + // Idea was + // on XML config on TestLink provide direct access to a minimun set of MANDATORY + // attributes => without it issue can not be created. + // After first development/release of this feature people that knows better + // Redmine start asking for other attributes. + // Then to manage this other set of unknown attributes in a generic way idea was + // loop over an object property and blidly add it to request. + // + // Drawback/limitations + // I can not manage type (because I do not request this info) => will treat always as STRING + // + // * Special case Target Version + // http://www.redmine.org/issues/6843 + // "Target version" is the new display name for this property, + // but it's still named fixed_version internally and thus in the API. + // $issueXmlObj->addChild('fixed_version_id', (string)2); + // + if (! is_null($this->issueOtherAttr)) { + foreach ($this->issueOtherAttr as $ka => $kv) { + // will treat everything as simple strings or can I check type + // see completeCfg() + $issueXmlObj->addChild( + (isset($this->translate[$ka]) ? $this->translate[$ka] : $ka), + (string) $kv); + } + } + + // In order to manage custom fields in simple way, + // it seems that is better create here plain XML String + // + $xml = $issueXmlObj->asXML(); + if (property_exists($this->cfg, 'custom_fields')) { + $cf = (string) $this->cfg->custom_fields; + + // Management of Dynamic Values From XML Configuration + $safeVal = array(); + foreach ($opt->tagValue->value as $val) { + array_push($safeVal, htmlentities($val, ENT_XML1)); + } + $cf = str_replace($opt->tagValue->tag, $safeVal, $cf); + + $xml = str_replace('', $cf . '', $xml); + } + + $op = $this->APIClient->addIssueFromXMLString($xml, $reporter); + + if (is_null($op)) { + $msg = "Error Calling " . __CLASS__ . + "->APIClient->addIssueFromXMLString() " . + " check Communication TimeOut "; + throw new Exception($msg, 1); + } + + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('redmine_bug_created'), $summary, $pid) + ); + } catch (Exception $e) { + $msg = "Create REDMINE Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($xml) + ); + } + return $ret; + } + + /** + */ + public function addNote($issueID, $noteText, $opt = null) + { + try { + // needs json or xml + $issueXmlObj = new SimpleXMLElement( + ''); + $issueXmlObj->addChild('notes', htmlspecialchars($noteText)); + + $reporter = null; + if (! is_null($opt) && property_exists($opt, 'reporter')) { + $reporter = $opt->reporter; + } + $op = $this->APIClient->addIssueNoteFromSimpleXML($issueID, + $issueXmlObj, $reporter); + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('redmine_bug_created'), $summary, + $issueXmlObj->project_id) + ); + } catch (Exception $e) { + $msg = "REDMINE Add Note to Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issueXmlObj) + ); + } + return $ret; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "REDMINE API KEY\n" . + "http://tl.m.remine.org\n" . + "http://tl.m.remine.org/issues/ \n" . + "\n" . + "REDMINE PROJECT IDENTIFIER\n" . + " You can use numeric id or identifier string \n" . + "\n" . "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + '' . "\n" . + '' . "\n" . + '' . "\n" . '' . + "\n" . + '' . + "\n" . '' . "\n" . + '' . "\n" . '' . + "\n" . '' . "\n" . + '' . "\n" . + "\n" . + "\n" . + "\n" . + "\n" . + "\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'projectidentifier'); + } } diff --git a/lib/issuetrackerintegration/tracxmlrpcInterface.class.php b/lib/issuetrackerintegration/tracxmlrpcInterface.class.php index 07213d3f0e..57169f8f19 100644 --- a/lib/issuetrackerintegration/tracxmlrpcInterface.class.php +++ b/lib/issuetrackerintegration/tracxmlrpcInterface.class.php @@ -1,341 +1,311 @@ -name = $name; - $this->interfaceViaDB = false; - - if( !$this->setCfg($config) ) - { - return false; - } - - $this->methodOpt['buildViewBugLink'] = array('addSummary' => true, 'colorByStatus' => false); - - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = array('code' => 'r', 'verbose' => 'resolved'); - $this->defaultResolvedStatus[] = array('code' => 'v', 'verbose' => 'verified'); - $this->defaultResolvedStatus[] = array('code' => 'c', 'verbose' => 'closed'); - - $this->setResolvedStatusCfg(); - $this->completeCfg(); - $this->connect(); - $this->guiCfg = array('use_decoration' => true); // add [] on summary - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - $base = trim($this->cfg->uribase,"/") . '/'; // be sure no double // at end - if( !property_exists($this->cfg,'urixmlrpc') ) - { - $this->cfg->urixmlrpc = $base . 'xmlrpc'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'ticket/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . 'newticket/'; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - // echo __METHOD__ . '

    '; - try - { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $this->createAPIClient(); - $this->connected = true; - - //var_dump($this->APIClient); - //echo '

    END ' . __METHOD__ . '

    '; - - } - catch(Exception $e) - { - $logDetails = ''; - foreach(array('uribase','apikey') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - public function getIssue($issueID) - { - // array ticket.get(int id) Fetch a ticket. - // Returns [id, time_created, time_changed, attributes]. - // attributes is following map (@20120826) - // - // ------------------------------------------ - // key | value - // ------------------------------------------ - // status | new - // description | MERCURIAL FIRST TICKET - // reporter | admin - // cc | [empty string] - // component | component1 - // summary | MERCURIAL FIRST TICKET - // priority | major - // keywords | [empty string] - // version | [empty string] - // milestone | [empty string] - // owner | somebody - // type | defect - // - - $resp = $this->sendCmd('ticket.get', $issueID); - if( $resp == false ) - { - $issue = null; - } - else - { - $attrib = $resp[self::TICKET_GET_ATTRIBUTES_IDX]; - $issue = new stdClass(); - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = 0; - $issue->statusVerbose = $attrib['status']; - $issue->statusHTMLString = "[$issue->statusVerbose] "; - $issue->summary = $issue->summaryHTMLString = $attrib['summary']; - $issue->isResolved = isset($this->resolvedStatus->byName[$issue->statusVerbose]); - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - $str = $issue->summaryHTMLString; - if($this->guiCfg['use_decoration']) - { - $str = "[" . $str . "] "; - } - return $str; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - $dBugLabel = array('label' => __METHOD__); - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - - /** - * - * - **/ - function createAPIClient() - { - try - { - // Create a new connection with the TRAC-server. - $this->APIClient = new xmlrpc_client($this->cfg->urixmlrpc); - - // Set the credentials to use to log in. - $this->APIClient->setCredentials($this->cfg->username, $this->cfg->password); - - // Disable certificate checking. Don't need to check it. - $this->APIClient->verifyhost = false; - $this->APIClient->verifypeer = false; - - } - catch(Exception $e) - { - $this->connected = false; - tLog(__METHOD__ . $e->getMessage(), 'ERROR'); - } - } - - - /** - * - */ - function sendCmd($cmd, $id) - { - $param = new xmlrpcval(intval($id)); - $msg = new xmlrpcmsg($cmd); - $msg->addParam($param); - - // Send request with timeout disabled - $response = $this->APIClient->send($msg, 0); - if (!$response->errno) - { - $response = php_xmlrpc_decode($response->val); - } - else - { - tLog(__METHOD__ . (serialize($response)), 'ERROR'); - $response = false; - } - - return $response; - } - - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "USERNAME\n" . - "PASSWORD\n" . - "'http:///\n" . - "\n"; - return $tpl; - } - -} \ No newline at end of file +name = $name; + $this->interfaceViaDB = false; + + if (! $this->setCfg($config)) { + return false; + } + + $this->methodOpt['buildViewBugLink'] = array( + 'addSummary' => true, + 'colorByStatus' => false + ); + + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = array( + 'code' => 'r', + 'verbose' => 'resolved' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'v', + 'verbose' => 'verified' + ); + $this->defaultResolvedStatus[] = array( + 'code' => 'c', + 'verbose' => 'closed' + ); + + $this->setResolvedStatusCfg(); + $this->completeCfg(); + $this->connect(); + $this->guiCfg = array( + 'use_decoration' => true + ); // add [] on summary + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + $base = trim($this->cfg->uribase, "/") . '/'; // be sure no double // at end + if (! property_exists($this->cfg, 'urixmlrpc')) { + $this->cfg->urixmlrpc = $base . 'xmlrpc'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'ticket/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . 'newticket/'; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $this->createAPIClient(); + $this->connected = true; + } catch (Exception $e) { + $logDetails = ''; + foreach (array( + 'uribase', + 'apikey' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + // array ticket.get(int id) Fetch a ticket. + // Returns [id, time_created, time_changed, attributes]. + // attributes is following map (@20120826) + // + // ------------------------------------------ + // key | value + // ------------------------------------------ + // status | new + // description | MERCURIAL FIRST TICKET + // reporter | admin + // cc | [empty string] + // component | component1 + // summary | MERCURIAL FIRST TICKET + // priority | major + // keywords | [empty string] + // version | [empty string] + // milestone | [empty string] + // owner | somebody + // type | defect + // + $resp = $this->sendCmd('ticket.get', $issueID); + if (! $resp) { + $issue = null; + } else { + $attrib = $resp[self::TICKET_GET_ATTRIBUTES_IDX]; + $issue = new stdClass(); + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = 0; + $issue->statusVerbose = $attrib['status']; + $issue->statusHTMLString = "[$issue->statusVerbose] "; + $issue->summary = $issue->summaryHTMLString = $attrib['summary']; + $issue->isResolved = isset( + $this->resolvedStatus->byName[$issue->statusVerbose]); + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + $str = $issue->summaryHTMLString; + if ($this->guiCfg['use_decoration']) { + $str = "[" . $str . "] "; + } + return $str; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + */ + private function createAPIClient() + { + try { + // Create a new connection with the TRAC-server. + $this->APIClient = new xmlrpc_client($this->cfg->urixmlrpc); + + // Set the credentials to use to log in. + $this->APIClient->setCredentials($this->cfg->username, + $this->cfg->password); + + // Disable certificate checking. Don't need to check it. + $this->APIClient->verifyhost = false; + $this->APIClient->verifypeer = false; + } catch (Exception $e) { + $this->connected = false; + tLog(__METHOD__ . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + private function sendCmd($cmd, $id) + { + $param = new xmlrpcval(intval($id)); + $msg = new xmlrpcmsg($cmd); + $msg->addParam($param); + + // Send request with timeout disabled + $response = $this->APIClient->send($msg, 0); + if (! $response->errno) { + $response = php_xmlrpc_decode($response->val); + } else { + tLog(__METHOD__ . (serialize($response)), 'ERROR'); + $response = false; + } + + return $response; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "USERNAME\n" . "PASSWORD\n" . + "'http:///\n" . + "\n"; + } +} diff --git a/lib/issuetrackerintegration/trellorestInterface.class.php b/lib/issuetrackerintegration/trellorestInterface.class.php index 89c39c1223..036a6baeaf 100644 --- a/lib/issuetrackerintegration/trellorestInterface.class.php +++ b/lib/issuetrackerintegration/trellorestInterface.class.php @@ -1,329 +1,316 @@ -name = $name; - $this->interfaceViaDB = false; - $this->methodOpt['buildViewBugLink'] = [ - 'addSummary' => true,'colorByStatus' => false, - 'addReporter' => false, 'addHandler' => false ]; - - $this->defaultResolvedStatus = []; - - /* @20201207 - $this->defaultResolvedStatus[] = ['code' => 1, 'verbose' => 'queue']; - $this->defaultResolvedStatus[] = ['code' => 2, 'verbose' => 'in progress']; - $this->defaultResolvedStatus[] = ['code' => 3, 'verbose' => 'done']; - */ - - // @20201207 $this->canSetReporter = true; - if( !$this->setCfg($config) ) { - return false; - } - - $this->completeCfg(); - $this->setResolvedStatusCfg(); - $this->connect(); - } - - /** - * - **/ - function completeCfg() - { - $this->cfg->implements = __CLASS__; - - $this->cfg->uribase = trim($this->cfg->uribase,"/"); - if(!property_exists($this->cfg, 'uricreate') ) { - $this->cfg->uricreate = $this->cfg->uribase; - } - - if( property_exists($this->cfg,'options') ) { - $option = get_object_vars($this->cfg->options); - foreach ($option as $name => $elem) { - $name = (string)$name; - $this->options[$name] = (string)$elem; - } - } - - if( !property_exists($this->cfg,'userinteraction') ) { - $this->cfg->userinteraction = 0; - } - - if( !property_exists($this->cfg,'createissueviaapi') ) { - $this->cfg->createissueviaapi = 0; - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - - /** - * - * Two formats allowed - * https://trello.com/c/XZZftZ8A/12-backlog01-yy - * XZZftZ8A - * - **/ - function normalizeBugID($issueID) - { - $norm = $issueID; - $pieces = explode('/',$issueID); - $piecesQty = count($pieces); - if ( $piecesQty > 1) { - // MAGIC - // 0 -> https: - // 1 -> /trello.com - // 2 -> c - // 3 -> XZZftZ8A - // 4 -> 12-backlog01-yy - $norm = $pieces[$piecesQty-2]; - } - return $norm; - } - - /** - * checks id for validity - * - * @param string issueID - * Two formats allowed - * https://trello.com/c/XZZftZ8A/12-backlog01-yy - * XZZftZ8A - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - // Two formats allowed - // https://trello.com/c/XZZftZ8A/12-backlog01-yy - // XZZftZ8A - return $this->checkBugIDSyntaxString($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() { - $processCatch = false; - - try { - // CRITIC NOTICE for developers - // $this->cfg is a simpleXML Object, then seems very conservative and safe - // to cast properties BEFORE using it. - $myContext = [ - 'url' => (string)trim($this->cfg->uribase), - 'apikey' => (string)trim($this->cfg->apikey), - 'apitoken' => (string)trim($this->cfg->apitoken), - 'boardid' => (string)trim($this->cfg->boardid) - ]; - - $cfg = ['proxy' => config_get('proxy')]; - - $this->APIClient = new trello($myContext,$cfg); - // to undestand if connection is OK, I will ask for users. - try { - $item = $this->APIClient->getBoard(); - $this->connected = ($item != null); - } - catch(Exception $e) { - $processCatch = true; - } - } - catch(Exception $e) { - $processCatch = true; - } - - if($processCatch) { - $logDetails = ''; - foreach(['uribase'] as $v) { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - /** - * - * - **/ - function buildViewBugURL($issueID) - { - return $this->APIClient->getIssueURL($issueID); - } - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - $issue = $this->getIssue($issueID); - return !is_null($issue) ? $issue->statusVerbose : false; - } - - /** - * - * @param string issueID - * - * @return string - * - **/ - function getIssueSummaryHTMLString($issueID) - { - $issue = $this->getIssue($issueID); - return $issue->summaryHTMLString; - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) { - $issue = $this->getIssue($issueID); - $status_ok = is_object($issue) && !is_null($issue); - } - return $status_ok; - } - - - - /** - * - * - **/ - public function getIssue($issueID) - { - if (!$this->isConnected()) { - tLog(__METHOD__ . '/Not Connected ', 'ERROR'); - return false; - } - - $issue = null; - try { - $jsonObj = $this->APIClient->getIssue($issueID); - if( !is_null($jsonObj) && is_object($jsonObj)) { - $issue = new stdClass(); - $issue->IDHTMLString = "{$jsonObj->idShort} : "; - - // dateLastActivity ? - // idList -> get the name - $silo = $this->APIClient->getList($jsonObj->idList); - - // we will use the list name as the status verbose - $issue->statusCode = (string)$jsonObj->idList; - $issue->statusVerbose = (string)$silo->name; - $issue->statusHTMLString = "[{$issue->statusVerbose}]"; - - $verbose = (string)$jsonObj->name; // . " {{$jsonObj->dateLastActivity}}"; - $issue->summary = $issue->summaryHTMLString = $verbose; - - $issue->isResolved = false; - } - } - catch(Exception $e) { - tLog(__METHOD__ . '/' . $e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * - **/ - public static function getCfgTemplate() - { - $tpl = "\n" . - "\n" . - "\n" . - "TRELLO API KEY\n" . - "TRELLO API TOKEN\n" . - "https://api.trello.com/1/\n" . - "BOARD IDENTIFICATOR\n" . - "\n"; - return $tpl; - } - - /** - * - **/ - function canCreateViaAPI() - { - return false; - } - - /** - * - **/ - function canAddNoteViaAPI() - { - return false; - } - +name = $name; + $this->interfaceViaDB = false; + $this->methodOpt['buildViewBugLink'] = [ + 'addSummary' => true, + 'colorByStatus' => false, + 'addReporter' => false, + 'addHandler' => false + ]; + + $this->defaultResolvedStatus = []; + + /* + * @20201207 + * $this->defaultResolvedStatus[] = ['code' => 1, 'verbose' => 'queue']; + * $this->defaultResolvedStatus[] = ['code' => 2, 'verbose' => 'in progress']; + * $this->defaultResolvedStatus[] = ['code' => 3, 'verbose' => 'done']; + */ + + // @20201207 $this->canSetReporter = true; + if (! $this->setCfg($config)) { + return false; + } + + $this->completeCfg(); + $this->setResolvedStatusCfg(); + $this->connect(); + } + + /** + */ + private function completeCfg() + { + $this->cfg->implements = __CLASS__; + + $this->cfg->uribase = trim($this->cfg->uribase, "/"); + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $this->cfg->uribase; + } + + if (property_exists($this->cfg, 'options')) { + $option = get_object_vars($this->cfg->options); + foreach ($option as $name => $elem) { + $name = (string) $name; + $this->options[$name] = (string) $elem; + } + } + + if (! property_exists($this->cfg, 'userinteraction')) { + $this->cfg->userinteraction = 0; + } + + if (! property_exists($this->cfg, 'createissueviaapi')) { + $this->cfg->createissueviaapi = 0; + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * Two formats allowed + * https://trello.com/c/XZZftZ8A/12-backlog01-yy + * XZZftZ8A + */ + public function normalizeBugID($issueID) + { + $norm = $issueID; + $pieces = explode('/', $issueID); + $piecesQty = count($pieces); + if ($piecesQty > 1) { + // MAGIC + // 0 -> https: + // 1 -> /trello.com + // 2 -> c + // 3 -> XZZftZ8A + // 4 -> 12-backlog01-yy + $norm = $pieces[$piecesQty - 2]; + } + return $norm; + } + + /** + * checks id for validity + * + * @param + * string issueID + * Two formats allowed + * https://trello.com/c/XZZftZ8A/12-backlog01-yy + * XZZftZ8A + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + // Two formats allowed + // https://trello.com/c/XZZftZ8A/12-backlog01-yy + // XZZftZ8A + return $this->checkBugIDSyntaxString($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + // CRITIC NOTICE for developers + // $this->cfg is a simpleXML Object, then seems very conservative and safe + // to cast properties BEFORE using it. + $myContext = [ + 'url' => (string) trim($this->cfg->uribase), + 'apikey' => (string) trim($this->cfg->apikey), + 'apitoken' => (string) trim($this->cfg->apitoken), + 'boardid' => (string) trim($this->cfg->boardid) + ]; + + $cfg = [ + 'proxy' => config_get('proxy') + ]; + + $this->APIClient = new trello($myContext, $cfg); + // to undestand if connection is OK, I will ask for users. + try { + $item = $this->APIClient->getBoard(); + $this->connected = ($item != null); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach ([ + 'uribase' + ] as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function buildViewBugURL($issueID) + { + return $this->APIClient->getIssueURL($issueID); + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + $issue = $this->getIssue($issueID); + return ! is_null($issue) ? $issue->statusVerbose : false; + } + + /** + * + * @param + * string issueID + * @return string + */ + public function getIssueSummaryHTMLString($issueID) + { + $issue = $this->getIssue($issueID); + return $issue->summaryHTMLString; + } + + /** + * + * @param + * string issueID + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = is_object($issue) && ! is_null($issue); + } + return $status_ok; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + tLog(__METHOD__ . '/Not Connected ', 'ERROR'); + return false; + } + + $issue = null; + try { + $jsonObj = $this->APIClient->getIssue($issueID); + if (! is_null($jsonObj) && is_object($jsonObj)) { + $issue = new stdClass(); + $issue->IDHTMLString = "{$jsonObj->idShort} : "; + + // dateLastActivity ? + // idList -> get the name + $silo = $this->APIClient->getList($jsonObj->idList); + + // we will use the list name as the status verbose + $issue->statusCode = (string) $jsonObj->idList; + $issue->statusVerbose = (string) $silo->name; + $issue->statusHTMLString = "[{$issue->statusVerbose}]"; + + $verbose = (string) $jsonObj->name; // . " {{$jsonObj->dateLastActivity}}"; + $issue->summary = $issue->summaryHTMLString = $verbose; + + $issue->isResolved = false; + } + } catch (Exception $e) { + tLog(__METHOD__ . '/' . $e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "\n" . + "TRELLO API KEY\n" . + "TRELLO API TOKEN\n" . + "https://api.trello.com/1/\n" . + "BOARD IDENTIFICATOR\n" . "\n"; + } + + /** + */ + public function canCreateViaAPI() + { + return false; + } + + /** + */ + public function canAddNoteViaAPI() + { + return false; + } } diff --git a/lib/issuetrackerintegration/tuleaprestInterface.class.php b/lib/issuetrackerintegration/tuleaprestInterface.class.php index e98cdacdc7..63403d437b 100644 --- a/lib/issuetrackerintegration/tuleaprestInterface.class.php +++ b/lib/issuetrackerintegration/tuleaprestInterface.class.php @@ -1,523 +1,514 @@ -name = $name; - $this->interfaceViaDB = false; - $this->defaultResolvedStatus = array(); - $this->defaultResolvedStatus[] = 'Invalid'; - $this->defaultResolvedStatus[] = 'Wont Fix'; - $this->defaultResolvedStatus[] = 'Fixed'; - $this->defaultResolvedStatus[] = 'Works for me'; - $this->defaultResolvedStatus[] = 'Duplicate'; - $this->methodOpt = array('buildViewBugLink' => array('addSummary' => true, 'colorByStatus' => false)); - $this->connected = false; - - if( !$this->setCfg($config) ) - { - return false; - } else { - // check the tracker ID - if (property_exists($this->cfg, 'tracker')) { - $this->trackerID = trim((string) $this->cfg->tracker); - if ( strlen($this->trackerID) > 0 - && ! $this->checkTrackerIDSyntax($this->trackerID) ) { - return false; - } - } else { - // tracker ID may be absent (bug creation from Testlink will not be possible) - $this->trackerID = ""; - } - - // check the base URI - if (property_exists($this->cfg, 'uribase')) { - $this->URIBase = trim((string) $this->cfg->uribase); - if ( strlen($this->URIBase) > 0 - && ! $this->checkURLSyntax($this->URIBase) ) { - return false; - } - } else { - return false; - } - } - - $this->completeCfg(); - $this->connect(); - $this->setResolvedStatusCfg(); - - } - - /** - * checks a tracker id for validity (a numeric value) - * - * @param string tracker ID - * - * @return bool returns true if the tracker id has the right format - **/ - private function checkTrackerIDSyntax($trackerID) - { - $valid = true; - $blackList = '/\D/i'; - if (preg_match($blackList, $trackerID)) { - $valid = false; - } else { - $valid = (intval($trackerID) > 0); - } - - return $valid; - } - - /** - * checks a URL for validity - * - * @param string URL - * - * @return bool returns true if the param is an URL - **/ - private function checkURLSyntax($url) { - return (filter_var($url, FILTER_VALIDATE_URL) - && stripos($url, "http") === 0); - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * Set resolved status - * - * @author Aurelien TISNE - **/ - public function setResolvedStatusCfg() - { - $statusCfg = $this->getResolvedStatus(); - if (! $statusCfg) { - if( property_exists($this->cfg, 'resolvedstatus') ) { - $statusCfg = (array)$this->cfg->resolvedstatus; - } - else { - $statusCfg['status'] = $this->defaultResolvedStatus; - } - } - - $this->resolvedStatus = new stdClass(); - foreach($statusCfg['status'] as $cfx) { - $this->resolvedStatus->byName[] = $cfx; - } - } - - - /** - * Get resolved status from ITS - * - * @author Aurelien TISNE - **/ - public function getResolvedStatus() - { - if (!$this->isConnected()) - return null; - - if ($this->trackerID == '') - return null; - - $ret = null; - try { - $tracker = $this->APIClient->getTrackerById($this->trackerID); - if ($tracker) { - // field ID containing the status semantic - $statusID = $tracker->semantics->status->field_id; - // opened values ID - $statusValuesID = $tracker->semantics->status->value_ids; - //$ret = array(); - // retrieve the field containing the status semantic - $status = $this->getField($tracker, $statusID); - if (! $status ) - throw new Exception('The field ' . $statusID . ' cannot be found in the tracker "' - . $tracker->label . '" (' . $tracker->id . ').'); - // retrieve the labels of closed status - $ret['status'] = $this->getClosedLabels($status, $statusValuesID); - // check that all labels have been found - if ( count($ret['status']) != (count($status->values) - count($statusValuesID)) ) - throw new Exception('Some labels was not found.'); - } else - throw new Exception('The tracker ' . $this->trackerID . ' was not found.'); - } catch(Exception $e) { - tLog($e->getMessage(),'ERROR'); - $ret = null; - } - - return $ret; - } - - /** - * Retrieve a field from a tracker - * - * @param object $tracker A tracker - * @param string $fieldID A tracker item ID - * - * @author Aurelien TISNE - **/ - private function getField($tracker, $fieldID) { - $i = count($tracker->fields); - $field = null; - while ($i > 0 && ! $field) { - if ($tracker->fields[$i - 1]->field_id == $fieldID) - $field = $tracker->fields[$i - 1]; - else - $i -= 1; - } - - return $field; - } - - /** - * Retrieve labels of closed status values ID from the status field - * - * @param object $statusField Tracker field containing the status semantic - * @param array $valuesID List of opened values ID - * - * @author Aurelien TISNE - **/ - private function getClosedLabels($statusField, $openValuesID) { - if (! property_exists($statusField, "values")) - return null; - - $ret = array(); - foreach($statusField->values as $value) { - if ( ! in_array($value->id, $openValuesID) ) - $ret[] = $value->label; - } - - return $ret; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxNumeric($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - - $processCatch = false; - - try - { - - $this->APIClient = new tuleap((string)trim($this->cfg->uriapi), - (string)trim($this->cfg->username), (string)trim($this->cfg->password)); - - try - { - $this->connected = $this->APIClient->Connect(); - - } - catch(Exception $e) - { - $processCatch = true; - } - } - catch(Exception $e) - { - $processCatch = true; - } - - if($processCatch) - { - $logDetails = ''; - foreach(array('uribase', 'username') as $v) - { - $logDetails .= "$v={$this->cfg->$v} / "; - } - $logDetails = trim($logDetails,'/ '); - $this->connected = false; - tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - **/ - function buildStatusHTMLString($status) - { - if (in_array($status, $this->resolvedStatus->byName) )// Closed type status - { - $str = "" . $status . ""; - }else{ - $str = $status; - } - return "[{$str}] "; - } - - /** - * - * - **/ - function getIssue($issueID) - { - if (!$this->isConnected()) - { - return false; - } - - try - { - $issue = $this->APIClient->getArtifactById((int)$issueID); - if( !is_null($issue) && is_object($issue) ) - { - $issue->IDHTMLString = "{$issueID} : "; - //$issue->statusCode = $issue->State; - $issue->statusVerbose = $issue->status; - $issue->statusHTMLString = $this->buildStatusHTMLString($issue->status); - $issue->summaryHTMLString = $issue->title; - - $issue->isResolved = isset($this->resolvedStatus->byName[$issue->statusVerbose]); - } - - } - catch(Exception $e) - { - tLog($e->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return boolean - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue))? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - return $this->getIssueStatusCode($issueID); - } - - - - /** - * Returns a configuration template - * - * @return string - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "TULEAP LOGIN NAME\n" . - "TULEAP PASSWORD\n" . - "\n" . - "https://" . $_SERVER['SERVER_NAME'] . "\n". - "\n" . - "\n" . - "\n" . - "https://" . $_SERVER['SERVER_NAME'] . "/api\n". - "https://" . $_SERVER['SERVER_NAME'] . "/plugins/tracker/?aid=\n". - "https://" . $_SERVER['SERVER_NAME'] . "/plugins/tracker/?func=new-artifact&tracker=TULEAP TRACKER ID\n". - "\n" . - "\n" . - "\n" . - "TULEAP TRACKER ID\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "Fixed\n" . - "Invalid\n" . - "Wont Fix\n" . - "Works for me\n" . - "Duplicate\n" . - "\n" . - "\n"; - return $template; - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - // '/' at uribase name creates issue with API - $this->URIBase = trim($this->URIBase, "/"); - - $base = $this->URIBase . '/'; - - if( !property_exists($this->cfg,'uriapi') ) - { - $this->cfg->uriapi = $base . 'api'; - } - - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'plugins/tracker/?aid='; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - if ( $this->trackerID != "" ) { - $this->cfg->uricreate = $base . 'plugins/tracker/?tracker=' - . $this->trackerID . '&func=new-artifact'; - } else { - $this->cfg->uricreate = ''; - } - } - - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = (!is_null($issue) && is_object($issue)); - } - return $status_ok; - } - - /** - * - */ - public function addIssue($summary, $description, $opt=null) - { - try - { - $issue = array('tracker' => (int)$this->trackerID, - 'summary' => $summary, - 'description' => $description); - - $op = $this->APIClient->createIssue((int)$this->trackerID, $summary, $description); - - if (is_null($op)) { - throw new Exception("Something's wrong when creating an artefact"); - } else { - $ret = array('status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('tuleap_bug_created'), $summary, (string)$op->tracker->project->id)); - } - } - catch (Exception $e) - { - $msg = "Create artifact FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg); - } - return $ret; - } - - /** - * - */ - public function addNote($bugId, $noteText, $opt=null) - { - if (!$this->isConnected()) - return null; - - try{ - $noteText = "Reporter: " . $opt->reporter . " <" . $opt->reporter_email . ">\n" . $noteText; - $op = $this->APIClient->addTrackerArtifactMessage( (int)$bugId, $noteText); - $ret = array('status_ok' => true, - 'msg' => sprintf(lang_get('tuleap_bug_comment'), $noteText)); - }catch (Exception $e){ - $msg = "Add note FAILURE for bug " . $bugId . " => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'msg' => $msg); - } - - return $ret; - } - - - /** - * - **/ - function canCreateViaAPI() - { - return ($this->trackerID !== ''); - } - - -} +name = $name; + $this->interfaceViaDB = false; + $this->defaultResolvedStatus = array(); + $this->defaultResolvedStatus[] = 'Invalid'; + $this->defaultResolvedStatus[] = 'Wont Fix'; + $this->defaultResolvedStatus[] = 'Fixed'; + $this->defaultResolvedStatus[] = 'Works for me'; + $this->defaultResolvedStatus[] = 'Duplicate'; + $this->methodOpt = array( + 'buildViewBugLink' => array( + 'addSummary' => true, + 'colorByStatus' => false + ) + ); + $this->connected = false; + + if (! $this->setCfg($config)) { + return false; + } else { + // check the tracker ID + if (property_exists($this->cfg, 'tracker')) { + $this->trackerID = trim((string) $this->cfg->tracker); + if (strlen($this->trackerID) > 0 && + ! $this->checkTrackerIDSyntax($this->trackerID)) { + return false; + } + } else { + // tracker ID may be absent (bug creation from Testlink will not be possible) + $this->trackerID = ""; + } + + // check the base URI + if (property_exists($this->cfg, 'uribase')) { + $this->URIBase = trim((string) $this->cfg->uribase); + if (strlen($this->URIBase) > 0 && + ! $this->checkURLSyntax($this->URIBase)) { + return false; + } + } else { + return false; + } + } + + $this->completeCfg(); + $this->connect(); + $this->setResolvedStatusCfg(); + } + + /** + * checks a tracker id for validity (a numeric value) + * + * @param + * string tracker ID + * @return bool returns true if the tracker id has the right format + */ + private function checkTrackerIDSyntax($trackerID) + { + $valid = true; + $blackList = '/\D/i'; + if (preg_match($blackList, $trackerID)) { + $valid = false; + } else { + $valid = (intval($trackerID) > 0); + } + + return $valid; + } + + /** + * checks a URL for validity + * + * @param + * string URL + * @return bool returns true if the param is an URL + */ + private function checkURLSyntax($url) + { + return filter_var($url, FILTER_VALIDATE_URL) && + stripos($url, "http") === 0; + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * Set resolved status + * + * @author Aurelien TISNE + */ + public function setResolvedStatusCfg() + { + $statusCfg = $this->getResolvedStatus(); + if (! $statusCfg) { + if (property_exists($this->cfg, 'resolvedstatus')) { + $statusCfg = (array) $this->cfg->resolvedstatus; + } else { + $statusCfg['status'] = $this->defaultResolvedStatus; + } + } + + $this->resolvedStatus = new stdClass(); + foreach ($statusCfg['status'] as $cfx) { + $this->resolvedStatus->byName[] = $cfx; + } + } + + /** + * Get resolved status from ITS + * + * @author Aurelien TISNE + */ + public function getResolvedStatus() + { + if (! $this->isConnected()) { + return null; + } + + if ($this->trackerID == '') { + return null; + } + + $ret = null; + try { + $tracker = $this->APIClient->getTrackerById($this->trackerID); + if ($tracker) { + // field ID containing the status semantic + $statusID = $tracker->semantics->status->field_id; + // opened values ID + $statusValuesID = $tracker->semantics->status->value_ids; + // $ret = array(); + // retrieve the field containing the status semantic + $status = $this->getField($tracker, $statusID); + if (! $status) { + throw new Exception( + 'The field ' . $statusID . + ' cannot be found in the tracker "' . $tracker->label . + '" (' . $tracker->id . ').'); + } + + // retrieve the labels of closed status + $ret['status'] = $this->getClosedLabels($status, $statusValuesID); + // check that all labels have been found + if (count($ret['status']) != + (count($status->values) - count($statusValuesID))) { + throw new Exception('Some labels was not found.'); + } + } else { + throw new Exception( + 'The tracker ' . $this->trackerID . ' was not found.'); + } + } catch (Exception $e) { + tLog($e->getMessage(), 'ERROR'); + $ret = null; + } + + return $ret; + } + + /** + * Retrieve a field from a tracker + * + * @param object $tracker + * A tracker + * @param string $fieldID + * A tracker item ID + * + * @author Aurelien TISNE + */ + private function getField($tracker, $fieldID) + { + $i = count($tracker->fields); + $field = null; + while ($i > 0 && ! $field) { + if ($tracker->fields[$i - 1]->field_id == $fieldID) { + $field = $tracker->fields[$i - 1]; + } else { + $i -= 1; + } + } + + return $field; + } + + /** + * Retrieve labels of closed status values ID from the status field + * + * @param object $statusField + * Tracker field containing the status semantic + * @param array $valuesID + * List of opened values ID + * @author Aurelien TISNE + */ + private function getClosedLabels($statusField, $openValuesID) + { + if (! property_exists($statusField, "values")) { + return null; + } + + $ret = array(); + foreach ($statusField->values as $value) { + if (! in_array($value->id, $openValuesID)) { + $ret[] = $value->label; + } + } + + return $ret; + } + + /** + * checks id for validity + * + * @param + * string issueID + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxNumeric($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + $processCatch = false; + + try { + + $this->APIClient = new tuleap((string) trim($this->cfg->uriapi), + (string) trim($this->cfg->username), + (string) trim($this->cfg->password)); + + try { + $this->connected = $this->APIClient->Connect(); + } catch (Exception $e) { + $processCatch = true; + } + } catch (Exception $e) { + $processCatch = true; + } + + if ($processCatch) { + $logDetails = ''; + foreach (array( + 'uribase', + 'username' + ) as $v) { + $logDetails .= "$v={$this->cfg->$v} / "; + } + $logDetails = trim($logDetails, '/ '); + $this->connected = false; + tLog(__METHOD__ . " [$logDetails] " . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + private function buildStatusHTMLString($status) + { + if (in_array($status, $this->resolvedStatus->byName)) // Closed type status + { + $str = "" . $status . ""; + } else { + $str = $status; + } + return "[{$str}] "; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + return false; + } + + try { + $issue = $this->APIClient->getArtifactById((int) $issueID); + if (! is_null($issue) && is_object($issue)) { + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusVerbose = $issue->status; + $issue->statusHTMLString = $this->buildStatusHTMLString( + $issue->status); + $issue->summaryHTMLString = $issue->title; + + $issue->isResolved = isset( + $this->resolvedStatus->byName[$issue->statusVerbose]); + } + } catch (Exception $e) { + tLog($e->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return boolean + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + return $this->getIssueStatusCode($issueID); + } + + /** + * Returns a configuration template + * + * @return string + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "TULEAP LOGIN NAME\n" . + "TULEAP PASSWORD\n" . + "\n" . + "https://" . $_SERVER['SERVER_NAME'] . "\n" . + "\n" . + "\n" . + "\n" . + "https://" . $_SERVER['SERVER_NAME'] . "/api\n" . + "https://" . $_SERVER['SERVER_NAME'] . + "/plugins/tracker/?aid=\n" . "https://" . + $_SERVER['SERVER_NAME'] . + "/plugins/tracker/?func=new-artifact&tracker=TULEAP TRACKER ID\n" . + "\n" . + "\n" . + "\n" . + "TULEAP TRACKER ID\n" . + "\n" . + "\n" . + "\n" . "\n" . + "Fixed\n" . "Invalid\n" . + "Wont Fix\n" . "Works for me\n" . + "Duplicate\n" . "\n" . + "\n"; + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + // '/' at uribase name creates issue with API + $this->URIBase = trim($this->URIBase, "/"); + + $base = $this->URIBase . '/'; + + if (! property_exists($this->cfg, 'uriapi')) { + $this->cfg->uriapi = $base . 'api'; + } + + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'plugins/tracker/?aid='; + } + + if (! property_exists($this->cfg, 'uricreate')) { + if ($this->trackerID != "") { + $this->cfg->uricreate = $base . 'plugins/tracker/?tracker=' . + $this->trackerID . '&func=new-artifact'; + } else { + $this->cfg->uricreate = ''; + } + } + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = (! is_null($issue) && is_object($issue)); + } + return $status_ok; + } + + /** + */ + public function addIssue($summary, $description, $opt = null) + { + try { + $op = $this->APIClient->createIssue((int) $this->trackerID, $summary, + $description); + + if (is_null($op)) { + throw new Exception( + "Something's wrong when creating an artefact"); + } else { + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('tuleap_bug_created'), $summary, + (string) $op->tracker->project->id) + ); + } + } catch (Exception $e) { + $msg = "Create artifact FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg + ); + } + return $ret; + } + + /** + */ + public function addNote($bugId, $noteText, $opt = null) + { + if (! $this->isConnected()) { + return null; + } + + try { + $noteText = "Reporter: " . $opt->reporter . " <" . + $opt->reporter_email . ">\n" . $noteText; + $this->APIClient->addTrackerArtifactMessage((int) $bugId, $noteText); + $ret = array( + 'status_ok' => true, + 'msg' => sprintf(lang_get('tuleap_bug_comment'), $noteText) + ); + } catch (Exception $e) { + $msg = "Add note FAILURE for bug " . $bugId . " => " . + $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'msg' => $msg + ); + } + + return $ret; + } + + /** + */ + public function canCreateViaAPI() + { + return $this->trackerID !== ''; + } +} ?> diff --git a/lib/issuetrackerintegration/youtrackrestInterface.class.php b/lib/issuetrackerintegration/youtrackrestInterface.class.php index 996e615f1b..e5ce3c508e 100644 --- a/lib/issuetrackerintegration/youtrackrestInterface.class.php +++ b/lib/issuetrackerintegration/youtrackrestInterface.class.php @@ -1,288 +1,269 @@ -name = $name; - $this->interfaceViaDB = false; - $this->methodOpt = array('buildViewBugLink' => array('addSummary' => true, 'colorByStatus' => true)); - $this->connected = false; - if( $this->setCfg($config) ) - { - $this->completeCfg(); - $this->connect(); - } - } - - /** - * useful for testing - * - * - **/ - function getAPIClient() - { - return $this->APIClient; - } - - /** - * checks id for validity - * - * @param string issueID - * - * @return bool returns true if the bugid has the right format, false else - **/ - function checkBugIDSyntax($issueID) - { - return $this->checkBugIDSyntaxString($issueID); - } - - /** - * establishes connection to the bugtracking system - * - * @return bool - * - **/ - function connect() - { - try - { - $this->APIClient = new \YouTrack\Connection($this->cfg->uribase, - $this->cfg->username, $this->cfg->password); - $this->connected = true; - } - catch(Exception $e) - { - $this->connected = false; - tLog(__METHOD__ . $e->getMessage(), 'ERROR'); - } - } - - /** - * - * - **/ - function isConnected() - { - return $this->connected; - } - - - /** - * - * - **/ - function getIssue($issueID) - { - if (!$this->isConnected()) - { - return false; - } - - try - { - $issue = $this->APIClient->get_issue($issueID); - if( !is_null($issue) && is_object($issue) ) - { - $issue->IDHTMLString = "{$issueID} : "; - $issue->statusCode = $issue->State; - $issue->statusVerbose = $issue->statusCode; - $issue->statusHTMLString = "[$issue->statusCode] "; - $issue->summaryHTMLString = $issue->summary; - } - - } - catch(\YouTrack\YouTrackException $yte) - { - tLog($yte->getMessage(),'ERROR'); - $issue = null; - } - return $issue; - } - - - /** - * Returns status for issueID - * - * @param string issueID - * - * @return - **/ - function getIssueStatusCode($issueID) - { - $issue = $this->getIssue($issueID); - return (!is_null($issue) && is_object($issue))? $issue->statusCode : false; - } - - /** - * Returns status in a readable form (HTML context) for the bug with the given id - * - * @param string issueID - * - * @return string - * - **/ - function getIssueStatusVerbose($issueID) - { - $str = "Ticket ID - " . $issueID . " - does not exist in BTS"; - $issue = $this->getBugStatus($issueID); - if (!is_null($issue) && is_object($issue)) - { - $str = array_search($issue->status, $this->statusDomain); - if (strcasecmp($str, 'closed') == 0 || strcasecmp($str, 'resolved') == 0 ) - { - $str = "" . $str . ""; - } - $str = "" . $issueID . ": [" . $str . "] " ; - } - return $str; - } - - - - /** - * - * @author francisco.mancardi@gmail.com> - **/ - public static function getCfgTemplate() - { - $template = "\n" . - "\n" . - "YOUTRACK LOGIN NAME\n" . - "YOUTRACK PASSWORD\n" . - "\n" . - "\n" . - "http://testlink.myjetbrains.com/youtrack\n". - "\n" . - "YOUTRACK PROJECT ID\n". - "\n"; - return $template; - } - - - /** - * - * check for configuration attributes than can be provided on - * user configuration, but that can be considered standard. - * If they are MISSING we will use 'these carved on the stone values' - * in order to simplify configuration. - * - * - **/ - function completeCfg() - { - // '/' at uribase name creates issue with API - $this->cfg->uribase = trim((string)$this->cfg->uribase,"/"); - - $base = $this->cfg->uribase . '/'; - if( !property_exists($this->cfg,'uriview') ) - { - $this->cfg->uriview = $base . 'issue/'; - } - - if( !property_exists($this->cfg,'uricreate') ) - { - $this->cfg->uricreate = $base . 'dashboard#newissue=yes'; - } - - $this->issueTemplate = array(); - $this->issueDefaults = array('assignee' => '', 'priority' => '', 'type' => '', - 'subsystem' => '', 'state' => '', 'affectsversion' => '', - 'fixedversion' => '', 'fixedinbuild' => ''); - foreach($this->issueDefaults as $prop => $default) - { - $this->cfg->$prop = (string)(property_exists($this->cfg,$prop) ? $this->cfg->$prop : $default); - $this->issueTemplate[$prop] = $this->cfg->$prop; - } - - - - } - - /** - * @param string issueID - * - * @return bool true if issue exists on BTS - **/ - function checkBugIDExistence($issueID) - { - if(($status_ok = $this->checkBugIDSyntax($issueID))) - { - $issue = $this->getIssue($issueID); - $status_ok = (!is_null($issue) && is_object($issue)); - } - return $status_ok; - } - - /** - * - */ - public function addIssue($summary,$description) - { - try - { - $issue = $this->issueTemplate; - $op = $this->APIClient->create_issue((string)$this->cfg->project, $issue['assignee'], - $summary, $description, $issue['priority'], - $issue['type'], $issue['subsystem'], $issue['state'], - $issue['affectsversion'], - $issue['fixedversion'], $issue['fixedinbuild']); - - $ret = array('status_ok' => true, 'id' => (string)$op->id, - 'msg' => sprintf(lang_get('youtrack_bug_created'),$summary,(string)$this->cfg->project)); - } - catch (Exception $e) - { - $msg = "Create YOUTRACK Ticket FAILURE => " . $e->getMessage(); - tLog($msg, 'WARNING'); - $ret = array('status_ok' => false, 'id' => -1, 'msg' => $msg . ' - serialized issue:' . serialize($issue)); - } - return $ret; - } - - - /** - * - **/ - function canCreateViaAPI() - { - return (property_exists($this->cfg, 'project')); - } - - -} \ No newline at end of file +name = $name; + $this->interfaceViaDB = false; + $this->methodOpt = array( + 'buildViewBugLink' => array( + 'addSummary' => true, + 'colorByStatus' => true + ) + ); + $this->connected = false; + if ($this->setCfg($config)) { + $this->completeCfg(); + $this->connect(); + } + } + + /** + * useful for testing + */ + public function getAPIClient() + { + return $this->APIClient; + } + + /** + * checks id for validity + * + * @param + * string issueID + * + * @return bool returns true if the bugid has the right format, false else + */ + public function checkBugIDSyntax($issueID) + { + return $this->checkBugIDSyntaxString($issueID); + } + + /** + * establishes connection to the bugtracking system + * + * @return bool + */ + public function connect() + { + try { + $this->APIClient = new \YouTrack\Connection($this->cfg->uribase, + $this->cfg->username, $this->cfg->password); + $this->connected = true; + } catch (Exception $e) { + $this->connected = false; + tLog(__METHOD__ . $e->getMessage(), 'ERROR'); + } + } + + /** + */ + public function isConnected() + { + return $this->connected; + } + + /** + */ + public function getIssue($issueID) + { + if (! $this->isConnected()) { + return false; + } + + try { + $issue = $this->APIClient->get_issue($issueID); + if (! is_null($issue) && is_object($issue)) { + $issue->IDHTMLString = "{$issueID} : "; + $issue->statusCode = $issue->State; + $issue->statusVerbose = $issue->statusCode; + $issue->statusHTMLString = "[$issue->statusCode] "; + $issue->summaryHTMLString = $issue->summary; + } + } catch (\YouTrack\YouTrackException $yte) { + tLog($yte->getMessage(), 'ERROR'); + $issue = null; + } + return $issue; + } + + /** + * Returns status for issueID + * + * @param + * string issueID + * @return + */ + public function getIssueStatusCode($issueID) + { + $issue = $this->getIssue($issueID); + return (! is_null($issue) && is_object($issue)) ? $issue->statusCode : false; + } + + /** + * Returns status in a readable form (HTML context) for the bug with the given id + * + * @param + * string issueID + * @return string + */ + public function getIssueStatusVerbose($issueID) + { + $str = "Ticket ID - " . $issueID . " - does not exist in BTS"; + $issue = $this->getBugStatus($issueID); + if (! is_null($issue) && is_object($issue)) { + $str = array_search($issue->status, $this->statusDomain); + if (strcasecmp($str, 'closed') == 0 || + strcasecmp($str, 'resolved') == 0) { + $str = "" . $str . ""; + } + $str = "" . $issueID . ": [" . $str . "] "; + } + return $str; + } + + /** + * + * @author francisco.mancardi@gmail.com> + */ + public static function getCfgTemplate() + { + return "\n" . "\n" . + "YOUTRACK LOGIN NAME\n" . + "YOUTRACK PASSWORD\n" . + "\n" . + "\n" . + "http://testlink.myjetbrains.com/youtrack\n" . + "\n" . + "YOUTRACK PROJECT ID\n" . "\n"; + } + + /** + * check for configuration attributes than can be provided on + * user configuration, but that can be considered standard. + * If they are MISSING we will use 'these carved on the stone values' + * in order to simplify configuration. + */ + private function completeCfg() + { + // '/' at uribase name creates issue with API + $this->cfg->uribase = trim((string) $this->cfg->uribase, "/"); + + $base = $this->cfg->uribase . '/'; + if (! property_exists($this->cfg, 'uriview')) { + $this->cfg->uriview = $base . 'issue/'; + } + + if (! property_exists($this->cfg, 'uricreate')) { + $this->cfg->uricreate = $base . 'dashboard#newissue=yes'; + } + + $this->issueTemplate = array(); + $this->issueDefaults = array( + 'assignee' => '', + 'priority' => '', + 'type' => '', + 'subsystem' => '', + 'state' => '', + 'affectsversion' => '', + 'fixedversion' => '', + 'fixedinbuild' => '' + ); + foreach ($this->issueDefaults as $prop => $default) { + $this->cfg->$prop = (string) (property_exists($this->cfg, $prop) ? $this->cfg->$prop : $default); + $this->issueTemplate[$prop] = $this->cfg->$prop; + } + } + + /** + * + * @param + * string issueID + * + * @return bool true if issue exists on BTS + */ + public function checkBugIDExistence($issueID) + { + if ($status_ok = $this->checkBugIDSyntax($issueID)) { + $issue = $this->getIssue($issueID); + $status_ok = (! is_null($issue) && is_object($issue)); + } + return $status_ok; + } + + /** + */ + public function addIssue($summary, $description) + { + try { + $issue = $this->issueTemplate; + $op = $this->APIClient->create_issue((string) $this->cfg->project, + $issue['assignee'], $summary, $description, $issue['priority'], + $issue['type'], $issue['subsystem'], $issue['state'], + $issue['affectsversion'], $issue['fixedversion'], + $issue['fixedinbuild']); + + $ret = array( + 'status_ok' => true, + 'id' => (string) $op->id, + 'msg' => sprintf(lang_get('youtrack_bug_created'), $summary, + (string) $this->cfg->project) + ); + } catch (Exception $e) { + $msg = "Create YOUTRACK Ticket FAILURE => " . $e->getMessage(); + tLog($msg, 'WARNING'); + $ret = array( + 'status_ok' => false, + 'id' => - 1, + 'msg' => $msg . ' - serialized issue:' . serialize($issue) + ); + } + return $ret; + } + + /** + */ + public function canCreateViaAPI() + { + return property_exists($this->cfg, 'project'); + } +} diff --git a/lib/issuetrackers/issueTrackerCommands.class.php b/lib/issuetrackers/issueTrackerCommands.class.php index 421e2bb75d..ae19e335e1 100644 --- a/lib/issuetrackers/issueTrackerCommands.class.php +++ b/lib/issuetrackers/issueTrackerCommands.class.php @@ -1,286 +1,286 @@ -db=$dbHandler; - $this->issueTrackerMgr = new tlIssueTracker($dbHandler); - $this->entitySpec = $this->issueTrackerMgr->getEntitySpec(); - - $this->grants=new stdClass(); - $this->grants->canManage = false; - - $this->guiOpWhiteList = array_flip(array('checkConnection','create','edit', - 'delete','doCreate', - 'doUpdate','doDelete')); - } - - /** - * - */ - function setTemplateCfg($cfg) { - $this->templateCfg = $cfg; - } - - /** - * - */ - function getGuiOpWhiteList() { - return $this->guiOpWhiteList; - } - - /** - * - * - */ - function initGuiBean(&$argsObj, $caller) { - $obj = new stdClass(); - $obj->action = $caller; - $obj->typeDomain = $this->issueTrackerMgr->getTypes(); - $obj->canManage = $argsObj->currentUser->hasRight($this->db,'issuetracker_management'); - $obj->user_feedback = array('type' => '', 'message' => ''); - - $obj->l18n = init_labels(array('issuetracker_management' => null, - 'btn_save' => null,'create' => null, - 'edit' => null, - 'checkConnection' => 'btn_check_connection', - 'issuetracker_deleted' => null)); - - // we experiment on way to get Action Description for GUI using __FUNCTION__ - $obj->l18n['doUpdate'] = $obj->l18n['edit']; - $obj->l18n['doCreate'] = $obj->l18n['create']; - $obj->l18n['doDelete'] = ''; - $obj->main_descr = $obj->l18n['issuetracker_management']; - $obj->action_descr = ucfirst($obj->l18n[$caller]); - - $obj->connectionStatus = ''; - - switch($caller) { - case 'delete': - case 'doDelete': - $obj->submit_button_label = ''; - break; - - default: - $obj->submit_button_label = $obj->l18n['btn_save']; - break; - } - - return $obj; - } - - /** - * - * - */ - function create(&$argsObj,$request,$caller=null) - { - $guiObj = $this->initGuiBean($argsObj,(is_null($caller) ? __FUNCTION__ : $caller)); - $templateCfg = templateConfiguration('issueTrackerEdit'); - $guiObj->template = $templateCfg->default_template; - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'issuetracker_management'); - - $guiObj->item = array('id' => 0); - $dummy = ''; - foreach($this->entitySpec as $property => $type) - { - $guiObj->item[$property] = ($type == 'int') ? 0 :''; - } - return $guiObj; - } - - /** - * - * - */ - function doCreate(&$argsObj,$request) - { - $guiObj = $this->create($argsObj,$request,__FUNCTION__); - - // Checks are centralized on create() - $it = new stdClass(); - foreach($this->entitySpec as $property => $type) - { - $it->$property = $argsObj->$property; - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$it; - - $op = $this->issueTrackerMgr->create($it); - if($op['status_ok']) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "issueTrackerView.php"; - } - else - { - $templateCfg = templateConfiguration('issueTrackerEdit'); - $guiObj->template=$templateCfg->default_template; - $guiObj->user_feedback['message'] = $op['msg']; - } - - return $guiObj; - } - - - - - /* - function: edit - - args: - - returns: - - */ - function edit(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $templateCfg = templateConfiguration('issueTrackerEdit'); - $guiObj->template = $templateCfg->default_template; - - $guiObj->item = $this->issueTrackerMgr->getByID($argsObj->id); - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'issuetracker_management'); - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $it = new stdClass(); - $it->id = $argsObj->id; - foreach($this->entitySpec as $property => $type) - { - $it->$property = $argsObj->$property; - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$it; - - $op = $this->issueTrackerMgr->update($it); - if( $op['status_ok'] ) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "issueTrackerView.php"; - - if( isset($_SESSION['its'][$it->name]) ) - { - unset($_SESSION['its'][$it->name]); - } - } - else - { - $guiObj->user_feedback['message'] = $op['msg']; - $guiObj->template = null; - } - - return $guiObj; - } - - /** - * - * - */ - function doDelete(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - // get minimal info for user feedback before deleting - // $it = $this->issueTrackerMgr->getByID($argsObj->id); - $op = $this->issueTrackerMgr->delete($argsObj->id); - - // http://www.plus2net.com/php_tutorial/variables.php - //if($op['status_ok']) - //{ - // $msg = sprintf($this->guiObj->l18n['issuetracker_deleted'],$it['name']); - //} - //else - //{ - // $msg = $op['msg']; - //} - //$_SESSION['issueTrackerView.user_feedback'] = $msg; - - $guiObj->action = 'doDelete'; - $guiObj->template = "issueTrackerView.php?"; - - return $guiObj; - } - - - /** - * - */ - function checkConnection(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'issuetracker_management'); - - $tplCfg = templateConfiguration('issueTrackerEdit'); - $guiObj->template = $tplCfg->default_template; - - if( $argsObj->id > 0 ) - { - $ixx = $this->issueTrackerMgr->getByID($argsObj->id); - $guiObj->item['id'] = $ixx['id']; - } - else - { - $guiObj->operation = 'doCreate'; - $guiObj->item['id'] = 0; - } - - $guiObj->item['name'] = $argsObj->name; - $guiObj->item['type'] = $argsObj->type; - $guiObj->item['cfg'] = $argsObj->cfg; - $guiObj->item['implementation'] = - $this->issueTrackerMgr->getImplementationForType($argsObj->type); - - $class2create = $guiObj->item['implementation']; - - $its = new $class2create($argsObj->type,$argsObj->cfg,$argsObj->name); - $guiObj->connectionStatus = $its->isConnected() ? 'ok' : 'ko'; - - return $guiObj; - } - -} // end class +db = $dbHandler; + $this->issueTrackerMgr = new tlIssueTracker($dbHandler); + $this->entitySpec = $this->issueTrackerMgr->getEntitySpec(); + + $this->grants = new stdClass(); + $this->grants->canManage = false; + + $this->guiOpWhiteList = array_flip( + array( + 'checkConnection', + 'create', + 'edit', + 'delete', + 'doCreate', + 'doUpdate', + 'doDelete' + )); + } + + /** + */ + public function setTemplateCfg($cfg) + { + $this->templateCfg = $cfg; + } + + /** + */ + public function getGuiOpWhiteList() + { + return $this->guiOpWhiteList; + } + + /** + */ + public function initGuiBean(&$argsObj, $caller) + { + $obj = new stdClass(); + $obj->action = $caller; + $obj->typeDomain = $this->issueTrackerMgr->getTypes(); + $obj->canManage = $argsObj->currentUser->hasRight($this->db, + 'issuetracker_management'); + $obj->user_feedback = array( + 'type' => '', + 'message' => '' + ); + + $obj->l18n = init_labels( + array( + 'issuetracker_management' => null, + 'btn_save' => null, + 'create' => null, + 'edit' => null, + 'checkConnection' => 'btn_check_connection', + 'issuetracker_deleted' => null + )); + + // we experiment on way to get Action Description for GUI using __FUNCTION__ + $obj->l18n['doUpdate'] = $obj->l18n['edit']; + $obj->l18n['doCreate'] = $obj->l18n['create']; + $obj->l18n['doDelete'] = ''; + $obj->main_descr = $obj->l18n['issuetracker_management']; + $obj->action_descr = ucfirst($obj->l18n[$caller]); + + $obj->connectionStatus = ''; + + switch ($caller) { + case 'delete': + case 'doDelete': + $obj->submit_button_label = ''; + break; + + default: + $obj->submit_button_label = $obj->l18n['btn_save']; + break; + } + + return $obj; + } + + /** + */ + public function create(&$argsObj, $request, $caller = null) + { + $guiObj = $this->initGuiBean($argsObj, + (is_null($caller) ? __FUNCTION__ : $caller)); + $templateCfg = templateConfiguration('issueTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'issuetracker_management'); + + $guiObj->item = array( + 'id' => 0 + ); + foreach ($this->entitySpec as $property => $type) { + $guiObj->item[$property] = ($type == 'int') ? 0 : ''; + } + return $guiObj; + } + + /** + */ + public function doCreate(&$argsObj, $request) + { + $guiObj = $this->create($argsObj, $request, __FUNCTION__); + + // Checks are centralized on create() + $it = new stdClass(); + foreach ($this->entitySpec as $property => $type) { + $it->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $it; + + $op = $this->issueTrackerMgr->create($it); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "issueTrackerView.php"; + } else { + $templateCfg = templateConfiguration('issueTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->user_feedback['message'] = $op['msg']; + } + + return $guiObj; + } + + /* + * function: edit + * + * args: + * + * returns: + * + */ + public function edit(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $templateCfg = templateConfiguration('issueTrackerEdit'); + $guiObj->template = $templateCfg->default_template; + + $guiObj->item = $this->issueTrackerMgr->getByID($argsObj->id); + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'issuetracker_management'); + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $it = new stdClass(); + $it->id = $argsObj->id; + foreach ($this->entitySpec as $property => $type) { + $it->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $it; + + $op = $this->issueTrackerMgr->update($it); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "issueTrackerView.php"; + + if (isset($_SESSION['its'][$it->name])) { + unset($_SESSION['its'][$it->name]); + } + } else { + $guiObj->user_feedback['message'] = $op['msg']; + $guiObj->template = null; + } + + return $guiObj; + } + + /** + */ + public function doDelete(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + // get minimal info for user feedback before deleting + // $it = $this->issueTrackerMgr->getByID($argsObj->id); + $this->issueTrackerMgr->delete($argsObj->id); + + // http://www.plus2net.com/php_tutorial/variables.php + // if($op['status_ok']) + // { + // $msg = sprintf($this->guiObj->l18n['issuetracker_deleted'],$it['name']); + // } + // else + // { + // $msg = $op['msg']; + // } + // $_SESSION['issueTrackerView.user_feedback'] = $msg; + + $guiObj->action = 'doDelete'; + $guiObj->template = "issueTrackerView.php?"; + + return $guiObj; + } + + /** + */ + public function checkConnection(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'issuetracker_management'); + + $tplCfg = templateConfiguration('issueTrackerEdit'); + $guiObj->template = $tplCfg->default_template; + + if ($argsObj->id > 0) { + $ixx = $this->issueTrackerMgr->getByID($argsObj->id); + $guiObj->item['id'] = $ixx['id']; + } else { + $guiObj->operation = 'doCreate'; + $guiObj->item['id'] = 0; + } + + $guiObj->item['name'] = $argsObj->name; + $guiObj->item['type'] = $argsObj->type; + $guiObj->item['cfg'] = $argsObj->cfg; + $guiObj->item['implementation'] = $this->issueTrackerMgr->getImplementationForType( + $argsObj->type); + + $class2create = $guiObj->item['implementation']; + + $its = new $class2create($argsObj->type, $argsObj->cfg, $argsObj->name); + $guiObj->connectionStatus = $its->isConnected() ? 'ok' : 'ko'; + + return $guiObj; + } +} // end class diff --git a/lib/issuetrackers/issueTrackerEdit.php b/lib/issuetrackers/issueTrackerEdit.php index 9f1541f1a3..9bb23d93c6 100644 --- a/lib/issuetrackers/issueTrackerEdit.php +++ b/lib/issuetrackers/issueTrackerEdit.php @@ -1,166 +1,217 @@ -doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) { - $op = $commandMgr->$pFn($args,$_REQUEST); +doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_REQUEST); +} + +renderGui($args, $gui, $op, $templateCfg); + +/** + */ +function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg) +{ + $smartyObj = new TLSmarty(); + $renderType = 'none'; + + // key: gui action + // value: next gui action (used to set value of action button on gui) + $actionOperation = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'checkConnection' => 'doCreate' + ); + + if ($argsObj->id > 0) { + $actionOperation['checkConnection'] = 'doUpdate'; + } + + // Get rendering type and set variable for template + switch ($argsObj->doAction) { + case "edit": + case "create": + case "doDelete": + case "doCreate": + case "doUpdate": + case "checkConnection": + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + $renderType = 'redirect'; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = $tplDir . $tpl; + $renderType = 'template'; + } + break; + } + + // execute rendering + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/** + * Initializes the script + * + * @param database $dbHandler + * @return issueTrackerCommands[]|stdClass[]|issueTrackerCommands[] + */ +function initScript(&$dbHandler) +{ + $mgr = new issueTrackerCommands($dbHandler); + $args = initArgs(array( + 'doAction' => $mgr->getGuiOpWhiteList() + )); + $gui = initializeGui($dbHandler, $args, $mgr); + return array( + $args, + $gui, + $mgr + ); +} + +/** + * Get input from user and return it in some sort of namespace + * + * @param array $whiteList + * @return stdClass object returns the arguments for the page + */ +function initArgs($whiteList) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "name" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "cfg" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ), + "type" => array( + tlInputParameter::INT_N + ) + ); + + R_PARAMS($iParams, $args); + + // sanitize via whitelist + foreach ($whiteList as $inputKey => $allowedValues) { + if (property_exists($args, $inputKey) && + ! isset($allowedValues[$args->$inputKey])) { + $msg = "Input parameter $inputKey - white list validation failure - " . + "Value:" . $args->$inputKey . " - " . "File: " . + basename(__FILE__) . " - Function: " . __FUNCTION__; + tLog($msg, 'ERROR'); + throw new Exception($msg); + } + } + + $args->currentUser = $_SESSION['currentUser']; + + return $args; +} + +/** + * Initializes the GUI + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param issueTrackerCommands $commandMgr + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj, &$commandMgr) +{ + $gui = new stdClass(); + $gui->main_descr = ''; + $gui->action_descr = ''; + $gui->user_feedback = array( + 'type' => '', + 'message' => '' + ); + $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler, + 'mgt_view_events'); + + // get affected test projects + $gui->testProjectSet = null; + if ($argsObj->id > 0) { + // just to fix erroneous test project delete + $dummy = $commandMgr->issueTrackerMgr->getLinks($argsObj->id, + array( + 'getDeadLinks' => true + )); + if (! is_null($dummy)) { + foreach ($dummy as $key => $elem) { + $commandMgr->issueTrackerMgr->unlink($argsObj->id, $key); + } + } + + // Now get good info + $gui->testProjectSet = $commandMgr->issueTrackerMgr->getLinks( + $argsObj->id); + } + return $gui; +} + +/** + * Checks the user rights for accessing the page + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'issuetracker_management'); } - -renderGui($db,$args,$gui,$op,$templateCfg); - - -/** - */ -function renderGui(&$dbHandler,&$argsObj,$guiObj,$opObj,$templateCfg) { - $smartyObj = new TLSmarty(); - $renderType = 'none'; - - // key: gui action - // value: next gui action (used to set value of action button on gui) - $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doCreate' => 'doCreate', - 'doUpdate' => 'doUpdate', - 'checkConnection' => 'doCreate'); - - if($argsObj->id > 0) { - $actionOperation['checkConnection'] = 'doUpdate'; - } - - // Get rendering type and set variable for template - switch($argsObj->doAction) { - case "edit": - case "create": - case "doDelete": - case "doCreate": - case "doUpdate": - case "checkConnection"; - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) { - $guiObj->$key = $value; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - $renderType = 'redirect'; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - $pos = strpos($tpl, '.php'); - if($pos === false) { - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = $tplDir . $tpl; - $renderType = 'template'; - } - break; - } - - // execute rendering - switch($renderType) { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } -} - -/** - * - */ -function initScript(&$dbHandler) { - $mgr = new issueTrackerCommands($dbHandler); - $args = init_args(array('doAction' => $mgr->getGuiOpWhiteList())); - $gui = initializeGui($dbHandler,$args,$mgr); - return array($args,$gui,$mgr); -} - -/** - * @return object returns the arguments for the page - */ -function init_args($whiteList) { - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - $iParams = array("id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,20), - "name" => array(tlInputParameter::STRING_N,0,100), - "cfg" => array(tlInputParameter::STRING_N,0,2000), - "type" => array(tlInputParameter::INT_N)); - - R_PARAMS($iParams,$args); - - // sanitize via whitelist - foreach($whiteList as $inputKey => $allowedValues) { - if( property_exists($args,$inputKey) ) { - if( !isset($allowedValues[$args->$inputKey]) ) { - $msg = "Input parameter $inputKey - white list validation failure - " . - "Value:" . $args->$inputKey . " - " . - "File: " . basename(__FILE__) . " - Function: " . __FUNCTION__ ; - tLog($msg,'ERROR'); - throw new Exception($msg); - } - } - } - - $args->currentUser = $_SESSION['currentUser']; - - return $args; -} - - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,&$commandMgr) { - $gui = new stdClass(); - $gui->main_descr = ''; - $gui->action_descr = ''; - $gui->user_feedback = array('type' => '', 'message' => ''); - $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler,'mgt_view_events'); - - // get affected test projects - $gui->testProjectSet = null; - if($argsObj->id > 0) { - // just to fix erroneous test project delete - $dummy = $commandMgr->issueTrackerMgr->getLinks($argsObj->id,array('getDeadLinks' => true)); - if( !is_null($dummy) ) { - foreach($dummy as $key => $elem) { - $commandMgr->issueTrackerMgr->unlink($argsObj->id,$key); - } - } - - // Now get good info - $gui->testProjectSet = $commandMgr->issueTrackerMgr->getLinks($argsObj->id); - } - return $gui; -} - - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) { - return $user->hasRight($db,'issuetracker_management'); -} \ No newline at end of file diff --git a/lib/issuetrackers/issueTrackerView.php b/lib/issuetrackers/issueTrackerView.php index 899546eec2..e9638845e2 100644 --- a/lib/issuetrackers/issueTrackerView.php +++ b/lib/issuetrackers/issueTrackerView.php @@ -1,66 +1,82 @@ -items = $issueTrackerMgr->getAll(array('output' => 'add_link_count', 'checkEnv' => true)); -$gui->canManage = $args->currentUser->hasRight($db,"issuetracker_management"); -$gui->user_feedback = $args->user_feedback; - -if($args->id > 0) { - $gui->items[$args->id]['connection_status'] = $issueTrackerMgr->checkConnection($args->id) ? 'ok' : 'ko'; +items = $issueTrackerMgr->getAll( + array( + 'output' => 'add_link_count', + 'checkEnv' => true + )); +$gui->canManage = $args->currentUser->hasRight($db, "issuetracker_management"); +$gui->user_feedback = $args->user_feedback; + +if ($args->id > 0) { + $gui->items[$args->id]['connection_status'] = $issueTrackerMgr->checkConnection( + $args->id) ? 'ok' : 'ko'; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass $args object returns the arguments for the page + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + $args->currentUser = $_SESSION['currentUser']; + $args->user_feedback = array( + 'type' => '', + 'message' => '' + ); + + // only way I've found in order to give feedback for delete + // need to undertand if we really need/want to do all this mess + // $args->user_feedback = array('type' => '', 'message' => ''); + // if( isset($_SESSION['issueTrackerView.user_feedback']) ) + // { + // $args->user_feedback = array('type' => '', 'message' => $_SESSION['issueTrackerView.user_feedback']); + // unset($_SESSION['issueTrackerView.user_feedback']); + // } + + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + return $args; +} + +/** + * Checks the user rights for accessing the page + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "issuetracker_view") || + $user->hasRight($db, "issuetracker_management"); } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * @return object returns the arguments for the page - */ -function init_args() { - $args = new stdClass(); - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - - $args->currentUser = $_SESSION['currentUser']; - - $args->user_feedback = array('type' => '', 'message' => ''); - - // only way I've found in order to give feedback for delete - // need to undertand if we really need/want to do all this mess - // $args->user_feedback = array('type' => '', 'message' => ''); - // if( isset($_SESSION['issueTrackerView.user_feedback']) ) - // { - // $args->user_feedback = array('type' => '', 'message' => $_SESSION['issueTrackerView.user_feedback']); - // unset($_SESSION['issueTrackerView.user_feedback']); - // } - - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - return $args; -} - -/** - * - */ -function checkRights(&$db,&$user) { - return $user->hasRight($db,"issuetracker_view") || $user->hasRight($db,"issuetracker_management"); -} \ No newline at end of file diff --git a/lib/keywords/keywordsAssign.php b/lib/keywords/keywordsAssign.php index 2a15f03624..3373f9e11c 100644 --- a/lib/keywords/keywordsAssign.php +++ b/lib/keywords/keywordsAssign.php @@ -1,239 +1,297 @@ -js_ot_name = 'ot'; -$args = init_args($opt_cfg); - -$gui = initializeGui($args); - -if ($args->edit == 'testproject') { - // We can NOT assign/remove keywords on a whole test project - show_instructions('keywordsAssign'); - exit(); +js_ot_name = 'ot'; +$args = initArgs($opt_cfg); + +$gui = initializeGui($args); + +if ($args->edit == 'testproject') { + // We can NOT assign/remove keywords on a whole test project + show_instructions('keywordsAssign'); + exit(); +} + +$smarty = new TLSmarty(); +$tproject_mgr = new testproject($db); +$tcaseMgr = new testcase($db); + +$result = null; + +// Important Development Notice +// option transfer do the magic on GUI, +// analizing content of from->map and to->map, is able to populate +// each side as expected. +// +$opt_cfg->global_lbl = ''; +$opt_cfg->additional_global_lbl = null; +$opt_cfg->from->lbl = lang_get('available_kword'); +$opt_cfg->from->map = $tproject_mgr->get_keywords_map($args->testproject_id); + +switch ($args->edit) { + + case 'testsuite': + $opt_cfg->to->lbl = lang_get('target_kword'); + $opt_cfg->to->map = null; + + // We are going to walk all test suites contained + // in the selected container, and assign/remove keywords on each test case. + $tsuite_mgr = new testsuite($db); + $testsuite = $tsuite_mgr->get_by_id($args->id); + $gui->keyword_assignment_subtitle = lang_get('test_suite') . TITLE_SEP . + $testsuite['name']; + + if ($args->onlyDirectChildren) { + $tsChildren = $tsuite_mgr->get_children_testcases($args->id, + 'only_id'); + } else { + if ($args->useFilteredSet) { + $filteredTC = $args->tcaseSet; + } else { + $deepTC = $tsuite_mgr->get_testcases_deep($args->id, 'only_id'); + } + } + + if ($args->onlyDirectChildren && $args->useFilteredSet && + ! empty($tsChildren) && ! empty($filteredTC)) { + $tcs = array_intersect($tsChildren, $filteredTC); + } else { + if ($args->useFilteredSet && ! empty($filteredTC)) { + $tcs = &$filteredTC; + } elseif ($args->onlyDirectChildren) { + $tcs = &$tsChildren; + } else { + $tcs = &$deepTC; + } + } + + if ($loop2do = count($tcs)) { + $gui->can_do = 1; + + $method = null; + if ($args->assignToTestSuite && null != $args->keywordArray) { + $method = 'addKeywords'; + } + + if ($args->removeFromTestSuite && null != $args->keywordArray) { + $method = 'deleteKeywords'; + } + + if ($args->removeAllFromTestSuite) { + $method = 'deleteKeywords'; + } + + if (null != $method) { + $result = 'ok'; + $glOpt = array( + 'output' => 'thin', + 'active' => 1 + ); + + for ($idx = 0; $idx < $loop2do; $idx ++) { + $ltcv = $tcaseMgr->getLastVersionInfo($tcs[$idx], $glOpt); + $latestActiveVersionID = $ltcv['tcversion_id']; + $statusQuo = current( + $tcaseMgr->getVersionsStatusQuo($tcs[$idx], + $latestActiveVersionID)); + + $hasBeenExecuted = intval($statusQuo['executed']) > 0; + if ($gui->canAddRemoveKWFromExecuted || ! $hasBeenExecuted) { + $tcaseMgr->$method($tcs[$idx], $latestActiveVersionID, + $args->keywordArray); + } + } + } + } + break; + + case 'testcase': + $doRecall = true; + $gui->can_do = 1; + + $tcName = $tcaseMgr->getName($args->id); + $gui->keyword_assignment_subtitle = lang_get('test_case') . TITLE_SEP . + $tcName; + + // Now we work only on latest active version. + // We also need to check if has been executed + $glOpt = array( + 'output' => 'thin', + 'active' => 1 + ); + $ltcv = $tcaseMgr->getLastVersionInfo($args->id, $glOpt); + $latestActiveVersionID = $ltcv['tcversion_id']; + + $statusQuo = current( + $tcaseMgr->getVersionsStatusQuo($args->id, $latestActiveVersionID)); + $gui->hasBeenExecuted = intval($statusQuo['executed']) > 0; + + if ($gui->canAddRemoveKWFromExecuted || ! $gui->hasBeenExecuted) { + $kwQty = ! is_null($args->keywordArray) ? count($args->keywordArray) : 0; + if ($args->assignToTestCase && $kwQty > 0) { + $result = 'ok'; + $tcaseMgr->setKeywords($args->id, $latestActiveVersionID, + $args->keywordArray); + $doRecall = ! is_null($args->keywordArray); + } + } + + $opt_cfg->to->lbl = lang_get('assigned_kword'); + $opt_cfg->to->map = $doRecall ? $tcaseMgr->get_keywords_map($args->id, + $latestActiveVersionID, + array( + 'orderByClause' => " ORDER BY keyword ASC " + )) : null; + break; +} + +keywords_opt_transf_cfg($opt_cfg, $args->keywordList); + +$smarty->assign('gui', $gui); +$smarty->assign('sqlResult', $result); +$smarty->assign('opt_cfg', $opt_cfg); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @param stdClass $opt_cfg + * @return stdClass object returns the arguments for the page + */ +function initArgs(&$opt_cfg) +{ + $rl_html_name = $opt_cfg->js_ot_name . "_newRight"; + + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ), + "edit" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "assigntestcase" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "assigntestsuite" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "removetestcase" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "removetestsuite" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "removealltestcase" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "removealltestsuite" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + $rl_html_name => array( + tlInputParameter::STRING_N + ) + ); + + $args = new stdClass(); + $pParams = R_PARAMS($iParams, $args); + + $args->id = $pParams["id"]; + $args->edit = $pParams["edit"]; + + $args->assignToTestCase = ($pParams["assigntestcase"] != "") ? 1 : 0; + $args->assignToTestSuite = ($pParams["assigntestsuite"] != "") ? 1 : 0; + + $args->removeFromTestCase = ($pParams["removetestcase"] != "") ? 1 : 0; + $args->removeFromTestSuite = ($pParams["removetestsuite"] != "") ? 1 : 0; + + $args->removeAllFromTestCase = ($pParams["removealltestcase"] != "") ? 1 : 0; + $args->removeAllFromTestSuite = ($pParams["removealltestsuite"] != "") ? 1 : 0; + + $args->useFilteredSet = isset($_REQUEST['useFilteredSet']) ? 1 : 0; + $args->onlyDirectChildren = isset($_REQUEST['onlyDirectChildren']) ? 1 : 0; + + $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $args->tcaseSet = isset($_SESSION['edit_mode']) && + isset($_SESSION['edit_mode'][$args->form_token]['testcases_to_show']) ? $_SESSION['edit_mode'][$args->form_token]['testcases_to_show'] : null; + + $args->keywordArray = null; + $args->keywordList = $pParams[$rl_html_name]; + if ($args->keywordList != "") { + $args->keywordArray = explode(",", $args->keywordList); + } + + $args->user = $_SESSION['currentUser']; + return $args; +} + +/** + * Initializes the GUI + * + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->can_do = 0; + $guiObj->form_token = $argsObj->form_token; + $guiObj->useFilteredSet = $argsObj->useFilteredSet; + $guiObj->onlyDirectChildren = $argsObj->onlyDirectChildren; + $guiObj->id = $argsObj->id; + $guiObj->level = $argsObj->edit; + $guiObj->keyword_assignment_subtitle = null; + + $guiObj->canAddRemoveKWFromExecuted = $argsObj->user->hasRightOnProj($db, + 'testproject_add_remove_keywords_executed_tcversions') || + $argsObj->user->hasRightOnProj($db, + 'testproject_edit_executed_testcases'); + + return $guiObj; +} + +/** + * Checks the user rights for accessing the page + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'keyword_assignment'); } - -$smarty = new TLSmarty(); -$tproject_mgr = new testproject($db); -$tcase_mgr = new testcase($db); - -$result = null; - -// Important Development Notice -// option transfer do the magic on GUI, -// analizing content of from->map and to->map, is able to populate -// each side as expected. -// -$opt_cfg->global_lbl = ''; -$opt_cfg->additional_global_lbl = null; -$opt_cfg->from->lbl = lang_get('available_kword'); -$opt_cfg->from->map = $tproject_mgr->get_keywords_map($args->testproject_id); - -switch($args->edit) { - - case 'testsuite': - $opt_cfg->to->lbl = lang_get('target_kword'); - $opt_cfg->to->map = null; - - // We are going to walk all test suites contained - // in the selected container, and assign/remove keywords on each test case. - $tsuite_mgr = new testsuite($db); - $testsuite = $tsuite_mgr->get_by_id($args->id); - $gui->keyword_assignment_subtitle = lang_get('test_suite') . TITLE_SEP . $testsuite['name']; - - if ($args->onlyDirectChildren) { - $tsChildren = $tsuite_mgr->get_children_testcases($args->id,'only_id'); - } else { - if($args->useFilteredSet) { - $filteredTC = $args->tcaseSet; - } else { - $deepTC = $tsuite_mgr->get_testcases_deep($args->id,'only_id'); - } - } - - if ($args->onlyDirectChildren && $args->useFilteredSet) { - // intersect - $tcs = array_intersect($tsChildren, $filteredTC); - } else { - if ($args->useFilteredSet) { - $tcs = &$filteredTC; - } else if ($args->onlyDirectChildren) { - $tcs = &$tsChildren; - } else { - $tcs = &$deepTC; - } - } - - if( ($loop2do = sizeof($tcs)) ) { - $gui->can_do = 1; - - $method = null; - if ($args->assignToTestSuite && null != $args->keywordArray) { - $method = 'addKeywords'; - } - - if ($args->removeFromTestSuite && null != $args->keywordArray) { - $method = 'deleteKeywords'; - } - - if ($args->removeAllFromTestSuite) { - $method = 'deleteKeywords'; - } - - if (null != $method) { - $result = 'ok'; - $glOpt = array('output' => 'thin', 'active' => 1); - - for($idx = 0; $idx < $loop2do; $idx++) { - $ltcv = $tcase_mgr->get_last_version_info($tcs[$idx],$glOpt); - $latestActiveVersionID = $ltcv['tcversion_id']; - $statusQuo = current($tcase_mgr->get_versions_status_quo($tcs[$idx],$latestActiveVersionID)); - - $hasBeenExecuted = intval($statusQuo['executed']) > 0; - if( $gui->canAddRemoveKWFromExecuted || - $hasBeenExecuted == false ) { - $tcase_mgr->$method($tcs[$idx],$latestActiveVersionID,$args->keywordArray); - } - } - } - } - break; - - - case 'testcase': - $doRecall = true; - $gui->can_do = 1; - - $tcName = $tcase_mgr->getName($args->id); - $gui->keyword_assignment_subtitle = lang_get('test_case') . TITLE_SEP . - $tcName; - - // Now we work only on latest active version. - // We also need to check if has been executed - $glOpt = array('output' => 'thin', 'active' => 1); - $ltcv = $tcase_mgr->get_last_version_info($args->id,$glOpt); - $latestActiveVersionID = $ltcv['tcversion_id']; - - $statusQuo = current($tcase_mgr->get_versions_status_quo($args->id,$latestActiveVersionID)); - $gui->hasBeenExecuted = intval($statusQuo['executed']) > 0; - - if ($gui->canAddRemoveKWFromExecuted || !$gui->hasBeenExecuted) { - $kwQty = !is_null($args->keywordArray) ? count($args->keywordArray) : 0; - if ($args->assignToTestCase && $kwQty >0) { - $result = 'ok'; - $tcase_mgr->setKeywords($args->id,$latestActiveVersionID,$args->keywordArray); - $doRecall = !is_null($args->keywordArray); - } - } - - $opt_cfg->to->lbl = lang_get('assigned_kword'); - $opt_cfg->to->map = $doRecall ? - $tcase_mgr->get_keywords_map($args->id,$latestActiveVersionID, - array('orderByClause' =>" ORDER BY keyword ASC ")) : null; - break; -} - - -keywords_opt_transf_cfg($opt_cfg, $args->keywordList); - - -$smarty->assign('gui', $gui); -$smarty->assign('sqlResult', $result); -$smarty->assign('opt_cfg', $opt_cfg); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function init_args(&$opt_cfg) { - $rl_html_name = $opt_cfg->js_ot_name . "_newRight"; - - $iParams = array("id" => array(tlInputParameter::INT_N), - "edit" => array(tlInputParameter::STRING_N,0,100), - "assigntestcase" => array(tlInputParameter::STRING_N,0,1), - "assigntestsuite" => array(tlInputParameter::STRING_N,0,1), - "removetestcase" => array(tlInputParameter::STRING_N,0,1), - "removetestsuite" => array(tlInputParameter::STRING_N,0,1), - "removealltestcase" => array(tlInputParameter::STRING_N,0,1), - "removealltestsuite" => array(tlInputParameter::STRING_N,0,1), - $rl_html_name => array(tlInputParameter::STRING_N) ); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - $args->id = $pParams["id"]; - $args->edit = $pParams["edit"]; - - $args->assignToTestCase = ($pParams["assigntestcase"] != "") ? 1 : 0; - $args->assignToTestSuite = ($pParams["assigntestsuite"] != "") ? 1 : 0; - - $args->removeFromTestCase = ($pParams["removetestcase"] != "") ? 1 : 0; - $args->removeFromTestSuite = ($pParams["removetestsuite"] != "") ? 1 : 0; - - $args->removeAllFromTestCase = ($pParams["removealltestcase"] != "") ? 1 : 0; - $args->removeAllFromTestSuite = ($pParams["removealltestsuite"] != "") ? 1 : 0; - - $args->useFilteredSet = isset($_REQUEST['useFilteredSet']) ? 1 : 0; - $args->onlyDirectChildren = isset($_REQUEST['onlyDirectChildren']) ? 1 : 0; - - $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - - $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $args->tcaseSet = isset($_SESSION['edit_mode']) - && isset($_SESSION['edit_mode'][$args->form_token]['testcases_to_show']) ? - $_SESSION['edit_mode'][$args->form_token]['testcases_to_show'] : null; - - - $args->keywordArray = null; - $args->keywordList = $pParams[$rl_html_name]; - if ($args->keywordList != "") { - $args->keywordArray = explode(",",$args->keywordList); - } - - $args->user = $_SESSION['currentUser']; - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj) { - $guiObj = new stdClass(); - $guiObj->can_do = 0; - $guiObj->form_token = $argsObj->form_token; - $guiObj->useFilteredSet = $argsObj->useFilteredSet; - $guiObj->onlyDirectChildren = $argsObj->onlyDirectChildren; - $guiObj->id = $argsObj->id; - $guiObj->level = $argsObj->edit; - $guiObj->keyword_assignment_subtitle = null; - - $guiObj->canAddRemoveKWFromExecuted = - $argsObj->user->hasRightOnProj($db, - 'testproject_add_remove_keywords_executed_tcversions') || - $argsObj->user->hasRightOnProj($db,'testproject_edit_executed_testcases'); - - return $guiObj; -} - - -function checkRights(&$db,&$user) { - return $user->hasRightOnProj($db,'keyword_assignment'); -} \ No newline at end of file diff --git a/lib/keywords/keywordsEdit.php b/lib/keywords/keywordsEdit.php index 310b1c4fc2..f188e1fdc2 100644 --- a/lib/keywords/keywordsEdit.php +++ b/lib/keywords/keywordsEdit.php @@ -1,348 +1,426 @@ -status = 0; - -$args = initEnv($db); -$gui = initializeGui($db,$args); - -$tprojectMgr = new testproject($db); - -$action = $args->doAction; - -switch ($action) { - case "do_create": - case "do_update": - case "do_delete": - case "edit": - case "create": - case "cfl": - case "do_cfl": - $op = $action($args,$gui,$tprojectMgr); - break; -} - - -if($op->status == 1) { - $tpl = $op->template; -} else { - $tpl = (property_exists($op,'template') - && null != $op->template) ? $op->template : - $tplCfg->default_template; - $gui->user_feedback = getKeywordErrorMessage($op->status); -} - -$gui->keywords = null; -$gui->submitCode = ""; -if ($tpl != $tplCfg->default_template) { - // I'm going to return to screen that display all keywords - $kwe = getKeywordsEnv($db,$args->user,$args->tproject_id); - foreach($kwe as $prop => $val) { - $gui->$prop = $val; - } - $setUpDialog = $gui->openByOther; -} else { - $setUpDialog = $gui->directAccess; - $gui->submitCode="return dialog_onSubmit($gui->dialogName)"; -} - -if ($setUpDialog) { - $gui->dialogName = 'kw_dialog'; - $gui->bodyOnLoad = "dialog_onLoad($gui->dialogName)"; - $gui->bodyOnUnload = "dialog_onUnload($gui->dialogName)"; - - if( $gui->directAccess ) { - $gui->submitCode = "return dialog_onSubmit($gui->dialogName)"; - } -} - -$tplEngine->assign('gui',$gui); -$tplEngine->display($tplCfg->template_dir . $tpl); - - -/** - * @return object returns the arguments for the page - */ -function initEnv(&$dbHandler) { - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - $source = sizeof($_POST) ? "POST" : "GET"; - - $ipcfg = - array( "doAction" => array($source,tlInputParameter::STRING_N,0,50), - "id" => array($source, tlInputParameter::INT_N), - "keyword" => array($source, tlInputParameter::STRING_N,0,100), - "notes" => array($source, tlInputParameter::STRING_N), - "tproject_id" => array($source, tlInputParameter::INT_N), - "openByOther" => array($source, tlInputParameter::INT_N), - "directAccess" => array($source, tlInputParameter::INT_N), - "tcversion_id" => array($source, tlInputParameter::INT_N)); - - $ip = I_PARAMS($ipcfg); - - $args = new stdClass(); - $args->doAction = $ip["doAction"]; - $args->notes = $ip["notes"]; - $args->keyword = $ip["keyword"]; - $args->keyword_id = $ip["id"]; - $args->tproject_id = $ip["tproject_id"]; - $args->openByOther = intval($ip["openByOther"]); - $args->directAccess = intval($ip["directAccess"]); - $args->tcversion_id = intval($ip["tcversion_id"]); - - - if( $args->tproject_id <= 0 ) { - throw new Exception("Error Invalid Test Project ID", 1); - } - - // Check rights before doing anything else - // Abort if rights are not enough - $args->user = $_SESSION['currentUser']; - $env['tproject_id'] = $args->tproject_id; - $env['tplan_id'] = 0; - - $check = new stdClass(); - $check->items = array('mgt_modify_key','mgt_view_key'); - $check->mode = 'and'; - checkAccess($dbHandler,$args->user,$env,$check); - - // OK Go ahead - $args->canManage = true; - $args->mgt_view_events = $args->user->hasRight($dbHandler,"mgt_view_events",$args->tproject_id); - - $treeMgr = new tree($dbHandler); - $dummy = $treeMgr->get_node_hierarchy_info($args->tproject_id); - $args->tproject_name = $dummy['name']; - - return $args; -} - -/* - * initialize variables to launch user interface (smarty template) - * to get information to accomplish create task. -*/ -function create(&$argsObj,&$guiObj) { - $guiObj->submit_button_action = 'do_create'; - $guiObj->submit_button_label = lang_get('btn_save'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('create_keyword'); - - $ret = new stdClass(); - $ret->template = 'keywordsEdit.tpl'; - $ret->status = 1; - return $ret; -} - -/* - * initialize variables to launch user interface (smarty template) - * to get information to accomplish edit task. -*/ -function edit(&$argsObj,&$guiObj,&$tproject_mgr) { - $guiObj->submit_button_action = 'do_update'; - $guiObj->submit_button_label = lang_get('btn_save'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('edit_keyword'); - - $ret = new stdClass(); - $ret->template = 'keywordsEdit.tpl'; - $ret->status = 1; - - $keyword = $tproject_mgr->getKeyword($argsObj->keyword_id); - if ($keyword) { - $guiObj->keyword = $argsObj->keyword = $keyword->name; - $guiObj->notes = $argsObj->notes = $keyword->notes; - $guiObj->action_descr .= TITLE_SEP . $guiObj->keyword; - } - - return $ret; -} - -/* - * Creates the keyword - */ -function do_create(&$args,&$guiObj,&$tproject_mgr) { - $guiObj->submit_button_action = 'do_create'; - $guiObj->submit_button_label = lang_get('btn_save'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('create_keyword'); - - $op = $tproject_mgr->addKeyword($args->tproject_id,$args->keyword,$args->notes); - $ret = new stdClass(); - $ret->template = 'keywordsView.tpl'; - $ret->status = $op['status']; - return $ret; -} - -/* - * Updates the keyword - */ -function do_update(&$argsObj,&$guiObj,&$tproject_mgr) { - $guiObj->submit_button_action = 'do_update'; - $guiObj->submit_button_label = lang_get('btn_save'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('edit_keyword'); - - $keyword = $tproject_mgr->getKeyword($argsObj->keyword_id); - if ($keyword) { - $guiObj->action_descr .= TITLE_SEP . $keyword->name; - } - - $ret = new stdClass(); - $ret->template = 'keywordsView.tpl'; - $ret->status = $tproject_mgr->updateKeyword($argsObj->tproject_id, - $argsObj->keyword_id,$argsObj->keyword,$argsObj->notes); - return $ret; -} - -/* - * Deletes the keyword - */ -function do_delete(&$args,&$guiObj,&$tproject_mgr) { - $guiObj->submit_button_action = 'do_update'; - $guiObj->submit_button_label = lang_get('btn_save'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('delete_keyword'); - - $ret = new stdClass(); - $ret->template = 'keywordsView.tpl'; - - $dko = array('context' => 'getTestProjectName', - 'tproject_id' => $args->tproject_id); - $ret->status = $tproject_mgr->deleteKeyword($args->keyword_id,$dko); - - return $ret; -} - -/* - * initialize variables to launch user interface (smarty template) - * to get information to accomplish create and link task. -*/ -function cfl(&$argsObj,&$guiObj) { - $guiObj->submit_button_action = 'do_cfl'; - $guiObj->submit_button_label = lang_get('btn_create_and_link'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('create_keyword_and_link'); - - $ret = new stdClass(); - $ret->template = 'keywordsEdit.tpl'; - $ret->status = 1; - return $ret; -} - -/* - * Creates & Link the keyword - */ -function do_cfl(&$args,&$guiObj,&$tproject_mgr) { - $guiObj->submit_button_action = 'do_cfl'; - $guiObj->submit_button_label = lang_get('btn_create_and_link'); - $guiObj->main_descr = lang_get('keyword_management'); - $guiObj->action_descr = lang_get('create_keyword_and_link'); - - $op = $tproject_mgr->addKeyword($args->tproject_id,$args->keyword,$args->notes); - - $ret = new stdClass(); - if ($op['status'] >= tl::OK) { - $ret->template = 'keywordsView.tpl'; - $tcaseMgr = new testcase($tproject_mgr->db); - $tbl = tlObject::getDBTables('nodes_hierarchy'); - $sql = "SELECT parent_id FROM {$tbl['nodes_hierarchy']} - WHERE id=" . intval($args->tcversion_id); - $rs = $tproject_mgr->db->get_recordset($sql); - $tcase_id = intval($rs[0]['parent_id']); - $tcaseMgr->addKeywords($tcase_id,$args->tcversion_id, - array($op['id'])); - } - $ret->status = $op['status']; - return $ret; -} - - -/** - * - */ -function getKeywordErrorMessage($code) { - - switch($code) { - case tlKeyword::E_NAMENOTALLOWED: - $msg = lang_get('keywords_char_not_allowed'); - break; - - case tlKeyword::E_NAMELENGTH: - $msg = lang_get('empty_keyword_no'); - break; - - case tlKeyword::E_DBERROR: - case ERROR: - $msg = lang_get('kw_update_fails'); - break; - - case tlKeyword::E_NAMEALREADYEXISTS: - $msg = lang_get('keyword_already_exists'); - break; - - default: - $msg = 'ok'; - break; - } - return $msg; -} - -/** - * - * - */ -function initializeGui(&$dbH,&$args) { - - $gui = new stdClass(); - $gui->dialogName='keywordsEdit_dialog'; - $gui->openByOther = $args->openByOther; - $gui->directAccess = $args->directAccess; - $gui->tcversion_id = $args->tcversion_id; - - $gui->user_feedback = ''; - - // Needed by the smarty template to be launched - $kr = array('canManage' => "mgt_modify_key", 'canAssign' => "keyword_assignment"); - foreach( $kr as $vk => $rk ) { - $gui->$vk = - $args->user->hasRight($dbH,$rk,$args->tproject_id); - } - - $gui->tproject_id = $args->tproject_id; - $gui->canManage = $args->canManage; - $gui->mgt_view_events = $args->mgt_view_events; - $gui->notes = $args->notes; - $gui->name = $args->keyword; - $gui->keyword = $args->keyword; - $gui->keywordID = $args->keyword_id; - - $gui->editUrl = $_SESSION['basehref'] . - "lib/keywords/keywordsEdit.php?" . - "tproject_id={$gui->tproject_id}"; - - return $gui; +status = 0; + +$args = initEnv($db); +$gui = initializeGui($db, $args); + +$tprojectMgr = new testproject($db); + +$action = $args->doAction; + +switch ($action) { + case "do_create": + case "do_update": + case "do_delete": + case "edit": + case "create": + case "cfl": + case "do_cfl": + $op = $action($args, $gui, $tprojectMgr); + break; +} + +if ($op->status == 1) { + $tpl = $op->template; +} else { + $tpl = (property_exists($op, 'template') && null != $op->template) ? $op->template : $tplCfg->default_template; + $gui->user_feedback = getKeywordErrorMessage($op->status); +} + +$gui->keywords = null; +$gui->submitCode = ""; +if ($tpl != $tplCfg->default_template) { + // I'm going to return to screen that display all keywords + $kwe = getKeywordsEnv($db, $args->user, $args->tproject_id); + foreach ($kwe as $prop => $val) { + $gui->$prop = $val; + } + $setUpDialog = $gui->openByOther; +} else { + $setUpDialog = $gui->directAccess; + $gui->submitCode = "return dialog_onSubmit($gui->dialogName)"; +} + +if ($setUpDialog) { + $gui->dialogName = 'kw_dialog'; + $gui->bodyOnLoad = "dialog_onLoad($gui->dialogName)"; + $gui->bodyOnUnload = "dialog_onUnload($gui->dialogName)"; + + if ($gui->directAccess) { + $gui->submitCode = "return dialog_onSubmit($gui->dialogName)"; + } +} + +$tplEngine->assign('gui', $gui); +$tplEngine->display($tplCfg->template_dir . $tpl); + +/** + * Initializes the environment + * + * @param database $dbHandler + * @return stdClass object returns the arguments for the page + */ +function initEnv(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $source = count($_POST) ? "POST" : "GET"; + + $ipcfg = array( + "doAction" => array( + $source, + tlInputParameter::STRING_N, + 0, + 50 + ), + "id" => array( + $source, + tlInputParameter::INT_N + ), + "keyword" => array( + $source, + tlInputParameter::STRING_N, + 0, + 100 + ), + "notes" => array( + $source, + tlInputParameter::STRING_N + ), + "tproject_id" => array( + $source, + tlInputParameter::INT_N + ), + "openByOther" => array( + $source, + tlInputParameter::INT_N + ), + "directAccess" => array( + $source, + tlInputParameter::INT_N + ), + "tcversion_id" => array( + $source, + tlInputParameter::INT_N + ) + ); + + $ip = I_PARAMS($ipcfg); + + $args = new stdClass(); + $args->doAction = $ip["doAction"]; + $args->notes = $ip["notes"]; + $args->keyword = $ip["keyword"]; + $args->keyword_id = $ip["id"]; + $args->tproject_id = $ip["tproject_id"]; + $args->openByOther = intval($ip["openByOther"]); + $args->directAccess = intval($ip["directAccess"]); + $args->tcversion_id = intval($ip["tcversion_id"]); + + if ($args->tproject_id <= 0) { + throw new Exception("Error Invalid Test Project ID", 1); + } + + // Check rights before doing anything else + // Abort if rights are not enough + $args->user = $_SESSION['currentUser']; + $env['tproject_id'] = $args->tproject_id; + $env['tplan_id'] = 0; + + $check = new stdClass(); + $check->items = array( + 'mgt_modify_key', + 'mgt_view_key' + ); + $check->mode = 'and'; + checkAccess($dbHandler, $args->user, $env, $check); + + // OK Go ahead + $args->canManage = true; + $args->mgt_view_events = $args->user->hasRight($dbHandler, "mgt_view_events", + $args->tproject_id); + + $treeMgr = new tree($dbHandler); + $dummy = $treeMgr->get_node_hierarchy_info($args->tproject_id); + $args->tproject_name = $dummy['name']; + + return $args; +} + +/** + * initialize variables to launch user interface (smarty template) + * to get information to accomplish create task. + * + * @param stdClass $argsObj + * @param stdClass $guiObj + * @return stdClass + */ +function create(&$argsObj, &$guiObj) +{ + $guiObj->submit_button_action = 'do_create'; + $guiObj->submit_button_label = lang_get('btn_save'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('create_keyword'); + + $ret = new stdClass(); + $ret->template = 'keywordsEdit.tpl'; + $ret->status = 1; + return $ret; +} + +/** + * + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param testproject $tproject_mgr + * @return stdClass + */ +function edit(&$argsObj, &$guiObj, &$tproject_mgr) +{ + $guiObj->submit_button_action = 'do_update'; + $guiObj->submit_button_label = lang_get('btn_save'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('edit_keyword'); + + $ret = new stdClass(); + $ret->template = 'keywordsEdit.tpl'; + $ret->status = 1; + + $keyword = $tproject_mgr->getKeyword($argsObj->keyword_id); + if ($keyword) { + $guiObj->keyword = $argsObj->keyword = $keyword->name; + $guiObj->notes = $argsObj->notes = $keyword->notes; + $guiObj->action_descr .= TITLE_SEP . $guiObj->keyword; + } + + return $ret; +} + +/** + * Creates the keyword + * + * @param stdClass $args + * @param stdClass $guiObj + * @param testproject $tproject_mgr + * @return stdClass + */ +function do_create(&$args, &$guiObj, &$tproject_mgr) +{ + $guiObj->submit_button_action = 'do_create'; + $guiObj->submit_button_label = lang_get('btn_save'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('create_keyword'); + + $op = $tproject_mgr->addKeyword($args->tproject_id, $args->keyword, + $args->notes); + $ret = new stdClass(); + $ret->template = 'keywordsView.tpl'; + $ret->status = $op['status']; + return $ret; +} + +/** + * Updates the keyword + * + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param testproject $tproject_mgr + * @return stdClass + */ +function do_update(&$argsObj, &$guiObj, &$tproject_mgr) +{ + $guiObj->submit_button_action = 'do_update'; + $guiObj->submit_button_label = lang_get('btn_save'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('edit_keyword'); + + $keyword = $tproject_mgr->getKeyword($argsObj->keyword_id); + if ($keyword) { + $guiObj->action_descr .= TITLE_SEP . $keyword->name; + } + + $ret = new stdClass(); + $ret->template = 'keywordsView.tpl'; + $ret->status = $tproject_mgr->updateKeyword($argsObj->tproject_id, + $argsObj->keyword_id, $argsObj->keyword, $argsObj->notes); + return $ret; +} + +/** + * Deletes the keyword + * + * @param stdClass $args + * @param stdClass $guiObj + * @param testproject $tproject_mgr + * @return stdClass + */ +function do_delete(&$args, &$guiObj, &$tproject_mgr) +{ + $guiObj->submit_button_action = 'do_update'; + $guiObj->submit_button_label = lang_get('btn_save'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('delete_keyword'); + + $ret = new stdClass(); + $ret->template = 'keywordsView.tpl'; + + $dko = array( + 'context' => 'getTestProjectName', + 'tproject_id' => $args->tproject_id + ); + $ret->status = $tproject_mgr->deleteKeyword($args->keyword_id, $dko); + + return $ret; +} + +/** + * initialize variables to launch user interface (smarty template) + * to get information to accomplish create and link task. + * + * @param stdClass $argsObj + * @param stdClass $guiObj + * @return stdClass + */ +function cfl(&$argsObj, &$guiObj) +{ + $guiObj->submit_button_action = 'do_cfl'; + $guiObj->submit_button_label = lang_get('btn_create_and_link'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('create_keyword_and_link'); + + $ret = new stdClass(); + $ret->template = 'keywordsEdit.tpl'; + $ret->status = 1; + return $ret; +} + +/** + * Creates & Link the keyword + * + * @param stdClass $args + * @param stdClass $guiObj + * @param testproject $tproject_mgr + * @return stdClass + */ +function do_cfl(&$args, &$guiObj, &$tproject_mgr) +{ + $guiObj->submit_button_action = 'do_cfl'; + $guiObj->submit_button_label = lang_get('btn_create_and_link'); + $guiObj->main_descr = lang_get('keyword_management'); + $guiObj->action_descr = lang_get('create_keyword_and_link'); + + $op = $tproject_mgr->addKeyword($args->tproject_id, $args->keyword, + $args->notes); + + $ret = new stdClass(); + if ($op['status'] >= tl::OK) { + $ret->template = 'keywordsView.tpl'; + $tcaseMgr = new testcase($tproject_mgr->db); + $tbl = tlObject::getDBTables('nodes_hierarchy'); + $sql = "SELECT parent_id FROM {$tbl['nodes_hierarchy']} + WHERE id=" . intval($args->tcversion_id); + $rs = $tproject_mgr->db->get_recordset($sql); + $tcase_id = intval($rs[0]['parent_id']); + $tcaseMgr->addKeywords($tcase_id, $args->tcversion_id, + array( + $op['id'] + )); + } + $ret->status = $op['status']; + return $ret; +} + +/** + * Get the error message + * + * @param string $code + * the local language + * @return string of the error message + */ +function getKeywordErrorMessage($code) +{ + switch ($code) { + case tlKeyword::E_NAMENOTALLOWED: + $msg = lang_get('keywords_char_not_allowed'); + break; + + case tlKeyword::E_NAMELENGTH: + $msg = lang_get('empty_keyword_no'); + break; + + case tlKeyword::E_DBERROR: + case ERROR: + $msg = lang_get('kw_update_fails'); + break; + + case tlKeyword::E_NAMEALREADYEXISTS: + $msg = lang_get('keyword_already_exists'); + break; + + default: + $msg = 'ok'; + break; + } + return $msg; +} + +/** + */ +function initializeGui(&$dbH, &$args) +{ + $gui = new stdClass(); + $gui->dialogName = 'keywordsEdit_dialog'; + $gui->openByOther = $args->openByOther; + $gui->directAccess = $args->directAccess; + $gui->tcversion_id = $args->tcversion_id; + + $gui->user_feedback = ''; + + // Needed by the smarty template to be launched + $kr = array( + 'canManage' => "mgt_modify_key", + 'canAssign' => "keyword_assignment" + ); + foreach ($kr as $vk => $rk) { + $gui->$vk = $args->user->hasRight($dbH, $rk, $args->tproject_id); + } + + $gui->tproject_id = $args->tproject_id; + $gui->canManage = $args->canManage; + $gui->mgt_view_events = $args->mgt_view_events; + $gui->notes = $args->notes; + $gui->name = $args->keyword; + $gui->keyword = $args->keyword; + $gui->keywordID = $args->keyword_id; + + $gui->editUrl = $_SESSION['basehref'] . "lib/keywords/keywordsEdit.php?" . + "tproject_id={$gui->tproject_id}"; + + return $gui; } diff --git a/lib/keywords/keywordsEnv.php b/lib/keywords/keywordsEnv.php index 08ff28b0d8..94a16f90fc 100644 --- a/lib/keywords/keywordsEnv.php +++ b/lib/keywords/keywordsEnv.php @@ -1,11 +1,11 @@ dbID; if( $more ) { $kwNames[$kwo->dbID] = $kwo->name; - $kwNotes[$kwo->dbID] = $kwo->notes; + $kwNotes[$kwo->dbID] = $kwo->notes; } } @@ -42,20 +42,18 @@ function getKeywordsEnv(&$dbHandler,&$user,$tproject_id,$opt=null) { if( $more && count($kwEnv->kwOnTCV) > 0) { foreach($kwEnv->kwOnTCV as $kk => $dummy) { $kwEnv->kwOnTCV[$kk]['keyword'] = $kwNames[$kk]; - $kwEnv->kwOnTCV[$kk]['notes'] = $kwNotes[$kk]; + $kwEnv->kwOnTCV[$kk]['notes'] = $kwNotes[$kk]; } } $kwCfg = config_get('keywords'); if( $kwCfg->onDeleteCheckExecutedTCVersions ) { - $kwEnv->kwExecStatus = - $tproject->getKeywordsExecStatus($kws,$tproject_id); + $kwEnv->kwExecStatus = $tproject->getKeywordsExecStatus($kws,$tproject_id); } if( $kwCfg->onDeleteCheckFrozenTCVersions ) { - $kwEnv->kwFreshStatus = - $tproject->getKeywordsFreezeStatus($kws,$tproject_id); + $kwEnv->kwFreshStatus = $tproject->getKeywordsFreezeStatus($kws,$tproject_id); } } @@ -64,6 +62,6 @@ function getKeywordsEnv(&$dbHandler,&$user,$tproject_id,$opt=null) { $kwEnv->canAssign = $user->hasRight($dbHandler,"keyword_assignment",$tproject_id); $kwEnv->editUrl = $_SESSION['basehref'] . "lib/keywords/keywordsEdit.php?" . - "tproject_id={$tproject_id}"; + "tproject_id={$tproject_id}"; return $kwEnv; -} \ No newline at end of file +} diff --git a/lib/keywords/keywordsExport.php b/lib/keywords/keywordsExport.php index 6f7fca6202..0bc13da84f 100644 --- a/lib/keywords/keywordsExport.php +++ b/lib/keywords/keywordsExport.php @@ -1,134 +1,175 @@ -doAction) { - case "do_export": - $op = do_export($db,$smarty,$args); - break; +doAction) { + case "do_export": + do_export($db, $smarty, $args); + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @param database $dbHandler + * @return stdClass object returns the arguments for the page + */ +function initArgs(&$dbHandler) +{ + $ipcfg = array( + "doAction" => array( + "GET", + tlInputParameter::STRING_N, + 0, + 50 + ), + "tproject_id" => array( + "GET", + tlInputParameter::INT_N + ), + "export_filename" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 255 + ), + "exportType" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 255 + ) + ); + + $args = new stdClass(); + I_PARAMS($ipcfg, $args); + + if ($args->tproject_id <= 0) { + throw new Exception("Error Invalid Test Project ID", 1); + } + + // Check rights before doing anything else + // Abort if rights are not enough + $args->user = $_SESSION['currentUser']; + $env['tproject_id'] = $args->tproject_id; + $env['tplan_id'] = 0; + + $check = new stdClass(); + $check->items = array( + 'mgt_view_key' + ); + $check->mode = 'and'; + checkAccess($dbHandler, $args->user, $env, $check); + + $tproj_mgr = new testproject($dbHandler); + $dm = $tproj_mgr->get_by_id($args->tproject_id, array( + 'output' => 'name' + )); + $args->tproject_name = $dm['name']; + + return $args; +} + +/** + * do_export + * generate export file + * + * @param database $db + * @param TLSmarty $smarty + * @param stdClass $args + */ +function do_export(&$db, &$smarty, &$args) +{ + $pfn = null; + $pfx = null; + switch ($args->exportType) { + case 'iSerializationToCSV': + $pfn = null; + $pfx = "exportKeywordsToCSV"; + break; + + case 'iSerializationToXML': + $pfn = "exportKeywordsToXML"; + break; + } + + if (null != $pfn) { + $tprojectMgr = new testproject($db); + $content = $tprojectMgr->$pfn($args->tproject_id); + downloadContentsToFile($content, $args->export_filename); + exit(); + } + + if (null != $pfx) { + $cu = getKeywordsEnv($db, $args->user, $args->tproject_id, + array( + 'usage' => 'csvExport' + )); + + $content = exportKeywordsToCSV($cu->kwOnTCV); + downloadContentsToFile($content, $args->export_filename); + exit(); + } +} + +/** + * Initialisiert die GUI + * + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$argsObj) +{ + $kw = new tlKeyword(); + $gui = new stdClass(); + $gui->tproject_id = $argsObj->tproject_id; + $gui->exportTypes = $kw->getSupportedSerializationInterfaces(); + $gui->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + $gui->export_filename = is_null($argsObj->export_filename) ? 'keywords.xml' : $argsObj->export_filename; + $gui->action_descr = lang_get('export_keywords'); + + $gui->actionUrl = "lib/keywords/keywordsExport.php?doAction=do_export&tproject_id={$gui->tproject_id}"; + $gui->cancelUrl = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id}"; + return $gui; +} + +/** + * Export keywords to CSV + * + * @param array $kwSet + * @return string in csv format + */ +function exportKeywordsToCSV($kwSet) +{ + $keys = array( + "keyword", + "notes", + "tcv_qty" + ); + return exportDataToCSV($kwSet, $keys, $keys, array( + 'addHeader' => 1 + )); } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - */ -function init_args(&$dbHandler) { - $ipcfg = array("doAction" => array("GET",tlInputParameter::STRING_N,0,50), - "tproject_id" => array("GET",tlInputParameter::INT_N), - "export_filename" => array("POST", tlInputParameter::STRING_N,0,255), - "exportType" => array("POST", tlInputParameter::STRING_N,0,255)); - - $args = new stdClass(); - $pps = I_PARAMS($ipcfg,$args); - - if( $args->tproject_id <= 0 ) { - throw new Exception("Error Invalid Test Project ID", 1); - } - - // Check rights before doing anything else - // Abort if rights are not enough - $args->user = $_SESSION['currentUser']; - $env['tproject_id'] = $args->tproject_id; - $env['tplan_id'] = 0; - - $check = new stdClass(); - $check->items = array('mgt_view_key'); - $check->mode = 'and'; - checkAccess($dbHandler,$args->user,$env,$check); - - $tproj_mgr = new testproject($dbHandler); - $dm = $tproj_mgr->get_by_id($args->tproject_id,array('output' => 'name')); - $args->tproject_name = $dm['name']; - - return $args; -} - - -/* - function: do_export - generate export file - - args : - - returns: - -*/ -function do_export(&$db,&$smarty,&$args) { - $pfn = null; - $pfx = null; - switch($args->exportType) { - case 'iSerializationToCSV': - $pfn = null; - $pfx = "exportKeywordsToCSV"; - break; - - case 'iSerializationToXML': - $pfn = "exportKeywordsToXML"; - break; - } - - if (null != $pfn) { - $tprojectMgr = new testproject($db); - $content = $tprojectMgr->$pfn($args->tproject_id); - downloadContentsToFile($content,$args->export_filename); - exit(); - } - - if (null != $pfx) { - $cu = getKeywordsEnv($db,$args->user,$args->tproject_id, - array('usage' => 'csvExport')); - - $content = exportKeywordsToCSV($cu->kwOnTCV); - downloadContentsToFile($content,$args->export_filename); - exit(); - } - -} - -/** - * - */ -function initializeGui(&$argsObj) { - $kw = new tlKeyword(); - $gui = new stdClass(); - $gui->tproject_id = $argsObj->tproject_id; - $gui->exportTypes = $kw->getSupportedSerializationInterfaces(); - $gui->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - $gui->export_filename = is_null($argsObj->export_filename) ? 'keywords.xml' : $argsObj->export_filename; - $gui->action_descr = lang_get('export_keywords'); - - $gui->actionUrl = "lib/keywords/keywordsExport.php?doAction=do_export&tproject_id={$gui->tproject_id}"; - $gui->cancelUrl = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id}"; - return $gui; -} - - -/** - * - */ -function exportKeywordsToCSV($kwSet) { - $keys = array( "keyword","notes","tcv_qty" ); - $csv = exportDataToCSV($kwSet,$keys,$keys,array('addHeader' => 1)); - return $csv; -} \ No newline at end of file diff --git a/lib/keywords/keywordsImport.php b/lib/keywords/keywordsImport.php index 48b0ff1725..8452a5f94d 100644 --- a/lib/keywords/keywordsImport.php +++ b/lib/keywords/keywordsImport.php @@ -1,148 +1,160 @@ -msg && $args->UploadFile) { - - if(($args->source != 'none') && ($args->source != '')) { - if (move_uploaded_file($args->source, $args->dest)) { - $pfn = null; - switch($args->importType) { - case 'iSerializationToCSV': - $pfn = "importKeywordsFromCSV"; - break; - - case 'iSerializationToXML': - $pfn = "importKeywordsFromXMLFile"; - break; - } - - if ($pfn) { - $tproject = new testproject($db); - $result = $tproject->$pfn($args->tproject_id,$args->dest); - if ($result != tl::OK) { - $gui->msg = lang_get('wrong_keywords_file'); - } else { - header("Location: keywordsView.php?tproject_id={$gui->tproject_id}"); - exit(); - } - } - @unlink($args->dest); - } - } else { - $gui->msg = lang_get('please_choose_keywords_file'); - } +msg && $args->UploadFile) { + + if (($args->source != 'none') && ($args->source != '')) { + if (move_uploaded_file($args->source, $args->dest)) { + $pfn = null; + switch ($args->importType) { + case 'iSerializationToCSV': + $pfn = "importKeywordsFromCSV"; + break; + + case 'iSerializationToXML': + $pfn = "importKeywordsFromXMLFile"; + break; + } + + if ($pfn) { + $tproject = new testproject($db); + $result = $tproject->$pfn($args->tproject_id, $args->dest); + if ($result != tl::OK) { + $gui->msg = lang_get('wrong_keywords_file'); + } else { + header( + "Location: keywordsView.php?tproject_id={$gui->tproject_id}"); + exit(); + } + } + @unlink($args->dest); + } + } else { + $gui->msg = lang_get('please_choose_keywords_file'); + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->tpl); + +/** + * Get input from user and return it in some sort of namespace + * + * @return object returns the arguments for the page + */ +function initArgs(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $ipcfg = array( + "UploadFile" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "importType" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($ipcfg, $args); + + if ($args->tproject_id <= 0) { + throw new Exception(" Error Invalid Test Project ID", 1); + } + + // Check rights before doing anything else + // Abort if rights are not enough + $user = $_SESSION['currentUser']; + $env['tproject_id'] = $args->tproject_id; + $env['tplan_id'] = 0; + + $check = new stdClass(); + $check->items = array( + 'mgt_modify_key' + ); + $check->mode = 'and'; + checkAccess($dbHandler, $user, $env, $check); + + $tproj_mgr = new testproject($dbHandler); + $dm = $tproj_mgr->get_by_id($args->tproject_id, array( + 'output' => 'name' + )); + $args->tproject_name = $dm['name']; + + $args->UploadFile = ($args->UploadFile != "") ? 1 : 0; + $args->fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; + $args->source = isset($args->fInfo['tmp_name']) ? $args->fInfo['tmp_name'] : null; + + // whitelist + switch ($args->importType) { + case 'iSerializationToCSV': + case 'iSerializationToXML': + break; + + default: + $args->importType = 'iSerializationToXML'; + break; + } + + $tlkw = new tlKeyword(); + $args->importTypes = $tlkw->getSupportedSerializationInterfaces(); + $args->keywordFormatStrings = $tlkw->getSupportedSerializationFormatDescriptions(); + + $args->dest = TL_TEMP_PATH . session_id() . "-importkeywords." . + $args->importTypes[$args->importType]; + + return $args; +} + +/** + */ +function initializeGui(&$argsObj) +{ + $gui = new stdClass(); + $gui->tproject_id = $argsObj->tproject_id; + $gui->tproject_name = $argsObj->tproject_name; + + $gui->main_descr = lang_get('testproject') . TITLE_SEP . $gui->tproject_name; + $gui->viewUrl = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id}"; + $gui->import_type_selected = $argsObj->importType; + $gui->msg = getFileUploadErrorMessage($argsObj->fInfo); + + $gui->importTypes = $argsObj->importTypes; + $gui->keywordFormatStrings = $argsObj->keywordFormatStrings; + + $fslimit = config_get('import_file_max_size_bytes'); + $gui->fileSizeLimitMsg = sprintf(lang_get('max_file_size_is'), + $fslimit / 1024 . ' KB '); + $gui->importLimit = $fslimit; + + return $gui; } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->tpl); - -/** - * @return object returns the arguments for the page - */ -function init_args(&$dbHandler) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $ipcfg = - array("UploadFile" => array(tlInputParameter::STRING_N,0,1), - "importType" => array(tlInputParameter::STRING_N,0,100), - "tproject_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($ipcfg,$args); - - if ($args->tproject_id <= 0) { - throw new Exception(" Error Invalid Test Project ID", 1); - } - - // Check rights before doing anything else - // Abort if rights are not enough - $user = $_SESSION['currentUser']; - $env['tproject_id'] = $args->tproject_id; - $env['tplan_id'] = 0; - - $check = new stdClass(); - $check->items = array('mgt_modify_key'); - $check->mode = 'and'; - checkAccess($dbHandler,$user,$env,$check); - - $tproj_mgr = new testproject($dbHandler); - $dm = $tproj_mgr->get_by_id($args->tproject_id, - array('output' => 'name')); - $args->tproject_name = $dm['name']; - - $args->UploadFile = ($args->UploadFile != "") ? 1 : 0; - $args->fInfo = isset($_FILES['uploadedFile']) ? $_FILES['uploadedFile'] : null; - $args->source = isset($args->fInfo['tmp_name']) ? $args->fInfo['tmp_name'] : null; - - // whitelist - switch($args->importType) { - case 'iSerializationToCSV': - case 'iSerializationToXML': - break; - - default: - $args->importType = 'iSerializationToXML'; - break; - } - - $tlkw = new tlKeyword(); - $args->importTypes = $tlkw->getSupportedSerializationInterfaces(); - $args->keywordFormatStrings = $tlkw->getSupportedSerializationFormatDescriptions(); - - $args->dest = TL_TEMP_PATH . session_id() . - "-importkeywords." . - $args->importTypes[$args->importType]; - - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj) -{ - $gui = new stdClass(); - $gui->tproject_id = $argsObj->tproject_id; - $gui->tproject_name = $argsObj->tproject_name; - - $gui->main_descr = lang_get('testproject') . TITLE_SEP . $gui->tproject_name; - $gui->viewUrl = "lib/keywords/keywordsView.php?tproject_id={$gui->tproject_id}"; - $gui->import_type_selected = $argsObj->importType; - $gui->msg = getFileUploadErrorMessage($argsObj->fInfo); - - $gui->importTypes = $argsObj->importTypes; - $gui->keywordFormatStrings = $argsObj->keywordFormatStrings;; - - $fslimit = config_get('import_file_max_size_bytes'); - $gui->fileSizeLimitMsg = - sprintf(lang_get('max_file_size_is'), $fslimit/1024 . ' KB '); - $gui->importLimit = $fslimit; - - - - - return $gui; -} \ No newline at end of file diff --git a/lib/keywords/keywordsView.php b/lib/keywords/keywordsView.php index 6efdf40fbc..9c1fb379f0 100644 --- a/lib/keywords/keywordsView.php +++ b/lib/keywords/keywordsView.php @@ -1,65 +1,70 @@ -assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * @return object returns the arguments for the page - */ -function init_args(&$dbHandler) { - $args = new stdClass(); - $tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0; - $tproject_id = intval($tproject_id); - - if( $tproject_id <= 0 ) { - throw new Exception("Error Invalid Test Project ID", 1); - } - - // Check rights before doing anything else - // Abort if rights are not enough - $user = $_SESSION['currentUser']; - $env['tproject_id'] = $tproject_id; - $env['tplan_id'] = 0; - - $check = new stdClass(); - $check->items = array('mgt_view_key'); - $check->mode = 'and'; - checkAccess($dbHandler,$user,$env,$check); - - // OK, go ahead - $args = getKeywordsEnv($dbHandler,$user,$tproject_id); - $args->tproject_id = $tproject_id; - - $args->dialogName = ''; - $args->bodyOnLoad = $args->bodyOnUnload = ''; - if(isset($_REQUEST['openByKWInc'])) { - $args->openByOther = 1; - } else { - // Probably useless - $args->openByOther = - isset($_REQUEST['openByOther']) ? intval($_REQUEST['openByOther']) : 0; - if( $args->openByOther ) { - $args->dialogName = 'kw_dialog'; - $args->bodyOnLoad = "dialog_onLoad($args->dialogName)"; - $args->bodyOnUnload = "dialog_onUnload($args->dialogName)"; - } - } - - return $args; -} \ No newline at end of file +assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @param database $dbHandler + * @return stdClass object returns the arguments for the page + */ +function initArgs(&$dbHandler) +{ + $tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0; + $tproject_id = intval($tproject_id); + + if ($tproject_id <= 0) { + throw new Exception("Error Invalid Test Project ID", 1); + } + + // Check rights before doing anything else + // Abort if rights are not enough + $user = $_SESSION['currentUser']; + $env['tproject_id'] = $tproject_id; + $env['tplan_id'] = 0; + + $check = new stdClass(); + $check->items = array( + 'mgt_view_key' + ); + $check->mode = 'and'; + checkAccess($dbHandler, $user, $env, $check); + + // OK, go ahead + $args = getKeywordsEnv($dbHandler, $user, $tproject_id); + $args->tproject_id = $tproject_id; + + $args->dialogName = ''; + $args->bodyOnLoad = $args->bodyOnUnload = ''; + if (isset($_REQUEST['openByKWInc'])) { + $args->openByOther = 1; + } else { + // Probably useless + $args->openByOther = isset($_REQUEST['openByOther']) ? intval( + $_REQUEST['openByOther']) : 0; + if ($args->openByOther) { + $args->dialogName = 'kw_dialog'; + $args->bodyOnLoad = "dialog_onLoad($args->dialogName)"; + $args->bodyOnUnload = "dialog_onUnload($args->dialogName)"; + } + } + + return $args; +} diff --git a/lib/plan/buildCopyExecTaskAssignment.php b/lib/plan/buildCopyExecTaskAssignment.php index 9ae4522003..132e6fb9f7 100644 --- a/lib/plan/buildCopyExecTaskAssignment.php +++ b/lib/plan/buildCopyExecTaskAssignment.php @@ -1,186 +1,185 @@ -assignment_mgr; -$build_mgr = new build_mgr($db); - -$templateCfg = templateConfiguration(); - -$args = init_args($build_mgr); -$gui = init_gui($db, $args, $tplan_mgr); - -$context = new stdClass(); -$context->tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - - -switch( $args->doAction ) -{ - case 'copy': - // Step 1 - remove old assignments - $assignment_mgr->delete_by_build_id($args->build_id); - - // Step 2 - copy assignments - $assignment_mgr->copy_assignments($args->source_build_id,$args->build_id, - $args->user_id); - $gui->message = lang_get('copy_done'); - break; - - default: - break; -} - - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function init_args(&$buildMgr) -{ - $args = new stdClass(); - - $_REQUEST = strings_stripSlashes($_REQUEST); - - $k2g = array('build_id','source_build_id'); - foreach($k2g as $key) - { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; - } - - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; - switch( $args->doAction ) - { - case 'copy': - break; - - default: - $args->doAction = null; - break; - } - - // Fatal checks - if( $args->build_id <= 0 ) - { - throw new Exception("Error Processing Request - Target build is not set", 1); - } - - // Get test plan id from build - $bi = $buildMgr->get_by_id($args->build_id); - $args->tplan_id = $bi['testplan_id']; - - $info = $buildMgr->tree_manager-> - get_node_hierarchy_info($args->tplan_id,null, - array('nodeType' => 'testplan')); - - $args->tproject_id = intval($info['testproject_id']); - - $args->confirmed = isset($_REQUEST['confirmed']) && $_REQUEST['confirmed'] == 'yes' ? true : false; - - - $args->refreshTree = false; - $args->currentUser = $_SESSION['currentUser']; - $args->user_id = $_SESSION['userID']; - - return $args; -} - - -/** - * - */ -function init_gui(&$dbHandler, &$argsObj, &$tplanMgr) -{ - $gui = new stdClass(); - - $gui->build_id = $argsObj->build_id; - $gui->source_build_id = $argsObj->source_build_id; - $gui->source_build = getBuildDomainForGUI($tplanMgr, $argsObj); - $gui->message = ""; - - if( is_null($gui->source_build->items) ) - { - $gui->message = lang_get('no_builds_available_for_tester_copy'); - } - - $gui->draw_tc_unassign_button = false; - $gui->refreshTree = false; - - $gui->title = lang_get('copy_tester_assignments_title'); - - - $gui->popup_title = ""; - $gui->popup_message = ""; - - return $gui; -} - -/** - * Initialize the HTML select box for selection of a source build when - * user wants to copy the user assignments. - * @internal revisions - */ -function getBuildDomainForGUI(&$tplanMgr, &$argsObj) -{ - - $htmlMenu = array('items' => null, 'selected' => null, 'build_count' => 0, 'testers' => null); - $opt = array('orderByDir' => 'id:DESC', 'excludeBuild' => $argsObj->build_id); - - $htmlMenu['items'] = $tplanMgr->get_builds_for_html_options($argsObj->tplan_id,testplan::ACTIVE_BUILDS,testplan::OPEN_BUILDS,$opt); - - // get the number of existing execution assignments with each build - if( !is_null($htmlMenu['items']) ) - { - $lblCount = lang_get('assignments'); - $htmlMenu['build_count'] = count($htmlMenu['items']); - foreach ($htmlMenu['items'] as $key => $name) - { - $count = $tplanMgr->assignment_mgr->get_count_of_assignments_for_build_id($key); - $htmlMenu['items'][$key] = $name . " ($lblCount" . $count . ")"; - $htmlMenu['testers'][$key] = $count; - } - - // if no build has been chosen yet, select the newest build by default - reset($htmlMenu['items']); - if( !$argsObj->source_build_id ) - { - $htmlMenu['selected'] = key($htmlMenu['items']); - } - } - - return $htmlMenu; -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); +assignment_mgr; +$build_mgr = new build_mgr($db); + +$templateCfg = templateConfiguration(); + +$args = initArgs($build_mgr); +$gui = initGui($db, $args, $tplan_mgr); + +$context = new stdClass(); +$context->tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +switch ($args->doAction) { + case 'copy': + // Step 1 - remove old assignments + $assignment_mgr->delete_by_build_id($args->build_id); + + // Step 2 - copy assignments + $assignment_mgr->copy_assignments($args->source_build_id, + $args->build_id, $args->user_id); + $gui->message = lang_get('copy_done'); + break; + + default: + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs(&$buildMgr) +{ + $args = new stdClass(); + + $_REQUEST = strings_stripSlashes($_REQUEST); + + $k2g = array( + 'build_id', + 'source_build_id' + ); + foreach ($k2g as $key) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; + } + + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; + switch ($args->doAction) { + case 'copy': + break; + + default: + $args->doAction = null; + break; + } + + // Fatal checks + if ($args->build_id <= 0) { + throw new Exception( + "Error Processing Request - Target build is not set", 1); + } + + // Get test plan id from build + $bi = $buildMgr->get_by_id($args->build_id); + $args->tplan_id = $bi['testplan_id']; + + $info = $buildMgr->tree_manager->get_node_hierarchy_info($args->tplan_id, + null, array( + 'nodeType' => 'testplan' + )); + + $args->tproject_id = intval($info['testproject_id']); + + $args->confirmed = isset($_REQUEST['confirmed']) && + $_REQUEST['confirmed'] == 'yes' ? true : false; + + $args->refreshTree = false; + $args->currentUser = $_SESSION['currentUser']; + $args->user_id = $_SESSION['userID']; + + return $args; +} + +/** + */ +function initGui(&$dbHandler, &$argsObj, &$tplanMgr) +{ + $gui = new stdClass(); + + $gui->build_id = $argsObj->build_id; + $gui->source_build_id = $argsObj->source_build_id; + $gui->source_build = getBuildDomainForGUI($tplanMgr, $argsObj); + $gui->message = ""; + + if (is_null($gui->source_build->items)) { + $gui->message = lang_get('no_builds_available_for_tester_copy'); + } + + $gui->draw_tc_unassign_button = false; + $gui->refreshTree = false; + + $gui->title = lang_get('copy_tester_assignments_title'); + + $gui->popup_title = ""; + $gui->popup_message = ""; + + return $gui; +} + +/** + * Initialize the HTML select box for selection of a source build when + * user wants to copy the user assignments. + * + * @internal revisions + */ +function getBuildDomainForGUI(&$tplanMgr, &$argsObj) +{ + $htmlMenu = array( + 'items' => null, + 'selected' => null, + 'build_count' => 0, + 'testers' => null + ); + $opt = array( + 'orderByDir' => 'id:DESC', + 'excludeBuild' => $argsObj->build_id + ); + + $htmlMenu['items'] = $tplanMgr->get_builds_for_html_options( + $argsObj->tplan_id, testplan::ACTIVE_BUILDS, testplan::OPEN_BUILDS, $opt); + + // get the number of existing execution assignments with each build + if (! is_null($htmlMenu['items'])) { + $lblCount = lang_get('assignments'); + $htmlMenu['build_count'] = count($htmlMenu['items']); + foreach ($htmlMenu['items'] as $key => $name) { + $count = $tplanMgr->assignment_mgr->get_count_of_assignments_for_build_id( + $key); + $htmlMenu['items'][$key] = $name . " ($lblCount" . $count . ")"; + $htmlMenu['testers'][$key] = $count; + } + + // if no build has been chosen yet, select the newest build by default + reset($htmlMenu['items']); + if (! $argsObj->source_build_id) { + $htmlMenu['selected'] = key($htmlMenu['items']); + } + } + + return $htmlMenu; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/plan/buildEdit.php b/lib/plan/buildEdit.php index 8545dea106..16641e33d5 100644 --- a/lib/plan/buildEdit.php +++ b/lib/plan/buildEdit.php @@ -1,747 +1,823 @@ -user_feedback = ''; -$op->buttonCfg = new stdClass(); -$op->buttonCfg->name = ""; -$op->buttonCfg->value = ""; - -$smarty = new TLSmarty(); -$tplan_mgr = new testplan($db); -$build_mgr = new build_mgr($db); - -$args = init_args($_REQUEST,$_SESSION,$date_format_cfg,$tplan_mgr); -$gui = initializeGui($args,$build_mgr); - -$context = new stdClass(); -$context->tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$of = web_editor('notes',$_SESSION['basehref'],$editorCfg); -$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes); - - -$op = new stdClass(); -$op->operation_descr = ''; -$op->user_feedback = ''; -$op->buttonCfg = ''; -$op->status_ok = 1; - -switch($args->do_action) -{ - case 'edit': - $op = edit($args,$build_mgr,$date_format_cfg); - $gui->closed_on_date = $args->closed_on_date; - $of->Value = $op->notes; - break; - - case 'create': - $op = create($args); - $gui->closed_on_date = $args->closed_on_date; - break; - - case 'do_delete': - $op = doDelete($db,$args,$build_mgr,$tplan_mgr); - break; - - case 'do_update': - $op = doUpdate($args,$build_mgr,$tplan_mgr,$date_format_cfg); - $of->Value = $op->notes; - $templateCfg->template = $op->template; - break; - - case 'do_create': - $op = doCreate($args,$build_mgr,$tplan_mgr,$date_format_cfg); - $of->Value = $op->notes; - $templateCfg->template = $op->template; - break; - - case 'setActive': - $build_mgr->setActive($args->build_id); - break; - - case 'setInactive': - $build_mgr->setInactive($args->build_id); - break; - - case 'open': - $build_mgr->setOpen($args->build_id); - break; - - case 'close': - $build_mgr->setClosed($args->build_id); - break; - +user_feedback = ''; +$op->buttonCfg = new stdClass(); +$op->buttonCfg->name = ""; +$op->buttonCfg->value = ""; + +$smarty = new TLSmarty(); +$tplan_mgr = new testplan($db); +$build_mgr = new build_mgr($db); + +$args = initArgs($_REQUEST, $_SESSION, $date_format_cfg, $tplan_mgr); +$gui = initializeGui($args, $build_mgr); + +$context = new stdClass(); +$context->tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$of = web_editor('notes', $_SESSION['basehref'], $editorCfg); +$of->Value = getItemTemplateContents('build_template', $of->InstanceName, + $args->notes); + +$op = new stdClass(); +$op->operation_descr = ''; +$op->user_feedback = ''; +$op->buttonCfg = ''; +$op->status_ok = 1; + +switch ($args->do_action) { + case 'edit': + $op = edit($args, $build_mgr); + $gui->closed_on_date = $args->closed_on_date; + $of->Value = $op->notes; + break; + + case 'create': + $op = create($args); + $gui->closed_on_date = $args->closed_on_date; + break; + + case 'do_delete': + $op = doDelete($db, $args, $build_mgr, $tplan_mgr); + break; + + case 'do_update': + $op = doUpdate($args, $build_mgr, $tplan_mgr, $date_format_cfg); + $of->Value = $op->notes; + $templateCfg->template = $op->template; + break; + + case 'do_create': + $op = doCreate($args, $build_mgr, $tplan_mgr, $date_format_cfg); + $of->Value = $op->notes; + $templateCfg->template = $op->template; + break; + + case 'setActive': + $build_mgr->setActive($args->build_id); + break; + + case 'setInactive': + $build_mgr->setInactive($args->build_id); + break; + + case 'open': + $build_mgr->setOpen($args->build_id); + break; + + case 'close': + $build_mgr->setClosed($args->build_id); + break; +} + +$dummy = null; +$gui->release_date = (isset($op->status_ok) && $op->status_ok && + $args->release_date != "") ? localize_dateOrTimeStamp(null, $dummy, + 'date_format', $args->release_date) : $args->release_date_original; +$gui->closed_on_date = $args->closed_on_date; +$gui->operation_descr = $op->operation_descr; +$gui->user_feedback = $op->user_feedback; +$gui->buttonCfg = $op->buttonCfg; + +$gui->mgt_view_events = $args->user->hasRight($db, "mgt_view_events"); +$gui->editorType = $editorCfg['type']; + +renderGui($smarty, $args, $tplan_mgr, $build_mgr, $templateCfg, $of, $gui); + +/** + * INITialize page ARGuments, using the $_REQUEST and $_SESSION + * super-global hashes. + * Important: changes in HTML input elements on the Smarty template + * must be reflected here. + * + * @param array $request_hash + * hash the $_REQUEST + * @param array $session_hash + * hash the the $_SESSION + * @param string $date_format + * @param testplan $tplanMgr + * @return stdClass object with html values tranformed and other generated variables. + * @internal revisions + */ +function initArgs($request_hash, $session_hash, $date_format, &$tplanMgr) +{ + $args = new stdClass(); + $request_hash = strings_stripSlashes($request_hash); + + $nullable_keys = array( + 'notes', + 'do_action', + 'build_name', + 'commit_id', + 'tag', + 'branch', + 'release_candidate' + ); + foreach ($nullable_keys as $value) { + $args->$value = isset($request_hash[$value]) ? $request_hash[$value] : null; + } + + $intval_keys = array( + 'build_id' => 0, + 'source_build_id' => 0 + ); + foreach ($intval_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; + } + + $bool_keys = array( + 'is_active' => 0, + 'is_open' => 0, + 'copy_to_all_tplans' => 0, + 'copy_tester_assignments' => 0 + ); + foreach ($bool_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? 1 : $value; + } + + // convert start date to iso format to write to db + $args->release_date = null; + if (isset($request_hash['release_date']) && + $request_hash['release_date'] != '') { + $date_array = split_localized_date($request_hash['release_date'], + $date_format); + if ($date_array != null) { + // set date in iso format + $args->release_date = $date_array['year'] . "-" . + $date_array['month'] . "-" . $date_array['day']; + } + } + + $args->release_date_original = isset($request_hash['release_date']) && + $request_hash['release_date'] != '' ? $request_hash['release_date'] : null; + + $args->closed_on_date = isset($request_hash['closed_on_date']) ? $request_hash['closed_on_date'] : null; + + if (isset($request_hash['tplan_id']) && intval($request_hash['tplan_id']) > 0) { + $args->tplan_id = intval($_REQUEST['tplan_id']); + $dp = $tplanMgr->get_by_id($args->tplan_id); + $args->tplan_name = $dp['name']; + } else { + $args->tplan_id = isset($session_hash['testplanID']) ? intval( + $session_hash['testplanID']) : 0; + $args->tplan_name = isset($session_hash['testplanName']) ? $session_hash['testplanName'] : ''; + } + + $args->testprojectID = intval($session_hash['testprojectID']); + $args->tproject_id = intval($session_hash['testprojectID']); + + $args->testprojectName = $session_hash['testprojectName']; + $args->userID = intval($session_hash['userID']); + + $args->exec_status_filter = isset($request_hash['exec_status_filter']) ? $request_hash['exec_status_filter'] : null; + + $args->user = $_SESSION['currentUser']; + return $args; +} + +/** + * Initialize the GUI + * + * @param stdClass $argsObj + * @param stdClass $buildMgr + * @return stdClass + */ +function initializeGui(&$argsObj, &$buildMgr) +{ + $guiObj = new stdClass(); + $guiObj->main_descr = lang_get('title_build_2') . + config_get('gui_title_separator_2') . lang_get('test_plan') . + config_get('gui_title_separator_1') . $argsObj->tplan_name; + + $guiObj->cfields = $buildMgr->html_custom_field_inputs($argsObj->build_id, + $argsObj->testprojectID, 'design', '', $_REQUEST); + + $dummy = config_get('results'); + foreach ($dummy['status_label_for_exec_ui'] as $kv => $vl) { + $guiObj->exec_status_filter['items'][$dummy['status_code'][$kv]] = lang_get( + $vl); + } + $guiObj->exec_status_filter['selected'] = $argsObj->exec_status_filter; + + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->tproject_id = $argsObj->tproject_id; + return $guiObj; +} + +/** + * This action can be used to edit a build + * + * @param stdClass $argsObj + * @param build_mgr $buildMgr + * @return stdClass + */ +function edit(&$argsObj, &$buildMgr) +{ + $binfo = $buildMgr->get_by_id($argsObj->build_id); + $op = new stdClass(); + $op->buttonCfg = new stdClass(); + $op->buttonCfg->name = "do_update"; + $op->buttonCfg->value = lang_get('btn_save'); + $op->notes = $binfo['notes']; + $op->user_feedback = ''; + $op->status_ok = 1; + + $argsObj->build_name = $binfo['name']; + $argsObj->is_active = $binfo['active']; + + $k2l = array( + 'is_open', + 'commit_id', + 'tag', + 'branch', + 'release_candidate', + 'release_date' + ); + foreach ($k2l as $pp) { + $argsObj->$pp = $binfo[$pp]; + } + + if ($binfo['closed_on_date'] == '') { + $argsObj->closed_on_date = mktime(0, 0, 0, date("m"), date("d"), + date("Y")); + } else { + $datePieces = explode("-", $binfo['closed_on_date']); + $argsObj->closed_on_date = mktime(0, 0, 0, $datePieces[1], + $datePieces[2], $datePieces[0]); + } + + $op->operation_descr = lang_get('title_build_edit') . TITLE_SEP_TYPE3 . + $argsObj->build_name; + + return $op; +} + +/** + * This action creates a new build + * + * prepares environment to manage user interaction on a create operations + * + * @param stdClass $argsObj + * reference to input values received by page. + * @return stdClass object with part of gui configuration + */ +function create(&$argsObj) +{ + $op = new stdClass(); + $op->operation_descr = lang_get('title_build_create'); + $op->buttonCfg = new stdClass(); + $op->buttonCfg->name = "do_create"; + $op->buttonCfg->value = lang_get('btn_create'); + $op->user_feedback = ''; + $argsObj->is_active = 1; + $argsObj->is_open = 1; + $argsObj->closed_on_date = mktime(0, 0, 0, date("m"), date("d"), date("Y")); + + return $op; +} + +/** + * This action deletes an existing build + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param build_mgr $buildMgr + * @param testplan $tplanMgr + * @return stdClass + */ +function doDelete(&$dbHandler, &$argsObj, &$buildMgr, &$tplanMgr) +{ + $op = new stdClass(); + $op->user_feedback = ''; + $op->operation_descr = ''; + $op->buttonCfg = null; + + $build = $buildMgr->get_by_id($argsObj->build_id); + + $qty = $tplanMgr->getExecCountOnBuild($argsObj->tplan_id, $argsObj->build_id); + if ($qty > 0 && ! $argsObj->user->hasRightOnProj($dbHandler, 'exec_delete')) { + // Need to check if user has rigth to delete executions + $op->user_feedback = sprintf( + lang_get("cannot_delete_build_no_exec_delete"), $build['name']); + return $op; + } + + if (! $buildMgr->delete($argsObj->build_id)) { + $op->user_feedback = lang_get("cannot_delete_build"); + } else { + logAuditEvent( + TLS("audit_build_deleted", $argsObj->testprojectName, + $argsObj->tplan_name, $build['name']), "DELETE", + $argsObj->build_id, "builds"); + } + return $op; +} + +/** + * Renders the GUI + * + * @param TLSmarty $smartyObj + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @param build_mgr $buildMgr + * @param stdClass $templateCfg + * @param ckeditorInterface $owebeditor + * @param stdClass $guiObj + */ +function renderGui(&$smartyObj, &$argsObj, &$tplanMgr, &$buildMgr, $templateCfg, + $owebeditor, &$guiObj) +{ + $doRender = false; + switch ($argsObj->do_action) { + case "do_create": + case "do_delete": + case "do_update": + case "setActive": + case "setInactive": + case "open": + case "close": + $doRender = true; + $tpl = is_null($templateCfg->template) ? 'buildView.tpl' : $templateCfg->template; + + // ----- + // To create the CF columns we need to get the linked CF + // Attention this is affected by changes in templates + $guiObj->buildSet = $tplanMgr->get_builds($argsObj->tplan_id); + $availableCF = (array) $buildMgr->get_linked_cfields_at_design( + $guiObj->build, $guiObj->tproject_id); + + $hasCF = count($availableCF); + $guiObj->cfieldsColumns = null; + $guiObj->cfieldsType = null; + + // get CF used to configure HIDE COLS + // We want different configurations for different test projects + // then will do two steps algorithm + // 1. get test project prefix PPFX + // 2. look for TL_BUILDVIEW_HIDECOL_PPFX + // 3. if found proceed + // 4. else look for TL_BUILDVIEW_HIDECOL + // + $ppfx = $tplanMgr->tproject_mgr->getTestCasePrefix( + $guiObj->tproject_id); + $suffixSet = [ + '_' . $ppfx, + '' + ]; + foreach ($suffixSet as $suf) { + $gopt['name'] = 'TL_BUILDVIEW_HIDECOL' . $suf; + $col2hideCF = $tplanMgr->cfield_mgr->get_linked_to_testproject( + $guiObj->tproject_id, null, $gopt); + if ($col2hideCF != null) { + $col2hideCF = current($col2hideCF); + $col2hide = array_flip( + explode('|', $col2hideCF['possible_values'])); + $col2hide[$gopt['name']] = ''; + break; + } + } + + $localeDateFormat = config_get('locales_date_format'); + $localeDateFormat = $localeDateFormat[$args->user->locale]; + $initCFCol = true; + + foreach ($guiObj->buildSet as $elemBuild) { + $idk = current($elemBuild); + if ($hasCF) { + $cfields = (array) $buildMgr->getCustomFieldsValues($idk, + $guiObj->tproject_id); + foreach ($cfields as $cfd) { + if ($initCFCol && ! isset($col2hide[$cfd['name']])) { + $guiObj->cfieldsColumns[] = $cfd['label']; + $guiObj->cfieldsType[] = $cfd['type']; + } + $guiObj->buildSet[$idk][$cfd['label']] = [ + 'value' => $cfd['value'], + 'data-order' => $cfd['value'] + ]; + if ($cfd['type'] == 'date') { + $guiObj->buildSet[$idk][$cfd['label']]['data-order'] = locateDateToISO( + $cfd['value'], $localeDateFormat); + } + } + $initCFCol = false; + } + } + break; + + case "edit": + case "create": + $doRender = true; + $tpl = is_null($templateCfg->template) ? $templateCfg->default_template : $templateCfg->template; + break; + } + + if ($doRender) { + + // Attention this is affected by changes in templates + $guiObj->enable_copy = ($argsObj->do_action == 'create' || + $argsObj->do_action == 'do_create') ? 1 : 0; + $guiObj->notes = $owebeditor->CreateHTML(); + $guiObj->source_build = initSourceBuildSelector($tplanMgr, $argsObj); + + $k2c = array( + 'tplan_name', + 'build_id', + 'build_name', + 'is_active', + 'is_open', + 'copy_tester_assignments', + 'commit_id', + 'tag', + 'branch', + 'release_candidate' + ); + + foreach ($k2c as $pp) { + $guiObj->$pp = $argsObj->$pp; + } + + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($templateCfg->template_dir . $tpl); + } +} + +/** + * create action + * + * @param stdClass $argsObj + * @param build_mgr $buildMgr + * @param testplan $tplanMgr + * @param string $dateFormat + * @return stdClass + */ +function doCreate(&$argsObj, &$buildMgr, &$tplanMgr, $dateFormat) +{ + $op = new stdClass(); + $op->operation_descr = ''; + $op->user_feedback = ''; + $op->template = "buildEdit.tpl"; + $op->notes = $argsObj->notes; + $op->status_ok = 0; + $op->buttonCfg = null; + $check = crossChecks($argsObj, $tplanMgr, $dateFormat); + $targetDate = null; + if ($check->status_ok) { + $oBuild = new stdClass(); + // 'creation_ts' + $prop = array( + 'tplan_id', + 'release_date', + 'notes', + 'commit_id', + 'tag', + 'branch', + 'release_candidate', + 'is_active', + 'is_open' + ); + + $oBuild->name = $argsObj->build_name; + foreach ($prop as $pp) { + $oBuild->$pp = $argsObj->$pp; + } + + $buildID = $buildMgr->createFromObject($oBuild); + + if ($buildID) { + $cf_map = $buildMgr->get_linked_cfields_at_design($buildID, + $argsObj->testprojectID); + $buildMgr->cfield_mgr->design_values_to_db($_REQUEST, $buildID, + $cf_map, null, 'build'); + + if ($argsObj->is_open == 1) { + $targetDate = null; + } else { + $targetDate = date("Y-m-d", $argsObj->closed_on_date); + } + $buildMgr->setClosedOnDate($buildID, $targetDate); + + if ($argsObj->copy_tester_assignments && $argsObj->source_build_id) { + if (! is_null($argsObj->exec_status_filter) && + is_array($argsObj->exec_status_filter)) { + $buildSet[] = $argsObj->source_build_id; + + $execVerboseDomain = config_get('results'); + $execVerboseDomain = array_flip( + $execVerboseDomain['status_code']); + + // remember that assignment is done at platform + build + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => true, + 'outputDetails' => 'name' + ); + $platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, + $getOpt); + + $caOpt['keep_old_assignments'] = true; + foreach ($platformSet as $platform_id => $pname) { + $glf['filters']['platform_id'] = $platform_id; + foreach ($argsObj->exec_status_filter as $ec) { + switch ($execVerboseDomain[$ec]) { + case 'not_run': + $tcaseSet = $tplanMgr->getHitsNotRunForBuildAndPlatform( + $argsObj->tplan_id, $platform_id, + $argsObj->source_build_id); + + break; + + default: + $tcaseSet = $tplanMgr->getHitsSingleStatusFull( + $argsObj->tplan_id, $platform_id, $ec, + $buildSet); + break; + } + + if (! is_null($tcaseSet)) { + $targetSet = array_keys($tcaseSet); + $features = $tplanMgr->getLinkedFeatures( + $argsObj->tplan_id, $glf['filters']); + $caOpt['feature_set'] = null; + foreach ($targetSet as $tcase_id) { + $caOpt['feature_set'][] = $features[$tcase_id][$glf['filters']['platform_id']]['feature_id']; + } + $tplanMgr->assignment_mgr->copy_assignments( + $argsObj->source_build_id, $buildID, + $argsObj->userID, $caOpt); + } + } + } + } else { + $tplanMgr->assignment_mgr->copy_assignments( + $argsObj->source_build_id, $buildID, $argsObj->userID); + } + } + + $op->user_feedback = ''; + $op->notes = ''; + $op->template = null; + $op->status_ok = 1; + logAuditEvent( + TLS("audit_build_created", $argsObj->testprojectName, + $argsObj->tplan_name, $argsObj->build_name), "CREATE", + $buildID, "builds"); + } + } + + if (! $op->status_ok) { + $op->buttonCfg = new stdClass(); + $op->buttonCfg->name = "do_create"; + $op->buttonCfg->value = lang_get('btn_create'); + $op->user_feedback = $check->user_feedback; + } elseif ($argsObj->copy_to_all_tplans) { + doCopyToTestPlans($argsObj, $buildMgr, $tplanMgr); + } + return $op; +} + +/** + * This action updates a build + * + * @param stdClass $argsObj + * @param build_mgr $buildMgr + * @param testplan $tplanMgr + * @param string $dateFormat + * @return stdClass + */ +function doUpdate(&$argsObj, &$buildMgr, &$tplanMgr, $dateFormat) +{ + $op = new stdClass(); + $op->operation_descr = ''; + $op->user_feedback = ''; + $op->template = "buildEdit.tpl"; + $op->notes = $argsObj->notes; + $op->status_ok = 0; + $op->buttonCfg = null; + + $oldObjData = $buildMgr->get_by_id($argsObj->build_id); + $oldname = $oldObjData['name']; + + $check = crossChecks($argsObj, $tplanMgr, $dateFormat); + if ($check->status_ok) { + $attr = array(); + $k2c = array( + 'release_date', + 'release_candidate', + 'is_active', + 'is_open', + 'copy_tester_assignments', + 'commit_id', + 'tag', + 'branch' + ); + foreach ($k2c as $pp) { + $attr[$pp] = $argsObj->$pp; + } + + if ($buildMgr->update($argsObj->build_id, $argsObj->build_name, + $argsObj->notes, $attr)) { + $cf_map = $buildMgr->get_linked_cfields_at_design( + $argsObj->build_id, $argsObj->testprojectID); + $buildMgr->cfield_mgr->design_values_to_db($_REQUEST, + $argsObj->build_id, $cf_map, null, 'build'); + + if ($argsObj->closed_on_date == '') { + $argsObj->closed_on_date = mktime(0, 0, 0, date("m"), date("d"), + date("Y")); + } + + if ($argsObj->is_open == 1) { + $targetDate = null; + } else { + $targetDate = date("Y-m-d", $argsObj->closed_on_date); + } + $buildMgr->setClosedOnDate($argsObj->build_id, $targetDate); + + $op->user_feedback = ''; + $op->notes = ''; + $op->template = null; + $op->status_ok = 1; + logAuditEvent( + TLS("audit_build_saved", $argsObj->testprojectName, + $argsObj->tplan_name, $argsObj->build_name), "SAVE", + $argsObj->build_id, "builds"); + } + } + + if (! $op->status_ok) { + $op->operation_descr = lang_get('title_build_edit') . TITLE_SEP_TYPE3 . + $oldname; + $op->buttonCfg = new stdClass(); + $op->buttonCfg->name = "do_update"; + $op->buttonCfg->value = lang_get('btn_save'); + $op->user_feedback = $check->user_feedback; + } + return $op; +} + +/** + * crossChecks + * + * do checks that are common to create and update operations + * - name already exists in this testplan? + * + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @param string $dateFormat + * @return stdClass + * @internal revision + * 20100706 - franciscom - BUGID 3581 + */ +function crossChecks($argsObj, &$tplanMgr, $dateFormat) +{ + $op = new stdClass(); + $op->user_feedback = ''; + $op->status_ok = 1; + $buildID = ($argsObj->do_action == 'do_update') ? $argsObj->build_id : null; + if ($tplanMgr->check_build_name_existence($argsObj->tplan_id, + $argsObj->build_name, $buildID)) { + $op->user_feedback = lang_get("warning_duplicate_build") . + TITLE_SEP_TYPE3 . $argsObj->build_name; + $op->status_ok = 0; + } + + // check is date is valid + if ($op->status_ok) { + + // BUGID 3716 + $rdate = trim($argsObj->release_date_original); + + $date_array = split_localized_date($rdate, $dateFormat); + + if ($date_array != null) { + $status_ok = checkdate($date_array['month'], $date_array['day'], + $date_array['year']); + $op->status_ok = $status_ok ? 1 : 0; + } else { + $op->status_ok = 0; + } + + // release date is optional + if ($rdate == "") { + $op->status_ok = 1; + } + + if ($op->status_ok == 0) { + $op->user_feedback = lang_get("invalid_release_date"); + } + } + + return $op; +} + +/** + * Copy do checks that are common to create and update operations + * - name already exists in this testplan? + * + * @param stdClass $argsObj + * @param build_mgr $buildMgr + * @param testplan $tplanMgr + */ +function doCopyToTestPlans(&$argsObj, &$buildMgr, &$tplanMgr) +{ + $tprojectMgr = new testproject($tplanMgr->db); + + // exclude this testplan + $filters = array( + 'tplan2exclude' => $argsObj->tplan_id + ); + $tplanset = $tprojectMgr->get_all_testplans($argsObj->testprojectID, + $filters); + + if (! is_null($tplanset)) { + foreach ($tplanset as $id => $info) { + if (! $tplanMgr->check_build_name_existence($id, + $argsObj->build_name)) { + $buildMgr->create($id, $argsObj->build_name, $argsObj->notes, + $argsObj->is_active, $argsObj->is_open); + } + } + } +} + +/** + * Check the rights + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_create_build" + ]; + pageAccessCheck($db, $user, $context); +} + +/** + * Initialize the HTML select box for selection of a source build when + * user wants to copy the user assignments on creation of a new build. + * + * @author Andreas Simon + * @param testplan $testplan_mgr + * reference to testplan manager object + * @param object $argsObj + * reference to user input object + * @return array $htmlMenu array structure with all information needed for the menu + * + * @internal revisions + */ +function initSourceBuildSelector(&$testplan_mgr, &$argsObj) +{ + $htmlMenu = array( + 'items' => null, + 'selected' => null, + 'build_count' => 0 + ); + $htmlMenu['items'] = $testplan_mgr->get_builds_for_html_options( + $argsObj->tplan_id, null, null, array( + 'orderByDir' => 'id:DESC' + )); + + // get the number of existing execution assignments with each build + if (! is_null($htmlMenu['items'])) { + $htmlMenu['build_count'] = count($htmlMenu['items']); + foreach ($htmlMenu['items'] as $key => $name) { + $count = $testplan_mgr->assignment_mgr->get_count_of_assignments_for_build_id( + $key); + $htmlMenu['items'][$key] = $name . " (" . $count . ")"; + } + + // if no build has been chosen yet, select the newest build by default + reset($htmlMenu['items']); + if (! $argsObj->source_build_id) { + $htmlMenu['selected'] = key($htmlMenu['items']); + } + } + + return $htmlMenu; } - -$dummy = null; -$gui->release_date = (isset($op->status_ok) && $op->status_ok && $args->release_date != "") ? - localize_dateOrTimeStamp(null, $dummy, 'date_format',$args->release_date) : - $args->release_date_original; -$gui->closed_on_date = $args->closed_on_date; -$gui->operation_descr = $op->operation_descr; -$gui->user_feedback = $op->user_feedback; -$gui->buttonCfg = $op->buttonCfg; - -$gui->mgt_view_events = $args->user->hasRight($db,"mgt_view_events"); -$gui->editorType = $editorCfg['type']; - -renderGui($smarty,$args,$tplan_mgr,$build_mgr,$templateCfg,$of,$gui); - -/* - * INITialize page ARGuments, using the $_REQUEST and $_SESSION - * super-global hashes. - * Important: changes in HTML input elements on the Smarty template - * must be reflected here. - * - * - * @parameter hash request_hash the $_REQUEST - * @parameter hash session_hash the $_SESSION - * @return object with html values tranformed and other - * generated variables. - * @internal revisions - * - */ -function init_args($request_hash, $session_hash,$date_format,&$tplanMgr) { - $args = new stdClass(); - $request_hash = strings_stripSlashes($request_hash); - - $nullable_keys = array('notes','do_action','build_name', - 'commit_id','tag','branch','release_candidate'); - foreach($nullable_keys as $value) { - $args->$value = isset($request_hash[$value]) ? $request_hash[$value] : null; - } - - $intval_keys = array('build_id' => 0, 'source_build_id' => 0); - foreach($intval_keys as $key => $value) { - $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; - } - - $bool_keys = array('is_active' => 0, 'is_open' => 0, - 'copy_to_all_tplans' => 0, - 'copy_tester_assignments' => 0); - foreach($bool_keys as $key => $value) { - $args->$key = isset($request_hash[$key]) ? 1 : $value; - } - - // convert start date to iso format to write to db - $args->release_date = null; - if (isset($request_hash['release_date']) && $request_hash['release_date'] != '') - { - $date_array = split_localized_date($request_hash['release_date'], $date_format); - if ($date_array != null) { - // set date in iso format - $args->release_date = $date_array['year'] . "-" . $date_array['month'] . "-" . $date_array['day']; - } - } - - $args->release_date_original = isset($request_hash['release_date']) && $request_hash['release_date'] != '' ? - $request_hash['release_date'] : null; - - $args->closed_on_date = isset($request_hash['closed_on_date']) ? $request_hash['closed_on_date'] : null; - - - if(isset($request_hash['tplan_id']) && intval($request_hash['tplan_id']) > 0) { - $args->tplan_id = intval($_REQUEST['tplan_id']); - $dp = $tplanMgr->get_by_id($args->tplan_id); - $args->tplan_name = $dp['name']; - } else { - $args->tplan_id = isset($session_hash['testplanID']) ? intval($session_hash['testplanID']) : 0; - $args->tplan_name = isset($session_hash['testplanName']) ? $session_hash['testplanName']: ''; - } - - $args->testprojectID = intval($session_hash['testprojectID']); - $args->tproject_id = intval($session_hash['testprojectID']); - - $args->testprojectName = $session_hash['testprojectName']; - $args->userID = intval($session_hash['userID']); - - $args->exec_status_filter = - isset($request_hash['exec_status_filter']) ? - $request_hash['exec_status_filter'] : null; - - $args->user = $_SESSION['currentUser']; - return $args; -} - -/** - * - * - */ -function initializeGui(&$argsObj,&$buildMgr) { - $guiObj = new stdClass(); - $guiObj->main_descr = lang_get('title_build_2') . - config_get('gui_title_separator_2') . - lang_get('test_plan') . config_get('gui_title_separator_1') . - $argsObj->tplan_name; - - $guiObj->cfields = $buildMgr->html_custom_field_inputs($argsObj->build_id,$argsObj->testprojectID,'design','',$_REQUEST); - - $dummy = config_get('results'); - foreach($dummy['status_label_for_exec_ui'] as $kv => $vl) { - $guiObj->exec_status_filter['items'][$dummy['status_code'][$kv]] = lang_get($vl); - } - $guiObj->exec_status_filter['selected'] = - $argsObj->exec_status_filter; - - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->tproject_id = $argsObj->tproject_id; - return $guiObj; -} - - -/* - function: edit - edit action - - args : - - returns: - -*/ -function edit(&$argsObj,&$buildMgr,$dateFormat) { - - $binfo = $buildMgr->get_by_id($argsObj->build_id); - $op = new stdClass(); - $op->buttonCfg = new stdClass(); - $op->buttonCfg->name = "do_update"; - $op->buttonCfg->value = lang_get('btn_save'); - $op->notes = $binfo['notes']; - $op->user_feedback = ''; - $op->status_ok = 1; - - $argsObj->build_name = $binfo['name']; - $argsObj->is_active = $binfo['active']; - - $k2l = array('is_open','commit_id','tag', - 'branch','release_candidate', - 'release_date'); - foreach( $k2l as $pp ) { - $argsObj->$pp = $binfo[$pp]; - } - - if( $binfo['closed_on_date'] == '') { - $argsObj->closed_on_date = mktime(0, 0, 0, date("m") , date("d"), date("Y")); - } else { - $datePieces = explode("-",$binfo['closed_on_date']); - $argsObj->closed_on_date = mktime(0,0,0,$datePieces[1],$datePieces[2],$datePieces[0]); - } - - $op->operation_descr=lang_get('title_build_edit') . TITLE_SEP_TYPE3 . $argsObj->build_name; - - return $op; -} - -/* - function: create - prepares environment to manage user interaction on a create operations - - args: $argsObj: reference to input values received by page. - - returns: object with part of gui configuration - -*/ -function create(&$argsObj) { - - $op = new stdClass(); - $op->operation_descr = lang_get('title_build_create'); - $op->buttonCfg = new stdClass(); - $op->buttonCfg->name = "do_create"; - $op->buttonCfg->value = lang_get('btn_create'); - $op->user_feedback = ''; - $argsObj->is_active = 1; - $argsObj->is_open = 1; - $argsObj->closed_on_date = mktime(0, 0, 0, date("m") , date("d"), date("Y")); - - return $op; -} - -/* - function: doDelete - - args : - - returns: - -*/ -function doDelete(&$dbHandler,&$argsObj,&$buildMgr,&$tplanMgr) { - $op = new stdClass(); - $op->user_feedback = ''; - $op->operation_descr = ''; - $op->buttonCfg = null; - - $build = $buildMgr->get_by_id($argsObj->build_id); - - $qty = $tplanMgr->getExecCountOnBuild($argsObj->tplan_id,$argsObj->build_id); - if($qty > 0 && !$argsObj->user->hasRightOnProj($dbHandler,'exec_delete')) - { - // Need to check if user has rigth to delete executions - $op->user_feedback = sprintf(lang_get("cannot_delete_build_no_exec_delete"),$build['name']); - return $op; - } - - - if (!$buildMgr->delete($argsObj->build_id)) - { - $op->user_feedback = lang_get("cannot_delete_build"); - } - else - { - logAuditEvent(TLS("audit_build_deleted",$argsObj->testprojectName,$argsObj->tplan_name,$build['name']), - "DELETE",$argsObj->build_id,"builds"); - } - return $op; -} - -/* - function: - - args : - - returns: - -*/ -function renderGui(&$smartyObj,&$argsObj,&$tplanMgr,&$buildMgr,$templateCfg,$owebeditor,&$guiObj) -{ - $doRender = false; - switch($argsObj->do_action) - { - case "do_create": - case "do_delete": - case "do_update": - case "setActive": - case "setInactive": - case "open": - case "close": - $doRender = true; - $tpl = is_null($templateCfg->template) ? 'buildView.tpl' : $templateCfg->template; - - // ----- - // To create the CF columns we need to get the linked CF - // Attention this is affected by changes in templates - $guiObj->buildSet=$tplanMgr->get_builds($argsObj->tplan_id); - $availableCF = (array)$buildMgr->get_linked_cfields_at_design($guiObj->build,$guiObj->tproject_id); - - $hasCF = count($availableCF); - $guiObj->cfieldsColumns = null; - $guiObj->cfieldsType = null; - - // get CF used to configure HIDE COLS - // We want different configurations for different test projects - // then will do two steps algorithm - // 1. get test project prefix PPFX - // 2. look for TL_BUILDVIEW_HIDECOL_PPFX - // 3. if found proceed - // 4. else look for TL_BUILDVIEW_HIDECOL - // - $ppfx = $tplanMgr->tproject_mgr->getTestCasePrefix($guiObj->tproject_id); - $suffixSet = ['_' . $ppfx, '']; - foreach($suffixSet as $suf) { - $gopt['name'] = 'TL_BUILDVIEW_HIDECOL' . $suf; - $col2hideCF = $tplanMgr->cfield_mgr->get_linked_to_testproject($guiObj->tproject_id,null,$gopt); - if ($col2hideCF != null) { - $col2hideCF = current($col2hideCF); - $col2hide = array_flip(explode('|',$col2hideCF['possible_values'])); - $col2hide[$gopt['name']] = ''; - break; - } - } - - $localeDateFormat = config_get('locales_date_format'); - $localeDateFormat = $localeDateFormat[$args->user->locale]; - $initCFCol = true; - - foreach($guiObj->buildSet as $elemBuild) { - $idk = current($elemBuild); - if ($hasCF) { - $cfields = (array)$buildMgr->getCustomFieldsValues($idk,$guiObj->tproject_id); - foreach ($cfields as $cfd) { - if ($initCFCol) { - if (!isset($col2hide[$cfd['name']])) { - $guiObj->cfieldsColumns[] = $cfd['label']; - $guiObj->cfieldsType[] = $cfd['type']; - } - } - $guiObj->buildSet[$idk][$cfd['label']] = ['value' => $cfd['value'], 'data-order' => $cfd['value']]; - if ($cfd['type'] == 'date') { - $guiObj->buildSet[$idk][$cfd['label']]['data-order'] = locateDateToISO($cfd['value'], $localeDateFormat); - } - } - $initCFCol = false; - } - } - //------ - break; - - case "edit": - case "create": - $doRender = true; - $tpl = is_null($templateCfg->template) ? $templateCfg->default_template : $templateCfg->template; - break; - } - - if($doRender) { - - // Attention this is affected by changes in templates - $guiObj->enable_copy = ($argsObj->do_action == 'create' || $argsObj->do_action == 'do_create') ? 1 : 0; - $guiObj->notes = $owebeditor->CreateHTML(); - $guiObj->source_build = init_source_build_selector($tplanMgr, $argsObj); - - $k2c = array('tplan_name','build_id','build_name', - 'is_active','is_open','copy_tester_assignments', - 'commit_id','tag','branch','release_candidate'); - - foreach( $k2c as $pp ) { - $guiObj->$pp=$argsObj->$pp; - } - - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($templateCfg->template_dir . $tpl); - } - -} - - -/* - function: doCreate - - args : - - returns: - - @internal revisions -*/ -function doCreate(&$argsObj,&$buildMgr,&$tplanMgr,$dateFormat) { - $op = new stdClass(); - $op->operation_descr = ''; - $op->user_feedback = ''; - $op->template = "buildEdit.tpl"; - $op->notes = $argsObj->notes; - $op->status_ok = 0; - $op->buttonCfg = null; - $check = crossChecks($argsObj,$tplanMgr,$dateFormat); - $targetDate = null; - if($check->status_ok) { - $user_feedback = lang_get("cannot_add_build"); - - $oBuild = new stdClass(); - // 'creation_ts' - $prop = array('tplan_id','release_date','notes', - 'commit_id', 'tag', - 'branch', 'release_candidate', - 'is_active','is_open'); - - $oBuild->name = $argsObj->build_name; - foreach( $prop as $pp ) { - $oBuild->$pp = $argsObj->$pp; - } - - $buildID = $buildMgr->createFromObject($oBuild); - - if ($buildID) { - $cf_map = $buildMgr->get_linked_cfields_at_design($buildID,$argsObj->testprojectID); - $buildMgr->cfield_mgr->design_values_to_db($_REQUEST,$buildID,$cf_map,null,'build'); - - if($argsObj->is_open == 1) { - $targetDate = null; - } else { - $targetDate=date("Y-m-d",$argsObj->closed_on_date); - } - $buildMgr->setClosedOnDate($buildID,$targetDate); - - if ($argsObj->copy_tester_assignments && - $argsObj->source_build_id) { - if(!is_null($argsObj->exec_status_filter) && - is_array($argsObj->exec_status_filter)) { - $buildSet[] = $argsObj->source_build_id; - - $execVerboseDomain = config_get('results'); - $execVerboseDomain = array_flip($execVerboseDomain['status_code']); - - // remember that assignment is done at platform + build - $getOpt = array('outputFormat' => 'mapAccessByID' , 'addIfNull' => true, - 'outputDetails' => 'name'); - $platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,$getOpt); - - $caOpt['keep_old_assignments'] = true; - foreach($platformSet as $platform_id => $pname) { - $glf['filters']['platform_id'] = $platform_id; - foreach($argsObj->exec_status_filter as $ec) { - switch($execVerboseDomain[$ec]) { - case 'not_run': - $tcaseSet = $tplanMgr->getHitsNotRunForBuildAndPlatform( - $argsObj->tplan_id,$platform_id,$argsObj->source_build_id); - - break; - - default: - $tcaseSet = $tplanMgr->getHitsSingleStatusFull( - $argsObj->tplan_id,$platform_id,$ec,$buildSet); - break; - } - - if(!is_null($tcaseSet)){ - $targetSet = array_keys($tcaseSet); - $features = $tplanMgr->getLinkedFeatures($argsObj->tplan_id,$glf['filters']); - $caOpt['feature_set'] = null; - foreach($targetSet as $tcase_id) { - $caOpt['feature_set'][] = - $features[$tcase_id][$glf['filters']['platform_id']]['feature_id']; - } - $tplanMgr->assignment_mgr->copy_assignments( - $argsObj->source_build_id, $buildID, $argsObj->userID,$caOpt); - } - } - } - } else { - $tplanMgr->assignment_mgr->copy_assignments($argsObj->source_build_id, - $buildID, $argsObj->userID); - } - } - - $op->user_feedback = ''; - $op->notes = ''; - $op->template = null; - $op->status_ok = 1; - logAuditEvent(TLS("audit_build_created",$argsObj->testprojectName, - $argsObj->tplan_name,$argsObj->build_name), - "CREATE",$buildID,"builds"); - } - } - - if(!$op->status_ok) { - $op->buttonCfg = new stdClass(); - $op->buttonCfg->name = "do_create"; - $op->buttonCfg->value = lang_get('btn_create'); - $op->user_feedback = $check->user_feedback; - } elseif($argsObj->copy_to_all_tplans) { - doCopyToTestPlans($argsObj,$buildMgr,$tplanMgr); - } - return $op; -} - - -/* - function: doUpdate - - args : - - returns: - -*/ -function doUpdate(&$argsObj,&$buildMgr,&$tplanMgr,$dateFormat) -{ - $op = new stdClass(); - $op->operation_descr = ''; - $op->user_feedback = ''; - $op->template = "buildEdit.tpl"; - $op->notes = $argsObj->notes; - $op->status_ok = 0; - $op->buttonCfg = null; - - $oldObjData = $buildMgr->get_by_id($argsObj->build_id); - $oldname = $oldObjData['name']; - - $check = crossChecks($argsObj,$tplanMgr,$dateFormat); - if($check->status_ok) { - $user_feedback = lang_get("cannot_update_build"); - - $attr = array(); - $k2c = array('release_date','release_candidate', - 'is_active','is_open','copy_tester_assignments', - 'commit_id','tag','branch'); - foreach( $k2c as $pp ) { - $attr[$pp] = $argsObj->$pp; - } - - if ($buildMgr->update($argsObj->build_id,$argsObj->build_name,$argsObj->notes,$attr) ) { - $cf_map = $buildMgr->get_linked_cfields_at_design($argsObj->build_id,$argsObj->testprojectID); - $buildMgr->cfield_mgr->design_values_to_db($_REQUEST,$argsObj->build_id,$cf_map,null,'build'); - - if( $argsObj->closed_on_date == '') { - $argsObj->closed_on_date = mktime(0, 0, 0, date("m") , date("d"), date("Y")); - } - - if($argsObj->is_open == 1) { - $targetDate=null; - } else { - $targetDate=date("Y-m-d",$argsObj->closed_on_date); - } - $buildMgr->setClosedOnDate($argsObj->build_id,$targetDate); - - $op->user_feedback = ''; - $op->notes = ''; - $op->template = null; - $op->status_ok = 1; - logAuditEvent(TLS("audit_build_saved",$argsObj->testprojectName,$argsObj->tplan_name,$argsObj->build_name), - "SAVE",$argsObj->build_id,"builds"); - } - } - - if(!$op->status_ok) - { - $op->operation_descr = lang_get('title_build_edit') . TITLE_SEP_TYPE3 . $oldname; - $op->buttonCfg = new stdClass(); - $op->buttonCfg->name = "do_update"; - $op->buttonCfg->value = lang_get('btn_save'); - $op->user_feedback = $check->user_feedback; - } - return $op; -} - -/* - function: crossChecks - do checks that are common to create and update operations - - name already exists in this testplan? - args: - - returns: - - - @internal revision - 20100706 - franciscom - BUGID 3581 -*/ -function crossChecks($argsObj,&$tplanMgr,$dateFormat) -{ - $op = new stdClass(); - $op->user_feedback = ''; - $op->status_ok = 1; - $buildID = ($argsObj->do_action == 'do_update') ? $argsObj->build_id : null; - if( $tplanMgr->check_build_name_existence($argsObj->tplan_id,$argsObj->build_name,$buildID) ) - { - $op->user_feedback = lang_get("warning_duplicate_build") . TITLE_SEP_TYPE3 . $argsObj->build_name; - $op->status_ok = 0; - } - - // check is date is valid - if( $op->status_ok ) - { - - // BUGID 3716 - $rdate = trim($argsObj->release_date_original); - - // TODO: comment - $date_array = split_localized_date($rdate,$dateFormat); - - if( $date_array != null ) - { - $status_ok = checkdate($date_array['month'],$date_array['day'],$date_array['year']); - $op->status_ok = $status_ok ? 1 : 0; - } else { - $op->status_ok = 0; - } - - // release date is optional - if ( $rdate == "") { - $op->status_ok = 1; - } - - if( $op->status_ok == 0 ) - { - $op->user_feedback = lang_get("invalid_release_date"); - } - } - - return $op; -} - -/* - function: doCopyToTestPlans - copy do checks that are common to create and update operations - - name already exists in this testplan? - args: - - returns: - - -*/ -function doCopyToTestPlans(&$argsObj,&$buildMgr,&$tplanMgr) -{ - $tprojectMgr = new testproject($tplanMgr->db); - - // exclude this testplan - $filters = array('tplan2exclude' => $argsObj->tplan_id); - $tplanset = $tprojectMgr->get_all_testplans($argsObj->testprojectID,$filters); - - if(!is_null($tplanset)) - { - foreach($tplanset as $id => $info) - { - if(!$tplanMgr->check_build_name_existence($id,$argsObj->build_name)) - { - $buildMgr->create($id,$argsObj->build_name,$argsObj->notes, - $argsObj->is_active,$argsObj->is_open); - } - } - } -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_create_build"]; - pageAccessCheck($db, $user, $context); -} - - -/** - * Initialize the HTML select box for selection of a source build when - * user wants to copy the user assignments on creation of a new build. - * - * @author Andreas Simon - * @param testplan $testplan_mgr reference to testplan manager object - * @param object $argsObj reference to user input object - * @return array $htmlMenu array structure with all information needed for the menu - * - * @internal revisions - */ -function init_source_build_selector(&$testplan_mgr, &$argsObj) -{ - - $htmlMenu = array('items' => null, 'selected' => null, 'build_count' => 0); - $htmlMenu['items'] = $testplan_mgr->get_builds_for_html_options($argsObj->tplan_id,null,null, - array('orderByDir' => 'id:DESC')); - - - // get the number of existing execution assignments with each build - if( !is_null($htmlMenu['items']) ) - { - $htmlMenu['build_count'] = count($htmlMenu['items']); - foreach ($htmlMenu['items'] as $key => $name) - { - $count = $testplan_mgr->assignment_mgr->get_count_of_assignments_for_build_id($key); - $htmlMenu['items'][$key] = $name . " (" . $count . ")"; - } - - // if no build has been chosen yet, select the newest build by default - reset($htmlMenu['items']); - if( !$argsObj->source_build_id ) - { - $htmlMenu['selected'] = key($htmlMenu['items']); - } - } - - return $htmlMenu; -} // end of method diff --git a/lib/plan/buildView.php b/lib/plan/buildView.php index 139c530f28..8ecddaa6d6 100644 --- a/lib/plan/buildView.php +++ b/lib/plan/buildView.php @@ -1,134 +1,146 @@ -tproject_id = $gui->tproject_id; -$context->tplan_id = $gui->tplan_id; - -checkRights($db,$_SESSION['currentUser'],$context); - -/** - * - */ -function initEnv(&$dbHandler) -{ - $gui = new StdClass(); - - $_REQUEST = strings_stripSlashes($_REQUEST); - $gui->tplan_id = isset($_REQUEST['tplan_id']) - ? intval($_REQUEST['tplan_id']) : 0; - if( $gui->tplan_id == 0 ) { - throw new Exception("Abort Test Plan ID == 0", 1); - } - - $tplan_mgr = new testplan($dbHandler); - $build_mgr = new build_mgr($dbHandler); - $info = $tplan_mgr->tree_manager-> - get_node_hierarchy_info($gui->tplan_id,null,array('nodeType' => 'testplan')); - - if( !is_null($info) ) { - $gui->tplan_name = $info['name']; - } else { - throw new Exception("Invalid Test Plan ID", 1); - } - - $gui->tproject_id = intval($info['parent_id']); - - $gui->buildSet = $tplan_mgr->get_builds($gui->tplan_id); - $gui->user_feedback = null; - - // To create the CF columns we need to get the linked CF - $availableCF = []; - if (!is_null($gui->buildSet)) { - $availableCF = (array)$build_mgr->get_linked_cfields_at_design(current($gui->buildSet),$gui->tproject_id); - } - $hasCF = count($availableCF); - $gui->cfieldsColumns = null; - $gui->cfieldsType = null; - $initCFCol = true; - - // get CF used to configure HIDE COLS - // We want different configurations for different test projects - // then will do two steps algorithm - // 1. get test project prefix PPFX - // 2. look for TL_BUILDVIEW_HIDECOL_PPFX - // 3. if found proceed - // 4. else look for TL_BUILDVIEW_HIDECOL - // - $ppfx = $tplan_mgr->tproject_mgr->getTestCasePrefix($gui->tproject_id); - $suffixSet = ['_' . $ppfx, '']; - foreach($suffixSet as $suf) { - $gopt['name'] = 'TL_BUILDVIEW_HIDECOL' . $suf; - $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject($gui->tproject_id,null,$gopt); - - if ($col2hideCF != null) { - $col2hideCF = current($col2hideCF); - $col2hide = array_flip(explode('|',$col2hideCF['possible_values'])); - $col2hide[$gopt['name']] = ''; - break; - } - } - $localeDateFormat = config_get('locales_date_format'); - $localeDateFormat = $localeDateFormat[$_SESSION['currentUser']->locale]; - - foreach($gui->buildSet as $elemBuild) { - // --------------------------------------------------------------------------------------------- - $idk = current($elemBuild); - if ($hasCF) { - $cfields = (array)$build_mgr->getCustomFieldsValues($idk,$gui->tproject_id); - foreach ($cfields as $cfd) { - if ($initCFCol) { - if (!isset($col2hide[$cfd['name']])) { - $gui->cfieldsColumns[] = $cfd['label']; - $gui->cfieldsType[] = $cfd['type']; - } - } - $gui->buildSet[$idk][$cfd['label']] = ['value' => $cfd['value'], 'data-order' => $cfd['value']]; - if ($cfd['type'] == 'date') { - $gui->buildSet[$idk][$cfd['label']]['data-order'] = locateDateToISO($cfd['value'], $localeDateFormat); - } - } - $initCFCol = false; - } - // --------------------------------------------------------------------------------------------- - } - - - - - $cfg = getWebEditorCfg('build'); - $gui->editorType = $cfg['type']; - - return $gui; +tproject_id = $gui->tproject_id; +$context->tplan_id = $gui->tplan_id; + +checkRights($db, $_SESSION['currentUser'], $context); + +/** + * initialize the environment + * + * @param database $dbHandler + * @return StdClass + */ +function initEnv(&$dbHandler) +{ + $gui = new StdClass(); + + $_REQUEST = strings_stripSlashes($_REQUEST); + $gui->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + if ($gui->tplan_id == 0) { + throw new Exception("Abort Test Plan ID == 0", 1); + } + + $tplan_mgr = new testplan($dbHandler); + $build_mgr = new build_mgr($dbHandler); + $info = $tplan_mgr->tree_manager->get_node_hierarchy_info($gui->tplan_id, + null, array( + 'nodeType' => 'testplan' + )); + + if (! is_null($info)) { + $gui->tplan_name = $info['name']; + } else { + throw new Exception("Invalid Test Plan ID", 1); + } + + $gui->tproject_id = intval($info['parent_id']); + + $gui->buildSet = $tplan_mgr->get_builds($gui->tplan_id); + $gui->user_feedback = null; + + // To create the CF columns we need to get the linked CF + $availableCF = []; + if (! is_null($gui->buildSet)) { + $availableCF = (array) $build_mgr->get_linked_cfields_at_design( + current($gui->buildSet), $gui->tproject_id); + } + $hasCF = count($availableCF); + $gui->cfieldsColumns = null; + $gui->cfieldsType = null; + $initCFCol = true; + + // get CF used to configure HIDE COLS + // We want different configurations for different test projects + // then will do two steps algorithm + // 1. get test project prefix PPFX + // 2. look for TL_BUILDVIEW_HIDECOL_PPFX + // 3. if found proceed + // 4. else look for TL_BUILDVIEW_HIDECOL + // + $ppfx = $tplan_mgr->tproject_mgr->getTestCasePrefix($gui->tproject_id); + $suffixSet = [ + '_' . $ppfx, + '' + ]; + foreach ($suffixSet as $suf) { + $gopt['name'] = 'TL_BUILDVIEW_HIDECOL' . $suf; + $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject( + $gui->tproject_id, null, $gopt); + + if ($col2hideCF != null) { + $col2hideCF = current($col2hideCF); + $col2hide = array_flip(explode('|', $col2hideCF['possible_values'])); + $col2hide[$gopt['name']] = ''; + break; + } + } + $localeDateFormat = config_get('locales_date_format'); + $localeDateFormat = $localeDateFormat[$_SESSION['currentUser']->locale]; + + foreach ($gui->buildSet as $elemBuild) { + $idk = current($elemBuild); + if ($hasCF) { + $cfields = (array) $build_mgr->getCustomFieldsValues($idk, + $gui->tproject_id); + foreach ($cfields as $cfd) { + if ($initCFCol && ! isset($col2hide[$cfd['name']])) { + $gui->cfieldsColumns[] = $cfd['label']; + $gui->cfieldsType[] = $cfd['type']; + } + $gui->buildSet[$idk][$cfd['label']] = [ + 'value' => $cfd['value'], + 'data-order' => $cfd['value'] + ]; + if ($cfd['type'] == 'date') { + $gui->buildSet[$idk][$cfd['label']]['data-order'] = locateDateToISO( + $cfd['value'], $localeDateFormat); + } + } + $initCFCol = false; + } + } + + $cfg = getWebEditorCfg('build'); + $gui->editorType = $cfg['type']; + + return $gui; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($tplCfg->template_dir . $tplCfg->default_template); + +/** + * checks the rights + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_create_build" + ]; + pageAccessCheck($db, $user, $context); } - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($tplCfg->template_dir . $tplCfg->default_template); - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_create_build"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/plan/newest_tcversions.php b/lib/plan/newest_tcversions.php index 7f27f5d560..03cfc2fb3d 100644 --- a/lib/plan/newest_tcversions.php +++ b/lib/plan/newest_tcversions.php @@ -1,124 +1,111 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$gui = new stdClass(); -$gui->can_manage_testplans = - $_SESSION['currentUser'] - ->hasRight($db,"mgt_testplan_create",$context->tproject_id); -$gui->tplans = array(); -$gui->show_details = 0; -$gui->user_feedback = ''; -$gui->tcasePrefix = $tcase_mgr->tproject_mgr->getTestCasePrefix($args->tproject_id) . - $testcase_cfg->glue_character; - -$tplan_info = $tcase_mgr->get_by_id($args->tplan_id); -$gui->tplan_name = $tplan_info['name']; -$gui->tplan_id=$args->tplan_id; -$gui->tproject_name = $args->tproject_name; - -$linked_tcases = $tplan_mgr->get_linked_items_id($args->tplan_id); -$qty_linked = count($linked_tcases); -$gui->testcases = $tplan_mgr->get_linked_and_newest_tcversions($args->tplan_id); - -if($qty_linked) -{ - $qty_newest = count($gui->testcases); - if($qty_newest) - { - $gui->show_details = 1; - - // get path - $tcaseSet=array_keys($gui->testcases); - $path_info=$tree_mgr->get_full_path_verbose($tcaseSet); - foreach($gui->testcases as $tcase_id => $value) - { - $path=$path_info[$tcase_id]; - unset($path[0]); - $path[]=''; - $gui->testcases[$tcase_id]['path']=implode(' / ',$path); - } - } - else - { - $gui->user_feedback = lang_get('no_newest_version_of_linked_tcversions'); - } -} -else -{ - $gui->user_feedback = lang_get('no_linked_tcversions'); +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$gui = new stdClass(); +$gui->can_manage_testplans = $_SESSION['currentUser']->hasRight($db, + "mgt_testplan_create", $context->tproject_id); +$gui->tplans = array(); +$gui->show_details = 0; +$gui->user_feedback = ''; +$gui->tcasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix( + $args->tproject_id) . $testcase_cfg->glue_character; + +$tplan_info = $tcaseMgr->get_by_id($args->tplan_id); +$gui->tplan_name = $tplan_info['name']; +$gui->tplan_id = $args->tplan_id; +$gui->tproject_name = $args->tproject_name; + +$linked_tcases = $tplan_mgr->get_linked_items_id($args->tplan_id); +$qty_linked = count($linked_tcases); +$gui->testcases = $tplan_mgr->get_linked_and_newest_tcversions($args->tplan_id); + +if ($qty_linked) { + $qty_newest = count($gui->testcases); + if ($qty_newest) { + $gui->show_details = 1; + + // get path + $tcaseSet = array_keys($gui->testcases); + $path_info = $tree_mgr->get_full_path_verbose($tcaseSet); + foreach ($gui->testcases as $tcase_id => $value) { + $path = $path_info[$tcase_id]; + unset($path[0]); + $path[] = ''; + $gui->testcases[$tcase_id]['path'] = implode(' / ', $path); + } + } else { + $gui->user_feedback = lang_get('no_newest_version_of_linked_tcversions'); + } +} else { + $gui->user_feedback = lang_get('no_linked_tcversions'); +} + +$tplans = $_SESSION['currentUser']->getAccessibleTestPlans($db, + $args->tproject_id); +foreach ($tplans as $value) { + $gui->tplans[$value['id']] = $value['name']; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * init_args + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->user_id = $_SESSION['userID']; + $args->tproject_id = intval($_SESSION['testprojectID']); + $args->tproject_name = $_SESSION['testprojectName']; + + $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']; + $args->tplan_id = intval($args->tplan_id); + + $args->id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; + $args->version_id = isset($_REQUEST['version_id']) ? $_REQUEST['version_id'] : 0; + $args->level = isset($_REQUEST['level']) ? $_REQUEST['level'] : null; + + // Can be a list (string with , (comma) has item separator), + $args->keyword_id = isset($_REQUEST['keyword_id']) ? $_REQUEST['keyword_id'] : 0; + + return $args; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } - -$tplans = $_SESSION['currentUser']->getAccessibleTestPlans($db,$args->tproject_id); -foreach($tplans as $key => $value) -{ - $gui->tplans[$value['id']] = $value['name']; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * init_args - * - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->user_id = $_SESSION['userID']; - $args->tproject_id = intval($_SESSION['testprojectID']); - $args->tproject_name = $_SESSION['testprojectName']; - - $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']; - $args->tplan_id = intval($args->tplan_id); - - $args->id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; - $args->version_id = isset($_REQUEST['version_id']) ? $_REQUEST['version_id'] : 0; - $args->level = isset($_REQUEST['level']) ? $_REQUEST['level'] : null; - - // Can be a list (string with , (comma) has item separator), - $args->keyword_id = isset($_REQUEST['keyword_id']) ? $_REQUEST['keyword_id'] : 0; - - return $args; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/plan/planAddTC.php b/lib/plan/planAddTC.php index c1c712dc9c..764675a9ea 100644 --- a/lib/plan/planAddTC.php +++ b/lib/plan/planAddTC.php @@ -1,1137 +1,1110 @@ -keyword_id)) { - $keywordsFilter = new stdClass(); - $keywordsFilter->items = $args->keyword_id; - $keywordsFilter->type = $gui->keywordsFilterType->selected; -} - -$do_display = 0; -$do_display_coverage = 0; - -switch($args->item_level) { - case 'testsuite': - case 'req': - case 'req_spec': - $do_display = 1; - break; - - case 'reqcoverage': - case 'reqspeccoverage': - $do_display_coverage = 1; - break; - - case 'testproject': - redirect($_SESSION['basehref'] . - "lib/results/printDocOptions.php?activity=$args->activity"); - exit(); - break; -} - - -switch($args->doAction) { - case 'doAddRemove': - // Remember: checkboxes exist only if are checked - $gui->itemQty = count((array)$args->testcases2add); - - if( !is_null($args->testcases2add) ) { - addToTestPlan($db,$args,$gui,$tplan_mgr,$tcase_mgr); - } - - if(!is_null($args->testcases2remove)) { - // remove without warning - $items_to_unlink=null; - foreach ($args->testcases2remove as $tcase_id => $info) { - foreach ($info as $platform_id => $tcversion_id) { - $items_to_unlink['tcversion'][$tcase_id] = $tcversion_id; - $items_to_unlink['platform'][$platform_id] = $platform_id; - $items_to_unlink['items'][$tcase_id][$platform_id] = $tcversion_id; - } - } - $tplan_mgr->unlink_tcversions($args->tplan_id,$items_to_unlink); - } - - doReorder($args,$tplan_mgr); - break; - - case 'doReorder': - doReorder($args,$tplan_mgr); - break; - - case 'doSavePlatforms': - doSavePlatforms($args,$tplan_mgr); - break; - - case 'doSaveCustomFields': - doSaveCustomFields($args,$_REQUEST,$tplan_mgr,$tcase_mgr); - break; - - default: - break; -} - -$smarty = new TLSmarty(); - - -if($do_display) { - $tsuite_data = $tsuite_mgr->get_by_id($args->object_id); - // see development documentation on [INSTALL DIR]/docs/development/planAddTC.php.txt - $tplan_linked_tcversions = getFilteredLinkedVersions($db,$args,$tplan_mgr,$tcase_mgr,array('addImportance' => true)); - - // Add Test Cases to Test plan - Right pane does not honor custom field filter - $testCaseSet = $args->control_panel['filter_tc_id']; - if(!is_null($keywordsFilter) ) { - - // With this pieces we implement the AND type of keyword filter. - $keywordsTestCases = - $tproject_mgr->getKeywordsLatestTCV($args->tproject_id, - $keywordsFilter->items,$keywordsFilter->type); - - if (sizeof($keywordsTestCases)) { - $testCaseSet = array_keys($keywordsTestCases); - } - } - - // Choose enable/disable display of custom fields, analysing if this kind of custom fields - // exists on this test project. - $cfields = (array)$tsuite_mgr->cfield_mgr->get_linked_cfields_at_testplan_design($args->tproject_id,1,'testcase'); - $opt = array('write_button_only_if_linked' => 0, 'add_custom_fields' => 0); - $opt['add_custom_fields'] = count($cfields) > 0 ? 1 : 0; - - // Add Test Cases to Test plan - Right pane does not honor custom field filter - // filter by test case execution type - $filters = array('keywords' => $args->keyword_id, - 'testcases' => $testCaseSet, - 'exec_type' => $args->executionType, - 'importance' => $args->importance, - 'workflow_status' => $args->workflow_status, - 'cfields' => null, 'tcase_name' => null, - 'platforms' => null); - - if( isset($args->control_panel['filter_custom_fields']) ) { - $filters['cfields'] = $args->control_panel['filter_custom_fields']; - } - - if( isset($args->control_panel['filter_testcase_name']) ) { - $filters['tcase_name'] = - $args->control_panel['filter_testcase_name']; - } - - if( isset($args->control_panel['filter_platforms']) ) { - $filters['platforms'] = - $args->control_panel['filter_platforms']; - } - - - $out = gen_spec_view($db,'testPlanLinking', - $args->tproject_id,$args->object_id, - $tsuite_data['name'], - $tplan_linked_tcversions,null,$filters,$opt); - - $gui->has_tc = ($out['num_tc'] > 0 ? 1 : 0); - $gui->items = $out['spec_view']; - $gui->has_linked_items = $out['has_linked_items']; - $gui->add_custom_fields = $opt['add_custom_fields']; - $gui->drawSavePlatformsButton = false; - $gui->drawSaveCFieldsButton = false; - - if( !is_null($gui->items) ) - { - initDrawSaveButtons($gui); - } - - // This has to be done ONLY AFTER has all data needed => after gen_spec_view() call - setAdditionalGuiData($gui); - - // refresh tree only when action is done - switch ($args->doAction) - { - case 'doReorder': - case 'doSavePlatforms': - case 'doSaveCustomFields': - case 'doAddRemove': - $gui->refreshTree = $args->refreshTree; - break; - - default: - $gui->refreshTree = false; - break; - } - - $smarty->assign('gui', $gui); - $smarty->display($templateCfg->template_dir . 'planAddTC_m1.tpl'); -} elseif ($do_display_coverage) { - if($args->item_level == 'reqcoverage') { - // Select coverage - - $requirement_data = $req_mgr->get_by_id($args->object_id, requirement_mgr::LATEST_VERSION); - $requirement_data_name = $requirement_data[0]['req_doc_id'] . ' : ' . $requirement_data[0]['title']; - // get chekbox value : setting_get_parent_child_relation. - if($_SESSION['setting_get_parent_child_relation']){ - // if checkbox is checked. - $requirements_child = $req_spec_mgr->get_requirement_child_by_id($args->object_id, requirement_mgr::LATEST_VERSION); - } else { - $requirements_child = null; - } - } - elseif($args->item_level == 'reqspeccoverage') { - - // Select folder coverage - $getOptions = array('order_by' => " ORDER BY id"); - //$getFilters = array('status' => VALID_REQ); - $requirements = $req_spec_mgr->get_requirements($args->object_id,'all',null,$getOptions); - } - - // This does filter on keywords ALWAYS in OR mode. - // - // CRITIC: - // We have arrived after clicking in a node of Test Spec Tree where we have two classes of filters - // 1. filters on attribute COMMON to all test case versions => TEST CASE attribute like keyword_id - // 2. filters on attribute that can change on each test case version => execution type. - // - // For attributes at Version Level, filter is done ON LAST ACTIVE version, that can be NOT the VERSION - // already linked to test plan. - // This can produce same weird effects like this: - // - // 1. Test Suite A - create TC1 - Version 1 - exec type MANUAL - // 2. Test Suite A - create TC2 - Version 1 - exec type AUTO - // 3. Test Suite A - create TC3 - Version 1 - exec type MANUAL - // 4. Use feature ADD/REMOVE test cases from test plan. - // 5. Add TC1 - Version 1 to test plan - // 6. Apply filter on exec type AUTO - // 7. Tree will display (Folder) Test Suite A with 1 element - // 8. click on folder, then on RIGHT pane: - // TC2 - Version 1 NOT ASSIGNED TO TEST PLAN is displayed - // 9. Use feature edits test cases, to create a new version for TC1 -> Version 2 - exec type AUTO - // 10. Use feature ADD/REMOVE test cases from test plan. - // 11. Apply filter on exec type AUTO - // 12. Tree will display (Folder) Test Suite A with 2 elements - // 13. click on folder, then on RIGHT pane: - // TC2 - Version 1 NOT ASSIGNED TO TEST PLAN is displayed - // TC1 - Version 2 NOT ASSIGNED TO TEST PLAN is displayed ----> THIS IS RIGHT but WRONG - // Only one TC version can be linked to test plan, and TC1 already is LINKED BUT with VERSION 1. - // Version 2 is displayed because it has EXEC TYPE AUTO - // - // How to solve ? - // Filters regarding this kind of attributes WILL BE NOT APPLIEDED to get linked items - // In this way counters on Test Spec Tree and amount of TC displayed on right pane will be coherent. - // - // 20130426 - // Hmm. But if I do as explained in ' How to solve ?' - // I need to apply this filters on a second step or this filters will not work - // Need to check what I've done - // - $tplan_linked_tcversions = getFilteredLinkedVersions($db,$args,$tplan_mgr,$tcase_mgr,null,false); - - // Add Test Cases to Test plan - Right pane does not honor custom field filter - $testCaseSet = $args->control_panel['filter_tc_id']; - if(!is_null($keywordsFilter) ) { - - // With this pieces we implement the AND type of keyword filter. - $keywordsTestCases = - $tproject_mgr->getKeywordsLatestTCV($args->tproject_id, - $keywordsFilter->items,$keywordsFilter->type); - - if (sizeof($keywordsTestCases)) { - $testCaseSet = array_keys($keywordsTestCases); - } - } - - // Choose enable/disable display of custom fields, analysing if this kind of custom fields - // exists on this test project. - $cfields = - (array)$tsuite_mgr->cfield_mgr->get_linked_cfields_at_testplan_design($args->tproject_id,1,'testcase'); - - $opt = array('write_button_only_if_linked' => 0, 'add_custom_fields' => 0); - $opt['add_custom_fields'] = count($cfields) > 0 ? 1 : 0; - - // Add Test Cases to Test plan - Right pane does not honor custom field filter - // filter by test case execution type - $filters = array('keywords' => $args->keyword_id, 'testcases' => null, - 'exec_type' => $args->executionType, 'importance' => $args->importance, - 'cfields' => $args->control_panel['filter_custom_fields'], - 'tcase_name' => $args->control_panel['filter_testcase_name']); - - if($args->item_level == 'reqcoverage') { - $out = array(); - $out = gen_coverage_view($db,'testPlanLinking',$args->tproject_id,$args->object_id,$requirement_data_name, - $tplan_linked_tcversions,null,$filters,$opt); - - // if requirement, has a child requirement. - if(!is_null($requirements_child)){ - - // get parent name. - $parentName = $requirement_data_name; - - foreach($requirements_child as $key => $req){ - $requirement_data_name = $req['req_doc_id'] . ' : ' . $req['name'] . " " . lang_get('req_rel_is_child_of') . " " . $parentName; - $tmp = gen_coverage_view($db,'testPlanLinking',$args->tproject_id,$req['destination_id'],$requirement_data_name, - $tplan_linked_tcversions,null,$filters,$opt); - // update parent name. - $parentName = $req['req_doc_id'] . ' : ' . $req['name']; - // First requirement without test cases - if (empty($tmp['spec_view'])) - continue; - - if(empty($out)) - { - $out = $tmp; - } - else - { - $tmp['spec_view'][1]["testsuite"] = $tmp['spec_view'][0]['testsuite']; - array_push($out['spec_view'], $tmp['spec_view'][1]); - } - } - } - } - elseif($args->item_level == 'reqspeccoverage') - { - - $out = array(); - foreach($requirements as $key => $req) - { - if(empty($req['req_doc_id'])){ - $coverage_name = $req['doc_id'] . " : " . $req['title']; - } else { - $coverage_name = $req['req_doc_id'] . " : " . $req['title']; - } - $tmp = gen_coverage_view($db,'testPlanLinking',$args->tproject_id,$req['id'], $coverage_name, - $tplan_linked_tcversions,null,$filters,$opt); - - // First requirement without test cases - if (empty($tmp['spec_view'])) - continue; - - if(empty($out)) - { - $out = $tmp; - } - else - { - $tmp['spec_view'][1]["testsuite"] = $tmp['spec_view'][0]['testsuite']; - array_push($out['spec_view'], $tmp['spec_view'][1]); - } - - } - - } - - // count nb testcases selected in view. - $nbTestCaseSelected = 0; - foreach($out['spec_view'][1]['testcases'] as $key => $value) - { - if($value['linked_version_id'] != 0){ - $nbTestCaseSelected++; - } - } - - $out['spec_view'][1]['linked_testcase_qty'] = $nbTestCaseSelected; - $gui->has_tc = ($out['num_tc'] > 0 ? 1 : 0); - $gui->items = $out['spec_view']; - $gui->has_linked_items = $out['has_linked_items']; - $gui->add_custom_fields = $opt['add_custom_fields']; - $gui->drawSavePlatformsButton = false; - $gui->drawSaveCFieldsButton = false; - - if( !is_null($gui->items) ) - { - initDrawSaveButtons($gui); - } - - // This has to be done ONLY AFTER has all data needed => after gen_spec_view() call - setAdditionalGuiData($gui); - - // refresh tree only when action is done - switch ($args->doAction) - { - case 'doReorder': - case 'doSavePlatforms': - case 'doSaveCustomFields': - case 'doAddRemove': - $gui->refreshTree = $args->refreshTree; - break; - - default: - $gui->refreshTree = false; - break; - } - - $smarty->assign('gui', $gui); - $smarty->display($templateCfg->template_dir . 'planAddTC_m1.tpl'); -} - - - - - -/* - function: init_args - creates a sort of namespace - - args: - - returns: object with some REQUEST and SESSION values as members - -*/ -function init_args(&$tproject_mgr) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - - $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : 0; - $args->userID = intval($args->user->dbID); - - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : intval($_SESSION['testplanID']); - $args->tproject_id = intval($_SESSION['testprojectID']); - $args->tproject_name = $_SESSION['testprojectName']; - - $args->object_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - $args->item_level = isset($_REQUEST['edit']) ? trim($_REQUEST['edit']) : null; - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : "default"; - $args->testcases2add = isset($_REQUEST['achecked_tc']) ? $_REQUEST['achecked_tc'] : null; - $args->tcversion_for_tcid = isset($_REQUEST['tcversion_for_tcid']) ? $_REQUEST['tcversion_for_tcid'] : null; - $args->testcases2remove = isset($_REQUEST['remove_checked_tc']) ? $_REQUEST['remove_checked_tc'] : null; - - $args->testcases2order = isset($_REQUEST['exec_order']) ? $_REQUEST['exec_order'] : null; - $args->linkedOrder = isset($_REQUEST['linked_exec_order']) ? $_REQUEST['linked_exec_order'] : null; - $args->linkedVersion = isset($_REQUEST['linked_version']) ? $_REQUEST['linked_version'] : null; - $args->linkedWithCF = isset($_REQUEST['linked_with_cf']) ? $_REQUEST['linked_with_cf'] : null; - - $args->feature2fix = isset($_REQUEST['feature2fix']) ? $_REQUEST['feature2fix'] : null; - $args->testerID = isset($_REQUEST['testerID']) ? intval($_REQUEST['testerID']) : 0; - $args->send_mail = isset($_REQUEST['send_mail']) ? $_REQUEST['send_mail'] : false; - - // For more information about the data accessed in session here, see the comment - // in the file header of lib/functions/tlTestCaseFilterControl.class.php. - $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $mode = 'plan_add_mode'; - $pageCache = isset($_SESSION[$mode]) - && isset($_SESSION[$mode][$args->treeFormToken]) ? - $_SESSION[$mode][$args->treeFormToken] : null; - - // need to comunicate with left frame, will do via $_SESSION and form_token - if( $args->treeFormToken > 0 && ($args->item_level == 'testsuite' || $args->item_level == 'testcase')) { - // do not understand why this do not works OK - $_SESSION['loadRightPaneAddTC'][$args->treeFormToken] = false; - } - - - // to be able to pass filters to functions present on specview.php - $args->control_panel = $pageCache; - $getFromSession = !is_null($pageCache); - - $booleankeys = array('refreshTree' => 'setting_refresh_tree_on_action', - 'importance' => 'filter_importance', - 'executionType' => 'filter_execution_type'); - - foreach($booleankeys as $key => $value) { - $args->$key = ($getFromSession && isset($pageCache[$value])) ? $pageCache[$value] : 0; - } - $args->importance = ($args->importance > 0) ? $args->importance : null; - - - // Filter Top level testsuite is implemented in an strange way: - // contains WHAT TO REMOVE - $args->topLevelTestSuite = 0; - if( $getFromSession && isset($pageCache['filter_toplevel_testsuite']) - && count($pageCache['filter_toplevel_testsuite']) > 0) - { - // get all - $first_level_suites = $tproject_mgr->get_first_level_test_suites($args->tproject_id,'simple',array('accessKey' => 'id')); - - - // remove unneeded - $hit = array_diff_key($first_level_suites, $pageCache['filter_toplevel_testsuite']); - $args->topLevelTestSuite = intval(key($hit)); - } - - // This has effect when 'show full (on right pane)' button is used - if($args->tproject_id == $args->object_id && $args->topLevelTestSuite > 0) { - $args->object_id = $args->topLevelTestSuite; - } - - - - $args->keyword_id = 0; - $ak = 'filter_keywords'; - if (isset($pageCache[$ak])) { - $args->keyword_id = $pageCache[$ak]; - if (is_array($args->keyword_id) && count($args->keyword_id) == 1) { - $args->keyword_id = $args->keyword_id[0]; - } - } - - $args->keywordsFilterType = null; - $ak = 'filter_keywords_filter_type'; - if (isset($pageCache[$ak])) { - $args->keywordsFilterType = $pageCache[$ak]; - } - - $args->platform_id = 0; - $ak = 'filter_platforms'; - if (isset($pageCache[$ak])) { - $args->platform_id = $pageCache[$ak]; - } - - $args->keywordsFilterType = null; - $ak = 'filter_keywords_filter_type'; - if (isset($pageCache[$ak])) { - $args->keywordsFilterType = $pageCache[$ak]; - } - - - $ak = 'filter_workflow_status'; - $args->workflow_status = isset($pageCache[$ak]) ? $pageCache[$ak] : null; - - $args->build_id = isset($_REQUEST['build_id']) ? intval($_REQUEST['build_id']) : 0; - $args->activity = isset($_REQUEST['activity']) ? $_REQUEST['activity'] : ''; - - return $args; -} - -/* - function: doReorder - writes to DB execution order of test case versions - linked to testplan. - - args: argsObj: user input data collected via HTML inputs - tplanMgr: testplan manager object - - returns: - - -*/ -function doReorder(&$argsObj,&$tplanMgr) -{ - $mapo = null; - - // Do this to avoid update if order has not been changed on already linked items - if(!is_null($argsObj->linkedVersion)) - { - // Using memory of linked test case, try to get order - foreach($argsObj->linkedVersion as $tcid => $tcversion_id) - { - if($argsObj->linkedOrder[$tcid] != $argsObj->testcases2order[$tcid] ) - { - $mapo[$tcversion_id] = $argsObj->testcases2order[$tcid]; - } - } - } - - // Now add info for new liked test cases if any - if(!is_null($argsObj->testcases2add)) - { - $tcaseSet = array_keys($argsObj->testcases2add); - foreach($tcaseSet as $tcid) - { - // This check is needed because, after we have added test case - // for a platform, this will not be present anymore - // in tcversion_for_tcid, but it's present in linkedVersion. - // IMPORTANT: - // We do not allow link of different test case version on a - // testplan no matter we are using or not platform feature. - // - $tcversion_id=null; - if( isset($argsObj->tcversion_for_tcid[$tcid]) ) - { - $tcversion_id = $argsObj->tcversion_for_tcid[$tcid]; - //$mapo[$tcversion_id] = $argsObj->testcases2order[$tcid]; - } - else if( isset($argsObj->linkedVersion[$tcid]) && - !isset($mapo[$argsObj->linkedVersion[$tcid]])) - { - $tcversion_id = $argsObj->linkedVersion[$tcid]; - } - if( !is_null($tcversion_id)) - { - $mapo[$tcversion_id] = $argsObj->testcases2order[$tcid]; - } - } - } - - if(!is_null($mapo)) - { - $tplanMgr->setExecutionOrder($argsObj->tplan_id,$mapo); - } - -} - - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr,&$tcaseMgr) -{ - - $tcase_cfg = config_get('testcase_cfg'); - $title_separator = config_get('gui_title_separator_1'); - - $gui = new stdClass(); - $gui->status_feedback = buildStatusFeedbackMsg(); - - $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->testCasePrefix .= $tcase_cfg->glue_character; - - $gui->can_remove_executed_testcases = $argsObj->user->hasRight($dbHandler, - "testplan_unlink_executed_testcases", - $argsObj->tproject_id,$argsObj->tplan_id); - - $tprojectInfo = $tcaseMgr->tproject_mgr->get_by_id($argsObj->tproject_id); - $gui->priorityEnabled = $tprojectInfo['opt']->testPriorityEnabled; - - // $gui->keywordsFilterType = $argsObj->keywordsFilterType; - // $gui->keywords_filter = ''; - $gui->has_tc = 0; - $gui->items = null; - $gui->has_linked_items = false; - - $gui->keywordsFilterType = new stdClass(); - $gui->keywordsFilterType->options = array('OR' => 'Or' , 'AND' =>'And'); - $gui->keywordsFilterType->selected=$argsObj->keywordsFilterType; - - $gui->keyword_id = $argsObj->keyword_id; - $gui->keywords_filter_feedback = ''; - if( !is_null($gui->keyword_id) && $gui->keyword_id != 0 ) { - $gui->keywords_filter_feedback = - buildKeywordsFeedbackMsg($dbHandler,$argsObj,$gui); - } - - $gui->platform_id = $argsObj->platform_id; - $gui->platforms_filter_feedback = ''; - if( !is_null($gui->platform_id) && $gui->platform_id != 0 ) { - $gui->platforms_filter_feedback = - buildPlatformsFeedbackMsg($dbHandler,$argsObj,$gui); - } - - - // full_control, controls the operations planAddTC_m1.tpl will allow - // 1 => add/remove - // 0 => just remove - $gui->full_control = 1; - - $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->testPlanName = $tplan_info['name']; - $gui->pageTitle = lang_get('test_plan') . $title_separator . $gui->testPlanName; - $gui->refreshTree = $argsObj->refreshTree; - $gui->canAssignExecTask = $argsObj->user->hasRight($dbHandler,"exec_assign_testcases",$argsObj->tproject_id,$argsObj->tplan_id); - - $tproject_mgr = new testproject($dbHandler); - $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); - - $gui->testers = getTestersForHtmlOptions($dbHandler,$argsObj->tplan_id, $tproject_info); - $gui->testerID = $argsObj->testerID; - $gui->send_mail = $argsObj->send_mail; - $gui->send_mail_checked = ''; - if($gui->send_mail) { - $gui->send_mail_checked = ' checked="checked" '; - } - - $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id); - $gui->platforms = $platform_mgr->getLinkedToTestplan($argsObj->tplan_id); - $gui->platformsForHtmlOptions = null; - $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan($argsObj->tplan_id); - if($gui->usePlatforms) { - // Create options for two different select boxes. $bulk_platforms - // has "All platforms" on top and "$platformsForHtmlOptions" has an - // empty item - $gui->platformsForHtmlOptions[0]=''; - foreach($gui->platforms as $elem) - { - $gui->platformsForHtmlOptions[$elem['id']] =$elem['name']; - } - - $optLTT = null; - $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id,$optLTT); - $gui->bulk_platforms[0] = lang_get("all_platforms"); - ksort($gui->bulk_platforms); - } - - // - $gui->warning_msg = new stdClass(); - $gui->warning_msg->executed = lang_get('executed_can_not_be_removed'); - if( $gui->can_remove_executed_testcases ) - { - $gui->warning_msg->executed = lang_get('has_been_executed'); - } - - $gui->build = init_build_selector($tplanMgr, $argsObj); - - return $gui; -} - - -/* - function: doSaveCustomFields - writes to DB value of custom fields displayed - for test case versions linked to testplan. - - args: argsObj: user input data collected via HTML inputs - tplanMgr: testplan manager object - - returns: - - -*/ -function doSaveCustomFields(&$argsObj,&$userInput,&$tplanMgr,&$tcaseMgr) -{ - // N.B.: I've use this piece of code also on write_execution(), think is time to create - // a method on cfield_mgr class. - // One issue: find a good method name - $cf_prefix = $tcaseMgr->cfield_mgr->get_name_prefix(); - $len_cfp = tlStringLen($cf_prefix); - $cf_nodeid_pos=4; - - $nodeid_array_cfnames=null; - - // Example: two test cases (21 and 19 are testplan_tcversions.id => FEATURE_ID) - // with 3 custom fields - // - // custom_field_[TYPE]_[CFIELD_ID]_[FEATURE_ID] - // - // ( - // [21] => Array - // ( - // [0] => custom_field_0_3_21 - // [1] => custom_field_0_7_21 - // [5] => custom_field_6_9_21 - // ) - // - // [19] => Array - // ( - // [0] => custom_field_0_3_19 - // [1] => custom_field_0_7_19 - // [5] => custom_field_6_9_19 - // ) - // ) - // - foreach($userInput as $input_name => $value) - { - if( strncmp($input_name,$cf_prefix,$len_cfp) == 0 ) - { - $dummy=explode('_',$input_name); - $nodeid_array_cfnames[$dummy[$cf_nodeid_pos]][]=$input_name; - } - } - - // foreach($argsObj->linkedWithCF as $key => $link_id) - foreach( $nodeid_array_cfnames as $link_id => $customFieldsNames) - { - - - // Create a SubSet of userInput just with inputs regarding CF for a link_id - // Example for link_id=21: - // - // $cfvalues=( 'custom_field_0_3_21' => A - // 'custom_field_0_7_21' => - // 'custom_field_8_8_21_day' => 0 - // 'custom_field_8_8_21_month' => 0 - // 'custom_field_8_8_21_year' => 0 - // 'custom_field_6_9_21_' => Every day) - // - $cfvalues=null; - foreach($customFieldsNames as $cf) - { - $cfvalues[$cf]=$userInput[$cf]; - } - $tcaseMgr->cfield_mgr->testplan_design_values_to_db($cfvalues,null,$link_id); - } -} - - -/* - function: doSavePlatforms - writes to DB execution ... of test case versions linked to testplan. - - args: argsObj: user input data collected via HTML inputs - tplanMgr: testplan manager object - - returns: - - -*/ -function doSavePlatforms(&$argsObj,&$tplanMgr) -{ - foreach($argsObj->feature2fix as $feature_id => $tcversion_platform) { - $tcversion_id = key($tcversion_platform); - $platform_id = current($tcversion_platform); - if( $platform_id != 0 ) { - $tplanMgr->changeLinkedTCVersionsPlatform($argsObj->tplan_id,0,$platform_id,$tcversion_id); - } - } -} - - -/** - * send_mail_to_testers - * - * - * @return void - */ -function send_mail_to_testers(&$dbHandler,&$tcaseMgr,&$guiObj,&$argsObj,$features,$operation) -{ - $testers['new']=null; - $mail_details['new']=lang_get('mail_testcase_assigned') . "

    "; - $mail_subject['new']=lang_get('mail_subject_testcase_assigned'); - $use_testers['new']= true ; - - $tcaseSet=null; - $tcnames=null; - $email=array(); - - $userSet[]=$argsObj->userID; - $userSet[]=$argsObj->testerID; - - $userData=tlUser::getByIDs($dbHandler,$userSet); - $assigner=$userData[$argsObj->userID]->firstName . ' ' . $userData[$argsObj->userID]->lastName ; - - $email['from_address']=config_get('from_email'); - $body_first_lines = lang_get('testproject') . ': ' . $argsObj->tproject_name . '
    ' . - lang_get('testplan') . ': ' . $guiObj->testPlanName .'

    '; - - // Get testers id - foreach($features as $feature_id => $value) - { - if($use_testers['new']) - { - $testers['new'][$value['user_id']][$value['tcase_id']]=$value['tcase_id']; - } - $tcaseSet[$value['tcase_id']]=$value['tcase_id']; - $tcversionSet[$value['tcversion_id']]=$value['tcversion_id']; - } - - $infoSet=$tcaseMgr->get_by_id_bulk($tcaseSet,$tcversionSet); - foreach($infoSet as $value) - { - $tcnames[$value['testcase_id']] = $guiObj->testCasePrefix . $value['tc_external_id'] . ' ' . $value['name']; - } - - $path_info = $tcaseMgr->tree_manager->get_full_path_verbose($tcaseSet,array('output_format' => 'simple')); - $flat_path=null; - foreach($path_info as $tcase_id => $pieces) - { - $flat_path[$tcase_id]=implode('/',$pieces) . '/' . $tcnames[$tcase_id]; - } - - $validator = new Zend_Validate_EmailAddress(); - foreach($testers as $tester_type => $tester_set) - { - if( !is_null($tester_set) ) - { - $email['subject'] = $mail_subject[$tester_type] . ' ' . $guiObj->testPlanName; - foreach($tester_set as $user_id => $value) - { - $userObj=$userData[$user_id]; - $email['to_address'] = trim($userObj->emailAddress); - if($email['to_address'] == '' || !$validator->isValid($email['to_address'])) - { - continue; - } - - $email['body'] = $body_first_lines; - $email['body'] .= sprintf($mail_details[$tester_type], - $userObj->firstName . ' ' .$userObj->lastName,$assigner); - - foreach($value as $tcase_id) - { - $email['body'] .= $flat_path[$tcase_id] . '
    '; - } - $email['body'] .= '
    ' . date(DATE_RFC1123); - - $email['cc'] = ''; - $email['attachment'] = null; - $email['exit_on_error'] = true; - $email['htmlFormat'] = true; - - $email_op = email_send($email['from_address'], $email['to_address'], - $email['subject'], $email['body'], - $email['cc'],$email['attachment'], - $email['exit_on_error'],$email['htmlFormat']); - } - } - } -} - - -/** - * initDrawSaveButtons - * - */ -function initDrawSaveButtons(&$guiObj) -{ - $keySet = array_keys($guiObj->items); - - // 20100225 - eloff - BUGID 3205 - check only when platforms are active - // Logic to initialize drawSavePlatformsButton. - if ($guiObj->usePlatforms) - { - // Looks for a platform with id = 0 - foreach($keySet as $key) - { - $breakLoop = false; - $testSuite = &$guiObj->items[$key]; - if($testSuite['linked_testcase_qty'] > 0) - { - $tcaseSet = array_keys($testSuite['testcases']); - foreach($tcaseSet as $tcaseKey) - { - if( isset($testSuite['testcases'][$tcaseKey]['feature_id'][0]) ) - { - $breakLoop = true; - $guiObj->drawSavePlatformsButton = true; - break; - } - } - } - if( $breakLoop ) - { - break; - } - } - } - - // Logic to initialize drawSaveCFieldsButton - reset($keySet); - foreach($keySet as $key) - { - $breakLoop = false; - $tcaseSet = &$guiObj->items[$key]['testcases']; - if( !is_null($tcaseSet) ) - { - $tcversionSet = array_keys($tcaseSet); - foreach($tcversionSet as $tcversionID) - { - if( isset($tcaseSet[$tcversionID]['custom_fields']) && - !is_null($tcaseSet[$tcversionID]['custom_fields'])) - { - $breakLoop = true; - $guiObj->drawSaveCFieldsButton = true; - break; - } - } - } - if( $breakLoop ) - { - break; - } - } -} - - -/** - * - * - */ -function setAdditionalGuiData($guiObj) -{ - $actionTitle = 'title_remove_test_from_plan'; - $buttonValue = 'btn_remove_selected_tc'; - $guiObj->exec_order_input_disabled = 'disabled="disabled"'; - - if( $guiObj->full_control ) - { - $actionTitle = 'title_add_test_to_plan'; - $buttonValue = 'btn_add_selected_tc'; - if( $guiObj->has_linked_items ) - { - $actionTitle = 'title_add_remove_test_to_plan'; - $buttonValue = 'btn_add_remove_selected_tc'; - } - $guiObj->exec_order_input_disabled = ' '; - } - $guiObj->actionTitle = lang_get($actionTitle); - $guiObj->buttonValue = lang_get($buttonValue); -} - -/** - * Initialize the HTML select box for selection of a build to which - * user wants to assign testers which are added to testplan. - * - * @author Andreas Simon - * @param testplan $testplan_mgr reference to testplan manager object - * @param object $argsObj reference to user input object - * @return array $html_menu array structure with all information needed for the menu - */ -function init_build_selector(&$testplan_mgr, &$argsObj) { - - // init array - $menu = array('items' => null, 'selected' => null, 'count' => 0); - - $menu['items'] = - (array)$testplan_mgr->get_builds_for_html_options($argsObj->tplan_id, - testplan::GET_ACTIVE_BUILD, - testplan::GET_OPEN_BUILD); - $menu['count'] = count($menu['items']); - - // if no build has been chosen yet, select the newest build by default - $build_id = $argsObj->build_id; - if (!$build_id && $menu['count']) { - $keys = array_keys($menu['items']); - $build_id = end($keys); - } - $menu['selected'] = $build_id; - - return $menu; -} // end of method - -/** - * - */ -function addToTestPlan(&$dbHandler,&$argsObj,&$guiObj,&$tplanMgr,&$tcaseMgr) { - // items_to_link structure: - // key: test case id , value: map - // key: platform_id value: test case VERSION ID - $items_to_link = null; - foreach ($argsObj->testcases2add as $tcase_id => $info) { - foreach ($info as $platform_id => $tcase_id) { - if( isset($argsObj->tcversion_for_tcid[$tcase_id]) ){ - $tcversion_id = $argsObj->tcversion_for_tcid[$tcase_id]; - } else { - $tcversion_id = $argsObj->linkedVersion[$tcase_id]; - } - $items_to_link['tcversion'][$tcase_id] = $tcversion_id; - $items_to_link['platform'][$platform_id] = $platform_id; - $items_to_link['items'][$tcase_id][$platform_id] = $tcversion_id; - } - } - - $linked_features=$tplanMgr->link_tcversions($argsObj->tplan_id,$items_to_link,$argsObj->userID); - - if( $argsObj->testerID > 0 ) { - $features2add = null; - $status_map = $tplanMgr->assignment_mgr->get_available_status(); - $types_map = $tplanMgr->assignment_mgr->get_available_types(); - $db_now = $dbHandler->db_now(); - $tcversion_tcase = array_flip($items_to_link['tcversion']); - - $getOpt = array('outputFormat' => 'map', 'addIfNull' => true); - $platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,$getOpt); - - foreach($linked_features as $platform_id => $tcversion_info) - { - foreach($tcversion_info as $tcversion_id => $feature_id) - { - $features2['add'][$feature_id]['user_id'] = $argsObj->testerID; - $features2['add'][$feature_id]['type'] = $types_map['testcase_execution']['id']; - $features2['add'][$feature_id]['status'] = $status_map['open']['id']; - $features2['add'][$feature_id]['assigner_id'] = $argsObj->userID; - $features2['add'][$feature_id]['tcase_id'] = $tcversion_tcase[$tcversion_id]; - $features2['add'][$feature_id]['tcversion_id'] = $tcversion_id; - $features2['add'][$feature_id]['creation_ts'] = $db_now; - $features2['add'][$feature_id]['platform_name'] = $platformSet[$platform_id]; - $features2['add'][$feature_id]['build_id'] = $argsObj->build_id; - } - } - - foreach($features2 as $key => $values) - { - $tplanMgr->assignment_mgr->assign($values); - $called[$key]=true; - } - - if($argsObj->send_mail) - { - foreach($called as $ope => $ope_status) - { - if($ope_status) - { - send_mail_to_testers($dbHandler,$tcaseMgr,$guiObj,$argsObj,$features2['add'],$ope); - } - } - } - } -} - -/** - * - * - */ -function buildStatusFeedbackMsg() -{ - $ret = ''; - $hideStatusSet = config_get('tplanDesign')->hideTestCaseWithStatusIn; - if( !is_null($hideStatusSet) ) - { - $cfx = getConfigAndLabels('testCaseStatus'); - $sc = array_flip($cfx['cfg']); - $msg = array(); - foreach( $hideStatusSet as $code => $verbose) - { - $msg[] = $cfx['lbl'][$sc[$code]]; - } - $ret = - sprintf(lang_get('hint_add_testcases_to_testplan_status'),implode(',',$msg)); - } - - return $ret; -} - -/** - * - */ -function buildKeywordsFeedbackMsg(&$dbHandler,&$argsObj,&$gui) -{ - $opx = array('tproject_id' => $argsObj->tproject_id, - 'cols' => 'id,keyword', 'accessKey' => 'id'); - - $kwSet = tlKeyword::getSimpleSet($dbHandler, $opx); - $msg = array(); - $k2s = (array)$gui->keyword_id; - foreach( $k2s as $idt ) { - $msg[] = $kwSet[$idt]['keyword']; - } - return implode(',',$msg); -} - -/** - * - */ -function buildPlatformsFeedbackMsg(&$dbHandler,&$argsObj,&$gui) -{ - $opx = array('fields' => 'id,name', 'accessKey' => 'id'); - - $platMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); - $k2s = (array)$gui->platform_id; - $ixSet = $platMgr->getByID($k2s, $opx); - $msg = array(); - foreach( $k2s as $idt ) { - $msg[] = $ixSet[$idt]['name']; - } - return implode(',',$msg); +keyword_id)) { + $keywordsFilter = new stdClass(); + $keywordsFilter->items = $args->keyword_id; + $keywordsFilter->type = $gui->keywordsFilterType->selected; +} + +$do_display = 0; +$do_display_coverage = 0; + +switch ($args->item_level) { + case 'testsuite': + case 'req': + case 'req_spec': + case 'testproject': + $do_display = 1; + break; + + case 'reqcoverage': + case 'reqspeccoverage': + $do_display_coverage = 1; + break; + + default: + break; +} + +switch ($args->doAction) { + case 'doAddRemove': + // Remember: checkboxes exist only if are checked + $gui->itemQty = count((array) $args->testcases2add); + + if (! is_null($args->testcases2add)) { + addToTestPlan($db, $args, $gui, $tplan_mgr, $tcaseMgr); + } + + if (! is_null($args->testcases2remove)) { + // remove without warning + $items_to_unlink = null; + foreach ($args->testcases2remove as $tcase_id => $info) { + foreach ($info as $platform_id => $tcversion_id) { + $items_to_unlink['tcversion'][$tcase_id] = $tcversion_id; + $items_to_unlink['platform'][$platform_id] = $platform_id; + $items_to_unlink['items'][$tcase_id][$platform_id] = $tcversion_id; + } + } + $tplan_mgr->unlink_tcversions($args->tplan_id, $items_to_unlink); + } + + doReorder($args, $tplan_mgr); + break; + + case 'doReorder': + doReorder($args, $tplan_mgr); + break; + + case 'doSavePlatforms': + doSavePlatforms($args, $tplan_mgr); + break; + + case 'doSaveCustomFields': + doSaveCustomFields($args, $_REQUEST, $tplan_mgr, $tcaseMgr); + break; + + default: + break; +} + +$smarty = new TLSmarty(); + +if ($do_display) { + $tsuite_data = $tsuite_mgr->get_by_id($args->object_id); + // see development documentation on [INSTALL DIR]/docs/development/planAddTC.php.txt + $tplan_linked_tcversions = getFilteredLinkedVersions($db, $args, $tplan_mgr, + $tcaseMgr, array( + 'addImportance' => true + )); + + // Add Test Cases to Test plan - Right pane does not honor custom field filter + $testCaseSet = $args->control_panel['filter_tc_id']; + if (! is_null($keywordsFilter)) { + + // With this pieces we implement the AND type of keyword filter. + $keywordsTestCases = $tproject_mgr->getKeywordsLatestTCV( + $args->tproject_id, $keywordsFilter->items, $keywordsFilter->type); + + if (count($keywordsTestCases)) { + $testCaseSet = array_keys($keywordsTestCases); + } + } + + // Choose enable/disable display of custom fields, analysing if this kind of custom fields + // exists on this test project. + $cfields = (array) $tsuite_mgr->cfield_mgr->get_linked_cfields_at_testplan_design( + $args->tproject_id, 1, 'testcase'); + $opt = array( + 'write_button_only_if_linked' => 0, + 'add_custom_fields' => 0 + ); + $opt['add_custom_fields'] = count($cfields) > 0 ? 1 : 0; + + // Add Test Cases to Test plan - Right pane does not honor custom field filter + // filter by test case execution type + $filters = array( + 'keywords' => $args->keyword_id, + 'testcases' => $testCaseSet, + 'exec_type' => $args->executionType, + 'importance' => $args->importance, + 'workflow_status' => $args->workflow_status, + 'cfields' => null, + 'tcase_name' => null, + 'platforms' => null + ); + + if (isset($args->control_panel['filter_custom_fields'])) { + $filters['cfields'] = $args->control_panel['filter_custom_fields']; + } + + if (isset($args->control_panel['filter_testcase_name'])) { + $filters['tcase_name'] = $args->control_panel['filter_testcase_name']; + } + + if (isset($args->control_panel['filter_platforms'])) { + $filters['platforms'] = $args->control_panel['filter_platforms']; + } + + $out = gen_spec_view($db, 'testPlanLinking', $args->tproject_id, + $args->object_id, $tsuite_data['name'], $tplan_linked_tcversions, null, + $filters, $opt); + + $gui->has_tc = ($out['num_tc'] > 0 ? 1 : 0); + $gui->items = $out['spec_view']; + $gui->has_linked_items = $out['has_linked_items']; + $gui->add_custom_fields = $opt['add_custom_fields']; + $gui->drawSavePlatformsButton = false; + $gui->drawSaveCFieldsButton = false; + + if (! is_null($gui->items)) { + initDrawSaveButtons($gui); + } + + // This has to be done ONLY AFTER has all data needed => after gen_spec_view() call + setAdditionalGuiData($gui); + + // refresh tree only when action is done + switch ($args->doAction) { + case 'doReorder': + case 'doSavePlatforms': + case 'doSaveCustomFields': + case 'doAddRemove': + $gui->refreshTree = $args->refreshTree; + break; + + default: + $gui->refreshTree = false; + break; + } + + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . 'planAddTC_m1.tpl'); +} elseif ($do_display_coverage) { + if ($args->item_level == 'reqcoverage') { + // Select coverage + + $requirement_data = $req_mgr->get_by_id($args->object_id, + requirement_mgr::LATEST_VERSION); + $requirement_data_name = $requirement_data[0]['req_doc_id'] . ' : ' . + $requirement_data[0]['title']; + // get chekbox value : setting_get_parent_child_relation. + if ($_SESSION['setting_get_parent_child_relation']) { + // if checkbox is checked. + $requirements_child = $req_spec_mgr->get_requirement_child_by_id( + $args->object_id, requirement_mgr::LATEST_VERSION); + } else { + $requirements_child = null; + } + } elseif ($args->item_level == 'reqspeccoverage') { + + // Select folder coverage + $getOptions = array( + 'order_by' => " ORDER BY id" + ); + $requirements = $req_spec_mgr->get_requirements($args->object_id, 'all', + null, $getOptions); + } + + // This does filter on keywords ALWAYS in OR mode. + // + // CRITIC: + // We have arrived after clicking in a node of Test Spec Tree where we have two classes of filters + // 1. filters on attribute COMMON to all test case versions => TEST CASE attribute like keyword_id + // 2. filters on attribute that can change on each test case version => execution type. + // + // For attributes at Version Level, filter is done ON LAST ACTIVE version, that can be NOT the VERSION + // already linked to test plan. + // This can produce same weird effects like this: + // + // 1. Test Suite A - create TC1 - Version 1 - exec type MANUAL + // 2. Test Suite A - create TC2 - Version 1 - exec type AUTO + // 3. Test Suite A - create TC3 - Version 1 - exec type MANUAL + // 4. Use feature ADD/REMOVE test cases from test plan. + // 5. Add TC1 - Version 1 to test plan + // 6. Apply filter on exec type AUTO + // 7. Tree will display (Folder) Test Suite A with 1 element + // 8. click on folder, then on RIGHT pane: + // TC2 - Version 1 NOT ASSIGNED TO TEST PLAN is displayed + // 9. Use feature edits test cases, to create a new version for TC1 -> Version 2 - exec type AUTO + // 10. Use feature ADD/REMOVE test cases from test plan. + // 11. Apply filter on exec type AUTO + // 12. Tree will display (Folder) Test Suite A with 2 elements + // 13. click on folder, then on RIGHT pane: + // TC2 - Version 1 NOT ASSIGNED TO TEST PLAN is displayed + // TC1 - Version 2 NOT ASSIGNED TO TEST PLAN is displayed ----> THIS IS RIGHT but WRONG + // Only one TC version can be linked to test plan, and TC1 already is LINKED BUT with VERSION 1. + // Version 2 is displayed because it has EXEC TYPE AUTO + // + // How to solve ? + // Filters regarding this kind of attributes WILL BE NOT APPLIEDED to get linked items + // In this way counters on Test Spec Tree and amount of TC displayed on right pane will be coherent. + // + // 20130426 + // Hmm. But if I do as explained in ' How to solve ?' + // I need to apply this filters on a second step or this filters will not work + // Need to check what I've done + // + $tplan_linked_tcversions = getFilteredLinkedVersions($db, $args, $tplan_mgr, + $tcaseMgr, null, false); + + // Add Test Cases to Test plan - Right pane does not honor custom field filter + $testCaseSet = $args->control_panel['filter_tc_id']; + if (! is_null($keywordsFilter)) { + + // With this pieces we implement the AND type of keyword filter. + $keywordsTestCases = $tproject_mgr->getKeywordsLatestTCV( + $args->tproject_id, $keywordsFilter->items, $keywordsFilter->type); + + if (count($keywordsTestCases)) { + $testCaseSet = array_keys($keywordsTestCases); + } + } + + // Choose enable/disable display of custom fields, analysing if this kind of custom fields + // exists on this test project. + $cfields = (array) $tsuite_mgr->cfield_mgr->get_linked_cfields_at_testplan_design( + $args->tproject_id, 1, 'testcase'); + + $opt = array( + 'write_button_only_if_linked' => 0, + 'add_custom_fields' => 0 + ); + $opt['add_custom_fields'] = count($cfields) > 0 ? 1 : 0; + + // Add Test Cases to Test plan - Right pane does not honor custom field filter + // filter by test case execution type + $filters = array( + 'keywords' => $args->keyword_id, + 'testcases' => null, + 'exec_type' => $args->executionType, + 'importance' => $args->importance, + 'cfields' => $args->control_panel['filter_custom_fields'], + 'tcase_name' => $args->control_panel['filter_testcase_name'] + ); + + if ($args->item_level == 'reqcoverage') { + $out = array(); + $out = gen_coverage_view($db, 'testPlanLinking', $args->tproject_id, + $args->object_id, $requirement_data_name, $tplan_linked_tcversions, + null, $filters, $opt); + + // if requirement, has a child requirement. + if (! is_null($requirements_child)) { + + // get parent name. + $parentName = $requirement_data_name; + + foreach ($requirements_child as $req) { + $requirement_data_name = $req['req_doc_id'] . ' : ' . + $req['name'] . " " . lang_get('req_rel_is_child_of') . " " . + $parentName; + $tmp = gen_coverage_view($db, 'testPlanLinking', + $args->tproject_id, $req['destination_id'], + $requirement_data_name, $tplan_linked_tcversions, null, + $filters, $opt); + // update parent name. + $parentName = $req['req_doc_id'] . ' : ' . $req['name']; + // First requirement without test cases + if (empty($tmp['spec_view'])) { + continue; + } + if (empty($out)) { + $out = $tmp; + } else { + $tmp['spec_view'][1]["testsuite"] = $tmp['spec_view'][0]['testsuite']; + array_push($out['spec_view'], $tmp['spec_view'][1]); + } + } + } + } elseif ($args->item_level == 'reqspeccoverage') { + + $out = array(); + foreach ($requirements as $req) { + if (empty($req['req_doc_id'])) { + $coverage_name = $req['doc_id'] . " : " . $req['title']; + } else { + $coverage_name = $req['req_doc_id'] . " : " . $req['title']; + } + $tmp = gen_coverage_view($db, 'testPlanLinking', $args->tproject_id, + $req['id'], $coverage_name, $tplan_linked_tcversions, null, + $filters, $opt); + + // First requirement without test cases + if (empty($tmp['spec_view'])) { + continue; + } + + if (empty($out)) { + $out = $tmp; + } else { + $tmp['spec_view'][1]["testsuite"] = $tmp['spec_view'][0]['testsuite']; + array_push($out['spec_view'], $tmp['spec_view'][1]); + } + } + } + + // count nb testcases selected in view. + $nbTestCaseSelected = 0; + foreach ($out['spec_view'][1]['testcases'] as $value) { + if ($value['linked_version_id'] != 0) { + $nbTestCaseSelected ++; + } + } + + $out['spec_view'][1]['linked_testcase_qty'] = $nbTestCaseSelected; + $gui->has_tc = ($out['num_tc'] > 0 ? 1 : 0); + $gui->items = $out['spec_view']; + $gui->has_linked_items = $out['has_linked_items']; + $gui->add_custom_fields = $opt['add_custom_fields']; + $gui->drawSavePlatformsButton = false; + $gui->drawSaveCFieldsButton = false; + + if (! is_null($gui->items)) { + initDrawSaveButtons($gui); + } + + // This has to be done ONLY AFTER has all data needed => after gen_spec_view() call + setAdditionalGuiData($gui); + + // refresh tree only when action is done + switch ($args->doAction) { + case 'doReorder': + case 'doSavePlatforms': + case 'doSaveCustomFields': + case 'doAddRemove': + $gui->refreshTree = $args->refreshTree; + break; + + default: + $gui->refreshTree = false; + break; + } + + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . 'planAddTC_m1.tpl'); +} + +/** + * Get input from user and return it in some sort of namespace + * + * @param testproject $tproject_mgr + * @return stdClass object with some REQUEST and SESSION values as members + */ +function initArgs(&$tproject_mgr) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : 0; + $args->userID = intval($args->user->dbID); + + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : intval($_SESSION['testplanID']); + $args->tproject_id = intval($_SESSION['testprojectID']); + $args->tproject_name = $_SESSION['testprojectName']; + + $args->object_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + $args->item_level = isset($_REQUEST['edit']) ? trim($_REQUEST['edit']) : null; + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : "default"; + $args->testcases2add = isset($_REQUEST['achecked_tc']) ? $_REQUEST['achecked_tc'] : null; + $args->tcversion_for_tcid = isset($_REQUEST['tcversion_for_tcid']) ? $_REQUEST['tcversion_for_tcid'] : null; + $args->testcases2remove = isset($_REQUEST['remove_checked_tc']) ? $_REQUEST['remove_checked_tc'] : null; + + $args->testcases2order = isset($_REQUEST['exec_order']) ? $_REQUEST['exec_order'] : null; + $args->linkedOrder = isset($_REQUEST['linked_exec_order']) ? $_REQUEST['linked_exec_order'] : null; + $args->linkedVersion = isset($_REQUEST['linked_version']) ? $_REQUEST['linked_version'] : null; + $args->linkedWithCF = isset($_REQUEST['linked_with_cf']) ? $_REQUEST['linked_with_cf'] : null; + + $args->feature2fix = isset($_REQUEST['feature2fix']) ? $_REQUEST['feature2fix'] : null; + $args->testerID = isset($_REQUEST['testerID']) ? intval( + $_REQUEST['testerID']) : 0; + $args->send_mail = isset($_REQUEST['send_mail']) ? $_REQUEST['send_mail'] : false; + + // For more information about the data accessed in session here, see the comment + // in the file header of lib/functions/tlTestCaseFilterControl.class.php. + $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $mode = 'plan_add_mode'; + $pageCache = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$args->treeFormToken]) ? $_SESSION[$mode][$args->treeFormToken] : null; + + // need to comunicate with left frame, will do via $_SESSION and form_token + if ($args->treeFormToken > 0 && + ($args->item_level == 'testsuite' || $args->item_level == 'testcase')) { + // do not understand why this do not works OK + $_SESSION['loadRightPaneAddTC'][$args->treeFormToken] = false; + } + + // to be able to pass filters to functions present on specview.php + $args->control_panel = $pageCache; + $getFromSession = ! is_null($pageCache); + + $booleankeys = array( + 'refreshTree' => 'setting_refresh_tree_on_action', + 'importance' => 'filter_importance', + 'executionType' => 'filter_execution_type' + ); + + foreach ($booleankeys as $key => $value) { + $args->$key = ($getFromSession && isset($pageCache[$value])) ? $pageCache[$value] : 0; + } + $args->importance = ($args->importance > 0) ? $args->importance : null; + + // Filter Top level testsuite is implemented in an strange way: + // contains WHAT TO REMOVE + $args->topLevelTestSuite = 0; + if ($getFromSession && isset($pageCache['filter_toplevel_testsuite']) && + count($pageCache['filter_toplevel_testsuite']) > 0) { + // get all + $first_level_suites = $tproject_mgr->get_first_level_test_suites( + $args->tproject_id, 'simple', array( + 'accessKey' => 'id' + )); + + // remove unneeded + $hit = array_diff_key($first_level_suites, + $pageCache['filter_toplevel_testsuite']); + $args->topLevelTestSuite = intval(key($hit)); + } + + // This has effect when 'show full (on right pane)' button is used + if ($args->tproject_id == $args->object_id && $args->topLevelTestSuite > 0) { + $args->object_id = $args->topLevelTestSuite; + } + + $args->keyword_id = 0; + $ak = 'filter_keywords'; + if (isset($pageCache[$ak])) { + $args->keyword_id = $pageCache[$ak]; + if (is_array($args->keyword_id) && count($args->keyword_id) == 1) { + $args->keyword_id = $args->keyword_id[0]; + } + } + + $args->keywordsFilterType = null; + $ak = 'filter_keywords_filter_type'; + if (isset($pageCache[$ak])) { + $args->keywordsFilterType = $pageCache[$ak]; + } + + $args->platform_id = 0; + $ak = 'filter_platforms'; + if (isset($pageCache[$ak])) { + $args->platform_id = $pageCache[$ak]; + } + + $args->keywordsFilterType = null; + $ak = 'filter_keywords_filter_type'; + if (isset($pageCache[$ak])) { + $args->keywordsFilterType = $pageCache[$ak]; + } + + $ak = 'filter_workflow_status'; + $args->workflow_status = isset($pageCache[$ak]) ? $pageCache[$ak] : null; + + $args->build_id = isset($_REQUEST['build_id']) ? intval( + $_REQUEST['build_id']) : 0; + $args->activity = isset($_REQUEST['activity']) ? $_REQUEST['activity'] : ''; + + return $args; +} + +/* + * function: doReorder + * writes to DB execution order of test case versions + * linked to testplan. + * + * args: argsObj: user input data collected via HTML inputs + * tplanMgr: testplan manager object + * + * returns: - + * + */ +function doReorder(&$argsObj, &$tplanMgr) +{ + $mapo = null; + + // Do this to avoid update if order has not been changed on already linked items + if (! is_null($argsObj->linkedVersion)) { + // Using memory of linked test case, try to get order + foreach ($argsObj->linkedVersion as $tcid => $tcversion_id) { + if ($argsObj->linkedOrder[$tcid] != $argsObj->testcases2order[$tcid]) { + $mapo[$tcversion_id] = $argsObj->testcases2order[$tcid]; + } + } + } + + // Now add info for new liked test cases if any + if (! is_null($argsObj->testcases2add)) { + $tcaseSet = array_keys($argsObj->testcases2add); + foreach ($tcaseSet as $tcid) { + // This check is needed because, after we have added test case + // for a platform, this will not be present anymore + // in tcversion_for_tcid, but it's present in linkedVersion. + // IMPORTANT: + // We do not allow link of different test case version on a + // testplan no matter we are using or not platform feature. + // + $tcversion_id = null; + if (isset($argsObj->tcversion_for_tcid[$tcid])) { + $tcversion_id = $argsObj->tcversion_for_tcid[$tcid]; + } elseif (isset($argsObj->linkedVersion[$tcid]) && + ! isset($mapo[$argsObj->linkedVersion[$tcid]])) { + $tcversion_id = $argsObj->linkedVersion[$tcid]; + } + if (! is_null($tcversion_id)) { + $mapo[$tcversion_id] = $argsObj->testcases2order[$tcid]; + } + } + } + + if (! is_null($mapo)) { + $tplanMgr->setExecutionOrder($argsObj->tplan_id, $mapo); + } +} + +/* + * function: initializeGui + * + * args : + * + * returns: + * + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr, &$tcaseMgr) +{ + $tcase_cfg = config_get('testcase_cfg'); + $title_separator = config_get('gui_title_separator_1'); + + $gui = new stdClass(); + $gui->status_feedback = buildStatusFeedbackMsg(); + + $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix( + $argsObj->tproject_id); + $gui->testCasePrefix .= $tcase_cfg->glue_character; + + $gui->can_remove_executed_testcases = $argsObj->user->hasRight($dbHandler, + "testplan_unlink_executed_testcases", $argsObj->tproject_id, + $argsObj->tplan_id); + + $tprojectInfo = $tcaseMgr->tproject_mgr->get_by_id($argsObj->tproject_id); + $gui->priorityEnabled = $tprojectInfo['opt']->testPriorityEnabled; + + $gui->has_tc = 0; + $gui->items = null; + $gui->has_linked_items = false; + + $gui->keywordsFilterType = new stdClass(); + $gui->keywordsFilterType->options = array( + 'OR' => 'Or', + 'AND' => 'And' + ); + $gui->keywordsFilterType->selected = $argsObj->keywordsFilterType; + + $gui->keyword_id = $argsObj->keyword_id; + $gui->keywords_filter_feedback = ''; + if (! is_null($gui->keyword_id) && $gui->keyword_id != 0) { + $gui->keywords_filter_feedback = buildKeywordsFeedbackMsg($dbHandler, + $argsObj, $gui); + } + + $gui->platform_id = $argsObj->platform_id; + $gui->platforms_filter_feedback = ''; + if (! is_null($gui->platform_id) && $gui->platform_id != 0) { + $gui->platforms_filter_feedback = buildPlatformsFeedbackMsg($dbHandler, + $argsObj, $gui); + } + + // full_control, controls the operations planAddTC_m1.tpl will allow + // 1 => add/remove + // 0 => just remove + $gui->full_control = 1; + + $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->testPlanName = $tplan_info['name']; + $gui->pageTitle = lang_get('test_plan') . $title_separator . + $gui->testPlanName; + $gui->refreshTree = $argsObj->refreshTree; + $gui->canAssignExecTask = $argsObj->user->hasRight($dbHandler, + "exec_assign_testcases", $argsObj->tproject_id, $argsObj->tplan_id); + + $tproject_mgr = new testproject($dbHandler); + $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); + + $gui->testers = getTestersForHtmlOptions($dbHandler, $argsObj->tplan_id, + $tproject_info); + $gui->testerID = $argsObj->testerID; + $gui->send_mail = $argsObj->send_mail; + $gui->send_mail_checked = ''; + if ($gui->send_mail) { + $gui->send_mail_checked = ' checked="checked" '; + } + + $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + $gui->platforms = $platform_mgr->getLinkedToTestplan($argsObj->tplan_id); + $gui->platformsForHtmlOptions = null; + $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan( + $argsObj->tplan_id); + if ($gui->usePlatforms) { + // Create options for two different select boxes. $bulk_platforms + // has "All platforms" on top and "$platformsForHtmlOptions" has an + // empty item + $gui->platformsForHtmlOptions[0] = ''; + foreach ($gui->platforms as $elem) { + $gui->platformsForHtmlOptions[$elem['id']] = $elem['name']; + } + + $optLTT = null; + $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap( + $argsObj->tplan_id, $optLTT); + $gui->bulk_platforms[0] = lang_get("all_platforms"); + ksort($gui->bulk_platforms); + } + + $gui->warning_msg = new stdClass(); + $gui->warning_msg->executed = lang_get('executed_can_not_be_removed'); + if ($gui->can_remove_executed_testcases) { + $gui->warning_msg->executed = lang_get('has_been_executed'); + } + + $gui->build = initBuildSelector($tplanMgr, $argsObj); + + return $gui; +} + +/* + * function: doSaveCustomFields + * writes to DB value of custom fields displayed + * for test case versions linked to testplan. + * + * args: argsObj: user input data collected via HTML inputs + * tplanMgr: testplan manager object + * + * returns: - + * + */ +function doSaveCustomFields(&$argsObj, &$userInput, &$tplanMgr, &$tcaseMgr) +{ + // N.B.: I've use this piece of code also on write_execution(), think is time to create + // a method on cfield_mgr class. + // One issue: find a good method name + $cf_prefix = $tcaseMgr->cfield_mgr->get_name_prefix(); + $len_cfp = tlStringLen($cf_prefix); + $cf_nodeid_pos = 4; + + $nodeid_array_cfnames = null; + + // Example: two test cases (21 and 19 are testplan_tcversions.id => FEATURE_ID) + // with 3 custom fields + // + // custom_field_[TYPE]_[CFIELD_ID]_[FEATURE_ID] + // + // ( + // [21] => Array + // ( + // [0] => custom_field_0_3_21 + // [1] => custom_field_0_7_21 + // [5] => custom_field_6_9_21 + // ) + // + // [19] => Array + // ( + // [0] => custom_field_0_3_19 + // [1] => custom_field_0_7_19 + // [5] => custom_field_6_9_19 + // ) + // ) + // + foreach ($userInput as $input_name => $value) { + if (strncmp($input_name, $cf_prefix, $len_cfp) == 0) { + $dummy = explode('_', $input_name); + $nodeid_array_cfnames[$dummy[$cf_nodeid_pos]][] = $input_name; + } + } + + // foreach($argsObj->linkedWithCF as $key => $link_id) + foreach ($nodeid_array_cfnames as $link_id => $customFieldsNames) { + + // Create a SubSet of userInput just with inputs regarding CF for a link_id + // Example for link_id=21: + // + // $cfvalues=( 'custom_field_0_3_21' => A + // 'custom_field_0_7_21' => + // 'custom_field_8_8_21_day' => 0 + // 'custom_field_8_8_21_month' => 0 + // 'custom_field_8_8_21_year' => 0 + // 'custom_field_6_9_21_' => Every day) + // + $cfvalues = null; + foreach ($customFieldsNames as $cf) { + $cfvalues[$cf] = $userInput[$cf]; + } + $tcaseMgr->cfield_mgr->testplan_design_values_to_db($cfvalues, null, + $link_id); + } +} + +/* + * function: doSavePlatforms + * writes to DB execution ... of test case versions linked to testplan. + * + * args: argsObj: user input data collected via HTML inputs + * tplanMgr: testplan manager object + * + * returns: - + * + */ +function doSavePlatforms(&$argsObj, &$tplanMgr) +{ + foreach ($argsObj->feature2fix as $tcversion_platform) { + $tcversion_id = key($tcversion_platform); + $platform_id = current($tcversion_platform); + if ($platform_id != 0) { + $tplanMgr->changeLinkedTCVersionsPlatform($argsObj->tplan_id, 0, + $platform_id, $tcversion_id); + } + } +} + +/** + * send_mail_to_testers + * + * + * @return void + */ +function sendMailToTesters(&$dbHandler, &$tcaseMgr, &$guiObj, &$argsObj, + $features, $operation) +{ + $testers['new'] = null; + $mail_details['new'] = lang_get('mail_testcase_assigned') . "

    "; + $mail_subject['new'] = lang_get('mail_subject_testcase_assigned'); + $use_testers['new'] = true; + + $tcaseSet = null; + $tcnames = null; + $email = array(); + + $userSet[] = $argsObj->userID; + $userSet[] = $argsObj->testerID; + + $userData = tlUser::getByIDs($dbHandler, $userSet); + $assigner = $userData[$argsObj->userID]->firstName . ' ' . + $userData[$argsObj->userID]->lastName; + + $email['from_address'] = config_get('from_email'); + $body_first_lines = lang_get('testproject') . ': ' . $argsObj->tproject_name . + '
    ' . lang_get('testplan') . ': ' . $guiObj->testPlanName . + '

    '; + + // Get testers id + foreach ($features as $value) { + if ($use_testers['new']) { + $testers['new'][$value['user_id']][$value['tcase_id']] = $value['tcase_id']; + } + $tcaseSet[$value['tcase_id']] = $value['tcase_id']; + $tcversionSet[$value['tcversion_id']] = $value['tcversion_id']; + } + + $infoSet = $tcaseMgr->get_by_id_bulk($tcaseSet, $tcversionSet); + foreach ($infoSet as $value) { + $tcnames[$value['testcase_id']] = $guiObj->testCasePrefix . + $value['tc_external_id'] . ' ' . $value['name']; + } + + $path_info = $tcaseMgr->tree_manager->get_full_path_verbose($tcaseSet, + array( + 'output_format' => 'simple' + )); + $flat_path = null; + foreach ($path_info as $tcase_id => $pieces) { + $flat_path[$tcase_id] = implode('/', $pieces) . '/' . $tcnames[$tcase_id]; + } + + $validator = new Zend_Validate_EmailAddress(); + foreach ($testers as $tester_type => $tester_set) { + if (! is_null($tester_set)) { + $email['subject'] = $mail_subject[$tester_type] . ' ' . + $guiObj->testPlanName; + foreach ($tester_set as $user_id => $value) { + $userObj = $userData[$user_id]; + $email['to_address'] = trim($userObj->emailAddress); + if ($email['to_address'] == '' || + ! $validator->isValid($email['to_address'])) { + continue; + } + + $email['body'] = $body_first_lines; + $email['body'] .= sprintf($mail_details[$tester_type], + $userObj->firstName . ' ' . $userObj->lastName, $assigner); + + foreach ($value as $tcase_id) { + $email['body'] .= $flat_path[$tcase_id] . '
    '; + } + $email['body'] .= '
    ' . date(DATE_RFC1123); + + $email['cc'] = ''; + $email['attachment'] = null; + $email['exit_on_error'] = true; + $email['htmlFormat'] = true; + + $email_op = email_send($email['from_address'], + $email['to_address'], $email['subject'], $email['body'], + $email['cc'], $email['attachment'], $email['exit_on_error'], + $email['htmlFormat']); + } + } + } +} + +/** + * initDrawSaveButtons + */ +function initDrawSaveButtons(&$guiObj) +{ + $keySet = array_keys($guiObj->items); + + // 20100225 - eloff - BUGID 3205 - check only when platforms are active + // Logic to initialize drawSavePlatformsButton. + if ($guiObj->usePlatforms) { + // Looks for a platform with id = 0 + foreach ($keySet as $key) { + $breakLoop = false; + $testSuite = &$guiObj->items[$key]; + if ($testSuite['linked_testcase_qty'] > 0) { + $tcaseSet = array_keys($testSuite['testcases']); + foreach ($tcaseSet as $tcaseKey) { + if (isset( + $testSuite['testcases'][$tcaseKey]['feature_id'][0])) { + $breakLoop = true; + $guiObj->drawSavePlatformsButton = true; + break; + } + } + } + if ($breakLoop) { + break; + } + } + } + + // Logic to initialize drawSaveCFieldsButton + reset($keySet); + foreach ($keySet as $key) { + $breakLoop = false; + $tcaseSet = &$guiObj->items[$key]['testcases']; + if (! is_null($tcaseSet)) { + $tcversionSet = array_keys($tcaseSet); + foreach ($tcversionSet as $tcversionID) { + if (isset($tcaseSet[$tcversionID]['custom_fields']) && + ! is_null($tcaseSet[$tcversionID]['custom_fields'])) { + $breakLoop = true; + $guiObj->drawSaveCFieldsButton = true; + break; + } + } + } + if ($breakLoop) { + break; + } + } +} + +/** + */ +function setAdditionalGuiData($guiObj) +{ + $actionTitle = 'title_remove_test_from_plan'; + $buttonValue = 'btn_remove_selected_tc'; + $guiObj->exec_order_input_disabled = 'disabled="disabled"'; + + if ($guiObj->full_control) { + $actionTitle = 'title_add_test_to_plan'; + $buttonValue = 'btn_add_selected_tc'; + if ($guiObj->has_linked_items) { + $actionTitle = 'title_add_remove_test_to_plan'; + $buttonValue = 'btn_add_remove_selected_tc'; + } + $guiObj->exec_order_input_disabled = ' '; + } + $guiObj->actionTitle = lang_get($actionTitle); + $guiObj->buttonValue = lang_get($buttonValue); +} + +/** + * Initialize the HTML select box for selection of a build to which + * user wants to assign testers which are added to testplan. + * + * @author Andreas Simon + * @param testplan $testplan_mgr + * reference to testplan manager object + * @param object $argsObj + * reference to user input object + * @return array $html_menu array structure with all information needed for the menu + */ +function initBuildSelector(&$testplan_mgr, &$argsObj) +{ + + // init array + $menu = array( + 'items' => null, + 'selected' => null, + 'count' => 0 + ); + + $menu['items'] = (array) $testplan_mgr->get_builds_for_html_options( + $argsObj->tplan_id, testplan::GET_ACTIVE_BUILD, testplan::GET_OPEN_BUILD); + $menu['count'] = count($menu['items']); + + // if no build has been chosen yet, select the newest build by default + $build_id = $argsObj->build_id; + if (! $build_id && $menu['count']) { + $keys = array_keys($menu['items']); + $build_id = end($keys); + } + $menu['selected'] = $build_id; + + return $menu; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param testplan $tplanMgr + * @param testcase $tcaseMgr + */ +function addToTestPlan(&$dbHandler, &$argsObj, &$guiObj, &$tplanMgr, &$tcaseMgr) +{ + // items_to_link structure: + // key: test case id , value: map + // key: platform_id value: test case VERSION ID + $items_to_link = null; + foreach ($argsObj->testcases2add as $tcase_id => $info) { + foreach ($info as $platform_id => $tcase_id) { + if (isset($argsObj->tcversion_for_tcid[$tcase_id])) { + $tcversion_id = $argsObj->tcversion_for_tcid[$tcase_id]; + } else { + $tcversion_id = $argsObj->linkedVersion[$tcase_id]; + } + $items_to_link['tcversion'][$tcase_id] = $tcversion_id; + $items_to_link['platform'][$platform_id] = $platform_id; + $items_to_link['items'][$tcase_id][$platform_id] = $tcversion_id; + } + } + + $linked_features = $tplanMgr->link_tcversions($argsObj->tplan_id, + $items_to_link, $argsObj->userID); + + if ($argsObj->testerID > 0) { + $features2 = null; + $status_map = $tplanMgr->assignment_mgr->get_available_status(); + $types_map = $tplanMgr->assignment_mgr->get_available_types(); + $db_now = $dbHandler->db_now(); + $tcversion_tcase = array_flip($items_to_link['tcversion']); + + $getOpt = array( + 'outputFormat' => 'map', + 'addIfNull' => true + ); + $platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, $getOpt); + + foreach ($linked_features as $platform_id => $tcversion_info) { + foreach ($tcversion_info as $tcversion_id => $feature_id) { + $features2['add'][$feature_id]['user_id'] = $argsObj->testerID; + $features2['add'][$feature_id]['type'] = $types_map['testcase_execution']['id']; + $features2['add'][$feature_id]['status'] = $status_map['open']['id']; + $features2['add'][$feature_id]['assigner_id'] = $argsObj->userID; + $features2['add'][$feature_id]['tcase_id'] = $tcversion_tcase[$tcversion_id]; + $features2['add'][$feature_id]['tcversion_id'] = $tcversion_id; + $features2['add'][$feature_id]['creation_ts'] = $db_now; + $features2['add'][$feature_id]['platform_name'] = $platformSet[$platform_id]; + $features2['add'][$feature_id]['build_id'] = $argsObj->build_id; + } + } + + foreach ($features2 as $key => $values) { + $tplanMgr->assignment_mgr->assign($values); + $called[$key] = true; + } + + if ($argsObj->send_mail) { + foreach ($called as $ope => $ope_status) { + if ($ope_status) { + sendMailToTesters($dbHandler, $tcaseMgr, $guiObj, $argsObj, + $features2['add'], $ope); + } + } + } + } +} + +/** + */ +function buildStatusFeedbackMsg() +{ + $ret = ''; + $hideStatusSet = config_get('tplanDesign')->hideTestCaseWithStatusIn; + if (! is_null($hideStatusSet)) { + $cfx = getConfigAndLabels('testCaseStatus'); + $sc = array_flip($cfx['cfg']); + $msg = array(); + foreach ($hideStatusSet as $code => $verbose) { + $msg[] = $cfx['lbl'][$sc[$code]]; + } + $ret = sprintf(lang_get('hint_add_testcases_to_testplan_status'), + implode(',', $msg)); + } + + return $ret; +} + +/** + */ +function buildKeywordsFeedbackMsg(&$dbHandler, &$argsObj, &$gui) +{ + $opx = array( + 'tproject_id' => $argsObj->tproject_id, + 'cols' => 'id,keyword', + 'accessKey' => 'id' + ); + + $kwSet = tlKeyword::getSimpleSet($dbHandler, $opx); + $msg = array(); + $k2s = (array) $gui->keyword_id; + foreach ($k2s as $idt) { + $msg[] = $kwSet[$idt]['keyword']; + } + return implode(',', $msg); +} + +/** + */ +function buildPlatformsFeedbackMsg(&$dbHandler, &$argsObj, &$gui) +{ + $opx = array( + 'fields' => 'id,name', + 'accessKey' => 'id' + ); + + $platMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + $k2s = (array) $gui->platform_id; + $ixSet = $platMgr->getByID($k2s, $opx); + $msg = array(); + foreach ($k2s as $idt) { + $msg[] = $ixSet[$idt]['name']; + } + return implode(',', $msg); } diff --git a/lib/plan/planAddTCNavigator.php b/lib/plan/planAddTCNavigator.php index c28b477edc..ea6dd6c13d 100644 --- a/lib/plan/planAddTCNavigator.php +++ b/lib/plan/planAddTCNavigator.php @@ -1,90 +1,86 @@ -build_tree_menu($gui); +$control->formAction = $_SESSION['basehref'] . "lib/plan/planAddTCNavigator.php"; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('control', $control); +$smarty->assign('args', $gui->args); +$smarty->assign('menuUrl', $gui->menuUrl); + +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Initialize gui object for use in templates. + * + * @param tlTestCaseFilterControl $control + * @return object $gui + */ +function initializeGui($control) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $gui = new stdClass(); + $gui->formAction = ''; + + $gui->req_spec_manager_url = "lib/requirements/reqSpecView.php"; + $gui->req_manager_url = "lib/requirements/reqView.php"; + + // This logic is managed from frmWorkArea.php and planAddTC.php + $gui->loadRightPaneAddTC = isset($_REQUEST['loadRightPaneAddTC']) ? $_REQUEST['loadRightPaneAddTC'] : true; + if (isset($_SESSION['loadRightPaneAddTC'][$control->form_token])) { + $gui->loadRightPaneAddTC = false; + unset($_SESSION['loadRightPaneAddTC'][$control->form_token]); + } + + $gui->menuUrl = 'lib/plan/planAddTC.php'; + + // DEV NOTES - CRITIC + // activity has to be coherent with login on frmWorkArea.php and printDocOptions.php + $gui->args = $control->get_argument_string() . '&activity=addTC'; + $gui->additional_string = ''; + $gui->src_workframe = $control->args->basehref . $gui->menuUrl . + "?edit=testproject&id={$control->args->testproject_id}" . $gui->args; + + $gui->title_navigator = lang_get('navigator_add_remove_tcase_to_tplan'); + return $gui; } - -$gui = initializeGui($control); -$control->build_tree_menu($gui); -$control->formAction = $_SESSION['basehref'] . "lib/plan/planAddTCNavigator.php"; - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->assign('control', $control); -$smarty->assign('args', $gui->args); -$smarty->assign('menuUrl', $gui->menuUrl); - -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * Initialize gui object for use in templates. - * @param tlTestCaseFilterControl $control - * @return object $gui - */ -function initializeGui($control) -{ - - $_REQUEST = strings_stripSlashes($_REQUEST); - - $gui = new stdClass(); - $gui->formAction = ''; - - $gui->req_spec_manager_url = "lib/requirements/reqSpecView.php"; - $gui->req_manager_url = "lib/requirements/reqView.php"; - - // This logic is managed from frmWorkArea.php and planAddTC.php - $gui->loadRightPaneAddTC = isset($_REQUEST['loadRightPaneAddTC']) ? $_REQUEST['loadRightPaneAddTC'] : true; - if( isset($_SESSION['loadRightPaneAddTC'][$control->form_token]) ) - { - $gui->loadRightPaneAddTC = false; - unset($_SESSION['loadRightPaneAddTC'][$control->form_token]); - } - - $gui->menuUrl = 'lib/plan/planAddTC.php'; - - // DEV NOTES - CRITIC - // activity has to be coherent with login on frmWorkArea.php and printDocOptions.php - $gui->args = $control->get_argument_string() . '&activity=addTC'; - $gui->additional_string = ''; - $gui->src_workframe = $control->args->basehref . $gui->menuUrl . - "?edit=testproject&id={$control->args->testproject_id}" . $gui->args; - - $gui->title_navigator = lang_get('navigator_add_remove_tcase_to_tplan'); - return $gui; -} \ No newline at end of file diff --git a/lib/plan/planEdit.php b/lib/plan/planEdit.php index 0a85fd4b88..255d409da5 100644 --- a/lib/plan/planEdit.php +++ b/lib/plan/planEdit.php @@ -1,511 +1,553 @@ -tproject_id) { - $smarty->assign('title', lang_get('fatal_page_title')); - $smarty->assign('content', lang_get('error_no_testprojects_present')); - $smarty->display('workAreaSimple.tpl'); - exit(); -} - -if (!checkRights($db,$args->user,$args->tproject_id)) { - $smarty->assign('title', lang_get('fatal_page_title')); - $smarty->assign('content', lang_get('not_enough_rights')); - $smarty->display('workAreaSimple.tpl'); - exit(); +tproject_id) { + $smarty->assign('title', lang_get('fatal_page_title')); + $smarty->assign('content', lang_get('error_no_testprojects_present')); + $smarty->display('workAreaSimple.tpl'); + exit(); +} + +if (! checkRights($db, $args->user, $args->tproject_id)) { + $smarty->assign('title', lang_get('fatal_page_title')); + $smarty->assign('content', lang_get('not_enough_rights')); + $smarty->display('workAreaSimple.tpl'); + exit(); +} + +$of = web_editor('notes', $_SESSION['basehref'], $editorCfg); +$of->Value = getItemTemplateContents('testplan_template', $of->InstanceName, + $args->notes); + +// Checks on testplan name, and testplan name<=>testplan id +if ($args->do_action == "do_create" || $args->do_action == "do_update") { + $gui->testplan_name = $args->testplan_name; + $name_exists = $tproject_mgr->check_tplan_name_existence($args->tproject_id, + $args->testplan_name); + $name_id_rel_ok = (isset($gui->tplans[$args->tplan_id]) && + $gui->tplans[$args->tplan_id]['name'] == $args->testplan_name); +} + +// interface changes to be able to do not loose CF values if some problem arise on User Interface +$gui->cfields = $tplan_mgr->html_table_of_custom_field_inputs($args->tplan_id, + $args->tproject_id, 'design', '', $_REQUEST); + +switch ($args->do_action) { + case 'fileUpload': + $gui->uploadOp = fileUploadManagement($db, $args->tplan_id, + $args->fileTitle, $tplan_mgr->getAttachmentTableName()); + getItemData($tplan_mgr, $gui, $of, $args->tplan_id, true); + break; + + case 'deleteFile': + deleteAttachment($db, $args->file_id); + getItemData($tplan_mgr, $gui, $of, $args->tplan_id, true); + break; + + case 'edit': + getItemData($tplan_mgr, $gui, $of, $args->tplan_id); + break; + + case 'do_delete': + $tplanInfo = $tplan_mgr->get_by_id($args->tplan_id); + if ($tplanInfo) { + $tplan_mgr->delete($args->tplan_id); + logAuditEvent( + TLS("audit_testplan_deleted", $args->tproject_name, + $tplanInfo['name']), "DELETE", $args->tplan_id, "testplan"); + } + + // unset the session test plan if it is deleted + if (isset($_SESSION['testplanID']) && + ($_SESSION['testplanID'] = $args->tplan_id)) { + $_SESSION['testplanID'] = 0; + $_SESSION['testplanName'] = null; + } + break; + + case 'do_update': + $of->Value = $args->notes; + $gui->testplan_name = $args->testplan_name; + $gui->is_active = ($args->active == 'on') ? 1 : 0; + $gui->is_public = ($args->is_public == 'on') ? 1 : 0; + + $template = 'planEdit.tpl'; + $status_ok = false; + + if (! $name_exists || $name_id_rel_ok) { + if (! $tplan_mgr->update($args->tplan_id, $args->testplan_name, + $args->notes, $args->active, $args->is_public)) { + $gui->user_feedback = lang_get('update_tp_failed1') . + $gui->testplan_name . lang_get('update_tp_failed2') . ": " . + $db->error_msg() . "
    "; + } else { + logAuditEvent( + TLS("audit_testplan_saved", $args->tproject_name, + $args->testplan_name), "SAVE", $args->tplan_id, + "testplans"); + $cf_map = $tplan_mgr->get_linked_cfields_at_design( + $args->tplan_id); + $tplan_mgr->cfield_mgr->design_values_to_db($_REQUEST, + $args->tplan_id, $cf_map); + + if (isset($_SESSION['testplanID']) && + ($args->tplan_id == $_SESSION['testplanID'])) { + $_SESSION['testplanName'] = $args->testplan_name; + } + $status_ok = true; + $template = null; + + if (! $args->is_public) { + $tprojectEffectiveRole = $args->user->getEffectiveRole($db, + $args->tproject_id, null); + + // does user have an SPECIFIC role on TestPlan ? + // if answer is yes => do nothing + if (! tlUser::hasRoleOnTestPlan($db, $args->user_id, + $args->tplan_id)) { + $tplan_mgr->addUserRole($args->user_id, $args->tplan_id, + $tprojectEffectiveRole->dbID); + } + } + } + } else { + $gui->user_feedback = lang_get("warning_duplicate_tplan_name"); + } + + if (! $status_ok) { + $gui->tplan_id = $args->tplan_id; + $gui->tproject_name = $args->tproject_name; + $gui->notes = $of->CreateHTML(); + } + break; + + case 'do_create': + $template = 'planEdit.tpl'; + $status_ok = false; + + $of->Value = $args->notes; + $gui->testplan_name = $args->testplan_name; + $gui->is_active = ($args->active == 'on') ? 1 : 0; + $gui->is_public = ($args->is_public == 'on') ? 1 : 0; + + if (! $name_exists) { + $new_tplan_id = $tplan_mgr->create($args->testplan_name, + $args->notes, $args->tproject_id, $args->active, + $args->is_public); + if ($new_tplan_id == 0) { + $gui->user_feedback = $db->error_msg(); + } else { + logAuditEvent( + TLS("audit_testplan_created", $args->tproject_name, + $args->testplan_name), "CREATED", $new_tplan_id, + "testplans"); + $cf_map = $tplan_mgr->get_linked_cfields_at_design( + $new_tplan_id, $args->tproject_id); + $tplan_mgr->cfield_mgr->design_values_to_db($_REQUEST, + $new_tplan_id, $cf_map); + + $status_ok = true; + $template = null; + $gui->user_feedback = ''; + + // Operations Order is CRITIC + if ($args->copy) { + $options = array( + 'items2copy' => $args->copy_options, + 'copy_assigned_to' => $args->copy_assigned_to, + 'tcversion_type' => $args->tcversion_type + ); + $tplan_mgr->copy_as($args->source_tplanid, $new_tplan_id, + $args->testplan_name, $args->tproject_id, $args->user_id, + $options); + } + + // does user have an SPECIFIC role on TestPlan ? + // if answer is yes => do nothing + if (! $args->is_public && + ! tlUser::hasRoleOnTestPlan($db, $args->user_id, + $new_tplan_id)) { + $effectiveRole = $args->user->getEffectiveRole($db, + $args->tproject_id, null); + $tplan_mgr->addUserRole($args->user_id, $new_tplan_id, + $effectiveRole->dbID); + } + } + } else { + $gui->user_feedback = lang_get("warning_duplicate_tplan_name"); + } + + if (! $status_ok) { + $gui->tproject_name = $args->tproject_name; + $gui->notes = $of->CreateHTML(); + } + break; + + case 'setActive': + $tplan_mgr->setActive($args->tplan_id); + break; + + case 'setInactive': + $tplan_mgr->setInactive($args->tplan_id); + break; +} + +switch ($args->do_action) { + case "do_create": + case "do_delete": + case "do_update": + case "list": + case 'setActive': + case 'setInactive': + $do_display = true; + $template = is_null($template) ? 'planView.tpl' : $template; + $gui->tplans = $args->user->getAccessibleTestPlans($db, + $args->tproject_id, null, + array( + 'output' => 'mapfull', + 'active' => null + )); + $gui->drawPlatformQtyColumn = false; + + if (! is_null($gui->tplans)) { + // do this test project has platform definitions ? + $tplan_mgr->platform_mgr->setTestProjectID($args->tproject_id); + $dummy = $tplan_mgr->platform_mgr->testProjectCount(); + $gui->drawPlatformQtyColumn = $dummy[$args->tproject_id]['platform_qty'] > + 0; + + $tplanSet = array_keys($gui->tplans); + $dummy = $tplan_mgr->count_testcases($tplanSet, null, + array( + 'output' => 'groupByTestPlan' + )); + $buildQty = $tplan_mgr->get_builds($tplanSet, null, null, + array( + 'getCount' => true + )); + + $rightSet = array( + 'testplan_user_role_assignment' + ); + + $availableCF = (array) $tplan_mgr->get_linked_cfields_at_design( + current($tplanSet), $gui->tproject_id); + $hasCF = count($availableCF); + $gui->cfieldsColumns = null; + $initCFCol = true; + + $localeDateFormat = config_get('locales_date_format'); + $localeDateFormat = $localeDateFormat[$args->user->locale]; + + // get CF used to configure HIDE COLS + // We want different configurations for different test projects + // then will do two steps algorithm + // 1. get test project prefix PPFX + // 2. look for TL_TPLANVIEW_HIDECOL_PPFX + // 3. if found proceed + // 4. else look for TL_TPLANVIEW_HIDECOL + // + $ppfx = $tproject_mgr->getTestCasePrefix($gui->tproject_id); + $suffixSet = [ + '_' . $ppfx, + '' + ]; + foreach ($suffixSet as $suf) { + $gopt['name'] = 'TL_TPLANVIEW_HIDECOL' . $suf; + $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject( + $gui->tproject_id, null, $gopt); + + if ($col2hideCF != null) { + $col2hideCF = current($col2hideCF); + $col2hide = array_flip( + explode('|', $col2hideCF['possible_values'])); + $col2hide[$gopt['name']] = ''; + break; + } + } + + foreach ($tplanSet as $idk) { + if ($hasCF) { + $cfields = (array) $tplan_mgr->getCustomFieldsValues($idk, + $gui->tproject_id); + foreach ($cfields as $cfd) { + if ($initCFCol && ! isset($col2hide[$cfd['name']])) { + $gui->cfieldsColumns[] = $cfd['label']; + $gui->cfieldsType[] = $cfd['type']; + } + $gui->tplans[$idk][$cfd['label']] = [ + 'value' => $cfd['value'], + 'data-order' => $cfd['value'] + ]; + + if ($cfd['type'] == 'date') { + $gui->tplans[$idk][$cfd['label']]['data-order'] = locateDateToISO( + $cfd['value'], $localeDateFormat); + } + } + $initCFCol = false; + } + + $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval( + $dummy[$idk]['qty']) : 0; + $gui->tplans[$idk]['build_qty'] = isset( + $buildQty[$idk]['build_qty']) ? intval( + $buildQty[$idk]['build_qty']) : 0; + if ($gui->drawPlatformQtyColumn) { + $plat = $tplan_mgr->getPlatforms($idk); + $gui->tplans[$idk]['platform_qty'] = is_null($plat) ? 0 : count( + $plat); + } + + // Get rights for each test plan + foreach ($rightSet as $target) { + // DEV NOTE - CRITIC + // I've made a theorically good performance choice to + // assign to $roleObj a reference to different roleObj + // UNFORTUNATELLY this choice was responsible to destroy point object + // since second LOOP + $roleObj = null; + if ($gui->tplans[$idk]['has_role'] > 0) { + if (isset( + $args->user->tplanRoles[$gui->tplans[$idk]['has_role']])) { + $roleObj = $args->user->tplanRoles[$gui->tplans[$idk]['has_role']]; + } else { + // Need To review this comment + // session cache has not still updated => get from DB ? + $roleObj = $args->user->getEffectiveRole($db, + $args->tproject_id, $idk); + } + } elseif (! is_null($args->user->tprojectRoles) && + isset($args->user->tprojectRoles[$args->tproject_id])) { + $roleObj = $args->user->tprojectRoles[$args->tproject_id]; + } + + if (is_null($roleObj)) { + $roleObj = $args->user->globalRole; + } + $gui->tplans[$idk]['rights'][$target] = $roleObj->hasRight( + $target); + } + } + } + break; + + case "edit": + case "create": + case 'fileUpload': + case 'deleteFile': + $do_display = true; + $template = is_null($template) ? 'planEdit.tpl' : $template; + $gui->notes = $of->CreateHTML(); + break; +} + +if ($do_display) { + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . $template); +} + +/** + * INITialize page ARGuments, using the $_REQUEST and $_SESSION + * super-global hashes. + * Important: changes in HTML input elements on the Smarty template must be reflected here. + * + * @param array $request_hash + * hash the $_REQUEST + * @return stdClass object with html values tranformed and other generated variables. + */ +function initArgs($request_hash) +{ + $session_hash = $_SESSION; + $args = new stdClass(); + $request_hash = strings_stripSlashes($request_hash); + + $nullable_keys = array( + 'testplan_name', + 'notes', + 'rights', + 'active', + 'do_action' + ); + foreach ($nullable_keys as $value) { + $args->$value = isset($request_hash[$value]) ? trim( + $request_hash[$value]) : null; + } + + $checkboxes_keys = array( + 'is_public' => 0, + 'active' => 0 + ); + foreach ($checkboxes_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? 1 : 0; + } + + $intval_keys = array( + 'copy_from_tplan_id' => 0, + 'tplan_id' => 0 + ); + foreach ($intval_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; + } + $args->source_tplanid = $args->copy_from_tplan_id; + $args->copy = ($args->copy_from_tplan_id > 0) ? true : false; + + $args->copy_options = array(); + $boolean_keys = array( + 'copyTcases' => 0, + 'copyPriorities' => 0, + 'copyMilestones' => 0, + 'copyUserRoles' => 0, + 'copyBuilds' => 0, + 'copyPlatformsLinks' => 0, + 'copyAttachments' => 0 + ); + + foreach ($boolean_keys as $key => $value) { + $args->copy_options[$key] = isset($request_hash[$key]) ? 1 : 0; + } + + $args->copy_assigned_to = isset($request_hash['copy_assigned_to']) ? 1 : 0; + $args->tcversion_type = isset($request_hash['tcversion_type']) ? $request_hash['tcversion_type'] : null; + $args->tproject_id = intval($session_hash['testprojectID']); + $args->tproject_name = $session_hash['testprojectName']; + $args->user_id = intval($session_hash['userID']); + $args->user = $session_hash['currentUser']; + + // all has to be refactored this way + $iParams = array( + "file_id" => array( + tlInputParameter::INT_N + ), + "fileTitle" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + R_PARAMS($iParams, $args); + + return $args; +} + +/** + * Checks the user rights for accessing the page + * + * @param database $db + * @param tlUser $user + * @param int $tproject_id + * @return boolean + */ +function checkRights(&$db, &$user, $tproject_id) +{ + return $user->hasRight($db, 'mgt_testplan_create', $tproject_id); +} + +/** + * Initializes the GUI + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param array $editorCfg + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj, &$editorCfg) +{ + $tplan_mgr = new testplan($dbHandler); + + $guiObj = new stdClass(); + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->editorType = $editorCfg['type']; + $guiObj->tplans = $argsObj->user->getAccessibleTestPlans($dbHandler, + $argsObj->tproject_id, null, + array( + 'output' => 'mapfull', + 'active' => null + )); + $guiObj->tproject_name = $argsObj->tproject_name; + $guiObj->main_descr = lang_get('testplan_title_tp_management') . " - " . + lang_get('testproject') . ' ' . $argsObj->tproject_name; + $guiObj->testplan_name = null; + $guiObj->tplan_id = intval($argsObj->tplan_id); + $guiObj->is_active = 0; + $guiObj->is_public = 0; + $guiObj->cfields = ''; + $guiObj->user_feedback = ''; + + $guiObj->grants = new stdClass(); + $guiObj->grants->testplan_create = $argsObj->user->hasRight($dbHandler, + "mgt_testplan_create", $argsObj->tproject_id); + $guiObj->grants->mgt_view_events = $argsObj->user->hasRight($dbHandler, + "mgt_view_events"); + $guiObj->notes = ''; + + $guiObj->attachments[$guiObj->tplan_id] = getAttachmentInfosFrom($tplan_mgr, + $guiObj->tplan_id); + $guiObj->attachmentTableName = $tplan_mgr->getAttachmentTableName(); + + $guiObj->fileUploadURL = $_SESSION['basehref'] . + $tplan_mgr->getFileUploadRelativeURL($guiObj->tplan_id); + $guiObj->delAttachmentURL = $_SESSION['basehref'] . + $tplan_mgr->getDeleteAttachmentRelativeURL($guiObj->tplan_id); + + $guiObj->fileUploadMsg = ''; + $guiObj->import_limit = TL_REPOSITORY_MAXFILESIZE; + + return $guiObj; +} + +/** + * + * @param testplan $itemMgr + * @param stdClass $guiObj + * @param ckeditorInterface $ofObj + * @param int $itemID + * @param boolean $updateAttachments + */ +function getItemData(&$itemMgr, &$guiObj, &$ofObj, $itemID, + $updateAttachments = false) +{ + $dummy = $itemMgr->get_by_id($itemID); + if (count($dummy)) { + $ofObj->Value = $dummy['notes']; + $guiObj->testplan_name = $dummy['name']; + $guiObj->is_active = $dummy['active']; + $guiObj->is_public = $dummy['is_public']; + $guiObj->api_key = $dummy['api_key']; + $guiObj->tplan_id = $itemID; + + if ($updateAttachments) { + $guiObj->attachments[$guiObj->tplan_id] = getAttachmentInfosFrom( + $itemMgr, $guiObj->tplan_id); + } + } } - - - -$of = web_editor('notes',$_SESSION['basehref'],$editorCfg); -$of->Value = getItemTemplateContents('testplan_template', $of->InstanceName, $args->notes); - - -// Checks on testplan name, and testplan name<=>testplan id -if($args->do_action == "do_create" || $args->do_action == "do_update") -{ - $gui->testplan_name = $args->testplan_name; - $name_exists = $tproject_mgr->check_tplan_name_existence($args->tproject_id,$args->testplan_name); - $name_id_rel_ok = (isset($gui->tplans[$args->tplan_id]) && - $gui->tplans[$args->tplan_id]['name'] == $args->testplan_name); -} - -// interface changes to be able to do not loose CF values if some problem arise on User Interface -$gui->cfields = $tplan_mgr->html_table_of_custom_field_inputs($args->tplan_id,$args->tproject_id,'design','',$_REQUEST); - -switch($args->do_action) -{ - case 'fileUpload': - $gui->uploadOp = fileUploadManagement($db,$args->tplan_id,$args->fileTitle,$tplan_mgr->getAttachmentTableName()); - getItemData($tplan_mgr,$gui,$of,$args->tplan_id,true); - break; - - case 'deleteFile': - deleteAttachment($db,$args->file_id); - getItemData($tplan_mgr,$gui,$of,$args->tplan_id,true); - break; - - case 'edit': - getItemData($tplan_mgr,$gui,$of,$args->tplan_id); - break; - - case 'do_delete': - $tplanInfo = $tplan_mgr->get_by_id($args->tplan_id); - if ($tplanInfo) - { - $tplan_mgr->delete($args->tplan_id); - logAuditEvent(TLS("audit_testplan_deleted",$args->tproject_name,$tplanInfo['name']), - "DELETE",$args->tplan_id,"testplan"); - } - - //unset the session test plan if it is deleted - if (isset($_SESSION['testplanID']) && ($_SESSION['testplanID'] = $args->tplan_id)) - { - $_SESSION['testplanID'] = 0; - $_SESSION['testplanName'] = null; - } - break; - - case 'do_update': - $of->Value = $args->notes; - $gui->testplan_name = $args->testplan_name; - $gui->is_active = ($args->active == 'on') ? 1 :0 ; - $gui->is_public = ($args->is_public == 'on') ? 1 :0 ; - - $template = 'planEdit.tpl'; - $status_ok = false; - - if(!$name_exists || $name_id_rel_ok) - { - if(!$tplan_mgr->update($args->tplan_id,$args->testplan_name,$args->notes, - $args->active,$args->is_public)) - { - $gui->user_feedback = lang_get('update_tp_failed1'). $gui->testplan_name . - lang_get('update_tp_failed2').": " . $db->error_msg() . "
    "; - } - else - { - logAuditEvent(TLS("audit_testplan_saved",$args->tproject_name,$args->testplan_name),"SAVE", - $args->tplan_id,"testplans"); - $cf_map = $tplan_mgr->get_linked_cfields_at_design($args->tplan_id); - $tplan_mgr->cfield_mgr->design_values_to_db($_REQUEST,$args->tplan_id,$cf_map); - - if(isset($_SESSION['testplanID']) && ($args->tplan_id == $_SESSION['testplanID'])) - { - $_SESSION['testplanName'] = $args->testplan_name; - } - $status_ok = true; - $template = null; - - if(!$args->is_public) - { - $tprojectEffectiveRole = $args->user->getEffectiveRole($db,$args->tproject_id,null); - - // does user have an SPECIFIC role on TestPlan ? - // if answer is yes => do nothing - if(!tlUser::hasRoleOnTestPlan($db,$args->user_id,$args->tplan_id)) - { - $tplan_mgr->addUserRole($args->user_id,$args->tplan_id,$tprojectEffectiveRole->dbID); - } - } - } - } - else - { - $gui->user_feedback = lang_get("warning_duplicate_tplan_name"); - } - - if(!$status_ok) - { - $gui->tplan_id=$args->tplan_id; - $gui->tproject_name=$args->tproject_name; - $gui->notes=$of->CreateHTML(); - } - break; - - case 'do_create': - $template = 'planEdit.tpl'; - $status_ok = false; - - $of->Value = $args->notes; - $gui->testplan_name = $args->testplan_name; - $gui->is_active = ($args->active == 'on') ? 1 :0 ; - $gui->is_public = ($args->is_public == 'on') ? 1 :0 ; - - if(!$name_exists) - { - $new_tplan_id = $tplan_mgr->create($args->testplan_name,$args->notes, - $args->tproject_id,$args->active,$args->is_public); - if ($new_tplan_id == 0) - { - $gui->user_feedback = $db->error_msg(); - } - else - { - logAuditEvent(TLS("audit_testplan_created",$args->tproject_name,$args->testplan_name), - "CREATED",$new_tplan_id,"testplans"); - $cf_map = $tplan_mgr->get_linked_cfields_at_design($new_tplan_id,$args->tproject_id); - $tplan_mgr->cfield_mgr->design_values_to_db($_REQUEST,$new_tplan_id,$cf_map); - - $status_ok = true; - $template = null; - $gui->user_feedback =''; - - // Operations Order is CRITIC - if($args->copy) - { - $options = array('items2copy' => $args->copy_options,'copy_assigned_to' => $args->copy_assigned_to, - 'tcversion_type' => $args->tcversion_type); - $tplan_mgr->copy_as($args->source_tplanid, $new_tplan_id,$args->testplan_name, - $args->tproject_id,$args->user_id,$options); - } - - if(!$args->is_public) - { - // does user have an SPECIFIC role on TestPlan ? - // if answer is yes => do nothing - if(!tlUser::hasRoleOnTestPlan($db,$args->user_id,$new_tplan_id)) - { - $effectiveRole = $args->user->getEffectiveRole($db,$args->tproject_id,null); - $tplan_mgr->addUserRole($args->user_id,$new_tplan_id,$effectiveRole->dbID); - } - } - // End critic block - - } - } - else - { - $gui->user_feedback = lang_get("warning_duplicate_tplan_name"); - } - - if(!$status_ok) - { - // $gui->tplan_id=$new_tplan_id; - $gui->tproject_name=$args->tproject_name; - $gui->notes=$of->CreateHTML(); - } - break; - - case 'setActive': - $tplan_mgr->setActive($args->tplan_id); - break; - - case 'setInactive': - $tplan_mgr->setInactive($args->tplan_id); - break; - -} - -switch($args->do_action) -{ - case "do_create": - case "do_delete": - case "do_update": - case "list": - case 'setActive': - case 'setInactive': - $do_display=true; - $template = is_null($template) ? 'planView.tpl' : $template; - $gui->tplans = $args->user->getAccessibleTestPlans($db,$args->tproject_id,null, - array('output' =>'mapfull','active' => null)); - $gui->drawPlatformQtyColumn = false; - - if( !is_null($gui->tplans) ) { - // do this test project has platform definitions ? - $tplan_mgr->platform_mgr->setTestProjectID($args->tproject_id); - $dummy = $tplan_mgr->platform_mgr->testProjectCount(); - $gui->drawPlatformQtyColumn = $dummy[$args->tproject_id]['platform_qty'] > 0; - - $tplanSet = array_keys($gui->tplans); - $dummy = $tplan_mgr->count_testcases($tplanSet,null,array('output' => 'groupByTestPlan')); - $buildQty = $tplan_mgr->get_builds($tplanSet,null,null,array('getCount' => true)); - - $rightSet = array('testplan_user_role_assignment'); - - // -------------------------------------------------------------------------------------------------- - $availableCF = (array)$tplan_mgr->get_linked_cfields_at_design(current($tplanSet),$gui->tproject_id); - $hasCF = count($availableCF); - $gui->cfieldsColumns = null; - $initCFCol = true; - - $localeDateFormat = config_get('locales_date_format'); - $localeDateFormat = $localeDateFormat[$args->user->locale]; - - - // get CF used to configure HIDE COLS - // We want different configurations for different test projects - // then will do two steps algorithm - // 1. get test project prefix PPFX - // 2. look for TL_TPLANVIEW_HIDECOL_PPFX - // 3. if found proceed - // 4. else look for TL_TPLANVIEW_HIDECOL - // - $ppfx = $tproject_mgr->getTestCasePrefix($gui->tproject_id); - $suffixSet = ['_' . $ppfx, '']; - foreach($suffixSet as $suf) { - $gopt['name'] = 'TL_TPLANVIEW_HIDECOL' . $suf; - $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject($gui->tproject_id,null,$gopt); - - if ($col2hideCF != null) { - $col2hideCF = current($col2hideCF); - $col2hide = array_flip(explode('|',$col2hideCF['possible_values'])); - $col2hide[$gopt['name']] = ''; - break; - } - } - - // -------------------------------------------------------------------------------------------------- - - foreach($tplanSet as $idk) { - // --------------------------------------------------------------------------------------------- - if ($hasCF) { - $cfields = (array)$tplan_mgr->getCustomFieldsValues($idk,$gui->tproject_id); - foreach ($cfields as $cfd) { - if ($initCFCol) { - if (!isset($col2hide[$cfd['name']])) { - $gui->cfieldsColumns[] = $cfd['label']; - $gui->cfieldsType[] = $cfd['type']; - } - } - $gui->tplans[$idk][$cfd['label']] = ['value' => $cfd['value'], 'data-order' => $cfd['value']]; - - if ($cfd['type'] == 'date') { - $gui->tplans[$idk][$cfd['label']]['data-order'] = locateDateToISO($cfd['value'], $localeDateFormat); - } - } - $initCFCol = false; - } - // --------------------------------------------------------------------------------------------- - - - - $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval($dummy[$idk]['qty']) : 0; - $gui->tplans[$idk]['build_qty'] = isset($buildQty[$idk]['build_qty']) ? intval($buildQty[$idk]['build_qty']) : 0; - if( $gui->drawPlatformQtyColumn ) - { - $plat = $tplan_mgr->getPlatforms($idk); - $gui->tplans[$idk]['platform_qty'] = is_null($plat) ? 0 : count($plat); - } - - // Get rights for each test plan - foreach($rightSet as $target) - { - // DEV NOTE - CRITIC - // I've made a theorically good performance choice to - // assign to $roleObj a reference to different roleObj - // UNFORTUNATELLY this choice was responsible to destroy point object - // since second LOOP - $roleObj = null; - if($gui->tplans[$idk]['has_role'] > 0) - { - if( isset($args->user->tplanRoles[ $gui->tplans[$idk]['has_role'] ]) ) - { - $roleObj = $args->user->tplanRoles[ $gui->tplans[$idk]['has_role'] ]; - } - else - { - // Need To review this comment - // session cache has not still updated => get from DB ? - $roleObj = $args->user->getEffectiveRole($db,$args->tproject_id,$idk); - } - } - else if (!is_null($args->user->tprojectRoles) && - isset($args->user->tprojectRoles[$args->tproject_id]) ) - { - $roleObj = $args->user->tprojectRoles[$args->tproject_id]; - } - - if(is_null($roleObj)) - { - $roleObj = $args->user->globalRole; - } - $gui->tplans[$idk]['rights'][$target] = $roleObj->hasRight($target); - } - } - } - break; - - case "edit": - case "create": - case 'fileUpload': - case 'deleteFile': - $do_display=true; - $template = is_null($template) ? 'planEdit.tpl' : $template; - $gui->notes=$of->CreateHTML(); - break; -} - -if($do_display) -{ - $smarty->assign('gui',$gui); - $smarty->display($templateCfg->template_dir . $template); -} - - -/* - * INITialize page ARGuments, using the $_REQUEST and $_SESSION - * super-global hashes. - * Important: changes in HTML input elements on the Smarty template - * must be reflected here. - * - * - * @parameter hash request_hash the $_REQUEST - * @return object with html values tranformed and other - * generated variables. - * - */ -function init_args($request_hash) -{ - $session_hash = $_SESSION; - $args = new stdClass(); - $request_hash = strings_stripSlashes($request_hash); - - $nullable_keys = array('testplan_name','notes','rights','active','do_action'); - foreach($nullable_keys as $value) - { - $args->$value = isset($request_hash[$value]) ? trim($request_hash[$value]) : null; - } - - $checkboxes_keys = array('is_public' => 0,'active' => 0); - foreach($checkboxes_keys as $key => $value) - { - $args->$key = isset($request_hash[$key]) ? 1 : 0; - } - - $intval_keys = array('copy_from_tplan_id' => 0,'tplan_id' => 0); - foreach($intval_keys as $key => $value) - { - $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; - } - $args->source_tplanid = $args->copy_from_tplan_id; - $args->copy = ($args->copy_from_tplan_id > 0) ? TRUE : FALSE; - - $args->copy_options=array(); - $boolean_keys = array('copy_tcases' => 0,'copy_priorities' => 0, - 'copy_milestones' => 0, 'copy_user_roles' => 0, - 'copy_builds' => 0, 'copy_platforms_links' => 0, - 'copy_attachments' => 0); - - foreach($boolean_keys as $key => $value) - { - $args->copy_options[$key]=isset($request_hash[$key]) ? 1 : 0; - } - - $args->copy_assigned_to = isset($request_hash['copy_assigned_to']) ? 1 : 0; - $args->tcversion_type = isset($request_hash['tcversion_type']) ? $request_hash['tcversion_type'] : null; - $args->tproject_id = intval($session_hash['testprojectID']); - $args->tproject_name = $session_hash['testprojectName']; - $args->user_id = intval($session_hash['userID']); - $args->user = $session_hash['currentUser']; - - - // all has to be refactored this way - $iParams = array("file_id" => array(tlInputParameter::INT_N), - "fileTitle" => array(tlInputParameter::STRING_N,0,100)); - R_PARAMS($iParams,$args); - - return $args; -} - -/** - * checkRights - * - */ -function checkRights(&$db,&$user,$tproject_id) -{ - return $user->hasRight($db,'mgt_testplan_create',$tproject_id); -} - -/** - * initializeGui - * - */ -function initializeGui(&$dbHandler,&$argsObj,&$editorCfg,&$tprojectMgr) -{ - $tplan_mgr = new testplan($dbHandler); - - $guiObj = new stdClass(); - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->editorType = $editorCfg['type']; - $guiObj->tplans = $argsObj->user->getAccessibleTestPlans($dbHandler,$argsObj->tproject_id, - null,array('output' =>'mapfull','active' => null)); - $guiObj->tproject_name = $argsObj->tproject_name; - $guiObj->main_descr = lang_get('testplan_title_tp_management'). " - " . - lang_get('testproject') . ' ' . $argsObj->tproject_name; - $guiObj->testplan_name = null; - $guiObj->tplan_id = intval($argsObj->tplan_id); - $guiObj->is_active = 0; - $guiObj->is_public = 0; - $guiObj->cfields = ''; - $guiObj->user_feedback = ''; - - $guiObj->grants = new stdClass(); - $guiObj->grants->testplan_create = $argsObj->user->hasRight($dbHandler,"mgt_testplan_create",$argsObj->tproject_id); - $guiObj->grants->mgt_view_events = $argsObj->user->hasRight($dbHandler,"mgt_view_events"); - $guiObj->notes = ''; - - $guiObj->attachments[$guiObj->tplan_id] = getAttachmentInfosFrom($tplan_mgr,$guiObj->tplan_id); - $guiObj->attachmentTableName = $tplan_mgr->getAttachmentTableName(); - - - $guiObj->fileUploadURL = $_SESSION['basehref'] . $tplan_mgr->getFileUploadRelativeURL($guiObj->tplan_id); - $guiObj->delAttachmentURL = $_SESSION['basehref'] . $tplan_mgr->getDeleteAttachmentRelativeURL($guiObj->tplan_id); - - $guiObj->fileUploadMsg = ''; - $guiObj->import_limit = TL_REPOSITORY_MAXFILESIZE; - - return $guiObj; -} - -/** - * - */ -function getItemData(&$itemMgr,&$guiObj,&$ofObj,$itemID,$updateAttachments=false) -{ - $dummy = $itemMgr->get_by_id($itemID); - if (sizeof($dummy)) - { - $ofObj->Value = $dummy['notes']; - $guiObj->testplan_name = $dummy['name']; - $guiObj->is_active = $dummy['active']; - $guiObj->is_public = $dummy['is_public']; - $guiObj->api_key = $dummy['api_key']; - $guiObj->tplan_id = $itemID; - - if($updateAttachments) - { - $guiObj->attachments[$guiObj->tplan_id] = getAttachmentInfosFrom($itemMgr,$guiObj->tplan_id); - } - } -} \ No newline at end of file diff --git a/lib/plan/planExport.php b/lib/plan/planExport.php index 860a0b370f..3b14714775 100644 --- a/lib/plan/planExport.php +++ b/lib/plan/planExport.php @@ -1,203 +1,218 @@ -exportContent - * - * 'linkedItem' just linked elements - * linked platforms - * linked test cases (minimal information) - * - * 'tree' - * complete plan contents: - * to be defined - * - * '4results' - * generates file format that can be used to import results - * - * @filesource planExport.php - * @package TestLink - * @author Francisco Mancardi - * @copyright 2003-2014, TestLink community - * @link http://www.testlink.org/ - * - * @internal revisions - * @since 1.9.12 - * - **/ -require_once("../../config.inc.php"); -require_once("../functions/common.php"); -require_once("../functions/xml.inc.php"); -testlinkInitPage($db); -$templateCfg = templateConfiguration(); - -$tplan_mgr = new testplan($db); - -$args = init_args(); -$gui = initializeGui($args,$tplan_mgr); - -if ($args->doExport) -{ - $tLogMsg = 'basename(__FILE__) : ' . basename(__FILE__) . ' : $args->exportContent : ' . $args->exportContent; - switch ($args->exportContent) - { - case 'tree': - $context = array('platform_id' => $args->platform_id, 'build_id' => $args->build_id, - 'tproject_id' => $args->tproject_id); - $content = $tplan_mgr->exportTestPlanDataToXML($args->tplan_id,$context); - $tLogMsg .= ' : exportTestPlanDataToXML()'; - break; - - case '4results': - $context = array('platform_id' => $args->platform_id, 'build_id' => $args->build_id, - 'tproject_id' => $args->tproject_id); - - $content = $tplan_mgr->exportForResultsToXML($args->tplan_id,$context,null, - array('tcaseSet' => $args->testCaseSet)); - $tLogMsg .= ' : exportForResultsToXML()'; - break; - - case 'linkedItems': - default: - $args->exportContent = 'linkedItems'; - $content = $tplan_mgr->exportLinkedItemsToXML($args->tplan_id); - $tLogMsg .= ' : exportLinkedItemsToXML()'; - break; - } - - tLog($tLogMsg,'DEBUG'); - downloadContentsToFile($content,$gui->export_filename); - exit(); +exportContent + * + * 'linkedItem' just linked elements + * linked platforms + * linked test cases (minimal information) + * + * 'tree' + * complete plan contents: + * to be defined + * + * '4results' + * generates file format that can be used to import results + * + * @filesource planExport.php + * @package TestLink + * @author Francisco Mancardi + * @copyright 2003-2014, TestLink community + * @link http://www.testlink.org/ + * + * @internal revisions + * @since 1.9.12 + * + **/ +require_once '../../config.inc.php'; +require_once '../functions/common.php'; +require_once '../functions/xml.inc.php'; +testlinkInitPage($db); +$templateCfg = templateConfiguration(); + +$tplan_mgr = new testplan($db); + +$args = initArgs(); +$gui = initializeGui($args, $tplan_mgr); + +if ($args->doExport) { + $tLogMsg = 'basename(__FILE__) : ' . basename(__FILE__) . + ' : $args->exportContent : ' . $args->exportContent; + switch ($args->exportContent) { + case 'tree': + $context = array( + 'platform_id' => $args->platform_id, + 'build_id' => $args->build_id, + 'tproject_id' => $args->tproject_id + ); + $content = $tplan_mgr->exportTestPlanDataToXML($args->tplan_id, + $context); + $tLogMsg .= ' : exportTestPlanDataToXML()'; + break; + + case '4results': + $context = array( + 'platform_id' => $args->platform_id, + 'build_id' => $args->build_id, + 'tproject_id' => $args->tproject_id + ); + + $content = $tplan_mgr->exportForResultsToXML($args->tplan_id, + $context, null, array( + 'tcaseSet' => $args->testCaseSet + )); + $tLogMsg .= ' : exportForResultsToXML()'; + break; + + case 'linkedItems': + default: + $args->exportContent = 'linkedItems'; + $content = $tplan_mgr->exportLinkedItemsToXML($args->tplan_id); + $tLogMsg .= ' : exportLinkedItemsToXML()'; + break; + } + + tLog($tLogMsg, 'DEBUG'); + downloadContentsToFile($content, $gui->export_filename); + exit(); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->doExport = isset($_REQUEST['export']) ? $_REQUEST['export'] : null; + $args->exportType = isset($_REQUEST['exportType']) ? $_REQUEST['exportType'] : null; + $args->closeOnCancel = isset($_REQUEST['closeOnCancel']) ? $_REQUEST['closeOnCancel'] : 0; + + // ------------------------------------------------------------------------------------------------ + // IMPORTANT NOTICE - 20101101 - franciscom + // This page is called (@20101101) from two places + // + // From test plan management to export linked test cases & platforms + // From execution to export test plan contents + // I've found problems when using in 'execution feature' when I've choose to name hidden inputs + // on tpl with a name different to that used on execSetResults.php. + // This resulted on weird effects on execNavigator.tpl + // Propably one option can be to save 'form_token'. + // I've used a simple (and may be more suggest to new bugs in future): + // maintain same names -> build_id instead of buildID, and so on. + // A change was also needed on JS support function openExportTestPlan(). + // ------------------------------------------------------------------------------------------------ + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + $args->build_id = isset($_REQUEST['build_id']) ? intval( + $_REQUEST['build_id']) : 0; + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + $args->platform_id = isset($_REQUEST['platform_id']) ? intval( + $_REQUEST['platform_id']) : 0; + + $args->export_filename = isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; + $args->export_filename = trim($args->export_filename); + + // replace blank on name with _ + if (! is_null($args->export_filename)) { + $args->export_filename = str_replace(' ', '_', $args->export_filename); + } + + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + // TICKET 6498: Cross-Site Scripting on /lib/plan/planExport.php (CWE-80) + $default = 'linkedItems'; + $args->exportContent = isset($_REQUEST['exportContent']) ? substr( + $_REQUEST['exportContent'], 0, strlen($default)) : $default; + switch ($args->exportContent) { + case 'tree': + case '4results': + case 'linkedItems': + break; + + default: + $args->exportContent = $default; + break; + } + + // Vulnerable ? + $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $args->testCaseSet = null; + if ($args->treeFormToken > 0) { + $mode = 'execution_mode'; + $session_data = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$args->treeFormToken]) ? $_SESSION[$mode][$args->treeFormToken] : null; + + $args->testCaseSet = $session_data['testcases_to_show']; + } + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$tplanMgr) +{ + $info = $tplanMgr->get_by_id($argsObj->tplan_id, + array( + 'output' => 'minimun', + 'caller' => __LINE__ + )); + $add2name = ''; + + $guiObj = new stdClass(); + $guiObj->do_it = 1; + $guiObj->nothing_todo_msg = ''; + $guiObj->closeOnCancel = $argsObj->closeOnCancel; + + // If there is a platform setted -> use in name. + if ($argsObj->platform_id > 0) { + $dummy = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'mapAccessByID' + )); + $add2name .= '_' . + str_replace(' ', '_', $dummy[$argsObj->platform_id]['name']); + } + // If there is a build setted -> use in name. + if ($argsObj->build_id > 0) { + $dummy = $tplanMgr->get_builds($argsObj->tplan_id); + $add2name .= '_' . + str_replace(' ', '_', $dummy[$argsObj->build_id]['name']); + } + + // TICKET 4996: Ignores change of XML export file name + $guiObj->export_filename = $argsObj->export_filename; + if (trim($argsObj->export_filename) == '') { + $guiObj->export_filename = $argsObj->exportContent . '_' . + str_replace(' ', '_', $info['name']) . $add2name . '.xml'; + } + + $guiObj->exportTypes = array( + 'XML' => 'XML' + ); + $guiObj->page_title = lang_get('export_test_plan'); + $guiObj->object_name = $info['name']; + $guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + + $guiObj->tplan_id = intval($argsObj->tplan_id); + $guiObj->tproject_id = intval($argsObj->tproject_id); + $guiObj->platform_id = intval($argsObj->platform_id); + $guiObj->build_id = intval($argsObj->build_id); + $guiObj->exportContent = $argsObj->exportContent; + $guiObj->treeFormToken = $argsObj->treeFormToken; + + return $guiObj; } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->doExport = isset($_REQUEST['export']) ? $_REQUEST['export'] : null; - $args->exportType = isset($_REQUEST['exportType']) ? $_REQUEST['exportType'] : null; - $args->closeOnCancel = isset($_REQUEST['closeOnCancel']) ? $_REQUEST['closeOnCancel'] : 0; - - // ------------------------------------------------------------------------------------------------ - // IMPORTANT NOTICE - 20101101 - franciscom - // This page is called (@20101101) from two places - // - // From test plan management to export linked test cases & platforms - // From execution to export test plan contents - // I've found problems when using in 'execution feature' when I've choose to name hidden inputs - // on tpl with a name different to that used on execSetResults.php. - // This resulted on weird effects on execNavigator.tpl - // Propably one option can be to save 'form_token'. - // I've used a simple (and may be more suggest to new bugs in future): - // maintain same names -> build_id instead of buildID, and so on. - // A change was also needed on JS support function openExportTestPlan(). - // ------------------------------------------------------------------------------------------------ - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - $args->build_id = isset($_REQUEST['build_id']) ? intval($_REQUEST['build_id']) : 0; - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - $args->platform_id = isset($_REQUEST['platform_id']) ? intval($_REQUEST['platform_id']) : 0; - - $args->export_filename = isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; - $args->export_filename = trim($args->export_filename); - - // replace blank on name with _ - if( !is_null($args->export_filename) ) - { - $args->export_filename = str_replace(' ','_',$args->export_filename); - } - - $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - // TICKET 6498: Cross-Site Scripting on /lib/plan/planExport.php (CWE-80) - $default = 'linkedItems'; - $args->exportContent = isset($_REQUEST['exportContent']) ? substr($_REQUEST['exportContent'],0,strlen($default)) : $default; - switch ($args->exportContent) - { - case 'tree': - case '4results': - case 'linkedItems': - break; - - default: - $args->exportContent = $default; - break; - } - - // Vulnerable ? - $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $args->testCaseSet = null; - if($args->treeFormToken >0) - { - $mode = 'execution_mode'; - $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$args->treeFormToken]) ? - $_SESSION[$mode][$args->treeFormToken] : null; - - $args->testCaseSet = $session_data['testcases_to_show']; - } - return $args; -} - - -/** - * - * - */ -function initializeGui(&$argsObj,&$tplanMgr) -{ - $info = $tplanMgr->get_by_id($argsObj->tplan_id, array('output' => 'minimun','caller' => __LINE__)); - $add2name = ''; - - $guiObj = new stdClass(); - $guiObj->do_it = 1; - $guiObj->nothing_todo_msg = ''; - $guiObj->closeOnCancel = $argsObj->closeOnCancel; - - // If there is a platform setted -> use in name. - if( $argsObj->platform_id > 0 ) - { - $dummy = $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'mapAccessByID')); - $add2name .= '_' . str_replace(' ','_',$dummy[$argsObj->platform_id]['name']); - } - // If there is a build setted -> use in name. - if( $argsObj->build_id > 0 ) - { - $dummy = $tplanMgr->get_builds($argsObj->tplan_id); - $add2name .= '_' . str_replace(' ','_',$dummy[$argsObj->build_id]['name']); - } - - // TICKET 4996: Ignores change of XML export file name - $guiObj->export_filename = $argsObj->export_filename; - if( trim($argsObj->export_filename) == '' ) - { - $guiObj->export_filename = $argsObj->exportContent . '_' . str_replace(' ','_',$info['name']) . $add2name . '.xml'; - } - - $guiObj->exportTypes = array('XML' => 'XML'); - $guiObj->page_title = lang_get('export_test_plan'); - $guiObj->object_name = $info['name']; - $guiObj->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - - $guiObj->tplan_id = intval($argsObj->tplan_id); - $guiObj->tproject_id = intval($argsObj->tproject_id); - $guiObj->platform_id = intval($argsObj->platform_id); - $guiObj->build_id = intval($argsObj->build_id); - $guiObj->exportContent = $argsObj->exportContent; - $guiObj->treeFormToken = $argsObj->treeFormToken; - - return $guiObj; -} \ No newline at end of file diff --git a/lib/plan/planImport.php b/lib/plan/planImport.php index 891df1fc37..3b616c2a76 100644 --- a/lib/plan/planImport.php +++ b/lib/plan/planImport.php @@ -1,512 +1,544 @@ - $dest_common . ".xml"); -$input_file = $dest_files['XML']; - -if(!is_null($args->importType)) -{ - $input_file = $dest_files[$args->importType]; -} - -$gui->file_check = array('status_ok' => 1, 'msg' => 'ok'); -$gui->import_title = lang_get('title_import_testplan_links'); - -// This check is done againg, also on importTestPlanLinksFromXML(), just to avoid surprises -$tproject_mgr = new testproject($db); -$dummy = $tproject_mgr->get_by_id($args->tproject_id); -$tprojectHasTC = $tproject_mgr->count_testcases($args->tproject_id) > 0; -if(!$tprojectHasTC) -{ - $gui->resultMap[] = array('',sprintf(lang_get('tproject_has_zero_testcases'),$dummy['name'])); -} - - -if ($args->do_upload) -{ - - // check the uploaded file - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - - $doIt = false; - $gui->file_check = null; - if (($source != 'none') && ($source != '')) - { - // ATTENTION: - // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using - // Firefox and Chrome. - if( !($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes) ) - { - $gui->file_check['status_ok'] = 0; - $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'),$_FILES['uploadedFile']['size'],$gui->importLimitBytes); - } - } - if($doIt) - { - $gui->file_check['status_ok'] = 1; - if (move_uploaded_file($source, $input_file)) - { - switch($args->importType) - { - case 'XML': - $pimport_fn = "importTestPlanLinksFromXML"; - break; - } - } - if($gui->file_check['status_ok'] && $pimport_fn) - { - $context = new stdClass(); - $context->tproject_id = $args->tproject_id; - $context->tplan_id = $args->tplan_id; - $context->userID = $args->userID; - $gui->resultMap = $pimport_fn($db,$tplan_mgr,$input_file,$context); - } - } - else if(is_null($gui->file_check)) - { - $gui->file_check = array('status_ok' => 0, 'msg' => lang_get('please_choose_file_to_import')); - $args->importType = null; - } -} - -$gui->testprojectName = $_SESSION['testprojectName']; -$gui->importTypes = $tplan_mgr->get_import_file_types(); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * called magically by TL to check if user trying to use this feature - * has enough rights. - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'mgt_testplan_create'); -} - -/** - * process input data, creating a kind of namespace - * - * @global array _REQUEST - * - * @internal Revisions - * 20101017 - franciscom - creation - */ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; - $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; - $args->do_upload = isset($_REQUEST['uploadFile']) ? 1 : 0; - - $args->userID = intval($_SESSION['userID']); - $args->tproject_id = $_SESSION['testprojectID']; - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - - return $args; -} - - -/** - * - */ -function initializeGui(&$argsObj,&$tplanMgr) -{ - $guiObj = new stdClass(); - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); - $guiObj->resultMap = null; - - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->main_descr = lang_get('testplan') . ' ' . $info['name']; - $guiObj->tplan_id = intval($argsObj->tplan_id); - $guiObj->import_done = false; - return $guiObj; -} - - -/** - * @internal revisions - */ -function importTestPlanLinksFromXML(&$dbHandler,&$tplanMgr,$targetFile,$contextObj) -{ - // - // - // - // - // - // - // - // - // ... - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // ... - // - // - // - // - $msg = array(); - $labels = init_labels(array('link_without_required_platform' => null, 'ok' => null, - 'link_without_platform_element' => null, - 'no_platforms_on_tproject' => null, 'tcase_link_updated' => null, - 'link_with_platform_not_needed' => null, - 'tproject_has_zero_testcases' => null, - 'platform_not_on_tproject' => null, 'platform_linked' => null, - 'platform_not_linked' => null, 'tcase_doesnot_exist' => null, - 'tcversion_doesnot_exist' => null, 'not_imported' => null, - 'link_to_tplan_feedback' => null, 'link_to_platform' => null, - 'tcversion_status_forbidden' => null, - 'cant_link_to_tplan_feedback' => null)); - - // Double Check - // Check if Test Plan Parent (Test Project) has testcases, if not abort - $tprojectMgr = new testproject($dbHandler); - $tprojectInfo = $tprojectMgr->get_by_id($contextObj->tproject_id); - $tcasePrefix = $tprojectInfo['prefix'] . config_get('testcase_cfg')->glue_character; - - $tprojectHasTC = $tprojectMgr->count_testcases($contextObj->tproject_id) > 0; - if(!$tprojectHasTC) - { - $msg[] = array(sprintf($labels['tproject_has_zero_testcases'],$tprojectInfo['name']),$labels['not_imported']); - return $msg; // >>>-----> Bye - } - - $xml = @simplexml_load_file_wrapper($targetFile); - if($xml !== FALSE) - { - $tcaseMgr = new testcase($dbHandler); - $tcaseSet = array(); - $tprojectMgr->get_all_testcases_id($contextObj->tproject_id,$tcaseSet,array('output' => 'external_id')); - $tcaseSet = array_flip($tcaseSet); - - // Test Plan name will not be used - // - // - // Platform definition info will not be used - // - // I will try to link the platforms if are defined - $status_ok = true; - if (property_exists($xml,'platforms')) { - $platformMgr = new tlPlatform($dbHandler,$contextObj->tproject_id); - $platformUniverse = $platformMgr->getAllAsMap(); - if (is_null($platformUniverse)) { - $status_ok = false; - $msg[] = array($labels['no_platforms_on_tproject'],$labels['not_imported']); - } else { - $platformUniverse = array_flip($platformUniverse); - $op = processPlatforms($platformMgr,$tplanMgr,$platformUniverse,$xml->platforms, - $labels,$contextObj->tplan_id); - $status_ok = $op['status_ok']; - $msg = $op['msg']; - } - } - - if( $status_ok && $xml->xpath('//executables') ) - { - $tables = tlObjectWithDB::getDBTables(array('testplan_tcversions')); - $platformSet = $tplanMgr->getPlatforms($contextObj->tplan_id,array('outputFormat' => 'mapAccessByName')); - $targetHasPlatforms = (count($platformSet) > 0); - - $xmlLinks = $xml->executables->children(); - $loops2do = count($xmlLinks); - - // new dBug($platformSet); - $tplanDesignCfg = config_get('tplanDesign'); - - for($idx = 0; $idx < $loops2do; $idx++) - { - // if Target Test Plan has platforms and importing file NO => Fatal Error - $targetName = null; - $platformID = -1; - $linkWithPlatform = false; - $status_ok = false; - $dummy_msg = null; - $import_status = $labels['ok'];; - - if( ($platformElementExists = property_exists($xmlLinks[$idx],'platform')) ) - { - $targetName = trim((string)$xmlLinks[$idx]->platform->name); - $linkWithPlatform = ($targetName != ''); - } - - // echo "\$targetHasPlatforms:$targetHasPlatforms
    "; - // echo "\$linkWithPlatform:$linkWithPlatform
    "; - if($targetHasPlatforms) - { - // each link need to have platform or will not be imported - if( $linkWithPlatform && isset($platformSet[$targetName])) - { - $platformID = $platformSet[$targetName]['id']; - $status_ok = true; - $dummy_msg = null; - } - else - { - $import_status = $labels['not_imported']; - if( !$platformElementExists ) - { - $dummy_msg = sprintf($labels['link_without_platform_element'],$idx+1); - } - else if(!$linkWithPlatform) - { - $dummy_msg = sprintf($labels['link_without_required_platform'],$idx+1); - } - else - { - $dummy_msg = sprintf($labels['platform_not_linked'],$idx+1,$targetName,$contextObj->tplan_name); - } - } - } - else - { - if( $linkWithPlatform ) - { - $import_status = $labels['not_imported']; - $dummy_msg = sprintf($labels['link_with_platform_not_needed'],$idx+1); - } - else - { - $platformID = 0; - $status_ok = true; - } - } - if( !is_null($dummy_msg) ) - { - $msg[] = array($dummy_msg,$import_status); - } - - // echo '$status_ok' . $status_ok . ' ' . __LINE__ . '
    ' ; - if( $status_ok ) - { - $createLink = false; - $updateLink = false; - - // Link passed ok check on platform - // Now we need to understand if requested Test case is present on Test Project - $externalID = (int)$xmlLinks[$idx]->testcase->externalid; - $tcaseName = (string)$xmlLinks[$idx]->testcase->name; - $execOrder = (int)$xmlLinks[$idx]->testcase->execution_order; - $version = (int)$xmlLinks[$idx]->testcase->version; - - if( isset($tcaseSet[$externalID] ) ) - { - // now need to check if requested version exists - $dummy = $tcaseMgr->get_basic_info($tcaseSet[$externalID], - array('number' => $version)); - - if( count($dummy) > 0 ) - { - // Check : - // for same test plan there is a different version already linked ? - // if YES => error. - // - $lvFilters = array('tplan_id' => $contextObj->tplan_id); - $linkedVersions = $tcaseMgr->get_linked_versions($dummy[0]['id'],$lvFilters); - $updateLink = false; - $doUpdateFeedBack = true; - - if( !($createLink = is_null($linkedVersions)) ) - { - // Now need to understand if is already linked with this signature. - if( !isset($linkedVersions[$dummy[0]['tcversion_id']]) ) - { - // need to check if tc version status allows link to test plan - $createLink = !isset($tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]); - if($createLink == FALSE) - { - // see const.inc.php - $rogue = 'testCaseStatus_' . - $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]; - - $dummy_msg = sprintf($labels['cant_link_to_tplan_feedback'], $externalID, $version); - - $msg[] = array($dummy_msg, - sprintf($labels['tcversion_status_forbidden'],lang_get($rogue))); - } - } - else - { - // linked platforms - $createLink = false; - $updateLink = false; - $plat_keys = array_keys($linkedVersions[$dummy[0]['tcversion_id']][$contextObj->tplan_id]); - $plat_keys = array_flip($plat_keys); - - if( isset($plat_keys[$platformID]) ) - { - $updateLink = true; - } - else if ($platformID == 0 ) - { - // User request to add without platform, but platforms exist => SKIP - $msg[] = array('platform 0 missing messages',$labels['not_imported']); - } - else - { - $createLink = true; - } - } - } - - - if( $createLink ) - { - $createLink = !isset($tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]); - if($createLink == FALSE) - { - // see const.inc.php - $rogue = 'testCaseStatus_' . - $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]; - - $dummy_msg = sprintf($labels['cant_link_to_tplan_feedback'], $externalID, $version); - - $msg[] = array($dummy_msg, - sprintf($labels['tcversion_status_forbidden'],lang_get($rogue))); - } - } - - if( $createLink ) - { - $item2link['items'] = array($dummy[0]['id'] => array($platformID => $dummy[0]['tcversion_id'])); - $item2link['tcversion'] = array($dummy[0]['id'] => $dummy[0]['tcversion_id']); - $tplanMgr->link_tcversions($contextObj->tplan_id,$item2link,$contextObj->userID); - $dummy_msg = sprintf($labels['link_to_tplan_feedback'], $externalID, $version); - - if( $platformID > 0 ) - { - $dummy_msg .= sprintf($labels['link_to_platform'],$targetName); - } - $msg[] = array($dummy_msg,$labels['ok']); - - // TICKET 5189: Import a test plan does not import test cases execution order - $updateLink = true; - $doUpdateFeedBack = false; - } - - if( $updateLink ) - { - $newOrder = array( $dummy[0]['tcversion_id'] => $execOrder); - $tplanMgr->setExecutionOrder($contextObj->tplan_id,$newOrder); - - if( $doUpdateFeedBack ) - { - $dummy_msg = sprintf($labels['tcase_link_updated'],$tcasePrefix . $externalID . ' ' . - $tcaseName,$version); - $msg[] = array($dummy_msg,$labels['ok']); - } - } - } - else - { - $msg[] = array(sprintf($labels['tcversion_doesnot_exist'],$externalID,$version,$tprojectInfo['name'])); - } - } - else - { - $msg[] = array(sprintf($labels['tcase_doesnot_exist'],$externalID,$tprojectInfo['name'])); - } - //$tcaseMgr->get_by_external - - // echo '
    ';
    -          // var_dump($xmlLinks[$idx]->testcase);
    -          // echo 'TCBAME' . (string)$xmlLinks[$idx]->testcase->name;     
    -          // echo '
    '; - } - - } - } - } - return $msg; -} - -/** - * - */ -function processPlatforms(&$platMgr,&$tplanMgr,$universe,$xmlSubset,$lbl,$tplanID) -{ - $ret = array('status_ok' => true, 'msg' => null); - $children = $xmlSubset->children(); - $msg_ok = array(); - $loops2do = count($children); - $status_ok = true; - $idSet = null; - for($idx = 0; $idx < $loops2do; $idx++) - { - $targetName = trim((string)$children[$idx]->name); - if( isset($universe[$targetName]) ) - { - $status_ok = $status_ok && true; - // $msg_ok[] = array(sprintf($lbl['platform_linked'],$targetName),$lbl['ok']); - $idSet[$universe[$targetName]] = $targetName; - } - else - { - $status_ok = false; - $ret['msg'][] = array(sprintf($lbl['platform_not_on_tproject'],$targetName),$lbl['not_imported']); - - } - } - if( $status_ok ) - { - - // Now Link only if Platform is not already linked to test plan - $currentPlatformSet = $tplanMgr->getPlatforms($tplanID,array('outputFormat' => 'mapAccessByID')); - foreach($idSet as $platformID => $platformName) - { - if( !isset($currentPlatformSet[$platformID]) ) - { - $platMgr->linkToTestplan($platformID, $tplanID); - $msg_ok[] = array(sprintf($lbl['platform_linked'],$platformName),$lbl['ok']); - } - } - $ret['msg'] = $msg_ok; - } - return $ret; + $dest_common . ".xml" +); +$input_file = $dest_files['XML']; + +if (! is_null($args->importType)) { + $input_file = $dest_files[$args->importType]; +} + +$gui->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' +); +$gui->import_title = lang_get('title_import_testplan_links'); + +// This check is done againg, also on importTestPlanLinksFromXML(), just to avoid surprises +$tproject_mgr = new testproject($db); +$dummy = $tproject_mgr->get_by_id($args->tproject_id); +$tprojectHasTC = $tproject_mgr->count_testcases($args->tproject_id) > 0; +if (! $tprojectHasTC) { + $gui->resultMap[] = array( + '', + sprintf(lang_get('tproject_has_zero_testcases'), $dummy['name']) + ); +} + +if ($args->do_upload) { + + // check the uploaded file + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + + $doIt = false; + $gui->file_check = null; + // ATTENTION: + // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using + // Firefox and Chrome. + if (($source != 'none') && ($source != '') && + ! ($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes)) { + $gui->file_check['status_ok'] = 0; + $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'), + $_FILES['uploadedFile']['size'], $gui->importLimitBytes); + } + if ($doIt) { + $gui->file_check['status_ok'] = 1; + if (move_uploaded_file($source, $input_file)) { + switch ($args->importType) { + case 'XML': + $pimport_fn = "importTestPlanLinksFromXML"; + break; + } + } + if ($gui->file_check['status_ok'] && $pimport_fn) { + $context = new stdClass(); + $context->tproject_id = $args->tproject_id; + $context->tplan_id = $args->tplan_id; + $context->userID = $args->userID; + $gui->resultMap = $pimport_fn($db, $tplan_mgr, $input_file, $context); + } + } elseif (is_null($gui->file_check)) { + $gui->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + $args->importType = null; + } +} + +$gui->testprojectName = $_SESSION['testprojectName']; +$gui->importTypes = $tplan_mgr->get_import_file_types(); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * called magically by TL to check if user trying to use this feature + * has enough rights. + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_testplan_create'); +} + +/** + * process input data, creating a kind of namespace + * + * @global array _REQUEST + * + * @internal Revisions + * 20101017 - franciscom - creation + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; + $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; + $args->do_upload = isset($_REQUEST['uploadFile']) ? 1 : 0; + + $args->userID = intval($_SESSION['userID']); + $args->tproject_id = $_SESSION['testprojectID']; + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$tplanMgr) +{ + $guiObj = new stdClass(); + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); + $guiObj->resultMap = null; + + $info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->main_descr = lang_get('testplan') . ' ' . $info['name']; + $guiObj->tplan_id = intval($argsObj->tplan_id); + $guiObj->import_done = false; + return $guiObj; +} + +/** + * + * @internal revisions + */ +function importTestPlanLinksFromXML(&$dbHandler, &$tplanMgr, $targetFile, + $contextObj) +{ + // + // + // + // + // + // + // + // + // ... + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // ... + // + // + // + // + $msg = array(); + $labels = init_labels( + array( + 'link_without_required_platform' => null, + 'ok' => null, + 'link_without_platform_element' => null, + 'no_platforms_on_tproject' => null, + 'tcase_link_updated' => null, + 'link_with_platform_not_needed' => null, + 'tproject_has_zero_testcases' => null, + 'platform_not_on_tproject' => null, + 'platform_linked' => null, + 'platform_not_linked' => null, + 'tcase_doesnot_exist' => null, + 'tcversion_doesnot_exist' => null, + 'not_imported' => null, + 'link_to_tplan_feedback' => null, + 'link_to_platform' => null, + 'tcversion_status_forbidden' => null, + 'cant_link_to_tplan_feedback' => null + )); + + // Double Check + // Check if Test Plan Parent (Test Project) has testcases, if not abort + $tprojectMgr = new testproject($dbHandler); + $tprojectInfo = $tprojectMgr->get_by_id($contextObj->tproject_id); + $tcasePrefix = $tprojectInfo['prefix'] . + config_get('testcase_cfg')->glue_character; + + $tprojectHasTC = $tprojectMgr->count_testcases($contextObj->tproject_id) > 0; + if (! $tprojectHasTC) { + $msg[] = array( + sprintf($labels['tproject_has_zero_testcases'], + $tprojectInfo['name']), + $labels['not_imported'] + ); + return $msg; + } + + $xml = @simplexml_load_file_wrapper($targetFile); + if ($xml !== false) { + $tcaseMgr = new testcase($dbHandler); + $tcaseSet = array(); + $tprojectMgr->get_all_testcases_id($contextObj->tproject_id, $tcaseSet, + array( + 'output' => 'external_id' + )); + $tcaseSet = array_flip($tcaseSet); + + // Test Plan name will not be used + // + // + // Platform definition info will not be used + // + // I will try to link the platforms if are defined + $status_ok = true; + if (property_exists($xml, 'platforms')) { + $platformMgr = new tlPlatform($dbHandler, $contextObj->tproject_id); + $platformUniverse = $platformMgr->getAllAsMap(); + if (is_null($platformUniverse)) { + $status_ok = false; + $msg[] = array( + $labels['no_platforms_on_tproject'], + $labels['not_imported'] + ); + } else { + $platformUniverse = array_flip($platformUniverse); + $op = processPlatforms($platformMgr, $tplanMgr, + $platformUniverse, $xml->platforms, $labels, + $contextObj->tplan_id); + $status_ok = $op['status_ok']; + $msg = $op['msg']; + } + } + + if ($status_ok && $xml->xpath('//executables')) { + $platformSet = $tplanMgr->getPlatforms($contextObj->tplan_id, + array( + 'outputFormat' => 'mapAccessByName' + )); + $targetHasPlatforms = (! empty($platformSet)); + + $xmlLinks = $xml->executables->children(); + $loops2do = count($xmlLinks); + + $tplanDesignCfg = config_get('tplanDesign'); + + for ($idx = 0; $idx < $loops2do; $idx ++) { + // if Target Test Plan has platforms and importing file NO => Fatal Error + $targetName = null; + $platformID = - 1; + $linkWithPlatform = false; + $status_ok = false; + $dummy_msg = null; + $import_status = $labels['ok']; + + if ($platformElementExists = property_exists($xmlLinks[$idx], + 'platform')) { + $targetName = trim((string) $xmlLinks[$idx]->platform->name); + $linkWithPlatform = ($targetName != ''); + } + + if ($targetHasPlatforms) { + // each link need to have platform or will not be imported + if ($linkWithPlatform && isset($platformSet[$targetName])) { + $platformID = $platformSet[$targetName]['id']; + $status_ok = true; + $dummy_msg = null; + } else { + $import_status = $labels['not_imported']; + if (! $platformElementExists) { + $dummy_msg = sprintf( + $labels['link_without_platform_element'], + $idx + 1); + } elseif (! $linkWithPlatform) { + $dummy_msg = sprintf( + $labels['link_without_required_platform'], + $idx + 1); + } else { + $dummy_msg = sprintf($labels['platform_not_linked'], + $idx + 1, $targetName, $contextObj->tplan_name); + } + } + } else { + if ($linkWithPlatform) { + $import_status = $labels['not_imported']; + $dummy_msg = sprintf( + $labels['link_with_platform_not_needed'], $idx + 1); + } else { + $platformID = 0; + $status_ok = true; + } + } + if (! is_null($dummy_msg)) { + $msg[] = array( + $dummy_msg, + $import_status + ); + } + + if ($status_ok) { + $createLink = false; + $updateLink = false; + + // Link passed ok check on platform + // Now we need to understand if requested Test case is present on Test Project + $externalID = (int) $xmlLinks[$idx]->testcase->externalid; + $tcaseName = (string) $xmlLinks[$idx]->testcase->name; + $execOrder = (int) $xmlLinks[$idx]->testcase->execution_order; + $version = (int) $xmlLinks[$idx]->testcase->version; + + if (isset($tcaseSet[$externalID])) { + // now need to check if requested version exists + $dummy = $tcaseMgr->get_basic_info( + $tcaseSet[$externalID], + array( + 'number' => $version + )); + + if (! empty($dummy)) { + // Check : + // for same test plan there is a different version already linked ? + // if YES => error. + // + $lvFilters = array( + 'tplan_id' => $contextObj->tplan_id + ); + $linkedVersions = $tcaseMgr->get_linked_versions( + $dummy[0]['id'], $lvFilters); + $updateLink = false; + $doUpdateFeedBack = true; + + if (! ($createLink = is_null($linkedVersions))) { + // Now need to understand if is already linked with this signature. + if (! isset( + $linkedVersions[$dummy[0]['tcversion_id']])) { + // need to check if tc version status allows link to test plan + $createLink = ! isset( + $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]); + if (! $createLink) { + // see const.inc.php + $rogue = 'testCaseStatus_' . + $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]; + + $dummy_msg = sprintf( + $labels['cant_link_to_tplan_feedback'], + $externalID, $version); + + $msg[] = array( + $dummy_msg, + sprintf( + $labels['tcversion_status_forbidden'], + lang_get($rogue)) + ); + } + } else { + // linked platforms + $createLink = false; + $updateLink = false; + $plat_keys = array_keys( + $linkedVersions[$dummy[0]['tcversion_id']][$contextObj->tplan_id]); + $plat_keys = array_flip($plat_keys); + + if (isset($plat_keys[$platformID])) { + $updateLink = true; + } elseif ($platformID == 0) { + // User request to add without platform, but platforms exist => SKIP + $msg[] = array( + 'platform 0 missing messages', + $labels['not_imported'] + ); + } else { + $createLink = true; + } + } + } + + if ($createLink) { + $createLink = ! isset( + $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]); + if (! $createLink) { + // see const.inc.php + $rogue = 'testCaseStatus_' . + $tplanDesignCfg->hideTestCaseWithStatusIn[$dummy[0]['status']]; + + $dummy_msg = sprintf( + $labels['cant_link_to_tplan_feedback'], + $externalID, $version); + + $msg[] = array( + $dummy_msg, + sprintf( + $labels['tcversion_status_forbidden'], + lang_get($rogue)) + ); + } + } + + if ($createLink) { + $item2link['items'] = array( + $dummy[0]['id'] => array( + $platformID => $dummy[0]['tcversion_id'] + ) + ); + $item2link['tcversion'] = array( + $dummy[0]['id'] => $dummy[0]['tcversion_id'] + ); + $tplanMgr->link_tcversions( + $contextObj->tplan_id, $item2link, + $contextObj->userID); + $dummy_msg = sprintf( + $labels['link_to_tplan_feedback'], + $externalID, $version); + + if ($platformID > 0) { + $dummy_msg .= sprintf( + $labels['link_to_platform'], $targetName); + } + $msg[] = array( + $dummy_msg, + $labels['ok'] + ); + + // TICKET 5189: Import a test plan does not import test cases execution order + $updateLink = true; + $doUpdateFeedBack = false; + } + + if ($updateLink) { + $newOrder = array( + $dummy[0]['tcversion_id'] => $execOrder + ); + $tplanMgr->setExecutionOrder( + $contextObj->tplan_id, $newOrder); + + if ($doUpdateFeedBack) { + $dummy_msg = sprintf( + $labels['tcase_link_updated'], + $tcasePrefix . $externalID . ' ' . + $tcaseName, $version); + $msg[] = array( + $dummy_msg, + $labels['ok'] + ); + } + } + } else { + $msg[] = array( + sprintf($labels['tcversion_doesnot_exist'], + $externalID, $version, $tprojectInfo['name']) + ); + } + } else { + $msg[] = array( + sprintf($labels['tcase_doesnot_exist'], $externalID, + $tprojectInfo['name']) + ); + } + } + } + } + } + return $msg; +} + +/** + */ +function processPlatforms(&$platMgr, &$tplanMgr, $universe, $xmlSubset, $lbl, + $tplanID) +{ + $ret = array( + 'status_ok' => true, + 'msg' => null + ); + $children = $xmlSubset->children(); + $msg_ok = array(); + $loops2do = count($children); + $status_ok = true; + $idSet = null; + for ($idx = 0; $idx < $loops2do; $idx ++) { + $targetName = trim((string) $children[$idx]->name); + if (isset($universe[$targetName])) { + $status_ok = true; + $idSet[$universe[$targetName]] = $targetName; + } else { + $status_ok = false; + $ret['msg'][] = array( + sprintf($lbl['platform_not_on_tproject'], $targetName), + $lbl['not_imported'] + ); + } + } + if ($status_ok) { + + // Now Link only if Platform is not already linked to test plan + $currentPlatformSet = $tplanMgr->getPlatforms($tplanID, + array( + 'outputFormat' => 'mapAccessByID' + )); + foreach ($idSet as $platformID => $platformName) { + if (! isset($currentPlatformSet[$platformID])) { + $platMgr->linkToTestplan($platformID, $tplanID); + $msg_ok[] = array( + sprintf($lbl['platform_linked'], $platformName), + $lbl['ok'] + ); + } + } + $ret['msg'] = $msg_ok; + } + return $ret; } diff --git a/lib/plan/planMilestonesCommands.class.php b/lib/plan/planMilestonesCommands.class.php index f08cf34677..88fa7de8c6 100644 --- a/lib/plan/planMilestonesCommands.class.php +++ b/lib/plan/planMilestonesCommands.class.php @@ -1,316 +1,325 @@ -db = $db; - $this->milestone_mgr = new milestone_mgr($db); - $this->submit_button_label = lang_get('btn_save'); - } - - function setAuditContext($auditContext) - { - $this->auditContext = $auditContext; - } - - /* - function: create - - args: - - returns: - - */ - function create(&$argsObj) - { - $guiObj = new stdClass(); - $guiObj->main_descr = lang_get('testplan') . TITLE_SEP; - $guiObj->action_descr = lang_get('create_milestone'); - $guiObj->template = $this->defaultTemplate; - $guiObj->submit_button_label = $this->submit_button_label; - $guiObj->milestone = array('id' => 0, 'name' => '', 'target_date' => '', - 'start_date' => '', - 'high_percentage' => '', 'medium_percentage' => '', - 'low_percentage' => '', - 'testplan_id' => $argsObj->tplan_id, - 'testplan_name' => $argsObj->tplan_name,); - return $guiObj; - } - - /* - function: edit - - args: - - returns: - - */ - function edit(&$argsObj) - { - $guiObj = new stdClass(); - $dummy = $this->milestone_mgr->get_by_id($argsObj->id); - $guiObj->milestone = $dummy[$argsObj->id]; - - // $dummyy necessary because localize_dateOrTimeStamp wants second parameter to be passed by reference - $dummy = null; - - // localize target date (is always set on edit) - $guiObj->milestone['target_date'] = localize_dateOrTimeStamp(null, $dummy, 'date_format',$guiObj->milestone['target_date']); - - // as start date is optional it can be "0000-00-00" (default timestamp) - if ($guiObj->milestone['start_date'] != "0000-00-00") - { - $guiObj->milestone['start_date'] = localize_dateOrTimeStamp(null, $dummy, 'date_format',$guiObj->milestone['start_date']); - } - else - { - $guiObj->milestone['start_date'] = ""; - } - - $guiObj->main_descr = lang_get('testplan') . TITLE_SEP; - $guiObj->action_descr = sprintf(lang_get('edit_milestone'),$guiObj->milestone['name']); - $guiObj->template = $this->defaultTemplate; - $guiObj->submit_button_label = $this->submit_button_label; - return $guiObj; - } - - - /* - function: doCreate - - args: - - returns: - - */ - function doCreate(&$argsObj,$basehref) - { - $date_format_cfg = config_get('date_format'); - $guiObj = new stdClass(); - $guiObj->main_descr = lang_get('Milestone') . TITLE_SEP; - $guiObj->action_descr = lang_get('create_milestone'); - $guiObj->submit_button_label=$this->submit_button_label; - $guiObj->template = null; - $op_ok = 1; - - // Check name do not exists - $name_exists = $this->milestone_mgr->check_name_existence($argsObj->tplan_id,$argsObj->name); - if($name_exists) - { - $guiObj->user_feedback = sprintf(lang_get('milestone_name_already_exists'),$argsObj->name); - $op_ok=0; - } - - // BUGID 3716 - // are the dates valid? - if ($op_ok) { - // start date is optional - $op_ok = is_valid_date($argsObj->target_date_original, $date_format_cfg) && - ($argsObj->start_date_original == '' || is_valid_date($argsObj->start_date_original, $date_format_cfg)); - if (!$op_ok) { - $guiObj->user_feedback = sprintf(lang_get('warning_invalid_date')); - } - } - - // check target date - if($op_ok) - { - $timestamp=array(); - $timestamp['target'] = strtotime($argsObj->target_date . " 23:59:59"); - $timestamp['now'] = strtotime("now"); - - if( $timestamp['target'] < $timestamp['now'] ) - { - $op_ok=0; - $guiObj->user_feedback = lang_get('warning_milestone_date'); - } - } - - // BUGID 3829 - check target date > start date - if($op_ok && isset($argsObj->start_date)) { - $timestamp['target'] = strtotime($argsObj->target_date . " 23:59:59"); - $timestamp['start'] = strtotime($argsObj->start_date . " 23:59:59"); - - // target must be chronologically after start - if( $timestamp['target'] < $timestamp['start'] ) - { - $op_ok=0; - $guiObj->user_feedback = lang_get('warning_target_before_start'); - } - } - - if($op_ok) - { - // avoid warning on event viewer - if (!isset($argsObj->start_date)) { - $argsObj->start_date = ""; - } - /* - $argsObj->id = $this->milestone_mgr->create($argsObj->tplan_id,$argsObj->name, - $argsObj->target_date,$argsObj->start_date, - $argsObj->low_priority_tcases, - $argsObj->medium_priority_tcases, - $argsObj->high_priority_tcases); - */ - $argsObj->low_priority = $argsObj->low_priority_tcases; - $argsObj->medium_priority = $argsObj->medium_priority_tcases; - $argsObj->high_priority = $argsObj->high_priority_tcases; - - $argsObj->id = $this->milestone_mgr->create($argsObj); - - $guiObj->user_feedback = 'ok'; - if($argsObj->id > 0) - { - logAuditEvent(TLS("audit_milestone_created",$argsObj->tplan_name,$argsObj->name), - "CREATE",$argsObj->id,"milestones"); - $guiObj->user_feedback = sprintf(lang_get('milestone_created'), $argsObj->name); - $guiObj->template = $basehref . $this->viewAction; - } - } - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$basehref) - { - $date_format_cfg = config_get('date_format'); - $obj=new stdClass(); - $descr_prefix = lang_get('Milestone') . TITLE_SEP; - $obj=$this->edit($argsObj); - $obj->user_feedback = 'ok'; - $obj->template = null; - $dummy = $this->milestone_mgr->get_by_id($argsObj->id); - $originalMilestone = $dummy[$argsObj->id]; - - $op_ok=1; - - // Check name do not exists - $name_exists = $this->milestone_mgr->check_name_existence($originalMilestone['testplan_id'], - $argsObj->name,$argsObj->id); - if($name_exists) - { - $obj->user_feedback = sprintf(lang_get('milestone_name_already_exists'),$argsObj->name); - $op_ok=0; - } - - // BUGID 3716 - // are the dates valid? - if ($op_ok) { - // start date is optional - $op_ok = is_valid_date($argsObj->target_date_original, $date_format_cfg) && - ($argsObj->start_date_original == '' || is_valid_date($argsObj->start_date_original, $date_format_cfg)); - - if (!$op_ok) { - $obj->user_feedback = lang_get('warning_invalid_date'); - } - } - - // target date changed ? - if($op_ok) - { - $timestamp=array(); - $timestamp['target'] = strtotime($argsObj->target_date ." 23:59:59"); - $timestamp['original_target'] = strtotime($originalMilestone['target_date'] ." 23:59:59"); - $timestamp['now'] = strtotime("now"); - - if( ($timestamp['target'] != $timestamp['original_target']) && $timestamp['target'] < $timestamp['now'] ) - { - $op_ok=0; - $obj->user_feedback = lang_get('warning_milestone_date'); - } - } - - // BUGID 3829 - check target date > start date - if($op_ok && isset($argsObj->start_date)) { - $timestamp['target'] = strtotime($argsObj->target_date . " 23:59:59"); - $timestamp['start'] = strtotime($argsObj->start_date . " 23:59:59"); - - // target must be chronologically after start - if( $timestamp['target'] < $timestamp['start'] ) - { - $op_ok=0; - $obj->user_feedback = lang_get('warning_target_before_start'); - } - } - - if($op_ok) - { - // BUGID 3907 - start date is optional -> if empty set to default date - if (!isset($argsObj->start_date) || $argsObj->start_date == "") { - $argsObj->start_date = "0000-00-00"; - } - - $op_ok = $this->milestone_mgr->update($argsObj->id,$argsObj->name,$argsObj->target_date, - $argsObj->start_date,$argsObj->low_priority_tcases,$argsObj->medium_priority_tcases, - $argsObj->high_priority_tcases); - } - if($op_ok) - { - $obj->main_descr = ''; - $obj->action_descr=''; - $obj->template = "planMilestonesView.php"; - logAuditEvent(TLS("audit_milestone_saved",$argsObj->tplan_name,$argsObj->name), - "SAVE",$argsObj->id,"milestones"); - } - else - { - // Action has failed => no change done on DB. - $obj->main_descr = $descr_prefix . $originalMilestone['name']; - } - - return $obj; - } - - - /* - function: doDelete - - args: - - returns: object with info useful to manage user interface - - */ - function doDelete(&$argsObj,$basehref) - { - $dummy = $this->milestone_mgr->get_by_id($argsObj->id); - $milestone = $dummy[$argsObj->id]; - - $this->milestone_mgr->delete($argsObj->id); - logAuditEvent(TLS("audit_milestone_deleted",$milestone['testplan_name'],$milestone['name']), - "DELETE",$argsObj->id,"milestones"); - - $obj = new stdClass(); - $obj->template = $basehref . $this->viewAction; - $obj->user_feedback = sprintf(lang_get('milestone_deleted'),$milestone['name']); - $obj->main_descr = null; - $obj->title = lang_get('delete_milestone'); - - return $obj; - } -} -?> \ No newline at end of file +db = $db; + $this->milestone_mgr = new milestone_mgr($db); + $this->submit_button_label = lang_get('btn_save'); + } + + private function setAuditContext($auditContext) + { + $this->auditContext = $auditContext; + } + + /* + * function: create + * + * args: + * + * returns: + * + */ + public function create(&$argsObj) + { + $guiObj = new stdClass(); + $guiObj->main_descr = lang_get('testplan') . TITLE_SEP; + $guiObj->action_descr = lang_get('create_milestone'); + $guiObj->template = $this->defaultTemplate; + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->milestone = array( + 'id' => 0, + 'name' => '', + 'target_date' => '', + 'start_date' => '', + 'high_percentage' => '', + 'medium_percentage' => '', + 'low_percentage' => '', + 'testplan_id' => $argsObj->tplan_id, + 'testplan_name' => $argsObj->tplan_name + ); + return $guiObj; + } + + /* + * function: edit + * + * args: + * + * returns: + * + */ + public function edit(&$argsObj) + { + $guiObj = new stdClass(); + $dummy = $this->milestone_mgr->get_by_id($argsObj->id); + $guiObj->milestone = $dummy[$argsObj->id]; + + // $dummyy necessary because localize_dateOrTimeStamp wants second parameter to be passed by reference + $dummy = null; + + // localize target date (is always set on edit) + $guiObj->milestone['target_date'] = localize_dateOrTimeStamp(null, + $dummy, 'date_format', $guiObj->milestone['target_date']); + + // as start date is optional it can be "0000-00-00" (default timestamp) + if ($guiObj->milestone['start_date'] != "0000-00-00") { + $guiObj->milestone['start_date'] = localize_dateOrTimeStamp(null, + $dummy, 'date_format', $guiObj->milestone['start_date']); + } else { + $guiObj->milestone['start_date'] = ""; + } + + $guiObj->main_descr = lang_get('testplan') . TITLE_SEP; + $guiObj->action_descr = sprintf(lang_get('edit_milestone'), + $guiObj->milestone['name']); + $guiObj->template = $this->defaultTemplate; + $guiObj->submit_button_label = $this->submit_button_label; + return $guiObj; + } + + /* + * function: doCreate + * + * args: + * + * returns: + * + */ + public function doCreate(&$argsObj, $basehref) + { + $date_format_cfg = config_get('date_format'); + $guiObj = new stdClass(); + $guiObj->main_descr = lang_get('Milestone') . TITLE_SEP; + $guiObj->action_descr = lang_get('create_milestone'); + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->template = null; + $op_ok = 1; + + // Check name do not exists + $name_exists = $this->milestone_mgr->check_name_existence( + $argsObj->tplan_id, $argsObj->name); + if ($name_exists) { + $guiObj->user_feedback = sprintf( + lang_get('milestone_name_already_exists'), $argsObj->name); + $op_ok = 0; + } + + // BUGID 3716 + // are the dates valid? + if ($op_ok) { + // start date is optional + $op_ok = is_valid_date($argsObj->target_date_original, + $date_format_cfg) && + ($argsObj->start_date_original == '' || + is_valid_date($argsObj->start_date_original, $date_format_cfg)); + if (! $op_ok) { + $guiObj->user_feedback = sprintf( + lang_get('warning_invalid_date')); + } + } + + // check target date + if ($op_ok) { + $timestamp = array(); + $timestamp['target'] = strtotime( + $argsObj->target_date . " 23:59:59"); + $timestamp['now'] = strtotime("now"); + + if ($timestamp['target'] < $timestamp['now']) { + $op_ok = 0; + $guiObj->user_feedback = lang_get('warning_milestone_date'); + } + } + + // BUGID 3829 - check target date > start date + if ($op_ok && isset($argsObj->start_date)) { + $timestamp['target'] = strtotime( + $argsObj->target_date . " 23:59:59"); + $timestamp['start'] = strtotime($argsObj->start_date . " 23:59:59"); + + // target must be chronologically after start + if ($timestamp['target'] < $timestamp['start']) { + $op_ok = 0; + $guiObj->user_feedback = lang_get('warning_target_before_start'); + } + } + + if ($op_ok) { + // avoid warning on event viewer + if (! isset($argsObj->start_date)) { + $argsObj->start_date = ""; + } + + $argsObj->low_priority = $argsObj->low_priority_tcases; + $argsObj->medium_priority = $argsObj->medium_priority_tcases; + $argsObj->high_priority = $argsObj->high_priority_tcases; + + $argsObj->id = $this->milestone_mgr->create($argsObj); + + $guiObj->user_feedback = 'ok'; + if ($argsObj->id > 0) { + logAuditEvent( + TLS("audit_milestone_created", $argsObj->tplan_name, + $argsObj->name), "CREATE", $argsObj->id, "milestones"); + $guiObj->user_feedback = sprintf(lang_get('milestone_created'), + $argsObj->name); + $guiObj->template = $basehref . $this->viewAction; + } + } + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $basehref) + { + $date_format_cfg = config_get('date_format'); + $descr_prefix = lang_get('Milestone') . TITLE_SEP; + $obj = $this->edit($argsObj); + $obj->user_feedback = 'ok'; + $obj->template = null; + $dummy = $this->milestone_mgr->get_by_id($argsObj->id); + $originalMilestone = $dummy[$argsObj->id]; + + $op_ok = 1; + + // Check name do not exists + $name_exists = $this->milestone_mgr->check_name_existence( + $originalMilestone['testplan_id'], $argsObj->name, $argsObj->id); + if ($name_exists) { + $obj->user_feedback = sprintf( + lang_get('milestone_name_already_exists'), $argsObj->name); + $op_ok = 0; + } + + // BUGID 3716 + // are the dates valid? + if ($op_ok) { + // start date is optional + $op_ok = is_valid_date($argsObj->target_date_original, + $date_format_cfg) && + ($argsObj->start_date_original == '' || + is_valid_date($argsObj->start_date_original, $date_format_cfg)); + + if (! $op_ok) { + $obj->user_feedback = lang_get('warning_invalid_date'); + } + } + + // target date changed ? + if ($op_ok) { + $timestamp = array(); + $timestamp['target'] = strtotime( + $argsObj->target_date . " 23:59:59"); + $timestamp['original_target'] = strtotime( + $originalMilestone['target_date'] . " 23:59:59"); + $timestamp['now'] = strtotime("now"); + + if (($timestamp['target'] != $timestamp['original_target']) && + $timestamp['target'] < $timestamp['now']) { + $op_ok = 0; + $obj->user_feedback = lang_get('warning_milestone_date'); + } + } + + // BUGID 3829 - check target date > start date + if ($op_ok && isset($argsObj->start_date)) { + $timestamp['target'] = strtotime( + $argsObj->target_date . " 23:59:59"); + $timestamp['start'] = strtotime($argsObj->start_date . " 23:59:59"); + + // target must be chronologically after start + if ($timestamp['target'] < $timestamp['start']) { + $op_ok = 0; + $obj->user_feedback = lang_get('warning_target_before_start'); + } + } + + if ($op_ok) { + // BUGID 3907 - start date is optional -> if empty set to default date + if (! isset($argsObj->start_date) || $argsObj->start_date == "") { + $argsObj->start_date = "0000-00-00"; + } + + $op_ok = $this->milestone_mgr->update($argsObj->id, $argsObj->name, + $argsObj->target_date, $argsObj->start_date, + $argsObj->low_priority_tcases, $argsObj->medium_priority_tcases, + $argsObj->high_priority_tcases); + } + if ($op_ok) { + $obj->main_descr = ''; + $obj->action_descr = ''; + $obj->template = "planMilestonesView.php"; + logAuditEvent( + TLS("audit_milestone_saved", $argsObj->tplan_name, + $argsObj->name), "SAVE", $argsObj->id, "milestones"); + } else { + // Action has failed => no change done on DB. + $obj->main_descr = $descr_prefix . $originalMilestone['name']; + } + + return $obj; + } + + /* + * function: doDelete + * + * args: + * + * returns: object with info useful to manage user interface + * + */ + public function doDelete(&$argsObj, $basehref) + { + $dummy = $this->milestone_mgr->get_by_id($argsObj->id); + $milestone = $dummy[$argsObj->id]; + + $this->milestone_mgr->delete($argsObj->id); + logAuditEvent( + TLS("audit_milestone_deleted", $milestone['testplan_name'], + $milestone['name']), "DELETE", $argsObj->id, "milestones"); + + $obj = new stdClass(); + $obj->template = $basehref . $this->viewAction; + $obj->user_feedback = sprintf(lang_get('milestone_deleted'), + $milestone['name']); + $obj->main_descr = null; + $obj->title = lang_get('delete_milestone'); + + return $obj; + } +} +?> diff --git a/lib/plan/planMilestonesEdit.php b/lib/plan/planMilestonesEdit.php index 2f61fdb5bf..d7e0cd446a 100644 --- a/lib/plan/planMilestonesEdit.php +++ b/lib/plan/planMilestonesEdit.php @@ -1,209 +1,208 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$commandMgr = new planMilestonesCommands($db); - -$pFn = $args->doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) -{ - $op = $commandMgr->$pFn($args,$_SESSION['basehref']); -} - -renderGui($args,$gui,$op,$templateCfg); - - -/* - function: - - args : - - returns: - -*/ -function init_args(&$dbHandler,$dateFormat) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - $args->target_date_original = isset($_REQUEST['target_date']) ? $_REQUEST['target_date'] : null; - $args->start_date_original = isset($_REQUEST['start_date']) ? $_REQUEST['start_date'] : null; - - // convert target date to iso format to write to db - if (isset($_REQUEST['target_date']) && $_REQUEST['target_date'] != '') { - $date_array = split_localized_date($_REQUEST['target_date'], $dateFormat); - if ($date_array != null) { - // set date in iso format - $args->target_date = $date_array['year'] . "-" . $date_array['month'] . "-" . $date_array['day']; - } - } - - // convert start date to iso format to write to db - if (isset($_REQUEST['start_date']) && $_REQUEST['start_date'] != '') { - $date_array = split_localized_date($_REQUEST['start_date'], $dateFormat); - if ($date_array != null) { - // set date in iso format - $args->start_date = $date_array['year'] . "-" . $date_array['month'] . "-" . $date_array['day']; - } - } - - $key2loop = array('low_priority_tcases','medium_priority_tcases','high_priority_tcases'); - foreach($key2loop as $key) - { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; - } - - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - $args->name = isset($_REQUEST['milestone_name']) ? $_REQUEST['milestone_name'] : null; - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; - - $args->basehref=$_SESSION['basehref']; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; - - $args->tplan_name = ''; - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - if( $args->tplan_id == 0 ) - { - $args->tplan_id = isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : 0; - } - if( $args->tplan_id > 0 ) - { - $tplan_mgr = new testplan($dbHandler); - $info = $tplan_mgr->get_by_id($args->tplan_id); - $args->tplan_name = $info['name']; - } - - return $args; -} - - -/* - function: renderGui - - args: - - returns: - -*/ -function renderGui(&$argsObj,$guiObj,$opObj,$templateCfg) -{ - $smartyObj = new TLSmarty(); - // - // key: operation requested (normally received from GUI on doAction) - // value: operation value to set on doAction HTML INPUT - // This is useful when you use same template (example xxEdit.tpl), for create and edit. - // When template is used for create -> operation: doCreate. - // When template is used for edit -> operation: doUpdate. - // - // used to set value of: $guiObj->operation - // - $actionOperation=array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doCreate' => 'doCreate', - 'doUpdate' => 'doUpdate'); - - $renderType = 'none'; - switch($argsObj->doAction) - { - case "edit": - case "create": - case "doDelete": - case "doCreate": - case "doUpdate": - $renderType = 'template'; - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) - { - $guiObj->$key = $value; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - - $pos = strpos($tpl, '.php'); - if($pos === false) - { - $tpl = $tplDir . $tpl; - } - else - { - $renderType = 'redirect'; - } - break; - } - - switch($renderType) - { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } - -} - -/* - function: initialize_gui - - args : - - - returns: - -*/ -function initialize_gui(&$dbHandler,&$argsObj) -{ - $req_spec_mgr = new requirement_spec_mgr($dbHandler); - $gui = new stdClass(); - - $gui->user_feedback = null; - $gui->main_descr = lang_get('req_spec'); - $gui->action_descr = null; - - $gui->grants = new stdClass(); - $gui->grants->milestone_mgmt = has_rights($dbHandler,"testplan_planning"); - $gui->grants->mgt_view_events = has_rights($dbHandler,"mgt_view_events"); - - return $gui; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$commandMgr = new planMilestonesCommands($db); + +$pFn = $args->doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_SESSION['basehref']); +} + +renderGui($args, $gui, $op, $templateCfg); + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs(&$dbHandler, $dateFormat) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + $args->target_date_original = isset($_REQUEST['target_date']) ? $_REQUEST['target_date'] : null; + $args->start_date_original = isset($_REQUEST['start_date']) ? $_REQUEST['start_date'] : null; + + // convert target date to iso format to write to db + if (isset($_REQUEST['target_date']) && $_REQUEST['target_date'] != '') { + $date_array = split_localized_date($_REQUEST['target_date'], $dateFormat); + if ($date_array != null) { + // set date in iso format + $args->target_date = $date_array['year'] . "-" . $date_array['month'] . + "-" . $date_array['day']; + } + } + + // convert start date to iso format to write to db + if (isset($_REQUEST['start_date']) && $_REQUEST['start_date'] != '') { + $date_array = split_localized_date($_REQUEST['start_date'], $dateFormat); + if ($date_array != null) { + // set date in iso format + $args->start_date = $date_array['year'] . "-" . $date_array['month'] . + "-" . $date_array['day']; + } + } + + $key2loop = array( + 'low_priority_tcases', + 'medium_priority_tcases', + 'high_priority_tcases' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; + } + + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + $args->name = isset($_REQUEST['milestone_name']) ? $_REQUEST['milestone_name'] : null; + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; + + $args->basehref = $_SESSION['basehref']; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; + + $args->tplan_name = ''; + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + if ($args->tplan_id == 0) { + $args->tplan_id = isset($_SESSION['testplanID']) ? intval( + $_SESSION['testplanID']) : 0; + } + if ($args->tplan_id > 0) { + $tplan_mgr = new testplan($dbHandler); + $info = $tplan_mgr->get_by_id($args->tplan_id); + $args->tplan_name = $info['name']; + } + + return $args; +} + +/* + * function: renderGui + * + * args: + * + * returns: + * + */ +function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg) +{ + $smartyObj = new TLSmarty(); + // + // key: operation requested (normally received from GUI on doAction) + // value: operation value to set on doAction HTML INPUT + // This is useful when you use same template (example xxEdit.tpl), for create and edit. + // When template is used for create -> operation: doCreate. + // When template is used for edit -> operation: doUpdate. + // + // used to set value of: $guiObj->operation + // + $actionOperation = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate' + ); + + $renderType = 'none'; + switch ($argsObj->doAction) { + case "edit": + case "create": + case "doDelete": + case "doCreate": + case "doUpdate": + $renderType = 'template'; + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tpl = $tplDir . $tpl; + } else { + $renderType = 'redirect'; + } + break; + } + + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/* + * function: initialize_gui + * + * args : - + * + * returns: + * + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $gui = new stdClass(); + + $gui->user_feedback = null; + $gui->main_descr = lang_get('req_spec'); + $gui->action_descr = null; + + $gui->grants = new stdClass(); + $gui->grants->milestone_mgmt = has_rights($dbHandler, "testplan_planning"); + $gui->grants->mgt_view_events = has_rights($dbHandler, "mgt_view_events"); + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/plan/planMilestonesView.php b/lib/plan/planMilestonesView.php index 9eff39e3f8..5f46fe2085 100644 --- a/lib/plan/planMilestonesView.php +++ b/lib/plan/planMilestonesView.php @@ -1,102 +1,97 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; - $args->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; - $args->tplan_name = isset($_SESSION['testplanName']) ? $_SESSION['testplanName'] : ""; - - return $args; +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; + $args->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; + $args->tplan_name = isset($_SESSION['testplanName']) ? $_SESSION['testplanName'] : ""; + + return $args; +} + +/* + * function: initialize_gui + * + * args : - + * + * returns: + * + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $manager = new milestone_mgr($dbHandler); + $gui = new stdClass(); + + $gui->user_feedback = null; + $gui->main_descr = lang_get('title_milestones') . " " . $argsObj->tplan_name; + $gui->action_descr = null; + $gui->tplan_name = $argsObj->tplan_name; + $gui->tplan_id = $argsObj->tplan_id; + $gui->items = $manager->get_all_by_testplan($argsObj->tplan_id); + $gui->itemsLive = null; + + if (! is_null($gui->items)) { + $metrics = new tlTestPlanMetrics($dbHandler); + $gui->itemsLive = $metrics->getMilestonesMetrics($argsObj->tplan_id, + $gui->items); + } + + $gui->grants = new stdClass(); + $gui->grants->milestone_mgmt = has_rights($dbHandler, "testplan_planning"); + $gui->grants->mgt_view_events = has_rights($dbHandler, "mgt_view_events"); + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } - -/* - function: initialize_gui - - args : - - - returns: - -*/ -function initialize_gui(&$dbHandler,&$argsObj) -{ - $manager = new milestone_mgr($dbHandler); - $gui = new stdClass(); - - $gui->user_feedback = null; - $gui->main_descr = lang_get('title_milestones') . " " . $argsObj->tplan_name; - $gui->action_descr = null; - $gui->tplan_name = $argsObj->tplan_name; - $gui->tplan_id = $argsObj->tplan_id; - $gui->items = $manager->get_all_by_testplan($argsObj->tplan_id); - $gui->itemsLive = null; - - if(!is_null($gui->items)) - { - $metrics = new tlTestPlanMetrics($dbHandler); - $gui->itemsLive = $metrics->getMilestonesMetrics($argsObj->tplan_id,$gui->items); - } - - - $gui->grants = new stdClass(); - $gui->grants->milestone_mgmt = has_rights($dbHandler,"testplan_planning"); - $gui->grants->mgt_view_events = has_rights($dbHandler,"mgt_view_events"); - - return $gui; -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/plan/planTCNavigator.php b/lib/plan/planTCNavigator.php index 88fb551689..614971a7a0 100644 --- a/lib/plan/planTCNavigator.php +++ b/lib/plan/planTCNavigator.php @@ -16,11 +16,11 @@ * **/ -require('../../config.inc.php'); -require_once("common.php"); -require_once("users.inc.php"); -require_once("treeMenu.inc.php"); -require_once('exec.inc.php'); +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'users.inc.php'; +require_once 'treeMenu.inc.php'; +require_once 'exec.inc.php'; testlinkInitPage($db); $templateCfg = templateConfiguration(); @@ -43,13 +43,13 @@ /** - * @param unknown_type $dbHandler - * @param unknown_type $control + * @param database $dbHandler + * @param tlTestCaseFilterControl $control * @return stdClass - * + * * @internal revisions: */ -function initializeGui(&$dbHandler, &$control, &$assignmentMgr) +function initializeGui(&$dbHandler, &$control, &$assignmentMgr) { $gui = new stdClass(); @@ -60,7 +60,7 @@ function initializeGui(&$dbHandler, &$control, &$assignmentMgr) $gui->additional_string = ''; // configure target URLs and clickable buttons - switch($control->args->feature) + switch($control->args->feature) { case 'planUpdateTC': $gui->menuUrl = "lib/plan/planUpdateTC.php"; @@ -76,7 +76,7 @@ function initializeGui(&$dbHandler, &$control, &$assignmentMgr) case 'tc_exec_assignment': $gui->title_navigator = lang_get('navigator_tc_exec_assignment'); $gui->menuUrl = "lib/plan/tc_exec_assignment.php"; - $build_id = $control->settings['setting_build']['selected']; + $control->settings['setting_build']['selected']; $control->draw_tc_unassign_button = true; $control->draw_tc_assignment_bulk_copy_button = true; @@ -84,4 +84,4 @@ function initializeGui(&$dbHandler, &$control, &$assignmentMgr) } return $gui; -} \ No newline at end of file +} diff --git a/lib/plan/planUpdateTC.php b/lib/plan/planUpdateTC.php index 5d7d403286..0bcfb3fe82 100644 --- a/lib/plan/planUpdateTC.php +++ b/lib/plan/planUpdateTC.php @@ -1,442 +1,432 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - - -$keywordsFilter = null; -if(is_array($args->keyword_id)) -{ - $keywordsFilter = new stdClass(); - $keywordsFilter->items = $args->keyword_id; - $keywordsFilter->type = $gui->keywordsFilterType->selected; +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$keywordsFilter = null; +if (is_array($args->keyword_id)) { + $keywordsFilter = new stdClass(); + $keywordsFilter->items = $args->keyword_id; + $keywordsFilter->type = $gui->keywordsFilterType->selected; +} + +switch ($args->doAction) { + case "doUpdate": + case "doBulkUpdateToLatest": + $gui->user_feedback = doUpdate($db, $args); + break; + + default: + break; +} + +$out = null; +$gui->show_details = 0; +$gui->operationType = 'standard'; +$gui->hasItems = 0; + +switch ($args->level) { + case 'testcase': + $out = processTestCase($db, $args, $tplan_mgr, $tree_mgr); + break; + + case 'testsuite': + $out = processTestSuite($db, $args, $keywordsFilter, $tplan_mgr, + $tcaseMgr); + break; + + case 'testplan': + $itemSet = processTestPlan($db, $args, $tplan_mgr); + $gui->testcases = $itemSet['items']; + $gui->user_feedback = $itemSet['msg']; + $gui->instructions = lang_get('update2latest'); + $gui->buttonAction = "doBulkUpdateToLatest"; + $gui->operationType = 'bulk'; + if (! is_null($gui->testcases)) { + $gui->hasItems = 1; + $gui->show_details = 1; + } + break; + + default: + // show instructions + redirect( + $_SESSION['basehref'] . + "/lib/general/staticPage.php?key=planUpdateTC"); + break; +} + +if (! is_null($out)) { + $gui->hasItems = $out['num_tc'] > 0 ? 1 : 0; + $gui->items = $out['spec_view']; +} + +if ($gui->buttonAction == 'doUpdate') { + $gui->action_descr = lang_get('update_testcase_versions'); +} else { + $gui->action_descr = lang_get('update_all_testcase_versions'); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @param testplan $tplanMgr + * @return stdClass object with some REQUEST and SESSION values as members + */ +function initArgs(&$tplanMgr) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; + $args->level = isset($_REQUEST['level']) ? $_REQUEST['level'] : null; + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; + + // Maps with key: test case ID value: tcversion_id + $args->fullTestCaseSet = isset($_REQUEST['a_tcid']) ? $_REQUEST['a_tcid'] : null; + $args->checkedTestCaseSet = isset($_REQUEST['achecked_tc']) ? $_REQUEST['achecked_tc'] : null; + $args->newVersionSet = isset($_REQUEST['new_tcversion_for_tcid']) ? $_REQUEST['new_tcversion_for_tcid'] : null; + $args->version_id = isset($_REQUEST['version_id']) ? $_REQUEST['version_id'] : 0; + + $args->tproject_id = $_SESSION['testprojectID']; + $args->tproject_name = $_SESSION['testprojectName']; + + // For more information about the data accessed in session here, see the comment + // in the file header of lib/functions/tlTestCaseFilterControl.class.php. + $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + + $mode = 'plan_mode'; + + $session_data = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; + + $args->tplan_id = isset($session_data['setting_testplan']) ? $session_data['setting_testplan'] : 0; + if ($args->tplan_id == 0) { + $args->tplan_id = isset($_SESSION['testplanID']) ? intval( + $_SESSION['testplanID']) : 0; + $args->tplan_name = $_SESSION['testplanName']; + } else { + $tpi = $tplanMgr->get_by_id($args->tplan_id); + $args->tplan_name = $tpi['name']; + } + + $args->refreshTree = isset($session_data['setting_refresh_tree_on_action']) ? $session_data['setting_refresh_tree_on_action'] : 0; + + $args->keyword_id = 0; + $fk = 'filter_keywords'; + if (isset($session_data[$fk])) { + $args->keyword_id = $session_data[$fk]; + if (is_array($args->keyword_id) && count($args->keyword_id) == 1) { + $args->keyword_id = $args->keyword_id[0]; + } + } + + $args->keywordsFilterType = null; + $ft = 'filter_keywords_filter_type'; + if (isset($session_data[$ft])) { + $args->keywordsFilterType = $session_data[$ft]; + } + + return $args; +} + +/** + * doUpdate + * + * @param database $dbObj + * @param stdClass $argsObj + * @return string + */ +function doUpdate(&$dbObj, &$argsObj) +{ + $debugMsg = 'File:' . __FILE__ . ' - Function: ' . __FUNCTION__; + $tables = tlObject::getDBTables( + array( + 'testplan_tcversions', + 'executions', + 'cfield_execution_values' + )); + $msg = ""; + if (! is_null($argsObj->checkedTestCaseSet)) { + foreach ($argsObj->checkedTestCaseSet as $tcaseID => $tcversionID) { + $newtcversion = $argsObj->newVersionSet[$tcaseID]; + foreach ($tables as $table2update) { + $sql = "/* $debugMsg */ UPDATE $table2update " . + " SET tcversion_id={$newtcversion} " . + " WHERE tcversion_id={$tcversionID} " . + " AND testplan_id={$argsObj->tplan_id}"; + $dbObj->exec_query($sql); + } + } + $msg = lang_get("tplan_updated"); + } + return $msg; +} + +/** + * Initializes the GUI + * + * @param stdClass $argsObj + * @param testcase $tcaseMgr + * @return stdClass + */ +function initializeGui($argsObj, &$tcaseMgr) +{ + $tcase_cfg = config_get('testcase_cfg'); + $gui = new stdClass(); + $gui->refreshTree = false; + $gui->instructions = ''; + $gui->buttonAction = "doUpdate"; + $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix( + $argsObj->tproject_id); + $gui->testCasePrefix .= $tcase_cfg->glue_character; + $gui->user_feedback = ''; + $gui->testPlanName = $argsObj->tplan_name; + $gui->items = null; + $gui->has_tc = 1; + + return $gui; +} + +/** + * processTestSuite + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param + * $keywordsFilter + * @param testplan $tplanMgr + * @param testcase $tcaseMgr + * @return array + */ +function processTestSuite(&$dbHandler, &$argsObj, $keywordsFilter, &$tplanMgr, + &$tcaseMgr) +{ + // hmm need to document why we use ONLY $keywordsFilter + $out = getFilteredSpecView($dbHandler, $argsObj, $tplanMgr, $tcaseMgr, + array( + 'keywordsFilter' => $keywordsFilter + )); + tideUpForGUI($out); + return $out; +} + +/** + * doUpdateAllToLatest + * + * @param database $dbObj + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return array + */ +function doUpdateAllToLatest(&$dbObj, $argsObj, &$tplanMgr) +{ + $qty = 0; + $linkedItems = $tplanMgr->get_linked_items_id($argsObj->tplan_id); + if (is_null($linkedItems)) { + return lang_get('no_testcase_available'); + } + + $items = $tplanMgr->get_linked_and_newest_tcversions($argsObj->tplan_id); + if (! is_null($items)) { + foreach ($items as $value) { + if ($value['newest_tcversion_id'] != $value['tcversion_id']) { + $newtcversion = $value['newest_tcversion_id']; + $tcversionID = $value['tcversion_id']; + $qty ++; + + // Update link to testplan + $sql = "UPDATE testplan_tcversions " . + " SET tcversion_id={$newtcversion} " . + " WHERE tcversion_id={$tcversionID} " . + " AND testplan_id={$argsObj->tplan_id}"; + $dbObj->exec_query($sql); + + // Update link in executions + $sql = "UPDATE executions " . + " SET tcversion_id={$newtcversion} " . + " WHERE tcversion_id={$tcversionID}" . + " AND testplan_id={$argsObj->tplan_id}"; + $dbObj->exec_query($sql); + + // Update link in cfields values + $sql = "UPDATE cfield_execution_values " . + " SET tcversion_id={$newtcversion} " . + " WHERE tcversion_id={$tcversionID}" . + " AND testplan_id={$argsObj->tplan_id}"; + $dbObj->exec_query($sql); + } + } + } + $qty == 0 ? $msg = lang_get('all_versions_where_latest') : $msg = sprintf( + lang_get('num_of_updated'), $qty); + + return $msg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @param tree $treeMgr + * @return array|array[]|number[] + */ +function processTestCase(&$dbHandler, &$argsObj, &$tplanMgr, &$treeMgr) +{ + $xx = $tplanMgr->getLinkInfo($argsObj->tplan_id, $argsObj->id, null, + array( + 'output' => 'tcase_info', + 'collapse' => true + )); + $linked_items[$xx['tc_id']][0] = $xx; // adapt data structure to gen_spec_view() desires + + $my_path = $treeMgr->get_path($argsObj->id); + $idx_ts = count($my_path) - 1; + $tsuite_data = $my_path[$idx_ts - 1]; + + // Again here need to understand why we seems to consider ONLY keywords filter. + $filters = array( + 'keywords' => $argsObj->keyword_id, + 'testcases' => $argsObj->id + ); + $opt = array( + 'write_button_only_if_linked' => 1, + 'prune_unlinked_tcversions' => 1 + ); + $out = gen_spec_view($dbHandler, 'testplan', $argsObj->tplan_id, + $tsuite_data['id'], $tsuite_data['name'], $linked_items, null, $filters, + $opt); + + // need new processing + tideUpForGUI($out); + return $out; +} + +/** + * + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return string|NULL[]|string[] + * @internal revisions: + */ +function processTestPlan(&$argsObj, &$tplanMgr) +{ + $set2update = array( + 'items' => null, + 'msg' => '' + ); + $check = $tplanMgr->getLinkedCount($argsObj->tplan_id); + $set2update['msg'] = $check == 0 ? lang_get('testplan_seems_empty') : lang_get( + 'no_newest_version_of_linked_tcversions'); + + $set2update['items'] = $tplanMgr->get_linked_and_newest_tcversions( + $argsObj->tplan_id); + if (! empty($set2update['items']) && ! is_null($set2update['items'])) { + $set2update['msg'] = ''; + $itemSet = array_keys($set2update['items']); + $path_info = $tplanMgr->tree_manager->get_full_path_verbose($itemSet); + foreach ($set2update['items'] as $tcase_id => $value) { + $path = $path_info[$tcase_id]; + unset($path[0]); + $path[] = ''; + $set2update['items'][$tcase_id]['path'] = implode(' / ', $path); + } + } + return $set2update; +} + +/** + * + * @param array $output + */ +function tideUpForGUI(&$output) +{ + // We are going to loop over test suites + $loop2do = count($output['spec_view']); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $itemSet = &$output['spec_view'][$idx]['testcases']; + if (! empty($itemSet)) { + $key2loop = array_keys($itemSet); + foreach ($key2loop as $tcaseID) { + // want to understand + // How many active test case versions exist + // if we have ONLY one active test case version + // is this version the ALREADY LINKED one ? + // if we have ZERO ACTIVE VERSIONS + // + $active = 0; + foreach ($itemSet[$tcaseID]['tcversions_active_status'] as $status) { + if ($status) { + $active ++; + } + } + + $itemSet[$tcaseID]['updateTarget'] = $itemSet[$tcaseID]['tcversions']; + $lnItem = $itemSet[$tcaseID]['linked_version_id']; + $itemSet[$tcaseID]['canUpdateVersion'] = ($active != 0); + if ($active == 1 && + $lnItem == key($itemSet[$tcaseID]['tcversions'])) { + $itemSet[$tcaseID]['canUpdateVersion'] = false; + } + if (! is_null($lnItem) && + isset($itemSet[$tcaseID]['tcversions'][$lnItem])) { + unset($itemSet[$tcaseID]['updateTarget'][$lnItem]); + if (count($itemSet[$tcaseID]['updateTarget']) == 0) { + $itemSet[$tcaseID]['updateTarget'] = null; + } + } + } + } + } +} + +/** + * Checks the user rights for accessing the page + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } - -switch ($args->doAction) -{ - case "doUpdate": - case "doBulkUpdateToLatest": - $gui->user_feedback = doUpdate($db,$args); - break; - - default: - break; -} - -$out = null; -$gui->show_details = 0; -$gui->operationType = 'standard'; -$gui->hasItems = 0; - -switch($args->level) -{ - case 'testcase': - $out = processTestCase($db,$args,$keywordsFilter,$tplan_mgr,$tree_mgr); - break; - - case 'testsuite': - $out = processTestSuite($db,$args,$keywordsFilter,$tplan_mgr,$tcase_mgr); - break; - - case 'testplan': - $itemSet = processTestPlan($db,$args,$tplan_mgr); - $gui->testcases = $itemSet['items']; - $gui->user_feedback = $itemSet['msg']; - $gui->instructions = lang_get('update2latest'); - $gui->buttonAction = "doBulkUpdateToLatest"; - $gui->operationType = 'bulk'; - if( !is_null($gui->testcases) ) - { - $gui->hasItems = 1; - $gui->show_details = 1; - } - break; - - default: - // show instructions - redirect($_SESSION['basehref'] . "/lib/general/staticPage.php?key=planUpdateTC"); - break; -} - -if(!is_null($out)) -{ - $gui->hasItems = $out['num_tc'] > 0 ? 1 : 0; - $gui->items = $out['spec_view']; -} - -if($gui->buttonAction == 'doUpdate') -{ - $gui->action_descr = lang_get('update_testcase_versions'); -} -else -{ - $gui->action_descr = lang_get('update_all_testcase_versions'); -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/* - function: init_args - - args : - - returns: - -*/ -function init_args(&$tplanMgr) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; - $args->level = isset($_REQUEST['level']) ? $_REQUEST['level'] : null; - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; - - // Maps with key: test case ID value: tcversion_id - $args->fullTestCaseSet = isset($_REQUEST['a_tcid']) ? $_REQUEST['a_tcid'] : null; - $args->checkedTestCaseSet = isset($_REQUEST['achecked_tc']) ? $_REQUEST['achecked_tc'] : null; - $args->newVersionSet = isset($_REQUEST['new_tcversion_for_tcid']) ? $_REQUEST['new_tcversion_for_tcid'] : null; - $args->version_id = isset($_REQUEST['version_id']) ? $_REQUEST['version_id'] : 0; - - $args->tproject_id = $_SESSION['testprojectID']; - $args->tproject_name = $_SESSION['testprojectName']; - - // For more information about the data accessed in session here, see the comment - // in the file header of lib/functions/tlTestCaseFilterControl.class.php. - $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - - $mode = 'plan_mode'; - - $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) - ? $_SESSION[$mode][$form_token] : null; - - $args->tplan_id = isset($session_data['setting_testplan']) ? $session_data['setting_testplan'] : 0; - if($args->tplan_id == 0) - { - $args->tplan_id = isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : 0; - $args->tplan_name = $_SESSION['testplanName']; - } - else - { - $tpi = $tplanMgr->get_by_id($args->tplan_id); - $args->tplan_name = $tpi['name']; - } - - $args->refreshTree = isset($session_data['setting_refresh_tree_on_action']) ? - $session_data['setting_refresh_tree_on_action'] : 0; - - $args->keyword_id = 0; - $fk = 'filter_keywords'; - if (isset($session_data[$fk])) - { - $args->keyword_id = $session_data[$fk]; - if (is_array($args->keyword_id) && count($args->keyword_id) == 1) - { - $args->keyword_id = $args->keyword_id[0]; - } - } - - $args->keywordsFilterType = null; - $ft = 'filter_keywords_filter_type'; - if (isset($session_data[$ft])) - { - $args->keywordsFilterType = $session_data[$ft]; - } - - return $args; -} - -/* - function: doUpdate - - args: - - returns: message - -*/ -function doUpdate(&$dbObj,&$argsObj) -{ - $debugMsg = 'File:' . __FILE__ . ' - Function: ' . __FUNCTION__; - $tables = tlObject::getDBTables(array('testplan_tcversions','executions', - 'cfield_execution_values')); - $msg = ""; - if(!is_null($argsObj->checkedTestCaseSet)) - { - foreach($argsObj->checkedTestCaseSet as $tcaseID => $tcversionID) - { - $newtcversion=$argsObj->newVersionSet[$tcaseID]; - foreach($tables as $table2update) - { - $sql = "/* $debugMsg */ UPDATE $table2update " . - " SET tcversion_id={$newtcversion} " . - " WHERE tcversion_id={$tcversionID} " . - " AND testplan_id={$argsObj->tplan_id}"; - $dbObj->exec_query($sql); - } - } - $msg = lang_get("tplan_updated"); - } - return $msg; -} - - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr,&$tcaseMgr) -{ - $tcase_cfg = config_get('testcase_cfg'); - $gui = new stdClass(); - $gui->refreshTree=false; - $gui->instructions=''; - $gui->buttonAction="doUpdate"; - $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->testCasePrefix .= $tcase_cfg->glue_character; - $gui->user_feedback = ''; - $gui->testPlanName = $argsObj->tplan_name; - $gui->items = null; - $gui->has_tc = 1; - - return $gui; -} - - -/* - function: processTestSuite - - args : - - returns: - -*/ -function processTestSuite(&$dbHandler,&$argsObj,$keywordsFilter,&$tplanMgr,&$tcaseMgr) -{ - // hmm need to document why we use ONLY $keywordsFilter - $out = getFilteredSpecView($dbHandler,$argsObj,$tplanMgr,$tcaseMgr,array('keywordsFilter' => $keywordsFilter)); - tideUpForGUI($out); - return $out; -} - - -/* - function: doUpdateAllToLatest - - args: - - returns: message - -*/ -function doUpdateAllToLatest(&$dbObj,$argsObj,&$tplanMgr) -{ - $qty=0; - $linkedItems = $tplanMgr->get_linked_items_id($argsObj->tplan_id); - if( is_null($linkedItems) ) - { - return lang_get('no_testcase_available'); - } - - $items=$tplanMgr->get_linked_and_newest_tcversions($argsObj->tplan_id); - if( !is_null($items) ) - { - foreach($items as $key => $value) - { - if( $value['newest_tcversion_id'] != $value['tcversion_id'] ) - { - $newtcversion=$value['newest_tcversion_id']; - $tcversionID=$value['tcversion_id']; - $qty++; - - // Update link to testplan - $sql = "UPDATE testplan_tcversions " . - " SET tcversion_id={$newtcversion} " . - " WHERE tcversion_id={$tcversionID} " . - " AND testplan_id={$argsObj->tplan_id}"; - $dbObj->exec_query($sql); - - // Update link in executions - $sql = "UPDATE executions " . - " SET tcversion_id={$newtcversion} " . - " WHERE tcversion_id={$tcversionID}" . - " AND testplan_id={$argsObj->tplan_id}"; - $dbObj->exec_query($sql); - - // Update link in cfields values - $sql = "UPDATE cfield_execution_values " . - " SET tcversion_id={$newtcversion} " . - " WHERE tcversion_id={$tcversionID}" . - " AND testplan_id={$argsObj->tplan_id}"; - $dbObj->exec_query($sql); - } - } - } - if( $qty == 0 ) - { - $msg=lang_get('all_versions_where_latest'); - } - else - { - $msg=sprintf(lang_get('num_of_updated'),$qty); - } - - return $msg; -} - - -/** - * - * - */ -function processTestCase(&$dbHandler,&$argsObj,$keywordsFilter,&$tplanMgr,&$treeMgr) -{ - $xx = $tplanMgr->getLinkInfo($argsObj->tplan_id,$argsObj->id,null, - array('output' => 'tcase_info', 'collapse' => true)); - $linked_items[$xx['tc_id']][0] = $xx; // adapt data structure to gen_spec_view() desires - - $my_path = $treeMgr->get_path($argsObj->id); - $idx_ts = count($my_path)-1; - $tsuite_data = $my_path[$idx_ts-1]; - - // Again here need to understand why we seems to consider ONLY keywords filter. - $filters = array('keywords' => $argsObj->keyword_id, 'testcases' => $argsObj->id); - $opt = array('write_button_only_if_linked' => 1, 'prune_unlinked_tcversions' => 1); - $out = gen_spec_view($dbHandler,'testplan',$argsObj->tplan_id,$tsuite_data['id'],$tsuite_data['name'], - $linked_items,null,$filters,$opt); - - // need new processing - tideUpForGUI($out); - return $out; -} - -/** - * - * - * @internal revisions: - */ -function processTestPlan(&$dbHandler,&$argsObj,&$tplanMgr) -{ - $set2update = array('items' => null, 'msg' => ''); - $check = $tplanMgr->getLinkedCount($argsObj->tplan_id); - $set2update['msg'] = $check == 0 ? lang_get('testplan_seems_empty') : - lang_get('no_newest_version_of_linked_tcversions'); - - $set2update['items'] = $tplanMgr->get_linked_and_newest_tcversions($argsObj->tplan_id); - if( count($set2update['items']) > 0 ) - { - if( !is_null($set2update['items']) && count($set2update['items']) > 0 ) - { - $set2update['msg'] = ''; - $itemSet=array_keys($set2update['items']); - $path_info=$tplanMgr->tree_manager->get_full_path_verbose($itemSet); - foreach($set2update['items'] as $tcase_id => $value) - { - $path=$path_info[$tcase_id]; - unset($path[0]); - $path[]=''; - $set2update['items'][$tcase_id]['path']=implode(' / ',$path); - } - } - } - return $set2update; -} - - -function tideUpForGUI(&$output) -{ - // We are going to loop over test suites - $loop2do = count($output['spec_view']); - for($idx=0; $idx < $loop2do; $idx++) - { - $itemSet = &$output['spec_view'][$idx]['testcases']; - if( count($itemSet) > 0) - { - $key2loop = array_keys($itemSet); - foreach($key2loop as $tcaseID) - { - // want to understand - // How many active test case versions exist - // if we have ONLY one active test case version - // is this version the ALREADY LINKED one ? - // if we have ZERO ACTIVE VERSIONS - // - $active = 0; - $total = count($itemSet[$tcaseID]['tcversions_active_status']); - foreach($itemSet[$tcaseID]['tcversions_active_status'] as $status) - { - if($status) - { - $active++; - } - } - - $itemSet[$tcaseID]['updateTarget'] = $itemSet[$tcaseID]['tcversions']; - $lnItem = $itemSet[$tcaseID]['linked_version_id']; - $itemSet[$tcaseID]['canUpdateVersion'] = ($active != 0); - if($active == 1) - { - // linked_version_id - if( $lnItem == key($itemSet[$tcaseID]['tcversions']) ) - { - $itemSet[$tcaseID]['canUpdateVersion'] = FALSE; - } - } - if( !is_null($lnItem) && isset($itemSet[$tcaseID]['tcversions'][$lnItem]) ) - { - unset($itemSet[$tcaseID]['updateTarget'][$lnItem]); - if(count($itemSet[$tcaseID]['updateTarget']) == 0) - { - $itemSet[$tcaseID]['updateTarget'] = null; - } - } - } - } - - } -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/plan/planUrgency.php b/lib/plan/planUrgency.php index dce91be35e..654d417b85 100644 --- a/lib/plan/planUrgency.php +++ b/lib/plan/planUrgency.php @@ -1,169 +1,167 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - - - -if ($args->show_help) { - show_instructions('test_urgency'); - exit(); +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +if ($args->show_help) { + show_instructions('test_urgency'); + exit(); +} + +$templateCfg = templateConfiguration(); +$tplan_mgr = new testPlanUrgency($db); +$gui = initializeGui($args, $tplan_mgr->tree_manager); + +if ($args->urgency != OFF || isset($args->urgency_tc)) { + $gui->user_feedback = doProcess($args, $tplan_mgr); +} + +// get the current urgency for child test cases +$context = new stdClass(); +$context->tplan_id = $args->tplan_id; +$context->tsuite_id = $args->node_id; +$context->tproject_id = $args->tproject_id; +$context->platform_id = $args->platform_id; + +$gui->listTestCases = $tplan_mgr->getSuiteUrgency($context, + array( + 'build4testers' => $args->build4testers + ), array( + 'testcases' => $args->testCaseSet + )); + +foreach ($gui->listTestCases as $tcversion_id => $tcaseSet) { + foreach ($tcaseSet as $idx => $tcase) { + $gui->listTestCases[$tcversion_id][$idx]['priority'] = priority_to_level( + $tcase['priority']); + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: init_args() + * + * args: - + * + * returns: object with user input. + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->show_help = (isset($_REQUEST['level']) && + $_REQUEST['level'] == 'testproject'); + + $args->tproject_id = intval( + isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); + $args->tplan_id = intval( + isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); + $args->tplan_name = $_SESSION['testplanName']; + $args->node_type = isset($_REQUEST['level']) ? $_REQUEST['level'] : OFF; + $args->node_id = isset($_REQUEST['id']) ? $_REQUEST['id'] : ERROR; + + // Sets urgency for suite + + if (isset($_REQUEST['high_urgency'])) { + $args->urgency = HIGH; + } elseif (isset($_REQUEST['medium_urgency'])) { + $args->urgency = MEDIUM; + } elseif (isset($_REQUEST['low_urgency'])) { + $args->urgency = LOW; + } else { + $args->urgency = OFF; + } + + // Sets urgency for every single tc + if (isset($_REQUEST['urgency'])) { + $args->urgency_tc = $_REQUEST['urgency']; + } + + // For more information about the data accessed in session here, see the comment + // in the file header of lib/functions/tlTestCaseFilterControl.class.php. + $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $mode = 'plan_mode'; + $session_data = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$args->treeFormToken]) ? $_SESSION[$mode][$args->treeFormToken] : null; + + $args->testCaseSet = $session_data['testcases_to_show']; + $args->build4testers = intval($session_data['setting_build']); + $args->platform_id = intval($session_data['setting_platform']); + + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$treeMgr) +{ + $guiObj = new stdClass(); + + $ni = $treeMgr->get_node_hierarchy_info($argsObj->node_id); + $guiObj->node_name = $ni['name']; + $guiObj->user_feedback = null; + $guiObj->node_id = $argsObj->node_id; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->tplan_name = $argsObj->tplan_name; + $guiObj->formToken = $argsObj->treeFormToken; + return $guiObj; +} + +/** + */ +function doProcess(&$argsObj, &$tplanMgr) +{ + $userFeedback = null; + + // Set urgency for test suite + if ($argsObj->urgency != OFF) { + $userFeedback['type'] = $tplanMgr->setSuiteUrgency($argsObj->tplan_id, + $argsObj->node_id, $argsObj->urgency); + $userFeedback['message'] = lang_get( + ($userFeedback['type'] == OK) ? "feedback_urgency_ok" : "feedback_urgency_fail"); + } + + // Set urgency for individual testcases + if (isset($argsObj->urgency_tc)) { + foreach ($argsObj->urgency_tc as $id => $urgency) { + $tplanMgr->setTestUrgency($argsObj->tplan_id, intval($id), + intval($urgency)); + } + } + + return $userFeedback; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } - -$templateCfg = templateConfiguration(); -$tplan_mgr = new testPlanUrgency($db); -$gui = initializeGui($args,$tplan_mgr->tree_manager); - -if ($args->urgency != OFF || isset($args->urgency_tc)){ - $gui->user_feedback = doProcess($args,$tplan_mgr); -} - - -// get the current urgency for child test cases -$context = new stdClass(); -$context->tplan_id = $args->tplan_id; -$context->tsuite_id = $args->node_id; -$context->tproject_id = $args->tproject_id; -$context->platform_id = $args->platform_id; - -$gui->listTestCases = $tplan_mgr->getSuiteUrgency($context,array('build4testers' => $args->build4testers), - array('testcases' => $args->testCaseSet)); - -foreach($gui->listTestCases as $tcversion_id => $tcaseSet) -{ - foreach($tcaseSet as $idx => $tcase) - { - $gui->listTestCases[$tcversion_id][$idx]['priority'] = priority_to_level($tcase['priority']); - } -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args() - - args: - - - returns: object with user input. - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->show_help = (isset($_REQUEST['level']) && $_REQUEST['level']=='testproject'); - - $args->tproject_id = intval(isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); - $args->tplan_id = intval(isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); - $args->tplan_name = $_SESSION['testplanName']; - $args->node_type = isset($_REQUEST['level']) ? $_REQUEST['level'] : OFF; - $args->node_id = isset($_REQUEST['id']) ? $_REQUEST['id'] : ERROR; - - // Sets urgency for suite - - if (isset($_REQUEST['high_urgency'])) { - $args->urgency = HIGH; - } elseif (isset($_REQUEST['medium_urgency'])) { - $args->urgency = MEDIUM; - } elseif (isset($_REQUEST['low_urgency'])) { - $args->urgency = LOW; - } else { - $args->urgency = OFF; - } - - // Sets urgency for every single tc - if (isset($_REQUEST['urgency'])) { - $args->urgency_tc = $_REQUEST['urgency']; - } - - // For more information about the data accessed in session here, see the comment - // in the file header of lib/functions/tlTestCaseFilterControl.class.php. - $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $mode = 'plan_mode'; - $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$args->treeFormToken]) ? - $_SESSION[$mode][$args->treeFormToken] : null; - - - $args->testCaseSet = $session_data['testcases_to_show']; - $args->build4testers = intval($session_data['setting_build']); - $args->platform_id = intval($session_data['setting_platform']); - - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj,&$treeMgr) -{ - $guiObj = new stdClass(); - - $ni = $treeMgr->get_node_hierarchy_info($argsObj->node_id); - $guiObj->node_name = $ni['name']; - $guiObj->user_feedback = null; - $guiObj->node_id = $argsObj->node_id; - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->tplan_name = $argsObj->tplan_name; - $guiObj->formToken = $argsObj->treeFormToken; - return $guiObj; -} - - -/** - * - */ -function doProcess(&$argsObj,&$tplanMgr) -{ - $userFeedback = null; - - // Set urgency for test suite - if($argsObj->urgency != OFF) - { - $userFeedback['type'] = $tplanMgr->setSuiteUrgency($argsObj->tplan_id, $argsObj->node_id, $argsObj->urgency); - $userFeedback['message'] = lang_get(($userFeedback['type'] == OK) ? "feedback_urgency_ok" : "feedback_urgency_fail"); - } - - // Set urgency for individual testcases - if (isset($argsObj->urgency_tc)) { - foreach ($argsObj->urgency_tc as $id => $urgency) { - $tplanMgr->setTestUrgency($argsObj->tplan_id, - intval($id), intval($urgency)); - } - } - - return $userFeedback; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/plan/planView.php b/lib/plan/planView.php index 5fd3f0eb3f..68302863d3 100644 --- a/lib/plan/planView.php +++ b/lib/plan/planView.php @@ -1,180 +1,204 @@ -tproject_id && checkRights($db,$args->user,$args->tproject_id)) { - $tproject_mgr = new testproject($db); - $gui->tplans = $args->user->getAccessibleTestPlans($db,$args->tproject_id,null, - array('output' =>'mapfull', 'active' => null)); - $gui->drawPlatformQtyColumn = false; - - if( !is_null($gui->tplans) && count($gui->tplans) > 0 ) - { - // do this test project has platform definitions ? - $tplan_mgr = new testplan($db); - $tplan_mgr->platform_mgr->setTestProjectID($args->tproject_id); - $dummy = $tplan_mgr->platform_mgr->testProjectCount(); - $gui->drawPlatformQtyColumn = $dummy[$args->tproject_id]['platform_qty'] > 0; - - $tplanSet = array_keys($gui->tplans); - $dummy = $tplan_mgr->count_testcases($tplanSet,null,array('output' => 'groupByTestPlan')); - $buildQty = $tplan_mgr->get_builds($tplanSet,null,null,array('getCount' => true)); - $rightSet = array('testplan_user_role_assignment'); - - // To create the CF columns we need to get the linked CF - $availableCF = (array)$tplan_mgr->get_linked_cfields_at_design(current($tplanSet),$gui->tproject_id); - $hasCF = count($availableCF); - $gui->cfieldsColumns = null; - $gui->cfieldsType = null; - $initCFCol = true; - - // get CF used to configure HIDE COLS - // We want different configurations for different test projects - // then will do two steps algorithm - // 1. get test project prefix PPFX - // 2. look for TL_TPLANVIEW_HIDECOL_PPFX - // 3. if found proceed - // 4. else look for TL_TPLANVIEW_HIDECOL - // - $ppfx = $tproject_mgr->getTestCasePrefix($gui->tproject_id); - $suffixSet = ['_' . $ppfx, '']; - foreach($suffixSet as $suf) { - $gopt['name'] = 'TL_TPLANVIEW_HIDECOL' . $suf; - $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject($gui->tproject_id,null,$gopt); - - if ($col2hideCF != null) { - $col2hideCF = current($col2hideCF); - $col2hide = array_flip(explode('|',$col2hideCF['possible_values'])); - $col2hide[$gopt['name']] = ''; - break; - } - } - - - - $localeDateFormat = config_get('locales_date_format'); - $localeDateFormat = $localeDateFormat[$args->user->locale]; - - foreach($tplanSet as $idk) { - // --------------------------------------------------------------------------------------------- - if ($hasCF) { - $cfields = (array)$tplan_mgr->getCustomFieldsValues($idk,$gui->tproject_id); - foreach ($cfields as $cfd) { - if ($initCFCol) { - if (!isset($col2hide[$cfd['name']])) { - $gui->cfieldsColumns[] = $cfd['label']; - $gui->cfieldsType[] = $cfd['type']; - } - } - $gui->tplans[$idk][$cfd['label']] = ['value' => $cfd['value'], 'data-order' => $cfd['value']]; - - if ($cfd['type'] == 'date') { - $gui->tplans[$idk][$cfd['label']]['data-order'] = locateDateToISO($cfd['value'], $localeDateFormat); - } - } - $initCFCol = false; - } - // --------------------------------------------------------------------------------------------- - - //echo '
    ';var_dump($gui->tplans);echo "
    "; - $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval($dummy[$idk]['qty']) : 0; - - - $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval($dummy[$idk]['qty']) : 0; - $gui->tplans[$idk]['build_qty'] = isset($buildQty[$idk]['build_qty']) ? intval($buildQty[$idk]['build_qty']) : 0; - if( $gui->drawPlatformQtyColumn ) - { - $plat = $tplan_mgr->getPlatforms($idk); - $gui->tplans[$idk]['platform_qty'] = is_null($plat) ? 0 : count($plat); - } - - - // Get rights for each test plan - foreach($rightSet as $target) - { - // DEV NOTE - CRITIC - // I've made a theorically good performance choice to - // assign to $roleObj a reference to different roleObj - // UNFORTUNATELLY this choice was responsible to destroy point object - // since second LOOP - $roleObj = null; - if($gui->tplans[$idk]['has_role'] > 0) - { - $roleObj = $args->user->tplanRoles[$gui->tplans[$idk]['has_role']]; - } - else if (!is_null($args->user->tprojectRoles) && - isset($args->user->tprojectRoles[$args->tproject_id]) ) - { - $roleObj = $args->user->tprojectRoles[$args->tproject_id]; - } - - if(is_null($roleObj)) - { - $roleObj = $args->user->globalRole; - } - $gui->tplans[$idk]['rights'][$target] = $roleObj->hasRight($target); - } - } - unset($tplan_mgr); - } - unset($tproject_mgr); +tproject_id && checkRights($db, $args->user, $args->tproject_id)) { + $tproject_mgr = new testproject($db); + $gui->tplans = $args->user->getAccessibleTestPlans($db, $args->tproject_id, + null, array( + 'output' => 'mapfull', + 'active' => null + )); + $gui->drawPlatformQtyColumn = false; + + if (! is_null($gui->tplans) && count($gui->tplans) > 0) { + // do this test project has platform definitions ? + $tplan_mgr = new testplan($db); + $tplan_mgr->platform_mgr->setTestProjectID($args->tproject_id); + $dummy = $tplan_mgr->platform_mgr->testProjectCount(); + $gui->drawPlatformQtyColumn = $dummy[$args->tproject_id]['platform_qty'] > + 0; + + $tplanSet = array_keys($gui->tplans); + $dummy = $tplan_mgr->count_testcases($tplanSet, null, + array( + 'output' => 'groupByTestPlan' + )); + $buildQty = $tplan_mgr->get_builds($tplanSet, null, null, + array( + 'getCount' => true + )); + $rightSet = array( + 'testplan_user_role_assignment' + ); + + // To create the CF columns we need to get the linked CF + $availableCF = (array) $tplan_mgr->get_linked_cfields_at_design( + current($tplanSet), $gui->tproject_id); + $hasCF = count($availableCF); + $gui->cfieldsColumns = null; + $gui->cfieldsType = null; + $initCFCol = true; + + // get CF used to configure HIDE COLS + // We want different configurations for different test projects + // then will do two steps algorithm + // 1. get test project prefix PPFX + // 2. look for TL_TPLANVIEW_HIDECOL_PPFX + // 3. if found proceed + // 4. else look for TL_TPLANVIEW_HIDECOL + // + $ppfx = $tproject_mgr->getTestCasePrefix($gui->tproject_id); + $suffixSet = [ + '_' . $ppfx, + '' + ]; + foreach ($suffixSet as $suf) { + $gopt['name'] = 'TL_TPLANVIEW_HIDECOL' . $suf; + $col2hideCF = $tplan_mgr->cfield_mgr->get_linked_to_testproject( + $gui->tproject_id, null, $gopt); + + if ($col2hideCF != null) { + $col2hideCF = current($col2hideCF); + $col2hide = array_flip( + explode('|', $col2hideCF['possible_values'])); + $col2hide[$gopt['name']] = ''; + break; + } + } + + $localeDateFormat = config_get('locales_date_format'); + $localeDateFormat = $localeDateFormat[$args->user->locale]; + + foreach ($tplanSet as $idk) { + if ($hasCF) { + $cfields = (array) $tplan_mgr->getCustomFieldsValues($idk, + $gui->tproject_id); + foreach ($cfields as $cfd) { + if ($initCFCol && ! isset($col2hide[$cfd['name']])) { + $gui->cfieldsColumns[] = $cfd['label']; + $gui->cfieldsType[] = $cfd['type']; + } + $gui->tplans[$idk][$cfd['label']] = [ + 'value' => $cfd['value'], + 'data-order' => $cfd['value'] + ]; + + if ($cfd['type'] == 'date') { + $gui->tplans[$idk][$cfd['label']]['data-order'] = locateDateToISO( + $cfd['value'], $localeDateFormat); + } + } + $initCFCol = false; + } + + $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval( + $dummy[$idk]['qty']) : 0; + + $gui->tplans[$idk]['tcase_qty'] = isset($dummy[$idk]['qty']) ? intval( + $dummy[$idk]['qty']) : 0; + $gui->tplans[$idk]['build_qty'] = isset( + $buildQty[$idk]['build_qty']) ? intval( + $buildQty[$idk]['build_qty']) : 0; + if ($gui->drawPlatformQtyColumn) { + $plat = $tplan_mgr->getPlatforms($idk); + $gui->tplans[$idk]['platform_qty'] = is_null($plat) ? 0 : count( + $plat); + } + + // Get rights for each test plan + foreach ($rightSet as $target) { + // DEV NOTE - CRITIC + // I've made a theorically good performance choice to + // assign to $roleObj a reference to different roleObj + // UNFORTUNATELLY this choice was responsible to destroy point object + // since second LOOP + $roleObj = null; + if ($gui->tplans[$idk]['has_role'] > 0) { + $roleObj = $args->user->tplanRoles[$gui->tplans[$idk]['has_role']]; + } elseif (! is_null($args->user->tprojectRoles) && + isset($args->user->tprojectRoles[$args->tproject_id])) { + $roleObj = $args->user->tprojectRoles[$args->tproject_id]; + } + + if (is_null($roleObj)) { + $roleObj = $args->user->globalRole; + } + $gui->tplans[$idk]['rights'][$target] = $roleObj->hasRight( + $target); + } + } + unset($tplan_mgr); + } + unset($tproject_mgr); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass object with some REQUEST and SESSION values as members + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? trim( + $_SESSION['testprojectName']) : ''; + + $args->user = $_SESSION['currentUser']; + return $args; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $gui = new stdClass(); + $gui->tproject_id = $argsObj->tproject_id; + $gui->tplans = null; + $gui->user_feedback = ''; + $gui->grants = new stdClass(); + $gui->grants->testplan_create = $argsObj->user->hasRight($dbHandler, + "mgt_testplan_create", $argsObj->tproject_id); + $gui->main_descr = lang_get('testplan_title_tp_management') . " - " . + lang_get('testproject') . ' ' . $argsObj->tproject_name; + $cfg = getWebEditorCfg('testplan'); + $gui->editorType = $cfg['type']; + + return $gui; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param int $tproject_id + * @return boolean + */ +function checkRights(&$db, &$user, $tproject_id) +{ + return $user->hasRight($db, 'mgt_testplan_create', $tproject_id); } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * init_args - * - */ -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0 ; - $args->tproject_name = isset($_SESSION['testprojectName']) ? trim($_SESSION['testprojectName']) : '' ; - - $args->user = $_SESSION['currentUser']; - return $args; -} - -function initializeGui(&$dbHandler,$argsObj) -{ - $gui = new stdClass(); - $gui->tproject_id = $argsObj->tproject_id; - $gui->tplans = null; - $gui->user_feedback = ''; - $gui->grants = new stdClass(); - $gui->grants->testplan_create = $argsObj->user->hasRight($dbHandler,"mgt_testplan_create",$argsObj->tproject_id); - $gui->main_descr = lang_get('testplan_title_tp_management'). " - " . - lang_get('testproject') . ' ' . $argsObj->tproject_name; - $cfg = getWebEditorCfg('testplan'); - $gui->editorType = $cfg['type']; - - return $gui; -} - - -/** - * checkRights - * - */ -function checkRights(&$db,&$user,$tproject_id) -{ - return $user->hasRight($db,'mgt_testplan_create',$tproject_id); -} \ No newline at end of file diff --git a/lib/plan/tc_exec_assignment.php b/lib/plan/tc_exec_assignment.php index c5df7de217..d20a458afd 100644 --- a/lib/plan/tc_exec_assignment.php +++ b/lib/plan/tc_exec_assignment.php @@ -1,643 +1,667 @@ -tproject_id = $args->tproject_id; -$context->tplan_id = $args->tplan_id; -checkRights($db,$_SESSION['currentUser'],$context); - -$keywordsFilter = new stdClass(); -$keywordsFilter->items = null; -$keywordsFilter->type = null; -if(is_array($args->keyword_id)) -{ - $keywordsFilter->items = $args->keyword_id; - $keywordsFilter->type = $gui->keywordsFilterType; -} -$arrData = array(); - -$status_map = $assignment_mgr->get_available_status(); -$types_map = $assignment_mgr->get_available_types(); -$cfg['task_test_execution'] = $types_map['testcase_execution']['id']; -$task_test_execution = $cfg['task_test_execution']; - -switch($args->doAction) -{ - case 'std': - if(!is_null($args->achecked_tc)) - { - $open = $status_map['open']['id']; - $db_now = $db->db_now(); - $features2 = array( 'upd' => array(), 'ins' => array(), 'del' => array()); - $method2call = array( 'upd' => 'update', 'ins' => 'assign', 'del' => 'delete_by_feature_id_and_build_id'); - $called = array( 'upd' => false, 'ins' => false, 'del' => false); - - foreach($args->achecked_tc as $key_tc => $platform_tcversion) - { - foreach($platform_tcversion as $platform_id => $tcversion_id) - { - $feature_id = $args->feature_id[$key_tc][$platform_id]; - - $op='ins'; - $features2[$op][$platform_id][$feature_id]['user_id'] = $args->tester_for_tcid[$key_tc][$platform_id]; - $features2[$op][$platform_id][$feature_id]['type'] = $task_test_execution; - $features2[$op][$platform_id][$feature_id]['status'] = $open; - $features2[$op][$platform_id][$feature_id]['creation_ts'] = $db_now; - $features2[$op][$platform_id][$feature_id]['assigner_id'] = $args->user_id; - $features2[$op][$platform_id][$feature_id]['tcase_id'] = $key_tc; - $features2[$op][$platform_id][$feature_id]['tcversion_id'] = $tcversion_id; - $features2[$op][$platform_id][$feature_id]['build_id'] = $args->build_id; - } - - } - - foreach($features2 as $key => $featByPlatform) - { - if( count($features2[$key]) > 0 ) - { - foreach($featByPlatform as $plat => $values) - { - $assignment_mgr->assign($values); - } - $called[$key]=true; - } - } - - if($args->send_mail) - { - foreach($called as $ope => $ope_status) - { - if($ope_status) - { - send_mail_to_testers($db,$tcase_mgr,$gui,$args,$features2[$ope],$ope); - } - } - } // if($args->send_mail) - } - break; - - - case 'doRemoveAll': - if(!is_null($args->achecked_tc)) { - doRemoveAll($db,$args,$gui,$cfg,$objMgr); - } - break; - - case 'doRemove': - $signature[] = array('type' => $task_test_execution, - 'user_id' => $args->targetUser, - 'feature_id' => $args->targetFeature, - 'build_id' => $args->build_id); - $assignment_mgr->deleteBySignature($signature); - - if($args->send_mail) - { - // In order to send mail to tester we need info about test case, test case version - // and build, and we need to use feature_id to get this info - $feature = current($tplan_mgr->getFeatureByID($args->targetFeature)); - - $items = array(); - $lnk[$args->targetFeature] = array(); - $lnk[$args->targetFeature]['previous_user_id'] = array($args->targetUser); - $lnk[$args->targetFeature]['tcase_id'] = intval($feature['tcase_id']); - $lnk[$args->targetFeature]['tcversion_id'] = intval($feature['tcversion_id']); - $items[intval($feature['platform_id'])] = $lnk; - - send_mail_to_testers($db,$tcase_mgr,$gui,$args,$items,'del'); - } - break; - - case 'linkByMail': - $context = array('tplan_id' => $args->tplan_id, - 'build_id' => $args->build_id); - $assignment_mgr->emailLinkToExecPlanning($context,$args->userSet); - break; - - case 'doBulkUserRemove': - if(!is_null($args->achecked_tc) && !is_null($args->userSet)) { - doBulkUserRemove($db,$args,$gui,$cfg,$objMgr); - } - break; - - -} - - - - - -switch($args->level) { - case 'testcase': - // build the data need to call gen_spec_view - $xx = $tcase_mgr->getPathLayered(array($args->id)); - $yy = array_keys($xx); // done to silence warning on end() - $tsuite_data['id'] = end($yy); - $tsuite_data['name'] = $xx[$tsuite_data['id']]['value']; - - $xx = $tplan_mgr->getLinkInfo($args->tplan_id,$args->id,$args->control_panel['setting_platform'], - array('output' => 'assignment_info','build4assignment' => $args->build_id)); - - $linked_items[$args->id] = $xx; - $opt = array('write_button_only_if_linked' => 1, 'user_assignments_per_build' => $args->build_id, - 'useOptionalArrayFields' => true); - - $filters = array('keywords' => $keywordsFilter->items, 'testcases' => $args->id); - - $my_out = gen_spec_view($db,'testplan',$args->tplan_id,$tsuite_data['id'],$tsuite_data['name'], - $linked_items,null,$filters,$opt); - - // index 0 contains data for the parent test suite of this test case, - // other elements are not needed. - $out = array(); - $out['spec_view'][0] = $my_out['spec_view'][0]; - $out['num_tc'] = 1; - break; - - case 'testsuite': - $filters = array(); - $filters['keywordsFilter'] = $keywordsFilter; - $filters['testcaseFilter'] = (isset($args->testcases_to_show)) ? $args->testcases_to_show : null; - $filters['assignedToFilter'] = property_exists($args,'filter_assigned_to') ? $args->filter_assigned_to : null; - $filters['executionTypeFilter'] = $args->control_panel['filter_execution_type']; - $filters['cfieldsFilter'] = $args->control_panel['filter_custom_fields']; - - // ORDER IS CRITIC - Attention in refactoring - $opt = array('assigned_on_build' => $args->build_id, 'addPriority' => true, - 'addExecInfo' => false); - $filters += $opt; - $opt['accessKeyType'] = 'tcase+platform+stackOnUser'; - $opt['useOptionalArrayFields'] = true; - $opt['tlFeature'] = 'testCaseExecTaskAssignment'; - - // platform filter is generated inside getFilteredSpecView() using $args->control_panel['setting_platform']; - // $out = getFilteredSpecView($db, $args, $tplan_mgr, $tcase_mgr, $filters, $opt); - - $out = getFilteredSpecViewFlat($db, $args, $tplan_mgr, $tcase_mgr, $filters, $opt); - break; - - default: - show_instructions('tc_exec_assignment'); - break; -} - - -$gui->items = $out['spec_view']; - -// useful to avoid error messages on smarty template. -$gui->items_qty = is_null($gui->items) ? 0 : count($gui->items); -$gui->has_tc = $out['num_tc'] > 0 ? 1:0; -$gui->support_array = array_keys($gui->items); - -if ($_SESSION['testprojectOptions']->testPriorityEnabled) -{ - $cfg = config_get('priority'); - $gui->priority_labels = init_labels($cfg["code_label"]); -} - -// Changing to _flat template -$tplCfg = templateConfiguration(); -$tpl = $tplCfg->tpl; -$tpl = str_replace('.tpl', '_flat.tpl', $tpl); - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($tpl); - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $args->user_id = intval($_SESSION['userID']); - $args->tproject_id = intval($_SESSION['testprojectID']); - $args->tproject_name = $_SESSION['testprojectName']; - - $key2loop = array('doActionButton' => null, 'doAction' => null,'level' => null , 'achecked_tc' => null, - 'version_id' => 0, 'has_prev_assignment' => null, 'send_mail' => false, - 'tester_for_tcid' => null, 'feature_id' => null, 'id' => 0); - - foreach($key2loop as $key => $value) - { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; - } - - $args->userSet = null; - $target = $_REQUEST['bulk_tester_div']; - if(isset($target) && count($target) > 0) { - foreach($target as $uid) { - if($uid > 0) { - $args->userSet[$uid] = $uid; - } - } - } - - // For more information about the data accessed in session here, see the comment - // in the file header of lib/functions/tlTestCaseFilterControl.class.php. - $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $mode = 'plan_mode'; - $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; - - $args->control_panel = $session_data; - - $key2loop = array('refreshTree' => array('key' => 'setting_refresh_tree_on_action', 'value' => 0), - 'filter_assigned_to' => array('key' => 'filter_assigned_user', 'value' => null)); - - foreach($key2loop as $key => $info) - { - $args->$key = isset($session_data[$info['key']]) ? $session_data[$info['key']] : $info['value']; - } - - - $args->keyword_id = 0; - $fk = 'filter_keywords'; - if (isset($session_data[$fk])) - { - $args->keyword_id = $session_data[$fk]; - if (is_array($args->keyword_id) && count($args->keyword_id) == 1) - { - $args->keyword_id = $args->keyword_id[0]; - } - } - - $args->keywordsFilterType = null; - $fk = 'filter_keywords_filter_type'; - if (isset($session_data[$fk])) - { - $args->keywordsFilterType = $session_data[$fk]; - } - - - $args->testcases_to_show = null; - if (isset($session_data['testcases_to_show'])) - { - $args->testcases_to_show = $session_data['testcases_to_show']; - } - - $args->build_id = intval(isset($session_data['setting_build']) ? $session_data['setting_build'] : 0); - $args->platform_id = intval(isset($session_data['setting_platform']) ? - $session_data['setting_platform'] : 0); - - $args->tplan_id = intval(isset($session_data['setting_testplan']) ? $session_data['setting_testplan'] : 0); - if ($args->tplan_id) - { - $args->tplan_id = intval(isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); - } - - - $args->targetFeature = intval(isset($_REQUEST['targetFeature']) ? $_REQUEST['targetFeature'] : 0); - $args->targetUser = intval(isset($_REQUEST['targetUser']) ? $_REQUEST['targetUser'] : 0); - - - $key = 'doRemoveAll'; - if( ($args->$key = isset($_REQUEST[$key]) ? 1 : 0) ) - { - $args->doAction = $key; - } - - return $args; -} - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr,&$tcaseMgr) -{ - $platform_mgr = new tlPlatform($dbHandler,$argsObj->tproject_id); - - $tcase_cfg = config_get('testcase_cfg'); - $gui = new stdClass(); - - $optLTT = null; - $gui->platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id,$optLTT); - - $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan($argsObj->tplan_id); - $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap($argsObj->tplan_id); - $gui->bulk_platforms[0] = lang_get("all_platforms"); - ksort($gui->bulk_platforms); - - $gui->send_mail = $argsObj->send_mail; - $gui->send_mail_checked = ""; - if($gui->send_mail) - { - $gui->send_mail_checked = ' checked="checked" '; - } - - $gui->glueChar=$tcase_cfg->glue_character; - - if ($argsObj->level != 'testproject') - { - $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->testCasePrefix .= $tcase_cfg->glue_character; - $gui->keywordsFilterType = $argsObj->keywordsFilterType; - $gui->build_id = $argsObj->build_id; - $gui->tplan_id = $argsObj->tplan_id; - - $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->testPlanName = $tplan_info['name']; - - $build_info = $tplanMgr->get_build_by_id($argsObj->tplan_id, $argsObj->build_id); - $gui->buildName = $build_info['name']; - $gui->main_descr = sprintf(lang_get('title_tc_exec_assignment'),$gui->buildName, $gui->testPlanName); - - $tproject_mgr = new testproject($dbHandler); - $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); - - $gui->all_users = tlUser::getAll($dbHandler,null,"id",null); - $gui->users = getUsersForHtmlOptions($dbHandler,null,null,null,$gui->all_users); - $gui->testers = getTestersForHtmlOptions($dbHandler,$argsObj->tplan_id,$tproject_info,$gui->all_users); - } - - return $gui; -} - - -/** - * send_mail_to_testers - * - * @param hash $features main key platform_id - * @param string $operation - * - * @return void - */ -function send_mail_to_testers(&$dbHandler,&$tcaseMgr,&$guiObj,&$argsObj,$features,$operation) -{ - $testers['new']=null; - $testers['old']=null; - $lb = array('platform' => null, 'testplan' => null, 'testproject' => null, - 'build' =>null); - $lbl = init_labels($lb); - - $mail_details['new']=lang_get('mail_testcase_assigned') . "

    "; - $mail_details['old']=lang_get('mail_testcase_assignment_removed'). "

    "; - $mail_subject['new']=lang_get('mail_subject_testcase_assigned'); - $mail_subject['old']=lang_get('mail_subject_testcase_assignment_removed'); - $use_testers['new']= ($operation == 'del') ? false : true ; - $use_testers['old']= ($operation == 'ins') ? false : true ; - - $tcaseSet=null; - $tcnames=null; - - $assigner=$guiObj->all_users[$argsObj->user_id]->firstName . ' ' . - $guiObj->all_users[$argsObj->user_id]->lastName ; - - - $email=array(); - $email['from_address']=config_get('from_email'); - $email['attachment'] = null; - $email['cc'] = null; - $email['exit_on_error'] = true; - $email['htmlFormat'] = true; - - $body_header = $lbl['testproject'] . ': ' . $argsObj->tproject_name . '
    ' . - $lbl['testplan'] . ': ' . $guiObj->testPlanName .'
    ' . - $lbl['build'] . ': ' . $guiObj->buildName .'

    '; - - - // Do we really have platforms? - $pset = array_flip(array_keys($features)); - if ($hasPlat = !isset($pset[0])) { - $platMgr = new tlPlatform($dbHandler,$argsObj->tproject_id); - $platSet = $platMgr->getAllAsMap(); - } - - // Get testers id & item set with test case & test case version - foreach($features as $platform_id => $items) - { - $plat[$platform_id] = $platform_id; - foreach( $items as $feature_id => $value ) - { - if( $use_testers['new'] || $use_testers['old'] ) - { - if( $use_testers['new'] ) - { - $ty = (array)$value['user_id']; - $accessKey = 'new'; - } - - if( $use_testers['old'] ) - { - $ty = (array)$value['previous_user_id']; - $accessKey = 'old'; - } - - foreach( $ty as $user_id ) - { - $testers[$accessKey][$user_id][$platform_id][$feature_id]=$value['tcase_id']; - } - } - - $tcaseSet[$value['tcase_id']]=$value['tcase_id']; - $tcversionSet[$value['tcversion_id']]=$value['tcversion_id']; - } - } - - $infoSet = $tcaseMgr->get_by_id_bulk($tcaseSet,$tcversionSet); - foreach($infoSet as $value) - { - $tcnames[$value['testcase_id']] = $guiObj->testCasePrefix . $value['tc_external_id'] . ' ' . $value['name']; - } - - $path_info = $tcaseMgr->tree_manager->get_full_path_verbose($tcaseSet); - $flat_path=null; - foreach($path_info as $tcase_id => $pieces) - { - $flat_path[$tcase_id]=implode('/',$pieces) . '/' . $tcnames[$tcase_id]; - } - - $validator = new Zend_Validate_EmailAddress(); - foreach($testers as $tester_type => $tester_set) - { - if( !is_null($tester_set) ) - { - $email['subject'] = $mail_subject[$tester_type] . ' ' . $guiObj->testPlanName; - foreach($tester_set as $user_id => $set2work) - { - // workaround till solution will be found - if($user_id <= 0) - { - continue; - } - - $userObj=$guiObj->all_users[$user_id]; - $email['to_address'] = trim($userObj->emailAddress); - if($email['to_address'] == '' || !$validator->isValid($email['to_address'])) - { - continue; - } - - $email['body'] = $body_header; - $email['body'] .= sprintf($mail_details[$tester_type], - $userObj->firstName . ' ' .$userObj->lastName,$assigner); - - foreach ($set2work as $pid => $value) - { - if( $pid != 0 ) - { - $email['body'] .= $lbl['platform'] . ': ' . $platSet[$pid] . '
    '; - } - - foreach($value as $tcase_id) - { - $email['body'] .= $flat_path[$tcase_id] . '
    '; - $wl = $tcaseMgr->buildDirectWebLink($_SESSION['basehref'],$tcase_id, - $argsObj->testproject_id); - - $email['body'] .= '' . - 'direct link to test case spec ' . - '' . - '

    '; - - } - } - - - $email['body'] .= '
    ' . date(DATE_RFC1123); - - $email_op = email_send($email['from_address'], $email['to_address'], - $email['subject'], $email['body'], $email['cc'], - $email['attachment'],$email['exit_on_error'], - $email['htmlFormat']); - } // foreach($tester_set as $user_id => $value) - } - } -} - -/** - * - */ -function doRemoveAll(&$dbH,&$argsObj,&$guiObj,$cfg,$oMgr) { - $op='del'; - $features2[$op] = array(); - - foreach($argsObj->achecked_tc as $key_tc => $ptc) { - foreach($ptc as $platform_id => $tcversion_id) { - $fid = $argsObj->feature_id[$key_tc][$platform_id]; - $features2[$op][$fid]['type'] = $cfg['task_test_execution']; - $features2[$op][$fid]['build_id'] = $argsObj->build_id; - } - } - - // Must be done before delete - if($argsObj->send_mail) { - $fSet = array_keys($features2[$op]); - $items = $oMgr['tplan']->getFeatureByID($fSet); - $testers = $oMgr['assign']->getUsersByFeatureBuild($fSet,$argsObj->build_id,$cfg['task_test_execution']); - - $f4mail = array(); - foreach($items as $fid => $value) - { - $pid = $value['platform_id']; - $f4mail[$pid][$fid]['previous_user_id'] = array_keys($testers[$fid]); - $f4mail[$pid][$fid]['tcase_id'] = $items[$fid]['tcase_id']; - $f4mail[$pid][$fid]['tcversion_id'] = $items[$fid]['tcversion_id']; - } - } - - - foreach($features2 as $key => $values) { - if( count($features2[$key]) > 0 ) { - $oMgr['assign']->delete_by_feature_id_and_build_id($values); - } - } - - if($argsObj->send_mail) { - send_mail_to_testers($dbH,$oMgr['tcase'],$guiObj,$argsObj,$f4mail,'del'); - } -} - -/** - * - */ -function doBulkUserRemove(&$dbH,&$argsObj,&$guiObj,$cfg,$oMgr) { - - $feat = null; - if(!is_null($argsObj->achecked_tc)) { - foreach($argsObj->achecked_tc as $key_tc => $ptc) { - foreach($ptc as $platform_id => $tcversion_id) { - foreach($argsObj->userSet as $user2remove) { - $fid = $argsObj->feature_id[$key_tc][$platform_id]; - $feat[$fid]['type'] = $cfg['task_test_execution']; - $feat[$fid]['feature_id'] = $fid; - $feat[$fid]['build_id'] = $argsObj->build_id; - $feat[$fid]['user_id'] = $user2remove; - } - } - } - - // Must be done before delete - if($argsObj->send_mail) { - $fSet = array_keys($feat); - $items = $oMgr['tplan']->getFeatureByID($fSet); - $testers = $oMgr['assign']->getUsersByFeatureBuild($fSet,$argsObj->build_id,$cfg['task_test_execution']); - - $f4mail = array(); - foreach($items as $fid => $value) { - $pid = $value['platform_id']; - $f4mail[$pid][$fid]['previous_user_id'] = array_keys($testers[$fid]); - $f4mail[$pid][$fid]['tcase_id'] = $items[$fid]['tcase_id']; - $f4mail[$pid][$fid]['tcversion_id'] = $items[$fid]['tcversion_id']; - } - } - - $oMgr['assign']->deleteBySignature($feat); - - if($argsObj->send_mail) { - send_mail_to_testers($dbH,$oMgr['tcase'],$guiObj,$argsObj,$f4mail,'del'); - } - - } -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["exec_assign_testcases"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +$context->tplan_id = $args->tplan_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$keywordsFilter = new stdClass(); +$keywordsFilter->items = null; +$keywordsFilter->type = null; +if (is_array($args->keyword_id)) { + $keywordsFilter->items = $args->keyword_id; + $keywordsFilter->type = $gui->keywordsFilterType; +} +$arrData = array(); + +$status_map = $assignment_mgr->get_available_status(); +$types_map = $assignment_mgr->get_available_types(); +$cfg['task_test_execution'] = $types_map['testcase_execution']['id']; +$task_test_execution = $cfg['task_test_execution']; + +switch ($args->doAction) { + case 'std': + if (! is_null($args->achecked_tc)) { + $open = $status_map['open']['id']; + $db_now = $db->db_now(); + $features2 = array( + 'upd' => array(), + 'ins' => array(), + 'del' => array() + ); + $method2call = array( + 'upd' => 'update', + 'ins' => 'assign', + 'del' => 'delete_by_feature_id_and_build_id' + ); + $called = array( + 'upd' => false, + 'ins' => false, + 'del' => false + ); + + foreach ($args->achecked_tc as $key_tc => $platform_tcversion) { + foreach ($platform_tcversion as $platform_id => $tcversion_id) { + $feature_id = $args->feature_id[$key_tc][$platform_id]; + + $op = 'ins'; + $features2[$op][$platform_id][$feature_id]['user_id'] = $args->tester_for_tcid[$key_tc][$platform_id]; + $features2[$op][$platform_id][$feature_id]['type'] = $task_test_execution; + $features2[$op][$platform_id][$feature_id]['status'] = $open; + $features2[$op][$platform_id][$feature_id]['creation_ts'] = $db_now; + $features2[$op][$platform_id][$feature_id]['assigner_id'] = $args->user_id; + $features2[$op][$platform_id][$feature_id]['tcase_id'] = $key_tc; + $features2[$op][$platform_id][$feature_id]['tcversion_id'] = $tcversion_id; + $features2[$op][$platform_id][$feature_id]['build_id'] = $args->build_id; + } + } + + foreach ($features2 as $key => $featByPlatform) { + if (count($features2[$key]) > 0) { + foreach ($featByPlatform as $values) { + $assignment_mgr->assign($values); + } + $called[$key] = true; + } + } + + if ($args->send_mail) { + foreach ($called as $ope => $ope_status) { + if ($ope_status) { + sendMailToTesters($db, $tcaseMgr, $gui, $args, + $features2[$ope], $ope); + } + } + } + } + break; + + case 'doRemoveAll': + if (! is_null($args->achecked_tc)) { + doRemoveAll($db, $args, $gui, $cfg, $objMgr); + } + break; + + case 'doRemove': + $signature[] = array( + 'type' => $task_test_execution, + 'user_id' => $args->targetUser, + 'feature_id' => $args->targetFeature, + 'build_id' => $args->build_id + ); + $assignment_mgr->deleteBySignature($signature); + + if ($args->send_mail) { + // In order to send mail to tester we need info about test case, test case version + // and build, and we need to use feature_id to get this info + $feature = current($tplan_mgr->getFeatureByID($args->targetFeature)); + + $items = array(); + $lnk[$args->targetFeature] = array(); + $lnk[$args->targetFeature]['previous_user_id'] = array( + $args->targetUser + ); + $lnk[$args->targetFeature]['tcase_id'] = intval( + $feature['tcase_id']); + $lnk[$args->targetFeature]['tcversion_id'] = intval( + $feature['tcversion_id']); + $items[intval($feature['platform_id'])] = $lnk; + + sendMailToTesters($db, $tcaseMgr, $gui, $args, $items, 'del'); + } + break; + + case 'linkByMail': + $context = array( + 'tplan_id' => $args->tplan_id, + 'build_id' => $args->build_id + ); + $assignment_mgr->emailLinkToExecPlanning($context, $args->userSet); + break; + + case 'doBulkUserRemove': + if (! is_null($args->achecked_tc) && ! is_null($args->userSet)) { + doBulkUserRemove($db, $args, $gui, $cfg, $objMgr); + } + break; +} + +switch ($args->level) { + case 'testcase': + // build the data need to call gen_spec_view + $xx = $tcaseMgr->getPathLayered(array( + $args->id + )); + $yy = array_keys($xx); // done to silence warning on end() + $tsuite_data['id'] = end($yy); + $tsuite_data['name'] = $xx[$tsuite_data['id']]['value']; + + $xx = $tplan_mgr->getLinkInfo($args->tplan_id, $args->id, + $args->control_panel['setting_platform'], + array( + 'output' => 'assignment_info', + 'build4assignment' => $args->build_id + )); + + $linked_items[$args->id] = $xx; + $opt = array( + 'write_button_only_if_linked' => 1, + 'user_assignments_per_build' => $args->build_id, + 'useOptionalArrayFields' => true + ); + + $filters = array( + 'keywords' => $keywordsFilter->items, + 'testcases' => $args->id + ); + + $my_out = gen_spec_view($db, 'testplan', $args->tplan_id, + $tsuite_data['id'], $tsuite_data['name'], $linked_items, null, + $filters, $opt); + + // index 0 contains data for the parent test suite of this test case, + // other elements are not needed. + $out = array(); + $out['spec_view'][0] = $my_out['spec_view'][0]; + $out['num_tc'] = 1; + break; + + case 'testsuite': + $filters = array(); + $filters['keywordsFilter'] = $keywordsFilter; + $filters['testcaseFilter'] = (isset($args->testcases_to_show)) ? $args->testcases_to_show : null; + $filters['assignedToFilter'] = property_exists($args, + 'filter_assigned_to') ? $args->filter_assigned_to : null; + $filters['executionTypeFilter'] = $args->control_panel['filter_execution_type']; + $filters['cfieldsFilter'] = $args->control_panel['filter_custom_fields']; + + // ORDER IS CRITIC - Attention in refactoring + $opt = array( + 'assigned_on_build' => $args->build_id, + 'addPriority' => true, + 'addExecInfo' => false + ); + $filters += $opt; + $opt['accessKeyType'] = 'tcase+platform+stackOnUser'; + $opt['useOptionalArrayFields'] = true; + $opt['tlFeature'] = 'testCaseExecTaskAssignment'; + + // platform filter is generated inside getFilteredSpecView() using $args->control_panel['setting_platform']; + // $out = getFilteredSpecView($db, $args, $tplan_mgr, $tcaseMgr, $filters, $opt); + + $out = getFilteredSpecViewFlat($db, $args, $tplan_mgr, $tcaseMgr, + $filters, $opt); + break; + + default: + show_instructions('tc_exec_assignment'); + break; +} + +$gui->items = $out['spec_view']; + +// useful to avoid error messages on smarty template. +$gui->items_qty = is_null($gui->items) ? 0 : count($gui->items); +$gui->has_tc = $out['num_tc'] > 0 ? 1 : 0; +$gui->support_array = array_keys($gui->items); + +if ($_SESSION['testprojectOptions']->testPriorityEnabled) { + $cfg = config_get('priority'); + $gui->priority_labels = init_labels($cfg["code_label"]); +} + +// Changing to _flat template +$tplCfg = templateConfiguration(); +$tpl = $tplCfg->tpl; +$tpl = str_replace('.tpl', '_flat.tpl', $tpl); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($tpl); + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $args->user_id = intval($_SESSION['userID']); + $args->tproject_id = intval($_SESSION['testprojectID']); + $args->tproject_name = $_SESSION['testprojectName']; + + $key2loop = array( + 'doActionButton' => null, + 'doAction' => null, + 'level' => null, + 'achecked_tc' => null, + 'version_id' => 0, + 'has_prev_assignment' => null, + 'send_mail' => false, + 'tester_for_tcid' => null, + 'feature_id' => null, + 'id' => 0 + ); + + foreach ($key2loop as $key => $value) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; + } + + $args->userSet = null; + $target = $_REQUEST['bulk_tester_div']; + if (isset($target) && count($target) > 0) { + foreach ($target as $uid) { + if ($uid > 0) { + $args->userSet[$uid] = $uid; + } + } + } + + // For more information about the data accessed in session here, see the comment + // in the file header of lib/functions/tlTestCaseFilterControl.class.php. + $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $mode = 'plan_mode'; + $session_data = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; + + $args->control_panel = $session_data; + + $key2loop = array( + 'refreshTree' => array( + 'key' => 'setting_refresh_tree_on_action', + 'value' => 0 + ), + 'filter_assigned_to' => array( + 'key' => 'filter_assigned_user', + 'value' => null + ) + ); + + foreach ($key2loop as $key => $info) { + $args->$key = isset($session_data[$info['key']]) ? $session_data[$info['key']] : $info['value']; + } + + $args->keyword_id = 0; + $fk = 'filter_keywords'; + if (isset($session_data[$fk])) { + $args->keyword_id = $session_data[$fk]; + if (is_array($args->keyword_id) && count($args->keyword_id) == 1) { + $args->keyword_id = $args->keyword_id[0]; + } + } + + $args->keywordsFilterType = null; + $fk = 'filter_keywords_filter_type'; + if (isset($session_data[$fk])) { + $args->keywordsFilterType = $session_data[$fk]; + } + + $args->testcases_to_show = null; + if (isset($session_data['testcases_to_show'])) { + $args->testcases_to_show = $session_data['testcases_to_show']; + } + + $args->build_id = intval( + isset($session_data['setting_build']) ? $session_data['setting_build'] : 0); + $args->platform_id = intval( + isset($session_data['setting_platform']) ? $session_data['setting_platform'] : 0); + + $args->tplan_id = intval( + isset($session_data['setting_testplan']) ? $session_data['setting_testplan'] : 0); + if ($args->tplan_id) { + $args->tplan_id = intval( + isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); + } + + $args->targetFeature = intval( + isset($_REQUEST['targetFeature']) ? $_REQUEST['targetFeature'] : 0); + $args->targetUser = intval( + isset($_REQUEST['targetUser']) ? $_REQUEST['targetUser'] : 0); + + $key = 'doRemoveAll'; + if ($args->$key = isset($_REQUEST[$key]) ? 1 : 0) { + $args->doAction = $key; + } + + return $args; +} + +/* + * function: initializeGui + * + * args : + * + * returns: + * + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr, &$tcaseMgr) +{ + $platform_mgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + + $tcase_cfg = config_get('testcase_cfg'); + $gui = new stdClass(); + + $optLTT = null; + $gui->platforms = $platform_mgr->getLinkedToTestplanAsMap( + $argsObj->tplan_id, $optLTT); + + $gui->usePlatforms = $platform_mgr->platformsActiveForTestplan( + $argsObj->tplan_id); + $gui->bulk_platforms = $platform_mgr->getLinkedToTestplanAsMap( + $argsObj->tplan_id); + $gui->bulk_platforms[0] = lang_get("all_platforms"); + ksort($gui->bulk_platforms); + + $gui->send_mail = $argsObj->send_mail; + $gui->send_mail_checked = ""; + if ($gui->send_mail) { + $gui->send_mail_checked = ' checked="checked" '; + } + + $gui->glueChar = $tcase_cfg->glue_character; + + if ($argsObj->level != 'testproject') { + $gui->testCasePrefix = $tcaseMgr->tproject_mgr->getTestCasePrefix( + $argsObj->tproject_id); + $gui->testCasePrefix .= $tcase_cfg->glue_character; + $gui->keywordsFilterType = $argsObj->keywordsFilterType; + $gui->build_id = $argsObj->build_id; + $gui->tplan_id = $argsObj->tplan_id; + + $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->testPlanName = $tplan_info['name']; + + $build_info = $tplanMgr->get_build_by_id($argsObj->tplan_id, + $argsObj->build_id); + $gui->buildName = $build_info['name']; + $gui->main_descr = sprintf(lang_get('title_tc_exec_assignment'), + $gui->buildName, $gui->testPlanName); + + $tproject_mgr = new testproject($dbHandler); + $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); + + $gui->all_users = tlUser::getAll($dbHandler, null, "id", null); + $gui->users = getUsersForHtmlOptions($dbHandler, null, null, null, + $gui->all_users); + $gui->testers = getTestersForHtmlOptions($dbHandler, $argsObj->tplan_id, + $tproject_info, $gui->all_users); + } + + return $gui; +} + +/** + * send_mail_to_testers + * + * @param array $features + * main key platform_id + * @param string $operation + * + * @return void + */ +function sendMailToTesters(&$dbHandler, &$tcaseMgr, &$guiObj, &$argsObj, + $features, $operation) +{ + $testers['new'] = null; + $testers['old'] = null; + $lb = array( + 'platform' => null, + 'testplan' => null, + 'testproject' => null, + 'build' => null + ); + $lbl = init_labels($lb); + + $mail_details['new'] = lang_get('mail_testcase_assigned') . "

    "; + $mail_details['old'] = lang_get('mail_testcase_assignment_removed') . + "

    "; + $mail_subject['new'] = lang_get('mail_subject_testcase_assigned'); + $mail_subject['old'] = lang_get('mail_subject_testcase_assignment_removed'); + $use_testers['new'] = ($operation == 'del') ? false : true; + $use_testers['old'] = ($operation == 'ins') ? false : true; + + $tcaseSet = null; + $tcnames = null; + + $assigner = $guiObj->all_users[$argsObj->user_id]->firstName . ' ' . + $guiObj->all_users[$argsObj->user_id]->lastName; + + $email = array(); + $email['from_address'] = config_get('from_email'); + $email['attachment'] = null; + $email['cc'] = null; + $email['exit_on_error'] = true; + $email['htmlFormat'] = true; + + $body_header = $lbl['testproject'] . ': ' . $argsObj->tproject_name . + '
    ' . $lbl['testplan'] . ': ' . $guiObj->testPlanName . '
    ' . + $lbl['build'] . ': ' . $guiObj->buildName . '

    '; + + // Do we really have platforms? + $pset = array_flip(array_keys($features)); + if (! isset($pset[0])) { + $platMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + $platSet = $platMgr->getAllAsMap(); + } + + // Get testers id & item set with test case & test case version + foreach ($features as $platform_id => $items) { + $plat[$platform_id] = $platform_id; + foreach ($items as $feature_id => $value) { + if ($use_testers['new'] || $use_testers['old']) { + if ($use_testers['new']) { + $ty = (array) $value['user_id']; + $accessKey = 'new'; + } + + if ($use_testers['old']) { + $ty = (array) $value['previous_user_id']; + $accessKey = 'old'; + } + + foreach ($ty as $user_id) { + $testers[$accessKey][$user_id][$platform_id][$feature_id] = $value['tcase_id']; + } + } + + $tcaseSet[$value['tcase_id']] = $value['tcase_id']; + $tcversionSet[$value['tcversion_id']] = $value['tcversion_id']; + } + } + + $infoSet = $tcaseMgr->get_by_id_bulk($tcaseSet, $tcversionSet); + foreach ($infoSet as $value) { + $tcnames[$value['testcase_id']] = $guiObj->testCasePrefix . + $value['tc_external_id'] . ' ' . $value['name']; + } + + $path_info = $tcaseMgr->tree_manager->get_full_path_verbose($tcaseSet); + $flat_path = null; + foreach ($path_info as $tcase_id => $pieces) { + $flat_path[$tcase_id] = implode('/', $pieces) . '/' . $tcnames[$tcase_id]; + } + + $validator = new Zend_Validate_EmailAddress(); + foreach ($testers as $tester_type => $tester_set) { + if (! is_null($tester_set)) { + $email['subject'] = $mail_subject[$tester_type] . ' ' . + $guiObj->testPlanName; + foreach ($tester_set as $user_id => $set2work) { + // workaround till solution will be found + if ($user_id <= 0) { + continue; + } + + $userObj = $guiObj->all_users[$user_id]; + $email['to_address'] = trim($userObj->emailAddress); + if ($email['to_address'] == '' || + ! $validator->isValid($email['to_address'])) { + continue; + } + + $email['body'] = $body_header; + $email['body'] .= sprintf($mail_details[$tester_type], + $userObj->firstName . ' ' . $userObj->lastName, $assigner); + + foreach ($set2work as $pid => $value) { + if ($pid != 0) { + $email['body'] .= $lbl['platform'] . ': ' . + $platSet[$pid] . '
    '; + } + + foreach ($value as $tcase_id) { + $email['body'] .= $flat_path[$tcase_id] . '
    '; + $wl = $tcaseMgr->buildDirectWebLink( + $_SESSION['basehref'], $tcase_id, + $argsObj->testproject_id); + + $email['body'] .= '' . + 'direct link to test case spec ' . '' . + '

    '; + } + } + + $email['body'] .= '
    ' . date(DATE_RFC1123); + + email_send($email['from_address'], $email['to_address'], + $email['subject'], $email['body'], $email['cc'], + $email['attachment'], $email['exit_on_error'], + $email['htmlFormat']); + } + } + } +} + +/** + */ +function doRemoveAll(&$dbH, &$argsObj, &$guiObj, $cfg, $oMgr) +{ + $op = 'del'; + $features2[$op] = array(); + + foreach ($argsObj->achecked_tc as $key_tc => $ptc) { + foreach ($ptc as $platform_id => $tcversion_id) { + $fid = $argsObj->feature_id[$key_tc][$platform_id]; + $features2[$op][$fid]['type'] = $cfg['task_test_execution']; + $features2[$op][$fid]['build_id'] = $argsObj->build_id; + } + } + + // Must be done before delete + if ($argsObj->send_mail) { + $fSet = array_keys($features2[$op]); + $items = $oMgr['tplan']->getFeatureByID($fSet); + $testers = $oMgr['assign']->getUsersByFeatureBuild($fSet, + $argsObj->build_id, $cfg['task_test_execution']); + + $f4mail = array(); + foreach ($items as $fid => $value) { + $pid = $value['platform_id']; + $f4mail[$pid][$fid]['previous_user_id'] = array_keys($testers[$fid]); + $f4mail[$pid][$fid]['tcase_id'] = $items[$fid]['tcase_id']; + $f4mail[$pid][$fid]['tcversion_id'] = $items[$fid]['tcversion_id']; + } + } + + foreach ($features2 as $key => $values) { + if (count($features2[$key]) > 0) { + $oMgr['assign']->delete_by_feature_id_and_build_id($values); + } + } + + if ($argsObj->send_mail) { + sendMailToTesters($dbH, $oMgr['tcase'], $guiObj, $argsObj, $f4mail, + 'del'); + } +} + +/** + */ +function doBulkUserRemove(&$dbH, &$argsObj, &$guiObj, $cfg, $oMgr) +{ + $feat = null; + if (! is_null($argsObj->achecked_tc)) { + foreach ($argsObj->achecked_tc as $key_tc => $ptc) { + foreach ($ptc as $platform_id => $tcversion_id) { + foreach ($argsObj->userSet as $user2remove) { + $fid = $argsObj->feature_id[$key_tc][$platform_id]; + $feat[$fid]['type'] = $cfg['task_test_execution']; + $feat[$fid]['feature_id'] = $fid; + $feat[$fid]['build_id'] = $argsObj->build_id; + $feat[$fid]['user_id'] = $user2remove; + } + } + } + + // Must be done before delete + if ($argsObj->send_mail) { + $fSet = array_keys($feat); + $items = $oMgr['tplan']->getFeatureByID($fSet); + $testers = $oMgr['assign']->getUsersByFeatureBuild($fSet, + $argsObj->build_id, $cfg['task_test_execution']); + + $f4mail = array(); + foreach ($items as $fid => $value) { + $pid = $value['platform_id']; + $f4mail[$pid][$fid]['previous_user_id'] = array_keys( + $testers[$fid]); + $f4mail[$pid][$fid]['tcase_id'] = $items[$fid]['tcase_id']; + $f4mail[$pid][$fid]['tcversion_id'] = $items[$fid]['tcversion_id']; + } + } + + $oMgr['assign']->deleteBySignature($feat); + + if ($argsObj->send_mail) { + sendMailToTesters($dbH, $oMgr['tcase'], $guiObj, $argsObj, $f4mail, + 'del'); + } + } +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "exec_assign_testcases" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/plan/tc_exec_unassign_all.php b/lib/plan/tc_exec_unassign_all.php index 2b27835301..57ae3c4f5c 100644 --- a/lib/plan/tc_exec_unassign_all.php +++ b/lib/plan/tc_exec_unassign_all.php @@ -1,118 +1,116 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - - -$assignment_count = 0; - -$build_name = ""; -if ($args->build_id) { - $assignment_count = $assignment_mgr->get_count_of_assignments_for_build_id($args->build_id); - $build_info = $build_mgr->get_by_id($args->build_id); - $build_name = $build_info['name']; -} - - -if ($assignment_count) { - // there are assignments - if ($args->confirmed) { - // their deletion has been confirmed, so delete them - $assignment_mgr->delete_by_build_id($args->build_id); - $gui->message = sprintf(lang_get('unassigned_all_tcs_msg'), $build_name); - $gui->refreshTree = $args->refreshTree ? true : false; - } else { - // there are assignments, but their deletion has still to be confirmed - $gui->draw_tc_unassign_button = true; - $gui->popup_title = lang_get('unassign_all_tcs_msgbox_title'); - $gui->popup_message = sprintf(lang_get('unassign_all_tcs_warning_msg'), $build_name); - $gui->message = sprintf(lang_get('number_of_assignments_per_build'), $assignment_count, $build_name); - } -} else { - // there are no assignments for this build - $gui->message = lang_get('no_testers_assigned_to_build'); -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function init_args() { - - $args = new stdClass(); - - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->build_id = isset($_REQUEST['build_id']) ? - intval($_REQUEST['build_id']) : 0; - $args->confirmed = isset($_REQUEST['confirmed']) && $_REQUEST['confirmed'] == 'yes' ? true : false; - - $args->user_id = $_SESSION['userID']; - $args->testproject_id = intval($_SESSION['testprojectID']); - $args->testproject_name = $_SESSION['testprojectName']; - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? - $_SESSION['setting_refresh_tree_on_action'] : false; - - return $args; -} - - -/** - * - */ -function init_gui(&$dbHandler, &$argsObj) { - - $gui = new stdClass(); - - $gui->build_id = $argsObj->build_id; - $gui->draw_tc_unassign_button = false; - $gui->refreshTree = false; - - $gui->title = lang_get('remove_all_tester_assignments_title'); - $gui->message = ""; - - $gui->popup_title = ""; - $gui->popup_message = ""; - - return $gui; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["testplan_planning"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$assignment_count = 0; + +$build_name = ""; +if ($args->build_id) { + $assignment_count = $assignment_mgr->get_count_of_assignments_for_build_id( + $args->build_id); + $build_info = $build_mgr->get_by_id($args->build_id); + $build_name = $build_info['name']; +} + +if ($assignment_count) { + // there are assignments + if ($args->confirmed) { + // their deletion has been confirmed, so delete them + $assignment_mgr->delete_by_build_id($args->build_id); + $gui->message = sprintf(lang_get('unassigned_all_tcs_msg'), $build_name); + $gui->refreshTree = $args->refreshTree ? true : false; + } else { + // there are assignments, but their deletion has still to be confirmed + $gui->draw_tc_unassign_button = true; + $gui->popup_title = lang_get('unassign_all_tcs_msgbox_title'); + $gui->popup_message = sprintf(lang_get('unassign_all_tcs_warning_msg'), + $build_name); + $gui->message = sprintf(lang_get('number_of_assignments_per_build'), + $assignment_count, $build_name); + } +} else { + // there are no assignments for this build + $gui->message = lang_get('no_testers_assigned_to_build'); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get input from user and return it in some sort of namespace + * + * @return stdClass object returns the arguments for the page + */ +function initArgs() +{ + $args = new stdClass(); + + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->build_id = isset($_REQUEST['build_id']) ? intval( + $_REQUEST['build_id']) : 0; + $args->confirmed = isset($_REQUEST['confirmed']) && + $_REQUEST['confirmed'] == 'yes' ? true : false; + + $args->user_id = $_SESSION['userID']; + $args->testproject_id = intval($_SESSION['testprojectID']); + $args->testproject_name = $_SESSION['testprojectName']; + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : false; + + return $args; +} + +/** + */ +function initGui(&$dbHandler, &$argsObj) +{ + $gui = new stdClass(); + + $gui->build_id = $argsObj->build_id; + $gui->draw_tc_unassign_button = false; + $gui->refreshTree = false; + + $gui->title = lang_get('remove_all_tester_assignments_title'); + $gui->message = ""; + + $gui->popup_title = ""; + $gui->popup_message = ""; + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "testplan_planning" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/platforms/platformsAssign.php b/lib/platforms/platformsAssign.php index ebb89a47e7..2f7918aba9 100644 --- a/lib/platforms/platformsAssign.php +++ b/lib/platforms/platformsAssign.php @@ -1,181 +1,180 @@ -js_ot_name = 'ot'; -$args = init_args($opt_cfg); - -if ($args->edit == 'testproject') { - show_instructions('platformAssign'); - exit(); -} - - -$smarty = new TLSmarty(); -$tplan_mgr = new testplan($db); -$platform_mgr = new tlPlatform($db, $args->tproject_id); - -$gui = new stdClass(); -$gui->platform_assignment_subtitle = null; -$gui->tplan_id = $args->tplan_id; -$gui->can_do = isset($args->tplan_id); -$gui->mainTitle = lang_get('add_remove_platforms'); -$gui->warning = ''; - -if (isset($args->tplan_id)) { - // do following check to give warning to user - // if test plan has test case versions with platform_id=0 - // this means that right now there are not platforms linked to test plan. - // Give message to user with following info: - // Till you are not going to assign a platform to this linked tcversions - // and it's execution results he/she will not be able to execute - // - $qtyByPlatform = $tplan_mgr->countLinkedTCVersionsByPlatform($args->tplan_id); - - - $qtyLinked2Unknown = isset($qtyByPlatform[0]['qty']) ? $qtyByPlatform[0]['qty'] : 0; - - if( ($fix_needed = ($qtyLinked2Unknown > 0)) ) { - $gui->warning = lang_get('unknown_platform'); - } - $opt_cfg->global_lbl = ''; - $opt_cfg->additional_global_lbl = null; - $opt_cfg->from->lbl = lang_get('available_platforms'); - $opt_cfg->to->lbl = lang_get('assigned_platforms'); - $gui->platform_count_js = init_option_panels($tplan_mgr, $platform_mgr, $opt_cfg, $args); - - $tplanData = $tplan_mgr->get_by_id($args->tplan_id); - if (isset($tplanData)) { - $gui->mainTitle = sprintf($gui->mainTitle,$tplanData['name']); - } - - - if ($args->doAction == 'doAssignPlatforms') { - $platform_mgr->linkToTestplan($args->platformsToAdd,$args->tplan_id); - $platform_mgr->unlinkFromTestplan($args->platformsToRemove,$args->tplan_id); - if( $fix_needed && count($args->platformsToAdd) == 1) - { - reset($args->platformsToAdd); - $tplan_mgr->changeLinkedTCVersionsPlatform($args->tplan_id,0,current($args->platformsToAdd)); - } - // Update option panes with newly updated config - $gui->platform_count_js = init_option_panels($tplan_mgr, $platform_mgr, $opt_cfg, $args); - } -} - - -$opt_cfg->from->desc_field = 'platform'; -$opt_cfg->to->desc_field = 'platform'; -item_opt_transf_cfg($opt_cfg, null); - -$smarty->assign('gui', $gui); -$smarty->assign('opt_cfg', $opt_cfg); - -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * Initializes option transfer items, by appending a text with number linked TC:s - * for every assigned platform. - * It also builds a js map platform_name => linked_count. - * This map is used to show warning dialog only when trying to unlink - * platforms with assigned TCs - */ -function init_option_panels(&$tplan_mgr, &$platform_mgr, - &$opt_cfg, &$args) -{ - - /* - $opx = [ - 'enable_on_design' => false, - 'enable_on_execution' => true, - 'is_open' => true - ]; - */ - - $opt_cfg->from->map = $platform_mgr->getAllAsMap(config_get('platforms')->allowedOnAssign); - - $optLTT = null; - $map = $platform_mgr->getLinkedToTestplanAsMap($args->tplan_id, - $optLTT); - $platform_count_js = "platform_count_map = new Array();\n"; - if (!is_null($map)) { - foreach ($map as $plat_id => &$plat_name) { - $count = $tplan_mgr->count_testcases($args->tplan_id, - $plat_id); - $plat_name .= sprintf(lang_get('platform_linked_count'), - $count); - $platform_count_js .= - "platform_count_map['$plat_name'] = $count;\n"; - - // Removal of duplicates is NOT handled - // automatically since we just have modified - // their names adding a usage counter. - unset($opt_cfg->from->map[$plat_id]); - } - } - - $opt_cfg->to->map = $map; - return $platform_count_js; -} - -/** - * - * - */ -function init_args(&$opt_cfg) -{ - $added = $opt_cfg->js_ot_name . "_addedRight"; - $removed = $opt_cfg->js_ot_name . "_removedRight"; - - $iParams = array( "tplan_id" => array(tlInputParameter::INT_N), - "edit" => array(tlInputParameter::STRING_N,0,100), - "doAction" => array(tlInputParameter::STRING_N,0,20), - $added => array(tlInputParameter::STRING_N), - $removed => array(tlInputParameter::STRING_N)); - - $pParams = R_PARAMS($iParams); - - $args = new stdClass(); - $args->tplan_id = $pParams["tplan_id"]; - $args->platformsToAdd = null; - $args->platformsToRemove = null; - $args->edit = $pParams["edit"]; - $args->doAction = $pParams["doAction"]; - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - if ($pParams[$added] != "") { - $args->platformsToAdd = explode(",", $pParams[$added]); - } - - if( $pParams[$removed] != "" ) - { - $args->platformsToRemove = explode(",", $pParams[$removed]); - } - - return $args; -} - - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_add_remove_platforms'); +js_ot_name = 'ot'; +$args = initArgs($opt_cfg); + +if ($args->edit == 'testproject') { + show_instructions('platformAssign'); + exit(); +} + +$smarty = new TLSmarty(); +$tplan_mgr = new testplan($db); +$platform_mgr = new tlPlatform($db, $args->tproject_id); + +$gui = new stdClass(); +$gui->platform_assignment_subtitle = null; +$gui->tplan_id = $args->tplan_id; +$gui->can_do = isset($args->tplan_id); +$gui->mainTitle = lang_get('add_remove_platforms'); +$gui->warning = ''; + +if (isset($args->tplan_id)) { + // do following check to give warning to user + // if test plan has test case versions with platform_id=0 + // this means that right now there are not platforms linked to test plan. + // Give message to user with following info: + // Till you are not going to assign a platform to this linked tcversions + // and it's execution results he/she will not be able to execute + // + $qtyByPlatform = $tplan_mgr->countLinkedTCVersionsByPlatform( + $args->tplan_id); + + $qtyLinked2Unknown = isset($qtyByPlatform[0]['qty']) ? $qtyByPlatform[0]['qty'] : 0; + + if ($fix_needed = ($qtyLinked2Unknown > 0)) { + $gui->warning = lang_get('unknown_platform'); + } + $opt_cfg->global_lbl = ''; + $opt_cfg->additional_global_lbl = null; + $opt_cfg->from->lbl = lang_get('available_platforms'); + $opt_cfg->to->lbl = lang_get('assigned_platforms'); + $gui->platform_count_js = initOptionPanels($tplan_mgr, $platform_mgr, + $opt_cfg, $args); + + $tplanData = $tplan_mgr->get_by_id($args->tplan_id); + if (isset($tplanData)) { + $gui->mainTitle = sprintf($gui->mainTitle, $tplanData['name']); + } + + if ($args->doAction == 'doAssignPlatforms') { + $platform_mgr->linkToTestplan($args->platformsToAdd, $args->tplan_id); + $platform_mgr->unlinkFromTestplan($args->platformsToRemove, + $args->tplan_id); + if ($fix_needed && count($args->platformsToAdd) == 1) { + reset($args->platformsToAdd); + $tplan_mgr->changeLinkedTCVersionsPlatform($args->tplan_id, 0, + current($args->platformsToAdd)); + } + // Update option panes with newly updated config + $gui->platform_count_js = initOptionPanels($tplan_mgr, $platform_mgr, + $opt_cfg, $args); + } +} + +$opt_cfg->from->desc_field = 'platform'; +$opt_cfg->to->desc_field = 'platform'; +item_opt_transf_cfg($opt_cfg, null); + +$smarty->assign('gui', $gui); +$smarty->assign('opt_cfg', $opt_cfg); + +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Initializes option transfer items, by appending a text with number linked TC:s + * for every assigned platform. + * It also builds a js map platform_name => linked_count. + * This map is used to show warning dialog only when trying to unlink + * platforms with assigned TCs + */ +function initOptionPanels(&$tplan_mgr, &$platform_mgr, &$opt_cfg, &$args) +{ + $opt_cfg->from->map = $platform_mgr->getAllAsMap( + config_get('platforms')->allowedOnAssign); + + $optLTT = null; + $map = $platform_mgr->getLinkedToTestplanAsMap($args->tplan_id, $optLTT); + $platform_count_js = "platform_count_map = new Array();\n"; + if (! is_null($map)) { + foreach ($map as $plat_id => &$plat_name) { + $count = $tplan_mgr->count_testcases($args->tplan_id, $plat_id); + $plat_name .= sprintf(lang_get('platform_linked_count'), $count); + $platform_count_js .= "platform_count_map['$plat_name'] = $count;\n"; + + // Removal of duplicates is NOT handled + // automatically since we just have modified + // their names adding a usage counter. + unset($opt_cfg->from->map[$plat_id]); + } + } + + $opt_cfg->to->map = $map; + return $platform_count_js; +} + +/** + */ +function initArgs(&$opt_cfg) +{ + $added = $opt_cfg->js_ot_name . "_addedRight"; + $removed = $opt_cfg->js_ot_name . "_removedRight"; + + $iParams = array( + "tplan_id" => array( + tlInputParameter::INT_N + ), + "edit" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + $added => array( + tlInputParameter::STRING_N + ), + $removed => array( + tlInputParameter::STRING_N + ) + ); + + $pParams = R_PARAMS($iParams); + + $args = new stdClass(); + $args->tplan_id = $pParams["tplan_id"]; + $args->platformsToAdd = null; + $args->platformsToRemove = null; + $args->edit = $pParams["edit"]; + $args->doAction = $pParams["doAction"]; + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + if ($pParams[$added] != "") { + $args->platformsToAdd = explode(",", $pParams[$added]); + } + + if ($pParams[$removed] != "") { + $args->platformsToRemove = explode(",", $pParams[$removed]); + } + + return $args; +} + +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_add_remove_platforms'); } diff --git a/lib/platforms/platformsEdit.php b/lib/platforms/platformsEdit.php index 375b43264f..63df7b4da1 100644 --- a/lib/platforms/platformsEdit.php +++ b/lib/platforms/platformsEdit.php @@ -1,388 +1,414 @@ - exit() -list($args,$gui,$platform_mgr) = initEnv($db); - -$templateCfg = templateConfiguration(); -$smarty = new TLSmarty(); -$default_template = $templateCfg->default_template; - -$op = new stdClass(); -$op->status = 0; - -$of = web_editor('notes',$_SESSION['basehref'],$editorCfg); -$of->Value = getItemTemplateContents('platform_template', $of->InstanceName, $args->notes); - -$method = $args->doAction; -switch ($args->doAction) { - case "do_create": - case "do_update": - case "do_delete": - if (!$gui->canManage) { - break; - } - - case "edit": - case "create": - $op = $method($args,$gui,$platform_mgr); - $of->Value = $gui->notes; - break; - - case "disableDesign": - case "enableDesign": - case "disableExec": - case "enableExec": - case "openForExec": - case "closeForExec": - $platform_mgr->$method($args->platform_id); - - // optimistic - $op = new stdClass(); - $op->status = 1; - $op->user_feedback = ''; - $op->template = 'platformsView.tpl'; - break; -} - -if ($op->status == 1) { - $default_template = $op->template; - $gui->user_feedback['message'] = $op->user_feedback; -} else { - $gui->user_feedback['message'] = getErrorMessage($op->status, $args->name); - $gui->user_feedback['type'] = 'ERROR'; -} - -// refresh -$guiX = $platform_mgr->initViewGui($args->currentUser,$args); -$gui->platforms = $guiX->platforms; - -$gui->notes = $of->CreateHTML(); - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $default_template); - -/** - * - * - */ -function initEnv(&$dbHandler) { - testlinkInitPage($dbHandler); - $argsObj = init_args($dbHandler); - - checkPageAccess($dbHandler,$argsObj); // Will exit if check failed - - $platMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); - - $guiObj = init_gui($dbHandler,$argsObj,$platMgr); - - return array($argsObj,$guiObj,$platMgr); -} - - - -/** - * - * - */ -function init_args( &$dbH ) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $iParams = [ - "doAction" => [tlInputParameter::STRING_N,0,50], - "id" => [tlInputParameter::INT_N], - "platform_id" => [tlInputParameter::INT_N], - "name" => [tlInputParameter::STRING_N,0,100], - "notes" => [tlInputParameter::STRING_N], - "tproject_id" => [tlInputParameter::INT_N], - "tplan_id" => [tlInputParameter::INT_N], - "enable_on_execution" => [tlInputParameter::CB_BOOL], - "enable_on_design" => [tlInputParameter::CB_BOOL], - "is_open" => [tlInputParameter::CB_BOOL] - ]; - - R_PARAMS($iParams,$args); - if (null == $args->platform_id || $args->platform_id <= 0) { - $args->platform_id = $args->id; - } - - $tables = tlDBObject::getDBTables(array('nodes_hierarchy','platforms')); - - if( 0 != $args->platform_id ) { - $sql = "SELECT testproject_id FROM {$tables['platforms']} - WHERE id={$args->platform_id}"; - $info = $dbH->get_recordset($sql); - - $args->tproject_id = $info[0]['testproject_id']; - } - - if( 0 == $args->tproject_id ) { - throw new Exception("Unable to Get Test Project ID, Aborting", 1); - } - - $args->testproject_name = ''; - $sql = "SELECT name FROM {$tables['nodes_hierarchy']} - WHERE id={$args->tproject_id}"; - $info = $dbH->get_recordset($sql); - if( null != $info ) { - $args->testproject_name = $info[0]['name']; - } - - $args->currentUser = $_SESSION['currentUser']; - - // Checkboxes - if (null == $args->enable_on_design) { - $args->enable_on_design = 0; - } - - if (null == $args->enable_on_execution) { - $args->enable_on_execution = 0; - } - - if (null == $args->is_open) { - $args->is_open = 0; - } - - return $args; -} - -/* - function: create - initialize variables to launch user interface (smarty template) - to get information to accomplish create task. - - args: - - returns: - - -*/ -function create(&$args,&$gui) { - $ret = new stdClass(); - $ret->template = 'platformsEdit.tpl'; - $ret->status = 1; - $ret->user_feedback = ''; - $gui->submit_button_label = lang_get('btn_save'); - $gui->submit_button_action = 'do_create'; - $gui->action_descr = lang_get('create_platform'); - - return $ret; -} - - -/* - function: edit - initialize variables to launch user interface (smarty template) - to get information to accomplish edit task. - - args: - - returns: - - -*/ -function edit(&$args,&$gui,&$platform_mgr) { - $ret = new stdClass(); - $ret->template = 'platformsEdit.tpl'; - $ret->status = 1; - $ret->user_feedback = ''; - - $gui->action_descr = lang_get('edit_platform'); - $platform = $platform_mgr->getById($args->platform_id); - - if ($platform) { - $args->enable_on_design = $platform['enable_on_design']; - $args->enable_on_execution = $platform['enable_on_execution']; - $args->is_open = $platform['is_open']; - - $args->name = $platform['name']; - $args->notes = $platform['notes']; - - // --------------------------------------------------------- - // Copy from args into $gui - $gui->enable_on_design = $args->enable_on_design; - $gui->enable_on_execution = $args->enable_on_execution; - $gui->is_open = $args->is_open; - - $gui->name = $args->name; - $gui->notes = $args->notes; - // --------------------------------------------------------- - - $gui->action_descr .= TITLE_SEP . $platform['name']; - } - - $gui->submit_button_label = lang_get('btn_save'); - $gui->submit_button_action = 'do_update'; - $gui->main_descr = lang_get('platform_management'); - - return $ret; -} - -/** - * function: do_create - * do operations on db - * - */ -function do_create(&$args,&$gui,&$platform_mgr) -{ - $gui->main_descr = lang_get('platform_management'); - $gui->action_descr = lang_get('create_platform'); - $gui->submit_button_label = lang_get('btn_save'); - $gui->submit_button_action = 'do_create'; - - $ret = new stdClass(); - $ret->template = 'platformsView.tpl'; - $plat = new stdClass(); - $plat->name = $args->name; - $k2c = [ - 'notes' => null, - 'enable_on_design' => 0, - 'enable_on_execution' => 0, - 'is_open' => 0 - ]; - - foreach ($k2c as $prop => $defa) { - $plat->$prop = property_exists($args, $prop) ? $args->$prop : $defa; - } - $op = $platform_mgr->create($plat); - - $ret->status = $op['status']; - $ret->user_feedback = sprintf(lang_get('platform_created'), $args->name); - - return $ret; -} - -/** - * - * - */ -function do_update(&$args,&$gui,&$platform_mgr) { - $action_descr = lang_get('edit_platform'); - $platform = $platform_mgr->getPlatform($args->platform_id); - if ($platform) { - $action_descr .= TITLE_SEP . $platform['name']; - } - - $gui->submit_button_label = lang_get('btn_save'); - $gui->submit_button_action = 'do_update'; - $gui->main_descr = lang_get('platform_management'); - $gui->action_descr = $action_descr; - - $ret = new stdClass(); - $ret->template = 'platformsView.tpl'; - $ret->status = $platform_mgr->update( - $args->platform_id, - $args->name,$args->notes, - $args->enable_on_design, - $args->enable_on_execution, - $args->is_open - ); - $ret->user_feedback = sprintf(lang_get('platform_updated'), $args->name); - - return $ret; -} - -/* - function: do_delete - do operations on db - - args : - - returns: - -*/ -function do_delete(&$args,&$gui,&$platform_mgr) { - $gui->main_descr = lang_get('testproject') . TITLE_SEP . $args->testproject_name; - - $gui->submit_button_label = lang_get('btn_save'); - $gui->submit_button_action = 'do_update'; - $gui->action_descr = lang_get('edit_platform'); - - $ret = new stdClass(); - $ret->template = 'platformsView.tpl'; - // This also removes all exec data on this platform - $ret->status = $platform_mgr->delete($args->platform_id,true); - $ret->user_feedback = sprintf(lang_get('platform_deleted'), $args->name); - - return $ret; -} - -/** - * - */ -function getErrorMessage($code,$platform_name) { - switch($code) { - case tlPlatform::E_NAMENOTALLOWED: - $msg = lang_get('platforms_char_not_allowed'); - break; - - case tlPlatform::E_NAMELENGTH: - $msg = lang_get('empty_platform_no'); - break; - - case tlPlatform::E_DBERROR: - case ERROR: - $msg = lang_get('platform_update_failed'); - break; - - case tlPlatform::E_NAMEALREADYEXISTS: - $msg = sprintf(lang_get('platform_name_already_exists'),$platform_name); - break; - - default: - $msg = 'ok'; - } - return $msg; -} - -/** - * - */ -function init_gui(&$db,&$args,&$platMgr) { - $gui = $platMgr->initViewGui($args->currentUser,$args); - - $gui->name = $args->name; - $gui->notes = $args->notes; - $gui->platform_id = $args->platform_id; - $gui->tproject_id = $args->tproject_id; - $gui->tplan_id = $args->tplan_id; - - $gui->enable_on_design = 0; - $gui->enable_on_execution = 0; - $gui->is_open = 0; - - return $gui; -} - -/** - * - */ -function checkPageAccess(&$db,&$argsObj) { - $env['script'] = basename(__FILE__); - $env['tproject_id'] = isset($argsObj->tproject_id) ? $argsObj->tproject_id : 0; - $env['tplan_id'] = isset($argsObj->tplan_id) ? $argsObj->tplan_id : 0; - $argsObj->currentUser->checkGUISecurityClearance($db,$env,array('platform_management'),'and'); + exit() +list ($args, $gui, $platform_mgr) = initEnv($db); + +$templateCfg = templateConfiguration(); +$smarty = new TLSmarty(); +$default_template = $templateCfg->default_template; + +$op = new stdClass(); +$op->status = 0; + +$of = web_editor('notes', $_SESSION['basehref'], $editorCfg); +$of->Value = getItemTemplateContents('platform_template', $of->InstanceName, + $args->notes); + +$method = $args->doAction; +switch ($args->doAction) { + case "do_create": + case "do_update": + case "do_delete": + if (! $gui->canManage) { + break; + } + + case "edit": + case "create": + $op = $method($args, $gui, $platform_mgr); + $of->Value = $gui->notes; + break; + + case "disableDesign": + case "enableDesign": + case "disableExec": + case "enableExec": + case "openForExec": + case "closeForExec": + $platform_mgr->$method($args->platform_id); + + // optimistic + $op = new stdClass(); + $op->status = 1; + $op->user_feedback = ''; + $op->template = 'platformsView.tpl'; + break; +} + +if ($op->status == 1) { + $default_template = $op->template; + $gui->user_feedback['message'] = $op->user_feedback; +} else { + $gui->user_feedback['message'] = getErrorMessage($op->status, $args->name); + $gui->user_feedback['type'] = 'ERROR'; +} + +// refresh +$guiX = $platform_mgr->initViewGui($args->currentUser, $args); +$gui->platforms = $guiX->platforms; + +$gui->notes = $of->CreateHTML(); + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $default_template); + +/** + */ +function initEnv(&$dbHandler) +{ + testlinkInitPage($dbHandler); + $argsObj = initArgs($dbHandler); + + checkPageAccess($dbHandler, $argsObj); // Will exit if check failed + + $platMgr = new tlPlatform($dbHandler, $argsObj->tproject_id); + + $guiObj = initGui($dbHandler, $argsObj, $platMgr); + + return array( + $argsObj, + $guiObj, + $platMgr + ); +} + +/** + */ +function initArgs(&$dbH) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $iParams = [ + "doAction" => [ + tlInputParameter::STRING_N, + 0, + 50 + ], + "id" => [ + tlInputParameter::INT_N + ], + "platform_id" => [ + tlInputParameter::INT_N + ], + "name" => [ + tlInputParameter::STRING_N, + 0, + 100 + ], + "notes" => [ + tlInputParameter::STRING_N + ], + "tproject_id" => [ + tlInputParameter::INT_N + ], + "tplan_id" => [ + tlInputParameter::INT_N + ], + "enable_on_execution" => [ + tlInputParameter::CB_BOOL + ], + "enable_on_design" => [ + tlInputParameter::CB_BOOL + ], + "is_open" => [ + tlInputParameter::CB_BOOL + ] + ]; + + R_PARAMS($iParams, $args); + if (null == $args->platform_id || $args->platform_id <= 0) { + $args->platform_id = $args->id; + } + + $tables = tlDBObject::getDBTables(array( + 'nodes_hierarchy', + 'platforms' + )); + + if (0 != $args->platform_id) { + $sql = "SELECT testproject_id FROM {$tables['platforms']} + WHERE id={$args->platform_id}"; + $info = $dbH->get_recordset($sql); + + $args->tproject_id = $info[0]['testproject_id']; + } + + if (0 == $args->tproject_id) { + throw new Exception("Unable to Get Test Project ID, Aborting", 1); + } + + $args->testproject_name = ''; + $sql = "SELECT name FROM {$tables['nodes_hierarchy']} + WHERE id={$args->tproject_id}"; + $info = $dbH->get_recordset($sql); + if (null != $info) { + $args->testproject_name = $info[0]['name']; + } + + $args->currentUser = $_SESSION['currentUser']; + + // Checkboxes + if (null == $args->enable_on_design) { + $args->enable_on_design = 0; + } + + if (null == $args->enable_on_execution) { + $args->enable_on_execution = 0; + } + + if (null == $args->is_open) { + $args->is_open = 0; + } + + return $args; +} + +/* + * function: create + * initialize variables to launch user interface (smarty template) + * to get information to accomplish create task. + * + * args: + * + * returns: - + * + */ +function create(&$args, &$gui) +{ + $ret = new stdClass(); + $ret->template = 'platformsEdit.tpl'; + $ret->status = 1; + $ret->user_feedback = ''; + $gui->submit_button_label = lang_get('btn_save'); + $gui->submit_button_action = 'do_create'; + $gui->action_descr = lang_get('create_platform'); + + return $ret; +} + +/* + * function: edit + * initialize variables to launch user interface (smarty template) + * to get information to accomplish edit task. + * + * args: + * + * returns: - + * + */ +function edit(&$args, &$gui, &$platform_mgr) +{ + $ret = new stdClass(); + $ret->template = 'platformsEdit.tpl'; + $ret->status = 1; + $ret->user_feedback = ''; + + $gui->action_descr = lang_get('edit_platform'); + $platform = $platform_mgr->getById($args->platform_id); + + if ($platform) { + $args->enable_on_design = $platform['enable_on_design']; + $args->enable_on_execution = $platform['enable_on_execution']; + $args->is_open = $platform['is_open']; + + $args->name = $platform['name']; + $args->notes = $platform['notes']; + + // Copy from args into $gui + $gui->enable_on_design = $args->enable_on_design; + $gui->enable_on_execution = $args->enable_on_execution; + $gui->is_open = $args->is_open; + + $gui->name = $args->name; + $gui->notes = $args->notes; + + $gui->action_descr .= TITLE_SEP . $platform['name']; + } + + $gui->submit_button_label = lang_get('btn_save'); + $gui->submit_button_action = 'do_update'; + $gui->main_descr = lang_get('platform_management'); + + return $ret; +} + +/** + * function: do_create + * do operations on db + */ +function do_create(&$args, &$gui, &$platform_mgr) +{ + $gui->main_descr = lang_get('platform_management'); + $gui->action_descr = lang_get('create_platform'); + $gui->submit_button_label = lang_get('btn_save'); + $gui->submit_button_action = 'do_create'; + + $ret = new stdClass(); + $ret->template = 'platformsView.tpl'; + $plat = new stdClass(); + $plat->name = $args->name; + $k2c = [ + 'notes' => null, + 'enable_on_design' => 0, + 'enable_on_execution' => 0, + 'is_open' => 0 + ]; + + foreach ($k2c as $prop => $defa) { + $plat->$prop = property_exists($args, $prop) ? $args->$prop : $defa; + } + $op = $platform_mgr->create($plat); + + $ret->status = $op['status']; + $ret->user_feedback = sprintf(lang_get('platform_created'), $args->name); + + return $ret; +} + +/** + */ +function do_update(&$args, &$gui, &$platform_mgr) +{ + $action_descr = lang_get('edit_platform'); + $platform = $platform_mgr->getPlatform($args->platform_id); + if ($platform) { + $action_descr .= TITLE_SEP . $platform['name']; + } + + $gui->submit_button_label = lang_get('btn_save'); + $gui->submit_button_action = 'do_update'; + $gui->main_descr = lang_get('platform_management'); + $gui->action_descr = $action_descr; + + $ret = new stdClass(); + $ret->template = 'platformsView.tpl'; + $ret->status = $platform_mgr->update($args->platform_id, $args->name, + $args->notes, $args->enable_on_design, $args->enable_on_execution, + $args->is_open); + $ret->user_feedback = sprintf(lang_get('platform_updated'), $args->name); + + return $ret; +} + +/* + * function: do_delete + * do operations on db + * + * args : + * + * returns: + * + */ +function do_delete(&$args, &$gui, &$platform_mgr) +{ + $gui->main_descr = lang_get('testproject') . TITLE_SEP . + $args->testproject_name; + + $gui->submit_button_label = lang_get('btn_save'); + $gui->submit_button_action = 'do_update'; + $gui->action_descr = lang_get('edit_platform'); + + $ret = new stdClass(); + $ret->template = 'platformsView.tpl'; + // This also removes all exec data on this platform + $ret->status = $platform_mgr->delete($args->platform_id, true); + $ret->user_feedback = sprintf(lang_get('platform_deleted'), $args->name); + + return $ret; +} + +/** + */ +function getErrorMessage($code, $platform_name) +{ + switch ($code) { + case tlPlatform::E_NAMENOTALLOWED: + $msg = lang_get('platforms_char_not_allowed'); + break; + + case tlPlatform::E_NAMELENGTH: + $msg = lang_get('empty_platform_no'); + break; + + case tlPlatform::E_DBERROR: + case ERROR: + $msg = lang_get('platform_update_failed'); + break; + + case tlPlatform::E_NAMEALREADYEXISTS: + $msg = sprintf(lang_get('platform_name_already_exists'), + $platform_name); + break; + + default: + $msg = 'ok'; + } + return $msg; +} + +/** + */ +function initGui(&$db, &$args, &$platMgr) +{ + $gui = $platMgr->initViewGui($args->currentUser, $args); + + $gui->name = $args->name; + $gui->notes = $args->notes; + $gui->platform_id = $args->platform_id; + $gui->tproject_id = $args->tproject_id; + $gui->tplan_id = $args->tplan_id; + + $gui->enable_on_design = 0; + $gui->enable_on_execution = 0; + $gui->is_open = 0; + + return $gui; +} + +/** + */ +function checkPageAccess(&$db, &$argsObj) +{ + $env['script'] = basename(__FILE__); + $env['tproject_id'] = isset($argsObj->tproject_id) ? $argsObj->tproject_id : 0; + $env['tplan_id'] = isset($argsObj->tplan_id) ? $argsObj->tplan_id : 0; + $argsObj->currentUser->checkGUISecurityClearance($db, $env, + array( + 'platform_management' + ), 'and'); } diff --git a/lib/platforms/platformsExport.php b/lib/platforms/platformsExport.php index 73f0013b38..92f858834f 100644 --- a/lib/platforms/platformsExport.php +++ b/lib/platforms/platformsExport.php @@ -1,118 +1,134 @@ -doAction) { - case 'doExport': - doExport($db,$gui->export_filename,$args->tproject_id); - break; - - default: - break; +doAction) { + case 'doExport': + doExport($db, $gui->export_filename, $args->tproject_id); + break; + + default: + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs(&$dbH) +{ + $args = new stdClass(); + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "export_filename" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "tproject_id" => array( + tlInputParameter::INT + ) + ); + + R_PARAMS($iParams, $args); + if (0 == $args->tproject_id) { + throw new Exception("Unable to Get Test Project ID, Aborting", 1); + } + + $args->testproject_name = ''; + $tables = tlDBObject::getDBTables(array( + 'nodes_hierarchy' + )); + $sql = "SELECT name FROM {$tables['nodes_hierarchy']} + WHERE id={$args->tproject_id}"; + $info = $dbH->get_recordset($sql); + if (null != $info) { + $args->testproject_name = $info[0]['name']; + } + + if (is_null($args->export_filename)) { + $args->export_filename = $args->testproject_name . "-platforms.xml"; + } + $args->export_filename = trim(str_ireplace(" ", "", $args->export_filename)); + return $args; +} + +/** + */ +function initializeGui(&$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->export_filename = trim($argsObj->export_filename); + $guiObj->page_title = lang_get('export_platforms'); + $guiObj->do_it = 1; + $guiObj->nothing_todo_msg = ''; + $guiObj->exportTypes = array( + 'XML' => 'XML' + ); + + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->goback_url = $_SESSION['basehref'] . + 'lib/platforms/platformsView.php?tproject_id=' . $guiObj->tproject_id; + + return $guiObj; +} + +/* + * function: doExport() + * + * args: dbHandler + * filename: where to export + * + * returns: - + * + */ +function doExport(&$db, $filename, $tproject_id) +{ + $debugMsg = 'File:' . __FILE__ . ' - Function: ' . __FUNCTION__; + $tables = tlObjectWithDB::getDBTables(array( + 'platforms' + )); + $adodbXML = new ADODB_XML("1.0", "UTF-8"); + + $sql = "/* $debugMsg */ + SELECT name,notes,enable_on_design,enable_on_execution,is_open + FROM {$tables['platforms']} PLAT + WHERE PLAT.testproject_id=" . intval($tproject_id); + + $adodbXML->setRootTagName('platforms'); + $adodbXML->setRowTagName('platform'); + $content = $adodbXML->ConvertToXMLString($db->db, $sql); + downloadContentsToFile($content, $filename); + exit(); +} + +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, "platform_view"); } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function init_args( &$dbH ) { - $args = new stdClass(); - $iParams = - array("doAction" => array(tlInputParameter::STRING_N,0,50), - "export_filename" => array(tlInputParameter::STRING_N,0,255), - "tproject_id" => array(tlInputParameter::INT)); - - R_PARAMS($iParams,$args); - if (0 == $args->tproject_id) { - throw new Exception("Unable to Get Test Project ID, Aborting", 1); - } - - $args->testproject_name = ''; - $tables = tlDBObject::getDBTables(array('nodes_hierarchy')); - $sql = "SELECT name FROM {$tables['nodes_hierarchy']} - WHERE id={$args->tproject_id}"; - $info = $dbH->get_recordset($sql); - if( null != $info ) { - $args->testproject_name = $info[0]['name']; - } - - if(is_null($args->export_filename)) { - $args->export_filename = $args->testproject_name . "-platforms.xml"; - } - $args->export_filename = trim(str_ireplace(" ", "",$args->export_filename)); - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj) { - $guiObj = new stdClass(); - $guiObj->export_filename = trim($argsObj->export_filename); - $guiObj->page_title = lang_get('export_platforms'); - $guiObj->do_it = 1; - $guiObj->nothing_todo_msg = ''; - $guiObj->exportTypes = array('XML' => 'XML'); - - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->goback_url = $_SESSION['basehref'] . - 'lib/platforms/platformsView.php?tproject_id=' . $guiObj->tproject_id; - - return $guiObj; -} - -/* - function: doExport() - - args: dbHandler - filename: where to export - - returns: - - -*/ -function doExport(&$db,$filename,$tproject_id) -{ - $debugMsg = 'File:' . __FILE__ . ' - Function: ' . __FUNCTION__; - $tables = tlObjectWithDB::getDBTables(array('platforms')); - $adodbXML = new ADODB_XML("1.0", "UTF-8"); - - $sql = "/* $debugMsg */ - SELECT name,notes,enable_on_design,enable_on_execution,is_open - FROM {$tables['platforms']} PLAT - WHERE PLAT.testproject_id=" . intval($tproject_id); - - $adodbXML->setRootTagName('platforms'); - $adodbXML->setRowTagName('platform'); - $content = $adodbXML->ConvertToXMLString($db->db, $sql); - downloadContentsToFile($content,$filename); - exit(); -} - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,"platform_view"); -} \ No newline at end of file diff --git a/lib/platforms/platformsImport.php b/lib/platforms/platformsImport.php index 6de3115b45..0f09619d88 100644 --- a/lib/platforms/platformsImport.php +++ b/lib/platforms/platformsImport.php @@ -1,193 +1,211 @@ -doAction) { - case 'doImport': - $gui->file_check = doImport($db,$args->tproject_id); - break; - - default: - break; +doAction) { + case 'doImport': + $gui->file_check = doImport($db, $args->tproject_id); + break; + + default: + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs(&$dbH) +{ + $args = new stdClass(); + $iParams = [ + "doAction" => [ + tlInputParameter::STRING_N, + 0, + 50 + ], + "tproject_id" => [ + tlInputParameter::INT + ], + "tplan_id" => [ + tlInputParameter::INT + ] + ]; + + R_PARAMS($iParams, $args); + $args->userID = $_SESSION['userID']; + + if (0 == $args->tproject_id) { + throw new Exception("Unable to Get Test Project ID, Aborting", 1); + } + + $args->testproject_name = ''; + $tables = tlDBObject::getDBTables(array( + 'nodes_hierarchy' + )); + $sql = "SELECT name FROM {$tables['nodes_hierarchy']} + WHERE id={$args->tproject_id}"; + $info = $dbH->get_recordset($sql); + if (null != $info) { + $args->testproject_name = $info[0]['name']; + } + + return $args; +} + +/** + */ +function initializeGui(&$argsObj) +{ + $guiObj = new stdClass(); + + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + + $guiObj->goback_url = $_SESSION['basehref'] . + 'lib/platforms/platformsView.php?tproject_id=' . $guiObj->tproject_id . + 'tplan_id=' . $guiObj->tplan_id; + + $guiObj->page_title = lang_get('import_platforms'); + $guiObj->file_check = [ + 'show_results' => 0, + 'status_ok' => 1, + 'msg' => 'ok', + 'filename' => '' + ]; + + $guiObj->importTypes = array( + 'XML' => 'XML' + ); + + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->max_size_import_file_msg = sprintf(lang_get('max_size_file_msg'), + $guiObj->importLimitBytes / 1024); + + return $guiObj; +} + +/** + * + * @param + * object dbHandler reference to db handler + * + */ +function doImport(&$dbHandler, $testproject_id) +{ + $import_msg = array( + 'ok' => array(), + 'ko' => array() + ); + $file_check = array( + 'show_results' => 0, + 'status_ok' => 0, + 'msg' => '', + 'filename' => '', + 'import_msg' => $import_msg + ); + + $key = 'targetFilename'; + $dest = TL_TEMP_PATH . session_id() . "-import_platforms.tmp"; + $fInfo = $_FILES[$key]; + $source = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : null; + if (($source != 'none') && ($source != '')) { + $file_check['filename'] = $fInfo['name']; + $xml = false; + if (move_uploaded_file($source, $dest)) { + // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html + $xml = @simplexml_load_file_wrapper($dest); + } + if ($xml !== false) { + $file_check['status_ok'] = 1; + $file_check['show_results'] = 1; + $platform_mgr = new tlPlatform($dbHandler, $testproject_id); + + $platformsOnSystem = $platform_mgr->getAllAsMap( + [ + 'accessKey' => 'name', + 'output' => 'rows', + 'enable_on_design' => null, + 'enable_on_execution' => null, + 'is_open' => null + ]); + + foreach ($xml as $platform) { + if (property_exists($platform, 'name')) { + // Check if platform with this name already exists on test Project + // if answer is yes => update fields + $name = trim((string) $platform->name); + if (isset($platformsOnSystem[$name])) { + $import_msg['ok'][] = sprintf( + lang_get('platform_updated'), $name); + + $platform_mgr->update($platformsOnSystem[$name]['id'], + $name, (string) $platform->notes, + intval($platform->enable_on_design), + intval($platform->enable_on_execution), + intval($platform->is_open)); + } else { + $import_msg['ok'][] = sprintf( + lang_get('platform_imported'), $name); + $item = new stdClass(); + $item->name = $name; + $item->notes = (string) $platform->notes; + $item->enable_on_design = intval( + $platform->enable_on_design); + $item->enable_on_execution = intval( + $platform->enable_on_execution); + $item->is_open = intval($platform->is_open); + $platform_mgr->create($item); + } + } else { + $import_msg['ko'][] = lang_get('bad_line_skipped'); + } + } + } else { + $file_check['msg'] = lang_get('problems_loading_xml_content'); + } + } else { + $msg = getFileUploadErrorMessage($fInfo); + $file_check = array( + 'show_results' => 0, + 'status_ok' => 0, + 'msg' => $msg + ); + } + + if (count($import_msg['ko']) == 0) { + $import_msg['ko'] = null; + } + $file_check['import_msg'] = $import_msg; + return $file_check; +} + +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, "platform_management"); } - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - */ -function init_args(&$dbH) { - $args = new stdClass(); - $iParams = [ - "doAction" => [tlInputParameter::STRING_N,0,50], - "tproject_id" => [tlInputParameter::INT], - "tplan_id" => [tlInputParameter::INT] - ]; - - R_PARAMS($iParams,$args); - $args->userID = $_SESSION['userID']; - - if( 0 == $args->tproject_id ) { - throw new Exception("Unable to Get Test Project ID, Aborting", 1); - } - - $args->testproject_name = ''; - $tables = tlDBObject::getDBTables(array('nodes_hierarchy')); - $sql = "SELECT name FROM {$tables['nodes_hierarchy']} - WHERE id={$args->tproject_id}"; - $info = $dbH->get_recordset($sql); - if( null != $info ) { - $args->testproject_name = $info[0]['name']; - } - - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj) { - $guiObj = new stdClass(); - - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - - - $guiObj->goback_url = $_SESSION['basehref'] . - 'lib/platforms/platformsView.php?tproject_id=' . $guiObj->tproject_id . - 'tplan_id=' . $guiObj->tplan_id; - - $guiObj->page_title = lang_get('import_platforms'); - $guiObj->file_check = [ - 'show_results' => 0, - 'status_ok' => 1, - 'msg' => 'ok', - 'filename' => '' - ]; - - $guiObj->importTypes = array('XML' => 'XML'); - - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->max_size_import_file_msg = - sprintf(lang_get('max_size_file_msg'), $guiObj->importLimitBytes/1024); - - return $guiObj; -} - - -/** - * @param object dbHandler reference to db handler - * - */ -function doImport(&$dbHandler,$testproject_id) -{ - - $import_msg = array('ok' => array(), 'ko' => array()); - $file_check = array('show_results' => 0, 'status_ok' => 0, 'msg' => '', - 'filename' => '', 'import_msg' => $import_msg); - - $key = 'targetFilename'; - $dest = TL_TEMP_PATH . session_id(). "-import_platforms.tmp"; - $fInfo = $_FILES[$key]; - $source = isset($fInfo['tmp_name']) ? $fInfo['tmp_name'] : null; - if (($source != 'none') && ($source != '')) { - $file_check['filename'] = $fInfo['name']; - $xml = false; - if (move_uploaded_file($source, $dest)) { - // http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html - $xml = @simplexml_load_file_wrapper($dest); - } - if ($xml !== FALSE) { - $file_check['status_ok'] = 1; - $file_check['show_results'] = 1; - $platform_mgr = new tlPlatform($dbHandler,$testproject_id); - - $platformsOnSystem = $platform_mgr->getAllAsMap(['accessKey' => 'name', - 'output' => 'rows', - 'enable_on_design' => null, - 'enable_on_execution' => null, - 'is_open' => null, - ]); - - foreach($xml as $platform) { - if (property_exists($platform, 'name')) { - // Check if platform with this name already exists on test Project - // if answer is yes => update fields - $name = trim((string)$platform->name); - if(isset($platformsOnSystem[$name])) { - $import_msg['ok'][] = sprintf(lang_get('platform_updated'),$name); - - $platform_mgr->update($platformsOnSystem[$name]['id'], - $name, - (string)$platform->notes, - intval($platform->enable_on_design), - intval($platform->enable_on_execution), - intval($platform->is_open) - ); - - } else { - $import_msg['ok'][] = sprintf(lang_get('platform_imported'),$name); - $item = new stdClass(); - $item->name = $name; - $item->notes = (string)$platform->notes; - $item->enable_on_design = intval($platform->enable_on_design); - $item->enable_on_execution = intval($platform->enable_on_execution); - $item->is_open = intval($platform->is_open); - $platform_mgr->create($item); - } - } else { - $import_msg['ko'][] = lang_get('bad_line_skipped'); - } - } - } - else - { - $file_check['msg'] = lang_get('problems_loading_xml_content'); - } - - } - else - { - $msg = getFileUploadErrorMessage($fInfo); - $file_check = array('show_results' => 0, 'status_ok' => 0,'msg' => $msg); - } - - if( count($import_msg['ko']) == 0 ) - { - $import_msg['ko'] = null; - } - $file_check['import_msg'] = $import_msg; - return $file_check; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,"platform_management"); -} \ No newline at end of file diff --git a/lib/platforms/platformsView.php b/lib/platforms/platformsView.php index cb8a15ff22..a5285b4166 100644 --- a/lib/platforms/platformsView.php +++ b/lib/platforms/platformsView.php @@ -1,53 +1,48 @@ -tproject_id); -$gui = $platform_mgr->initViewGui($args->currentUser,$args); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function init_args() { - $args = new stdClass(); - $args->currentUser = $_SESSION['currentUser']; - - list($context,$env) = initContext(); - $args->tproject_id = $context->tproject_id; - $args->tplan_id = $context->tplan_id; - - if( 0 == $args->tproject_id ) { - throw new Exception("Unable Get Test Project ID => Can Not Proceed", 1); - } - - return $args; +tproject_id); +$gui = $platform_mgr->initViewGui($args->currentUser, $args); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs() +{ + $args = new stdClass(); + $args->currentUser = $_SESSION['currentUser']; + + list ($context,) = initContext(); + $args->tproject_id = $context->tproject_id; + $args->tplan_id = $context->tplan_id; + + if (0 == $args->tproject_id) { + throw new Exception("Unable Get Test Project ID => Can Not Proceed", 1); + } + + return $args; +} + +/** + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'platform_management') || + $user->hasRightOnProj($db, 'platform_view'); } - - - -/** - * - * - */ -function checkRights(&$db,&$user) { - return ($user->hasRightOnProj($db,'platform_management') || - $user->hasRightOnProj($db,'platform_view')); -} \ No newline at end of file diff --git a/lib/plugins/pluginView.php b/lib/plugins/pluginView.php index 9d60854bab..5e6bb7cdb1 100644 --- a/lib/plugins/pluginView.php +++ b/lib/plugins/pluginView.php @@ -1,89 +1,99 @@ -operation) -{ - case 'install': - if ($args->pluginName) - { - $p_plugin = plugin_register($args->pluginName, true); - plugin_init($args->pluginName); - plugin_install($p_plugin); - $feedback = sprintf(lang_get('plugin_installed'), $args->pluginName); - } - break; - - case 'uninstall': - if ($args->pluginId) - { - $t_basename = plugin_uninstall($args->pluginId); - $feedback = sprintf(lang_get('plugin_uninstalled'), $t_basename); - } - break; - - default: - break; -} - -$gui->main_title = lang_get('title_plugin_mgmt'); -$gui->installed_plugins = get_all_installed_plugins(); -$gui->available_plugins = get_all_available_plugins($gui->installed_plugins); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->assign('user_feedback', $feedback); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -function initEnv(&$dbHandler) -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - - $iParams = array("operation" => array(tlInputParameter::STRING_N,0,50), - "pluginId" => array(tlInputParameter::INT_N), - "pluginName" => array(tlInputParameter::STRING_N,0,50)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - $args->currentUser = $_SESSION['currentUser']; - $args->currentUserID = $_SESSION['currentUser']->dbID; - $args->basehref = $_SESSION['basehref']; - - $gui = new stdClass(); - $gui->grants = getGrantsForUserMgmt($dbHandler,$args->currentUser); - $gui->feedback = ''; - $gui->basehref = $args->basehref; - - return array($args,$gui); +operation) { + case 'install': + if ($args->pluginName) { + $p_plugin = plugin_register($args->pluginName, true); + plugin_init($args->pluginName); + plugin_install($p_plugin); + $feedback = sprintf(lang_get('plugin_installed'), $args->pluginName); + } + break; + + case 'uninstall': + if ($args->pluginId) { + $t_basename = plugin_uninstall($args->pluginId); + $feedback = sprintf(lang_get('plugin_uninstalled'), $t_basename); + } + break; + + default: + break; +} + +$gui->main_title = lang_get('title_plugin_mgmt'); +$gui->installed_plugins = get_all_installed_plugins(); +$gui->available_plugins = get_all_available_plugins($gui->installed_plugins); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('user_feedback', $feedback); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +function initEnv(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "operation" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "pluginId" => array( + tlInputParameter::INT_N + ), + "pluginName" => array( + tlInputParameter::STRING_N, + 0, + 50 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->currentUser = $_SESSION['currentUser']; + $args->currentUserID = $_SESSION['currentUser']->dbID; + $args->basehref = $_SESSION['basehref']; + + $gui = new stdClass(); + $gui->grants = getGrantsForUserMgmt($dbHandler, $args->currentUser); + $gui->feedback = ''; + $gui->basehref = $args->basehref; + + return array( + $args, + $gui + ); +} + +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_plugins'); } - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'mgt_plugins'); -} \ No newline at end of file diff --git a/lib/project/fix_tplans.php b/lib/project/fix_tplans.php index ce0d9e5048..f70e2e7621 100644 --- a/lib/project/fix_tplans.php +++ b/lib/project/fix_tplans.php @@ -1,64 +1,56 @@ - $testProject) - { - if ($testProject != "none") - { - echo "
    changing test plan $testPlan to go with test project $testProject"; - changeTestProjectForTestPlan($db, $testPlan, $testProject); - } - } - echo "
    "; - } - - $testPlans = getTestPlansWithoutProject($db); - $testPlansCount = count($testPlans); - - $tpObj = new testproject($db); - $testProjects = $tpObj->get_all(); - - $smarty = new TLSmarty(); - $smarty->assign('testPlans', $testPlans); - $smarty->assign('testProjects', $testProjects); - $smarty->assign('count', $testPlansCount); - $smarty->display($template_dir . 'fix_tplans.tpl'); -} -else -{ - echo "

    ".lang_get('fix_tplans_no_rights')."

    "; -} - - -function changeTestProjectForTestPlan(&$db, $testPlan, $testProject) -{ - $query = "UPDATE testplans SET testproject_id={$testProject} WHERE id={$testPlan}"; - $db->exec_query($query); - echo "
    Done changing test project"; -} - -?> \ No newline at end of file + $testProject) { + if ($testProject != "none") { + echo "
    changing test plan $testPlan to go with test project $testProject"; + changeTestProjectForTestPlan($db, $testPlan, $testProject); + } + } + echo "
    "; + } + + $testPlans = getTestPlansWithoutProject($db); + $testPlansCount = count($testPlans); + + $tpObj = new testproject($db); + $testProjects = $tpObj->get_all(); + + $smarty = new TLSmarty(); + $smarty->assign('testPlans', $testPlans); + $smarty->assign('testProjects', $testProjects); + $smarty->assign('count', $testPlansCount); + $smarty->display($template_dir . 'fix_tplans.tpl'); +} else { + echo "

    " . lang_get('fix_tplans_no_rights') . "

    "; +} + +function changeTestProjectForTestPlan(&$db, $testPlan, $testProject) +{ + $query = "UPDATE testplans SET testproject_id={$testProject} WHERE id={$testPlan}"; + $db->exec_query($query); + echo "
    Done changing test project"; +} + +?> diff --git a/lib/project/projectEdit.php b/lib/project/projectEdit.php index 96b9609434..5439dd39b8 100644 --- a/lib/project/projectEdit.php +++ b/lib/project/projectEdit.php @@ -1,734 +1,771 @@ -doActionValue = ''; -$ui->buttonValue = ''; -$ui->caption = ''; -$ui->main_descr = lang_get('title_testproject_management'); - -$user_feedback = ''; -$reloadType = 'none'; // domain 'none','reloadNavBar' - -$tproject_mgr = new testproject($db); -$args = init_args($tproject_mgr, $_REQUEST, $session_tproject_id); - -$gui = initializeGui($db,$args); -$of = web_editor('notes',$_SESSION['basehref'],$editorCfg) ; -$status_ok = 1; - -switch($args->doAction) { - case 'create': - $template = $templateCfg->default_template; - $ui = create($args,$tproject_mgr); - $gui->testprojects = $ui->testprojects; - break; - - case 'edit': - $template = $templateCfg->default_template; - $ui = edit($args,$tproject_mgr); - break; - - case 'doCreate': - $op = doCreate($args,$tproject_mgr); - $template= $op->status_ok ? null : $templateCfg->default_template; - $ui = $op->ui; - $status_ok = $op->status_ok; - $user_feedback = $op->msg; - $reloadType = $op->reloadType; - break; - - case 'doUpdate': - $op = doUpdate($args,$tproject_mgr,$session_tproject_id); - $template= $op->status_ok ? null : $templateCfg->default_template; - $ui = $op->ui; - $status_ok = $op->status_ok; - $user_feedback = $op->msg; - $reloadType = $op->reloadType; - break; - - case 'doDelete': - $op = doDelete($args,$tproject_mgr,$session_tproject_id); - $status_ok = $op->status_ok; - $user_feedback = $op->msg; - $reloadType = $op->reloadType; - break; - - case 'setActive': - case 'setInactive': - case 'enableRequirements': - case 'disableRequirements': - $m2c = $args->doAction; - $tproject_mgr->$m2c($args->tprojectID); - $template= null; - $ui = new stdClass(); - $status_ok = 1; - $user_feedback = ''; - $reloadType = 'reloadNavBar'; - break; - -} - -$ui->main_descr = lang_get('title_testproject_management'); -$smarty = new TLSmarty(); -$smarty->assign('gui_cfg',$gui_cfg); -$smarty->assign('editorType',$editorCfg['type']); -$smarty->assign('mgt_view_events',$_SESSION['currentUser']->hasRight($db,"mgt_view_events")); - -$feedback_type = ''; -if(!$status_ok) { - $feedback_type = 'error'; - $args->doAction = "ErrorOnAction"; -} - -switch($args->doAction) { - case "doCreate": - case "doDelete": - case "doUpdate": - case "setActive": - case "setInactive": - case 'enableRequirements': - case 'disableRequirements': - if( ($addIssueTracker = $addCodeTracker = $addReqMgrSystem = is_null($template)) ) { - $template = 'projectView.tpl'; - // needed after addition of search function on test project view - $gui->name = ''; - $gui->feedback = ''; - } - - $gui->doAction = $reloadType; - $opt = array('output' => 'array_of_map', 'order_by' => " ORDER BY nodes_hierarchy.name ", - 'add_issuetracker' => $addIssueTracker, 'add_codetracker' => $addCodeTracker, - 'add_reqmgrsystem' => $addReqMgrSystem); - $gui->tprojects = (array)$tproject_mgr->get_accessible_for_user($args->userID,$opt); - - $gui->pageTitle = lang_get('title_testproject_management'); - $gui->itemQty = $tprojQty = count($gui->tprojects); - - if($gui->itemQty > 0) { - $gui->pageTitle .= ' ' . sprintf(lang_get('available_test_projects'),$gui->itemQty); - } - $imgSet = $smarty->getImages(); - - - if($addIssueTracker) { - $labels = init_labels(array('active_integration' => null, 'inactive_integration' => null)); - - for($idx=0; $idx < $tprojQty; $idx++) { - $gui->tprojects[$idx]['itstatusImg'] = ''; - if($gui->tprojects[$idx]['itname'] != '') { - $ak = ($gui->tprojects[$idx]['issue_tracker_enabled']) ? 'active' : 'inactive'; - $gui->tprojects[$idx]['itstatusImg'] = ' ' . $labels[$ak . '_integration'] . ''; - } - } - } - - if($addCodeTracker) { - $labels = init_labels(array('active_integration' => null, 'inactive_integration' => null)); - - for($idx=0; $idx < $tprojQty; $idx++) { - $gui->tprojects[$idx]['ctstatusImg'] = ''; - if($gui->tprojects[$idx]['ctname'] != '') { - $ak = ($gui->tprojects[$idx]['code_tracker_enabled']) ? 'active' : 'inactive'; - $gui->tprojects[$idx]['ctstatusImg'] = ' ' . $labels[$ak . '_integration'] . ''; - } - } - } - - if($addReqMgrSystem) { - $labels = init_labels(array('active_integration' => null, 'inactive_integration' => null)); - - for($idx=0; $idx < $tprojQty; $idx++) { - $gui->tprojects[$idx]['rmsstatusImg'] = ''; - if($gui->tprojects[$idx]['rmsname'] != '') { - $ak = ($gui->tprojects[$idx]['reqmgr_integration_enabled']) ? 'active' : 'inactive'; - $gui->tprojects[$idx]['rmsstatusImg'] = ' ' . $labels[$ak . '_integration'] . ''; - } - } - } - - $gui->editorType = $editorCfg['type']; - $smarty->assign('gui',$gui); - $smarty->display($templateCfg->template_dir . $template); - break; - - - case "ErrorOnAction": - default: - if( $args->doAction != "edit" && $args->doAction != "ErrorOnAction") { - $of->Value = getItemTemplateContents('project_template', $of->InstanceName, $args->notes); - } else { - $of->Value = $args->notes; - } - - foreach($ui as $prop => $value) { - $smarty->assign($prop,$value); - } - - $smarty->assign('gui', $args); - $smarty->assign('notes', $of->CreateHTML()); - $smarty->assign('user_feedback', $user_feedback); - $smarty->assign('feedback_type', $feedback_type); - $smarty->display($templateCfg->template_dir . $template); - break; -} - - - -/** - * INITialize page ARGuments, using the $_REQUEST and $_SESSION - * super-global hashes. - * Important: changes in HTML input elements on the Smarty template - * must be reflected here. - * - * @param array $request_hash the $_REQUEST - * @param hash session_hash the $_SESSION - * @return singleton object with html values tranformed and other - * generated variables. - * @internal - */ -function init_args($tprojectMgr,$request_hash, $session_tproject_id) { - $args = new stdClass(); - $request_hash = strings_stripSlashes($request_hash); - - $nullable_keys = array('tprojectName','color','notes','doAction','tcasePrefix','api_key'); - foreach ($nullable_keys as $value) - { - $args->$value = isset($request_hash[$value]) ? trim($request_hash[$value]) : null; - } - - $intval_keys = array('tprojectID' => 0, 'copy_from_tproject_id' => 0); - foreach ($intval_keys as $key => $value) - { - $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; - } - - // get input from the project edit/create page - $checkbox_keys = array('is_public' => 0,'active' => 0, - 'optPriority' => 0,'optAutomation' => 0, - 'optReq' => 0,'optInventory' => 0, - 'issue_tracker_enabled' => 0, - 'code_tracker_enabled' => 0, - 'reqmgr_integration_enabled' => 0); - foreach ($checkbox_keys as $key => $value) - { - $args->$key = isset($request_hash[$key]) ? 1 : $value; - } - - $args->issue_tracker_id = isset($request_hash['issue_tracker_id']) ? intval($request_hash['issue_tracker_id']) : 0; - $args->code_tracker_id = isset($request_hash['code_tracker_id']) ? intval($request_hash['code_tracker_id']) : 0; - $args->reqmgrsystem_id = isset($request_hash['reqmgrsystem_id']) ? intval($request_hash['reqmgrsystem_id']) : 0; - - // This way we are safe - if($args->issue_tracker_id == 0) - { - $args->issue_tracker_enabled = 0; - } - - if($args->code_tracker_id == 0) { - $args->code_tracker_enabled = 0; - } - - if($args->doAction != 'doUpdate' && $args->doAction != 'doCreate') { - if ($args->tprojectID > 0) { - $the_data = $tprojectMgr->get_by_id($args->tprojectID); - $args->notes = $the_data['notes']; - - $args->issue_tracker_enabled = intval($the_data['issue_tracker_enabled']); - $args->issue_tracker_id = 0; - $itMgr = new tlIssueTracker($tprojectMgr->db); - $issueT = $itMgr->getLinkedTo($args->tprojectID); - if( !is_null($issueT) ) { - $args->issue_tracker_id = $issueT['issuetracker_id']; - } - - $args->code_tracker_enabled = intval($the_data['code_tracker_enabled']); - $args->code_tracker_id = 0; - $ctMgr = new tlCodeTracker($tprojectMgr->db); - $codeT = $ctMgr->getLinkedTo($args->tprojectID); - if( !is_null($codeT) ) { - $args->code_tracker_id = $codeT['codetracker_id']; - } - - $args->reqmgr_integration_enabled = intval($the_data['reqmgr_integration_enabled']); - $args->reqmgrsystem_id = 0; - $mgr = new tlReqMgrSystem($tprojectMgr->db); - $et = $mgr->getLinkedTo($args->tprojectID); - if( !is_null($et) ) { - $args->reqmgrsystem_id = $et['reqmgrsystem_id']; - } - - if ($args->doAction == 'doDelete') { - $args->tprojectName = $the_data['name']; - } - - } else { - $args->notes = ''; - } - } - - // sanitize output via black list - if($args->notes != '') { - // The Black List - Jon Bokenkamp - $bl = array(''); - foreach($bl as $tg) { - $cl[] = htmlentities($tg); - } - $args->notes = str_replace($bl,$cl,$args->notes); - } - - $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; - $args->userID = intval(isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0); - $args->testprojects = null; - $args->projectOptions = prepareOptions($args); - - return $args; -} - -/** - * Collect a test project options (input from form) to a singleton - * - * @param array $argsObj the page input - * @return singleton data to be stored - */ -function prepareOptions($argsObj) { - $opts = new stdClass(); - $opts->requirementsEnabled = $argsObj->optReq; - $opts->testPriorityEnabled = $argsObj->optPriority; - $opts->automationEnabled = $argsObj->optAutomation; - $opts->inventoryEnabled = $argsObj->optInventory; - - return $opts; -} - -/** - * - * ATTENTION: logEvent() is done on testproject->create() - * - */ -function doCreate($argsObj,&$tprojectMgr) { - $key2get=array('status_ok','msg'); - - $op = new stdClass(); - $op->ui = new stdClass(); - - $op->status_ok = 0; - $op->template = null; - $op->msg = ''; - $op->id = 0; - $op->reloadType = 'none'; - - $check_op = crossChecks($argsObj,$tprojectMgr); - foreach($key2get as $key) { - $op->$key=$check_op[$key]; - } - - if($op->status_ok) { - try { - $shazam = false; - $item = $argsObj; - $item->name = $argsObj->tprojectName; - $item->prefix = $argsObj->tcasePrefix; - $item->options = prepareOptions($argsObj); - $new_id = $tprojectMgr->create($item, array('doChecks' => true, 'setSessionProject' => true)); - } catch (Exception $e) { - $new_id = -1; - $op->status_ok = false; - $op->msg = $e->getMessage(); - $shazam = true; - } - - if ($new_id <= 0) { - if(!$shazam) { - $op->msg = lang_get('refer_to_log'); - } - } else { - $op->template = 'projectView.tpl'; - $op->id = $new_id; - - if($argsObj->issue_tracker_enabled) { - $tprojectMgr->enableIssueTracker($new_id); - } else { - $tprojectMgr->disableIssueTracker($new_id); - } - - - $itMgr = new tlIssueTracker($tprojectMgr->db); - if($argsObj->issue_tracker_id > 0) { - $itMgr->link($argsObj->issue_tracker_id,$new_id); - } - - if($argsObj->code_tracker_enabled) { - $tprojectMgr->enableCodeTracker($new_id); - } else { - $tprojectMgr->disableCodeTracker($new_id); - } - - - $ctMgr = new tlCodeTracker($tprojectMgr->db); - if($argsObj->code_tracker_id > 0) { - $ctMgr->link($argsObj->code_tracker_id,$new_id); - } - - if( !$argsObj->is_public) { - // Need to add specific role on test project in order to not make - // it invisible for me!!! - $tprojectMgr->addUserRole($argsObj->userID,$new_id,$argsObj->user->globalRole->dbID); - } - } - } - - if( $op->status_ok ) { - $op->reloadType = 'reloadNavBar'; - if($argsObj->copy_from_tproject_id > 0) { - $options = array('copy_requirements' => $argsObj->optReq); - $tprojectMgr->copy_as($argsObj->copy_from_tproject_id,$new_id, - $argsObj->userID,trim($argsObj->tprojectName),$options); - } - } - else - { - $op->ui->doActionValue = 'doCreate'; - $op->ui->buttonValue = lang_get('btn_create'); - $op->ui->caption = lang_get('caption_new_tproject'); - } - - return $op; -} - -/* - function: doUpdate - - args: - - returns: - -*/ -function doUpdate($argsObj,&$tprojectMgr,$sessionTprojectID) -{ - $key2get = array('status_ok','msg'); - - $op = new stdClass(); - $op->ui = new stdClass(); - $op->status_ok = 0; - $op->msg = ''; - $op->template = null; - $op->reloadType = 'none'; - - $oldObjData = $tprojectMgr->get_by_id($argsObj->tprojectID); - $op->oldName = $oldObjData['name']; - - $check_op = crossChecks($argsObj,$tprojectMgr); - foreach($key2get as $key) - { - $op->$key=$check_op[$key]; - } - - if($op->status_ok) - { - $options = prepareOptions($argsObj); - if( $tprojectMgr->update($argsObj->tprojectID,trim($argsObj->tprojectName), - $argsObj->color, $argsObj->notes, $options, $argsObj->active, - $argsObj->tcasePrefix, $argsObj->is_public) ) - { - $op->msg = ''; - $tprojectMgr->activate($argsObj->tprojectID,$argsObj->active); - - $tprojectMgr->setIssueTrackerEnabled($argsObj->tprojectID,$argsObj->issue_tracker_enabled); - $itMgr = new tlIssueTracker($tprojectMgr->db); - if( ($doLink = $argsObj->issue_tracker_id > 0) ) - { - $itMgr->link($argsObj->issue_tracker_id,$argsObj->tprojectID); - } - else - { - $issueT = $itMgr->getLinkedTo($argsObj->tprojectID); - if( !is_null($issueT) ) - { - $itMgr->unlink($issueT['issuetracker_id'],$issueT['testproject_id']); - } - } - - $tprojectMgr->setCodeTrackerEnabled($argsObj->tprojectID,$argsObj->code_tracker_enabled); - $ctMgr = new tlCodeTracker($tprojectMgr->db); - if( ($doLink = $argsObj->code_tracker_id > 0) ) - { - $ctMgr->link($argsObj->code_tracker_id,$argsObj->tprojectID); - } - else - { - $codeT = $ctMgr->getLinkedTo($argsObj->tprojectID); - if( !is_null($codeT) ) - { - $ctMgr->unlink($codeT['codetracker_id'],$codeT['testproject_id']); - } - } - - $tprojectMgr->setReqMgrIntegrationEnabled($argsObj->tprojectID,$argsObj->reqmgr_integration_enabled); - $mgr = new tlReqMgrSystem($tprojectMgr->db); - if( ($doLink = $argsObj->reqmgrsystem_id > 0) ) - { - $mgr->link($argsObj->reqmgrsystem_id,$argsObj->tprojectID); - } - else - { - $et = $mgr->getLinkedTo($argsObj->tprojectID); - if( !is_null($et) ) - { - $mgr->unlink($et['reqmgrsystem_id'],$et['testproject_id']); - } - } - - if( !$argsObj->is_public) - { - // does user have an SPECIFIC role on Test Project ? - // if answer is yes => do nothing - if(!tlUser::hasRoleOnTestProject($tprojectMgr->db,$argsObj->userID,$argsObj->tprojectID)) - { - $tprojectMgr->addUserRole($argsObj->userID,$argsObj->tprojectID,$argsObj->user->globalRole->dbID); - } - } - - $event = new stdClass(); - $event->message = TLS("audit_testproject_saved",$argsObj->tprojectName); - $event->logLevel = "AUDIT"; - $event->source = "GUI"; - $event->objectID = $argsObj->tprojectID; - $event->objectType = "testprojects"; - $event->code = "UPDATE"; - logEvent($event); - } - else - { - $op->status_ok=0; - } - } - if($op->status_ok) - { - if($sessionTprojectID == $argsObj->tprojectID) - { - $op->reloadType = 'reloadNavBar'; - } - } - else - { - $op->ui->doActionValue = 'doUpdate'; - $op->ui->buttonValue = lang_get('btn_save'); - $op->ui->caption = sprintf(lang_get('caption_edit_tproject'),$op->oldName); - } - - return $op; -} - - -/* - function: edit - initialize variables to launch user interface (smarty template) - to get information to accomplish edit task. - - args: - - returns: - - -*/ -function edit(&$argsObj,&$tprojectMgr) -{ - $tprojectInfo = $tprojectMgr->get_by_id($argsObj->tprojectID); - - $argsObj->tprojectName = $tprojectInfo['name']; - $argsObj->projectOptions = $tprojectInfo['opt']; - $argsObj->tcasePrefix = $tprojectInfo['prefix']; - - $k2l = array('color','notes', 'active','is_public','issue_tracker_enabled', - 'code_tracker_enabled','reqmgr_integration_enabled','api_key'); - foreach($k2l as $key) - { - $argsObj->$key = $tprojectInfo[$key]; - } - - $ui = new stdClass(); - $ui->main_descr=lang_get('title_testproject_management'); - $ui->doActionValue = 'doUpdate'; - $ui->buttonValue = lang_get('btn_save'); - $ui->caption = sprintf(lang_get('caption_edit_tproject'),$argsObj->tprojectName); - return $ui; -} - -/* - function: crossChecks - do checks that are common to create and update operations - - name is valid ? - - name already exists ? - - prefix already exits ? - args: - - returns: - - - -*/ -function crossChecks($argsObj,&$tprojectMgr) -{ - $op = new stdClass(); - $updateAdditionalSQLFilter = null ; - $op = $tprojectMgr->checkName($argsObj->tprojectName); - - $check_op = array(); - $check_op['msg'] = array(); - $check_op['status_ok'] = $op['status_ok']; - - if($argsObj->doAction == 'doUpdate') - { - $updateAdditionalSQLFilter = " testprojects.id <> {$argsObj->tprojectID}"; - } - - if($check_op['status_ok']) - { - if($tprojectMgr->get_by_name($argsObj->tprojectName,$updateAdditionalSQLFilter)) - { - $check_op['msg'][] = sprintf(lang_get('error_product_name_duplicate'),$argsObj->tprojectName); - $check_op['status_ok'] = 0; - } - - // Check prefix no matter what has happen with previous check - $rs = $tprojectMgr->get_by_prefix($argsObj->tcasePrefix,$updateAdditionalSQLFilter); - if(!is_null($rs)) - { - $check_op['msg'][] = sprintf(lang_get('error_tcase_prefix_exists'),$argsObj->tcasePrefix); - $check_op['status_ok'] = 0; - } - } - else - { - $check_op['msg'][] = $op['msg']; - } - return $check_op; -} - -/* - function: create - - args : - - returns: - -*/ -function create(&$argsObj,&$tprojectMgr) -{ - $gui = new stdClass(); - - // Set defaults here - $argsObj->active = 1; - $argsObj->is_public = 1; - $argsObj->optPriority = 1; - $argsObj->optAutomation = 1; - - $gui->active = $argsObj->active; - $gui->is_public = $argsObj->is_public; - $gui->projectOptions = $argsObj->projectOptions = prepareOptions($argsObj); - $gui->doActionValue = 'doCreate'; - $gui->buttonValue = lang_get('btn_create'); - $gui->caption = lang_get('caption_new_tproject'); - - - - new dBug($gui); - - $gui->testprojects = $tprojectMgr->get_all(null,array('access_key' => 'id')); - return $gui; -} - - -/* - function: doDelete - - args : - - returns: - -*/ -function doDelete($argsObj,&$tprojectMgr,$sessionTprojectID) -{ - $tprojectMgr->setAuditLogOn(); - $ope_status = $tprojectMgr->delete($argsObj->tprojectID); - - $op = new stdClass(); - $op->status_ok = $ope_status['status_ok']; - $op->reloadType = 'none'; - - if ($ope_status['status_ok']) - { - $op->reloadType = 'reloadNavBar'; - $op->msg = sprintf(lang_get('test_project_deleted'),$argsObj->tprojectName); - } - else - { - $op->msg = lang_get('info_product_not_deleted_check_log') . ' ' . $ope_status['msg']; - } - - return $op; -} - - - -/* - * - * @internal revisions - * - */ -function initializeGui(&$dbHandler,$argsObj) -{ - - $guiObj = $argsObj; - $guiObj->canManage = $argsObj->user->hasRight($dbHandler,"mgt_modify_product"); - $guiObj->found = 'yes'; - - $ent2loop = array('tlIssueTracker' => 'issueTrackers', 'tlCodeTracker' => 'codeTrackers', - 'tlReqMgrSystem' => 'reqMgrSystems'); - - foreach($ent2loop as $cl => $pr) - { - $mgr = new $cl($dbHandler); - $guiObj->$pr = $mgr->getAll(); - unset($mgr); - } - return $guiObj; -} - - -function checkRights(&$db,&$user) -{ - csrfguard_start(); - return $user->hasRight($db,'mgt_modify_product'); +doActionValue = ''; +$ui->buttonValue = ''; +$ui->caption = ''; +$ui->main_descr = lang_get('title_testproject_management'); + +$user_feedback = ''; +$reloadType = 'none'; +$tproject_mgr = new testproject($db); +$args = initArgs($tproject_mgr, $_REQUEST); + +$gui = initializeGui($db, $args); +$of = web_editor('notes', $_SESSION['basehref'], $editorCfg); +$status_ok = 1; + +switch ($args->doAction) { + case 'create': + $ui = create($args, $tproject_mgr); + $template = $templateCfg->default_template; + $gui->testprojects = $ui->testprojects; + break; + + case 'edit': + $ui = edit($args, $tproject_mgr); + $template = $templateCfg->default_template; + break; + + case 'doCreate': + $op = doCreate($args, $tproject_mgr); + $template = $op->status_ok ? null : $templateCfg->default_template; + $ui = $op->ui; + $status_ok = $op->status_ok; + $user_feedback = $op->msg; + $reloadType = 'projectView'; + break; + + case 'doUpdate': + $op = doUpdate($args, $tproject_mgr, $session_tproject_id); + $template = $op->status_ok ? null : $templateCfg->default_template; + $ui = $op->ui; + $status_ok = $op->status_ok; + $user_feedback = $op->msg; + $reloadType = 'projectView'; + break; + + case 'doDelete': + $op = doDelete($args, $tproject_mgr); + $status_ok = $op->status_ok; + $user_feedback = $op->msg; + $reloadType = 'projectView'; + break; + + case 'setActive': + case 'setInactive': + case 'enableRequirements': + case 'disableRequirements': + $m2c = $args->doAction; + $tproject_mgr->$m2c($args->tprojectID); + $template = null; + $ui = new stdClass(); + $status_ok = tl::OK; + $user_feedback = ''; + $reloadType = 'projectView'; + break; +} + +$ui->main_descr = lang_get('title_testproject_management'); +$smarty = new TLSmarty(); +$smarty->assign('gui_cfg', $gui_cfg); +$smarty->assign('editorType', $editorCfg['type']); +$smarty->assign('mgt_view_events', + $_SESSION['currentUser']->hasRight($db, "mgt_view_events")); + +$feedback_type = ''; +if (! $status_ok) { + $feedback_type = 'error'; + $args->doAction = "ErrorOnAction"; +} + +switch ($args->doAction) { + case "doCreate": + case "doDelete": + case "doUpdate": + case "setActive": + case "setInactive": + case 'enableRequirements': + case 'disableRequirements': + if ($addIssueTracker = $addCodeTracker = $addReqMgrSystem = is_null( + $template)) { + $template = 'projectView.tpl'; + // needed after addition of search function on test project view + $gui->name = ''; + $gui->feedback = ''; + } + + $gui->doAction = $reloadType; + $opt = array( + 'output' => 'array_of_map', + 'order_by' => " ORDER BY nodes_hierarchy.name ", + 'add_issuetracker' => $addIssueTracker, + 'add_codetracker' => $addCodeTracker, + 'add_reqmgrsystem' => $addReqMgrSystem + ); + $gui->tprojects = (array) $tproject_mgr->get_accessible_for_user( + $args->userID, $opt); + + $gui->pageTitle = lang_get('title_testproject_management'); + $gui->itemQty = $tprojQty = count($gui->tprojects); + + if ($gui->itemQty > 0) { + $gui->pageTitle .= ' ' . + sprintf(lang_get('available_test_projects'), $gui->itemQty); + } + $imgSet = $smarty->getImages(); + + if ($addIssueTracker) { + $labels = init_labels( + array( + 'active_integration' => null, + 'inactive_integration' => null + )); + + for ($idx = 0; $idx < $tprojQty; $idx ++) { + $gui->tprojects[$idx]['itstatusImg'] = ''; + if ($gui->tprojects[$idx]['itname'] != '') { + $ak = ($gui->tprojects[$idx]['issue_tracker_enabled']) ? 'active' : 'inactive'; + $gui->tprojects[$idx]['itstatusImg'] = ' ' .
+                        $labels[$ak . '_integration'] . ''; + } + } + } + + if ($addCodeTracker) { + $labels = init_labels( + array( + 'active_integration' => null, + 'inactive_integration' => null + )); + + for ($idx = 0; $idx < $tprojQty; $idx ++) { + $gui->tprojects[$idx]['ctstatusImg'] = ''; + if ($gui->tprojects[$idx]['ctname'] != '') { + $ak = ($gui->tprojects[$idx]['code_tracker_enabled']) ? 'active' : 'inactive'; + $gui->tprojects[$idx]['ctstatusImg'] = ' ' .
+                        $labels[$ak . '_integration'] . ''; + } + } + } + + if ($addReqMgrSystem) { + $labels = init_labels( + array( + 'active_integration' => null, + 'inactive_integration' => null + )); + + for ($idx = 0; $idx < $tprojQty; $idx ++) { + $gui->tprojects[$idx]['rmsstatusImg'] = ''; + if ($gui->tprojects[$idx]['rmsname'] != '') { + $ak = ($gui->tprojects[$idx]['reqmgr_integration_enabled']) ? 'active' : 'inactive'; + $gui->tprojects[$idx]['rmsstatusImg'] = ' ' .
+                        $labels[$ak . '_integration'] . ''; + } + } + } + + $gui->editorType = $editorCfg['type']; + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . $template); + break; + + case "ErrorOnAction": + default: + if ($args->doAction != "edit" && $args->doAction != "ErrorOnAction") { + $of->Value = getItemTemplateContents('project_template', + $of->InstanceName, $args->notes); + } else { + $of->Value = $args->notes; + } + + foreach ($ui as $prop => $value) { + $smarty->assign($prop, $value); + } + + $smarty->assign('gui', $args); + $smarty->assign('notes', $of->CreateHTML()); + $smarty->assign('user_feedback', $user_feedback); + $smarty->assign('feedback_type', $feedback_type); + $smarty->display($templateCfg->template_dir . $template); + break; +} + +/** + * INITialize page ARGuments, using the $_REQUEST and $_SESSION + * super-global hashes. + * Important: changes in HTML input elements on the Smarty template + * must be reflected here. + * + * @param array $request_hash + * the $_REQUEST + * @param + * hash session_hash the $_SESSION + * @return stdClass object with html values tranformed and other + * generated variables. + * @internal + */ +function initArgs($tprojectMgr, $request_hash) +{ + $args = new stdClass(); + $request_hash = strings_stripSlashes($request_hash); + + $nullable_keys = array( + 'tprojectName', + 'color', + 'notes', + 'doAction', + 'tcasePrefix', + 'api_key' + ); + foreach ($nullable_keys as $value) { + $args->$value = isset($request_hash[$value]) ? trim( + $request_hash[$value]) : null; + } + + $intval_keys = array( + 'tprojectID' => 0, + 'copy_from_tproject_id' => 0 + ); + foreach ($intval_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? intval($request_hash[$key]) : $value; + } + + // get input from the project edit/create page + $checkbox_keys = array( + 'is_public' => 0, + 'active' => 0, + 'optPriority' => 0, + 'optAutomation' => 0, + 'optReq' => 0, + 'optInventory' => 0, + 'issue_tracker_enabled' => 0, + 'code_tracker_enabled' => 0, + 'reqmgr_integration_enabled' => 0 + ); + foreach ($checkbox_keys as $key => $value) { + $args->$key = isset($request_hash[$key]) ? 1 : $value; + } + + $args->issue_tracker_id = isset($request_hash['issue_tracker_id']) ? intval( + $request_hash['issue_tracker_id']) : 0; + $args->code_tracker_id = isset($request_hash['code_tracker_id']) ? intval( + $request_hash['code_tracker_id']) : 0; + $args->reqmgrsystem_id = isset($request_hash['reqmgrsystem_id']) ? intval( + $request_hash['reqmgrsystem_id']) : 0; + + // This way we are safe + if ($args->issue_tracker_id == 0) { + $args->issue_tracker_enabled = 0; + } + + if ($args->code_tracker_id == 0) { + $args->code_tracker_enabled = 0; + } + + if ($args->doAction != 'doUpdate' && $args->doAction != 'doCreate') { + if ($args->tprojectID > 0) { + $the_data = $tprojectMgr->get_by_id($args->tprojectID); + $args->notes = $the_data['notes']; + + $args->issue_tracker_enabled = intval( + $the_data['issue_tracker_enabled']); + $args->issue_tracker_id = 0; + $itMgr = new tlIssueTracker($tprojectMgr->db); + $issueT = $itMgr->getLinkedTo($args->tprojectID); + if (! is_null($issueT)) { + $args->issue_tracker_id = $issueT['issuetracker_id']; + } + + $args->code_tracker_enabled = intval( + $the_data['code_tracker_enabled']); + $args->code_tracker_id = 0; + $ctMgr = new tlCodeTracker($tprojectMgr->db); + $codeT = $ctMgr->getLinkedTo($args->tprojectID); + if (! is_null($codeT)) { + $args->code_tracker_id = $codeT['codetracker_id']; + } + + $args->reqmgr_integration_enabled = intval( + $the_data['reqmgr_integration_enabled']); + $args->reqmgrsystem_id = 0; + $mgr = new tlReqMgrSystem($tprojectMgr->db); + $et = $mgr->getLinkedTo($args->tprojectID); + if (! is_null($et)) { + $args->reqmgrsystem_id = $et['reqmgrsystem_id']; + } + + if ($args->doAction == 'doDelete') { + $args->tprojectName = $the_data['name']; + } + } else { + $args->notes = ''; + } + } + + // sanitize output via black list + if ($args->notes != '') { + // The Black List - Jon Bokenkamp + $bl = array( + '' + ); + foreach ($bl as $tg) { + $cl[] = htmlentities($tg); + } + $args->notes = str_replace($bl, $cl, $args->notes); + } + + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + $args->userID = intval( + isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0); + $args->testprojects = null; + $args->projectOptions = prepareOptions($args); + + return $args; +} + +/** + * Collect a test project options (input from form) to a singleton + * + * @param array $argsObj + * the page input + * @return stdClass data to be stored + */ +function prepareOptions($argsObj) +{ + $opts = new stdClass(); + $opts->requirementsEnabled = $argsObj->optReq; + $opts->testPriorityEnabled = $argsObj->optPriority; + $opts->automationEnabled = $argsObj->optAutomation; + $opts->inventoryEnabled = $argsObj->optInventory; + + return $opts; +} + +/** + * ATTENTION: logEvent() is done on testproject->create() + */ +function doCreate($argsObj, &$tprojectMgr) +{ + $key2get = array( + 'status_ok', + 'msg' + ); + + $op = new stdClass(); + $op->ui = new stdClass(); + + $op->status_ok = 0; + $op->template = null; + $op->msg = ''; + $op->id = 0; + $op->reloadType = 'none'; + + $check_op = crossChecks($argsObj, $tprojectMgr); + foreach ($key2get as $key) { + $op->$key = $check_op[$key]; + } + + if ($op->status_ok) { + try { + $shazam = false; + $item = $argsObj; + $item->name = $argsObj->tprojectName; + $item->prefix = $argsObj->tcasePrefix; + $item->options = prepareOptions($argsObj); + $new_id = $tprojectMgr->create($item, + array( + 'doChecks' => true, + 'setSessionProject' => true + )); + } catch (Exception $e) { + $new_id = - 1; + $op->status_ok = false; + $op->msg = $e->getMessage(); + $shazam = true; + } + + if ($new_id <= 0) { + if (! $shazam) { + $op->msg = lang_get('refer_to_log'); + } + } else { + $op->template = 'projectView.tpl'; + $op->id = $new_id; + + if ($argsObj->issue_tracker_enabled) { + $tprojectMgr->enableIssueTracker($new_id); + } else { + $tprojectMgr->disableIssueTracker($new_id); + } + + $itMgr = new tlIssueTracker($tprojectMgr->db); + if ($argsObj->issue_tracker_id > 0) { + $itMgr->link($argsObj->issue_tracker_id, $new_id); + } + + if ($argsObj->code_tracker_enabled) { + $tprojectMgr->enableCodeTracker($new_id); + } else { + $tprojectMgr->disableCodeTracker($new_id); + } + + $ctMgr = new tlCodeTracker($tprojectMgr->db); + if ($argsObj->code_tracker_id > 0) { + $ctMgr->link($argsObj->code_tracker_id, $new_id); + } + + if (! $argsObj->is_public) { + // Need to add specific role on test project in order to not make + // it invisible for me!!! + $tprojectMgr->addUserRole($argsObj->userID, $new_id, + $argsObj->user->globalRole->dbID); + } + } + } + + if ($op->status_ok) { + $op->reloadType = 'reloadNavBar'; + if ($argsObj->copy_from_tproject_id > 0) { + $options = array( + 'copy_requirements' => $argsObj->optReq + ); + $tprojectMgr->copy_as($argsObj->copy_from_tproject_id, $new_id, + $argsObj->userID, trim($argsObj->tprojectName), $options); + } + } else { + $op->ui->doActionValue = 'doCreate'; + $op->ui->buttonValue = lang_get('btn_create'); + $op->ui->caption = lang_get('caption_new_tproject'); + } + + return $op; +} + +/* + * function: doUpdate + * + * args: + * + * returns: + * + */ +function doUpdate($argsObj, &$tprojectMgr, $sessionTprojectID) +{ + $key2get = array( + 'status_ok', + 'msg' + ); + + $op = new stdClass(); + $op->ui = new stdClass(); + $op->status_ok = 0; + $op->msg = ''; + $op->template = null; + $op->reloadType = 'none'; + + $oldObjData = $tprojectMgr->get_by_id($argsObj->tprojectID); + $op->oldName = $oldObjData['name']; + + $check_op = crossChecks($argsObj, $tprojectMgr); + foreach ($key2get as $key) { + $op->$key = $check_op[$key]; + } + + if ($op->status_ok) { + $options = prepareOptions($argsObj); + if ($tprojectMgr->update($argsObj->tprojectID, + trim($argsObj->tprojectName), $argsObj->color, $argsObj->notes, + $options, $argsObj->active, $argsObj->tcasePrefix, + $argsObj->is_public)) { + $op->msg = ''; + $tprojectMgr->activate($argsObj->tprojectID, $argsObj->active); + + $tprojectMgr->setIssueTrackerEnabled($argsObj->tprojectID, + $argsObj->issue_tracker_enabled); + $itMgr = new tlIssueTracker($tprojectMgr->db); + if ($argsObj->issue_tracker_id > 0) { + $itMgr->link($argsObj->issue_tracker_id, $argsObj->tprojectID); + } else { + $issueT = $itMgr->getLinkedTo($argsObj->tprojectID); + if (! is_null($issueT)) { + $itMgr->unlink($issueT['issuetracker_id'], + $issueT['testproject_id']); + } + } + + $tprojectMgr->setCodeTrackerEnabled($argsObj->tprojectID, + $argsObj->code_tracker_enabled); + $ctMgr = new tlCodeTracker($tprojectMgr->db); + if ($argsObj->code_tracker_id > 0) { + $ctMgr->link($argsObj->code_tracker_id, $argsObj->tprojectID); + } else { + $codeT = $ctMgr->getLinkedTo($argsObj->tprojectID); + if (! is_null($codeT)) { + $ctMgr->unlink($codeT['codetracker_id'], + $codeT['testproject_id']); + } + } + + $tprojectMgr->setReqMgrIntegrationEnabled($argsObj->tprojectID, + $argsObj->reqmgr_integration_enabled); + $mgr = new tlReqMgrSystem($tprojectMgr->db); + if ($argsObj->reqmgrsystem_id > 0) { + $mgr->link($argsObj->reqmgrsystem_id, $argsObj->tprojectID); + } else { + $et = $mgr->getLinkedTo($argsObj->tprojectID); + if (! is_null($et)) { + $mgr->unlink($et['reqmgrsystem_id'], $et['testproject_id']); + } + } + + // does user have an SPECIFIC role on Test Project ? + // if answer is yes => do nothing + if (! $argsObj->is_public && + ! tlUser::hasRoleOnTestProject($tprojectMgr->db, + $argsObj->userID, $argsObj->tprojectID)) { + $tprojectMgr->addUserRole($argsObj->userID, $argsObj->tprojectID, + $argsObj->user->globalRole->dbID); + } + + $event = new stdClass(); + $event->message = TLS("audit_testproject_saved", + $argsObj->tprojectName); + $event->logLevel = "AUDIT"; + $event->source = "GUI"; + $event->objectID = $argsObj->tprojectID; + $event->objectType = "testprojects"; + $event->code = "UPDATE"; + logEvent($event); + } else { + $op->status_ok = 0; + } + } + if ($op->status_ok) { + if ($sessionTprojectID == $argsObj->tprojectID) { + $op->reloadType = 'reloadNavBar'; + } + } else { + $op->ui->doActionValue = 'doUpdate'; + $op->ui->buttonValue = lang_get('btn_save'); + $op->ui->caption = sprintf(lang_get('caption_edit_tproject'), + $op->oldName); + } + + return $op; +} + +/* + * function: edit + * initialize variables to launch user interface (smarty template) + * to get information to accomplish edit task. + * + * args: + * + * returns: - + * + */ +function edit(&$argsObj, &$tprojectMgr) +{ + $tprojectInfo = $tprojectMgr->get_by_id($argsObj->tprojectID); + + $argsObj->tprojectName = $tprojectInfo['name']; + $argsObj->projectOptions = $tprojectInfo['opt']; + $argsObj->tcasePrefix = $tprojectInfo['prefix']; + + $k2l = array( + 'color', + 'notes', + 'active', + 'is_public', + 'issue_tracker_enabled', + 'code_tracker_enabled', + 'reqmgr_integration_enabled', + 'api_key' + ); + foreach ($k2l as $key) { + $argsObj->$key = $tprojectInfo[$key]; + } + + $ui = new stdClass(); + $ui->main_descr = lang_get('title_testproject_management'); + $ui->doActionValue = 'doUpdate'; + $ui->buttonValue = lang_get('btn_save'); + $ui->caption = sprintf(lang_get('caption_edit_tproject'), + $argsObj->tprojectName); + return $ui; +} + +/* + * function: crossChecks + * do checks that are common to create and update operations + * - name is valid ? + * - name already exists ? + * - prefix already exits ? + * args: + * + * returns: - + * + * + */ +function crossChecks($argsObj, &$tprojectMgr) +{ + $updateAdditionalSQLFilter = null; + $op = $tprojectMgr->checkName($argsObj->tprojectName); + + $check_op = array(); + $check_op['msg'] = array(); + $check_op['status_ok'] = $op['status_ok']; + + if ($argsObj->doAction == 'doUpdate') { + $updateAdditionalSQLFilter = " testprojects.id <> {$argsObj->tprojectID}"; + } + + if ($check_op['status_ok']) { + if ($tprojectMgr->get_by_name($argsObj->tprojectName, + $updateAdditionalSQLFilter)) { + $check_op['msg'][] = sprintf( + lang_get('error_product_name_duplicate'), $argsObj->tprojectName); + $check_op['status_ok'] = 0; + } + + // Check prefix no matter what has happen with previous check + $rs = $tprojectMgr->get_by_prefix($argsObj->tcasePrefix, + $updateAdditionalSQLFilter); + if (! is_null($rs)) { + $check_op['msg'][] = sprintf(lang_get('error_tcase_prefix_exists'), + $argsObj->tcasePrefix); + $check_op['status_ok'] = 0; + } + } else { + $check_op['msg'][] = $op['msg']; + } + return $check_op; +} + +/* + * function: create + * + * args : + * + * returns: + * + */ +function create(&$argsObj, &$tprojectMgr) +{ + $gui = new stdClass(); + + // Set defaults here + $argsObj->active = 1; + $argsObj->is_public = 1; + $argsObj->optPriority = 1; + $argsObj->optAutomation = 1; + + $gui->active = $argsObj->active; + $gui->is_public = $argsObj->is_public; + $gui->projectOptions = $argsObj->projectOptions = prepareOptions($argsObj); + $gui->doActionValue = 'doCreate'; + $gui->buttonValue = lang_get('btn_create'); + $gui->caption = lang_get('caption_new_tproject'); + + $gui->testprojects = $tprojectMgr->get_all(null, + array( + 'access_key' => 'id' + )); + return $gui; +} + +/* + * function: doDelete + * + * args : + * + * returns: + * + */ +function doDelete($argsObj, &$tprojectMgr) +{ + $tprojectMgr->setAuditLogOn(); + $ope_status = $tprojectMgr->delete($argsObj->tprojectID); + + $op = new stdClass(); + $op->status_ok = $ope_status['status_ok']; + $op->reloadType = 'none'; + + if ($ope_status['status_ok']) { + $op->reloadType = 'reloadNavBar'; + $op->msg = sprintf(lang_get('test_project_deleted'), + $argsObj->tprojectName); + } else { + $op->msg = lang_get('info_product_not_deleted_check_log') . ' ' . + $ope_status['msg']; + } + + return $op; +} + +/* + * + * @internal revisions + * + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $guiObj = $argsObj; + $guiObj->canManage = $argsObj->user->hasRight($dbHandler, + "mgt_modify_product"); + $guiObj->found = 'yes'; + + $ent2loop = array( + 'tlIssueTracker' => 'issueTrackers', + 'tlCodeTracker' => 'codeTrackers', + 'tlReqMgrSystem' => 'reqMgrSystems' + ); + + foreach ($ent2loop as $cl => $pr) { + $mgr = new $cl($dbHandler); + $guiObj->$pr = $mgr->getAll(); + unset($mgr); + } + return $guiObj; +} + +function checkRights(&$db, &$user) +{ + csrfguard_start(); + return $user->hasRight($db, 'mgt_modify_product'); } diff --git a/lib/project/projectView.php b/lib/project/projectView.php index d900078b8a..6bca34bfae 100644 --- a/lib/project/projectView.php +++ b/lib/project/projectView.php @@ -1,146 +1,153 @@ -default_template; -if(!is_null($gui->tprojects) || $args->doAction=='list') { - if( $gui->itemQty == 0 ) { - $template2launch = "projectEdit.tpl"; - $gui->doAction = "create"; - } -} - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $template2launch); - - -/** - * - * - */ -function init_args() { - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0 ; - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : 'list' ; - $args->userID = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0; - $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; - $args->name = isset($_REQUEST['name']) ? trim($_REQUEST['name']) : null ; - - - - if(!is_null($args->name)) - { - $args->name = trim($args->name); - if(strlen($args->name) == 0) - { - $args->name = null; - } - else - { - $args->name = substr($args->name,0,100); - } - } - return $args; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj) { - - $tplEngine = new TLSmarty(); - - $guiObj = new stdClass(); - $guiObj->doAction = $argsObj->doAction; - $guiObj->canManage = $argsObj->user->hasRight($dbHandler,"mgt_modify_product"); - $guiObj->name = is_null($argsObj->name) ? '' : $argsObj->name; - $guiObj->feedback = ''; - - switch($argsObj->doAction) { - case 'list': - $filters = null; - break; - - case 'search': - default: - $filters = array('name' => array('op' => 'like', 'value' => $argsObj->name)); - $guiObj->feedback = lang_get('no_records_found'); - break; - } - - $tproject_mgr = new testproject($dbHandler); - $opt = array('output' => 'array_of_map', 'order_by' => " ORDER BY name ", - 'add_issuetracker' => true, - 'add_codetracker' => true, 'add_reqmgrsystem' => true); - $guiObj->tprojects = $tproject_mgr->get_accessible_for_user($argsObj->userID,$opt,$filters); - $guiObj->pageTitle = lang_get('title_testproject_management'); - - $cfg = getWebEditorCfg('testproject'); - $guiObj->editorType = $cfg['type']; - - $guiObj->itemQty = count($guiObj->tprojects); - - if($guiObj->itemQty > 0) { - $guiObj->pageTitle .= ' ' . sprintf(lang_get('available_test_projects'),$guiObj->itemQty); - - initIntegrations($guiObj->tprojects,$guiObj->itemQty,$tplEngine); - } - - return array($guiObj,$tplEngine); -} - -/** - * - */ -function initIntegrations(&$tprojSet,$tprojQty,&$tplEngine) { - $labels = init_labels(array('active_integration' => null, - 'inactive_integration' => null)); - - $imgSet = $tplEngine->getImages(); - - $intk = array('it' => 'issue', 'ct' => 'code'); - for($idx=0; $idx < $tprojQty; $idx++) { - foreach( $intk as $short => $item ) { - $tprojSet[$idx][$short . 'statusImg'] = ''; - if($tprojSet[$idx][$short . 'name'] != '') { - $ak = ($tprojSet[$idx][$item . '_tracker_enabled']) ? - 'active' : 'inactive'; - $tprojSet[$idx][$short . 'statusImg'] = - ' ' . $labels[$ak . '_integration'] . ''; - } - } - } -} - - -/** - * - */ -function checkRights(&$db,&$user) { - return $user->hasRight($db,'mgt_modify_product'); +default_template; +if ((! is_null($gui->tprojects) || $args->doAction == 'list') && + $gui->itemQty == 0) { + $template2launch = "projectEdit.tpl"; + $gui->doAction = "create"; +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $template2launch); + +/** + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : 'list'; + $args->userID = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0; + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + $args->name = isset($_REQUEST['name']) ? trim($_REQUEST['name']) : null; + + if (! is_null($args->name)) { + $args->name = trim($args->name); + if (strlen($args->name) == 0) { + $args->name = null; + } else { + $args->name = substr($args->name, 0, 100); + } + } + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $tplEngine = new TLSmarty(); + + $guiObj = new stdClass(); + $guiObj->doAction = $argsObj->doAction; + $guiObj->canManage = $argsObj->user->hasRight($dbHandler, + "mgt_modify_product"); + $guiObj->name = is_null($argsObj->name) ? '' : $argsObj->name; + $guiObj->feedback = ''; + + switch ($argsObj->doAction) { + case 'list': + $filters = null; + break; + + case 'search': + default: + $filters = array( + 'name' => array( + 'op' => 'like', + 'value' => $argsObj->name + ) + ); + $guiObj->feedback = lang_get('no_records_found'); + break; + } + + $tproject_mgr = new testproject($dbHandler); + $opt = array( + 'output' => 'array_of_map', + 'order_by' => " ORDER BY name ", + 'add_issuetracker' => true, + 'add_codetracker' => true, + 'add_reqmgrsystem' => true + ); + $guiObj->tprojects = $tproject_mgr->get_accessible_for_user( + $argsObj->userID, $opt, $filters); + $guiObj->pageTitle = lang_get('title_testproject_management'); + + $cfg = getWebEditorCfg('testproject'); + $guiObj->editorType = $cfg['type']; + + $guiObj->itemQty = count($guiObj->tprojects); + + if ($guiObj->itemQty > 0) { + $guiObj->pageTitle .= ' ' . + sprintf(lang_get('available_test_projects'), $guiObj->itemQty); + + initIntegrations($guiObj->tprojects, $guiObj->itemQty, $tplEngine); + } + + return array( + $guiObj, + $tplEngine + ); +} + +/** + */ +function initIntegrations(&$tprojSet, $tprojQty, &$tplEngine) +{ + $labels = init_labels( + array( + 'active_integration' => null, + 'inactive_integration' => null + )); + + $imgSet = $tplEngine->getImages(); + + $intk = array( + 'it' => 'issue', + 'ct' => 'code' + ); + for ($idx = 0; $idx < $tprojQty; $idx ++) { + foreach ($intk as $short => $item) { + $tprojSet[$idx][$short . 'statusImg'] = ''; + if ($tprojSet[$idx][$short . 'name'] != '') { + $ak = ($tprojSet[$idx][$item . '_tracker_enabled']) ? 'active' : 'inactive'; + $tprojSet[$idx][$short . 'statusImg'] = ' ' .
+                    $labels[$ak . '_integration'] . ''; + } + } + } +} + +/** + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_modify_product'); } diff --git a/lib/project/project_req_spec_mgmt.php b/lib/project/project_req_spec_mgmt.php index 6da9f1c599..5640dacd02 100644 --- a/lib/project/project_req_spec_mgmt.php +++ b/lib/project/project_req_spec_mgmt.php @@ -1,47 +1,49 @@ -tproject_id = $tproject_id; -checkRights($db,$uo,$context); - -$gui = new stdClass(); -$gui->main_descr = lang_get('testproject') . TITLE_SEP . $tproject_name . TITLE_SEP . lang_get('title_req_spec'); -$gui->tproject_id = $tproject_id; -$gui->refresh_tree = 'no'; - - -$gui->grants = new stdClass(); -$gui->grants->modify = - $uo->hasRight($db,'mgt_modify_req',$context->tproject_id); -$gui->grants->ro = - $uo->hasRight($db,'mgt_view_req',$context->tproject_id); - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display('requirements/project_req_spec_mgmt.tpl'); - -/** - * - */ -function checkRights(&$db, &$user, $context) -{ - $context->rightsOr = ["mgt_view_req","mgt_modify_req"]; - $context->rightsAnd = []; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file +tproject_id = $tproject_id; +checkRights($db, $uo, $context); + +$gui = new stdClass(); +$gui->main_descr = lang_get('testproject') . TITLE_SEP . $tproject_name . + TITLE_SEP . lang_get('title_req_spec'); +$gui->tproject_id = $tproject_id; +$gui->refresh_tree = 'no'; + +$gui->grants = new stdClass(); +$gui->grants->modify = $uo->hasRight($db, 'mgt_modify_req', + $context->tproject_id); +$gui->grants->ro = $uo->hasRight($db, 'mgt_view_req', $context->tproject_id); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display('requirements/project_req_spec_mgmt.tpl'); + +/** + */ +function checkRights(&$db, &$user, $context) +{ + $context->rightsOr = [ + "mgt_view_req", + "mgt_modify_req" + ]; + $context->rightsAnd = []; + pageAccessCheck($db, $user, $context); +} diff --git a/lib/reqmgrsystemintegration/reqMgrSystemInterface.class.php b/lib/reqmgrsystemintegration/reqMgrSystemInterface.class.php index 83aa68101c..2d5bf91cc0 100644 --- a/lib/reqmgrsystemintegration/reqMgrSystemInterface.class.php +++ b/lib/reqmgrsystemintegration/reqMgrSystemInterface.class.php @@ -1,4 +1,5 @@ setCfg($config) ) - { - $this->connect(); - } - else - { - $this->connected = false; - } - } - - - /** - * - **/ - function getCfg() - { - return $this->cfg; - } - - /** - * - **/ - function setCfg($xmlString) - { - $msg = null; - $signature = 'Source:' . __METHOD__; - - $xmlCfg = " " . $xmlString; - libxml_use_internal_errors(true); - try - { - $this->cfg = simplexml_load_string($xmlCfg); - if (!$this->cfg) - { - $msg = $signature . " - Failure loading XML STRING\n"; - foreach(libxml_get_errors() as $error) - { - $msg .= "\t" . $error->message; - } - } - } - catch(Exception $e) - { - $msg = $signature . " - Exception loading XML STRING\n"; - $msg .= 'Message: ' .$e->getMessage(); - } - - return is_null($msg); - } - /** - * - **/ - function getMyInterface() - { - return $this->cfg->interfacePHP; - } + private $connected; + + private $cfg = null; + + // simpleXML object + private $interfaceViaDB = false; + + // Variables related to establishing the connection + private $serverConnection = null; + private $server = null; - function isConnected() - { - return $this->connected; - } + private $user = null; + private $password = null; - // =========================================================== - function connect() - { - if (is_null($type)) + // Variables related to retrieving and caching the requirements + private $projects = array(); + + private $lastproject = null; + + private $baselines = array(); + + private $lastbaseline = null; + + private $requirements = array(); + + private $type = null; + + // Variables related to requirement modifications during import. + private $prefix = ""; + + /** + * Will follow same approach used for issue tracking integration, + * connection will be done when constructing. + */ + public function __construct($type, $config) { - return false; + if ($this->setCfg($config)) { + $this->connect(); + } else { + $this->connected = false; + } } - - $this->server = $server; - $this->user = $user; - $this->password = $password; - - return true; - } - - function disconnect($url) - { - if (!is_null($this->server)) + + /** + */ + public function getCfg() { - // Need to disconnect from the server somehow + return $this->cfg; } - - $this->server = null; - $this->user = null; - $this->password = null; - - return true; - } - - function getProjects() - { - if (is_null($server)) + + /** + */ + public function setCfg($xmlString) { - // There is no connection with the requirement management server. - return false; + $msg = null; + $signature = 'Source:' . __METHOD__; + + $xmlCfg = " " . $xmlString; + libxml_use_internal_errors(true); + try { + $this->cfg = simplexml_load_string($xmlCfg); + if (! $this->cfg) { + $msg = $signature . " - Failure loading XML STRING\n"; + foreach (libxml_get_errors() as $error) { + $msg .= "\t" . $error->message; + } + } + } catch (Exception $e) { + $msg = $signature . " - Exception loading XML STRING\n"; + $msg .= 'Message: ' . $e->getMessage(); + } + + return is_null($msg); } - $this->projects = array(); - $this->lastproject = null; - $this->lastbaseline = null; - - if (count($this->projects) == 0) + /** + */ + public function getMyInterface() { - // No projects were found. - return false; + return $this->cfg->interfacePHP; } - return $this->projects; - } - - function getBaselines($project, $refresh = false) - { - if (is_null($serverConnection)) + + public function isConnected() { - // There is no connection with the requirement management server. - return false ; + return $this->connected; } - - if (($project != $this->lastproject) || (count($this->baselines) == 0) || $refresh) + + private function connect() { - // Retrieve baselines for the specified project. - $this->lastproject = $project; - $this->baselines = array(); + if (is_null($type)) { + return false; + } + + $this->server = $server; + $this->user = $user; + $this->password = $password; + + return true; } - else + + private function disconnect($url) { - // Baselines are already available. + if (! is_null($this->server)) { + // Need to disconnect from the server somehow + } + + $this->server = null; + $this->user = null; + $this->password = null; + + return true; + } + + public function getProjects() + { + if (is_null($server)) { + // There is no connection with the requirement management server. + return false; + } + + $this->projects = array(); + $this->lastproject = null; + $this->lastbaseline = null; + + if (count($this->projects) == 0) { + // No projects were found. + return false; + } + return $this->projects; } - - return $this->baselines; - } - - function getRequirements($project, $baseline, $refresh = false) - { - if ($project != $this->lastproject) + + public function getBaselines($project, $refresh = false) { - if (!$this->getBaselines($project)) - { - // Baselines for specified projects could not be retrieved. - return false; - } + if (is_null($serverConnection)) { + // There is no connection with the requirement management server. + return false; + } + + if (($project != $this->lastproject) || (count($this->baselines) == 0) || + $refresh) { + // Retrieve baselines for the specified project. + $this->lastproject = $project; + $this->baselines = array(); + } else { + // Baselines are already available. + } + + return $this->baselines; } - - if (($baseline != $this->lastbaseline) || $refresh) + + public function getRequirements($project, $baseline, $refresh = false) { - // Retrieve the set of requirements in case it is a different baseline as last retrieved - // or the list needs to be refreshed + if ($project != $this->lastproject && ! $this->getBaselines($project)) { + // Baselines for specified projects could not be retrieved. + return false; + } + + if (($baseline != $this->lastbaseline) || $refresh) { + // Retrieve the set of requirements in case it is a different baseline as last retrieved + // or the list needs to be refreshed + } + + return $this->requirements; } - - return $this->requirements; - } - } -?> \ No newline at end of file +?> diff --git a/lib/reqmgrsystems/reqMgrSystemCommands.class.php b/lib/reqmgrsystems/reqMgrSystemCommands.class.php index 333b4ba0ba..c6cba62c70 100644 --- a/lib/reqmgrsystems/reqMgrSystemCommands.class.php +++ b/lib/reqmgrsystems/reqMgrSystemCommands.class.php @@ -1,238 +1,240 @@ -db = $dbHandler; - $this->mgr = new tlReqMgrSystem($dbHandler); - $this->entitySpec = $this->mgr->getEntitySpec(); - - $this->grants=new stdClass(); - $this->grants->canManage = false; - - $this->guiOpWhiteList = array_flip(array('checkConnection','create','edit','delete','doCreate', - 'doUpdate','doDelete')); - } - - function setTemplateCfg($cfg) - { - $this->templateCfg = $cfg; - } - - function getGuiOpWhiteList() - { - return $this->guiOpWhiteList; - } - - /** - * - * - */ - function initGuiBean(&$argsObj, $caller) - { - $obj = new stdClass(); - $obj->action = $caller; - $obj->typeDomain = $this->mgr->getTypes(); - $obj->canManage = $argsObj->currentUser->hasRight($this->db,'reqmgrsystem_management'); - $obj->user_feedback = array('type' => '', 'message' => ''); - - $obj->l18n = init_labels(array('reqmgrsystem_management' => null, 'btn_save' => null, - 'create' => null, 'edit' => null, 'reqmgrsystem_deleted' => null)); - - // we experiment on way to get Action Description for GUI using __FUNCTION__ - $obj->l18n['doUpdate'] = $obj->l18n['edit']; - $obj->l18n['doCreate'] = $obj->l18n['create']; - $obj->l18n['doDelete'] = ''; - $obj->main_descr = $obj->l18n['reqmgrsystem_management']; - $obj->action_descr = ucfirst($obj->l18n[$caller]); - - switch($caller) - { - case 'delete': - case 'doDelete': - $obj->submit_button_label = ''; - break; - - default: - $obj->submit_button_label = $obj->l18n['btn_save']; - break; - } - - return $obj; - } - - /** - * - * - */ - function create(&$argsObj,$request,$caller=null) - { - $guiObj = $this->initGuiBean($argsObj,(is_null($caller) ? __FUNCTION__ : $caller)); - $templateCfg = templateConfiguration('reqMgrSystemEdit'); - $guiObj->template = $templateCfg->default_template; - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'reqmgrsystem_management'); - - $guiObj->item = array('id' => 0); - $dummy = ''; - foreach($this->entitySpec as $property => $type) - { - $guiObj->item[$property] = ($type == 'int') ? 0 :''; - } - return $guiObj; - } - - /** - * - * - */ - function doCreate(&$argsObj,$request) - { - $guiObj = $this->create($argsObj,$request,__FUNCTION__); - - // Checks are centralized on create() - $it = new stdClass(); - foreach($this->entitySpec as $property => $type) - { - $it->$property = $argsObj->$property; - - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$it; - - $op = $this->mgr->create($it); - if($op['status_ok']) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "reqMgrSystemView.php"; - } - else - { - $templateCfg = templateConfiguration('reqMgrSystemEdit'); - $guiObj->template=$templateCfg->default_template; - $guiObj->user_feedback['message'] = $op['msg']; - } - - return $guiObj; - } - - - - - /* - function: edit - - args: - - returns: - - */ - function edit(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $templateCfg = templateConfiguration('reqMgrSystemEdit'); - $guiObj->template = $templateCfg->default_template; - - $guiObj->item = $this->mgr->getByID($argsObj->id); - $guiObj->canManage = $argsObj->currentUser->hasRight($this->db,'reqmgrsystem_management'); - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $it = new stdClass(); - $it->id = $argsObj->id; - foreach($this->entitySpec as $property => $type) - { - $it->$property = $argsObj->$property; - } - - // Save user input. - // This will be useful if create() will fail, to present values again on GUI - $guiObj->item = (array)$it; - - $op = $this->mgr->update($it); - if( $op['status_ok'] ) - { - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "reqMgrSystemView.php"; - } - else - { - $guiObj->user_feedback['message'] = $op['msg']; - $guiObj->template = null; - } - - return $guiObj; - } - - /** - * - * - */ - function doDelete(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - $op = $this->mgr->delete($argsObj->id); - $guiObj->action = 'doDelete'; - $guiObj->template = "reqMgrSystemView.php?"; - return $guiObj; - } - - - function checkConnection(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj,__FUNCTION__); - - $xx = $this->mgr->getByID($argsObj->id); - $class2create = $xx['implementation']; - $its = new $class2create($xx['type'],$xx['cfg']); - - - $guiObj->template = "reqMgrSystemView.php?"; - $guiObj->connectionStatus = $its->isConnected() ? 'ok' : 'ko'; - return $guiObj; - } - -} // end class -?> \ No newline at end of file +db = $dbHandler; + $this->mgr = new tlReqMgrSystem($dbHandler); + $this->entitySpec = $this->mgr->getEntitySpec(); + + $this->grants = new stdClass(); + $this->grants->canManage = false; + + $this->guiOpWhiteList = array_flip( + array( + 'checkConnection', + 'create', + 'edit', + 'delete', + 'doCreate', + 'doUpdate', + 'doDelete' + )); + } + + public function setTemplateCfg($cfg) + { + $this->templateCfg = $cfg; + } + + public function getGuiOpWhiteList() + { + return $this->guiOpWhiteList; + } + + /** + */ + public function initGuiBean(&$argsObj, $caller) + { + $obj = new stdClass(); + $obj->action = $caller; + $obj->typeDomain = $this->mgr->getTypes(); + $obj->canManage = $argsObj->currentUser->hasRight($this->db, + 'reqmgrsystem_management'); + $obj->user_feedback = array( + 'type' => '', + 'message' => '' + ); + + $obj->l18n = init_labels( + array( + 'reqmgrsystem_management' => null, + 'btn_save' => null, + 'create' => null, + 'edit' => null, + 'reqmgrsystem_deleted' => null + )); + + // we experiment on way to get Action Description for GUI using __FUNCTION__ + $obj->l18n['doUpdate'] = $obj->l18n['edit']; + $obj->l18n['doCreate'] = $obj->l18n['create']; + $obj->l18n['doDelete'] = ''; + $obj->main_descr = $obj->l18n['reqmgrsystem_management']; + $obj->action_descr = ucfirst($obj->l18n[$caller]); + + switch ($caller) { + case 'delete': + case 'doDelete': + $obj->submit_button_label = ''; + break; + + default: + $obj->submit_button_label = $obj->l18n['btn_save']; + break; + } + + return $obj; + } + + /** + */ + public function create(&$argsObj, $request, $caller = null) + { + $guiObj = $this->initGuiBean($argsObj, + (is_null($caller) ? __FUNCTION__ : $caller)); + $templateCfg = templateConfiguration('reqMgrSystemEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'reqmgrsystem_management'); + + $guiObj->item = array( + 'id' => 0 + ); + foreach ($this->entitySpec as $property => $type) { + $guiObj->item[$property] = ($type == 'int') ? 0 : ''; + } + return $guiObj; + } + + /** + */ + public function doCreate(&$argsObj, $request) + { + $guiObj = $this->create($argsObj, $request, __FUNCTION__); + + // Checks are centralized on create() + $it = new stdClass(); + foreach ($this->entitySpec as $property => $type) { + $it->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $it; + + $op = $this->mgr->create($it); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "reqMgrSystemView.php"; + } else { + $templateCfg = templateConfiguration('reqMgrSystemEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->user_feedback['message'] = $op['msg']; + } + + return $guiObj; + } + + /* + * function: edit + * + * args: + * + * returns: + * + */ + public function edit(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $templateCfg = templateConfiguration('reqMgrSystemEdit'); + $guiObj->template = $templateCfg->default_template; + + $guiObj->item = $this->mgr->getByID($argsObj->id); + $guiObj->canManage = $argsObj->currentUser->hasRight($this->db, + 'reqmgrsystem_management'); + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $it = new stdClass(); + $it->id = $argsObj->id; + foreach ($this->entitySpec as $property => $type) { + $it->$property = $argsObj->$property; + } + + // Save user input. + // This will be useful if create() will fail, to present values again on GUI + $guiObj->item = (array) $it; + + $op = $this->mgr->update($it); + if ($op['status_ok']) { + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "reqMgrSystemView.php"; + } else { + $guiObj->user_feedback['message'] = $op['msg']; + $guiObj->template = null; + } + + return $guiObj; + } + + /** + */ + public function doDelete(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + $this->mgr->delete($argsObj->id); + $guiObj->action = 'doDelete'; + $guiObj->template = "reqMgrSystemView.php?"; + return $guiObj; + } + + public function checkConnection(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj, __FUNCTION__); + + $xx = $this->mgr->getByID($argsObj->id); + $class2create = $xx['implementation']; + $its = new $class2create($xx['type'], $xx['cfg']); + + $guiObj->template = "reqMgrSystemView.php?"; + $guiObj->connectionStatus = $its->isConnected() ? 'ok' : 'ko'; + return $guiObj; + } +} +?> diff --git a/lib/reqmgrsystems/reqMgrSystemEdit.php b/lib/reqmgrsystems/reqMgrSystemEdit.php index b7a4142762..8784244d0f 100644 --- a/lib/reqmgrsystems/reqMgrSystemEdit.php +++ b/lib/reqmgrsystems/reqMgrSystemEdit.php @@ -1,181 +1,201 @@ -doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) -{ - $op = $commandMgr->$pFn($args,$_REQUEST); -} -renderGui($db,$args,$gui,$op,$templateCfg); - - - - -/** - */ -function renderGui(&$dbHandler,&$argsObj,$guiObj,$opObj,$templateCfg) -{ - $smartyObj = new TLSmarty(); - $renderType = 'none'; - - // key: gui action - // value: next gui action (used to set value of action button on gui) - $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doCreate' => 'doCreate', - 'doUpdate' => 'doUpdate'); - - // Get rendering type and set variable for template - switch($argsObj->doAction) - { - case "edit": - case "create": - case "doDelete": - case "doCreate": - case "doUpdate": - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) - { - $guiObj->$key = $value; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - $renderType = 'redirect'; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - $pos = strpos($tpl, '.php'); - if($pos === false) - { - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = $tplDir . $tpl; - $renderType = 'template'; - } - break; - } - - switch($renderType) - { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } -} - -/** - * - */ -function initScript(&$dbHandler) -{ - $mgr = new reqMgrSystemCommands($dbHandler); - $args = init_args(array('doAction' => $mgr->getGuiOpWhiteList())); - $gui = initializeGui($dbHandler,$args,$mgr); - return array($args,$gui,$mgr); -} - -/** - * @return object returns the arguments for the page - */ -function init_args($whiteLists) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - $iParams = array("id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,20), - "name" => array(tlInputParameter::STRING_N,0,100), - "cfg" => array(tlInputParameter::STRING_N,0,2000), - "type" => array(tlInputParameter::INT_N)); - - R_PARAMS($iParams,$args); - - // sanitize via whitelist - foreach($whiteLists as $inputKey => $allowedValues) - { - if( property_exists($args,$inputKey) ) - { - if( !isset($allowedValues[$args->$inputKey]) ) - { - $msg = "Input parameter $inputKey - white list validation failure - " . - "Value:" . $args->$inputKey . " - " . - "File: " . basename(__FILE__) . " - Function: " . __FUNCTION__ ; - tLog($msg,'ERROR'); - throw new Exception($msg); - } - } - } - - $args->currentUser = $_SESSION['currentUser']; - - return $args; -} - - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,&$commandMgr) -{ - $gui = new stdClass(); - $gui->main_descr = ''; - $gui->action_descr = ''; - $gui->user_feedback = array('type' => '', 'message' => ''); - $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler,'mgt_view_events'); - - // get affected test projects - $gui->testProjectSet = null; - if($argsObj->id > 0) - { - - // just to fix erroneous test project delete - $dummy = $commandMgr->mgr->getLinks($argsObj->id,array('getDeadLinks' => true)); - if( !is_null($dummy) ) - { - foreach($dummy as $key => $elem) - { - $commandMgr->mgr->unlink($argsObj->id,$key); - } - } - - // Now get good info - $gui->testProjectSet = $commandMgr->mgr->getLinks($argsObj->id); - } - return $gui; -} - - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'reqmgrsystem_management'); -} -?> \ No newline at end of file +doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_REQUEST); +} +renderGui($db, $args, $gui, $op, $templateCfg); + +/** + */ +function renderGui(&$dbHandler, &$argsObj, $guiObj, $opObj, $templateCfg) +{ + $smartyObj = new TLSmarty(); + $renderType = 'none'; + + // key: gui action + // value: next gui action (used to set value of action button on gui) + $actionOperation = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate' + ); + + // Get rendering type and set variable for template + switch ($argsObj->doAction) { + case "edit": + case "create": + case "doDelete": + case "doCreate": + case "doUpdate": + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + $renderType = 'redirect'; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = $tplDir . $tpl; + $renderType = 'template'; + } + break; + } + + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/** + */ +function initScript(&$dbHandler) +{ + $mgr = new reqMgrSystemCommands($dbHandler); + $args = initArgs(array( + 'doAction' => $mgr->getGuiOpWhiteList() + )); + $gui = initializeGui($dbHandler, $args, $mgr); + return array( + $args, + $gui, + $mgr + ); +} + +/** + * + * @return object returns the arguments for the page + */ +function initArgs($whiteLists) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "name" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "cfg" => array( + tlInputParameter::STRING_N, + 0, + 2000 + ), + "type" => array( + tlInputParameter::INT_N + ) + ); + + R_PARAMS($iParams, $args); + + // sanitize via whitelist + foreach ($whiteLists as $inputKey => $allowedValues) { + if (property_exists($args, $inputKey) && + ! isset($allowedValues[$args->$inputKey])) { + $msg = "Input parameter $inputKey - white list validation failure - " . + "Value:" . $args->$inputKey . " - " . "File: " . + basename(__FILE__) . " - Function: " . __FUNCTION__; + tLog($msg, 'ERROR'); + throw new Exception($msg); + } + } + + $args->currentUser = $_SESSION['currentUser']; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, &$commandMgr) +{ + $gui = new stdClass(); + $gui->main_descr = ''; + $gui->action_descr = ''; + $gui->user_feedback = array( + 'type' => '', + 'message' => '' + ); + $gui->mgt_view_events = $argsObj->currentUser->hasRight($dbHandler, + 'mgt_view_events'); + + // get affected test projects + $gui->testProjectSet = null; + if ($argsObj->id > 0) { + + // just to fix erroneous test project delete + $dummy = $commandMgr->mgr->getLinks($argsObj->id, + array( + 'getDeadLinks' => true + )); + if (! is_null($dummy)) { + foreach ($dummy as $key => $elem) { + $commandMgr->mgr->unlink($argsObj->id, $key); + } + } + + // Now get good info + $gui->testProjectSet = $commandMgr->mgr->getLinks($argsObj->id); + } + return $gui; +} + +/** + * + * @param $db resource + * the database connection handle + * @param tlUser $user + * the current active user + * + * @return boolean returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'reqmgrsystem_management'); +} +?> diff --git a/lib/reqmgrsystems/reqMgrSystemView.php b/lib/reqmgrsystems/reqMgrSystemView.php index c719ab350b..4774914fa1 100644 --- a/lib/reqmgrsystems/reqMgrSystemView.php +++ b/lib/reqmgrsystems/reqMgrSystemView.php @@ -1,72 +1,79 @@ -items = $mgr->getAll(array('output' => 'add_link_count', 'checkEnv' => true)); -$gui->canManage = $args->currentUser->hasRight($db,"reqmgrsystem_management"); -$gui->user_feedback = $args->user_feedback; - -if($args->id > 0) -{ - $gui->items[$args->id]['connection_status'] = $mgr->checkConnection($args->id) ? 'ok' : 'ko'; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - - - - - - -*/ - - -/** - * @return object returns the arguments for the page - */ -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - - if( $args->tproject_id == 0 ) - { - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_SESSION['tproject_id']) : 0; - } - $args->currentUser = $_SESSION['currentUser']; - - $args->user_feedback = array('type' => '', 'message' => ''); - $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; - return $args; -} - - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"reqmgrsystem_view") || $user->hasRight($db,"reqmgrsystem_management"); -} -?> \ No newline at end of file +items = $mgr->getAll( + array( + 'output' => 'add_link_count', + 'checkEnv' => true + )); +$gui->canManage = $args->currentUser->hasRight($db, "reqmgrsystem_management"); +$gui->user_feedback = $args->user_feedback; + +if ($args->id > 0) { + $gui->items[$args->id]['connection_status'] = $mgr->checkConnection( + $args->id) ? 'ok' : 'ko'; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * + * + * + * + * + * + */ + +/** + * + * @return object returns the arguments for the page + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_SESSION['tproject_id']) : 0; + } + $args->currentUser = $_SESSION['currentUser']; + + $args->user_feedback = array( + 'type' => '', + 'message' => '' + ); + $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; + return $args; +} + +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "reqmgrsystem_view") || + $user->hasRight($db, "reqmgrsystem_management"); +} +?> diff --git a/lib/requirements/reqCommands.class.php b/lib/requirements/reqCommands.class.php index d722310e20..a2e6fe935b 100644 --- a/lib/requirements/reqCommands.class.php +++ b/lib/requirements/reqCommands.class.php @@ -1,1035 +1,1088 @@ -db=$db; - $this->reqSpecMgr = new requirement_spec_mgr($db); - $this->reqMgr = new requirement_mgr($db); - - $this->reqCfg = config_get('req_cfg'); - $this->reqStatusDomain = init_labels($this->reqCfg->status_labels); - $this->reqTypeDomain = init_labels($this->reqCfg->type_labels); - $this->reqRelationTypeDescr = init_labels($this->reqCfg->rel_type_description); - - $type_ec = $this->reqCfg->type_expected_coverage; - $this->attrCfg = array(); - $this->attrCfg['expected_coverage'] = array(); - foreach($this->reqTypeDomain as $type_code => $dummy) { - // Because it has to be used on Smarty Template, I choose to transform - // TRUE -> 1, FALSE -> 0, because I've had problems using true/false - $value = isset($type_ec[$type_code]) ? ($type_ec[$type_code] ? 1 : 0) : 1; - $this->attrCfg['expected_coverage'][$type_code] = $value; - } - } - - /** - * common properties needed on gui - * - */ - function initGuiBean( $argsObj = null ) { - - $obj = new stdClass(); - $obj->pageTitle = ''; - $obj->bodyOnLoad = ''; - $obj->bodyOnUnload = "storeWindowSize('ReqPopup');"; - $obj->hilite_item_name = false; - $obj->display_path = false; - $obj->show_match_count = false; - $obj->match_count = 0; - $obj->main_descr = ''; - $obj->action_descr = ''; - $obj->cfields = null; - $obj->template = ''; - $obj->submit_button_label = ''; - $obj->reqStatusDomain = $this->reqStatusDomain; - $obj->reqTypeDomain = $this->reqTypeDomain; - $obj->attrCfg = $this->attrCfg; - - $obj->reqHasBeenDeleted = false; - $obj->req_spec_id = null; - $obj->req_id = null; - $obj->req_version_id = null; - $obj->req = null; - $obj->expected_coverage = 0; - - $obj->suggest_revision = false; - $obj->prompt_for_log = false; - // do not do this -> will desctroy webeditor - // $obj->scope = ''; - // $obj->refreshTree = 0; - - $obj->req_cfg = config_get('req_cfg'); - $obj->glueChar = config_get('testcase_cfg')->glue_character; - $obj->pieceSep = config_get('gui_title_separator_1'); - - $obj->req_id = 0; - $obj->canAddCoverage = true; - if( null != $argsObj ) { - $obj->refreshTree = $argsObj->refreshTree; - $obj->tproject_name = $argsObj->tproject_name; - $obj->showAllVersions = $argsObj->showAllVersions; - $obj->user_feedback = $argsObj->user_feedback; - $obj->req_version_id = $argsObj->req_version_id; - - $obj->reqVersionIDFromCaller = $obj->req_version_id; - - if( property_exists($argsObj, 'req_id') ) { - $obj->req_id = $argsObj->req_id; - } - - /* if wanted, show only the given version */ - if( $obj->showAllVersions ) { - $obj->version_option = requirement_mgr::ALL_VERSIONS; - } else { - $obj->version_option = $argsObj->req_version_id ? $argsObj->req_version_id : requirement_mgr::ALL_VERSIONS; - $obj->version_option = intval($obj->version_option); - } - - // In order to enable/disable Coverage Manage for version - // we need to understand if this is latest version. - $obj->canAddCoverage = true; - if( $obj->version_option != requirement_mgr::ALL_VERSIONS ) { - $nuOpt = array('output' => 'id'); - $nu = $this->reqMgr->get_last_version_info($obj->req_id, $nuOpt); - $obj->canAddCoverage = ($nu['id'] == $obj->req_version_id); - } - } - $obj->requirement_id = $obj->req_id; - - - - $obj->fileUploadMsg = ''; - $obj->import_limit = TL_REPOSITORY_MAXFILESIZE; - - $reqEdCfg = getWebEditorCfg('requirement'); - $obj->reqEditorType = $reqEdCfg['type']; - - - return $obj; - } - - /* - function: create - - args: - - returns: - - */ - function create(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - - $obj->main_descr = lang_get('req_spec_short') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('create_req'); - - $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id); - $obj->template = 'reqEdit.tpl'; - $obj->submit_button_label = lang_get('btn_save'); - $obj->reqStatusDomain = $this->reqStatusDomain; - $obj->reqTypeDomain = $this->reqTypeDomain; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_id = null; - $obj->req = null; - $obj->expected_coverage = 1; - - // set a default value other than informational for type, - // so the "expected coverage" field is showing for new req - $obj->preSelectedType = 0; - if (defined('TL_REQ_TYPE_USE_CASE') && isset($obj->reqTypeDomain[TL_REQ_TYPE_USE_CASE])) { - $obj->preSelectedType = TL_REQ_TYPE_USE_CASE; - } - - $obj->display_path = false; - return $obj; - } - - /* - function: edit - - args: - - @param boolean $overwriteArgs - - returns: - - */ - function edit(&$argsObj,$request,$overwriteArgs=true) - { - $obj = $this->initGuiBean(); - $obj->display_path = false; - $obj->req = $this->reqMgr->get_by_id($argsObj->req_id,$argsObj->req_version_id); - $obj->req = $obj->req[0]; - if( $overwriteArgs ) - { - $argsObj->scope = $obj->req['scope']; - } - - $obj->main_descr = lang_get('req_short') . TITLE_SEP . $obj->req['req_doc_id'] . " (" . - lang_get('version') . ' ' . $obj->req['version'] . " " . - lang_get('revision') . ' ' . $obj->req['revision'] . - ")" . TITLE_SEP . TITLE_SEP . $obj->req['title']; - - $obj->action_descr = lang_get('edit_req'); - - $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs($argsObj->req_id,$argsObj->req_version_id, - $argsObj->tproject_id); - - - $obj->template = 'reqEdit.tpl'; - $obj->submit_button_label = lang_get('btn_save'); - $obj->reqStatusDomain = $this->reqStatusDomain; - $obj->reqTypeDomain = $this->reqTypeDomain; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_id = $argsObj->req_id; - $obj->req_version_id = $argsObj->req_version_id; - $obj->expected_coverage = $argsObj->expected_coverage; - - return $obj; - } - - /* - function: doCreate - - args: - - returns: - - */ - function doCreate(&$argsObj,$request) - { - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $obj = $this->initGuiBean(); - $obj->display_path = false; - $obj->req = null; - $obj->main_descr = lang_get('req_spec_short') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('create_req'); - $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id, null, $request); - - $obj->submit_button_label=lang_get('btn_save'); - $obj->template = null; - $obj->reqStatusDomain=$this->reqStatusDomain; - $obj->reqTypeDomain = $this->reqTypeDomain; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->expected_coverage = $argsObj->expected_coverage; - - // manage new order - $order = 0; - $nt2exclude = array('testplan' => 'exclude_me','testsuite'=> 'exclude_me', - 'testcase'=> 'exclude_me'); - $siblings = $this->reqMgr->tree_mgr->get_children($argsObj->req_spec_id,$nt2exclude); - if( !is_null($siblings) ) - { - $dummy = end($siblings); - $order = $dummy['node_order']+1; - } - $ret = $this->reqMgr->create($argsObj->req_spec_id,$argsObj->reqDocId,$argsObj->title, - $argsObj->scope,$argsObj->user_id,$argsObj->reqStatus, - $argsObj->reqType,$argsObj->expected_coverage,$order); - - $obj->user_feedback = $ret['msg']; - if($ret['status_ok']) - { - logAuditEvent(TLS("audit_requirement_created",$argsObj->reqDocId),"CREATE",$ret['id'],"requirements"); - $obj->user_feedback = sprintf(lang_get('req_created'),$argsObj->reqDocId,$argsObj->title); - - $cf_map = $this->reqMgr->get_linked_cfields(null,null,$argsObj->tproject_id); - $this->reqMgr->values_to_db($request,$ret['version_id'],$cf_map); - if($argsObj->stay_here) - { - $obj->template = 'reqEdit.tpl'; - } - else - { - $obj->template = "reqView.php?refreshTree={$argsObj->refreshTree}&requirement_id={$ret['id']}"; - } - $obj->req_id = $ret['id']; - $argsObj->scope = ''; - } - else - { - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_version_id = $argsObj->req_version_id; - - $obj->req = array(); - $obj->req['expected_coverage'] = $argsObj->expected_coverage; - $obj->req['title'] = $argsObj->title; - $obj->req['status'] = $argsObj->reqStatus; - $obj->req['type'] = $argsObj->reqType; - $obj->req['req_doc_id'] = $argsObj->reqDocId; - } - return $obj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - $descr_prefix = lang_get('req') . TITLE_SEP; - $ret['msg'] = null; - - // Before Update want to understand what has changed regarding previous version/revision - $oldData = $this->reqMgr->get_by_id($argsObj->req_id,$argsObj->req_version_id); - $oldCFields = $this->reqMgr->get_linked_cfields(null,$argsObj->req_version_id,$argsObj->tproject_id); - - - $cf_map = $this->reqMgr->get_linked_cfields(null,null,$argsObj->tproject_id); - $newCFields = $this->reqMgr->cfield_mgr->_build_cfield($request,$cf_map); - - $diff = $this->simpleCompare($oldData[0],$argsObj,$oldCFields,$newCFields); - - $obj = $this->edit($argsObj,null,!self::OVERWRITESCOPE); - $obj->user_feedback = ''; - $obj->template = null; - $obj->suggest_revision = false; - - $createRev = false; - if($diff['force'] && !$argsObj->do_save) - { - $obj->prompt_for_log = true; - - // Need Change several values with user input data, to match logic on - // reqEdit.php - renderGui() - $map = array('status' => 'reqStatus', 'type' => 'reqType','scope' => 'scope', - 'expected_coverage' => 'expected_coverage', - 'req_doc_id'=> 'reqDocId', 'title' => 'title'); - - foreach($map as $k => $w) - { - $obj->req[$k] = $argsObj->$w; - } - - // Need to preserve Custom Fields values filled in by user - $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id, null, $request); - - } - else if( $diff['nochange'] || ( ($createRev = $diff['force'] && !$obj->prompt_for_log) || $argsObj->do_save ) ) - { - if( $argsObj->do_save == 1) - { - $createRev = ($argsObj->save_rev == 1); - } - - $ret = $this->reqMgr->update($argsObj->req_id,$argsObj->req_version_id, - trim($argsObj->reqDocId),$argsObj->title, - $argsObj->scope,$argsObj->user_id,$argsObj->reqStatus, - $argsObj->reqType,$argsObj->expected_coverage, - null,null,0,$createRev,$argsObj->log_message); - - $obj->user_feedback = $ret['msg']; - $obj->template = null; - - if($ret['status_ok']) - { - $obj->main_descr = ''; - $obj->action_descr = ''; - $obj->template = "reqView.php?refreshTree={$argsObj->refreshTree}&requirement_id={$argsObj->req_id}"; - - $this->reqMgr->values_to_db($request,$argsObj->req_version_id,$cf_map); - - logAuditEvent(TLS("audit_requirement_saved",$argsObj->reqDocId),"SAVE",$argsObj->req_id,"requirements"); - - $obj->refreshTree = $argsObj->refreshTree; - } - else - { - // Action has failed => no change done on DB. - $old = $this->reqMgr->get_by_id($argsObj->req_id,$argsObj->req_version_id); - $obj->main_descr = $descr_prefix . $old['title']; - $obj->cfields = $this->reqMgr->html_table_of_custom_field_values($argsObj->req_id,$argsObj->req_version_id, - $argsObj->tproject_id); - } - } - else if( $diff['suggest'] ) - { - $obj->suggest_revision = true; - } - return $obj; - } - - /** - * - * - */ - function doDelete(&$argsObj,$request) { - $obj = $this->initGuiBean(); - $obj->display_path = false; - $reqVersionSet = $this->reqMgr->get_by_id($argsObj->req_id); - $req = current($reqVersionSet); - - $this->reqMgr->setNotifyOn(array('delete'=> true) ); - $this->reqMgr->delete($argsObj->req_id,requirement_mgr::ALL_VERSIONS,$argsObj->user_id); - - logAuditEvent(TLS("audit_requirement_deleted",$req['req_doc_id']),"DELETE",$argsObj->req_id,"requirements"); - - $obj->template = 'show_message.tpl'; - $obj->template_dir = ''; - $obj->user_feedback = sprintf(lang_get('req_deleted'),$req['req_doc_id'],$req['title']); - $obj->main_descr=lang_get('requirement') . TITLE_SEP . $req['title']; - $obj->title=lang_get('delete_req'); - $obj->refreshTree = 1; - $obj->result = 'ok'; // needed to enable refresh_tree logic - $obj->refreshTree = $argsObj->refreshTree; - return $obj; - } - - - /** - * - * - */ - function doUnfreezeVersion(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info($argsObj->req_version_id); - $req_version = $this->reqMgr->get_by_id($node['parent_id'],$argsObj->req_version_id); - $req_version = $req_version[0]; - - $this->reqMgr->updateOpen($req_version['version_id'], true); - logAuditEvent(TLS("audit_req_version_unfrozen",$req_version['version'], - $req_version['req_doc_id'],$req_version['title']), - "UNFREEZE",$argsObj->req_version_id,"req_version"); - - $obj->template = 'show_message.tpl'; - $obj->template_dir = ''; - - $obj->user_feedback = sprintf(lang_get('req_version_unfrozen'),$req_version['req_doc_id'], - $req_version['title'],$req_version['version']); - - $obj->main_descr = lang_get('requirement') . TITLE_SEP . $req_version['title']; - $obj->title = lang_get('unfreeze_req'); - $obj->refreshTree = 0; - $obj->result = 'ok'; // needed to enable refresh_tree logic - return $obj; - } - - - /** - * - */ - function reorder(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $all_reqs = $this->reqSpecMgr->get_requirements($argsObj->req_spec_id); - - $obj->template = 'reqReorder.tpl'; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_spec_name = $req_spec['title']; - $obj->all_reqs = $all_reqs; - $obj->main_descr = lang_get('req') . TITLE_SEP . $obj->req_spec_name; - - return $obj; - } - - - /** - * - */ - function doReorder(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - $obj->template = 'reqSpecView.tpl'; - $nodes_in_order = transform_nodes_order($argsObj->nodes_order); - - // need to remove first element, is req_spec_id - $req_spec_id = array_shift($nodes_in_order); - $this->reqMgr->set_order($nodes_in_order); - - $obj->req_spec = $this->reqSpecMgr->get_by_id($req_spec_id); - $obj->refreshTree = 1; - - return $obj; - } - - /** - * - * - */ - function createTestCases(&$argsObj,$request) - { - $guiObj = $this->initGuiBean(); - $guiObj->template = 'reqCreateTestCases.tpl'; - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . $req_spec['title']; - $guiObj->action_descr = lang_get('create_testcase_from_req'); - - $guiObj->req_spec_id = $argsObj->req_spec_id; - $guiObj->req_spec_name = $req_spec['title']; - $guiObj->array_of_msg = ''; - - $guiObj->all_reqs = $this->reqSpecMgr->get_requirements($argsObj->req_spec_id); - - foreach($guiObj->all_reqs as $key => $req) - { - $count = count($this->reqMgr->get_coverage($req['id'])); - $guiObj->all_reqs[$key]['coverage_percent'] = - round(100 / $guiObj->all_reqs[$key]['expected_coverage'] * $count, 2); - $guiObj->all_reqs[$key]['coverage'] = $count; - } - return $guiObj; - } - - /** - * - * - */ - function doCreateTestCases(&$argsObj,$request) - { - $guiObj = $this->initGuiBean(); - $guiObj = $this->createTestCases($argsObj,$request); - $msg = $this->reqMgr->create_tc_from_requirement($argsObj->arrReqIds,$argsObj->req_spec_id, - $argsObj->user_id,$argsObj->tproject_id, - $argsObj->testcase_count); - // need to update results - $guiObj = $this->createTestCases($argsObj,$request); - $guiObj->array_of_msg = $msg; - return $guiObj; - } - - - /** - * - * - */ - function copy(&$argsObj,$request=NULL) - { - $obj = $this->initGuiBean(); - $reqVersionSet = $this->reqMgr->get_by_id($argsObj->req_id); - $req = current($reqVersionSet); - - $obj->items = array($req); - $obj->main_descr = lang_get('req') . TITLE_SEP . $req['title']; - $obj->action_descr = lang_get('copy_one_req'); - $obj->template = 'reqCopy.tpl'; - $obj->containers = null; - $obj->page2call = 'lib/requirements/reqEdit.php'; - $obj->array_of_msg = ''; - $obj->doActionButton = 'doCopy'; - $obj->req_spec_id = $argsObj->req_spec_id; - - $exclude_node_types=array('testplan' => 'exclude_me','testsuite' => 'exclude_me', - 'testcase'=> 'exclude_me','requirement' => 'exclude_me', - 'requirement_spec_revision'=> 'exclude_me'); - - $my['filters'] = array('exclude_node_types' => $exclude_node_types); - $my['options']['order_cfg']['type'] = $my['options']['output'] = 'rspec'; - $subtree = $this->reqMgr->tree_mgr->get_subtree($argsObj->tproject_id,$my['filters'],$my['options']); - if(count($subtree)) - { - $obj->containers = $this->reqMgr->tree_mgr->createHierarchyMap($subtree,'dotted',array('field' => 'doc_id','format' => '%s:')); - } - return $obj; - } - - /** - * - * - */ - function doCopy(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - - $target_req_spec = $this->reqSpecMgr->get_by_id($argsObj->containerID); - $itemID = current($argsObj->itemSet); - $argsObj->req_id = $itemID; - $obj = $this->copy($argsObj); - $obj->req = null; - $obj->req_spec_id = $argsObj->req_spec_id; - - $copyOptions = array('copy_also' => - array('testcase_assignment' => $argsObj->copy_testcase_assignment)); - - $ret = $this->reqMgr->copy_to($itemID,$argsObj->containerID,$argsObj->user_id,$argsObj->tproject_id, - $copyOptions); - $obj->user_feedback = $ret['msg']; - $obj->array_of_msg = ''; - - if($ret['status_ok']) - { - $new_req_version_set = $this->reqMgr->get_by_id($ret['id']); - $new_req = current($new_req_version_set); - - $source_req_version_set = $this->reqMgr->get_by_id($itemID); - $source_req = current($source_req_version_set); - $logMsg = TLS("audit_requirement_copy",$new_req['req_doc_id'],$source_req['req_doc_id']); - logAuditEvent($logMsg,"COPY",$ret['id'],"requirements"); - - - $obj->user_feedback = sprintf(lang_get('req_created'), $new_req['req_doc_id'],$new_req['title']); - $obj->template = 'reqCopy.tpl'; - $obj->req_id = $ret['id']; - $obj->array_of_msg = array($logMsg); - $obj->refreshTree = $argsObj->refreshTree; - } - return $obj; - } - - - /** - * doCreateVersion - * - */ - function doCreateVersion(&$argsObj,$request) { - - $freezeSourceVersion = $this->reqCfg->freezeREQVersionOnNewREQVersion; - - $opt = array('reqVersionID' => $argsObj->req_version_id, - 'log_msg' => $argsObj->log_message, - 'notify' => true, - 'freezeSourceVersion' => $freezeSourceVersion); - - $ret = $this->reqMgr->create_new_version($argsObj->req_id,$argsObj->user_id,$opt); - $obj = $this->initGuiBean(); - $obj->user_feedback = $ret['msg']; - $obj->template = "reqView.php?requirement_id={$argsObj->req_id}"; - $obj->req = null; - $obj->req_id = $argsObj->req_id; - return $obj; - } - - - /** - * - * - */ - function doDeleteVersion(&$argsObj,$request) { - $obj = $this->initGuiBean(); - $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info($argsObj->req_version_id); - $req_version = $this->reqMgr->get_by_id($node['parent_id'],$argsObj->req_version_id); - $req_version = $req_version[0]; - - $this->reqMgr->setNotifyOn(array('delete'=> true) ); - - $this->reqMgr->delete($node['parent_id'],$argsObj->req_version_id,$argsObj->user_id); - - logAuditEvent(TLS("audit_req_version_deleted",$req_version['version'], - $req_version['req_doc_id'],$req_version['title']), - "DELETE",$argsObj->req_version_id,"req_version"); - - $obj->template = 'show_message.tpl'; - $obj->template_dir = ''; - - $obj->user_feedback = sprintf(lang_get('req_version_deleted'),$req_version['req_doc_id'], - $req_version['title'],$req_version['version']); - - $obj->main_descr=lang_get('requirement') . TITLE_SEP . $req_version['title']; - $obj->title=lang_get('delete_req'); - $obj->refreshTree = 0; - $obj->result = 'ok'; // needed to enable refresh_tree logic - return $obj; - } - - - /** - * Add a relation from one requirement to another. - * - * @param stdClass $argsObj input parameters - * @return stdClass $obj - */ - public function doAddRelation($argsObj,$request) - { - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $op = array('ok' => true, 'msg' => lang_get('new_rel_add_success')); - $own_id = $argsObj->relation_source_req_id; - $authorID = $argsObj->user_id; - $tproject_id = $argsObj->tproject_id; - - if (isset($argsObj->relation_destination_testproject_id)) { - // relation destination belongs to another project - $tproject_id = $argsObj->relation_destination_testproject_id; - } - - $other_req = $this->reqMgr->getByDocID($argsObj->relation_destination_req_doc_id, $tproject_id); - if (count($other_req) < 1) { - // req doc ID was not ok - $op['ok'] = false; - $op['msg'] = lang_get('rel_add_error_dest_id'); - } - - if ($op['ok']) { - // are all the IDs we have ok? - $other_req = current($other_req); - - $other_id = $other_req['id']; - $source_id = $own_id; - $destination_id = $other_id; - $relTypeID = (int)current((explode('_',$argsObj->relation_type))); - if( strpos($argsObj->relation_type, "_destination") ) - { - $source_id = $other_id; - $destination_id = $own_id; - } - - if (!is_numeric($authorID) || !is_numeric($source_id) || !is_numeric($destination_id)) { - $op['ok'] = false; - $op['msg'] = lang_get('rel_add_error'); - } - - if ( $op['ok'] && ($source_id == $destination_id)) { - $op['ok'] = false; - $op['msg'] = lang_get('rel_add_error_self'); - } - } - - if ($op['ok']) { - $exists = $this->reqMgr->check_if_relation_exists($source_id, $destination_id, $relTypeID); - if ($exists) { - $op['ok'] = false; - $op['msg'] = sprintf(lang_get('rel_add_error_exists_already'),$this->reqRelationTypeDescr[$relTypeID]); - } - $dest_last_version_info = $this->reqMgr->get_last_version_info($destination_id); - if (!$dest_last_version_info['is_open']) { - $op['ok'] = false; - $op['msg'] = sprintf(lang_get('rel_add_error_dest_frozen')); - } - } - - if ($op['ok']) { - $this->reqMgr->add_relation($source_id, $destination_id, $relTypeID, $authorID); - } - - $obj = $this->initGuiBean(); - $op['msg'] = ($op['ok'] ? '
    ' : '
    ') . $op['msg'] . '
    '; - $obj->template = "reqView.php?requirement_id={$own_id}&relation_add_result_msg=" . $op['msg']; - - return $obj; - } - - - /** - * delete a relation to another requirement - * - * @author Andreas Simon - * - * @param stcClass $argsObj user input data - * - * @return stdClass $object data for template to display - */ - public function doDeleteRelation($argsObj,$request) - { - - $debugMsg = '/* Class:' . __CLASS__ . ' - Method: ' . __FUNCTION__ . ' */'; - $ok_msg = '
    ' . lang_get('delete_rel_success') . '
    '; - $op = array('ok' => true, 'msg' => $ok_msg); - - $relation_id = $argsObj->relation_id; - $requirement_id = $argsObj->requirement_id; - - if (is_null($relation_id) || !is_numeric($relation_id) - || is_null($requirement_id) || !is_numeric($requirement_id)) { - $op['ok'] = false; - $op['msg'] = '
    ' . lang_get('error_deleting_rel') . '
    '; - } - - if ($op['ok']) { - $this->reqMgr->delete_relation($relation_id); - } - - $obj = $this->initGuiBean(); - $obj->template = "reqView.php?requirement_id=$requirement_id&relation_add_result_msg=" . $op['msg']; - - return $obj; - } - - /* - function: doCreateRevision - - args: - - returns: - - @internal revisions - - */ - function doCreateRevision(&$argsObj,$request) - { - $req = $this->reqMgr->get_by_id($argsObj->req_id,$argsObj->req_version_id); - $req = $req[0]; - $ret = $this->reqMgr->create_new_revision($argsObj->req_version_id,$argsObj->user_id, - $argsObj->tproject_id,$req,$argsObj->log_message); - - $obj = $this->initGuiBean(); - $obj->user_feedback = $ret['msg']; - $obj->template = "reqView.php?requirement_id={$argsObj->req_id}"; - $obj->req = null; - $obj->req_id = $argsObj->req_id; - return $obj; - } - - - - - - /** - * - * - */ - function simpleCompare($old,$new,$oldCF,$newCF) - { - - $suggest_revision = array('scope' => 'scope'); - - $force_revision = array('status' => 'reqStatus', 'type' => 'reqType', - 'expected_coverage' => 'expected_coverage', - 'req_doc_id'=> 'reqDocId', 'title' => 'title'); - - - $ret = array('force' => false, 'suggest' => false, 'nochange' => false, 'changeon' => null); - foreach($force_revision as $access_key => $access_prop) - { - if( $ret['force'] = ($old[$access_key] != $new->$access_prop) ) - { - $ret['changeon'] = 'attribute:' . $access_key; - break; - } - } - - if( !$ret['force'] ) - { - if( !is_null($newCF) ) - { - foreach($newCF as $cf_key => $cf) - { - if( $ret['force'] = ($oldCF[$cf_key]['value'] != $cf['cf_value']) ) - { - $ret['changeon'] = 'custom field:' . $oldCF[$cf_key]['name']; - break; - } - } - } - } - - if( !$ret['force'] ) - { - - foreach($suggest_revision as $access_key => $access_prop) - { - if( $ret['suggest'] = ($old[$access_key] != $new->$access_prop) ) - { - $ret['changeon'] = 'attribute:' . $access_key; - break; - } - } - - } - $ret['nochange'] = ($ret['force'] == false && $ret['suggest'] == false); - return $ret; - } - - - /** - * - * - */ - function doFreezeVersion(&$argsObj,$request) - { - $obj = $this->initGuiBean(); - $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info($argsObj->req_version_id); - $req_version = $this->reqMgr->get_by_id($node['parent_id'],$argsObj->req_version_id); - $req_version = $req_version[0]; - - $this->reqMgr->updateOpen($req_version['version_id'], false); - - // BUGID 3312 - logAuditEvent(TLS("audit_req_version_frozen",$req_version['version'], - $req_version['req_doc_id'],$req_version['title']), - "FREEZE",$argsObj->req_version_id,"req_version"); - - $obj->template = 'show_message.tpl'; - $obj->template_dir = ''; - - $obj->user_feedback = sprintf(lang_get('req_version_frozen'),$req_version['req_doc_id'], - $req_version['title'],$req_version['version']); - - $obj->main_descr=lang_get('requirement') . TITLE_SEP . $req_version['title']; - $obj->title=lang_get('freeze_req'); - $obj->refreshTree = 0; - $obj->result = 'ok'; // needed to enable refresh_tree logic - return $obj; - } - - /** - * - */ - function addTestCase(&$argsObj,$request) { - - $obj = $this->initGuiBean(); - $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info($argsObj->req_version_id); - $dummy = $this->reqMgr->get_by_id($node['parent_id'],$argsObj->req_version_id); - $req_version = $dummy[0]; - - $obj->req = $req_version; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_version_id = $argsObj->req_version_id; - $obj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; - - // Analise test case identity - $tcaseCfg = config_get('testcase_cfg'); - - $status_ok = false; - $msg = sprintf(lang_get('provide_full_external_tcase_id'),$argsObj->tcasePrefix, $tcaseCfg->glue_character); - $gluePos = strrpos($argsObj->tcaseIdentity, $tcaseCfg->glue_character); - - $isFullExternal = ($gluePos !== false); - if($isFullExternal) { - $status_ok = true; - $rawTestCasePrefix = substr($argsObj->tcaseIdentity, 0, $gluePos); - - $status_ok = (strcmp($rawTestCasePrefix,$argsObj->tcasePrefix) == 0); - if(!$status_ok) { - $msg = sprintf(lang_get('seems_to_belong_to_other_tproject'),$rawTestCasePrefix,$argsObj->tcasePrefix); - } - } - - if($status_ok) { - // IMPORTANT NOTICE: audit info is managed on reqMgr method - $alienMgr = new testcase($this->db); - $tcase_id = $alienMgr->getInternalID($argsObj->tcaseIdentity,array('tproject_id' => $argsObj->tproject_id)); - - // Design Choice - // 1. Only latest test case version will be added - // 2. Only if not executed - if($tcase_id > 0) { - - $doLink = true; - if( $tcaseCfg->reqLinkingDisabledAfterExec ) { - if( $alienMgr->latestVersionHasBeenExecuted($tcase_id) == 0) { - $doLink = true; - } else { - $doLink = false; - $status_ok = false; - $msg = sprintf(lang_get('cannot_link_latest_version_reason_has_been_exec'), - $argsObj->tcaseIdentity); - } - } - if( $doLink ) { - $this->reqMgr->assign_to_tcase($argsObj->req_id,$tcase_id,intval($argsObj->user_id)); - } - - } else { - $status_ok = false; - $msg = sprintf(lang_get('tcase_doesnot_exist'),$argsObj->tcaseIdentity); - } - } - - - if(!$status_ok) { - $obj->user_feedback = $msg; - $obj->template .= "&user_feedback=" . urlencode($obj->user_feedback); - } - - return $obj; - } - - /** - * - */ - function removeTestCase(&$argsObj,$request) { - // IMPORTANT NOTICE: audit info is managed on reqMgr method - $obj = $this->initGuiBean(); - $bond = array('req' => $argsObj->req_version_id, 'tc' => $argsObj->tcaseIdentity); - - $this->reqMgr->delReqVersionTCVersionLink($bond,__METHOD__); - - $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info($argsObj->req_version_id); - $dummy = $this->reqMgr->get_by_id($node['parent_id'],$argsObj->req_version_id); - $req_version = $dummy[0]; - - $obj->req = $req_version; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->req_version_id = $argsObj->req_version_id; - $obj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; - return $obj; - } - - /** - * - */ - function fileUpload(&$argsObj,$request) { - $argsObj->uploadOp = fileUploadManagement($this->db,$argsObj->req_version_id, - $argsObj->fileTitle,$this->reqMgr->getAttachmentTableName()); - - return $this->initGuiObjForAttachmentOperations($argsObj); - } - - /** - * - */ - function deleteFile(&$argsObj) { - $fileInfo = deleteAttachment($this->db,$argsObj->file_id,false); - if( $argsObj->req_version_id == 0 ) { - $argsObj->req_version_id = $fileInfo['fk_id']; - } - - return $this->initGuiObjForAttachmentOperations($argsObj); - } - - - /** - * - */ - private function initGuiObjForAttachmentOperations($argsObj) { - $guiObj = new stdClass(); - $guiObj->reqHasBeenDeleted = false; - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->req_id = $argsObj->req_id; - $guiObj->suggest_revision = $guiObj->prompt_for_log = false; - $guiObj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; - $guiObj->uploadOp = $argsObj->uploadOp; - - return $guiObj; - } - - /** - * - */ - function stopMonitoring(&$argsObj,$request) - { - $this->reqMgr->monitorOff($argsObj->req_id,$argsObj->user_id,$argsObj->tproject_id); - - return $this->initGuiObjForAttachmentOperations($argsObj); - } - - /** - * - */ - function startMonitoring(&$argsObj,$request) - { - $this->reqMgr->monitorOn($argsObj->req_id,$argsObj->user_id,$argsObj->tproject_id); - - return $this->initGuiObjForAttachmentOperations($argsObj); - } - -} \ No newline at end of file +db = $db; + $this->reqSpecMgr = new requirement_spec_mgr($db); + $this->reqMgr = new requirement_mgr($db); + + $this->reqCfg = config_get('req_cfg'); + $this->reqStatusDomain = init_labels($this->reqCfg->status_labels); + $this->reqTypeDomain = init_labels($this->reqCfg->type_labels); + $this->reqRelationTypeDescr = init_labels( + $this->reqCfg->rel_type_description); + + $type_ec = $this->reqCfg->type_expected_coverage; + $this->attrCfg = array(); + $this->attrCfg['expected_coverage'] = array(); + foreach ($this->reqTypeDomain as $type_code => $dummy) { + // Because it has to be used on Smarty Template, I choose to transform + // TRUE -> 1, FALSE -> 0, because I've had problems using true/false + $value = isset($type_ec[$type_code]) ? ($type_ec[$type_code] ? 1 : 0) : 1; + $this->attrCfg['expected_coverage'][$type_code] = $value; + } + } + + /** + * common properties needed on gui + */ + public function initGuiBean($argsObj = null) + { + $obj = new stdClass(); + $obj->pageTitle = ''; + $obj->bodyOnLoad = ''; + $obj->bodyOnUnload = "storeWindowSize('ReqPopup');"; + $obj->hilite_item_name = false; + $obj->display_path = false; + $obj->show_match_count = false; + $obj->match_count = 0; + $obj->main_descr = ''; + $obj->action_descr = ''; + $obj->cfields = null; + $obj->template = ''; + $obj->submit_button_label = ''; + $obj->reqStatusDomain = $this->reqStatusDomain; + $obj->reqTypeDomain = $this->reqTypeDomain; + $obj->attrCfg = $this->attrCfg; + + $obj->reqHasBeenDeleted = false; + $obj->req_spec_id = null; + $obj->req_id = null; + $obj->req_version_id = null; + $obj->req = null; + $obj->expected_coverage = 0; + + $obj->suggest_revision = false; + $obj->prompt_for_log = false; + + $obj->req_cfg = config_get('req_cfg'); + $obj->glueChar = config_get('testcase_cfg')->glue_character; + $obj->pieceSep = config_get('gui_title_separator_1'); + + $obj->req_id = 0; + $obj->canAddCoverage = true; + if (! empty($argsObj)) { + $obj->refreshTree = $argsObj->refreshTree; + $obj->tproject_name = $argsObj->tproject_name; + $obj->showAllVersions = $argsObj->showAllVersions; + $obj->user_feedback = $argsObj->user_feedback; + $obj->req_version_id = $argsObj->req_version_id; + + $obj->reqVersionIDFromCaller = $obj->req_version_id; + + if (property_exists($argsObj, 'req_id')) { + $obj->req_id = $argsObj->req_id; + } + + /* if wanted, show only the given version */ + if ($obj->showAllVersions) { + $obj->version_option = requirement_mgr::ALL_VERSIONS; + } else { + $obj->version_option = $argsObj->req_version_id ? $argsObj->req_version_id : requirement_mgr::ALL_VERSIONS; + $obj->version_option = intval($obj->version_option); + } + + // In order to enable/disable Coverage Manage for version + // we need to understand if this is latest version. + $obj->canAddCoverage = true; + if ($obj->version_option != requirement_mgr::ALL_VERSIONS) { + $nuOpt = array( + 'output' => 'id' + ); + $nu = $this->reqMgr->getLastVersionInfo($obj->req_id, $nuOpt); + $obj->canAddCoverage = ($nu['id'] == $obj->req_version_id); + } + } + $obj->requirement_id = $obj->req_id; + + $obj->fileUploadMsg = ''; + $obj->import_limit = TL_REPOSITORY_MAXFILESIZE; + + $reqEdCfg = getWebEditorCfg('requirement'); + $obj->reqEditorType = $reqEdCfg['type']; + + return $obj; + } + + /* + * function: create + * + * args: + * + * returns: + * + */ + public function create(&$argsObj) + { + $obj = $this->initGuiBean(); + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + + $obj->main_descr = lang_get('req_spec_short') . TITLE_SEP . + $req_spec['title']; + $obj->action_descr = lang_get('create_req'); + + $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs(null, + null, $argsObj->tproject_id); + $obj->template = 'reqEdit.tpl'; + $obj->submit_button_label = lang_get('btn_save'); + $obj->reqStatusDomain = $this->reqStatusDomain; + $obj->reqTypeDomain = $this->reqTypeDomain; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_id = null; + $obj->req = null; + $obj->expected_coverage = 1; + + // set a default value other than informational for type, + // so the "expected coverage" field is showing for new req + $obj->preSelectedType = 0; + if (defined('TL_REQ_TYPE_USE_CASE') && + isset($obj->reqTypeDomain[TL_REQ_TYPE_USE_CASE])) { + $obj->preSelectedType = TL_REQ_TYPE_USE_CASE; + } + + $obj->display_path = false; + return $obj; + } + + /* + * function: edit + * + * args: + * + * @param boolean $overwriteArgs + * + * returns: + * + */ + public function edit(&$argsObj, $overwriteArgs = true) + { + $obj = $this->initGuiBean(); + $obj->display_path = false; + $obj->req = $this->reqMgr->get_by_id($argsObj->req_id, + $argsObj->req_version_id); + $obj->req = $obj->req[0]; + if ($overwriteArgs) { + $argsObj->scope = $obj->req['scope']; + } + + $obj->main_descr = lang_get('req_short') . TITLE_SEP . + $obj->req['req_doc_id'] . " (" . lang_get('version') . ' ' . + $obj->req['version'] . " " . lang_get('revision') . ' ' . + $obj->req['revision'] . ")" . TITLE_SEP . TITLE_SEP . + $obj->req['title']; + + $obj->action_descr = lang_get('edit_req'); + + $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs( + $argsObj->req_id, $argsObj->req_version_id, $argsObj->tproject_id); + + $obj->template = 'reqEdit.tpl'; + $obj->submit_button_label = lang_get('btn_save'); + $obj->reqStatusDomain = $this->reqStatusDomain; + $obj->reqTypeDomain = $this->reqTypeDomain; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_id = $argsObj->req_id; + $obj->req_version_id = $argsObj->req_version_id; + $obj->expected_coverage = $argsObj->expected_coverage; + + return $obj; + } + + /* + * function: doCreate + * + * args: + * + * returns: + * + */ + public function doCreate(&$argsObj, $request) + { + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $obj = $this->initGuiBean(); + $obj->display_path = false; + $obj->req = null; + $obj->main_descr = lang_get('req_spec_short') . TITLE_SEP . + $req_spec['title']; + $obj->action_descr = lang_get('create_req'); + $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs(null, + null, $argsObj->tproject_id, null, $request); + + $obj->submit_button_label = lang_get('btn_save'); + $obj->template = null; + $obj->reqStatusDomain = $this->reqStatusDomain; + $obj->reqTypeDomain = $this->reqTypeDomain; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->expected_coverage = $argsObj->expected_coverage; + + // manage new order + $order = 0; + $nt2exclude = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me' + ); + $siblings = $this->reqMgr->tree_mgr->get_children($argsObj->req_spec_id, + $nt2exclude); + if (! is_null($siblings)) { + $dummy = end($siblings); + $order = $dummy['node_order'] + 1; + } + $ret = $this->reqMgr->create($argsObj->req_spec_id, $argsObj->reqDocId, + $argsObj->title, $argsObj->scope, $argsObj->user_id, + $argsObj->reqStatus, $argsObj->reqType, $argsObj->expected_coverage, + $order); + + $obj->user_feedback = $ret['msg']; + if ($ret['status_ok']) { + logAuditEvent(TLS("audit_requirement_created", $argsObj->reqDocId), + "CREATE", $ret['id'], "requirements"); + $obj->user_feedback = sprintf(lang_get('req_created'), + $argsObj->reqDocId, $argsObj->title); + + $cf_map = $this->reqMgr->get_linked_cfields(null, null, + $argsObj->tproject_id); + $this->reqMgr->values_to_db($request, $ret['version_id'], $cf_map); + if ($argsObj->stay_here) { + $obj->template = 'reqEdit.tpl'; + } else { + $obj->template = "reqView.php?refreshTree={$argsObj->refreshTree}&requirement_id={$ret['id']}"; + } + $obj->req_id = $ret['id']; + $argsObj->scope = ''; + } else { + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_version_id = $argsObj->req_version_id; + + $obj->req = array(); + $obj->req['expected_coverage'] = $argsObj->expected_coverage; + $obj->req['title'] = $argsObj->title; + $obj->req['status'] = $argsObj->reqStatus; + $obj->req['type'] = $argsObj->reqType; + $obj->req['req_doc_id'] = $argsObj->reqDocId; + } + return $obj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $this->initGuiBean(); + $descr_prefix = lang_get('req') . TITLE_SEP; + $ret['msg'] = null; + + // Before Update want to understand what has changed regarding previous version/revision + $oldData = $this->reqMgr->get_by_id($argsObj->req_id, + $argsObj->req_version_id); + $oldCFields = $this->reqMgr->get_linked_cfields(null, + $argsObj->req_version_id, $argsObj->tproject_id); + + $cf_map = $this->reqMgr->get_linked_cfields(null, null, + $argsObj->tproject_id); + $newCFields = $this->reqMgr->cfield_mgr->_build_cfield($request, $cf_map); + + $diff = $this->simpleCompare($oldData[0], $argsObj, $oldCFields, + $newCFields); + + $obj = $this->edit($argsObj, ! self::OVERWRITESCOPE); + $obj->user_feedback = ''; + $obj->template = null; + $obj->suggest_revision = false; + + $createRev = false; + if ($diff['force'] && ! $argsObj->do_save) { + $obj->prompt_for_log = true; + + // Need Change several values with user input data, to match logic on + // reqEdit.php - renderGui() + $map = array( + 'status' => 'reqStatus', + 'type' => 'reqType', + 'scope' => 'scope', + 'expected_coverage' => 'expected_coverage', + 'req_doc_id' => 'reqDocId', + 'title' => 'title' + ); + + foreach ($map as $k => $w) { + $obj->req[$k] = $argsObj->$w; + } + + // Need to preserve Custom Fields values filled in by user + $obj->cfields = $this->reqMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id, null, $request); + } elseif ($diff['nochange'] || + (($createRev = $diff['force'] && ! $obj->prompt_for_log) || + $argsObj->do_save)) { + if ($argsObj->do_save == 1) { + $createRev = ($argsObj->save_rev == 1); + } + + $ret = $this->reqMgr->update($argsObj->req_id, + $argsObj->req_version_id, trim($argsObj->reqDocId), + $argsObj->title, $argsObj->scope, $argsObj->user_id, + $argsObj->reqStatus, $argsObj->reqType, + $argsObj->expected_coverage, null, null, 0, $createRev, + $argsObj->log_message); + + $obj->user_feedback = $ret['msg']; + $obj->template = null; + + if ($ret['status_ok']) { + $obj->main_descr = ''; + $obj->action_descr = ''; + $obj->template = "reqView.php?refreshTree={$argsObj->refreshTree}&requirement_id={$argsObj->req_id}"; + + $this->reqMgr->values_to_db($request, $argsObj->req_version_id, + $cf_map); + + logAuditEvent( + TLS("audit_requirement_saved", $argsObj->reqDocId), "SAVE", + $argsObj->req_id, "requirements"); + + $obj->refreshTree = $argsObj->refreshTree; + } else { + // Action has failed => no change done on DB. + $old = $this->reqMgr->get_by_id($argsObj->req_id, + $argsObj->req_version_id); + $obj->main_descr = $descr_prefix . $old['title']; + $obj->cfields = $this->reqMgr->html_table_of_custom_field_values( + $argsObj->req_id, $argsObj->req_version_id, + $argsObj->tproject_id); + } + } elseif ($diff['suggest']) { + $obj->suggest_revision = true; + } + return $obj; + } + + /** + */ + public function doDelete(&$argsObj) + { + $obj = $this->initGuiBean(); + $obj->display_path = false; + $reqVersionSet = $this->reqMgr->get_by_id($argsObj->req_id); + $req = current($reqVersionSet); + + $this->reqMgr->setNotifyOn(array( + 'delete' => true + )); + $this->reqMgr->delete($argsObj->req_id, requirement_mgr::ALL_VERSIONS, + $argsObj->user_id); + + logAuditEvent(TLS("audit_requirement_deleted", $req['req_doc_id']), + "DELETE", $argsObj->req_id, "requirements"); + + $obj->template = 'show_message.tpl'; + $obj->template_dir = ''; + $obj->user_feedback = sprintf(lang_get('req_deleted'), + $req['req_doc_id'], $req['title']); + $obj->main_descr = lang_get('requirement') . TITLE_SEP . $req['title']; + $obj->title = lang_get('delete_req'); + $obj->refreshTree = 1; + $obj->result = 'ok'; // needed to enable refresh_tree logic + $obj->refreshTree = $argsObj->refreshTree; + return $obj; + } + + /** + */ + public function doUnfreezeVersion(&$argsObj) + { + $obj = $this->initGuiBean(); + $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info( + $argsObj->req_version_id); + $req_version = $this->reqMgr->get_by_id($node['parent_id'], + $argsObj->req_version_id); + $req_version = $req_version[0]; + + $this->reqMgr->updateOpen($req_version['version_id'], true); + logAuditEvent( + TLS("audit_req_version_unfrozen", $req_version['version'], + $req_version['req_doc_id'], $req_version['title']), "UNFREEZE", + $argsObj->req_version_id, "req_version"); + + $obj->template = 'show_message.tpl'; + $obj->template_dir = ''; + + $obj->user_feedback = sprintf(lang_get('req_version_unfrozen'), + $req_version['req_doc_id'], $req_version['title'], + $req_version['version']); + + $obj->main_descr = lang_get('requirement') . TITLE_SEP . + $req_version['title']; + $obj->title = lang_get('unfreeze_req'); + $obj->refreshTree = 0; + $obj->result = 'ok'; // needed to enable refresh_tree logic + return $obj; + } + + /** + */ + private function reorder(&$argsObj) + { + $obj = $this->initGuiBean(); + + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $all_reqs = $this->reqSpecMgr->get_requirements($argsObj->req_spec_id); + + $obj->template = 'reqReorder.tpl'; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_spec_name = $req_spec['title']; + $obj->all_reqs = $all_reqs; + $obj->main_descr = lang_get('req') . TITLE_SEP . $obj->req_spec_name; + + return $obj; + } + + /** + */ + public function doReorder(&$argsObj) + { + $obj = $this->initGuiBean(); + $obj->template = 'reqSpecView.tpl'; + $nodes_in_order = transform_nodes_order($argsObj->nodes_order); + + // need to remove first element, is req_spec_id + $req_spec_id = array_shift($nodes_in_order); + $this->reqMgr->set_order($nodes_in_order); + + $obj->req_spec = $this->reqSpecMgr->get_by_id($req_spec_id); + $obj->refreshTree = 1; + + return $obj; + } + + /** + */ + private function createTestCases(&$argsObj) + { + $guiObj = $this->initGuiBean(); + $guiObj->template = 'reqCreateTestCases.tpl'; + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . + $req_spec['title']; + $guiObj->action_descr = lang_get('create_testcase_from_req'); + + $guiObj->req_spec_id = $argsObj->req_spec_id; + $guiObj->req_spec_name = $req_spec['title']; + $guiObj->array_of_msg = ''; + + $guiObj->all_reqs = $this->reqSpecMgr->get_requirements( + $argsObj->req_spec_id); + + foreach ($guiObj->all_reqs as $key => $req) { + $count = count($this->reqMgr->get_coverage($req['id'])); + $guiObj->all_reqs[$key]['coverage_percent'] = round( + 100 / $guiObj->all_reqs[$key]['expected_coverage'] * $count, 2); + $guiObj->all_reqs[$key]['coverage'] = $count; + } + return $guiObj; + } + + /** + */ + public function doCreateTestCases(&$argsObj) + { + $this->initGuiBean(); + $this->createTestCases($argsObj); + $msg = $this->reqMgr->create_tc_from_requirement($argsObj->arrReqIds, + $argsObj->req_spec_id, $argsObj->user_id, $argsObj->tproject_id, + $argsObj->testcase_count); + // need to update results + $guiObj = $this->createTestCases($argsObj); + $guiObj->array_of_msg = $msg; + return $guiObj; + } + + /** + */ + public function copy(&$argsObj) + { + $obj = $this->initGuiBean(); + $reqVersionSet = $this->reqMgr->get_by_id($argsObj->req_id); + $req = current($reqVersionSet); + + $obj->items = array( + $req + ); + $obj->main_descr = lang_get('req') . TITLE_SEP . $req['title']; + $obj->action_descr = lang_get('copy_one_req'); + $obj->template = 'reqCopy.tpl'; + $obj->containers = null; + $obj->page2call = 'lib/requirements/reqEdit.php'; + $obj->array_of_msg = ''; + $obj->doActionButton = 'doCopy'; + $obj->req_spec_id = $argsObj->req_spec_id; + + $exclude_node_types = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me', + 'requirement_spec_revision' => 'exclude_me' + ); + + $my['filters'] = array( + 'exclude_node_types' => $exclude_node_types + ); + $my['options']['order_cfg']['type'] = $my['options']['output'] = 'rspec'; + $subtree = $this->reqMgr->tree_mgr->get_subtree($argsObj->tproject_id, + $my['filters'], $my['options']); + if (count($subtree)) { + $obj->containers = $this->reqMgr->tree_mgr->createHierarchyMap( + $subtree, 'dotted', + array( + 'field' => 'doc_id', + 'format' => '%s:' + )); + } + return $obj; + } + + /** + */ + public function doCopy(&$argsObj) + { + $this->initGuiBean(); + + $this->reqSpecMgr->get_by_id($argsObj->containerID); + $itemID = current($argsObj->itemSet); + $argsObj->req_id = $itemID; + $obj = $this->copy($argsObj); + $obj->req = null; + $obj->req_spec_id = $argsObj->req_spec_id; + + $copyOptions = array( + 'copy_also' => array( + 'testcase_assignment' => $argsObj->copy_testcase_assignment + ) + ); + + $ret = $this->reqMgr->copy_to($itemID, $argsObj->containerID, + $argsObj->user_id, $argsObj->tproject_id, $copyOptions); + $obj->user_feedback = $ret['msg']; + $obj->array_of_msg = ''; + + if ($ret['status_ok']) { + $new_req_version_set = $this->reqMgr->get_by_id($ret['id']); + $new_req = current($new_req_version_set); + + $source_req_version_set = $this->reqMgr->get_by_id($itemID); + $source_req = current($source_req_version_set); + $logMsg = TLS("audit_requirement_copy", $new_req['req_doc_id'], + $source_req['req_doc_id']); + logAuditEvent($logMsg, "COPY", $ret['id'], "requirements"); + + $obj->user_feedback = sprintf(lang_get('req_created'), + $new_req['req_doc_id'], $new_req['title']); + $obj->template = 'reqCopy.tpl'; + $obj->req_id = $ret['id']; + $obj->array_of_msg = array( + $logMsg + ); + $obj->refreshTree = $argsObj->refreshTree; + } + return $obj; + } + + /** + * doCreateVersion + */ + public function doCreateVersion(&$argsObj) + { + $freezeSourceVersion = $this->reqCfg->freezeREQVersionOnNewREQVersion; + + $opt = array( + 'reqVersionID' => $argsObj->req_version_id, + 'log_msg' => $argsObj->log_message, + 'notify' => true, + 'freezeSourceVersion' => $freezeSourceVersion + ); + + $ret = $this->reqMgr->create_new_version($argsObj->req_id, + $argsObj->user_id, $opt); + $obj = $this->initGuiBean(); + $obj->user_feedback = $ret['msg']; + $obj->template = "reqView.php?requirement_id={$argsObj->req_id}"; + $obj->req = null; + $obj->req_id = $argsObj->req_id; + return $obj; + } + + /** + */ + public function doDeleteVersion(&$argsObj) + { + $obj = $this->initGuiBean(); + $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info( + $argsObj->req_version_id); + $req_version = $this->reqMgr->get_by_id($node['parent_id'], + $argsObj->req_version_id); + $req_version = $req_version[0]; + + $this->reqMgr->setNotifyOn(array( + 'delete' => true + )); + + $this->reqMgr->delete($node['parent_id'], $argsObj->req_version_id, + $argsObj->user_id); + + logAuditEvent( + TLS("audit_req_version_deleted", $req_version['version'], + $req_version['req_doc_id'], $req_version['title']), "DELETE", + $argsObj->req_version_id, "req_version"); + + $obj->template = 'show_message.tpl'; + $obj->template_dir = ''; + + $obj->user_feedback = sprintf(lang_get('req_version_deleted'), + $req_version['req_doc_id'], $req_version['title'], + $req_version['version']); + + $obj->main_descr = lang_get('requirement') . TITLE_SEP . + $req_version['title']; + $obj->title = lang_get('delete_req'); + $obj->refreshTree = 0; + $obj->result = 'ok'; // needed to enable refresh_tree logic + return $obj; + } + + /** + * Add a relation from one requirement to another. + * + * @param stdClass $argsObj + * input parameters + * @return stdClass $obj + */ + public function doAddRelation($argsObj) + { + $op = array( + 'ok' => true, + 'msg' => lang_get('new_rel_add_success') + ); + $own_id = $argsObj->relation_source_req_id; + $authorID = $argsObj->user_id; + $tproject_id = $argsObj->tproject_id; + + if (isset($argsObj->relation_destination_testproject_id)) { + // relation destination belongs to another project + $tproject_id = $argsObj->relation_destination_testproject_id; + } + + $other_req = $this->reqMgr->getByDocID( + $argsObj->relation_destination_req_doc_id, $tproject_id); + if (empty($other_req)) { + // req doc ID was not ok + $op['ok'] = false; + $op['msg'] = lang_get('rel_add_error_dest_id'); + } + + if ($op['ok']) { + // are all the IDs we have ok? + $other_req = current($other_req); + + $other_id = $other_req['id']; + $source_id = $own_id; + $destination_id = $other_id; + $relTypeID = (int) current((explode('_', $argsObj->relation_type))); + if (strpos($argsObj->relation_type, "_destination")) { + $source_id = $other_id; + $destination_id = $own_id; + } + + if (! is_numeric($authorID) || ! is_numeric($source_id) || + ! is_numeric($destination_id)) { + $op['ok'] = false; + $op['msg'] = lang_get('rel_add_error'); + } + + if ($op['ok'] && ($source_id == $destination_id)) { + $op['ok'] = false; + $op['msg'] = lang_get('rel_add_error_self'); + } + } + + if ($op['ok']) { + $exists = $this->reqMgr->check_if_relation_exists($source_id, + $destination_id, $relTypeID); + if ($exists) { + $op['ok'] = false; + $op['msg'] = sprintf(lang_get('rel_add_error_exists_already'), + $this->reqRelationTypeDescr[$relTypeID]); + } + $dest_last_version_info = $this->reqMgr->getLastVersionInfo( + $destination_id); + if (! $dest_last_version_info['is_open']) { + $op['ok'] = false; + $op['msg'] = sprintf(lang_get('rel_add_error_dest_frozen')); + } + } + + if ($op['ok']) { + $this->reqMgr->add_relation($source_id, $destination_id, $relTypeID, + $authorID); + } + + $obj = $this->initGuiBean(); + $op['msg'] = ($op['ok'] ? '
    ' : '
    ') . + $op['msg'] . '
    '; + $obj->template = "reqView.php?requirement_id={$own_id}&relation_add_result_msg=" . + $op['msg']; + + return $obj; + } + + /** + * delete a relation to another requirement + * + * @author Andreas Simon + * + * @param stdClass $argsObj + * user input data + * + * @return stdClass $object data for template to display + */ + public function doDeleteRelation($argsObj) + { + $ok_msg = '
    ' . lang_get('delete_rel_success') . + '
    '; + $op = array( + 'ok' => true, + 'msg' => $ok_msg + ); + + $relation_id = $argsObj->relation_id; + $requirement_id = $argsObj->requirement_id; + + if (is_null($relation_id) || ! is_numeric($relation_id) || + is_null($requirement_id) || ! is_numeric($requirement_id)) { + $op['ok'] = false; + $op['msg'] = '
    ' . lang_get('error_deleting_rel') . + '
    '; + } + + if ($op['ok']) { + $this->reqMgr->delete_relation($relation_id); + } + + $obj = $this->initGuiBean(); + $obj->template = "reqView.php?requirement_id=$requirement_id&relation_add_result_msg=" . + $op['msg']; + + return $obj; + } + + /* + * function: doCreateRevision + * + * args: + * + * returns: + * + * @internal revisions + * + */ + public function doCreateRevision(&$argsObj) + { + $req = $this->reqMgr->get_by_id($argsObj->req_id, + $argsObj->req_version_id); + $req = $req[0]; + $ret = $this->reqMgr->create_new_revision($argsObj->req_version_id, + $argsObj->user_id, $argsObj->tproject_id, $req, + $argsObj->log_message); + + $obj = $this->initGuiBean(); + $obj->user_feedback = $ret['msg']; + $obj->template = "reqView.php?requirement_id={$argsObj->req_id}"; + $obj->req = null; + $obj->req_id = $argsObj->req_id; + return $obj; + } + + /** + */ + private function simpleCompare($old, $new, $oldCF, $newCF) + { + $suggest_revision = array( + 'scope' => 'scope' + ); + + $force_revision = array( + 'status' => 'reqStatus', + 'type' => 'reqType', + 'expected_coverage' => 'expected_coverage', + 'req_doc_id' => 'reqDocId', + 'title' => 'title' + ); + + $ret = array( + 'force' => false, + 'suggest' => false, + 'nochange' => false, + 'changeon' => null + ); + foreach ($force_revision as $access_key => $access_prop) { + if ($ret['force'] = ($old[$access_key] != $new->$access_prop)) { + $ret['changeon'] = 'attribute:' . $access_key; + break; + } + } + + if (! $ret['force'] && ! is_null($newCF)) { + foreach ($newCF as $cf_key => $cf) { + if ($ret['force'] = ($oldCF[$cf_key]['value'] != $cf['cf_value'])) { + $ret['changeon'] = 'custom field:' . $oldCF[$cf_key]['name']; + break; + } + } + } + + if (! $ret['force']) { + + foreach ($suggest_revision as $access_key => $access_prop) { + if ($ret['suggest'] = ($old[$access_key] != $new->$access_prop)) { + $ret['changeon'] = 'attribute:' . $access_key; + break; + } + } + } + $ret['nochange'] = (! $ret['force'] && ! $ret['suggest']); + return $ret; + } + + /** + */ + public function doFreezeVersion(&$argsObj) + { + $obj = $this->initGuiBean(); + $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info( + $argsObj->req_version_id); + $req_version = $this->reqMgr->get_by_id($node['parent_id'], + $argsObj->req_version_id); + $req_version = $req_version[0]; + + $this->reqMgr->updateOpen($req_version['version_id'], false); + + // BUGID 3312 + logAuditEvent( + TLS("audit_req_version_frozen", $req_version['version'], + $req_version['req_doc_id'], $req_version['title']), "FREEZE", + $argsObj->req_version_id, "req_version"); + + $obj->template = 'show_message.tpl'; + $obj->template_dir = ''; + + $obj->user_feedback = sprintf(lang_get('req_version_frozen'), + $req_version['req_doc_id'], $req_version['title'], + $req_version['version']); + + $obj->main_descr = lang_get('requirement') . TITLE_SEP . + $req_version['title']; + $obj->title = lang_get('freeze_req'); + $obj->refreshTree = 0; + $obj->result = 'ok'; // needed to enable refresh_tree logic + return $obj; + } + + /** + */ + public function addTestCase(&$argsObj) + { + $obj = $this->initGuiBean(); + $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info( + $argsObj->req_version_id); + $dummy = $this->reqMgr->get_by_id($node['parent_id'], + $argsObj->req_version_id); + $req_version = $dummy[0]; + + $obj->req = $req_version; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_version_id = $argsObj->req_version_id; + $obj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; + + // Analise test case identity + $tcaseCfg = config_get('testcase_cfg'); + + $status_ok = false; + $msg = sprintf(lang_get('provide_full_external_tcase_id'), + $argsObj->tcasePrefix, $tcaseCfg->glue_character); + $gluePos = strrpos($argsObj->tcaseIdentity, $tcaseCfg->glue_character); + + $isFullExternal = ($gluePos !== false); + if ($isFullExternal) { + $status_ok = true; + $rawTestCasePrefix = substr($argsObj->tcaseIdentity, 0, $gluePos); + + $status_ok = (strcmp($rawTestCasePrefix, $argsObj->tcasePrefix) == 0); + if (! $status_ok) { + $msg = sprintf(lang_get('seems_to_belong_to_other_tproject'), + $rawTestCasePrefix, $argsObj->tcasePrefix); + } + } + + if ($status_ok) { + // IMPORTANT NOTICE: audit info is managed on reqMgr method + $alienMgr = new testcase($this->db); + $tcase_id = $alienMgr->getInternalID($argsObj->tcaseIdentity, + array( + 'tproject_id' => $argsObj->tproject_id + )); + + // Design Choice + // 1. Only latest test case version will be added + // 2. Only if not executed + if ($tcase_id > 0) { + $doLink = true; + if ($tcaseCfg->reqLinkingDisabledAfterExec) { + if ($alienMgr->latestVersionHasBeenExecuted($tcase_id) == 0) { + $doLink = true; + } else { + $doLink = false; + $status_ok = false; + $msg = sprintf( + lang_get( + 'cannot_link_latest_version_reason_has_been_exec'), + $argsObj->tcaseIdentity); + } + } + if ($doLink) { + $this->reqMgr->assign_to_tcase($argsObj->req_id, $tcase_id, + intval($argsObj->user_id)); + } + } else { + $status_ok = false; + $msg = sprintf(lang_get('tcase_doesnot_exist'), + $argsObj->tcaseIdentity); + } + } + + if (! $status_ok) { + $obj->user_feedback = $msg; + $obj->template .= "&user_feedback=" . urlencode($obj->user_feedback); + } + + return $obj; + } + + /** + */ + public function removeTestCase(&$argsObj) + { + // IMPORTANT NOTICE: audit info is managed on reqMgr method + $obj = $this->initGuiBean(); + $bond = array( + 'req' => $argsObj->req_version_id, + 'tc' => $argsObj->tcaseIdentity + ); + + $this->reqMgr->delReqVersionTCVersionLink($bond, __METHOD__); + + $node = $this->reqMgr->tree_mgr->get_node_hierarchy_info( + $argsObj->req_version_id); + $dummy = $this->reqMgr->get_by_id($node['parent_id'], + $argsObj->req_version_id); + $req_version = $dummy[0]; + + $obj->req = $req_version; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_version_id = $argsObj->req_version_id; + $obj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; + return $obj; + } + + /** + */ + public function fileUpload(&$argsObj) + { + $argsObj->uploadOp = fileUploadManagement($this->db, + $argsObj->req_version_id, $argsObj->fileTitle, + $this->reqMgr->getAttachmentTableName()); + + return $this->initGuiObjForAttachmentOperations($argsObj); + } + + /** + */ + public function deleteFile(&$argsObj) + { + $fileInfo = deleteAttachment($this->db, $argsObj->file_id, false); + if ($argsObj->req_version_id == 0) { + $argsObj->req_version_id = $fileInfo['fk_id']; + } + + return $this->initGuiObjForAttachmentOperations($argsObj); + } + + /** + */ + private function initGuiObjForAttachmentOperations($argsObj) + { + $guiObj = new stdClass(); + $guiObj->reqHasBeenDeleted = false; + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->req_id = $argsObj->req_id; + $guiObj->suggest_revision = $guiObj->prompt_for_log = false; + $guiObj->template = "reqView.php?refreshTree=0&requirement_id={$argsObj->req_id}"; + $guiObj->uploadOp = $argsObj->uploadOp; + + return $guiObj; + } + + /** + */ + public function stopMonitoring(&$argsObj) + { + $this->reqMgr->monitorOff($argsObj->req_id, $argsObj->user_id, + $argsObj->tproject_id); + + return $this->initGuiObjForAttachmentOperations($argsObj); + } + + /** + */ + public function startMonitoring(&$argsObj) + { + $this->reqMgr->monitorOn($argsObj->req_id, $argsObj->user_id, + $argsObj->tproject_id); + + return $this->initGuiObjForAttachmentOperations($argsObj); + } +} diff --git a/lib/requirements/reqCompareVersions.php b/lib/requirements/reqCompareVersions.php index 88ec0d8be3..126ad86da5 100644 --- a/lib/requirements/reqCompareVersions.php +++ b/lib/requirements/reqCompareVersions.php @@ -1,344 +1,356 @@ - null,"no_changes" => null, - "diff_subtitle_req" => null, "version_short" => null, - "diff_details_req" => null,"type" => null, "status" => null, - "expected_coverage" => null, - "revision_short" => null, "version_revision" => null) ); - - - -$reqMgr = new requirement_mgr($db); -$differ = new diff(); -$args = init_args(); -$gui = initializeGui($db,$args,$labels,$reqMgr); - - -// if already two versions are selected, display diff -// else display template with versions to select -if ($args->compare_selected_versions) -{ - // Side By Side - $sbs = getItemsToCompare($args->left_item_id,$args->right_item_id,$gui->items); - prepareUserFeedback($db,$gui,$args->req_id,$labels,$sbs); - - $gui->attrDiff = getAttrDiff($sbs['left_item'],$sbs['right_item'],$labels); - - $cfields = getCFToCompare($sbs,$args->tproject_id,$reqMgr); - $gui->cfieldsDiff = null; - if( !is_null($cfields) ) - { - $gui->cfieldsDiff = getCFDiff($cfields,$reqMgr); - } - - $gui->diff = array("scope" => array()); - foreach($gui->diff as $key => $val) - { - if ($args->use_daisydiff) - { - // using daisydiff as diffing engine - $diff = new HTMLDiffer(); - if ($gui->reqType == 'none'){ - list($differences, $diffcount) = $diff->htmlDiff(nl2br($sbs['left_item'][$key]), nl2br($sbs['right_item'][$key])); - } - else{ - list($differences, $diffcount) = $diff->htmlDiff($sbs['left_item'][$key], $sbs['right_item'][$key]); - } - $gui->diff[$key]["diff"] = $differences; - $gui->diff[$key]["count"] = $diffcount; - } - else - { - // insert line endings so diff is better readable and makes sense (not everything in one line) - // then cast to array with \n as separating character, differ needs that - $gui->diff[$key]["left"] = explode("\n", str_replace("

    ", "

    \n", $sbs['left_item'][$key])); - $gui->diff[$key]["right"] = explode("\n", str_replace("

    ", "

    \n", $sbs['right_item'][$key])); - $gui->diff[$key]["diff"] = $differ->inline($gui->diff[$key]["left"], $gui->leftID, - $gui->diff[$key]["right"], $gui->rightID,$args->context); - $gui->diff[$key]["count"] = count($differ->changes); - } - - $gui->diff[$key]["heading"] = lang_get($key); - - // are there any changes? then display! if not, nothing to show here - $additional = ''; - $msg_key = "no_changes"; - if ($gui->diff[$key]["count"] > 0) - { - $msg_key = "num_changes"; - $additional = $gui->diff[$key]["count"]; - } - $gui->diff[$key]["message"] = (sprintf($labels[$msg_key], $key, $additional)); - } + null, + "no_changes" => null, + "diff_subtitle_req" => null, + "version_short" => null, + "diff_details_req" => null, + "type" => null, + "status" => null, + "expected_coverage" => null, + "revision_short" => null, + "version_revision" => null + )); + +$reqMgr = new requirement_mgr($db); +$differ = new diff(); +$args = initArgs(); +$gui = initializeGui($db, $args, $labels, $reqMgr); + +// if already two versions are selected, display diff +// else display template with versions to select +if ($args->compare_selected_versions) { + // Side By Side + $sbs = getItemsToCompare($args->left_item_id, $args->right_item_id, + $gui->items); + prepareUserFeedback($db, $gui, $args->req_id, $labels, $sbs); + + $gui->attrDiff = getAttrDiff($sbs['left_item'], $sbs['right_item'], $labels); + + $cfields = getCFToCompare($sbs, $args->tproject_id, $reqMgr); + $gui->cfieldsDiff = null; + if (! is_null($cfields)) { + $gui->cfieldsDiff = getCFDiff($cfields, $reqMgr); + } + + $gui->diff = array( + "scope" => array() + ); + foreach ($gui->diff as $key => $val) { + if ($args->use_daisydiff) { + // using daisydiff as diffing engine + $diff = new HTMLDiffer(); + if ($gui->reqType == 'none') { + list ($differences, $diffcount) = $diff->htmlDiff( + nl2br($sbs['left_item'][$key]), + nl2br($sbs['right_item'][$key])); + } else { + list ($differences, $diffcount) = $diff->htmlDiff( + $sbs['left_item'][$key], $sbs['right_item'][$key]); + } + $gui->diff[$key]["diff"] = $differences; + $gui->diff[$key]["count"] = $diffcount; + } else { + // insert line endings so diff is better readable and makes sense (not everything in one line) + // then cast to array with \n as separating character, differ needs that + $gui->diff[$key]["left"] = explode("\n", + str_replace("

    ", "

    \n", $sbs['left_item'][$key])); + $gui->diff[$key]["right"] = explode("\n", + str_replace("

    ", "

    \n", $sbs['right_item'][$key])); + $gui->diff[$key]["diff"] = $differ->inline($gui->diff[$key]["left"], + $gui->leftID, $gui->diff[$key]["right"], $gui->rightID, + $args->context); + $gui->diff[$key]["count"] = count($differ->changes); + } + + $gui->diff[$key]["heading"] = lang_get($key); + + // are there any changes? then display! if not, nothing to show here + $additional = ''; + $msg_key = "no_changes"; + if ($gui->diff[$key]["count"] > 0) { + $msg_key = "num_changes"; + $additional = $gui->diff[$key]["count"]; + } + $gui->diff[$key]["message"] = (sprintf($labels[$msg_key], $key, + $additional)); + } +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function getBareBonesReq($dbHandler, $reqID) +{ + $debugMsg = ' Function: ' . __FUNCTION__; + $tables = tlObjectWithDB::getDBTables( + array( + 'requirements', + 'nodes_hierarchy' + )); + $sql = " /* $debugMsg */ SELECT REQ.req_doc_id, NH_REQ.name " . + " FROM {$tables['requirements']} REQ " . + " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . + " WHERE REQ.id = " . intval($reqID); + + $bones = $dbHandler->get_recordset($sql); + + return $bones[0]; +} + +/** + */ +function getItemsToCompare($leftSideID, $rightSideID, &$itemSet) +{ + $ret = array(); + foreach ($itemSet as $item) { + if ($item['item_id'] == $leftSideID) { + $ret['left_item'] = $item; + } + if ($item['item_id'] == $rightSideID) { + $ret['right_item'] = $item; + } + + if (count($ret) == 2) { + break; + } + } + return $ret; +} + +/** + */ +function getCFToCompare($sides, $tprojectID, &$reqMgr) +{ + $cfields = array( + 'left_side' => array( + 'key' => 'left_item', + 'value' => null + ), + 'right_side' => array( + 'key' => 'right_item', + 'value' => null + ) + ); + + foreach ($cfields as $item_side => $dummy) { + $target_id = $sides[$dummy['key']]; + $target_id = $target_id['item_id']; + $cfields[$item_side]['value'] = $reqMgr->get_linked_cfields(null, + $target_id, $tprojectID); + } + return $cfields; +} + +/** + */ +function getCFDiff($cfields, &$reqMgr) +{ + $cmp = null; + + // Development Note + // All versions + revisions (i.e. child items) have the same qty of linked CF + // => both arrays will have same size() + // + // This is because to get cfields we look only to CF enabled for node type. + $cfieldsLeft = $cfields['left_side']['value']; + $cfieldsRight = $cfields['right_side']['value']; + + if (! is_null($cfieldsLeft)) { + $key2loop = array_keys($cfieldsLeft); + $cmp = array(); + $type_code = $reqMgr->cfield_mgr->get_available_types(); + $key2convert = array( + 'lvalue', + 'rvalue' + ); + + $cfg = config_get('gui'); + $cfCfg = config_get('custom_fields'); + + $formats = array( + 'date' => config_get('date_format') + ); + $t_date_format = str_replace("%", "", $formats['date']); // must remove % + $t_datetime_format = $t_date_format . ' ' . + $cfg->custom_fields->time_format; + + foreach ($key2loop as $cf_key) { + $dt_format = $t_date_format; + + // $cfg->show_custom_fields_without_value + // false => At least one value has to be <> NULL to include on comparsion results + if ($cfCfg->show_custom_fields_without_value || + (! $cfCfg->show_custom_fields_without_value && + ((! is_null($cfieldsRight) && + ! is_null($cfieldsRight[$cf_key]['value'])) || + (! is_null($cfieldsLeft) && + ! is_null($cfieldsLeft[$cf_key]['value']))))) { + $cmp[$cf_key] = array( + 'label' => htmlspecialchars($cfieldsLeft[$cf_key]['label']), + 'lvalue' => $cfieldsLeft[$cf_key]['value'], + 'rvalue' => ! is_null($cfieldsRight) ? $cfieldsRight[$cf_key]['value'] : null, + 'changed' => $cfieldsLeft[$cf_key]['value'] != + $cfieldsRight[$cf_key]['value'] + ); + + if ($type_code[$cfieldsLeft[$cf_key]['type']] == 'date' || + $type_code[$cfieldsLeft[$cf_key]['type']] == 'datetime') { + foreach ($key2convert as $fx) { + if ($doIt = ($cmp[$cf_key][$fx] != null)) { + switch ($type_code[$cfieldsLeft[$cf_key]['type']]) { + case 'datetime': + $dt_format = $t_datetime_format; + break; + } + } + if ($doIt) { + $cmp[$cf_key][$fx] = date($dt_format, + $cmp[$cf_key][$fx]); + } + } + } + } + } + } + + return (null != $cmp && ! empty($cmp)) ? $cmp : null; +} + +/** + */ +function initArgs() +{ + $args = new stdClass(); + + $args->req_id = isset($_REQUEST['requirement_id']) ? intval( + $_REQUEST['requirement_id']) : 0; + + $args->compare_selected_versions = isset( + $_REQUEST['compare_selected_versions']); + $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval( + $_REQUEST['left_item_id']) : - 1; + $args->right_item_id = isset($_REQUEST['right_item_id']) ? intval( + $_REQUEST['right_item_id']) : - 1; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + + $args->use_daisydiff = isset($_REQUEST['use_html_comp']); + + $diffEngineCfg = config_get("diffEngine"); + $args->context = null; + if (! isset($_REQUEST['context_show_all'])) { + $args->context = (isset($_REQUEST['context']) && + is_numeric($_REQUEST['context'])) ? $_REQUEST['context'] : $diffEngineCfg->context; + } + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, $lbl, &$reqMgr) +{ + $reqCfg = config_get('req_cfg'); + $guiObj = new stdClass(); + $guiObj->items = $reqMgr->get_history($argsObj->req_id, + array( + 'output' => 'array', + 'decode_user' => true + )); + + // Truncate log message + if ($reqCfg->log_message_len > 0) { + $loop2do = count($guiObj->items); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if (strlen($guiObj->items[$idx]['log_message']) > + $reqCfg->log_message_len) { + $guiObj->items[$idx]['log_message'] = substr( + $guiObj->items[$idx]['log_message'], 0, + $reqCfg->log_message_len) . '...'; + } + $guiObj->items[$idx]['log_message'] = htmlspecialchars( + $guiObj->items[$idx]['log_message']); + } + } + $guiObj->req_id = $argsObj->req_id; + $guiObj->compare_selected_versions = $argsObj->compare_selected_versions; + $guiObj->context = $argsObj->context; + $guiObj->version_short = $lbl['version_short']; + $guiObj->diff = null; + $reqCfg = getWebEditorCfg('requirement'); + $guiObj->reqType = $reqCfg['type']; + + return $guiObj; +} + +/** + */ +function prepareUserFeedback(&$dbHandler, &$guiObj, $reqID, $labels, $sbs) +{ + $guiObj->leftID = sprintf($labels['version_revision'], + $sbs['left_item']['version'], $sbs['left_item']['revision']); + $guiObj->rightID = sprintf($labels['version_revision'], + $sbs['right_item']['version'], $sbs['right_item']['revision']); + $mini_me = getBareBonesReq($dbHandler, $reqID); + $guiObj->subtitle = sprintf($labels['diff_details_req'], + $sbs['left_item']['version'], $sbs['left_item']['revision'], + $sbs['left_item']['version'], $sbs['left_item']['revision'], + $sbs['right_item']['version'], $sbs['right_item']['revision'], + $sbs['right_item']['version'], $sbs['right_item']['revision'], + $mini_me['req_doc_id'] . config_get('gui_title_separator_1') . + $mini_me['name']); +} + +/** + */ +function getAttrDiff($leftSide, $rightSide, $labels) +{ + $req_cfg = config_get('req_cfg'); + $key2loop = array( + 'status' => 'status_labels', + 'type' => 'type_labels', + 'expected_coverage' => null + ); + foreach ($key2loop as $fkey => $lkey) { + // Need to decode + $cmp[$fkey] = array( + 'label' => htmlspecialchars($labels[$fkey]), + 'lvalue' => $leftSide[$fkey], + 'rvalue' => $rightSide[$fkey], + 'changed' => $leftSide[$fkey] != $rightSide[$fkey] + ); + + if (! is_null($lkey)) { + $decode = $req_cfg->$lkey; + + $cmp[$fkey]['lvalue'] = lang_get($decode[$cmp[$fkey]['lvalue']]); + $cmp[$fkey]['rvalue'] = lang_get($decode[$cmp[$fkey]['rvalue']]); + } + } + return $cmp; } - -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function getBareBonesReq($dbHandler,$reqID) -{ - $debugMsg = ' Function: ' . __FUNCTION__; - $tables = tlObjectWithDB::getDBTables(array('requirements','nodes_hierarchy')); - $sql = " /* $debugMsg */ SELECT REQ.req_doc_id, NH_REQ.name " . - " FROM {$tables['requirements']} REQ " . - " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id = REQ.id " . - " WHERE REQ.id = " . intval($reqID); - - $bones = $dbHandler->get_recordset($sql); - - return $bones[0]; -} - -/** - * - * - */ -function getItemsToCompare($leftSideID,$rightSideID,&$itemSet) -{ - - $ret = array(); - foreach($itemSet as $item) - { - if ($item['item_id'] == $leftSideID) - { - $ret['left_item'] = $item; - } - if ($item['item_id'] == $rightSideID) - { - $ret['right_item'] = $item; - } - - if( count($ret) == 2 ) - { - break; - } - } - return $ret; -} - - -/** - * - * - */ -function getCFToCompare($sides,$tprojectID,&$reqMgr) -{ - $cfields = array('left_side' => array('key' => 'left_item', 'value' => null), - 'right_side' => array('key' => 'right_item', 'value' => null)); - - foreach($cfields as $item_side => $dummy) - { - $target_id = $sides[$dummy['key']]; - $target_id = $target_id['item_id']; - $cfields[$item_side]['value'] = $reqMgr->get_linked_cfields(null,$target_id,$tprojectID); - } - return $cfields; -} - - -/** - * - */ -function getCFDiff($cfields,&$reqMgr) -{ - $cmp = null; - - // Development Note - // All versions + revisions (i.e. child items) have the same qty of linked CF - // => both arrays will have same size() - // - // This is because to get cfields we look only to CF enabled for node type. - $cfieldsLeft = $cfields['left_side']['value']; - $cfieldsRight = $cfields['right_side']['value']; - - if( !is_null($cfieldsLeft) ) - { - $key2loop = array_keys($cfieldsLeft); - $cmp = array(); - $type_code = $reqMgr->cfield_mgr->get_available_types(); - $key2convert = array('lvalue','rvalue'); - - - $cfg = config_get('gui'); - $cfCfg = config_get('custom_fields'); - - $formats = array('date' => config_get( 'date_format')); - $t_date_format = str_replace("%","",$formats['date']); // must remove % - $t_datetime_format = $t_date_format . ' ' . $cfg->custom_fields->time_format; - - foreach($key2loop as $cf_key) - { - $dt_format = $t_date_format; - - // $cfg->show_custom_fields_without_value - // false => At least one value has to be <> NULL to include on comparsion results - // - if( $cfCfg->show_custom_fields_without_value == true || - ($cfCfg->show_custom_fields_without_value == false && - ( (!is_null($cfieldsRight) && !is_null($cfieldsRight[$cf_key]['value'])) || - (!is_null($cfieldsLeft) && !is_null($cfieldsLeft[$cf_key]['value'])) ) - ) - ) - { - $cmp[$cf_key] = array('label' => htmlspecialchars($cfieldsLeft[$cf_key]['label']), - 'lvalue' => $cfieldsLeft[$cf_key]['value'], - 'rvalue' => !is_null($cfieldsRight) ? $cfieldsRight[$cf_key]['value'] : null, - 'changed' => $cfieldsLeft[$cf_key]['value'] != $cfieldsRight[$cf_key]['value']); - - if($type_code[$cfieldsLeft[$cf_key]['type']] == 'date' || - $type_code[$cfieldsLeft[$cf_key]['type']] == 'datetime') - { - foreach($key2convert as $fx) - { - if( ($doIt = ($cmp[$cf_key][$fx] != null)) ) - { - switch($type_code[$cfieldsLeft[$cf_key]['type']]) - { - case 'datetime': - $dt_format = $t_datetime_format; - break ; - } - } - if( $doIt ) - { - $cmp[$cf_key][$fx] = date($dt_format,$cmp[$cf_key][$fx]); - } - } - } - } // mega if - } // foraeach - } - - return (null != $cmp && count($cmp) > 0) ? $cmp : null; -} - - - -/** - * - * - */ -function init_args() { - $args = new stdClass(); - - $args->req_id = isset($_REQUEST['requirement_id']) ? intval($_REQUEST['requirement_id']) : 0; - - $args->compare_selected_versions = isset($_REQUEST['compare_selected_versions']); - $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval($_REQUEST['left_item_id']) : -1; - $args->right_item_id = isset($_REQUEST['right_item_id']) ? intval($_REQUEST['right_item_id']) : -1; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - - $args->use_daisydiff = isset($_REQUEST['use_html_comp']); - - $diffEngineCfg = config_get("diffEngine"); - $args->context = null; - if( !isset($_REQUEST['context_show_all'])) { - $args->context = (isset($_REQUEST['context']) && is_numeric($_REQUEST['context'])) ? $_REQUEST['context'] : $diffEngineCfg->context; - } - - return $args; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$lbl,&$reqMgr) -{ - $reqCfg = config_get('req_cfg'); - $guiObj = new stdClass(); - $guiObj->items = $reqMgr->get_history($argsObj->req_id,array('output' => 'array','decode_user' => true)); - - - // Truncate log message - if( $reqCfg->log_message_len > 0 ) - { - $loop2do = count($guiObj->items); - for($idx=0; $idx < $loop2do; $idx++) - { - if( strlen($guiObj->items[$idx]['log_message']) > $reqCfg->log_message_len ) - { - $guiObj->items[$idx]['log_message'] = substr($guiObj->items[$idx]['log_message'],0,$reqCfg->log_message_len) . '...'; - } - $guiObj->items[$idx]['log_message'] = htmlspecialchars($guiObj->items[$idx]['log_message']); - } - } - $guiObj->req_id = $argsObj->req_id; - $guiObj->compare_selected_versions = $argsObj->compare_selected_versions; - $guiObj->context = $argsObj->context; - $guiObj->version_short = $lbl['version_short']; - $guiObj->diff = null; - $reqCfg = getWebEditorCfg('requirement'); - $guiObj->reqType = $reqCfg['type']; - - return $guiObj; -} - -/** - * - * - */ -function prepareUserFeedback(&$dbHandler,&$guiObj,$reqID,$labels,$sbs) -{ - $guiObj->leftID = sprintf($labels['version_revision'],$sbs['left_item']['version'],$sbs['left_item']['revision']); - $guiObj->rightID = sprintf($labels['version_revision'],$sbs['right_item']['version'],$sbs['right_item']['revision']); - $mini_me = getBareBonesReq($dbHandler,$reqID); - $guiObj->subtitle = sprintf($labels['diff_details_req'], - $sbs['left_item']['version'],$sbs['left_item']['revision'], - $sbs['left_item']['version'],$sbs['left_item']['revision'], - $sbs['right_item']['version'],$sbs['right_item']['revision'], - $sbs['right_item']['version'],$sbs['right_item']['revision'], - $mini_me['req_doc_id'] . config_get('gui_title_separator_1') . $mini_me['name']); -} - -/** - * - * - */ -function getAttrDiff($leftSide,$rightSide,$labels) -{ - $req_cfg = config_get('req_cfg'); - $key2loop = array('status' => 'status_labels','type' => 'type_labels','expected_coverage' => null); - foreach($key2loop as $fkey => $lkey) - { - // Need to decode - $cmp[$fkey] = array('label' => htmlspecialchars($labels[$fkey]), - 'lvalue' => $leftSide[$fkey],'rvalue' => $rightSide[$fkey], - 'changed' => $leftSide[$fkey] != $rightSide[$fkey]); - - if( !is_null($lkey) ) - { - $decode = $req_cfg->$lkey; - - $cmp[$fkey]['lvalue'] = lang_get($decode[$cmp[$fkey]['lvalue']]); - $cmp[$fkey]['rvalue'] = lang_get($decode[$cmp[$fkey]['rvalue']]); - } - } - return $cmp; -} \ No newline at end of file diff --git a/lib/requirements/reqCreateFromIssueMantisXML.php b/lib/requirements/reqCreateFromIssueMantisXML.php index 329cb181eb..e5732db3c2 100644 --- a/lib/requirements/reqCreateFromIssueMantisXML.php +++ b/lib/requirements/reqCreateFromIssueMantisXML.php @@ -1,268 +1,270 @@ - - * - * - * 21 - * testlink-test - * administrator - * normal - * minor - * have not tried - * new - * open - * none - * FromTestLink - * 1365184242 - * 1365184242 - * none - * V1 - * public - * ISSUE-V1 - * 1 - * ISSUE-V1 - * - * - * 20 - * testlink-test - * - * @internal revisions - * @since 1.9.10 - * - */ -require('../../config.inc.php'); -require_once('common.php'); -require_once('xml.inc.php'); - -testlinkInitPage($db,false,false,"checkRights"); -$templateCfg = templateConfiguration(); -$req_spec_mgr = new requirement_spec_mgr($db); -$req_mgr = new requirement_mgr($db); -$args = init_args(); -$gui = initializeGui($db,$args); - -new dBug($args); -new dBug($gui); - -switch($args->doAction) -{ - case 'uploadFile': - $dummy = doExecuteImport($gui->fileName,$args,$req_spec_mgr,$req_mgr); - $gui->items = $dummy->items; - $gui->file_check = $dummy->file_check; - $gui->userFeedback = (array)$dummy->userFeedback; - if(array_key_exists("syntaxError", $gui->userFeedback) && count($gui->userFeedback['syntaxError']) > 0) - { - $gui->importResult = lang_get('import_syntax_error'); - } - else - { - $gui->importResult = lang_get('import_done'); - } - $gui->refreshTree = $args->refreshTree && $gui->file_check['status_ok']; - break; -} - - -// new dBug($gui); -$smarty = new TLSmarty; -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * - */ -function init_args() -{ - $argsObj = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = array("importType" => array(tlInputParameter::STRING_N,0,5), - "req_spec_id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,20)); - - R_PARAMS($iParams,$argsObj); - - $argsObj->doAction = ($argsObj->doAction == '') ? 'askFileName' : $argsObj->doAction; - $argsObj->userID = intval($_SESSION['userID']); - $argsObj->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $argsObj->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - return $argsObj; -} - - - - -/** - * - * - * - **/ -function initializeGui(&$dbHandler,&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); - $guiObj->importTypes = array('XML' => 'Mantis XML'); - - - $guiObj->req_spec_id = $argsObj->req_spec_id; - $guiObj->refreshTree = $guiObj->doImport = tlStringLen($argsObj->importType); - $guiObj->resultMap = null; - $guiObj->req_spec_name = ''; - $guiObj->file_check = array('status_ok' => 1, 'msg' => 'ok'); - $guiObj->import_title = lang_get('title_req_import'); - - $guiObj->fileName = TL_TEMP_PATH . session_id(). "-import_req_from_issue"; - - if($argsObj->req_spec_id) - { - $tree_mgr = new tree($dbHandler); - $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->req_spec_id); - unset($tree_mgr); - $guiObj->req_spec_name = $node_info['name']; - } - - - return $guiObj; -} - - -/** - * doExecuteImport - * - */ -function doExecuteImport($fileName,&$argsObj,&$reqSpecMgr,&$reqMgr) -{ - $retval = new stdClass(); - $retval->items = array(); - $retval->msg = ''; - $retval->file_check=array('status_ok' => 1, 'msg' => 'ok'); - $retval->userFeedback = null; - - $context = new stdClass(); - $context->tproject_id = $argsObj->tproject_id; - $context->req_spec_id = $argsObj->req_spec_id; - $context->user_id = $argsObj->userID; - $context->importType = $argsObj->importType; - - new dBug($context); - // manage file upload process - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - - - if (($source != 'none') && ($source != '' )) - { - if (move_uploaded_file($source, $fileName)) - { - if( strcasecmp($argsObj->importType,'XML') == 0 ) - { - $retval->file_check['status_ok']=!(($xml=simplexml_load_file_wrapper($fileName)) === FALSE); - } - } - } - else - { - $retval->file_check=array('status_ok' => 0, 'msg' => lang_get('please_choose_req_file')); - } - // ---------------------------------------------------------------------------------------------- - - if($retval->file_check['status_ok']) - { - //var_dump($xml); - //die(); - - $retval->items = doReqImportFromMantisXML($reqMgr,$xml,$context); - $retval->msg = lang_get('req_import_finished'); - unlink($fileName); - } - return $retval; -} - - -/** - * - */ -function doReqImportFromMantisXML(&$reqMgr,&$simpleXMLObj,$importContext) -{ - - $inputItems = getFromMantisIssueSimpleXMLObj($simpleXMLObj); - $loop2do = count($inputItems); - for($kdx=0; $kdx < $loop2do; $kdx++) - { - $dummy = $reqMgr->createFromMap($inputItems[$kdx],$importContext->tproject_id, - $importContext->req_spec_id,$importContext->user_id); - $items = array_merge($items,$dummy); - } - return $items; -} - -/** - * - */ -function getFromMantisIssueSimpleXMLObj($xmlObj) -{ - $itemSet = null; - if (!$xmlObj) - { - return $itemSet; - } - - - $l18n = init_labels( array('issue_issue' => null, 'issue_steps_to_reproduce' => null, 'issue_summary' => null, - 'issue_target_version' => null,'issue_description' => null, - 'issue_additional_information' => null)); - - $jdx = 0; - $xmlIssue = $xmlObj->issue; - $loops2do=sizeof($xmlIssue); - - $XMLDef['elements'] = array('string' => array('summary' => null,'description' => null, - 'additional_information' => null, - 'steps_to_reproduce' => null, - 'target_version' => null, 'id' => null)); - $itemSet = array(); - $nl = "

    "; - for($idx = 0; $idx < $loops2do; $idx++) - { - $dummy = getItemsFromSimpleXMLObj(array($xmlIssue[$idx]),$XMLDef); - $dummy = $dummy[0]; - - $isum = $l18n['issue_description'] . $nl . $dummy['description']; - if(!is_null($dummy['steps_to_reproduce'])) - { - $isum .= $nl . $l18n['issue_steps_to_reproduce'] . $nl . $dummy['steps_to_reproduce']; - } - if(!is_null($dummy['additional_information'])) - { - $isum .= $nl . $l18n['issue_additional_information'] . $nl . $dummy['additional_information']; - } - - $itemSet[$jdx++] = array('docid' => 'Mantis Task ID:' .$dummy['id'], - 'title' => ($l18n['issue_issue'] . ':' . $dummy['id'] . ' - ' . $dummy['summary']), - 'description' => $isum,'node_order' => $idx, - 'status' => '', 'type' => '', 'expected_coverage' => 1); - } - return $itemSet; -} - -/** - * - * - */ -function checkRights(&$db,&$user) -{ - return ($user->hasRight($db,'mgt_view_req') && $user->hasRight($db,'mgt_modify_req')); + + * + * + * 21 + * testlink-test + * administrator + * normal + * minor + * have not tried + * new + * open + * none + * FromTestLink + * 1365184242 + * 1365184242 + * none + * V1 + * public + *

    ISSUE-V1 + * 1 + * ISSUE-V1 + *
    + * + * 20 + * testlink-test + * + * @internal revisions + * @since 1.9.10 + * + */ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'xml.inc.php'; + +testlinkInitPage($db, false, false, "checkRights"); +$templateCfg = templateConfiguration(); +$req_spec_mgr = new requirement_spec_mgr($db); +$req_mgr = new requirement_mgr($db); +$args = initArgs(); +$gui = initializeGui($db, $args); + +switch ($args->doAction) { + case 'uploadFile': + $dummy = doExecuteImport($gui->fileName, $args, $req_spec_mgr, $req_mgr); + $gui->items = $dummy->items; + $gui->file_check = $dummy->file_check; + $gui->userFeedback = (array) $dummy->userFeedback; + if (array_key_exists("syntaxError", $gui->userFeedback) && + ! empty($gui->userFeedback['syntaxError'])) { + $gui->importResult = lang_get('import_syntax_error'); + } else { + $gui->importResult = lang_get('import_done'); + } + $gui->refreshTree = $args->refreshTree && $gui->file_check['status_ok']; + break; +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs() +{ + $argsObj = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "importType" => array( + tlInputParameter::STRING_N, + 0, + 5 + ), + "req_spec_id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ) + ); + + R_PARAMS($iParams, $argsObj); + + $argsObj->doAction = ($argsObj->doAction == '') ? 'askFileName' : $argsObj->doAction; + $argsObj->userID = intval($_SESSION['userID']); + $argsObj->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $argsObj->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + return $argsObj; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); + $guiObj->importTypes = array( + 'XML' => 'Mantis XML' + ); + + $guiObj->req_spec_id = $argsObj->req_spec_id; + $guiObj->refreshTree = $guiObj->doImport = tlStringLen($argsObj->importType); + $guiObj->resultMap = null; + $guiObj->req_spec_name = ''; + $guiObj->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $guiObj->import_title = lang_get('title_req_import'); + + $guiObj->fileName = TL_TEMP_PATH . session_id() . "-import_req_from_issue"; + + if ($argsObj->req_spec_id) { + $tree_mgr = new tree($dbHandler); + $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->req_spec_id); + unset($tree_mgr); + $guiObj->req_spec_name = $node_info['name']; + } + + return $guiObj; +} + +/** + * doExecuteImport + */ +function doExecuteImport($fileName, &$argsObj, &$reqSpecMgr, &$reqMgr) +{ + $retval = new stdClass(); + $retval->items = array(); + $retval->msg = ''; + $retval->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $retval->userFeedback = null; + + $context = new stdClass(); + $context->tproject_id = $argsObj->tproject_id; + $context->req_spec_id = $argsObj->req_spec_id; + $context->user_id = $argsObj->userID; + $context->importType = $argsObj->importType; + + // manage file upload process + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + + if (($source != 'none') && ($source != '')) { + if (move_uploaded_file($source, $fileName) && + strcasecmp($argsObj->importType, 'XML') == 0) { + $retval->file_check['status_ok'] = (($xml = simplexml_load_file_wrapper( + $fileName)) !== false); + } + } else { + $retval->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_req_file') + ); + } + + if ($retval->file_check['status_ok']) { + + $retval->items = doReqImportFromMantisXML($reqMgr, $xml, $context); + $retval->msg = lang_get('req_import_finished'); + unlink($fileName); + } + return $retval; +} + +/** + */ +function doReqImportFromMantisXML(&$reqMgr, &$simpleXMLObj, $importContext) +{ + $inputItems = getFromMantisIssueSimpleXMLObj($simpleXMLObj); + $loop2do = count($inputItems); + for ($kdx = 0; $kdx < $loop2do; $kdx ++) { + $dummy = $reqMgr->createFromMap($inputItems[$kdx], + $importContext->tproject_id, $importContext->req_spec_id, + $importContext->user_id); + $items = array_merge($items, $dummy); + } + return $items; +} + +/** + */ +function getFromMantisIssueSimpleXMLObj($xmlObj) +{ + $itemSet = null; + if (! $xmlObj) { + return $itemSet; + } + + $l18n = init_labels( + array( + 'issue_issue' => null, + 'issue_steps_to_reproduce' => null, + 'issue_summary' => null, + 'issue_target_version' => null, + 'issue_description' => null, + 'issue_additional_information' => null + )); + + $jdx = 0; + $xmlIssue = $xmlObj->issue; + $loops2do = count($xmlIssue); + + $xmlDef['elements'] = array( + 'string' => array( + 'summary' => null, + 'description' => null, + 'additional_information' => null, + 'steps_to_reproduce' => null, + 'target_version' => null, + 'id' => null + ) + ); + $itemSet = array(); + $nl = "

    "; + for ($idx = 0; $idx < $loops2do; $idx ++) { + $dummy = getItemsFromSimpleXMLObj(array( + $xmlIssue[$idx] + ), $xmlDef); + $dummy = $dummy[0]; + + $isum = $l18n['issue_description'] . $nl . $dummy['description']; + if (! is_null($dummy['steps_to_reproduce'])) { + $isum .= $nl . $l18n['issue_steps_to_reproduce'] . $nl . + $dummy['steps_to_reproduce']; + } + if (! is_null($dummy['additional_information'])) { + $isum .= $nl . $l18n['issue_additional_information'] . $nl . + $dummy['additional_information']; + } + + $itemSet[$jdx ++] = array( + 'docid' => 'Mantis Task ID:' . $dummy['id'], + 'title' => ($l18n['issue_issue'] . ':' . $dummy['id'] . ' - ' . + $dummy['summary']), + 'description' => $isum, + 'node_order' => $idx, + 'status' => '', + 'type' => '', + 'expected_coverage' => 1 + ); + } + return $itemSet; +} + +/** + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_view_req') && + $user->hasRight($db, 'mgt_modify_req'); } diff --git a/lib/requirements/reqEdit.php b/lib/requirements/reqEdit.php index bee3bb619e..85387f7262 100644 --- a/lib/requirements/reqEdit.php +++ b/lib/requirements/reqEdit.php @@ -1,317 +1,389 @@ -tproject_id = $args->tproject_id; -checkRights($db,$args->user,$context); - - -$pFn = $args->doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) { - $op = $commandMgr->$pFn($args,$_REQUEST); +tproject_id = $args->tproject_id; +checkRights($db, $args->user, $context); + +$pFn = $args->doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_REQUEST); +} + +renderGui($args, $gui, $op, $templateCfg, $editorCfg, $db); + +/** + * init_args + */ +function initArgs(&$dbHandler) +{ + $reqTitleSize = config_get('field_size')->requirement_title; + $iParams = array( + "requirement_id" => array( + tlInputParameter::INT_N + ), + "req_version_id" => array( + tlInputParameter::INT_N + ), + "req_spec_id" => array( + tlInputParameter::INT_N + ), + "req_title" => array( + tlInputParameter::STRING_N, + 0, + $reqTitleSize + ), + "req_id_cbox" => array( + tlInputParameter::ARRAY_INT + ), + "reqDocId" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "reqStatus" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "reqType" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "containerID" => array( + tlInputParameter::INT_N + ), + "scope" => array( + tlInputParameter::STRING_N + ), + "countReq" => array( + tlInputParameter::INT_N + ), + "expected_coverage" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "itemSet" => array( + tlInputParameter::ARRAY_INT + ), + "testcase_count" => array( + tlInputParameter::ARRAY_INT + ), + "copy_testcase_assignment" => array( + tlInputParameter::CB_BOOL + ), + "relation_id" => array( + tlInputParameter::INT_N + ), + "relation_source_req_id" => array( + tlInputParameter::INT_N + ), + "relation_type" => array( + tlInputParameter::STRING_N + ), + "relation_destination_req_doc_id" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "relation_destination_testproject_id" => array( + tlInputParameter::INT_N + ), + "save_rev" => array( + tlInputParameter::INT_N + ), + "do_save" => array( + tlInputParameter::INT_N + ), + "log_message" => array( + tlInputParameter::STRING_N + ), + "tcaseIdentity" => array( + tlInputParameter::STRING_N + ), + "file_id" => array( + tlInputParameter::INT_N + ), + "fileTitle" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->user = $_SESSION['currentUser']; + $args->req_id = $args->requirement_id; + $args->title = $args->req_title; + $args->arrReqIds = $args->req_id_cbox; + + $args->basehref = $_SESSION['basehref']; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + if ($args->tproject_id <= 0) { + throw new Exception( + __FILE__ . '::' . __FUNCTION__ . " Test project ID can not be <= 0 "); + } + + $mgr = new testproject($dbHandler); + $info = $mgr->get_by_id($args->tproject_id); + if (is_null($info)) { + throw new Exception( + __FILE__ . '::' . __FUNCTION__ . " Unable to get test project data "); + } + + $args->tproject_name = $info['name']; + $args->tcasePrefix = $info['prefix']; + + $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + + if (! is_numeric($args->expected_coverage)) { + $args->expected_coverage = 0; + } + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : 0; + + $args->stay_here = isset($_REQUEST['stay_here']) ? 1 : 0; + return $args; +} + +/** + */ +function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg, $editorCfg, + &$dbHandler) +{ + $smartyObj = new TLSmarty(); + $renderType = 'none'; + // @TODO document + $actionOpe = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doReorder' => '', + 'reorder' => '', + 'createTestCases' => 'doCreateTestCases', + 'doCreateTestCases' => 'doCreateTestCases', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'copy' => 'doCopy', + 'doCopy' => 'doCopy', + 'doCreateVersion' => 'doCreateVersion', + 'doCreateRevision' => 'doCreateRevision', + 'doDeleteVersion' => '', + 'doFreezeVersion' => 'doFreezeVersion', + 'doAddRelation' => 'doAddRelation', + 'doDeleteRelation' => 'doDeleteRelation', + 'doUnfreezeVersion' => 'doUnfreezeVersion', + 'fileUpload' => '', + 'deleteFile' => '', + 'startMonitoring' => '', + 'stopMonitoring' => '' + ); + + $owebEditor = web_editor('scope', $argsObj->basehref, $editorCfg); + switch ($argsObj->doAction) { + case "edit": + case "doCreate": + $owebEditor->Value = $argsObj->scope; + break; + + case "fileUpload": + case "deleteFile": + case "startMonitoring": + case "stopMonitoring": + break; + + default: + if ($opObj->suggest_revision || $opObj->prompt_for_log) { + $owebEditor->Value = $argsObj->scope; + } else { + $owebEditor->Value = getItemTemplateContents( + 'requirement_template', $owebEditor->InstanceName, + $argsObj->scope); + } + break; + } + + $guiObj->askForRevision = $opObj->suggest_revision ? 1 : 0; + $guiObj->askForLog = $opObj->prompt_for_log ? 1 : 0; + + $guiObj->scope = $owebEditor->CreateHTML(); + $guiObj->editorType = $editorCfg['type']; + switch ($argsObj->doAction) { + case "doDelete": + $guiObj->refreshTree = 1; // has to be forced + break; + + case "doCreate": + $guiObj->refreshTree = $argsObj->refreshTree; + break; + + case "doUpdate": + // IMPORTANT NOTICE + // we do not set tree refresh here, because on this situation + // tree update has to be done when reqView page is called. + // If we ask for tree refresh here we are going to do double refresh (useless and time consuming) + break; + } + + switch ($argsObj->doAction) { + case "addTestCase": + case "edit": + case "create": + case "reorder": + case "doDelete": + case "doReorder": + case "createTestCases": + case "doCreateTestCases": + case "doCreate": + case "doFreezeVersion": + case "doUnfreezeVersion": + case "doUpdate": + case "copy": + case "doCopy": + case "doCreateVersion": + case "doDeleteVersion": + case "doAddRelation": + case "doDeleteRelation": + case "doCreateRevision": + case "removeTestCase": + case "fileUpload": + case "deleteFile": + case "stopMonitoring": + case "startMonitoring": + $renderType = 'template'; + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + + // exceptions + $guiObj->askForRevision = $opObj->suggest_revision ? 1 : 0; + $guiObj->askForLog = $opObj->prompt_for_log ? 1 : 0; + $guiObj->operation = isset($actionOpe[$argsObj->doAction]) ? $actionOpe[$argsObj->doAction] : $argsObj->doAction; + + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tpl = $tplDir . $tpl; + } else { + $renderType = 'redirect'; + if (! empty($guiObj->uploadOp) && ! $guiObj->uploadOp->statusOK) { + $tpl .= "&uploadOPStatusCode=" . + $guiObj->uploadOp->statusCode; + } + } + break; + } + + $req_mgr = new requirement_mgr($dbHandler); + $guiObj->last_doc_id = $req_mgr->get_last_doc_id_for_testproject( + $argsObj->tproject_id); + $guiObj->doAction = $argsObj->doAction; + + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, &$commandMgr) +{ + $req_spec_mgr = new requirement_spec_mgr($dbHandler); + + $gui = $commandMgr->initGuiBean(); + $gui->req_cfg = config_get('req_cfg'); + + $gui->req_spec_id = $argsObj->req_spec_id; + if ($argsObj->req_spec_id) { + $gui->requirements_count = $req_spec_mgr->get_requirements_count( + $gui->req_spec_id); + $gui->req_spec = $req_spec_mgr->get_by_id($gui->req_spec_id); + } + $gui->user_feedback = null; + $gui->main_descr = lang_get('req_spec_short'); + if (isset($gui->req_spec)) { + $gui->main_descr .= config_get('gui_title_separator_1') . + $gui->req_spec['title']; + } + $gui->action_descr = null; + + $gui->grants = new stdClass(); + $gui->grants->req_mgmt = $argsObj->user->hasRightOnProj($dbHandler, + "mgt_modify_req"); + $gui->grants->mgt_view_events = $argsObj->user->hasRightOnProj($dbHandler, + "mgt_view_events"); + + $gui->req_version_id = $argsObj->req_version_id; + $gui->preSelectedType = TL_REQ_TYPE_USE_CASE; + + $gui->stay_here = $argsObj->stay_here; + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req", + "mgt_modify_req" + ]; + pageAccessCheck($db, $user, $context); } - -renderGui($args,$gui,$op,$templateCfg,$editorCfg,$db); - - -/** - * init_args - * - */ -function init_args(&$dbHandler) -{ - - $reqTitleSize = config_get('field_size')->requirement_title; - $iParams = array("requirement_id" => array(tlInputParameter::INT_N), - "req_version_id" => array(tlInputParameter::INT_N), - "req_spec_id" => array(tlInputParameter::INT_N), - "req_title" => array(tlInputParameter::STRING_N,0,$reqTitleSize), - "req_id_cbox" => array(tlInputParameter::ARRAY_INT), - "reqDocId" => array(tlInputParameter::STRING_N,0,64), - "reqStatus" => array(tlInputParameter::STRING_N,0,1), - "reqType" => array(tlInputParameter::STRING_N,0,1), - "containerID" => array(tlInputParameter::INT_N), - "scope" => array(tlInputParameter::STRING_N), - "countReq" => array(tlInputParameter::INT_N), - "expected_coverage" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,20), - "itemSet" => array(tlInputParameter::ARRAY_INT), - "testcase_count" => array(tlInputParameter::ARRAY_INT), - "copy_testcase_assignment" => array(tlInputParameter::CB_BOOL), - "relation_id" => array(tlInputParameter::INT_N), - "relation_source_req_id" => array(tlInputParameter::INT_N), - "relation_type" => array(tlInputParameter::STRING_N), - "relation_destination_req_doc_id" => array(tlInputParameter::STRING_N,0,64), - "relation_destination_testproject_id" => array(tlInputParameter::INT_N), - "save_rev" => array(tlInputParameter::INT_N), - "do_save" => array(tlInputParameter::INT_N), - "log_message" => array(tlInputParameter::STRING_N), - "tcaseIdentity" => array(tlInputParameter::STRING_N), - "file_id" => array(tlInputParameter::INT_N), - "fileTitle" => array(tlInputParameter::STRING_N,0,100)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - $_REQUEST=strings_stripSlashes($_REQUEST); - - $args->user = $_SESSION['currentUser']; - $args->req_id = $args->requirement_id; - $args->title = $args->req_title; - $args->arrReqIds = $args->req_id_cbox; - - $args->basehref = $_SESSION['basehref']; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - if($args->tproject_id <= 0) - { - throw new Exception(__FILE__ . '::' . __FUNCTION__ . " Test project ID can not be <= 0 "); - } - - $mgr = new testproject($dbHandler); - $info = $mgr->get_by_id($args->tproject_id); - if(is_null($info)) - { - throw new Exception(__FILE__ . '::' . __FUNCTION__ . " Unable to get test project data "); - } - - $args->tproject_name = $info['name']; - $args->tcasePrefix = $info['prefix']; - - - $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - - if (!is_numeric($args->expected_coverage)) { - $args->expected_coverage = 0; - } - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) - ? $_SESSION['setting_refresh_tree_on_action'] : 0; - - $args->stay_here = isset($_REQUEST['stay_here']) ? 1 : 0; - return $args; -} - -/** - * - * - */ -function renderGui(&$argsObj,$guiObj,$opObj,$templateCfg,$editorCfg,&$dbHandler) -{ - $smartyObj = new TLSmarty(); - $renderType = 'none'; - // @TODO document - $actionOpe = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doReorder' => '', 'reorder' => '', - 'createTestCases' => 'doCreateTestCases', - 'doCreateTestCases' => 'doCreateTestCases', - 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', - 'copy' => 'doCopy', 'doCopy' => 'doCopy', - 'doCreateVersion' => 'doCreateVersion','doCreateRevision' => 'doCreateRevision', - 'doDeleteVersion' => '', 'doFreezeVersion' => 'doFreezeVersion', - 'doAddRelation' => 'doAddRelation', 'doDeleteRelation' => 'doDeleteRelation', - 'doUnfreezeVersion' => 'doUnfreezeVersion', - 'fileUpload' => '', 'deleteFile' => '', - 'startMonitoring' => '','stopMonitoring' => ''); - - $owebEditor = web_editor('scope',$argsObj->basehref,$editorCfg) ; - switch($argsObj->doAction) { - case "edit": - case "doCreate": - $owebEditor->Value = $argsObj->scope; - break; - - case "fileUpload": - case "deleteFile": - case "startMonitoring": - case "stopMonitoring": - break; - - default: - if($opObj->suggest_revision || $opObj->prompt_for_log) - { - $owebEditor->Value = $argsObj->scope; - } - else - { - $owebEditor->Value = getItemTemplateContents('requirement_template',$owebEditor->InstanceName, - $argsObj->scope); - } - break; - } - - $guiObj->askForRevision = $opObj->suggest_revision ? 1 : 0; - $guiObj->askForLog = $opObj->prompt_for_log ? 1 : 0; - - - $guiObj->scope = $owebEditor->CreateHTML(); - $guiObj->editorType = $editorCfg['type']; - switch($argsObj->doAction) - { - case "doDelete": - $guiObj->refreshTree = 1; // has to be forced - break; - - case "doCreate": - $guiObj->refreshTree = $argsObj->refreshTree; - break; - - case "doUpdate": - // IMPORTANT NOTICE - // we do not set tree refresh here, because on this situation - // tree update has to be done when reqView page is called. - // If we ask for tree refresh here we are going to do double refresh (useless and time consuming) - break; - } - - switch($argsObj->doAction) - { - case "addTestCase": - case "edit": - case "create": - case "reorder": - case "doDelete": - case "doReorder": - case "createTestCases": - case "doCreateTestCases": - case "doCreate": - case "doFreezeVersion": - case "doUnfreezeVersion": - case "doUpdate": - case "copy": - case "doCopy": - case "doCreateVersion": - case "doDeleteVersion": - case "doAddRelation": - case "doDeleteRelation": - case "doCreateRevision": - case "removeTestCase": - case "fileUpload": - case "deleteFile": - case "stopMonitoring": - case "startMonitoring": - $renderType = 'template'; - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) - { - $guiObj->$key = $value; - } - - // exceptions - $guiObj->askForRevision = $opObj->suggest_revision ? 1 : 0; - $guiObj->askForLog = $opObj->prompt_for_log ? 1 : 0; - $guiObj->operation = isset($actionOpe[$argsObj->doAction]) ? $actionOpe[$argsObj->doAction] : $argsObj->doAction; - - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - - $pos = strpos($tpl, '.php'); - if($pos === false) { - $tpl = $tplDir . $tpl; - } else { - $renderType = 'redirect'; - if (null != $guiObj->uploadOp && $guiObj->uploadOp->statusOK == false) { - $tpl .= "&uploadOPStatusCode=" . $guiObj->uploadOp->statusCode; - } - } - break; - } - - $req_mgr = new requirement_mgr($dbHandler); - $guiObj->last_doc_id = $req_mgr->get_last_doc_id_for_testproject($argsObj->tproject_id); - $guiObj->doAction = $argsObj->doAction; - - switch($renderType) - { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } -} - -/** - * - * - */ -function initialize_gui(&$dbHandler,&$argsObj,&$commandMgr) -{ - $req_spec_mgr = new requirement_spec_mgr($dbHandler); - - // new dBug($argsObj); - - $gui = $commandMgr->initGuiBean(); - $gui->req_cfg = config_get('req_cfg'); - - $gui->req_spec_id = $argsObj->req_spec_id; - if ($argsObj->req_spec_id) - { - $gui->requirements_count = $req_spec_mgr->get_requirements_count($gui->req_spec_id); - $gui->req_spec = $req_spec_mgr->get_by_id($gui->req_spec_id); - } - $gui->user_feedback = null; - $gui->main_descr = lang_get('req_spec_short'); - if (isset($gui->req_spec)) - { - $gui->main_descr .= config_get('gui_title_separator_1') . $gui->req_spec['title']; - } - $gui->action_descr = null; - - $gui->grants = new stdClass(); - $gui->grants->req_mgmt = $argsObj->user->hasRightOnProj($dbHandler,"mgt_modify_req"); - $gui->grants->mgt_view_events = $argsObj->user->hasRightOnProj($dbHandler,"mgt_view_events"); - - $gui->req_version_id = $argsObj->req_version_id; - $gui->preSelectedType = TL_REQ_TYPE_USE_CASE; - - $gui->stay_here = $argsObj->stay_here; - - return $gui; -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req","mgt_modify_req"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/requirements/reqExport.php b/lib/requirements/reqExport.php index 2a5799e4d5..f13a025737 100644 --- a/lib/requirements/reqExport.php +++ b/lib/requirements/reqExport.php @@ -1,180 +1,170 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - -switch($args->doAction) { - case 'export': - $smarty = new TLSmarty(); - $smarty->assign('gui', $gui); - $smarty->display($tplCfg->template_dir . - $tplCfg->default_template); - break; - - case 'doExport': - doExport($args,$req_spec_mgr); - break; +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +switch ($args->doAction) { + case 'export': + $smarty = new TLSmarty(); + $smarty->assign('gui', $gui); + $smarty->display($tplCfg->template_dir . $tplCfg->default_template); + break; + + case 'doExport': + doExport($args, $req_spec_mgr); + break; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); +} + +/** + * init_args + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : 'export'; + $args->exportType = isset($_REQUEST['exportType']) ? $_REQUEST['exportType'] : null; + $args->req_spec_id = isset($_REQUEST['req_spec_id']) ? intval( + $_REQUEST['req_spec_id']) : null; + $args->export_filename = isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : ""; + $args->export_attachments = isset($_REQUEST['exportAttachments']) ? $_REQUEST['exportAttachments'] : ""; + + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + $args->scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : 'items'; + + return $args; +} + +/** + * initializeGui + */ +function initializeGui(&$argsObj, &$req_spec_mgr) +{ + $gui = new stdClass(); + $gui->exportTypes = $req_spec_mgr->get_export_file_types(); + $gui->exportType = $argsObj->exportType; + $gui->scope = $argsObj->scope; + $gui->tproject_id = $argsObj->tproject_id; + + switch ($argsObj->scope) { + case 'tree': + $gui->req_spec['title'] = lang_get('all_reqspecs_in_tproject'); + $gui->req_spec_id = 0; + $exportFileName = 'all-req.xml'; + break; + + case 'branch': + $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); + $gui->req_spec_id = $argsObj->req_spec_id; + $exportFileName = $gui->req_spec['title'] . '-req-spec.xml'; + break; + + case 'items': + $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); + $gui->req_spec_id = $argsObj->req_spec_id; + $exportFileName = $gui->req_spec['title'] . '-child_req.xml'; + break; + } + + $gui->export_filename = trim($argsObj->export_filename); + if ($gui->export_filename == "") { + $gui->export_filename = $exportFileName; + } + return $gui; +} + +/** + * doExport + */ +function doExport(&$argsObj, &$req_spec_mgr) +{ + $pfn = null; + switch ($argsObj->exportType) { + case 'csv': + $requirements_map = $req_spec_mgr->get_requirements( + $argsObj->req_spec_id); + $pfn = "exportReqDataToCSV"; + $fileName = 'reqs.csv'; + $content = $pfn($requirements_map); + break; + + case 'XML': + $pfn = "exportReqSpecToXML"; + $fileName = 'reqs.xml'; + $content = TL_XMLEXPORT_HEADER; + $optionsForExport['RECURSIVE'] = $argsObj->scope == 'items' ? false : true; + $optionsForExport['ATTACHMENTS'] = $argsObj->export_attachments; + + $openTag = $argsObj->scope == 'items' ? "requirements>" : 'requirement-specification>'; + + switch ($argsObj->scope) { + case 'tree': + $reqSpecSet = $req_spec_mgr->getFirstLevelInTestProject( + $argsObj->tproject_id); + $reqSpecSet = array_keys($reqSpecSet); + break; + + case 'branch': + case 'items': + $reqSpecSet = array( + $argsObj->req_spec_id + ); + break; + } + + $content .= "<" . $openTag . "\n"; + if (! is_null($reqSpecSet)) { + foreach ($reqSpecSet as $reqSpecID) { + $content .= $req_spec_mgr->$pfn($reqSpecID, + $argsObj->tproject_id, $optionsForExport); + } + } + $content .= "export_filename) ? $fileName : $argsObj->export_filename; + downloadContentsToFile($content, $fileName); + exit(); + } } - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); -} - -/** - * init_args - * - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - $args->doAction = isset($_REQUEST['doAction']) - ? $_REQUEST['doAction'] : 'export'; - $args->exportType = isset($_REQUEST['exportType']) - ? $_REQUEST['exportType'] : null; - $args->req_spec_id = isset($_REQUEST['req_spec_id']) - ? intval($_REQUEST['req_spec_id']) : null; - $args->export_filename = isset($_REQUEST['export_filename']) - ? $_REQUEST['export_filename'] : ""; - $args->export_attachments = isset($_REQUEST['exportAttachments']) - ? $_REQUEST['exportAttachments'] : ""; - - $args->tproject_id = isset($_REQUEST['tproject_id']) - ? intval($_REQUEST['tproject_id']) : 0; - - if( $args->tproject_id == 0 ) { - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - $args->scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : 'items'; - - return $args; -} - - -/** - * initializeGui - * - */ -function initializeGui(&$argsObj,&$req_spec_mgr) -{ - $gui = new stdClass(); - $gui->exportTypes = $req_spec_mgr->get_export_file_types(); - $gui->exportType = $argsObj->exportType; - $gui->scope = $argsObj->scope; - $gui->tproject_id = $argsObj->tproject_id; - - switch($argsObj->scope) - { - case 'tree': - $gui->req_spec['title'] = lang_get('all_reqspecs_in_tproject'); - $gui->req_spec_id = 0; - $exportFileName = 'all-req.xml'; - break; - - case 'branch': - $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); - $gui->req_spec_id = $argsObj->req_spec_id; - $exportFileName = $gui->req_spec['title'] . '-req-spec.xml'; - break; - - case 'items': - $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); - $gui->req_spec_id = $argsObj->req_spec_id; - $exportFileName = $gui->req_spec['title'] . '-child_req.xml'; - break; - - } - - $gui->export_filename = trim($argsObj->export_filename); - if($gui->export_filename == "") - { - $gui->export_filename = $exportFileName; - } - return $gui; -} - - - -/** - * doExport - * - */ -function doExport(&$argsObj,&$req_spec_mgr) -{ - $pfn = null; - switch($argsObj->exportType) - { - case 'csv': - $requirements_map = $req_spec_mgr->get_requirements($argsObj->req_spec_id); - $pfn = "exportReqDataToCSV"; - $fileName = 'reqs.csv'; - $content = $pfn($requirements_map); - break; - - case 'XML': - $pfn = "exportReqSpecToXML"; - $fileName = 'reqs.xml'; - $content = TL_XMLEXPORT_HEADER; - $optionsForExport['RECURSIVE'] = $argsObj->scope == 'items' ? false : true; - $optionsForExport['ATTACHMENTS'] = $argsObj->export_attachments; - - $openTag = $argsObj->scope == 'items' ? "requirements>" : 'requirement-specification>'; - - switch($argsObj->scope) { - case 'tree': - $reqSpecSet = $req_spec_mgr->getFirstLevelInTestProject($argsObj->tproject_id); - $reqSpecSet = array_keys($reqSpecSet); - break; - - case 'branch': - case 'items': - $reqSpecSet = array($argsObj->req_spec_id); - break; - } - - $content .= "<" . $openTag . "\n"; - if(!is_null($reqSpecSet)) { - foreach($reqSpecSet as $reqSpecID) { - $content .= $req_spec_mgr->$pfn($reqSpecID,$argsObj->tproject_id,$optionsForExport); - } - } - $content .= "export_filename) - ? $fileName : $argsObj->export_filename; - downloadContentsToFile($content,$fileName); - exit(); - } -} \ No newline at end of file diff --git a/lib/requirements/reqImport.php b/lib/requirements/reqImport.php index 14d90ddafa..0eb7974d66 100644 --- a/lib/requirements/reqImport.php +++ b/lib/requirements/reqImport.php @@ -1,321 +1,322 @@ -tproject_id = $args->tproject_id; -checkRights($db,$args->user,$context); - - - -switch ($args->doAction) { - case 'uploadFile': - $dummy = doExecuteImport($gui->fileName,$args,$req_spec_mgr,$req_mgr); - $gui->items = $dummy->items; - $gui->file_check = $dummy->file_check; - $gui->userFeedback = (array)$dummy->userFeedback; - $gui->importResult = lang_get('import_done'); - if(array_key_exists("syntaxError", $gui->userFeedback) && count($gui->userFeedback['syntaxError']) > 0) { - $gui->importResult = lang_get('import_syntax_error'); - } - $gui->refreshTree = $args->refreshTree && $gui->file_check['status_ok']; - break; +tproject_id = $args->tproject_id; +checkRights($db, $args->user, $context); + +switch ($args->doAction) { + case 'uploadFile': + $dummy = doExecuteImport($gui->fileName, $args, $req_spec_mgr, $req_mgr); + $gui->items = $dummy->items; + $gui->file_check = $dummy->file_check; + $gui->userFeedback = (array) $dummy->userFeedback; + $gui->importResult = lang_get('import_done'); + if (array_key_exists("syntaxError", $gui->userFeedback) && + count($gui->userFeedback['syntaxError']) > 0) { + $gui->importResult = lang_get('import_syntax_error'); + } + $gui->refreshTree = $args->refreshTree && $gui->file_check['status_ok']; + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * doExecuteImport + */ +function doExecuteImport($fileName, &$argsObj, &$reqSpecMgr, &$reqMgr) +{ + $retval = new stdClass(); + $retval->items = array(); + $retval->msg = ''; + $retval->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $retval->userFeedback = null; + + $context = new stdClass(); + $context->tproject_id = $argsObj->tproject_id; + $context->req_spec_id = $argsObj->req_spec_id; + $context->user_id = $argsObj->user_id; + $context->importType = $argsObj->importType; + + $opts = array(); + $opts['skipFrozenReq'] = ($argsObj->skip_frozen_req ? true : false); + $opts['hitCriteria'] = $argsObj->hitCriteria; + $opts['actionOnHit'] = $argsObj->actionOnHit; + + // manage file upload process + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + if (($source != 'none') && ($source != '')) { + if (move_uploaded_file($source, $fileName) && + $argsObj->importType == 'XML') { + $retval->file_check['status_ok'] = (($xml = simplexml_load_file_wrapper( + $fileName)) !== false); + if (! $retval->file_check['status_ok']) { + $retval->file_check['msg'] = lang_get( + 'import_failed_xml_load_failed'); + } + } + } else { + $retval->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_req_file') + ); + } + + if ($retval->file_check['status_ok']) { + if ($argsObj->importType == 'XML') { + // If there is no req_spec in XML, and req_spec_id + // from context is null, we must raise an error, to avoid ghots requirements in DB + $isReqSpec = property_exists($xml, 'req_spec'); + if (! $isReqSpec && $argsObj->req_spec_id <= 0) { + $retval->file_check = array( + 'status_ok' => false, + 'msg' => lang_get('please_create_req_spec_first') + ); + } else { + $retval->items = doReqImportFromXML($reqSpecMgr, $reqMgr, $xml, + $context, $opts); + } + } else { + echo __LINE__; + die(); + $dummy = doReqImportOther($reqMgr, $fileName, $context, $opts); + $retval->items = $dummy['items']; + $retval->userFeedback = $dummy['userFeedback']; + } + unlink($fileName); + $retval->msg = lang_get('req_import_finished'); + } + + return $retval; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $request = strings_stripSlashes($_REQUEST); + + $key = 'actionOnHit'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'update_last_version'; + + $key = 'hitCriteria'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'docid'; + + $args->req_spec_id = isset($request['req_spec_id']) ? intval( + $request['req_spec_id']) : null; + $args->importType = isset($request['importType']) ? $request['importType'] : null; + $args->emptyScope = isset($request['noEmpty']) ? $request['noEmpty'] : null; + $args->conflictSolution = isset($request['conflicts']) ? $request['conflicts'] : null; + $args->bUpload = isset($request['uploadFile']) ? 1 : 0; + + // useRecursion: used when you want to work on test project or req. spec + $args->useRecursion = isset($request['useRecursion']) ? 1 : 0; + $args->skip_frozen_req = isset($request['skip_frozen_req']) ? 1 : 0; + + $args->doAction = 'askFileName'; + $action_keys = array( + 'uploadFile', + 'executeImport' + ); + foreach ($action_keys as $action) { + if (isset($request[$action])) { + $args->doAction = $action; + break; + } + } + + $args->achecked_req = isset($request['achecked_req']) ? $request['achecked_req'] : null; + $args->tproject_id = intval($_SESSION['testprojectID']); + $args->tproject_name = $_SESSION['testprojectName']; + $args->user_id = intval( + isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); + + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + + $args->scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : 'items'; + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : 0; + + return $args; +} + +/** + * initializeGui() + * create object that will be used by Smarty template + */ +function initializeGui(&$dbHandler, &$argsObj, $session, &$reqSpecMgr, &$reqMgr) +{ + $gui = new stdClass(); + $gui->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $gui->items = null; + $gui->try_upload = $argsObj->bUpload; + $gui->importResult = null; + $gui->refreshTree = false; + + $gui->doAction = $argsObj->doAction; + $gui->scope = $argsObj->scope; + $gui->req_spec = null; + $gui->req_spec_id = $argsObj->req_spec_id; + $gui->hitCriteria = $argsObj->hitCriteria; + $gui->actionOnHit = $argsObj->actionOnHit; + + switch ($gui->scope) { + case 'tree': + $gui->main_descr = sprintf(lang_get('tproject_import_req_spec'), + $argsObj->tproject_name); + $gui->importTypes = $reqSpecMgr->get_import_file_types(); + break; + + case 'branch': + $gui->req_spec = $reqSpecMgr->get_by_id($argsObj->req_spec_id); + $gui->main_descr = sprintf(lang_get('reqspec_import_req_spec'), + $gui->req_spec['title']); + $gui->importTypes = $reqSpecMgr->get_import_file_types(); + break; + + case 'items': + $gui->req_spec = $reqSpecMgr->get_by_id($argsObj->req_spec_id); + $gui->main_descr = sprintf(lang_get('reqspec_import_requirements'), + $gui->req_spec['title']); + $gui->importTypes = $reqMgr->get_import_file_types(); + break; + } + + $gui->importType = $argsObj->importType; + $gui->fileName = TL_TEMP_PATH . "importReq-" . session_id() . ".tmp"; + + $gui->importFileGui = new stdClass(); + $gui->importFileGui->importTypes = $gui->importTypes; + $gui->importFileGui->importType = $argsObj->importType; + + $file_size_limit = config_get('import_file_max_size_bytes'); + $gui->importFileGui->maxFileSize = round(strval($file_size_limit) / 1024); + $gui->importFileGui->fileSizeLimitMsg = sprintf( + lang_get('max_file_size_is'), $gui->importFileGui->maxFileSize . ' KB '); + + $gui->importFileGui->skip_frozen_req_checked = $argsObj->skip_frozen_req ? ' checked="checked" ' : ''; + + $gui->importFileGui->return_to_url = $session['basehref']; + if (is_null($argsObj->req_spec_id)) { + $gui->importFileGui->return_to_url .= "lib/project/project_req_spec_mgmt.php?id=$argsObj->tproject_id"; + } else { + $gui->importFileGui->return_to_url .= "lib/requirements/reqSpecView.php?req_spec_id=$argsObj->req_spec_id"; + } + + $gui->actionOptions = array( + 'update_last_version' => lang_get('update_last_requirement_version'), + 'create_new_version' => lang_get('create_new_requirement_version') + ); + + $gui->hitOptions = array( + 'docid' => lang_get('same_docid'), + 'title' => lang_get('same_title') + ); + + $gui->duplicate_criteria_verbose = lang_get('duplicate_req_criteria'); + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req", + "mgt_modify_req" + ]; + pageAccessCheck($db, $user, $context); +} + +/** + */ +function doReqImportFromXML(&$reqSpecMgr, &$reqMgr, &$simpleXMLObj, + $importContext, $importOptions) +{ + $items = array(); + $isReqSpec = property_exists($simpleXMLObj, 'req_spec'); + if ($isReqSpec) { + foreach ($simpleXMLObj->req_spec as $xkm) { + $dummy = $reqSpecMgr->createFromXML($xkm, + $importContext->tproject_id, $importContext->req_spec_id, + $importContext->user_id, null, $importOptions); + $items = array_merge($items, $dummy); + } + } else { + $loop2do = count($simpleXMLObj->requirement); + for ($kdx = 0; $kdx < $loop2do; $kdx ++) { + $dummy = $reqMgr->createFromXML($simpleXMLObj->requirement[$kdx], + $importContext->tproject_id, $importContext->req_spec_id, + $importContext->user_id, null, $importOptions); + $items = array_merge($items, $dummy); + } + } + return $items; +} + +/** + */ +function doReqImportOther(&$reqMgr, $fileName, $importContext, $importOptions) +{ + $impSet = loadImportedReq($fileName, $importContext->importType); + $items = array(); + + if (! is_null($impSet)) { + $reqSet = $impSet['info']; + if ($loop2do = count($reqSet)) { + for ($kdx = 0; $kdx < $loop2do; $kdx ++) { + $dummy = $reqMgr->createFromMap($reqSet[$kdx], + $importContext->tproject_id, $importContext->req_spec_id, + $importContext->user_id, null, $importOptions); + $items = array_merge($items, $dummy); + } + } + } + return array( + 'items' => $items, + 'userFeedback' => $impSet['userFeedback'] + ); } - - -$smarty = new TLSmarty; -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * doExecuteImport - * - */ -function doExecuteImport($fileName,&$argsObj,&$reqSpecMgr,&$reqMgr) -{ - $retval = new stdClass(); - $retval->items = array(); - $retval->msg = ''; - $retval->file_check=array('status_ok' => 1, 'msg' => 'ok'); - $retval->userFeedback = null; - - $context = new stdClass(); - $context->tproject_id = $argsObj->tproject_id; - $context->req_spec_id = $argsObj->req_spec_id; - $context->user_id = $argsObj->user_id; - $context->importType = $argsObj->importType; - - $opts = array(); - $opts['skipFrozenReq'] = ($argsObj->skip_frozen_req ? true : false); - $opts['hitCriteria'] = $argsObj->hitCriteria; - $opts['actionOnHit'] = $argsObj->actionOnHit; - - // manage file upload process - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - if (($source != 'none') && ($source != '' )) { - if (move_uploaded_file($source, $fileName)) { - if( $argsObj->importType == 'XML' ) { - $retval->file_check['status_ok']=!(($xml=simplexml_load_file_wrapper($fileName)) === FALSE); - if( !$retval->file_check['status_ok'] ) { - $retval->file_check['msg'] = lang_get('import_failed_xml_load_failed'); - } - } - } - } else { - $retval->file_check=array('status_ok' => 0, 'msg' => lang_get('please_choose_req_file')); - } - // ------------------------------------------------------------- - - if($retval->file_check['status_ok']) { - if($argsObj->importType == 'XML') { - // If there is no req_spec in XML, and req_spec_id - // from context is null, we must raise an error, to avoid ghots requirements in DB - $isReqSpec = property_exists($xml,'req_spec'); - if(!$isReqSpec && $argsObj->req_spec_id <= 0) { - $retval->file_check = array('status_ok' => FALSE, 'msg' => lang_get('please_create_req_spec_first')); - } else { - $retval->items = doReqImportFromXML($reqSpecMgr,$reqMgr,$xml,$context,$opts); - } - } else { - echo __LINE__; die(); - $dummy = doReqImportOther($reqMgr,$fileName,$context,$opts); - $retval->items = $dummy['items']; - $retval->userFeedback = $dummy['userFeedback']; - } - unlink($fileName); - $retval->msg = lang_get('req_import_finished'); - } - - return $retval; -} - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $request = strings_stripSlashes($_REQUEST); - - - $key='actionOnHit'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'update_last_version'; - - $key='hitCriteria'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'docid'; - - - $args->req_spec_id = isset($request['req_spec_id']) ? intval($request['req_spec_id']) : null; - $args->importType = isset($request['importType']) ? $request['importType'] : null; - $args->emptyScope = isset($request['noEmpty']) ? $request['noEmpty'] : null; - $args->conflictSolution = isset($request['conflicts']) ? $request['conflicts'] : null; - $args->bUpload = isset($request['uploadFile']) ? 1 : 0; - - // useRecursion: used when you want to work on test project or req. spec - $args->useRecursion = isset($request['useRecursion']) ? 1 : 0; - $args->skip_frozen_req = isset($request['skip_frozen_req']) ? 1 : 0; - - - $args->doAction='askFileName'; - $action_keys = array('uploadFile','executeImport'); - foreach($action_keys as $action) - { - if( isset($request[$action]) ) - { - $args->doAction=$action; - break; - } - } - - $args->achecked_req = isset($request['achecked_req']) ? $request['achecked_req'] : null; - $args->tproject_id = intval($_SESSION['testprojectID']); - $args->tproject_name = $_SESSION['testprojectName']; - $args->user_id = intval(isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); - - $args->user = isset($_SESSION['currentUser']) - ? $_SESSION['currentUser'] : null; - - - $args->scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : 'items'; - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? - $_SESSION['setting_refresh_tree_on_action'] : 0; - - return $args; -} - - - - - -/** - * initializeGui() - * create object that will be used by Smarty template - * - */ -function initializeGui(&$dbHandler,&$argsObj,$session,&$reqSpecMgr,&$reqMgr) -{ - $gui=new stdClass(); - $gui->file_check = array('status_ok' => 1, 'msg' => 'ok'); - $gui->items=null; - $gui->try_upload = $argsObj->bUpload; - $gui->importResult = null; - $gui->refreshTree = false; - - $gui->doAction=$argsObj->doAction; - $gui->scope = $argsObj->scope; - $gui->req_spec = null; - $gui->req_spec_id = $argsObj->req_spec_id; - $gui->hitCriteria = $argsObj->hitCriteria; - $gui->actionOnHit = $argsObj->actionOnHit; - - switch($gui->scope) - { - case 'tree': - $gui->main_descr = sprintf(lang_get('tproject_import_req_spec'),$argsObj->tproject_name); - $gui->importTypes = $reqSpecMgr->get_import_file_types(); - break; - - case 'branch': - $gui->req_spec = $reqSpecMgr->get_by_id($argsObj->req_spec_id); - $gui->main_descr = sprintf(lang_get('reqspec_import_req_spec'),$gui->req_spec['title']); - $gui->importTypes = $reqSpecMgr->get_import_file_types(); - break; - - case 'items': - $gui->req_spec = $reqSpecMgr->get_by_id($argsObj->req_spec_id); - $gui->main_descr = sprintf(lang_get('reqspec_import_requirements'),$gui->req_spec['title']); - $gui->importTypes = $reqMgr->get_import_file_types(); - break; - } - - - $gui->importType = $argsObj->importType; - $gui->fileName = TL_TEMP_PATH . "importReq-" . session_id() . ".tmp"; - - $gui->importFileGui = new stdClass(); - $gui->importFileGui->importTypes = $gui->importTypes; - $gui->importFileGui->importType = $argsObj->importType; - - $file_size_limit = config_get('import_file_max_size_bytes'); - $gui->importFileGui->maxFileSize=round(strval($file_size_limit)/1024); - $gui->importFileGui->fileSizeLimitMsg=sprintf(lang_get('max_file_size_is'), $gui->importFileGui->maxFileSize . ' KB '); - - - $gui->importFileGui->skip_frozen_req_checked = $argsObj->skip_frozen_req ? ' checked="checked" ' : ''; - - - $gui->importFileGui->return_to_url=$session['basehref']; - if( is_null($argsObj->req_spec_id) ) - { - $gui->importFileGui->return_to_url .= "lib/project/project_req_spec_mgmt.php?id=$argsObj->tproject_id"; - } - else - { - $gui->importFileGui->return_to_url .= "lib/requirements/reqSpecView.php?req_spec_id=$argsObj->req_spec_id"; - } - - $gui->actionOptions=array('update_last_version' => lang_get('update_last_requirement_version'), - 'create_new_version' => lang_get('create_new_requirement_version')); - - $gui->hitOptions=array('docid' => lang_get('same_docid'),'title' => lang_get('same_title')); - - $gui->duplicate_criteria_verbose = lang_get('duplicate_req_criteria'); - - return $gui; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req","mgt_modify_req"]; - pageAccessCheck($db, $user, $context); -} - - -/** - * - * - */ -function doReqImportFromXML(&$reqSpecMgr,&$reqMgr,&$simpleXMLObj,$importContext,$importOptions) -{ - $items = array(); - $isReqSpec = property_exists($simpleXMLObj,'req_spec'); - if ($isReqSpec) { - foreach($simpleXMLObj->req_spec as $xkm) { - $dummy = $reqSpecMgr->createFromXML($xkm,$importContext->tproject_id,$importContext->req_spec_id, - $importContext->user_id,null,$importOptions); - $items = array_merge($items,$dummy); - } - } else { - $loop2do = count($simpleXMLObj->requirement); - for($kdx=0; $kdx < $loop2do; $kdx++) { - $dummy = $reqMgr->createFromXML($simpleXMLObj->requirement[$kdx],$importContext->tproject_id, - $importContext->req_spec_id,$importContext->user_id,null,$importOptions); - $items = array_merge($items,$dummy); - } - } - return $items; -} - - -/** - * - * - */ -function doReqImportOther(&$reqMgr,$fileName,$importContext,$importOptions) -{ - $impSet = loadImportedReq($fileName, $importContext->importType); - $items = array(); - - if( !is_null($impSet) ) - { - $reqSet = $impSet['info']; - if( ($loop2do=count($reqSet)) ) - { - for($kdx=0; $kdx < $loop2do; $kdx++) - { - $dummy = $reqMgr->createFromMap($reqSet[$kdx],$importContext->tproject_id, - $importContext->req_spec_id, - $importContext->user_id,null,$importOptions); - $items = array_merge($items,$dummy); - } - } - } - return array('items' => $items, 'userFeedback' => $impSet['userFeedback']); -} \ No newline at end of file diff --git a/lib/requirements/reqMonitorOverview.php b/lib/requirements/reqMonitorOverview.php index d5377bfdd5..9703ccc9c8 100644 --- a/lib/requirements/reqMonitorOverview.php +++ b/lib/requirements/reqMonitorOverview.php @@ -1,292 +1,316 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$cfg = getCfg(); - -// manageUserSubscribtion($db,$args); -$smarty = new TLSmarty(); - -if(count($gui->reqIDSet) > 0) -{ - $pathCache = null; - $imgSet = $smarty->getImages(); - - // get type and status labels - $lbl = getLabels($cfg->req); - $reqSet = $req_mgr->getByIDBulkLatestVersionRevision($gui->reqIDSet,array('outputFormat' => 'mapOfArray')); - $onClick = buildOnClick($args,$lbl['mixed'],$imgSet); - - if( $args->req_id > 0 ) - { - $vk = array_flip(array('on','off')); - if( isset($vk[$args->action]) ) - { - $m2c = 'monitor' . ucfirst($args->action); - $req_mgr->$m2c($args->req_id,$args->userID,$args->tproject_id); - } - } - - // array to gather table data row per row - $rows = array(); - - $monitoredSet = $req_mgr->getMonitoredByUser($args->userID,$args->tproject_id); - - foreach($gui->reqIDSet as $id) - { - $req = $reqSet[$id][0]; - - // create the link to display - $title = htmlentities($req['req_doc_id'], ENT_QUOTES, $cfg->charset) . $cfg->glue_char . - htmlentities($req['title'], ENT_QUOTES, $cfg->charset); - - // reqspec-"path" to requirement - if( !isset($pathCache[$req['srs_id']]) ) - { - $path = $req_mgr->tree_mgr->get_path($req['srs_id']); - foreach ($path as $key => $p) - { - $path[$key] = $p['name']; - } - $pathCache[$req['srs_id']] = htmlentities(implode("/", $path), ENT_QUOTES, $cfg->charset); - } - - // get content for each row to display - $result = array(); - $result[] = $pathCache[$req['srs_id']]; - - $edit_link = '' . - ' '; - - $result[] = '' . $edit_link . $title; - - // use html comment to sort properly by this columns (extjs) - $result[] = "" . - localizeTimeStamp($req['creation_ts'],$cfg->datetime) . " ({$req['author']})"; - - $action = 'on'; - foreach($monitoredSet as $monReqID => $dummy) - { - if($req["id"] == $monReqID) - { - $action = 'off'; - break; - } - } - $result[] = $onClick[$action]['open'] . $req["id"] . - $onClick[$action]['close']; - - $rows[] = $result; - } - - - - - - // -------------------------------------------------------------------------------------------------- - // Construction of EXT-JS table starts here - if(($gui->row_qty = count($rows)) > 0 ) - { - - /** - * get column header titles for the table - * - * IMPORTANT: - * the order of following items in this array has to be - * the same as row content above!!! - * - * should be: - * 1. path, 2. title, 3. created_on, 4. monitor - */ - $columns = array(); - $columns[] = array('title_key' => 'req_spec_short', 'width' => 150); - $columns[] = array('title_key' => 'title', 'width' => 150); - $columns[] = array('title_key' => 'created_on', 'width' => 100); - $columns[] = array('title_key' => 'monitor', 'width' => 100); - - // create table object, fill it with columns and row data and give it a title - $matrix = new tlExtTable($columns, $rows, 'tl_table_req_overview'); - $matrix->title = $lbl['mixed']['requirements']; - - // group by Req Spec - $matrix->setGroupByColumnName($lbl['mixed']['req_spec_short']); - - // sort by coverage descending if enabled, otherwise by status - $sort_name = ($cfg->req->expected_coverage_management) ?$lbl['mixed']['th_coverage'] : $lbl['mixed']['status']; - $matrix->setSortByColumnName($sort_name); - $matrix->sortDirection = 'DESC'; - - // define toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - $matrix->toolbarRefreshButton = true; - $matrix->showGroupItemsCount = true; - - // show custom field content in multiple lines - $matrix->addCustomBehaviour('text', array('render' => 'columnWrap')); - $gui->tableSet= array($matrix); - } - -} - - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * initialize user input - * - * @param resource &$tproject_mgr reference to testproject manager - * @return array $args array with user input information - */ -function init_args(&$tproject_mgr) -{ - $args = new stdClass(); - - $i2get = array("tproject_id" => array(tlInputParameter::INT_N), - "req_id" => array(tlInputParameter::INT_N), - "action" => array(tlInputParameter::STRING_N,2,3)); - - $args = new stdClass(); - R_PARAMS($i2get,$args); - - if( $args->tproject_id <= 0 ) - { - throw new Exception("Test project is mandatory", 1); - } - - $item = $tproject_mgr->get_by_id($args->tproject_id); - $args->tproject_name = $item['name']; - - - $args->req_id = intval($args->req_id); - $args->userID = $_SESSION['currentUser']->dbID; - - return $args; -} - - -/** - * initialize GUI - * - * @param stdClass $argsObj reference to user input - * @return stdClass $gui gui data - */ -function initializeGui(&$argsObj,&$tprojectMgr) -{ - $gui = new stdClass(); - - $gui->pageTitle = lang_get('caption_req_monitor_overview'); - $gui->tproject_name = $argsObj->tproject_name; - $gui->tableSet = null; - $gui->reqIDSet = $tprojectMgr->get_all_requirement_ids($argsObj->tproject_id); - - return $gui; -} - - -/** - * - */ -function getCfg() -{ - $cfg = new stdClass(); - $cfg->glue_char = config_get('gui_title_separator_1'); - $cfg->charset = config_get('charset'); - $cfg->req = config_get('req_cfg'); - $cfg->date = config_get('date_format'); - $cfg->datetime = config_get('timestamp_format'); - - return $cfg; -} - - -/** - * - */ -function getLabels($reqCfg) -{ - $lbl = array(); - - $l2get = array('no' => 'No', 'yes' => 'Yes', - 'not_aplicable' => null,'never' => null, - 'req_spec_short' => null,'title' => null, - 'version' => null, 'th_coverage' => null, - 'frozen' => null, 'type'=> null, - 'status' => null,'th_relations' => null, - 'requirements' => null,'number_of_reqs' => null, - 'number_of_versions' => null, - 'requirement' => null, 'monitor' => null, - 'version_revision_tag' => null, - 'week_short' => 'calendar_week_short', - 'on2off' => 'on_turn_off', 'off2on' => 'off_turn_on'); - - $lbl['mixed'] = init_labels($l2get); - $lbl['type'] = init_labels($reqCfg->type_labels); - $lbl['status'] = init_labels($reqCfg->status_labels); - - return $lbl; -} - -/** - * - */ -function buildOnClick($args,$lbl,$imgSet) -{ - $ret = array(); - $ret['off']['open'] = '

    tproject_id}&req_id="; - $ret['off']['close'] = '">
    '; - - $ret['on']['open'] = str_replace('=off','=on',$ret['off']['open']); - $ret['on']['close'] = '">'; - - - return $ret; -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$cfg = getCfg(); + +$smarty = new TLSmarty(); + +if (! empty($gui->reqIDSet)) { + $pathCache = null; + $imgSet = $smarty->getImages(); + + // get type and status labels + $lbl = getLabels($cfg->req); + $reqSet = $req_mgr->getByIDBulkLatestVersionRevision($gui->reqIDSet, + array( + 'outputFormat' => 'mapOfArray' + )); + $onClick = buildOnClick($args, $lbl['mixed'], $imgSet); + + if ($args->req_id > 0) { + $vk = array_flip(array( + 'on', + 'off' + )); + if (isset($vk[$args->action])) { + $m2c = 'monitor' . ucfirst($args->action); + $req_mgr->$m2c($args->req_id, $args->userID, $args->tproject_id); + } + } + + // array to gather table data row per row + $rows = array(); + + $monitoredSet = $req_mgr->getMonitoredByUser($args->userID, + $args->tproject_id); + + foreach ($gui->reqIDSet as $id) { + $req = $reqSet[$id][0]; + + // create the link to display + $title = htmlentities($req['req_doc_id'], ENT_QUOTES, $cfg->charset) . + $cfg->glue_char . + htmlentities($req['title'], ENT_QUOTES, $cfg->charset); + + // reqspec-"path" to requirement + if (! isset($pathCache[$req['srs_id']])) { + $path = $req_mgr->tree_mgr->get_path($req['srs_id']); + foreach ($path as $key => $p) { + $path[$key] = $p['name']; + } + $pathCache[$req['srs_id']] = htmlentities(implode("/", $path), + ENT_QUOTES, $cfg->charset); + } + + // get content for each row to display + $result = array(); + $result[] = $pathCache[$req['srs_id']]; + + $edit_link = '' . ' '; + + $result[] = '' . $edit_link . $title; + + // use html comment to sort properly by this columns (extjs) + $result[] = "" . + localizeTimeStamp($req['creation_ts'], $cfg->datetime) . + " ({$req['author']})"; + + $action = 'on'; + if (! empty($monitoredSet)) { + foreach ($monitoredSet as $monReqID => $dummy) { + if ($req["id"] == $monReqID) { + $action = 'off'; + break; + } + } + } + $result[] = $onClick[$action]['open'] . $req["id"] . + $onClick[$action]['close']; + + $rows[] = $result; + } + + // Construction of EXT-JS table starts here + if (($gui->row_qty = count($rows)) > 0) { + + /** + * get column header titles for the table + * + * IMPORTANT: + * the order of following items in this array has to be + * the same as row content above!!! + * + * should be: + * 1. path, 2. title, 3. created_on, 4. monitor + */ + $columns = array(); + $columns[] = array( + 'title_key' => 'req_spec_short', + 'width' => 150 + ); + $columns[] = array( + 'title_key' => 'title', + 'width' => 150 + ); + $columns[] = array( + 'title_key' => 'created_on', + 'width' => 100 + ); + $columns[] = array( + 'title_key' => 'monitor', + 'width' => 100 + ); + + // create table object, fill it with columns and row data and give it a title + $matrix = new tlExtTable($columns, $rows, 'tl_table_req_overview'); + $matrix->title = $lbl['mixed']['requirements']; + + // group by Req Spec + $matrix->setGroupByColumnName($lbl['mixed']['req_spec_short']); + + // sort by coverage descending if enabled, otherwise by status + $sort_name = ($cfg->req->expected_coverage_management) ? $lbl['mixed']['th_coverage'] : $lbl['mixed']['status']; + $matrix->setSortByColumnName($sort_name); + $matrix->sortDirection = 'DESC'; + + // define toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + $matrix->toolbarRefreshButton = true; + $matrix->showGroupItemsCount = true; + + // show custom field content in multiple lines + $matrix->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $gui->tableSet = array( + $matrix + ); + } +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * initialize user input + * + * @param + * resource &$tproject_mgr reference to testproject manager + * @return array $args array with user input information + */ +function initArgs(&$tproject_mgr) +{ + $i2get = array( + "tproject_id" => array( + tlInputParameter::INT_N + ), + "req_id" => array( + tlInputParameter::INT_N + ), + "action" => array( + tlInputParameter::STRING_N, + 2, + 3 + ) + ); + + $args = new stdClass(); + R_PARAMS($i2get, $args); + + if ($args->tproject_id <= 0) { + throw new Exception("Test project is mandatory", 1); + } + + $item = $tproject_mgr->get_by_id($args->tproject_id); + $args->tproject_name = $item['name']; + + $args->req_id = intval($args->req_id); + $args->userID = $_SESSION['currentUser']->dbID; + + return $args; +} + +/** + * initialize GUI + * + * @param stdClass $argsObj + * reference to user input + * @return stdClass $gui gui data + */ +function initializeGui(&$argsObj, &$tprojectMgr) +{ + $gui = new stdClass(); + + $gui->pageTitle = lang_get('caption_req_monitor_overview'); + $gui->tproject_name = $argsObj->tproject_name; + $gui->tableSet = null; + $gui->reqIDSet = $tprojectMgr->get_all_requirement_ids( + $argsObj->tproject_id); + + return $gui; +} + +/** + */ +function getCfg() +{ + $cfg = new stdClass(); + $cfg->glue_char = config_get('gui_title_separator_1'); + $cfg->charset = config_get('charset'); + $cfg->req = config_get('req_cfg'); + $cfg->date = config_get('date_format'); + $cfg->datetime = config_get('timestamp_format'); + + return $cfg; +} + +/** + */ +function getLabels($reqCfg) +{ + $lbl = array(); + + $l2get = array( + 'no' => 'No', + 'yes' => 'Yes', + 'not_aplicable' => null, + 'never' => null, + 'req_spec_short' => null, + 'title' => null, + 'version' => null, + 'th_coverage' => null, + 'frozen' => null, + 'type' => null, + 'status' => null, + 'th_relations' => null, + 'requirements' => null, + 'number_of_reqs' => null, + 'number_of_versions' => null, + 'requirement' => null, + 'monitor' => null, + 'version_revision_tag' => null, + 'week_short' => 'calendar_week_short', + 'on2off' => 'on_turn_off', + 'off2on' => 'off_turn_on' + ); + + $lbl['mixed'] = init_labels($l2get); + $lbl['type'] = init_labels($reqCfg->type_labels); + $lbl['status'] = init_labels($reqCfg->status_labels); + + return $lbl; +} + +/** + */ +function buildOnClick($args, $lbl, $imgSet) +{ + $ret = array(); + $ret['off']['open'] = '
    tproject_id}&req_id="; + $ret['off']['close'] = '">
    '; + + $ret['on']['open'] = str_replace('=off', '=on', $ret['off']['open']); + $ret['on']['close'] = '">'; + + return $ret; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/requirements/reqOverview.php b/lib/requirements/reqOverview.php index ad7ab349d7..7c2e1d26d4 100644 --- a/lib/requirements/reqOverview.php +++ b/lib/requirements/reqOverview.php @@ -1,412 +1,480 @@ -tproject_id = $args->tproject_id; -checkRights($db,$args->user,$ctx); - -$gui->reqIDs = $tproject_mgr->get_all_requirement_ids($args->tproject_id); - -$smarty = new TLSmarty(); -if(count($gui->reqIDs) > 0) { - $chronoStart = microtime(true); - - $pathCache = null; - $imgSet = $smarty->getImages(); - $gui->warning_msg = ''; - - // get type and status labels - $type_labels = init_labels($cfg->req->type_labels); - $status_labels = init_labels($cfg->req->status_labels); - - $labels2get = array('no' => 'No', 'yes' => 'Yes', - 'not_aplicable' => null,'never' => null, - 'req_spec_short' => null,'title' => null, - 'version' => null, 'th_coverage' => null, - 'frozen' => null, 'type'=> null,'status' => null, - 'th_relations' => null, 'requirements' => null, - 'number_of_reqs' => null, 'number_of_versions' => null, - 'requirement' => null, - 'version_revision_tag' => null, - 'week_short' => 'calendar_week_short'); - - $labels = init_labels($labels2get); - - $gui->cfields4req = (array)$cfield_mgr->get_linked_cfields_at_design($args->tproject_id, 1, null, 'requirement', null, 'name'); - $gui->processCF = count($gui->cfields4req) > 0; - - - $coverageSet = null; - $relationCounters = null; - - $version_option = $args->all_versions ? requirement_mgr::ALL_VERSIONS : requirement_mgr::LATEST_VERSION; - if( $version_option == requirement_mgr::LATEST_VERSION ) { - $reqSet = $req_mgr->getByIDBulkLatestVersionRevision($gui->reqIDs,array('outputFormat' => 'mapOfArray')); - } - else { - $reqSet = $req_mgr->get_by_id($gui->reqIDs, $version_option,null,array('output_format' => 'mapOfArray')); - } - - // conditions to generate reqVersion Set - // having this set, is useful to try to improve performance - // to get Custom Fields when req qty > 2000 - // - if ( $cfg->req->expected_coverage_management || - $gui->processCF ) { - $xSet = array_keys($reqSet); - - foreach($xSet as $rqID) { - $reqVersionSet[] = $reqSet[$rqID][0]['version_id']; - } - } - - if($cfg->req->expected_coverage_management) { - - $coverageSet = $req_mgr->getLatestReqVersionCoverageCounterSet($reqVersionSet); - } - - if($cfg->req->relations->enable) { - $relationCounters = $req_mgr->getRelationsCounters($gui->reqIDs); - } - - if ($gui->processCF) { - // get custom field values bulk - $cfByReqVer = (array)$req_mgr->get_linked_cfields(null,$reqVersionSet,$args->tproject_id,array('access_key' => 'node_id')); - } - - - // array to gather table data row per row - $rows = array(); - - foreach($gui->reqIDs as $id) { - - $req = $reqSet[$id]; - - // create the link to display - $title = htmlentities($req[0]['req_doc_id'], ENT_QUOTES, $cfg->charset) . - $cfg->glue_char . - htmlentities($req[0]['title'], ENT_QUOTES, $cfg->charset); - - // reqspec-"path" to requirement - if( !isset($pathCache[$req[0]['srs_id']]) ) { - $path = $req_mgr->tree_mgr->get_path($req[0]['srs_id']); - foreach ($path as $key => $p) { - $path[$key] = $p['name']; - } - $pathCache[$req[0]['srs_id']] = htmlentities(implode("/", $path), ENT_QUOTES, $cfg->charset); - } - - - # get all cfield ids we have columns for in the req overview - $cfield_ids = array(); - foreach ($gui->cfields4req as $cf){ - $cfield_ids[] = $cf['id']; - } - - - foreach($req as $version) { - // get content for each row to display - $result = array(); - - /** - * IMPORTANT: - * the order of following items in this array has to be - * the same as column headers are below!!! - * - * should be: - * 1. path - * 2. title - * 3. version - * 4. frozen (is_open attribute) - * 5. coverage (if enabled) - * 6. type - * 7. status - * 8. relations (if enabled) - * 9. all custom fields in order of $fields - */ - - $result[] = $pathCache[$req[0]['srs_id']]; - - $edit_link = '' . - ' '; - - $result[] = '' . $edit_link . $title; - - // version and revision number - // $version_revision = sprintf($labels['version_revision_tag'],$version['version'],$version['revision']); - // $padded_data = sprintf("%05d%05d", $version['version'], $version['revision']); - - // use html comment to sort properly by this column (extjs) - // USE CARVED IN THE STONE [vxxsyy] to save function calls. - $result[] = "" . - "[v{$version['version']}r{$version['revision']}]"; - - // use html comment to sort properly by this columns (extjs) - $result[] = "" . localizeTimeStamp($version['creation_ts'],$cfg->datetime) . - " ({$version['author']})"; - - // 20140914 - - // Because we can do this logic thoundands of times, I suppose it will cost less - // to do not use my other approach of firts assigning instead of using else. - // - // use html comment to sort properly by this column (extjs) - if( !is_null($version['modification_ts']) && ($version['modification_ts'] != $cfg->neverModifiedTS) ) { - $result[] = "" . localizeTimeStamp($version['modification_ts'],$cfg->datetime) . - " ({$version['modifier']})"; - } - else { - $result[] = "" . $labels['never']; - } - - - // is it frozen? - $result[] = ($version['is_open']) ? $labels['no'] : $labels['yes']; - - // coverage - // use html comment to sort properly by this columns (extjs) - if($cfg->req->expected_coverage_management) { - $tc_coverage = isset($coverageSet[$id]) ? $coverageSet[$id]['qty'] : 0; - $expected = $version['expected_coverage']; - $coverage_string = "" . $labels['not_aplicable'] . " ($tc_coverage/0)"; - if ($expected > 0) { - $percentage = round(100 / $expected * $tc_coverage, 2); - $padded_data = sprintf("%010d", $percentage); //bring all percentages to same length - $coverage_string = " {$percentage}% ({$tc_coverage}/{$expected})"; - } - $result[] = $coverage_string; - } - - $result[] = isset($type_labels[$version['type']]) ? $type_labels[$version['type']] : ''; - $result[] = isset($status_labels[$version['status']]) ? $status_labels[$version['status']] : ''; - - if ($cfg->req->relations->enable) { - $rx = isset($relationCounters[$id]) ? $relationCounters[$id] : 0; - $result[] = "" . $rx; - } - - #8792: append one item to $result for every displayed column (no content?: append empty string) - if($gui->processCF) { - $linkedCFWithContent = array(); - if ( isset($cfByReqVer[$version['version_id']])) { - $linkedCFWithContent = $cfByReqVer[$version['version_id']]; - } - - foreach ($cfield_ids as $cf_id) { - if (isset($linkedCFWithContent[$cf_id])) { - $cf = $linkedCFWithContent[$cf_id]; - $verbose_type = $req_mgr->cfield_mgr->custom_field_types[$cf['type']]; - $value = preg_replace('!\s+!', ' ', htmlspecialchars($cf['value'], ENT_QUOTES, $cfg->charset)); - if( ($verbose_type == 'date' || $verbose_type == 'datetime') && is_numeric($value) && $value != 0 ) { - $value = @strftime( $cfg->$verbose_type . " ({$labels['week_short']} %W)" , $value); #fix typo: missing 's' in labels - } - $result[] = $value; - } - else { - $result[] = ''; - continue; - } - } - } - - $rows[] = $result; - } - } - - // -------------------------------------------------------------------- - // Construction of EXT-JS table starts here - if(($gui->row_qty = count($rows)) > 0 ) { - $version_string = ($args->all_versions) ? $labels['number_of_versions'] : $labels['number_of_reqs']; - $gui->pageTitle .= " - " . $version_string . ": " . $gui->row_qty; - - /** - * get column header titles for the table - * - * IMPORTANT: - * the order of following items in this array has to be - * the same as row content above!!! - * - * should be: - * 1. path - * 2. title - * 3. version - * 4. frozen - * 5. coverage (if enabled) - * 6. type - * 7. status - * 8. relations (if enabled) - * 9. then all custom fields in order of $fields - */ - $columns = array(); - $columns[] = array('title_key' => 'req_spec_short', 'width' => 200); - $columns[] = array('title_key' => 'title', 'width' => 150); - $columns[] = array('title_key' => 'version', 'width' => 30); - $columns[] = array('title_key' => 'created_on', 'width' => 55); - $columns[] = array('title_key' => 'modified_on','width' => 55); - - $frozen_for_filter = array($labels['yes'],$labels['no']); - $columns[] = array('title_key' => 'frozen', 'width' => 30, 'filter' => 'list', - 'filterOptions' => $frozen_for_filter); - - if($cfg->req->expected_coverage_management) { - $columns[] = array('title_key' => 'th_coverage', 'width' => 80); - } - - $columns[] = array('title_key' => 'type', 'width' => 60, 'filter' => 'list', - 'filterOptions' => $type_labels); - $columns[] = array('title_key' => 'status', 'width' => 60, 'filter' => 'list', - 'filterOptions' => $status_labels); - - if ($cfg->req->relations->enable) { - $columns[] = array('title_key' => 'th_relations', 'width' => 50, 'filter' => 'numeric'); - } - - foreach($gui->cfields4req as $cf) { - $columns[] = array('title' => htmlentities($cf['label'], ENT_QUOTES, $cfg->charset), 'type' => 'text', - 'col_id' => 'id_cf_' .$cf['name']); - } - - // create table object, fill it with columns and row data and give it a title - $matrix = new tlExtTable($columns, $rows, 'tl_table_req_overview'); - $matrix->title = $labels['requirements']; - - // group by Req Spec - $matrix->setGroupByColumnName($labels['req_spec_short']); - - // sort by coverage descending if enabled, otherwise by status - $sort_name = ($cfg->req->expected_coverage_management) ? $labels['th_coverage'] : $labels['status']; - $matrix->setSortByColumnName($sort_name); - $matrix->sortDirection = 'DESC'; - - // define toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - $matrix->toolbarRefreshButton = true; - $matrix->showGroupItemsCount = true; - - // show custom field content in multiple lines - $matrix->addCustomBehaviour('text', array('render' => 'columnWrap')); - $gui->tableSet= array($matrix); - } - - $chronoStop = microtime(true); - $gui->elapsedSeconds = round($chronoStop - $chronoStart); -} - - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * initialize user input - * - * @param resource &$tproject_mgr reference to testproject manager - * @return array $args array with user input information - */ -function init_args(&$tproject_mgr) { - $args = new stdClass(); - $args->user = isset($_SESSION['currentUser']) - ? $_SESSION['currentUser'] : null; - - $all_versions = isset($_REQUEST['all_versions']) ? true : false; - $all_versions_hidden = isset($_REQUEST['all_versions_hidden']) ? true : false; - if ($all_versions) { - $selection = true; - } else if ($all_versions_hidden) { - $selection = false; - } else if (isset($_SESSION['all_versions'])) { - $selection = $_SESSION['all_versions']; - } else { - $selection = false; - } - $args->all_versions = $_SESSION['all_versions'] = $selection; - - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - if($args->tproject_id > 0) { - $tproject_info = $tproject_mgr->get_by_id($args->tproject_id); - $args->tproject_name = $tproject_info['name']; - $args->tproject_description = $tproject_info['notes']; - } - - return $args; -} - - -/** - * initialize GUI - * - * @param stdClass $argsObj reference to user input - * @return stdClass $gui gui data - */ -function init_gui(&$argsObj) { - $gui = new stdClass(); - - $gui->pageTitle = lang_get('caption_req_overview'); - $gui->warning_msg = lang_get('no_linked_req'); - $gui->tproject_name = $argsObj->tproject_name; - $gui->all_versions = $argsObj->all_versions; - $gui->tableSet = null; - - return $gui; -} - - -/** - * - */ -function getCfg() { - $cfg = new stdClass(); - $cfg->glue_char = config_get('gui_title_separator_1'); - $cfg->charset = config_get('charset'); - $cfg->req = config_get('req_cfg'); - $cfg->date = config_get('date_format'); - $cfg->datetime = config_get('timestamp_format'); - - // on requirement creation motification timestamp is set to default value "0000-00-00 00:00:00" - $cfg->neverModifiedTS = "0000-00-00 00:00:00"; - - // $cfg->req->expected_coverage_management = FALSE; // FORCED FOR TEST - - return $cfg; -} - -/** - * - */ -function checkRights(&$db, &$user, $context) -{ - $context->rightsOr = ["mgt_view_req"]; - $context->rightsAnd = []; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $args->user, $ctx); + +$gui->reqIDs = $tproject_mgr->get_all_requirement_ids($args->tproject_id); + +$smarty = new TLSmarty(); +if (count($gui->reqIDs) > 0) { + $chronoStart = microtime(true); + + $pathCache = null; + $imgSet = $smarty->getImages(); + $gui->warning_msg = ''; + + // get type and status labels + $type_labels = init_labels($cfg->req->type_labels); + $status_labels = init_labels($cfg->req->status_labels); + + $labels2get = array( + 'no' => 'No', + 'yes' => 'Yes', + 'not_aplicable' => null, + 'never' => null, + 'req_spec_short' => null, + 'title' => null, + 'version' => null, + 'th_coverage' => null, + 'frozen' => null, + 'type' => null, + 'status' => null, + 'th_relations' => null, + 'requirements' => null, + 'number_of_reqs' => null, + 'number_of_versions' => null, + 'requirement' => null, + 'version_revision_tag' => null, + 'week_short' => 'calendar_week_short' + ); + + $labels = init_labels($labels2get); + + $gui->cfields4req = (array) $cfield_mgr->get_linked_cfields_at_design( + $args->tproject_id, 1, null, 'requirement', null, 'name'); + $gui->processCF = count($gui->cfields4req) > 0; + + $coverageSet = null; + $relationCounters = null; + + $version_option = $args->all_versions ? requirement_mgr::ALL_VERSIONS : requirement_mgr::LATEST_VERSION; + if ($version_option == requirement_mgr::LATEST_VERSION) { + $reqSet = $req_mgr->getByIDBulkLatestVersionRevision($gui->reqIDs, + array( + 'outputFormat' => 'mapOfArray' + )); + } else { + $reqSet = $req_mgr->get_by_id($gui->reqIDs, $version_option, null, + array( + 'output_format' => 'mapOfArray' + )); + } + + // conditions to generate reqVersion Set + // having this set, is useful to try to improve performance + // to get Custom Fields when req qty > 2000 + // + if ($cfg->req->expected_coverage_management || $gui->processCF) { + $xSet = array_keys($reqSet); + + foreach ($xSet as $rqID) { + $reqVersionSet[] = $reqSet[$rqID][0]['version_id']; + } + } + + if ($cfg->req->expected_coverage_management) { + + $coverageSet = $req_mgr->getLatestReqVersionCoverageCounterSet( + $reqVersionSet); + } + + if ($cfg->req->relations->enable) { + $relationCounters = $req_mgr->getRelationsCounters($gui->reqIDs); + } + + if ($gui->processCF) { + // get custom field values bulk + $cfByReqVer = (array) $req_mgr->get_linked_cfields(null, $reqVersionSet, + $args->tproject_id, array( + 'access_key' => 'node_id' + )); + } + + // array to gather table data row per row + $rows = array(); + + foreach ($gui->reqIDs as $id) { + + $req = $reqSet[$id]; + + // create the link to display + $title = htmlentities($req[0]['req_doc_id'], ENT_QUOTES, $cfg->charset) . + $cfg->glue_char . + htmlentities($req[0]['title'], ENT_QUOTES, $cfg->charset); + + // reqspec-"path" to requirement + if (! isset($pathCache[$req[0]['srs_id']])) { + $path = $req_mgr->tree_mgr->get_path($req[0]['srs_id']); + foreach ($path as $key => $p) { + $path[$key] = $p['name']; + } + $pathCache[$req[0]['srs_id']] = htmlentities(implode("/", $path), + ENT_QUOTES, $cfg->charset); + } + + # get all cfield ids we have columns for in the req overview + $cfield_ids = array(); + foreach ($gui->cfields4req as $cf) { + $cfield_ids[] = $cf['id']; + } + + foreach ($req as $version) { + // get content for each row to display + $result = array(); + + /** + * IMPORTANT: + * the order of following items in this array has to be + * the same as column headers are below!!! + * + * should be: + * 1. path + * 2. title + * 3. version + * 4. frozen (is_open attribute) + * 5. coverage (if enabled) + * 6. type + * 7. status + * 8. relations (if enabled) + * 9. all custom fields in order of $fields + */ + + $result[] = $pathCache[$req[0]['srs_id']]; + + $edit_link = '' . ' '; + + $result[] = '' . $edit_link . $title; + + // version and revision number + // $version_revision = sprintf($labels['version_revision_tag'],$version['version'],$version['revision']); + // $padded_data = sprintf("%05d%05d", $version['version'], $version['revision']); + + // use html comment to sort properly by this column (extjs) + // USE CARVED IN THE STONE [vxxsyy] to save function calls. + $result[] = "" . "[v{$version['version']}r{$version['revision']}]"; + + // use html comment to sort properly by this columns (extjs) + $result[] = "" . + localizeTimeStamp($version['creation_ts'], $cfg->datetime) . + " ({$version['author']})"; + + // 20140914 - + // Because we can do this logic thoundands of times, I suppose it will cost less + // to do not use my other approach of firts assigning instead of using else. + // + // use html comment to sort properly by this column (extjs) + if (! is_null($version['modification_ts']) && + ($version['modification_ts'] != $cfg->neverModifiedTS)) { + $result[] = "" . + localizeTimeStamp($version['modification_ts'], + $cfg->datetime) . " ({$version['modifier']})"; + } else { + $result[] = "" . $labels['never']; + } + + // is it frozen? + $result[] = ($version['is_open']) ? $labels['no'] : $labels['yes']; + + // coverage + // use html comment to sort properly by this columns (extjs) + if ($cfg->req->expected_coverage_management) { + $tc_coverage = isset($coverageSet[$id]) ? $coverageSet[$id]['qty'] : 0; + $expected = $version['expected_coverage']; + $coverage_string = "" . $labels['not_aplicable'] . + " ($tc_coverage/0)"; + if ($expected > 0) { + $percentage = round(100 / $expected * $tc_coverage, 2); + $padded_data = sprintf("%010d", $percentage); // bring all percentages to same length + $coverage_string = " {$percentage}% ({$tc_coverage}/{$expected})"; + } + $result[] = $coverage_string; + } + + $result[] = isset($type_labels[$version['type']]) ? $type_labels[$version['type']] : ''; + $result[] = isset($status_labels[$version['status']]) ? $status_labels[$version['status']] : ''; + + if ($cfg->req->relations->enable) { + $rx = isset($relationCounters[$id]) ? $relationCounters[$id] : 0; + $result[] = "" . $rx; + } + + # 8792: append one item to $result for every displayed column (no content?: append empty string) + if ($gui->processCF) { + $linkedCFWithContent = array(); + if (isset($cfByReqVer[$version['version_id']])) { + $linkedCFWithContent = $cfByReqVer[$version['version_id']]; + } + + foreach ($cfield_ids as $cf_id) { + if (isset($linkedCFWithContent[$cf_id])) { + $cf = $linkedCFWithContent[$cf_id]; + $verbose_type = $req_mgr->cfield_mgr->custom_field_types[$cf['type']]; + $value = preg_replace('!\s+!', ' ', + htmlspecialchars($cf['value'], ENT_QUOTES, + $cfg->charset)); + if (($verbose_type == 'date' || + $verbose_type == 'datetime') && is_numeric($value) && + $value != 0) { + $value = @strftime( + $cfg->$verbose_type . + " ({$labels['week_short']} %W)", $value); # fix typo: missing 's' in labels + } + $result[] = $value; + } else { + $result[] = ''; + } + } + } + + $rows[] = $result; + } + } + + // Construction of EXT-JS table starts here + if (($gui->row_qty = count($rows)) > 0) { + $version_string = ($args->all_versions) ? $labels['number_of_versions'] : $labels['number_of_reqs']; + $gui->pageTitle .= " - " . $version_string . ": " . $gui->row_qty; + + /** + * get column header titles for the table + * + * IMPORTANT: + * the order of following items in this array has to be + * the same as row content above!!! + * + * should be: + * 1. path + * 2. title + * 3. version + * 4. frozen + * 5. coverage (if enabled) + * 6. type + * 7. status + * 8. relations (if enabled) + * 9. then all custom fields in order of $fields + */ + $columns = array(); + $columns[] = array( + 'title_key' => 'req_spec_short', + 'width' => 200 + ); + $columns[] = array( + 'title_key' => 'title', + 'width' => 150 + ); + $columns[] = array( + 'title_key' => 'version', + 'width' => 30 + ); + $columns[] = array( + 'title_key' => 'created_on', + 'width' => 55 + ); + $columns[] = array( + 'title_key' => 'modified_on', + 'width' => 55 + ); + + $frozen_for_filter = array( + $labels['yes'], + $labels['no'] + ); + $columns[] = array( + 'title_key' => 'frozen', + 'width' => 30, + 'filter' => 'list', + 'filterOptions' => $frozen_for_filter + ); + + if ($cfg->req->expected_coverage_management) { + $columns[] = array( + 'title_key' => 'th_coverage', + 'width' => 80 + ); + } + + $columns[] = array( + 'title_key' => 'type', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $type_labels + ); + $columns[] = array( + 'title_key' => 'status', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $status_labels + ); + + if ($cfg->req->relations->enable) { + $columns[] = array( + 'title_key' => 'th_relations', + 'width' => 50, + 'filter' => 'numeric' + ); + } + + foreach ($gui->cfields4req as $cf) { + $columns[] = array( + 'title' => htmlentities($cf['label'], ENT_QUOTES, $cfg->charset), + 'type' => 'text', + 'col_id' => 'id_cf_' . $cf['name'] + ); + } + + // create table object, fill it with columns and row data and give it a title + $matrix = new tlExtTable($columns, $rows, 'tl_table_req_overview'); + $matrix->title = $labels['requirements']; + + // group by Req Spec + $matrix->setGroupByColumnName($labels['req_spec_short']); + + // sort by coverage descending if enabled, otherwise by status + $sort_name = ($cfg->req->expected_coverage_management) ? $labels['th_coverage'] : $labels['status']; + $matrix->setSortByColumnName($sort_name); + $matrix->sortDirection = 'DESC'; + + // define toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + $matrix->toolbarRefreshButton = true; + $matrix->showGroupItemsCount = true; + + // show custom field content in multiple lines + $matrix->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $gui->tableSet = array( + $matrix + ); + } + + $chronoStop = microtime(true); + $gui->elapsedSeconds = round($chronoStop - $chronoStart); +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * initialize user input + * + * @param + * resource &$tproject_mgr reference to testproject manager + * @return array $args array with user input information + */ +function initArgs(&$tproject_mgr) +{ + $args = new stdClass(); + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + + $all_versions = isset($_REQUEST['all_versions']) ? true : false; + $all_versions_hidden = isset($_REQUEST['all_versions_hidden']) ? true : false; + if ($all_versions) { + $selection = true; + } elseif ($all_versions_hidden) { + $selection = false; + } elseif (isset($_SESSION['all_versions'])) { + $selection = $_SESSION['all_versions']; + } else { + $selection = false; + } + $args->all_versions = $_SESSION['all_versions'] = $selection; + + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + if ($args->tproject_id > 0) { + $tproject_info = $tproject_mgr->get_by_id($args->tproject_id); + $args->tproject_name = $tproject_info['name']; + $args->tproject_description = $tproject_info['notes']; + } + + return $args; +} + +/** + * initialize GUI + * + * @param stdClass $argsObj + * reference to user input + * @return stdClass $gui gui data + */ +function initGui(&$argsObj) +{ + $gui = new stdClass(); + + $gui->pageTitle = lang_get('caption_req_overview'); + $gui->warning_msg = lang_get('no_linked_req'); + $gui->tproject_name = $argsObj->tproject_name; + $gui->all_versions = $argsObj->all_versions; + $gui->tableSet = null; + + return $gui; +} + +/** + */ +function getCfg() +{ + $cfg = new stdClass(); + $cfg->glue_char = config_get('gui_title_separator_1'); + $cfg->charset = config_get('charset'); + $cfg->req = config_get('req_cfg'); + $cfg->date = config_get('date_format'); + $cfg->datetime = config_get('timestamp_format'); + + // on requirement creation motification timestamp is set to default value "0000-00-00 00:00:00" + $cfg->neverModifiedTS = "0000-00-00 00:00:00"; + + // $cfg->req->expected_coverage_management = FALSE; // FORCED FOR TEST + + return $cfg; +} + +/** + */ +function checkRights(&$db, &$user, $context) +{ + $context->rightsOr = [ + "mgt_view_req" + ]; + $context->rightsAnd = []; + pageAccessCheck($db, $user, $context); } diff --git a/lib/requirements/reqPrint.php b/lib/requirements/reqPrint.php index 0a238c4b98..3dda190d84 100644 --- a/lib/requirements/reqPrint.php +++ b/lib/requirements/reqPrint.php @@ -1,78 +1,87 @@ -get_node_hierarchy_info($args->req_id); -$node['version_id'] = $args->req_version_id; -$node['revision'] = $args->req_revision; - -$gui = new stdClass(); -$gui->object_name=''; -$gui->object_name = $node['name']; -$gui->page_title = sprintf(lang_get('print_requirement'),$node['name']); -$gui->tproject_name=$args->tproject_name; -$gui->tproject_id=$args->tproject_id; -$gui->req_id=$args->req_id; -$gui->req_version_id=$args->req_version_id; -$gui->req_revision=$args->req_revision; - - -// Struture defined in printDocument.php -$options = array('toc' => 0, - 'req_linked_tcs' => 1, 'req_cf' => 1, - 'req_scope' => 1, 'req_relations' => 1, 'req_coverage' => 1, - 'req_status' => 1, 'req_type' => 1,'req_author'=> 1, - 'displayVersion' => 1, 'displayDates' => 1, - 'displayLastEdit' => 1, 'docType' => SINGLE_REQ); - -$text2print = ''; -$text2print .= - renderHTMLHeader($gui->page_title,$_SESSION['basehref'],SINGLE_REQ); - -$text2print .= - renderReqForPrinting($db,$node,$options,null,0,$args->tproject_id); - -echo $text2print; - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() { - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->req_id = isset($_REQUEST['req_id']) ? intval($_REQUEST['req_id']) : 0; - $args->req_version_id = isset($_REQUEST['req_version_id']) ? intval($_REQUEST['req_version_id']) : 0; - $args->req_revision = isset($_REQUEST['req_revision']) ? intval($_REQUEST['req_revision']) : 0; - - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tproject_name = $_SESSION['testprojectName']; - - return $args; +get_node_hierarchy_info($args->req_id); +$node['version_id'] = $args->req_version_id; +$node['revision'] = $args->req_revision; + +$gui = new stdClass(); +$gui->object_name = ''; +$gui->object_name = $node['name']; +$gui->page_title = sprintf(lang_get('print_requirement'), $node['name']); +$gui->tproject_name = $args->tproject_name; +$gui->tproject_id = $args->tproject_id; +$gui->req_id = $args->req_id; +$gui->req_version_id = $args->req_version_id; +$gui->req_revision = $args->req_revision; + +// Struture defined in printDocument.php +$options = array( + 'toc' => 0, + 'req_linked_tcs' => 1, + 'req_cf' => 1, + 'req_scope' => 1, + 'req_relations' => 1, + 'req_coverage' => 1, + 'req_status' => 1, + 'req_type' => 1, + 'req_author' => 1, + 'displayVersion' => 1, + 'displayDates' => 1, + 'displayLastEdit' => 1, + 'docType' => SINGLE_REQ +); + +$text2print = ''; +$text2print .= renderHTMLHeader($gui->page_title, $_SESSION['basehref'], + SINGLE_REQ); +$text2print .= renderReqForPrinting($db, $node, $options, 0, $args->tproject_id); + +echo $text2print; + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->req_id = isset($_REQUEST['req_id']) ? intval($_REQUEST['req_id']) : 0; + $args->req_version_id = isset($_REQUEST['req_version_id']) ? intval( + $_REQUEST['req_version_id']) : 0; + $args->req_revision = isset($_REQUEST['req_revision']) ? intval( + $_REQUEST['req_revision']) : 0; + + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = $_SESSION['testprojectName']; + + return $args; } diff --git a/lib/requirements/reqSearch.php b/lib/requirements/reqSearch.php index f4de572814..2cad00e4cf 100644 --- a/lib/requirements/reqSearch.php +++ b/lib/requirements/reqSearch.php @@ -1,466 +1,519 @@ -initGuiBean(); - -$gui->main_descr = lang_get('caption_search_form_req'); -$gui->warning_msg = ''; -$gui->path_info = null; -$gui->tableSet = null; -$gui->resultSet = []; - -$map = []; -$args = init_args($date_format_cfg); - -$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); -$gui->tcasePrefix .= $tcase_cfg->glue_character; - -if ($args->tprojectID) { - $sql = build_search_sql($db,$args,$gui); - - // key: req id (db id) - // value: array of versions and revisions - // - $map = (array)$db->fetchRowsIntoMap($sql,'id',database::CUMULATIVE); - - // dont show requirements from different testprojects than the selected one - if (count($map)) { - $reqIDSet = array_keys($map); - foreach ($reqIDSet as $item) { - $pid = $tproject_mgr->tree_manager->getTreeRoot($item); - if ($pid != $args->tprojectID) { - unset($map[$item]); - } - } - } +initGuiBean(); + +$gui->main_descr = lang_get('caption_search_form_req'); +$gui->warning_msg = ''; +$gui->path_info = null; +$gui->tableSet = null; +$gui->resultSet = []; + +$map = []; +$args = initArgs($date_format_cfg); + +$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); +$gui->tcasePrefix .= $tcase_cfg->glue_character; + +if ($args->tprojectID) { + $sql = build_search_sql($db, $args, $gui); + + // key: req id (db id) + // value: array of versions and revisions + $map = (array) $db->fetchRowsIntoMap($sql, 'id', database::CUMULATIVE); + + // dont show requirements from different testprojects than the selected one + if (count($map)) { + $reqIDSet = array_keys($map); + foreach ($reqIDSet as $item) { + $pid = $tproject_mgr->tree_manager->getTreeRoot($item); + if ($pid != $args->tprojectID) { + unset($map[$item]); + } + } + } +} + +$smarty = new TLSmarty(); +$gui->row_qty = count($map); +if ($gui->row_qty > 0) { + $gui->resultSet = $map; + if ($gui->row_qty <= $req_cfg->search->max_qty_for_display) { + $req_set = array_keys($map); + $options = array( + 'output_format' => 'path_as_string' + ); + $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose( + $req_set, $options); + } else { + $gui->warning_msg = lang_get('too_wide_search_criteria'); + } +} else { + $gui->warning_msg = lang_get('no_records_found'); +} + +$table = buildExtTable($gui, $charset); + +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$gui->pageTitle = $gui->main_descr . " - " . lang_get('match_count') . ": " . + $gui->row_qty; + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $tpl); + +/** + */ +function buildExtTable($gui, $charset) +{ + $table = null; + $lbl = array( + 'edit' => 'requirement', + 'rev' => 'revision_short', + 'ver' => 'version_short', + 'req_spec' => 'req_spec', + 'requirement' => 'requirement', + 'version_revision_tag' => 'version_revision_tag' + ); + + $labels = init_labels($lbl); + $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; + + // $gui->resultSet - + // key: reqspec_id + // value: array of matches + // array + // { + // [4][0]=>{"name" => "QAZ MNNN","id" => "4","req_doc_id" => "QAZ", + // "version_id" => 5, "version" => 1, + // "revision_id" => -1, "revision" => 2} -> revisio_id < 0 => lives on REQ VERSIONS TABLE + // + // [1]=>{"name" => "QAZ MNNN","id" => "4","req_doc_id" => "QAZ", + // "version_id" => 5, "version" => 1, + // "revision_id" => 6, "revision" => 1} + // ... + // } + // + // + if (count($gui->resultSet) > 0) { + $columns = array(); + + $columns[] = array( + 'title_key' => 'req_spec' + ); + $columns[] = array( + 'title_key' => 'requirement', + 'type' => 'text' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + $key2loop = array_keys($gui->resultSet); + $img = ""; + // req_id, req_version_id + $reqVerHref = '' . + $labels['version_revision_tag'] . ' '; + // req_revision_id + $reqRevHref = '' . + $labels['version_revision_tag'] . ' '; + + foreach ($key2loop as $req_id) { + $rowData = array(); + $itemSet = $gui->resultSet[$req_id]; + $rfx = &$itemSet[0]; + + // We Group by Requirement path + $rowData[] = htmlentities($gui->path_info[$rfx['id']], ENT_QUOTES, + $charset); + + $edit_link = "" . "{$img} "; + $title = htmlentities($rfx['req_doc_id'], ENT_QUOTES, $charset) . ":" . + htmlentities($rfx['name'], ENT_QUOTES, $charset); + + $matches = ''; + foreach ($itemSet as $rx) { + if ($rx['revision_id'] > 0) { + $dummy = sprintf($reqRevHref, $rx['revision_id'], + $rx['version'], $rx['revision']); + } else { + $dummy = sprintf($reqVerHref, $req_id, $rx['version_id'], + $rx['version'], $rx['revision']); + } + $matches .= $dummy; + } + $rowData[] = $edit_link . $title . ' ' . $matches; + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_req_search'); + + $table->setGroupByColumnName($labels['req_spec']); + $table->setSortByColumnName($labels['requirement']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + $table->storeTableState = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + } + return $table; +} + +/* + * function: + * + * args: + * + * returns: + * + */ +function initArgs($dateFormat) +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $strnull = array( + 'requirement_document_id', + 'name', + 'scope', + 'reqStatus', + 'custom_field_value', + 'targetRequirement', + 'creation_date_from', + 'creation_date_to', + 'log_message', + 'modification_date_from', + 'modification_date_to' + ); + + foreach ($strnull as $keyvar) { + $args->$keyvar = isset($_REQUEST[$keyvar]) ? trim($_REQUEST[$keyvar]) : null; + $args->$keyvar = ! is_null($args->$keyvar) && strlen($args->$keyvar) > 0 ? trim( + $args->$keyvar) : null; + } + + $intcheck = array( + 'version', + 'tcid', + 'reqType', + 'relation_type' + ); + foreach ($intcheck as $keyvar) { + $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : null; + } + + $int0 = array( + 'custom_field_id', + 'coverage' + ); + foreach ($int0 as $keyvar) { + $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : 0; + } + + // convert "creation date from" to iso format for database usage + $dk = array( + 'creation_date_from' => ' 00:00:00', + 'creation_date_to' => ' 23:59:59', + 'modification_date_from' => ' 00:00:00', + 'modification_date_to' => ' 23:59:59' + ); + foreach ($dk as $tdk => $hhmmss) { + if (isset($args->$tdk) && trim($args->$tdk) != '') { + $l10ndate = split_localized_date($args->$tdk, $dateFormat); + $args->$tdk = null; + if ($l10ndate != null && is_array($l10ndate)) { + // set date in iso format + $args->$tdk = $l10ndate['year'] . "-" . $l10ndate['month'] . "-" . + $l10ndate['day'] . $hhmmss; + } + } + } + + $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + return $args; +} + +/** + */ +function build_search_sql(&$dbHandler, &$argsObj, &$guiObj) +{ + $tables = tlObjectWithDB::getDBTables( + array( + 'cfield_design_values', + 'nodes_hierarchy', + 'req_specs', + 'req_relations', + 'req_versions', + 'req_revisions', + 'requirements', + 'req_coverage', + 'tcversions' + )); + + // ver => REQ Versions + // rev => REQ Revisions + // Some filters can be applied on REQ Versions & REQ Revisions + // other ONLY on REQ Versions and other ONLY REQ Revisions + // that's why we have developer logic using UNION. + // Using just UNION and not UNION ALL, we will try to remove duplicates + // if possible. + // + // That's why to certain extent filter seems to work in OR mode. + // May be this is a BUG, that was never reported. + $filter = array(); + $filter['ver'] = null; + $filter['rev'] = null; + + // date filters can be build using algorithm + // Need to sanitize!!! 2019 + $date_fields = array( + 'creation_ts' => 'ts', + 'modification_ts' => 'ts' + ); + $date_keys = array( + 'date_from' => '>=', + 'date_to' => '<=' + ); + foreach ($date_fields as $fx => $needle) { + foreach ($date_keys as $fk => $op) { + $fkey = str_replace($needle, $fk, $fx); + if ($argsObj->$fkey) { + $filter['ver'][$fkey] = " AND REQV.$fx $op '{$argsObj->$fkey}' "; + $filter['rev'][$fkey] = " AND REQR.$fx $op '{$argsObj->$fkey}' "; + } + } + } + + // key: args key + // value: map + // key: table field + // value: map + // key: filter scope, will identify with part of SQL affects + // value: table alias + $likeKeys = array( + 'name' => array( + 'name' => array( + 'ver' => "NH_REQ", + 'rev' => "REQR" + ) + ), + 'requirement_document_id' => array( + 'req_doc_id' => array( + 'ver' => 'REQ', + 'rev' => 'REQR' + ) + ), + 'scope' => array( + 'scope' => array( + 'ver' => 'REQV', + 'rev' => 'REQR' + ) + ), + 'log_message' => array( + 'log_message' => array( + 'ver' => 'REQV', + 'rev' => 'REQR' + ) + ) + ); + + foreach ($likeKeys as $key => $fcfg) { + if ($argsObj->$key) { + $value = $dbHandler->prepare_string($argsObj->$key); + $field = key($fcfg); + foreach ($fcfg[$field] as $table => $alias) { + $filter[$table][$field] = " AND {$alias}.{$field} like '%{$value}%' "; + } + } + } + + $char_keys = array( + 'reqType' => array( + 'type' => array( + 'ver' => "REQV", + 'rev' => "REQR" + ) + ), + 'reqStatus' => array( + 'status' => array( + 'ver' => 'REQV', + 'rev' => 'REQR' + ) + ) + ); + + foreach ($char_keys as $key => $fcfg) { + if ($argsObj->$key) { + $value = $dbHandler->prepare_string($argsObj->$key); + $field = key($fcfg); + foreach ($fcfg[$field] as $table => $alias) { + $filter[$table][$field] = " AND {$alias}.{$field} = '{$value}' "; + } + } + } + + if ($argsObj->version) { + $version = $dbHandler->prepare_int($argsObj->version); + $filter['ver']['version'] = " AND REQV.version = {$version} "; + $filter['rev']['version'] = $filter['ver']['version']; + } + + if ($argsObj->coverage) { + // search by expected coverage of testcases + $coverage = $dbHandler->prepare_int($argsObj->coverage); + $filter['ver']['coverage'] = " AND REQV.expected_coverage = {$coverage} "; + $filter['rev']['coverage'] = " AND REQR.expected_coverage = {$coverage} "; + } + + // Complex processing + if (! is_null($argsObj->relation_type) && intval($argsObj->relation_type) > 0) { + // search by relation type + // $argsObj->relation_type is a string in following form + // e.g. 3_destination or 2_source or only 4 + // must be treated different + $dummy = explode('_', $argsObj->relation_type); + $rel_type = $dummy[0]; + $side = isset($dummy[1]) ? " RR.{$dummy[1]}_id = NH_REQ.id " : " RR.source_id = NH_REQ.id OR RR.destination_id = NH_REQ.id "; + + $from['ver']['relation_type'] = " JOIN {$tables['req_relations']} RR " . + " ON ($side) AND RR.relation_type = {$rel_type} "; + $from['rev']['relation_type'] = $from['ver']['relation_type']; + } + + if ($argsObj->custom_field_id > 0) { + $cfield_id = $dbHandler->prepare_string($argsObj->custom_field_id); + $cfield_value = $dbHandler->prepare_string($argsObj->custom_field_value); + $from['ver']['custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id = REQV.id "; + + $from['rev']['custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id = REQR.id "; + + $filter['ver']['custom_field'] = " AND CFD.field_id = {$cfield_id} " . + " AND CFD.value like '%{$cfield_value}%' "; + + $filter['rev']['custom_field'] = $filter['ver']['custom_field']; + } + + if ($argsObj->tcid != "" && strcmp($argsObj->tcid, $guiObj->tcasePrefix) != 0) { + // search for reqs linked to this testcase + $tcid = $dbHandler->prepare_string($argsObj->tcid); + $tcid = str_replace($guiObj->tcasePrefix, "", $tcid); + + $filter['ver']['tcid'] = " AND TCV.tc_external_id = '$tcid' "; + $filter['rev']['tcid'] = $filter['ver']['tcid']; + + $from['ver']['tcid'] = " /* 1.9.18 Changed */ " . + " /* Look for Req Coverage info */ " . + " JOIN {$tables['req_coverage']} RC ON RC.req_version_id = NH_REQV.id " . + + " /* 1.9.18 Changed */ " . + " /* Need Test case children => test case versions */ " . + " JOIN {$tables['nodes_hierarchy']} NH_TCV + ON NH_TCV.id = RC.tcversion_id " . + + " /* Needed to search using External ID */ " . + " JOIN {$tables['tcversions']} TCV ON TCV.id = NH_TCV.id "; + + $from['rev']['tcid'] = $from['ver']['tcid']; + } + + // We will search on two steps + // STEP 1 + // Search on REQ Versions + // + $common = " SELECT NH_REQ.name, REQ.id, REQ.req_doc_id,"; + $sql = $common . + " REQV.id as version_id, REQV.version, REQV.revision, -1 AS revision_id " . + " /* */" . " /* Main table to get Last Version REQ_DOC_ID */" . + " FROM {$tables['requirements']} REQ " . + " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id=REQ.id " . + " /* */ " . " /* Need to get all REQ children => REQ Versions */ " . + " JOIN {$tables['nodes_hierarchy']} + NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . " /* */ " . + " /* Go for REQ REV data */ " . + " JOIN {$tables['req_versions']} REQV ON REQV.id=NH_REQV.id " . " /* */ "; + + $map2use = array( + 'from', + 'filter' + ); // ORDER IS CRITIC to build SQL statement + foreach ($map2use as $vv) { + $ref = &$$vv; + if (! is_null($ref['ver'])) { + $sql .= ($vv == 'filter') ? ' WHERE 1=1 ' : ''; + $sql .= implode("", $ref['ver']); + } + } + $stm['ver'] = $sql; + + // STEP 1 + // Search on REQ Revisions + // + $sql4Union = $common . + " REQR.parent_id AS version_id, REQV.version, REQR.revision, REQR.id AS revision_id " . + " /* SQL For Req REVISIONS - */ " . + " /* SQL For Req REVISIONS - Main table to get Last Version REQ_DOC_ID */" . + " FROM {$tables['requirements']} REQ " . + " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id=REQ.id " . + " /* SQL For Req REVISIONS - */ " . + " /* SQL For Req REVISIONS - Need to get all REQ children => REQ Versions because they are parent of REVISIONS */ " . + " JOIN {$tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . + " /* SQL For Req REVISIONS - */ " . + " /* SQL For Req REVISIONS - Go for REQ REVISION DATA */" . + " JOIN {$tables['req_versions']} REQV ON REQV.id=NH_REQV.id " . + " /* SQL For Req REVISIONS - */ " . + " /* SQL For Req REVISIONS - Now need to go for revisions */ " . + " JOIN {$tables['req_revisions']} REQR ON REQR.parent_id=REQV.id "; + + foreach ($map2use as $vv) { + $ref = &$$vv; + if (! is_null($ref['rev'])) { + $sql4Union .= ($vv == 'filter') ? ' WHERE 1=1 ' : ''; + $sql4Union .= implode("", $ref['rev']); + } + } + + // add additional joins that depends on user search criteria + return $stm['ver'] . + " UNION ({$sql4Union}) ORDER BY id ASC, version DESC, revision DESC "; } - -$smarty = new TLSmarty(); -$gui->row_qty = count($map); -if($gui->row_qty > 0) { - $gui->resultSet = $map; - if($gui->row_qty <= $req_cfg->search->max_qty_for_display) { - $req_set = array_keys($map); - $options = array('output_format' => 'path_as_string'); - $gui->path_info = - $tproject_mgr->tree_manager->get_full_path_verbose($req_set,$options); - } else { - $gui->warning_msg = lang_get('too_wide_search_criteria'); - } -} else { - $gui->warning_msg = lang_get('no_records_found'); -} - -$table = buildExtTable($gui, $charset); - -if (!is_null($table)) { - $gui->tableSet[] = $table; -} - -$gui->pageTitle = - $gui->main_descr . " - " . lang_get('match_count') . ": " . $gui->row_qty; - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $tpl); - -/** - * - * - */ -function buildExtTable($gui, $charset) { - $table = null; - $lbl = array('edit' => 'requirement', 'rev' => 'revision_short', - 'ver' => 'version_short', - 'req_spec' => 'req_spec', 'requirement' => 'requirement', - 'version_revision_tag' => 'version_revision_tag'); - - $labels = init_labels($lbl); - $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; - - // $gui->resultSet - - // key: reqspec_id - // value: array of matches - // array - // { - // [4][0]=>{"name" => "QAZ MNNN","id" => "4","req_doc_id" => "QAZ", - // "version_id" => 5, "version" => 1, - // "revision_id" => -1, "revision" => 2} -> revisio_id < 0 => lives on REQ VERSIONS TABLE - // - // [1]=>{"name" => "QAZ MNNN","id" => "4","req_doc_id" => "QAZ", - // "version_id" => 5, "version" => 1, - // "revision_id" => 6, "revision" => 1} - // ... - // } - // - // - - if(count($gui->resultSet) > 0) { - $columns = array(); - - $columns[] = array('title_key' => 'req_spec'); - $columns[] = array('title_key' => 'requirement', 'type' => 'text'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - $key2loop = array_keys($gui->resultSet); - $img = ""; - // req_id, req_version_id - $reqVerHref = '' . $labels['version_revision_tag'] . ' '; - // req_revision_id - $reqRevHref = '' . $labels['version_revision_tag'] . ' '; - - foreach($key2loop as $req_id) { - $rowData = array(); - $itemSet = $gui->resultSet[$req_id]; - $rfx = &$itemSet[0]; - - // We Group by Requirement path - $rowData[] = htmlentities($gui->path_info[$rfx['id']], ENT_QUOTES, $charset); - - $edit_link = "" . "{$img} "; - $title = htmlentities($rfx['req_doc_id'], ENT_QUOTES, $charset) . ":" . - htmlentities($rfx['name'], ENT_QUOTES, $charset); - - $matches = ''; - foreach($itemSet as $rx) { - if($rx['revision_id'] > 0) { - $dummy = sprintf($reqRevHref,$rx['revision_id'],$rx['version'], - $rx['revision']); - } else { - $dummy = sprintf($reqVerHref,$req_id,$rx['version_id'],$rx['version'], - $rx['revision']); - } - $matches .= $dummy; - } - $rowData[] = $edit_link . $title . ' ' . $matches; - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_req_search'); - - $table->setGroupByColumnName($labels['req_spec']); - $table->setSortByColumnName($labels['requirement']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - $table->storeTableState = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - } - return $table; -} - -/* - function: - - args: - - returns: - - */ -function init_args($dateFormat) { - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $strnull = array('requirement_document_id', 'name','scope', - 'reqStatus', - 'custom_field_value', 'targetRequirement', - 'creation_date_from','creation_date_to', - 'log_message', - 'modification_date_from','modification_date_to'); - - foreach($strnull as $keyvar) { - $args->$keyvar = isset($_REQUEST[$keyvar]) ? trim($_REQUEST[$keyvar]) : null; - $args->$keyvar = !is_null($args->$keyvar) && strlen($args->$keyvar) > 0 ? trim($args->$keyvar) : null; - } - - $intcheck = array('version', 'tcid', 'reqType', 'relation_type'); - foreach($intcheck as $keyvar) { - $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : null; - } - - $int0 = array('custom_field_id', 'coverage'); - foreach($int0 as $keyvar) { - $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : 0; - } - - // convert "creation date from" to iso format for database usage - $dk = array('creation_date_from' => ' 00:00:00', - 'creation_date_to' => ' 23:59:59', - 'modification_date_from' => ' 00:00:00', - 'modification_date_to' => ' 23:59:59'); - foreach( $dk as $tdk => $hhmmss ) { - if (isset($args->$tdk) && trim($args->$tdk) != '') { - $l10ndate = split_localized_date($args->$tdk, $dateFormat); - $args->$tdk = null; - if ($l10ndate != null && is_array($l10ndate)) { - // set date in iso format - $args->$tdk = $l10ndate['year'] . "-" . - $l10ndate['month'] . "-" . - $l10ndate['day'] . $hhmmss; - } - } - } - - $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - return $args; -} - - - -/** - * - * - */ -function build_search_sql(&$dbHandler,&$argsObj,&$guiObj) { - $tables = tlObjectWithDB::getDBTables(array('cfield_design_values', - 'nodes_hierarchy', 'req_specs', 'req_relations', 'req_versions', - 'req_revisions','requirements', 'req_coverage', 'tcversions')); - - // ver => REQ Versions - // rev => REQ Revisions - // Some filters can be applied on REQ Versions & REQ Revisions - // other ONLY on REQ Versions and other ONLY REQ Revisions - // that's why we have developer logic using UNION. - // Using just UNION and not UNION ALL, we will try to remove duplicates - // if possible. - // - // That's why to certain extent filter seems to work in OR mode. - // May be this is a BUG, that was never reported. - // - $filter = array(); - $filter['ver'] = null; - $filter['rev'] = null; - - // ----------------------------------------------------------------------- - // date filters can be build using algorithm - // Need to sanitize!!! 2019 - $date_fields = array('creation_ts' => 'ts' ,'modification_ts' => 'ts'); - $date_keys = array('date_from' => '>=' ,'date_to' => '<='); - foreach($date_fields as $fx => $needle) { - foreach($date_keys as $fk => $op) { - $fkey = str_replace($needle,$fk,$fx); - if($argsObj->$fkey) { - $filter['ver'][$fkey] = " AND REQV.$fx $op '{$argsObj->$fkey}' "; - $filter['rev'][$fkey] = " AND REQR.$fx $op '{$argsObj->$fkey}' "; - } - } - } - // ----------------------------------------------------------------------- - - // key: args key - // value: map - // key: table field - // value: map - // key: filter scope, will identify with part of SQL affects - // value: table alias - // - $likeKeys = array('name' => - array('name' => - array('ver' => "NH_REQ", 'rev' => "REQR")), - 'requirement_document_id' => - array('req_doc_id' => - array('ver' => 'REQ', 'rev' => 'REQR')), - 'scope' => - array('scope' => - array('ver' => 'REQV', 'rev' => 'REQR')), - 'log_message' - => array('log_message' => - array('ver' => 'REQV','rev' =>'REQR'))); - - foreach($likeKeys as $key => $fcfg) { - if($argsObj->$key) { - $value = $dbHandler->prepare_string($argsObj->$key); - $field = key($fcfg); - foreach($fcfg[$field] as $table => $alias) { - $filter[$table][$field] = " AND {$alias}.{$field} like '%{$value}%' "; - } - } - } - - $char_keys = array( 'reqType' => - array('type' => - array('ver' => "REQV", 'rev' => "REQR")), - 'reqStatus' => - array('status' => array('ver' => 'REQV', 'rev' => 'REQR'))); - - foreach($char_keys as $key => $fcfg) { - if($argsObj->$key) { - $value = $dbHandler->prepare_string($argsObj->$key); - $field = key($fcfg); - foreach($fcfg[$field] as $table => $alias) { - $filter[$table][$field] = " AND {$alias}.{$field} = '{$value}' "; - } - } - } - - if ($argsObj->version) { - $version = $dbHandler->prepare_int($argsObj->version); - $filter['ver']['version'] = " AND REQV.version = {$version} "; - $filter['rev']['version'] = $filter['ver']['version']; - } - - if ($argsObj->coverage) { - //search by expected coverage of testcases - $coverage=$dbHandler->prepare_int($argsObj->coverage); - $filter['ver']['coverage'] = " AND REQV.expected_coverage = {$coverage} "; - $filter['rev']['coverage'] = " AND REQR.expected_coverage = {$coverage} "; - } - - - // Complex processing - if(!is_null($argsObj->relation_type) && intval($argsObj->relation_type) >0) { - // search by relation type - // $argsObj->relation_type is a string in following form - // e.g. 3_destination or 2_source or only 4 - // must be treated different - $dummy = explode('_',$argsObj->relation_type); - $rel_type = $dummy[0]; - $side = isset($dummy[1]) ? " RR.{$dummy[1]}_id = NH_REQ.id " : - " RR.source_id = NH_REQ.id OR RR.destination_id = NH_REQ.id "; - - $from['ver']['relation_type'] = " JOIN {$tables['req_relations']} RR " . - " ON ($side) AND RR.relation_type = {$rel_type} "; - $from['rev']['relation_type'] = $from['ver']['relation_type']; - - } - - if($argsObj->custom_field_id > 0) { - $cfield_id = $dbHandler->prepare_string($argsObj->custom_field_id); - $cfield_value = $dbHandler->prepare_string($argsObj->custom_field_value); - $from['ver']['custom_field'] = - " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id = REQV.id "; - - $from['rev']['custom_field'] = - " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id = REQR.id "; - - $filter['ver']['custom_field'] = " AND CFD.field_id = {$cfield_id} " . - " AND CFD.value like '%{$cfield_value}%' "; - - $filter['rev']['custom_field'] = $filter['ver']['custom_field']; - } - - if ($argsObj->tcid != "" && strcmp($argsObj->tcid, $guiObj->tcasePrefix) != 0) { - // search for reqs linked to this testcase - $tcid = $dbHandler->prepare_string($argsObj->tcid); - $tcid = str_replace($guiObj->tcasePrefix, "", $tcid); - - $filter['ver']['tcid'] = " AND TCV.tc_external_id = '$tcid' "; - $filter['rev']['tcid'] = $filter['ver']['tcid']; - - $from['ver']['tcid'] = - - " /* 1.9.18 Changed */ " . - " /* Look for Req Coverage info */ " . - " JOIN {$tables['req_coverage']} RC ON RC.req_version_id = NH_REQV.id " . - - " /* 1.9.18 Changed */ " . - " /* Need Test case children => test case versions */ ". - " JOIN {$tables['nodes_hierarchy']} NH_TCV - ON NH_TCV.id = RC.tcversion_id " . - - " /* Needed to search using External ID */ ". - " JOIN {$tables['tcversions']} TCV ON TCV.id = NH_TCV.id "; - - $from['rev']['tcid'] = $from['ver']['tcid']; - } - - // We will search on two steps - // STEP 1 - // Search on REQ Versions - // - $common = " SELECT NH_REQ.name, REQ.id, REQ.req_doc_id,"; - $sql = $common . - " REQV.id as version_id, REQV.version, REQV.revision, -1 AS revision_id " . - " /* */" . - " /* Main table to get Last Version REQ_DOC_ID */" . - " FROM {$tables['requirements']} REQ " . - " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id=REQ.id " . - " /* */ " . - " /* Need to get all REQ children => REQ Versions */ " . - " JOIN {$tables['nodes_hierarchy']} - NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . - " /* */ " . - " /* Go for REQ REV data */ " . - " JOIN {$tables['req_versions']} REQV ON REQV.id=NH_REQV.id " . - " /* */ "; - - $map2use = array('from','filter'); // ORDER IS CRITIC to build SQL statement - foreach($map2use as $vv) { - $ref = &$$vv; - if(!is_null($ref['ver'])) { - $sql .= ($vv == 'filter') ? ' WHERE 1=1 ' : ''; - $sql .= implode("",$ref['ver']); - } - } - $stm['ver'] = $sql; - - - // STEP 1 - // Search on REQ Revisions - // - $sql4Union = $common . - " REQR.parent_id AS version_id, REQV.version, REQR.revision, REQR.id AS revision_id " . - " /* SQL For Req REVISIONS - */ " . - " /* SQL For Req REVISIONS - Main table to get Last Version REQ_DOC_ID */" . - " FROM {$tables['requirements']} REQ " . - " JOIN {$tables['nodes_hierarchy']} NH_REQ ON NH_REQ.id=REQ.id " . - " /* SQL For Req REVISIONS - */ " . - " /* SQL For Req REVISIONS - Need to get all REQ children => REQ Versions because they are parent of REVISIONS */ " . - " JOIN {$tables['nodes_hierarchy']} NH_REQV ON NH_REQV.parent_id = NH_REQ.id " . - " /* SQL For Req REVISIONS - */ " . - " /* SQL For Req REVISIONS - Go for REQ REVISION DATA */" . - " JOIN {$tables['req_versions']} REQV ON REQV.id=NH_REQV.id " . - " /* SQL For Req REVISIONS - */ " . - " /* SQL For Req REVISIONS - Now need to go for revisions */ " . - " JOIN {$tables['req_revisions']} REQR ON REQR.parent_id=REQV.id "; - - foreach($map2use as $vv) { - $ref = &$$vv; - if(!is_null($ref['rev'])) { - $sql4Union .= ($vv == 'filter') ? ' WHERE 1=1 ' : ''; - $sql4Union .= implode("",$ref['rev']); - } - } - - - // add additional joins that depends on user search criteria - $sql = $stm['ver'] . " UNION ({$sql4Union}) ORDER BY id ASC, version DESC, revision DESC "; - return $sql; -} \ No newline at end of file diff --git a/lib/requirements/reqSearchForm.php b/lib/requirements/reqSearchForm.php index ce3160b05d..5c36d0daa8 100644 --- a/lib/requirements/reqSearchForm.php +++ b/lib/requirements/reqSearchForm.php @@ -1,90 +1,87 @@ -tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); -$gui->tcasePrefix .= $tcase_cfg->glue_character; -$gui->mainCaption = lang_get('testproject') . " " . $args->tprojectName; - -$enabled = 1; -$no_filters = null; -$gui->creation_date_from = null; -$gui->creation_date_to = null; -$gui->modification_date_from = null; -$gui->modification_date_to = null; - -$gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design($args->tprojectID,$enabled, - $no_filters,'requirement'); - -$gui->keywords = $tproject_mgr->getKeywords($args->tprojectID); -$reqSpecSet = $tproject_mgr->getOptionReqSpec($args->tprojectID,testproject::GET_NOT_EMPTY_REQSPEC); - -$gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf); -$gui->filter_by['keyword'] = !is_null($gui->keywords); -$gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet); - -$reqCfg = config_get('req_cfg'); -$gui->types = init_labels($reqCfg->type_labels); -$coverageManagement = $reqCfg->expected_coverage_management; -$gui->filter_by['expected_coverage'] = !is_null($coverageManagement); - -$gui->reqStatus = init_labels($reqCfg->status_labels); - -$gui->filter_by['relation_type'] = $reqCfg->relations->enable; -$gui->req_relation_select = $req_mgr->init_relation_type_select(); -foreach ($gui->req_relation_select['equal_relations'] as $key => $oldkey) { - // set new key in array and delete old one - $new_key = (int)str_replace("_source", "", $oldkey); - $gui->req_relation_select['items'][$new_key] = $gui->req_relation_select['items'][$oldkey]; - unset($gui->req_relation_select['items'][$oldkey]); -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'reqSearchForm.tpl'); - - - -function init_args() -{ - $args = new stdClass(); - $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - - return $args; -} - -?> \ No newline at end of file +tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); +$gui->tcasePrefix .= $tcase_cfg->glue_character; +$gui->mainCaption = lang_get('testproject') . " " . $args->tprojectName; + +$enabled = 1; +$no_filters = null; +$gui->creation_date_from = null; +$gui->creation_date_to = null; +$gui->modification_date_from = null; +$gui->modification_date_to = null; + +$gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design( + $args->tprojectID, $enabled, $no_filters, 'requirement'); + +$gui->keywords = $tproject_mgr->getKeywords($args->tprojectID); +$reqSpecSet = $tproject_mgr->getOptionReqSpec($args->tprojectID, + testproject::GET_NOT_EMPTY_REQSPEC); + +$gui->filter_by['design_scope_custom_fields'] = ! is_null($gui->design_cf); +$gui->filter_by['keyword'] = ! is_null($gui->keywords); +$gui->filter_by['requirement_doc_id'] = ! is_null($reqSpecSet); + +$reqCfg = config_get('req_cfg'); +$gui->types = init_labels($reqCfg->type_labels); +$coverageManagement = $reqCfg->expected_coverage_management; +$gui->filter_by['expected_coverage'] = ! is_null($coverageManagement); + +$gui->reqStatus = init_labels($reqCfg->status_labels); + +$gui->filter_by['relation_type'] = $reqCfg->relations->enable; +$gui->req_relation_select = $req_mgr->init_relation_type_select(); +foreach ($gui->req_relation_select['equal_relations'] as $oldkey) { + // set new key in array and delete old one + $new_key = (int) str_replace("_source", "", $oldkey); + $gui->req_relation_select['items'][$new_key] = $gui->req_relation_select['items'][$oldkey]; + unset($gui->req_relation_select['items'][$oldkey]); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'reqSearchForm.tpl'); + +function initArgs() +{ + $args = new stdClass(); + $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + + return $args; +} + +?> diff --git a/lib/requirements/reqSpecCommands.class.php b/lib/requirements/reqSpecCommands.class.php index af89f42fa2..61c588cea5 100644 --- a/lib/requirements/reqSpecCommands.class.php +++ b/lib/requirements/reqSpecCommands.class.php @@ -1,944 +1,981 @@ -db=$db; - $this->reqSpecMgr = new requirement_spec_mgr($db); - $this->reqMgr = new requirement_mgr($db); - $this->treeMgr = $this->reqMgr->tree_mgr; - - $req_spec_cfg = config_get('req_spec_cfg'); - $this->reqSpecTypeDomain = init_labels($req_spec_cfg->type_labels); - $this->commandMgr = new reqCommands($db); - $this->submit_button_label=lang_get('btn_save'); - $this->getRequirementsOptions = array('order_by' => " ORDER BY NH_REQ.node_order "); - - $tproject_mgr = new testproject($this->db); - $info = $tproject_mgr->get_by_id($tproject_id); - if($info['reqmgr_integration_enabled']) - { - $sysmgr = new tlReqMgrSystem($this->db); - $rms = $sysmgr->getInterfaceObject($tproject_id); - $this->reqMgrSystem = $sysmgr->getLinkedTo($tproject_id); - unset($sysmgr); - } - } - - function setAuditContext($auditContext) - { - $this->auditContext=$auditContext; - } - - function getReqMgrSystem() - { - return $this->reqMgrSystem; - } - - - /** - * common properties needed on gui - * - */ - function initGuiBean($options=null) - { - $obj = new stdClass(); - $obj->pageTitle = ''; - $obj->bodyOnLoad = ''; - $obj->bodyOnUnload = ''; - $obj->hilite_item_name = false; - $obj->display_path = false; - $obj->show_match_count = false; - $obj->main_descr = ''; - $obj->action_descr = ''; - $obj->cfields = null; - $obj->template = ''; - $obj->submit_button_label = ''; - $obj->action_status_ok = true; - - $obj->req_spec_id = null; - $obj->req_spec_revision_id = null; - $obj->req_spec = null; - - $obj->expected_coverage = null; - $obj->total_req_counter=null; - $obj->reqSpecTypeDomain = $this->reqSpecTypeDomain; - - $obj->askForRevision = false; - $obj->askForLog = false; - $obj->req_spec = null; - if(!is_null($options)) - { - if(isset($options['getReqSpec'])) - { - $ref = &$options['getReqSpec']; - $obj->req_spec = $this->reqSpecMgr->get_by_id($ref['id'],$ref['options']); - } - } - - return $obj; - } - - - - - /* - function: create - - args: - - returns: - - */ - function create(&$argsObj) - { - // echo __CLASS__ . '.' . __FUNCTION__ . '()
    '; - $guiObj = $this->initGuiBean(); - $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - $guiObj->action_descr = lang_get('create_req_spec'); - - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id); - $guiObj->template = $this->defaultTemplate; - $guiObj->submit_button_label=$this->submit_button_label; - $guiObj->req_spec_id=null; - $guiObj->req_spec_title=null; - $guiObj->req_spec_doc_id=null; - $guiObj->total_req_counter=null; - - return $guiObj; - } - - /* - function: edit - - args: - - returns: - - */ - // following req command model - function edit(&$argsObj,$request,$overwriteArgs=true) - { - // echo __CLASS__ . '.' . __FUNCTION__ . '()
    '; - - $guiObj = $this->initGuiBean(); - - $guiObj->req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . $guiObj->req_spec['title']; - - $guiObj->req_spec_doc_id = $guiObj->req_spec['doc_id']; - $guiObj->req_spec_title = $guiObj->req_spec['title']; - $guiObj->total_req_counter = $guiObj->req_spec['total_req']; - - $guiObj->req_spec_id = $argsObj->req_spec_id; - $guiObj->req_spec_revision_id = $argsObj->req_spec_revision_id; - - $guiObj->action_descr = lang_get('edit_req_spec'); - $guiObj->template = $this->defaultTemplate; - $guiObj->submit_button_label=$this->submit_button_label; - - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs($argsObj->req_spec_id, - $argsObj->req_spec_revision_id, - $argsObj->tproject_id); - - // not really clear - if( $overwriteArgs ) - { - $argsObj->scope = $guiObj->req_spec['scope']; - } - - return $guiObj; - } - - /* - function: doCreate - - args: - - returns: - - */ - function doCreate(&$argsObj,$request) - { - // echo __CLASS__ . '.' . __FUNCTION__ . '()
    '; - - $guiObj = $this->initGuiBean(); - $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - $guiObj->action_descr = lang_get('create_req_spec'); - $guiObj->submit_button_label=$this->submit_button_label; - $guiObj->template = $this->defaultTemplate; - $guiObj->req_spec_id=null; - $guiObj->req_spec_doc_id=null; - $guiObj->req_spec_title=null; - $guiObj->total_req_counter=null; - - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id, - $request); - // manage new order - $order = 0; - $nt2exclude = array('testplan' => 'exclude_me','testsuite'=> 'exclude_me', - 'testcase'=> 'exclude_me'); - $siblings = $this->treeMgr->get_children($argsObj->parentID,$nt2exclude); - if( !is_null($siblings) ) - { - $dummy = end($siblings); - $order = $dummy['node_order']+1; - } - - $ret = $this->reqSpecMgr->create($argsObj->tproject_id,$argsObj->parentID, - $argsObj->doc_id,$argsObj->title,$argsObj->scope, - $argsObj->countReq,$argsObj->user_id,$argsObj->reqSpecType,$order); - - $guiObj->user_feedback = $ret['msg']; - if($ret['status_ok']) - { - $argsObj->scope = ""; - $guiObj->user_feedback = sprintf(lang_get('req_spec_created'),$argsObj->title); - $idCard = array('tproject_id' => $argsObj->tproject_id); - $cf_map = $this->reqSpecMgr->get_linked_cfields($idCard); - - $this->reqSpecMgr->values_to_db($request,$ret['revision_id'],$cf_map); - logAuditEvent(TLS("audit_req_spec_created",$this->auditContext->tproject,$argsObj->title), - "CREATE",$ret['id'],"req_specs"); - } - else - { - $guiObj->req_spec_doc_id=$argsObj->doc_id; - $guiObj->req_spec_title=$argsObj->title; - $guiObj->total_req_counter=$argsObj->countReq; - } - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) - { - $descr_prefix = lang_get('req_spec_short') . TITLE_SEP; - - $guiObj = $this->initGuiBean(); - $guiObj->submit_button_label=$this->submit_button_label; - $guiObj->template = null; - $guiObj->req_spec_id = $argsObj->req_spec_id; - - $guiObj = $this->edit($argsObj,null,!self::OVERWRITESCOPE); - $guiObj->user_feedback = ''; - $guiObj->template = null; - $guiObj->askForRevision = false; - - // why can not do the check now ? 20110730 - $chk = $this->reqSpecMgr->check_main_data($argsObj->title,$argsObj->doc_id, - $argsObj->tproject_id,$argsObj->parentID, - $argsObj->req_spec_id); - - if( $chk['status_ok'] ) - { - $guiObj = $this->process_revision($guiObj,$argsObj,$request); - } - else - { - // need to manage things in order to NOT LOOSE user input - $user_inputs = array('title' => array('prefix' => 'req_spec_'), - 'scope' => array('prefix' => ''), - 'doc_id' => array('prefix' => 'req_spec_'), - 'reqSpecType' => array(prefix => '', 'item_key' => 'type') ); - - foreach($user_inputs as $from => $convert_to) - { - $prefix_to = isset($convert_to['prefix_to']) ? $convert_to['prefix_to'] : ''; - $to = $prefix_to . $from; - $guiObj->$to = $argsObj->$from; - - $item_key = isset($convert_to['item_key']) ? $convert_to['item_key'] : $from; - $guiObj->req_spec[$item_key] = $argsObj->$from; - } - - $guiObj->action_status_ok = false; - $guiObj->user_feedback = $chk['msg']; - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id, - null, null,$request); - } - - return $guiObj; - } - - - /* - function: doDelete - - args: - - returns: - - */ - function doDelete(&$argsObj) - { - $guiObj = $this->initGuiBean(); - - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $this->reqSpecMgr->delete_deep($argsObj->req_spec_id); - logAuditEvent(TLS("audit_req_spec_deleted",$this->auditContext->tproject,$req_spec['title']), - "DELETE",$argsObj->req_spec_id,"req_specs"); - - $guiObj->template = 'show_message.tpl'; - $guiObj->template_dir = ''; - $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - $guiObj->title=lang_get('delete_req_spec'); - - $guiObj->user_feedback = sprintf(lang_get('req_spec_deleted'),$req_spec['title']); - $guiObj->refreshTree = 1; // needed to enable refresh_tree logic - $guiObj->result = 'ok'; - - return $guiObj; - } - - - /* - function: reorder - - args: - - returns: - - */ - function reorder(&$argsObj) - { - $guiObj = $this->initGuiBean(); - $guiObj->template = 'reqSpecReorder.tpl'; - $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - $guiObj->action_descr = lang_get('title_change_req_spec_order'); - - $order_by = ' ORDER BY NH.node_order,REQ_SPEC.id '; - $guiObj->all_req_spec = $this->reqSpecMgr->get_all_in_testproject($argsObj->tproject_id,$order_by); - $guiObj->tproject_name=$argsObj->tproject_name; - $guiObj->tproject_id=$argsObj->tproject_id; - return $guiObj; - } - - - - /* - function: doReorder - - args: - - returns: - - */ - function doReorder(&$argsObj) - { - $guiObj = $this->initGuiBean(); - $guiObj->tproject_name=$argsObj->tproject_name; - $guiObj->tproject_id=$argsObj->tproject_id; - $guiObj->template = 'project_req_spec_mgmt.tpl'; - $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . $argsObj->tproject_name; - - $nodes_in_order = transform_nodes_order($argsObj->nodes_order); - - // need to remove first element, is testproject - array_shift($nodes_in_order); - $this->reqSpecMgr->set_order($nodes_in_order); - $guiObj->refreshTree=1; - return $guiObj; - } - - - /* - function: createChild - - args: - - returns: - - */ - function createChild(&$argsObj) - { - $reqParent=$this->reqSpecMgr->get_by_id($argsObj->parentID); - $guiObj = $this->initGuiBean(); - $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . $reqParent['title']; - $guiObj->action_descr = lang_get('create_child_req_spec'); - - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id); - $guiObj->template = $this->defaultTemplate; - $guiObj->submit_button_label=$this->submit_button_label; - $guiObj->req_spec_id=null; - $guiObj->req_spec_doc_id=null; - $guiObj->req_spec_title=null; - $guiObj->total_req_counter=null; - - return $guiObj; - } - - - /* - function: copyRequirements - - args: - - returns: - - */ - function copyRequirements(&$argsObj,$options=null) - { - $obj = $this->initGuiBean(); - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - - $my['options'] = array( 'get_items' => true); - $my['options'] = array_merge($my['options'], (array)$options); - if( $my['options']['get_items'] ) - { - $opt = $this->getRequirementsOptions + array('output' => 'minimal'); - $obj->items = $this->reqSpecMgr->get_requirements($argsObj->req_spec_id,'all',null,$opt); - } - $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('copy_several_reqs'); - $obj->template = 'reqCopy.tpl'; - $obj->containers = null; - $obj->page2call = 'lib/requirements/reqSpecEdit.php'; - $obj->array_of_msg = ''; - $obj->doActionButton = 'doCopyRequirements'; - $obj->req_spec_id = $argsObj->req_spec_id; - - $exclude_node_types=array('testplan' => 'exclude_me','testsuite' => 'exclude_me', - 'testcase' => 'exclude_me','requirement' => 'exclude_me', - 'requirement_spec_revision' => 'exclude_me'); - - $my['filters'] = array('exclude_node_types' => $exclude_node_types); - $my['options']['order_cfg']['type'] = $my['options']['output'] = 'rspec'; - $subtree = $this->reqMgr->tree_mgr->get_subtree($argsObj->tproject_id,$my['filters'],$my['options']); - if(count($subtree)) - { - $obj->containers = $this->reqMgr->tree_mgr->createHierarchyMap($subtree,'dotted',array('field' => 'doc_id','format' => '%s:')); - } - return $obj; - } - - /** - * - * - */ - function doCopyRequirements(&$argsObj) - { - $obj = $this->initGuiBean(); - $obj = $this->copyRequirements($argsObj, array( 'get_items' => false)); - $obj->req = null; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->array_of_msg = array(); - - $copyOptions = array('copy_also' => array('testcase_assignment' => $argsObj->copy_testcase_assignment)); - - foreach($argsObj->itemSet as $itemID) - { - $ret = $this->reqMgr->copy_to($itemID,$argsObj->containerID,$argsObj->user_id, - $argsObj->tproject_id,$copyOptions); - $obj->user_feedback = $ret['msg']; - if($ret['status_ok']) - { - $new_req = $this->reqMgr->get_by_id($ret['id'],requirement_mgr::LATEST_VERSION); - $source_req = $this->reqMgr->get_by_id($itemID,requirement_mgr::LATEST_VERSION); - $new_req = $new_req[0]; - $source_req = $source_req[0]; - - $logMsg = TLS("audit_requirement_copy",$new_req['req_doc_id'],$source_req['req_doc_id']); - logAuditEvent($logMsg,"COPY",$ret['id'],"requirements"); - $obj->user_feedback = $logMsg; // sprintf(lang_get('req_created'), $new_req['req_doc_id']); - $obj->template = 'reqCopy.tpl'; - $obj->req_id = $ret['id']; - $obj->array_of_msg[] = $logMsg; - } - } - $obj->items = $this->reqSpecMgr->get_requirements($obj->req_spec_id, - 'all',null,$this->getRequirementsOptions); - - return $obj; - } - - - /* - function: copy - copy req. spec - - args: - - returns: - - */ - function copy(&$argsObj,$options=null) - { - $obj = $this->initGuiBean(); - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - - $my['options'] = array( 'get_items' => true); - $my['options'] = array_merge($my['options'], (array)$options); - - $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('copy_req_spec'); - $obj->template = 'reqSpecCopy.tpl'; - $obj->containers = null; - $obj->page2call = 'lib/requirements/reqSpecEdit.php'; - $obj->array_of_msg = ''; - $obj->doActionButton = 'doCopy'; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->top_checked = ' checked = "checked" '; - $obj->bottom_checked = ' '; - - - $exclude_node_types=array('testplan' => 'exclude_me','testsuite' => 'exclude_me', - 'testcase'=> 'exclude_me','requirement' => 'exclude_me'); - - $my['filters'] = array('exclude_node_types' => $exclude_node_types); - $root = $this->treeMgr->get_node_hierarchy_info($argsObj->tproject_id); - $subtree = array_merge(array($root),$this->treeMgr->get_subtree($argsObj->tproject_id,$my['filters'])); - - if(count($subtree)) - { - $obj->containers = $this->treeMgr->createHierarchyMap($subtree); - } - return $obj; - } - - - - /* - function: doCopy - copy req. spec - - args: - - returns: - - */ - function doCopy(&$argsObj) - { - $obj = $this->initGuiBean(); - $obj = $this->copy($argsObj); - $obj->req = null; - $obj->req_spec_id = $argsObj->req_spec_id; - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - - - $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('copy_req_spec'); - $obj->template = 'reqSpecCopy.tpl'; - $obj->containers = null; - $obj->page2call = 'lib/requirements/reqSpecEdit.php'; - $obj->array_of_msg = array(); - $obj->doActionButton = 'doCopy'; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->top_checked = ' checked = "checked" '; - $obj->bottom_checked = ' '; - - $op = $this->reqSpecMgr->copy_to($argsObj->req_spec_id,$argsObj->containerID, - $argsObj->tproject_id, $argsObj->user_id); - - if( $op['status_ok'] ) - { - $new_req_spec = $this->reqSpecMgr->get_by_id($op['id']); - $obj->array_of_msg[] = sprintf(lang_get('req_spec_copy_done'),$req_spec['doc_id'], - $req_spec['title'],$new_req_spec['doc_id']); - } - - $exclude_node_types=array('testplan' => 'exclude_me','testsuite' => 'exclude_me', - 'testcase'=> 'exclude_me','requirement' => 'exclude_me'); - - $my['filters'] = array('exclude_node_types' => $exclude_node_types); - $root = $this->treeMgr->get_node_hierarchy_info($argsObj->tproject_id); - $subtree = array_merge(array($root),$this->treeMgr->get_subtree($argsObj->tproject_id,$my['filters'])); - - if(count($subtree)) - { - $obj->containers = $this->treeMgr->createHierarchyMap($subtree); - } - return $obj; - } - - /** - * - */ - public function doFreeze(&$argsObj,$request) - { - $req_spec_id = $request["req_spec_id"]; - $req_spec = $this->reqSpecMgr->getReqTree($req_spec_id); - $req_spec_info = $this->reqSpecMgr->get_by_id($req_spec_id); - - $childNodes = isset($req_spec['childNodes']) ? $req_spec['childNodes'] : null ; - if( !is_null($childNodes)) - { - $loop_qty=sizeof($childNodes); - for($idx = 0;$idx < $loop_qty;$idx++) - { - $cNode = $childNodes[$idx]; - $nTable = $cNode['node_table']; - if($cNode['node_table'] == 'req_specs') - { - $request["req_spec_id"]=$cNode['id']; - $this->doFreeze($argsObj,$request); - } - else if ($cNode['node_table'] == 'requirements') - { - $req = $this->reqMgr->get_by_id($cNode['id'],requirement_mgr::LATEST_VERSION); - $req_freeze_version = new stdClass(); - $req_freeze_version->req_version_id = $req[0]['version_id']; - $this->commandMgr->doFreezeVersion($req_freeze_version); - } - } - } - - $obj = $this->initGuiBean(); - $obj->template = 'show_message.tpl'; - $obj->template_dir = ''; - $obj->user_feedback = lang_get('req_frozen'); - $obj->main_descr=lang_get('req_spec') . TITLE_SEP . $req_spec_info['title']; - $obj->title=lang_get('freeze_req'); - $obj->refreshTree = 0; - $obj->result = 'ok'; // needed to enable refresh_tree logic - return $obj; - } - - - /** - * THIS METHOD NEED to be moved to common class because is also used - * on reqCommand.class.php - * - */ - function simpleCompare($old,$new,$oldCF,$newCF) - { - // - log message is only forced to be entered when a custom field, title or document ID is changed - // - when only changes where made to scope user is free to create a new revision or - // overwrite the old revision (Cancel -> overwrite) - $ret = array('force' => false, 'suggest' => false, 'nochange' => false, 'changeon' => null); - - // key: var name to be used on $old - // value: var name to be used on $new - // Then to compare old and new - // $old[$key] compare to $new[$value] - // - $suggest_revision = array('scope' => 'scope'); - $force_revision = array('type' => 'reqSpecType', 'doc_id'=> 'doc_id', 'title' => 'title'); - - foreach($force_revision as $access_key => $access_prop) - { - if( $ret['force'] = ($old[$access_key] != $new->$access_prop) ) - { - $ret['changeon'] = 'attribute:' . $access_key; - break; - } - } - - if( !$ret['force'] ) - { - if( !is_null($newCF) ) - { - foreach($newCF as $cf_key => $cf) - { - if( $ret['force'] = ($oldCF[$cf_key]['value'] != $cf['cf_value']) ) - { - $ret['changeon'] = 'custom field:' . $oldCF[$cf_key]['name']; - break; - } - } - } - } - - if( !$ret['force'] ) - { - foreach($suggest_revision as $access_key => $access_prop) - { - if( $ret['suggest'] = ($old[$access_key] != $new->$access_prop) ) - { - $ret['changeon'] = 'attribute:' . $access_key; - break; - } - } - - } - $ret['nochange'] = ($ret['force'] == false && $ret['suggest'] == false); - return $ret; - } - - /* - function: doCreateRevision - - args: - - returns: - - @internal revisions - - */ - function doCreateRevision(&$argsObj,$request) - { - $item = array('log_message' => $argsObj->log_message, 'author_id' => $argsObj->user_id); - $ret = $this->reqSpecMgr->clone_revision($argsObj->req_spec_id,$item); - - $obj = $this->initGuiBean(); - $obj->user_feedback = $ret['msg']; - $obj->template = "reqSpecView.php?req_spec_id={$argsObj->req_spec_id}"; - $obj->req_spec = null; - $obj->req_spec_id=$argsObj->req_spec_id; - $obj->req_spec_revision_id = $ret['id']; - return $obj; - } - - - - /** - * - */ - function process_revision(&$guiObj,&$argsObj,&$userInput) - { - - // TICKET 4661 - $itemOnDB = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - $who = array('tproject_id' => $argsObj->tproject_id); - $cf_map = $this->reqSpecMgr->get_linked_cfields($who); - $newCFields = $this->reqSpecMgr->cfield_mgr->_build_cfield($userInput,$cf_map); - - $who['item_id'] = $argsObj->req_spec_revision_id; - $oldCFields = $this->reqSpecMgr->get_linked_cfields($who); - $diff = $this->simpleCompare($itemOnDB,$argsObj,$oldCFields,$newCFields); - - - $createRev = false; - if($diff['force'] && !$argsObj->do_save) - { - $guiObj->askForLog = true; - $guiObj->refreshTree = false; - - // Need Change several values with user input data, to match logic on - // edit php page on function renderGui() - // $map = array('status' => 'reqStatus', 'type' => 'reqSpecType','scope' => 'scope', - $map = array('type' => 'reqSpecType','scope' => 'scope', - 'doc_id'=> 'doc_id', 'title' => 'title'); - - foreach($map as $k => $w) - { - $guiObj->req_spec[$k] = $argsObj->$w; - } - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs(null,null,$argsObj->tproject_id, - null, null,$userInput); - - } - else if( $diff['nochange'] || ( ($createRev = $diff['force'] && !$guiObj->askForLog) || $argsObj->do_save ) ) - { - - if( $argsObj->do_save == 1) - { - $createRev = ($argsObj->save_rev == 1); - } - - $item = array(); - $item['id'] = $argsObj->req_spec_id; - $item['revision_id'] = $createRev ? -1 : $argsObj->req_spec_revision_id; - $item['doc_id'] = $argsObj->doc_id; - $item['name'] = $argsObj->title; - $item['scope'] = $argsObj->scope; - $item['countReq'] = $argsObj->countReq; - $item['type'] = $argsObj->reqSpecType; - - $user_key = $createRev ? 'author_id' : 'modifier_id'; - $item[$user_key] = $argsObj->user_id; - - $opt = array('skip_controls' => true, 'create_rev' => $createRev, 'log_message' => $argsObj->log_message); - $ret = $this->reqSpecMgr->update($item,$opt); - - $guiObj->user_feedback = $ret['msg']; - $guiObj->template = null; - - if($ret['status_ok']) - { - // custom fields update - $this->reqSpecMgr->values_to_db($userInput,$ret['revision_id'],$cf_map); - - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->template = "reqSpecView.php?refreshTree={$argsObj->refreshTree}&" . - "req_spec_id={$guiObj->req_spec_id}"; - - // TODO - // logAuditEvent(TLS("audit_requirement_saved",$argsObj->reqDocId),"SAVE",$argsObj->req_id,"requirements"); - } - else - { - // Action has failed => no change done on DB. - $old = $this->reqSpecMgr->get_by_id($argsObj->req_id); - $guiObj->main_descr = $descr_prefix . $old['title']; - $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_values($argsObj->req_spec_id, - $argsObj->req_spec_revision_id, - $argsObj->tproject_id); - } - } - else if( $diff['suggest'] ) - { - $guiObj->askForRevision = true; - } - - return $guiObj; - } - - - /** - * - */ - function fileUpload(&$argsObj,$request) - { - $argsObj->uploadOp = fileUploadManagement($this->db,$argsObj->req_spec_id,$argsObj->fileTitle,$this->reqSpecMgr->getAttachmentTableName()); - return $this->initGuiObjForAttachmentOperations($argsObj); - } - - /** - * - */ - function deleteFile(&$argsObj) - { - deleteAttachment($this->db,$argsObj->file_id); - return $this->initGuiObjForAttachmentOperations($argsObj); - } - - - /** - * - */ - private function initGuiObjForAttachmentOperations($argsObj) - { - $guiObj = new stdClass(); - $guiObj->main_descr = ''; - $guiObj->action_descr = ''; - $guiObj->askForRevision = $guiObj->askForLog = false; - $guiObj->action_status_ok = true; - $guiObj->req_spec_id = $argsObj->req_spec_id; - $guiObj->template = "reqSpecView.php?refreshTree=0&req_spec_id={$argsObj->req_spec_id}"; - - $guiObj->uploadOp = $argsObj->uploadOp; - - return $guiObj; - } - - /* - function: copyRequirements - - args: - - returns: - - */ - function bulkReqMon(&$argsObj,$options=null) - { - $obj = $this->initGuiBean(); - $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); - - $my['options'] = array( 'get_items' => true); - $my['options'] = array_merge($my['options'], (array)$options); - - - if( $my['options']['get_items'] ) - { - $opt = $this->getRequirementsOptions + - array('outputLevel' => 'minimal', 'decodeUsers' => false); - $obj->items = $this->reqSpecMgr->get_requirements($argsObj->req_spec_id,'all',null,$opt); - } - - $opx = array('reqSpecID' => $argsObj->req_spec_id); - $monSet = $this->reqMgr->getMonitoredByUser($argsObj->user_id,$argsObj->tproject_id,$opx); - - $obj->enable_start_btn = false; - $obj->enable_stop_btn = false; - foreach($obj->items as $xdx => &$itx) - { - $onOff = isset($monSet[$itx['id']]) ? true : false; - $itx['monitor'] = $onOff ? 'On' : 'Off'; - $obj->enable_start_btn |= !$onOff; - $obj->enable_stop_btn |= $onOff; - } - - $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; - $obj->action_descr = lang_get('bulk_monitoring'); - $obj->template = 'reqBulkMon.tpl'; - $obj->containers = null; - $obj->page2call = 'lib/requirements/reqSpecEdit.php'; - $obj->array_of_msg = ''; - $obj->doActionButton = 'do' . ucfirst(__FUNCTION__); - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->refreshTree = 0; - - return $obj; - } - - /** - * - * - */ - function doBulkReqMon(&$argsObj) - { - $obj = $this->initGuiBean(); - $obj->req = null; - $obj->req_spec_id = $argsObj->req_spec_id; - $obj->array_of_msg = ''; - - $m2r = null; - switch($argsObj->op) - { - case 'toogleMon': - $opx = array('reqSpecID' => $argsObj->req_spec_id); - $monSet = $this->reqMgr->getMonitoredByUser($argsObj->user_id,$argsObj->tproject_id,$opx); - - foreach($argsObj->itemSet as $req_id) - { - $f2r = isset($monSet[$req_id]) ? 'monitorOff' : 'monitorOn'; - $this->reqMgr->$f2r($req_id,$argsObj->user_id,$argsObj->tproject_id); - } - break; - - case 'startMon': - $m2r = 'monitorOn'; - break; - - case 'stopMon': - $m2r = 'monitorOff'; - break; - } - - if( !is_null($m2r) ) - { - foreach($argsObj->itemSet as $req_id) - { - $this->reqMgr->$m2r($req_id,$argsObj->user_id,$argsObj->tproject_id); - } - } - - return $this->bulkReqMon($argsObj); - } - - - +db = $db; + $this->reqSpecMgr = new requirement_spec_mgr($db); + $this->reqMgr = new requirement_mgr($db); + $this->treeMgr = $this->reqMgr->tree_mgr; + + $req_spec_cfg = config_get('req_spec_cfg'); + $this->reqSpecTypeDomain = init_labels($req_spec_cfg->type_labels); + $this->commandMgr = new reqCommands($db); + $this->submit_button_label = lang_get('btn_save'); + $this->getRequirementsOptions = array( + 'order_by' => " ORDER BY NH_REQ.node_order " + ); + + $tproject_mgr = new testproject($this->db); + $info = $tproject_mgr->get_by_id($tproject_id); + if ($info['reqmgr_integration_enabled']) { + $sysmgr = new tlReqMgrSystem($this->db); + $this->reqMgrSystem = $sysmgr->getLinkedTo($tproject_id); + unset($sysmgr); + } + } + + public function setAuditContext($auditContext) + { + $this->auditContext = $auditContext; + } + + public function getReqMgrSystem() + { + return $this->reqMgrSystem; + } + + /** + * common properties needed on gui + */ + public function initGuiBean($options = null) + { + $obj = new stdClass(); + $obj->pageTitle = ''; + $obj->bodyOnLoad = ''; + $obj->bodyOnUnload = ''; + $obj->hilite_item_name = false; + $obj->display_path = false; + $obj->show_match_count = false; + $obj->main_descr = ''; + $obj->action_descr = ''; + $obj->cfields = null; + $obj->template = ''; + $obj->submit_button_label = ''; + $obj->action_status_ok = true; + + $obj->req_spec_id = null; + $obj->req_spec_revision_id = null; + $obj->req_spec = null; + + $obj->expected_coverage = null; + $obj->total_req_counter = null; + $obj->reqSpecTypeDomain = $this->reqSpecTypeDomain; + + $obj->askForRevision = false; + $obj->askForLog = false; + $obj->req_spec = null; + if (! is_null($options) && isset($options['getReqSpec'])) { + $ref = &$options['getReqSpec']; + $obj->req_spec = $this->reqSpecMgr->get_by_id($ref['id'], + $ref['options']); + } + + return $obj; + } + + /* + * function: create + * + * args: + * + * returns: + * + */ + public function create(&$argsObj) + { + $guiObj = $this->initGuiBean(); + $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + $guiObj->action_descr = lang_get('create_req_spec'); + + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id); + $guiObj->template = $this->defaultTemplate; + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->req_spec_id = null; + $guiObj->req_spec_title = null; + $guiObj->req_spec_doc_id = null; + $guiObj->total_req_counter = null; + + return $guiObj; + } + + /* + * function: edit + * + * args: + * + * returns: + * + */ + // following req command model + public function edit(&$argsObj, $request, $overwriteArgs = true) + { + $guiObj = $this->initGuiBean(); + + $guiObj->req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . + $guiObj->req_spec['title']; + + $guiObj->req_spec_doc_id = $guiObj->req_spec['doc_id']; + $guiObj->req_spec_title = $guiObj->req_spec['title']; + $guiObj->total_req_counter = $guiObj->req_spec['total_req']; + + $guiObj->req_spec_id = $argsObj->req_spec_id; + $guiObj->req_spec_revision_id = $argsObj->req_spec_revision_id; + + $guiObj->action_descr = lang_get('edit_req_spec'); + $guiObj->template = $this->defaultTemplate; + $guiObj->submit_button_label = $this->submit_button_label; + + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + $argsObj->req_spec_id, $argsObj->req_spec_revision_id, + $argsObj->tproject_id); + + // not really clear + if ($overwriteArgs) { + $argsObj->scope = $guiObj->req_spec['scope']; + } + + return $guiObj; + } + + /* + * function: doCreate + * + * args: + * + * returns: + * + */ + public function doCreate(&$argsObj, $request) + { + $guiObj = $this->initGuiBean(); + $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + $guiObj->action_descr = lang_get('create_req_spec'); + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->template = $this->defaultTemplate; + $guiObj->req_spec_id = null; + $guiObj->req_spec_doc_id = null; + $guiObj->req_spec_title = null; + $guiObj->total_req_counter = null; + + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id, $request); + // manage new order + $order = 0; + $nt2exclude = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me' + ); + $siblings = $this->treeMgr->get_children($argsObj->parentID, $nt2exclude); + if (! is_null($siblings)) { + $dummy = end($siblings); + $order = $dummy['node_order'] + 1; + } + + $ret = $this->reqSpecMgr->create($argsObj->tproject_id, + $argsObj->parentID, $argsObj->doc_id, $argsObj->title, + $argsObj->scope, $argsObj->countReq, $argsObj->user_id, + $argsObj->reqSpecType, $order); + + $guiObj->user_feedback = $ret['msg']; + if ($ret['status_ok']) { + $argsObj->scope = ""; + $guiObj->user_feedback = sprintf(lang_get('req_spec_created'), + $argsObj->title); + $idCard = array( + 'tproject_id' => $argsObj->tproject_id + ); + $cf_map = $this->reqSpecMgr->get_linked_cfields($idCard); + + $this->reqSpecMgr->values_to_db($request, $ret['revision_id'], + $cf_map); + logAuditEvent( + TLS("audit_req_spec_created", $this->auditContext->tproject, + $argsObj->title), "CREATE", $ret['id'], "req_specs"); + } else { + $guiObj->req_spec_doc_id = $argsObj->doc_id; + $guiObj->req_spec_title = $argsObj->title; + $guiObj->total_req_counter = $argsObj->countReq; + } + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $guiObj = $this->initGuiBean(); + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->template = null; + $guiObj->req_spec_id = $argsObj->req_spec_id; + + $guiObj = $this->edit($argsObj, null, ! self::OVERWRITESCOPE); + $guiObj->user_feedback = ''; + $guiObj->template = null; + $guiObj->askForRevision = false; + + // why can not do the check now ? 20110730 + $chk = $this->reqSpecMgr->check_main_data($argsObj->title, + $argsObj->doc_id, $argsObj->tproject_id, $argsObj->parentID, + $argsObj->req_spec_id); + + if ($chk['status_ok']) { + $guiObj = $this->processRevision($guiObj, $argsObj, $request); + } else { + // need to manage things in order to NOT LOOSE user input + $user_inputs = array( + 'title' => array( + 'prefix' => 'req_spec_' + ), + 'scope' => array( + 'prefix' => '' + ), + 'doc_id' => array( + 'prefix' => 'req_spec_' + ), + 'reqSpecType' => array( + prefix => '', + 'item_key' => 'type' + ) + ); + + foreach ($user_inputs as $from => $convert_to) { + $prefix_to = isset($convert_to['prefix_to']) ? $convert_to['prefix_to'] : ''; + $to = $prefix_to . $from; + $guiObj->$to = $argsObj->$from; + + $item_key = isset($convert_to['item_key']) ? $convert_to['item_key'] : $from; + $guiObj->req_spec[$item_key] = $argsObj->$from; + } + + $guiObj->action_status_ok = false; + $guiObj->user_feedback = $chk['msg']; + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id, null, null, $request); + } + + return $guiObj; + } + + /* + * function: doDelete + * + * args: + * + * returns: + * + */ + public function doDelete(&$argsObj) + { + $guiObj = $this->initGuiBean(); + + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $this->reqSpecMgr->delete_deep($argsObj->req_spec_id); + logAuditEvent( + TLS("audit_req_spec_deleted", $this->auditContext->tproject, + $req_spec['title']), "DELETE", $argsObj->req_spec_id, + "req_specs"); + + $guiObj->template = 'show_message.tpl'; + $guiObj->template_dir = ''; + $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + $guiObj->title = lang_get('delete_req_spec'); + + $guiObj->user_feedback = sprintf(lang_get('req_spec_deleted'), + $req_spec['title']); + $guiObj->refreshTree = 1; // needed to enable refresh_tree logic + $guiObj->result = 'ok'; + + return $guiObj; + } + + /* + * function: reorder + * + * args: + * + * returns: + * + */ + public function reorder(&$argsObj) + { + $guiObj = $this->initGuiBean(); + $guiObj->template = 'reqSpecReorder.tpl'; + $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + $guiObj->action_descr = lang_get('title_change_req_spec_order'); + + $order_by = ' ORDER BY NH.node_order,REQ_SPEC.id '; + $guiObj->all_req_spec = $this->reqSpecMgr->get_all_in_testproject( + $argsObj->tproject_id, $order_by); + $guiObj->tproject_name = $argsObj->tproject_name; + $guiObj->tproject_id = $argsObj->tproject_id; + return $guiObj; + } + + /* + * function: doReorder + * + * args: + * + * returns: + * + */ + public function doReorder(&$argsObj) + { + $guiObj = $this->initGuiBean(); + $guiObj->tproject_name = $argsObj->tproject_name; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->template = 'project_req_spec_mgmt.tpl'; + $guiObj->main_descr = lang_get('testproject') . TITLE_SEP . + $argsObj->tproject_name; + + $nodes_in_order = transform_nodes_order($argsObj->nodes_order); + + // need to remove first element, is testproject + array_shift($nodes_in_order); + $this->reqSpecMgr->set_order($nodes_in_order); + $guiObj->refreshTree = 1; + return $guiObj; + } + + /* + * function: createChild + * + * args: + * + * returns: + * + */ + public function createChild(&$argsObj) + { + $reqParent = $this->reqSpecMgr->get_by_id($argsObj->parentID); + $guiObj = $this->initGuiBean(); + $guiObj->main_descr = lang_get('req_spec_short') . TITLE_SEP . + $reqParent['title']; + $guiObj->action_descr = lang_get('create_child_req_spec'); + + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id); + $guiObj->template = $this->defaultTemplate; + $guiObj->submit_button_label = $this->submit_button_label; + $guiObj->req_spec_id = null; + $guiObj->req_spec_doc_id = null; + $guiObj->req_spec_title = null; + $guiObj->total_req_counter = null; + + return $guiObj; + } + + /* + * function: copyRequirements + * + * args: + * + * returns: + * + */ + public function copyRequirements(&$argsObj, $options = null) + { + $obj = $this->initGuiBean(); + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + + $my['options'] = array( + 'get_items' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + if ($my['options']['get_items']) { + $opt = $this->getRequirementsOptions + array( + 'output' => 'minimal' + ); + $obj->items = $this->reqSpecMgr->get_requirements( + $argsObj->req_spec_id, 'all', null, $opt); + } + $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; + $obj->action_descr = lang_get('copy_several_reqs'); + $obj->template = 'reqCopy.tpl'; + $obj->containers = null; + $obj->page2call = 'lib/requirements/reqSpecEdit.php'; + $obj->array_of_msg = ''; + $obj->doActionButton = 'doCopyRequirements'; + $obj->req_spec_id = $argsObj->req_spec_id; + + $exclude_node_types = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me', + 'requirement_spec_revision' => 'exclude_me' + ); + + $my['filters'] = array( + 'exclude_node_types' => $exclude_node_types + ); + $my['options']['order_cfg']['type'] = $my['options']['output'] = 'rspec'; + $subtree = $this->reqMgr->tree_mgr->get_subtree($argsObj->tproject_id, + $my['filters'], $my['options']); + if (count($subtree)) { + $obj->containers = $this->reqMgr->tree_mgr->createHierarchyMap( + $subtree, 'dotted', + array( + 'field' => 'doc_id', + 'format' => '%s:' + )); + } + return $obj; + } + + /** + */ + public function doCopyRequirements(&$argsObj) + { + $this->initGuiBean(); + $obj = $this->copyRequirements($argsObj, array( + 'get_items' => false + )); + $obj->req = null; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->array_of_msg = array(); + + $copyOptions = array( + 'copy_also' => array( + 'testcase_assignment' => $argsObj->copy_testcase_assignment + ) + ); + + foreach ($argsObj->itemSet as $itemID) { + $ret = $this->reqMgr->copy_to($itemID, $argsObj->containerID, + $argsObj->user_id, $argsObj->tproject_id, $copyOptions); + $obj->user_feedback = $ret['msg']; + if ($ret['status_ok']) { + $new_req = $this->reqMgr->get_by_id($ret['id'], + requirement_mgr::LATEST_VERSION); + $source_req = $this->reqMgr->get_by_id($itemID, + requirement_mgr::LATEST_VERSION); + $new_req = $new_req[0]; + $source_req = $source_req[0]; + + $logMsg = TLS("audit_requirement_copy", $new_req['req_doc_id'], + $source_req['req_doc_id']); + logAuditEvent($logMsg, "COPY", $ret['id'], "requirements"); + $obj->user_feedback = $logMsg; + $obj->template = 'reqCopy.tpl'; + $obj->req_id = $ret['id']; + $obj->array_of_msg[] = $logMsg; + } + } + $obj->items = $this->reqSpecMgr->get_requirements($obj->req_spec_id, + 'all', null, $this->getRequirementsOptions); + + return $obj; + } + + /* + * function: copy + * copy req. spec + * + * args: + * + * returns: + * + */ + public function copy(&$argsObj, $options = null) + { + $obj = $this->initGuiBean(); + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + + $my['options'] = array( + 'get_items' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + + $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; + $obj->action_descr = lang_get('copy_req_spec'); + $obj->template = 'reqSpecCopy.tpl'; + $obj->containers = null; + $obj->page2call = 'lib/requirements/reqSpecEdit.php'; + $obj->array_of_msg = ''; + $obj->doActionButton = 'doCopy'; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->top_checked = ' checked = "checked" '; + $obj->bottom_checked = ' '; + + $exclude_node_types = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + $my['filters'] = array( + 'exclude_node_types' => $exclude_node_types + ); + $root = $this->treeMgr->get_node_hierarchy_info($argsObj->tproject_id); + $subtree = array_merge(array( + $root + ), $this->treeMgr->get_subtree($argsObj->tproject_id, $my['filters'])); + + if (count($subtree)) { + $obj->containers = $this->treeMgr->createHierarchyMap($subtree); + } + return $obj; + } + + /* + * function: doCopy + * copy req. spec + * + * args: + * + * returns: + * + */ + public function doCopy(&$argsObj) + { + $this->initGuiBean(); + $obj = $this->copy($argsObj); + $obj->req = null; + $obj->req_spec_id = $argsObj->req_spec_id; + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + + $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; + $obj->action_descr = lang_get('copy_req_spec'); + $obj->template = 'reqSpecCopy.tpl'; + $obj->containers = null; + $obj->page2call = 'lib/requirements/reqSpecEdit.php'; + $obj->array_of_msg = array(); + $obj->doActionButton = 'doCopy'; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->top_checked = ' checked = "checked" '; + $obj->bottom_checked = ' '; + + $op = $this->reqSpecMgr->copy_to($argsObj->req_spec_id, + $argsObj->containerID, $argsObj->tproject_id, $argsObj->user_id); + + if ($op['status_ok']) { + $new_req_spec = $this->reqSpecMgr->get_by_id($op['id']); + $obj->array_of_msg[] = sprintf(lang_get('req_spec_copy_done'), + $req_spec['doc_id'], $req_spec['title'], $new_req_spec['doc_id']); + } + + $exclude_node_types = array( + 'testplan' => 'exclude_me', + 'testsuite' => 'exclude_me', + 'testcase' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + $my['filters'] = array( + 'exclude_node_types' => $exclude_node_types + ); + $root = $this->treeMgr->get_node_hierarchy_info($argsObj->tproject_id); + $subtree = array_merge(array( + $root + ), $this->treeMgr->get_subtree($argsObj->tproject_id, $my['filters'])); + + if (count($subtree)) { + $obj->containers = $this->treeMgr->createHierarchyMap($subtree); + } + return $obj; + } + + /** + */ + public function doFreeze(&$argsObj, $request) + { + $req_spec_id = $request["req_spec_id"]; + $req_spec = $this->reqSpecMgr->getReqTree($req_spec_id); + $req_spec_info = $this->reqSpecMgr->get_by_id($req_spec_id); + + $childNodes = isset($req_spec['childNodes']) ? $req_spec['childNodes'] : null; + if (! is_null($childNodes)) { + $loop_qty = count($childNodes); + for ($idx = 0; $idx < $loop_qty; $idx ++) { + $cNode = $childNodes[$idx]; + if ($cNode['node_table'] == 'req_specs') { + $request["req_spec_id"] = $cNode['id']; + $this->doFreeze($argsObj, $request); + } elseif ($cNode['node_table'] == 'requirements') { + $req = $this->reqMgr->get_by_id($cNode['id'], + requirement_mgr::LATEST_VERSION); + $req_freeze_version = new stdClass(); + $req_freeze_version->req_version_id = $req[0]['version_id']; + $this->commandMgr->doFreezeVersion($req_freeze_version); + } + } + } + + $obj = $this->initGuiBean(); + $obj->template = 'show_message.tpl'; + $obj->template_dir = ''; + $obj->user_feedback = lang_get('req_frozen'); + $obj->main_descr = lang_get('req_spec') . TITLE_SEP . + $req_spec_info['title']; + $obj->title = lang_get('freeze_req'); + $obj->refreshTree = 0; + $obj->result = 'ok'; // needed to enable refresh_tree logic + return $obj; + } + + /** + * THIS METHOD NEED to be moved to common class because is also used + * on reqCommand.class.php + */ + private function simpleCompare($old, $new, $oldCF, $newCF) + { + // - log message is only forced to be entered when a custom field, title or document ID is changed + // - when only changes where made to scope user is free to create a new revision or + // overwrite the old revision (Cancel -> overwrite) + $ret = array( + 'force' => false, + 'suggest' => false, + 'nochange' => false, + 'changeon' => null + ); + + // key: var name to be used on $old + // value: var name to be used on $new + // Then to compare old and new + // $old[$key] compare to $new[$value] + // + $suggest_revision = array( + 'scope' => 'scope' + ); + $force_revision = array( + 'type' => 'reqSpecType', + 'doc_id' => 'doc_id', + 'title' => 'title' + ); + + foreach ($force_revision as $access_key => $access_prop) { + if ($ret['force'] = ($old[$access_key] != $new->$access_prop)) { + $ret['changeon'] = 'attribute:' . $access_key; + break; + } + } + + if (! $ret['force'] && ! is_null($newCF)) { + foreach ($newCF as $cf_key => $cf) { + if ($ret['force'] = ($oldCF[$cf_key]['value'] != $cf['cf_value'])) { + $ret['changeon'] = 'custom field:' . $oldCF[$cf_key]['name']; + break; + } + } + } + + if (! $ret['force']) { + foreach ($suggest_revision as $access_key => $access_prop) { + if ($ret['suggest'] = ($old[$access_key] != $new->$access_prop)) { + $ret['changeon'] = 'attribute:' . $access_key; + break; + } + } + } + $ret['nochange'] = (! $ret['force'] && ! $ret['suggest']); + return $ret; + } + + /* + * function: doCreateRevision + * + * args: + * + * returns: + * + * @internal revisions + * + */ + public function doCreateRevision(&$argsObj, $request) + { + $item = array( + 'log_message' => $argsObj->log_message, + 'author_id' => $argsObj->user_id + ); + $ret = $this->reqSpecMgr->clone_revision($argsObj->req_spec_id, $item); + + $obj = $this->initGuiBean(); + $obj->user_feedback = $ret['msg']; + $obj->template = "reqSpecView.php?req_spec_id={$argsObj->req_spec_id}"; + $obj->req_spec = null; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->req_spec_revision_id = $ret['id']; + return $obj; + } + + /** + */ + private function processRevision(&$guiObj, &$argsObj, &$userInput) + { + // TICKET 4661 + $itemOnDB = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + $who = array( + 'tproject_id' => $argsObj->tproject_id + ); + $cf_map = $this->reqSpecMgr->get_linked_cfields($who); + $newCFields = $this->reqSpecMgr->cfield_mgr->_build_cfield($userInput, + $cf_map); + + $who['item_id'] = $argsObj->req_spec_revision_id; + $oldCFields = $this->reqSpecMgr->get_linked_cfields($who); + $diff = $this->simpleCompare($itemOnDB, $argsObj, $oldCFields, + $newCFields); + + $createRev = false; + if ($diff['force'] && ! $argsObj->do_save) { + $guiObj->askForLog = true; + $guiObj->refreshTree = false; + + // Need Change several values with user input data, to match logic on + // edit php page on function renderGui() + // $map = array('status' => 'reqStatus', 'type' => 'reqSpecType','scope' => 'scope', + $map = array( + 'type' => 'reqSpecType', + 'scope' => 'scope', + 'doc_id' => 'doc_id', + 'title' => 'title' + ); + + foreach ($map as $k => $w) { + $guiObj->req_spec[$k] = $argsObj->$w; + } + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_inputs( + null, null, $argsObj->tproject_id, null, null, $userInput); + } elseif ($diff['nochange'] || + (($createRev = $diff['force'] && ! $guiObj->askForLog) || + $argsObj->do_save)) { + + if ($argsObj->do_save == 1) { + $createRev = ($argsObj->save_rev == 1); + } + + $item = array(); + $item['id'] = $argsObj->req_spec_id; + $item['revision_id'] = $createRev ? - 1 : $argsObj->req_spec_revision_id; + $item['doc_id'] = $argsObj->doc_id; + $item['name'] = $argsObj->title; + $item['scope'] = $argsObj->scope; + $item['countReq'] = $argsObj->countReq; + $item['type'] = $argsObj->reqSpecType; + + $user_key = $createRev ? 'author_id' : 'modifier_id'; + $item[$user_key] = $argsObj->user_id; + + $opt = array( + 'skip_controls' => true, + 'create_rev' => $createRev, + 'log_message' => $argsObj->log_message + ); + $ret = $this->reqSpecMgr->update($item, $opt); + + $guiObj->user_feedback = $ret['msg']; + $guiObj->template = null; + + if ($ret['status_ok']) { + // custom fields update + $this->reqSpecMgr->values_to_db($userInput, $ret['revision_id'], + $cf_map); + + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->template = "reqSpecView.php?refreshTree={$argsObj->refreshTree}&" . + "req_spec_id={$guiObj->req_spec_id}"; + + // TODO + // logAuditEvent(TLS("audit_requirement_saved",$argsObj->reqDocId),"SAVE",$argsObj->req_id,"requirements"); + } else { + // Action has failed => no change done on DB. + $old = $this->reqSpecMgr->get_by_id($argsObj->req_id); + $guiObj->main_descr = $descr_prefix . $old['title']; + $guiObj->cfields = $this->reqSpecMgr->html_table_of_custom_field_values( + $argsObj->req_spec_id, $argsObj->req_spec_revision_id, + $argsObj->tproject_id); + } + } elseif ($diff['suggest']) { + $guiObj->askForRevision = true; + } + + return $guiObj; + } + + /** + */ + public function fileUpload(&$argsObj, $request) + { + $argsObj->uploadOp = fileUploadManagement($this->db, + $argsObj->req_spec_id, $argsObj->fileTitle, + $this->reqSpecMgr->getAttachmentTableName()); + return $this->initGuiObjForAttachmentOperations($argsObj); + } + + /** + */ + public function deleteFile(&$argsObj) + { + deleteAttachment($this->db, $argsObj->file_id); + return $this->initGuiObjForAttachmentOperations($argsObj); + } + + /** + */ + private function initGuiObjForAttachmentOperations($argsObj) + { + $guiObj = new stdClass(); + $guiObj->main_descr = ''; + $guiObj->action_descr = ''; + $guiObj->askForRevision = $guiObj->askForLog = false; + $guiObj->action_status_ok = true; + $guiObj->req_spec_id = $argsObj->req_spec_id; + $guiObj->template = "reqSpecView.php?refreshTree=0&req_spec_id={$argsObj->req_spec_id}"; + + $guiObj->uploadOp = $argsObj->uploadOp; + + return $guiObj; + } + + /* + * function: copyRequirements + * + * args: + * + * returns: + * + */ + public function bulkReqMon(&$argsObj, $options = null) + { + $obj = $this->initGuiBean(); + $req_spec = $this->reqSpecMgr->get_by_id($argsObj->req_spec_id); + + $my['options'] = array( + 'get_items' => true + ); + $my['options'] = array_merge($my['options'], (array) $options); + + if ($my['options']['get_items']) { + $opt = $this->getRequirementsOptions + + array( + 'outputLevel' => 'minimal', + 'decodeUsers' => false + ); + $obj->items = $this->reqSpecMgr->get_requirements( + $argsObj->req_spec_id, 'all', null, $opt); + } + + $opx = array( + 'reqSpecID' => $argsObj->req_spec_id + ); + $monSet = $this->reqMgr->getMonitoredByUser($argsObj->user_id, + $argsObj->tproject_id, $opx); + + $obj->enable_start_btn = false; + $obj->enable_stop_btn = false; + foreach ($obj->items as &$itx) { + $onOff = isset($monSet[$itx['id']]) ? true : false; + $itx['monitor'] = $onOff ? 'On' : 'Off'; + $obj->enable_start_btn |= ! $onOff; + $obj->enable_stop_btn |= $onOff; + } + + $obj->main_descr = lang_get('req_spec') . TITLE_SEP . $req_spec['title']; + $obj->action_descr = lang_get('bulk_monitoring'); + $obj->template = 'reqBulkMon.tpl'; + $obj->containers = null; + $obj->page2call = 'lib/requirements/reqSpecEdit.php'; + $obj->array_of_msg = ''; + $obj->doActionButton = 'do' . ucfirst(__FUNCTION__); + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->refreshTree = 0; + + return $obj; + } + + /** + */ + public function doBulkReqMon(&$argsObj) + { + $obj = $this->initGuiBean(); + $obj->req = null; + $obj->req_spec_id = $argsObj->req_spec_id; + $obj->array_of_msg = ''; + + $m2r = null; + switch ($argsObj->op) { + case 'toogleMon': + $opx = array( + 'reqSpecID' => $argsObj->req_spec_id + ); + $monSet = $this->reqMgr->getMonitoredByUser($argsObj->user_id, + $argsObj->tproject_id, $opx); + + foreach ($argsObj->itemSet as $req_id) { + $f2r = isset($monSet[$req_id]) ? 'monitorOff' : 'monitorOn'; + $this->reqMgr->$f2r($req_id, $argsObj->user_id, + $argsObj->tproject_id); + } + break; + + case 'startMon': + $m2r = 'monitorOn'; + break; + + case 'stopMon': + $m2r = 'monitorOff'; + break; + } + + if (! is_null($m2r)) { + foreach ($argsObj->itemSet as $req_id) { + $this->reqMgr->$m2r($req_id, $argsObj->user_id, + $argsObj->tproject_id); + } + } + + return $this->bulkReqMon($argsObj); + } } diff --git a/lib/requirements/reqSpecCompareRevisions.php b/lib/requirements/reqSpecCompareRevisions.php index c9cf22a501..97652a9b96 100644 --- a/lib/requirements/reqSpecCompareRevisions.php +++ b/lib/requirements/reqSpecCompareRevisions.php @@ -1,327 +1,324 @@ - null,"no_changes" => null, - "version_short" => null,"diff_details_rev" => null, - "type" => null, "status" => null, "name" => "title", - "doc_id" => null,"revision_short" => null, "revision" => null) ); - - - -$itemMgr = new requirement_spec_mgr($db); -$differ = new diff(); -$args = init_args(); -$gui = initializeGui($db,$args,$labels,$itemMgr); - -// if already two revisions are selected, display diff -// else display template with versions to select -if ($args->doCompare) -{ - // Side By Side - $sbs = getItemsToCompare($args->left_item_id,$args->right_item_id,$gui->items); - prepareUserFeedback($db,$gui,$args->req_spec_id,$labels,$sbs); - - $gui->attrDiff = getAttrDiff($sbs['left_item'],$sbs['right_item'],$labels); - - $cfields = getCFToCompare($sbs,$args->tproject_id,$itemMgr); - $gui->cfieldsDiff = null; - if( !is_null($cfields) ) - { - $gui->cfieldsDiff = getCFDiff($cfields,$itemMgr); - } - - $gui->diff = array("scope" => array()); - foreach($gui->diff as $key => $val) - { - if ($args->useDaisyDiff) - { - $diff = new HTMLDiffer(); - list($differences, $diffcount) = $diff->htmlDiff($sbs['left_item'][$key], $sbs['right_item'][$key]); - $gui->diff[$key]["diff"] = $differences; - $gui->diff[$key]["count"] = $diffcount; - } else { - // insert line endings so diff is better readable and makes sense (not everything in one line) - // then cast to array with \n as separating character, differ needs that - $gui->diff[$key]["left"] = explode("\n", str_replace("

    ", "

    \n", $sbs['left_item'][$key])); - $gui->diff[$key]["right"] = explode("\n", str_replace("

    ", "

    \n", $sbs['right_item'][$key])); - - $gui->diff[$key]["diff"] = $differ->inline($gui->diff[$key]["left"], $gui->leftID, - $gui->diff[$key]["right"], $gui->rightID,$args->context); - $gui->diff[$key]["count"] = count($differ->changes); - } - - $gui->diff[$key]["heading"] = lang_get($key); - - // are there any changes? then display! if not, nothing to show here - $additional = ''; - $msg_key = "no_changes"; - if ($gui->diff[$key]["count"] > 0) - { - $msg_key = "num_changes"; - $additional = $gui->diff[$key]["count"]; - } - $gui->diff[$key]["message"] = sprintf($labels[$msg_key], $key, $additional); - } - -} - -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -/** - * - * - */ -function getItemsToCompare($leftSideID,$rightSideID,&$itemSet) -{ - - $ret = array(); - foreach($itemSet as $item) - { - if ($item['item_id'] == $leftSideID) - { - $ret['left_item'] = $item; - } - if ($item['item_id'] == $rightSideID) - { - $ret['right_item'] = $item; - } - - if( count($ret) == 2 ) - { - break; - } - } - return $ret; -} - - -/** - * - * - */ -function getCFToCompare($sides,$tprojectID,&$itemMgr) -{ - $cfields = array('left_side' => array('key' => 'left_item', 'value' => null), - 'right_side' => array('key' => 'right_item', 'value' => null)); - - - $who = array('parent_id' => null, 'item_id' => 0, 'tproject_id' => $tprojectID); - foreach($cfields as $item_side => $dummy) - { - $target_id = $sides[$dummy['key']]; - // $target_id = $target_id['item_id']; - // $cfields[$item_side]['value'] = $itemMgr->get_linked_cfields(null,$target_id,$tprojectID); - $who['item_id'] = $target_id['item_id']; - $cfields[$item_side]['value'] = $itemMgr->get_linked_cfields($who); - } - return $cfields; -} - - -/** - * - * - * @internal revisions - * 20101211 - franciscom - use show_custom_fields_without_value - */ -function getCFDiff($cfields,&$itemMgr) -{ - $cmp = null; - - // Development Note - // All versions + revisions (i.e. child items) have the same qty of linked CF - // => both arrays will have same size() - // - // This is because to get cfields we look only to CF enabled for node type. - $cfieldsLeft = $cfields['left_side']['value']; - $cfieldsRight = $cfields['right_side']['value']; - if( !is_null($cfieldsLeft) ) - { - $key2loop = array_keys($cfieldsLeft); - $cmp = array(); - $type_code = $itemMgr->cfield_mgr->get_available_types(); - $key2convert = array('lvalue','rvalue'); - - $formats = array('date' => config_get( 'date_format')); - $cfg = config_get('gui'); - $cfCfg = config_get('custom_fields'); - foreach($key2loop as $cf_key) - { - // $cfg->show_custom_fields_without_value - // false => At least one value has to be <> NULL to include on comparsion results - // - if( $cfCfg->show_custom_fields_without_value == true || - ($cfCfg->show_custom_fields_without_value == false && - ( (!is_null($cfieldsRight) && !is_null($cfieldsRight[$cf_key]['value'])) || - (!is_null($cfieldsLeft) && !is_null($cfieldsLeft[$cf_key]['value'])) ) - ) - ) - { - $cmp[$cf_key] = array('label' => htmlspecialchars($cfieldsLeft[$cf_key]['label']), - 'lvalue' => $cfieldsLeft[$cf_key]['value'], - 'rvalue' => !is_null($cfieldsRight) ? $cfieldsRight[$cf_key]['value'] : null, - 'changed' => $cfieldsLeft[$cf_key]['value'] != $cfieldsRight[$cf_key]['value']); - - if($type_code[$cfieldsLeft[$cf_key]['type']] == 'date' || - $type_code[$cfieldsLeft[$cf_key]['type']] == 'datetime') - { - $t_date_format = str_replace("%","",$formats['date']); // must remove % - foreach($key2convert as $fx) - { - if( ($doIt = ($cmp[$cf_key][$fx] != null)) ) - { - switch($type_code[$cfieldsLeft[$cf_key]['type']]) - { - case 'datetime': - $t_date_format .= " " . $cfg->custom_fields->time_format; - break ; - } - } - if( $doIt ) - { - $cmp[$cf_key][$fx] = date($t_date_format,$cmp[$cf_key][$fx]); - } - } - } - } // mega if - } // foraeach - } - return count($cmp) > 0 ? $cmp : null; -} - - - -/** - * - * - */ -function init_args() -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - - - $args = new stdClass(); - $args->req_spec_id = isset($_REQUEST['req_spec_id']) ? intval($_REQUEST['req_spec_id']) : 0; - $args->doCompare = isset($_REQUEST['doCompare']) ? true : false; - $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval($_REQUEST['left_item_id']) : -1; - $args->right_item_id = isset($_REQUEST['right_item_id']) ? intval($_REQUEST['right_item_id']) : -1; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->useDaisyDiff = (isset($_REQUEST['diff_method']) && ($_REQUEST['diff_method'] == 'htmlCompare')) ? 1 : 0; - - - - $diffEngineCfg = config_get("diffEngine"); - $args->context = null; - if( !isset($_REQUEST['context_show_all'])) - { - $args->context = (isset($_REQUEST['context']) && is_numeric($_REQUEST['context'])) ? $_REQUEST['context'] : $diffEngineCfg->context; - } - - return $args; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$lbl,&$itemMgr) -{ - $reqSpecCfg = config_get('req_spec_cfg'); - $guiObj = new stdClass(); - $guiObj->items = $itemMgr->get_history($argsObj->req_spec_id,array('output' => 'array','decode_user' => true)); - - // Truncate log message - if( $reqSpecCfg->log_message_len > 0 ) - { - $loop2do = count($guiObj->items); - for($idx=0; $idx < $loop2do; $idx++) - { - if( strlen($guiObj->items[$idx]['log_message']) > $reqSpecCfg->log_message_len ) - { - $guiObj->items[$idx]['log_message'] = substr($guiObj->items[$idx]['log_message'],0,$reqSpecCfg->log_message_len) . '...'; - } - $guiObj->items[$idx]['log_message'] = htmlspecialchars($guiObj->items[$idx]['log_message']); - } - } - $guiObj->req_spec_id = $argsObj->req_spec_id; - $guiObj->doCompare = $argsObj->doCompare; - $guiObj->context = $argsObj->context; - $guiObj->version_short = $lbl['version_short']; - $guiObj->diff = null; - return $guiObj; -} - -/** - * - * - */ -function prepareUserFeedback(&$dbHandler,&$guiObj,$itemID,$labels,$sbs) -{ - $guiObj->leftID = $labels['revision'] . ':' . $sbs['left_item']['revision']; - $guiObj->rightID = $labels['revision'] . ':' . $sbs['right_item']['revision']; - $guiObj->subtitle = sprintf($labels['diff_details_rev'], - $sbs['left_item']['revision'],$sbs['left_item']['revision'], - $sbs['right_item']['revision'],$sbs['right_item']['revision']); - - -} - - - -/** - * - * - */ -function getAttrDiff($leftSide,$rightSide,$labels) -{ - $req_spec_cfg = config_get('req_spec_cfg'); - - // attribute => label definition on TL configuration (just if NOT NULL) - // order in this array will drive display order - // $key2loop = array('doc_id' => null,'status' => 'status_labels','type' => 'type_labels'); - $key2loop = array('doc_id' => null,'name' => null,'type' => 'type_labels'); - foreach($key2loop as $fkey => $lkey) - { - // Need to decode - $cmp[$fkey] = array('label' => htmlspecialchars($labels[$fkey]), - 'lvalue' => $leftSide[$fkey],'rvalue' => $rightSide[$fkey], - 'changed' => $leftSide[$fkey] != $rightSide[$fkey]); - - if( !is_null($lkey) ) - { - $decode = $req_spec_cfg->$lkey; - $cmp[$fkey]['lvalue'] = lang_get($decode[$cmp[$fkey]['lvalue']]); - $cmp[$fkey]['rvalue'] = lang_get($decode[$cmp[$fkey]['rvalue']]); - } - } - return $cmp; -} -?> \ No newline at end of file + null, + "no_changes" => null, + "version_short" => null, + "diff_details_rev" => null, + "type" => null, + "status" => null, + "name" => "title", + "doc_id" => null, + "revision_short" => null, + "revision" => null + )); + +$itemMgr = new requirement_spec_mgr($db); +$differ = new diff(); +$args = initArgs(); +$gui = initializeGui($db, $args, $labels, $itemMgr); + +// if already two revisions are selected, display diff +// else display template with versions to select +if ($args->doCompare) { + // Side By Side + $sbs = getItemsToCompare($args->left_item_id, $args->right_item_id, + $gui->items); + prepareUserFeedback($db, $gui, $labels, $sbs); + + $gui->attrDiff = getAttrDiff($sbs['left_item'], $sbs['right_item'], $labels); + + $cfields = getCFToCompare($sbs, $args->tproject_id, $itemMgr); + $gui->cfieldsDiff = null; + if (! is_null($cfields)) { + $gui->cfieldsDiff = getCFDiff($cfields, $itemMgr); + } + + $gui->diff = array( + "scope" => array() + ); + foreach ($gui->diff as $key => $val) { + if ($args->useDaisyDiff) { + $diff = new HTMLDiffer(); + list ($differences, $diffcount) = $diff->htmlDiff( + $sbs['left_item'][$key], $sbs['right_item'][$key]); + $gui->diff[$key]["diff"] = $differences; + $gui->diff[$key]["count"] = $diffcount; + } else { + // insert line endings so diff is better readable and makes sense (not everything in one line) + // then cast to array with \n as separating character, differ needs that + $gui->diff[$key]["left"] = explode("\n", + str_replace("

    ", "

    \n", $sbs['left_item'][$key])); + $gui->diff[$key]["right"] = explode("\n", + str_replace("

    ", "

    \n", $sbs['right_item'][$key])); + + $gui->diff[$key]["diff"] = $differ->inline($gui->diff[$key]["left"], + $gui->leftID, $gui->diff[$key]["right"], $gui->rightID, + $args->context); + $gui->diff[$key]["count"] = count($differ->changes); + } + + $gui->diff[$key]["heading"] = lang_get($key); + + // are there any changes? then display! if not, nothing to show here + $additional = ''; + $msg_key = "no_changes"; + if ($gui->diff[$key]["count"] > 0) { + $msg_key = "num_changes"; + $additional = $gui->diff[$key]["count"]; + } + $gui->diff[$key]["message"] = sprintf($labels[$msg_key], $key, + $additional); + } +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function getItemsToCompare($leftSideID, $rightSideID, &$itemSet) +{ + $ret = array(); + foreach ($itemSet as $item) { + if ($item['item_id'] == $leftSideID) { + $ret['left_item'] = $item; + } + if ($item['item_id'] == $rightSideID) { + $ret['right_item'] = $item; + } + + if (count($ret) == 2) { + break; + } + } + return $ret; +} + +/** + */ +function getCFToCompare($sides, $tprojectID, &$itemMgr) +{ + $cfields = array( + 'left_side' => array( + 'key' => 'left_item', + 'value' => null + ), + 'right_side' => array( + 'key' => 'right_item', + 'value' => null + ) + ); + + $who = array( + 'parent_id' => null, + 'item_id' => 0, + 'tproject_id' => $tprojectID + ); + foreach ($cfields as $item_side => $dummy) { + $target_id = $sides[$dummy['key']]; + $who['item_id'] = $target_id['item_id']; + $cfields[$item_side]['value'] = $itemMgr->get_linked_cfields($who); + } + return $cfields; +} + +/** + * + * @internal revisions + * 20101211 - franciscom - use show_custom_fields_without_value + */ +function getCFDiff($cfields, &$itemMgr) +{ + $cmp = null; + + // Development Note + // All versions + revisions (i.e. child items) have the same qty of linked CF + // => both arrays will have same size() + // + // This is because to get cfields we look only to CF enabled for node type. + $cfieldsLeft = $cfields['left_side']['value']; + $cfieldsRight = $cfields['right_side']['value']; + if (! is_null($cfieldsLeft)) { + $key2loop = array_keys($cfieldsLeft); + $cmp = array(); + $type_code = $itemMgr->cfield_mgr->get_available_types(); + $key2convert = array( + 'lvalue', + 'rvalue' + ); + + $formats = array( + 'date' => config_get('date_format') + ); + $cfg = config_get('gui'); + $cfCfg = config_get('custom_fields'); + foreach ($key2loop as $cf_key) { + // $cfg->show_custom_fields_without_value + // false => At least one value has to be <> NULL to include on comparsion results + if ($cfCfg->show_custom_fields_without_value || + (! $cfCfg->show_custom_fields_without_value && + ((! is_null($cfieldsRight) && + ! is_null($cfieldsRight[$cf_key]['value'])) || + (! is_null($cfieldsLeft) && + ! is_null($cfieldsLeft[$cf_key]['value']))))) { + $cmp[$cf_key] = array( + 'label' => htmlspecialchars($cfieldsLeft[$cf_key]['label']), + 'lvalue' => $cfieldsLeft[$cf_key]['value'], + 'rvalue' => ! is_null($cfieldsRight) ? $cfieldsRight[$cf_key]['value'] : null, + 'changed' => $cfieldsLeft[$cf_key]['value'] != + $cfieldsRight[$cf_key]['value'] + ); + + if ($type_code[$cfieldsLeft[$cf_key]['type']] == 'date' || + $type_code[$cfieldsLeft[$cf_key]['type']] == 'datetime') { + $t_date_format = str_replace("%", "", $formats['date']); // must remove % + foreach ($key2convert as $fx) { + if ($doIt = ($cmp[$cf_key][$fx] != null)) { + switch ($type_code[$cfieldsLeft[$cf_key]['type']]) { + case 'datetime': + $t_date_format .= " " . + $cfg->custom_fields->time_format; + break; + } + } + if ($doIt) { + $cmp[$cf_key][$fx] = date($t_date_format, + $cmp[$cf_key][$fx]); + } + } + } + } + } + } + return ! empty($cmp) ? $cmp : null; +} + +/** + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->req_spec_id = isset($_REQUEST['req_spec_id']) ? intval( + $_REQUEST['req_spec_id']) : 0; + $args->doCompare = isset($_REQUEST['doCompare']) ? true : false; + $args->left_item_id = isset($_REQUEST['left_item_id']) ? intval( + $_REQUEST['left_item_id']) : - 1; + $args->right_item_id = isset($_REQUEST['right_item_id']) ? intval( + $_REQUEST['right_item_id']) : - 1; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->useDaisyDiff = (isset($_REQUEST['diff_method']) && + ($_REQUEST['diff_method'] == 'htmlCompare')) ? 1 : 0; + + $diffEngineCfg = config_get("diffEngine"); + $args->context = null; + if (! isset($_REQUEST['context_show_all'])) { + $args->context = (isset($_REQUEST['context']) && + is_numeric($_REQUEST['context'])) ? $_REQUEST['context'] : $diffEngineCfg->context; + } + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, $lbl, &$itemMgr) +{ + $reqSpecCfg = config_get('req_spec_cfg'); + $guiObj = new stdClass(); + $guiObj->items = $itemMgr->get_history($argsObj->req_spec_id, + array( + 'output' => 'array', + 'decode_user' => true + )); + + // Truncate log message + if ($reqSpecCfg->log_message_len > 0) { + $loop2do = count($guiObj->items); + for ($idx = 0; $idx < $loop2do; $idx ++) { + if (strlen($guiObj->items[$idx]['log_message']) > + $reqSpecCfg->log_message_len) { + $guiObj->items[$idx]['log_message'] = substr( + $guiObj->items[$idx]['log_message'], 0, + $reqSpecCfg->log_message_len) . '...'; + } + $guiObj->items[$idx]['log_message'] = htmlspecialchars( + $guiObj->items[$idx]['log_message']); + } + } + $guiObj->req_spec_id = $argsObj->req_spec_id; + $guiObj->doCompare = $argsObj->doCompare; + $guiObj->context = $argsObj->context; + $guiObj->version_short = $lbl['version_short']; + $guiObj->diff = null; + return $guiObj; +} + +/** + */ +function prepareUserFeedback(&$dbHandler, &$guiObj, $labels, $sbs) +{ + $guiObj->leftID = $labels['revision'] . ':' . $sbs['left_item']['revision']; + $guiObj->rightID = $labels['revision'] . ':' . $sbs['right_item']['revision']; + $guiObj->subtitle = sprintf($labels['diff_details_rev'], + $sbs['left_item']['revision'], $sbs['left_item']['revision'], + $sbs['right_item']['revision'], $sbs['right_item']['revision']); +} + +/** + */ +function getAttrDiff($leftSide, $rightSide, $labels) +{ + $req_spec_cfg = config_get('req_spec_cfg'); + + // attribute => label definition on TL configuration (just if NOT NULL) + // order in this array will drive display order + $key2loop = array( + 'doc_id' => null, + 'name' => null, + 'type' => 'type_labels' + ); + foreach ($key2loop as $fkey => $lkey) { + // Need to decode + $cmp[$fkey] = array( + 'label' => htmlspecialchars($labels[$fkey]), + 'lvalue' => $leftSide[$fkey], + 'rvalue' => $rightSide[$fkey], + 'changed' => $leftSide[$fkey] != $rightSide[$fkey] + ); + + if (! is_null($lkey)) { + $decode = $req_spec_cfg->$lkey; + $cmp[$fkey]['lvalue'] = lang_get($decode[$cmp[$fkey]['lvalue']]); + $cmp[$fkey]['rvalue'] = lang_get($decode[$cmp[$fkey]['rvalue']]); + } + } + return $cmp; +} +?> diff --git a/lib/requirements/reqSpecEdit.php b/lib/requirements/reqSpecEdit.php index f8c60aa2cc..bf3a68e0d9 100644 --- a/lib/requirements/reqSpecEdit.php +++ b/lib/requirements/reqSpecEdit.php @@ -1,273 +1,317 @@ -tproject_id); -$gui = initialize_gui($db,$args,$req_cfg,$commandMgr); - -$context = new stdClass(); -$context->tproject_id = $args->tproject_id; -checkRights($db,$args->user,$context); - - -$auditContext = new stdClass(); -$auditContext->tproject = $args->tproject_name; -$commandMgr->setAuditContext($auditContext); - -$pFn = $args->doAction; -$op = null; -if(method_exists($commandMgr,$pFn)) -{ - $op = $commandMgr->$pFn($args,$_REQUEST); +tproject_id); +$gui = initializeGui($db, $args, $req_cfg, $commandMgr); + +$context = new stdClass(); +$context->tproject_id = $args->tproject_id; +checkRights($db, $args->user, $context); + +$auditContext = new stdClass(); +$auditContext->tproject = $args->tproject_name; +$commandMgr->setAuditContext($auditContext); + +$pFn = $args->doAction; +$op = null; +if (method_exists($commandMgr, $pFn)) { + $op = $commandMgr->$pFn($args, $_REQUEST); +} + +renderGui($args, $gui, $op, $templateCfg, $editorCfg); + +/** + */ +function initArgs() +{ + $iParams = array( + "countReq" => array( + tlInputParameter::INT_N, + 99999 + ), + "req_spec_id" => array( + tlInputParameter::INT_N + ), + "req_spec_revision_id" => array( + tlInputParameter::INT_N + ), + "parentID" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 250 + ), + "title" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "scope" => array( + tlInputParameter::STRING_N + ), + "doc_id" => array( + tlInputParameter::STRING_N, + 1, + 32 + ), + "nodes_order" => array( + tlInputParameter::ARRAY_INT + ), + "containerID" => array( + tlInputParameter::INT_N + ), + "itemSet" => array( + tlInputParameter::ARRAY_INT + ), + "reqSpecType" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "copy_testcase_assignment" => array( + tlInputParameter::CB_BOOL + ), + "save_rev" => array( + tlInputParameter::INT_N + ), + "do_save" => array( + tlInputParameter::INT_N + ), + "log_message" => array( + tlInputParameter::STRING_N + ), + "file_id" => array( + tlInputParameter::INT_N + ), + "fileTitle" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + // i guess due to required revison log it is necessary to strip slashes + // after R_PARAMS call - at least this fixed the problem + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; + $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + $args->basehref = $_SESSION['basehref']; + + $args->parentID = is_null($args->parentID) ? $args->tproject_id : $args->parentID; + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : 0; + + $args->countReq = is_null($args->countReq) ? 0 : intval($args->countReq); + + // Process buttons + $args->op = null; + $btnSet = array( + 'toogleMon', + 'startMon', + 'stopMon' + ); + foreach ($btnSet as $btn) { + if (isset($_REQUEST[$btn])) { + $args->op = $btn; + break; + } + } + + $args->user = $_SESSION['currentUser']; + + return $args; +} + +/** + * renderGui + */ +function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg, $editorCfg) +{ + $smartyObj = new TLSmarty(); + $renderType = 'none'; + $tpl = $tpd = null; + + $actionOperation = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doDelete' => '', + 'doReorder' => '', + 'reorder' => '', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'createChild' => 'doCreate', + 'copy' => 'doCopy', + 'doCopy' => 'doCopy', + 'doFreeze' => 'doFreeze', + 'copyRequirements' => 'doCopyRequirements', + 'doCopyRequirements' => 'doCopyRequirements', + 'doCreateRevision' => 'doCreateRevision', + 'fileUpload' => '', + 'deleteFile' => '', + 'bulkReqMon' => 'doBulkReqMon', + 'doBulkReqMon' => 'doBulkReqMon' + ); + // ------------------------------------------------------------------------------------------------ + // Web Editor Processing + $owebEditor = web_editor('scope', $argsObj->basehref, $editorCfg); + switch ($argsObj->doAction) { + case "edit": + case "doCreate": + $owebEditor->Value = $argsObj->scope; + break; + + case "fileUpload": + case "deleteFile": + break; + + default: + if ($opObj->askForRevision || $opObj->askForLog || + ! $opObj->action_status_ok) { + $owebEditor->Value = $argsObj->scope; + } else { + $owebEditor->Value = getItemTemplateContents( + 'req_spec_template', $owebEditor->InstanceName, + $argsObj->scope); + } + break; + } + $guiObj->scope = $owebEditor->CreateHTML(); + $guiObj->editorType = $editorCfg['type']; + + // Tree refresh Processing + switch ($argsObj->doAction) { + case "doCreate": + case "doUpdate": + case "doCopyRequirements": + case "doCopy": + case "doFreeze": + case "doDelete": + case "doBulkReqMon": + $guiObj->refreshTree = $argsObj->refreshTree; + break; + } + + // GUI rendering Processing + switch ($argsObj->doAction) { + case "edit": + case "create": + case "createChild": + case "reorder": + case "doDelete": + case "doReorder": + case "doCreate": + case "doUpdate": + case "copyRequirements": + case "doCopyRequirements": + case "copy": + case "doCopy": + case "doFreeze": + case "doCreateRevision": + case "fileUpload": + case "deleteFile": + case "bulkReqMon": + case "doBulkReqMon": + $renderType = 'template'; + $key2loop = get_object_vars($opObj); + + if (! $opObj->action_status_ok) { + // Remember that scope normally is a WebRichEditor, and that + // we have already processed WebRichEditor + // Need to understand if remove of scope key can be done always + // no matter action_status_ok + unset($key2loop['scope']); + } + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + + $guiObj->operation = $actionOperation[$argsObj->doAction]; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + $tpd = isset($key2loop['template_dir']) ? $opObj->template_dir : $templateCfg->template_dir; + + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tpl = $tpd . $tpl; + } else { + $renderType = 'redirect'; + if (! is_null($guiObj->uploadOp) && ! $guiObj->uploadOp->statusOK) { + $tpl .= "&uploadOPStatusCode=" . + $guiObj->uploadOp->statusCode; + } + } + break; + } + + switch ($renderType) { + case 'template': + $smartyObj->assign('mgt_view_events', + has_rights($db, "mgt_view_events")); + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + echo 'Can not process RENDERING!!!'; + break; + } +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj, &$req_cfg, &$commandMgr) +{ + $gui = $commandMgr->initGuiBean(); + $gui->parentID = $argsObj->parentID; + $gui->user_feedback = null; + $gui->main_descr = null; + $gui->action_descr = null; + $gui->refreshTree = 0; + $gui->external_req_management = ($req_cfg->external_req_management == ENABLED) ? 1 : 0; + $gui->grants = new stdClass(); + $gui->grants->req_mgmt = has_rights($dbHandler, "mgt_modify_req"); + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req", + "mgt_modify_req" + ]; + pageAccessCheck($db, $user, $context); } - -renderGui($args,$gui,$op,$templateCfg,$editorCfg); - - -/** - * - * - */ -function init_args() -{ - $args = new stdClass(); - - $iParams = array("countReq" => array(tlInputParameter::INT_N,99999), - "req_spec_id" => array(tlInputParameter::INT_N), - "req_spec_revision_id" => array(tlInputParameter::INT_N), - "parentID" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,250), - "title" => array(tlInputParameter::STRING_N,0,100), - "scope" => array(tlInputParameter::STRING_N), - "doc_id" => array(tlInputParameter::STRING_N,1,32), - "nodes_order" => array(tlInputParameter::ARRAY_INT), - "containerID" => array(tlInputParameter::INT_N), - "itemSet" => array(tlInputParameter::ARRAY_INT), - "reqSpecType" => array(tlInputParameter::STRING_N,0,1), - "copy_testcase_assignment" => array(tlInputParameter::CB_BOOL), - "save_rev" => array(tlInputParameter::INT_N), - "do_save" => array(tlInputParameter::INT_N), - "log_message" => array(tlInputParameter::STRING_N), - "file_id" => array(tlInputParameter::INT_N), - "fileTitle" => array(tlInputParameter::STRING_N,0,100)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - // i guess due to required revison log it is necessary to strip slashes - // after R_PARAMS call - at least this fixed the problem - $_REQUEST=strings_stripSlashes($_REQUEST); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ""; - $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - $args->basehref = $_SESSION['basehref']; - - $args->parentID = is_null($args->parentID) ? $args->tproject_id : $args->parentID; - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) - ? $_SESSION['setting_refresh_tree_on_action'] : 0; - - $args->countReq = is_null($args->countReq) ? 0 : intval($args->countReq); - - // Process buttons - $args->op = null; - $btnSet = array('toogleMon','startMon','stopMon'); - foreach( $btnSet as $btn ) - { - if( isset($_REQUEST[$btn]) ) - { - $args->op = $btn; - break; - } - } - - $args->user = $_SESSION['currentUser']; - - return $args; -} - - -/** - * renderGui - * - */ -function renderGui(&$argsObj,$guiObj,$opObj,$templateCfg,$editorCfg) -{ - $smartyObj = new TLSmarty(); - $renderType = 'none'; - $tpl = $tpd = null; - - $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doDelete' => '', 'doReorder' => '', 'reorder' => '', - 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', - 'createChild' => 'doCreate', 'copy' => 'doCopy', - 'doCopy' => 'doCopy', - 'doFreeze' => 'doFreeze', - 'copyRequirements' => 'doCopyRequirements', - 'doCopyRequirements' => 'doCopyRequirements', - 'doCreateRevision' => 'doCreateRevision', - 'fileUpload' => '', 'deleteFile' => '', - 'bulkReqMon' => 'doBulkReqMon', - 'doBulkReqMon' => 'doBulkReqMon'); - // ------------------------------------------------------------------------------------------------ - // Web Editor Processing - $owebEditor = web_editor('scope',$argsObj->basehref,$editorCfg) ; - switch($argsObj->doAction) - { - case "edit": - case "doCreate": - $owebEditor->Value = $argsObj->scope; - break; - - case "fileUpload": - case "deleteFile": - break; - - default: - if($opObj->askForRevision || $opObj->askForLog || !$opObj->action_status_ok) - { - $owebEditor->Value = $argsObj->scope; - } - else - { - $owebEditor->Value = getItemTemplateContents('req_spec_template',$owebEditor->InstanceName,$argsObj->scope); - } - break; - } - $guiObj->scope = $owebEditor->CreateHTML(); - $guiObj->editorType = $editorCfg['type']; - - // Tree refresh Processing - switch($argsObj->doAction) - { - case "doCreate": - case "doUpdate": - case "doCopyRequirements": - case "doCopy": - case "doFreeze": - case "doDelete": - case "doBulkReqMon": - $guiObj->refreshTree = $argsObj->refreshTree; - break; - } - - // GUI rendering Processing - switch($argsObj->doAction) - { - case "edit": - case "create": - case "createChild": - case "reorder": - case "doDelete": - case "doReorder": - case "doCreate": - case "doUpdate": - case "copyRequirements": - case "doCopyRequirements": - case "copy": - case "doCopy": - case "doFreeze": - case "doCreateRevision": - case "fileUpload": - case "deleteFile": - case "bulkReqMon": - case "doBulkReqMon": - $renderType = 'template'; - $key2loop = get_object_vars($opObj); - - if($opObj->action_status_ok == false) - { - // Remember that scope normally is a WebRichEditor, and that - // we have already processed WebRichEditor - // Need to understand if remove of scope key can be done always - // no matter action_status_ok - unset($key2loop['scope']); - } - foreach($key2loop as $key => $value) - { - $guiObj->$key = $value; - } - - $guiObj->operation = $actionOperation[$argsObj->doAction]; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - $tpd = isset($key2loop['template_dir']) ? $opObj->template_dir : $templateCfg->template_dir; - - $pos = strpos($tpl, '.php'); - if ($pos === false) { - $tpl = $tpd . $tpl; - } else { - $renderType = 'redirect'; - if (null != $guiObj->uploadOp && $guiObj->uploadOp->statusOK == false) { - $tpl .= "&uploadOPStatusCode=" . $guiObj->uploadOp->statusCode; - } - } - break; - } - - switch($renderType) - { - case 'template': - $smartyObj->assign('mgt_view_events',has_rights($db,"mgt_view_events")); - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - echo 'Can not process RENDERING!!!'; - break; - } -} - -/** - * - * - */ -function initialize_gui(&$dbHandler, &$argsObj, &$req_cfg, &$commandMgr) -{ - $gui = $commandMgr->initGuiBean(); - $gui->parentID = $argsObj->parentID; - $gui->user_feedback = null; - $gui->main_descr = null; - $gui->action_descr = null; - $gui->refreshTree = 0; - $gui->external_req_management = ($req_cfg->external_req_management == ENABLED) ? 1 : 0; - $gui->grants = new stdClass(); - $gui->grants->req_mgmt = has_rights($dbHandler,"mgt_modify_req"); - - return $gui; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req","mgt_modify_req"]; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/requirements/reqSpecListTree.php b/lib/requirements/reqSpecListTree.php index d432ff7780..a69325c334 100644 --- a/lib/requirements/reqSpecListTree.php +++ b/lib/requirements/reqSpecListTree.php @@ -1,84 +1,86 @@ -tproject_id = $args->tproject_id; -checkRights($db,$args->user,$ctx); - -$control = new tlRequirementFilterControl($db); -$control->build_tree_menu($gui); -$control->formAction = ''; - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->assign('control', $control); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - */ -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 'undefned'; - $args->basehref = $_SESSION['basehref']; - - $args->user = isset($_SESSION['currentUser']) - ? $_SESSION['currentUser'] : null; - - return $args; +tproject_id = $args->tproject_id; +checkRights($db, $args->user, $ctx); + +$control = new tlRequirementFilterControl($db); +$control->build_tree_menu($gui); +$control->formAction = ''; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('control', $control); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 'undefned'; + $args->basehref = $_SESSION['basehref']; + + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + + return $args; +} + +/* + * function: initializeGui + * initialize gui (stdClass) object that will be used as argument + * in call to Template Engine. + * + * args: argsObj: object containing User Input and some session values + * basehref: URL to web home of your testlink installation. + * + * returns: stdClass object + * + * rev: + * + */ +function initializeGui($argsObj) +{ + $gui = new stdClass(); + $gui->tree_title = lang_get('title_navigator') . ' - ' . + lang_get('title_req_spec'); + + $gui->req_spec_manager_url = "lib/requirements/reqSpecView.php"; + $gui->req_manager_url = "lib/requirements/reqView.php"; + $gui->basehref = $argsObj->basehref; + + return $gui; +} + +/* + * rights check + */ +function checkRights(&$db, &$user, $context) +{ + $context->rightsOr = [ + "mgt_view_req", + "mgt_modify_req" + ]; + $context->rightsAnd = []; + pageAccessCheck($db, $user, $context); } - -/* - function: initializeGui - initialize gui (stdClass) object that will be used as argument - in call to Template Engine. - - args: argsObj: object containing User Input and some session values - basehref: URL to web home of your testlink installation. - - returns: stdClass object - - rev: - -*/ -function initializeGui($argsObj) -{ - $gui = new stdClass(); - $gui->tree_title = lang_get('title_navigator'). ' - ' . lang_get('title_req_spec'); - - $gui->req_spec_manager_url = "lib/requirements/reqSpecView.php"; - $gui->req_manager_url = "lib/requirements/reqView.php"; - $gui->basehref = $argsObj->basehref; - - return $gui; -} - -/* - * rights check - */ -function checkRights(&$db, &$user, $context) -{ - $context->rightsOr = ["mgt_view_req","mgt_modify_req"]; - $context->rightsAnd = []; - pageAccessCheck($db, $user, $context); -} \ No newline at end of file diff --git a/lib/requirements/reqSpecPrint.php b/lib/requirements/reqSpecPrint.php index 4d5a8e90f1..ecd86b5299 100644 --- a/lib/requirements/reqSpecPrint.php +++ b/lib/requirements/reqSpecPrint.php @@ -1,101 +1,112 @@ -reqspec_revision_id; -$target_id = ($target_id <= 0) ? $args->reqspec_id : $target_id; - -// $node = $tree_mgr->get_node_hierarchy_info($args->reqspec_id); -$node = $tree_mgr->get_node_hierarchy_info($target_id); - -$gui = new stdClass(); -$gui->object_name=''; -$gui->object_name = $node['name']; -$gui->page_title = sprintf(lang_get('print_requirement_specification'),$node['name']); -$gui->tproject_name=$args->tproject_name; -$gui->tproject_id=$args->tproject_id; -$gui->reqspec_id=$args->reqspec_id; - - -// Struture defined in printDocument.php -$options = array('toc' => 0, 'req_spec_scope' => 1, 'req_spec_author' => 1,'req_spec_type' =>1, - 'req_spec_cf' => 1,'req_spec_overwritten_count_reqs' => 1, - 'headerNumbering' => 0, 'docType' => SINGLE_REQSPEC); - -$text2print = ''; -$text2print .= renderHTMLHeader($gui->page_title,$_SESSION['basehref'],SINGLE_REQSPEC) . '' ; -//$text2print .= '

    ' . lang_get('req_specification') . '

    '; - -$text2print .= renderReqSpecNodeForPrinting($db, $node, $options,null,0,$args->tproject_id); - -// now get all it's children (just requirements). -$childrenReq = $reqspec_mgr->get_requirements($args->reqspec_id); -if( !is_null($childrenReq) && $req_cfg->show_child_reqs_on_reqspec_print_view) -{ - // IMPORTANT NOTICE: - // 'docType' => 'SINGLE_REQ' among other things remove the indent on req table - // that is present by default. - // That's why we need to pass any other value. - $reqPrintOpts = array('toc' => 0, 'req_linked_tcs' => 1, 'req_cf' => 1, - 'req_scope' => 1, 'req_relations' => 1, 'req_coverage' => 1, - 'req_status' => 1, 'req_type' => 1,'req_author'=> 1, - 'displayVersion' => 1, 'displayDates' => 1, - 'displayLastEdit' => 1, 'docType' => SINGLE_REQ); - - $text2print .= '

    ' . lang_get('reqs') . '

    '; - $loop2do = count($childrenReq); - for($rdx=0; $rdx < $loop2do; $rdx++) - { - $text2print .= renderReqForPrinting($db,$childrenReq[$rdx],$reqPrintOpts, - null,0,$args->tproject_id); - } -} -$text2print .= renderEOF(); -echo $text2print; - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->reqspec_id = isset($_REQUEST['reqspec_id']) ? intval($_REQUEST['reqspec_id']) : 0; - $args->reqspec_revision_id = isset($_REQUEST['reqspec_revision_id']) ? intval($_REQUEST['reqspec_revision_id']) : 0; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tproject_name = $_SESSION['testprojectName']; - - return $args; -} -?> \ No newline at end of file +reqspec_revision_id; +$target_id = ($target_id <= 0) ? $args->reqspec_id : $target_id; + +$node = $tree_mgr->get_node_hierarchy_info($target_id); + +$gui = new stdClass(); +$gui->object_name = ''; +$gui->object_name = $node['name']; +$gui->page_title = sprintf(lang_get('print_requirement_specification'), + $node['name']); +$gui->tproject_name = $args->tproject_name; +$gui->tproject_id = $args->tproject_id; +$gui->reqspec_id = $args->reqspec_id; + +// Struture defined in printDocument.php +$options = array( + 'toc' => 0, + 'req_spec_scope' => 1, + 'req_spec_author' => 1, + 'req_spec_type' => 1, + 'req_spec_cf' => 1, + 'req_spec_overwritten_count_reqs' => 1, + 'headerNumbering' => 0, + 'docType' => SINGLE_REQSPEC +); + +$text2print = ''; +$text2print .= renderHTMLHeader($gui->page_title, $_SESSION['basehref'], + SINGLE_REQSPEC) . ''; +$text2print .= renderReqSpecNodeForPrinting($db, $node, $options, null, 0); + +// now get all it's children (just requirements). +$childrenReq = $reqspec_mgr->get_requirements($args->reqspec_id); +if (! is_null($childrenReq) && $req_cfg->show_child_reqs_on_reqspec_print_view) { + // IMPORTANT NOTICE: + // 'docType' => 'SINGLE_REQ' among other things remove the indent on req table + // that is present by default. + // That's why we need to pass any other value. + $reqPrintOpts = array( + 'toc' => 0, + 'req_linked_tcs' => 1, + 'req_cf' => 1, + 'req_scope' => 1, + 'req_relations' => 1, + 'req_coverage' => 1, + 'req_status' => 1, + 'req_type' => 1, + 'req_author' => 1, + 'displayVersion' => 1, + 'displayDates' => 1, + 'displayLastEdit' => 1, + 'docType' => SINGLE_REQ + ); + + $text2print .= '

    ' . lang_get('reqs') . '

    '; + $loop2do = count($childrenReq); + for ($rdx = 0; $rdx < $loop2do; $rdx ++) { + $text2print .= renderReqForPrinting($db, $childrenReq[$rdx], + $reqPrintOpts, 0, $args->tproject_id); + } +} +$text2print .= renderEOF(); +echo $text2print; + +/** + * + * @return stdClass + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->reqspec_id = isset($_REQUEST['reqspec_id']) ? intval( + $_REQUEST['reqspec_id']) : 0; + $args->reqspec_revision_id = isset($_REQUEST['reqspec_revision_id']) ? intval( + $_REQUEST['reqspec_revision_id']) : 0; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = $_SESSION['testprojectName']; + + return $args; +} +?> diff --git a/lib/requirements/reqSpecSearch.php b/lib/requirements/reqSpecSearch.php index 3ab8b830f4..64ac7e11d7 100644 --- a/lib/requirements/reqSpecSearch.php +++ b/lib/requirements/reqSpecSearch.php @@ -1,243 +1,254 @@ -tprojectID); -$gui = $commandMgr->initGuiBean(); - -$edit_label = lang_get('requirement_spec'); -$edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; - -$gui->main_descr = lang_get('caption_search_form_req_spec'); -$gui->warning_msg = ''; -$gui->path_info = null; -$gui->resultSet = null; -$gui->tableSet = null; - -$itemSet = null; -if ($args->tprojectID) -{ - $tables = tlObjectWithDB::getDBTables(array('cfield_design_values', 'nodes_hierarchy', - 'req_specs','req_specs_revisions')); - $filter = null; - $join = null; - - - - // we use same approach used on requirements search => search on revisions - if ($args->requirement_document_id) { - $id=$db->prepare_string($args->requirement_document_id); - $filter['by_id'] = " AND RSPECREV.doc_id like '%{$id}%' "; - } - - if ($args->name) { - $title=$db->prepare_string($args->name); - $filter['by_name'] = " AND NHRSPEC.name like '%{$title}%' "; - } - - if ($args->reqSpecType != "notype") { - $type=$db->prepare_string($args->reqSpecType); - $filter['by_type'] = " AND RSPECREV.type='{$type}' "; - } - - if ($args->scope) { - $scope=$db->prepare_string($args->scope); - $filter['by_scope'] = " AND RSPECREV.scope like '%{$scope}%' "; - } - - if ($args->log_message) { - $log_message = $db->prepare_string($args->log_message); - $filter['by_log_message'] = " AND RSPECREV.log_message like '%{$log_message}%' "; - } - - - if($args->custom_field_id > 0) { - $args->custom_field_id = $db->prepare_int($args->custom_field_id); - $args->custom_field_value = $db->prepare_string($args->custom_field_value); - $join['by_custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id=RSPECREV.id "; - $filter['by_custom_field'] = " AND CFD.field_id={$args->custom_field_id} " . - " AND CFD.value like '%{$args->custom_field_value}%' "; - } - - $sql = " SELECT NHRSPEC.name, NHRSPEC.id, RSPEC.doc_id, RSPECREV.id AS revision_id, RSPECREV.revision " . - " FROM {$tables['req_specs']} RSPEC JOIN {$tables['req_specs_revisions']} RSPECREV " . - " ON RSPEC.id=RSPECREV.parent_id " . - " JOIN {$tables['nodes_hierarchy']} NHRSPEC " . - " ON NHRSPEC.id = RSPEC.id "; - - if(!is_null($join)) - { - $sql .= implode("",$join); - } - - $sql .= " AND RSPEC.testproject_id = {$args->tprojectID} "; - - if(!is_null($filter)) - { - $sql .= implode("",$filter); - } - - $sql .= ' ORDER BY id ASC, revision DESC '; - $itemSet = $db->fetchRowsIntoMap($sql,'id',database::CUMULATIVE); - -} - -$smarty = new TLSmarty(); -$gui->row_qty=count($itemSet); -if($gui->row_qty > 0) -{ - $gui->resultSet = $itemSet; - if($gui->row_qty <= $req_cfg->search->max_qty_for_display) - { - $req_set=array_keys($itemSet); - $options = array('output_format' => 'path_as_string'); - $gui->path_info=$tproject_mgr->tree_manager->get_full_path_verbose($req_set, $options); - } - else - { - $gui->warning_msg=lang_get('too_wide_search_criteria'); - } -} -else -{ - $gui->warning_msg=lang_get('no_records_found'); -} - -$table = buildExtTable($gui, $charset); -if (!is_null($table)) { - $gui->tableSet[] = $table; -} - -$gui->pageTitle = $gui->main_descr . " - " . lang_get('match_count') . ": " . $gui->row_qty; -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $tpl); - - -function buildExtTable($gui, $charset) -{ - $lbl = array('edit' => 'requirement_spec', 'rev' => 'revision_short','req_spec' => 'req_spec', - 'revision_tag' => 'revision_tag', 'open_on_new_window' => 'open_on_new_window'); - $labels = init_labels($lbl); - $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; - $table = null; - - // $gui->resultSet - - // key: reqspec_id - // value: array of matches - // array - // { - // [232][0]=>{"name" => "QA","id" => "232","doc_id" => "QA", - // "revision_id" => "251", "revision" => "4"} - // [1]=>{"name" => "QA","id" => "232","doc_id" => "QA", - // "revision_id" => "251", "revision" => "3"} - // ... - // } - // - // - if(count($gui->resultSet) > 0) - { - $matrixData = array(); - $columns = array(); - $columns[] = array('title_key' => 'req_spec', 'type' => 'text', 'groupable' => 'false', - 'hideable' => 'false'); - - $key2loop = array_keys($gui->resultSet); - foreach($key2loop as $rspec_id) - { - $rowData = array(); - - $itemSet = $gui->resultSet[$rspec_id]; - $rfx = &$itemSet[0]; - $path = ($gui->path_info[$rfx['id']]) ? $gui->path_info[$rfx['id']] . " / " : ""; - $edit_link = "" . - " "; - - $title = htmlentities($rfx['doc_id'], ENT_QUOTES, $charset) . ":" . - htmlentities($rfx['name'], ENT_QUOTES, $charset); - $cm = '' . - $labels['revision_tag'] . ' '; - // $link = $edit_link; - $matches = ''; - foreach($itemSet as $rx) - { - $matches .= sprintf($cm,$rx['revision_id'],$rx['revision']); - } - $rowData[] = $edit_link . $title . ' ' . $matches; - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_req_spec_search'); - $table->setSortByColumnName($labels['req_spec']); - $table->sortDirection = 'ASC'; - - $table->showToolbar = false; - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - $table->storeTableState = false; - } - return($table); -} - -/* - function: - - args: - - returns: - - */ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $strnull = array('requirement_document_id', 'name', 'scope', 'coverage', - 'custom_field_value', 'reqSpecType', 'log_message'); - - foreach($strnull as $keyvar) - { - $args->$keyvar = isset($_REQUEST[$keyvar]) ? trim($_REQUEST[$keyvar]) : null; - $args->$keyvar = !is_null($args->$keyvar) && strlen($args->$keyvar) > 0 ? trim($args->$keyvar) : null; - } - - $int0 = array('custom_field_id'); - foreach($int0 as $keyvar) - { - $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : 0; - } - - $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - return $args; -} -?> \ No newline at end of file +tprojectID); +$gui = $commandMgr->initGuiBean(); + +$edit_label = lang_get('requirement_spec'); +$edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; + +$gui->main_descr = lang_get('caption_search_form_req_spec'); +$gui->warning_msg = ''; +$gui->path_info = null; +$gui->resultSet = null; +$gui->tableSet = null; + +$itemSet = null; +if ($args->tprojectID) { + $tables = tlObjectWithDB::getDBTables( + array( + 'cfield_design_values', + 'nodes_hierarchy', + 'req_specs', + 'req_specs_revisions' + )); + $filter = null; + $join = null; + + // we use same approach used on requirements search => search on revisions + if ($args->requirement_document_id) { + $id = $db->prepare_string($args->requirement_document_id); + $filter['by_id'] = " AND RSPECREV.doc_id like '%{$id}%' "; + } + + if ($args->name) { + $title = $db->prepare_string($args->name); + $filter['by_name'] = " AND NHRSPEC.name like '%{$title}%' "; + } + + if ($args->reqSpecType != "notype") { + $type = $db->prepare_string($args->reqSpecType); + $filter['by_type'] = " AND RSPECREV.type='{$type}' "; + } + + if ($args->scope) { + $scope = $db->prepare_string($args->scope); + $filter['by_scope'] = " AND RSPECREV.scope like '%{$scope}%' "; + } + + if ($args->log_message) { + $log_message = $db->prepare_string($args->log_message); + $filter['by_log_message'] = " AND RSPECREV.log_message like '%{$log_message}%' "; + } + + if ($args->custom_field_id > 0) { + $args->custom_field_id = $db->prepare_int($args->custom_field_id); + $args->custom_field_value = $db->prepare_string( + $args->custom_field_value); + $join['by_custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id=RSPECREV.id "; + $filter['by_custom_field'] = " AND CFD.field_id={$args->custom_field_id} " . + " AND CFD.value like '%{$args->custom_field_value}%' "; + } + + $sql = " SELECT NHRSPEC.name, NHRSPEC.id, RSPEC.doc_id, RSPECREV.id AS revision_id, RSPECREV.revision " . + " FROM {$tables['req_specs']} RSPEC JOIN {$tables['req_specs_revisions']} RSPECREV " . + " ON RSPEC.id=RSPECREV.parent_id " . + " JOIN {$tables['nodes_hierarchy']} NHRSPEC " . + " ON NHRSPEC.id = RSPEC.id "; + + if (! is_null($join)) { + $sql .= implode("", $join); + } + + $sql .= " AND RSPEC.testproject_id = {$args->tprojectID} "; + + if (! is_null($filter)) { + $sql .= implode("", $filter); + } + + $sql .= ' ORDER BY id ASC, revision DESC '; + $itemSet = $db->fetchRowsIntoMap($sql, 'id', database::CUMULATIVE); +} + +$smarty = new TLSmarty(); +if (! empty($itemSet)) { + $gui->row_qty = count($itemSet); + $gui->resultSet = $itemSet; + if ($gui->row_qty <= $req_cfg->search->max_qty_for_display) { + $req_set = array_keys($itemSet); + $options = array( + 'output_format' => 'path_as_string' + ); + $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose( + $req_set, $options); + } else { + $gui->warning_msg = lang_get('too_wide_search_criteria'); + } +} else { + $gui->warning_msg = lang_get('no_records_found'); +} + +$table = buildExtTable($gui, $charset); +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$gui->pageTitle = $gui->main_descr . " - " . lang_get('match_count') . ": " . + $gui->row_qty; +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $tpl); + +function buildExtTable($gui, $charset) +{ + $lbl = array( + 'edit' => 'requirement_spec', + 'rev' => 'revision_short', + 'req_spec' => 'req_spec', + 'revision_tag' => 'revision_tag', + 'open_on_new_window' => 'open_on_new_window' + ); + $labels = init_labels($lbl); + $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; + $table = null; + + // $gui->resultSet - + // key: reqspec_id + // value: array of matches + // array + // { + // [232][0]=>{"name" => "QA","id" => "232","doc_id" => "QA", + // "revision_id" => "251", "revision" => "4"} + // [1]=>{"name" => "QA","id" => "232","doc_id" => "QA", + // "revision_id" => "251", "revision" => "3"} + // ... + // } + if (! empty($gui->resultSet)) { + $matrixData = array(); + $columns = array(); + $columns[] = array( + 'title_key' => 'req_spec', + 'type' => 'text', + 'groupable' => 'false', + 'hideable' => 'false' + ); + + $key2loop = array_keys($gui->resultSet); + foreach ($key2loop as $rspec_id) { + $rowData = array(); + + $itemSet = $gui->resultSet[$rspec_id]; + $rfx = &$itemSet[0]; + $edit_link = "" . + " "; + + $title = htmlentities($rfx['doc_id'], ENT_QUOTES, $charset) . ":" . + htmlentities($rfx['name'], ENT_QUOTES, $charset); + $cm = '' . $labels['revision_tag'] . + ' '; + $matches = ''; + foreach ($itemSet as $rx) { + $matches .= sprintf($cm, $rx['revision_id'], $rx['revision']); + } + $rowData[] = $edit_link . $title . ' ' . $matches; + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_req_spec_search'); + $table->setSortByColumnName($labels['req_spec']); + $table->sortDirection = 'ASC'; + + $table->showToolbar = false; + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $table->storeTableState = false; + } + return $table; +} + +/* + * function: + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $strnull = array( + 'requirement_document_id', + 'name', + 'scope', + 'coverage', + 'custom_field_value', + 'reqSpecType', + 'log_message' + ); + + foreach ($strnull as $keyvar) { + $args->$keyvar = isset($_REQUEST[$keyvar]) ? trim($_REQUEST[$keyvar]) : null; + $args->$keyvar = ! is_null($args->$keyvar) && strlen($args->$keyvar) > 0 ? trim( + $args->$keyvar) : null; + } + + $int0 = array( + 'custom_field_id' + ); + foreach ($int0 as $keyvar) { + $args->$keyvar = isset($_REQUEST[$keyvar]) ? intval($_REQUEST[$keyvar]) : 0; + } + + $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + return $args; +} +?> diff --git a/lib/requirements/reqSpecSearchForm.php b/lib/requirements/reqSpecSearchForm.php index 5660179f31..bd0ebb724f 100644 --- a/lib/requirements/reqSpecSearchForm.php +++ b/lib/requirements/reqSpecSearchForm.php @@ -1,66 +1,65 @@ -tcasePrefix = ''; - -$gui->mainCaption = lang_get('testproject') . " " . $args->tprojectName; - -$enabled = 1; -$no_filters = null; - -$gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design($args->tprojectID,$enabled, - $no_filters,'requirement_spec'); - -$reqSpecSet = $tproject_mgr->getOptionReqSpec($args->tprojectID,testproject::GET_NOT_EMPTY_REQSPEC); - -$gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf); -$gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet); - -$reqSpecCfg = config_get('req_spec_cfg'); -$gui->types = init_labels($reqSpecCfg->type_labels); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'reqSpecSearchForm.tpl'); - -/* - function: - - args: - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - - return $args; -} -?> \ No newline at end of file +tcasePrefix = ''; + +$gui->mainCaption = lang_get('testproject') . " " . $args->tprojectName; + +$enabled = 1; +$no_filters = null; + +$gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design( + $args->tprojectID, $enabled, $no_filters, 'requirement_spec'); + +$reqSpecSet = $tproject_mgr->getOptionReqSpec($args->tprojectID, + testproject::GET_NOT_EMPTY_REQSPEC); + +$gui->filter_by['design_scope_custom_fields'] = ! is_null($gui->design_cf); +$gui->filter_by['requirement_doc_id'] = ! is_null($reqSpecSet); + +$reqSpecCfg = config_get('req_spec_cfg'); +$gui->types = init_labels($reqSpecCfg->type_labels); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'reqSpecSearchForm.tpl'); + +/* + * function: + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $args->tprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + + return $args; +} +?> diff --git a/lib/requirements/reqSpecView.php b/lib/requirements/reqSpecView.php index 2bf29bbb94..34c0d09571 100644 --- a/lib/requirements/reqSpecView.php +++ b/lib/requirements/reqSpecView.php @@ -1,140 +1,147 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($tplCfg->template_dir . $tplCfg->default_template); - - -/** - * - */ -function init_args() -{ - $iParams = array("req_spec_id" => array(tlInputParameter::INT_N), - "refreshTree" => array(tlInputParameter::INT_N), - "uploadOPStatusCode" => array(tlInputParameter::STRING_N,0,30) ); - $args = new stdClass(); - R_PARAMS($iParams,$args); - $args->refreshTree = intval($args->refreshTree); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - - return $args; -} - -/** - * - * - */ -function initialize_gui(&$dbHandler,&$argsObj) -{ - $req_spec_mgr = new requirement_spec_mgr($dbHandler); - $tproject_mgr = new testproject($dbHandler); - $commandMgr = new reqSpecCommands($dbHandler, - $argsObj->tproject_id); - - $gui = $commandMgr->initGuiBean(); - $gui->refreshTree = $argsObj->refreshTree; - $gui->req_spec_cfg = config_get('req_spec_cfg'); - $gui->req_cfg = config_get('req_cfg'); - $gui->external_req_management = ($gui->req_cfg->external_req_management == ENABLED) ? 1 : 0; - - $gui->grants = new stdClass(); - $gui->grants->req_mgmt = - has_rights($db,"mgt_modify_req",$argsObj->tproject_id); - - $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); - $gui->revCount = $req_spec_mgr->getRevisionsCount($argsObj->req_spec_id); - - $gui->req_spec_id = intval($argsObj->req_spec_id); - $gui->parentID = $argsObj->req_spec_id; - - $gui->req_spec_revision_id = $gui->req_spec['revision_id']; - $gui->name = $gui->req_spec['title']; - - - $gui->tproject_name = $argsObj->tproject_name; - $gui->main_descr = lang_get('req_spec_short') . - config_get('gui_title_separator_1') . - "[{$gui->req_spec['doc_id']}] :: " . - $gui->req_spec['title']; - - $gui->refresh_tree = 'no'; - - $gui->cfields = $req_spec_mgr->html_table_of_custom_field_values($gui->req_spec_id, - $gui->req_spec_revision_id, - $argsObj->tproject_id); - - $gui->attachments = getAttachmentInfosFrom($req_spec_mgr,$argsObj->req_spec_id); - $gui->requirements_count = $req_spec_mgr->get_requirements_count($argsObj->req_spec_id); - - $gui->reqSpecTypeDomain = init_labels($gui->req_spec_cfg->type_labels); - - $prefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . urlencode($prefix) . - '&item=reqspec&id=' . urlencode($gui->req_spec['doc_id']); - - - $gui->fileUploadURL = $_SESSION['basehref'] . $req_spec_mgr->getFileUploadRelativeURL($gui->req_spec_id); - $gui->delAttachmentURL = $_SESSION['basehref'] . $req_spec_mgr->getDeleteAttachmentRelativeURL($gui->req_spec_id); - $gui->fileUploadMsg = ''; - $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; - - $cfg = new stdClass(); - $cfg->reqSpecCfg = getWebEditorCfg('requirement_spec'); - $gui->reqSpecEditorType = $cfg->reqSpecCfg['type']; - - $gui->btn_import_req_spec = ''; - $gui->reqMgrSystemEnabled = 0; - if( !is_null($reqMgrSystem = $commandMgr->getReqMgrSystem()) ) - { - $gui->btn_import_req_spec = sprintf(lang_get('importViaAPI'),$reqMgrSystem['reqmgrsystem_name']); - $gui->reqMgrSystemEnabled = 1; - } - - $gui->uploadOp = null; - if (trim($argsObj->uploadOPStatusCode) != '') { - $gui->uploadOp = new stdClass(); - $gui->uploadOp->statusOK = false; - $gui->uploadOp->statusCode = $argsObj->uploadOPStatusCode; - $gui->uploadOp->msg = lang_get($argsObj->uploadOPStatusCode); - } - - return $gui; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($tplCfg->template_dir . $tplCfg->default_template); + +/** + */ +function initArgs() +{ + $iParams = array( + "req_spec_id" => array( + tlInputParameter::INT_N + ), + "refreshTree" => array( + tlInputParameter::INT_N + ), + "uploadOPStatusCode" => array( + tlInputParameter::STRING_N, + 0, + 30 + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + $args->refreshTree = intval($args->refreshTree); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $req_spec_mgr = new requirement_spec_mgr($dbHandler); + $tproject_mgr = new testproject($dbHandler); + $commandMgr = new reqSpecCommands($dbHandler, $argsObj->tproject_id); + + $gui = $commandMgr->initGuiBean(); + $gui->refreshTree = $argsObj->refreshTree; + $gui->req_spec_cfg = config_get('req_spec_cfg'); + $gui->req_cfg = config_get('req_cfg'); + $gui->external_req_management = ($gui->req_cfg->external_req_management == + ENABLED) ? 1 : 0; + + $gui->grants = new stdClass(); + $gui->grants->req_mgmt = has_rights($db, "mgt_modify_req", + $argsObj->tproject_id); + + $gui->req_spec = $req_spec_mgr->get_by_id($argsObj->req_spec_id); + $gui->revCount = $req_spec_mgr->getRevisionsCount($argsObj->req_spec_id); + + $gui->req_spec_id = intval($argsObj->req_spec_id); + $gui->parentID = $argsObj->req_spec_id; + + $gui->req_spec_revision_id = $gui->req_spec['revision_id']; + $gui->name = $gui->req_spec['title']; + + $gui->tproject_name = $argsObj->tproject_name; + $gui->main_descr = lang_get('req_spec_short') . + config_get('gui_title_separator_1') . "[{$gui->req_spec['doc_id']}] :: " . + $gui->req_spec['title']; + + $gui->refresh_tree = 'no'; + + $gui->cfields = $req_spec_mgr->html_table_of_custom_field_values( + $gui->req_spec_id, $gui->req_spec_revision_id, $argsObj->tproject_id); + + $gui->attachments = getAttachmentInfosFrom($req_spec_mgr, + $argsObj->req_spec_id); + $gui->requirements_count = $req_spec_mgr->get_requirements_count( + $argsObj->req_spec_id); + + $gui->reqSpecTypeDomain = init_labels($gui->req_spec_cfg->type_labels); + + $prefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); + $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . + urlencode($prefix) . '&item=reqspec&id=' . + urlencode($gui->req_spec['doc_id']); + + $gui->fileUploadURL = $_SESSION['basehref'] . + $req_spec_mgr->getFileUploadRelativeURL($gui->req_spec_id); + $gui->delAttachmentURL = $_SESSION['basehref'] . + $req_spec_mgr->getDeleteAttachmentRelativeURL($gui->req_spec_id); + $gui->fileUploadMsg = ''; + $gui->import_limit = TL_REPOSITORY_MAXFILESIZE; + + $cfg = new stdClass(); + $cfg->reqSpecCfg = getWebEditorCfg('requirement_spec'); + $gui->reqSpecEditorType = $cfg->reqSpecCfg['type']; + + $gui->btn_import_req_spec = ''; + $gui->reqMgrSystemEnabled = 0; + if (! is_null($reqMgrSystem = $commandMgr->getReqMgrSystem())) { + $gui->btn_import_req_spec = sprintf(lang_get('importViaAPI'), + $reqMgrSystem['reqmgrsystem_name']); + $gui->reqMgrSystemEnabled = 1; + } + + $gui->uploadOp = null; + if (trim($argsObj->uploadOPStatusCode) != '') { + $gui->uploadOp = new stdClass(); + $gui->uploadOp->statusOK = false; + $gui->uploadOp->statusCode = $argsObj->uploadOPStatusCode; + $gui->uploadOp->msg = lang_get($argsObj->uploadOPStatusCode); + } + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/requirements/reqSpecViewRevision.php b/lib/requirements/reqSpecViewRevision.php index 6707c97be8..d1d92c8847 100644 --- a/lib/requirements/reqSpecViewRevision.php +++ b/lib/requirements/reqSpecViewRevision.php @@ -1,102 +1,107 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$smarty = new TLSmarty(); - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'reqSpecViewRevision.tpl'); - -/** - * - */ -function init_args() -{ - $iParams = array("item_id" => array(tlInputParameter::INT_N), - "showContextInfo" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - $user = $_SESSION['currentUser']; - $args->userID = $user->dbID; - - return $args; -} - -/** - * - * - */ -function initialize_gui(&$dbHandler,$argsObj) -{ - $tproject_mgr = new testproject($dbHandler); - $itemMgr = new requirement_spec_mgr($dbHandler); - $commandMgr = new reqSpecCommands($dbHandler,$argsObj->tproject_id); - - $gui = $commandMgr->initGuiBean(); - $gui->itemCfg = config_get('req_spec_cfg'); - $gui->tproject_name = $argsObj->tproject_name; - - $gui->grants = new stdClass(); - $gui->grants->req_mgmt = has_rights($dbHandler,"mgt_modify_req"); - - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->glueChar = config_get('testcase_cfg')->glue_character; - $gui->pieceSep = config_get('gui_title_separator_1'); - - $gui->item_id = $argsObj->item_id; - $info = $itemMgr->getRevisionByID($gui->item_id,array('decode_user' => true)); - $gui->item = $info; - - $gui->cfields = $itemMgr->html_table_of_custom_field_values(null,$gui->item_id,$argsObj->tproject_id); - $gui->show_title = false; - $gui->main_descr = lang_get('req_spec') . $gui->pieceSep . $gui->item['name']; - - $gui->showContextInfo = $argsObj->showContextInfo; - if($gui->showContextInfo) - { - $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->item['name']; - } - - $gui->itemSpecStatus = null; - $gui->itemTypeDomain = init_labels($gui->itemCfg->type_labels); - - return $gui; -} - - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$smarty = new TLSmarty(); + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'reqSpecViewRevision.tpl'); + +/** + */ +function initArgs() +{ + $iParams = array( + "item_id" => array( + tlInputParameter::INT_N + ), + "showContextInfo" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + $user = $_SESSION['currentUser']; + $args->userID = $user->dbID; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $tproject_mgr = new testproject($dbHandler); + $itemMgr = new requirement_spec_mgr($dbHandler); + $commandMgr = new reqSpecCommands($dbHandler, $argsObj->tproject_id); + + $gui = $commandMgr->initGuiBean(); + $gui->itemCfg = config_get('req_spec_cfg'); + $gui->tproject_name = $argsObj->tproject_name; + + $gui->grants = new stdClass(); + $gui->grants->req_mgmt = has_rights($dbHandler, "mgt_modify_req"); + + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); + $gui->glueChar = config_get('testcase_cfg')->glue_character; + $gui->pieceSep = config_get('gui_title_separator_1'); + + $gui->item_id = $argsObj->item_id; + $info = $itemMgr->getRevisionByID($gui->item_id, + array( + 'decode_user' => true + )); + $gui->item = $info; + + $gui->cfields = $itemMgr->html_table_of_custom_field_values(null, + $gui->item_id, $argsObj->tproject_id); + $gui->show_title = false; + $gui->main_descr = lang_get('req_spec') . $gui->pieceSep . $gui->item['name']; + + $gui->showContextInfo = $argsObj->showContextInfo; + if ($gui->showContextInfo) { + $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . + $gui->item['name']; + } + + $gui->itemSpecStatus = null; + $gui->itemTypeDomain = init_labels($gui->itemCfg->type_labels); + + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/requirements/reqTcAssign.php b/lib/requirements/reqTcAssign.php index 267685b632..65d43c566b 100644 --- a/lib/requirements/reqTcAssign.php +++ b/lib/requirements/reqTcAssign.php @@ -1,409 +1,458 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$bulkCounter = 0; -$bulkDone = false; -$bulkMsg = null; -$pfn = null; - -switch($args->doAction) { - case 'assign': - $pfn = "assign_to_tcase"; - break; - - case 'unassign': - $pfn = "delReqVersionTCVersionLinkByID"; - break; - - case 'bulkassign': - // need to check if we have test cases to work on - $tcase_set = getTargetTestCases($db,$args); - $bulkCounter = 0; - $bulkDone = true; - $args->edit = 'testsuite'; - if( !is_null($tcase_set) && count($tcase_set) > 0 ) { - $bulkCounter = doBulkAssignment($db,$args,$tcase_set); - } - break; - - case 'switchspec': - $args->edit = 'testsuite'; - break; -} - -if(!is_null($pfn)) { - $gui = doSingleTestCaseOperation($db,$args,$gui,$pfn); -} - -switch($args->edit) { - case 'testproject': - show_instructions('assignReqs'); - exit(); - break; - - case 'testsuite': - $gui = processTestSuite($db,$args,$gui); - $templateCfg->default_template = 'reqTcBulkAssignment.tpl'; - if($bulkDone) { - $gui->user_feedback = sprintf(lang_get('bulk_assigment_done'),$bulkCounter); - } - break; - - case 'testcase': - $gui = processTestCase($db,$args,$gui); - break; - - default: - tlog("Wrong GET/POST arguments.", 'ERROR'); - exit(); - break; -} - -$tpl = $templateCfg->template_dir . $templateCfg->default_template; -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($tpl); - - -/** - * - */ -function init_args() { - $iParams = array("id" => array(tlInputParameter::INT_N), - "req_id" => array(tlInputParameter::ARRAY_INT), - "link_id" => array(tlInputParameter::ARRAY_INT), - - "req" => array(tlInputParameter::INT_N), - "showCloseButton" => array(tlInputParameter::STRING_N,0,1), - "doAction" => array(tlInputParameter::STRING_N,0,100), - "edit" => array(tlInputParameter::STRING_N,0,100), - "unassign" => array(tlInputParameter::STRING_N,0,1), - "assign" => array(tlInputParameter::STRING_N,0,1), - "form_token" => array(tlInputParameter::INT_N), - "callback" => array(tlInputParameter::STRING_N,0,1), - "idSRS" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - // take care of proper escaping when magic_quotes_gpc is enabled - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->idReqSpec = null; - $args->idReq = $args->req; - $args->reqIdSet = $args->req_id; - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - - $args->tcaseSet = null; - if(isset($_SESSION['edit_mode'][$args->form_token]['testcases_to_show'])) { - $args->tcaseSet = $_SESSION['edit_mode'][$args->form_token]['testcases_to_show']; - } - - if(is_null($args->doAction)) { - $args->doAction = ($args->unassign != "") ? "unassign" : null; - } - - if(is_null($args->doAction)){ - $args->doAction = ($args->assign != "") ? "assign" : null; - } - - if ($args->idSRS) { - $args->idReqSpec = $args->idSRS; - $_SESSION['currentSrsId'] = $args->idReqSpec; - } - else if(isset($_SESSION['currentSrsId']) && intval($_SESSION['currentSrsId']) > 0) { - $args->idReqSpec = intval($_SESSION['currentSrsId']); - } - - - $args->user = $_SESSION['currentUser']; - return $args; -} - -/** - * - * - */ -function processTestSuite(&$dbHandler,&$argsObj,&$guiObj) { - $tproject_mgr = new testproject($dbHandler); - - $guiObj->bulkassign_warning_msg = ''; - $guiObj->tsuite_id = $argsObj->id; - - $tsuite_info = $tproject_mgr->tree_manager->get_node_hierarchy_info($guiObj->tsuite_id); - $guiObj->pageTitle = lang_get('test_suite') . config_get('gui_title_separator_1') . $tsuite_info['name']; - - $guiObj->req_specs = $tproject_mgr->genComboReqSpec($argsObj->tproject_id,'dotted'," "); - - $guiObj->selectedReqSpec = $argsObj->idReqSpec; - $guiObj->selectedReqSpecName = ''; - - $guiObj->tcase_number = 0; - $guiObj->has_req_spec = false; - - if(!is_null($guiObj->req_specs) && count($guiObj->req_specs)) { - $guiObj->has_req_spec = true; - - if(is_null($argsObj->idReqSpec)) { - $guiObj->selectedReqSpec = key($guiObj->req_specs); - } - $guiObj->selectedReqSpecName = - trim($guiObj->req_specs[$guiObj->selectedReqSpec],' '); - - $req_spec_mgr = new requirement_spec_mgr($dbHandler); - - $getOpt = array('output' => 'array'); - $guiObj->requirements = - $req_spec_mgr->getAllLatestRQVOnReqSpec($guiObj->selectedReqSpec,$getOpt); - - $guiObj->reqCountOnReqSpec = count((array)$guiObj->requirements); - - $guiObj->reqCountFeedback = - sprintf(lang_get('req_on_req_spec'),$guiObj->reqCountOnReqSpec, - $guiObj->selectedReqSpecName); - - - $tcase_set = getTargetTestCases($dbHandler,$argsObj); - $guiObj->tcase_number = count($tcase_set); - if( $guiObj->tcase_number > 0 ) { - $guiObj->bulkassign_warning_msg = - sprintf(lang_get('bulk_req_assign_msg'),$guiObj->tcase_number,$tsuite_info['name']); - } else { - $guiObj->bulkassign_warning_msg = - lang_get('bulk_req_assign_no_test_cases'); - } - } - return $guiObj; -} - -/** - * - * - */ -function doBulkAssignment(&$dbHandler,&$argsObj,$targetTestCaseSet = null) -{ - $req_mgr = new requirement_mgr($dbHandler); - $assignmentCounter = 0; - $requirements = array_keys($argsObj->reqIdSet); - if(!is_null($requirements) && count($requirements) > 0) - { - $tcase_set = $targetTestCaseSet; - if( is_null($tcase_set) ) - { - $tsuite_mgr = new testsuite($dbHandler); - $tcase_set = $tsuite_mgr->get_testcases_deep($argsObj->id,'only_id'); - } - - if( !is_null($tcase_set) && count($tcase_set) ) - { - // $assignmentCounter = $req_mgr->bulk_assignment($requirements,$tcase_set,$argsObj->user->dbID); - - $assignmentCounter = - $req_mgr->bulkAssignLatestREQVTCV($requirements,$tcase_set,$argsObj->user->dbID); - - } - - } - return $assignmentCounter; -} - -/** - * - */ -function doSingleTestCaseOperation(&$dbHandler,&$argsObj,&$guiObj,$pfn) { - $msg = ''; - - switch($pfn) { - case 'assign_to_tcase': - $items = array_keys($argsObj->reqIdSet); - break; - - case 'delReqVersionTCVersionLinkByID': - $items = array_keys($argsObj->link_id); - break; - } - - if( count($items) == 0 ) { - $guiObj->user_feedback = lang_get('req_msg_noselect'); - return $guiObj; - } - - $req_mgr = new requirement_mgr($dbHandler); - - - switch($pfn) { - case 'assign_to_tcase': - foreach ($items as $idOneReq) { - $res = $req_mgr->$pfn($idOneReq,$argsObj->id,$argsObj->user->dbID); - if (!$res) { - $msg .= $idOneReq . ', '; - } - } - if (!empty($msg)) { - $guiObj->user_feedback = lang_get('req_msg_notupdated_coverage') . $msg; - } - break; - - case 'delReqVersionTCVersionLinkByID': - foreach ($items as $idLink) { - $res = $req_mgr->$pfn($idLink); - if (!$res) { - $msg .= $idOneReq . ', '; - } - } - if (!empty($msg)) { - $guiObj->user_feedback = lang_get('req_msg_notupdated_coverage') . $msg; - } - break; - } - - return $guiObj; -} - - -/** - * - * - */ -function array_diff_byId($arrAll, $arrPart) { - - if (is_null($arrAll) || !count($arrAll)) { - return null; - } - - if (is_null($arrPart) || !count($arrPart)) { - return $arrAll; - } - - $arrTempAll = array(); - foreach ($arrAll as $penny) { - $highLander[$penny['id']] = $penny; - } - - foreach ($arrPart as $penny) { - if(isset($highLander[$penny['id']])) { - unset($highLander[$penny['id']]); - } - } - - return array_values($highLander); -} - - -/** - * processTestCase - * - */ -function processTestCase(&$dbHandler,&$argsObj,&$guiObj) { - $tproject_mgr = new testproject($dbHandler); - $guiObj->arrReqSpec = $tproject_mgr->genComboReqSpec($argsObj->tproject_id,'dotted'," "); - $SRS_qty = count($guiObj->arrReqSpec); - - if($SRS_qty > 0) { - $tc_mgr = new testcase($dbHandler); - $tcase = $tc_mgr->get_by_id($argsObj->id,testcase::LATEST_VERSION); - $tcase = current($tcase); - if($tcase) { - $guiObj->tcTitle = $tcase['name']; - $guiObj->tcVersion = $tcase['version']; - - // get test case version execution status - $tcversion_id = $tcase['id']; - $statusQuo = $tc_mgr->get_versions_status_quo($argsObj->id,$tcversion_id); - - $statusQuo = current($statusQuo); - $guiObj->tcaseHasBeenExecuted = (intval($statusQuo['executed']) > 0); - - // get first ReqSpec if not defined - if(is_null($argsObj->idReqSpec)) { - reset($guiObj->arrReqSpec); - $argsObj->idReqSpec = key($guiObj->arrReqSpec); - } - - if($argsObj->idReqSpec) { - $req_spec_mgr = new requirement_spec_mgr($dbHandler); - $fx = array('link_status' => array(LINK_TC_REQ_OPEN,LINK_TC_REQ_CLOSED_BY_EXEC)); - $theAssigned = $req_spec_mgr->getReqsOnSpecForLatestTCV($argsObj->idReqSpec,$argsObj->id,null,$fx); - - $guiObj->assignedReq = $theAssigned; - $guiObj->allReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec); - - $guiObj->unassignedReq = array_diff_byId($guiObj->allReq, $guiObj->assignedReq); - } - } - } - return $guiObj; -} - -/** - * - */ -function initializeGui(&$dbH,$argsObj) { - $guiObj = new stdClass(); - $guiObj->user_feedback = ''; - $guiObj->tcTitle = $guiObj->assignedReq = null; - $guiObj->unassignedReq = $guiObj->arrReqSpec = null; - - $guiObj->showCloseButton = $argsObj->showCloseButton; - $guiObj->selectedReqSpec = $argsObj->idReqSpec; - $guiObj->form_token = $argsObj->form_token; - - $guiObj->tcase_id = $argsObj->id; - $guiObj->callback = $argsObj->callback; - - $reqCfg = getWebEditorCfg('requirement'); - $guiObj->reqEditorType = $reqCfg['type']; - $reqCfg = getWebEditorCfg('requirement_spec'); - $guiObj->reqSpecEditorType = $reqCfg['type']; - - $guiObj->req_tcase_link_management = - $argsObj->user->hasRightOnProj($dbH,'req_tcase_link_management'); - - return $guiObj; -} - -/** - * - */ -function getTargetTestCases(&$dbHandler,&$argsObj) { - $mgr = new testsuite($dbHandler); - $items = $mgr->get_testcases_deep($argsObj->id,'only_id'); - - if(!is_null($argsObj->tcaseSet)) { - $rr = array_intersect($items,$argsObj->tcaseSet); - $items = $rr; - } - - return $items; -} - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["req_tcase_link_management"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$bulkCounter = 0; +$bulkDone = false; +$bulkMsg = null; +$pfn = null; + +switch ($args->doAction) { + case 'assign': + $pfn = "assign_to_tcase"; + break; + + case 'unassign': + $pfn = "delReqVersionTCVersionLinkByID"; + break; + + case 'bulkassign': + // need to check if we have test cases to work on + $tcase_set = getTargetTestCases($db, $args); + $bulkCounter = 0; + $bulkDone = true; + $args->edit = 'testsuite'; + if (! is_null($tcase_set) && ! empty($tcase_set)) { + $bulkCounter = doBulkAssignment($db, $args, $tcase_set); + } + break; + + case 'switchspec': + $args->edit = 'testsuite'; + break; +} + +if (! is_null($pfn)) { + $gui = doSingleTestCaseOperation($db, $args, $gui, $pfn); +} + +switch ($args->edit) { + case 'testproject': + show_instructions('assignReqs'); + exit(); + break; + + case 'testsuite': + $gui = processTestSuite($db, $args, $gui); + $templateCfg->default_template = 'reqTcBulkAssignment.tpl'; + if ($bulkDone) { + $gui->user_feedback = sprintf(lang_get('bulk_assigment_done'), + $bulkCounter); + } + break; + + case 'testcase': + $gui = processTestCase($db, $args, $gui); + break; + + default: + tlog("Wrong GET/POST arguments.", 'ERROR'); + exit(); + break; +} + +$tpl = $templateCfg->template_dir . $templateCfg->default_template; +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($tpl); + +/** + */ +function initArgs() +{ + $iParams = array( + "id" => array( + tlInputParameter::INT_N + ), + "req_id" => array( + tlInputParameter::ARRAY_INT + ), + "link_id" => array( + tlInputParameter::ARRAY_INT + ), + + "req" => array( + tlInputParameter::INT_N + ), + "showCloseButton" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "edit" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "unassign" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "assign" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "form_token" => array( + tlInputParameter::INT_N + ), + "callback" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "idSRS" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + // take care of proper escaping when magic_quotes_gpc is enabled + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->idReqSpec = null; + $args->idReq = $args->req; + $args->reqIdSet = $args->req_id; + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + + $args->tcaseSet = null; + if (isset($_SESSION['edit_mode'][$args->form_token]['testcases_to_show'])) { + $args->tcaseSet = $_SESSION['edit_mode'][$args->form_token]['testcases_to_show']; + } + + if (is_null($args->doAction)) { + $args->doAction = ($args->unassign != "") ? "unassign" : null; + } + + if (is_null($args->doAction)) { + $args->doAction = ($args->assign != "") ? "assign" : null; + } + + if ($args->idSRS) { + $args->idReqSpec = $args->idSRS; + $_SESSION['currentSrsId'] = $args->idReqSpec; + } elseif (isset($_SESSION['currentSrsId']) && + intval($_SESSION['currentSrsId']) > 0) { + $args->idReqSpec = intval($_SESSION['currentSrsId']); + } + + $args->user = $_SESSION['currentUser']; + return $args; +} + +/** + */ +function processTestSuite(&$dbHandler, &$argsObj, &$guiObj) +{ + $tproject_mgr = new testproject($dbHandler); + + $guiObj->bulkassign_warning_msg = ''; + $guiObj->tsuite_id = $argsObj->id; + + $tsuite_info = $tproject_mgr->tree_manager->get_node_hierarchy_info( + $guiObj->tsuite_id); + $guiObj->pageTitle = lang_get('test_suite') . + config_get('gui_title_separator_1') . $tsuite_info['name']; + + $guiObj->req_specs = $tproject_mgr->genComboReqSpec($argsObj->tproject_id, + 'dotted', " "); + + $guiObj->selectedReqSpec = $argsObj->idReqSpec; + $guiObj->selectedReqSpecName = ''; + + $guiObj->tcase_number = 0; + $guiObj->has_req_spec = false; + + if (! is_null($guiObj->req_specs) && count($guiObj->req_specs)) { + $guiObj->has_req_spec = true; + + if (is_null($argsObj->idReqSpec)) { + $guiObj->selectedReqSpec = key($guiObj->req_specs); + } + $guiObj->selectedReqSpecName = trim( + $guiObj->req_specs[$guiObj->selectedReqSpec], ' '); + + $req_spec_mgr = new requirement_spec_mgr($dbHandler); + + $getOpt = array( + 'output' => 'array' + ); + $guiObj->requirements = $req_spec_mgr->getAllLatestRQVOnReqSpec( + $guiObj->selectedReqSpec, $getOpt); + + $guiObj->reqCountOnReqSpec = count((array) $guiObj->requirements); + + $guiObj->reqCountFeedback = sprintf(lang_get('req_on_req_spec'), + $guiObj->reqCountOnReqSpec, $guiObj->selectedReqSpecName); + + $tcase_set = getTargetTestCases($dbHandler, $argsObj); + $guiObj->tcase_number = count($tcase_set); + if ($guiObj->tcase_number > 0) { + $guiObj->bulkassign_warning_msg = sprintf( + lang_get('bulk_req_assign_msg'), $guiObj->tcase_number, + $tsuite_info['name']); + } else { + $guiObj->bulkassign_warning_msg = lang_get( + 'bulk_req_assign_no_test_cases'); + } + } + return $guiObj; +} + +/** + */ +function doBulkAssignment(&$dbHandler, &$argsObj, $targetTestCaseSet = null) +{ + $req_mgr = new requirement_mgr($dbHandler); + $assignmentCounter = 0; + $requirements = array_keys($argsObj->reqIdSet); + if (! is_null($requirements) && count($requirements) > 0) { + $tcase_set = $targetTestCaseSet; + if (is_null($tcase_set)) { + $tsuite_mgr = new testsuite($dbHandler); + $tcase_set = $tsuite_mgr->get_testcases_deep($argsObj->id, 'only_id'); + } + + if (! is_null($tcase_set) && count($tcase_set)) { + $assignmentCounter = $req_mgr->bulkAssignLatestREQVTCV( + $requirements, $tcase_set, $argsObj->user->dbID); + } + } + return $assignmentCounter; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param string $pfn + * @return stdClass + */ +function doSingleTestCaseOperation(&$dbHandler, &$argsObj, &$guiObj, $pfn) +{ + $msg = ''; + + switch ($pfn) { + case 'assign_to_tcase': + $items = array_keys($argsObj->reqIdSet); + break; + + case 'delReqVersionTCVersionLinkByID': + $items = array_keys($argsObj->link_id); + break; + } + + if (count($items) == 0) { + $guiObj->user_feedback = lang_get('req_msg_noselect'); + return $guiObj; + } + + $req_mgr = new requirement_mgr($dbHandler); + + switch ($pfn) { + case 'assign_to_tcase': + foreach ($items as $idOneReq) { + $res = $req_mgr->$pfn($idOneReq, $argsObj->id, + $argsObj->user->dbID); + if (! $res) { + $msg .= $idOneReq . ', '; + } + } + if (! empty($msg)) { + $guiObj->user_feedback = lang_get('req_msg_notupdated_coverage') . + $msg; + } + break; + + case 'delReqVersionTCVersionLinkByID': + foreach ($items as $idLink) { + $res = $req_mgr->$pfn($idLink); + if (! $res) { + $msg .= $idLink . ', '; + } + } + if (! empty($msg)) { + $guiObj->user_feedback = lang_get('req_msg_notupdated_coverage') . + $msg; + } + break; + } + + return $guiObj; +} + +/** + */ +function arrayDiffById($arrAll, $arrPart) +{ + if (is_null($arrAll) || ! count($arrAll)) { + return null; + } + + if (is_null($arrPart) || ! count($arrPart)) { + return $arrAll; + } + + foreach ($arrAll as $penny) { + $highLander[$penny['id']] = $penny; + } + + foreach ($arrPart as $penny) { + if (isset($highLander[$penny['id']])) { + unset($highLander[$penny['id']]); + } + } + + return array_values($highLander); +} + +/** + * processTestCase + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param stdClass $guiObj + * @return stdClass + */ +function processTestCase(&$dbHandler, &$argsObj, &$guiObj) +{ + $tproject_mgr = new testproject($dbHandler); + $guiObj->arrReqSpec = $tproject_mgr->genComboReqSpec($argsObj->tproject_id, + 'dotted', " "); + $srs_qty = count($guiObj->arrReqSpec); + + if ($srs_qty > 0) { + $tc_mgr = new testcase($dbHandler); + $tcase = $tc_mgr->get_by_id($argsObj->id, testcase::LATEST_VERSION); + $tcase = current($tcase); + if ($tcase) { + $guiObj->tcTitle = $tcase['name']; + $guiObj->tcVersion = $tcase['version']; + + // get test case version execution status + $tcversion_id = $tcase['id']; + $statusQuo = $tc_mgr->getVersionsStatusQuo($argsObj->id, + $tcversion_id); + + $statusQuo = current($statusQuo); + $guiObj->tcaseHasBeenExecuted = (intval($statusQuo['executed']) > 0); + + // get first ReqSpec if not defined + if (is_null($argsObj->idReqSpec)) { + reset($guiObj->arrReqSpec); + $argsObj->idReqSpec = key($guiObj->arrReqSpec); + } + + if ($argsObj->idReqSpec) { + $req_spec_mgr = new requirement_spec_mgr($dbHandler); + $fx = array( + 'link_status' => array( + LINK_TC_REQ_OPEN, + LINK_TC_REQ_CLOSED_BY_EXEC + ) + ); + $theAssigned = $req_spec_mgr->getReqsOnSpecForLatestTCV( + $argsObj->idReqSpec, $argsObj->id, null, $fx); + + $guiObj->assignedReq = $theAssigned; + $guiObj->allReq = $req_spec_mgr->get_requirements( + $argsObj->idReqSpec); + + $guiObj->unassignedReq = arrayDiffById($guiObj->allReq, + $guiObj->assignedReq); + } + } + } + return $guiObj; +} + +/** + */ +function initializeGui(&$dbH, $argsObj) +{ + $guiObj = new stdClass(); + $guiObj->user_feedback = ''; + $guiObj->tcTitle = $guiObj->assignedReq = null; + $guiObj->unassignedReq = $guiObj->arrReqSpec = null; + + $guiObj->showCloseButton = $argsObj->showCloseButton; + $guiObj->selectedReqSpec = $argsObj->idReqSpec; + $guiObj->form_token = $argsObj->form_token; + + $guiObj->tcase_id = $argsObj->id; + $guiObj->callback = $argsObj->callback; + + $reqCfg = getWebEditorCfg('requirement'); + $guiObj->reqEditorType = $reqCfg['type']; + $reqCfg = getWebEditorCfg('requirement_spec'); + $guiObj->reqSpecEditorType = $reqCfg['type']; + + $guiObj->req_tcase_link_management = $argsObj->user->hasRightOnProj($dbH, + 'req_tcase_link_management'); + + return $guiObj; +} + +/** + */ +function getTargetTestCases(&$dbHandler, &$argsObj) +{ + $mgr = new testsuite($dbHandler); + $items = $mgr->get_testcases_deep($argsObj->id, 'only_id'); + + if (! is_null($argsObj->tcaseSet)) { + $rr = array_intersect($items, $argsObj->tcaseSet); + $items = $rr; + } + + return $items; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "req_tcase_link_management" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/requirements/reqView.php b/lib/requirements/reqView.php index d8c9f30d47..e25fe4edc5 100644 --- a/lib/requirements/reqView.php +++ b/lib/requirements/reqView.php @@ -1,279 +1,300 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'reqViewVersions.tpl'); - -/** - * - */ -function init_args( &$reqMgr ) { - $_REQUEST=strings_stripSlashes($_REQUEST); - $iParams = array("req_id" => array(tlInputParameter::INT_N), - "requirement_id" => array(tlInputParameter::INT_N), - "req_version_id" => array(tlInputParameter::INT_N), - "showReqSpecTitle" => array(tlInputParameter::INT_N), - "refreshTree" => array(tlInputParameter::INT_N), - "relation_add_result_msg" => array(tlInputParameter::STRING_N), - "user_feedback" => array(tlInputParameter::STRING_N), - "uploadOPStatusCode" => array(tlInputParameter::STRING_N,0,30)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if($args->req_id <= 0) { - $args->req_id = $args->requirement_id; - } - - $args->reqVersionIDFromCaller = $args->req_version_id; - $args->showAllVersions = false; - - if( $args->req_version_id == 0 ) { - $args->showAllVersions = true; - $lv = $reqMgr->get_last_version_info($args->req_id); - $args->req_version_id = intval($lv['id']); - } - - $args->refreshTree = intval($args->refreshTree); - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - $args->user = $_SESSION['currentUser']; - $args->userID = $args->user->dbID; - - return $args; +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'reqViewVersions.tpl'); + +/** + */ +function initArgs(&$reqMgr) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $iParams = array( + "req_id" => array( + tlInputParameter::INT_N + ), + "requirement_id" => array( + tlInputParameter::INT_N + ), + "req_version_id" => array( + tlInputParameter::INT_N + ), + "showReqSpecTitle" => array( + tlInputParameter::INT_N + ), + "refreshTree" => array( + tlInputParameter::INT_N + ), + "relation_add_result_msg" => array( + tlInputParameter::STRING_N + ), + "user_feedback" => array( + tlInputParameter::STRING_N + ), + "uploadOPStatusCode" => array( + tlInputParameter::STRING_N, + 0, + 30 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if ($args->req_id <= 0) { + $args->req_id = $args->requirement_id; + } + + $args->reqVersionIDFromCaller = $args->req_version_id; + $args->showAllVersions = false; + + if ($args->req_version_id == 0) { + $args->showAllVersions = true; + $lv = $reqMgr->getLastVersionInfo($args->req_id); + $args->req_version_id = intval($lv['id']); + } + + $args->refreshTree = intval($args->refreshTree); + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + $args->user = $_SESSION['currentUser']; + $args->userID = $args->user->dbID; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, $argsObj, &$tproject_mgr, &$req_mgr) +{ + $commandMgr = new reqCommands($dbHandler); + + $gui = $commandMgr->initGuiBean($argsObj); + + $opt = array( + 'renderImageInline' => true + ); + $gui->req_versions = $req_mgr->get_by_id($gui->req_id, $gui->version_option, + 1, $opt); + + $gui->reqHasBeenDeleted = false; + if (is_null($gui->req_versions)) { + // this means that requirement does not exist anymore. + // We have to give just that info to user + $gui->reqHasBeenDeleted = true; + $gui->main_descr = lang_get('req_does_not_exist'); + unset($gui->show_match_count); + return $gui; // >>>----> Bye! + } + + // Everything OK, go ahead + $tproject_id = $req_mgr->getTestProjectID($argsObj->requirement_id); + $target_id = $argsObj->tproject_id; + if ($isAlien = ($tproject_id != $argsObj->tproject_id)) { + $target_id = $tproject_id; + } + + $gui->grants = getGrants($dbHandler, $argsObj->user, $target_id); + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); + + $gui->reqMonitors = $req_mgr->getReqMonitors($gui->req_id); + $gui->btn_monitor_mgmt = lang_get('btn_start_mon'); + $gui->btn_monitor_action = 'startMonitoring'; + if (isset($gui->reqMonitors[$argsObj->userID])) { + $gui->btn_monitor_mgmt = lang_get('btn_stop_mon'); + $gui->btn_monitor_action = 'stopMonitoring'; + } + + $gui->req = current($gui->req_versions); + + // 2018 $gui->req_coverage = $req_mgr->get_coverage($gui->req_id); + // This need to become an array. + $loop2do = count($gui->req_versions); + $gui->current_req_coverage = array(); + $gui->other_req_coverage = array(); + for ($cvx = 0; $cvx < $loop2do; $cvx ++) { + $bebe = $gui->req_versions[$cvx]['version_id']; + + if ($cvx == 0) { + $gui->current_req_coverage = $req_mgr->getActiveForReqVersion($bebe); + } else { + $gui->other_req_coverage[0][] = $req_mgr->getActiveForReqVersion( + $bebe); + } + } + + $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . + urlencode($gui->tcasePrefix) . '&item=req&id=' . + urlencode($gui->req['req_doc_id']); + + // Same for all versions because we only use the FILE ID + // need to be refactored + $gui->delAttachmentURL = $_SESSION['basehref'] . + $req_mgr->getDeleteAttachmentRelativeURL($gui->req_id, 0); + + $gui->fileUploadURL = array(); + $gui->fileUploadURL[$gui->req_version_id] = $_SESSION['basehref'] . + $req_mgr->getFileUploadRelativeURL($gui->req_id, $gui->req_version_id); + + $gui->log_target = null; + $loop2do = count($gui->req_versions); + for ($rqx = 0; $rqx < $loop2do; $rqx ++) { + $gui->log_target[] = ($gui->req_versions[$rqx]['revision_id'] > 0) ? $gui->req_versions[$rqx]['revision_id'] : $gui->req_versions[$rqx]['version_id']; + } + + $gui->req_has_history = count( + $req_mgr->get_history($gui->req_id, array( + 'output' => 'array' + ))) > 1; + + // This seems weird but is done to adapt template than can + // display multiple requirements. + // This logic has been borrowed from test case versions management + $gui->current_version[0] = array( + $gui->req + ); + $gui->cfields_current_version[0] = $req_mgr->html_table_of_custom_field_values( + $gui->req_id, $gui->req['version_id'], $argsObj->tproject_id); + + // Now CF for other Versions + $gui->other_versions[0] = null; + $gui->cfields_other_versions[] = null; + if (count($gui->req_versions) > 1) { + $gui->other_versions[0] = array_slice($gui->req_versions, 1); + $loop2do = count($gui->other_versions[0]); + for ($qdx = 0; $qdx < $loop2do; $qdx ++) { + $target_version = $gui->other_versions[0][$qdx]['version_id']; + $gui->cfields_other_versions[0][$qdx] = $req_mgr->html_table_of_custom_field_values( + $gui->req_id, $target_version, $argsObj->tproject_id); + + // File Upload Management + $gui->fileUploadURL[$target_version] = $_SESSION['basehref'] . + $req_mgr->getFileUploadRelativeURL($gui->req_id, $target_version); + } + } + + $gui->show_title = false; + $gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->req['title']; + + $gui->showReqSpecTitle = $argsObj->showReqSpecTitle; + if ($gui->showReqSpecTitle) { + $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . + $gui->req['req_spec_title']; + } + + if ($gui->showAllVersions) { + $versionSet = array(); + $loop2do = count($gui->req_versions); + for ($ggx = 0; $ggx < $loop2do; $ggx ++) { + $versionSet[] = intval($gui->req_versions[$ggx]['version_id']); + } + } else { + $versionSet = array( + $gui->req_version_id + ); + } + + foreach ($versionSet as $kiwi) { + $gui->attachments[$kiwi] = getAttachmentInfosFrom($req_mgr, $kiwi); + } + + $gui->reqStatus = init_labels($gui->req_cfg->status_labels); + $gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels); + + $gui->req_relations = false; + $gui->req_relation_select = false; + $gui->testproject_select = false; + $gui->req_add_result_msg = isset($argsObj->relation_add_result_msg) ? $argsObj->relation_add_result_msg : ""; + + if ($gui->req_cfg->relations->enable) { + $gui->req_relations = $req_mgr->get_relations($gui->req_id); + $gui->req_relations['rw'] = ! $isAlien; + $gui->req_relation_select = $req_mgr->init_relation_type_select(); + if ($gui->req_cfg->relations->interproject_linking) { + $gui->testproject_select = initTestprojectSelect($argsObj->userID, + $argsObj->tproject_id, $tproject_mgr); + } + } + + $gui->uploadOp = null; + if (trim($argsObj->uploadOPStatusCode) != '') { + $gui->uploadOp = new stdClass(); + $gui->uploadOp->statusOK = false; + $gui->uploadOp->statusCode = $argsObj->uploadOPStatusCode; + $gui->uploadOp->msg = lang_get($argsObj->uploadOPStatusCode); + } + + return $gui; +} + +/** + */ +function getGrants(&$dbH, &$userObj, $tproject_id) +{ + $grants = new stdClass(); + $gk = array( + 'req_mgmt' => "mgt_modify_req", + 'monitor_req' => "monitor_requirement", + 'req_tcase_link_management' => 'req_tcase_link_management', + 'unfreeze_req' => 'mgt_unfreeze_req' + ); + + foreach ($gk as $p => $g) { + $grants->$p = $userObj->hasRight($dbH, $g, $tproject_id); + } + return $grants; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); +} + +/** + * Initializes the select field for the testprojects. + * + * @return array $htmlSelect array with info, needed to create testproject select box on template + */ +function initTestprojectSelect($userID, $tprojectID, &$tprojectMgr) +{ + $opt = array( + 'output' => 'map_name_with_inactive_mark', + 'order_by' => config_get('gui')->tprojects_combo_order_by + ); + $testprojects = $tprojectMgr->get_accessible_for_user($userID, $opt); + return array( + 'items' => $testprojects, + 'selected' => $tprojectID + ); } - -/** - * - * - */ -function initialize_gui(&$dbHandler,$argsObj,&$tproject_mgr,&$req_mgr) { - $commandMgr = new reqCommands($dbHandler); - - $gui = $commandMgr->initGuiBean( $argsObj ); - - $opt = array('renderImageInline' => true); - $gui->req_versions = - $req_mgr->get_by_id($gui->req_id, $gui->version_option,1,$opt); - - $gui->reqHasBeenDeleted = false; - if( is_null($gui->req_versions) ) { - // this means that requirement does not exist anymore. - // We have to give just that info to user - $gui->reqHasBeenDeleted = true; - $gui->main_descr = lang_get('req_does_not_exist'); - unset($gui->show_match_count); - return $gui; // >>>----> Bye! - } - - // Everything OK, go ahead - $tproject_id = $req_mgr->getTestProjectID($argsObj->requirement_id); - $target_id = $argsObj->tproject_id; - if( ($isAlien = ($tproject_id != $argsObj->tproject_id)) ) { - $target_id = $tproject_id; - } - - $gui->grants = getGrants($dbHandler,$argsObj->user,$target_id); - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - - - $gui->reqMonitors = $req_mgr->getReqMonitors($gui->req_id); - $gui->btn_monitor_mgmt = lang_get('btn_start_mon'); - $gui->btn_monitor_action = 'startMonitoring'; - if(isset($gui->reqMonitors[$argsObj->userID])) { - $gui->btn_monitor_mgmt = lang_get('btn_stop_mon'); - $gui->btn_monitor_action = 'stopMonitoring'; - } - - $gui->req = current($gui->req_versions); - - // 2018 $gui->req_coverage = $req_mgr->get_coverage($gui->req_id); - // This need to become an array. - $loop2do = count($gui->req_versions); - $gui->current_req_coverage = array(); - $gui->other_req_coverage = array(); - for($cvx = 0 ; $cvx < $loop2do; $cvx++) { - $bebe = $gui->req_versions[$cvx]['version_id']; - - if( $cvx == 0 ) { - $gui->current_req_coverage = $req_mgr->getActiveForReqVersion($bebe); - } else { - $gui->other_req_coverage[0][] = $req_mgr->getActiveForReqVersion($bebe); - } - } - - $gui->direct_link = $_SESSION['basehref'] . 'linkto.php?tprojectPrefix=' . - urlencode($gui->tcasePrefix) . '&item=req&id=' . urlencode($gui->req['req_doc_id']); - - - /* - $gui->fileUploadURL = $gui->delAttachmentURL = $_SESSION['basehref']; - $gui->fileUploadURL .= - $req_mgr->getFileUploadRelativeURL($gui->req_id, $gui->req_version_id); - - $gui->delAttachmentURL .= - $req_mgr->getDeleteAttachmentRelativeURL($gui->req_id, $gui->req_version_id); - */ - - // Same for all versions because we only use the FILE ID - // need to be refactored - $gui->delAttachmentURL = $_SESSION['basehref'] . - $req_mgr->getDeleteAttachmentRelativeURL($gui->req_id,0); - - $gui->fileUploadURL = array(); - $gui->fileUploadURL[$gui->req_version_id] = $_SESSION['basehref'] . - $req_mgr->getFileUploadRelativeURL($gui->req_id, $gui->req_version_id); - - $gui->log_target = null; - $loop2do = count($gui->req_versions); - for($rqx = 0; $rqx < $loop2do; $rqx++) { - $gui->log_target[] = ($gui->req_versions[$rqx]['revision_id'] > 0) ? $gui->req_versions[$rqx]['revision_id'] : - $gui->req_versions[$rqx]['version_id']; - } - - $gui->req_has_history = count($req_mgr->get_history($gui->req_id, array('output' => 'array'))) > 1; - - - // This seems weird but is done to adapt template than can - // display multiple requirements. - // This logic has been borrowed from test case versions management - $gui->current_version[0] = array($gui->req); - $gui->cfields_current_version[0] = - $req_mgr->html_table_of_custom_field_values($gui->req_id,$gui->req['version_id'], - $argsObj->tproject_id); - - // Now CF for other Versions - $gui->other_versions[0] = null; - $gui->cfields_other_versions[] = null; - if( count($gui->req_versions) > 1 ) { - $gui->other_versions[0] = array_slice($gui->req_versions,1); - $loop2do = count($gui->other_versions[0]); - for($qdx=0; $qdx < $loop2do; $qdx++) { - $target_version = $gui->other_versions[0][$qdx]['version_id']; - $gui->cfields_other_versions[0][$qdx]= - $req_mgr->html_table_of_custom_field_values($gui->req_id,$target_version,$argsObj->tproject_id); - - // File Upload Management - $gui->fileUploadURL[$target_version] = $_SESSION['basehref'] . - $req_mgr->getFileUploadRelativeURL($gui->req_id, $target_version); - } - } - - $gui->show_title = false; - $gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->req['title']; - - $gui->showReqSpecTitle = $argsObj->showReqSpecTitle; - if($gui->showReqSpecTitle) { - $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->req['req_spec_title']; - } - - - if( $gui->showAllVersions ) { - $versionSet = array(); - $loop2do = count($gui->req_versions); - for( $ggx=0; $ggx < $loop2do; $ggx++ ) { - $versionSet[] = intval($gui->req_versions[$ggx]['version_id']); - } - } else { - $versionSet = array($gui->req_version_id); - } - - foreach ($versionSet as $kiwi) { - $gui->attachments[$kiwi] = getAttachmentInfosFrom($req_mgr,$kiwi); - } - - $gui->reqStatus = init_labels($gui->req_cfg->status_labels); - $gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels); - - $gui->req_relations = FALSE; - $gui->req_relation_select = FALSE; - $gui->testproject_select = FALSE; - $gui->req_add_result_msg = isset($argsObj->relation_add_result_msg) ? - $argsObj->relation_add_result_msg : ""; - - if ($gui->req_cfg->relations->enable) { - $gui->req_relations = $req_mgr->get_relations($gui->req_id); - $gui->req_relations['rw'] = !$isAlien; - $gui->req_relation_select = $req_mgr->init_relation_type_select(); - if ($gui->req_cfg->relations->interproject_linking) { - $gui->testproject_select = initTestprojectSelect($argsObj->userID, $argsObj->tproject_id,$tproject_mgr); - } - } - - $gui->uploadOp = null; - if (trim($argsObj->uploadOPStatusCode) != '') { - $gui->uploadOp = new stdClass(); - $gui->uploadOp->statusOK = false; - $gui->uploadOp->statusCode = $argsObj->uploadOPStatusCode; - $gui->uploadOp->msg = lang_get($argsObj->uploadOPStatusCode); - } - - return $gui; -} - - -/** - * - * - */ -function getGrants( &$dbH, &$userObj, $tproject_id ) { - - $grants = new stdClass(); - $gk = array('req_mgmt' => "mgt_modify_req", 'monitor_req' => "monitor_requirement", - 'req_tcase_link_management' => 'req_tcase_link_management', - 'unfreeze_req' => 'mgt_unfreeze_req'); - - foreach($gk as $p => $g) { - $grants->$p = $userObj->hasRight($dbH,$g,$tproject_id); - } - return $grants; -} - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); -} - - - -/** - * Initializes the select field for the testprojects. - * - * @return array $htmlSelect array with info, needed to create testproject select box on template - */ -function initTestprojectSelect($userID, $tprojectID, &$tprojectMgr) { - $opt = array('output' => 'map_name_with_inactive_mark', 'order_by' => config_get('gui')->tprojects_combo_order_by); - $testprojects = $tprojectMgr->get_accessible_for_user($userID,$opt); - $htmlSelect = array('items' => $testprojects, 'selected' => $tprojectID); - return $htmlSelect; -} \ No newline at end of file diff --git a/lib/requirements/reqViewRevision.php b/lib/requirements/reqViewRevision.php index 0e8ab17ae8..e5edfca602 100644 --- a/lib/requirements/reqViewRevision.php +++ b/lib/requirements/reqViewRevision.php @@ -1,123 +1,130 @@ -tproject_id = $args->tproject_id; -checkRights($db,$_SESSION['currentUser'],$context); - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'reqViewRevisionRO.tpl'); - -/** - * - */ -function init_args() { - $iParams = array("item_id" => array(tlInputParameter::INT_N), - "showReqSpecTitle" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - $user = $_SESSION['currentUser']; - $args->userID = $user->dbID; - - return $args; -} - -/** - * - * - */ -function initialize_gui(&$dbHandler,$argsObj) { - $tproject_mgr = new testproject($dbHandler); - $req_mgr = new requirement_mgr($dbHandler); - $commandMgr = new reqCommands($dbHandler); - - $gui = $commandMgr->initGuiBean(); - $gui->req_cfg = config_get('req_cfg'); - $gui->tproject_name = $argsObj->tproject_name; - - $gui->grants = new stdClass(); - $gui->grants->req_mgmt = has_rights($dbHandler,"mgt_modify_req"); - - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - $gui->glueChar = config_get('testcase_cfg')->glue_character; - $gui->pieceSep = config_get('gui_title_separator_1'); - - $gui->item_id = $argsObj->item_id; - - // identify item is version or revision ? - $node_type_id = $req_mgr->tree_mgr->get_available_node_types(); - $node_id_type = array_flip($node_type_id); - $item = $req_mgr->tree_mgr->get_node_hierarchy_info($gui->item_id); - - // target_is is db id of item, item['id'] is the REQ ID. - // for several logics we need to DB id (target_id) - $info = null; - $getOpt = array('renderImageInline' => true); - switch ($node_id_type[$item['node_type_id']]) { - case 'requirement_version': - $info = $req_mgr->get_version($gui->item_id,$getOpt); - $info['revision_id'] = -1; - $info['target_id'] = $reqVersionID = $info['version_id']; - - break; - - case 'requirement_revision': - $info = $req_mgr->get_revision($gui->item_id,$getOpt); - $info['target_id'] = $info['revision_id']; - - $reqVersionID = $info['req_version_id']; - break; - } - $gui->reqCoverage = $req_mgr->getActiveForReqVersion($reqVersionID); - - $gui->item = $info; - $gui->cfields = $req_mgr->html_table_of_custom_field_values(null,$gui->item_id,$argsObj->tproject_id); - $gui->show_title = false; - $gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->item['title']; - - $gui->showReqSpecTitle = $argsObj->showReqSpecTitle; - if($gui->showReqSpecTitle) { - $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . $gui->item['req_spec_title']; - } - - $gui->reqStatus = init_labels($gui->req_cfg->status_labels); - $gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels); - return $gui; -} - - - -/** - * - */ -function checkRights(&$db,&$user,&$context) -{ - $context->rightsOr = []; - $context->rightsAnd = ["mgt_view_req"]; - pageAccessCheck($db, $user, $context); +tproject_id = $args->tproject_id; +checkRights($db, $_SESSION['currentUser'], $context); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'reqViewRevisionRO.tpl'); + +/** + */ +function initArgs() +{ + $iParams = array( + "item_id" => array( + tlInputParameter::INT_N + ), + "showReqSpecTitle" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + $user = $_SESSION['currentUser']; + $args->userID = $user->dbID; + + return $args; +} + +/** + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $tproject_mgr = new testproject($dbHandler); + $req_mgr = new requirement_mgr($dbHandler); + $commandMgr = new reqCommands($dbHandler); + + $gui = $commandMgr->initGuiBean(); + $gui->req_cfg = config_get('req_cfg'); + $gui->tproject_name = $argsObj->tproject_name; + + $gui->grants = new stdClass(); + $gui->grants->req_mgmt = has_rights($dbHandler, "mgt_modify_req"); + + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); + $gui->glueChar = config_get('testcase_cfg')->glue_character; + $gui->pieceSep = config_get('gui_title_separator_1'); + + $gui->item_id = $argsObj->item_id; + + // identify item is version or revision ? + $node_type_id = $req_mgr->tree_mgr->get_available_node_types(); + $node_id_type = array_flip($node_type_id); + $item = $req_mgr->tree_mgr->get_node_hierarchy_info($gui->item_id); + + // target_is is db id of item, item['id'] is the REQ ID. + // for several logics we need to DB id (target_id) + $info = null; + $getOpt = array( + 'renderImageInline' => true + ); + switch ($node_id_type[$item['node_type_id']]) { + case 'requirement_version': + $info = $req_mgr->get_version($gui->item_id, $getOpt); + $info['revision_id'] = - 1; + $info['target_id'] = $reqVersionID = $info['version_id']; + + break; + + case 'requirement_revision': + $info = $req_mgr->get_revision($gui->item_id, $getOpt); + $info['target_id'] = $info['revision_id']; + + $reqVersionID = $info['req_version_id']; + break; + } + $gui->reqCoverage = $req_mgr->getActiveForReqVersion($reqVersionID); + + $gui->item = $info; + $gui->cfields = $req_mgr->html_table_of_custom_field_values(null, + $gui->item_id, $argsObj->tproject_id); + $gui->show_title = false; + $gui->main_descr = lang_get('req') . $gui->pieceSep . $gui->item['title']; + + $gui->showReqSpecTitle = $argsObj->showReqSpecTitle; + if ($gui->showReqSpecTitle) { + $gui->parent_descr = lang_get('req_spec_short') . $gui->pieceSep . + $gui->item['req_spec_title']; + } + + $gui->reqStatus = init_labels($gui->req_cfg->status_labels); + $gui->reqTypeDomain = init_labels($gui->req_cfg->type_labels); + return $gui; +} + +/** + */ +function checkRights(&$db, &$user, &$context) +{ + $context->rightsOr = []; + $context->rightsAnd = [ + "mgt_view_req" + ]; + pageAccessCheck($db, $user, $context); } diff --git a/lib/results/baselinel1l2.php b/lib/results/baselinel1l2.php index 5892ef7d1f..901a245414 100644 --- a/lib/results/baselinel1l2.php +++ b/lib/results/baselinel1l2.php @@ -1,597 +1,680 @@ -do_report['status_ok'] = 1; - $gui->do_report['msg'] = ''; - -$tables = tlObject::getDBTables(array('baseline_l1l2_context', - 'baseline_l1l2_details', - 'nodes_hierarchy')); - -// Get virtual columns -$sql = "SELECT distinct(status) as status_col - FROM {$tables['baseline_l1l2_context']} BLC - JOIN {$tables['baseline_l1l2_details']} BLDT - ON BLDT.context_id = BLC.id - WHERE BLC.testplan_id = $args->tplan_id"; - -$statusRS = $db->fetchRowsIntoMap($sql,'status_col'); -$cfg = config_get('results'); -$codeToStatus = array_flip($cfg['status_code']); -$statusToLabel = $cfg['status_label']; -$statusDisplayOrder = $cfg['status_order']; -$statusCols = array(); -$gui->columnsDefinition = array(); - -foreach ($statusDisplayOrder as $x => $code) { - $statusCols[$code] = $statusToLabel[$codeToStatus[$code]]; - $gui->columnsDefinition[$codeToStatus[$code]] = - array('qty' => lang_get($statusCols[$code]), - 'percentage' => "[%]"); - - $data_tpl[$codeToStatus[$code]] = array('qty' => 0, 'percentage' => 0); -} - - -//foreach ($gui->platformSet as $plat_id => $plat_name) { - $sql = "SELECT context_id,BLDT.id AS detail_id, - testplan_id,platform_id, - begin_exec_ts,end_exec_ts,creation_ts, - top_tsuite_id,child_tsuite_id,status,qty,total_tc, - TS_TOP.name AS top_name, TS_CHI.name AS child_name - FROM {$tables['baseline_l1l2_context']} BLC - JOIN {$tables['baseline_l1l2_details']} BLDT - ON BLDT.context_id = BLC.id - JOIN {$tables['nodes_hierarchy']} AS TS_TOP - ON TS_TOP.id = top_tsuite_id - JOIN {$tables['nodes_hierarchy']} AS TS_CHI - ON TS_CHI.id = child_tsuite_id - WHERE BLC.testplan_id = $args->tplan_id - ORDER BY BLC.creation_ts DESC, top_name ASC,child_name ASC"; - - - $keyCols = array('platform_id','context_id', - 'top_tsuite_id','child_tsuite_id'); - $rsu = $db->fetchRowsIntoMap4l($sql,$keyCols,true); - - - -// Generate statistics for each platform -// Platforms are ordered by name -foreach ($rsu as $plat_id => $dataByContext) { - $gui->statistics = array(); - - $gui->statistics[$plat_id] = array(); - $gui->span[$plat_id] = array(); - - $rx = 0; - foreach ($dataByContext as $context_id => $dataByTop) { - $gui->statistics[$plat_id][$rx] = array(); - $gui->span[$plat_id][$rx] = null; - - $rrr = current(current($dataByTop))[0]; - reset($dataByTop); - $gui->span[$plat_id][$rx] = - array('begin' => $rrr['begin_exec_ts'], - 'end' => $rrr['end_exec_ts'], - 'baseline_ts' => $rrr['creation_ts']); - - foreach ($dataByTop as $top_id => $dataByChild) { - foreach ($dataByChild as $child_id => $dataX) { - $gui->statistics[$plat_id][$rx][$child_id] = array(); - $hand = &$gui->statistics[$plat_id][$rx][$child_id]; - - $dfx = $dataX[0]; - $hand['name'] = $dfx['top_name'] . ':' . $dfx['child_name']; - $hand['total_tc'] = $dfx['total_tc']; - $hand['percentage_completed'] = -1; - $hand['details'] = $data_tpl; - $hand['parent_id'] = $top_id; - - foreach ($dataX as $xx => $xmen) { - $pp = ($hand['total_tc'] > 0) ? - (round(($xmen['qty']/$hand['total_tc']) * 100,1)) : 0; - $hand['details'][$codeToStatus[$xmen['status']]] = - array('qty' => $xmen['qty'],'percentage' => $pp); - } - - // Calculate percentage completed, using all exec status - // other than not run - if ($hand['total_tc'] > 0) { - $hand['percentage_completed'] = - $hand['total_tc'] - $hand['details']['not_run']['qty']; - $hand['percentage_completed'] = - round(($hand['percentage_completed']/$hand['total_tc']) * 100,1); - } - } - } - $rx++; - } -} - - -/* -array(1) { - [187]=> - array(10) { - [33984]=> - array(6) { - ["type"]=> string(6) "tsuite" - ["name"]=> - string(55) "PT/08/TMS/Costing:PT/08.01/Price List & Rate Management" - ["parent_id"]=> string(5) "33953" - ["total_tc"]=> int(218) - ["percentage_completed"]=> string(4) "95.4" - ["details"]=> - array(4) { - ["not_run"]=> array(2) {["qty"]=>int(10) - ["percentage"]=> string(3) "4.6"} - ["passed"]=> - } - } -*/ - - - -$timerOff = microtime(true); -$gui->elapsed_time = round($timerOff - $timerOn,2); - -if ($args->spreadsheet) { - createSpreadsheet($gui,$args,$tplan_mgr); -} - -$smarty = new TLSmarty; -$smarty->assign('gui', $gui); -displayReport($tplCfg->tpl, $smarty, $args->format,$mailCfg); - - -/** - * - * - */ -function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . - $labels['testproject'] . ' : ' . - $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - */ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr) { - - list($add2args,$gui) = initUserEnv($dbHandler,$argsObj); - - $gui->fakePlatform = array(''); - $gui->title = lang_get('baseline_l1l2'); - $gui->do_report = array(); - $gui->showPlatforms = true; - $gui->columnsDefinition = new stdClass(); - $gui->statistics = new stdClass(); - $gui->elapsed_time = 0; - $gui->displayBuildMetrics = false; - $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); - - $gui->tproject_name = testproject::getName($dbHandler,$argsObj->tproject_id); - - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->tplan_name = $info['name']; - $gui->tplan_id = intval($argsObj->tplan_id); - - $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - if( is_null($gui->platformSet) ) { - $gui->platformSet = array(''); - $gui->showPlatforms = false; - } else { - natsort($gui->platformSet); - } - - $gui->hasPlatforms = count($gui->platformSet) >= 1 && - !isset($gui->platformSet[0]); - - return $gui; -} - - -/** - * - * - */ -function createSpreadsheet($gui,$args,&$tplanMgr) { - - // N sections - // Always same format - // Platform - // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] - // Completed [%] - - // Results by Platform - // Overall Build Status - // Results by Build - // Results by Top Level Test Suite - // Results by priority - // Results by Keyword - - - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - // Common - $execStatusDomain = $tplanMgr->getStatusForReports(); - $dataHeaderMetrics = array(); - // $cellPosForExecStatus = array(); - $ccc = 0; - foreach( $execStatusDomain as $code => $human ) { - $dataHeaderMetrics[] = lang_get('test_status_' . $human); - $ccc++; - $dataHeaderMetrics[] = '[%]'; - $ccc++; - //$cellPosForExecStatus[$human] = $ccc; - } - $dataHeaderMetrics[] = $lbl['completed_perc']; - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - $oneLevel = array(); - - // NO PLATFORM => ID=0 - if( $gui->hasPlatforms ) { - $oneLevel[] = array('entity' => 'platform', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->platform); - } - - $oneLevel[] = array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->overallBuildStatus); - - $startingRow = count($lines2write); // MAGIC - foreach( $oneLevel as $target ) { - $entity = $target['entity']; - $dimension = $target['dimension']; - $dataHeader = array($lbl[$entity],$lbl[$dimension]); - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $startingRow++; - $startingRow++; - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - $startingRow++; - $infoSet = $target['source']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - foreach($infoSet as $itemID => $fieldSet) { - - $whatCell = 0; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - $startingRow++; - } - } - - // The first column will be the platform - $twoLevels = array(); - - if( $gui->hasPlatforms ) { - $twoLevels[] = - array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->buildByPlatMetrics); - } - - $twoLevels[] = - array('entity' => 'testsuite', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->testsuites); - - $twoLevels[] = array('entity' => 'priority', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->priorities); - - $twoLevels[] = - array('entity' => 'keyword', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->keywords); - - foreach( $twoLevels as $target ) { - $startingRow++; - $startingRow++; - - $entity = $target['entity']; - $dimension = $target['dimension']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - if( count($target['source']) == 0 ) { - continue; - } - - // Just ONE HEADER ? - $dataHeader = array($lbl['platform'],$lbl[$entity],$lbl[$dimension]); - if( $gui->hasPlatforms == false ) { - array_shift($dataHeader); - } - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - // END ONE HEADER - $startingRow++; - - $idr = ''; - foreach( $gui->platformSet as $platID => $platName ) { - $idr = ('' == $idr || 'rowB' == $idr ) ? 'rowA' : 'rowB'; - - $infoSet = isset($target['source'][$platID]) ? - $target['source'][$platID] : array(); - - foreach($infoSet as $itemID => $fieldSet) { - $whatCell=0; - - if( $gui->hasPlatforms ) { - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $platName; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - } - - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - - $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . - "$startingRow"; - - $objPHPExcel->getActiveSheet() - ->getStyle($cellZone) - ->applyFromArray($style[$idr]); - - $startingRow++; - } - } - } // on container ? - - // Just to add some final empty row - $cellID = $cellRange[0] . $startingRow; - $field = ''; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - - - // Final step - $tmpfname = tempnam(config_get('temp_dir'),"TestLink_GTMP.tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - downloadXls($tmpfname,$xlsType,$gui,'TestLink_GTMP_'); -} - - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0) - ->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels( - array('testsuite' => null, - 'testcase_qty' => null,'keyword' => null, - 'platform' => null,'priority' => null, - 'priority_level' => null, - 'build' => null,'testplan' => null, - 'testproject' => null,'not_run' => null, - 'completed_perc' => 'trep_comp_perc', - 'generated_by_TestLink_on' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = - array('font' => array('bold' => true), - 'borders' => - array('outline' => - array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - $style['rowA'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FFFFFFFF')) - ); - - $style['rowB'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'DCDCDCDC')) - ); - - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - - - -/** - * - */ -function checkRights(&$db,&$user,$context = null) { - if(is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; +do_report['status_ok'] = 1; +$gui->do_report['msg'] = ''; + +$tables = tlObject::getDBTables( + array( + 'baseline_l1l2_context', + 'baseline_l1l2_details', + 'nodes_hierarchy' + )); + +// Get virtual columns +$sql = "SELECT distinct(status) as status_col " . + " FROM {$tables['baseline_l1l2_context']} BLC " . + " JOIN {$tables['baseline_l1l2_details']} BLDT " . + " ON BLDT.context_id = BLC.id " . " WHERE BLC.testplan_id = $args->tplan_id"; + +$statusRS = $db->fetchRowsIntoMap($sql, 'status_col'); +$cfg = config_get('results'); +$codeToStatus = array_flip($cfg['status_code']); +$statusToLabel = $cfg['status_label']; +$statusDisplayOrder = $cfg['status_order']; +$statusCols = array(); +$gui->columnsDefinition = array(); + +foreach ($statusDisplayOrder as $code) { + $statusCols[$code] = $statusToLabel[$codeToStatus[$code]]; + $gui->columnsDefinition[$codeToStatus[$code]] = array( + 'qty' => lang_get($statusCols[$code]), + 'percentage' => "[%]" + ); + + $data_tpl[$codeToStatus[$code]] = array( + 'qty' => 0, + 'percentage' => 0 + ); +} + +// foreach ($gui->platformSet as $plat_id => $plat_name) { +$sql = "SELECT context_id,BLDT.id AS detail_id,testplan_id,platform_id," . + " begin_exec_ts, end_exec_ts, creation_ts," . + " top_tsuite_id, child_tsuite_id, status, qty, total_tc," . + " TS_TOP.name AS top_name, TS_CHI.name AS child_name " . + " FROM {$tables['baseline_l1l2_context']} BLC " . + " JOIN {$tables['baseline_l1l2_details']} BLDT " . + " ON BLDT.context_id = BLC.id " . + " JOIN {$tables['nodes_hierarchy']} AS TS_TOP " . + " ON TS_TOP.id = top_tsuite_id " . + " JOIN {$tables['nodes_hierarchy']} AS TS_CHI " . + " ON TS_CHI.id = child_tsuite_id " . + " WHERE BLC.testplan_id = $args->tplan_id " . + " ORDER BY BLC.creation_ts DESC, top_name ASC, child_name ASC"; + +$keyCols = array( + 'platform_id', + 'context_id', + 'top_tsuite_id', + 'child_tsuite_id' +); +$rsu = $db->fetchRowsIntoMap4l($sql, $keyCols, true); + +// Generate statistics for each platform +// Platforms are ordered by name +if (! empty($rsu)) { + foreach ($rsu as $plat_id => $dataByContext) { + $gui->statistics = array(); + + $gui->statistics[$plat_id] = array(); + $gui->span[$plat_id] = array(); + + $rx = 0; + foreach ($dataByContext as $dataByTop) { + $gui->statistics[$plat_id][$rx] = array(); + $gui->span[$plat_id][$rx] = null; + + $rrr = current(current($dataByTop))[0]; + reset($dataByTop); + $gui->span[$plat_id][$rx] = array( + 'begin' => $rrr['begin_exec_ts'], + 'end' => $rrr['end_exec_ts'], + 'baseline_ts' => $rrr['creation_ts'] + ); + + foreach ($dataByTop as $top_id => $dataByChild) { + foreach ($dataByChild as $child_id => $dataX) { + $gui->statistics[$plat_id][$rx][$child_id] = array(); + $hand = &$gui->statistics[$plat_id][$rx][$child_id]; + + $dfx = $dataX[0]; + $hand['name'] = $dfx['top_name'] . ':' . $dfx['child_name']; + $hand['total_tc'] = $dfx['total_tc']; + $hand['percentage_completed'] = - 1; + $hand['details'] = $data_tpl; + $hand['parent_id'] = $top_id; + + foreach ($dataX as $xmen) { + $pp = ($hand['total_tc'] > 0) ? (round( + ($xmen['qty'] / $hand['total_tc']) * 100, 1)) : 0; + $hand['details'][$codeToStatus[$xmen['status']]] = array( + 'qty' => $xmen['qty'], + 'percentage' => $pp + ); + } + + // Calculate percentage completed, using all exec status + // other than not run + if ($hand['total_tc'] > 0) { + $hand['percentage_completed'] = $hand['total_tc'] - + $hand['details']['not_run']['qty']; + $hand['percentage_completed'] = round( + ($hand['percentage_completed'] / $hand['total_tc']) * + 100, 1); + } + } + } + $rx ++; + } + } +} + +/* + * array(1) { + * [187]=> + * array(10) { + * [33984]=> + * array(6) { + * ["type"]=> string(6) "tsuite" + * ["name"]=> + * string(55) "PT/08/TMS/Costing:PT/08.01/Price List & Rate Management" + * ["parent_id"]=> string(5) "33953" + * ["total_tc"]=> int(218) + * ["percentage_completed"]=> string(4) "95.4" + * ["details"]=> + * array(4) { + * ["not_run"]=> array(2) {["qty"]=>int(10) + * ["percentage"]=> string(3) "4.6"} + * ["passed"]=> + * } + * } + */ + +$timerOff = microtime(true); +$gui->elapsed_time = round($timerOff - $timerOn, 2); + +if ($args->spreadsheet) { + createSpreadsheet($gui, $tplan_mgr); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($tplCfg->tpl, $smarty, $args->format, $mailCfg); + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return array + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr) +{ + list (, $gui) = initUserEnv($dbHandler, $argsObj); + + $gui->fakePlatform = array( + '' + ); + $gui->title = lang_get('baseline_l1l2'); + $gui->do_report = array(); + $gui->showPlatforms = true; + $gui->columnsDefinition = new stdClass(); + $gui->statistics = new stdClass(); + $gui->elapsed_time = 0; + $gui->displayBuildMetrics = false; + $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); + + $gui->tproject_name = testproject::getName($dbHandler, $argsObj->tproject_id); + + $info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->tplan_name = $info['name']; + $gui->tplan_id = intval($argsObj->tplan_id); + + $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + if (is_null($gui->platformSet)) { + $gui->platformSet = array( + '' + ); + $gui->showPlatforms = false; + } else { + natsort($gui->platformSet); + } + + $gui->hasPlatforms = count($gui->platformSet) >= 1 && + ! isset($gui->platformSet[0]); + + return $gui; +} + +/** + * + * @param stdClass $gui + * @param tlTestPlanMetrics $tplanMgr + */ +function createSpreadsheet($gui, &$tplanMgr) +{ + + // N sections + // Always same format + // Platform + // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] + // Completed [%] + + // Results by Platform + // Overall Build Status + // Results by Build + // Results by Top Level Test Suite + // Results by priority + // Results by Keyword + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + // Common + $execStatusDomain = $tplanMgr->getStatusForReports(); + $dataHeaderMetrics = array(); + $ccc = 0; + foreach ($execStatusDomain as $human) { + $dataHeaderMetrics[] = lang_get('test_status_' . $human); + $ccc ++; + $dataHeaderMetrics[] = '[%]'; + $ccc ++; + } + $dataHeaderMetrics[] = $lbl['completed_perc']; + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + $oneLevel = array(); + + // NO PLATFORM => ID=0 + if ($gui->hasPlatforms) { + $oneLevel[] = array( + 'entity' => 'platform', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->platform + ); + } + + $oneLevel[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->overallBuildStatus + ); + + $startingRow = count($lines2write); // MAGIC + foreach ($oneLevel as $target) { + $entity = $target['entity']; + $dimension = $target['dimension']; + $dataHeader = array( + $lbl[$entity], + $lbl[$dimension] + ); + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $startingRow ++; + $startingRow ++; + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + $infoSet = $target['source']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + foreach ($infoSet as $fieldSet) { + + $whatCell = 0; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + $startingRow ++; + } + } + + // The first column will be the platform + $twoLevels = array(); + + if ($gui->hasPlatforms) { + $twoLevels[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->buildByPlatMetrics + ); + } + + $twoLevels[] = array( + 'entity' => 'testsuite', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->testsuites + ); + + $twoLevels[] = array( + 'entity' => 'priority', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->priorities + ); + + $twoLevels[] = array( + 'entity' => 'keyword', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->keywords + ); + + foreach ($twoLevels as $target) { + $startingRow ++; + $startingRow ++; + + $entity = $target['entity']; + $dimension = $target['dimension']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + if (count($target['source']) == 0) { + continue; + } + + // Just ONE HEADER ? + $dataHeader = array( + $lbl['platform'], + $lbl[$entity], + $lbl[$dimension] + ); + if (! $gui->hasPlatforms) { + array_shift($dataHeader); + } + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + // END ONE HEADER + $startingRow ++; + + $idr = ''; + foreach ($gui->platformSet as $platID => $platName) { + $idr = ('' == $idr || 'rowB' == $idr) ? 'rowA' : 'rowB'; + + $infoSet = isset($target['source'][$platID]) ? $target['source'][$platID] : array(); + + foreach ($infoSet as $fieldSet) { + $whatCell = 0; + + if ($gui->hasPlatforms) { + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $platName; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + } + + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + + $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . + "$startingRow"; + + $objPHPExcel->getActiveSheet() + ->getStyle($cellZone) + ->applyFromArray($style[$idr]); + + $startingRow ++; + } + } + } + + // Just to add some final empty row + $cellID = $cellRange[0] . $startingRow; + $field = ''; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + // Final step + $tmpfname = tempnam(config_get('temp_dir'), "TestLink_GTMP.tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + downloadXls($tmpfname, $xlsType, $gui, 'TestLink_GTMP_'); +} + +/** + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'testsuite' => null, + 'testcase_qty' => null, + 'keyword' => null, + 'platform' => null, + 'priority' => null, + 'priority_level' => null, + 'build' => null, + 'testplan' => null, + 'testproject' => null, + 'not_run' => null, + 'completed_perc' => 'trep_comp_perc', + 'generated_by_TestLink_on' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + $style['rowA'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FFFFFFFF' + ) + ) + ); + + $style['rowB'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'DCDCDCDC' + ) + ) + ); + + return $style; +} + +/** + * + * @return string|array + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } diff --git a/lib/results/charts.inc.php b/lib/results/charts.inc.php index 6e12a2e0f6..91daf7d632 100644 --- a/lib/results/charts.inc.php +++ b/lib/results/charts.inc.php @@ -1,138 +1,155 @@ - 255, 'G' => 255, 'B' => 254); - $chartCfg=new stdClass(); - $chartCfg->XSize = $info->canDraw ? $cfg->XSize : 600; - $chartCfg->YSize = $info->canDraw ? $cfg->YSize : 50; - - $chartCfg->border = new stdClass(); - $chartCfg->border->width = 1; - $chartCfg->border->color = array('R' => 0, 'G' => 0, 'B' => 0); - - $chartCfg->graphArea = new stdClass(); - $chartCfg->graphArea->color=array('R' => 213, 'G' => 217, 'B' => 221); - - $chartCfg->graphArea->beginX = property_exists($cfg,'beginX') ? $cfg->beginX : 40; - $chartCfg->graphArea->beginY = property_exists($cfg,'beginY') ? $cfg->beginY : 100; - - $chartCfg->graphArea->endX = $chartCfg->XSize - $chartCfg->graphArea->beginX; - $chartCfg->graphArea->endY = $chartCfg->YSize - $chartCfg->graphArea->beginY; - - $chartCfg->scale=new stdClass(); - - // 20100914 - franciscom - // After reading documentation - // drawScale - // Today there is four way of computing scales : - // - // - Getting Max & Min values per serie : ScaleMode = SCALE_NORMAL - // - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_START0 - // - Getting the series cumulative Max & Min values : ScaleMode = SCALE_ADDALL - // - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_ADDALLSTART0 - // - // This will depends on the kind of graph you are drawing, today only the stacked bar chart - // can use the SCALE_ADDALL mode. - // Drawing graphs were you want to fix the min value to 0 you must use the SCALE_START0 option. - // - $chartCfg->scale->mode = SCALE_ADDALLSTART0; - $chartCfg->scale->color = array('R' => 0, 'G' => 0, 'B' => 0); - $chartCfg->scale->drawTicks = TRUE; - $chartCfg->scale->angle=$cfg->scale->legendXAngle; - $chartCfg->scale->decimals=1; - $chartCfg->scale->withMargin=TRUE; - - $chartCfg->legend=new stdClass(); - $chartCfg->legend->X=$chartCfg->XSize-80; - $chartCfg->legend->Y=15; - $chartCfg->legend->color=array('R' => 236, 'G' => 238, 'B' => 240); - - $chartCfg->title=new stdClass(); - $chartCfg->title->value=$cfg->chartTitle; - - $chartCfg->title->X=2*$chartCfg->graphArea->beginX; - $chartCfg->title->Y=$chartCfg->legend->Y; - $chartCfg->title->color=array('R' => 0, 'G' => 0, 'B' => 255); - - $Test = new pChart($chartCfg->XSize,$chartCfg->YSize); - $Test->reportWarnings("GD"); - $Test->drawBackground($backgndColor['R'],$backgndColor['G'],$backgndColor['B']); - $Test->drawGraphArea($chartCfg->graphArea->color['R'], - $chartCfg->graphArea->color['G'],$chartCfg->graphArea->color['B']); - $Test->setGraphArea($chartCfg->graphArea->beginX,$chartCfg->graphArea->beginY, - $chartCfg->graphArea->endX,$chartCfg->graphArea->endY); - - $Test->setFontProperties(config_get('charts_font_path'),config_get('charts_font_size')); - - if($info->canDraw) - { - $DataSet = new pData; - foreach($info->chart_data as $key => $values) - { - $id=$key+1; - $DataSet->AddPoint($values,"Serie{$id}"); - $DataSet->SetSerieName($info->series_label[$key],"Serie{$id}"); - - } - $DataSet->AddPoint($info->xAxis->values,$info->xAxis->serieName); - $DataSet->AddAllSeries(); - $DataSet->RemoveSerie($info->xAxis->serieName); - $DataSet->SetAbsciseLabelSerie($info->xAxis->serieName); - $chartData=$DataSet->GetData(); - $chartLegend=$DataSet->GetDataDescription(); - - - foreach( $info->series_color as $key => $hexrgb) - { - $rgb=str_split($hexrgb,2); - $Test->setColorPalette($key,hexdec($rgb[0]),hexdec($rgb[1]),hexdec($rgb[2])); - } - // $Test->setFixedScale($info->scale->minY,$info->scale->maxY,$info->scale->divisions); - $Test->drawScale($chartData,$chartLegend,$chartCfg->scale->mode, - $chartCfg->scale->color['R'],$chartCfg->scale->color['G'],$chartCfg->scale->color['B'], - $chartCfg->scale->drawTicks,$chartCfg->scale->angle,$chartCfg->scale->decimals, - $chartCfg->scale->withMargin); - - $Test->drawStackedBarGraph($chartData,$chartLegend,70); - - // Draw the legend - $Test->setFontProperties(config_get('charts_font_path'),config_get('charts_font_size')); - $Test->drawLegend($chartCfg->legend->X,$chartCfg->legend->Y,$chartLegend, - $chartCfg->legend->color['R'],$chartCfg->legend->color['G'], - $chartCfg->legend->color['B']); - - $Test->addBorder($chartCfg->border->width, - $chartCfg->border->color['R'],$chartCfg->border->color['G'], - $chartCfg->border->color['B']); - } - else - { - $chartCfg->title->value .= '/' . lang_get('no_data_available'); - } - - $Test->drawTitle($chartCfg->title->X,$chartCfg->title->Y,$chartCfg->title->value, - $chartCfg->title->color['R'],$chartCfg->title->color['G'],$chartCfg->title->color['B']); - $Test->Stroke(); -} + 255, + 'G' => 255, + 'B' => 254 + ); + $chartCfg = new stdClass(); + $chartCfg->XSize = $info->canDraw ? $cfg->XSize : 600; + $chartCfg->YSize = $info->canDraw ? $cfg->YSize : 50; + + $chartCfg->border = new stdClass(); + $chartCfg->border->width = 1; + $chartCfg->border->color = array( + 'R' => 0, + 'G' => 0, + 'B' => 0 + ); + + $chartCfg->graphArea = new stdClass(); + $chartCfg->graphArea->color = array( + 'R' => 213, + 'G' => 217, + 'B' => 221 + ); + + $chartCfg->graphArea->beginX = property_exists($cfg, 'beginX') ? $cfg->beginX : 40; + $chartCfg->graphArea->beginY = property_exists($cfg, 'beginY') ? $cfg->beginY : 100; + + $chartCfg->graphArea->endX = $chartCfg->XSize - $chartCfg->graphArea->beginX; + $chartCfg->graphArea->endY = $chartCfg->YSize - $chartCfg->graphArea->beginY; + + $chartCfg->scale = new stdClass(); + + // 20100914 - franciscom + // After reading documentation + // drawScale + // Today there is four way of computing scales : + // + // - Getting Max & Min values per serie : ScaleMode = SCALE_NORMAL + // - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_START0 + // - Getting the series cumulative Max & Min values : ScaleMode = SCALE_ADDALL + // - Like the previous one but setting the min value to 0 : ScaleMode = SCALE_ADDALLSTART0 + // + // This will depends on the kind of graph you are drawing, today only the stacked bar chart + // can use the SCALE_ADDALL mode. + // Drawing graphs were you want to fix the min value to 0 you must use the SCALE_START0 option. + // + $chartCfg->scale->mode = SCALE_ADDALLSTART0; + $chartCfg->scale->color = array( + 'R' => 0, + 'G' => 0, + 'B' => 0 + ); + $chartCfg->scale->drawTicks = true; + $chartCfg->scale->angle = $cfg->scale->legendXAngle; + $chartCfg->scale->decimals = 1; + $chartCfg->scale->withMargin = true; + + $chartCfg->legend = new stdClass(); + $chartCfg->legend->X = 15; + $chartCfg->legend->Y = 20; + $chartCfg->legend->color = array( + 'R' => 236, + 'G' => 238, + 'B' => 240 + ); + + $chartCfg->title = new stdClass(); + $chartCfg->title->value = $cfg->chartTitle; + $chartCfg->title->X = ($chartCfg->XSize / 2) - + (strlen($chartCfg->title->value) * 2.5); + $chartCfg->title->Y = 15; + $chartCfg->title->color = array( + 'R' => 0, + 'G' => 0, + 'B' => 255 + ); + + $test = new pChart($chartCfg->XSize, $chartCfg->YSize); + $test->drawBackground($backgndColor['R'], $backgndColor['G'], + $backgndColor['B']); + $test->drawGraphArea($chartCfg->graphArea->color['R'], + $chartCfg->graphArea->color['G'], $chartCfg->graphArea->color['B']); + $test->setGraphArea($chartCfg->graphArea->beginX, + $chartCfg->graphArea->beginY, $chartCfg->graphArea->endX, + $chartCfg->graphArea->endY); + + $test->setFontProperties(config_get('charts_font_path'), + config_get('charts_font_size')); + + if ($info->canDraw) { + $dataSet = new pData(); + foreach ($info->chart_data as $key => $values) { + $id = $key + 1; + $dataSet->AddPoint($values, "Serie{$id}"); + $dataSet->SetSerieName($info->series_label[$key], "Serie{$id}"); + } + $dataSet->AddPoint($info->xAxis->values, $info->xAxis->serieName); + $dataSet->AddAllSeries(); + $dataSet->RemoveSerie($info->xAxis->serieName); + $dataSet->SetAbsciseLabelSerie($info->xAxis->serieName); + $chartData = $dataSet->GetData(); + $chartLegend = $dataSet->GetDataDescription(); + + foreach ($info->series_color as $key => $hexrgb) { + $rgb = str_split($hexrgb, 2); + $test->setColorPalette($key, hexdec($rgb[0]), hexdec($rgb[1]), + hexdec($rgb[2])); + } + $test->drawScale($chartData, $chartLegend, $chartCfg->scale->mode, + $chartCfg->scale->color['R'], $chartCfg->scale->color['G'], + $chartCfg->scale->color['B'], $chartCfg->scale->drawTicks, + $chartCfg->scale->angle, $chartCfg->scale->decimals, + $chartCfg->scale->withMargin); + $test->drawStackedBarGraph($chartData, $chartLegend, 70); + + // Draw the legend + $test->setFontProperties(config_get('charts_font_path'), + config_get('charts_font_size')); + $test->drawLegend($chartCfg->legend->X, $chartCfg->legend->Y, + $chartLegend, $chartCfg->legend->color['R'], + $chartCfg->legend->color['G'], $chartCfg->legend->color['B']); + + $test->addBorder($chartCfg->border->width, $chartCfg->border->color['R'], + $chartCfg->border->color['G'], $chartCfg->border->color['B']); + } else { + $chartCfg->title->value .= '/' . lang_get('no_data_available'); + } + + $test->drawTitle($chartCfg->title->X, $chartCfg->title->Y, + $chartCfg->title->value, $chartCfg->title->color['R'], + $chartCfg->title->color['G'], $chartCfg->title->color['B']); + $test->Stroke(); +} ?> diff --git a/lib/results/charts.php b/lib/results/charts.php index 8866a75db5..520118b79c 100644 --- a/lib/results/charts.php +++ b/lib/results/charts.php @@ -1,158 +1,184 @@ - null,'overall_metrics_for_platform' => null, - 'results_by_keyword' => null,'results_top_level_suites' => null)); - -list($args,$tproject_mgr,$tplan_mgr) = init_args($db); - -$tplan_info = $tplan_mgr->get_by_id($args->tplan_id); -$tproject_info = $tproject_mgr->get_by_id($args->tproject_id); - -$gui = initializeGui($args); -if($gui->can_use_charts == 'OK') -{ - $gui->tplan_name = $tplan_info['name']; - $gui->tproject_name = $tproject_info['name']; - - $resultsCfg = config_get('results'); - - $pathToScripts = "lib/results/"; - $chartsUrl=new stdClass(); - $chartsUrl->overallPieChart = $pathToScripts . "overallPieChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}"; - $chartsUrl->keywordBarChart = $pathToScripts . "keywordBarChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}" . - "&tproject_id=$args->tproject_id"; - $chartsUrl->topLevelSuitesBarChart = $pathToScripts . - "topLevelSuitesBarChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}" . - "&tproject_id=$args->tproject_id"; - - $platformSet = $tplan_mgr->getPlatforms($gui->tplan_id,array('outputFormat' => 'map')); - $platformIDSet = is_null($platformSet) ? array(0) : array_keys($platformSet); - - $gui->charts = array($l18n['overall_metrics'] => $chartsUrl->overallPieChart); - if(!is_null($platformSet)) - { - foreach($platformIDSet as $platform_id) - { - $description = $l18n['overall_metrics_for_platform'] . ' ' . $platformSet[$platform_id]; - $gui->charts[$description] = $pathToScripts . - "platformPieChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}&platform_id={$platform_id}"; - } - } - - $gui->charts = array_merge( $gui->charts, - array($l18n['results_by_keyword'] => $chartsUrl->keywordBarChart, - $l18n['results_top_level_suites'] => $chartsUrl->topLevelSuitesBarChart) ); -} - -$smarty = new TLSmarty(); -$smarty->assign("gui",$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - - -/** - * initialize user input - * - * @param resource dbHandler - * @return array $args array with user input information - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,0,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - $tproject_mgr = new testproject($dbHandler); - $tplan_mgr = new testplan($dbHandler); - if($args->tproject_id > 0) - { - $args->tproject_info = $tproject_mgr->get_by_id($args->tproject_id); - $args->tproject_name = $args->tproject_info['name']; - $args->tproject_description = $args->tproject_info['notes']; - } - - if ($args->tplan_id > 0) - { - $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - } - - return array($args,$tproject_mgr,$tplan_mgr); + null, + 'overall_metrics_for_platform' => null, + 'results_by_keyword' => null, + 'results_top_level_suites' => null + )); + +list ($args, $tproject_mgr, $tplan_mgr) = initArgs($db); + +$tplan_info = $tplan_mgr->get_by_id($args->tplan_id); +$tproject_info = $tproject_mgr->get_by_id($args->tproject_id); + +$gui = initializeGui($args); +if ($gui->can_use_charts == 'OK') { + $gui->tplan_name = $tplan_info['name']; + $gui->tproject_name = $tproject_info['name']; + + $resultsCfg = config_get('results'); + + $pathToScripts = "lib/results/"; + $chartsUrl = new stdClass(); + $chartsUrl->overallPieChart = $pathToScripts . + "overallPieChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}"; + $chartsUrl->keywordBarChart = $pathToScripts . + "keywordBarChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}" . + "&tproject_id=$args->tproject_id"; + $chartsUrl->topLevelSuitesBarChart = $pathToScripts . + "topLevelSuitesBarChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}" . + "&tproject_id=$args->tproject_id"; + + $platformSet = $tplan_mgr->getPlatforms($gui->tplan_id, + array( + 'outputFormat' => 'map' + )); + $platformIDSet = is_null($platformSet) ? array( + 0 + ) : array_keys($platformSet); + + $gui->charts = array( + $l18n['overall_metrics'] => $chartsUrl->overallPieChart + ); + if (! is_null($platformSet)) { + foreach ($platformIDSet as $platform_id) { + $description = $l18n['overall_metrics_for_platform'] . ' ' . + $platformSet[$platform_id]; + $gui->charts[$description] = $pathToScripts . + "platformPieChart.php?apikey={$args->apikey}&tplan_id={$gui->tplan_id}&platform_id={$platform_id}"; + } + } + + $gui->charts = array_merge($gui->charts, + array( + $l18n['results_by_keyword'] => $chartsUrl->keywordBarChart, + $l18n['results_top_level_suites'] => $chartsUrl->topLevelSuitesBarChart + )); +} + +$smarty = new TLSmarty(); +$smarty->assign("gui", $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * initialize user input + * + * @param + * database dbHandler + * @return array $args array with user input information + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + $tproject_mgr = new testproject($dbHandler); + $tplan_mgr = new testplan($dbHandler); + if ($args->tproject_id > 0) { + $args->tproject_info = $tproject_mgr->get_by_id($args->tproject_id); + $args->tproject_name = $args->tproject_info['name']; + $args->tproject_description = $args->tproject_info['notes']; + } + + if ($args->tplan_id > 0) { + $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + } + + return array( + $args, + $tproject_mgr, + $tplan_mgr + ); +} + +/** + * + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui($argsObj) +{ + $gui = new stdClass(); + $gui->tplan_id = $argsObj->tplan_id; + $gui->can_use_charts = checkLibGd(); + return $gui; +} + +/** + * rights check function for testlinkInitPage() + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } - -/** - * - */ -function initializeGui($argsObj) -{ - $gui=new stdClass(); - $gui->tplan_id = $argsObj->tplan_id; - $gui->can_use_charts = checkLibGd(); - return $gui; -} - - - -/* - * rights check function for testlinkInitPage() - */ -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} \ No newline at end of file diff --git a/lib/results/displayMgr.php b/lib/results/displayMgr.php index 6d76b3416f..d00a8cd2d3 100644 --- a/lib/results/displayMgr.php +++ b/lib/results/displayMgr.php @@ -1,238 +1,267 @@ - array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - "type" => array(tlInputParameter::STRING_N,0,1), - "sendByMail" => array(tlInputParameter::INT_N), - "spreadsheet" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,5,15), - "platSet" => array(tlInputParameter::ARRAY_INT), - "build_set" => array(tlInputParameter::ARRAY_INT), - "buildListForExcel" => array(tlInputParameter::STRING_N,0,100)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $rCfg = config_get('results'); - $args->statusCode = $rCfg['status_code']; - - $args->spreadsheet = intval($args->spreadsheet); - $args->accessType = 'gui'; - $args->addOpAccess = true; - - $args->getSpreadsheetBy = - isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; - - if( is_null($args->getSpreadsheetBy) ) { - $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? - 'download' : null; - } - - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - $args->accessType = 'remote'; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - $args->accessType = 'anonymous'; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } else { - testlinkInitPage($dbHandler,true,false,"checkRights"); - - $tplanMgr = new testplan($dbHandler); - $tplan = $tplanMgr->get_by_id($args->tplan_id); - $args->tproject_id = $tplan['testproject_id']; - } - - if ($args->tproject_id <= 0) { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - if (is_null($args->format)) { - tlog("Parameter 'format' is not defined", 'ERROR'); - exit(); - } - - switch ($args->format) { - case FORMAT_XLS: - if($args->buildListForExcel != '') { - $args->build_set = explode(',',$args->buildListForExcel); - } - break; - } - - $args->format = $args->sendByMail ? FORMAT_MAIL_HTML : $args->format; - - $args->user = $_SESSION['currentUser']; - $args->basehref = $_SESSION['basehref']; - - return array($tplanMgr,$args); -} - - -/** - * - * - */ -function generateHtmlEmail(&$smarty, $template_file, $mailCfg) { - // same objet that is returned by email_send - $op = new stdClass(); - $op->status_ok = true; - $op->msg = 'ok'; - - $html_report = $smarty->fetch($template_file); - if( ! property_exists($mailCfg,'from') ) { - $mailCfg->from = $_SESSION['currentUser']->emailAddress; - } - - if( ! property_exists($mailCfg,'to') ) { - $mailCfg->to = $mailCfg->from; - } - - if($mailCfg->to == ""){ - $op->status_ok = false; - $op->msg = lang_get("error_sendreport_no_email_credentials"); - } else { - // Link to test case is still raw link (no title) in email(HTML) type of test report - $op = email_send( $mailCfg->from, $mailCfg->to, $mailCfg->subject, - $html_report, $mailCfg->cc, null,false,true, - array('strip_email_links' => false)); - - if($op->status_ok) { - $op->msg = sprintf(lang_get('mail_sent_to'), $mailCfg->to); - } - } - return $op; -} - - -/** - * - * - */ -function displayReport($template_file, &$smarty, $doc_format, $mailCfg = null) -{ - - $doc_format = intval($doc_format); - switch($doc_format) - { - case FORMAT_HTML: - case FORMAT_ODT: - case FORMAT_ODS: - case FORMAT_XLS: - case FORMAT_MSWORD: - case FORMAT_PDF: - flushHttpHeader($doc_format, $doc_kind = 0); - break; - - case FORMAT_MAIL_HTML: - $op = generateHtmlEmail($smarty, $template_file, $mailCfg); - - switch($template_file) - { - case 'results/resultsGeneral.tpl'; - flushHttpHeader(FORMAT_HTML, $doc_kind = 0); - $mf->msg = $op->status_ok ? '' : lang_get('send_mail_ko'); - $mf->msg .= ' ' . $op->msg; - $mf->title = ''; //$mailCfg->subject; - $smarty->assign('mailFeedBack',$mf); - break; - - default: - $message = $op->status_ok ? '' : lang_get('send_mail_ko'); - $smarty = new TLSmarty(); - $smarty->assign('message', $message . ' ' . $op->msg); - $smarty->assign('title', $mailCfg->subject); - $template_file = "emailSent.tpl"; - break; - } - break; - } - - $smarty->display($template_file); -} - - -/** - * Generate HTML header and send it to browser - * @param string $format identifier of document format; value must be in $tlCfg->reports_formats - * @param integer $doc_kind Magic number of document kind; see consts.inc.php for list - * (for example: DOC_TEST_PLAN_DESIGN) - * @author havlatm - */ -function flushHttpHeader($format, $doc_kind = 0) -{ - $file_extensions = config_get('reports_file_extension'); - $reports_applications = config_get('reports_applications'); - - switch($doc_kind) { - case DOC_TEST_SPEC: - $kind_acronym = '_test_spec'; - break; - - case DOC_TEST_PLAN_DESIGN: - $kind_acronym = '_test_plan'; - break; - - case DOC_TEST_PLAN_EXECUTION: - $kind_acronym = '_test_report'; - break; - - case DOC_REQ_SPEC: - $kind_acronym = '_req_spec'; - break; - - default: - $kind_acronym = ''; - break; - } - - - if ($format == FORMAT_MAIL_HTML) { - tLog('flushHttpHeader> Invalid format: '.$format, 'ERROR'); - } - - $filename = isset($_SESSION['testprojectPrefix']) ? $_SESSION['testprojectPrefix'] : ''; - $filename .= $kind_acronym . '-' . date('Y-m-d') . '.' . $file_extensions[$format]; - tLog('Flush HTTP header for '.$format); - - - $contentType = isset($reports_applications[$format]) ? $reports_applications[$format] : 'text/html'; - $contentType .= (is_null($format) || $format=='') ? '' : ("; name='Testlink_" . $format ."'") ; - header("Content-type: {$contentType}"); - header("Content-Description: TestLink - Generated Document (see " . __FUNCTION__ . ")" ); - if( (!is_null($format) && $format != '') && $format != FORMAT_HTML ) - { - header("Content-Disposition: attachment; filename=$filename"); - } - flush(); + array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "sendByMail" => array( + tlInputParameter::INT_N + ), + "spreadsheet" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 5, + 15 + ), + "platSet" => array( + tlInputParameter::ARRAY_INT + ), + "build_set" => array( + tlInputParameter::ARRAY_INT + ), + "buildListForExcel" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $rCfg = config_get('results'); + $args->statusCode = $rCfg['status_code']; + + $args->spreadsheet = intval($args->spreadsheet); + $args->accessType = 'gui'; + $args->addOpAccess = true; + + $args->getSpreadsheetBy = isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; + + if (is_null($args->getSpreadsheetBy)) { + $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? 'download' : null; + } + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + $args->accessType = 'remote'; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $args->accessType = 'anonymous'; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + + $tplanMgr = new testplan($dbHandler); + $tplan = $tplanMgr->get_by_id($args->tplan_id); + $args->tproject_id = $tplan['testproject_id']; + } + + if ($args->tproject_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + if (is_null($args->format)) { + tlog("Parameter 'format' is not defined", 'ERROR'); + exit(); + } + + switch ($args->format) { + case FORMAT_XLS: + if ($args->buildListForExcel != '') { + $args->build_set = explode(',', $args->buildListForExcel); + } + break; + } + + $args->format = $args->sendByMail ? FORMAT_MAIL_HTML : $args->format; + + $args->user = $_SESSION['currentUser']; + $args->basehref = $_SESSION['basehref']; + + return array( + $tplanMgr, + $args + ); +} + +/** + */ +function generateHtmlEmail(&$smarty, $template_file, $mailCfg) +{ + // same objet that is returned by email_send + $op = new stdClass(); + $op->status_ok = true; + $op->msg = 'ok'; + + $html_report = $smarty->fetch($template_file); + if (! property_exists($mailCfg, 'from')) { + $mailCfg->from = $_SESSION['currentUser']->emailAddress; + } + + if (! property_exists($mailCfg, 'to')) { + $mailCfg->to = $mailCfg->from; + } + + if ($mailCfg->to == "") { + $op->status_ok = false; + $op->msg = lang_get("error_sendreport_no_email_credentials"); + } else { + // Link to test case is still raw link (no title) in email(HTML) type of test report + $op = email_send($mailCfg->from, $mailCfg->to, $mailCfg->subject, + $html_report, $mailCfg->cc, null, false, true, + array( + 'strip_email_links' => false + )); + + if ($op->status_ok) { + $op->msg = sprintf(lang_get('mail_sent_to'), $mailCfg->to); + } + } + return $op; +} + +/** + */ +function displayReport($template_file, &$smarty, $doc_format, $mailCfg = null) +{ + $doc_format = intval($doc_format); + switch ($doc_format) { + case FORMAT_HTML: + case FORMAT_ODT: + case FORMAT_ODS: + case FORMAT_XLS: + case FORMAT_MSWORD: + case FORMAT_PDF: + flushHttpHeader($doc_format); + break; + + case FORMAT_MAIL_HTML: + $op = generateHtmlEmail($smarty, $template_file, $mailCfg); + + switch ($template_file) { + case 'results/resultsGeneral.tpl': + flushHttpHeader(FORMAT_HTML); + $mf->msg = $op->status_ok ? '' : lang_get('send_mail_ko'); + $mf->msg .= ' ' . $op->msg; + $mf->title = ''; + $smarty->assign('mailFeedBack', $mf); + break; + + default: + $message = $op->status_ok ? '' : lang_get('send_mail_ko'); + $smarty = new TLSmarty(); + $smarty->assign('message', $message . ' ' . $op->msg); + $smarty->assign('title', $mailCfg->subject); + $template_file = "emailSent.tpl"; + break; + } + break; + } + + $smarty->display($template_file); +} + +/** + * Generate HTML header and send it to browser + * + * @param string $format + * identifier of document format; value must be in $tlCfg->reports_formats + * @param integer $doc_kind + * Magic number of document kind; see consts.inc.php for list + * (for example: DOC_TEST_PLAN_DESIGN) + * @author havlatm + */ +function flushHttpHeader($format, $doc_kind = 0) +{ + $file_extensions = config_get('reports_file_extension'); + $reports_applications = config_get('reports_applications'); + + switch ($doc_kind) { + case DOC_TEST_SPEC: + $kind_acronym = '_test_spec'; + break; + + case DOC_TEST_PLAN_DESIGN: + $kind_acronym = '_test_plan'; + break; + + case DOC_TEST_PLAN_EXECUTION: + $kind_acronym = '_test_report'; + break; + + case DOC_REQ_SPEC: + $kind_acronym = '_req_spec'; + break; + + default: + $kind_acronym = ''; + break; + } + + if ($format == FORMAT_MAIL_HTML) { + tLog('flushHttpHeader> Invalid format: ' . $format, 'ERROR'); + } + + $filename = isset($_SESSION['testprojectPrefix']) ? $_SESSION['testprojectPrefix'] : ''; + $filename .= $kind_acronym . '-' . date('Y-m-d') . '.' . + $file_extensions[$format]; + tLog('Flush HTTP header for ' . $format); + + $contentType = isset($reports_applications[$format]) ? $reports_applications[$format] : 'text/html'; + $contentType .= (is_null($format) || $format == '') ? '' : ("; name='Testlink_" . + $format . "'"); + header("Content-type: {$contentType}"); + header( + "Content-Description: TestLink - Generated Document (see " . __FUNCTION__ . + ")"); + if ((! is_null($format) && $format != '') && $format != FORMAT_HTML) { + header("Content-Disposition: attachment; filename=$filename"); + } + flush(); } diff --git a/lib/results/execTimelineStats.php b/lib/results/execTimelineStats.php index bbee42e19c..8e930e95d4 100644 --- a/lib/results/execTimelineStats.php +++ b/lib/results/execTimelineStats.php @@ -1,348 +1,424 @@ - 'month', 'workforce' => true); -$statsBy['day'] = array('timeline' => 'day', 'workforce' => true); -$statsBy['day_hour'] = array('timeline' => 'day_hour', 'workforce' => true); - -$gui->statsBy = $statsBy; -$gui->group = $group = 'day'; -$stats = $mgr->getExecTimelineStats($args->tplan_id,null,$statsBy[$group]); - -if ($stats != null) { - $gui->do_report['status_ok'] = 1; - $gui->do_report['msg'] = ''; - $gui->statistics->exec = $stats[0]; - - if( !is_null($gui->statistics->exec) ) { - switch ($group) { - case 'day': - $gui->columnsDefinition->exec = - array(lang_get('qty'),lang_get('yyyy_mm_dd')); - break; - - case 'month': - $gui->columnsDefinition->exec = - array(lang_get('qty'),lang_get('yyyy_mm')); - break; - - case 'day_hour': - $gui->columnsDefinition->exec = - array(lang_get('qty'),lang_get('yyyy_mm_dd'),lang_get('hh')); - break; - } - - if ($statsBy[$group]['workforce']) { - $gui->columnsDefinition->exec[] = lang_get('testers_qty'); - } - } -} - -if( $args->spreadsheet ) { - createSpreadsheet($gui,$args,$tplan_mgr); -} - -$smarty = new TLSmarty; -$smarty->assign('gui', $gui); -displayReport($tplCfg->tpl, $smarty, $args->format,$mailCfg); - - - -/** - * - * - */ -function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . - $labels['testproject'] . ' : ' . - $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - */ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr) -{ - - $gui = new stdClass(); - $gui->tproject_id = $argsObj->tproject_id; - - if ($argsObj->accessType == 'gui') { - list($add2args,$gui) = initUserEnv($dbHandler,$argsObj); - } - - $gui->apikey = $argsObj->apikey; - $gui->accessType = $argsObj->accessType; - $gui->fakePlatform = array(''); - $gui->title = lang_get('execTimelineStats_report'); - $gui->do_report = array(); - $gui->showPlatforms=true; - $gui->columnsDefinition = new stdClass(); - $gui->columnsDefinition->keywords = null; - $gui->columnsDefinition->testers = null; - $gui->columnsDefinition->platform = null; - $gui->statistics = new stdClass(); - $gui->statistics->keywords = null; - $gui->statistics->testers = null; - $gui->statistics->milestones = null; - $gui->statistics->overalBuildStatus = null; - $gui->elapsed_time = 0; - $gui->displayBuildMetrics = false; - $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); - - $gui->tproject_name = testproject::getName($dbHandler,$argsObj->tproject_id); - - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->tplan_name = $info['name']; - $gui->tplan_id = intval($argsObj->tplan_id); - - $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - if( is_null($gui->platformSet) ) { - $gui->platformSet = array(''); - $gui->showPlatforms = false; - } else { - natsort($gui->platformSet); - } - - $gui->basehref = $_SESSION['basehref']; - $gui->actionSendMail = $gui->basehref . - "lib/results/execTimelineStats.php?format=" . - FORMAT_MAIL_HTML . "&tplan_id={$gui->tplan_id}" . - "&tproject_id={$gui->tproject_id}"; - - $gui->actionSpreadsheet = $gui->basehref . - "lib/results/execTimelineStats.php?format=" . - FORMAT_XLS . "&tplan_id={$gui->tplan_id}&spreadsheet=1". - "&tproject_id={$gui->tproject_id}"; - - $gui->mailFeedBack = new stdClass(); - $gui->mailFeedBack->msg = ''; - return $gui; -} - - -/** - * - * - */ -function createSpreadsheet($gui,$args,&$tplanMgr) -{ - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - // Common - $dataHeaderMetrics = array(); - $dataHeaderMetrics[] = $lbl['qty_of_executions']; - switch ($gui->group) { - case 'day': - $dataHeaderMetrics[] = $lbl['yyyy_mm_dd']; - break; - - case 'month': - $dataHeaderMetrics[] = $lbl['yyyy_mm']; - break; - - case 'day_hour': - $dataHeaderMetrics[] = $lbl['yyyy_mm_dd']; - $dataHeaderMetrics[] = $lbl['hh']; - break; - } - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - $startingRow = count($lines2write); // MAGIC - $dataHeader = array(); - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $startingRow++; - $startingRow++; - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - $startingRow++; - - // 'The meat!!' - foreach ($gui->statistics->exec as $timestamp => $elem) { - $ldx = 0; - foreach ($elem as $field) { - $cellID = $cellRange[$ldx++] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - } - $startingRow++; - } - $startingRow++; - - // Just to add some final empty row - $cellID = $cellRange[0] . $startingRow; - $field = ''; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - // Final step - $tmpfname = tempnam(config_get('temp_dir'),"TL_ExecTimelineStats.tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - downloadXls($tmpfname,$xlsType,$gui,'TL_ExecTimelineStats_'); -} - - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0) - ->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels( - array('qty' => null,'yyyy_mm_dd' => null, - 'qty_of_executions' => null, - 'yyyy_mm' => null, 'hh' => null, - 'platform' => null, - 'testplan' => null, - 'testproject' => null, - 'generated_by_TestLink_on' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = - array('font' => array('bold' => true), - 'borders' => - array('outline' => - array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - $style['rowA'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FFFFFFFF')) - ); - - $style['rowB'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'DCDCDCDC')) - ); - - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - - - -/** - * - */ -function checkRights(&$db,&$user,$context = null) { - if(is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; + 'month', + 'workforce' => true +); +$statsBy['day'] = array( + 'timeline' => 'day', + 'workforce' => true +); +$statsBy['day_hour'] = array( + 'timeline' => 'day_hour', + 'workforce' => true +); + +$gui->statsBy = $statsBy; +$gui->group = $group = 'day'; +$stats = $mgr->getExecTimelineStats($args->tplan_id, null, $statsBy[$group]); + +if ($stats != null) { + $gui->do_report['status_ok'] = 1; + $gui->do_report['msg'] = ''; + $gui->statistics->exec = $stats[0]; + + if (! is_null($gui->statistics->exec)) { + switch ($group) { + case 'day': + $gui->columnsDefinition->exec = array( + lang_get('qty'), + lang_get('yyyy_mm_dd') + ); + break; + + case 'month': + $gui->columnsDefinition->exec = array( + lang_get('qty'), + lang_get('yyyy_mm') + ); + break; + + case 'day_hour': + $gui->columnsDefinition->exec = array( + lang_get('qty'), + lang_get('yyyy_mm_dd'), + lang_get('hh') + ); + break; + } + + if ($statsBy[$group]['workforce']) { + $gui->columnsDefinition->exec[] = lang_get('testers_qty'); + } + } +} + +if ($args->spreadsheet) { + createSpreadsheet($gui, $tplan_mgr); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($tplCfg->tpl, $smarty, $args->format, $mailCfg); + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param tlTestPlanMetrics $tplanMgr + * @return stdClass|stdClass[]|testproject[] + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr) +{ + $gui = new stdClass(); + $gui->tproject_id = $argsObj->tproject_id; + + if ($argsObj->accessType == 'gui') { + list (, $gui) = initUserEnv($dbHandler, $argsObj); + } + + $gui->apikey = $argsObj->apikey; + $gui->accessType = $argsObj->accessType; + $gui->fakePlatform = array( + '' + ); + $gui->title = lang_get('execTimelineStats_report'); + $gui->do_report = array(); + $gui->showPlatforms = true; + $gui->columnsDefinition = new stdClass(); + $gui->columnsDefinition->keywords = null; + $gui->columnsDefinition->testers = null; + $gui->columnsDefinition->platform = null; + $gui->statistics = new stdClass(); + $gui->statistics->keywords = null; + $gui->statistics->testers = null; + $gui->statistics->milestones = null; + $gui->statistics->overalBuildStatus = null; + $gui->elapsed_time = 0; + $gui->displayBuildMetrics = false; + $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); + + $gui->tproject_name = testproject::getName($dbHandler, $argsObj->tproject_id); + + $info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->tplan_name = $info['name']; + $gui->tplan_id = intval($argsObj->tplan_id); + + $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + if (is_null($gui->platformSet)) { + $gui->platformSet = array( + '' + ); + $gui->showPlatforms = false; + } else { + natsort($gui->platformSet); + } + + $gui->basehref = $_SESSION['basehref']; + $gui->actionSendMail = $gui->basehref . + "lib/results/execTimelineStats.php?format=" . FORMAT_MAIL_HTML . + "&tplan_id={$gui->tplan_id}" . "&tproject_id={$gui->tproject_id}"; + + $gui->actionSpreadsheet = $gui->basehref . + "lib/results/execTimelineStats.php?format=" . FORMAT_XLS . + "&tplan_id={$gui->tplan_id}&spreadsheet=1" . + "&tproject_id={$gui->tproject_id}"; + + $gui->mailFeedBack = new stdClass(); + $gui->mailFeedBack->msg = ''; + return $gui; +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + * @param tlTestPlanMetrics $tplanMgr + */ +function createSpreadsheet($gui, &$tplanMgr) +{ + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + // Common + $dataHeaderMetrics = array(); + $dataHeaderMetrics[] = $lbl['qty_of_executions']; + switch ($gui->group) { + case 'day': + $dataHeaderMetrics[] = $lbl['yyyy_mm_dd']; + break; + + case 'month': + $dataHeaderMetrics[] = $lbl['yyyy_mm']; + break; + + case 'day_hour': + $dataHeaderMetrics[] = $lbl['yyyy_mm_dd']; + $dataHeaderMetrics[] = $lbl['hh']; + break; + } + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + $startingRow = count($lines2write); // MAGIC + $dataHeader = array(); + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $startingRow ++; + $startingRow ++; + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + + // 'The meat!!' + foreach ($gui->statistics->exec as $elem) { + $ldx = 0; + foreach ($elem as $field) { + $cellID = $cellRange[$ldx ++] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + } + $startingRow ++; + } + $startingRow ++; + + // Just to add some final empty row + $cellID = $cellRange[0] . $startingRow; + $field = ''; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + // Final step + $tmpfname = tempnam(config_get('temp_dir'), "TL_ExecTimelineStats.tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + downloadXls($tmpfname, $xlsType, $gui, 'TL_ExecTimelineStats_'); +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'qty' => null, + 'yyyy_mm_dd' => null, + 'qty_of_executions' => null, + 'yyyy_mm' => null, + 'hh' => null, + 'platform' => null, + 'testplan' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + $style['rowA'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FFFFFFFF' + ) + ) + ); + + $style['rowB'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'DCDCDCDC' + ) + ) + ); + + return $style; +} + +/** + * + * @return string|array + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } diff --git a/lib/results/freeTestCases.php b/lib/results/freeTestCases.php index 34ec8c0551..b4bd1e149f 100644 --- a/lib/results/freeTestCases.php +++ b/lib/results/freeTestCases.php @@ -1,179 +1,210 @@ -testPriorityEnabled; - -$msg_key = 'all_testcases_has_testplan'; -$edit_img = TL_THEME_IMG_DIR . "edit_icon.png"; - -// Time tracking -//$tstart = microtime(true); -//$chronos[] = $tstart; $tnow = end($chronos);reset($chronos); -// Memory metrics -//$mem['usage'][] = memory_get_usage(true); $mem['peak'][] = memory_get_peak_usage(true); - -$gui = new stdClass(); -$gui->path_info = null; -$gui->tableSet = null; -$gui->freeTestCases = $tproject_mgr->getFreeTestCases($args->tproject_id); - -// Time tracking -//$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); -//$t_elapsed_abs = number_format( $tnow - $tstart, 4); -//$t_elapsed = number_format( $tnow - $tprev, 4); -//echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'
    '; -//reset($chronos); - - -if(!is_null($gui->freeTestCases['items'])) -{ - - $l18n = init_labels(array('low_importance' => null,'medium_importance' => null, - 'high_importance' => null, 'test_suite' => null, 'design' => null)); - $il = config_get('importance_levels'); - $impCols = array(); - $impCols[$il[LOW]] = "" . $l18n['low_importance']; - $impCols[$il[MEDIUM]] = "" . $l18n['medium_importance']; - $impCols[$il[HIGH]] = "" . $l18n['high_importance']; - - if($gui->freeTestCases['allfree']) - { - // has no sense display all test cases => display just message. - $msg_key = 'all_testcases_are_free'; - } - else - { - $msg_key = ''; - $tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . $tcase_cfg->glue_character; - $tcaseSet = array_keys($gui->freeTestCases['items']); - $tsuites = $tproject_mgr->tree_manager->get_full_path_verbose($tcaseSet, - array('output_format' => 'path_as_string')); - unset($tcaseSet); - - // Time tracking - //$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); - //$t_elapsed_abs = number_format( $tnow - $tstart, 4); - //$t_elapsed = number_format( $tnow - $tprev, 4); - //echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE AFTER get_full_path_verbose(sec):' . $t_elapsed_abs .'
    '; - //reset($chronos); - - $columns = getColumnsDefinition($priorityMgmtEnabled); - - // Extract the relevant data and build a matrix - $matrixData = array(); - foreach($gui->freeTestCases['items'] as &$tcases) - { - $rowData = array(); - $rowData[] = strip_tags($tsuites[$tcases['id']]); - $rowData[] = "" . - "" . - " " . - $tcasePrefix . $tcases['tc_external_id'] . ':' . strip_tags($tcases['name']); - - // only add importance column if - if($priorityMgmtEnabled) - { - $rowData[] = $impCols[$tcases['importance']]; - } - - $matrixData[] = $rowData; - } - // Time tracking - //$chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); - //$t_elapsed_abs = number_format( $tnow - $tstart, 4); - //$t_elapsed = number_format( $tnow - $tprev, 4); - //echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'
    '; - //reset($chronos); - - $table = new tlExtTable($columns, $matrixData, 'tl_table_test_cases_not_assigned_to_any_test_plan'); - $table->setGroupByColumnName($l18n['test_suite']); - $table->setSortByColumnName(lang_get(($priorityMgmtEnabled) ? 'importance' : 'test_case')); - $table->sortDirection = 'DESC'; - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - - $gui->tableSet = array($table); - } -} - - -$gui->tproject_name = $args->tproject_name; -$gui->pageTitle = lang_get('report_free_testcases_on_testproject'); -$gui->warning_msg = lang_get($msg_key); - - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * get Columns definition for table to display - * - */ -function getColumnsDefinition($priorityMgmtEnabled) -{ - $colDef = array(); - - $colDef[] = array('title_key' => 'test_suite', 'type' => 'text'); - $colDef[] = array('title_key' => 'test_case', 'type' => 'text'); - if ($priorityMgmtEnabled) { - $urgencies_for_filter = array(lang_get('urgency_low'),lang_get('urgency_medium'),lang_get('urgency_high')); - $colDef[] = array('title_key' => 'importance', 'width' => 20, 'filter' => 'ListSimpleMatch', 'filterOptions' => $urgencies_for_filter); - } - - return $colDef; -} - -/** - * init_args - * - * Collect all inputs (arguments) to page, that can be arrived via $_REQUEST,$_SESSION - * and creates an stdClass() object where each property is result of mapping page inputs. - * We have created some sort of 'namespace', thi way we can easy understand which variables - * has been created for local use, and which have arrived on call. - * - */ -function init_args() -{ - $iParams = array( - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - ); - - $args = new stdClass(); - $pParams = G_PARAMS($iParams,$args); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - return $args; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); +testPriorityEnabled; + +$msg_key = 'all_testcases_has_testplan'; +$edit_img = TL_THEME_IMG_DIR . "edit_icon.png"; + +// Time tracking +// $tstart = microtime(true); +// $chronos[] = $tstart; $tnow = end($chronos);reset($chronos); +// Memory metrics +// $mem['usage'][] = memory_get_usage(true); $mem['peak'][] = memory_get_peak_usage(true); + +$gui = new stdClass(); +$gui->path_info = null; +$gui->tableSet = null; +$gui->freeTestCases = $tproject_mgr->getFreeTestCases($args->tproject_id); + +// Time tracking +// $chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); +// $t_elapsed_abs = number_format( $tnow - $tstart, 4); +// $t_elapsed = number_format( $tnow - $tprev, 4); +// echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'
    '; +// reset($chronos); + +if (! is_null($gui->freeTestCases['items'])) { + + $l18n = init_labels( + array( + 'low_importance' => null, + 'medium_importance' => null, + 'high_importance' => null, + 'test_suite' => null, + 'design' => null + )); + $il = config_get('importance_levels'); + $impCols = array(); + $impCols[$il[LOW]] = "" . $l18n['low_importance']; + $impCols[$il[MEDIUM]] = "" . $l18n['medium_importance']; + $impCols[$il[HIGH]] = "" . $l18n['high_importance']; + + if ($gui->freeTestCases['allfree']) { + // has no sense display all test cases => display just message. + $msg_key = 'all_testcases_are_free'; + } else { + $msg_key = ''; + $tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . + $tcase_cfg->glue_character; + $tcaseSet = array_keys($gui->freeTestCases['items']); + $tsuites = $tproject_mgr->tree_manager->get_full_path_verbose($tcaseSet, + array( + 'output_format' => 'path_as_string' + )); + unset($tcaseSet); + + // Time tracking + // $chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); + // $t_elapsed_abs = number_format( $tnow - $tstart, 4); + // $t_elapsed = number_format( $tnow - $tprev, 4); + // echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE AFTER get_full_path_verbose(sec):' . $t_elapsed_abs .'
    '; + // reset($chronos); + + $columns = getColumnsDefinition($priorityMgmtEnabled); + + // Extract the relevant data and build a matrix + $matrixData = array(); + foreach ($gui->freeTestCases['items'] as &$tcases) { + $rowData = array(); + $rowData[] = strip_tags($tsuites[$tcases['id']]); + $rowData[] = "" . + "" . + " " . + $tcasePrefix . $tcases['tc_external_id'] . ':' . + strip_tags($tcases['name']); + + // only add importance column if + if ($priorityMgmtEnabled) { + $rowData[] = $impCols[$tcases['importance']]; + } + + $matrixData[] = $rowData; + } + // Time tracking + // $chronos[] = microtime(true);$tnow = end($chronos);$tprev = prev($chronos); + // $t_elapsed_abs = number_format( $tnow - $tstart, 4); + // $t_elapsed = number_format( $tnow - $tprev, 4); + // echo '
    ' . __FUNCTION__ . ' Elapsed relative (sec):' . $t_elapsed . ' Elapsed ABSOLUTE (sec):' . $t_elapsed_abs .'
    '; + // reset($chronos); + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_test_cases_not_assigned_to_any_test_plan'); + $table->setGroupByColumnName($l18n['test_suite']); + $table->setSortByColumnName( + lang_get(($priorityMgmtEnabled) ? 'importance' : 'test_case')); + $table->sortDirection = 'DESC'; + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + + $gui->tableSet = array( + $table + ); + } +} + +$gui->tproject_name = $args->tproject_name; +$gui->pageTitle = lang_get('report_free_testcases_on_testproject'); +$gui->warning_msg = lang_get($msg_key); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * get Columns definition for table to display + * + * @param int $priorityMgmtEnabled + * @return array + */ +function getColumnsDefinition($priorityMgmtEnabled) +{ + $colDef = array(); + + $colDef[] = array( + 'title_key' => 'test_suite', + 'type' => 'text' + ); + $colDef[] = array( + 'title_key' => 'test_case', + 'type' => 'text' + ); + if ($priorityMgmtEnabled) { + $urgencies_for_filter = array( + lang_get('urgency_low'), + lang_get('urgency_medium'), + lang_get('urgency_high') + ); + $colDef[] = array( + 'title_key' => 'importance', + 'width' => 20, + 'filter' => 'ListSimpleMatch', + 'filterOptions' => $urgencies_for_filter + ); + } + + return $colDef; +} + +/** + * init_args + * + * Collect all inputs (arguments) to page, that can be arrived via $_REQUEST,$_SESSION + * and creates an stdClass() object where each property is result of mapping page inputs. + * We have created some sort of 'namespace', thi way we can easy understand which variables + * has been created for local use, and which have arrived on call. + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + G_PARAMS($iParams, $args); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } diff --git a/lib/results/keywordBarChart.php b/lib/results/keywordBarChart.php index 3650984046..d6a18f5b60 100644 --- a/lib/results/keywordBarChart.php +++ b/lib/results/keywordBarChart.php @@ -1,165 +1,161 @@ -scale = new stdClass(); - -$chart_cfg = config_get('results'); -$chart_cfg = $chart_cfg['charts']['dimensions']['keywordBarChart']; - -$cfg->chartTitle = lang_get($chart_cfg['chartTitle']); -$cfg->XSize = $chart_cfg['XSize']; -$cfg->YSize = $chart_cfg['YSize']; -$cfg->beginX = $chart_cfg['beginX']; -$cfg->beginY = $chart_cfg['beginY']; -$cfg->scale->legendXAngle = $chart_cfg['legendXAngle']; - - -$args = init_args($db); -$info = getDataAndScale($db,$args); - -createChart($info,$cfg); - - -/* - function: getDataAndScale - - args: dbHandler - - returns: object - -*/ -function getDataAndScale(&$dbHandler,$argsObj) -{ - $resultsCfg = config_get('results'); - $obj = new stdClass(); - $items = array(); - $totals = null; - - $metricsMgr = new tlTestPlanMetrics($dbHandler); - $dummy = $metricsMgr->getStatusTotalsByKeywordForRender($argsObj->tplan_id); - - $obj->canDraw = false; - if( !is_null($dummy) ) - { - $dataSet = $dummy->info; - $obj->canDraw = !is_null($dataSet) && (count($dataSet) > 0); - } - - if($obj->canDraw) - { - // Process to enable alphabetical order - foreach($dataSet as $keyword_id => $elem) - { - $item_descr[$elem['name']] = $keyword_id; - } - ksort($item_descr); - - foreach($item_descr as $name => $keyword_id) - { - $items[] = htmlspecialchars($name); - foreach($dataSet[$keyword_id]['details'] as $status => $value) - { - $totals[$status][] = $value['qty']; - } - } - } - - $obj->xAxis = new stdClass(); - $obj->xAxis->values = $items; - $obj->xAxis->serieName = 'Serie8'; - - $obj->series_color = null; - $obj->scale = new stdClass(); - $obj->scale->maxY = 0; - $obj->scale->minY = 0; - $obj->scale->divisions = 0; - - if(!is_null($totals)) - { - // in this array position we will find minimun value after an rsort - $minPos = count($dataSet)-1; - $obj->scale->maxY = 0; - $obj->scale->minY = 0; - - foreach($totals as $status => $values) - { - $obj->chart_data[] = $values; - $obj->series_label[] = lang_get($resultsCfg['status_label'][$status]); - if( isset($resultsCfg['charts']['status_colour'][$status]) ) - { - $obj->series_color[] = $resultsCfg['charts']['status_colour'][$status]; - } - } - } - - return $obj; -} - -/** - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,0,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - if( isset($_REQUEST['debug']) ) - { - $args->debug = 'yes'; - } - return $args; -} - -/** - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} \ No newline at end of file +scale = new stdClass(); + +$chart_cfg = config_get('results'); +$chart_cfg = $chart_cfg['charts']['dimensions']['keywordBarChart']; + +$cfg->chartTitle = lang_get($chart_cfg['chartTitle']); +$cfg->XSize = $chart_cfg['XSize']; +$cfg->YSize = $chart_cfg['YSize']; +$cfg->beginX = $chart_cfg['beginX']; +$cfg->beginY = $chart_cfg['beginY']; +$cfg->scale->legendXAngle = $chart_cfg['legendXAngle']; + +$args = initArgs($db); +$info = getDataAndScale($db, $args); + +createChart($info, $cfg); + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function getDataAndScale(&$dbHandler, $argsObj) +{ + $resultsCfg = config_get('results'); + $obj = new stdClass(); + $items = array(); + $totals = null; + + $metricsMgr = new tlTestPlanMetrics($dbHandler); + $dummy = $metricsMgr->getStatusTotalsByKeywordForRender($argsObj->tplan_id); + + $obj->canDraw = false; + if (! is_null($dummy)) { + $dataSet = $dummy->info; + $obj->canDraw = ! is_null($dataSet) && (! empty($dataSet)); + } + + if ($obj->canDraw) { + // Process to enable alphabetical order + foreach ($dataSet as $keyword_id => $elem) { + $item_descr[$elem['name']] = $keyword_id; + } + ksort($item_descr); + + foreach ($item_descr as $name => $keyword_id) { + $items[] = htmlspecialchars($name); + foreach ($dataSet[$keyword_id]['details'] as $status => $value) { + $totals[$status][] = $value['qty']; + } + } + } + + $obj->xAxis = new stdClass(); + $obj->xAxis->values = $items; + $obj->xAxis->serieName = 'Serie8'; + + $obj->series_color = null; + $obj->scale = new stdClass(); + $obj->scale->maxY = 0; + $obj->scale->minY = 0; + $obj->scale->divisions = 0; + + if (! is_null($totals)) { + $obj->scale->maxY = 0; + $obj->scale->minY = 0; + + foreach ($totals as $status => $values) { + $obj->chart_data[] = $values; + $obj->series_label[] = lang_get( + $resultsCfg['status_label'][$status]); + if (isset($resultsCfg['charts']['status_colour'][$status])) { + $obj->series_color[] = $resultsCfg['charts']['status_colour'][$status]; + } + } + } + + return $obj; +} + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + if (isset($_REQUEST['debug'])) { + $args->debug = 'yes'; + } + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} diff --git a/lib/results/metricsDashboard.php b/lib/results/metricsDashboard.php index 1c3325c5a8..d66b1b902e 100644 --- a/lib/results/metricsDashboard.php +++ b/lib/results/metricsDashboard.php @@ -1,473 +1,517 @@ -show_test_plan_status; -$round_precision = config_get('dashboard_precision'); - -$labels = init_labels(array('overall_progress' => null, 'test_plan' => null, 'progress' => null, - 'href_metrics_dashboard' => null, 'progress_absolute' => null, - 'no_testplans_available' => null, 'not_aplicable' => null, - 'platform' => null, 'th_active_tc' => null, 'in_percent' => null)); - -list($gui->tplan_metrics,$gui->show_platforms, $platforms) = getMetrics($db,$_SESSION['currentUser'],$args,$result_cfg, $labels); - - -// new dBug($gui->tplan_metrics); -if(count($gui->tplan_metrics) > 0) -{ - $statusSetForDisplay = $result_cfg['status_label_for_exec_ui']; - $gui->warning_msg = ''; - $columns = getColumnsDefinition($gui->show_platforms, $statusSetForDisplay, $labels, $platforms); - - $matrixData = array(); - if(isset($gui->tplan_metrics['testplans'])) - { - foreach ($gui->tplan_metrics['testplans'] as $tplan_metrics) - { - foreach($tplan_metrics['platforms'] as $key => $platform_metric) - { - $rowData = array(); - - // if test plan does not use platforms a overall status is not necessary - $tplan_string = strip_tags($platform_metric['tplan_name']); - if ($show_all_status_details) - { - // add information for all exec statuses - $tplan_string .= "
    "; - foreach( $statusSetForDisplay as $status_verbose => &$status_label) - { - $tplan_string .= lang_get($status_label). ": " . - $tplan_metrics['overall'][$status_verbose] . - " [" . getPercentage($tplan_metrics['overall'][$status_verbose], - $tplan_metrics['overall']['active'], - $round_precision) . "%], "; - } - } - else - { - $tplan_string .= " - "; - } - - $tplan_string .= $labels['overall_progress'] . ": " . - getPercentage($tplan_metrics['overall']['executed'], - $tplan_metrics['overall']['active'], - $round_precision) . "%"; - - $rowData[] = $tplan_string; - if ($gui->show_platforms) - { - $rowData[] = strip_tags($platform_metric['platform_name']); - } - - if( isset($platform_metric['total']) ) - { - $rowData[] = $platform_metric['total']; - } - else - { - $rowData[] = 0; - } - - foreach ($statusSetForDisplay as $status_verbose => $status_label) - { - if( isset($platform_metric[$status_verbose]) ) - { - $rowData[] = $platform_metric[$status_verbose]; - $rowData[] = getPercentage($platform_metric[$status_verbose], $platform_metric['active'], - $round_precision); - } - else - { - $rowData[] = 0; - $rowData[] = 0; - } - } - - $rowData[] = getPercentage($platform_metric['executed'], $platform_metric['active'], - $round_precision); - - $matrixData[] = $rowData; - } - } - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_metrics_dashboard'); - - // if platforms are to be shown -> group by test plan - // if no platforms are to be shown -> no grouping - if($gui->show_platforms) - { - $table->setGroupByColumnName($labels['test_plan']); - } - - $table->setSortByColumnName($labels['progress']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - $table->toolbarResetFiltersButton = true; - $table->title = $labels['href_metrics_dashboard']; - $table->showGroupItemsCount = true; - - $gui->tableSet = array($table); - - // get overall progress, collect test project metrics - $gui->project_metrics = collectTestProjectMetrics($gui->tplan_metrics, - array('statusSetForDisplay' => $statusSetForDisplay, - 'round_precision' => $round_precision)); -} - - -$smarty = new TLSmarty; -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * only active builds has to be used - * - * @internal revisions - * - * - */ -function getMetrics(&$db,$userObj,$args, $result_cfg, $labels) -{ - $user_id = $args->currentUserID; - $tproject_id = $args->tproject_id; - $linked_tcversions = array(); - $metrics = array(); - $tplan_mgr = new testplan($db); - $show_platforms = false; - $platforms = array(); - - // get all tesplans accessibles for user, for $tproject_id - $options = array('output' => 'map'); - $options['active'] = $args->show_only_active ? ACTIVE : TP_ALL_STATUS; - $test_plans = $userObj->getAccessibleTestPlans($db,$tproject_id,null,$options); - - // Get count of testcases linked to every testplan - // Hmm Count active and inactive ? - $linkedItemsQty = $tplan_mgr->count_testcases(array_keys($test_plans),null,array('output' => 'groupByTestPlan')); - - - $metricsMgr = new tlTestPlanMetrics($db); - $show_platforms = false; - - $metrics = array('testplans' => null, 'total' => null); - $mm = &$metrics['testplans']; - $metrics['total'] = array('active' => 0,'total' => 0, 'executed' => 0); - foreach($result_cfg['status_label_for_exec_ui'] as $status_code => &$dummy) - { - $metrics['total'][$status_code] = 0; - } - - $codeStatusVerbose = array_flip($result_cfg['status_code']); - foreach($test_plans as $key => &$dummy) - { - // We need to know if test plan has builds, if not we can not call any method - // that try to get exec info, because you can only execute if you have builds. - // - // 20130909 - added active filter - $buildSet = $tplan_mgr->get_builds($key,testplan::ACTIVE_BUILDS); - if( is_null($buildSet) ) - { - continue; - } - - $platformSet = $tplan_mgr->getPlatforms($key); - if (isset($platformSet)) - { - $platforms = array_merge($platforms, $platformSet); - } - $show_platforms_for_tplan = !is_null($platformSet); - $show_platforms = $show_platforms || $show_platforms_for_tplan; - if( !is_null($platformSet) ) - { - $neurus = $metricsMgr->getExecCountersByPlatformExecStatus($key,null, - array('getPlatformSet' => true, - 'getOnlyActiveTCVersions' => true)); - - $mm[$key]['overall']['active'] = $mm[$key]['overall']['executed'] = 0; - foreach($neurus['with_tester'] as $platform_id => &$pinfo) - { - $xd = &$mm[$key]['platforms'][$platform_id]; - $xd['tplan_name'] = $dummy['name']; - $xd['platform_name'] = $neurus['platforms'][$platform_id]; - $xd['total'] = $xd['active'] = $neurus['total'][$platform_id]['qty']; - $xd['executed'] = 0; - - foreach($pinfo as $code => &$elem) - { - $xd[$codeStatusVerbose[$code]] = $elem['exec_qty']; - if($codeStatusVerbose[$code] != 'not_run') - { - $xd['executed'] += $elem['exec_qty']; - } - if( !isset($mm[$key]['overall'][$codeStatusVerbose[$code]]) ) - { - $mm[$key]['overall'][$codeStatusVerbose[$code]] = 0; - } - $mm[$key]['overall'][$codeStatusVerbose[$code]] += $elem['exec_qty']; - $metrics['total'][$codeStatusVerbose[$code]] += $elem['exec_qty']; - } - $mm[$key]['overall']['executed'] += $xd['executed']; - $mm[$key]['overall']['active'] += $xd['active']; - } - unset($neurus); - $mm[$key]['overall']['total'] = $mm[$key]['overall']['active']; - $metrics['total']['executed'] += $mm[$key]['overall']['executed']; - $metrics['total']['active'] += $mm[$key]['overall']['active']; - } - else - { - $mm[$key]['overall'] = $metricsMgr->getExecCountersByExecStatus($key,null, - array('getOnlyActiveTCVersions' => true)); - - $mm[$key]['overall']['active'] = $mm[$key]['overall']['total']; - - // compute executed - $mm[$key]['overall']['executed'] = 0; - foreach($mm[$key]['overall'] as $status_code => $qty) - { - if( $status_code != 'not_run' && $status_code != 'total' && $status_code != 'active' ) - { - $mm[$key]['overall']['executed'] += $qty; - } - - if( $status_code != 'total' && $status_code != 'active' ) - { - if(!isset($metrics['total'][$status_code])) - { - $metrics['total'][$status_code] = 0; - } - $metrics['total'][$status_code] += $qty; - } - } - $metrics['total']['executed'] += $mm[$key]['overall']['executed']; - $metrics['total']['active'] += $mm[$key]['overall']['active']; - - $mm[$key]['platforms'][0] = $mm[$key]['overall']; - $mm[$key]['platforms'][0]['tplan_name'] = $dummy['name']; - $mm[$key]['platforms'][0]['platform_name'] = $labels['not_aplicable']; - } - } - - // remove duplicate platform names - $platformsUnique = array(); - foreach($platforms as $platform) - { - if(!in_array($platform['name'], $platformsUnique)) - { - $platformsUnique[] = $platform['name']; - } - } - - return array($metrics, $show_platforms, $platformsUnique); -} - -/** - * - * - */ -function getPercentage($denominator, $numerator, $round_precision) -{ - $percentage = ($numerator > 0) ? (round(($denominator / $numerator) * 100,$round_precision)) : 0; - - return $percentage; -} - -/** - * get Columns definition for table to display - * - */ -function getColumnsDefinition($showPlatforms, $statusLbl, $labels, $platforms) -{ - $colDef = array(); - - $colDef[] = array('title_key' => 'test_plan', 'width' => 60, 'type' => 'text', 'sortType' => 'asText', - 'filter' => 'string'); - - if ($showPlatforms) - { - $colDef[] = array('title_key' => 'platform', 'width' => 60, 'sortType' => 'asText', - 'filter' => 'list', 'filterOptions' => $platforms); - } - - $colDef[] = array('title_key' => 'th_active_tc', 'width' => 40, 'sortType' => 'asInt', - 'filter' => 'numeric'); - - // create 2 columns for each defined status - foreach($statusLbl as $lbl) - { - $colDef[] = array('title_key' => $lbl, 'width' => 40, 'hidden' => true, 'type' => 'int', - 'sortType' => 'asInt', 'filter' => 'numeric'); - - $colDef[] = array('title' => lang_get($lbl) . " " . $labels['in_percent'], 'width' => 40, - 'col_id' => 'id_'. $lbl .'_percent', 'type' => 'float', 'sortType' => 'asFloat', - 'filter' => 'numeric'); - } - - $colDef[] = array('title_key' => 'progress', 'width' => 40, 'sortType' => 'asFloat', 'filter' => 'numeric'); - - return $colDef; -} - -function initEnv(&$dbHandler) -{ - $args = new stdClass(); - $gui = new stdClass(); - - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "show_only_active" => array(tlInputParameter::CB_BOOL), - "show_only_active_hidden" => array(tlInputParameter::CB_BOOL)); - - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) - { - - $args->show_only_active = true; - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->redirect_target = "../../login.php?note=logout"; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - // Have got OBJECT KEY - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - - // if we are here => everything seems OK - $tprojMgr = new testproject($dbHandler); - $dj = $tprojMgr->getByAPIKey($args->apikey); - $args->tproject_id = $dj['id']; - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? - intval($_SESSION['testprojectID']) : 0; - } - - if($args->tproject_id <= 0) - { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - $mgr = new tree($dbHandler); - $dummy = $mgr->get_node_hierarchy_info($args->tproject_id); - $args->tproject_name = $dummy['name']; - - $args->user = $_SESSION['currentUser']; - $args->currentUserID = $args->user->dbID; - - // I'm sorry for MAGIC - $args->direct_link_ok = true; - $ak = testproject::getAPIkey($dbHandler,$args->tproject_id); - $args->direct_link = $_SESSION['basehref'] . - "lnl.php?type=metricsdashboard&" . - "apikey={$ak}"; - - if ($args->show_only_active) - { - $selection = true; - } - else if ($args->show_only_active_hidden) - { - $selection = false; - } - else if (isset($_SESSION['show_only_active'])) - { - $selection = $_SESSION['show_only_active']; - } - else - { - $selection = true; - } - $args->show_only_active = $_SESSION['show_only_active'] = $selection; - - - $gui->tproject_name = $args->tproject_name; - $gui->show_only_active = $args->show_only_active; - $gui->direct_link = $args->direct_link; - $gui->direct_link_ok = $args->direct_link_ok; - $gui->warning_msg = lang_get('no_testplans_available'); - - return array($args,$gui); -} - - -/** - * - */ -function collectTestProjectMetrics($tplanMetrics,$cfg) -{ - $mm = array(); - $mm['executed']['value'] = getPercentage($tplanMetrics['total']['executed'], - $tplanMetrics['total']['active'], $cfg['round_precision']); - $mm['executed']['label_key'] = 'progress_absolute'; - - foreach ($cfg['statusSetForDisplay'] as $status_verbose => $label_key) - { - $mm[$status_verbose]['value'] = getPercentage($tplanMetrics['total'][$status_verbose], - $tplanMetrics['total']['active'], $cfg['round_precision']); - $mm[$status_verbose]['label_key'] = $label_key; - } - return $mm; -} - -/** - * - */ -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - $checkOrMode = array('testplan_metrics','testplan_execute'); - foreach($checkOrMode as $right) - { - if( $user->hasRightOnProj($db,$right,$context->tproject_id,$context->tplan_id,$context->getAccessAttr) ) - { - return true; - } - } - return false; -} +show_test_plan_status; +$round_precision = config_get('dashboard_precision'); + +$labels = init_labels( + array( + 'overall_progress' => null, + 'test_plan' => null, + 'progress' => null, + 'href_metrics_dashboard' => null, + 'progress_absolute' => null, + 'no_testplans_available' => null, + 'not_aplicable' => null, + 'platform' => null, + 'th_active_tc' => null, + 'in_percent' => null + )); + +list ($gui->tplan_metrics, $gui->show_platforms, $platforms) = getMetrics($db, + $_SESSION['currentUser'], $args, $result_cfg, $labels); + +if (! empty($gui->tplan_metrics)) { + $statusSetForDisplay = $result_cfg['status_label_for_exec_ui']; + $gui->warning_msg = ''; + $columns = getColumnsDefinition($gui->show_platforms, $statusSetForDisplay, + $labels, $platforms); + + $matrixData = array(); + if (isset($gui->tplan_metrics['testplans'])) { + foreach ($gui->tplan_metrics['testplans'] as $tplan_metrics) { + foreach ($tplan_metrics['platforms'] as $platform_metric) { + $rowData = array(); + + // if test plan does not use platforms a overall status is not necessary + $tplan_string = strip_tags($platform_metric['tplan_name']); + if ($show_all_status_details) { + // add information for all exec statuses + $tplan_string .= "
    "; + foreach ($statusSetForDisplay as $status_verbose => &$status_label) { + $tplan_string .= lang_get($status_label) . ": " . + $tplan_metrics['overall'][$status_verbose] . " [" . + getPercentage( + $tplan_metrics['overall'][$status_verbose], + $tplan_metrics['overall']['active'], + $round_precision) . "%], "; + } + } else { + $tplan_string .= " - "; + } + + $tplan_string .= $labels['overall_progress'] . ": " . + getPercentage($tplan_metrics['overall']['executed'], + $tplan_metrics['overall']['active'], $round_precision) . + "%"; + + $rowData[] = $tplan_string; + if ($gui->show_platforms) { + $rowData[] = strip_tags($platform_metric['platform_name']); + } + + if (isset($platform_metric['total'])) { + $rowData[] = $platform_metric['total']; + } else { + $rowData[] = 0; + } + + foreach ($statusSetForDisplay as $status_verbose => $status_label) { + if (isset($platform_metric[$status_verbose])) { + $rowData[] = $platform_metric[$status_verbose]; + $rowData[] = getPercentage( + $platform_metric[$status_verbose], + $platform_metric['active'], $round_precision); + } else { + $rowData[] = 0; + $rowData[] = 0; + } + } + + $rowData[] = getPercentage($platform_metric['executed'], + $platform_metric['active'], $round_precision); + + $matrixData[] = $rowData; + } + } + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_metrics_dashboard'); + + // if platforms are to be shown -> group by test plan + // if no platforms are to be shown -> no grouping + if ($gui->show_platforms) { + $table->setGroupByColumnName($labels['test_plan']); + } + + $table->setSortByColumnName($labels['progress']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + $table->toolbarResetFiltersButton = true; + $table->title = $labels['href_metrics_dashboard']; + $table->showGroupItemsCount = true; + + $gui->tableSet = array( + $table + ); + + // get overall progress, collect test project metrics + $gui->project_metrics = collectTestProjectMetrics($gui->tplan_metrics, + array( + 'statusSetForDisplay' => $statusSetForDisplay, + 'round_precision' => $round_precision + )); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * only active builds has to be used + * + * @param database $db + * @param tlUser $userObj + * @param stdClass $args + * @param array $result_cfg + * @param array $labels + * @return array + * @internal revisions + */ +function getMetrics(&$db, $userObj, $args, $result_cfg, $labels) +{ + $tproject_id = $args->tproject_id; + $metrics = array(); + $tplan_mgr = new testplan($db); + $show_platforms = false; + $platforms = array(); + + // get all tesplans accessibles for user, for $tproject_id + $options = array( + 'output' => 'map' + ); + $options['active'] = $args->show_only_active ? ACTIVE : TP_ALL_STATUS; + $test_plans = $userObj->getAccessibleTestPlans($db, $tproject_id, null, + $options); + + $metricsMgr = new tlTestPlanMetrics($db); + $show_platforms = false; + + $metrics = array( + 'testplans' => null, + 'total' => null + ); + $mm = &$metrics['testplans']; + $metrics['total'] = array( + 'active' => 0, + 'total' => 0, + 'executed' => 0 + ); + foreach ($result_cfg['status_label_for_exec_ui'] as $status_code => &$dummy) { + $metrics['total'][$status_code] = 0; + } + + $codeStatusVerbose = array_flip($result_cfg['status_code']); + foreach ($test_plans as $key => &$dummy) { + // We need to know if test plan has builds, if not we can not call any method + // that try to get exec info, because you can only execute if you have builds. + // + // 20130909 - added active filter + $buildSet = $tplan_mgr->get_builds($key, testplan::ACTIVE_BUILDS); + if (is_null($buildSet)) { + continue; + } + + $platformSet = $tplan_mgr->getPlatforms($key); + if (isset($platformSet)) { + $platforms = array_merge($platforms, $platformSet); + } + $show_platforms_for_tplan = ! is_null($platformSet); + $show_platforms = $show_platforms || $show_platforms_for_tplan; + if (! is_null($platformSet)) { + $neurus = $metricsMgr->getExecCountersByPlatformExecStatus($key, + null, + array( + 'getPlatformSet' => true, + 'getOnlyActiveTCVersions' => true + )); + + $mm[$key]['overall']['active'] = $mm[$key]['overall']['executed'] = 0; + foreach ($neurus['with_tester'] as $platform_id => &$pinfo) { + $xd = &$mm[$key]['platforms'][$platform_id]; + $xd['tplan_name'] = $dummy['name']; + $xd['platform_name'] = $neurus['platforms'][$platform_id]; + $xd['total'] = $xd['active'] = $neurus['total'][$platform_id]['qty']; + $xd['executed'] = 0; + + foreach ($pinfo as $code => &$elem) { + $xd[$codeStatusVerbose[$code]] = $elem['exec_qty']; + if ($codeStatusVerbose[$code] != 'not_run') { + $xd['executed'] += $elem['exec_qty']; + } + if (! isset($mm[$key]['overall'][$codeStatusVerbose[$code]])) { + $mm[$key]['overall'][$codeStatusVerbose[$code]] = 0; + } + $mm[$key]['overall'][$codeStatusVerbose[$code]] += $elem['exec_qty']; + $metrics['total'][$codeStatusVerbose[$code]] += $elem['exec_qty']; + } + $mm[$key]['overall']['executed'] += $xd['executed']; + $mm[$key]['overall']['active'] += $xd['active']; + } + unset($neurus); + $mm[$key]['overall']['total'] = $mm[$key]['overall']['active']; + $metrics['total']['executed'] += $mm[$key]['overall']['executed']; + $metrics['total']['active'] += $mm[$key]['overall']['active']; + } else { + $mm[$key]['overall'] = $metricsMgr->getExecCountersByExecStatus( + $key, null, array( + 'getOnlyActiveTCVersions' => true + )); + + $mm[$key]['overall']['active'] = $mm[$key]['overall']['total']; + + // compute executed + $mm[$key]['overall']['executed'] = 0; + foreach ($mm[$key]['overall'] as $status_code => $qty) { + if ($status_code != 'not_run' && $status_code != 'total' && + $status_code != 'active') { + $mm[$key]['overall']['executed'] += $qty; + } + + if ($status_code != 'total' && $status_code != 'active') { + if (! isset($metrics['total'][$status_code])) { + $metrics['total'][$status_code] = 0; + } + $metrics['total'][$status_code] += $qty; + } + } + $metrics['total']['executed'] += $mm[$key]['overall']['executed']; + $metrics['total']['active'] += $mm[$key]['overall']['active']; + + $mm[$key]['platforms'][0] = $mm[$key]['overall']; + $mm[$key]['platforms'][0]['tplan_name'] = $dummy['name']; + $mm[$key]['platforms'][0]['platform_name'] = $labels['not_aplicable']; + } + } + + // remove duplicate platform names + $platformsUnique = array(); + foreach ($platforms as $platform) { + if (! in_array($platform['name'], $platformsUnique)) { + $platformsUnique[] = $platform['name']; + } + } + + return array( + $metrics, + $show_platforms, + $platformsUnique + ); +} + +/** + * + * @param int $denominator + * @param int $numerator + * @param int $round_precision + * @return number + */ +function getPercentage($denominator, $numerator, $round_precision) +{ + return ($numerator > 0) ? (round(($denominator / $numerator) * 100, + $round_precision)) : 0; +} + +/** + * get Columns definition for table to display + * + * @param boolean $showPlatforms + * @param array $statusLbl + * @param array $labels + * @param array $platforms + * @return array + */ +function getColumnsDefinition($showPlatforms, $statusLbl, $labels, $platforms) +{ + $colDef = array(); + + $colDef[] = array( + 'title_key' => 'test_plan', + 'width' => 60, + 'type' => 'text', + 'sortType' => 'asText', + 'filter' => 'string' + ); + + if ($showPlatforms) { + $colDef[] = array( + 'title_key' => 'platform', + 'width' => 60, + 'sortType' => 'asText', + 'filter' => 'list', + 'filterOptions' => $platforms + ); + } + + $colDef[] = array( + 'title_key' => 'th_active_tc', + 'width' => 40, + 'sortType' => 'asInt', + 'filter' => 'numeric' + ); + + // create 2 columns for each defined status + foreach ($statusLbl as $lbl) { + $colDef[] = array( + 'title_key' => $lbl, + 'width' => 40, + 'hidden' => true, + 'type' => 'int', + 'sortType' => 'asInt', + 'filter' => 'numeric' + ); + + $colDef[] = array( + 'title' => lang_get($lbl) . " " . $labels['in_percent'], + 'width' => 40, + 'col_id' => 'id_' . $lbl . '_percent', + 'type' => 'float', + 'sortType' => 'asFloat', + 'filter' => 'numeric' + ); + } + + $colDef[] = array( + 'title_key' => 'progress', + 'width' => 40, + 'sortType' => 'asFloat', + 'filter' => 'numeric' + ); + + return $colDef; +} + +/** + * + * @param database $dbHandler + * @return stdClass[] + */ +function initEnv(&$dbHandler) +{ + $args = new stdClass(); + $gui = new stdClass(); + + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "show_only_active" => array( + tlInputParameter::CB_BOOL + ), + "show_only_active_hidden" => array( + tlInputParameter::CB_BOOL + ) + ); + + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + + $args->show_only_active = true; + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->redirect_target = "../../login.php?note=logout"; + + if (strlen($args->apikey) == 32) { + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + // Have got OBJECT KEY + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + + // if we are here => everything seems OK + $tprojMgr = new testproject($dbHandler); + $dj = $tprojMgr->getByAPIKey($args->apikey); + $args->tproject_id = $dj['id']; + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + if ($args->tproject_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + $mgr = new tree($dbHandler); + $dummy = $mgr->get_node_hierarchy_info($args->tproject_id); + $args->tproject_name = $dummy['name']; + + $args->user = $_SESSION['currentUser']; + $args->currentUserID = $args->user->dbID; + + // I'm sorry for MAGIC + $args->direct_link_ok = true; + $ak = testproject::getAPIkey($dbHandler, $args->tproject_id); + $args->direct_link = $_SESSION['basehref'] . "lnl.php?type=metricsdashboard&" . + "apikey={$ak}"; + + if ($args->show_only_active) { + $selection = true; + } elseif ($args->show_only_active_hidden) { + $selection = false; + } elseif (isset($_SESSION['show_only_active'])) { + $selection = $_SESSION['show_only_active']; + } else { + $selection = true; + } + $args->show_only_active = $_SESSION['show_only_active'] = $selection; + + $gui->tproject_name = $args->tproject_name; + $gui->show_only_active = $args->show_only_active; + $gui->direct_link = $args->direct_link; + $gui->direct_link_ok = $args->direct_link_ok; + $gui->warning_msg = lang_get('no_testplans_available'); + + return array( + $args, + $gui + ); +} + +/** + * + * @param array $tplanMetrics + * @param array $cfg + * @return array + */ +function collectTestProjectMetrics($tplanMetrics, $cfg) +{ + $mm = array(); + $mm['executed']['value'] = getPercentage($tplanMetrics['total']['executed'], + $tplanMetrics['total']['active'], $cfg['round_precision']); + $mm['executed']['label_key'] = 'progress_absolute'; + + foreach ($cfg['statusSetForDisplay'] as $status_verbose => $label_key) { + $mm[$status_verbose]['value'] = getPercentage( + $tplanMetrics['total'][$status_verbose], + $tplanMetrics['total']['active'], $cfg['round_precision']); + $mm[$status_verbose]['label_key'] = $label_key; + } + return $mm; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return boolean + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + $checkOrMode = array( + 'testplan_metrics', + 'testplan_execute' + ); + foreach ($checkOrMode as $right) { + if ($user->hasRightOnProj($db, $right, $context->tproject_id, + $context->tplan_id, $context->getAccessAttr)) { + return true; + } + } + return false; +} ?> diff --git a/lib/results/neverRunByPP.php b/lib/results/neverRunByPP.php index 89a851fbc2..1a758094ca 100644 --- a/lib/results/neverRunByPP.php +++ b/lib/results/neverRunByPP.php @@ -1,537 +1,658 @@ -labels; - -$testCaseCfg = config_get('testcase_cfg'); - -// done here in order to get some config about images -$smarty = new TLSmarty(); - -$doIt = false; -$doChoice = true; - -$metrics = null; - -/* -file_put_contents('/development/tmp/ty.txt', - json_encode(array('$args->platSet' => $args->platSet)) . "\n", - FILE_APPEND); -*/ -if( $args->doAction == 'result' ) { - $metrics = getMetrics($db,$args,$gui); -} - -if( $args->doAction == 'result' && - !is_null($metrics) and count($metrics) > 0 ) { - - $doIt = true; - $doChoice = false; - - $tpl = $tplCfg->default_template; - - $urlSafeString = array(); - $urlSafeString['tprojectPrefix'] = urlencode($gui->tproject_info['prefix']); - $urlSafeString['basehref'] = str_replace(" ", "%20", $args->basehref); - - $out = array(); - $pathCache = $topCache = $levelCache = null; - $nameCache = initNameCache($gui); - - $odx = 0; - foreach($metrics as &$elem) { - // ------------------------------------------- - // do some decode work, using caches - if( !isset($pathCache[$elem['tcase_id']]) ) { - $du = $tcase_mgr->getPathLayered(array($elem['tcase_id'])); - $pathCache[$elem['tcase_id']] = $du[$elem['tsuite_id']]['value']; - $levelCache[$elem['tcase_id']] = $du[$elem['tsuite_id']]['level']; - $ky = current(array_keys($du)); - $topCache[$elem['tcase_id']] = $ky; - } - - // ----------------------------------------------------------- - // IMPORTANT NOTICE: - // - // Column ORDER IS CRITIC - // testTitle CCA-15708: RSRSR-150 - // platformName XXXX <<< ONlY is platforms have been used on - // Test plan under analisys - // - // $out[$odx]['suiteName'] = $pathCache[$exec['tcase_id']]; - - // ------------------------------------------------------------- - $zipper = ''; - switch($args->format) { - case FORMAT_HTML: - $out[$odx]['testTitle'] = ""; - $zipper = ''; - break; - - case FORMAT_XLS: - $out[$odx]['testTitle'] = ''; - break; - - default: - $out[$odx]['testTitle'] = ''; - $zipper = ''; - break; - } - - // See IMPORTANT NOTICE/WARNING about XLS generation - $out[$odx]['testTitle'] .= $elem['full_external_id'] . ':' . - $elem['name'] . $zipper; - - // Insert order on out is CRITIC, because order is used on buildMatrix - if($gui->show_platforms) { - $out[$odx]['platformName'] = - $nameCache['platform'][$elem['platform_id']]; - } - // --------------------------------------------------------- - $odx++; - } - $gui->dataSet = $out; - unset($out); -} - -$gui->urlSendExcelByEmail = $args->basehref . - "lib/results/neverRunByPP.php?" . - "format=" . FORMAT_XLS . "&tplan_id=$gui->tplan_id" . - "&tproject_id=$gui->tproject_id&doAction=result"; - -if( $doIt ) { - switch($args->format) { - case FORMAT_XLS: - createSpreadsheet($gui,$args,$args->getSpreadsheetBy,$cfSet); - break; - - default: - $tableOpt = - array('format' => $args->format, - 'show_platforms' => $gui->show_platforms); - - $gui->tableSet[] = buildMatrix($gui->dataSet, $args, $tableOpt , - $gui->platformSet,$cfSet); - break; - } -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui ); - -if( $doChoice ) { - $tpl = 'neverRunByPPLauncher.tpl'; - $gui->url2call = $args->basehref . - "lib/results/neverRunByPP.php?tplan_id=$gui->tplan_id" . - "&tproject_id=$gui->tproject_id&format=$gui->format&doAction=result"; -} - -displayReport($tplCfg->template_dir . $tpl, - $smarty, $args->format, $gui->mailCfg); - - -/** - * - * - */ -function init_args(&$dbHandler) { - $iP = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - "type" => array(tlInputParameter::STRING_N,0,1), - "platSet" => array(tlInputParameter::ARRAY_INT), - "doAction" => array(tlInputParameter::STRING_N,5,10)); - - $args = new stdClass(); - R_PARAMS($iP,$args); - - $cx = 'sendSpreadSheetByMail_x'; - $args->getSpreadsheetBy = isset($_REQUEST[$cx]) ? 'email' : null; - if( is_null($args->getSpreadsheetBy) ) { - $cx = 'exportSpreadSheet_x'; - $args->getSpreadsheetBy = isset($_REQUEST[$cx]) ? 'download' : null; - } - - $args->addOpAccess = true; - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } else { - testlinkInitPage($dbHandler,true,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - $args->user = $_SESSION['currentUser']; - $args->basehref = $_SESSION['basehref']; - - return $args; -} - -/** - * initializeGui - * - */ -function initializeGui(&$dbh,&$argsObj,&$tplanMgr) { - $tprojectMgr = new testproject($dbh); - - $guiObj = new stdClass(); - - $guiObj->labels = init_labels( - array('deleted_user' => null, 'design' => null, - 'execution' => null,'nobody' => null, - 'execution_history' => null, - 'info_notrun_tc_report' => null, - 'title' => 'neverRunByPP_title')); - - $guiObj->title = $guiObj->labels['title']; - $guiObj->pageTitle = $guiObj->title; - $guiObj->report_context = ''; - $guiObj->info_msg = ''; - - $guiObj->tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->tproject_info = $tprojectMgr->get_by_id($argsObj->tproject_id); - $guiObj->tplan_name = $guiObj->tplan_info['name']; - $guiObj->tproject_name = $guiObj->tproject_info['name']; - - $guiObj->format = $argsObj->format; - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->apikey = $argsObj->apikey; - - $guiObj->dataSet = null; - $guiObj->type = $argsObj->type; - $guiObj->warning_msg = ''; - - $reportCfg = config_get('reports_list'); - - // needed to decode - $getOpt = array('outputFormat' => 'map', 'addIfNull' => true); - $guiObj->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,$getOpt); - - $guiObj->show_platforms = true; - $pqy = count($guiObj->platformSet); - if( $pqy == 0 || ($pqy == 1) && isset($guiObj->platformSet[0])){ - $guiObj->show_platforms = false; - } - - // will be used when sending mail o creating spreadsheet - $guiObj->platSet = array(); - $pp = (array)array_flip($argsObj->platSet); - if( !isset($pp[0]) ) { - // we have platforms - foreach( $argsObj->platSet as $pk ) { - $guiObj->platSet[$pk] = $pk; - } - } - - $guiObj->mailCfg = buildMailCfg($guiObj); - - return $guiObj; -} - - -/** - * - */ -function checkRights(&$db,&$user,$context = null) { - if(is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - $check = $user->hasRightOnProj($db,'testplan_metrics', - $context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), - 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * Builds ext-js rich table to display matrix results - * - * @param map dataSet: data to be displayed on matrix - * - * return tlExtTable - * - */ -function buildMatrix($dataSet, &$args, $options = array(), $platforms,$customFieldColumns=null) { - $default_options = - array('show_platforms' => false,'format' => FORMAT_HTML); - $options = array_merge($default_options, $options); - - $l18n = init_labels(array('platform' => null)); - $columns = array(); - $columns[] = array('title_key' => 'title_test_case_title', 'width' => 80, 'type' => 'text'); - - if ($options['show_platforms']) { - $columns[] = array('title_key' => 'platform', 'width' => 60, 'filter' => 'list', 'filterOptions' => $platforms); - } - - if ($options['format'] == FORMAT_HTML) { - - // IMPORTANT DEVELOPMENT NOTICE - // columns and dataSet are deeply related this means that inside - // dataSet order has to be identical that on columns or table will be a disaster - // - $matrix = new tlExtTable($columns, $dataSet, 'tl_table_results_by_status'); - - //if not run report: sort by test suite - //blocked, failed report: sort by platform (if enabled) else sort by date - $sort_name = 0; - $sort_name = $options['show_platforms'] ? $l18n['platform'] : ''; - - $matrix->setSortByColumnName($sort_name); - $matrix->addCustomBehaviour('text', array('render' => 'columnWrap')); - - //define table toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - } else { - $matrix = new tlHTMLTable($columns, $dataSet, 'tl_table_results_by_status'); - } - return $matrix; -} - - -/** - * - */ -function initNameCache($guiObj) { - $safeItems = array('platform' => null); - - if($guiObj->show_platforms) { - foreach($guiObj->platformSet as $id => $name) { - $safeItems['platform'][$id] = htmlspecialchars($name); - } - } - - return $safeItems; -} - -/** - * - */ -function createSpreadsheet($gui,$args,$media) { - $lbl = initLblSpreadsheet(); - $cellRange = range('A','Z'); - $style = initStyleSpreadsheet(); - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - // Step 2 - // data is organized with following columns$dataHeader[] - // Test case - // [Platform] - // - // This is HOW gui->dataSet is organized - // THIS IS CRITIC ?? - // - // testTitle PTRJ-76:Create issue tracker - no conflict - // [platformName] - // - $dataHeader = array($lbl['title_test_case_title']); - if( $showPlatforms = ( property_exists($gui,'platformSet') && - !is_null($gui->platformSet) && !isset($gui->platformSet[0])) ) { - $dataHeader[] = $lbl['platform']; - } - - $startingRow = count($lines2write) + 2; // MAGIC - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - // Now process data - $colorChangeCol = 1; - $startingRow++; - $qta_loops = count($gui->dataSet); - $val4color = $gui->dataSet[0][$colorChangeCol]; - for($idx = 0; $idx < $qta_loops; $idx++) { - $line2write = $gui->dataSet[$idx]; - $colCounter = 0; - foreach($line2write as $ldx => $field) { - $cellID = $cellRange[$colCounter] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, html_entity_decode($field) ); - $colCounter++; - } - $cellEnd = $cellRange[$colCounter-1] . $startingRow; - $startingRow++; - } - - // Final step - $objPHPExcel->setActiveSheetIndex(0); - - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - - $codex = 'neverRunByPP'; - $tmpfname = tempnam(config_get('temp_dir'),"$codex.tmp"); - $objWriter->save($tmpfname); - - if($args->getSpreadsheetBy == 'email') { - require_once('email_api.php'); - - $ema = new stdClass(); - $ema->from_address = config_get('from_email'); - $ema->to_address = $args->user->emailAddress;; - $ema->subject = $gui->mailCfg->subject; - $ema->message = $gui->mailCfg->subject; - - $dum = uniqid("$codex_") . '.xls'; - $oops = array('attachment' => - array('file' => $tmpfname, 'newname' => $dum), - 'exit_on_error' => true, 'htmlFormat' => true); - $email_op = email_send_wrapper($ema,$oops); - unlink($tmpfname); - exit(); - } else { - downloadXls($tmpfname,$xlsType,$gui,"$codex_"); - } -} - - -/** - * - */ -function getMetrics(&$dbh,&$args,&$gui) { - $metricsMgr = new tlTestPlanMetrics($dbh); - - $opt = array('output' => 'array'); - $met = $metricsMgr->getNeverRunByPlatform($args->tplan_id,$args->platSet); - - $gui->notRunReport = true; - $gui->info_msg = $gui->labels['info_notrun_tc_report']; - $gui->notesAccessKey = 'summary'; - $gui->userAccessKey = 'user_id'; - - return $met; -} - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels(array('title_test_suite_name' => null,'platform' => null,'build' => null,'th_bugs_id_summary' => null, - 'title_test_case_title' => null,'version' => null, - 'testproject' => null,'generated_by_TestLink_on' => null,'testplan' => null, - 'title_execution_notes' => null, 'th_date' => null, 'th_run_by' => null, - 'assigned_to' => null,'summary' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $sty = array(); - $sty['ReportContext'] = array('font' => array('bold' => true)); - $sty['DataHeader'] = array('font' => array('bold' => true), - 'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - return $sty; -} - -/** - * - */ -function xlsStepOne($oj,$style,$lbl,$gui) { - $dummy = ''; - $lines2write = array(array($gui->title,''), - array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time())), - array($gui->report_context,'')); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0)->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet()->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} \ No newline at end of file +labels; + +$testCaseCfg = config_get('testcase_cfg'); + +// done here in order to get some config about images +$smarty = new TLSmarty(); + +$doIt = false; +$doChoice = true; + +$metrics = null; + +if ($args->doAction == 'result') { + $metrics = getMetrics($db, $args, $gui); +} + +if ($args->doAction == 'result' && ! empty($metrics)) { + + $doIt = true; + $doChoice = false; + + $tpl = $tplCfg->default_template; + + $urlSafeString = array(); + $urlSafeString['tprojectPrefix'] = urlencode($gui->tproject_info['prefix']); + $urlSafeString['basehref'] = str_replace(" ", "%20", $args->basehref); + + $out = array(); + $pathCache = $topCache = $levelCache = null; + $nameCache = initNameCache($gui); + + $odx = 0; + foreach ($metrics as &$elem) { + // do some decode work, using caches + if (! isset($pathCache[$elem['tcase_id']])) { + $du = $tcaseMgr->getPathLayered(array( + $elem['tcase_id'] + )); + $pathCache[$elem['tcase_id']] = $du[$elem['tsuite_id']]['value']; + $levelCache[$elem['tcase_id']] = $du[$elem['tsuite_id']]['level']; + $ky = current(array_keys($du)); + $topCache[$elem['tcase_id']] = $ky; + } + + // IMPORTANT NOTICE: + // + // Column ORDER IS CRITIC + // testTitle CCA-15708: RSRSR-150 + // platformName XXXX <<< ONlY is platforms have been used on + // Test plan under analisys + // + // $out[$odx]['suiteName'] = $pathCache[$exec['tcase_id']]; + $zipper = ''; + switch ($args->format) { + case FORMAT_HTML: + $out[$odx]['testTitle'] = ""; + $zipper = ''; + break; + + case FORMAT_XLS: + $out[$odx]['testTitle'] = ''; + break; + + default: + $out[$odx]['testTitle'] = ''; + $zipper = ''; + break; + } + + // See IMPORTANT NOTICE/WARNING about XLS generation + $out[$odx]['testTitle'] .= $elem['full_external_id'] . ':' . + $elem['name'] . $zipper; + + // Insert order on out is CRITIC, because order is used on buildMatrix + if ($gui->show_platforms) { + $out[$odx]['platformName'] = $nameCache['platform'][$elem['platform_id']]; + } + + $odx ++; + } + $gui->dataSet = $out; + unset($out); +} + +$gui->urlSendExcelByEmail = $args->basehref . "lib/results/neverRunByPP.php?" . + "format=" . FORMAT_XLS . "&tplan_id=$gui->tplan_id" . + "&tproject_id=$gui->tproject_id&doAction=result"; + +if ($doIt) { + switch ($args->format) { + case FORMAT_XLS: + createSpreadsheet($gui, $args, $args->getSpreadsheetBy, $cfSet); + break; + + default: + $tableOpt = array( + 'format' => $args->format, + 'show_platforms' => $gui->show_platforms + ); + + $gui->tableSet[] = buildMatrix($gui->dataSet, $args, + $gui->platformSet, $tableOpt); + break; + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); + +if ($doChoice) { + $tpl = 'neverRunByPPLauncher.tpl'; + $gui->url2call = $args->basehref . + "lib/results/neverRunByPP.php?tplan_id=$gui->tplan_id" . + "&tproject_id=$gui->tproject_id&format=$gui->format&doAction=result"; +} + +displayReport($tplCfg->template_dir . $tpl, $smarty, $args->format, + $gui->mailCfg); + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iP = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "platSet" => array( + tlInputParameter::ARRAY_INT + ), + "doAction" => array( + tlInputParameter::STRING_N, + 5, + 10 + ) + ); + + $args = new stdClass(); + R_PARAMS($iP, $args); + + $cx = 'sendSpreadSheetByMail_x'; + $args->getSpreadsheetBy = isset($_REQUEST[$cx]) ? 'email' : null; + if (is_null($args->getSpreadsheetBy)) { + $cx = 'exportSpreadSheet_x'; + $args->getSpreadsheetBy = isset($_REQUEST[$cx]) ? 'download' : null; + } + + $args->addOpAccess = true; + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + $args->user = $_SESSION['currentUser']; + $args->basehref = $_SESSION['basehref']; + + return $args; +} + +/** + * initializeGui + * + * @param database $dbh + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return stdClass + */ +function initializeGui(&$dbh, &$argsObj, &$tplanMgr) +{ + $tprojectMgr = new testproject($dbh); + + $guiObj = new stdClass(); + + $guiObj->labels = init_labels( + array( + 'deleted_user' => null, + 'design' => null, + 'execution' => null, + 'nobody' => null, + 'execution_history' => null, + 'info_notrun_tc_report' => null, + 'title' => 'neverRunByPP_title' + )); + + $guiObj->title = $guiObj->labels['title']; + $guiObj->pageTitle = $guiObj->title; + $guiObj->report_context = ''; + $guiObj->info_msg = ''; + + $guiObj->tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->tproject_info = $tprojectMgr->get_by_id($argsObj->tproject_id); + $guiObj->tplan_name = $guiObj->tplan_info['name']; + $guiObj->tproject_name = $guiObj->tproject_info['name']; + + $guiObj->format = $argsObj->format; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->apikey = $argsObj->apikey; + + $guiObj->dataSet = null; + $guiObj->type = $argsObj->type; + $guiObj->warning_msg = ''; + + // needed to decode + $getOpt = array( + 'outputFormat' => 'map', + 'addIfNull' => true + ); + $guiObj->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, $getOpt); + + $guiObj->show_platforms = true; + $pqy = count($guiObj->platformSet); + if ($pqy == 0 || ($pqy == 1) && isset($guiObj->platformSet[0])) { + $guiObj->show_platforms = false; + } + + // will be used when sending mail o creating spreadsheet + $guiObj->platSet = array(); + if (! empty($argsObj->platSet)) { + $pp = (array) array_flip($argsObj->platSet); + } + if (! isset($pp[0])) { + // we have platforms + foreach ($argsObj->platSet as $pk) { + $guiObj->platSet[$pk] = $pk; + } + } + + $guiObj->mailCfg = buildMailCfg($guiObj); + + return $guiObj; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * Builds ext-js rich table to display matrix results + * + * @param array $dataSet + * data to be displayed on matrix + * @param stdClass $args + * @param array $options + * @param array $platforms + * @param array $customFieldColumns + * @return tlExtTable|tlHTMLTable + */ +function buildMatrix($dataSet, &$args, $platforms, $options = array()) +{ + $default_options = array( + 'show_platforms' => false, + 'format' => FORMAT_HTML + ); + $options = array_merge($default_options, $options); + + $l18n = init_labels(array( + 'platform' => null + )); + $columns = array(); + $columns[] = array( + 'title_key' => 'title_test_case_title', + 'width' => 80, + 'type' => 'text' + ); + + if ($options['show_platforms']) { + $columns[] = array( + 'title_key' => 'platform', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $platforms + ); + } + + if ($options['format'] == FORMAT_HTML) { + + // IMPORTANT DEVELOPMENT NOTICE + // columns and dataSet are deeply related this means that inside + // dataSet order has to be identical that on columns or table will be a disaster + // + $matrix = new tlExtTable($columns, $dataSet, + 'tl_table_results_by_status'); + + // if not run report: sort by test suite + // blocked, failed report: sort by platform (if enabled) else sort by date + $sort_name = 0; + $sort_name = $options['show_platforms'] ? $l18n['platform'] : ''; + + $matrix->setSortByColumnName($sort_name); + $matrix->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + // define table toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + } else { + $matrix = new tlHTMLTable($columns, $dataSet, + 'tl_table_results_by_status'); + } + return $matrix; +} + +/** + * + * @param stdClass $guiObj + * @return NULL[]|string + */ +function initNameCache($guiObj) +{ + $safeItems = array( + 'platform' => null + ); + + if ($guiObj->show_platforms) { + foreach ($guiObj->platformSet as $id => $name) { + $safeItems['platform'][$id] = htmlspecialchars($name); + } + } + + return $safeItems; +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + * @param string $media + */ +function createSpreadsheet($gui, $args, $media) +{ + $lbl = initLblSpreadsheet(); + $cellRange = range('A', 'Z'); + $style = initStyleSpreadsheet(); + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + // Step 2 + // data is organized with following columns$dataHeader[] + // Test case + // [Platform] + // + // This is HOW gui->dataSet is organized + // THIS IS CRITIC ?? + // + // testTitle PTRJ-76:Create issue tracker - no conflict + // [platformName] + // + $dataHeader = array( + $lbl['title_test_case_title'] + ); + if (property_exists($gui, 'platformSet') && ! is_null($gui->platformSet) && + ! isset($gui->platformSet[0])) { + $dataHeader[] = $lbl['platform']; + } + + $startingRow = count($lines2write) + 2; + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + // Now process data + $startingRow ++; + $qta_loops = count($gui->dataSet); + for ($idx = 0; $idx < $qta_loops; $idx ++) { + $line2write = $gui->dataSet[$idx]; + $colCounter = 0; + foreach ($line2write as $field) { + $cellID = $cellRange[$colCounter] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + html_entity_decode($field)); + $colCounter ++; + } + $startingRow ++; + } + + // Final step + $objPHPExcel->setActiveSheetIndex(0); + + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + + $codex = 'neverRunByPP'; + $tmpfname = tempnam(config_get('temp_dir'), "$codex.tmp"); + $objWriter->save($tmpfname); + + if ($args->getSpreadsheetBy == 'email') { + require_once 'email_api.php'; + + $ema = new stdClass(); + $ema->from_address = config_get('from_email'); + $ema->to_address = $args->user->emailAddress; + $ema->subject = $gui->mailCfg->subject; + $ema->message = $gui->mailCfg->subject; + + $dum = uniqid("$codex_") . '.xls'; + $oops = array( + 'attachment' => array( + 'file' => $tmpfname, + 'newname' => $dum + ), + 'exit_on_error' => true, + 'htmlFormat' => true + ); + $email_op = email_send_wrapper($ema, $oops); + unlink($tmpfname); + exit(); + } else { + downloadXls($tmpfname, $xlsType, $gui, "$codex_"); + } +} + +/** + * + * @param database $dbh + * @param stdClass $args + * @param stdClass $gui + * @return array + */ +function getMetrics(&$dbh, &$args, &$gui) +{ + $metricsMgr = new tlTestPlanMetrics($dbh); + + $met = $metricsMgr->getNeverRunByPlatform($args->tplan_id, $args->platSet); + + $gui->notRunReport = true; + $gui->info_msg = $gui->labels['info_notrun_tc_report']; + $gui->notesAccessKey = 'summary'; + $gui->userAccessKey = 'user_id'; + + return $met; +} + +/** + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'title_test_suite_name' => null, + 'platform' => null, + 'build' => null, + 'th_bugs_id_summary' => null, + 'title_test_case_title' => null, + 'version' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'testplan' => null, + 'title_execution_notes' => null, + 'th_date' => null, + 'th_run_by' => null, + 'assigned_to' => null, + 'summary' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $sty = array(); + $sty['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $sty['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + return $sty; +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne($oj, $style, $lbl, $gui) +{ + $dummy = ''; + $lines2write = array( + array( + $gui->title, + '' + ), + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ), + array( + $gui->report_context, + '' + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} diff --git a/lib/results/overallPieChart.php b/lib/results/overallPieChart.php index d9fa294601..789d1eb3a3 100644 --- a/lib/results/overallPieChart.php +++ b/lib/results/overallPieChart.php @@ -1,135 +1,141 @@ -getExecCountersByExecStatus($args->tplan_id); -unset($totals['total']); - -$values = array(); -$labels = array(); -foreach($totals as $key => $value) -{ - $values[] = $value; - $labels[] = lang_get($resultsCfg['status_label'][$key]) . " ($value)"; - if( isset($resultsCfg['charts']['status_colour'][$key]) ) - { - $series_color[] = $resultsCfg['charts']['status_colour'][$key]; - } +getExecCountersByExecStatus($args->tplan_id); +unset($totals['total']); + +$values = array(); +$labels = array(); +foreach ($totals as $key => $value) { + $values[] = $value; + $labels[] = lang_get($resultsCfg['status_label'][$key]) . " ($value)"; + if (isset($resultsCfg['charts']['status_colour'][$key])) { + $series_color[] = $resultsCfg['charts']['status_colour'][$key]; + } +} + +// Dataset definition +$DataSet = new pData(); +$DataSet->AddPoint($values, "Serie1"); +$DataSet->AddPoint($labels, "Serie8"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie8"); + +// Initialise the graph +$pChartCfg = new stdClass(); +$pChartCfg->XSize = $chart_cfg['XSize'] + 200; +$pChartCfg->YSize = $chart_cfg['YSize']; +$pChartCfg->radius = $chart_cfg['radius']; +$pChartCfg->legendX = $chart_cfg['legendX']; +$pChartCfg->legendY = $chart_cfg['legendY']; + +$pChartCfg->centerX = intval($pChartCfg->XSize / 2); +$pChartCfg->centerY = intval($pChartCfg->YSize / 2); + +$graph = new stdClass(); +$graph->data = $DataSet->GetData(); +$graph->description = $DataSet->GetDataDescription(); + +$Test = new pChart($pChartCfg->XSize, $pChartCfg->YSize); +foreach ($series_color as $key => $hexrgb) { + $rgb = str_split($hexrgb, 2); + $Test->setColorPalette($key, hexdec($rgb[0]), hexdec($rgb[1]), + hexdec($rgb[2])); +} + +// Draw the pie chart +$Test->setFontProperties(config_get('charts_font_path'), + config_get('charts_font_size')); +$Test->AntialiasQuality = 0; +$Test->drawBasicPieGraph($graph->data, $graph->description, $pChartCfg->centerX, + $pChartCfg->centerY, $pChartCfg->radius, PIE_PERCENTAGE, 255, 255, 218); +$Test->drawPieLegend($pChartCfg->legendX, $pChartCfg->legendY, $graph->data, + $graph->description, 250, 250, 250); +$Test->Stroke(); + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + return $args; } - -// Dataset definition -$DataSet = new pData; -$DataSet->AddPoint($values,"Serie1"); -$DataSet->AddPoint($labels,"Serie8"); -$DataSet->AddAllSeries(); -$DataSet->SetAbsciseLabelSerie("Serie8"); - -// Initialise the graph -$pChartCfg = new stdClass(); -$pChartCfg->XSize = $chart_cfg['XSize']; -$pChartCfg->YSize = $chart_cfg['YSize']; -$pChartCfg->radius = $chart_cfg['radius']; -$pChartCfg->legendX = $chart_cfg['legendX']; -$pChartCfg->legendY = $chart_cfg['legendY']; - -$pChartCfg->centerX = intval($pChartCfg->XSize/2); -$pChartCfg->centerY = intval($pChartCfg->YSize/2); - - -$graph = new stdClass(); -$graph->data = $DataSet->GetData(); -$graph->description = $DataSet->GetDataDescription(); - -$Test = new pChart($pChartCfg->XSize,$pChartCfg->YSize); -foreach($series_color as $key => $hexrgb) -{ - $rgb = str_split($hexrgb,2); - $Test->setColorPalette($key,hexdec($rgb[0]),hexdec($rgb[1]),hexdec($rgb[2])); -} - -// Draw the pie chart -$Test->setFontProperties(config_get('charts_font_path'),config_get('charts_font_size')); -$Test->AntialiasQuality = 0; -$Test->drawBasicPieGraph($graph->data,$graph->description, - $pChartCfg->centerX,$pChartCfg->centerY,$pChartCfg->radius,PIE_PERCENTAGE,255,255,218); -$Test->drawPieLegend($pChartCfg->legendX,$pChartCfg->legendY,$graph->data,$graph->description,250,250,250); -$Test->Stroke(); - - -/** - * - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} - - -/** - * - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,0,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,true,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - return $args; -} \ No newline at end of file diff --git a/lib/results/platformPieChart.php b/lib/results/platformPieChart.php index 4d1975e096..b557d34766 100644 --- a/lib/results/platformPieChart.php +++ b/lib/results/platformPieChart.php @@ -1,154 +1,161 @@ -getStatusTotalsByPlatformForRender($args->tplan_id); - -// if platform has no test case assigned $dummy->info[$args->platform_id] does not exists -if( isset($dummy->info[$args->platform_id]) ) -{ - $totals = $dummy->info[$args->platform_id]['details']; +getStatusTotalsByPlatformForRender($args->tplan_id); + +// if platform has no test case assigned $dummy->info[$args->platform_id] does not exists +if (isset($dummy->info[$args->platform_id])) { + $totals = $dummy->info[$args->platform_id]['details']; +} else { + // create empty set + $status = $metricsMgr->getStatusForReports(); + foreach ($status as $statusVerbose) { + $totals[$statusVerbose] = array( + 'qty' => 0, + 'percentage' => 0 + ); + } + unset($status); +} + +unset($dummy); +unset($metricsMgr); + +$values = array(); +$labels = array(); +$series_color = array(); +foreach ($totals as $key => $value) { + $value = $value['qty']; + $values[] = $value; + $labels[] = lang_get($resultsCfg['status_label'][$key]) . " ($value)"; + if (isset($resultsCfg['charts']['status_colour'][$key])) { + $series_color[] = $resultsCfg['charts']['status_colour'][$key]; + } +} + +// Dataset definition +$DataSet = new pData(); +$DataSet->AddPoint($values, "Serie1"); +$DataSet->AddPoint($labels, "Serie8"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie8"); + +// Initialise the graph +$pChartCfg = new stdClass(); +$pChartCfg->XSize = $chart_cfg['XSize'] + 200; +$pChartCfg->YSize = $chart_cfg['YSize']; +$pChartCfg->radius = $chart_cfg['radius']; +$pChartCfg->legendX = $chart_cfg['legendX']; +$pChartCfg->legendY = $chart_cfg['legendY']; + +$pChartCfg->centerX = intval($pChartCfg->XSize / 2); +$pChartCfg->centerY = intval($pChartCfg->YSize / 2); + +$graph = new stdClass(); +$graph->data = $DataSet->GetData(); +$graph->description = $DataSet->GetDataDescription(); + +$Test = new pChart($pChartCfg->XSize, $pChartCfg->YSize); +foreach ($series_color as $key => $hexrgb) { + $rgb = str_split($hexrgb, 2); + $Test->setColorPalette($key, hexdec($rgb[0]), hexdec($rgb[1]), + hexdec($rgb[2])); +} + +// Draw the pie chart +$Test->setFontProperties(config_get('charts_font_path'), + config_get('charts_font_size')); +$Test->AntialiasQuality = 0; +$Test->drawBasicPieGraph($graph->data, $graph->description, $pChartCfg->centerX, + $pChartCfg->centerY, $pChartCfg->radius, PIE_PERCENTAGE, 255, 255, 218); +$Test->drawPieLegend($pChartCfg->legendX, $pChartCfg->legendY, $graph->data, + $graph->description, 250, 250, 250); +$Test->Stroke(); + +/** + * + * @param database $db + * @param tlUser $user + * @return unknown + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "platform_id" => array( + tlInputParameter::INT_N + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + return $args; } -else -{ - // create empty set - $status = $metricsMgr->getStatusForReports(); - foreach($status as $statusVerbose) - { - $totals[$statusVerbose] = array('qty' => 0, 'percentage' => 0); - } - unset($status); -} - -unset($dummy); -unset($metricsMgr); - -$values = array(); -$labels = array(); -$series_color = array(); -foreach($totals as $key => $value) -{ - $value = $value['qty']; - $values[] = $value; - $labels[] = lang_get($resultsCfg['status_label'][$key]) . " ($value)"; - if( isset($resultsCfg['charts']['status_colour'][$key]) ) - { - $series_color[] = $resultsCfg['charts']['status_colour'][$key]; - } -} - -// Dataset definition -$DataSet = new pData; -$DataSet->AddPoint($values,"Serie1"); -$DataSet->AddPoint($labels,"Serie8"); -$DataSet->AddAllSeries(); -$DataSet->SetAbsciseLabelSerie("Serie8"); - -// Initialise the graph -$pChartCfg = new stdClass(); -$pChartCfg->XSize = $chart_cfg['XSize']; -$pChartCfg->YSize = $chart_cfg['YSize']; -$pChartCfg->radius = $chart_cfg['radius']; -$pChartCfg->legendX = $chart_cfg['legendX']; -$pChartCfg->legendY = $chart_cfg['legendY']; - -$pChartCfg->centerX = intval($pChartCfg->XSize/2); -$pChartCfg->centerY = intval($pChartCfg->YSize/2); - -$graph = new stdClass(); -$graph->data = $DataSet->GetData(); -$graph->description = $DataSet->GetDataDescription(); - -$Test = new pChart($pChartCfg->XSize,$pChartCfg->YSize); -foreach($series_color as $key => $hexrgb) -{ - $rgb = str_split($hexrgb,2); - $Test->setColorPalette($key,hexdec($rgb[0]),hexdec($rgb[1]),hexdec($rgb[2])); -} - -// Draw the pie chart -$Test->setFontProperties(config_get('charts_font_path'),config_get('charts_font_size')); -$Test->AntialiasQuality = 0; -$Test->drawBasicPieGraph($graph->data,$graph->description, - $pChartCfg->centerX,$pChartCfg->centerY,$pChartCfg->radius,PIE_PERCENTAGE,255,255,218); -$Test->drawPieLegend($pChartCfg->legendX,$pChartCfg->legendY,$graph->data,$graph->description,250,250,250); -$Test->Stroke(); - - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} - - -/** - * - * - */ -function init_args(&$dbHandler) -{ - // $_REQUEST = strings_stripSlashes($_REQUEST); - // $args = new stdClass(); - // $args->tplan_id = $_REQUEST['tplan_id']; - // $args->tproject_id = $_SESSION['testprojectID']; - // $args->platform_id = $_REQUEST['platform_id']; - $iParams = array("apikey" => array(tlInputParameter::STRING_N,0,64), - "platform_id" => array(tlInputParameter::INT_N), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,true,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - - return $args; -} \ No newline at end of file diff --git a/lib/results/printDocOptions.php b/lib/results/printDocOptions.php index d2e80afcc3..cd50a3edcc 100644 --- a/lib/results/printDocOptions.php +++ b/lib/results/printDocOptions.php @@ -1,354 +1,373 @@ -doc_type) { - case DOC_TEST_SPEC: - case DOC_REQ_SPEC: - $gui->buildInfoSet = null; - break; - - case DOC_TEST_PLAN_DESIGN: - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $tplan_mgr = new testplan($db); - $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - $testplan_name = htmlspecialchars($tplan_info['name']); - - // 20131201 - do we really need this ? - // $filters = new stdClass(); - // $filters->build_id = $tplan_mgr->get_max_build_id($args->tplan_id); - $gui->buildInfoSet = null; - if( $args->doc_type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { - $gui->buildInfoSet = $tplan_mgr->get_builds($args->tplan_id); - - if( null != $gui->buildInfoSet ) { - $gui->buildRptLinkSet = array(); - $dl = $args->basehref . - "lnl.php?apikey=" . $args->tplan_info['api_key'] . - "&tproject_id=$args->tproject_id" . - "&tplan_id=$args->tplan_id" . - "&type=testreport_onbuild"; - - foreach( $gui->buildInfoSet as $bid => $nunu ) { - $gui->buildRptLinkSet[$bid] = $dl . "&build_id=$bid"; - } - } - } - - $additionalInfo = new stdClass(); - $additionalInfo->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; - $additionalInfo->useColours = COLOR_BY_TC_STATUS_OFF; - - $opt_etree = new stdClass(); - $opt_etree->tc_action_enabled = 0; - $opt_etree->allow_empty_build = 1; - $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; - $opt_etree->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; - - $opt_etree->useColours = new stdClass(); - $opt_etree->useColours->testcases = COLOR_BY_TC_STATUS_OFF; - $opt_etree->useColours->counters = COLOR_BY_TC_STATUS_OFF; - - switch($args->activity) { - case 'addTC': - $opt_etree->hideTestCases = SHOW_TESTCASES; - $opt_etree->tc_action_enabled = false; - $opt_etree->showTestCaseExecStatus = false; - $opt_etree->nodeHelpText = array(); - $opt_etree->nodeHelpText['testproject'] = lang_get('gen_test_plan_design_report'); - $opt_etree->nodeHelpText['testsuite'] = $opt_etree->nodeHelpText['testproject']; - - $opt_etree->actionJS['testproject'] = 'TPLAN_PTP'; - $opt_etree->actionJS['testsuite'] = 'TPLAN_PTS'; - break; - - default: - $opt_etree->hideTestCases = HIDE_TESTCASES; - break; - } - - $filters = null; - $treeContents = null; - list($treeContents, $testcases_to_show) = - testPlanTree($db,$rightPaneAction,$args->tproject_id, - $args->tproject_name,$args->tplan_id, - $testplan_name,$filters,$opt_etree); - - - $gui->ajaxTree = new stdClass(); - $gui->ajaxTree->cookiePrefix = "{$args->doc_type}_tplan_id_{$args->tplan_id}_"; - $gui->ajaxTree->loadFromChildren = true; - $gui->ajaxTree->root_node = $treeContents->rootnode; - $gui->ajaxTree->children = trim($treeContents->menustring); - - if($gui->ajaxTree->children == ''){ - $gui->ajaxTree->children = '{}'; // generate valid JSON - $gui->ajaxTree->root_node->href = ''; - } - break; - - default: - tLog("Argument _REQUEST['type'] has invalid value", 'ERROR'); - exit(); - break; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->assign('args', $gui->getArguments); -$smarty->assign('selFormat', $args->format); -$smarty->assign('docType', $args->doc_type); -$smarty->assign('docTestPlanId', $args->tplan_id); -$smarty->assign('menuUrl', $rightPaneAction); -$smarty->assign('additionalArgs',$additionalArgs); - -$optCfg = new printDocOptions(); -$smarty->assign('printPreferences', $optCfg->getJSPrintPreferences()); - -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * get user input and create an object with properties representing this inputs. - * @return stdClass object - */ -function init_args(&$dbHandler) { - $args = new stdClass(); - $iParams = array("tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N,999), - "type" => array(tlInputParameter::STRING_N,0,100), - "activity" => array(tlInputParameter::STRING_N,1,10)); - - $l18n = array(); - $l18n['addTC'] = lang_get('navigator_add_remove_tcase_to_tplan'); - $l18n['test_plan'] = lang_get('test_plan'); - - - R_PARAMS($iParams,$args); - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0); - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - $args->basehref = $_SESSION['basehref']; - $args->testprojectOptReqs = $_SESSION['testprojectOptions']->requirementsEnabled; - - - $args->format = is_null($args->format) ? FORMAT_HTML : $args->format; - $args->type = is_null($args->type) ? DOC_TEST_PLAN_DESIGN : $args->type; - $args->doc_type = $args->type; - - // Changes to call this page also in add/remove test cases feature - $args->showOptions = true; - $args->showHelpIcon = true; - $args->tplan_info = null; - $args->mainTitle = ''; - - if( ($args->tplan_id = intval($args->tplan_id)) <= 0 || $args->activity != '') { - $args->showOptions = false; - $args->showHelpIcon = false; - $args->tplan_id = intval(isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : 0); - - } - - if($args->tplan_id > 0) { - $tplan_mgr = new testplan($dbHandler); - $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - $args->mainTitle = $l18n['test_plan'] . ': ' . $args->tplan_info['name']; - } - - return $args; -} - - -/** - * Initialize gui (stdClass) object that will be used as argument - * in call to Template Engine. - * - * @param class pointer args: object containing User Input and some session values - * TBD structure - * - * ? tprojectMgr: test project manager object. - * ? treeDragDropEnabled: true/false. Controls Tree drag and drop behaivor. - * - * @return stdClass TBD structure - */ -function initializeGui(&$db,$args) { - $tcaseCfg = config_get('testcase_cfg'); - $reqCfg = config_get('req_cfg'); - - $gui = new stdClass(); - $gui->showOptionsCheckBoxes = $gui->showOptions = $args->showOptions; - - $gui->showHelpIcon = $args->showHelpIcon; - - $gui->mainTitle = ''; - $gui->outputFormat = array(FORMAT_HTML => lang_get('format_html'), - FORMAT_MSWORD => lang_get('format_pseudo_msword')); - - $gui->outputOptions = init_checkboxes($args); - if($gui->showOptions == false) { - $loop2do = count($gui->outputOptions); - for($idx = 0; $idx < $loop2do; $idx++) { - $gui->outputOptions[$idx]['checked'] = 'y'; - } - } - - $tprojectMgr = new testproject($db); - $tcasePrefix = $tprojectMgr->getTestCasePrefix($args->tproject_id); - - $gui->tree_title = ''; - $gui->ajaxTree = new stdClass(); - $gui->ajaxTree->root_node = new stdClass(); - $gui->ajaxTree->dragDrop = new stdClass(); - $gui->ajaxTree->dragDrop->enabled = false; - $gui->ajaxTree->dragDrop->BackEndUrl = null; - $gui->ajaxTree->children = ''; - - // improved cookie prefix for test spec doc and req spec doc - $gui->ajaxTree->cookiePrefix = $args->doc_type . '_doc_'; - $gui->doc_type = $args->doc_type; - - $addTestPlanID = false; - switch($args->doc_type) { - case DOC_REQ_SPEC: - $gui->showOptions = true; - $gui->showOptionsCheckBoxes = false; - $gui->tree_title = lang_get('title_req_print_navigator'); - $gui->ajaxTree->loader = $args->basehref . 'lib/ajax/getrequirementnodes.php?' . - "root_node={$args->tproject_id}&show_children=0&operation=print"; - - $gui->ajaxTree->loadFromChildren = 0; - $gui->ajaxTree->root_node->href = "javascript:TPROJECT_PTP_RS({$args->tproject_id})"; - $gui->ajaxTree->root_node->id = $args->tproject_id; - - $req_qty = $tprojectMgr->count_all_requirements($args->tproject_id); - $gui->ajaxTree->root_node->name = htmlspecialchars($args->tproject_name) . " ($req_qty)"; - $gui->ajaxTree->cookiePrefix .= "tproject_id_" . $gui->ajaxTree->root_node->id . "_" ; - $gui->mainTitle = lang_get('requirement_specification_report'); - break; - - case DOC_TEST_SPEC: - $gui->tree_title = lang_get('title_tc_print_navigator'); - $gui->ajaxTree->loader = $args->basehref . 'lib/ajax/gettprojectnodes.php?' . - "root_node={$args->tproject_id}&" . - "show_tcases=0&operation=print&" . - "tcprefix=". urlencode($tcasePrefix.$tcaseCfg->glue_character) ."}"; - - $gui->ajaxTree->loadFromChildren = 0; - $gui->ajaxTree->root_node->href = "javascript:TPROJECT_PTP({$args->tproject_id})"; - $gui->ajaxTree->root_node->id = $args->tproject_id; - - $tcase_qty = $tprojectMgr->count_testcases($args->tproject_id); - $gui->ajaxTree->root_node->name = htmlspecialchars($args->tproject_name) . " ($tcase_qty)"; - $gui->ajaxTree->cookiePrefix .= "tproject_id_" . $gui->ajaxTree->root_node->id . "_" ; - $gui->mainTitle = lang_get('testspecification_report'); - break; - - case DOC_TEST_PLAN_EXECUTION: - $addTestPlanID = true; - $gui->mainTitle = lang_get('test_report'); - break; - - case DOC_TEST_PLAN_DESIGN: - $addTestPlanID = true; - $gui->tree_title = lang_get('title_tp_print_navigator'); - $gui->ajaxTree->loadFromChildren = 1; - $gui->ajaxTree->loader = ''; - $gui->mainTitle = lang_get('report_test_plan_design'); - break; - - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $addTestPlanID = true; - $gui->mainTitle = lang_get('test_report_on_build'); - break; - - } - - // Do not move - if($args->mainTitle == '') { - $gui->mainTitle .= ' - ' . lang_get('doc_opt_title'); - } else { - $gui->mainTitle = $args->mainTitle; - } - - $gui->getArguments = "&type=" . $args->doc_type; - if ($addTestPlanID) { - $gui->getArguments .= '&docTestPlanId=' . $args->tplan_id; - } - return $gui; -} - -/** - * Initializes the checkbox options. - * Made this a function to simplify handling of differences - * between printing for requirements and testcases and to make code more readable. - * - * ATTENTION if you add somethin here, you need also to work on javascript function - * tree_getPrintPreferences() - * - * @author Andreas Simon - * - * @param stdClass $args reference to user input parameters - * - * @return array $cbSet - */ -function init_checkboxes(&$args) { - // Important Notice: - // If you want to add or remove elements in this array, you must also update - // $printingOptions in printDocument.php and tree_getPrintPreferences() in testlink_library.js - - $execCfg = config_get('exec_cfg'); - - $optCfg = new printDocOptions(); - - // Check Box Set - $cbSet = array(); - - $cbSet += $optCfg->getDocOpt(); - switch($args->doc_type) { - case 'reqspec': - $cbSet = array_merge($cbSet,$optCfg->getReqSpecOpt()); - break; - - default: - $cbSet = array_merge($cbSet,$optCfg->getTestSpecOpt()); - break; - } - - if( $args->doc_type == DOC_TEST_PLAN_EXECUTION || - $args->doc_type == DOC_TEST_PLAN_EXECUTION_ON_BUILD ) { - $cbSet = array_merge($cbSet,$optCfg->getExecOpt()); - } - - foreach ($cbSet as $key => $elem) { - $cbSet[$key]['description'] = lang_get($elem['description']); - if( !isset($cbSet[$key]['checked']) ) { - $cbSet[$key]['checked'] = 'n'; - } - } - - return $cbSet; +doc_type) { + case DOC_TEST_SPEC: + case DOC_REQ_SPEC: + $gui->buildInfoSet = null; + break; + + case DOC_TEST_PLAN_DESIGN: + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $tplan_mgr = new testplan($db); + $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + $testplan_name = htmlspecialchars($tplan_info['name']); + + // 20131201 - do we really need this ? + // $filters = new stdClass(); + // $filters->build_id = $tplan_mgr->get_max_build_id($args->tplan_id); + $gui->buildInfoSet = null; + if ($args->doc_type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $gui->buildInfoSet = $tplan_mgr->get_builds($args->tplan_id); + + if (null != $gui->buildInfoSet) { + $gui->buildRptLinkSet = array(); + $dl = $args->basehref . "lnl.php?apikey=" . + $args->tplan_info['api_key'] . + "&tproject_id=$args->tproject_id" . + "&tplan_id=$args->tplan_id" . "&type=testreport_onbuild"; + + foreach ($gui->buildInfoSet as $bid => $nunu) { + $gui->buildRptLinkSet[$bid] = $dl . "&build_id=$bid"; + } + } + } + + $additionalInfo = new stdClass(); + $additionalInfo->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; + $additionalInfo->useColours = COLOR_BY_TC_STATUS_OFF; + + $opt_etree = new stdClass(); + $opt_etree->tc_action_enabled = 0; + $opt_etree->allow_empty_build = 1; + $opt_etree->getTreeMethod = 'getLinkedForTesterAssignmentTree'; + $opt_etree->useCounters = CREATE_TC_STATUS_COUNTERS_OFF; + + $opt_etree->useColours = new stdClass(); + $opt_etree->useColours->testcases = COLOR_BY_TC_STATUS_OFF; + $opt_etree->useColours->counters = COLOR_BY_TC_STATUS_OFF; + + switch ($args->activity) { + case 'addTC': + $opt_etree->hideTestCases = SHOW_TESTCASES; + $opt_etree->tc_action_enabled = false; + $opt_etree->showTestCaseExecStatus = false; + $opt_etree->nodeHelpText = array(); + $opt_etree->nodeHelpText['testproject'] = lang_get( + 'gen_test_plan_design_report'); + $opt_etree->nodeHelpText['testsuite'] = $opt_etree->nodeHelpText['testproject']; + + $opt_etree->actionJS['testproject'] = 'TPLAN_PTP'; + $opt_etree->actionJS['testsuite'] = 'TPLAN_PTS'; + break; + + default: + $opt_etree->hideTestCases = HIDE_TESTCASES; + break; + } + + $filters = null; + $treeContents = null; + list ($treeContents, $testcases_to_show) = testPlanTree($db, + $rightPaneAction, $args->tproject_id, $args->tproject_name, + $args->tplan_id, $testplan_name, $filters, $opt_etree); + + $gui->ajaxTree = new stdClass(); + $gui->ajaxTree->cookiePrefix = "{$args->doc_type}_tplan_id_{$args->tplan_id}_"; + $gui->ajaxTree->loadFromChildren = true; + $gui->ajaxTree->root_node = $treeContents->rootnode; + $gui->ajaxTree->children = trim($treeContents->menustring); + + if ($gui->ajaxTree->children == '') { + $gui->ajaxTree->children = '{}'; // generate valid JSON + $gui->ajaxTree->root_node->href = ''; + } + break; + + default: + tLog("Argument _REQUEST['type'] has invalid value", 'ERROR'); + exit(); + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('args', $gui->getArguments); +$smarty->assign('selFormat', $args->format); +$smarty->assign('docType', $args->doc_type); +$smarty->assign('docTestPlanId', $args->tplan_id); +$smarty->assign('menuUrl', $rightPaneAction); +$smarty->assign('additionalArgs', $additionalArgs); + +$optCfg = new printDocOptions(); +$smarty->assign('printPreferences', $optCfg->getJSPrintPreferences()); + +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get user input and create an object with properties representing this inputs. + * + * @param database $dbHandler + * @return stdClass object + */ +function initArgs(&$dbHandler) +{ + $args = new stdClass(); + $iParams = array( + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N, + 999 + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "activity" => array( + tlInputParameter::STRING_N, + 1, + 10 + ) + ); + + $l18n = array(); + $l18n['addTC'] = lang_get('navigator_add_remove_tcase_to_tplan'); + $l18n['test_plan'] = lang_get('test_plan'); + + R_PARAMS($iParams, $args); + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0); + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + $args->basehref = $_SESSION['basehref']; + $args->testprojectOptReqs = $_SESSION['testprojectOptions']->requirementsEnabled; + + $args->format = is_null($args->format) ? FORMAT_HTML : $args->format; + $args->type = is_null($args->type) ? DOC_TEST_PLAN_DESIGN : $args->type; + $args->doc_type = $args->type; + + // Changes to call this page also in add/remove test cases feature + $args->showOptions = true; + $args->showHelpIcon = true; + $args->tplan_info = null; + $args->mainTitle = ''; + + if (($args->tplan_id = intval($args->tplan_id)) <= 0 || $args->activity != '') { + $args->showOptions = false; + $args->showHelpIcon = false; + $args->tplan_id = intval( + isset($_SESSION['testplanID']) ? intval($_SESSION['testplanID']) : 0); + } + + if ($args->tplan_id > 0) { + $tplan_mgr = new testplan($dbHandler); + $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + $args->mainTitle = $l18n['test_plan'] . ': ' . $args->tplan_info['name']; + } + + return $args; +} + +/** + * Initialize gui (stdClass) object that will be used as argument + * in call to Template Engine. + * + * @param database $db + * @param stdClass $args + * object containing User Input and some session values + * TBD structure + * + * ? tprojectMgr: test project manager object. + * ? treeDragDropEnabled: true/false. Controls Tree drag and drop behaivor. + * + * @return stdClass TBD structure + */ +function initializeGui(&$db, $args) +{ + $tcaseCfg = config_get('testcase_cfg'); + + $gui = new stdClass(); + $gui->showOptionsCheckBoxes = $gui->showOptions = $args->showOptions; + + $gui->showHelpIcon = $args->showHelpIcon; + + $gui->mainTitle = ''; + $gui->outputFormat = array( + FORMAT_HTML => lang_get('format_html'), + FORMAT_MSWORD => lang_get('format_pseudo_msword') + ); + + $gui->outputOptions = init_checkboxes($args); + if (! $gui->showOptions) { + $loop2do = count($gui->outputOptions); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $gui->outputOptions[$idx]['checked'] = 'y'; + } + } + + $tprojectMgr = new testproject($db); + $tcasePrefix = $tprojectMgr->getTestCasePrefix($args->tproject_id); + + $gui->tree_title = ''; + $gui->ajaxTree = new stdClass(); + $gui->ajaxTree->root_node = new stdClass(); + $gui->ajaxTree->dragDrop = new stdClass(); + $gui->ajaxTree->dragDrop->enabled = false; + $gui->ajaxTree->dragDrop->BackEndUrl = null; + $gui->ajaxTree->children = ''; + + // improved cookie prefix for test spec doc and req spec doc + $gui->ajaxTree->cookiePrefix = $args->doc_type . '_doc_'; + $gui->doc_type = $args->doc_type; + + $addTestPlanID = false; + switch ($args->doc_type) { + case DOC_REQ_SPEC: + $gui->showOptions = true; + $gui->showOptionsCheckBoxes = false; + $gui->tree_title = lang_get('title_req_print_navigator'); + $gui->ajaxTree->loader = $args->basehref . + 'lib/ajax/getrequirementnodes.php?' . + "root_node={$args->tproject_id}&show_children=0&operation=print"; + + $gui->ajaxTree->loadFromChildren = 0; + $gui->ajaxTree->root_node->href = "javascript:TPROJECT_PTP_RS({$args->tproject_id})"; + $gui->ajaxTree->root_node->id = $args->tproject_id; + + $req_qty = $tprojectMgr->count_all_requirements($args->tproject_id); + $gui->ajaxTree->root_node->name = htmlspecialchars( + $args->tproject_name) . " ($req_qty)"; + $gui->ajaxTree->cookiePrefix .= "tproject_id_" . + $gui->ajaxTree->root_node->id . "_"; + $gui->mainTitle = lang_get('requirement_specification_report'); + break; + + case DOC_TEST_SPEC: + $gui->tree_title = lang_get('title_tc_print_navigator'); + $gui->ajaxTree->loader = $args->basehref . + 'lib/ajax/gettprojectnodes.php?' . + "root_node={$args->tproject_id}&" . + "show_tcases=0&operation=print&" . "tcprefix=" . + urlencode($tcasePrefix . $tcaseCfg->glue_character) . "}"; + + $gui->ajaxTree->loadFromChildren = 0; + $gui->ajaxTree->root_node->href = "javascript:TPROJECT_PTP({$args->tproject_id})"; + $gui->ajaxTree->root_node->id = $args->tproject_id; + + $tcase_qty = $tprojectMgr->count_testcases($args->tproject_id); + $gui->ajaxTree->root_node->name = htmlspecialchars( + $args->tproject_name) . " ($tcase_qty)"; + $gui->ajaxTree->cookiePrefix .= "tproject_id_" . + $gui->ajaxTree->root_node->id . "_"; + $gui->mainTitle = lang_get('testspecification_report'); + break; + + case DOC_TEST_PLAN_EXECUTION: + $addTestPlanID = true; + $gui->mainTitle = lang_get('test_report'); + break; + + case DOC_TEST_PLAN_DESIGN: + $addTestPlanID = true; + $gui->tree_title = lang_get('title_tp_print_navigator'); + $gui->ajaxTree->loadFromChildren = 1; + $gui->ajaxTree->loader = ''; + $gui->mainTitle = lang_get('report_test_plan_design'); + break; + + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $addTestPlanID = true; + $gui->mainTitle = lang_get('test_report_on_build'); + break; + } + + // Do not move + if ($args->mainTitle == '') { + $gui->mainTitle .= ' - ' . lang_get('doc_opt_title'); + } else { + $gui->mainTitle = $args->mainTitle; + } + + $gui->getArguments = "&type=" . $args->doc_type; + if ($addTestPlanID) { + $gui->getArguments .= '&docTestPlanId=' . $args->tplan_id; + } + return $gui; +} + +/** + * Initializes the checkbox options. + * Made this a function to simplify handling of differences + * between printing for requirements and testcases and to make code more readable. + * + * ATTENTION if you add somethin here, you need also to work on javascript function + * tree_getPrintPreferences() + * + * @author Andreas Simon + * @param stdClass $args + * reference to user input parameters + * @return array $cbSet + */ +function init_checkboxes(&$args) +{ + // Important Notice: + // If you want to add or remove elements in this array, you must also update + // $printingOptions in printDocument.php and tree_getPrintPreferences() in testlink_library.js + $optCfg = new printDocOptions(); + + // Check Box Set + $cbSet = array(); + + $cbSet += $optCfg->getDocOpt(); + switch ($args->doc_type) { + case 'reqspec': + $cbSet = array_merge($cbSet, $optCfg->getReqSpecOpt()); + break; + + default: + $cbSet = array_merge($cbSet, $optCfg->getTestSpecOpt()); + break; + } + + if ($args->doc_type == DOC_TEST_PLAN_EXECUTION || + $args->doc_type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $cbSet = array_merge($cbSet, $optCfg->getExecOpt()); + } + + foreach ($cbSet as $key => $elem) { + $cbSet[$key]['description'] = lang_get($elem['description']); + if (! isset($cbSet[$key]['checked'])) { + $cbSet[$key]['checked'] = 'n'; + } + } + + return $cbSet; } diff --git a/lib/results/printDocument.php b/lib/results/printDocument.php index 144922e432..a99c2235e5 100644 --- a/lib/results/printDocument.php +++ b/lib/results/printDocument.php @@ -1,743 +1,838 @@ -tree_manager; -list($doc_info,$my) = initEnv($db,$args,$tproject_mgr,$args->user_id); - -$printingOptions = initPrintOpt($_REQUEST,$doc_info); - -$subtree = $tree_manager->get_subtree($args->itemID,$my['filters'],$my['options']); - -$treeForPlatform[0] = &$subtree; -$doc_info->title = $doc_info->tproject_name; -$doc_info->outputFormat = $printingOptions['outputFormat'] = $args->format; - -switch ($doc_info->type) { - case DOC_REQ_SPEC: - switch($doc_info->content_range) { - case 'reqspec': - $spec_mgr = new requirement_spec_mgr($db); - $spec = $spec_mgr->get_by_id($args->itemID); - unset($spec_mgr); - - $spec['childNodes'] = isset($subtree['childNodes']) ? $subtree['childNodes'] : null; - $spec['node_type_id'] = $decode['node_descr_id']['requirement_spec']; - - unset($treeForPlatform[0]['childNodes']); - $treeForPlatform[0]['childNodes'][0] = &$spec; - - $doc_info->title = htmlspecialchars($args->tproject_name . - $tlCfg->gui_title_separator_2 . $spec['title']); - break; - } // $doc_info->content_range - break; - - case DOC_TEST_SPEC: - $printingOptions['importance'] = $doc_info->test_priority_enabled; - - switch($doc_info->content_range) { - case 'testsuite': - $tsuite = new testsuite($db); - $tInfo = $tsuite->get_by_id($args->itemID); - $tInfo['childNodes'] = isset($subtree['childNodes']) ? $subtree['childNodes'] : null; - - $treeForPlatform[0]['childNodes'] = array($tInfo); - - $doc_info->title = htmlspecialchars(isset($tInfo['name']) ? $args->tproject_name . - $tlCfg->gui_title_separator_2.$tInfo['name'] : $args->tproject_name); - break; - } - break; - - case DOC_TEST_PLAN_DESIGN: - $printingOptions['metrics'] = true; // FORCE - - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $tplan_mgr = new testplan($db); - $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - - if($args->build_id > 0) { - $xx = $tplan_mgr->get_builds($args->tplan_id,null,null,array('buildID' => $args->build_id)); - $doc_info->build_name = htmlspecialchars($xx[$args->build_id]['name']); - $doc_info->build_notes = $xx[$args->build_id]['notes']; - } - - $doc_info->testplan_name = htmlspecialchars($tplan_info['name']); - $doc_info->testplan_scope = $tplan_info['notes']; - $doc_info->title = $doc_info->testplan_name; - - // Changed to get ALL platform attributes. - $getOpt = array('outputFormat' => 'mapAccessByID', 'addIfNull' => true); - $platforms = $tplan_mgr->getPlatforms($args->tplan_id,$getOpt); - $platformIDSet = array_keys($platforms); - - $printingOptions['priority'] = $doc_info->test_priority_enabled; - $items2use = (object) array('estimatedExecTime' => null,'realExecTime' => null); - $treeForPlatform = array(); - - $filters = null; - $ctx = new stdClass(); - $ctx->tplan_id = $args->tplan_id; - $ctx->platformIDSet = $platformIDSet; - $opx = null; - - if( $doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD ) { - $ctx->build_id = ($args->build_id > 0) ? $args->build_id : null; - - $opx = array('setAssignedTo' => false); - $ctx->with_user_assignment = $args->with_user_assignment; - if( $ctx->build_id > 0 ) { - if( $args->with_user_assignment ) { - $opx = array('setAssignedTo' => true); - } - } - } - - // var_dump($opx); die(); - - switch($doc_info->content_range) { - case 'testproject': - $treeForPlatform = buildContentForTestPlan($db,$subtree,$ctx,$decode, - $tplan_mgr,$filters,$opx); - break; - - case 'testsuite': - $ctx->branchRoot = $args->itemID; - $opx = array_merge((array)$opx,(array)$my['options']['prepareNode']); - list($treeForPlatform,$items2use) = - buildContentForTestPlanBranch($db,$subtree,$ctx,$doc_info,$decode,$tplan_mgr,$opx); - break; - } - - // Create list of execution id, that will be used to compute execution time if - // CF_EXEC_TIME custom field exists and is linked to current testproject - $doc_data->statistics = null; - if ($printingOptions['metrics']) { - $target = new stdClass(); - $target->tplan_id = $args->tplan_id; - $target->build_id = $args->build_id; - $target->platform_id = isset($args->platform_id) ? $args->platform_id : null; - $doc_data->statistics = timeStatistics($items2use,$target,$decode,$tplan_mgr); - } - break; +tree_manager; +list ($doc_info, $my) = initEnv($db, $args, $tproject_mgr, $args->user_id); + +$printingOptions = initPrintOpt($_REQUEST, $doc_info); + +$subtree = $tree_manager->get_subtree($args->itemID, $my['filters'], + $my['options']); + +$treeForPlatform[0] = &$subtree; +$doc_info->title = $doc_info->tproject_name; +$doc_info->outputFormat = $printingOptions['outputFormat'] = $args->format; + +switch ($doc_info->type) { + case DOC_REQ_SPEC: + switch ($doc_info->content_range) { + case 'reqspec': + $spec_mgr = new requirement_spec_mgr($db); + $spec = $spec_mgr->get_by_id($args->itemID); + unset($spec_mgr); + + $spec['childNodes'] = isset($subtree['childNodes']) ? $subtree['childNodes'] : null; + $spec['node_type_id'] = $decode['node_descr_id']['requirement_spec']; + + unset($treeForPlatform[0]['childNodes']); + $treeForPlatform[0]['childNodes'][0] = &$spec; + + $doc_info->title = htmlspecialchars( + $args->tproject_name . $tlCfg->gui_title_separator_2 . + $spec['title']); + break; + } + break; + + case DOC_TEST_SPEC: + $printingOptions['importance'] = $doc_info->test_priority_enabled; + + switch ($doc_info->content_range) { + case 'testsuite': + $tsuite = new testsuite($db); + $tInfo = $tsuite->get_by_id($args->itemID); + $tInfo['childNodes'] = isset($subtree['childNodes']) ? $subtree['childNodes'] : null; + + $treeForPlatform[0]['childNodes'] = array( + $tInfo + ); + + $doc_info->title = htmlspecialchars( + isset($tInfo['name']) ? $args->tproject_name . + $tlCfg->gui_title_separator_2 . $tInfo['name'] : $args->tproject_name); + break; + } + break; + + case DOC_TEST_PLAN_DESIGN: + $printingOptions['metrics'] = true; // FORCE + + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $tplan_mgr = new testplan($db); + $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + + if ($args->build_id > 0) { + $xx = $tplan_mgr->get_builds($args->tplan_id, null, null, + array( + 'buildID' => $args->build_id + )); + $doc_info->build_name = htmlspecialchars( + $xx[$args->build_id]['name']); + $doc_info->build_notes = $xx[$args->build_id]['notes']; + } + + $doc_info->testplan_name = htmlspecialchars($tplan_info['name']); + $doc_info->testplan_scope = $tplan_info['notes']; + $doc_info->title = $doc_info->testplan_name; + + // Changed to get ALL platform attributes. + $getOpt = array( + 'outputFormat' => 'mapAccessByID', + 'addIfNull' => true + ); + $platforms = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt); + $platformIDSet = array_keys($platforms); + + $printingOptions['priority'] = $doc_info->test_priority_enabled; + $items2use = (object) array( + 'estimatedExecTime' => null, + 'realExecTime' => null + ); + $treeForPlatform = array(); + + $filters = null; + $ctx = new stdClass(); + $ctx->tplan_id = $args->tplan_id; + $ctx->platformIDSet = $platformIDSet; + $opx = null; + + if ($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $ctx->build_id = ($args->build_id > 0) ? $args->build_id : null; + + $opx = array( + 'setAssignedTo' => false + ); + $ctx->with_user_assignment = $args->with_user_assignment; + if ($ctx->build_id > 0 && $args->with_user_assignment) { + $opx = array( + 'setAssignedTo' => true + ); + } + } + + switch ($doc_info->content_range) { + case 'testproject': + $treeForPlatform = buildContentForTestPlan($db, $subtree, $ctx, + $tplan_mgr, $filters, $opx); + break; + + case 'testsuite': + $ctx->branchRoot = $args->itemID; + $opx = array_merge((array) $opx, + (array) $my['options']['prepareNode']); + list ($treeForPlatform, $items2use) = buildContentForTestPlanBranch( + $db, $subtree, $ctx, $doc_info, $decode, $tplan_mgr, $opx); + break; + } + + // Create list of execution id, that will be used to compute execution time if + // CF_EXEC_TIME custom field exists and is linked to current testproject + $doc_data->statistics = null; + if ($printingOptions['metrics']) { + $target = new stdClass(); + $target->tplan_id = $args->tplan_id; + $target->build_id = $args->build_id; + $target->platform_id = isset($args->platform_id) ? $args->platform_id : null; + $doc_data->statistics = timeStatistics($items2use, $target, $decode, + $tplan_mgr); + } + break; +} + +// ----- rendering logic ----- +$topText = renderHTMLHeader($doc_info->type . ' ' . $doc_info->title, + $_SESSION['basehref'], $doc_info->type); +$topText .= renderFirstPage($doc_info); + +// Init table of content (TOC) data +renderTOC($printingOptions); // @TODO check if is really useful + +$tocPrefix = null; +if ($showPlatforms = ! isset($treeForPlatform[0]) ? true : false) { + $tocPrefix = 0; +} + +if ($treeForPlatform) { + // Things that have to be printed just once + switch ($doc_info->type) { + case DOC_TEST_PLAN_DESIGN: + $printingOptions['metrics'] = true; // FORCED + + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $docText .= renderTestProjectItem($doc_info); + $docText .= renderTestPlanItem($doc_info); + + if ($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $docText .= renderBuildItem($doc_info); + } + + $cfieldFormatting = array( + 'table_css_style' => 'class="cf"' + ); + if ($printingOptions['cfields']) { + $cfields = $tplan_mgr->html_table_of_custom_field_values( + $args->tplan_id, 'design', null, $cfieldFormatting); + $docText .= '

    ' . $cfields . '

    '; + } + break; + } + + $actionContext = (array) $args; + foreach ($treeForPlatform as $platform_id => $tree2work) { + $actionContext['platform_id'] = $platform_id; + + if (isset($tree2work['childNodes']) && + count($tree2work['childNodes']) > 0) { + $tree2work['name'] = $args->tproject_name; + $tree2work['id'] = $args->tproject_id; + $tree2work['node_type_id'] = $decode['node_descr_id']['testproject']; + switch ($doc_info->type) { + case DOC_REQ_SPEC: + $docText .= renderReqSpecTreeForPrinting($db, $tree2work, + $printingOptions, null, 0, 1, $args->user_id, 0, + $args->tproject_id); + break; + + case DOC_TEST_SPEC: + $docText .= renderSimpleChapter(lang_get('scope'), + $doc_info->tproject_scope); + + $env = new stdClass(); + $env->base_href = $_SESSION['basehref']; + $env->item_type = $doc_info->content_range; + $env->tocPrefix = null; + $env->tocCounter = 0; + $env->user_id = $args->user_id; + $env->reportType = $doc_info->type; + + // force hidding of execution related info + $printingOptions['passfail'] = false; + $printingOptions['step_exec_notes'] = false; + $printingOptions['step_exec_status'] = false; + + $actionContext['level'] = 0; + $indentLevelStart = 1; + $docText .= renderTestSpecTreeForPrinting($db, $tree2work, + $printingOptions, $env, $actionContext, $env->tocPrefix, + $indentLevelStart); + break; + + case DOC_TEST_PLAN_DESIGN: + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + + $tocPrefix ++; + $env = new stdClass(); + $env->base_href = $_SESSION['basehref']; + $env->item_type = $doc_info->content_range; + $env->tocPrefix = $tocPrefix; + $env->user_id = $args->user_id; + $env->testCounter = 1; + $env->reportType = $doc_info->type; + + if ($showPlatforms) { + $printingOptions['showPlatformNotes'] = true; + $docText .= renderPlatformHeading($tocPrefix, + $platforms[$platform_id], $printingOptions); + } + + $actionContext['level'] = 0; + $docText .= renderTestPlanForPrinting($db, $tree2work, + $printingOptions, $env, $actionContext); + + if ($printingOptions['metrics']) { + $docText .= buildTestPlanMetrics($doc_data->statistics, + $platform_id); + } + break; + } + } + } +} +$docText .= renderEOF(); + +// Needed for platform feature +if ($printingOptions['toc']) { + $printingOptions['tocCode'] .= '
    '; + $topText .= $printingOptions['tocCode']; +} +$docText = $topText . $docText; + +// add application header to HTTP +if (($args->format == FORMAT_ODT) || ($args->format == FORMAT_MSWORD)) { + flushHttpHeader($args->format, $doc_info->type); +} + +// send out the data +echo $docText; + +/** + * Process input data + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "build_id" => array( + tlInputParameter::INT_N + ), + "docTestPlanId" => array( + tlInputParameter::INT_N + ), + "id" => array( + tlInputParameter::INT_N + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "format" => array( + tlInputParameter::INT_N + ), + "level" => array( + tlInputParameter::STRING_N, + 0, + 32 + ), + "with_user_assignment" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + // really UGLY HACK + $typeDomain = array( + 'test_plan' => 'testplan', + 'test_report' => 'testreport' + ); + $args->type = isset($typeDomain[$args->type]) ? $typeDomain[$args->type] : $args->type; + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + $args->itemID = $args->tproject_id; + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tplan_id = isset($_REQUEST['docTestPlanId']) ? intval( + $_REQUEST['docTestPlanId']) : 0; + $args->itemID = $args->id; + } + + $tproject_mgr = new testproject($dbHandler); + + if ($args->tproject_id > 0) { + $dummy = $tproject_mgr->get_by_id($args->tproject_id); + $args->tproject_name = $dummy['name']; + } else { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + $args->doc_type = $args->type; + $args->user_id = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : null; + + $resultsCfg = config_get('results'); + $dcd = array(); + $dcd['node_descr_id'] = $tproject_mgr->tree_manager->get_available_node_types(); + $dcd['node_id_descr'] = array_flip($dcd['node_descr_id']); + + $dcd['status_descr_code'] = $resultsCfg['status_code']; + $dcd['status_code_descr'] = array_flip($dcd['status_descr_code']); + + return array( + $args, + $tproject_mgr, + $dcd + ); +} + +/** + * + * @uses init_checkboxes() - printDocOptions.php + * + */ +function initPrintOpt(&$uiHash, &$docInfo) +{ + $optObj = new printDocOptions(); + $pOpt = $optObj->getAllOptVars(); + + $lightOn = isset($uiHash['allOptionsOn']); + foreach ($pOpt as $opt => $val) { + $pOpt[$opt] = $lightOn || + (isset($uiHash[$opt]) && ($uiHash[$opt] == 'y')); + } + $pOpt['docType'] = $docInfo->type; + $pOpt['tocCode'] = ''; // to avoid warning because of undefined index + + return $pOpt; +} + +/** + */ +function getDecode(&$treeMgr) +{ + $resultsCfg = config_get('results'); + + $dcd = array(); + $dcd['node_descr_id'] = $treeMgr->get_available_node_types(); + $dcd['node_id_descr'] = array_flip($dcd['node_descr_id']); + + $dcd['status_descr_code'] = $resultsCfg['status_code']; + $dcd['status_code_descr'] = array_flip($dcd['status_descr_code']); + + return $dcd; +} + +/** + * + * @internal revisions: + * + */ +function initEnv(&$dbHandler, &$argsObj, &$tprojectMgr, $userID) +{ + $my = array(); + $doc = new stdClass(); + + $my['options'] = array( + 'recursive' => true, + 'prepareNode' => null, + 'order_cfg' => array( + "type" => 'spec_order' + ) + ); + $my['filters'] = array( + 'exclude_node_types' => array( + 'testplan' => 'exclude me', + 'requirement_spec' => 'exclude me', + 'requirement' => 'exclude me' + ), + 'exclude_children_of' => array( + 'testcase' => 'exclude my children', + 'requirement_spec' => 'exclude my children' + ) + ); + + $lblKey = array( + DOC_TEST_SPEC => 'title_test_spec', + DOC_TEST_PLAN_DESIGN => 'report_test_plan_design', + DOC_TEST_PLAN_EXECUTION => 'report_test_plan_execution', + DOC_TEST_PLAN_EXECUTION_ON_BUILD => 'report_test_plan_execution_on_build', + DOC_REQ_SPEC => 'req_spec' + ); + + $doc->content_range = $argsObj->level; + $doc->type = $argsObj->doc_type; + $doc->type_name = lang_get($lblKey[$doc->type]); + $doc->additional_info = $argsObj->with_user_assignment ? lang_get( + 'only_test_cases_wta') : ''; + $doc->author = ''; + $doc->title = ''; + + switch ($doc->type) { + case DOC_TEST_PLAN_DESIGN: + $my['options']['order_cfg'] = array( + "type" => 'exec_order', + "tplan_id" => $argsObj->tplan_id + ); + break; + + case DOC_TEST_PLAN_EXECUTION: + case DOC_TEST_PLAN_EXECUTION_ON_BUILD: + $my['options']['order_cfg'] = array( + "type" => 'exec_order', + "tplan_id" => $argsObj->tplan_id + ); + $my['options']['prepareNode'] = array( + 'viewType' => 'executionTree' + ); + break; + + case DOC_REQ_SPEC: + $my['filters'] = array( + 'exclude_node_types' => array( + 'testplan' => 'exclude me', + 'testsuite' => 'exclude me', + 'testcase' => 'exclude me' + ), + 'exclude_children_of' => array( + 'testcase' => 'exclude my children', + 'testsuite' => 'exclude my children', + 'requirement' => 'exclude my children' + ) + ); + break; + } + + $user = tlUser::getById($dbHandler, $userID); + if ($user) { + $doc->author = htmlspecialchars($user->getDisplayName()); + } + unset($user); + + $dummy = $tprojectMgr->get_by_id($argsObj->tproject_id); + $doc->tproject_name = htmlspecialchars($dummy['name']); + $doc->tproject_scope = $dummy['notes']; + + $doc->test_priority_enabled = $dummy['opt']->testPriorityEnabled; + + return array( + $doc, + $my + ); +} + +/** + */ +function getStatsEstimatedExecTime(&$tplanMgr, &$items2use, $tplanID) +{ + $min = array(); + $stat = null; + if (is_null($items2use)) { + // will work on all test cases present on Test Plan. + // these IDs will be searched inside get_estimated_execution_time() + $min = $tplanMgr->get_estimated_execution_time($tplanID); + } else { + $min['totalMinutes'] = 0; + $min['totalTestCases'] = 0; + $min['platform'] = array(); + foreach ($items2use as $platID => $itemsForPlat) { + if (! is_null($itemsForPlat)) { + $tmp = $tplanMgr->get_estimated_execution_time($tplanID, + $itemsForPlat, $platID); + $min['platform'][$platID] = $tmp['platform'][$platID]; + $min['totalMinutes'] += $tmp['totalMinutes']; + $min['totalTestCases'] += $tmp['totalTestCases']; + } + } + } + + if ($min['totalMinutes'] != "0") { + $stat['minutes'] = $min['totalMinutes']; + $stat['tcase_qty'] = $min['totalTestCases']; + + foreach ($min['platform'] as $platformID => $elem) { + $stat['platform'][$platformID] = $elem; + } + } + return $stat; +} + +/** + */ +function getStatsRealExecTime(&$tplanMgr, &$lastExecBy, $context, $decode) +{ + $min = array(); + $stat = null; + $executed_qty = 0; + $items2use = array(); + + if (! is_null($lastExecBy) && ! empty($lastExecBy)) { + // divide execution by Platform ID + $p2loop = array_keys($lastExecBy); + foreach ($p2loop as $platfID) { + if (! is_null($lastExecBy[$platfID])) { + $i2loop = array_keys($lastExecBy[$platfID]); + $items2use[$platfID] = null; + foreach ($i2loop as $xdx) { + $info = &$lastExecBy[$platfID][$xdx]; + if ($info['exec_status'] != + $decode['status_descr_code']['not_run']) { + $items2use[$platfID][] = $info['exec_id']; + $executed_qty ++; + } + } + } + } + + if ($executed_qty > 0) { + $min['totalMinutes'] = 0; + $min['totalTestCases'] = 0; + $min['platform'] = array(); + $ecx = $context; + + foreach ($items2use as $platID => $itemsForPlat) { + $min['platform'][$platID] = null; + if (! is_null($itemsForPlat)) { + $ecx->platform_id = $platID; + + $tmp = $tplanMgr->getExecutionTime($context, $itemsForPlat); + + $min['platform'][$platID] = $tmp['platform'][$platID]; + $min['totalMinutes'] += isset($tmp['totalMinutes']) ? $tmp['totalMinutes'] : 0; + $min['totalTestCases'] += $tmp['totalTestCases']; + } + } + } + } else { + $min = $tplanMgr->getExecutionTime($context); + } + + // Arrange data for caller + if (isset($min['totalMinutes']) && $min['totalMinutes'] != 0) { + $stat['minutes'] = $min['totalMinutes']; + $stat['tcase_qty'] = $min['totalTestCases']; + + foreach ($min['platform'] as $platformID => $elem) { + $stat['platform'][$platformID] = $elem; + } + } + return $stat; +} + +/** + */ +function buildContentForTestPlan(&$dbHandler, $itemsTree, $ctx, &$tplanMgr, + $pnFilters = null, $opt = null) +{ + $linkedBy = array(); + $contentByPlatform = array(); + + $tplanID = $ctx->tplan_id; + $platformIDSet = $ctx->platformIDSet; + + $my['opt'] = array( + 'setAssignedTo' => false + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + // due to Platforms we need to use 'viewType' => 'executionTree', + // if not we get ALWAYS the same set of test cases linked to test plan + // for each platform -> WRONG + $pnOptions = array( + 'hideTestCases' => 0, + 'showTestCaseID' => 1, + 'viewType' => 'executionTree', + 'getExternalTestCaseID' => 0, + 'ignoreInactiveTestCases' => 0 + ); + + $pnOptions['setAssignedTo'] = $my['opt']['setAssignedTo']; + + $filters = null; + $px = 'with_user_assignment'; + if (property_exists($ctx, $px) && $ctx->$px == 0) { + $filters = null; + } else { + $px = 'build_id'; + if (property_exists($ctx, $px)) { + $filters = array( + $px => $ctx->$px + ); + } + } + + foreach ($platformIDSet as $platform_id) { + $filters['platform_id'] = $platform_id; + $linkedBy[$platform_id] = $tplanMgr->getLinkedStaticView($tplanID, + $filters); + + // IMPORTANT NOTE: + // We are in a loop and we use tree on prepareNode, that changes it, + // then we can not use anymore a reference BUT WE NEED A COPY. + $tree2work = $itemsTree; + if (! $linkedBy[$platform_id]) { + $tree2work['childNodes'] = null; + } + + $dummy4reference = null; + prepareNode($dbHandler, $tree2work, $dummy4reference, $dummy4reference, + $linkedBy[$platform_id], $pnFilters, $pnOptions); + + $contentByPlatform[$platform_id] = $tree2work; + } + + return $contentByPlatform; +} + +/** + */ +function buildContentForTestPlanBranch(&$dbHandler, $itemsTree, $ctx, &$docInfo, + $decode, &$tplanMgr, $options = null) +{ + $linkedBy = array(); + $branch_tsuites = null; + $contentByPlatform = array(); + + $branchRoot = &$ctx->branchRoot; + $tplanID = &$ctx->tplan_id; + $platformIDSet = &$ctx->platformIDSet; + + $pnOptions = array( + 'hideTestCases' => 0, + 'setAssignedTo' => false + ); + $pnOptions = array_merge($pnOptions, (array) $options); + + $tsuite = new testsuite($dbHandler); + $tInfo = $tsuite->get_by_id($branchRoot); + $tInfo['node_type_id'] = $decode['node_descr_id']['testsuite']; + $docInfo->title = htmlspecialchars( + isset($tInfo['name']) ? $tInfo['name'] : $docInfo->testplan_name); + + $children_tsuites = $tsuite->tree_manager->get_subtree_list($branchRoot, + $decode['node_descr_id']['testsuite']); + if (! is_null($children_tsuites) && trim($children_tsuites) != "") { + $branch_tsuites = explode(',', $children_tsuites); + } + $branch_tsuites[] = $branchRoot; + + $metrics = (object) array( + 'estimatedExecTime' => null, + 'realExecTime' => null + ); + $filters = array( + 'tsuites_id' => $branch_tsuites + ); + + $getLTCVOpt['addExecInfo'] = true; + if ($docInfo->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { + $getLTCVOpt['addExecInfo'] = true; + $getLTCVOpt['ua_user_alias'] = ' AS assigned_to '; + $getLTCVOpt['ua_force_join'] = true; + + $getLTCVOpt['assigned_on_build'] = $ctx->build_id; + $filters['build_id'] = $ctx->build_id; + } + + foreach ($platformIDSet as $platform_id) { + // IMPORTANTE NOTICE: + // This need to be initialized on each iteration because prepareNode() make changes on it. + $tInfo['childNodes'] = isset($itemsTree['childNodes']) ? $itemsTree['childNodes'] : null; + + $filters['platform_id'] = $platform_id; + $metrics->estimatedExecTime[$platform_id] = null; + $metrics->realExecTime[$platform_id] = null; + + $avalon = $tplanMgr->getLTCVNewGeneration($tplanID, $filters, + $getLTCVOpt); + if (! is_null($avalon)) { + $k2l = array_keys($avalon); + foreach ($k2l as $key) { + $linkedBy[$platform_id][$key] = $avalon[$key][$platform_id]; + } + } else { + $linkedBy[$platform_id] = null; + } + + // After architecture changes on how CF design values for Test Cases are + // managed, we need the test case version ID and not test case ID + // In addition if we loop over Platforms we need to save this set each time!!! + $items2loop = ! is_null($linkedBy[$platform_id]) ? array_keys( + $linkedBy[$platform_id]) : null; + if (! is_null($items2loop)) { + foreach ($items2loop as $rdx) { + $metrics->estimatedExecTime[$platform_id][] = $linkedBy[$platform_id][$rdx]['tcversion_id']; + } + } + + // Prepare Node -> pn + $pnFilters = null; + $dummy4reference = null; + $contentByPlatform[$platform_id]['childNodes'] = array(); + + if (! is_null($linkedBy[$platform_id])) { + prepareNode($dbHandler, $tInfo, $dummy4reference, $dummy4reference, + $linkedBy[$platform_id], $pnFilters, $pnOptions); + + $contentByPlatform[$platform_id]['childNodes'] = array( + $tInfo + ); + } + } + + $metrics->realExecTime = $linkedBy; + return array( + $contentByPlatform, + $metrics + ); +} + +/** + */ +function timeStatistics($items, $context, $decode, $tplanMgr) +{ + $stats = array(); + $stats['estimated_execution'] = getStatsEstimatedExecTime($tplanMgr, + $items->estimatedExecTime, $context->tplan_id); + + $stats['real_execution'] = getStatsRealExecTime($tplanMgr, + $items->realExecTime, $context, $decode); + return $stats; +} + +/** + * rights check function for testlinkInitPage() + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } - - -// ----- rendering logic ----- -$topText = renderHTMLHeader($doc_info->type . ' ' . $doc_info->title,$_SESSION['basehref'],$doc_info->type); -$topText .= renderFirstPage($doc_info); - -// Init table of content (TOC) data -renderTOC($printingOptions); // @TODO check if is really useful - -$tocPrefix = null; -if( ($showPlatforms = !isset($treeForPlatform[0]) ? true : false) ) { - $tocPrefix = 0; -} - -if ($treeForPlatform) { - // Things that have to be printed just once - // - switch ($doc_info->type) { - case DOC_TEST_PLAN_DESIGN: - $printingOptions['metrics'] = true; // FORCED - - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $docText .= renderTestProjectItem($doc_info); - $docText .= renderTestPlanItem($doc_info); - - if($doc_info->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { - $docText .= renderBuildItem($doc_info); - } - - $cfieldFormatting=array('table_css_style' => 'class="cf"'); - if ($printingOptions['cfields']) { - $cfields = $tplan_mgr->html_table_of_custom_field_values($args->tplan_id,'design',null,$cfieldFormatting); - $docText .= '

    ' . $cfields . '

    '; - } - break; - } - - - $actionContext = (array)$args; - foreach ($treeForPlatform as $platform_id => $tree2work) { - $actionContext['platform_id'] = $platform_id; - - if(isset($tree2work['childNodes']) && sizeof($tree2work['childNodes']) > 0) { - $tree2work['name'] = $args->tproject_name; - $tree2work['id'] = $args->tproject_id; - $tree2work['node_type_id'] = $decode['node_descr_id']['testproject']; - switch ($doc_info->type) { - case DOC_REQ_SPEC: - $docText .= renderReqSpecTreeForPrinting($db, $tree2work, $printingOptions, - null, 0, 1, $args->user_id,0,$args->tproject_id); - break; - - case DOC_TEST_SPEC: - $docText .= renderSimpleChapter(lang_get('scope'), $doc_info->tproject_scope); - - $env = new stdClass(); - $env->base_href = $_SESSION['basehref']; - $env->item_type = $doc_info->content_range; - $env->tocPrefix = null; - $env->tocCounter = 0; - $env->user_id = $args->user_id; - $env->reportType = $doc_info->type; - - // force hidding of execution related info - $printingOptions['passfail'] = false; - $printingOptions['step_exec_notes'] = false; - $printingOptions['step_exec_status'] = false; - - - $actionContext['level'] = 0; - $indentLevelStart = 1; - $docText .= renderTestSpecTreeForPrinting($db,$tree2work,$printingOptions,$env,$actionContext, - $env->tocPrefix,$indentLevelStart); - break; - - case DOC_TEST_PLAN_DESIGN: - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - - $tocPrefix++; - $env = new stdClass(); - $env->base_href = $_SESSION['basehref']; - $env->item_type = $doc_info->content_range; - $env->tocPrefix = $tocPrefix; - $env->user_id = $args->user_id; - $env->testCounter = 1; - $env->reportType = $doc_info->type; - - if ($showPlatforms) { - $printingOptions['showPlatformNotes'] = true; - $docText .= renderPlatformHeading($tocPrefix,$platforms[$platform_id],$printingOptions); - } - - $actionContext['level'] = 0; - $docText .= renderTestPlanForPrinting($db,$tree2work,$printingOptions,$env,$actionContext); - - if( $printingOptions['metrics'] ) { - $docText .= buildTestPlanMetrics($doc_data->statistics,$platform_id); - } - break; - } - } - } -} -$docText .= renderEOF(); - -// Needed for platform feature -if ($printingOptions['toc']) { - $printingOptions['tocCode'] .= '
    '; - $topText .= $printingOptions['tocCode']; -} -$docText = $topText . $docText; - - -// add application header to HTTP -if (($args->format == FORMAT_ODT) || ($args->format == FORMAT_MSWORD)) -{ - flushHttpHeader($args->format, $doc_info->type); -} - -// send out the data -echo $docText; - - -/** - * Process input data - * - **/ -function init_args(&$dbHandler) { - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "build_id" => array(tlInputParameter::INT_N), - "docTestPlanId" => array(tlInputParameter::INT_N), - "id" => array(tlInputParameter::INT_N), - "type" => array(tlInputParameter::STRING_N,0,20), - "format" => array(tlInputParameter::INT_N), - "level" => array(tlInputParameter::STRING_N,0,32), - "with_user_assignment" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - // really UGLY HACK - $typeDomain = array('test_plan' => 'testplan','test_report' => 'testreport'); - $args->type = isset($typeDomain[$args->type]) ? $typeDomain[$args->type] : $args->type; - - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - $args->itemID = $args->tproject_id; - } - else { - testlinkInitPage($dbHandler,false,false,"checkRights"); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tplan_id = isset($_REQUEST['docTestPlanId']) ? intval($_REQUEST['docTestPlanId']) : 0; - $args->itemID = $args->id; - } - - $tproject_mgr = new testproject($dbHandler); - - if($args->tproject_id > 0) { - $dummy = $tproject_mgr->get_by_id($args->tproject_id); - $args->tproject_name = $dummy['name']; - } else { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - $args->doc_type = $args->type; - $args->user_id = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : null; - - - $resultsCfg = config_get('results'); - $dcd = array(); - $dcd['node_descr_id'] = $tproject_mgr->tree_manager->get_available_node_types(); - $dcd['node_id_descr'] = array_flip($dcd['node_descr_id']); - - $dcd['status_descr_code'] = $resultsCfg['status_code']; - $dcd['status_code_descr'] = array_flip($dcd['status_descr_code']); - - return array($args,$tproject_mgr,$dcd); -} - - -/** - * @uses init_checkboxes() - printDocOptions.php - * - **/ -function initPrintOpt(&$UIhash,&$docInfo) { - - $optObj = new printDocOptions(); - $pOpt = $optObj->getAllOptVars(); - - $lightOn = isset($UIhash['allOptionsOn']); - foreach($pOpt as $opt => $val) { - $pOpt[$opt] = $lightOn || (isset($UIhash[$opt]) && ($UIhash[$opt] == 'y')); - } - $pOpt['docType'] = $docInfo->type; - $pOpt['tocCode'] = ''; // to avoid warning because of undefined index - - return $pOpt; -} - - -/** - * - * - **/ -function getDecode(&$treeMgr) -{ - - $resultsCfg = config_get('results'); - - $dcd = array(); - $dcd['node_descr_id'] = $treeMgr->get_available_node_types(); - $dcd['node_id_descr'] = array_flip($dcd['node_descr_id']); - - $dcd['status_descr_code'] = $resultsCfg['status_code']; - $dcd['status_code_descr'] = array_flip($dcd['status_descr_code']); - - return $dcd; -} - -/** - * - * @internal revisions: - * - **/ -function initEnv(&$dbHandler,&$argsObj,&$tprojectMgr,$userID) { - - $my = array(); - $doc = new stdClass(); - - $my['options'] = array('recursive' => true, 'prepareNode' => null, - 'order_cfg' => array("type" =>'spec_order') ); - $my['filters'] = array('exclude_node_types' => array('testplan'=>'exclude me', - 'requirement_spec'=>'exclude me', - 'requirement'=>'exclude me'), - 'exclude_children_of' => array('testcase'=>'exclude my children', - 'requirement_spec'=> 'exclude my children')); - - $lblKey = array(DOC_TEST_SPEC => 'title_test_spec', DOC_TEST_PLAN_DESIGN => 'report_test_plan_design', - DOC_TEST_PLAN_EXECUTION => 'report_test_plan_execution', - DOC_TEST_PLAN_EXECUTION_ON_BUILD => 'report_test_plan_execution_on_build', - DOC_REQ_SPEC => 'req_spec'); - - - $doc->content_range = $argsObj->level; - $doc->type = $argsObj->doc_type; - $doc->type_name = lang_get($lblKey[$doc->type]); - $doc->additional_info = $argsObj->with_user_assignment ? - lang_get('only_test_cases_wta') : ''; - $doc->author = ''; - $doc->title = ''; - - switch ($doc->type) { - case DOC_TEST_PLAN_DESIGN: - $my['options']['order_cfg'] = array("type" =>'exec_order',"tplan_id" => $argsObj->tplan_id); - break; - - case DOC_TEST_PLAN_EXECUTION: - case DOC_TEST_PLAN_EXECUTION_ON_BUILD: - $my['options']['order_cfg'] = array("type" =>'exec_order', - "tplan_id" => $argsObj->tplan_id); - $my['options']['prepareNode'] = array('viewType' => 'executionTree'); - break; - - case DOC_REQ_SPEC: - $my['filters'] = array('exclude_node_types' => array('testplan'=>'exclude me', - 'testsuite'=>'exclude me', - 'testcase'=>'exclude me'), - 'exclude_children_of' => array('testcase'=>'exclude my children', - 'testsuite'=> 'exclude my children', - 'requirement'=>'exclude my children')); - break; - } - - - $user = tlUser::getById($dbHandler,$userID); - if ($user) { - $doc->author = htmlspecialchars($user->getDisplayName()); - } - unset($user); - - $dummy = $tprojectMgr->get_by_id($argsObj->tproject_id); - $doc->tproject_name = htmlspecialchars($dummy['name']); - $doc->tproject_scope = $dummy['notes']; - - $doc->test_priority_enabled = $dummy['opt']->testPriorityEnabled; - - return array($doc,$my); -} - - -/** - * - * - **/ -function getStatsEstimatedExecTime(&$tplanMgr,&$items2use,$tplanID) -{ - - $min = array(); - $stat = null; - if( is_null($items2use) ) - { - // will work on all test cases present on Test Plan. - // these IDs will be searched inside get_estimated_execution_time() - $min = $tplanMgr->get_estimated_execution_time($tplanID); - } - else - { - $min['totalMinutes'] = 0; - $min['totalTestCases'] = 0; - $min['platform'] = array(); - foreach( $items2use as $platID => $itemsForPlat ) - { - if( !is_null($itemsForPlat) ) - { - $tmp = $tplanMgr->get_estimated_execution_time($tplanID,$itemsForPlat,$platID); - $min['platform'][$platID] = $tmp['platform'][$platID]; - $min['totalMinutes'] += $tmp['totalMinutes']; - $min['totalTestCases'] += $tmp['totalTestCases']; - } - } - } - - if ($min['totalMinutes'] != "0") - { - $stat['minutes'] = $min['totalMinutes']; - $stat['tcase_qty'] = $min['totalTestCases']; - - foreach($min['platform'] as $platformID => $elem) - { - $stat['platform'][$platformID] = $elem; - } - } - return $stat; -} - - -/** - * - * - **/ -function getStatsRealExecTime(&$tplanMgr,&$lastExecBy,$context,$decode) { - $min = array(); - $stat = null; - $executed_qty = 0; - $items2use = array(); - - if( !is_null($lastExecBy) && count($lastExecBy) > 0 ) { - // divide execution by Platform ID - $p2loop = array_keys($lastExecBy); - foreach($p2loop as $platfID) { - if( !is_null($lastExecBy[$platfID]) ) { - $i2loop = array_keys($lastExecBy[$platfID]); - $items2use[$platfID] = null; - foreach($i2loop as $xdx) { - $info = &$lastExecBy[$platfID][$xdx]; - if( $info['exec_status'] != $decode['status_descr_code']['not_run'] ) { - $items2use[$platfID][] = $info['exec_id']; - $executed_qty++; - } - } - } - } - - if( $executed_qty > 0) { - $min['totalMinutes'] = 0; - $min['totalTestCases'] = 0; - $min['platform'] = array(); - $ecx = new stdClass(); - $ecx = $context; - - foreach( $items2use as $platID => $itemsForPlat ) { - $min['platform'][$platID] = null; - if( !is_null($itemsForPlat) ) { - $ecx->platform_id = $platID; - - $tmp = $tplanMgr->getExecutionTime($context,$itemsForPlat); - - $min['platform'][$platID] = $tmp['platform'][$platID]; - $min['totalMinutes'] += isset($tmp['totalMinutes']) ? $tmp['totalMinutes'] : 0; - $min['totalTestCases'] += $tmp['totalTestCases']; - } - } - } - } else { - $min = $tplanMgr->getExecutionTime($context); - } - - // Arrange data for caller - if (isset($min['totalMinutes']) && $min['totalMinutes'] != 0) { - $stat['minutes'] = $min['totalMinutes']; - $stat['tcase_qty'] = $min['totalTestCases']; - - foreach($min['platform'] as $platformID => $elem) { - $stat['platform'][$platformID] = $elem; - } - } - return $stat; -} - - -/** - * - */ -function buildContentForTestPlan(&$dbHandler,$itemsTree,$ctx,$decode, - &$tplanMgr,$pnFilters=null,$opt=null) { - - $linkedBy = array(); - $contentByPlatform = array(); - - $tplanID = $ctx->tplan_id; - $platformIDSet = $ctx->platformIDSet; - - $my['opt'] = array('setAssignedTo' => false); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - // due to Platforms we need to use 'viewType' => 'executionTree', - // if not we get ALWAYS the same set of test cases linked to test plan - // for each platform -> WRONG - $pnOptions = array('hideTestCases' => 0, 'showTestCaseID' => 1, - 'viewType' => 'executionTree', - 'getExternalTestCaseID' => 0, 'ignoreInactiveTestCases' => 0); - - $pnOptions['setAssignedTo'] = $my['opt']['setAssignedTo']; - - $filters = null; - $px = 'with_user_assignment'; - if( property_exists($ctx, $px) && $ctx->$px == 0 ){ - $filters = null; - } else { - $px = 'build_id'; - if( property_exists($ctx, $px) ) { - $filters = array($px => $ctx->$px); - } - } - - foreach($platformIDSet as $platform_id) { - $filters['platform_id'] = $platform_id; - $linkedBy[$platform_id] = $tplanMgr->getLinkedStaticView($tplanID,$filters); - - // IMPORTANT NOTE: - // We are in a loop and we use tree on prepareNode, that changes it, - // then we can not use anymore a reference BUT WE NEED A COPY. - $tree2work = $itemsTree; - if (!$linkedBy[$platform_id]) { - $tree2work['childNodes'] = null; - } - - $dummy4reference = null; - prepareNode($dbHandler,$tree2work,$dummy4reference,$dummy4reference,$linkedBy[$platform_id],$pnFilters,$pnOptions); - - $contentByPlatform[$platform_id] = $tree2work; - } - - return $contentByPlatform; -} - - -/** - * - */ -function buildContentForTestPlanBranch(&$dbHandler,$itemsTree,$ctx,&$docInfo,$decode, - &$tplanMgr,$options=null) -{ - $linkedBy = array(); - $branch_tsuites = null; - $contentByPlatform = array(); - - $branchRoot = &$ctx->branchRoot; - $tplanID = &$ctx->tplan_id; - $platformIDSet = &$ctx->platformIDSet; - - $pnOptions = array('hideTestCases' => 0,'setAssignedTo' => false); - $pnOptions = array_merge($pnOptions, (array)$options); - - $tsuite = new testsuite($dbHandler); - $tInfo = $tsuite->get_by_id($branchRoot); - $tInfo['node_type_id'] = $decode['node_descr_id']['testsuite']; - $docInfo->title = htmlspecialchars(isset($tInfo['name']) ? $tInfo['name'] : $docInfo->testplan_name); - - $children_tsuites = $tsuite->tree_manager->get_subtree_list($branchRoot,$decode['node_descr_id']['testsuite']); - if( !is_null($children_tsuites) and trim($children_tsuites) != "") - { - $branch_tsuites = explode(',',$children_tsuites); - } - $branch_tsuites[]=$branchRoot; - - $metrics = (object) array('estimatedExecTime' => null,'realExecTime' => null); - $filters = array( 'tsuites_id' => $branch_tsuites); - - $getLTCVOpt['addExecInfo'] = true; - if($docInfo->type == DOC_TEST_PLAN_EXECUTION_ON_BUILD) { - $getLTCVOpt['addExecInfo'] = true; - $getLTCVOpt['ua_user_alias'] = ' AS assigned_to '; - $getLTCVOpt['ua_force_join'] = true; - - $getLTCVOpt['assigned_on_build'] = $ctx->build_id; - $filters['build_id'] = $ctx->build_id; - } - - foreach($platformIDSet as $platform_id) { - // IMPORTANTE NOTICE: - // This need to be initialized on each iteration because prepareNode() make changes on it. - $tInfo['childNodes'] = isset($itemsTree['childNodes']) ? $itemsTree['childNodes'] : null; - - $filters['platform_id'] = $platform_id; - $metrics->estimatedExecTime[$platform_id] = null; - $metrics->realExecTime[$platform_id] = null; - - $avalon = $tplanMgr->getLTCVNewGeneration($tplanID, $filters, $getLTCVOpt); - if(!is_null($avalon)) { - $k2l = array_keys($avalon); - foreach($k2l as $key) { - $linkedBy[$platform_id][$key] = $avalon[$key][$platform_id]; - } - } else { - $linkedBy[$platform_id] = null; - } - - // After architecture changes on how CF design values for Test Cases are - // managed, we need the test case version ID and not test case ID - // In addition if we loop over Platforms we need to save this set each time!!! - $items2loop = !is_null($linkedBy[$platform_id]) ? array_keys($linkedBy[$platform_id]) : null; - if( !is_null($items2loop) ) { - foreach($items2loop as $rdx) { - $metrics->estimatedExecTime[$platform_id][] = $linkedBy[$platform_id][$rdx]['tcversion_id']; - } - } - - // Prepare Node -> pn - $pnFilters = null; - $dummy4reference = null; - $contentByPlatform[$platform_id]['childNodes'] = array(); - - if(!is_null($linkedBy[$platform_id])) { - prepareNode($dbHandler,$tInfo,$dummy4reference,$dummy4reference, - $linkedBy[$platform_id],$pnFilters,$pnOptions); - - $contentByPlatform[$platform_id]['childNodes'] = array($tInfo); - } - } - - $metrics->realExecTime = $linkedBy; - return array($contentByPlatform,$metrics); -} - -/** - * - */ -function timeStatistics($items,$context,$decode,$tplanMgr) { - $stats = array(); - $stats['estimated_execution'] = - getStatsEstimatedExecTime($tplanMgr,$items->estimatedExecTime,$context->tplan_id); - - $stats['real_execution'] = getStatsRealExecTime($tplanMgr,$items->realExecTime,$context,$decode); - return $stats; -} - - - -/* - * rights check function for testlinkInitPage() - */ -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} \ No newline at end of file diff --git a/lib/results/priorityBarChart.php b/lib/results/priorityBarChart.php index 1ec19c8f52..d706c95fa1 100644 --- a/lib/results/priorityBarChart.php +++ b/lib/results/priorityBarChart.php @@ -1,100 +1,200 @@ -get_by_id($tplan_id); -$tproject_info = $tproject_mgr->get_by_id($tproject_id); - -$re = new results($db, $tplan_mgr, $tproject_info, $tplan_info, - ALL_TEST_SUITES,ALL_BUILDS,ALL_PLATFORMS); - -/** -* KEYWORDS REPORT -*/ -$arrDataKeys = $re->getAggregateKeywordResults(); -$i = 0; -$arrDataKeys2 = null; - -if ($arrDataKeys != null) { - while ($keywordId = key($arrDataKeys)) { - $arr = $arrDataKeys[$keywordId]; - $arrDataKeys2[$i] = $arr; - $i++; - next($arrDataKeys); - } -} - - - -$namesOfKeywordsArray = array(); -$namesOfKeywordsArray[0] = ""; - -$passArray = array(); -$passArray[0] = "pass"; - -$failArray = array(); -$failArray[0] = "fail"; - -$blockedArray = array(); -$blockedArray[0] = "blocked"; - -$notRunArray = array(); -$notRunArray[0] = "not run"; - -for ($i = 0 ; $i < sizeOf($arrDataKeys); $i++) { - $keywordArr = $arrDataKeys2[$i]; - $namesOfKeywordsArray[$i + 1] = $keywordArr[0]; - // $total = $keywordArr[1]; - $passArray[$i + 1] = $keywordArr[2]; - $failArray[$i + 1] = $keywordArr[3]; - $blockedArray[$i + 1] = $keywordArr[4]; - $notRunArray[$i + 1] = $keywordArr[5]; - // $percentComplete = $keywordArr[6]; -} - -$chart[ 'chart_data' ] = array ($namesOfKeywordsArray, $passArray,$failArray, $blockedArray,$notRunArray); - -/** -END NEW STUFF -*/ - - - -$chart[ 'axis_value' ] = array ( 'font'=>"arial", 'bold'=>true, 'size'=>10, 'color'=>"000000", 'alpha'=>50, 'steps'=>6, 'prefix'=>"", 'suffix'=>"", 'decimals'=>0, 'separator'=>"", 'show_min'=>true ); - -$chart[ 'chart_border' ] = array ( 'color'=>"000000", 'top_thickness'=>0, 'bottom_thickness'=>3, 'left_thickness'=>0, 'right_thickness'=>0 ); - -// $chart[ 'chart_data' ] = array ( array ( "", "P1", "P2", "P3" ), array ( "pass", 1, 5, 10), array ( "fail", 1, 5, 10), array ("blocked", 1, 5, 10), array ("not run", 1, 5, 10)); - - - - - - -$chart[ 'chart_grid_h' ] = array ( 'alpha'=>20, 'color'=>"000000", 'thickness'=>1, 'type'=>"solid" ); -$chart[ 'chart_grid_v' ] = array ( 'alpha'=>20, 'color'=>"000000", 'thickness'=>1, 'type'=>"dashed" ); -$chart[ 'chart_rect' ] = array ( 'x'=>125, 'y'=>65, 'width'=>250, 'height'=>200, 'positive_color'=>"ffffff", 'negative_color'=>"000000", 'positive_alpha'=>75, 'negative_alpha'=>15 ); -$chart[ 'chart_transition' ] = array ( 'type'=>"drop", 'delay'=>0, 'duration'=>2, 'order'=>"series" ); -$chart[ 'chart_type' ] = "stacked column"; - -$chart[ 'draw' ] = array ( array ( 'transition'=>"slide_up", 'delay'=>1, 'duration'=>.5, 'type'=>"text", 'color'=>"000033", 'alpha'=>15, 'font'=>"arial", 'rotation'=>-90, 'bold'=>true, 'size'=>64, 'x'=>0, 'y'=>295, 'width'=>300, 'height'=>50, 'text'=>"Keywords", 'h_align'=>"right", 'v_align'=>"middle" ), - array ( 'transition'=>"slide_up", 'delay'=>1, 'duration'=>.5, 'type'=>"text", 'color'=>"ffffff", 'alpha'=>40, 'font'=>"arial", 'rotation'=>-90, 'bold'=>true, 'size'=>25, 'x'=>30, 'y'=>300, 'width'=>300, 'height'=>50, 'text'=>"report", 'h_align'=>"right", 'v_align'=>"middle" ) ); - -$chart[ 'legend_label' ] = array ( 'layout'=>"horizontal", 'font'=>"arial", 'bold'=>true, 'size'=>13, 'color'=>"444466", 'alpha'=>90 ); -$chart[ 'legend_rect' ] = array ( 'x'=>125, 'y'=>10, 'width'=>250, 'height'=>10, 'margin'=>5, 'fill_color'=>"ffffff", 'fill_alpha'=>35, 'line_color'=>"000000", 'line_alpha'=>0, 'line_thickness'=>0 ); -$chart[ 'legend_transition' ] = array ( 'type'=>"slide_left", 'delay'=>0, 'duration'=>1 ); - -$chart[ 'series_color' ] = array ("00FF00", "FF0000", "0000FF", "000000"); - -SendChartData ( $chart ); +get_by_id($tplan_id); +$tproject_info = $tproject_mgr->get_by_id($tproject_id); + +$re = new results($db, $tplan_mgr, $tproject_info, $tplan_info, ALL_TEST_SUITES, + ALL_BUILDS, ALL_PLATFORMS); + +/** + * KEYWORDS REPORT + */ +$arrDataKeys = $re->getAggregateKeywordResults(); +$i = 0; +$arrDataKeys2 = null; + +if ($arrDataKeys != null) { + while ($keywordId = key($arrDataKeys)) { + $arr = $arrDataKeys[$keywordId]; + $arrDataKeys2[$i] = $arr; + $i ++; + next($arrDataKeys); + } +} + +$namesOfKeywordsArray = array(); +$namesOfKeywordsArray[0] = ""; + +$passArray = array(); +$passArray[0] = "pass"; + +$failArray = array(); +$failArray[0] = "fail"; + +$blockedArray = array(); +$blockedArray[0] = "blocked"; + +$notRunArray = array(); +$notRunArray[0] = "not run"; + +for ($i = 0; $i < count($arrDataKeys); $i ++) { + $keywordArr = $arrDataKeys2[$i]; + $namesOfKeywordsArray[$i + 1] = $keywordArr[0]; + $passArray[$i + 1] = $keywordArr[2]; + $failArray[$i + 1] = $keywordArr[3]; + $blockedArray[$i + 1] = $keywordArr[4]; + $notRunArray[$i + 1] = $keywordArr[5]; +} + +$chart['chart_data'] = array( + $namesOfKeywordsArray, + $passArray, + $failArray, + $blockedArray, + $notRunArray +); + +/** + * END NEW STUFF + */ + +$chart['axis_value'] = array( + 'font' => "arial", + 'bold' => true, + 'size' => 10, + 'color' => "000000", + 'alpha' => 50, + 'steps' => 6, + 'prefix' => "", + 'suffix' => "", + 'decimals' => 0, + 'separator' => "", + 'show_min' => true +); + +$chart['chart_border'] = array( + 'color' => "000000", + 'top_thickness' => 0, + 'bottom_thickness' => 3, + 'left_thickness' => 0, + 'right_thickness' => 0 +); + +$chart['chart_grid_h'] = array( + 'alpha' => 20, + 'color' => "000000", + 'thickness' => 1, + 'type' => "solid" +); +$chart['chart_grid_v'] = array( + 'alpha' => 20, + 'color' => "000000", + 'thickness' => 1, + 'type' => "dashed" +); +$chart['chart_rect'] = array( + 'x' => 125, + 'y' => 65, + 'width' => 250, + 'height' => 200, + 'positive_color' => "ffffff", + 'negative_color' => "000000", + 'positive_alpha' => 75, + 'negative_alpha' => 15 +); +$chart['chart_transition'] = array( + 'type' => "drop", + 'delay' => 0, + 'duration' => 2, + 'order' => "series" +); +$chart['chart_type'] = "stacked column"; + +$chart['draw'] = array( + array( + 'transition' => "slide_up", + 'delay' => 1, + 'duration' => .5, + 'type' => "text", + 'color' => "000033", + 'alpha' => 15, + 'font' => "arial", + 'rotation' => - 90, + 'bold' => true, + 'size' => 64, + 'x' => 0, + 'y' => 295, + 'width' => 300, + 'height' => 50, + 'text' => "Keywords", + 'h_align' => "right", + 'v_align' => "middle" + ), + array( + 'transition' => "slide_up", + 'delay' => 1, + 'duration' => .5, + 'type' => "text", + 'color' => "ffffff", + 'alpha' => 40, + 'font' => "arial", + 'rotation' => - 90, + 'bold' => true, + 'size' => 25, + 'x' => 30, + 'y' => 300, + 'width' => 300, + 'height' => 50, + 'text' => "report", + 'h_align' => "right", + 'v_align' => "middle" + ) +); + +$chart['legend_label'] = array( + 'layout' => "horizontal", + 'font' => "arial", + 'bold' => true, + 'size' => 13, + 'color' => "444466", + 'alpha' => 90 +); +$chart['legend_rect'] = array( + 'x' => 125, + 'y' => 10, + 'width' => 250, + 'height' => 10, + 'margin' => 5, + 'fill_color' => "ffffff", + 'fill_alpha' => 35, + 'line_color' => "000000", + 'line_alpha' => 0, + 'line_thickness' => 0 +); +$chart['legend_transition'] = array( + 'type' => "slide_left", + 'delay' => 0, + 'duration' => 1 +); + +$chart['series_color'] = array( + "00FF00", + "FF0000", + "0000FF", + "000000" +); + +SendChartData($chart); ?> diff --git a/lib/results/resultsBugs.php b/lib/results/resultsBugs.php index 1c3e6ddeca..b54dab7a52 100644 --- a/lib/results/resultsBugs.php +++ b/lib/results/resultsBugs.php @@ -1,268 +1,285 @@ -warning_msg = ''; -$gui->tableSet = null; - -$templateCfg = templateConfiguration(); -$args = init_args(); - -// get issue tracker config and object to manage TestLink - BTS integration -$its = null; -$tproject_mgr = new testproject($db); -$info = $tproject_mgr->get_by_id($args->tproject_id); -$gui->bugInterfaceOn = $info['issue_tracker_enabled']; -if( $info['issue_tracker_enabled']) { - $it_mgr = new tlIssueTracker($db); - $its = $it_mgr->getInterfaceObject($args->tproject_id); - unset($it_mgr); -} - -$smarty = new TLSmarty; -$img = $smarty->getImages(); -$openBugs = array(); -$resolvedBugs = array(); -$arrData = array(); - -$tplan_mgr = new testplan($db); -$metricsMgr = new tlTestPlanMetrics($db); -$tproject_mgr = new testproject($db); - -$tplan_info = $tplan_mgr->get_by_id($args->tplan_id); -$tproject_info = $tproject_mgr->get_by_id($args->tproject_id); -unset($tproject_mgr); - -// $filters = array(); -// $options = array('output' => 'array', 'only_executed' => true, 'details' => 'full'); -// $execSet = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options); - -switch($args->verboseType) -{ - case 'all': - $execSet = $tplan_mgr->getAllExecutionsWithBugs($args->tplan_id); - break; - - case 'latest': - default: - $execSet = (array)$metricsMgr->getLTCVNewGeneration($args->tplan_id,null, - array('addExecInfo' => true, 'accessKeyType' => 'index', - 'specViewFields' => true, 'testSuiteInfo' => true, - 'includeNotRun' => false)); - break; - - +warning_msg = ''; +$gui->tableSet = null; + +$templateCfg = templateConfiguration(); +$args = initArgs(); + +// get issue tracker config and object to manage TestLink - BTS integration +$its = null; +$tproject_mgr = new testproject($db); +$info = $tproject_mgr->get_by_id($args->tproject_id); +$gui->bugInterfaceOn = $info['issue_tracker_enabled']; +if ($info['issue_tracker_enabled']) { + $it_mgr = new tlIssueTracker($db); + $its = $it_mgr->getInterfaceObject($args->tproject_id); + unset($it_mgr); +} + +$smarty = new TLSmarty(); +$img = $smarty->getImages(); +$openBugs = array(); +$resolvedBugs = array(); +$arrData = array(); + +$tplan_mgr = new testplan($db); +$metricsMgr = new tlTestPlanMetrics($db); +$tproject_mgr = new testproject($db); + +$tplan_info = $tplan_mgr->get_by_id($args->tplan_id); +$tproject_info = $tproject_mgr->get_by_id($args->tproject_id); +unset($tproject_mgr); + +switch ($args->verboseType) { + case 'all': + $execSet = $tplan_mgr->getAllExecutionsWithBugs($args->tplan_id); + break; + + case 'latest': + default: + $execSet = (array) $metricsMgr->getLTCVNewGeneration($args->tplan_id, + null, + array( + 'addExecInfo' => true, + 'accessKeyType' => 'index', + 'specViewFields' => true, + 'testSuiteInfo' => true, + 'includeNotRun' => false + )); + break; +} + +$testcase_bugs = array(); +$mine = array(); + +$l18n = init_labels( + array( + 'execution_history' => null, + 'design' => null, + 'no_linked_bugs' => null + )); +foreach ($execSet as $execution) { + $tc_id = $execution['tc_id']; + $mine[] = $execution['exec_id']; + + $bug_urls = buildBugString($db, $execution['exec_id'], $its, $openBugs, + $resolvedBugs); + if ($bug_urls) { + // First bug found for this tc + if (! isset($testcase_bugs[$tc_id])) { + // This is ONLY PARENT TEST SUITE !!! + $suiteName = $execution['tsuite_name']; + $tc_name = $execution['full_external_id'] . ":" . $execution['name']; + + // add linked icons + $exec_history_link = "" . + " "; + $edit_link = "" . + " "; + + $tc_name = "" . $exec_history_link . $edit_link . $tc_name; + + $testcase_bugs[$tc_id] = array( + $suiteName, + $tc_name, + array() + ); + } + foreach ($bug_urls as $url) { + if (! in_array($url, $testcase_bugs[$tc_id][2])) { + $testcase_bugs[$tc_id][2][] = $url; + } + } + } +} +foreach ($testcase_bugs as &$row) { + $row[2] = implode("
    ", $row[2]); +} +$arrData = array_values($testcase_bugs); + +if (! empty($arrData)) { + // Create column headers + $columns = getColumnsDefinition(); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + foreach ($arrData as $bugs) { + $rowData = array(); + $rowData[] = $bugs[0]; + $rowData[] = $bugs[1]; + $rowData[] = $bugs[2]; + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_bugs_per_test_case'); + + $table->setGroupByColumnName(lang_get('title_test_suite_name')); + + $table->setSortByColumnName(lang_get('title_test_case_title')); + $table->sortDirection = 'ASC'; + + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + + $gui->tableSet = array( + $table + ); +} else { + $gui->warning_msg = $l18n['no_linked_bugs']; +} + +$totalOpenBugs = count($openBugs); +$totalResolvedBugs = count($resolvedBugs); +$totalBugs = $totalOpenBugs + $totalResolvedBugs; +$totalCasesWithBugs = count($arrData); + +$gui->user = $args->user; +$gui->printDate = ''; +$gui->tproject_name = $tproject_info['name']; +$gui->tplan_name = $tplan_info['name']; +$gui->title = $args->title; +$gui->totalOpenBugs = $totalOpenBugs; +$gui->totalResolvedBugs = $totalResolvedBugs; +$gui->totalBugs = $totalBugs; +$gui->totalCasesWithBugs = $totalCasesWithBugs; +$gui->hint = $args->hint; + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Get links to bugs related to execution. + * + * @param database $db + * @param integer $execID + * execution id + * @param array $openBugsArray + * array to count open bugs + * @param array $resolvedBugsArray + * array to count resolved bugs + * @return array List of links to related bugs + */ +function buildBugString(&$db, $execID, &$bugInterface, &$openBugsArray, + &$resolvedBugsArray) +{ + $bugUrls = array(); + if ($bugInterface) { + $bugs = get_bugs_for_exec($db, $bugInterface, $execID); + if ($bugs) { + foreach ($bugs as $bugID => $bugInfo) { + if ($bugInfo['isResolved']) { + if (! in_array($bugID, $resolvedBugsArray)) { + $resolvedBugsArray[] = $bugID; + } + } else { + if (! in_array($bugID, $openBugsArray)) { + $openBugsArray[] = $bugID; + } + } + $bugUrls[] = $bugInfo['link_to_bts']; + } + } + } + return $bugUrls; +} + +/** + * get Columns definition for table to display + * + * @return array + */ +function getColumnsDefinition() +{ + $colDef = array(); + + $colDef[] = array( + 'title_key' => 'title_test_suite_name', + 'width' => 30, + 'type' => 'text' + ); + $colDef[] = array( + 'title_key' => 'title_test_case_title', + 'width' => 30, + 'type' => 'text' + ); + $colDef[] = array( + 'title_key' => 'title_test_case_bugs', + 'width' => 40, + 'type' => 'text' + ); + + return $colDef; +} + +/** + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "type" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->tproject_id = intval($_SESSION['testprojectID']); + $args->user = $_SESSION['currentUser']; + + switch ($args->type) { + case 1: + $args->verboseType = 'all'; + $args->title = lang_get('link_report_total_bugs_all_exec'); + $args->hint = lang_get('link_report_total_bugs_all_exec'); + break; + + case 0: + default: + $args->verboseType = 'latest'; + $args->title = lang_get('link_report_total_bugs'); + $args->hint = ''; + break; + } + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } - -$testcase_bugs = array(); -$mine = array(); - -$l18n = init_labels(array('execution_history' => null,'design' => null,'no_linked_bugs' => null)); -foreach ($execSet as $execution) -{ - $tc_id = $execution['tc_id']; - $mine[] = $execution['exec_id']; - - $bug_urls = buildBugString($db, $execution['exec_id'],$its, $openBugs, $resolvedBugs); - if ($bug_urls) - { - // First bug found for this tc - if (!isset($testcase_bugs[$tc_id])) - { - // This is ONLY PARENT TEST SUITE !!! - $suiteName = $execution['tsuite_name']; - $tc_name = $execution['full_external_id'] . ":" . $execution['name']; - - // add linked icons - $exec_history_link = "" . - " "; - $edit_link = "" . - " "; - - $tc_name = "" . $exec_history_link . - $edit_link . $tc_name; - - $testcase_bugs[$tc_id] = array($suiteName, $tc_name, array()); - } - foreach ($bug_urls as $url) - { - if (!in_array($url, $testcase_bugs[$tc_id][2])) - { - $testcase_bugs[$tc_id][2][] = $url; - } - } - } -} -foreach ($testcase_bugs as &$row) -{ - $row[2] = implode("
    ", $row[2]); -} -$arrData = array_values($testcase_bugs); - -if(count($arrData) > 0) -{ - // Create column headers - $columns = getColumnsDefinition(); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - foreach($arrData as $bugs) - { - $rowData = array(); - $rowData[] = $bugs[0]; - $rowData[] = $bugs[1]; - $rowData[] = $bugs[2]; - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_bugs_per_test_case'); - - $table->setGroupByColumnName(lang_get('title_test_suite_name')); - - $table->setSortByColumnName(lang_get('title_test_case_title')); - $table->sortDirection = 'ASC'; - - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - - $gui->tableSet = array($table); -} -else -{ - $gui->warning_msg = $l18n['no_linked_bugs']; -} - -$totalOpenBugs = count($openBugs); -$totalResolvedBugs = count($resolvedBugs); -$totalBugs = $totalOpenBugs + $totalResolvedBugs; -$totalCasesWithBugs = count($arrData); - -$gui->user = $args->user; -$gui->printDate = ''; -$gui->tproject_name = $tproject_info['name']; -$gui->tplan_name = $tplan_info['name']; -$gui->title = $args->title; -$gui->totalOpenBugs = $totalOpenBugs; -$gui->totalResolvedBugs = $totalResolvedBugs; -$gui->totalBugs = $totalBugs; -$gui->totalCasesWithBugs = $totalCasesWithBugs; -$gui->hint = $args->hint; - -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * Get links to bugs related to execution. - * @param $db - * @param $execID execution id - * @param $openBugsArray array to count open bugs - * @param $resolvedBugsArray array to count resolved bugs - * - * @return array List of links to related bugs - */ -function buildBugString(&$db,$execID,&$bugInterface,&$openBugsArray,&$resolvedBugsArray) -{ - $bugUrls = array(); - if ($bugInterface) - { - $bugs = get_bugs_for_exec($db,$bugInterface,$execID); - if ($bugs) - { - foreach($bugs as $bugID => $bugInfo) - { - if($bugInfo['isResolved']) - { - if(!in_array($bugID, $resolvedBugsArray)) - { - $resolvedBugsArray[] = $bugID; - } - } - else - { - if(!in_array($bugID, $openBugsArray)) - { - $openBugsArray[] = $bugID; - } - } - $bugUrls[] = $bugInfo['link_to_bts']; - } - } - } - return $bugUrls; -} - -/** - * get Columns definition for table to display - * - */ -function getColumnsDefinition() -{ - $colDef = array(); - - $colDef[] = array('title_key' => 'title_test_suite_name', 'width' => 30, 'type' => 'text'); - $colDef[] = array('title_key' => 'title_test_case_title', 'width' => 30, 'type' => 'text'); - $colDef[] = array('title_key' => 'title_test_case_bugs', 'width' => 40, 'type' => 'text'); - - return $colDef; -} - - -/* - function: init_args() - - args : - - returns: - -*/ -function init_args() -{ - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "type" => array(tlInputParameter::INT_N) ); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - $args->tproject_id = intval($_SESSION['testprojectID']); - $args->user = $_SESSION['currentUser']; - - switch($args->type) - { - case 1: - $args->verboseType = 'all'; - $args->title = lang_get('link_report_total_bugs_all_exec'); - $args->hint = lang_get('link_report_total_bugs_all_exec'); - break; - - default: - case 0: - $args->verboseType = 'latest'; - $args->title = lang_get('link_report_total_bugs'); - $args->hint = ''; - break; - } - return $args; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/resultsByStatus.php b/lib/results/resultsByStatus.php index 3d2b6cc677..8fe79cb62e 100644 --- a/lib/results/resultsByStatus.php +++ b/lib/results/resultsByStatus.php @@ -1,950 +1,1026 @@ -statusCode; - -$tplan_mgr = new testplan($db); -$tcase_mgr = new testcase($db); - -$gui = initializeGui($db,$args,$tplan_mgr); -$its = &$gui->its; -$labels = &$gui->labels; - -$testCaseCfg = config_get('testcase_cfg'); -$metrics = getMetrics($db,$args,$gui); - -$cfOnExec = $cfSet = null; - -// done here in order to get some config about images -$smarty = new TLSmarty(); -if (!is_null($metrics) and count($metrics) > 0) { - if ($args->addOpAccess) { - $links = featureLinks($labels,$smarty->getImages()); - } - - - $userAccessKey = $gui->userAccessKey; - $notesAccessKey = $gui->notesAccessKey; - - $urlSafeString = array(); - $urlSafeString['tprojectPrefix'] = urlencode($gui->tproject_info['prefix']); - $urlSafeString['basehref'] = str_replace(" ", "%20", $args->basehref); - - $out = array(); - $users = getUsersForHtmlOptions($db); - $pathCache = $topCache = $levelCache = null; - $nameCache = initNameCache($gui); - - $odx = 0; - - if( $args->type != $statusCode['not_run'] ) { - // get Custom fields definition to understand columns to be added - $cfSet = $tcase_mgr->cfield_mgr->get_linked_cfields_at_execution($args->tproject_id,true,'testcase'); - $execSet = array_keys($metrics); - - - // go for Custom fields values of all executions on ONE SHOT! - $cfOnExec = $tcase_mgr->cfield_mgr->get_linked_cfields_at_execution($args->tproject_id,true,'testcase',null,$execSet); - } - - - foreach($metrics as $execID => &$exec) { - // --------------------------------------------------------------------- - // do some decode work, using caches - if (!isset($pathCache[$exec['tcase_id']])) { - $dummy = $tcase_mgr->getPathLayered(array($exec['tcase_id'])); - $pathCache[$exec['tcase_id']] = $dummy[$exec['tsuite_id']]['value']; - $levelCache[$exec['tcase_id']] = $dummy[$exec['tsuite_id']]['level']; - $ky = current(array_keys($dummy)); - $topCache[$exec['tcase_id']] = $ky; - } - - - // ------------------------------------------------------------------------- - // IMPORTANT NOTICE: - // When test case has been runned, version must be get from - // executions.tcversion_number - // - // Column ORDER IS CRITIC - // suiteName - // testTitle CCA-15708: RSRSR-150 - // testVersion 1 - - // @20191128 - // We will adde test version summary ONLY if OUTPUT is - // Spreadsheet - - // platformName XXXX <<< ONlY is platforms have been used on - // Test plan under analisys - // - // buildName 2.0 <<< At least when platforms ARE NOT USED, - // <<< BY DEFAULT build is not displayed as - // column but used to group results. - // testerName yyyyyy - // localizedTS 2012-04-25 12:14:55 <<<< ONLY if executed - // notes [empty string] (execution notes) - // bugString [empty string] <<<< ONLY if executed - // - $out[$odx]['suiteName'] = $pathCache[$exec['tcase_id']]; - - // ------------------------------------------------------------------------- - $zipper = ''; - switch ($args->format) { - case FORMAT_HTML: - $out[$odx]['testTitle'] = ""; - $zipper = ''; - if ($args->addOpAccess) { - $out[$odx]['testTitle'] .= sprintf($links['full'], - $exec['tcase_id'],$exec['tcase_id'],$exec['tcversion_id'], - $exec['build_id'],$args->tplan_id,$exec['platform_id'],$exec['tcase_id']); - $zipper = ''; - } - break; - - case FORMAT_XLS: - $out[$odx]['testTitle'] = ''; - break; - - default: - $out[$odx]['testTitle'] = ''; - $zipper = ''; - break; - - } - - // See IMPORTANT NOTICE/WARNING about XLS generation - $out[$odx]['testTitle'] .= $exec['full_external_id'] . ':' . - $exec['name'] .$zipper; - - $out[$odx]['testVersion'] = $exec['tcversion_number']; - - switch ($args->format) { - case FORMAT_XLS: - $out[$odx]['summary'] = $exec['summary']; - break; - - case FORMAT_HTML: - default: - break; - } - - // Insert order on out is CRITIC, because order is used on buildMatrix - if($gui->show_platforms) { - $out[$odx]['platformName'] = $nameCache['platform'][$exec['platform_id']]; - } - - $out[$odx]['buildName'] = $nameCache['build'][$exec['build_id']]; - - // ------------------------------------------------------------------------ - // verbose user - if( $args->type == $statusCode['not_run'] ) - { - natsort($exec[$userAccessKey]); - $zux = array(); - foreach ($exec[$userAccessKey] as $vux) - { - if(isset($users,$vux)) - { - $zux[] = htmlspecialchars($users[$vux]); - } - else - { - // user id has been disable/deleted - $zux[] = sprintf($labels['deleted_user'],$vux); - } - } - $out[$odx]['testerName'] = implode(',',$zux); - } - else - { - if($exec[$userAccessKey] == 0 ) - { - $out[$odx]['testerName'] = $labels['nobody']; - } - else - { - if(isset($users,$exec[$userAccessKey])) - { - $out[$odx]['testerName'] = htmlspecialchars($users[$exec[$userAccessKey]]); - } - else - { - // user id has been disable/deleted - $out[$odx]['testerName'] = sprintf($labels['deleted_user'],$exec[$userAccessKey]); - } - } - } - $out[$odx]['testerName'] = htmlspecialchars($out[$odx]['testerName']); - - // ------------------------------------------------------------------------- - if( $args->type != $statusCode['not_run'] ) - { - $out[$odx]['localizedTS'] = $exec['execution_ts']; - } - $out[$odx]['notes'] = strip_tags($exec[$notesAccessKey]); - - if( $args->type != $statusCode['not_run'] ) - { - if(!is_null($cfSet)) - { - // Need to document how important is value of second index on - // $out[$odx][SECOND INDEX] - foreach($cfSet as $cfID => $cfValue) - { - if(isset($cfOnExec[$execID][$cfID]) && !is_null($cfOnExec[$execID][$cfID])) - { - $out[$odx][$cfID] = $tcase_mgr->cfield_mgr->string_custom_field_value($cfOnExec[$execID][$cfID],null); - } - else - { - $out[$odx][$cfID] = ''; - } - } - } - - // ------------------------------------------------------------------------ - // Bug processing. - // Remember that bugs are linked to executions NOT test case. - // When using Platforms a Test Case can have multiple executions - // (N on each platform). - // ------------------------------------------------------------------------ - $bugString = ''; - if($gui->bugInterfaceOn && $exec['status'] != $statusCode['not_run']) - { - $bugSet = get_bugs_for_exec($db, $its, $exec['executions_id'],array('id','summary')); - if (count($bugSet) == 0) - { - $gui->without_bugs_counter += 1; - } - - switch($args->format) - { - case FORMAT_XLS: - // See IMPORTANT NOTICE/WARNING about XLS generation - foreach($bugSet as $bug) - { - $bugString .= $bug['id'] . ':' . $bug['summary'] . "\r"; - } - break; - - default: - foreach($bugSet as $bug) - { - $bugString .= $bug['link_to_bts'] . '
    '; - } - break; - } - unset($bugSet); - } - $out[$odx]['bugString'] = $bugString; - } - $odx++; - } - $gui->dataSet = $out; - unset($out); -} else { - $gui->warning_msg = getWarning($args->type,$statusCode); -} - -switch ($args->format) { - case FORMAT_XLS: - createSpreadsheet($gui,$args,$args->getSpreadsheetBy,$cfSet); - break; - - default: - $tableOpt = [ - 'status_not_run' => ($args->type == $statusCode['not_run']), - 'bugInterfaceOn' => $gui->bugInterfaceOn, - 'format' => $args->format, - 'show_platforms' => $gui->show_platforms - ]; - - $gui->tableSet[] = buildMatrix($gui->dataSet, $args, $tableOpt , - $gui->platformSet,$cfSet); - break; -} - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui ); -displayReport($tplCfg->template_dir . $tplCfg->default_template, - $smarty, $args->format, $gui->mailCfg); - - -/** - * - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - "type" => array(tlInputParameter::STRING_N,0,1)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->getSpreadsheetBy = isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; - if( is_null($args->getSpreadsheetBy) ) { - $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? 'download' : null; - } - - $args->addOpAccess = true; - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } else { - testlinkInitPage($dbHandler,true,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - - $rCfg = config_get('results'); - $args->statusCode = $rCfg['status_code']; - - $args->user = $_SESSION['currentUser']; - $args->basehref = $_SESSION['basehref']; - return $args; +statusCode; + +$tplan_mgr = new testplan($db); +$tcaseMgr = new testcase($db); + +$gui = initializeGui($db, $args, $tplan_mgr); +$its = &$gui->its; +$labels = &$gui->labels; + +$testCaseCfg = config_get('testcase_cfg'); +$metrics = getMetrics($db, $args, $gui); + +$cfOnExec = $cfSet = null; + +// done here in order to get some config about images +$smarty = new TLSmarty(); +if (! is_null($metrics) && ! empty($metrics)) { + if ($args->addOpAccess) { + $links = featureLinks($labels, $smarty->getImages()); + } + + $userAccessKey = $gui->userAccessKey; + $notesAccessKey = $gui->notesAccessKey; + + $urlSafeString = array(); + $urlSafeString['tprojectPrefix'] = urlencode($gui->tproject_info['prefix']); + $urlSafeString['basehref'] = str_replace(" ", "%20", $args->basehref); + + $out = array(); + $users = getUsersForHtmlOptions($db); + $pathCache = null; + $nameCache = initNameCache($gui); + + $odx = 0; + + if ($args->type != $statusCode['not_run']) { + // get Custom fields definition to understand columns to be added + $cfSet = $tcaseMgr->cfield_mgr->get_linked_cfields_at_execution( + $args->tproject_id, true, 'testcase'); + $execSet = array_keys($metrics); + + // go for Custom fields values of all executions on ONE SHOT! + $cfOnExec = $tcaseMgr->cfield_mgr->get_linked_cfields_at_execution( + $args->tproject_id, true, 'testcase', null, $execSet); + } + + foreach ($metrics as $execID => &$exec) { + // --------------------------------------------------------------------- + // do some decode work, using caches + if (! isset($pathCache[$exec['tcase_id']])) { + $dummy = $tcaseMgr->getPathLayered(array( + $exec['tcase_id'] + )); + $pathCache[$exec['tcase_id']] = $dummy[$exec['tsuite_id']]['value']; + $levelCache[$exec['tcase_id']] = $dummy[$exec['tsuite_id']]['level']; + $ky = current(array_keys($dummy)); + $topCache[$exec['tcase_id']] = $ky; + } + + // ------------------------------------------------------------------------- + // IMPORTANT NOTICE: + // When test case has been runned, version must be get from + // executions.tcversion_number + // + // Column ORDER IS CRITIC + // suiteName + // testTitle CCA-15708: RSRSR-150 + // testVersion 1 + + // @20191128 + // We will adde test version summary ONLY if OUTPUT is + // Spreadsheet + + // platformName XXXX <<< ONlY is platforms have been used on + // Test plan under analisys + // + // buildName 2.0 <<< At least when platforms ARE NOT USED, + // <<< BY DEFAULT build is not displayed as + // column but used to group results. + // testerName yyyyyy + // localizedTS 2012-04-25 12:14:55 <<<< ONLY if executed + // notes [empty string] (execution notes) + // bugString [empty string] <<<< ONLY if executed + // + $out[$odx]['suiteName'] = $pathCache[$exec['tcase_id']]; + + // ------------------------------------------------------------------------- + $zipper = ''; + switch ($args->format) { + case FORMAT_HTML: + $out[$odx]['testTitle'] = ""; + $zipper = ''; + if ($args->addOpAccess) { + $out[$odx]['testTitle'] .= sprintf($links['full'], + $exec['tcase_id'], $exec['tcase_id'], + $exec['tcversion_id'], $exec['build_id'], + $args->tplan_id, $exec['platform_id'], $exec['tcase_id']); + $zipper = ''; + } + break; + + case FORMAT_XLS: + $out[$odx]['testTitle'] = ''; + break; + + default: + $out[$odx]['testTitle'] = ''; + $zipper = ''; + break; + } + + // See IMPORTANT NOTICE/WARNING about XLS generation + $out[$odx]['testTitle'] .= $exec['full_external_id'] . ':' . + $exec['name'] . $zipper; + + $out[$odx]['testVersion'] = $exec['tcversion_number']; + + switch ($args->format) { + case FORMAT_XLS: + $out[$odx]['summary'] = $exec['summary']; + break; + + case FORMAT_HTML: + default: + break; + } + + // Insert order on out is CRITIC, because order is used on buildMatrix + if ($gui->show_platforms) { + $out[$odx]['platformName'] = $nameCache['platform'][$exec['platform_id']]; + } + + $out[$odx]['buildName'] = $nameCache['build'][$exec['build_id']]; + + // ------------------------------------------------------------------------ + // verbose user + if ($args->type == $statusCode['not_run']) { + natsort($exec[$userAccessKey]); + $zux = array(); + foreach ($exec[$userAccessKey] as $vux) { + if (isset($users, $vux)) { + $zux[] = htmlspecialchars($users[$vux]); + } else { + // user id has been disable/deleted + $zux[] = sprintf($labels['deleted_user'], $vux); + } + } + $out[$odx]['testerName'] = implode(',', $zux); + } else { + if ($exec[$userAccessKey] == 0) { + $out[$odx]['testerName'] = $labels['nobody']; + } else { + if (isset($users, $exec[$userAccessKey])) { + $out[$odx]['testerName'] = htmlspecialchars( + $users[$exec[$userAccessKey]]); + } else { + // user id has been disable/deleted + $out[$odx]['testerName'] = sprintf($labels['deleted_user'], + $exec[$userAccessKey]); + } + } + } + $out[$odx]['testerName'] = htmlspecialchars($out[$odx]['testerName']); + + // ------------------------------------------------------------------------- + if ($args->type != $statusCode['not_run']) { + $out[$odx]['localizedTS'] = $exec['execution_ts']; + } + $out[$odx]['notes'] = strip_tags($exec[$notesAccessKey]); + + if ($args->type != $statusCode['not_run']) { + if (! is_null($cfSet)) { + // Need to document how important is value of second index on + // $out[$odx][SECOND INDEX] + foreach ($cfSet as $cfID => $cfValue) { + if (isset($cfOnExec[$execID][$cfID]) && + ! is_null($cfOnExec[$execID][$cfID])) { + $out[$odx][$cfID] = $tcaseMgr->cfield_mgr->string_custom_field_value( + $cfOnExec[$execID][$cfID], null); + } else { + $out[$odx][$cfID] = ''; + } + } + } + + // ------------------------------------------------------------------------ + // Bug processing. + // Remember that bugs are linked to executions NOT test case. + // When using Platforms a Test Case can have multiple executions + // (N on each platform). + // ------------------------------------------------------------------------ + $bugString = ''; + if ($gui->bugInterfaceOn && $exec['status'] != $statusCode['not_run']) { + $bugSet = get_bugs_for_exec($db, $its, $exec['executions_id'], + array( + 'id', + 'summary' + )); + if (count($bugSet) == 0) { + $gui->without_bugs_counter += 1; + } + + switch ($args->format) { + case FORMAT_XLS: + // See IMPORTANT NOTICE/WARNING about XLS generation + foreach ($bugSet as $bug) { + $bugString .= $bug['id'] . ':' . $bug['summary'] . + "\r"; + } + break; + + default: + foreach ($bugSet as $bug) { + $bugString .= $bug['link_to_bts'] . '
    '; + } + break; + } + unset($bugSet); + } + $out[$odx]['bugString'] = $bugString; + } + $odx ++; + } + $gui->dataSet = $out; + unset($out); +} else { + $gui->warning_msg = getWarning($args->type, $statusCode); +} + +switch ($args->format) { + case FORMAT_XLS: + createSpreadsheet($gui, $args, $cfSet); + break; + + default: + $tableOpt = [ + 'status_not_run' => ($args->type == $statusCode['not_run']), + 'bugInterfaceOn' => $gui->bugInterfaceOn, + 'format' => $args->format, + 'show_platforms' => $gui->show_platforms + ]; + + $gui->tableSet[] = buildMatrix($gui->dataSet, $args, $tableOpt, + $gui->platformSet, $cfSet); + break; +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($tplCfg->template_dir . $tplCfg->default_template, $smarty, + $args->format, $gui->mailCfg); + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + 1 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->getSpreadsheetBy = isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; + if (is_null($args->getSpreadsheetBy)) { + $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? 'download' : null; + } + + $args->addOpAccess = true; + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + $rCfg = config_get('results'); + $args->statusCode = $rCfg['status_code']; + + $args->user = $_SESSION['currentUser']; + $args->basehref = $_SESSION['basehref']; + return $args; +} + +/** + * initializeGui + */ +function initializeGui(&$dbh, &$argsObj, &$tplanMgr) +{ + $tprojectMgr = new testproject($dbh); + + $guiObj = new stdClass(); + + $guiObj->labels = init_labels( + array( + 'deleted_user' => null, + 'design' => null, + 'execution' => null, + 'nobody' => null, + 'execution_history' => null, + 'info_only_with_tester_assignment' => null, + 'th_bugs_not_linked' => null, + 'info_notrun_tc_report' => null, + 'info_xls_report_results_by_status' => null + )); + + $guiObj->report_context = $guiObj->labels['info_only_with_tester_assignment']; + $guiObj->info_xls_report = $guiObj->labels['info_xls_report_results_by_status']; + + $guiObj->info_msg = ''; + $guiObj->bugs_msg = ''; + + $guiObj->tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->tproject_info = $tprojectMgr->get_by_id($argsObj->tproject_id); + $guiObj->tplan_name = $guiObj->tplan_info['name']; + $guiObj->tproject_name = $guiObj->tproject_info['name']; + + $guiObj->format = $argsObj->format; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->apikey = $argsObj->apikey; + + // Count for the Failed Issues whose bugs have to be raised/not linked. + $guiObj->without_bugs_counter = 0; + $guiObj->dataSet = null; + $guiObj->title = null; + $guiObj->type = $argsObj->type; + $guiObj->warning_msg = ''; + + // Implementation based on convention, will use only keys starting with 'list_tc_' + // see reports.cfg.php + $reportCfg = config_get('reports_list'); + + $lbl_th_bugs_not_linked = lang_get('th_bugs_not_linked'); + $needle = 'list_tc_'; + $nl = strlen($needle); + foreach ($reportCfg as $key => $val) { + $checkIt = false; + if ($checkIt = (strpos($key, $needle) !== false)) { + // now get the verbose status + // list_tc_[verbose_status], example list_tc_not_run + $verbose_status = substr($key, $nl); + + // if( $verbose_status != 'not_run' || $verbose_status != 'passed' ) + $guiObj->bugs_msg = $lbl_th_bugs_not_linked; + if (isset($reportCfg[$key]['misc']) && + isset($reportCfg[$key]['misc']['bugs_not_linked']) && + ! $reportCfg[$key]['misc']['bugs_not_linked']) { + $guiObj->bugs_msg = ''; + } + } + + if ($checkIt && $argsObj->type == $argsObj->statusCode[$verbose_status]) { + $guiObj->title = lang_get('list_of_' . $verbose_status); + break; + } + } + + if (is_null($guiObj->title)) { + tlog('wrong value of GET type'); + exit(); + } + + $guiObj->buildSet = (array) $tplanMgr->get_builds_for_html_options( + $argsObj->tplan_id); + + // needed to decode + $getOpt = [ + 'outputFormat' => 'map' + ]; + $guiObj->platformSet = (array) $tplanMgr->getPlatforms($argsObj->tplan_id, + $getOpt); + $guiObj->show_platforms = count($guiObj->platformSet); + + $guiObj->its = null; // Issue Tracker System + $info = $tprojectMgr->get_by_id($argsObj->tproject_id); + $guiObj->bugInterfaceOn = $info['issue_tracker_enabled']; + if ($info['issue_tracker_enabled']) { + $it_mgr = new tlIssueTracker($dbh); + $guiObj->its = $it_mgr->getInterfaceObject($argsObj->tproject_id); + unset($it_mgr); + } + + $guiObj->mailCfg = buildMailCfg($guiObj); + + return $guiObj; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * Builds ext-js rich table to display matrix results + * + * @param array $dataSet + * data to be displayed on matrix + * @param stdClass $args + * @param array $options + * @param array $platforms + * @param array $customFieldColumns + * @return tlExtTable|tlHTMLTable + */ +function buildMatrix($dataSet, &$args, $options = [], $platforms = null, + $customFieldColumns = null) +{ + $default_options = [ + 'bugInterfaceOn' => false, + 'show_platforms' => false, + 'status_not_run' => false, + 'format' => FORMAT_HTML + ]; + + $options = array_merge($default_options, $options); + + $l18n = init_labels( + [ + 'assigned_to' => null, + 'platform' => null, + 'th_date' => null, + 'th_build' => null + ]); + + $columns = []; + $columns[] = [ + 'title_key' => 'title_test_suite_name', + 'width' => 80 + ]; + $columns[] = [ + 'title_key' => 'title_test_case_title', + 'width' => 80 + ]; + $columns[] = [ + 'title_key' => 'version', + 'width' => 30 + ]; + + if ($options['show_platforms']) { + $columns[] = [ + 'title_key' => 'platform', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $platforms + ]; + } + + $columns[] = [ + 'title_key' => 'th_build', + 'width' => 35 + ]; + if ($options['status_not_run']) { + $columns[] = [ + 'title_key' => 'assigned_to', + 'width' => 60 + ]; + $columns[] = [ + 'title_key' => 'summary', + 'width' => 150, + 'type' => 'textArea' // This will attach a custom behaivour + // defined in exttable.class.php + ]; + } else { + $columns[] = [ + 'title_key' => 'th_run_by', + 'width' => 60 + ]; + $columns[] = [ + 'title_key' => 'th_date', + 'width' => 60 + ]; + $columns[] = [ + 'title_key' => 'title_execution_notes', + 'width' => 150, + 'type' => 'notes' // This will attach a custom behaivour + // defined in exttable.class.php + ]; + + if (! is_null($customFieldColumns)) { + foreach ($customFieldColumns as $def) { + $columns[] = [ + 'title' => $def['label'], + 'width' => 60 + ]; + } + } + + if ($options['bugInterfaceOn']) { + $columns[] = [ + 'title_key' => 'th_bugs_id_summary', + 'type' => 'issueSummary' + ]; + } + } + + if ($options['format'] == FORMAT_HTML) { + + // IMPORTANT DEVELOPMENT NOTICE + // columns and dataSet are deeply related this means that inside + // dataSet order has to be identical that on columns or table will be a disaster + // + $matrix = new tlExtTable($columns, $dataSet, + 'tl_table_results_by_status'); + + // if not run report: sort by test suite + // blocked, failed report: sort by platform (if enabled) else sort by date + $sort_name = 0; + if ($options['status_not_run']) { + $sort_name = $l18n['assigned_to']; + } else { + $sort_name = $options['show_platforms'] ? $l18n['platform'] : $l18n['th_date']; + } + + $matrix->setSortByColumnName($sort_name); + $matrix->setGroupByColumnName($l18n['th_build']); + + // define table toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + } else { + $matrix = new tlHTMLTable($columns, $dataSet, + 'tl_table_results_by_status'); + } + return $matrix; +} + +/** + * + * @param array $lbl + * @param array $img + * @return string[] + */ +function featureLinks($lbl, $img) +{ + $links = array(); + + // %s => test case id + $links['exec_history'] = '' . + ' '; + + // tcase_id,tcversion_id,build_id,tplan_id,platform_id + $links['exec'] = '' . + ' '; + + // %s => test case id + $links['edit'] = '' . + ' '; + + $links['full'] = $links['exec_history'] . $links['exec'] . $links['edit']; + + return $links; +} + +/** + * + * @param stdClass $guiObj + * @return array + */ +function initNameCache($guiObj) +{ + $safeItems = array( + 'build' => null, + 'platform' => null + ); + + foreach ($guiObj->buildSet as $id => $name) { + $safeItems['build'][$id] = htmlspecialchars($name); + } + + if ($guiObj->show_platforms) { + foreach ($guiObj->platformSet as $id => $name) { + $safeItems['platform'][$id] = htmlspecialchars($name); + } + } + + return $safeItems; +} + +/** + * + * @param String $targetStatus + * @param array $statusCfg + * @return array + */ +function getWarning($targetStatus, $statusCfg) +{ + $msg = ''; + $key2check = array( + 'not_run', + 'failed', + 'blocked' + ); + foreach ($key2check as $statusVerbose) { + if ($targetStatus == $statusCfg[$statusVerbose]) { + $msg = lang_get('no_' . $statusVerbose . '_with_tester'); + break; + } + } + return $msg; +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + * @param string $media + * @param array $customFieldColumns + */ +function createSpreadsheet($gui, $args, $customFieldColumns = null) +{ + $lbl = initLblSpreadsheet(); + $cellRange = range('A', 'Z'); + $style = initStyleSpreadsheet(); + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + // Step 2 + // data is organized with following columns$dataHeader[] + // Test suite + // Test case + // Version + // Test case summary + // [Platform] + // Build + // Tester + // Date + // Execution notes + // [Custom Field ENABLED ON EXEC 1] + // [Custom Field ENABLED ON EXEC 1] + // [Custom Field ENABLED ON EXEC 1] + // [bugString] only if bugtracking integration exists for this test project + + // This is HOW gui->dataSet is organized + // THIS IS CRITIC ?? + // + // suiteName Issue Tracker Management + // testTitle PTRJ-76:Create issue tracker - no conflict + // testVersion 1 + // bla,bla,bla,.... + // [platformName] + // buildName 1.0 + // testerName admin + // localizedTS 2013-03-28 20:15:06 + // notes [empty string] + // bugString [empty string] + + // + $dataHeader = array( + $lbl['title_test_suite_name'], + $lbl['title_test_case_title'], + $lbl['version'], + $lbl['summary'] + ); + + // if( $showPlatforms = ( property_exists($gui,'platformSet') && !is_null($gui->platformSet) && !isset($gui->platformSet[0])) ) + if (property_exists($gui, 'platformSet') && ! is_null($gui->platformSet) && + ! isset($gui->platformSet[0])) { + $dataHeader[] = $lbl['platform']; + } + + $dataHeader[] = $lbl['build']; + + if ($gui->notRunReport) { + $dataHeader[] = $lbl['assigned_to']; + $dataHeader[] = $lbl['summary']; + } else { + $dataHeader[] = $lbl['th_run_by']; + $dataHeader[] = $lbl['th_date']; + $dataHeader[] = $lbl['title_execution_notes']; + } + + if (! is_null($customFieldColumns)) { + foreach ($customFieldColumns as $def) { + $dataHeader[] = $def['label']; + } + } + + // ATTENTION logic regarding NOT RUN IS MISSING + // For not run this column and also columns regarding CF on exec are not displayed + if ($gui->bugInterfaceOn && ! $gui->notRunReport) { + $dataHeader[] = $lbl['th_bugs_id_summary']; + } + + $startingRow = count($lines2write) + 2; // MAGIC + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + // Now process data + $startingRow ++; + $qta_loops = count($gui->dataSet); + for ($idx = 0; $idx < $qta_loops; $idx ++) { + $colCounter = 0; + foreach ($gui->dataSet[$idx] as $ldx => $field) { + if ($ldx != 'bugString' || + ($ldx == 'bugString' && $gui->bugInterfaceOn)) { + $cellID = $cellRange[$colCounter] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + html_entity_decode($field)); + $colCounter ++; + } + + // May be same processing can be applied to execution otes + if ($ldx == 'bugString' && $gui->bugInterfaceOn) { + // To manage new line + // http://stackoverflow.com/questions/5960242/how-to-make-new-lines-in-a-cell-using-phpexcel + // http://stackoverflow.com/questions/6054444/how-to-set-auto-height-in-phpexcel + $objPHPExcel->setActiveSheetIndex(0) + ->getStyle($cellID) + ->getAlignment() + ->setWrapText(true); + } + } + $startingRow ++; + } + + // Final step + $objPHPExcel->setActiveSheetIndex(0); + + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + + $tmpfname = tempnam(config_get('temp_dir'), "resultsByStatus.tmp"); + $objWriter->save($tmpfname); + + if ($args->getSpreadsheetBy == 'email') { + require_once 'email_api.php'; + $ema = new stdClass(); + $ema->from_address = config_get('from_email'); + $ema->to_address = $args->user->emailAddress; + $ema->subject = $gui->mailCfg->subject; + $ema->message = $gui->mailCfg->subject; + + $dum = uniqid("resultsByStatus_") . '.xls'; + $oops = array( + 'attachment' => array( + 'file' => $tmpfname, + 'newname' => $dum + ), + 'exit_on_error' => true, + 'htmlFormat' => true + ); + $email_op = email_send_wrapper($ema, $oops); + unlink($tmpfname); + exit(); + } else { + downloadXls($tmpfname, $xlsType, $gui, 'resultsByStatus_'); + } +} + +/** + * + * @param database $dbh + * @param stdClass $args + * @param stdClass $gui + * @return array + */ +function getMetrics(&$dbh, &$args, &$gui) +{ + $resultsCfg = config_get('results'); + $statusCode = $resultsCfg['status_code']; + $metricsMgr = new tlTestPlanMetrics($dbh); + + if ($args->type == $statusCode['not_run']) { + $opt = array( + 'output' => 'array' + ); + if ($args->format == FORMAT_XLS) { + $opt['add2fields'] = 'TCV.summary'; + } + + $met = $metricsMgr->getNotRunWithTesterAssigned($args->tplan_id, null, + $opt); + + $gui->notRunReport = true; + $gui->info_msg = $gui->labels['info_notrun_tc_report']; + $gui->notesAccessKey = 'summary'; + $gui->userAccessKey = 'user_id'; + } else { + $opt = array( + 'output' => 'mapByExecID', + 'getOnlyAssigned' => true + ); + if ($args->format == FORMAT_XLS) { + $opt['add2fields'] = 'TCV.summary'; + } + + $met = $metricsMgr->getExecutionsByStatus($args->tplan_id, $args->type, + null, $opt); + + $gui->notRunReport = false; + $gui->info_msg = lang_get( + 'info_' . $resultsCfg['code_status'][$args->type] . '_tc_report'); + + $gui->notesAccessKey = 'execution_notes'; + $gui->userAccessKey = 'tester_id'; + } + + return $met; +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'title_test_suite_name' => null, + 'platform' => null, + 'build' => null, + 'th_bugs_id_summary' => null, + 'title_test_case_title' => null, + 'version' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'testplan' => null, + 'title_execution_notes' => null, + 'th_date' => null, + 'th_run_by' => null, + 'assigned_to' => null, + 'summary' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $sty = array(); + $sty['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $sty['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + return $sty; +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne($oj, $style, $lbl, $gui) +{ + $dummy = ''; + $lines2write = array( + array( + $gui->title, + '' + ), + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ), + array( + $gui->report_context, + '' + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + $cellArea .= "A[$cdx]"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; } - -/** - * initializeGui - * - */ -function initializeGui(&$dbh,&$argsObj,&$tplanMgr) -{ - $tprojectMgr = new testproject($dbh); - - $guiObj = new stdClass(); - - $guiObj->labels = init_labels( - array('deleted_user' => null, 'design' => null, - 'execution' => null,'nobody' => null, - 'execution_history' => null, - 'info_only_with_tester_assignment' => null, - 'th_bugs_not_linked' => null, - 'info_notrun_tc_report' => null, - 'info_xls_report_results_by_status' => null)); - - $guiObj->report_context = $guiObj->labels['info_only_with_tester_assignment']; - $guiObj->info_xls_report = - $guiObj->labels['info_xls_report_results_by_status']; - - $guiObj->info_msg = ''; - $guiObj->bugs_msg = ''; - - $guiObj->tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->tproject_info = $tprojectMgr->get_by_id($argsObj->tproject_id); - $guiObj->tplan_name = $guiObj->tplan_info['name']; - $guiObj->tproject_name = $guiObj->tproject_info['name']; - - - $guiObj->format = $argsObj->format; - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->apikey = $argsObj->apikey; - - // Count for the Failed Issues whose bugs have to be raised/not linked. - $guiObj->without_bugs_counter = 0; - $guiObj->dataSet = null; - $guiObj->title = null; - $guiObj->type = $argsObj->type; - $guiObj->warning_msg = ''; - - - // Implementation based on convention, will use only keys starting with 'list_tc_' - // see reports.cfg.php - $reportCfg = config_get('reports_list'); - - $lbl_th_bugs_not_linked = lang_get('th_bugs_not_linked'); - $needle = 'list_tc_'; - $nl = strlen($needle); - foreach( $reportCfg as $key => $val ) - { - $checkIt = false; - if( $checkIt = (strpos($key,$needle) !== FALSE) ) - { - // now get the verbose status - // list_tc_[verbose_status], example list_tc_not_run - $verbose_status = substr($key, $nl); - - // if( $verbose_status != 'not_run' || $verbose_status != 'passed' ) - $guiObj->bugs_msg = $lbl_th_bugs_not_linked; - if( isset($reportCfg[$key]['misc']) ) - { - if( isset($reportCfg[$key]['misc']['bugs_not_linked']) && - $reportCfg[$key]['misc']['bugs_not_linked'] == false ) - { - $guiObj->bugs_msg = ''; - } - } - } - - if( $checkIt ) - { - if($argsObj->type == $argsObj->statusCode[$verbose_status]) - { - $guiObj->title = lang_get('list_of_' . $verbose_status); - break; - } - } - } - - if(is_null($guiObj->title)) - { - tlog('wrong value of GET type'); - exit(); - } - - $guiObj->buildSet = (array)$tplanMgr->get_builds_for_html_options($argsObj->tplan_id); - - // needed to decode - $getOpt = ['outputFormat' => 'map']; - $guiObj->platformSet = (array)$tplanMgr->getPlatforms($argsObj->tplan_id,$getOpt); - $guiObj->show_platforms = count($guiObj->platformSet); - // - - $guiObj->its = null; // Issue Tracker System - $info = $tprojectMgr->get_by_id($argsObj->tproject_id); - $guiObj->bugInterfaceOn = $info['issue_tracker_enabled']; - if($info['issue_tracker_enabled']) - { - $it_mgr = new tlIssueTracker($dbh); - $guiObj->its = $it_mgr->getInterfaceObject($argsObj->tproject_id); - unset($it_mgr); - } - - $guiObj->mailCfg = buildMailCfg($guiObj); - - return $guiObj; - -} - - - -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) -{ - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * Builds ext-js rich table to display matrix results - * - * @param map dataSet: data to be displayed on matrix - * - * return tlExtTable - * - */ -function buildMatrix($dataSet, &$args, $options = [], $platforms = null,$customFieldColumns=null) -{ - $default_options = [ - 'bugInterfaceOn' => false, - 'show_platforms' => false, - 'status_not_run' => false, - 'format' => FORMAT_HTML - ]; - - $options = array_merge($default_options, $options); - - $l18n = init_labels([ - 'assigned_to' => null, - 'platform' => null, - 'th_date' => null, - 'th_build' => null - ]); - - - - $columns = []; - $columns[] = [ - 'title_key' => 'title_test_suite_name', - 'width' => 80 - ]; - $columns[] = [ - 'title_key' => 'title_test_case_title', - 'width' => 80 - ]; - $columns[] = [ - 'title_key' => 'version', - 'width' => 30 - ]; - - if ($options['show_platforms']) { - $columns[] = [ - 'title_key' => 'platform', - 'width' => 60, - 'filter' => 'list', - 'filterOptions' => $platforms - ]; - } - - $columns[] = [ - 'title_key' => 'th_build', - 'width' => 35 - ]; - if( $options['status_not_run'] ) { - $columns[] = [ - 'title_key' => 'assigned_to', - 'width' => 60 - ]; - $columns[] = [ - 'title_key' => 'summary', - 'width' => 150, - 'type' => 'textArea' // This will attach a custom behaivour - // defined in exttable.class.php - ]; - } else { - $columns[] = [ - 'title_key' => 'th_run_by', - 'width' => 60 - ]; - $columns[] = [ - 'title_key' => 'th_date', - 'width' => 60 - ]; - $columns[] = [ - 'title_key' => 'title_execution_notes', - 'width' => 150, - 'type' => 'notes' // This will attach a custom behaivour - // defined in exttable.class.php - ]; - - if(!is_null($customFieldColumns)) { - foreach($customFieldColumns as $id => $def) { - $columns[] = [ - 'title' => $def['label'], - 'width' => 60 - ]; - } - } - - if ($options['bugInterfaceOn']) - { - $columns[] = [ - 'title_key' => 'th_bugs_id_summary', - 'type' => 'issueSummary' - ]; - } - } - - - if ($options['format'] == FORMAT_HTML) - { - - // IMPORTANT DEVELOPMENT NOTICE - // columns and dataSet are deeply related this means that inside - // dataSet order has to be identical that on columns or table will be a disaster - // - $matrix = new tlExtTable($columns, $dataSet, 'tl_table_results_by_status'); - - //if not run report: sort by test suite - //blocked, failed report: sort by platform (if enabled) else sort by date - $sort_name = 0; - if ($options['status_not_run']) - { - $sort_name = $l18n['assigned_to']; - } - else - { - $sort_name = $options['show_platforms'] ? $l18n['platform'] : $l18n['th_date']; - } - - $matrix->setSortByColumnName($sort_name); - $matrix->setGroupByColumnName($l18n['th_build']); - - // define table toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - } - else - { - $matrix = new tlHTMLTable($columns, $dataSet, 'tl_table_results_by_status'); - } - return $matrix; -} - - -/** - * - */ -function featureLinks($lbl,$img) -{ - $links = array(); - - // %s => test case id - $links['exec_history'] = '' . - ' '; - - // tcase_id,tcversion_id,build_id,tplan_id,platform_id - $links['exec'] = '' . - ' '; - - // %s => test case id - $links['edit'] = '' . - ' '; - - - $links['full'] = $links['exec_history'] . $links['exec'] . $links['edit']; - - return $links; -} - - -/** - * - */ -function initNameCache($guiObj) -{ - $safeItems = array('build' => null, 'platform' => null); - - foreach($guiObj->buildSet as $id => $name) - { - $safeItems['build'][$id] = htmlspecialchars($name); - } - - if($guiObj->show_platforms) - { - foreach($guiObj->platformSet as $id => $name) - { - $safeItems['platform'][$id] = htmlspecialchars($name); - } - } - - return $safeItems; -} - -/** - * - */ -function getWarning($targetStatus,$statusCfg) -{ - $msg = ''; - $key2check = array('not_run','failed','blocked'); - foreach($key2check as $statusVerbose) - { - if( $targetStatus == $statusCfg[$statusVerbose] ) - { - $msg = lang_get('no_' . $statusVerbose . '_with_tester'); - break; - } - } - return $msg; -} - -/** - * - */ -function createSpreadsheet($gui,$args,$media,$customFieldColumns=null) -{ - $lbl = initLblSpreadsheet(); - $cellRange = range('A','Z'); - $style = initStyleSpreadsheet(); - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - // Step 2 - // data is organized with following columns$dataHeader[] - // Test suite - // Test case - // Version - // Test case summary - // [Platform] - // Build - // Tester - // Date - // Execution notes - // [Custom Field ENABLED ON EXEC 1] - // [Custom Field ENABLED ON EXEC 1] - // [Custom Field ENABLED ON EXEC 1] - // [bugString] only if bugtracking integration exists for this test project - - // This is HOW gui->dataSet is organized - // THIS IS CRITIC ?? - // - // suiteName Issue Tracker Management - // testTitle PTRJ-76:Create issue tracker - no conflict - // testVersion 1 - // bla,bla,bla,.... - // [platformName] - // buildName 1.0 - // testerName admin - // localizedTS 2013-03-28 20:15:06 - // notes [empty string] - // bugString [empty string] - - // - $dataHeader = - array($lbl['title_test_suite_name'],$lbl['title_test_case_title'], - $lbl['version'],$lbl['summary']); - - if( $showPlatforms = ( property_exists($gui,'platformSet') && !is_null($gui->platformSet) && - !isset($gui->platformSet[0])) ) { - $dataHeader[] = $lbl['platform']; - } - - $dataHeader[] = $lbl['build']; - - if ($gui->notRunReport) { - $dataHeader[] = $lbl['assigned_to']; - $dataHeader[] = $lbl['summary']; - } else { - $dataHeader[] = $lbl['th_run_by']; - $dataHeader[] = $lbl['th_date']; - $dataHeader[] = $lbl['title_execution_notes']; - } - - - if(!is_null($customFieldColumns)) { - foreach($customFieldColumns as $id => $def) { - $dataHeader[] = $def['label']; - } - } - - // ATTENTION logic regarding NOT RUN IS MISSING - // For not run this column and also columns regarding CF on exec are not displayed - if( $gui->bugInterfaceOn && !$gui->notRunReport) { - $dataHeader[] = $lbl['th_bugs_id_summary']; - } - - $startingRow = count($lines2write) + 2; // MAGIC - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - // Now process data - $startingRow++; - $qta_loops = count($gui->dataSet); - for ($idx = 0; $idx < $qta_loops; $idx++) { - $line2write = $gui->dataSet[$idx]; - $colCounter = 0; - foreach($gui->dataSet[$idx] as $ldx => $field) { - if( $ldx != 'bugString' || ($ldx == 'bugString' && $gui->bugInterfaceOn) ) - { - $cellID = $cellRange[$colCounter] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, html_entity_decode($field) ); - $colCounter++; - } - - // May be same processing can be applied to execution otes - if(($ldx == 'bugString' && $gui->bugInterfaceOn)) { - // To manage new line - // http://stackoverflow.com/questions/5960242/how-to-make-new-lines-in-a-cell-using-phpexcel - // http://stackoverflow.com/questions/6054444/how-to-set-auto-height-in-phpexcel - $objPHPExcel->setActiveSheetIndex(0)->getStyle($cellID)->getAlignment()->setWrapText(true); - } - } - $cellEnd = $cellRange[$colCounter-1] . $startingRow; - $startingRow++; - } - - // Final step - $objPHPExcel->setActiveSheetIndex(0); - - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - - $tmpfname = tempnam(config_get('temp_dir'),"resultsByStatus.tmp"); - $objWriter->save($tmpfname); - - if($args->getSpreadsheetBy == 'email') { - require_once('email_api.php'); - $ema = new stdClass(); - $ema->from_address = config_get('from_email'); - $ema->to_address = $args->user->emailAddress;; - $ema->subject = $gui->mailCfg->subject; - $ema->message = $gui->mailCfg->subject; - - $dum = uniqid("resultsByStatus_") . '.xls'; - $oops = array('attachment' => - array('file' => $tmpfname, 'newname' => $dum), - 'exit_on_error' => true, 'htmlFormat' => true); - $email_op = email_send_wrapper($ema,$oops); - unlink($tmpfname); - exit(); - } else { - downloadXls($tmpfname,$xlsType,$gui,'resultsByStatus_'); - } -} - - -/** - * - */ -function getMetrics(&$dbh,&$args,&$gui) -{ - $resultsCfg = config_get('results'); - $statusCode = $resultsCfg['status_code']; - $metricsMgr = new tlTestPlanMetrics($dbh); - - if( $args->type == $statusCode['not_run'] ) { - $opt = array('output' => 'array'); - if ($args->format == FORMAT_XLS) { - $opt['add2fields'] = 'TCV.summary'; - } - - $met = $metricsMgr->getNotRunWithTesterAssigned($args->tplan_id,null,$opt); - - $gui->notRunReport = true; - $gui->info_msg = $gui->labels['info_notrun_tc_report']; - $gui->notesAccessKey = 'summary'; - $gui->userAccessKey = 'user_id'; - } else { - $opt = array('output' => 'mapByExecID', - 'getOnlyAssigned' => true); - if ($args->format == FORMAT_XLS) { - $opt['add2fields'] = 'TCV.summary'; - } - - $met = $metricsMgr->getExecutionsByStatus($args->tplan_id,$args->type,null,$opt); - - $gui->notRunReport = false; - $gui->info_msg = lang_get('info_' . $resultsCfg['code_status'][$args->type] .'_tc_report'); - - $gui->notesAccessKey = 'execution_notes'; - $gui->userAccessKey='tester_id'; - } - - return $met; -} - -/** - * - */ -function initLblSpreadsheet() -{ - $lbl = init_labels(array('title_test_suite_name' => null,'platform' => null,'build' => null,'th_bugs_id_summary' => null, - 'title_test_case_title' => null,'version' => null, - 'testproject' => null,'generated_by_TestLink_on' => null,'testplan' => null, - 'title_execution_notes' => null, 'th_date' => null, 'th_run_by' => null, - 'assigned_to' => null,'summary' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() -{ - $sty = array(); - $sty['ReportContext'] = array('font' => array('bold' => true)); - $sty['DataHeader'] = array('font' => array('bold' => true), - 'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - return $sty; -} - -/** - * - */ -function xlsStepOne($oj,$style,$lbl,$gui) -{ - - $dummy = ''; - $lines2write = array(array($gui->title,''), - array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time())), - array($gui->report_context,'')); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) - { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0)->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet()->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} - diff --git a/lib/results/resultsByTSuite.php b/lib/results/resultsByTSuite.php index c3baa44ced..4526aa914a 100644 --- a/lib/results/resultsByTSuite.php +++ b/lib/results/resultsByTSuite.php @@ -1,576 +1,665 @@ -getStatusTotalsTSuiteDepth2ForRender($args->tplan_id,null,array('groupByPlatform' => 1)); - -if(is_null($tsInf)) { - // no test cases -> no report - $gui->do_report['status_ok'] = 0; - $gui->do_report['msg'] = lang_get('report_tspec_has_no_tsuites'); - tLog('Overall Metrics page: no test cases defined'); -} else { - // do report - $gui->statistics->testsuites = $tsInf->infoL2; - $gui->do_report['status_ok'] = 1; - $gui->do_report['msg'] = ''; - - $doubleItemToLoop = array('testsuites'); - foreach( $doubleItemToLoop as $item ) { - if( !is_null($gui->statistics->$item) ) { - $gui->columnsDefinition->$item = array(); - - // Get labels - // !!double current because main key is PLATFORM - $dummy = current(current($gui->statistics->$item)); - if(isset($dummy['details'])) { - foreach($dummy['details'] as $status_verbose => $value) { - $dummy['details'][$status_verbose]['qty'] = lang_get($tlCfg->results['status_label'][$status_verbose]); - $dummy['details'][$status_verbose]['percentage'] = "[%]"; - } - $gui->columnsDefinition->$item = $dummy['details']; - } - } - } - - // Get First & Latest Execution - $execContext = array('testplan_id'); - if ($gui->hasPlatforms) { - $execContext[] = 'platform_id'; - } - $span = $metricsMgr->getExecTimeSpan($args->tplan_id,$execContext); - - if ($gui->hasPlatforms) { - $gui->spanByPlatform = $span[$args->tplan_id]; - } else { - $gui->spanByPlatform[0] = $span[$args->tplan_id]; - } - - // reorder data according test suite name - natcasesort($tsInf->idNameMap); - $sortedKeys = array_keys($tsInf->idNameMap); - $gui->dataByPlatform = new stdClass(); - $gui->dataByPlatform->testsuites = array(); - foreach ($gui->statistics->testsuites as $platId => $elem) { - foreach($sortedKeys as $itemID) { - $gui->dataByPlatform->testsuites[$platId][$itemID] = $elem[$itemID]; - } - } -} - -if ($args->doAction == 'saveForBaseline') { - foreach ($gui->dataByPlatform->testsuites as $platID => $elem) { - // Context - $span = $gui->spanByPlatform[$platID]; - $tables = tlObject::getDBTables(array('baseline_l1l2_context', - 'baseline_l1l2_details')); - $sql = "INSERT INTO {$tables['baseline_l1l2_context']} - (testplan_id,platform_id,begin_exec_ts,end_exec_ts) - VALUES({$span['testplan_id']}, - {$platID}," . - "'" . $span['begin'] . "'," . - "'" . $span['end'] . "')"; - $db->exec_query($sql); - $context_id = $db->insert_id($tables['baseline_l1l2_context']); - - $cfg = config_get('results'); - $verboseCode = $cfg['status_code']; - - foreach ($elem as $l2_id => $info) { - foreach ($info['details'] as $verbose => $figures) { - $exec_status = "'" . $verboseCode[$verbose] . "'"; - - $sql = "INSERT INTO {$tables['baseline_l1l2_details']} - (context_id,top_tsuite_id,child_tsuite_id, - status,qty,total_tc) - VALUES($context_id,{$info['parent_id']},$l2_id, - $exec_status,{$figures['qty']}, - {$info['total_tc']})"; - $db->exec_query($sql); - } - } - } - $gui->baselineSaved = true; -} - -$timerOff = microtime(true); -$gui->elapsed_time = round($timerOff - $timerOn,2); - -if ($args->spreadsheet) { - createSpreadsheet($gui,$args,$tplan_mgr); -} - -$smarty = new TLSmarty; -$smarty->assign('gui', $gui); -displayReport($tplCfg->tpl, $smarty, $args->format,$mailCfg); - - -/** - * - * - */ -function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . - $labels['testproject'] . ' : ' . - $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - */ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr) { - - list($add2args,$gui) = initUserEnv($dbHandler,$argsObj); - - $gui->baselineSaved = false; - $gui->fakePlatform = array(''); - $gui->title = lang_get('metrics_by_l1l2_testsuite'); - $gui->do_report = array(); - $gui->showPlatforms=true; - $gui->columnsDefinition = new stdClass(); - $gui->columnsDefinition->keywords = null; - $gui->columnsDefinition->testers = null; - $gui->columnsDefinition->platform = null; - $gui->statistics = new stdClass(); - $gui->statistics->keywords = null; - $gui->statistics->testers = null; - $gui->statistics->milestones = null; - $gui->statistics->overalBuildStatus = null; - $gui->elapsed_time = 0; - $gui->displayBuildMetrics = false; - $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); - - $gui->tproject_name = testproject::getName($dbHandler,$argsObj->tproject_id); - - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->tplan_name = $info['name']; - $gui->tplan_id = intval($argsObj->tplan_id); - - $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - if( is_null($gui->platformSet) ) { - $gui->platformSet = array(''); - $gui->showPlatforms = false; - } else { - natsort($gui->platformSet); - } - - $base = 'lib/results/resultsByTSuite.php'; - $gui->basehref = $_SESSION['basehref']; - $common = $gui->basehref . $base . "?tplan_id={$gui->tplan_id}" . - "&tproject_id={$gui->tproject_id}&format="; - - $gui->actionSendMail = $common . FORMAT_MAIL_HTML; - $gui->actionSpreadsheet = $common . FORMAT_XLS . "&spreadsheet=1"; - $gui->actionSaveForBaseline = $common . "fake" . "&doAction=saveForBaseline"; - - $gui->mailFeedBack = new stdClass(); - $gui->mailFeedBack->msg = ''; - - $gui->hasPlatforms = count($gui->platformSet) >= 1 && - !isset($gui->platformSet[0]); - - return $gui; -} - - -/** - * - * - */ -function createSpreadsheet($gui,$args,&$tplanMgr) { - - // N sections - // Always same format - // Platform - // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] - // Completed [%] - - // Results by Platform - // Overall Build Status - // Results by Build - // Results by Top Level Test Suite - // Results by priority - // Results by Keyword - - - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - // Common - $execStatusDomain = $tplanMgr->getStatusForReports(); - $dataHeaderMetrics = array(); - // $cellPosForExecStatus = array(); - $ccc = 0; - foreach( $execStatusDomain as $code => $human ) { - $dataHeaderMetrics[] = lang_get('test_status_' . $human); - $ccc++; - $dataHeaderMetrics[] = '[%]'; - $ccc++; - //$cellPosForExecStatus[$human] = $ccc; - } - $dataHeaderMetrics[] = $lbl['completed_perc']; - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - $oneLevel = array(); - - // NO PLATFORM => ID=0 - if( $gui->hasPlatforms ) { - $oneLevel[] = array('entity' => 'platform', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->platform); - } - - $oneLevel[] = array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->overallBuildStatus); - - $startingRow = count($lines2write); // MAGIC - foreach( $oneLevel as $target ) { - $entity = $target['entity']; - $dimension = $target['dimension']; - $dataHeader = array($lbl[$entity],$lbl[$dimension]); - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $startingRow++; - $startingRow++; - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - $startingRow++; - $infoSet = $target['source']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - foreach($infoSet as $itemID => $fieldSet) { - - $whatCell = 0; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - $startingRow++; - } - } - - // The first column will be the platform - $twoLevels = array(); - - if( $gui->hasPlatforms ) { - $twoLevels[] = - array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->buildByPlatMetrics); - } - - $twoLevels[] = - array('entity' => 'testsuite', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->testsuites); - - $twoLevels[] = array('entity' => 'priority', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->priorities); - - $twoLevels[] = - array('entity' => 'keyword', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->keywords); - - foreach( $twoLevels as $target ) { - $startingRow++; - $startingRow++; - - $entity = $target['entity']; - $dimension = $target['dimension']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - if( count($target['source']) == 0 ) { - continue; - } - - // Just ONE HEADER ? - $dataHeader = array($lbl['platform'],$lbl[$entity],$lbl[$dimension]); - if( $gui->hasPlatforms == false ) { - array_shift($dataHeader); - } - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - // END ONE HEADER - $startingRow++; - - $idr = ''; - foreach( $gui->platformSet as $platID => $platName ) { - $idr = ('' == $idr || 'rowB' == $idr ) ? 'rowA' : 'rowB'; - - $infoSet = isset($target['source'][$platID]) ? - $target['source'][$platID] : array(); - - foreach($infoSet as $itemID => $fieldSet) { - $whatCell=0; - - if( $gui->hasPlatforms ) { - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $platName; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - } - - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - - $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . - "$startingRow"; - - $objPHPExcel->getActiveSheet() - ->getStyle($cellZone) - ->applyFromArray($style[$idr]); - - $startingRow++; - } - } - } // on container ? - - // Just to add some final empty row - $cellID = $cellRange[0] . $startingRow; - $field = ''; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - - - // Final step - $tmpfname = tempnam(config_get('temp_dir'),"TestLink_GTMP.tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - downloadXls($tmpfname,$xlsType,$gui,'TestLink_GTMP_'); -} - - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0) - ->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels( - array('testsuite' => null, - 'testcase_qty' => null,'keyword' => null, - 'platform' => null,'priority' => null, - 'priority_level' => null, - 'build' => null,'testplan' => null, - 'testproject' => null,'not_run' => null, - 'completed_perc' => 'trep_comp_perc', - 'generated_by_TestLink_on' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = - array('font' => array('bold' => true), - 'borders' => - array('outline' => - array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - $style['rowA'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FFFFFFFF')) - ); - - $style['rowB'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'DCDCDCDC')) - ); - - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - - - -/** - * - */ -function checkRights(&$db,&$user,$context = null) { - if(is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; +getStatusTotalsTSuiteDepth2ForRender($args->tplan_id, null, + array( + 'groupByPlatform' => 1 + )); + +if (is_null($tsInf)) { + // no test cases -> no report + $gui->do_report['status_ok'] = 0; + $gui->do_report['msg'] = lang_get('report_tspec_has_no_tsuites'); + tLog('Overall Metrics page: no test cases defined'); +} else { + // do report + $gui->statistics->testsuites = $tsInf->infoL2; + $gui->do_report['status_ok'] = 1; + $gui->do_report['msg'] = ''; + + $doubleItemToLoop = array( + 'testsuites' + ); + foreach ($doubleItemToLoop as $item) { + if (! is_null($gui->statistics->$item)) { + $gui->columnsDefinition->$item = array(); + + // Get labels + // !!double current because main key is PLATFORM + if ($gui->statistics->$item) { + $dummy = current(current($gui->statistics->$item)); + } + if (isset($dummy['details'])) { + foreach ($dummy['details'] as $status_verbose => $value) { + $dummy['details'][$status_verbose]['qty'] = lang_get( + $tlCfg->results['status_label'][$status_verbose]); + $dummy['details'][$status_verbose]['percentage'] = "[%]"; + } + $gui->columnsDefinition->$item = $dummy['details']; + } + } + } + + // Get First & Latest Execution + $execContext = array( + 'testplan_id' + ); + if ($gui->hasPlatforms) { + $execContext[] = 'platform_id'; + } + $span = $metricsMgr->getExecTimeSpan($args->tplan_id, $execContext); + + if ($gui->hasPlatforms) { + $gui->spanByPlatform = $span[$args->tplan_id]; + } else { + $gui->spanByPlatform[0] = $span[$args->tplan_id]; + } + + // reorder data according test suite name + natcasesort($tsInf->idNameMap); + $sortedKeys = array_keys($tsInf->idNameMap); + $gui->dataByPlatform = new stdClass(); + $gui->dataByPlatform->testsuites = array(); + foreach ($gui->statistics->testsuites as $platId => $elem) { + foreach ($sortedKeys as $itemID) { + $gui->dataByPlatform->testsuites[$platId][$itemID] = $elem[$itemID]; + } + } +} + +if ($args->doAction == 'saveForBaseline') { + foreach ($gui->dataByPlatform->testsuites as $platID => $elem) { + // Context + $span = $gui->spanByPlatform[$platID]; + $tables = tlObject::getDBTables( + array( + 'baseline_l1l2_context', + 'baseline_l1l2_details' + )); + $sql = "INSERT INTO {$tables['baseline_l1l2_context']} " . + " (testplan_id,platform_id,begin_exec_ts,end_exec_ts) " . + " VALUES({$span['testplan_id']}, {$platID}, '" . $span['begin'] . + "', '" . $span['end'] . "')"; + $db->exec_query($sql); + $context_id = $db->insert_id($tables['baseline_l1l2_context']); + + $cfg = config_get('results'); + $verboseCode = $cfg['status_code']; + + foreach ($elem as $l2_id => $info) { + foreach ($info['details'] as $verbose => $figures) { + $exec_status = "'" . $verboseCode[$verbose] . "'"; + $sql = "INSERT INTO {$tables['baseline_l1l2_details']} " . + " (context_id,top_tsuite_id,child_tsuite_id,status,qty,total_tc) " . + " VALUES($context_id,{$info['parent_id']},$l2_id,$exec_status,{$figures['qty']}, " . + " {$info['total_tc']})"; + $db->exec_query($sql); + } + } + } + $gui->baselineSaved = true; +} + +$timerOff = microtime(true); +$gui->elapsed_time = round($timerOff - $timerOn, 2); + +if ($args->spreadsheet) { + createSpreadsheet($gui, $tplan_mgr); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($tplCfg->tpl, $smarty, $args->format, $mailCfg); + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return stdClass + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr) +{ + list (, $gui) = initUserEnv($dbHandler, $argsObj); + + $gui->baselineSaved = false; + $gui->fakePlatform = array( + '' + ); + $gui->title = lang_get('metrics_by_l1l2_testsuite'); + $gui->do_report = array(); + $gui->showPlatforms = true; + $gui->columnsDefinition = new stdClass(); + $gui->columnsDefinition->keywords = null; + $gui->columnsDefinition->testers = null; + $gui->columnsDefinition->platform = null; + $gui->statistics = new stdClass(); + $gui->statistics->keywords = null; + $gui->statistics->testers = null; + $gui->statistics->milestones = null; + $gui->statistics->overalBuildStatus = null; + $gui->elapsed_time = 0; + $gui->displayBuildMetrics = false; + $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); + + $gui->tproject_name = testproject::getName($dbHandler, $argsObj->tproject_id); + + $info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->tplan_name = $info['name']; + $gui->tplan_id = intval($argsObj->tplan_id); + + $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + if (is_null($gui->platformSet)) { + $gui->platformSet = array( + '' + ); + $gui->showPlatforms = false; + } else { + natsort($gui->platformSet); + } + + $base = 'lib/results/resultsByTSuite.php'; + $gui->basehref = $_SESSION['basehref']; + $common = $gui->basehref . $base . "?tplan_id={$gui->tplan_id}" . + "&tproject_id={$gui->tproject_id}&format="; + + $gui->actionSendMail = $common . FORMAT_MAIL_HTML; + $gui->actionSpreadsheet = $common . FORMAT_XLS . "&spreadsheet=1"; + $gui->actionSaveForBaseline = $common . "fake" . "&doAction=saveForBaseline"; + + $gui->mailFeedBack = new stdClass(); + $gui->mailFeedBack->msg = ''; + + $gui->hasPlatforms = count($gui->platformSet) >= 1 && + ! isset($gui->platformSet[0]); + + return $gui; +} + +/** + * + * @param stdClass $gui + * @param testplan $tplanMgr + */ +function createSpreadsheet($gui, &$tplanMgr) +{ + // N sections + // Always same format + // Platform + // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] + // Completed [%] + + // Results by Platform + // Overall Build Status + // Results by Build + // Results by Top Level Test Suite + // Results by priority + // Results by Keyword + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + // Common + $execStatusDomain = $tplanMgr->getStatusForReports(); + $dataHeaderMetrics = array(); + $ccc = 0; + foreach ($execStatusDomain as $human) { + $dataHeaderMetrics[] = lang_get('test_status_' . $human); + $ccc ++; + $dataHeaderMetrics[] = '[%]'; + $ccc ++; + } + $dataHeaderMetrics[] = $lbl['completed_perc']; + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + $oneLevel = array(); + + // NO PLATFORM => ID=0 + if ($gui->hasPlatforms) { + $oneLevel[] = array( + 'entity' => 'platform', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->platform + ); + } + + $oneLevel[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->overallBuildStatus + ); + + $startingRow = count($lines2write); // MAGIC + foreach ($oneLevel as $target) { + $entity = $target['entity']; + $dimension = $target['dimension']; + $dataHeader = array( + $lbl[$entity], + $lbl[$dimension] + ); + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $startingRow ++; + $startingRow ++; + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + $infoSet = $target['source']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + foreach ($infoSet as $fieldSet) { + + $whatCell = 0; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + $startingRow ++; + } + } + + // The first column will be the platform + $twoLevels = array(); + + if ($gui->hasPlatforms) { + $twoLevels[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->buildByPlatMetrics + ); + } + + $twoLevels[] = array( + 'entity' => 'testsuite', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->testsuites + ); + + $twoLevels[] = array( + 'entity' => 'priority', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->priorities + ); + + $twoLevels[] = array( + 'entity' => 'keyword', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->keywords + ); + + foreach ($twoLevels as $target) { + $startingRow ++; + $startingRow ++; + + $entity = $target['entity']; + $dimension = $target['dimension']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + if (empty($target['source'])) { + continue; + } + + // Just ONE HEADER ? + $dataHeader = array( + $lbl['platform'], + $lbl[$entity], + $lbl[$dimension] + ); + if (! $gui->hasPlatforms) { + array_shift($dataHeader); + } + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + // END ONE HEADER + $startingRow ++; + + $idr = ''; + foreach ($gui->platformSet as $platID => $platName) { + $idr = ('' == $idr || 'rowB' == $idr) ? 'rowA' : 'rowB'; + + $infoSet = isset($target['source'][$platID]) ? $target['source'][$platID] : array(); + + foreach ($infoSet as $fieldSet) { + $whatCell = 0; + + if ($gui->hasPlatforms) { + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $platName; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + } + + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + + $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . + "$startingRow"; + + $objPHPExcel->getActiveSheet() + ->getStyle($cellZone) + ->applyFromArray($style[$idr]); + + $startingRow ++; + } + } + } + + // Just to add some final empty row + $cellID = $cellRange[0] . $startingRow; + $field = ''; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + // Final step + $tmpfname = tempnam(config_get('temp_dir'), "TestLink_GTMP.tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + downloadXls($tmpfname, $xlsType, $gui, 'TestLink_GTMP_'); +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'testsuite' => null, + 'testcase_qty' => null, + 'keyword' => null, + 'platform' => null, + 'priority' => null, + 'priority_level' => null, + 'build' => null, + 'testplan' => null, + 'testproject' => null, + 'not_run' => null, + 'completed_perc' => 'trep_comp_perc', + 'generated_by_TestLink_on' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + $style['rowA'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FFFFFFFF' + ) + ) + ); + + $style['rowB'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'DCDCDCDC' + ) + ) + ); + + return $style; +} + +/** + * + * @return array + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } diff --git a/lib/results/resultsByTesterPerBuild.php b/lib/results/resultsByTesterPerBuild.php index 351873fa3b..81f76028d0 100644 --- a/lib/results/resultsByTesterPerBuild.php +++ b/lib/results/resultsByTesterPerBuild.php @@ -1,327 +1,376 @@ -getNumberOfBuilds($args->tplan_id,null,testplan::OPEN_BUILDS); - -// not too wise duplicated code, but effective => Quick & Dirty -if( $openBuildsQty <= 0 && !$args->show_closed_builds) -{ - $gui->warning_message = lang_get('no_open_builds'); - $gui->tableSet = null; - $smarty = new TLSmarty(); - $smarty->assign('gui',$gui); - $smarty->display($templateCfg->template_dir . $templateCfg->default_template); - exit(); +getNumberOfBuilds($args->tplan_id, null, + testplan::OPEN_BUILDS); + +// not too wise duplicated code, but effective => Quick & Dirty +if ($openBuildsQty <= 0 && ! $args->show_closed_builds) { + $gui->warning_message = lang_get('no_open_builds'); + $gui->tableSet = null; + $smarty = new TLSmarty(); + $smarty->assign('gui', $gui); + $smarty->display( + $templateCfg->template_dir . $templateCfg->default_template); + exit(); +} + +$metricsMgr = new tlTestPlanMetrics($db); +$statusCfg = $metricsMgr->getStatusConfig(); +$metrics = $metricsMgr->getStatusTotalsByBuildUAForRender($args->tplan_id, + array( + 'processClosedBuilds' => $args->show_closed_builds + )); +$matrix = $metrics->info; + +// Here need to work, because all queries consider ONLY ACTIVE STATUS +$option = $args->show_closed_builds ? null : testplan::GET_OPEN_BUILD; +$build_set = $metricsMgr->get_builds($args->tplan_id, testplan::GET_ACTIVE_BUILD, + $option); +$names = $user->getNames($db); + +// get the progress of the whole build based on executions of single users +$build_statistics = array(); +foreach ($matrix as $build_id => $build_execution_map) { + $build_statistics[$build_id]['total'] = 0; + $build_statistics[$build_id]['executed'] = 0; + $build_statistics[$build_id]['total_time'] = 0; + + foreach ($build_execution_map as $statistics) { + // total assigned test cases + $build_statistics[$build_id]['total'] += $statistics['total']; + + // total executed testcases + $executed = $statistics['total'] - $statistics['not_run']['count']; + $build_statistics[$build_id]['executed'] += $executed; + + $build_statistics[$build_id]['total_time'] += $statistics['total_time']; + } + + // build progress + $build_statistics[$build_id]['progress'] = round( + $build_statistics[$build_id]['executed'] / + $build_statistics[$build_id]['total'] * 100, 2); + + // We have to fill this if we want time at BUILD LEVEL + $build_statistics[$build_id]['total_time'] = minutes2HHMMSS( + $build_statistics[$build_id]['total_time']); +} + +// build the content of the table +$rows = array(); + +$lblx = array( + 'progress_absolute' => lang_get('progress_absolute'), + 'total_time_hhmmss' => lang_get('total_time_hhmmss') +); + +foreach ($matrix as $build_id => $build_execution_map) { + + $first_row = $build_set[$build_id]['name'] . " - " . + $lblx['progress_absolute'] . + " {$build_statistics[$build_id]['progress']}%" . " - " . + $lblx['total_time_hhmmss'] . + " {$build_statistics[$build_id]['total_time']}"; + + foreach ($build_execution_map as $user_id => $statistics) { + $current_row = array(); + $current_row[] = $first_row; + + // add username and link it to tcAssignedToUser.php + // $username = $names[$user_id]['login']; + $name = "tplan_id});\">{$names[$user_id]['login']}"; + $current_row[] = $name; + + // total count of testcases assigned to this user on this build + $current_row[] = $statistics['total']; + + // add count and percentage for each possible status + foreach ($statusCfg as $status => $code) { + $current_row[] = $statistics[$status]['count']; + $current_row[] = $statistics[$status]['percentage']; + } + + $current_row[] = $statistics['progress']; + + $current_row[] = minutes2HHMMSS($statistics['total_time']); + + // add this row to the others + $rows[] = $current_row; + } +} + +$columns = getTableHeader($statusCfg); +$smartTable = new tlExtTable($columns, $rows, + 'tl_table_results_by_tester_per_build'); +$smartTable->title = lang_get('results_by_tester_per_build'); +$smartTable->setGroupByColumnName(lang_get('build')); + +// enable default sorting by progress column +$smartTable->setSortByColumnName(lang_get('progress')); + +// define toolbar +$smartTable->showToolbar = true; +$smartTable->toolbarExpandCollapseGroupsButton = true; +$smartTable->toolbarShowAllColumnsButton = true; + +$gui->tableSet = array( + $smartTable +); + +// show warning message instead of table if table is empty +$gui->warning_message = ! empty($rows > 0) ? '' : lang_get( + 'no_testers_per_build'); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * initialize user input + * + * @param + * database dbHandler + * @return array $args array with user input information + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ), + "show_closed_builds" => array( + tlInputParameter::CB_BOOL + ), + "show_closed_builds_hidden" => array( + tlInputParameter::CB_BOOL + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + $tproject_mgr = new testproject($dbHandler); + $tplan_mgr = new testplan($dbHandler); + if ($args->tproject_id > 0) { + $args->tproject_info = $tproject_mgr->get_by_id($args->tproject_id); + $args->tproject_name = $args->tproject_info['name']; + $args->tproject_description = $args->tproject_info['notes']; + } + + if ($args->tplan_id > 0) { + $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + } + + $selection = false; + if ($args->show_closed_builds) { + $selection = true; + } elseif ($args->show_closed_builds_hidden) { + $selection = false; + } elseif (isset($_SESSION['reports_show_closed_builds'])) { + $selection = $_SESSION['reports_show_closed_builds']; + } + $args->show_closed_builds = $_SESSION['reports_show_closed_builds'] = $selection; + + return array( + $args, + $tproject_mgr, + $tplan_mgr + ); +} + +/** + * initialize GUI + * + * @param stdClass $argsObj + * reference to user input + * @return stdClass $gui gui data + */ +function initGui(&$argsObj) +{ + $gui = new stdClass(); + $gui->pageTitle = lang_get('caption_results_by_tester_per_build'); + $gui->warning_msg = ''; + $gui->tproject_name = $argsObj->tproject_name; + $gui->tplan_name = $argsObj->tplan_info['name']; + $gui->show_closed_builds = $argsObj->show_closed_builds; + + return $gui; +} + +/** + * + * @param array $statusCfg + * @return array + */ +function getTableHeader($statusCfg) +{ + $resultsCfg = config_get('results'); + + $colCfg = array(); + $colCfg[] = array( + 'title_key' => 'build', + 'width' => 50, + 'type' => 'text', + 'sortType' => 'asText', + 'filter' => 'string' + ); + $colCfg[] = array( + 'title_key' => 'user', + 'width' => 50, + 'type' => 'text', + 'sortType' => 'asText', + 'filter' => 'string' + ); + $colCfg[] = array( + 'title_key' => 'th_tc_assigned', + 'width' => 50, + 'sortType' => 'asFloat', + 'filter' => 'numeric' + ); + + foreach ($statusCfg as $status => $code) { + $label = $resultsCfg['status_label'][$status]; + $colCfg[] = array( + 'title_key' => $label, + 'width' => 20, + 'sortType' => 'asInt', + 'filter' => 'numeric' + ); + $colCfg[] = array( + 'title' => lang_get($label) . ' ' . lang_get('in_percent'), + 'col_id' => 'id_' . $label . '_percent', + 'width' => 30, + 'type' => 'float', + 'sortType' => 'asFloat', + 'filter' => 'numeric' + ); + } + + $colCfg[] = array( + 'title_key' => 'progress', + 'width' => 30, + 'type' => 'float', + 'sortType' => 'asFloat', + 'filter' => 'numeric' + ); + + $colCfg[] = array( + 'title' => lang_get('total_time_hhmmss'), + 'width' => 30, + 'type' => 'text', + 'sortType' => 'asText', + 'filter' => 'string' + ); + + return $colCfg; +} + +/** + * + * ATTENTION: + * because minutes can be a decimal (i.e 131.95) if I use standard operations i can get + * wrong results + * + * @param int $minutes + * @return string + */ +function minutes2HHMMSS($minutes) +{ + // Attention: + // $min2sec = $minutes * 60; + // doing echo provide expected result, but when using to do more math op + // result was wrong, 1 second loss. + // Example with 131.95 as input + // $min2sec = sprintf('%d',($minutes * 60)); + $min2sec = bcmul($minutes, 60); + + // From here number will not have decimal => will return to normal operators. + // do not know perfomance impacts related to BC* functions + $hh = floor($min2sec / 3600); + $mmss = ($min2sec % 3600); + + $mm = floor($mmss / 60); + $ss = $mmss % 60; + + return sprintf('%02d:%02d:%02d', $hh, $mm, $ss); +} + +/** + * rights check function for testlinkInitPage() + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } - - -$metricsMgr = new tlTestPlanMetrics($db); -$statusCfg = $metricsMgr->getStatusConfig(); -$metrics = $metricsMgr->getStatusTotalsByBuildUAForRender($args->tplan_id, - array('processClosedBuilds' => $args->show_closed_builds)); -$matrix = $metrics->info; - -// Here need to work, because all queries consider ONLY ACTIVE STATUS -$option = $args->show_closed_builds ? null : testplan::GET_OPEN_BUILD; -$build_set = $metricsMgr->get_builds($args->tplan_id, testplan::GET_ACTIVE_BUILD, $option); -$names = $user->getNames($db); - -// get the progress of the whole build based on executions of single users -$build_statistics = array(); -foreach($matrix as $build_id => $build_execution_map) -{ - $build_statistics[$build_id]['total'] = 0; - $build_statistics[$build_id]['executed'] = 0; - $build_statistics[$build_id]['total_time'] = 0; - - foreach ($build_execution_map as $user_id => $statistics) - { - // total assigned test cases - $build_statistics[$build_id]['total'] += $statistics['total']; - - // total executed testcases - $executed = $statistics['total'] - $statistics['not_run']['count']; - $build_statistics[$build_id]['executed'] += $executed; - - $build_statistics[$build_id]['total_time'] += $statistics['total_time']; - } - - // build progress - $build_statistics[$build_id]['progress'] = round($build_statistics[$build_id]['executed'] / - $build_statistics[$build_id]['total'] * 100,2); - - // We have to fill this if we want time at BUILD LEVEL - $build_statistics[$build_id]['total_time'] = minutes2HHMMSS($build_statistics[$build_id]['total_time']); -} - -// build the content of the table -$rows = array(); - -$lblx = array('progress_absolute' => lang_get('progress_absolute'), - 'total_time_hhmmss' => lang_get('total_time_hhmmss') ); - -foreach ($matrix as $build_id => $build_execution_map) -{ - - $first_row = $build_set[$build_id]['name'] . " - " . - $lblx['progress_absolute'] . " {$build_statistics[$build_id]['progress']}%" ." - " . - $lblx['total_time_hhmmss']. " {$build_statistics[$build_id]['total_time']}"; - - foreach ($build_execution_map as $user_id => $statistics) - { - $current_row = array(); - $current_row[] = $first_row; - - // add username and link it to tcAssignedToUser.php - // $username = $names[$user_id]['login']; - $name = "tplan_id});\">{$names[$user_id]['login']}"; - $current_row[] = $name; - - // total count of testcases assigned to this user on this build - $current_row[] = $statistics['total']; - - // add count and percentage for each possible status - foreach ($statusCfg as $status => $code) - { - $current_row[] = $statistics[$status]['count']; - $current_row[] = $statistics[$status]['percentage']; - } - - $current_row[] = $statistics['progress']; - - $current_row[] = minutes2HHMMSS($statistics['total_time']); - - // add this row to the others - $rows[] = $current_row; - } -} - -$columns = getTableHeader($statusCfg); -$smartTable = new tlExtTable($columns, $rows, 'tl_table_results_by_tester_per_build'); -$smartTable->title = lang_get('results_by_tester_per_build'); -$smartTable->setGroupByColumnName(lang_get('build')); - -// enable default sorting by progress column -$smartTable->setSortByColumnName(lang_get('progress')); - -//define toolbar -$smartTable->showToolbar = true; -$smartTable->toolbarExpandCollapseGroupsButton = true; -$smartTable->toolbarShowAllColumnsButton = true; - -$gui->tableSet = array($smartTable); - -// show warning message instead of table if table is empty -$gui->warning_message = (count($rows) > 0) ? '' : lang_get('no_testers_per_build'); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * initialize user input - * - * @param resource dbHandler - * @return array $args array with user input information - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - "show_closed_builds" => array(tlInputParameter::CB_BOOL), - "show_closed_builds_hidden" => array(tlInputParameter::CB_BOOL)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - $tproject_mgr = new testproject($dbHandler); - $tplan_mgr = new testplan($dbHandler); - if($args->tproject_id > 0) - { - $args->tproject_info = $tproject_mgr->get_by_id($args->tproject_id); - $args->tproject_name = $args->tproject_info['name']; - $args->tproject_description = $args->tproject_info['notes']; - } - - if ($args->tplan_id > 0) - { - $args->tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - } - - $selection = false; - if($args->show_closed_builds) - { - $selection = true; - } - else if ($args->show_closed_builds_hidden) - { - $selection = false; - } - else if (isset($_SESSION['reports_show_closed_builds'])) - { - $selection = $_SESSION['reports_show_closed_builds']; - } - $args->show_closed_builds = $_SESSION['reports_show_closed_builds'] = $selection; - - return array($args,$tproject_mgr,$tplan_mgr); -} - - -/** - * initialize GUI - * - * @param stdClass $argsObj reference to user input - * @return stdClass $gui gui data - */ -function init_gui(&$argsObj) -{ - $gui = new stdClass(); - - $gui->pageTitle = lang_get('caption_results_by_tester_per_build'); - $gui->warning_msg = ''; - $gui->tproject_name = $argsObj->tproject_name; - $gui->tplan_name = $argsObj->tplan_info['name']; - $gui->show_closed_builds = $argsObj->show_closed_builds; - return $gui; -} - -/** - * - * - */ -function getTableHeader($statusCfg) -{ - $resultsCfg = config_get('results'); - - $colCfg = array(); - $colCfg[] = array('title_key' => 'build', 'width' => 50, - 'type' => 'text', 'sortType' => 'asText','filter' => 'string'); - $colCfg[] = array('title_key' => 'user', 'width' => 50, - 'type' => 'text', 'sortType' => 'asText','filter' => 'string'); - $colCfg[] = array('title_key' => 'th_tc_assigned', - 'width' => 50, 'sortType' => 'asFloat','filter' => 'numeric'); - - foreach ($statusCfg as $status => $code) - { - $label = $resultsCfg['status_label'][$status]; - $colCfg[] = array('title_key' => $label, 'width' => 20, 'sortType' => 'asInt','filter' => 'numeric'); - $colCfg[] = array('title' => lang_get($label).' '.lang_get('in_percent'), - 'col_id' => 'id_'.$label.'_percent', 'width' => 30, - 'type' => 'float', 'sortType' => 'asFloat', 'filter' => 'numeric'); - } - - $colCfg[] = array('title_key' => 'progress', 'width' => 30, - 'type' => 'float','sortType' => 'asFloat', 'filter' => 'numeric'); - - $colCfg[] = array('title' => lang_get('total_time_hhmmss'), 'width' => 30, - 'type' => 'text','sortType' => 'asText', 'filter' => 'string'); - - return $colCfg; -} - -/** - * - * ATTENTION: - * because minutes can be a decimal (i.e 131.95) if I use standard operations i can get - * wrong results - * - * - */ -function minutes2HHMMSS($minutes) -{ - // Attention: - // $min2sec = $minutes * 60; - // doing echo provide expected result, but when using to do more math op - // result was wrong, 1 second loss. - // Example with 131.95 as input - // $min2sec = sprintf('%d',($minutes * 60)); - $min2sec = bcmul($minutes, 60); - - // From here number will not have decimal => will return to normal operators. - // do not know perfomance impacts related to BC* functions - $hh = floor($min2sec/3600); - $mmss = ($min2sec%3600); - - $mm = floor($mmss/60); - $ss = $mmss%60; - - return sprintf('%02d:%02d:%02d', $hh, $mm, $ss); -} - - - - -/* - * rights check function for testlinkInitPage() - */ -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} - - diff --git a/lib/results/resultsGeneral.php b/lib/results/resultsGeneral.php index 5305ccad01..d4a4f6058e 100644 --- a/lib/results/resultsGeneral.php +++ b/lib/results/resultsGeneral.php @@ -1,651 +1,764 @@ -getStatusTotalsByTopLevelTestSuiteForRender($args->tplan_id,null,array('groupByPlatform' => 1)); - -if(is_null($tsInf)) { - // no test cases -> no report - $gui->do_report['status_ok'] = 0; - $gui->do_report['msg'] = lang_get('report_tspec_has_no_tsuites'); - tLog('Overall Metrics page: no test cases defined'); -} else { - - // do report - $gui->statistics->testsuites = $tsInf->info; - $gui->do_report['status_ok'] = 1; - $gui->do_report['msg'] = ''; - - - $keywordsMetrics = - $metricsMgr->getStatusTotalsByKeywordForRender($args->tplan_id,null, array('groupByPlatform' => 1) ); - - $gui->statistics->keywords = !is_null($keywordsMetrics) ? $keywordsMetrics->info : null; - - if( $gui->showPlatforms ) { - $items2loop[] = 'platform'; - $platformMetrics = $metricsMgr->getStatusTotalsByPlatformForRender($args->tplan_id); - $gui->statistics->platform = !is_null($platformMetrics) ? $platformMetrics->info : null; - } - - if($gui->testprojectOptions->testPriorityEnabled) { - $filters = null; - $opt = array('getOnlyAssigned' => false, - 'groupByPlatform' => 1); - $priorityMetrics = $metricsMgr->getStatusTotalsByPriorityForRender($args->tplan_id,$filters,$opt); - $gui->statistics->priorities = !is_null($priorityMetrics) ? $priorityMetrics->info : null; - } - - - foreach($items2loop as $item) { - if( !is_null($gui->statistics->$item) ) { - $gui->columnsDefinition->$item = array(); - - // Get labels - $dummy = current($gui->statistics->$item); - if(isset($dummy['details'])) { - foreach($dummy['details'] as $status_verbose => $value) { - $dummy['details'][$status_verbose]['qty'] = lang_get($tlCfg->results['status_label'][$status_verbose]); - $dummy['details'][$status_verbose]['percentage'] = "[%]"; - } - $gui->columnsDefinition->$item = $dummy['details']; - } - } - } - - $doubleItemToLoop = array('priorities','keywords','testsuites'); - foreach( $doubleItemToLoop as $item ) { - if( !is_null($gui->statistics->$item) ) { - $gui->columnsDefinition->$item = array(); - - // Get labels - // !!double current because main key is PLATFORM - $dummy = current(current($gui->statistics->$item)); - if(isset($dummy['details'])) { - foreach($dummy['details'] as $status_verbose => $value) { - $dummy['details'][$status_verbose]['qty'] = lang_get($tlCfg->results['status_label'][$status_verbose]); - $dummy['details'][$status_verbose]['percentage'] = "[%]"; - } - $gui->columnsDefinition->$item = $dummy['details']; - } - } - } - - - /* BUILDS REPORT */ - $colDefinition = null; - $results = null; - if($gui->do_report['status_ok']) { - - $o = $metricsMgr->getOverallBuildStatusForRender($args->tplan_id); - $gui->statistics->overallBuildStatus = $o->info; - $gui->columnsDefinition->overallBuildStatus = $o->colDefinition; - $gui->displayBuildMetrics = !is_null($gui->statistics->overallBuildStatus); - } - - // Build by Platform - $colDefinition = null; - $results = null; - if($gui->do_report['status_ok']) { - $o = $metricsMgr->getBuildByPlatStatusForRender($args->tplan_id); - - $gui->statistics->buildByPlatMetrics = new stdClass(); - $gui->statistics->buildByPlatMetrics = $o->info; - $gui->columnsDefinition->buildByPlatMetrics = $o->colDefinition; - - $gui->displayBuildByPlatMetrics = - !is_null($gui->statistics->buildByPlatMetrics); - } - - - - /* MILESTONE & PRIORITY REPORT */ - // Need to be refactored ??? - $milestonesList = $tplan_mgr->get_milestones($args->tplan_id); - if (!empty($milestonesList)) { - $gui->statistics->milestones = $metricsMgr->getMilestonesMetrics($args->tplan_id,$milestonesList); - } - -} - -$timerOff = microtime(true); -$gui->elapsed_time = round($timerOff - $timerOn,2); - -if( $args->spreadsheet ) { - createSpreadsheet($gui,$args,$tplan_mgr); -} - - -$smarty = new TLSmarty; -$smarty->assign('gui', $gui); -displayReport($tplCfg->tpl, $smarty, $args->format,$mailCfg); - - - -/* - function: init_args - args: none - returns: array -*/ -function init_args(&$dbHandler) { - $tplanMgr = null; - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "format" => array(tlInputParameter::INT_N), - "sendByMail" => array(tlInputParameter::INT_N), - "spreadsheet" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - $pParams = G_PARAMS($iParams,$args); - - $args->spreadsheet = intval($args->spreadsheet); - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } else { - testlinkInitPage($dbHandler,true,false,"checkRights"); - - $tplanMgr = new testplan($dbHandler); - $tplan = $tplanMgr->get_by_id($args->tplan_id); - $args->tproject_id = $tplan['testproject_id']; - } - - if($args->tproject_id <= 0) { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - if (is_null($args->format)) { - tlog("Parameter 'format' is not defined", 'ERROR'); - exit(); - } - - $args->user = $_SESSION['currentUser']; - $args->format = $args->sendByMail ? FORMAT_MAIL_HTML : $args->format; - - return array($tplanMgr,$args); -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - */ -function initializeGui(&$dbHandler,$argsObj,&$tplanMgr) { - $gui = new stdClass(); - $gui->fakePlatform = array(''); - $gui->title = lang_get('title_gen_test_rep'); - $gui->do_report = array(); - $gui->showPlatforms=true; - $gui->columnsDefinition = new stdClass(); - $gui->columnsDefinition->keywords = null; - $gui->columnsDefinition->testers = null; - $gui->columnsDefinition->platform = null; - $gui->statistics = new stdClass(); - $gui->statistics->keywords = null; - $gui->statistics->testers = null; - $gui->statistics->milestones = null; - $gui->statistics->overalBuildStatus = null; - $gui->elapsed_time = 0; - $gui->displayBuildMetrics = false; - $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); - - $mgr = new testproject($dbHandler); - $dummy = $mgr->get_by_id($argsObj->tproject_id); - $gui->testprojectOptions = new stdClass(); - $gui->testprojectOptions->testPriorityEnabled = $dummy['opt']->testPriorityEnabled; - $gui->tproject_name = $dummy['name']; - - $info = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->tplan_name = $info['name']; - $gui->tplan_id = intval($argsObj->tplan_id); - - $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - if( is_null($gui->platformSet) ) { - $gui->platformSet = array(''); - $gui->showPlatforms = false; - } else { - natsort($gui->platformSet); - } - - $gui->basehref = $_SESSION['basehref']; - $gui->actionSendMail = $gui->basehref . - "lib/results/resultsGeneral.php?format=" . - FORMAT_MAIL_HTML . "&tplan_id={$gui->tplan_id}"; - - $gui->actionSpreadsheet = $gui->basehref . - "lib/results/resultsGeneral.php?format=" . - FORMAT_XLS . "&tplan_id={$gui->tplan_id}&spreadsheet=1"; - - - $gui->mailFeedBack = new stdClass(); - $gui->mailFeedBack->msg = ''; - return $gui; -} - - -/** - * - * - */ -function createSpreadsheet($gui,$args,&$tplanMgr) { - - // N sections - // Always same format - // Platform - // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] - // Completed [%] - - // Results by Platform - // Overall Build Status - // Results by Build - // Results by Top Level Test Suite - // Results by priority - // Results by Keyword - - - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - // Common - $execStatusDomain = $tplanMgr->getStatusForReports(); - $dataHeaderMetrics = array(); - // $cellPosForExecStatus = array(); - $ccc = 0; - foreach( $execStatusDomain as $code => $human ) { - $dataHeaderMetrics[] = lang_get('test_status_' . $human); - $ccc++; - $dataHeaderMetrics[] = '[%]'; - $ccc++; - //$cellPosForExecStatus[$human] = $ccc; - } - $dataHeaderMetrics[] = $lbl['completed_perc']; - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - $oneLevel = array(); - - // NO PLATFORM => ID=0 - $hasPlatforms = count($gui->platformSet) >= 1 && - !isset($gui->platformSet[0]); - if( $hasPlatforms ) { - $oneLevel[] = array('entity' => 'platform', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->platform); - } - - $oneLevel[] = array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->overallBuildStatus); - - $startingRow = count($lines2write); // MAGIC - foreach( $oneLevel as $target ) { - $entity = $target['entity']; - $dimension = $target['dimension']; - $dataHeader = array($lbl[$entity],$lbl[$dimension]); - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $startingRow++; - $startingRow++; - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - - $startingRow++; - $infoSet = $target['source']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - foreach($infoSet as $itemID => $fieldSet) { - - $whatCell = 0; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - $startingRow++; - } - } - - // The first column will be the platform - $twoLevels = array(); - - if( $hasPlatforms ) { - $twoLevels[] = - array('entity' => 'build', 'dimension' => 'testcase_qty', - 'nameKey' => 'build_name', - 'tcQtyKey' => 'total_assigned', - 'source' => &$gui->statistics->buildByPlatMetrics); - } - - $twoLevels[] = - array('entity' => 'testsuite', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->testsuites); - - $twoLevels[] = array('entity' => 'priority', - 'dimension' => 'testcase_qty', - 'nameKey' => 'name', 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->priorities); - - $twoLevels[] = - array('entity' => 'keyword', 'dimension' => 'testcase_qty', - 'nameKey' => 'name', - 'tcQtyKey' => 'total_tc', - 'source' => &$gui->statistics->keywords); - - foreach( $twoLevels as $target ) { - $startingRow++; - $startingRow++; - - $entity = $target['entity']; - $dimension = $target['dimension']; - $nameKey = $target['nameKey']; - $tcQtyKey = $target['tcQtyKey']; - - if( count($target['source']) == 0 ) { - continue; - } - - // Just ONE HEADER ? - $dataHeader = array($lbl['platform'],$lbl[$entity],$lbl[$dimension]); - if( $hasPlatforms == false ) { - array_shift($dataHeader); - } - - // intermediate column qty is dynamic because it depends - // of status configuration. - foreach( $dataHeaderMetrics as $val ) { - $dataHeader[] = $val; - } - - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['DataHeader']); - // END ONE HEADER - $startingRow++; - - $idr = ''; - foreach( $gui->platformSet as $platID => $platName ) { - $idr = ('' == $idr || 'rowB' == $idr ) ? 'rowA' : 'rowB'; - - $infoSet = isset($target['source'][$platID]) ? - $target['source'][$platID] : array(); - - foreach($infoSet as $itemID => $fieldSet) { - $whatCell=0; - - if( $hasPlatforms ) { - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $platName; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - } - - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$nameKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $field = $fieldSet[$tcQtyKey]; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - foreach($fieldSet['details'] as $human => $metrics) { - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['qty']); - - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, $metrics['percentage']); - } - $whatCell++; - $cellID = $cellRange[$whatCell] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0) - ->setCellValue($cellID, - $fieldSet['percentage_completed']); - - $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . - "$startingRow"; - - $objPHPExcel->getActiveSheet() - ->getStyle($cellZone) - ->applyFromArray($style[$idr]); - - $startingRow++; - } - } - } // on container ? - - // Just to add some final empty row - $cellID = $cellRange[0] . $startingRow; - $field = ''; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - - - - // Final step - $tmpfname = tempnam(config_get('temp_dir'),"TestLink_GTMP.tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - downloadXls($tmpfname,$xlsType,$gui,'TestLink_GTMP_'); -} - - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0) - ->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet() - ->getStyle($cellArea) - ->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels( - array('testsuite' => null, - 'testcase_qty' => null,'keyword' => null, - 'platform' => null,'priority' => null, - 'priority_level' => null, - 'build' => null,'testplan' => null, - 'testproject' => null,'not_run' => null, - 'completed_perc' => 'trep_comp_perc', - 'generated_by_TestLink_on' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = - array('font' => array('bold' => true), - 'borders' => - array('outline' => - array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - - $style['rowA'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FFFFFFFF')) - ); - - $style['rowB'] = - array('borders' => - array( - 'outline' => - array('style' => PHPExcel_Style_Border::BORDER_THIN), - 'vertical' => - array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'DCDCDCDC')) - ); - - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - - - -/** - * - */ -function checkRights(&$db,&$user,$context = null) { - if(is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; +getStatusTotalsByTopLevelTestSuiteForRender( + $args->tplan_id, null, array( + 'groupByPlatform' => 1 + )); + +if (is_null($tsInf)) { + // no test cases -> no report + $gui->do_report['status_ok'] = 0; + $gui->do_report['msg'] = lang_get('report_tspec_has_no_tsuites'); + tLog('Overall Metrics page: no test cases defined'); +} else { + + // do report + $gui->statistics->testsuites = $tsInf->info; + $gui->do_report['status_ok'] = 1; + $gui->do_report['msg'] = ''; + + $keywordsMetrics = $metricsMgr->getStatusTotalsByKeywordForRender( + $args->tplan_id, null, array( + 'groupByPlatform' => 1 + )); + + $gui->statistics->keywords = ! is_null($keywordsMetrics) ? $keywordsMetrics->info : null; + + if ($gui->showPlatforms) { + $items2loop[] = 'platform'; + $platformMetrics = $metricsMgr->getStatusTotalsByPlatformForRender( + $args->tplan_id); + $gui->statistics->platform = ! is_null($platformMetrics) ? $platformMetrics->info : null; + } + + if ($gui->testprojectOptions->testPriorityEnabled) { + $filters = null; + $opt = array( + 'getOnlyAssigned' => false, + 'groupByPlatform' => 1 + ); + $priorityMetrics = $metricsMgr->getStatusTotalsByPriorityForRender( + $args->tplan_id, $filters, $opt); + $gui->statistics->priorities = ! is_null($priorityMetrics) ? $priorityMetrics->info : null; + } + + foreach ($items2loop as $item) { + if (! is_null($gui->statistics->$item)) { + $gui->columnsDefinition->$item = array(); + + // Get labels + $dummy = current($gui->statistics->$item); + if (isset($dummy['details'])) { + foreach ($dummy['details'] as $status_verbose => $value) { + $dummy['details'][$status_verbose]['qty'] = lang_get( + $tlCfg->results['status_label'][$status_verbose]); + $dummy['details'][$status_verbose]['percentage'] = "[%]"; + } + $gui->columnsDefinition->$item = $dummy['details']; + } + } + } + + $doubleItemToLoop = array( + 'priorities', + 'keywords', + 'testsuites' + ); + foreach ($doubleItemToLoop as $item) { + if (! empty($gui->statistics->$item)) { + $gui->columnsDefinition->$item = array(); + + // Get labels + // !!double current because main key is PLATFORM + $dummy = current(current($gui->statistics->$item)); + if (isset($dummy['details'])) { + foreach ($dummy['details'] as $status_verbose => $value) { + $dummy['details'][$status_verbose]['qty'] = lang_get( + $tlCfg->results['status_label'][$status_verbose]); + $dummy['details'][$status_verbose]['percentage'] = "[%]"; + } + $gui->columnsDefinition->$item = $dummy['details']; + } + } + } + + /* BUILDS REPORT */ + $colDefinition = null; + $results = null; + if ($gui->do_report['status_ok']) { + + $o = $metricsMgr->getOverallBuildStatusForRender($args->tplan_id); + $gui->statistics->overallBuildStatus = $o->info; + $gui->columnsDefinition->overallBuildStatus = $o->colDefinition; + $gui->displayBuildMetrics = ! is_null( + $gui->statistics->overallBuildStatus); + } + + // Build by Platform + $colDefinition = null; + $results = null; + if ($gui->do_report['status_ok']) { + $o = $metricsMgr->getBuildByPlatStatusForRender($args->tplan_id); + + $gui->statistics->buildByPlatMetrics = new stdClass(); + $gui->statistics->buildByPlatMetrics = $o->info; + $gui->columnsDefinition->buildByPlatMetrics = $o->colDefinition; + + $gui->displayBuildByPlatMetrics = ! is_null( + $gui->statistics->buildByPlatMetrics); + } + + /* MILESTONE & PRIORITY REPORT */ + // Need to be refactored ??? + $milestonesList = $tplan_mgr->get_milestones($args->tplan_id); + if (! empty($milestonesList)) { + $gui->statistics->milestones = $metricsMgr->getMilestonesMetrics( + $args->tplan_id, $milestonesList); + } +} + +$timerOff = microtime(true); +$gui->elapsed_time = round($timerOff - $timerOn, 2); + +if ($args->spreadsheet) { + createSpreadsheet($gui, $tplan_mgr); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($tplCfg->tpl, $smarty, $args->format, $mailCfg); + +/** + * + * @param database $dbHandler + * @return array + */ +function initArgs(&$dbHandler) +{ + $tplanMgr = null; + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "format" => array( + tlInputParameter::INT_N + ), + "sendByMail" => array( + tlInputParameter::INT_N + ), + "spreadsheet" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + G_PARAMS($iParams, $args); + + $args->spreadsheet = intval($args->spreadsheet); + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, true, false, "checkRights"); + + $tplanMgr = new testplan($dbHandler); + $tplan = $tplanMgr->get_by_id($args->tplan_id); + $args->tproject_id = $tplan['testproject_id']; + } + + if ($args->tproject_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + if (is_null($args->format)) { + tlog("Parameter 'format' is not defined", 'ERROR'); + exit(); + } + + $args->user = $_SESSION['currentUser']; + $args->format = $args->sendByMail ? FORMAT_MAIL_HTML : $args->format; + + return array( + $tplanMgr, + $args + ); +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param testplan $tplanMgr + * @return stdClass + */ +function initializeGui(&$dbHandler, $argsObj, &$tplanMgr) +{ + $gui = new stdClass(); + $gui->fakePlatform = array( + '' + ); + $gui->title = lang_get('title_gen_test_rep'); + $gui->do_report = array(); + $gui->showPlatforms = true; + $gui->columnsDefinition = new stdClass(); + $gui->columnsDefinition->keywords = null; + $gui->columnsDefinition->testers = null; + $gui->columnsDefinition->platform = null; + $gui->statistics = new stdClass(); + $gui->statistics->keywords = null; + $gui->statistics->testers = null; + $gui->statistics->milestones = null; + $gui->statistics->overalBuildStatus = null; + $gui->elapsed_time = 0; + $gui->displayBuildMetrics = false; + $gui->buildMetricsFeedback = lang_get('buildMetricsFeedback'); + + $mgr = new testproject($dbHandler); + $dummy = $mgr->get_by_id($argsObj->tproject_id); + $gui->testprojectOptions = new stdClass(); + $gui->testprojectOptions->testPriorityEnabled = $dummy['opt']->testPriorityEnabled; + $gui->tproject_name = $dummy['name']; + + $info = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->tplan_name = $info['name']; + $gui->tplan_id = intval($argsObj->tplan_id); + + $gui->platformSet = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + if (is_null($gui->platformSet)) { + $gui->platformSet = array( + '' + ); + $gui->showPlatforms = false; + } else { + natsort($gui->platformSet); + } + + $gui->basehref = $_SESSION['basehref']; + $gui->actionSendMail = $gui->basehref . + "lib/results/resultsGeneral.php?format=" . FORMAT_MAIL_HTML . + "&tplan_id={$gui->tplan_id}"; + + $gui->actionSpreadsheet = $gui->basehref . + "lib/results/resultsGeneral.php?format=" . FORMAT_XLS . + "&tplan_id={$gui->tplan_id}&spreadsheet=1"; + + $gui->mailFeedBack = new stdClass(); + $gui->mailFeedBack->msg = ''; + return $gui; +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + * @param testplan $tplanMgr + */ +function createSpreadsheet($gui, &$tplanMgr) +{ + + // N sections + // Always same format + // Platform + // Build Assigned Not Run [%] Passed [%] Failed [%] Blocked [%] + // Completed [%] + + // Results by Platform + // Overall Build Status + // Results by Build + // Results by Top Level Test Suite + // Results by priority + // Results by Keyword + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + // Common + $execStatusDomain = $tplanMgr->getStatusForReports(); + $dataHeaderMetrics = array(); + $ccc = 0; + foreach ($execStatusDomain as $human) { + $dataHeaderMetrics[] = lang_get('test_status_' . $human); + $ccc ++; + $dataHeaderMetrics[] = '[%]'; + $ccc ++; + } + $dataHeaderMetrics[] = $lbl['completed_perc']; + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + $oneLevel = array(); + + // NO PLATFORM => ID=0 + $hasPlatforms = count($gui->platformSet) >= 1 && + ! isset($gui->platformSet[0]); + if ($hasPlatforms) { + $oneLevel[] = array( + 'entity' => 'platform', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->platform + ); + } + + $oneLevel[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->overallBuildStatus + ); + + $startingRow = count($lines2write); // MAGIC + foreach ($oneLevel as $target) { + $entity = $target['entity']; + $dimension = $target['dimension']; + $dataHeader = array( + $lbl[$entity], + $lbl[$dimension] + ); + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $startingRow ++; + $startingRow ++; + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + $infoSet = $target['source']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + foreach ($infoSet as $fieldSet) { + + $whatCell = 0; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + $startingRow ++; + } + } + + // The first column will be the platform + $twoLevels = array(); + + if ($hasPlatforms) { + $twoLevels[] = array( + 'entity' => 'build', + 'dimension' => 'testcase_qty', + 'nameKey' => 'build_name', + 'tcQtyKey' => 'total_assigned', + 'source' => &$gui->statistics->buildByPlatMetrics + ); + } + + $twoLevels[] = array( + 'entity' => 'testsuite', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->testsuites + ); + + $twoLevels[] = array( + 'entity' => 'priority', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->priorities + ); + + $twoLevels[] = array( + 'entity' => 'keyword', + 'dimension' => 'testcase_qty', + 'nameKey' => 'name', + 'tcQtyKey' => 'total_tc', + 'source' => &$gui->statistics->keywords + ); + + foreach ($twoLevels as $target) { + $startingRow ++; + $startingRow ++; + + $entity = $target['entity']; + $dimension = $target['dimension']; + $nameKey = $target['nameKey']; + $tcQtyKey = $target['tcQtyKey']; + + if (count($target['source']) == 0) { + continue; + } + + // Just ONE HEADER ? + $dataHeader = array( + $lbl['platform'], + $lbl[$entity], + $lbl[$dimension] + ); + if (! $hasPlatforms) { + array_shift($dataHeader); + } + + // intermediate column qty is dynamic because it depends + // of status configuration. + foreach ($dataHeaderMetrics as $val) { + $dataHeader[] = $val; + } + + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + // END ONE HEADER + $startingRow ++; + + $idr = ''; + foreach ($gui->platformSet as $platID => $platName) { + $idr = ('' == $idr || 'rowB' == $idr) ? 'rowA' : 'rowB'; + + $infoSet = isset($target['source'][$platID]) ? $target['source'][$platID] : array(); + + foreach ($infoSet as $fieldSet) { + $whatCell = 0; + + if ($hasPlatforms) { + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $platName; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + } + + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$nameKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $field = $fieldSet[$tcQtyKey]; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $field); + + foreach ($fieldSet['details'] as $metrics) { + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['qty']); + + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $metrics['percentage']); + } + $whatCell ++; + $cellID = $cellRange[$whatCell] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, + $fieldSet['percentage_completed']); + + $cellZone = "A{$startingRow}:" . $cellRange[$whatCell] . + "$startingRow"; + + $objPHPExcel->getActiveSheet() + ->getStyle($cellZone) + ->applyFromArray($style[$idr]); + + $startingRow ++; + } + } + } + + // Just to add some final empty row + $cellID = $cellRange[0] . $startingRow; + $field = ''; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + + // Final step + $tmpfname = tempnam(config_get('temp_dir'), "TestLink_GTMP.tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + downloadXls($tmpfname, $xlsType, $gui, 'TestLink_GTMP_'); +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'testsuite' => null, + 'testcase_qty' => null, + 'keyword' => null, + 'platform' => null, + 'priority' => null, + 'priority_level' => null, + 'build' => null, + 'testplan' => null, + 'testproject' => null, + 'not_run' => null, + 'completed_perc' => 'trep_comp_perc', + 'generated_by_TestLink_on' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + + $style['rowA'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FFFFFFFF' + ) + ) + ); + + $style['rowB'] = array( + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'DCDCDCDC' + ) + ) + ); + + return $style; +} + +/** + * + * @return array + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); } diff --git a/lib/results/resultsImport.php b/lib/results/resultsImport.php index 8e2370c5fb..e132d3025b 100644 --- a/lib/results/resultsImport.php +++ b/lib/results/resultsImport.php @@ -1,742 +1,866 @@ -doUpload) { - // check the uploaded file - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - - if (($source != 'none') && ($source != '')) { - $gui->file_check['status_ok']=1; - if($gui->file_check['status_ok']) { - if (move_uploaded_file($source, $dest)) { - switch($args->importType) { - case 'XML': - $pcheck_fn="check_xml_execution_results"; - $pimport_fn="importExecutionResultsFromXML"; - break; - } - - if ($pcheck_fn) { - $gui->file_check=$pcheck_fn($dest); - if($gui->file_check['status_ok']) { - if ($pimport_fn) { - $resultMap=$pimport_fn($db,$dest,$args); - } - } - } - } - } - } else { - $gui->file_check=array('status_ok' => 0, 'msg' => lang_get('please_choose_file_to_import')); - $args->importType=null; - } +doUpload) { + // check the uploaded file + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + + if (($source != 'none') && ($source != '')) { + $gui->file_check['status_ok'] = 1; + if ($gui->file_check['status_ok'] && move_uploaded_file($source, $dest)) { + switch ($args->importType) { + case 'XML': + $pcheck_fn = "check_xml_execution_results"; + $pimport_fn = "importExecutionResultsFromXML"; + break; + } + + if ($pcheck_fn) { + $gui->file_check = $pcheck_fn($dest); + if ($gui->file_check['status_ok'] && $pimport_fn) { + $resultMap = $pimport_fn($db, $dest, $args); + } + } + } + } else { + $gui->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + $args->importType = null; + } +} + +$gui->resultMap = $resultMap; +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * + * args : + * + * returns: + * + */ +function importExecutionResultsFromXML(&$db, $fileName, $context) +{ + $resultMap = null; + + $xml = @simplexml_load_file_wrapper($fileName); + if ($xml !== false) { + $resultMap = importResults($db, $xml, $context); + } + return $resultMap; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function importResults(&$db, &$xml, $context) +{ + $resultMap = null; + + if ($xml->getName() == 'results') { + // check if additional data (context execution) has been provided, + // if yes overwrite GUI selection with value get from file + // + $executionContext = $context; + $contextKeys = array( + 'testproject' => array( + 'id' => 'tprojectID', + 'name' => 'tprojectName' + ), + 'testplan' => array( + 'id' => 'tplanID', + 'name' => 'tplanName' + ), + 'build' => array( + 'id' => 'buildID', + 'name' => 'buildName' + ), + 'platform' => array( + 'id' => 'platformID', + 'name' => 'platformName' + ) + ); + + foreach ($contextKeys as $xmlkey => $execElem) { + if ($joker = $xml->$xmlkey) { + // IMPORTANT NOTICE: name has precedence over id + if (isset($joker['name'])) { + $executionContext->$execElem['name'] = (string) $joker['name']; + $executionContext->$execElem['id'] = null; // get rid of id passed from GUI + continue; + } + + if (isset($joker['id'])) { + $executionContext->$execElem['id'] = (int) $joker['id']; + $executionContext->$execElem['name'] = null; + } + } + } + + $xmlTCExec = $xml->xpath("//testcase"); + $resultData = importExecutionsFromXML($xmlTCExec); + if ($resultData) { + $resultMap = saveImportedResultData($db, $resultData, + $executionContext, $context); + } + } + return $resultMap; +} + +/* + * function: saveImportedResultData + * + * args : + * + * returns: + * + * rev: + */ +function saveImportedResultData(&$db, $resultData, $context, $options) +{ + if (! $resultData) { + return; + } + + $debugMsg = ' FUNCTION: ' . __FUNCTION__; + $tables = tlObjectWithDB::getDBTables( + array( + 'executions', + 'execution_bugs' + )); + + $tcaseCfg = config_get('testcase_cfg'); + + $l10n = array( + 'import_results_tc_not_found' => '', + 'import_results_invalid_result' => '', + 'tproject_id_not_found' => '', + 'import_results_ok' => '', + 'invalid_cf' => '', + 'import_results_skipped' => '' + ); + + foreach ($l10n as $key => $value) { + $l10n[$key] = lang_get($key); + } + + $resultsCfg = config_get('results'); + foreach ($resultsCfg['status_label'] as $ks => $lbl) { + $key = $resultsCfg['status_code'][$ks]; + $l10n[$key] = lang_get($lbl); + } + + // Get Column definitions to get size dinamically instead of create constants + $columnDef = array(); + $adodbObj = $db->get_dbmgr_object(); + $columnDef['execution_bugs'] = $adodbObj->MetaColumns( + $tables['execution_bugs']); + $keySet = array_keys($columnDef['execution_bugs']); + foreach ($keySet as $keyName) { + if (($keylow = strtolower($keyName)) != $keyName) { + $columnDef['execution_bugs'][$keylow] = $columnDef['execution_bugs'][$keyName]; + unset($columnDef['execution_bugs'][$keyName]); + } + } + $user = new tlUser($context->userID); + $user->readFromDB($db); + + $tcaseMgr = new testcase($db); + + $resultMap = array(); + $tplan_mgr = null; + + $tc_qty = count($resultData); + if ($tc_qty) { + $tplan_mgr = new testplan($db); + $tproject_mgr = new testproject($db); + $build_mgr = new build_mgr($db); + } + + // Need to do checks on common settings + // + // test project exists + // + // test plan id: + // belongs to target test project + // is active + // build id: + // belongs to target test plan + // is open + // + // platform id: + // is linked to target test plan + // + // execution type if not present -> set to MANUAL + // if presente is valid i.e. inside the TL domain + $checks = array(); + $checks['msg'] = null; + $dummy = null; + + if (! is_null($context->tprojectID) && intval($context->tprojectID) > 0) { + $dummy = array( + $tproject_mgr->get_by_id($context->tprojectID, + array( + 'output' => 'existsByID' + )) + ); + } elseif (! is_null($context->tprojectName)) { + $dummy = $tproject_mgr->get_by_name($context->tprojectName, null, + array( + 'output' => 'existsByName' + )); + } + + $checks['status_ok'] = ! is_null($dummy); + if (! $checks['status_ok']) { + $checks['msg'][] = sprintf($l10n['tproject_id_not_found'], + $context->tprojectID); + } + + if (! $checks['status_ok']) { + foreach ($checks['msg'] as $warning) { + $resultMap[] = array( + $warning + ); + } + } + + if ($doIt = $checks['status_ok']) { + $context->tprojectID = $dummy[0]['id']; + } + + $dummy = null; + if (! is_null($context->tplanID) && intval($context->tplanID) > 0) { + $dummy = $tplan_mgr->get_by_id($context->tplanID, + array( + 'output' => 'minimun' + )); + if (! is_null($dummy)) { + $dummy['id'] = $context->tplanID; + } + } elseif (! is_null($context->tplanName)) { + $dummy = $tplan_mgr->get_by_name($context->tplanName, + $context->tprojectID, array( + 'output' => 'minimun' + )); + if (! is_null($dummy)) { + $dummy = $dummy[0]; + } + } + + if (! is_null($dummy)) { + $context->tplanID = $dummy['id']; + } + + if ((intval($context->tprojectID) <= 0) && intval($context->tplanID) > 0) { + $dummy = $tplan_mgr->tree_manager->get_node_hierarchy_info( + $context->tplanID); + $context->tprojectID = $dummy['parent_id']; + } + + $dummy = null; + $tplan_mgr->platform_mgr->setTestProjectID($context->tprojectID); + if (! is_null($context->platformID) && intval($context->platformID) > 0) { + $dummy = array( + $tplan_mgr->platform_mgr->getByID($context->platformID) + ); + } elseif (property_exists($context, 'platformName') && + ! is_null($context->platformName)) { + if (! is_null( + $xx = $tplan_mgr->platform_mgr->getID($context->platformName))) { + $dummy = array( + 0 => array( + 'id' => $xx + ) + ); + } + } + if (! is_null($dummy)) { + $context->platformID = $dummy[0]['id']; + } + + $optGB = array( + 'tplan_id' => $context->tplanID, + 'output' => 'minimun' + ); + $dummy = null; + if (! is_null($context->buildID) && intval($context->buildID) > 0) { + $dummy = array( + $build_mgr->get_by_id($context->buildID, $optGB) + ); + } elseif (! is_null($context->buildName)) { + $dummy = $build_mgr->get_by_name($context->buildName, $optGB); + } + + if (! is_null($dummy)) { + $context->buildID = $dummy[0]['id']; + } + + for ($idx = 0; $doIt && $idx < $tc_qty; $idx ++) { + + $tester_id = 0; + $tester_name = ''; + $using_external_id = false; + $message = null; + $status_ok = true; + $tcase_exec = $resultData[$idx]; + + // New attribute "execution type" makes old XML import files incompatible + // Important NOTICE: + // tcase_exec is passed BY REFERENCE to allow check_exec_values()change execution type if needed + $checks = checkExecValues($db, $tcaseMgr, $user_mgr, $tcaseCfg, + $tcase_exec, $columnDef['execution_bugs']); + $status_ok = $checks['status_ok']; + if ($status_ok) { + $tcase_id = $checks['tcase_id']; + $tcase_external_id = trim($tcase_exec['tcase_external_id']); + $tester_id = $checks['tester_id']; + + // external_id has precedence over internal id + $using_external_id = ($tcase_external_id != ""); + } else { + foreach ($checks['msg'] as $warning) { + $resultMap[] = array( + $warning + ); + } + } + + if ($status_ok) { + $tcase_identity = $using_external_id ? $tcase_external_id : $tcase_id; + $result_code = strtolower($tcase_exec['result']); + $result_is_acceptable = isset( + $resultsCfg['code_status'][$result_code]) ? true : false; + $notes = $tcase_exec['notes']; + $message = null; + + $info_on_case = $tplan_mgr->getLinkInfo($context->tplanID, $tcase_id, + $context->platformID); + if (is_null($info_on_case)) { + $message = sprintf($l10n['import_results_tc_not_found'], + $tcase_identity); + } elseif (! $result_is_acceptable) { + $message = sprintf($l10n['import_results_invalid_result'], + $tcase_identity, $tcase_exec['result']); + } else { + $info_on_case = current($info_on_case); + $tcversion_id = $info_on_case['tcversion_id']; + $version = $info_on_case['version']; + $notes = $db->prepare_string(trim($notes)); + + // N.B.: db_now() returns an string ready to be used in an SQL insert + // example '2008-09-04', while $tcase_exec["timestamp"] => 2008-09-04 + $execution_ts = ($tcase_exec['timestamp'] != '') ? "'" . + $tcase_exec["timestamp"] . "'" : $db->db_now(); + + if ($tester_id != 0) { + $tester_name = $tcase_exec['tester']; + } else { + $tester_name = $user->login; + $tester_id = $context->userID; + } + + $addExecDuration = (strlen($tcase_exec['execution_duration']) > 0 && + is_numeric($tcase_exec['execution_duration'])); + + $lexid = 0; + if ($options->copyIssues) { + $lexid = $tcaseMgr->getSystemWideLastestExecutionID( + $tcversion_id); + } + + $idCard = array( + 'id' => $tcase_id, + 'version_id' => $tcversion_id + ); + $exco = array( + 'tplan_id' => $context->tplanID, + 'platform_id' => $context->platformID, + 'build_id' => $context->buildID + ); + $lexInfo = $tcaseMgr->getLatestExecSingleContext($idCard, $exco, + array( + 'output' => 'timestamp' + )); + $doInsert = true; + if (! is_null($lexInfo)) { + $doInsert = ($lexInfo[$tcase_id][0]['execution_ts'] != + trim($execution_ts, "'")); + $msgTxt = $l10n['import_results_skipped']; + } + + if ($doInsert) { + $sql = " /* $debugMsg */ " . + " INSERT INTO {$tables['executions']} (build_id,tester_id,status,testplan_id," . + " tcversion_id,execution_ts,notes,tcversion_number,platform_id,execution_type" . + ($addExecDuration ? ',execution_duration' : '') . ")" . + " VALUES ({$context->buildID}, {$tester_id},'{$result_code}',{$context->tplanID}, " . + " {$tcversion_id},{$execution_ts},'{$notes}', {$version}, " . + " {$context->platformID}, {$tcase_exec['execution_type']}" . + ($addExecDuration ? ",{$tcase_exec['execution_duration']}" : '') . + ")"; + + $db->exec_query($sql); + $execution_id = $db->insert_id($tables['executions']); + + if ($lexid > 0 && $options->copyIssues) { + copyIssues($db, $lexid, $execution_id); + } + + if (isset($tcase_exec['steps']) && + ! is_null($tcase_exec['steps']) && $execution_id > 0) { + $stepSet = $tcaseMgr->getStepsSimple($tcversion_id, 0, + array( + 'fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', + 'accessKey' => 'step_number' + )); + $sc = count($tcase_exec['steps']); + + for ($sx = 0; $sx < $sc; $sx ++) { + $snum = $tcase_exec['steps'][$sx]['step_number']; + + if (isset($stepSet[$snum])) { + $tcstep_id = $stepSet[$snum]['id']; + $target = DB_TABLE_PREFIX . 'execution_tcsteps'; + + $doIt = (! is_null( + $tcase_exec['steps'][$sx]['result']) && + trim($tcase_exec['steps'][$sx]['result']) != + '') || + $tcase_exec['steps'][$sx]['result'] != + $resultsCfg['status_code']['not_run']; + + if ($doIt) { + $sql = " INSERT INTO {$target} (execution_id,tcstep_id,notes"; + $values = " VALUES ( {$execution_id}, {$tcstep_id} , " . + "'" . + $db->prepare_string( + $tcase_exec['steps'][$sx]['notes']) . + "'"; + + $status = strtolower( + trim( + $tcase_exec['steps'][$sx]['result'])); + $status = $status[0]; + $sql .= ",status"; + $values .= ",'" . + $db->prepare_string( + $tcase_exec['steps'][$sx]['result']) . + "'"; + + $sql .= ") " . $values . ")"; + $db->exec_query($sql); + + $db->insert_id($target); + } + } + } + } + + if (isset($tcase_exec['bug_id']) && + ! is_null($tcase_exec['bug_id']) && + is_array($tcase_exec['bug_id'])) { + + foreach ($tcase_exec['bug_id'] as $bug_id) { + $bug_id = trim($bug_id); + $sql = " /* $debugMsg */ " . + " SELECT execution_id AS check_qty FROM {$tables['execution_bugs']} " . + " WHERE bug_id = '{$bug_id}' AND execution_id={$execution_id} "; + $rs = $db->get_recordset($sql); + if (is_null($rs)) { + $sql = " /* $debugMsg */ " . + " INSERT INTO {$tables['execution_bugs']} (bug_id,execution_id)" . + " VALUES ('" . $db->prepare_string($bug_id) . + "', {$execution_id} )"; + $db->exec_query($sql); + } + } + } + + if (isset($tcase_exec['custom_fields']) && + ! is_null($tcase_exec['custom_fields']) && + is_array($tcase_exec['custom_fields'])) { + + // Get linked custom fields to this test project, for test case on execution + // $context->tprojectID + $cfieldMgr = new cfield_mgr($db); + $cfSetByName = $cfieldMgr->get_linked_cfields_at_execution( + $context->tprojectID, 1, 'testcase', null, null, + null, 'name'); + + foreach ($tcase_exec['custom_fields'] as $cf) { + $ak = null; + if (isset($cfSetByName[$cf['name']])) { + // write to db blind + $ak[$cfSetByName[$cf['name']]['id']]['cf_value'] = $cf['value']; + } else { + $message = sprintf($l10n['invalid_cf'], + $tcase_identity, $cf['name']); + } + + if (! is_null($ak)) { + $cfieldMgr->execution_values_to_db($ak, + $tcversion_id, $execution_id, + $context->tplanID, null, 'plain'); + } + } + } + + if (! is_null($message)) { + $resultMap[] = array( + $message + ); + } + $msgTxt = $l10n['import_results_ok']; + } + $message = sprintf($msgTxt, $tcase_identity, $version, + $tester_name, $l10n[$result_code], $execution_ts); + } + } + + if (! is_null($message)) { + $resultMap[] = array( + $message + ); + } + } + return $resultMap; +} + +/* + * function: importExecutionsFromXML + * + * args : + * + * returns: + * + */ +function importExecutionsFromXML($xmlTCExecSet) +{ + $execInfoSet = null; + if ($xmlTCExecSet) { + $jdx = 0; + $exec_qty = count($xmlTCExecSet); + for ($idx = 0; $idx < $exec_qty; $idx ++) { + $xmlTCExec = $xmlTCExecSet[$idx]; + $execInfo = importExecutionFromXML($xmlTCExec); + if ($execInfo) { + $execInfoSet[$jdx ++] = $execInfo; + } + } + } + + return $execInfoSet; +} + +/* + * function: importExecutionFromXML() + * + * args : + * + * returns: + * + */ +function importExecutionFromXML(&$xmlTCExec) +{ + if (! $xmlTCExec) { + return null; + } + + $execInfo = array(); + $execInfo['tcase_id'] = isset($xmlTCExec["id"]) ? (int) $xmlTCExec["id"] : 0; + $execInfo['tcase_external_id'] = (string) $xmlTCExec["external_id"]; + + // Developer Note - 20100328 - franciscom: + // seems that no PHP error is generated when trying to access an undefined + // property. Do not know if will not be better anyway to use property_exists() + $execInfo['tcase_name'] = (string) $xmlTCExec->name; + $execInfo['result'] = (string) trim($xmlTCExec->result); + $execInfo['notes'] = (string) trim($xmlTCExec->notes); + $execInfo['timestamp'] = (string) trim($xmlTCExec->timestamp); + $execInfo['tester'] = (string) trim($xmlTCExec->tester); + $execInfo['execution_type'] = intval((int) trim($xmlTCExec->execution_type)); + $execInfo['execution_duration'] = trim($xmlTCExec->execution_duration); + + if (! empty($xmlTCExec->bug_id)) { + foreach ($xmlTCExec->bug_id as $bug) { + $execInfo['bug_id'][] = (string) $bug; + } + } + + $execInfo['steps'] = null; + if (property_exists($xmlTCExec, 'steps') && + property_exists($xmlTCExec->steps, 'step')) { + $itemStructure['elements'] = array( + 'integer' => array( + "step_number" => 'intval' + ), + 'string' => array( + "result" => 'trim', + "notes" => 'trim' + ) + ); + $execInfo['steps'] = getItemsFromSimpleXMLObj($xmlTCExec->steps->step, + $itemStructure); + } + + $execInfo['custom_fields'] = null; + if (property_exists($xmlTCExec, 'custom_fields') && + property_exists($xmlTCExec->custom_fields, 'custom_field')) { + $itemStructure['elements'] = array( + 'string' => array( + "name" => 'trim', + "value" => 'trim' + ) + ); + $execInfo['custom_fields'] = getItemsFromSimpleXMLObj( + $xmlTCExec->custom_fields->custom_field, $itemStructure); + } + + return $execInfo; +} + +/* + * function: + * + * Check if at least the file starts seems OK + * + */ +function checkXMLExecutionResults($fileName) +{ + $file_check = array( + 'status_ok' => 0, + 'msg' => 'xml_ko' + ); + $xml = @simplexml_load_file_wrapper($fileName); + if ($xml !== false) { + $file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $elementName = $xml->getName(); + if ($elementName != 'results') { + $file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('wrong_results_import_format') + ); + } + } + return $file_check; +} + +/* + * function: init_args(&$dbHandler) + * + * args : + * + * returns: + * + */ +function initArgs(&$dbHandler) +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; + $args->copyIssues = isset($_REQUEST['copyIssues']) ? 1 : 0; + + // Need to use REQUEST because sometimes data arrives on GET and other on POST (has hidden fields) + $args->buildID = isset($_REQUEST['buildID']) ? intval($_REQUEST['buildID']) : null; + $args->platformID = isset($_REQUEST['platformID']) ? intval( + $_REQUEST['platformID']) : null; + $args->tplanID = isset($_REQUEST['tplanID']) ? intval($_REQUEST['tplanID']) : null; + $args->tplanID = ! is_null($args->tplanID) ? $args->tplanID : intval( + $_SESSION['testplanID']); + + $args->tprojectID = isset($_REQUEST['tprojectID']) ? intval( + $_REQUEST['tprojectID']) : null; + + if (is_null($args->tprojectID)) { + $args->tprojectID = intval($_SESSION['testprojectID']); + $args->testprojectName = $_SESSION['testprojectName']; + } else { + $tproject_mgr = new testproject($dbHandler); + $dummy = $tproject_mgr->get_by_id($args->tprojectID); + $args->testprojectName = $dummy['name']; + } + + $args->doUpload = isset($_REQUEST['UploadFile']) ? 1 : 0; + $args->userID = intval($_SESSION['userID']); + + return $args; +} + +/* + * function: check_exec_values() + * + * args : + * + * returns: map + * keys: + * status_ok -> value=true / false + * tcase_id: test case id if controls OK + * tester_id: tester_id if controls OK + * msg -> array with localized messages + * + * @internal revisions + */ +function checkExecValues(&$db, &$tcaseMgr, &$user_mgr, $tcaseCfg, &$execValues, + &$columnDef) +{ + $tables = tlObjectWithDB::getDBTables(array( + 'users', + 'execution_bugs' + )); + $checks = array( + 'status_ok' => false, + 'tcase_id' => 0, + 'tester_id' => 0, + 'msg' => array() + ); + $tcase_id = $execValues['tcase_id']; + $tcase_external_id = trim($execValues['tcase_external_id']); + $using_external_id = ($tcase_external_id != ""); // external_id has precedence over internal id + + if ($using_external_id) { + // need to get internal id + $checks['tcase_id'] = $tcaseMgr->getInternalID($tcase_external_id); + $checks['status_ok'] = intval($checks['tcase_id']) > 0 ? true : false; + if (! $checks['status_ok']) { + $checks['msg'][] = sprintf( + lang_get('tcase_external_id_do_not_exists'), $tcase_external_id); + } + } else { + // before using internal id, I want to check it's a number + $checks['tcase_id'] = $tcase_id; + $checks['status_ok'] = intval($checks['tcase_id']) > 0 ? true : false; + if (! $checks['status_ok']) { + $checks['msg'][] = sprintf(lang_get('tcase_id_is_not_number'), + $tcase_id); + } + } + + if ($checks['status_ok']) { + // useful for user feedback + $identity = $using_external_id ? $tcase_external_id : $checks['tcase_id']; + } + + if ($checks['status_ok'] && $execValues['timestamp'] != '') { + $checks['status_ok'] = isValidISODateTime($execValues['timestamp']); + if (! $checks['status_ok']) { + $checks['msg'][] = sprintf(lang_get('invalid_execution_timestamp'), + $identity, $execValues['timestamp']); + } + } + + if ($checks['status_ok'] && $execValues['tester'] != '') { + $sql = "SELECT id,login FROM {$tables['users']} WHERE login ='" . + $db->prepare_string($execValues['tester']) . "'"; + $userInfo = $db->get_recordset($sql); + + if (! is_null($userInfo) && isset($userInfo[0]['id'])) { + $checks['tester_id'] = $userInfo[0]['id']; + } else { + $checks['status_ok'] = false; + $checks['msg'][] = sprintf(lang_get('invalid_tester'), $identity, + $execValues['tester']); + } + } + + $execValues['bug_id'] = isset($execValues['bug_id']) ? $execValues['bug_id'] : null; + if ($checks['status_ok'] && ! is_null($execValues['bug_id']) && + is_array($execValues['bug_id'])) { + foreach ($execValues['bug_id'] as $bug_id) { + if (($field_len = strlen(trim($bug_id))) > + $columnDef['bug_id']->max_length) { + $checks['msg'][] = sprintf(lang_get('bug_id_invalid_len'), + $field_len, $columnDef['bug_id']->max_length); + $checks['status_ok'] = false; + break; + } + } + } + + if ($checks['status_ok'] && isset($execValues['execution_type'])) { + $execValues['execution_type'] = intval($execValues['execution_type']); + $execDomain = $tcaseMgr->get_execution_types(); + if ($execValues['execution_type'] == 0) { + $execValues['execution_type'] = TESTCASE_EXECUTION_TYPE_MANUAL; + // right now this is useless, but may be in future can be used, then I choose to leave it. + $checks['msg'][] = sprintf(lang_get('missing_exec_type'), + $execValues['execution_type'], + $execDomain[$execValues['execution_type']]); + } else { + $checks['status_ok'] = isset( + $execDomain[$execValues['execution_type']]); + if (! $checks['status_ok']) { + $checks['msg'][] = sprintf(lang_get('invalid_exec_type'), + $execValues['execution_type']); + } + } + } + + return $checks; +} + +/** + */ +function initializeGui(&$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->import_title = lang_get('title_results_import_to'); + $guiObj->buildID = $argsObj->buildID; + $guiObj->platformID = $argsObj->platformID; + $guiObj->tplanID = $argsObj->tplanID; + + $guiObj->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $guiObj->importTypes = array( + "XML" => "XML" + ); + $guiObj->importLimit = config_get('import_file_max_size_bytes'); + $guiObj->doImport = ($argsObj->importType != ""); + $guiObj->testprojectName = $argsObj->testprojectName; + $guiObj->copyIssues = $argsObj->copyIssues; + return $guiObj; } - -$gui->resultMap=$resultMap; -$smarty=new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/* - function: - - args : - - returns: - -*/ -function importExecutionResultsFromXML(&$db,$fileName,$context) { - $resultMap=null; - - $xml = @simplexml_load_file_wrapper($fileName); - if($xml !== FALSE) { - $resultMap = importResults($db,$xml,$context); - } - return $resultMap; -} - - -/* - function: - - args : - - returns: - -*/ -function importResults(&$db,&$xml,$context) { - $resultMap = null; - - if($xml->getName() == 'results') { - // check if additional data (context execution) has been provided, - // if yes overwrite GUI selection with value get from file - // - $executionContext = $context; - $contextKeys = - array('testproject' => array('id' => 'tprojectID', 'name' => 'tprojectName'), - 'testplan' => array('id' => 'tplanID', 'name' => 'tplanName'), - 'build' => array('id' => 'buildID', 'name' => 'buildName'), - 'platform' => array('id' => 'platformID', 'name' => 'platformName')); - - - foreach( $contextKeys as $xmlkey => $execElem) { - if( ($joker = $xml->$xmlkey) ) { - // IMPORTANT NOTICE: name has precedence over id - if( isset($joker['name']) ) { - $executionContext->$execElem['name'] = (string) $joker['name']; - $executionContext->$execElem['id'] = null; // get rid of id passed from GUI - continue; - } - - if( isset($joker['id']) ) { - $executionContext->$execElem['id'] = (int) $joker['id']; - $executionContext->$execElem['name'] = null; - } - } - } - - $xmlTCExec = $xml->xpath("//testcase"); - $resultData = importExecutionsFromXML($xmlTCExec); - if ($resultData) { - $resultMap = saveImportedResultData($db,$resultData,$executionContext,$context); - } - } - return $resultMap; -} - - - -/* - function: saveImportedResultData - - args : - - returns: - - rev: -*/ -function saveImportedResultData(&$db,$resultData,$context,$options) { - - if (!$resultData) { - return; - } - - $debugMsg = ' FUNCTION: ' . __FUNCTION__; - $tables = tlObjectWithDB::getDBTables(array('executions','execution_bugs')); - - $tcaseCfg = config_get('testcase_cfg'); - - // -------------------------------------------------------------------------------- - $l10n = - array('import_results_tc_not_found' => '' ,'import_results_invalid_result' => '', - 'tproject_id_not_found' => '', 'import_results_ok' => '', - 'invalid_cf' => '', 'import_results_skipped' => ''); - - foreach($l10n as $key => $value) { - $l10n[$key] = lang_get($key); - } - - $resultsCfg=config_get('results'); - foreach($resultsCfg['status_label'] as $ks => $lbl) { - $key = $resultsCfg['status_code'][$ks]; - $l10n[$key] = lang_get($lbl); - } - // --------------------------------------------------------------------------------- - - // Get Column definitions to get size dinamically instead of create constants - $columnDef = array(); - $adodbObj = $db->get_dbmgr_object(); - $columnDef['execution_bugs'] = $adodbObj->MetaColumns($tables['execution_bugs']); - $keySet = array_keys($columnDef['execution_bugs']); - foreach($keySet as $keyName) { - if( ($keylow=strtolower($keyName)) != $keyName ) { - $columnDef['execution_bugs'][$keylow] = $columnDef['execution_bugs'][$keyName]; - unset($columnDef['execution_bugs'][$keyName]); - } - } - $user = new tlUser($context->userID); - $user->readFromDB($db); - - $tcase_mgr = new testcase($db); - - $resultMap = array(); - $tplan_mgr = null; - - $tc_qty = sizeof($resultData); - if($tc_qty) { - $tplan_mgr=new testplan($db); - $tproject_mgr=new testproject($db); - $build_mgr=new build_mgr($db); - } - - // Need to do checks on common settings - // - // test project exists - // - // test plan id: - // belongs to target test project - // is active - // build id: - // belongs to target test plan - // is open - // - // platform id: - // is linked to target test plan - // - // execution type if not present -> set to MANUAL - // if presente is valid i.e. inside the TL domain - // - $checks = array(); - $checks['status_ok'] = true; - $checks['msg'] = null; - $dummy = null; - - if( !is_null($context->tprojectID) && intval($context->tprojectID) > 0) { - $dummy = array($tproject_mgr->get_by_id($context->tprojectID,array('output' => 'existsByID'))); - } else if( !is_null($context->tprojectName) ) { - $dummy = $tproject_mgr->get_by_name($context->tprojectName,null,array('output' => 'existsByName')); - } - - $checks['status_ok'] = !is_null($dummy); - if( !$checks['status_ok'] ) { - $checks['msg'][] = sprintf($l10n['tproject_id_not_found'],$context->tprojectID); - } - - if( !$checks['status_ok'] ) { - foreach($checks['msg'] as $warning ) { - $resultMap[]=array($warning); - } - } - - if( ($doIt = $checks['status_ok']) ) { - $context->tprojectID = $dummy[0]['id']; - } - - // -------------------------------------------------------------------- - $dummy = null; - if( !is_null($context->tplanID) && intval($context->tplanID) > 0 ) { - $dummy = $tplan_mgr->get_by_id($context->tplanID,array('output' => 'minimun')); - if( !is_null($dummy) ) { - $dummy['id'] = $context->tplanID; - } - } else if( !is_null($context->tplanName) ) { - $dummy = $tplan_mgr->get_by_name($context->tplanName,$context->tprojectID,array('output' => 'minimun')); - if( !is_null($dummy) ) { - $dummy = $dummy[0]; - } - } - - if( !is_null($dummy) ) { - $context->tplanID = $dummy['id']; - } - - if( (intval($context->tprojectID) <= 0) && intval($context->tplanID) > 0) { - $dummy = $tplan_mgr->tree_manager->get_node_hierarchy_info($context->tplanID); - $context->tprojectID = $dummy['parent_id']; - } - // -------------------------------------------------------------------- - - // -------------------------------------------------------------------- - $dummy = null; - $tplan_mgr->platform_mgr->setTestProjectID($context->tprojectID); - if( !is_null($context->platformID) && intval($context->platformID) > 0 ) { - $dummy = array($tplan_mgr->platform_mgr->getByID($context->platformID)); - } else if( property_exists($context,'platformName') && !is_null($context->platformName) ) { - if( !is_null($xx = $tplan_mgr->platform_mgr->getID($context->platformName) ) ) { - $dummy = array(0 => array('id' => $xx)); - } - } - if( !is_null($dummy) ) { - $context->platformID = $dummy[0]['id']; - } - // -------------------------------------------------------------------- - - // -------------------------------------------------------------------- - $optGB = array('tplan_id' => $context->tplanID, 'output' => 'minimun'); - $dummy = null; - if( !is_null($context->buildID) && intval($context->buildID) > 0 ) { - $dummy = array($build_mgr->get_by_id($context->buildID,$optGB)); - } else if( !is_null($context->buildName) ) { - $dummy = $build_mgr->get_by_name($context->buildName,$optGB); - } - - if( !is_null($dummy) ) { - $context->buildID = $dummy[0]['id']; - } - // -------------------------------------------------------------------- - - // -------------------------------------------------------------------- - for($idx=0; $doIt && $idx < $tc_qty;$idx++) { - - $tester_id = 0; - $tester_name = ''; - $using_external_id = false; - $message = null; - $status_ok = true; - $tcase_exec = $resultData[$idx]; - - // New attribute "execution type" makes old XML import files incompatible - // Important NOTICE: - // tcase_exec is passed BY REFERENCE to allow check_exec_values()change execution type if needed - // - $checks = check_exec_values($db,$tcase_mgr,$user_mgr,$tcaseCfg,$tcase_exec,$columnDef['execution_bugs']); - $status_ok = $checks['status_ok']; - if($status_ok) { - $tcase_id = $checks['tcase_id']; - $tcase_external_id = trim($tcase_exec['tcase_external_id']); - $tester_id = $checks['tester_id']; - - // external_id has precedence over internal id - $using_external_id = ($tcase_external_id != ""); - } else { - foreach($checks['msg'] as $warning ) { - $resultMap[]=array($warning); - } - } - - if( $status_ok ) { - $tcase_identity = $using_external_id ? $tcase_external_id : $tcase_id; - $result_code = strtolower($tcase_exec['result']); - $result_is_acceptable = isset($resultsCfg['code_status'][$result_code]) ? true : false; - $notes = $tcase_exec['notes']; - $message = null; - - $info_on_case = $tplan_mgr->getLinkInfo($context->tplanID,$tcase_id,$context->platformID); - if(is_null($info_on_case)) { - $message=sprintf($l10n['import_results_tc_not_found'],$tcase_identity); - } else if (!$result_is_acceptable) { - $message=sprintf($l10n['import_results_invalid_result'],$tcase_identity,$tcase_exec['result']); - } else { - $info_on_case = current($info_on_case); - $tcversion_id = $info_on_case['tcversion_id']; - $version = $info_on_case['version']; - $notes = $db->prepare_string(trim($notes)); - - // N.B.: db_now() returns an string ready to be used in an SQL insert - // example '2008-09-04', while $tcase_exec["timestamp"] => 2008-09-04 - // - $execution_ts=($tcase_exec['timestamp'] != '') ? "'" . $tcase_exec["timestamp"] . "'": $db->db_now(); - - if($tester_id != 0) { - $tester_name=$tcase_exec['tester']; - } else { - $tester_name=$user->login; - $tester_id=$context->userID; - } - - $addExecDuration = (strlen($tcase_exec['execution_duration']) > 0 && is_numeric($tcase_exec['execution_duration'])); - - $lexid = 0; - if($options->copyIssues) { - $lexid = $tcase_mgr->getSystemWideLastestExecutionID($tcversion_id); - } - - $idCard = array('id' => $tcase_id,'version_id' => $tcversion_id); - $exco = array('tplan_id' => $context->tplanID, - 'platform_id' => $context->platformID, - 'build_id' => $context->buildID); - $lexInfo = $tcase_mgr->getLatestExecSingleContext($idCard,$exco,array('output' => 'timestamp')); - $doInsert = true; - if(!is_null($lexInfo)) { - $tts = $lexInfo[$tcase_id][0]['execution_ts']; - $doInsert = ($lexInfo[$tcase_id][0]['execution_ts'] != trim($execution_ts,"'")); - $msgTxt = $l10n['import_results_skipped']; - } - - if( $doInsert ) { - $sql = " /* $debugMsg */ " . - " INSERT INTO {$tables['executions']} (build_id,tester_id,status,testplan_id," . - " tcversion_id,execution_ts,notes,tcversion_number,platform_id,execution_type" . - ($addExecDuration ? ',execution_duration':'') . ")" . - " VALUES ({$context->buildID}, {$tester_id},'{$result_code}',{$context->tplanID}, ". - " {$tcversion_id},{$execution_ts},'{$notes}', {$version}, " . - " {$context->platformID}, {$tcase_exec['execution_type']}" . - ($addExecDuration ? ",{$tcase_exec['execution_duration']}" : '') . ")"; - - $db->exec_query($sql); - $execution_id = $db->insert_id($tables['executions']); - - if($lexid > 0 && $options->copyIssues) { - copyIssues($db,$lexid,$execution_id); - } - - if(isset($tcase_exec['steps']) && !is_null($tcase_exec['steps']) && - $execution_id > 0 ) { - $stepSet = $tcase_mgr->getStepsSimple($tcversion_id,0, - array('fields2get' => 'TCSTEPS.step_number,TCSTEPS.id', - 'accessKey' => 'step_number')); - $sc = count($tcase_exec['steps']); - - for($sx=0; $sx < $sc; $sx++) { - $snum = $tcase_exec['steps'][$sx]['step_number']; - - if(isset($stepSet[$snum])) { - $tcstep_id = $stepSet[$snum]['id']; - $target = DB_TABLE_PREFIX . 'execution_tcsteps'; - - $doIt = (!is_null($tcase_exec['steps'][$sx]['result']) && - trim($tcase_exec['steps'][$sx]['result']) != '') || - $tcase_exec['steps'][$sx]['result'] != $resultsCfg['status_code']['not_run']; - - if( $doIt ) { - $sql = " INSERT INTO {$target} (execution_id,tcstep_id,notes"; - $values = " VALUES ( {$execution_id}, {$tcstep_id} , " . - "'" . $db->prepare_string($tcase_exec['steps'][$sx]['notes']) . "'"; - - $status = strtolower(trim($tcase_exec['steps'][$sx]['result'])); - $status = $status[0]; - $sql .= ",status"; - $values .= ",'" . $db->prepare_string($tcase_exec['steps'][$sx]['result']) . "'"; - - $sql .= ") " . $values . ")"; - $db->exec_query($sql); - - $execution_tcsteps_id = $db->insert_id($target); - } - } - } - } - - if( isset($tcase_exec['bug_id']) && !is_null($tcase_exec['bug_id']) && is_array($tcase_exec['bug_id']) ) { - - foreach($tcase_exec['bug_id'] as $bug_id) { - $bug_id = trim($bug_id); - $sql = " /* $debugMsg */ " . - " SELECT execution_id AS check_qty FROM {$tables['execution_bugs']} " . - " WHERE bug_id = '{$bug_id}' AND execution_id={$execution_id} "; - $rs = $db->get_recordset($sql); - if( is_null($rs) ) { - $sql = " /* $debugMsg */ " . - " INSERT INTO {$tables['execution_bugs']} (bug_id,execution_id)" . - " VALUES ('" . $db->prepare_string($bug_id) . "', {$execution_id} )"; - $db->exec_query($sql); - } - } - } - - if( isset($tcase_exec['custom_fields']) && !is_null($tcase_exec['custom_fields']) && is_array($tcase_exec['custom_fields']) ) { - - // Get linked custom fields to this test project, for test case on execution - // $context->tprojectID - $cfieldMgr = new cfield_mgr($db); - $cfSetByName = $cfieldMgr->get_linked_cfields_at_execution($context->tprojectID,1,'testcase',null,null,null,'name'); - - foreach($tcase_exec['custom_fields'] as $cf) { - $ak = null; - if( isset($cfSetByName[$cf['name']]) ) { - // write to db blind - $ak[$cfSetByName[$cf['name']]['id']]['cf_value'] = $cf['value']; - } else { - $message=sprintf($l10n['invalid_cf'],$tcase_identity,$cf['name']); - } - - if(!is_null($ak)) { - $cfieldMgr->execution_values_to_db($ak,$tcversion_id,$execution_id,$context->tplanID,null,'plain'); - } - } - } - - if( !is_null($message) ) { - $resultMap[]=array($message); - } - $msgTxt = $l10n['import_results_ok']; - - } - $message = sprintf($msgTxt,$tcase_identity,$version,$tester_name, - $l10n[$result_code],$execution_ts); - } - } - - if( !is_null($message) ) { - $resultMap[]=array($message); - } - } - return $resultMap; -} - -/* - function: importExecutionsFromXML - - args : - - returns: - -*/ -function importExecutionsFromXML($xmlTCExecSet) { - $execInfoSet=null; - if($xmlTCExecSet) { - $jdx=0; - $exec_qty=sizeof($xmlTCExecSet); - for($idx=0; $idx < $exec_qty ; $idx++) { - $xmlTCExec=$xmlTCExecSet[$idx]; - $execInfo = importExecutionFromXML($xmlTCExec); - if ($execInfo) { - $execInfoSet[$jdx++]=$execInfo; - } - } - } - - return $execInfoSet; -} - -/* - function: importExecutionFromXML() - - args : - - returns: - -*/ -function importExecutionFromXML(&$xmlTCExec) { - if (!$xmlTCExec) { - return null; - } - - $execInfo=array();; - $execInfo['tcase_id'] = isset($xmlTCExec["id"]) ? (int)$xmlTCExec["id"] : 0; - $execInfo['tcase_external_id'] = (string) $xmlTCExec["external_id"]; - - // Developer Note - 20100328 - franciscom: - // seems that no PHP error is generated when trying to access an undefined - // property. Do not know if will not be better anyway to use property_exists() - // - $execInfo['tcase_name'] = (string) $xmlTCExec->name; - $execInfo['result'] = (string) trim($xmlTCExec->result); - $execInfo['notes'] = (string) trim($xmlTCExec->notes); - $execInfo['timestamp'] = (string) trim($xmlTCExec->timestamp); - $execInfo['tester'] = (string) trim($xmlTCExec->tester); - $execInfo['execution_type'] = intval((int) trim($xmlTCExec->execution_type)); - $execInfo['execution_duration'] = trim($xmlTCExec->execution_duration); - - $bugQty = count($xmlTCExec->bug_id); - if( ($bugQty = count($xmlTCExec->bug_id)) > 0 ) { - foreach($xmlTCExec->bug_id as $bug) { - $execInfo['bug_id'][] = (string) $bug; - } - } - - $execInfo['steps'] = null; - if(property_exists($xmlTCExec, 'steps') && - property_exists($xmlTCExec->steps, 'step')){ - $itemStructure['elements'] = array('integer' => array("step_number" => 'intval'), - 'string' => array("result" => 'trim',"notes" => 'trim')); - $execInfo['steps'] = getItemsFromSimpleXMLObj($xmlTCExec->steps->step,$itemStructure); - } - - $execInfo['custom_fields'] = null; - if(property_exists($xmlTCExec, 'custom_fields') && property_exists($xmlTCExec->custom_fields, 'custom_field')) { - $itemStructure['elements'] = array('string' => array("name" => 'trim',"value" => 'trim')); - $execInfo['custom_fields'] = getItemsFromSimpleXMLObj($xmlTCExec->custom_fields->custom_field,$itemStructure); - } - - return $execInfo; -} - - -/* - function: - - Check if at least the file starts seems OK - -*/ -function check_xml_execution_results($fileName) { - - $file_check=array('status_ok' => 0, 'msg' => 'xml_ko'); - $xml = @simplexml_load_file_wrapper($fileName); - if($xml !== FALSE) { - $file_check=array('status_ok' => 1, 'msg' => 'ok'); - $elementName = $xml->getName(); - if($elementName != 'results') { - $file_check=array('status_ok' => 0, 'msg' => lang_get('wrong_results_import_format')); - } - } - return $file_check; -} - - -/* - function: init_args(&$dbHandler) - - args : - - returns: - -*/ -function init_args(&$dbHandler) { - $args=new stdClass(); - $_REQUEST=strings_stripSlashes($_REQUEST); - - $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; - $args->copyIssues = isset($_REQUEST['copyIssues']) ? 1 : 0; - - - // Need to use REQUEST because sometimes data arrives on GET and other on POST (has hidden fields) - $args->buildID = isset($_REQUEST['buildID']) ? intval($_REQUEST['buildID']) : null; - $args->platformID = isset($_REQUEST['platformID']) ? intval($_REQUEST['platformID']) : null; - $args->tplanID = isset($_REQUEST['tplanID']) ? intval($_REQUEST['tplanID']) : null; - $args->tplanID = !is_null($args->tplanID) ? $args->tplanID : intval($_SESSION['testplanID']); - - $args->tprojectID = isset($_REQUEST['tprojectID']) ? intval($_REQUEST['tprojectID']) : null; - - if( is_null($args->tprojectID)) { - $args->tprojectID = intval($_SESSION['testprojectID']); - $args->testprojectName = $_SESSION['testprojectName']; - } else { - $tproject_mgr = new testproject($dbHandler); - $dummy = $tproject_mgr->get_by_id($args->tprojectID); - $args->testprojectName = $dummy['name']; - } - - $args->doUpload=isset($_REQUEST['UploadFile']) ? 1 : 0; - $args->userID=intval($_SESSION['userID']); - - return $args; -} - -/* - function: check_exec_values() - - args : - - returns: map - keys: - status_ok -> value=true / false - tcase_id: test case id if controls OK - tester_id: tester_id if controls OK - msg -> array with localized messages - - @internal revisions -*/ -function check_exec_values(&$db,&$tcase_mgr,&$user_mgr,$tcaseCfg,&$execValues,&$columnDef) { - $tables = tlObjectWithDB::getDBTables(array('users','execution_bugs')); - $checks=array('status_ok' => false, 'tcase_id' => 0, 'tester_id' => 0, 'msg' => array()); - $tcase_id=$execValues['tcase_id']; - $tcase_external_id=trim($execValues['tcase_external_id']); - $using_external_id = ($tcase_external_id != ""); // external_id has precedence over internal id - - if($using_external_id) { - // need to get internal id - $checks['tcase_id'] = $tcase_mgr->getInternalID($tcase_external_id); - $checks['status_ok'] = intval($checks['tcase_id']) > 0 ? true : false; - if(!$checks['status_ok']) { - $checks['msg'][]=sprintf(lang_get('tcase_external_id_do_not_exists'),$tcase_external_id); - } - } else { - // before using internal id, I want to check it's a number - $checks['tcase_id'] = $tcase_id; - $checks['status_ok'] = intval($checks['tcase_id']) > 0 ? true : false; - if(!$checks['status_ok']) { - $checks['msg'][]=sprintf(lang_get('tcase_id_is_not_number'),$tcase_id); - } - } - - if($checks['status_ok']) { - // useful for user feedback - $identity=$using_external_id ? $tcase_external_id : $checks['tcase_id']; - } - - if($checks['status_ok'] && $execValues['timestamp'] != '' ) { - $checks['status_ok']=isValidISODateTime($execValues['timestamp']); - if(!$checks['status_ok']) { - $checks['msg'][]=sprintf(lang_get('invalid_execution_timestamp'),$identity,$execValues['timestamp']); - } - } - - if($checks['status_ok'] && $execValues['tester'] != '' ) { - $sql = "SELECT id,login FROM {$tables['users']} WHERE login ='" . - $db->prepare_string($execValues['tester']) . "'"; - $userInfo=$db->get_recordset($sql); - - if(!is_null($userInfo) && isset($userInfo[0]['id']) ) { - $checks['tester_id']=$userInfo[0]['id']; - } else { - $checks['status_ok']=false; - $checks['msg'][]=sprintf(lang_get('invalid_tester'),$identity,$execValues['tester']); - } - } - - $execValues['bug_id'] = isset($execValues['bug_id']) ? $execValues['bug_id'] : null; - if($checks['status_ok'] && !is_null($execValues['bug_id']) && is_array($execValues['bug_id']) ) { - foreach($execValues['bug_id'] as $bug_id ) { - if( ($field_len = strlen(trim($bug_id))) > $columnDef['bug_id']->max_length ) { - $checks['msg'][]=sprintf(lang_get('bug_id_invalid_len'),$field_len,$columnDef['bug_id']->max_length); - $checks['status_ok']=false; - break; - } - } - } - - if($checks['status_ok'] && isset($execValues['execution_type']) ) { - $execValues['execution_type'] = intval($execValues['execution_type']); - $execDomain = $tcase_mgr->get_execution_types(); - if( $execValues['execution_type'] == 0 ) { - $execValues['execution_type'] = TESTCASE_EXECUTION_TYPE_MANUAL; - // right now this is useless, but may be in future can be used, then I choose to leave it. - $checks['msg'][]=sprintf(lang_get('missing_exec_type'), - $execValues['execution_type'],$execDomain[$execValues['execution_type']]); - } else { - $checks['status_ok'] = isset($execDomain[$execValues['execution_type']]); - if( !$checks['status_ok'] ) { - $checks['msg'][]=sprintf(lang_get('invalid_exec_type'),$execValues['execution_type']); - } - } - } - - - if($checks['status_ok'] && isset($execValues['steps']) ) { - // To Be done - } - - return $checks; -} - - -/** - * - * - */ -function initializeGui(&$argsObj) { - $guiObj = new stdClass(); - $guiObj->import_title = lang_get('title_results_import_to'); - $guiObj->buildID = $argsObj->buildID; - $guiObj->platformID = $argsObj->platformID; - $guiObj->tplanID = $argsObj->tplanID; - - $guiObj->file_check = array('status_ok' => 1, 'msg' => 'ok'); - $guiObj->importTypes = array("XML" => "XML"); - $guiObj->importLimit = config_get('import_file_max_size_bytes'); - $guiObj->doImport = ($argsObj->importType != ""); - $guiObj->testprojectName = $argsObj->testprojectName; - $guiObj->copyIssues = $argsObj->copyIssues; - return $guiObj; -} \ No newline at end of file diff --git a/lib/results/resultsMoreBuilds.php b/lib/results/resultsMoreBuilds.php index 31fef6d461..bab3e61e9f 100644 --- a/lib/results/resultsMoreBuilds.php +++ b/lib/results/resultsMoreBuilds.php @@ -1,316 +1,315 @@ - - * @copyright 2009,2012 TestLink community - * - * @internal revisions - * @since 1.9.4 - * - **/ -require_once('../../config.inc.php'); -require_once('common.php'); -require_once('users.inc.php'); -require_once('displayMgr.php'); - -testlinkInitPage($db,false,false,"checkRights"); -$templateCfg = templateConfiguration(); -$date_format_cfg = config_get('date_format'); - -$args = init_args(); -$gui = initializeGui($db,$args,$date_format_cfg); -$mailCfg = buildMailCfg($gui); - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->assign('report_type', $args->report_type); -displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->report_type,$mailCfg); - - -/** - * initialize Gui - */ -function initializeGui(&$dbHandler,&$argsObj,$dateFormat) -{ - - new dBug($argsObj); - -/* $my['filters'] = array('exec_ts_from' => null, 'exec_ts_to' => null, - 'assigned_to' => null, 'tester_id' => null, - 'keywords' => null, 'builds' => null, - 'plaforms' => null, 'top_level_tsuites' => null); - -*/ - $reports_cfg = config_get('reportsCfg'); - $tplan_mgr = new tlTestPlanMetrics($dbHandler); - $tproject_mgr = new testproject($dbHandler); - - $gui = new stdClass(); - $gui->resultsCfg = config_get('results'); - $gui->title = lang_get('query_metrics_report'); - $gui->tplan_id = $argsObj->tplan_id; - $gui->tproject_id = $argsObj->tproject_id; - - $tplan_info = $tplan_mgr->get_by_id($gui->tplan_id); - $tproject_info = $tproject_mgr->get_by_id($gui->tproject_id); - $gui->tplan_name = $tplan_info['name']; - $gui->tproject_name = $tproject_info['name']; - - $getOpt = array('outputFormat' => 'map'); - $gui->platformSet = $tplan_mgr->getPlatforms($argsObj->tplan_id,$getOpt); - $gui->showPlatforms = true; - if( is_null($gui->platformSet) ) - { - $gui->platformSet = null; - $gui->showPlatforms = false; - } - else - { - $filters['platforms'] = array_keys($gui->platformSet); - } - - // convert starttime to iso format for database usage - list($gui->startTime,$gui->endTime) = helper2ISO($_REQUEST); - - //die(); - - - $gui_open = config_get('gui_separator_open'); - $gui_close = config_get('gui_separator_close'); - $gui->str_option_any = $gui_open . lang_get('any') . $gui_close; - $gui->str_option_none = $gui_open . lang_get('nobody') . $gui_close; - - $gui->search_notes_string = $argsObj->search_notes_string; - - $testsuiteNames = null; - $everest = $tplan_mgr->getRootTestSuites($gui->tplan_id,$gui->tproject_id,array('output' => 'plain')); - $tsuites_qty = sizeOf($argsObj->testsuitesSelected); - - $userWantsAll = ($tsuits_qty == 0 || $tsuits_qty == count($everest)); - $filters['top_level_tsuites'] = ($tsuites_qty == 0 || $tsuites_qty == count($everest)) ? null : $argsObj->testsuitesSelected; - $gui->testsuitesSelected = array(); - foreach($argsObj->testsuitesSelected as $dmy) - { - $gui->testsuitesSelected[$dmy] = $everest[$dmy]['name']; - } - - $filters['builds'] = null; - if (sizeof($argsObj->buildsSelected)) - { - $filters['builds'] = implode(",", $argsObj->buildsSelected); - } - - $filters['keywords'] = (array)$argsObj->keywordSelected; - if(in_array(0,$filters['keywords'])) // Sorry for MAGIC 0 => ANY - { - $filters['keywords'] = null; - } - - // statusForClass is used for results.class.php - // lastStatus is used to be displayed - $statusForClass = 'a'; - - // amitkhullar - added this parameter to get the latest results. - $latest_resultset = $argsObj->display->latest_results; - - $assignee = $argsObj->ownerSelected > 0 ? $argsObj->ownerSelected : TL_USER_ANYBODY; - $tester = $argsObj->executorSelected > 0 ? $argsObj->executorSelected : TL_USER_ANYBODY ; - - - - - //$rs = $tplan_mgr->queryMetrics($gui->tplan_id,$filters); - //new dBug($rs); - // die(); - - //$re = new newResults($dbHandler, $tplan_mgr,$tproject_info,$tplan_info, - // $testsuiteIds, $buildsToQuery, - // $argsObj->platformsSelected, $statusForClass, - // $latest_resultset, $argsObj->keywordSelected, - // $assignee, $gui->startTime, - // $gui->endTime, $tester, - // $argsObj->search_notes_string, null); - // - //$gui->suiteList = $re->getSuiteList(); // test executions results - //// Filter test cases on selected platforms - //foreach ($gui->suiteList as $suiteid => $tcases) - //{ - // $filtered = array(); - // foreach ($tcases as $index => $tcase) { - // if ($tcase['platform_id'] == 0 || - // $argsObj->platformsSelected[0] == ALL_PLATFORMS || - // array_search($tcase['platform_id'], $argsObj->platformsSelected) !== false) { - // array_push($filtered, $tcase); - // } - // } - // unset($gui->suiteList[$suiteid]); - // $gui->suiteList[$suiteid] = $filtered; - //} - //$gui->flatArray = $re->getFlatArray(); - //$gui->mapOfSuiteSummary = $re->getAggregateMap(); - // - - - // Prepare User Feedback - $gui->totals = new stdClass(); - $gui->totals->items = 0; - $gui->totals->labels = array(); - - foreach($gui->totals->items as $key => $value) - { - $l18n = $key == 'total' ? 'th_total_cases' : $gui->resultsCfg['status_label'][$key]; - $gui->totals->labels[$key] = lang_get($l18n); - } - - $gui->keywords = new stdClass(); - $gui->keywords->items[0] = $gui->str_option_any; // Sorry MAGIC 0 - if(!is_null($tplan_keywords_map = $tplan_mgr->get_keywords_map($gui->tplan_id))) - { - $gui->keywords->items += $tplan_keywords_map; - } - $gui->keywords->qty = count($gui->keywords->items); - $gui->keywordSelected = $gui->keywords->items[$argsObj->keywordSelected]; - - $gui->builds_html = $tplan_mgr->get_builds_for_html_options($gui->tplan_id); - $gui->users = getUsersForHtmlOptions($dbHandler,ALL_USERS_FILTER, - array(TL_USER_ANYBODY => $gui->str_option_any)); - - $gui->ownerSelected = $gui->users[$argsObj->ownerSelected]; - $gui->executorSelected = $gui->users[$argsObj->executorSelected]; - $gui->buildsSelected = $argsObj->buildsSelected; - $gui->platformsSelected = $argsObj->platformsSelected; - $gui->display = $argsObj->display; - - // init display rows attribute and some status localized labels - $gui->displayResults = array(); - $gui->lastStatus = array(); - foreach($reports_cfg->exec_status as $verbose => $label) - { - $gui->displayResults[$gui->resultsCfg['status_code'][$verbose]]=false; - } - - foreach($gui->resultsCfg['status_label'] as $status_verbose => $label_key) - { - $gui->statusLabels[$gui->resultsCfg['status_code'][$status_verbose]] = lang_get($label_key); - } - - $lastStatus_localized = null; - foreach($argsObj->lastStatus as $key => $status_code) - { - $verbose = $gui->resultsCfg['code_status'][$status_code]; - $gui->displayResults[$status_code] = true; - $lastStatus_localized[] = lang_get($gui->resultsCfg['status_label'][$verbose]); - } - $gui->lastStatus = $lastStatus_localized; - - return $gui; -} - -/** - * Initialize input data - */ -function init_args() -{ - $iParams = array("format" => array(tlInputParameter::INT_N), - "report_type" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "build" => array(tlInputParameter::ARRAY_INT), - "platform" => array(tlInputParameter::ARRAY_INT), - "keyword" => array(tlInputParameter::INT_N), - "owner" => array(tlInputParameter::INT_N), - "executor" => array(tlInputParameter::INT_N), - "display_totals" => array(tlInputParameter::INT_N,1), - "display_query_params" => array(tlInputParameter::INT_N,1), - "display_test_cases" => array(tlInputParameter::INT_N,1), - "display_latest_results" => array(tlInputParameter::INT_N,1), - "display_suite_summaries" => array(tlInputParameter::INT_N,1), - "lastStatus" => array(tlInputParameter::ARRAY_STRING_N), - "testsuite" => array(tlInputParameter::ARRAY_STRING_N), - "search_notes_string" => array(tlInputParameter::STRING_N)); - $args = new stdClass(); - - $_REQUEST=strings_stripSlashes($_REQUEST); - $pParams = R_PARAMS($iParams); - - $args->format = $pParams["format"]; - $args->report_type = $pParams["report_type"]; - $args->tplan_id = $pParams["tplan_id"]; - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - $args->display = new stdClass(); - $args->display->suite_summaries = $pParams["display_suite_summaries"]; - $args->display->totals = $pParams["display_totals"]; - $args->display->query_params = $pParams["display_query_params"]; - $args->display->test_cases = $pParams["display_test_cases"]; - $args->display->latest_results = $pParams["display_latest_results"]; - - $args->lastStatus = $pParams["lastStatus"] ? $pParams["lastStatus"] : array(); - $args->keywordSelected = $pParams["keyword"]; - $args->ownerSelected = $pParams["owner"]; - $args->executorSelected = $pParams["executor"]; - $args->buildsSelected = $pParams["build"] ? $pParams["build"] : array(); - $args->platformsSelected = $pParams["platform"] ? $pParams["platform"] : array(); - $args->testsuitesSelected = $pParams["testsuite"] ? $pParams["testsuite"] : array(); - $args->search_notes_string = $pParams['search_notes_string']; - - return $args; -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) -{ - $labels = init_labels(array('testplan' => null, 'testproject' => null)); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . - $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - return $cfg; -} - -function helper2ISO($userInput) -{ - $dateFormatMask = config_get('date_format'); - $zy = array(); - $key2loop = array('selected_start_date' => 'startTime','selected_end_date' => 'endTime'); - foreach($key2loop as $target => $prop) - { - if (isset($userInput[$target]) && $userInput[$target] != '') - { - $dummy = split_localized_date($userInput[$target], $dateFormatMask); - if($dummy != null) - { - $zy[$prop] = $dummy['year'] . "-" . $dummy['month'] . "-" . $dummy['day']; - } - } - } - - $dummy = isset($userInput['start_Hour']) ? $userInput['start_Hour'] : "00"; - $zy['startTime'] .= " " . $dummy . ":00:00"; - $dummy = isset($userInput['end_Hour']) ? $userInput['end_Hour'] : "00"; - $zy['endTime'] .= " " . $dummy . ":59:59"; - - return(array($zy['startTime'],$zy['endTime'])); -} - - - -/** - * - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} -?> \ No newline at end of file + + * @copyright 2009,2012 TestLink community + * + * @internal revisions + * @since 1.9.4 + * + **/ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'users.inc.php'; +require_once 'displayMgr.php'; + +testlinkInitPage($db, false, false, "checkRights"); +$templateCfg = templateConfiguration(); +$date_format_cfg = config_get('date_format'); + +$args = initArgs(); +$gui = initializeGui($db, $args); +$mailCfg = buildMailCfg($gui); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('report_type', $args->report_type); +displayReport($templateCfg->template_dir . $templateCfg->default_template, + $smarty, $args->report_type, $mailCfg); + +/** + * initialize Gui + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param string $dateFormat + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $reports_cfg = config_get('reportsCfg'); + $tplan_mgr = new tlTestPlanMetrics($dbHandler); + $tproject_mgr = new testproject($dbHandler); + + $gui = new stdClass(); + $gui->resultsCfg = config_get('results'); + $gui->title = lang_get('query_metrics_report'); + $gui->tplan_id = $argsObj->tplan_id; + $gui->tproject_id = $argsObj->tproject_id; + + $tplan_info = $tplan_mgr->get_by_id($gui->tplan_id); + $tproject_info = $tproject_mgr->get_by_id($gui->tproject_id); + $gui->tplan_name = $tplan_info['name']; + $gui->tproject_name = $tproject_info['name']; + + $getOpt = array( + 'outputFormat' => 'map' + ); + $gui->platformSet = $tplan_mgr->getPlatforms($argsObj->tplan_id, $getOpt); + $gui->showPlatforms = true; + if (is_null($gui->platformSet)) { + $gui->platformSet = null; + $gui->showPlatforms = false; + } else { + $filters['platforms'] = array_keys($gui->platformSet); + } + + // convert starttime to iso format for database usage + list ($gui->startTime, $gui->endTime) = helper2ISO($_REQUEST); + + $gui_open = config_get('gui_separator_open'); + $gui_close = config_get('gui_separator_close'); + $gui->str_option_any = $gui_open . lang_get('any') . $gui_close; + $gui->str_option_none = $gui_open . lang_get('nobody') . $gui_close; + + $gui->search_notes_string = $argsObj->search_notes_string; + + $everest = $tplan_mgr->getRootTestSuites($gui->tplan_id, $gui->tproject_id, + array( + 'output' => 'plain' + )); + $tsuites_qty = count($argsObj->testsuitesSelected); + + $filters['top_level_tsuites'] = ($tsuites_qty == 0 || + $tsuites_qty == count($everest)) ? null : $argsObj->testsuitesSelected; + $gui->testsuitesSelected = array(); + foreach ($argsObj->testsuitesSelected as $dmy) { + $gui->testsuitesSelected[$dmy] = $everest[$dmy]['name']; + } + + $filters['builds'] = null; + if (count($argsObj->buildsSelected)) { + $filters['builds'] = implode(",", $argsObj->buildsSelected); + } + + $filters['keywords'] = (array) $argsObj->keywordSelected; + if (in_array(0, $filters['keywords'])) // Sorry for MAGIC 0 => ANY + { + $filters['keywords'] = null; + } + + // Prepare User Feedback + $gui->totals = new stdClass(); + $gui->totals->items = 0; + $gui->totals->labels = array(); + + foreach ($gui->totals->items as $key => $value) { + $l18n = $key == 'total' ? 'th_total_cases' : $gui->resultsCfg['status_label'][$key]; + $gui->totals->labels[$key] = lang_get($l18n); + } + + $gui->keywords = new stdClass(); + $gui->keywords->items[0] = $gui->str_option_any; // Sorry MAGIC 0 + if (! is_null( + $tplan_keywords_map = $tplan_mgr->get_keywords_map($gui->tplan_id))) { + $gui->keywords->items += $tplan_keywords_map; + } + $gui->keywords->qty = count($gui->keywords->items); + $gui->keywordSelected = $gui->keywords->items[$argsObj->keywordSelected]; + + $gui->builds_html = $tplan_mgr->get_builds_for_html_options($gui->tplan_id); + $gui->users = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, + array( + TL_USER_ANYBODY => $gui->str_option_any + )); + + $gui->ownerSelected = $gui->users[$argsObj->ownerSelected]; + $gui->executorSelected = $gui->users[$argsObj->executorSelected]; + $gui->buildsSelected = $argsObj->buildsSelected; + $gui->platformsSelected = $argsObj->platformsSelected; + $gui->display = $argsObj->display; + + // init display rows attribute and some status localized labels + $gui->displayResults = array(); + $gui->lastStatus = array(); + foreach ($reports_cfg->exec_status as $verbose => $label) { + $gui->displayResults[$gui->resultsCfg['status_code'][$verbose]] = false; + } + + foreach ($gui->resultsCfg['status_label'] as $status_verbose => $label_key) { + $gui->statusLabels[$gui->resultsCfg['status_code'][$status_verbose]] = lang_get( + $label_key); + } + + $lastStatus_localized = null; + foreach ($argsObj->lastStatus as $status_code) { + $verbose = $gui->resultsCfg['code_status'][$status_code]; + $gui->displayResults[$status_code] = true; + $lastStatus_localized[] = lang_get( + $gui->resultsCfg['status_label'][$verbose]); + } + $gui->lastStatus = $lastStatus_localized; + + return $gui; +} + +/** + * Initialize input data + */ +function initArgs() +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "report_type" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "build" => array( + tlInputParameter::ARRAY_INT + ), + "platform" => array( + tlInputParameter::ARRAY_INT + ), + "keyword" => array( + tlInputParameter::INT_N + ), + "owner" => array( + tlInputParameter::INT_N + ), + "executor" => array( + tlInputParameter::INT_N + ), + "display_totals" => array( + tlInputParameter::INT_N, + 1 + ), + "display_query_params" => array( + tlInputParameter::INT_N, + 1 + ), + "display_test_cases" => array( + tlInputParameter::INT_N, + 1 + ), + "display_latest_results" => array( + tlInputParameter::INT_N, + 1 + ), + "display_suite_summaries" => array( + tlInputParameter::INT_N, + 1 + ), + "lastStatus" => array( + tlInputParameter::ARRAY_STRING_N + ), + "testsuite" => array( + tlInputParameter::ARRAY_STRING_N + ), + "search_notes_string" => array( + tlInputParameter::STRING_N + ) + ); + $args = new stdClass(); + + $_REQUEST = strings_stripSlashes($_REQUEST); + $pParams = R_PARAMS($iParams); + + $args->format = $pParams["format"]; + $args->report_type = $pParams["report_type"]; + $args->tplan_id = $pParams["tplan_id"]; + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + $args->display = new stdClass(); + $args->display->suite_summaries = $pParams["display_suite_summaries"]; + $args->display->totals = $pParams["display_totals"]; + $args->display->query_params = $pParams["display_query_params"]; + $args->display->test_cases = $pParams["display_test_cases"]; + $args->display->latest_results = $pParams["display_latest_results"]; + + $args->lastStatus = $pParams["lastStatus"] ? $pParams["lastStatus"] : array(); + $args->keywordSelected = $pParams["keyword"]; + $args->ownerSelected = $pParams["owner"]; + $args->executorSelected = $pParams["executor"]; + $args->buildsSelected = $pParams["build"] ? $pParams["build"] : array(); + $args->platformsSelected = $pParams["platform"] ? $pParams["platform"] : array(); + $args->testsuitesSelected = $pParams["testsuite"] ? $pParams["testsuite"] : array(); + $args->search_notes_string = $pParams['search_notes_string']; + + return $args; +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = init_labels(array( + 'testplan' => null, + 'testproject' => null + )); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + return $cfg; +} + +/** + * + * @param string $userInput + * @return array + */ +function helper2ISO($userInput) +{ + $dateFormatMask = config_get('date_format'); + $zy = array(); + $key2loop = array( + 'selected_start_date' => 'startTime', + 'selected_end_date' => 'endTime' + ); + foreach ($key2loop as $target => $prop) { + if (isset($userInput[$target]) && $userInput[$target] != '') { + $dummy = split_localized_date($userInput[$target], $dateFormatMask); + if ($dummy != null) { + $zy[$prop] = $dummy['year'] . "-" . $dummy['month'] . "-" . + $dummy['day']; + } + } + } + + $dummy = isset($userInput['start_Hour']) ? $userInput['start_Hour'] : "00"; + $zy['startTime'] .= " " . $dummy . ":00:00"; + $dummy = isset($userInput['end_Hour']) ? $userInput['end_Hour'] : "00"; + $zy['endTime'] .= " " . $dummy . ":59:59"; + + return array( + $zy['startTime'], + $zy['endTime'] + ); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} +?> diff --git a/lib/results/resultsMoreBuildsGUI.php b/lib/results/resultsMoreBuildsGUI.php index 275e4542e1..5622f15e8f 100644 --- a/lib/results/resultsMoreBuildsGUI.php +++ b/lib/results/resultsMoreBuildsGUI.php @@ -1,155 +1,172 @@ - - * - * @internal revisions - * @since 1.9.4 - * - **/ -require_once('../../config.inc.php'); -require_once('common.php'); -require_once('exec.inc.php'); -require_once('users.inc.php'); -testlinkInitPage($db,true,false,"checkRights"); - -$templateCfg = templateConfiguration(); - -$args = init_args(); -$gui = initializeGui($db,$args); - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/* - function: get_status_for_reports_html_options - generates map useful for smarty html_options - - args : - - returns: map key -> status code, value -> localized status description - -*/ -function get_status_for_reports_html_options() -{ - $reports_cfg = config_get('reportsCfg'); - $results = config_get('results'); - - foreach($reports_cfg->exec_status as $verbose_status => $status_label) - { - $code = $results['status_code'][$verbose_status]; - $html_options[$code] = lang_get($status_label); - } - - return $html_options; -} - - -/* - function: initializeGui - - args : - - returns: - -*/ -function initializeGui(&$dbHandler,$args) -{ - - $gui = new stdClass(); - $tplan_mgr = new testplan($dbHandler); - - $gui_open = config_get('gui_separator_open'); - $gui_close = config_get('gui_separator_close'); - $gui->str_option_any = $gui_open . lang_get('any') . $gui_close; - $gui->str_option_none = $gui_open . lang_get('nobody') . $gui_close; - - $gui->tplan_id = $args->tplan_id; - $gui->tproject_id = $args->tproject_id; - - $tplan_info = $tplan_mgr->get_by_id($gui->tplan_id); - $gui->tplan_name = $tplan_info['name']; - unset($tplan_info); - - $ni = $tplan_mgr->tree_manager->get_node_hierarchy_info($gui->tproject_id); - $gui->tproject_name = $ni['name']; - unset($ni); - - $gui->assigned_users = new stdClass(); - $gui->keywords = new stdClass(); - $gui->builds = new stdClass(); - $gui->platforms = new stdClass(); - $gui->testsuites = new stdClass(); - - // 20090107 - franciscom - // Show only users that are able to execute test cases ? - // What happens if a user that has loose right to execute, but - // before loosing this right has been assigned some tests, or have executed it? - // - // $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, ADD_BLANK_OPTION); - // $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, - // array(TL_USER_ANYBODY => $gui->str_option_any, - // TL_USER_NOBODY => $gui->str_option_none) ); - // - $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, - array(TL_USER_ANYBODY => $gui->str_option_any) ); - - $gui->builds->items = $tplan_mgr->get_builds($gui->tplan_id,testplan::ACTIVE_BUILDS); - $gui->platforms->items = $tplan_mgr->getPlatforms($gui->tplan_id); - $gui->testsuites->items = $tplan_mgr->getRootTestSuites($gui->tplan_id,$gui->tproject_id, - array('output' => 'plain')); - - $gui->keywords->items[0]=$gui->str_option_any; - if(!is_null($tplan_keywords_map=$tplan_mgr->get_keywords_map($gui->tplan_id)) ) - { - $gui->keywords->items += $tplan_keywords_map; - } - - - $key2loop = array('keywords','builds','platforms','testsuites','assigned_users'); - foreach($key2loop as $kx) - { - $gui->$kx->qty = count($gui->$kx->items); - - } - $gui->status_code_label = get_status_for_reports_html_options(); - $gui->report_type = $args->format; - - $reports_cfg = config_get('reportsCfg'); - $ldf = config_get('locales_date_format'); - $date_format = $ldf[((isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB')]; - $gui->selected_start_date = @strftime($date_format, time() - ($reports_cfg->start_date_offset)); - $gui->selected_start_time = $reports_cfg->start_time; - $gui->selected_end_date = @strftime($date_format, time()); - $gui->selected_end_time = null; - - return $gui; -} - - - -function init_args() -{ - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - - return $args; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} -?> \ No newline at end of file + + * + * @internal revisions + * @since 1.9.4 + * + **/ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'exec.inc.php'; +require_once 'users.inc.php'; +testlinkInitPage($db, true, false, "checkRights"); + +$templateCfg = templateConfiguration(); + +$args = initArgs(); +$gui = initializeGui($db, $args); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: get_status_for_reports_html_options + * generates map useful for smarty html_options + * + * args : + * + * returns: map key -> status code, value -> localized status description + * + */ +function getStatusForReportsHTMLOptions() +{ + $reports_cfg = config_get('reportsCfg'); + $results = config_get('results'); + + foreach ($reports_cfg->exec_status as $verbose_status => $status_label) { + $code = $results['status_code'][$verbose_status]; + $html_options[$code] = lang_get($status_label); + } + + return $html_options; +} + +/** + * + * @param database $dbHandler + * @param unknown $args + * @return stdClass + */ +function initializeGui(&$dbHandler, $args) +{ + $gui = new stdClass(); + $tplan_mgr = new testplan($dbHandler); + + $gui_open = config_get('gui_separator_open'); + $gui_close = config_get('gui_separator_close'); + $gui->str_option_any = $gui_open . lang_get('any') . $gui_close; + $gui->str_option_none = $gui_open . lang_get('nobody') . $gui_close; + + $gui->tplan_id = $args->tplan_id; + $gui->tproject_id = $args->tproject_id; + + $tplan_info = $tplan_mgr->get_by_id($gui->tplan_id); + $gui->tplan_name = $tplan_info['name']; + unset($tplan_info); + + $ni = $tplan_mgr->tree_manager->get_node_hierarchy_info($gui->tproject_id); + $gui->tproject_name = $ni['name']; + unset($ni); + + $gui->assigned_users = new stdClass(); + $gui->keywords = new stdClass(); + $gui->builds = new stdClass(); + $gui->platforms = new stdClass(); + $gui->testsuites = new stdClass(); + + // 20090107 - franciscom + // Show only users that are able to execute test cases ? + // What happens if a user that has loose right to execute, but + // before loosing this right has been assigned some tests, or have executed it? + // + // $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, ADD_BLANK_OPTION); + // $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, + // array(TL_USER_ANYBODY => $gui->str_option_any, + // TL_USER_NOBODY => $gui->str_option_none) ); + $gui->assigned_users->items = getUsersForHtmlOptions($dbHandler, + ALL_USERS_FILTER, array( + TL_USER_ANYBODY => $gui->str_option_any + )); + + $gui->builds->items = $tplan_mgr->get_builds($gui->tplan_id, + testplan::ACTIVE_BUILDS); + $gui->platforms->items = $tplan_mgr->getPlatforms($gui->tplan_id); + $gui->testsuites->items = $tplan_mgr->getRootTestSuites($gui->tplan_id, + $gui->tproject_id, array( + 'output' => 'plain' + )); + + $gui->keywords->items[0] = $gui->str_option_any; + if (! is_null( + $tplan_keywords_map = $tplan_mgr->get_keywords_map($gui->tplan_id))) { + $gui->keywords->items += $tplan_keywords_map; + } + + $key2loop = array( + 'keywords', + 'builds', + 'platforms', + 'testsuites', + 'assigned_users' + ); + foreach ($key2loop as $kx) { + $gui->$kx->qty = count($gui->$kx->items); + } + $gui->status_code_label = getStatusForReportsHTMLOptions(); + $gui->report_type = $args->format; + + $reports_cfg = config_get('reportsCfg'); + $ldf = config_get('locales_date_format'); + $date_format = $ldf[((isset($_SESSION['locale'])) ? $_SESSION['locale'] : 'en_GB')]; + $gui->selected_start_date = @strftime($date_format, + time() - ($reports_cfg->start_date_offset)); + $gui->selected_start_time = $reports_cfg->start_time; + $gui->selected_end_date = @strftime($date_format, time()); + $gui->selected_end_time = null; + + return $gui; +} + +/** + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} +?> diff --git a/lib/results/resultsNavigator.php b/lib/results/resultsNavigator.php index 0154efc625..991f9cf0a6 100644 --- a/lib/results/resultsNavigator.php +++ b/lib/results/resultsNavigator.php @@ -1,140 +1,157 @@ - - * - * - **/ -require('../../config.inc.php'); -require_once('common.php'); -require_once('reports.class.php'); -testlinkInitPage($db,true,false,"checkRights"); - -$smarty = new TLSmarty(); -$templateCfg = templateConfiguration(); -$args = init_args(); -$gui = initializeGui($db,$args); -$reports_mgr = new tlReports($db, $gui->tplan_id); - -// ----------------------------------------------------------------------------- -// Do some checks to understand if reports make sense - -// Check if there are linked test cases to the choosen test plan. -$tc4tp_count = $reports_mgr->get_count_testcase4testplan(); -tLog('TC in TP count = ' . $tc4tp_count); -if( $tc4tp_count == 0) { - // Test plan without test cases - $gui->do_report['status_ok'] = 0; - $gui->do_report['msg'] = lang_get('report_tplan_has_no_tcases'); + + * + * + **/ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'reports.class.php'; +testlinkInitPage($db, true, false, "checkRights"); + +$smarty = new TLSmarty(); +$templateCfg = templateConfiguration(); +$args = initArgs(); +$gui = initializeGui($db, $args); +$reports_mgr = new tlReports($db, $gui->tplan_id); + +// ----------------------------------------------------------------------------- +// Do some checks to understand if reports make sense + +// Check if there are linked test cases to the choosen test plan. +$tc4tp_count = $reports_mgr->get_count_testcase4testplan(); +tLog('TC in TP count = ' . $tc4tp_count); +if ($tc4tp_count == 0) { + // Test plan without test cases + $gui->do_report['status_ok'] = 0; + $gui->do_report['msg'] = lang_get('report_tplan_has_no_tcases'); +} + +// Build qty +$build_count = $reports_mgr->get_count_builds(); +tLog('Active Builds count = ' . $build_count); +if ($build_count == 0) { + // Test plan without builds can have execution data + $gui->do_report['status_ok'] = 0; + $gui->do_report['msg'] = lang_get('report_tplan_has_no_build'); +} + +// ----------------------------------------------------------------------------- +// get navigation data +$gui->menuItems = array(); +if ($gui->do_report['status_ok']) { + // create a list or reports + $context = new stdClass(); + $context->tproject_id = $args->tproject_id; + $context->tplan_id = $args->tplan_id; + + $tplan_mgr = new testplan($db); + $dmy = $tplan_mgr->get_by_id($context->tplan_id); + unset($tplan_mgr); + + $context->apikey = $dmy['api_key']; + $context->imgSet = $smarty->getImages(); + $gui->menuItems = $reports_mgr->get_list_reports($context, $gui->btsEnabled, + $args->optReqs, $tlCfg->reports_formats[$args->format]); +} + +$gui->selectedReportType = $args->format; +$gui->reportTypes = localize_array($tlCfg->reports_formats); + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "show_inactive_tplans" => array( + tlInputParameter::CB_BOOL + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if (is_null($args->format)) { + $reports_formats = config_get('reports_formats'); + $args->format = count($reports_formats) ? key($reports_formats) : null; + } + + if (is_null($args->tplan_id)) { + $args->tplan_id = $_SESSION['testplanID']; + } + + $_SESSION['resultsNavigator_testplanID'] = $args->tplan_id; + $_SESSION['resultsNavigator_format'] = $args->format; + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + $args->userID = $_SESSION['userID']; + $args->user = $_SESSION['currentUser']; + $args->optReqs = $_SESSION['testprojectOptions']->requirementsEnabled; + $args->checked_show_inactive_tplans = $args->show_inactive_tplans ? 'checked="checked"' : 0; + $args->show_only_active_tplans = ! $args->show_inactive_tplans; + + return $args; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $gui = new stdClass(); + + $gui->workframe = $_SESSION['basehref'] . + "lib/general/staticPage.php?key=showMetrics"; + $gui->do_report = array( + 'status_ok' => 1, + 'msg' => '' + ); + $gui->tplan_id = $argsObj->tplan_id; + $gui->tproject_id = $argsObj->tproject_id; + $gui->checked_show_inactive_tplans = $argsObj->checked_show_inactive_tplans; + + $tproject_mgr = new testproject($dbHandler); + $gui->btsEnabled = $tproject_mgr->isIssueTrackerEnabled($gui->tproject_id); + + // get Accessible Test Plans for combobox + $activeAttr = $argsObj->show_only_active_tplans ? 1 : null; + $gui->tplans = $argsObj->user->getAccessibleTestPlans($dbHandler, + $argsObj->tproject_id, null, + array( + 'output' => 'combo', + 'active' => $activeAttr + )); + + return $gui; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return boolean + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } - -// Build qty -$build_count = $reports_mgr->get_count_builds(); -tLog('Active Builds count = ' . $build_count); -if( $build_count == 0) { - // Test plan without builds can have execution data - $gui->do_report['status_ok'] = 0; - $gui->do_report['msg'] = lang_get('report_tplan_has_no_build'); -} - -// ----------------------------------------------------------------------------- -// get navigation data -$gui->menuItems = array(); -if($gui->do_report['status_ok']) { - // create a list or reports - $context = new stdClass(); - $context->tproject_id = $args->tproject_id; - $context->tplan_id = $args->tplan_id; - - $tplan_mgr = new testplan($db); - $dmy = $tplan_mgr->get_by_id($context->tplan_id); - unset($tplan_mgr); - - $context->apikey = $dmy['api_key']; - $context->imgSet = $smarty->getImages(); - $gui->menuItems = - $reports_mgr->get_list_reports($context,$gui->btsEnabled,$args->optReqs, - $tlCfg->reports_formats[$args->format]); -} - -$gui->selectedReportType = $args->format; -$gui->reportTypes = localize_array($tlCfg->reports_formats); - - -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - * - */ -function init_args() { - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "show_inactive_tplans" => array(tlInputParameter::CB_BOOL)); - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if (is_null($args->format)) { - $reports_formats = config_get('reports_formats'); - $args->format = sizeof($reports_formats) ? key($reports_formats) : null; - } - - if (is_null($args->tplan_id)) { - $args->tplan_id = $_SESSION['testplanID']; - } - - $_SESSION['resultsNavigator_testplanID'] = $args->tplan_id; - $_SESSION['resultsNavigator_format'] = $args->format; - - $args->tproject_id = - isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - $args->userID = $_SESSION['userID']; - $args->user = $_SESSION['currentUser']; - $args->optReqs = $_SESSION['testprojectOptions']->requirementsEnabled; - $args->checked_show_inactive_tplans = - $args->show_inactive_tplans ? 'checked="checked"' : 0; - $args->show_only_active_tplans = !$args->show_inactive_tplans; - - return $args; -} - -/** - * - */ -function initializeGui(&$dbHandler,$argsObj) { - $gui = new stdClass(); - - $gui->workframe = $_SESSION['basehref'] . "lib/general/staticPage.php?key=showMetrics"; - $gui->do_report = array('status_ok' => 1, 'msg' => ''); - $gui->tplan_id = $argsObj->tplan_id; - $gui->tproject_id = $argsObj->tproject_id; - $gui->checked_show_inactive_tplans = $argsObj->checked_show_inactive_tplans; - - $tproject_mgr = new testproject($dbHandler); - $gui->btsEnabled = $tproject_mgr->isIssueTrackerEnabled($gui->tproject_id); - - // get Accessible Test Plans for combobox - $activeAttr = $argsObj->show_only_active_tplans ? 1 : null; - $gui->tplans = - $argsObj->user->getAccessibleTestPlans($dbHandler,$argsObj->tproject_id,null, - array('output' =>'combo', 'active' => $activeAttr)); - - return $gui; -} - - - -/** - * - * - */ -function checkRights(&$db,&$user) { - return $user->hasRightOnProj($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/resultsReqs.php b/lib/results/resultsReqs.php index 8128f71bb7..bbff4aeaca 100644 --- a/lib/results/resultsReqs.php +++ b/lib/results/resultsReqs.php @@ -1,875 +1,928 @@ -getImages(); -$gui = init_gui($args,$tplan_mgr); -$i2u = array('edit_icon','exec_icon','history_small'); - - -$reqContext = array('tproject_id' => $args->tproject_id, 'tplan_id' => $args->tplan_id, - 'platform_id' => $args->platform); - -$reqSetX = (array)$req_mgr->getAllByContext($reqContext); -$req_ids = array_keys($reqSetX); - -$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . (config_get('testcase_cfg')->glue_character); - -$rspecSet = array(); -$testcases = array(); - -// first step: get the requirements and linked testcases with which we have to work, -// order them into $rspecSet by spec -$gui->total_reqs = 0; -if (count($req_ids)) -{ - list($gui->total_reqs,$rspecSet,$testcases) = buildReqSpecMap($req_ids,$req_mgr,$req_spec_mgr,$tplan_mgr, - $args->states_to_show->selected,$args); - if (!count($rspecSet)) - { - $gui->warning_msg = $labels['no_matching_reqs']; - } +getImages(); +$gui = initGui($args, $tplan_mgr); +$i2u = array( + 'edit_icon', + 'exec_icon', + 'history_small' +); + +$reqContext = array( + 'tproject_id' => $args->tproject_id, + 'tplan_id' => $args->tplan_id, + 'platform_id' => $args->platform +); + +$reqSetX = (array) $req_mgr->getAllByContext($reqContext); +$req_ids = array_keys($reqSetX); + +$prefix = $tproject_mgr->getTestCasePrefix($args->tproject_id) . + (config_get('testcase_cfg')->glue_character); + +$rspecSet = array(); +$testcases = array(); + +// first step: get the requirements and linked testcases with which we have to work, +// order them into $rspecSet by spec +$gui->total_reqs = 0; +if (count($req_ids)) { + list ($gui->total_reqs, $rspecSet, $testcases) = buildReqSpecMap($req_ids, + $req_mgr, $req_spec_mgr, $tplan_mgr, $args->states_to_show->selected, + $args); + if (! count($rspecSet)) { + $gui->warning_msg = $labels['no_matching_reqs']; + } +} else { + $gui->warning_msg = $labels['no_srs_defined']; +} + +// second step: walk through req spec map, count/calculate, store results +if (count($rspecSet)) { + + foreach ($rspecSet as $rspec_id => $req_spec_info) { + $rspecSet[$rspec_id]['req_counters'] = array( + 'total' => 0 + ); + foreach ($req_spec_info['requirements'] as $req_id => $req_info) { + // Test Plan Test Case Version (TPTCV) + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'] = array( + 'total' => 0, + 'totalTPTCV' => 0 + ); + + // add coverage for more detailed evaluation + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['expected_coverage'] = $rspecSet[$rspec_id]['requirements'][$req_id]['expected_coverage']; + + foreach ($req_info['linked_testcases'] as $tc_info) { + $tc_id = $tc_info['id']; + $plat2loop = array_keys($testcases[$tc_id]); + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['total'] ++; + + foreach ($plat2loop as $plat_id) { + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['totalTPTCV'] ++; + if (isset($testcases[$tc_id][$plat_id]['exec_status'])) { + $status = $testcases[$tc_id][$plat_id]['exec_status']; + + // if the counters for this status don't exist yet, initialize them with 0 + if (! isset( + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status])) { + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status] = 0; + } + + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status] ++; + } + } + } + + // evaluate this requirement by configured coverage algorithm + $eval = evaluateReq($status_code_map, + $req_cfg->coverageStatusAlgorithm, + $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']); + + $rspecSet[$rspec_id]['requirements'][$req_id]['evaluation'] = $eval; + + if (! isset($rspecSet[$rspec_id]['req_counters'][$eval])) { + $rspecSet[$rspec_id]['req_counters'][$eval] = 0; + } + + $rspecSet[$rspec_id]['req_counters'][$eval] ++; + $rspecSet[$rspec_id]['req_counters']['total'] ++; + } + } +} + +// last step: build the table +if (count($rspecSet)) { + $allStatusCode = config_get('results'); + + // headers + $columns = array(); + $columns[] = array( + 'title_key' => 'req_spec_short', + 'groupable' => 'true', + 'hideable' => 'false', + 'hidden' => 'true' + ); + $columns[] = array( + 'title_key' => 'title', + 'width' => 100, + 'groupable' => 'false', + 'type' => 'text' + ); + $columns[] = array( + 'title_key' => 'version', + 'width' => 20, + 'groupable' => 'false' + ); + + if ($req_cfg->expected_coverage_management) { + $columns[] = array( + 'title_key' => 'th_coverage', + 'width' => 60, + 'groupable' => 'false' + ); + } + + $evaluation_for_filter = array(); + foreach ($eval_status_map as $eval) { + $evaluation_for_filter[] = $eval['label']; + } + $columns[] = array( + 'title_key' => 'evaluation', + 'width' => 80, + 'groupable' => 'false', + 'filter' => 'ListSimpleMatch', + 'filterOptions' => $evaluation_for_filter + ); + $columns[] = array( + 'title_key' => 'type', + 'width' => 60, + 'groupable' => 'false', + 'filter' => 'list', + 'filterOptions' => $req_type_labels + ); + $columns[] = array( + 'title_key' => 'status', + 'width' => 60, + 'groupable' => 'false', + 'filter' => 'list', + 'filterOptions' => $status_labels + ); + + foreach ($code_status_map as $status) { + $columns[] = array( + 'title_key' => $results_cfg['status_label'][$status['status']], + 'width' => 60, + 'groupable' => 'false' + ); + } + + // complete progress + $columns[] = array( + 'title_key' => 'progress', + 'width' => 60, + 'groupable' => 'false' + ); + $columns[] = array( + 'title_key' => 'linked_tcs', + 'groupable' => 'false', + 'width' => 250, + 'type' => 'text' + ); + + // data for rows + $rows = array(); + foreach ($rspecSet as $req_spec_info) { + + // build the evaluation data string and attache it to req spec name for table group feature + $req_spec_description = buildReqSpecDescription($eval_status_map, + $req_spec_info, $req_cfg->external_req_management, $labels, + $req_spec_type_labels); + + foreach ($req_spec_info['requirements'] as $req_id => $req_info) { + $single_row = array(); + + // first column (grouped, not shown) is req spec information + $path = $req_mgr->tree_mgr->get_path($req_info['srs_id']); + foreach ($path as $key => $val) { + $path[$key] = $val['name']; + } + $path = implode("/", $path); + $single_row[] = htmlentities($path, ENT_QUOTES, $charset) . + $req_spec_description; + + // create the linked title to display + $edit_link = ' "; + + $single_row[] = $edit_link . + htmlentities($req_info['req_doc_id'], ENT_QUOTES, $charset) . + $title_sep . + htmlentities($req_info['title'], ENT_QUOTES, $charset); + + $single_row[] = "" . $req_info['version']; + + // coverage + if ($req_cfg->expected_coverage_management) { + $expected_coverage = $req_info['expected_coverage']; + $current = count($req_info['linked_testcases']); + if ($expected_coverage) { + $coverage_string = "" . $labels['na'] . + " ($current/0)"; + if ($expected_coverage) { + $percentage = 100 / $expected_coverage * $current; + $coverage_string = commentPercentage($percentage) . + " ({$current}/{$expected_coverage})"; + } + $single_row[] = $coverage_string; + } else { + // no expected value, no percentage, just absolute number + $single_row[] = $current; + } + } + + $eval = $req_info['evaluation']; + + // add the count of each evaluation + $eval_status_map[$eval]['count'] += 1; + + $single_row[] = '' . + $eval_status_map[$eval]['label'] . ''; + + $single_row[] = isset($req_type_labels[$req_info['type']]) ? $req_type_labels[$req_info['type']] : sprintf( + $labels['no_label_for_req_type'], $req_info['type']); + + $single_row[] = $status_labels[$req_info['status']]; + + // add count and percentage for each possible status and progress + $progress_percentage = 0; + + $total_count = ($req_cfg->expected_coverage_management && + $expected_coverage > 0) ? $expected_coverage : $req_info['tc_counters']['total']; + + foreach ($status_code_map as $status => $code) { + $count = isset($req_info['tc_counters'][$code]) ? $req_info['tc_counters'][$code] : 0; + $value = 0; + + if ($total_count) { + $percentage = (100 / $total_count) * $count; + $percentage_string = commentPercentage($percentage) . + " ({$count}/{$total_count})"; + + $value = $percentage_string; + + // if status is not "not run", add it to progress percentage + if ($code != $status_code_map['not_run']) { + $progress_percentage += $percentage; + } + } else { + $value = $labels['na']; + } + + $single_row[] = $value; + } + + // complete progress + $single_row[] = $total_count ? commentPercentage( + $progress_percentage) : $labels['na']; + + // show all linked tcversions incl exec result + $linked_tcs_with_status = ''; + if (! empty($req_info['linked_testcases'])) { + // ATTENTION HERE IS WHERE PLATFORMS AFFECTS + foreach ($req_info['linked_testcases'] as $ltcase) { + $tc_id = $ltcase['id']; + foreach ($testcases[$tc_id] as $pelem) { + $status = $status_code_map['not_run']; + if (isset($pelem['exec_status'])) { + $status = $pelem['exec_status']; + $status_l10n = $eval_status_map[$status]['label']; + } else { + $not_run = $allStatusCode['status_code']['not_run']; + $status_l10n = $labels['not_in_testplan']; + } + $pname = ($pelem['platform_id'] > 0 ? ($pelem['platform_name'] . + '/') : ''); + $colored_status = '' . '[' . + $pname . $status_l10n . ']'; + + $tc_name = $prefix . $ltcase['tc_external_id'] . + $title_sep . $ltcase['name'] . " v" . + $ltcase['version']; + + $exec_history_link = "" . + " "; + $edit_link = "" . + " "; + + $exec_link = ""; + + if (isset($pelem['exec_status']) && + $pelem['exec_status'] != $status_code_map['not_run']) { + $exec_link = "" . + " "; + } + + $linked_tcs_with_status .= "{$exec_history_link} {$edit_link} {$exec_link} {$colored_status} {$tc_name}
    "; + } + } + } else { + $linked_tcs_with_status = $labels['no_linked_tcs']; + } + + $single_row[] = $linked_tcs_with_status; + + $rows[] = $single_row; + } + } + + $matrix = new tlExtTable($columns, $rows, 'tl_table_results_reqs'); + $matrix->title = $gui->pageTitle; + + // group by Req Spec and hide that column + $matrix->setGroupByColumnName($labels['req_spec_short']); + + $matrix->setSortByColumnName($labels['progress']); + $matrix->sortDirection = 'DESC'; + + // show long text content in multiple lines + $matrix->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + // define toolbar + $matrix->toolbarShowAllColumnsButton = true; + $matrix->showGroupItemsCount = false; + + $gui->tableSet = array( + $matrix + ); +} + +$gui->summary = $eval_status_map; + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Builds a descriptive string which will be added to the grouping column of the ExtJS table + * for each req spec to see information about the requirements in this spec and their status. + * + * @author Andreas Simon + * @param array $evalcode_status_map + * @param array $spec_info + * @param bool $ext_mgmt_enabled + * @param array $labels + * @param array $spec_types + * @return string description + */ +function buildReqSpecDescription(&$evalcode_status_map, &$spec_info, + $ext_mgmt_enabled, &$labels, &$spec_types) +{ + $description = ""; + $space = "    "; + + $req_count = $spec_info['req_counters']['total']; + $external_count = isset($spec_info['total_req']) ? $spec_info['total_req'] : 0; + $description .= "
    " . $space . $labels['type'] . ": " . + $spec_types[$spec_info['type']]; + + if ($ext_mgmt_enabled && $external_count) { + $description .= "
    {$space}{$labels['req_availability']}: " . + "({$req_count}/{$external_count})"; + } else { + $description .= "
    " . $space . $labels['requirements'] . ": " . + $req_count; + } + + foreach ($evalcode_status_map as $status_code => $status_info) { + $count = isset($spec_info['req_counters'][$status_code]) ? $spec_info['req_counters'][$status_code] : 0; + if ($count) { + $description .= "
    " . $space . $status_info['long_label'] . ": " . + $count; + } + } + + return $description; +} + +/** + * Get the evaluation status of a single requirement. + * + * @author Andreas Simon + * @param array $status_code + * @param array $algorithm_cfg + * @param array $counters + * @return string evaluation + */ +function evaluateReq(&$status_code, &$algorithm_cfg, &$counters) +{ + // init + $evaluation = null; + $is_fully_covered = ($counters['total'] >= $counters['expected_coverage']) ? true : false; + + if (! isset($counters[$status_code['not_run']])) { + $counters[$status_code['not_run']] = 0; + } + + $doIt = true; + if ($counters['total'] == 0) { + // Zero test cases linked to Requirement => uncovered + // Do we really display this req on report? + $evaluation = 'uncovered'; + $doIt = false; + } + + // because we can have a situation where NOT ALL test cases assigned to req + // are linked to test plan, we need to compute how many results we have + // because this figure is equal to qty of test cases linked to test plan + // ATTENTION: recheck logic when there are PLATFORMS. + + // if there are linked test cases and ALL are not run => Req. takes status 'not run' + // how many status counters are set ? + $hmc = 0; + foreach ($status_code as $code) { + $hmc += isset($counters[$code]); + } + + if ($counters['total'] > 0) { + list ($evaluation, $doIt) = doNotRunAnalysis($hmc, $counters, + $status_code['not_run']); + if (! $doIt) { + $evaluation .= ($is_fully_covered ? '' : '_nfc'); + } + } + + if ($doIt) { + $evaluation = null; + $analisysDone = false; + foreach ($algorithm_cfg['checkOrder'] as $checkKey) { + $analisysDone = true; + $doOuterBreak = false; + foreach ($algorithm_cfg['checkType'][$checkKey] as $status2check) { + $code = $status_code[$status2check]; + $count = isset($counters[$code]) ? $counters[$code] : 0; + if ($checkKey == 'atLeastOne' && $count) { + $evaluation = $is_fully_covered ? $code : $code . "_nfc"; + $doOuterBreak = true; + break; + } + + if ($checkKey == 'all' && ($count == $counters['totalTPTCV'])) { + $evaluation = $is_fully_covered ? $code : $code . "_nfc"; + $doOuterBreak = true; + break; + } + } + + if ($doOuterBreak) { + break; + } + } + + if ($analisysDone && is_null($evaluation)) { + $evaluation = 'partially_passed'; + if ($counters[$status_code['not_run']] == 0) { + $evaluation = $status_code['passed']; + } + $evaluation .= ($is_fully_covered ? '' : '_nfc'); + } + } + return $evaluation; +} + +/** + * Transform a numerical value to a string with its value as a padded html comment + * to make sorting on ExtJS table object easier + * + * @author Andreas Simon + * @param int $percentage + * @return string + */ +function commentPercentage($percentage) +{ + $percentage = round($percentage, 2); + $padded_percentage = sprintf("%010d", $percentage); + return " {$percentage}% "; +} + +/** + * initialize user input + * + * @author Andreas Simon + * @param + * resource &$tproject_mgr reference to testproject manager + * @return array $args array with user input information + */ +function initArgs(&$tproject_mgr, &$tplan_mgr, &$req_cfg) +{ + $args = new stdClass(); + + $states_to_show = array( + 0 => "0" + ); + if (isset($_REQUEST['states_to_show'])) { + $states_to_show = $_REQUEST['states_to_show']; + } elseif (isset($_SESSION['states_to_show'])) { + $states_to_show = $_SESSION['states_to_show']; + } + + $args->states_to_show = new stdClass(); + $args->states_to_show->selected = $_SESSION['states_to_show'] = $states_to_show; + + // get configured statuses and add "any" string to menu + $args->states_to_show->items = array( + 0 => "[" . lang_get('any') . "]" + ) + (array) init_labels($req_cfg->status_labels); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + + $args->tplan_id = intval($_SESSION['resultsNavigator_testplanID']); + + $args->format = $_SESSION['resultsNavigator_format']; + + // remember platform selection too + // + $platform = 0; + $gui_open = config_get('gui_separator_open'); + $gui_close = config_get('gui_separator_close'); + + $optLTT = null; + $dummy = $tplan_mgr->platform_mgr->getLinkedToTestplanAsMap($args->tplan_id, + $optLTT); + $args->platformSet = $dummy ? array( + 0 => $gui_open . lang_get('any') . $gui_close + ) + $dummy : null; + + if (isset($_REQUEST['platform'])) { + $platform = $_REQUEST['platform']; + } elseif (isset($_SESSION['platform']) && + isset($args->platforms[$_SESSION['platform']])) { + // ATTENTION: + // This can be ONLY done if: + // the platform we remember linked to current test plan + $platform = intval($_SESSION['platform']); + } + + $args->platform = $_SESSION['platform'] = $platform; + + // $dummy = $tplan_mgr->get_builds_for_html_options($id,$active=null,$open=null,$opt=null) + $dummy = $tplan_mgr->get_builds_for_html_options($args->tplan_id, 1); // Only active builds should be available to choose + $args->buildSet = $dummy ? array( + 0 => $gui_open . lang_get('any') . $gui_close + ) + $dummy : null; + $args->build = 0; + if (isset($_REQUEST['build'])) { + $args->build = $_REQUEST['build']; + } + + return $args; +} + +/** + * initialize GUI object + * + * @author Andreas Simon + * @param stdClass $argsObj + * reference to user input + * @return stdClass $gui gui data + */ +function initGui(&$argsObj, &$tplanMgr) +{ + $gui = new stdClass(); + + $gui->pageTitle = lang_get('title_result_req_testplan'); + $gui->warning_msg = ''; + $gui->tproject_name = $argsObj->tproject_name; + $gui->states_to_show = $argsObj->states_to_show; + $gui->tableSet = null; + $gui->selected_platform = $argsObj->platform; + $gui->platforms = $argsObj->platformSet; + + $gui->builds = $argsObj->buildSet; + $gui->selected_build = $argsObj->build; + + $dummy = $tplanMgr->get_by_id($argsObj->tplan_id); + $gui->tplan_name = $dummy['name']; + + $gui->baseHref = $_SESSION['basehref']; + + return $gui; +} + +function setUpLabels($reqCfg) +{ + $dummy = config_get('req_spec_cfg'); + $rsptlbl = init_labels($dummy->type_labels); + + $rtlbl = init_labels($reqCfg->type_labels); + $slbl = init_labels($reqCfg->status_labels); + + $labels = init_labels( + array( + 'requirement' => null, + 'requirements' => null, + 'type' => null, + 'req_availability' => null, + 'linked_tcs' => null, + 'no_linked_tcs' => null, + 'goto_testspec' => null, + 'design' => null, + 'no_label_for_req_type' => null, + 'progress' => null, + 'na' => 'not_aplicable', + 'no_matching_reqs' => null, + 'execution' => null, + 'no_srs_defined' => null, + 'not_in_testplan' => null, + 'platform' => null, + 'execution_history' => null, + 'req_spec_short' => null + )); + + return array( + $rsptlbl, + $rtlbl, + $slbl, + $labels + ); +} + +/** + */ +function setUpReqStatusCfg() +{ + $results_cfg = config_get('results'); + + $status_code_map = array(); + foreach ($results_cfg['status_label_for_exec_ui'] as $status => $label) { + $status_code_map[$status] = $results_cfg['status_code'][$status]; + } + + $code_status_map = array_flip($status_code_map); + foreach ($code_status_map as $code => $status) { + $code_status_map[$code] = array( + 'label' => lang_get($results_cfg['status_label'][$status]), + 'long_label' => lang_get("req_title_" . $status), + 'status' => $status, + 'css_class' => $status . '_text' + ); + } + + $eva = $code_status_map; + + // add additional states for requirement evaluation + $evalbl = init_labels( + array( + 'partially_passed' => null, + 'partially_passed_reqs' => null, + 'uncovered' => null, + 'uncovered_reqs' => null, + 'passed_nfc' => null, + 'passed_nfc_reqs' => null, + 'failed_nfc' => null, + 'failed_nfc_reqs' => null, + 'blocked_nfc' => null, + 'blocked_nfc_reqs' => null, + 'not_run_nfc' => null, + 'not_run_nfc_reqs' => null, + 'passed' => null, + 'partially_passed_nfc' => null, + 'partially_passed_nfc_reqs' => null + )); + + $eva['partially_passed'] = array( + 'label' => $evalbl['partially_passed'], + 'long_label' => $evalbl['partially_passed_reqs'], + 'css_class' => 'passed_text' + ); + + $eva['uncovered'] = array( + 'label' => $evalbl['uncovered'], + 'long_label' => $evalbl['uncovered_reqs'], + 'css_class' => 'not_run_text' + ); + + $eva['p_nfc'] = array( + 'label' => $evalbl['passed_nfc'], + 'long_label' => $evalbl['passed_nfc_reqs'], + 'css_class' => 'passed_text' + ); + + $eva['f_nfc'] = array( + 'label' => $evalbl['failed_nfc'], + 'long_label' => $evalbl['failed_nfc_reqs'], + 'css_class' => 'failed_text' + ); + + $eva['b_nfc'] = array( + 'label' => $evalbl['blocked_nfc'], + 'long_label' => $evalbl['blocked_nfc_reqs'], + 'css_class' => 'blocked_text' + ); + + $eva['n_nfc'] = array( + 'label' => $evalbl['not_run_nfc'], + 'long_label' => $evalbl['not_run_nfc_reqs'], + 'css_class' => 'not_run_text' + ); + + $eva['partially_passed_nfc'] = array( + 'label' => $evalbl['partially_passed_nfc'], + 'long_label' => $evalbl['partially_passed_nfc_reqs'], + 'css_class' => 'passed_text' + ); + + // add count for each status to show test progress + foreach ($eva as $key => $status) { + $eva[$key]['count'] = 0; + } + + return array( + $results_cfg, + $status_code_map, + $code_status_map, + $eva + ); +} + +/** + */ +function buildReqSpecMap($reqSet, &$reqMgr, &$reqSpecMgr, &$tplanMgr, + $reqStatusFilter, &$argsObj) +{ + $rspec = array(); + $total = 0; + $tc_ids = array(); + + $coverageContext = null; + if ($argsObj->platform != 0) { + $coverageContext['tplan_id'] = $argsObj->tplan_id; + $coverageContext['platform_id'] = $argsObj->platform; + } + + // Test case linked to test plan + // $itemsInTestPlan = $tplanMgr->get_linked_items_id($argsObj->tplan_id); + $itemsInTestPlan = $tplanMgr->getLinkedItems($argsObj->tplan_id); + foreach ($reqSet as $id) { + // get the information for this requirement + $req = $reqMgr->get_by_id($id, requirement_mgr::LATEST_VERSION); + $req = $req[0]; + + // if req is "usable" (has one of the selected states) add it + if (in_array($req['status'], $reqStatusFilter, true) || + in_array("0", $reqStatusFilter, true)) { + + // some sort of Caching + if (! isset($rspec[$req['srs_id']])) { + $rspec[$req['srs_id']] = $reqSpecMgr->get_by_id($req['srs_id']); + $rspec[$req['srs_id']]['requirements'] = array(); + } + + $req['linked_testcases'] = (array) $reqMgr->getActiveForReqVersion( + $req['version_id']); + + // Exclude obsolete TC or TC not linked to test plan under analysis + foreach ($req['linked_testcases'] as $itemID => $dummy) { + if ($dummy['is_obsolete'] == "1" || + ! isset($itemsInTestPlan[$dummy['id']])) { + unset($req['linked_testcases'][$itemID]); + } + } + + // if there is linked (active) test case + if (count($req['linked_testcases']) > 0) { + $total ++; + $rspec[$req['srs_id']]['requirements'][$id] = $req; + + foreach ($req['linked_testcases'] as $tc) { + $tc_ids[] = $tc['id']; + } + } + } + } + + // Get test case data from test case version LINKED TO TEST PLAN, + // using as FILTER test cases ASSIGNED (linked) TO requirements + // + // ATTENTION: + // What can happens is this + // Test spec has TC1,TC2,TC3,TC4 + // REQ 1 has TC1,TC2.TC3 assigned + // TEST PLAN A has only TC1, TC2 + // + // It will be impossibile to provide a CLEAR INDICATION of + // relation between REQ status and Test case exec status, because + // TC3 is NOT PART OF TEST PLAN under analisys + // + $tcaseSet = array(); + if (count($tc_ids)) { + $filters = array( + 'tcase_id' => $tc_ids + ); + $f2a = array( + 'platform', + 'build' + ); + foreach ($f2a as $fk) { + if ($argsObj->$fk != 0) { + $filters[$fk . '_id'] = $argsObj->$fk; + } + } + + $filterOnly = array(); + $filterOnly['platform_id'] = isset($filters['platform_id']) && + ! isset($filters['build_id']); + $filterOnly['build_id'] = ! isset($filters['platform_id']) && + isset($filters['build_id']); + $noFilter = ! isset($filters['platform_id']) && + ! isset($filters['build_id']); + $allFilters = isset($filters['platform_id']) && + isset($filters['build_id']); + + $options = array( + 'addExecInfo' => true, + 'accessKeyType' => 'tcase+platform', + 'build_is_active' => true + ); + + if ($noFilter || $filterOnly['platform_id']) { + $tcaseSet = $tplanMgr->getLTCVOnTestPlanPlatform($argsObj->tplan_id, + $filters, $options); + } elseif ($allFilters || $filterOnly['build_id']) { + $tcaseSet = $tplanMgr->getLTCVNewGeneration($argsObj->tplan_id, + $filters, $options); + } + } + + return array( + $total, + $rspec, + $tcaseSet + ); +} + +/** + */ +function doNotRunAnalysis($tcaseQty, $execStatusCounter, $notRunCode) +{ + $evaluation = null; + $doIt = true; + + if ($tcaseQty == 1) { + if ($execStatusCounter[$notRunCode] != 0) { + $evaluation = $notRunCode; + $doIt = false; + } + } else { + if ($execStatusCounter['totalTPTCV'] == $execStatusCounter[$notRunCode]) { + $evaluation = $notRunCode; + $doIt = false; + } + } + return array( + $evaluation, + $doIt + ); +} + +/** + * Check if the user has the needed rights to view this page (testplan metrics). + * + * @author Andreas Simon + * @param Database $db + * reference to database object + * @param tlUser $user + * reference to user object + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } -else -{ - $gui->warning_msg = $labels['no_srs_defined']; -} - - -// second step: walk through req spec map, count/calculate, store results -if(count($rspecSet)) -{ - - foreach ($rspecSet as $rspec_id => $req_spec_info) - { - $rspecSet[$rspec_id]['req_counters'] = array('total' => 0); - foreach ($req_spec_info['requirements'] as $req_id => $req_info) - { - // Test Plan Test Case Version (TPTCV) - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'] = array('total' => 0,'totalTPTCV' => 0); - - // add coverage for more detailed evaluation - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['expected_coverage'] = - $rspecSet[$rspec_id]['requirements'][$req_id]['expected_coverage']; - - foreach ($req_info['linked_testcases'] as $key => $tc_info) - { - $tc_id = $tc_info['id']; - $plat2loop = array_keys($testcases[$tc_id]); - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['total']++; - - foreach($plat2loop as $plat_id) - { - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']['totalTPTCV']++; - if (isset($testcases[$tc_id][$plat_id]['exec_status'])) - { - $status = $testcases[$tc_id][$plat_id]['exec_status']; - - // if the counters for this status don't exist yet, initialize them with 0 - if (!isset($rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status])) - { - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status] = 0; - } - - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters'][$status] ++; - } - } - } - - // evaluate this requirement by configured coverage algorithm - $eval = evaluate_req($status_code_map, $req_cfg->coverageStatusAlgorithm, - $rspecSet[$rspec_id]['requirements'][$req_id]['tc_counters']); - - $rspecSet[$rspec_id]['requirements'][$req_id]['evaluation'] = $eval; - - if (!isset($rspecSet[$rspec_id]['req_counters'][$eval])) - { - $rspecSet[$rspec_id]['req_counters'][$eval] = 0; - } - - $rspecSet[$rspec_id]['req_counters'][$eval] ++; - $rspecSet[$rspec_id]['req_counters']['total'] ++; - } - } -} - -// last step: build the table -if (count($rspecSet)) -{ - $allStatusCode = config_get('results'); - - // headers - $columns = array(); - $columns[] = array('title_key' => 'req_spec_short', - 'groupable' => 'true', 'hideable' => 'false', 'hidden' => 'true'); - $columns[] = array('title_key' => 'title', 'width' => 100, - 'groupable' => 'false', 'type' => 'text'); - $columns[] = array('title_key' => 'version', 'width' => 20, 'groupable' => 'false'); - - if ($req_cfg->expected_coverage_management) - { - $columns[] = array('title_key' => 'th_coverage', 'width' => 60, 'groupable' => 'false'); - } - - $evaluation_for_filter = array(); - foreach($eval_status_map as $eval) - { - $evaluation_for_filter[] = $eval['label']; - } - $columns[] = array('title_key' => 'evaluation', 'width' => 80, 'groupable' => 'false', - 'filter' => 'ListSimpleMatch', 'filterOptions' => $evaluation_for_filter); - $columns[] = array('title_key' => 'type', 'width' => 60, 'groupable' => 'false', - 'filter' => 'list', 'filterOptions' => $req_type_labels); - $columns[] = array('title_key' => 'status', 'width' => 60, 'groupable' => 'false', - 'filter' => 'list', 'filterOptions' => $status_labels); - - foreach ($code_status_map as $status) - { - $columns[] = array('title_key' => $results_cfg['status_label'][$status['status']], - 'width' => 60, 'groupable' => 'false'); - } - - // complete progress - $columns[] = array('title_key' => 'progress', 'width' => 60, 'groupable' => 'false'); - $columns[] = array('title_key' => 'linked_tcs', 'groupable' => 'false', 'width' => 250, 'type' => 'text'); - - // data for rows - $rows = array(); - foreach ($rspecSet as $rspec_id => $req_spec_info) - { - - // build the evaluation data string and attache it to req spec name for table group feature - $req_spec_description = build_req_spec_description($eval_status_map, $req_spec_info, - $req_cfg->external_req_management, $labels, - $req_spec_type_labels); - - - foreach ($req_spec_info['requirements'] as $req_id => $req_info) - { - $single_row = array(); - - // first column (grouped, not shown) is req spec information - $path = $req_mgr->tree_mgr->get_path($req_info['srs_id']); - foreach ($path as $key => $val) - { - $path[$key] = $val['name']; - } - $path = implode("/", $path); - $single_row[] = htmlentities($path, ENT_QUOTES, $charset) . $req_spec_description; - - // create the linked title to display - $edit_link = ' "; - - $single_row[] = $edit_link . - htmlentities($req_info['req_doc_id'], ENT_QUOTES, $charset) . $title_sep . - htmlentities($req_info['title'], ENT_QUOTES, $charset); - - $single_row[] = "" . $req_info['version']; - - // coverage - if ($req_cfg->expected_coverage_management) - { - $expected_coverage = $req_info['expected_coverage']; - $current = count($req_info['linked_testcases']); - if ($expected_coverage) - { - $coverage_string = "" . $labels['na'] . " ($current/0)"; - if ($expected_coverage) - { - $percentage = 100 / $expected_coverage * $current; - $coverage_string = comment_percentage($percentage) . - " ({$current}/{$expected_coverage})"; - } - $single_row[] = $coverage_string; - } - else - { - // no expected value, no percentage, just absolute number - $single_row[] = $current; - } - } - - $eval = $req_info['evaluation']; - - // add the count of each evaluation - $eval_status_map[$eval]['count'] += 1; - - $single_row[] = '' . - $eval_status_map[$eval]['label'] . ''; - - $single_row[] = isset($req_type_labels[$req_info['type']]) ? $req_type_labels[$req_info['type']] : - sprintf($labels['no_label_for_req_type'],$req_info['type']); - - $single_row[] = $status_labels[$req_info['status']]; - - // add count and percentage for each possible status and progress - $progress_percentage = 0; - - $total_count = ($req_cfg->expected_coverage_management && $expected_coverage > 0) ? - $expected_coverage : $req_info['tc_counters']['total']; - - foreach ($status_code_map as $status => $code) - { - $count = isset($req_info['tc_counters'][$code]) ? $req_info['tc_counters'][$code] : 0; - $value = 0; - - if ($total_count) - { - $percentage = (100 / $total_count) * $count; - $percentage_string = comment_percentage($percentage) . " ({$count}/{$total_count})"; - - $value = $percentage_string; - - // if status is not "not run", add it to progress percentage - if ($code != $status_code_map['not_run']) - { - $progress_percentage += $percentage; - } - } - else - { - $value = $labels['na']; - } - - $single_row[] = $value; - } - - // complete progress - $single_row[] = $total_count ? comment_percentage($progress_percentage) : $labels['na']; - - // show all linked tcversions incl exec result - $linked_tcs_with_status = ''; - if (count($req_info['linked_testcases']) > 0 ) - { - // ATTENTION HERE IS WHERE PLATFORMS AFFECTS - foreach($req_info['linked_testcases'] as $ltcase) - { - $tc_id = $ltcase['id']; - foreach($testcases[$tc_id] as $pelem) - { - $status = $status_code_map['not_run']; - if(isset($pelem['exec_status'])) - { - $status = $pelem['exec_status']; - $status_l10n = $eval_status_map[$status]['label']; - } - else - { - $not_run = $allStatusCode['status_code']['not_run']; - $status_l10n = $labels['not_in_testplan']; - } - $pname = ($pelem['platform_id'] > 0 ? ($pelem['platform_name'] . '/') : '' ); - $colored_status = '' . - '[' . $pname . $status_l10n . ']'; - - - $tc_name = $prefix . $ltcase['tc_external_id'] . $title_sep . $ltcase['name'] . " v" . $ltcase['version']; - - $exec_history_link = "" . - " "; - $edit_link = "" . - " "; - - $exec_link = ""; - - - if(isset($pelem['exec_status']) && $pelem['exec_status'] != $status_code_map['not_run']) - { - $exec_link = "" . - " "; - } - - $linked_tcs_with_status .= "{$exec_history_link} {$edit_link} {$exec_link} {$colored_status} {$tc_name}
    "; - } - - } - } - else - { - $linked_tcs_with_status = $labels['no_linked_tcs']; - } - - $single_row[] = $linked_tcs_with_status; - - $rows[] = $single_row; - } - } - - $matrix = new tlExtTable($columns, $rows, 'tl_table_results_reqs'); - $matrix->title = $gui->pageTitle; - - // group by Req Spec and hide that column - $matrix->setGroupByColumnName($labels['req_spec_short']); - - $matrix->setSortByColumnName($labels['progress']); - $matrix->sortDirection = 'DESC'; - - // show long text content in multiple lines - $matrix->addCustomBehaviour('text', array('render' => 'columnWrap')); - - // define toolbar - $matrix->toolbarShowAllColumnsButton = true; - $matrix->showGroupItemsCount = false; - - $gui->tableSet = array($matrix); -} - -$gui->summary = $eval_status_map; - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * Builds a descriptive string which will be added to the grouping column of the ExtJS table - * for each req spec to see information about the requirements in this spec and their status. - * - * @author Andreas Simon - * @param array $evalcode_status_map - * @param array $spec_info - * @param bool $ext_mgmt_enabled - * @param array $labels - * @param array $spec_types - * @return string description - */ -function build_req_spec_description(&$evalcode_status_map, &$spec_info, $ext_mgmt_enabled, - &$labels, &$spec_types) -{ - - $description = ""; - $space = "    "; - - $req_count = $spec_info['req_counters']['total']; - $external_count = isset($spec_info['total_req']) ? $spec_info['total_req'] : 0; - $description .= "
    " . $space . $labels['type'] . ": " . $spec_types[$spec_info['type']]; - - if ($ext_mgmt_enabled && $external_count) - { - $description .= "
    {$space}{$labels['req_availability']}: " . - "({$req_count}/{$external_count})"; - } - else - { - $description .= "
    " . $space . $labels['requirements'] . ": " . $req_count; - } - - foreach ($evalcode_status_map as $status_code => $status_info) - { - $count = isset($spec_info['req_counters'][$status_code]) ? - $spec_info['req_counters'][$status_code] : 0; - if ($count) - { - $description .= "
    " . $space . $status_info['long_label'] . ": " . $count; - } - } - - return $description; -} - - -/** - * Get the evaluation status of a single requirement. - * - * @author Andreas Simon - * @param array $status_code - * @param array $algorithm_cfg - * @param array $counters - * @return string evaluation - */ -function evaluate_req(&$status_code, &$algorithm_cfg, &$counters) -{ - // init - $evaluation = null; - $is_fully_covered = ($counters['total'] >= $counters['expected_coverage']) ? true : false; - - if( !isset($counters[$status_code['not_run']]) ) - { - $counters[$status_code['not_run']] = 0; - } - - $doIt = true; - if ($counters['total'] == 0) - { - // Zero test cases linked to Requirement => uncovered - // Do we really display this req on report? - $evaluation = 'uncovered'; - $doIt = false; - } - - - // because we can have a situation where NOT ALL test cases assigned to req - // are linked to test plan, we need to compute how many results we have - // because this figure is equal to qty of test cases linked to test plan - // ATTENTION: recheck logic when there are PLATFORMS. - - // if there are linked test cases and ALL are not run => Req. takes status 'not run' - // how many status counters are set ? - $hmc = 0; - foreach($status_code as $verbose => $code) - { - $hmc += isset($counters[$code]); - } - - if( ($counters['total'] > 0) ) - { - list($evaluation,$doIt) = doNotRunAnalysis($hmc,$counters,$status_code['not_run']); - if(!$doIt) - { - $evaluation .= ($is_fully_covered ? '' : '_nfc'); - } - } - - if($doIt) - { - $evaluation = null; - $analisysDone = false; - foreach($algorithm_cfg['checkOrder'] as $checkKey) - { - $analisysDone = true; - $doOuterBreak = false; - foreach($algorithm_cfg['checkType'][$checkKey] as $status2check) - { - $code = $status_code[$status2check]; - $count = isset($counters[$code]) ? $counters[$code] : 0; - if ($checkKey == 'atLeastOne' && $count) - { - $evaluation = $is_fully_covered ? $code : $code . "_nfc"; - $doOuterBreak = true; - break; - } - - if($checkKey == 'all' && ($count == $counters['totalTPTCV']) ) - { - $evaluation = $is_fully_covered ? $code : $code . "_nfc"; - $doOuterBreak = true; - break; - } - } - - if($doOuterBreak) - { - break; - } - } - - if($analisysDone && is_null($evaluation)) - { - $evaluation = 'partially_passed'; - if($counters[$status_code['not_run']] == 0) - { - $evaluation = $status_code['passed']; - } - $evaluation .= ($is_fully_covered ? '' : '_nfc'); - } - } - return $evaluation; -} - - -/** - * Transform a numerical value to a string with its value as a padded html comment - * to make sorting on ExtJS table object easier - * - * @author Andreas Simon - * @param int $percentage - * @return string - */ -function comment_percentage($percentage) -{ - $percentage = round($percentage, 2); - $padded_percentage = sprintf("%010d", $percentage); - $string = " {$percentage}% "; - return $string; -} - - -/** - * initialize user input - * - * @author Andreas Simon - * @param resource &$tproject_mgr reference to testproject manager - * @return array $args array with user input information - */ -function init_args(&$tproject_mgr, &$tplan_mgr, &$req_cfg) -{ - $args = new stdClass(); - - $states_to_show = array(0 => "0"); - if (isset($_REQUEST['states_to_show'])) - { - $states_to_show = $_REQUEST['states_to_show']; - } - else if (isset($_SESSION['states_to_show'])) - { - $states_to_show = $_SESSION['states_to_show']; - } - - $args->states_to_show = new stdClass(); - $args->states_to_show->selected = $_SESSION['states_to_show'] = $states_to_show; - - // get configured statuses and add "any" string to menu - $args->states_to_show->items = array(0 => "[" . lang_get('any') . "]") + - (array) init_labels($req_cfg->status_labels); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - - $args->tplan_id = intval($_SESSION['resultsNavigator_testplanID']); - - $args->format = $_SESSION['resultsNavigator_format']; - - // remember platform selection too - // - $platform = 0; - $gui_open = config_get('gui_separator_open'); - $gui_close = config_get('gui_separator_close'); - - $optLTT = null; - $dummy = $tplan_mgr->platform_mgr->getLinkedToTestplanAsMap($args->tplan_id,$optLTT); - $args->platformSet = $dummy ? array(0 => $gui_open . lang_get('any') . $gui_close) + $dummy : null; - - if (isset($_REQUEST['platform'])) - { - $platform = $_REQUEST['platform']; - } - else if ( isset($_SESSION['platform']) && isset($args->platforms[$_SESSION['platform']]) ) - { - // ATTENTION: - // This can be ONLY done if: - // the platform we remember linked to current test plan - $platform = intval($_SESSION['platform']); - } - - $args->platform = $_SESSION['platform'] = $platform; - - - // $dummy = $tplan_mgr->get_builds_for_html_options($id,$active=null,$open=null,$opt=null) - $dummy = $tplan_mgr->get_builds_for_html_options($args->tplan_id, 1); //Only active builds should be available to choose - $args->buildSet = $dummy ? array(0 => $gui_open . lang_get('any') . $gui_close) + $dummy : null; - $args->build = 0; - if (isset($_REQUEST['build'])) - { - $args->build = $_REQUEST['build']; - } - - return $args; -} - - -/** - * initialize GUI object - * - * @author Andreas Simon - * @param stdClass $argsObj reference to user input - * @return stdClass $gui gui data - */ -function init_gui(&$argsObj,&$tplanMgr) -{ - $gui = new stdClass(); - - $gui->pageTitle = lang_get('title_result_req_testplan'); - $gui->warning_msg = ''; - $gui->tproject_name = $argsObj->tproject_name; - $gui->states_to_show = $argsObj->states_to_show; - $gui->tableSet = null; - $gui->selected_platform = $argsObj->platform; - $gui->platforms = $argsObj->platformSet; - - $gui->builds = $argsObj->buildSet; - $gui->selected_build = $argsObj->build; - - $dummy = $tplanMgr->get_by_id($argsObj->tplan_id); - $gui->tplan_name = $dummy['name']; - - $gui->baseHref = $_SESSION['basehref']; - - return $gui; -} - - -function setUpLabels($reqCfg) -{ - $dummy = config_get('req_spec_cfg'); - $rsptlbl = init_labels($dummy->type_labels); - - $rtlbl = init_labels($reqCfg->type_labels); - $slbl = init_labels($reqCfg->status_labels); - - $labels = init_labels( array('requirement' => null,'requirements' => null, - 'type' => null,'req_availability' => null, - 'linked_tcs' => null,'no_linked_tcs' => null, - 'goto_testspec' => null,'design' => null, - 'no_label_for_req_type' => null, 'progress' => null, - 'na' => 'not_aplicable', 'no_matching_reqs' => null, - 'execution' => null,'no_srs_defined' => null, - 'not_in_testplan' => null,'platform' => null, - 'execution_history' => null, 'req_spec_short' => null)); - - return array($rsptlbl,$rtlbl,$slbl,$labels); -} - -/** - * - */ -function setUpReqStatusCfg() -{ - $results_cfg = config_get('results'); - - $status_code_map = array(); - foreach ($results_cfg['status_label_for_exec_ui'] as $status => $label) - { - $status_code_map[$status] = $results_cfg['status_code'][$status]; - } - - $code_status_map = array_flip($status_code_map); - foreach ($code_status_map as $code => $status) - { - $code_status_map[$code] = array('label' => lang_get($results_cfg['status_label'][$status]), - 'long_label' => lang_get("req_title_" . $status), - 'status' => $status, - 'css_class' => $status . '_text'); - } - - - $eva = $code_status_map; - - // add additional states for requirement evaluation - $evalbl = init_labels(array('partially_passed' => null, 'partially_passed_reqs' => null, - 'uncovered' => null, 'uncovered_reqs' => null, - 'passed_nfc' => null, 'passed_nfc_reqs' => null, - 'failed_nfc' => null, 'failed_nfc_reqs' => null, - 'blocked_nfc' => null, 'blocked_nfc_reqs' => null, - 'not_run_nfc' => null, 'not_run_nfc_reqs' => null, - 'passed' => null, - 'partially_passed_nfc' => null, 'partially_passed_nfc_reqs' => null)); - - $eva['partially_passed'] = array('label' => $evalbl['partially_passed'], - 'long_label' => $evalbl['partially_passed_reqs'], - 'css_class' => 'passed_text'); - - $eva['uncovered'] = array('label' => $evalbl['uncovered'], - 'long_label' => $evalbl['uncovered_reqs'], - 'css_class' => 'not_run_text'); - - $eva['p_nfc'] = array('label' => $evalbl['passed_nfc'], - 'long_label' => $evalbl['passed_nfc_reqs'], - 'css_class' => 'passed_text'); - - $eva['f_nfc'] = array('label' => $evalbl['failed_nfc'], - 'long_label' => $evalbl['failed_nfc_reqs'], - 'css_class' => 'failed_text'); - - $eva['b_nfc'] = array('label' => $evalbl['blocked_nfc'], - 'long_label' => $evalbl['blocked_nfc_reqs'], - 'css_class' => 'blocked_text'); - - $eva['n_nfc'] = array('label' => $evalbl['not_run_nfc'], - 'long_label' => $evalbl['not_run_nfc_reqs'], - 'css_class' => 'not_run_text'); - - $eva['partially_passed_nfc'] = array('label' => $evalbl['partially_passed_nfc'], - 'long_label' => $evalbl['partially_passed_nfc_reqs'], - 'css_class' => 'passed_text'); - - - // add count for each status to show test progress - foreach ($eva as $key => $status) - { - $eva[$key]['count'] = 0; - } - - return array($results_cfg,$status_code_map,$code_status_map,$eva); -} - - -/** - * - */ -function buildReqSpecMap($reqSet,&$reqMgr,&$reqSpecMgr,&$tplanMgr,$reqStatusFilter,&$argsObj) -{ - $rspec = array(); - $total = 0; - $tc_ids = array(); - - $coverageContext = null; - if ($argsObj->platform != 0) - { - $coverageContext['tplan_id'] = $argsObj->tplan_id; - $coverageContext['platform_id'] = $argsObj->platform; - } - - // Test case linked to test plan - // $itemsInTestPlan = $tplanMgr->get_linked_items_id($argsObj->tplan_id); - $itemsInTestPlan = $tplanMgr->getLinkedItems($argsObj->tplan_id); - foreach($reqSet as $id) - { - // get the information for this requirement - $req = $reqMgr->get_by_id($id, requirement_mgr::LATEST_VERSION); - $req = $req[0]; - - // if req is "usable" (has one of the selected states) add it - if( in_array($req['status'], $reqStatusFilter, true) || - in_array("0", $reqStatusFilter, true) ) - { - - // some sort of Caching - if (!isset($rspec[$req['srs_id']])) - { - $rspec[$req['srs_id']] = $reqSpecMgr->get_by_id($req['srs_id']); - $rspec[$req['srs_id']]['requirements'] = array(); - } - - $req['linked_testcases'] = (array)$reqMgr->getActiveForReqVersion($req['version_id']); - - // Exclude obsolete TC or TC not linked to test plan under analysis - foreach($req['linked_testcases'] as $itemID => $dummy) - { - if ($dummy['is_obsolete'] == "1" || ! isset($itemsInTestPlan[$dummy['id']]) ) { - unset($req['linked_testcases'][$itemID]); - } - } - - // if there is linked (active) test case - if (count($req['linked_testcases']) > 0) { - $total++; - $rspec[$req['srs_id']]['requirements'][$id] = $req; - - foreach ($req['linked_testcases'] as $tc) - { - $tc_ids[] = $tc['id']; - } - } - } - } - - // Get test case data from test case version LINKED TO TEST PLAN, - // using as FILTER test cases ASSIGNED (linked) TO requirements - // - // ATTENTION: - // What can happens is this - // Test spec has TC1,TC2,TC3,TC4 - // REQ 1 has TC1,TC2.TC3 assigned - // TEST PLAN A has only TC1, TC2 - // - // It will be impossibile to provide a CLEAR INDICATION of - // relation between REQ status and Test case exec status, because - // TC3 is NOT PART OF TEST PLAN under analisys - // - $tcaseSet = array(); - if (count($tc_ids)) - { - $filters = array('tcase_id' => $tc_ids); - $f2a = array('platform','build'); - foreach($f2a as $fk) - { - if ($argsObj->$fk != 0) - { - $filters[$fk . '_id'] = $argsObj->$fk; - } - - } - - $filterOnly = array(); - $filterOnly['platform_id'] = isset($filters['platform_id']) && !isset($filters['build_id']); - $filterOnly['build_id'] = !isset($filters['platform_id']) && isset($filters['build_id']); - $noFilter = !isset($filters['platform_id']) && !isset($filters['build_id']); - $allFilters = isset($filters['platform_id']) && isset($filters['build_id']); - - // $options = array('addExecInfo' => true,'accessKeyType' => 'tcase'); - $options = array('addExecInfo' => true,'accessKeyType' => 'tcase+platform', 'build_is_active' => true); - - if($noFilter || $filterOnly['platform_id']) - { - $tcaseSet = $tplanMgr->getLTCVOnTestPlanPlatform($argsObj->tplan_id, $filters, $options); - } - else if ($allFilters || $filterOnly['build_id']) - { - $tcaseSet = $tplanMgr->getLTCVNewGeneration($argsObj->tplan_id, $filters, $options); - } - } - - return array($total,$rspec,$tcaseSet); -} - -/** - * - */ -function doNotRunAnalysis($tcaseQty,$execStatusCounter,$notRunCode) -{ - $evaluation = null; - $doIt = true; - - if($tcaseQty == 1) - { - if( $execStatusCounter[$notRunCode] != 0 ) - { - $evaluation = $notRunCode; - $doIt = false; - } - } - else - { - if(($execStatusCounter['totalTPTCV'] == $execStatusCounter[$notRunCode])) - { - $evaluation = $notRunCode; - $doIt = false; - } - } - return array($evaluation,$doIt); -} - - - -/** - * Check if the user has the needed rights to view this page (testplan metrics). - * - * @author Andreas Simon - * @param Database $db reference to database object - * @param tlUser $user reference to user object - */ -function checkRights(&$db, &$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/resultsTC.php b/lib/results/resultsTC.php index d8a67e7f38..266e5c9009 100644 --- a/lib/results/resultsTC.php +++ b/lib/results/resultsTC.php @@ -1,828 +1,882 @@ - -* -* Test Results Matrix -* -*/ -require('../../config.inc.php'); - -// Must be included BEFORE common.php -require_once('../../third_party/codeplex/PHPExcel.php'); - -require_once('common.php'); -require_once('displayMgr.php'); -require_once('exttable.class.php'); - -$timerOn = microtime(true); // will be used to compute elapsed time -$templateCfg = templateConfiguration(); - -$smarty = new TLSmarty; - -list($tplan_mgr,$args) = initArgsForReports($db); -$metricsMgr = new tlTestPlanMetrics($db); -$tplan_mgr = &$metricsMgr; - -list($gui,$tproject_info,$labels,$cfg) = initializeGui($db,$args,$smarty->getImages(),$tplan_mgr); -$args->cfg = $cfg; - -$renderHTML = true; - -// Because we will try to send via email xls, we need to be careful -// with logic regarding args->format. -// may be we need to add in logic the media => email, download, etc -// -// We have faced a performance block due to an environment with -// 700 Builds and 1300 Test Cases on Test Plan -// This created a block on NOT RUN QUERY, but anyway will produce an enormous and -// unmanageable matrix on screen -// -// New way to process: -// ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use -// Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry -// - -setUpBuilds($args,$gui); -$buildSet = array('buildSet' => $args->builds->idSet); - -if( ($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit) || - ($args->doAction == 'result' && - count($args->builds->idSet) <= $gui->matrixCfg->buildQtyLimit) ) { - - $tpl = $templateCfg->default_template; - - $opt = array('getExecutionNotes' => true); - if($args->format == FORMAT_XLS) { - $opt = array('getExecutionNotes' => true, 'getTester' => true, - 'getUserAssignment' => true, - 'getExecutionTimestamp' => true, 'getExecutionDuration' => true); - } - $execStatus = $metricsMgr->getExecStatusMatrix($args->tplan_id,$buildSet,$opt); - - $metrics = $execStatus['metrics']; - $latestExecution = $execStatus['latestExec']; - - // Every Test suite a row on matrix to display will be created - // One matrix will be created for every platform that has testcases - $args->cols = initCols($gui->show_platforms); - if( !is_null($execStatus['metrics']) ) { - buildDataSet($db,$args,$gui,$execStatus,$labels); - } - - $renderHTML = false; - - switch($args->format) { - case FORMAT_XLS: - createSpreadsheet($gui,$args,$args->getSpreadsheetBy); - break; - - default: - $renderHTML = true; - $gui->tableSet[] = buildMatrix($gui, $args); - break; - } -} else { - // We need to ask user to do a choice - $tpl = 'resultsTCLauncher.tpl'; - $gui->url2call = - "lib/results/resultsTC.php?tplan_id=$gui->tplan_id" . - "&tproject_id=$gui->tproject_id&doAction=result&format="; - - $gui->pageTitle = $labels['test_result_matrix_filters']; - if($gui->matrixCfg->buildQtyLimit > 0) { - $gui->userFeedback = $labels['too_much_data'] . '
    ' . - sprintf($labels['too_much_builds'],$gui->activeBuildsQty,$gui->matrixCfg->buildQtyLimit); - } -} - - -$timerOff = microtime(true); -$gui->elapsed_time = round($timerOff - $timerOn,2); - -$smarty->assign('gui',$gui); -displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, - $gui->mailCfg,$renderHTML); - - -/** - * - * - */ -function checkRights(&$db,&$user,$context = null) -{ - if (is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; + + * + * Test Results Matrix + * + */ +require_once '../../config.inc.php'; +require_once '../../third_party/codeplex/PHPExcel.php'; // Must be included BEFORE common.php +require_once 'common.php'; +require_once 'displayMgr.php'; +require_once 'exttable.class.php'; + +$timerOn = microtime(true); // will be used to compute elapsed time +$templateCfg = templateConfiguration(); + +$smarty = new TLSmarty(); + +list ($tplan_mgr, $args) = initArgsForReports($db); +$metricsMgr = new tlTestPlanMetrics($db); +$tplan_mgr = &$metricsMgr; + +list ($gui, $tproject_info, $labels, $cfg) = initializeGui($db, $args, + $smarty->getImages(), $tplan_mgr); +$args->cfg = $cfg; + +$renderHTML = true; + +// Because we will try to send via email xls, we need to be careful +// with logic regarding args->format. +// may be we need to add in logic the media => email, download, etc +// +// We have faced a performance block due to an environment with +// 700 Builds and 1300 Test Cases on Test Plan +// This created a block on NOT RUN QUERY, but anyway will produce an enormous and +// unmanageable matrix on screen +// +// New way to process: +// ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use +// Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry +// + +setUpBuilds($args, $gui); +$buildSet = array( + 'buildSet' => $args->builds->idSet +); + +if (($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit) || + ($args->doAction == 'result' && + count($args->builds->idSet) <= $gui->matrixCfg->buildQtyLimit)) { + + $tpl = $templateCfg->default_template; + + $opt = array( + 'getExecutionNotes' => true + ); + if ($args->format == FORMAT_XLS) { + $opt = array( + 'getExecutionNotes' => true, + 'getTester' => true, + 'getUserAssignment' => true, + 'getExecutionTimestamp' => true, + 'getExecutionDuration' => true + ); + } + $execStatus = $metricsMgr->getExecStatusMatrix($args->tplan_id, $buildSet, + $opt); + + $metrics = $execStatus['metrics']; + $latestExecution = $execStatus['latestExec']; + + // Every Test suite a row on matrix to display will be created + // One matrix will be created for every platform that has testcases + $args->cols = initCols($gui->show_platforms); + if (! is_null($execStatus['metrics'])) { + buildDataSet($db, $args, $gui, $execStatus, $labels); + } + + $renderHTML = false; + + switch ($args->format) { + case FORMAT_XLS: + createSpreadsheet($gui, $args, $args->getSpreadsheetBy); + break; + + default: + $renderHTML = true; + $gui->tableSet[] = buildMatrix($gui, $args); + break; + } +} else { + // We need to ask user to do a choice + $tpl = 'resultsTCLauncher.tpl'; + $gui->url2call = "lib/results/resultsTC.php?tplan_id=$gui->tplan_id" . + "&tproject_id=$gui->tproject_id&doAction=result&format="; + + $gui->pageTitle = $labels['test_result_matrix_filters']; + if ($gui->matrixCfg->buildQtyLimit > 0) { + $gui->userFeedback = $labels['too_much_data'] . '
    ' . + sprintf($labels['too_much_builds'], $gui->activeBuildsQty, + $gui->matrixCfg->buildQtyLimit); + } +} + +$timerOff = microtime(true); +$gui->elapsed_time = round($timerOff - $timerOn, 2); + +$smarty->assign('gui', $gui); +displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, + $gui->mailCfg, $renderHTML); + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); +} + +/** + * Builds ext-js rich table to display matrix results + * + * + * return tlExtTable + */ +function buildMatrix(&$guiObj, &$argsObj, $forceFormat = null) +{ + $buildIDSet = $argsObj->builds->idSet; + $latestBuild = $argsObj->builds->latest; + + $lbl = init_labels( + [ + 'title_test_suite_name' => null, + 'platform' => null, + 'priority' => null, + 'result_on_last_build' => null, + 'title_test_case_title' => null, + 'latest_exec_notes' => null + ]); + $group_name = $lbl['title_test_suite_name']; + + // Column order is CRITIC, because is used in the build data logic + $columns = [ + [ + 'title_key' => 'title_test_suite_name', + 'width' => 100 + ], + [ + 'title_key' => 'title_test_case_title', + 'width' => 150 + ] + ]; + + if (! is_null($guiObj->platforms) && (count($guiObj->platforms) > 0)) { + $columns[] = [ + 'title_key' => 'platform', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $guiObj->platforms + ]; + $group_name = $lbl['platform']; + } + + if ($guiObj->options->testPriorityEnabled) { + $columns[] = [ + 'title_key' => 'priority', + 'type' => 'priority', + 'width' => 40 + ]; + } + + // -------------------------------------------------------------------- + $guiObj->filterFeedback = null; + foreach ($buildIDSet as $iix) { + $buildSet[] = $guiObj->buildInfoSet[$iix]; + if ($guiObj->filterApplied) { + $guiObj->filterFeedback[] = $guiObj->buildInfoSet[$iix]['name']; + } + } + + if ($guiObj->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild']) { + $buildSet[] = [ + 'name' => $lbl['result_on_last_build'] . ' ' . $latestBuild->name + ]; + } + + foreach ($buildSet as $build) { + $columns[] = [ + 'title' => $build['name'], + 'type' => 'status', // OK because we display status + 'width' => 100 + ]; + } + + if ($guiObj->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild']) { + $columns[] = [ + 'title_key' => 'test_exec_notes_latest_created_build', + 'type' => 'notes', + 'width' => 100 + ]; + } + + // -------------------------------------------------------------------- + $columns[] = [ + 'title_key' => 'last_execution', + 'type' => 'status', // OK because we display status + 'width' => 100 + ]; + + $columns[] = [ + 'title_key' => 'latest_exec_notes', + 'type' => 'notes', + 'width' => 100 + ]; + + $fo = ! is_null($forceFormat) ? $forceFormat : $argsObj->format; + if ($fo == FORMAT_HTML) { + + // 20221231 - having a differente name for the table it's critic + // because it seems that column ID, of the column used for sorting are + // saves in a cookie that is not rested. + // This has created an issue when using the Test Results matrix + // in a Test Plan with platforms, and then request for a Test Plan + // without platforms, because the EXTJS code was trying to access + // sort info from a column named id_platform that does not exist + // obvioulsy in the data to be displayed + // That's why I've added the $group_name to the name + // I was able to fix this using the ext-all-debug-w-comments.js + // + $matrix = new tlExtTable($columns, $guiObj->matrix, + 'tlTestResultMatrix' . $group_name); + + // if platforms feature is enabled group by platform otherwise group by test suite + $matrix->setGroupByColumnName($group_name); + + $matrix->sortDirection = 'DESC'; + + if ($guiObj->options->testPriorityEnabled) { + // Developer Note: + // To understand 'filter' => 'Priority' => see exttable.class.php => buildColumns() + $matrix->addCustomBehaviour('priority', + [ + 'render' => 'priorityRenderer', + 'filter' => 'Priority' + ]); + $matrix->setSortByColumnName($lbl['priority']); + } else { + $matrix->setSortByColumnName($lbl['title_test_case_title']); + } + + // define table toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + } else { + $matrix = new tlHTMLTable($columns, $guiObj->matrix, + 'tl_table_results_tc'); + } + + return $matrix; +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param array $imgSet + * @param tlTestPlanMetrics $tplanMgr + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj, $imgSet, &$tplanMgr) +{ + $cfg = array( + 'results' => config_get('results'), + 'urgency' => config_get('urgency'), + 'tcase' => config_get('testcase_cfg') + ); + + $guiObj = new stdClass(); + $guiObj->map_status_css = null; + $guiObj->title = lang_get('title_test_report_all_builds'); + $guiObj->printDate = ''; + $guiObj->matrix = []; + + $guiObj->platforms = (array) $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + $guiObj->show_platforms = (count($guiObj->platforms) > 0); + + $guiObj->img = new stdClass(); + $guiObj->img->exec = $imgSet['exec_icon']; + $guiObj->img->edit = $imgSet['edit_icon']; + $guiObj->img->history = $imgSet['history_small']; + + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + + $guiObj->apikey = $argsObj->apikey; + + $tproject_mgr = new testproject($dbHandler); + $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); + $argsObj->prefix = $tproject_info['prefix']; + $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; + $argsObj->tprojectOpt = $tproject_info['opt']; + + $guiObj->options = new stdClass(); + $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; + unset($tproject_mgr); + + $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->tplan_name = $tplan_info['name']; + $guiObj->tproject_name = $tproject_info['name']; + + $l18n = init_labels( + array( + 'design' => null, + 'execution' => null, + 'history' => 'execution_history', + 'test_result_matrix_filters' => null, + 'too_much_data' => null, + 'too_much_builds' => null, + 'result_on_last_build' => null, + 'versionTag' => 'tcversion_indicator' + )); + + $l18n['not_run'] = lang_get($cfg['results']['status_label']['not_run']); + + $guiObj->matrixCfg = config_get('resultMatrixReport'); + $guiObj->buildInfoSet = $tplanMgr->get_builds($argsObj->tplan_id, + testplan::ACTIVE_BUILDS, null, + array( + 'orderBy' => $guiObj->matrixCfg->buildOrderByClause + )); + $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); + + // hmm need to understand if this can be removed + if ($guiObj->matrixCfg->buildColumns['latestBuildOnLeft']) { + $guiObj->buildInfoSet = array_reverse($guiObj->buildInfoSet); + } + // ------------------------------------------------------------------------------- + + foreach ($cfg['results']['code_status'] as $code => $verbose) { + if (isset($cfg['results']['status_label'][$verbose])) { + $l18n[$code] = lang_get($cfg['results']['status_label'][$verbose]); + $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . + '_text'; + } + } + + $xxx = config_get('urgency'); + foreach ($xxx['code_label'] as $code => $label) { + $cfg['priority'][$code] = lang_get($label); + } + + $guiObj->mailCfg = buildMailCfg($guiObj); + + return array( + $guiObj, + $tproject_info, + $l18n, + $cfg + ); +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + */ +function createSpreadsheet($gui, $args) +{ + $buildIDSet = $args->builds->idSet; + $latestBuild = $args->builds->latest; + + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + // Step 2 + // data is organized with following columns $dataHeader[] + // Test suite + // Test case + // [Platform] => if any exists + // + // Priority ===> Just discovered that we have choosen to make this column + // displayabled or not according test project configuration + // IMHO has no sense work without priority + // + // Exec result on Build 1 + // Assigned To + // Date + // Tester + // Notes + // Duration + // + // Exec result on Build 2 + // Assigned To + // ... + // ... + // Exec result on Build N + // + // + // Exec result ON LATEST CREATED Build + // Exec notes ON LATEST CREATED Build + // Latest Execution result (Hmm need to explain better) + // Latest Execution notes + // + $dataHeader = [ + $lbl['title_test_suite_name'], + $lbl['title_test_case_title'] + ]; + + if (! empty($gui->platforms)) { + $dataHeader[] = $lbl['platform']; + } + + if ($gui->options->testPriorityEnabled) { + $dataHeader[] = $lbl['priority']; + } + + $gui->filterFeedback = null; + foreach ($buildIDSet as $iix) { + $dataHeader[] = $lbl['build'] . ' ' . $gui->buildInfoSet[$iix]['name']; + $dataHeader[] = $lbl['assigned_to']; + $dataHeader[] = $lbl['date_time_run']; + $dataHeader[] = $lbl['test_exec_by']; + $dataHeader[] = $lbl['notes']; + $dataHeader[] = $lbl['execution_duration']; + + if ($gui->filterApplied) { + $gui->filterFeedback[] = $gui->buildInfoSet[$iix]['name']; + } + } + + // Now the magic + if ($gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild']) { + $dataHeader[] = $lbl['result_on_last_build'] . ' ' . $latestBuild->name; + } + + if ($gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild']) { + $dataHeader[] = $lbl['test_exec_notes_latest_created_build']; + } + + $dataHeader[] = $lbl['last_execution']; + $dataHeader[] = $lbl['latest_exec_notes']; + + $startingRow = count($lines2write) + 2; // MAGIC + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + $qta_loops = count($gui->matrix); + for ($idx = 0; $idx < $qta_loops; $idx ++) { + foreach ($gui->matrix[$idx] as $ldx => $field) { + $cellID = $cellRange[$ldx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + } + $startingRow ++; + } + + // Final step + $tmpfname = tempnam(config_get('temp_dir'), "resultsTC.tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + if ($args->getSpreadsheetBy == 'email') { + require_once 'email_api.php'; + + $ema = new stdClass(); + $ema->from_address = config_get('from_email'); + $ema->to_address = $args->user->emailAddress; + $ema->subject = $gui->mailCfg->subject; + $ema->message = $gui->mailCfg->subject; + + $dum = uniqid("resultsTC_") . '.xls'; + $oops = array( + 'attachment' => array( + 'file' => $tmpfname, + 'newname' => $dum + ), + 'exit_on_error' => true, + 'htmlFormat' => true + ); + $email_op = email_send_wrapper($ema, $oops); + unlink($tmpfname); + exit(); + } else { + downloadXls($tmpfname, $xlsType, $gui, 'resultsTC_'); + } +} + +/** + */ +function setUpBuilds(&$args, &$gui) +{ + $args->builds = new stdClass(); + + if (is_null($args->build_set)) { + $args->builds->idSet = null; + + $gui->buildListForExcel = ''; + $gui->filterApplied = false; + if (! is_null($gui->buildInfoSet)) { + $args->builds->idSet = array_keys($gui->buildInfoSet); + } + } else { + $args->builds->idSet = array_keys(array_flip($args->build_set)); + $gui->filterApplied = true; + $gui->buildListForExcel = implode(',', $args->builds->idSet); + } + + $args->builds->latest = new stdClass(); + $args->builds->latest->id = end($args->builds->idSet); + $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; +} + +/** + */ +function buildDataSet(&$db, &$args, &$gui, &$exec, $labels, $forceFormat = null) +{ + $userSet = getUsersForHtmlOptions($db, null, null, null, null, + array( + 'userDisplayFormat' => '%first% %last%' + )); + + // invariant pieces => avoid wasting time on loops + // $dlink = 'basehref) . + // 'linkto.php?tprojectPrefix=' . urlencode($args->prefix) . '&item=testcase&id='; + + $hist_img_tag = ' '; + $edit_img_tag = ' '; + + $metrics = $exec['metrics']; + $latestExecution = $exec['latestExec']; + + $cols = $args->cols; + + $tsuiteSet = array_keys($metrics); + foreach ($tsuiteSet as $tsuiteID) { + + $tcaseSet = array_keys($metrics[$tsuiteID]); + + foreach ($tcaseSet as $tcaseID) { + + // If there are NO PLATFORMS anyway we have the platformID=0!!! + $platformSet = array_keys($metrics[$tsuiteID][$tcaseID]); + foreach ($platformSet as $platformID) { + $rf = &$metrics[$tsuiteID][$tcaseID][$platformID]; + $rows = null; + + // some info does not change on different executions + $build2loop = array_keys($rf); + $top = current($build2loop); + $external_id = $args->tcPrefix . $rf[$top]['external_id']; + $rows[$cols['tsuite']] = $rf[$top]['suiteName']; + + $name = htmlspecialchars("{$external_id}:{$rf[$top]['name']}", + ENT_QUOTES); + + $fo = ! is_null($forceFormat) ? $forceFormat : $args->format; + if ($fo == FORMAT_HTML) { + $rows[$cols['link']] = ""; + if ($args->addOpAccess) { + $rows[$cols['link']] .= "" . + $hist_img_tag . + "" . + $edit_img_tag; + } + $rows[$cols['link']] .= $name; + } else { + $rows[$cols['link']] = "{$external_id}:{$rf[$top]['name']}"; + } + + if ($gui->show_platforms) { + $rows[$cols['platform']] = $gui->platforms[$platformID]; + } + + if ($gui->options->testPriorityEnabled) { + switch ($fo) { + case FORMAT_XLS: + $rows[$cols['priority']] = $args->cfg['priority'][$rf[$top]['priority_level']]; + break; + + default: + // is better to use code to do reorder instead of localized string ??? + $rows[$cols['priority']] = $rf[$top]['priority_level']; + break; + } + } + + // Now loop on result on each build, but following order + $buildExecStatus = null; + $execOnLatestCreatedBuild = null; + $execNoteLatestCreatedBuild = ''; + + foreach ($args->builds->idSet as $buildID) { + $r4build['text'] = ""; + + if ($fo == FORMAT_XLS) { + $r4build = $labels[$rf[$buildID]['status']] . + sprintf($labels['versionTag'], + $rf[$buildID]['version']); + + $tester = ''; + if (isset($userSet, $rf[$buildID]['tester_id'])) { + $tester = $userSet[$rf[$buildID]['tester_id']]; + } + + $assignee = ''; + if (isset($userSet, $rf[$buildID]['user_id'])) { + $assignee = $userSet[$rf[$buildID]['user_id']]; + } + + $bella = array( + $r4build, + $assignee, + $rf[$buildID]['execution_ts'], + $tester, + $rf[$buildID]['execution_notes'], + $rf[$buildID]['execution_duration'] + ); + $buildExecStatus = array_merge((array) $buildExecStatus, + $bella); + } else { + $r4build['text'] = ""; + } + + if ($fo == FORMAT_HTML) { + if ($args->addOpAccess) { + $r4build['text'] = "tplan_id}, {$platformID});\">" . + "img->exec}\" /> "; + } + + $r4build['text'] .= $labels[$rf[$buildID]['status']] . + sprintf($labels['versionTag'], + $rf[$buildID]['version']); + + $r4build['value'] = $rf[$buildID]['status']; + $r4build['cssClass'] = $gui->map_status_css[$rf[$buildID]['status']]; + $buildExecStatus[] = $r4build; + } + + if ($gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild'] && + $args->builds->latest->id == $buildID) { + $execOnLatestCreatedBuild = $r4build; + } + + if ($gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild'] && + $args->builds->latest->id == $buildID && + $rf[$buildID]['execution_notes']) { + $execNoteLatestCreatedBuild = $rf[$buildID]['execution_notes']; + } + + // why we do special reasoning on NOT RUN ??? + if (($latestExecution[$platformID][$tcaseID]['status'] == + $args->cfg['results']['status_code']['not_run']) || + (($latestExecution[$platformID][$tcaseID]['build_id'] == + $buildID) && + ($latestExecution[$platformID][$tcaseID]['id'] == + $rf[$buildID]['executions_id']))) { + $lexec = $r4build; + } + } // foreach buildIDSet + + // Ok, now the specials + // If configured, add column with Exec result on Latest Created Build + if ($gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild']) { + $buildExecStatus[] = $execOnLatestCreatedBuild; + } + + if ($gui->matrixCfg->buildColumns['latestBuildOnLeft']) { + $buildExecStatus = array_reverse($buildExecStatus); + } + + $rows = array_merge($rows, $buildExecStatus); + + if ($gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild']) { + $rows[] = $execNoteLatestCreatedBuild; + } + + // Always righmost column will display lastest execution result + $rows[] = $lexec; + + // @see lib/functions/tlTestPlanMetrics.class.php + // getExecStatusMatrix($id, $filters=null, $opt=null) + // + $dfx = $latestExecution[$platformID][$tcaseID]; + $nv = ''; + if (isset($dfx['execution_notes'])) { + $nv = is_null($dfx['execution_notes']) ? '' : $dfx['execution_notes']; + } + $rows[] = $nv; + // ---------------------------------------------------------------------- + + $gui->matrix[] = $rows; + unset($r4build); + unset($rows); + unset($buildExecStatus); + } + } + } +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + [ + 'title_test_suite_name' => null, + 'platform' => null, + 'priority' => null, + 'build' => null, + 'title_test_case_title' => null, + 'test_exec_by' => null, + 'notes' => null, + 'date_time_run' => null, + 'execution_duration' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'testplan' => null, + 'result_on_last_build' => null, + 'last_execution' => null, + 'assigned_to' => null, + 'latest_exec_notes' => null, + 'test_exec_notes_latest_created_build' => null + ]); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + return $style; +} + +/** + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + */ +function initCols($showPlat) +{ + $tcols = array( + 'tsuite', + 'link' + ); + if ($showPlat) { + $tcols[] = 'platform'; + } + $tcols[] = 'priority'; + return array_flip($tcols); } - - -/** - * Builds ext-js rich table to display matrix results - * - * - * return tlExtTable - * - */ -function buildMatrix(&$guiObj,&$argsObj,$forceFormat=null) { - $buildIDSet = $argsObj->builds->idSet; - $latestBuild = $argsObj->builds->latest; - - $lbl = init_labels(['title_test_suite_name' => null, - 'platform' => null, - 'priority' => null, - 'result_on_last_build' => null, - 'title_test_case_title' => null, - 'latest_exec_notes' => null]); - $group_name = $lbl['title_test_suite_name']; - - // Column order is CRITIC, because is used in the build data logic - $columns = [ - ['title_key' => 'title_test_suite_name', 'width' => 100], - ['title_key' => 'title_test_case_title', 'width' => 150] - ]; - - if(!is_null($guiObj->platforms) && (count($guiObj->platforms) > 0)) { - $columns[] = [ - 'title_key' => 'platform', - 'width' => 60, - 'filter' => 'list', - 'filterOptions' => $guiObj->platforms - ]; - $group_name = $lbl['platform']; - } - - if($guiObj->options->testPriorityEnabled) - { - $columns[] = [ - 'title_key' => 'priority', - 'type' => 'priority', - 'width' => 40 - ]; - } - - // -------------------------------------------------------------------- - $guiObj->filterFeedback = null; - foreach($buildIDSet as $iix) { - $buildSet[] = $guiObj->buildInfoSet[$iix]; - if($guiObj->filterApplied) { - $guiObj->filterFeedback[] = $guiObj->buildInfoSet[$iix]['name']; - } - } - - if( $guiObj->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild'] ) { - $buildSet[] = ['name' => $lbl['result_on_last_build'] . ' ' . $latestBuild->name]; - } - - foreach($buildSet as $build) - { - $columns[] = [ - 'title' => $build['name'], - 'type' => 'status', // OK because we display status - 'width' => 100 - ]; - } - - if ($guiObj->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild']) { - $columns[] = [ - 'title_key' => 'test_exec_notes_latest_created_build', - 'type' => 'notes', - 'width' => 100 - ]; - } - - // -------------------------------------------------------------------- - $columns[] = [ - 'title_key' => 'last_execution', - 'type' => 'status', // OK because we display status - 'width' => 100 - ]; - - $columns[] = [ - 'title_key' => 'latest_exec_notes', - 'type' => 'notes', - 'width' => 100 - ]; - - $fo = !is_null($forceFormat) ? $forceFormat : $argsObj->format; - if ($fo == FORMAT_HTML) - { - - // 20221231 - having a differente name for the table it's critic - // because it seems that column ID, of the column used for sorting are - // saves in a cookie that is not rested. - // This has created an issue when using the Test Results matrix - // in a Test Plan with platforms, and then request for a Test Plan - // without platforms, because the EXTJS code was trying to access - // sort info from a column named id_platform that does not exist - // obvioulsy in the data to be displayed - // That's why I've added the $group_name to the name - // I was able to fix this using the ext-all-debug-w-comments.js - // - $matrix = new tlExtTable($columns, $guiObj->matrix, 'tlTestResultMatrix' . $group_name); - - - //if platforms feature is enabled group by platform otherwise group by test suite - $matrix->setGroupByColumnName($group_name); - - $matrix->sortDirection = 'DESC'; - - if($guiObj->options->testPriorityEnabled) { - // Developer Note: - // To understand 'filter' => 'Priority' => see exttable.class.php => buildColumns() - $matrix->addCustomBehaviour('priority', ['render' => 'priorityRenderer', 'filter' => 'Priority']); - $matrix->setSortByColumnName($lbl['priority']); - } else { - $matrix->setSortByColumnName($lbl['title_test_case_title']); - } - - // define table toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - - } else { - $matrix = new tlHTMLTable($columns, $guiObj->matrix, 'tl_table_results_tc'); - } - - return $matrix; -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) -{ - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$imgSet,&$tplanMgr) -{ - - $cfg = array('results' => config_get('results'), 'urgency' => config_get('urgency'), - 'tcase' => config_get('testcase_cfg')); - - $guiObj = new stdClass(); - $guiObj->map_status_css = null; - $guiObj->title = lang_get('title_test_report_all_builds'); - $guiObj->printDate = ''; - $guiObj->matrix = []; - - $guiObj->platforms = (array)$tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - $guiObj->show_platforms = (count($guiObj->platforms) > 0); - - $guiObj->img = new stdClass(); - $guiObj->img->exec = $imgSet['exec_icon']; - $guiObj->img->edit = $imgSet['edit_icon']; - $guiObj->img->history = $imgSet['history_small']; - - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - - $guiObj->apikey = $argsObj->apikey; - - - $tproject_mgr = new testproject($dbHandler); - $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); - $argsObj->prefix = $tproject_info['prefix']; - $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; - $argsObj->tprojectOpt = $tproject_info['opt']; - - $guiObj->options = new stdClass(); - $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; - unset($tproject_mgr); - - $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->tplan_name = $tplan_info['name']; - $guiObj->tproject_name = $tproject_info['name']; - - $l18n = init_labels(array('design' => null, 'execution' => null, 'history' => 'execution_history', - 'test_result_matrix_filters' => null, 'too_much_data' => null,'too_much_builds' => null, - 'result_on_last_build' => null, 'versionTag' => 'tcversion_indicator') ); - - $l18n['not_run']=lang_get($cfg['results']['status_label']['not_run']); - - - $guiObj->matrixCfg = config_get('resultMatrixReport'); - $guiObj->buildInfoSet = $tplanMgr->get_builds($argsObj->tplan_id, testplan::ACTIVE_BUILDS,null, - array('orderBy' => $guiObj->matrixCfg->buildOrderByClause)); - $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); - - - // hmm need to understand if this can be removed - if ($guiObj->matrixCfg->buildColumns['latestBuildOnLeft']) - { - $guiObj->buildInfoSet = array_reverse($guiObj->buildInfoSet); - } - // ------------------------------------------------------------------------------- - - - foreach($cfg['results']['code_status'] as $code => $verbose) - { - if( isset($cfg['results']['status_label'][$verbose])) - { - $l18n[$code] = lang_get($cfg['results']['status_label'][$verbose]); - $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . '_text'; - } - } - - $xxx = config_get('urgency'); - foreach ($xxx['code_label'] as $code => $label) - { - $cfg['priority'][$code] = lang_get($label); - } - - $guiObj->mailCfg = buildMailCfg($guiObj); - - return array($guiObj,$tproject_info,$l18n,$cfg); -} - -/** - * - * - */ -function createSpreadsheet($gui,$args,$media) { - $buildIDSet = $args->builds->idSet; - $latestBuild = $args->builds->latest; - - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - // Step 2 - // data is organized with following columns $dataHeader[] - // Test suite - // Test case - // [Platform] => if any exists - // - // Priority ===> Just discovered that we have choosen to make this column - // displayabled or not according test project configuration - // IMHO has no sense work without priority - // - // Exec result on Build 1 - // Assigned To - // Date - // Tester - // Notes - // Duration - // - // Exec result on Build 2 - // Assigned To - // ... - // ... - // Exec result on Build N - // - // - // Exec result ON LATEST CREATED Build - // Exec notes ON LATEST CREATED Build - // Latest Execution result (Hmm need to explain better) - // Latest Execution notes - // - $dataHeader = [ - $lbl['title_test_suite_name'], - $lbl['title_test_case_title'] - ]; - - if( $showPlatforms = count($gui->platforms) > 0 ) - { - $dataHeader[] = $lbl['platform']; - } - - if($gui->options->testPriorityEnabled) - { - $dataHeader[] = $lbl['priority']; - } - - - $gui->filterFeedback = null; - foreach($buildIDSet as $iix) - { - $dataHeader[] = $lbl['build'] . ' ' . $gui->buildInfoSet[$iix]['name']; - $dataHeader[] = $lbl['assigned_to']; - $dataHeader[] = $lbl['date_time_run']; - $dataHeader[] = $lbl['test_exec_by']; - $dataHeader[] = $lbl['notes']; - $dataHeader[] = $lbl['execution_duration']; - - if($gui->filterApplied) - { - $gui->filterFeedback[] = $gui->buildInfoSet[$iix]['name']; - } - } - - - // Now the magic - if( $gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild'] ) - { - $dataHeader[] = $lbl['result_on_last_build'] . ' ' . $latestBuild->name; - } - - if( $gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild'] ) - { - $dataHeader[] = $lbl['test_exec_notes_latest_created_build']; - } - - - $dataHeader[] = $lbl['last_execution']; - $dataHeader[] = $lbl['latest_exec_notes']; - - $startingRow = count($lines2write) + 2; // MAGIC - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) - { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea)->applyFromArray($style['DataHeader']); - - $startingRow++; - $qta_loops = count($gui->matrix); - for($idx = 0; $idx < $qta_loops; $idx++) - { - foreach($gui->matrix[$idx] as $ldx => $field) - { - $cellID = $cellRange[$ldx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - } - $startingRow++; - } - - // Final step - $tmpfname = tempnam(config_get('temp_dir'),"resultsTC.tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - if($args->getSpreadsheetBy == 'email') - { - require_once('email_api.php'); - - $ema = new stdClass(); - $ema->from_address = config_get('from_email'); - $ema->to_address = $args->user->emailAddress;; - $ema->subject = $gui->mailCfg->subject; - $ema->message = $gui->mailCfg->subject; - - $dum = uniqid("resultsTC_") . '.xls'; - $oops = array('attachment' => - array('file' => $tmpfname, 'newname' => $dum), - 'exit_on_error' => true, 'htmlFormat' => true); - $email_op = email_send_wrapper($ema,$oops); - unlink($tmpfname); - exit(); - } - else - { - downloadXls($tmpfname,$xlsType,$gui,'resultsTC_'); - } -} - - -/** - * - */ -function setUpBuilds(&$args,&$gui) { - $args->builds = new stdClass(); - - if( is_null($args->build_set) ) { - $args->builds->idSet = null; - - $gui->buildListForExcel = ''; - $gui->filterApplied = false; - if( !is_null($gui->buildInfoSet) ) { - $args->builds->idSet = array_keys($gui->buildInfoSet); - } - } else { - $args->builds->idSet = array_keys(array_flip($args->build_set)); - $gui->filterApplied = true; - $gui->buildListForExcel = implode(',',$args->builds->idSet); - } - - $args->builds->latest = new stdClass(); - $args->builds->latest->id = end($args->builds->idSet); - $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; -} - - - - -/** - * - * - */ -function buildDataSet(&$db,&$args,&$gui,&$exec,$labels,$forceFormat=null) -{ - $userSet = getUsersForHtmlOptions($db,null,null,null,null, - array('userDisplayFormat' => '%first% %last%')); - - // invariant pieces => avoid wasting time on loops - $dlink = 'basehref) . - 'linkto.php?tprojectPrefix=' . urlencode($args->prefix) . '&item=testcase&id='; - - $hist_img_tag = ' '; - $edit_img_tag = ' '; - - $metrics = $exec['metrics']; - $latestExecution = $exec['latestExec']; - - $cols = $args->cols; - - $tsuiteSet = array_keys($metrics); - foreach($tsuiteSet as $tsuiteID) { - - $tcaseSet = array_keys($metrics[$tsuiteID]); - - foreach($tcaseSet as $tcaseID) { - - // If there are NO PLATFORMS anyway we have the platformID=0!!! - $platformSet = array_keys($metrics[$tsuiteID][$tcaseID]); - foreach($platformSet as $platformID) { - $rf = &$metrics[$tsuiteID][$tcaseID][$platformID]; - $rows = null; - - // some info does not change on different executions - $build2loop = array_keys($rf); - $top = current($build2loop); - $external_id = $args->tcPrefix . $rf[$top]['external_id']; - $rows[$cols['tsuite']] = $rf[$top]['suiteName']; - - - $name = htmlspecialchars("{$external_id}:{$rf[$top]['name']}",ENT_QUOTES); - - $fo = !is_null($forceFormat) ? $forceFormat : $args->format; - if($fo == FORMAT_HTML) - { - $rows[$cols['link']] = ""; - if($args->addOpAccess) - { - $rows[$cols['link']] .= "" . - $hist_img_tag . - "" . - $edit_img_tag; - } - $rows[$cols['link']] .= $name; - } - else - { - $rows[$cols['link']] = "{$external_id}:{$rf[$top]['name']}"; - } - - if ($gui->show_platforms) { - $rows[$cols['platform']] = $gui->platforms[$platformID]; - } - - if($gui->options->testPriorityEnabled) - { - switch($fo) - { - case FORMAT_XLS: - $rows[$cols['priority']] = $args->cfg['priority'][$rf[$top]['priority_level']]; - break; - - default: - // is better to use code to do reorder instead of localized string ??? - $rows[$cols['priority']] = $rf[$top]['priority_level']; - break; - } - } - - // Now loop on result on each build, but following order - $buildExecStatus = null; - $execOnLatestCreatedBuild = null; - $execNoteLatestCreatedBuild = ''; - - foreach($args->builds->idSet as $buildID) - { - $r4build['text'] = ""; - - if( $fo == FORMAT_XLS) - { - $r4build = $labels[$rf[$buildID]['status']] . - sprintf($labels['versionTag'],$rf[$buildID]['version']); - - $tester = ''; - if(isset($userSet,$rf[$buildID]['tester_id'])) - { - $tester = $userSet[$rf[$buildID]['tester_id']]; - } - - $assignee = ''; - if(isset($userSet,$rf[$buildID]['user_id'])) - { - $assignee = $userSet[$rf[$buildID]['user_id']]; - } - - $bella = array($r4build,$assignee, - $rf[$buildID]['execution_ts'],$tester, - $rf[$buildID]['execution_notes'], - $rf[$buildID]['execution_duration']); - $buildExecStatus = array_merge((array)$buildExecStatus, $bella); - } - else - { - $r4build['text'] = ""; - } - - if ($fo == FORMAT_HTML ) - { - if ($args->addOpAccess) - { - $r4build['text'] = "tplan_id}, {$platformID});\">" . - "img->exec}\" /> "; - } - - $r4build['text'] .= $labels[$rf[$buildID]['status']] . - sprintf($labels['versionTag'],$rf[$buildID]['version']); - - $r4build['value'] = $rf[$buildID]['status']; - $r4build['cssClass'] = $gui->map_status_css[$rf[$buildID]['status']]; - $buildExecStatus[] = $r4build; - } - - - if($gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild'] && - $args->builds->latest->id == $buildID) - { - $execOnLatestCreatedBuild = $r4build; - } - - if ($gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild'] && - $args->builds->latest->id == $buildID && - $rf[$buildID]['execution_notes']) - { - $execNoteLatestCreatedBuild = $rf[$buildID]['execution_notes']; - } - - // why we do special reasoning on NOT RUN ??? - if( ($latestExecution[$platformID][$tcaseID]['status'] == - $args->cfg['results']['status_code']['not_run']) || - ( ($latestExecution[$platformID][$tcaseID]['build_id'] == $buildID) && - ($latestExecution[$platformID][$tcaseID]['id'] == $rf[$buildID]['executions_id']) ) - ) - { - $lexec = $r4build; - } - } // foreach buildIDSet - - // Ok, now the specials - // If configured, add column with Exec result on Latest Created Build - if ($gui->matrixCfg->buildColumns['showExecutionResultLatestCreatedBuild']) - { - $buildExecStatus[] = $execOnLatestCreatedBuild; - } - - if ($gui->matrixCfg->buildColumns['latestBuildOnLeft']) - { - $buildExecStatus = array_reverse($buildExecStatus); - } - - $rows = array_merge($rows, $buildExecStatus); - - if ($gui->matrixCfg->buildColumns['showExecutionNoteLatestCreatedBuild']) { - $rows[] = $execNoteLatestCreatedBuild; - } - - // Always righmost column will display lastest execution result - $rows[] = $lexec; - - // @see lib/functions/tlTestPlanMetrics.class.php - // getExecStatusMatrix($id, $filters=null, $opt=null) - // - $dfx = $latestExecution[$platformID][$tcaseID]; - $nv = ''; - if( isset($dfx['execution_notes']) ) { - $nv = is_null($dfx['execution_notes']) ? '' : $dfx['execution_notes']; - } - $rows[] = $nv; - // ---------------------------------------------------------------------- - - $gui->matrix[] = $rows; - unset($r4build); - unset($rows); - unset($buildExecStatus); - } // $platformSet - } // $tcaseSet - } // $tsuiteSet -} - - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels([ - 'title_test_suite_name' => null, - 'platform' => null, - 'priority' => null, - 'build' => null, - 'title_test_case_title' => null, - 'test_exec_by' => null, - 'notes' => null, - 'date_time_run' => null, - 'execution_duration' => null, - 'testproject' => null, - 'generated_by_TestLink_on' => null, - 'testplan' => null, - 'result_on_last_build' => null, - 'last_execution' => null, - 'assigned_to' => null, - 'latest_exec_notes' => null, - 'test_exec_notes_latest_created_build' => null] - ); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = array('font' => array('bold' => true), - 'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0)->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet()->getStyle($cellArea)->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initCols($showPlat) -{ - $tcols = array('tsuite', 'link'); - if($showPlat) - { - $tcols[] = 'platform'; - } - $tcols[] = 'priority'; - $cols = array_flip($tcols); - return $cols; -} diff --git a/lib/results/resultsTCAbsoluteLatest.php b/lib/results/resultsTCAbsoluteLatest.php index 2f2914e7fa..7dcb79a4a6 100644 --- a/lib/results/resultsTCAbsoluteLatest.php +++ b/lib/results/resultsTCAbsoluteLatest.php @@ -1,703 +1,830 @@ - -* -* Absolute Latest Execution Results on Test Plan & ONE Platform -* Builds ARE IGNORED -* -*/ -require('../../config.inc.php'); - -// Must be included BEFORE common.php -require_once('../../third_party/codeplex/PHPExcel.php'); - -require_once('common.php'); -require_once('displayMgr.php'); -require_once('exttable.class.php'); - -$timerOn = microtime(true); // will be used to compute elapsed time -$templateCfg = templateConfiguration(); - -// to init $db -testlinkInitPage($db,false,false); -$smarty = new TLSmarty; -$metricsMgr = new tlTestPlanMetrics($db); -$tplan_mgr = &$metricsMgr; - - -$args = init_args($db); - -list($gui,$tproject_info,$labels,$cfg) = - initializeGui($db,$args,$smarty->getImages(),$tplan_mgr); -$args->cfg = $cfg; - - -$renderHTML = true; - -// Because we will try to send via email xls, we need to be careful -// with logic regarding args->format. -// may be we need to add in logic the media => email, download, etc -// -// We have faced a performance block due to an environment with -// 700 Builds and 1300 Test Cases on Test Plan -// This created a block on NOT RUN QUERY, -// but anyway will produce an enormous and unmanageable matrix on screen -// - -switch ($args->doAction) { - case 'result': - $tpl = $templateCfg->default_template; - doProcess($db,$args,$gui,$metricsMgr); - break; - - case 'choose': - default: - $tpl = 'resultsTCAbsoluteLatestLauncher.tpl'; - $gui->url2call = $args->basehref . - "lib/results/resultsTCAbsoluteLatest.php?tplan_id=$gui->tplan_id" . - "&tproject_id=$gui->tproject_id&doAction=result"; - break; + + * + * Absolute Latest Execution Results on Test Plan & ONE Platform + * Builds ARE IGNORED + * + */ +require_once '../../config.inc.php'; +require_once '../../third_party/codeplex/PHPExcel.php'; // Must be included BEFORE common.php +require_once 'common.php'; +require_once 'displayMgr.php'; +require_once 'exttable.class.php'; + +$timerOn = microtime(true); // will be used to compute elapsed time +$templateCfg = templateConfiguration(); + +// to init $db +testlinkInitPage($db, false, false); +$smarty = new TLSmarty(); +$metricsMgr = new tlTestPlanMetrics($db); +$tplan_mgr = &$metricsMgr; + +$args = initArgs($db); + +list ($gui, $tproject_info, $labels, $cfg) = initializeGui($db, $args, + $smarty->getImages(), $tplan_mgr); +$args->cfg = $cfg; + +$renderHTML = true; + +// Because we will try to send via email xls, we need to be careful +// with logic regarding args->format. +// may be we need to add in logic the media => email, download, etc +// +// We have faced a performance block due to an environment with +// 700 Builds and 1300 Test Cases on Test Plan +// This created a block on NOT RUN QUERY, +// but anyway will produce an enormous and unmanageable matrix on screen +// + +switch ($args->doAction) { + case 'result': + $tpl = $templateCfg->default_template; + doProcess($db, $args, $gui, $metricsMgr); + break; + + case 'choose': + default: + $tpl = 'resultsTCAbsoluteLatestLauncher.tpl'; + $gui->url2call = $args->basehref . + "lib/results/resultsTCAbsoluteLatest.php?tplan_id=$gui->tplan_id" . + "&tproject_id=$gui->tproject_id&doAction=result"; + break; +} + +$smarty->assign('gui', $gui); +displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, + $gui->mailCfg, $renderHTML); + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "platform_id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 5, + 10 + ), + "format" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->format = intval($args->format); + + $args->getSpreadsheetBy = isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; + + if (is_null($args->getSpreadsheetBy)) { + $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? 'download' : null; + } + + $args->addOpAccess = true; + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + if ($args->tproject_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + if ($args->tplan_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test PLAN ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + if ($args->doAction == 'result' && $args->platform_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid PLATFORM ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + $args->user = $_SESSION['currentUser']; + $args->basehref = $_SESSION['basehref']; + + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); +} + +/** + * Builds ext-js rich table to display matrix results + * + * @param stdClass $guiObj + * @param stdClass $argsObj + * @param int $forceFormat + * @return tlExtTable|tlHTMLTable + */ +function buildMatrix(&$guiObj, &$argsObj, $forceFormat = null) +{ + $columns = array( + array( + 'title_key' => 'title_test_suite_name', + 'width' => 100 + ), + array( + 'title_key' => 'title_test_case_title', + 'width' => 150 + ) + ); + + $lbl = init_labels( + array( + 'title_test_suite_name' => null, + 'platform' => null, + 'priority' => null, + 'result_on_last_build' => null, + 'title_test_case_title' => null, + 'latest_exec_notes' => null + )); + + $group_name = $lbl['title_test_suite_name']; + + if (! is_null($guiObj->platforms)) { + $columns[] = array( + 'title_key' => 'platform', + 'width' => 60, + 'filter' => 'list', + 'filterOptions' => $guiObj->platforms + ); + $group_name = $lbl['platform']; + } + + if ($guiObj->options->testPriorityEnabled) { + $columns[] = array( + 'title_key' => 'priority', + 'type' => 'priority', + 'width' => 40 + ); + } + + // -------------------------------------------------------------------- + $columns[] = array( + 'title_key' => 'latest_execution', + 'type' => 'status', + 'width' => 100 + ); + + $columns[] = array( + 'title_key' => 'latest_exec_notes', + 'type' => 'status', + 'width' => 100 + ); + + $fo = ! is_null($forceFormat) ? $forceFormat : $argsObj->format; + if ($fo == FORMAT_HTML) { + $matrix = new tlExtTable($columns, $guiObj->matrix, + 'tl_table_results_tc'); + + // if platforms feature is enabled group by platform + // otherwise group by test suite + $matrix->setGroupByColumnName($group_name); + $matrix->sortDirection = 'DESC'; + + if ($guiObj->options->testPriorityEnabled) { + // Developer Note: + // To understand 'filter' => 'Priority' => + // see exttable.class.php => buildColumns() + $matrix->addCustomBehaviour('priority', + array( + 'render' => 'priorityRenderer', + 'filter' => 'Priority' + )); + $matrix->setSortByColumnName($lbl['priority']); + } else { + $matrix->setSortByColumnName($lbl['title_test_case_title']); + } + + // define table toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + } else { + $matrix = new tlHTMLTable($columns, $guiObj->matrix, + 'tl_table_results_tc'); + } + unset($columns); + + return $matrix; +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param array $imgSet + * @param tlTestPlanMetrics $tplanMgr + * @return array + */ +function initializeGui(&$dbHandler, &$argsObj, $imgSet, &$tplanMgr) +{ + $cfg = array( + 'results' => config_get('results'), + 'urgency' => config_get('urgency'), + 'tcase' => config_get('testcase_cfg') + ); + + $guiObj = new stdClass(); + $guiObj->map_status_css = null; + $guiObj->title = lang_get('resultsTCAbsoluteLatest_title'); + $guiObj->pageTitle = $guiObj->title; + + $guiObj->printDate = ''; + $guiObj->matrix = array(); + $guiObj->platform_id = $argsObj->platform_id; + + $guiObj->platforms = $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + $guiObj->show_platforms = ! is_null($guiObj->platforms); + + $guiObj->img = new stdClass(); + $guiObj->img->exec = $imgSet['exec_icon']; + $guiObj->img->edit = $imgSet['edit_icon']; + $guiObj->img->history = $imgSet['history_small']; + + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + + $guiObj->apikey = $argsObj->apikey; + + $tproject_mgr = new testproject($dbHandler); + $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); + $argsObj->prefix = $tproject_info['prefix']; + $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; + $argsObj->tprojectOpt = $tproject_info['opt']; + + $guiObj->options = new stdClass(); + $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; + unset($tproject_mgr); + + $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->tplan_name = $tplan_info['name']; + $guiObj->tproject_name = $tproject_info['name']; + + $L10N = init_labels( + array( + 'design' => null, + 'execution' => null, + 'latest_execution' => null, + 'history' => 'execution_history', + 'test_result_matrix_filters' => null, + 'too_much_data' => null, + 'too_much_builds' => null, + 'result_on_last_build' => null, + 'versionTag' => 'tcversion_indicator' + )); + + $L10N['not_run'] = lang_get($cfg['results']['status_label']['not_run']); + + $guiObj->report_details = lang_get(basename(__FILE__, '.php')); + + $guiObj->matrixCfg = config_get('resultMatrixReport'); + $guiObj->buildInfoSet = $tplanMgr->get_builds($argsObj->tplan_id, + testplan::ACTIVE_BUILDS, null, + array( + 'orderBy' => $guiObj->matrixCfg->buildOrderByClause + )); + $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); + + foreach ($cfg['results']['code_status'] as $code => $verbose) { + if (isset($cfg['results']['status_label'][$verbose])) { + $L10N[$code] = lang_get($cfg['results']['status_label'][$verbose]); + $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . + '_text'; + } + } + + $xxx = config_get('urgency'); + foreach ($xxx['code_label'] as $code => $label) { + $cfg['priority'][$code] = lang_get($label); + } + + $guiObj->mailCfg = buildMailCfg($guiObj); + + $guiObj->labels = $L10N; + return array( + $guiObj, + $tproject_info, + $L10N, + $cfg + ); +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + */ +function createSpreadsheet($gui, $args) +{ + $lbl = initLblSpreadsheet(); + $cellRange = setCellRangeSpreadsheet(); + $style = initStyleSpreadsheet(); + + $objPHPExcel = new PHPExcel(); + $lines2write = xlsStepOne($objPHPExcel, $style, $lbl, $gui); + + // Step 2 + // data is organized with following columns $dataHeader[] + // Test suite + // Test case + // [Platform] => if any exists + // + // Priority ===> Just discovered that we have choosen to make this column + // displayabled or not according test project configuration + // IMHO has no sense work without priority + // + // Latest Execution result (Hmm need to explain better) + // Latest Execution notes + // + $dataHeader = array( + $lbl['title_test_suite_name'], + $lbl['title_test_case_title'] + ); + + if (! is_null($gui->platforms)) { + $dataHeader[] = $lbl['platform']; + } + + if ($gui->options->testPriorityEnabled) { + $dataHeader[] = $lbl['priority']; + } + + $dataHeader[] = $lbl['latest_execution']; + $dataHeader[] = $lbl['latest_exec_notes']; + + $startingRow = count($lines2write) + 2; // MAGIC + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['DataHeader']); + + $startingRow ++; + $qta_loops = count($gui->matrix); + for ($idx = 0; $idx < $qta_loops; $idx ++) { + foreach ($gui->matrix[$idx] as $ldx => $field) { + $cellID = $cellRange[$ldx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + } + $startingRow ++; + } + + // Final step + $fname = basename(__FILE__, '.php') . '_'; + $tmpfname = tempnam(config_get('temp_dir'), $fname . ".tmp"); + $objPHPExcel->setActiveSheetIndex(0); + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + $objWriter->save($tmpfname); + + if ($args->getSpreadsheetBy == 'email') { + require_once 'email_api.php'; + + $ema = new stdClass(); + $ema->from_address = config_get('from_email'); + $ema->to_address = $args->user->emailAddress; + $ema->subject = $gui->mailCfg->subject; + $ema->message = $gui->mailCfg->subject; + + $dum = uniqid($fname) . '.xls'; + $oops = array( + 'attachment' => array( + 'file' => $tmpfname, + 'newname' => $dum + ), + 'exit_on_error' => true, + 'htmlFormat' => true + ); + $email_op = email_send_wrapper($ema, $oops); + unlink($tmpfname); + exit(); + } else { + downloadXls($tmpfname, $xlsType, $gui, $fname); + } +} + +/** + * + * @param stdClass $args + * @param stdClass $gui + */ +function setUpBuilds(&$args, &$gui) +{ + $args->builds = new stdClass(); + + if (is_null($args->build_set)) { + $args->builds->idSet = null; + + $gui->buildListForExcel = ''; + $gui->filterApplied = false; + if (! is_null($gui->buildInfoSet)) { + $args->builds->idSet = array_keys($gui->buildInfoSet); + } + } else { + $args->builds->idSet = array_keys(array_flip($args->build_set)); + $gui->filterApplied = true; + $gui->buildListForExcel = implode(',', $args->builds->idSet); + } + + $args->builds->latest = new stdClass(); + $args->builds->latest->id = end($args->builds->idSet); + $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; +} + +/** + * + * @param database $db + * @param stdClass $args + * @param stdClass $gui + * @param array $metrics + * @param array $labels + * @param int $forceFormat + */ +function buildDataSet(&$db, &$args, &$gui, &$metrics, $labels, + $forceFormat = null) +{ + $hist_img_tag = ' '; + $edit_img_tag .= '" /> '; + + $cols = $args->cols; + $priorityCfg = config_get('urgencyImportance'); + $execVerboseCode = config_get('results'); + $execVerboseCode = $execVerboseCode['status_code']; + + $itemSet = array_keys($metrics); + $tsuiteCache = array(); + $treeMgr = new tree($db); + + foreach ($itemSet as $iidx) { + $tcaseSet = array_keys($metrics[$iidx]); + foreach ($tcaseSet as $tcaseID) { + $platformSet = array_keys($metrics[$iidx][$tcaseID]); + foreach ($platformSet as $platformID) { + $rf = &$metrics[$iidx][$tcaseID][$platformID][0]; + + $tsuiteID = $rf['tsuite_id']; + if (! isset($tsuiteCache[$tsuiteID])) { + // Get full path + $tsuiteCache[$tsuiteID] = implode("/", + $treeMgr->get_path($tsuiteID, null, 'name')); + } + + $rows = null; + $external_id = $args->tcPrefix . $rf['external_id']; + $rows[$cols['tsuite']] = $tsuiteCache[$tsuiteID]; + + $name = htmlspecialchars("{$external_id}:{$rf['name']}", + ENT_QUOTES); + + $fo = ! is_null($forceFormat) ? $forceFormat : $args->format; + if ($fo == FORMAT_HTML) { + $rows[$cols['link']] = ""; + + if ($args->addOpAccess) { + $rows[$cols['link']] .= "" . + $hist_img_tag . + "" . + $edit_img_tag; + } + $rows[$cols['link']] .= $name; + } else { + $rows[$cols['link']] = "{$external_id}:{$rf['name']}"; + } + + $rows[$cols['platform']] = $gui->platforms[$platformID]; + + if ($gui->options->testPriorityEnabled) { + if ($rf['urg_imp'] >= $priorityCfg->threshold['high']) { + $rf['priority_level'] = HIGH; + } elseif ($rf['urg_imp'] < $priorityCfg->threshold['low']) { + $rf['priority_level'] = LOW; + } else { + $rf['priority_level'] = MEDIUM; + } + + switch ($fo) { + case FORMAT_XLS: + // We need the human readable value, not the code + $rows[$cols['priority']] = $args->cfg['priority'][$rf['priority_level']]; + break; + + default: + // Raw Code the human readable value will be + // constructed while rendering. + $rows[$cols['priority']] = $rf['priority_level']; + break; + } + } + + $statusVerbose = $labels[$rf['status']] . + sprintf($labels['versionTag'], $rf['version']); + + if ($fo == FORMAT_HTML) { + $execOut = array( + 'text' => '', + 'value' => '', + 'cssClass' => '' + ); + $execOut['text'] = $statusVerbose; + $execOut['value'] = $rf['status']; + $execOut['cssClass'] = $gui->map_status_css[$rf['status']]; + $rows[] = $execOut; + } else { + $rows[] = $statusVerbose; + } + $nv = ''; + if (isset($rf['execution_notes'])) { + $nv = is_null($rf['execution_notes']) ? '' : $rf['execution_notes']; + } + if ($fo == FORMAT_XLS) { + $rows[] = $nv; + } + if ($fo == FORMAT_HTML) { + $rows[] = [ + 'text' => $nv + ]; + } + $gui->matrix[] = $rows; + } // $platformSet + } // $tcaseSet + } // $tsuiteSet +} + +/** + * + * @return array + */ +function initLblSpreadsheet() +{ + return init_labels( + array( + 'title_test_suite_name' => null, + 'platform' => null, + 'priority' => null, + 'title_test_case_title' => null, + 'test_exec_by' => null, + 'notes' => null, + 'date_time_run' => null, + 'execution_duration' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'testplan' => null, + 'result_on_last_build' => null, + 'latest_execution' => null, + 'assigned_to' => null, + 'latest_exec_notes' => null, + 'important_notice' => null + )); +} + +/** + * + * @return array + */ +function initStyleSpreadsheet() +{ + $style = array(); + $style['ReportContext'] = array( + 'font' => array( + 'bold' => true + ) + ); + $style['DataHeader'] = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + return $style; +} + +/** + * + * @return string|array + */ +function setCellRangeSpreadsheet() +{ + $cr = range('A', 'Z'); + $crLen = count($cr); + for ($idx = 0; $idx < $crLen; $idx ++) { + for ($jdx = 0; $jdx < $crLen; $jdx ++) { + $cr[] = $cr[$idx] . $cr[$jdx]; + } + } + return $cr; +} + +/** + * + * @param PHPExcel $oj + * @param array $style + * @param array $lbl + * @param stdClass $gui + * @return array + */ +function xlsStepOne(&$oj, $style, &$lbl, &$gui) +{ + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['important_notice'], + $gui->report_details + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $oj->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + $cellArea .= "A{$cdx}"; + $oj->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($style['ReportContext']); + + return $lines2write; +} + +/** + * + * @return array + */ +function initCols() +{ + $tcols = array( + 'tsuite', + 'link', + 'platform', + 'priority', + 'latest_exec', + 'latest_exec_notes' + ); + return array_flip($tcols); +} + +/** + * + * @param database $dbH + * @param stdClass $args + * @param stdClass $gui + * @param tlTestPlanMetrics $metricsMgr + */ +function doProcess(&$dbH, &$args, &$gui, &$metricsMgr) +{ + $opt = array( + 'output' => 'array' + ); + $neverRunOnPP = (array) $metricsMgr->getNeverRunOnSinglePlatform( + $args->tplan_id, $args->platform_id); + + $execStatus = (array) $metricsMgr->getLatestExecOnSinglePlatformMatrix( + $args->tplan_id, $args->platform_id, $opt); + + $allExec = array(); + foreach ($neverRunOnPP as $elem) { + $allExec[] = $elem; + } + foreach ($execStatus as $elem) { + $allExec[] = $elem; + } + + // Every Test suite a row on matrix to display will be created + $args->cols = initCols(); + if (! is_null($neverRunOnPP) || ! is_null($execStatus)) { + buildDataSet($dbH, $args, $gui, $allExec, $gui->labels); + } + + switch ($args->format) { + case FORMAT_XLS: + createSpreadsheet($gui, $args); + break; + + default: + $gui->tableSet[] = buildMatrix($gui, $args); + break; + } } - -$smarty->assign('gui',$gui); -displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, - $gui->mailCfg,$renderHTML); - - -/** - * - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "platform_id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,5,10), - "format" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->format = intval($args->format); - - $args->getSpreadsheetBy = isset($_REQUEST['sendSpreadSheetByMail_x']) ? 'email' : null; - - if( is_null($args->getSpreadsheetBy) ) { - $args->getSpreadsheetBy = isset($_REQUEST['exportSpreadSheet_x']) ? 'download' : null; - } - - - $args->addOpAccess = true; - if( !is_null($args->apikey) ) { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if( strlen($args->apikey) == 32) { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } else { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - if ($args->tproject_id <= 0) { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - if ($args->tplan_id <= 0) { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test PLAN ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - if ($args->doAction == 'result') { - if ($args->platform_id <= 0) { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid PLATFORM ID ({$args->tproject_id})"; - throw new Exception($msg); - } - } - - $args->user = $_SESSION['currentUser']; - $args->basehref = $_SESSION['basehref']; - - return $args; -} - -/** - * - * - */ -function checkRights(&$db,&$user,$context = null) -{ - if (is_null($context)) { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} - - -/** - * Builds ext-js rich table to display matrix results - * - * - * return tlExtTable - * - */ -function buildMatrix(&$guiObj,&$argsObj,$forceFormat=null) { - - $columns = array(array('title_key' => 'title_test_suite_name', - 'width' => 100), - array('title_key' => 'title_test_case_title', - 'width' => 150)); - - $lbl = init_labels(array('title_test_suite_name' => null, - 'platform' => null, - 'priority' => null, - 'result_on_last_build' => null, - 'title_test_case_title' => null, - 'latest_exec_notes' => null)); - - $group_name = $lbl['title_test_suite_name']; - - if (!is_null($guiObj->platforms)) { - $columns[] = array('title_key' => 'platform', - 'width' => 60, 'filter' => 'list', - 'filterOptions' => $guiObj->platforms); - $group_name = $lbl['platform']; - } - - if ($guiObj->options->testPriorityEnabled) { - $columns[] = array('title_key' => 'priority', - 'type' => 'priority', 'width' => 40); - } - - // -------------------------------------------------------------------- - $columns[] = array('title_key' => 'latest_execution', - 'type' => 'status', 'width' => 100); - - $columns[] = array('title_key' => 'latest_exec_notes', - 'type' => 'status', 'width' => 100); - - $fo = !is_null($forceFormat) ? $forceFormat : $argsObj->format; - if ($fo == FORMAT_HTML) { - $matrix = new tlExtTable($columns, $guiObj->matrix, 'tl_table_results_tc'); - - // if platforms feature is enabled group by platform - // otherwise group by test suite - $matrix->setGroupByColumnName($group_name); - $matrix->sortDirection = 'DESC'; - - if ($guiObj->options->testPriorityEnabled) { - // Developer Note: - // To understand 'filter' => 'Priority' => - // see exttable.class.php => buildColumns() - $matrix->addCustomBehaviour('priority', array('render' => 'priorityRenderer', 'filter' => 'Priority')); - $matrix->setSortByColumnName($lbl['priority']); - } else { - $matrix->setSortByColumnName($lbl['title_test_case_title']); - } - - // define table toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - } else { - $matrix = new tlHTMLTable($columns, $guiObj->matrix, 'tl_table_results_tc'); - } - unset($columns); - - return $matrix; -} - - -/** - * - * - */ -function buildMailCfg(&$guiObj) -{ - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$imgSet,&$tplanMgr) -{ - - $cfg = array('results' => config_get('results'), - 'urgency' => config_get('urgency'), - 'tcase' => config_get('testcase_cfg')); - - $guiObj = new stdClass(); - $guiObj->map_status_css = null; - $guiObj->title = lang_get('resultsTCAbsoluteLatest_title'); - $guiObj->pageTitle = $guiObj->title; - - $guiObj->printDate = ''; - $guiObj->matrix = array(); - $guiObj->platform_id = $argsObj->platform_id; - - $guiObj->platforms = - $tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - $guiObj->show_platforms = !is_null($guiObj->platforms); - - $guiObj->img = new stdClass(); - $guiObj->img->exec = $imgSet['exec_icon']; - $guiObj->img->edit = $imgSet['edit_icon']; - $guiObj->img->history = $imgSet['history_small']; - - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - - $guiObj->apikey = $argsObj->apikey; - - - $tproject_mgr = new testproject($dbHandler); - $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); - $argsObj->prefix = $tproject_info['prefix']; - $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; - $argsObj->tprojectOpt = $tproject_info['opt']; - - $guiObj->options = new stdClass(); - $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; - unset($tproject_mgr); - - $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->tplan_name = $tplan_info['name']; - $guiObj->tproject_name = $tproject_info['name']; - - $L10N = init_labels(array('design' => null, - 'execution' => null, - 'latest_execution' => null, - 'history' => 'execution_history', - 'test_result_matrix_filters' => null, - 'too_much_data' => null, - 'too_much_builds' => null, - 'result_on_last_build' => null, - 'versionTag' => 'tcversion_indicator') ); - - $L10N['not_run'] = lang_get($cfg['results']['status_label']['not_run']); - - $guiObj->report_details = lang_get(basename(__FILE__, '.php')); - - $guiObj->matrixCfg = config_get('resultMatrixReport'); - $guiObj->buildInfoSet = - $tplanMgr->get_builds($argsObj->tplan_id, testplan::ACTIVE_BUILDS,null, - array('orderBy' => $guiObj->matrixCfg->buildOrderByClause)); - $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); - - - foreach($cfg['results']['code_status'] as $code => $verbose) { - if( isset($cfg['results']['status_label'][$verbose])) { - $L10N[$code] = lang_get($cfg['results']['status_label'][$verbose]); - $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . '_text'; - } - } - - $xxx = config_get('urgency'); - foreach ($xxx['code_label'] as $code => $label) { - $cfg['priority'][$code] = lang_get($label); - } - - $guiObj->mailCfg = buildMailCfg($guiObj); - - $guiObj->labels = $L10N; - return array($guiObj,$tproject_info,$L10N,$cfg); -} - -/** - * - * - */ -function createSpreadsheet($gui,$args,$media) { - $lbl = initLblSpreadsheet(); - $cellRange = setCellRangeSpreadsheet(); - $style = initStyleSpreadsheet(); - - $objPHPExcel = new PHPExcel(); - $lines2write = xlsStepOne($objPHPExcel,$style,$lbl,$gui); - - // Step 2 - // data is organized with following columns $dataHeader[] - // Test suite - // Test case - // [Platform] => if any exists - // - // Priority ===> Just discovered that we have choosen to make this column - // displayabled or not according test project configuration - // IMHO has no sense work without priority - // - // Latest Execution result (Hmm need to explain better) - // Latest Execution notes - // - $dataHeader = array($lbl['title_test_suite_name'], - $lbl['title_test_case_title']); - - if( $showPlatforms = !is_null($gui->platforms) ) { - $dataHeader[] = $lbl['platform']; - } - - if ($gui->options->testPriorityEnabled) { - $dataHeader[] = $lbl['priority']; - } - - - $dataHeader[] = $lbl['latest_execution']; - $dataHeader[] = $lbl['latest_exec_notes']; - - $startingRow = count($lines2write) + 2; // MAGIC - $cellArea = "A{$startingRow}:"; - foreach ($dataHeader as $zdx => $field) { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea)->applyFromArray($style['DataHeader']); - - $startingRow++; - $qta_loops = count($gui->matrix); - for($idx = 0; $idx < $qta_loops; $idx++) { - foreach($gui->matrix[$idx] as $ldx => $field) { - $cellID = $cellRange[$ldx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - } - $startingRow++; - } - - // Final step - $fname = basename(__FILE__, '.php') . '_'; - $tmpfname = tempnam(config_get('temp_dir'), $fname . ".tmp"); - $objPHPExcel->setActiveSheetIndex(0); - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - $objWriter->save($tmpfname); - - if ($args->getSpreadsheetBy == 'email') { - require_once('email_api.php'); - - $ema = new stdClass(); - $ema->from_address = config_get('from_email'); - $ema->to_address = $args->user->emailAddress;; - $ema->subject = $gui->mailCfg->subject; - $ema->message = $gui->mailCfg->subject; - - $dum = uniqid($fname) . '.xls'; - $oops = array('attachment' => - array('file' => $tmpfname, 'newname' => $dum), - 'exit_on_error' => true, 'htmlFormat' => true); - $email_op = email_send_wrapper($ema,$oops); - unlink($tmpfname); - exit(); - } else { - downloadXls($tmpfname,$xlsType,$gui,$fname); - } -} - - -/** - * - */ -function setUpBuilds(&$args,&$gui) { - $args->builds = new stdClass(); - - if( is_null($args->build_set) ) { - $args->builds->idSet = null; - - $gui->buildListForExcel = ''; - $gui->filterApplied = false; - if( !is_null($gui->buildInfoSet) ) { - $args->builds->idSet = array_keys($gui->buildInfoSet); - } - } else { - $args->builds->idSet = array_keys(array_flip($args->build_set)); - $gui->filterApplied = true; - $gui->buildListForExcel = implode(',',$args->builds->idSet); - } - - $args->builds->latest = new stdClass(); - $args->builds->latest->id = end($args->builds->idSet); - $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; -} - - - - -/** - * - * - */ -function buildDataSet(&$db,&$args,&$gui,&$metrics,$labels,$forceFormat=null) -{ - $userSet = getUsersForHtmlOptions($db,null,null,null,null, - array('userDisplayFormat' => '%first% %last%')); - - // invariant pieces => avoid wasting time on loops - $dlink = 'basehref) . - 'linkto.php?tprojectPrefix=' . urlencode($args->prefix) . '&item=testcase&id='; - - $hist_img_tag = ' '; - $edit_img_tag .= '" /> '; - - - $cols = $args->cols; - $priorityCfg = config_get('urgencyImportance'); - $execVerboseCode = config_get('results'); - $execVerboseCode = $execVerboseCode['status_code']; - $execCodeVerbose = array_flip($execVerboseCode); - - $itemSet = array_keys($metrics); - $tsuiteCache = array(); - $treeMgr = new tree($db); - - foreach($itemSet as $iidx) { - $tcaseSet = array_keys($metrics[$iidx]); - foreach($tcaseSet as $tcaseID) { - $platformSet = array_keys($metrics[$iidx][$tcaseID]); - foreach($platformSet as $platformID) { - $rf = &$metrics[$iidx][$tcaseID][$platformID][0]; - - $tsuiteID = $rf['tsuite_id']; - if (!isset($tsuiteCache[$tsuiteID])) { - // Get full path - $tsuiteCache[$tsuiteID] = - implode("/",$treeMgr->get_path($tsuiteID,null,'name')); - } - - $rows = null; - $external_id = $args->tcPrefix . $rf['external_id']; - $rows[$cols['tsuite']] = $tsuiteCache[$tsuiteID]; - - $name = htmlspecialchars("{$external_id}:{$rf['name']}",ENT_QUOTES); - - $fo = !is_null($forceFormat) ? $forceFormat : $args->format; - if ($fo == FORMAT_HTML) { - $rows[$cols['link']] = ""; - - if($args->addOpAccess) { - $rows[$cols['link']] .= - "" . - $hist_img_tag . - "" . - $edit_img_tag; - } - $rows[$cols['link']] .= $name; - } else { - $rows[$cols['link']] = "{$external_id}:{$rf['name']}"; - } - - $rows[$cols['platform']] = $gui->platforms[$platformID]; - - if ($gui->options->testPriorityEnabled) { - if ($rf['urg_imp'] >= $priorityCfg->threshold['high']) { - $rf['priority_level'] = HIGH; - } else if( $rf['urg_imp'] < $priorityCfg->threshold['low']) { - $rf['priority_level'] = LOW; - } else { - $rf['priority_level'] = MEDIUM; - } - - switch($fo) { - case FORMAT_XLS: - // We need the human readable value, not the code - $rows[$cols['priority']] = - $args->cfg['priority'][$rf['priority_level']]; - break; - - default: - // Raw Code the human readable value will be - // constructed while rendering. - $rows[$cols['priority']] = $rf['priority_level']; - break; - } - } - - $statusVerbose = $labels[$rf['status']] . - sprintf($labels['versionTag'],$rf['version']); - - if ($fo == FORMAT_HTML) { - $execOut = array('text' => '', 'value' => '', 'cssClass' => ''); - $execOut['text'] = $statusVerbose; - $execOut['value'] = $rf['status']; - $execOut['cssClass'] = $gui->map_status_css[$rf['status']]; - $rows[] = $execOut; - } - else { - $rows[] = $statusVerbose; - } - $nv = ''; - if (isset($rf['execution_notes'])) { - $nv = is_null($rf['execution_notes']) ? '' : - $rf['execution_notes']; - } - if( $fo == FORMAT_XLS) { - $rows[] = $nv; - } - if( $fo == FORMAT_HTML) { - $rows[] = ['text' => $nv]; - } - $gui->matrix[] = $rows; - } // $platformSet - } // $tcaseSet - } // $tsuiteSet -} - - -/** - * - */ -function initLblSpreadsheet() { - $lbl = init_labels(array('title_test_suite_name' => null, - 'platform' => null, - 'priority' => null, - 'title_test_case_title' => null, - 'test_exec_by' => null, - 'notes' => null, - 'date_time_run' => null, - 'execution_duration' => null, - 'testproject' => null, - 'generated_by_TestLink_on' => null, - 'testplan' => null, - 'result_on_last_build' => null, - 'latest_execution' => null, - 'assigned_to' => null, - 'latest_exec_notes' => null, - 'important_notice' => null)); - return $lbl; -} - -/** - * - */ -function initStyleSpreadsheet() { - $style = array(); - $style['ReportContext'] = array('font' => array('bold' => true)); - $style['DataHeader'] = array('font' => array('bold' => true), - 'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - return $style; -} - -/** - * - */ -function setCellRangeSpreadsheet() { - $cr = range('A','Z'); - $crLen = count($cr); - for($idx = 0; $idx < $crLen; $idx++) { - for($jdx = 0; $jdx < $crLen; $jdx++) { - $cr[] = $cr[$idx] . $cr[$jdx]; - } - } - return $cr; -} - -/** - * - */ -function xlsStepOne(&$oj,$style,&$lbl,&$gui) { - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['important_notice'],$gui->report_details), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) { - $cdx = $zdx+1; - $oj->setActiveSheetIndex(0)->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - $cellArea .= "A{$cdx}"; - $oj->getActiveSheet()->getStyle($cellArea)->applyFromArray($style['ReportContext']); - - return $lines2write; -} - -/** - * - */ -function initCols() -{ - $tcols = array('tsuite','link','platform','priority', - 'latest_exec','latest_exec_notes'); - $cols = array_flip($tcols); - return $cols; -} - -/** - * - */ -function doProcess(&$dbH,&$args,&$gui,&$metricsMgr) -{ - $opt = array('getExecutionNotes' => true); - - $opt = array('output' => 'array'); - $neverRunOnPP = (array)$metricsMgr->getNeverRunOnSinglePlatform($args->tplan_id,$args->platform_id); - - $execStatus = (array)$metricsMgr->getLatestExecOnSinglePlatformMatrix($args->tplan_id,$args->platform_id,$opt); - - $allExec = array(); - foreach ($neverRunOnPP as $elem) { - $allExec[] = $elem; - } - foreach ($execStatus as $elem) { - $allExec[] = $elem; - } - - // Every Test suite a row on matrix to display will be created - $args->cols = initCols(); - if( !is_null($neverRunOnPP) || !is_null($execStatus)) { - buildDataSet($dbH,$args,$gui,$allExec,$gui->labels); - } - - $renderHTML = false; - - switch($args->format) { - case FORMAT_XLS: - createSpreadsheet($gui,$args,$args->getSpreadsheetBy); - break; - - default: - $renderHTML = true; - $gui->tableSet[] = buildMatrix($gui, $args); - break; - } -} - diff --git a/lib/results/resultsTCFlat.php b/lib/results/resultsTCFlat.php index b0fc97868f..a5c318a7d3 100644 --- a/lib/results/resultsTCFlat.php +++ b/lib/results/resultsTCFlat.php @@ -1,555 +1,629 @@ - -* -* Test Results on simple spreadsheet format -* -* -* @internal revisions -* @since 1.9.15 -*/ -require('../../config.inc.php'); -require_once('../../third_party/codeplex/PHPExcel.php'); // Must be included BEFORE common.php -require_once('common.php'); -require_once('displayMgr.php'); - -$timerOn = microtime(true); // will be used to compute elapsed time -$templateCfg = templateConfiguration(); - -$smarty = new TLSmarty; -$args = init_args($db); - -$metricsMgr = new tlTestPlanMetrics($db); -$tplan_mgr = &$metricsMgr; // displayMemUsage('START' . __FILE__); - -list($gui,$labels,$cfg) = initializeGui($db,$args,$smarty->getImages(),$tplan_mgr); -$args->cfg = $cfg; -$mailCfg = buildMailCfg($gui); - - -// We have faced a performance block due to an environment with -// 700 Builds and 1300 Test Cases on Test Plan -// This created a block on NOT RUN QUERY, but anyway will produce an enormous and -// unmanageable matrix on screen -// -// New way to process: -// ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use -// Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry -// -if( ($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit) || - $args->do_action == 'result') -{ - setUpBuilds($args,$gui); - - $tpl = $templateCfg->default_template; - $opt = null; - $buildSet = array('buildSet' => $args->builds->idSet); - - $opt = array('getExecutionNotes' => true, 'getTester' => true, - 'getUserAssignment' => true, 'output' => 'cumulative', - 'getExecutionTimestamp' => true, 'getExecutionDuration' => true); - - $execStatus = $metricsMgr->getExecStatusMatrixFlat($args->tplan_id,$buildSet,$opt); - - - $metrics = $execStatus['metrics']; - $latestExecution = $execStatus['latestExec']; - - // Every Test suite a row on matrix to display will be created - // One matrix will be created for every platform that has testcases - $tcols = array('tsuite', 'tcase','version'); - if($gui->show_platforms) - { - $tcols[] = 'platform'; - } - $tcols[] = 'priority'; - $cols = array_flip($tcols); - $args->cols = $cols; - - if( !is_null($execStatus['metrics']) ) - { - buildSpreadsheetData($db,$args,$gui,$execStatus,$labels); - } - createSpreadsheet($gui,$args); - $args->format = FORMAT_XLS; -} else { - // We need to ask user to do a choice - $tpl = 'resultsTCFlatLauncher.tpl'; - $gui->pageTitle = $labels['test_result_flat_filters']; - if($gui->matrixCfg->buildQtyLimit > 0) - { - $gui->userFeedback = $labels['too_much_data'] . '
    ' . - sprintf($labels['too_much_builds'],$gui->activeBuildsQty,$gui->matrixCfg->buildQtyLimit); - } - $args->format = FORMAT_HTML; -} - - -$timerOff = microtime(true); -$gui->elapsed_time = round($timerOff - $timerOn,2); - -$smarty->assign('gui',$gui); -displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, $mailCfg); - -/** - * - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "do_action" => array(tlInputParameter::STRING_N,5,10), - "build_set" => array(tlInputParameter::ARRAY_INT), - "buildListForExcel" => array(tlInputParameter::STRING_N,0,100), - "format" => array(tlInputParameter::INT_N)); - - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->addOpAccess = true; - if( !is_null($args->apikey) ) - { - //var_dump($args); - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - if($args->tproject_id <= 0) - { - $msg = __FILE__ . '::' . __FUNCTION__ . " :: Invalid Test Project ID ({$args->tproject_id})"; - throw new Exception($msg); - } - - switch($args->format) - { - case FORMAT_XLS: - if($args->buildListForExcel != '') - { - $args->build_set = explode(',',$args->buildListForExcel); - } - break; - } - - - $args->user = $_SESSION['currentUser']; - $args->basehref = $_SESSION['basehref']; - - return $args; + + * + * Test Results on simple spreadsheet format + * + * + * @internal revisions + * @since 1.9.15 + */ +require_once '../../config.inc.php'; +require_once '../../third_party/codeplex/PHPExcel.php'; // Must be included BEFORE common.php +require_once 'common.php'; +require_once 'displayMgr.php'; + +$timerOn = microtime(true); // will be used to compute elapsed time +$templateCfg = templateConfiguration(); + +$smarty = new TLSmarty(); +$args = initArgs($db); + +$metricsMgr = new tlTestPlanMetrics($db); +$tplan_mgr = &$metricsMgr; + +list ($gui, $labels, $cfg) = initializeGui($db, $args, $smarty->getImages(), + $tplan_mgr); +$args->cfg = $cfg; +$mailCfg = buildMailCfg($gui); + +// We have faced a performance block due to an environment with +// 700 Builds and 1300 Test Cases on Test Plan +// This created a block on NOT RUN QUERY, but anyway will produce an enormous and +// unmanageable matrix on screen +// +// New way to process: +// ACTIVE Build Qty > 20 => Ask user to select builds he/she wants to use +// Cell Qty = (ACTIVE Build Qty x Test Cases on Test plan) > 2000 => said user I'm sorry +// +if (($gui->activeBuildsQty <= $gui->matrixCfg->buildQtyLimit) || + $args->do_action == 'result') { + setUpBuilds($args, $gui); + + $tpl = $templateCfg->default_template; + $opt = null; + $buildSet = array( + 'buildSet' => $args->builds->idSet + ); + + $opt = array( + 'getExecutionNotes' => true, + 'getTester' => true, + 'getUserAssignment' => true, + 'output' => 'cumulative', + 'getExecutionTimestamp' => true, + 'getExecutionDuration' => true + ); + + $execStatus = $metricsMgr->getExecStatusMatrixFlat($args->tplan_id, + $buildSet, $opt); + + $metrics = $execStatus['metrics']; + $latestExecution = $execStatus['latestExec']; + + // Every Test suite a row on matrix to display will be created + // One matrix will be created for every platform that has testcases + $tcols = array( + 'tsuite', + 'tcase', + 'version' + ); + if ($gui->show_platforms) { + $tcols[] = 'platform'; + } + $tcols[] = 'priority'; + $cols = array_flip($tcols); + $args->cols = $cols; + + if (! is_null($execStatus['metrics'])) { + buildSpreadsheetData($db, $args, $gui, $execStatus, $labels); + } + createSpreadsheet($gui); + $args->format = FORMAT_XLS; +} else { + // We need to ask user to do a choice + $tpl = 'resultsTCFlatLauncher.tpl'; + $gui->pageTitle = $labels['test_result_flat_filters']; + if ($gui->matrixCfg->buildQtyLimit > 0) { + $gui->userFeedback = $labels['too_much_data'] . '
    ' . + sprintf($labels['too_much_builds'], $gui->activeBuildsQty, + $gui->matrixCfg->buildQtyLimit); + } + $args->format = FORMAT_HTML; +} + +$timerOff = microtime(true); +$gui->elapsed_time = round($timerOff - $timerOn, 2); + +$smarty->assign('gui', $gui); +displayReport($templateCfg->template_dir . $tpl, $smarty, $args->format, + $mailCfg); + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "do_action" => array( + tlInputParameter::STRING_N, + 5, + 10 + ), + "build_set" => array( + tlInputParameter::ARRAY_INT + ), + "buildListForExcel" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "format" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->addOpAccess = true; + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + + if ($args->tproject_id <= 0) { + $msg = __FILE__ . '::' . __FUNCTION__ . + " :: Invalid Test Project ID ({$args->tproject_id})"; + throw new Exception($msg); + } + + switch ($args->format) { + case FORMAT_XLS: + if ($args->buildListForExcel != '') { + $args->build_set = explode(',', $args->buildListForExcel); + } + break; + } + + $args->user = $_SESSION['currentUser']; + $args->basehref = $_SESSION['basehref']; + + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @param stdClass $context + * @return string + */ +function checkRights(&$db, &$user, $context = null) +{ + if (is_null($context)) { + $context = new stdClass(); + $context->tproject_id = $context->tplan_id = null; + $context->getAccessAttr = false; + } + + return $user->hasRightOnProj($db, 'testplan_metrics', $context->tproject_id, + $context->tplan_id, $context->getAccessAttr); +} + +/** + * + * @param stdClass $guiObj + * @return stdClass + */ +function buildMailCfg(&$guiObj) +{ + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param array $imgSet + * @param tlTestPlanMetrics $tplanMgr + * @return array + */ +function initializeGui(&$dbHandler, &$argsObj, $imgSet, &$tplanMgr) +{ + $cfg = array( + 'results' => config_get('results'), + 'urgency' => config_get('urgency'), + 'tcase' => config_get('testcase_cfg') + ); + + $guiObj = new stdClass(); + $guiObj->map_status_css = null; + $guiObj->title = lang_get('title_test_report_all_builds'); + $guiObj->printDate = ''; + $guiObj->matrix = array(); + + $guiObj->platforms = (array) $tplanMgr->getPlatforms($argsObj->tplan_id, + array( + 'outputFormat' => 'map' + )); + $guiObj->show_platforms = (count($guiObj->platforms) > 0); + $guiObj->img = new stdClass(); + $guiObj->img->exec = $imgSet['exec_icon']; + $guiObj->img->edit = $imgSet['edit_icon']; + $guiObj->img->history = $imgSet['history_small']; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->apikey = $argsObj->apikey; + + $tproject_mgr = new testproject($dbHandler); + $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); + $argsObj->prefix = $tproject_info['prefix']; + $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; + $argsObj->tprojectOpt = $tproject_info['opt']; + + $guiObj->options = new stdClass(); + $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; + unset($tproject_mgr); + + $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); + $guiObj->tplan_name = $tplan_info['name']; + $guiObj->tproject_name = $tproject_info['name']; + + $l18n = init_labels( + array( + 'design' => null, + 'execution' => null, + 'history' => 'execution_history', + 'test_result_flat_filters' => null, + 'too_much_data' => null, + 'too_much_builds' => null, + 'result_on_last_build' => null, + 'versionTag' => 'tcversion_indicator', + 'execution_type_manual' => null, + 'execution_type_auto' => null + )); + + $l18n['not_run'] = lang_get($cfg['results']['status_label']['not_run']); + + $guiObj->matrixCfg = config_get('resultMatrixReport'); + $guiObj->buildInfoSet = $tplanMgr->get_builds($argsObj->tplan_id, + testplan::ACTIVE_BUILDS, null, + array( + 'orderBy' => $guiObj->matrixCfg->buildOrderByClause + )); + $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); + + // hmm need to understand if this can be removed + if ($guiObj->matrixCfg->buildColumns['latestBuildOnLeft']) { + $guiObj->buildInfoSet = array_reverse($guiObj->buildInfoSet); + } + + foreach ($cfg['results']['code_status'] as $code => $verbose) { + if (isset($cfg['results']['status_label'][$verbose])) { + $l18n[$code] = lang_get($cfg['results']['status_label'][$verbose]); + $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . + '_text'; + } + } + + $xxx = config_get('urgency'); + foreach ($xxx['code_label'] as $code => $label) { + $cfg['priority'][$code] = lang_get($label); + } + + return array( + $guiObj, + $l18n, + $cfg + ); +} + +/** + * + * @param stdClass $gui + * @param stdClass $args + */ +function createSpreadsheet($gui) +{ + $lbl = init_labels( + array( + 'title_test_suite_name' => null, + 'platform' => null, + 'priority' => null, + 'build' => null, + 'title_test_case_title' => null, + 'test_exec_by' => null, + 'notes' => null, + 'date_time_run' => null, + 'execution_duration' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'testplan' => null, + 'result_on_last_build' => null, + 'last_execution' => null, + 'assigned_to' => null, + 'tcexec_latest_exec_result' => null, + 'version' => null, + 'execution_type' => null + )); + + // contribution to have more than 26 columns + $cellRange = range('A', 'Z'); + $cellRangeLen = count($cellRange); + for ($idx = 0; $idx < $cellRangeLen; $idx ++) { + for ($jdx = 0; $jdx < $cellRangeLen; $jdx ++) { + $cellRange[] = $cellRange[$idx] . $cellRange[$jdx]; + } + } + + $styleReportContext = array( + 'font' => array( + 'bold' => true + ) + ); + $styleDataHeader = array( + 'font' => array( + 'bold' => true + ), + 'borders' => array( + 'outline' => array( + 'style' => PHPExcel_Style_Border::BORDER_MEDIUM + ), + 'vertical' => array( + 'style' => PHPExcel_Style_Border::BORDER_THIN + ) + ), + 'fill' => array( + 'type' => PHPExcel_Style_Fill::FILL_SOLID, + 'startcolor' => array( + 'argb' => 'FF9999FF' + ) + ) + ); + $dummy = ''; + $lines2write = array( + array( + $lbl['testproject'], + $gui->tproject_name + ), + array( + $lbl['testplan'], + $gui->tplan_name + ), + array( + $lbl['generated_by_TestLink_on'], + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', time()) + ) + ); + + $objPHPExcel = new PHPExcel(); + $cellArea = "A1:"; + foreach ($lines2write as $zdx => $fields) { + $cdx = $zdx + 1; + $objPHPExcel->setActiveSheetIndex(0) + ->setCellValue("A{$cdx}", current($fields)) + ->setCellValue("B{$cdx}", end($fields)); + } + $cellArea .= "A{$cdx}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($styleReportContext); + + // Step 2 + // data is organized with following columns $dataHeader[] + // Test suite + // Test case + // Test case version (for humans) + // [Platform] => if any exists + // + // Priority ===> Just discovered that we have choosen to make this column + // displayabled or not according test project configuration + // IMHO has no sense work without priority + // + // Build + // Assigned To + // Exec result + // Date + // Tester + // Notes + // Duration + + // + // ?? Exec result on ON LATEST CREATED Build + // ?? Latest Execution result (Hmm need to explain better) + // + $dataHeader = array( + $lbl['title_test_suite_name'], + $lbl['title_test_case_title'], + $lbl['version'] + ); + + if (! is_null($gui->platforms)) { + $dataHeader[] = $lbl['platform']; + } + + if ($gui->options->testPriorityEnabled) { + $dataHeader[] = $lbl['priority']; + } + + $gui->filterFeedback = null; + $dataHeader[] = $lbl['build']; + $dataHeader[] = $lbl['assigned_to']; + $dataHeader[] = $lbl['tcexec_latest_exec_result']; + $dataHeader[] = $lbl['date_time_run']; + $dataHeader[] = $lbl['test_exec_by']; + $dataHeader[] = $lbl['notes']; + $dataHeader[] = $lbl['execution_duration']; + $dataHeader[] = $lbl['execution_type']; + + $startingRow = count($lines2write) + 2; // MAGIC + $cellArea = "A{$startingRow}:"; + foreach ($dataHeader as $zdx => $field) { + $cellID = $cellRange[$zdx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + $cellAreaEnd = $cellRange[$zdx]; + } + + $cellArea .= "{$cellAreaEnd}{$startingRow}"; + $objPHPExcel->getActiveSheet() + ->getStyle($cellArea) + ->applyFromArray($styleDataHeader); + + $startingRow ++; + + $qta_loops = count($gui->matrix); + + for ($idx = 0; $idx < $qta_loops; $idx ++) { + foreach ($gui->matrix[$idx] as $ldx => $field) { + $cellID = $cellRange[$ldx] . $startingRow; + $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); + } + $startingRow ++; + } + + // Final step + $objPHPExcel->setActiveSheetIndex(0); + $settings = array(); + $settings['Excel2007'] = array( + 'ext' => '.xlsx', + 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ); + $settings['Excel5'] = array( + 'ext' => '.xls', + 'Content-Type' => 'application/vnd.ms-excel' + ); + + $xlsType = 'Excel5'; + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); + + $tmpfname = tempnam(config_get('temp_dir'), "resultsTCFlat.tmp"); + $objWriter->save($tmpfname); + + $content = file_get_contents($tmpfname); + unlink($tmpfname); + $f2d = 'resultsTCFlat_' . $gui->tproject_name . '_' . $gui->tplan_name . + $settings[$xlsType]['ext']; + downloadContentsToFile($content, $f2d, + array( + 'Content-Type' => $settings[$xlsType]['Content-Type'] + )); + exit(); +} + +/** + * + * @param stdClass $args + * @param stdClass $gui + */ +function setUpBuilds(&$args, &$gui) +{ + $args->builds = new stdClass(); + + if (is_null($args->build_set)) { + $args->builds->idSet = null; + + $gui->buildListForExcel = ''; + $gui->filterApplied = false; + if (! is_null($gui->buildInfoSet)) { + $args->builds->idSet = array_keys($gui->buildInfoSet); + } + } else { + $args->builds->idSet = array_keys(array_flip($args->build_set)); + $gui->filterApplied = true; + $gui->buildListForExcel = implode(',', $args->builds->idSet); + } + + $args->builds->latest = new stdClass(); + $args->builds->latest->id = end($args->builds->idSet); + $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; +} + +/** + * + * @param database $db + * @param stdClass $args + * @param stdClass $gui + * @param array $exec + * @param array $labels + */ +function buildSpreadsheetData(&$db, &$args, &$gui, &$exec, $labels) +{ + $userSet = getUsersForHtmlOptions($db, null, null, null, null, + array( + 'userDisplayFormat' => '%first% %last%' + )); + + $det = array( + TESTCASE_EXECUTION_TYPE_MANUAL => $labels['execution_type_manual'], + TESTCASE_EXECUTION_TYPE_AUTO => $labels['execution_type_auto'] + ); + + $metrics = $exec['metrics']; + + $cols = $args->cols; + + /* + * tsuite_id 741 + * tcase_id 742 => name TC-1A + * tcversion_id 743 + * platform_id 16 => NEED TO DECODE + * build_id 19 => NEED TO DECODE + * version 1 + * external_id 1 + * executions_id 64 + * status f => NEED TO DECODE + * execution_notes [empty string] + * tester_id 1 => NEED TO DECODE + * execution_ts 2015-05-23 16:38:22 + * execution_duration NULL + * user_id 1 => NEED TO DECODE + * urg_imp 4 => NEED TO DECODE + * execution_type => NEED TO DECODE + */ + + $loop2do = count($metrics); + + for ($ix = 0; $ix < $loop2do; $ix ++) { + $rows = array(); + + $rows[$cols['tsuite']] = $metrics[$ix]['suiteName']; + $eid = $args->tcPrefix . $metrics[$ix]['external_id']; + $rows[$cols['tcase']] = htmlspecialchars( + "{$eid}:{$metrics[$ix]['name']}", ENT_QUOTES); + + $rows[$cols['version']] = $metrics[$ix]['version']; + if ($gui->show_platforms) { + $rows[$cols['platform']] = $gui->platforms[$metrics[$ix]['platform_id']]; + } + + if ($gui->options->testPriorityEnabled) { + $rows[$cols['priority']] = $args->cfg['priority'][$metrics[$ix]['priority_level']]; + } + + // build,assigned to,exec result,data,tested by,notes,duration + $rows[] = $gui->buildInfoSet[$metrics[$ix]['build_id']]['name']; + + $u = ""; + if (isset($userSet, $metrics[$ix]['user_id'])) { + $u = $userSet[$metrics[$ix]['user_id']]; + } + $rows[] = $u; + $rows[] = $labels[$metrics[$ix]['status']]; + $rows[] = $metrics[$ix]['execution_ts']; + + $u = ""; + if (isset($userSet, $metrics[$ix]['tester_id'])) { + $u = $userSet[$metrics[$ix]['tester_id']]; + } + $rows[] = $u; + $rows[] = $metrics[$ix]['execution_notes']; + $rows[] = $metrics[$ix]['execution_duration']; + $rows[] = isset($det[$metrics[$ix]['exec_type']]) ? $det[$metrics[$ix]['exec_type']] : 'not configured'; + + $gui->matrix[] = $rows; + } } - -/** - * - * - */ -function checkRights(&$db,&$user,$context = null) -{ - if(is_null($context)) - { - $context = new stdClass(); - $context->tproject_id = $context->tplan_id = null; - $context->getAccessAttr = false; - } - - $check = $user->hasRightOnProj($db,'testplan_metrics',$context->tproject_id,$context->tplan_id,$context->getAccessAttr); - return $check; -} - -/** - * - * - */ -function buildMailCfg(&$guiObj) -{ - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; -} - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$imgSet,&$tplanMgr) -{ - - $cfg = array('results' => config_get('results'), 'urgency' => config_get('urgency'), - 'tcase' => config_get('testcase_cfg')); - - $guiObj = new stdClass(); - $guiObj->map_status_css = null; - $guiObj->title = lang_get('title_test_report_all_builds'); - $guiObj->printDate = ''; - $guiObj->matrix = array(); - - $guiObj->platforms = (array)$tplanMgr->getPlatforms($argsObj->tplan_id,array('outputFormat' => 'map')); - $guiObj->show_platforms = (count($guiObj->platforms) > 0); - - $guiObj->img = new stdClass(); - $guiObj->img->exec = $imgSet['exec_icon']; - $guiObj->img->edit = $imgSet['edit_icon']; - $guiObj->img->history = $imgSet['history_small']; - - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->tplan_id = $argsObj->tplan_id; - - $guiObj->apikey = $argsObj->apikey; - - - $tproject_mgr = new testproject($dbHandler); - $tproject_info = $tproject_mgr->get_by_id($argsObj->tproject_id); - $argsObj->prefix = $tproject_info['prefix']; - $argsObj->tcPrefix = $tproject_info['prefix'] . $cfg['tcase']->glue_character; - $argsObj->tprojectOpt = $tproject_info['opt']; - - $guiObj->options = new stdClass(); - $guiObj->options->testPriorityEnabled = $tproject_info['opt']->testPriorityEnabled; - unset($tproject_mgr); - - $tplan_info = $tplanMgr->get_by_id($argsObj->tplan_id); - $guiObj->tplan_name = $tplan_info['name']; - $guiObj->tproject_name = $tproject_info['name']; - - $l18n = init_labels(array('design' => null, 'execution' => null, 'history' => 'execution_history', - 'test_result_flat_filters' => null, 'too_much_data' => null,'too_much_builds' => null, - 'result_on_last_build' => null, 'versionTag' => 'tcversion_indicator', - 'execution_type_manual' => null, - 'execution_type_auto' => null) ); - - $l18n['not_run']=lang_get($cfg['results']['status_label']['not_run']); - - - $guiObj->matrixCfg = config_get('resultMatrixReport'); - $guiObj->buildInfoSet = $tplanMgr->get_builds($argsObj->tplan_id, testplan::ACTIVE_BUILDS,null, - array('orderBy' => $guiObj->matrixCfg->buildOrderByClause)); - $guiObj->activeBuildsQty = count($guiObj->buildInfoSet); - - - // hmm need to understand if this can be removed - if ($guiObj->matrixCfg->buildColumns['latestBuildOnLeft']) - { - $guiObj->buildInfoSet = array_reverse($guiObj->buildInfoSet); - } - // ------------------------------------------------------------------------------- - - - foreach($cfg['results']['code_status'] as $code => $verbose) - { - if( isset($cfg['results']['status_label'][$verbose])) - { - $l18n[$code] = lang_get($cfg['results']['status_label'][$verbose]); - $guiObj->map_status_css[$code] = $cfg['results']['code_status'][$code] . '_text'; - } - } - - $xxx = config_get('urgency'); - foreach ($xxx['code_label'] as $code => $label) - { - $cfg['priority'][$code] = lang_get($label); - } - - return array($guiObj,$l18n,$cfg); -} - -/** - * - * - */ -function createSpreadsheet($gui,$args) -{ - - $lbl = init_labels(array('title_test_suite_name' => null,'platform' => null,'priority' => null, - 'build' => null, 'title_test_case_title' => null,'test_exec_by' => null, - 'notes' => null, 'date_time_run' => null, 'execution_duration' => null, - 'testproject' => null,'generated_by_TestLink_on' => null,'testplan' => null, - 'result_on_last_build' => null,'last_execution' => null, - 'assigned_to' => null,'tcexec_latest_exec_result' => null, - 'version' => null,'execution_type' => null)); - - $buildIDSet = $args->builds->idSet; - - // contribution to have more than 26 columns - $cellRange = range('A','Z'); - $cellRangeLen = count($cellRange); - for($idx = 0; $idx < $cellRangeLen; $idx++) - { - for($jdx = 0; $jdx < $cellRangeLen; $jdx++) - { - $cellRange[] = $cellRange[$idx] . $cellRange[$jdx]; - } - } - - $styleReportContext = array('font' => array('bold' => true)); - $styleDataHeader = array('font' => array('bold' => true), - 'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_MEDIUM), - 'vertical' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), - 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, - 'startcolor' => array( 'argb' => 'FF9999FF')) - ); - $dummy = ''; - $lines2write = array(array($lbl['testproject'],$gui->tproject_name), - array($lbl['testplan'],$gui->tplan_name), - array($lbl['generated_by_TestLink_on'], - localize_dateOrTimeStamp(null,$dummy,'timestamp_format',time()))); - - $objPHPExcel = new PHPExcel(); - $cellArea = "A1:"; - foreach($lines2write as $zdx => $fields) - { - $cdx = $zdx+1; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$cdx}", current($fields)) - ->setCellValue("B{$cdx}", end($fields)); - } - $cellArea .= "A{$cdx}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea)->applyFromArray($styleReportContext); - - - // Step 2 - // data is organized with following columns $dataHeader[] - // Test suite - // Test case - // Test case version (for humans) - // [Platform] => if any exists - // - // Priority ===> Just discovered that we have choosen to make this column - // displayabled or not according test project configuration - // IMHO has no sense work without priority - // - // Build - // Assigned To - // Exec result - // Date - // Tester - // Notes - // Duration - - // - // ?? Exec result on ON LATEST CREATED Build - // ?? Latest Execution result (Hmm need to explain better) - // - $dataHeader = array($lbl['title_test_suite_name'], - $lbl['title_test_case_title'], - $lbl['version']); - - if( $showPlatforms = !is_null($gui->platforms) ) - { - $dataHeader[] = $lbl['platform']; - } - - if($gui->options->testPriorityEnabled) - { - $dataHeader[] = $lbl['priority']; - } - - $gui->filterFeedback = null; - $dataHeader[] = $lbl['build']; - $dataHeader[] = $lbl['assigned_to']; - $dataHeader[] = $lbl['tcexec_latest_exec_result']; - $dataHeader[] = $lbl['date_time_run']; - $dataHeader[] = $lbl['test_exec_by']; - $dataHeader[] = $lbl['notes']; - $dataHeader[] = $lbl['execution_duration']; - $dataHeader[] = $lbl['execution_type']; - - $startingRow = count($lines2write) + 2; // MAGIC - $cellArea = "A{$startingRow}:"; - foreach($dataHeader as $zdx => $field) - { - $cellID = $cellRange[$zdx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - $cellAreaEnd = $cellRange[$zdx]; - } - - $cellArea .= "{$cellAreaEnd}{$startingRow}"; - $objPHPExcel->getActiveSheet()->getStyle($cellArea)->applyFromArray($styleDataHeader); - - $startingRow++; - - $qta_loops = count($gui->matrix); - - for($idx = 0; $idx < $qta_loops; $idx++) - { - foreach($gui->matrix[$idx] as $ldx => $field) - { - $cellID = $cellRange[$ldx] . $startingRow; - $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellID, $field); - } - $startingRow++; - } - - - - // Final step - $objPHPExcel->setActiveSheetIndex(0); - $settings = array(); - $settings['Excel2007'] = array('ext' => '.xlsx', - 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); - $settings['Excel5'] = array('ext' => '.xls', - 'Content-Type' => 'application/vnd.ms-excel'); - - $xlsType = 'Excel5'; - $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $xlsType); - - $tmpfname = tempnam(config_get('temp_dir'),"resultsTCFlat.tmp"); - $objWriter->save($tmpfname); - - $content = file_get_contents($tmpfname); - unlink($tmpfname); - $f2d = 'resultsTCFlat_'. $gui->tproject_name . '_' . $gui->tplan_name . $settings[$xlsType]['ext']; - downloadContentsToFile($content,$f2d,array('Content-Type' => $settings[$xlsType]['Content-Type'])); - exit(); -} - - -/** - * - */ -function setUpBuilds(&$args,&$gui) -{ - $args->builds = new stdClass(); - - if( is_null($args->build_set) ) - { - $args->builds->idSet = null; - - $gui->buildListForExcel = ''; - $gui->filterApplied = false; - if( !is_null($gui->buildInfoSet) ) - { - $args->builds->idSet = array_keys($gui->buildInfoSet); - } - } - else - { - $args->builds->idSet = array_keys(array_flip($args->build_set)); - $gui->filterApplied = true; - $gui->buildListForExcel = implode(',',$args->builds->idSet); - } - - $args->builds->latest = new stdClass(); - $args->builds->latest->id = end($args->builds->idSet); - $args->builds->latest->name = $gui->buildInfoSet[$args->builds->latest->id]['name']; -} - - -/** - * - * - */ -function buildSpreadsheetData(&$db,&$args,&$gui,&$exec,$labels) -{ - $userSet = getUsersForHtmlOptions($db,null,null,null,null, - array('userDisplayFormat' => '%first% %last%')); - - $det = array(TESTCASE_EXECUTION_TYPE_MANUAL => - $labels['execution_type_manual'], - TESTCASE_EXECUTION_TYPE_AUTO => - $labels['execution_type_auto']); - - $metrics = $exec['metrics']; - $latestExecution = $exec['latestExec']; - $cols = $args->cols; - -/* -tsuite_id 741 -tcase_id 742 => name TC-1A -tcversion_id 743 -platform_id 16 => NEED TO DECODE -build_id 19 => NEED TO DECODE -version 1 -external_id 1 -executions_id 64 -status f => NEED TO DECODE -execution_notes [empty string] -tester_id 1 => NEED TO DECODE -execution_ts 2015-05-23 16:38:22 -execution_duration NULL -user_id 1 => NEED TO DECODE -urg_imp 4 => NEED TO DECODE -execution_type => NEED TO DECODE -*/ - - $loop2do = count($metrics); - - $uk2 = array('user_id','tester_id'); - - for($ix=0; $ix < $loop2do; $ix++) - { - $rows = array(); - - $rows[$cols['tsuite']] = $metrics[$ix]['suiteName']; - $eid = $args->tcPrefix . $metrics[$ix]['external_id']; - $rows[$cols['tcase']] = - htmlspecialchars("{$eid}:{$metrics[$ix]['name']}",ENT_QUOTES); - - $rows[$cols['version']] = $metrics[$ix]['version']; - if ($gui->show_platforms) { - $rows[$cols['platform']] = $gui->platforms[$metrics[$ix]['platform_id']]; - } - - if($gui->options->testPriorityEnabled) - { - $rows[$cols['priority']] = $args->cfg['priority'][$metrics[$ix]['priority_level']]; - } - - // build,assigned to,exec result,data,tested by,notes,duration - $rows[] = $gui->buildInfoSet[$metrics[$ix]['build_id']]['name']; - - $u = ""; - if(isset($userSet,$metrics[$ix]['user_id'])) - { - $u = $userSet[$metrics[$ix]['user_id']]; - } - $rows[] = $u; - - // $rows[] = $args->cfg['results']['code_status'][$metrics[$ix]['status']]; - $rows[] = $labels[$metrics[$ix]['status']]; - $rows[] = $metrics[$ix]['execution_ts']; - - $u = ""; - if(isset($userSet,$metrics[$ix]['tester_id'])) - { - $u = $userSet[$metrics[$ix]['tester_id']]; - } - $rows[] = $u; - - $rows[] = $metrics[$ix]['execution_notes']; - $rows[] = $metrics[$ix]['execution_duration']; - - $rows[] = - isset($det[$metrics[$ix]['exec_type']]) ? - $det[$metrics[$ix]['exec_type']] : 'not configured'; - - $gui->matrix[] = $rows; - } -} \ No newline at end of file diff --git a/lib/results/tcCreatedPerUserOnTestProject.php b/lib/results/tcCreatedPerUserOnTestProject.php index db0364b937..58471ab34d 100644 --- a/lib/results/tcCreatedPerUserOnTestProject.php +++ b/lib/results/tcCreatedPerUserOnTestProject.php @@ -1,472 +1,570 @@ -getImages(); -$templateCfg = templateConfiguration(); -$args = init_args($db); -$gui = initializeGui($db,$args,$imgSet); -$tpl = $templateCfg->default_template; - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $tpl); - -/** -* initialize Gui -*/ -function initializeGui(&$dbHandler,&$args,$images) { - $gui = new stdClass(); - $gui->images = $images; - $gui->glueChar = config_get('testcase_cfg')->glue_character; - $gui->tproject_id = $args->tproject_id; - $gui->tproject_name = $args->tproject_name; - $gui->warning_msg = ''; - $gui->tableSet = null; - - $gui->l18n = init_labels( - array('tcversion_indicator' => null,'goto_testspec' => null, - 'version' => null, - 'testplan' => null, 'assigned_tc_overview' => null, - 'testcases_created_per_user' => null, - 'design' => null, 'execution' => null, - 'execution_history' => null, - 'testproject' => null,'generated_by_TestLink_on' => null, - 'no_records_found' => null, - 'low' => null, 'medium' => null, 'high' => null)); - - $gui->pageTitle = sprintf($gui->l18n['testcases_created_per_user'],$gui->tproject_name); - $gui->context = $gui->l18n['testproject'] . ': ' . $args->tproject_name; - - switch($args->do_action) { - case 'uinput': - default: - initializeGuiForInput($dbHandler,$args,$gui); - break; - - case 'result': - initializeGuiForInput($dbHandler,$args,$gui); - initializeGuiForResult($dbHandler,$args,$gui); - break; - - case 'csv': - initializeGuiForInput($dbHandler,$args,$gui); - initGuiForCSVDownload($dbHandler,$args,$gui); - break; - - } - - return $gui; +getImages(); +$templateCfg = templateConfiguration(); +$args = initArgs($db); +$gui = initializeGui($db, $args, $imgSet); +$tpl = $templateCfg->default_template; + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $tpl); + +/** + * initialize Gui + */ +function initializeGui(&$dbHandler, &$args, $images) +{ + $gui = new stdClass(); + $gui->images = $images; + $gui->glueChar = config_get('testcase_cfg')->glue_character; + $gui->tproject_id = $args->tproject_id; + $gui->tproject_name = $args->tproject_name; + $gui->warning_msg = ''; + $gui->tableSet = null; + + $gui->l18n = init_labels( + array( + 'tcversion_indicator' => null, + 'goto_testspec' => null, + 'version' => null, + 'testplan' => null, + 'assigned_tc_overview' => null, + 'testcases_created_per_user' => null, + 'design' => null, + 'execution' => null, + 'execution_history' => null, + 'testproject' => null, + 'generated_by_TestLink_on' => null, + 'no_records_found' => null, + 'low' => null, + 'medium' => null, + 'high' => null + )); + + $gui->pageTitle = sprintf($gui->l18n['testcases_created_per_user'], + $gui->tproject_name); + $gui->context = $gui->l18n['testproject'] . ': ' . $args->tproject_name; + + switch ($args->do_action) { + case 'result': + initializeGuiForInput($dbHandler, $args, $gui); + initializeGuiForResult($dbHandler, $args, $gui); + break; + + case 'csv': + initializeGuiForInput($dbHandler, $args, $gui); + initGuiForCSVDownload($dbHandler, $args, $gui); + break; + + case 'uinput': + default: + initializeGuiForInput($dbHandler, $args, $gui); + break; + } + + return $gui; +} + +/** + */ +function initializeGuiForResult(&$dbHandler, $argsObj, &$guiObj) +{ + $rcfg = config_get('results'); + $map_code_status = $rcfg['code_status']; + $map_status_label = $rcfg['status_label']; + $map_statuscode_css = array(); + + foreach ($map_code_status as $code => $status) { + if (isset($map_status_label[$status])) { + $label = $map_status_label[$status]; + $map_statuscode_css[$code] = array(); + $map_statuscode_css[$code]['translation'] = lang_get($label); + $map_statuscode_css[$code]['css_class'] = $map_code_status[$code] . + '_text'; + } + } + + $options = array(); + + // convert starttime to iso format for database usage + $dateFormat = config_get('date_format'); + $k2l = array( + 'selected_start_date' => 'startTime', + 'selected_end_date' => 'endTime' + ); + foreach ($k2l as $in => $opt) { + if (isset($argsObj->$in) && count($argsObj->$in) > 0) { + $dd = split_localized_date(current($argsObj->$in), $dateFormat); + if ($dd != null) { + $options[$opt] = $dd['year'] . "-" . $dd['month'] . "-" . + $dd['day']; + } + } + } + + $options['startTime'] .= " " . + (isset($argsObj->start_Hour) ? $argsObj->start_Hour : "00") . ":00:00"; + $options['endTime'] .= " " . + (isset($argsObj->end_Hour) ? $argsObj->end_Hour : "00") . ":59:59"; + + $mgr = new testproject($dbHandler); + $guiObj->searchDone = 1; + $guiObj->resultSet = $mgr->getTestCasesCreatedByUser($argsObj->tproject_id, + $argsObj->user_id, $options); + + if (! is_null($guiObj->resultSet)) { + // test case can exist multiple times, due to versions + $rows = array(); + list ($columns, $sortByColumn) = getColumnsDefinition(); + foreach ($guiObj->resultSet as $itemInfo) { + foreach ($itemInfo as $tcase) { + $cuRow = array(); + $tcase_id = $tcase['tcase_id']; + $tcversion_id = $tcase['tcversion_id']; + $cuRow[] = htmlspecialchars($tcase['login']); + $cuRow[] = htmlspecialchars($tcase['path']); + + // Create linked icons + $edit_link = "
    " . + "l18n['design']}\" src=\"{$guiObj->images['edit']}\" /> "; + + $cuRow[] = "" . $edit_link . + htmlspecialchars($tcase['external_id']) . " : " . + htmlspecialchars($tcase['tcase_name']) . + sprintf($guiObj->l18n['tcversion_indicator'], + $tcase['version']); + + $cuRow[] = $tcase['importance']; + $cuRow[] = $tcase['creation_ts']; + $cuRow[] = $tcase['modification_ts']; + $rows[] = $cuRow; + } + } + + // Different table ID for different reports: + $table_id = "tl_table_tc_created_per_user_"; + + // Add test plan ID to table ID + $table_id .= $guiObj->tproject_id; + + $matrix = new tlExtTable($columns, $rows, $table_id); + $matrix->title = $guiObj->l18n['testproject'] . ": " . + htmlspecialchars($guiObj->tproject_name); + // + // @TODO how this work ? + // $matrix->addCustomBehaviour(arg1, arg2) + // arg1: type that can be user defined, here we use 'importance'. + // arg2: array with methods + // 'render' => javascript render method (has to be present on inc_ext_table.tpl). + // 'filter' => piece of name used on several files + // 1. on exttable.class.php is used on buildColumns() to call build{piece}FilterOptions() + // 2. on ext_extensions a method named Ext.ux.grid.filter.{piece}Filter + // has to exists or rendering will fail + // + $matrix->addCustomBehaviour('importance', + array( + 'render' => 'importanceRenderer', + 'filter' => 'Importance' + )); + + // Default grouping by first column, which is user for overview, build otherwise + $matrix->setGroupByColumnName(lang_get($columns[0]['title_key'])); + + // Define toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + + $matrix->toolbarDefaultStateButton = false; + $matrix->toolbarRefreshButton = false; + + $matrix->setSortByColumnName($sortByColumn); + $matrix->sortDirection = 'DESC'; + + $guiObj->tableSet[$guiObj->tproject_id] = $matrix; + } +} + +/** + */ +function initGuiForCSVDownload(&$dbHandler, $argsObj, &$guiObj) +{ + $fromDate = current($argsObj->selected_start_date); + $toDate = current($argsObj->selected_end_date); + + $impCfg = config_get('importance'); + $impL10N = $impCfg['code_label']; + foreach ($impL10N as $ci => $lc) { + $impL10N[$ci] = lang_get($lc); + } + + $colHeaders = getCSVColumnsDefinition(); + + $options = array(); + + // convert starttime to iso format for database usage + $dateFormat = config_get('date_format'); + $k2l = array( + 'selected_start_date' => 'startTime', + 'selected_end_date' => 'endTime' + ); + foreach ($k2l as $in => $opt) { + if (isset($argsObj->$in) && count($argsObj->$in) > 0) { + $dd = split_localized_date(current($argsObj->$in), $dateFormat); + if ($dd != null) { + $options[$opt] = $dd['year'] . "-" . $dd['month'] . "-" . + $dd['day']; + } + } + } + + $options['startTime'] .= " " . + (isset($argsObj->start_Hour) ? $argsObj->start_Hour : "00") . ":00:00"; + $options['endTime'] .= " " . + (isset($argsObj->end_Hour) ? $argsObj->end_Hour : "00") . ":59:59"; + + $mgr = new testproject($dbHandler); + $guiObj->searchDone = 1; + $guiObj->resultSet = $mgr->getTestCasesCreatedByUser($argsObj->tproject_id, + $argsObj->user_id, $options); + + if (! is_null($guiObj->resultSet)) { + // test case can exist multiple times, due to versions + $rows = array(); + foreach ($guiObj->resultSet as $itemInfo) { + foreach ($itemInfo as $tcase) { + $cuRow = array(); + $cuRow[] = htmlspecialchars($tcase['login']); + $cuRow[] = htmlspecialchars($tcase['path']); + + $cuRow[] = htmlspecialchars($tcase['external_id']) . " : " . + htmlspecialchars($tcase['tcase_name']) . + sprintf($guiObj->l18n['tcversion_indicator'], + $tcase['version']); + + $cuRow[] = '(' . $tcase['importance'] . ') ' . + $impL10N[$tcase['importance']]; + + $cuRow[] = $tcase['creation_ts']; + $cuRow[] = $tcase['modification_ts']; + $cuRow[] = $fromDate; + $cuRow[] = $toDate; + + $rows[] = $cuRow; + } + } + + if (empty($rows)) { + return; + } + + $tmpfname = tempnam(sys_get_temp_dir(), "nuwow"); + unlink($tmpfname); + $csvfile = $tmpfname . '.csv'; + $fp = fopen($csvfile, 'w'); + fputcsv($fp, $colHeaders); + foreach ($rows as $fields) { + fputcsv($fp, $fields); + } + fclose($fp); + $fcont = file_get_contents($csvfile); + unlink($csvfile); + $f2d = __FILE__ . '.csv'; + $cty = array( + 'Content-Type' => 'text/csv' + ); + downloadContentsToFile($fcont, $f2d, $cty); + exit(); + } +} + +/** + */ +function initializeGuiForInput(&$dbHandler, $argsObj, &$guiObj) +{ + $room = config_get('gui_room'); + $guiObj->str_option_any = sprintf($room, lang_get('any')); + $guiObj->str_option_none = sprintf($room, lang_get('nobody')); + $guiObj->warning_msg = ''; + $guiObj->searchDone = 0; + + $guiObj->users = new stdClass(); + $guiObj->users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, + array( + TL_USER_ANYBODY => $guiObj->str_option_any + )); + + $guiObj->user_id = intval($argsObj->user_id); + + $dateFormat = config_get('date_format'); + $cfg = config_get('reportsCfg'); + $now = time(); + + if (is_null($argsObj->selected_start_date)) { + $guiObj->selected_start_date = @strftime($dateFormat, + $now - ($cfg->start_date_offset)); + $guiObj->selected_start_time = $cfg->start_time; + + $guiObj->selected_end_date = @strftime($dateFormat, $now); + $guiObj->selected_end_time = null; + } else { + $guiObj->selected_start_date = $argsObj->selected_start_date[0]; + $guiObj->selected_end_date = $argsObj->selected_end_date[0]; + + // we are using html_select_time (provided by Smarty Templates) + // then we need to provide selected in a format she likes. + $guiObj->selected_start_time = sprintf('%02d:00', $argsObj->start_Hour); + $guiObj->selected_end_time = sprintf('%02d:59', $argsObj->end_Hour); + } +} + +/** + * Gets the arguments used to create the report. + * + * Some of these arguments are set in the $_REQUEST, and some in $_SESSION. + * Having these arguments in hand, the init_args method will use TestLink objects, + * such as a Test Project Manager (testproject class) to retrieve other information + * that is displayed on the screen (e.g.: project name). + * + * @param database $dbHandler + * handler to TestLink database + * + * @return object of stdClass + */ +function initArgs(&$dbHandler) +{ + $args = new stdClass(); + + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 32, + 32 + ), + "do_action" => array( + tlInputParameter::STRING_N, + 3, + 6 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "user_id" => array( + tlInputParameter::INT_N + ), + "selected_start_date" => array( + tlInputParameter::ARRAY_STRING_N + ), + "selected_end_date" => array( + tlInputParameter::ARRAY_STRING_N + ), + "start_Hour" => array( + tlInputParameter::INT_N + ), + "end_Hour" => array( + tlInputParameter::INT_N + ) + ); + + $_REQUEST = strings_stripSlashes($_REQUEST); + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + $args->show_only_active = true; + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = null; + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + } + + if ($args->tproject_id < 0) { + throw new Exception('Test project id can not be empty'); + } + $mgr = new testproject($dbHandler); + $info = $mgr->get_by_id($args->tproject_id); + $args->tproject_name = $info['name']; + + // Sanitize a little bit better + sanitizeDates($args); + + return $args; +} + +/** + * + * @link http://stackoverflow.com/questions/ + * 9293483/regular-expression-help-for-date-validation-dd-mm-yyyy-php + */ +function sanitizeDates(&$obj) +{ + $validLenght = strlen('MM/DD/YYYY'); + + // [./-] + // . russian,pl + // - nl + $validFormat = '#^\d{1,2}[./-][[0-9]{1,2}[./-][[0-9]{4}$#'; + + $p2check = array( + 'selected_end_date', + 'selected_start_date' + ); + foreach ($p2check as $prop) { + if (! is_null($obj->$prop)) { + // lenght check + $val = $obj->$prop; + $val = $val[0]; + + if (strlen($val) != $validLenght) { + $obj->$prop = null; + } else { + // check if format is valid + if (preg_match($validFormat, $val) === 0) { + $obj->$prop = null; + } + } + } + } // foreach +} + +/** + * Gets the columns definitions used in the report table. + * + * @return array containing columns and sort information + */ +function getColumnsDefinition() +{ + static $labels; + if (is_null($labels)) { + $lbl2get = array( + 'user' => null, + 'testsuite' => null, + 'testcase' => null, + 'importance' => null, + 'status' => null, + 'version' => null, + 'title_created' => null, + 'low' => null, + 'medium' => null, + 'high' => null + ); + $labels = init_labels($lbl2get); + } + + $colDef = array(); + $sortByCol = $labels['testsuite']; + $colDef[] = array( + 'title_key' => '', + 'width' => 80 + ); + $colDef[] = array( + 'title_key' => 'testsuite', + 'width' => 130 + ); + $colDef[] = array( + 'title_key' => 'testcase', + 'width' => 130 + ); + + // render and filter will be managed using customBehaviour (see $matrix->addCustomBehaviour()) + $colDef[] = array( + 'title_key' => 'importance', + 'width' => 50, + 'type' => 'importance' + ); + + $colDef[] = array( + 'title_key' => 'title_created', + 'width' => 75 + ); + $colDef[] = array( + 'title_key' => 'title_last_mod', + 'width' => 75 + ); + + return array( + $colDef, + $sortByCol + ); +} + +/** + * Gets the columns definitions used in the report table. + * + * @return array containing columns + */ +function getCSVColumnsDefinition() +{ + $lbl2get = array( + 'user' => null, + 'testsuite' => null, + 'testcase' => null, + 'importance' => null, + 'status' => null, + 'version' => null, + 'title_created' => null, + 'title_last_mod' => null, + 'th_start_time' => null, + 'th_end_time' => null, + 'low' => null, + 'medium' => null, + 'high' => null + ); + $lbl = init_labels($lbl2get); + + // this is the row layout + return array( + $lbl['user'], + $lbl['testsuite'], + $lbl['testcase'], + $lbl['importance'], + $lbl['title_created'], + $lbl['title_last_mod'], + $lbl['th_start_time'], + $lbl['th_end_time'] + ); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); } - - -/** - * - */ -function initializeGuiForResult(&$dbHandler,$argsObj,&$guiObj) { - $rcfg = config_get('results'); - $map_status_code = $rcfg['status_code']; - $map_code_status = $rcfg['code_status']; - $map_status_label = $rcfg['status_label']; - $map_statuscode_css = array(); - - foreach($map_code_status as $code => $status) { - if (isset($map_status_label[$status])) { - $label = $map_status_label[$status]; - $map_statuscode_css[$code] = array(); - $map_statuscode_css[$code]['translation'] = lang_get($label); - $map_statuscode_css[$code]['css_class'] = $map_code_status[$code] . '_text'; - } - } - - $options = array(); - - // convert starttime to iso format for database usage - $dateFormat = config_get('date_format'); - $k2l = array('selected_start_date' => 'startTime','selected_end_date' => 'endTime'); - foreach($k2l as $in => $opt) { - if (isset($argsObj->$in) && sizeof($argsObj->$in) > 0) { - $dd = split_localized_date(current($argsObj->$in), $dateFormat); - if ($dd != null) { - $options[$opt] = $dd['year'] . "-" . $dd['month'] . "-" . $dd['day']; - } - } - } - - $options['startTime'] .= " " . (isset($argsObj->start_Hour) ? $argsObj->start_Hour : "00") . ":00:00"; - $options['endTime'] .= " " . (isset($argsObj->end_Hour) ? $argsObj->end_Hour : "00") . ":59:59"; - - $mgr = new testproject($dbHandler); - $guiObj->searchDone = 1; - $guiObj->resultSet = $mgr->getTestCasesCreatedByUser($argsObj->tproject_id,$argsObj->user_id,$options); - - if(!is_null($guiObj->resultSet)) { - // test case can exist multiple times, due to versions - $rows = array(); - list($columns, $sortByColumn) = getColumnsDefinition(); - foreach ($guiObj->resultSet as $idx => $itemInfo) { - foreach($itemInfo as $tcase) { - $cuRow = array(); - $tcase_id = $tcase['tcase_id']; - $tcversion_id = $tcase['tcversion_id']; - $cuRow[] = htmlspecialchars($tcase['login']); - $cuRow[] = htmlspecialchars($tcase['path']); - - // Create linked icons - $edit_link = "" . - "l18n['design']}\" src=\"{$guiObj->images['edit']}\" /> "; - - $cuRow[] = "" . - $edit_link . htmlspecialchars($tcase['external_id']) . " : " . - htmlspecialchars($tcase['tcase_name']) . - sprintf($guiObj->l18n['tcversion_indicator'],$tcase['version']); - - $cuRow[] = $tcase['importance']; - $cuRow[] = $tcase['creation_ts']; - $cuRow[] = $tcase['modification_ts']; - $rows[] = $cuRow; - } - } - - // Different table ID for different reports: - $table_id = "tl_table_tc_created_per_user_"; - - // Add test plan ID to table ID - $table_id .= $guiObj->tproject_id; - - $matrix = new tlExtTable($columns, $rows, $table_id); - $matrix->title = $guiObj->l18n['testproject'] . ": " . htmlspecialchars($guiObj->tproject_name); - // - // @TODO how this work ? - // $matrix->addCustomBehaviour(arg1, arg2) - // arg1: type that can be user defined, here we use 'importance'. - // arg2: array with methods - // 'render' => javascript render method (has to be present on inc_ext_table.tpl). - // 'filter' => piece of name used on several files - // 1. on exttable.class.php is used on buildColumns() to call build{piece}FilterOptions() - // 2. on ext_extensions a method named Ext.ux.grid.filter.{piece}Filter - // has to exists or rendering will fail - // - $matrix->addCustomBehaviour('importance', array('render' => 'importanceRenderer', 'filter' => 'Importance')); - - // Default grouping by first column, which is user for overview, build otherwise - $matrix->setGroupByColumnName(lang_get($columns[0]['title_key'])); - - // Define toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - - $matrix->toolbarDefaultStateButton = false; - $matrix->toolbarRefreshButton = false; - - $matrix->setSortByColumnName($sortByColumn); - $matrix->sortDirection = 'DESC'; - - $guiObj->tableSet[$guiObj->tproject_id] = $matrix; - } -} - -/** - * - */ -function initGuiForCSVDownload(&$dbHandler,$argsObj,&$guiObj) { - - $fromDate = current($argsObj->selected_start_date); - $toDate = current($argsObj->selected_end_date); - - $impCfg = config_get('importance'); - $impL10N = $impCfg['code_label']; - foreach( $impL10N as $ci => $lc ) { - $impL10N[$ci] = lang_get($lc); - } - - $colHeaders = getCSVColumnsDefinition(); - - $options = array(); - - // convert starttime to iso format for database usage - $dateFormat = config_get('date_format'); - $k2l = array('selected_start_date' => 'startTime','selected_end_date' => 'endTime'); - foreach($k2l as $in => $opt) { - if (isset($argsObj->$in) && sizeof($argsObj->$in) > 0) { - $dd = split_localized_date(current($argsObj->$in), $dateFormat); - if ($dd != null) { - $options[$opt] = $dd['year'] . "-" . $dd['month'] . "-" . $dd['day']; - } - } - } - - $options['startTime'] .= " " . (isset($argsObj->start_Hour) ? $argsObj->start_Hour : "00") . ":00:00"; - $options['endTime'] .= " " . (isset($argsObj->end_Hour) ? $argsObj->end_Hour : "00") . ":59:59"; - - $mgr = new testproject($dbHandler); - $guiObj->searchDone = 1; - $guiObj->resultSet = $mgr->getTestCasesCreatedByUser($argsObj->tproject_id,$argsObj->user_id,$options); - - if(!is_null($guiObj->resultSet)) { - // test case can exist multiple times, due to versions - $rows = array(); - foreach ($guiObj->resultSet as $idx => $itemInfo) { - foreach($itemInfo as $tcase) { - $cuRow = array(); - $tcase_id = $tcase['tcase_id']; - $tcversion_id = $tcase['tcversion_id']; - $cuRow[] = htmlspecialchars($tcase['login']); - $cuRow[] = htmlspecialchars($tcase['path']); - - $cuRow[] = htmlspecialchars($tcase['external_id']) . - " : " . - htmlspecialchars($tcase['tcase_name']) . - sprintf($guiObj->l18n['tcversion_indicator'],$tcase['version']); - - $cuRow[] = '(' . $tcase['importance'] . ') ' . - $impL10N[$tcase['importance']]; - - $cuRow[] = $tcase['creation_ts']; - $cuRow[] = $tcase['modification_ts']; - $cuRow[] = $fromDate; - $cuRow[] = $toDate; - - $rows[] = $cuRow; - } - } - - if( count($rows) == 0 ) { - return; - } - - $tmpfname = tempnam(sys_get_temp_dir(), "nuwow"); - unlink($tmpfname); - $csvfile = $tmpfname . '.csv'; - $fp = fopen($csvfile, 'w'); - fputcsv($fp, $colHeaders); - foreach ($rows as $fields) { - fputcsv($fp, $fields); - } - fclose($fp); - $fcont = file_get_contents($csvfile); - unlink($csvfile); - $f2d = __FILE__ . '.csv'; - $cty = array('Content-Type' => 'text/csv'); - downloadContentsToFile($fcont,$f2d,$cty); - exit(); - } - -} - - - -/** - * - */ -function initializeGuiForInput(&$dbHandler,$argsObj,&$guiObj) { - $room = config_get('gui_room'); - $guiObj->str_option_any = sprintf($room,lang_get('any')); - $guiObj->str_option_none = sprintf($room,lang_get('nobody')); - $guiObj->warning_msg = ''; - $guiObj->searchDone = 0; - - $guiObj->users = new stdClass(); - $guiObj->users->items = getUsersForHtmlOptions($dbHandler, ALL_USERS_FILTER, - array(TL_USER_ANYBODY => $guiObj->str_option_any) ); - - $guiObj->user_id = intval($argsObj->user_id); - - $dateFormat = config_get('date_format'); - $cfg = config_get('reportsCfg'); - $now = time(); - - if(is_null($argsObj->selected_start_date)) { - $guiObj->selected_start_date = @strftime($dateFormat, $now - ($cfg->start_date_offset)); - $guiObj->selected_start_time = $cfg->start_time; - - $guiObj->selected_end_date = @strftime($dateFormat, $now); - $guiObj->selected_end_time = null; - } else { - $guiObj->selected_start_date = $argsObj->selected_start_date[0]; - $guiObj->selected_end_date = $argsObj->selected_end_date[0]; - - // we are using html_select_time (provided by Smarty Templates) - // then we need to provide selected in a format she likes. - $guiObj->selected_start_time = sprintf('%02d:00',$argsObj->start_Hour); - $guiObj->selected_end_time = sprintf('%02d:59',$argsObj->end_Hour); - } -} - -/** - * Gets the arguments used to create the report. - * - * Some of these arguments are set in the $_REQUEST, and some in $_SESSION. - * Having these arguments in hand, the init_args method will use TestLink objects, - * such as a Test Project Manager (testproject class) to retrieve other information - * that is displayed on the screen (e.g.: project name). - * - * @param $dbHandler handler to TestLink database - * - * @return object of stdClass - */ -function init_args(&$dbHandler) { - $args = new stdClass(); - - $iParams = array("apikey" => array(tlInputParameter::STRING_N,32,32), - "do_action" => array(tlInputParameter::STRING_N,3,6), - "tproject_id" => array(tlInputParameter::INT_N), - "user_id" => array(tlInputParameter::INT_N), - "selected_start_date" => array(tlInputParameter::ARRAY_STRING_N), - "selected_end_date" => array(tlInputParameter::ARRAY_STRING_N), - "start_Hour" => array(tlInputParameter::INT_N), - "end_Hour" => array(tlInputParameter::INT_N)); - - $_REQUEST=strings_stripSlashes($_REQUEST); - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) { - $args->show_only_active = true; - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = null; - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } else { - testlinkInitPage($dbHandler,false,false,"checkRights"); - } - - if($args->tproject_id < 0) { - throw new Exception('Test project id can not be empty'); - } - $mgr = new testproject($dbHandler); - $info = $mgr->get_by_id($args->tproject_id); - $args->tproject_name = $info['name']; - - - // Sanitize a little bit better - sanitizeDates($args); - - return $args; -} - -/** - * - * @link http://stackoverflow.com/questions/ - * 9293483/regular-expression-help-for-date-validation-dd-mm-yyyy-php - */ -function sanitizeDates(&$obj) { - $validLenght = strlen('MM/DD/YYYY'); - - // [./-] - // . russian,pl - // - nl - $validFormat = '#^[0-9]{1,2}[./-][[0-9]{1,2}[./-][[0-9]{4}$#'; - - $p2check = array('selected_end_date','selected_start_date'); - foreach($p2check as $prop) { - if(!is_null($obj->$prop)) { - // lenght check - $val = $obj->$prop; - $val = $val[0]; - - if( strlen($val) != $validLenght) { - $obj->$prop = null; - } else { - // check if format is valid - if(preg_match($validFormat, $val) === 0) { - $obj->$prop = null; - } - } - } - } // foreach -} - -/** - * Gets the columns definitions used in the report table. - * - * @return array containing columns and sort information - */ -function getColumnsDefinition() { - - static $labels; - if( is_null($labels) ) { - $lbl2get = array('user' => null, 'testsuite' => null, - 'testcase' => null,'importance' => null,'status' => null, - 'version' => null,'title_created' => null, - 'low' => null,'medium' => null, 'high' => null); - $labels = init_labels($lbl2get); - } - - $colDef = array(); - $sortByCol = $labels['testsuite']; - $colDef[] = array('title_key' => '', 'width' => 80); - $colDef[] = array('title_key' => 'testsuite', 'width' => 130); - $colDef[] = array('title_key' => 'testcase', 'width' => 130); - - // render and filter will be managed using customBehaviour (see $matrix->addCustomBehaviour()) - $colDef[] = array('title_key' => 'importance', 'width' => 50, 'type' => 'importance'); - - $colDef[] = array('title_key' => 'title_created', 'width' => 75); - $colDef[] = array('title_key' => 'title_last_mod', 'width' => 75); - - return array($colDef, $sortByCol); -} - - -/** - * Gets the columns definitions used in the report table. - * - * @return array containing columns - */ -function getCSVColumnsDefinition() { - - $lbl2get = array('user' => null, 'testsuite' => null, - 'testcase' => null,'importance' => null,'status' => null, - 'version' => null,'title_created' => null, - 'title_last_mod' => null, - 'th_start_time' => null, 'th_end_time' => null, - 'low' => null,'medium' => null, 'high' => null); - $lbl = init_labels($lbl2get); - - - // this is the row layout - $colDef = array($lbl['user'],$lbl['testsuite'], - $lbl['testcase'],$lbl['importance'], - $lbl['title_created'],$lbl['title_last_mod'], - $lbl['th_start_time'],$lbl['th_end_time'] - ); - - return $colDef; -} - - -/** - * - */ -function checkRights(&$db,&$user) { - return $user->hasRight($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/tcNotRunAnyPlatform.php b/lib/results/tcNotRunAnyPlatform.php index 9e955a273d..9e02266322 100644 --- a/lib/results/tcNotRunAnyPlatform.php +++ b/lib/results/tcNotRunAnyPlatform.php @@ -1,32 +1,36 @@ title = lang_get('title_test_report_not_run_on_any_platform'); $gui->printDate = ''; $gui->matrixData = array(); -$labels = init_labels(array('design' => null, 'execution' => null, 'execution_history' => null)); +$labels = init_labels( + array( + 'design' => null, + 'execution' => null, + 'execution_history' => null + )); $edit_img = TL_THEME_IMG_DIR . "edit_icon.png"; $history_img = TL_THEME_IMG_DIR . "history_small.png"; @@ -42,17 +46,16 @@ $testCasePrefix = $tproject_info['prefix'] . $testCaseCfg->glue_character; $mailCfg = buildMailCfg($gui); -$getOpt = array('outputFormat' => 'map'); -$gui->platforms = $tplan_mgr->getPlatforms($args->tplan_id,$getOpt); -$platforms_active = !is_null($gui->platforms); - -// $re = new results($db, $tplan_mgr, $tproject_info, $tplan_info,ALL_TEST_SUITES,ALL_BUILDS,ALL_PLATFORMS); +$getOpt = array( + 'outputFormat' => 'map' +); +$gui->platforms = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt); +$platforms_active = ! is_null($gui->platforms); $gui->buildInfoSet = $tplan_mgr->get_builds($args->tplan_id, 1); // only active builds -if ($gui->buildInfoSet) -{ - $buildIDSet = array_keys($gui->buildInfoSet); - $buildQty = sizeOf($buildIDSet); +if ($gui->buildInfoSet) { + $buildIDSet = array_keys($gui->buildInfoSet); + $buildQty = count($buildIDSet); } // Get Results on map with access key = test case's parent test suite id @@ -72,195 +75,213 @@ $gui->matrix = array(); $gui->tableSet = array(); -$cols = array_flip(array('tsuite', 'link', 'priority')); - -if ($lastResultMap != null && $platforms_active) -{ - $versionTag = lang_get('tcversion_indicator'); - foreach ($lastResultMap as $suiteId => $tsuite) - { - foreach ($tsuite as $testCaseId => $platform) - { - - $any_result_found = false; - $rowArray = null; - $gui->number_of_testcases ++; - - foreach($platform as $platformId => $tcase) - { - - if (!$any_result_found) - { - $suiteName = $tcase['suiteName']; - $name = $tcase['name']; - $linkedTCVersion = $tcase['version']; - $external_id = $testCasePrefix . $tcase['external_id']; - $tc_name = htmlspecialchars("{$external_id}:{$name}",ENT_QUOTES); - - // create linked icons - $exec_history_link = "" . - " "; - $edit_link = "" . - " "; - - $dl = str_replace(" ", "%20", $args->basehref) . 'linkto.php?tprojectPrefix=' . urlencode($tproject_info['prefix']) . - '&item=testcase&id=' . urlencode($external_id); - $mail_link = "{$tc_name} "; - - $tcLink = "" . - $exec_history_link .$edit_link . $tc_name; - - $rowArray[$cols['tsuite']] = $suiteName; - $rowArray[$cols['link']] = $args->format != FORMAT_HTML ? $mail_link : $tcLink; - - if($_SESSION['testprojectOptions']->testPriorityEnabled) - { - $dummy = $tplan_mgr->getPriority($args->tplan_id, array('tcversion_id' => $tcase['tcversion_id'])); - $rowArray[$cols['priority']] = $dummy[$tcase['tcversion_id']]['priority_level']; - } - - $suiteExecutions = $executionsMap[$suiteId]; - - foreach ($buildIDSet as $idx => $buildId) { - $resultsForBuild = null; - $lastStatus = $resultsCfg['status_code']['not_run']; - - // iterate over executions for this suite, look for - // entries that match current: - // test case id,build id ,platform id - $qta_suites=sizeOf($suiteExecutions); - - foreach ($suiteExecutions as $jdx => $execution_array) { - if (($execution_array['testcaseID'] == $testCaseId) && - ($execution_array['build_id'] == $buildId) && - ($execution_array['platform_id'] == $platformId) && - isset($execution_array['status'])) - { - $any_result_found = true; - } - } - } - } - } // end of inner foreach() - - if (!$any_result_found) { - $gui->matrix[] = $rowArray; - $gui->number_of_not_run_testcases++; - } - } +$cols = array_flip(array( + 'tsuite', + 'link', + 'priority' +)); + +if ($lastResultMap != null && $platforms_active) { + $versionTag = lang_get('tcversion_indicator'); + foreach ($lastResultMap as $suiteId => $tsuite) { + foreach ($tsuite as $testCaseId => $platform) { + + $any_result_found = false; + $rowArray = null; + $gui->number_of_testcases ++; + + foreach ($platform as $platformId => $tcase) { + + if (! $any_result_found) { + $suiteName = $tcase['suiteName']; + $name = $tcase['name']; + $linkedTCVersion = $tcase['version']; + $external_id = $testCasePrefix . $tcase['external_id']; + $tc_name = htmlspecialchars("{$external_id}:{$name}", + ENT_QUOTES); + + // create linked icons + $exec_history_link = "" . + " "; + $edit_link = "" . + " "; + + $dl = str_replace(" ", "%20", $args->basehref) . + 'linkto.php?tprojectPrefix=' . + urlencode($tproject_info['prefix']) . + '&item=testcase&id=' . urlencode($external_id); + $mail_link = "{$tc_name} "; + + $tcLink = "" . $exec_history_link . $edit_link . $tc_name; + + $rowArray[$cols['tsuite']] = $suiteName; + $rowArray[$cols['link']] = $args->format != FORMAT_HTML ? $mail_link : $tcLink; + + if ($_SESSION['testprojectOptions']->testPriorityEnabled) { + $dummy = $tplan_mgr->getPriority($args->tplan_id, + array( + 'tcversion_id' => $tcase['tcversion_id'] + )); + $rowArray[$cols['priority']] = $dummy[$tcase['tcversion_id']]['priority_level']; + } + + $suiteExecutions = $executionsMap[$suiteId]; + + foreach ($buildIDSet as $buildId) { + $resultsForBuild = null; + $lastStatus = $resultsCfg['status_code']['not_run']; + + // iterate over executions for this suite, look for + // entries that match current: + // test case id,build id ,platform id + $qta_suites = count($suiteExecutions); + + foreach ($suiteExecutions as $execution_array) { + if (($execution_array['testcaseID'] == $testCaseId) && + ($execution_array['build_id'] == $buildId) && + ($execution_array['platform_id'] == $platformId) && + isset($execution_array['status'])) { + $any_result_found = true; + } + } + } + } + } + + if (! $any_result_found) { + $gui->matrix[] = $rowArray; + $gui->number_of_not_run_testcases ++; + } + } } } // create and show the table only if we have data to display -if ($gui->number_of_not_run_testcases) -{ - $gui->tableSet[] = buildMatrix($gui->matrix, $args->format); +if ($gui->number_of_not_run_testcases) { + $gui->tableSet[] = buildMatrix($gui->matrix, $args->format); } -if ($platforms_active) -{ - $gui->status_message = sprintf(lang_get('not_run_any_platform_status_msg'), - $gui->number_of_testcases, - $gui->number_of_not_run_testcases); -} -else -{ - $gui->warning_msg = lang_get('not_run_any_platform_no_platforms'); +if ($platforms_active) { + $gui->status_message = sprintf(lang_get('not_run_any_platform_status_msg'), + $gui->number_of_testcases, $gui->number_of_not_run_testcases); +} else { + $gui->warning_msg = lang_get('not_run_any_platform_no_platforms'); } -$smarty = new TLSmarty; -$smarty->assign('gui',$gui); -displayReport($templateCfg->template_dir . $templateCfg->default_template, $smarty, $args->format, $mailCfg); - +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +displayReport($templateCfg->template_dir . $templateCfg->default_template, + $smarty, $args->format, $mailCfg); /** - * * + * @return stdClass */ -function init_args() +function initArgs() { - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->basehref = $_SESSION['basehref']; - + $args->basehref = $_SESSION['basehref']; + return $args; } /** - * * + * @param database $db + * @param tlUser $user + * @return string */ -function checkRights(&$db,&$user) +function checkRights(&$db, &$user) { - return $user->hasRight($db,'testplan_metrics'); + return $user->hasRight($db, 'testplan_metrics'); } /** * Builds ext-js rich table or static HTML table to display matrix results * - * @param $dataSet - * @param $format + * @param unknown $dataSet + * @param unknown $format * @return tlExtTable|tlHTMLTable - * - * */ function buildMatrix($dataSet, $format) { - $columns = array(array('title_key' => 'title_test_suite_name', 'width' => 100), - array('title_key' => 'title_test_case_title', 'width' => 150)); - - if($_SESSION['testprojectOptions']->testPriorityEnabled) - { - $columns[] = array('title_key' => 'priority', 'type' => 'priority', 'width' => 40); - } - - if ($format == FORMAT_HTML) - { - - $matrix = new tlExtTable($columns, $dataSet, 'tl_table_results_tc'); - $matrix->setGroupByColumnName(lang_get('title_test_suite_name')); - $matrix->sortDirection = 'DESC'; - - if($_SESSION['testprojectOptions']->testPriorityEnabled) - { - $matrix->addCustomBehaviour('priority', array('render' => 'priorityRenderer', 'filter' => 'Priority')); - //sort by priority - $matrix->setSortByColumnName(lang_get('priority')); - } else { - //sort by test case - $matrix->setSortByColumnName(lang_get('title_test_case_title')); - } - - //define table toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - - } - else - { - $matrix = new tlHTMLTable($columns, $dataSet, 'tl_table_results_tc'); - } - return $matrix; -} + $columns = array( + array( + 'title_key' => 'title_test_suite_name', + 'width' => 100 + ), + array( + 'title_key' => 'title_test_case_title', + 'width' => 150 + ) + ); + + if ($_SESSION['testprojectOptions']->testPriorityEnabled) { + $columns[] = array( + 'title_key' => 'priority', + 'type' => 'priority', + 'width' => 40 + ); + } + if ($format == FORMAT_HTML) { + + $matrix = new tlExtTable($columns, $dataSet, 'tl_table_results_tc'); + $matrix->setGroupByColumnName(lang_get('title_test_suite_name')); + $matrix->sortDirection = 'DESC'; + + if ($_SESSION['testprojectOptions']->testPriorityEnabled) { + $matrix->addCustomBehaviour('priority', + array( + 'render' => 'priorityRenderer', + 'filter' => 'Priority' + )); + // sort by priority + $matrix->setSortByColumnName(lang_get('priority')); + } else { + // sort by test case + $matrix->setSortByColumnName(lang_get('title_test_case_title')); + } + + // define table toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + } else { + $matrix = new tlHTMLTable($columns, $dataSet, 'tl_table_results_tc'); + } + return $matrix; +} /** - * * + * @param stdClass $guiObj + * @return stdClass */ function buildMailCfg(&$guiObj) { - $labels = array('testplan' => lang_get('testplan'), 'testproject' => lang_get('testproject')); - $cfg = new stdClass(); - $cfg->cc = ''; - $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . $guiObj->tproject_name . - ' : ' . $labels['testplan'] . ' : ' . $guiObj->tplan_name; - - return $cfg; + $labels = array( + 'testplan' => lang_get('testplan'), + 'testproject' => lang_get('testproject') + ); + $cfg = new stdClass(); + $cfg->cc = ''; + $cfg->subject = $guiObj->title . ' : ' . $labels['testproject'] . ' : ' . + $guiObj->tproject_name . ' : ' . $labels['testplan'] . ' : ' . + $guiObj->tplan_name; + + return $cfg; } ?> diff --git a/lib/results/testCasesWithCF.php b/lib/results/testCasesWithCF.php index 5963bb8cb1..b5258b15ca 100644 --- a/lib/results/testCasesWithCF.php +++ b/lib/results/testCasesWithCF.php @@ -1,314 +1,360 @@ -getImages(); - -$templateCfg = templateConfiguration(); -$charset = config_get('charset'); -$labels = init_labels(array('design' => null, 'execution' => null, 'no_linked_tc_cf' => null, - 'execution_history' => null)); - - -$tcase_mgr = new testcase($db); -$args = init_args($db); -$gui = initializeGui($db,$args); - -if( $args->doIt ) -{ - // Get executions with custom field values - buildResultSet($db,$gui,$args->tproject_id,$args->tplan_id); - - // Create column headers - $columns = getColumnsDefinition($args->showPlatforms,$gui->cfields,$args->platforms); - - // Extract the relevant data and build a matrix - $matrixData = array(); - foreach ($gui->resultSet as $item) - { - $rowData = array(); - - // Get test suite path - $dummy = $tcase_mgr->getPathLayered(array($item['tcase_id'])); - $dummy = end($dummy); - $rowData[] = $dummy['value']; - - // create linked icons - $exec_history_link = "" . - " "; - - $exec_link = "tplan_id}, {$item['platform_id']});\">" . - " "; - - $edit_link = "" . - " "; - - $tcaseName = buildExternalIdString($gui->tcasePrefix, $item['tc_external_id']) . ' : ' . $item['tcase_name']; - - $tcLink = "" . $exec_history_link . - $exec_link . $edit_link . $tcaseName; - $rowData[] = $tcLink; - - $rowData[] = $item['tcversion_number']; - if ($args->showPlatforms) - { - $rowData[] = $item['platform_name']; - } - $rowData[] = $item['build_name']; - $rowData[] = $item['tester']; - - // use html comment to be able to sort table by timestamp and not by link - // only link is visible in table but comment is used for sorting - $dummy = null; - $rowData[] = "" . - localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', $item['execution_ts']); - - // Use array for status to get correct rendering and sorting - $rowData[] = array( - 'value' => $item['exec_status'], - 'text' => $gui->status_code_labels[$item['exec_status']], - 'cssClass' => $gui->code_status[$item['exec_status']] . '_text', - ); - - $hasValue = false; - - $rowData[] = strip_tags($item['exec_notes']); - - if($item['exec_notes']) { - $hasValue = true; - } - - foreach ($item['cfields'] as $cf_value) - { - $rowData[] = preg_replace('!\s+!', ' ', htmlspecialchars($cf_value, ENT_QUOTES, $charset));; - if ($cf_value) { - $hasValue = true; - } - } - if ($hasValue) { - $matrixData[] = $rowData; - } - } - - if (count($matrixData) > 0) - { - $table = new tlExtTable($columns, $matrixData, 'tl_table_tc_with_cf'); - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - - $table->setGroupByColumnName(lang_get('build')); - $table->setSortByColumnName(lang_get('date')); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - - $gui->tableSet = array($table); - } - else - { - $gui->warning_msg = $labels['no_linked_tc_cf']; - } +getImages(); + +$templateCfg = templateConfiguration(); +$charset = config_get('charset'); +$labels = init_labels( + array( + 'design' => null, + 'execution' => null, + 'no_linked_tc_cf' => null, + 'execution_history' => null + )); + +$tcaseMgr = new testcase($db); +$args = initArgs($db); +$gui = initializeGui($db, $args); + +if ($args->doIt) { + // Get executions with custom field values + buildResultSet($db, $gui, $args->tproject_id, $args->tplan_id); + + // Create column headers + $columns = getColumnsDefinition($args->showPlatforms, $gui->cfields, + $args->platforms); + + // Extract the relevant data and build a matrix + $matrixData = array(); + foreach ($gui->resultSet as $item) { + $rowData = array(); + + // Get test suite path + $dummy = $tcaseMgr->getPathLayered(array( + $item['tcase_id'] + )); + $dummy = end($dummy); + $rowData[] = $dummy['value']; + + // create linked icons + $exec_history_link = "" . + " "; + + $exec_link = "tplan_id}, {$item['platform_id']});\">" . + " "; + + $edit_link = "" . + " "; + + $tcaseName = buildExternalIdString($gui->tcasePrefix, + $item['tc_external_id']) . ' : ' . $item['tcase_name']; + + $tcLink = "" . + $exec_history_link . $exec_link . $edit_link . $tcaseName; + $rowData[] = $tcLink; + + $rowData[] = $item['tcversion_number']; + if ($args->showPlatforms) { + $rowData[] = $item['platform_name']; + } + $rowData[] = $item['build_name']; + $rowData[] = $item['tester']; + + // use html comment to be able to sort table by timestamp and not by link + // only link is visible in table but comment is used for sorting + $dummy = null; + $rowData[] = "" . + localize_dateOrTimeStamp(null, $dummy, 'timestamp_format', + $item['execution_ts']); + + // Use array for status to get correct rendering and sorting + $rowData[] = array( + 'value' => $item['exec_status'], + 'text' => $gui->status_code_labels[$item['exec_status']], + 'cssClass' => $gui->code_status[$item['exec_status']] . '_text' + ); + + $hasValue = false; + + $rowData[] = strip_tags($item['exec_notes']); + + if ($item['exec_notes']) { + $hasValue = true; + } + + foreach ($item['cfields'] as $cf_value) { + $rowData[] = preg_replace('!\s+!', ' ', + htmlspecialchars($cf_value, ENT_QUOTES, $charset)); + if ($cf_value) { + $hasValue = true; + } + } + if ($hasValue) { + $matrixData[] = $rowData; + } + } + + if (! empty($matrixData)) { + $table = new tlExtTable($columns, $matrixData, 'tl_table_tc_with_cf'); + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + $table->setGroupByColumnName(lang_get('build')); + $table->setSortByColumnName(lang_get('date')); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + + $gui->tableSet = array( + $table + ); + } else { + $gui->warning_msg = $labels['no_linked_tc_cf']; + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs(&$dbHandler) +{ + $argsObj = new stdClass(); + $argsObj->doIt = false; + $argsObj->showPlatforms = false; + $argsObj->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $argsObj->tproject_id = intval($argsObj->tproject_id); + + $argsObj->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + $argsObj->tplan_name = ''; + $argsObj->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : 0; + $argsObj->tplan_id = intval($argsObj->tplan_id); + + if ($argsObj->tplan_id == 0) { + $argsObj->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; + } + + if ($argsObj->tplan_id > 0) { + $tplan_mgr = new testplan($dbHandler); + $tplan_info = $tplan_mgr->get_by_id($argsObj->tplan_id); + $argsObj->tplan_name = $tplan_info['name']; + + $argsObj->doIt = $tplan_mgr->count_testcases($argsObj->tplan_id) > 0; + $argsObj->showPlatforms = $tplan_mgr->hasLinkedPlatforms( + $argsObj->tplan_id); + $getOpt = array( + 'outputFormat' => 'map' + ); + $argsObj->platforms = $tplan_mgr->getPlatforms($argsObj->tplan_id, + $getOpt); + unset($tplan_mgr); + } + + return $argsObj; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->pageTitle = lang_get('caption_testCasesWithCF'); + $guiObj->warning_msg = $guiObj->tcasePrefix = ''; + $guiObj->path_info = $guiObj->resultSet = $guiObj->tableSet = null; + + $guiObj->tproject_name = $argsObj->tproject_name; + $guiObj->tplan_name = $argsObj->tplan_name; + $guiObj->tplan_id = $argsObj->tplan_id; + + $tproject_mgr = new testproject($dbHandler); + $guiObj->tcasePrefix = $tproject_mgr->getTestCasePrefix( + $argsObj->tproject_id); + unset($tproject_mgr); + + // Get the mapping for the Verbose Status Description of Test Case Status + $resultsCfg = config_get('results'); + $guiObj->code_status = $resultsCfg['code_status']; + foreach ($guiObj->code_status as $code => $verbose) { + if (isset($resultsCfg['status_label'][$verbose])) { + $guiObj->status_code_labels[$code] = lang_get( + $resultsCfg['status_label'][$verbose]); + } + } + return $guiObj; +} + +/** + * + * @param database $dbHandler + * @param stdClass $guiObj + * @param int $tproject_id + * @param int $tplan_id + */ +function buildResultSet(&$dbHandler, &$guiObj, $tproject_id, $tplan_id) +{ + $cfieldMgr = new cfield_mgr($dbHandler); + + // Get the custom fields linked/enabled on execution to a test project + // This will be used on report to give name to header of columns that hold custom field value + $guiObj->cfields = $cfieldMgr->get_linked_cfields_at_execution($tproject_id, + 1, 'testcase', null, null, null, 'name'); + + // this way on caller can be used on array operations, without warnings + $guiObj->cfields = (array) $guiObj->cfields; + if (count($guiObj->cfields) > 0) { + foreach ($guiObj->cfields as $key => $values) { + $cf_place_holder['cfields'][$key] = ''; + } + } + + $cf_map = $cfieldMgr->get_linked_cfields_at_execution($tproject_id, 1, + 'testcase', null, null, $tplan_id, 'exec_id'); + + // need to transform in structure that allow easy display + // Every row is an execution with exec data plus a column that contains following map: + // 'cfields' => CFNAME1 => value + // CFNAME2 => value + $guiObj->resultSet = array(); + + if (! is_null($cf_map)) { + foreach ($cf_map as $exec_id => $exec_info) { + // Get common exec info and remove useless keys + $guiObj->resultSet[$exec_id] = $exec_info[0]; + unset($guiObj->resultSet[$exec_id]['name']); + unset($guiObj->resultSet[$exec_id]['label']); + unset($guiObj->resultSet[$exec_id]['display_order']); + unset($guiObj->resultSet[$exec_id]['id']); + unset($guiObj->resultSet[$exec_id]['value']); + + // Collect custom fields values + $guiObj->resultSet[$exec_id] += $cf_place_holder; + foreach ($exec_info as $cfield_data) { + $guiObj->resultSet[$exec_id]['cfields'][$cfield_data['name']] = $cfieldMgr->string_custom_field_value( + $cfield_data, null); + } + } + } + + if (! empty($cf_map) && ($guiObj->row_qty = count($cf_map)) == 0) { + $guiObj->warning_msg = lang_get('no_linked_tc_cf'); + } +} + +/** + * get Columns definition for table to display + * + * @param boolean $showPlatforms + * @param array $customFields + * @param array $platforms + * @return array + */ +function getColumnsDefinition($showPlatforms, $customFields, $platforms) +{ + $colDef = array( + array( + 'title_key' => 'test_suite', + 'width' => 80, + 'type' => 'text' + ), + array( + 'title_key' => 'test_case', + 'width' => 80, + 'type' => 'text' + ), + array( + 'title_key' => 'version', + 'width' => 20 + ) + ); + + if ($showPlatforms) { + $colDef[] = array( + 'title_key' => 'platform', + 'width' => 40, + 'filter' => 'list', + 'filterOptions' => $platforms + ); + } + array_push($colDef, array( + 'title_key' => 'build', + 'width' => 35 + ), array( + 'title_key' => 'th_owner', + 'width' => 60 + ), array( + 'title_key' => 'date', + 'width' => 60 + ), array( + 'title_key' => 'status', + 'type' => 'status', + 'width' => 30 + )); + + $colDef[] = array( + 'title_key' => 'title_execution_notes', + 'type' => 'text' + ); + + foreach ($customFields as $cfield) { + // if custom field is time for computing execution time do not waste space + // $cfield['id'] is used instead of $cfield['name'] to fix the issue regarding dot on CF name + // 20130324 - need to understand if col_id is really needed + // + $dummy = array( + 'title' => $cfield['label'], + 'col_id' => 'id_cf_' . $cfield['id'] + ); + if ($cfield['name'] == 'CF_EXEC_TIME') { + $dummy['width'] = 20; + } else { + $dummy['type'] = 'text'; + } + $colDef[] = $dummy; + } + + return $colDef; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/* - function: - - args : - - returns: - - */ -function init_args(&$dbHandler) -{ - $argsObj = new stdClass(); - $argsObj->doIt = false; - $argsObj->showPlatforms = false; - $argsObj->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $argsObj->tproject_id = intval($argsObj->tproject_id); - - - $argsObj->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - $argsObj->tplan_name = ''; - $argsObj->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : 0; - $argsObj->tplan_id = intval($argsObj->tplan_id); - - if ($argsObj->tplan_id == 0) { - $argsObj->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; - } - - if($argsObj->tplan_id > 0) { - $tplan_mgr = new testplan($dbHandler); - $tplan_info = $tplan_mgr->get_by_id($argsObj->tplan_id); - $argsObj->tplan_name = $tplan_info['name']; - - $argsObj->doIt = $tplan_mgr->count_testcases($argsObj->tplan_id) > 0; - $argsObj->showPlatforms = $tplan_mgr->hasLinkedPlatforms($argsObj->tplan_id); - $getOpt = array('outputFormat' => 'map'); - $argsObj->platforms = $tplan_mgr->getPlatforms($argsObj->tplan_id,$getOpt); - unset($tplan_mgr); - } - - return $argsObj; -} - - - -function initializeGui(&$dbHandler,&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->pageTitle = lang_get('caption_testCasesWithCF'); - $guiObj->warning_msg = $guiObj->tcasePrefix = ''; - $guiObj->path_info = $guiObj->resultSet = $guiObj->tableSet = null; - - $guiObj->tproject_name = $argsObj->tproject_name; - $guiObj->tplan_name = $argsObj->tplan_name; - $guiObj->tplan_id = $argsObj->tplan_id; - - $tproject_mgr = new testproject($dbHandler); - $guiObj->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tproject_id); - unset($tproject_mgr); - - // Get the mapping for the Verbose Status Description of Test Case Status - $resultsCfg = config_get('results'); - $guiObj->code_status = $resultsCfg['code_status']; - foreach($guiObj->code_status as $code => $verbose) - { - if(isset($resultsCfg['status_label'][$verbose])) - { - $guiObj->status_code_labels[$code] = lang_get($resultsCfg['status_label'][$verbose]); - } - } - return $guiObj; -} - - -/** - * - * - */ -function buildResultSet(&$dbHandler,&$guiObj,$tproject_id,$tplan_id) -{ - - $cfieldMgr = new cfield_mgr($dbHandler); - - // Get the custom fields linked/enabled on execution to a test project - // This will be used on report to give name to header of columns that hold custom field value - $guiObj->cfields = $cfieldMgr->get_linked_cfields_at_execution($tproject_id,1,'testcase',null,null,null,'name'); - - // this way on caller can be used on array operations, without warnings - $guiObj->cfields = (array)$guiObj->cfields; - if( count($guiObj->cfields) > 0 ) - { - foreach($guiObj->cfields as $key => $values) - { - $cf_place_holder['cfields'][$key]=''; - } - } - - $cf_map = $cfieldMgr->get_linked_cfields_at_execution($tproject_id,1,'testcase',null,null,$tplan_id,'exec_id'); - - // need to transform in structure that allow easy display - // Every row is an execution with exec data plus a column that contains following map: - // 'cfields' => CFNAME1 => value - // CFNAME2 => value - $guiObj->resultSet = array(); - - if(!is_null($cf_map)) - { - foreach($cf_map as $exec_id => $exec_info) - { - // Get common exec info and remove useless keys - $guiObj->resultSet[$exec_id] = $exec_info[0]; - unset($guiObj->resultSet[$exec_id]['name']); - unset($guiObj->resultSet[$exec_id]['label']); - unset($guiObj->resultSet[$exec_id]['display_order']); - unset($guiObj->resultSet[$exec_id]['id']); - unset($guiObj->resultSet[$exec_id]['value']); - - // Collect custom fields values - $guiObj->resultSet[$exec_id] += $cf_place_holder; - foreach($exec_info as $cfield_data) - { - $guiObj->resultSet[$exec_id]['cfields'][$cfield_data['name']] = $cfieldMgr->string_custom_field_value($cfield_data,null); - } - } - } - - if(($guiObj->row_qty=count($cf_map)) == 0 ) - { - $guiObj->warning_msg = lang_get('no_linked_tc_cf'); - } -} - - -/** - * get Columns definition for table to display - * - */ -function getColumnsDefinition($showPlatforms,$customFields,$platforms) -{ - - $colDef = array(array('title_key' => 'test_suite', 'width' => 80, 'type' => 'text'), - array('title_key' => 'test_case', 'width' => 80, 'type' => 'text'), - array('title_key' => 'version', 'width' => 20)); - - if ($showPlatforms) - { - $colDef[] = array('title_key' => 'platform', 'width' => 40, 'filter' => 'list', 'filterOptions' => $platforms); - } - array_push( $colDef, - array('title_key' => 'build', 'width' => 35), - array('title_key' => 'th_owner', 'width' => 60), - array('title_key' => 'date', 'width' => 60), - array('title_key' => 'status', 'type' => 'status', 'width' => 30)); - - $colDef[] = array('title_key' => 'title_execution_notes', 'type' => 'text'); - - - foreach ($customFields as $cfield) - { - // if custom field is time for computing execution time do not waste space - // $cfield['id'] is used instead of $cfield['name'] to fix the issue regarding dot on CF name - // 20130324 - need to understand if col_id is really needed - // - $dummy = array('title' => $cfield['label'], 'col_id' => 'id_cf_' . $cfield['id']); - if($cfield['name'] == 'CF_EXEC_TIME') - { - $dummy['width'] = 20; - } - else - { - $dummy['type'] = 'text'; - } - $colDef[] = $dummy; - } - - return $colDef; -} - - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/testCasesWithoutTester.php b/lib/results/testCasesWithoutTester.php index b3399517e3..8355f6fcd9 100644 --- a/lib/results/testCasesWithoutTester.php +++ b/lib/results/testCasesWithoutTester.php @@ -1,224 +1,270 @@ -count_testcases($args->tplan_id) > 0) -{ - $platformCache = null; - $msg_key = 'all_testcases_have_tester'; - $cfg = config_get('results'); - - $metricsMgr = new tlTestPlanMetrics($db); - $metrics = $metricsMgr->getNotRunWoTesterAssigned($args->tplan_id,null,null, - array('output' => 'array', 'ignoreBuild' => true)); - - if(($gui->row_qty = count($metrics)) > 0) - { - $msg_key = ''; - $links = featureLinks($gui->labels,$smarty->getImages()); - $gui->pageTitle .= " - " . $gui->labels['match_count'] . ":" . $gui->row_qty; - - - if ($args->show_platforms) - { - $platformCache = $tplan_mgr->getPlatforms($args->tplan_id,array('outputFormat' => 'mapAccessByID')); - } - - // Collect all tcases id and get all test suite paths - $targetSet = array(); - - foreach ($metrics as &$item) - { - $targetSet[] = $item['tcase_id']; - } - $tree_mgr = new tree($db); - $path_info = $tree_mgr->get_full_path_verbose($targetSet); - unset($tree_mgr); - unset($targetSet); - - $data = array(); - foreach ($metrics as &$item) - { - $row = array(); - $row[] = join(" / ", $path_info[$item['tcase_id']]); - - $row[] = "" . - sprintf($links['full'],$item['tcase_id'],$item['tcase_id']) . - $item['full_external_id'] . ': ' . $item['name']; - - if ($args->show_platforms) - { - $row[] = $platformCache[$item['platform_id']]['name']; - } - - if($gui->options->testPriorityEnabled) - { - // THIS HAS TO BE REFACTORED, because we can no do lot of calls - // because performance will be BAD - $row[] = $tplan_mgr->urgencyImportanceToPriorityLevel($item['urg_imp']); - } - - $row[] = strip_tags($item['summary']); - $data[] = $row; - } - - $gui->tableSet[] = buildTable($data, $args->tproject_id, $args->show_platforms, - $gui->options->testPriorityEnabled); - } +count_testcases($args->tplan_id) > 0) { + $platformCache = null; + $msg_key = 'all_testcases_have_tester'; + $cfg = config_get('results'); + + $metricsMgr = new tlTestPlanMetrics($db); + $metrics = $metricsMgr->getNotRunWoTesterAssigned($args->tplan_id, null, + null, array( + 'output' => 'array', + 'ignoreBuild' => true + )); + + if (($gui->row_qty = count($metrics)) > 0) { + $msg_key = ''; + $links = featureLinks($gui->labels, $smarty->getImages()); + $gui->pageTitle .= " - " . $gui->labels['match_count'] . ":" . + $gui->row_qty; + + if ($args->show_platforms) { + $platformCache = $tplan_mgr->getPlatforms($args->tplan_id, + array( + 'outputFormat' => 'mapAccessByID' + )); + } + + // Collect all tcases id and get all test suite paths + $targetSet = array(); + + foreach ($metrics as &$item) { + $targetSet[] = $item['tcase_id']; + } + $tree_mgr = new tree($db); + $path_info = $tree_mgr->get_full_path_verbose($targetSet); + unset($tree_mgr); + unset($targetSet); + + $data = array(); + foreach ($metrics as &$item) { + $row = array(); + $row[] = implode(" / ", $path_info[$item['tcase_id']]); + + $row[] = "" . + sprintf($links['full'], $item['tcase_id'], $item['tcase_id']) . + $item['full_external_id'] . ': ' . $item['name']; + + if ($args->show_platforms) { + $row[] = $platformCache[$item['platform_id']]['name']; + } + + if ($gui->options->testPriorityEnabled) { + // THIS HAS TO BE REFACTORED, because we can no do lot of calls + // because performance will be BAD + $row[] = $tplan_mgr->urgencyImportanceToPriorityLevel( + $item['urg_imp']); + } + + $row[] = strip_tags($item['summary']); + $data[] = $row; + } + + $gui->tableSet[] = buildTable($data, $args->tproject_id, + $args->show_platforms, $gui->options->testPriorityEnabled); + } +} + +$gui->warning_msg = lang_get($msg_key); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @param unknown $data + * @param unknown $tproject_id + * @param unknown $show_platforms + * @param unknown $priorityMgmtEnabled + * @return tlExtTable + */ +function buildTable($data, $tproject_id, $show_platforms, $priorityMgmtEnabled) +{ + $key2search = array( + 'testsuite', + 'testcase', + 'platform', + 'priority', + 'summary' + ); + foreach ($key2search as $key) { + $labels[$key] = lang_get($key); + } + $columns[] = array( + 'title_key' => 'testsuite', + 'width' => 20 + ); + + $columns[] = array( + 'title_key' => 'testcase', + 'width' => 25 + ); + + if ($show_platforms) { + $columns[] = array( + 'title_key' => 'platform', + 'width' => 10 + ); + } + + if ($priorityMgmtEnabled) { + $columns[] = array( + 'title_key' => 'priority', + 'type' => 'priority', + 'width' => 5 + ); + } + + $columns[] = array( + 'title_key' => 'summary', + 'type' => 'text', + 'width' => 40 + ); + + $matrix = new tlExtTable($columns, $data, 'tl_table_tc_without_tester'); + + $matrix->setGroupByColumnName($labels['testsuite']); + $matrix->setSortByColumnName($labels['testcase']); + $matrix->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + if ($priorityMgmtEnabled) { + $matrix->addCustomBehaviour('priority', + array( + 'render' => 'priorityRenderer', + 'filter' => 'Priority' + )); + $matrix->setSortByColumnName($labels['priority']); + } + return $matrix; +} + +/** + * + * @param testplan $tplan_mgr + * @return stdClass + */ +function initArgs(&$tplan_mgr) +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->show_platforms = false; + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + + $args->tplan_name = ''; + if (! $args->tplan_id) { + $args->tplan_id = intval( + isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0); + } + + if ($args->tplan_id > 0) { + $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + $args->tplan_name = $tplan_info['name']; + $args->show_platforms = $tplan_mgr->hasLinkedPlatforms($args->tplan_id); + } + + return $args; +} + +/** + * + * @param unknown $lbl + * @param unknown $img + * @return string[] + */ +function featureLinks($lbl, $img) +{ + $links = array(); + + // %s => test case id + $links['exec_history'] = '' . + ' '; + + // %s => test case id + $links['edit'] = '' . + ' '; + + $links['full'] = $links['exec_history'] . $links['edit']; + return $links; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $gui = new stdClass(); + $gui->pageTitle = lang_get('caption_testCasesWithoutTester'); + $gui->warning_msg = ''; + $gui->tplan_name = $argsObj->tplan_name; + + $mgr = new testproject($dbHandler); + $dummy = $mgr->get_by_id($argsObj->tproject_id); + + $gui->tproject_name = $argsObj->tproject_name = $dummy['name']; + + $gui->options = new stdClass(); + $gui->options->testPriorityEnabled = $dummy['opt']->testPriorityEnabled; + $gui->labels = init_labels( + array( + 'design' => null, + 'execution' => null, + 'execution_history' => null, + 'match_count' => null + )); + + $gui->tableSet = null; + return $gui; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } - -$gui->warning_msg = lang_get($msg_key); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function buildTable($data, $tproject_id, $show_platforms, $priorityMgmtEnabled) -{ - $key2search = array('testsuite','testcase','platform','priority','summary'); - foreach($key2search as $key) - { - $labels[$key] = lang_get($key); - } - $columns[] = array('title_key' => 'testsuite', 'width' => 20); - - $columns[] = array('title_key' => 'testcase', 'width' => 25); - - if ($show_platforms){ - $columns[] = array('title_key' => 'platform', 'width' => 10); - } - - if ($priorityMgmtEnabled) { - $columns[] = array('title_key' => 'priority', 'type' => 'priority', 'width' => 5); - } - - $columns[] = array('title_key' => 'summary', 'type' => 'text', 'width' => 40); - - $matrix = new tlExtTable($columns, $data, 'tl_table_tc_without_tester'); - - $matrix->setGroupByColumnName($labels['testsuite']); - $matrix->setSortByColumnName($labels['testcase']); - $matrix->addCustomBehaviour('text', array('render' => 'columnWrap')); - - if($priorityMgmtEnabled) - { - $matrix->addCustomBehaviour('priority', array('render' => 'priorityRenderer', 'filter' => 'Priority')); - $matrix->setSortByColumnName($labels['priority']); - } - return $matrix; -} - -/* - function: - - args : - - returns: - -*/ -function init_args(&$tplan_mgr) -{ - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $args->show_platforms = false; - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - - $args->tplan_name = ''; - if(!$args->tplan_id) - { - $args->tplan_id = intval(isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0); - } - - if($args->tplan_id > 0) - { - $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - $args->tplan_name = $tplan_info['name']; - $args->show_platforms = $tplan_mgr->hasLinkedPlatforms($args->tplan_id); - } - - return $args; -} - -/** - * - * - */ -function featureLinks($lbl,$img) -{ - $links = array(); - - // %s => test case id - $links['exec_history'] = '' . - ' '; - - // %s => test case id - $links['edit'] = '' . - ' '; - - - $links['full'] = $links['exec_history'] . $links['edit']; - return $links; -} - -/** - * - */ -function initializeGui(&$dbHandler,&$argsObj) -{ - $gui = new stdClass(); - $gui->pageTitle = lang_get('caption_testCasesWithoutTester'); - $gui->warning_msg = ''; - $gui->tplan_name = $argsObj->tplan_name; - - $mgr = new testproject($dbHandler); - $dummy = $mgr->get_by_id($argsObj->tproject_id); - - $gui->tproject_name = $argsObj->tproject_name = $dummy['name']; - - $gui->options = new stdClass(); - $gui->options->testPriorityEnabled = $dummy['opt']->testPriorityEnabled; - $gui->labels = init_labels(array('design' => null, 'execution' => null, 'execution_history' => null, - 'match_count' => null)); - - $gui->tableSet = null; - return $gui; -} - - - - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/testPlanWithCF.php b/lib/results/testPlanWithCF.php index 7838556ad8..fd2f22d6a8 100644 --- a/lib/results/testPlanWithCF.php +++ b/lib/results/testPlanWithCF.php @@ -1,207 +1,222 @@ -getImages(); - -$cfield_mgr = new cfield_mgr($db); -$templateCfg = templateConfiguration(); -$tproject_mgr = new testproject($db); -$tplan_mgr = new testplan($db); -$tcase_mgr = new testcase($db); -$args = init_args($tplan_mgr); - -$gui = new stdClass(); -$gui->warning_msg = ''; -$gui->path_info = $gui->resultSet = $gui->tableSet = null; -$gui->pageTitle = lang_get('caption_testPlanWithCF'); -$gui->tproject_name = $args->tproject_name; -$gui->tplan_name = $args->tplan_name; -$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id); - - -$labels = init_labels(array('design' => null)); -$testCaseSet = array(); - -if($tplan_mgr->count_testcases($args->tplan_id) > 0) -{ - $resultsCfg = config_get('results'); - $tcase_cfg = config_get('testcase_cfg'); - - // ----------------------------------------------------------------------------------- - $gui->code_status = $resultsCfg['code_status']; - - // Get the custom fields linked/enabled on execution to a test project - // This will be used on report to give name to header of columns that hold custom field value - $gui->cfields = $cfield_mgr->get_linked_cfields_at_testplan_design($args->tproject_id,1,'testcase', - null,null,null,'name'); - - if(!is_null($gui->cfields)) - { - foreach($gui->cfields as $key => $values) - { - $cf_place_holder['cfields'][$key] = ''; - } - } - // Now get TPlan -> Test Cases with custom field values - $cf_map = $cfield_mgr->get_linked_cfields_at_testplan_design($args->tproject_id,1,'testcase', - null,null,$args->tplan_id); - // need to transform in structure that allow easy display - // Every row is an execution with exec data plus a column that contains following map: - // 'cfields' => CFNAME1 => value - // CFNAME2 => value - $result = array(); - if(!is_null($cf_map)) - { - foreach($cf_map as $exec_id => $exec_info) - { - // Get common exec info and remove useless keys - $result[$exec_id] = $exec_info[0]; - // Collect custom fields values - $result[$exec_id] += $cf_place_holder; - foreach($exec_info as $cfield_data) - { - $result[$exec_id]['cfields'][$cfield_data['name']]=$cfield_data['value']; - } - } - } - if(($gui->row_qty = count($cf_map)) > 0 ) - { - $gui->warning_msg = ''; - $gui->resultSet = $result; - } else { - $gui->warning_msg = lang_get('no_linked_tplan_cf'); - } -} - -$table = buildExtTable($gui,$tcase_mgr, $tplan_mgr, $args->tplan_id,$labels, $imgSet['edit_icon']); - -if (!is_null($table)) -{ - $gui->tableSet[] = $table; -} -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - * - */ -function buildExtTable($gui,$tcase_mgr,$tplan_mgr, $tplan_id, $labels, $edit_icon) -{ - - $charset = config_get('charset'); - $title_sep = config_get('gui_title_separator_1'); - - $table = null; - if(count($gui->resultSet) > 0) - { - $columns = array(); - $columns[] = array('title_key' => 'test_suite'); - $columns[] = array('title_key' => 'test_case', 'width' => 80, 'type' => 'text'); - - foreach ($gui->cfields as $cfield) - { - $dummy = array('title' => $cfield['label'], 'col_id' => 'id_cf_' . $cfield['name'], 'type' => 'text'); - $columns[] = $dummy; - } - - // Extract the relevant data and build a matrix - $matrixData = array(); - - foreach ($gui->resultSet as $item) - { - $rowData = array(); - - // Get test suite path - $dummy = $tcase_mgr->getPathLayered(array($item['tcase_id'])); - $dummy = end($dummy); - $rowData[] = $dummy['value']; - - $name = buildExternalIdString($gui->tcasePrefix, $item['tc_external_id']) . - $title_sep . $item['tcase_name']; - - // create linked icons - $edit_link = "" . - " "; - - $rowData[] = "" . $edit_link . $name;; - $hasValue = false; - foreach ($item['cfields'] as $cf_value) - { - $rowData[] = preg_replace('!\s+!', ' ', htmlentities($cf_value, ENT_QUOTES, $charset)); - $hasValue = $cf_value ? true : false; - } - - if ($hasValue) - { - $matrixData[] = $rowData; - } - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_tplan_with_cf'); - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - - $table->setGroupByColumnName(lang_get('test_suite')); - $table->setSortByColumnName(lang_get('test_case')); - $table->sortDirection = 'ASC'; - - $table->showToolbar = true; - $table->toolbarExpandCollapseGroupsButton = true; - $table->toolbarShowAllColumnsButton = true; - } - return($table); -} - -/* - function: - - args : - - returns: - - */ -function init_args(&$tplan_mgr) -{ - $iParams = array("format" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - $args->tplan_name = ''; - if(!$args->tplan_id) - { - $args->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; - } - - if($args->tplan_id > 0) - { - $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); - $args->tplan_name = $tplan_info['name']; - } - return $args; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRightOnProj($db,'testplan_metrics'); +getImages(); + +$cfield_mgr = new cfield_mgr($db); +$templateCfg = templateConfiguration(); +$tproject_mgr = new testproject($db); +$tplan_mgr = new testplan($db); +$tcaseMgr = new testcase($db); +$args = initArgs($tplan_mgr); + +$gui = new stdClass(); +$gui->warning_msg = ''; +$gui->path_info = $gui->resultSet = $gui->tableSet = null; +$gui->pageTitle = lang_get('caption_testPlanWithCF'); +$gui->tproject_name = $args->tproject_name; +$gui->tplan_name = $args->tplan_name; +$gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id); + +$labels = init_labels(array( + 'design' => null +)); +$testCaseSet = array(); + +if ($tplan_mgr->count_testcases($args->tplan_id) > 0) { + $resultsCfg = config_get('results'); + $tcase_cfg = config_get('testcase_cfg'); + + // ----------------------------------------------------------------------------------- + $gui->code_status = $resultsCfg['code_status']; + + // Get the custom fields linked/enabled on execution to a test project + // This will be used on report to give name to header of columns that hold custom field value + $gui->cfields = $cfield_mgr->get_linked_cfields_at_testplan_design( + $args->tproject_id, 1, 'testcase', null, null, null, 'name'); + + if (! is_null($gui->cfields)) { + foreach ($gui->cfields as $key => $values) { + $cf_place_holder['cfields'][$key] = ''; + } + } + // Now get TPlan -> Test Cases with custom field values + $cf_map = $cfield_mgr->get_linked_cfields_at_testplan_design( + $args->tproject_id, 1, 'testcase', null, null, $args->tplan_id); + // need to transform in structure that allow easy display + // Every row is an execution with exec data plus a column that contains following map: + // 'cfields' => CFNAME1 => value + // CFNAME2 => value + $result = array(); + if (! is_null($cf_map)) { + foreach ($cf_map as $exec_id => $exec_info) { + // Get common exec info and remove useless keys + $result[$exec_id] = $exec_info[0]; + // Collect custom fields values + $result[$exec_id] += $cf_place_holder; + foreach ($exec_info as $cfield_data) { + $result[$exec_id]['cfields'][$cfield_data['name']] = $cfield_data['value']; + } + } + } + if ($gui->row_qty = ! empty($cf_map)) { + $gui->warning_msg = ''; + $gui->resultSet = $result; + } else { + $gui->warning_msg = lang_get('no_linked_tplan_cf'); + } +} + +$table = buildExtTable($gui, $tcaseMgr, $labels, $imgSet['edit_icon']); + +if (! is_null($table)) { + $gui->tableSet[] = $table; +} +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @param stdClass $gui + * @param testcase $tcaseMgr + * @param array $labels + * @param string $edit_icon + * @return tlExtTable + */ +function buildExtTable($gui, $tcaseMgr, $labels, $edit_icon) +{ + $charset = config_get('charset'); + $title_sep = config_get('gui_title_separator_1'); + + $table = null; + if (! empty($gui->resultSet)) { + $columns = array(); + $columns[] = array( + 'title_key' => 'test_suite' + ); + $columns[] = array( + 'title_key' => 'test_case', + 'width' => 80, + 'type' => 'text' + ); + + foreach ($gui->cfields as $cfield) { + $dummy = array( + 'title' => $cfield['label'], + 'col_id' => 'id_cf_' . $cfield['name'], + 'type' => 'text' + ); + $columns[] = $dummy; + } + + // Extract the relevant data and build a matrix + $matrixData = array(); + + foreach ($gui->resultSet as $item) { + $rowData = array(); + + // Get test suite path + $dummy = $tcaseMgr->getPathLayered(array( + $item['tcase_id'] + )); + $dummy = end($dummy); + $rowData[] = $dummy['value']; + + $name = buildExternalIdString($gui->tcasePrefix, + $item['tc_external_id']) . $title_sep . $item['tcase_name']; + + // create linked icons + $edit_link = "" . + " "; + + $rowData[] = "" . $edit_link . $name; + $hasValue = false; + foreach ($item['cfields'] as $cf_value) { + $rowData[] = preg_replace('!\s+!', ' ', + htmlentities($cf_value, ENT_QUOTES, $charset)); + $hasValue = $cf_value ? true : false; + } + + if ($hasValue) { + $matrixData[] = $rowData; + } + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_tplan_with_cf'); + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + + $table->setGroupByColumnName(lang_get('test_suite')); + $table->setSortByColumnName(lang_get('test_case')); + $table->sortDirection = 'ASC'; + + $table->showToolbar = true; + $table->toolbarExpandCollapseGroupsButton = true; + $table->toolbarShowAllColumnsButton = true; + } + + return $table; +} + +/** + * + * @param testplan $tplan_mgr + * @return stdClass + */ +function initArgs(&$tplan_mgr) +{ + $iParams = array( + "format" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + $args->tplan_name = ''; + if (! $args->tplan_id) { + $args->tplan_id = isset($_SESSION['testplanID']) ? $_SESSION['testplanID'] : 0; + } + + if ($args->tplan_id > 0) { + $tplan_info = $tplan_mgr->get_by_id($args->tplan_id); + $args->tplan_name = $tplan_info['name']; + } + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRightOnProj($db, 'testplan_metrics'); } diff --git a/lib/results/topLevelSuitesBarChart.php b/lib/results/topLevelSuitesBarChart.php index 7dd6bce27e..66d541dd1c 100644 --- a/lib/results/topLevelSuitesBarChart.php +++ b/lib/results/topLevelSuitesBarChart.php @@ -1,162 +1,165 @@ -scale = new stdClass(); - -$chart_cfg = config_get('results'); -$chart_cfg = $chart_cfg['charts']['dimensions']['topLevelSuitesBarChart']; - -$cfg->chartTitle = lang_get($chart_cfg['chartTitle']); -$cfg->XSize = $chart_cfg['XSize']; -$cfg->YSize = $chart_cfg['YSize']; -$cfg->beginX = $chart_cfg['beginX']; -$cfg->beginY = $chart_cfg['beginY']; -$cfg->scale->legendXAngle = $chart_cfg['legendXAngle']; - -$args = init_args($db); -$info = getDataAndScale($db,$args); -if( property_exists($args,'debug') ) -{ - new dBug($info); - die(); +scale = new stdClass(); + +$chart_cfg = config_get('results'); +$chart_cfg = $chart_cfg['charts']['dimensions']['topLevelSuitesBarChart']; + +$cfg->chartTitle = lang_get($chart_cfg['chartTitle']); +$cfg->XSize = $chart_cfg['XSize']; +$cfg->YSize = $chart_cfg['YSize']; +$cfg->beginX = $chart_cfg['beginX']; +$cfg->beginY = $chart_cfg['beginY']; +$cfg->scale->legendXAngle = $chart_cfg['legendXAngle']; + +$args = initArgs($db); +$info = getDataAndScale($db, $args); +if (property_exists($args, 'debug')) { + new dBug($info); + die(); +} +createChart($info, $cfg); + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function getDataAndScale(&$dbHandler, $argsObj) +{ + $obj = new stdClass(); + $totals = null; + $resultsCfg = config_get('results'); + $metricsMgr = new tlTestPlanMetrics($dbHandler); + + $dataSet = $metricsMgr->getRootTestSuites($argsObj->tplan_id, + $argsObj->tproject_id); + $dummy = $metricsMgr->getStatusTotalsByTopLevelTestSuiteForRender( + $argsObj->tplan_id); + $obj->canDraw = ! is_null($dummy->info); + + if (property_exists($argsObj, 'debug')) { + new dBug($dummy->info); + } + + if ($obj->canDraw) { + // // Process to enable alphabetical order + $item_descr = array_flip($dataSet); + ksort($item_descr); + foreach ($item_descr as $name => $tsuite_id) { + if (isset($dummy->info[$tsuite_id])) { + $items[] = htmlspecialchars($name); + $rmap = $dummy->info[$tsuite_id]['details']; + foreach ($rmap as $key => $value) { + $totals[$key][] = $value['qty']; + } + } else { + // make things work, but create log this is not ok + tlog( + __FILE__ . '::' . __FUNCTION__ . 'Missing item: name/id:' . + "$name/$tsuite_id", 'DEBUG'); + } + } + } + + $obj->xAxis = new stdClass(); + $obj->xAxis->values = $items; + $obj->xAxis->serieName = 'Serie8'; + $obj->series_color = null; + + foreach ($totals as $status => $values) { + $obj->chart_data[] = $values; + $obj->series_label[] = lang_get($resultsCfg['status_label'][$status]); + if (isset($resultsCfg['charts']['status_colour'][$status])) { + $obj->series_color[] = $resultsCfg['charts']['status_colour'][$status]; + } + } + + return $obj; +} + +/** + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + 0, + 64 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + if (! is_null($args->apikey)) { + $cerbero = new stdClass(); + $cerbero->args = new stdClass(); + $cerbero->args->tproject_id = $args->tproject_id; + $cerbero->args->tplan_id = $args->tplan_id; + + if (strlen($args->apikey) == 32) { + $cerbero->args->getAccessAttr = true; + $cerbero->method = 'checkRights'; + $cerbero->redirect_target = "../../login.php?note=logout"; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, $cerbero); + } else { + $args->addOpAccess = false; + $cerbero->method = null; + $cerbero->args->getAccessAttr = false; + setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $cerbero); + } + } else { + testlinkInitPage($dbHandler, false, false, "checkRights"); + } + + if (isset($_REQUEST['debug'])) { + $args->debug = 'yes'; + } + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); } -createChart($info,$cfg); - - -/* - function: getDataAndScale - - args : - - returns: - -*/ -function getDataAndScale(&$dbHandler,$argsObj) -{ - $obj = new stdClass(); - $totals = null; - $resultsCfg = config_get('results'); - $metricsMgr = new tlTestPlanMetrics($dbHandler); - - $dataSet = $metricsMgr->getRootTestSuites($argsObj->tplan_id,$argsObj->tproject_id); - $dummy = $metricsMgr->getStatusTotalsByTopLevelTestSuiteForRender($argsObj->tplan_id); - $obj->canDraw = !is_null($dummy->info); - - if( property_exists($argsObj,'debug') ) - { - new dBug($dummy->info); - } - - if($obj->canDraw) - { - //// Process to enable alphabetical order - $item_descr = array_flip($dataSet); - ksort($item_descr); - foreach($item_descr as $name => $tsuite_id) - { - if( isset($dummy->info[$tsuite_id]) ) - { - $items[]=htmlspecialchars($name); - $rmap = $dummy->info[$tsuite_id]['details']; - foreach($rmap as $key => $value) - { - $totals[$key][]=$value['qty']; - } - } - else - { - // make things work, but create log this is not ok - tlog(__FILE__ . '::' . __FUNCTION__ . 'Missing item: name/id:' . - "$name/$tsuite_id", 'DEBUG'); - } - } - } - - $obj->xAxis = new stdClass(); - $obj->xAxis->values = $items; - $obj->xAxis->serieName = 'Serie8'; - $obj->series_color = null; - - foreach($totals as $status => $values) - { - $obj->chart_data[] = $values; - $obj->series_label[] = lang_get($resultsCfg['status_label'][$status]); - if( isset($resultsCfg['charts']['status_colour'][$status]) ) - { - $obj->series_color[] = $resultsCfg['charts']['status_colour'][$status]; - } - } - - return $obj; -} - -/** - * - */ -function init_args(&$dbHandler) -{ - $iParams = array("apikey" => array(tlInputParameter::STRING_N,0,64), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - if( !is_null($args->apikey) ) - { - $cerbero = new stdClass(); - $cerbero->args = new stdClass(); - $cerbero->args->tproject_id = $args->tproject_id; - $cerbero->args->tplan_id = $args->tplan_id; - - if(strlen($args->apikey) == 32) - { - $cerbero->args->getAccessAttr = true; - $cerbero->method = 'checkRights'; - $cerbero->redirect_target = "../../login.php?note=logout"; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,$cerbero); - } - else - { - $args->addOpAccess = false; - $cerbero->method = null; - $cerbero->args->getAccessAttr = false; - setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$cerbero); - } - } - else - { - testlinkInitPage($dbHandler,false,false,"checkRights"); - // $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - - if( isset($_REQUEST['debug']) ) - { - $args->debug = 'yes'; - } - return $args; -} - -/** - * - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} \ No newline at end of file diff --git a/lib/results/uncoveredTestCases.php b/lib/results/uncoveredTestCases.php index ae43798223..bfb2d929bf 100644 --- a/lib/results/uncoveredTestCases.php +++ b/lib/results/uncoveredTestCases.php @@ -1,123 +1,135 @@ -getOptionReqSpec($args->tproject_id); -$reqSpec = $tproject_mgr->genComboReqSpec($args->tproject_id); -$uncovered = null; -$gui = new stdClass(); -$gui->items = null; -$gui->tproject_name = $args->tproject_name; -$gui->has_reqspec = count($reqSpec) > 0; -$gui->has_requirements = false; -$gui->has_tc = false; - -if($gui->has_reqspec) -{ - // Check if at least one of these requirement spec are not empty. - $reqSpecMgr = new requirement_spec_mgr($db); - foreach($reqSpec as $reqSpecID => $name) - { - if($gui->has_requirements = ($reqSpecMgr->get_requirements_count($reqSpecID) > 0)) - break; - } - unset($reqSpecMgr); -} -if($gui->has_requirements) -{ - // get all test cases id (active/inactive) in test project - $tcasesID = null; - $tproject_mgr->get_all_testcases_id($args->tproject_id,$tcasesID); - - if(!is_null($tcasesID) && count($tcasesID) > 0) - { - $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . ' - '; - $sql = " /* $debugMsg */ " . - " SELECT NHA.id AS tc_id, NHA.name, NHA.parent_id AS testsuite_id," . - " NT.description, REQC.req_id " . - " FROM {$tables['nodes_hierarchy']} NHA " . - " JOIN {$tables['node_types']} NT ON NHA.node_type_id=NT.id " . - " LEFT OUTER JOIN {$tables['req_coverage']} REQC on REQC.testcase_id=NHA.id " . - " WHERE NT.description='testcase' AND NHA.id IN (" . implode(",",$tcasesID) . ") " . - " and REQC.req_id IS NULL " ; - $uncovered = $db->fetchRowsIntoMap($sql,'tc_id'); - } -} - - -if($gui->has_tc = (!is_null($uncovered) && count($uncovered) > 0) ) -{ - // Get external ID - $testSet = array_keys($uncovered); - $inClause = implode(',',$testSet); - $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . ' - '; - $sql = "/* $debugMsg */ " . - " SELECT distinct NHA.id AS tc_id, TCV.tc_external_id " . - " FROM {$tables['nodes_hierarchy']} NHA, " . - " {$tables['nodes_hierarchy']} NHB, " . - " {$tables['tcversions']} TCV, {$tables['node_types']} NT " . - " WHERE NHA.node_type_id=NT.id AND NHA.id=NHB.parent_id AND NHB.id=TCV.id " . - " AND NHA.id IN ({$inClause}) AND NT.description='testcase' "; - $external_id = $db->fetchRowsIntoMap($sql,'tc_id'); - foreach($external_id as $key => $value) - { - $uncovered[$key]['external_id'] = $value['tc_external_id']; - } - // $out = gen_spec_view($db,'uncoveredtestcases',$args->tproject_id,$args->tproject_id,null, - // $uncovered,null,null,$testSet,1,0,0); - $opt = array('write_button_only_if_linked' => 1); - $filters = array('testcases' => $testSet); - $out = gen_spec_view($db,'uncoveredtestcases',$args->tproject_id,$args->tproject_id,null, - $uncovered,null,$filters,$opt); - - $gui->items = $out['spec_view']; -} - -$tcase_cfg = config_get('testcase_cfg'); -$gui->pageTitle = lang_get('report_testcases_without_requirement'); -$gui->testCasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id); -$gui->testCasePrefix .= $tcase_cfg->glue_character; - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -function init_args() -{ - $args = new stdClass(); - $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; - - return $args; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'testplan_metrics'); -} -?> \ No newline at end of file +getOptionReqSpec($args->tproject_id); +$reqSpec = $tproject_mgr->genComboReqSpec($args->tproject_id); +$uncovered = null; +$gui = new stdClass(); +$gui->items = null; +$gui->tproject_name = $args->tproject_name; +$gui->has_reqspec = count($reqSpec) > 0; +$gui->has_requirements = false; +$gui->has_tc = false; + +if ($gui->has_reqspec) { + // Check if at least one of these requirement spec are not empty. + $reqSpecMgr = new requirement_spec_mgr($db); + foreach ($reqSpec as $reqSpecID => $name) { + if ($gui->has_requirements = ($reqSpecMgr->get_requirements_count( + $reqSpecID) > 0)) { + break; + } + } + unset($reqSpecMgr); +} +if ($gui->has_requirements) { + // get all test cases id (active/inactive) in test project + $tcasesID = null; + $tproject_mgr->get_all_testcases_id($args->tproject_id, $tcasesID); + + if (! is_null($tcasesID) && count($tcasesID) > 0) { + $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . + ' - '; + $sql = " /* $debugMsg */ " . + " SELECT NHA.id AS tc_id, NHA.name, NHA.parent_id AS testsuite_id," . + " NT.description, REQC.req_id " . + " FROM {$tables['nodes_hierarchy']} NHA " . + " JOIN {$tables['node_types']} NT ON NHA.node_type_id=NT.id " . + " LEFT OUTER JOIN {$tables['req_coverage']} REQC on REQC.testcase_id=NHA.id " . + " WHERE NT.description='testcase' AND NHA.id IN (" . + implode(",", $tcasesID) . ") " . " and REQC.req_id IS NULL "; + $uncovered = $db->fetchRowsIntoMap($sql, 'tc_id'); + } +} + +if ($gui->has_tc = (! is_null($uncovered) && ! empty($uncovered))) { + // Get external ID + $testSet = array_keys($uncovered); + $inClause = implode(',', $testSet); + $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . ' - '; + $sql = "/* $debugMsg */ " . + " SELECT distinct NHA.id AS tc_id, TCV.tc_external_id " . + " FROM {$tables['nodes_hierarchy']} NHA, " . + " {$tables['nodes_hierarchy']} NHB, " . + " {$tables['tcversions']} TCV, {$tables['node_types']} NT " . + " WHERE NHA.node_type_id=NT.id AND NHA.id=NHB.parent_id AND NHB.id=TCV.id " . + " AND NHA.id IN ({$inClause}) AND NT.description='testcase' "; + $external_id = $db->fetchRowsIntoMap($sql, 'tc_id'); + foreach ($external_id as $key => $value) { + $uncovered[$key]['external_id'] = $value['tc_external_id']; + } + $opt = array( + 'write_button_only_if_linked' => 1 + ); + $filters = array( + 'testcases' => $testSet + ); + $out = gen_spec_view($db, 'uncoveredtestcases', $args->tproject_id, + $args->tproject_id, null, $uncovered, null, $filters, $opt); + + $gui->items = $out['spec_view']; +} + +$tcase_cfg = config_get('testcase_cfg'); +$gui->pageTitle = lang_get('report_testcases_without_requirement'); +$gui->testCasePrefix = $tproject_mgr->getTestCasePrefix($args->tproject_id); +$gui->testCasePrefix .= $tcase_cfg->glue_character; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $args = new stdClass(); + $args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : ''; + + return $args; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'testplan_metrics'); +} +?> diff --git a/lib/search/search.php b/lib/search/search.php index 875d6c9679..a11845d86a 100644 --- a/lib/search/search.php +++ b/lib/search/search.php @@ -1,438 +1,476 @@ -initEnv(); - -$args = $cmdMgr->getArgs(); -$gui = $cmdMgr->getGui(); -$cmdMgr->initSchema(); -$treeMgr = new tree($db); -$cfieldMgr = new cfield_mgr($db); - - -$targetSet = cleanUpTarget($db,$args->target); -$canUseTarget = (count($targetSet) > 0); - -if($args->oneCheck == false) { - $gui->caller = 'search'; - $smarty->assign('gui',$gui); - $smarty->display($templateCfg->template_dir . $tpl); - exit(); -} - -if($canUseTarget == false && $args->oneValueOK == false) { - $smarty->assign('gui',$gui); - $smarty->display($templateCfg->template_dir . $tpl); - exit(); -} - -// Processing -$map = null; - -// CF belongs to ? -$tc_cf_id = null; -$req_cf_id = null; -if( $args->custom_field_id > 0) { - if ( isset( $gui->design_cf_tc[$args->custom_field_id] ) ) { - $tc_cf_id = $args->custom_field_id; - } - - if ( isset( $gui->design_cf_req[$args->custom_field_id] ) ) { - $req_cf_id = $args->custom_field_id; - } -} - -$args->reqType = null; -if($args->reqType != '') { - $args->reqType = str_replace('RQ','', $args->reqTypes); -} - -if( ($args->tproject_id > 0) && $args->doAction == 'doSearch') { - $tables = $cmdMgr->getTables(); - $views = $cmdMgr->getViews(); - - $from = array('by_keyword_id' => ' ', 'by_custom_field' => ' ', - 'by_requirement_doc_id' => '', 'users' => ''); - $tcaseID = null; - - $emptyTestProject = true; - - // Need to get all test cases to filter - $tcaseSet = $cmdMgr->getTestCaseIDSet($args->tproject_id); -} - - -$mapTC = null; -$mapTS = null; -$mapRS = null; -$mapRQ = null; - -// Search on Test Suites -if( $canUseTarget && ($args->ts_summary || $args->ts_title) ) { - $mapTS = $cmdMgr->searchTestSuites($targetSet,$canUseTarget); -} - -// Requirment SPECification -if( $canUseTarget && ($args->rs_scope || $args->rs_title) ) { - $mapRS = $cmdMgr->searchReqSpec($targetSet,$canUseTarget); -} - -// REQuirements -if( $args->rq_scope || $args->rq_title || $args->rq_doc_id || ($req_cf_id > 0) ) { - $mapRQ = $cmdMgr->searchReq($targetSet,$canUseTarget,$req_cf_id); -} - - -$hasTestCases = (!is_null($tcaseSet) && count($tcaseSet) > 0); -if( $hasTestCases ) { - $emptyTestProject = false; - $mapTC = $cmdMgr->searchTestCases($tcaseSet,$targetSet,$canUseTarget,$tc_cf_id); -} - -// Render Results -if( !is_null($mapTC) ) { - $tcase_mgr = new testcase($db); - $tcase_set = array_keys($mapTC); - $options = array('output_format' => 'path_as_string'); - $gui->path_info = $treeMgr->get_full_path_verbose($tcase_set, $options); - $gui->resultSet = $mapTC; -} else if ($emptyTestProject) { - $gui->warning_msg = lang_get('empty_testproject'); -} else { - $gui->warning_msg = lang_get('no_records_found'); -} - -$img = $smarty->getImages(); -$table = buildTCExtTable($gui, $charset, $img['edit_icon'], $img['history_small']); - -if (!is_null($table)) { - $gui->tableSet[] = $table; -} - -$table = null; -if( !is_null($mapTS)) { - $gui->resultTestSuite = $mapTS; - $table = buildTSExtTable($gui, $charset, $img['edit_icon'], $img['history_small']); -} - -$gui->warning_msg = ''; -if(!is_null($table)) { - $gui->tableSet[] = $table; -} - -$table = null; -if( !is_null($mapRS)) { - $gui->resultReqSpec = $mapRS; - $table = buildRSExtTable($gui, $charset, $img['edit_icon'], $img['history_small']); -} - -$gui->warning_msg = ''; -if(!is_null($table)) { - $gui->tableSet[] = $table; -} - -$table = null; -if( !is_null($mapRQ)) { - $gui->resultReq = $mapRQ; - $req_set = array_keys($mapRQ); - $options = array('output_format' => 'path_as_string'); - $gui->path_info = $treeMgr->get_full_path_verbose($req_set,$options); - - $table = buildRQExtTable($gui, $charset); -} - -$gui->warning_msg = ''; -if(!is_null($table)) { - $gui->tableSet[] = $table; -} - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $tpl); - - -/** - * - * - */ -function buildTCExtTable($gui, $charset, $edit_icon, $history_icon) { - $table = null; - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - if(count((array)$gui->resultSet) > 0) { - $labels = array('test_suite' => lang_get('test_suite'), 'test_case' => lang_get('test_case')); - $columns = array(); - - $columns[] = array('title_key' => 'test_suite'); - $columns[] = array('title_key' => 'test_case', 'type' => 'text'); - - $columns[] = array('title_key' => 'summary'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - $titleSeparator = config_get('gui_title_separator_1'); - - foreach($gui->resultSet as $result) - { - $rowData = array(); - $rowData[] = htmlentities($gui->path_info[$result['testcase_id']], ENT_QUOTES, $charset); - - // build test case link - $history_link = "" . - " "; - $edit_link = "" . - " "; - $tcaseName = htmlentities($gui->tcasePrefix, ENT_QUOTES, $charset) . $result['tc_external_id'] . - " [v" . $result['version'] . "]" . $titleSeparator . - htmlentities($result['name'], ENT_QUOTES, $charset); - - $rowData[] = $history_link . $edit_link . $tcaseName; - $rowData[] = ($designType == 'none' ? nl2br($result['summary']) : $result['summary']); - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_test_case_search'); - - $table->setGroupByColumnName($labels['test_suite']); - $table->setSortByColumnName($labels['test_case']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - $table->storeTableState = false; - } - return($table); -} - -/** - * - * - */ -function buildTSExtTable($gui, $charset, $edit_icon, $history_icon) -{ - $table = null; - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - if(count($gui->resultTestSuite) > 0) - { - $labels = array('test_suite' => lang_get('test_suite'), - 'details' => lang_get('details')); - $columns = array(); - - $columns[] = array('title_key' => 'test_suite', 'type' => 'text'); - $columns[] = array('title_key' => 'details'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - foreach($gui->resultTestSuite as $result) - { - $edit_link = "" . - " "; - - $rowData = array(); - - $rowData[] = $edit_link . htmlentities($result['name'], ENT_QUOTES, $charset); - - $rowData[] = ($designType == 'none' ? nl2br($result['details']) : $result['details']); - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_test_suite_search'); - - $table->setSortByColumnName($labels['test_suite']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - $table->storeTableState = false; - } - return $table; -} - -/** - * - * - */ -function buildRSExtTable($gui, $charset, $edit_icon, $history_icon) -{ - $table = null; - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - if(count($gui->resultReqSpec) > 0) - { - $labels = array('req_spec' => lang_get('req_spec'), - 'scope' => lang_get('scope')); - $columns = array(); - - $columns[] = array('title_key' => 'req_spec', 'type' => 'text'); - $columns[] = array('title_key' => 'scope'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - foreach($gui->resultReqSpec as $result) - { - $edit_link = "" . - " "; - - $rowData = array(); - - $rowData[] = $edit_link . - htmlentities($result['name'] . "[r{$result['revision']}]", ENT_QUOTES, $charset); - - $rowData[] = ($designType == 'none' ? nl2br($result['scope']) : $result['scope']); - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_req_spec_search'); - - $table->setSortByColumnName($labels['req_spec']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - $table->storeTableState = false; - } - return $table; -} - - - -/** - * - * - */ -function buildRQExtTable($gui, $charset) -{ - $table = null; - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - $lbl = array('edit' => 'requirement', 'req_spec' => 'req_spec', - 'requirement' => 'requirement','scope' => 'scope', - 'version_revision_tag' => 'version_revision_tag'); - - $labels = init_labels($lbl); - $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; - - if(count($gui->resultReq) > 0) - { - $columns = array(); - - $columns[] = array('title_key' => 'req_spec'); - $columns[] = array('title_key' => 'requirement', 'type' => 'text'); - - $columns[] = array('title_key' => 'scope'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - $key2loop = array_keys($gui->resultReq); - $img = ""; - $reqVerHref = '' . $labels['version_revision_tag'] . ' '; - $reqRevHref = '' . $labels['version_revision_tag'] . ' '; - - foreach($key2loop as $req_id) - { - $rowData = array(); - $itemSet = $gui->resultReq[$req_id]; - $rfx = $itemSet; - - // We Group by Requirement path - $rowData[] = htmlentities($gui->path_info[$rfx['req_id']], ENT_QUOTES, $charset); - - $edit_link = "" . "{$img} "; - $title = htmlentities($rfx['req_doc_id'], ENT_QUOTES, $charset) . ":" . - htmlentities($rfx['name'], ENT_QUOTES, $charset); - - $matches = ''; - $rowData[] = $edit_link . $title . ' ' . $matches; - $rowData[] = ($designType == 'none' ? nl2br($rfx['scope']) : $rfx['scope']); - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_req_search'); - - $table->setGroupByColumnName($labels['req_spec']); - $table->setSortByColumnName($labels['requirement']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - $table->storeTableState = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - } - return($table); -} - - - - -/** - * - */ -function cleanUpTarget(&$dbHandler,$target) -{ - $s = preg_replace("/ {2,}/", " ", $target); - $theSet = explode(' ',$s); - $targetSet = array(); - foreach($theSet as $idx => $val) - { - if(trim($val) != '') - { - $targetSet[] = $dbHandler->prepare_string($val); - } - } - return $targetSet; +initEnv(); + +$args = $cmdMgr->getArgs(); +$gui = $cmdMgr->getGui(); +$cmdMgr->initSchema(); +$treeMgr = new tree($db); +$cfieldMgr = new cfield_mgr($db); + +$targetSet = cleanUpTarget($db, $args->target); +$canUseTarget = (count($targetSet) > 0); + +if (! $args->oneCheck) { + $gui->caller = 'search'; + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . $tpl); + exit(); +} + +if (! $canUseTarget && ! $args->oneValueOK) { + $smarty->assign('gui', $gui); + $smarty->display($templateCfg->template_dir . $tpl); + exit(); +} + +// Processing +$map = null; + +// CF belongs to ? +$tc_cf_id = null; +$req_cf_id = null; +if ($args->custom_field_id > 0) { + if (isset($gui->design_cf_tc[$args->custom_field_id])) { + $tc_cf_id = $args->custom_field_id; + } + + if (isset($gui->design_cf_req[$args->custom_field_id])) { + $req_cf_id = $args->custom_field_id; + } +} + +$args->reqType = null; +if ($args->reqType != '') { + $args->reqType = str_replace('RQ', '', $args->reqTypes); +} + +if (($args->tproject_id > 0) && $args->doAction == 'doSearch') { + $tables = $cmdMgr->getTables(); + $views = $cmdMgr->getViews(); + + $from = array( + 'by_keyword_id' => ' ', + 'by_custom_field' => ' ', + 'by_requirement_doc_id' => '', + 'users' => '' + ); + $tcaseID = null; + + $emptyTestProject = true; + + // Need to get all test cases to filter + $tcaseSet = $cmdMgr->getTestCaseIDSet($args->tproject_id); +} + +$mapTC = null; +$mapTS = null; +$mapRS = null; +$mapRQ = null; + +// Search on Test Suites +if ($canUseTarget && ($args->ts_summary || $args->ts_title)) { + $mapTS = $cmdMgr->searchTestSuites($targetSet, $canUseTarget); +} + +// Requirment SPECification +if ($canUseTarget && ($args->rs_scope || $args->rs_title)) { + $mapRS = $cmdMgr->searchReqSpec($targetSet, $canUseTarget); +} + +// REQuirements +if ($args->rq_scope || $args->rq_title || $args->rq_doc_id || ($req_cf_id > 0)) { + $mapRQ = $cmdMgr->searchReq($targetSet, $canUseTarget, $req_cf_id); +} + +$hasTestCases = (! is_null($tcaseSet) && count($tcaseSet) > 0); +if ($hasTestCases) { + $emptyTestProject = false; + $mapTC = $cmdMgr->searchTestCases($tcaseSet, $targetSet, $canUseTarget, + $tc_cf_id); +} + +// Render Results +if (! is_null($mapTC)) { + $tcaseMgr = new testcase($db); + $tcase_set = array_keys($mapTC); + $options = array( + 'output_format' => 'path_as_string' + ); + $gui->path_info = $treeMgr->get_full_path_verbose($tcase_set, $options); + $gui->resultSet = $mapTC; +} elseif ($emptyTestProject) { + $gui->warning_msg = lang_get('empty_testproject'); +} else { + $gui->warning_msg = lang_get('no_records_found'); +} + +$img = $smarty->getImages(); +$table = buildTCExtTable($gui, $charset, $img['edit_icon'], + $img['history_small']); + +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$table = null; +if (! is_null($mapTS)) { + $gui->resultTestSuite = $mapTS; + $table = buildTSExtTable($gui, $charset, $img['edit_icon']); +} + +$gui->warning_msg = ''; +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$table = null; +if (! is_null($mapRS)) { + $gui->resultReqSpec = $mapRS; + $table = buildRSExtTable($gui, $charset, $img['edit_icon']); +} + +$gui->warning_msg = ''; +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$table = null; +if (! is_null($mapRQ)) { + $gui->resultReq = $mapRQ; + $req_set = array_keys($mapRQ); + $options = array( + 'output_format' => 'path_as_string' + ); + $gui->path_info = $treeMgr->get_full_path_verbose($req_set, $options); + + $table = buildRQExtTable($gui, $charset); +} + +$gui->warning_msg = ''; +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $tpl); + +/** + */ +function buildTCExtTable($gui, $charset, $edit_icon, $history_icon) +{ + $table = null; + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + if (count((array) $gui->resultSet) > 0) { + $labels = array( + 'test_suite' => lang_get('test_suite'), + 'test_case' => lang_get('test_case') + ); + $columns = array(); + + $columns[] = array( + 'title_key' => 'test_suite' + ); + $columns[] = array( + 'title_key' => 'test_case', + 'type' => 'text' + ); + + $columns[] = array( + 'title_key' => 'summary' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + $titleSeparator = config_get('gui_title_separator_1'); + + foreach ($gui->resultSet as $result) { + $rowData = array(); + $rowData[] = htmlentities($gui->path_info[$result['testcase_id']], + ENT_QUOTES, $charset); + + // build test case link + $history_link = "" . + " "; + $edit_link = "" . + " "; + $tcaseName = htmlentities($gui->tcasePrefix, ENT_QUOTES, $charset) . + $result['tc_external_id'] . " [v" . $result['version'] . "]" . + $titleSeparator . + htmlentities($result['name'], ENT_QUOTES, $charset); + + $rowData[] = $history_link . $edit_link . $tcaseName; + $rowData[] = ($designType == 'none' ? nl2br($result['summary']) : $result['summary']); + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_test_case_search'); + + $table->setGroupByColumnName($labels['test_suite']); + $table->setSortByColumnName($labels['test_case']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $table->storeTableState = false; + } + return $table; +} + +/** + */ +function buildTSExtTable($gui, $charset, $edit_icon) +{ + $table = null; + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + if (! empty($gui->resultTestSuite)) { + $labels = array( + 'test_suite' => lang_get('test_suite'), + 'details' => lang_get('details') + ); + $columns = array(); + + $columns[] = array( + 'title_key' => 'test_suite', + 'type' => 'text' + ); + $columns[] = array( + 'title_key' => 'details' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + foreach ($gui->resultTestSuite as $result) { + $edit_link = "" . + " "; + + $rowData = array(); + + $rowData[] = $edit_link . + htmlentities($result['name'], ENT_QUOTES, $charset); + + $rowData[] = ($designType == 'none' ? nl2br($result['details']) : $result['details']); + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_test_suite_search'); + + $table->setSortByColumnName($labels['test_suite']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $table->storeTableState = false; + } + return $table; +} + +/** + */ +function buildRSExtTable($gui, $charset, $edit_icon) +{ + $table = null; + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + if (! empty($gui->resultReqSpec)) { + $labels = array( + 'req_spec' => lang_get('req_spec'), + 'scope' => lang_get('scope') + ); + $columns = array(); + + $columns[] = array( + 'title_key' => 'req_spec', + 'type' => 'text' + ); + $columns[] = array( + 'title_key' => 'scope' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + foreach ($gui->resultReqSpec as $result) { + $edit_link = "" . + " "; + + $rowData = array(); + + $rowData[] = $edit_link . + htmlentities($result['name'] . "[r{$result['revision']}]", + ENT_QUOTES, $charset); + + $rowData[] = ($designType == 'none' ? nl2br($result['scope']) : $result['scope']); + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_req_spec_search'); + + $table->setSortByColumnName($labels['req_spec']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $table->storeTableState = false; + } + return $table; +} + +/** + */ +function buildRQExtTable($gui, $charset) +{ + $table = null; + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + $lbl = array( + 'edit' => 'requirement', + 'req_spec' => 'req_spec', + 'requirement' => 'requirement', + 'scope' => 'scope', + 'version_revision_tag' => 'version_revision_tag' + ); + + $labels = init_labels($lbl); + $edit_icon = TL_THEME_IMG_DIR . "edit_icon.png"; + + if (! empty($gui->resultReq)) { + $columns = array(); + + $columns[] = array( + 'title_key' => 'req_spec' + ); + $columns[] = array( + 'title_key' => 'requirement', + 'type' => 'text' + ); + + $columns[] = array( + 'title_key' => 'scope' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + $key2loop = array_keys($gui->resultReq); + $img = ""; + + foreach ($key2loop as $req_id) { + $rowData = array(); + $itemSet = $gui->resultReq[$req_id]; + $rfx = $itemSet; + + // We Group by Requirement path + $rowData[] = htmlentities($gui->path_info[$rfx['req_id']], + ENT_QUOTES, $charset); + + $edit_link = "" . "{$img} "; + $title = htmlentities($rfx['req_doc_id'], ENT_QUOTES, $charset) . ":" . + htmlentities($rfx['name'], ENT_QUOTES, $charset); + + $matches = ''; + $rowData[] = $edit_link . $title . ' ' . $matches; + $rowData[] = ($designType == 'none' ? nl2br($rfx['scope']) : $rfx['scope']); + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, 'tl_table_req_search'); + + $table->setGroupByColumnName($labels['req_spec']); + $table->setSortByColumnName($labels['requirement']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + $table->storeTableState = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + } + return $table; +} + +/** + */ +function cleanUpTarget(&$dbHandler, $target) +{ + $s = preg_replace("/ {2,}/", " ", $target); + $theSet = explode(' ', $s); + $targetSet = array(); + foreach ($theSet as $val) { + if (trim($val) != '') { + $targetSet[] = $dbHandler->prepare_string($val); + } + } + return $targetSet; } @@ -440,22 +478,22 @@ function cleanUpTarget(&$dbHandler,$target) /* create view latest_tcase_version_number AS SELECT NH_TC.id AS testcase_id,max(TCV.version) AS version -FROM nodes_hierarchy NH_TC -JOIN nodes_hierarchy NH_TCV ON NH_TCV.parent_id = NH_TC.id -JOIN tcversions TCV ON NH_TCV.id = TCV.id +FROM nodes_hierarchy NH_TC +JOIN nodes_hierarchy NH_TCV ON NH_TCV.parent_id = NH_TC.id +JOIN tcversions TCV ON NH_TCV.id = TCV.id group by testcase_id =========== -SELECT LVN.testcase_id, TCV.id,TCV.version -FROM latest_tcase_version_number LVN -JOIN nodes_hierarchy NH_TCV ON NH_TCV.parent_id = LVN.testcase_id +SELECT LVN.testcase_id, TCV.id,TCV.version +FROM latest_tcase_version_number LVN +JOIN nodes_hierarchy NH_TCV ON NH_TCV.parent_id = LVN.testcase_id JOIN tcversions TCV ON NH_TCV.id = TCV.id AND LVN.version = TCV.version WHERE 1=1 AND NH_TCV.parent_id IN (7945) AND ( 1=1 AND TCV.summary like '%three%' ) create view latest_rspec_revision AS SELECT parent_id AS req_spec_id,testproject_id, max(revision) AS revision FROM req_specs_revisions RSR -JOIN req_specs RS ON RS.id = RSR.parent_id +JOIN req_specs RS ON RS.id = RSR.parent_id group by parent_id,testproject_id CREATE VIEW latest_req_version AS @@ -469,6 +507,6 @@ function cleanUpTarget(&$dbHandler,$target) JOIN latest_req_version LV on LV.req_id = NHRQV.parent_id JOIN req_versions RQV on NHRQV.id = RQV.id AND RQV.version = LV.version JOIN nodes_hierarchy NHRQ on NHRQ.id = LV.req_id -JOIN requirements RQ on RQ.id = LV.req_id +JOIN requirements RQ on RQ.id = LV.req_id */ diff --git a/lib/search/searchCommands.class.php b/lib/search/searchCommands.class.php index f3a156b4dd..313e772758 100644 --- a/lib/search/searchCommands.class.php +++ b/lib/search/searchCommands.class.php @@ -1,1025 +1,1054 @@ -db = $db; - $this->tcaseMgr = new testcase($this->db); - $this->tprojectMgr = new testproject($this->db); - $this->cfieldMgr = &$this->tprojectMgr->cfield_mgr; - $this->reqSpecMgr = new requirement_spec_mgr($this->db); - - $this->tcaseCfg = config_get('testcase_cfg'); - $dbt = strtolower($this->db->db->databaseType); - - $this->likeOp = 'LIKE'; - if(stristr($dbt, 'postgres') !== FALSE) - { - $this->likeOp = 'I' . $this->likeOp; - } - } - - - /** - * - */ - function isReqFeatureEnabled($tproject_id) - { - $info = $this->tprojectMgr->get_by_id($tproject_id); - return isset($info['opt']->requirementsEnabled) - ? $info['opt']->requirementsEnabled : 0; - } - - - /** - * - */ - function getTestCaseIDSet($tproject_id) - { - $items = array(); - $this->tprojectMgr->get_all_testcases_id($tproject_id,$items); - return $items; - } - - /** - * - */ - function getTestSuiteIDSet($tproject_id) { - $nt2ex = array('testcase' => 'exclude_me', - 'testplan' => 'exclude_me', - 'requirement_spec'=> 'exclude_me', - 'requirement'=> 'exclude_me'); - - $nt2exchi = array('testcase' => 'exclude_my_children', - 'requirement_spec'=> 'exclude_my_children'); - - $opt = array('recursive' => 0, 'output' => 'id'); - $filters = array('exclude_node_types' => $nt2ex, - 'exclude_children_of' => $nt2exchi); - - $items = $this->tprojectMgr->tree_manager->get_subtree($tproject_id,$filters,$opt); - - return $items; - } - - /** - * - */ - function getReqSpecIDSet($tproject_id) - { - $items = array(); - - $opt = array('output' => 'id'); - $items = $this->reqSpecMgr->get_all_id_in_testproject($tproject_id); - return $items; - } - - /** - * - */ - function getReqIDSet($tproject_id) - { - $items = array(); - $items = $this->tprojectMgr->get_all_requirement_ids($tproject_id); - return $items; - } - - - /** - * - */ - function getArgs() - { - return $this->args; - } - - /** - * - */ - function getGui() - { - return $this->gui; - } - - /** - * - */ - function getFilters() - { - return $this->filters; - } - - /** - * - */ - function getTables() - { - return $this->tables; - } - - /** - * - */ - function getViews() - { - return $this->views; - } - - - - /** - * - */ - function initEnv() - { - $this->initArgs(); - $this->initGui(); - $this->initSearch(); - } - - - /** - * - */ - function initSchema() { - $this->tables = tlObjectWithDB::getDBTables( - array('cfield_design_values','nodes_hierarchy', - 'requirements','tcsteps','testcase_keywords', - 'req_specs_revisions','req_versions', - 'testsuites','tcversions','users', - 'object_keywords')); - - $this->views = tlObjectWithDB::getDBViews( - array('latest_rspec_revision','latest_req_version', - 'latest_tcase_version_number')); - } - - - /** - * - */ - function initArgs() - { - $cb = array("rq_scope" => array(tlInputParameter::CB_BOOL), - "rq_title" => array(tlInputParameter::CB_BOOL), - "rq_doc_id" => array(tlInputParameter::CB_BOOL), - "rs_scope" => array(tlInputParameter::CB_BOOL), - "rs_title" => array(tlInputParameter::CB_BOOL), - "tc_summary" => array(tlInputParameter::CB_BOOL), - "tc_title" => array(tlInputParameter::CB_BOOL), - "tc_steps" => array(tlInputParameter::CB_BOOL), - "tc_expected_results" => array(tlInputParameter::CB_BOOL), - "tc_preconditions" => array(tlInputParameter::CB_BOOL), - "tc_id" => array(tlInputParameter::CB_BOOL), - "ts_summary" => array(tlInputParameter::CB_BOOL), - "ts_title" => array(tlInputParameter::CB_BOOL)); - - - $strIn = array("tcWKFStatus" => array(tlInputParameter::STRING_N,0,1), - "reqStatus" => array(tlInputParameter::STRING_N,0,1), - "reqType" => array(tlInputParameter::STRING_N), - "created_by" => array(tlInputParameter::STRING_N,0,50), - "edited_by" => array(tlInputParameter::STRING_N,0,50), - "creation_date_from" => array(tlInputParameter::STRING_N), - "creation_date_to" => array(tlInputParameter::STRING_N), - "modification_date_from" => array(tlInputParameter::STRING_N), - "modification_date_to" => array(tlInputParameter::STRING_N), - "and_or" => array(tlInputParameter::STRING_N,2,3) ); - - $numIn = array("keyword_id" => array(tlInputParameter::INT_N), - "custom_field_id" => array(tlInputParameter::INT_N)); - - $iParams = array("target" => array(tlInputParameter::STRING_N), - "doAction" => array(tlInputParameter::STRING_N,0,10), - "custom_field_value" => array(tlInputParameter::STRING_N,0,20), - "tproject_id" => array(tlInputParameter::INT_N)); - - $this->args = new stdClass(); - $args = &$this->args; - - $iParams = $iParams + $cb + $strIn + $numIn; - - R_PARAMS($iParams,$this->args); - - // At least one checkbox need to be checked - $args->oneCheck = false; - foreach($cb as $key => $vx) - { - $args->oneCheck = $args->$key; - if($args->oneCheck) - { - break; - } - } - - $args->oneValueOK = false; - foreach($numIn as $key => $vx) - { - $args->oneValueOK = (intval($args->$key) > 0); - if($args->oneValueOK) - { - break; - } - } - - if($args->oneValueOK == false) - { - foreach($strIn as $key => $vx) - { - $args->oneValueOK = (trim($args->$key) != ''); - if($args->oneValueOK) - { - break; - } - } - } - - // try to sanitize target against XSS - // remove all blanks - // remove some html entities - // remove () - // Need to give a look - //$tt = array('<','>','(',')'); - //$args->target = str_replace($tt,'',$args->target); - $ts = preg_replace("/ {2,}/", " ", $args->target); - $args->target = trim($ts); - - $args->userID = intval(isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); - - if(is_null($args->tproject_id) || intval($args->tproject_id) <= 0) - { - $args->tprojectID = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - } - else - { - $args->tprojectID = intval($args->tproject_id); - $info = $this->tprojectMgr->get_by_id($args->tprojectID); - $args->tprojectName = $info['name']; - } - - if($args->tprojectID <= 0) - { - throw new Exception("Error Processing Request - Invalid Test project id " . __FILE__); - } - - // convert according local - - // convert "creation date from" to iso format for database usage - $k2w = array('creation_date_from' => '','creation_date_to' => " 23:59:59", - 'modification_date_from' => '', 'modification_date_to' => " 23:59:59"); - - $k2f = array('creation_date_from' => ' creation_ts >= ', - 'creation_date_to' => 'creation_ts <= ', - 'modification_date_from' => ' modification_ts >= ', - 'modification_date_to' => ' modification_ts <= '); - - - $dateFormat = config_get('date_format'); - $filter['dates4tc'] = null; - $filter['dates4rq'] = null; - foreach($k2w as $key => $value) - { - $lk = 'loc_' . $key; - $args->$lk = ''; - - if (isset($args->$key) && $args->$key != '') - { - $da = split_localized_date($args->$key, $dateFormat); - if ($da != null) - { - $args->$key = $da['year'] . "-" . $da['month'] . "-" . $da['day'] . $value; // set date in iso format - $this->filters['dates4tc'][$key] = " AND TCV.{$k2f[$key]} '{$args->$key}' "; - $this->filters['dates4rq'][$key] = " AND RQV.{$k2f[$key]} '{$args->$key}' "; - - $args->$lk = implode("/",$da); - } - } - } - - // $args->and_or = isset($_REQUEST['and_or']) ? $_REQUEST['and_or'] : 'or'; - $args->user = $_SESSION['currentUser']; - - $args->canAccessTestSpec = $args->user->hasRight($this->db,'mgt_view_tc',$args->tproject_id); - - $args->canAccessReqSpec = $args->user->hasRight($this->db,'mgt_view_req',$args->tproject_id); - - } - - - /** - * - * - */ - function initGui() - { - $this->gui = new stdClass(); - - $this->gui->caller = 'search.php'; - - $this->gui->tcasePrefix = $this->tprojectMgr->getTestCasePrefix($this->args->tprojectID); - $this->gui->tcasePrefix .= $this->tcaseCfg->glue_character; - - - - $this->gui->reqType = $this->args->reqType; - $this->gui->reqStatus = $this->args->reqStatus; - $this->gui->tcWKFStatus = $this->args->tcWKFStatus; - - $this->gui->pageTitle = lang_get('multiple_entities_search'); - $this->gui->warning_msg = ''; - $this->gui->path_info = null; - $this->gui->resultSet = null; - $this->gui->tableSet = null; - $this->gui->bodyOnLoad = null; - $this->gui->bodyOnUnload = null; - $this->gui->refresh_tree = false; - $this->gui->hilite_testcase_name = false; - $this->gui->show_match_count = false; - $this->gui->row_qty = 0; - $this->gui->doSearch = ($this->args->doAction == 'doSearch'); - $this->gui->tproject_id = intval($this->args->tprojectID); - - // ---------------------------------------------------- - $this->gui->mainCaption = lang_get('testproject') . " " . $this->args->tprojectName; - - $this->gui->search_important_notice = sprintf(lang_get('search_important_notice'),$this->args->tprojectName); - - // need to set values that where used on latest search (if any was done) - // $this->gui->importance = config_get('testcase_importance_default'); - - $this->gui->tc_steps = $this->args->tc_steps; - $this->gui->tc_title = $this->args->tc_title; - $this->gui->tc_summary = $this->args->tc_summary; - $this->gui->tc_preconditions = $this->args->tc_preconditions; - $this->gui->tc_expected_results = $this->args->tc_expected_results; - $this->gui->tc_id = $this->args->tc_id; - - $this->gui->ts_title = $this->args->ts_title; - $this->gui->ts_summary = $this->args->ts_summary; - - $this->gui->rs_title = $this->args->rs_title; - $this->gui->rs_scope = $this->args->rs_scope; - - $this->gui->rq_title = $this->args->rq_title; - $this->gui->rq_scope = $this->args->rq_scope; - $this->gui->rq_doc_id = $this->args->rq_doc_id; - - - $this->gui->custom_field_id = $this->args->custom_field_id; - $this->gui->custom_field_value = $this->args->custom_field_value; - $this->gui->creation_date_from = $this->args->loc_creation_date_from; - $this->gui->creation_date_to = $this->args->loc_creation_date_to; - $this->gui->modification_date_from = $this->args->loc_modification_date_from; - $this->gui->modification_date_to = $this->args->loc_modification_date_to; - - $this->gui->created_by = trim($this->args->created_by); - $this->gui->edited_by = trim($this->args->edited_by); - $this->gui->keyword_id = intval($this->args->keyword_id); - - - $this->gui->forceSearch = false; - - $this->gui->and_selected = $this->gui->or_selected = ''; - switch($this->args->and_or) - { - case 'and': - $this->gui->and_selected = ' selected '; - break; - - case 'or': - default: - $this->gui->or_selected = ' selected '; - break; - } - - $reqCfg = config_get('req_cfg'); - $this->gui->reqStatusDomain = init_labels($reqCfg->status_labels); - - $this->gui->reqTypes = array_flip(init_labels($reqCfg->type_labels)); - foreach ($this->gui->reqTypes as $key => $value) - { - $this->gui->reqTypes[$key] = 'RQ' . $value; - } - $this->gui->reqTypes = array_flip($this->gui->reqTypes); - $this->gui->tcWKFStatusDomain = $this->getTestCaseWKFStatusDomain(); - } - - - /** - * - */ - function initSearch() - { - - $this->gui->reqEnabled = $this->isReqFeatureEnabled($this->args->tproject_id); - - - $this->gui->cf = null; - $this->gui->design_cf_req = null; - - $this->gui->design_cf_tc = $this->cfieldMgr->get_linked_cfields_at_design( - $this->args->tproject_id,cfield_mgr::ENABLED,null,'testcase'); - - if($this->gui->reqEnabled) - { - $this->gui->design_cf_req = $this->cfieldMgr->get_linked_cfields_at_design( - $this->args->tproject_id, - cfield_mgr::ENABLED,null,'requirement'); - } - - if(!is_null($this->gui->design_cf_tc)) - { - $this->gui->cf = $this->gui->design_cf_tc; - } - - if(!is_null($this->gui->design_cf_req)) - { - if(is_null($this->gui->cf)) - { - $this->gui->cf = $this->gui->design_cf_req; - } - else - { - $this->gui->cf += $this->gui->design_cf_req; - } - } - - $this->gui->filter_by['custom_fields'] = !is_null($this->gui->cf) && count($this->gui->cf) > 0; - - $this->gui->keywords = $this->tprojectMgr->getKeywordSet($this->args->tproject_id); - $this->gui->filter_by['keyword'] = !is_null($this->gui->keywords); - - $reqSpecSet = $this->tprojectMgr->genComboReqSpec($this->args->tprojectID); - $this->gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet); - $reqSpecSet = null; - - $this->gui->status = isset($this->args->status) ? intval($this->args->status) : ''; - $this->gui->target = $this->args->target; - } - - /** - * - */ - function searchReqSpec($targetSet,$canUseTarget) { - // shortcuts - $args = &$this->args; - $db = &$this->db; - - $cfg = config_get('UDFStripHTMLTags'); - $udf = $cfg ? 'UDFStripHTMLTags' : ''; - - $mapRSpec = null; - $sql = "SELECT RSRV.name, RSRV.scope, LRSR.req_spec_id, RSRV.id," . - "LRSR.revision " . - "FROM {$this->views['latest_rspec_revision']} LRSR " . - "JOIN {$this->tables['req_specs_revisions']} RSRV " . - "ON RSRV.parent_id = LRSR.req_spec_id " . - "AND RSRV.revision = LRSR.revision " . - "WHERE LRSR.testproject_id = " . $args->tproject_id; - - $doFilter = true; - - - $filterRS = null; - if( $canUseTarget ) { - $doFilter = true; - $filterRS['tricky'] = " 1=0 "; - - $filterRS['scope'] = ' OR ( '; - $filterRS['scope'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - foreach($targetSet as $target) { - $filterRS['scope'] .= $args->and_or . " $udf(RSRV.scope) $this->likeOp '%{$target}%' "; - } - $filterRS['scope'] .= ')'; - - $filterRS['name'] = ' OR ( '; - $filterRS['name'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - foreach($targetSet as $trgt) { - $target = trim($trgt); - $filterRS['name'] .= $args->and_or . " RSRV.name $this->likeOp '%{$target}%' "; - } - $filterRS['name'] .= ')'; - } - - $otherFRS = ''; - if(!is_null($filterRS)) { - $otherFRS = " AND (" . implode("",$filterRS) . ")"; - } - - $sql .= $otherFRS; - if($doFilter) { - $mapRSpec = $db->fetchRowsIntoMap($sql,'req_spec_id'); - } - return $mapRSpec; - } - - /** - * - */ - function searchReq($targetSet,$canUseTarget,$req_cf_id) { - // shortcuts - $args = &$this->args; - $gui = &$this->gui; - $db = &$this->db; - $tables = &$this->tables; - $views = &$this->views; - - $cfg = config_get('UDFStripHTMLTags'); - $udf = $cfg ? 'UDFStripHTMLTags' : ''; - - - $reqSet = $this->getReqIDSet($args->tproject_id); - - $noItems = is_null($reqSet) || count($reqSet) == 0; - $bye = $noItems || (!$canUseTarget && $req_cf_id <= 0); - if( $bye ) - { - return null; - } - - // OK go ahead - $doSql = true; - $doFilter = false; - $fi = null; - $from['by_custom_field'] = ''; - - - if($req_cf_id >0) - { - $cf_def = $gui->design_cf_rq[$req_cf_id]; - - $from['by_custom_field']= " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id=RQV.id "; - $fi['by_custom_field'] = " AND CFD.field_id=" . intval($req_cf_id); - - switch($gui->cf_types[$cf_def['type']]) - { - case 'date': - $args->custom_field_value = $this->cfieldMgr->cfdate2mktime($args->custom_field_value); - - $fi['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; - break; - - default: - $args->custom_field_value = $db->prepare_string($args->custom_field_value); - $fi['by_custom_field'] .= " AND CFD.value $this->likeOp '%{$args->custom_field_value}%' "; - break; - } - } - - $args->created_by = trim($args->created_by); - $from['users'] = ''; - if($args->created_by != '' ) - { - $doFilter = true; - $from['users'] .= " JOIN {$tables['users']} RQAUTHOR ON RQAUTHOR.id = RQV.author_id "; - $fi['author'] = " AND ( RQAUTHOR.login $this->likeOp '%{$args->created_by}%' OR " . - " RQAUTHOR.first $this->likeOp '%{$args->created_by}%' OR " . - " RQAUTHOR.last $this->likeOp '%{$args->created_by}%') "; - } - - $args->edited_by = trim($args->edited_by); - if( $args->edited_by != '' ) - { - $doFilter = true; - $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = RQV.modifier_id "; - $fi['modifier'] = " AND ( UPDATER.login $this->likeOp '%{$args->edited_by}%' OR " . - " UPDATER.first $this->likeOp '%{$args->edited_by}%' OR " . - " UPDATER.last $this->likeOp '%{$args->edited_by}%') "; - } - - if( $doSql ) { - $doFilter = true; - - $sql = " /* " . __LINE__ . " */ " . - " SELECT RQ.id AS req_id, RQV.scope,RQ.req_doc_id,NHRQ.name " . - " FROM {$tables['nodes_hierarchy']} NHRQV " . - " JOIN {$views['latest_req_version']} LV on LV.req_id = NHRQV.parent_id " . - " JOIN {$tables['req_versions']} RQV on NHRQV.id = RQV.id AND RQV.version = LV.version " . - " JOIN {$tables['nodes_hierarchy']} NHRQ on NHRQ.id = LV.req_id " . - " JOIN {$tables['requirements']} RQ on RQ.id = LV.req_id " . - $from['users'] . $from['by_custom_field'] . - " WHERE RQ.id IN(" . implode(',', $reqSet) . ")"; - - if(!is_null($args->reqType)) { - $doFilter = true; - $sql .= " AND RQV.type ='" . $db->prepare_string($args->reqType) . "' "; - } - - if($args->reqStatus != '') { - $doFilter = true; - $sql .= " AND RQV.status='" . $db->prepare_string($args->reqStatus) . "' "; - } - - $filterRQ = null; - if( $canUseTarget ) { - $doFilter = true; - $filterRQ['tricky'] = " 1=0 "; - - if( $args->rq_scope ) { - $filterRQ['scope'] = ' OR ( '; - $filterRQ['scope'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - foreach($targetSet as $target) { - $filterRQ['scope'] .= $args->and_or . " $udf(RQV.scope) $this->likeOp '%{$target}%' "; - } - $filterRQ['scope'] .= ')'; - } - - if( $args->rq_title ) - { - $filterRQ['name'] = ' OR ( '; - $filterRQ['name'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) - { - $filterRQ['name'] .= $args->and_or . " NHRQ.name $this->likeOp '%{$target}%' "; - } - $filterRQ['name'] .= ')'; - } - - if( $args->rq_doc_id ) - { - $filterRQ['req_doc_id'] = ' OR ( '; - $filterRQ['req_doc_id'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - foreach($targetSet as $target) - { - $filterRQ['req_doc_id'] .= $args->and_or . " RQ.req_doc_id $this->likeOp '%{$target}%' "; - } - $filterRQ['req_doc_id'] .= ')'; - } - } - - $otherFRQ = ''; - if(!is_null($filterRQ)) - { - $otherFRQ = " AND (" . implode("",$filterRQ) . ")"; - } - - $xfil = ''; - if(!is_null($fi)) - { - $xfil = implode("",$fi); - } - - $sql .= $xfil . $otherFRQ; - if( $doFilter ) - { - //DEBUGecho __FUNCTION__ . ' SQL Line:' . __LINE__ . $sql .'
    '; - $mapRQ = $db->fetchRowsIntoMap($sql,'req_id'); - } - - return $mapRQ; - } - } - - - /** - * - */ - function searchTestSuites($targetSet,$canUseTarget) { - - // shortcuts - $args = &$this->args; - $gui = &$this->gui; - $db = &$this->db; - $tables = &$this->tables; - $views = &$this->views; - $cfg = config_get('UDFStripHTMLTags'); - $udf = $cfg ? 'UDFStripHTMLTags' : ''; - - $mapTS = null; - $tsuiteSet = $this->getTestSuiteIDSet($args->tproject_id); - if(is_null($tsuiteSet) || count($tsuiteSet) == 0) - { - return null; - } - - $filterSpecial = null; - $filterSpecial['tricky'] = " 1=0 "; - - if( ($doIt = $args->ts_summary && $canUseTarget) ) { - $filterSpecial['ts_summary'] = ' OR ( '; - $filterSpecial['ts_summary'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) { - $filterSpecial['ts_summary'] .= $args->and_or . - " $udf(TS.details) $this->likeOp '%{$target}%' "; - } - $filterSpecial['ts_summary'] .= ')'; - } - - if( ($doIt = $args->ts_title && $canUseTarget) ) { - $filterSpecial['ts_title'] = ' OR ( '; - $filterSpecial['ts_title'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) { - $filterSpecial['ts_title'] .= $args->and_or . " NH_TS.name $this->likeOp '%{$target}%' "; - } - $filterSpecial['ts_title'] .= ')'; - } - - $otherFilters = ''; - if(!is_null($filterSpecial)) - { - $otherFilters = " AND (" . implode("",$filterSpecial) . ")"; - } - - if($args->ts_title || $args->ts_summary) - { - $fromTS['by_keyword_id']= ''; - $filterTS['by_keyword_id']=''; - if($args->keyword_id) - { - $fromTS['by_keyword_id'] = " JOIN {$tables['object_keywords']} KW ON KW.fk_id = NH_TS.id "; - $filterTS['by_keyword_id'] = " AND KW.keyword_id = " . $args->keyword_id; - } - - $sqlFields = " SELECT NH_TS.name, TS.id, TS.details " . - " FROM {$tables['nodes_hierarchy']} NH_TS " . - " JOIN {$tables['testsuites']} TS ON TS.id = NH_TS.id " . - $fromTS['by_keyword_id'] . - " WHERE TS.id IN (" . implode(',', $tsuiteSet) . ")"; - - $sql = $sqlFields . $filterTS['by_keyword_id'] . $otherFilters; - $mapTS = $db->fetchRowsIntoMap($sql,'id'); - - //DEBUGecho 'DEBUG===' . $sql; - } - - return $mapTS; - } - - - /** - * - */ - function searchTestCases($tcaseSet,$targetSet,$canUseTarget,$tc_cf_id) { - // shortcuts - $args = &$this->args; - $gui = &$this->gui; - $db = &$this->db; - $tables = &$this->tables; - $views = &$this->views; - $cfg = config_get('UDFStripHTMLTags'); - $udf = $cfg ? 'UDFStripHTMLTags' : ''; - - - $from['tc_steps'] = ""; - $from['users'] = ""; - $from['by_keyword_id'] = ""; - $from['by_custom_field'] = ""; - - $filter = null; - $filterSpecial = null; - - - if( is_null($tcaseSet) || count($tcaseSet) == 0) - { - return null; - } - - - $filter['by_tc_internal_id'] = " AND NH_TCV.parent_id IN (" . - implode(",",$tcaseSet) . ") "; - - - $filterSpecial['tricky'] = " 1=0 "; - - if($args->tc_id) - { - $filterSpecial['by_tc_id'] = ''; - - // Remember that test case id is a number! - foreach($targetSet as $tgx) - { - $target = trim($tgx); - if( is_numeric($target) ) - { - $filterSpecial['by_tc_id'] .= $args->and_or . - " TCV.tc_external_id = $target "; - } - } - } - - $doFilter = false; - $doFilter = ($args->tc_summary || $args->tc_title || $args->tc_id); - - if($tc_cf_id > 0) - { - $cf_def = $gui->design_cf_tc[$tc_cf_id]; - - $from['by_custom_field']= " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id=NH_TCV.id "; - $filter['by_custom_field'] = " AND CFD.field_id=" . intval($tc_cf_id); - - switch($gui->cf_types[$cf_def['type']]) - { - case 'date': - $args->custom_field_value = $cfieldMgr->cfdate2mktime($args->custom_field_value); - - $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; - break; - - default: - $args->custom_field_value = $db->prepare_string($args->custom_field_value); - $filter['by_custom_field'] .= " AND CFD.value $this->likeOp '%{$args->custom_field_value}%' "; - break; - } - } - - if($args->tc_steps || $args->tc_expected_results) - { - $doFilter = true; - $from['tc_steps'] = " LEFT OUTER JOIN {$tables['nodes_hierarchy']} " . - " NH_TCSTEPS ON NH_TCSTEPS.parent_id = NH_TCV.id " . - " LEFT OUTER JOIN {$tables['tcsteps']} TCSTEPS " . - " ON NH_TCSTEPS.id = TCSTEPS.id "; - } - - if($args->tc_steps && $canUseTarget) { - $filterSpecial['by_steps'] = ' OR ( '; - $filterSpecial['by_steps'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) { - $filterSpecial['by_steps'] .= $args->and_or . - " $udf(TCSTEPS.actions) $this->likeOp '%{$target}%' "; - } - $filterSpecial['by_steps'] .= ')'; - } - - if($args->tc_expected_results && $canUseTarget) { - $filterSpecial['by_expected_results'] = ' OR ( '; - $filterSpecial['by_expected_results'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) { - $filterSpecial['by_expected_results'] .= $args->and_or . - " $udf(TCSTEPS.expected_results) $this->likeOp '%{$target}%' "; - } - $filterSpecial['by_expected_results'] .= ')'; - } - - if($canUseTarget) - { - $k2w = array('name' => 'NH_TC', 'summary' => 'TCV', 'preconditions' => 'TCV'); - $i2s = array('name' => 'tc_title', 'summary' => 'tc_summary', - 'preconditions' => 'tc_preconditions'); - foreach($k2w as $kf => $alias) - { - $in = $i2s[$kf]; - if($args->$in) - { - $doFilter = true; - - $filterSpecial[$kf] = ' OR ( '; - $filterSpecial[$kf] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; - - foreach($targetSet as $target) { - $filterSpecial[$kf] .= " {$args->and_or} "; - $xx = "{$alias}.{$kf}"; - switch($kf) { - case 'summary': - case 'preconditions': - $xx = " $udf(" . $xx . ") "; - break; - } - $filterSpecial[$kf] .= "{$xx} {$this->likeOp} '%{$target}%' "; - } - $filterSpecial[$kf] .= ' )'; - } - } - } - - - $otherFilters = ''; - if(!is_null($filterSpecial) && count($filterSpecial) > 1) - { - $otherFilters = " AND (/* filterSpecial */ " . - implode("",$filterSpecial) . ")"; - } - - // Search on latest test case version using view - $sqlFields = " SELECT LVN.testcase_id, NH_TC.name, TCV.id AS tcversion_id," . - " TCV.summary, TCV.version, TCV.tc_external_id "; - - if($doFilter) - { - if($args->tcWKFStatus > 0) - { - $tg = intval($args->tcWKFStatus); - $filter['by_tcWKFStatus'] = " AND TCV.status = {$tg} "; - } - - if($args->keyword_id) - { - $from['by_keyword_id'] = " JOIN {$tables['testcase_keywords']} KW ON KW.testcase_id = NH_TC.id "; - $filter['by_keyword_id'] = " AND KW.keyword_id = " . $args->keyword_id; - } - - $created_by_on_tc = $args->created_by = trim($args->created_by); - $from['users'] = ''; - if( $created_by_on_tc != '' ) - { - $doFilter = true; - $from['users'] .= " JOIN {$tables['users']} AUTHOR ON AUTHOR.id = TCV.author_id "; - $filter['author'] = " AND ( AUTHOR.login $this->likeOp '%{$args->created_by}%' OR " . - " AUTHOR.first $this->likeOp '%{$args->created_by}%' OR " . - " AUTHOR.last $this->likeOp '%{$args->created_by}%') "; - } - - $edited_by_on_tc = $args->edited_by = trim($args->edited_by); - if( $edited_by_on_tc != '' ) - { - $doFilter = true; - $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = TCV.updater_id "; - $filter['modifier'] = " AND ( UPDATER.login $this->likeOp '%{$args->edited_by}%' OR " . - " UPDATER.first $this->likeOp '%{$args->edited_by}%' OR " . - " UPDATER.last $this->likeOp '%{$args->edited_by}%') "; - } - } - - - // search fails if test case has 0 steps - Added LEFT OUTER - $sqlPart2 = " FROM {$views['latest_tcase_version_number']} LVN " . - " JOIN {$tables['nodes_hierarchy']} NH_TC ON NH_TC.id = LVN.testcase_id " . - " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TC.id " . - " JOIN {$tables['tcversions']} TCV ON NH_TCV.id = TCV.id " . - " AND TCV.version = LVN.version " . - $from['tc_steps'] . $from['users'] . $from['by_keyword_id'] . - $from['by_custom_field'] . - " WHERE LVN.testcase_id IN (" . implode(',', $tcaseSet) . ")"; - - - $mapTC = NULL; - if($doFilter) - { - $mixedFilter = $this->getFilters(); - if ($filter) - { - $sqlPart2 .= implode("",$filter); - } - - if ($mixedFilter['dates4tc']) - { - $sqlPart2 .= implode("",$mixedFilter['dates4tc']); - } - - $sql = $sqlFields . $sqlPart2 . $otherFilters; - - //DEBUGecho __FUNCTION__ . '-' . __LINE__ . '-' . $sql .'
    '; - $mapTC = $db->fetchRowsIntoMap($sql,'testcase_id'); - } - - return $mapTC; - } - - /** - * - */ - static function getTestCaseWKFStatusDomain() { - $cv = array_flip(config_get('testCaseStatus')); - foreach($cv as $cc => $vv) { - $lbl = lang_get('testCaseStatus_' . $vv); - $cv[$cc] = lang_get('testCaseStatus_' . $vv); - } - return $cv; - } - - -} // end class +db = $db; + $this->tcaseMgr = new testcase($this->db); + $this->tprojectMgr = new testproject($this->db); + $this->cfieldMgr = &$this->tprojectMgr->cfield_mgr; + $this->reqSpecMgr = new requirement_spec_mgr($this->db); + + $this->tcaseCfg = config_get('testcase_cfg'); + $dbt = strtolower($this->db->db->databaseType); + + $this->likeOp = 'LIKE'; + if (stristr($dbt, 'postgres') !== false) { + $this->likeOp = 'I' . $this->likeOp; + } + } + + /** + */ + private function isReqFeatureEnabled($tproject_id) + { + $info = $this->tprojectMgr->get_by_id($tproject_id); + return isset($info['opt']->requirementsEnabled) ? $info['opt']->requirementsEnabled : 0; + } + + /** + */ + public function getTestCaseIDSet($tproject_id) + { + $items = array(); + $this->tprojectMgr->get_all_testcases_id($tproject_id, $items); + return $items; + } + + /** + */ + private function getTestSuiteIDSet($tproject_id) + { + $nt2ex = array( + 'testcase' => 'exclude_me', + 'testplan' => 'exclude_me', + 'requirement_spec' => 'exclude_me', + 'requirement' => 'exclude_me' + ); + + $nt2exchi = array( + 'testcase' => 'exclude_my_children', + 'requirement_spec' => 'exclude_my_children' + ); + + $opt = array( + 'recursive' => 0, + 'output' => 'id' + ); + $filters = array( + 'exclude_node_types' => $nt2ex, + 'exclude_children_of' => $nt2exchi + ); + + return $this->tprojectMgr->tree_manager->get_subtree($tproject_id, + $filters, $opt); + } + + /** + */ + private function getReqSpecIDSet($tproject_id) + { + return $this->reqSpecMgr->get_all_id_in_testproject($tproject_id); + } + + /** + */ + private function getReqIDSet($tproject_id) + { + return $this->tprojectMgr->get_all_requirement_ids($tproject_id); + } + + /** + */ + public function getArgs() + { + return $this->args; + } + + /** + */ + public function getGui() + { + return $this->gui; + } + + /** + */ + private function getFilters() + { + return $this->filters; + } + + /** + */ + public function getTables() + { + return $this->tables; + } + + /** + */ + public function getViews() + { + return $this->views; + } + + /** + */ + public function initEnv() + { + $this->initArgs(); + $this->initGui(); + $this->initSearch(); + } + + /** + */ + public function initSchema() + { + $this->tables = tlObjectWithDB::getDBTables( + array( + 'cfield_design_values', + 'nodes_hierarchy', + 'requirements', + 'tcsteps', + 'testcase_keywords', + 'req_specs_revisions', + 'req_versions', + 'testsuites', + 'tcversions', + 'users', + 'object_keywords' + )); + + $this->views = tlObjectWithDB::getDBViews( + array( + 'latest_rspec_revision', + 'latest_req_version', + 'latest_tcase_version_number' + )); + } + + /** + */ + private function initArgs() + { + $cb = array( + "rq_scope" => array( + tlInputParameter::CB_BOOL + ), + "rq_title" => array( + tlInputParameter::CB_BOOL + ), + "rq_doc_id" => array( + tlInputParameter::CB_BOOL + ), + "rs_scope" => array( + tlInputParameter::CB_BOOL + ), + "rs_title" => array( + tlInputParameter::CB_BOOL + ), + "tc_summary" => array( + tlInputParameter::CB_BOOL + ), + "tc_title" => array( + tlInputParameter::CB_BOOL + ), + "tc_steps" => array( + tlInputParameter::CB_BOOL + ), + "tc_expected_results" => array( + tlInputParameter::CB_BOOL + ), + "tc_preconditions" => array( + tlInputParameter::CB_BOOL + ), + "tc_id" => array( + tlInputParameter::CB_BOOL + ), + "ts_summary" => array( + tlInputParameter::CB_BOOL + ), + "ts_title" => array( + tlInputParameter::CB_BOOL + ) + ); + + $strIn = array( + "tcWKFStatus" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "reqStatus" => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + "reqType" => array( + tlInputParameter::STRING_N + ), + "created_by" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "edited_by" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "creation_date_from" => array( + tlInputParameter::STRING_N + ), + "creation_date_to" => array( + tlInputParameter::STRING_N + ), + "modification_date_from" => array( + tlInputParameter::STRING_N + ), + "modification_date_to" => array( + tlInputParameter::STRING_N + ), + "and_or" => array( + tlInputParameter::STRING_N, + 2, + 3 + ) + ); + + $numIn = array( + "keyword_id" => array( + tlInputParameter::INT_N + ), + "custom_field_id" => array( + tlInputParameter::INT_N + ) + ); + + $iParams = array( + "target" => array( + tlInputParameter::STRING_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 10 + ), + "custom_field_value" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ) + ); + + $this->args = new stdClass(); + $args = &$this->args; + + $iParams = $iParams + $cb + $strIn + $numIn; + + R_PARAMS($iParams, $this->args); + + // At least one checkbox need to be checked + $args->oneCheck = false; + foreach ($cb as $key => $vx) { + $args->oneCheck = $args->$key; + if ($args->oneCheck) { + break; + } + } + + $args->oneValueOK = false; + foreach ($numIn as $key => $vx) { + $args->oneValueOK = (intval($args->$key) > 0); + if ($args->oneValueOK) { + break; + } + } + + if (! $args->oneValueOK) { + foreach ($strIn as $key => $vx) { + $args->oneValueOK = (trim($args->$key) != ''); + if ($args->oneValueOK) { + break; + } + } + } + + // try to sanitize target against XSS + // remove all blanks + // remove some html entities + // remove () + // Need to give a look + // $tt = array('<','>','(',')'); + // $args->target = str_replace($tt,'',$args->target); + $ts = preg_replace("/ {2,}/", " ", $args->target); + $args->target = trim($ts); + + $args->userID = intval( + isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); + + if (is_null($args->tproject_id) || intval($args->tproject_id) <= 0) { + $args->tprojectID = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + } else { + $args->tprojectID = intval($args->tproject_id); + $info = $this->tprojectMgr->get_by_id($args->tprojectID); + $args->tprojectName = $info['name']; + } + + if ($args->tprojectID <= 0) { + throw new Exception( + "Error Processing Request - Invalid Test project id " . __FILE__); + } + + // convert according local + + // convert "creation date from" to iso format for database usage + $k2w = array( + 'creation_date_from' => '', + 'creation_date_to' => " 23:59:59", + 'modification_date_from' => '', + 'modification_date_to' => " 23:59:59" + ); + + $k2f = array( + 'creation_date_from' => ' creation_ts >= ', + 'creation_date_to' => 'creation_ts <= ', + 'modification_date_from' => ' modification_ts >= ', + 'modification_date_to' => ' modification_ts <= ' + ); + + $dateFormat = config_get('date_format'); + $filter['dates4tc'] = null; + $filter['dates4rq'] = null; + foreach ($k2w as $key => $value) { + $lk = 'loc_' . $key; + $args->$lk = ''; + + if (isset($args->$key) && $args->$key != '') { + $da = split_localized_date($args->$key, $dateFormat); + if ($da != null) { + $args->$key = $da['year'] . "-" . $da['month'] . "-" . + $da['day'] . $value; // set date in iso format + $this->filters['dates4tc'][$key] = " AND TCV.{$k2f[$key]} '{$args->$key}' "; + $this->filters['dates4rq'][$key] = " AND RQV.{$k2f[$key]} '{$args->$key}' "; + + $args->$lk = implode("/", $da); + } + } + } + + $args->user = $_SESSION['currentUser']; + $args->canAccessTestSpec = $args->user->hasRight($this->db, + 'mgt_view_tc', $args->tproject_id); + $args->canAccessReqSpec = $args->user->hasRight($this->db, + 'mgt_view_req', $args->tproject_id); + } + + /** + */ + private function initGui() + { + $this->gui = new stdClass(); + + $this->gui->caller = 'search.php'; + + $this->gui->tcasePrefix = $this->tprojectMgr->getTestCasePrefix( + $this->args->tprojectID); + $this->gui->tcasePrefix .= $this->tcaseCfg->glue_character; + + $this->gui->reqType = $this->args->reqType; + $this->gui->reqStatus = $this->args->reqStatus; + $this->gui->tcWKFStatus = $this->args->tcWKFStatus; + + $this->gui->pageTitle = lang_get('multiple_entities_search'); + $this->gui->warning_msg = ''; + $this->gui->path_info = null; + $this->gui->resultSet = null; + $this->gui->tableSet = null; + $this->gui->bodyOnLoad = null; + $this->gui->bodyOnUnload = null; + $this->gui->refresh_tree = false; + $this->gui->hilite_testcase_name = false; + $this->gui->show_match_count = false; + $this->gui->row_qty = 0; + $this->gui->doSearch = ($this->args->doAction == 'doSearch'); + $this->gui->tproject_id = intval($this->args->tprojectID); + + $this->gui->mainCaption = lang_get('testproject') . " " . + $this->args->tprojectName; + + $this->gui->search_important_notice = sprintf( + lang_get('search_important_notice'), $this->args->tprojectName); + + // need to set values that where used on latest search (if any was done) + // $this->gui->importance = config_get('testcase_importance_default'); + + $this->gui->tc_steps = $this->args->tc_steps; + $this->gui->tc_title = $this->args->tc_title; + $this->gui->tc_summary = $this->args->tc_summary; + $this->gui->tc_preconditions = $this->args->tc_preconditions; + $this->gui->tc_expected_results = $this->args->tc_expected_results; + $this->gui->tc_id = $this->args->tc_id; + + $this->gui->ts_title = $this->args->ts_title; + $this->gui->ts_summary = $this->args->ts_summary; + + $this->gui->rs_title = $this->args->rs_title; + $this->gui->rs_scope = $this->args->rs_scope; + + $this->gui->rq_title = $this->args->rq_title; + $this->gui->rq_scope = $this->args->rq_scope; + $this->gui->rq_doc_id = $this->args->rq_doc_id; + + $this->gui->custom_field_id = $this->args->custom_field_id; + $this->gui->custom_field_value = $this->args->custom_field_value; + $this->gui->creation_date_from = $this->args->loc_creation_date_from; + $this->gui->creation_date_to = $this->args->loc_creation_date_to; + $this->gui->modification_date_from = $this->args->loc_modification_date_from; + $this->gui->modification_date_to = $this->args->loc_modification_date_to; + + $this->gui->created_by = trim($this->args->created_by); + $this->gui->edited_by = trim($this->args->edited_by); + $this->gui->keyword_id = intval($this->args->keyword_id); + + $this->gui->forceSearch = false; + + $this->gui->and_selected = $this->gui->or_selected = ''; + switch ($this->args->and_or) { + case 'and': + $this->gui->and_selected = ' selected '; + break; + + case 'or': + default: + $this->gui->or_selected = ' selected '; + break; + } + + $reqCfg = config_get('req_cfg'); + $this->gui->reqStatusDomain = init_labels($reqCfg->status_labels); + + $this->gui->reqTypes = array_flip(init_labels($reqCfg->type_labels)); + foreach ($this->gui->reqTypes as $key => $value) { + $this->gui->reqTypes[$key] = 'RQ' . $value; + } + $this->gui->reqTypes = array_flip($this->gui->reqTypes); + $this->gui->tcWKFStatusDomain = $this->getTestCaseWKFStatusDomain(); + } + + /** + */ + private function initSearch() + { + $this->gui->reqEnabled = $this->isReqFeatureEnabled( + $this->args->tproject_id); + + $this->gui->cf = null; + $this->gui->design_cf_req = null; + + $this->gui->design_cf_tc = $this->cfieldMgr->get_linked_cfields_at_design( + $this->args->tproject_id, cfield_mgr::ENABLED, null, 'testcase'); + + if ($this->gui->reqEnabled) { + $this->gui->design_cf_req = $this->cfieldMgr->get_linked_cfields_at_design( + $this->args->tproject_id, cfield_mgr::ENABLED, null, + 'requirement'); + } + + if (! is_null($this->gui->design_cf_tc)) { + $this->gui->cf = $this->gui->design_cf_tc; + } + + if (! is_null($this->gui->design_cf_req)) { + if (is_null($this->gui->cf)) { + $this->gui->cf = $this->gui->design_cf_req; + } else { + $this->gui->cf += $this->gui->design_cf_req; + } + } + + $this->gui->filter_by['custom_fields'] = ! is_null($this->gui->cf) && + count($this->gui->cf) > 0; + + $this->gui->keywords = $this->tprojectMgr->getKeywordSet( + $this->args->tproject_id); + $this->gui->filter_by['keyword'] = ! is_null($this->gui->keywords); + + $reqSpecSet = $this->tprojectMgr->genComboReqSpec( + $this->args->tprojectID); + $this->gui->filter_by['requirement_doc_id'] = ! is_null($reqSpecSet); + $reqSpecSet = null; + + $this->gui->status = isset($this->args->status) ? intval( + $this->args->status) : ''; + $this->gui->target = $this->args->target; + } + + /** + */ + public function searchReqSpec($targetSet, $canUseTarget) + { + // shortcuts + $args = &$this->args; + $db = &$this->db; + + $cfg = config_get('UDFStripHTMLTags'); + $udf = $cfg ? 'UDFStripHTMLTags' : ''; + + $mapRSpec = null; + $sql = "SELECT RSRV.name, RSRV.scope, LRSR.req_spec_id, RSRV.id," . + "LRSR.revision " . + "FROM {$this->views['latest_rspec_revision']} LRSR " . + "JOIN {$this->tables['req_specs_revisions']} RSRV " . + "ON RSRV.parent_id = LRSR.req_spec_id " . + "AND RSRV.revision = LRSR.revision " . "WHERE LRSR.testproject_id = " . + $args->tproject_id; + + $doFilter = true; + + $filterRS = null; + if ($canUseTarget) { + $doFilter = true; + $filterRS['tricky'] = " 1=0 "; + + $filterRS['scope'] = ' OR ( '; + $filterRS['scope'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + foreach ($targetSet as $target) { + $filterRS['scope'] .= $args->and_or . + " $udf(RSRV.scope) $this->likeOp '%{$target}%' "; + } + $filterRS['scope'] .= ')'; + + $filterRS['name'] = ' OR ( '; + $filterRS['name'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + foreach ($targetSet as $trgt) { + $target = trim($trgt); + $filterRS['name'] .= $args->and_or . + " RSRV.name $this->likeOp '%{$target}%' "; + } + $filterRS['name'] .= ')'; + } + + $otherFRS = ''; + if (! is_null($filterRS)) { + $otherFRS = " AND (" . implode("", $filterRS) . ")"; + } + + $sql .= $otherFRS; + if ($doFilter) { + $mapRSpec = $db->fetchRowsIntoMap($sql, 'req_spec_id'); + } + return $mapRSpec; + } + + /** + */ + public function searchReq($targetSet, $canUseTarget, $req_cf_id) + { + // shortcuts + $args = &$this->args; + $gui = &$this->gui; + $db = &$this->db; + $tables = &$this->tables; + $views = &$this->views; + + $cfg = config_get('UDFStripHTMLTags'); + $udf = $cfg ? 'UDFStripHTMLTags' : ''; + + $reqSet = $this->getReqIDSet($args->tproject_id); + + $noItems = is_null($reqSet) || count($reqSet) == 0; + $bye = $noItems || (! $canUseTarget && $req_cf_id <= 0); + if ($bye) { + return null; + } + + // OK go ahead + $doSql = true; + $doFilter = false; + $fi = null; + $from['by_custom_field'] = ''; + + if ($req_cf_id > 0) { + $cf_def = $gui->design_cf_rq[$req_cf_id]; + + $from['by_custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id=RQV.id "; + $fi['by_custom_field'] = " AND CFD.field_id=" . intval($req_cf_id); + + switch ($gui->cf_types[$cf_def['type']]) { + case 'date': + $args->custom_field_value = $this->cfieldMgr->cfdate2mktime( + $args->custom_field_value); + + $fi['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; + break; + + default: + $args->custom_field_value = $db->prepare_string( + $args->custom_field_value); + $fi['by_custom_field'] .= " AND CFD.value $this->likeOp '%{$args->custom_field_value}%' "; + break; + } + } + + $args->created_by = trim($args->created_by); + $from['users'] = ''; + if ($args->created_by != '') { + $doFilter = true; + $from['users'] .= " JOIN {$tables['users']} RQAUTHOR ON RQAUTHOR.id = RQV.author_id "; + $fi['author'] = " AND ( RQAUTHOR.login $this->likeOp '%{$args->created_by}%' OR " . + " RQAUTHOR.first $this->likeOp '%{$args->created_by}%' OR " . + " RQAUTHOR.last $this->likeOp '%{$args->created_by}%') "; + } + + $args->edited_by = trim($args->edited_by); + if ($args->edited_by != '') { + $doFilter = true; + $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = RQV.modifier_id "; + $fi['modifier'] = " AND ( UPDATER.login $this->likeOp '%{$args->edited_by}%' OR " . + " UPDATER.first $this->likeOp '%{$args->edited_by}%' OR " . + " UPDATER.last $this->likeOp '%{$args->edited_by}%') "; + } + + if ($doSql) { + $doFilter = true; + + $sql = " /* " . __LINE__ . " */ " . + " SELECT RQ.id AS req_id, RQV.scope,RQ.req_doc_id,NHRQ.name " . + " FROM {$tables['nodes_hierarchy']} NHRQV " . + " JOIN {$views['latest_req_version']} LV on LV.req_id = NHRQV.parent_id " . + " JOIN {$tables['req_versions']} RQV on NHRQV.id = RQV.id AND RQV.version = LV.version " . + " JOIN {$tables['nodes_hierarchy']} NHRQ on NHRQ.id = LV.req_id " . + " JOIN {$tables['requirements']} RQ on RQ.id = LV.req_id " . + $from['users'] . $from['by_custom_field'] . " WHERE RQ.id IN(" . + implode(',', $reqSet) . ")"; + + if (! is_null($args->reqType)) { + $doFilter = true; + $sql .= " AND RQV.type ='" . $db->prepare_string($args->reqType) . + "' "; + } + + if ($args->reqStatus != '') { + $doFilter = true; + $sql .= " AND RQV.status='" . + $db->prepare_string($args->reqStatus) . "' "; + } + + $filterRQ = null; + if ($canUseTarget) { + $doFilter = true; + $filterRQ['tricky'] = " 1=0 "; + + if ($args->rq_scope) { + $filterRQ['scope'] = ' OR ( '; + $filterRQ['scope'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + foreach ($targetSet as $target) { + $filterRQ['scope'] .= $args->and_or . + " $udf(RQV.scope) $this->likeOp '%{$target}%' "; + } + $filterRQ['scope'] .= ')'; + } + + if ($args->rq_title) { + $filterRQ['name'] = ' OR ( '; + $filterRQ['name'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterRQ['name'] .= $args->and_or . + " NHRQ.name $this->likeOp '%{$target}%' "; + } + $filterRQ['name'] .= ')'; + } + + if ($args->rq_doc_id) { + $filterRQ['req_doc_id'] = ' OR ( '; + $filterRQ['req_doc_id'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + foreach ($targetSet as $target) { + $filterRQ['req_doc_id'] .= $args->and_or . + " RQ.req_doc_id $this->likeOp '%{$target}%' "; + } + $filterRQ['req_doc_id'] .= ')'; + } + } + + $otherFRQ = ''; + if (! is_null($filterRQ)) { + $otherFRQ = " AND (" . implode("", $filterRQ) . ")"; + } + + $xfil = ''; + if (! is_null($fi)) { + $xfil = implode("", $fi); + } + + $sql .= $xfil . $otherFRQ; + if ($doFilter) { + // DEBUGecho __FUNCTION__ . ' SQL Line:' . __LINE__ . $sql .'
    '; + $mapRQ = $db->fetchRowsIntoMap($sql, 'req_id'); + } + + return $mapRQ; + } + } + + /** + */ + public function searchTestSuites($targetSet, $canUseTarget) + { + + // shortcuts + $args = &$this->args; + $db = &$this->db; + $tables = &$this->tables; + $cfg = config_get('UDFStripHTMLTags'); + $udf = $cfg ? 'UDFStripHTMLTags' : ''; + + $mapTS = null; + $tsuiteSet = $this->getTestSuiteIDSet($args->tproject_id); + if (is_null($tsuiteSet) || count($tsuiteSet) == 0) { + return null; + } + + $filterSpecial = null; + $filterSpecial['tricky'] = " 1=0 "; + + if ($args->ts_summary && $canUseTarget) { + $filterSpecial['ts_summary'] = ' OR ( '; + $filterSpecial['ts_summary'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterSpecial['ts_summary'] .= $args->and_or . + " $udf(TS.details) $this->likeOp '%{$target}%' "; + } + $filterSpecial['ts_summary'] .= ')'; + } + + if ($args->ts_title && $canUseTarget) { + $filterSpecial['ts_title'] = ' OR ( '; + $filterSpecial['ts_title'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterSpecial['ts_title'] .= $args->and_or . + " NH_TS.name $this->likeOp '%{$target}%' "; + } + $filterSpecial['ts_title'] .= ')'; + } + + $otherFilters = ''; + if (! is_null($filterSpecial)) { + $otherFilters = " AND (" . implode("", $filterSpecial) . ")"; + } + + if ($args->ts_title || $args->ts_summary) { + $fromTS['by_keyword_id'] = ''; + $filterTS['by_keyword_id'] = ''; + if ($args->keyword_id) { + $fromTS['by_keyword_id'] = " JOIN {$tables['object_keywords']} KW ON KW.fk_id = NH_TS.id "; + $filterTS['by_keyword_id'] = " AND KW.keyword_id = " . + $args->keyword_id; + } + + $sqlFields = " SELECT NH_TS.name, TS.id, TS.details " . + " FROM {$tables['nodes_hierarchy']} NH_TS " . + " JOIN {$tables['testsuites']} TS ON TS.id = NH_TS.id " . + $fromTS['by_keyword_id'] . " WHERE TS.id IN (" . + implode(',', $tsuiteSet) . ")"; + + $sql = $sqlFields . $filterTS['by_keyword_id'] . $otherFilters; + $mapTS = $db->fetchRowsIntoMap($sql, 'id'); + + // DEBUGecho 'DEBUG===' . $sql; + } + + return $mapTS; + } + + /** + */ + public function searchTestCases($tcaseSet, $targetSet, $canUseTarget, + $tc_cf_id) + { + // shortcuts + $args = &$this->args; + $gui = &$this->gui; + $db = &$this->db; + $tables = &$this->tables; + $views = &$this->views; + $cfg = config_get('UDFStripHTMLTags'); + $udf = $cfg ? 'UDFStripHTMLTags' : ''; + + $from['tc_steps'] = ""; + $from['users'] = ""; + $from['by_keyword_id'] = ""; + $from['by_custom_field'] = ""; + + $filter = null; + $filterSpecial = null; + + if (is_null($tcaseSet) || count($tcaseSet) == 0) { + return null; + } + + $filter['by_tc_internal_id'] = " AND NH_TCV.parent_id IN (" . + implode(",", $tcaseSet) . ") "; + + $filterSpecial['tricky'] = " 1=0 "; + + if ($args->tc_id) { + $filterSpecial['by_tc_id'] = ''; + + // Remember that test case id is a number! + foreach ($targetSet as $tgx) { + $target = trim($tgx); + if (is_numeric($target)) { + $filterSpecial['by_tc_id'] .= $args->and_or . + " TCV.tc_external_id = $target "; + } + } + } + + $doFilter = false; + $doFilter = ($args->tc_summary || $args->tc_title || $args->tc_id); + + if ($tc_cf_id > 0) { + $cf_def = $gui->design_cf_tc[$tc_cf_id]; + + $from['by_custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id=NH_TCV.id "; + $filter['by_custom_field'] = " AND CFD.field_id=" . intval( + $tc_cf_id); + + switch ($gui->cf_types[$cf_def['type']]) { + case 'date': + $args->custom_field_value = $cfieldMgr->cfdate2mktime( + $args->custom_field_value); + + $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; + break; + + default: + $args->custom_field_value = $db->prepare_string( + $args->custom_field_value); + $filter['by_custom_field'] .= " AND CFD.value $this->likeOp '%{$args->custom_field_value}%' "; + break; + } + } + + if ($args->tc_steps || $args->tc_expected_results) { + $doFilter = true; + $from['tc_steps'] = " LEFT OUTER JOIN {$tables['nodes_hierarchy']} " . + " NH_TCSTEPS ON NH_TCSTEPS.parent_id = NH_TCV.id " . + " LEFT OUTER JOIN {$tables['tcsteps']} TCSTEPS " . + " ON NH_TCSTEPS.id = TCSTEPS.id "; + } + + if ($args->tc_steps && $canUseTarget) { + $filterSpecial['by_steps'] = ' OR ( '; + $filterSpecial['by_steps'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterSpecial['by_steps'] .= $args->and_or . + " $udf(TCSTEPS.actions) $this->likeOp '%{$target}%' "; + } + $filterSpecial['by_steps'] .= ')'; + } + + if ($args->tc_expected_results && $canUseTarget) { + $filterSpecial['by_expected_results'] = ' OR ( '; + $filterSpecial['by_expected_results'] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterSpecial['by_expected_results'] .= $args->and_or . + " $udf(TCSTEPS.expected_results) $this->likeOp '%{$target}%' "; + } + $filterSpecial['by_expected_results'] .= ')'; + } + + if ($canUseTarget) { + $k2w = array( + 'name' => 'NH_TC', + 'summary' => 'TCV', + 'preconditions' => 'TCV' + ); + $i2s = array( + 'name' => 'tc_title', + 'summary' => 'tc_summary', + 'preconditions' => 'tc_preconditions' + ); + foreach ($k2w as $kf => $alias) { + $in = $i2s[$kf]; + if ($args->$in) { + $doFilter = true; + + $filterSpecial[$kf] = ' OR ( '; + $filterSpecial[$kf] .= $args->and_or == 'or' ? ' 1=0 ' : ' 1=1 '; + + foreach ($targetSet as $target) { + $filterSpecial[$kf] .= " {$args->and_or} "; + $xx = "{$alias}.{$kf}"; + switch ($kf) { + case 'summary': + case 'preconditions': + $xx = " $udf(" . $xx . ") "; + break; + } + $filterSpecial[$kf] .= "{$xx} {$this->likeOp} '%{$target}%' "; + } + $filterSpecial[$kf] .= ' )'; + } + } + } + + $otherFilters = ''; + if (! is_null($filterSpecial) && count($filterSpecial) > 1) { + $otherFilters = " AND (/* filterSpecial */ " . + implode("", $filterSpecial) . ")"; + } + + // Search on latest test case version using view + $sqlFields = " SELECT LVN.testcase_id, NH_TC.name, TCV.id AS tcversion_id," . + " TCV.summary, TCV.version, TCV.tc_external_id "; + + if ($doFilter) { + if ($args->tcWKFStatus > 0) { + $tg = intval($args->tcWKFStatus); + $filter['by_tcWKFStatus'] = " AND TCV.status = {$tg} "; + } + + if ($args->keyword_id) { + $from['by_keyword_id'] = " JOIN {$tables['testcase_keywords']} KW ON KW.testcase_id = NH_TC.id "; + $filter['by_keyword_id'] = " AND KW.keyword_id = " . + $args->keyword_id; + } + + $created_by_on_tc = $args->created_by = trim($args->created_by); + $from['users'] = ''; + if ($created_by_on_tc != '') { + $doFilter = true; + $from['users'] .= " JOIN {$tables['users']} AUTHOR ON AUTHOR.id = TCV.author_id "; + $filter['author'] = " AND ( AUTHOR.login $this->likeOp '%{$args->created_by}%' OR " . + " AUTHOR.first $this->likeOp '%{$args->created_by}%' OR " . + " AUTHOR.last $this->likeOp '%{$args->created_by}%') "; + } + + $edited_by_on_tc = $args->edited_by = trim($args->edited_by); + if ($edited_by_on_tc != '') { + $doFilter = true; + $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = TCV.updater_id "; + $filter['modifier'] = " AND ( UPDATER.login $this->likeOp '%{$args->edited_by}%' OR " . + " UPDATER.first $this->likeOp '%{$args->edited_by}%' OR " . + " UPDATER.last $this->likeOp '%{$args->edited_by}%') "; + } + } + + // search fails if test case has 0 steps - Added LEFT OUTER + $sqlPart2 = " FROM {$views['latest_tcase_version_number']} LVN " . + " JOIN {$tables['nodes_hierarchy']} NH_TC ON NH_TC.id = LVN.testcase_id " . + " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TC.id " . + " JOIN {$tables['tcversions']} TCV ON NH_TCV.id = TCV.id " . + " AND TCV.version = LVN.version " . $from['tc_steps'] . + $from['users'] . $from['by_keyword_id'] . $from['by_custom_field'] . + " WHERE LVN.testcase_id IN (" . implode(',', $tcaseSet) . ")"; + + $mapTC = null; + if ($doFilter) { + $mixedFilter = $this->getFilters(); + if ($filter) { + $sqlPart2 .= implode("", $filter); + } + + if ($mixedFilter['dates4tc']) { + $sqlPart2 .= implode("", $mixedFilter['dates4tc']); + } + + $sql = $sqlFields . $sqlPart2 . $otherFilters; + + // DEBUGecho __FUNCTION__ . '-' . __LINE__ . '-' . $sql .'
    '; + $mapTC = $db->fetchRowsIntoMap($sql, 'testcase_id'); + } + + return $mapTC; + } + + /** + */ + public static function getTestCaseWKFStatusDomain() + { + $cv = array_flip(config_get('testCaseStatus')); + foreach ($cv as $cc => $vv) { + $cv[$cc] = lang_get('testCaseStatus_' . $vv); + } + return $cv; + } +} diff --git a/lib/search/searchForm.php b/lib/search/searchForm.php index a9bc7bb4a8..eac6f6e969 100644 --- a/lib/search/searchForm.php +++ b/lib/search/searchForm.php @@ -1,81 +1,87 @@ -assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'tcSearchForm.tpl'); -/** - * - * - */ -function init_args() -{ - $args = new stdClass(); - $args->tprojectID = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - - if($args->tprojectID <= 0) - { - throw new Exception("Error Processing Request - Invalid Test project id " . __FILE__); - } - - return $args; +assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'tcSearchForm.tpl'); + +/** + */ +function initArgs() +{ + $args = new stdClass(); + $args->tprojectID = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + + if ($args->tprojectID <= 0) { + throw new Exception( + "Error Processing Request - Invalid Test project id " . __FILE__); + } + + return $args; +} + +function initializeGui(&$dbHandler, &$argsObj) +{ + $tproject_mgr = new testproject($dbHandler); + + $gui = new stdClass(); + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tprojectID) . + config_get('testcase_cfg')->glue_character; + $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; + $gui->importance = config_get('testcase_importance_default'); + $gui->creation_date_from = null; + $gui->creation_date_to = null; + $gui->modification_date_from = null; + $gui->modification_date_to = null; + $gui->search_important_notice = sprintf(lang_get('search_important_notice'), + $argsObj->tprojectName); + + $gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design( + $argsObj->tprojectID, cfield_mgr::ENABLED, null, 'testcase'); + + $gui->keywords = $tproject_mgr->getKeywords($argsObj->tprojectID); + + $gui->filter_by['design_scope_custom_fields'] = ! is_null($gui->design_cf); + $gui->filter_by['keyword'] = ! is_null($gui->keywords); + + $reqSpecSet = $tproject_mgr->genComboReqSpec($argsObj->tprojectID); + $gui->filter_by['requirement_doc_id'] = ! is_null($reqSpecSet); + + $gui->option_importance = array( + 0 => '', + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $gui->domainTCStatus = array( + 0 => '' + ) + $dummy['lbl']; + return $gui; } - -function initializeGui(&$dbHandler,&$argsObj) -{ - - $tproject_mgr = new testproject($dbHandler); - - $gui = new stdClass(); - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tprojectID) . config_get('testcase_cfg')->glue_character; - $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; - $gui->importance = config_get('testcase_importance_default'); - $gui->creation_date_from = null; - $gui->creation_date_to = null; - $gui->modification_date_from = null; - $gui->modification_date_to = null; - $gui->search_important_notice = sprintf(lang_get('search_important_notice'),$argsObj->tprojectName); - - $gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design($argsObj->tprojectID,cfield_mgr::ENABLED,null,'testcase'); - - $gui->keywords = $tproject_mgr->getKeywords($argsObj->tprojectID); - - $gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf); - $gui->filter_by['keyword'] = !is_null($gui->keywords); - - $reqSpecSet = $tproject_mgr->genComboReqSpec($argsObj->tprojectID); - $gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet); - - $gui->option_importance = array(0 => '',HIGH => lang_get('high_importance'),MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $gui->domainTCStatus = array(0 => '') + $dummy['lbl']; - return $gui; -} \ No newline at end of file diff --git a/lib/search/searchMgmt.php b/lib/search/searchMgmt.php index 3c42c7b5fb..4054e26aa8 100644 --- a/lib/search/searchMgmt.php +++ b/lib/search/searchMgmt.php @@ -1,137 +1,128 @@ - array(tlInputParameter::STRING_N,0,200), - "caller" => array(tlInputParameter::STRING_N,0,20)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $tprojectMgr = new testproject($dbHandler); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - - if(is_null($args->tcaseTestProject)) - { - $args->tcaseTestProject = $tprojectMgr->get_by_id($args->tproject_id); - } - return $args; -} - - - -/** - * - * - */ -function initializeEnv($dbHandler) -{ - $args = init_args($dbHandler); - $gui = new stdClass(); - - $grant2check = array('mgt_modify_tc','mgt_view_req','testplan_planning', - 'mgt_modify_product', - 'mgt_modify_req','testcase_freeze', - 'testproject_edit_executed_testcases','testproject_delete_executed_testcases'); - $grants = new stdClass(); - foreach($grant2check as $right) - { - $grants->$right = $_SESSION['currentUser']->hasRight($dbHandler,$right,$args->tproject_id); - $gui->$right = $grants->$right; - } - - $gui->target = $args->target; - $gui->form_token = $args->form_token; - $gui->tproject_id = $args->tproject_id; - $gui->page_title = lang_get('container_title_' . $args->feature); - $gui->caller = trim($args->caller); - return array($args,$gui,$grants); -} - - -/** - * - * - */ -function processSearch(&$dbHandler) -{ - //$cfg = array('testcase' => config_get('testcase_cfg'), - // 'testcase_reorder_by' => config_get('testcase_reorder_by'), - // 'spec' => config_get('spec_cfg')); - - // list($args,$gui,$grants) = initializeEnv($dbHandler); - - $tplEngine = new TLSmarty(); - $tplEngine->tlTemplateCfg = $templateCfg = templateConfiguration(); - - $cmdMgr = new searchCommands($dbHandler); - $cmdMgr->initEnv(); - - $args = $cmdMgr->getArgs(); - - - // need to initialize search fields - $xbm = $cmdMgr->getGui(); - $xbm->warning_msg = lang_get('no_records_found'); - - $xbm->forceSearch = (strlen(trim($args->target)) > 0); - $xbm->caller = basename(__FILE__); - - $xbm->tc_summary = $xbm->tc_title = 1; - $xbm->tc_steps = $xbm->tc_expected_results = $xbm->tc_id = 1; - $xbm->tc_preconditions = $xbm->ts_summary = $xbm->ts_title = 1; - - if($xbm->reqEnabled) - { - $xbm->rs_scope = $xbm->rs_title = 1; - $xbm->rq_scope = $xbm->rq_title = $xbm->rq_doc_id = 1; - } - - - /* - $xbm->filter_by['custom_fields'] = !is_null($args->cf); - $xbm->cf = $args->cf; - $xbm->filter_by['keyword'] = !is_null($args->keywords); - $xbm->keywords = $args->keywords; - $xbm->tcWKFStatus = 0; - $xbm->tcWKFStatusDomain = searchCommands::getTestCaseWKFStatusDomain(); - */ - - $tplEngine->assign('gui',$xbm); - $tplEngine->display($templateCfg->template_dir . 'searchResults.tpl'); -} - -/** - * - */ -function getSearchSkeleton($userInput=null) -{ - $sk = new stdClass(); - - $sk->searchText = null; - - return $sk; + array( + tlInputParameter::STRING_N, + 0, + 200 + ), + "caller" => array( + tlInputParameter::STRING_N, + 0, + 20 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $tprojectMgr = new testproject($dbHandler); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + + if (is_null($args->tcaseTestProject)) { + $args->tcaseTestProject = $tprojectMgr->get_by_id($args->tproject_id); + } + return $args; +} + +/** + */ +function initializeEnv($dbHandler) +{ + $args = initArgs($dbHandler); + $gui = new stdClass(); + + $grant2check = array( + 'mgt_modify_tc', + 'mgt_view_req', + 'testplan_planning', + 'mgt_modify_product', + 'mgt_modify_req', + 'testcase_freeze', + 'testproject_edit_executed_testcases', + 'testproject_delete_executed_testcases' + ); + $grants = new stdClass(); + foreach ($grant2check as $right) { + $grants->$right = $_SESSION['currentUser']->hasRight($dbHandler, $right, + $args->tproject_id); + $gui->$right = $grants->$right; + } + + $gui->target = $args->target; + $gui->form_token = $args->form_token; + $gui->tproject_id = $args->tproject_id; + $gui->page_title = lang_get('container_title_' . $args->feature); + $gui->caller = trim($args->caller); + return array( + $args, + $gui, + $grants + ); +} + +/** + */ +function processSearch(&$dbHandler) +{ + $tplEngine = new TLSmarty(); + $tplEngine->tlTemplateCfg = $templateCfg = templateConfiguration(); + + $cmdMgr = new searchCommands($dbHandler); + $cmdMgr->initEnv(); + + $args = $cmdMgr->getArgs(); + + // need to initialize search fields + $xbm = $cmdMgr->getGui(); + $xbm->warning_msg = lang_get('no_records_found'); + + $xbm->forceSearch = (strlen(trim($args->target)) > 0); + $xbm->caller = basename(__FILE__); + + $xbm->tc_summary = $xbm->tc_title = 1; + $xbm->tc_steps = $xbm->tc_expected_results = $xbm->tc_id = 1; + $xbm->tc_preconditions = $xbm->ts_summary = $xbm->ts_title = 1; + + if ($xbm->reqEnabled) { + $xbm->rs_scope = $xbm->rs_title = 1; + $xbm->rq_scope = $xbm->rq_title = $xbm->rq_doc_id = 1; + } + + $tplEngine->assign('gui', $xbm); + $tplEngine->display($templateCfg->template_dir . 'searchResults.tpl'); +} + +/** + */ +function getSearchSkeleton($userInput = null) +{ + $sk = new stdClass(); + + $sk->searchText = null; + + return $sk; } diff --git a/lib/testcases/archiveData.php b/lib/testcases/archiveData.php index e72fd27166..e341f24b37 100644 --- a/lib/testcases/archiveData.php +++ b/lib/testcases/archiveData.php @@ -1,440 +1,515 @@ -tlTemplateCfg = $templateCfg = templateConfiguration(); - -$cfg = array('testcase' => config_get('testcase_cfg'),'testcase_reorder_by' => config_get('testcase_reorder_by'), - 'spec' => config_get('spec_cfg')); - -list($args,$gui,$grants) = initializeEnv($db); - - -// User right at test project level has to be done -// Because this script can be called requesting an item that CAN BELONG -// to a test project DIFFERENT that value present on SESSION, -// we need to use requested item to get its right Test Project -// We will start with Test Cases ONLY -switch($args->feature) { - case 'testproject': - case 'testsuite': - $item_mgr = new $args->feature($db); - $gui->id = $args->id; - $gui->user = $args->user; - if($args->feature == 'testproject') { - $gui->id = $args->id = $args->tproject_id; - $item_mgr->show($smarty,$gui,$templateCfg->template_dir,$args->id); - } - else { - $gui->direct_link = $item_mgr->buildDirectWebLink($_SESSION['basehref'],$args->id,$args->tproject_id); - $gui->attachments = getAttachmentInfosFrom($item_mgr,$args->id); - $item_mgr->show($smarty,$gui,$templateCfg->template_dir,$args->id, - array('show_mode' => $args->show_mode)); - } - break; - - case 'testcase': - try { - processTestCase($db,$smarty,$args,$gui,$grants,$cfg); - } - catch (Exception $e) { - echo $e->getMessage(); - } - break; - - default: - tLog('Argument "edit" has invalid value: ' . $args->feature , 'ERROR'); - trigger_error($_SESSION['currentUser']->login.'> Argument "edit" has invalid value.', E_USER_ERROR); - break; -} - - - -/** - * - * - */ -function init_args(&$dbHandler) { - $_REQUEST=strings_stripSlashes($_REQUEST); - - $iParams = array("edit" => array(tlInputParameter::STRING_N,0,50), - "id" => array(tlInputParameter::INT_N), - "tcase_id" => array(tlInputParameter::INT_N), - "tcversion_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "targetTestCase" => array(tlInputParameter::STRING_N,0,24), - "show_path" => array(tlInputParameter::INT_N), - "show_mode" => array(tlInputParameter::STRING_N,0,50), - "tcasePrefix" => array(tlInputParameter::STRING_N,0,16), - "tcaseExternalID" => array(tlInputParameter::STRING_N,0,16), - "tcaseVersionNumber" => array(tlInputParameter::INT_N), - "add_relation_feedback_msg" => array(tlInputParameter::STRING_N,0,255), - "caller" => array(tlInputParameter::STRING_N,0,10)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $tprojectMgr = new testproject($dbHandler); - - $cfg = config_get('testcase_cfg'); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; - $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; - - // --------------------------- - // whitelist - $wl = array_flip(array('testcase','testproject','testsuite')); - $args->edit = trim($args->edit); - - if (!isset($wl[$args->edit])) { - tLog('Argument "edit" has invalid value: ' . $args->edit , 'ERROR'); - trigger_error($_SESSION['currentUser']->login . - '> Argument "edit" has invalid value.', E_USER_ERROR); - } - // --------------------------- - - $args->feature = $args->edit; - $args->tcaseTestProject = null; - $args->viewerArgs = null; - - $args->automationEnabled = 0; - $args->requirementsEnabled = 0; - $args->testPriorityEnabled = 0; - $args->tcasePrefix = trim($args->tcasePrefix); - $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - - - - // For more information about the data accessed in session here, see the comment - // in the file header of lib/functions/tlTestCaseFilterControl.class.php. - $args->refreshTree = getSettingFromFormNameSpace('edit_mode','setting_refresh_tree_on_action'); - - // Try to understan how this script was called. - switch($args->caller) { - case 'navBar': - systemWideTestCaseSearch($dbHandler,$args,$cfg->glue_character); - break; - - case 'openTCW': - // all data come in - // tcaseExternalID DOM-22 - // tcaseVersionNumber 1 - $args->targetTestCase = $args->tcaseExternalID; // trick for systemWideTestCaseSearch - systemWideTestCaseSearch($dbHandler,$args,$cfg->glue_character); - break; - - default: - if (!$args->tcversion_id) { - $args->tcversion_id = testcase::ALL_VERSIONS; - } - break; - } - - - // used to manage goback - if(intval($args->tcase_id) > 0) { - $args->feature = 'testcase'; - $args->id = intval($args->tcase_id); - } - - switch($args->feature) { - case 'testsuite': - $args->viewerArgs = null; - $_SESSION['setting_refresh_tree_on_action'] = ($args->refreshTree) ? 1 : 0; - break; - - case 'testcase': - $args->viewerArgs = array('action' => '', 'msg_result' => '', - 'user_feedback' => '', - 'disable_edit' => 0, 'refreshTree' => 0, - 'add_relation_feedback_msg' => $args->add_relation_feedback_msg); - - $args->id = is_null($args->id) ? 0 : $args->id; - $args->tcase_id = $args->id; - - if( is_null($args->tcaseTestProject) && $args->id > 0 ) { - $args->tcaseTestProject = $tprojectMgr->getByChildID($args->id); - } - break; - } - - if(is_null($args->tcaseTestProject)) { - $args->tcaseTestProject = $tprojectMgr->get_by_id($args->tproject_id); - } - $args->requirementsEnabled = $args->tcaseTestProject['opt']->requirementsEnabled; - $args->automationEnabled = $args->tcaseTestProject['opt']->automationEnabled; - $args->testPriorityEnabled = $args->tcaseTestProject['opt']->testPriorityEnabled; - - // get code tracker config and object to manage TestLink - CTS integration - $args->ctsCfg = null; - $args->cts = null; - - unset($tprojectMgr); - if( ($args->codeTrackerEnabled = intval($args->tcaseTestProject['code_tracker_enabled'])) ) { - $ct_mgr = new tlCodeTracker($dbHandler); - $args->ctsCfg = $ct_mgr->getLinkedTo($args->tproject_id); - $args->cts = $ct_mgr->getInterfaceObject($args->tproject_id); - - unset($ct_mgr); - } - - return $args; -} - - - -/** - * - * - */ -function initializeEnv($dbHandler) { - $args = init_args($dbHandler); - $gui = new stdClass(); - - $grant2check = - array('mgt_modify_tc','mgt_view_req','testplan_planning', - 'mgt_modify_product','mgt_modify_req','testcase_freeze', - 'keyword_assignment','req_tcase_link_management', - 'testproject_edit_executed_testcases', - 'testproject_delete_executed_testcases', - 'testproject_add_remove_keywords_executed_tcversions', - 'delete_frozen_tcversion'); - - $grants = new stdClass(); - foreach($grant2check as $right) { - $grants->$right = $_SESSION['currentUser']->hasRight($dbHandler,$right,$args->tproject_id); - $gui->$right = $grants->$right; - } - - $gui->modify_tc_rights = $gui->mgt_modify_tc; - - $gui->form_token = $args->form_token; - $gui->tproject_id = $args->tproject_id; - $gui->tplan_id = $args->tplan_id; - - $gui->page_title = lang_get('container_title_' . $args->feature); - $gui->requirementsEnabled = $args->requirementsEnabled; - $gui->automationEnabled = $args->automationEnabled; - $gui->testPriorityEnabled = $args->testPriorityEnabled; - $gui->codeTrackerEnabled = $args->codeTrackerEnabled; - $gui->cts = $args->cts; - $gui->show_mode = $args->show_mode; - $lblkey = config_get('testcase_reorder_by') == 'NAME' ? '_alpha' : '_externalid'; - $gui->btn_reorder_testcases = lang_get('btn_reorder_testcases' . $lblkey); - - // has sense only when we work on test case - $dummy = testcase::getLayout(); - $gui->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; - - $gui->platforms = null; - $gui->loadOnCancelURL = ''; - $gui->attachments = null; - $gui->direct_link = null; - $gui->steps_results_layout = config_get('spec_cfg')->steps_results_layout; - $gui->bodyOnUnload = "storeWindowSize('TCEditPopup')"; - $gui->viewerArgs = $args->viewerArgs; - - - return array($args,$gui,$grants); -} - - -/** - * - * - */ -function systemWideTestCaseSearch(&$dbHandler,&$argsObj,$glue) -{ - // Attention: - // this algorithm has potential flaw (IMHO) because we can find the glue character - // in situation where it's role is not this. - // Anyway i will work on this in the future (if I've time) - // - if (strpos($argsObj->targetTestCase,$glue) === false) { - // We suppose user was lazy enough to do not provide prefix, - // then we will try to help him/her - $argsObj->targetTestCase = $argsObj->tcasePrefix . $argsObj->targetTestCase; - } - - if( !is_null($argsObj->targetTestCase) ) { - // parse to get JUST prefix, find the last glue char. - // This useful because from navBar, user can request search of test cases that belongs - // to test project DIFFERENT to test project setted in environment - if( ($gluePos = strrpos($argsObj->targetTestCase, $glue)) !== false) { - $tcasePrefix = substr($argsObj->targetTestCase, 0, $gluePos); - } - - $tprojectMgr = new testproject($dbHandler); - $argsObj->tcaseTestProject = $tprojectMgr->get_by_prefix($tcasePrefix); - - $tcaseMgr = new testcase($dbHandler); - $argsObj->tcase_id = $tcaseMgr->getInternalID($argsObj->targetTestCase); - $dummy = $tcaseMgr->get_basic_info($argsObj->tcase_id,array('number' => $argsObj->tcaseVersionNumber)); - if(!is_null($dummy)) { - $argsObj->tcversion_id = $dummy[0]['tcversion_id']; - } - } -} - -/** - * - */ -function getSettingFromFormNameSpace($mode,$setting) -{ - $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $sd = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; - - $rtSetting = isset($sd[$setting]) ? $sd[$setting] : 0; - return $rtSetting; -} - -/** - * - * - */ -function processTestCase(&$dbHandler,$tplEngine,$args,&$gui,$grants,$cfg) { - $get_path_info = false; - $item_mgr = new testcase($dbHandler); - - - // has sense only when we work on test case - $dummy = testcase::getLayout(); - - $gui->showAllVersions = true; - $gui->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; - $gui->viewerArgs['refresh_tree'] = 'no'; - $gui->path_info = null; - $gui->platforms = null; - $gui->loadOnCancelURL = ''; - $gui->attachments = null; - $gui->direct_link = null; - $gui->steps_results_layout = $cfg['spec']->steps_results_layout; - $gui->bodyOnUnload = "storeWindowSize('TCEditPopup')"; - - if( ($args->caller == 'navBar') && !is_null($args->targetTestCase) && strcmp($args->targetTestCase,$args->tcasePrefix) != 0) { - - $args->id = $item_mgr->getInternalID($args->targetTestCase); - $args->tcversion_id = testcase::ALL_VERSIONS; - - // I've added $args->caller, in order to make clear the logic, - // because some actions need to be done ONLY - // when we have arrived to this script because user has requested - // a search from navBar. - // Before we have trusted the existence of certain variables - // (do not think this old kind of approach is good). - // - // why strcmp($args->targetTestCase,$args->tcasePrefix) ? - // because in navBar targetTestCase is initialized with testcase prefix - // to provide some help to user - // then if user request search without adding nothing, - // we will not be able to search. - // - // From navBar we want to allow ONLY to search for ONE and ONLY ONE test case ID. - // - $gui->showAllVersions = true; - $gui->viewerArgs['show_title'] = 'no'; - $gui->viewerArgs['display_testproject'] = 1; - $gui->viewerArgs['display_parent_testsuite'] = 1; - if( !($get_path_info = ($args->id > 0)) ) { - $gui->warning_msg = $args->id == 0 ? lang_get('testcase_does_not_exists') : lang_get('prefix_does_not_exists'); - } - } - - // because we can arrive here from a User Search Request, - // if args->id == 0 => nothing found - if( $args->id > 0 ) { - if( $get_path_info || $args->show_path ) { - $gui->path_info = $item_mgr->tree_manager->get_full_path_verbose($args->id); - } - $platform_mgr = new tlPlatform($dbHandler,$args->tproject_id); - - $opx = array(); - $gui->platforms = $platform_mgr->getAllAsMap(); - $gui->direct_link = $item_mgr->buildDirectWebLink($_SESSION['basehref'],$args->id); - - $gui->id = $args->id; - - $identity = new stdClass(); - $identity->id = $args->id; - $identity->tproject_id = $args->tproject_id; - $identity->version_id = intval($args->tcversion_id); - - $gui->showAllVersions = ($identity->version_id == 0); - - // Since 1.9.18, other entities (attachments, keywords, etc) - // are related to test case versions, then the choice is to provide - // in identity an specific test case version. - // If nothing has been received on args, we will get latest active. - // - $latestTCVersionID = $identity->version_id; - if( $latestTCVersionID == 0 ) { - $tcvSet = $item_mgr->getAllVersionsID($args->id); - } else { - $tcvSet = array( $latestTCVersionID ); - } - - foreach( $tcvSet as $tcvx ) { - $gui->attachments[$tcvx] = - getAttachmentInfosFrom($item_mgr,$tcvx); - } - - try { - $item_mgr->show($tplEngine,$gui,$identity,$grants); - } - catch (Exception $e) { - echo $e->getMessage(); - } - exit(); - } - else { - $templateCfg = templateConfiguration(); - - // need to initialize search fields - $xbm = $item_mgr->getTcSearchSkeleton(); - $xbm->warning_msg = lang_get('no_records_found'); - $xbm->pageTitle = lang_get('caption_search_form'); - $xbm->tableSet = null; - $xbm->doSearch = false; - $xbm->tproject_id = $args->tproject_id; - - - $tprj = new testproject($dbHandler); - $oo = $tprj->getOptions($args->tproject_id); - $xbm->filter_by['requirement_doc_id'] = $oo->requirementsEnabled; - $xbm->keywords = $tprj->getKeywords($args->tproject_id); - $xbm->filter_by['keyword'] = !is_null($xbm->keywords); - - // - $cfMgr = new cfield_mgr($dbHandler); - $xbm->design_cf = $cfMgr->get_linked_cfields_at_design($args->tproject_id, - cfield_mgr::ENABLED,null,'testcase'); - - $xbm->filter_by['design_scope_custom_fields'] = !is_null($xbm->design_cf); - - $tplEngine->assign('gui',$xbm); - $tplEngine->display($templateCfg->template_dir . 'tcSearchResults.tpl'); - } +tlTemplateCfg = $templateCfg = templateConfiguration(); + +$cfg = array( + 'testcase' => config_get('testcase_cfg'), + 'testcase_reorder_by' => config_get('testcase_reorder_by'), + 'spec' => config_get('spec_cfg') +); + +list ($args, $gui, $grants) = initializeEnv($db); + +// User right at test project level has to be done +// Because this script can be called requesting an item that CAN BELONG +// to a test project DIFFERENT that value present on SESSION, +// we need to use requested item to get its right Test Project +// We will start with Test Cases ONLY +switch ($args->feature) { + case 'testproject': + case 'testsuite': + $item_mgr = new $args->feature($db); + $gui->id = $args->id; + $gui->user = $args->user; + if ($args->feature == 'testproject') { + $gui->id = $args->id = $args->tproject_id; + $item_mgr->show($smarty, $gui, $templateCfg->template_dir, $args->id); + } else { + $gui->direct_link = $item_mgr->buildDirectWebLink( + $_SESSION['basehref'], $args->id, $args->tproject_id); + $gui->attachments = getAttachmentInfosFrom($item_mgr, $args->id); + $item_mgr->show($smarty, $gui, $templateCfg->template_dir, $args->id, + array( + 'show_mode' => $args->show_mode + )); + } + break; + + case 'testcase': + try { + processTestCase($db, $smarty, $args, $gui, $grants, $cfg); + } catch (Exception $e) { + echo $e->getMessage(); + } + break; + + default: + tLog('Argument "edit" has invalid value: ' . $args->feature, 'ERROR'); + trigger_error( + $_SESSION['currentUser']->login . + '> Argument "edit" has invalid value.', E_USER_ERROR); + break; +} + +/** + * Initialize arguments + * + * @param database $dbHandler + * @return stdClass + */ +function initArgs(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "edit" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "id" => array( + tlInputParameter::INT_N + ), + "tcase_id" => array( + tlInputParameter::INT_N + ), + "tcversion_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "targetTestCase" => array( + tlInputParameter::STRING_N, + 0, + 24 + ), + "show_path" => array( + tlInputParameter::INT_N + ), + "show_mode" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "tcasePrefix" => array( + tlInputParameter::STRING_N, + 0, + 16 + ), + "tcaseExternalID" => array( + tlInputParameter::STRING_N, + 0, + 16 + ), + "tcaseVersionNumber" => array( + tlInputParameter::INT_N + ), + "add_relation_feedback_msg" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "caller" => array( + tlInputParameter::STRING_N, + 0, + 10 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $tprojectMgr = new testproject($dbHandler); + + $cfg = config_get('testcase_cfg'); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0; + $args->user = isset($_SESSION['currentUser']) ? $_SESSION['currentUser'] : null; + + // whitelist + $wl = array_flip(array( + 'testcase', + 'testproject', + 'testsuite' + )); + $args->edit = trim($args->edit); + if (! isset($wl[$args->edit])) { + tLog('Argument "edit" has invalid value: ' . $args->edit, 'ERROR'); + trigger_error( + $_SESSION['currentUser']->login . + '> Argument "edit" has invalid value.', E_USER_ERROR); + } + + $args->feature = $args->edit; + $args->tcaseTestProject = null; + $args->viewerArgs = null; + + $args->automationEnabled = 0; + $args->requirementsEnabled = 0; + $args->testPriorityEnabled = 0; + $args->tcasePrefix = trim($args->tcasePrefix); + $args->form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + + // For more information about the data accessed in session here, see the comment + // in the file header of lib/functions/tlTestCaseFilterControl.class.php. + $args->refreshTree = getSettingFromFormNameSpace('edit_mode', + 'setting_refresh_tree_on_action'); + + // Try to understan how this script was called. + switch ($args->caller) { + case 'navBar': + systemWideTestCaseSearch($dbHandler, $args, $cfg->glue_character); + break; + + case 'openTCW': + // all data come in + // tcaseExternalID DOM-22 + // tcaseVersionNumber 1 + $args->targetTestCase = $args->tcaseExternalID; // trick for systemWideTestCaseSearch + systemWideTestCaseSearch($dbHandler, $args, $cfg->glue_character); + break; + + default: + if (! $args->tcversion_id) { + $args->tcversion_id = testcase::ALL_VERSIONS; + } + break; + } + + // used to manage goback + if (intval($args->tcase_id) > 0) { + $args->feature = 'testcase'; + $args->id = intval($args->tcase_id); + } + + switch ($args->feature) { + case 'testsuite': + $args->viewerArgs = null; + $_SESSION['setting_refresh_tree_on_action'] = ($args->refreshTree) ? 1 : 0; + break; + + case 'testcase': + $args->viewerArgs = array( + 'action' => '', + 'msg_result' => '', + 'user_feedback' => '', + 'disable_edit' => 0, + 'refreshTree' => 0, + 'add_relation_feedback_msg' => $args->add_relation_feedback_msg + ); + + $args->id = is_null($args->id) ? 0 : $args->id; + $args->tcase_id = $args->id; + + if (is_null($args->tcaseTestProject) && $args->id > 0) { + $args->tcaseTestProject = $tprojectMgr->getByChildID($args->id); + } + break; + } + + if (is_null($args->tcaseTestProject)) { + $args->tcaseTestProject = $tprojectMgr->get_by_id($args->tproject_id); + } + $args->requirementsEnabled = $args->tcaseTestProject['opt']->requirementsEnabled; + $args->automationEnabled = $args->tcaseTestProject['opt']->automationEnabled; + $args->testPriorityEnabled = $args->tcaseTestProject['opt']->testPriorityEnabled; + + // get code tracker config and object to manage TestLink - CTS integration + $args->ctsCfg = null; + $args->cts = null; + + unset($tprojectMgr); + if ($args->codeTrackerEnabled = intval( + $args->tcaseTestProject['code_tracker_enabled'])) { + $ct_mgr = new tlCodeTracker($dbHandler); + $args->ctsCfg = $ct_mgr->getLinkedTo($args->tproject_id); + $args->cts = $ct_mgr->getInterfaceObject($args->tproject_id); + + unset($ct_mgr); + } + + return $args; +} + +/** + * Initialize the environment + * + * @param database $dbHandler + * @return stdClass[] + */ +function initializeEnv($dbHandler) +{ + $args = initArgs($dbHandler); + $gui = new stdClass(); + + $grant2check = array( + 'mgt_modify_tc', + 'mgt_view_req', + 'testplan_planning', + 'mgt_modify_product', + 'mgt_modify_req', + 'testcase_freeze', + 'keyword_assignment', + 'req_tcase_link_management', + 'testproject_edit_executed_testcases', + 'testproject_delete_executed_testcases', + 'testproject_add_remove_keywords_executed_tcversions', + 'delete_frozen_tcversion' + ); + + $grants = new stdClass(); + foreach ($grant2check as $right) { + $grants->$right = $_SESSION['currentUser']->hasRight($dbHandler, $right, + $args->tproject_id); + $gui->$right = $grants->$right; + } + + $gui->modify_tc_rights = $gui->mgt_modify_tc; + + $gui->form_token = $args->form_token; + $gui->tproject_id = $args->tproject_id; + $gui->tplan_id = $args->tplan_id; + + $gui->page_title = lang_get('container_title_' . $args->feature); + $gui->requirementsEnabled = $args->requirementsEnabled; + $gui->automationEnabled = $args->automationEnabled; + $gui->testPriorityEnabled = $args->testPriorityEnabled; + $gui->codeTrackerEnabled = $args->codeTrackerEnabled; + $gui->cts = $args->cts; + $gui->show_mode = $args->show_mode; + $lblkey = config_get('testcase_reorder_by') == 'NAME' ? '_alpha' : '_externalid'; + $gui->btn_reorder_testcases = lang_get('btn_reorder_testcases' . $lblkey); + + // has sense only when we work on test case + $dummy = testcase::getLayout(); + $gui->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; + + $gui->platforms = null; + $gui->loadOnCancelURL = ''; + $gui->attachments = null; + $gui->direct_link = null; + $gui->steps_results_layout = config_get('spec_cfg')->steps_results_layout; + $gui->bodyOnUnload = "storeWindowSize('TCEditPopup')"; + $gui->viewerArgs = $args->viewerArgs; + + return array( + $args, + $gui, + $grants + ); +} + +/** + */ +function systemWideTestCaseSearch(&$dbHandler, &$argsObj, $glue) +{ + // Attention: + // this algorithm has potential flaw (IMHO) because we can find the glue character + // in situation where it's role is not this. + // Anyway i will work on this in the future (if I've time) + // + if (strpos($argsObj->targetTestCase, $glue) === false) { + // We suppose user was lazy enough to do not provide prefix, + // then we will try to help him/her + $argsObj->targetTestCase = $argsObj->tcasePrefix . + $argsObj->targetTestCase; + } + + if (! is_null($argsObj->targetTestCase)) { + // parse to get JUST prefix, find the last glue char. + // This useful because from navBar, user can request search of test cases that belongs + // to test project DIFFERENT to test project setted in environment + if (($gluePos = strrpos($argsObj->targetTestCase, $glue)) !== false) { + $tcasePrefix = substr($argsObj->targetTestCase, 0, $gluePos); + } + + $tprojectMgr = new testproject($dbHandler); + $argsObj->tcaseTestProject = $tprojectMgr->get_by_prefix($tcasePrefix); + + $tcaseMgr = new testcase($dbHandler); + $argsObj->tcase_id = $tcaseMgr->getInternalID($argsObj->targetTestCase); + $dummy = $tcaseMgr->get_basic_info($argsObj->tcase_id, + array( + 'number' => $argsObj->tcaseVersionNumber + )); + if (! is_null($dummy)) { + $argsObj->tcversion_id = $dummy[0]['tcversion_id']; + } + } +} + +/** + * getSettingFromFormNameSpace + * + * @param string $mode + * @param string $setting + * @return number + */ +function getSettingFromFormNameSpace($mode, $setting) +{ + $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $sd = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null; + + return isset($sd[$setting]) ? $sd[$setting] : 0; +} + +/** + * + * @param database $dbHandler + * @param TLSmarty $tplEngine + * @param stdClass $args + * @param stdClass $gui + * @param stdClass $grants + * @param array $cfg + */ +function processTestCase(&$dbHandler, $tplEngine, $args, &$gui, $grants, $cfg) +{ + $get_path_info = false; + $item_mgr = new testcase($dbHandler); + + // has sense only when we work on test case + $dummy = testcase::getLayout(); + + $gui->showAllVersions = true; + $gui->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; + $gui->viewerArgs['refresh_tree'] = 'no'; + $gui->path_info = null; + $gui->platforms = null; + $gui->loadOnCancelURL = ''; + $gui->attachments = null; + $gui->direct_link = null; + $gui->steps_results_layout = $cfg['spec']->steps_results_layout; + $gui->bodyOnUnload = "storeWindowSize('TCEditPopup')"; + + if (($args->caller == 'navBar') && ! is_null($args->targetTestCase) && + strcmp($args->targetTestCase, $args->tcasePrefix) != 0) { + + $args->id = $item_mgr->getInternalID($args->targetTestCase); + $args->tcversion_id = testcase::ALL_VERSIONS; + + // I've added $args->caller, in order to make clear the logic, + // because some actions need to be done ONLY + // when we have arrived to this script because user has requested + // a search from navBar. + // Before we have trusted the existence of certain variables + // (do not think this old kind of approach is good). + // + // why strcmp($args->targetTestCase,$args->tcasePrefix) ? + // because in navBar targetTestCase is initialized with testcase prefix + // to provide some help to user + // then if user request search without adding nothing, + // we will not be able to search. + // + // From navBar we want to allow ONLY to search for ONE and ONLY ONE test case ID. + // + $gui->showAllVersions = true; + $gui->viewerArgs['show_title'] = 'no'; + $gui->viewerArgs['display_testproject'] = 1; + $gui->viewerArgs['display_parent_testsuite'] = 1; + if (! ($get_path_info = ($args->id > 0))) { + $gui->warning_msg = $args->id == 0 ? lang_get( + 'testcase_does_not_exists') : lang_get('prefix_does_not_exists'); + } + } + + // because we can arrive here from a User Search Request, + // if args->id == 0 => nothing found + if ($args->id > 0) { + if ($get_path_info || $args->show_path) { + $gui->path_info = $item_mgr->tree_manager->get_full_path_verbose( + $args->id); + } + $platform_mgr = new tlPlatform($dbHandler, $args->tproject_id); + + $gui->platforms = $platform_mgr->getAllAsMap(); + $gui->direct_link = $item_mgr->buildDirectWebLink($_SESSION['basehref'], + $args->id); + + $gui->id = $args->id; + + $identity = new stdClass(); + $identity->id = $args->id; + $identity->tproject_id = $args->tproject_id; + $identity->version_id = intval($args->tcversion_id); + + $gui->showAllVersions = ($identity->version_id == 0); + + // Since 1.9.18, other entities (attachments, keywords, etc) + // are related to test case versions, then the choice is to provide + // in identity an specific test case version. + // If nothing has been received on args, we will get latest active. + // + $latestTCVersionID = $identity->version_id; + if ($latestTCVersionID == 0) { + $tcvSet = $item_mgr->getAllVersionsID($args->id); + } else { + $tcvSet = array( + $latestTCVersionID + ); + } + + foreach ($tcvSet as $tcvx) { + $gui->attachments[$tcvx] = getAttachmentInfosFrom($item_mgr, $tcvx); + } + + try { + $item_mgr->show($tplEngine, $gui, $identity, $grants); + } catch (Exception $e) { + echo $e->getMessage(); + } + exit(); + } else { + $templateCfg = templateConfiguration(); + + // need to initialize search fields + $xbm = $item_mgr->getTcSearchSkeleton(); + $xbm->warning_msg = lang_get('no_records_found'); + $xbm->pageTitle = lang_get('caption_search_form'); + $xbm->tableSet = null; + $xbm->doSearch = false; + $xbm->tproject_id = $args->tproject_id; + + $tprj = new testproject($dbHandler); + $oo = $tprj->getOptions($args->tproject_id); + $xbm->filter_by['requirement_doc_id'] = $oo->requirementsEnabled; + $xbm->keywords = $tprj->getKeywords($args->tproject_id); + $xbm->filter_by['keyword'] = ! is_null($xbm->keywords); + + // + $cfMgr = new cfield_mgr($dbHandler); + $xbm->design_cf = $cfMgr->get_linked_cfields_at_design( + $args->tproject_id, cfield_mgr::ENABLED, null, 'testcase'); + + $xbm->filter_by['design_scope_custom_fields'] = ! is_null( + $xbm->design_cf); + + $tplEngine->assign('gui', $xbm); + $tplEngine->display($templateCfg->template_dir . 'tcSearchResults.tpl'); + } } diff --git a/lib/testcases/containerEdit.php b/lib/testcases/containerEdit.php index 5b6009161d..3779b63f5a 100644 --- a/lib/testcases/containerEdit.php +++ b/lib/testcases/containerEdit.php @@ -1,1522 +1,1581 @@ -js_ot_name = 'ot'; - -$args = init_args($db,$tproject_mgr,$tsuite_mgr,$opt_cfg); -$level = isset($args->level) ? $args->level : $args->containerType; - -$gui_cfg = config_get('gui'); -$smarty = new TLSmarty(); -$smarty->assign('editorType',$editorCfg['type']); - - -list($a_tpl, $a_actions) = initTPLActions(); - -$a_init_opt_transfer = array('edit_testsuite' => 1,'new_testsuite' => 1, - 'add_testsuite' => 1,'update_testsuite' => 1); - -$the_tpl = null; -$action = null; -$get_c_data = null; -$init_opt_transfer = null; - - -// 20121222 -franciscom -// Need this trick because current implementation of Ext.ux.requireSessionAndSubmit() -// discards the original submit button -if( isset($_REQUEST['doAction']) ) { - $_POST[$_REQUEST['doAction']] = $_REQUEST['doAction']; -} -$action = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; - -foreach ($a_actions as $the_key => $the_val) { - if (isset($_POST[$the_key]) ) { - $the_tpl = isset($a_tpl[$the_key]) ? $a_tpl[$the_key] : null; - $init_opt_transfer = isset($a_init_opt_transfer[$the_key])?1:0; - - $action = $the_key; - $get_c_data = $the_val; - $level = is_null($level) ? 'testsuite' : $level; - break; - } -} -$args->action = $action; - -$smarty->assign('level', $level); -$smarty->assign('page_title',lang_get('container_title_' . $level)); - -if($init_opt_transfer) { - $opt_cfg = initializeOptionTransfer($tproject_mgr,$tsuite_mgr,$args,$action); -} - -// create web editor objects -list($oWebEditor,$webEditorHtmlNames,$webEditorTemplateKey) = initWebEditors($action,$level,$editorCfg); -if($get_c_data) { - $name_ok = 1; - $c_data = getValuesFromPost($webEditorHtmlNames); - if($name_ok && !check_string($c_data['container_name'],$g_ereg_forbidden)) { - $msg = $args->l10n['string_contains_bad_chars']; - $name_ok = 0; - } - - if($name_ok && ($c_data['container_name'] == "")) { - $msg = $args->l10n['warning_empty_testsuite_name']; - $name_ok = 0; - } -} - -$doIt = true; -switch($action) { - case 'fileUpload': - case 'deleteFile': - case 'edit_testsuite': - case 'new_testsuite': - case 'delete_testsuite': - case 'move_testsuite_viewer': - case 'reorder_testsuites': - case 'update_testsuite': - case 'do_move': - case 'do_copy': - case 'do_move_tcase_set': - case 'do_copy_tcase_set': - case 'do_copy_tcase_set_ghost': - case 'add_testsuite': - case 'delete_testcases': - case 'do_delete_testcases': - case 'reorder_testcases': - case 'reorder_testsuites_alpha': - case 'reorder_testproject_testsuites_alpha': - case 'doBulkSet': - case 'addKeyword': - case 'addKeywordTSDeep': - case 'removeKeyword': - $doIt = ('yes' == $args->grants->testcase_mgmt); - break; -} - -if( $doIt ) { - switch($action) { - case 'fileUpload': - switch($level) { - case 'testsuite': - $uploadOp = fileUploadManagement($db,$args->testsuiteID,$args->fileTitle,$tsuite_mgr->getAttachmentTableName()); - $gui = initializeGui($tsuite_mgr,$args->testsuiteID,$args); - $gui->refreshTree = 0; - $gui->uploadOp = $uploadOp; - $tsuite_mgr->show($smarty,$gui,$template_dir,$args->testsuiteID,null,null); - break; - - case 'testproject': - $uploadOp = fileUploadManagement($db,$args->tprojectID,$args->fileTitle,$tproject_mgr->getAttachmentTableName()); - $gui = initializeGui($tproject_mgr,$args->tprojectID,$args); - $gui->refreshTree = 0; - $gui->uploadOp = $uploadOp; - - $tproject_mgr->show($smarty,$gui,$template_dir,$args->tprojectID,null,null); - break; - } - break; - - case 'deleteFile': - deleteAttachment($db,$args->file_id); - switch($level) { - case 'testsuite': - $gui = initializeGui($tsuite_mgr,$args->testsuiteID,$args); - $gui->refreshTree = 0; - $tsuite_mgr->show($smarty,$gui,$template_dir,$args->testsuiteID,null,null); - break; - - case 'testproject': - $gui = initializeGui($tproject_mgr,$args->tprojectID,$args); - $gui->refreshTree = 0; - $tproject_mgr->show($smarty,$gui,$template_dir,$args->tprojectID,null,null); - break; - } - break; - - case 'edit_testsuite': - case 'new_testsuite': - keywords_opt_transf_cfg($opt_cfg, $args->assigned_keyword_list); - - $smarty->assign('opt_cfg', $opt_cfg); - - $gui = new stdClass(); - $gui->tproject_id = $args->tprojectID; - $gui->containerType = $level; - $gui->refreshTree = $args->refreshTree; - $gui->hasKeywords = (count($opt_cfg->from->map) > 0) || (count($opt_cfg->to->map) > 0); - - $gui->cancelActionJS = 'location.href=fRoot+' . - "'lib/testcases/archiveData.php?id=" . intval($args->containerID); - switch($level) { - case 'testproject': - $gui->cancelActionJS .= "&edit=testproject&level=testproject'"; - break; - - case 'testsuite': - $gui->cancelActionJS .= "&edit=testsuite&level=testsuite&containerType=testsuite'"; - break; - } - - $smarty->assign('level', $level); - $smarty->assign('gui', $gui); - $tsuite_mgr->viewer_edit_new($smarty,$template_dir,$webEditorHtmlNames, - $oWebEditor,$action,$args->containerID, - $args->testsuiteID,null, - $webEditorTemplateKey); - break; - - case 'delete_testsuite': - $refreshTree = deleteTestSuite($smarty,$args,$tsuite_mgr,$tree_mgr,$tcase_mgr,$level); - break; - - case 'move_testsuite_viewer': - moveTestSuiteViewer($smarty,$tproject_mgr,$args); - break; - - case 'move_testcases_viewer': - moveTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$args); - break; - - case 'testcases_table_view': - $cf = null; - $cf_map = $tcase_mgr->get_linked_cfields_at_design(0,null,null,null,$args->tprojectID); - if(!is_null($cf_map)) { - $cfOpt = array('addCheck' => true, 'forceOptional' => true); - $cf = $tcase_mgr->cfield_mgr->html_table_inputs($cf_map,'',null,$cfOpt); - } - - moveTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$args,null,$cf); - break; - - - case 'reorder_testsuites': - $ret = reorderTestSuiteViewer($smarty,$tree_mgr,$args); - $level = is_null($ret) ? $level : $ret; - break; - - case 'do_move': - moveTestSuite($smarty,$template_dir,$tproject_mgr,$args); - break; - - case 'do_copy': - copyTestSuite($smarty,$template_dir,$tsuite_mgr,$args); - break; - - case 'update_testsuite': - if ($name_ok) { - $msg = updateTestSuite($tsuite_mgr,$args,$c_data,$_REQUEST); - } - $gui = initializeGui($tsuite_mgr,$args->testsuiteID,$args); - $tsuite_mgr->show($smarty,$gui,$template_dir,$args->testsuiteID,null,$msg); - break; - - case 'add_testsuite': - $messages = null; - $op['status'] = 0; - if ($name_ok) { - $op = addTestSuite($tsuite_mgr,$args,$c_data,$_REQUEST); - $messages = array( 'result_msg' => $op['messages']['msg'], - 'user_feedback' => $op['messages']['user_feedback']); - } - - // $userInput is used to maintain data filled by user if there is - // a problem with test suite name. - $userInput = $op['status'] ? null : $_REQUEST; - $assignedKeywords = $op['status'] ? "" : $args->assigned_keyword_list; - keywords_opt_transf_cfg($opt_cfg, $assignedKeywords); - $smarty->assign('opt_cfg', $opt_cfg); - - $gui = new stdClass(); - $gui->tproject_id = $args->tprojectID; - $gui->containerType = $level; - $gui->refreshTree = $args->refreshTree; - $gui->cancelActionJS = 'location.href=fRoot+' . - "'lib/testcases/archiveData.php?id=" . intval($args->containerID); - - switch($level) { - case 'testproject': - $gui->cancelActionJS .= "&edit=testproject&level=testproject'"; - break; - - case 'testsuite': - $gui->cancelActionJS .= "&edit=testsuite&level=testsuite&containerType=testsuite'"; - break; - } - - $smarty->assign('level', $level); - $smarty->assign('gui', $gui); - - $tsuite_mgr->viewer_edit_new($smarty,$template_dir,$webEditorHtmlNames, - $oWebEditor, $action,$args->containerID, null, - $messages,$webEditorTemplateKey,$userInput); - break; - - - case 'do_move_tcase_set': - moveTestCases($smarty,$template_dir,$tsuite_mgr,$tree_mgr,$args); - break; - - case 'do_copy_tcase_set': - case 'do_copy_tcase_set_ghost': - $args->stepAsGhost = ($action == 'do_copy_tcase_set_ghost'); - $op = copyTestCases($smarty,$template_dir,$tsuite_mgr,$tcase_mgr,$args); - - $refreshTree = $op['refreshTree']; - moveTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$args,$op['userfeedback']); - break; - - - case 'delete_testcases': - $args->refreshTree = false; - deleteTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$tsuite_mgr,$tcase_mgr,$args); - break; - - case 'do_delete_testcases': - $args->refreshTree = true; - doDeleteTestCases($db,$args->tcaseSet,$tcase_mgr); - deleteTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$tsuite_mgr, - $tcase_mgr,$args, - lang_get('all_testcases_have_been_deleted')); - break; - - case 'reorder_testcases': - reorderTestCasesByCriteria($args,$tsuite_mgr,$tree_mgr); - $gui = initializeGui($tsuite_mgr,$args->testsuiteID,$args); - $gui->refreshTree = true; - $tsuite_mgr->show($smarty,$gui,$template_dir,$args->testsuiteID,null,null); - break; - - - case 'reorder_testsuites_alpha': - reorderTestSuitesDictionary($args,$tree_mgr,$args->testsuiteID); - $gui = initializeGui($tsuite_mgr,$args->testsuiteID,$args); - $gui->refreshTree = true; - $tsuite_mgr->show($smarty,$gui,$template_dir,$args->testsuiteID,null,null); - break; - - case 'reorder_testproject_testsuites_alpha': - reorderTestSuitesDictionary($args,$tree_mgr,$args->tprojectID); - $gui = initializeGui($tproject_mgr,$args->tprojectID,$args); - $gui->refreshTree = true; - $tproject_mgr->show($smarty,$gui,$template_dir,$args->tprojectID,null,null); - break; - - case 'doBulkSet': - $args->refreshTree = true; - doBulkSet($db,$args,$args->tcaseSet,$tcase_mgr); - - $cf = null; - $cf_map = $tcase_mgr->get_linked_cfields_at_design(0,null,null,null,$args->tprojectID); - if(!is_null($cf_map)) { - $cfOpt = array('addCheck' => true, 'forceOptional' => true); - $cf = $tcase_mgr->cfield_mgr->html_table_inputs($cf_map,'',null,$cfOpt); - } - - moveTestCasesViewer($db,$smarty,$tproject_mgr,$tree_mgr,$args,null,$cf); - break; - - case 'addKeyword': - $tsuite_mgr->addKeywords($args->item_id,$args->free_keywords); - showTestSuite($smarty,$args,$tsuite_mgr,$template_dir); - exit(); - break; - - case 'addKeywordTSDeep': - $tsuite_mgr->addKeywordsDeep($args->item_id,$args->free_keywords); - showTestSuite($smarty,$args,$tsuite_mgr,$template_dir); - exit(); - break; - - case 'removeKeyword': - $tsuite_mgr->deleteKeywordByLinkID($args->kw_link_id); - showTestSuite($smarty,$args,$tsuite_mgr,$template_dir); - exit(); - break; - - - default: - trigger_error("containerEdit.php - No correct GET/POST data", E_USER_ERROR); - break; - } -} - - -if($the_tpl) { - $smarty->assign('refreshTree',$refreshTree && $args->refreshTree); - $smarty->display($template_dir . $the_tpl); -} - - -/** - * - * - */ -function getValuesFromPost($akeys2get) { - $akeys2get[] = 'container_name'; - $c_data = array(); - foreach($akeys2get as $key) { - $c_data[$key] = isset($_POST[$key]) ? strings_stripSlashes($_POST[$key]) : null; - } - return $c_data; -} - -/* - function: - -args : - -returns: - -*/ -function build_del_testsuite_warning_msg(&$tree_mgr,&$tcase_mgr,&$testcases,$tsuite_id) -{ - $msg = null; - $msg['warning'] = null; - $msg['link_msg'] = null; - $msg['delete_msg'] = null; - - if(!is_null($testcases)) { - $show_warning = 0; - $delete_msg = ''; - $verbose = array(); - $msg['link_msg'] = array(); - - $status_warning = array('linked_and_executed' => 1, - 'linked_but_not_executed' => 1, - 'no_links' => 0); - - $delete_notice = array('linked_and_executed' => lang_get('delete_notice'), - 'linked_but_not_executed' => '', - 'no_links' => ''); - - $getOptions = array('addExecIndicator' => true); - foreach($testcases as $the_key => $elem) { - $verbose[] = $tree_mgr->get_path($elem['id'],$tsuite_id); - $xx = $tcase_mgr->get_exec_status($elem['id'],null,$getOptions); - $status = 'no_links'; - if(!is_null($xx)) { - $status = $xx['executed'] ? 'linked_and_executed' : 'linked_but_not_executed'; - } - $msg['link_msg'][] = $status; - - if($status_warning[$status]) { - $show_warning = 1; - $msg['delete_msg'] = $delete_notice[$status]; - } - } - - $idx = 0; - if($show_warning) { - $msg['warning'] = array(); - foreach($verbose as $the_key => $elem) { - $msg['warning'][$idx] = ''; - $bSlash = false; - foreach($elem as $tkey => $telem) { - if ($bSlash) { - $msg['warning'][$idx] .= "\\"; - } - $msg['warning'][$idx] .= $telem['name']; - $bSlash = true; - } - $idx++; - } - } - else { - $msg['link_msg'] = null; - $msg['warning'] = null; - } - } - return $msg; -} - - -/* - function: - -args : - -returns: - -*/ -function init_args(&$dbHandler,&$tprojectMgr,&$tsuiteMgr,$optionTransferCfg) { - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->kw_link_id = isset($_REQUEST['kw_link_id']) ? - intval($_REQUEST['kw_link_id']) : null; - - $args->item_id = isset($_REQUEST['item_id']) ? - intval($_REQUEST['item_id']) : null; - - $args->free_keywords = isset($_REQUEST['free_keywords']) ? - $_REQUEST['free_keywords'] : null; - - $args->containerID = isset($_REQUEST['containerID']) ? - $_REQUEST['containerID'] : null; - - // check againts whitelist - $args->objectType = isset($_REQUEST['objectType']) ? - $_REQUEST['objectType'] : null; - - $args->containerType = isset($_REQUEST['containerType']) ? - $_REQUEST['containerType'] : null; - - if( null != $args->containerType ) { - $ctWhiteList = array('testproject' => 'OK','testsuite' => 'OK'); - if(!is_null($args->containerType) && - !isset($ctWhiteList[$args->containerType])) { - $args->containerType = null; - } - } - - // When Deleting Test suite - container ID is not set - if( is_null($args->containerID) ) { - $args->containerType = is_null($args->containerType) ? 'testproject' : - $args->containerType; - } - - if( null == $args->containerType ) { - throw new Exception("Error No Container Type", 1); - } - - - $args->testsuiteID = isset($_REQUEST['testsuiteID']) ? intval($_REQUEST['testsuiteID']) : null; - $args->tsuite_name = isset($_REQUEST['testsuiteName']) ? $_REQUEST['testsuiteName'] : null; - - // Order is critic - $args->objectID = isset($_REQUEST['objectID']) ? intval($_REQUEST['objectID']) : null; - $args->containerID = isset($_REQUEST['containerID']) ? - intval($_REQUEST['containerID']) : $args->objectID; - - switch( $args->containerType ) { - case 'testproject': - $args->tprojectID = $args->containerID; - break; - - case 'testsuite': - $nodeID = !is_null($args->testsuiteID) ? $args->testsuiteID : - $args->containerID; - $args->tprojectID = $tsuiteMgr->getTestProjectFromTestSuite($nodeID,null); - break; - } - - if( intval($args->tprojectID) == 0 ) { - if( isset($_REQUEST['tproject_id']) ) { - $args->tprojectID = intval($_REQUEST['tproject_id']); - } - - if( isset($_REQUEST['tprojectID']) ) { - $args->tprojectID = intval($_REQUEST['tprojectID']); - } - } - - // very ugly - $args->level = null; - if( isset($_REQUEST['delete_testsuite']) ) { - $args->level = $args->objectType; - } - - - $info = $tprojectMgr->get_by_id($args->tprojectID, - array('output' => 'name')); - $args->tprojectName = $info['name']; - - $args->userID = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0; - $args->file_id = isset($_REQUEST['file_id']) ? intval($_REQUEST['file_id']) : 0; - $args->fileTitle = isset($_REQUEST['fileTitle']) ? trim($_REQUEST['fileTitle']) : ''; - - - $k2l = array('tc_status','importance','execution_type'); - foreach($k2l as $kv) { - $args->$kv = isset($_REQUEST[$kv]) ? intval($_REQUEST[$kv]) : -1; - } - - $args->user = $_SESSION['currentUser']; - - $args->grants = new stdClass(); - $args->grants->delete_executed_testcases = - $args->user->hasRight($dbHandler,'testproject_delete_executed_testcases',$args->tprojectID); - - $args->grants->testcase_mgmt = - $args->user->hasRight($dbHandler,'mgt_modify_tc',$args->tprojectID); - - - $keys2loop=array('nodes_order' => null, 'tcaseSet' => null, - 'target_position' => 'bottom', 'doAction' => ''); - foreach($keys2loop as $key => $value) { - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; - } - - $args->bSure = (isset($_REQUEST['sure']) && ($_REQUEST['sure'] == 'yes')); - $rl_html_name = $optionTransferCfg->js_ot_name . "_newRight"; - $args->assigned_keyword_list = isset($_REQUEST[$rl_html_name])? $_REQUEST[$rl_html_name] : ""; - - - $keys2loop = array('copyKeywords' => 0,'copyRequirementAssignments' => 0); - - foreach($keys2loop as $key => $value) { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : $value; - } - - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? - $_SESSION['setting_refresh_tree_on_action'] : 0; - $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; - $args->testCaseSet = null; - - if($args->treeFormToken >0) { - $mode = 'edit_mode'; - $sdata = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$args->treeFormToken]) ? - $_SESSION[$mode][$args->treeFormToken] : null; - $args->testCaseSet = isset($sdata['testcases_to_show']) ? $sdata['testcases_to_show'] : null; - } - - $dummy = ($sortCriteria = config_get('testcase_reorder_by')) == 'NAME' ? '_alpha' : - '_externalid'; - $lbl2init = array('warning_empty_testsuite_name' => null, - 'string_contains_bad_chars' => null, - 'container_title_testsuite' => null, - 'btn_reorder_testcases' => 'btn_reorder_testcases' . $dummy); - $args->l10n = init_labels($lbl2init); - - return $args; -} - - -/* - function: - -args: - -returns: - -*/ -function writeCustomFieldsToDB(&$db,$tprojectID,$tsuiteID,&$hash) -{ - $ENABLED = 1; - $NO_FILTERS = null; - - $cfield_mgr = new cfield_mgr($db); - $cf_map = $cfield_mgr->get_linked_cfields_at_design($tprojectID,$ENABLED, - $NO_FILTERS,'testsuite'); - $cfield_mgr->design_values_to_db($hash,$tsuiteID,$cf_map); -} - - -/* - function: deleteTestSuite - -args: - -returns: true -> refresh tree -false -> do not refresh - -*/ -function deleteTestSuite(&$smartyObj,&$argsObj,&$tsuiteMgr,&$treeMgr,&$tcaseMgr,$level) -{ - - $feedback_msg = ''; - $system_message = ''; - $testcase_cfg = config_get('testcase_cfg'); - $can_delete = 1; - - if($argsObj->bSure) { - $tsuite = $tsuiteMgr->get_by_id($argsObj->objectID); - $tsuiteMgr->delete_deep($argsObj->objectID); - $tsuiteMgr->deleteKeywords($argsObj->objectID); - $smartyObj->assign('objectName', $tsuite['name']); - $doRefreshTree = true; - $feedback_msg = 'ok'; - $smartyObj->assign('user_feedback',lang_get('testsuite_successfully_deleted')); - } - else { - $doRefreshTree = false; - - // Get test cases present in this testsuite and all children - $testcases = $tsuiteMgr->get_testcases_deep($argsObj->testsuiteID); - $map_msg['warning'] = null; - $map_msg['link_msg'] = null; - $map_msg['delete_msg'] = null; - - if(is_null($testcases) || count($testcases) == 0) { - $can_delete = 1; - } - else { - $map_msg = build_del_testsuite_warning_msg($treeMgr,$tcaseMgr,$testcases,$argsObj->testsuiteID); - if( in_array('linked_and_executed', (array)$map_msg['link_msg']) ) { - $can_delete = $argsObj->grants->delete_executed_testcases; - } - } - - $system_message = ''; - if(!$can_delete && !$argsObj->grants->delete_executed_testcases) { - $system_message = lang_get('system_blocks_tsuite_delete_due_to_exec_tc'); - } - - // prepare to show the delete confirmation page - $smartyObj->assign('can_delete',$can_delete); - $smartyObj->assign('objectID',$argsObj->testsuiteID); - $smartyObj->assign('objectType','testsuite'); - $smartyObj->assign('objectName', $argsObj->tsuite_name); - $smartyObj->assign('containerType', $argsObj->containerType); - $smartyObj->assign('delete_msg',$map_msg['delete_msg']); - $smartyObj->assign('warning', $map_msg['warning']); - $smartyObj->assign('link_msg', $map_msg['link_msg']); - } - $smartyObj->assign('system_message', $system_message); - $smartyObj->assign('page_title', lang_get('delete') . " " . lang_get('container_title_' . $level)); - $smartyObj->assign('sqlResult',$feedback_msg); - - return $doRefreshTree; -} - -/* - function: addTestSuite - -args: - -returns: map with messages and status - -revision: -20101012 - franciscom - BUGID 3890 -when creating action on duplicate is setted to BLOCK without using -config_get('action_on_duplicate_name'). -This is because this config option has to be used ONLY when copying/moving not when creating. - -20091206 - franciscom - new items are created as last element of tree branch - -*/ -function addTestSuite(&$tsuiteMgr,&$argsObj,$container,&$hash) { - $new_order = null; - - // compute order - // - // $nt2exclude=array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me'); - // $siblings = $tsuiteMgr->tree_manager->get_children($argsObj->containerID,$nt2exclude); - // if( !is_null($siblings) ) - //{ - // $dummy = end($siblings); - // $new_order = $dummy['node_order']+1; - //} - $ret = $tsuiteMgr->create($argsObj->containerID,$container['container_name'], - $container['details'], - $new_order,config_get('check_names_for_duplicates'),'block'); - - $op['messages']= array('msg' => $ret['msg'], 'user_feedback' => ''); - $op['status']=$ret['status_ok']; - - if($ret['status_ok']) - { - $op['messages']['user_feedback'] = lang_get('testsuite_created'); - if($op['messages']['msg'] != 'ok') { - $op['messages']['user_feedback'] = $op['messages']['msg']; - } - - if(trim($argsObj->assigned_keyword_list) != "") { - $tsuiteMgr->addKeywords($ret['id'],explode(",",$argsObj->assigned_keyword_list)); - } - writeCustomFieldsToDB($tsuiteMgr->db,$argsObj->tprojectID,$ret['id'],$hash); - - // Send Events to plugins - $ctx = array('id' => $ret['id'],'name' => $container['container_name'],'details' => $container['details']); - event_signal('EVENT_TEST_SUITE_CREATE', $ctx); - } - return $op; -} - -/* - function: moveTestSuiteViewer -prepares smarty variables to display move testsuite viewer - -args: - -returns: - - -*/ -function moveTestSuiteViewer(&$smartyObj,&$tprojectMgr,$argsObj) { - $testsuites = $tprojectMgr->gen_combo_test_suites($argsObj->tprojectID, - array($argsObj->testsuiteID => 'exclude')); - // Added the Test Project as the FIRST Container where is possible to copy - $testsuites = array($argsObj->tprojectID => $argsObj->tprojectName) + $testsuites; - - // original container (need to comment this better) - $smartyObj->assign('old_containerID', $argsObj->tprojectID); - $smartyObj->assign('containers', $testsuites); - $smartyObj->assign('objectID', $argsObj->testsuiteID); - $smartyObj->assign('object_name', $argsObj->tsuite_name); - $smartyObj->assign('top_checked','checked=checked'); - $smartyObj->assign('bottom_checked',''); -} - - -/* - function: reorderTestSuiteViewer -prepares smarty variables to display reorder testsuite viewer - -args: - -returns: - - -*/ -function reorderTestSuiteViewer(&$smartyObj,&$treeMgr,$argsObj) -{ - $level = null; - $oid = is_null($argsObj->testsuiteID) ? $argsObj->containerID : $argsObj->testsuiteID; - $children = $treeMgr->get_children($oid, - array("testplan" => "exclude_me","requirement_spec" => "exclude_me")); - $object_info = $treeMgr->get_node_hierarchy_info($oid); - $object_name = $object_info['name']; - - - if (!sizeof($children)) - { - $children = null; - } - - $smartyObj->assign('arraySelect', $children); - $smartyObj->assign('objectID', $oid); - $smartyObj->assign('object_name', $object_name); - - if($oid == $argsObj->tprojectID) - { - $level = 'testproject'; - $smartyObj->assign('level', $level); - $smartyObj->assign('page_title',lang_get('container_title_' . $level)); - } - - return $level; -} - - -/* - function: updateTestSuite - -args: - -returns: - -*/ -function updateTestSuite(&$tsuiteMgr,&$argsObj,$container,&$hash) { - $msg = 'ok'; - $ret = $tsuiteMgr->update($argsObj->testsuiteID,$container['container_name'],$container['details']); - if($ret['status_ok']) { - $tsuiteMgr->deleteKeywords($argsObj->testsuiteID); - if(trim($argsObj->assigned_keyword_list) != "") { - $tsuiteMgr->addKeywords($argsObj->testsuiteID,explode(",",$argsObj->assigned_keyword_list)); - } - writeCustomFieldsToDB($tsuiteMgr->db,$argsObj->tprojectID,$argsObj->testsuiteID,$hash); - - /* Send events to plugins */ - $ctx = array('id' => $argsObj->testsuiteID,'name' => $container['container_name'],'details' => $container['details']); - event_signal('EVENT_TEST_SUITE_UPDATE', $ctx); - } - else - { - $msg = $ret['msg']; - } - return $msg; -} - -/* - function: copyTestSuite - -args: - -returns: - -*/ -function copyTestSuite(&$smartyObj,$template_dir,&$tsuiteMgr,$argsObj) { - $guiObj = new stdClass(); - $guiObj->btn_reorder_testcases = $argsObj->l10n['btn_reorder_testcases'];; - - $exclude_node_types=array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1); - - $options = array(); - $options['check_duplicate_name'] = config_get('check_names_for_duplicates'); - $options['action_on_duplicate_name'] = config_get('action_on_duplicate_name'); - $options['copyKeywords'] = $argsObj->copyKeywords; - $options['copyRequirements'] = $argsObj->copyRequirementAssignments; - - - // copy_to($source,$destination,...) - $op = $tsuiteMgr->copy_to($argsObj->objectID, - $argsObj->containerID, $argsObj->userID,$options); - - if( $op['status_ok'] ) { - $tsuiteMgr->tree_manager->change_child_order($argsObj->containerID,$op['id'], - $argsObj->target_position,$exclude_node_types); - - - // get info to provide feedback - $dummy = $tsuiteMgr->tree_manager->get_node_hierarchy_info(array($argsObj->objectID, $argsObj->containerID)); - - $msgk = $op['name_changed'] ? 'tsuite_copied_ok_name_changed' : 'tsuite_copied_ok'; - $guiObj->user_feedback = sprintf(lang_get($msgk),$dummy[$argsObj->objectID]['name'], - $dummy[$argsObj->containerID]['name'],$op['name']); - } - $guiObj->refreshTree = $op['status_ok'] && $argsObj->refreshTree; - $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr,$argsObj->objectID); - $guiObj->id = $argsObj->objectID; - $guiObj->treeFormToken = $guiObj->form_token = $argsObj->treeFormToken; - - $guiObj->direct_link = $tsuiteMgr->buildDirectWebLink($_SESSION['basehref'], - $guiObj->id,$argsObj->tprojectID); - - $tsuiteMgr->show($smartyObj,$guiObj,$template_dir,$argsObj->objectID,null,'ok'); - - return $op['status_ok']; -} - -/* - function: moveTestSuite - -args: - -returns: - -*/ -function moveTestSuite(&$smartyObj,$template_dir,&$tprojectMgr,$argsObj) -{ - $exclude_node_types=array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1); - - $tprojectMgr->tree_manager->change_parent($argsObj->objectID,$argsObj->containerID); - $tprojectMgr->tree_manager->change_child_order($argsObj->containerID,$argsObj->objectID, - $argsObj->target_position,$exclude_node_types); - - $guiObj = new stdClass(); - $guiObj->id = $argsObj->tprojectID; - $guiObj->refreshTree = $argsObj->refreshTree; - - $tprojectMgr->show($smartyObj,$guiObj,$template_dir,$argsObj->tprojectID,null,'ok'); -} - - -/* - function: initializeOptionTransfer - -args: - -returns: option transfer configuration - -*/ -function initializeOptionTransfer(&$tprojectMgr,&$tsuiteMgr,$argsObj,$doAction) { - $opt_cfg = opt_transf_empty_cfg(); - $opt_cfg->js_ot_name='ot'; - $opt_cfg->global_lbl=''; - $opt_cfg->from->lbl=lang_get('available_kword'); - $opt_cfg->from->map = $tprojectMgr->get_keywords_map($argsObj->tprojectID); - $opt_cfg->to->lbl=lang_get('assigned_kword'); - - if($doAction=='edit_testsuite') { - $opt_cfg->to->map = $tsuiteMgr->get_keywords_map($argsObj->testsuiteID," ORDER BY keyword ASC "); - } - return $opt_cfg; -} - - -/* - function: moveTestCasesViewer -prepares smarty variables to display move testcases viewer - -args: - -returns: - - -*/ -function moveTestCasesViewer(&$dbHandler,&$smartyObj,&$tprojectMgr,&$treeMgr, - $argsObj,$feedback='',$cf=null) -{ - $tables = $tprojectMgr->getDBTables(array('nodes_hierarchy','node_types','tcversions')); - $testcase_cfg = config_get('testcase_cfg'); - $glue = $testcase_cfg->glue_character; - - $containerID = isset($argsObj->testsuiteID) ? $argsObj->testsuiteID : $argsObj->objectID; - $containerName = $argsObj->tsuite_name; - if( is_null($containerName) ) { - $dummy = $treeMgr->get_node_hierarchy_info($argsObj->objectID); - $containerName = $dummy['name']; - } - - // I'have discovered that exclude selected testsuite branch is not good - // when you want to move lots of testcases from one testsuite to it's children - // testsuites. (in this situation tree drag & drop is not ergonomic). - $testsuites = $tprojectMgr->gen_combo_test_suites($argsObj->tprojectID); - $tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID) . $glue; - - // While testing with PostGres have found this behaivour: - // No matter is UPPER CASE has used on field aliases, keys on hash returned by - // ADODB are lower case. - // Accessing this keys on Smarty template using UPPER CASE fails. - // Solution: have changed case on Smarty to lower case. - // - $sqlA = " SELECT MAX(TCV.version) AS lvnum, NHTC.node_order, NHTC.name," . - " NHTC.id, TCV.tc_external_id AS tcexternalid" . - " FROM {$tables['nodes_hierarchy']} NHTC " . - " JOIN {$tables['nodes_hierarchy']} NHTCV " . - " ON NHTCV.parent_id = NHTC.id " . - " JOIN {$tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - " JOIN {$tables['node_types']} NT " . - " ON NT.id = NHTC.node_type_id AND NT.description='testcase'" . - " WHERE NHTC.parent_id = " . intval($containerID); - - if( !is_null($argsObj->testCaseSet) ) { - $sqlA .= " AND NHTC.id IN (" . implode(',', $argsObj->testCaseSet). ")"; - } - - $sqlA .=" GROUP BY NHTC.id,TCV.tc_external_id,NHTC.name,NHTC.node_order "; - - $sqlB = " SELECT SQLA.id AS tcid, SQLA.name AS tcname," . - " SQLA.node_order AS tcorder, SQLA.tcexternalid," . - " MTCV.summary,MTCV.status,MTCV.importance,MTCV.execution_type," . - " MTCV.id AS tcversion_id FROM ($sqlA) SQLA " . - " JOIN {$tables['nodes_hierarchy']} MNHTCV ON MNHTCV.parent_id = SQLA.id " . - " JOIN {$tables['tcversions']} MTCV ON MTCV.id = MNHTCV.id AND MTCV.version = SQLA.lvnum"; - $orderClause = " ORDER BY TCORDER,TCNAME"; - - $children = $dbHandler->get_recordset($sqlB . $orderClause); - - // check if operation can be done - $user_feedback = $feedback; - if(!is_null($children) && (sizeof($children) > 0) && sizeof($testsuites)) { - $op_ok = true; - } else { - $children = null; - $op_ok = false; - $user_feedback = lang_get('no_testcases_available_or_tsuite'); - } - - $gui = new stdClass(); - $gui->treeFormToken = $gui->form_token = $argsObj->treeFormToken; - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $gui->domainTCStatus = array(-1 => '') + $dummy['lbl']; - $gui->domainTCImportance = array(-1 => '', - HIGH => lang_get('high_importance'), - MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - $dummy = getConfigAndLabels('execution_type','code'); - $gui->domainTCExecType = array(-1 => '') + $dummy['lbl']; - - $gui->testCasesTableView = 0; - if(($argsObj->action == 'testcases_table_view') || - ($argsObj->action == 'doBulkSet')) { - $gui->testCasesTableView = 1; - } - $gui->cf = $cf; - - $gui->tcprefix = $tcasePrefix; - $gui->testcases = $children; - - $smartyObj->assign('gui', $gui); - $smartyObj->assign('op_ok', $op_ok); - $smartyObj->assign('user_feedback', $user_feedback); - - //check if is needed - $smartyObj->assign('old_containerID', $argsObj->tprojectID); - $smartyObj->assign('containers', $testsuites); - $smartyObj->assign('objectID', $containerID); - $smartyObj->assign('object_name', $containerName); - $smartyObj->assign('top_checked','checked=checked'); - $smartyObj->assign('bottom_checked',''); -} - - -/* - function: copyTestCases -copy a set of choosen test cases. - -args: - -returns: - - -*/ -function copyTestCases(&$smartyObj,$template_dir,&$tsuiteMgr,&$tcaseMgr,$argsObj) -{ - $op = array('refreshTree' => false, 'userfeedback' => ''); - if( ($qty=sizeof($argsObj->tcaseSet)) > 0) - { - $msg_id = $qty == 1 ? 'one_testcase_copied' : 'testcase_set_copied'; - $op['userfeedback'] = sprintf(lang_get($msg_id),$qty); - - $copyOpt = array( - 'check_duplicate_name' => config_get('check_names_for_duplicates'), - 'action_on_duplicate_name' => config_get('action_on_duplicate_name'), - 'stepAsGhost' => $argsObj->stepAsGhost); - $copyOpt['copy_also'] = - array('keyword_assignments' => $argsObj->copyKeywords, - 'requirement_assignments' => - $argsObj->copyRequirementAssignments); - - $copy_op =array(); - foreach($argsObj->tcaseSet as $key => $tcaseid) { - $copy_op[$tcaseid] = $tcaseMgr->copy_to($tcaseid, $argsObj->containerID, $argsObj->userID, $copyOpt); - } - $guiObj = new stdClass(); - $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr,$argsObj->objectID); - $guiObj->id = $argsObj->objectID; - $guiObj->refreshTree = true; - $op['refreshTree'] = true; - } - return $op; -} - - -/* - function: moveTestCases -move a set of choosen test cases. - -args: - -returns: - - -*/ -function moveTestCases(&$smartyObj,$template_dir,&$tsuiteMgr,&$treeMgr,$argsObj) -{ - $lbl = $argsObj->l10n; - if (sizeof($argsObj->tcaseSet) > 0) { - $status_ok = $treeMgr->change_parent($argsObj->tcaseSet,$argsObj->containerID); - $user_feedback= $status_ok ? '' : lang_get('move_testcases_failed'); - - // objectID - original container - $guiObj = new stdClass(); - $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr,$argsObj->objectID); - $guiObj->id = $argsObj->objectID; - $guiObj->refreshTree = true; - $guiObj->btn_reorder_testcases = $lbl['btn_reorder_testcases']; - - $tsuiteMgr->show($smartyObj,$guiObj,$template_dir,$argsObj->objectID,null,$user_feedback); - } -} - - -/** - * initWebEditors - * - */ -function initWebEditors($action,$itemType,$editorCfg) { - $webEditorKeys = array('testsuite' => array('details')); - $itemTemplateKey=null; - - switch($action) { - case 'new_testsuite': - case 'add_testsuite': - case 'edit_testsuite': - $accessKey = 'testsuite'; - break; - - default: - $accessKey = ''; - break; - } - - - switch($itemType) { - case 'testproject': - case 'testsuite': - $itemTemplateKey = 'testsuite_template'; - $accessKey = 'testsuite'; - break; - } - - $oWebEditor = array(); - $htmlNames = ''; - if( isset($webEditorKeys[$accessKey]) ) { - $htmlNames = $webEditorKeys[$accessKey]; - foreach ($htmlNames as $key) { - $oWebEditor[$key] = web_editor($key,$_SESSION['basehref'],$editorCfg); - } - } - return array($oWebEditor,$htmlNames,$itemTemplateKey); -} - - - - -/* - function: deleteTestCasesViewer -prepares smarty variables to display move testcases viewer - -args: - -returns: - - -@internal revisions -20110402 - franciscom - BUGID 4322: New Option to block delete of executed test cases. -*/ -function deleteTestCasesViewer(&$dbHandler,&$smartyObj,&$tprojectMgr,&$treeMgr,&$tsuiteMgr, - &$tcaseMgr,$argsObj,$feedback = null) -{ - - $guiObj = new stdClass(); - $guiObj->main_descr = lang_get('delete_testcases'); - $guiObj->system_message = ''; - - - $tables = $tprojectMgr->getDBTables(array('nodes_hierarchy','node_types','tcversions')); - $testcase_cfg = config_get('testcase_cfg'); - $glue = $testcase_cfg->glue_character; - - $containerID = isset($argsObj->testsuiteID) ? $argsObj->testsuiteID : $argsObj->objectID; - $containerName = $argsObj->tsuite_name; - if( is_null($containerName) ) - { - $dummy = $treeMgr->get_node_hierarchy_info($argsObj->objectID); - $containerName = $dummy['name']; - } - - $guiObj->testCaseSet = $tsuiteMgr->get_children_testcases($containerID); - $guiObj->exec_status_quo = null; - $tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID); - $hasExecutedTC = false; - - if( !is_null($guiObj->testCaseSet) && count($guiObj->testCaseSet) > 0) - { - foreach($guiObj->testCaseSet as &$child) - { - $external = $tcaseMgr->getExternalID($child['id'],null,$tcasePrefix); - $child['external_id'] = $external[0]; - - // key level 1 : Test Case Version ID - // key level 2 : Test Plan ID - // key level 3 : Platform ID - $getOptions = array('addExecIndicator' => true); - $dummy = $tcaseMgr->get_exec_status($child['id'],null,$getOptions); - $child['draw_check'] = $argsObj->grants->delete_executed_testcases || (!$dummy['executed']); - - $hasExecutedTC = $hasExecutedTC || $dummy['executed']; - unset($dummy['executed']); - $guiObj->exec_status_quo[] = $dummy; - } - } - // Need to understand if platform column has to be displayed on GUI - if( !is_null($guiObj->exec_status_quo) ) - { - // key level 1 : Test Case Version ID - // key level 2 : Test Plan ID - // key level 3 : Platform ID - - $itemSet = array_keys($guiObj->exec_status_quo); - foreach($itemSet as $mainKey) - { - $guiObj->display_platform[$mainKey] = false; - if(!is_null($guiObj->exec_status_quo[$mainKey]) ) - { - $versionSet = array_keys($guiObj->exec_status_quo[$mainKey]); - $stop = false; - foreach($versionSet as $version_id) - { - $tplanSet = array_keys($guiObj->exec_status_quo[$mainKey][$version_id]); - foreach($tplanSet as $tplan_id) - { - if( ($guiObj->display_platform[$mainKey] = !isset($guiObj->exec_status_quo[$mainKey][$version_id][$tplan_id][0])) ) - { - $stop = true; - break; - } - } - - if($stop) - { - break; - } - } - } - } - } - // check if operation can be done - $guiObj->user_feedback = $feedback; - if(!is_null($guiObj->testCaseSet) && (sizeof($guiObj->testCaseSet) > 0) ) - { - $guiObj->op_ok = true; - $guiObj->user_feedback = ''; - } - else - { - $guiObj->children = null; - $guiObj->op_ok = false; - $guiObj->user_feedback = is_null($guiObj->user_feedback) ? lang_get('no_testcases_available') : $guiObj->user_feedback; - } - - if (!$argsObj->grants->delete_executed_testcases && $hasExecutedTC) { - $guiObj->system_message = lang_get('system_blocks_delete_executed_tc'); - } - - $guiObj->objectID = $containerID; - $guiObj->object_name = $containerName; - $guiObj->refreshTree = $argsObj->refreshTree; - - $smartyObj->assign('gui', $guiObj); -} - - -/* - function: doDeleteTestCasesViewer -prepares smarty variables to display move testcases viewer - -args: - -returns: - - -*/ -function doDeleteTestCases(&$dbHandler,$tcaseSet,&$tcaseMgr) -{ - if( count($tcaseSet) > 0 ) - { - foreach($tcaseSet as $victim) - { - $tcaseMgr->delete($victim); - } - } -} - - -/** - * - * - */ -function reorderTestCasesByCriteria($argsObj,&$tsuiteMgr,&$treeMgr) { - $sortCriteria = config_get('testcase_reorder_by'); - $pfn = ($sortCriteria == 'NAME') ? 'reorderTestCasesDictionary' : 'reorderTestCasesByExtID'; - $pfn($argsObj,$tsuiteMgr,$treeMgr); -} - - -/** - * - * - */ -function reorderTestCasesDictionary($argsObj,&$tsuiteMgr,&$treeMgr) -{ - $tcaseSet = (array)$tsuiteMgr->get_children_testcases($argsObj->testsuiteID,'simple'); - if( ($loop2do = count($tcaseSet)) > 0 ) - { - for($idx=0; $idx < $loop2do; $idx++) - { - $a2sort[$tcaseSet[$idx]['id']] = strtolower($tcaseSet[$idx]['name']); - } - natsort($a2sort); - $a2sort = array_keys($a2sort); - $treeMgr->change_order_bulk($a2sort); - } -} - - -/** - * - * - */ -function reorderTestCasesByExtID($argsObj,&$tsuiteMgr,&$treeMgr) -{ - $tables = $tsuiteMgr->getDBTables(array('nodes_hierarchy','testsuites','tcversions')); - - $sql = " SELECT DISTINCT NHTC.id,TCV.tc_external_id " . - " FROM {$tables['nodes_hierarchy']} NHTC " . - " JOIN {$tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . - " JOIN {$tables['tcversions']} TCV ON TCV.id = NHTCV.id " . - " JOIN {$tables['testsuites']} TS ON NHTC.parent_id = TS.id " . - " WHERE TS.id = " . intval($argsObj->testsuiteID) . - " ORDER BY tc_external_id ASC"; - - $tcaseSet = $tsuiteMgr->db->fetchColumnsIntoMap($sql,'tc_external_id','id'); - $treeMgr->change_order_bulk($tcaseSet); -} - - - -/** - * - * - */ -function reorderTestSuitesDictionary($args,$treeMgr,$parent_id) -{ - $exclude_node_types = array('testplan' => 1, 'requirement' => 1, 'testcase' => 1, 'requirement_spec' => 1); - $itemSet = (array)$treeMgr->get_children($parent_id,$exclude_node_types); - if( ($loop2do = count($itemSet)) > 0 ) - { - for($idx=0; $idx < $loop2do; $idx++) - { - $a2sort[$itemSet[$idx]['id']] = strtolower($itemSet[$idx]['name']); - } - natsort($a2sort); - $a2sort = array_keys($a2sort); - $treeMgr->change_order_bulk($a2sort); - } -} - -/** - * - */ -function initializeGui(&$objMgr,$id,$argsObj,$lbl=null) { - $guiObj = new stdClass(); - - $labels = $lbl; - if( null == $labels ) { - $labels = $argsObj->l10n; - } - - $guiObj->id = $id; - $guiObj->user = $argsObj->user; - $guiObj->tproject_id = $argsObj->tprojectID; - $guiObj->refreshTree = $argsObj->refreshTree; - $guiObj->btn_reorder_testcases = $labels['btn_reorder_testcases']; - $guiObj->page_title = $labels['container_title_testsuite']; - $guiObj->attachments = getAttachmentInfosFrom($objMgr,$id); - $guiObj->form_token = $argsObj->treeFormToken; - - $guiObj->fileUploadURL = $_SESSION['basehref'] . $objMgr->getFileUploadRelativeURL($id); - - if( $objMgr->my_node_type == $objMgr->node_types_descr_id['testsuite'] ) { - $guiObj->direct_link = - $objMgr->buildDirectWebLink($_SESSION['basehref'], - $guiObj->id,$argsObj->tprojectID); - } - - - $guiObj->modify_tc_rights = $argsObj->grants->testcase_mgmt; - return $guiObj; -} - -/** - * - * - */ -function doBulkSet(&$dbHandler,$argsObj,$tcaseSet,&$tcaseMgr) -{ - if( count($tcaseSet) > 0 ) - { - $k2s = array('tc_status' => 'setStatus', - 'importance' => 'setImportance', - 'execution_type' => 'setExecutionType'); - foreach($tcaseSet as $tcversion_id => $tcase_id) - { - foreach($k2s as $attr => $m2c) - { - if($argsObj->$attr >0) - { - $tcaseMgr->$m2c($tcversion_id,$argsObj->$attr); - } - } - - /* - if($argsObj->tc_status >0) - { - $tcaseMgr->setStatus($tcversion_id,$argsObj->tc_status); - } - - if($argsObj->importance >0) - { - $tcaseMgr->setImportance($tcversion_id,$argsObj->importance); - } - - if($argsObj->execution_type >0) - { - $tcaseMgr->setStatus($tcversion_id,$argsObj->tc_status); - } - */ - } - - // second round, on Custom Fields - $cf_map = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design($argsObj->tprojectID,ENABLED, - NO_FILTER_SHOW_ON_EXEC,'testcase'); - if( !is_null($cf_map) ) - { - // get checkboxes from $_REQUEST - $k2i = array_keys($_REQUEST); - $cfval = null; - foreach($k2i as $val) - { - if(strpos($val,'check_custom_field_') !== FALSE) - { - $cfid = explode('_',$val); - $cfid = end($cfid); - $cfval[$cfid] = $cf_map[$cfid]; - } - } - if(!is_null($cfval)) - { - foreach($tcaseSet as $tcversion_id => $tcase_id) - { - $tcaseMgr->cfield_mgr->design_values_to_db($_REQUEST,$tcversion_id,$cfval); - } - } - } - - } -} - - -/** - * - */ -function initTPLActions() { - - $tpl = array( 'move_testsuite_viewer' => 'containerMove.tpl', - 'delete_testsuite' => 'containerDelete.tpl', - 'move_testcases_viewer' => 'containerMoveTC.tpl', - 'testcases_table_view' => 'containerMoveTC.tpl', - 'do_copy_tcase_set' => 'containerMoveTC.tpl', - 'do_copy_tcase_set_ghost' => 'containerMoveTC.tpl', - 'delete_testcases' => 'containerDeleteTC.tpl', - 'do_delete_testcases' => 'containerDeleteTC.tpl', - 'doBulkSet' => 'containerMoveTC.tpl'); - - $actions = array('edit_testsuite' => 0,'new_testsuite' => 0, - 'delete_testsuite' => 0, - 'do_move' => 0,'do_copy' => 0,'reorder_testsuites' => 1, - 'do_testsuite_reorder' => 0,'add_testsuite' => 1, - 'move_testsuite_viewer' => 0,'update_testsuite' => 1, - 'move_testcases_viewer' => 0,'do_move_tcase_set' => 0, - 'testcases_table_view' => 0,'do_copy_tcase_set' => 0, - 'do_copy_tcase_set_ghost' => 0, 'del_testsuites_bulk' => 0, - 'delete_testcases' => 0,'do_delete_testcases' => 0, - 'reorder_testcases' => 0,'reorder_testsuites_alpha' => 0, - 'reorder_testproject_testsuites_alpha' => 0, - 'doBulkSet' => 0); - - return array($tpl,$actions); -} - -/** - * - */ -function showTestSuite(&$tplEngine,&$argsO,&$tsuiteMgr,$tplDir) { - if( null == $argsO->tprojectID ) { - $argsO->tprojectID = $tsuiteMgr->getTestproject($argsO->item_id); - } - $gui = initializeGui($tsuiteMgr,$argsO->item_id,$argsO,$argsO->l10n); - $gui->refreshTree = 0; - $tsuiteMgr->show($tplEngine,$gui,$tplDir,$argsO->item_id,null,null); - exit(); +js_ot_name = 'ot'; + +$args = initArgs($db, $tproject_mgr, $tsuite_mgr, $opt_cfg); +$level = isset($args->level) ? $args->level : $args->containerType; + +$gui_cfg = config_get('gui'); +$smarty = new TLSmarty(); +$smarty->assign('editorType', $editorCfg['type']); + +list ($a_tpl, $a_actions) = initTPLActions(); + +$a_init_opt_transfer = array( + 'edit_testsuite' => 1, + 'new_testsuite' => 1, + 'add_testsuite' => 1, + 'update_testsuite' => 1 +); + +$the_tpl = null; +$action = null; +$get_c_data = null; +$init_opt_transfer = null; + +// 20121222 -franciscom +// Need this trick because current implementation of Ext.ux.requireSessionAndSubmit() +// discards the original submit button +if (isset($_REQUEST['doAction'])) { + $_POST[$_REQUEST['doAction']] = $_REQUEST['doAction']; +} +$action = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; + +foreach ($a_actions as $the_key => $the_val) { + if (isset($_POST[$the_key])) { + $the_tpl = isset($a_tpl[$the_key]) ? $a_tpl[$the_key] : null; + $init_opt_transfer = isset($a_init_opt_transfer[$the_key]) ? 1 : 0; + + $action = $the_key; + $get_c_data = $the_val; + $level = is_null($level) ? 'testsuite' : $level; + break; + } +} +$args->action = $action; + +$smarty->assign('level', $level); +$smarty->assign('page_title', lang_get('container_title_' . $level)); + +if ($init_opt_transfer) { + $opt_cfg = initializeOptionTransfer($tproject_mgr, $tsuite_mgr, $args, + $action); +} + +// create web editor objects +list ($oWebEditor, $webEditorHtmlNames, $webEditorTemplateKey) = initWebEditors( + $action, $level, $editorCfg); +if ($get_c_data) { + $name_ok = 1; + $c_data = getValuesFromPost($webEditorHtmlNames); + if ($name_ok && ! checkString($c_data['container_name'], $g_ereg_forbidden)) { + $msg = $args->l10n['string_contains_bad_chars']; + $name_ok = 0; + } + + if ($name_ok && ($c_data['container_name'] == "")) { + $msg = $args->l10n['warning_empty_testsuite_name']; + $name_ok = 0; + } +} + +$doIt = true; +switch ($action) { + case 'fileUpload': + case 'deleteFile': + case 'edit_testsuite': + case 'new_testsuite': + case 'delete_testsuite': + case 'move_testsuite_viewer': + case 'reorder_testsuites': + case 'update_testsuite': + case 'do_move': + case 'do_copy': + case 'do_move_tcase_set': + case 'do_copy_tcase_set': + case 'do_copy_tcase_set_ghost': + case 'add_testsuite': + case 'delete_testcases': + case 'do_delete_testcases': + case 'reorder_testcases': + case 'reorder_testsuites_alpha': + case 'reorder_testproject_testsuites_alpha': + case 'doBulkSet': + case 'addKeyword': + case 'addKeywordTSDeep': + case 'removeKeyword': + $doIt = ('yes' == $args->grants->testcase_mgmt); + break; +} + +if ($doIt) { + switch ($action) { + case 'fileUpload': + switch ($level) { + case 'testsuite': + $uploadOp = fileUploadManagement($db, $args->testsuiteID, + $args->fileTitle, $tsuite_mgr->getAttachmentTableName()); + $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args); + $gui->refreshTree = 0; + $gui->uploadOp = $uploadOp; + $tsuite_mgr->show($smarty, $gui, $template_dir, + $args->testsuiteID, null, null); + break; + + case 'testproject': + $uploadOp = fileUploadManagement($db, $args->tprojectID, + $args->fileTitle, + $tproject_mgr->getAttachmentTableName()); + $gui = initializeGui($tproject_mgr, $args->tprojectID, $args); + $gui->refreshTree = 0; + $gui->uploadOp = $uploadOp; + + $tproject_mgr->show($smarty, $gui, $template_dir, + $args->tprojectID, null, null); + break; + } + break; + + case 'deleteFile': + deleteAttachment($db, $args->file_id); + switch ($level) { + case 'testsuite': + $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args); + $gui->refreshTree = 0; + $tsuite_mgr->show($smarty, $gui, $template_dir, + $args->testsuiteID, null, null); + break; + + case 'testproject': + $gui = initializeGui($tproject_mgr, $args->tprojectID, $args); + $gui->refreshTree = 0; + $tproject_mgr->show($smarty, $gui, $template_dir, + $args->tprojectID, null, null); + break; + } + break; + + case 'edit_testsuite': + case 'new_testsuite': + keywords_opt_transf_cfg($opt_cfg, $args->assigned_keyword_list); + + $smarty->assign('opt_cfg', $opt_cfg); + + $gui = new stdClass(); + $gui->tproject_id = $args->tprojectID; + $gui->containerType = $level; + $gui->refreshTree = $args->refreshTree; + $gui->hasKeywords = (count($opt_cfg->from->map) > 0) || + (count($opt_cfg->to->map) > 0); + + $gui->cancelActionJS = 'location.href=fRoot+' . + "'lib/testcases/archiveData.php?id=" . + intval($args->containerID); + switch ($level) { + case 'testproject': + $gui->cancelActionJS .= "&edit=testproject&level=testproject'"; + break; + + case 'testsuite': + $gui->cancelActionJS .= "&edit=testsuite&level=testsuite&containerType=testsuite'"; + break; + } + + $smarty->assign('level', $level); + $smarty->assign('gui', $gui); + $tsuite_mgr->viewer_edit_new($smarty, $template_dir, + $webEditorHtmlNames, $oWebEditor, $action, $args->containerID, + $args->testsuiteID, null, $webEditorTemplateKey); + break; + + case 'delete_testsuite': + $refreshTree = deleteTestSuite($smarty, $args, $tsuite_mgr, + $tree_mgr, $tcaseMgr, $level); + break; + + case 'move_testsuite_viewer': + moveTestSuiteViewer($smarty, $tproject_mgr, $args); + break; + + case 'move_testcases_viewer': + moveTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, $args); + break; + + case 'testcases_table_view': + $cf = null; + $cf_map = $tcaseMgr->get_linked_cfields_at_design(0, null, null, + null, $args->tprojectID); + if (! is_null($cf_map)) { + $cfOpt = array( + 'addCheck' => true, + 'forceOptional' => true + ); + $cf = $tcaseMgr->cfield_mgr->html_table_inputs($cf_map, '', null, + $cfOpt); + } + + moveTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, $args, + null, $cf); + break; + + case 'reorder_testsuites': + $ret = reorderTestSuiteViewer($smarty, $tree_mgr, $args); + $level = is_null($ret) ? $level : $ret; + break; + + case 'do_move': + moveTestSuite($smarty, $template_dir, $tproject_mgr, $args); + break; + + case 'do_copy': + copyTestSuite($smarty, $template_dir, $tsuite_mgr, $args); + break; + + case 'update_testsuite': + if ($name_ok) { + $msg = updateTestSuite($tsuite_mgr, $args, $c_data, $_REQUEST); + } + $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args); + $tsuite_mgr->show($smarty, $gui, $template_dir, $args->testsuiteID, + null, $msg); + break; + + case 'add_testsuite': + $messages = null; + $op['status'] = 0; + if ($name_ok) { + $op = addTestSuite($tsuite_mgr, $args, $c_data, $_REQUEST); + $messages = array( + 'result_msg' => $op['messages']['msg'], + 'user_feedback' => $op['messages']['user_feedback'] + ); + } + + // $userInput is used to maintain data filled by user if there is + // a problem with test suite name. + $userInput = $op['status'] ? null : $_REQUEST; + $assignedKeywords = $op['status'] ? "" : $args->assigned_keyword_list; + keywords_opt_transf_cfg($opt_cfg, $assignedKeywords); + $smarty->assign('opt_cfg', $opt_cfg); + + $gui = new stdClass(); + $gui->tproject_id = $args->tprojectID; + $gui->containerType = $level; + $gui->refreshTree = $args->refreshTree; + $gui->cancelActionJS = 'location.href=fRoot+' . + "'lib/testcases/archiveData.php?id=" . + intval($args->containerID); + + switch ($level) { + case 'testproject': + $gui->cancelActionJS .= "&edit=testproject&level=testproject'"; + break; + + case 'testsuite': + $gui->cancelActionJS .= "&edit=testsuite&level=testsuite&containerType=testsuite'"; + break; + } + + $smarty->assign('level', $level); + $smarty->assign('gui', $gui); + + $tsuite_mgr->viewer_edit_new($smarty, $template_dir, + $webEditorHtmlNames, $oWebEditor, $action, $args->containerID, + null, $messages, $webEditorTemplateKey, $userInput); + break; + + case 'do_move_tcase_set': + moveTestCases($smarty, $template_dir, $tsuite_mgr, $tree_mgr, $args); + break; + + case 'do_copy_tcase_set': + case 'do_copy_tcase_set_ghost': + $args->stepAsGhost = ($action == 'do_copy_tcase_set_ghost'); + $op = copyTestCases($smarty, $template_dir, $tsuite_mgr, $tcaseMgr, + $args); + + $refreshTree = $op['refreshTree']; + moveTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, $args, + $op['userfeedback']); + break; + + case 'delete_testcases': + $args->refreshTree = false; + deleteTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, + $tsuite_mgr, $tcaseMgr, $args); + break; + + case 'do_delete_testcases': + $args->refreshTree = true; + doDeleteTestCases($db, $args->tcaseSet, $tcaseMgr); + deleteTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, + $tsuite_mgr, $tcaseMgr, $args, + lang_get('all_testcases_have_been_deleted')); + break; + + case 'reorder_testcases': + reorderTestCasesByCriteria($args, $tsuite_mgr, $tree_mgr); + $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args); + $gui->refreshTree = true; + $tsuite_mgr->show($smarty, $gui, $template_dir, $args->testsuiteID, + null, null); + break; + + case 'reorder_testsuites_alpha': + reorderTestSuitesDictionary($tree_mgr, $args->testsuiteID); + $gui = initializeGui($tsuite_mgr, $args->testsuiteID, $args); + $gui->refreshTree = true; + $tsuite_mgr->show($smarty, $gui, $template_dir, $args->testsuiteID, + null, null); + break; + + case 'reorder_testproject_testsuites_alpha': + reorderTestSuitesDictionary($tree_mgr, $args->tprojectID); + $gui = initializeGui($tproject_mgr, $args->tprojectID, $args); + $gui->refreshTree = true; + $tproject_mgr->show($smarty, $gui, $template_dir, $args->tprojectID, + null, null); + break; + + case 'doBulkSet': + $args->refreshTree = true; + doBulkSet($db, $args, $args->tcaseSet, $tcaseMgr); + + $cf = null; + $cf_map = $tcaseMgr->get_linked_cfields_at_design(0, null, null, + null, $args->tprojectID); + if (! is_null($cf_map)) { + $cfOpt = array( + 'addCheck' => true, + 'forceOptional' => true + ); + $cf = $tcaseMgr->cfield_mgr->html_table_inputs($cf_map, '', null, + $cfOpt); + } + + moveTestCasesViewer($db, $smarty, $tproject_mgr, $tree_mgr, $args, + null, $cf); + break; + + case 'addKeyword': + $tsuite_mgr->addKeywords($args->item_id, $args->free_keywords); + showTestSuite($smarty, $args, $tsuite_mgr, $template_dir); + exit(); + break; + + case 'addKeywordTSDeep': + $tsuite_mgr->addKeywordsDeep($args->item_id, $args->free_keywords); + showTestSuite($smarty, $args, $tsuite_mgr, $template_dir); + exit(); + break; + + case 'removeKeyword': + $tsuite_mgr->deleteKeywordByLinkID($args->kw_link_id); + showTestSuite($smarty, $args, $tsuite_mgr, $template_dir); + exit(); + break; + + default: + trigger_error("containerEdit.php - No correct GET/POST data", + E_USER_ERROR); + break; + } +} + +if ($the_tpl) { + $smarty->assign('refreshTree', $refreshTree && $args->refreshTree); + $smarty->display($template_dir . $the_tpl); +} + +/** + */ +function getValuesFromPost($akeys2get) +{ + $akeys2get[] = 'container_name'; + $c_data = array(); + foreach ($akeys2get as $key) { + $c_data[$key] = isset($_POST[$key]) ? strings_stripSlashes($_POST[$key]) : null; + } + return $c_data; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function build_del_testsuite_warning_msg(&$tree_mgr, &$tcaseMgr, &$testcases, + $tsuite_id) +{ + $msg = null; + $msg['warning'] = null; + $msg['link_msg'] = null; + $msg['delete_msg'] = null; + + if (! is_null($testcases)) { + $show_warning = 0; + $verbose = array(); + $msg['link_msg'] = array(); + + $status_warning = array( + 'linked_and_executed' => 1, + 'linked_but_not_executed' => 1, + 'no_links' => 0 + ); + + $delete_notice = array( + 'linked_and_executed' => lang_get('delete_notice'), + 'linked_but_not_executed' => '', + 'no_links' => '' + ); + + $getOptions = array( + 'addExecIndicator' => true + ); + foreach ($testcases as $elem) { + $verbose[] = $tree_mgr->get_path($elem['id'], $tsuite_id); + $xx = $tcaseMgr->get_exec_status($elem['id'], null, $getOptions); + $status = 'no_links'; + if (! is_null($xx)) { + $status = $xx['executed'] ? 'linked_and_executed' : 'linked_but_not_executed'; + } + $msg['link_msg'][] = $status; + + if ($status_warning[$status]) { + $show_warning = 1; + $msg['delete_msg'] = $delete_notice[$status]; + } + } + + $idx = 0; + if ($show_warning) { + $msg['warning'] = array(); + foreach ($verbose as $elem) { + $msg['warning'][$idx] = ''; + $bSlash = false; + foreach ($elem as $telem) { + if ($bSlash) { + $msg['warning'][$idx] .= "\\"; + } + $msg['warning'][$idx] .= $telem['name']; + $bSlash = true; + } + $idx ++; + } + } else { + $msg['link_msg'] = null; + $msg['warning'] = null; + } + } + return $msg; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs(&$dbHandler, &$tprojectMgr, &$tsuiteMgr, $optionTransferCfg) +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->kw_link_id = isset($_REQUEST['kw_link_id']) ? intval( + $_REQUEST['kw_link_id']) : null; + $args->item_id = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null; + $args->free_keywords = isset($_REQUEST['free_keywords']) ? $_REQUEST['free_keywords'] : null; + $args->containerID = isset($_REQUEST['containerID']) ? $_REQUEST['containerID'] : null; + $args->objectType = isset($_REQUEST['objectType']) ? $_REQUEST['objectType'] : null; // check againts whitelist + $args->containerType = isset($_REQUEST['containerType']) ? $_REQUEST['containerType'] : null; + + if (null != $args->containerType) { + $ctWhiteList = array( + 'testproject' => 'OK', + 'testsuite' => 'OK' + ); + if (! is_null($args->containerType) && + ! isset($ctWhiteList[$args->containerType])) { + $args->containerType = null; + } + } + + // When Deleting Test suite - container ID is not set + if (is_null($args->containerID)) { + $args->containerType = is_null($args->containerType) ? 'testproject' : $args->containerType; + } + + if (null == $args->containerType) { + throw new Exception("Error No Container Type", 1); + } + + $args->testsuiteID = isset($_REQUEST['testsuiteID']) ? intval( + $_REQUEST['testsuiteID']) : null; + $args->tsuite_name = isset($_REQUEST['testsuiteName']) ? $_REQUEST['testsuiteName'] : null; + + // Order is critic + $args->objectID = isset($_REQUEST['objectID']) ? intval( + $_REQUEST['objectID']) : null; + $args->containerID = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : $args->objectID; + + switch ($args->containerType) { + case 'testproject': + $args->tprojectID = $args->containerID; + break; + + case 'testsuite': + $nodeID = ! is_null($args->testsuiteID) ? $args->testsuiteID : $args->containerID; + $args->tprojectID = $tsuiteMgr->getTestProjectFromTestSuite($nodeID, + null); + break; + } + + if (intval($args->tprojectID) == 0) { + if (isset($_REQUEST['tproject_id'])) { + $args->tprojectID = intval($_REQUEST['tproject_id']); + } + + if (isset($_REQUEST['tprojectID'])) { + $args->tprojectID = intval($_REQUEST['tprojectID']); + } + } + + // very ugly + $args->level = null; + if (isset($_REQUEST['delete_testsuite'])) { + $args->level = $args->objectType; + } + + $info = $tprojectMgr->get_by_id($args->tprojectID, + array( + 'output' => 'name' + )); + $args->tprojectName = $info['name']; + + $args->userID = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0; + $args->file_id = isset($_REQUEST['file_id']) ? intval($_REQUEST['file_id']) : 0; + $args->fileTitle = isset($_REQUEST['fileTitle']) ? trim( + $_REQUEST['fileTitle']) : ''; + + $k2l = array( + 'tc_status', + 'importance', + 'execution_type' + ); + foreach ($k2l as $kv) { + $args->$kv = isset($_REQUEST[$kv]) ? intval($_REQUEST[$kv]) : - 1; + } + + $args->user = $_SESSION['currentUser']; + + $args->grants = new stdClass(); + $args->grants->delete_executed_testcases = $args->user->hasRight($dbHandler, + 'testproject_delete_executed_testcases', $args->tprojectID); + + $args->grants->testcase_mgmt = $args->user->hasRight($dbHandler, + 'mgt_modify_tc', $args->tprojectID); + + $keys2loop = array( + 'nodes_order' => null, + 'tcaseSet' => null, + 'target_position' => 'bottom', + 'doAction' => '' + ); + foreach ($keys2loop as $key => $value) { + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; + } + + $args->bSure = (isset($_REQUEST['sure']) && ($_REQUEST['sure'] == 'yes')); + $rl_html_name = $optionTransferCfg->js_ot_name . "_newRight"; + $args->assigned_keyword_list = isset($_REQUEST[$rl_html_name]) ? $_REQUEST[$rl_html_name] : ""; + + $keys2loop = array( + 'copyKeywords' => 0, + 'copyRequirementAssignments' => 0 + ); + + foreach ($keys2loop as $key => $value) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : $value; + } + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? $_SESSION['setting_refresh_tree_on_action'] : 0; + $args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0; + $args->testCaseSet = null; + + if ($args->treeFormToken > 0) { + $mode = 'edit_mode'; + $sdata = isset($_SESSION[$mode]) && + isset($_SESSION[$mode][$args->treeFormToken]) ? $_SESSION[$mode][$args->treeFormToken] : null; + $args->testCaseSet = isset($sdata['testcases_to_show']) ? $sdata['testcases_to_show'] : null; + } + + $dummy = (config_get('testcase_reorder_by')) == 'NAME' ? '_alpha' : '_externalid'; + $lbl2init = array( + 'warning_empty_testsuite_name' => null, + 'string_contains_bad_chars' => null, + 'container_title_testsuite' => null, + 'btn_reorder_testcases' => 'btn_reorder_testcases' . $dummy + ); + $args->l10n = init_labels($lbl2init); + + return $args; +} + +/* + * function: + * + * args: + * + * returns: + * + */ +function writeCustomFieldsToDB(&$db, $tprojectID, $tsuiteID, &$hash) +{ + $NO_FILTERS = null; + + $cfield_mgr = new cfield_mgr($db); + $cf_map = $cfield_mgr->get_linked_cfields_at_design($tprojectID, + cfield_mgr::ENABLED, $NO_FILTERS, 'testsuite'); + $cfield_mgr->design_values_to_db($hash, $tsuiteID, $cf_map); +} + +/* + * function: deleteTestSuite + * + * args: + * + * returns: true -> refresh tree + * false -> do not refresh + * + */ +function deleteTestSuite(&$smartyObj, &$argsObj, &$tsuiteMgr, &$treeMgr, + &$tcaseMgr, $level) +{ + $feedback_msg = ''; + $system_message = ''; + $can_delete = 1; + + if ($argsObj->bSure) { + $tsuite = $tsuiteMgr->get_by_id($argsObj->objectID); + $tsuiteMgr->delete_deep($argsObj->objectID); + $tsuiteMgr->deleteKeywords($argsObj->objectID); + $smartyObj->assign('objectName', $tsuite['name']); + $doRefreshTree = true; + $feedback_msg = 'ok'; + $smartyObj->assign('user_feedback', + lang_get('testsuite_successfully_deleted')); + } else { + $doRefreshTree = false; + + // Get test cases present in this testsuite and all children + $testcases = $tsuiteMgr->get_testcases_deep($argsObj->testsuiteID); + $map_msg['warning'] = null; + $map_msg['link_msg'] = null; + $map_msg['delete_msg'] = null; + + if (is_null($testcases) || count($testcases) == 0) { + $can_delete = 1; + } else { + $map_msg = build_del_testsuite_warning_msg($treeMgr, $tcaseMgr, + $testcases, $argsObj->testsuiteID); + if (in_array('linked_and_executed', (array) $map_msg['link_msg'])) { + $can_delete = $argsObj->grants->delete_executed_testcases; + } + } + + $system_message = ''; + if (! $can_delete && ! $argsObj->grants->delete_executed_testcases) { + $system_message = lang_get( + 'system_blocks_tsuite_delete_due_to_exec_tc'); + } + + // prepare to show the delete confirmation page + $smartyObj->assign('can_delete', $can_delete); + $smartyObj->assign('objectID', $argsObj->testsuiteID); + $smartyObj->assign('objectType', 'testsuite'); + $smartyObj->assign('objectName', $argsObj->tsuite_name); + $smartyObj->assign('containerType', $argsObj->containerType); + $smartyObj->assign('delete_msg', $map_msg['delete_msg']); + $smartyObj->assign('warning', $map_msg['warning']); + $smartyObj->assign('link_msg', $map_msg['link_msg']); + } + $smartyObj->assign('system_message', $system_message); + $smartyObj->assign('page_title', + lang_get('delete') . " " . lang_get('container_title_' . $level)); + $smartyObj->assign('sqlResult', $feedback_msg); + + return $doRefreshTree; +} + +/* + * function: addTestSuite + * + * args: + * + * returns: map with messages and status + * + * revision: + * 20101012 - franciscom - BUGID 3890 + * when creating action on duplicate is setted to BLOCK without using + * config_get('action_on_duplicate_name'). + * This is because this config option has to be used ONLY when copying/moving not when creating. + * + * 20091206 - franciscom - new items are created as last element of tree branch + * + */ +function addTestSuite(&$tsuiteMgr, &$argsObj, $container, &$hash) +{ + $new_order = null; + + // compute order + // + // $nt2exclude=array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me'); + // $siblings = $tsuiteMgr->tree_manager->get_children($argsObj->containerID,$nt2exclude); + // if( !is_null($siblings) ) + // { + // $dummy = end($siblings); + // $new_order = $dummy['node_order']+1; + // } + $ret = $tsuiteMgr->create($argsObj->containerID, + $container['container_name'], $container['details'], $new_order, + config_get('check_names_for_duplicates'), 'block'); + + $op['messages'] = array( + 'msg' => $ret['msg'], + 'user_feedback' => '' + ); + $op['status'] = $ret['status_ok']; + + if ($ret['status_ok']) { + $op['messages']['user_feedback'] = lang_get('testsuite_created'); + if ($op['messages']['msg'] != 'ok') { + $op['messages']['user_feedback'] = $op['messages']['msg']; + } + + if (trim($argsObj->assigned_keyword_list) != "") { + $tsuiteMgr->addKeywords($ret['id'], + explode(",", $argsObj->assigned_keyword_list)); + } + writeCustomFieldsToDB($tsuiteMgr->db, $argsObj->tprojectID, $ret['id'], + $hash); + + // Send Events to plugins + $ctx = array( + 'id' => $ret['id'], + 'name' => $container['container_name'], + 'details' => $container['details'] + ); + event_signal('EVENT_TEST_SUITE_CREATE', $ctx); + } + return $op; +} + +/* + * function: moveTestSuiteViewer + * prepares smarty variables to display move testsuite viewer + * + * args: + * + * returns: - + * + */ +function moveTestSuiteViewer(&$smartyObj, &$tprojectMgr, $argsObj) +{ + $testsuites = $tprojectMgr->gen_combo_test_suites($argsObj->tprojectID, + array( + $argsObj->testsuiteID => 'exclude' + )); + // Added the Test Project as the FIRST Container where is possible to copy + $testsuites = array( + $argsObj->tprojectID => $argsObj->tprojectName + ) + $testsuites; + + // original container (need to comment this better) + $smartyObj->assign('old_containerID', $argsObj->tprojectID); + $smartyObj->assign('containers', $testsuites); + $smartyObj->assign('objectID', $argsObj->testsuiteID); + $smartyObj->assign('object_name', $argsObj->tsuite_name); + $smartyObj->assign('top_checked', 'checked=checked'); + $smartyObj->assign('bottom_checked', ''); +} + +/* + * function: reorderTestSuiteViewer + * prepares smarty variables to display reorder testsuite viewer + * + * args: + * + * returns: - + * + */ +function reorderTestSuiteViewer(&$smartyObj, &$treeMgr, $argsObj) +{ + $level = null; + $oid = is_null($argsObj->testsuiteID) ? $argsObj->containerID : $argsObj->testsuiteID; + $children = $treeMgr->get_children($oid, + array( + "testplan" => "exclude_me", + "requirement_spec" => "exclude_me" + )); + $object_info = $treeMgr->get_node_hierarchy_info($oid); + $object_name = $object_info['name']; + + if (! count($children)) { + $children = null; + } + + $smartyObj->assign('arraySelect', $children); + $smartyObj->assign('objectID', $oid); + $smartyObj->assign('object_name', $object_name); + + if ($oid == $argsObj->tprojectID) { + $level = 'testproject'; + $smartyObj->assign('level', $level); + $smartyObj->assign('page_title', lang_get('container_title_' . $level)); + } + + return $level; +} + +/* + * function: updateTestSuite + * + * args: + * + * returns: + * + */ +function updateTestSuite(&$tsuiteMgr, &$argsObj, $container, &$hash) +{ + $msg = 'ok'; + $ret = $tsuiteMgr->update($argsObj->testsuiteID, + $container['container_name'], $container['details']); + if ($ret['status_ok']) { + $tsuiteMgr->deleteKeywords($argsObj->testsuiteID); + if (trim($argsObj->assigned_keyword_list) != "") { + $tsuiteMgr->addKeywords($argsObj->testsuiteID, + explode(",", $argsObj->assigned_keyword_list)); + } + writeCustomFieldsToDB($tsuiteMgr->db, $argsObj->tprojectID, + $argsObj->testsuiteID, $hash); + + /* Send events to plugins */ + $ctx = array( + 'id' => $argsObj->testsuiteID, + 'name' => $container['container_name'], + 'details' => $container['details'] + ); + event_signal('EVENT_TEST_SUITE_UPDATE', $ctx); + } else { + $msg = $ret['msg']; + } + return $msg; +} + +/* + * function: copyTestSuite + * + * args: + * + * returns: + * + */ +function copyTestSuite(&$smartyObj, $template_dir, &$tsuiteMgr, $argsObj) +{ + $guiObj = new stdClass(); + $guiObj->btn_reorder_testcases = $argsObj->l10n['btn_reorder_testcases']; + + $exclude_node_types = array( + 'testplan' => 1, + 'requirement' => 1, + 'requirement_spec' => 1 + ); + + $options = array(); + $options['check_duplicate_name'] = config_get('check_names_for_duplicates'); + $options['action_on_duplicate_name'] = config_get( + 'action_on_duplicate_name'); + $options['copyKeywords'] = $argsObj->copyKeywords; + $options['copyRequirements'] = $argsObj->copyRequirementAssignments; + + // copy_to($source,$destination,...) + $op = $tsuiteMgr->copy_to($argsObj->objectID, $argsObj->containerID, + $argsObj->userID, $options); + + if ($op['status_ok']) { + $tsuiteMgr->tree_manager->change_child_order($argsObj->containerID, + $op['id'], $argsObj->target_position, $exclude_node_types); + + // get info to provide feedback + $dummy = $tsuiteMgr->tree_manager->get_node_hierarchy_info( + array( + $argsObj->objectID, + $argsObj->containerID + )); + + $msgk = $op['name_changed'] ? 'tsuite_copied_ok_name_changed' : 'tsuite_copied_ok'; + $guiObj->user_feedback = sprintf(lang_get($msgk), + $dummy[$argsObj->objectID]['name'], + $dummy[$argsObj->containerID]['name'], $op['name']); + } + $guiObj->refreshTree = $op['status_ok'] && $argsObj->refreshTree; + $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr, $argsObj->objectID); + $guiObj->id = $argsObj->objectID; + $guiObj->treeFormToken = $guiObj->form_token = $argsObj->treeFormToken; + + $guiObj->direct_link = $tsuiteMgr->buildDirectWebLink($_SESSION['basehref'], + $guiObj->id, $argsObj->tprojectID); + + $tsuiteMgr->show($smartyObj, $guiObj, $template_dir, $argsObj->objectID, + null, 'ok'); + + return $op['status_ok']; +} + +/* + * function: moveTestSuite + * + * args: + * + * returns: + * + */ +function moveTestSuite(&$smartyObj, $template_dir, &$tprojectMgr, $argsObj) +{ + $exclude_node_types = array( + 'testplan' => 1, + 'requirement' => 1, + 'requirement_spec' => 1 + ); + + $tprojectMgr->tree_manager->change_parent($argsObj->objectID, + $argsObj->containerID); + $tprojectMgr->tree_manager->change_child_order($argsObj->containerID, + $argsObj->objectID, $argsObj->target_position, $exclude_node_types); + + $guiObj = new stdClass(); + $guiObj->id = $argsObj->tprojectID; + $guiObj->refreshTree = $argsObj->refreshTree; + + $tprojectMgr->show($smartyObj, $guiObj, $template_dir, $argsObj->tprojectID, + null, 'ok'); +} + +/* + * function: initializeOptionTransfer + * + * args: + * + * returns: option transfer configuration + * + */ +function initializeOptionTransfer(&$tprojectMgr, &$tsuiteMgr, $argsObj, + $doAction) +{ + $opt_cfg = opt_transf_empty_cfg(); + $opt_cfg->js_ot_name = 'ot'; + $opt_cfg->global_lbl = ''; + $opt_cfg->from->lbl = lang_get('available_kword'); + $opt_cfg->from->map = $tprojectMgr->get_keywords_map($argsObj->tprojectID); + $opt_cfg->to->lbl = lang_get('assigned_kword'); + + if ($doAction == 'edit_testsuite') { + $opt_cfg->to->map = $tsuiteMgr->get_keywords_map($argsObj->testsuiteID, + " ORDER BY keyword ASC "); + } + return $opt_cfg; +} + +/* + * function: moveTestCasesViewer + * prepares smarty variables to display move testcases viewer + * + * args: + * + * returns: - + * + */ +function moveTestCasesViewer(&$dbHandler, &$smartyObj, &$tprojectMgr, &$treeMgr, + $argsObj, $feedback = '', $cf = null) +{ + $tables = $tprojectMgr->getDBTables( + array( + 'nodes_hierarchy', + 'node_types', + 'tcversions' + )); + $testcase_cfg = config_get('testcase_cfg'); + $glue = $testcase_cfg->glue_character; + + $containerID = isset($argsObj->testsuiteID) ? $argsObj->testsuiteID : $argsObj->objectID; + $containerName = $argsObj->tsuite_name; + if (is_null($containerName)) { + $dummy = $treeMgr->get_node_hierarchy_info($argsObj->objectID); + $containerName = $dummy['name']; + } + + // I'have discovered that exclude selected testsuite branch is not good + // when you want to move lots of testcases from one testsuite to it's children + // testsuites. (in this situation tree drag & drop is not ergonomic). + $testsuites = $tprojectMgr->gen_combo_test_suites($argsObj->tprojectID); + $tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID) . $glue; + + // While testing with PostGres have found this behaivour: + // No matter is UPPER CASE has used on field aliases, keys on hash returned by + // ADODB are lower case. + // Accessing this keys on Smarty template using UPPER CASE fails. + // Solution: have changed case on Smarty to lower case. + // + $sqlA = " SELECT MAX(TCV.version) AS lvnum, NHTC.node_order, NHTC.name," . + " NHTC.id, TCV.tc_external_id AS tcexternalid" . + " FROM {$tables['nodes_hierarchy']} NHTC " . + " JOIN {$tables['nodes_hierarchy']} NHTCV " . + " ON NHTCV.parent_id = NHTC.id " . + " JOIN {$tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN {$tables['node_types']} NT " . + " ON NT.id = NHTC.node_type_id AND NT.description='testcase'" . + " WHERE NHTC.parent_id = " . intval($containerID); + + if (! is_null($argsObj->testCaseSet)) { + $sqlA .= " AND NHTC.id IN (" . implode(',', $argsObj->testCaseSet) . ")"; + } + + $sqlA .= " GROUP BY NHTC.id,TCV.tc_external_id,NHTC.name,NHTC.node_order "; + + $sqlB = " SELECT SQLA.id AS tcid, SQLA.name AS tcname," . + " SQLA.node_order AS tcorder, SQLA.tcexternalid," . + " MTCV.summary,MTCV.status,MTCV.importance,MTCV.execution_type," . + " MTCV.id AS tcversion_id FROM ($sqlA) SQLA " . + " JOIN {$tables['nodes_hierarchy']} MNHTCV ON MNHTCV.parent_id = SQLA.id " . + " JOIN {$tables['tcversions']} MTCV ON MTCV.id = MNHTCV.id AND MTCV.version = SQLA.lvnum"; + $orderClause = " ORDER BY TCORDER,TCNAME"; + + $children = $dbHandler->get_recordset($sqlB . $orderClause); + + // check if operation can be done + $user_feedback = $feedback; + if (! is_null($children) && (count($children) > 0) && count($testsuites)) { + $op_ok = true; + } else { + $children = null; + $op_ok = false; + $user_feedback = lang_get('no_testcases_available_or_tsuite'); + } + + $gui = new stdClass(); + $gui->treeFormToken = $gui->form_token = $argsObj->treeFormToken; + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $gui->domainTCStatus = array( + - 1 => '' + ) + $dummy['lbl']; + $gui->domainTCImportance = array( + - 1 => '', + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $dummy = getConfigAndLabels('execution_type', 'code'); + $gui->domainTCExecType = array( + - 1 => '' + ) + $dummy['lbl']; + + $gui->testCasesTableView = 0; + if (($argsObj->action == 'testcases_table_view') || + ($argsObj->action == 'doBulkSet')) { + $gui->testCasesTableView = 1; + } + $gui->cf = $cf; + + $gui->tcprefix = $tcasePrefix; + $gui->testcases = $children; + + $smartyObj->assign('gui', $gui); + $smartyObj->assign('op_ok', $op_ok); + $smartyObj->assign('user_feedback', $user_feedback); + + // check if is needed + $smartyObj->assign('old_containerID', $argsObj->tprojectID); + $smartyObj->assign('containers', $testsuites); + $smartyObj->assign('objectID', $containerID); + $smartyObj->assign('object_name', $containerName); + $smartyObj->assign('top_checked', 'checked=checked'); + $smartyObj->assign('bottom_checked', ''); +} + +/* + * function: copyTestCases + * copy a set of choosen test cases. + * + * args: + * + * returns: - + * + */ +function copyTestCases(&$smartyObj, $template_dir, &$tsuiteMgr, &$tcaseMgr, + $argsObj) +{ + $op = array( + 'refreshTree' => false, + 'userfeedback' => '' + ); + if (($qty = count($argsObj->tcaseSet)) > 0) { + $msg_id = $qty == 1 ? 'one_testcase_copied' : 'testcase_set_copied'; + $op['userfeedback'] = sprintf(lang_get($msg_id), $qty); + + $copyOpt = array( + 'check_duplicate_name' => config_get('check_names_for_duplicates'), + 'action_on_duplicate_name' => config_get('action_on_duplicate_name'), + 'stepAsGhost' => $argsObj->stepAsGhost + ); + $copyOpt['copy_also'] = array( + 'keyword_assignments' => $argsObj->copyKeywords, + 'requirement_assignments' => $argsObj->copyRequirementAssignments + ); + + $copy_op = array(); + foreach ($argsObj->tcaseSet as $tcaseid) { + $copy_op[$tcaseid] = $tcaseMgr->copy_to($tcaseid, + $argsObj->containerID, $argsObj->userID, $copyOpt); + } + $guiObj = new stdClass(); + $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr, + $argsObj->objectID); + $guiObj->id = $argsObj->objectID; + $guiObj->refreshTree = true; + $op['refreshTree'] = true; + } + return $op; +} + +/* + * function: moveTestCases + * move a set of choosen test cases. + * + * args: + * + * returns: - + * + */ +function moveTestCases(&$smartyObj, $template_dir, &$tsuiteMgr, &$treeMgr, + $argsObj) +{ + $lbl = $argsObj->l10n; + if (count($argsObj->tcaseSet) > 0) { + $status_ok = $treeMgr->change_parent($argsObj->tcaseSet, + $argsObj->containerID); + $user_feedback = $status_ok ? '' : lang_get('move_testcases_failed'); + + // objectID - original container + $guiObj = new stdClass(); + $guiObj->attachments = getAttachmentInfosFrom($tsuiteMgr, + $argsObj->objectID); + $guiObj->id = $argsObj->objectID; + $guiObj->refreshTree = true; + $guiObj->btn_reorder_testcases = $lbl['btn_reorder_testcases']; + + $tsuiteMgr->show($smartyObj, $guiObj, $template_dir, $argsObj->objectID, + null, $user_feedback); + } +} + +/** + * initWebEditors + */ +function initWebEditors($action, $itemType, $editorCfg) +{ + $webEditorKeys = array( + 'testsuite' => array( + 'details' + ) + ); + $itemTemplateKey = null; + + switch ($action) { + case 'new_testsuite': + case 'add_testsuite': + case 'edit_testsuite': + $accessKey = 'testsuite'; + break; + + default: + $accessKey = ''; + break; + } + + switch ($itemType) { + case 'testproject': + case 'testsuite': + $itemTemplateKey = 'testsuite_template'; + $accessKey = 'testsuite'; + break; + } + + $oWebEditor = array(); + $htmlNames = ''; + if (isset($webEditorKeys[$accessKey])) { + $htmlNames = $webEditorKeys[$accessKey]; + foreach ($htmlNames as $key) { + $oWebEditor[$key] = web_editor($key, $_SESSION['basehref'], + $editorCfg); + } + } + return array( + $oWebEditor, + $htmlNames, + $itemTemplateKey + ); +} + +/* + * function: deleteTestCasesViewer + * prepares smarty variables to display move testcases viewer + * + * args: + * + * returns: - + * + * @internal revisions + * 20110402 - franciscom - BUGID 4322: New Option to block delete of executed test cases. + */ +function deleteTestCasesViewer(&$dbHandler, &$smartyObj, &$tprojectMgr, + &$treeMgr, &$tsuiteMgr, &$tcaseMgr, $argsObj, $feedback = null) +{ + $guiObj = new stdClass(); + $guiObj->main_descr = lang_get('delete_testcases'); + $guiObj->system_message = ''; + + $containerID = isset($argsObj->testsuiteID) ? $argsObj->testsuiteID : $argsObj->objectID; + $containerName = $argsObj->tsuite_name; + if (is_null($containerName)) { + $dummy = $treeMgr->get_node_hierarchy_info($argsObj->objectID); + $containerName = $dummy['name']; + } + + $guiObj->testCaseSet = $tsuiteMgr->get_children_testcases($containerID); + $guiObj->exec_status_quo = null; + $tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID); + $hasExecutedTC = false; + + if (! is_null($guiObj->testCaseSet) && count($guiObj->testCaseSet) > 0) { + foreach ($guiObj->testCaseSet as &$child) { + $external = $tcaseMgr->getExternalID($child['id'], null, + $tcasePrefix); + $child['external_id'] = $external[0]; + + // key level 1 : Test Case Version ID + // key level 2 : Test Plan ID + // key level 3 : Platform ID + $getOptions = array( + 'addExecIndicator' => true + ); + $dummy = $tcaseMgr->get_exec_status($child['id'], null, $getOptions); + $child['draw_check'] = $argsObj->grants->delete_executed_testcases || + (! $dummy['executed']); + + $hasExecutedTC = $hasExecutedTC || $dummy['executed']; + unset($dummy['executed']); + $guiObj->exec_status_quo[] = $dummy; + } + } + // Need to understand if platform column has to be displayed on GUI + if (! is_null($guiObj->exec_status_quo)) { + // key level 1 : Test Case Version ID + // key level 2 : Test Plan ID + // key level 3 : Platform ID + + $itemSet = array_keys($guiObj->exec_status_quo); + foreach ($itemSet as $mainKey) { + $guiObj->display_platform[$mainKey] = false; + if (! is_null($guiObj->exec_status_quo[$mainKey])) { + $versionSet = array_keys($guiObj->exec_status_quo[$mainKey]); + $stop = false; + foreach ($versionSet as $version_id) { + $tplanSet = array_keys( + $guiObj->exec_status_quo[$mainKey][$version_id]); + foreach ($tplanSet as $tplan_id) { + if ($guiObj->display_platform[$mainKey] = ! isset( + $guiObj->exec_status_quo[$mainKey][$version_id][$tplan_id][0])) { + $stop = true; + break; + } + } + + if ($stop) { + break; + } + } + } + } + } + // check if operation can be done + $guiObj->user_feedback = $feedback; + if (! is_null($guiObj->testCaseSet) && (count($guiObj->testCaseSet) > 0)) { + $guiObj->op_ok = true; + $guiObj->user_feedback = ''; + } else { + $guiObj->children = null; + $guiObj->op_ok = false; + $guiObj->user_feedback = is_null($guiObj->user_feedback) ? lang_get( + 'no_testcases_available') : $guiObj->user_feedback; + } + + if (! $argsObj->grants->delete_executed_testcases && $hasExecutedTC) { + $guiObj->system_message = lang_get('system_blocks_delete_executed_tc'); + } + + $guiObj->objectID = $containerID; + $guiObj->object_name = $containerName; + $guiObj->refreshTree = $argsObj->refreshTree; + + $smartyObj->assign('gui', $guiObj); +} + +/* + * function: doDeleteTestCasesViewer + * prepares smarty variables to display move testcases viewer + * + * args: + * + * returns: - + * + */ +function doDeleteTestCases(&$dbHandler, $tcaseSet, &$tcaseMgr) +{ + if (! empty($tcaseSet)) { + foreach ($tcaseSet as $victim) { + $tcaseMgr->delete($victim); + } + } +} + +/** + */ +function reorderTestCasesByCriteria($argsObj, &$tsuiteMgr, &$treeMgr) +{ + $sortCriteria = config_get('testcase_reorder_by'); + $pfn = ($sortCriteria == 'NAME') ? 'reorderTestCasesDictionary' : 'reorderTestCasesByExtID'; + $pfn($argsObj, $tsuiteMgr, $treeMgr); +} + +/** + */ +function reorderTestCasesDictionary($argsObj, &$tsuiteMgr, &$treeMgr) +{ + $tcaseSet = (array) $tsuiteMgr->get_children_testcases( + $argsObj->testsuiteID, 'simple'); + if (($loop2do = count($tcaseSet)) > 0) { + for ($idx = 0; $idx < $loop2do; $idx ++) { + $a2sort[$tcaseSet[$idx]['id']] = strtolower($tcaseSet[$idx]['name']); + } + natsort($a2sort); + $a2sort = array_keys($a2sort); + $treeMgr->change_order_bulk($a2sort); + } +} + +/** + */ +function reorderTestCasesByExtID($argsObj, &$tsuiteMgr, &$treeMgr) +{ + $tables = $tsuiteMgr->getDBTables( + array( + 'nodes_hierarchy', + 'testsuites', + 'tcversions' + )); + + $sql = " SELECT DISTINCT NHTC.id,TCV.tc_external_id " . + " FROM {$tables['nodes_hierarchy']} NHTC " . + " JOIN {$tables['nodes_hierarchy']} NHTCV ON NHTCV.parent_id = NHTC.id " . + " JOIN {$tables['tcversions']} TCV ON TCV.id = NHTCV.id " . + " JOIN {$tables['testsuites']} TS ON NHTC.parent_id = TS.id " . + " WHERE TS.id = " . intval($argsObj->testsuiteID) . + " ORDER BY tc_external_id ASC"; + + $tcaseSet = $tsuiteMgr->db->fetchColumnsIntoMap($sql, 'tc_external_id', 'id'); + $treeMgr->change_order_bulk($tcaseSet); +} + +/** + */ +function reorderTestSuitesDictionary($treeMgr, $parent_id) +{ + $exclude_node_types = array( + 'testplan' => 1, + 'requirement' => 1, + 'testcase' => 1, + 'requirement_spec' => 1 + ); + $itemSet = (array) $treeMgr->get_children($parent_id, $exclude_node_types); + if (($loop2do = count($itemSet)) > 0) { + for ($idx = 0; $idx < $loop2do; $idx ++) { + $a2sort[$itemSet[$idx]['id']] = strtolower($itemSet[$idx]['name']); + } + natsort($a2sort); + $a2sort = array_keys($a2sort); + $treeMgr->change_order_bulk($a2sort); + } +} + +/** + */ +function initializeGui(&$objMgr, $id, $argsObj, $lbl = null) +{ + $guiObj = new stdClass(); + + $labels = $lbl; + if (null == $labels) { + $labels = $argsObj->l10n; + } + + $guiObj->id = $id; + $guiObj->user = $argsObj->user; + $guiObj->tproject_id = $argsObj->tprojectID; + $guiObj->refreshTree = $argsObj->refreshTree; + $guiObj->btn_reorder_testcases = $labels['btn_reorder_testcases']; + $guiObj->page_title = $labels['container_title_testsuite']; + $guiObj->attachments = getAttachmentInfosFrom($objMgr, $id); + $guiObj->form_token = $argsObj->treeFormToken; + + $guiObj->fileUploadURL = $_SESSION['basehref'] . + $objMgr->getFileUploadRelativeURL($id); + + if ($objMgr->my_node_type == $objMgr->node_types_descr_id['testsuite']) { + $guiObj->direct_link = $objMgr->buildDirectWebLink( + $_SESSION['basehref'], $guiObj->id, $argsObj->tprojectID); + } + + $guiObj->modify_tc_rights = $argsObj->grants->testcase_mgmt; + return $guiObj; +} + +/** + */ +function doBulkSet(&$dbHandler, $argsObj, $tcaseSet, &$tcaseMgr) +{ + if (! empty($tcaseSet)) { + $k2s = array( + 'tc_status' => 'setStatus', + 'importance' => 'setImportance', + 'execution_type' => 'setExecutionType' + ); + foreach ($tcaseSet as $tcversion_id => $tcase_id) { + foreach ($k2s as $attr => $m2c) { + if ($argsObj->$attr > 0) { + $tcaseMgr->$m2c($tcversion_id, $argsObj->$attr); + } + } + } + + // second round, on Custom Fields + $cf_map = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $argsObj->tprojectID, cfield_mgr::ENABLED, NO_FILTER_SHOW_ON_EXEC, + 'testcase'); + if (! is_null($cf_map)) { + // get checkboxes from $_REQUEST + $k2i = array_keys($_REQUEST); + $cfval = null; + foreach ($k2i as $val) { + if (strpos($val, 'check_custom_field_') !== false) { + $cfid = explode('_', $val); + $cfid = end($cfid); + $cfval[$cfid] = $cf_map[$cfid]; + } + } + if (! is_null($cfval)) { + foreach ($tcaseSet as $tcversion_id => $tcase_id) { + $tcaseMgr->cfield_mgr->design_values_to_db($_REQUEST, + $tcversion_id, $cfval); + } + } + } + } +} + +/** + */ +function initTPLActions() +{ + $tpl = array( + 'move_testsuite_viewer' => 'containerMove.tpl', + 'delete_testsuite' => 'containerDelete.tpl', + 'move_testcases_viewer' => 'containerMoveTC.tpl', + 'testcases_table_view' => 'containerMoveTC.tpl', + 'do_copy_tcase_set' => 'containerMoveTC.tpl', + 'do_copy_tcase_set_ghost' => 'containerMoveTC.tpl', + 'delete_testcases' => 'containerDeleteTC.tpl', + 'do_delete_testcases' => 'containerDeleteTC.tpl', + 'doBulkSet' => 'containerMoveTC.tpl' + ); + + $actions = array( + 'edit_testsuite' => 0, + 'new_testsuite' => 0, + 'delete_testsuite' => 0, + 'do_move' => 0, + 'do_copy' => 0, + 'reorder_testsuites' => 1, + 'do_testsuite_reorder' => 0, + 'add_testsuite' => 1, + 'move_testsuite_viewer' => 0, + 'update_testsuite' => 1, + 'move_testcases_viewer' => 0, + 'do_move_tcase_set' => 0, + 'testcases_table_view' => 0, + 'do_copy_tcase_set' => 0, + 'do_copy_tcase_set_ghost' => 0, + 'del_testsuites_bulk' => 0, + 'delete_testcases' => 0, + 'do_delete_testcases' => 0, + 'reorder_testcases' => 0, + 'reorder_testsuites_alpha' => 0, + 'reorder_testproject_testsuites_alpha' => 0, + 'doBulkSet' => 0 + ); + + return array( + $tpl, + $actions + ); +} + +/** + */ +function showTestSuite(&$tplEngine, &$argsO, &$tsuiteMgr, $tplDir) +{ + if (null == $argsO->tprojectID) { + $argsO->tprojectID = $tsuiteMgr->getTestproject($argsO->item_id); + } + $gui = initializeGui($tsuiteMgr, $argsO->item_id, $argsO, $argsO->l10n); + $gui->refreshTree = 0; + $tsuiteMgr->show($tplEngine, $gui, $tplDir, $argsO->item_id, null, null); + exit(); } diff --git a/lib/testcases/listTestCases.php b/lib/testcases/listTestCases.php index a5da56ca24..1ac7ada134 100644 --- a/lib/testcases/listTestCases.php +++ b/lib/testcases/listTestCases.php @@ -1,59 +1,64 @@ -build_tree_menu($gui); -$control->formAction = ''; - -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->assign('control', $control); -$smarty->assign('args', $control->get_argument_string()); -$smarty->assign('menuUrl', $gui->menuUrl); - -$smarty->display($templateCfg->template_dir . 'tcTree.tpl'); - - -/** - * Initialize object with information for graphical user interface. - * - * @param tlTestCaseFilterControl $control - * @return stdClass $gui - */ -function initializeGui(&$dbHandler, &$control) -{ - $gui = new stdClass(); - $gui->feature = $control->args->feature; - $gui->treeHeader = lang_get('title_navigator'). ' - ' . lang_get('title_test_spec'); - - $lblkey = (config_get('testcase_reorder_by') == 'NAME') ? '_alpha' : '_externalid'; - $gui->btn_reorder_testcases = lang_get('btn_reorder_testcases' . $lblkey); - - $feature_path = array('edit_tc' => "lib/testcases/archiveData.php", - 'keywordsAssign' => "lib/keywords/keywordsAssign.php", - 'assignReqs' => "lib/requirements/reqTcAssign.php"); - - $gui->tree_drag_and_drop_enabled = array('edit_tc' => ($_SESSION['currentUser']->hasRightOnProj($dbHandler, "mgt_modify_tc") == 'yes'), - 'keywordsAssign' => false, - 'assignReqs' => false); - - $gui->menuUrl = $feature_path[$gui->feature]; - return $gui; -} \ No newline at end of file +build_tree_menu($gui); +$control->formAction = ''; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('control', $control); +$smarty->assign('args', $control->get_argument_string()); +$smarty->assign('menuUrl', $gui->menuUrl); + +$smarty->display($templateCfg->template_dir . 'tcTree.tpl'); + +/** + * Initialize object with information for graphical user interface. + * + * @param tlTestCaseFilterControl $control + * @return stdClass $gui + */ +function initializeGui(&$dbHandler, &$control) +{ + $gui = new stdClass(); + $gui->feature = $control->args->feature; + $gui->treeHeader = lang_get('title_navigator') . ' - ' . + lang_get('title_test_spec'); + + $lblkey = (config_get('testcase_reorder_by') == 'NAME') ? '_alpha' : '_externalid'; + $gui->btn_reorder_testcases = lang_get('btn_reorder_testcases' . $lblkey); + + $feature_path = array( + 'edit_tc' => "lib/testcases/archiveData.php", + 'keywordsAssign' => "lib/keywords/keywordsAssign.php", + 'assignReqs' => "lib/requirements/reqTcAssign.php" + ); + + $gui->tree_drag_and_drop_enabled = array( + 'edit_tc' => ($_SESSION['currentUser']->hasRightOnProj($dbHandler, + "mgt_modify_tc") == 'yes'), + 'keywordsAssign' => false, + 'assignReqs' => false + ); + + $gui->menuUrl = $feature_path[$gui->feature]; + return $gui; +} diff --git a/lib/testcases/scriptAdd.php b/lib/testcases/scriptAdd.php index e64839f08a..798c08b5a2 100755 --- a/lib/testcases/scriptAdd.php +++ b/lib/testcases/scriptAdd.php @@ -1,424 +1,480 @@ -codeTrackerMetaData = array('projects' => null, 'repos' => null, 'files' => null, - 'branches' => null, 'commits' => null); -if(!is_null($args->projectKey)) -{ - $gui->codeTrackerMetaData['projects'] = $args->projectKey; -} -else -{ - $gui->codeTrackerMetaData['projects'] = $cts->getProjectsForHTMLSelect(); -} - -if(is_null($gui->project_key)) -{ - $gui->project_key = isset($_SESSION['testscript_projectKey']) ? $_SESSION['testscript_projectKey'] : $cts->cfg->projectkey; -} -if(is_null($gui->repository_name) && isset($_SESSION['testscript_repositoryName']) && $args->user_action == 'link') -{ - $gui->repository_name = $_SESSION['testscript_repositoryName']; -} - -if(!is_null($args->repositoryName) && $args->user_action != 'projectSelected') -{ - $gui->codeTrackerMetaData['repos'] = $args->repositoryName; -} -else -{ - $gui->codeTrackerMetaData['repos'] = $cts->getReposForHTMLSelect($gui->project_key); -} - -if(!is_null($args->branchName) && $args->user_action != 'projectSelected' && $args->user_action != 'repoSelected') -{ - $gui->codeTrackerMetaData['branches'] = $args->branchName; -} -else -{ - $gui->codeTrackerMetaData['branches'] = $cts->getBranchesForHTMLSelect($gui->project_key, $gui->repository_name); -} - -if(!is_null($args->commits) && $args->user_action != 'projectSelected' && $args->user_action != 'repoSelected' && - $args->user_action != 'branchSelected') -{ - $gui->codeTrackerMetaData['commits'] = $args->commits; -} -else if(($args->user_action == 'branchSelected') || - (!is_null($gui->branch_name) && ($args->user_action == 'expand' || $args->user_action == 'collapse'))) -{ - $gui->codeTrackerMetaData['commits'] = $cts->getCommitsForHTMLSelect($gui->project_key, $gui->repository_name, - $gui->branch_name); -} - -if(!is_null($args->files) && ($args->user_action == 'expand' || $args->user_action == 'collapse')) -{ - $gui->codeTrackerMetaData['files'] = $args->files; -} -else if($args->user_action == 'repoSelected' || $args->user_action == 'branchSelected' || -$args->user_action == 'expand' || $args->user_action == 'collapse' || ($args->user_action == 'link' && !is_null($gui->repository_name))) -{ - $gui->codeTrackerMetaData['files'] = $cts->getRepoContentForHTMLSelect($gui->project_key, $gui->repository_name, '', $gui->branch_name, $gui->commit_id); -} -if($args->user_action == 'expand') -{ - $expandArray = explode("/", $args->expand_item); - $tmpFileArray = &$gui->codeTrackerMetaData['files']; - $tmpPath = ""; - foreach($expandArray as $item) - { - $tmpPath .= $item . "/"; - $tmpFileArray[$item][0] = $cts->getRepoContentForHTMLSelect($gui->project_key, $gui->repository_name, $tmpPath, $gui->branch_name, $gui->commit_id); - $tmpFileArray = &$tmpFileArray[$item][0]; - } -} -else if($args->user_action == 'collapse') -{ - if(substr($args->collapse_item,-1) == "/") - { - $args->collapse_item = substr($args->collapse_item,0,-1); - } - $collapseArray = explode("/", $args->collapse_item); - array_pop($collapseArray); - - $tmpFileArray = &$gui->codeTrackerMetaData['files']; - $tmpPath = ""; - foreach($collapseArray as $item) - { - $tmpPath .= $item . "/"; - $tmpFileArray[$item][0] = $cts->getRepoContentForHTMLSelect($gui->project_key, $gui->repository_name, $tmpPath, $gui->branch_name, $gui->commit_id); - $tmpFileArray = &$tmpFileArray[$item][0]; - } -} - -if($args->user_action == 'create') -{ - if(!is_null($codeT) && $args->project_key != "" && $args->repository_name != "" && $args->code_path != "") - { - $l18n = init_labels(array("error_code_does_not_exist_on_cts" => null)); - - $gui->msg = ""; - - $baseURL = $cts->buildViewCodeURL($args->project_key, $args->repository_name, ''); - /* if code_path was entered manually it may contain the complete URL - * in this case we have to strip the base URL from the string - */ - if (substr($args->code_path, 0, strlen($baseURL)) === $baseURL) - { - $args->code_path = substr($args->code_path, strlen($baseURL)); - } - // if code_path contains reference to certain branch, delete it - $refPos = strpos($args->code_path, '?at='); - if ($refPos !== false) - { - // in case no branch was seleted try to extract branch name from reference if possible - $refStr = substr($args->code_path, $refPos); - if (strpos($refStr, '?at=refs%2Fheads%2F') !== false) - { - $refStr = str_replace("?at=refs%2Fheads%2F", "", $refStr); - if (is_null($args->branch_name) && (isset($args->branchName[$refStr]) || array_key_exists($refStr, $args->branchName))) - { - $args->branch_name = $refStr; - } - } - else //no branch given, but commit_id -> try to extract this - { - $refStr = str_replace("?at=", "", $refStr); - if (is_null($args->commit_id)) - { - $args->commit_id = $refStr; - } - } - - $args->code_path = substr($args->code_path, 0, $refPos); - } - - $scriptWritten = write_testcase_script($db,$cts,$args->tcversion_id, $args->project_key, $args->repository_name, - $args->code_path, $args->branch_name, $args->commit_id); - - - $auditMsg = "audit_testcasescript_added"; - $item_id = $args->tcversion_id; - $objectType = "testcase_script_links"; - $args->direct_link = $cts->buildViewCodeURL($args->project_key,$args->repository_name,$args->code_path,$args->branch_name); - if ($scriptWritten) - { - $gui->msg = lang_get("script_added"); - - //save user selection of project_key and repository_name to current session - $_SESSION['testscript_projectKey'] = $args->project_key; - $_SESSION['testscript_repositoryName'] = $args->repository_name; - - //update value of Custom Field "Test Script" if possible - $tScriptFieldID = null; - $tScriptFieldValue = null; - - $tcase_mgr = new testcase($db); - $linked_cfields = $tcase_mgr->cfield_mgr->get_linked_cfields_at_design($args->tproject_id, - 1,null,'testcase',$args->tcversion_id); - unset($tcase_mgr); - foreach($linked_cfields as $cfieldID => $cfieldValue) - { - if (is_null($tScriptFieldValue) && strpos(strtolower(str_replace(" ", "", $cfieldValue['name'])), 'testscript') !== false) - { - $tScriptFieldID = $cfieldID; - $tScriptFieldValue = $cfieldValue; - break; - } - } - - if (!is_null($tScriptFieldID)) - { - $cfieldWritten = write_cfield_testscript($db, $args->user, $tScriptFieldID, $args->tcversion_id, $args->code_path); - } - else - { - $cfieldWritten = true; - } - - if (!$cfieldWritten) - { - $gui->msg .= " - But Custom Field 'Test Script' could not be updated"; - } - - logAuditEvent(TLS($auditMsg,$args->direct_link),"CREATE",$item_id,$objectType); - } - else - { - $gui->msg = sprintf($l18n["error_code_does_not_exist_on_cts"],$args->direct_link); - } - } - else - { - $gui->msg = lang_get("error_script_not_added"); - } -} -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function initEnv(&$dbHandler) -{ - $uaWhiteList = array(); - $uaWhiteList['elements'] = array('link','create','projectSelected','repoSelected', - 'branchSelected','expand','collapse'); - $uaWhiteList['length'] = array(); - foreach($uaWhiteList['elements'] as $xmen) - { - $uaWhiteList['length'][] = strlen($xmen); - } - $user_action['maxLength'] = max($uaWhiteList['length']); - $user_action['minLength'] = min($uaWhiteList['length']); - - $iParams = array("script_id" => array("REQUEST",tlInputParameter::STRING_N), - "tproject_id" => array("REQUEST",tlInputParameter::INT_N), - "tplan_id" => array("REQUEST",tlInputParameter::INT_N), - "tcversion_id" => array("REQUEST",tlInputParameter::INT_N), - "project_key" => array("POST",tlInputParameter::STRING_N), - "repository_name" => array("POST",tlInputParameter::STRING_N), - "code_path" => array("POST",tlInputParameter::STRING_N), - "branch_name" => array("POST",tlInputParameter::STRING_N), - "commit_id" => array("POST",tlInputParameter::STRING_N), - "projectKey" => array("POST",tlInputParameter::ARRAY_STRING_N), - "repositoryName" => array("POST",tlInputParameter::ARRAY_STRING_N), - "branchName" => array("POST",tlInputParameter::ARRAY_STRING_N), - "commits" => array("POST",tlInputParameter::ARRAY_STRING_N), - "files" => array("POST",tlInputParameter::ARRAY_STRING_N), - "expand_item" => array("POST",tlInputParameter::STRING_N), - "collapse_item" => array("POST",tlInputParameter::STRING_N), - "user_action" => array("REQUEST",tlInputParameter::STRING_N, - $user_action['minLength'],$user_action['maxLength'])); - - $args = new stdClass(); - I_PARAMS($iParams,$args); - - $args->user = $_SESSION['currentUser']; - - $gui = new stdClass(); - $gui->pageTitle = lang_get('title_script_add'); - - $gui->msg = ''; - $gui->tproject_id = $args->tproject_id; - $gui->tplan_id = $args->tplan_id; - $gui->tcversion_id = $args->tcversion_id; - $gui->user_action = $args->user_action; - - $gui->project_key = $args->project_key; - $gui->repository_name = $args->repository_name; - $gui->code_path = $args->code_path; - $gui->branch_name = $args->branch_name; - $gui->commit_id = $args->commit_id; - - // ----------------------------------------------------------------------- - // Special processing - list($ctObj,$ctCfg) = getCodeTracker($dbHandler,$args,$gui); - - $args->script_id = trim($args->script_id); - - return array($args,$gui,$ctObj,$ctCfg); -} - - -/** - * - */ -function getCodeTracker(&$dbHandler,$argsObj,&$guiObj) -{ - $cts = null; - $tprojectMgr = new testproject($dbHandler); - $info = $tprojectMgr->get_by_id($argsObj->tproject_id); - unset($tprojectMgr); - - $guiObj->codeTrackerCfg = new stdClass(); - $guiObj->codeTrackerCfg->createCodeURL = null; - $guiObj->codeTrackerCfg->VerboseID = ''; - $guiObj->codeTrackerCfg->VerboseType = ''; - - if($info['code_tracker_enabled']) - { - $ct_mgr = new tlCodeTracker($dbHandler); - $codeTrackerCfg = $ct_mgr->getLinkedTo($argsObj->tproject_id); - - if( !is_null($codeTrackerCfg) ) - { - $cts = $ct_mgr->getInterfaceObject($argsObj->tproject_id); - $guiObj->codeTrackerCfg->VerboseType = $codeTrackerCfg['verboseType']; - $guiObj->codeTrackerCfg->VerboseID = $codeTrackerCfg['codetracker_name']; - $guiObj->codeTrackerCfg->createCodeURL = $cts->getEnterCodeURL(); - } - } - return array($cts,$codeTrackerCfg); -} - -/** - * - */ -function write_testcase_script(&$dbHandler, &$cts, $tcversion_id, $project_key, - $repo_name, $code_path, $branch_name, $commit_id) -{ - $result = true; - - $repoCont = $cts->getRepoContent($project_key,$repo_name,$code_path,$branch_name,$commit_id); - if(property_exists($repoCont, 'errors')) - { - return false; - } - - $tbk = array('testcase_script_links'); - $tbl = tlObjectWithDB::getDBTables($tbk); - - //check if entry already exists in DB - $sql = " SELECT * FROM `{$tbl['testcase_script_links']}` " . - " WHERE `tcversion_id` = " .intval($tcversion_id) . - " AND `project_key` = '{$project_key}' " . - " AND `repository_name` = '{$repo_name}' " . - " AND `code_path` = '{$code_path}'"; - - $rs = $dbHandler->get_recordset($sql); - if (is_null($rs)) - { - $fields = "(`tcversion_id`,`project_key`,`repository_name`,`code_path`"; - $values = "(".intval($tcversion_id).",'{$project_key}'," . - "'{$repo_name}','{$code_path}'"; - if (!is_null($branch_name)) - { - $fields .= ",`branch_name`"; - $values .= ",'{$branch_name}'"; - } - if (!is_null($commit_id)) - { - $fields .= ",`commit_id`"; - $values .= ",'{$commit_id}'"; - } - $fields .= ")"; - $values .= ")"; - - //no entry found, i.e. add new values to DB - $sql = " INSERT INTO `{$tbl['testcase_script_links']}` {$fields} " . - " VALUES {$values}"; - - $result = $dbHandler->exec_query($sql); - } - - return $result; -} - -function write_cfield_testscript(&$dbHandler, &$user, $field_id, $node_id, $value) -{ - $tbk = array('cfield_design_values', 'tcversions','executions'); - $tbl = tlObjectWithDB::getDBTables($tbk); - - $result = false; - //check if tcversion can be edited - $sql = " SELECT id, active, is_open, baseline, reviewer_id " . - " FROM `{$tbl['tcversions']}` " . - " WHERE `id` = '{$node_id}'"; - - $rs = $dbHandler->get_recordset($sql); - - if(!is_null($rs)) - { - $rs = $rs[0]; - /* only update custom field value if test case can be - * modified, i.e. has no baseline, is not status "Accepted" - * and is active and open */ - if($rs['active'] == 1 && $rs['is_open'] == 1 && - is_null($rs['baseline']) && is_null($rs['reviewer_id'])) - { - $sql = " SELECT id FROM `{$tbl['executions']}` " . - " WHERE `tcversion_id` = '{$node_id}'"; - - $rsExec = $dbHandler->get_recordset($sql); - - /* only update if test case was not executed yet or - * corresponding modification right is given */ - if(is_null($rsExec) || - $user->hasRight($dbHandler,"testproject_edit_executed_testcases")) - { - //check if entry already exists in DB - $sql = " UPDATE `{$tbl['cfield_design_values']}` " . - " SET `value` = '{$value}' " . - " WHERE `field_id` = '{$field_id}' " . - " AND `node_id` = '{$node_id}'"; - - $result = $dbHandler->exec_query($sql); - } - } - } - - return $result; - -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) -{ - $hasRights = $user->hasRight($db,"mgt_modify_tc"); - return $hasRights; +codeTrackerMetaData = array( + 'projects' => null, + 'repos' => null, + 'files' => null, + 'branches' => null, + 'commits' => null +); +if (! is_null($args->projectKey)) { + $gui->codeTrackerMetaData['projects'] = $args->projectKey; +} else { + $gui->codeTrackerMetaData['projects'] = $cts->getProjectsForHTMLSelect(); +} + +if (is_null($gui->project_key)) { + $gui->project_key = isset($_SESSION['testscript_projectKey']) ? $_SESSION['testscript_projectKey'] : $cts->cfg->projectkey; +} +if (is_null($gui->repository_name) && + isset($_SESSION['testscript_repositoryName']) && $args->user_action == 'link') { + $gui->repository_name = $_SESSION['testscript_repositoryName']; +} + +if (! is_null($args->repositoryName) && $args->user_action != 'projectSelected') { + $gui->codeTrackerMetaData['repos'] = $args->repositoryName; +} else { + $gui->codeTrackerMetaData['repos'] = $cts->getReposForHTMLSelect( + $gui->project_key); +} + +if (! is_null($args->branchName) && $args->user_action != 'projectSelected' && + $args->user_action != 'repoSelected') { + $gui->codeTrackerMetaData['branches'] = $args->branchName; +} else { + $gui->codeTrackerMetaData['branches'] = $cts->getBranchesForHTMLSelect( + $gui->project_key, $gui->repository_name); +} + +if (! is_null($args->commits) && $args->user_action != 'projectSelected' && + $args->user_action != 'repoSelected' && + $args->user_action != 'branchSelected') { + $gui->codeTrackerMetaData['commits'] = $args->commits; +} elseif (($args->user_action == 'branchSelected') || + (! is_null($gui->branch_name) && + ($args->user_action == 'expand' || $args->user_action == 'collapse'))) { + $gui->codeTrackerMetaData['commits'] = $cts->getCommitsForHTMLSelect( + $gui->project_key, $gui->repository_name, $gui->branch_name); +} + +if (! is_null($args->files) && + ($args->user_action == 'expand' || $args->user_action == 'collapse')) { + $gui->codeTrackerMetaData['files'] = $args->files; +} elseif ($args->user_action == 'repoSelected' || + $args->user_action == 'branchSelected' || $args->user_action == 'expand' || + $args->user_action == 'collapse' || + ($args->user_action == 'link' && ! is_null($gui->repository_name))) { + $gui->codeTrackerMetaData['files'] = $cts->getRepoContentForHTMLSelect( + $gui->project_key, $gui->repository_name, '', $gui->branch_name, + $gui->commit_id); +} +if ($args->user_action == 'expand') { + $expandArray = explode("/", $args->expand_item); + $tmpFileArray = &$gui->codeTrackerMetaData['files']; + $tmpPath = ""; + foreach ($expandArray as $item) { + $tmpPath .= $item . "/"; + $tmpFileArray[$item][0] = $cts->getRepoContentForHTMLSelect( + $gui->project_key, $gui->repository_name, $tmpPath, + $gui->branch_name, $gui->commit_id); + $tmpFileArray = &$tmpFileArray[$item][0]; + } +} elseif ($args->user_action == 'collapse') { + if (substr($args->collapse_item, - 1) == "/") { + $args->collapse_item = substr($args->collapse_item, 0, - 1); + } + $collapseArray = explode("/", $args->collapse_item); + array_pop($collapseArray); + + $tmpFileArray = &$gui->codeTrackerMetaData['files']; + $tmpPath = ""; + foreach ($collapseArray as $item) { + $tmpPath .= $item . "/"; + $tmpFileArray[$item][0] = $cts->getRepoContentForHTMLSelect( + $gui->project_key, $gui->repository_name, $tmpPath, + $gui->branch_name, $gui->commit_id); + $tmpFileArray = &$tmpFileArray[$item][0]; + } +} + +if ($args->user_action == 'create') { + if (! is_null($codeT) && $args->project_key != "" && + $args->repository_name != "" && $args->code_path != "") { + $l18n = init_labels(array( + "error_code_does_not_exist_on_cts" => null + )); + + $gui->msg = ""; + + $baseURL = $cts->buildViewCodeURL($args->project_key, + $args->repository_name, ''); + /* + * if code_path was entered manually it may contain the complete URL + * in this case we have to strip the base URL from the string + */ + if (substr($args->code_path, 0, strlen($baseURL)) === $baseURL) { + $args->code_path = substr($args->code_path, strlen($baseURL)); + } + // if code_path contains reference to certain branch, delete it + $refPos = strpos($args->code_path, '?at='); + if ($refPos !== false) { + // in case no branch was seleted try to extract branch name from reference if possible + $refStr = substr($args->code_path, $refPos); + if (strpos($refStr, '?at=refs%2Fheads%2F') !== false) { + $refStr = str_replace("?at=refs%2Fheads%2F", "", $refStr); + if (is_null($args->branch_name) && + (isset($args->branchName[$refStr]) || + array_key_exists($refStr, $args->branchName))) { + $args->branch_name = $refStr; + } + } else // no branch given, but commit_id -> try to extract this + { + $refStr = str_replace("?at=", "", $refStr); + if (is_null($args->commit_id)) { + $args->commit_id = $refStr; + } + } + + $args->code_path = substr($args->code_path, 0, $refPos); + } + + $scriptWritten = writeTestcaseScript($db, $cts, $args->tcversion_id, + $args->project_key, $args->repository_name, $args->code_path, + $args->branch_name, $args->commit_id); + + $auditMsg = "audit_testcasescript_added"; + $item_id = $args->tcversion_id; + $objectType = "testcase_script_links"; + $args->direct_link = $cts->buildViewCodeURL($args->project_key, + $args->repository_name, $args->code_path, $args->branch_name); + if ($scriptWritten) { + $gui->msg = lang_get("script_added"); + + // save user selection of project_key and repository_name to current session + $_SESSION['testscript_projectKey'] = $args->project_key; + $_SESSION['testscript_repositoryName'] = $args->repository_name; + + // update value of Custom Field "Test Script" if possible + $tScriptFieldID = null; + $tScriptFieldValue = null; + + $tcaseMgr = new testcase($db); + $linked_cfields = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $args->tproject_id, 1, null, 'testcase', $args->tcversion_id); + unset($tcaseMgr); + foreach ($linked_cfields as $cfieldID => $cfieldValue) { + if (is_null($tScriptFieldValue) && + strpos( + strtolower(str_replace(" ", "", $cfieldValue['name'])), + 'testscript') !== false) { + $tScriptFieldID = $cfieldID; + $tScriptFieldValue = $cfieldValue; + break; + } + } + + if (! is_null($tScriptFieldID)) { + $cfieldWritten = writeCfieldTestscript($db, $args->user, + $tScriptFieldID, $args->tcversion_id, $args->code_path); + } else { + $cfieldWritten = true; + } + + if (! $cfieldWritten) { + $gui->msg .= " - But Custom Field 'Test Script' could not be updated"; + } + + logAuditEvent(TLS($auditMsg, $args->direct_link), "CREATE", $item_id, + $objectType); + } else { + $gui->msg = sprintf($l18n["error_code_does_not_exist_on_cts"], + $args->direct_link); + } + } else { + $gui->msg = lang_get("error_script_not_added"); + } +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initEnv(&$dbHandler) +{ + $uaWhiteList = array(); + $uaWhiteList['elements'] = array( + 'link', + 'create', + 'projectSelected', + 'repoSelected', + 'branchSelected', + 'expand', + 'collapse' + ); + $uaWhiteList['length'] = array(); + foreach ($uaWhiteList['elements'] as $xmen) { + $uaWhiteList['length'][] = strlen($xmen); + } + $user_action['maxLength'] = max($uaWhiteList['length']); + $user_action['minLength'] = min($uaWhiteList['length']); + + $iParams = array( + "script_id" => array( + "REQUEST", + tlInputParameter::STRING_N + ), + "tproject_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "tplan_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "tcversion_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "project_key" => array( + "POST", + tlInputParameter::STRING_N + ), + "repository_name" => array( + "POST", + tlInputParameter::STRING_N + ), + "code_path" => array( + "POST", + tlInputParameter::STRING_N + ), + "branch_name" => array( + "POST", + tlInputParameter::STRING_N + ), + "commit_id" => array( + "POST", + tlInputParameter::STRING_N + ), + "projectKey" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "repositoryName" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "branchName" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "commits" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "files" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ), + "expand_item" => array( + "POST", + tlInputParameter::STRING_N + ), + "collapse_item" => array( + "POST", + tlInputParameter::STRING_N + ), + "user_action" => array( + "REQUEST", + tlInputParameter::STRING_N, + $user_action['minLength'], + $user_action['maxLength'] + ) + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + + $args->user = $_SESSION['currentUser']; + + $gui = new stdClass(); + $gui->pageTitle = lang_get('title_script_add'); + + $gui->msg = ''; + $gui->tproject_id = $args->tproject_id; + $gui->tplan_id = $args->tplan_id; + $gui->tcversion_id = $args->tcversion_id; + $gui->user_action = $args->user_action; + + $gui->project_key = $args->project_key; + $gui->repository_name = $args->repository_name; + $gui->code_path = $args->code_path; + $gui->branch_name = $args->branch_name; + $gui->commit_id = $args->commit_id; + + // ----------------------------------------------------------------------- + // Special processing + list ($ctObj, $ctCfg) = getCodeTracker($dbHandler, $args, $gui); + + $args->script_id = trim($args->script_id); + + return array( + $args, + $gui, + $ctObj, + $ctCfg + ); +} + +/** + */ +function getCodeTracker(&$dbHandler, $argsObj, &$guiObj) +{ + $cts = null; + $tprojectMgr = new testproject($dbHandler); + $info = $tprojectMgr->get_by_id($argsObj->tproject_id); + unset($tprojectMgr); + + $guiObj->codeTrackerCfg = new stdClass(); + $guiObj->codeTrackerCfg->createCodeURL = null; + $guiObj->codeTrackerCfg->VerboseID = ''; + $guiObj->codeTrackerCfg->VerboseType = ''; + + if ($info['code_tracker_enabled']) { + $ct_mgr = new tlCodeTracker($dbHandler); + $codeTrackerCfg = $ct_mgr->getLinkedTo($argsObj->tproject_id); + + if (! is_null($codeTrackerCfg)) { + $cts = $ct_mgr->getInterfaceObject($argsObj->tproject_id); + $guiObj->codeTrackerCfg->VerboseType = $codeTrackerCfg['verboseType']; + $guiObj->codeTrackerCfg->VerboseID = $codeTrackerCfg['codetracker_name']; + $guiObj->codeTrackerCfg->createCodeURL = $cts->getEnterCodeURL(); + } + } + return array( + $cts, + $codeTrackerCfg + ); +} + +/** + */ +function writeTestcaseScript(&$dbHandler, &$cts, $tcversion_id, $project_key, + $repo_name, $code_path, $branch_name, $commit_id) +{ + $result = true; + + $repoCont = $cts->getRepoContent($project_key, $repo_name, $code_path, + $branch_name, $commit_id); + if (property_exists($repoCont, 'errors')) { + return false; + } + + $tbk = array( + 'testcase_script_links' + ); + $tbl = tlObjectWithDB::getDBTables($tbk); + + // check if entry already exists in DB + $sql = " SELECT * FROM `{$tbl['testcase_script_links']}` " . + " WHERE `tcversion_id` = " . intval($tcversion_id) . + " AND `project_key` = '{$project_key}' " . + " AND `repository_name` = '{$repo_name}' " . + " AND `code_path` = '{$code_path}'"; + + $rs = $dbHandler->get_recordset($sql); + if (is_null($rs)) { + $fields = "(`tcversion_id`,`project_key`,`repository_name`,`code_path`"; + $values = "(" . intval($tcversion_id) . ",'{$project_key}'," . + "'{$repo_name}','{$code_path}'"; + if (! is_null($branch_name)) { + $fields .= ",`branch_name`"; + $values .= ",'{$branch_name}'"; + } + if (! is_null($commit_id)) { + $fields .= ",`commit_id`"; + $values .= ",'{$commit_id}'"; + } + $fields .= ")"; + $values .= ")"; + + // no entry found, i.e. add new values to DB + $sql = " INSERT INTO `{$tbl['testcase_script_links']}` {$fields} " . + " VALUES {$values}"; + + $result = $dbHandler->exec_query($sql); + } + + return $result; +} + +function writeCfieldTestscript(&$dbHandler, &$user, $field_id, $node_id, $value) +{ + $tbk = array( + 'cfield_design_values', + 'tcversions', + 'executions' + ); + $tbl = tlObjectWithDB::getDBTables($tbk); + + $result = false; + // check if tcversion can be edited + $sql = " SELECT id, active, is_open, baseline, reviewer_id " . + " FROM `{$tbl['tcversions']}` " . " WHERE `id` = '{$node_id}'"; + + $rs = $dbHandler->get_recordset($sql); + + if (! is_null($rs)) { + $rs = $rs[0]; + /* + * only update custom field value if test case can be + * modified, i.e. has no baseline, is not status "Accepted" + * and is active and open + */ + if ($rs['active'] == 1 && $rs['is_open'] == 1 && + is_null($rs['baseline']) && is_null($rs['reviewer_id'])) { + $sql = " SELECT id FROM `{$tbl['executions']}` " . + " WHERE `tcversion_id` = '{$node_id}'"; + + $rsExec = $dbHandler->get_recordset($sql); + + /* + * only update if test case was not executed yet or + * corresponding modification right is given + */ + if (is_null($rsExec) || + $user->hasRight($dbHandler, + "testproject_edit_executed_testcases")) { + // check if entry already exists in DB + $sql = " UPDATE `{$tbl['cfield_design_values']}` " . + " SET `value` = '{$value}' " . + " WHERE `field_id` = '{$field_id}' " . + " AND `node_id` = '{$node_id}'"; + + $result = $dbHandler->exec_query($sql); + } + } + } + + return $result; +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "mgt_modify_tc"); } diff --git a/lib/testcases/scriptDelete.php b/lib/testcases/scriptDelete.php index f54020ebad..9be6acacaa 100755 --- a/lib/testcases/scriptDelete.php +++ b/lib/testcases/scriptDelete.php @@ -1,167 +1,170 @@ -project_key != "" && $args->repository_name != "" && $args->code_path != "") -{ - $l18n = init_labels(array("error_code_does_not_exist_on_cts" => null)); - - $gui->msg = ""; - $scriptDeleted = del_testcase_script($db,$args->tcversion_id, $args->project_key, - $args->repository_name, $args->code_path); - $auditMsg = "audit_testcasescript_deleted"; - $item_id = $args->tcversion_id; - $objectType = "testcase_script_links"; - $args->direct_link = $cts->buildViewCodeURL($args->project_key,$args->repository_name,$args->code_path,$args->branch_name); - if ($scriptDeleted) - { - $gui->msg = lang_get("scriptdeleting_was_ok"); - logAuditEvent(TLS($auditMsg,$args->script_id),"DELETE",$item_id,$objectType); - } - else - { - $gui->msg = sprintf($l18n["error_code_does_not_exist_on_cts"],$args->direct_link); - } -} -else -{ - $gui->msg = lang_get("error_script_not_deleted"); -} -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function initEnv(&$dbHandler) -{ - $iParams = array("script_id" => array("REQUEST",tlInputParameter::STRING_N), - "tproject_id" => array("REQUEST",tlInputParameter::INT_N), - "tcversion_id" => array("REQUEST",tlInputParameter::INT_N), - "project_key" => null, - "repository_name" => null, - "code_path" => null); - - $args = new stdClass(); - I_PARAMS($iParams,$args); - - $args->user = $_SESSION['currentUser']; - - $args->script_id = trim($args->script_id); - - $scriptArray = explode("&&", $args->script_id); - if(count($scriptArray) > 0) - { - $args->project_key = $scriptArray[0]; - $args->repository_name = $scriptArray[1]; - $args->code_path = $scriptArray[2]; - } - - if (is_null($args->tproject_id)) - { - $args->tproject_id = $_SESSION['testprojectID']; - } - $gui = new stdClass(); - $gui->pageTitle = lang_get('title_delete_script'); - - $gui->msg = ''; - $gui->tcversion_id = $args->tcversion_id; - - $gui->project_key = $args->project_key; - $gui->repository_name = $args->repository_name; - $gui->code_path = $args->code_path; - - // ----------------------------------------------------------------------- - // Special processing - list($ctObj,$ctCfg) = getCodeTracker($dbHandler,$args,$gui); - - $args->basehref = $_SESSION['basehref']; - - return array($args,$gui,$ctObj,$ctCfg); -} - - -/** - * - */ -function getCodeTracker(&$dbHandler,$argsObj,&$guiObj) -{ - $cts = null; - $tprojectMgr = new testproject($dbHandler); - $info = $tprojectMgr->get_by_id($argsObj->tproject_id); - - $guiObj->codeTrackerCfg = new stdClass(); - $guiObj->codeTrackerCfg->createCodeURL = null; - $guiObj->codeTrackerCfg->VerboseID = ''; - $guiObj->codeTrackerCfg->VerboseType = ''; - - if($info['code_tracker_enabled']) - { - $ct_mgr = new tlCodeTracker($dbHandler); - $codeTrackerCfg = $ct_mgr->getLinkedTo($argsObj->tproject_id); - - if( !is_null($codeTrackerCfg) ) - { - $cts = $ct_mgr->getInterfaceObject($argsObj->tproject_id); - $guiObj->codeTrackerCfg->VerboseType = $codeTrackerCfg['verboseType']; - $guiObj->codeTrackerCfg->VerboseID = $codeTrackerCfg['codetracker_name']; - $guiObj->codeTrackerCfg->createCodeURL = $cts->getEnterCodeURL(); - } - } - return array($cts,$codeTrackerCfg); -} - -/** - * - */ -function del_testcase_script(&$dbHandler, $tcversion_id, $project_key, - $repo_name, $code_path) -{ - $fields = "(`tcversion_id`,`project_key`,`repository_name`,`code_path`"; - $values = "(".intval($tcversion_id).",'{$project_key}'," . - "'{$repo_name}','{$code_path}'"; - $fields .= ")"; - $values .= ")"; - - $tbk = array('testcase_script_links'); - $tbl = tlObjectWithDB::getDBTables($tbk); - $sql = " DELETE FROM `{$tbl['testcase_script_links']}` " . - " WHERE `tcversion_id` = " . intval($tcversion_id) . - " AND `project_key` = '{$project_key}' " . - " AND `repository_name` = '{$repo_name}' " . - " AND `code_path` = '{$code_path}' "; - - $result = $dbHandler->exec_query($sql); - - return $result; -} - -/** - * Checks the user rights for viewing the page - * - * @param $db resource the database connection handle - * @param $user tlUser the object of the current user - * - * @return boolean return true if the page can be viewed, false if not - */ -function checkRights(&$db,&$user) -{ - $hasRights = $user->hasRight($db,"mgt_modify_tc"); - return $hasRights; +project_key != "" && $args->repository_name != "" && + $args->code_path != "") { + $l18n = init_labels(array( + "error_code_does_not_exist_on_cts" => null + )); + + $gui->msg = ""; + $scriptDeleted = delTestcaseScript($db, $args->tcversion_id, + $args->project_key, $args->repository_name, $args->code_path); + $auditMsg = "audit_testcasescript_deleted"; + $item_id = $args->tcversion_id; + $objectType = "testcase_script_links"; + $args->direct_link = $cts->buildViewCodeURL($args->project_key, + $args->repository_name, $args->code_path, $args->branch_name); + if ($scriptDeleted) { + $gui->msg = lang_get("scriptdeleting_was_ok"); + logAuditEvent(TLS($auditMsg, $args->script_id), "DELETE", $item_id, + $objectType); + } else { + $gui->msg = sprintf($l18n["error_code_does_not_exist_on_cts"], + $args->direct_link); + } +} else { + $gui->msg = lang_get("error_script_not_deleted"); +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + */ +function initEnv(&$dbHandler) +{ + $iParams = array( + "script_id" => array( + "REQUEST", + tlInputParameter::STRING_N + ), + "tproject_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "tcversion_id" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "project_key" => null, + "repository_name" => null, + "code_path" => null + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + + $args->user = $_SESSION['currentUser']; + + $args->script_id = trim($args->script_id); + + $scriptArray = explode("&&", $args->script_id); + if (! empty($scriptArray)) { + $args->project_key = $scriptArray[0]; + $args->repository_name = $scriptArray[1]; + $args->code_path = $scriptArray[2]; + } + + if (is_null($args->tproject_id)) { + $args->tproject_id = $_SESSION['testprojectID']; + } + $gui = new stdClass(); + $gui->pageTitle = lang_get('title_delete_script'); + + $gui->msg = ''; + $gui->tcversion_id = $args->tcversion_id; + + $gui->project_key = $args->project_key; + $gui->repository_name = $args->repository_name; + $gui->code_path = $args->code_path; + + // Special processing + list ($ctObj, $ctCfg) = getCodeTracker($dbHandler, $args, $gui); + + $args->basehref = $_SESSION['basehref']; + + return array( + $args, + $gui, + $ctObj, + $ctCfg + ); +} + +/** + */ +function getCodeTracker(&$dbHandler, $argsObj, &$guiObj) +{ + $cts = null; + $tprojectMgr = new testproject($dbHandler); + $info = $tprojectMgr->get_by_id($argsObj->tproject_id); + + $guiObj->codeTrackerCfg = new stdClass(); + $guiObj->codeTrackerCfg->createCodeURL = null; + $guiObj->codeTrackerCfg->VerboseID = ''; + $guiObj->codeTrackerCfg->VerboseType = ''; + + if ($info['code_tracker_enabled']) { + $ct_mgr = new tlCodeTracker($dbHandler); + $codeTrackerCfg = $ct_mgr->getLinkedTo($argsObj->tproject_id); + + if (! is_null($codeTrackerCfg)) { + $cts = $ct_mgr->getInterfaceObject($argsObj->tproject_id); + $guiObj->codeTrackerCfg->VerboseType = $codeTrackerCfg['verboseType']; + $guiObj->codeTrackerCfg->VerboseID = $codeTrackerCfg['codetracker_name']; + $guiObj->codeTrackerCfg->createCodeURL = $cts->getEnterCodeURL(); + } + } + return array( + $cts, + $codeTrackerCfg + ); +} + +/** + */ +function delTestcaseScript(&$dbHandler, $tcversion_id, $project_key, $repo_name, + $code_path) +{ + $tbk = array( + 'testcase_script_links' + ); + $tbl = tlObjectWithDB::getDBTables($tbk); + $sql = " DELETE FROM `{$tbl['testcase_script_links']}` " . + " WHERE `tcversion_id` = " . intval($tcversion_id) . + " AND `project_key` = '{$project_key}' " . + " AND `repository_name` = '{$repo_name}' " . + " AND `code_path` = '{$code_path}' "; + + return $dbHandler->exec_query($sql); +} + +/** + * Checks the user rights for viewing the page + * + * @param $db resource + * the database connection handle + * @param $user tlUser + * the object of the current user + * + * @return boolean return true if the page can be viewed, false if not + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "mgt_modify_tc"); } diff --git a/lib/testcases/tcAssign2Tplan.php b/lib/testcases/tcAssign2Tplan.php index acfd3e664f..468da66872 100644 --- a/lib/testcases/tcAssign2Tplan.php +++ b/lib/testcases/tcAssign2Tplan.php @@ -1,211 +1,201 @@ -glue_character; -$args = init_args(); -$gui = initializeGui($args); -$getOpt = array('outputFormat' => 'map', 'addIfNull' => true); -$gui->platformSet = $tplan_mgr->getPlatforms($args->tplan_id,$getOpt); - -$options['output'] = 'essential'; -$tcase_all_info = $tcase_mgr->get_by_id($args->tcase_id,testcase::ALL_VERSIONS,null,$options); - -if( !is_null($tcase_all_info) ) -{ - foreach($tcase_all_info as $tcversion_info) - { - if($tcversion_info['id'] == $args->tcversion_id ) - { - $version = $tcversion_info['version']; - $gui->pageTitle=lang_get('test_case') . ':' . $tcversion_info['name']; - $gui->tcaseIdentity = $tproject_mgr->getTestCasePrefix($args->tproject_id); - $gui->tcaseIdentity .= $glue . $tcversion_info['tc_external_id'] . ':' . $tcversion_info['name']; - break; - } - } +glue_character; +$args = initArgs(); +$gui = initializeGui($args); +$getOpt = array( + 'outputFormat' => 'map', + 'addIfNull' => true +); +$gui->platformSet = $tplan_mgr->getPlatforms($args->tplan_id, $getOpt); + +$options['output'] = 'essential'; +$tcase_all_info = $tcaseMgr->get_by_id($args->tcase_id, testcase::ALL_VERSIONS, + null, $options); + +if (! is_null($tcase_all_info)) { + foreach ($tcase_all_info as $tcversion_info) { + if ($tcversion_info['id'] == $args->tcversion_id) { + $version = $tcversion_info['version']; + $gui->pageTitle = lang_get('test_case') . ':' . + $tcversion_info['name']; + $gui->tcaseIdentity = $tproject_mgr->getTestCasePrefix( + $args->tproject_id); + $gui->tcaseIdentity .= $glue . $tcversion_info['tc_external_id'] . + ':' . $tcversion_info['name']; + break; + } + } +} + +$link_info = $tcaseMgr->get_linked_versions($args->tcase_id); +if (! is_null( + $tplanSet = $tproject_mgr->get_all_testplans($args->tproject_id, + array( + 'plan_status' => 1 + )))) { + $has_links = array_fill_keys(array_keys($tplanSet), false); + $linked_tplans = null; + if (! is_null($link_info)) { + foreach ($link_info as $info) { + foreach ($info as $tplan_id => $platform_info) { + $has_links[$tplan_id] = true; + foreach ($platform_info as $platform_id => $value) { + $linked_tplans[$tplan_id][$platform_id]['tcversion_id'] = $value['tcversion_id']; + $linked_tplans[$tplan_id][$platform_id]['version'] = $value['version']; + $linked_tplans[$tplan_id][$platform_id]['draw_checkbox'] = false; + } + } + } + } + + // Initial situation, enable link of target test case version to all test plans + $getOpt = array( + 'outputFormat' => 'map', + 'addIfNull' => true + ); + foreach ($tplanSet as $tplan_id => $value) { + $gui->tplans[$tplan_id] = array(); + $platformSet = $tplan_mgr->getPlatforms($tplan_id, $getOpt); + + $target_version_number = $version; + $target_version_id = $args->tcversion_id; + $linked_platforms = null; + + // if a version of this Test Case has been linked to test plan, get it. + if ($has_links[$tplan_id]) { + $linked_platforms = array_flip( + array_keys($linked_tplans[$tplan_id])); + $dummy = current($linked_tplans[$tplan_id]); + $target_version_number = $dummy['version']; + $target_version_id = $dummy['tcversion_id']; + } + + // do logic on test plan linked platforms to understand what to display + // For situation like + // Test Plan TPX - Platforms: P1,P2,P3 + // Test Case A - version 1 -> Test Plan TPX - Platform P1 + // + // Create Test Case A - version 2 + // + // Add to test plan on version 2 + // We CAN NOT DISPLAY Platforms P2 and P3, because P1 has been linked to version 1 + // and we DO NOT ALLOW different test case versions to be linked to ONE TEST PLAN. + // Then we need to display only + // [x](read only) version 1 - test plan TPX - platform P1 + // + // But if we go to version 1 and choose add to test plan, will display: + // [x](read only) version 1 - test plan TPX - platform P1 + // [ ] version 1 - test plan TPX - platform P2 + // [ ] version 1 - test plan TPX - platform P3 + // + // Then we can add version 1 to other platform + // Following logic try to implement this. + // + foreach ($platformSet as $platform_id => $platform_info) { + $doAdd = true; + $draw_checkbox = true; + if ($has_links[$tplan_id]) { + if (isset($linked_platforms[$platform_id])) { + $draw_checkbox = false; + } elseif ($target_version_number == $version) { + $draw_checkbox = true; + } else { + $doAdd = false; + } + } + if ($doAdd) { + $gui->tplans[$tplan_id][$platform_id] = $value; + $gui->tplans[$tplan_id][$platform_id]['tcversion_id'] = $target_version_id; + $gui->tplans[$tplan_id][$platform_id]['version'] = $target_version_number; + $gui->tplans[$tplan_id][$platform_id]['draw_checkbox'] = $draw_checkbox; + $gui->tplans[$tplan_id][$platform_id]['platform'] = $platform_info; + } + } + } + + // Check if submit button can be displayed. + // Condition there is at least one test plan where no version of + // target test cases has been linked. + $gui->can_do = false; // because an OR logic will be used + foreach ($gui->tplans as $tplan_id => $platform_info) { + foreach ($platform_info as $platform_id => $value) { + $gui->can_do = $gui->can_do || + $gui->tplans[$tplan_id][$platform_id]['draw_checkbox']; + } + } +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * init_args + * creates a sort of namespace + * + * @return stdClass object with some REQUEST and SESSION values as members. + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + // if any piece of context is missing => we will display nothing instead of crashing WORK TO BE DONE + $args = new stdClass(); + $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']; + $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']; + + $args->tproject_id = intval($args->tproject_id); + $args->tplan_id = intval($args->tplan_id); + + $args->tcase_id = isset($_REQUEST['tcase_id']) ? $_REQUEST['tcase_id'] : 0; + $args->tcase_id = intval($args->tcase_id); + + $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? $_REQUEST['tcversion_id'] : 0; + $args->tcversion_id = intval($args->tcversion_id); + + return $args; +} + +/** + * + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui($argsObj) +{ + $guiObj = new stdClass(); + $guiObj->pageTitle = ''; + $guiObj->tcaseIdentity = ''; + $guiObj->mainDescription = lang_get('add_tcversion_to_plans'); + $guiObj->tcase_id = $argsObj->tcase_id; + $guiObj->tcversion_id = $argsObj->tcversion_id; + $guiObj->can_do = false; + $guiObj->item_sep = config_get('gui')->title_separator_2; + $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . + "lib/testcases/archiveData.php?" . 'edit=testcase&id=' . + intval($argsObj->tcase_id) . "'"; + return $guiObj; } - -$link_info = $tcase_mgr->get_linked_versions($args->tcase_id); -if( !is_null($tplanSet = $tproject_mgr->get_all_testplans($args->tproject_id,array('plan_status' => 1))) ) -{ - $has_links = array_fill_keys(array_keys($tplanSet),false); - $linked_tplans = null; - if( !is_null($link_info) ) - { - foreach($link_info as $tcversion_id => $info) - { - foreach($info as $tplan_id => $platform_info) - { - $has_links[$tplan_id] = true; - foreach($platform_info as $platform_id => $value) - { - $linked_tplans[$tplan_id][$platform_id]['tcversion_id']=$value['tcversion_id']; - $linked_tplans[$tplan_id][$platform_id]['version']=$value['version']; - $linked_tplans[$tplan_id][$platform_id]['draw_checkbox'] = false; - } - } - } - } - - // Initial situation, enable link of target test case version to all test plans - $getOpt = array('outputFormat' => 'map', 'addIfNull' => true); - foreach($tplanSet as $tplan_id => $value) - { - $gui->tplans[$tplan_id] = array(); - $platformSet = $tplan_mgr->getPlatforms($tplan_id,$getOpt); - - // $target_version_number = 0; - // $target_version_id = 0; - $target_version_number = $version; - $target_version_id = $args->tcversion_id; - $linked_platforms = null; - - // if a version of this Test Case has been linked to test plan, get it. - if( $has_links[$tplan_id] ) - { - $linked_platforms = array_flip(array_keys($linked_tplans[$tplan_id])); - $dummy = current($linked_tplans[$tplan_id]); - $target_version_number = $dummy['version']; - $target_version_id = $dummy['tcversion_id']; - } - - // do logic on test plan linked platforms to understand what to display - // For situation like - // Test Plan TPX - Platforms: P1,P2,P3 - // Test Case A - version 1 -> Test Plan TPX - Platform P1 - // - // Create Test Case A - version 2 - // - // Add to test plan on version 2 - // We CAN NOT DISPLAY Platforms P2 and P3, because P1 has been linked to version 1 - // and we DO NOT ALLOW different test case versions to be linked to ONE TEST PLAN. - // Then we need to display only - // [x](read only) version 1 - test plan TPX - platform P1 - // - // But if we go to version 1 and choose add to test plan, will display: - // [x](read only) version 1 - test plan TPX - platform P1 - // [ ] version 1 - test plan TPX - platform P2 - // [ ] version 1 - test plan TPX - platform P3 - // - // Then we can add version 1 to other platform - // Following logic try to implement this. - // - foreach($platformSet as $platform_id => $platform_info) - { - $doAdd = true; - $draw_checkbox = true; - if( $has_links[$tplan_id] ) - { - if( isset($linked_platforms[$platform_id]) ) - { - $draw_checkbox = false; - } - else if($target_version_number == $version) - { - $draw_checkbox = true; - } - else - { - $doAdd = false; - } - } - if( $doAdd ) - { - $gui->tplans[$tplan_id][$platform_id] = $value; - $gui->tplans[$tplan_id][$platform_id]['tcversion_id'] = $target_version_id; - $gui->tplans[$tplan_id][$platform_id]['version'] = $target_version_number; - $gui->tplans[$tplan_id][$platform_id]['draw_checkbox'] = $draw_checkbox; - $gui->tplans[$tplan_id][$platform_id]['platform'] = $platform_info; - } - - } - } - - // Check if submit button can be displayed. - // Condition there is at least one test plan where no version of - // target test cases has been linked. - $gui->can_do=false; // because an OR logic will be used - foreach($gui->tplans as $tplan_id => $platform_info) - { - foreach($platform_info as $platform_id => $value) - { - $gui->can_do = $gui->can_do || $gui->tplans[$tplan_id][$platform_id]['draw_checkbox']; - } - - } -} -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * init_args - * creates a sort of namespace - * - * @return object with some REQUEST and SESSION values as members. - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - // if any piece of context is missing => we will display nothing instead of crashing WORK TO BE DONE - $args = new stdClass(); - $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']; - $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']; - - $args->tproject_id = intval($args->tproject_id); - $args->tplan_id = intval($args->tplan_id); - - - $args->tcase_id = isset($_REQUEST['tcase_id']) ? $_REQUEST['tcase_id'] : 0; - $args->tcase_id = intval($args->tcase_id); - - $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? $_REQUEST['tcversion_id'] : 0; - $args->tcversion_id = intval($args->tcversion_id); - - return $args; -} - - -/** - * - * - */ -function initializeGui($argsObj) -{ - $guiObj = new stdClass(); - $guiObj->pageTitle=''; - $guiObj->tcaseIdentity=''; - $guiObj->mainDescription=lang_get('add_tcversion_to_plans');; - $guiObj->tcase_id=$argsObj->tcase_id; - $guiObj->tcversion_id=$argsObj->tcversion_id; - $guiObj->can_do=false; - $guiObj->item_sep=config_get('gui')->title_separator_2; - $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . "lib/testcases/archiveData.php?" . - 'edit=testcase&id=' . intval($argsObj->tcase_id) . "'"; - return $guiObj; -} \ No newline at end of file diff --git a/lib/testcases/tcAssignedToUser.php b/lib/testcases/tcAssignedToUser.php index 9016a71e39..67acb5a0da 100644 --- a/lib/testcases/tcAssignedToUser.php +++ b/lib/testcases/tcAssignedToUser.php @@ -1,509 +1,573 @@ -getImages(); - -$args = init_args($db); -$gui = initializeGui($db,$args); -$statusGui = getStatusGuiCfg(); - - -// Get all test cases assigned to user without filtering by execution status -$opt = array('mode' => 'full_path'); -$filters = initFilters($args); -$tplan_param = ($args->tplan_id) ? array($args->tplan_id) : testcase::ALL_TESTPLANS; - -$tcase_mgr = new testcase($db); -$gui->resultSet = $tcase_mgr->get_assigned_to_user($args->user_id, $args->tproject_id, - $tplan_param, $opt, $filters); - -$doIt = !is_null($gui->resultSet); - -// will work only on standard exec status -$exec = getQuickExecCfg($gui,$imgSet,$statusGui->status_code); - -$tables = tlObjectWithDB::getDBTables(array('nodes_hierarchy','executions','tcversions')); - -if($args->result != '' && $args->tcvx > 0) -{ - - // get version number - $sql = " SELECT TCV.version FROM {$tables['tcversions']} TCV WHERE TCV.id = " . $args->tcvx; - $xx = $db->get_recordset($sql); - $version_number = $xx[0]['version']; - - $sql = " INSERT INTO {$tables['executions']} ". - " (status,tester_id,execution_ts,tcversion_id,tcversion_number,testplan_id,platform_id,build_id)". - " VALUES ('{$args->result}', {$args->executedBy}, " . $db->db_now() . "," . - " {$args->tcvx}, {$version_number}, {$args->tpx}, {$args->pxi},{$args->bxi})"; - - $db->exec_query($sql); -} - - -if( $doIt ) -{ - $execCfg = config_get('exec_cfg'); - - $tables = tlObjectWithDB::getDBTables(array('nodes_hierarchy')); - $tplanSet=array_keys($gui->resultSet); - $sql="SELECT name,id FROM {$tables['nodes_hierarchy']} " . - "WHERE id IN (" . implode(',',$tplanSet) . ")"; - $gui->tplanNames=$db->fetchRowsIntoMap($sql,'id'); - $optColumns = array('user' => $args->show_user_column, 'priority' => $args->priority_enabled); - - $whoiam = $args->show_all_users ? 'tcAssignedToUser': 'tcAssignedToMe'; - - foreach ($gui->resultSet as $tplan_id => $tcase_set) { - list($columns,$sortByColumn,$show_platforms) = getColumnsDefinition($db,$tplan_id,$optColumns); - - $rows = array(); - - // has logged user right to execute test cases on this (test project,test plan)? - $hasExecRight = $_SESSION['currentUser']->hasRight($db,'testplan_execute', - $args->tproject_id,$tplan_id,true); - - foreach ($tcase_set as $tcase_platform) { - foreach ($tcase_platform as $tcase) { - $current_row = array(); - $tcase_id = $tcase['testcase_id']; - $tcversion_id = $tcase['tcversion_id']; - - if ($args->show_user_column) - { - if($tcase['user_id'] > 0 && isset($args->userSet[$tcase['user_id']])) - { - $current_row[] = htmlspecialchars($args->userSet[$tcase['user_id']]['login']); - } - else - { - $current_row[] = ''; - } - } - - $current_row[] = htmlspecialchars($tcase['build_name']); - $current_row[] = htmlspecialchars($tcase['tcase_full_path']); - - // create linked icons - $ekk = $elk = $exec_link = ''; - $canExec = ($hasExecRight == 'yes'); - - if($execCfg->exec_mode->tester == 'assigned_to_me') { - $canExec = $canExec && ($tcase['user_id'] == $_SESSION['userID']); - } - - if($canExec) { - $ekk = sprintf($exec['common'],$tplan_id,$tcase['platform_id'],$tplan_id,$tcase['build_id'], - $tplan_id,$tcversion_id,$tplan_id); - - $elk = sprintf($exec['passed'],$tplan_id) . $ekk . ' ' . sprintf($exec['failed'],$tplan_id ) . $ekk . ' ' . - sprintf($exec['blocked'],$tplan_id) . $ekk; - - $exec_link = "" . - "l18n['execution']}\" src=\"{$imgSet['exec_icon']}\" /> "; - } - - $exec_history_link = "" . - "l18n['execution_history']}\" src=\"{$imgSet['history_small']}\" /> "; - - - $edit_link = "" . - "l18n['design']}\" src=\"{$imgSet['edit_icon']}\" /> "; - - $current_row[] = "" . $elk . $exec_history_link . - $exec_link . $edit_link . htmlspecialchars($tcase['prefix']) . $gui->glueChar . - $tcase['tc_external_id'] . " : " . htmlspecialchars($tcase['name']) . - sprintf($gui->l18n['tcversion_indicator'],$tcase['version']); - - if ($show_platforms) - { - $current_row[] = htmlspecialchars($tcase['platform_name']); - } - - if ($args->priority_enabled) - { - $current_row[] = "" . $gui->priority[priority_to_level($tcase['priority'])]; - } - - $leOptions = array('getSteps' => 0); - $lexec = $tcase_mgr->get_last_execution($tcase_id, $tcversion_id, $tplan_id, - $tcase['build_id'],$tcase['platform_id'], - $leOptions); - $status = $lexec[$tcversion_id]['status']; - if (!$status) - { - $status = $statusGui->status_code['not_run']; - } - $current_row[] = $statusGui->definition[$status]; - - if ($args->show_user_column) - { - $current_row[] = htmlspecialchars($lexec[$tcversion_id]['tester_login']); - } - - - - // need to check if we are using the right timestamp - $current_row[] = htmlspecialchars($tcase['creation_ts']) . - " (" . get_date_diff($tcase['creation_ts']) . ")"; - - $rows[] = $current_row; - } - } - - /* different table id for different reports: - * - Assignment Overview if $args->show_all_users is set - * - Test Cases assigned to user if $args->build_id > 0 - * - Test Cases assigned to me else - */ - $table_id = "tl_table_tc_assigned_to_me_for_tplan_"; - if($args->show_all_users) { - $table_id = "tl_table_tc_assignment_overview_for_tplan_"; - } - if($args->build_id) { - $table_id = "tl_table_tc_assigned_to_user_for_tplan_"; - } - - // add test plan id to table id - $table_id .= $tplan_id; - - $matrix = new tlExtTable($columns, $rows, $table_id); - $matrix->title = $gui->l18n['testplan'] . ": " . htmlspecialchars($gui->tplanNames[$tplan_id]['name']); - - // default grouping by first column, which is user for overview, build otherwise - $matrix->setGroupByColumnName(lang_get($columns[0]['title_key'])); - - // make table collapsible if more than 1 table is shown and surround by frame - if (count($tplanSet) > 1) { - $matrix->collapsible = true; - $matrix->frame = true; - } - - // define toolbar - $matrix->showToolbar = true; - $matrix->toolbarExpandCollapseGroupsButton = true; - $matrix->toolbarShowAllColumnsButton = true; - - $matrix->setSortByColumnName($sortByColumn); - $matrix->sortDirection = 'DESC'; - $gui->tableSet[$tplan_id] = $matrix; - } -} - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * Replacement for the smarty helper function to get that functionality outside of templates. - * Returns difference between a given date and the current time in days. - * @author Andreas Simon - * @param $date - */ -function get_date_diff($date) -{ - $date = (is_string($date)) ? strtotime($date) : $date; - $i = 1/60/60/24; - return floor((time() - $date) * $i); -} - - -/** - * init_args() - * Get in an object all data that has arrived to page through _REQUEST or _SESSION. - * If you think this page as a function, you can consider this data arguments (args) - * to a function call. - * Using all this data as one object property will help developer to understand - * if data is received or produced on page. - * - * @author franciscom - francisco.mancardi@gmail.com - * @args - used global coupling accessing $_REQUEST and $_SESSION - * - * @return object of stdClass - * - * @internal revisions - */ -function init_args(&$dbHandler) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - - $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; - if( $args->tproject_id == 0) - { - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - } - if( $args->tproject_id == 0) - { - throw new Exception(__FILE__ . ' Can not work without Test project ID => Aborting'); - } - $mgr = new testproject($dbHandler); - $info = $mgr->get_by_id($args->tproject_id); - $args->tproject_name = $info['name']; - $args->testprojectOptions = $info['opt']; - unset($info); - - $args->user_id = isset($_REQUEST['user_id']) ? intval($_REQUEST['user_id']) : 0; - - if( $args->user_id != 0) - { - $args->user = new tlUser($args->user_id); - $args->user->readFromDB($dbHandler); - } - else - { - $args->user_id = isset($_SESSION['userID']) ? intval($_SESSION['userID']) : 0; - if( $args->user_id == 0) - { - throw new Exception(__FILE__ . ' Can not work without User ID => Aborting'); - } - $args->user = $_SESSION['currentUser']; - } - - - $args->executedBy = $args->user_id; - $args->user_name = $args->user->login; - $args->userSet = $args->user->getNames($dbHandler); - - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - $args->build_id = isset($_REQUEST['build_id']) && is_numeric($_REQUEST['build_id']) ? intval($_REQUEST['build_id']) : 0; - - $args->show_inactive_tplans = isset($_REQUEST['show_inactive_tplans']) ? true : false; - - $args->show_all_users = false; - if(isset($_REQUEST['show_all_users'])) - { - $args->show_all_users = (intval($_REQUEST['show_all_users']) == 1); - } - $args->show_user_column = $args->show_all_users; - - - $show_closed_builds = isset($_REQUEST['show_closed_builds']) ? true : false; - $show_closed_builds_hidden = isset($_REQUEST['show_closed_builds_hidden']) ? true : false; - if ($show_closed_builds) - { - $selection = true; - } - else if ($show_closed_builds_hidden) - { - $selection = false; - } - else if (isset($_SESSION['show_closed_builds'])) - { - $selection = intval($_SESSION['show_closed_builds']); - } - else - { - $selection = false; - } - $args->show_closed_builds = $_SESSION['show_closed_builds'] = $selection; - - if ($args->show_all_users) - { - $args->user_id = TL_USER_ANYBODY; - } - - $args->show_inactive_and_closed = false; - if( isset($_REQUEST['show_inactive_and_closed']) ) - { - $args->show_inactive_and_closed = (intval($_REQUEST['show_inactive_and_closed']) != 0); - } - - $args->priority_enabled = $_SESSION['testprojectOptions']->testPriorityEnabled ? true : false; - - - // quick & dirty execution - $args->tpx = isset($_REQUEST['tpx']) ? intval($_REQUEST['tpx']) : 0; - $dirtyHarry = array('pxi','bxi','tcvx'); - foreach($dirtyHarry as $tg) - { - $key = $tg . '_' . $args->tpx; - $args->$tg = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; - } - $args->result = isset($_REQUEST['result_' . $args->tpx]) ? $_REQUEST['result_' . $args->tpx][0] : ''; - - return $args; -} - - -/** - * get Columns definition for table to display - * - */ -function getColumnsDefinition($dbHandler,$tplan_id,$optionalColumns) -{ - static $labels; - static $tplan_mgr; - if( is_null($labels) ) - { - $tplan_mgr = new testplan($dbHandler); - - $lbl2get = array('build' => null,'testsuite' => null,'testcase' => null,'platform' => null, - 'user' => null, 'priority' => null,'status' => null, 'version' => null, - 'low_priority' => null,'medium_priority' => null,'high_priority' => null, - 'due_since' => null); - $labels = init_labels($lbl2get); - } - - $colDef = array(); - $sortByCol = $labels['testsuite']; - - // user column is only shown for assignment overview - if ($optionalColumns['user']) - { - $colDef[] = array('title_key' => 'user', 'width' => 80); - $sortByCol = $labels['build']; - } - - $colDef[] = array('title_key' => 'build', 'width' => 80); - $colDef[] = array('title_key' => 'testsuite', 'width' => 130); - $colDef[] = array('title_key' => 'testcase', 'width' => 130); - - $platforms = $tplan_mgr->getPlatforms($tplan_id,array('outputFormat' => 'map')); - if( ($show_plat = !is_null($platforms)) ) - { - $colDef[] = array('title_key' => 'platform', 'width' => 50, 'filter' => 'list', 'filterOptions' => $platforms); - } - - if ($optionalColumns['priority']) - { - $sortByCol = $labels['priority']; - $colDef[] = array('title_key' => 'priority', 'width' => 50, 'filter' => 'ListSimpleMatch', - 'filterOptions' => array($labels['low_priority'],$labels['medium_priority'],$labels['high_priority'])); - } - - $colDef[] = array('title_key' => 'status', 'width' => 50, 'type' => 'status'); - if($optionalColumns['user']) - { - $colDef[] = array('title_key' => 'tester', 'width' => 80); - } - - - $colDef[] = array('title_key' => 'due_since', 'width' => 100); - - return array($colDef, $sortByCol, $show_plat); -} - - -function initializeGui(&$dbHandler,$argsObj) -{ - $gui = new stdClass(); - $gui->tproject_name = $argsObj->tproject_name; - - // disable "show also closed builds" checkbox when a specific build is selected - $gui->show_build_selector = ($argsObj->build_id == 0); - $gui->show_closed_builds = $argsObj->show_closed_builds; - - $gui->glueChar = config_get('testcase_cfg')->glue_character; - $gui->warning_msg = ''; - $gui->tableSet = null; - $gui->l18n = init_labels(array('tcversion_indicator' => null,'goto_testspec' => null, 'version' => null, - 'testplan' => null, 'assigned_tc_overview' => null, - 'testcases_assigned_to_user' => null, - 'quick_passed' => null, 'quick_failed' => null,'quick_blocked' => null, - 'low_priority' => null,'medium_priority' => null,'high_priority' => null, - 'design' => null, 'execution' => null, 'execution_history' => null)); - - $gui->priority = array(LOW => $gui->l18n['low_priority'],MEDIUM => $gui->l18n['medium_priority'], - HIGH => $gui->l18n['high_priority']); - - if ($argsObj->show_all_users) - { - $gui->pageTitle=sprintf($gui->l18n['assigned_tc_overview'], $gui->tproject_name); - } - else - { - $gui->pageTitle=sprintf($gui->l18n['testcases_assigned_to_user'],$gui->tproject_name, $argsObj->user_name); - } - - $gui->user_id = $argsObj->user_id; - $gui->tplan_id = $argsObj->tplan_id; - - $gui->directLink = $_SESSION['basehref'] . - 'ltx.php?item=xta2m&user_id=' . $gui->user_id . - '&tplan_id=' . $gui->tplan_id; - - return $gui; -} - - -function initFilters($argsObj) -{ - $filters = array(); - - $filters['tplan_status'] = $argsObj->show_inactive_tplans ? 'all' : 'active'; - $filters['build_status'] = $argsObj->show_closed_builds ? 'all' : 'open'; - - if ($argsObj->build_id) - { - $filters['build_id'] = $argsObj->build_id; - - // show assignments regardless of build and tplan status - $filters['build_status'] = 'all'; - $filters['tplan_status'] = 'all'; - } - return $filters; -} - -function getStatusGuiCfg() -{ - $cfg = config_get('results'); - - $ret = new stdClass(); - $ret->status_code = $cfg['status_code']; - $ret->code_css = array(); - $ret->definition = array(); - - foreach($cfg['code_status'] as $code => $status) - { - if (isset($cfg['status_label'][$status])) - { - $label = $cfg['status_label'][$status]; - $ret->code_css[$code] = array(); - $ret->code_css[$code]['translation'] = lang_get($label); - $ret->code_css[$code]['css_class'] = $cfg['code_status'][$code] . '_text'; - $ret->definition[$code] = array("value" => $code, - "text" => $ret->code_css[$code]['translation'], - "cssClass" => $ret->code_css[$code]['css_class']); - } - } - return $ret; -} - -/** - * ATTENTION: xx.value is strongly related to HTML input names on tcAssignedToUser.tpl - */ -function getQuickExecCfg($gui,$imgSet,$statusCode) -{ - $qexe['passed'] = "l18n['quick_passed']}\" src=\"{$imgSet['exec_passed']}\" " . - " onclick=\"result_%s.value='{$statusCode['passed']}';"; - - - $qexe['failed'] = "l18n['quick_failed']}\" src=\"{$imgSet['exec_failed']}\" " . - " onclick=\"result_%s.value='{$statusCode['failed']}';"; - - $qexe['blocked'] = "l18n['quick_blocked']}\" src=\"{$imgSet['exec_blocked']}\" " . - " onclick=\"result_%s.value='{$statusCode['blocked']}';"; - - $qexe['common'] = 'pxi_%s.value=%s;bxi_%s.value=%s;tcvx_%s.value=%s;fog_%s.submit();" /> '; - - return $qexe; +getImages(); + +$args = initArgs($db); +$gui = initializeGui($db, $args); +$statusGui = getStatusGuiCfg(); + +// Get all test cases assigned to user without filtering by execution status +$opt = array( + 'mode' => 'full_path' +); +$filters = initFilters($args); +$tplan_param = ($args->tplan_id) ? array( + $args->tplan_id +) : testcase::ALL_TESTPLANS; + +$tcaseMgr = new testcase($db); +$gui->resultSet = $tcaseMgr->getAssignedToUser($args->user_id, + $args->tproject_id, $tplan_param, $opt, $filters); + +$doIt = ! is_null($gui->resultSet); + +// will work only on standard exec status +$exec = getQuickExecCfg($gui, $imgSet, $statusGui->status_code); + +$tables = tlObjectWithDB::getDBTables( + array( + 'nodes_hierarchy', + 'executions', + 'tcversions' + )); + +if ($args->result != '' && $args->tcvx > 0) { + + // get version number + $sql = " SELECT TCV.version FROM {$tables['tcversions']} TCV WHERE TCV.id = " . + $args->tcvx; + $xx = $db->get_recordset($sql); + $version_number = $xx[0]['version']; + + $sql = " INSERT INTO {$tables['executions']} " . + " (status,tester_id,execution_ts,tcversion_id,tcversion_number,testplan_id,platform_id,build_id)" . + " VALUES ('{$args->result}', {$args->executedBy}, " . $db->db_now() . "," . + " {$args->tcvx}, {$version_number}, {$args->tpx}, {$args->pxi},{$args->bxi})"; + + $db->exec_query($sql); +} + +if ($doIt) { + $execCfg = config_get('exec_cfg'); + + $tables = tlObjectWithDB::getDBTables(array( + 'nodes_hierarchy' + )); + $tplanSet = array_keys($gui->resultSet); + $sql = "SELECT name,id FROM {$tables['nodes_hierarchy']} " . "WHERE id IN (" . + implode(',', $tplanSet) . ")"; + $gui->tplanNames = $db->fetchRowsIntoMap($sql, 'id'); + $optColumns = array( + 'user' => $args->show_user_column, + 'priority' => $args->priority_enabled + ); + + $whoiam = $args->show_all_users ? 'tcAssignedToUser' : 'tcAssignedToMe'; + + foreach ($gui->resultSet as $tplan_id => $tcase_set) { + list ($columns, $sortByColumn, $show_platforms) = getColumnsDefinition( + $db, $tplan_id, $optColumns); + + $rows = array(); + + // has logged user right to execute test cases on this (test project,test plan)? + $hasExecRight = $_SESSION['currentUser']->hasRight($db, + 'testplan_execute', $args->tproject_id, $tplan_id, true); + + foreach ($tcase_set as $tcase_platform) { + foreach ($tcase_platform as $tcase) { + $current_row = array(); + $tcase_id = $tcase['testcase_id']; + $tcversion_id = $tcase['tcversion_id']; + + if ($args->show_user_column) { + if ($tcase['user_id'] > 0 && + isset($args->userSet[$tcase['user_id']])) { + $current_row[] = htmlspecialchars( + $args->userSet[$tcase['user_id']]['login']); + } else { + $current_row[] = ''; + } + } + + $current_row[] = htmlspecialchars($tcase['build_name']); + $current_row[] = htmlspecialchars($tcase['tcase_full_path']); + + // create linked icons + $ekk = $elk = $exec_link = ''; + $canExec = ($hasExecRight == 'yes'); + + if ($execCfg->exec_mode->tester == 'assigned_to_me') { + $canExec = $canExec && + ($tcase['user_id'] == $_SESSION['userID']); + } + + if ($canExec) { + $ekk = sprintf($exec['common'], $tplan_id, + $tcase['platform_id'], $tplan_id, $tcase['build_id'], + $tplan_id, $tcversion_id, $tplan_id); + + $elk = sprintf($exec['passed'], $tplan_id) . $ekk . ' ' . + sprintf($exec['failed'], $tplan_id) . $ekk . ' ' . + sprintf($exec['blocked'], $tplan_id) . $ekk; + + $exec_link = "" . + "l18n['execution']}\" src=\"{$imgSet['exec_icon']}\" /> "; + } + + $exec_history_link = "" . + "l18n['execution_history']}\" src=\"{$imgSet['history_small']}\" /> "; + + $edit_link = "" . + "l18n['design']}\" src=\"{$imgSet['edit_icon']}\" /> "; + + $current_row[] = "" . $elk . + $exec_history_link . $exec_link . $edit_link . + htmlspecialchars($tcase['prefix']) . $gui->glueChar . + $tcase['tc_external_id'] . " : " . + htmlspecialchars($tcase['name']) . + sprintf($gui->l18n['tcversion_indicator'], $tcase['version']); + + if ($show_platforms) { + $current_row[] = htmlspecialchars($tcase['platform_name']); + } + + if ($args->priority_enabled) { + $current_row[] = "" . + $gui->priority[priority_to_level($tcase['priority'])]; + } + + $leOptions = array( + 'getSteps' => 0 + ); + $lexec = $tcaseMgr->getLastExecution($tcase_id, $tcversion_id, + $tplan_id, $tcase['build_id'], $tcase['platform_id'], + $leOptions); + if (isset($lexec[$tcversion_id]['status'])) { + $status = $lexec[$tcversion_id]['status']; + } + if (! $status) { + $status = $statusGui->status_code['not_run']; + } + $current_row[] = $statusGui->definition[$status]; + + if ($args->show_user_column) { + $current_row[] = htmlspecialchars( + $lexec[$tcversion_id]['tester_login']); + } + + // need to check if we are using the right timestamp + $current_row[] = htmlspecialchars($tcase['creation_ts']) . " (" . + getDateDiff($tcase['creation_ts']) . ")"; + + $rows[] = $current_row; + } + } + + /* + * different table id for different reports: + * - Assignment Overview if $args->show_all_users is set + * - Test Cases assigned to user if $args->build_id > 0 + * - Test Cases assigned to me else + */ + $table_id = "tl_table_tc_assigned_to_me_for_tplan_"; + if ($args->show_all_users) { + $table_id = "tl_table_tc_assignment_overview_for_tplan_"; + } + if ($args->build_id) { + $table_id = "tl_table_tc_assigned_to_user_for_tplan_"; + } + + // add test plan id to table id + $table_id .= $tplan_id; + + $matrix = new tlExtTable($columns, $rows, $table_id); + $matrix->title = $gui->l18n['testplan'] . ": " . + htmlspecialchars($gui->tplanNames[$tplan_id]['name']); + + // default grouping by first column, which is user for overview, build otherwise + $matrix->setGroupByColumnName(lang_get($columns[0]['title_key'])); + + // make table collapsible if more than 1 table is shown and surround by frame + if (count($tplanSet) > 1) { + $matrix->collapsible = true; + $matrix->frame = true; + } + + // define toolbar + $matrix->showToolbar = true; + $matrix->toolbarExpandCollapseGroupsButton = true; + $matrix->toolbarShowAllColumnsButton = true; + + $matrix->setSortByColumnName($sortByColumn); + $matrix->sortDirection = 'DESC'; + $gui->tableSet[$tplan_id] = $matrix; + } +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * Replacement for the smarty helper function to get that functionality outside of templates. + * Returns difference between a given date and the current time in days. + * + * @author Andreas Simon + * @param + * $date + */ +function getDateDiff($date) +{ + $date = (is_string($date)) ? strtotime($date) : $date; + $i = 1 / 60 / 60 / 24; + return floor((time() - $date) * $i); +} + +/** + * init_args() + * Get in an object all data that has arrived to page through _REQUEST or _SESSION. + * If you think this page as a function, you can consider this data arguments (args) + * to a function call. + * Using all this data as one object property will help developer to understand + * if data is received or produced on page. + * + * @author franciscom - francisco.mancardi@gmail.com + * @args - used global coupling accessing $_REQUEST and $_SESSION + * + * @return object of stdClass + * + * @internal revisions + */ +function initArgs(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + + $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval( + $_REQUEST['tproject_id']) : 0; + if ($args->tproject_id == 0) { + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + } + if ($args->tproject_id == 0) { + throw new Exception( + __FILE__ . ' Can not work without Test project ID => Aborting'); + } + $mgr = new testproject($dbHandler); + $info = $mgr->get_by_id($args->tproject_id); + $args->tproject_name = $info['name']; + $args->testprojectOptions = $info['opt']; + unset($info); + + $args->user_id = isset($_REQUEST['user_id']) ? intval($_REQUEST['user_id']) : 0; + + if ($args->user_id != 0) { + $args->user = new tlUser($args->user_id); + $args->user->readFromDB($dbHandler); + } else { + $args->user_id = isset($_SESSION['userID']) ? intval( + $_SESSION['userID']) : 0; + if ($args->user_id == 0) { + throw new Exception( + __FILE__ . ' Can not work without User ID => Aborting'); + } + $args->user = $_SESSION['currentUser']; + } + + $args->executedBy = $args->user_id; + $args->user_name = $args->user->login; + $args->userSet = $args->user->getNames($dbHandler); + + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + $args->build_id = isset($_REQUEST['build_id']) && + is_numeric($_REQUEST['build_id']) ? intval($_REQUEST['build_id']) : 0; + + $args->show_inactive_tplans = isset($_REQUEST['show_inactive_tplans']) ? true : false; + + $args->show_all_users = false; + if (isset($_REQUEST['show_all_users'])) { + $args->show_all_users = (intval($_REQUEST['show_all_users']) == 1); + } + $args->show_user_column = $args->show_all_users; + + $show_closed_builds = isset($_REQUEST['show_closed_builds']) ? true : false; + $show_closed_builds_hidden = isset($_REQUEST['show_closed_builds_hidden']) ? true : false; + if ($show_closed_builds) { + $selection = true; + } elseif ($show_closed_builds_hidden) { + $selection = false; + } elseif (isset($_SESSION['show_closed_builds'])) { + $selection = intval($_SESSION['show_closed_builds']); + } else { + $selection = false; + } + $args->show_closed_builds = $_SESSION['show_closed_builds'] = $selection; + + if ($args->show_all_users) { + $args->user_id = TL_USER_ANYBODY; + } + + $args->show_inactive_and_closed = false; + if (isset($_REQUEST['show_inactive_and_closed'])) { + $args->show_inactive_and_closed = (intval( + $_REQUEST['show_inactive_and_closed']) != 0); + } + + $args->priority_enabled = $_SESSION['testprojectOptions']->testPriorityEnabled ? true : false; + + // quick & dirty execution + $args->tpx = isset($_REQUEST['tpx']) ? intval($_REQUEST['tpx']) : 0; + $dirtyHarry = array( + 'pxi', + 'bxi', + 'tcvx' + ); + foreach ($dirtyHarry as $tg) { + $key = $tg . '_' . $args->tpx; + $args->$tg = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; + } + $args->result = isset($_REQUEST['result_' . $args->tpx]) ? $_REQUEST['result_' . + $args->tpx][0] : ''; + + return $args; +} + +/** + * get Columns definition for table to display + */ +function getColumnsDefinition($dbHandler, $tplan_id, $optionalColumns) +{ + static $labels; + static $tplan_mgr; + if (is_null($labels)) { + $tplan_mgr = new testplan($dbHandler); + + $lbl2get = array( + 'build' => null, + 'testsuite' => null, + 'testcase' => null, + 'platform' => null, + 'user' => null, + 'priority' => null, + 'status' => null, + 'version' => null, + 'low_priority' => null, + 'medium_priority' => null, + 'high_priority' => null, + 'due_since' => null + ); + $labels = init_labels($lbl2get); + } + + $colDef = array(); + $sortByCol = $labels['testsuite']; + + // user column is only shown for assignment overview + if ($optionalColumns['user']) { + $colDef[] = array( + 'title_key' => 'user', + 'width' => 80 + ); + $sortByCol = $labels['build']; + } + + $colDef[] = array( + 'title_key' => 'build', + 'width' => 80 + ); + $colDef[] = array( + 'title_key' => 'testsuite', + 'width' => 130 + ); + $colDef[] = array( + 'title_key' => 'testcase', + 'width' => 130 + ); + + $platforms = $tplan_mgr->getPlatforms($tplan_id, + array( + 'outputFormat' => 'map' + )); + if ($show_plat = ! is_null($platforms)) { + $colDef[] = array( + 'title_key' => 'platform', + 'width' => 50, + 'filter' => 'list', + 'filterOptions' => $platforms + ); + } + + if ($optionalColumns['priority']) { + $sortByCol = $labels['priority']; + $colDef[] = array( + 'title_key' => 'priority', + 'width' => 50, + 'filter' => 'ListSimpleMatch', + 'filterOptions' => array( + $labels['low_priority'], + $labels['medium_priority'], + $labels['high_priority'] + ) + ); + } + + $colDef[] = array( + 'title_key' => 'status', + 'width' => 50, + 'type' => 'status' + ); + if ($optionalColumns['user']) { + $colDef[] = array( + 'title_key' => 'tester', + 'width' => 80 + ); + } + + $colDef[] = array( + 'title_key' => 'due_since', + 'width' => 100 + ); + + return array( + $colDef, + $sortByCol, + $show_plat + ); +} + +function initializeGui(&$dbHandler, $argsObj) +{ + $gui = new stdClass(); + $gui->tproject_name = $argsObj->tproject_name; + + // disable "show also closed builds" checkbox when a specific build is selected + $gui->show_build_selector = ($argsObj->build_id == 0); + $gui->show_closed_builds = $argsObj->show_closed_builds; + + $gui->glueChar = config_get('testcase_cfg')->glue_character; + $gui->warning_msg = ''; + $gui->tableSet = null; + $gui->l18n = init_labels( + array( + 'tcversion_indicator' => null, + 'goto_testspec' => null, + 'version' => null, + 'testplan' => null, + 'assigned_tc_overview' => null, + 'testcases_assigned_to_user' => null, + 'quick_passed' => null, + 'quick_failed' => null, + 'quick_blocked' => null, + 'low_priority' => null, + 'medium_priority' => null, + 'high_priority' => null, + 'design' => null, + 'execution' => null, + 'execution_history' => null + )); + + $gui->priority = array( + LOW => $gui->l18n['low_priority'], + MEDIUM => $gui->l18n['medium_priority'], + HIGH => $gui->l18n['high_priority'] + ); + + if ($argsObj->show_all_users) { + $gui->pageTitle = sprintf($gui->l18n['assigned_tc_overview'], + $gui->tproject_name); + } else { + $gui->pageTitle = sprintf($gui->l18n['testcases_assigned_to_user'], + $gui->tproject_name, $argsObj->user_name); + } + + $gui->user_id = $argsObj->user_id; + $gui->tplan_id = $argsObj->tplan_id; + + $gui->directLink = $_SESSION['basehref'] . 'ltx.php?item=xta2m&user_id=' . + $gui->user_id . '&tplan_id=' . $gui->tplan_id; + + return $gui; +} + +function initFilters($argsObj) +{ + $filters = array(); + + $filters['tplan_status'] = $argsObj->show_inactive_tplans ? 'all' : 'active'; + $filters['build_status'] = $argsObj->show_closed_builds ? 'all' : 'open'; + + if ($argsObj->build_id) { + $filters['build_id'] = $argsObj->build_id; + + // show assignments regardless of build and tplan status + $filters['build_status'] = 'all'; + $filters['tplan_status'] = 'all'; + } + return $filters; +} + +function getStatusGuiCfg() +{ + $cfg = config_get('results'); + + $ret = new stdClass(); + $ret->status_code = $cfg['status_code']; + $ret->code_css = array(); + $ret->definition = array(); + + foreach ($cfg['code_status'] as $code => $status) { + if (isset($cfg['status_label'][$status])) { + $label = $cfg['status_label'][$status]; + $ret->code_css[$code] = array(); + $ret->code_css[$code]['translation'] = lang_get($label); + $ret->code_css[$code]['css_class'] = $cfg['code_status'][$code] . + '_text'; + $ret->definition[$code] = array( + "value" => $code, + "text" => $ret->code_css[$code]['translation'], + "cssClass" => $ret->code_css[$code]['css_class'] + ); + } + } + return $ret; +} + +/** + * ATTENTION: xx.value is strongly related to HTML input names on tcAssignedToUser.tpl + */ +function getQuickExecCfg($gui, $imgSet, $statusCode) +{ + $qexe['passed'] = "l18n['quick_passed']}\" src=\"{$imgSet['exec_passed']}\" " . + " onclick=\"result_%s.value='{$statusCode['passed']}';"; + + $qexe['failed'] = "l18n['quick_failed']}\" src=\"{$imgSet['exec_failed']}\" " . + " onclick=\"result_%s.value='{$statusCode['failed']}';"; + + $qexe['blocked'] = "l18n['quick_blocked']}\" src=\"{$imgSet['exec_blocked']}\" " . + " onclick=\"result_%s.value='{$statusCode['blocked']}';"; + + $qexe['common'] = 'pxi_%s.value=%s;bxi_%s.value=%s;tcvx_%s.value=%s;fog_%s.submit();" /> '; + + return $qexe; } diff --git a/lib/testcases/tcBulkOp.php b/lib/testcases/tcBulkOp.php index 948c3e837b..0e8a81c69e 100644 --- a/lib/testcases/tcBulkOp.php +++ b/lib/testcases/tcBulkOp.php @@ -1,107 +1,113 @@ -doAction == 'apply') -{ - foreach($args->uchoice as $key => $val) - { - if($val > 0) - { - $tcaseMgr->setIntAttrForAllVersions($args->tcase_id,$key,$val,$args->forceFrozenVersions); - } - } -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args - - args: - - returns: - -*/ -function init_args(&$tcaseMgr) -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; - switch($args->doAction) - { - case 'apply'; - break; - - default: - $args->doAction = 'init'; - break; - } - - $args->tcase_id = isset($_REQUEST['tcase_id']) ? intval($_REQUEST['tcase_id']) : 0; - $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - $args->uchoice = array(); - $k2s = array('importance','status','execution_type'); - foreach($k2s as $tg) - { - $args->uchoice[$tg] = intval(isset($_REQUEST[$tg]) ? $_REQUEST[$tg] : -1); - } - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $args->tcStatusCfg['status_code'] = $dummy['cfg']; - $args->tcStatusCfg['code_label'] = $dummy['lbl']; - - $args->domainTCExecType = $tcaseMgr->get_execution_types(); - - $dummy = config_get('importance'); - foreach ($dummy['code_label'] as $code => $label) - { - $args->domainTCImportance[$code] = lang_get($label); - } - $args->forceFrozenVersions = isset($_REQUEST['forceFrozenTestcasesVersions']) ? intval($_REQUEST['forceFrozenTestcasesVersions']) : 0; - - return $args; -} - -/** - * - * - */ -function initializeGui(&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->page_title = lang_get('bulk_op'); - $guiObj->uchoice = $argsObj->uchoice; - $guiObj->tcase_id = $argsObj->tcase_id; - - $guiObj->domainTCStatus = array(-1 => '') + $argsObj->tcStatusCfg['code_label']; - $guiObj->domainTCExecType = array(-1 => '') + $argsObj->domainTCExecType; - $guiObj->domainTCImportance = array(-1 => '') + $argsObj->domainTCImportance; - - $guiObj->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - - return $guiObj; +doAction == 'apply') { + foreach ($args->uchoice as $key => $val) { + if ($val > 0) { + $tcaseMgr->setIntAttrForAllVersions($args->tcase_id, $key, $val, + $args->forceFrozenVersions); + } + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs(&$tcaseMgr) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : null; + switch ($args->doAction) { + case 'apply': + break; + + default: + $args->doAction = 'init'; + break; + } + + $args->tcase_id = isset($_REQUEST['tcase_id']) ? intval( + $_REQUEST['tcase_id']) : 0; + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + $args->uchoice = array(); + $k2s = array( + 'importance', + 'status', + 'execution_type' + ); + foreach ($k2s as $tg) { + $args->uchoice[$tg] = intval( + isset($_REQUEST[$tg]) ? $_REQUEST[$tg] : - 1); + } + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $args->tcStatusCfg['status_code'] = $dummy['cfg']; + $args->tcStatusCfg['code_label'] = $dummy['lbl']; + + $args->domainTCExecType = $tcaseMgr->get_execution_types(); + + $dummy = config_get('importance'); + foreach ($dummy['code_label'] as $code => $label) { + $args->domainTCImportance[$code] = lang_get($label); + } + $args->forceFrozenVersions = isset( + $_REQUEST['forceFrozenTestcasesVersions']) ? intval( + $_REQUEST['forceFrozenTestcasesVersions']) : 0; + + return $args; +} + +/** + */ +function initializeGui(&$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->page_title = lang_get('bulk_op'); + $guiObj->uchoice = $argsObj->uchoice; + $guiObj->tcase_id = $argsObj->tcase_id; + + $guiObj->domainTCStatus = array( + - 1 => '' + ) + $argsObj->tcStatusCfg['code_label']; + $guiObj->domainTCExecType = array( + - 1 => '' + ) + $argsObj->domainTCExecType; + $guiObj->domainTCImportance = array( + - 1 => '' + ) + $argsObj->domainTCImportance; + + $guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + + return $guiObj; } diff --git a/lib/testcases/tcCompareVersions.php b/lib/testcases/tcCompareVersions.php index 0cf2a3ebca..9d182ad4a7 100644 --- a/lib/testcases/tcCompareVersions.php +++ b/lib/testcases/tcCompareVersions.php @@ -1,189 +1,186 @@ -compare_selected_versions) -{ - $diffEngine = $args->use_daisydiff ? new HTMLDiffer() : new diff(); - $attributes = buildDiff($gui->tc_versions,$args); - foreach($attributes as $key => $val) - { - $gui->diff[$key]['count'] = 0; - $gui->diff[$key]['heading'] = lang_get($key); - - $val['left'] = isset($val['left']) ? $val['left'] : ''; - $val['right'] = isset($val['right']) ? $val['right'] : ''; - - if($args->use_daisydiff) - { - if ($gui->tcType == 'none') - { - list($gui->diff[$key]['diff'], $gui->diff[$key]['count']) = $diffEngine->htmlDiff(nl2br($val['left']), nl2br($val['right'])); - } - else - { - list($gui->diff[$key]['diff'], $gui->diff[$key]['count']) = $diffEngine->htmlDiff($val['left'], $val['right']); - } - } - else - { - // insert line endings so diff is better readable and makes sense (not everything in one line) - // then transform into array with \n as separator => diffEngine needs that. - // - $gui->diff[$key]['left'] = explode("\n", str_replace("

    ", "

    \n", $val['left'])); - $gui->diff[$key]['right'] = explode("\n", str_replace("

    ", "

    \n", $val['right'])); - - $gui->diff[$key]['diff'] = $diffEngine->inline($gui->diff[$key]['left'], $gui->leftID, - $gui->diff[$key]['right'], $gui->rightID,$args->context); - $gui->diff[$key]['count'] = count($diffEngine->changes); - } - - // are there any changes? then display! if not, nothing to show here - $msgKey = ($gui->diff[$key]['count'] > 0) ? 'num_changes' : 'no_changes'; - $gui->diff[$key]['message'] = sprintf($gui->labels[$msgKey], $gui->diff[$key]['heading'], - $gui->diff[$key]['count']); - } -} -$smarty = new TLSmarty(); -$smarty->assign('gui', $gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -function init_args() -{ - $args = new stdClass(); - $args->use_daisydiff = isset($_REQUEST['use_html_comp']); - - - $args->tcase_id = isset($_REQUEST['testcase_id']) ? $_REQUEST['testcase_id'] : 0; - $args->tcase_id = intval($args->tcase_id); - - $key2set = array('compare_selected_versions' => 0,'version_left' => '','version_right' => ''); - foreach($key2set as $tk => $value) - { - $args->$tk = isset($_REQUEST[$tk]) ? $_REQUEST[$tk] : $value; - } - - - if (isset($_REQUEST['context_show_all'])) - { - $args->context = null; - } - else - { - $diffEngineCfg = config_get("diffEngine"); - $args->context = (isset($_REQUEST['context']) && is_numeric($_REQUEST['context'])) ? - $_REQUEST['context'] : $diffEngineCfg->context; - } - - return $args; -} - -function initializeGUI(&$dbHandler,$argsObj) -{ - $gui = new stdClass(); - - $gui->tc_id = $argsObj->tcase_id; - $gui->compare_selected_versions = $argsObj->compare_selected_versions; - $gui->context = $argsObj->context; - - $tcaseMgr = new testcase($dbHandler); - $gui->tc_versions = $tcaseMgr->get_by_id($argsObj->tcase_id); - $gui->tcaseName = $gui->tc_versions[0]['name']; - unset($tcaseMgr); - - $lblkeys = array('num_changes' => null,'no_changes' => null, 'version_short' => null,'diff_subtitle_tc' => null); - $gui->labels = init_labels($lblkeys); - $gui->version_short = $gui->labels['version_short']; - - - $gui->subtitle = sprintf($gui->labels['diff_subtitle_tc'], - $argsObj->version_left,$argsObj->version_left, - $argsObj->version_right,$argsObj->version_right, $gui->tcaseName); - - $gui->leftID = "v{$argsObj->version_left}"; - $gui->rightID = "v{$argsObj->version_right}"; - $tcCfg = getWebEditorCfg('design'); - $gui->tcType = $tcCfg['type']; - return $gui; -} - -function buildDiff($items,$argsObj) -{ - - $panel = array('left','right'); - - $attrKeys = array(); - $attrKeys['simple'] = array('summary','preconditions'); - $attrKeys['complex'] = array('steps' => 'actions', 'expected_results' => 'expected_results'); - $dummy = array_merge($attrKeys['simple'],array_keys($attrKeys['complex'])); - foreach($dummy as $gx) - { - foreach($panel as $side) - { - $diff[$gx][$side] = null; - } - } - - foreach($items as $tcase) - { - foreach($panel as $side) - { - $tk = 'version_' . $side; - if ($tcase['version'] == $argsObj->$tk) - { - foreach($attrKeys['simple'] as $attr) - { - $diff[$attr][$side] = $tcase[$attr]; - } - - // Steps & Expected results, have evolved from ONE FIXED SET of two simple fields - // to a dynamic SET (array?) of two simple fields. - // Our choice in order to find differences, is to transform the dynamic set - // again on a ONE FIXED SET. - // That's why we need to do this kind of special processing. - if(is_array($tcase['steps'])) // some magic, I'm Sorry - { - foreach($tcase['steps'] as $step) - { - foreach($attrKeys['complex'] as $attr => $key2read) - { - $diff[$attr][$side] .= str_replace("

    ", "

    \n", $step[$key2read])."
    "."
    "; // insert lines between each steps and between each expected results so diff is better readable and makes sense (not everything in one line) - } - } - } - } - } // foreach panel - } - return $diff; -} -?> \ No newline at end of file +compare_selected_versions) { + $diffEngine = $args->use_daisydiff ? new HTMLDiffer() : new diff(); + $attributes = buildDiff($gui->tc_versions, $args); + foreach ($attributes as $key => $val) { + $gui->diff[$key]['count'] = 0; + $gui->diff[$key]['heading'] = lang_get($key); + + $val['left'] = isset($val['left']) ? $val['left'] : ''; + $val['right'] = isset($val['right']) ? $val['right'] : ''; + + if ($args->use_daisydiff) { + if ($gui->tcType == 'none') { + list ($gui->diff[$key]['diff'], $gui->diff[$key]['count']) = $diffEngine->htmlDiff( + nl2br($val['left']), nl2br($val['right'])); + } else { + list ($gui->diff[$key]['diff'], $gui->diff[$key]['count']) = $diffEngine->htmlDiff( + $val['left'], $val['right']); + } + } else { + // insert line endings so diff is better readable and makes sense (not everything in one line) + // then transform into array with \n as separator => diffEngine needs that. + // + $gui->diff[$key]['left'] = explode("\n", + str_replace("

    ", "

    \n", $val['left'])); + $gui->diff[$key]['right'] = explode("\n", + str_replace("

    ", "

    \n", $val['right'])); + + $gui->diff[$key]['diff'] = $diffEngine->inline( + $gui->diff[$key]['left'], $gui->leftID, + $gui->diff[$key]['right'], $gui->rightID, $args->context); + $gui->diff[$key]['count'] = count($diffEngine->changes); + } + + // are there any changes? then display! if not, nothing to show here + $msgKey = ($gui->diff[$key]['count'] > 0) ? 'num_changes' : 'no_changes'; + $gui->diff[$key]['message'] = sprintf($gui->labels[$msgKey], + $gui->diff[$key]['heading'], $gui->diff[$key]['count']); + } +} +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +function initArgs() +{ + $args = new stdClass(); + $args->use_daisydiff = isset($_REQUEST['use_html_comp']); + + $args->tcase_id = isset($_REQUEST['testcase_id']) ? $_REQUEST['testcase_id'] : 0; + $args->tcase_id = intval($args->tcase_id); + + $key2set = array( + 'compare_selected_versions' => 0, + 'version_left' => '', + 'version_right' => '' + ); + foreach ($key2set as $tk => $value) { + $args->$tk = isset($_REQUEST[$tk]) ? $_REQUEST[$tk] : $value; + } + + if (isset($_REQUEST['context_show_all'])) { + $args->context = null; + } else { + $diffEngineCfg = config_get("diffEngine"); + $args->context = (isset($_REQUEST['context']) && + is_numeric($_REQUEST['context'])) ? $_REQUEST['context'] : $diffEngineCfg->context; + } + + return $args; +} + +function initializeGUI(&$dbHandler, $argsObj) +{ + $gui = new stdClass(); + + $gui->tc_id = $argsObj->tcase_id; + $gui->compare_selected_versions = $argsObj->compare_selected_versions; + $gui->context = $argsObj->context; + + $tcaseMgr = new testcase($dbHandler); + $gui->tc_versions = $tcaseMgr->get_by_id($argsObj->tcase_id); + $gui->tcaseName = $gui->tc_versions[0]['name']; + unset($tcaseMgr); + + $lblkeys = array( + 'num_changes' => null, + 'no_changes' => null, + 'version_short' => null, + 'diff_subtitle_tc' => null + ); + $gui->labels = init_labels($lblkeys); + $gui->version_short = $gui->labels['version_short']; + + $gui->subtitle = sprintf($gui->labels['diff_subtitle_tc'], + $argsObj->version_left, $argsObj->version_left, $argsObj->version_right, + $argsObj->version_right, $gui->tcaseName); + + $gui->leftID = "v{$argsObj->version_left}"; + $gui->rightID = "v{$argsObj->version_right}"; + $tcCfg = getWebEditorCfg('design'); + $gui->tcType = $tcCfg['type']; + return $gui; +} + +function buildDiff($items, $argsObj) +{ + $panel = array( + 'left', + 'right' + ); + + $attrKeys = array(); + $attrKeys['simple'] = array( + 'summary', + 'preconditions' + ); + $attrKeys['complex'] = array( + 'steps' => 'actions', + 'expected_results' => 'expected_results' + ); + $dummy = array_merge($attrKeys['simple'], array_keys($attrKeys['complex'])); + foreach ($dummy as $gx) { + foreach ($panel as $side) { + $diff[$gx][$side] = null; + } + } + + foreach ($items as $tcase) { + foreach ($panel as $side) { + $tk = 'version_' . $side; + if ($tcase['version'] == $argsObj->$tk) { + foreach ($attrKeys['simple'] as $attr) { + $diff[$attr][$side] = $tcase[$attr]; + } + + // Steps & Expected results, have evolved from ONE FIXED SET of two simple fields + // to a dynamic SET (array?) of two simple fields. + // Our choice in order to find differences, is to transform the dynamic set + // again on a ONE FIXED SET. + // That's why we need to do this kind of special processing. + if (is_array($tcase['steps'])) // some magic, I'm Sorry + { + foreach ($tcase['steps'] as $step) { + foreach ($attrKeys['complex'] as $attr => $key2read) { + $diff[$attr][$side] .= str_replace("

    ", "

    \n", + $step[$key2read]) . "
    " . "
    "; // insert lines between each steps and between each expected results so diff is better readable and makes sense (not everything in one line) + } + } + } + } + } + } + return $diff; +} +?> diff --git a/lib/testcases/tcCreateFromIssue.php b/lib/testcases/tcCreateFromIssue.php index fc3a226732..2686bca54e 100644 --- a/lib/testcases/tcCreateFromIssue.php +++ b/lib/testcases/tcCreateFromIssue.php @@ -1,1069 +1,1095 @@ -do_upload) -{ - - // check the uploaded file - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - - tLog('Uploaded file: '.$source); - $doIt = false; - $gui->file_check = null; - if (($source != 'none') && ($source != '')) - { - // ATTENTION: - // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using - // Firefox and Chrome. - if( !($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes) ) - { - $gui->file_check['status_ok'] = 0; - $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'),$_FILES['uploadedFile']['size'],$gui->importLimitBytes); - } - } - if($doIt) - { - $gui->file_check['status_ok'] = 1; - if (move_uploaded_file($source, $gui->dest)) - { - tLog('Renamed uploaded file: ' . $source); - switch($args->importType) - { - case 'XML': - $pcheck_fn = "check_xml_tc_tsuite"; - $pimport_fn = "importTestCaseDataFromXML"; - break; - } - if(!is_null($pcheck_fn)) - { - $gui->file_check = $pcheck_fn($gui->dest,$args->useRecursion); - } - } - if($gui->file_check['status_ok'] && $pimport_fn) - { - tLog('Check is Ok.'); - $opt = array(); - $opt['useRecursion'] = $args->useRecursion; - $opt['importIntoProject'] = $args->bIntoProject; - $opt['duplicateLogic'] = array('hitCriteria' => $args->hit_criteria, - 'actionOnHit' => $args->action_on_duplicated_name); - $gui->resultMap = $pimport_fn($db,$gui->dest,intval($args->container_id), - intval($args->tproject_id),intval($args->userID),$opt); - } - } - else if(is_null($gui->file_check)) - { - - tLog('Missing upload file','WARNING'); - $gui->file_check = array('status_ok' => 0, 'msg' => lang_get('please_choose_file_to_import')); - $args->importType = null; - } -} - -if($args->useRecursion) -{ - $obj_mgr = new testsuite($db); - $gui->actionOptions=array('update_last_version' => lang_get('update_last_testcase_version'), - 'generate_new' => lang_get('generate_new_testcase'), - 'create_new_version' => lang_get('create_new_testcase_version')); - - $gui->hitOptions=array('name' => lang_get('same_name'), - 'internalID' => lang_get('same_internalID'), - 'externalID' => lang_get('same_externalID')); -} -else -{ - $obj_mgr = new testcase($db); - $gui->actionOptions=array('update_last_version' => lang_get('update_last_testcase_version'), - 'generate_new' => lang_get('generate_new_testcase'), - 'create_new_version' => lang_get('create_new_testcase_version')); - - $gui->hitOptions=array('name' => lang_get('same_name'), - 'internalID' => lang_get('same_internalID'), - 'externalID' => lang_get('same_externalID')); - -} - -$gui->testprojectName = $_SESSION['testprojectName']; -$gui->importTypes = $obj_mgr->get_import_file_types(); -$gui->action_on_duplicated_name=$args->action_on_duplicated_name; - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -// -------------------------------------------------------------------------------------- -/* - function: importTestCaseDataFromXML - args : - returns: -*/ -function importTestCaseDataFromXML(&$db,$fileName,$parentID,$tproject_id,$userID,$options=null) -{ - tLog('importTestCaseDataFromXML called for file: '. $fileName); - $xmlTCs = null; - $resultMap = null; - $my = array(); - $my['options'] = array('useRecursion' => false, 'importIntoProject' => 0, - 'duplicateLogic' => array('hitCriteria' => 'name', 'actionOnHit' => null)); - $my['options'] = array_merge($my['options'], (array)$options); - foreach($my['options'] as $varname => $value) - { - $$varname = $value; - } - - if (file_exists($fileName)) - { - $xml = @simplexml_load_file_wrapper($fileName); - if($xml !== FALSE) - { - $xmlKeywords = $xml->xpath('//keywords'); - $kwMap = null; - if ($xmlKeywords) - { - $tproject = new testproject($db); - $loop2do = sizeof($xmlKeywords); - for($idx = 0; $idx < $loop2do ;$idx++) - { - $tproject->importKeywordsFromSimpleXML($tproject_id,$xmlKeywords[$idx]); - } - $kwMap = $tproject->get_keywords_map($tproject_id); - $kwMap = is_null($kwMap) ? null : array_flip($kwMap); - } - - if (!$useRecursion && ($xml->getName() == 'testcases') ) - { - $resultMap = importTestCasesFromSimpleXML($db,$xml,$parentID,$tproject_id,$userID,$kwMap,$duplicateLogic); - } - - if ($useRecursion && ($xml->getName() == 'testsuite')) - { - $resultMap = importTestSuitesFromSimpleXML($db,$xml,intval($parentID),intval($tproject_id),$userID, - $kwMap,$importIntoProject,$duplicateLogic); - } - - } - } - return $resultMap; -} - - -// -------------------------------------------------------------------------------------- -/* - function: saveImportedTCData - args : - returns: -*/ -function saveImportedTCData(&$db,$tcData,$tproject_id,$container_id, - $userID,$kwMap,$duplicatedLogic = array('hitCriteria' => 'name', 'actionOnHit' => null)) -{ - static $messages; - static $fieldSizeCfg; - static $feedbackMsg; - static $tcase_mgr; - static $tproject_mgr; - static $req_spec_mgr; - static $req_mgr; - static $safeSizeCfg; - static $linkedCustomFields; - static $tprojectHas; - static $reqSpecSet; - static $getVersionOpt; - static $userObj; - - if (!$tcData) - { - return; - } - - // $tprojectHas = array('customFields' => false, 'reqSpec' => false); - $hasCustomFieldsInfo = false; - $hasRequirements = false; - - if(is_null($messages)) - { - $feedbackMsg = array(); - $messages = array(); - $fieldSizeCfg = config_get('field_size'); - - $tcase_mgr = new testcase($db); - $tcase_mgr->setTestProject($tproject_id); - - - $tproject_mgr = new testproject($db); - $req_spec_mgr = new requirement_spec_mgr($db); - $req_mgr = new requirement_mgr($db); - $userObj = new tlUser(); - - $k2l = array('already_exists_updated','original_name','testcase_name_too_long', - 'start_warning','end_warning','testlink_warning','hit_with_same_external_ID'); - foreach($k2l as $k) - { - $messages[$k] = lang_get($k); - } - - $messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n"; - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['reqspec_warning'] = lang_get('no_reqspec_defined_can_not_import'); - - - - $feedbackMsg['cfield']=lang_get('cf_value_not_imported_missing_cf_on_testproject'); - $feedbackMsg['tcase'] = lang_get('testcase'); - $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); - $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); - - - // because name can be changed automatically during item creation - // to avoid name conflict adding a suffix automatically generated, - // is better to use a max size < max allowed size - $safeSizeCfg = new stdClass(); - $safeSizeCfg->testcase_name=($fieldSizeCfg->testcase_name) * 0.8; - - - // Get CF with scope design time and allowed for test cases linked to this test project - $linkedCustomFields = $tcase_mgr->cfield_mgr->get_linked_cfields_at_design($tproject_id,1,null,'testcase',null,'name'); - $tprojectHas['customFields']=!is_null($linkedCustomFields); - - $reqSpecSet = $tproject_mgr->getReqSpec($tproject_id,null,array('RSPEC.id','NH.name AS title','RSPEC.doc_id as rspec_doc_id', 'REQ.req_doc_id'),'req_doc_id'); - $tprojectHas['reqSpec'] = (!is_null($reqSpecSet) && count($reqSpecSet) > 0); - - $getVersionOpt = array('output' => 'minimun'); - $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); - } - - $resultMap = array(); - $tc_qty = sizeof($tcData); - $userIDCache = array(); - - for($idx = 0; $idx <$tc_qty ; $idx++) - { - $tc = $tcData[$idx]; - $name = $tc['name']; - $summary = $tc['summary']; - $steps = $tc['steps']; - - // I've changed value to use when order has not been provided - // from testcase:DEFAULT_ORDER to a counter, because with original solution - // an issue arise with 'save execution and go next' - // if use has not provided order I think is OK TestLink make any choice. - $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx+1); - $internalid = $tc['internalid']; - $preconditions = $tc['preconditions']; - $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; - $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; - - $externalid = $tc['externalid']; - if( intval($externalid) <= 0 ) - { - $externalid = null; - } - - $personID = $userID; - if( !is_null($tc['author_login']) ) - { - if( isset($userIDCache[$tc['author_login']]) ) - { - $personID = $userIDCache[$tc['author_login']]; - } - else - { - $userObj->login = $tc['author_login']; - if( $userObj->readFromDB($db,tlUser::USER_O_SEARCH_BYLOGIN) == tl::OK ) - { - $personID = $userObj->dbID; - } - - // I will put always a valid userID on this cache, - // this way if author_login does not exit, and is used multiple times - // i will do check for existence JUST ONCE. - $userIDCache[$tc['author_login']] = $personID; - } - } - - $name_len = tlStringLen($name); - if($name_len > $fieldSizeCfg->testcase_name) - { - // Will put original name inside summary - $xx = $messages['start_feedback']; - $xx .= sprintf($messages['testcase_name_too_long'],$name_len, $fieldSizeCfg->testcase_name) . "\n"; - $xx .= $messages['original_name'] . "\n" . $name. "\n" . $messages['end_warning'] . "\n"; - $summary = nl2br($xx) . $summary; - $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); - } - - - $kwIDs = null; - if (isset($tc['keywords']) && $tc['keywords']) - { - $kwIDs = implode(",",buildKeywordList($kwMap,$tc['keywords'])); - } - - $doCreate=true; - if( $duplicatedLogic['actionOnHit'] == 'update_last_version' ) - { - switch($duplicatedLogic['hitCriteria']) - { - case 'name': - $info = $tcase_mgr->getDuplicatesByName($name,$container_id); - break; - - case 'internalID': - $dummy = $tcase_mgr->tree_manager->get_node_hierarchy_info($internalid,$container_id); - if( !is_null($dummy) ) - { - $info = null; // TICKET 4925 - $info[$internalid] = $dummy; - } - break; - - case 'externalID': - $info = $tcase_mgr->get_by_external($externalid,$container_id); - break; - - - } - - if( !is_null($info) ) - { - $tcase_qty = count($info); - switch($tcase_qty) - { - case 1: - $doCreate=false; - $tcase_id = key($info); - $last_version = $tcase_mgr->get_last_version_info($tcase_id,$getVersionOpt); - $tcversion_id = $last_version['id']; - $ret = $tcase_mgr->update($tcase_id,$tcversion_id,$name,$summary, - $preconditions,$steps,$personID,$kwIDs, - $node_order,$exec_type,$importance); - - $ret['id'] = $tcase_id; - $ret['tcversion_id'] = $tcversion_id; - $resultMap[] = array($name,$messages['already_exists_updated']); - break; - - case 0: - $doCreate=true; - break; - - default: - $doCreate=false; - break; - } - } - } - - if( $doCreate ) - { - // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. - $item_id = intval($tcase_mgr->getInternalID($externalid, array('tproject_id' => $tproject_id))); - if( $item_id > 0) - { - // who is his parent ? - $owner = $tcase_mgr->getTestSuite($item_id); - if( $owner != $container_id) - { - // Get full path of existent Test Cases - $stain = $tcase_mgr->tree_manager->get_path($item_id,null, 'name'); - $n = count($stain); - $stain[$n-1] = $tcasePrefix . config_get('testcase_cfg')->glue_character . $externalid . ':' . $stain[$n-1]; - $stain = implode('/',$stain); - - $resultMap[] = array($name,$messages['hit_with_same_external_ID'] . $stain); - $doCreate = false; - } - } - } - if( $doCreate ) - { - $createOptions = array('check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, - 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], - 'external_id' => $externalid); - - if ($ret = $tcase_mgr->create($container_id,$name,$summary,$preconditions,$steps, - $personID,$kwIDs,$node_order,testcase::AUTOMATIC_ID, - $exec_type,$importance,$createOptions)) - { - $resultMap[] = array($name,$ret['msg']); - } - } - - // Custom Fields Management - // Check if CF with this name and that can be used on Test Cases is defined in current Test Project. - // If Check fails => give message to user. - // Else Import CF data - // - $hasCustomFieldsInfo = (isset($tc['customfields']) && !is_null($tc['customfields'])); - if($hasCustomFieldsInfo && !is_null($ret)) - { - if($tprojectHas['customFields']) - { - $msg = processCustomFields($tcase_mgr,$name,$ret['id'],$ret['tcversion_id'],$tc['customfields'], - $linkedCustomFields,$feedbackMsg); - if( !is_null($msg) ) - { - $resultMap = array_merge($resultMap,$msg); - } - } - else - { - // Can not import Custom Fields Values, give feedback - $msg[]=array($name,$messages['cf_warning']); - $resultMap = array_merge($resultMap,$msg); - } - } - - // BUGID - 20090205 - franciscom - // Requirements Management - // Check if Requirement ... - // If Check fails => give message to user. - // Else Import - // - $hasRequirements=(isset($tc['requirements']) && !is_null($tc['requirements'])); - if($hasRequirements) - { - if( $tprojectHas['reqSpec'] ) - { - $msg = processRequirements($db,$req_mgr,$name,$ret['id'],$tc['requirements'],$reqSpecSet,$feedbackMsg); - if( !is_null($msg) ) - { - $resultMap = array_merge($resultMap,$msg); - } - } - else - { - $msg[]=array($name,$messages['reqspec_warning']); - $resultMap = array_merge($resultMap,$msg); - } - } - - } - return $resultMap; -} - - -// -------------------------------------------------------------------------------------- -/* - function: buildKeywordList - args : - returns: -*/ -function buildKeywordList($kwMap,$keywords) -{ - $items = array(); - $loop2do = sizeof($keywords); - for($jdx = 0; $jdx <$loop2do ; $jdx++) - { - $items[] = $kwMap[trim($keywords[$jdx]['name'])]; - } - return $items; -} - - -// -------------------------------------------------------------------------------------- - -// -------------------------------------------------------------------------------------- - -/* - function: Check if at least the file starts seems OK -*/ -function check_xml_tc_tsuite($fileName,$recursiveMode) -{ - $xml = @simplexml_load_file_wrapper($fileName); - $file_check = array('status_ok' => 0, 'msg' => 'xml_load_ko'); - if($xml !== FALSE) - { - $file_check = array('status_ok' => 1, 'msg' => 'ok'); - $elementName = $xml->getName(); - if($recursiveMode) - { - if($elementName != 'testsuite') - { - $file_check=array('status_ok' => 0, 'msg' => lang_get('wrong_xml_tsuite_file')); - } - } - else - { - if($elementName != 'testcases' && $elementName != 'testcase') - { - $file_check=array('status_ok' => 0, 'msg' => lang_get('wrong_xml_tcase_file')); - } - } - } - return $file_check; -} - - - -/* contribution by mirosvad - - Convert new line characters from XLS to HTML -*/ -function nl2p($str) -{ - return str_replace('

    ', '', '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); //MS -} - - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $key='action_on_duplicated_name'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'generate_new'; - - $key='hit_criteria'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'name'; - - - $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; - $args->useRecursion = isset($_REQUEST['useRecursion']) ? $_REQUEST['useRecursion'] : 0; - $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; - $args->container_id = isset($_REQUEST['containerID']) ? intval($_REQUEST['containerID']) : 0; - $args->bIntoProject = isset($_REQUEST['bIntoProject']) ? intval($_REQUEST['bIntoProject']) : 0; - - $args->containerType = isset($_REQUEST['containerType']) ? intval($_REQUEST['containerType']) : 0; - $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; - - $args->userID = $_SESSION['userID']; - $args->tproject_id = $_SESSION['testprojectID']; - - return $args; -} - - -/** - * processCustomFields - * - * Analise custom field info related to test case being imported. - * If everything OK, assign to test case. - * Else return an array of messages. - * - * - * @internal revisions - * 20100905 - franciscom - BUGID 3431 - Custom Field values at Test Case VERSION Level - */ -function processCustomFields(&$tcaseMgr,$tcaseName,$tcaseId,$tcversionId,$cfValues,$cfDefinition,$messages) -{ - static $missingCfMsg; - $cf2insert=null; - $resultMsg=null; - - foreach($cfValues as $value) - { - if( isset($cfDefinition[$value['name']]) ) - { - $cf2insert[$cfDefinition[$value['name']]['id']]=array('type_id' => $cfDefinition[$value['name']]['type'], - 'cf_value' => $value['value']); - } - else - { - if( !isset($missingCfMsg[$value['name']]) ) - { - $missingCfMsg[$value['name']] = sprintf($messages['cfield'],$value['name'],$messages['tcase']); - } - $resultMsg[] = array($tcaseName,$missingCfMsg[$value['name']]); - } - } - - new dBug($cf2insert); - new dBug($tcversionId); - $tcaseMgr->cfield_mgr->design_values_to_db($cf2insert,$tcversionId,null,'simple'); - return $resultMsg; -} - -/** - * processRequirements - * - * Analise requirements info related to test case being imported. - * If everything OK, assign to test case. - * Else return an array of messages. - * - * 20100911 - amitkhullar - BUGID 3764 - */ -function processRequirements(&$dbHandler,&$reqMgr,$tcaseName,$tcaseId,$tcReq,$reqSpecSet,$messages) -{ - static $missingReqMsg; - static $missingReqSpecMsg; - static $cachedReqSpec; - $resultMsg=null; - $tables = tlObjectWithDB::getDBTables(array('requirements')); - - - foreach($tcReq as $ydx => $value) - { - $cachedReqSpec=array(); - $doit=false; - if( ($doit=isset($reqSpecSet[$value['doc_id']])) ) - { - if( !(isset($cachedReqSpec[$value['req_spec_title']])) ) - { - // $cachedReqSpec - // key: Requirement Specification Title - // value: map with follogin keys - // id => requirement specification id - // req => map with key: requirement document id - $cachedReqSpec[$value['req_spec_title']]['id']=$reqSpecSet[$value['doc_id']]['id']; - $cachedReqSpec[$value['req_spec_title']]['req']=null; - } - } - - if($doit) - { - $useit=false; - $req_spec_id=$cachedReqSpec[$value['req_spec_title']]['id']; - - // Check if requirement with desired document id exists on requirement specification. - // If not => create message for user feedback. - if( !($useit=isset($cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']])) ) - { - $sql = " SELECT REQ.id from {$tables['requirements']} REQ " . - " WHERE REQ.req_doc_id='{$dbHandler->prepare_string($value['doc_id'])}' " . - " AND REQ.srs_id={$req_spec_id} "; - - $rsx=$dbHandler->get_recordset($sql); - if( $useit=((!is_null($rsx) && count($rsx) > 0) ? true : false) ) - { - $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']]=$rsx[0]['id']; - } - } - - - if($useit) - { - $reqMgr->assign_to_tcase($cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']],$tcaseId); - } - else - { - if( !isset($missingReqMsg[$value['doc_id']]) ) - { - $missingReqMsg[$value['doc_id']]=sprintf($messages['req'], - $value['doc_id'],$value['req_spec_title']); - } - $resultMsg[] = array($tcaseName,$missingReqMsg[$value['doc_id']]); - } - } - else - { - // Requirement Specification not found - if( !isset($missingReqSpecMsg[$value['req_spec_title']]) ) - { - $missingReqSpecMsg[$value['req_spec_title']]=sprintf($messages['req_spec'],$value['req_spec_title']); - } - $resultMsg[] = array($tcaseName,$missingReqSpecMsg[$value['req_spec_title']]); - } - - } //foreach - - return $resultMsg; -} - - - -/** - * - * - */ -function importTestCasesFromSimpleXML(&$db,&$simpleXMLObj,$parentID,$tproject_id,$userID,$kwMap,$duplicateLogic) -{ - $resultMap = null; - $xmlTCs = $simpleXMLObj->xpath('//testcase'); - $tcData = getTestCaseSetFromSimpleXMLObj($xmlTCs); - if ($tcData) - { - $resultMap = saveImportedTCData($db,$tcData,$tproject_id,$parentID,$userID,$kwMap,$duplicateLogic); - } - return $resultMap; -} - -/** - * - * - * @internal revisions - * 20100317 - added internalid - BUGID 3236 - */ -function getTestCaseSetFromSimpleXMLObj($xmlTCs) -{ - $tcSet = null; - if (!$xmlTCs) - { - return $tcSet; - } - - $jdx = 0; - $loops2do=sizeof($xmlTCs); - $tcaseSet = array(); - - // $tcXML['elements'] = array('string' => array("summary","preconditions"), - // 'integer' => array("node_order","externalid","execution_type","importance")); - // $tcXML['attributes'] = array('string' => array("name"), 'integer' =>array('internalid')); - - // TICKET 4963: Test case / Tes suite XML format, new element to set author - $tcXML['elements'] = array('string' => array("summary" => null,"preconditions" => null, - "author_login" => null), - 'integer' => array("node_order" => null,"externalid" => null, - "execution_type" => null ,"importance" => null)); - $tcXML['attributes'] = array('string' => array("name" => 'trim'), - 'integer' =>array('internalid' => null)); - - for($idx = 0; $idx < $loops2do; $idx++) - { - $dummy = getItemsFromSimpleXMLObj(array($xmlTCs[$idx]),$tcXML); - $tc = $dummy[0]; - - if ($tc) - { - // Test Case Steps - $steps = getStepsFromSimpleXMLObj($xmlTCs[$idx]->steps->step); - $tc['steps'] = $steps; - - $keywords = getKeywordsFromSimpleXMLObj($xmlTCs[$idx]->keywords->keyword); - if ($keywords) - { - $tc['keywords'] = $keywords; - } - - $cf = getCustomFieldsFromSimpleXMLObj($xmlTCs[$idx]->custom_fields->custom_field); - if($cf) - { - $tc['customfields'] = $cf; - } - - $requirements = getRequirementsFromSimpleXMLObj($xmlTCs[$idx]->requirements->requirement); - if($requirements) - { - $tc['requirements'] = $requirements; - } - } - $tcaseSet[$jdx++] = $tc; - } - return $tcaseSet; -} - - -/** - * - * - * @internal revisions - * 20100821 - franciscom - BUGID 3695 - added "execution_type" - */ -function getStepsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("actions"=>null,"expectedresults" => null), - 'integer' => array("step_number" => null,"execution_type" => null)); - - // 20110205 - franciscom - seems key 'transformations' is not managed on - // getItemsFromSimpleXMLObj(), then ??? is useless??? - $itemStructure['transformations'] = array("expectedresults" => "expected_results"); - - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - - // need to do this due to (maybe) a wrong name choice for XML element - if( !is_null($items) ) - { - $loop2do = count($items); - for($idx=0; $idx < $loop2do; $idx++) - { - $items[$idx]['expected_results'] = ''; - if( isset($items[$idx]['expectedresults']) ) - { - $items[$idx]['expected_results'] = $items[$idx]['expectedresults']; - unset($items[$idx]['expectedresults']); - } - } - } - return $items; -} - -function getCustomFieldsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("name" => 'trim',"value" => 'trim')); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; - -} - -function getRequirementsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("req_spec_title" => 'trim', - "doc_id" => 'trim' ,"title" => 'trim' )); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; -} - -function getKeywordsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("notes" => null)); - $itemStructure['attributes'] = array('string' => array("name" => 'trim')); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; -} - - -/* - function: importTestSuite - args : - returns: - - @internal revisions - 20120623 - franciscom - TICKET 5070 - test suite custom fields import - -*/ -function importTestSuitesFromSimpleXML(&$dbHandler,&$xml,$parentID,$tproject_id, - $userID,$kwMap,$importIntoProject = 0,$duplicateLogic) -{ - static $tsuiteXML; - static $tsuiteMgr; - static $myself; - static $callCounter = 0; - static $cfSpec; - static $doCF; - - $resultMap = array(); - if(is_null($tsuiteXML) ) - { - $myself = __FUNCTION__; - $tsuiteXML = array(); - $tsuiteXML['elements'] = array('string' => array("details" => null), - 'integer' => array("node_order" => null)); - $tsuiteXML['attributes'] = array('string' => array("name" => 'trim')); - - $tsuiteMgr = new testsuite($dbHandler); - $doCF = !is_null(($cfSpec = $tsuiteMgr->get_linked_cfields_at_design(null,null,null, - $tproject_id,'name'))); - } - - if($xml->getName() == 'testsuite') - { - - - // getItemsFromSimpleXMLObj() first argument must be an array - $dummy = getItemsFromSimpleXMLObj(array($xml),$tsuiteXML); - $tsuite = current($dummy); - $tsuiteID = $parentID; // hmmm, not clear - - if ($tsuite['name'] != "") - { - // Check if Test Suite with this name exists on this container - // if yes -> update instead of create - $info = $tsuiteMgr->get_by_name($tsuite['name'],$parentID); - if( is_null($info) ) - { - $ret = $tsuiteMgr->create($parentID,$tsuite['name'],$tsuite['details'],$tsuite['node_order']); - $tsuite['id'] = $ret['id']; - } - else - { - $ret = $tsuiteMgr->update(($tsuite['id'] = $info[0]['id']),$tsuite['name'],$tsuite['details'], - null,$tsuite['node_order']); - - } - unset($dummy); - - $tsuiteID = $tsuite['id']; // $tsuiteID is needed on more code pieces => DO NOT REMOVE - if (!$tsuite['id']) - { - return null; - } - - if($doCF) - { - $cf = getCustomFieldsFromSimpleXMLObj($xml->custom_fields->custom_field); - if(!is_null($cf)) - { - processTestSuiteCF($tsuiteMgr,$xml,$cfSpec,$cf,$tsuite,$tproject_id); - } - } - - if( $keywords = getKeywordsFromSimpleXMLObj($xml->keywords->keyword) ) - { - $kwIDs = buildKeywordList($kwMap,$keywords); - $tsuiteMgr->addKeywords($tsuite['id'],$kwIDs); - } - - unset($tsuite); - } - else if($importIntoProject) - { - $tsuiteID = intval($tproject_id); - } - - $childrenNodes = $xml->children(); - $loop2do = sizeof($childrenNodes); - - for($idx = 0; $idx < $loop2do; $idx++) - { - $target = $childrenNodes[$idx]; - switch($target->getName()) - { - case 'testcase': - // getTestCaseSetFromSimpleXMLObj() first argument must be an array - $tcData = getTestCaseSetFromSimpleXMLObj(array($target)); - $resultMap = array_merge($resultMap, - saveImportedTCData($dbHandler,$tcData,$tproject_id, - $tsuiteID,$userID,$kwMap,$duplicateLogic)); - unset($tcData); - break; - - case 'testsuite': - $resultMap = array_merge($resultMap, - $myself($dbHandler,$target,$tsuiteID,$tproject_id, - $userID,$kwMap,$importIntoProject,$duplicateLogic)); - break; - - - // Important Development Notice - // Due to XML file structure, while looping - // we will find also this children: - // node_order,keywords,custom_fields,details - // - // It's processing to get and save values is done - // on other pieces of this code. - // - // Form a logical point of view seems the better - // to consider and process here testcase and testsuite as children. - // - } - } - } - return $resultMap; -} - - -/** - * - * - * - **/ -function initializeGui(&$dbHandler,&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); - $guiObj->hitCriteria = $argsObj->hit_criteria; - $guiObj->useRecursion = $argsObj->useRecursion; - $guiObj->containerID = $argsObj->container_id; - $guiObj->bImport = tlStringLen($argsObj->importType); - $guiObj->bIntoProject = $argsObj->bIntoProject; - $guiObj->resultMap = null; - $guiObj->container_name = ''; - - - $dest_common = TL_TEMP_PATH . session_id(). "-importtcs"; - $dest_files = array('XML' => $dest_common . ".xml"); - $guiObj->dest = $dest_files['XML']; - if(!is_null($argsObj->importType)) - { - $guiObj->dest = $dest_files[$argsObj->importType]; - } - - $guiObj->file_check = array('status_ok' => 1, 'msg' => 'ok'); - - if($argsObj->useRecursion) - { - $guiObj->import_title = lang_get('title_tsuite_import_to'); - $guiObj->container_description = lang_get('test_suite'); - } - else - { - $guiObj->import_title = lang_get('title_tc_import_to'); - $guiObj->container_description = lang_get('test_case'); - } - - if($argsObj->container_id) - { - $tree_mgr = new tree($dbHandler); - $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); - unset($tree_mgr); - $guiObj->container_name = $node_info['name']; - if($argsObj->container_id == $argsObj->tproject_id) - { - $guiObj->container_description = lang_get('testproject'); - } - } - - return $guiObj; -} - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - **/ -function processTestSuiteCF(&$tsuiteMgr,$xmlObj,&$cfDefinition,&$cfValues,$tsuite,$tproject_id) -{ - - static $messages; - static $missingCfMsg; - - if(is_null($messages)) - { - $messages = array(); - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['start_warning'] = lang_get('start_warning'); - $messages['end_warning'] = lang_get('end_warning'); - $messages['testlink_warning'] = lang_get('testlink_warning'); - $messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n"; - $messages['cfield'] = lang_get('cf_value_not_imported_missing_cf_on_testproject'); - $messages['tsuite'] = lang_get('testsuite'); - } - - $cf2insert=null; - $resultMsg=null; - foreach($cfValues as $value) - { - if( isset($cfDefinition[$value['name']]) ) - { - $cf2insert[$cfDefinition[$value['name']]['id']]=array('type_id' => $cfDefinition[$value['name']]['type'], - 'cf_value' => $value['value']); - } - else - { - if( !isset($missingCfMsg[$value['name']]) ) - { - $missingCfMsg[$value['name']] = sprintf($messages['cfield'],$value['name'],$messages['tsuite']); - } - $resultMsg[] = array($tsuite['name'],$missingCfMsg[$value['name']]); - } - } - $tsuiteMgr->cfield_mgr->design_values_to_db($cf2insert,$tsuite['id'],null,'simple'); - return $resultMsg; -} -?> \ No newline at end of file +do_upload) { + + // check the uploaded file + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + + tLog('Uploaded file: ' . $source); + $doIt = false; + $gui->file_check = null; + if (($source != 'none') && ($source != '')) { + // ATTENTION: + // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using + // Firefox and Chrome. + if (! ($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes)) { + $gui->file_check['status_ok'] = 0; + $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'), + $_FILES['uploadedFile']['size'], $gui->importLimitBytes); + } + } + if ($doIt) { + $gui->file_check['status_ok'] = 1; + if (move_uploaded_file($source, $gui->dest)) { + tLog('Renamed uploaded file: ' . $source); + switch ($args->importType) { + case 'XML': + $pcheck_fn = "check_xml_tc_tsuite"; + $pimport_fn = "importTestCaseDataFromXML"; + break; + } + if (! is_null($pcheck_fn)) { + $gui->file_check = $pcheck_fn($gui->dest, $args->useRecursion); + } + } + if ($gui->file_check['status_ok'] && $pimport_fn) { + tLog('Check is Ok.'); + $opt = array(); + $opt['useRecursion'] = $args->useRecursion; + $opt['importIntoProject'] = $args->bIntoProject; + $opt['duplicateLogic'] = array( + 'hitCriteria' => $args->hit_criteria, + 'actionOnHit' => $args->action_on_duplicated_name + ); + $gui->resultMap = $pimport_fn($db, $gui->dest, + intval($args->container_id), intval($args->tproject_id), + intval($args->userID), $opt); + } + } elseif (is_null($gui->file_check)) { + + tLog('Missing upload file', 'WARNING'); + $gui->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + $args->importType = null; + } +} + +if ($args->useRecursion) { + $obj_mgr = new testsuite($db); + $gui->actionOptions = array( + 'update_last_version' => lang_get('update_last_testcase_version'), + 'generate_new' => lang_get('generate_new_testcase'), + 'create_new_version' => lang_get('create_new_testcase_version') + ); + + $gui->hitOptions = array( + 'name' => lang_get('same_name'), + 'internalID' => lang_get('same_internalID'), + 'externalID' => lang_get('same_externalID') + ); +} else { + $obj_mgr = new testcase($db); + $gui->actionOptions = array( + 'update_last_version' => lang_get('update_last_testcase_version'), + 'generate_new' => lang_get('generate_new_testcase'), + 'create_new_version' => lang_get('create_new_testcase_version') + ); + + $gui->hitOptions = array( + 'name' => lang_get('same_name'), + 'internalID' => lang_get('same_internalID'), + 'externalID' => lang_get('same_externalID') + ); +} + +$gui->testprojectName = $_SESSION['testprojectName']; +$gui->importTypes = $obj_mgr->get_import_file_types(); +$gui->action_on_duplicated_name = $args->action_on_duplicated_name; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: importTestCaseDataFromXML + * args : + * returns: + */ +function importTestCaseDataFromXML(&$db, $fileName, $parentID, $tproject_id, + $userID, $options = null) +{ + tLog('importTestCaseDataFromXML called for file: ' . $fileName); + $resultMap = null; + $my = array(); + $my['options'] = array( + 'useRecursion' => false, + 'importIntoProject' => 0, + 'duplicateLogic' => array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + ) + ); + $my['options'] = array_merge($my['options'], (array) $options); + foreach ($my['options'] as $varname => $value) { + $$varname = $value; + } + + if (file_exists($fileName)) { + $xml = @simplexml_load_file_wrapper($fileName); + if ($xml !== false) { + $xmlKeywords = $xml->xpath('//keywords'); + $kwMap = null; + if ($xmlKeywords) { + $tproject = new testproject($db); + $loop2do = count($xmlKeywords); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $tproject->importKeywordsFromSimpleXML($tproject_id, + $xmlKeywords[$idx]); + } + $kwMap = $tproject->get_keywords_map($tproject_id); + $kwMap = is_null($kwMap) ? null : array_flip($kwMap); + } + + if (! $useRecursion && ($xml->getName() == 'testcases')) { + $resultMap = importTestCasesFromSimpleXML($db, $xml, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic); + } + + if ($useRecursion && ($xml->getName() == 'testsuite')) { + $resultMap = importTestSuitesFromSimpleXML($db, $xml, + intval($parentID), intval($tproject_id), $userID, $kwMap, + $duplicateLogic, $importIntoProject); + } + } + } + return $resultMap; +} + +/* + * function: saveImportedTCData + * args : + * returns: + */ +function saveImportedTCData(&$db, $tcData, $tproject_id, $container_id, $userID, + $kwMap, + $duplicatedLogic = array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + )) +{ + static $messages; + static $fieldSizeCfg; + static $feedbackMsg; + static $tcaseMgr; + static $tproject_mgr; + static $req_mgr; + static $safeSizeCfg; + static $linkedCustomFields; + static $tprojectHas; + static $reqSpecSet; + static $getVersionOpt; + static $userObj; + + if (! $tcData) { + return; + } + + $hasCustomFieldsInfo = false; + $hasRequirements = false; + + if (is_null($messages)) { + $feedbackMsg = array(); + $messages = array(); + $fieldSizeCfg = config_get('field_size'); + + $tcaseMgr = new testcase($db); + $tcaseMgr->setTestProject($tproject_id); + + $tproject_mgr = new testproject($db); + $req_mgr = new requirement_mgr($db); + $userObj = new tlUser(); + + $k2l = array( + 'already_exists_updated', + 'original_name', + 'testcase_name_too_long', + 'start_warning', + 'end_warning', + 'testlink_warning', + 'hit_with_same_external_ID' + ); + foreach ($k2l as $k) { + $messages[$k] = lang_get($k); + } + + $messages['start_feedback'] = $messages['start_warning'] . "\n" . + $messages['testlink_warning'] . "\n"; + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['reqspec_warning'] = lang_get( + 'no_reqspec_defined_can_not_import'); + + $feedbackMsg['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + $feedbackMsg['tcase'] = lang_get('testcase'); + $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); + $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); + + // because name can be changed automatically during item creation + // to avoid name conflict adding a suffix automatically generated, + // is better to use a max size < max allowed size + $safeSizeCfg = new stdClass(); + $safeSizeCfg->testcase_name = ($fieldSizeCfg->testcase_name) * 0.8; + + // Get CF with scope design time and allowed for test cases linked to this test project + $linkedCustomFields = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $tproject_id, 1, null, 'testcase', null, 'name'); + $tprojectHas['customFields'] = ! is_null($linkedCustomFields); + + $reqSpecSet = $tproject_mgr->getReqSpec($tproject_id, null, + array( + 'RSPEC.id', + 'NH.name AS title', + 'RSPEC.doc_id as rspec_doc_id', + 'REQ.req_doc_id' + ), 'req_doc_id'); + $tprojectHas['reqSpec'] = (! is_null($reqSpecSet) && + count($reqSpecSet) > 0); + + $getVersionOpt = array( + 'output' => 'minimun' + ); + $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); + } + + $resultMap = array(); + $tc_qty = count($tcData); + $userIDCache = array(); + + for ($idx = 0; $idx < $tc_qty; $idx ++) { + $tc = $tcData[$idx]; + $name = $tc['name']; + $summary = $tc['summary']; + $steps = $tc['steps']; + + // I've changed value to use when order has not been provided + // from testcase:DEFAULT_ORDER to a counter, because with original solution + // an issue arise with 'save execution and go next' + // if use has not provided order I think is OK TestLink make any choice. + $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx + + 1); + $internalid = $tc['internalid']; + $preconditions = $tc['preconditions']; + $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; + $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; + + $externalid = $tc['externalid']; + if (intval($externalid) <= 0) { + $externalid = null; + } + + $personID = $userID; + if (! is_null($tc['author_login'])) { + if (isset($userIDCache[$tc['author_login']])) { + $personID = $userIDCache[$tc['author_login']]; + } else { + $userObj->login = $tc['author_login']; + if ($userObj->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) == + tl::OK) { + $personID = $userObj->dbID; + } + + // I will put always a valid userID on this cache, + // this way if author_login does not exit, and is used multiple times + // i will do check for existence JUST ONCE. + $userIDCache[$tc['author_login']] = $personID; + } + } + + $name_len = tlStringLen($name); + if ($name_len > $fieldSizeCfg->testcase_name) { + // Will put original name inside summary + $xx = $messages['start_feedback']; + $xx .= sprintf($messages['testcase_name_too_long'], $name_len, + $fieldSizeCfg->testcase_name) . "\n"; + $xx .= $messages['original_name'] . "\n" . $name . "\n" . + $messages['end_warning'] . "\n"; + $summary = nl2br($xx) . $summary; + $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); + } + + $kwIDs = null; + if (isset($tc['keywords']) && $tc['keywords']) { + $kwIDs = implode(",", buildKeywordList($kwMap, $tc['keywords'])); + } + + $doCreate = true; + if ($duplicatedLogic['actionOnHit'] == 'update_last_version') { + switch ($duplicatedLogic['hitCriteria']) { + case 'name': + $info = $tcaseMgr->getDuplicatesByName($name, $container_id); + break; + + case 'internalID': + $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $internalid, $container_id); + if (! is_null($dummy)) { + $info = null; // TICKET 4925 + $info[$internalid] = $dummy; + } + break; + + case 'externalID': + $info = $tcaseMgr->get_by_external($externalid, + $container_id); + break; + } + + if (! is_null($info)) { + $tcase_qty = count($info); + switch ($tcase_qty) { + case 1: + $doCreate = false; + $tcase_id = key($info); + $last_version = $tcaseMgr->getLastVersionInfo($tcase_id, + $getVersionOpt); + $tcversion_id = $last_version['id']; + $ret = $tcaseMgr->update($tcase_id, $tcversion_id, $name, + $summary, $preconditions, $steps, $personID, $kwIDs, + $node_order, $exec_type, $importance); + + $ret['id'] = $tcase_id; + $ret['tcversion_id'] = $tcversion_id; + $resultMap[] = array( + $name, + $messages['already_exists_updated'] + ); + break; + + case 0: + $doCreate = true; + break; + + default: + $doCreate = false; + break; + } + } + } + + if ($doCreate) { + // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. + $item_id = intval( + $tcaseMgr->getInternalID($externalid, + array( + 'tproject_id' => $tproject_id + ))); + if ($item_id > 0) { + // who is his parent ? + $owner = $tcaseMgr->getTestSuite($item_id); + if ($owner != $container_id) { + // Get full path of existent Test Cases + $stain = $tcaseMgr->tree_manager->get_path($item_id, null, + 'name'); + $n = count($stain); + $stain[$n - 1] = $tcasePrefix . + config_get('testcase_cfg')->glue_character . $externalid . + ':' . $stain[$n - 1]; + $stain = implode('/', $stain); + + $resultMap[] = array( + $name, + $messages['hit_with_same_external_ID'] . $stain + ); + $doCreate = false; + } + } + } + if ($doCreate) { + $createOptions = array( + 'check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, + 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], + 'external_id' => $externalid + ); + + if ($ret = $tcaseMgr->create($container_id, $name, $summary, + $preconditions, $steps, $personID, $kwIDs, $node_order, + testcase::AUTOMATIC_ID, $exec_type, $importance, $createOptions)) { + $resultMap[] = array( + $name, + $ret['msg'] + ); + } + } + + // Custom Fields Management + // Check if CF with this name and that can be used on Test Cases is defined in current Test Project. + // If Check fails => give message to user. + // Else Import CF data + $hasCustomFieldsInfo = (isset($tc['customfields']) && + ! is_null($tc['customfields'])); + if ($hasCustomFieldsInfo && ! is_null($ret)) { + if ($tprojectHas['customFields']) { + $msg = processCustomFields($tcaseMgr, $name, + $ret['tcversion_id'], $tc['customfields'], + $linkedCustomFields, $feedbackMsg); + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } else { + // Can not import Custom Fields Values, give feedback + $msg[] = array( + $name, + $messages['cf_warning'] + ); + $resultMap = array_merge($resultMap, $msg); + } + } + + // BUGID - 20090205 - franciscom + // Requirements Management + // Check if Requirement ... + // If Check fails => give message to user. + // Else Import + $hasRequirements = (isset($tc['requirements']) && + ! is_null($tc['requirements'])); + if ($hasRequirements) { + if ($tprojectHas['reqSpec']) { + $msg = processRequirements($db, $req_mgr, $name, $ret['id'], + $tc['requirements'], $reqSpecSet, $feedbackMsg); + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } else { + $msg[] = array( + $name, + $messages['reqspec_warning'] + ); + $resultMap = array_merge($resultMap, $msg); + } + } + } + return $resultMap; +} + +/* + * function: buildKeywordList + * args : + * returns: + */ +function buildKeywordList($kwMap, $keywords) +{ + $items = array(); + $loop2do = count($keywords); + for ($jdx = 0; $jdx < $loop2do; $jdx ++) { + $items[] = $kwMap[trim($keywords[$jdx]['name'])]; + } + return $items; +} + +/* + * function: Check if at least the file starts seems OK + */ +function checkXMLTCTsuite($fileName, $recursiveMode) +{ + $xml = @simplexml_load_file_wrapper($fileName); + $file_check = array( + 'status_ok' => 0, + 'msg' => 'xml_load_ko' + ); + if ($xml !== false) { + $file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $elementName = $xml->getName(); + if ($recursiveMode) { + if ($elementName != 'testsuite') { + $file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('wrong_xml_tsuite_file') + ); + } + } else { + if ($elementName != 'testcases' && $elementName != 'testcase') { + $file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('wrong_xml_tcase_file') + ); + } + } + } + return $file_check; +} + +/* + * contribution by mirosvad - + * Convert new line characters from XLS to HTML + */ +function nl2p($str) +{ + return str_replace('

    ', '', + '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); // MS +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $key = 'action_on_duplicated_name'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'generate_new'; + + $key = 'hit_criteria'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'name'; + + $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; + $args->useRecursion = isset($_REQUEST['useRecursion']) ? $_REQUEST['useRecursion'] : 0; + $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; + $args->container_id = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : 0; + $args->bIntoProject = isset($_REQUEST['bIntoProject']) ? intval( + $_REQUEST['bIntoProject']) : 0; + + $args->containerType = isset($_REQUEST['containerType']) ? intval( + $_REQUEST['containerType']) : 0; + $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; + + $args->userID = $_SESSION['userID']; + $args->tproject_id = $_SESSION['testprojectID']; + + return $args; +} + +/** + * processCustomFields + * + * Analise custom field info related to test case being imported. + * If everything OK, assign to test case. + * Else return an array of messages. + * + * + * @internal revisions + * 20100905 - franciscom - BUGID 3431 - Custom Field values at Test Case VERSION Level + */ +function processCustomFields(&$tcaseMgr, $tcaseName, $tcversionId, $cfValues, + $cfDefinition, $messages) +{ + static $missingCfMsg; + $cf2insert = null; + $resultMsg = null; + + foreach ($cfValues as $value) { + if (isset($cfDefinition[$value['name']])) { + $cf2insert[$cfDefinition[$value['name']]['id']] = array( + 'type_id' => $cfDefinition[$value['name']]['type'], + 'cf_value' => $value['value'] + ); + } else { + if (! isset($missingCfMsg[$value['name']])) { + $missingCfMsg[$value['name']] = sprintf($messages['cfield'], + $value['name'], $messages['tcase']); + } + $resultMsg[] = array( + $tcaseName, + $missingCfMsg[$value['name']] + ); + } + } + + new dBug($cf2insert); + new dBug($tcversionId); + $tcaseMgr->cfield_mgr->design_values_to_db($cf2insert, $tcversionId, null, + 'simple'); + return $resultMsg; +} + +/** + * processRequirements + * + * Analise requirements info related to test case being imported. + * If everything OK, assign to test case. + * Else return an array of messages. + * + * 20100911 - amitkhullar - BUGID 3764 + */ +function processRequirements(&$dbHandler, &$reqMgr, $tcaseName, $tcaseId, $tcReq, + $reqSpecSet, $messages) +{ + static $missingReqMsg; + static $missingReqSpecMsg; + static $cachedReqSpec; + $resultMsg = null; + $tables = tlObjectWithDB::getDBTables(array( + 'requirements' + )); + + foreach ($tcReq as $value) { + $cachedReqSpec = array(); + $doit = false; + if ($doit = isset($reqSpecSet[$value['doc_id']]) && + ! (isset($cachedReqSpec[$value['req_spec_title']]))) { + // $cachedReqSpec + // key: Requirement Specification Title + // value: map with follogin keys + // id => requirement specification id + // req => map with key: requirement document id + $cachedReqSpec[$value['req_spec_title']]['id'] = $reqSpecSet[$value['doc_id']]['id']; + $cachedReqSpec[$value['req_spec_title']]['req'] = null; + } + + if ($doit) { + $useit = false; + $req_spec_id = $cachedReqSpec[$value['req_spec_title']]['id']; + + // Check if requirement with desired document id exists on requirement specification. + // If not => create message for user feedback. + if (! ($useit = isset( + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']]))) { + $sql = " SELECT REQ.id from {$tables['requirements']} REQ " . + " WHERE REQ.req_doc_id='{$dbHandler->prepare_string($value['doc_id'])}' " . + " AND REQ.srs_id={$req_spec_id} "; + + $rsx = $dbHandler->get_recordset($sql); + if ($useit = ((! empty($rsx)) ? true : false)) { + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']] = $rsx[0]['id']; + } + } + + if ($useit) { + $reqMgr->assign_to_tcase( + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']], + $tcaseId); + } else { + if (! isset($missingReqMsg[$value['doc_id']])) { + $missingReqMsg[$value['doc_id']] = sprintf($messages['req'], + $value['doc_id'], $value['req_spec_title']); + } + $resultMsg[] = array( + $tcaseName, + $missingReqMsg[$value['doc_id']] + ); + } + } else { + // Requirement Specification not found + if (! isset($missingReqSpecMsg[$value['req_spec_title']])) { + $missingReqSpecMsg[$value['req_spec_title']] = sprintf( + $messages['req_spec'], $value['req_spec_title']); + } + $resultMsg[] = array( + $tcaseName, + $missingReqSpecMsg[$value['req_spec_title']] + ); + } + } // foreach + + return $resultMsg; +} + +/** + */ +function importTestCasesFromSimpleXML(&$db, &$simpleXMLObj, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic) +{ + $resultMap = null; + $xmlTCs = $simpleXMLObj->xpath('//testcase'); + $tcData = getTestCaseSetFromSimpleXMLObj($xmlTCs); + if ($tcData) { + $resultMap = saveImportedTCData($db, $tcData, $tproject_id, $parentID, + $userID, $kwMap, $duplicateLogic); + } + return $resultMap; +} + +/** + * + * @internal revisions + * 20100317 - added internalid - BUGID 3236 + */ +function getTestCaseSetFromSimpleXMLObj($xmlTCs) +{ + $tcSet = null; + if (! $xmlTCs) { + return $tcSet; + } + + $jdx = 0; + $loops2do = count($xmlTCs); + $tcaseSet = array(); + + // TICKET 4963: Test case / Tes suite XML format, new element to set author + $tcXML['elements'] = array( + 'string' => array( + "summary" => null, + "preconditions" => null, + "author_login" => null + ), + 'integer' => array( + "node_order" => null, + "externalid" => null, + "execution_type" => null, + "importance" => null + ) + ); + $tcXML['attributes'] = array( + 'string' => array( + "name" => 'trim' + ), + 'integer' => array( + 'internalid' => null + ) + ); + + for ($idx = 0; $idx < $loops2do; $idx ++) { + $dummy = getItemsFromSimpleXMLObj(array( + $xmlTCs[$idx] + ), $tcXML); + $tc = $dummy[0]; + + if ($tc) { + // Test Case Steps + $steps = getStepsFromSimpleXMLObj($xmlTCs[$idx]->steps->step); + $tc['steps'] = $steps; + + $keywords = getKeywordsFromSimpleXMLObj( + $xmlTCs[$idx]->keywords->keyword); + if ($keywords) { + $tc['keywords'] = $keywords; + } + + $cf = getCustomFieldsFromSimpleXMLObj( + $xmlTCs[$idx]->custom_fields->custom_field); + if ($cf) { + $tc['customfields'] = $cf; + } + + $requirements = getRequirementsFromSimpleXMLObj( + $xmlTCs[$idx]->requirements->requirement); + if ($requirements) { + $tc['requirements'] = $requirements; + } + } + $tcaseSet[$jdx ++] = $tc; + } + return $tcaseSet; +} + +/** + * + * @internal revisions + * 20100821 - franciscom - BUGID 3695 - added "execution_type" + */ +function getStepsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "actions" => null, + "expectedresults" => null + ), + 'integer' => array( + "step_number" => null, + "execution_type" => null + ) + ); + + // 20110205 - franciscom - seems key 'transformations' is not managed on + // getItemsFromSimpleXMLObj(), then ??? is useless??? + $itemStructure['transformations'] = array( + "expectedresults" => "expected_results" + ); + + $items = getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); + + // need to do this due to (maybe) a wrong name choice for XML element + if (! is_null($items)) { + $loop2do = count($items); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $items[$idx]['expected_results'] = ''; + if (isset($items[$idx]['expectedresults'])) { + $items[$idx]['expected_results'] = $items[$idx]['expectedresults']; + unset($items[$idx]['expectedresults']); + } + } + } + return $items; +} + +function getCustomFieldsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "name" => 'trim', + "value" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +function getRequirementsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "req_spec_title" => 'trim', + "doc_id" => 'trim', + "title" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +function getKeywordsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "notes" => null + ) + ); + $itemStructure['attributes'] = array( + 'string' => array( + "name" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +/* + * function: importTestSuite + * args : + * returns: + * + * @internal revisions + * 20120623 - franciscom - TICKET 5070 - test suite custom fields import + * + */ +function importTestSuitesFromSimpleXML(&$dbHandler, &$xml, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic, $importIntoProject = 0) +{ + static $tsuiteXML; + static $tsuiteMgr; + static $myself; + static $cfSpec; + static $doCF; + + $resultMap = array(); + if (is_null($tsuiteXML)) { + $myself = __FUNCTION__; + $tsuiteXML = array(); + $tsuiteXML['elements'] = array( + 'string' => array( + "details" => null + ), + 'integer' => array( + "node_order" => null + ) + ); + $tsuiteXML['attributes'] = array( + 'string' => array( + "name" => 'trim' + ) + ); + + $tsuiteMgr = new testsuite($dbHandler); + $doCF = ! is_null( + ($cfSpec = $tsuiteMgr->get_linked_cfields_at_design(null, null, null, + $tproject_id, 'name'))); + } + + if ($xml->getName() == 'testsuite') { + + // getItemsFromSimpleXMLObj() first argument must be an array + $dummy = getItemsFromSimpleXMLObj(array( + $xml + ), $tsuiteXML); + $tsuite = current($dummy); + $tsuiteID = $parentID; // hmmm, not clear + + if ($tsuite['name'] != "") { + // Check if Test Suite with this name exists on this container + // if yes -> update instead of create + $info = $tsuiteMgr->get_by_name($tsuite['name'], $parentID); + if (is_null($info)) { + $ret = $tsuiteMgr->create($parentID, $tsuite['name'], + $tsuite['details'], $tsuite['node_order']); + $tsuite['id'] = $ret['id']; + } else { + $tsuiteMgr->update(($tsuite['id'] = $info[0]['id']), + $tsuite['name'], $tsuite['details'], null, + $tsuite['node_order']); + } + unset($dummy); + + $tsuiteID = $tsuite['id']; // $tsuiteID is needed on more code pieces => DO NOT REMOVE + if (! $tsuite['id']) { + return null; + } + + if ($doCF) { + $cf = getCustomFieldsFromSimpleXMLObj( + $xml->custom_fields->custom_field); + if (! is_null($cf)) { + processTestSuiteCF($tsuiteMgr, $xml, $cfSpec, $cf, $tsuite, + $tproject_id); + } + } + + if ($keywords = getKeywordsFromSimpleXMLObj($xml->keywords->keyword)) { + $kwIDs = buildKeywordList($kwMap, $keywords); + $tsuiteMgr->addKeywords($tsuite['id'], $kwIDs); + } + + unset($tsuite); + } elseif ($importIntoProject) { + $tsuiteID = intval($tproject_id); + } + + $childrenNodes = $xml->children(); + $loop2do = count($childrenNodes); + + for ($idx = 0; $idx < $loop2do; $idx ++) { + $target = $childrenNodes[$idx]; + switch ($target->getName()) { + case 'testcase': + // getTestCaseSetFromSimpleXMLObj() first argument must be an array + $tcData = getTestCaseSetFromSimpleXMLObj(array( + $target + )); + $resultMap = array_merge($resultMap, + saveImportedTCData($dbHandler, $tcData, $tproject_id, + $tsuiteID, $userID, $kwMap, $duplicateLogic)); + unset($tcData); + break; + + case 'testsuite': + $resultMap = array_merge($resultMap, + $myself($dbHandler, $target, $tsuiteID, $tproject_id, + $userID, $kwMap, $importIntoProject, $duplicateLogic)); + break; + + // Important Development Notice + // Due to XML file structure, while looping + // we will find also this children: + // node_order,keywords,custom_fields,details + // + // It's processing to get and save values is done + // on other pieces of this code. + // + // Form a logical point of view seems the better + // to consider and process here testcase and testsuite as children. + } + } + } + return $resultMap; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); + $guiObj->hitCriteria = $argsObj->hit_criteria; + $guiObj->useRecursion = $argsObj->useRecursion; + $guiObj->containerID = $argsObj->container_id; + $guiObj->bImport = tlStringLen($argsObj->importType); + $guiObj->bIntoProject = $argsObj->bIntoProject; + $guiObj->resultMap = null; + $guiObj->container_name = ''; + + $dest_common = TL_TEMP_PATH . session_id() . "-importtcs"; + $dest_files = array( + 'XML' => $dest_common . ".xml" + ); + $guiObj->dest = $dest_files['XML']; + if (! is_null($argsObj->importType)) { + $guiObj->dest = $dest_files[$argsObj->importType]; + } + + $guiObj->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + + if ($argsObj->useRecursion) { + $guiObj->import_title = lang_get('title_tsuite_import_to'); + $guiObj->container_description = lang_get('test_suite'); + } else { + $guiObj->import_title = lang_get('title_tc_import_to'); + $guiObj->container_description = lang_get('test_case'); + } + + if ($argsObj->container_id) { + $tree_mgr = new tree($dbHandler); + $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); + unset($tree_mgr); + $guiObj->container_name = $node_info['name']; + if ($argsObj->container_id == $argsObj->tproject_id) { + $guiObj->container_description = lang_get('testproject'); + } + } + + return $guiObj; +} + +/** + * + * @internal revisions + * @since 1.9.4 + * + */ +function processTestSuiteCF(&$tsuiteMgr, $xmlObj, &$cfDefinition, &$cfValues, + $tsuite, $tproject_id) +{ + static $messages; + static $missingCfMsg; + + if (is_null($messages)) { + $messages = array(); + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['start_warning'] = lang_get('start_warning'); + $messages['end_warning'] = lang_get('end_warning'); + $messages['testlink_warning'] = lang_get('testlink_warning'); + $messages['start_feedback'] = $messages['start_warning'] . "\n" . + $messages['testlink_warning'] . "\n"; + $messages['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + $messages['tsuite'] = lang_get('testsuite'); + } + + $cf2insert = null; + $resultMsg = null; + foreach ($cfValues as $value) { + if (isset($cfDefinition[$value['name']])) { + $cf2insert[$cfDefinition[$value['name']]['id']] = array( + 'type_id' => $cfDefinition[$value['name']]['type'], + 'cf_value' => $value['value'] + ); + } else { + if (! isset($missingCfMsg[$value['name']])) { + $missingCfMsg[$value['name']] = sprintf($messages['cfield'], + $value['name'], $messages['tsuite']); + } + $resultMsg[] = array( + $tsuite['name'], + $missingCfMsg[$value['name']] + ); + } + } + $tsuiteMgr->cfield_mgr->design_values_to_db($cf2insert, $tsuite['id'], null, + 'simple'); + return $resultMsg; +} +?> diff --git a/lib/testcases/tcCreateFromIssueMantisXML.php b/lib/testcases/tcCreateFromIssueMantisXML.php index 630ca8f252..f8797a49b9 100644 --- a/lib/testcases/tcCreateFromIssueMantisXML.php +++ b/lib/testcases/tcCreateFromIssueMantisXML.php @@ -1,526 +1,546 @@ - - * - * - * 21 - * testlink-test - * administrator - * normal - * minor - * have not tried - * new - * open - * none - * FromTestLink - * 1365184242 - * 1365184242 - * none - * V1 - * public - * ISSUE-V1 - * 1 - * ISSUE-V1 - * - * - * 20 - * testlink-test - * - * @internal revisions - * @since 1.9.7 - * - */ -require('../../config.inc.php'); -require_once('common.php'); -require_once('xml.inc.php'); - - -testlinkInitPage($db); -$templateCfg = templateConfiguration(); -$pcheck_fn=null; -$args = init_args(); -$gui = initializeGui($db,$args); - -if ($args->do_upload) -{ - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - tLog('Uploaded file: '.$source); - $doIt = false; - $gui->file_check = null; - if (($source != 'none') && ($source != '')) - { - // ATTENTION: - // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using - // Firefox and Chrome. - if( !($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes) ) - { - $gui->file_check['status_ok'] = 0; - $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'),$_FILES['uploadedFile']['size'],$gui->importLimitBytes); - } - } - if($doIt) - { - $gui->file_check['status_ok'] = 1; - if (move_uploaded_file($source, $gui->dest)) - { - tLog('Renamed uploaded file: ' . $source); - } - tLog('Check is Ok.'); - $opt = array(); - $gui->resultMap = importIssueFromXML($db,$gui->dest,intval($args->container_id), - intval($args->tproject_id),intval($args->userID),$opt); - } - else if(is_null($gui->file_check)) - { - - tLog('Missing upload file','WARNING'); - $gui->file_check = array('status_ok' => 0, 'msg' => lang_get('please_choose_file_to_import')); - $args->importType = null; - } -} - - -$gui->testprojectName = $args->tproject_name; -$gui->importTypes = array('XML' => 'Mantis XML'); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -// -------------------------------------------------------------------------------------- -/* - function: - args : - returns: -*/ -function importIssueFromXML(&$db,$fileName,$parentID,$tproject_id,$userID,$options=null) -{ - $xmlTCs = null; - $resultMap = null; - $my = array(); - $my['options'] = array('useRecursion' => false, 'importIntoProject' => 0, - 'duplicateLogic' => array('hitCriteria' => 'name', 'actionOnHit' => null)); - $my['options'] = array_merge($my['options'], (array)$options); - foreach($my['options'] as $varname => $value) - { - $$varname = $value; - } - - if (file_exists($fileName)) - { - $xml = @simplexml_load_file_wrapper($fileName); - if($xml !== FALSE) - { - $resultMap = importTestCasesFromIssueSimpleXML($db,$xml,$parentID,$tproject_id,$userID,null,$duplicateLogic); - } - } - return $resultMap; -} - - -// -------------------------------------------------------------------------------------- -/* - function: saveImportedTCData - args : - returns: -*/ -function saveImportedTCData(&$db,$tcData,$tproject_id,$container_id, - $userID,$kwMap,$duplicatedLogic = array('hitCriteria' => 'name', 'actionOnHit' => null)) -{ - static $messages; - static $fieldSizeCfg; - static $feedbackMsg; - static $tcase_mgr; - static $tproject_mgr; - static $req_spec_mgr; - static $req_mgr; - static $safeSizeCfg; - static $linkedCustomFields; - static $tprojectHas; - static $reqSpecSet; - static $getVersionOpt; - static $userObj; - - if (!$tcData) - { - return; - } - - // $tprojectHas = array('customFields' => false, 'reqSpec' => false); - $hasCustomFieldsInfo = false; - $hasRequirements = false; - - if(is_null($messages)) - { - $feedbackMsg = array(); - $messages = array(); - $fieldSizeCfg = config_get('field_size'); - - $tcase_mgr = new testcase($db); - $tproject_mgr = new testproject($db); - $req_spec_mgr = new requirement_spec_mgr($db); - $req_mgr = new requirement_mgr($db); - $userObj = new tlUser(); - - $k2l = array('already_exists_updated','original_name','testcase_name_too_long', - 'start_warning','end_warning','testlink_warning','hit_with_same_external_ID'); - foreach($k2l as $k) - { - $messages[$k] = lang_get($k); - } - - $messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n"; - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['reqspec_warning'] = lang_get('no_reqspec_defined_can_not_import'); - - - - $feedbackMsg['cfield']=lang_get('cf_value_not_imported_missing_cf_on_testproject'); - $feedbackMsg['tcase'] = lang_get('testcase'); - $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); - $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); - - - // because name can be changed automatically during item creation - // to avoid name conflict adding a suffix automatically generated, - // is better to use a max size < max allowed size - $safeSizeCfg = new stdClass(); - $safeSizeCfg->testcase_name=($fieldSizeCfg->testcase_name) * 0.8; - - - // Get CF with scope design time and allowed for test cases linked to this test project - $linkedCustomFields = $tcase_mgr->cfield_mgr->get_linked_cfields_at_design($tproject_id,1,null,'testcase',null,'name'); - $tprojectHas['customFields']=!is_null($linkedCustomFields); - - $reqSpecSet = $tproject_mgr->getReqSpec($tproject_id,null,array('RSPEC.id','NH.name AS title','RSPEC.doc_id as rspec_doc_id', 'REQ.req_doc_id'),'req_doc_id'); - $tprojectHas['reqSpec'] = (!is_null($reqSpecSet) && count($reqSpecSet) > 0); - - $getVersionOpt = array('output' => 'minimun'); - $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); - } - - $resultMap = array(); - $tc_qty = sizeof($tcData); - $userIDCache = array(); - - for($idx = 0; $idx <$tc_qty ; $idx++) - { - $tc = $tcData[$idx]; - $name = $tc['name']; - $summary = $tc['summary']; - $steps = $tc['steps']; - - // I've changed value to use when order has not been provided - // from testcase:DEFAULT_ORDER to a counter, because with original solution - // an issue arise with 'save execution and go next' - // if use has not provided order I think is OK TestLink make any choice. - $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx+1); - $internalid = $tc['internalid']; - $preconditions = $tc['preconditions']; - $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; - $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; - - $externalid = $tc['externalid']; - if( intval($externalid) <= 0 ) - { - $externalid = null; - } - - $personID = $userID; - if( !is_null($tc['author_login']) ) - { - if( isset($userIDCache[$tc['author_login']]) ) - { - $personID = $userIDCache[$tc['author_login']]; - } - else - { - $userObj->login = $tc['author_login']; - if( $userObj->readFromDB($db,tlUser::USER_O_SEARCH_BYLOGIN) == tl::OK ) - { - $personID = $userObj->dbID; - } - - // I will put always a valid userID on this cache, - // this way if author_login does not exit, and is used multiple times - // i will do check for existence JUST ONCE. - $userIDCache[$tc['author_login']] = $personID; - } - } - - $name_len = tlStringLen($name); - if($name_len > $fieldSizeCfg->testcase_name) - { - // Will put original name inside summary - $xx = $messages['start_feedback']; - $xx .= sprintf($messages['testcase_name_too_long'],$name_len, $fieldSizeCfg->testcase_name) . "\n"; - $xx .= $messages['original_name'] . "\n" . $name. "\n" . $messages['end_warning'] . "\n"; - $summary = nl2br($xx) . $summary; - $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); - } - - - $kwIDs = null; - if (isset($tc['keywords']) && $tc['keywords']) - { - $kwIDs = implode(",",buildKeywordList($kwMap,$tc['keywords'])); - } - - $doCreate=true; - if( $duplicatedLogic['actionOnHit'] == 'update_last_version' ) - { - switch($duplicatedLogic['hitCriteria']) - { - case 'name': - $info = $tcase_mgr->getDuplicatesByName($name,$container_id); - break; - - case 'internalID': - $dummy = $tcase_mgr->tree_manager->get_node_hierarchy_info($internalid,$container_id); - if( !is_null($dummy) ) - { - $info = null; - $info[$internalid] = $dummy; - } - break; - - case 'externalID': - $info = $tcase_mgr->get_by_external($externalid,$container_id); - break; - - - } - - if( !is_null($info) ) - { - $tcase_qty = count($info); - switch($tcase_qty) - { - case 1: - $doCreate=false; - $tcase_id = key($info); - $last_version = $tcase_mgr->get_last_version_info($tcase_id,$getVersionOpt); - $tcversion_id = $last_version['id']; - $ret = $tcase_mgr->update($tcase_id,$tcversion_id,$name,$summary, - $preconditions,$steps,$personID,$kwIDs, - $node_order,$exec_type,$importance); - - $ret['id'] = $tcase_id; - $ret['tcversion_id'] = $tcversion_id; - $resultMap[] = array($name,$messages['already_exists_updated']); - break; - - case 0: - $doCreate=true; - break; - - default: - $doCreate=false; - break; - } - } - } - - if( $doCreate ) - { - // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. - $item_id = intval($tcase_mgr->getInternalID($externalid, array('tproject_id' => $tproject_id))); - if( $item_id > 0) - { - // who is his parent ? - $owner = $tcase_mgr->getTestSuite($item_id); - if( $owner != $container_id) - { - // Get full path of existent Test Cases - $stain = $tcase_mgr->tree_manager->get_path($item_id,null, 'name'); - $n = count($stain); - $stain[$n-1] = $tcasePrefix . config_get('testcase_cfg')->glue_character . $externalid . ':' . $stain[$n-1]; - $stain = implode('/',$stain); - - $resultMap[] = array($name,$messages['hit_with_same_external_ID'] . $stain); - $doCreate = false; - } - } - } - if( $doCreate ) - { - $createOptions = array('check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, - 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], - 'external_id' => $externalid); - - if ($ret = $tcase_mgr->create($container_id,$name,$summary,$preconditions,$steps, - $personID,$kwIDs,$node_order,testcase::AUTOMATIC_ID, - $exec_type,$importance,$createOptions)) - { - $resultMap[] = array($name,$ret['msg']); - } - } - - } - return $resultMap; -} - - - -/* contribution by mirosvad - - Convert new line characters from XLS to HTML -*/ -function nl2p($str) -{ - return str_replace('

    ', '', '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); //MS -} - - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; - $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; - $args->container_id = isset($_REQUEST['containerID']) ? intval($_REQUEST['containerID']) : 0; - $args->containerType = isset($_REQUEST['containerType']) ? intval($_REQUEST['containerType']) : 0; - $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; - - $args->userID = intval($_SESSION['userID']); - $args->tproject_id = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; - - - return $args; -} - - - -/** - * - * - */ -function importTestCasesFromIssueSimpleXML(&$db,&$simpleXMLObj,$parentID,$tproject_id,$userID,$kwMap,$duplicateLogic) -{ - $resultMap = null; - $tcData = getTestCaseSetFromIssueSimpleXMLObj($simpleXMLObj); - if ($tcData) - { - $resultMap = saveImportedTCData($db,$tcData,$tproject_id,$parentID,$userID,$kwMap,$duplicateLogic); - } - return $resultMap; -} - -/** - * - * - * @internal revisions - * 20100317 - added internalid - BUGID 3236 - */ -function getTestCaseSetFromIssueSimpleXMLObj($xmlObj) -{ - $itemSet = null; - if (!$xmlObj) - { - return $itemSet; - } - - - $l18n = init_labels( array('issue_issue' => null, 'issue_steps_to_reproduce' => null, 'issue_summary' => null, - 'issue_target_version' => null,'issue_description' => null, - 'issue_additional_information' => null)); - - $jdx = 0; - $xmlIssue = $xmlObj->issue; - $loops2do=sizeof($xmlIssue); - - $XMLDef['elements'] = array('string' => array('summary' => null,'description' => null, - 'additional_information' => null, - 'steps_to_reproduce' => null, - 'target_version' => null, 'id' => null)); - $itemSet = array(); - $nl = "

    "; - for($idx = 0; $idx < $loops2do; $idx++) - { - $dummy = getItemsFromSimpleXMLObj(array($xmlIssue[$idx]),$XMLDef); - $dummy = $dummy[0]; - - $isum = $l18n['issue_description'] . $nl . $dummy['description']; - if(!is_null($dummy['steps_to_reproduce'])) - { - $isum .= $nl . $l18n['issue_steps_to_reproduce'] . $nl . $dummy['steps_to_reproduce']; - } - if(!is_null($dummy['additional_information'])) - { - $isum .= $nl . $l18n['issue_additional_information'] . $nl . $dummy['additional_information']; - } - - $itemSet[$jdx++] = array('name' => ($l18n['issue_issue'] . ':' . $dummy['id'] . ' - ' . $dummy['summary']), - 'summary' => $isum, 'steps' => null, 'internalid' => null, 'externalid' => null, - 'author_login' => null, 'preconditions' => null); - } - return $itemSet; -} - - - - -/** - * - * - * - **/ -function initializeGui(&$dbHandler,&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); - $guiObj->containerID = $argsObj->container_id; - $guiObj->refreshTree = $guiObj->doImport = tlStringLen($argsObj->importType); - $guiObj->resultMap = null; - $guiObj->container_name = ''; - $guiObj->file_check = array('status_ok' => 1, 'msg' => 'ok'); - $guiObj->import_title = lang_get('title_tc_import_to'); - $guiObj->container_description = lang_get('test_case'); - - $dest_common = TL_TEMP_PATH . session_id(). "-importtcs"; - $dest_files = array('XML' => $dest_common . ".xml"); - $guiObj->dest = $dest_files['XML']; - if(!is_null($argsObj->importType)) - { - $guiObj->dest = $dest_files[$argsObj->importType]; - } - - if($argsObj->container_id) - { - $tree_mgr = new tree($dbHandler); - $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); - unset($tree_mgr); - $guiObj->container_name = $node_info['name']; - if($argsObj->container_id == $argsObj->tproject_id) - { - $guiObj->container_description = lang_get('testproject'); - } - } - - return $guiObj; -} - -?> \ No newline at end of file + + * + * + * 21 + * testlink-test + * administrator + * normal + * minor + * have not tried + * new + * open + * none + * FromTestLink + * 1365184242 + * 1365184242 + * none + * V1 + * public + *

    ISSUE-V1 + * 1 + * ISSUE-V1 + *
    + * + * 20 + * testlink-test + * + * @internal revisions + * @since 1.9.7 + * + */ +require_once '../../config.inc.php'; +require_once 'common.php'; +require_once 'xml.inc.php'; + +testlinkInitPage($db); +$templateCfg = templateConfiguration(); +$pcheck_fn = null; +$args = initArgs(); +$gui = initializeGui($db, $args); + +if ($args->do_upload) { + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + tLog('Uploaded file: ' . $source); + $doIt = false; + $gui->file_check = null; + + // ATTENTION: + // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using + // Firefox and Chrome. + if (($source != 'none') && ($source != '') && + ! ($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes)) { + $gui->file_check['status_ok'] = 0; + $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'), + $_FILES['uploadedFile']['size'], $gui->importLimitBytes); + } + if ($doIt) { + $gui->file_check['status_ok'] = 1; + if (move_uploaded_file($source, $gui->dest)) { + tLog('Renamed uploaded file: ' . $source); + } + tLog('Check is Ok.'); + $opt = array(); + $gui->resultMap = importIssueFromXML($db, $gui->dest, + intval($args->container_id), intval($args->tproject_id), + intval($args->userID), $opt); + } elseif (is_null($gui->file_check)) { + + tLog('Missing upload file', 'WARNING'); + $gui->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + $args->importType = null; + } +} + +$gui->testprojectName = $args->tproject_name; +$gui->importTypes = array( + 'XML' => 'Mantis XML' +); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: + * args : + * returns: + */ +function importIssueFromXML(&$db, $fileName, $parentID, $tproject_id, $userID, + $options = null) +{ + $resultMap = null; + $my = array(); + $my['options'] = array( + 'useRecursion' => false, + 'importIntoProject' => 0, + 'duplicateLogic' => array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + ) + ); + $my['options'] = array_merge($my['options'], (array) $options); + foreach ($my['options'] as $varname => $value) { + $$varname = $value; + } + + if (file_exists($fileName)) { + $xml = @simplexml_load_file_wrapper($fileName); + if ($xml !== false) { + $resultMap = importTestCasesFromIssueSimpleXML($db, $xml, $parentID, + $tproject_id, $userID, null, $duplicateLogic); + } + } + return $resultMap; +} + +/* + * function: saveImportedTCData + * args : + * returns: + */ +function saveImportedTCData(&$db, $tcData, $tproject_id, $container_id, $userID, + $kwMap, + $duplicatedLogic = array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + )) +{ + static $messages; + static $fieldSizeCfg; + static $feedbackMsg; + static $tcaseMgr; + static $tproject_mgr; + static $safeSizeCfg; + static $linkedCustomFields; + static $tprojectHas; + static $reqSpecSet; + static $getVersionOpt; + static $userObj; + + if (! $tcData) { + return; + } + + if (is_null($messages)) { + $feedbackMsg = array(); + $messages = array(); + $fieldSizeCfg = config_get('field_size'); + + $tcaseMgr = new testcase($db); + $tproject_mgr = new testproject($db); + $userObj = new tlUser(); + + $k2l = array( + 'already_exists_updated', + 'original_name', + 'testcase_name_too_long', + 'start_warning', + 'end_warning', + 'testlink_warning', + 'hit_with_same_external_ID' + ); + foreach ($k2l as $k) { + $messages[$k] = lang_get($k); + } + + $messages['start_feedback'] = $messages['start_warning'] . "\n" . + $messages['testlink_warning'] . "\n"; + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['reqspec_warning'] = lang_get( + 'no_reqspec_defined_can_not_import'); + + $feedbackMsg['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + $feedbackMsg['tcase'] = lang_get('testcase'); + $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); + $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); + + // because name can be changed automatically during item creation + // to avoid name conflict adding a suffix automatically generated, + // is better to use a max size < max allowed size + $safeSizeCfg = new stdClass(); + $safeSizeCfg->testcase_name = ($fieldSizeCfg->testcase_name) * 0.8; + + // Get CF with scope design time and allowed for test cases linked to this test project + $linkedCustomFields = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $tproject_id, 1, null, 'testcase', null, 'name'); + $tprojectHas['customFields'] = ! is_null($linkedCustomFields); + + $reqSpecSet = $tproject_mgr->getReqSpec($tproject_id, null, + array( + 'RSPEC.id', + 'NH.name AS title', + 'RSPEC.doc_id as rspec_doc_id', + 'REQ.req_doc_id' + ), 'req_doc_id'); + $tprojectHas['reqSpec'] = (! is_null($reqSpecSet) && + count($reqSpecSet) > 0); + + $getVersionOpt = array( + 'output' => 'minimun' + ); + $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); + } + + $resultMap = array(); + $tc_qty = count($tcData); + $userIDCache = array(); + + for ($idx = 0; $idx < $tc_qty; $idx ++) { + $tc = $tcData[$idx]; + $name = $tc['name']; + $summary = $tc['summary']; + $steps = $tc['steps']; + + // I've changed value to use when order has not been provided + // from testcase:DEFAULT_ORDER to a counter, because with original solution + // an issue arise with 'save execution and go next' + // if use has not provided order I think is OK TestLink make any choice. + $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx + + 1); + $internalid = $tc['internalid']; + $preconditions = $tc['preconditions']; + $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; + $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; + + $externalid = $tc['externalid']; + if (intval($externalid) <= 0) { + $externalid = null; + } + + $personID = $userID; + if (! is_null($tc['author_login'])) { + if (isset($userIDCache[$tc['author_login']])) { + $personID = $userIDCache[$tc['author_login']]; + } else { + $userObj->login = $tc['author_login']; + if ($userObj->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) == + tl::OK) { + $personID = $userObj->dbID; + } + + // I will put always a valid userID on this cache, + // this way if author_login does not exit, and is used multiple times + // i will do check for existence JUST ONCE. + $userIDCache[$tc['author_login']] = $personID; + } + } + + $name_len = tlStringLen($name); + if ($name_len > $fieldSizeCfg->testcase_name) { + // Will put original name inside summary + $xx = $messages['start_feedback']; + $xx .= sprintf($messages['testcase_name_too_long'], $name_len, + $fieldSizeCfg->testcase_name) . "\n"; + $xx .= $messages['original_name'] . "\n" . $name . "\n" . + $messages['end_warning'] . "\n"; + $summary = nl2br($xx) . $summary; + $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); + } + + $kwIDs = null; + if (isset($tc['keywords']) && $tc['keywords']) { + $kwIDs = implode(",", buildKeywordList($kwMap, $tc['keywords'])); + } + + $doCreate = true; + if ($duplicatedLogic['actionOnHit'] == 'update_last_version') { + switch ($duplicatedLogic['hitCriteria']) { + case 'name': + $info = $tcaseMgr->getDuplicatesByName($name, $container_id); + break; + + case 'internalID': + $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $internalid, $container_id); + if (! is_null($dummy)) { + $info = null; + $info[$internalid] = $dummy; + } + break; + + case 'externalID': + $info = $tcaseMgr->get_by_external($externalid, + $container_id); + break; + } + + if (! is_null($info)) { + $tcase_qty = count($info); + switch ($tcase_qty) { + case 1: + $doCreate = false; + $tcase_id = key($info); + $last_version = $tcaseMgr->getLastVersionInfo($tcase_id, + $getVersionOpt); + $tcversion_id = $last_version['id']; + $ret = $tcaseMgr->update($tcase_id, $tcversion_id, $name, + $summary, $preconditions, $steps, $personID, $kwIDs, + $node_order, $exec_type, $importance); + + $ret['id'] = $tcase_id; + $ret['tcversion_id'] = $tcversion_id; + $resultMap[] = array( + $name, + $messages['already_exists_updated'] + ); + break; + + case 0: + $doCreate = true; + break; + + default: + $doCreate = false; + break; + } + } + } + + if ($doCreate) { + // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. + $item_id = intval( + $tcaseMgr->getInternalID($externalid, + array( + 'tproject_id' => $tproject_id + ))); + if ($item_id > 0) { + // who is his parent ? + $owner = $tcaseMgr->getTestSuite($item_id); + if ($owner != $container_id) { + // Get full path of existent Test Cases + $stain = $tcaseMgr->tree_manager->get_path($item_id, null, + 'name'); + $n = count($stain); + $stain[$n - 1] = $tcasePrefix . + config_get('testcase_cfg')->glue_character . $externalid . + ':' . $stain[$n - 1]; + $stain = implode('/', $stain); + + $resultMap[] = array( + $name, + $messages['hit_with_same_external_ID'] . $stain + ); + $doCreate = false; + } + } + } + if ($doCreate) { + $createOptions = array( + 'check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, + 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], + 'external_id' => $externalid + ); + + if ($ret = $tcaseMgr->create($container_id, $name, $summary, + $preconditions, $steps, $personID, $kwIDs, $node_order, + testcase::AUTOMATIC_ID, $exec_type, $importance, $createOptions)) { + $resultMap[] = array( + $name, + $ret['msg'] + ); + } + } + } + return $resultMap; +} + +/* + * contribution by mirosvad - + * Convert new line characters from XLS to HTML + */ +function nl2p($str) +{ + return str_replace('

    ', '', + '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); // MS +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; + $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; + $args->container_id = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : 0; + $args->containerType = isset($_REQUEST['containerType']) ? intval( + $_REQUEST['containerType']) : 0; + $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; + + $args->userID = intval($_SESSION['userID']); + $args->tproject_id = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : null; + + return $args; +} + +/** + */ +function importTestCasesFromIssueSimpleXML(&$db, &$simpleXMLObj, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic) +{ + $resultMap = null; + $tcData = getTestCaseSetFromIssueSimpleXMLObj($simpleXMLObj); + if ($tcData) { + $resultMap = saveImportedTCData($db, $tcData, $tproject_id, $parentID, + $userID, $kwMap, $duplicateLogic); + } + return $resultMap; +} + +/** + * + * @internal revisions + * 20100317 - added internalid - BUGID 3236 + */ +function getTestCaseSetFromIssueSimpleXMLObj($xmlObj) +{ + $itemSet = null; + if (! $xmlObj) { + return $itemSet; + } + + $l18n = init_labels( + array( + 'issue_issue' => null, + 'issue_steps_to_reproduce' => null, + 'issue_summary' => null, + 'issue_target_version' => null, + 'issue_description' => null, + 'issue_additional_information' => null + )); + + $jdx = 0; + $xmlIssue = $xmlObj->issue; + $loops2do = count($xmlIssue); + + $xmlDef['elements'] = array( + 'string' => array( + 'summary' => null, + 'description' => null, + 'additional_information' => null, + 'steps_to_reproduce' => null, + 'target_version' => null, + 'id' => null + ) + ); + $itemSet = array(); + $nl = "

    "; + for ($idx = 0; $idx < $loops2do; $idx ++) { + $dummy = getItemsFromSimpleXMLObj(array( + $xmlIssue[$idx] + ), $xmlDef); + $dummy = $dummy[0]; + + $isum = $l18n['issue_description'] . $nl . $dummy['description']; + if (! is_null($dummy['steps_to_reproduce'])) { + $isum .= $nl . $l18n['issue_steps_to_reproduce'] . $nl . + $dummy['steps_to_reproduce']; + } + if (! is_null($dummy['additional_information'])) { + $isum .= $nl . $l18n['issue_additional_information'] . $nl . + $dummy['additional_information']; + } + + $itemSet[$jdx ++] = array( + 'name' => ($l18n['issue_issue'] . ':' . $dummy['id'] . ' - ' . + $dummy['summary']), + 'summary' => $isum, + 'steps' => null, + 'internalid' => null, + 'externalid' => null, + 'author_login' => null, + 'preconditions' => null + ); + } + return $itemSet; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); + $guiObj->containerID = $argsObj->container_id; + $guiObj->refreshTree = $guiObj->doImport = tlStringLen($argsObj->importType); + $guiObj->resultMap = null; + $guiObj->container_name = ''; + $guiObj->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $guiObj->import_title = lang_get('title_tc_import_to'); + $guiObj->container_description = lang_get('test_case'); + + $dest_common = TL_TEMP_PATH . session_id() . "-importtcs"; + $dest_files = array( + 'XML' => $dest_common . ".xml" + ); + $guiObj->dest = $dest_files['XML']; + if (! is_null($argsObj->importType)) { + $guiObj->dest = $dest_files[$argsObj->importType]; + } + + if ($argsObj->container_id) { + $tree_mgr = new tree($dbHandler); + $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); + unset($tree_mgr); + $guiObj->container_name = $node_info['name']; + if ($argsObj->container_id == $argsObj->tproject_id) { + $guiObj->container_description = lang_get('testproject'); + } + } + + return $guiObj; +} + +?> diff --git a/lib/testcases/tcEdit.php b/lib/testcases/tcEdit.php index 0b3bbce140..9e965134c7 100644 --- a/lib/testcases/tcEdit.php +++ b/lib/testcases/tcEdit.php @@ -1,856 +1,951 @@ -webEditorCfg['type'])); - -$templateCfg = templateConfiguration('tcEdit'); - -$commandMgr = new testcaseCommands($db,$args->user,$args->tproject_id); -$commandMgr->setTemplateCfg(templateConfiguration()); - -$testCaseEditorKeys = array('summary' => 'summary','preconditions' => 'preconditions'); -$init_inputs = true; -$opt_cfg = initializeOptionTransferCfg($optionTransferName,$args,$tproject_mgr); -$gui = initializeGui($db,$args,$cfg,$tcase_mgr,$tproject_mgr); - -$smarty = new TLSmarty(); - -$name_ok = 1; -$doRender = false; -$pfn = $args->doAction; - - -$testCaseEditorKeys = null; -switch($args->doAction) { - case "create": - case "edit": - case "doCreate": - $testCaseEditorKeys = array('summary' => 'summary','preconditions' => 'preconditions'); - break; - - - case "createStep": - case "editStep": - case "doCreateStep": - case "doCreateStepAndExit": - case "doCopyStep": - case "doUpdateStep": - case "doUpdateStepAndExit": - case "doUpdateStepAndInsert": - case "doDeleteStep": - case "doReorderSteps": - case "doInsertStep": - case "doResequenceSteps": - case "doStepOperationExit": - $testCaseEditorKeys = array('steps' => 'steps', 'expected_results' => 'expected_results'); - break; - -} - -switch($args->doAction) { - case "doUpdate": - case "doAdd2testplan": - case 'updateTPlanLinkToTCV': - $op = $commandMgr->$pfn($args,$_REQUEST); - break; - - case "create": - case "edit": - case "doCreate": - $op = $commandMgr->$pfn($args,$opt_cfg,array_keys($testCaseEditorKeys),$_REQUEST); - $doRender = true; - break; - - - case "delete": - case "doDelete": - case "createStep": - case "editStep": - case "doCreateStep": - case "doCreateStepAndExit": - case "doCopyStep": - case "doUpdateStep": - case "doUpdateStepAndExit": - case "doUpdateStepAndInsert": - case "doDeleteStep": - case "doReorderSteps": - case "doInsertStep": - case "doResequenceSteps": - case "setImportance": - case "setStatus": - case "setExecutionType": - case "setEstimatedExecDuration": - case "removeKeyword": - case "addKeyword": - case "freeze": - case "unfreeze": - case "doStepOperationExit": - case "removePlatform": - case "addPlatform": - $op = $commandMgr->$pfn($args,$_REQUEST); - $doRender = true; - break; - - case "fileUpload": - $args->uploadOp = fileUploadManagement($db,$args->tcversion_id,$args->fileTitle,$tcase_mgr->getAttachmentTableName()); - $commandMgr->show($args,$_REQUEST,array('status_ok' => true),['updateCFOnDB' => false]); - break; - - case "deleteFile": - $fileInfo = deleteAttachment($db,$args->file_id,false); - if( $args->tcversion_id == 0 && null != $fileInfo ) { - $args->tcversion_id = $fileInfo['fk_id']; - } - $commandMgr->show($args,$_REQUEST,array('status_ok' => true),['updateCFOnDB' => false]); - break; - - - case "doAddRelation": - case "doDeleteRelation": - $op = $commandMgr->$pfn($args,$_REQUEST); - $doRender = true; - break; - -} - - -if ( $doRender ) { - renderGui($args,$gui,$op,$templateCfg,$cfg,$testCaseEditorKeys); - exit(); -} - -// Things that one day will be managed by command file -if($args->delete_tc_version) { - $status_quo_map = $tcase_mgr->get_versions_status_quo($args->tcase_id); - $exec_status_quo = $tcase_mgr->get_exec_status($args->tcase_id); - $gui->delete_mode = 'single'; - $gui->delete_enabled = 1; - - $msg = ''; - $sq = null; - if(!is_null($exec_status_quo)) { - if(isset($exec_status_quo[$args->tcversion_id])) { - $sq = array($args->tcversion_id => $exec_status_quo[$args->tcversion_id]); - } - } - - if(intval($status_quo_map[$args->tcversion_id]['executed'])) { - $msg = lang_get('warning') . TITLE_SEP . lang_get('delete_linked_and_exec'); - } - else if(intval($status_quo_map[$args->tcversion_id]['linked'])) - { - $msg = lang_get('warning') . TITLE_SEP . lang_get('delete_linked'); - } - - $tcinfo = $tcase_mgr->get_by_id($args->tcase_id,$args->tcversion_id); - - $gui->main_descr = lang_get('title_del_tc') . - TITLE_SEP_TYPE3 . lang_get('version') . " " . $tcinfo[0]['version']; - $gui->testcase_name = $tcinfo[0]['name']; - $gui->testcase_id = $args->tcase_id; - $gui->tcversion_id = $args->tcversion_id; - $gui->delete_message = $msg; - $gui->exec_status_quo = $sq; - $gui->refreshTree = 0; - - $smarty->assign('gui',$gui); - $templateCfg = templateConfiguration('tcDelete'); - $smarty->display($templateCfg->template_dir . $templateCfg->default_template); -} else if($args->move_copy_tc) { - // need to get the testproject for the test case - $tproject_id = $tcase_mgr->get_testproject($args->tcase_id); - $the_tc_node = $tree_mgr->get_node_hierarchy_info($args->tcase_id); - $tc_parent_id = $the_tc_node['parent_id']; - $the_xx = $tproject_mgr->gen_combo_test_suites($tproject_id); - - $the_xx[$the_tc_node['parent_id']] .= ' (' . lang_get('current') . ')'; - $tc_info = $tcase_mgr->get_by_id($args->tcase_id); - - $container_qty = count($the_xx); - $gui->move_enabled = 1; - if ($container_qty == 1) { - // move operation is nonsense - $gui->move_enabled = 0; - } - - $gui->top_checked = 'checked=checked'; - $gui->bottom_checked = ''; - - $gui->array_container = $the_xx; - $gui->old_container = $the_tc_node['parent_id']; // original container - $gui->testsuite_id = $the_tc_node['parent_id']; - $gui->testcase_id = $args->tcase_id; - $gui->name = $tc_info[0]['name']; - $gui->testcase_name = $tcase_mgr->generateTimeStampName($gui->name); - - - $smarty->assign('gui', $gui); - $templateCfg = templateConfiguration('tcMove'); - $smarty->display($templateCfg->template_dir . $templateCfg->default_template); -} -else if($args->do_move) -{ - $result = $tree_mgr->change_parent($args->tcase_id,$args->new_container_id); - $tree_mgr->change_child_order($args->new_container_id,$args->tcase_id, - $args->target_position,$cfg->exclude_node_types); - - $gui->refreshTree = $args->refreshTree; - $tsuite_mgr->show($smarty,$gui,$templateCfg->template_dir,$args->old_container_id); -} else if($args->do_copy || $args->do_copy_ghost_zone) { - $args->stepAsGhost = $args->do_copy_ghost_zone; - $user_feedback=''; - $msg = ''; - $action_result = 'copied'; - $options = array('check_duplicate_name' => - config_get('check_names_for_duplicates'), - 'action_on_duplicate_name' => - config_get('action_on_duplicate_name'), - 'copy_also' => $args->copy, - 'stepAsGhost' => $args->do_copy_ghost_zone, - 'use_this_name' => $args->name, - 'copyOnlyLatest' => $args->copyOnlyLatestVersion); - - $result = $tcase_mgr->copy_to($args->tcase_id,$args->new_container_id,$args->user_id,$options); - $msg = $result['msg']; - if($result['status_ok']) - { - $tree_mgr->change_child_order($args->new_container_id,$result['id'], - $args->target_position,$cfg->exclude_node_types); - - $ts_sep = config_get('testsuite_sep'); - $tc_info = $tcase_mgr->get_by_id($args->tcase_id); - $container_info = $tree_mgr->get_node_hierarchy_info($args->new_container_id); - $container_path = $tree_mgr->get_path($args->new_container_id); - $path = ''; - - foreach($container_path as $key => $value) - { - $path .= $value['name'] . $ts_sep; - } - $path = trim($path,$ts_sep); - $user_feedback = sprintf(lang_get('tc_copied'),$tc_info[0]['name'],$path); - } - - $gui->refreshTree = $args->refreshTree; - $gui->viewerArgs['action'] = $action_result; - $gui->viewerArgs['refreshTree']=$args->refreshTree? 1 : 0; - $gui->viewerArgs['msg_result'] = $msg; - $gui->viewerArgs['user_feedback'] = $user_feedback; - $gui->path_info = null; - - $identity = new stdClass(); - $identity->id = $args->tcase_id; - $identity->tproject_id = $args->tproject_id; - $identity->version_id = $args->tcversion_id; - - $tcase_mgr->show($smarty,$gui,$identity,$gui->grants); - -} -else if($args->do_create_new_version) { - createNewVersion($smarty,$args,$gui,$tcase_mgr,$args->tcversion_id); -} -else if($args->do_create_new_version_from_latest) { - $ltcv = $tcase_mgr->getLatestVersionID($args->tcase_id); - createNewVersion($smarty,$args,$gui,$tcase_mgr,$ltcv); - -} -else if($args->do_activate_this || $args->do_deactivate_this) { - $commandMgr->setActiveAttr($args,$_REQUEST); - exit(); -} - -// ----------------------------------------------------------------------- - -/* - function: - - args: - - returns: - -*/ -function init_args(&$cfgObj,$otName,&$tcaseMgr) { - $tc_importance_default = config_get('testcase_importance_default'); - - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args->stepSeq = isset($_REQUEST["stepSeq"])? $_REQUEST["stepSeq"] : ""; - - $rightlist_html_name = $otName . "_newRight"; - $args->assigned_keywords_list = isset($_REQUEST[$rightlist_html_name])? $_REQUEST[$rightlist_html_name] : ""; - $args->container_id = isset($_REQUEST['containerID']) ? intval($_REQUEST['containerID']) : 0; - - $args->file_id = isset($_REQUEST['file_id']) ? intval($_REQUEST['file_id']) : 0; - - $args->tcase_id = isset($_REQUEST['testcase_id']) ? intval($_REQUEST['testcase_id']) : 0; - if($args->tcase_id == 0) { - $args->tcase_id = isset($_REQUEST['tcase_id']) ? intval($_REQUEST['tcase_id']) : 0; - } - if($args->tcase_id == 0) { - $args->tcase_id = intval(isset($_REQUEST['relation_source_tcase_id']) ? - $_REQUEST['relation_source_tcase_id'] : 0); - } - - $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? intval($_REQUEST['tcversion_id']) : 0; - - if( $args->tcversion_id == 0 && $args->tcase_id > 0 ) { - // get latest active version - $nu = key($tcaseMgr->get_last_active_version($args->tcase_id)); - } - - - $args->name = isset($_REQUEST['testcase_name']) ? $_REQUEST['testcase_name'] : null; - - // Normally Rich Web Editors - $args->summary = isset($_REQUEST['summary']) ? $_REQUEST['summary'] : null; - $args->preconditions = isset($_REQUEST['preconditions']) ? $_REQUEST['preconditions'] : null; - $args->steps = isset($_REQUEST['steps']) ? $_REQUEST['steps'] : null; - $args->expected_results = isset($_REQUEST['expected_results']) ? $_REQUEST['expected_results'] : null; - - $args->new_container_id = isset($_REQUEST['new_container']) ? intval($_REQUEST['new_container']) : 0; - $args->old_container_id = isset($_REQUEST['old_container']) ? intval($_REQUEST['old_container']) : 0; - $args->has_been_executed = isset($_REQUEST['has_been_executed']) ? intval($_REQUEST['has_been_executed']) : 0; - $args->exec_type = isset($_REQUEST['exec_type']) ? $_REQUEST['exec_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; - $args->importance = isset($_REQUEST['importance']) ? $_REQUEST['importance'] : $tc_importance_default; - $args->status = isset($_REQUEST['status']) ? $_REQUEST['status'] : 1; // sorry for the magic - - $args->estimatedExecDuration = isset($_REQUEST['estimated_execution_duration']) ? - $_REQUEST['estimated_execution_duration'] : null; - - - $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : ''; - - $key2loop = array('edit_tc' => 'edit', 'delete_tc' => 'delete','do_delete' => 'doDelete', - 'create_tc' => 'create','do_create' => 'doCreate'); - - foreach($key2loop as $key => $action) { - if( isset($_REQUEST[$key]) ) { - $args->doAction = $action; - break; - } - } - - - $key2loop = array('move_copy_tc','delete_tc_version','do_move','do_copy', - 'do_copy_ghost_zone','do_delete_tc_version', - 'do_create_new_version','do_create_new_version_from_latest'); - foreach($key2loop as $key) { - $args->$key = isset($_REQUEST[$key]) ? 1 : 0; - } - - $args->do_activate_this = isset($_REQUEST['activate_this_tcversion']) ? 1 : 0; - $args->do_deactivate_this = isset($_REQUEST['deactivate_this_tcversion']) ? 1 : 0; - $args->activeAttr = 0; - if( $args->do_activate_this ) { - $args->activeAttr = 1; - } - - - $args->target_position = isset($_REQUEST['target_position']) ? $_REQUEST['target_position'] : 'bottom'; - - $key2loop=array("keyword_assignments","requirement_assignments"); - foreach($key2loop as $key) { - $args->copy[$key] = isset($_REQUEST[$key])?true:false; - } - - - $args->show_mode = (isset($_REQUEST['show_mode']) && $_REQUEST['show_mode'] != '') ? $_REQUEST['show_mode'] : null; - - // Multiple Test Case Steps Feature - $args->step_number = isset($_REQUEST['step_number']) ? intval($_REQUEST['step_number']) : 0; - $args->step_id = isset($_REQUEST['step_id']) ? intval($_REQUEST['step_id']) : 0; - $args->step_set = isset($_REQUEST['step_set']) ? $_REQUEST['step_set'] : null; - $args->tcaseSteps = isset($_REQUEST['tcaseSteps']) ? $_REQUEST['tcaseSteps'] : null; - - - // from session - $args->testproject_id = $args->tproject_id = intval($_SESSION['testprojectID']); - - $args->user = $_SESSION['currentUser']; - $args->user_id = intval($_SESSION['userID']); - - $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? intval($_SESSION['setting_refresh_tree_on_action']) : 0; - - $args->opt_requirements = null; - if( isset($_SESSION['testprojectOptions']) ) { - $args->opt_requirements = $_SESSION['testprojectOptions']->requirementsEnabled; - $args->requirementsEnabled = $_SESSION['testprojectOptions']->requirementsEnabled; - } - - $args->basehref = $_SESSION['basehref']; - $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - - // Specialized webEditorConfiguration - $action2check = array("editStep" => true,"createStep" => true, - "doCreateStep" => true, - "doUpdateStep" => true, "doInsertStep" => true, - "doCopyStep" => true, - "doUpdateStepAndInsert" => true); - if( isset($action2check[$args->doAction]) ) { - $cfgObj->webEditorCfg = getWebEditorCfg('steps_design'); - } - - $args->stay_here = isset($_REQUEST['stay_here']) ? 1 : 0; - - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $args->tcStatusCfg['status_code'] = $dummy['cfg']; - $args->tcStatusCfg['code_label'] = $dummy['lbl']; - $args->tc_status = isset($_REQUEST['tc_status']) ? intval($_REQUEST['tc_status']) : - $args->tcStatusCfg['status_code']['draft']; - - $dk = 'estimated_execution_duration'; - $args->$dk = trim(isset($_REQUEST[$dk]) ? $_REQUEST[$dk] : ''); - - - $args->fileTitle = isset($_REQUEST['fileTitle'])? $_REQUEST['fileTitle'] : ""; - - - - $args->relation_type = isset($_REQUEST['relation_type']) ? $_REQUEST['relation_type'] : null; - $args->relation_id = intval(isset($_REQUEST['relation_id']) ? $_REQUEST['relation_id'] : 0); - - $args->relation_destination_tcase = isset($_REQUEST['relation_destination_tcase']) ? - $_REQUEST['relation_destination_tcase'] : null; - - $args->relation_destination_tcase = str_replace(' ','',$args->relation_destination_tcase); - $getOpt = array('tproject_id' => null, 'output' => 'map'); - if( is_numeric($args->relation_destination_tcase) ) { - $getOpt['tproject_id'] = $args->tproject_id; - } - $args->dummy = $tcaseMgr->getInternalID($args->relation_destination_tcase,$getOpt); - - $args->destination_tcase_id = $args->dummy['id']; - - - $args->keyword_id = isset($_GET['keyword_id']) ? intval($_GET['keyword_id']) : 0; - - - $args->tckw_link_id = isset($_GET['tckw_link_id']) ? intval($_GET['tckw_link_id']) : 0; - - $args->tcplat_link_id = isset($_GET['tcplat_link_id']) ? intval($_GET['tcplat_link_id']) : 0; - - - $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0; - $args->platform_id = isset($_REQUEST['platform_id']) ? intval($_REQUEST['platform_id']) : 0; - - - $cbk = 'changeExecTypeOnSteps'; - $args->applyExecTypeChangeToAllSteps = isset($_REQUEST[$cbk]); - - $k2c = array('free_keywords','free_platforms'); - foreach ($k2c as $kv) { - $args->$kv = isset($_REQUEST[$kv]) ? $_REQUEST[$kv] : null; - } - - $args->copyOnlyLatestVersion = - isset($_REQUEST['copy_latest_version']) ? 1 : 0; - - $tcaseMgr->setTestProject($args->tproject_id); - - return $args; -} - - -/* - function: initializeOptionTransferCfg - args : - returns: -*/ -function initializeOptionTransferCfg($otName,&$argsObj,&$tprojectMgr) -{ - $otCfg = new stdClass(); - switch($argsObj->doAction) - { - case 'create': - case 'edit': - case 'doCreate': - $otCfg = opt_transf_empty_cfg(); - $otCfg->global_lbl = ''; - $otCfg->from->lbl = lang_get('available_kword'); - $otCfg->from->map = $tprojectMgr->get_keywords_map($argsObj->testproject_id); - $otCfg->to->lbl = lang_get('assigned_kword'); - break; - } - - $otCfg->js_ot_name = $otName; - return $otCfg; -} - -/* - function: createWebEditors - - When using tinymce or none as web editor, we need to set rows and cols - to appropriate values, to avoid an ugly ui. - null => use default values defined on editor class file - Rows and Cols values are useless for FCKeditor - - args : - - returns: object - -*/ -function createWebEditors($basehref,$editorCfg,$editorSet=null) -{ - $specGUICfg=config_get('spec_cfg'); - $layout=$specGUICfg->steps_results_layout; - - // Rows and Cols configuration - $owe = new stdClass(); - - $cols = array('steps' => array('horizontal' => 38, 'vertical' => 44), - 'expected_results' => array('horizontal' => 38, 'vertical' => 44)); - - - $editorsCfg = config_get('gui')->text_editor; - $owe->cfg = ['summary' => ['height' => $editorsCfg['summary']['height']], - 'preconditions' => ['height' => $editorsCfg['preconditions']['height']], - 'steps' => ['rows'=> null, - 'cols' => $cols['steps'][$layout] - ], - 'expected_results' => ['rows'=> null, - 'cols' => $cols['expected_results'][$layout] - ] - ]; - - $owe->editor = array(); - $force_create = is_null($editorSet); - foreach ($owe->cfg as $key => $value) - { - if( $force_create || isset($editorSet[$key]) ) - { - $owe->editor[$key] = web_editor($key,$basehref,$editorCfg); - } - else - { - unset($owe->cfg[$key]); - } - } - - return $owe; -} - -/* - function: getCfg - args : - returns: object -*/ -function getCfg() -{ - $cfg=new stdClass(); - $cfg->treemenu_default_testcase_order = config_get('treemenu_default_testcase_order'); - $cfg->spec = config_get('spec_cfg'); - $cfg->exclude_node_types = array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1); - $cfg->tcase_template = config_get('testcase_template'); - $cfg->webEditorCfg=getWebEditorCfg('design'); - - $cfg->editorKeys = new stdClass(); - $cfg->editorKeys->testcase = array('summary' => true, 'preconditions' => true); - $cfg->editorKeys->step = array('steps' => true, 'expected_results' => true); - - return $cfg; -} - -/* - function: getGrants - args : - returns: object -*/ -function getGrants(&$dbHandler) { - $grants = new stdClass(); - $grants->requirement_mgmt = has_rights($dbHandler,"mgt_modify_req"); - return $grants; -} - - -/** - * - * - */ -function initializeGui(&$dbHandler,&$argsObj,$cfgObj,&$tcaseMgr,&$tprojMgr) { - $guiObj = new stdClass(); - $guiObj->uploadOp = null; - $guiObj->tplan_id = $argsObj->tplan_id; - $guiObj->tproject_id = $argsObj->tproject_id; - $guiObj->editorType = $cfgObj->webEditorCfg['type']; - $guiObj->grants = getGrants($dbHandler); - $guiObj->opt_requirements = $argsObj->opt_requirements; - $guiObj->action_on_duplicated_name = 'generate_new'; - $guiObj->show_mode = $argsObj->show_mode; - $guiObj->has_been_executed = $argsObj->has_been_executed; - $guiObj->attachments = null; - $guiObj->parent_info = null; - $guiObj->user_feedback = ''; - $guiObj->stay_here = $argsObj->stay_here; - $guiObj->steps_results_layout = $cfgObj->spec->steps_results_layout; - $guiObj->btn_reorder_testcases = lang_get('btn_reorder_testcases_externalid'); - $guiObj->import_limit = TL_REPOSITORY_MAXFILESIZE; - $guiObj->msg = ''; - - $guiObj->loadOnCancelURL = $_SESSION['basehref'] . - "/lib/testcases/archiveData.php?edit=testcase&id=" . $argsObj->tcase_id . - "&show_mode={$argsObj->show_mode}"; - - $guiObj->fileUploadURL = $_SESSION['basehref'] . $tcaseMgr->getFileUploadRelativeURL($argsObj); - - - if($argsObj->container_id > 0) { - $pnode_info = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->container_id); - $node_descr = array_flip($tcaseMgr->tree_manager->get_available_node_types()); - $guiObj->parent_info['name'] = $pnode_info['name']; - $guiObj->parent_info['description'] = lang_get($node_descr[$pnode_info['node_type_id']]); - } - - $guiObj->direct_link = $tcaseMgr->buildDirectWebLink($_SESSION['basehref'],$argsObj->tcase_id, - $argsObj->testproject_id); - - $guiObj->domainTCStatus = $argsObj->tcStatusCfg['code_label']; - - $grant2check = array('mgt_modify_tc','mgt_view_req','testplan_planning', - 'mgt_modify_product','keyword_assignment', - 'req_tcase_link_management', - 'testproject_edit_executed_testcases', - 'testproject_delete_executed_testcases'); - $guiObj->grants = new stdClass(); - foreach($grant2check as $right) { - $guiObj->$right = $guiObj->grants->$right = $argsObj->user->hasRight($dbHandler,$right,$argsObj->tproject_id); - } - - $guiObj->codeTrackerEnabled = $tprojMgr->isCodeTrackerEnabled($guiObj->tproject_id); - - return $guiObj; -} - -/** - * manage GUI rendering - * - */ -function renderGui(&$argsObj,$guiObj,$opObj,$templateCfg,$cfgObj,$editorKeys) { - $smartyObj = new TLSmarty(); - - // needed by webeditor loading logic present on inc_head.tpl - $smartyObj->assign('editorType',$guiObj->editorType); - - $renderType = 'none'; - - // - // key: operation requested (normally received from GUI on doAction) - // value: operation value to set on doAction HTML INPUT - // This is useful when you use same template (example xxEdit.tpl), - // for create and edit. - // When template is used for create -> operation: doCreate. - // When template is used for edit -> operation: doUpdate. - // - // used to set value of: $guiObj->operation - // - $actionOperation = array('create' => 'doCreate', 'doCreate' => 'doCreate', - 'edit' => 'doUpdate','delete' => 'doDelete', - 'createStep' => 'doCreateStep', - 'doCreateStep' => 'doCreateStep', - 'doCopyStep' => 'doUpdateStep', - 'editStep' => 'doUpdateStep', - 'doUpdateStep' => 'doUpdateStep', - 'doInsertStep' => 'doUpdateStep', - 'doUpdateStepAndInsert' => 'doUpdateStep'); - - $nak = array('doDelete','doDeleteStep','doReorderSteps','doResequenceSteps', - 'setImportance','setStatus','setExecutionType', - 'setEstimatedExecDuration','doAddRelation','doDeleteRelation', - 'removeKeyword','freeze','unfreeze','addKeyword', - 'removePlatform','addPlatform'); - - foreach($nak as $ak) { - $actionOperation[$ak] = ''; - } - - $key2work = 'initWebEditorFromTemplate'; - $initWebEditorFromTemplate = property_exists($opObj,$key2work) ? $opObj->$key2work : false; - $key2work = 'cleanUpWebEditor'; - $cleanUpWebEditor = property_exists($opObj,$key2work) ? $opObj->$key2work : false; - - $oWebEditor = createWebEditors($argsObj->basehref,$cfgObj->webEditorCfg,$editorKeys); - - foreach ($oWebEditor->cfg as $key => $value) { - $of = &$oWebEditor->editor[$key]; - - switch($argsObj->doAction) { - case "edit": - case "delete": - case "editStep": - $initWebEditorFromTemplate = false; - $of->Value = $argsObj->$key; - break; - - case "doCreate": - $initWebEditorFromTemplate = $opObj->actionOK; - $of->Value = $argsObj->$key; - break; - - case "doDelete": - case "doCopyStep": - case "doUpdateStep": - $initWebEditorFromTemplate = false; - $of->Value = $argsObj->$key; - break; - - case "create": - case "doCreateStep": - case "doInsertStep": - case "doUpdateStepAndInsert": - default: - $initWebEditorFromTemplate = true; - break; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - if($initWebEditorFromTemplate) { - $of->Value = getItemTemplateContents('testcase_template', $of->InstanceName, ''); - } else if( $cleanUpWebEditor ) { - $of->Value = ''; - } - $smartyObj->assign($key, $of->CreateHTML($oWebEditor->cfg[$key])); - } - - switch($argsObj->doAction) { - case "doDelete": - $guiObj->refreshTree = $argsObj->refreshTree; - break; - } - - switch($argsObj->doAction) { - case "edit": - case "create": - case "delete": - case "createStep": - case "editStep": - case "doCreate": - case "doDelete": - case "doCreateStep": - case "doUpdateStep": - case "doDeleteStep": - case "doReorderSteps": - case "doCopyStep": - case "doInsertStep": - case "doResequenceSteps": - case "setImportance": - case "setStatus": - case "setExecutionType": - case "setEstimatedExecDuration": - case "doAddRelation": - case "doDeleteRelation": - case "doUpdateStepAndInsert": - case "removeKeyword": - case "addKeyword": - case "freeze": - case "unfreeze": - case "removePlatform": - case "addPlatform": - $renderType = 'template'; - - // Document this !!!! - $key2loop = get_object_vars($opObj); - foreach($key2loop as $key => $value) { - $guiObj->$key = $value; - } - $guiObj->operation = $actionOperation[$argsObj->doAction]; - - $tplDir = (!isset($opObj->template_dir) || is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; - $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; - - $pos = strpos($tpl, '.php'); - if($pos === false) { - $tpl = $tplDir . $tpl; - } else { - $renderType = 'redirect'; - } - break; - } - - switch($renderType) { - case 'template': - $smartyObj->assign('gui',$guiObj); - $smartyObj->display($tpl); - break; - - case 'redirect': - header("Location: {$tpl}"); - exit(); - break; - - default: - break; - } - -} - - -/** - * - */ -function createNewVersion(&$tplEng,&$argsObj,&$guiObj,&$tcaseMgr,$sourceTCVID) { - $user_feedback = ''; - $msg = lang_get('error_tc_add'); - - $op = $tcaseMgr->create_new_version($argsObj->tcase_id, - $argsObj->user_id,$sourceTCVID); - - $candidate = $sourceTCVID; - if ($op['msg'] == "ok") { - $candidate = $op['id']; - $user_feedback = sprintf(lang_get('tc_new_version'),$op['version']); - $msg = 'ok'; - $tcCfg = config_get('testcase_cfg'); - $isOpen = !$tcCfg->freezeTCVersionOnNewTCVersion; - $tcaseMgr->setIsOpen($argsObj->tcase_id,$sourceTCVID,$isOpen); - } - $identity = new stdClass(); - $identity->id = $argsObj->tcase_id; - $identity->tproject_id = $argsObj->tproject_id; - $identity->version_id = !is_null($argsObj->show_mode) ? $candidate : testcase::ALL_VERSIONS; - - $guiObj->viewerArgs['action'] = "do_update"; - $guiObj->viewerArgs['refreshTree'] = DONT_REFRESH; - $guiObj->viewerArgs['msg_result'] = $msg; - $guiObj->viewerArgs['user_feedback'] = $user_feedback; - $guiObj->path_info = null; - - // used to implement go back ?? - $guiObj->loadOnCancelURL = $_SESSION['basehref'] . - '/lib/testcases/archiveData.php?edit=testcase&id=' . $argsObj->tcase_id . - "&show_mode={$argsObj->show_mode}"; - - - $tcaseMgr->show($tplEng,$guiObj,$identity,$guiObj->grants, - array('getAttachments' => true)); - exit(); +webEditorCfg['type']); + +$templateCfg = templateConfiguration('tcEdit'); + +$commandMgr = new testcaseCommands($db, $args->user, $args->tproject_id); +$commandMgr->setTemplateCfg(templateConfiguration()); + +$testCaseEditorKeys = array( + 'summary' => 'summary', + 'preconditions' => 'preconditions' +); +$init_inputs = true; +$opt_cfg = initializeOptionTransferCfg($optionTransferName, $args, $tproject_mgr); +$gui = initializeGui($db, $args, $cfg, $tcaseMgr, $tproject_mgr); + +$smarty = new TLSmarty(); + +$name_ok = 1; +$doRender = false; +$pfn = $args->doAction; + +$testCaseEditorKeys = null; +switch ($args->doAction) { + case "create": + case "edit": + case "doCreate": + $testCaseEditorKeys = array( + 'summary' => 'summary', + 'preconditions' => 'preconditions' + ); + break; + + case "createStep": + case "editStep": + case "doCreateStep": + case "doCreateStepAndExit": + case "doCopyStep": + case "doUpdateStep": + case "doUpdateStepAndExit": + case "doUpdateStepAndInsert": + case "doDeleteStep": + case "doReorderSteps": + case "doInsertStep": + case "doResequenceSteps": + case "doStepOperationExit": + $testCaseEditorKeys = array( + 'steps' => 'steps', + 'expected_results' => 'expected_results' + ); + break; +} + +switch ($args->doAction) { + case "doUpdate": + case "doAdd2testplan": + case 'updateTPlanLinkToTCV': + $op = $commandMgr->$pfn($args, $_REQUEST); + break; + + case "create": + case "edit": + case "doCreate": + $op = $commandMgr->$pfn($args, $opt_cfg, array_keys($testCaseEditorKeys), + $_REQUEST); + $doRender = true; + break; + + case "delete": + case "doDelete": + case "createStep": + case "editStep": + case "doCreateStep": + case "doCreateStepAndExit": + case "doCopyStep": + case "doUpdateStep": + case "doUpdateStepAndExit": + case "doUpdateStepAndInsert": + case "doDeleteStep": + case "doReorderSteps": + case "doInsertStep": + case "doResequenceSteps": + case "setImportance": + case "setStatus": + case "setExecutionType": + case "setEstimatedExecDuration": + case "removeKeyword": + case "addKeyword": + case "freeze": + case "unfreeze": + case "doStepOperationExit": + case "removePlatform": + case "addPlatform": + case "doAddRelation": + case "doDeleteRelation": + $op = $commandMgr->$pfn($args, $_REQUEST); + $doRender = true; + break; + + case "fileUpload": + $args->uploadOp = fileUploadManagement($db, $args->tcversion_id, + $args->fileTitle, $tcaseMgr->getAttachmentTableName()); + $commandMgr->show($args, $_REQUEST, array( + 'status_ok' => true + ), [ + 'updateCFOnDB' => false + ]); + break; + + case "deleteFile": + $fileInfo = deleteAttachment($db, $args->file_id, false); + if ($args->tcversion_id == 0 && null != $fileInfo) { + $args->tcversion_id = $fileInfo['fk_id']; + } + $commandMgr->show($args, $_REQUEST, array( + 'status_ok' => true + ), [ + 'updateCFOnDB' => false + ]); + break; +} + +if ($doRender) { + renderGui($args, $gui, $op, $templateCfg, $cfg, $testCaseEditorKeys); + exit(); +} + +// Things that one day will be managed by command file +if ($args->delete_tc_version) { + $status_quo_map = $tcaseMgr->getVersionsStatusQuo($args->tcase_id); + $exec_status_quo = $tcaseMgr->getExecStatus($args->tcase_id); + $gui->delete_mode = 'single'; + $gui->delete_enabled = 1; + + $msg = ''; + $sq = null; + if (! is_null($exec_status_quo) && + isset($exec_status_quo[$args->tcversion_id])) { + $sq = array( + $args->tcversion_id => $exec_status_quo[$args->tcversion_id] + ); + } + + if (intval($status_quo_map[$args->tcversion_id]['executed'])) { + $msg = lang_get('warning') . TITLE_SEP . + lang_get('delete_linked_and_exec'); + } elseif (intval($status_quo_map[$args->tcversion_id]['linked'])) { + $msg = lang_get('warning') . TITLE_SEP . lang_get('delete_linked'); + } + + $tcinfo = $tcaseMgr->get_by_id($args->tcase_id, $args->tcversion_id); + + $gui->main_descr = lang_get('title_del_tc') . TITLE_SEP_TYPE3 . + lang_get('version') . " " . $tcinfo[0]['version']; + $gui->testcase_name = $tcinfo[0]['name']; + $gui->testcase_id = $args->tcase_id; + $gui->tcversion_id = $args->tcversion_id; + $gui->delete_message = $msg; + $gui->exec_status_quo = $sq; + $gui->refreshTree = 0; + + $smarty->assign('gui', $gui); + $templateCfg = templateConfiguration('tcDelete'); + $smarty->display( + $templateCfg->template_dir . $templateCfg->default_template); +} elseif ($args->move_copy_tc) { + // need to get the testproject for the test case + $tproject_id = $tcaseMgr->get_testproject($args->tcase_id); + $the_tc_node = $tree_mgr->get_node_hierarchy_info($args->tcase_id); + $tc_parent_id = $the_tc_node['parent_id']; + $the_xx = $tproject_mgr->gen_combo_test_suites($tproject_id); + + $the_xx[$the_tc_node['parent_id']] .= ' (' . lang_get('current') . ')'; + $tc_info = $tcaseMgr->get_by_id($args->tcase_id); + + $container_qty = count($the_xx); + $gui->move_enabled = 1; + if ($container_qty == 1) { + // move operation is nonsense + $gui->move_enabled = 0; + } + + $gui->top_checked = 'checked=checked'; + $gui->bottom_checked = ''; + + $gui->array_container = $the_xx; + $gui->old_container = $the_tc_node['parent_id']; // original container + $gui->testsuite_id = $the_tc_node['parent_id']; + $gui->testcase_id = $args->tcase_id; + $gui->name = $tc_info[0]['name']; + $gui->testcase_name = $tcaseMgr->generateTimeStampName($gui->name); + + $smarty->assign('gui', $gui); + $templateCfg = templateConfiguration('tcMove'); + $smarty->display( + $templateCfg->template_dir . $templateCfg->default_template); +} elseif ($args->do_move) { + $result = $tree_mgr->change_parent($args->tcase_id, $args->new_container_id); + $tree_mgr->change_child_order($args->new_container_id, $args->tcase_id, + $args->target_position, $cfg->exclude_node_types); + + $gui->refreshTree = $args->refreshTree; + $tsuite_mgr->show($smarty, $gui, $templateCfg->template_dir, + $args->old_container_id); +} elseif ($args->do_copy || $args->do_copy_ghost_zone) { + $args->stepAsGhost = $args->do_copy_ghost_zone; + $user_feedback = ''; + $msg = ''; + $action_result = 'copied'; + $options = array( + 'check_duplicate_name' => config_get('check_names_for_duplicates'), + 'action_on_duplicate_name' => config_get('action_on_duplicate_name'), + 'copy_also' => $args->copy, + 'stepAsGhost' => $args->do_copy_ghost_zone, + 'use_this_name' => $args->name, + 'copyOnlyLatest' => $args->copyOnlyLatestVersion + ); + + $result = $tcaseMgr->copy_to($args->tcase_id, $args->new_container_id, + $args->user_id, $options); + $msg = $result['msg']; + if ($result['status_ok']) { + $tree_mgr->change_child_order($args->new_container_id, $result['id'], + $args->target_position, $cfg->exclude_node_types); + + $ts_sep = config_get('testsuite_sep'); + $tc_info = $tcaseMgr->get_by_id($args->tcase_id); + $container_info = $tree_mgr->get_node_hierarchy_info( + $args->new_container_id); + $container_path = $tree_mgr->get_path($args->new_container_id); + $path = ''; + + foreach ($container_path as $value) { + $path .= $value['name'] . $ts_sep; + } + $path = trim($path, $ts_sep); + $user_feedback = sprintf(lang_get('tc_copied'), $tc_info[0]['name'], + $path); + } + + $gui->refreshTree = $args->refreshTree; + $gui->viewerArgs['action'] = $action_result; + $gui->viewerArgs['refreshTree'] = $args->refreshTree ? 1 : 0; + $gui->viewerArgs['msg_result'] = $msg; + $gui->viewerArgs['user_feedback'] = $user_feedback; + $gui->path_info = null; + + $identity = new stdClass(); + $identity->id = $args->tcase_id; + $identity->tproject_id = $args->tproject_id; + $identity->version_id = $args->tcversion_id; + + $tcaseMgr->show($smarty, $gui, $identity, $gui->grants); +} elseif ($args->do_create_new_version) { + createNewVersion($smarty, $args, $gui, $tcaseMgr, $args->tcversion_id); +} elseif ($args->do_create_new_version_from_latest) { + $ltcv = $tcaseMgr->getLatestVersionID($args->tcase_id); + createNewVersion($smarty, $args, $gui, $tcaseMgr, $ltcv); +} elseif ($args->do_activate_this || $args->do_deactivate_this) { + $commandMgr->setActiveAttr($args, $_REQUEST); + exit(); +} + +/** + * Initialize arguments + * + * @param stdClass $cfgObj + * @param string $otName + * @param testcase $tcaseMgr + * @return stdClass + */ +function initArgs(&$cfgObj, $otName, &$tcaseMgr) +{ + $tc_importance_default = config_get('testcase_importance_default'); + + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args->stepSeq = isset($_REQUEST["stepSeq"]) ? $_REQUEST["stepSeq"] : ""; + + $rightlist_html_name = $otName . "_newRight"; + $args->assigned_keywords_list = isset($_REQUEST[$rightlist_html_name]) ? $_REQUEST[$rightlist_html_name] : ""; + $args->container_id = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : 0; + + $args->file_id = isset($_REQUEST['file_id']) ? intval($_REQUEST['file_id']) : 0; + + $args->tcase_id = isset($_REQUEST['testcase_id']) ? intval( + $_REQUEST['testcase_id']) : 0; + if ($args->tcase_id == 0) { + $args->tcase_id = isset($_REQUEST['tcase_id']) ? intval( + $_REQUEST['tcase_id']) : 0; + } + if ($args->tcase_id == 0) { + $args->tcase_id = intval( + isset($_REQUEST['relation_source_tcase_id']) ? $_REQUEST['relation_source_tcase_id'] : 0); + } + + $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? intval( + $_REQUEST['tcversion_id']) : 0; + + $args->name = isset($_REQUEST['testcase_name']) ? $_REQUEST['testcase_name'] : null; + + // Normally Rich Web Editors + $args->summary = isset($_REQUEST['summary']) ? $_REQUEST['summary'] : null; + $args->preconditions = isset($_REQUEST['preconditions']) ? $_REQUEST['preconditions'] : null; + $args->steps = isset($_REQUEST['steps']) ? $_REQUEST['steps'] : null; + $args->expected_results = isset($_REQUEST['expected_results']) ? $_REQUEST['expected_results'] : null; + + $args->new_container_id = isset($_REQUEST['new_container']) ? intval( + $_REQUEST['new_container']) : 0; + $args->old_container_id = isset($_REQUEST['old_container']) ? intval( + $_REQUEST['old_container']) : 0; + $args->has_been_executed = isset($_REQUEST['has_been_executed']) ? intval( + $_REQUEST['has_been_executed']) : 0; + $args->exec_type = isset($_REQUEST['exec_type']) ? $_REQUEST['exec_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; + $args->importance = isset($_REQUEST['importance']) ? $_REQUEST['importance'] : $tc_importance_default; + $args->status = isset($_REQUEST['status']) ? $_REQUEST['status'] : 1; // sorry for the magic + + $args->estimatedExecDuration = isset( + $_REQUEST['estimated_execution_duration']) ? $_REQUEST['estimated_execution_duration'] : null; + + $args->doAction = isset($_REQUEST['doAction']) ? $_REQUEST['doAction'] : ''; + + $key2loop = array( + 'edit_tc' => 'edit', + 'delete_tc' => 'delete', + 'do_delete' => 'doDelete', + 'create_tc' => 'create', + 'do_create' => 'doCreate' + ); + + foreach ($key2loop as $key => $action) { + if (isset($_REQUEST[$key])) { + $args->doAction = $action; + break; + } + } + + $key2loop = array( + 'move_copy_tc', + 'delete_tc_version', + 'do_move', + 'do_copy', + 'do_copy_ghost_zone', + 'do_delete_tc_version', + 'do_create_new_version', + 'do_create_new_version_from_latest' + ); + foreach ($key2loop as $key) { + $args->$key = isset($_REQUEST[$key]) ? 1 : 0; + } + + $args->do_activate_this = isset($_REQUEST['activate_this_tcversion']) ? 1 : 0; + $args->do_deactivate_this = isset($_REQUEST['deactivate_this_tcversion']) ? 1 : 0; + $args->activeAttr = 0; + if ($args->do_activate_this) { + $args->activeAttr = 1; + } + + $args->target_position = isset($_REQUEST['target_position']) ? $_REQUEST['target_position'] : 'bottom'; + + $key2loop = array( + "keyword_assignments", + "requirement_assignments" + ); + foreach ($key2loop as $key) { + $args->copy[$key] = isset($_REQUEST[$key]) ? true : false; + } + + $args->show_mode = (isset($_REQUEST['show_mode']) && + $_REQUEST['show_mode'] != '') ? $_REQUEST['show_mode'] : null; + + // Multiple Test Case Steps Feature + $args->step_number = isset($_REQUEST['step_number']) ? intval( + $_REQUEST['step_number']) : 0; + $args->step_id = isset($_REQUEST['step_id']) ? intval($_REQUEST['step_id']) : 0; + $args->step_set = isset($_REQUEST['step_set']) ? $_REQUEST['step_set'] : null; + $args->tcaseSteps = isset($_REQUEST['tcaseSteps']) ? $_REQUEST['tcaseSteps'] : null; + + // from session + $args->testproject_id = $args->tproject_id = intval( + $_SESSION['testprojectID']); + + $args->user = $_SESSION['currentUser']; + $args->user_id = intval($_SESSION['userID']); + + $args->refreshTree = isset($_SESSION['setting_refresh_tree_on_action']) ? intval( + $_SESSION['setting_refresh_tree_on_action']) : 0; + + $args->opt_requirements = null; + if (isset($_SESSION['testprojectOptions'])) { + $args->opt_requirements = $_SESSION['testprojectOptions']->requirementsEnabled; + $args->requirementsEnabled = $_SESSION['testprojectOptions']->requirementsEnabled; + } + + $args->basehref = $_SESSION['basehref']; + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + // Specialized webEditorConfiguration + $action2check = array( + "editStep" => true, + "createStep" => true, + "doCreateStep" => true, + "doUpdateStep" => true, + "doInsertStep" => true, + "doCopyStep" => true, + "doUpdateStepAndInsert" => true + ); + if (isset($action2check[$args->doAction])) { + $cfgObj->webEditorCfg = getWebEditorCfg('steps_design'); + } + + $args->stay_here = isset($_REQUEST['stay_here']) ? 1 : 0; + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $args->tcStatusCfg['status_code'] = $dummy['cfg']; + $args->tcStatusCfg['code_label'] = $dummy['lbl']; + $args->tc_status = isset($_REQUEST['tc_status']) ? intval( + $_REQUEST['tc_status']) : $args->tcStatusCfg['status_code']['draft']; + + $dk = 'estimated_execution_duration'; + $args->$dk = trim(isset($_REQUEST[$dk]) ? $_REQUEST[$dk] : ''); + + $args->fileTitle = isset($_REQUEST['fileTitle']) ? $_REQUEST['fileTitle'] : ""; + + $args->relation_type = isset($_REQUEST['relation_type']) ? $_REQUEST['relation_type'] : null; + $args->relation_id = intval( + isset($_REQUEST['relation_id']) ? $_REQUEST['relation_id'] : 0); + + $args->relation_destination_tcase = isset( + $_REQUEST['relation_destination_tcase']) ? $_REQUEST['relation_destination_tcase'] : null; + + $args->relation_destination_tcase = str_replace(' ', '', + $args->relation_destination_tcase); + $getOpt = array( + 'tproject_id' => null, + 'output' => 'map' + ); + if (is_numeric($args->relation_destination_tcase)) { + $getOpt['tproject_id'] = $args->tproject_id; + } + $args->dummy = $tcaseMgr->getInternalID($args->relation_destination_tcase, + $getOpt); + + $args->destination_tcase_id = $args->dummy['id']; + + $args->keyword_id = isset($_GET['keyword_id']) ? intval($_GET['keyword_id']) : 0; + + $args->tckw_link_id = isset($_GET['tckw_link_id']) ? intval( + $_GET['tckw_link_id']) : 0; + + $args->tcplat_link_id = isset($_GET['tcplat_link_id']) ? intval( + $_GET['tcplat_link_id']) : 0; + + $args->tplan_id = isset($_REQUEST['tplan_id']) ? intval( + $_REQUEST['tplan_id']) : 0; + $args->platform_id = isset($_REQUEST['platform_id']) ? intval( + $_REQUEST['platform_id']) : 0; + + $cbk = 'changeExecTypeOnSteps'; + $args->applyExecTypeChangeToAllSteps = isset($_REQUEST[$cbk]); + + $k2c = array( + 'free_keywords', + 'free_platforms' + ); + foreach ($k2c as $kv) { + $args->$kv = isset($_REQUEST[$kv]) ? $_REQUEST[$kv] : null; + } + + $args->copyOnlyLatestVersion = isset($_REQUEST['copy_latest_version']) ? 1 : 0; + + $tcaseMgr->setTestProject($args->tproject_id); + + return $args; +} + +/** + * initializeOptionTransferCfg + * + * @param string $otName + * @param stdClass $argsObj + * @param testproject $tprojectMgr + * @return stdClass + */ +function initializeOptionTransferCfg($otName, &$argsObj, &$tprojectMgr) +{ + $otCfg = new stdClass(); + switch ($argsObj->doAction) { + case 'create': + case 'edit': + case 'doCreate': + $otCfg = opt_transf_empty_cfg(); + $otCfg->global_lbl = ''; + $otCfg->from->lbl = lang_get('available_kword'); + $otCfg->from->map = $tprojectMgr->get_keywords_map( + $argsObj->testproject_id); + $otCfg->to->lbl = lang_get('assigned_kword'); + break; + } + + $otCfg->js_ot_name = $otName; + return $otCfg; +} + +/** + * Create web editors + * + * When using tinymce or none as web editor, we need to set rows and cols + * to appropriate values, to avoid an ugly ui. + * null => use default values defined on editor class file + * Rows and Cols values are useless for FCKeditor + * + * @param string $basehref + * @param array $editorCfg + * @param array $editorSet + * @return stdClass + */ +function createWebEditors($basehref, $editorCfg, $editorSet = null) +{ + $specGUICfg = config_get('spec_cfg'); + $layout = $specGUICfg->steps_results_layout; + + // Rows and Cols configuration + $owe = new stdClass(); + + $cols = array( + 'steps' => array( + 'horizontal' => 38, + 'vertical' => 44 + ), + 'expected_results' => array( + 'horizontal' => 38, + 'vertical' => 44 + ) + ); + + $editorsCfg = config_get('gui')->text_editor; + $owe->cfg = [ + 'summary' => [ + 'height' => $editorsCfg['summary']['height'] + ], + 'preconditions' => [ + 'height' => $editorsCfg['preconditions']['height'] + ], + 'steps' => [ + 'rows' => null, + 'cols' => $cols['steps'][$layout] + ], + 'expected_results' => [ + 'rows' => null, + 'cols' => $cols['expected_results'][$layout] + ] + ]; + + $owe->editor = array(); + $force_create = is_null($editorSet); + foreach ($owe->cfg as $key => $value) { + if ($force_create || isset($editorSet[$key])) { + $owe->editor[$key] = web_editor($key, $basehref, $editorCfg); + } else { + unset($owe->cfg[$key]); + } + } + + return $owe; +} + +/** + * Get the configuration + * + * @return stdClass + */ +function getCfg() +{ + $cfg = new stdClass(); + $cfg->treemenu_default_testcase_order = config_get( + 'treemenu_default_testcase_order'); + $cfg->spec = config_get('spec_cfg'); + $cfg->exclude_node_types = array( + 'testplan' => 1, + 'requirement' => 1, + 'requirement_spec' => 1 + ); + $cfg->tcase_template = config_get('testcase_template'); + $cfg->webEditorCfg = getWebEditorCfg('design'); + + $cfg->editorKeys = new stdClass(); + $cfg->editorKeys->testcase = array( + 'summary' => true, + 'preconditions' => true + ); + $cfg->editorKeys->step = array( + 'steps' => true, + 'expected_results' => true + ); + + return $cfg; +} + +/** + * Get the grants + * + * @param database $dbHandler + * @return stdClass object + */ +function getGrants(&$dbHandler) +{ + $grants = new stdClass(); + $grants->requirement_mgmt = has_rights($dbHandler, "mgt_modify_req"); + return $grants; +} + +/** + * Initialize the GUI + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param stdClass $cfgObj + * @param testcase $tcaseMgr + * @param testproject $tprojMgr + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj, $cfgObj, &$tcaseMgr, &$tprojMgr) +{ + $guiObj = new stdClass(); + $guiObj->uploadOp = null; + $guiObj->tplan_id = $argsObj->tplan_id; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->editorType = $cfgObj->webEditorCfg['type']; + $guiObj->grants = getGrants($dbHandler); + $guiObj->opt_requirements = $argsObj->opt_requirements; + $guiObj->action_on_duplicated_name = 'generate_new'; + $guiObj->show_mode = $argsObj->show_mode; + $guiObj->has_been_executed = $argsObj->has_been_executed; + $guiObj->attachments = null; + $guiObj->parent_info = null; + $guiObj->user_feedback = ''; + $guiObj->stay_here = $argsObj->stay_here; + $guiObj->steps_results_layout = $cfgObj->spec->steps_results_layout; + $guiObj->btn_reorder_testcases = lang_get( + 'btn_reorder_testcases_externalid'); + $guiObj->import_limit = TL_REPOSITORY_MAXFILESIZE; + $guiObj->msg = ''; + + $guiObj->loadOnCancelURL = $_SESSION['basehref'] . + "/lib/testcases/archiveData.php?edit=testcase&id=" . $argsObj->tcase_id . + "&show_mode={$argsObj->show_mode}"; + + $guiObj->fileUploadURL = $_SESSION['basehref'] . + $tcaseMgr->getFileUploadRelativeURL($argsObj); + + if ($argsObj->container_id > 0) { + $pnode_info = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $argsObj->container_id); + $node_descr = array_flip( + $tcaseMgr->tree_manager->get_available_node_types()); + $guiObj->parent_info['name'] = $pnode_info['name']; + $guiObj->parent_info['description'] = lang_get( + $node_descr[$pnode_info['node_type_id']]); + } + + $guiObj->direct_link = $tcaseMgr->buildDirectWebLink($_SESSION['basehref'], + $argsObj->tcase_id, $argsObj->testproject_id); + + $guiObj->domainTCStatus = $argsObj->tcStatusCfg['code_label']; + + $grant2check = array( + 'mgt_modify_tc', + 'mgt_view_req', + 'testplan_planning', + 'mgt_modify_product', + 'keyword_assignment', + 'req_tcase_link_management', + 'testproject_edit_executed_testcases', + 'testproject_delete_executed_testcases' + ); + $guiObj->grants = new stdClass(); + foreach ($grant2check as $right) { + $guiObj->$right = $guiObj->grants->$right = $argsObj->user->hasRight( + $dbHandler, $right, $argsObj->tproject_id); + } + + $guiObj->codeTrackerEnabled = $tprojMgr->isCodeTrackerEnabled( + $guiObj->tproject_id); + + return $guiObj; +} + +/** + * manage GUI rendering + * + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param stdClass $opObj + * @param stdClass $templateCfg + * @param stdClass $cfgObj + * @param array $editorKeys + */ +function renderGui(&$argsObj, $guiObj, $opObj, $templateCfg, $cfgObj, + $editorKeys) +{ + $smartyObj = new TLSmarty(); + + // needed by webeditor loading logic present on inc_head.tpl + $smartyObj->assign('editorType', $guiObj->editorType); + + $renderType = 'none'; + + // + // key: operation requested (normally received from GUI on doAction) + // value: operation value to set on doAction HTML INPUT + // This is useful when you use same template (example xxEdit.tpl), + // for create and edit. + // When template is used for create -> operation: doCreate. + // When template is used for edit -> operation: doUpdate. + // + // used to set value of: $guiObj->operation + // + $actionOperation = array( + 'create' => 'doCreate', + 'doCreate' => 'doCreate', + 'edit' => 'doUpdate', + 'delete' => 'doDelete', + 'createStep' => 'doCreateStep', + 'doCreateStep' => 'doCreateStep', + 'doCopyStep' => 'doUpdateStep', + 'editStep' => 'doUpdateStep', + 'doUpdateStep' => 'doUpdateStep', + 'doInsertStep' => 'doUpdateStep', + 'doUpdateStepAndInsert' => 'doUpdateStep' + ); + + $nak = array( + 'doDelete', + 'doDeleteStep', + 'doReorderSteps', + 'doResequenceSteps', + 'setImportance', + 'setStatus', + 'setExecutionType', + 'setEstimatedExecDuration', + 'doAddRelation', + 'doDeleteRelation', + 'removeKeyword', + 'freeze', + 'unfreeze', + 'addKeyword', + 'removePlatform', + 'addPlatform' + ); + + foreach ($nak as $ak) { + $actionOperation[$ak] = ''; + } + + $key2work = 'cleanUpWebEditor'; + $cleanUpWebEditor = property_exists($opObj, $key2work) ? $opObj->$key2work : false; + + $oWebEditor = createWebEditors($argsObj->basehref, $cfgObj->webEditorCfg, + $editorKeys); + + foreach ($oWebEditor->cfg as $key => $value) { + $of = &$oWebEditor->editor[$key]; + + switch ($argsObj->doAction) { + case "edit": + case "delete": + case "editStep": + case "doDelete": + case "doCopyStep": + case "doUpdateStep": + $initWebEditorFromTemplate = false; + $of->Value = $argsObj->$key; + break; + + case "doCreate": + $initWebEditorFromTemplate = $opObj->actionOK; + $of->Value = $argsObj->$key; + break; + + case "create": + case "doCreateStep": + case "doInsertStep": + case "doUpdateStepAndInsert": + default: + $initWebEditorFromTemplate = true; + break; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + if ($initWebEditorFromTemplate) { + $of->Value = getItemTemplateContents('testcase_template', + $of->InstanceName, ''); + } elseif ($cleanUpWebEditor) { + $of->Value = ''; + } + $smartyObj->assign($key, $of->CreateHTML($oWebEditor->cfg[$key])); + } + + switch ($argsObj->doAction) { + case "doDelete": + $guiObj->refreshTree = $argsObj->refreshTree; + break; + } + + switch ($argsObj->doAction) { + case "edit": + case "create": + case "delete": + case "createStep": + case "editStep": + case "doCreate": + case "doDelete": + case "doCreateStep": + case "doUpdateStep": + case "doDeleteStep": + case "doReorderSteps": + case "doCopyStep": + case "doInsertStep": + case "doResequenceSteps": + case "setImportance": + case "setStatus": + case "setExecutionType": + case "setEstimatedExecDuration": + case "doAddRelation": + case "doDeleteRelation": + case "doUpdateStepAndInsert": + case "removeKeyword": + case "addKeyword": + case "freeze": + case "unfreeze": + case "removePlatform": + case "addPlatform": + $renderType = 'template'; + + // Document this !!!! + $key2loop = get_object_vars($opObj); + foreach ($key2loop as $key => $value) { + $guiObj->$key = $value; + } + $guiObj->operation = $actionOperation[$argsObj->doAction]; + + $tplDir = (! isset($opObj->template_dir) || + is_null($opObj->template_dir)) ? $templateCfg->template_dir : $opObj->template_dir; + $tpl = is_null($opObj->template) ? $templateCfg->default_template : $opObj->template; + + $pos = strpos($tpl, '.php'); + if ($pos === false) { + $tpl = $tplDir . $tpl; + } else { + $renderType = 'redirect'; + } + break; + } + + switch ($renderType) { + case 'template': + $smartyObj->assign('gui', $guiObj); + $smartyObj->display($tpl); + break; + + case 'redirect': + header("Location: {$tpl}"); + exit(); + break; + + default: + break; + } +} + +/** + * Create a new version of a test case + * + * @param TLSmarty $tplEng + * @param stdClass $argsObj + * @param stdClass $guiObj + * @param testcase $tcaseMgr + * @param int $sourceTCVID + */ +function createNewVersion(&$tplEng, &$argsObj, &$guiObj, &$tcaseMgr, + $sourceTCVID) +{ + $user_feedback = ''; + $msg = lang_get('error_tc_add'); + + $op = $tcaseMgr->create_new_version($argsObj->tcase_id, $argsObj->user_id, + $sourceTCVID); + + $candidate = $sourceTCVID; + if ($op['msg'] == "ok") { + $candidate = $op['id']; + $user_feedback = sprintf(lang_get('tc_new_version'), $op['version']); + $msg = 'ok'; + $tcCfg = config_get('testcase_cfg'); + $isOpen = ! $tcCfg->freezeTCVersionOnNewTCVersion; + $tcaseMgr->setIsOpen($argsObj->tcase_id, $sourceTCVID, $isOpen); + } + $identity = new stdClass(); + $identity->id = $argsObj->tcase_id; + $identity->tproject_id = $argsObj->tproject_id; + $identity->version_id = ! is_null($argsObj->show_mode) ? $candidate : testcase::ALL_VERSIONS; + + $guiObj->viewerArgs['action'] = "do_update"; + $guiObj->viewerArgs['refreshTree'] = DONT_REFRESH; + $guiObj->viewerArgs['msg_result'] = $msg; + $guiObj->viewerArgs['user_feedback'] = $user_feedback; + $guiObj->path_info = null; + + // used to implement go back ?? + $guiObj->loadOnCancelURL = $_SESSION['basehref'] . + '/lib/testcases/archiveData.php?edit=testcase&id=' . $argsObj->tcase_id . + "&show_mode={$argsObj->show_mode}"; + + $tcaseMgr->show($tplEng, $guiObj, $identity, $guiObj->grants, + array( + 'getAttachments' => true + )); + exit(); } diff --git a/lib/testcases/tcExecute.php b/lib/testcases/tcExecute.php index dec2ef19f7..7b28e9a896 100644 --- a/lib/testcases/tcExecute.php +++ b/lib/testcases/tcExecute.php @@ -1,158 +1,157 @@ -" . lang_get("check_test_automation_server") . ""; - -switch($args->level) -{ - case "testcase": - $xmlResponse = remote_exec_testcase($db,$args->testcase_id,$msg); - break; - case "testsuite": - case "testproject": - //@TODO schlundus, investigate this! - $tcase_parent_id = $_REQUEST[$args->level . "_id"]; - $xmlResponse = remote_exec_testcase_set($db,$tcase_parent_id,$msg); - break; - default: - echo "" . lang_get("service_not_supported") . ""; - break; -} - -if(!is_null($xmlResponse)) -{ - $xmlResponse = '' . $xmlResponse . - '
    '; - echo $xmlResponse; -} - -function remote_exec_testcase(&$db,$tcase_id,$msg) -{ - $cfield_manager = new cfield_mgr($db); - $tree_manager = new tree($db); - $xmlResponse = null; - $executionResults = array(); - - $executionResults[$tcase_id] = executeTestCase($tcase_id,$tree_manager,$cfield_manager); - $myResult = $executionResults[$tcase_id]['result']; - $myNotes = $executionResults[$tcase_id]['notes']; - $myMessage = $executionResults[$tcase_id]['message']; - - $xmlResponse = '' . lang_get('result_after_exec') . " {$myMessage}"; - - if($myResult != -1 and $myNotes != -1) - { - $xmlResponse .= "" . lang_get('tcexec_result') . "" . - "{$myResult}" . - "" . lang_get('tcexec_notes'). "" . - " {$myNotes}"; - } - else - { - $xmlResponse .= $msg['check_server_setting']; - } - - return $xmlResponse; -} - - -/* - function: - - args : - - returns: - -*/ -function remote_exec_testcase_set(&$db,$parent_id,$msg) -{ - $cfield_manager = new cfield_mgr($db); - $tree_manager = new tree($db); - $xmlResponse = null; - $executionResults = array(); - $node_type = $tree_manager->get_available_node_types(); - $subtree_list = $tree_manager->get_subtree($parent_id); - - foreach($subtree_list as $_key => $_value){ - if (is_array($_value)){ - if($_value['node_type_id'] == $node_type['testcase']) { - $executionResults[$_value['id']] = executeTestCase($_value['id'],$tree_manager,$cfield_manager); - } - else{ - //Can add some logic here. If required. - continue; - } - } - } - if($executionResults){ - foreach($executionResults as $key => $value){ - - $node_info=$tree_manager->get_node_hierarchy_info($key); - - $xmlResponse .= '' . lang_get('tcexec_results_for') . - $node_info['name'] . ""; - $serverTest = 1; - foreach($value as $_key => $_value){ - if($_value != -1){ - $xmlResponse .= "" . $_key . ":" . $_value . ""; - } - else - $serverTest = $serverTest+1; - - } - if($serverTest != 1){ - $xmlResponse .= $xmlResponse .= $msg['check_server_setting']; - } - } - } - return $xmlResponse; -} - -/** - * - * - */ -function init_args() -{ - $iParams = array("testcase_id" => array(tlInputParameter::INT_N,0), - "level" => array(tlInputParameter::STRING_N,0,50)); - $args = new stdClass(); - R_PARAMS($iParams,$args); - return $args; -} -?> \ No newline at end of file +" . + lang_get("check_test_automation_server") . ""; + +switch ($args->level) { + case "testcase": + $xmlResponse = remoteExecTestcase($db, $args->testcase_id, $msg); + break; + case "testsuite": + case "testproject": + // @TODO schlundus, investigate this! + $tcase_parent_id = $_REQUEST[$args->level . "_id"]; + $xmlResponse = remoteExecTestcaseSet($db, $tcase_parent_id, $msg); + break; + default: + echo "" . lang_get("service_not_supported") . ""; + break; +} + +if (! is_null($xmlResponse)) { + $xmlResponse = '' . $xmlResponse . + '
    '; + echo $xmlResponse; +} + +function remoteExecTestcase(&$db, $tcase_id, $msg) +{ + $cfield_manager = new cfield_mgr($db); + $tree_manager = new tree($db); + $xmlResponse = null; + $executionResults = array(); + + $executionResults[$tcase_id] = executeTestCase($tcase_id, $tree_manager, + $cfield_manager); + $myResult = $executionResults[$tcase_id]['result']; + $myNotes = $executionResults[$tcase_id]['notes']; + $myMessage = $executionResults[$tcase_id]['message']; + + $xmlResponse = '' . lang_get('result_after_exec') . + " {$myMessage}"; + + if ($myResult != - 1 && $myNotes != - 1) { + $xmlResponse .= "" . lang_get('tcexec_result') . "" . + "{$myResult}" . "" . lang_get('tcexec_notes') . + "" . " {$myNotes}"; + } else { + $xmlResponse .= $msg['check_server_setting']; + } + + return $xmlResponse; +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function remoteExecTestcaseSet(&$db, $parent_id, $msg) +{ + $cfield_manager = new cfield_mgr($db); + $tree_manager = new tree($db); + $xmlResponse = null; + $executionResults = array(); + $node_type = $tree_manager->get_available_node_types(); + $subtree_list = $tree_manager->get_subtree($parent_id); + + foreach ($subtree_list as $_key => $_value) { + if (is_array($_value) && + $_value['node_type_id'] == $node_type['testcase']) { + $executionResults[$_value['id']] = executeTestCase($_value['id'], + $tree_manager, $cfield_manager); + } + } + if ($executionResults) { + foreach ($executionResults as $key => $value) { + $node_info = $tree_manager->get_node_hierarchy_info($key); + + $xmlResponse .= '' . + lang_get('tcexec_results_for') . $node_info['name'] . + ""; + $serverTest = 1; + foreach ($value as $_key => $_value) { + if ($_value != - 1) { + $xmlResponse .= "" . $_key . ":" . $_value . + ""; + } else { + $serverTest += 1; + } + } + if ($serverTest != 1) { + $xmlResponse .= $xmlResponse .= $msg['check_server_setting']; + } + } + } + return $xmlResponse; +} + +/** + */ +function initArgs() +{ + $iParams = array( + "testcase_id" => array( + tlInputParameter::INT_N, + 0 + ), + "level" => array( + tlInputParameter::STRING_N, + 0, + 50 + ) + ); + $args = new stdClass(); + R_PARAMS($iParams, $args); + return $args; +} +?> diff --git a/lib/testcases/tcExport.php b/lib/testcases/tcExport.php index 20dbcdab0a..4f356c8425 100644 --- a/lib/testcases/tcExport.php +++ b/lib/testcases/tcExport.php @@ -1,233 +1,251 @@ -container_id; -$check_children = 0; - - - -if($args->useRecursion) { - // Exporting situations: - // All test suites in test project - // One test suite - // $dummy = array_flip($tree_mgr->get_available_node_types()); - $node_info = $tree_mgr->get_node_hierarchy_info($node_id); - $gui->export_filename = $node_info['name']; - - $gui->page_title=lang_get('title_tsuite_export'); - - $dummy = '.testsuite-deep.xml'; - if($node_id == $args->tproject_id) { - $gui->page_title = lang_get('title_tsuite_export_all'); - $dummy = '.testproject-deep.xml'; - $check_children=1; - $gui->nothing_todo_msg=lang_get('no_testsuites_to_export'); - } - $gui->export_filename .= $dummy; - -} else { - // Exporting situations: - // All test cases in test suite. - // One test case. - if($gui->oneTestCaseExport) { - $tcase_mgr = new testcase($db); - $tcinfo = $tcase_mgr->get_by_id($args->tcase_id,$args->tcversion_id,null,array('output' => 'essential')); - $tcinfo = $tcinfo[0]; - $node_id = $args->tcase_id; - $gui->export_filename = $tcinfo['name'] . '.version' . $tcinfo['version'] . '.testcase.xml'; - $gui->page_title = lang_get('title_tc_export'); - } else { - $check_children = 1; - $node_info = $tree_mgr->get_node_hierarchy_info($args->container_id); - $gui->export_filename = $node_info['name'] . '.testsuite-children-testcases.xml'; - $gui->page_title = lang_get('title_tc_export_all'); - $gui->nothing_todo_msg = lang_get('no_testcases_to_export'); - } -} -$gui->export_filename = is_null($args->export_filename) ? $gui->export_filename : $args->export_filename; - - -if( $check_children ) { - // Check if there is something to export - $children=$tree_mgr->get_children($node_id, - array("testplan" => "exclude_me", - "requirement_spec" => "exclude_me", - "requirement" => "exclude_me")); - - $gui->nothing_todo_msg=''; - if(count($children)==0) { - $gui->do_it = 0 ; - } -} -$node = $tree_mgr->get_node_hierarchy_info($node_id); - -if( $args->doExport || ( $args->doExportSkel && !$gui->oneTestCaseExport ) ) { - if( is_null($tcase_mgr) ) { - $tcase_mgr = new testcase($db); - } - $tsuite_mgr = new testsuite($db); - - $pfn = null; - switch($args->exportType) { - case 'XML': - $pfn = 'exportTestSuiteDataToXML'; - if ($gui->oneTestCaseExport) { - $pfn = 'exportTestCaseDataToXML'; - } - break; - } - - if ($pfn) { - if ($gui->oneTestCaseExport) { - $args->optExport['RELATIONS'] = true; - $args->optExport['ROOTELEM'] = "{{XMLCODE}}"; - $content = $tcase_mgr->$pfn($args->tcase_id,$args->tcversion_id,$args->tproject_id,null,$args->optExport); - } else { - - $opt = $args->optExport; - if( $args->doExportSkel ) { - $opt['skeleton'] = 1; - } - $content = TL_XMLEXPORT_HEADER; - $content .= $tsuite_mgr->$pfn($args->container_id,$args->tproject_id,$opt); - } - - downloadContentsToFile($content,$gui->export_filename); - exit(); - } -} - -$gui->object_name=$node['name']; -$gui->tproject_name=$args->tproject_name; -$gui->tproject_id=$args->tproject_id; -$gui->tcID=$args->tcase_id; -$gui->useRecursion=$args->useRecursion ? 1 : 0; -$gui->tcVersionID=$args->tcversion_id; -$gui->containerID=$args->container_id; - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/* - function: init_args - - args: - - returns: - -*/ -function init_args(&$dbHandler) { - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->doExport = isset($_REQUEST['export']) ? 1 : 0; - $args->doExportSkel = isset($_REQUEST['exportSkel']) ? 1 : 0; - - $k2l = array('useRecursion','exportReqs','exportCFields', - 'exportKeywords','exportTestCaseExternalID','exportTCSummary', - 'exportTCPreconditions','exportTCSteps', 'exportAttachments'); - - foreach ($k2l as $key) { - $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; - } - - $args->addPrefix = 0; - if($args->exportTestCaseExternalID) { - $args->addPrefix = isset($_REQUEST['addPrefix']) ? 1 : 0; - } - - $args->optExport = array('REQS' => $args->exportReqs, - 'CFIELDS' => $args->exportCFields, - 'KEYWORDS' => $args->exportKeywords, - 'EXTERNALID' => $args->exportTestCaseExternalID, - 'ADDPREFIX' => $args->addPrefix, - 'RECURSIVE' => $args->useRecursion, - 'TCSUMMARY' => $args->exportTCSummary, - 'TCPRECONDITIONS' => $args->exportTCPreconditions, - 'ATTACHMENTS' => $args->exportAttachments, - 'TCSTEPS' => $args->exportTCSteps); - - - $omgr = $args->useRecursion ? new testsuite($dbHandler) : new testcase($dbHandler); - $args->exportTypes = $omgr->get_export_file_types(); - $args->exportType = null; - if( isset($_REQUEST['exportType']) ) { - $xd = strtoupper(trim($_REQUEST['exportType'])); - $args->exportType = isset($args->exportTypes[$xd]) ? $args->exportTypes[$xd] : null; - } - - $args->export_filename=isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; - - $args->tcase_id = isset($_REQUEST['testcase_id']) ? intval($_REQUEST['testcase_id']) : 0; - $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? intval($_REQUEST['tcversion_id']) : 0; - $args->container_id = isset($_REQUEST['containerID']) ? intval($_REQUEST['containerID']) : 0; - - // To be replaced with $_REQUEST value - $args->tproject_id = intval(isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0); - if($args->tproject_id > 0) { - $dummy = $omgr->tree_manager->get_node_hierarchy_info($args->tproject_id); - if(!is_null($dummy)) { - $args->tproject_name = $dummy['name']; - } else { - throw new Exception("BAD Test Project ID={$args->tproject_id}", 1); - } - } else { - throw new Exception("Test Project ID=0", 1); - } - - $args->goback_url=isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - unset($omgr); - return $args; -} - - -/** - * - */ -function initializeGui($argsObj) { - $guiObj = new stdClass(); - $guiObj->do_it = 1; - $guiObj->nothing_todo_msg = ''; - $guiObj->export_filename = ''; - $guiObj->page_title = ''; - $guiObj->object_name = ''; - $guiObj->exportTypes = $argsObj->exportTypes; - $guiObj->tproject_id = $argsObj->tproject_id; - - - $guiObj->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - $guiObj->oneTestCaseExport = ($argsObj->tcase_id && $argsObj->tcversion_id); - - $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . - "lib/testcases/archiveData.php?"; - if($argsObj->useRecursion || !$guiObj->oneTestCaseExport) { - $guiObj->cancelActionJS .= 'edit=testsuite&id=' . - intval($argsObj->container_id) . "'"; - } else { - $guiObj->cancelActionJS .= 'edit=testcase&id=' . - intval($argsObj->tcase_id) . "'"; - } - return $guiObj; +container_id; +$check_children = 0; + +if ($args->useRecursion) { + // Exporting situations: + // All test suites in test project + // One test suite + // $dummy = array_flip($tree_mgr->get_available_node_types()); + $node_info = $tree_mgr->get_node_hierarchy_info($node_id); + $gui->export_filename = $node_info['name']; + + $gui->page_title = lang_get('title_tsuite_export'); + + $dummy = '.testsuite-deep.xml'; + if ($node_id == $args->tproject_id) { + $gui->page_title = lang_get('title_tsuite_export_all'); + $dummy = '.testproject-deep.xml'; + $check_children = 1; + $gui->nothing_todo_msg = lang_get('no_testsuites_to_export'); + } + $gui->export_filename .= $dummy; +} else { + // Exporting situations: + // All test cases in test suite. + // One test case. + if ($gui->oneTestCaseExport) { + $tcaseMgr = new testcase($db); + $tcinfo = $tcaseMgr->get_by_id($args->tcase_id, $args->tcversion_id, + null, array( + 'output' => 'essential' + )); + $tcinfo = $tcinfo[0]; + $node_id = $args->tcase_id; + $gui->export_filename = $tcinfo['name'] . '.version' . $tcinfo['version'] . + '.testcase.xml'; + $gui->page_title = lang_get('title_tc_export'); + } else { + $check_children = 1; + $node_info = $tree_mgr->get_node_hierarchy_info($args->container_id); + $gui->export_filename = $node_info['name'] . + '.testsuite-children-testcases.xml'; + $gui->page_title = lang_get('title_tc_export_all'); + $gui->nothing_todo_msg = lang_get('no_testcases_to_export'); + } +} +$gui->export_filename = is_null($args->export_filename) ? $gui->export_filename : $args->export_filename; + +if ($check_children) { + // Check if there is something to export + $children = $tree_mgr->get_children($node_id, + array( + "testplan" => "exclude_me", + "requirement_spec" => "exclude_me", + "requirement" => "exclude_me" + )); + + $gui->nothing_todo_msg = ''; + if (count($children) == 0) { + $gui->do_it = 0; + } +} +$node = $tree_mgr->get_node_hierarchy_info($node_id); + +if ($args->doExport || ($args->doExportSkel && ! $gui->oneTestCaseExport)) { + if (is_null($tcaseMgr)) { + $tcaseMgr = new testcase($db); + } + $tsuite_mgr = new testsuite($db); + + $pfn = null; + switch ($args->exportType) { + case 'XML': + $pfn = 'exportTestSuiteDataToXML'; + if ($gui->oneTestCaseExport) { + $pfn = 'exportTestCaseDataToXML'; + } + break; + } + + if ($pfn) { + if ($gui->oneTestCaseExport) { + $args->optExport['RELATIONS'] = true; + $args->optExport['ROOTELEM'] = "{{XMLCODE}}"; + $content = $tcaseMgr->$pfn($args->tcase_id, $args->tcversion_id, + $args->tproject_id, null, $args->optExport); + } else { + + $opt = $args->optExport; + if ($args->doExportSkel) { + $opt['skeleton'] = 1; + } + $content = TL_XMLEXPORT_HEADER; + $content .= $tsuite_mgr->$pfn($args->container_id, + $args->tproject_id, $opt); + } + + downloadContentsToFile($content, $gui->export_filename); + exit(); + } +} + +$gui->object_name = $node['name']; +$gui->tproject_name = $args->tproject_name; +$gui->tproject_id = $args->tproject_id; +$gui->tcID = $args->tcase_id; +$gui->useRecursion = $args->useRecursion ? 1 : 0; +$gui->tcVersionID = $args->tcversion_id; +$gui->containerID = $args->container_id; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->doExport = isset($_REQUEST['export']) ? 1 : 0; + $args->doExportSkel = isset($_REQUEST['exportSkel']) ? 1 : 0; + + $k2l = array( + 'useRecursion', + 'exportReqs', + 'exportCFields', + 'exportKeywords', + 'exportTestCaseExternalID', + 'exportTCSummary', + 'exportTCPreconditions', + 'exportTCSteps', + 'exportAttachments' + ); + + foreach ($k2l as $key) { + $args->$key = isset($_REQUEST[$key]) ? intval($_REQUEST[$key]) : 0; + } + + $args->addPrefix = 0; + if ($args->exportTestCaseExternalID) { + $args->addPrefix = isset($_REQUEST['addPrefix']) ? 1 : 0; + } + + $args->optExport = array( + 'REQS' => $args->exportReqs, + 'CFIELDS' => $args->exportCFields, + 'KEYWORDS' => $args->exportKeywords, + 'EXTERNALID' => $args->exportTestCaseExternalID, + 'ADDPREFIX' => $args->addPrefix, + 'RECURSIVE' => $args->useRecursion, + 'TCSUMMARY' => $args->exportTCSummary, + 'TCPRECONDITIONS' => $args->exportTCPreconditions, + 'ATTACHMENTS' => $args->exportAttachments, + 'TCSTEPS' => $args->exportTCSteps + ); + + $omgr = $args->useRecursion ? new testsuite($dbHandler) : new testcase( + $dbHandler); + $args->exportTypes = $omgr->get_export_file_types(); + $args->exportType = null; + if (isset($_REQUEST['exportType'])) { + $xd = strtoupper(trim($_REQUEST['exportType'])); + $args->exportType = isset($args->exportTypes[$xd]) ? $args->exportTypes[$xd] : null; + } + + $args->export_filename = isset($_REQUEST['export_filename']) ? $_REQUEST['export_filename'] : null; + + $args->tcase_id = isset($_REQUEST['testcase_id']) ? intval( + $_REQUEST['testcase_id']) : 0; + $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? intval( + $_REQUEST['tcversion_id']) : 0; + $args->container_id = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : 0; + + // To be replaced with $_REQUEST value + $args->tproject_id = intval( + isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0); + if ($args->tproject_id > 0) { + $dummy = $omgr->tree_manager->get_node_hierarchy_info( + $args->tproject_id); + if (! is_null($dummy)) { + $args->tproject_name = $dummy['name']; + } else { + throw new Exception("BAD Test Project ID={$args->tproject_id}", 1); + } + } else { + throw new Exception("Test Project ID=0", 1); + } + + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + unset($omgr); + return $args; +} + +/** + */ +function initializeGui($argsObj) +{ + $guiObj = new stdClass(); + $guiObj->do_it = 1; + $guiObj->nothing_todo_msg = ''; + $guiObj->export_filename = ''; + $guiObj->page_title = ''; + $guiObj->object_name = ''; + $guiObj->exportTypes = $argsObj->exportTypes; + $guiObj->tproject_id = $argsObj->tproject_id; + + $guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + $guiObj->oneTestCaseExport = ($argsObj->tcase_id && $argsObj->tcversion_id); + + $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . + "lib/testcases/archiveData.php?"; + if ($argsObj->useRecursion || ! $guiObj->oneTestCaseExport) { + $guiObj->cancelActionJS .= 'edit=testsuite&id=' . + intval($argsObj->container_id) . "'"; + } else { + $guiObj->cancelActionJS .= 'edit=testcase&id=' . + intval($argsObj->tcase_id) . "'"; + } + return $guiObj; } diff --git a/lib/testcases/tcImport.php b/lib/testcases/tcImport.php index a15840e543..4ed9cf45ed 100644 --- a/lib/testcases/tcImport.php +++ b/lib/testcases/tcImport.php @@ -1,1285 +1,1410 @@ -do_upload) { - - // check the uploaded file - $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; - - tLog('Uploaded file: '.$source); - $doIt = false; - $gui->file_check = null; - if (($source != 'none') && ($source != '')) { - // ATTENTION: - // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using - // Firefox and Chrome. - if( !($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes) ) { - $gui->file_check['status_ok'] = 0; - $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'),$_FILES['uploadedFile']['size'],$gui->importLimitBytes); - } - } - - if($doIt) { - $gui->file_check['status_ok'] = 1; - if (move_uploaded_file($source, $gui->dest)) { - tLog('Renamed uploaded file: ' . $source); - switch($args->importType) { - case 'XML': - $pcheck_fn = "check_xml_tc_tsuite"; - $pimport_fn = "importTestCaseDataFromXML"; - break; - } - - if(!is_null($pcheck_fn)) { - $gui->file_check = $pcheck_fn($gui->dest,$args->useRecursion); - } - } - - if($gui->file_check['status_ok'] && $pimport_fn) { - tLog('Check is Ok.'); - $opt = array(); - $opt['useRecursion'] = $args->useRecursion; - $opt['importIntoProject'] = $args->bIntoProject; - $opt['duplicateLogic'] = array('hitCriteria' => $args->hit_criteria, - 'actionOnHit' => $args->action_on_duplicated_name); - $gui->resultMap = $pimport_fn($db,$gui->dest, - intval($args->container_id),intval($args->tproject_id),intval($args->userID), - $opt); - } - } else if(is_null($gui->file_check)) { - - tLog('Missing upload file','WARNING'); - $gui->file_check = array('status_ok' => 0, 'msg' => lang_get('please_choose_file_to_import')); - $args->importType = null; - } +do_upload) { + + // check the uploaded file + $source = isset($_FILES['uploadedFile']['tmp_name']) ? $_FILES['uploadedFile']['tmp_name'] : null; + + tLog('Uploaded file: ' . $source); + $doIt = false; + $gui->file_check = null; + // ATTENTION: + // MAX_FILE_SIZE hidden input is defined on form, but anyway we do not get error at least using + // Firefox and Chrome. + if (($source != 'none') && ($source != '') && + ! ($doIt = $_FILES['uploadedFile']['size'] <= $gui->importLimitBytes)) { + $gui->file_check['status_ok'] = 0; + $gui->file_check['msg'] = sprintf(lang_get('file_size_exceeded'), + $_FILES['uploadedFile']['size'], $gui->importLimitBytes); + } + + if ($doIt) { + $gui->file_check['status_ok'] = 1; + if (move_uploaded_file($source, $gui->dest)) { + tLog('Renamed uploaded file: ' . $source); + switch ($args->importType) { + case 'XML': + $pcheck_fn = "check_xml_tc_tsuite"; + $pimport_fn = "importTestCaseDataFromXML"; + break; + } + + if (! is_null($pcheck_fn)) { + $gui->file_check = $pcheck_fn($gui->dest, $args->useRecursion); + } + } + + if ($gui->file_check['status_ok'] && $pimport_fn) { + tLog('Check is Ok.'); + $opt = array(); + $opt['useRecursion'] = $args->useRecursion; + $opt['importIntoProject'] = $args->bIntoProject; + $opt['duplicateLogic'] = array( + 'hitCriteria' => $args->hit_criteria, + 'actionOnHit' => $args->action_on_duplicated_name + ); + $gui->resultMap = $pimport_fn($db, $gui->dest, + intval($args->container_id), intval($args->tproject_id), + intval($args->userID), $opt); + } + } elseif (is_null($gui->file_check)) { + + tLog('Missing upload file', 'WARNING'); + $gui->file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('please_choose_file_to_import') + ); + $args->importType = null; + } +} + +if ($args->useRecursion) { + $obj_mgr = new testsuite($db); + $gui->actionOptions = array( + 'update_last_version' => lang_get('update_last_testcase_version'), + 'generate_new' => lang_get('generate_new_testcase'), + 'create_new_version' => lang_get('create_new_testcase_version') + ); + + $gui->hitOptions = array( + 'name' => lang_get('same_name'), + 'internalID' => lang_get('same_internalID'), + 'externalID' => lang_get('same_externalID') + ); +} else { + $obj_mgr = new testcase($db); + $obj_mgr->setTestProject($args->tproject_id); +} + +$gui->actionOptions = array( + 'skip' => lang_get('skip_testcase_import'), + 'update_last_version' => lang_get('update_last_testcase_version'), + 'generate_new' => lang_get('generate_new_testcase'), + 'create_new_version' => lang_get('create_new_testcase_version') +); + +$gui->hitOptions = array( + 'name' => lang_get('same_name'), + 'internalID' => lang_get('same_internalID'), + 'externalID' => lang_get('same_externalID') +); + +$gui->testprojectName = $_SESSION['testprojectName']; +$gui->importTypes = $obj_mgr->get_import_file_types(); +$gui->action_on_duplicated_name = $args->action_on_duplicated_name; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/* + * function: importTestCaseDataFromXML + * args : + * returns: + */ +function importTestCaseDataFromXML(&$db, $fileName, $parentID, $tproject_id, + $userID, $options = null) +{ + tLog('importTestCaseDataFromXML called for file: ' . $fileName); + $resultMap = null; + $my = array(); + $my['options'] = array( + 'useRecursion' => false, + 'importIntoProject' => 0, + 'duplicateLogic' => array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + ) + ); + $my['options'] = array_merge($my['options'], (array) $options); + foreach ($my['options'] as $varname => $value) { + $$varname = $value; + } + + if (file_exists($fileName)) { + $xml = @simplexml_load_file_wrapper($fileName); + if ($xml) { + $xmlKeywords = $xml->xpath('//keywords'); + $kwMap = null; + if ($xmlKeywords) { + $tproject = new testproject($db); + $loop2do = count($xmlKeywords); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $tproject->importKeywordsFromSimpleXML($tproject_id, + $xmlKeywords[$idx]); + } + $kwMap = $tproject->get_keywords_map($tproject_id); + // change keywords to lowercase to be case insensitive + $kwMap = is_null($kwMap) ? null : array_change_key_case( + array_flip($kwMap), CASE_LOWER); + } + + if (! $useRecursion && ($xml->getName() == 'testcases')) { + $resultMap = importTestCasesFromSimpleXML($db, $xml, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic); + } + + if ($useRecursion && ($xml->getName() == 'testsuite')) { + $resultMap = importTestSuitesFromSimpleXML($db, $xml, + intval($parentID), intval($tproject_id), $userID, $kwMap, + $duplicateLogic, $importIntoProject); + } + } + } + return $resultMap; +} + +/* + * function: saveImportedTCData + * args : + * returns: + */ +function saveImportedTCData(&$db, $tcData, $tproject_id, $container_id, $userID, + $kwMap, + $duplicatedLogic = array( + 'hitCriteria' => 'name', + 'actionOnHit' => null + )) +{ + static $messages; + static $fieldSizeCfg; + static $feedbackMsg; + static $tcaseMgr; + static $tproject_mgr; + static $req_mgr; + static $safeSizeCfg; + static $linkedCustomFields; + static $tprojectHas; + static $reqSpecSet; + static $getVersionOpt; + static $userObj; + static $tcasePrefix; + static $glueChar; + static $userRights; + + $ret = null; + + if (! $tcData) { + return; + } + + $hasCFieldsInfo = false; + $hasRequirements = false; + $hasAttachments = false; + + if (is_null($messages)) { + $feedbackMsg = array(); + $messages = array(); + $fieldSizeCfg = config_get('field_size'); + + $tcaseMgr = new testcase($db); + $tcaseMgr->setTestProject($tproject_id); + + $tproject_mgr = new testproject($db); + $req_mgr = new requirement_mgr($db); + $userObj = new tlUser($userID); + $userObj->readFromDB($db, tlUser::TLOBJ_O_SEARCH_BY_ID); + + $userRights['can_edit_executed'] = $userObj->hasRight($db, + 'testproject_edit_executed_testcases', $tproject_id); + $userRights['can_link_to_req'] = $userObj->hasRight($db, + 'req_tcase_link_management', $tproject_id); + $userRights['can_assign_keywords'] = $userObj->hasRight($db, + 'keyword_assignment', $tproject_id); + + $k2l = array( + 'already_exists_updated', + 'original_name', + 'testcase_name_too_long', + 'already_exists_not_updated', + 'already_exists_skipped', + 'start_warning', + 'end_warning', + 'testlink_warning', + 'hit_with_same_external_ID', + 'keywords_assignment_skipped_during_import', + 'req_assignment_skipped_during_import' + ); + + foreach ($k2l as $k) { + $messages[$k] = lang_get($k); + } + + $messages['start_feedback'] = $messages['start_warning'] . "\n" . + $messages['testlink_warning'] . "\n"; + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['reqspec_warning'] = lang_get( + 'no_reqspec_defined_can_not_import'); + + $feedbackMsg['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + $feedbackMsg['tcase'] = lang_get('testcase'); + $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); + $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); + $feedbackMsg['reqNotInDB'] = lang_get('req_not_in_DB_on_tcimport'); + $feedbackMsg['attachment'] = lang_get( + 'attachment_skipped_during_import'); + + // because name can be changed automatically during item creation + // to avoid name conflict adding a suffix automatically generated, + // is better to use a max size < max allowed size + $safeSizeCfg = new stdClass(); + $safeSizeCfg->testcase_name = ($fieldSizeCfg->testcase_name) * 0.8; + + // Get CF with scope design time and allowed for test cases linked to this test project + $linkedCustomFields = $tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $tproject_id, 1, null, 'testcase', null, 'name'); + $tprojectHas['customFields'] = ! is_null($linkedCustomFields); + + $reqSpecSet = getReqSpecSet($db, $tproject_id); + + $tprojectHas['reqSpec'] = (! is_null($reqSpecSet) && + count($reqSpecSet) > 0); + + $getVersionOpt = array( + 'output' => 'minimun' + ); + $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); + $glueChar = config_get('testcase_cfg')->glue_character; + } + + $resultMap = array(); + $tc_qty = count($tcData); + $userIDCache = array(); + + for ($idx = 0; $idx < $tc_qty; $idx ++) { + $tc = $tcData[$idx]; + $name = $tc['name']; + + $summary = $tc['summary']; + $steps = $tc['steps']; + $internalid = $tc['internalid']; + $externalid = $tc['externalid']; + + $doCreate = true; + if ($duplicatedLogic['actionOnHit'] == 'update_last_version' || + $duplicatedLogic['actionOnHit'] == 'skip') { + + $updOpt['blockIfExecuted'] = ! $userRights['can_edit_executed']; + + switch ($duplicatedLogic['hitCriteria']) { + case 'name': + $dupInfo = $tcaseMgr->getDuplicatesByName($name, + $container_id); + break; + + case 'internalID': + $dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info( + $internalid, $container_id); + if (! is_null($dummy)) { + $dupInfo = null; + $dupInfo[$internalid] = $dummy; + } + break; + + case 'externalID': + $dupInfo = $tcaseMgr->get_by_external($externalid, + $container_id); + break; + } + } + + // Check for skip, to avoid useless processing + if ($duplicatedLogic['actionOnHit'] == 'skip' && ! empty($dupInfo)) { + $resultMap[] = array( + $name, + $messages['already_exists_skipped'] + ); + continue; + } + + // I've changed value to use when order has not been provided + // from testcase:DEFAULT_ORDER to a counter, because with original solution + // an issue arise with 'save execution and go next' + // if use has not provided order I think is OK TestLink make any choice. + $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx + + 1); + $internalid = $tc['internalid']; + + $preconditions = $tc['preconditions']; + + $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; + $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; + + $attr = null; + if (isset($tc['estimated_exec_duration']) && + ! is_null($tc['estimated_exec_duration'])) { + $attr['estimatedExecDuration'] = trim( + $tc['estimated_exec_duration']); + $attr['estimatedExecDuration'] = $attr['estimatedExecDuration'] == '' ? null : floatval( + $attr['estimatedExecDuration']); + } + + if (isset($tc['is_open'])) { + $attr['is_open'] = trim($tc['is_open']); + } + + if (isset($tc['active'])) { + $attr['active'] = trim($tc['active']); + } + + if (isset($tc['status'])) { + $attr['status'] = trim($tc['status']); + } + + $externalid = $tc['externalid']; + if (intval($externalid) <= 0) { + $externalid = null; + } + + $personID = $userID; + if (! is_null($tc['author_login'])) { + if (isset($userIDCache[$tc['author_login']])) { + $personID = $userIDCache[$tc['author_login']]; + } else { + $userObj->login = $tc['author_login']; + if ($userObj->readFromDB($db, tlUser::USER_O_SEARCH_BYLOGIN) == + tl::OK) { + $personID = $userObj->dbID; + } + + // I will put always a valid userID on this cache, + // this way if author_login does not exit, and is used multiple times + // i will do check for existence JUST ONCE. + $userIDCache[$tc['author_login']] = $personID; + } + } + + $name_len = tlStringLen($name); + if ($name_len > $fieldSizeCfg->testcase_name) { + // Will put original name inside summary + $xx = $messages['start_feedback']; + $xx .= sprintf($messages['testcase_name_too_long'], $name_len, + $fieldSizeCfg->testcase_name) . "\n"; + $xx .= $messages['original_name'] . "\n" . $name . "\n" . + $messages['end_warning'] . "\n"; + $tcCfg = getWebEditorCfg('design'); + $tcType = $tcCfg['type']; + if ($tcType == 'none') { + $summary = $xx . $summary; + } else { + $summary = nl2br($xx) . $summary; + } + $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); + } + + $kwIDs = null; + if (isset($tc['keywords']) && $tc['keywords']) { + if (! $userRights['can_assign_keywords']) { + $resultMap[] = array( + $name, + $messages['keywords_assignment_skipped_during_import'] + ); + } else { + $kwIDs = implode(",", buildKeywordList($kwMap, $tc['keywords'])); + } + } + + // More logic regarding Action on Duplicate + if ($duplicatedLogic['actionOnHit'] == 'update_last_version' && + ! is_null($dupInfo)) { + + $tcase_qty = count($dupInfo); + + switch ($tcase_qty) { + case 1: + $doCreate = false; + $tcase_id = key($dupInfo); + $last_version = $tcaseMgr->getLastVersionInfo($tcase_id, + $getVersionOpt); + $tcversion_id = $last_version['id']; + $ret = $tcaseMgr->update($tcase_id, $tcversion_id, $name, + $summary, $preconditions, $steps, $personID, $kwIDs, + $node_order, $exec_type, $importance, $attr, $updOpt); + + $ret['id'] = $tcase_id; + $ret['tcversion_id'] = $tcversion_id; + if ($ret['status_ok']) { + $resultMap[] = array( + $name, + $messages['already_exists_updated'] + ); + } else { + if ($ret['reason'] == '') { + $resultMap[] = array( + $name, + sprintf($messages['already_exists_not_updated'], + $tcasePrefix . $glueChar . $externalid, + $tcasePrefix . $glueChar . + $ret['hit_on']['tc_external_id']) + ); + } else { + $resultMap[] = array( + $name, + $ret['msg'] + ); + } + } + break; + + case 0: + $doCreate = true; + break; + + default: + $doCreate = false; + break; + } + } + + if ($doCreate) { + // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. + $item_id = intval( + $tcaseMgr->getInternalID($externalid, + array( + 'tproject_id' => $tproject_id + ))); + + if ($item_id > 0) { + // who is his parent ? + $owner = $tcaseMgr->getTestSuite($item_id); + if ($owner != $container_id) { + // Get full path of existent Test Cases + $stain = $tcaseMgr->tree_manager->get_path($item_id, null, + 'name'); + $n = count($stain); + $stain[$n - 1] = $tcasePrefix . + config_get('testcase_cfg')->glue_character . $externalid . + ':' . $stain[$n - 1]; + $stain = implode('/', $stain); + + $resultMap[] = array( + $name, + $messages['hit_with_same_external_ID'] . $stain + ); + $doCreate = false; + } + } + } + + if ($doCreate) { + $createOptions = array( + 'check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, + 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], + 'external_id' => $externalid, + 'importLogic' => $duplicatedLogic + ); + + if (! is_null($attr)) { + $createOptions += $attr; + } + + if ($ret = $tcaseMgr->create($container_id, $name, $summary, + $preconditions, $steps, $personID, $kwIDs, $node_order, + testcase::AUTOMATIC_ID, $exec_type, $importance, $createOptions)) { + $resultMap[] = array( + $name, + $ret['msg'] + ); + } + } + + // Custom Fields Management + // Check if CF with this name and that can be used on Test Cases + // is defined in current Test Project. + // If Check fails => give message to user. + // Else Import CF data + $hasCFieldsInfo = (isset($tc['customfields']) && + ! is_null($tc['customfields'])); + + if ($hasCFieldsInfo && ! is_null($ret)) { + if ($tprojectHas['customFields']) { + $msg = processCustomFields($tcaseMgr, $name, + $ret['tcversion_id'], $tc['customfields'], + $linkedCustomFields, $feedbackMsg); + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } else { + // Can not import Custom Fields Values, give feedback + $msg[] = array( + $name, + $messages['cf_warning'] + ); + $resultMap = array_merge($resultMap, $msg); + } + } + + $hasRequirements = (isset($tc['requirements']) && + ! is_null($tc['requirements'])); + + if ($hasRequirements) { + if ($tprojectHas['reqSpec']) { + + if (! $userRights['can_link_to_req']) { + $msg[] = array( + $name, + $messages['req_assignment_skipped_during_import'] + ); + } else { + $msg = processRequirements($db, $req_mgr, $name, $ret, + $tc['requirements'], $reqSpecSet, $feedbackMsg, $userID); + } + + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } else { + $msg[] = array( + $name, + $messages['reqspec_warning'] + ); + $resultMap = array_merge($resultMap, $msg); + } + } + + $hasAttachments = (isset($tc['attachments']) && + ! is_null($tc['attachments'])); + if ($hasAttachments) { + $fk_id = $doCreate ? $ret['tcversion_id'] : $internalid; + + if ($internalid == "" && $item_id > 0) { + $internalid = $item_id; + } + + $msg = processAttachments($db, true, $name, $internalid, $fk_id, + $tc['attachments'], $feedbackMsg); + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } + } + + return $resultMap; +} + +/* + * function: buildKeywordList + * + * Build the list of DB ID of the keywords used in the XML. + * + * args : + * returns: + */ +function buildKeywordList($kwMap, $keywords) +{ + $items = array(); + $loop2do = count($keywords); + for ($jdx = 0; $jdx < $loop2do; $jdx ++) { + // change Map keys (keyword) to lowercase to be case insensitive + $items[] = $kwMap[strtolower(trim($keywords[$jdx]['name']))]; + } + return $items; +} + +/* + * function: Check if at least the file starts seems OK + */ +function checkXMLTCTsuite($fileName, $recursiveMode) +{ + $xml = @simplexml_load_file_wrapper($fileName); + $file_check = array( + 'status_ok' => 0, + 'msg' => 'xml_load_ko' + ); + if ($xml) { + $file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + $elementName = $xml->getName(); + if ($recursiveMode) { + if ($elementName != 'testsuite') { + $file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('wrong_xml_tsuite_file') + ); + } + } else { + if ($elementName != 'testcases' && $elementName != 'testcase') { + $file_check = array( + 'status_ok' => 0, + 'msg' => lang_get('wrong_xml_tcase_file') + ); + } + } + } + return $file_check; +} + +/* + * contribution by mirosvad - + * Convert new line characters from XLS to HTML + */ +function nl2p($str) +{ + return str_replace('

    ', '', + '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); // MS +} + +/* + * function: + * + * args : + * + * returns: + * + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $key = 'action_on_duplicated_name'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'generate_new'; + + $key = 'hit_criteria'; + $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'name'; + + $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; + $args->useRecursion = isset($_REQUEST['useRecursion']) ? $_REQUEST['useRecursion'] : 0; + $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; + $args->container_id = isset($_REQUEST['containerID']) ? intval( + $_REQUEST['containerID']) : 0; + $args->bIntoProject = isset($_REQUEST['bIntoProject']) ? intval( + $_REQUEST['bIntoProject']) : 0; + + $args->containerType = isset($_REQUEST['containerType']) ? intval( + $_REQUEST['containerType']) : 0; + $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; + + $args->userID = $_SESSION['userID']; + $args->tproject_id = $_SESSION['testprojectID']; + + return $args; +} + +/** + * processCustomFields + * + * Analise custom field info related to test case being imported. + * If everything OK, assign to test case. + * Else return an array of messages. + * + * + * @internal revisions + * 20100905 - franciscom - BUGID 3431 - Custom Field values at Test Case VERSION Level + */ +function processCustomFields(&$tcaseMgr, $tcaseName, $tcversionId, $cfValues, + $cfDefinition, $messages) +{ + static $missingCfMsg; + $cf2insert = null; + $resultMsg = null; + + foreach ($cfValues as $value) { + if (isset($cfDefinition[$value['name']])) { + $cf2insert[$cfDefinition[$value['name']]['id']] = array( + 'type_id' => $cfDefinition[$value['name']]['type'], + 'cf_value' => $value['value'] + ); + } else { + if (! isset($missingCfMsg[$value['name']])) { + $missingCfMsg[$value['name']] = sprintf($messages['cfield'], + $value['name'], $messages['tcase']); + } + $resultMsg[] = array( + $tcaseName, + $missingCfMsg[$value['name']] + ); + } + } + + $tcaseMgr->cfield_mgr->design_values_to_db($cf2insert, $tcversionId, null, + 'simple'); + return $resultMsg; +} + +/** + * processRequirements + * + * Analise requirements info related to test case being imported. + * If everything OK, assign to test case. + * Else return an array of messages. + */ +function processRequirements(&$dbHandler, &$reqMgr, $tcaseName, $tcIDCard, + $tcReq, $reqSpecSet, $messages, $userID) +{ + static $missingReqMsg; + static $missingReqInDBMsg; + static $cachedReqSpec; + + $resultMsg = null; + $tables = tlObjectWithDB::getDBTables(array( + 'requirements' + )); + + // Since 1.9.18, links are between req version e test case version + // We will work on latest test case version and lates req version + $tcaseId = $tcIDCard['id']; + + foreach ($tcReq as $value) { + $cachedReqSpec = array(); + $doit = false; + + // Look for req doc id we get from file, inside Req Spec Set + // we got from DB + if ($doit = isset($reqSpecSet[$value['doc_id']]) && + ! (isset($cachedReqSpec[$value['req_spec_title']]))) { + // $cachedReqSpec + // key: Requirement Specification Title get from file + // value: map with follogin keys + // id => requirement specification id from DB + // req => map with key: requirement document id + $cachedReqSpec[$value['req_spec_title']]['id'] = $reqSpecSet[$value['doc_id']]['id']; + + $cachedReqSpec[$value['req_spec_title']]['req'] = null; + } + + if ($doit) { + $useit = false; + $req_spec_id = $cachedReqSpec[$value['req_spec_title']]['id']; + + // Check if requirement with desired document id exists + // on requirement specification on DB. + // If not => create message for user feedback. + if (! ($useit = isset( + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']]))) { + + $sql = " SELECT REQ.id from {$tables['requirements']} REQ " . + " WHERE REQ.req_doc_id='{$dbHandler->prepare_string($value['doc_id'])}' " . + " AND REQ.srs_id={$req_spec_id} "; + + $rsx = $dbHandler->get_recordset($sql); + if ($useit = (! empty($rsx) ? true : false)) { + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']] = $rsx[0]['id']; + } + } + + if ($useit) { + $reqMgr->assignToTCaseUsingLatestVersions( + $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']], + $tcaseId, $userID); + } else { + if (! isset($missingReqMsg[$value['doc_id']])) { + $missingReqMsg[$value['doc_id']] = sprintf($messages['req'], + $value['doc_id'], $value['req_spec_title']); + } + $resultMsg[] = array( + $tcaseName, + $missingReqMsg[$value['doc_id']] + ); + } + } else { + // We didnt find Req Doc ID in Req Spec Set got from DB + if (! isset($missingReqInDBMsg[$value['doc_id']])) { + $missingReqInDBMsg[$value['doc_id']] = sprintf( + $messages['reqNotInDB'], $value['doc_id'], ''); + } + $resultMsg[] = array( + $tcaseName, + $missingReqInDBMsg[$value['doc_id']] + ); + } + } // foreach + + return $resultMsg; +} + +/** + * processAttachments + * + * Analyze attachments info related to testcase or testsuite to define if the the attachment has to be saved. + * If attachment format is OK and attachment is not already in database for the target, save the attachment. + * Else return an array of messages. + */ +function processAttachments(&$dbHandler, $isTestCase, $tcaseName, $xmlInternalID, + $fk_Id, $tcAtt, $messages) +{ + static $duplicateAttachment; + $resultMsg = null; + $tables = tlObjectWithDB::getDBTables( + array( + 'nodes_hierarchy', + 'attachments', + 'tcversions' + )); + + foreach ($tcAtt as $value) { + $addAttachment = false; + + // Is it a CREATION or an UPDATE? + if ($xmlInternalID == $fk_Id) // internalID matches, seems to be an update + { + // try to bypass the importation of already known attachments. + // Check in database if the attachment with the same ID is linked to the testcase/testsuite with the same internal ID + // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. + // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). + $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . + " WHERE ATT.id='{$dbHandler->prepare_string($value['id'])}' " . + " AND ATT.fk_id={$fk_Id} "; + + $rsx = $dbHandler->get_recordset($sql); + // allow attachment import only if no record with the same signature have been found in database + $addAttachment = (is_null($rsx) || count($rsx) < 1); + if ($addAttachment === false) { // inform user that the attachment has been skipped + if (! isset($duplicateAttachment[$value['id']])) { + $duplicateAttachment[$value['id']] = sprintf( + $messages['attachment'], $value['name']); + } + $resultMsg[] = array( + $tcaseName, + $duplicateAttachment[$value['id']] + ); + } + } else { + // Creation + $addAttachment = true; + } + + if ($addAttachment) { + $attachRepo = tlAttachmentRepository::create($dbHandler); + + $fileInfo = $attachRepo->createAttachmentTempFile($value['content']); + $fileInfo['name'] = $value['name']; + $fileInfo['type'] = $value['file_type']; + $tableRef = $tables['nodes_hierarchy']; + if ($isTestCase) { + $tableRef = $tables['tcversions']; + } + $iaOp = $attachRepo->insertAttachment($fk_Id, $tableRef, + $value['title'], $fileInfo); + } + } + + return $resultMsg; +} + +/** + */ +function importTestCasesFromSimpleXML(&$db, &$simpleXMLObj, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic) +{ + $resultMap = null; + $xmlTCs = $simpleXMLObj->xpath('//testcase'); + $tcData = getTestCaseSetFromSimpleXMLObj($xmlTCs); + + if ($tcData) { + $resultMap = saveImportedTCData($db, $tcData, $tproject_id, $parentID, + $userID, $kwMap, $duplicateLogic); + } + return $resultMap; +} + +/** + * + * @internal revisions + */ +function getTestCaseSetFromSimpleXMLObj($xmlTCs) +{ + static $cfg; + if (! $cfg) { + $cfg = config_get('testcase_cfg')->import; + } + + $tcSet = null; + if (! $xmlTCs) { + return $tcSet; + } + + $jdx = 0; + $loops2do = count($xmlTCs); + $tcaseSet = array(); + + // TICKET 4963: Test case / Tes suite XML format, new element to set author + $tcXML['elements'] = array( + 'string' => array( + "summary" => null, + "preconditions" => null, + "author_login" => null, + "estimated_exec_duration" => null + ), + 'integer' => array( + "node_order" => null, + "externalid" => null, + "is_open" => null, + "active" => null, + "status" => null, + "execution_type" => null, + "importance" => null + ) + ); + $tcXML['attributes'] = array( + 'string' => array( + "name" => 'trim' + ), + 'integer' => array( + 'internalid' => null + ) + ); + + for ($idx = 0; $idx < $loops2do; $idx ++) { + $dummy = getItemsFromSimpleXMLObj(array( + $xmlTCs[$idx] + ), $tcXML); + $tc = $dummy[0]; + if ($tc) { + + if ($cfg->wordwrap->summary > 0) { + $tc['summary'] = wordwrap($tc['summary'], + $cfg->wordwrap->summary); + } + if ($cfg->wordwrap->preconditions > 0) { + $tc['preconditions'] = wordwrap($tc['preconditions'], + $cfg->wordwrap->preconditions); + } + + // Test Case Steps + $steps = getStepsFromSimpleXMLObj($xmlTCs[$idx]->steps->step); + $tc['steps'] = $steps; + + if ($cfg->wordwrap->actions > 0 || + $cfg->wordwrap->expected_results > 0) { + foreach ($tc['steps'] as $sdx => $elem) { + + if ($cfg->wordwrap->actions > 0) { + $tc['steps'][$sdx]['actions'] = wordwrap( + $tc['steps'][$sdx]['actions'], + $cfg->wordwrap->actions); + } + + if ($cfg->wordwrap->expected_results > 0) { + $tc['steps'][$sdx]['expected_results'] = wordwrap( + $tc['steps'][$sdx]['expected_results'], + $cfg->wordwrap->expected_results); + } + } + } + + $keywords = getKeywordsFromSimpleXMLObj( + $xmlTCs[$idx]->keywords->keyword); + if ($keywords) { + $tc['keywords'] = $keywords; + } + + $cf = getCustomFieldsFromSimpleXMLObj( + $xmlTCs[$idx]->custom_fields->custom_field); + if ($cf) { + $tc['customfields'] = $cf; + } + + $requirements = getRequirementsFromSimpleXMLObj( + $xmlTCs[$idx]->requirements->requirement); + if ($requirements) { + $tc['requirements'] = $requirements; + } + + $attachments = getAttachmentsFromSimpleXMLObj( + $xmlTCs[$idx]->attachments->attachment); + if ($attachments) { + $tc['attachments'] = $attachments; + } + } + $tcaseSet[$jdx ++] = $tc; + } + return $tcaseSet; +} + +/** + * + * @internal revisions + */ +function getStepsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "actions" => null, + "expectedresults" => null + ), + 'integer' => array( + "step_number" => null, + "execution_type" => null + ) + ); + + // 20110205 - franciscom - seems key 'transformations' is not managed on + // getItemsFromSimpleXMLObj(), then ??? is useless??? + $itemStructure['transformations'] = array( + "expectedresults" => "expected_results" + ); + + $items = getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); + + // need to do this due to (maybe) a wrong name choice for XML element + if (! is_null($items)) { + $loop2do = count($items); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $items[$idx]['expected_results'] = ''; + if (isset($items[$idx]['expectedresults'])) { + $items[$idx]['expected_results'] = $items[$idx]['expectedresults']; + unset($items[$idx]['expectedresults']); + } + } + } + return $items; +} + +function getCustomFieldsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "name" => 'trim', + "value" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +function getRequirementsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "req_spec_title" => 'trim', + "doc_id" => 'trim', + "title" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +function getAttachmentsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "id" => 'trim', + "name" => 'trim', + "file_type" => 'trim', + "title" => 'trim', + "date_added" => 'trim', + "content" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +function getKeywordsFromSimpleXMLObj($simpleXMLItems) +{ + $itemStructure['elements'] = array( + 'string' => array( + "notes" => null + ) + ); + $itemStructure['attributes'] = array( + 'string' => array( + "name" => 'trim' + ) + ); + return getItemsFromSimpleXMLObj($simpleXMLItems, $itemStructure); +} + +/* + * function: importTestSuite + * args : + * returns: + * + * @internal revisions + * 20120623 - franciscom - TICKET 5070 - test suite custom fields import + * + */ +function importTestSuitesFromSimpleXML(&$dbHandler, &$xml, $parentID, + $tproject_id, $userID, $kwMap, $duplicateLogic, $importIntoProject = 0) +{ + static $tsuiteXML; + static $tsuiteMgr; + static $myself; + static $cfSpec; + static $doCF; + static $feedbackMsg; + + $feedbackMsg['attachment'] = lang_get('attachment_skipped_during_import'); + + $resultMap = array(); + if (is_null($tsuiteXML)) { + $myself = __FUNCTION__; + $tsuiteXML = array(); + $tsuiteXML['elements'] = array( + 'string' => array( + "details" => null + ), + 'integer' => array( + "node_order" => null + ) + ); + $tsuiteXML['attributes'] = array( + 'string' => array( + "name" => 'trim' + ), + 'integer' => array( + 'id' => null + ) + ); + + $tsuiteMgr = new testsuite($dbHandler); + $doCF = ! is_null( + ($cfSpec = $tsuiteMgr->get_linked_cfields_at_design(null, null, null, + $tproject_id, 'name'))); + } + + if ($xml->getName() == 'testsuite') { + // getItemsFromSimpleXMLObj() first argument must be an array + $dummy = getItemsFromSimpleXMLObj(array( + $xml + ), $tsuiteXML); + $tsuite = current($dummy); + $tsuiteXMLID = $dummy[0]['id']; + $tsuiteID = $parentID; // hmmm, not clear + + if ($tsuite['name'] != "") { + // Check if Test Suite with this name exists on this container + // if yes -> update instead of create + $info = $tsuiteMgr->get_by_name($tsuite['name'], $parentID); + if (is_null($info)) { + $ret = $tsuiteMgr->create($parentID, $tsuite['name'], + $tsuite['details'], $tsuite['node_order']); + $tsuite['id'] = $ret['id']; + } else { + $tsuiteMgr->update(($tsuite['id'] = $info[0]['id']), + $tsuite['name'], $tsuite['details'], null, + $tsuite['node_order']); + } + unset($dummy); + + $tsuiteID = $tsuite['id']; // $tsuiteID is needed on more code pieces => DO NOT REMOVE + if (! $tsuite['id']) { + return null; + } + + if ($doCF) { + $cf = getCustomFieldsFromSimpleXMLObj( + $xml->custom_fields->custom_field); + if (! is_null($cf)) { + processTestSuiteCF($tsuiteMgr, $cfSpec, $cf, $tsuite); + } + } + + if ($keywords = getKeywordsFromSimpleXMLObj($xml->keywords->keyword)) { + $kwIDs = buildKeywordList($kwMap, $keywords); + $tsuiteMgr->addKeywords($tsuite['id'], $kwIDs); + } + + if ($attachments = getAttachmentsFromSimpleXMLObj( + $xml->attachments->attachment) && ! is_null($attachments)) { + if ($tsuiteXMLID == "" && $info[0]['id'] > 0) { // testsuite id is optionnal in XML schema, id may has been retrieved from name during update + $tsuiteXMLID = $info[0]['id']; + } + $msg = processAttachments($dbHandler, false, $tsuite['name'], + $tsuiteXMLID, $tsuite['id'], $attachments, $feedbackMsg); + if (! is_null($msg)) { + $resultMap = array_merge($resultMap, $msg); + } + } + + unset($tsuite); + } elseif ($importIntoProject) { + $tsuiteID = intval($tproject_id); + } + + $childrenNodes = $xml->children(); + $loop2do = count($childrenNodes); + + for ($idx = 0; $idx < $loop2do; $idx ++) { + + $target = $childrenNodes[$idx]; + switch ($target->getName()) { + case 'testcase': + // getTestCaseSetFromSimpleXMLObj() first argument must be an array + $tcData = getTestCaseSetFromSimpleXMLObj(array( + $target + )); + if (trim($tcData[0]['name']) == '') { + $xx = array( + lang_get('testcase_has_no_name'), + lang_get('testcase_has_no_name') + ); + $resultMap = array_merge($resultMap, array( + $xx + )); + } else { + $resultMap = array_merge($resultMap, + saveImportedTCData($dbHandler, $tcData, $tproject_id, + $tsuiteID, $userID, $kwMap, $duplicateLogic)); + } + unset($tcData); + break; + + case 'testsuite': + $resultMap = array_merge($resultMap, + $myself($dbHandler, $target, $tsuiteID, $tproject_id, + $userID, $kwMap, $importIntoProject, $duplicateLogic)); + break; + + // Important Development Notice + // Due to XML file structure, while looping + // we will find also this children: + // node_order,keywords,custom_fields,details + // + // It's processing to get and save values is done + // on other pieces of this code. + // + // Form a logical point of view seems the better + // to consider and process here testcase and testsuite as children. + } + } + } + return $resultMap; +} + +/** + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $guiObj = new stdClass(); + $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); + $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); + $guiObj->hitCriteria = $argsObj->hit_criteria; + $guiObj->useRecursion = $argsObj->useRecursion; + $guiObj->containerID = $argsObj->container_id; + $guiObj->bImport = tlStringLen($argsObj->importType); + $guiObj->bIntoProject = $argsObj->bIntoProject; + $guiObj->resultMap = null; + $guiObj->container_name = ''; + + $dest_common = TL_TEMP_PATH . session_id() . "-importtcs"; + $dest_files = array( + 'XML' => $dest_common . ".xml" + ); + $guiObj->dest = $dest_files['XML']; + if (! is_null($argsObj->importType)) { + $guiObj->dest = $dest_files[$argsObj->importType]; + } + + $guiObj->file_check = array( + 'status_ok' => 1, + 'msg' => 'ok' + ); + + if ($argsObj->useRecursion) { + $guiObj->import_title = lang_get('title_tsuite_import_to'); + $guiObj->container_description = lang_get('test_suite'); + } else { + $guiObj->import_title = lang_get('title_tc_import_to'); + $guiObj->container_description = lang_get('test_case'); + } + + if ($argsObj->container_id) { + $tree_mgr = new tree($dbHandler); + $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); + unset($tree_mgr); + $guiObj->container_name = $node_info['name']; + if ($argsObj->container_id == $argsObj->tproject_id) { + $guiObj->container_description = lang_get('testproject'); + } + } + + return $guiObj; +} + +/** + * + * @internal revisions + * @since 1.9.4 + * + */ +function processTestSuiteCF(&$tsuiteMgr, &$cfDefinition, &$cfValues, $tsuite) +{ + static $messages; + static $missingCfMsg; + + if (is_null($messages)) { + $messages = array(); + $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); + $messages['start_warning'] = lang_get('start_warning'); + $messages['end_warning'] = lang_get('end_warning'); + $messages['testlink_warning'] = lang_get('testlink_warning'); + $messages['start_feedback'] = $messages['start_warning'] . "\n" . + $messages['testlink_warning'] . "\n"; + $messages['cfield'] = lang_get( + 'cf_value_not_imported_missing_cf_on_testproject'); + $messages['tsuite'] = lang_get('testsuite'); + } + + $cf2insert = null; + $resultMsg = null; + foreach ($cfValues as $value) { + if (isset($cfDefinition[$value['name']])) { + $cf2insert[$cfDefinition[$value['name']]['id']] = array( + 'type_id' => $cfDefinition[$value['name']]['type'], + 'cf_value' => $value['value'] + ); + } else { + if (! isset($missingCfMsg[$value['name']])) { + $missingCfMsg[$value['name']] = sprintf($messages['cfield'], + $value['name'], $messages['tsuite']); + } + $resultMsg[] = array( + $tsuite['name'], + $missingCfMsg[$value['name']] + ); + } + } + $tsuiteMgr->cfield_mgr->design_values_to_db($cf2insert, $tsuite['id'], null, + 'simple'); + return $resultMsg; +} + +/** + */ +function getReqSpecSet(&$dbHandler, $tproject_id) +{ + $debugMsg = __FUNCTION__; + + $tables = tlObjectWithDB::getDBTables( + array( + 'req_specs', + 'nodes_hierarchy', + 'requirements' + )); + + // get always Latest Revision Req. Spec Title + $sql = "/* $debugMsg */ " . + " SELECT RSPEC.id, NHRSPEC.name AS title, RSPEC.doc_id AS rspec_doc_id, REQ.req_doc_id " . + " FROM {$tables['req_specs']} RSPEC " . + " JOIN {$tables['nodes_hierarchy']} NHRSPEC ON NHRSPEC.id = RSPEC.id " . + " JOIN {$tables['requirements']} REQ ON REQ.srs_id = RSPEC.id " . + " WHERE RSPEC.testproject_id = " . intval($tproject_id) . + " ORDER BY RSPEC.id,title"; + + return $dbHandler->fetchRowsIntoMap($sql, 'req_doc_id'); } - -if($args->useRecursion) { - $obj_mgr = new testsuite($db); - $gui->actionOptions = - array('update_last_version' => lang_get('update_last_testcase_version'), - 'generate_new' => lang_get('generate_new_testcase'), - 'create_new_version' => lang_get('create_new_testcase_version')); - - $gui->hitOptions=array('name' => lang_get('same_name'), - 'internalID' => lang_get('same_internalID'), - 'externalID' => lang_get('same_externalID')); -} else { - $obj_mgr = new testcase($db); - $obj_mgr->setTestProject($args->tproject_id); -} - -$gui->actionOptions = -array('skip' => lang_get('skip_testcase_import'), - 'update_last_version' => lang_get('update_last_testcase_version'), - 'generate_new' => lang_get('generate_new_testcase'), - 'create_new_version' => lang_get('create_new_testcase_version')); - -$gui->hitOptions = array('name' => lang_get('same_name'), - 'internalID' => lang_get('same_internalID'), - 'externalID' => lang_get('same_externalID')); - - -$gui->testprojectName = $_SESSION['testprojectName']; -$gui->importTypes = $obj_mgr->get_import_file_types(); -$gui->action_on_duplicated_name=$args->action_on_duplicated_name; - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -// -------------------------------------------------------------------------------------- -/* - function: importTestCaseDataFromXML - args : - returns: -*/ -function importTestCaseDataFromXML(&$db,$fileName,$parentID,$tproject_id,$userID,$options=null) { - - tLog('importTestCaseDataFromXML called for file: '. $fileName); - $xmlTCs = null; - $resultMap = null; - $my = array(); - $my['options'] = array('useRecursion' => false, 'importIntoProject' => 0, - 'duplicateLogic' => array('hitCriteria' => 'name', 'actionOnHit' => null)); - $my['options'] = array_merge($my['options'], (array)$options); - foreach($my['options'] as $varname => $value) { - $$varname = $value; - } - - if (file_exists($fileName)) { - $xml = @simplexml_load_file_wrapper($fileName); - if($xml !== FALSE) { - $xmlKeywords = $xml->xpath('//keywords'); - $kwMap = null; - if ($xmlKeywords) { - $tproject = new testproject($db); - $loop2do = sizeof($xmlKeywords); - for($idx = 0; $idx < $loop2do ;$idx++) { - $tproject->importKeywordsFromSimpleXML($tproject_id,$xmlKeywords[$idx]); - } - $kwMap = $tproject->get_keywords_map($tproject_id); - // change keywords to lowercase to be case insensitive - $kwMap = is_null($kwMap) ? null : array_change_key_case(array_flip($kwMap), CASE_LOWER); - } - - if (!$useRecursion && ($xml->getName() == 'testcases') ) { - $resultMap = importTestCasesFromSimpleXML($db,$xml,$parentID,$tproject_id,$userID,$kwMap,$duplicateLogic); - } - - if ($useRecursion && ($xml->getName() == 'testsuite')) { - $resultMap = importTestSuitesFromSimpleXML($db,$xml,intval($parentID),intval($tproject_id),$userID,$kwMap,$importIntoProject,$duplicateLogic); - } - } - } - return $resultMap; -} - - -// -------------------------------------------------------------------------------------- -/* - function: saveImportedTCData - args : - returns: -*/ -function saveImportedTCData(&$db,$tcData,$tproject_id,$container_id, - $userID,$kwMap,$duplicatedLogic = array('hitCriteria' => 'name', 'actionOnHit' => null)) -{ - static $messages; - static $fieldSizeCfg; - static $feedbackMsg; - static $tcase_mgr; - static $tproject_mgr; - static $req_spec_mgr; - static $req_mgr; - static $safeSizeCfg; - static $linkedCustomFields; - static $tprojectHas; - static $reqSpecSet; - static $getVersionOpt; - static $userObj; - static $tcasePrefix; - static $glueChar; - static $userRights; - - $ret = null; - - if (!$tcData) { - return; - } - - // $tprojectHas = array('customFields' => false, 'reqSpec' => false); - $hasCFieldsInfo = false; - $hasRequirements = false; - $hasAttachments = false; - - if(is_null($messages)) { - $feedbackMsg = array(); - $messages = array(); - $fieldSizeCfg = config_get('field_size'); - - $tcase_mgr = new testcase($db); - $tcase_mgr->setTestProject($tproject_id); - - $tproject_mgr = new testproject($db); - $req_spec_mgr = new requirement_spec_mgr($db); - $req_mgr = new requirement_mgr($db); - $userObj = new tlUser($userID); - $userObj->readFromDB($db,tlUser::TLOBJ_O_SEARCH_BY_ID); - - $userRights['can_edit_executed'] = - $userObj->hasRight($db,'testproject_edit_executed_testcases',$tproject_id); - $userRights['can_link_to_req'] = - $userObj->hasRight($db,'req_tcase_link_management',$tproject_id); - $userRights['can_assign_keywords'] = - $userObj->hasRight($db,'keyword_assignment',$tproject_id); - - $k2l = array('already_exists_updated','original_name','testcase_name_too_long', - 'already_exists_not_updated','already_exists_skipped', - 'start_warning','end_warning','testlink_warning', - 'hit_with_same_external_ID', - 'keywords_assignment_skipped_during_import', - 'req_assignment_skipped_during_import'); - - foreach($k2l as $k) { - $messages[$k] = lang_get($k); - } - - $messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n"; - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['reqspec_warning'] = lang_get('no_reqspec_defined_can_not_import'); - - - $feedbackMsg['cfield']=lang_get('cf_value_not_imported_missing_cf_on_testproject'); - $feedbackMsg['tcase'] = lang_get('testcase'); - $feedbackMsg['req'] = lang_get('req_not_in_req_spec_on_tcimport'); - $feedbackMsg['req_spec'] = lang_get('req_spec_ko_on_tcimport'); - $feedbackMsg['reqNotInDB'] = lang_get('req_not_in_DB_on_tcimport'); - $feedbackMsg['attachment'] = lang_get('attachment_skipped_during_import'); - - - // because name can be changed automatically during item creation - // to avoid name conflict adding a suffix automatically generated, - // is better to use a max size < max allowed size - $safeSizeCfg = new stdClass(); - $safeSizeCfg->testcase_name=($fieldSizeCfg->testcase_name) * 0.8; - - - // Get CF with scope design time and allowed for test cases linked to this test project - $linkedCustomFields = $tcase_mgr->cfield_mgr->get_linked_cfields_at_design($tproject_id,1,null,'testcase',null,'name'); - $tprojectHas['customFields']=!is_null($linkedCustomFields); - - $reqSpecSet = getReqSpecSet($db,$tproject_id); - - $tprojectHas['reqSpec'] = (!is_null($reqSpecSet) && count($reqSpecSet) > 0); - - $getVersionOpt = array('output' => 'minimun'); - $tcasePrefix = $tproject_mgr->getTestCasePrefix($tproject_id); - $glueChar = config_get('testcase_cfg')->glue_character; - } - - $resultMap = array(); - $tc_qty = sizeof($tcData); - $userIDCache = array(); - - for($idx = 0; $idx <$tc_qty ; $idx++) { - $tc = $tcData[$idx]; - $name = $tc['name']; - - $summary = $tc['summary']; - $steps = $tc['steps']; - $internalid = $tc['internalid']; - $externalid = $tc['externalid']; - - $doCreate = true; - if( $duplicatedLogic['actionOnHit'] == 'update_last_version' || - $duplicatedLogic['actionOnHit'] == 'skip' ) { - - $updOpt['blockIfExecuted'] = !$userRights['can_edit_executed']; - - switch($duplicatedLogic['hitCriteria']) { - case 'name': - $dupInfo = $tcase_mgr->getDuplicatesByName($name,$container_id); - break; - - case 'internalID': - $dummy = $tcase_mgr->tree_manager->get_node_hierarchy_info($internalid,$container_id); - if( !is_null($dummy) ) { - $dupInfo = null; - $dupInfo[$internalid] = $dummy; - } - break; - - case 'externalID': - $dupInfo = $tcase_mgr->get_by_external($externalid,$container_id); - break; - } - } - - // Check for skip, to avoid useless processing - if( $duplicatedLogic['actionOnHit'] == 'skip' && !is_null($dupInfo) && - count($dupInfo) > 0 ) { - $resultMap[] = array($name,$messages['already_exists_skipped']); - continue; - } - - // I've changed value to use when order has not been provided - // from testcase:DEFAULT_ORDER to a counter, because with original solution - // an issue arise with 'save execution and go next' - // if use has not provided order I think is OK TestLink make any choice. - $node_order = isset($tc['node_order']) ? intval($tc['node_order']) : ($idx+1); - $internalid = $tc['internalid']; - - $preconditions = $tc['preconditions']; - - $exec_type = isset($tc['execution_type']) ? $tc['execution_type'] : TESTCASE_EXECUTION_TYPE_MANUAL; - $importance = isset($tc['importance']) ? $tc['importance'] : MEDIUM; - - $attr = null; - if(isset($tc['estimated_exec_duration']) && !is_null($tc['estimated_exec_duration'])) { - $attr['estimatedExecDuration'] = trim($tc['estimated_exec_duration']); - $attr['estimatedExecDuration'] = $attr['estimatedExecDuration']=='' ? null : floatval($attr['estimatedExecDuration']); - } - - if(isset($tc['is_open'])) { - $attr['is_open'] = trim($tc['is_open']); - } - - if(isset($tc['active'])) { - $attr['active'] = trim($tc['active']); - } - - if(isset($tc['status'])) { - $attr['status'] = trim($tc['status']); - } - - $externalid = $tc['externalid']; - if( intval($externalid) <= 0 ) { - $externalid = null; - } - - $personID = $userID; - if( !is_null($tc['author_login']) ) { - if( isset($userIDCache[$tc['author_login']]) ) { - $personID = $userIDCache[$tc['author_login']]; - } else { - $userObj->login = $tc['author_login']; - if( $userObj->readFromDB($db,tlUser::USER_O_SEARCH_BYLOGIN) == tl::OK ) { - $personID = $userObj->dbID; - } - - // I will put always a valid userID on this cache, - // this way if author_login does not exit, and is used multiple times - // i will do check for existence JUST ONCE. - $userIDCache[$tc['author_login']] = $personID; - } - } - - $name_len = tlStringLen($name); - if($name_len > $fieldSizeCfg->testcase_name) { - // Will put original name inside summary - $xx = $messages['start_feedback']; - $xx .= sprintf($messages['testcase_name_too_long'],$name_len, $fieldSizeCfg->testcase_name) . "\n"; - $xx .= $messages['original_name'] . "\n" . $name. "\n" . $messages['end_warning'] . "\n"; - $tcCfg = getWebEditorCfg('design'); - $tcType = $tcCfg['type']; - if ($tcType == 'none'){ - $summary = $xx . $summary ; - } else{ - $summary = nl2br($xx) . $summary ; - } - $name = tlSubStr($name, 0, $safeSizeCfg->testcase_name); - } - - - $kwIDs = null; - if (isset($tc['keywords']) && $tc['keywords']) { - if(!$userRights['can_assign_keywords']){ - $resultMap[] = - array($name,$messages['keywords_assignment_skipped_during_import']); - } else{ - $kwIDs = implode(",",buildKeywordList($kwMap,$tc['keywords'])); - } - } - - // More logic regarding Action on Duplicate - if( $duplicatedLogic['actionOnHit'] == 'update_last_version' && - !is_null($dupInfo) ) { - - $tcase_qty = count($dupInfo); - - switch($tcase_qty) { - case 1: - $doCreate=false; - $tcase_id = key($dupInfo); - $last_version = $tcase_mgr->get_last_version_info($tcase_id, - $getVersionOpt); - $tcversion_id = $last_version['id']; - $ret = $tcase_mgr->update($tcase_id,$tcversion_id,$name, - $summary, - $preconditions,$steps,$personID, - $kwIDs, - $node_order,$exec_type,$importance, - $attr,$updOpt); - - $ret['id'] = $tcase_id; - $ret['tcversion_id'] = $tcversion_id; - if( $ret['status_ok'] ) { - $resultMap[] = array($name,$messages['already_exists_updated']); - } else { - if($ret['reason'] == '') { - $resultMap[] = array($name, - sprintf($messages['already_exists_not_updated'], - $tcasePrefix . $glueChar . $externalid, - $tcasePrefix . $glueChar . $ret['hit_on']['tc_external_id'])); - } else { - $resultMap[] = array($name,$ret['msg']); - } - } - break; - - case 0: - $doCreate=true; - break; - - default: - $doCreate=false; - break; - } - } - - if( $doCreate ) { - // Want to block creation of with existent EXTERNAL ID, if containers ARE DIFFERENT. - $item_id = intval($tcase_mgr->getInternalID($externalid, array('tproject_id' => $tproject_id))); - - if( $item_id > 0) { - // who is his parent ? - $owner = $tcase_mgr->getTestSuite($item_id); - if( $owner != $container_id) { - // Get full path of existent Test Cases - $stain = $tcase_mgr->tree_manager->get_path($item_id,null, 'name'); - $n = count($stain); - $stain[$n-1] = $tcasePrefix . config_get('testcase_cfg')->glue_character . $externalid . ':' . $stain[$n-1]; - $stain = implode('/',$stain); - - $resultMap[] = array($name,$messages['hit_with_same_external_ID'] . $stain); - $doCreate = false; - } - } - } - - if( $doCreate ) { - $createOptions = - array('check_duplicate_name' => testcase::CHECK_DUPLICATE_NAME, - 'action_on_duplicate_name' => $duplicatedLogic['actionOnHit'], - 'external_id' => $externalid, 'importLogic' => $duplicatedLogic); - - if(!is_null($attr) ) { - $createOptions += $attr; - } - - if ( $ret = $tcase_mgr->create($container_id,$name,$summary,$preconditions, - $steps,$personID,$kwIDs,$node_order, - testcase::AUTOMATIC_ID, - $exec_type,$importance,$createOptions) ) { - $resultMap[] = array($name,$ret['msg']); - } - } - - // Custom Fields Management - // Check if CF with this name and that can be used on Test Cases - // is defined in current Test Project. - // If Check fails => give message to user. - // Else Import CF data - // - $hasCFieldsInfo = (isset($tc['customfields']) && - !is_null($tc['customfields'])); - - - if($hasCFieldsInfo && !is_null($ret)) { - if($tprojectHas['customFields']) { - $msg = processCustomFields($tcase_mgr,$name,$ret['id'],$ret['tcversion_id'], - $tc['customfields'],$linkedCustomFields,$feedbackMsg); - if( !is_null($msg) ) { - $resultMap = array_merge($resultMap,$msg); - } - } else { - // Can not import Custom Fields Values, give feedback - $msg[]=array($name,$messages['cf_warning']); - $resultMap = array_merge($resultMap,$msg); - } - } - - $hasRequirements=(isset($tc['requirements']) && !is_null($tc['requirements'])); - - if($hasRequirements) { - if( $tprojectHas['reqSpec'] ) { - - if(!$userRights['can_link_to_req']){ - $msg[]=array($name,$messages['req_assignment_skipped_during_import']); - } else{ - $msg = processRequirements($db,$req_mgr,$name,$ret,$tc['requirements'], - $reqSpecSet,$feedbackMsg,$userID); - } - - if( !is_null($msg) ) { - $resultMap = array_merge($resultMap,$msg); - } - } else { - $msg[]=array($name,$messages['reqspec_warning']); - $resultMap = array_merge($resultMap,$msg); - } - } - - - $hasAttachments=(isset($tc['attachments']) && !is_null($tc['attachments'])); - if($hasAttachments) { - $fk_id = $doCreate ? $ret['tcversion_id'] : $internalid; - - if ($internalid == "" && $item_id>0) { - $internalid = $item_id; - } - - - $msg = processAttachments( $db, true, $name, $internalid, $fk_id, $tc['attachments'], $feedbackMsg ); - if( !is_null($msg) ) { - $resultMap = array_merge($resultMap,$msg); - } - } - - } - - return $resultMap; -} - - -// ------------------------------------------------------------------------------- -/* - function: buildKeywordList - - Build the list of DB ID of the keywords used in the XML. - - args : - returns: -*/ -function buildKeywordList($kwMap,$keywords) { - $items = array(); - $loop2do = sizeof($keywords); - for($jdx = 0; $jdx <$loop2do ; $jdx++) { - // change Map keys (keyword) to lowercase to be case insensitive - $items[] = $kwMap[strtolower(trim($keywords[$jdx]['name']))]; - } - return $items; -} - - -// ---------------------------------------------------------------------------------- - -// ------------------------------------------------------------------------------------ - -/* - function: Check if at least the file starts seems OK -*/ -function check_xml_tc_tsuite($fileName,$recursiveMode) { - $xml = @simplexml_load_file_wrapper($fileName); - $file_check = array('status_ok' => 0, 'msg' => 'xml_load_ko'); - if($xml !== FALSE) - { - $file_check = array('status_ok' => 1, 'msg' => 'ok'); - $elementName = $xml->getName(); - if($recursiveMode) - { - if($elementName != 'testsuite') - { - $file_check=array('status_ok' => 0, 'msg' => lang_get('wrong_xml_tsuite_file')); - } - } - else - { - if($elementName != 'testcases' && $elementName != 'testcase') - { - $file_check=array('status_ok' => 0, 'msg' => lang_get('wrong_xml_tcase_file')); - } - } - } - return $file_check; -} - - - -/* contribution by mirosvad - - Convert new line characters from XLS to HTML -*/ -function nl2p($str) -{ - return str_replace('

    ', '', '

    ' . preg_replace('#\n|\r#', '

    $0

    ', $str) . '

    '); //MS -} - - -/* - function: - - args : - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $key='action_on_duplicated_name'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'generate_new'; - - $key='hit_criteria'; - $args->$key = isset($_REQUEST[$key]) ? $_REQUEST[$key] : 'name'; - - - $args->importType = isset($_REQUEST['importType']) ? $_REQUEST['importType'] : null; - $args->useRecursion = isset($_REQUEST['useRecursion']) ? $_REQUEST['useRecursion'] : 0; - $args->location = isset($_REQUEST['location']) ? $_REQUEST['location'] : null; - $args->container_id = isset($_REQUEST['containerID']) ? intval($_REQUEST['containerID']) : 0; - $args->bIntoProject = isset($_REQUEST['bIntoProject']) ? intval($_REQUEST['bIntoProject']) : 0; - - $args->containerType = isset($_REQUEST['containerType']) ? intval($_REQUEST['containerType']) : 0; - $args->do_upload = isset($_REQUEST['UploadFile']) ? 1 : 0; - - $args->userID = $_SESSION['userID']; - $args->tproject_id = $_SESSION['testprojectID']; - - return $args; -} - - -/** - * processCustomFields - * - * Analise custom field info related to test case being imported. - * If everything OK, assign to test case. - * Else return an array of messages. - * - * - * @internal revisions - * 20100905 - franciscom - BUGID 3431 - Custom Field values at Test Case VERSION Level - */ -function processCustomFields(&$tcaseMgr,$tcaseName,$tcaseId,$tcversionId,$cfValues,$cfDefinition,$messages) -{ - static $missingCfMsg; - $cf2insert=null; - $resultMsg=null; - - foreach($cfValues as $value) - { - if( isset($cfDefinition[$value['name']]) ) - { - $cf2insert[$cfDefinition[$value['name']]['id']]=array('type_id' => $cfDefinition[$value['name']]['type'], - 'cf_value' => $value['value']); - } - else - { - if( !isset($missingCfMsg[$value['name']]) ) - { - $missingCfMsg[$value['name']] = sprintf($messages['cfield'],$value['name'],$messages['tcase']); - } - $resultMsg[] = array($tcaseName,$missingCfMsg[$value['name']]); - } - } - - $tcaseMgr->cfield_mgr->design_values_to_db($cf2insert,$tcversionId,null,'simple'); - return $resultMsg; -} - -/** - * processRequirements - * - * Analise requirements info related to test case being imported. - * If everything OK, assign to test case. - * Else return an array of messages. - * - */ -function processRequirements(&$dbHandler,&$reqMgr,$tcaseName,$tcIDCard, - $tcReq,$reqSpecSet,$messages,$userID) { - - static $missingReqMsg; - static $missingReqSpecMsg; - static $missingReqInDBMsg; - static $cachedReqSpec; - - $resultMsg = null; - $tables = tlObjectWithDB::getDBTables(array('requirements')); - - // Since 1.9.18, links are between req version e test case version - // We will work on latest test case version and lates req version - // - $tcaseId = $tcIDCard['id']; - $latestTCVersionID = $tcIDCard['tcversion_id']; - - foreach($tcReq as $ydx => $value) { - $cachedReqSpec=array(); - $doit=false; - - // Look for req doc id we get from file, inside Req Spec Set - // we got from DB - if( ($doit=isset($reqSpecSet[$value['doc_id']])) ) { - if( !(isset($cachedReqSpec[$value['req_spec_title']])) ) { - // $cachedReqSpec - // key: Requirement Specification Title get from file - // value: map with follogin keys - // id => requirement specification id from DB - // req => map with key: requirement document id - $cachedReqSpec[$value['req_spec_title']]['id'] = - $reqSpecSet[$value['doc_id']]['id']; - - $cachedReqSpec[$value['req_spec_title']]['req']=null; - } - } - - if($doit) { - $useit = false; - $req_spec_id = $cachedReqSpec[$value['req_spec_title']]['id']; - - // Check if requirement with desired document id exists - // on requirement specification on DB. - // If not => create message for user feedback. - if( !($useit=isset($cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']])) ) { - - $sql = " SELECT REQ.id from {$tables['requirements']} REQ " . - " WHERE REQ.req_doc_id='{$dbHandler->prepare_string($value['doc_id'])}' " . - " AND REQ.srs_id={$req_spec_id} "; - - $rsx = $dbHandler->get_recordset($sql); - if( $useit=((!is_null($rsx) && count($rsx) > 0) ? true : false) ) { - $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']]=$rsx[0]['id']; - } - } - - if($useit) { - // $reqMgr->assign_to_tcase($cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']],$tcaseId,$userID); - $reqMgr->assignToTCaseUsingLatestVersions( - $cachedReqSpec[$value['req_spec_title']]['req'][$value['doc_id']], - $tcaseId,$userID); - - } - else { - if( !isset($missingReqMsg[$value['doc_id']]) ) { - $missingReqMsg[$value['doc_id']]=sprintf($messages['req'], - $value['doc_id'],$value['req_spec_title']); - } - $resultMsg[] = array($tcaseName,$missingReqMsg[$value['doc_id']]); - } - } else { - // We didnt find Req Doc ID in Req Spec Set got from DB - if( !isset($missingReqInDBMsg[$value['doc_id']]) ) { - $missingReqInDBMsg[$value['doc_id']]=sprintf($messages['reqNotInDB'], - $value['doc_id'],''); - } - $resultMsg[] = array($tcaseName,$missingReqInDBMsg[$value['doc_id']]); - } - - } //foreach - - return $resultMsg; -} - -/** - * processAttachments - * - * Analyze attachments info related to testcase or testsuite to define if the the attachment has to be saved. - * If attachment format is OK and attachment is not already in database for the target, save the attachment. - * Else return an array of messages. - * - */ -function processAttachments( &$dbHandler, $isTestCase, $tcaseName, $xmlInternalID, $fk_Id, $tcAtt, $messages ) -{ - static $duplicateAttachment; - $resultMsg=null; - $tables = tlObjectWithDB::getDBTables(array('nodes_hierarchy','attachments','tcversions')); - - foreach( $tcAtt as $ydx => $value ) { - $addAttachment = false; - - // Is it a CREATION or an UPDATE? - if( $xmlInternalID == $fk_Id ) // internalID matches, seems to be an update - { - // try to bypass the importation of already known attachments. - // Check in database if the attachment with the same ID is linked to the testcase/testsuite with the same internal ID - // The couple attachment ID + InternalID is used as a kind of signature to avoid duplicates. - // If signature is not precise enough, could add the use of attachment timestamp (date_added in XML file). - $sql = " SELECT ATT.id from {$tables['attachments']} ATT " . - " WHERE ATT.id='{$dbHandler->prepare_string($value['id'])}' " . - " AND ATT.fk_id={$fk_Id} "; - - $rsx=$dbHandler->get_recordset($sql); - // allow attachment import only if no record with the same signature have been found in database - $addAttachment = ( is_null($rsx) || count($rsx) < 1 ); - if( $addAttachment === false ){ // inform user that the attachment has been skipped - if( !isset($duplicateAttachment[$value['id']]) ) { - $duplicateAttachment[$value['id']]=sprintf($messages['attachment'],$value['name']); - } - $resultMsg[] = array($tcaseName,$duplicateAttachment[$value['id']]); - } - - } else{ - // Creation - $addAttachment = true; - } - - if( $addAttachment ) { - $attachRepo = tlAttachmentRepository::create($dbHandler); - - $fileInfo = $attachRepo->createAttachmentTempFile( $value['content'] ); - $fileInfo['name'] = $value['name']; - $fileInfo['type'] = $value['file_type']; - $tableRef = $tables['nodes_hierarchy']; - if ($isTestCase) { - $tableRef = $tables['tcversions']; - } - $iaOp = $attachRepo->insertAttachment( $fk_Id, $tableRef, $value['title'], $fileInfo); - } - } //foreach - - return $resultMsg; -} - - - -/** - * - * - */ -function importTestCasesFromSimpleXML(&$db,&$simpleXMLObj,$parentID,$tproject_id,$userID,$kwMap,$duplicateLogic) { - $resultMap = null; - $xmlTCs = $simpleXMLObj->xpath('//testcase'); - $tcData = getTestCaseSetFromSimpleXMLObj($xmlTCs); - - if ($tcData) { - $resultMap = saveImportedTCData($db,$tcData,$tproject_id,$parentID,$userID,$kwMap,$duplicateLogic); - } - return $resultMap; -} - -/** - * - * - * @internal revisions - */ -function getTestCaseSetFromSimpleXMLObj($xmlTCs) -{ - static $cfg; - if (!$cfg) { - $cfg = config_get('testcase_cfg')->import; - } - - $tcSet = null; - if (!$xmlTCs) - { - return $tcSet; - } - - $jdx = 0; - $loops2do=sizeof($xmlTCs); - $tcaseSet = array(); - - // $tcXML['elements'] = array('string' => array("summary","preconditions"), - // 'integer' => array("node_order","externalid","execution_type","importance")); - // $tcXML['attributes'] = array('string' => array("name"), 'integer' =>array('internalid')); - - // TICKET 4963: Test case / Tes suite XML format, new element to set author - $tcXML['elements'] = array('string' => array("summary" => null,"preconditions" => null, - "author_login" => null,"estimated_exec_duration" => null), - 'integer' => array("node_order" => null,"externalid" => null,"is_open" => null,"active" => null,"status" => null, - "execution_type" => null ,"importance" => null)); - $tcXML['attributes'] = array('string' => array("name" => 'trim'), - 'integer' =>array('internalid' => null)); - - - for($idx = 0; $idx < $loops2do; $idx++) - { - $dummy = getItemsFromSimpleXMLObj(array($xmlTCs[$idx]),$tcXML); - $tc = $dummy[0]; - if ($tc) { - - if ($cfg->wordwrap->summary > 0) { - $tc['summary'] = wordwrap($tc['summary'],$cfg->wordwrap->summary); - } - if ($cfg->wordwrap->preconditions > 0) { - $tc['preconditions'] = wordwrap($tc['preconditions'],$cfg->wordwrap->preconditions); - } - - - // Test Case Steps - $steps = getStepsFromSimpleXMLObj($xmlTCs[$idx]->steps->step); - $tc['steps'] = $steps; - - if ($cfg->wordwrap->actions > 0 || $cfg->wordwrap->expected_results > 0) { - foreach ($tc['steps'] as $sdx => $elem) { - - if ($cfg->wordwrap->actions > 0) { - $tc['steps'][$sdx]['actions'] = wordwrap($tc['steps'][$sdx]['actions'], - $cfg->wordwrap->actions); - } - - if ($cfg->wordwrap->expected_results > 0) { - $tc['steps'][$sdx]['expected_results'] = wordwrap($tc['steps'][$sdx]['expected_results'], - $cfg->wordwrap->expected_results); - } - } - } - - $keywords = getKeywordsFromSimpleXMLObj($xmlTCs[$idx]->keywords->keyword); - if ($keywords) - { - $tc['keywords'] = $keywords; - } - - $cf = getCustomFieldsFromSimpleXMLObj($xmlTCs[$idx]->custom_fields->custom_field); - if($cf) - { - $tc['customfields'] = $cf; - } - - $requirements = getRequirementsFromSimpleXMLObj($xmlTCs[$idx]->requirements->requirement); - if($requirements) { - $tc['requirements'] = $requirements; - } - - $attachments = getAttachmentsFromSimpleXMLObj($xmlTCs[$idx]->attachments->attachment); - if($attachments) { - $tc['attachments'] = $attachments; - } - } - $tcaseSet[$jdx++] = $tc; - } - return $tcaseSet; -} - - -/** - * - * - * @internal revisions - */ -function getStepsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("actions"=>null,"expectedresults" => null), - 'integer' => array("step_number" => null,"execution_type" => null)); - - // 20110205 - franciscom - seems key 'transformations' is not managed on - // getItemsFromSimpleXMLObj(), then ??? is useless??? - $itemStructure['transformations'] = array("expectedresults" => "expected_results"); - - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - - // need to do this due to (maybe) a wrong name choice for XML element - if( !is_null($items) ) - { - $loop2do = count($items); - for($idx=0; $idx < $loop2do; $idx++) - { - $items[$idx]['expected_results'] = ''; - if( isset($items[$idx]['expectedresults']) ) - { - $items[$idx]['expected_results'] = $items[$idx]['expectedresults']; - unset($items[$idx]['expectedresults']); - } - } - } - return $items; -} - -function getCustomFieldsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("name" => 'trim',"value" => 'trim')); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; - -} - -function getRequirementsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("req_spec_title" => 'trim', - "doc_id" => 'trim' ,"title" => 'trim' )); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; -} - -function getAttachmentsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("id" => 'trim', "name" => 'trim', - "file_type" => 'trim' ,"title" => 'trim', - "date_added" => 'trim' ,"content" => 'trim' )); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; -} - -function getKeywordsFromSimpleXMLObj($simpleXMLItems) -{ - $itemStructure['elements'] = array('string' => array("notes" => null)); - $itemStructure['attributes'] = array('string' => array("name" => 'trim')); - $items = getItemsFromSimpleXMLObj($simpleXMLItems,$itemStructure); - return $items; -} - - -/* - function: importTestSuite - args : - returns: - - @internal revisions - 20120623 - franciscom - TICKET 5070 - test suite custom fields import - -*/ -function importTestSuitesFromSimpleXML(&$dbHandler,&$xml,$parentID,$tproject_id, - $userID,$kwMap,$importIntoProject = 0,$duplicateLogic) -{ - static $tsuiteXML; - static $tsuiteMgr; - static $myself; - static $callCounter = 0; - static $cfSpec; - static $doCF; - static $feedbackMsg; - - $feedbackMsg['attachment'] = lang_get('attachment_skipped_during_import'); - - $resultMap = array(); - if(is_null($tsuiteXML) ) - { - $myself = __FUNCTION__; - $tsuiteXML = array(); - $tsuiteXML['elements'] = array('string' => array("details" => null), - 'integer' => array("node_order" => null)); - $tsuiteXML['attributes'] = array('string' => array("name" => 'trim'), - 'integer' =>array('id' => null)); - - $tsuiteMgr = new testsuite($dbHandler); - $doCF = !is_null(($cfSpec = $tsuiteMgr->get_linked_cfields_at_design(null,null,null, - $tproject_id,'name'))); - } - - if($xml->getName() == 'testsuite') - { - - - // getItemsFromSimpleXMLObj() first argument must be an array - $dummy = getItemsFromSimpleXMLObj(array($xml),$tsuiteXML); - $tsuite = current($dummy); - $tsuiteXMLID = $dummy[0]['id']; - $tsuiteID = $parentID; // hmmm, not clear - - if ($tsuite['name'] != "") - { - // Check if Test Suite with this name exists on this container - // if yes -> update instead of create - $info = $tsuiteMgr->get_by_name($tsuite['name'],$parentID); - if( is_null($info) ) - { - $ret = $tsuiteMgr->create($parentID,$tsuite['name'],$tsuite['details'],$tsuite['node_order']); - $tsuite['id'] = $ret['id']; - } - else - { - $ret = $tsuiteMgr->update(($tsuite['id'] = $info[0]['id']),$tsuite['name'],$tsuite['details'], - null,$tsuite['node_order']); - - } - unset($dummy); - - $tsuiteID = $tsuite['id']; // $tsuiteID is needed on more code pieces => DO NOT REMOVE - if (!$tsuite['id']) - { - return null; - } - - if($doCF) - { - $cf = getCustomFieldsFromSimpleXMLObj($xml->custom_fields->custom_field); - if(!is_null($cf)) - { - processTestSuiteCF($tsuiteMgr,$xml,$cfSpec,$cf,$tsuite,$tproject_id); - } - } - - if( $keywords = getKeywordsFromSimpleXMLObj($xml->keywords->keyword) ) - { - $kwIDs = buildKeywordList($kwMap,$keywords); - $tsuiteMgr->addKeywords($tsuite['id'],$kwIDs); - } - - if( $attachments = getAttachmentsFromSimpleXMLObj($xml->attachments->attachment) ) - { - if(!is_null($attachments)) - { - if ($tsuiteXMLID == "" && $info[0]['id']>0){ // testsuite id is optionnal in XML schema, id may has been retrieved from name during update - $tsuiteXMLID = $info[0]['id']; - } - $msg = processAttachments( $dbHandler, false, $tsuite['name'], $tsuiteXMLID, $tsuite['id'], $attachments, $feedbackMsg ); - if( !is_null($msg) ) - { - $resultMap = array_merge($resultMap,$msg); - } - } - } - - unset($tsuite); - } - else if($importIntoProject) - { - $tsuiteID = intval($tproject_id); - } - - $childrenNodes = $xml->children(); - $loop2do = sizeof($childrenNodes); - - for($idx = 0; $idx < $loop2do; $idx++) { - - $target = $childrenNodes[$idx]; - switch($target->getName()) { - case 'testcase': - // getTestCaseSetFromSimpleXMLObj() first argument must be an array - $tcData = getTestCaseSetFromSimpleXMLObj(array($target)); - if( trim($tcData[0]['name']) == '' ) { - $xx = array(lang_get('testcase_has_no_name'),lang_get('testcase_has_no_name')); - $resultMap = array_merge($resultMap,array($xx)); - } else { - $resultMap = array_merge($resultMap, - saveImportedTCData($dbHandler,$tcData,$tproject_id, - $tsuiteID,$userID,$kwMap,$duplicateLogic)); - } - unset($tcData); - break; - - case 'testsuite': - $resultMap = array_merge($resultMap, - $myself($dbHandler,$target,$tsuiteID,$tproject_id, - $userID,$kwMap,$importIntoProject,$duplicateLogic)); - break; - - - // Important Development Notice - // Due to XML file structure, while looping - // we will find also this children: - // node_order,keywords,custom_fields,details - // - // It's processing to get and save values is done - // on other pieces of this code. - // - // Form a logical point of view seems the better - // to consider and process here testcase and testsuite as children. - // - } - } - } - return $resultMap; -} - - -/** - * - * - * - **/ -function initializeGui(&$dbHandler,&$argsObj) -{ - $guiObj = new stdClass(); - $guiObj->importLimitBytes = config_get('import_file_max_size_bytes'); - $guiObj->importLimitKB = ($guiObj->importLimitBytes / 1024); - $guiObj->hitCriteria = $argsObj->hit_criteria; - $guiObj->useRecursion = $argsObj->useRecursion; - $guiObj->containerID = $argsObj->container_id; - $guiObj->bImport = tlStringLen($argsObj->importType); - $guiObj->bIntoProject = $argsObj->bIntoProject; - $guiObj->resultMap = null; - $guiObj->container_name = ''; - - - $dest_common = TL_TEMP_PATH . session_id(). "-importtcs"; - $dest_files = array('XML' => $dest_common . ".xml"); - $guiObj->dest = $dest_files['XML']; - if(!is_null($argsObj->importType)) - { - $guiObj->dest = $dest_files[$argsObj->importType]; - } - - $guiObj->file_check = array('status_ok' => 1, 'msg' => 'ok'); - - if($argsObj->useRecursion) - { - $guiObj->import_title = lang_get('title_tsuite_import_to'); - $guiObj->container_description = lang_get('test_suite'); - } - else - { - $guiObj->import_title = lang_get('title_tc_import_to'); - $guiObj->container_description = lang_get('test_case'); - } - - if($argsObj->container_id) - { - $tree_mgr = new tree($dbHandler); - $node_info = $tree_mgr->get_node_hierarchy_info($argsObj->container_id); - unset($tree_mgr); - $guiObj->container_name = $node_info['name']; - if($argsObj->container_id == $argsObj->tproject_id) - { - $guiObj->container_description = lang_get('testproject'); - } - } - - return $guiObj; -} - -/** - * - * - * @internal revisions - * @since 1.9.4 - * - **/ -function processTestSuiteCF(&$tsuiteMgr,$xmlObj,&$cfDefinition,&$cfValues,$tsuite,$tproject_id) -{ - - static $messages; - static $missingCfMsg; - - if(is_null($messages)) { - $messages = array(); - $messages['cf_warning'] = lang_get('no_cf_defined_can_not_import'); - $messages['start_warning'] = lang_get('start_warning'); - $messages['end_warning'] = lang_get('end_warning'); - $messages['testlink_warning'] = lang_get('testlink_warning'); - $messages['start_feedback'] = $messages['start_warning'] . "\n" . $messages['testlink_warning'] . "\n"; - $messages['cfield'] = lang_get('cf_value_not_imported_missing_cf_on_testproject'); - $messages['tsuite'] = lang_get('testsuite'); - } - - $cf2insert=null; - $resultMsg=null; - foreach($cfValues as $value) - { - if( isset($cfDefinition[$value['name']]) ) - { - $cf2insert[$cfDefinition[$value['name']]['id']]=array('type_id' => $cfDefinition[$value['name']]['type'], - 'cf_value' => $value['value']); - } - else - { - if( !isset($missingCfMsg[$value['name']]) ) - { - $missingCfMsg[$value['name']] = sprintf($messages['cfield'],$value['name'],$messages['tsuite']); - } - $resultMsg[] = array($tsuite['name'],$missingCfMsg[$value['name']]); - } - } - $tsuiteMgr->cfield_mgr->design_values_to_db($cf2insert,$tsuite['id'],null,'simple'); - return $resultMsg; -} - -/** - * - */ -function getReqSpecSet(&$dbHandler,$tproject_id) -{ - $debugMsg = __FUNCTION__; - - $tables = tlObjectWithDB::getDBTables(array('req_specs','nodes_hierarchy','requirements')); - - // get always Latest Revision Req. Spec Title - $sql = "/* $debugMsg */ " . - " SELECT RSPEC.id, NHRSPEC.name AS title, RSPEC.doc_id AS rspec_doc_id, REQ.req_doc_id " . - " FROM {$tables['req_specs']} RSPEC " . - " JOIN {$tables['nodes_hierarchy']} NHRSPEC ON NHRSPEC.id = RSPEC.id " . - " JOIN {$tables['requirements']} REQ ON REQ.srs_id = RSPEC.id " . - " WHERE RSPEC.testproject_id = " . intval($tproject_id) . - " ORDER BY RSPEC.id,title"; - - $rs = $dbHandler->fetchRowsIntoMap($sql,'req_doc_id'); - - return $rs; -} \ No newline at end of file diff --git a/lib/testcases/tcPrint.php b/lib/testcases/tcPrint.php index ff9f989a09..b2793ab6f5 100644 --- a/lib/testcases/tcPrint.php +++ b/lib/testcases/tcPrint.php @@ -1,101 +1,123 @@ -get_node_hierarchy_info($args->tcase_id); -$node['tcversion_id'] = $args->tcversion_id; -$gui = initializeGui($args,$node); - - -// Struture defined in printDocument.php -$printingOptions = array('toc' => 0,'body' => 1,'summary' => 1, - 'header' => 0,'headerNumbering' => 0, - 'passfail' => 0, 'author' => 1, 'notes' => 0, 'requirement' => 1, - 'keyword' => 1, 'cfields' => 1, 'displayVersion' => 1, - 'displayDates' => 1, - 'docType' => SINGLE_TESTCASE, 'importance' => 1,'platform' => 1); - -$level = 0; -$tplanID = 0; -$prefix = null; -$text2print = ''; -$text2print .= renderHTMLHeader($gui->page_title,$_SESSION['basehref'], - SINGLE_TESTCASE,array('gui/javascript/testlink_library.js')); - -$env = new stdClass(); -$env->base_href = $_SESSION['basehref']; -$env->reportType = $printingOptions['docType']; - -$text2print .= renderTestCaseForPrinting($db,$node,$printingOptions,$env, - array('level' => $level,'tplan_id' => $tplanID, - 'tproject_id' => $args->tproject_id,'prefix' => $prefix),$level); - -echo $text2print; - -/* - function: init_args - - args: - - returns: - -*/ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $args->tcase_id = intval(isset($_REQUEST['testcase_id']) ? intval($_REQUEST['testcase_id']) : 0); - $args->tcversion_id = intval(isset($_REQUEST['tcversion_id']) ? intval($_REQUEST['tcversion_id']) : 0); - $args->tproject_id = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - - $args->tproject_name = $_SESSION['testprojectName']; - $args->goback_url=isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; - - - $ofd = array('HTML' => lang_get('format_html'),'ODT' => lang_get('format_odt'), - 'MSWORD' => lang_get('format_msword')); - $args->outputFormat = isset($_REQUEST['outputFormat']) ? $_REQUEST['outputFormat'] : null; - $args->outputFormat = isset($ofd[$args->outputFormat]) ? $ofd[$args->outputFormat] : null; - - $args->outputFormatDomain = array('NONE' => '') + $ofd; - return $args; -} - -/** - * - */ -function initializeGui(&$argsObj,&$node) -{ - $guiObj = new stdClass(); - $guiObj->outputFormatDomain = $argsObj->outputFormatDomain; - $guiObj->object_name=''; - $guiObj->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - $guiObj->object_name = $node['name']; - $guiObj->page_title = sprintf(lang_get('print_testcase'),$node['name']); - $guiObj->tproject_name=$argsObj->tproject_name; - $guiObj->tproject_id=$argsObj->tproject_id; - $guiObj->tcase_id=$argsObj->tcase_id; - $guiObj->tcversion_id=$argsObj->tcversion_id; - - return $guiObj; +get_node_hierarchy_info($args->tcase_id); +$node['tcversion_id'] = $args->tcversion_id; +$gui = initializeGui($args, $node); + +// Struture defined in printDocument.php +$printingOptions = array( + 'toc' => 0, + 'body' => 1, + 'summary' => 1, + 'header' => 0, + 'headerNumbering' => 0, + 'passfail' => 0, + 'author' => 1, + 'notes' => 0, + 'requirement' => 1, + 'keyword' => 1, + 'cfields' => 1, + 'displayVersion' => 1, + 'displayDates' => 1, + 'docType' => SINGLE_TESTCASE, + 'importance' => 1, + 'platform' => 1 +); + +$level = 0; +$tplanID = 0; +$prefix = null; +$text2print = ''; +$text2print .= renderHTMLHeader($gui->page_title, $_SESSION['basehref'], + SINGLE_TESTCASE, array( + 'gui/javascript/testlink_library.js' + )); + +$env = new stdClass(); +$env->base_href = $_SESSION['basehref']; +$env->reportType = $printingOptions['docType']; + +$text2print .= renderTestCaseForPrinting($db, $node, $printingOptions, $env, + array( + 'level' => $level, + 'tplan_id' => $tplanID, + 'tproject_id' => $args->tproject_id, + 'prefix' => $prefix + ), $level); + +echo $text2print; + +/* + * function: init_args + * + * args: + * + * returns: + * + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $args = new stdClass(); + $args->tcase_id = intval( + isset($_REQUEST['testcase_id']) ? intval($_REQUEST['testcase_id']) : 0); + $args->tcversion_id = intval( + isset($_REQUEST['tcversion_id']) ? intval($_REQUEST['tcversion_id']) : 0); + $args->tproject_id = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + + $args->tproject_name = $_SESSION['testprojectName']; + $args->goback_url = isset($_REQUEST['goback_url']) ? $_REQUEST['goback_url'] : null; + + $ofd = array( + 'HTML' => lang_get('format_html'), + 'ODT' => lang_get('format_odt'), + 'MSWORD' => lang_get('format_msword') + ); + $args->outputFormat = isset($_REQUEST['outputFormat']) ? $_REQUEST['outputFormat'] : null; + $args->outputFormat = isset($ofd[$args->outputFormat]) ? $ofd[$args->outputFormat] : null; + + $args->outputFormatDomain = array( + 'NONE' => '' + ) + $ofd; + return $args; +} + +/** + */ +function initializeGui(&$argsObj, &$node) +{ + $guiObj = new stdClass(); + $guiObj->outputFormatDomain = $argsObj->outputFormatDomain; + $guiObj->object_name = ''; + $guiObj->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + $guiObj->object_name = $node['name']; + $guiObj->page_title = sprintf(lang_get('print_testcase'), $node['name']); + $guiObj->tproject_name = $argsObj->tproject_name; + $guiObj->tproject_id = $argsObj->tproject_id; + $guiObj->tcase_id = $argsObj->tcase_id; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + return $guiObj; } diff --git a/lib/testcases/tcSearch.php b/lib/testcases/tcSearch.php index 8b7817d92c..d69485a068 100644 --- a/lib/testcases/tcSearch.php +++ b/lib/testcases/tcSearch.php @@ -1,526 +1,615 @@ -getTcSearchSkeleton($args); -$gui = (object)array_merge((array)$ga,(array)$gx); - -initSearch($gui,$args,$tproject_mgr); - -$map = null; -$emptyTestProject = true; - -if ($args->tprojectID && $args->doAction == 'doSearch') { - $tables = tlObjectWithDB::getDBTables(array('cfield_design_values','nodes_hierarchy', - 'requirements','req_coverage','tcsteps', - 'testcase_keywords','tcversions','users')); - - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); - $gui->tcasePrefix .= $tcase_cfg->glue_character; - - $from = array('by_keyword_id' => ' ', 'by_custom_field' => ' ', 'by_requirement_doc_id' => '', 'users' => ''); - $tcaseID = null; - $emptyTestProject = false; - - if($args->targetTestCase != "" && strcmp($args->targetTestCase,$gui->tcasePrefix) != 0) { - if (strpos($args->targetTestCase,$tcase_cfg->glue_character) === false) { - $args->targetTestCase = $gui->tcasePrefix . $args->targetTestCase; - } - - $tcaseID = $tcase_mgr->getInternalID($args->targetTestCase); - $filter['by_tc_id'] = " AND NH_TCV.parent_id = " . intval($tcaseID); - } - else { - $tproject_mgr->get_all_testcases_id($args->tprojectID,$a_tcid); - - if(!is_null($a_tcid)) { - $filter['by_tc_id'] = " AND NH_TCV.parent_id IN (" . implode(",",$a_tcid) . ") "; - } - else { - // Force Nothing extracted, because test project - // has no test case defined - $emptyTestProject = true; - $filter['by_tc_id'] = " AND 1 = 0 "; - } - } - - if($args->version) { - $filter['by_version'] = " AND TCV.version = {$args->version} "; - } - - if($args->keyword_id) { - $from['by_keyword_id'] = " JOIN {$tables['testcase_keywords']} KW ON KW.testcase_id = NH_TC.id "; - $filter['by_keyword_id'] = " AND KW.keyword_id = " . $args->keyword_id; - } - - - $useOr = false; - $filterSpecial = null; - $feOp = " AND "; - $filterSpecial['tricky'] = " 1=1 "; - if($args->jolly != "") { - // $filterSpecial['trick'] = " 1=1 "; - $useOr = true; - $feOp = " OR "; - $filterSpecial['tricky'] = " 1=0 "; - $args->steps = $args->expected_results = $args->jolly; - } - - if($args->steps != "") { - $args->steps = $db->prepare_string($args->steps); - $filterSpecial['by_steps'] = $feOp . " TCSTEPS.actions like '%{$args->steps}%' "; - } - - if($args->expected_results != "") { - $args->expected_results = $db->prepare_string($args->expected_results); - $filterSpecial['by_expected_results'] = $feOp . " TCSTEPS.expected_results like '%{$args->expected_results}%' "; - } - - $k2w = array('name' => 'NH_TC', 'summary' => 'TCV', 'preconditions' => 'TCV'); - $jollyEscaped = $db->prepare_string($args->jolly); - foreach($k2w as $kf => $alias) { - if($args->$kf != "" || $args->jolly != '') { - if( $args->jolly == '' ) { - $args->$kf = $db->prepare_string($args->$kf); - } - $filterSpecial[$kf] = " {$feOp} {$alias}.{$kf} like "; - $filterSpecial[$kf] .= ($args->jolly == '') ? " '%{$args->$kf}%' " : " '%{$jollyEscaped}%' "; - } - } - - $otherFilters = ''; - if(!is_null($filterSpecial)) { - $otherFilters = " AND (" . implode("",$filterSpecial) . ")"; - } - - - if($args->custom_field_id > 0) { - - // Need to understand custom type to fomat the value - - $args->custom_field_id = $db->prepare_string($args->custom_field_id); - - $cf_def = $gui->design_cf[$args->custom_field_id]; - $from['by_custom_field']= " JOIN {$tables['cfield_design_values']} CFD " . - " ON CFD.node_id=NH_TCV.id "; - - $filter['by_custom_field'] = " AND CFD.field_id={$args->custom_field_id} "; - - switch($gui->cf_types[$cf_def['type']]) { - case 'date': - $args->custom_field_value = $tproject_mgr->cfield_mgr->cfdate2mktime($args->custom_field_value); - - $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; - break; - - case 'datetime': - $args->custom_field_value = $tproject_mgr->cfield_mgr->cfdatetime2mktime($args->custom_field_value); - - $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; - break; - - default: - $args->custom_field_value = $db->prepare_string($args->custom_field_value); - $filter['by_custom_field'] .= " AND CFD.value like '%{$args->custom_field_value}%' "; - break; - - } - } - - if($args->requirement_doc_id != "") { - $args->requirement_doc_id = $db->prepare_string($args->requirement_doc_id); - $from['by_requirement_doc_id'] = " JOIN {$tables['req_coverage']} RC" . - " ON RC.testcase_id = NH_TC.id " . - " JOIN {$tables['requirements']} REQ " . - " ON REQ.id=RC.req_id " ; - $filter['by_requirement_doc_id'] = " AND REQ.req_doc_id like '%{$args->requirement_doc_id}%' "; - } - - if( $args->importance > 0) - { - $filter['importance'] = " AND TCV.importance = {$args->importance} "; - } - - if( $args->status > 0) - { - $filter['status'] = " AND TCV.status = {$args->status} "; - } - - - $args->created_by = trim($args->created_by); - $from['users'] = ''; - if( $args->created_by != '' ) - { - $from['users'] .= " JOIN {$tables['users']} AUTHOR ON AUTHOR.id = TCV.author_id "; - $filter['author'] = " AND ( AUTHOR.login LIKE '%{$args->created_by}%' OR " . - " AUTHOR.first LIKE '%{$args->created_by}%' OR " . - " AUTHOR.last LIKE '%{$args->created_by}%') "; - } - - $args->edited_by = trim($args->edited_by); - if( $args->edited_by != '' ) - { - $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = TCV.updater_id "; - $filter['modifier'] = " AND ( UPDATER.login LIKE '%{$args->edited_by}%' OR " . - " UPDATER.first LIKE '%{$args->edited_by}%' OR " . - " UPDATER.last LIKE '%{$args->edited_by}%') "; - } - - $sqlFields = " SELECT NH_TC.id AS testcase_id,NH_TC.name,TCV.id AS tcversion_id," . - " TCV.summary, TCV.version, TCV.tc_external_id "; - - // Count Test Cases NOT Test Case Versions - // ATTENTION: - // Keywords are stored AT TEST CASE LEVEL, not test case version. - $sqlCount = "SELECT COUNT(DISTINCT(NH_TC.id)) "; - - // search fails if test case has 0 steps - Added LEFT OUTER - $sqlPart2 = " FROM {$tables['nodes_hierarchy']} NH_TC " . - " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TC.id " . - " JOIN {$tables['tcversions']} TCV ON NH_TCV.id = TCV.id " . - " LEFT OUTER JOIN {$tables['nodes_hierarchy']} NH_TCSTEPS ON NH_TCSTEPS.parent_id = NH_TCV.id " . - " LEFT OUTER JOIN {$tables['tcsteps']} TCSTEPS ON NH_TCSTEPS.id = TCSTEPS.id " . - " {$from['by_keyword_id']} {$from['by_custom_field']} {$from['by_requirement_doc_id']} " . - " {$from['users']} " . - " WHERE 1=1 "; - - - // if user fill in test case [external] id filter, and we were not able to get tcaseID, do any query is useless - $applyFilters = true; - if( !is_null($filter) && isset($filter['by_tc_id']) && !is_null($tcaseID) && ($tcaseID <= 0) ) - { - // get the right feedback message - $applyFilters = false; - $gui->warning_msg = $tcaseID == 0 ? lang_get('testcase_does_not_exists') : lang_get('prefix_does_not_exists'); - } - - if( $applyFilters ) - { - if ($filter) - { - $sqlPart2 .= implode("",$filter); - } - - $sqlPart2 .= $otherFilters; - - - // Count results - $sql = $sqlCount . $sqlPart2; - - $gui->row_qty = $db->fetchOneValue($sql); - if ($gui->row_qty) - { - if ($gui->row_qty <= $tcase_cfg->search->max_qty_for_display) - { - $sql = $sqlFields . $sqlPart2; - $map = $db->fetchRowsIntoMap($sql,'testcase_id'); - } - else - { - $gui->warning_msg = lang_get('too_wide_search_criteria'); - } - } - } +getTcSearchSkeleton($args); +$gui = (object) array_merge((array) $ga, (array) $gx); + +initSearch($gui, $args, $tproject_mgr); + +$map = null; +$emptyTestProject = true; + +if ($args->tprojectID && $args->doAction == 'doSearch') { + $tables = tlObjectWithDB::getDBTables( + array( + 'cfield_design_values', + 'nodes_hierarchy', + 'requirements', + 'req_coverage', + 'tcsteps', + 'testcase_keywords', + 'tcversions', + 'users' + )); + + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($args->tprojectID); + $gui->tcasePrefix .= $tcase_cfg->glue_character; + + $from = array( + 'by_keyword_id' => ' ', + 'by_custom_field' => ' ', + 'by_requirement_doc_id' => '', + 'users' => '' + ); + $tcaseID = null; + $emptyTestProject = false; + + if ($args->targetTestCase != "" && + strcmp($args->targetTestCase, $gui->tcasePrefix) != 0) { + if (strpos($args->targetTestCase, $tcase_cfg->glue_character) === false) { + $args->targetTestCase = $gui->tcasePrefix . $args->targetTestCase; + } + + $tcaseID = $tcaseMgr->getInternalID($args->targetTestCase); + $filter['by_tc_id'] = " AND NH_TCV.parent_id = " . intval($tcaseID); + } else { + $tproject_mgr->get_all_testcases_id($args->tprojectID, $a_tcid); + + if (! is_null($a_tcid)) { + $filter['by_tc_id'] = " AND NH_TCV.parent_id IN (" . + implode(",", $a_tcid) . ") "; + } else { + // Force Nothing extracted, because test project + // has no test case defined + $emptyTestProject = true; + $filter['by_tc_id'] = " AND 1 = 0 "; + } + } + + if ($args->version) { + $filter['by_version'] = " AND TCV.version = {$args->version} "; + } + + if ($args->keyword_id) { + $from['by_keyword_id'] = " JOIN {$tables['testcase_keywords']} KW ON KW.testcase_id = NH_TC.id "; + $filter['by_keyword_id'] = " AND KW.keyword_id = " . $args->keyword_id; + } + + $useOr = false; + $filterSpecial = null; + $feOp = " AND "; + $filterSpecial['tricky'] = " 1=1 "; + if ($args->jolly != "") { + $useOr = true; + $feOp = " OR "; + $filterSpecial['tricky'] = " 1=0 "; + $args->steps = $args->expected_results = $args->jolly; + } + + if ($args->steps != "") { + $args->steps = $db->prepare_string($args->steps); + $filterSpecial['by_steps'] = $feOp . + " TCSTEPS.actions like '%{$args->steps}%' "; + } + + if ($args->expected_results != "") { + $args->expected_results = $db->prepare_string($args->expected_results); + $filterSpecial['by_expected_results'] = $feOp . + " TCSTEPS.expected_results like '%{$args->expected_results}%' "; + } + + $k2w = array( + 'name' => 'NH_TC', + 'summary' => 'TCV', + 'preconditions' => 'TCV' + ); + $jollyEscaped = $db->prepare_string($args->jolly); + foreach ($k2w as $kf => $alias) { + if ($args->$kf != "" || $args->jolly != '') { + if ($args->jolly == '') { + $args->$kf = $db->prepare_string($args->$kf); + } + $filterSpecial[$kf] = " {$feOp} {$alias}.{$kf} like "; + $filterSpecial[$kf] .= ($args->jolly == '') ? " '%{$args->$kf}%' " : " '%{$jollyEscaped}%' "; + } + } + + $otherFilters = ''; + if (! is_null($filterSpecial)) { + $otherFilters = " AND (" . implode("", $filterSpecial) . ")"; + } + + if ($args->custom_field_id > 0) { + + // Need to understand custom type to fomat the value + + $args->custom_field_id = $db->prepare_string($args->custom_field_id); + + $cf_def = $gui->design_cf[$args->custom_field_id]; + $from['by_custom_field'] = " JOIN {$tables['cfield_design_values']} CFD " . + " ON CFD.node_id=NH_TCV.id "; + + $filter['by_custom_field'] = " AND CFD.field_id={$args->custom_field_id} "; + + switch ($gui->cf_types[$cf_def['type']]) { + case 'date': + $args->custom_field_value = $tproject_mgr->cfield_mgr->cfdate2mktime( + $args->custom_field_value); + + $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; + break; + + case 'datetime': + $args->custom_field_value = $tproject_mgr->cfield_mgr->cfdatetime2mktime( + $args->custom_field_value); + + $filter['by_custom_field'] .= " AND CFD.value = {$args->custom_field_value}"; + break; + + default: + $args->custom_field_value = $db->prepare_string( + $args->custom_field_value); + $filter['by_custom_field'] .= " AND CFD.value like '%{$args->custom_field_value}%' "; + break; + } + } + + if ($args->requirement_doc_id != "") { + $args->requirement_doc_id = $db->prepare_string( + $args->requirement_doc_id); + $from['by_requirement_doc_id'] = " JOIN {$tables['req_coverage']} RC" . + " ON RC.testcase_id = NH_TC.id " . + " JOIN {$tables['requirements']} REQ " . " ON REQ.id=RC.req_id "; + $filter['by_requirement_doc_id'] = " AND REQ.req_doc_id like '%{$args->requirement_doc_id}%' "; + } + + if ($args->importance > 0) { + $filter['importance'] = " AND TCV.importance = {$args->importance} "; + } + + if ($args->status > 0) { + $filter['status'] = " AND TCV.status = {$args->status} "; + } + + $args->created_by = trim($args->created_by); + $from['users'] = ''; + if ($args->created_by != '') { + $from['users'] .= " JOIN {$tables['users']} AUTHOR ON AUTHOR.id = TCV.author_id "; + $filter['author'] = " AND ( AUTHOR.login LIKE '%{$args->created_by}%' OR " . + " AUTHOR.first LIKE '%{$args->created_by}%' OR " . + " AUTHOR.last LIKE '%{$args->created_by}%') "; + } + + $args->edited_by = trim($args->edited_by); + if ($args->edited_by != '') { + $from['users'] .= " JOIN {$tables['users']} UPDATER ON UPDATER.id = TCV.updater_id "; + $filter['modifier'] = " AND ( UPDATER.login LIKE '%{$args->edited_by}%' OR " . + " UPDATER.first LIKE '%{$args->edited_by}%' OR " . + " UPDATER.last LIKE '%{$args->edited_by}%') "; + } + + $sqlFields = " SELECT NH_TC.id AS testcase_id,NH_TC.name,TCV.id AS tcversion_id," . + " TCV.summary, TCV.version, TCV.tc_external_id "; + + // Count Test Cases NOT Test Case Versions + // ATTENTION: + // Keywords are stored AT TEST CASE LEVEL, not test case version. + $sqlCount = "SELECT COUNT(DISTINCT(NH_TC.id)) "; + + // search fails if test case has 0 steps - Added LEFT OUTER + $sqlPart2 = " FROM {$tables['nodes_hierarchy']} NH_TC " . + " JOIN {$tables['nodes_hierarchy']} NH_TCV ON NH_TCV.parent_id = NH_TC.id " . + " JOIN {$tables['tcversions']} TCV ON NH_TCV.id = TCV.id " . + " LEFT OUTER JOIN {$tables['nodes_hierarchy']} NH_TCSTEPS ON NH_TCSTEPS.parent_id = NH_TCV.id " . + " LEFT OUTER JOIN {$tables['tcsteps']} TCSTEPS ON NH_TCSTEPS.id = TCSTEPS.id " . + " {$from['by_keyword_id']} {$from['by_custom_field']} {$from['by_requirement_doc_id']} " . + " {$from['users']} " . " WHERE 1=1 "; + + // if user fill in test case [external] id filter, and we were not able to get tcaseID, do any query is useless + $applyFilters = true; + if (! is_null($filter) && isset($filter['by_tc_id']) && ! is_null($tcaseID) && + ($tcaseID <= 0)) { + // get the right feedback message + $applyFilters = false; + $gui->warning_msg = $tcaseID == 0 ? lang_get('testcase_does_not_exists') : lang_get( + 'prefix_does_not_exists'); + } + + if ($applyFilters) { + if ($filter) { + $sqlPart2 .= implode("", $filter); + } + + $sqlPart2 .= $otherFilters; + + // Count results + $sql = $sqlCount . $sqlPart2; + + $gui->row_qty = $db->fetchOneValue($sql); + if ($gui->row_qty) { + if ($gui->row_qty <= $tcase_cfg->search->max_qty_for_display) { + $sql = $sqlFields . $sqlPart2; + $map = $db->fetchRowsIntoMap($sql, 'testcase_id'); + } else { + $gui->warning_msg = lang_get('too_wide_search_criteria'); + } + } + } +} + +if ($gui->doSearch) { + $gui->pageTitle .= " - " . lang_get('match_count') . " : " . $gui->row_qty; +} + +if ($gui->row_qty > 0) { + if ($map) { + $tcaseMgr = new testcase($db); + $tcase_set = array_keys($map); + $options = array( + 'output_format' => 'path_as_string' + ); + $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose( + $tcase_set, $options); + $gui->resultSet = $map; + } +} elseif ($emptyTestProject) { + $gui->warning_msg = lang_get('empty_testproject'); +} else { + $gui->warning_msg = lang_get('no_records_found'); +} + +$img = $smarty->getImages(); +$table = buildExtTable($gui, $charset, $img['edit_icon'], $img['history_small']); +if (! is_null($table)) { + $gui->tableSet[] = $table; +} + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $tpl); + +/** + */ +function buildExtTable($gui, $charset, $edit_icon, $history_icon) +{ + $table = null; + $designCfg = getWebEditorCfg('design'); + $designType = $designCfg['type']; + + if (null != $gui->resultSet && count($gui->resultSet) > 0) { + $labels = array( + 'test_suite' => lang_get('test_suite'), + 'test_case' => lang_get('test_case') + ); + $columns = array(); + + $columns[] = array( + 'title_key' => 'test_suite' + ); + $columns[] = array( + 'title_key' => 'test_case', + 'type' => 'text' + ); + + $columns[] = array( + 'title_key' => 'summary' + ); + + // Extract the relevant data and build a matrix + $matrixData = array(); + + $titleSeperator = config_get('gui_title_separator_1'); + + foreach ($gui->resultSet as $result) { + $rowData = array(); + $rowData[] = htmlentities($gui->path_info[$result['testcase_id']], + ENT_QUOTES, $charset); + + // build test case link + $history_link = "" . + " "; + $edit_link = "" . + " "; + $tcaseName = htmlentities($gui->tcasePrefix, ENT_QUOTES, $charset) . + $result['tc_external_id'] . " [v" . $result['version'] . "]" . + $titleSeperator . + htmlentities($result['name'], ENT_QUOTES, $charset); + + $rowData[] = $history_link . $edit_link . $tcaseName; + $rowData[] = ($designType == 'none' ? nl2br($result['summary']) : $result['summary']); + + $matrixData[] = $rowData; + } + + $table = new tlExtTable($columns, $matrixData, + 'tl_table_test_case_search'); + + $table->setGroupByColumnName($labels['test_suite']); + $table->setSortByColumnName($labels['test_case']); + $table->sortDirection = 'DESC'; + + $table->showToolbar = true; + $table->allowMultiSort = false; + $table->toolbarRefreshButton = false; + $table->toolbarShowAllColumnsButton = false; + + $table->addCustomBehaviour('text', array( + 'render' => 'columnWrap' + )); + $table->storeTableState = false; + } + return $table; +} + +/** + */ +function initArgs(&$tprojectMgr) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 10 + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "status" => array( + tlInputParameter::INT_N + ), + "keyword_id" => array( + tlInputParameter::INT_N + ), + "version" => array( + tlInputParameter::INT_N, + 999 + ), + "custom_field_id" => array( + tlInputParameter::INT_N + ), + "name" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "created_by" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "edited_by" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "summary" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "steps" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "expected_results" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "custom_field_value" => array( + tlInputParameter::STRING_N, + 0, + 20 + ), + "targetTestCase" => array( + tlInputParameter::STRING_N, + 0, + 30 + ), + "preconditions" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "requirement_doc_id" => array( + tlInputParameter::STRING_N, + 0, + 32 + ), + "importance" => array( + tlInputParameter::INT_N + ), + "creation_date_from" => array( + tlInputParameter::STRING_N + ), + "creation_date_to" => array( + tlInputParameter::STRING_N + ), + "modification_date_from" => array( + tlInputParameter::STRING_N + ), + "modification_date_to" => array( + tlInputParameter::STRING_N + ), + "jolly" => array( + tlInputParameter::STRING_N + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + // sanitize targetTestCase against XSS + // remove all blanks + // remove some html entities + // remove () + $tt = array( + ' ', + '<', + '>', + '(', + ')' + ); + $args->targetTestCase = str_replace($tt, '', $args->targetTestCase); + + $args->userID = intval(isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); + + if (is_null($args->tproject_id) || intval($args->tproject_id) <= 0) { + $args->tprojectID = intval( + isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + } else { + $args->tprojectID = intval($args->tproject_id); + $info = $tprojectMgr->get_by_id($args->tprojectID); + $args->tprojectName = $info['name']; + } + + if ($args->tprojectID <= 0) { + throw new Exception( + "Error Processing Request - Invalid Test project id " . __FILE__); + } + + // convert "creation date from" to iso format for database usage + $k2w = array( + 'creation_date_from' => '', + 'creation_date_to' => " 23:59:59", + 'modification_date_from' => '', + 'modification_date_to' => " 23:59:59" + ); + + $k2f = array( + 'creation_date_from' => ' creation_ts >= ', + 'creation_date_to' => 'creation_ts <= ', + 'modification_date_from' => ' modification_ts >= ', + 'modification_date_to' => ' modification_ts <= ' + ); + + $dateFormat = config_get('date_format'); + $filter = null; + foreach ($k2w as $key => $value) { + if (isset($args->$key) && $args->$key != '') { + $da = split_localized_date($args->$key, $dateFormat); + if ($da != null) { + $args->$key = $da['year'] . "-" . $da['month'] . "-" . $da['day'] . + $value; // set date in iso format + $filter[$key] = " AND TCV.{$k2f[$key]} '{$args->$key}' "; + } + } + } + + return array( + $args, + $filter + ); +} + +/** + */ +function initializeGui(&$argsObj, &$tprojectMgr) +{ + $gui = new stdClass(); + + $gui->pageTitle = lang_get('caption_search_form'); + $gui->warning_msg = ''; + $gui->path_info = null; + $gui->resultSet = null; + $gui->tableSet = null; + $gui->bodyOnLoad = null; + $gui->bodyOnUnload = null; + $gui->refresh_tree = false; + $gui->hilite_testcase_name = false; + $gui->show_match_count = false; + $gui->row_qty = 0; + $gui->doSearch = ($argsObj->doAction == 'doSearch'); + $gui->tproject_id = intval($argsObj->tprojectID); + + $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; + + $gui->creation_date_from = null; + $gui->creation_date_to = null; + $gui->modification_date_from = null; + $gui->modification_date_to = null; + $gui->search_important_notice = sprintf(lang_get('search_important_notice'), + $argsObj->tprojectName); + + // need to set values that where used on latest search (if any was done) + // $gui->importance = config_get('testcase_importance_default'); + return $gui; +} + +/** + */ +function initSearch(&$gui, &$argsObj, &$tprojectMgr) +{ + $gui->design_cf = $tprojectMgr->cfield_mgr->get_linked_cfields_at_design( + $argsObj->tprojectID, cfield_mgr::ENABLED, null, 'testcase'); + + $gui->cf_types = $tprojectMgr->cfield_mgr->custom_field_types; + $gui->filter_by['design_scope_custom_fields'] = ! is_null($gui->design_cf); + + $gui->keywords = $tprojectMgr->getKeywords($argsObj->tprojectID); + $gui->filter_by['keyword'] = ! is_null($gui->keywords); + + $oo = $tprojectMgr->getOptions($argsObj->tprojectID); + $gui->filter_by['requirement_doc_id'] = $oo->requirementsEnabled; + + $gui->importance = intval($argsObj->importance); + $gui->status = intval($argsObj->status); + $gui->tcversion = (is_null($argsObj->version) || $argsObj->version == '') ? '' : intval( + $argsObj->version); + + $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID) . + config_get('testcase_cfg')->glue_character; + + $gui->targetTestCase = (is_null($argsObj->targetTestCase) || + $argsObj->targetTestCase == '') ? $gui->tcasePrefix : $argsObj->targetTestCase; + + $txtin = array( + "created_by", + "edited_by", + "jolly" + ); + $jollyKilled = array( + "summary", + "steps", + "expected_results", + "preconditions", + "name" + ); + $txtin = array_merge($txtin, $jollyKilled); + + foreach ($txtin as $key) { + $gui->$key = $argsObj->$key; + } + + if ($argsObj->jolly != '') { + foreach ($jollyKilled as $key) { + $gui->$key = ''; + } + } } - -if($gui->doSearch) -{ - $gui->pageTitle .= " - " . lang_get('match_count') . " : " . $gui->row_qty; -} - -if($gui->row_qty > 0) -{ - if ($map) - { - $tcase_mgr = new testcase($db); - $tcase_set = array_keys($map); - $options = array('output_format' => 'path_as_string'); - $gui->path_info = $tproject_mgr->tree_manager->get_full_path_verbose($tcase_set, $options); - $gui->resultSet = $map; - } -} -else if ($emptyTestProject) -{ - $gui->warning_msg = lang_get('empty_testproject'); -} -else -{ - $gui->warning_msg = lang_get('no_records_found'); -} - -$img = $smarty->getImages(); -$table = buildExtTable($gui, $charset, $img['edit_icon'], $img['history_small']); -if (!is_null($table)) -{ - $gui->tableSet[] = $table; -} - - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $tpl); - -/** - * - * - */ -function buildExtTable($gui, $charset, $edit_icon, $history_icon) { - $table = null; - $designCfg = getWebEditorCfg('design'); - $designType = $designCfg['type']; - - if(null != $gui->resultSet && count($gui->resultSet) > 0) { - $labels = array('test_suite' => lang_get('test_suite'), 'test_case' => lang_get('test_case')); - $columns = array(); - - $columns[] = array('title_key' => 'test_suite'); - $columns[] = array('title_key' => 'test_case', 'type' => 'text'); - - $columns[] = array('title_key' => 'summary'); - - // Extract the relevant data and build a matrix - $matrixData = array(); - - $titleSeperator = config_get('gui_title_separator_1'); - - foreach($gui->resultSet as $result) - { - $rowData = array(); - $rowData[] = htmlentities($gui->path_info[$result['testcase_id']], ENT_QUOTES, $charset); - - // build test case link - $history_link = "" . - " "; - $edit_link = "" . - " "; - $tcaseName = htmlentities($gui->tcasePrefix, ENT_QUOTES, $charset) . $result['tc_external_id'] . - " [v" . $result['version'] . "]" . $titleSeperator . - htmlentities($result['name'], ENT_QUOTES, $charset); - - $rowData[] = $history_link . $edit_link . $tcaseName; - $rowData[] = ($designType == 'none' ? nl2br($result['summary']) : $result['summary']); - - $matrixData[] = $rowData; - } - - $table = new tlExtTable($columns, $matrixData, 'tl_table_test_case_search'); - - $table->setGroupByColumnName($labels['test_suite']); - $table->setSortByColumnName($labels['test_case']); - $table->sortDirection = 'DESC'; - - $table->showToolbar = true; - $table->allowMultiSort = false; - $table->toolbarRefreshButton = false; - $table->toolbarShowAllColumnsButton = false; - - $table->addCustomBehaviour('text', array('render' => 'columnWrap')); - $table->storeTableState = false; - } - return($table); -} - - -/** - * - */ -function init_args(&$tprojectMgr) -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - - $args = new stdClass(); - $iParams = array("doAction" => array(tlInputParameter::STRING_N,0,10), - "tproject_id" => array(tlInputParameter::INT_N), - "status" => array(tlInputParameter::INT_N), - "keyword_id" => array(tlInputParameter::INT_N), - "version" => array(tlInputParameter::INT_N,999), - "custom_field_id" => array(tlInputParameter::INT_N), - "name" => array(tlInputParameter::STRING_N,0,50), - "created_by" => array(tlInputParameter::STRING_N,0,50), - "edited_by" => array(tlInputParameter::STRING_N,0,50), - "summary" => array(tlInputParameter::STRING_N,0,50), - "steps" => array(tlInputParameter::STRING_N,0,50), - "expected_results" => array(tlInputParameter::STRING_N,0,50), - "custom_field_value" => array(tlInputParameter::STRING_N,0,20), - "targetTestCase" => array(tlInputParameter::STRING_N,0,30), - "preconditions" => array(tlInputParameter::STRING_N,0,50), - "requirement_doc_id" => array(tlInputParameter::STRING_N,0,32), - "importance" => array(tlInputParameter::INT_N), - "creation_date_from" => array(tlInputParameter::STRING_N), - "creation_date_to" => array(tlInputParameter::STRING_N), - "modification_date_from" => array(tlInputParameter::STRING_N), - "modification_date_to" => array(tlInputParameter::STRING_N), - "jolly" => array(tlInputParameter::STRING_N)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - // sanitize targetTestCase against XSS - // remove all blanks - // remove some html entities - // remove () - $tt = array(' ','<','>','(',')'); - $args->targetTestCase = str_replace($tt,'',$args->targetTestCase); - - $args->userID = intval(isset($_SESSION['userID']) ? $_SESSION['userID'] : 0); - - if(is_null($args->tproject_id) || intval($args->tproject_id) <= 0) - { - $args->tprojectID = intval(isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0); - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - } - else - { - $args->tprojectID = intval($args->tproject_id); - $info = $tprojectMgr->get_by_id($args->tprojectID); - $args->tprojectName = $info['name']; - } - - if($args->tprojectID <= 0) - { - throw new Exception("Error Processing Request - Invalid Test project id " . __FILE__); - } - - // convert "creation date from" to iso format for database usage - $k2w = array('creation_date_from' => '','creation_date_to' => " 23:59:59", - 'modification_date_from' => '', 'modification_date_to' => " 23:59:59"); - - $k2f = array('creation_date_from' => ' creation_ts >= ', - 'creation_date_to' => 'creation_ts <= ', - 'modification_date_from' => ' modification_ts >= ', - 'modification_date_to' => ' modification_ts <= '); - - - $dateFormat = config_get('date_format'); - $filter = null; - foreach($k2w as $key => $value) - { - if (isset($args->$key) && $args->$key != '') - { - $da = split_localized_date($args->$key, $dateFormat); - if ($da != null) - { - $args->$key = $da['year'] . "-" . $da['month'] . "-" . $da['day'] . $value; // set date in iso format - $filter[$key] = " AND TCV.{$k2f[$key]} '{$args->$key}' "; - } - } - } - - return array($args,$filter); -} - - -/** - * - * - */ -function initializeGui(&$argsObj,&$tprojectMgr) -{ - $gui = new stdClass(); - - $gui->pageTitle = lang_get('caption_search_form'); - $gui->warning_msg = ''; - $gui->path_info = null; - $gui->resultSet = null; - $gui->tableSet = null; - $gui->bodyOnLoad = null; - $gui->bodyOnUnload = null; - $gui->refresh_tree = false; - $gui->hilite_testcase_name = false; - $gui->show_match_count = false; - $gui->row_qty = 0; - $gui->doSearch = ($argsObj->doAction == 'doSearch'); - $gui->tproject_id = intval($argsObj->tprojectID); - - // ---------------------------------------------------- - $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; - - $gui->creation_date_from = null; - $gui->creation_date_to = null; - $gui->modification_date_from = null; - $gui->modification_date_to = null; - $gui->search_important_notice = sprintf(lang_get('search_important_notice'),$argsObj->tprojectName); - - // need to set values that where used on latest search (if any was done) - // $gui->importance = config_get('testcase_importance_default'); - - return $gui; -} - -/** - * - */ -function initSearch(&$gui,&$argsObj,&$tprojectMgr) -{ - $gui->design_cf = $tprojectMgr->cfield_mgr->get_linked_cfields_at_design($argsObj->tprojectID, - cfield_mgr::ENABLED,null,'testcase'); - - $gui->cf_types = $tprojectMgr->cfield_mgr->custom_field_types; - $gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf); - - $gui->keywords = $tprojectMgr->getKeywords($argsObj->tprojectID); - $gui->filter_by['keyword'] = !is_null($gui->keywords); - - $oo = $tprojectMgr->getOptions($argsObj->tprojectID); - $gui->filter_by['requirement_doc_id'] = $oo->requirementsEnabled; - - $gui->importance = intval($argsObj->importance); - $gui->status = intval($argsObj->status); - $gui->tcversion = (is_null($argsObj->version) || $argsObj->version == '') ? '' : intval($argsObj->version); - - $gui->tcasePrefix = $tprojectMgr->getTestCasePrefix($argsObj->tprojectID) . config_get('testcase_cfg')->glue_character; - - - $gui->targetTestCase = (is_null($argsObj->targetTestCase) || $argsObj->targetTestCase == '') ? - $gui->tcasePrefix : $argsObj->targetTestCase; - - - $txtin = array("created_by","edited_by","jolly"); - $jollyKilled = array("summary","steps","expected_results","preconditions","name"); - $txtin = array_merge($txtin, $jollyKilled); - - foreach($txtin as $key ) - { - $gui->$key = $argsObj->$key; - } - - if($argsObj->jolly != '') - { - foreach($jollyKilled as $key) - { - $gui->$key = ''; - } - } - -} \ No newline at end of file diff --git a/lib/testcases/tcSearchForm.php b/lib/testcases/tcSearchForm.php index a1e72e5cbb..8497f2b971 100644 --- a/lib/testcases/tcSearchForm.php +++ b/lib/testcases/tcSearchForm.php @@ -1,83 +1,89 @@ -assign('gui',$gui); -$smarty->display($templateCfg->template_dir . 'tcSearchForm.tpl'); -/** - * - * - */ -function init_args() -{ - $args = new stdClass(); - $args->tprojectID = isset($_SESSION['testprojectID']) ? intval($_SESSION['testprojectID']) : 0; - $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; - - if($args->tprojectID <= 0) - { - throw new Exception("Error Processing Request - Invalid Test project id " . __FILE__); - } - - return $args; +assign('gui', $gui); +$smarty->display($templateCfg->template_dir . 'tcSearchForm.tpl'); + +/** + */ +function initArgs() +{ + $args = new stdClass(); + $args->tprojectID = isset($_SESSION['testprojectID']) ? intval( + $_SESSION['testprojectID']) : 0; + $args->tprojectName = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; + + if ($args->tprojectID <= 0) { + throw new Exception( + "Error Processing Request - Invalid Test project id " . __FILE__); + } + + return $args; +} + +function initializeGui(&$dbHandler, &$argsObj) +{ + $tproject_mgr = new testproject($dbHandler); + + $gui = new stdClass(); + $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tprojectID) . + config_get('testcase_cfg')->glue_character; + $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; + $gui->importance = config_get('testcase_importance_default'); + $gui->creation_date_from = null; + $gui->creation_date_to = null; + $gui->modification_date_from = null; + $gui->modification_date_to = null; + $gui->search_important_notice = sprintf(lang_get('search_important_notice'), + $argsObj->tprojectName); + + $gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design( + $argsObj->tprojectID, cfield_mgr::ENABLED, null, 'testcase'); + + $gui->keywords = $tproject_mgr->getKeywords($argsObj->tprojectID); + + $gui->filter_by['design_scope_custom_fields'] = ! is_null($gui->design_cf); + $gui->filter_by['keyword'] = ! is_null($gui->keywords); + + $reqSpecSet = $tproject_mgr->genComboReqSpec($argsObj->tprojectID); + $gui->filter_by['requirement_doc_id'] = ! is_null($reqSpecSet); + + $gui->option_importance = array( + 0 => '', + HIGH => lang_get('high_importance'), + MEDIUM => lang_get('medium_importance'), + LOW => lang_get('low_importance') + ); + + $dummy = getConfigAndLabels('testCaseStatus', 'code'); + $gui->domainTCStatus = array( + 0 => '' + ) + $dummy['lbl']; + return $gui; } - -function initializeGui(&$dbHandler,&$argsObj) -{ - - $tproject_mgr = new testproject($dbHandler); - - $gui = new stdClass(); - $gui->tcasePrefix = $tproject_mgr->getTestCasePrefix($argsObj->tprojectID) . config_get('testcase_cfg')->glue_character; - $gui->mainCaption = lang_get('testproject') . " " . $argsObj->tprojectName; - $gui->importance = config_get('testcase_importance_default'); - $gui->creation_date_from = null; - $gui->creation_date_to = null; - $gui->modification_date_from = null; - $gui->modification_date_to = null; - $gui->search_important_notice = sprintf(lang_get('search_important_notice'),$argsObj->tprojectName); - - $gui->design_cf = $tproject_mgr->cfield_mgr->get_linked_cfields_at_design($argsObj->tprojectID,cfield_mgr::ENABLED,null,'testcase'); - - $gui->keywords = $tproject_mgr->getKeywords($argsObj->tprojectID); - - $gui->filter_by['design_scope_custom_fields'] = !is_null($gui->design_cf); - $gui->filter_by['keyword'] = !is_null($gui->keywords); - - $reqSpecSet = $tproject_mgr->genComboReqSpec($argsObj->tprojectID); - $gui->filter_by['requirement_doc_id'] = !is_null($reqSpecSet); - - $gui->option_importance = array(0 => '',HIGH => lang_get('high_importance'),MEDIUM => lang_get('medium_importance'), - LOW => lang_get('low_importance')); - - - $dummy = getConfigAndLabels('testCaseStatus','code'); - $gui->domainTCStatus = array(0 => '') + $dummy['lbl']; - return $gui; -} \ No newline at end of file diff --git a/lib/testcases/testcaseCommands.class.php b/lib/testcases/testcaseCommands.class.php index caeda4de6a..6023ab56e9 100644 --- a/lib/testcases/testcaseCommands.class.php +++ b/lib/testcases/testcaseCommands.class.php @@ -1,1598 +1,1659 @@ -db = $db; - $this->tcaseMgr = new testcase($db); - $this->tcaseMgr->setTestProject($tproject_id); - - $this->tprojectMgr = &$this->tcaseMgr->tproject_mgr; - $this->tproject_id = $tproject_id; - - $this->execution_types = $this->tcaseMgr->get_execution_types(); - $this->grants = new stdClass(); - - $g2c = array('mgt_modify_tc','mgt_view_req','testplan_planning', - 'req_tcase_link_management','mgt_modify_req', - 'testproject_delete_executed_testcases', - 'testproject_edit_executed_testcases'); - foreach($g2c as $grant) { - $this->grants->$grant = $userObj->hasRight($db,$grant,$tproject_id); - } - - $this->grants->requirement_mgmt = $this->grants->mgt_modify_req || - $this->grants->req_tcase_link_management; - - $this->tables = $this->tcaseMgr->getDBTables(array('keywords','platforms')); - } - - function setTemplateCfg($cfg) { - $this->templateCfg=$cfg; - } - - /** - * - * - */ - function initGuiBean(&$argsObj) - { - $obj = new stdClass(); - $obj->action = ''; - $obj->attachments = null; - $obj->cleanUpWebEditor = false; - $obj->containerID = ''; - $obj->direct_link = null; - $obj->execution_types = $this->execution_types; - - - $obj->grants = $this->grants; - - $key = 'req_tcase_link_management'; - $obj->$key = $obj->grants->$key; - - $obj->has_been_executed = false; - $obj->initWebEditorFromTemplate = false; - - $obj->main_descr = ''; - $obj->name = ''; - $obj->path_info = null; - $obj->refreshTree = 0; - $obj->sqlResult = ''; - $obj->step_id = -1; - $obj->step_set = ''; - $obj->steps = ''; - - $dummy = testcase::getLayout(); - $obj->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; - - $tck = array('tcase_id','tcversion_id','tplan_id'); - foreach ($tck as $pkey) { - $obj->$pkey = property_exists($argsObj,$pkey) ? $argsObj->$pkey : -1; - } - - $obj->viewerArgs = null; - - $p2check = 'goback_url'; - $obj->$p2check = ''; - if( property_exists($argsObj,$p2check) ) { - $obj->$p2check = !is_null($argsObj->$p2check) ? $argsObj->$p2check : ''; - } - - $p2check = 'show_mode'; - if( property_exists($argsObj,$p2check) ) { - $obj->$p2check = !is_null($argsObj->$p2check) ? $argsObj->$p2check : 'show'; - } - - // need to check where is used - $obj->loadOnCancelURL = "archiveData.php?edit=testcase&show_mode={$obj->show_mode}&id=%s&version_id=%s"; - - if( property_exists($obj, 'tplan_id') ) { - $obj->loadOnCancelURL .= "&tplan_id={$obj->tplan_id}"; - } - - if( property_exists($obj, 'show_mode') ) { - $obj->loadOnCancelURL .= "&show_mode={$obj->show_mode}"; - } - - $obj->codeTrackerEnabled = $this->tprojectMgr->isCodeTrackerEnabled($this->tproject_id); - - return $obj; - } - - /** - * initialize common test case information, useful when working on steps - * - */ - function initTestCaseBasicInfo(&$argsObj,&$guiObj,$opt=null) - { - - $my['opt'] = array('accessByStepID' => true); - $my['opt'] = array_merge($my['opt'],(array)$opt); - - // Security - // https://cxsecurity.com/issue/WLB-2019110139 - if (intval($argsObj->tcase_id) == 0 && - intval($argsObj->tcversion_id) ==0) { - die("Error Processing Request:" . __METHOD__); - } - - $greenCard = array('tcase_id' => $argsObj->tcase_id, - 'tcversion_id' => $argsObj->tcversion_id); - - if( $my['opt']['accessByStepID'] ) { - foreach($greenCard as $ky) { - // this logic need to be explained BETTER - if($ky == 0) { - $greenCard = $this->tcaseMgr->getIdCardByStepID($argsObj->step_id); - break; - } - } - } - - $gopt = [ - 'output' => 'full_without_steps', - 'renderGhost' => true, - 'renderImageInline' => true, - 'renderVariables' => true, - 'tproject_id' => intval($argsObj->testproject_id) - ]; - - $tcaseInfo = $this->tcaseMgr->get_by_id( - $greenCard['tcase_id'],$greenCard['tcversion_id'],null,$gopt); - - $external = $this->tcaseMgr->getExternalID( - $greenCard['tcase_id'],$argsObj->testproject_id); - $tcaseInfo[0]['tc_external_id'] = $external[0]; - $guiObj->testcase = $tcaseInfo[0]; - - if(!isset($guiObj->testcase['ghost'])) { - $guiObj->testcase['ghost'] = null; - } - $guiObj->authorObj = tlUser::getByID($this->db,$guiObj->testcase['author_id']); - - $guiObj->updaterObj = null; - if( !is_null($guiObj->testcase['updater_id']) ) { - $guiObj->updaterObj = tlUser::getByID($this->db,$guiObj->testcase['updater_id']); - } - - $cfCtx = array('scope' => 'design', - 'tproject_id' => $argsObj->testproject_id, - 'link_id' => $argsObj->tcversion_id); - - $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); - foreach($cfPlaces as $cfpKey => $cfpFilter) { - $guiObj->cfieldsDesignTime[$cfpKey] = - $this->tcaseMgr->htmlTableOfCFValues( - $argsObj->tcase_id,$cfCtx,$cfpFilter); - } - - - } - - - - - - /** - * - * - */ - function create(&$argsObj,&$otCfg) - { - $parentKeywords = array(); - $guiObj = $this->initGuiBean($argsObj); - $guiObj->initWebEditorFromTemplate = true; - - $guiObj->containerID = $argsObj->container_id; - if($argsObj->container_id > 0) { - $pnode_info = $this->tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->container_id); - $node_descr = array_flip($this->tcaseMgr->tree_manager->get_available_node_types()); - $guiObj->parent_info['name'] = $pnode_info['name']; - $guiObj->parent_info['description'] = lang_get($node_descr[$pnode_info['node_type_id']]); - - // get keywords - $tsuiteMgr = new testsuite($this->db); - $parentKeywords = $tsuiteMgr->getKeywords($argsObj->container_id); - } - $sep_1 = config_get('gui_title_separator_1'); - $sep_2 = config_get('gui_title_separator_2'); - $guiObj->main_descr = $guiObj->parent_info['description'] . $sep_1 . $guiObj->parent_info['name'] . - $sep_2 . lang_get('title_new_tc'); - - - $otCfg->to->map = array(); - keywords_opt_transf_cfg($otCfg,implode(',',array_keys((array)$parentKeywords))); - - $guiObj->tc = array('id' => 0, 'name' => '', 'importance' => config_get('testcase_importance_default'), - 'status' => null, 'estimated_exec_duration' => null, - 'execution_type' => TESTCASE_EXECUTION_TYPE_MANUAL); - - $guiObj->opt_cfg=$otCfg; - $templateCfg = templateConfiguration('tcNew'); - $guiObj->template=$templateCfg->default_template; - - - $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); - foreach($cfPlaces as $locationKey => $locationFilter) { - $guiObj->cf[$locationKey] = - $this->tcaseMgr->html_table_of_custom_field_inputs(null,null, - 'design','',null,null, - $argsObj->testproject_id,$locationFilter, $_REQUEST); - } - - $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . - "lib/testcases/archiveData.php?id=" . - intval($argsObj->container_id); - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->cancelActionJS .= "&tplan_id={$guiObj->tplan_id}"; - } - - if( property_exists($guiObj, 'show_mode') ) { - $guiObj->cancelActionJS .= "&show_mode={$guiObj->show_mode}"; - } - - - $guiObj->cancelActionJS .= - '&edit=testsuite&level=testsuite&containerType=testsuite' . "'"; - - return $guiObj; - } - - /** - * - * - */ - function doCreate(&$argsObj,&$otCfg,$oWebEditorKeys,$request) { - $guiObj = $this->create($argsObj,$otCfg,$oWebEditorKeys); - - // compute order - $new_order = config_get('treemenu_default_testcase_order'); - $co = $this->tcaseMgr->tree_manager->getBottomOrder($argsObj->container_id,array('node_type' => 'testcase')); - if( $co > 0){ - $new_order = $co+1; - } - - $options = array('check_duplicate_name' => config_get('check_names_for_duplicates'), - 'action_on_duplicate_name' => 'block', - 'status' => $argsObj->tc_status, - 'estimatedExecDuration' => $argsObj->estimated_execution_duration); - - $tcase = $this->tcaseMgr->create($argsObj->container_id,$argsObj->name,$argsObj->summary,$argsObj->preconditions, - $argsObj->tcaseSteps,$argsObj->user_id,$argsObj->assigned_keywords_list, - $new_order,testcase::AUTOMATIC_ID, - $argsObj->exec_type,$argsObj->importance,$options); - - if($tcase['status_ok']) { - $guiObj->actionOK = true; - if($argsObj->stay_here) { - $cf_map = $this->tcaseMgr->cfield_mgr->get_linked_cfields_at_design($argsObj->testproject_id,ENABLED, - NO_FILTER_SHOW_ON_EXEC,'testcase'); - - $this->tcaseMgr->cfield_mgr->design_values_to_db($_REQUEST,$tcase['tcversion_id'],$cf_map); - - $guiObj->user_feedback = sprintf(lang_get('tc_created'),$argsObj->name); - $guiObj->sqlResult = 'ok'; - $guiObj->initWebEditorFromTemplate = true; - $guiObj->cleanUpWebEditor = true; - $opt_list = ''; - } - else { - // we will not return to caller - $argsObj->tcase_id = $tcase['id']; - $argsObj->tcversion_id = $tcase['tcversion_id']; - - // BAD Choice Custom fields are written to db on $this->show() - $this->show($argsObj,$request, array('status_ok' => 1)); - } - } - elseif(isset($tcase['msg'])) { - $guiObj->actionOK = false; - $guiObj->user_feedback = lang_get('error_tc_add'); - $guiObj->user_feedback .= '' . $tcase['msg']; - $guiObj->sqlResult = 'ko'; - $opt_list = $argsObj->assigned_keywords_list; - $guiObj->initWebEditorFromTemplate = false; - } - - keywords_opt_transf_cfg($otCfg, $opt_list); - $guiObj->opt_cfg=$otCfg; - $templateCfg = templateConfiguration('tcNew'); - $guiObj->template=$templateCfg->default_template; - return $guiObj; - } - - - /* - function: edit (Test Case) - - args: - - returns: - - */ - function edit(&$argsObj,&$otCfg,$oWebEditorKeys) { - $guiObj = $this->initGuiBean($argsObj); - $otCfg->to->map = - $this->tcaseMgr->get_keywords_map($argsObj->tcase_id,$argsObj->tcversion_id, - array('orderByClause' =>" ORDER BY keyword ASC ")); - - keywords_opt_transf_cfg($otCfg, $argsObj->assigned_keywords_list); - - $gopt = [ - 'renderImageInline' => false, - 'renderImageInline' => false, - 'caller' => __METHOD__ - ]; - - $tc_data = $this->tcaseMgr->get_by_id($argsObj->tcase_id,$argsObj->tcversion_id,null,$gopt); - foreach($oWebEditorKeys as $key) { - $guiObj->$key = isset($tc_data[0][$key]) ? $tc_data[0][$key] : ''; - $argsObj->$key = $guiObj->$key; - } - - $cf_smarty = null; - $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); - - // To skip in an elegant way?? - $hideCode = $cfPlaces['hide_because_is_used_as_variable']['location']; - unset($cfPlaces['hide_because_is_used_as_variable']); - - foreach($cfPlaces as $locationKey => $locationFilter) { - switch($locationKey) { - case 'standard_location': - $std = $locationFilter['location']; - $locationFilter['location'] = [ - $std, - $hideCode - ]; - break; - } - - $cf_smarty[$locationKey] = - $this->tcaseMgr->html_table_of_custom_field_inputs( - $argsObj->tcase_id,null,'design','', - $argsObj->tcversion_id,null,null,$locationFilter); - } - - $templateCfg = templateConfiguration('tcEdit'); - $guiObj->cf = $cf_smarty; - $guiObj->tc=$tc_data[0]; - $guiObj->opt_cfg=$otCfg; - - $guiObj->cancelActionJS = - 'location.href=fRoot+' . "'" . - "lib/testcases/archiveData.php?version_id=" . - $argsObj->tcversion_id . - "&tcversion_id=" . $argsObj->tcversion_id . - '&edit=testcase&id=' . intval($argsObj->tcase_id); - - if( property_exists($argsObj, 'tplan_id') ) { - $guiObj->cancelActionJS .= "&tplan_id={$argsObj->tplan_id}"; - } - - if( property_exists($argsObj, 'show_mode') ) { - $guiObj->cancelActionJS .= "&show_mode={$argsObj->show_mode}"; - } - - $guiObj->cancelActionJS .= "'"; - - $guiObj->template=$templateCfg->default_template; - return $guiObj; - } - - - /* - function: doUpdate - - args: - - returns: - - */ - function doUpdate(&$argsObj,$request) { - $options = array('status' => $argsObj->tc_status, - 'estimatedExecDuration' => $argsObj->estimated_execution_duration); - - $ret = $this->tcaseMgr->update($argsObj->tcase_id, $argsObj->tcversion_id, $argsObj->name, - $argsObj->summary, $argsObj->preconditions, $argsObj->tcaseSteps, - $argsObj->user_id, $argsObj->assigned_keywords_list, - testcase::DEFAULT_ORDER, $argsObj->exec_type, - $argsObj->importance,$options); - - $this->show($argsObj,$request,$ret); - return; - } - - - /** - * doAdd2testplan - * - */ - function doAdd2testplan(&$argsObj,$request) { - $smartyObj = new TLSmarty(); - $smartyObj->assign('attachments',null); - $guiObj = $this->initGuiBean($argsObj); - $guiObj->refreshTree = $argsObj->refreshTree? 1 : 0; - - $tplan_mgr = new testplan($this->db); - - // $request['add2tplanid'] - // main key: testplan id - // sec key : platform_id - $item2link = null; - if( isset($request['add2tplanid']) ) - { - foreach($request['add2tplanid'] as $tplan_id => $platformSet) - { - foreach($platformSet as $platform_id => $dummy) - { - $item2link = null; - $item2link['tcversion'][$argsObj->tcase_id] = $argsObj->tcversion_id; - $item2link['platform'][$platform_id] = $platform_id; - $item2link['items'][$argsObj->tcase_id][$platform_id] = $argsObj->tcversion_id; - $tplan_mgr->link_tcversions($tplan_id,$item2link,$argsObj->user_id); - } - } - - $identity = new stdClass(); - $identity->tproject_id = $argsObj->tproject_id; - $identity->id = $argsObj->tcase_id; - $identity->version_id = $argsObj->tcversion_id; - - $this->tcaseMgr->show($smartyObj,$guiObj,$identity,$this->grants); - exit(); - } - return $guiObj; - } - - /** - * add2testplan - is really needed???? 20090308 - franciscom - TO DO - * - */ - function add2testplan(&$argsObj,$request) - { - } - - - /** - * - * - * @internal revisions - */ - function delete(&$argsObj,$request) { - - $guiObj = $this->initGuiBean($argsObj); - $guiObj->delete_message = ''; - $cfg = config_get('testcase_cfg'); - - $guiObj->exec_status_quo = $this->tcaseMgr->get_exec_status($argsObj->tcase_id,null, - array('addExecIndicator' => true)); - $guiObj->delete_enabled = 1; - if( $guiObj->exec_status_quo['executed'] && !$this->grants->testproject_delete_executed_testcases ) - { - $guiObj->delete_message = lang_get('system_blocks_delete_executed_tc_when'); - $guiObj->delete_enabled = 0; - } - // need to remove 'executed' key, in order to do not have side effects on Viewer logic (template). - unset($guiObj->exec_status_quo['executed']); - - - $guiObj->delete_mode = 'single'; - $guiObj->display_platform = false; - - // Need to understand if platform column has to be displayed on GUI - if( !is_null($guiObj->exec_status_quo) ) - { - // key level 1 : Test Case Version ID - // key level 2 : Test Plan ID - // key level 3 : Platform ID - - $versionSet = array_keys($guiObj->exec_status_quo); - $stop = false; - foreach($versionSet as $version_id) - { - $tplanSet = array_keys($guiObj->exec_status_quo[$version_id]); - foreach($tplanSet as $tplan_id) - { - if( ($guiObj->display_platform = !isset($guiObj->exec_status_quo[$version_id][$tplan_id][0])) ) - { - $stop = true; - break; - } - } - if($stop) - { - break; - } - } - } - - $tcinfo = $this->tcaseMgr->get_by_id($argsObj->tcase_id); - list($prefix,$root) = $this->tcaseMgr->getPrefix($argsObj->tcase_id,$argsObj->testproject_id); - $prefix .= $cfg->glue_character; - $external_id = $prefix . $tcinfo[0]['tc_external_id']; - - $guiObj->title = lang_get('title_del_tc'); - $guiObj->testcase_name = $tcinfo[0]['name']; - $guiObj->testcase_id = $argsObj->tcase_id; - $guiObj->tcversion_id = testcase::ALL_VERSIONS; - $guiObj->refreshTree = 1; - $guiObj->main_descr = lang_get('title_del_tc') . TITLE_SEP . $external_id . TITLE_SEP . $tcinfo[0]['name']; - - $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . - 'lib/testcases/archiveData.php?version_id=undefined&' . - 'edit=testcase&id=' . intval($guiObj->testcase_id) . "'"; - - - $templateCfg = templateConfiguration('tcDelete'); - $guiObj->template = $templateCfg->default_template; - return $guiObj; - } - - /** - * - * - */ - function doDelete(&$argsObj,$request) { - $cfg = config_get('testcase_cfg'); - - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->delete_message = ''; - $guiObj->action = 'deleted'; - $guiObj->sqlResult = 'ok'; - $guiObj->delete_mode = 'single'; - - $tcinfo = $this->tcaseMgr->get_by_id($argsObj->tcase_id,$argsObj->tcversion_id); - list($prefix,$root) = $this->tcaseMgr->getPrefix($argsObj->tcase_id,$argsObj->testproject_id); - $prefix .= $cfg->glue_character; - $external_id = $prefix . $tcinfo[0]['tc_external_id']; - if (!$this->tcaseMgr->delete($argsObj->tcase_id,$argsObj->tcversion_id)) - { - $guiObj->action = ''; - $guiObj->sqlResult = $this->tcaseMgr->db->error_msg(); - } - - $guiObj->main_descr = lang_get('title_del_tc') . ":" . $external_id . TITLE_SEP . htmlspecialchars($tcinfo[0]['name']); - - if($argsObj->tcversion_id == testcase::ALL_VERSIONS) - { - $guiObj->refreshTree = 1; - logAuditEvent(TLS("audit_testcase_deleted",$external_id),"DELETE",$argsObj->tcase_id,"testcases"); - $guiObj->user_feedback = sprintf(lang_get('tc_deleted'), ":" . $external_id . TITLE_SEP . $tcinfo[0]['name']); - } - else{ - $guiObj->main_descr .= " " . lang_get('version') . " " . $tcinfo[0]['version']; - // When deleting JUST one version, there is no need to refresh tree - $guiObj->refreshTree = 0; - logAuditEvent(TLS("audit_testcase_version_deleted",$tcinfo[0]['version'],$external_id),"DELETE",$argsObj->tcase_id,"testcases"); - $guiObj->user_feedback = sprintf(lang_get('tc_version_deleted'),$tcinfo[0]['name'],$tcinfo[0]['version']); - } - - $guiObj->testcase_name = $tcinfo[0]['name']; - $guiObj->testcase_id = $argsObj->tcase_id; - - $templateCfg = templateConfiguration('tcDelete'); - $guiObj->template=$templateCfg->default_template; - return $guiObj; - } - - - /** - * createStep - * - */ - function createStep(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $guiObj->main_descr = sprintf(lang_get('create_step'), $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - $max_step = $this->tcaseMgr->get_latest_step_number($argsObj->tcversion_id); - $max_step++;; - - $guiObj->step_number = $max_step; - $guiObj->step_exec_type = $guiObj->testcase['execution_type']; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $guiObj->step_set = $this->tcaseMgr->get_step_numbers($argsObj->tcversion_id); - $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",",array_keys($guiObj->step_set)); - $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL,$argsObj->tcase_id,$argsObj->tcversion_id); - - // Get all existent steps - $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - - $templateCfg = templateConfiguration('tcStepEdit'); - $guiObj->template = $templateCfg->default_template; - $guiObj->action = __FUNCTION__; - - return $guiObj; - } - - /** - * doCreateStep - * - */ - function doCreateStep(&$argsObj,$request,$doAndExit=false) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - $guiObj->main_descr = sprintf(lang_get('create_step'), $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - - $new_step = $this->tcaseMgr->get_latest_step_number($argsObj->tcversion_id); - $new_step++; - $op = $this->tcaseMgr->create_step($argsObj->tcversion_id,$new_step, - $argsObj->steps,$argsObj->expected_results,$argsObj->exec_type); - - $guiObj->doExit = false; - if( $op['status_ok'] ) - { - $guiObj->doExit = $doAndExit; - $guiObj->user_feedback = sprintf(lang_get('step_number_x_created'),$argsObj->step_number); - $guiObj->step_exec_type = $guiObj->testcase['execution_type']; - $guiObj->cleanUpWebEditor = true; - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - $this->initTestCaseBasicInfo($argsObj,$guiObj); - } - - if(!$guiObj->doExit) - { - $guiObj->action = __FUNCTION__; - - // Get all existent steps - $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - $max_step = $this->tcaseMgr->get_latest_step_number($argsObj->tcversion_id); - $max_step++;; - $guiObj->step_number = $max_step; - - $guiObj->step_set = $this->tcaseMgr->get_step_numbers($argsObj->tcversion_id); - $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",",array_keys($guiObj->step_set)); - $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL,$argsObj->tcase_id,$argsObj->tcversion_id); - - $templateCfg = templateConfiguration('tcStepEdit'); - $guiObj->template=$templateCfg->default_template; - } - return $guiObj; - } - - /** - * doCreateStepAndExit - * - */ - function doCreateStepAndExit(&$argsObj,$request) { - $guiObj = $this->doCreateStep($argsObj,$request,true); - if($guiObj->doExit) { - // when working on step, refreshing tree is nonsense - $argsObj->refreshTree = 0; - - $opt= array('updateCFOnDB' => !self::UPDATECFONDB); - $this->show($argsObj,$request,array('status_ok' => true),$opt); - exit(); - } else { - return $guiObj; - } - } - - - - - /** - * editStep - * - */ - function editStep(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); - - $oWebEditorKeys = array('steps' => 'actions', 'expected_results' => 'expected_results'); - foreach($oWebEditorKeys as $key => $field) - { - $argsObj->$key = $stepInfo[$field]; - $guiObj->$key = $stepInfo[$field]; - } - - $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'),$stepInfo['step_number'], - $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - $guiObj->tcase_id = $argsObj->tcase_id; - $guiObj->tcversion_id = $argsObj->tcversion_id; - $guiObj->step_id = $argsObj->step_id; - $guiObj->step_exec_type = $stepInfo['execution_type']; - $guiObj->step_number = $stepInfo['step_number']; - - // Get all existent steps - $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - - $guiObj->step_set = $this->tcaseMgr->get_step_numbers($argsObj->tcversion_id); - $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",",array_keys($guiObj->step_set)); - - $templateCfg = templateConfiguration('tcStepEdit'); - $guiObj->template=$templateCfg->default_template; - $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL,$argsObj->tcase_id,$argsObj->tcversion_id); - - return $guiObj; - } - - /** - * doUpdateStep - * - */ - function doUpdateStep(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - try { - $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); - } - catch (Exception $e) { - echo $e->getMessage(); - } - - - $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'),$stepInfo['step_number'], - $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - $op = $this->tcaseMgr->update_step($argsObj->step_id,$argsObj->step_number,$argsObj->steps, - $argsObj->expected_results,$argsObj->exec_type); - - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $guiObj->tcversion_id = $argsObj->tcversion_id; - $guiObj->step_id = $argsObj->step_id; - $guiObj->step_number = $stepInfo['step_number']; - $guiObj->step_exec_type = $argsObj->exec_type; - - - $guiObj = $this->editStep($argsObj,$request); - return $guiObj; - } - - /** - * doUpdateStepAndExit - * - */ - function doUpdateStepAndExit(&$argsObj,$request) { - $this->doUpdateStep($argsObj,$request); - - // when working on step, refreshing tree is nonsense - $argsObj->refreshTree = 0; - $opt= array('updateCFOnDB' => !self::UPDATECFONDB); - $this->show($argsObj,$request,array('status_ok' => true),$opt); - } - - - /** - * doReorderSteps - * - */ - function doReorderSteps(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->main_descr = lang_get('test_case'); - $this->tcaseMgr->set_step_number($argsObj->step_set); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $argsObj->refreshTree = 0; - $opt= array('updateCFOnDB' => !self::UPDATECFONDB); - $this->show($argsObj,$request,array('status_ok' => true),$opt); - exit(); - - } - - - /** - * doDeleteStep - * - */ - function doDeleteStep(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - - $guiObj->main_descr = lang_get('test_case'); - $guiObj->viewerArgs = array(); - $guiObj->refreshTree = 0; - $step_node = $this->tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->step_id); - - $tcversion_node = $this->tcaseMgr->tree_manager->get_node_hierarchy_info($step_node['parent_id']); - $argsObj->tcversion_id = $step_node['parent_id']; - $argsObj->tcase_id = $tcversion_node['parent_id']; - - $guiObj->user_feedback = ''; - $op = $this->tcaseMgr->delete_step_by_id($argsObj->step_id); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $argsObj->refreshTree = 0; - $opt= array('updateCFOnDB' => !self::UPDATECFONDB); - $this->show($argsObj,$request,array('status_ok' => true),$opt); - exit(); - } - - /** - * doCopyStep - * - */ - function doCopyStep(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - // need to document difference bewteen these two similar concepts - $guiObj->action = __FUNCTION__; - $guiObj->operation = 'doUpdateStep'; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'),$argsObj->step_number, - $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - $new_step = $this->tcaseMgr->get_latest_step_number($argsObj->tcversion_id); - $new_step++; - - $source_info = $this->tcaseMgr->get_steps($argsObj->tcversion_id,$argsObj->step_number); - $source_info = current($source_info); - $op = $this->tcaseMgr->create_step($argsObj->tcversion_id,$new_step,$source_info['actions'], - $source_info['expected_results'],$source_info['execution_type']); - - if( $op['status_ok'] ) - { - $guiObj->user_feedback = sprintf(lang_get('step_number_x_created_as_copy'),$new_step,$argsObj->step_number); - $guiObj->step_exec_type = TESTCASE_EXECUTION_TYPE_MANUAL; - - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - $this->initTestCaseBasicInfo($argsObj,$guiObj); - } - - - // Get all existent steps - $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - - // After copy I would like to return to target step in edit mode, - // is enough to set $guiObj->step_number to target test step --> FOUND THIS is WRONG - // generated BUGID 4410 - $guiObj->step_number = $argsObj->step_number; - $guiObj->step_id = $argsObj->step_id; - - $guiObj->step_set = $this->tcaseMgr->get_step_numbers($argsObj->tcversion_id); - $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",",array_keys($guiObj->step_set)); - $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL,$argsObj->tcase_id,$argsObj->tcversion_id); - - $templateCfg = templateConfiguration('tcStepEdit'); - $guiObj->template=$templateCfg->default_template; - return $guiObj; - } - - - - /** - * doInsertStep - * - */ - function doInsertStep(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - // Get all existent steps - info needed to do renumbering - $stepNumberSet = array(); - $existentSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - $stepsQty = count($existentSteps); - for($idx=0; $idx < $stepsQty; $idx++) - { - $stepNumberSet[$idx] = $existentSteps[$idx]['step_number']; - $stepIDSet[$idx] = $existentSteps[$idx]['id']; - } - - $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); - $newStepNumber = $stepInfo['step_number'] + 1; - $op = $this->tcaseMgr->create_step($argsObj->tcversion_id,$newStepNumber,'',''); - $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'),$newStepNumber, - $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - - if( $op['status_ok'] ) - { - $guiObj->user_feedback = sprintf(lang_get('step_number_x_created'),$newStepNumber); - $guiObj->step_exec_type = TESTCASE_EXECUTION_TYPE_MANUAL; - $guiObj->cleanUpWebEditor = true; - - // renumber steps only if new step hits an existent step number - $hitPos = array_search($newStepNumber, $stepNumberSet); - if( $hitPos !== FALSE ) - { - // Process starts from this position - $just_renumbered = array('pos' => $hitPos, 'value' => $newStepNumber+1); - $renumbered[$stepIDSet[$hitPos]] = $just_renumbered['value']; - - // now check if new renumbered collides with next - // if not nothing needs to be done - // if yes need to loop - $startFrom = $hitPos +1; - $endOn = count($stepNumberSet); - for($jdx = $startFrom; $jdx < $endOn; $jdx++) - { - if( $stepNumberSet[$jdx] == $just_renumbered['value'] ) - { - $just_renumbered['value']++; - $renumbered[$stepIDSet[$jdx]] = $just_renumbered['value']; - } - } - $this->tcaseMgr->set_step_number($renumbered); - } - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - $this->initTestCaseBasicInfo($argsObj,$guiObj); - } - - // Get all existent steps - updated - $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - $guiObj->action = __FUNCTION__; - $guiObj->step_number = $newStepNumber; - $guiObj->step_id = $op['id']; - - $guiObj->step_set = $this->tcaseMgr->get_step_numbers($argsObj->tcversion_id); - $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",",array_keys($guiObj->step_set)); - $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL,$argsObj->tcase_id,$argsObj->tcversion_id); - $templateCfg = templateConfiguration('tcStepEdit'); - $guiObj->template=$templateCfg->default_template; - return $guiObj; - } - - - /** - * - */ - function doResequenceSteps(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - if ($argsObj->stepSeq != '') { - $xx = explode('&', $argsObj->stepSeq); - $point = 1; - foreach($xx as $step_id) { - $renumbered[$step_id] = $point++; - } - } else { - // Get all existent steps - info needed to do renumbering - $stepNumberSet = array(); - $stepSet = $this->tcaseMgr->get_steps($argsObj->tcversion_id); - $stepsQty = count($stepSet); - for($idx=0; $idx < $stepsQty; $idx++) { - $renumbered[$stepSet[$idx]['id']] = $idx+1; - } - } - - $this->tcaseMgr->set_step_number($renumbered); - - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&" . - "show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - return $guiObj; - } - - - /** - * - * - * - */ - function setImportance(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $this->tcaseMgr->setImportance($argsObj->tcversion_id,$argsObj->importance); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - // set up for rendering - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&". - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - return $guiObj; - } - - /** - * - * - * - */ - function setStatus(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $this->tcaseMgr->setStatus($argsObj->tcversion_id,$argsObj->status); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - // set up for rendering - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - return $guiObj; - } - - /** - * - * - * - */ - function setExecutionType(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $opx = array('updSteps' => $argsObj->applyExecTypeChangeToAllSteps); - $this->tcaseMgr->setExecutionType($argsObj->tcversion_id,$argsObj->exec_type,$opx); - - - - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - // - - - - // set up for rendering - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - return $guiObj; - } - - /** - * - * - * - */ - function setEstimatedExecDuration(&$argsObj,$request) - { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $this->tcaseMgr->setEstimatedExecDuration($argsObj->tcversion_id,$argsObj->estimatedExecDuration); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - // set up for rendering - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - return $guiObj; - } - - - - /** - * - * - */ - function show(&$argsObj,$request,$userFeedback,$opt=null) { - $smartyObj = new TLSmarty(); - - $options = array('updateCFOnDB' => true, - 'updateTPlanLinkToTCV' => false); - $options = array_merge($options,(array)$opt); - - $updateCFOnDB = $options['updateCFOnDB']; - - $guiObj = $this->initGuiBean($argsObj); - $identity = $this->buildIdentity($argsObj); - - $guiObj->uploadOp = property_exists($argsObj,'uploadOp') ? $argsObj->uploadOp : ''; - - $guiObj->viewerArgs=array(); - $guiObj->refreshTree = ($argsObj->refreshTree - && $userFeedback['status_ok']) ? 1 : 0; - $guiObj->has_been_executed = $argsObj->has_been_executed; - $guiObj->steps_results_layout = config_get('spec_cfg')->steps_results_layout; - $guiObj->user_feedback = ''; - - $guiObj->direct_link = - $this->tcaseMgr->buildDirectWebLink($_SESSION['basehref'], - $argsObj->tcase_id, - $argsObj->testproject_id); - - if($userFeedback['status_ok']) { - if( $options['updateTPlanLinkToTCV'] ) { - $guiObj->updateTPlanLinkToTCV = true; - $guiObj->show_mode = 'editOnExec'; - - // @20190127 the only useful thing there may be is the Rabbit - $guiObj->additionalURLPar = - "&updateTCVToThis=" . $identity->version_id . - "&followTheWhiteRabbit=1"; - $guiObj->closeMyWindow = 1; - - } - - $guiObj->user_feedback = ''; - if($updateCFOnDB) { - $cfCtx = array('tproject_id' => $identity->tproject_id, 'enabled' => 1, - 'node_type' => 'testcase'); - $cf_map = $this->tcaseMgr->cfield_mgr->getLinkedCfieldsAtDesign($cfCtx); - - - $this->tcaseMgr->cfield_mgr->design_values_to_db($request,$identity->version_id,$cf_map); - } - - $guiObj->attachments[$identity->version_id] = - getAttachmentInfosFrom($this->tcaseMgr,$identity->version_id); - } - else { - $guiObj->viewerArgs['user_feedback'] = $guiObj->user_feedback = $userFeedback['msg']; - } - - $guiObj->viewerArgs['refreshTree'] = $guiObj->refreshTree; - $guiObj->viewerArgs['user_feedback'] = $guiObj->user_feedback; - - $this->tcaseMgr->show($smartyObj,$guiObj,$identity,$this->grants); - exit(); - } - - - /** - * - */ - private function buildIdentity($cred) { - $idy= new stdClass(); - if( property_exists($cred, 'tproject_id') ) { - $idy->tproject_id = $cred->tproject_id; - } - else if( property_exists($cred, 'testproject_id')) { - $idy->tproject_id = $cred->testproject_id; - } - else { - throw new Exception(__METHOD__ . ' EXCEPTION: test project ID, is mandatory'); - } - $idy->tproject_id = intval($idy->tproject_id); - $idy->id = intval($cred->tcase_id); - $idy->version_id = $cred->tcversion_id; - return $idy; - } - - - /** - * - * - */ - function doAddRelation(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - if($argsObj->destination_tcase_id >0) { - $relTypeInfo = explode('_',$argsObj->relation_type); - $source_id = $argsObj->tcase_id; - $destination_id = $argsObj->destination_tcase_id; - if( $relTypeInfo[1] == "destination" ) { - $source_id = $argsObj->destination_tcase_id; - $destination_id = $argsObj->tcase_id; - } - - $ret = $this->tcaseMgr->addRelation($source_id, $destination_id,$relTypeInfo[0], $argsObj->user_id); - $guiObj->user_feedback = sprintf(lang_get($ret['msg']), $argsObj->relation_destination_tcase); - } - else { - $guiObj->user_feedback = sprintf(lang_get('testcase_doesnot_exists'), $argsObj->relation_destination_tcase); - } - - // set up for rendering - // It's OK put fixed 0 on version_id other functions on the chain to do the display know how to manage this - $guiObj->template = "archiveData.php?version_id=0&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - if($guiObj->user_feedback != '') { - $guiObj->template .= "&add_relation_feedback_msg=" . urlencode($guiObj->user_feedback); - } - return $guiObj; - } - - /** - * - * - */ - function doDeleteRelation(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - if($argsObj->relation_id >0) { - $this->tcaseMgr->deleteRelationByID($argsObj->relation_id); - } - - // set up for rendering - $guiObj->template = "archiveData.php?edit=testcase&" . - "id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . - "&caller=delRel"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - return $guiObj; - } - - - - /** - * doUpdateStepAndExit - * - */ - function doUpdateStepAndInsert(&$argsObj,$request) { - $this->doUpdateStep($argsObj,$request); - return $this->doInsertStep($argsObj,$request); - } - - - /** - * - * - */ - function removeKeyword(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - if($argsObj->tckw_link_id > 0) { - $this->tcaseMgr->deleteKeywordsByLink( - $guiObj->tcase_id, $argsObj->tckw_link_id,testcase::AUDIT_ON); - } - - // set up for rendering - $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . "&caller=removeKeyword"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - return $guiObj; - } - - - function freeze(&$argsObj,$request) { - $argsObj->isOpen = 0; - return $this->setIsOpen($argsObj,$request); - } - - function unfreeze(&$argsObj,$request) { - $argsObj->isOpen = 1; - return $this->setIsOpen($argsObj,$request); - } - - /** - * - */ - function setIsOpen(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $this->tcaseMgr->setIsOpen(null,$argsObj->tcversion_id,$argsObj->isOpen); - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - // set up for rendering - $guiObj->template = - "archiveData.php?version_id={$guiObj->tcversion_id}&" . - "tcversion_id={$guiObj->tcversion_id}&" . - "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - $guiObj->user_feedback = ''; - return $guiObj; - } - - - /** - * - */ - function setActiveAttr(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - $this->tcaseMgr->update_active_status($argsObj->tcase_id, - $argsObj->tcversion_id, $argsObj->activeAttr); - - $this->tcaseMgr->update_last_modified($argsObj->tcversion_id,$argsObj->user_id); - - $lk = 'audit_tcversion_deactivated'; - $pre = 'DE'; - if( $argsObj->activeAttr ) { - $pre = ''; - $lk = 'audit_tcversion_activated'; - } - - logAuditEvent(TLS($lk,$guiObj->testcase['name'], - $guiObj->testcase['version']), - "{$pre}ACTIVATE","testcases"); - - $this->show($argsObj,$request,['status_ok' => 1],['updateCFOnDB' => false]); - exit(); - } - - - /** - * - * - */ - function addKeyword(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - $tcExternalID = $guiObj->testcase['tc_external_id']; - if( null != $argsObj->free_keywords && count($argsObj->free_keywords) > 0) { - $this->tcaseMgr->addKeywords($guiObj->tcase_id, - $guiObj->tcversion_id, - $argsObj->free_keywords); - - $info = $this->tprojectMgr->get_by_id($this->tproject_id); - $cfx = config_get('keywords')->byTestProject; - if( isset($cfx[$info['prefix']]) && - $cfx[$info['prefix']]['addTCLinkIntoITS'] && - $info['issue_tracker_enabled'] ) { - - $it_mgr = new tlIssueTracker($this->db); - $argsObj->itsCfg = $it_mgr->getLinkedTo($this->tproject_id); - $its = $it_mgr->getInterfaceObject($this->tproject_id); - if( method_exists($its,'addNote') ) { - $dl = sprintf(lang_get('dlToTCSpecPVCode'), $tcExternalID) . - ' ' . lang_get('dlToTCSpecPV') . ' ' . - $this->tcaseMgr->buildDirectWebLink($_SESSION['basehref'], - $argsObj->tcase_id,$argsObj->testproject_id); - - // Get keyword for human beins - $tbl = tlObject::getDBTables(array('keywords')); - $inClause = "'" . implode("','",$argsObj->free_keywords) . - "'"; - $sql = "SELECT id,keyword FROM {$tbl['keywords']} - WHERE id IN($inClause) "; - $kwSet = $this->db->fetchRowsIntoMap($sql,'id'); - - $strToDel = isset($cfx[$info['prefix']]['prefix']) ? - $cfx[$info['prefix']]['prefix'] : ''; - $strToDel = trim($strToDel); - foreach( $argsObj->free_keywords as $kw ) { - if( '' == $strToDel ) { - $kwv = $kwSet[$kw]['keyword']; - } else { - $kwv = str_replace($strToDel,'', - $kwSet[$kw]['keyword']); - } - try { - $opStatus = $its->addNote($kwv,$dl); - } catch(Exception $e) { - echo 'Silent Failure?'; - } - } - - - } - } - } - - // set up for rendering - $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . "&caller=addKeyword"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - return $guiObj; - } - - /** - * - * @used by tcEdit.php - * @use tcaseMgr->updateLatestTPlanLinkToTCV() - */ - function updateTPlanLinkToTCV($argsObj,$request) { - - $this->tcaseMgr->updateLatestTPlanLinkToTCV($argsObj->tcversion_id,$argsObj->tplan_id); - - $opt = array('updateTPlanLinkToTCV' => true); - - $this->show($argsObj,$request, array('status_ok' => 1),$opt); - } - - /** - * doStepOperationExit - * - */ - function doStepOperationExit(&$argsObj,$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - $guiObj->step_exec_type = $argsObj->exec_type; - $guiObj->tcversion_id = $argsObj->tcversion_id; - - $this->initTestCaseBasicInfo($argsObj,$guiObj); - $guiObj->main_descr = sprintf(lang_get('create_step'), $guiObj->testcase['tc_external_id'] . ':' . - $guiObj->testcase['name'], $guiObj->testcase['version']); - $guiObj->cleanUpWebEditor = true; - $this->initTestCaseBasicInfo($argsObj,$guiObj); - - // when working on step, refreshing tree is nonsense - $argsObj->refreshTree = 0; - - $opt= array('updateCFOnDB' => !self::UPDATECFONDB); - $this->show($argsObj,$request,array('status_ok' => true),$opt); - exit(); - } - - /** - * - * - */ - function addPlatform(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - if( null != $argsObj->free_platforms ) { - $this->tcaseMgr->addPlatforms($guiObj->tcase_id, - $guiObj->tcversion_id, $argsObj->free_platforms); - } - - // set up for rendering - $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . "&caller=addPlatform"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - - return $guiObj; - } - - /** - * - * - */ - function removePlatform(&$argsObj,&$request) { - $guiObj = $this->initGuiBean($argsObj); - $guiObj->user_feedback = ''; - - $this->initTestCaseBasicInfo($argsObj,$guiObj,array('accessByStepID' => false)); - - if($argsObj->tcplat_link_id > 0) { - $this->tcaseMgr->deletePlatformsByLink( - $guiObj->tcase_id, $argsObj->tcplat_link_id,testcase::AUDIT_ON); - } - - // set up for rendering - $guiObj->template = - "archiveData.php?edit=testcase&id={$guiObj->tcase_id}" . - "&show_mode={$guiObj->show_mode}" . - "&caller=removePlatform"; - - if( property_exists($guiObj, 'tplan_id') ) { - $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; - } - return $guiObj; - } - - - - - -} // end class +db = $db; + $this->tcaseMgr = new testcase($db); + $this->tcaseMgr->setTestProject($tproject_id); + + $this->tprojectMgr = &$this->tcaseMgr->tproject_mgr; + $this->tproject_id = $tproject_id; + + $this->execution_types = $this->tcaseMgr->get_execution_types(); + $this->grants = new stdClass(); + + $g2c = array( + 'mgt_modify_tc', + 'mgt_view_req', + 'testplan_planning', + 'req_tcase_link_management', + 'mgt_modify_req', + 'testproject_delete_executed_testcases', + 'testproject_edit_executed_testcases' + ); + foreach ($g2c as $grant) { + $this->grants->$grant = $userObj->hasRight($db, $grant, $tproject_id); + } + + $this->grants->requirement_mgmt = $this->grants->mgt_modify_req || + $this->grants->req_tcase_link_management; + + $this->tables = $this->tcaseMgr->getDBTables( + array( + 'keywords', + 'platforms' + )); + } + + public function setTemplateCfg($cfg) + { + $this->templateCfg = $cfg; + } + + /** + */ + public function initGuiBean(&$argsObj) + { + $obj = new stdClass(); + $obj->action = ''; + $obj->attachments = null; + $obj->cleanUpWebEditor = false; + $obj->containerID = ''; + $obj->direct_link = null; + $obj->execution_types = $this->execution_types; + + $obj->grants = $this->grants; + + $key = 'req_tcase_link_management'; + $obj->$key = $obj->grants->$key; + + $obj->has_been_executed = false; + $obj->initWebEditorFromTemplate = false; + + $obj->main_descr = ''; + $obj->name = ''; + $obj->path_info = null; + $obj->refreshTree = 0; + $obj->sqlResult = ''; + $obj->step_id = - 1; + $obj->step_set = ''; + $obj->steps = ''; + + $dummy = testcase::getLayout(); + $obj->tableColspan = $dummy->tableToDisplayTestCaseSteps->colspan; + + $tck = array( + 'tcase_id', + 'tcversion_id', + 'tplan_id' + ); + foreach ($tck as $pkey) { + $obj->$pkey = property_exists($argsObj, $pkey) ? $argsObj->$pkey : - 1; + } + + $obj->viewerArgs = null; + + $p2check = 'goback_url'; + $obj->$p2check = ''; + if (property_exists($argsObj, $p2check)) { + $obj->$p2check = ! is_null($argsObj->$p2check) ? $argsObj->$p2check : ''; + } + + $p2check = 'show_mode'; + if (property_exists($argsObj, $p2check)) { + $obj->$p2check = ! is_null($argsObj->$p2check) ? $argsObj->$p2check : 'show'; + } + + // need to check where is used + $obj->loadOnCancelURL = "archiveData.php?edit=testcase&show_mode={$obj->show_mode}&id=%s&version_id=%s"; + + if (property_exists($obj, 'tplan_id')) { + $obj->loadOnCancelURL .= "&tplan_id={$obj->tplan_id}"; + } + + if (property_exists($obj, 'show_mode')) { + $obj->loadOnCancelURL .= "&show_mode={$obj->show_mode}"; + } + + $obj->codeTrackerEnabled = $this->tprojectMgr->isCodeTrackerEnabled( + $this->tproject_id); + + return $obj; + } + + /** + * initialize common test case information, useful when working on steps + */ + public function initTestCaseBasicInfo(&$argsObj, &$guiObj, $opt = null) + { + $my['opt'] = array( + 'accessByStepID' => true + ); + $my['opt'] = array_merge($my['opt'], (array) $opt); + + // Security + // https://cxsecurity.com/issue/WLB-2019110139 + if (intval($argsObj->tcase_id) == 0 && + intval($argsObj->tcversion_id) == 0) { + die("Error Processing Request:" . __METHOD__); + } + + $greenCard = array( + 'tcase_id' => $argsObj->tcase_id, + 'tcversion_id' => $argsObj->tcversion_id + ); + + if ($my['opt']['accessByStepID']) { + foreach ($greenCard as $ky) { + // this logic need to be explained BETTER + if ($ky == 0) { + $greenCard = $this->tcaseMgr->getIdCardByStepID( + $argsObj->step_id); + break; + } + } + } + + $gopt = [ + 'output' => 'full_without_steps', + 'renderGhost' => true, + 'renderImageInline' => true, + 'renderVariables' => true, + 'tproject_id' => intval($argsObj->testproject_id) + ]; + + $tcaseInfo = $this->tcaseMgr->get_by_id($greenCard['tcase_id'], + $greenCard['tcversion_id'], null, $gopt); + + $external = $this->tcaseMgr->getExternalID($greenCard['tcase_id'], + $argsObj->testproject_id); + $tcaseInfo[0]['tc_external_id'] = $external[0]; + $guiObj->testcase = $tcaseInfo[0]; + + if (! isset($guiObj->testcase['ghost'])) { + $guiObj->testcase['ghost'] = null; + } + $guiObj->authorObj = tlUser::getByID($this->db, + $guiObj->testcase['author_id']); + + $guiObj->updaterObj = null; + if (! is_null($guiObj->testcase['updater_id'])) { + $guiObj->updaterObj = tlUser::getByID($this->db, + $guiObj->testcase['updater_id']); + } + + $cfCtx = array( + 'scope' => 'design', + 'tproject_id' => $argsObj->testproject_id, + 'link_id' => $argsObj->tcversion_id + ); + + $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); + foreach ($cfPlaces as $cfpKey => $cfpFilter) { + $guiObj->cfieldsDesignTime[$cfpKey] = $this->tcaseMgr->htmlTableOfCFValues( + $argsObj->tcase_id, $cfCtx, $cfpFilter); + } + } + + /** + */ + public function create(&$argsObj, &$otCfg) + { + $parentKeywords = array(); + $guiObj = $this->initGuiBean($argsObj); + $guiObj->initWebEditorFromTemplate = true; + + $guiObj->containerID = $argsObj->container_id; + if ($argsObj->container_id > 0) { + $pnode_info = $this->tcaseMgr->tree_manager->get_node_hierarchy_info( + $argsObj->container_id); + $node_descr = array_flip( + $this->tcaseMgr->tree_manager->get_available_node_types()); + $guiObj->parent_info['name'] = $pnode_info['name']; + $guiObj->parent_info['description'] = lang_get( + $node_descr[$pnode_info['node_type_id']]); + + // get keywords + $tsuiteMgr = new testsuite($this->db); + $parentKeywords = $tsuiteMgr->getKeywords($argsObj->container_id); + } + $sep_1 = config_get('gui_title_separator_1'); + $sep_2 = config_get('gui_title_separator_2'); + $guiObj->main_descr = $guiObj->parent_info['description'] . $sep_1 . + $guiObj->parent_info['name'] . $sep_2 . lang_get('title_new_tc'); + + $otCfg->to->map = array(); + keywords_opt_transf_cfg($otCfg, + implode(',', array_keys((array) $parentKeywords))); + + $guiObj->tc = array( + 'id' => 0, + 'name' => '', + 'importance' => config_get('testcase_importance_default'), + 'status' => null, + 'estimated_exec_duration' => null, + 'execution_type' => TESTCASE_EXECUTION_TYPE_MANUAL + ); + + $guiObj->opt_cfg = $otCfg; + $templateCfg = templateConfiguration('tcNew'); + $guiObj->template = $templateCfg->default_template; + + $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); + foreach ($cfPlaces as $locationKey => $locationFilter) { + $guiObj->cf[$locationKey] = $this->tcaseMgr->html_table_of_custom_field_inputs( + null, null, 'design', '', null, null, $argsObj->testproject_id, + $locationFilter, $_REQUEST); + } + + $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . + "lib/testcases/archiveData.php?id=" . intval($argsObj->container_id); + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->cancelActionJS .= "&tplan_id={$guiObj->tplan_id}"; + } + + if (property_exists($guiObj, 'show_mode')) { + $guiObj->cancelActionJS .= "&show_mode={$guiObj->show_mode}"; + } + + $guiObj->cancelActionJS .= '&edit=testsuite&level=testsuite&containerType=testsuite' . + "'"; + + return $guiObj; + } + + /** + */ + public function doCreate(&$argsObj, &$otCfg, $oWebEditorKeys, $request) + { + $guiObj = $this->create($argsObj, $otCfg, $oWebEditorKeys); + + // compute order + $new_order = config_get('treemenu_default_testcase_order'); + $co = $this->tcaseMgr->tree_manager->getBottomOrder( + $argsObj->container_id, array( + 'node_type' => 'testcase' + )); + if ($co > 0) { + $new_order = $co + 1; + } + + $options = array( + 'check_duplicate_name' => config_get('check_names_for_duplicates'), + 'action_on_duplicate_name' => 'block', + 'status' => $argsObj->tc_status, + 'estimatedExecDuration' => $argsObj->estimated_execution_duration + ); + + $tcase = $this->tcaseMgr->create($argsObj->container_id, $argsObj->name, + $argsObj->summary, $argsObj->preconditions, $argsObj->tcaseSteps, + $argsObj->user_id, $argsObj->assigned_keywords_list, $new_order, + testcase::AUTOMATIC_ID, $argsObj->exec_type, $argsObj->importance, + $options); + + if ($tcase['status_ok']) { + $guiObj->actionOK = true; + if ($argsObj->stay_here) { + $cf_map = $this->tcaseMgr->cfield_mgr->get_linked_cfields_at_design( + $argsObj->testproject_id, cfield_mgr::ENABLED, + NO_FILTER_SHOW_ON_EXEC, 'testcase'); + + $this->tcaseMgr->cfield_mgr->design_values_to_db($_REQUEST, + $tcase['tcversion_id'], $cf_map); + + $guiObj->user_feedback = sprintf(lang_get('tc_created'), + $argsObj->name); + $guiObj->sqlResult = 'ok'; + $guiObj->initWebEditorFromTemplate = true; + $guiObj->cleanUpWebEditor = true; + $opt_list = ''; + } else { + // we will not return to caller + $argsObj->tcase_id = $tcase['id']; + $argsObj->tcversion_id = $tcase['tcversion_id']; + + // BAD Choice Custom fields are written to db on $this->show() + $this->show($argsObj, $request, array( + 'status_ok' => 1 + )); + } + } elseif (isset($tcase['msg'])) { + $guiObj->actionOK = false; + $guiObj->user_feedback = lang_get('error_tc_add'); + $guiObj->user_feedback .= '' . $tcase['msg']; + $guiObj->sqlResult = 'ko'; + $opt_list = $argsObj->assigned_keywords_list; + $guiObj->initWebEditorFromTemplate = false; + } + + keywords_opt_transf_cfg($otCfg, $opt_list); + $guiObj->opt_cfg = $otCfg; + $templateCfg = templateConfiguration('tcNew'); + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /* + * function: edit (Test Case) + * + * args: + * + * returns: + * + */ + public function edit(&$argsObj, &$otCfg, $oWebEditorKeys) + { + $guiObj = $this->initGuiBean($argsObj); + $otCfg->to->map = $this->tcaseMgr->get_keywords_map($argsObj->tcase_id, + $argsObj->tcversion_id, + array( + 'orderByClause' => " ORDER BY keyword ASC " + )); + + keywords_opt_transf_cfg($otCfg, $argsObj->assigned_keywords_list); + + $gopt = [ + 'renderImageInline' => false, + 'renderImageInline' => false, + 'caller' => __METHOD__ + ]; + + $tc_data = $this->tcaseMgr->get_by_id($argsObj->tcase_id, + $argsObj->tcversion_id, null, $gopt); + foreach ($oWebEditorKeys as $key) { + $guiObj->$key = isset($tc_data[0][$key]) ? $tc_data[0][$key] : ''; + $argsObj->$key = $guiObj->$key; + } + + $cf_smarty = null; + $cfPlaces = $this->tcaseMgr->buildCFLocationMap(); + + // To skip in an elegant way?? + $hideCode = $cfPlaces['hide_because_is_used_as_variable']['location']; + unset($cfPlaces['hide_because_is_used_as_variable']); + + foreach ($cfPlaces as $locationKey => $locationFilter) { + switch ($locationKey) { + case 'standard_location': + $std = $locationFilter['location']; + $locationFilter['location'] = [ + $std, + $hideCode + ]; + break; + } + + $cf_smarty[$locationKey] = $this->tcaseMgr->html_table_of_custom_field_inputs( + $argsObj->tcase_id, null, 'design', '', $argsObj->tcversion_id, + null, null, $locationFilter); + } + + $templateCfg = templateConfiguration('tcEdit'); + $guiObj->cf = $cf_smarty; + $guiObj->tc = $tc_data[0]; + $guiObj->opt_cfg = $otCfg; + + $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . + "lib/testcases/archiveData.php?version_id=" . $argsObj->tcversion_id . + "&tcversion_id=" . $argsObj->tcversion_id . '&edit=testcase&id=' . + intval($argsObj->tcase_id); + + if (property_exists($argsObj, 'tplan_id')) { + $guiObj->cancelActionJS .= "&tplan_id={$argsObj->tplan_id}"; + } + + if (property_exists($argsObj, 'show_mode')) { + $guiObj->cancelActionJS .= "&show_mode={$argsObj->show_mode}"; + } + + $guiObj->cancelActionJS .= "'"; + + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /* + * function: doUpdate + * + * args: + * + * returns: + * + */ + public function doUpdate(&$argsObj, $request) + { + $options = array( + 'status' => $argsObj->tc_status, + 'estimatedExecDuration' => $argsObj->estimated_execution_duration + ); + + $ret = $this->tcaseMgr->update($argsObj->tcase_id, + $argsObj->tcversion_id, $argsObj->name, $argsObj->summary, + $argsObj->preconditions, $argsObj->tcaseSteps, $argsObj->user_id, + $argsObj->assigned_keywords_list, testcase::DEFAULT_ORDER, + $argsObj->exec_type, $argsObj->importance, $options); + + $this->show($argsObj, $request, $ret); + } + + /** + * doAdd2testplan + */ + public function doAdd2testplan(&$argsObj, $request) + { + $smartyObj = new TLSmarty(); + $smartyObj->assign('attachments', null); + $guiObj = $this->initGuiBean($argsObj); + $guiObj->refreshTree = $argsObj->refreshTree ? 1 : 0; + + $tplan_mgr = new testplan($this->db); + + // $request['add2tplanid'] + // main key: testplan id + // sec key : platform_id + $item2link = null; + if (isset($request['add2tplanid'])) { + foreach ($request['add2tplanid'] as $tplan_id => $platformSet) { + foreach ($platformSet as $platform_id => $dummy) { + $item2link = null; + $item2link['tcversion'][$argsObj->tcase_id] = $argsObj->tcversion_id; + $item2link['platform'][$platform_id] = $platform_id; + $item2link['items'][$argsObj->tcase_id][$platform_id] = $argsObj->tcversion_id; + $tplan_mgr->link_tcversions($tplan_id, $item2link, + $argsObj->user_id); + } + } + + $identity = new stdClass(); + $identity->tproject_id = $argsObj->tproject_id; + $identity->id = $argsObj->tcase_id; + $identity->version_id = $argsObj->tcversion_id; + + $this->tcaseMgr->show($smartyObj, $guiObj, $identity, $this->grants); + exit(); + } + return $guiObj; + } + + /** + * + * @internal revisions + */ + public function delete(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->delete_message = ''; + $cfg = config_get('testcase_cfg'); + + $guiObj->exec_status_quo = $this->tcaseMgr->getExecStatus( + $argsObj->tcase_id, null, array( + 'addExecIndicator' => true + )); + $guiObj->delete_enabled = 1; + if ($guiObj->exec_status_quo['executed'] && + ! $this->grants->testproject_delete_executed_testcases) { + $guiObj->delete_message = lang_get( + 'system_blocks_delete_executed_tc_when'); + $guiObj->delete_enabled = 0; + } + // need to remove 'executed' key, in order to do not have side effects on Viewer logic (template). + unset($guiObj->exec_status_quo['executed']); + + $guiObj->delete_mode = 'single'; + $guiObj->display_platform = false; + + // Need to understand if platform column has to be displayed on GUI + if (! is_null($guiObj->exec_status_quo)) { + // key level 1 : Test Case Version ID + // key level 2 : Test Plan ID + // key level 3 : Platform ID + + $versionSet = array_keys($guiObj->exec_status_quo); + $stop = false; + foreach ($versionSet as $version_id) { + $tplanSet = array_keys($guiObj->exec_status_quo[$version_id]); + foreach ($tplanSet as $tplan_id) { + if ($guiObj->display_platform = ! isset( + $guiObj->exec_status_quo[$version_id][$tplan_id][0])) { + $stop = true; + break; + } + } + if ($stop) { + break; + } + } + } + + $tcinfo = $this->tcaseMgr->get_by_id($argsObj->tcase_id); + list ($prefix,) = $this->tcaseMgr->getPrefix($argsObj->tcase_id, + $argsObj->testproject_id); + $prefix .= $cfg->glue_character; + $external_id = $prefix . $tcinfo[0]['tc_external_id']; + + $guiObj->title = lang_get('title_del_tc'); + $guiObj->testcase_name = $tcinfo[0]['name']; + $guiObj->testcase_id = $argsObj->tcase_id; + $guiObj->tcversion_id = testcase::ALL_VERSIONS; + $guiObj->refreshTree = 1; + $guiObj->main_descr = lang_get('title_del_tc') . TITLE_SEP . $external_id . + TITLE_SEP . $tcinfo[0]['name']; + + $guiObj->cancelActionJS = 'location.href=fRoot+' . "'" . + 'lib/testcases/archiveData.php?version_id=undefined&' . + 'edit=testcase&id=' . intval($guiObj->testcase_id) . "'"; + + $templateCfg = templateConfiguration('tcDelete'); + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /** + */ + public function doDelete(&$argsObj, $request) + { + $cfg = config_get('testcase_cfg'); + + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->delete_message = ''; + $guiObj->action = 'deleted'; + $guiObj->sqlResult = 'ok'; + $guiObj->delete_mode = 'single'; + + $tcinfo = $this->tcaseMgr->get_by_id($argsObj->tcase_id, + $argsObj->tcversion_id); + list ($prefix,) = $this->tcaseMgr->getPrefix($argsObj->tcase_id, + $argsObj->testproject_id); + $prefix .= $cfg->glue_character; + $external_id = $prefix . $tcinfo[0]['tc_external_id']; + if (! $this->tcaseMgr->delete($argsObj->tcase_id, $argsObj->tcversion_id)) { + $guiObj->action = ''; + $guiObj->sqlResult = $this->tcaseMgr->db->error_msg(); + } + + $guiObj->main_descr = lang_get('title_del_tc') . ":" . $external_id . + TITLE_SEP . htmlspecialchars($tcinfo[0]['name']); + + if ($argsObj->tcversion_id == testcase::ALL_VERSIONS) { + $guiObj->refreshTree = 1; + logAuditEvent(TLS("audit_testcase_deleted", $external_id), "DELETE", + $argsObj->tcase_id, "testcases"); + $guiObj->user_feedback = sprintf(lang_get('tc_deleted'), + ":" . $external_id . TITLE_SEP . $tcinfo[0]['name']); + } else { + $guiObj->main_descr .= " " . lang_get('version') . " " . + $tcinfo[0]['version']; + // When deleting JUST one version, there is no need to refresh tree + $guiObj->refreshTree = 0; + logAuditEvent( + TLS("audit_testcase_version_deleted", $tcinfo[0]['version'], + $external_id), "DELETE", $argsObj->tcase_id, "testcases"); + $guiObj->user_feedback = sprintf(lang_get('tc_version_deleted'), + $tcinfo[0]['name'], $tcinfo[0]['version']); + } + + $guiObj->testcase_name = $tcinfo[0]['name']; + $guiObj->testcase_id = $argsObj->tcase_id; + + $templateCfg = templateConfiguration('tcDelete'); + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /** + * createStep + */ + public function createStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $guiObj->main_descr = sprintf(lang_get('create_step'), + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + $max_step = $this->tcaseMgr->get_latest_step_number( + $argsObj->tcversion_id); + $max_step ++; + + $guiObj->step_number = $max_step; + $guiObj->step_exec_type = $guiObj->testcase['execution_type']; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $guiObj->step_set = $this->tcaseMgr->get_step_numbers( + $argsObj->tcversion_id); + $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",", + array_keys($guiObj->step_set)); + $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL, + $argsObj->tcase_id, $argsObj->tcversion_id); + + // Get all existent steps + $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + + $templateCfg = templateConfiguration('tcStepEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->action = __FUNCTION__; + + return $guiObj; + } + + /** + * doCreateStep + */ + public function doCreateStep(&$argsObj, $request, $doAndExit = false) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + $guiObj->main_descr = sprintf(lang_get('create_step'), + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + $new_step = $this->tcaseMgr->get_latest_step_number( + $argsObj->tcversion_id); + $new_step ++; + $op = $this->tcaseMgr->create_step($argsObj->tcversion_id, $new_step, + $argsObj->steps, $argsObj->expected_results, $argsObj->exec_type); + + $guiObj->doExit = false; + if ($op['status_ok']) { + $guiObj->doExit = $doAndExit; + $guiObj->user_feedback = sprintf(lang_get('step_number_x_created'), + $argsObj->step_number); + $guiObj->step_exec_type = $guiObj->testcase['execution_type']; + $guiObj->cleanUpWebEditor = true; + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + $this->initTestCaseBasicInfo($argsObj, $guiObj); + } + + if (! $guiObj->doExit) { + $guiObj->action = __FUNCTION__; + + // Get all existent steps + $guiObj->tcaseSteps = $this->tcaseMgr->get_steps( + $argsObj->tcversion_id); + $max_step = $this->tcaseMgr->get_latest_step_number( + $argsObj->tcversion_id); + $max_step ++; + $guiObj->step_number = $max_step; + + $guiObj->step_set = $this->tcaseMgr->get_step_numbers( + $argsObj->tcversion_id); + $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",", + array_keys($guiObj->step_set)); + $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL, + $argsObj->tcase_id, $argsObj->tcversion_id); + + $templateCfg = templateConfiguration('tcStepEdit'); + $guiObj->template = $templateCfg->default_template; + } + return $guiObj; + } + + /** + * doCreateStepAndExit + */ + public function doCreateStepAndExit(&$argsObj, $request) + { + $guiObj = $this->doCreateStep($argsObj, $request, true); + if ($guiObj->doExit) { + // when working on step, refreshing tree is nonsense + $argsObj->refreshTree = 0; + + $opt = array( + 'updateCFOnDB' => ! self::UPDATECFONDB + ); + $this->show($argsObj, $request, array( + 'status_ok' => true + ), $opt); + exit(); + } else { + return $guiObj; + } + } + + /** + * editStep + */ + public function editStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); + + $oWebEditorKeys = array( + 'steps' => 'actions', + 'expected_results' => 'expected_results' + ); + foreach ($oWebEditorKeys as $key => $field) { + $argsObj->$key = $stepInfo[$field]; + $guiObj->$key = $stepInfo[$field]; + } + + $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'), + $stepInfo['step_number'], + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + $guiObj->tcase_id = $argsObj->tcase_id; + $guiObj->tcversion_id = $argsObj->tcversion_id; + $guiObj->step_id = $argsObj->step_id; + $guiObj->step_exec_type = $stepInfo['execution_type']; + $guiObj->step_number = $stepInfo['step_number']; + + // Get all existent steps + $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + + $guiObj->step_set = $this->tcaseMgr->get_step_numbers( + $argsObj->tcversion_id); + $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",", + array_keys($guiObj->step_set)); + + $templateCfg = templateConfiguration('tcStepEdit'); + $guiObj->template = $templateCfg->default_template; + $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL, + $argsObj->tcase_id, $argsObj->tcversion_id); + + return $guiObj; + } + + /** + * doUpdateStep + */ + public function doUpdateStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + try { + $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); + } catch (Exception $e) { + echo $e->getMessage(); + } + + $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'), + $stepInfo['step_number'], + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + $this->tcaseMgr->update_step($argsObj->step_id, $argsObj->step_number, + $argsObj->steps, $argsObj->expected_results, $argsObj->exec_type); + + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $guiObj->tcversion_id = $argsObj->tcversion_id; + $guiObj->step_id = $argsObj->step_id; + $guiObj->step_number = $stepInfo['step_number']; + $guiObj->step_exec_type = $argsObj->exec_type; + + return $this->editStep($argsObj, $request); + } + + /** + * doUpdateStepAndExit + */ + public function doUpdateStepAndExit(&$argsObj, $request) + { + $this->doUpdateStep($argsObj, $request); + + // when working on step, refreshing tree is nonsense + $argsObj->refreshTree = 0; + $opt = array( + 'updateCFOnDB' => ! self::UPDATECFONDB + ); + $this->show($argsObj, $request, array( + 'status_ok' => true + ), $opt); + } + + /** + * doReorderSteps + */ + public function doReorderSteps(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->main_descr = lang_get('test_case'); + $this->tcaseMgr->set_step_number($argsObj->step_set); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $argsObj->refreshTree = 0; + $opt = array( + 'updateCFOnDB' => ! self::UPDATECFONDB + ); + $this->show($argsObj, $request, array( + 'status_ok' => true + ), $opt); + exit(); + } + + /** + * doDeleteStep + */ + public function doDeleteStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + + $guiObj->main_descr = lang_get('test_case'); + $guiObj->viewerArgs = array(); + $guiObj->refreshTree = 0; + $step_node = $this->tcaseMgr->tree_manager->get_node_hierarchy_info( + $argsObj->step_id); + + $tcversion_node = $this->tcaseMgr->tree_manager->get_node_hierarchy_info( + $step_node['parent_id']); + $argsObj->tcversion_id = $step_node['parent_id']; + $argsObj->tcase_id = $tcversion_node['parent_id']; + + $guiObj->user_feedback = ''; + $this->tcaseMgr->delete_step_by_id($argsObj->step_id); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $argsObj->refreshTree = 0; + $opt = array( + 'updateCFOnDB' => ! self::UPDATECFONDB + ); + $this->show($argsObj, $request, array( + 'status_ok' => true + ), $opt); + exit(); + } + + /** + * doCopyStep + */ + public function doCopyStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + // need to document difference bewteen these two similar concepts + $guiObj->action = __FUNCTION__; + $guiObj->operation = 'doUpdateStep'; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'), + $argsObj->step_number, + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + $new_step = $this->tcaseMgr->get_latest_step_number( + $argsObj->tcversion_id); + $new_step ++; + + $source_info = $this->tcaseMgr->get_steps($argsObj->tcversion_id, + $argsObj->step_number); + $source_info = current($source_info); + $op = $this->tcaseMgr->create_step($argsObj->tcversion_id, $new_step, + $source_info['actions'], $source_info['expected_results'], + $source_info['execution_type']); + + if ($op['status_ok']) { + $guiObj->user_feedback = sprintf( + lang_get('step_number_x_created_as_copy'), $new_step, + $argsObj->step_number); + $guiObj->step_exec_type = TESTCASE_EXECUTION_TYPE_MANUAL; + + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + $this->initTestCaseBasicInfo($argsObj, $guiObj); + } + + // Get all existent steps + $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + + // After copy I would like to return to target step in edit mode, + // is enough to set $guiObj->step_number to target test step --> FOUND THIS is WRONG + // generated BUGID 4410 + $guiObj->step_number = $argsObj->step_number; + $guiObj->step_id = $argsObj->step_id; + + $guiObj->step_set = $this->tcaseMgr->get_step_numbers( + $argsObj->tcversion_id); + $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",", + array_keys($guiObj->step_set)); + $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL, + $argsObj->tcase_id, $argsObj->tcversion_id); + + $templateCfg = templateConfiguration('tcStepEdit'); + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /** + * doInsertStep + */ + public function doInsertStep(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + // Get all existent steps - info needed to do renumbering + $stepNumberSet = array(); + $existentSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + $stepsQty = count($existentSteps); + for ($idx = 0; $idx < $stepsQty; $idx ++) { + $stepNumberSet[$idx] = $existentSteps[$idx]['step_number']; + $stepIDSet[$idx] = $existentSteps[$idx]['id']; + } + + $stepInfo = $this->tcaseMgr->get_step_by_id($argsObj->step_id); + $newStepNumber = $stepInfo['step_number'] + 1; + $op = $this->tcaseMgr->create_step($argsObj->tcversion_id, + $newStepNumber, '', ''); + $guiObj->main_descr = sprintf(lang_get('edit_step_number_x'), + $newStepNumber, + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + + if ($op['status_ok']) { + $guiObj->user_feedback = sprintf(lang_get('step_number_x_created'), + $newStepNumber); + $guiObj->step_exec_type = TESTCASE_EXECUTION_TYPE_MANUAL; + $guiObj->cleanUpWebEditor = true; + + // renumber steps only if new step hits an existent step number + $hitPos = array_search($newStepNumber, $stepNumberSet); + if ($hitPos !== false) { + // Process starts from this position + $just_renumbered = array( + 'pos' => $hitPos, + 'value' => $newStepNumber + 1 + ); + $renumbered[$stepIDSet[$hitPos]] = $just_renumbered['value']; + + // now check if new renumbered collides with next + // if not nothing needs to be done + // if yes need to loop + $startFrom = $hitPos + 1; + $endOn = count($stepNumberSet); + for ($jdx = $startFrom; $jdx < $endOn; $jdx ++) { + if ($stepNumberSet[$jdx] == $just_renumbered['value']) { + $just_renumbered['value'] ++; + $renumbered[$stepIDSet[$jdx]] = $just_renumbered['value']; + } + } + $this->tcaseMgr->set_step_number($renumbered); + } + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + $this->initTestCaseBasicInfo($argsObj, $guiObj); + } + + // Get all existent steps - updated + $guiObj->tcaseSteps = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + $guiObj->action = __FUNCTION__; + $guiObj->step_number = $newStepNumber; + $guiObj->step_id = $op['id']; + + $guiObj->step_set = $this->tcaseMgr->get_step_numbers( + $argsObj->tcversion_id); + $guiObj->step_set = is_null($guiObj->step_set) ? '' : implode(",", + array_keys($guiObj->step_set)); + $guiObj->loadOnCancelURL = sprintf($guiObj->loadOnCancelURL, + $argsObj->tcase_id, $argsObj->tcversion_id); + $templateCfg = templateConfiguration('tcStepEdit'); + $guiObj->template = $templateCfg->default_template; + return $guiObj; + } + + /** + */ + public function doResequenceSteps(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + if ($argsObj->stepSeq != '') { + $xx = explode('&', $argsObj->stepSeq); + $point = 1; + foreach ($xx as $step_id) { + $renumbered[$step_id] = $point ++; + } + } else { + // Get all existent steps - info needed to do renumbering + $stepSet = $this->tcaseMgr->get_steps($argsObj->tcversion_id); + $stepsQty = count($stepSet); + for ($idx = 0; $idx < $stepsQty; $idx ++) { + $renumbered[$stepSet[$idx]['id']] = $idx + 1; + } + } + + $this->tcaseMgr->set_step_number($renumbered); + + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&" . + "show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + return $guiObj; + } + + /** + */ + public function setImportance(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $this->tcaseMgr->setImportance($argsObj->tcversion_id, + $argsObj->importance); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + // set up for rendering + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + return $guiObj; + } + + /** + */ + public function setStatus(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $this->tcaseMgr->setStatus($argsObj->tcversion_id, $argsObj->status); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + // set up for rendering + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + return $guiObj; + } + + /** + */ + public function setExecutionType(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $opx = array( + 'updSteps' => $argsObj->applyExecTypeChangeToAllSteps + ); + $this->tcaseMgr->setExecutionType($argsObj->tcversion_id, + $argsObj->exec_type, $opx); + + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + // set up for rendering + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + return $guiObj; + } + + /** + */ + public function setEstimatedExecDuration(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $this->tcaseMgr->setEstimatedExecDuration($argsObj->tcversion_id, + $argsObj->estimatedExecDuration); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + // set up for rendering + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + return $guiObj; + } + + /** + */ + public function show(&$argsObj, $request, $userFeedback, $opt = null) + { + $smartyObj = new TLSmarty(); + + $options = array( + 'updateCFOnDB' => true, + 'updateTPlanLinkToTCV' => false + ); + $options = array_merge($options, (array) $opt); + + $updateCFOnDB = $options['updateCFOnDB']; + + $guiObj = $this->initGuiBean($argsObj); + $identity = $this->buildIdentity($argsObj); + + $guiObj->uploadOp = property_exists($argsObj, 'uploadOp') ? $argsObj->uploadOp : ''; + + $guiObj->viewerArgs = array(); + $guiObj->refreshTree = ($argsObj->refreshTree && + $userFeedback['status_ok']) ? 1 : 0; + $guiObj->has_been_executed = $argsObj->has_been_executed; + $guiObj->steps_results_layout = config_get('spec_cfg')->steps_results_layout; + $guiObj->user_feedback = ''; + + $guiObj->direct_link = $this->tcaseMgr->buildDirectWebLink( + $_SESSION['basehref'], $argsObj->tcase_id, $argsObj->testproject_id); + + if ($userFeedback['status_ok']) { + if ($options['updateTPlanLinkToTCV']) { + $guiObj->updateTPlanLinkToTCV = true; + $guiObj->show_mode = 'editOnExec'; + + // @20190127 the only useful thing there may be is the Rabbit + $guiObj->additionalURLPar = "&updateTCVToThis=" . + $identity->version_id . "&followTheWhiteRabbit=1"; + $guiObj->closeMyWindow = 1; + } + + $guiObj->user_feedback = ''; + if ($updateCFOnDB) { + $cfCtx = array( + 'tproject_id' => $identity->tproject_id, + 'enabled' => 1, + 'node_type' => 'testcase' + ); + $cf_map = $this->tcaseMgr->cfield_mgr->getLinkedCfieldsAtDesign( + $cfCtx); + + $this->tcaseMgr->cfield_mgr->design_values_to_db($request, + $identity->version_id, $cf_map); + } + + $guiObj->attachments[$identity->version_id] = getAttachmentInfosFrom( + $this->tcaseMgr, $identity->version_id); + } else { + $guiObj->viewerArgs['user_feedback'] = $guiObj->user_feedback = $userFeedback['msg']; + } + + $guiObj->viewerArgs['refreshTree'] = $guiObj->refreshTree; + $guiObj->viewerArgs['user_feedback'] = $guiObj->user_feedback; + + $this->tcaseMgr->show($smartyObj, $guiObj, $identity, $this->grants); + exit(); + } + + /** + */ + private function buildIdentity($cred) + { + $idy = new stdClass(); + if (property_exists($cred, 'tproject_id')) { + $idy->tproject_id = $cred->tproject_id; + } elseif (property_exists($cred, 'testproject_id')) { + $idy->tproject_id = $cred->testproject_id; + } else { + throw new Exception( + __METHOD__ . ' EXCEPTION: test project ID, is mandatory'); + } + $idy->tproject_id = intval($idy->tproject_id); + $idy->id = intval($cred->tcase_id); + $idy->version_id = $cred->tcversion_id; + return $idy; + } + + /** + */ + public function doAddRelation(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + if ($argsObj->destination_tcase_id > 0) { + $relTypeInfo = explode('_', $argsObj->relation_type); + $source_id = $argsObj->tcase_id; + $destination_id = $argsObj->destination_tcase_id; + if ($relTypeInfo[1] == "destination") { + $source_id = $argsObj->destination_tcase_id; + $destination_id = $argsObj->tcase_id; + } + + $ret = $this->tcaseMgr->addRelation($source_id, $destination_id, + $relTypeInfo[0], $argsObj->user_id); + $guiObj->user_feedback = sprintf(lang_get($ret['msg']), + $argsObj->relation_destination_tcase); + } else { + $guiObj->user_feedback = sprintf( + lang_get('testcase_doesnot_exists'), + $argsObj->relation_destination_tcase); + } + + // set up for rendering + // It's OK put fixed 0 on version_id other functions on the chain to do the display know how to manage this + $guiObj->template = "archiveData.php?version_id=0&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + if ($guiObj->user_feedback != '') { + $guiObj->template .= "&add_relation_feedback_msg=" . + urlencode($guiObj->user_feedback); + } + return $guiObj; + } + + /** + */ + public function doDeleteRelation(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + if ($argsObj->relation_id > 0) { + $this->tcaseMgr->deleteRelationByID($argsObj->relation_id); + } + + // set up for rendering + $guiObj->template = "archiveData.php?edit=testcase&" . + "id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . + "&caller=delRel"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + return $guiObj; + } + + /** + * doUpdateStepAndExit + */ + public function doUpdateStepAndInsert(&$argsObj, $request) + { + $this->doUpdateStep($argsObj, $request); + return $this->doInsertStep($argsObj, $request); + } + + /** + */ + public function removeKeyword(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + if ($argsObj->tckw_link_id > 0) { + $this->tcaseMgr->deleteKeywordsByLink($guiObj->tcase_id, + $argsObj->tckw_link_id, testcase::AUDIT_ON); + } + + // set up for rendering + $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . + "&caller=removeKeyword"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + return $guiObj; + } + + public function freeze(&$argsObj, $request) + { + $argsObj->isOpen = 0; + return $this->setIsOpen($argsObj, $request); + } + + public function unfreeze(&$argsObj, $request) + { + $argsObj->isOpen = 1; + return $this->setIsOpen($argsObj, $request); + } + + /** + */ + public function setIsOpen(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $this->tcaseMgr->setIsOpen(null, $argsObj->tcversion_id, + $argsObj->isOpen); + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + // set up for rendering + $guiObj->template = "archiveData.php?version_id={$guiObj->tcversion_id}&" . + "tcversion_id={$guiObj->tcversion_id}&" . + "edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + $guiObj->user_feedback = ''; + return $guiObj; + } + + /** + */ + public function setActiveAttr(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + $this->tcaseMgr->updateActiveStatus($argsObj->tcase_id, + $argsObj->tcversion_id, $argsObj->activeAttr); + + $this->tcaseMgr->update_last_modified($argsObj->tcversion_id, + $argsObj->user_id); + + $lk = 'audit_tcversion_deactivated'; + $pre = 'DE'; + if ($argsObj->activeAttr) { + $pre = ''; + $lk = 'audit_tcversion_activated'; + } + + logAuditEvent( + TLS($lk, $guiObj->testcase['name'], $guiObj->testcase['version']), + "{$pre}ACTIVATE", "testcases"); + + $this->show($argsObj, $request, [ + 'status_ok' => 1 + ], [ + 'updateCFOnDB' => false + ]); + exit(); + } + + /** + */ + public function addKeyword(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + $tcExternalID = $guiObj->testcase['tc_external_id']; + if (null != $argsObj->free_keywords && count($argsObj->free_keywords) > 0) { + $this->tcaseMgr->addKeywords($guiObj->tcase_id, + $guiObj->tcversion_id, $argsObj->free_keywords); + + $info = $this->tprojectMgr->get_by_id($this->tproject_id); + $cfx = config_get('keywords')->byTestProject; + if (isset($cfx[$info['prefix']]) && + $cfx[$info['prefix']]['addTCLinkIntoITS'] && + $info['issue_tracker_enabled']) { + + $it_mgr = new tlIssueTracker($this->db); + $argsObj->itsCfg = $it_mgr->getLinkedTo($this->tproject_id); + $its = $it_mgr->getInterfaceObject($this->tproject_id); + if (method_exists($its, 'addNote')) { + $dl = sprintf(lang_get('dlToTCSpecPVCode'), $tcExternalID) . + ' ' . lang_get('dlToTCSpecPV') . ' ' . + $this->tcaseMgr->buildDirectWebLink( + $_SESSION['basehref'], $argsObj->tcase_id, + $argsObj->testproject_id); + + // Get keyword for human beins + $tbl = tlObject::getDBTables(array( + 'keywords' + )); + $inClause = "'" . implode("','", $argsObj->free_keywords) . + "'"; + $sql = "SELECT id,keyword FROM {$tbl['keywords']} + WHERE id IN($inClause) "; + $kwSet = $this->db->fetchRowsIntoMap($sql, 'id'); + + $strToDel = isset($cfx[$info['prefix']]['prefix']) ? $cfx[$info['prefix']]['prefix'] : ''; + $strToDel = trim($strToDel); + foreach ($argsObj->free_keywords as $kw) { + if ('' == $strToDel) { + $kwv = $kwSet[$kw]['keyword']; + } else { + $kwv = str_replace($strToDel, '', + $kwSet[$kw]['keyword']); + } + try { + $its->addNote($kwv, $dl); + } catch (Exception $e) { + echo 'Silent Failure?'; + } + } + } + } + } + + // set up for rendering + $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . + "&caller=addKeyword"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + return $guiObj; + } + + /** + * + * @used by tcEdit.php + * @use tcaseMgr->updateLatestTPlanLinkToTCV() + */ + public function updateTPlanLinkToTCV($argsObj, $request) + { + $this->tcaseMgr->updateLatestTPlanLinkToTCV($argsObj->tcversion_id, + $argsObj->tplan_id); + + $opt = array( + 'updateTPlanLinkToTCV' => true + ); + + $this->show($argsObj, $request, array( + 'status_ok' => 1 + ), $opt); + } + + /** + * doStepOperationExit + */ + public function doStepOperationExit(&$argsObj, $request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + $guiObj->step_exec_type = $argsObj->exec_type; + $guiObj->tcversion_id = $argsObj->tcversion_id; + + $this->initTestCaseBasicInfo($argsObj, $guiObj); + $guiObj->main_descr = sprintf(lang_get('create_step'), + $guiObj->testcase['tc_external_id'] . ':' . $guiObj->testcase['name'], + $guiObj->testcase['version']); + $guiObj->cleanUpWebEditor = true; + $this->initTestCaseBasicInfo($argsObj, $guiObj); + + // when working on step, refreshing tree is nonsense + $argsObj->refreshTree = 0; + + $opt = array( + 'updateCFOnDB' => ! self::UPDATECFONDB + ); + $this->show($argsObj, $request, array( + 'status_ok' => true + ), $opt); + exit(); + } + + /** + */ + public function addPlatform(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + if (null != $argsObj->free_platforms) { + $this->tcaseMgr->addPlatforms($guiObj->tcase_id, + $guiObj->tcversion_id, $argsObj->free_platforms); + } + + // set up for rendering + $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}&show_mode={$guiObj->show_mode}" . + "&caller=addPlatform"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + + return $guiObj; + } + + /** + */ + public function removePlatform(&$argsObj, &$request) + { + $guiObj = $this->initGuiBean($argsObj); + $guiObj->user_feedback = ''; + + $this->initTestCaseBasicInfo($argsObj, $guiObj, + array( + 'accessByStepID' => false + )); + + if ($argsObj->tcplat_link_id > 0) { + $this->tcaseMgr->deletePlatformsByLink($guiObj->tcase_id, + $argsObj->tcplat_link_id, testcase::AUDIT_ON); + } + + // set up for rendering + $guiObj->template = "archiveData.php?edit=testcase&id={$guiObj->tcase_id}" . + "&show_mode={$guiObj->show_mode}" . "&caller=removePlatform"; + + if (property_exists($guiObj, 'tplan_id')) { + $guiObj->template .= "&tplan_id={$guiObj->tplan_id}"; + } + return $guiObj; + } +} diff --git a/lib/usermanagement/rolesEdit.php b/lib/usermanagement/rolesEdit.php index 5dd50bd197..ab9b5aac6f 100644 --- a/lib/usermanagement/rolesEdit.php +++ b/lib/usermanagement/rolesEdit.php @@ -1,313 +1,361 @@ -basehref,$editorCfg) ; -$owebeditor->Value = getItemTemplateContents('role_template', $owebeditor->InstanceName, null); -$canManage = $args->user->hasRight($db,"role_management") ? true : false; - -switch ($args->doAction) { - case 'create': - $gui->main_title = $lbl["action_{$args->doAction}_role"]; - break; - - case 'edit': - $op->role = tlRole::getByID($db,$args->roleid); - $gui->main_title = $lbl["action_{$args->doAction}_role"]; - break; - - case 'doCreate': - case 'doUpdate': - case 'duplicate': - if ($canManage) { - $op = doOperation($db,$args,$args->doAction); - $templateCfg->template = $op->template; - } - break; - - default: - break; -} - -$gui = complete_gui($db,$gui,$args,$op->role,$owebeditor); -$gui->userFeedback = $op->userFeedback; - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -// $smarty->assign('highlight',$gui->highlight); -renderGui($smarty,$args,$templateCfg); - -/** - * - */ -function init_args() -{ - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = array("rolename" => array("POST",tlInputParameter::STRING_N,0,100), - "roleid" => array("REQUEST",tlInputParameter::INT_N), - "doAction" => array("REQUEST",tlInputParameter::STRING_N,0,100), - "notes" => array("POST",tlInputParameter::STRING_N), - "grant" => array("POST",tlInputParameter::ARRAY_STRING_N)); - - $args = new stdClass(); - $pParams = I_PARAMS($iParams,$args); - $args->basehref = $_SESSION['basehref']; - $args->user = $_SESSION['currentUser']; - - return $args; -} - -/** - * - */ -function doOperation(&$dbHandler,$argsObj,$operation) -{ - $op = new stdClass(); - $op->role = new tlRole(); - $op->userFeedback = null; - $op->template = 'rolesEdit.tpl'; - - switch($operation) - { - - case 'doCreate': - case 'doUpdate': - $rights = implode("','",array_keys($argsObj->grant)); - $op->role->rights = tlRight::getAll($dbHandler,"WHERE description IN ('{$rights}')"); - $op->role->name = $argsObj->rolename; - $op->role->description = $argsObj->notes; - $op->role->dbID = $argsObj->roleid; - break; - - case 'duplicate': - $op->role = tlRole::getByID($dbHandler,$argsObj->roleid); - $op->role->dbID = null; - $op->role->name = generateUniqueName($op->role->name); - - break; - } - - - $result = $op->role->writeToDB($dbHandler); - if ($result >= tl::OK) - { - $auditCfg = null; - switch($operation) - { - case 'doCreate': - case 'duplicate': - $auditCfg['msg'] = "audit_role_created"; - $auditCfg['activity'] = "CREATE"; - break; - - case 'doUpdate': - $auditCfg['msg'] = "audit_role_saved"; - $auditCfg['activity'] = "SAVE"; - break; - } - - logAuditEvent(TLS($auditCfg['msg'],$op->role->name),$auditCfg['activity'],$op->role->dbID,"roles"); - $op->template = null; - } - else - { - $op->userFeedback = getRoleErrorMessage($result); - } - - return $op; -} - - -function renderGui(&$smartyObj,&$argsObj,$templateCfg) -{ - $doRender = false; - switch($argsObj->doAction) - { - case "edit": - case "create": - $doRender = true; - $tpl = $templateCfg->default_template; - break; - - case "doCreate": - case "doUpdate": - if(!is_null($templateCfg->template)) - { - $doRender = true; - $tpl = $templateCfg->template; - } - else - { - header("Location: rolesView.php"); - exit(); - } - break; - - case "duplicate": - header("Location: rolesView.php"); - exit(); - break; - } - - if($doRender) - { - $smartyObj->display($templateCfg->template_dir . $tpl); - } -} - - -/* - function: getRightsCfg - - args : - - - returns: object - -*/ -function getRightsCfg() -{ - $cfg = new stdClass(); - $cfg->tplan_mgmt = config_get('rights_tp'); - $cfg->tcase_mgmt = config_get('rights_mgttc'); - $cfg->kword_mgmt = config_get('rights_kw'); - $cfg->tproject_mgmt = config_get('rights_product'); - $cfg->user_mgmt = config_get('rights_users'); - $cfg->req_mgmt = config_get('rights_req'); - $cfg->cfield_mgmt = config_get('rights_cf'); - $cfg->system_mgmt = config_get('rights_system'); - $cfg->platform_mgmt = config_get('rights_platforms'); - $cfg->issuetracker_mgmt = config_get('rights_issuetrackers'); - $cfg->codetracker_mgmt = config_get('rights_codetrackers'); - $cfg->execution = config_get('rights_executions'); - - return $cfg; -} - - -function initialize_gui(&$argsObj,$editorType) -{ - $gui = new stdClass(); - $gui->checkboxStatus = null; - $gui->userFeedback = null; - $gui->affectedUsers = null; - $gui->highlight = initialize_tabsmenu(); - $gui->editorType = $editorType; - $gui->roleCanBeEdited = ($argsObj->roleid != TL_ROLES_ADMIN); - - return $gui; -} - -/** - * - */ -function initialize_op() -{ - $op = new stdClass(); - $op->role = new tlRole(); - $op->userFeedback = ''; - - return $op; -} - -/** - * - */ -function complete_gui(&$dbHandler,&$guiObj,&$argsObj,&$roleObj,&$webEditorObj) -{ - $actionCfg['operation'] = array('create' => 'doCreate', 'edit' => 'doUpdate', - 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', - 'duplicate' => 'duplicate'); - - $actionCfg['highlight'] = array('create' => 'create_role', 'edit' => 'edit_role', - 'doCreate' => 'create_role', - 'doUpdate' => 'edit_role', - 'duplicate' => 'create_role'); - - $guiObj->highlight = new stdClass(); - $kp = $actionCfg['highlight'][$argsObj->doAction]; - $guiObj->highlight->$kp = 1; - $guiObj->operation = $actionCfg['operation'][$argsObj->doAction]; - - $guiObj->role = $roleObj; - $guiObj->grants = getGrantsForUserMgmt($dbHandler,$_SESSION['currentUser']); - $guiObj->grants->mgt_view_events = $argsObj->user->hasRight($db,"mgt_view_events"); - $guiObj->rightsCfg = getRightsCfg(); - - $guiObj->disabledAttr = $guiObj->roleCanBeEdited ? ' ' : ' disabled="disabled" '; - - // Create status for all checkboxes and set to unchecked - foreach ($guiObj->rightsCfg as $grantDetails) { - foreach ($grantDetails as $grantCode => $grantDescription) { - $guiObj->checkboxStatus[$grantCode] = "" . $guiObj->disabledAttr; - } - } - - if($roleObj->dbID) - { - $webEditorObj->Value = $roleObj->description; - - // build checked attribute for checkboxes - if(sizeof($roleObj->rights)) - { - foreach($roleObj->rights as $key => $right) - { - $guiObj->checkboxStatus[$right->name] = ' checked="checked" ' . $guiObj->disabledAttr; - } - } - //get all users which are affected by changing the role definition - $guiObj->affectedUsers = $roleObj->getAllUsersWithRole($dbHandler); - } - - $guiObj->notes = $webEditorObj->CreateHTML(); - return $guiObj; -} - -function generateUniqueName($s) -{ - // sorry for the magic, but anyway user has to edit role to provide desired name - // IMHO this quick & dirty solution is OK - return substr($s . ' - Copy - ' . substr(sha1(rand()), 0, 50),0,100); -} - - -/** - * - */ -function initLabels() -{ - $tg = array('action_create_role' => null,'action_edit_role' => null); - $labels = init_labels($tg); - return $labels; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"role_management"); +basehref, $editorCfg); +$owebeditor->Value = getItemTemplateContents('role_template', + $owebeditor->InstanceName, null); +$canManage = $args->user->hasRight($db, "role_management") ? true : false; + +switch ($args->doAction) { + case 'create': + $gui->main_title = $lbl["action_{$args->doAction}_role"]; + break; + + case 'edit': + $op->role = tlRole::getByID($db, $args->roleid); + $gui->main_title = $lbl["action_{$args->doAction}_role"]; + break; + + case 'doCreate': + case 'doUpdate': + case 'duplicate': + if ($canManage) { + $op = doOperation($db, $args, $args->doAction); + $templateCfg->template = $op->template; + } + break; + + default: + break; +} + +$gui = completeGui($db, $gui, $args, $op->role, $owebeditor); +$gui->userFeedback = $op->userFeedback; + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +renderGui($smarty, $args, $templateCfg); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "rolename" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 100 + ), + "roleid" => array( + "REQUEST", + tlInputParameter::INT_N + ), + "doAction" => array( + "REQUEST", + tlInputParameter::STRING_N, + 0, + 100 + ), + "notes" => array( + "POST", + tlInputParameter::STRING_N + ), + "grant" => array( + "POST", + tlInputParameter::ARRAY_STRING_N + ) + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + $args->basehref = $_SESSION['basehref']; + $args->user = $_SESSION['currentUser']; + + return $args; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param string $operation + * @return stdClass + */ +function doOperation(&$dbHandler, $argsObj, $operation) +{ + $op = new stdClass(); + $op->role = new tlRole(); + $op->userFeedback = null; + $op->template = 'rolesEdit.tpl'; + + switch ($operation) { + case 'doCreate': + case 'doUpdate': + $rights = implode("','", array_keys($argsObj->grant)); + $op->role->rights = tlRight::getAll($dbHandler, + "WHERE description IN ('{$rights}')"); + $op->role->name = $argsObj->rolename; + $op->role->description = $argsObj->notes; + $op->role->dbID = $argsObj->roleid; + break; + + case 'duplicate': + $op->role = tlRole::getByID($dbHandler, $argsObj->roleid); + $op->role->dbID = null; + $op->role->name = generateUniqueName($op->role->name); + + break; + } + + $result = $op->role->writeToDB($dbHandler); + if ($result >= tl::OK) { + $auditCfg = null; + switch ($operation) { + case 'doCreate': + case 'duplicate': + $auditCfg['msg'] = "audit_role_created"; + $auditCfg['activity'] = "CREATE"; + break; + + case 'doUpdate': + $auditCfg['msg'] = "audit_role_saved"; + $auditCfg['activity'] = "SAVE"; + break; + } + + logAuditEvent(TLS($auditCfg['msg'], $op->role->name), + $auditCfg['activity'], $op->role->dbID, "roles"); + $op->template = null; + } else { + $op->userFeedback = getRoleErrorMessage($result); + } + + return $op; +} + +/** + * + * @param TLSmarty $smartyObj + * @param stdClass $argsObj + * @param stdClass $templateCfg + */ +function renderGui(&$smartyObj, &$argsObj, $templateCfg) +{ + $doRender = false; + switch ($argsObj->doAction) { + case "edit": + case "create": + $doRender = true; + $tpl = $templateCfg->default_template; + break; + + case "doCreate": + case "doUpdate": + if (! is_null($templateCfg->template)) { + $doRender = true; + $tpl = $templateCfg->template; + } else { + header("Location: rolesView.php"); + exit(); + } + break; + + case "duplicate": + header("Location: rolesView.php"); + exit(); + break; + } + + if ($doRender) { + $smartyObj->display($templateCfg->template_dir . $tpl); + } +} + +/** + * + * @return stdClass + */ +function getRightsCfg() +{ + $cfg = new stdClass(); + $cfg->tplan_mgmt = config_get('rights_tp'); + $cfg->tcase_mgmt = config_get('rights_mgttc'); + $cfg->kword_mgmt = config_get('rights_kw'); + $cfg->tproject_mgmt = config_get('rights_product'); + $cfg->user_mgmt = config_get('rights_users'); + $cfg->req_mgmt = config_get('rights_req'); + $cfg->cfield_mgmt = config_get('rights_cf'); + $cfg->system_mgmt = config_get('rights_system'); + $cfg->platform_mgmt = config_get('rights_platforms'); + $cfg->issuetracker_mgmt = config_get('rights_issuetrackers'); + $cfg->codetracker_mgmt = config_get('rights_codetrackers'); + $cfg->execution = config_get('rights_executions'); + + return $cfg; +} + +/** + * + * @param stdClass $argsObj + * @param string $editorType + * @return stdClass + */ +function initializeGui(&$argsObj, $editorType) +{ + $gui = new stdClass(); + $gui->checkboxStatus = null; + $gui->userFeedback = null; + $gui->affectedUsers = null; + $gui->highlight = initializeTabsmenu(); + $gui->editorType = $editorType; + $gui->roleCanBeEdited = ($argsObj->roleid != TL_ROLES_ADMIN); + + return $gui; +} + +/** + * + * @return stdClass + */ +function initializeOp() +{ + $op = new stdClass(); + $op->role = new tlRole(); + $op->userFeedback = ''; + + return $op; +} + +/** + * + * @param database $dbHandler + * @param stdClass $guiObj + * @param stdClass $argsObj + * @param tlRole $roleObj + * @param ckeditorInterface $webEditorObj + * @return stdClass + */ +function completeGui(&$dbHandler, &$guiObj, &$argsObj, &$roleObj, &$webEditorObj) +{ + $actionCfg['operation'] = array( + 'create' => 'doCreate', + 'edit' => 'doUpdate', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'duplicate' => 'duplicate' + ); + + $actionCfg['highlight'] = array( + 'create' => 'create_role', + 'edit' => 'edit_role', + 'doCreate' => 'create_role', + 'doUpdate' => 'edit_role', + 'duplicate' => 'create_role' + ); + + $guiObj->highlight = new stdClass(); + $kp = $actionCfg['highlight'][$argsObj->doAction]; + $guiObj->highlight->$kp = 1; + $guiObj->operation = $actionCfg['operation'][$argsObj->doAction]; + + $guiObj->role = $roleObj; + $guiObj->grants = getGrantsForUserMgmt($dbHandler, $_SESSION['currentUser']); + $guiObj->grants->mgt_view_events = $argsObj->user->hasRight($db, + "mgt_view_events"); + $guiObj->rightsCfg = getRightsCfg(); + + $guiObj->disabledAttr = $guiObj->roleCanBeEdited ? ' ' : ' disabled="disabled" '; + + // Create status for all checkboxes and set to unchecked + foreach ($guiObj->rightsCfg as $grantDetails) { + foreach ($grantDetails as $grantCode => $grantDescription) { + $guiObj->checkboxStatus[$grantCode] = "" . $guiObj->disabledAttr; + } + } + + if ($roleObj->dbID) { + $webEditorObj->Value = $roleObj->description; + + // build checked attribute for checkboxes + if (count($roleObj->rights)) { + foreach ($roleObj->rights as $right) { + $guiObj->checkboxStatus[$right->name] = ' checked="checked" ' . + $guiObj->disabledAttr; + } + } + // get all users which are affected by changing the role definition + $guiObj->affectedUsers = $roleObj->getAllUsersWithRole($dbHandler); + } + + $guiObj->notes = $webEditorObj->CreateHTML(); + return $guiObj; +} + +/** + * + * @param boolean $s + * @return string + */ +function generateUniqueName($s) +{ + // sorry for the magic, but anyway user has to edit role to provide desired name + // IMHO this quick & dirty solution is OK + return substr($s . ' - Copy - ' . substr(sha1(rand()), 0, 50), 0, 100); +} + +/** + * + * @return array + */ +function initLabels() +{ + $tg = array( + 'action_create_role' => null, + 'action_edit_role' => null + ); + + return init_labels($tg); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "role_management"); } diff --git a/lib/usermanagement/rolesView.php b/lib/usermanagement/rolesView.php index 926e0c8e60..7a56128166 100644 --- a/lib/usermanagement/rolesView.php +++ b/lib/usermanagement/rolesView.php @@ -1,119 +1,131 @@ -doAction) -{ - case 'delete': - $role = tlRole::getByID($db,$args->roleid,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - if ($role) - { - $gui->affectedUsers = $role->getAllUsersWithRole($db); - $doDelete = (sizeof($gui->affectedUsers) == 0); - } - break; - - default: - break; +doAction) { + case 'delete': + $role = tlRole::getByID($db, $args->roleid, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + if ($role) { + $gui->affectedUsers = $role->getAllUsersWithRole($db); + $doDelete = empty($gui->affectedUsers); + } + break; + + default: + break; +} + +$userFeedback = null; +if ($doDelete) { + // CSRF check + if (! is_null($args->csrfid) && ! is_null($args->csrftoken) && + csrfguard_validate_token($args->csrfid, $args->csrftoken)) { + // only NON SYSTEM ROLES CAN be deleted + if ($args->roleid > TL_LAST_SYSTEM_ROLE) { + $userFeedback = deleteRole($db, $args->roleid); + checkSessionValid($db); // refresh the current user + } + } else { + $msg = lang_get('CSRF_attack'); + tLog($msg, 'ERROR'); + die($msg); + } +} + +$gui->roles = tlRole::getAll($db, null, null, null, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('sqlResult', $userFeedback); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return object returns the arguments for the page + */ +function initArgs() +{ + $iParams = array( + "roleid" => array( + tlInputParameter::INT_N + ), + "csrfid" => array( + tlInputParameter::STRING_N, + 0, + 30 + ), + "csrftoken" => array( + tlInputParameter::STRING_N, + 0, + 128 + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 15 + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + $args->currentUser = $_SESSION['currentUser']; + + return $args; +} + +/** + * + * @param database $db + * @param stdClass $args + * @return stdClass + */ +function initializeGui(&$db, &$args) +{ + $gui = new stdClass(); + $gui->highlight = initializeTabsmenu(); + $gui->highlight->view_roles = 1; + $gui->grants = getGrantsForUserMgmt($db, $args->currentUser); + $gui->affectedUsers = null; + $gui->roleid = $args->roleid; + $gui->main_title = lang_get('role_management'); + $gui->role_id_replacement = config_get('role_replace_for_deleted_roles'); + $cfg = getWebEditorCfg('role'); + $gui->editorType = $cfg['type']; + + return $gui; +} + +/** + * + * @param database $db + * resource the database connection handle + * @param tlUser $user + * the current active user + * @return string returns true if the page can be accessed + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "role_management"); } - -$userFeedback = null; -if($doDelete) -{ - // CSRF check - if( !is_null($args->csrfid) && !is_null($args->csrftoken) && - csrfguard_validate_token($args->csrfid,$args->csrftoken) ) - { - // only NON SYSTEM ROLES CAN be deleted - if($args->roleid > TL_LAST_SYSTEM_ROLE) - { - $userFeedback = deleteRole($db,$args->roleid); - checkSessionValid($db); //refresh the current user - } - } - else - { - $msg = lang_get('CSRF_attack'); - tLog($msg,'ERROR'); - die($msg); - } -} - -$gui->roles = tlRole::getAll($db,null,null,null,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->assign('sqlResult',$userFeedback); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * @return object returns the arguments for the page - */ -function init_args() -{ - $iParams = array("roleid" => array(tlInputParameter::INT_N), - "csrfid" => array(tlInputParameter::STRING_N,0,30), - "csrftoken" => array(tlInputParameter::STRING_N,0,128), - "doAction" => array(tlInputParameter::STRING_N,0,15)); - - $args = new stdClass(); - $pParams = R_PARAMS($iParams,$args); - $args->currentUser = $_SESSION['currentUser']; - - return $args; -} - -/** - * - */ -function initializeGui(&$db,&$args) -{ - $gui = new stdClass(); - $gui->highlight = initialize_tabsmenu(); - $gui->highlight->view_roles = 1; - $gui->grants = getGrantsForUserMgmt($db,$args->currentUser); - $gui->affectedUsers = null; - $gui->roleid = $args->roleid; - $gui->main_title = lang_get('role_management'); - $gui->role_id_replacement = config_get('role_replace_for_deleted_roles'); - $cfg = getWebEditorCfg('role'); - $gui->editorType = $cfg['type']; - - return $gui; -} - - -/** - * @param $db resource the database connection handle - * @param $user the current active user - * - * @return boolean returns true if the page can be accessed - */ -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"role_management"); -} \ No newline at end of file diff --git a/lib/usermanagement/userInfo.php b/lib/usermanagement/userInfo.php index 753431e2ec..683fcb0ee5 100644 --- a/lib/usermanagement/userInfo.php +++ b/lib/usermanagement/userInfo.php @@ -1,184 +1,234 @@ -optLocale = config_get('locales'); - -$user = new tlUser($args->userID); -$user->readFromDB($db); - -$op = new stdClass(); -$op->auditMsg = null; -$op->user_feedback = null; -$op->status = tl::OK; -$update_title_bar = 0; - - -$doUpdate = false; -switch($args->doAction) { - case 'editUser': - $doUpdate = true; - foreach($args->user as $key => $value) { - $user->$key = $value; - } - $op->status = tl::OK; - $op->auditMsg = "audit_user_saved"; - $op->user_feedback = lang_get('result_user_changed'); - $update_title_bar = 1; - break; - - case 'changePassword': - $op = changePassword($db,$args,$user); - $doUpdate = false; - logAuditEvent(TLS($op->auditMsg,$user->login),"SAVE",$user->dbID,"users"); - break; - - case 'genAPIKey': - $op = generateAPIKey($args,$user); - break; +optLocale = config_get('locales'); + +$user = new tlUser($args->userID); +$user->readFromDB($db); + +$op = new stdClass(); +$op->auditMsg = null; +$op->user_feedback = null; +$op->status = tl::OK; +$update_title_bar = 0; + +$doUpdate = false; +switch ($args->doAction) { + case 'editUser': + $doUpdate = true; + foreach ($args->user as $key => $value) { + $user->$key = $value; + } + $op->status = tl::OK; + $op->auditMsg = "audit_user_saved"; + $op->user_feedback = lang_get('result_user_changed'); + $update_title_bar = 1; + break; + + case 'changePassword': + $op = changePassword($db, $args, $user); + $doUpdate = false; + logAuditEvent(TLS($op->auditMsg, $user->login), "SAVE", $user->dbID, + "users"); + break; + + case 'genAPIKey': + $op = generateAPIKey($args, $user); + break; +} + +if ($doUpdate) { + $op->status = $user->writeToDB($db); + if ($op->status >= tl::OK) { + logAuditEvent(TLS($op->auditMsg, $user->login), "SAVE", $user->dbID, + "users"); + $_SESSION['currentUser'] = $user; + setUserSession($db, $user->login, $args->userID, $user->globalRoleID, + $user->emailAddress, $user->locale); + } +} + +$loginHistory = new stdClass(); +$loginHistory->failed = $g_tlLogger->getAuditEventsFor($args->userID, "users", + "LOGIN_FAILED", 10); +$loginHistory->ok = $g_tlLogger->getAuditEventsFor($args->userID, "users", + "LOGIN", 10); + +if ($op->status != tl::OK && empty($op->user_feedback)) { + $op->user_feedback = getUserErrorMessage($op->status); +} +$user->readFromDB($db); + +// set a string if not generated key yet +if (null == $user->userApiKey) { + $user->userApiKey = TLS('none'); +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->assign('external_password_mgmt', + tlUser::isPasswordMgtExternal($user->authentication)); +$smarty->assign('user', $user); +$smarty->assign('api_ui_show', $user); +$smarty->assign('mgt_view_events', $user->hasRight($db, "mgt_view_events")); +$smarty->assign('loginHistory', $loginHistory); +$smarty->assign('user_feedback', $op->user_feedback); +$smarty->assign('update_title_bar', $update_title_bar); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $iParams = array( + "firstName" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 30 + ), + "lastName" => array( + "REQUEST", + tlInputParameter::STRING_N, + 0, + 30 + ), + "emailAddress" => array( + "REQUEST", + tlInputParameter::STRING_N, + 0, + 100 + ), + "locale" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 10 + ), + "oldpassword" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 32 + ), + "newpassword" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 32 + ), + "doAction" => array( + "POST", + tlInputParameter::STRING_N, + 0, + 15, + null, + 'checkDoAction' + ), + "userinfo_token" => array( + tlInputParameter::STRING_N, + 0, + 255 + ) + ); + + $pParams = I_PARAMS($iParams); + + $args = new stdClass(); + $args->user = new stdClass(); + $args->user->firstName = $pParams["firstName"]; + $args->user->lastName = $pParams["lastName"]; + $args->user->emailAddress = $pParams["emailAddress"]; + $args->user->locale = $pParams["locale"]; + $args->oldpassword = $pParams["oldpassword"]; + $args->newpassword = $pParams["newpassword"]; + $args->doAction = $pParams["doAction"]; + $args->userinfo_token = $pParams["userinfo_token"]; + + $args->userID = isset($_SESSION['currentUser']) ? $_SESSION['currentUser']->dbID : 0; + + return $args; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param tlUser $userMgr + * @return stdClass object with properties: status, user_feedback: string message for on screen feedback, + * auditMsg: to be written by logAudid + */ +function changePassword(&$dbHandler, &$argsObj, &$userMgr) +{ + $op = new stdClass(); + $op->status = $userMgr->comparePassword($dbHandler, $argsObj->oldpassword); + $op->user_feedback = ''; + $op->auditMsg = ''; + if ($op->status == tl::OK) { + $userMgr->setPassword($argsObj->newpassword, $userMgr->authentication); + $userMgr->writePasswordToDB($dbHandler); + $op->user_feedback = lang_get('result_password_changed'); + $op->auditMsg = "audit_user_pwd_saved"; + } + return $op; +} + +/** + * + * @param stdClass $argsObj + * @param tlUser $user + * @return stdClass + */ +function generateAPIKey(&$argsObj, &$user) +{ + $op = new stdClass(); + $op->status = tl::OK; + $op->user_feedback = null; + if ($user) { + $APIKey = new APIKey(); + if ($APIKey->addKeyForUser($argsObj->userID) < tl::OK) { + logAuditEvent(TLS("audit_user_apikey_set", $user->login), "CREATE", + $user->login, "users"); + $op->user_feedback = lang_get('result_apikey_create_ok'); + } + } + return $op; +} + +/** + * check function for tlInputParameter doAction + * + * @param string $input + * @return boolean + */ +function checkDoAction($input) +{ + $domain = array_flip(array( + 'editUser', + 'changePassword', + 'genAPIKey' + )); + return isset($domain[$input]) ? true : false; } - -if($doUpdate) { - $op->status = $user->writeToDB($db); - if ($op->status >= tl::OK) { - logAuditEvent(TLS($op->auditMsg,$user->login),"SAVE",$user->dbID,"users"); - $_SESSION['currentUser'] = $user; - setUserSession($db,$user->login, $args->userID, $user->globalRoleID, $user->emailAddress, $user->locale); - } -} - -$loginHistory = new stdClass(); -$loginHistory->failed = $g_tlLogger->getAuditEventsFor($args->userID,"users","LOGIN_FAILED",10); -$loginHistory->ok = $g_tlLogger->getAuditEventsFor($args->userID,"users","LOGIN",10); - -if ($op->status != tl::OK && empty($op->user_feedback)) { - $op->user_feedback = getUserErrorMessage($op->status); -} -$user->readFromDB($db); - -// set a string if not generated key yet -if (null == $user->userApiKey) { - $user->userApiKey = TLS('none'); -} - - - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->assign('external_password_mgmt',tlUser::isPasswordMgtExternal($user->authentication)); -$smarty->assign('user',$user); -$smarty->assign('api_ui_show',$user); -$smarty->assign('mgt_view_events',$user->hasRight($db,"mgt_view_events")); -$smarty->assign('loginHistory', $loginHistory); -$smarty->assign('user_feedback', $op->user_feedback); -$smarty->assign('update_title_bar',$update_title_bar); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - -/** - * - */ -function init_args() -{ - $iParams = array("firstName" => array("POST",tlInputParameter::STRING_N,0,30), - "lastName" => array("REQUEST",tlInputParameter::STRING_N,0,30), - "emailAddress" => array("REQUEST",tlInputParameter::STRING_N,0,100), - "locale" => array("POST",tlInputParameter::STRING_N,0,10), - "oldpassword" => array("POST",tlInputParameter::STRING_N,0,32), - "newpassword" => array("POST",tlInputParameter::STRING_N,0,32), - "doAction" => array("POST",tlInputParameter::STRING_N,0,15,null,'checkDoAction'), - "userinfo_token" => array(tlInputParameter::STRING_N, 0, 255)); - - $pParams = I_PARAMS($iParams); - - $args = new stdClass(); - $args->user = new stdClass(); - $args->user->firstName = $pParams["firstName"]; - $args->user->lastName = $pParams["lastName"]; - $args->user->emailAddress = $pParams["emailAddress"]; - $args->user->locale = $pParams["locale"]; - $args->oldpassword = $pParams["oldpassword"]; - $args->newpassword = $pParams["newpassword"]; - $args->doAction = $pParams["doAction"]; - $args->userinfo_token = $pParams["userinfo_token"]; - - $args->userID = isset($_SESSION['currentUser']) ? $_SESSION['currentUser']->dbID : 0; - - return $args; -} - -/* - function: changePassword - - args: - - returns: object with properties: - status - user_feedback: string message for on screen feedback - auditMsg: to be written by logAudid - -*/ -function changePassword(&$dbHandler,&$argsObj,&$userMgr) -{ - $op = new stdClass(); - $op->status = $userMgr->comparePassword($dbHandler,$argsObj->oldpassword); - $op->user_feedback = ''; - $op->auditMsg = ''; - if ($op->status == tl::OK) { - $userMgr->setPassword($argsObj->newpassword,$userMgr->authentication); - $userMgr->writePasswordToDB($dbHandler); - $op->user_feedback = lang_get('result_password_changed'); - $op->auditMsg = "audit_user_pwd_saved"; - } - return $op; -} - -/** - * - * - */ -function generateAPIKey(&$argsObj,&$user) -{ - $op = new stdClass(); - $op->status = tl::OK; - $op->user_feedback = null; - if ($user) - { - $APIKey = new APIKey(); - if ($APIKey->addKeyForUser($argsObj->userID) < tl::OK) - { - logAuditEvent(TLS("audit_user_apikey_set",$user->login),"CREATE",$user->login,"users"); - $op->user_feedback = lang_get('result_apikey_create_ok'); - } - } - return $op; -} - -/** - * check function for tlInputParameter doAction - * - */ -function checkDoAction($input) -{ - $domain = array_flip(array('editUser','changePassword','genAPIKey')); - $status_ok = isset($domain[$input]) ? true : false; - return $status_ok; -} \ No newline at end of file diff --git a/lib/usermanagement/usersAssign.php b/lib/usermanagement/usersAssign.php index d1c73eed25..cd4cb481da 100644 --- a/lib/usermanagement/usersAssign.php +++ b/lib/usermanagement/usersAssign.php @@ -1,600 +1,647 @@ -getImages(); - -$templateCfg = templateConfiguration(); - -$assignRolesFor = null; -$featureMgr = null; -$userFeatureRoles = null; -$doInitGui = true; - -$tprojectMgr = new testproject($db); -$tplanMgr = new testplan($db); - -$args = init_args($tprojectMgr); -$gui = initializeGui($db,$args); - -$lbl = initLabels(); - -$target = new stdClass(); -$target->testprojectID = null; -$target->testplanID = null; - - -switch($args->featureType) { - case "testproject": - $gui->highlight->assign_users_tproject = 1; - $gui->roles_updated = $lbl["test_project_user_roles_updated"]; - $gui->not_for_you = $lbl["testproject_roles_assign_disabled"]; - $gui->main_title = $lbl["assign_tproject_roles"]; - - $assignRolesFor = $args->featureType; - $target->testprojectID = $args->featureID > 0 ? $args->featureID : null; - $featureMgr = &$tprojectMgr; - break; - - case "testplan": - $gui->highlight->assign_users_tplan = 1; - $gui->roles_updated = lang_get("test_plan_user_roles_updated"); - $gui->not_for_you = lang_get("testplan_roles_assign_disabled"); - $gui->main_title = $lbl["assign_tplan_roles"]; - - $assignRolesFor = $args->featureType; - $target->testprojectID = $args->testprojectID; - $featureMgr = &$tplanMgr; - - $accessKey = 'private'; - if( $tprojectMgr->getPublicAttr($args->testprojectID) ) - { - $accessKey = 'public'; - } - $gui->tprojectAccessTypeImg = ''; - break; -} - -if ($args->featureID && $args->doUpdate && $featureMgr) { - if(checkRightsForUpdate($db,$args->user,$args->testprojectID,$args->featureType,$args->featureID)) { - doUpdate($db,$args,$featureMgr); - if( $gui->user_feedback == '' ) { - $gui->user_feedback = $gui->roles_updated; - } - } -} -// ------------------------------------------------------------------ -// Important: -// Must be done here after having done update, to get current information -$gui->users = tlUser::getAll($db,"WHERE active=1",null,null,tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); -checkSessionValid($db); -$args->user = $_SESSION['currentUser']; -// ------------------------------------------------------------------ - -switch($assignRolesFor) { - case 'testproject': - $info = getTestProjectEffectiveRoles($db,$tprojectMgr,$args,$gui->users); - list($gui->userFeatureRoles,$gui->features,$gui->featureID) = $info; - $target->testprojectID = $gui->featureID; - break; - - case 'testplan': - $info = getTestPlanEffectiveRoles($db,$tplanMgr,$tprojectMgr,$args,$gui->users); - if( is_null($info) ) { - $gui->user_feedback = lang_get('no_test_plans_available'); - } - list($gui->userFeatureRoles,$gui->features,$gui->featureID)=$info; - break; - -} - - -$gui->grants = getGrantsForUserMgmt($db,$args->user,$target->testprojectID,-1); -$gui->accessTypeImg = ''; - - -if(is_null($gui->features) || count($gui->features) == 0) { - $gui->features = null; - if( $gui->user_feedback == '' ) { - $gui->user_feedback = $gui->not_for_you; - } -} else { - $accessKey = 'vorsicht'; - if( isset($gui->features[$gui->featureID]) ) { - $accessKey = $gui->features[$gui->featureID]['is_public'] ? 'public' : 'private'; - $gui->accessTypeImg = ''; - } - $gui->accessTypeImg = ''; -} - -$gui->hintImg = ''; - -$smarty->assign('gui',$gui); -$smarty->display($templateCfg->template_dir . $templateCfg->default_template); - - -/** - * - * - */ -function init_args(&$tprojMgr) { - $iParams = array( - "featureType" => array(tlInputParameter::STRING_N,0,100), - "featureID" => array(tlInputParameter::INT_N), - "userRole" => array(tlInputParameter::ARRAY_INT), - "do_update" => array(tlInputParameter::STRING_N,0,100) - ); - - $pParams = R_PARAMS($iParams); - - $args = new stdClass(); - $args->featureType = $pParams["featureType"]; - $args->featureID = $pParams["featureID"]; - $args->map_userid_roleid = $pParams["userRole"]; - $args->doUpdate = ($pParams["do_update"] != "") ? 1 : 0; - - $args->testprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; - - $args->testplanID = 0; - - switch( $args->featureType ) { - case 'testproject': - break; - - case 'testplan': - if( $args->testprojectID <= 0 ) { - throw new Exception("INVALID Test Project ID", 1); - } - break; - } - - if( ($fid = intval($args->featureID)) > 0 ) { - $prop = $args->featureType .'ID'; - $args->$prop = $fid; - } - - - $prjInfo = $tprojMgr->get_by_id($args->testprojectID,array('output' => 'name')); - - $args->testprojectName = $prjInfo['name']; - - $args->user = $_SESSION['currentUser']; - $args->userID = $args->user->dbID; - - return $args; -} - - -/** - * checks runned when tyring to run this page, - * to be sure user has rights to use it. - * - */ -function checkRights(&$db,&$user) { - $result = false; - - $tprojMgr = new testproject($db); - $args = init_args($tprojMgr); - $answers = new stdClass(); - $answers->role_management = $user->hasRight($db,"role_management"); - - // Two checks needed: - // First on current test project without using test plan rights - // if this fails then check again adding current test plan - $answers->testplan_user_role_assignment = $user->hasRight($db,"testplan_user_role_assignment",$args->testprojectID,-1); - if($answers->testplan_user_role_assignment != "yes") { - $targetTestPlanID = null; - if($args->featureType == 'testplan') { - $targetTestPlanID = $args->featureID; - } - $answers->testplan_user_role_assignment = $user->hasRight($db,"testplan_user_role_assignment",null,$targetTestPlanID); - } - - $answers->user_role_assignment = $user->hasRight($db,"user_role_assignment",null,-1); - - foreach($answers as $key => $value) { - $answers->$key = $value == "yes" ? true : false; - $result = $result | $answers->$key; - } - - if(!$result && ($args->featureType == 'testproject')) { - $feature2check = $args->featureID; - if($args->featureID == 0 || is_null($args->featureID)) { - $feature2check = $args->testprojectID; - } - if($user->hasRight($db,"testproject_user_role_assignment",$feature2check,-1) == "yes") - { - $result = true; - } - } - - return $result; -} - -/** - * checkRightsForUpdate - * - */ -function checkRightsForUpdate(&$dbHandler,&$user,$testprojectID,$featureType,$featureID) -{ - $yes_no = "no"; - switch($featureType) - { - case 'testproject': - if($user->hasRight($dbHandler,"user_role_assignment",$featureID) == "yes" || - $user->hasRight($dbHandler,"testproject_user_role_assignment",$featureID,-1,true) == "yes") - { - $yes_no = "yes"; - } - break; - - case 'testplan': - $yes_no = $user->hasRight($dbHandler,"testplan_user_role_assignment", - $testprojectID,$featureID); - break; - } - - return ($yes_no == 'yes'); -} - - -/** - * getTestProjectEffectiveRoles - * - */ -function getTestProjectEffectiveRoles($dbHandler,&$objMgr,&$argsObj,$users) { - $features = null; - $gui_cfg = config_get('gui'); - - // Accessible means user has a role on test project ? - $opt = array('output' => 'map_of_map_full', 'order_by' => $gui_cfg->tprojects_combo_order_by); - $testprojects = $objMgr->get_accessible_for_user($argsObj->userID,$opt); - - - // We need to populate the combo box with test project where current logged user ($argsObj->userID) - // has right enough to assign user role. - // - $features = array(); - $idSet = $key2loop = array_keys($testprojects); - $rolesCache = null; - foreach($idSet as $tk) { - // $rolesCache[$testprojects[$tk]['effective_role']][] = $tk; - if(!isset($rolesCache[$testprojects[$tk]['effective_role']])) { - $rolesCache[$testprojects[$tk]['effective_role']] = new tlRole($testprojects[$tk]['effective_role']); - $rolesCache[$testprojects[$tk]['effective_role']]->readFromDB($dbHandler); - } - } - - foreach($key2loop as $idx) { - $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight("user_role_assignment"); - if($answer == false) { - $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight("testproject_user_role_assignment"); - } - - if($answer == true) { - $features[$idx] = $testprojects[$idx]; - } - } - - // If have no a test project ID, try to figure out which test project to show - // Try with session info, if failed go to first test project available. - if (!$argsObj->featureID) { - if ($argsObj->testprojectID) { - $argsObj->featureID = $argsObj->testprojectID; - } else if (sizeof($features)) { - $xx = current($features); - $argsObj->featureID = $xx['id']; - } - } - - // get private/public status for feature2check - $featureIsPublic = 1; - $key2loop = array_keys($testprojects); - foreach($key2loop as $ppx) { - if( $testprojects[$ppx]['id'] == $argsObj->featureID ) { - $featureIsPublic = $testprojects[$ppx]['is_public']; - break; - } - } - - foreach($users as &$user) { - $user->readTestProjectRoles($dbHandler,$argsObj->featureID); - } - $effectiveRoles = get_tproject_effective_role($dbHandler, - array('id' => $argsObj->featureID, - 'is_public' => $featureIsPublic),null,$users); - - return array($effectiveRoles,$features,$argsObj->featureID); -} - - - -/** - * getTestPlanEffectiveRoles - * - */ -function getTestPlanEffectiveRoles(&$dbHandler,&$tplanMgr,$tprojectMgr,&$argsObj,&$users) { - $features = array(); - $activeTestplans = $tprojectMgr->get_all_testplans($argsObj->testprojectID, array('plan_status' => 1)); - - - $ret = null; - $status_ok = !is_null($activeTestplans); - if($status_ok) { - $myAccessibleSet = $argsObj->user->getAccessibleTestPlans($dbHandler, - $argsObj->testprojectID,null,array('output' =>'map')); - - // we want to change map key, from testplan id to a sequential index - // to maintain old logic - $activeKeys = array_keys($activeTestplans); - $myKeys = array_keys((array)$myAccessibleSet); - $key2remove = $key2remove_diff = array_diff($activeKeys,$myKeys); - if( !is_null($key2remove) ) { - foreach($key2remove as $target) { - unset($activeTestplans[$target]); - } - } - - - - if($argsObj->user->hasRight($dbHandler,"mgt_users")) { - $features = $activeTestplans; - } else { - $features = array(); - $key2loop = array_keys($activeTestplans); - foreach($key2loop as $idx) { - if($argsObj->user->hasRight($dbHandler,"testplan_user_role_assignment",null,$activeTestplans[$idx]['id']) == "yes") { - $features[$idx] = $activeTestplans[$idx]; - } - } - } - - // if nothing special was selected, - // use the one in the session or the first - if (!$argsObj->featureID) { - if (sizeof($features)) { - if ($argsObj->testplanID) { - $key2loop = array_keys($features); - foreach($key2loop as $idx) { - if ($argsObj->testplanID == $features[$idx]['id']) { - $argsObj->featureID = $argsObj->testplanID; - } - } - } - if (!$argsObj->featureID) { - $xx = current($features); - $argsObj->featureID = $xx['id']; - } - } - } - - foreach($users as &$user) { - $user->readTestProjectRoles($dbHandler,$argsObj->testprojectID); - $user->readTestPlanRoles($dbHandler,$argsObj->featureID); - } - - $tproject_info = $tprojectMgr->get_by_id($argsObj->testprojectID); - $effectiveRoles = get_tplan_effective_role($dbHandler,$argsObj->featureID,$tproject_info,null,$users); - $ret = array($effectiveRoles,$features,$argsObj->featureID); - } - return $ret; -} - - - -/** - * getTestPlanEffectiveRoles - * - */ -function getTestPlanEffectiveRolesNEW(&$dbHandler,&$tplanMgr,$tprojectMgr,&$argsObj,&$users) -{ - $features = array(); - $activeTestplans = $tprojectMgr->get_all_testplans($argsObj->testprojectID, array('plan_status' => 1)); - - - $ret = null; - $status_ok = !is_null($activeTestplans); - if($status_ok) - { - $myAccessibleSet = $argsObj->user->getAccessibleTestPlans($dbHandler,$argsObj->testprojectID,null, - array('output' =>'map')); - - - //echo __LINE__; - //echo __FUNCTION__; - //new dBug($myAccessibleSet); - - // we want to change map key, from testplan id to a sequential index to maintain old logic - $activeKeys = array_keys($activeTestplans); - $myKeys = array_keys((array)$myAccessibleSet); - $key2remove = $key2remove_diff = array_diff($activeKeys,$myKeys); - if( !is_null($key2remove) ) - { - foreach($key2remove as $target) - { - unset($activeTestplans[$target]); - } - } - - // $activeTestplans = array_values($activeTestplans); - //new dBug($activeTestplans); - - // 2013-04-01 - // now is not clear why this logic is right - // - // analisys has to go from detail (test plan) to general - // Step 1 - check if user has specific role on test plan - // Step 2 - If Step 1 fails - // check if user has specific role on test project - // that contains the test project - // Step 3 - If Step 2 fails - // check Global Role. - // - - if($argsObj->user->hasRight($dbHandler,"mgt_users")) - { - $features = $activeTestplans; - } - else - { - //$loop2do = sizeof($activeTestplans); - //for($idx = 0; $idx < $loop2do; $idx++) - $features = array(); - $key2loop = array_keys($activeTestplans); - foreach($key2loop as $idx) - { - // Humm!!, think we need to check testplan_user_role_assignment and not "testplan_planning" - if($argsObj->user->hasRight($dbHandler,"testplan_user_role_assignment",null, - $activeTestplans[$idx]['id']) == "yes") - { - $features[$idx] = $activeTestplans[$idx]; - } - } - } - - //if nothing special was selected, use the one in the session or the first - if (!$argsObj->featureID) - { - if (sizeof($features)) - { - if ($argsObj->testplanID) - { - // $loop2do = sizeof($features); - // for($idx = 0; $idx < $loop2do; $idx++) - $key2loop = array_keys($features); - foreach($key2loop as $idx) - { - if ($argsObj->testplanID == $features[$idx]['id']) - { - $argsObj->featureID = $argsObj->testplanID; - } - } - } - if (!$argsObj->featureID) - { - $xx = current($features); - $argsObj->featureID = $xx['id']; - } - } - } - - foreach($users as &$user) - { - $user->readTestProjectRoles($dbHandler,$argsObj->testprojectID); - $user->readTestPlanRoles($dbHandler,$argsObj->featureID); - } - - $tproject_info = $tprojectMgr->get_by_id($argsObj->testprojectID); - - $effectiveRoles = get_tplan_effective_role($dbHandler,$argsObj->featureID,$tproject_info,null,$users); - - // it seems that here is the best place to check if current logged user - // can manege roles on current selected test plan. - // why I did not find this before ??? - $features = array(); - $key2loop = array_keys($activeTestplans); - foreach($key2loop as $idx) - { - $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight("user_role_assignment"); - //echo 'Question is: user_role_assignment - ANSWER IS:' . $answer . '
    '; - - if($answer == false) - { - $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight("testproject_user_role_assignment"); - // echo 'Question is: testproject_user_role_assignment - ANSWER IS:' . $answer . '
    '; - } - - if($answer == true) - { - $features[$idx] = $testprojects[$idx]; - } - - - // Humm!!, think we need to check testplan_user_role_assignment and not "testplan_planning" - if($argsObj->user->hasRight($dbHandler,"testplan_user_role_assignment",null, - $activeTestplans[$idx]['id']) == "yes") - { - $features[$idx] = $activeTestplans[$idx]; - } - } - - - - $ret = array($effectiveRoles,$features,$argsObj->featureID); - } - return $ret; -} - - -function doUpdate(&$dbHandler,&$argsObj,&$featureMgr) -{ - $featureMgr->deleteUserRoles($argsObj->featureID, - array_keys($argsObj->map_userid_roleid)); - foreach($argsObj->map_userid_roleid as $user_id => $role_id) - { - if ($role_id) - { - $featureMgr->addUserRole($user_id,$argsObj->featureID,$role_id); - } - } -} - -function initializeGui(&$dbHandler,$argsObj) -{ - $gui = new stdClass(); - - $gui->highlight = initialize_tabsmenu(); - $gui->user_feedback = ''; - $gui->no_features = ''; - $gui->roles_updated = ''; - $gui->tproject_name = $argsObj->testprojectName; - $gui->featureType = $argsObj->featureType; - $gui->optRights = tlRole::getAll($dbHandler,null,null,null,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - $gui->features = null; - $gui->featureID = null; - $gui->role_colour = null; - $gui->tprojectAccessTypeImg = ''; - - $guiCfg = config_get('gui'); - if($guiCfg->usersAssignGlobalRoleColoring == ENABLED) - { - $gui->role_colour = tlRole::getRoleColourCfg($dbHandler); - } - return $gui; -} - -/** - * - */ -function initLabels() -{ - $tg = array('test_project_user_roles_updated' => null, - 'testproject_roles_assign_disabled' => null, - 'assign_tproject_roles' => null, - 'assign_tplan_roles' => null); - $labels = init_labels($tg); - return $labels; +getImages(); + +$templateCfg = templateConfiguration(); + +$assignRolesFor = null; +$featureMgr = null; +$userFeatureRoles = null; +$doInitGui = true; + +$tprojectMgr = new testproject($db); +$tplanMgr = new testplan($db); + +$args = initArgs($tprojectMgr); +$gui = initializeGui($db, $args); + +$lbl = initLabels(); + +$target = new stdClass(); +$target->testprojectID = null; +$target->testplanID = null; + +switch ($args->featureType) { + case "testproject": + $gui->highlight->assign_users_tproject = 1; + $gui->roles_updated = $lbl["test_project_user_roles_updated"]; + $gui->not_for_you = $lbl["testproject_roles_assign_disabled"]; + $gui->main_title = $lbl["assign_tproject_roles"]; + + $assignRolesFor = $args->featureType; + $target->testprojectID = $args->featureID > 0 ? $args->featureID : null; + $featureMgr = &$tprojectMgr; + break; + + case "testplan": + $gui->highlight->assign_users_tplan = 1; + $gui->roles_updated = lang_get("test_plan_user_roles_updated"); + $gui->not_for_you = lang_get("testplan_roles_assign_disabled"); + $gui->main_title = $lbl["assign_tplan_roles"]; + + $assignRolesFor = $args->featureType; + $target->testprojectID = $args->testprojectID; + $featureMgr = &$tplanMgr; + + $accessKey = 'private'; + if ($tprojectMgr->getPublicAttr($args->testprojectID)) { + $accessKey = 'public'; + } + $gui->tprojectAccessTypeImg = ''; + break; +} + +if ($args->featureID && $args->doUpdate && $featureMgr && + checkRightsForUpdate($db, $args->user, $args->testprojectID, + $args->featureType, $args->featureID)) { + doUpdate($db, $args, $featureMgr); + if ($gui->user_feedback == '') { + $gui->user_feedback = $gui->roles_updated; + } +} + +// Important: +// Must be done here after having done update, to get current information +$gui->users = tlUser::getAll($db, "WHERE active=1", null, null, + tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); +checkSessionValid($db); +$args->user = $_SESSION['currentUser']; + +switch ($assignRolesFor) { + case 'testproject': + $info = getTestProjectEffectiveRoles($db, $tprojectMgr, $args, + $gui->users); + list ($gui->userFeatureRoles, $gui->features, $gui->featureID) = $info; + $target->testprojectID = $gui->featureID; + break; + + case 'testplan': + $info = getTestPlanEffectiveRoles($db, $tplanMgr, $tprojectMgr, $args, + $gui->users); + if (is_null($info)) { + $gui->user_feedback = lang_get('no_test_plans_available'); + } + list ($gui->userFeatureRoles, $gui->features, $gui->featureID) = $info; + break; +} + +$gui->grants = getGrantsForUserMgmt($db, $args->user, $target->testprojectID, + - 1); +$gui->accessTypeImg = ''; + +if (is_null($gui->features) || count($gui->features) == 0) { + $gui->features = null; + if ($gui->user_feedback == '') { + $gui->user_feedback = $gui->not_for_you; + } +} else { + $accessKey = 'vorsicht'; + if (isset($gui->features[$gui->featureID])) { + $accessKey = $gui->features[$gui->featureID]['is_public'] ? 'public' : 'private'; + $gui->accessTypeImg = ''; + } + $gui->accessTypeImg = ''; +} + +$gui->hintImg = ''; + +$smarty->assign('gui', $gui); +$smarty->display($templateCfg->template_dir . $templateCfg->default_template); + +/** + * + * @param testproject $tprojMgr + * @return stdClass + */ +function initArgs(&$tprojMgr) +{ + $iParams = array( + "featureType" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "featureID" => array( + tlInputParameter::INT_N + ), + "userRole" => array( + tlInputParameter::ARRAY_INT + ), + "do_update" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + + $pParams = R_PARAMS($iParams); + + $args = new stdClass(); + $args->featureType = $pParams["featureType"]; + $args->featureID = $pParams["featureID"]; + $args->map_userid_roleid = $pParams["userRole"]; + $args->doUpdate = ($pParams["do_update"] != "") ? 1 : 0; + + $args->testprojectID = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; + + $args->testplanID = 0; + + switch ($args->featureType) { + case 'testproject': + break; + + case 'testplan': + if ($args->testprojectID <= 0) { + throw new Exception("INVALID Test Project ID", 1); + } + break; + } + + if (($fid = intval($args->featureID)) > 0) { + $prop = $args->featureType . 'ID'; + $args->$prop = $fid; + } + + $prjInfo = $tprojMgr->get_by_id($args->testprojectID, + array( + 'output' => 'name' + )); + + $args->testprojectName = $prjInfo['name']; + + $args->user = $_SESSION['currentUser']; + $args->userID = $args->user->dbID; + + return $args; +} + +/** + * checks runned when tyring to run this page, + * to be sure user has rights to use it. + * + * @param database $db + * @param tlUser $user + * @return boolean + */ +function checkRights(&$db, &$user) +{ + $result = false; + + $tprojMgr = new testproject($db); + $args = initArgs($tprojMgr); + $answers = new stdClass(); + $answers->role_management = $user->hasRight($db, "role_management"); + + // Two checks needed: + // First on current test project without using test plan rights + // if this fails then check again adding current test plan + $answers->testplan_user_role_assignment = $user->hasRight($db, + "testplan_user_role_assignment", $args->testprojectID, - 1); + if ($answers->testplan_user_role_assignment != "yes") { + $targetTestPlanID = null; + if ($args->featureType == 'testplan') { + $targetTestPlanID = $args->featureID; + } + $answers->testplan_user_role_assignment = $user->hasRight($db, + "testplan_user_role_assignment", null, $targetTestPlanID); + } + + $answers->user_role_assignment = $user->hasRight($db, "user_role_assignment", + null, - 1); + + foreach ($answers as $key => $value) { + $answers->$key = $value == "yes" ? true : false; + $result |= $answers->$key; + } + + if (! $result && ($args->featureType == 'testproject')) { + $feature2check = $args->featureID; + if ($args->featureID == 0 || is_null($args->featureID)) { + $feature2check = $args->testprojectID; + } + if ($user->hasRight($db, "testproject_user_role_assignment", + $feature2check, - 1) == "yes") { + $result = true; + } + } + + return $result; +} + +/** + * checkRightsForUpdate + * + * @param database $dbHandler + * @param tlUser $user + * @param int $testprojectID + * @param testproject $featureType + * @param int $featureID + * @return boolean + */ +function checkRightsForUpdate(&$dbHandler, &$user, $testprojectID, $featureType, + $featureID) +{ + $yes_no = "no"; + switch ($featureType) { + case 'testproject': + if ($user->hasRight($dbHandler, "user_role_assignment", $featureID) == + "yes" || + $user->hasRight($dbHandler, "testproject_user_role_assignment", + $featureID, - 1, true) == "yes") { + $yes_no = "yes"; + } + break; + + case 'testplan': + $yes_no = $user->hasRight($dbHandler, + "testplan_user_role_assignment", $testprojectID, $featureID); + break; + } + + return $yes_no == 'yes'; +} + +/** + * getTestProjectEffectiveRoles + * + * @param database $dbHandler + * @param testproject $objMgr + * @param stdClass $argsObj + * @param array $users + * @return array + */ +function getTestProjectEffectiveRoles($dbHandler, &$objMgr, &$argsObj, $users) +{ + $features = null; + $gui_cfg = config_get('gui'); + + // Accessible means user has a role on test project ? + $opt = array( + 'output' => 'map_of_map_full', + 'order_by' => $gui_cfg->tprojects_combo_order_by + ); + $testprojects = $objMgr->get_accessible_for_user($argsObj->userID, $opt); + + // We need to populate the combo box with test project where current logged user ($argsObj->userID) + // has right enough to assign user role. + // + $features = array(); + $idSet = $key2loop = array_keys($testprojects); + $rolesCache = null; + foreach ($idSet as $tk) { + if (! isset($rolesCache[$testprojects[$tk]['effective_role']])) { + $rolesCache[$testprojects[$tk]['effective_role']] = new tlRole( + $testprojects[$tk]['effective_role']); + $rolesCache[$testprojects[$tk]['effective_role']]->readFromDB( + $dbHandler); + } + } + + foreach ($key2loop as $idx) { + $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight( + "user_role_assignment"); + if (! $answer) { + $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight( + "testproject_user_role_assignment"); + } + + if ($answer) { + $features[$idx] = $testprojects[$idx]; + } + } + + // If have no a test project ID, try to figure out which test project to show + // Try with session info, if failed go to first test project available. + if (! $argsObj->featureID) { + if ($argsObj->testprojectID) { + $argsObj->featureID = $argsObj->testprojectID; + } elseif (count($features)) { + $xx = current($features); + $argsObj->featureID = $xx['id']; + } + } + + // get private/public status for feature2check + $featureIsPublic = 1; + $key2loop = array_keys($testprojects); + foreach ($key2loop as $ppx) { + if ($testprojects[$ppx]['id'] == $argsObj->featureID) { + $featureIsPublic = $testprojects[$ppx]['is_public']; + break; + } + } + + foreach ($users as &$user) { + $user->readTestProjectRoles($dbHandler, $argsObj->featureID); + } + $effectiveRoles = get_tproject_effective_role($dbHandler, + array( + 'id' => $argsObj->featureID, + 'is_public' => $featureIsPublic + ), null, $users); + + return array( + $effectiveRoles, + $features, + $argsObj->featureID + ); +} + +/** + * getTestPlanEffectiveRoles + * + * @param database $dbHandler + * @param testplan $tplanMgr + * @param testproject $tprojectMgr + * @param stdClass $argsObj + * @param array $users + * @return array + */ +function getTestPlanEffectiveRoles(&$dbHandler, &$tplanMgr, $tprojectMgr, + &$argsObj, &$users) +{ + $features = array(); + $activeTestplans = $tprojectMgr->get_all_testplans($argsObj->testprojectID, + array( + 'plan_status' => 1 + )); + + $ret = null; + $status_ok = ! is_null($activeTestplans); + if ($status_ok) { + $myAccessibleSet = $argsObj->user->getAccessibleTestPlans($dbHandler, + $argsObj->testprojectID, null, array( + 'output' => 'map' + )); + + // we want to change map key, from testplan id to a sequential index + // to maintain old logic + $activeKeys = array_keys($activeTestplans); + $myKeys = array_keys((array) $myAccessibleSet); + $key2remove = array_diff($activeKeys, $myKeys); + if (! is_null($key2remove)) { + foreach ($key2remove as $target) { + unset($activeTestplans[$target]); + } + } + + if ($argsObj->user->hasRight($dbHandler, "mgt_users")) { + $features = $activeTestplans; + } else { + $features = array(); + $key2loop = array_keys($activeTestplans); + foreach ($key2loop as $idx) { + if ($argsObj->user->hasRight($dbHandler, + "testplan_user_role_assignment", null, + $activeTestplans[$idx]['id']) == "yes") { + $features[$idx] = $activeTestplans[$idx]; + } + } + } + + // if nothing special was selected, + // use the one in the session or the first + if (! $argsObj->featureID && count($features)) { + if ($argsObj->testplanID) { + $key2loop = array_keys($features); + foreach ($key2loop as $idx) { + if ($argsObj->testplanID == $features[$idx]['id']) { + $argsObj->featureID = $argsObj->testplanID; + } + } + } + if (! $argsObj->featureID) { + $xx = current($features); + $argsObj->featureID = $xx['id']; + } + } + + foreach ($users as &$user) { + $user->readTestProjectRoles($dbHandler, $argsObj->testprojectID); + $user->readTestPlanRoles($dbHandler, $argsObj->featureID); + } + + $tproject_info = $tprojectMgr->get_by_id($argsObj->testprojectID); + $effectiveRoles = get_tplan_effective_role($dbHandler, + $argsObj->featureID, $tproject_info, null, $users); + $ret = array( + $effectiveRoles, + $features, + $argsObj->featureID + ); + } + return $ret; +} + +/** + * getTestPlanEffectiveRoles + * + * @param database $dbHandler + * @param testplan $tplanMgr + * @param testproject $tprojectMgr + * @param stdClass $argsObj + * @param array $users + * @return array + */ +function getTestPlanEffectiveRolesNEW(&$dbHandler, &$tplanMgr, $tprojectMgr, + &$argsObj, &$users) +{ + $features = array(); + $activeTestplans = $tprojectMgr->get_all_testplans($argsObj->testprojectID, + array( + 'plan_status' => 1 + )); + + $ret = null; + $status_ok = ! is_null($activeTestplans); + if ($status_ok) { + $myAccessibleSet = $argsObj->user->getAccessibleTestPlans($dbHandler, + $argsObj->testprojectID, null, array( + 'output' => 'map' + )); + + // we want to change map key, from testplan id to a sequential index to maintain old logic + $activeKeys = array_keys($activeTestplans); + $myKeys = array_keys((array) $myAccessibleSet); + $key2remove = array_diff($activeKeys, $myKeys); + if (! is_null($key2remove)) { + foreach ($key2remove as $target) { + unset($activeTestplans[$target]); + } + } + // 2013-04-01 + // now is not clear why this logic is right + // + // analisys has to go from detail (test plan) to general + // Step 1 - check if user has specific role on test plan + // Step 2 - If Step 1 fails + // check if user has specific role on test project + // that contains the test project + // Step 3 - If Step 2 fails + // check Global Role. + // + + if ($argsObj->user->hasRight($dbHandler, "mgt_users")) { + $features = $activeTestplans; + } else { + // $loop2do = count($activeTestplans); + // for($idx = 0; $idx < $loop2do; $idx++) + $features = array(); + $key2loop = array_keys($activeTestplans); + foreach ($key2loop as $idx) { + // Humm!!, think we need to check testplan_user_role_assignment and not "testplan_planning" + if ($argsObj->user->hasRight($dbHandler, + "testplan_user_role_assignment", null, + $activeTestplans[$idx]['id']) == "yes") { + $features[$idx] = $activeTestplans[$idx]; + } + } + } + + // if nothing special was selected, use the one in the session or the first + if (! $argsObj->featureID && count($features)) { + if ($argsObj->testplanID) { + $key2loop = array_keys($features); + foreach ($key2loop as $idx) { + if ($argsObj->testplanID == $features[$idx]['id']) { + $argsObj->featureID = $argsObj->testplanID; + } + } + } + if (! $argsObj->featureID) { + $xx = current($features); + $argsObj->featureID = $xx['id']; + } + } + + foreach ($users as &$user) { + $user->readTestProjectRoles($dbHandler, $argsObj->testprojectID); + $user->readTestPlanRoles($dbHandler, $argsObj->featureID); + } + + $tproject_info = $tprojectMgr->get_by_id($argsObj->testprojectID); + + $effectiveRoles = get_tplan_effective_role($dbHandler, + $argsObj->featureID, $tproject_info, null, $users); + + // it seems that here is the best place to check if current logged user + // can manege roles on current selected test plan. + // why I did not find this before ??? + $features = array(); + $key2loop = array_keys($activeTestplans); + foreach ($key2loop as $idx) { + $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight( + "user_role_assignment"); + + if (! $answer) { + $answer = $rolesCache[$testprojects[$idx]['effective_role']]->hasRight( + "testproject_user_role_assignment"); + } + + if ($answer) { + $features[$idx] = $testprojects[$idx]; + } + + // Humm!!, think we need to check testplan_user_role_assignment and not "testplan_planning" + if ($argsObj->user->hasRight($dbHandler, + "testplan_user_role_assignment", null, + $activeTestplans[$idx]['id']) == "yes") { + $features[$idx] = $activeTestplans[$idx]; + } + } + + $ret = array( + $effectiveRoles, + $features, + $argsObj->featureID + ); + } + return $ret; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param testproject $featureMgr + */ +function doUpdate(&$dbHandler, &$argsObj, &$featureMgr) +{ + $featureMgr->deleteUserRoles($argsObj->featureID, + array_keys($argsObj->map_userid_roleid)); + foreach ($argsObj->map_userid_roleid as $user_id => $role_id) { + if ($role_id) { + $featureMgr->addUserRole($user_id, $argsObj->featureID, $role_id); + } + } +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, $argsObj) +{ + $gui = new stdClass(); + + $gui->highlight = initializeTabsmenu(); + $gui->user_feedback = ''; + $gui->no_features = ''; + $gui->roles_updated = ''; + $gui->tproject_name = $argsObj->testprojectName; + $gui->featureType = $argsObj->featureType; + $gui->optRights = tlRole::getAll($dbHandler, null, null, null, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + $gui->features = null; + $gui->featureID = null; + $gui->role_colour = null; + $gui->tprojectAccessTypeImg = ''; + + $guiCfg = config_get('gui'); + if ($guiCfg->usersAssignGlobalRoleColoring == ENABLED) { + $gui->role_colour = tlRole::getRoleColourCfg($dbHandler); + } + return $gui; +} + +/** + * array + */ +function initLabels() +{ + $tg = array( + 'test_project_user_roles_updated' => null, + 'testproject_roles_assign_disabled' => null, + 'assign_tproject_roles' => null, + 'assign_tplan_roles' => null + ); + return init_labels($tg); } diff --git a/lib/usermanagement/usersEdit.php b/lib/usermanagement/usersEdit.php index a6017dfc5b..0531acae63 100644 --- a/lib/usermanagement/usersEdit.php +++ b/lib/usermanagement/usersEdit.php @@ -1,485 +1,556 @@ - 'doCreate', 'edit' => 'doUpdate', - 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', - 'resetPassword' => 'doUpdate', - 'genAPIKey' => 'doUpdate'); - -switch($args->doAction) -{ - case "edit": - $highlight->edit_user = 1; - break; - - case "doCreate": - $highlight->create_user = 1; - $gui->op = doCreate($db,$args); - $gui->user = $gui->op->user; - $templateCfg->template = $gui->op->template; - $gui->main_title = $lbl['action_create_user']; - break; - - case "doUpdate": - $highlight->edit_user = 1; - $sessionUserID = $_SESSION['currentUser']->dbID; - $gui->op = doUpdate($db,$args,$sessionUserID); - $gui->user = $gui->op->user; - $gui->main_title = $lbl['action_edit_user']; - break; - - case "resetPassword": - $highlight->edit_user = 1; - $passwordSendMethod = config_get('password_reset_send_method'); - $gui->op = createNewPassword($db,$args,$gui->user,$passwordSendMethod); - $gui->main_title = $lbl['action_edit_user']; - break; - - case "genAPIKey": - $highlight->edit_user = 1; - $gui->op = createNewAPIKey($db,$args,$gui->user); - $gui->main_title = $lbl['action_edit_user']; - break; - - case "create": - default: - $highlight->create_user = 1; - $gui->user = new tlUser(); - $gui->main_title = $lbl['action_create_user']; - break; + 'doCreate', + 'edit' => 'doUpdate', + 'doCreate' => 'doCreate', + 'doUpdate' => 'doUpdate', + 'resetPassword' => 'doUpdate', + 'genAPIKey' => 'doUpdate' +); + +switch ($args->doAction) { + case "edit": + $highlight->edit_user = 1; + break; + + case "doCreate": + $highlight->create_user = 1; + $gui->op = doCreate($db, $args); + $gui->user = $gui->op->user; + $templateCfg->template = $gui->op->template; + $gui->main_title = $lbl['action_create_user']; + break; + + case "doUpdate": + $highlight->edit_user = 1; + $sessionUserID = $_SESSION['currentUser']->dbID; + $gui->op = doUpdate($db, $args, $sessionUserID); + $gui->user = $gui->op->user; + $gui->main_title = $lbl['action_edit_user']; + break; + + case "resetPassword": + $highlight->edit_user = 1; + $passwordSendMethod = config_get('password_reset_send_method'); + $gui->op = createNewPassword($db, $args, $gui->user, $passwordSendMethod); + $gui->main_title = $lbl['action_edit_user']; + break; + + case "genAPIKey": + $highlight->edit_user = 1; + $gui->op = createNewAPIKey($db, $args, $gui->user); + $gui->main_title = $lbl['action_edit_user']; + break; + + case "create": + default: + $highlight->create_user = 1; + $gui->user = new tlUser(); + $gui->main_title = $lbl['action_create_user']; + break; +} + +$gui->op->operation = $actionOperation[$args->doAction]; +$roles = tlRole::getAll($db, null, null, null, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); +unset($roles[TL_ROLES_UNDEFINED]); + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); + +$smarty->assign('highlight', $highlight); +$smarty->assign('operation', $gui->op->operation); +$smarty->assign('user_feedback', $gui->op->user_feedback); +$smarty->assign('external_password_mgmt', + tlUser::isPasswordMgtExternal($gui->user->authentication)); +$smarty->assign('optRights', $roles); +renderGui($smarty, $args, $templateCfg); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $iParams = array( + "delete" => array( + tlInputParameter::INT_N + ), + "user" => array( + tlInputParameter::INT_N + ), + "user_id" => array( + tlInputParameter::INT_N + ), + "rights_id" => array( + tlInputParameter::INT_N + ), + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 30 + ), + "firstName" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "lastName" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "emailAddress" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "locale" => array( + tlInputParameter::STRING_N, + 0, + 10 + ), + "login" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "password" => array( + tlInputParameter::STRING_N, + 0, + 32 + ), + "authentication" => array( + tlInputParameter::STRING_N, + 0, + 10 + ), + "user_is_active" => array( + tlInputParameter::CB_BOOL + ) + ); + + $args = new stdClass(); + R_PARAMS($iParams, $args); + + $date_format = config_get('date_format'); + + // convert expiration date to ISO format to write to db + $dk = 'expiration_date'; + $args->$dk = null; + if (isset($_REQUEST[$dk]) && $_REQUEST[$dk] != '') { + $da = split_localized_date($_REQUEST[$dk], $date_format); + if ($da != null) { + // set date in iso format + $args->$dk = $da['year'] . "-" . $da['month'] . "-" . $da['day']; + } + } + + $args->user = $_SESSION['currentUser']; + return $args; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass object with following members + * user: tlUser object + * status: + * template: will be used by viewer logic. + * null -> viewer logic will choose template + * other value -> viever logic will use this template. + */ +function doCreate(&$dbHandler, &$argsObj) +{ + $op = new stdClass(); + $op->user = new tlUser(); + $op->status = $op->user->setPassword($argsObj->password); + $op->template = 'usersEdit.tpl'; + $op->operation = ''; + + $statusOk = false; + if ($op->status >= tl::OK) { + initializeUserProperties($op->user, $argsObj); + $op->status = $op->user->writeToDB($dbHandler); + if ($op->status >= tl::OK) { + tlUser::setExpirationDate($dbHandler, $op->user->dbID, + $argsObj->expiration_date); + + $statusOk = true; + $op->template = null; + logAuditEvent(TLS("audit_user_created", $op->user->login), "CREATE", + $op->user->dbID, "users"); + $op->user_feedback = sprintf(lang_get('user_created'), + $op->user->login); + } + } + + if (! $statusOk) { + $op->operation = 'create'; + $op->user_feedback = getUserErrorMessage($op->status); + } + + return $op; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param int $sessionUserID + * @return stdClass + */ +function doUpdate(&$dbHandler, &$argsObj, $sessionUserID) +{ + $op = new stdClass(); + $op->user_feedback = ''; + $op->user = new tlUser($argsObj->user_id); + $op->status = $op->user->readFromDB($dbHandler); + if ($op->status >= tl::OK) { + initializeUserProperties($op->user, $argsObj); + $op->status = $op->user->writeToDB($dbHandler); + if ($op->status >= tl::OK) { + tlUser::setExpirationDate($dbHandler, $op->user->dbID, + $argsObj->expiration_date); + + logAuditEvent(TLS("audit_user_saved", $op->user->login), "SAVE", + $op->user->dbID, "users"); + + if ($sessionUserID == $argsObj->user_id) { + $_SESSION['currentUser'] = $op->user; + setUserSession($dbHandler, $op->user->login, $argsObj->user_id, + $op->user->globalRoleID, $op->user->emailAddress, + $op->user->locale); + + if (! $argsObj->user_is_active) { + header("Location: ../../logout.php"); + exit(); + } + } + } + $op->user_feedback = getUserErrorMessage($op->status); + } + return $op; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param tlUser $userObj + * @param string $newPasswordSendMethod + * @return stdClass + */ +function createNewPassword(&$dbHandler, &$argsObj, &$userObj, + $newPasswordSendMethod) +{ + $op = new stdClass(); + $op->user_feedback = ''; + $op->new_password = ''; + + // Try to validate mail configuration + // + // From Zend Documentation + // You may find you also want to match IP addresses, Local hostnames, or a combination of all allowed types. + // This can be done by passing a parameter to Zend_Validate_Hostname when you instantiate it. + // The paramter should be an integer which determines what types of hostnames are allowed. + // You are encouraged to use the Zend_Validate_Hostname constants to do this. + // The Zend_Validate_Hostname constants are: ALLOW_DNS to allow only DNS hostnames, ALLOW_IP to allow IP addresses, + // ALLOW_LOCAL to allow local network names, and ALLOW_ALL to allow all three types. + // + $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); + $smtp_host = config_get('smtp_host'); + + $password_on_screen = ($newPasswordSendMethod == 'display_on_screen'); + if ($validator->isValid($smtp_host) || $password_on_screen) { + $dummy = resetPassword($dbHandler, $argsObj->user_id, + $newPasswordSendMethod); + + $op->user_feedback = $dummy['msg']; + $op->status = $dummy['status']; + $op->new_password = $dummy['password']; + if ($op->status >= tl::OK) { + logAuditEvent(TLS("audit_pwd_reset_requested", $userObj->login), + "PWD_RESET", $argsObj->user_id, "users"); + $op->user_feedback = lang_get('password_reseted'); + if ($password_on_screen) { + $op->user_feedback = lang_get('password_set') . + $dummy['password']; + } + } else { + $op->user_feedback = sprintf( + lang_get('password_cannot_be_reseted_reason'), + $op->user_feedback); + } + } else { + $op->status = tl::ERROR; + $op->user_feedback = lang_get( + 'password_cannot_be_reseted_invalid_smtp_hostname'); + } + return $op; +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @param tlUser $userObj + * @return stdClass + */ +function createNewAPIKey(&$dbHandler, &$argsObj, &$userObj) +{ + $op = new stdClass(); + $op->user_feedback = ''; + + // Try to validate mail configuration + // + // From Zend Documentation + // You may find you also want to match IP addresses, Local hostnames, or a combination of all allowed types. + // This can be done by passing a parameter to Zend_Validate_Hostname when you instantiate it. + // The paramter should be an integer which determines what types of hostnames are allowed. + // You are encouraged to use the Zend_Validate_Hostname constants to do this. + // The Zend_Validate_Hostname constants are: ALLOW_DNS to allow only DNS hostnames, ALLOW_IP to allow IP addresses, + // ALLOW_LOCAL to allow local network names, and ALLOW_ALL to allow all three types. + // + $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); + $smtp_host = config_get('smtp_host'); + $op->status = tl::ERROR; + + // We need to validate at least that user mail is NOT EMPTY + if ($validator->isValid($smtp_host)) { + $APIKey = new APIKey(); + if ($APIKey->addKeyForUser($argsObj->user_id) >= tl::OK) { + logAuditEvent(TLS("audit_user_apikey_set", $userObj->login), + "CREATE", $userObj->login, "users"); + $op->user_feedback = lang_get('apikey_by_mail'); + $op->status = tl::OK; + + // now send by mail + $ak = $APIKey->getAPIKey($argsObj->user_id); + $msgBody = lang_get('your_apikey_is') . "\n\n" . $ak . "\n\n" . + lang_get('contact_admin'); + $mail_op = @email_send(config_get('from_email'), + $userObj->emailAddress, lang_get('mail_apikey_subject'), + $msgBody); + } + } else { + $op->status = tl::ERROR; + $op->user_feedback = lang_get( + 'apikey_cannot_be_reseted_invalid_smtp_hostname'); + } + return $op; +} + +/** + * initialize members for a user object. + * + * @param tlUser $userObj + * data read from DB + * @param stdClass $argsObj + * data entry from User Interface + */ +function initializeUserProperties(&$userObj, &$argsObj) +{ + if (! is_null($argsObj->login)) { + $userObj->login = $argsObj->login; + } + $userObj->emailAddress = $argsObj->emailAddress; + + // The Black List - Jon Bokenkamp + $reddington = array( + '/', + '\\', + ':', + '*', + '?', + '<', + '>', + '|' + ); + $userObj->firstName = str_replace($reddington, '', $argsObj->firstName); + $userObj->lastName = str_replace($reddington, '', $argsObj->lastName); + + $userObj->globalRoleID = $argsObj->rights_id; + $userObj->locale = $argsObj->locale; + $userObj->isActive = $argsObj->user_is_active; + $userObj->authentication = trim($argsObj->authentication); +} + +/** + * + * @param database $dbHandler + * @param int $roleID + * @return + */ +function decodeRoleId(&$dbHandler, $roleID) +{ + $roleInfo = tlRole::getByID($dbHandler, $roleID); + return $roleInfo->name; +} + +/** + * + * @param TLSmarty $smartyObj + * @param stdClass $argsObj + * @param stdClass $templateCfg + */ +function renderGui(&$smartyObj, &$argsObj, $templateCfg) +{ + $doRender = false; + switch ($argsObj->doAction) { + case "edit": + case "create": + case "resetPassword": + case "genAPIKey": + $doRender = true; + $tpl = $templateCfg->default_template; + break; + + case "doCreate": + case "doUpdate": + if (! is_null($templateCfg->template)) { + $doRender = true; + $tpl = $templateCfg->template; + } else { + header("Location: usersView.php"); + exit(); + } + break; + } + + if ($doRender) { + $smartyObj->display($templateCfg->template_dir . $tpl); + } +} + +/** + * + * @param database $dbHandler + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui(&$dbHandler, &$argsObj) +{ + $userObj = &$argsObj->user; + + $guiObj = new stdClass(); + + $guiObj->user = null; + switch ($argsObj->doAction) { + case 'edit': + // Because we can arrive with login, we need to check if we can get + // id from login + if (strlen(trim($argsObj->login)) > 0) { + $argsObj->user_id = tlUser::doesUserExist($dbHandler, + $argsObj->login); + } + + if (is_null($argsObj->user_id) || intval($argsObj->user_id) <= 0) { + // need to manage some sort of error message + $guiObj->op = new stdClass(); + $guiObj->op->status = tl::ERROR; + $guiObj->op->user_feedback = sprintf( + lang_get('login_does_not_exist'), $argsObj->login); + } else { + $guiObj->user = new tlUser(intval($argsObj->user_id)); + $guiObj->user->readFromDB($dbHandler); + } + $guiObj->main_title = lang_get("action_{$argsObj->doAction}_user"); + break; + + case "resetPassword": + case "genAPIKey": + $guiObj->user = new tlUser($argsObj->user_id); + $guiObj->user->readFromDB($dbHandler); + break; + } + + $guiObj->op = new stdClass(); + $guiObj->op->user_feedback = ''; + $guiObj->op->status = tl::OK; + + $guiObj->authCfg = config_get('authentication'); + $guiObj->auth_method_opt = array( + lang_get('default_auth_method') . "(" . + $guiObj->authCfg['domain'][$guiObj->authCfg['method']]['description'] . + ")" => '' + ); + + $dummy = array_keys($guiObj->authCfg['domain']); + foreach ($dummy as $xc) { + // description => html option value + $guiObj->auth_method_opt[$xc] = $xc; + } + + $guiObj->auth_method_opt = array_flip($guiObj->auth_method_opt); + + $guiObj->optLocale = config_get('locales'); + + $guiObj->grants = getGrantsForUserMgmt($dbHandler, $userObj); + + $guiObj->grants->mgt_view_events = $userObj->hasRight($dbHandler, + "mgt_view_events"); + + $guiObj->expiration_date = $argsObj->expiration_date; + + $noExpirationUsers = array_flip(config_get('noExpDateUsers')); + $guiObj->expDateEnabled = true; + if (! is_null($guiObj->user)) { + $guiObj->expDateEnabled = ! isset( + $noExpirationUsers[$guiObj->user->login]); + } + + return $guiObj; +} + +/** + * + * @return array + */ +function initLabels() +{ + $tg = array( + 'action_create_user' => null, + 'action_edit_user' => null + ); + return init_labels($tg); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_users'); } - -$gui->op->operation = $actionOperation[$args->doAction]; -$roles = tlRole::getAll($db,null,null,null,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); -unset($roles[TL_ROLES_UNDEFINED]); - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); - -$smarty->assign('highlight',$highlight); -$smarty->assign('operation',$gui->op->operation); -$smarty->assign('user_feedback',$gui->op->user_feedback); -$smarty->assign('external_password_mgmt', tlUser::isPasswordMgtExternal($gui->user->authentication)); -$smarty->assign('optRights',$roles); -renderGui($smarty,$args,$templateCfg); - - -/** - * - * - */ -function init_args() -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - $iParams = array("delete" => array(tlInputParameter::INT_N), - "user" => array(tlInputParameter::INT_N), - "user_id" => array(tlInputParameter::INT_N), - "rights_id" => array(tlInputParameter::INT_N), - "doAction" => array(tlInputParameter::STRING_N,0,30), - "firstName" => array(tlInputParameter::STRING_N,0,50), - "lastName" => array(tlInputParameter::STRING_N,0,50), - "emailAddress" => array(tlInputParameter::STRING_N,0,100), - "locale" => array(tlInputParameter::STRING_N,0,10), - "login" => array(tlInputParameter::STRING_N,0,100), - "password" => array(tlInputParameter::STRING_N,0,32), - "authentication" => array(tlInputParameter::STRING_N,0,10), - "user_is_active" => array(tlInputParameter::CB_BOOL)); - - $args = new stdClass(); - R_PARAMS($iParams,$args); - - $date_format = config_get('date_format'); - - // convert expiration date to ISO format to write to db - $dk = 'expiration_date'; - $args->$dk = null; - if (isset($_REQUEST[$dk]) && $_REQUEST[$dk] != '') - { - $da = split_localized_date($_REQUEST[$dk], $date_format); - if ($da != null) - { - // set date in iso format - $args->$dk = $da['year'] . "-" . $da['month'] . "-" . $da['day']; - } - } - - $args->user = $_SESSION['currentUser']; - return $args; -} - -/* - function: doCreate - - args: - - returns: object with following members - user: tlUser object - status: - template: will be used by viewer logic. - null -> viewer logic will choose template - other value -> viever logic will use this template. - - - -*/ -function doCreate(&$dbHandler,&$argsObj) -{ - $op = new stdClass(); - $op->user = new tlUser(); - $op->status = $op->user->setPassword($argsObj->password); - $op->template = 'usersEdit.tpl'; - $op->operation = ''; - - $statusOk = false; - if ($op->status >= tl::OK) - { - initializeUserProperties($op->user,$argsObj); - $op->status = $op->user->writeToDB($dbHandler); - if($op->status >= tl::OK) - { - tlUser::setExpirationDate($dbHandler,$op->user->dbID,$argsObj->expiration_date); - - $statusOk = true; - $op->template = null; - logAuditEvent(TLS("audit_user_created",$op->user->login),"CREATE",$op->user->dbID,"users"); - $op->user_feedback = sprintf(lang_get('user_created'),$op->user->login); - } - } - - if (!$statusOk) - { - $op->operation = 'create'; - $op->user_feedback = getUserErrorMessage($op->status); - } - - return $op; -} - -/** - * - */ -function doUpdate(&$dbHandler,&$argsObj,$sessionUserID) -{ - $op = new stdClass(); - $op->user_feedback = ''; - $op->user = new tlUser($argsObj->user_id); - $op->status = $op->user->readFromDB($dbHandler); - if ($op->status >= tl::OK) - { - initializeUserProperties($op->user,$argsObj); - $op->status = $op->user->writeToDB($dbHandler); - if ($op->status >= tl::OK) - { - tlUser::setExpirationDate($dbHandler,$op->user->dbID,$argsObj->expiration_date); - - logAuditEvent(TLS("audit_user_saved",$op->user->login),"SAVE",$op->user->dbID,"users"); - - if ($sessionUserID == $argsObj->user_id) - { - $_SESSION['currentUser'] = $op->user; - setUserSession($dbHandler,$op->user->login, $argsObj->user_id, - $op->user->globalRoleID, $op->user->emailAddress, $op->user->locale); - - if (!$argsObj->user_is_active) - { - header("Location: ../../logout.php"); - exit(); - } - } - } - $op->user_feedback = getUserErrorMessage($op->status); - } - return $op; -} - -/** - * - */ -function createNewPassword(&$dbHandler,&$argsObj,&$userObj,$newPasswordSendMethod) -{ - $op = new stdClass(); - $op->user_feedback = ''; - $op->new_password = ''; - - // Try to validate mail configuration - // - // From Zend Documentation - // You may find you also want to match IP addresses, Local hostnames, or a combination of all allowed types. - // This can be done by passing a parameter to Zend_Validate_Hostname when you instantiate it. - // The paramter should be an integer which determines what types of hostnames are allowed. - // You are encouraged to use the Zend_Validate_Hostname constants to do this. - // The Zend_Validate_Hostname constants are: ALLOW_DNS to allow only DNS hostnames, ALLOW_IP to allow IP addresses, - // ALLOW_LOCAL to allow local network names, and ALLOW_ALL to allow all three types. - // - $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); - $smtp_host = config_get( 'smtp_host' ); - - $password_on_screen = ($newPasswordSendMethod == 'display_on_screen'); - if( $validator->isValid($smtp_host) || $password_on_screen ) - { - $dummy = resetPassword($dbHandler,$argsObj->user_id,$newPasswordSendMethod); - - $op->user_feedback = $dummy['msg']; - $op->status = $dummy['status']; - $op->new_password = $dummy['password']; - if ($op->status >= tl::OK) - { - logAuditEvent(TLS("audit_pwd_reset_requested",$userObj->login),"PWD_RESET",$argsObj->user_id,"users"); - $op->user_feedback = lang_get('password_reseted'); - if( $password_on_screen ) - { - $op->user_feedback = lang_get('password_set') . $dummy['password']; - } - } - else - { - $op->user_feedback = sprintf(lang_get('password_cannot_be_reseted_reason'),$op->user_feedback); - } - } - else - { - $op->status = tl::ERROR; - $op->user_feedback = lang_get('password_cannot_be_reseted_invalid_smtp_hostname'); - } - return $op; -} - -/** - * - */ -function createNewAPIKey(&$dbHandler,&$argsObj,&$userObj) -{ - $op = new stdClass(); - $op->user_feedback = ''; - - // Try to validate mail configuration - // - // From Zend Documentation - // You may find you also want to match IP addresses, Local hostnames, or a combination of all allowed types. - // This can be done by passing a parameter to Zend_Validate_Hostname when you instantiate it. - // The paramter should be an integer which determines what types of hostnames are allowed. - // You are encouraged to use the Zend_Validate_Hostname constants to do this. - // The Zend_Validate_Hostname constants are: ALLOW_DNS to allow only DNS hostnames, ALLOW_IP to allow IP addresses, - // ALLOW_LOCAL to allow local network names, and ALLOW_ALL to allow all three types. - // - $validator = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL); - $smtp_host = config_get( 'smtp_host' ); - $op->status = tl::ERROR; - - // We need to validate at least that user mail is NOT EMPTY - if( $validator->isValid($smtp_host) ) - { - $APIKey = new APIKey(); - if ($APIKey->addKeyForUser($argsObj->user_id) >= tl::OK) - { - logAuditEvent(TLS("audit_user_apikey_set",$userObj->login),"CREATE", - $userObj->login,"users"); - $op->user_feedback = lang_get('apikey_by_mail'); - $op->status = tl::OK; - - // now send by mail - $ak = $APIKey->getAPIKey($argsObj->user_id); - $msgBody = lang_get('your_apikey_is') . "\n\n" . $ak . - "\n\n" . lang_get('contact_admin'); - $mail_op = @email_send(config_get('from_email'), - $userObj->emailAddress,lang_get('mail_apikey_subject'),$msgBody); - } - } - else - { - $op->status = tl::ERROR; - $op->user_feedback = lang_get('apikey_cannot_be_reseted_invalid_smtp_hostname'); - } - return $op; -} - - - -/* - function: initializeUserProperties - initialize members for a user object. - - args: userObj: data read from DB - argsObj: data entry from User Interface - - returns: - - -*/ -function initializeUserProperties(&$userObj,&$argsObj) -{ - if (!is_null($argsObj->login)) - { - $userObj->login = $argsObj->login; - } - $userObj->emailAddress = $argsObj->emailAddress; - - // The Black List - Jon Bokenkamp - $reddington = array('/','\\',':','*','?','<','>','|'); - $userObj->firstName = str_replace($reddington,'',$argsObj->firstName); - $userObj->lastName = str_replace($reddington,'',$argsObj->lastName); - - $userObj->globalRoleID = $argsObj->rights_id; - $userObj->locale = $argsObj->locale; - $userObj->isActive = $argsObj->user_is_active; - $userObj->authentication = trim($argsObj->authentication); -} - -function decodeRoleId(&$dbHandler,$roleID) -{ - $roleInfo = tlRole::getByID($dbHandler,$roleID); - return $roleInfo->name; -} - -function renderGui(&$smartyObj,&$argsObj,$templateCfg) -{ - $doRender = false; - switch($argsObj->doAction) - { - case "edit": - case "create": - case "resetPassword": - case "genAPIKey": - $doRender = true; - $tpl = $templateCfg->default_template; - break; - - case "doCreate": - case "doUpdate": - if(!is_null($templateCfg->template)) - { - $doRender = true; - $tpl = $templateCfg->template; - } - else - { - header("Location: usersView.php"); - exit(); - } - break; - - } - - if($doRender) - { - $smartyObj->display($templateCfg->template_dir . $tpl); - } -} - - -/** - * - */ -function initializeGui(&$dbHandler,&$argsObj) -{ - $userObj = &$argsObj->user; - - $guiObj = new stdClass(); - - $guiObj->user = null; - switch($argsObj->doAction) - { - case 'edit': - // Because we can arrive with login, we need to check if we can get - // id from login - if(strlen(trim($argsObj->login)) > 0) - { - $argsObj->user_id = tlUser::doesUserExist($dbHandler,$argsObj->login); - } - - if( is_null($argsObj->user_id) || intval($argsObj->user_id) <= 0) - { - // need to manage some sort of error message - $guiObj->op = new stdClass(); - $guiObj->op->status = tl::ERROR; - $guiObj->op->user_feedback = - sprintf(lang_get('login_does_not_exist'),$argsObj->login); - } - else - { - $guiObj->user = new tlUser(intval($argsObj->user_id)); - $guiObj->user->readFromDB($dbHandler); - } - $guiObj->main_title = lang_get("action_{$argsObj->doAction}_user"); - break; - - case "resetPassword": - case "genAPIKey": - $guiObj->user = new tlUser($argsObj->user_id); - $guiObj->user->readFromDB($dbHandler); - break; - } - - $guiObj->op = new stdClass(); - $guiObj->op->user_feedback = ''; - $guiObj->op->status = tl::OK; - - $guiObj->authCfg = config_get('authentication'); - $guiObj->auth_method_opt = array(lang_get('default_auth_method') . - "(" . $guiObj->authCfg['domain'][$guiObj->authCfg['method']]['description'] . ")" => ''); - - $dummy = array_keys($guiObj->authCfg['domain']); - foreach($dummy as $xc) - { - // description => html option value - $guiObj->auth_method_opt[$xc] = $xc; - } - - $guiObj->auth_method_opt = array_flip($guiObj->auth_method_opt); - - $guiObj->optLocale = config_get('locales'); - - $guiObj->grants = getGrantsForUserMgmt($dbHandler,$userObj); - - $guiObj->grants->mgt_view_events = - $userObj->hasRight($dbHandler,"mgt_view_events"); - - $guiObj->expiration_date = $argsObj->expiration_date; - - $noExpirationUsers = array_flip(config_get('noExpDateUsers')); - $guiObj->expDateEnabled = true; - if( !is_null($guiObj->user) ) - { - $guiObj->expDateEnabled = !isset($noExpirationUsers[$guiObj->user->login]); - } - - return $guiObj; -} - -/** - * - */ -function initLabels() -{ - $tg = array('action_create_user' => null,'action_edit_user' => null); - $labels = init_labels($tg); - return $labels; -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'mgt_users'); -} \ No newline at end of file diff --git a/lib/usermanagement/usersExport.php b/lib/usermanagement/usersExport.php index 4697984bee..46cf115255 100644 --- a/lib/usermanagement/usersExport.php +++ b/lib/usermanagement/usersExport.php @@ -1,108 +1,124 @@ -doAction ) -{ - case 'doExport': - doExport($db,$gui->export_filename); - break; - - default: - break; +doAction) { + case 'doExport': + doExport($db, $gui->export_filename); + break; + + default: + break; +} + +$tplCfg = templateConfiguration(); +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); +$smarty->display($tplCfg->tpl); + +/** + * + * @return stdClass + */ +function initArgs() +{ + $args = new stdClass(); + $_REQUEST = strings_stripSlashes($_REQUEST); + + $iParams = array( + "doAction" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "export_filename" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "goback_url" => array( + tlInputParameter::STRING_N, + 0, + 2048 + ) + ); + + R_PARAMS($iParams, $args); + $args->userID = $_SESSION['userID']; + + return $args; +} + +/** + * + * @param stdClass $argsObj + * @return stdClass + */ +function initializeGui($argsObj) +{ + $gui = new stdClass(); + $gui->page_title = lang_get('export_users'); + $gui->do_it = 1; + $gui->nothing_todo_msg = ''; + $gui->goback_url = ! is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; + $gui->export_filename = is_null($argsObj->export_filename) ? 'users.xml' : $argsObj->export_filename; + $gui->exportTypes = array( + 'XML' => 'XML' + ); + return $gui; +} + +/** + * + * @param database $dbHandler + * @param string $filename + * where to export + */ +function doExport(&$dbHandler, $filename) +{ + $adodbXML = new ADODB_XML("1.0", "ISO-8859-1"); + $adodbXML->setRootTagName('users'); + $adodbXML->setRowTagName('user'); + + $tables = tlObjectWithDB::getDBTables(array( + 'users' + )); + $fieldSet = 'id,login,role_id,email,first,last,locale,' . + 'default_testproject_id,active,expiration_date'; + $sql = " SELECT {$fieldSet} FROM {$tables['users']} "; + + $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql); + downloadContentsToFile($content, $filename); + exit(); +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, "mgt_users"); } - -$tplCfg = templateConfiguration(); -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); -$smarty->display($tplCfg->tpl); - - -/* - function: init_args() - - args: - - returns: - -*/ -function init_args() -{ - $args = new stdClass(); - $_REQUEST = strings_stripSlashes($_REQUEST); - - $iParams = array("doAction" => array(tlInputParameter::STRING_N,0,50), - "export_filename" => array(tlInputParameter::STRING_N,0,100), - "goback_url" => array(tlInputParameter::STRING_N,0,2048)); - - R_PARAMS($iParams,$args); - $args->userID = $_SESSION['userID']; - - return $args; -} - -/** - * - */ -function initializeGui($argsObj) -{ - $gui = new stdClass(); - $gui->page_title = lang_get('export_users'); - $gui->do_it = 1; - $gui->nothing_todo_msg = ''; - $gui->goback_url = !is_null($argsObj->goback_url) ? $argsObj->goback_url : ''; - $gui->export_filename = is_null($argsObj->export_filename) ? 'users.xml' : $argsObj->export_filename; - $gui->exportTypes = array('XML' => 'XML'); - return $gui; -} - - -/* - function: doExport() - - args: dbHandler - filename: where to export - - returns: - - -*/ -function doExport(&$dbHandler,$filename) -{ - $adodbXML = new ADODB_XML("1.0", "ISO-8859-1"); - $adodbXML->setRootTagName('users'); - $adodbXML->setRowTagName('user'); - - $tables = tlObjectWithDB::getDBTables(array('users')); - $fieldSet = 'id,login,role_id,email,first,last,locale,' . - 'default_testproject_id,active,expiration_date'; - $sql = " SELECT {$fieldSet} FROM {$tables['users']} "; - - $content = $adodbXML->ConvertToXMLString($dbHandler->db, $sql); - downloadContentsToFile($content,$filename); - exit(); -} - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,"mgt_users"); -} \ No newline at end of file diff --git a/lib/usermanagement/usersView.php b/lib/usermanagement/usersView.php index 5113a49ed1..1316efb1db 100644 --- a/lib/usermanagement/usersView.php +++ b/lib/usermanagement/usersView.php @@ -1,310 +1,368 @@ -operation) { - case 'disable': - // user cannot disable => inactivate itself - if ($args->user_id != $args->currentUserID) { - // some minor CSRF protection checking referer - $refe = $_SERVER['HTTP_REFERER']; - $target = trim($_SESSION['basehref'],'/') . - '/lib/usermanagement/usersView.php'; - if (strpos($refe,$target) === FALSE) { - // No good - exit(); - } - - $user = new tlUser($args->user_id); - $gui->result = $user->readFromDB($db); - if ($gui->result >= tl::OK) { - $gui->result = $user->setActive($db,0); - if ($gui->result >= tl::OK) - { - logAuditEvent(TLS("audit_user_disabled",$user->login),"DISABLE",$args->user_id,"users"); - $gui->user_feedback = sprintf(lang_get('user_disabled'),$user->login); - } - } - } - if ($gui->result != tl::OK) - { - $gui->user_feedback = lang_get('error_user_not_disabled'); - } - break; - - default: - break; +operation) { + case 'disable': + // user cannot disable => inactivate itself + if ($args->user_id != $args->currentUserID) { + // some minor CSRF protection checking referer + $refe = $_SERVER['HTTP_REFERER']; + $target = trim($_SESSION['basehref'], '/') . + '/lib/usermanagement/usersView.php'; + if (strpos($refe, $target) === false) { + // No good + exit(); + } + + $user = new tlUser($args->user_id); + $gui->result = $user->readFromDB($db); + if ($gui->result >= tl::OK) { + $gui->result = $user->setActive($db, 0); + if ($gui->result >= tl::OK) { + logAuditEvent(TLS("audit_user_disabled", $user->login), + "DISABLE", $args->user_id, "users"); + $gui->user_feedback = sprintf(lang_get('user_disabled'), + $user->login); + } + } + } + if ($gui->result != tl::OK) { + $gui->user_feedback = lang_get('error_user_not_disabled'); + } + break; + + default: + break; +} + +$gui->images = $smarty->getImages(); +$gui->matrix = getAllUsersForGrid($db); +$gui->tableSet[] = buildMatrix($gui, $args); + +$tplCfg = templateConfiguration(); +$smarty->assign('gui', $gui); +$smarty->display($tplCfg->tpl); + +/** + * + * @param database $dbHandler + * @return stdClass[] + */ +function initEnv(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + + // input from GET['HelloString3'], + // type: string, + // minLen: 1, + // maxLen: 15, + // regular expression: null + // checkFunction: applys checks via checkFooOrBar() to ensure its either 'foo' or 'bar' + // normalization: done via normFunction() which replaces ',' with '.' + // "HelloString3" => array("GET",tlInputParameter::STRING_N,1,15,'checkFooOrBar','normFunction'), + // + $iParams = array( + "operation" => array( + tlInputParameter::STRING_N, + 0, + 50 + ), + "user" => array( + tlInputParameter::INT_N + ) + ); + + $pParams = R_PARAMS($iParams); + $args = new stdClass(); + $args->operation = $pParams["operation"]; + $args->user_id = $pParams['user']; + + $args->currentUser = $_SESSION['currentUser']; + $args->currentUserID = $_SESSION['currentUser']->dbID; + $args->basehref = $_SESSION['basehref']; + + $gui = new stdClass(); + $gui->grants = getGrantsForUserMgmt($dbHandler, $args->currentUser); + $gui->main_title = lang_get('title_user_mgmt'); + $gui->result = null; + $gui->action = null; + $gui->user_feedback = ''; + $gui->update_title_bar = 0; + $gui->reload = 0; + + $gui->basehref = $args->basehref; + + $gui->highlight = initializeTabsmenu(); + $gui->highlight->view_users = 1; + + return array( + $args, + $gui + ); +} + +/** + * using configuration parameter ($g_role_colour) + * creates a map with following structure: + * key: role name + * value: colour + * + * If name is not defined on $g_role_colour (this normally happens for user + * defined roles), will be added with '' as colour (means default colour). + * + * @param database $db + * reference to db object + * @return array + */ +function getRoleColourCfg(&$db) +{ + $role_colour = config_get('role_colour'); + $roles = tlRole::getAll($db, null, null, null, + tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); + unset($roles[TL_ROLES_UNDEFINED]); + foreach ($roles as $roleObj) { + if (! isset($role_colour[$roleObj->name])) { + $role_colour[$roleObj->name] = ''; + } + } + return $role_colour; +} + +/** + * Builds ext-js rich table to display matrix results + * + * @param stdClass $guiObj + * @param stdClass $argsObj + * @return tlExtTable + */ +function buildMatrix(&$guiObj, &$argsObj) +{ + // th_first_name,th_last_name,th_email + // IMPORTANT DEVELOPER NOTICE + // Column order is same that present on query on getAllUsersForGrid() + // + // Where col_id is not specified, col_id will be generated this way: 'id_' . $v['title_key']. + // Example: id_th_first_name. + // + // 'tlType' => TestLinkType: will be analized and mapped accordingly on tlExtTable::buildColumns() + // + $columns = array( + array( + 'title_key' => 'th_login', + 'col_id' => 'handle', + 'width' => 100 + ), + array( + 'title_key' => 'th_first_name', + 'width' => 150 + ), + array( + 'title_key' => 'th_last_name', + 'width' => 150 + ), + array( + 'title_key' => 'th_email', + 'width' => 150 + ), + array( + 'title_key' => 'th_role', + 'width' => 150 + ), + array( + 'title_key' => 'th_locale', + 'width' => 150 + ), + array( + 'title_key' => 'th_active', + 'type' => 'oneZeroImage', + 'width' => 50 + ), + array( + 'title_key' => 'expiration_date', + 'width' => 50 + ), + array( + 'title' => 'disableUser', + 'tlType' => 'disableUser', + 'width' => 150 + ), + array( + 'hidden' => true, + 'title' => 'hidden_role_id', + 'col_id' => 'role_id' + ), + array( + 'hidden' => true, + 'title' => 'hidden_user_id', + 'col_id' => 'user_id' + ), + array( + 'hidden' => true, + 'title' => 'hidden_login', + 'col_id' => 'login' + ), + array( + 'hidden' => true, + 'title' => 'hidden_is_special', + 'col_id' => 'is_special' + ) + ); + + init_labels( + array( + 'th_login' => null, + 'th_first_name' => null, + 'th_last_name' => null, + 'expiration' => null, + 'th_email' => null + )); + + $loop2do = count($guiObj->matrix); + + // login added as workaround for SORTING, because the whole string is used then user_id + // in url takes precedence over the login displayed + $actionUrl = '' . + $guiObj->matrix[$zdx]['login'] . ""; + } + + $matrix = new tlExtTable($columns, $guiObj->matrix, 'tl_users_list'); + + // => addCustomBehaviour(columnType, ); + $matrix->addCustomBehaviour('oneZeroImage', + array( + 'render' => 'oneZeroImageRenderer' + )); + $matrix->moreViewConfig = " ,getRowClass: function(record, index) {" . + " var x = record.get('role_id');" . " return('roleCode'+x); " . " } "; + + $matrix->setImages($guiObj->images); + $matrix->allowMultiSort = false; + $matrix->sortDirection = 'DESC'; + $matrix->showToolbar = true; + $matrix->toolbarShowAllColumnsButton = true; + unset($columns); + + return $matrix; +} + +/** + * check function for tlInputParameter user_order_by + * + * @param + * $input + * @return boolean + */ +function checkUserOrderBy($input) +{ + $domain = array_flip(array( + 'order_by_role', + 'order_by_login' + )); + return isset($domain[$input]) ? true : false; +} + +/** + * + * @param database $dbHandler + * @return number|string + */ +function getAllUsersForGrid(&$dbHandler) +{ + $tables = tlObject::getDBTables(array( + 'users', + 'roles' + )); + + // Column extraction order is CRITIC for correct behaviour of Ext-JS + $sql = " SELECT '' AS handle,U.first,U.last,U.email,R.description," . + " U.locale,U.active,U.expiration_date," . + " /* this columns will not visible on GUI */ " . + " '' AS place_holder,R.id AS role_id,U.id AS user_id,U.login, 0 AS is_special " . + " FROM {$tables['users']} U " . + " JOIN {$tables['roles']} R ON U.role_id = R.id ORDER BY U.login "; + + $users = $dbHandler->get_recordset($sql); + + // because we need to render this on EXT-JS, we have issues with role + // due to <, then we are going to escape values in description column + $loop2do = count($users); + $dummy = ''; + for ($idx = 0; $idx < $loop2do; $idx ++) { + $users[$idx]['description'] = htmlentities($users[$idx]['description']); + + // localize dates + $ed = trim($users[$idx]['expiration_date']); + if ($ed != '') { + $users[$idx]['expiration_date'] = localize_dateOrTimeStamp(null, + $dummy, 'date_format', $ed); + } + } + + // Still need to understand why, but with MSSQL we use on ADODB + // fetch mode = ADODB_FETCH_BOTH, this generates numeric AND literal keys + // on row maps => for each column on result set we get to elements on row map. + // example 0,handle,1,first, and so on. + // This drives crazy EXT-JS grid + if (! is_null($users) && $dbHandler->dbType == 'mssql') { + $clean = array(); + foreach ($users as $row) { + $cr = array(); + $elem = array_keys($row); + foreach ($elem as $accessKey) { + if (! is_numeric($accessKey)) { + $cr[$accessKey] = $row[$accessKey]; + } + } + $clean[] = $cr; + } + $users = $clean; + } + + if (config_get('demoMode')) { + $loop2do = count($users); + $specialK = array_flip((array) config_get('demoSpecialUsers')); + for ($idx = 0; $idx < $loop2do; $idx ++) { + $users[$idx]['is_special'] = isset($specialK[$users[$idx]['login']]) ? 1 : 0; + } + } + + return $users; +} + +/** + * + * @param database $db + * @param tlUser $user + * @return string + */ +function checkRights(&$db, &$user) +{ + return $user->hasRight($db, 'mgt_users'); } - -$gui->images = $smarty->getImages(); -$gui->matrix = getAllUsersForGrid($db); -$gui->tableSet[] = buildMatrix($gui, $args); - -$tplCfg = templateConfiguration(); -$smarty->assign('gui',$gui); -$smarty->display($tplCfg->tpl); - - -/** - * - */ -function initEnv(&$dbHandler) -{ - $_REQUEST=strings_stripSlashes($_REQUEST); - - // input from GET['HelloString3'], - // type: string, - // minLen: 1, - // maxLen: 15, - // regular expression: null - // checkFunction: applys checks via checkFooOrBar() to ensure its either 'foo' or 'bar' - // normalization: done via normFunction() which replaces ',' with '.' - // "HelloString3" => array("GET",tlInputParameter::STRING_N,1,15,'checkFooOrBar','normFunction'), - // - $iParams = array("operation" => array(tlInputParameter::STRING_N,0,50), - "user" => array(tlInputParameter::INT_N)); - - $pParams = R_PARAMS($iParams); - $args = new stdClass(); - $args->operation = $pParams["operation"]; - $args->user_id = $pParams['user']; - - $args->currentUser = $_SESSION['currentUser']; - $args->currentUserID = $_SESSION['currentUser']->dbID; - $args->basehref = $_SESSION['basehref']; - - - $gui = new stdClass(); - $gui->grants = getGrantsForUserMgmt($dbHandler,$args->currentUser); - $gui->main_title = lang_get('title_user_mgmt'); - $gui->result = null; - $gui->action = null; - $gui->user_feedback = ''; - $gui->update_title_bar = 0; - $gui->reload = 0; - - $gui->basehref = $args->basehref; - - $gui->highlight = initialize_tabsmenu(); - $gui->highlight->view_users = 1; - - return array($args,$gui); -} - -/* - function: getRoleColourCfg - using configuration parameter ($g_role_colour) - creates a map with following structure: - key: role name - value: colour - - If name is not defined on $g_role_colour (this normally - happens for user defined roles), will be added with '' as colour (means default colour). - - args: db: reference to db object - - returns: map - -*/ -function getRoleColourCfg(&$db) -{ - $role_colour = config_get('role_colour'); - $roles = tlRole::getAll($db,null,null,null,tlRole::TLOBJ_O_GET_DETAIL_MINIMUM); - unset($roles[TL_ROLES_UNDEFINED]); - foreach($roles as $roleObj) - { - if(!isset($role_colour[$roleObj->name])) - { - $role_colour[$roleObj->name] = ''; - } - } - return $role_colour; -} - - -/** - * Builds ext-js rich table to display matrix results - * - * - * return tlExtTable - * - */ -function buildMatrix(&$guiObj,&$argsObj) -{ - // th_first_name,th_last_name,th_email - // IMPORTANT DEVELOPER NOTICE - // Column order is same that present on query on getAllUsersForGrid() - // - // Where col_id is not specified, col_id will be generated this way: 'id_' . $v['title_key']. - // Example: id_th_first_name. - // - // 'tlType' => TestLinkType: will be analized and mapped accordingly on tlExtTable::buildColumns() - // - $columns = array(array('title_key' => 'th_login', 'col_id' => 'handle', 'width' => 100), - array('title_key' => 'th_first_name', 'width' => 150), - array('title_key' => 'th_last_name', 'width' => 150), - array('title_key' => 'th_email', 'width' => 150), - array('title_key' => 'th_role', 'width' => 150), - array('title_key' => 'th_locale', 'width' => 150), - array('title_key' => 'th_active', 'type' => 'oneZeroImage', 'width' => 50), - array('title_key' => 'expiration_date', 'width' => 50), - array('title' => 'disableUser', 'tlType' => 'disableUser', 'width' => 150), - array('hidden' => true, 'title' => 'hidden_role_id', 'col_id' => 'role_id'), - array('hidden' => true, 'title' => 'hidden_user_id', 'col_id' => 'user_id'), - array('hidden' => true, 'title' => 'hidden_login', 'col_id' => 'login'), - array('hidden' => true, 'title' => 'hidden_is_special', 'col_id' => 'is_special')); - - $lbl = init_labels(array('th_login' => null,'th_first_name' => null, - 'th_last_name' => null,'expiration' => null, - 'th_email' => null)); - - $loop2do = count($guiObj->matrix); - - // login added as workaround for SORTING, because the whole string is used then user_id - // in url takes precedence over the login displayed - $actionUrl = '' . $guiObj->matrix[$zdx]['login'] . - ""; - } - - - $matrix = new tlExtTable($columns, $guiObj->matrix, 'tl_users_list'); - - // => addCustomBehaviour(columnType, ); - $matrix->addCustomBehaviour('oneZeroImage', array('render' => 'oneZeroImageRenderer')); - $matrix->moreViewConfig = " ,getRowClass: function(record, index) {" . - " var x = record.get('role_id');" . - " return('roleCode'+x); " . - " } " ; - - $matrix->setImages($guiObj->images); - $matrix->allowMultiSort = false; - $matrix->sortDirection = 'DESC'; - $matrix->showToolbar = true; - $matrix->toolbarShowAllColumnsButton = true; - unset($columns); - - return $matrix; -} - - - -/** - * check function for tlInputParameter user_order_by - * - */ -function checkUserOrderBy($input) -{ - $domain = array_flip(array('order_by_role','order_by_login')); - - $status_ok = isset($domain[$input]) ? true : false; - return $status_ok; -} - -/** - * - */ -function getAllUsersForGrid(&$dbHandler) -{ - $tables = tlObject::getDBTables(array('users','roles')); - - // Column extraction order is CRITIC for correct behaviour of Ext-JS - $sql = " SELECT '' AS handle,U.first,U.last,U.email,R.description," . - " U.locale,U.active,U.expiration_date," . - " /* this columns will not visible on GUI */ " . - " '' AS place_holder,R.id AS role_id,U.id AS user_id,U.login, 0 AS is_special " . - " FROM {$tables['users']} U " . - " JOIN {$tables['roles']} R ON U.role_id = R.id ORDER BY U.login "; - - $users = $dbHandler->get_recordset($sql); - - // because we need to render this on EXT-JS, we have issues with role - // due to <, then we are going to escape values in description column - $loop2do = count($users); - $dummy = ''; - for($idx=0; $idx < $loop2do; $idx++) - { - $users[$idx]['description'] = htmlentities($users[$idx]['description']); - - // localize dates - $ed = trim($users[$idx]['expiration_date']); - if($ed != '') - { - $users[$idx]['expiration_date'] = - localize_dateOrTimeStamp(null,$dummy,'date_format',$ed); - } - } - - - // Still need to understand why, but with MSSQL we use on ADODB - // fetch mode = ADODB_FETCH_BOTH, this generates numeric AND literal keys - // on row maps => for each column on result set we get to elements on row map. - // example 0,handle,1,first, and so on. - // This drives crazy EXT-JS grid - if(!is_null($users) && $dbHandler->dbType == 'mssql') - { - $clean = array(); - foreach($users as $row) - { - $cr = array(); - $elem = array_keys($row); - foreach($elem as $accessKey) - { - if(!is_numeric($accessKey)) - { - $cr[$accessKey] = $row[$accessKey]; - } - } - $clean[] = $cr; - } - $users = $clean; - } - - if( config_get('demoMode') ) - { - $loop2do = count($users); - $specialK = array_flip((array)config_get('demoSpecialUsers')); - for($idx=0; $idx < $loop2do; $idx++) - { - $users[$idx]['is_special'] = isset($specialK[$users[$idx]['login']]) ? 1 : 0; - } - } - - return $users; -} - - - -function checkRights(&$db,&$user) -{ - return $user->hasRight($db,'mgt_users'); -} \ No newline at end of file diff --git a/linkto.php b/linkto.php index 39b35a2ba5..cc658a6afe 100644 --- a/linkto.php +++ b/linkto.php @@ -1,475 +1,434 @@ -/linkto.php?tprojectPrefix=KAOS&item=testcase&id=KAOS-4 - * http:///linkto.php?testcase=KAOS-4 - * - * - * - direct link to requirement REQ-002 in test project KAOS: - * http:///linkto.php?tprojectPrefix=KAOS&item=req&id=REQ-002 - * - * - direct link to requirement specification REQ-SPEC-AK89 in test project KAOS: - * http:///linkto.php?tprojectPrefix=KAOS&item=reqspec&id=REQ-SPEC-AK89 - * - * Anchors: - * If anchors are set (in scope, etc.) in the linked document, you can specify these - * by using &anchor=anchorname, e.g. - * http:///linkto.php?tprojectPrefix=KAOS&item=testcase&id=KAOS-4&anchor=importantpart - * - * Specials: - * - tree for requirement specification or test specification - * are expanded to the level of the item you created the link to - * - if a user has no right to view item he is redirected to main page - * - if item does not exist an errormessage shows - * - * @package TestLink - * @author asimon - * @copyright 2007-2023, TestLink community - * @link http://www.teamst.org/index.php - * - */ - -// use output buffer to prevent headers/data from being sent before -// cookies are set, else it will fail -ob_start(); - -// some session and settings stuff from original index.php -require_once('lib/functions/configCheck.php'); -checkConfiguration(); -require_once('config.inc.php'); -require_once('common.php'); -require_once('attachments.inc.php'); -require_once('requirements.inc.php'); -require_once('testcase.class.php'); -require_once('testproject.class.php'); -require_once('users.inc.php'); -testlinkInitPage($db, true); - -$smarty = new TLSmarty(); - -// display outer or inner frame? -if (!isset($_GET['load'])) -{ - // display outer frame, pass parameters to next script call for inner frame - // Direct link to testcase where TC ID prefix contains an '&' (the ampersand symbol), does not link - // - // ATTENTION: - // Because we are going to recreate an URL with paramenters on the URL, we need - // to use urlencode() on data we have got. - // - - $args = init_args(); - $args->tproject_id = 0; - if( $args->status_ok ) - { - $user = $_SESSION['currentUser']; - if($args->tprojectPrefix != '') { - $hasRight = checkTestProject($db,$user,$args); - if( $hasRight ) { - $gui = new stdClass(); - $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; - $gui->navbar_height = config_get('navbar_height'); - - if( $args->tproject_id > 0) - { - $gui->titleframe .= '&testproject=' . $args->tproject_id; - } - $gui->title = lang_get('main_page_title'); - $gui->mainframe = 'linkto.php?' . buildLink($args); - $smarty->assign('gui', $gui); - $smarty->display('main.tpl'); - } - } - } -} -else -{ - // - // inner frame, parameters passed - // figure out what to display - // - // key: item, value: url to tree management page - $itemCode = array('req' => 'lib/requirements/reqSpecListTree.php', - 'reqspec' => 'lib/requirements/reqSpecListTree.php', - 'testcase' => 'lib/testcases/listTestCases.php?feature=edit_tc', - 'testsuite' => 'lib/testcases/listTestCases.php?feature=edit_tc'); - - - $op = [ - 'status_ok' => true, - 'msg' => '' - ]; - - $args = init_args(); - if ($args->status_ok == false) { - // key: key on _GET, value: labelID defined on strings.txt - $mustKeys = [ - 'tprojectPrefix' => 'testproject_not_set', - 'item' => 'item_not_set', - 'id' => 'id_not_set' - ]; - - foreach($mustKeys as $key => $labelID) - { - $op['status_ok'] = isset($_GET[$key]); - if( !$op['status_ok']) - { - $op['msg'] = __FILE__ . ' >> ' . lang_get($labelID); - break; - } - } - } - - if($op['status_ok']) - { - $tproject = new testproject($db); - $tproject_data = $tproject->get_by_prefix($args->tprojectPrefix); - if(($op['status_ok'] = !is_null($tproject_data))) - { - $tproject->setSessionProject($tproject_data['id']); - $op['status_ok'] = isset($itemCode[$args->item]); - $op['msg'] = sprintf(lang_get('invalid_item'),$args->item); - } - else - { - $op['msg'] = sprintf(lang_get('testproject_not_found'),$args->tprojectPrefix); - } - } - - if($op['status_ok']) - { - // Build name of function to call for doing the job. - $pfn = 'process_' . $args->item; - $jump_to = $pfn($db, $args->id, $tproject_data['id'], $args->tprojectPrefix, $args->version); - $op['status_ok'] = !is_null($jump_to['url']); - $op['msg'] = $jump_to['msg']; - } - - if($op['status_ok']) - { - // need to set test project item on Navbar - // add anchor to URL - $url = $jump_to['url'] . $args->anchor; - - $smarty->assign('title', lang_get('main_page_title')); - $smarty->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); - $smarty->assign('workframe', $url); - $smarty->assign('treeframe', $itemCode[$args->item]); - $smarty->display('frmInner.tpl'); - } - else - { - echo $op['msg']; - ob_end_flush(); - exit(); - } -} -ob_end_flush(); - - -/** - * - * - */ -function checkTestProject(&$db,&$user,&$args) -{ - $hasRight = false; - $tproject_mgr = new testproject($db); - $item_info = $tproject_mgr->get_by_prefix($args->tprojectPrefix); - - if(($op['status_ok'] = !is_null($item_info))) - { - $args->tproject_id = intval($item_info['id']); - switch($args->item) - { - case 'testcase': - case 'testsuite': - $hasRight = $user->hasRight($db,'mgt_view_tc',$args->tproject_id); - break; - - case 'req': - case 'reqspec': - $hasRight = $user->hasRight($db,'mgt_view_req',$args->tproject_id); - break; - - default: - // need to fail!! - break; - - } - } - return $hasRight; -} - - -/** - * - */ -function init_args() -{ - $args = new stdClass(); - $args->tprojectPrefix = isset($_GET['tprojectPrefix']) ? $_GET['tprojectPrefix'] : null; - $args->id = isset($_GET['id']) ? $_GET['id'] : null; - - $args->anchor = isset($_GET['anchor']) ? $_GET['anchor'] : null; - $args->version = isset($_GET['version']) ? $_GET['version'] : null; - $args->item = isset($_GET['item']) ? $_GET['item'] : null; - - - $args->status_ok = !is_null($args->tprojectPrefix) && !is_null($args->id) && !is_null($args->item); - if ($args->status_ok == false) { - // new try - // http:///linkto.php?testcase=KAOS-4 - $args->id = isset($_GET['testcase']) ? $_GET['testcase'] : null; - $args->testcase = $args->id; - $args->item = 'testcase'; - $glue = config_get('testcase_cfg')->glue_character; - $pieces = explode($glue,$args->testcase); - if (count($pieces) != 2) { - return $args->status_ok; - } - $args->tprojectPrefix = $pieces[0]; - $args->status_ok = !is_null($args->tprojectPrefix) && !is_null($args->id) && !is_null($args->item); - } - return $args; -} - -/** - * - */ -function buildLink(&$argsObj) -{ - - // link => $item . $id . $version . $tprojectPrefix . '&load' . $anchor; - $key2loop = [ - "item", - "id", - "version", - "tprojectPrefix", - "testcase", - "anchor" - ]; - $lk = 'load'; - foreach ($key2loop as $key) { - $value = ''; - if (isset($_GET[$key])) { - $value = $_GET[$key]; - } - if (property_exists($argsObj,$key)) { - $value = $argsObj->$key; - } - - if ($key == "tprojectPrefix" || $key == "testcase" || $key == "id" ) { - $value = urlencode($value); - } - $lk .= "&" . $key . "=" . $value; - - } - /* - $lk = isset($_GET['item']) ? "item=" . $_GET['item'] : ''; - $lk .= isset($_GET['id']) ? "&id=" . urlencode($_GET['id']) : ''; - $lk .= isset($_GET['version']) ? "&version=" . $_GET['version'] : ''; - $lk .= isset($_GET['tprojectPrefix']) ? "&tprojectPrefix=" . urlencode($_GET['tprojectPrefix']) : ''; - $lk .= isset($_GET['testcase']) ? "&testcase=" . urlencode($_GET['testcase']) : ''; - - $lk .= '&load' . (isset($_GET['anchor']) ? '&anchor=' . $_GET['anchor'] : ""); - */ - return $lk; -} - - - - -/** - * process_testcase - * - */ -function process_testcase(&$dbHandler,$externalID, $tprojectID, $tprojectPrefix, $version) -{ - $ret = array(); - $ret['url'] = null; - $ret['msg'] = sprintf(lang_get('testcase_not_found'), $externalID, $tprojectPrefix); - - $tcase_mgr = new testcase($dbHandler); - $tcaseID = $tcase_mgr->getInternalID($externalID); - if($tcaseID > 0) - { - $ret['url'] = "lib/testcases/archiveData.php?edit=testcase&id={$tcaseID}"; - $ret['msg'] = 'ok'; - - $ckCfg = config_get('cookie'); - $ckCfg->prefix .= 'ys-tproject_'; - $cookie = buildCookie($dbHandler,$tcaseID,$tprojectID,$ckCfg->prefix); - - $ckObj = new stdClass(); - $ckObj->name = $cookie['value']; - $ckObj->value = $cookie['path']; - tlSetCookie($ckObj); - } - - return $ret; -} - - -/** - * process_req - * - * @internal revisions - */ -function process_req(&$dbHandler, $docID, $tprojectID, $tprojectPrefix, $version) -{ - $ret = array('url' => null, 'msg' => null); - - // First step: get this requirement's database ID by its Doc-ID (only if this Doc-ID exists). - $req_mgr = new requirement_mgr($dbHandler); - $req = $req_mgr->getByDocID($docID, $tprojectID); - $req = is_null($req) ? null : current($req); - $req_id = is_null($req) ? null : $req['id']; - $version_id = null; - - if (is_null($req_id)) - { - $ret['msg'] = sprintf(lang_get('req_not_found'), $docID, $tprojectPrefix); - } - - // Second step: If the requirement exists and a version was given, we have to check here if this specific version exists, too. - if(!is_null($req_id) && !is_null($version) && is_numeric($version)) - { - $req = $req_mgr->get_by_id($req_id, null, $version); - $req = is_null($req) ? null : current($req); - - // does this requirement really have the correct version number? - $version_id = !is_null($req) && ($req['version'] == $version) ? $req['version_id'] : null; - - if (is_null($version_id)) - { - // add direct link to current version to output - $req_url = $_SESSION['basehref'] . 'linkto.php?load&tprojectPrefix=' . - urlencode($tprojectPrefix) . '&item=req&id=' . urlencode($docID); - $ret['msg'] = sprintf(lang_get('req_version_not_found'), $version, $docID, $tprojectPrefix); - $ret['msg'] .= sprintf(" %s", lang_get('direct_link_on_wrong_version')); - $req_id = null; - } - } - - // Third and last step: set cookie and build the link (only if the requested item really was found). - if(!is_null($req_id)) - { - $ret['url'] = "lib/requirements/reqView.php?item=requirement&requirement_id=$req_id"; - - // link to open in requirement frame must include version - if (!is_null($version_id)) - { - $ret['url'] .= "&req_version_id=$version_id"; - } - - $ckCfg = config_get('cookie'); - $ckCfg->prefix .= 'requirement_spec'; - $cookie = buildCookie($dbHandler,$req_id,$tprojectID,$ckCfg->prefix); - - $ckObj = new stdClass(); - $ckObj->name = $cookie['value']; - $ckObj->value = $cookie['path']; - tlSetCookie($ckObj); - } - - return $ret; -} - - - -/** - * process_reqspec - * - */ -function process_reqspec(&$dbHandler, $docID, $tprojectID, $tprojectPrefix, $version) -{ - $ret = array(); - $ret['url'] = null; - $ret['msg'] = sprintf(lang_get('req_spec_not_found'), $docID,$tprojectPrefix); - - $reqspec_mgr = new requirement_spec_mgr($dbHandler); - $reqSpec = $reqspec_mgr->getByDocID($docID,$tprojectID); - - if( !is_null($reqSpec) ) - { - $reqSpec = current($reqSpec); - $id = $reqSpec['id']; - $ret['url'] = "lib/requirements/reqSpecView.php?req_spec_id={$id}"; - - $ckCfg = config_get('cookie'); - $ckCfg->prefix .= 'ys-requirement_spec'; - $cookie = buildCookie($dbHandler,$id,$tprojectID,$ckCfg->prefix); - - $ckObj = new stdClass(); - $ckObj->name = $cookie['value']; - $ckObj->value = $cookie['path']; - tlSetCookie($ckObj); - } - return $ret; -} - - - -/** - * - * - */ -function buildCookie(&$dbHandler,$itemID,$tprojectID,$cookiePrefix) -{ - $tree_mgr = new tree($dbHandler); - $path = $tree_mgr->get_path($itemID); - $parents = array(); - $parents[] = $tprojectID; - foreach($path as $node) - { - $parents[] = $node['id']; - } - array_pop($parents); - $cookieInfo['path'] = 'a:s%3A/' . implode("/", $parents); - $cookieInfo['value'] = $cookiePrefix . $tprojectID . '_ext-comp-1001' ; - return $cookieInfo; -} - - -/** - * process_testsuite - * - * http://localhost/development/gitorious/testlink/linkto.php?tprojectPrefix=333&item=testsuite&id=2894 - - */ -function process_testsuite(&$dbHandler,$tsuiteID, $tprojectID, $tprojectPrefix) -{ - $ret = array(); - $ret['url'] = null; - $ret['msg'] = sprintf(lang_get('testsuite_not_found'), $tsuiteID, $tprojectPrefix); - - $ret['url'] = 'lib/testcases/archiveData.php?print_scope=test_specification' . - '&edit=testsuite&level=testsuite&containerType=testsuite&id=' . $tsuiteID; - - $ret['msg'] = 'ok'; - - $ckCfg = config_get('cookie'); - $ckCfg->prefix .= 'ys-tproject_'; - $cookie = buildCookie($dbHandler,$tsuiteID,$tprojectID,$ckCfg->prefix); - - $ckObj = new stdClass(); - $ckObj->name = $cookie['value']; - $ckObj->value = $cookie['path']; - tlSetCookie($ckObj); - - - return $ret; +/linkto.php?tprojectPrefix=KAOS&item=testcase&id=KAOS-4 + * http:///linkto.php?testcase=KAOS-4 + * + * + * - direct link to requirement REQ-002 in test project KAOS: + * http:///linkto.php?tprojectPrefix=KAOS&item=req&id=REQ-002 + * + * - direct link to requirement specification REQ-SPEC-AK89 in test project KAOS: + * http:///linkto.php?tprojectPrefix=KAOS&item=reqspec&id=REQ-SPEC-AK89 + * + * Anchors: + * If anchors are set (in scope, etc.) in the linked document, you can specify these + * by using &anchor=anchorname, e.g. + * http:///linkto.php?tprojectPrefix=KAOS&item=testcase&id=KAOS-4&anchor=importantpart + * + * Specials: + * - tree for requirement specification or test specification + * are expanded to the level of the item you created the link to + * - if a user has no right to view item he is redirected to main page + * - if item does not exist an errormessage shows + * + * @package TestLink + * @author asimon + * @copyright 2007-2023, TestLink community + * @link http://www.teamst.org/index.php + * + */ + +// use output buffer to prevent headers/data from being sent before +// cookies are set, else it will fail +ob_start(); + +// some session and settings stuff from original index.php +require_once 'lib/functions/configCheck.php'; +checkConfiguration(); +require_once 'config.inc.php'; +require_once 'common.php'; +require_once 'attachments.inc.php'; +require_once 'requirements.inc.php'; +require_once 'testcase.class.php'; +require_once 'testproject.class.php'; +require_once 'users.inc.php'; +testlinkInitPage($db, true); + +$smarty = new TLSmarty(); + +// display outer or inner frame? +if (! isset($_GET['load'])) { + // display outer frame, pass parameters to next script call for inner frame + // Direct link to testcase where TC ID prefix contains an '&' (the ampersand symbol), does not link + // + // ATTENTION: + // Because we are going to recreate an URL with paramenters on the URL, we need + // to use urlencode() on data we have got. + // + + $args = init_args(); + $args->tproject_id = 0; + if ($args->status_ok) { + $user = $_SESSION['currentUser']; + if ($args->tprojectPrefix != '') { + $hasRight = checkTestProject($db, $user, $args); + if ($hasRight) { + $gui = new stdClass(); + $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; + $gui->navbar_height = config_get('navbar_height'); + + if ($args->tproject_id > 0) { + $gui->titleframe .= '&testproject=' . $args->tproject_id; + } + $gui->title = lang_get('main_page_title'); + $gui->mainframe = 'linkto.php?' . buildLink($args); + $smarty->assign('gui', $gui); + $smarty->display('main.tpl'); + } + } + } +} else { + // inner frame, parameters passed + // figure out what to display + // + // key: item, value: url to tree management page + $itemCode = array( + 'req' => 'lib/requirements/reqSpecListTree.php', + 'reqspec' => 'lib/requirements/reqSpecListTree.php', + 'testcase' => 'lib/testcases/listTestCases.php?feature=edit_tc', + 'testsuite' => 'lib/testcases/listTestCases.php?feature=edit_tc' + ); + + $op = [ + 'status_ok' => true, + 'msg' => '' + ]; + + $args = init_args(); + if (! $args->status_ok) { + // key: key on _GET, value: labelID defined on strings.txt + $mustKeys = [ + 'tprojectPrefix' => 'testproject_not_set', + 'item' => 'item_not_set', + 'id' => 'id_not_set' + ]; + + foreach ($mustKeys as $key => $labelID) { + $op['status_ok'] = isset($_GET[$key]); + if (! $op['status_ok']) { + $op['msg'] = __FILE__ . ' >> ' . lang_get($labelID); + break; + } + } + } + + if ($op['status_ok']) { + $tproject = new testproject($db); + $tproject_data = $tproject->get_by_prefix($args->tprojectPrefix); + if ($op['status_ok'] = ! is_null($tproject_data)) { + $tproject->setSessionProject($tproject_data['id']); + $op['status_ok'] = isset($itemCode[$args->item]); + $op['msg'] = sprintf(lang_get('invalid_item'), $args->item); + } else { + $op['msg'] = sprintf(lang_get('testproject_not_found'), + $args->tprojectPrefix); + } + } + + if ($op['status_ok']) { + // Build name of function to call for doing the job. + $pfn = 'process_' . $args->item; + $jump_to = $pfn($db, $args->id, $tproject_data['id'], + $args->tprojectPrefix, $args->version); + $op['status_ok'] = ! is_null($jump_to['url']); + $op['msg'] = $jump_to['msg']; + } + + if ($op['status_ok']) { + // need to set test project item on Navbar + // add anchor to URL + $url = $jump_to['url'] . $args->anchor; + + $smarty->assign('title', lang_get('main_page_title')); + $smarty->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); + $smarty->assign('workframe', $url); + $smarty->assign('treeframe', $itemCode[$args->item]); + $smarty->display('frmInner.tpl'); + } else { + echo $op['msg']; + ob_end_flush(); + exit(); + } +} +ob_end_flush(); + +/** + */ +function checkTestProject(&$db, &$user, &$args) +{ + $hasRight = false; + $tproject_mgr = new testproject($db); + $item_info = $tproject_mgr->get_by_prefix($args->tprojectPrefix); + + if ($op['status_ok'] = ! is_null($item_info)) { + $args->tproject_id = intval($item_info['id']); + switch ($args->item) { + case 'testcase': + case 'testsuite': + $hasRight = $user->hasRight($db, 'mgt_view_tc', + $args->tproject_id); + break; + + case 'req': + case 'reqspec': + $hasRight = $user->hasRight($db, 'mgt_view_req', + $args->tproject_id); + break; + + default: + // need to fail!! + break; + } + } + return $hasRight; +} + +/** + */ +function init_args() +{ + $args = new stdClass(); + $args->tprojectPrefix = isset($_GET['tprojectPrefix']) ? $_GET['tprojectPrefix'] : null; + $args->id = isset($_GET['id']) ? $_GET['id'] : null; + + $args->anchor = isset($_GET['anchor']) ? $_GET['anchor'] : null; + $args->version = isset($_GET['version']) ? $_GET['version'] : null; + $args->item = isset($_GET['item']) ? $_GET['item'] : null; + + $args->status_ok = ! is_null($args->tprojectPrefix) && ! is_null($args->id) && + ! is_null($args->item); + if (! $args->status_ok) { + // new try + // http:///linkto.php?testcase=KAOS-4 + $args->id = isset($_GET['testcase']) ? $_GET['testcase'] : null; + $args->testcase = $args->id; + $args->item = 'testcase'; + $glue = config_get('testcase_cfg')->glue_character; + $pieces = explode($glue, $args->testcase); + if (count($pieces) != 2) { + return $args->status_ok; + } + $args->tprojectPrefix = $pieces[0]; + $args->status_ok = ! is_null($args->tprojectPrefix) && + ! is_null($args->id) && ! is_null($args->item); + } + return $args; +} + +/** + */ +function buildLink(&$argsObj) +{ + + // link => $item . $id . $version . $tprojectPrefix . '&load' . $anchor; + $key2loop = [ + "item", + "id", + "version", + "tprojectPrefix", + "testcase", + "anchor" + ]; + $lk = 'load'; + foreach ($key2loop as $key) { + $value = ''; + if (isset($_GET[$key])) { + $value = $_GET[$key]; + } + if (property_exists($argsObj, $key)) { + $value = $argsObj->$key; + } + + if ($key == "tprojectPrefix" || $key == "testcase" || $key == "id") { + $value = urlencode($value); + } + $lk .= "&" . $key . "=" . $value; + } + + return $lk; +} + +/** + * process_testcase + */ +function process_testcase(&$dbHandler, $externalID, $tprojectID, $tprojectPrefix, + $version) +{ + $ret = array(); + $ret['url'] = null; + $ret['msg'] = sprintf(lang_get('testcase_not_found'), $externalID, + $tprojectPrefix); + + $tcaseMgr = new testcase($dbHandler); + $tcaseID = $tcaseMgr->getInternalID($externalID); + if ($tcaseID > 0) { + $ret['url'] = "lib/testcases/archiveData.php?edit=testcase&id={$tcaseID}"; + $ret['msg'] = 'ok'; + + $ckCfg = config_get('cookie'); + $ckCfg->prefix .= 'ys-tproject_'; + $cookie = buildCookie($dbHandler, $tcaseID, $tprojectID, $ckCfg->prefix); + + $ckObj = new stdClass(); + $ckObj->name = $cookie['value']; + $ckObj->value = $cookie['path']; + tlSetCookie($ckObj); + } + + return $ret; +} + +/** + * process_req + * + * @internal revisions + */ +function process_req(&$dbHandler, $docID, $tprojectID, $tprojectPrefix, $version) +{ + $ret = array( + 'url' => null, + 'msg' => null + ); + + // First step: get this requirement's database ID by its Doc-ID (only if this Doc-ID exists). + $req_mgr = new requirement_mgr($dbHandler); + $req = $req_mgr->getByDocID($docID, $tprojectID); + $req = is_null($req) ? null : current($req); + $req_id = is_null($req) ? null : $req['id']; + $version_id = null; + + if (is_null($req_id)) { + $ret['msg'] = sprintf(lang_get('req_not_found'), $docID, $tprojectPrefix); + } + + // Second step: If the requirement exists and a version was given, we have to check here if this specific version exists, too. + if (! is_null($req_id) && ! is_null($version) && is_numeric($version)) { + $req = $req_mgr->get_by_id($req_id, null, $version); + $req = is_null($req) ? null : current($req); + + // does this requirement really have the correct version number? + $version_id = ! is_null($req) && ($req['version'] == $version) ? $req['version_id'] : null; + + if (is_null($version_id)) { + // add direct link to current version to output + $req_url = $_SESSION['basehref'] . 'linkto.php?load&tprojectPrefix=' . + urlencode($tprojectPrefix) . '&item=req&id=' . urlencode($docID); + $ret['msg'] = sprintf(lang_get('req_version_not_found'), $version, + $docID, $tprojectPrefix); + $ret['msg'] .= sprintf(" %s", + lang_get('direct_link_on_wrong_version')); + $req_id = null; + } + } + + // Third and last step: set cookie and build the link (only if the requested item really was found). + if (! is_null($req_id)) { + $ret['url'] = "lib/requirements/reqView.php?item=requirement&requirement_id=$req_id"; + + // link to open in requirement frame must include version + if (! is_null($version_id)) { + $ret['url'] .= "&req_version_id=$version_id"; + } + + $ckCfg = config_get('cookie'); + $ckCfg->prefix .= 'requirement_spec'; + $cookie = buildCookie($dbHandler, $req_id, $tprojectID, $ckCfg->prefix); + + $ckObj = new stdClass(); + $ckObj->name = $cookie['value']; + $ckObj->value = $cookie['path']; + tlSetCookie($ckObj); + } + + return $ret; +} + +/** + * process_reqspec + */ +function process_reqspec(&$dbHandler, $docID, $tprojectID, $tprojectPrefix, + $version) +{ + $ret = array(); + $ret['url'] = null; + $ret['msg'] = sprintf(lang_get('req_spec_not_found'), $docID, + $tprojectPrefix); + + $reqspec_mgr = new requirement_spec_mgr($dbHandler); + $reqSpec = $reqspec_mgr->getByDocID($docID, $tprojectID); + + if (! is_null($reqSpec)) { + $reqSpec = current($reqSpec); + $id = $reqSpec['id']; + $ret['url'] = "lib/requirements/reqSpecView.php?req_spec_id={$id}"; + + $ckCfg = config_get('cookie'); + $ckCfg->prefix .= 'ys-requirement_spec'; + $cookie = buildCookie($dbHandler, $id, $tprojectID, $ckCfg->prefix); + + $ckObj = new stdClass(); + $ckObj->name = $cookie['value']; + $ckObj->value = $cookie['path']; + tlSetCookie($ckObj); + } + return $ret; +} + +/** + */ +function buildCookie(&$dbHandler, $itemID, $tprojectID, $cookiePrefix) +{ + $tree_mgr = new tree($dbHandler); + $path = $tree_mgr->get_path($itemID); + $parents = array(); + $parents[] = $tprojectID; + foreach ($path as $node) { + $parents[] = $node['id']; + } + array_pop($parents); + $cookieInfo['path'] = 'a:s%3A/' . implode("/", $parents); + $cookieInfo['value'] = $cookiePrefix . $tprojectID . '_ext-comp-1001'; + return $cookieInfo; +} + +/** + * process_testsuite + * + * http://localhost/development/gitorious/testlink/linkto.php?tprojectPrefix=333&item=testsuite&id=2894 + */ +function process_testsuite(&$dbHandler, $tsuiteID, $tprojectID, $tprojectPrefix) +{ + $ret = array(); + $ret['url'] = null; + $ret['msg'] = sprintf(lang_get('testsuite_not_found'), $tsuiteID, + $tprojectPrefix); + + $ret['url'] = 'lib/testcases/archiveData.php?print_scope=test_specification' . + '&edit=testsuite&level=testsuite&containerType=testsuite&id=' . $tsuiteID; + + $ret['msg'] = 'ok'; + + $ckCfg = config_get('cookie'); + $ckCfg->prefix .= 'ys-tproject_'; + $cookie = buildCookie($dbHandler, $tsuiteID, $tprojectID, $ckCfg->prefix); + + $ckObj = new stdClass(); + $ckObj->name = $cookie['value']; + $ckObj->value = $cookie['path']; + tlSetCookie($ckObj); + + return $ret; } diff --git a/lnl.php b/lnl.php index d74a7f3056..fbbc6b8e48 100644 --- a/lnl.php +++ b/lnl.php @@ -1,269 +1,296 @@ -light) { - case 'red': - // can not find user or item - break; - - case 'green': - $reportCfg = config_get('reports_list'); - $what2launch = null; - $cfg = isset($reportCfg[$args->type]) ? $reportCfg[$args->type] : null; - - switch($args->type) { - case 'exec': - $what2launch = "lib/execute/execPrint.php" . - "?id={$args->id}&apikey=$args->apikey"; - break; - - case 'file': - $what2launch = "lib/attachments/attachmentdownload.php" . - "?id={$args->id}&apikey=$args->apikey"; - break; - - case 'metricsdashboard': - $what2launch = "lib/results/metricsDashboard.php?apikey=$args->apikey"; - break; - - case 'test_report': - $param = "&type={$args->type}&level=testproject" . - "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&header=y&summary=y&toc=y&body=y&passfail=y&cfields=y&metrics=y&author=y" . - "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . FORMAT_HTML; - $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; - break; - - case 'testreport_onbuild': - $param = "&type={$args->type}&level=testproject" . - "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}&build_id={$args->build_id}" . - "&header=y&summary=y&toc=y&body=y&passfail=y&cfields=y&metrics=y&author=y" . - "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . FORMAT_HTML; - $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; - break; - - case 'test_plan': - $param = "&type={$args->type}&level=testproject" . - "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&header=y&summary=y&toc=y&body=y&passfail=n&cfields=y&metrics=y&author=y" . - "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . FORMAT_HTML; - $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; - break; - - case 'testspec': - $param = "&type={$args->type}&level=testproject&id={$args->tproject_id}" . - "&tproject_id={$args->tproject_id}" . - "&header=y&summary=y&toc=y&body=y&cfields=y&author=y". - "&requirement=y&keyword=y&headerNumbering=y&format=" . FORMAT_HTML; - $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; - break; - - - case 'metrics_tp_general': - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&format=" . FORMAT_HTML; - $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; - break; - - case 'list_tc_failed': - case 'list_tc_blocked': - case 'list_tc_not_run': - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&format={$args->format}"; - $what2launch = $cfg['url'] ."&apikey=$args->apikey{$param}"; - break; - - case 'results_matrix'; - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&format={$args->format}"; - $what2launch = $cfg['url'] ."?apikey=$args->apikey{$param}"; - break; - - - case 'results_by_tester_per_build'; - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}&format=" . FORMAT_HTML; - $what2launch = $cfg['url'] ."?apikey=$args->apikey{$param}"; - break; - - case 'charts_basic': - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}&format=" . FORMAT_HTML; - $what2launch = $cfg['url'] ."?apikey=$args->apikey{$param}"; - break; - - case 'abslatest_results_matrix'; - $param = "&tproject_id={$args->tproject_id}" . - "&tplan_id={$args->tplan_id}" . - "&format={$args->format}"; - $what2launch = $cfg['url'] ."?apikey=$args->apikey{$param}"; - break; - - case 'report_exec_timeline'; - $param = "&tproject_id={$args->tproject_id}" . - "&tplan_id={$args->tplan_id}" . - "&format={$args->format}"; - $what2launch = $cfg['url'] ."?apikey=$args->apikey{$param}"; - break; - - default: - $needle = 'list_tc_'; - $nl = strlen($needle); - if(strpos($key,$needle) !== FALSE) { - $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . - "&format={$args->format}"; - $what2launch = $cfg['url'] ."&apikey=$args->apikey{$param}"; - } else { - - $awl = config_get('accessWithoutLogin'); - if( !isset($awl[$args->type]) ) { - echo 'ABORTING - UNKNOWN TYPE:' . $args->type; - die(); - } - - $conf = $awl[$args->type]; - $param = ""; - foreach($args->use as $prop => $useIt) { - $param .= "&$prop={$args->$prop}"; - } - $what2launch = $conf['url'] ."&apikey=$args->apikey{$param}"; - } - break; - } - - if(!is_null($what2launch)) { - // changed to be able to get XLS file using wget - // redirect(TL_BASE_HREF . $what2launch); - //echo $what2launch; - //die(); - header('Location:' . TL_BASE_HREF . $what2launch); - exit(); - } - break; - - default: - // ?? - break; -} - - - -/** - * - */ -function init_args(&$dbHandler) { - - $_REQUEST = strings_stripSlashes($_REQUEST); - $args = new stdClass(); - - try { - // ATTENTION - give a look to $tlCfg->reports_list - // format domain: see reports.cfg.php FORMAT_* - $typeSize = 30; - $userAPIkeyLen = 32; - $objectAPIkeyLen = 64; - - $iParams = array("apikey" => array(tlInputParameter::STRING_N, - $userAPIkeyLen,$objectAPIkeyLen), - "tproject_id" => array(tlInputParameter::INT_N), - "tplan_id" => array(tlInputParameter::INT_N), - "build_id" => array(tlInputParameter::INT_N), - "level" => array(tlInputParameter::STRING_N,0,16), - "type" => array(tlInputParameter::STRING_N,0,$typeSize), - 'id' => array(tlInputParameter::INT_N), - 'format' => array(tlInputParameter::STRING_N,0,1), - 'entities' => array(tlInputParameter::STRING_N,0,3)); - } catch (Exception $e) { - echo $e->getMessage(); - exit(); - } - - R_PARAMS($iParams,$args); - - $args->format = intval($args->format); - $args->format = ($args->format <= 0) ? FORMAT_HTML : $args->format; - - $args->envCheckMode = $args->type == 'file' ? 'hippie' : 'paranoic'; - $args->light = 'red'; - $opt = array('setPaths' => true,'clearSession' => true); - - // what to use when is custom - $masks = array('tproject_id' => 1, 'tplan_id' => 2, 'build_id' => 4); - $args->use = $masks; - foreach($masks as $kx => $mm) { - $args->use[$kx] = (($args->entities & $mm) > 0); - } - - // validate apikey to avoid SQL injection - $args->apikey = trim($args->apikey); - $akl = strlen($args->apikey); - - switch($akl) { - case $userAPIkeyLen: - case $objectAPIkeyLen: - break; - - default: - throw new Exception("Aborting - Bad API Key lenght", 1); - break; - } - - if($akl == $userAPIkeyLen) { - $args->debug = 'USER-APIKEY'; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,null,$opt); - $user = tlUser::getByAPIKey($dbHandler,$args->apikey); - $args->light = (count($user) == 1) ? 'green' : 'red'; - } else { - if(is_null($args->type) || trim($args->type) == '') { - throw new Exception("Aborting - Bad type", 1); - } - - if($args->type == 'exec') { - $tex = DB_TABLE_PREFIX . 'executions'; - $sql = "SELECT testplan_id FROM $tex WHERE id=" . intval($args->id); - $rs = $dbHandler->get_recordset($sql); - - if( is_null($rs) ) { - die(__FILE__ . '-' . __LINE__); - } - - $rs = $rs[0]; - $tpl = DB_TABLE_PREFIX . 'testplans'; - $sql = "SELECT api_key FROM $tpl WHERE id=" . intval($rs['testplan_id']); - $rs = $dbHandler->get_recordset($sql); - if( is_null($rs) ) { - die(__FILE__ . '-' . __LINE__); - } - $rs = $rs[0]; - $args->apikey = $rs['api_key']; - $args->envCheckMode = 'hippie'; - } - - $args->debug = 'OBJECT-APIKEY'; - $kerberos = new stdClass(); - $kerberos->args = $args; - $kerberos->method = null; - - if( setUpEnvForAnonymousAccess($dbHandler,$args->apikey,$kerberos,$opt) ) { - $args->light = 'green'; - } - } - return $args; +light) { + case 'red': + // can not find user or item + break; + + case 'green': + $reportCfg = config_get('reports_list'); + $what2launch = null; + $cfg = isset($reportCfg[$args->type]) ? $reportCfg[$args->type] : null; + + switch ($args->type) { + case 'exec': + $what2launch = "lib/execute/execPrint.php" . + "?id={$args->id}&apikey=$args->apikey"; + break; + + case 'file': + $what2launch = "lib/attachments/attachmentdownload.php" . + "?id={$args->id}&apikey=$args->apikey"; + break; + + case 'metricsdashboard': + $what2launch = "lib/results/metricsDashboard.php?apikey=$args->apikey"; + break; + + case 'test_report': + $param = "&type={$args->type}&level=testproject" . + "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&header=y&summary=y&toc=y&body=y&passfail=y&cfields=y&metrics=y&author=y" . + "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . + FORMAT_HTML; + $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; + break; + + case 'testreport_onbuild': + $param = "&type={$args->type}&level=testproject" . + "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}&build_id={$args->build_id}" . + "&header=y&summary=y&toc=y&body=y&passfail=y&cfields=y&metrics=y&author=y" . + "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . + FORMAT_HTML; + $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; + break; + + case 'test_plan': + $param = "&type={$args->type}&level=testproject" . + "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&header=y&summary=y&toc=y&body=y&passfail=n&cfields=y&metrics=y&author=y" . + "&requirement=y&keyword=y¬es=y&headerNumbering=y&format=" . + FORMAT_HTML; + $what2launch = "lib/results/printDocument.php?apikey=$args->apikey{$param}"; + break; + + case 'testspec': + $param = "&type={$args->type}&level=testproject&id={$args->tproject_id}" . + "&tproject_id={$args->tproject_id}" . + "&header=y&summary=y&toc=y&body=y&cfields=y&author=y" . + "&requirement=y&keyword=y&headerNumbering=y&format=" . + FORMAT_HTML; + $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; + break; + + case 'metrics_tp_general': + $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&format=" . FORMAT_HTML; + $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; + break; + + case 'list_tc_failed': + case 'list_tc_blocked': + case 'list_tc_not_run': + $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&format={$args->format}"; + $what2launch = $cfg['url'] . "&apikey=$args->apikey{$param}"; + break; + + case 'results_matrix': + $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&format={$args->format}"; + $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; + break; + + case 'results_by_tester_per_build': + case 'charts_basic': + $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}&format=" . + FORMAT_HTML; + $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; + break; + + case 'abslatest_results_matrix': + case 'report_exec_timeline': + $param = "&tproject_id={$args->tproject_id}" . + "&tplan_id={$args->tplan_id}" . "&format={$args->format}"; + $what2launch = $cfg['url'] . "?apikey=$args->apikey{$param}"; + break; + + default: + $needle = 'list_tc_'; + $nl = strlen($needle); + if (strpos($key, $needle) !== false) { + $param = "&tproject_id={$args->tproject_id}&tplan_id={$args->tplan_id}" . + "&format={$args->format}"; + $what2launch = $cfg['url'] . "&apikey=$args->apikey{$param}"; + } else { + + $awl = config_get('accessWithoutLogin'); + if (! isset($awl[$args->type])) { + echo 'ABORTING - UNKNOWN TYPE:' . $args->type; + die(); + } + + $conf = $awl[$args->type]; + $param = ""; + foreach ($args->use as $prop => $useIt) { + $param .= "&$prop={$args->$prop}"; + } + $what2launch = $conf['url'] . "&apikey=$args->apikey{$param}"; + } + break; + } + + if (! is_null($what2launch)) { + // changed to be able to get XLS file using wget + // redirect(TL_BASE_HREF . $what2launch); + // echo $what2launch; + // die(); + header('Location:' . TL_BASE_HREF . $what2launch); + exit(); + } + break; + + default: + // ?? + break; +} + +/** + */ +function init_args(&$dbHandler) +{ + $_REQUEST = strings_stripSlashes($_REQUEST); + $args = new stdClass(); + + try { + // ATTENTION - give a look to $tlCfg->reports_list + // format domain: see reports.cfg.php FORMAT_* + $typeSize = 30; + $userAPIkeyLen = 32; + $objectAPIkeyLen = 64; + + $iParams = array( + "apikey" => array( + tlInputParameter::STRING_N, + $userAPIkeyLen, + $objectAPIkeyLen + ), + "tproject_id" => array( + tlInputParameter::INT_N + ), + "tplan_id" => array( + tlInputParameter::INT_N + ), + "build_id" => array( + tlInputParameter::INT_N + ), + "level" => array( + tlInputParameter::STRING_N, + 0, + 16 + ), + "type" => array( + tlInputParameter::STRING_N, + 0, + $typeSize + ), + 'id' => array( + tlInputParameter::INT_N + ), + 'format' => array( + tlInputParameter::STRING_N, + 0, + 1 + ), + 'entities' => array( + tlInputParameter::STRING_N, + 0, + 3 + ) + ); + } catch (Exception $e) { + echo $e->getMessage(); + exit(); + } + + R_PARAMS($iParams, $args); + + $args->format = intval($args->format); + $args->format = ($args->format <= 0) ? FORMAT_HTML : $args->format; + + $args->envCheckMode = $args->type == 'file' ? 'hippie' : 'paranoic'; + $args->light = 'red'; + $opt = array( + 'setPaths' => true, + 'clearSession' => true + ); + + // what to use when is custom + $masks = array( + 'tproject_id' => 1, + 'tplan_id' => 2, + 'build_id' => 4 + ); + $args->use = $masks; + foreach ($masks as $kx => $mm) { + $args->use[$kx] = (($args->entities & $mm) > 0); + } + + // validate apikey to avoid SQL injection + $args->apikey = trim($args->apikey); + $akl = strlen($args->apikey); + + switch ($akl) { + case $userAPIkeyLen: + case $objectAPIkeyLen: + break; + + default: + throw new Exception("Aborting - Bad API Key lenght", 1); + break; + } + + if ($akl == $userAPIkeyLen) { + $args->debug = 'USER-APIKEY'; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, null, $opt); + $user = tlUser::getByAPIKey($dbHandler, $args->apikey); + $args->light = (count($user) == 1) ? 'green' : 'red'; + } else { + if (is_null($args->type) || trim($args->type) == '') { + throw new Exception("Aborting - Bad type", 1); + } + + if ($args->type == 'exec') { + $tex = DB_TABLE_PREFIX . 'executions'; + $sql = "SELECT testplan_id FROM $tex WHERE id=" . intval($args->id); + $rs = $dbHandler->get_recordset($sql); + + if (is_null($rs)) { + die(__FILE__ . '-' . __LINE__); + } + + $rs = $rs[0]; + $tpl = DB_TABLE_PREFIX . 'testplans'; + $sql = "SELECT api_key FROM $tpl WHERE id=" . + intval($rs['testplan_id']); + $rs = $dbHandler->get_recordset($sql); + if (is_null($rs)) { + die(__FILE__ . '-' . __LINE__); + } + $rs = $rs[0]; + $args->apikey = $rs['api_key']; + $args->envCheckMode = 'hippie'; + } + + $args->debug = 'OBJECT-APIKEY'; + $kerberos = new stdClass(); + $kerberos->args = $args; + $kerberos->method = null; + + if (setUpEnvForAnonymousAccess($dbHandler, $args->apikey, $kerberos, + $opt)) { + $args->light = 'green'; + } + } + return $args; } diff --git a/locale/cs_CZ/description.php b/locale/cs_CZ/description.php index 6ca232640e..d8b7715f70 100644 --- a/locale/cs_CZ/description.php +++ b/locale/cs_CZ/description.php @@ -1,56 +1,56 @@ -Možnosti vytvoÅ™ení dokumentu

    Tato tabulka umožnuje uživatelům zvolit testovací případy, které mají být zobrazeny. Pouze zvolené testovací sady budou zobrazeny dle požadovaného obsahu. Pokud budete chtít zmÄ›nit obsah nebo zvolit jinou -testovací sadu, proveÄte zmÄ›nu obsahu Äásti navigace, popřípadÄ› zvolte ze stromové struktury jinou +testovací sadu, proveÄte zmÄ›nu obsahu Äásti navigace, popřípadÄ› zvolte ze stromové struktury jinou testovací sadu.

    -

    HlaviÄka dokumentu: Uživatelé mohou zvolit, které informace budou zobrazeny v hlaviÄce dokumentu. -Informace v hlaviÄce dokumentu mohou obsahovat: Úvod, Obsah, Odkazy, +

    HlaviÄka dokumentu: Uživatelé mohou zvolit, které informace budou zobrazeny v hlaviÄce dokumentu. +Informace v hlaviÄce dokumentu mohou obsahovat: Úvod, Obsah, Odkazy, Metodologii testování a omezení testů.

    Detaily testovacího případu: Uživatelé mohou zvolit, které informace budou zobrazeny v popisu testovacích případů. Informace v popisu testovacích případů mohou obsahovat: pÅ™ehled o testovacím případu, kroky testovacího skriptu, oÄekávané výsledky a klíÄová slova.

    StruÄný obsah testovacího případu: Uživatelé nemohou vypnout zobrazení shrnutí testovacího případu, pokud se rozhodli zobrazit jeho detail, -jelikož je standartnÄ› jeho souÄástí. Pokud nebude vybrán k zobrazení detail testovacího případu, bude umožnÄ›no zobrazení pouze jeho shrnutí v případné +jelikož je standartnÄ› jeho souÄástí. Pokud nebude vybrán k zobrazení detail testovacího případu, bude umožnÄ›no zobrazení pouze jeho shrnutí v případné kombinaci s dalšími možnostmi.

    Možnosti rejstříku obsahu: Pokud je zvoleno uživatelem, TestLink vloží do rejstřiku obsahu seznam všech názvů testovacích připadů s interním hypertextovým odkazem.

    -

    Výstupní formát: Můžete zvolit ze dvou možností: HTML nebo MS Word. V druhém případÄ› Váš prohlížeÄ spustí komponentu MS wordu.

    "; - -// testPlan.html +

    Výstupní formát: Můžete zvolit ze dvou možností: HTML nebo MS Word. V druhém případÄ› Váš prohlížeÄ spustí komponentu MS wordu.

    "; + +// testPlan.html $TLS_hlp_testPlan = "

    Testovací Plán

    Obecný popis

    @@ -58,20 +58,20 @@ do přísluÅ¡ných sestavení produktu v daném Äase a sledování jeho výsledků.

    Provádění testů

    -

    Tato sekce umožňuje uživatelům provádět testovací případy (zapsat jejich výsledek) a +

    Tato sekce umožňuje uživatelům provádět testovací případy (zapsat jejich výsledek) a případně vytisknout si testovací sadu z aktuálního testovacího plánu. V této sekci mohou uživatelé také sledovat výsledky -prováděných testovacích případů.

    +prováděných testovacích případů.

    Správa testovacích plánů

    -

    Tato sekce, dostupná pouze uživatelům v roli 'Vedoucí', umožňuje spravovat testovací plány. +

    Tato sekce, dostupná pouze uživatelům v roli 'Vedoucí', umožňuje spravovat testovací plány. Správa testovacích plánů zahrnuje jejich vytváření, mazání, nebo úpravu. Dále přidávání, mazání, nebo úpravu testovacích připadů v rámci testovacího plánu, vytváření sestavení, nebo nastavení oprávnění přístupu k plánu.
    -Uživatelé v roli 'Vedoucí' mohou také nastavovat prioritu/rizika a vlastnictví pro sady testovacích případů nebo vytvářet testovací milníky.

    - -

    UpozornÄ›ní: Je možné, že uživatelé nemusí mít dostupný seznam testovacích plánů. -V tomto případÄ› budou odkazy v úvodním oknÄ› nefunkÄní (neplatí pro uživatele s oprávnÄ›ním 'Vedoucí' nebo vyšší). Pokud se -dostanete do takovéto situace, kontaktujte uživatele s rolí 'Vedoucí' popřípadÄ› 'Administrátor', který vám nastaví oprávnÄ›ní, nebo pro Vás vytvoří testovací plán.

    "; +Uživatelé v roli 'Vedoucí' mohou také nastavovat prioritu/rizika a vlastnictví pro sady testovacích případů nebo vytvářet testovací milníky.

    -// custom_fields.html +

    UpozornÄ›ní: Je možné, že uživatelé nemusí mít dostupný seznam testovacích plánů. +V tomto případÄ› budou odkazy v úvodním oknÄ› nefunkÄní (neplatí pro uživatele s oprávnÄ›ním 'Vedoucí' nebo vyšší). Pokud se +dostanete do takovéto situace, kontaktujte uživatele s rolí 'Vedoucí' popřípadÄ› 'Administrátor', který vám nastaví oprávnÄ›ní, nebo pro Vás vytvoří testovací plán.

    "; + +// custom_fields.html $TLS_hlp_customFields = "

    Uživatelská pole

    Fakta o možnostech využití uživatelských polí:

      @@ -88,7 +88,7 @@
    • Jméno uživatelského pole
    • Název popisku promÄ›nné (například: Tato hodnota je pÅ™edána funkci lang_get() API , nebo zobrazena v případÄ›, že pro ni neexistuje pÅ™eklad).
    • Typ uživatelského pole (Å™etÄ›zec, celé Äíslo, desetiné Äíslo, výÄet, email)
    • -
    • VýÄet možných hodnot (například: ÄŒERVENÃ|ŽLUTÃ|MODRÃ), vztahuje se k seznamu s možností vícenásobného výbÄ›ru, +
    • VýÄet možných hodnot (například: ÄŒERVENÃ|ŽLUTÃ|MODRÃ), vztahuje se k seznamu s možností vícenásobného výbÄ›ru, nebo rozbalovacímu seznamu.
      Použijte oddÄ›lovací znak ('|') pro oddÄ›lení položek ve výÄtu možností. Prázdný Å™etÄ›zec může být použit jako jedna z položek ve výÄtu.
    • @@ -106,14 +106,14 @@
    • Povolí uživatelské pole pro zobrazení a editaci v rámci návrhu testovaciho plánu.. Uživatel může mÄ›nit hodnotu uživatelského pole pÅ™i návrhu testovacího plánu. (pÅ™iÅ™azení testovacích případů do testovacího plánu)
    • Dostupné pro: Uživatel zvolí k jaké komponentÄ› Testlinku se pole vztahuje.
    -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

    Provádění testovacích případů

    Umožňuje uživatelům 'provádÄ›t' testovací případy. Samotné provedení testovacího pÅ™ipadu v ramci aplikace Testlink spoÄívá v nastavení jeho stavu (úspěšný, neúspěšný, ...).

    -

    Aplikace Testlink umožňuje přístup do nástrojů pro správu chyb (závisí na konfiguraci). Uživatelé pak mohou k testovacím případům přiřadit chyby a sledovat jejich stav.

    "; - -//bug_add.html +

    Aplikace Testlink umožňuje přístup do nástrojů pro správu chyb (závisí na konfiguraci). Uživatelé pak mohou k testovacím případům přiřadit chyby a sledovat jejich stav.

    "; + +// bug_add.html $TLS_hlp_btsIntegration = "

    Přiřazení chyby k testovacímu případu

    (pouze v případě, že je nastaveno propojení s nástrojem pro správu chyb) TestLink poskytuje jednoduchou integraci s nástroji pro správu chyb (BTS). Neumožňuje však vložit chybu v rámci aplikace Testlink do BTS ani automatické předávaní ID chyby mezi BTS a Testlink. @@ -122,7 +122,7 @@

  • Vložit novou chybu.
  • Zobrazit informace o již existující chybÄ›.
  • -

    +

    Postup pro vložení chyby

    @@ -131,95 +131,92 @@

  • Krok 2: poznamenejte si ID chyby v rámci BTS.
  • Krok 3: napiÅ¡te ID chyby do vstupního pole v Testlinku.
  • Krok 4: použijte tlaÄítko PÅ™idat chybu.
  • - + Po uzavÅ™ení stránky 'PÅ™idat chybu' uvidíte informace o chybÄ› navázané na testovací případ, pro který byla chyba pÅ™idána. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Nastavení sestavení a filtrů pro zobrazení výsledků provedení testů

    -

    Levý ovládací panel se skládá ze seznamu testovacích případů navázaných na aktuální " . -"testovací plán a tabulku s možnostmi nastavení a filtrování. Tyto filtry umožňují uživateli " . -"omezit nabízenou sadu testovacích případů pÅ™ed tím, než budou provedeny." . -"Nastavte filtr, stisknÄ›te tlaÄítko \"Použít\" a zvolte přísluÅ¡ný testovací případ " . -"z menu.

    +

    Levý ovládací panel se skládá ze seznamu testovacích případů navázaných na aktuální " . + "testovací plán a tabulku s možnostmi nastavení a filtrování. Tyto filtry umožňují uživateli " . + "omezit nabízenou sadu testovacích případů pÅ™ed tím, než budou provedeny." . + "Nastavte filtr, stisknÄ›te tlaÄítko \"Použít\" a zvolte přísluÅ¡ný testovací případ " . + "z menu.

    Sestavení

    -

    Uživatelé musí zvolit, pro které sestavení se jim budou výsledky zobrazovat. " . -"Sestavení jsou základní komponentou pro aktuální testovací plán. Každý testovací případ " . -"může být v rámci jednoho sestavení proveden vícekrát. Pro filtrování ale bude použit pouze poslední výsledek. +

    Uživatelé musí zvolit, pro které sestavení se jim budou výsledky zobrazovat. " . + "Sestavení jsou základní komponentou pro aktuální testovací plán. Každý testovací případ " . + "může být v rámci jednoho sestavení proveden vícekrát. Pro filtrování ale bude použit pouze poslední výsledek.
    Sestavení mohou být vytvořena uživateli s rolí 'Vedoucí' nebo vyšší na stránce Správa sestavení.

    Filtrování dle ID testovacího případu

    -

    Uživatelé mohou filtrovat testovací případy podle jejich unikátního oznaÄení (ID). Toto ID je automaticky generováno pÅ™i vytváření testovacího případu. Pokud bude vstupní pole u filtru ID prázdné, nebude tento filtr aplikován.

    +

    Uživatelé mohou filtrovat testovací případy podle jejich unikátního oznaÄení (ID). Toto ID je automaticky generováno pÅ™i vytváření testovacího případu. Pokud bude vstupní pole u filtru ID prázdné, nebude tento filtr aplikován.

    Filtrování dle priority

    -

    Uživatelé mohou filtrovat testovací případy dle jejich priority. Důležitost každého testovacího případu ve zvoleném testovacím plánu je kombinována s jeho urgentností. Například testovací případ s prioritou 'Vysoká' " . -"je zobrazen v případÄ›, že důležitost je nastavena na úroveň VYSOKà a urgentnost je nastavena na úroveň STŘEDNÃ, popřípadÄ› obrácenÄ›.

    +

    Uživatelé mohou filtrovat testovací případy dle jejich priority. Důležitost každého testovacího případu ve zvoleném testovacím plánu je kombinována s jeho urgentností. Například testovací případ s prioritou 'Vysoká' " . + "je zobrazen v případÄ›, že důležitost je nastavena na úroveň VYSOKà a urgentnost je nastavena na úroveň STŘEDNÃ, popřípadÄ› obrácenÄ›.

    Filtrování dle výsledků

    -

    Uživatelé mohou filtrovat testovací případy dle jejich výsledků. Výsledkem se myslí stav testovacího případu ve zvoleném sestavení. Testovací případ může být například ve stavu: úspěšný, neúspěšný, blokován, nebo neproveden." . -"Tento filtr je standartně vypnut.

    +

    Uživatelé mohou filtrovat testovací případy dle jejich výsledků. Výsledkem se myslí stav testovacího případu ve zvoleném sestavení. Testovací případ může být například ve stavu: úspěšný, neúspěšný, blokován, nebo neproveden." . + "Tento filtr je standartně vypnut.

    Uživatelské filtry

    -

    Uživatelé mohou filtrovat testovací případy dle jim přiřazeného uživatele. Do výsledků je také možné zahrnout " . -"\"nepřiřazené\" testovací případy zaškrtnutím příslušného pole.

    "; -/* -

    Most Current Result

    -

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted -by the build that is chosen from the dropdown box. In this state the tree will display -the test cases status. -
    Example: User selects build 2 from the dropdown box and doesn't check the 'most -current' checkbox. All test cases will be shown with their status from build 2. -So, if test case 1 passed in build 2 it will be colored green. -
    If the user decideds to check the 'most current' checkbox the tree will be -colored by the test cases most recent result. -
    Ex: User selects build 2 from the dropdown box and this time checks -the 'most current' checkbox. All test cases will be shown with most current -status. So, if test case 1 passed in build 3, even though the user has also selected -build 2, it will be colored green.

    - */ - - -// newest_tcversions.html +

    Uživatelé mohou filtrovat testovací případy dle jim přiřazeného uživatele. Do výsledků je také možné zahrnout " . + "\"nepřiřazené\" testovací případy zaškrtnutím příslušného pole.

    "; +/* + *

    Most Current Result

    + *

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted + * by the build that is chosen from the dropdown box. In this state the tree will display + * the test cases status. + *
    Example: User selects build 2 from the dropdown box and doesn't check the 'most + * current' checkbox. All test cases will be shown with their status from build 2. + * So, if test case 1 passed in build 2 it will be colored green. + *
    If the user decideds to check the 'most current' checkbox the tree will be + * colored by the test cases most recent result. + *
    Ex: User selects build 2 from the dropdown box and this time checks + * the 'most current' checkbox. All test cases will be shown with most current + * status. So, if test case 1 passed in build 3, even though the user has also selected + * build 2, it will be colored green.

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Nejnovější verze testovacích případů v aktuálním testovacím plánu

    -

    Všechny testovací případy navázané do testovacího plánu budou analyzovány a zobrazí se seznam testovacích případů, které jsou dostupné v novější verzi.

    "; - - -// requirementsCoverage.html +

    Všechny testovací případy navázané do testovacího plánu budou analyzovány a zobrazí se seznam testovacích případů, které jsou dostupné v novější verzi.

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Pokrytí požadavků


    Tato funkÄnost umožnuje mapovat pokrytí testovacích případů uživateli nebo specifikacemi požadavků. K této funkÄnosti se dostanete odkazem \"Specifikace požadavků\" na úvodní obrazovce.

    Specifikace požadavků

    -

    Požadavky jsou uspořádány v rámci dokumentu specifikace požadavků, který je definována v rámci +

    Požadavky jsou uspořádány v rámci dokumentu specifikace požadavků, který je definována v rámci testovacího projektu.
    TestLink nepodporuje verzování dokumentu specifikace požadavků ani samotných požadavků. Verze dokumentu nebo požadavků by tak měla být zaznamenána v jejich názvu. -Uživatel může také připadně přidat popis nebo poznámku v rámci jejich b>obsahu
    .

    +Uživatel může také připadně přidat popis nebo poznámku v rámci jejich b>obsahu
    .

    -

    PoÄet importovaných požadavků slouží pro vyhodnocení pokrytí požadavků v případÄ›, že nÄ›které z požadavků nebyly pÅ™idány (importovány). -Hodnota 0 vyjadÅ™uje aktuální poÄet požadavků zahrnutých do metrik.

    +

    PoÄet importovaných požadavků slouží pro vyhodnocení pokrytí požadavků v případÄ›, že nÄ›které z požadavků nebyly pÅ™idány (importovány). +Hodnota 0 vyjadÅ™uje aktuální poÄet požadavků zahrnutých do metrik.

    Například SRS obsahuje 200 požadavků, ale pouze 50 je jich přidano do testlinku. Pokrytí testy je pak z 25% (za předpokladu, že budou všechny přidané požadavky zahrnuty do testování).

    Požadavky

    KliknÄ›te na jméno vytvoÅ™eného dokumentu specifikace požadavků. Pro dokument pak můžete vytvářet, upravovat, mazat, nebo importovat požadavky. Každý požadavek má jméno, specifikaci a stav. -Stav může být \"Normální\" or \"Netestovatelné\". Netestovatelné požadavky nejsou zahrnuty do výpoÄtu metrik. Tento parametr může být použit pro neimplementované prvky i pro Å¡patnÄ› definované požadavky.

    +Stav může být \"Normální\" or \"Netestovatelné\". Netestovatelné požadavky nejsou zahrnuty do výpoÄtu metrik. Tento parametr může být použit pro neimplementované prvky i pro Å¡patnÄ› definované požadavky.

    -

    Můžete vytvořit nové testovací případy přímo na stránce specifikace požadavků pro vybrané požadavky použitím automatické funkce. Tyto testovací případy budou vytvořeny v testovací sadě, jejíž jméno je definováno konfigurací Testlinku (standartní nastavení je: $tlCfg->req_cfg->default_testsuite_name = +

    Můžete vytvořit nové testovací případy přímo na stránce specifikace požadavků pro vybrané požadavky použitím automatické funkce. Tyto testovací případy budou vytvořeny v testovací sadě, jejíž jméno je definováno konfigurací Testlinku (standartní nastavení je: $tlCfg->req_cfg->default_testsuite_name = 'Test suite created by Requirement - Auto';). Titulek a obsah jsou zkopírovány do těchto testovacích případů.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Možnost 'Uložit uživatelská pole'

    Pokud nadefinujete a přiřadite uživatelská pole do testovacího projektu s nastavením:
    'Zobrazit v testovacím plánu=ano' a
    'Povolit v testovacím plánu=ano'
    budou tyto pole dostupné POUZE pro testovací případy navázané do testovacího plánu. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/cs_CZ/texts.php b/locale/cs_CZ/texts.php index 258cf2e29e..191dda8637 100644 --- a/locale/cs_CZ/texts.php +++ b/locale/cs_CZ/texts.php @@ -1,92 +1,90 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ - -//If this file is coded in UTF-8 then enable the following line -$TLS_STRINGFILE_CHARSET = "UTF-8"; - -$TLS_htmltext_title['assignReqs'] = "Přiřazení požadavků k testovacím případům"; -$TLS_htmltext['assignReqs'] = "

    ÚÄel

    -

    Uživatel může nastavit pÅ™iÅ™azení mezi požadavky a testovacími případy. PÅ™iÅ™azení může být definováno jako vazba 0..n až 0..n. tzn. Jeden požadavek může být pÅ™iÅ™azen k žádnému, jednomu, popřípadÄ› k více testovacím případům a naopak. Tato pÅ™iÅ™azení pomáhají zjistit pokrytí požadavků testovacími případy -a k urÄení testovacích případů, jejichž provádÄ›ní nebylo dokonÄeno z důvodu chyby. +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ + +// If this file is coded in UTF-8 then enable the following line +$TLS_STRINGFILE_CHARSET = "UTF-8"; + +$TLS_htmltext_title['assignReqs'] = "PÅ™iÅ™azení požadavků k testovacím případům"; +$TLS_htmltext['assignReqs'] = "

    ÚÄel

    +

    Uživatel může nastavit pÅ™iÅ™azení mezi požadavky a testovacími případy. PÅ™iÅ™azení může být definováno jako vazba 0..n až 0..n. tzn. Jeden požadavek může být pÅ™iÅ™azen k žádnému, jednomu, popřípadÄ› k více testovacím případům a naopak. Tato pÅ™iÅ™azení pomáhají zjistit pokrytí požadavků testovacími případy +a k urÄení testovacích případů, jejichž provádÄ›ní nebylo dokonÄeno z důvodu chyby. Tyto informace pak mohou sloužit jako podklad pro další plánování testů.

    Jak na to

      -
    1. Vyberte testovací případ ze stromové struktury v navigaÄním panelu na levé stranÄ›. Rozbalovací seznam s dokumenty specifikace +
    2. Vyberte testovací případ ze stromové struktury v navigaÄním panelu na levé stranÄ›. Rozbalovací seznam s dokumenty specifikace požadavků bude zobrazen v horní Äasti pracovní plochy
    3. -
    4. V případě, že je dostupno více dokumentů se specifikacemi požadavků, zvolte jeden z nich. +
    5. V případě, že je dostupno více dokumentů se specifikacemi požadavků, zvolte jeden z nich. TestLink automaticky obnoví obsah stránky.
    6. Ve stÅ™ední Äásti pracovní plochy se zobrazí vÅ¡echny požadavky (ze zvoleného dokumentu se specifikacemi požadavků), které jsou již k testovacímu případu pÅ™iÅ™azeny. Ve spodní Äásti 'Dostupné požadavky' se zobrazí vÅ¡echny - požadavky, které k testovacímu případu - pÅ™iÅ™azeny nejsou. Uživatel může oznaÄit požadavky, které se vztahují ke zvolenému testovacímu případu + požadavky, které k testovacímu případu + pÅ™iÅ™azeny nejsou. Uživatel může oznaÄit požadavky, které se vztahují ke zvolenému testovacímu případu a stisknout tlaÄítko 'PÅ™iÅ™adit'. OznaÄené požadavky se poté zobrazí ve stÅ™ední Äasti pracovní plochy 'PÅ™iÅ™azené požadavky'.
    7. -
    "; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Specifikace testů"; -$TLS_htmltext['editTc'] = "

    ÚÄel

    -

    Specifikace testovacích případů umožňuje uživatelům zobrazení a úpravu všech existujících " . - "testovacích sad a testovacích případů. Testovací případy jsou verzovány a všechny " . - "předcházející verze jsou zde dostupné. Je možné je zobrazit a dále s nimi pracovat.

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Specifikace testů"; +$TLS_htmltext['editTc'] = "

    ÚÄel

    +

    Specifikace testovacích případů umožňuje uživatelům zobrazení a úpravu všech existujících " . + "testovacích sad a testovacích případů. Testovací případy jsou verzovány a všechny " . + "předcházející verze jsou zde dostupné. Je možné je zobrazit a dále s nimi pracovat.

    Jak na to

      -
    1. Zvolte testovací projekt ze stromové struktury v navigaÄním panelu na levé stranÄ› (hlavní uzel stromové struktury). Poznámka: " . - "ZmÄ›nu aktivního testovacího projektu můžete kdykoliv provést pomocí rozbalovacího " . - "seznamu v pravém horním rohu.
    2. -
    3. Kliknutím na tlaÄítko Nová navázaná testovací sada vytvoÅ™te novou testovací sadu. Testovací sady Vám pomohou" . - "vytvoÅ™it strukturu vaÅ¡ich testovacích dokumentů dle VaÅ¡ich zvyklostí (funkÄní/nefunkÄní " . - "testy, komponenty produktu nebo funkÄnosti, zmÄ›nové požadavky, apod.). Popis " . - "testovací sady by mÄ›l obsahovat popis obsahu vložených testovacích případů, základní nastavení, " . - "odkazy na související dokumentaci, popis omezení popřípadÄ› dalších užiteÄných informací v rámci testovací sady. ObecnÄ› definováno, " . - "vÅ¡echny poznámky, které se vztahují k testovacím případům pÅ™iÅ™azených do popisovaných testovacích sad. Testovací sady vycházejí z " . - "filozofie adresářů. V rámci aktuálního testovacího projektu tak mohou mezi nimi uživatelé pÅ™esunovat nebo kopírovat testovací případy, popřípadÄ› samotné testovací sady. " . - ". Testovací sady mohou být také importovány, nebo exportovány (vÄetnÄ› testovacích případů, které obsahují).
    4. " . - "
    5. V panelu navigace zvolte ve stromové struktuÅ™e vytvoÅ™enou testovací sadu a stisknutím " . - "tlaÄítka VytvoÅ™it testovací případ vytvoÅ™te nový testovací případ. Testovací případ popisuje " . - "scénář testu, oÄekávané výsledky a obsah uživatelsky definovaných polí " . - " (další informace jsou dostupné v uživatelském manuálu). Pro zvýšení pÅ™ehledu " . - "je možné pÅ™iÅ™adit k testovacímu případu klíÄová slova.
    6. -
    7. Testovací případy můžete procházet a editovat za pomoci stromové struktury navigaÄního panelu na levé stranÄ› obrazovky. Pro každý testovací případ +
    8. Zvolte testovací projekt ze stromové struktury v navigaÄním panelu na levé stranÄ› (hlavní uzel stromové struktury). Poznámka: " . + "ZmÄ›nu aktivního testovacího projektu můžete kdykoliv provést pomocí rozbalovacího " . + "seznamu v pravém horním rohu.
    9. +
    10. Kliknutím na tlaÄítko Nová navázaná testovací sada vytvoÅ™te novou testovací sadu. Testovací sady Vám pomohou" . + "vytvoÅ™it strukturu vaÅ¡ich testovacích dokumentů dle VaÅ¡ich zvyklostí (funkÄní/nefunkÄní " . + "testy, komponenty produktu nebo funkÄnosti, zmÄ›nové požadavky, apod.). Popis " . + "testovací sady by mÄ›l obsahovat popis obsahu vložených testovacích případů, základní nastavení, " . + "odkazy na související dokumentaci, popis omezení popřípadÄ› dalších užiteÄných informací v rámci testovací sady. ObecnÄ› definováno, " . + "vÅ¡echny poznámky, které se vztahují k testovacím případům pÅ™iÅ™azených do popisovaných testovacích sad. Testovací sady vycházejí z " . + "filozofie adresářů. V rámci aktuálního testovacího projektu tak mohou mezi nimi uživatelé pÅ™esunovat nebo kopírovat testovací případy, popřípadÄ› samotné testovací sady. " . + ". Testovací sady mohou být také importovány, nebo exportovány (vÄetnÄ› testovacích případů, které obsahují).
    11. " . + "
    12. V panelu navigace zvolte ve stromové struktuÅ™e vytvoÅ™enou testovací sadu a stisknutím " . + "tlaÄítka VytvoÅ™it testovací případ vytvoÅ™te nový testovací případ. Testovací případ popisuje " . + "scénář testu, oÄekávané výsledky a obsah uživatelsky definovaných polí " . + " (další informace jsou dostupné v uživatelském manuálu). Pro zvýšení pÅ™ehledu " . + "je možné pÅ™iÅ™adit k testovacímu případu klíÄová slova.
    13. +
    14. Testovací případy můžete procházet a editovat za pomoci stromové struktury navigaÄního panelu na levé stranÄ› obrazovky. Pro každý testovací případ se ukládá jeho historie.
    15. Po dokonÄení definice testovacích případů, pÅ™iÅ™aÄte testovací sadu do požadovaného testovacího plánu.
    -

    V Testlinku jsou testovací případy organizovány za pomoci testovacích sad." . -"Testovací sady mohou být vnoÅ™ené v jiných testovacích sadách a je tak umožnÄ›no vytvářet si strukturu testovacích sad. - Informace o struktuÅ™e testovacich sad mohou být vytiÅ¡tÄ›ny spoleÄnÄ› s testovacími případy.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Vyhledávání testovacích případů"; -$TLS_htmltext['searchTc'] = "

    ÚÄel

    +

    V Testlinku jsou testovací případy organizovány za pomoci testovacích sad." . + "Testovací sady mohou být vnoÅ™ené v jiných testovacích sadách a je tak umožnÄ›no vytvářet si strukturu testovacích sad. + Informace o struktuÅ™e testovacich sad mohou být vytiÅ¡tÄ›ny spoleÄnÄ› s testovacími případy.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Vyhledávání testovacích případů"; +$TLS_htmltext['searchTc'] = "

    ÚÄel

    Vyhledání testovacích případů v závislosti na klíÄových slovech a/nebo zadaných textových Å™etÄ›zců. Vyhledávání nerozliÅ¡uje velká/malá písmena. Výsledky vyhledávání budou obsahovat pouze testovací případy z aktuálního testovacího projektu.

    @@ -97,12 +95,11 @@
  • Zvolte požadované klíÄové slovo, popřípadÄ› hodnotu 'Nepoužito', pokud nechcete podle klíÄového slova vyhledávat.
  • StisknÄ›te tlaÄítko 'Vyhledat'.
  • VÅ¡echny testovací případy, které odpovídají parametrům vyhledávání budou zobrazeny. Testovací případy mohou být následnÄ› editovány, pokud využijete odkazu v názvu testovacího případu.
  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "VytiÅ¡tÄ›ní specifikace testů"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    ÚÄel

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Vytištění specifikace testů"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    ÚÄel

    Uživatel zde může vytisknout jednotlivé testovací případy, všechny testovací případy v testovací sadě, nebo všechny testovací případy v projektu.

    Jak na to

      @@ -114,12 +111,11 @@
    1. Pro vytisknutí zobrazených informací využijte možnosti tisku vaÅ¡eho prohlížeÄe.
      Upozornění: Ujistěte se, že jste pro tisk zvolili pravý rámec HTML stránky.

    2. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Návrh specifikace požadavků"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    V této sekci můžete spravovat dokumenty specifikací požadavků.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Návrh specifikace požadavků"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    V této sekci můžete spravovat dokumenty specifikací požadavků.

    Specifikace požadavků

    @@ -134,18 +130,17 @@

    Požadavky

    -

    KliknÄ›te na jméno dokumentu specifikace požadavků. Pokud zatím nebyl dokument specifikace vytvoÅ™en, kliknÄ›te na projekt ve stromové struktuÅ™e navigaÄního panelu, +

    KliknÄ›te na jméno dokumentu specifikace požadavků. Pokud zatím nebyl dokument specifikace vytvoÅ™en, kliknÄ›te na projekt ve stromové struktuÅ™e navigaÄního panelu, a dokument specifikace požadavků vytvoÅ™te. Pro dokument pak můžete vytvářet, upravovat, mazat, nebo importovat požadavky. Každý požadavek má jméno, specifikaci a stav. Stav může být nastaven na \"Normalní\" nebo \"Netestovatelné\". Netestovatelné požadavky nejsou zahrnuty do výpoÄtu metrik. Tento parametr může být použit pro neimplementované prvky i pro Å¡patnÄ› specifikované požadavky.

    -

    Můžete vytvořit nové testovací případy přímo na stránce specifikace požadavků pro vybrané požadavky použitím automatické funkce. Testovací případy budou vytvořeny v testovací sadě, jejíž jméno je definováno konfigurací Testlinku (standartní nastavení je: $tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Titulek a obsah jsou zkopírovány do těchto testovacích případů.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "PÅ™iÅ™azení klíÄových slov"; -$TLS_htmltext['keywordsAssign'] = "

    ÚÄel

    -

    Na stránce pÅ™iÅ™azení klíÄových slov si mohou uživatelé dávkovÄ› pÅ™iÅ™adit k existující +

    Můžete vytvořit nové testovací případy přímo na stránce specifikace požadavků pro vybrané požadavky použitím automatické funkce. Testovací případy budou vytvořeny v testovací sadě, jejíž jméno je definováno konfigurací Testlinku (standartní nastavení je: $tlCfg->req_cfg->default_testsuite_name = +'Test suite created by Requirement - Auto';). Titulek a obsah jsou zkopírovány do těchto testovacích případů.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "PÅ™iÅ™azení klíÄových slov"; +$TLS_htmltext['keywordsAssign'] = "

    ÚÄel

    +

    Na stránce pÅ™iÅ™azení klíÄových slov si mohou uživatelé dávkovÄ› pÅ™iÅ™adit k existující testovací sadÄ› nebo testovacímu případu klíÄové slova

    Jak na to

    @@ -158,19 +153,18 @@

    Důležité informace ohlednÄ› pÅ™iÅ™azení kliÄových slov k testovacímu plánu

    PÅ™iÅ™azená klíÄová slova k definici testovacích případů se projeví v testovacích plánech pouze a jen v případÄ›, že testovací plán obsahuje poslední verzi testovacích případů. Pokud testovací plán obsahuje starší verze testovacích případů, pÅ™iÅ™azení klíÄových slov se v nÄ›m NEPROJEVÃ.

    -

    TestLink používá tento postup k tomu, aby starší verze testovacích případů v testovacím plánu nebyly dotÄeny pÅ™iÅ™azením, které provedete nad -jejich novÄ›jšími verzemi. Pokud budete chtít provést aktualizaci testovacích případů ve vaÅ¡em testovacím plánu, -proveÄte PŘED pÅ™iÅ™azením klíÄových slov nejdříve kontrolu testovacích případů za -pomoci funkce 'Aktualizovat upravené testovací případy'.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Provedení testovacího případu"; -$TLS_htmltext['executeTest'] = "

    ÚÄel

    - -

    Umožňuje uživatelům provádět testovací případy. Uživatel může v rámci aktuálního sestavení nastavit -výsledek testu. Pro více informací o nastavení a možnostech filtrovaní se podívejte do nápovědy " . - "(klikněte na ikonu otazníku).

    +

    TestLink používá tento postup k tomu, aby starší verze testovacích případů v testovacím plánu nebyly dotÄeny pÅ™iÅ™azením, které provedete nad +jejich novÄ›jšími verzemi. Pokud budete chtít provést aktualizaci testovacích případů ve vaÅ¡em testovacím plánu, +proveÄte PŘED pÅ™iÅ™azením klíÄových slov nejdříve kontrolu testovacích případů za +pomoci funkce 'Aktualizovat upravené testovací případy'.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Provedení testovacího případu"; +$TLS_htmltext['executeTest'] = "

    ÚÄel

    + +

    Umožňuje uživatelům provádět testovací případy. Uživatel může v rámci aktuálního sestavení nastavit +výsledek testu. Pro více informací o nastavení a možnostech filtrovaní se podívejte do nápovědy " . + "(klikněte na ikonu otazníku).

    Jak na to

    @@ -181,13 +175,13 @@
  • Vyplňte výsledky pro testovací případ spoleÄnÄ› s jakýmikoliv poznámkami, nebo nalezenými chybami.
  • Uložte výsledky.
  • -

    Poznámka: TestLink musí být nastaven na spolupráci s vaším nástrojem pro správu chyb, -pokud chcete vytvořit nebo sledovat stav chyby přímo z prostředí Testlinku.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Popis testovacích přehledů a metrik"; -$TLS_htmltext['showMetrics'] = "

    PÅ™ehledy se vztahují k testovacímu projektu " . - "(nastavenému v horní Äásti navigaÄního panelu). Testovací projekt nastavený pro generování pÅ™ehledů se může liÅ¡it +

    Poznámka: TestLink musí být nastaven na spolupráci s vaším nástrojem pro správu chyb, +pokud chcete vytvořit nebo sledovat stav chyby přímo z prostředí Testlinku.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Popis testovacích přehledů a metrik"; +$TLS_htmltext['showMetrics'] = "

    PÅ™ehledy se vztahují k testovacímu projektu " . + "(nastavenému v horní Äásti navigaÄního panelu). Testovací projekt nastavený pro generování pÅ™ehledů se může liÅ¡it od aktuálnÄ› zvoleného testovacího plánu pro provádÄ›ní testů. Pro pÅ™ehled můžete zvolit formát ve které bude vygenerován:

    • Normal - pÅ™ehled je zobrazen v prohlížeÄi
    • @@ -206,11 +200,11 @@

      'Poslední výsledek testu' je výraz použitý v mnoha přehledech, jeho význam je následující:

        -
      • Podle poÅ™adí, ve kterém jsou sestavení pÅ™idána do testovacího plánu, se stanoví které sestavení je poslední aktuální. Výsledky +
      • Podle poÅ™adí, ve kterém jsou sestavení pÅ™idána do testovacího plánu, se stanoví které sestavení je poslední aktuální. Výsledky z posledního aktuálního sestavení budou nadÅ™azené nad výsledky starších sestavení. Například, pokud oznaÄíte testovací případ jako 'Neúspěšný' v sestavení 1, a dále ho oznaÄíte jako 'úspěšný' v sestavení 2, bude posledním výsledkem 'úspěšný'.
      • Pokud je testovací případ proveden v rámci jednoho sestavení vícekrát, poslední aktuální provedení bude -nadÅ™azeno vÅ¡em ostatním provedením v sestavení. Například, pokud je sestavení 3 použito ve vaÅ¡em týmu, tester 1 oznaÄí testovací případ jako +nadÅ™azeno vÅ¡em ostatním provedením v sestavení. Například, pokud je sestavení 3 použito ve vaÅ¡em týmu, tester 1 oznaÄí testovací případ jako 'úspěšný' ve dvÄ› hodiny a tester 2 ho oznaÄí jako 'neúspěšný' ve tÅ™i hodiny, bude zobrazen jako 'neúspěšný'.
      • Testovací případy zobrazené jako 'nespuÅ¡tÄ›né' v rámci sestavení se neberou v úvahu. Například, pokud oznaÄíte testovací případ jako 'úspěšný' v sestavení 1, nebudete ho provádÄ›t v sestavení 2, bude jeho poslední výsledek oznaÄen jako 'úspěšný'.
      • @@ -236,32 +230,32 @@

        Parametrizovaný přehled

        Tento pÅ™ehled je složen ze stránky pro nastavení parametrů pÅ™ehledu a stránky, která zobrazí výsledky na základÄ› nastavených parametrů. Stránka s nastavením parametrů obsahuje parametry, které můžete použít k řízení obsahu pÅ™ehledu, který bude zobrazen. VÅ¡echny parametry mají základní -nastavení, které maximalizuje poÄet testovacích případů a sestavení, ze kterých bude pÅ™ehled sestaven. ZmÄ›nou parametrů může uživatel filtrovat -výsledky a tím vygenerovat specifický pÅ™ehled dle kombinace vlastníka testovacích případů, klíÄového slova, +nastavení, které maximalizuje poÄet testovacích případů a sestavení, ze kterých bude pÅ™ehled sestaven. ZmÄ›nou parametrů může uživatel filtrovat +výsledky a tím vygenerovat specifický pÅ™ehled dle kombinace vlastníka testovacích případů, klíÄového slova, testovacích sad, nebo sestavení.

          -
        • KlíÄové slovo Může být vybráno maximalnÄ› jedno klíÄové slovo. StandartnÄ› není vybráno žádné klíÄové slovo. Pokud není +
        • KlíÄové slovo Může být vybráno maximalnÄ› jedno klíÄové slovo. StandartnÄ› není vybráno žádné klíÄové slovo. Pokud není zvoleno klíÄové slovo, nebude se brát na klíÄová slova a jejich pÅ™iÅ™azení ve vyhodnocení ohled. KlíÄová slova můžete pÅ™iÅ™adit -na stránce správy klíÄových slov nebo specifikace testů. KlíÄová slova jsou pÅ™iÅ™azená k testovacím případům pro vÅ¡echny jejich verze +na stránce správy klíÄových slov nebo specifikace testů. KlíÄová slova jsou pÅ™iÅ™azená k testovacím případům pro vÅ¡echny jejich verze a vÅ¡echny testovací plány. Pokud Vás zajímají pouze testovací případy pro specifické klíÄové slovo, nastavte adekvátnÄ› tento parametr.
        • Vlastník testovacích případů Může být vybrán maximalnÄ› jeden vlastník. StandartnÄ› není vybrán žádný vlastník. Pokud není -vlastník vybrán, nebude se brát na pÅ™iÅ™azení vlastníka k testovacím případům a jeho vyhodnocení ohled. AktuálnÄ› není možné -vyhledávat 'nepÅ™iÅ™azené' testovací případy. Vlastníky pro zvolený testovací plán je možné pÅ™iÅ™adit na stránce 'PÅ™iÅ™azení provedení -testovacího případu'. Pokud Vás zajímají pouze testovací případy provedené urÄitým testerem, +vlastník vybrán, nebude se brát na pÅ™iÅ™azení vlastníka k testovacím případům a jeho vyhodnocení ohled. AktuálnÄ› není možné +vyhledávat 'nepÅ™iÅ™azené' testovací případy. Vlastníky pro zvolený testovací plán je možné pÅ™iÅ™adit na stránce 'PÅ™iÅ™azení provedení +testovacího případu'. Pokud Vás zajímají pouze testovací případy provedené urÄitým testerem, nastavte adekvátnÄ› tento parametr.
        • Testovací sada Vybráno může být více testovacích sad najednou. StandartnÄ› jsou vybrány vÅ¡echny testovací sady. -Pouze data z vybraných testovacích sad budou použity v pÅ™ehledu. Pokud Vás zajímají pouze výsledky pro specifickou testovací sadu(y) +Pouze data z vybraných testovacích sad budou použity v pÅ™ehledu. Pokud Vás zajímají pouze výsledky pro specifickou testovací sadu(y) nastavte adekvátnÄ› tento parametr.
        • Sestavení Vybráno může být jedno nebo více sestavení. StandartnÄ› jsou vybrány vÅ¡echna sestavení. Pouze provedení testovacích -případů z vybraných sestavení budou použity v pÅ™ehledu. Například, pokud chcete zobrazit kolik testovacích případů bylo provedeno +případů z vybraných sestavení budou použity v pÅ™ehledu. Například, pokud chcete zobrazit kolik testovacích případů bylo provedeno v posledních tÅ™ech sestavení, adektvátnÄ› nastavte tento parametr. -Kombinace vybraného klíÄového slova, vlastníka testovacích případů a testovacích sad má přímou souvislost s testovacími případy z vybraného +Kombinace vybraného klíÄového slova, vlastníka testovacích případů a testovacích sad má přímou souvislost s testovacími případy z vybraného testovacího plánu, které budou použity pro výpoÄet metrik v rámci testovací sady a testovacího plánu. Například, pokud vyberete pÅ™iÅ™azen = 'Greg', klíÄové slovo='Priorita 1', a vÅ¡echny dostupné testovací sady, budou v rámci pÅ™ehledu zobrazeny pouze testovací případy -s prioritou 1 a s vlastníkem Greg. Celkový poÄet testovacích případů zobrazený v pÅ™ehledu '# Testovacích případů' bude ovlivnÄ›no tÄ›mito -parametry. VýbÄ›r sestavení může ovlivňit zda bude testovací případ považován za 'úspěšný', 'neúspěšný', 'blokovaný', nebo 'neprovedený'. Pro +s prioritou 1 a s vlastníkem Greg. Celkový poÄet testovacích případů zobrazený v pÅ™ehledu '# Testovacích případů' bude ovlivnÄ›no tÄ›mito +parametry. VýbÄ›r sestavení může ovlivňit zda bude testovací případ považován za 'úspěšný', 'neúspěšný', 'blokovaný', nebo 'neprovedený'. Pro další informace se podívejte na definici výrazu 'Poslední výsledek testu'.

        StisknÄ›te tlaÄítko 'Odeslat' pro odeslání dotazu a zobrazení stránky s výsledkem.

        @@ -271,54 +265,53 @@
      • Parametry použité pÅ™i výbÄ›ru dat pro pÅ™ehled
      • Celkové souÄty za celý testovací plán
      • Rozpad jednotlivých testovacích sad na celkové souÄty (# Testovacích případů / úspěšné / neúspěšné / blokované / neprovedené) a seznam -provedení testovacích případů v dané testovací sadÄ›. Pokud byl testovací případ proveden vícekrát v nÄ›kolika sestavení, budou zobrazena +provedení testovacích případů v dané testovací sadÄ›. Pokud byl testovací případ proveden vícekrát v nÄ›kolika sestavení, budou zobrazena vÅ¡echna provedení pro zvolené sestavení. Celkové souÄty vÅ¡ak budou pro zvolené sestavení a testovací sady zahrnovat pouze 'Poslední výsledek testů'.
      • PÅ™ehledy blokovaných, neúspěšných a neprovedených testů

        Tyto přehledy zobrazují všechny aktuálně blokované, neúspěšné nebo neprovedené testovací případy. 'Poslední výsledek testu' -výraz (který byl popsán v popisu Celkového přehledu testovacího plánu) je opět použit ke stanovení, zda +výraz (který byl popsán v popisu Celkového přehledu testovacího plánu) je opět použit ke stanovení, zda může být testovací případ považován za blokovaný, neúspěšný, nebo neprovedený. V případě, že je testlink konfigurován pro použití s nástrojem pro správu chyb, budou chyby zobrazeny v přehledech blokovaných a neúspěšných testovacích případů.

        Testovací přehled

        -

        Zobrazí stav každého testovacího případu pro každé sestavení. V případě, že byl v rámci jednoho sestavení proveden testovací případ vícekrát, +

        Zobrazí stav každého testovacího případu pro každé sestavení. V případÄ›, že byl v rámci jednoho sestavení proveden testovací případ vícekrát, poslední aktuální výsledek provedení bude zobrazen. Pokud pracujete s velkým poÄtem údajů, doporuÄuje se exportovat tento pÅ™ehled do formátu MS Excel pro jeho snažší využití.

        Grafy - Celkový přehled testovacího plánu

        -

        'Poslední výsledek testu' je výraz, který je použit pro vÅ¡echny ÄtyÅ™i zobrazené grafy. Pro usnadnÄ›ní vizualizace metrik aktuálního +

        'Poslední výsledek testu' je výraz, který je použit pro vÅ¡echny ÄtyÅ™i zobrazené grafy. Pro usnadnÄ›ní vizualizace metrik aktuálního testovacího plánu jsou grafy animovány. Následující ÄtyÅ™i grafy budou zobrazeny :

        • KoláÄový graf s celkovým poÄtem úspěšných / neúspěšných / blokovaných / a neprovedených testovacích případů
        • Sloupce grafu s výsledky dle klíÄového slovav
        • Sloupce grafu s výsledky dle vlastníka testovacích případů
        • Sloupce grafu s výsledky dle hlavní testovací sady
        -

        Sloupce v grafech jsou barevnÄ› rozliÅ¡eny, aby mohl uživatel rozliÅ¡it pÅ™ibližný poÄet +

        Sloupce v grafech jsou barevnÄ› rozliÅ¡eny, aby mohl uživatel rozliÅ¡it pÅ™ibližný poÄet úspěšných, neúspěšných, blokovaných a neprovedených testovacích případů.

        Stránka tohoto pÅ™ehledu vyžaduje, aby mÄ›l Váš prohlížeÄ nainstalováno flash rozšíření (http://www.maani.us), aby byly výsledky zobrazeny v grafické podobÄ›.

        Celkový poÄet chyb pro každý testovací případ

        Tento přehled zobrazuje každý testovací případ, ke kterému jsou přiřazeny jakékoliv chyby v rámci celého testovacího projektu. -Tento přehled je dostupný pouze v případě, že je připojen nástroj pro správu chyb.

        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Přidat / Odebrat testovací případy v rámci testovacího plánu"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

        ÚÄel

        +Tento přehled je dostupný pouze v případě, že je připojen nástroj pro správu chyb.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Přidat / Odebrat testovací případy v rámci testovacího plánu"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

        ÚÄel

        Umožňuje uživatelům (v roli 'Vedoucí' nebo vyšší) přidávat nebo odebírat testovací případy v rámci aktuálního testovacího plánu.

        Jak na to

        1. Klikněte na testovací sadu pro zobrazení všech jejich vnořených testovacích sad a k nim přiřazených testovacích případů.
        2. -
        3. Po zvolení vybraných testovacích případů kliknÄ›te na tlaÄítko 'PÅ™idat / Odebrat testovací případ' pro jejich pÅ™idání nebo odebrání. +
        4. Po zvolení vybraných testovacích případů kliknÄ›te na tlaÄítko 'PÅ™idat / Odebrat testovací případ' pro jejich pÅ™idání nebo odebrání. Poznámka: Do testovací sady není možné pÅ™idat testovací případy, které již obsahuje.
        5. -
        "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Přiřazení uživatelů k provádění testů"; -$TLS_htmltext['tc_exec_assignment'] = "

        ÚÄel

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Přiřazení uživatelů k provádění testů"; +$TLS_htmltext['tc_exec_assignment'] = "

        ÚÄel

        Tato stránka umožňuje vedoucím testů přiřadit uživatele ke konkrétnímu testu v rámci testovacího plánu.

        Jak na to

        @@ -327,16 +320,15 @@
      • Vyberte uživatele k pÅ™iÅ™azení.
      • StisknÄ›te tlaÄítko pro potvrzení pÅ™iÅ™azení.
      • OtevÅ™ete stránku provedení testovacích případů pro ověření pÅ™iÅ™azení. Můžete využít nastavení filtru na uživatele.
      • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Aktualizace testovacích případů v testovacím plánu."; -$TLS_htmltext['planUpdateTC'] = "

        ÚÄel

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Aktualizace testovacích případů v testovacím plánu."; +$TLS_htmltext['planUpdateTC'] = "

        ÚÄel

        Tato stránka umožňuje aktualizovat testovací případ na novÄ›jší (nebo jinou než aktuální) verzi v případÄ›, že se specifikace -testovacího případu zmÄ›nila. ÄŒasto se stává, že se bÄ›hem testování zmÄ›ní definice funkÄnosti." . - " Uživatel zmÄ›ní specifikaci testovacího případu, která je poté potÅ™eba také zpropagovat do testovacího plánu. V opaÄném případÄ›" . - " bude testovací plán obsahovat původní verzi testovacího případu, aby se zajistila konzistence verze testovacího případu a jeho výsledku.

        +testovacího případu zmÄ›nila. ÄŒasto se stává, že se bÄ›hem testování zmÄ›ní definice funkÄnosti." . + " Uživatel zmÄ›ní specifikaci testovacího případu, která je poté potÅ™eba také zpropagovat do testovacího plánu. V opaÄném případÄ›" . + " bude testovací plán obsahovat původní verzi testovacího případu, aby se zajistila konzistence verze testovacího případu a jeho výsledku.

        Jak na to

          @@ -344,30 +336,28 @@
        1. Zvolte novou verzi z rozbalovacího menu pro zvolený testovací případ.
        2. StisknÄ›te tlaÄítko 'Aktualizovat testovací plán' pro odeslání zmÄ›n.
        3. Ověření aktualizace: Otevřete stránku provedení testovacích případů, kde bude zobrazen text testovacího případu/prípadů.
        4. -
        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Nastavení vysoké nebo nízké urgentnosti pro testovací případy a sady"; -$TLS_htmltext['test_urgency'] = "

        ÚÄel

        -

        TestLink umožnuje nastavení urgentnosti testovací sady k ovlivnění priority testovacích případů. +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Nastavení vysoké nebo nízké urgentnosti pro testovací případy a sady"; +$TLS_htmltext['test_urgency'] = "

        ÚÄel

        +

        TestLink umožnuje nastavení urgentnosti testovací sady k ovlivnÄ›ní priority testovacích případů. Priorita testovacích případů v rámci testovacího plánu závisí na jejich důležitosti a urgentnosti. - Vedoucí testů by mÄ›l nastavit sadu testovacích případů, které se budou prioritnÄ› provádÄ›t. V Äasové tísni by pak mÄ›lo být zajiÅ¡tÄ›no povedení + Vedoucí testů by mÄ›l nastavit sadu testovacích případů, které se budou prioritnÄ› provádÄ›t. V Äasové tísni by pak mÄ›lo být zajiÅ¡tÄ›no povedení tÄ›ch nejdůležitÄ›jších testů.

        Jak na to

        1. V navigaÄním panelu na levé stranÄ› zvolte testovací sadu.
        2. Vyberte úroveň urgentnosti (vysoká, střední nebo nízká). Přednastavena je střední úroveň. Můžete - snížit prioritu u testovacích případů, u kterých nebude důležitost změněna, popřípadě zvýšit v případě + snížit prioritu u testovacích případů, u kterých nebude důležitost změněna, popřípadě zvýšit v případě jejich větších změn.
        3. StisknÄ›te tlaÄítko 'Uložit' pro odeslání zmÄ›n.
        -

        Pro příklad, u testovacího případu s vysokou důležitostí v testovací sadě s nízkou urgentností bude " . - "výsledkem střední priorita."; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTcDocumentation'] = "Plan add testcase documentation"; -$TLS_htmltext['planAddTcDocumentation'] = "

        @TODO Plan add testcase documentation

        "; +

        Pro příklad, u testovacího případu s vysokou důležitostí v testovací sadě s nízkou urgentností bude " . + "výsledkem střední priorita."; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTcDocumentation'] = "Plan add testcase documentation"; +$TLS_htmltext['planAddTcDocumentation'] = "

        @TODO Plan add testcase documentation

        "; ?> diff --git a/locale/de_DE/description.php b/locale/de_DE/description.php index bd299f8efd..2719ebae71 100644 --- a/locale/de_DE/description.php +++ b/locale/de_DE/description.php @@ -1,60 +1,59 @@ -Optionen für das zu generierende Dokument -

        Diese Optionen erlauben es dem Benutzer Testfälle zu filtern bevor sie angezeigt werden. Wird das +

        Diese Optionen erlauben es dem Benutzer Testfälle zu filtern bevor sie angezeigt werden. Wird das Häkchen gesetzt, werden die Daten angezeigt. Um die angezeigten Daten zu verändern, de-/aktiveren Sie das Feld, klicken Sie den Filter an und selektieren die gewünschte Datenstufe des Baums.

        -

        Dokument Header: Benutzer können Dokument-Header-Informationen filtern. -Dokument-Header-Informationen umfassen: Einleitungen, Inhalte, Referenzen, +

        Dokument Header: Benutzer können Dokument-Header-Informationen filtern. +Dokument-Header-Informationen umfassen: Einleitungen, Inhalte, Referenzen, Test Methodologien und Test Einschränkungen.

        Testfall-Inhalt: Benutzer können den Testfall-Inhalt-Informationen filtern. Testfall-Inhalt-Informationen umfassen: Zusammenfassungen, Testschritten, erwartete Ergebnisse und Schlüsselwörter.

        -

        Testfall Zusammenfassung: Benutzer können Informationen der Testfall-Zusammenfassung aus dem Testfall-Titel filtern, -jedoch nicht aus dem Testfall-Inhalt. Für eine kurze Zusammenfassung mit Titel (ohne Testschritte, -erwartete Ergebnisse und Schlüsselwörter) ist die Testfall-Zusammenfassung nur Teilweise vom +

        Testfall Zusammenfassung: Benutzer können Informationen der Testfall-Zusammenfassung aus dem Testfall-Titel filtern, +jedoch nicht aus dem Testfall-Inhalt. Für eine kurze Zusammenfassung mit Titel (ohne Testschritte, +erwartete Ergebnisse und Schlüsselwörter) ist die Testfall-Zusammenfassung nur Teilweise vom Testfall-Inhalt getrennt. Wenn der Benutzer sich entscheidet den Testfall-Inhalt anzuschauen, wird die Testfall-Zusammenfassung mit angezeigt.

        -

        Inhaltsverzeichnis: TestLink fügt eine Liste aller Titel mit internen Hypertext-Links hinzu, wenn diese +

        Inhaltsverzeichnis: TestLink fügt eine Liste aller Titel mit internen Hypertext-Links hinzu, wenn diese Option aktiviert ist.

        -

        Ausgabeformat: Es gibt zwei Möglichkeiten: HTML und MS Word. Der Browser ruft MS Word im zweiten Fall auf.

        "; - -// testPlan.html +

        Ausgabeformat: Es gibt zwei Möglichkeiten: HTML und MS Word. Der Browser ruft MS Word im zweiten Fall auf.

        "; + +// testPlan.html $TLS_hlp_testPlan = "

        Test Plan

        Allgemein

        @@ -63,40 +62,24 @@

        Testausführung

        -

        In diesem Abschnitt können Benutzer Testfälle ausführen, Test Ergebnisse erzeugen -und die Test-Suite des Test Plans drucken. Ebenfalls können Sie die Ergebnisse -ihrer Testausführung verfolgen.

        +

        In diesem Abschnitt können Benutzer Testfälle ausführen, Test Ergebnisse erzeugen +und die Test-Suite des Test Plans drucken. Ebenfalls können Sie die Ergebnisse +ihrer Testausführung verfolgen.

        Test Plan Verwaltung

        -

        In diesem Abschnitt, der nur gesondert zugänglich ist, können Test Pläne administriert werden. -Test Plan Administratoren können Test Pläne erzeugen, bearbeiten und löschen sowie Testfälle -hinzufügen, bearbeiten, löschen und aktualisieren. Außerdem können Builds erzeugt werden und +

        In diesem Abschnitt, der nur gesondert zugänglich ist, können Test Pläne administriert werden. +Test Plan Administratoren können Test Pläne erzeugen, bearbeiten und löschen sowie Testfälle +hinzufügen, bearbeiten, löschen und aktualisieren. Außerdem können Builds erzeugt werden und Benutzern den Zugriff auf ausgewählte Test Pläne ermöglichen.
        Benutzer mit entsprechender Berechtigung können Priorität und Risiko bestimmen, den Besitz -an Test-Suiten (Kategorien) erwerben und Testmeilensteine erstellen.

        +an Test-Suiten (Kategorien) erwerben und Testmeilensteine erstellen.

        -

        Hinweis: Es ist möglich, dass ein leeres Dropdown ohne Test Plan erscheint. +

        Hinweis: Es ist möglich, dass ein leeres Dropdown ohne Test Plan erscheint. In diesem Fall werden alle Verknüpfungen (außer die freigegebenen) getrennt. Wenn das der Fall ist, - setzen Sie sich bitte mit einem Admin in Verbindung. Dieser kann Ihnen die nötigen -Zugriffsrechte gewähren oder einen Test Plan für Sie erstellen.

        "; - - - - - - - - - - - - - - - - - -// custom_fields.html + setzen Sie sich bitte mit einem Admin in Verbindung. Dieser kann Ihnen die nötigen +Zugriffsrechte gewähren oder einen Test Plan für Sie erstellen.

        "; + +// custom_fields.html $TLS_hlp_customFields = "

        Benutzerdefiniertes Feld

        Einige Fakten über die Implementierung von benutzerdefinierten Feldern:

          @@ -113,9 +96,9 @@
        • Name des benutzerdefinierten Feldes
        • Titel/Variablen Name (z.B: Das ist der Wert der an lang_get() API übermittelt oder angezeigt wird, wenn keine Übersetzung gefunden wurde.).
        • Typ des benutzerdefinierten Feldes (string, numeric, float, enum, email)
        • -
        • Mögliche Werte der Aufzählung (z.B.: ROT|GELB|BLAU) , anwendbar auf die Liste, Multiselektions Liste +
        • Mögliche Werte der Aufzählung (z.B.: ROT|GELB|BLAU) , anwendbar auf die Liste, Multiselektions Liste und auf Kombotypen.
          -Um mögliche Werte der Aufzählung zu trennen, kann der senkrechte Strich ('|') benutzt werden. Eine leere Zeichenfolge +Um mögliche Werte der Aufzählung zu trennen, kann der senkrechte Strich ('|') benutzt werden. Eine leere Zeichenfolge gilt als möglicher Wert.
        • Standard-Wert: NOCH NICHT UMGESETZT
        • @@ -132,28 +115,28 @@
        • Aktiviere beim Test Plan Entwurf. Der Wert kann beim Entwurf des Test Plans noch geändert werden (füge Testfälle dem Test Plan hinzu).
        • Verfügbar für: Nutzer wählt aus, welcher Art von Item das Feld folgt.
        -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

        Testfall Ausführung

        -

        Erlaubt es Nutzern Testfälle auszuführen. Die Ausführung selbst ist lediglich +

        Erlaubt es Nutzern Testfälle auszuführen. Die Ausführung selbst ist lediglich das Zuweisen eines Ergebnisses (OK, Fehlgeschlagen, Blockiert) an einen Testfall im ausgewählten Build.

        -

        Zugang zu einem Bug Tracking System kann konfiguriert werden. Nutzer kann neue BUGs hinzufügen und -existierende durchsuchen. Der Installationsanleitung können weitere Informationen entnommen werden.

        "; - -//bug_add.html +

        Zugang zu einem Bug Tracking System kann konfiguriert werden. Nutzer kann neue BUGs hinzufügen und +existierende durchsuchen. Der Installationsanleitung können weitere Informationen entnommen werden.

        "; + +// bug_add.html $TLS_hlp_btsIntegration = "

        Füge den Testfällen BUGs hinzu.

        (falls konfiguriert) TestLink hat nur eine einfache Integration in ein Bug Tracking Systems (BTS), -es ist nicht möglich eine Anfrage zum Erstellen eines BUGs an das BTs zu schicken. -Ebenfalls ist es nicht möglich die BUG ID zu bekommen. -Die Integration wird durch Verknüpfungen der BTS-Webseiten ermöglicht. +es ist nicht möglich eine Anfrage zum Erstellen eines BUGs an das BTs zu schicken. +Ebenfalls ist es nicht möglich die BUG ID zu bekommen. +Die Integration wird durch Verknüpfungen der BTS-Webseiten ermöglicht. Die folgenden Funktionen können aufgerufen werden:

        • Füge neuen BUG ein.
        • Zeige BUG Informationen.
        -

        +

        Wie man einen BUG hinzufügt

        @@ -162,19 +145,19 @@

      • Schritt 2: Notiere Sie die BUGID die vom BTS zugewiesen wurde.
      • Schritt 3: Schreibe Sie die BUGID in das Feld.
      • Schritt 4: Nutzen Sie die Schaltfläche 'BUG hinzufügen'.
      • -
      +
    Die relevanten BUG Daten werden auf der Ausführung Seite angezeigt, nachdem die 'BUG hinzufügen' Seite geschlossen wurde. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Einstellungen

    Die Einstellungen erlauben es einen Test Plan, Build oder eine Plattform (falls vorhanden) auszuwählen um sie auszuführen.

    Test Plan

    -Der geforderte Test Plan kann ausgewählt werden. Nach Auswahl des Test Plans +Der geforderte Test Plan kann ausgewählt werden. Nach Auswahl des Test Plans werden die entsprechenden Builds angezeigt und die Filter zurückgesetzt.

    Plattform

    @@ -184,89 +167,86 @@

    Das gewünschte Build, auf dem die Testfälle ausgeführt werden sollen, kann ausgewählt werden.

    Filter

    -

    Filter bieten die Möglichkeit die Testfälle nach eigenen Wünschen anzuzeigen bevor sie ausgeführt werden. +

    Filter bieten die Möglichkeit die Testfälle nach eigenen Wünschen anzuzeigen bevor sie ausgeführt werden. Mit bestimmten Filtern bzw. drücken der Schaltfläche 'Anwenden' kann die Anzahl der Testfall-Sätze reduziert werden.

    -

    Erweiterte Filter erlauben es schon angewandte Filter mit einer Reihe von Werten zu spezifizieren. +

    Erweiterte Filter erlauben es schon angewandte Filter mit einer Reihe von Werten zu spezifizieren. Das wird mit einem STRG-Klick in der Multi-Select ListBox erreicht.

    Stichwort-Filter

    -

    Nach Stichworten von Testfällen kann gefiltert werden. Mutliple Stichwörte " . -"können über den STRG-Klick ausgewählt werden " . -"Bei mehrfach ausgewählten Stichworten können die Testfälle angezeigt werden, ". -"die alle (Optionsfeld \"UND\") oder mindestens eins (Optionsfeld \"ODER\") ". -"dieser Stichworte beinhalten.

    +

    Nach Stichworten von Testfällen kann gefiltert werden. Mutliple Stichwörte " . + "können über den STRG-Klick ausgewählt werden " . + "Bei mehrfach ausgewählten Stichworten können die Testfälle angezeigt werden, " . + "die alle (Optionsfeld \"UND\") oder mindestens eins (Optionsfeld \"ODER\") " . + "dieser Stichworte beinhalten.

    Prioritäts-Filter

    -

    Testfälle können nach Test Prioritäten gefiltert werden. Die Test Prioritäten lauten \"Testfall Wichtung\" " . -"und \"Test Dringlichkeit\" in dem aktuellen Test Plan.

    +

    Testfälle können nach Test Prioritäten gefiltert werden. Die Test Prioritäten lauten \"Testfall Wichtung\" " . + "und \"Test Dringlichkeit\" in dem aktuellen Test Plan.

    Benutzer-Filter

    -

    Es kann nach Testfällen gefiltert werden, die zugewiesen an \"jemand\" oder nicht " . -"zugewiesen an \"niemand\" sind. Es kann auch nach bestimmten Testern gefiltert werden. ". -"Falls nach einem Tester gefiltert wird, können zusätzlich auch die Testfälle angezeigt werden, ". -"die nicht zugewiesen sind (erweiterte Filter sind anwählbar).

    +

    Es kann nach Testfällen gefiltert werden, die zugewiesen an \"jemand\" oder nicht " . + "zugewiesen an \"niemand\" sind. Es kann auch nach bestimmten Testern gefiltert werden. " . + "Falls nach einem Tester gefiltert wird, können zusätzlich auch die Testfälle angezeigt werden, " . + "die nicht zugewiesen sind (erweiterte Filter sind anwählbar).

    Ergebnis-Filter

    -

    Testfälle können nach ihren Ergebnissen gefiltert werden (erweiterte Filter sind anwählbar). -Es kann gefiltert werden nach dem Ergebnis \"des ausgewählten Builds für die Ausführung\", ". -" \"der letzten Ausführung\", \"ALLER Builds\", " . -"\"BELIEBIGES Build\" und \"eines bestimmten Builds\". Falls ein \"bestimmtes Build\" ausgewählt wurde" . -"muss das Build bestimmt werden.

    "; - - -// newest_tcversions.html +

    Testfälle können nach ihren Ergebnissen gefiltert werden (erweiterte Filter sind anwählbar). +Es kann gefiltert werden nach dem Ergebnis \"des ausgewählten Builds für die Ausführung\", " . + " \"der letzten Ausführung\", \"ALLER Builds\", " . + "\"BELIEBIGES Build\" und \"eines bestimmten Builds\". Falls ein \"bestimmtes Build\" ausgewählt wurde" . + "muss das Build bestimmt werden.

    "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Neuere Versionen von verknüpften Testfällen

    Alle, dem Test Plan verknüpfte Testfälle, werden analysiert und gelistet, die die neuesten Versionen der Testfälle anzeigt (im Vergleich zum aktuellen Satz des Test Plans). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Anforderungsabdeckung


    Diese Funktion erlaubt das Aufstellen einer Abdeckung von Benutzer- oder Systemanforderungen mit Testfällen. Auf der Hauptseite kann über \"Anforderungsspezifikation\" navigiert werden.

    Anforderungsspezifikation

    -

    Anforderungen sind nach dem Dokument 'Anforderung Spezifikation', welches mit dem Test Plan -verbunden ist, gruppiert.
    TestLink unterstützt nicht beide Versionen für die Anf.Spezifikation und +

    Anforderungen sind nach dem Dokument 'Anforderung Spezifikation', welches mit dem Test Plan +verbunden ist, gruppiert.
    TestLink unterstützt nicht beide Versionen für die Anf.Spezifikation und der Anforderung selbst. Also sollte die Version des Dokuments erst nach der Spezifikation eingefügt werden. Titel. -Der Nutzer kann dem Feld Inhalt eine kurze Beschreibung oder Notiz hinzufügen.

    +Der Nutzer kann dem Feld Inhalt eine kurze Beschreibung oder Notiz hinzufügen.

    -

    Überschrieben Anzahl von Anf. Dient der Evaluation der Anf. -Abdeckung, falls nicht alle Anforderungen importiert wurden. -Der Wert 0 bedeutet, dass die aktuelle Anzahl der Anf. für Metriken genutzt wird.

    -

    Beispielsweise SRS beinhaltet 200 Anforderungen aber nur 50 sind in TestLink hinzugefügt worden. Die Test +

    Überschrieben Anzahl von Anf. Dient der Evaluation der Anf. +Abdeckung, falls nicht alle Anforderungen importiert wurden. +Der Wert 0 bedeutet, dass die aktuelle Anzahl der Anf. für Metriken genutzt wird.

    +

    Beispielsweise SRS beinhaltet 200 Anforderungen aber nur 50 sind in TestLink hinzugefügt worden. Die Test Abdeckung ist 25% (falls alle importierten Anforderungen getestet werden).

    Anforderungen

    -

    Mit einem Klick auf den Titel der erstellten Anf. Spezifikation kann für das Dokument Anforderungen erstellt, +

    Mit einem Klick auf den Titel der erstellten Anf. Spezifikation kann für das Dokument Anforderungen erstellt, bearbeitet, gelöscht oder importiert werden. Jede Anforderung hat einen Titel, Inhalt und Status. -Der Status sollte \"Normal\" oder \"Nicht testbar\" sein. Nicht testbare Anforderungen gehen in die Metriken -nicht ein. Dieser Parameter kann für noch nicht implementierte Funktionen und -falsch entworfenen Anforderungen genutzt werden.

    +Der Status sollte \"Normal\" oder \"Nicht testbar\" sein. Nicht testbare Anforderungen gehen in die Metriken +nicht ein. Dieser Parameter kann für noch nicht implementierte Funktionen und +falsch entworfenen Anforderungen genutzt werden.

    -

    Mit der Nutzung von Multi Aktionen mit abgehakten Anforderungen auf der Spezifikations Umgebung, -können neue Testfälle für Anforderungen erstellt werden. Diese Testfälle werden der Test Suite mit dem -konfigurierten Namen (Standard ist: $tlCfg->req_cfg->default_testsuite_name = +

    Mit der Nutzung von Multi Aktionen mit abgehakten Anforderungen auf der Spezifikations Umgebung, +können neue Testfälle für Anforderungen erstellt werden. Diese Testfälle werden der Test Suite mit dem +konfigurierten Namen (Standard ist: $tlCfg->req_cfg->default_testsuite_name = \"Test Suite erstellt über Anforderung - Auto\";). hinzugefügt. Titel und Inhalt werden in die Testfälle kopiert.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Abdeckung:

    Ein Wert von bspw. \"40% (8/20)\" bedeutet das 20 Testfälle für diese Anforderung noch zu erstellen sind, -um sie vollständig abzudecken. Die 8 Testfälle, die schon erstellt und mit dieser Anforderung verknüpft +um sie vollständig abzudecken. Die 8 Testfälle, die schon erstellt und mit dieser Anforderung verknüpft wurden, ergeben eine Abdeckung von 40 Prozent. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    Interne Links im Inhalt:

    -

    Interne Links können genutzt werden um Links zu anderen Anforderungen/Anforderungsspezifikation -mit einer speziellen Syntax zu erstellen. +

    Interne Links können genutzt werden um Links zu anderen Anforderungen/Anforderungsspezifikation +mit einer speziellen Syntax zu erstellen. Das Verhalten der internen Links kann über die Konfigurationsdatei angepasst werden.

    Benutzung: @@ -279,22 +259,21 @@ Diese Syntax funktioniert auch für Anforderungsspezifikationen.

    Änderungsprotokoll/Revisionierung:

    -

    Immer wenn eine Änderung an einer Anforderung vorgenommen wird fragt Testlink nach einer Protokollierung der Änderung. +

    Immer wenn eine Änderung an einer Anforderung vorgenommen wird fragt Testlink nach einer Protokollierung der Änderung. Das Änderungsprotokoll dient der Rückverfolgbarkeit (Traceability).

    -

    Wenn sich nur der Inhalt der Anforderung ändert, steht es dem Autor frei, -ob er eine neue Revision erstellen möchte oder nicht. Sollte sich etwas außer dem Inhalt ändern ist der Autor gezwungen, +

    Wenn sich nur der Inhalt der Anforderung ändert, steht es dem Autor frei, +ob er eine neue Revision erstellen möchte oder nicht. Sollte sich etwas außer dem Inhalt ändern ist der Autor gezwungen, eine neue Revision zu erstellen.

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    Direkte Links:

    -

    Um Anforderungsdokumente so leicht wie möglich mit anderen teilen zu können -bietet TestLink die Möglichkeit einen direkten Link zu diesem Dokument zu erzeugen. +

    Um Anforderungsdokumente so leicht wie möglich mit anderen teilen zu können +bietet TestLink die Möglichkeit einen direkten Link zu diesem Dokument zu erzeugen. Klicken Sie dazu das Globus Icon an.

    Verlauf anzeigen:

    -

    Dieses Feature erlaubt es Revisionen/Versionen von Anforderungen zu vergleichen, +

    Dieses Feature erlaubt es Revisionen/Versionen von Anforderungen zu vergleichen, sofern mehr als eine Revision/Version der Anforderung existiert. Die Übersicht zeigt das Änderungsprotokoll, das Datum und den Autor der letzten Änderung für jede Revision/Version.

    @@ -317,18 +296,17 @@

    Zeigt alle Testfälle, die mit der Anforderung verknüpft wurden.

    Beziehungen:

    -

    Beziehungen werden benutzt um Beziehungen zwischen Anforderungen zu modellieren. -Benutzerdefinierte Beziehungen und die Möglichkeit Beziehungen zwischen Anforderungen +

    Beziehungen werden benutzt um Beziehungen zwischen Anforderungen zu modellieren. +Benutzerdefinierte Beziehungen und die Möglichkeit Beziehungen zwischen Anforderungen in verschiedenen Projekten herstellen zu können, werden in der Konfigurationsdatei konfiguriert.

    -

    Setzt man die Beziehung \"Anforderung A ist Vater von Anforderung B\", +

    Setzt man die Beziehung \"Anforderung A ist Vater von Anforderung B\", wird Testlink die Beziehung \"Anforderung B ist Kind von Anforderung A\" implizit setzen.

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    Interne Links im Inhalt:

    -

    Interne Links können genutzt werden um Links zu anderen Anforderungen/Anforderungsspezifikation -mit einer speziellen Syntax zu erstellen. +

    Interne Links können genutzt werden um Links zu anderen Anforderungen/Anforderungsspezifikation +mit einer speziellen Syntax zu erstellen. Das Verhalten der internen Links kann über die Konfigurationsdatei angepasst werden.

    Benutzung: @@ -339,40 +317,36 @@

    Das Testprojekt und ein Anker der zu verlinkenden Anforderung kann ebenfalls angegeben werden:
    [req tproj=<tproj_prefix> anchor=<anker_name>]Anf_Dokument_ID[/req]
    Diese Syntax funktioniert auch für Anforderungsspezifikationen.

    -"; - - +"; + $TLS_hlp_req_coverage_table = "

    Abdeckung:

    Ein Wert von z.B. \"40% (8/20)\" bedeutet, dass 20 Testfälle erstellt werden müssen um die Anforderung komplett durch Testfälle abzudecken. Acht dieser Testfälle wurden bereits erstellt und der Anforderung zugewiesen, was einer Abdeckung von 40% entspricht. -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Bezüglich 'Speichere Benutzerdefinierte Felder'

    -Falls zum Test Project definiert und zugewiesen,
    +Falls zum Test Project definiert und zugewiesen,
    Benutzerdefinierte Felder mit:
    'Zeige bei der Test Plan Entwurf=Wahr' und
    'Aktiviere beim Test Plan Entwurf=Wahr'
    Es werden auf der Seite NUR Testfälle angezeigt die mit dem Test Plan verknüpft sind. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "Zusatzinformationen über Tester:
    Bei einem Klick auf den Tester Namen in dieser Tabelle öffnet sich eine detaillierte Übersicht über alle dem jew. Tester zugewiesene Testfälle und dessen Testprozess.

    Hinweis:
    -Diese Übersicht zeigt die Testfälle, die einem bestimmten Nutzer zugewiesen sind und +Diese Übersicht zeigt die Testfälle, die einem bestimmten Nutzer zugewiesen sind und basierend auf dem jeweiligen aktiven Build ausgeführt wurden. Auch wenn der Testfall von einem anderen Nutzer ausgeführt wurde, erscheint der Testfall bei dem zugewiesenen Nutzer als Ausgeführt. -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/de_DE/strings.txt b/locale/de_DE/strings.txt index 973f54869e..0577ee14ba 100644 --- a/locale/de_DE/strings.txt +++ b/locale/de_DE/strings.txt @@ -48,9 +48,12 @@ $TLS_last_update = "Letztes Übersetzungs-Update: 18.08.2011 (TestLink 1.9.4)"; // ----- General terms (used wide) ---------------------------- $TLS_active_click_to_change = "Aktiv (klicken, um zu deaktivieren) "; $TLS_api_key = "API Schlüssel"; -$TLS_builds = "Builds"; +$TLS_builds = "Builds"; +$TLS_build = 'Build'; $TLS_active_builds = "Aktive Builds"; $TLS_all_active_builds = "[Alle aktiven Builds]"; +$TLS_exec_result = 'Ergebnis'; +$TLS_exec_attachments = 'Ausführungsanhänge'; $TLS_inactive_click_to_change = "Deaktiviert (klicken, um zu aktivieren)"; $TLS_default_auth_method = "Standard"; $TLS_authentication_method = "Authentifizierungs-Methode"; @@ -76,6 +79,12 @@ $TLS_availability = "Verfügbarkeit"; $TLS_build = "Build"; $TLS_check_uncheck_all = "Auswahl invertieren"; $TLS_check_uncheck_all_for_remove = "alle zum Entfernen an-/abwählen"; +$TLS_click_to_set_open = "Geschlossen (zum Öffnen klicken)"; +$TLS_click_to_set_closed = "Öffnen (zum Schließen klicken)"; +$TLS_click_to_disable = "Aktiviert (zum Deaktivieren klicken)"; +$TLS_click_to_enable = "Deaktiviert (zum Aktivieren klicken)"; +$TLS_current_testcase = "Dieser Testfall"; +$TLS_this_tcversion = "Diese Testfallversion "; $TLS_confirm = "Bestätigen"; $TLS_config = "Konfiguration"; $TLS_created_by = "Erstellt von"; @@ -119,6 +128,7 @@ $TLS_manual = "Manuell"; $TLS_Milestone = "Meilenstein"; $TLS_months = "Monate"; $TLS_monitor = "Beobachten"; +$TLS_monitor_set = "Beobachter"; $TLS_name = "Name"; $TLS_navigator_add_remove_tcase_to_tplan = "Testfälle Hinzufügen/Entfernen"; $TLS_navigator_tc_exec_assignment = "Ausführungs Zuweisung"; @@ -597,6 +607,8 @@ $TLS_btn_create_testsuite = "Erstellen"; $TLS_tc_keywords = "Stichwörter"; $TLS_title_create = "Erstellen"; $TLS_warning_empty_testsuite_name = "Sie müssen der Testsuite einen Namen geben!"; +// ----- gui/templates/script_add.tpl ----- +// ----- gui/templates/script_delete.tpl ----- @@ -766,6 +778,7 @@ $TLS_collapse_tree = "Baum zuklappen"; $TLS_filter_active_inactive = "Aktiv/Inaktiv"; $TLS_show_only_active_testcases = "Nur aktive Testfälle"; $TLS_show_only_inactive_testcases = "Nur inaktive Testfälle"; +$TLS_show_whole_spec_on_right_panel = 'Vollständig anzeigen (im rechten Bereich)'; $TLS_test_grouped_by = "Tests gruppiert nach"; $TLS_mode_test_suite = "Testsuite"; $TLS_mode_req_coverage = "Bedarf"; @@ -1110,6 +1123,10 @@ $TLS_delete_bug = "Bug löschen"; $TLS_del_bug_warning_msg = "Sind Sie sicher, dass Sie diesen Bug wirklich löschen wollen?"; +// gui/templates/inc_show_script_table.tpl +$TLS_caption_scripttable = "Relevante Testskripte"; +$TLS_delete_script ="Skriptlink aus TestLink löschen"; +$TLS_del_script_warning_msg = "Diesen Skriptlink wirklich aus der TestLink-Datenbank löschen?"; // gui/templates/reqSpecList.tpl $TLS_btn_assign_tc = "Testfall zuweisen"; @@ -1656,6 +1673,8 @@ $TLS_btn_del_this_version = "Version löschen"; $TLS_btn_execute_automatic_testcase = "Automatisierte Testfälle durchführen"; $TLS_btn_mv_cp = "Verschieben / Kopieren"; $TLS_btn_new_version = "Neue Version erstellen"; + + $TLS_btn_new_sibling = "Neuer Geschwisterknoten"; $TLS_hint_new_sibling = "Erzeuge Testfall in der aktuellen Test Suite"; $TLS_hint_new_version = "Erzeuge neue version"; @@ -3660,6 +3679,86 @@ $TLS_plugin_installed = "undefined"; $TLS_confirm_install_header = "undefined"; $TLS_confirm_install_text = "undefined"; $TLS_confirm_uninstall_header = "undefined"; -$TLS_confirm_uninstall_text = "undefined"; +$TLS_confirm_uninstall_text = "undefined"; + + +// ----- lib/requirements/reqMonitorOverview.php ----- +$TLS_caption_req_monitor_overview = "Übersicht über den Anforderungsmonitor"; +$TLS_on_turn_off = 'Ein (klicken, um die Überwachung zu beenden)'; +$TLS_off_turn_on = 'Aus (klicken, um die Überwachung zu starten)'; + +$TLS_mail_subject_req_delete_version = 'Anforderungsversion gelöscht Deleted [%docid%-%title%]'; + +$TLS_mail_subject_req_delete = 'Anforderung gelöscht [%docid%-%title%]'; + +$TLS_mail_subject_req_new_version = 'Neue Version der Anforderung [%docid%-%title%]'; + +$TLS_hint_add_testcases_to_testplan_status = 'Testfälle mit der neuesten Version und einem Status mit einem dieser Werte (%s) werden auf diesem Bildschirm nicht angezeigt'; + +$TLS_assignments = "Aufgaben:"; + +$TLS_btn_bulk_mon = 'Massenüberwachung'; +$TLS_bulk_monitoring = $TLS_btn_bulk_mon; +$TLS_monitoring = 'Überwachung'; +$TLS_btn_toogle_mon = 'Überwachung umschalten'; +$TLS_btn_start_mon = 'Überwachung starten'; +$TLS_btn_stop_mon = 'Überwachung stoppen'; + +$TLS_issueTracker_connection_ok = 'Test der Verbindung OK'; +$TLS_issueTracker_connection_ko = 'Test der Verbindung nicht OK'; +$TLS_codeTracker_connection_ok = 'Test der Verbindung OK'; +$TLS_codeTracker_connection_ko = 'Test der Verbindung nicht OK'; + +$TLS_click_passed = "Klicken Sie hier, um es auf „Bestanden“ zu setzen."; +$TLS_click_failed = "Klicken Sie hier, um es auf „Fehlgeschlagen“ zu setzen"; +$TLS_click_blocked = "Klicken Sie hier, um es auf „Blockiert“ zu setzen"; + +$TLS_click_passed_next = "Klicken Sie, um auf „Bestanden“ zu setzen und zum nächsten zu gelangen"; +$TLS_click_failed_next = "Klicken Sie, um das Feld auf „Fehlgeschlagen“ zu setzen und zum nächsten zu gelangen"; +$TLS_click_blocked_next = "Klicken Sie, um es auf „Blockiert“ zu setzen und zum nächsten zu gelangen"; + +$TLS_send_spreadsheet_by_email = 'Tabellenkalkulation per E-Mail an mich selbst senden'; +$TLS_send_by_email_to_me = 'Per E-Mail an mich selbst senden'; + +$TLS_search_items = "Suchen"; +$TLS_req_document_id = "Anf.-Dokument-ID"; +$TLS_id = 'ID'; + +$TLS_search_words_or = 'Die Suche muss mindestens EIN Wort ergeben (ODER)'; +$TLS_search_words_and = 'Die Suche muss mit ALLEN Wörtern übereinstimmen (UND)'; +$TLS_search_words_placeholder = 'Geben Sie hier die Wörter ein, nach denen Sie suchen möchten'; +$TLS_search_words_on_attr = "Das Wort/die Wörter werden anhand eines oder mehrerer Attribute gesucht, die Sie unten auswählen"; + +$TLS_search_other_attr = "Sie können Suchkriterien festlegen, die keine Wörter verwenden. Diese Suchkriterien werden jedoch im UND-Modus hinzugefügt"; + +$TLS_search_created_by_ph = 'Wert wird nach Login/Vorname/Nachname gesucht'; +$TLS_multiple_entities_search = 'Suche nach mehreren Entitäten'; +$TLS_no_access_to_feature = 'Sie verfügen nicht über ausreichende Rechte, um auf die Funktion zuzugreifen'; + +$TLS_applyExecTypeChangeToAllSteps = "Auf alle Schritte anwenden"; + +$TLS_user_bulk_action = 'Benutzer für Massenaktionen'; +$TLS_title_issuetracker_mgmt = 'Issue-Tracker'; +$TLS_title_codetracker_mgmt = 'Code-Tracker'; +$TLS_desc_cfield_assignment = "Benutzerdefinierte Feldzuweisung"; +$TLS_desc_exec_assign_testcases = "Testfallausführung zuweisen"; +$TLS_expiration_date = 'Verfallsdatum'; +$TLS_system_descr = "Test- und Anforderungsmanagement-Software"; +$TLS_poweredBy = 'Erstellt von'; +$TLS_expiration = 'Ablauf'; +$TLS_no_user_selected = 'Sie müssen mindestens einen Benutzer auswählen'; + +$TLS_can_not_delete_relation_tcversion_frozen = "Löschen deaktiviert: Testfallversion ist eingefroren"; +$TLS_can_not_delete_relation_related_tcversion_frozen = "Löschen deaktiviert: Die zugehörige Testfallversion ist eingefroren."; +$TLS_obsolete = 'veraltet'; + +$TLS_tcversion_executed_keyword_assignment_blocked = 'Testfallversion wurde ausgeführt, die Systemkonfiguration erlaubt keine Schlüsselwortverwaltung'; + +$TLS_select_keywords = 'Schlüsselwörter auswählen'; + +$TLS_issueReporter = 'Gemeldet von'; +$TLS_issueHandler = 'Zugewiesen an / Bearbeitet von'; + + // ----- END ------------------------------------------------------------------ ?> diff --git a/locale/de_DE/texts.php b/locale/de_DE/texts.php index 473ce5ad79..cd86cf3a72 100644 --- a/locale/de_DE/texts.php +++ b/locale/de_DE/texts.php @@ -1,52 +1,47 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat, Julian Krien - * @copyright 2003-2009, TestLink community - * @version CVS: $Id: texts.php,v 1.14 2010/06/24 17:25:57 asimon83 Exp $ - * @link http://www.teamst.org/index.php - * - * @internal Revisions: - * 20100517 - Julian - update of header according to en_GB texts.php - * - * Edit by: devwag00\fixccey 06.05.2014 - * - * Edit by: sschiele@mesnet.de 2014-08-19 - * Fixed String formatting errors - **/ - - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Anwendungsfehler"; -$TLS_htmltext['error'] = "

    Es ist ein unerwarteter Fehler aufgetreten. Bitte " . - "überprüfen Sie den Event Viewer und/oder Log-Dateien für weitere Details." . - "

    Sie können das Problem gerne melden. Besuchen Sie hierzu bitte unsere " . - - "Webseite.

    "; - - - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['assignReqs'] = "Zuweisung von Anforderungen an Testfälle"; -$TLS_htmltext['assignReqs'] = "

    Zweck:

    -

    Benutzer können eine Beziehung zwischen Anforderungen und Testfällen herstellen. +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat, Julian Krien + * @copyright 2003-2009, TestLink community + * @version CVS: $Id: texts.php,v 1.14 2010/06/24 17:25:57 asimon83 Exp $ + * @link http://www.teamst.org/index.php + * + * @internal Revisions: + * 20100517 - Julian - update of header according to en_GB texts.php + * + * Edit by: devwag00\fixccey 06.05.2014 + * + * Edit by: sschiele@mesnet.de 2014-08-19 + * Fixed String formatting errors + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Anwendungsfehler"; +$TLS_htmltext['error'] = "

    Es ist ein unerwarteter Fehler aufgetreten. Bitte " . + "überprüfen Sie den Event Viewer und/oder Log-Dateien für weitere Details." . + "

    Sie können das Problem gerne melden. Besuchen Sie hierzu bitte unsere " . + + "Webseite.

    "; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['assignReqs'] = "Zuweisung von Anforderungen an Testfälle"; +$TLS_htmltext['assignReqs'] = "

    Zweck:

    +

    Benutzer können eine Beziehung zwischen Anforderungen und Testfällen herstellen. Ein Testfall kann keiner, einer oder mehreren Anforderungen zugewiesen werden oder umgekehrt. Diese Zuweisungen erlauben es später eine Aussage darüber zu treffen, welche Anforderungen abhängig von den Testergebnissen erfolgreich umgesetzt wurden.

    @@ -64,47 +59,46 @@ Anforderungen, für die Sie eine Testfallzuweisung hinzufügen bzw. entfernen möchten und klicken Sie anschließend den entsprechenden Button. -"; +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Testfälle bearbeiten"; +$TLS_htmltext['editTc'] = "

    Die Testspezifikation ermöglicht das " . + "Anzeigen und Editieren aller vorhandenen Test Suiten und Testfälle. Testfälle sind " . + "versioniert. Alle früheren Versionen sind noch für die Einsicht und Verwaltung " . + "verfügbar.

    -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Testfälle bearbeiten"; -$TLS_htmltext['editTc'] = "

    Die Testspezifikation ermöglicht das " . - "Anzeigen und Editieren aller vorhandenen Test Suiten und Testfälle. Testfälle sind " . - "versioniert. Alle früheren Versionen sind noch für die Einsicht und Verwaltung " . - "verfügbar.

    -

    Anweisung:

      -
    1. Wähle das Test Projekt in der Baum Navigation (oberster Knoten). Bitte beachten: " . - "Sie können über die Drop-Down Liste in der Ecke oben rechts das aktive Projekt ändern.
    2. -
    3. Mit einem Klick auf Neue Testsuite erzeugen Sie eine neue Test Suite. Test Suiten " . - "strukturieren Test Dokumente entsprechend Ihrer Konventionen (funktionale/ nicht-funktionale " . - "Tests, Produktkomponenten oder Funktionen, Änderungswünsche etc.). Die Beschreibung einer " . - "Test Suite kann den Inhalt der eingefügten Testfälle, die Standard Konfiguration ". - "Verknüpfungen zu relevanten Dokumenten, Beschränkungen und andere nützliche Informationen beinhalten. Im Allgemeinen, " . - " alle Anmerkungen die Gemeinsamkeiten haben mit den Testfall-Kindknoten. Test Suiten folgen " . - "dem "Datei/Ornder" System, sodass Nutzer Test Suiten im Test Projekt " . - "verschieben und kopieren können. Sie können auch importiert und exportiert werden (mit den Testfällen).
    4. -
    5. Test Suiten sind skalierbare Ordner. Nutzer können Test Suiten im Test Projekt " . - "verschieben und kopieren. Sie können importiert und exportiert werden (mit den Testfällen). -
    6. Durch Auswahl der neu erstellten Test Suite in dem Navigations-Baum können neue Testfälle mit ". - "Testfälle erstellen erstellt werden. Ein Testfall in einem Test Projekt spezifiziert ein bestimmtes Testszenario, " . - "die erwarteten Ergebnisse und benutzerdefinierte Felder (siehe Benutzeranleitung). " . - "Für eine verbesserte Nachvollziehbarkeit ". - "(Traceability) können den Testfällen Stichwörter zugewiesen werden.
    7. +
    8. Wähle das Test Projekt in der Baum Navigation (oberster Knoten). Bitte beachten: " . + "Sie können über die Drop-Down Liste in der Ecke oben rechts das aktive Projekt ändern.
    9. +
    10. Mit einem Klick auf Neue Testsuite erzeugen Sie eine neue Test Suite. Test Suiten " . + "strukturieren Test Dokumente entsprechend Ihrer Konventionen (funktionale/ nicht-funktionale " . + "Tests, Produktkomponenten oder Funktionen, Änderungswünsche etc.). Die Beschreibung einer " . + "Test Suite kann den Inhalt der eingefügten Testfälle, die Standard Konfiguration " . + "Verknüpfungen zu relevanten Dokumenten, Beschränkungen und andere nützliche Informationen beinhalten. Im Allgemeinen, " . + " alle Anmerkungen die Gemeinsamkeiten haben mit den Testfall-Kindknoten. Test Suiten folgen " . + "dem "Datei/Ornder" System, sodass Nutzer Test Suiten im Test Projekt " . + "verschieben und kopieren können. Sie können auch importiert und exportiert werden (mit den Testfällen).
    11. +
    12. Test Suiten sind skalierbare Ordner. Nutzer können Test Suiten im Test Projekt " . + "verschieben und kopieren. Sie können importiert und exportiert werden (mit den Testfällen). +
    13. Durch Auswahl der neu erstellten Test Suite in dem Navigations-Baum können neue Testfälle mit " . + "Testfälle erstellen erstellt werden. Ein Testfall in einem Test Projekt spezifiziert ein bestimmtes Testszenario, " . + "die erwarteten Ergebnisse und benutzerdefinierte Felder (siehe Benutzeranleitung). " . + "Für eine verbesserte Nachvollziehbarkeit " . + "(Traceability) können den Testfällen Stichwörter zugewiesen werden.
    14. In der Baumansicht auf der linken Seite können Sie die Daten bearbeiten. Jeder Testfall speichert den eigenen Verlauf.
    15. Die erstellte Test Spezifikation kann einem Test Plan zugewiesen werden, wenn die Testfälle fertig sind.
    -

    Mit TestLink können Testfälle in Test Suiten gegliedert werden." . -"Test Suiten können in Test Suiten verschachtelt werden, sodass hierarchische Einstufungen möglich sind. - Diese Information kann dann mit den Testfällen ausgedruckt werden.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Testfälle suchen"; -$TLS_htmltext['searchTc'] = "

    Zweck:

    +

    Mit TestLink können Testfälle in Test Suiten gegliedert werden." . + "Test Suiten können in Test Suiten verschachtelt werden, sodass hierarchische Einstufungen möglich sind. + Diese Information kann dann mit den Testfällen ausgedruckt werden.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Testfälle suchen"; +$TLS_htmltext['searchTc'] = "

    Zweck:

    Suche von Testfällen anhand frei definierbaren Parametern.

    Anweisung:

    @@ -120,17 +114,13 @@

    - Es werden nur Testfälle innerhalb des aktuellen Testprojekts durchsucht.
    - Die Suche ist unabhängig von \"Groß- und Kleinschreibung\".
    -- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; - - - - - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Anforderungen suchen"; -$TLS_htmltext['searchReq'] = "

    Zweck:

    +- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Anforderungen suchen"; +$TLS_htmltext['searchReq'] = "

    Zweck:

    Suche von Anforderungen anhand frei-definierbare Parametern.

    @@ -147,12 +137,12 @@

    - Es werden nur Anforderungen innerhalb des aktuellen Testprojekts durchsucht.
    - Die Suche ist unabhängig von \"Groß- und Kleinschreibung\".
    -- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Anforderungsspezifikationen suchen"; -$TLS_htmltext['searchReqSpec'] = "

    Zweck:

    +- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Anforderungsspezifikationen suchen"; +$TLS_htmltext['searchReqSpec'] = "

    Zweck:

    Suche von Anforderungsspezifikationen anhand frei definierbaren Parametern.

    @@ -171,14 +161,12 @@

    - Es werden nur Anforderungsspezifikationen innerhalb des aktuellen Testprojekts durchsucht.
    - Die Suche ist unabhängig von \"Groß- und Kleinschreibung\".
    -- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; -/* end contribution */ - - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Testspezifikation erstellen"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Zweck:

    +- Leere Felder der Suchmaske werden nicht berücksichtigt.

    "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Testspezifikation erstellen"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Zweck:

    Hier können alle Testfälle eines Test Projekts, einer Test Suite oder ein einzelner Testfall ausgedruckt werden.

    @@ -189,52 +177,52 @@ dann auf einen Testfall, eine Test Suite oder ein Test Projekt. Eine druckbare Seitenansicht wird angezeigt.

  • Ändern Sie über die \"Zeige als\" drop-box in der Navigationsleiste den Anzeigemodus als -HTML, OpenOffice oder einem Microsoft Word Dokument. +HTML, OpenOffice oder einem Microsoft Word Dokument. Die Hilfe bietet weitere Informationen.

  • Über den Browser können die Daten dann gedruckt werden.
    Hinweis: Achten Sie darauf nur den Rahmen auf der rechten Seite zu drucken.

  • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Anforderungen definieren"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    Sie können Anforderungsspezifikations Dokumente verwalten.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Anforderungen definieren"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    Sie können Anforderungsspezifikations Dokumente verwalten.

    Anforderungspezifikation

    -

    Anforderungen sind nach dem Dokument 'Anforderungspezifikation', welches mit dem Test Plan -verbunden ist, gruppiert.
    TestLink unterstützt noch keine Versionen für beide, die Anf.Spezifikation und +

    Anforderungen sind nach dem Dokument 'Anforderungspezifikation', welches mit dem Test Plan +verbunden ist, gruppiert.
    TestLink unterstützt noch keine Versionen für beide, die Anf.Spezifikation und der Anforderung selbst. Also sollte die Version des Dokuments erst nach der Spezifikation eingefügt werden. Titel. -Der Nutzer kann in dem Feld Inhalt eine kurze Beschreibung oder Notiz hinzufügen.

    +Der Nutzer kann in dem Feld Inhalt eine kurze Beschreibung oder Notiz hinzufügen.

    -

    Überschriebene Anzahl von Anf. Dient der Evaluation der Anf. -Abdeckung, falls nicht alle Anforderungen importiert wurden. -Der Wert 0 bedeutet, dass die aktuelle Anzahl der Anf. für Metriken genutzt wird.

    -

    Beispielsweise SRS beinhaltet 200 Anforderungen aber nur 50 sind in TestLink hinzugefügt worden. Die Test +

    Überschriebene Anzahl von Anf. Dient der Evaluation der Anf. +Abdeckung, falls nicht alle Anforderungen importiert wurden. +Der Wert 0 bedeutet, dass die aktuelle Anzahl der Anf. für Metriken genutzt wird.

    +

    Beispielsweise SRS beinhaltet 200 Anforderungen aber nur 50 sind in TestLink hinzugefügt worden. Die Test Abdeckung ist 25% (falls alle importierten Anforderungen getestet werden).

    Anforderungen

    -

    Klicken Sie auf den Namen einer vorhandenen Anforderungs Spezifikation. Falls keine existiert kann mit einem Klick auf den " . - "Projekt Knoten eine neue erstellt werden. Es können Anforderungen erstellt bearbeitet, gelöscht oder importiert werden. +

    Klicken Sie auf den Namen einer vorhandenen Anforderungs Spezifikation. Falls keine existiert kann mit einem Klick auf den " . + "Projekt Knoten eine neue erstellt werden. Es können Anforderungen erstellt bearbeitet, gelöscht oder importiert werden. Jede Anforderung hat einen Titel, Inhalt und Status. -Der Status sollte 'Normal' oder 'nicht testbar' sein. Nicht testbare Anforderungen gehen nicht in die Metriken -ein. Dieser Parameter kann für noch nicht implementierte Funktionen und falsch entworfene Anforderungen genutzt werden.

    +Der Status sollte 'Normal' oder 'nicht testbar' sein. Nicht testbare Anforderungen gehen nicht in die Metriken +ein. Dieser Parameter kann für noch nicht implementierte Funktionen und falsch entworfene Anforderungen genutzt werden.

    -

    Mit der Nutzung von Multi Aktionen mit abgehakten Anforderungen auf der Spezifikations Umgebung, -können neue Testfälle für Anforderungen erstellt werden. Diese Testfälle werden der Test Suite mit dem +

    Mit der Nutzung von Multi Aktionen mit abgehakten Anforderungen auf der Spezifikations Umgebung, +können neue Testfälle für Anforderungen erstellt werden. Diese Testfälle werden der Test Suite mit dem konfigurierten Namen (Standard ist: \$tlCfg->req_cfg->default_testsuite_name = 'Test Suite erstellt über Anforderung - Auto';) hinzugefügt. Titel und Inhalt -werden in die Testfälle kopiert.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Anforderungsspezifikation erstellen"; //printReq +werden in die Testfälle kopiert.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Anforderungsspezifikation erstellen"; // printReq $TLS_htmltext['printReqSpec'] = "

    Zweck:

    Hier können alle Anforderungen eines Test Projekts, einer Anforderungsspezifikation oder einzelne Anforderungen ausgedruckt werden.

    @@ -243,75 +231,74 @@

    Anweisung:

    1. -

      Wählen Sie die Teile einer Anforderung aus die Sie angezeigt haben wollen und klicken +

      Wählen Sie die Teile einer Anforderung aus die Sie angezeigt haben wollen und klicken dann auf eine Anforderungen, eine Anforderungsspezifikation oder ein Test Projekt. Eine druckbare Seitenansicht wird angezeigt.

    2. Ändern Sie über die \"Zeige als\" drop-box in der Navigationsleiste den Anzeigemodus als -HTML, OpenOffice Writer oder einem Microsoft Word Dokument. +HTML, OpenOffice Writer oder einem Microsoft Word Dokument. Die Hilfe bietet weitere Informationen.

    3. Über den Browser können die Daten dann gedruckt werden.
      Hinweis: Achten Sie bitte darauf nur den Rahmen auf der rechten Seite zu drucken.

    4. -
    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Stichwörter zuweisen"; -$TLS_htmltext['keywordsAssign'] = "

    Zweck:

    -

    Auf der Stichwort zuweisen Seite können Nutzer stapelweise Stichwörter den vorhandenen +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Stichwörter zuweisen"; +$TLS_htmltext['keywordsAssign'] = "

    Zweck:

    +

    Auf der Stichwort zuweisen Seite können Nutzer stapelweise Stichwörter den vorhandenen Testfällen und Suiten zuweisen.

    Um Stichwörter zuzuweisen:

    1. Wählen Sie zuerst links in der Baumansicht eine Test Suite oder ein Testfall aus.
    2. -
    3. Auf der rechten Seite erscheinen Boxen mit verfügbaren und - zugewiesenen Stichwörtern. Damit ist eine schnelle Zuweisung +
    4. Auf der rechten Seite erscheinen Boxen mit verfügbaren und + zugewiesenen Stichwörtern. Damit ist eine schnelle Zuweisung an einzelne Testfälle möglich.
    5. -
    6. Die Auswahl auf der unteren Seite erlaubt ein detailliertes Zuweisen +
    7. Die Auswahl auf der unteren Seite erlaubt ein detailliertes Zuweisen an einen Testfall.

    Wichtiger Hinweis zu Stichwort Zuweisungen bei Test Plänen:

    -

    Stichwort Zuweisungen, die in der Test Spezifikation gemacht werden, haben nur Auswirkungen +

    Stichwort Zuweisungen, die in der Test Spezifikation gemacht werden, haben nur Auswirkungen auf Testfälle des Test Plans und nur wenn der Test Plan die neuste Version des Testfalls -enthält. Wenn der Test Plan eine ältere Version eines Testfalls enthält, erscheinen die gemachten Zuweisungen nicht +enthält. Wenn der Test Plan eine ältere Version eines Testfalls enthält, erscheinen die gemachten Zuweisungen nicht in dem Test Plan.

    Das ist in TestLink so umgesetzt, damit ältere Testfall Versionen im Test Plan nicht von Stichwort -Zuweisungen neuerer Testfall Versionen betroffen sind. -Testfälle des Test Plans können durch ein klick auf Testfälle aktualisieren aktualisiert werden. Dies -sollte möglichst vor dem Zuweisen von Stichwörtern geschehen.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Testfälle ausführen"; -$TLS_htmltext['executeTest'] = "

    Zweck:

    - -

    Erlaubt es dem Nutzer Testfälle auszuführen. Der Nutzer kann das Testfall Ergebnis +Zuweisungen neuerer Testfall Versionen betroffen sind. +Testfälle des Test Plans können durch ein klick auf Testfälle aktualisieren aktualisiert werden. Dies +sollte möglichst vor dem Zuweisen von Stichwörtern geschehen.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Testfälle ausführen"; +$TLS_htmltext['executeTest'] = "

    Zweck:

    + +

    Erlaubt es dem Nutzer Testfälle auszuführen. Der Nutzer kann das Testfall Ergebnis für ein bestimmtes Build zuweisen. In der Hilfe stehen weitere Informationen über Filter und -Einstellungen. " . - "(Klicken Sie bitte auf das Fragezeichen Symbol).

    +Einstellungen. " . + "(Klicken Sie bitte auf das Fragezeichen Symbol).

    Anweisung:

    1. Es muss vorher für den Test Plan ein Build definiert sein.
    2. Wählen Sie bitte ein Build über die Drop-Down Box aus.
    3. Über Filter-Optionen können Sie die Baumansicht auf einige wenige - Testfälle reduzieren. Änderungen der Filter-Optionen müssen über - die Schaltfläche 'Anwenden' gespeichert werden.
    4. + Testfälle reduzieren. Änderungen der Filter-Optionen müssen über + die Schaltfläche 'Anwenden' gespeichert werden.
    5. Wählen Sie, durch einen Klick, einen Testfall aus der Baumansicht.
    6. Tragen Sie das Testergebnis und ggf. Notizen oder BUGs ein.
    7. Speichern
    -

    Hinweis: Sie können Problem-Reports direkt über die Oberfläche erstellen/verfolgen möchten. Dazu muss TestLink -vorher konfiguriert werden, damit es mit Ihrem BUG-Tracker arbeitet.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Testberichte und Metriken"; -$TLS_htmltext['showMetrics'] = "

    Reports sind mit dem Test Plan verbunden" . - "(definiert in dem oberen Navigator). Dieser Test Plan kann sich vom aktuellen Test Plan +

    Hinweis: Sie können Problem-Reports direkt über die Oberfläche erstellen/verfolgen möchten. Dazu muss TestLink +vorher konfiguriert werden, damit es mit Ihrem BUG-Tracker arbeitet.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Testberichte und Metriken"; +$TLS_htmltext['showMetrics'] = "

    Reports sind mit dem Test Plan verbunden" . + "(definiert in dem oberen Navigator). Dieser Test Plan kann sich vom aktuellen Test Plan der Ausführung unterscheiden. Sie können ebenfalls ein Reportformat auswählen:

      @@ -330,7 +317,7 @@

      In dem Dokument 'Test Plan' können Inhalt und Dokumentenstruktur definiert werden.

      Test Report

      -

      In dem Dokument 'Test Report' können Inhalt und Dokumentenstruktur definiert werden. +

      In dem Dokument 'Test Report' können Inhalt und Dokumentenstruktur definiert werden. Testfälle mit den Ergebnissen sind mit eingeschlossen.

      Allgemeine Test Plan Metriken

      @@ -346,16 +333,16 @@
    • Wenn ein Testfall mehrmals auf dem selben Build ausgeführt wird, so hat die letzte Ausführung vorrang. Wenn bspw. das Build 3 dem Team und Tester freigegeben wird und Tester 1 es um 14 Uhr als 'OK' markiert und Tester 2 um 15 Uhr als 'Fehlgeschlagen' markiert, so erscheint das Ergebnis als 'Fehlgeschlagen'.
    • -
    • Testfälle die als 'nicht getestet' markiert sind werden nicht berücksichtigt. Wenn z.B ein Testfall in +
    • Testfälle die als 'nicht getestet' markiert sind werden nicht berücksichtigt. Wenn z.B ein Testfall in Build 1 als 'OK' markiert wird und in Build 2 nicht ausgeführt wird, so wird das zuletzt markierte Ergebnis 'OK' übernommen.

    Die folgenden Tabellen werden gezeigt:

    • Ergebnis nach Top-Level Test Suiten - Listet die Ergebnisse von Suites höchster Ebene. Es werden aufgelistet: Alle Testfälle, 'OK', 'Fehlgeschlagen', + Listet die Ergebnisse von Suites höchster Ebene. Es werden aufgelistet: Alle Testfälle, 'OK', 'Fehlgeschlagen', 'Blockiert', 'nicht getestet' und (x-Prozent) vollständig. Vollständige Testfälle sind Testfälle die als 'OK', - 'Fehlgeschlagen' oder 'Blockiert' markiert wurden. + 'Fehlgeschlagen' oder 'Blockiert' markiert wurden. Ergebnisse von Suites höchster Ebener beinhalten alle erbenden Kind-Suites.
    • Ergebnisse nach Schlüsselwörter Listet alle Schlüsselwörter und zugehörigen Ergebnisse des aktuellen Test Plans, @@ -368,40 +355,40 @@

      Der gesamte Build Status

      Listet die Ergebnisse der Ausführung aller Builds. Jeweils für jedes Build: die Anzahl aller Testfälle, Anzahl aller Testfälle mit 'OK', % 'OK', Anzahl aller Testfälle mit 'Fehlgeschlagen', % 'Fehlgeschlagen', - % 'Blockiert' , 'nicht getestet' und % 'nicht getestet'. Wenn ein Testfall mehrmals auf dem selben Build + % 'Blockiert' , 'nicht getestet' und % 'nicht getestet'. Wenn ein Testfall mehrmals auf dem selben Build ausgeführt wurde, so wird das zuletzt markierte Ergebnis übernommen.

      Query Metriken

      Dieser Report besteht aus einer Query Form Seite und einer Query Ergebnis Seite, die die befragten Daten enthält. Die Query Form Seite ist eine Query Seite mit vier Bedienelementen. Jedem Bedienelement ist ein Standardwert -zugeordnet, der die Anzahl an angefragt Testfällen und Builds maximiert. Die Änderung der +zugeordnet, der die Anzahl an angefragt Testfällen und Builds maximiert. Die Änderung der Bedienelemnte erlaubt es dem Nutzer die Ergebnisse zu filtern und spezifische Reports für bestimmte Besitzer, Stichwörter, Suiten und Build Kombinationen zu generieren.

        -
      • Stichwörter 0->1 Stichwörter können ausgewählt werden. Standardmäßig sind keine Stichwörter ausgewählt. +
      • Stichwörter 0->1 Stichwörter können ausgewählt werden. Standardmäßig sind keine Stichwörter ausgewählt. Ist ein Stichwort nicht ausgewählt, werden alle Testfälle unabhängig von Stichwort Zuweisungen berücksichtigt. Stichwörter sind in der Test Spezifikation oder Stichwort Verwaltung zugeordnet. Stichwort Zuweisungen bei Testfällen -umfassen alle Test Pläne und alle Testfall-Versionen. Wenn Sie an Testergebnissen für ein bestimmtes Stichwort interessiert sind, +umfassen alle Test Pläne und alle Testfall-Versionen. Wenn Sie an Testergebnissen für ein bestimmtes Stichwort interessiert sind, dann können Sie dieses Bedienelement ändern.
      • -
      • Besitzer 0->1 Besitzer können ausgewählt werden. Standardmäßig sind keine Besitzer ausgewählt. +
      • Besitzer 0->1 Besitzer können ausgewählt werden. Standardmäßig sind keine Besitzer ausgewählt. Ist kein Besitzer ausgewählt, werden alle Testfälle unabhängig von Besitzer Zuweisungen berücksichtigt. -Zurzeit gibt es keine Funktion um nach nicht zugewiesenen Testfällen zu suchen. Besitzern werden Testfälle per Test Plan -über die 'Testfälle an Benutzer zuweisen' Seite zugewiesen. Wenn Sie an Testergebnissen eines bestimmtes Testers interessiert sind, +Zurzeit gibt es keine Funktion um nach nicht zugewiesenen Testfällen zu suchen. Besitzern werden Testfälle per Test Plan +über die 'Testfälle an Benutzer zuweisen' Seite zugewiesen. Wenn Sie an Testergebnissen eines bestimmtes Testers interessiert sind, dann können Sie dieses Bedienelement ändern.
      • Top-Level Suite 0->n Suiten höchster Ebene können ausgewählt werden. Standardmäßig sind alle Suiten -ausgewählt. Nur Suiten die selektiert sind, werden für die Ergebnis-Metriken abgefragt. Wenn Sie nur an einer +ausgewählt. Nur Suiten die selektiert sind, werden für die Ergebnis-Metriken abgefragt. Wenn Sie nur an einer bestimmten Suite interessiert sind, dann sollte Sie dieses Bedienelement geändert werden.
      • -
      • Builds 1->n Builds können ausgewählt werden. Standardmäßig sind alle ausgewählt. Für Metriken werden nur -die selektierten Ausführungen eines Builds berücksichtigt. -Wenn Sie bspw. wissen möchten wieviele Testfälle auf den letzten 3 Builds ausgeführt wurden, sollte dieses -Bedienelement geändert werden. -Die Auswahl der Stichwörter, Besitzer und Top Level Suite schreibt die Anzahl der Testfälle eines Test Plans vor, +
      • Builds 1->n Builds können ausgewählt werden. Standardmäßig sind alle ausgewählt. Für Metriken werden nur +die selektierten Ausführungen eines Builds berücksichtigt. +Wenn Sie bspw. wissen möchten wieviele Testfälle auf den letzten 3 Builds ausgeführt wurden, sollte dieses +Bedienelement geändert werden. +Die Auswahl der Stichwörter, Besitzer und Top Level Suite schreibt die Anzahl der Testfälle eines Test Plans vor, womit die Metrik per Suite oder Metrik per Test Plan berechnet werden. Wenn z.B der Besitzer 'Greg', Stichwort='Priorität 1', und alle wählbaren Test Suiten ausgewählt sind, werden nur Priorität 1 Testfälle, die Greg zugewiesen sind berücksichtigt. Die Anzahl der Testfälle im Test Report werden durch diese 3 Bedienelemente -beeinflusst. -Die Auswahl der Builds beeinflusst ob ein Testfall als 'OK', 'Fehlgeschlagen', 'Blockiert', oder 'nicht getestet' gilt. +beeinflusst. +Die Auswahl der Builds beeinflusst ob ein Testfall als 'OK', 'Fehlgeschlagen', 'Blockiert', oder 'nicht getestet' gilt. Bitte sehen Sie nach unter 'Letztes Test Ergebnis'.

      Klicken Sie das Element 'Abschicken' an um mit der Anfrage fortzufahren und die Ausgabe zu betrachten.

      @@ -412,20 +399,20 @@
    • Summe für den gesamten Test Plan
    • ein per Test Suite Abbau aller (Summe / bestandenen / fehlgeschlagenen / blockierten / nicht getesten) und aller Ausführungen. Wenn eine Testfall auf mehreren Builds ausgeführt wurde werden alle Ausführungen der -ausgewählten Builds angezeigt. Allerdings, die Zusammenfassung der Suite beinhaltet nur das Letzte Testergebnis +ausgewählten Builds angezeigt. Allerdings, die Zusammenfassung der Suite beinhaltet nur das Letzte Testergebnis des ausgewählten Builds.
    • Blockierte, fehlgeschlagene und nicht getestete Testfall Reports

      -

      Diese Reports zeigen alle zurzeit blockierten, fehlerhaften oder nicht getesteten Testfälle an. Die -'Letztes Test Ergebnis' Logik (welches oben unter 'Allgemeine Test Plan Metriken' beschrieben ist) -wird angewendet um zu bestimmen ob ein Testfall als 'Fehlgeschlagen', 'Blockiert', oder 'nicht getestet' -betrachtet werden soll. Testergebnisse von fehlgeschlagenen und blockierten Testfällen zeigen +

      Diese Reports zeigen alle zurzeit blockierten, fehlerhaften oder nicht getesteten Testfälle an. Die +'Letztes Test Ergebnis' Logik (welches oben unter 'Allgemeine Test Plan Metriken' beschrieben ist) +wird angewendet um zu bestimmen ob ein Testfall als 'Fehlgeschlagen', 'Blockiert', oder 'nicht getestet' +betrachtet werden soll. Testergebnisse von fehlgeschlagenen und blockierten Testfällen zeigen die zugehörigen BUGs an, falls ein BUG Tracking System genutzt wird.

      Test Reports

      -

      Zeigt den Status von allen Testfällen der Builds. Wenn mehrere Testfälle auf dem selben Build ausgeführt -wurde dann wird das aktuellste Test Ergebnis angezeigt. Es wird empfohlen den Bericht in das Excel-Format +

      Zeigt den Status von allen Testfällen der Builds. Wenn mehrere Testfälle auf dem selben Build ausgeführt +wurde dann wird das aktuellste Test Ergebnis angezeigt. Es wird empfohlen den Bericht in das Excel-Format zu exportieren, um bei großen Datenmengen die Daten einfacher durchzusehen.

      Charts - Allgemeine Test Plan Metriken

      @@ -441,27 +428,26 @@ bestandenen, fehlgeschlagenen, blockierten, nicht getesteten Testfällen erkennen kann.

      Gesamtanzahl der Bugs für jeden Testfall

      -

      Dieser Bericht zeigt den jeden Testfall mit allen für das ganze Projekt geordneten BUGs. Dieser -Bericht ist nur verfügbar wenn ein BUG Tracking System verbunden ist.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Testfälle hinzufügen / entfernen"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Zweck:

      +

      Dieser Bericht zeigt den jeden Testfall mit allen für das ganze Projekt geordneten BUGs. Dieser +Bericht ist nur verfügbar wenn ein BUG Tracking System verbunden ist.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Testfälle hinzufügen / entfernen"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Zweck:

      Nutzer mit entsprechenden Rechten können dem Testplan Testfälle hinzufügen oder Testfälle aus dem Testplan entfernen.

      Anweisung:

        -
      1. Wählen Sie im Baum auf der linken Seite eine Test Suite aus, um alle in der Test Suite +
      2. Wählen Sie im Baum auf der linken Seite eine Test Suite aus, um alle in der Test Suite enthaltenen Testfälle angezeigt zu bekommen.
      3. Wählen Sie alle Testfälle, die Sie hinzufügen bzw. entfernen wollen und klicken Sie auf den \"Hinzufügen / Entfernen der ausgewählten Testfälle\" Button
      4. -
      "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Testfälle an Benutzer zuweisen"; -$TLS_htmltext['tc_exec_assignment'] = "

      Zweck:

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Testfälle an Benutzer zuweisen"; +$TLS_htmltext['tc_exec_assignment'] = "

      Zweck:

      Diese Seite erlaubt es Leitern den Nutzern bestimmte Tests im Test Plan zuzuweisen.

      Anweisung:

      @@ -469,7 +455,7 @@
    • Wählen Sie eine zu testende Test Suite oder Testfall aus.
    • Wählen Sie einen Tester aus.
    • Über die Schaltfläche 'Speichern' wird die Zuweisung übernommen.
    • -
    • Öffnen Sie die Ausführungs-Seite um die Zuweisung zu verifizieren. Es ist möglich nach +
    • Öffnen Sie die Ausführungs-Seite um die Zuweisung zu verifizieren. Es ist möglich nach Nutzern zu Filtern.
    • @@ -479,16 +465,16 @@
    • Sind Testfälle zugewiesen, erscheint eine Schaltfläche worüber die Zuweisung der Testfällen entzogen werden kann. Nach einem Klick auf die Schaltfläche sind alle Testfälle nicht mehr zugewiesen.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Verlinkte Testfälle aktualisieren"; -$TLS_htmltext['planUpdateTC'] = "

      Zweck

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Verlinkte Testfälle aktualisieren"; +$TLS_htmltext['planUpdateTC'] = "

      Zweck

      Diese Seite erlaubt das Aktualisieren von Testfällen auf eine neue (andere) Version, wenn die Test Spezifikation -sich geändert hat. Oft klären sich Funktionalitäten während dem Testen." . - " Der Nutzer ändert die Test Spezifikation, jedoch müssen Änderungen im Test Plans übernommen werden. Andernfalls" . - " wird die originale Version im Test Plan behalten, um den richtigen Bezug der Testergebnisse auf den korrekten ". - "Text eines Testfalls sicherzustellen.

      +sich geändert hat. Oft klären sich Funktionalitäten während dem Testen." . + " Der Nutzer ändert die Test Spezifikation, jedoch müssen Änderungen im Test Plans übernommen werden. Andernfalls" . + " wird die originale Version im Test Plan behalten, um den richtigen Bezug der Testergebnisse auf den korrekten " . + "Text eines Testfalls sicherzustellen.

      Anweisung:

        @@ -496,13 +482,13 @@
      1. Wählen Sie die neue Version des bestimmten Testfalls über die Kombo-Box aus.
      2. Klicken Sie auf 'Aktualisiere Test Plan' um die Änderungen zu übernehmen.
      3. Um zu prüfen: Öffnen Sie die Ausführungs-Seite, um die Texte der Testfälle zu betrachten.
      4. -
      "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Dringlichkeit der Tests bestimmen"; -$TLS_htmltext['test_urgency'] = "

      Zweck:

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Dringlichkeit der Tests bestimmen"; +$TLS_htmltext['test_urgency'] = "

      Zweck:

      Um die Testprioritäten von Testfällen vorzugeben, ist es in TestLink möglich die Dringlichkeit einer Test Suite zu setzen. - Die Testpriorität hängt sowohl von der Wichtigkeit der Testfälle als auch von der im Test Plan definierten + Die Testpriorität hängt sowohl von der Wichtigkeit der Testfälle als auch von der im Test Plan definierten Dringlichkeit ab. Der Test Leiter sollte einen Satz von Testfällen spezifizieren, die als erstes getestet werden können. Das hilft sicherzustellen, dass auch beim Testen unter Zeitdruck die wichtigsten Tests berücksichtigt werden.

      @@ -512,15 +498,15 @@
    • Wählen Sie im Navigator auf der linken Fensterseite eine Test Suite aus, um die Dringlichkeit eines Produkts/Bauteilmerkmals zu setzen.
    • Wählen Sie ein Dringlichkeits Niveau (hoch, mittel oder niedrig) aus. Mittel ist der Standardwert. - Sie können die Priorität für unberührte Teile Produkts vermindern und für Bauteile mit + Sie können die Priorität für unberührte Teile Produkts vermindern und für Bauteile mit signifikanten Änderungen steigern.
    • Klicken Sie auf 'Speichern', um die Änderungen zu übernehmen.
    • -

      Zum Beispiel: Ein Testfall mit einer hohen Wichtigkeit in einer Test Suite mit niedriger Dringlichkeit " . - "bekommt mittlere Priorität."; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTcDocumentation'] = "Plan add testcase documentation"; -$TLS_htmltext['planAddTcDocumentation'] = "

      @TODO Plan add testcase documentation

      "; - +

      Zum Beispiel: Ein Testfall mit einer hohen Wichtigkeit in einer Test Suite mit niedriger Dringlichkeit " . + "bekommt mittlere Priorität."; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTcDocumentation'] = "Plan add testcase documentation"; +$TLS_htmltext['planAddTcDocumentation'] = "

      @TODO Plan add testcase documentation

      "; + ?> diff --git a/locale/en_GB/description.php b/locale/en_GB/description.php index 5f93947a46..ce894d4bad 100644 --- a/locale/en_GB/description.php +++ b/locale/en_GB/description.php @@ -1,34 +1,33 @@ -Options for a generated document

      This table allows the user to filter test cases before they are viewed. If @@ -36,8 +35,8 @@ presented, check or uncheck, click on Filter, and select the desired data level from the tree.

      -

      Document Header: Users can filter out Document Header information. -Document Header information includes: Introduction, Scope, References, +

      Document Header: Users can filter out Document Header information. +Document Header information includes: Introduction, Scope, References, Test Methodology, and Test Limitations.

      Test Case Body: Users can filter out Test Case Body information. Test Case Body information @@ -52,35 +51,35 @@

      Table of Content: TestLink inserts list of all titles with internal hypertext links if checked.

      -

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component -in second case.

      "; - -// testPlan.html +

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component +in second case.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Test Plan

      General

      -

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with +

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with particular builds of product in time and trace results.

      Test Execution

      -

      This section is where users can execute test cases (write test results) and -print Test case suite of the Test Plan. This section is where users can track -the results of their test case execution.

      +

      This section is where users can execute test cases (write test results) and +print Test case suite of the Test Plan. This section is where users can track +the results of their test case execution.

      Test Plan Management

      -

      This section, which is only lead accessible, allows users to administrate test plans. -Administering test plans involves creating/editing/deleting plans, -adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can +

      This section, which is only lead accessible, allows users to administrate test plans. +Administering test plans involves creating/editing/deleting plans, +adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can see which plan.
      -Users with lead permissions may also set the priority/risk and ownership of -Test case suites (categories) and create testing milestones.

      - -

      Note: It is possible that users may not see a dropdown containing any Test plans. -In this situation all links (except lead enabled ones) will be unlinked. If you -are in this situation you must contact a lead or admin to grant you the proper -project rights or create a Test Plan for you.

      "; - -// custom_fields.html +Users with lead permissions may also set the priority/risk and ownership of +Test case suites (categories) and create testing milestones.

      + +

      Note: It is possible that users may not see a dropdown containing any Test plans. +In this situation all links (except lead enabled ones) will be unlinked. If you +are in this situation you must contact a lead or admin to grant you the proper +project rights or create a Test Plan for you.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Custom Fields

      Following are some facts about the implementation of custom fields:

        @@ -99,7 +98,7 @@
      • Caption variable name (eg: This is the value that is supplied to lang_get() API , or displayed as-is if not found in language file).
      • Custom field type (string, numeric, float, enum, email)
      • -
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list +
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list and combo types.
        Use the pipe ('|') character to separate possible values for an enumeration. One of the possible values @@ -119,16 +118,16 @@
      • Enable on test plan design. User can change the value during Test Plan design (add test cases to test plan)
      • Available for. User choose to what kind of item the field belows.
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Executing Test Cases

      Allows users to 'execute' test cases. Execution itself is merely assigning a test case a result (pass,fail,blocked) against a selected build.

      Access to a bug tracking system could be configured. User can directly add a new bugs -and browse existing ones then. See Installation manual for more.

      "; - -//bug_add.html +and browse existing ones then. See Installation manual for more.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Add Bugs to Test Case

      (only if it is configured) TestLink has a very simple integration with Bug Tracking Systems (BTS), @@ -138,7 +137,7 @@

    • Insert new bug.
    • Display existent bug info.
    -

    +

    Process to add a bug

    @@ -147,12 +146,12 @@

  • Step 2: write down the BUGID assigned by BTS.
  • Step 3: write BUGID on the input field.
  • Step 4: use add bug button.
  • - + After closing the add bug page, you will see relevant bug data on the execute page. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Settings

    Settings allows you to select the test plan, build and platform (if available) to @@ -178,77 +177,74 @@

    Keyword Filter

    -

    You can filter test cases by the keywords that have been assigned. You can choose " . -"multiple keywords by using CTRL-Click. If you chose more than one keyword you can " . -"decide whether only test cases are shown that have all chosen keywords assigned " . -"(radiobutton \"And\") or at least one of the chosen keywords (radiobutton \"Or\").

    +

    You can filter test cases by the keywords that have been assigned. You can choose " . + "multiple keywords by using CTRL-Click. If you chose more than one keyword you can " . + "decide whether only test cases are shown that have all chosen keywords assigned " . + "(radiobutton \"And\") or at least one of the chosen keywords (radiobutton \"Or\").

    Priority Filter

    -

    You can filter test cases by test priority. The test priority is \"test case importance\" " . -"combined with \"test urgency\" within the current test plan.

    +

    You can filter test cases by test priority. The test priority is \"test case importance\" " . + "combined with \"test urgency\" within the current test plan.

    User Filter

    -

    You can filter test cases that are not assigned (\"Nobody\") or assigned to \"Somebody\". " . -"You can also filter test cases that are assigned to a specific tester. If you chose a specific " . -"tester you also have the possibility to show test cases that are unassigned in addition to " . -"those test cases (advanced Filters are available).

    +

    You can filter test cases that are not assigned (\"Nobody\") or assigned to \"Somebody\". " . + "You can also filter test cases that are assigned to a specific tester. If you chose a specific " . + "tester you also have the possibility to show test cases that are unassigned in addition to " . + "those test cases (advanced Filters are available).

    Result Filter

    -

    You can filter test cases by result (advanced Filters are available). You can filter by " . -"result \"on chosen build for execution\", \"on latest execution\", \"on ALL builds\", " . -"\"on ANY build\" and \"on specific build\". If \"specific build\" is chosen you then can " . -"specify the build.

    "; - - -// newest_tcversions.html +

    You can filter test cases by result (advanced Filters are available). You can filter by " . + "result \"on chosen build for execution\", \"on latest execution\", \"on ALL builds\", " . + "\"on ANY build\" and \"on specific build\". If \"specific build\" is chosen you then can " . + "specify the build.

    "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Newest versions of linked Test Cases

    The whole set of Test Cases linked to Test Plan is analyzed, and a list of Test Cases which have a newest version is displayed (against the current set of the Test Plan). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Requirements Coverage


    This feature allows to map a coverage of user or system requirements by test cases. Navigate via link \"Requirement Specification\" in main screen.

    Requirements Specification

    -

    Requirements are grouped by 'Requirements Specification' document which is related to -Test Project.
    TestLink doesn't support versions for both Requirements Specification -and Requirements itself. So, version of document should be added after +

    Requirements are grouped by 'Requirements Specification' document which is related to +Test Project.
    TestLink doesn't support versions for both Requirements Specification +and Requirements itself. So, version of document should be added after a Specification Title. -An user can add simple description or notes to Scope field.

    +An user can add simple description or notes to Scope field.

    -

    Overwritten count of REQs serves for -evaluation Req. coverage in case that not all requirements are added (imported) in. -The value 0 means that current count of requirements is used for metrics.

    -

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test +

    Overwritten count of REQs serves for +evaluation Req. coverage in case that not all requirements are added (imported) in. +The value 0 means that current count of requirements is used for metrics.

    +

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test coverage is 25% (if all these added requirements will be tested).

    Requirements

    Click on title of a created Requirements Specification. You can create, edit, delete or import requirements for the document. Each requirement has title, scope and status. Status should be \"Normal\" or \"Not testable\". Not testable requirements are not counted -to metrics. This parameter should be used for both unimplemented features and -wrong designed requirements.

    +to metrics. This parameter should be used for both unimplemented features and +wrong designed requirements.

    -

    You can create new test cases for requirements by using multi action with checked +

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite -with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = +with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Title and Scope are copied to these Test cases.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Coverage:

    -A value of e.g. \"40% (8/20)\" means that 20 Test Cases have to be created for this Requirement -to test it completely. 8 of those have already been created and linked to this Requirement, which +A value of e.g. \"40% (8/20)\" means that 20 Test Cases have to be created for this Requirement +to test it completely. 8 of those have already been created and linked to this Requirement, which makes a coverage of 40 percent. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    Internal links on scope:

    -

    Internal links serve the purpose of creating links to other requirements/requirement specifications +

    Internal links serve the purpose of creating links to other requirements/requirement specifications with a special syntax. Internal Links behaviour can be changed in the config file.

    Usage: @@ -256,7 +252,7 @@ Link to requirements: [req]req_doc_id[/req]
    Link to requirement specifications: [req_spec]req_spec_doc_id[/req_spec]

    -

    The test project of the requirement / requirement specification, a version and an anchor +

    The test project of the requirement / requirement specification, a version and an anchor to jump to can also be specified:
    [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
    This syntax also works for requirement specifications (version attribute has no effect).
    @@ -264,12 +260,11 @@

    Log message for changes:

    Whenever a change is made Testlink will ask for a log message. This log message served the purpose of traceability. -If only the scope of the requirement has changed you are free to decide whether to create a new revision or not. +If only the scope of the requirement has changed you are free to decide whether to create a new revision or not. Whenever anything besides the scope is changed you are forced to create a new revision.

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    Direct Links:

    To easily share this document with others simply click the globe icon at the top of this document to create a direct link.

    @@ -281,17 +276,16 @@

    Shows all linked test cases for this requirement.

    Relations:

    -

    Requirement Relations are used to model relationships between requirements. -Custom relations and the option to allow relations between requirements of +

    Requirement Relations are used to model relationships between requirements. +Custom relations and the option to allow relations between requirements of different test projects can be configured on the config file. -If you set the relation \"Requirement A is parent of Requirement B\", +If you set the relation \"Requirement A is parent of Requirement B\", Testlink will set the relation \"Requirement B is child of Requirement A\" implicitly.

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    Internal links on scope:

    -

    Internal links serve the purpose of creating links to other requirements/requirement specifications +

    Internal links serve the purpose of creating links to other requirements/requirement specifications with a special syntax. Internal Links behaviour can be changed in the config file.

    Usage: @@ -299,37 +293,34 @@ Link to requirements: [req]req_doc_id[/req]
    Link to requirement specifications: [req_spec]req_spec_doc_id[/req_spec]

    -

    The test project of the requirement / requirement specification, a version and an anchor +

    The test project of the requirement / requirement specification, a version and an anchor to jump to can also be specified:
    [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
    This syntax also works for requirement specifications (version attribute has no effect).
    If you do not specify a version the whole requirement including all versions will be shown.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Regarding 'Save Custom Fields'

    -If you have defined and assigned to Test Project,
    +If you have defined and assigned to Test Project,
    Custom Fields with:
    'Display on test plan design=true' and
    'Enable on test plan design=true'
    you will see these in this page ONLY for Test Cases linked to Test Plan. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "More information about testers:
    If you click on a tester name in this table, you will get a more detailed overview about all Test Cases assigned to that user and his testing progress.

    Note:
    -This Report shows those test cases, which are assigned to a specific user and have been executed -based on each active build. Even if a test case has been executed by another user than the assigned user, +This Report shows those test cases, which are assigned to a specific user and have been executed +based on each active build. Even if a test case has been executed by another user than the assigned user, the test case will appear as executed for the assigned user. -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/en_GB/strings.txt b/locale/en_GB/strings.txt index fed1ddc6ed..b230d0ec64 100644 --- a/locale/en_GB/strings.txt +++ b/locale/en_GB/strings.txt @@ -69,6 +69,7 @@ $TLS_asc = "Ascending"; $TLS_any = "Any"; $TLS_all = "All"; +$TLS_any_bracketed = "[Any]"; $TLS_alt_delete = "delete"; $TLS_assigned_by = "Assigned by"; $TLS_attribute = "Attribute"; @@ -95,6 +96,7 @@ $TLS_edited_by = "Edited by"; $TLS_days = "days"; $TLS_desc = "Descending"; $TLS_description = "Description"; +$TLS_delete_confirm_question = "Are you sure you want to delete"; $TLS_doc_id = "Document ID"; $TLS_doc_id_short = "Doc ID"; $TLS_destination_top = "Destination position top"; @@ -125,6 +127,7 @@ $TLS_importance = "Importance"; $TLS_imported = "Imported"; $TLS_important_notice = "Important Notice"; $TLS_its_duedate_with_separator = "Due date: "; +$TLS_hint_mail_for_tester = "Additional text to be sent in the notification email"; $TLS_hint_like_search_on_name = 'Search wil be done on NAME in LIKE %value%'; $TLS_keyword = "Keyword"; @@ -181,6 +184,7 @@ $TLS_req_specification = "Req. Specification"; $TLS_revision = "revision"; $TLS_revision_short = "rev"; $TLS_revision_tag = "[r%s]"; +$TLS_version_tag = "[v%s]"; $TLS_version_revision_tag = "[v%sr%s]"; $TLS_srs = "SRS"; @@ -878,7 +882,6 @@ $TLS_btn_hide_cf = "Hide Custom Fields"; $TLS_btn_show_cf = "Show Custom Fields"; $TLS_btn_export_testplan_tree = 'Export Test Plan'; $TLS_btn_export_testplan_tree_for_results = 'Export for results import'; - $TLS_expand_tree = "Expand tree"; $TLS_collapse_tree = "Collapse tree"; $TLS_filter_active_inactive = "Active/Inactive"; @@ -1186,7 +1189,9 @@ $TLS_del_script_warning_msg = "Really delete this script link from TestLink Data // gui/templates/reqSpecList.tpl +$TLS_btn_assign_tc = "Assign test case"; $TLS_no_docs = "No available documents."; +$TLS_req_list_docs = "List of documents"; @@ -1724,7 +1729,6 @@ $TLS_btn_new_version_from_latest = "Create New Version From Latest"; $TLS_btn_new_sibling = "New sibling"; $TLS_hint_new_sibling = "Create another test case under current Test Suite"; $TLS_hint_new_version = "Create a new version"; - $TLS_can_not_edit_tc = "You can not edit this version because it has been executed"; $TLS_can_not_edit_frozen_tc = "You can not edit this version because it has been frozen"; $TLS_can_not_delete_relation_frozen_tc = "You can not delete this relation : testcase has been frozen"; @@ -3851,7 +3855,7 @@ $TLS_demo_usage = "This is a DEMO SITE, use it with RESPECT.
    " . "If you find TestLink useful think about supporting our work
    "; -// reqSpecMoveOrCopy.tpl +// ----- reqSpecMoveOrCopy.tpl $TLS_remove_kw_msgbox_title = "Remove keyword"; @@ -3895,7 +3899,7 @@ $TLS_assignments = "Assignments:"; $TLS_btn_bulk_mon = 'Bulk Monitoring'; $TLS_bulk_monitoring = $TLS_btn_bulk_mon; $TLS_monitoring = 'Monitoring'; -$TLS_btn_toogle_mon = 'Toogle Monitoring'; +$TLS_btn_toogle_mon = 'Toggle Monitoring'; $TLS_btn_start_mon = 'Start Monitoring'; $TLS_btn_stop_mon = 'Stop Monitoring'; @@ -3926,7 +3930,7 @@ $TLS_search_words_on_attr = "Word/Words will be searched among one or more attri $TLS_search_other_attr = "You can set search criteria that does not use words. But This search criteria will be added on AND mode"; -$TLS_search_created_by_ph = 'value will be searched on login/firts name/last name'; +$TLS_search_created_by_ph = 'value will be searched on login/first name/last name'; $TLS_multiple_entities_search = 'Search on multiple entities'; $TLS_no_access_to_feature = 'You do not have enough rights to access the feature'; diff --git a/locale/en_GB/texts.php b/locale/en_GB/texts.php index 6c9279da76..e7b6b237ba 100644 --- a/locale/en_GB/texts.php +++ b/locale/en_GB/texts.php @@ -1,39 +1,36 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat - * @copyright 2003-2009, TestLink community - * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ - * @link http://www.teamst.org/index.php - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Application error"; -$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . - "logs for details.

    You are welcome to report the problem. Please visit our " . - "website.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; -$TLS_htmltext['assignReqs'] = "

    Purpose:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat + * @copyright 2003-2009, TestLink community + * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ + * @link http://www.teamst.org/index.php + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Application error"; +$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . + "logs for details.

    You are welcome to report the problem. Please visit our " . + "website.

    "; + +$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; +$TLS_htmltext['assignReqs'] = "

    Purpose:

    Users can set relations between requirements and test cases. A test designer could define relations 0..n to 0..n. I.e. One test case could be assigned to none, one or more requirements and vice versa. Such traceability matrix helps to investigate test coverage @@ -44,7 +41,7 @@

    1. Choose an Test Case in tree at the left. The combo box with list of Requirements Specifications is shown at the top of the workarea.
    2. -
    3. Choose a Requirements Specification Document if more once defined. +
    4. Choose a Requirements Specification Document if more once defined. TestLink automatically reloads the page.
    5. A middle block of workarea lists all requirements (from choosen Specification), which are connected with the test case. Bottom block 'Available Requirements' lists all @@ -54,49 +51,47 @@ the middle block 'Assigned Requirements'.

    Warning:

    -A frozen requirement cannot be modified to update coverage. According to this fact, frozen requirements are listed but associated checkboxed are disabled."; +A frozen requirement cannot be modified to update coverage. According to this fact, frozen requirements are listed but associated checkboxed are disabled."; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Test Specification"; +$TLS_htmltext['editTc'] = "

    The Test Specification allows users to view " . + "and edit all of the existing Test Suites and Test Cases. " . + "Test Cases are versioned and all of the previous versions are available and can be " . + "viewed and managed here.

    - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Test Specification"; -$TLS_htmltext['editTc'] = "

    The Test Specification allows users to view " . - "and edit all of the existing Test Suites and Test Cases. " . - "Test Cases are versioned and all of the previous versions are available and can be " . - "viewed and managed here.

    -

    Getting Started:

      -
    1. Select your Test Project in the navigation tree (the root node). Please note: " . - "You can always change the active Test Project by selecting a different one from the " . - "drop-down list in the top-right corner.
    2. -
    3. Create a new Test Suite by clicking on Create (Test Suite Operations). Test Suites can " . - "bring structure to your test documents according to your conventions (functional/non-functional " . - "tests, product components or features, change requests, etc.). The description of " . - "a Test Suite could hold the scope of the included test cases, default configuration, " . - "links to relevant documents, limitations and other useful information. In general, " . - "all annotations that are common to the Child Test Cases. Test Suites follow " . - "the "folder" metaphor, thus users can move and copy Test Suites within " . - "the Test project. Also, they can be imported or exported (including the contained Test cases).
    4. -
    5. Test Suites are scalable folders. Users can move or copy Test Suites within " . - "the Test project. Test Suites can be imported or exported (include Test Cases). -
    6. Select your newly created Test Suite in the navigation tree and create " . - "a new Test Case by clicking on Create (Test Case Operations). A Test Case specifies " . - "a particular testing scenario, expected results and custom fields defined " . - "in the Test Project (refer to the user manual for more information). It is also possible " . - "to assign keywords for improved traceability.
    7. +
    8. Select your Test Project in the navigation tree (the root node). Please note: " . + "You can always change the active Test Project by selecting a different one from the " . + "drop-down list in the top-right corner.
    9. +
    10. Create a new Test Suite by clicking on Create (Test Suite Operations). Test Suites can " . + "bring structure to your test documents according to your conventions (functional/non-functional " . + "tests, product components or features, change requests, etc.). The description of " . + "a Test Suite could hold the scope of the included test cases, default configuration, " . + "links to relevant documents, limitations and other useful information. In general, " . + "all annotations that are common to the Child Test Cases. Test Suites follow " . + "the "folder" metaphor, thus users can move and copy Test Suites within " . + "the Test project. Also, they can be imported or exported (including the contained Test cases).
    11. +
    12. Test Suites are scalable folders. Users can move or copy Test Suites within " . + "the Test project. Test Suites can be imported or exported (include Test Cases). +
    13. Select your newly created Test Suite in the navigation tree and create " . + "a new Test Case by clicking on Create (Test Case Operations). A Test Case specifies " . + "a particular testing scenario, expected results and custom fields defined " . + "in the Test Project (refer to the user manual for more information). It is also possible " . + "to assign keywords for improved traceability.
    14. Navigate via the tree view on the left side and edit data. Each Test case stores own history.
    15. Assign your created Test Specification to a Test Plan when your Test cases are ready.
    -

    With TestLink you can organize Test Cases into Test Suites." . -"Test Suites can be nested within other test suites, enabling you to create hierarchies of Test Suites. - You can then print this information together with the Test Cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; -$TLS_htmltext['searchTc'] = "

    Purpose:

    +

    With TestLink you can organize Test Cases into Test Suites." . + "Test Suites can be nested within other test suites, enabling you to create hierarchies of Test Suites. + You can then print this information together with the Test Cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; +$TLS_htmltext['searchTc'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result include just test cases from actual Test Project.

    @@ -108,13 +103,13 @@
  • Choose required keyword or left value 'Not applied'.
  • Click the Search button.
  • All fulfilled test cases are shown. You can modify Test Cases via 'Title' link.
  • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; -$TLS_htmltext['searchReq'] = "

    Purpose:

    +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; +$TLS_htmltext['searchReq'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirements from actual Test Project.

    @@ -132,12 +127,12 @@

    - Only requirements within the current project will be searched.
    - The search is case-insensitive.
    -- Empty fields are not considered.

    "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; -$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    +- Empty fields are not considered.

    "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; +$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirement specifications from actual Test Project.

    @@ -155,35 +150,33 @@

    - Only requirement specifications within the current project will be searched.
    - The search is case-insensitive.
    -- Empty fields are not considered.

    "; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Purpose:

    +- Empty fields are not considered.

    "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Purpose:

    From here you can print a single test case, all the test cases within a test suite, or all the test cases in a test project or plan.

    Get Started:

    1. -

      Select the parts of the test cases you want to display, and then click on a test case, +

      Select the parts of the test cases you want to display, and then click on a test case, test suite, or the test project. A printable page will be displayed.

    2. -
    3. Use the \"Show As\" drop-box in the navigation pane to specify whether you want -the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. +

    4. Use the \"Show As\" drop-box in the navigation pane to specify whether you want +the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. See help for more information.

    5. Use your browser's print functionality to actually print the information.
      Note: Make sure to only print the right-hand frame.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    Requirements Specification

    @@ -201,8 +194,8 @@

    Requirements

    -

    Click the title of an existing Requirements Specification. If none exist, " . - "click on the project node to create one. You can create, edit, delete +

    Click the title of an existing Requirements Specification. If none exist, " . + "click on the project node to create one. You can create, edit, delete or import requirements for the document. Each requirement has a title, scope and status. A status should be either 'Normal' or 'Not testable'. Not testable requirements are not counted to metrics. This parameter should be used for both unimplemented features and @@ -211,34 +204,32 @@

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite with name defined in configuration (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Title and Scope are copied to these Test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; //printReq +'Test suite created by Requirement - Auto';)
    . Title and Scope are copied to these Test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; // printReq $TLS_htmltext['printReqSpec'] = "

    Purpose:

    You can generate document with the requirements within a requirement specification, or all the requirements in a test project.

    Get Started:

    1. -

      Select the parts of the requirements you want to display, and then click on a +

      Select the parts of the requirements you want to display, and then click on a requirement specification, or the test project. A printable page will be displayed.

    2. -
    3. Use the \"Show As\" drop-box in the navigation pane to specify whether you want -the information displayed as HTML, or in a Pseudo Micosoft Word document. +

    4. Use the \"Show As\" drop-box in the navigation pane to specify whether you want +the information displayed as HTML, or in a Pseudo Micosoft Word document. See help for more information.

    5. Use your browser's print functionality to actually print the information.
      Note: Make sure to only print the right-hand frame.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; -$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

    @@ -262,16 +253,15 @@

    TestLink uses this approach so that older versions of test cases in test plans are not affected by keyword assignments you make to the most recent version of the test case. If you want your test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

    Purpose:

    +Modified Test Cases' functionality BEFORE making keyword assignments.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

    Purpose:

    Allows user to execute Test cases. User can assign Test result -to Test Case for a Build. See help for more information about filters and settings " . - "(click on the question mark icon).

    +to Test Case for a Build. See help for more information about filters and settings " . + "(click on the question mark icon).

    Get started:

    @@ -279,19 +269,19 @@
  • User must have defined a Build for the Test Plan.
  • Select a Build from the drop down box
  • If you want to see only a few testcases instead of the whole tree, - you can choose which filters to apply. Click the \"Apply\"-Button - after you have changed the filters.
  • + you can choose which filters to apply. Click the \"Apply\"-Button + after you have changed the filters.
  • Click on a test case in the tree menu.
  • Fill out the test case result and any applicable notes or bugs.
  • Save results.
  • -

    Note: TestLink must be configured to collaborate with your Bug tracker -if you would like to create/trace a problem report directly from the GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; -$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . - "(defined in top of navigator). This Test Plan could differ from the +

    Note: TestLink must be configured to collaborate with your Bug tracker +if you would like to create/trace a problem report directly from the GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; +$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . + "(defined in top of navigator). This Test Plan could differ from the current Test Plan for execution. You can also select a Report format:

    • HTML - report is displayed in web page
    • @@ -370,12 +360,11 @@

      Total Bugs For Each Test Case

      This report shows each test case with all of the bugs filed against it for the entire project. -This report is only available if a Bug Tracking System is connected.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Purpose:

      +This report is only available if a Bug Tracking System is connected.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Purpose:

      Allows user (with lead level permissions) to add or remove test cases into a Test plan.

      To add or remove Test cases:

      @@ -383,11 +372,11 @@
    • Click on a test suite to see all of its test suites and all of its test cases.
    • When you are done click the 'Add / Remove Test Cases' button to add or remove the test cases. Note: Is not possible to add the same test case multiple times.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; -$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; +$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      This page allows test leaders to assign users to particular tests within the Test Plan.

      Get Started

      @@ -396,15 +385,15 @@
    • Select a planned tester.
    • Click the 'Save' button to submit assignment.
    • Open execution page to verify assignment. You can set-up a filter for users.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; -$TLS_htmltext['planUpdateTC'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; +$TLS_htmltext['planUpdateTC'] = "

      Purpose

      This page allows updating a Test case to a newer (different) version if a Test -Specification is changed. It often happens that some functionality is clarified during testing." . - " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . - " plan holds original version to be sure, that results refer to the correct text of a Test case.

      +Specification is changed. It often happens that some functionality is clarified during testing." . + " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . + " plan holds original version to be sure, that results refer to the correct text of a Test case.

      Get Started

        @@ -412,14 +401,13 @@
      1. Choose a new version from the combo-box menu for a particular Test case.
      2. Click the 'Update Test plan' button to submit changes.
      3. To verify: Open execution page to view text of the test case(s).
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; -$TLS_htmltext['test_urgency'] = "

      Purpose

      -

      TestLink allows setting the urgency of a Test Suite to affect the testing Priority of test cases. - Test priority depends on both Importance of Test cases and Urgency defined in +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; +$TLS_htmltext['test_urgency'] = "

      Purpose

      +

      TestLink allows setting the urgency of a Test Suite to affect the testing Priority of test cases. + Test priority depends on both Importance of Test cases and Urgency defined in the Test Plan. Test leader should specify a set of test cases that could be tested at first. It helps to ensure that testing will cover the most important tests also under time pressure.

      @@ -433,10 +421,9 @@ significant changes.
    • Click the 'Save' button to submit changes.
    • -

      For example, a Test case with a High importance in a Test suite with Low urgency " . - "will be Medium priority."; - - -// ------------------------------------------------------------------------------------------ - +

      For example, a Test case with a High importance in a Test suite with Low urgency " . + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/en_US/description.php b/locale/en_US/description.php index 96859369be..968fb791e8 100644 --- a/locale/en_US/description.php +++ b/locale/en_US/description.php @@ -1,32 +1,31 @@ -Options for a generated document

      This table allows the user to filter test cases before they are viewed. If @@ -34,8 +33,8 @@ presented, check or uncheck, click on Filter, and select the desired data level from the tree.

      -

      Document Header: Users can filter out Document Header information. -Document Header information includes: Introduction, Scope, References, +

      Document Header: Users can filter out Document Header information. +Document Header information includes: Introduction, Scope, References, Test Methodology, and Test Limitations.

      Test Case Body: Users can filter out Test Case Body information. Test Case Body information @@ -50,35 +49,35 @@

      Table of Content: TestLink inserts list of all titles with internal hypertext links if checked.

      -

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component -in second case.

      "; - -// testPlan.html +

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component +in second case.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Test Plan

      General

      -

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with +

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with particular builds of product in time and trace results.

      Test Execution

      -

      This section is where users can execute test cases (write test results) and -print Test case suite of the Test Plan. This section is where users can track -the results of their test case execution.

      +

      This section is where users can execute test cases (write test results) and +print Test case suite of the Test Plan. This section is where users can track +the results of their test case execution.

      Test Plan Management

      -

      This section, which is only lead accessible, allows users to administrate test plans. -Administering test plans involves creating/editing/deleting plans, -adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can +

      This section, which is only lead accessible, allows users to administrate test plans. +Administering test plans involves creating/editing/deleting plans, +adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can see which plan.
      -Users with lead permissions may also set the priority/risk and ownership of -Test case suites (categories) and create testing milestones.

      - -

      Note: It is possible that users may not see a dropdown containing any Test plans. -In this situation all links (except lead enabled ones) will be unlinked. If you -are in this situation you must contact a lead or admin to grant you the proper -project rights or create a Test Plan for you.

      "; - -// custom_fields.html +Users with lead permissions may also set the priority/risk and ownership of +Test case suites (categories) and create testing milestones.

      + +

      Note: It is possible that users may not see a dropdown containing any Test plans. +In this situation all links (except lead enabled ones) will be unlinked. If you +are in this situation you must contact a lead or admin to grant you the proper +project rights or create a Test Plan for you.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Custom Fields

      Following are some facts about the implementation of custom fields:

        @@ -97,7 +96,7 @@
      • Caption variable name (eg: This is the value that is supplied to lang_get() API , or displayed as-is if not found in language file).
      • Custom field type (string, numeric, float, enum, email)
      • -
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list +
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list and combo types.
        Use the pipe ('|') character to separate possible values for an enumeration. One of the possible values @@ -117,16 +116,16 @@
      • Enable on test plan design. User can change the value during Test Plan design (add test cases to test plan)
      • Available for. User choose to what kind of item the field belows.
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Executing Test Cases

      Allows users to 'execute' test cases. Execution itself is merely assigning a test case a result (pass,fail,blocked) against a selected build.

      Access to a bug tracking system could be configured. User can directly add a new bugs -and browse existing ones then. See Installation manual for more.

      "; - -//bug_add.html +and browse existing ones then. See Installation manual for more.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Add Bugs to Test Case

      (only if it is configured) TestLink has a very simple integration with Bug Tracking Systems (BTS), @@ -136,7 +135,7 @@

    • Insert new bug.
    • Display existent bug info.
    -

    +

    Process to add a bug

    @@ -145,12 +144,12 @@

  • Step 2: write down the BUGID assigned by BTS.
  • Step 3: write BUGID on the input field.
  • Step 4: use add bug button.
  • - + After closing the add bug page, you will see relevant bug data on the execute page. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Settings

    Settings allows you to select the test plan, build and platform (if available) to @@ -176,77 +175,74 @@

    Keyword Filter

    -

    You can filter test cases by the keywords that have been assigned. You can choose " . -"multiple keywords by using CTRL-Click. If you chose more than one keyword you can " . -"decide whether only test cases are shown that have all chosen keywords assigned " . -"(radiobutton \"And\") or at least one of the chosen keywords (radiobutton \"Or\").

    +

    You can filter test cases by the keywords that have been assigned. You can choose " . + "multiple keywords by using CTRL-Click. If you chose more than one keyword you can " . + "decide whether only test cases are shown that have all chosen keywords assigned " . + "(radiobutton \"And\") or at least one of the chosen keywords (radiobutton \"Or\").

    Priority Filter

    -

    You can filter test cases by test priority. The test priority is \"test case importance\" " . -"combined with \"test urgency\" within the current test plan.

    +

    You can filter test cases by test priority. The test priority is \"test case importance\" " . + "combined with \"test urgency\" within the current test plan.

    User Filter

    -

    You can filter test cases that are not assigned (\"Nobody\") or assigned to \"Somebody\". " . -"You can also filter test cases that are assigned to a specific tester. If you chose a specific " . -"tester you also have the possibility to show test cases that are unassigned in addition to " . -"those test cases (advanced Filters are available).

    +

    You can filter test cases that are not assigned (\"Nobody\") or assigned to \"Somebody\". " . + "You can also filter test cases that are assigned to a specific tester. If you chose a specific " . + "tester you also have the possibility to show test cases that are unassigned in addition to " . + "those test cases (advanced Filters are available).

    Result Filter

    -

    You can filter test cases by result (advanced Filters are available). You can filter by " . -"result \"on chosen build for execution\", \"on latest execution\", \"on ALL builds\", " . -"\"on ANY build\" and \"on specific build\". If \"specific build\" is chosen you then can " . -"specify the build.

    "; - - -// newest_tcversions.html +

    You can filter test cases by result (advanced Filters are available). You can filter by " . + "result \"on chosen build for execution\", \"on latest execution\", \"on ALL builds\", " . + "\"on ANY build\" and \"on specific build\". If \"specific build\" is chosen you then can " . + "specify the build.

    "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Newest versions of linked Test Cases

    The whole set of Test Cases linked to Test Plan is analyzed, and a list of Test Cases which have a newest version is displayed (against the current set of the Test Plan). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Requirements Coverage


    This feature allows to map a coverage of user or system requirements by test cases. Navigate via link \"Requirement Specification\" in main screen.

    Requirements Specification

    -

    Requirements are grouped by 'Requirements Specification' document which is related to -Test Project.
    TestLink doesn't support versions for both Requirements Specification -and Requirements itself. So, version of document should be added after +

    Requirements are grouped by 'Requirements Specification' document which is related to +Test Project.
    TestLink doesn't support versions for both Requirements Specification +and Requirements itself. So, version of document should be added after a Specification Title. -An user can add simple description or notes to Scope field.

    +An user can add simple description or notes to Scope field.

    -

    Overwritten count of REQs serves for -evaluation Req. coverage in case that not all requirements are added (imported) in. -The value 0 means that current count of requirements is used for metrics.

    -

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test +

    Overwritten count of REQs serves for +evaluation Req. coverage in case that not all requirements are added (imported) in. +The value 0 means that current count of requirements is used for metrics.

    +

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test coverage is 25% (if all these added requirements will be tested).

    Requirements

    Click on title of a created Requirements Specification. You can create, edit, delete or import requirements for the document. Each requirement has title, scope and status. Status should be \"Normal\" or \"Not testable\". Not testable requirements are not counted -to metrics. This parameter should be used for both unimplemented features and -wrong designed requirements.

    +to metrics. This parameter should be used for both unimplemented features and +wrong designed requirements.

    -

    You can create new test cases for requirements by using multi action with checked +

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite -with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = +with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Title and Scope are copied to these Test cases.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Coverage:

    -A value of e.g. \"40% (8/20)\" means that 20 Test Cases have to be created for this Requirement -to test it completely. 8 of those have already been created and linked to this Requirement, which +A value of e.g. \"40% (8/20)\" means that 20 Test Cases have to be created for this Requirement +to test it completely. 8 of those have already been created and linked to this Requirement, which makes a coverage of 40 percent. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    Internal links on scope:

    -

    Internal links serve the purpose of creating links to other requirements/requirement specifications +

    Internal links serve the purpose of creating links to other requirements/requirement specifications with a special syntax. Internal Links behaviour can be changed in the config file.

    Usage: @@ -261,12 +257,11 @@

    Log message for changes:

    Whenever a change is made Testlink will ask for a log message. This log message served the purpose of traceability. -If only the scope of the requirement has changed you are free to decide whether to create a new revision or not. +If only the scope of the requirement has changed you are free to decide whether to create a new revision or not. Whenever anything besides the scope is changed you are forced to create a new revision.

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    Direct Links:

    To easily share this document with others simply click the globe icon at the top of this document to create a direct link.

    @@ -278,17 +273,16 @@

    Shows all linked test cases for this requirement.

    Relations:

    -

    Requirement Relations are used to model relationships between requirements. -Custom relations and the option to allow relations between requirements of +

    Requirement Relations are used to model relationships between requirements. +Custom relations and the option to allow relations between requirements of different test projects can be configured on the config file. -If you set the relation \"Requirement A is parent of Requirement B\", +If you set the relation \"Requirement A is parent of Requirement B\", Testlink will set the relation \"Requirement B is child of Requirement A\" implicitly.

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    Internal links on scope:

    -

    Internal links serve the purpose of creating links to other requirements/requirement specifications +

    Internal links serve the purpose of creating links to other requirements/requirement specifications with a special syntax. Internal Links behaviour can be changed in the config file.

    Usage: @@ -300,32 +294,29 @@ to jump to can also be specified:
    [req tproj=<tproj_prefix> anchor=<anchor_name>]req_doc_id[/req]
    This syntax also works for requirement specifications.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Regarding 'Save Custom Fields'

    -If you have defined and assigned to Test Project,
    +If you have defined and assigned to Test Project,
    Custom Fields with:
    'Display on test plan design=true' and
    'Enable on test plan design=true'
    you will see these in this page ONLY for Test Cases linked to Test Plan. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "More information about testers:
    If you click on a tester name in this table, you will get a more detailed overview about all Test Cases assigned to that user and his testing progress.

    Note:
    -This Report shows those test cases, which are assigned to a specific user and have been executed -based on each active build. Even if a test case has been executed by another user than the assigned user, +This Report shows those test cases, which are assigned to a specific user and have been executed +based on each active build. Even if a test case has been executed by another user than the assigned user, the test case will appear as executed for the assigned user. -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/en_US/texts.php b/locale/en_US/texts.php index 8fe92c2ab9..a3fefb4070 100644 --- a/locale/en_US/texts.php +++ b/locale/en_US/texts.php @@ -1,41 +1,38 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat - * @copyright 2003-2009, TestLink community - * @link http://www.teamst.org/index.php - * - * @internal Revisions: - * 20110327 - BUGID 4349 - Julian - Update with en_GB files - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Application error"; -$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . - "logs for details.

    You are welcome to report the problem. Please visit our " . - "website.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; -$TLS_htmltext['assignReqs'] = "

    Purpose:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat + * @copyright 2003-2009, TestLink community + * @link http://www.teamst.org/index.php + * + * @internal Revisions: + * 20110327 - BUGID 4349 - Julian - Update with en_GB files + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Application error"; +$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . + "logs for details.

    You are welcome to report the problem. Please visit our " . + "website.

    "; + +$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; +$TLS_htmltext['assignReqs'] = "

    Purpose:

    Users can set relations between requirements and test cases. A test designer could define relations 0..n to 0..n. I.e. One test case could be assigned to none, one or more requirements and vice versa. Such traceability matrix helps to investigate test coverage @@ -46,7 +43,7 @@

    1. Choose an Test Case in tree at the left. The combo box with list of Requirements Specifications is shown at the top of the workarea.
    2. -
    3. Choose a Requirements Specification Document if more once defined. +
    4. Choose a Requirements Specification Document if more once defined. TestLink automatically reloads the page.
    5. A middle block of workarea lists all requirements (from choosen Specification), which are connected with the test case. Bottom block 'Available Requirements' lists all @@ -54,49 +51,47 @@ to the current test case. A designer could mark requirements which are covered by this test case and then click the button 'Assign'. These new assigned test case are shown in the middle block 'Assigned Requirements'.
    6. -
    "; +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Test Specification"; +$TLS_htmltext['editTc'] = "

    The Test Specification allows users to view " . + "and edit all of the existing Test Suites and Test Cases. " . + "Test Cases are versioned and all of the previous versions are available and can be " . + "viewed and managed here.

    - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Test Specification"; -$TLS_htmltext['editTc'] = "

    The Test Specification allows users to view " . - "and edit all of the existing Test Suites and Test Cases. " . - "Test Cases are versioned and all of the previous versions are available and can be " . - "viewed and managed here.

    -

    Getting Started:

      -
    1. Select your Test Project in the navigation tree (the root node). Please note: " . - "You can always change the active Test Project by selecting a different one from the " . - "drop-down list in the top-right corner.
    2. -
    3. Create a new Test Suite by clicking on Create (Test Suite Operations). Test Suites can " . - "bring structure to your test documents according to your conventions (functional/non-functional " . - "tests, product components or features, change requests, etc.). The description of " . - "a Test Suite could hold the scope of the included test cases, default configuration, " . - "links to relevant documents, limitations and other useful information. In general, " . - "all annotations that are common to the Child Test Cases. Test Suites follow " . - "the "folder" metaphor, thus users can move and copy Test Suites within " . - "the Test project. Also, they can be imported or exported (including the contained Test cases).
    4. -
    5. Test Suites are scalable folders. Users can move or copy Test Suites within " . - "the Test project. Test Suites can be imported or exported (include Test Cases). -
    6. Select your newly created Test Suite in the navigation tree and create " . - "a new Test Case by clicking on Create (Test Case Operations). A Test Case specifies " . - "a particular testing scenario, expected results and custom fields defined " . - "in the Test Project (refer to the user manual for more information). It is also possible " . - "to assign keywords for improved traceability.
    7. +
    8. Select your Test Project in the navigation tree (the root node). Please note: " . + "You can always change the active Test Project by selecting a different one from the " . + "drop-down list in the top-right corner.
    9. +
    10. Create a new Test Suite by clicking on Create (Test Suite Operations). Test Suites can " . + "bring structure to your test documents according to your conventions (functional/non-functional " . + "tests, product components or features, change requests, etc.). The description of " . + "a Test Suite could hold the scope of the included test cases, default configuration, " . + "links to relevant documents, limitations and other useful information. In general, " . + "all annotations that are common to the Child Test Cases. Test Suites follow " . + "the "folder" metaphor, thus users can move and copy Test Suites within " . + "the Test project. Also, they can be imported or exported (including the contained Test cases).
    11. +
    12. Test Suites are scalable folders. Users can move or copy Test Suites within " . + "the Test project. Test Suites can be imported or exported (include Test Cases). +
    13. Select your newly created Test Suite in the navigation tree and create " . + "a new Test Case by clicking on Create (Test Case Operations). A Test Case specifies " . + "a particular testing scenario, expected results and custom fields defined " . + "in the Test Project (refer to the user manual for more information). It is also possible " . + "to assign keywords for improved traceability.
    14. Navigate via the tree view on the left side and edit data. Each Test case stores own history.
    15. Assign your created Test Specification to a Test Plan when your Test cases are ready.
    -

    With TestLink you can organize Test Cases into Test Suites." . -"Test Suites can be nested within other test suites, enabling you to create hierarchies of Test Suites. - You can then print this information together with the Test Cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; -$TLS_htmltext['searchTc'] = "

    Purpose:

    +

    With TestLink you can organize Test Cases into Test Suites." . + "Test Suites can be nested within other test suites, enabling you to create hierarchies of Test Suites. + You can then print this information together with the Test Cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; +$TLS_htmltext['searchTc'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result include just test cases from actual Test Project.

    @@ -108,13 +103,13 @@
  • Choose required keyword or left value 'Not applied'.
  • Click the Search button.
  • All fulfilled test cases are shown. You can modify Test Cases via 'Title' link.
  • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; -$TLS_htmltext['searchReq'] = "

    Purpose:

    +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; +$TLS_htmltext['searchReq'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirements from actual Test Project.

    @@ -126,12 +121,12 @@
  • Choose required keyword or leave value 'Not applied'.
  • Click the 'Find' button.
  • All fulfilling requirements are shown. You can modify requirements via 'Title' link.
  • -"; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; -$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    +"; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; +$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirement specifications from actual Test Project.

    @@ -143,35 +138,33 @@
  • Choose required keyword or leave value 'Not applied'.
  • Click the 'Find' button.
  • All fulfilling requirements are shown. You can modify requirement specifications via 'Title' link.
  • -"; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Purpose:

    +"; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Purpose:

    From here you can print a single test case, all the test cases within a test suite, or all the test cases in a test project or plan.

    Get Started:

    1. -

      Select the parts of the test cases you want to display, and then click on a test case, +

      Select the parts of the test cases you want to display, and then click on a test case, test suite, or the test project. A printable page will be displayed.

    2. -
    3. Use the \"Show As\" drop-box in the navigation pane to specify whether you want -the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. +

    4. Use the \"Show As\" drop-box in the navigation pane to specify whether you want +the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. See help for more information.

    5. Use your browser's print functionality to actually print the information.
      Note: Make sure to only print the right-hand frame.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    Requirements Specification

    @@ -189,8 +182,8 @@

    Requirements

    -

    Click the title of an existing Requirements Specification. If none exist, " . - "click on the project node to create one. You can create, edit, delete +

    Click the title of an existing Requirements Specification. If none exist, " . + "click on the project node to create one. You can create, edit, delete or import requirements for the document. Each requirement has a title, scope and status. A status should be either 'Normal' or 'Not testable'. Not testable requirements are not counted to metrics. This parameter should be used for both unimplemented features and @@ -199,34 +192,32 @@

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite with name defined in configuration (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Title and Scope are copied to these Test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; //printReq +'Test suite created by Requirement - Auto';)
    . Title and Scope are copied to these Test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; // printReq $TLS_htmltext['printReqSpec'] = "

    Purpose:

    From here you can print a single requirement, all the requirements within a requirement specification, or all the requirements in a test project.

    Get Started:

    1. -

      Select the parts of the requirements you want to display, and then click on a requirement, +

      Select the parts of the requirements you want to display, and then click on a requirement, requirement specification, or the test project. A printable page will be displayed.

    2. -
    3. Use the \"Show As\" drop-box in the navigation pane to specify whether you want -the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. +

    4. Use the \"Show As\" drop-box in the navigation pane to specify whether you want +the information displayed as HTML, OpenOffice Writer or in a Micosoft Word document. See help for more information.

    5. Use your browser's print functionality to actually print the information.
      Note: Make sure to only print the right-hand frame.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; -$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

    @@ -250,16 +241,15 @@

    TestLink uses this approach so that older versions of test cases in test plans are not affected by keyword assignments you make to the most recent version of the test case. If you want your test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

    Purpose:

    +Modified Test Cases' functionality BEFORE making keyword assignments.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

    Purpose:

    Allows user to execute Test cases. User can assign Test result -to Test Case for a Build. See help for more information about filters and settings " . - "(click on the question mark icon).

    +to Test Case for a Build. See help for more information about filters and settings " . + "(click on the question mark icon).

    Get started:

    @@ -267,19 +257,19 @@
  • User must have defined a Build for the Test Plan.
  • Select a Build from the drop down box
  • If you want to see only a few testcases instead of the whole tree, - you can choose which filters to apply. Click the \"Apply\"-Button - after you have changed the filters.
  • + you can choose which filters to apply. Click the \"Apply\"-Button + after you have changed the filters.
  • Click on a test case in the tree menu.
  • Fill out the test case result and any applicable notes or bugs.
  • Save results.
  • -

    Note: TestLink must be configured to collaborate with your Bug tracker -if you would like to create/trace a problem report directly from the GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; -$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . - "(defined in top of navigator). This Test Plan could differ from the +

    Note: TestLink must be configured to collaborate with your Bug tracker +if you would like to create/trace a problem report directly from the GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; +$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . + "(defined in top of navigator). This Test Plan could differ from the current Test Plan for execution. You can also select a Report format:

    • Normal - report is displayed in web page
    • @@ -403,12 +393,11 @@

      Total Bugs For Each Test Case

      This report shows each test case with all of the bugs filed against it for the entire project. -This report is only available if a Bug Tracking System is connected.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Purpose:

      +This report is only available if a Bug Tracking System is connected.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Purpose:

      Allows user (with lead level permissions) to add or remove test cases into a Test plan.

      To add or remove Test cases:

      @@ -416,11 +405,11 @@
    • Click on a test suite to see all of its test suites and all of its test cases.
    • When you are done click the 'Add / Remove Test Cases' button to add or remove the test cases. Note: Is not possible to add the same test case multiple times.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; -$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; +$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      This page allows test leaders to assign users to particular tests within the Test Plan.

      Get Started

      @@ -429,15 +418,15 @@
    • Select a planned tester.
    • Click the 'Save' button to submit assignment.
    • Open execution page to verify assignment. You can set-up a filter for users.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; -$TLS_htmltext['planUpdateTC'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; +$TLS_htmltext['planUpdateTC'] = "

      Purpose

      This page allows updating a Test case to a newer (different) version if a Test -Specification is changed. It often happens that some functionality is clarified during testing." . - " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . - " plan holds original version to be sure, that results refer to the correct text of a Test case.

      +Specification is changed. It often happens that some functionality is clarified during testing." . + " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . + " plan holds original version to be sure, that results refer to the correct text of a Test case.

      Get Started

        @@ -445,14 +434,13 @@
      1. Choose a new version from the combo-box menu for a particular Test case.
      2. Click the 'Update Test plan' button to submit changes.
      3. To verify: Open execution page to view text of the test case(s).
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; -$TLS_htmltext['test_urgency'] = "

      Purpose

      -

      TestLink allows setting the urgency of a Test Suite to affect the testing Priority of test cases. - Test priority depends on both Importance of Test cases and Urgency defined in +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; +$TLS_htmltext['test_urgency'] = "

      Purpose

      +

      TestLink allows setting the urgency of a Test Suite to affect the testing Priority of test cases. + Test priority depends on both Importance of Test cases and Urgency defined in the Test Plan. Test leader should specify a set of test cases that could be tested at first. It helps to ensure that testing will cover the most important tests also under time pressure.

      @@ -466,10 +454,9 @@ significant changes.
    • Click the 'Save' button to submit changes.
    • -

      For example, a Test case with a High importance in a Test suite with Low urgency " . - "will be Medium priority."; - - -// ------------------------------------------------------------------------------------------ - +

      For example, a Test case with a High importance in a Test suite with Low urgency " . + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/es_AR/description.php b/locale/es_AR/description.php index cffbfe8ae1..5e943d6e72 100644 --- a/locale/es_AR/description.php +++ b/locale/es_AR/description.php @@ -1,40 +1,40 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

      Opciones para generar el documento

      Esta tabla permite al usuario filtrar los casos de prueba antes de verlos. -Si los datos están seleccionados se mostrarán. Para cambiar los datos presentados, +Si los datos están seleccionados se mostrarán. Para cambiar los datos presentados, marcar o desmarcar, haga clic en el Filtro, y seleccione el nivel de datos que desee en el árbol.

      -

      Cabecera del documento: Los usuarios pueden filtrar la información de cabecera del documento. -La información de cabecera del documento incluye: Introducción, alcance, referencias, +

      Cabecera del documento: Los usuarios pueden filtrar la información de cabecera del documento. +La información de cabecera del documento incluye: Introducción, alcance, referencias, Metodología de prueba y limitaciones de prueba.

      Cuerpo del caso de prueba: Los usuarios pueden filtrar la información del cuerpo del caso de prueba. @@ -44,39 +44,39 @@ desde el titulo del caso de prueba, sin embargo, no pueden filtrar la información del resumen desde el cuerpo del caso de prueba. El resumen ha sido solo parcialmente separado del cuerpo del caso de prueba Body a fin de apoyar los títulos de visión con un breve resumen y la ausencia de -Pasos, resultados esperados, y las keywords. Si el usuario decide ver el cuerpo del caso de prueba, +Pasos, resultados esperados, y las keywords. Si el usuario decide ver el cuerpo del caso de prueba, el resumen también se incluirá.

      Tabla de contenido: Testlink inserta una lista con todos los titulos con enlaces internos.

      -

      Formato de salida: Hay dos posibilidades: HTML y MS Word. El explorador llama al MS Word en segundo caso.

      "; - -// testPlan.html +

      Formato de salida: Hay dos posibilidades: HTML y MS Word. El explorador llama al MS Word en segundo caso.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Plan de pruebas

      General

      Un plan de pruebas es una aproximación sistemática a testear el sistema como un software. -Puede organizar las actividades de testeo para una build en particular de un producto en timpo +Puede organizar las actividades de testeo para una build en particular de un producto en timpo y con resultados de seguimiento.

      Ejecución

      Esta sección es donde los usuarios pueden ejecutar los casos de prueba (escribir los resultados) e imprimir la Suite de pruebas del plan de pruebas. Aquí es donde los usuarios pueden seguir -el resultado de la ejecución de sus casos de prueba.

      +el resultado de la ejecución de sus casos de prueba.

      Administración del plan de pruebas

      -

      Esta sección, a la cual solo un líder puede acceder, permite administrar lo planes de pruebas. -Administrar planes de pruebas involucra crear/editar/borrar planes, agregar/editar/borrar/actualizar +

      Esta sección, a la cual solo un líder puede acceder, permite administrar lo planes de pruebas. +Administrar planes de pruebas involucra crear/editar/borrar planes, agregar/editar/borrar/actualizar casos de prueba en planes, crear builds así como definir quien puede ver cada plan.
      -Los lideres (usuarios con permisos de lider) también pueden establecer la prioridad/riesgo -y la propiedad de las suites de pruebas (categorías) y crear hitos de prueba.

      - -

      Nota: Es posible que los usuarios no puedan ver un desplegable con todos los planes de pruebas. -En esta situación todos los vínculos (excepto los habilitados por un lider) serán desvinculados. Si está -en esta situación debe contactar a un lider o administrador lead or admin para concederle -los derechos adecuados del proyecto o crear un plan de pruebas para usted.

      "; - -// custom_fields.html +Los lideres (usuarios con permisos de lider) también pueden establecer la prioridad/riesgo +y la propiedad de las suites de pruebas (categorías) y crear hitos de prueba.

      + +

      Nota: Es posible que los usuarios no puedan ver un desplegable con todos los planes de pruebas. +En esta situación todos los vínculos (excepto los habilitados por un lider) serán desvinculados. Si está +en esta situación debe contactar a un lider o administrador lead or admin para concederle +los derechos adecuados del proyecto o crear un plan de pruebas para usted.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Campos personalizados

      Los siguientes son algunos hechos acerca de la implementación de campos personalizados:

        @@ -95,7 +95,7 @@
      • Tipo(string, numeric, float, enum, email)
      • Valores posible de enumeración(ej: rojo|amarillo|azul), aplicables a la lista, la lista de selección múltiple y los tipos de combo.
        -Utilice el carácter ('|') para separar los posibles valores de una enumeración. +Utilice el carácter ('|') para separar los posibles valores de una enumeración. Uno de los posibles valores puede ser una cadena vacía.
      • Valor por defecto (NO IMPLEMENTADO AUN).
      • @@ -104,7 +104,7 @@ (NO IMPLEMENTADO AUN)
      • Todos los campos personalizados son actualmente guardados en un campo de tipo VARCHAR(255) en la base de datos.
      • Mostrar en al especificación de pruebas.
      • -
      • Habilitar en la especificación de pruebas. El usuario puede cambiar el valor durante el diseño de +
      • Habilitar en la especificación de pruebas. El usuario puede cambiar el valor durante el diseño de la especificación de casos de prueba.
      • Mostrar en la ejecución.
      • Habilitar en la ejecución. El usuario puede cambiar el valor durante la ejecución.
      • @@ -112,26 +112,26 @@
      • Habilitar en el diseño del plan de pruebas. El usuario puede cambiar el valor durante el diseño del plan de pruebas (agregar casos de prueba al plan de pruebas)
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Ejecutando casos de prueba

      -

      Permite a los usuario a 'ejecutar' los casos de prueba. La ejecución en sí no es más que la +

      Permite a los usuario a 'ejecutar' los casos de prueba. La ejecución en sí no es más que la asignación a un caso de prueba de un resultado (pasa, falla, bloqueado) contra una build seleccionada.

      El acceso a un BTS puede ser configurado.Los usuarios pueden agregar un bug nuevo directamente o navegar -por los existentes.

      "; - -//bug_add.html +por los existentes.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Agregar bugs al caso de prueba

      (Sólo si está configurado) -Testlink tiene una integración muy simple con un BTS,no es capaz de enviar ni la solicitud de creación de bug de BTS, -ni recuperar el ID del bug.La integración se realiza mediante enlaces a las páginas de BTS, que llama a las siguientes +Testlink tiene una integración muy simple con un BTS,no es capaz de enviar ni la solicitud de creación de bug de BTS, +ni recuperar el ID del bug.La integración se realiza mediante enlaces a las páginas de BTS, que llama a las siguientes características:

      • Insertar bug nuevo.
      • Mostrar información de bug existente.
      -

      +

      Proceso para agregar un bug

      @@ -140,107 +140,104 @@

    • Paso 2: escribe abajo del BUG ID asignado por el BTS.
    • Paso 3: escribe BUG ID en el campo de entrada.
    • Paso 4: use el botón 'agregar bug'.
    • -
    + Luego de cerrar la página de adición de bugs, verá los datos relevantes del bug en la página de ejecución. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Instalar filtos y builds para la ejecución

    -

    El panel izquierdo consta de: un navegador por los casos de prueba asignados al plan de pruebas actual " . -"y una tabla con configuraciones y filtros.Estos filtros permiten al usuario " . -"refinar el conjunto ofrecido de casos de prueba antes de ser ejecutados." . -"establezca su filtro, presione el botón \"Aplicar\" y seleccione el caso de prueba apropiado en el árbol.

    +

    El panel izquierdo consta de: un navegador por los casos de prueba asignados al plan de pruebas actual " . + "y una tabla con configuraciones y filtros.Estos filtros permiten al usuario " . + "refinar el conjunto ofrecido de casos de prueba antes de ser ejecutados." . + "establezca su filtro, presione el botón \"Aplicar\" y seleccione el caso de prueba apropiado en el árbol.

    Build

    -

    Los usuarios pueden elegir una build que se conectará con el resultado de la prueba. " . -"Las Builds son el componente básico para el plan de pruebas actual.Cada caso de prueba " . -"puede ser corrido mas veces por build.Sin embargo, sólo el último resultado es tomado en cuenta. +

    Los usuarios pueden elegir una build que se conectará con el resultado de la prueba. " . + "Las Builds son el componente básico para el plan de pruebas actual.Cada caso de prueba " . + "puede ser corrido mas veces por build.Sin embargo, sólo el último resultado es tomado en cuenta.
    Las builds pueden ser creadas por lideres usando la página de creacion de build.

    Filtro de ID

    -

    Los usuarios pueden filtrar los casos de prueba por un identificador único. Este ID es creado automáticamente -durante el tiempo de creación.La caja vacía significa que el filtro no se aplica.

    +

    Los usuarios pueden filtrar los casos de prueba por un identificador único. Este ID es creado automáticamente +durante el tiempo de creación.La caja vacía significa que el filtro no se aplica.

    Filtro de prioridad

    -

    Los usuarios pueden filtrar los casos de prueba por la prioridad. Cada importancia del" . -"caso de prueba es combinada con la urgencia del mismo dentro del plan de pruebas actual." . -"Por ejemplo la prioridad 'ALTA' en el caso de prueba se muetra si la importancia" . -"o urgencia es alto y su segundo atributo es por lo menos 'MEDIA'.

    +

    Los usuarios pueden filtrar los casos de prueba por la prioridad. Cada importancia del" . + "caso de prueba es combinada con la urgencia del mismo dentro del plan de pruebas actual." . + "Por ejemplo la prioridad 'ALTA' en el caso de prueba se muetra si la importancia" . + "o urgencia es alto y su segundo atributo es por lo menos 'MEDIA'.

    Filtro de resultado

    -

    Los usuarios pueden filtrar los casos de prueba por los resultados.Los resultados +

    Los usuarios pueden filtrar los casos de prueba por los resultados.Los resultados son lo que pasó con ese caso de prueba durante una build en particular.Los casos de prueba pueden pasar, fallar, ser bloqueados o no ejecutados.Este filtro está desactivado por defecto.

    Filtro de usuario

    -

    Los usuarios pueden filtrar los casos de prueba por su asignado.El recuadro permite incluír también " . -"casos de prueba \"sin asignar\" dentro del resultado.

    "; -/* -

    Resultado más reciente

    -

    Por defecto o si el recuadro de 'Más reciente' está desmarcado, el árbol se ordenará -por la build que se elija en menú desplegable. Es esta condición el árbol mostrará -el estado de los casos de prueba.

    - */ - - -// newest_tcversions.html +

    Los usuarios pueden filtrar los casos de prueba por su asignado.El recuadro permite incluír también " . + "casos de prueba \"sin asignar\" dentro del resultado.

    "; +/* + *

    Resultado más reciente

    + *

    Por defecto o si el recuadro de 'Más reciente' está desmarcado, el árbol se ordenará + * por la build que se elija en menú desplegable. Es esta condición el árbol mostrará + * el estado de los casos de prueba.

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Nuevas versiones de Casos de prueba vinculados

    -

    El conjunto de casos de prueba vinculados al plan de pruebas es analizado, y se muestra una lista de -casos de prueba que tienen una versión más reciente (en contra de la serie -actual del plan de pruebas).

    "; - - -// requirementsCoverage.html +

    El conjunto de casos de prueba vinculados al plan de pruebas es analizado, y se muestra una lista de +casos de prueba que tienen una versión más reciente (en contra de la serie +actual del plan de pruebas).

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Cobertura de requerimientos


    -

    Esta característica permite asignar cobertura de usuario o requerimientos de sistema por caso de prueba. +

    Esta característica permite asignar cobertura de usuario o requerimientos de sistema por caso de prueba. Navegar a través de \"Especificación de requerimientos\" en la pantalla principal.

    Especificación de requerimientos

    Los requerimientos estan agrupados por el documento'Especificación de requerimientos', el cual está relacionado al proyecto.
    -Un usuario puede añadir una descripción simple o una nota al campo 'Alcance'.

    +Un usuario puede añadir una descripción simple o una nota al campo 'Alcance'.

    Sobreescribir el contador de Reqs

    sirve para evaluar la cobertura de Reqs.en caso de que no todos los requerimientos se añadan a Testlink. El valor 0 significa que el contador actual de Reqs. se utiliza para las métricas. -

    Por ejemplo SRS incluye 200 requerimientos pero solo 50 son añadidos a Testlink. La cobertura +

    Por ejemplo SRS incluye 200 requerimientos pero solo 50 son añadidos a Testlink. La cobertura de Test es del 25% (si todos estos requerimientos añadidos se testearan).

    Requerimientos

    -

    Haga click en el titulo de la Especificación de requerimientos creada,si no hay nada existente haga -click en el proyecto para crear uno. Puede crear, editar, eliminar o importar requerimientos +

    Haga click en el titulo de la Especificación de requerimientos creada,si no hay nada existente haga +click en el proyecto para crear uno. Puede crear, editar, eliminar o importar requerimientos de un documento. Cada requerimiento tiene un titulo, un alcance y un estado. -El estado debe ser 'Normal' o 'No testeable'. Los requerimientos no testeables no tienen contador +El estado debe ser 'Normal' o 'No testeable'. Los requerimientos no testeables no tienen contador para las métricas. Este parámetro debe ser usado tanto para características que no se han implementado como para requerimientos mal diseñados.

    -

    Puede crear nuevos casos de prueba para requerimientos usando la multi acción con requerimientos +

    Puede crear nuevos casos de prueba para requerimientos usando la multi acción con requerimientos marcados dentro de la pantalla de especificación. Estos casos de prueba son creados dentro de la Suite de pruebas con nombre definido en la configuración. El título y alcance son copiados de estos casos de prueba.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Cobertura:

    -Un valor de ejemplo \"40% (8/20)\" significa que 20 casos de prueba tienen qeu ser creados para este requisito -para probarlo completamente. 8 de ellos han sido ya creados y vinculados a este requisito, que +Un valor de ejemplo \"40% (8/20)\" significa que 20 casos de prueba tienen qeu ser creados para este requisito +para probarlo completamente. 8 de ellos han sido ya creados y vinculados a este requisito, que hace una cobertura del 40 porciento. -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Con respecto a 'Guardar campos personalizado'

    -Si se han definido y asignado al proyecto,
    +Si se han definido y asignado al proyecto,
    Campos personalizados con:
    'Display on test plan design=true' y
    'Enable on test plan design=true'
    podrá ver estos solo en esta página para casos de prueba relacionados con el Plan de pruebas. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/es_AR/texts.php b/locale/es_AR/texts.php index ccd0294340..e0e40066da 100644 --- a/locale/es_AR/texts.php +++ b/locale/es_AR/texts.php @@ -1,32 +1,31 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ - -$TLS_htmltext_title['assignReqs'] = "Asignar requerimientos a los Casos de prueba"; -$TLS_htmltext['assignReqs'] = "

    Propósito:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ +$TLS_htmltext_title['assignReqs'] = "Asignar requerimientos a los Casos de prueba"; +$TLS_htmltext['assignReqs'] = "

    Propósito:

    Los usuarios pueden establecer relaciones entre los Requerimientos y los Casos de prueba. Un diseñador podria definir relaciones 0..n a 0..n I.e. un Caso de prueba podria ser asignado a ninguno, uno o más Requerimientos y viceversa.La trazabilidad ayuda a investigar la cobertura de los requerimientos de los Casos de prueba @@ -34,21 +33,21 @@

    Primeros pasos:

      -
    1. Seleccione un Caso de prueba en el árbol de la izquierda. El cuadro combinado - con la lista de Especificaciones de Requerimientos se muestra en la parte superior +
    2. Seleccione un Caso de prueba en el árbol de la izquierda. El cuadro combinado + con la lista de Especificaciones de Requerimientos se muestra en la parte superior del área de trabajo .
    3. -
    4. Seleccione un documento de especificaciones de requerimientos si se encuentra definido +
    5. Seleccione un documento de especificaciones de requerimientos si se encuentra definido una vez más.Testlink automáticamente recarga la página.
    6. El bloque intermedio del área de trabajo registra todos los requerimientos - (de la especificación seleccionada), los cuales están unidos al Caso de prueba. - El bloque de fondo 'Requerimientos disponibles' lista todos los requerimientos que no poseen - relación al Caso de prueba actual. Un diseñador podría marcar requerimientos, los cuales están - cubiertos por el Caso de prueba, luego haga clic en la botón ‘Asignar’. Estos nuevos casos de + (de la especificación seleccionada), los cuales están unidos al Caso de prueba. + El bloque de fondo 'Requerimientos disponibles' lista todos los requerimientos que no poseen + relación al Caso de prueba actual. Un diseñador podría marcar requerimientos, los cuales están + cubiertos por el Caso de prueba, luego haga clic en la botón ‘Asignar’. Estos nuevos casos de prueba asignados se muestran en el bloque intermedio de “Requerimientos Asignadosâ€.
    7. -
    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Buscar Especificación de Requerimientos"; //printReq +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Buscar Especificación de Requerimientos"; // printReq $TLS_htmltext['searchReqSpec'] = "

    Propósito:

    Navegar acorde a keywords y/o palabras buscadas. La busqueda no es un caso sensible. El resultado incluye solo las especificaciones de requerimientos del proyecto actual.

    @@ -60,11 +59,11 @@
  • Elige la keyword requerida o deje el valor en 'no aplicado'.
  • Haga click en el botón 'Encontrar'.
  • Se muestran todos los requisitos de cumplimiento.Puede modificar las especificaciones de requerimientos por medio del vínculo 'Titulo'.
  • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Buscar Requerimientos"; -$TLS_htmltext['searchReq'] = "

    Próposito:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Buscar Requerimientos"; +$TLS_htmltext['searchReq'] = "

    Próposito:

    Navegar acorde a keywords y/o palabras buscadas. La busqueda no es un caso sensible. El resultado incluye solo @@ -76,65 +75,64 @@

  • Escribe la palabra a buscar en el cuadro apropiado. Deje campos sin usar en blanco.
  • Elige la keyword requerida o deje el valor en 'no aplicado'.
  • Haga click en el botón 'Encontrar'.
  • -
  • Se muestran todos los requerimientos de cumplimiento.Puede modificar los requerimientos +
  • Se muestran todos los requerimientos de cumplimiento.Puede modificar los requerimientos por medio del vínculo 'Titulo'.
  • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Imprimir Especificación de Requerimientos"; //printReq +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Imprimir Especificación de Requerimientos"; // printReq $TLS_htmltext['printReqSpec'] = "

    Propósito:

    -

    Desde aquí usted puede imprimir un requerimiento en particular, todos los requerimientos +

    Desde aquí usted puede imprimir un requerimiento en particular, todos los requerimientos dentro de la especificación de requerimientos,o todos los requerimientos del Proyecto.

    Comenzar:

    1. -

      Seleccione las partes de los requerimientos que desea mostrar y, a continuación, haga clic en un requerimiento, +

      Seleccione las partes de los requerimientos que desea mostrar y, a continuación, haga clic en un requerimiento, en el requerimiento de especificación, o en el proyecto. Una página para imprimir en la pantalla.

    2. -
    3. Use el cuadro \"Mostrar como\" en el panel de navegación para especificar si quiere que la información +

    4. Use el cuadro \"Mostrar como\" en el panel de navegación para especificar si quiere que la información se muestre como HTML, documento de word o de OpenOffice.

    5. Use la función de imprimir de su explorer para imprimir la información actual.
      Nota: Aseguresé de solo imprimir el marco de la mano derecha.

    6. -
    "; - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Especificaciones de pruebas"; -$TLS_htmltext['editTc'] = "

    Propósito:

    -

    La Especificación de pruebas permite a los usuarios ver y editar todos las " . - "Suites de pruebas y los Casos de prueba existentes. Los Casos de prueba están versionados y todas " . - "las versiones anteriores estan disponibles y pueden ser vistas y gestionadas desde aquí.

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Especificaciones de pruebas"; +$TLS_htmltext['editTc'] = "

    Propósito:

    +

    La Especificación de pruebas permite a los usuarios ver y editar todos las " . + "Suites de pruebas y los Casos de prueba existentes. Los Casos de prueba están versionados y todas " . + "las versiones anteriores estan disponibles y pueden ser vistas y gestionadas desde aquí.

    Primeros pasos:

      -
    1. Seleccione un Proyecto en el árbol de navegación. Tenga en cuenta que " . - "Siempre puede cambiar el Proyecto activo seleccionando uno diferente en la " . - "lista desplegable que está en la esquina superior-derecha de la página.
    2. -
    3. Cree una nueva Suite de prueba haciendo click en (Crear nueva Suite de prueba).La Suite de prueba puede " . - "brindarle estructura a sus Documentos, de acuerdo a sus convenciones. La descripción de " . - "una Suite de prueba podría tener el alcance de los Casos de prueba incluídos, configuración por defecto, " . - "enlaces a documentos relevantes, limitaciones y otra información util. En general, " . - "todas las anotaciones son comunes a los Casos de prueba.
    4. -
    5. Las Suites de pruebas son carpetas escalables. Por lo cual un usuario puede mover y copiar Suites de pruebas dentro del " . - "Proyecto. Además, pueden ser importadas o exportadas (incluyendo los Casos de prueba). -
    6. Seleccione su Suite de pruebas recien creada en el árbol de navegación y cree " . - "un nuevo Caso de prueba haciendo click en Crear Casos de prueba. Un Caso de prueba precisa " . - "un escenario de testing particular, resultados esperados y campos personalizados definidos " . - "en el Proyecto. También es posible " . - "asignar Palabras Clave para una mejor trazabilidad.
    7. -
    8. Navegue a través de la vista de árbol en el lado izquierdo y edite datos. Los Casos de prueba +
    9. Seleccione un Proyecto en el árbol de navegación. Tenga en cuenta que " . + "Siempre puede cambiar el Proyecto activo seleccionando uno diferente en la " . + "lista desplegable que está en la esquina superior-derecha de la página.
    10. +
    11. Cree una nueva Suite de prueba haciendo click en (Crear nueva Suite de prueba).La Suite de prueba puede " . + "brindarle estructura a sus Documentos, de acuerdo a sus convenciones. La descripción de " . + "una Suite de prueba podría tener el alcance de los Casos de prueba incluídos, configuración por defecto, " . + "enlaces a documentos relevantes, limitaciones y otra información util. En general, " . + "todas las anotaciones son comunes a los Casos de prueba.
    12. +
    13. Las Suites de pruebas son carpetas escalables. Por lo cual un usuario puede mover y copiar Suites de pruebas dentro del " . + "Proyecto. Además, pueden ser importadas o exportadas (incluyendo los Casos de prueba). +
    14. Seleccione su Suite de pruebas recien creada en el árbol de navegación y cree " . + "un nuevo Caso de prueba haciendo click en Crear Casos de prueba. Un Caso de prueba precisa " . + "un escenario de testing particular, resultados esperados y campos personalizados definidos " . + "en el Proyecto. También es posible " . + "asignar Palabras Clave para una mejor trazabilidad.
    15. +
    16. Navegue a través de la vista de árbol en el lado izquierdo y edite datos. Los Casos de prueba almacenan su propio historial.
    -

    con Testlink organize los Casos de prueba dentro de las Suites de pruebas." . -"Las Suites de pruebas se pueden anidar dentro de otras Suites, esto permite crear jerarquias de Casos de prueba. - Entonces usted puede imprimir esta información junto con los Casos de prueba.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Busar Casos de prueba"; -$TLS_htmltext['searchTc'] = "

    Próposito:

    +

    con Testlink organize los Casos de prueba dentro de las Suites de pruebas." . + "Las Suites de pruebas se pueden anidar dentro de otras Suites, esto permite crear jerarquias de Casos de prueba. + Entonces usted puede imprimir esta información junto con los Casos de prueba.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Busar Casos de prueba"; +$TLS_htmltext['searchTc'] = "

    Próposito:

    Navegar acorde a Palabras Clave y/o palabras buscadas.El resultado incluye solo los Casos de prueba del Proyecto actual.

    @@ -145,12 +143,11 @@
  • Elige las Palabras Clave requeridas o el valor 'No aplicado'.
  • Haga Click en el botón 'Buscar'.
  • Todos los Casos de prueba cumplidos se muestran. Usted puede modificar los Casos de prueba a través del 'Titulo'.
  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificación de pruebas"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Propósito:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificación de pruebas"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Propósito:

    Desde aquí usted puede imprimir un Caso de prueba en particular, todos los Casos de prueba dentro de la Suite de pruebas, o todos los Casos de prueba del Proyecto o del Plan de pruebas.

    Comenzar:

    @@ -164,12 +161,11 @@
  • Use la función de imprimir de su explorer para imprimir la información actual.
    Nota: Aseguresé de solo imprimir el marco de la mano derecha.

  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Diseño de Especificación de Requerimientos"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    Usted puede administrar los documentos de especificación de requerimientos.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Diseño de Especificación de Requerimientos"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    Usted puede administrar los documentos de especificación de requerimientos.

    Especificación de requerimientos

    @@ -181,52 +177,50 @@

    Sobreescribir el contador de Reqs sirve para evaluar la cobertura de Reqs.en caso de que no todos los requerimientos se añadan a Testlink. El valor 0 significa que el contador actual de Reqs. se utiliza para las métricas. -

    Por ejemplo SRS incluye 200 requerimientos pero solo 50 son añadidos a Testlink. La cobertura +

    Por ejemplo SRS incluye 200 requerimientos pero solo 50 son añadidos a Testlink. La cobertura de las pruebas es del 25% (si todos estos requerimientos añadidos se testearan).

    Requerimientos

    -

    Haga click en el titulo de la Especificación de requerimientos creada,si no hay nada existente haga -click en el proyecto para crear uno. Puede crear, editar, eliminar o importar requerimientos +

    Haga click en el titulo de la Especificación de requerimientos creada,si no hay nada existente haga +click en el proyecto para crear uno. Puede crear, editar, eliminar o importar requerimientos de un documento. Cada requerimiento tiene un titulo, un alcance y un estado. -El estado debe ser 'Normal' o 'No testeable'. Los requerimientos no testeables no tienen contador +El estado debe ser 'Normal' o 'No testeable'. Los requerimientos no testeables no tienen contador para las métricas. Este parámetro debe ser usado tanto para características que no se han implementado como para requerimientos mal diseñados.

    Puede crear nuevos casos de prueba para requerimientos mediante el uso de acciones multiples con requerimientos seleccionados dentro de la pantalla de especificación. Estos casos de prueba son creados dentro de la Suite de pruebas -con un nombre definido en la configuración. El Titulo y alcance son copiados a estos casos de prueba.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Asignación de Keywords"; -$TLS_htmltext['keywordsAssign'] = "

    Propósito:

    -

    La página de asignación de Keywords es donde los usuarios pueden asignar Keywords a la Suite +con un nombre definido en la configuración. El Titulo y alcance son copiados a estos casos de prueba.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Asignación de Keywords"; +$TLS_htmltext['keywordsAssign'] = "

    Propósito:

    +

    La página de asignación de Keywords es donde los usuarios pueden asignar Keywords a la Suite de pruebas existente o a un Caso de prueba

    Para asignar Keywords:

    1. Seleccione una Suite de pruebas, un Caso de pruebas en la vista de árbol de la izquierda.
    2. -
    3. El cuadro de nivel superior que aparece en el lado derecho le permitirá asignar +
    4. El cuadro de nivel superior que aparece en el lado derecho le permitirá asignar palabras clave a disposición de todos los casos de prueba en particular.
    5. Las selecciones siguientes le permiten asignar los casos de prueba a un nivel más específico

    Información importante respecto a las asignaciones de Keywords en los planes de pruebas:

    -

    Las asignaciones de keywords que realice en el pliego de condiciones sólo tienen efecto en casos de +

    Las asignaciones de keywords que realice en el pliego de condiciones sólo tienen efecto en casos de prueba en su plan de pruebas si y sólo si el plan de pruebas contiene la versión más reciente del caso de prueba. De otra manera si el Plan de pruebas contiene versiones antiguas del Caso de prueba, las asignaciones que haga ahora no apareceran en el Plan de pruebas.

    -

    Testlink utiliza este enfoque para que las versiones anteriores de casos de prueba en los planes de -prueba no sean afectadas por las asignaciones de Keywords que realice en la versión más reciente -del caso de prueba. Si usted quiere que se actualizen sus casos de prueba dentro del plan de pruebas, PRIMERO verifique -que ellos esten al día usando la funcionalidad de 'Actualizar Casos de prueba modificados' ANTES de realizar asignaciones de Keywords.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Ejecución de casos de prueba"; -$TLS_htmltext['executeTest'] = "

    Propósito:

    +

    Testlink utiliza este enfoque para que las versiones anteriores de casos de prueba en los planes de +prueba no sean afectadas por las asignaciones de Keywords que realice en la versión más reciente +del caso de prueba. Si usted quiere que se actualizen sus casos de prueba dentro del plan de pruebas, PRIMERO verifique +que ellos esten al día usando la funcionalidad de 'Actualizar Casos de prueba modificados' ANTES de realizar asignaciones de Keywords.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Ejecución de casos de prueba"; +$TLS_htmltext['executeTest'] = "

    Propósito:

    Permite a los usuarios ejecutar casos de prueba. Los usuarios pueden asignarle un resultado por build a los casos de prueba.

    @@ -239,13 +233,13 @@
  • Rellen el resultado del caso de prueba y el de notas aplicables o bugs.
  • Guarde los resultados.
  • -

    Nota: Testlink debe estar configurado para colaborar con su seguidor de bug -si usted desea crear / trazar un problema directamente reportado desde la GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Descripción del reporte y de las métricas"; -$TLS_htmltext['showMetrics'] = "

    Los reportes están relacionados con el plan de pruebas" . - "(definido en la parte superior del navegador). Este plan de pruebas podría diferir del +

    Nota: Testlink debe estar configurado para colaborar con su seguidor de bug +si usted desea crear / trazar un problema directamente reportado desde la GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Descripción del reporte y de las métricas"; +$TLS_htmltext['showMetrics'] = "

    Los reportes están relacionados con el plan de pruebas" . + "(definido en la parte superior del navegador). Este plan de pruebas podría diferir del plan de pruebas actual para ejecutar. También puede seleccionar un formato de reporte:

    • Normal - el reporte se muetras en la página web
    • @@ -264,11 +258,11 @@

      'Ultimo resultado de prueba' es un concepto usado en varios reportes, y es determinado de la siguiente manera:

        -
      • El orden en que se agregan builds al plan de pruebas determina que build es la más reciente. Los resultados de la más +
      • El orden en que se agregan builds al plan de pruebas determina que build es la más reciente. Los resultados de la más reciente build tendrá precedencia sobre las antiguas builds. Por ejemplo, si marca una prueba como 'fail' en la build 1, y marca ésta como 'pass' en la build 2, el resultado final de la prueba será 'pass'.
      • Si un caso de prueba es ejecutado en tiempos multiples en la misma build, la ejecución más reciente tendrá precedencia.
      • -
      • Los casos de pruebas listados como 'not run' en contra de una build no se tienen en cuenta. Por ejemplo, si marcas un +
      • Los casos de pruebas listados como 'not run' en contra de una build no se tienen en cuenta. Por ejemplo, si marcas un caso como 'pass' en la build 1, y no lo ejecutas en la build 2, el resultado final del caso sera considerado como 'pass'

      En las siguientes tablas se muestran:

      @@ -286,7 +280,7 @@

      El estado general de la build

      Muestra los resultados de la ejecución de todas las builds. Para cada build, el total de casos de prueba, -el total de los pass, % pass, el total de los fail, % fail, blocked, % blocked, not run, %not run. Si un caso +el total de los pass, % pass, el total de los fail, % fail, blocked, % blocked, not run, %not run. Si un caso de prueba ha sido ejecutado dos veces en la misma build, la más reciente ejecución se tomará en cuenta.

      Consulta de métricas

      @@ -298,18 +292,18 @@
      • keyword 0->1 keywords pueden ser seleccionadas. Por defecto - no hay keywords seleccionadas. Si una keyword no está seleccionada, entonces todos los casos de prueba seran considerados independietemente de las asignaciones de keywords. Keywords are assigned -Las keywords están asignadas en la especificación de pruebas o en la administración de keywords. Las keywords asignadas a los -casos de prueba abarcan a todos los planes de pruebas, y abarcan a lo largo de todas las verisones de los casos de prueba. +Las keywords están asignadas en la especificación de pruebas o en la administración de keywords. Las keywords asignadas a los +casos de prueba abarcan a todos los planes de pruebas, y abarcan a lo largo de todas las verisones de los casos de prueba. Si está interesado en los resultados para una keyword específica debe alterar este control.
      • owner 0->1 dueños pueden ser seleccionado. Por defecto - no hay dueño seleccionado. Si no hay dueños seleccionados, -entonces todos los casos de prueba seran considerados independietemente de las asignaciones de dueños. Actualmente no hay +entonces todos los casos de prueba seran considerados independietemente de las asignaciones de dueños. Actualmente no hay una funcionalidad para buscar un caso de prueba 'no asignado'. La propiedad es asignada a través de la página 'Asignar ejecución de caso de prueba', y se realiza en base a un plan por prueba. Si está interesado en el trabajo hecho por un tester en específico débe modificar este control.
      • Suite de nivel superior 0->n suites de nivel superior se pueden elegir. Por defecto - todas están seleccionadas. -Solamente las suites que son seleccionadas serán consultadas para los resultados y métricas. Si está interesado solamente +Solamente las suites que son seleccionadas serán consultadas para los resultados y métricas. Si está interesado solamente en los resultados para una suite específica usted debe alterar este control.
      • -
      • Builds 1->n builds pueden ser seleccionadas. Por defecto - todas las builds están seleccionadas. +
      • Builds 1->n builds pueden ser seleccionadas. Por defecto - todas las builds están seleccionadas. Sólo las ejecuciones realizadas en las builds seleccionadas seran tomadas en cuenta en producción de las métricas. Por ejemplo - si desea ver cuando casos de prueba fueron ejecutados en las ultimas 3 builds débe alterar este control.
      @@ -330,33 +324,32 @@ logicamente es el usado para determinar si un caso de prueba se considera 'bloqueado', 'falló', o 'no ejecutado'.

      Reporte

      -

      Ver el estado de cada caso de prueba en cada build. Si un caso de pruebas fue ejecutado varias veces en +

      Ver el estado de cada caso de prueba en cada build. Si un caso de pruebas fue ejecutado varias veces en la misma build, solamente el resultado de ejecución más reciente será tenido en cuenta.Se recomienda -para exportar este reporte el formato Excel para una facil navegación o si se está utilizando +para exportar este reporte el formato Excel para una facil navegación o si se está utilizando un conjunto de datos grande.

      Listas - Métricas generales del plan de pruebas

      -

      'Ultimo resultado de prueba' la lógica se utiliza para las cuatro cartas que se pueden ver.Los gráficos -se han animado para ayudar al usuario a visualizar los parámetros del plan de pruebas en curso. +

      'Ultimo resultado de prueba' la lógica se utiliza para las cuatro cartas que se pueden ver.Los gráficos +se han animado para ayudar al usuario a visualizar los parámetros del plan de pruebas en curso. Las cuatro gráficas proporcionan son :

      • Pie de tabla general 'paso / no / bloqueado / y no ejecutado' de los casos de prueba
      • Gráfico de barras de los resultados por keyword
      • Gráfico de barras de los resultados por dueño
      • Gráfico de barras de los resultados por suite de nivel superior
      -

      Las barras de los gráficos de barras son de color de manera que el usuario puede identificar el +

      Las barras de los gráficos de barras son de color de manera que el usuario puede identificar el número aproximado de 'paso, no, bloqueado, y no ejecutado' de los casos de prueba.

      Esta página de reporte requiere un plugin flash es su explorador web (by http://www.maani.us) para mostrar los resultados en un formato gráfico.

      Total de bugs para cada Caso de prueba

      Este reporte muestra cada caso de prueba con with todos los errores reportados en contra de todo el proyecto.. -Este reporte esta disponible si el sistema de seguimiento de bugs esta conectado (bugzilla por ej.).

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Añadir / Quitar Casos de prueba del plan de pruebas"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Propósito:

      +Este reporte esta disponible si el sistema de seguimiento de bugs esta conectado (bugzilla por ej.).

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Añadir / Quitar Casos de prueba del plan de pruebas"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Propósito:

      Permite a los líderes añadir o quitar casos de prueba dentro del plan de pruebas.

      Comenzar:

      @@ -364,11 +357,11 @@
    • Haga click en una suite de pruebas para ver todas las suites de pruebas y todos los casos de prueba.
    • Cuando termine haga click en el botón 'Añadir / quitar casos de prueba'para agregar o eliminar los casos de prueba. Nota: No es posible añadir el mismo caso de prueba varias veces.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Asignar Usuarios a la ejecuciones"; -$TLS_htmltext['tc_exec_assignment'] = "

      Propósito

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Asignar Usuarios a la ejecuciones"; +$TLS_htmltext['tc_exec_assignment'] = "

      Propósito

      Esta página le permite a los líderes asignar usuarios a casos particulares dentro del plan de pruebas.

      Comenzar:

      @@ -377,13 +370,12 @@
    • Seleccione un usuario previsto.
    • Presione el boton para presentar la asignación.
    • Abra la página de ejecución para verificar la asignación. Puede establecer filtros a los usuarios.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Actualizar los casos de prueba en los planes de prueba"; -$TLS_htmltext['planUpdateTC'] = "

      Propósito

      -

      Esta página permite actualizar los casos de prueba a una version nueva (diferente) +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Actualizar los casos de prueba en los planes de prueba"; +$TLS_htmltext['planUpdateTC'] = "

      Propósito

      +

      Esta página permite actualizar los casos de prueba a una version nueva (diferente) en el caso de que la especificación de pruebas halla cambiado. Sucede a menudo que algunas funciones se aclaran durante el testeo. Los usuarios modifican la especificación de pruebas, pero los cambios necesitan propagarse al plan de pruebas también. De otro modo. los planes de prueba mantienen las versiones originale para estar seguro que los resultados se refieren al texto correco del caso de prueba.

      @@ -394,14 +386,13 @@
    • Elige una nueva versión para un caso de prueba en particular.
    • Presione el botón 'Actualizar plan de pruebas' para realizar cambios.
    • Para verificar: abra la página de ejecución para ver el texto del caso de prueba.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Especificar la urgencia de la prueba"; -$TLS_htmltext['test_urgency'] = "

      Propósito

      -

      Testlink permite establecer urgencias en la Suite de pruebas para afectar la prioridad de testeo de los casos de prueba. - La prioridad de pruebas depende de la importancia de un caso de prueba +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Especificar la urgencia de la prueba"; +$TLS_htmltext['test_urgency'] = "

      Propósito

      +

      Testlink permite establecer urgencias en la Suite de pruebas para afectar la prioridad de testeo de los casos de prueba. + La prioridad de pruebas depende de la importancia de un caso de prueba y la urgencia definida en el plan de pruebas. El lider de pruebas debe especificar los casos de prueba que deberían ser testeados en primer lugar. Esto ayuda a asegurar que el testeo cubrirá las pruebas más importantes bajo la presión del tiempo.

      @@ -411,14 +402,13 @@
    • Elige una Suite de pruebas para establecer la urgencia de un producto/componente, en el navegador en el lado izquierdo de la ventana.
    • Elige un nivel de urgencia (alta, media o baja). Por defecto es media. Puede - bajarle prioridad a partes sin tocar del producto e incrementarle a componentes con + bajarle prioridad a partes sin tocar del producto e incrementarle a componentes con cambios significativos.
    • Presione el boton 'Guardar' para realizar los cambios.
    • -

      Por ejemplo, un caso de prueba con alta importancia en una suite de pruebas de baja importancia -tiene prioridad media."; - - -// ------------------------------------------------------------------------------------------ - -?> \ No newline at end of file +

      Por ejemplo, un caso de prueba con alta importancia en una suite de pruebas de baja importancia +tiene prioridad media."; + +// ------------------------------------------------------------------------------------------ + +?> diff --git a/locale/es_ES/description.php b/locale/es_ES/description.php index e53d6b1297..b6c94b5922 100644 --- a/locale/es_ES/description.php +++ b/locale/es_ES/description.php @@ -1,40 +1,40 @@ -Opciones para generar un documento

      Esta tabla permite al usuario filtrar los casos de prueba antes de ser visualizados. Si @@ -42,8 +42,8 @@ presentados, marca o desmarca, pulsa en el Filtro y selecciona el nivel de información deseada desde el árbol.

      -

      Cabecera del Documento: Los usuarios pueden filtrar la información de la cabecera. -La información de la cabecera incluye: Introducción, Alcance, Referencias, +

      Cabecera del Documento: Los usuarios pueden filtrar la información de la cabecera. +La información de la cabecera incluye: Introducción, Alcance, Referencias, Metodología de Pruebas y Limitaciones de Pruebas.

      Cuerpo del Caso de Prueba: Los usuarios pueden filtrar la información del cuerpo de los Casos de Prueba. La información del cuerpo de los Casos de Prueba @@ -58,35 +58,35 @@

      Ãndice de Contenidos: TestLink inserta una lista con todos los títulos con enlaces internos si está seleccionado.

      -

      Formato de Salida: Hay dos posibilidades: HTML y MS Word. El navegador llama al componente MS Word -en segundo caso.

      "; - -// testPlan.html +

      Formato de Salida: Hay dos posibilidades: HTML y MS Word. El navegador llama al componente MS Word +en segundo caso.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Plan de Pruebas

      General

      -

      Un plan de pruebas es una aproximación sistemática al testing de sistemas tales como el software. Puedes organizar las actividades de testing con +

      Un plan de pruebas es una aproximación sistemática al testing de sistemas tales como el software. Puedes organizar las actividades de testing con builds particulares para cada producto en concreto con resultados trazables en el tiempo.

      Ejecución de Pruebas

      -

      Esta sección es donde los usuarios pueden ejecutar Casos de Prueba (escribir los resultados de las pruebas) e -imprimir la suite de Casos de Prueba del Plan de Pruebas. Esta sección es donde los usuarios pueden realizar un seguimiento de -los resultados de sus ejecuciones de casos de prueba.

      +

      Esta sección es donde los usuarios pueden ejecutar Casos de Prueba (escribir los resultados de las pruebas) e +imprimir la suite de Casos de Prueba del Plan de Pruebas. Esta sección es donde los usuarios pueden realizar un seguimiento de +los resultados de sus ejecuciones de casos de prueba.

      Gestión del Plan de Pruebas

      -

      Esta sección, a la que sólo pueden acceder usuarios con determinados privilegios, permite a los usuarios administrar planes de pruebas. -La administración de planes de pruebas incluye la crear/editar/borrar planes, -añadir/editar/borrar/actualizar casos de prueba en planes, crear builds así como definir quién puede +

      Esta sección, a la que sólo pueden acceder usuarios con determinados privilegios, permite a los usuarios administrar planes de pruebas. +La administración de planes de pruebas incluye la crear/editar/borrar planes, +añadir/editar/borrar/actualizar casos de prueba en planes, crear builds así como definir quién puede ver cada plan.
      -Los usuarios con suficientes permisos pueden además establecer la prioridad/riesgo y la propiedad de -las suites de Casos de Prueba (categorías) y crear hitos de prueba.

      - -

      Nota: Es posible que los usuarios no vean ninguna lista desplegable conteniendo Planes de Pruebas. -En ese caso, todos los enlaces (excepto aquellos habilitados) estarán desenlazados. Si estás -en esa situación debes ponerte en contacto con el administrados para que te proporcione los -privilegios de proyecto pertinentes o para crear un Plan de Pruebas para ti.

      "; - -// custom_fields.html +Los usuarios con suficientes permisos pueden además establecer la prioridad/riesgo y la propiedad de +las suites de Casos de Prueba (categorías) y crear hitos de prueba.

      + +

      Nota: Es posible que los usuarios no vean ninguna lista desplegable conteniendo Planes de Pruebas. +En ese caso, todos los enlaces (excepto aquellos habilitados) estarán desenlazados. Si estás +en esa situación debes ponerte en contacto con el administrados para que te proporcione los +privilegios de proyecto pertinentes o para crear un Plan de Pruebas para ti.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Campos Personalizados

      Información relacionada con la implementación de campos personalizados:

        @@ -98,11 +98,11 @@
      • El número de campos personalizados no está limitado.
      -

      La definición de un campo personalizado incluye los siguientes atributos +

      La definición de un campo personalizado incluye los siguientes atributos lógicos:

      • Nombre del campo personalizado
      • -
      • Nombre de la variable (ej: Este valor es el que se +
      • Nombre de la variable (ej: Este valor es el que se proporciona a la API lang_get() , o se muestra tal y como está si no se encuentra en el fichero del idioma).
      • Tipo de campo personalizado (cadena de caracteres, numérico, float, enumeración, email)
      • Valores de la enumeración (ej: ROJO|AMARILLO|AZUL), aplicable los tipos lista, lista de selección múltiple @@ -125,16 +125,16 @@
      • Habilitar en el diseño del plan de pruebas. Los usuarios pueden cambiar el valor durante el diseño del Plan de Pruebas (añadir casos de prueba al plan de pruebas)
      • Disponible para. El usuario selecciona a qué tipo de elemento sigue el campo.
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Ejecutar Casos de Prueba

      Permite a los usuarios 'ejecutar' casos de prueba. La ejecución en sí misma es simplemente asignar un resultado a un caso de prueba (pasado,fallado,bloqueado) asociado a una build en concreto.

      El acceso al sistema de gestión de defectos debe ser configurado. El usuario puede añadir nuevos defectos directamente -y seleccionarlos de entre los existentes. Consulta el manual de Instalación para más detalles.

      "; - -//bug_add.html +y seleccionarlos de entre los existentes. Consulta el manual de Instalación para más detalles.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Añadir defectos a los Caso de Prueba

      (sólo si está configurado) TestLink tiene un sistema muy simple de integración con Gestores de Defectos, @@ -144,7 +144,7 @@

    • Insertar nuevo defecto.
    • Mostrar información de un defecto existente.
    -

    +

    Proceso para añadir un nuevo defecto

    @@ -153,12 +153,12 @@

  • Paso 2: apunta el ID del defecto asignado por el Gestor de Defectos.
  • Paso 3: escribe el ID del Defecto en el campo de entrada.
  • Paso 4: usa el botón de añadir defecto.
  • - + Después de cerrar la pantalla para añadir un defecto verás información importante del defecto en la pantalla de ejecución. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Opciones de Configuración

    Las opciones de configuración te permiten seleccionar el plan de pruebas, la build y la plataforma (si existe) a @@ -184,99 +184,94 @@

    Filtro de Keyword

    -

    Puedes filtrar casos de prueba por las keywords asignadas. Puedes elegir " . -"múltiples keywords usando CTRL-Clic. Si eliges más de una keyword puedes " . -"decidir si se muestran sólo los casos de prueba que tienen asignadas todas las keywords seleccionadas " . -"(opción \"Y\") o al memos una de las keywords seleccionadas (opción \"O\").

    +

    Puedes filtrar casos de prueba por las keywords asignadas. Puedes elegir " . + "múltiples keywords usando CTRL-Clic. Si eliges más de una keyword puedes " . + "decidir si se muestran sólo los casos de prueba que tienen asignadas todas las keywords seleccionadas " . + "(opción \"Y\") o al memos una de las keywords seleccionadas (opción \"O\").

    Filtro de Prioridad

    -

    Puedes filtrar los casos de prueba por prioridad. La prioridad de prueba es la \"importancia del caso de prueba\" " . -"combinada con la \"urgencia de prueba\" dentro del plan de pruebas actual.

    +

    Puedes filtrar los casos de prueba por prioridad. La prioridad de prueba es la \"importancia del caso de prueba\" " . + "combinada con la \"urgencia de prueba\" dentro del plan de pruebas actual.

    Filtro de Usuario

    -

    Puedes filtrar casos de prueba que no están asignados (\"Nadie\") o asignados a \"Alguien\". " . -"También puedes filtrar casos de prueba asignados a un tester en concreto. Si eliges un tester " . -"en concreto tienes la posibilidad de mostrar además los casos de prueba sin asignar " . -"(hay disponibles Filtros Avanzados).

    +

    Puedes filtrar casos de prueba que no están asignados (\"Nadie\") o asignados a \"Alguien\". " . + "También puedes filtrar casos de prueba asignados a un tester en concreto. Si eliges un tester " . + "en concreto tienes la posibilidad de mostrar además los casos de prueba sin asignar " . + "(hay disponibles Filtros Avanzados).

    Filtro de Resultado

    -

    Puedes filtrar casos de prueba por resultado (hay disponibles Filtros Avanzados). Puedes filtrar por " . -"resultado \"en la build seleccionada para ejecución\", \"en la última ejecución\", \"en TODAS las builds\", " . -"\"en CUALQUIER build\" y \"en una build en concreto\". Si se selecciona \"en una build en concreto\" puedes " . -"especificar la build.

    "; - - -// newest_tcversions.html +

    Puedes filtrar casos de prueba por resultado (hay disponibles Filtros Avanzados). Puedes filtrar por " . + "resultado \"en la build seleccionada para ejecución\", \"en la última ejecución\", \"en TODAS las builds\", " . + "\"en CUALQUIER build\" y \"en una build en concreto\". Si se selecciona \"en una build en concreto\" puedes " . + "especificar la build.

    "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Últimas versiones de los Casos de Prueba asignados

    El total de casos de prueba asociados al Plan de Pruebas es analizado, y se muestra una lista de los Casos de Prueba con su versión más reciente (junto con la selección actual incluida en el Plan de Pruebas). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Cobertura de Requisitos


    Esta funcionalidad permite relacionar requisitos de usuario o de sistema con casos de prueba. Puedes acceder a través del enlace \"Especificación de Requisitos\" de la pantalla principal.

    Especificación de Requisitos

    -

    Los requisitos están agrupados por documento de 'Especificación de Requisitos', que están relacionados al -Proyecto de Pruebas.
    TestLink no soporta versiones para la Especificación de Requisitos -y los Requisitos en sí mismos. Por tanto, la versión del documento debe ser añadida después de +

    Los requisitos están agrupados por documento de 'Especificación de Requisitos', que están relacionados al +Proyecto de Pruebas.
    TestLink no soporta versiones para la Especificación de Requisitos +y los Requisitos en sí mismos. Por tanto, la versión del documento debe ser añadida después de un Título de Especificación. -Un usuario puede añadir una simple descripción o notas al campo Descripción.

    +Un usuario puede añadir una simple descripción o notas al campo Descripción.

    -

    Sobreescribir el contador de REQs sirve para -evaluar la cobertura de Req. en caso de que no todos los requisitos estén añadidos (importados) a TestLink. -El valor 0 significa que el valor actual de requisitos es el que se usará para las métricas.

    -

    Ejemplo. El campo muestra un valor de 200 requisitos pero sólo 50 son añadidos a TestLink. La cobertura +

    Sobreescribir el contador de REQs sirve para +evaluar la cobertura de Req. en caso de que no todos los requisitos estén añadidos (importados) a TestLink. +El valor 0 significa que el valor actual de requisitos es el que se usará para las métricas.

    +

    Ejemplo. El campo muestra un valor de 200 requisitos pero sólo 50 son añadidos a TestLink. La cobertura de pruebas es del 25% (si todos los requisitos añadidos son probados).

    Requisitos

    Pulsa en el título de una Especificación de Requisitos. Puedes crear, editar, borrar o importar requisitos en el documento. Cada requisito tiene título, descripción y estado. El estado puede ser \"Normal\" o \"No testable\". Los requisitos No testables no son tenidos en cuenta en -las métricas. Este parámetro debería ser usado tanto para funcionalidades no implementadas como para -requisitos mal diseñados.

    +las métricas. Este parámetro debería ser usado tanto para funcionalidades no implementadas como para +requisitos mal diseñados.

    -

    Puedes crear nuevos casos de prueba desde los requsititos usando la acción múltiple con los requisitos +

    Puedes crear nuevos casos de prueba desde los requsititos usando la acción múltiple con los requisitos seleccionados en la pantalla de especificación. Estos Casos de Prueba son creados dentro de la Suite de Pruebas -con el nombre definido en la configuración (por defecto es: $tlCfg->req_cfg->default_testsuite_name = +con el nombre definido en la configuración (por defecto es: $tlCfg->req_cfg->default_testsuite_name = \"Título del Documento de Especificación de Requisitos + (generado automáticamente desde espec. req.)\";). Título y Descripción son copiados a estos casos de prueba.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Cobertura:

    -Un valor de, por ejemplo, \"40% (8/20)\" significa que se deben crear 20 Casos de Prueba para probar este -Requisito completamente. 8 de lo cuales ya han sido creados y enlazados a este Requisito, lo cual hace +Un valor de, por ejemplo, \"40% (8/20)\" significa que se deben crear 20 Casos de Prueba para probar este +Requisito completamente. 8 de lo cuales ya han sido creados y enlazados a este Requisito, lo cual hace que la cobertura sea del 40%. -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    En relación con 'Guardar Campos personalizados'

    -Si has definidos y asignado Campos Personalizados al
    +Si has definidos y asignado Campos Personalizados al
    Proyecto de Pruebas con las opciones:
    'Mostrar en plan de pruebas' y
    'Habilitar en el diseño del plan de pruebas'
    los verás en esta pantalla SÓLO para los Casos de Prueba asignados al Plan de Pruebas. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "Más información sobre los testers:
    Si pulsas en el nombre de un tester en esta tabla, verás un resumen más detallado de todos los Casos de Prueba asignados a ese usuario y su progreso de ejecución de pruebas.

    Nota:
    -Este informe muestra los casos de prueba que están asignados a un usuario en concreto y que han sido ejecutados -en la build activa. Incluso si un caso de prueba ha sido ejecutado por un usuario diferente al que tiene asignado, +Este informe muestra los casos de prueba que están asignados a un usuario en concreto y que han sido ejecutados +en la build activa. Incluso si un caso de prueba ha sido ejecutado por un usuario diferente al que tiene asignado, el caso de prueba will aparecerá como ejecutado por el usuario asignado. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    Enlaces Internos:

    -

    Los Enlaces Internos sirven para crear enlaces a otros requisitos/especificaciones de requisitos +

    Los Enlaces Internos sirven para crear enlaces a otros requisitos/especificaciones de requisitos con una sintaxis especial. El comportamiento de los Enlaces Internos puede ser modificado en el archivo de configuración.

    Uso: @@ -292,12 +287,11 @@

    Mensaje de registro para cambios:

    Siempre que se realiza un cambio, TestLink pregunta si se desea incluir un mensaje de registro. Este mensaje sirve para mantener la trazabilidad. -Si sólo ha cambiado la descripción del requisito eres libre de decidir si creas una nueva revisión o no. +Si sólo ha cambiado la descripción del requisito eres libre de decidir si creas una nueva revisión o no. Si se modifica algo más que la descripción se obliga a crear una nueva revisión.

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    Enlaces Directos:

    Para compartir fácilmente este documento con otros, simplemente pulsa el icono del blobo terráqueo de la parte superior de este documento para crear un enlace directo.

    @@ -310,17 +304,16 @@

    Muestra todos los casos de prueba asignados a este requisito.

    Relaciones:

    -

    Las Relaciones se usan para crear un modelo de relaciones entre requisitos. -Las relaciones personalizadas y la posibilidad de relacionar requisitos entre +

    Las Relaciones se usan para crear un modelo de relaciones entre requisitos. +Las relaciones personalizadas y la posibilidad de relacionar requisitos entre diferentes proyectos de prueba pueden ser configuradas en el archivo de configuración. -Si estableces la relación \"El Requisito A es padre del Requisito B\", +Si estableces la relación \"El Requisito A es padre del Requisito B\", TestLink establecerá la relación \"El Requisito B es hijo del Requisito A\" de forma implícita.

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    Enlaces Internos:

    -

    Los Enlaces Internos sirven para crear enlaces a otros requisitos/especificaciones de requisitos +

    Los Enlaces Internos sirven para crear enlaces a otros requisitos/especificaciones de requisitos con una sintaxis especial. El comportamiento de los Enlaces Internos puede ser modificado en el archivo de configuración.

    Uso: @@ -333,11 +326,10 @@ [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
    Esta sintaxis también funciona para especificaciones de requisitos (el atributo versión no se tiene en cuenta).
    Si no especificas una versión, se mostrará el requisito completo incluyendo todas las versiones.

    -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/es_ES/texts.php b/locale/es_ES/texts.php index 109e8c6720..e80fa430fb 100644 --- a/locale/es_ES/texts.php +++ b/locale/es_ES/texts.php @@ -1,45 +1,42 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat - * @copyright 2003-2009, TestLink community - * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ - * @link http://www.teamst.org/index.php - * - * ------------------------------------------------------------------------------------- - * Spanish (es_ES) translation - * ------------------------------------------------------------------------------------- - * Translated by: Jesus Hernandez - * Date: 2014/11/04 - * ------------------------------------------------------------------------------------- - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Error de la Aplicación"; -$TLS_htmltext['error'] = "

    Ha ocurrido un error inesperado. Por favor, consulta el visor de eventos o " . - "los mensajes de registro para más detalles.

    Agradeceríamos que informaras del error. Por favor, visita nuestra " . - "web.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "Asignar Requisitos a un Caso de Prueba"; -$TLS_htmltext['assignReqs'] = "

    Propósito:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat + * @copyright 2003-2009, TestLink community + * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ + * @link http://www.teamst.org/index.php + * + * ------------------------------------------------------------------------------------- + * Spanish (es_ES) translation + * ------------------------------------------------------------------------------------- + * Translated by: Jesus Hernandez + * Date: 2014/11/04 + * ------------------------------------------------------------------------------------- + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Error de la Aplicación"; +$TLS_htmltext['error'] = "

    Ha ocurrido un error inesperado. Por favor, consulta el visor de eventos o " . + "los mensajes de registro para más detalles.

    Agradeceríamos que informaras del error. Por favor, visita nuestra " . + "web.

    "; + +$TLS_htmltext_title['assignReqs'] = "Asignar Requisitos a un Caso de Prueba"; +$TLS_htmltext['assignReqs'] = "

    Propósito:

    Esta funcionalidad permite establecer relaciones entre los Requisitos y los Casos de Prueba. Un diseñador podría definir relaciones 0..n a 0..n. Por ejemplo, un Caso de Prueba podría estar asignado a ninguno, a uno o a muchos Requisitos y viceversa. Esta matriz de trazabilidad ayuda @@ -53,54 +50,52 @@

  • Selecciona una Especificación de Requisitos si hay más de una definida. TestLink recarga la página automáticamente.
  • Aparecen dos bloques: 'Requisitos Asignados' que es la lista de todos los Requisitos de la Especificación - seleccionada que están asignados al Caso de Prueba y 'Requisitos Disponibles' que es la lista de todos los + seleccionada que están asignados al Caso de Prueba y 'Requisitos Disponibles' que es la lista de todos los Requisitos que no están asignados al Caso de Prueba actual. Un diseñador podría marcar Requisitos que están cubiertos por este Caso de Prueba y hacer click en el botón 'Asignar'. Estos nuevos Requisitos asignados al Caso de Prueba se mostrarán en el bloque de 'Requisitos Asignados'.
  • -"; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Especificación de Pruebas"; -$TLS_htmltext['editTc'] = "

    Propósito:

    -

    La Especificación de Pruebas permite a los usuarios ver y editar todo el contenido existente para " . - "Suites de Pruebas y Casos de Prueba. Los Casos de Prueba son versionados y todas " . - "las versiones anteriores están disponibles y pueden ser vistas y gestionadas desde aquí.

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Especificación de Pruebas"; +$TLS_htmltext['editTc'] = "

    Propósito:

    +

    La Especificación de Pruebas permite a los usuarios ver y editar todo el contenido existente para " . + "Suites de Pruebas y Casos de Prueba. Los Casos de Prueba son versionados y todas " . + "las versiones anteriores están disponibles y pueden ser vistas y gestionadas desde aquí.

    Primeros pasos:

      -
    1. Selecciona tu Proyecto de Pruebas en el árbol de navegación (el nodo raíz). Por favor, ten en cuenta que: " . - "Siempre puedes cambiar el Proyecto de Pruebas activo seleccionando uno diferente en la " . - "lista desplegable de la esquina superior derecha.
    2. -
    3. Crea una nueva Suite de Pruebas pulsando en Nueva Suite de Pruebas. Las Suites de Pruebas pueden " . - "ser utilizadas para estructurar tus documentos de prueba de acuerdo a tus necesidades (tets funcionales/no funcionales, " . - "componentes del producto o características, peticiones de cambio, etc.). La descripción de " . - "una Suite de Pruebas puede contener el alcance de los casos de prueba incluidos, la configuración por defecto, " . - "enlaces a documentos importantes, limitaciones y otra información de utilidad. En general, " . - "todas las anotaciones que son comunes a los Casos de Prueba incluidos. Las Suites de Pruebas se comportan " . - "como un directorio escalable, por lo que los usuarios pueden mover y copiar las Suites de Pruebas dentro " . - "del Proyecto de Pruebas. Además, las Suites de Pruebas pueden ser importadas o exportadas (incluyendo los casos de prueba que contienen).
    4. -
    5. Las Suites de Pruebas son directorios escalables. Los usuarios pueden mover y copiar las Suites de Pruebas dentro " . - "del Proyecto de Pruebas. Las Suites de Pruebas podrían ser importadas o exportadas (incluidos los Casos de Prueba). -
    6. Seleccionar tu recien creada Suite de Pruebas en el árbol de navegación y crea " . - "un nuevo Caso de Prueba pulsando en Crear Caso de Prueba. Un Caso de Prueba especifica " . - "un escenario de pruebas en particular, resultados esperados y campos personalizados definidos " . - "en el Proyecto de Pruebas (consulta el manual de usuario para más información). Además es posible " . - "asignar keywords para mejorar la trazabilidad.
    7. +
    8. Selecciona tu Proyecto de Pruebas en el árbol de navegación (el nodo raíz). Por favor, ten en cuenta que: " . + "Siempre puedes cambiar el Proyecto de Pruebas activo seleccionando uno diferente en la " . + "lista desplegable de la esquina superior derecha.
    9. +
    10. Crea una nueva Suite de Pruebas pulsando en Nueva Suite de Pruebas. Las Suites de Pruebas pueden " . + "ser utilizadas para estructurar tus documentos de prueba de acuerdo a tus necesidades (tets funcionales/no funcionales, " . + "componentes del producto o características, peticiones de cambio, etc.). La descripción de " . + "una Suite de Pruebas puede contener el alcance de los casos de prueba incluidos, la configuración por defecto, " . + "enlaces a documentos importantes, limitaciones y otra información de utilidad. En general, " . + "todas las anotaciones que son comunes a los Casos de Prueba incluidos. Las Suites de Pruebas se comportan " . + "como un directorio escalable, por lo que los usuarios pueden mover y copiar las Suites de Pruebas dentro " . + "del Proyecto de Pruebas. Además, las Suites de Pruebas pueden ser importadas o exportadas (incluyendo los casos de prueba que contienen).
    11. +
    12. Las Suites de Pruebas son directorios escalables. Los usuarios pueden mover y copiar las Suites de Pruebas dentro " . + "del Proyecto de Pruebas. Las Suites de Pruebas podrían ser importadas o exportadas (incluidos los Casos de Prueba). +
    13. Seleccionar tu recien creada Suite de Pruebas en el árbol de navegación y crea " . + "un nuevo Caso de Prueba pulsando en Crear Caso de Prueba. Un Caso de Prueba especifica " . + "un escenario de pruebas en particular, resultados esperados y campos personalizados definidos " . + "en el Proyecto de Pruebas (consulta el manual de usuario para más información). Además es posible " . + "asignar keywords para mejorar la trazabilidad.
    14. Navega por la vista en árbol del lado izquierdo y edite la información. Los Casos de Prueba almacenan su propio historial.
    15. Asigna tu Especificación de Pruebas al Plan de Pruebas cuando tus Casos de Prueba estén preparados.
    -

    Con TestLink organizas los casos de prueba en suites de pruebas." . -"Las Suites de Pruebas pueden ser anidadas dentro de otras suites de pruebas, permitiendote crear jerarquías de suites de pruebas. - Entonces puedes imprimir esta información junto con los casos de prueba.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Pantalla de Búsqueda de Caso de Prueba"; -$TLS_htmltext['searchTc'] = "

    Propósito:

    +

    Con TestLink organizas los casos de prueba en suites de pruebas." . + "Las Suites de Pruebas pueden ser anidadas dentro de otras suites de pruebas, permitiendote crear jerarquías de suites de pruebas. + Entonces puedes imprimir esta información junto con los casos de prueba.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Pantalla de Búsqueda de Caso de Prueba"; +$TLS_htmltext['searchTc'] = "

    Propósito:

    Navegación según las keywords y/o las palabras buscadas. La búsqueda no distingue minúsculas de mayúsculas. Los resultados incluyen sólo los casos de prueba del Proyecto de Pruebas actual.

    @@ -112,12 +107,12 @@
  • Elige la keyword requerida o escribe el valor 'No aplica'.
  • Pulsa el botón 'Buscar'.
  • Todos los casos de prueba que cumplen los criterios son mostrados. Puedes modificar los casos de prueba mediante el enlace 'Título'.
  • -"; - -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Pantalla de Búsqueda de Requisitos"; -$TLS_htmltext['searchReq'] = "

    Propósito:

    +"; + +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Pantalla de Búsqueda de Requisitos"; +$TLS_htmltext['searchReq'] = "

    Propósito:

    Navegación según las keywords y/o las palabras buscadas. La búsqueda no distingue minúsculas de mayúsculas. Los resultados incluyen sólo los requisitos del Proyecto de Pruebas actual.

    @@ -135,12 +130,12 @@

    - Sólo se buscarán requisitos del proyecto de pruebas actual.
    - La búsqueda no distingue minúsculas de mayúsculas.
    -- Los campos vacíos no se tienen en cuenta.

    "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Pantalla de Búsqueda de Especificación de Requisitos"; -$TLS_htmltext['searchReqSpec'] = "

    Propósito:

    +- Los campos vacíos no se tienen en cuenta.

    "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Pantalla de Búsqueda de Especificación de Requisitos"; +$TLS_htmltext['searchReqSpec'] = "

    Propósito:

    Navegación según las keywords y/o las palabras buscadas. La búsqueda no distingue minúsculas de mayúsculas. Los resultados incluyen sólo las especificaciones de requisitos del Proyecto de Pruebas actual.

    @@ -158,13 +153,12 @@

    - Sólo se buscarán requisitos del proyecto de pruebas actual.
    - La búsqueda no distingue minúsculas de mayúsculas.
    -- Los campos vacíos no se tienen en cuenta.

    "; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificación de Pruebas"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Propósito:

    +- Los campos vacíos no se tienen en cuenta.

    "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificación de Pruebas"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Propósito:

    Desde aquí puedes imprimir un único caso de prueba, todos los casos de prueba de una suite de pruebas, o todos los casos de prueba de un proyecto de pruebas o plan.

    Primeros pasos:

    @@ -181,19 +175,18 @@
  • Usa la funcionalidad de imprimir de tu navegador para imprimir la información.
    Nota: Asegúrate de imprimir únicamente el marco derecho de la pantalla.

  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Diseño de Especificación de Requisitos"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    Puedes gestionar documentos de Especificación de Requisitos.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Diseño de Especificación de Requisitos"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    Puedes gestionar documentos de Especificación de Requisitos.

    Especificación de Requisitos

    -

    Los requisitos están agrupados por documento de Especificación de Requisitos que están relacionados al +

    Los requisitos están agrupados por documento de Especificación de Requisitos que están relacionados al Proyecto de Pruebas.

    -

    Los documentos de Especificación de Requisitos pueden estar ordenados jerárquicamente. +

    Los documentos de Especificación de Requisitos pueden estar ordenados jerárquicamente. Crear el nivel superior de los documentos de Especificación de Requisitos ulsando en el nodo del proyecto.

    TestLink no soporta (aún) versiones para la Especificación de Requisitos @@ -201,11 +194,11 @@ un Título de Especificación. Un usuario puede añadir una simple descripción o notas al campo Descripción.

    -

    Sobreescribir el contador de REQs sirve para -evaluar la cobertura de Req. en caso de que no todos los requisitos estén añadidos a TestLink. +

    Sobreescribir el contador de REQs sirve para +evaluar la cobertura de Req. en caso de que no todos los requisitos estén añadidos a TestLink. El valor 0 significa que el valor actual de requisitos es el que se usará para las métricas.

    -

    Ejemplo. El campo muestra un valor de 200 requisitos pero sólo 50 son añadidos a TestLink. La cobertura +

    Ejemplo. El campo muestra un valor de 200 requisitos pero sólo 50 son añadidos a TestLink. La cobertura de pruebas es del 25% (si todos los requisitos añadidos son probados).

    Requisitos

    @@ -213,25 +206,24 @@

    Pulsa en el título de una Especificación de Requisitos. Puedes crrar, editar, borrar o importar requisitos en el documento. Cada requisito tiene título, descripción y estado. El estado puede ser 'Normal' o 'No testable'. Los requisitos No testables no son tenidos en cuenta en -las métricas. Este parámetro debería ser usado tanto para funcionalidades no implementadas como para +las métricas. Este parámetro debería ser usado tanto para funcionalidades no implementadas como para requisitos mal diseñados.

    -

    Puedes crear nuevos casos de prueba desde los requsititos usando la acción múltiple con los requisitos +

    Puedes crear nuevos casos de prueba desde los requsititos usando la acción múltiple con los requisitos seleccionados en la pantalla de especificación. Estos Casos de Prueba son creados dentro de la Suite de Pruebas con el nombre definido en la configuración (por defecto es: \$tlCfg->req_cfg->default_testsuite_name = 'Título del Documento de Especificación de Requisitos + (generado automáticamente desde espec. req.)';). -Título y Descripción son copiados a estos Casos de Prueba.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Imprimir Especificación de Requisitos"; //printReq +Título y Descripción son copiados a estos Casos de Prueba.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Imprimir Especificación de Requisitos"; // printReq $TLS_htmltext['printReqSpec'] = "

    Propósito:

    Desde aquí puedes imprimir un requisito, todos los requisitos de la especificación de requisitos, o todos los requisitos del proyecto de pruebas.

    Primeros pasos:

    1. -

      Selecciona las partes de los requisitos que quieres mostrar y luego pulsa en un requisito, +

      Selecciona las partes de los requisitos que quieres mostrar y luego pulsa en un requisito, especificación de requisito o proyecto de pruebas. Se mostrará una página imprimible.

    2. Usa la lista desplegable \"Mostrar como\" del panel de navegación para especificar si quieres @@ -242,12 +234,11 @@

    3. Usa la funcionalidad de imprimir de tu navegador para imprimir la información.
      Nota: Asegúrate de imprimir únicamente el marco derecho de la pantalla.

    4. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Asignación de Keyword"; -$TLS_htmltext['keywordsAssign'] = "

    Propósito:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Asignación de Keyword"; +$TLS_htmltext['keywordsAssign'] = "

    Propósito:

    La pantalla de asignación de Keywords es el lugar en el que los usuarios pueden asignar keywords a la Suite de Pruebas existente o a un Caso de Prueba

    @@ -271,16 +262,15 @@

    TestLink usa este enfoque para que las versiones antiguas de los casos de prueba en los planes de pruebas no se vean afectadas por asignaciones de keywords que realices en las versiones más nuevas de los casos de prueba. Si quieres que los casos de prueba de tu plan de pruebas estén actualizados, primero verifica que están al día utilizando la funcionalidad -'Actualizar Casos de Prueba Modificados' ANTES de realizar la asignación de keyword.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Ejecución de Caso de Prueba"; -$TLS_htmltext['executeTest'] = "

    Propósito:

    +'Actualizar Casos de Prueba Modificados' ANTES de realizar la asignación de keyword.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Ejecución de Caso de Prueba"; +$TLS_htmltext['executeTest'] = "

    Propósito:

    Permite al usuario ejecutar casos de prueba. El usuario puede asignar resultados de prueba -a un Caso de Prueba para cada Build. Consulta la ayuda para más información sobre filtrado y configuración " . - "(pulsa en el icono con el signo de interrogación).

    +a un Caso de Prueba para cada Build. Consulta la ayuda para más información sobre filtrado y configuración " . + "(pulsa en el icono con el signo de interrogación).

    Primeros pasos:

    @@ -294,13 +284,13 @@
  • Selecciona el resultado del caso de prueba y completa las notas y la asignación de defectos.
  • Guarda los resultados.
  • -

    Nota: TestLink debe ser configurado para trabajar con un Gestor de Defectos -si quieres crear/enlazar un defecto directamente desde la interfaz.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Descripción de Informes de Pruebas y Métricas"; -$TLS_htmltext['showMetrics'] = "

    Los informes están relacionados a un Plan de Pruebas " . - "(definido en la parte superior del Navegador). Este Plan de Pruebas puede ser diferente al +

    Nota: TestLink debe ser configurado para trabajar con un Gestor de Defectos +si quieres crear/enlazar un defecto directamente desde la interfaz.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Descripción de Informes de Pruebas y Métricas"; +$TLS_htmltext['showMetrics'] = "

    Los informes están relacionados a un Plan de Pruebas " . + "(definido en la parte superior del Navegador). Este Plan de Pruebas puede ser diferente al Plan de Pruebas actual para la ejecución. Además puedes seleccionar el formato del informe:

    • Normal - el informe es mostrado en una página web
    • @@ -424,12 +414,11 @@

      Defectos Totales para cada Caso de Prueba

      Este informe muestra cada caso de prueba con todos los defectos asociados en todo el proyecto de pruebas. -Este informe sólo está disponible si hay un Gestor de Defectos conectado.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Añadir / Quitar Casos de Prueba del Plan de Pruebas"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Propósito:

      +Este informe sólo está disponible si hay un Gestor de Defectos conectado.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Añadir / Quitar Casos de Prueba del Plan de Pruebas"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Propósito:

      Los usuarios con privilegios (con un nivel de permisos determinado) pueden añadir o quitar casos de prueba de un Plan de Pruebas.

      Añadir o quitar Casos de Prueba:

      @@ -437,11 +426,11 @@
    • Pulsa en una suite de pruebas para ver todas sus suites de pruebas y todos sus casos de prueba.
    • Posteriormente pulsa el botón 'Añadir / Quitar Casos de Prueba' para añadir o quitar los casos de prueba. Nota: No es posible añadir el mismo caso de prueba varias veces.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Asignar Testers a la ejecución de pruebas"; -$TLS_htmltext['tc_exec_assignment'] = "

      Propósito

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Asignar Testers a la ejecución de pruebas"; +$TLS_htmltext['tc_exec_assignment'] = "

      Propósito

      Esta pantalla permite a los líderes de pruebas asignar usuarios a casos de prueba particulares del Plan de Pruebas.

      Primeros pasos:

      @@ -450,15 +439,15 @@
    • Selecciona un tester.
    • Pulsa el botón para confirmar la asignación.
    • Abre la pantalla de ejecución para verificar la asignación. Puedes configurar un filtro para los usuarios.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Actualizar Casos de Prueba del Plan de Pruebas"; -$TLS_htmltext['planUpdateTC'] = "

      Propósito

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Actualizar Casos de Prueba del Plan de Pruebas"; +$TLS_htmltext['planUpdateTC'] = "

      Propósito

      Esta pantalla permite actualizar el Caso de Prueba a una nueva (diferente) versión en el caso de que la Especificación -de Pruebas haya cambiado. Sucede a menudo que alguna funcionalidad se clarifica durante el testing." . - " El usuario modifica la Especificación de Pruebas, pero es necesario que los cambios se propaguen también al Plan de Pruebas. En otro caso, el Plan" . - " de Pruebas mantiene la versión original para estar seguros de que el resultado se refiere al text correcto del Caso de Prueba.

      +de Pruebas haya cambiado. Sucede a menudo que alguna funcionalidad se clarifica durante el testing." . + " El usuario modifica la Especificación de Pruebas, pero es necesario que los cambios se propaguen también al Plan de Pruebas. En otro caso, el Plan" . + " de Pruebas mantiene la versión original para estar seguros de que el resultado se refiere al text correcto del Caso de Prueba.

      Primeros pasos:

        @@ -466,14 +455,13 @@
      1. Elige una nueva versión para un Caso de Prueba en particular.
      2. Pulsa el botón 'Actualizar Plan de Pruebas' para aplicar los cambios.
      3. Para verificar: Abre la pantalla de ejecución para ver el text del caso de prueba.
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Especificar casos de prueba con alta o baja urgencia"; -$TLS_htmltext['test_urgency'] = "

      Propósito

      -

      TestLink permite establecer la urgencia de una Suite de Pruebas para afectar a la Prioridad de los casos de prueba. - La prioridad de los casos depende tanto de la Importancia de los casos de prueba como de la Urgencia definida en +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Especificar casos de prueba con alta o baja urgencia"; +$TLS_htmltext['test_urgency'] = "

      Propósito

      +

      TestLink permite establecer la urgencia de una Suite de Pruebas para afectar a la Prioridad de los casos de prueba. + La prioridad de los casos depende tanto de la Importancia de los casos de prueba como de la Urgencia definida en el Plan de Pruebas. El lider de pruebas debe especificar el conjunto de casos de prueba que deberían ser probados en primer lugar. Esto ayuda a asegurar que el testing cubrirá los casos de prueba más importantes incluso bajo presiones de tiempo.

      @@ -487,10 +475,9 @@ cambios significativos.
    • Pulsa el botón 'Guardar' para aplicar los cambios.
    • -

      Por ejemplo, un Caso de Prueba con una importancia Alta en una Suite de Pruebas con Baja urgencia " . - "tendrá una prioridad Media."; - - -// ------------------------------------------------------------------------------------------ - +

      Por ejemplo, un Caso de Prueba con una importancia Alta en una Suite de Pruebas con Baja urgencia " . + "tendrá una prioridad Media."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/fi_FI/description.php b/locale/fi_FI/description.php index ac742120c8..c28ce84bc5 100644 --- a/locale/fi_FI/description.php +++ b/locale/fi_FI/description.php @@ -1,33 +1,32 @@ -Vaihtoehtoja asiakirjan luomiseen

      Tällä taulukolla käyttäjät voivat suodattattaa testitapauksia, ennen niiden näyttämistä. Jos valitut (tarkastettu) tiedot tulevat näkyviin. Muuttaaksesi tietojen esitystä, valitse tai poista, valitse Suodatus ja valitse haluamasi tiedot hakemistosta.

      @@ -40,9 +39,9 @@

      Sisällysluettelo: TestLink lisätään luettelo kaikista Nimekkeitä sisäiseen hypertekstilinkkejä jos tarkastetaan..

      -

      Esitysmuoto: Mahdollisuuksia on kaksi: HTML ja MS Word. Selain vaatii MS Word-osan toisessa tapauksessa.

      "; - -// testPlan.html +

      Esitysmuoto: Mahdollisuuksia on kaksi: HTML ja MS Word. Selain vaatii MS Word-osan toisessa tapauksessa.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Test Plan

      Yleistä

      @@ -55,9 +54,9 @@

      Tämä osio, joka on vain johtaa saatavilla avulla käyttäjät voivat hallita testi suunnitelmia. Hallinnoivan testi suunnitelmiin kuuluu luodaan tai muokataan / poistetaan suunnitelmien lisääminen / muokkaaminen / poistaminen / tai päivittäminen testi tapauksissa suunnitelmiin, luomalla rakentuu sekä määritellään, kuka voi nähdä, mitkä suunnitelman.
      Käyttäjät, joilla on johtaa oikeudet voivat myös asettaa ensisijaiset / riski-ja omistajanvaihdoksiin Test tapauksessa suites (luokat) ja luoda testaus välietapit.

      -

      Huom: On mahdollista, että käyttäjät eivät voi nähdä Avattavan sisältävät kaikki Test suunnitelmia. Tässä tilanteessa kaikki linkit (paitsi johtaa käytössä ones) on purettu. Jos olet tässä tilanteessa sinun tulee ottaa yhteyttä lyijyä tai admin myöntää sinulle oikea hanke oikeuksia tai luo Test Plan sinulle.

      "; - -// custom_fields.html +

      Huom: On mahdollista, että käyttäjät eivät voi nähdä Avattavan sisältävät kaikki Test suunnitelmia. Tässä tilanteessa kaikki linkit (paitsi johtaa käytössä ones) on purettu. Jos olet tässä tilanteessa sinun tulee ottaa yhteyttä lyijyä tai admin myöntää sinulle oikea hanke oikeuksia tai luo Test Plan sinulle.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Custom Fields

      Seuraavassa on joitakin faktoja täytäntöönpanoa mukautetun aloilla:

        @@ -90,14 +89,14 @@
      • Ota Testisivulla suunnitelman suunnitteluun. Käyttäjä voi muuttaa arvoa aikana Test Plan suunnittelu (lisää testi tapauksissa testi suunnitelma)
      • Käytettävissä. Käyttäjä päättää, millaisia erä alalla belows.
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Executing Test Cases

      Avulla käyttäjät voivat 'toteuttaa' testi tapauksissa. Suorittaminen itse on vain siirtää testin tapauksessa tulos (siirrä, epäonnistuvat, estetty) vastaan valitun rakentaa.

      -

      Mahdollisuus käyttää vianseurantajärjestelmä voi kokoonpanosta. Käyttäjä voi suoraan lisätä uuden vikoja ja selata exesting kuin silloin.

      "; - -// bug_add.html +

      Mahdollisuus käyttää vianseurantajärjestelmä voi kokoonpanosta. Käyttäjä voi suoraan lisätä uuden vikoja ja selata exesting kuin silloin.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Lisää Bugs Test asia

      (vain, jos se on määritetty) TestLink on hyvin yksinkertainen integrointi Bug Tracking System (BTS), ei voi joko lähettää virheraportin creationg pyynnön BTS, ei saada takaisin bug id. Integroituminen tapahtuu linkkejä sivut BTS, että puhelut seuraavat ominaisuudet: @@ -117,51 +116,52 @@

    Kun sulkemalla lisätä bug sivulla, näet asiaa bug koskevat tiedot suorittaa sivulle. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Setup Suodatetaan ja Rakenna Testiparametrien täytäntöönpano

    -

    Vasemmanpuoleisessa ruudussa koostuu alkaen navigaattorin avulla testi tapauksissa osoitettu nykyinen". -"Test suunnitella ja taulukko, asetukset ja suodatetaan. Nämä suodattimet avulla käyttäjä ". -"tarkentaa tarjotaan joukko testi tapauksissa, ennen kuin ne on suoritettu." . -"Setup suodattimesi paina \"Käytä\" painiketta ja valitse sopiva Testitapaus" . -" puu-valikosta.

    +

    Vasemmanpuoleisessa ruudussa koostuu alkaen navigaattorin avulla testi tapauksissa osoitettu nykyinen" . + "Test suunnitella ja taulukko, asetukset ja suodatetaan. Nämä suodattimet avulla käyttäjä " . + "tarkentaa tarjotaan joukko testi tapauksissa, ennen kuin ne on suoritettu." . + "Setup suodattimesi paina \"Käytä\" painiketta ja valitse sopiva Testitapaus" . + " puu-valikosta.

    Build

    -

    Käyttäjien tulee valita rakentaa, jotka liittyvät testin tuloksen. ". -" Rakentaa ovat perusasetuksen komponentin nykyinen Test Plan. Jokainen testi " . -"voidaan käyttää useamman kerran per rakentaa. Kuitenkin viime tuloksia on laskea vain. +

    Käyttäjien tulee valita rakentaa, jotka liittyvät testin tuloksen. " . + " Rakentaa ovat perusasetuksen komponentin nykyinen Test Plan. Jokainen testi " . + "voidaan käyttää useamman kerran per rakentaa. Kuitenkin viime tuloksia on laskea vain.
    Rakentaa voidaan luoda johtaa käyttämällä Luo uusi Rakenna sivulla.

    Test Case ID filter

    Käyttäjät voivat testata suodattimet tapauksissa yksilöllinen tunniste. Tämä tunnus on luotu automaattisesti luoda aikaa. Tyhjä laatikko tarkoittaa, että suodatin ei sovelleta.

    Priority filter

    -

    Käyttäjät voivat testata suodattimet tapauksissa testi etusijalla. Jokainen testi tapauksessa tärkeää on yhdistää" . - "kanssa testi kiireellisissä nykyisen Test suunnitelma. Esimerkiksi 'KORKEAT' ensisijaisia testin tapauksessa" . -"näkyy, jos merkitystä tai kiireellisyys on KORKEA ja toisen attribuutin on vähintään 'KESKITASO' tasolla.

    +

    Käyttäjät voivat testata suodattimet tapauksissa testi etusijalla. Jokainen testi tapauksessa tärkeää on yhdistää" . + "kanssa testi kiireellisissä nykyisen Test suunnitelma. Esimerkiksi 'KORKEAT' ensisijaisia testin tapauksessa" . + "näkyy, jos merkitystä tai kiireellisyys on KORKEA ja toisen attribuutin on vähintään 'KESKITASO' tasolla.

    Result filter

    -

    Käyttäjät voivat testata suodattimet tapauksissa tuloksia. Tulokset ovat mitä tapahtui, että testi tapauksessa aikana erityisesti rakentaa. Testitapauksia voi kulkea, epäonnistuvat, on estetty, tai ei saa olla päällä. " . -"Tämä suodin on oletusarvona pois päältä.

    +

    Käyttäjät voivat testata suodattimet tapauksissa tuloksia. Tulokset ovat mitä tapahtui, että testi tapauksessa aikana erityisesti rakentaa. Testitapauksia voi kulkea, epäonnistuvat, on estetty, tai ei saa olla päällä. " . + "Tämä suodin on oletusarvona pois päältä.

    User filter

    -

    Käyttäjät voivat testata suodattimet tapauksissa niiden siirronsaajalle. Tarkastus-box mahdollistaa sisällyttää myös " . -"\"Vapaana\" testit osaksi johtanut asettaa lisäksi.

    "; -/* -

    Useimmat Nykyinen tulos

    -

    Oletusarvon tai jos 'viimeisintä' valintaruutu ei ole valittu, puussa on LAJITTELE luontinumero että valitaan avattavasta laatikko. Tässä tilassa puun näyttää testin tapauksissa tila. -
    Esimerkki: Käyttäjä valitsee rakentaa 2 avattavasta kentästä ja ei tarkistaaksesi 'viimeisintä' valintaruutu. Kaikki testin tapauksissa näkyy niiden tilan rakentaa 2. Joten, jos testi 1 hyväksyttiin rakentaa 2 on väritetty vihreäksi. -
    Jos käyttäjä decideds tarkistaaksesi 'viimeisintä' valintaruutu puussa on värillinen, että testi tapauksissa viimeisimmän tuloksen. -
    Esim: Käyttäjä valitsee rakentaa 2 avattavasta ruutuun ja tällä kertaa tarkistaa 'viimeisintä' valintaruutu. Kaikki testin tapauksissa näkyy useimpien nykyinen tila. Joten, jos testi 1 hyväksyttiin rakentaa 3, vaikka käyttäjä on myös valittu rakentaa 2, se on väritetty vihreäksi.

    "; */ - -// newest_tcversions.html +

    Käyttäjät voivat testata suodattimet tapauksissa niiden siirronsaajalle. Tarkastus-box mahdollistaa sisällyttää myös " . + "\"Vapaana\" testit osaksi johtanut asettaa lisäksi.

    "; +/* + *

    Useimmat Nykyinen tulos

    + *

    Oletusarvon tai jos 'viimeisintä' valintaruutu ei ole valittu, puussa on LAJITTELE luontinumero että valitaan avattavasta laatikko. Tässä tilassa puun näyttää testin tapauksissa tila. + *
    Esimerkki: Käyttäjä valitsee rakentaa 2 avattavasta kentästä ja ei tarkistaaksesi 'viimeisintä' valintaruutu. Kaikki testin tapauksissa näkyy niiden tilan rakentaa 2. Joten, jos testi 1 hyväksyttiin rakentaa 2 on väritetty vihreäksi. + *
    Jos käyttäjä decideds tarkistaaksesi 'viimeisintä' valintaruutu puussa on värillinen, että testi tapauksissa viimeisimmän tuloksen. + *
    Esim: Käyttäjä valitsee rakentaa 2 avattavasta ruutuun ja tällä kertaa tarkistaa 'viimeisintä' valintaruutu. Kaikki testin tapauksissa näkyy useimpien nykyinen tila. Joten, jos testi 1 hyväksyttiin rakentaa 3, vaikka käyttäjä on myös valittu rakentaa 2, se on väritetty vihreäksi.

    "; + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Uusimmat versiot liittyvät Test Cases

    Koko joukko Test asiat liittyvät Test Plan on analysoitu, ja luettelo Test asiat, joilla on uusin versio näkyy (verrattuna nykyiseen, että Test Plan). -

    "; - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Vaatimukset Kattavuus


    Tämä ominaisuus mahdollistaa kartta kattavuuskerrointa käyttäjän tai järjestelmän vaatimuksia testi tapauksissa. Navigoi kautta linkki \"Requirement Specification\" vuonna päänäyttö.

    @@ -178,19 +178,19 @@

    Klikkaa otsikkoa, joka luotiin eritelmä. Voit luoda, muokata, poistaa tai maahantuonnin vaatimukset asiakirjan. Jokainen vaatimus on nimi, laajuus ja tila. Tila olisi \ Normaali \ tai \ Ei testable \. Ei testable vaatimuksia ei lasketa ja käyttötiedot Tämä parametri olisi käyttää sekä unimplemented ominaisuuksia ja väärin suunnitellut vaatimukset.

    Voit luoda uuden testin tapauksissa vaatimukset käyttämällä useita toimia tarkastetaan vaatimukset eritelmän näytöllä. Nämä Test Cases luodaan osaksi testausohjelmisto nimi määritelty kokoonpano i (oletus on: $ tlCfg-req cfg-default testsuite nimi = \ testausohjelmisto luoma Vaatimus - Auto \;) / i. Otsikko ja Soveltamisala kopioidaan nämä testitapauksia

    -"; - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Mitä 'Tallenna Custom Fields'

    Jos olet määrittänyt, ja niihin liitetään Test Project,
    Custom Fields kanssa:
    'Näyttö testi suunnitelman suunnittelu = true' ja
    'Ota Testisivulla suunnitelman suunnittelu = true'
    näette nämä tällä sivulla AINOASTAAN Test asiat liittyvät Test Plan. -"; - -// xxx.html -$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +$TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/fi_FI/texts.php b/locale/fi_FI/texts.php index 9db49b590f..f48720382a 100644 --- a/locale/fi_FI/texts.php +++ b/locale/fi_FI/texts.php @@ -1,79 +1,77 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * Revisions history is not stored for the file - * - * - * @package TestLink - * @author Kirsi Mäkinen, Jan-Erik Finlander, Juho Kauppi, Heikki Alonen, Jari Ahonen, Otto Moilanen - * @copyright 2003-2009, TestLink community - * @version CVS: $Id: texts.php,v 1.3 2010/06/24 17:25:55 asimon83 Exp $ - * @link http://www.teamst.org/index.php - * - **/ - - -$TLS_htmltext_title['assignReqs'] = "Määritä Testitapauksen vaatimukset "; +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * Revisions history is not stored for the file + * + * + * @package TestLink + * @author Kirsi Mäkinen, Jan-Erik Finlander, Juho Kauppi, Heikki Alonen, Jari Ahonen, Otto Moilanen + * @copyright 2003-2009, TestLink community + * @version CVS: $Id: texts.php,v 1.3 2010/06/24 17:25:55 asimon83 Exp $ + * @link http://www.teamst.org/index.php + * + **/ +$TLS_htmltext_title['assignReqs'] = "Määritä Testitapauksen vaatimukset "; $TLS_htmltext['assignReqs'] = "

    Tarkoitus:

    Käyttäjät voivat asettaa suhteita ja testata tapauksissa. Testi suunnittelija voi määrittää suhteet 0..n to 0..n. I.e. Yksi testi tapauksessa voitaisiin antaa, ei yhtään, yhden tai useamman vaatimuksen ja päinvastoin. Tällainen jäljitettävyys matriisi auttaa tutkimaan testin kattavuuden vaatimukset ja selvittää, mitkä onnistuneesti jättänyt aikana testaus. Tämä analysoida toimii varmistetaan, että kaikki määritellyt odotukset ovat täyttyneet.

    Aloita:

      -
    1. Valitse Test Asia on puu milloin vasemmalle. Yhdistelmäruutuun ruutuun luettelo Vaatimukset Tekniset näkyy yläosassa olevaa workarea.
    2. +
    3. Valitse Test Asia on puu milloin vasemmalle. Yhdistelmäruutuun ruutuun luettelo Vaatimukset Tekniset näkyy yläosassa olevaa workarea.
    4. Valitse eritelmä Asiakirja jos useammat kerran määritelty.
    5. Valitse eritelmä Asiakirja jos useammat kerran määritelty. TestLink automaattisesti reloads sivua.
    6. Keski block workarea luetellaan kaikki vaatimukset (alkaen valittu Specification), jotka liittyvät testin tapauksessa. Pohja estää 'Saatavilla olevat vaatimukset' luetellaan kaikki vaatimukset, jotka eivät ole suhteessa nykyisen testin tapauksessa. Suunnittelija voi tavaramerkin vaatimuksia, jotka kuuluvat tämän testin, ja valitse sitten painiketta 'Valitse'. Nämä uudet sidottuja testi näkyvät keskellä estää 'sidotut Vaatimukset'.
    7. -
    "; - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['editTc'] = "Testauseritelmä"; +"; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['editTc'] = "Testauseritelmä"; $TLS_htmltext['editTc'] = "

    Tarkoitus:

    Tarkoitus:

    -

    The Testauseritelmä avulla käyttäjät voivat tarkastella ja muokata kaikki nykyiset " . -"Test Suites ja Testi Cases. Test Cases ovat versioidut ja kaikki " . -"ja aiemmat versiot ovat saatavilla ja niitä voidaan tarkastella ja hallinnoi täällä.

    +

    The Testauseritelmä avulla käyttäjät voivat tarkastella ja muokata kaikki nykyiset " . + "Test Suites ja Testi Cases. Test Cases ovat versioidut ja kaikki " . + "ja aiemmat versiot ovat saatavilla ja niitä voidaan tarkastella ja hallinnoi täällä.

    Aloita:

      -
    1. Valitse Test projekti navigointisivun puu (root node). Huomaa: " . -"Voit aina muuttaa aktivoida Test Project valitsemalla eri jokin " . -"alasvetovalikossa yläkulmasta oikeaan alakulmaan.
    2. -
    3. Luo uusi testausohjelmisto klikkaamalla New Child testausohjelmisto. testausohjelmisto voi " . -"saatettava rakenteen testi-asiakirjojen mukaan teidän yleissopimusten (toiminnallinen / ei-toiminnallinen" . -"testit, tuotteen osia tai toimintoja, muuttaa jne.). Kuvaus" . -"testiohjelmisto voisi pitää soveltamisalaan mukana testi tapauksissa oletuskokoonpanoon," . -"linkkejä asiaan liittyvät asiakirjat, rajoituksia ja muita hyödyllisiä tietoja. Yleensä" . -"kaikki merkinnät, jotka ovat yhteisiä lapsen Test Cases. Test Suites seurata" . -"me "kansio" metafora, näin käyttäjät voivat siirtää ja kopioida Test Suites kanssa" . -"Testaus-hankkeeseen. Lisäksi niitä voidaan tuoda maahan tai viedään maasta (mukaan lukien suljettuun testitapauksia).
    4. -
    5. Test sviitit ovat skaalattavat kansioihin. Käyttäjä voi siirtää tai kopioida Test Suites kanssa " . -"Testaus-hankkeeseen. Test sviittiä voidaan tuoda maahan tai viedä maasta (myös testitapauksia). -
    6. Valitse uudesta Test Suite-navigointi puu ja luoda" . -"uusi Test Asia klikkaamalla Luo Test Case. Test Case täsmennetään " . -"erityisesti testausta skenaario ja odotetut tulokset sekä mukautetut kentät määritelty " . -"että Test Project (katso käyttöohjetta lisätietoja). On myös mahdollista " . -"siirtää avainsanat parantaa jäljitettävyyttä.
    7. +
    8. Valitse Test projekti navigointisivun puu (root node). Huomaa: " . + "Voit aina muuttaa aktivoida Test Project valitsemalla eri jokin " . + "alasvetovalikossa yläkulmasta oikeaan alakulmaan.
    9. +
    10. Luo uusi testausohjelmisto klikkaamalla New Child testausohjelmisto. testausohjelmisto voi " . + "saatettava rakenteen testi-asiakirjojen mukaan teidän yleissopimusten (toiminnallinen / ei-toiminnallinen" . + "testit, tuotteen osia tai toimintoja, muuttaa jne.). Kuvaus" . + "testiohjelmisto voisi pitää soveltamisalaan mukana testi tapauksissa oletuskokoonpanoon," . + "linkkejä asiaan liittyvät asiakirjat, rajoituksia ja muita hyödyllisiä tietoja. Yleensä" . + "kaikki merkinnät, jotka ovat yhteisiä lapsen Test Cases. Test Suites seurata" . + "me "kansio" metafora, näin käyttäjät voivat siirtää ja kopioida Test Suites kanssa" . + "Testaus-hankkeeseen. Lisäksi niitä voidaan tuoda maahan tai viedään maasta (mukaan lukien suljettuun testitapauksia).
    11. +
    12. Test sviitit ovat skaalattavat kansioihin. Käyttäjä voi siirtää tai kopioida Test Suites kanssa " . + "Testaus-hankkeeseen. Test sviittiä voidaan tuoda maahan tai viedä maasta (myös testitapauksia). +
    13. Valitse uudesta Test Suite-navigointi puu ja luoda" . + "uusi Test Asia klikkaamalla Luo Test Case. Test Case täsmennetään " . + "erityisesti testausta skenaario ja odotetut tulokset sekä mukautetut kentät määritelty " . + "että Test Project (katso käyttöohjetta lisätietoja). On myös mahdollista " . + "siirtää avainsanat parantaa jäljitettävyyttä.
    14. Navigoi kautta puunäkymässä vasemmalla puolella ja muokata tietoja. Testitapauksia tallentaa oman historian.
    15. Anna teidän luonut testauseritelmä on Test Plan kun testitapauksia ovat valmiita.
    -

    TestLinkillä voit järjestellä testi tapauksissa osaksi testi sviittiä." . -"Test sviittiä voidaan nested muiden koe-sviittiä, joiden avulla voit luoda hierarkioita testityypin sviittiä. Voit tulostaa nämä tiedot yhdessä testin tapauksissa.

    "; - -$TLS_htmltext_title['searchTc'] = "Test Case hakusivu"; +

    TestLinkillä voit järjestellä testi tapauksissa osaksi testi sviittiä." . + "Test sviittiä voidaan nested muiden koe-sviittiä, joiden avulla voit luoda hierarkioita testityypin sviittiä. Voit tulostaa nämä tiedot yhdessä testin tapauksissa.

    "; + +$TLS_htmltext_title['searchTc'] = "Test Case hakusivu"; $TLS_htmltext['searchTc'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not @@ -86,11 +84,11 @@

  • Valitse vaaditaan avainsanan tai vasemmalle arvo 'Ei sovelleta'.
  • Napsauta Hae-painiketta.
  • Kaikki täyttyvät testi tapaukset ovat osoittaneet. Voit muokata testi tapauksissa kautta 'Otsikko'-linkkiä.
  • -";// - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['printTestSpec'] = "Tulosta testauseritelmä"; //printTC.html +"; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['printTestSpec'] = "Tulosta testauseritelmä"; // printTC.html $TLS_htmltext['printTestSpec'] = "

    Tarkoitus:

    Täältä voit tulostaa yhden testin tapauksessa kaikki testin tapauksissa testi sviitti tai kaikki testin tapauksissa testi hanketta tai suunnitelmaa.

    Aloita:

    @@ -105,11 +103,11 @@
  • Käytä selaimen tulosta toiminnot itse tulostaa tiedot.
    Huomaa: Varmista, että vain tulostaa oikean käden kanssa.

  • -";// - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['reqSpecMgmt'] = "Vaatimukset Eritelmä Design"; //printTC.html +"; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['reqSpecMgmt'] = "Vaatimukset Eritelmä Design"; // printTC.html $TLS_htmltext['reqSpecMgmt'] = "

    Voit hallita vaatimustarve määrittely asiakirjoja.

    Requirements Specification

    @@ -122,14 +120,15 @@

    Vaatimukset

    -

    Klikkaa otsikkoa olemassa oleva eritelmä. Jos ei ole," . "klikkaa hankkeen node luoda sellainen. Voit luoda, muokata, poistaa tai maahantuonnin vaatimukset asiakirjan. Jokainen vaatimus on otsikko, laajuus ja tila. A-asema olisi joko 'Normaali' tai 'Epävakaa'. Epävakaa vaatimuksia ei lasketa ja käyttötiedot Tämä parametri olisi käyttää sekä unimplemented ominaisuuksia ja väärin suunnitellut vaatimukset.

    +

    Klikkaa otsikkoa olemassa oleva eritelmä. Jos ei ole," . + "klikkaa hankkeen node luoda sellainen. Voit luoda, muokata, poistaa tai maahantuonnin vaatimukset asiakirjan. Jokainen vaatimus on otsikko, laajuus ja tila. A-asema olisi joko 'Normaali' tai 'Epävakaa'. Epävakaa vaatimuksia ei lasketa ja käyttötiedot Tämä parametri olisi käyttää sekä unimplemented ominaisuuksia ja väärin suunnitellut vaatimukset.

    Voit luoda uuden testin tapauksissa vaatimukset käyttämällä useita toimia tarkastetaan vaatimukset eritelmän näytöllä. Nämä Test Cases luodaan osaksi testausohjelmisto nimi määritelty kokoonpanoasetuksia (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Testausohjelmisto luotu Vaatimus - Auto';). Otsikko ja Soveltamisala kopioidaan nämä testitapauksia.

    ";// - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +'Testausohjelmisto luotu Vaatimus - Auto';)
    . Otsikko ja Soveltamisala kopioidaan nämä testitapauksia.

    "; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; $TLS_htmltext['keywordsAssign'] = "

    Tarkoitus:

    Avainsanatyökalun Tehtävä sivu on paikka, jossa käyttäjät voivat erän antaa avainsanoja nykyisten testausohjelmisto tai Test Case

    @@ -143,10 +142,10 @@

    Tärkeitä tietoja Hakusanat Luokitusprosessin vuonna Test Plans:

    Hakusanalla tehtäviä teet sen eritelmän vain vaikutus testi tapauksissa sinun Test suunnitelmia jos ja vain jos testin suunnitelma sisältää uusimman version Testaus tapauksessa. Muuten, jos testi suunnitelma sisältää vanhoja versioita testin tapauksessa tehtäviä teet nyt ei näy testissä suunnitelma.

    -

    TestLink käyttää tätä lähestymistapaa niin, että vanhemmat versiot testi tapauksissa testi suunnitelmat eivät vaikuta Hakusanalla tehtäviä teet sen viimeisintä versiota testin tapauksessa. Jos haluat testata tapauksissa testi-suunnitelma on päivitetty, ensin vahvistaa ne ovat ajan tasalla käyttämällä 'Päivitä Modified Test Cases' toiminnallisuutta, ennen kuin teet Hakusanalla toimeksiannoissa.

    "; - -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

    Tarkoitus:

    +

    TestLink käyttää tätä lähestymistapaa niin, että vanhemmat versiot testi tapauksissa testi suunnitelmat eivät vaikuta Hakusanalla tehtäviä teet sen viimeisintä versiota testin tapauksessa. Jos haluat testata tapauksissa testi-suunnitelma on päivitetty, ensin vahvistaa ne ovat ajan tasalla käyttämällä 'Päivitä Modified Test Cases' toiminnallisuutta, ennen kuin teet Hakusanalla toimeksiannoissa.

    "; + +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

    Tarkoitus:

    Avulla käyttäjä voi suorittaa testitapauksia. Käyttäjä voi määrittää Testitulos Test Johdanto Build. Katso ohjeesta lisätietoja suodatin ja asetukset. (klikkaa kysymysmerkki-kuvake).

    @@ -159,14 +158,13 @@
  • Täytä testin tapauksessa johtaa ja muussa sovellettavassa muistiinpanoja tai vikoja.
  • Tallenna tulokset.
  • -

    Note: Huom: TestLink on configurated tehdä yhteistyötä teidän Bug tracker jos haluat luoda / jäljittää ongelmaraportti suoraan niiden GUI.

    "; - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['showMetrics'] = "Kuvaus testausselosteet ja Metrics"; -$TLS_htmltext['showMetrics'] = "

    Raportit liittyvät testisuunnittelmaan". -"(määritelty alkuun navigator). Tämä Test Plan voisi poiketa nykyisen testin suunnitelman toteutusta varten. Voit myös valita raportin muodossa:

    +

    Note: Huom: TestLink on configurated tehdä yhteistyötä teidän Bug tracker jos haluat luoda / jäljittää ongelmaraportti suoraan niiden GUI.

    "; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['showMetrics'] = "Kuvaus testausselosteet ja Metrics"; +$TLS_htmltext['showMetrics'] = "

    Raportit liittyvät testisuunnittelmaan" . + "(määritelty alkuun navigator). Tämä Test Plan voisi poiketa nykyisen testin suunnitelman toteutusta varten. Voit myös valita raportin muodossa:

    • Normal - raportti näkyy Web-sivuna
    • OpenOffice Writer - raportti tuodaan OpenOffice Writeriin
    • @@ -242,9 +240,9 @@

      Palkit vuonna palkki kartat ovat värillisiä sellainen, että käyttäjä voi tunnistaa arvioitu määrä kulkea, epäonnistuvat, estetty, ei näytetä tapauksissa.

      Yhteensä Bugs Kunkin Test Case

      -

      Tämä raportti osoittaa kunkin testin tapauksessa kaikki virheraportit arkistoida sitä vastaan koko hankkeeseen. Tämä raportti on käytettävissä vain, jos Vianjäljitysjärjestelmä on kytketty.

      "; - -$TLS_htmltext_title['planAddTC'] = "Lisää / Poista testitapauksia Test Plan"; // testSetAdd +

      Tämä raportti osoittaa kunkin testin tapauksessa kaikki virheraportit arkistoida sitä vastaan koko hankkeeseen. Tämä raportti on käytettävissä vain, jos Vianjäljitysjärjestelmä on kytketty.

      "; + +$TLS_htmltext_title['planAddTC'] = "Lisää / Poista testitapauksia Test Plan"; // testSetAdd $TLS_htmltext['planAddTC'] = "

      Tarkoitus:

      Avulla käyttäjä (ja johtaa tason oikeudet) lisätä tai poistaa testi tapauksissa osaksi Test suunnitelma.

      @@ -252,9 +250,9 @@
      1. Klikkaa testausohjelmisto nähdä kaikki se testi sviittiä ja kaikki sen testin tapauksissa.
      2. Kun olet valmis, klikkaa *Lisää / Poista' Test Cases-painiketta lisätä tai poistaa testin tapauksissa. Huomautus: Ei ole mahdollista lisätä samassa testissä tapauksessa useita kertoja.
      3. -
      "; - -$TLS_htmltext_title['tc_exec_assignment'] = "Anna Tester testata täytäntöönpano"; +"; + +$TLS_htmltext_title['tc_exec_assignment'] = "Anna Tester testata täytäntöönpano"; $TLS_htmltext['tc_exec_assignment'] = "

      Tarkoitus

      Tämän sivun avulla testi johtajia määrittää käyttäjät erityisesti testeistä Testaus suunnitelma.

      @@ -264,12 +262,11 @@
    • Valitse suunniteltua testauslaite.
    • Napsauta Tallenna-painiketta esittämään luokitukseen.
    • Avaa suorittamisen sivu tarkistaa assignment. Voit perustaa suodatin käyttäjille.
    • -";// - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['reqSpecMgmt'] = "Vaatimukset Eritelmä Design"; //printTC.html +"; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['reqSpecMgmt'] = "Vaatimukset Eritelmä Design"; // printTC.html $TLS_htmltext['reqSpecMgmt'] = "

      Voit hallita Requirement Specification asiakirjoja.

      Requirements Specification

      @@ -290,19 +287,19 @@ A-asema olisi joko 'Normaali' tai 'Ei testavissa'. Ei testable vaatimuksia ei lasketa ja käyttötiedot. Tämä parametri olisi käyttää sekä unimplemented ominaisuuksia ja väärin suunnitellut vaatimukset.

      Voit luoda uuden testin tapauksissa vaatimukset käyttämällä useita toimia tarkastetaan vaatimukset eritelmän näytöllä. Nämä Test Cases luodaan osaksi testausohjelmisto nimi määritelty kokoonpanoasetuksia (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Testausohjelmisto luotu Vaatimus - Auto';). Otsikko ja Soveltamisala kopioidaan nämä testitapauksia.

      "; - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; - -$TLS_htmltext['keywordsAssign'] = "

      Purpose:

      +'Testausohjelmisto luotu Vaatimus - Auto';)
      . Otsikko ja Soveltamisala kopioidaan nämä testitapauksia.

      "; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; + +$TLS_htmltext['keywordsAssign'] = "

      Purpose:

      The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

      - +

      To Assign Keywords:

      @@ -324,7 +321,7 @@ - +

      Important Information Regarding Keyword Assignments in Test Plans:

      @@ -344,13 +341,11 @@ test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

      "; - - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['keywordsAssign'] = "Hakusanalla Tehtävä"; +Modified Test Cases' functionality BEFORE making keyword assignments.

      "; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['keywordsAssign'] = "Hakusanalla Tehtävä"; $TLS_htmltext['keywordsAssign'] = "

      Tarkoitus:

      Avainsanatyökalun Tehtävä sivu on paikka, jossa käyttäjät voivat erän antaa avainsanoja nykyisten testausohjelmisto tai Test asia

      @@ -363,9 +358,9 @@

      Tärkeitä tietoja Hakusanat Luokitusprosessin vuonna Test Plans:

      Hakusanalla tehtäviä teet sen eritelmän vain vaikutus testi tapauksissa sinun Test suunnitelmia jos ja vain jos testin suunnitelma sisältää uusimman version Testaus tapauksessa. Muuten, jos testi suunnitelma sisältää vanhoja versioita testin tapauksessa tehtäviä teet nyt ei näy testi suunnitelmassa.

      -

      TestLink käyttää tätä lähestymistapaa niin, että vanhemmat versiot testi tapauksissa testi suunnitelmat eivät vaikuta Hakusanalla tehtäviä teet sen viimeisintä versiota testin tapauksessa.Jos haluat testata tapauksissa testi-suunnitelma on päivitetty, ensin vahvistaa ne ovat ajan tasalla käyttämällä 'Päivitä Modified Test Cases' toiminnallisuutta, ennen kuin teet Hakusanalla toimeksiannoissa.

      "; - -$TLS_htmltext_title['executeTest'] = "Test Asia Suoritusaika"; +

      TestLink käyttää tätä lähestymistapaa niin, että vanhemmat versiot testi tapauksissa testi suunnitelmat eivät vaikuta Hakusanalla tehtäviä teet sen viimeisintä versiota testin tapauksessa.Jos haluat testata tapauksissa testi-suunnitelma on päivitetty, ensin vahvistaa ne ovat ajan tasalla käyttämällä 'Päivitä Modified Test Cases' toiminnallisuutta, ennen kuin teet Hakusanalla toimeksiannoissa.

      "; + +$TLS_htmltext_title['executeTest'] = "Test Asia Suoritusaika"; $TLS_htmltext['executeTest'] = "

      Purpose:

      Avulla käyttäjä voi suorittaa testitapauksia. Käyttäjä voi määrittää Testitulos Test Johdanto Build. Katso ohjeesta lisätietoja suodatin ja asetukset. (klikkaa kysymysmerkki-kuvake).

      @@ -379,12 +374,13 @@
    • Täytä testin tapauksessa johtaa ja muussa sovellettavassa muistiinpanoja tai vikoja.
    • Tallenna tulokset.
    • -

      Huom: TestLink on configurated tehdä yhteistyötä teidän Bug tracker jos haluat luoda / jäljittää ongelmaraportti suoraan niiden GU

      ";// - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['showMetrics'] = "Kuvaus testausselosteet ja mittarit"; -$TLS_htmltext['showMetrics'] = "

      Raportit liittyvät testisuunnitelmaan " ." +

      Huom: TestLink on configurated tehdä yhteistyötä teidän Bug tracker jos haluat luoda / jäljittää ongelmaraportti suoraan niiden GU

      "; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['showMetrics'] = "Kuvaus testausselosteet ja mittarit"; +$TLS_htmltext['showMetrics'] = "

      Raportit liittyvät testisuunnitelmaan " . + " (määritelty alkuun navigator). Tämä Test Plan voisi poiketa nykyisen testin suunnitelman toteutusta varten. Voit myös valita raportin muodossa:

      • Normaalitila - raportti näkyy Web-sivun
      • @@ -463,13 +459,11 @@

        Palkit vuonna palkki kartat ovat värillisiä sellainen, että käyttäjä voi tunnistaa arvioitu määrä kulkea, epäonnistuvat, estetty, ei näytetä tapauksissa.

        Yhteensä Bugs jokaisessa testissä asia

        -

        Tämä raportti osoittaa kunkin testin tapauksessa kaikki virheraportit arkistoida sitä vastaan koko hankkeeseen. Tämä raportti on käytettävissä vain, jos Vianjäljitysjärjestelmä on kytketty.

        "; - - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['planAddTC'] = "Lisää / Poista testitapauksia Testisuunnitelmaan"; //testSetAdd +

        Tämä raportti osoittaa kunkin testin tapauksessa kaikki virheraportit arkistoida sitä vastaan koko hankkeeseen. Tämä raportti on käytettävissä vain, jos Vianjäljitysjärjestelmä on kytketty.

        "; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['planAddTC'] = "Lisää / Poista testitapauksia Testisuunnitelmaan"; // testSetAdd $TLS_htmltext['planAddTC'] = "

        Päämäärä

        Avulla käyttäjä (ja johtaa tason oikeudet) lisätä tai poistaa testi tapauksissa osaksi Test suunnitelma.

        @@ -477,13 +471,11 @@
        1. Klikkaa testausohjelmistoa nähdäksesi kaikki se testi sviittiä ja kaikki sen testitapaukset.
        2. Kun olet valmis, klikkaa 'Lisää / Poista' Test Cases-painiketta lisätä tai poistaa testin tapauksissa. Huomautus: Ei ole mahdollista lisätä samassa testissä tapauksessa useita kertoja.
        3. -
        ";// - - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['tc_exec_assignment'] = "Anna Testaajan testata täytäntöönpano"; +"; // + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['tc_exec_assignment'] = "Anna Testaajan testata täytäntöönpano"; $TLS_htmltext['tc_exec_assignment'] = "

        Päämäärä

        Tämän sivun avulla testi johtajia määrittää käyttäjät erityisesti testeistä Testaus suunnitelma.

        @@ -493,12 +485,11 @@
      • Valitse suunniteltu testaaja.
      • Napsauta Tallenna-painiketta esittämään luokitukseen.
      • Avaa suorittamisen sivu tarkistaa assignment. Voit perustaa suodatin käyttäjille.
      • -"; - -// ------------------------------------------------------------------------------------------ - - -$TLS_htmltext_title['planUpdateTC'] = "Päivitä Testitapaukset, Testisuunnitelmassa"; +"; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['planUpdateTC'] = "Päivitä Testitapaukset, Testisuunnitelmassa"; $TLS_htmltext['planUpdateTC'] = "

        Päämäärä

        Tämän sivun avulla päivittäminen Test tapauksessa uudempaan (eri) versio, jos testauseritelmä on muuttunut. On harvinaista, että joitakin toimintoja on selkeytetty testauksen aikana. . Käyttäjä muuttaa testauseritelmä, mutta muutoksia on propagoivat Test Plan liikaa. Muuten Test suunnitelma omistaa alkuperäinen versio, jotta voitaisiin varmistaa, että tulokset viittaavat oikea teksti testin tapauksessa.

        @@ -508,14 +499,13 @@
      • Valitse uusi versio combo-box-valikosta tietyn Testitapauksessa mukaan.
      • Napsauta Päivitä testisuunnitelma-painiketta esittää muutoksia.
      • Voit tarkistaa: Avaa suorittamisen sivun avulla voit katsella teksti testin tapauksessa.
      • -"; - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; - -$TLS_htmltext['test_urgency'] = "

        Purpose

        +"; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; + +$TLS_htmltext['test_urgency'] = "

        Purpose

        TestLink allows setting the urgency of a Test Suite to affect the testing Priority of test cases. @@ -527,7 +517,7 @@ also under time pressure.

        - +

        Aloita

        @@ -547,14 +537,10 @@ -

        For example, a Test case with a High importance in a Test suite with Low urgency " . - -"will be Medium priority."; - - - -// ------------------------------------------------------------------------------------------ - - - +

        For example, a Test case with a High importance in a Test suite with Low urgency " . + + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/fr_FR/description.php b/locale/fr_FR/description.php index 781899a94e..2f0a465794 100644 --- a/locale/fr_FR/description.php +++ b/locale/fr_FR/description.php @@ -1,50 +1,49 @@ - comment only with "//" except header - * 2. for JS string you must use \\n to get \n for end of line - * - * ******************************************************************************************** - * - **/ - - -// printFilter.html + comment only with "//" except header + * 2. for JS string you must use \\n to get \n for end of line + * + * ******************************************************************************************** + * + **/ + +// printFilter.html $TLS_hlp_generateDocOptions = "

        Options pour un document généré

        -

        Cette table permet à l’utilisateur de filtrer les fiches de test avant leur visualisation. Si elles sont sélectionnées, leurs données sont affichées. Pour modifier les données présentées, cocher ou décocher, cliquer sur Filtre et sélectionner le niveau des données voulues depuis l’arborescence.

        "; - -// testPlan.html +

        Cette table permet à l’utilisateur de filtrer les fiches de test avant leur visualisation. Si elles sont sélectionnées, leurs données sont affichées. Pour modifier les données présentées, cocher ou décocher, cliquer sur Filtre et sélectionner le niveau des données voulues depuis l’arborescence.

        "; + +// testPlan.html $TLS_hlp_testPlan = "

        Campagne de test

        Général

        Une campagne de test est une approche systématique pour tester un système ou un logiciel. Il est possible d’organiser l’activité de test avec des versions du produit, des plateformes pour tracer les résultats.

        Campagne de test

        -

        Cette section permet l'administration des campagnes de test. Administrer les campagnes de test implique la création/modification/suppression de campagnes, l’ajout/modification/suppression de version du produit pour chaque campagne et l’ajout/modification/suppression d'indicateurs d'avancement.

        +

        Cette section permet l'administration des campagnes de test. Administrer les campagnes de test implique la création/modification/suppression de campagnes, l’ajout/modification/suppression de version du produit pour chaque campagne et l’ajout/modification/suppression d'indicateurs d'avancement.

        Contenu de la campagne de test

        -

        Cette section permet la définition du contenu d'une campagne de test. Gérer le contenu d'une campagne de test implique la définition des platesformes utilisées dans la campagne, la définition des fiches de test utilisées dans la campagne, l'assignation éventuelle des fiches de test à des utilisateurs liés à la campagne et la définition de l'urgence des tests. Au cours de la réalisation, les versions de fiches de tests peuvent également être mises à jour si de nouvelles versions de fiches de tests ont été créées.

        +

        Cette section permet la définition du contenu d'une campagne de test. Gérer le contenu d'une campagne de test implique la définition des platesformes utilisées dans la campagne, la définition des fiches de test utilisées dans la campagne, l'assignation éventuelle des fiches de test à des utilisateurs liés à la campagne et la définition de l'urgence des tests. Au cours de la réalisation, les versions de fiches de tests peuvent également être mises à jour si de nouvelles versions de fiches de tests ont été créées.

        Exécution des fiches de test

        -

        Cette section est celle où les utilisateurs peuvent exécuter les fiches de test (écrire des résultats de test) et imprimer les suites de test de la campagne de test. Cette section est où les utilisateurs peuvent tracer les résultats de leur exécution de fiches de test.

        - -

        Remarque: Il est possible que les utilisateurs puissent ne pas voir de liste déroulante avec les campagnes de test. Dans ce cas, tous les liens (sauf ceux actifs pour le test leader) seront indisponibles. Si tel est le cas, veuillez contacter le test leader ou l’administrateur pour vous donner les droits du projet qui convienne ou pour vous créer une campagne de test.

        "; +

        Cette section est celle où les utilisateurs peuvent exécuter les fiches de test (écrire des résultats de test) et imprimer les suites de test de la campagne de test. Cette section est où les utilisateurs peuvent tracer les résultats de leur exécution de fiches de test.

        -// custom_fields.html +

        Remarque: Il est possible que les utilisateurs puissent ne pas voir de liste déroulante avec les campagnes de test. Dans ce cas, tous les liens (sauf ceux actifs pour le test leader) seront indisponibles. Si tel est le cas, veuillez contacter le test leader ou l’administrateur pour vous donner les droits du projet qui convienne ou pour vous créer une campagne de test.

        "; + +// custom_fields.html $TLS_hlp_customFields = "

        Champs personnalisés

        Les points suivants sont des éléments sur l’implémentation des champs personnalisés:

          @@ -76,14 +75,14 @@
        • Activer sur la conception de campagne de test; l’utilisateur peut modifier la valeur pendant la conception de la campagne de test (ajouter des fiches de test à la campagne);
        • Disponible pour; l’utilisateur choisit quelle sorte d’objet est sous le champ.
        -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

        Exécution de fiches de test

        Permet aux utilisateurs d’exécuter les fiches de test. L’exécution en elle-même n’est qu’une assignation à chaque version d'une fiche de test d’un résultat (réussi, en échec, bloqué) pour une version du produit (livraison) donnée.

        -

        L’accès à un système de gestion d’anomalie peut être configuré. L’utilisateur peut alors ajouter directement de nouvelles anomalies et rechercher celles existantes. Voir le manuel d’installation pour d’avantage de détails.

        "; - -//bug_add.html +

        L’accès à un système de gestion d’anomalie peut être configuré. L’utilisateur peut alors ajouter directement de nouvelles anomalies et rechercher celles existantes. Voir le manuel d’installation pour d’avantage de détails.

        "; + +// bug_add.html $TLS_hlp_btsIntegration = "

        Ajout d’anomalie à la fiche de test

        (Seulement si c’est configuré) TestLink a une intégration très simple avec les systèmes de gestion d’anomalies, qui n’est ni capable d’envoyer de requête de création au système, ni récupérer le bug id. L’intégration est faite par des liens aux pages du système de gestion d’anomalie, qui appelle les fonctionnalités suivantes: @@ -91,7 +90,7 @@

      • Insertion d’une nouvelle anomalie;
      • Affichage des informations de l’anomalie.
      -

      +

      Processus d’ajout d’anomalie

      @@ -100,12 +99,12 @@

    • Etape 2: retenir le BUGID assigné par le système;
    • Etape 3: renseigner le champ de Testlink avec le BUGID récupéré;
    • Etape 4: utiliser le bouton d’ajout d’anomalie.
    • -
    + Après fermeture de la fenêtre d’ajout d’anomalie, l’anomalie apparaît dans la page d’exécution. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Propriétés

    Les propriétés permettent de sélectionner la campagne de test, le Build et la plateforme (si disponible) à exécuter.

    @@ -129,45 +128,42 @@

    Il est possible de filtrer les fiches de test par mots-clés qui leurs ont été affectés. Il est possible de choisir plusieurs mots-clés en utilisant CTRL-Clic. Si vous choisissez plus d’un mot-clé, vous pouvez choisir le mode \"And\" ou \"Or\" pour le filtre.

    Filtre de priorité

    -

    Il est possible de filtrer les fiches de test par priorité, \"Criticité de fiches de test\" combiné à \"Urgence de test\" dans la campagne de test courante.

    +

    Il est possible de filtrer les fiches de test par priorité, \"Criticité de fiches de test\" combiné à \"Urgence de test\" dans la campagne de test courante.

    Filtre utilisateur

    Il est possible de filtrer les fiches de test affectées ou non à quelqu’un, et également à un utilisateur spécifique (avec inclusion des fiches non affectés ou non - les filtres avancés sont disponibles).

    Filtre de résultat

    -

    Il est possible de filtrer les fiches de test par résultat(les filtres avancés sont disponibles), sur la version du produit choisi pour l’exécution, sur la dernière exécution, sur tous les versions du produit, n’importe quel version du produit ou sur une version du produit spécifique.

    "; - - -// newest_tcversions.html +

    Il est possible de filtrer les fiches de test par résultat(les filtres avancés sont disponibles), sur la version du produit choisi pour l’exécution, sur la dernière exécution, sur tous les versions du produit, n’importe quel version du produit ou sur une version du produit spécifique.

    "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Dernière version des fiches de test liée

    Toute la série des fiches de test liées à une campagne de test est analysée, et la liste des fiches de test qui ont une nouvelle version disponible est affichée (par rapport aux versions courantes liées à la campagne de test). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Récapitulatif d'exigences


    La fonctionnalité permet de cartographier la couverture des exigences utilisateur ou système par fiche de test.

    Dossier d’exigences

    -

    Les exigences sont regroupées dans des dossiers d’exigences qui sont liés au projet de test.
    TestLink ne supporte pas les versions des dossiers d’exigences et en même temps des exigences: il faut d’abord faire une version d’exigence avec d’effectuer celle du dossier.Titre. Un utilisateur peut ajouter une simple description ou des notes au champ Périmètre.

    +

    Les exigences sont regroupées dans des dossiers d’exigences qui sont liés au projet de test.
    TestLink ne supporte pas les versions des dossiers d’exigences et en même temps des exigences: il faut d’abord faire une version d’exigence avec d’effectuer celle du dossier.Titre. Un utilisateur peut ajouter une simple description ou des notes au champ Périmètre.

    -

    Le comptage surchargé d’exigences sert d’évaluation à la couverture d’exigences dans le cas où toutes les exigences ne sont pas ajoutées (importées). La valeur 0 signifie que le comptage courant d’exigences est utilisé pour les métriques.

    +

    Le comptage surchargé d’exigences sert d’évaluation à la couverture d’exigences dans le cas où toutes les exigences ne sont pas ajoutées (importées). La valeur 0 signifie que le comptage courant d’exigences est utilisé pour les métriques.

    Par exemple: le dossier d’exigences compte 200 exigences mais seulement 50 sont ajoutées dans Testlink. La couverture est de 25% (si toutes les exigences ajoutées sont testées).

    Exigences

    -

    Cliquer sur le titre des dossiers d’exigences créés. il est possible de créer, modifier, supprimer ou importer les exigences du cahier de test. Chaque exigence a un titre, un contexte et un statut. Le statut peut être \"Normal\" ou \"Non testable\". Les exigences non testables ne sont pas comptées dans les métriques. Ce paramètre peut être utilisé pour des fonctionnalités non implémentées et des exigences mal conçues.

    +

    Cliquer sur le titre des dossiers d’exigences créés. il est possible de créer, modifier, supprimer ou importer les exigences du cahier de test. Chaque exigence a un titre, un contexte et un statut. Le statut peut être \"Normal\" ou \"Non testable\". Les exigences non testables ne sont pas comptées dans les métriques. Ce paramètre peut être utilisé pour des fonctionnalités non implémentées et des exigences mal conçues.

    -

    Il est possible de créer de nouvelles fiches de test pour les exigences en utilisant l’action multiple avec les exigences sélectionnées dans l’écran du cahier. Les fiches de test sont créés dans le dossier de test avec le nom défini en configuration (par défaut: $tlCfg->req_cfg->default_testsuite_name = +

    Il est possible de créer de nouvelles fiches de test pour les exigences en utilisant l’action multiple avec les exigences sélectionnées dans l’écran du cahier. Les fiches de test sont créés dans le dossier de test avec le nom défini en configuration (par défaut: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Le titre et le contexte sont copiés dans le cas de test.

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    Couverture:

    Une valeur de \"40% (8/20)\" signifie que 20 fiches de test doivent être créés pour l’exigence pour la tester entièrement, 8 de ces fiches sont déjà créés et liés à l’exigence, ce qui fait une couverture de 40%. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    Liens internes au contexte:

    Les liens internes permettent de créer des liens vers d’autres exigences ou dossiers d’exigences avec une syntaxe spéciale. Le comportement des liens internes peuvent être changé dans le fichier de configuration.

    @@ -182,10 +178,9 @@

    Message de log pour modifications:

    Pour toute modification, Testlink demande un message de log servant à la traçabilité. Si le périmètre de l’exigence a été modifié, vous être libre de choisir de créer ou non une nouvelle révision. Quand toute autre modification est apportée, la création d’une nouvelle révision est obligatoire.

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    Liens directs:

    Pour facilement partager le document avec d’autres personnes, cliquer tout simplement sur l’icône globe en haut du document pour créer un lien direct.

    @@ -197,10 +192,9 @@

    Relations:

    Les relations d’exigence sont utilisées pour modéliser les relations entre les exigences. Les relations personnalisées et l’option pour autoriser les relations entre exigences de différents projets de test peuvent être configurées dans le fichier de configuration. Si vous définissez une relation \"Exigence A est parent de Exigence B\", Testlink définit implicitement la relation \"Exigence B est enfant de Exigence A\".

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    Liens internes dans le contexte:

    Les liens internes permettent de créer des liens vers d’autres exigences/dossiers d’exigences avec une syntaxe spéciale. Le comportement des liens internes peut être modifié dans le fichier de configuration.

    @@ -213,28 +207,25 @@ [req tproj=<tproj_prefix> anchor=<anchor_name>version=<version_number>]req_doc_id[/req]
    Cette syntaxe fonctionne également pour les dossiers d’exigences (l’attribut de version n’a aucun effet).
    Si vous ne voulez pas définir une version, l’exigence avec toutes ses versions est affichée.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Concernant ’Enregistrer les champs personnalisés’

    -Si des champs personnalisés ont été définis et affectés au projet, avec:
    +Si des champs personnalisés ont été définis et affectés au projet, avec:
    ’Afficher sur la conception de campagne de test=true’ et
    ’Activer sur la conception de campagne de test=true’
    Les champs sont visibles sur la page uniquement pour les fiches de test liées à la campagne de test. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "Plus d’informations à propos des testeurs:
    Si vous cliquez sur le nom d’un testeur dans le tableau, un récapitulatif détaillé de toutes les fiches de test affectées à l’utilisateur et sa progression d'avancement sont affichés.

    Remarque:
    Le rapport affiche les fiches de test qui sont affectées à un utilisateur spécifique et qui ont été exécutées pour chaque version du produit active. Même si une fiche de test a été exécutée par un autre utilisateur que l’utilisateur affecté, la fiche de test est affichée comme exécutée pour l’utilisateur affecté. -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/fr_FR/texts.php b/locale/fr_FR/texts.php index dccbc5354f..a5c68f528b 100644 --- a/locale/fr_FR/texts.php +++ b/locale/fr_FR/texts.php @@ -1,39 +1,36 @@ - comment only with "//" except header - * 2. for JS string you must use \\n to get \n for end of line - * - * ******************************************************************************************** - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Erreur applicative"; -$TLS_htmltext['error'] = "

    Une erreur inattendue est survenue. Merci de consulter le moniteur d'événement ou " . - "les fichiers de logs pour plus de détails.

    Nous vous incitons à signaler le problème. Merci d'utiliser notre " . - "gestionnaire d'anomalies.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "Lier les exigences aux fiches de test"; -$TLS_htmltext['assignReqs'] = "

    Objectif :

    + comment only with "//" except header + * 2. for JS string you must use \\n to get \n for end of line + * + * ******************************************************************************************** + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Erreur applicative"; +$TLS_htmltext['error'] = "

    Une erreur inattendue est survenue. Merci de consulter le moniteur d'événement ou " . + "les fichiers de logs pour plus de détails.

    Nous vous incitons à signaler le problème. Merci d'utiliser notre " . + "gestionnaire d'anomalies.

    "; + +$TLS_htmltext_title['assignReqs'] = "Lier les exigences aux fiches de test"; +$TLS_htmltext['assignReqs'] = "

    Objectif :

    Les utilisateurs peuvent créer des relations entre exigences et fiches de test. Un concepteur de test peut -définir des relations 0..n vers 0..n. Par exemple, une fiche de test peut être affectée à une ou plusieurs +définir des relations 0..n vers 0..n. Par exemple, une fiche de test peut être affectée à une ou plusieurs exigences, ou aucune, et inversement. Tout comme la matrice de traçabilité aide à rechercher la couverture des tests d'une exigence et trouver lesquelles ont successivement échoué pendant les tests, l'analyse sert à confirmer que toutes les attentes définies ont été rencontrées.

    @@ -41,60 +38,58 @@
    1. Choisissez une fiche de test dans l'arborescence à gauche. La combo box avec la liste des dossiers d'exigences est affichée en haut de l'espace de travail.
    2. -
    3. Choisissez un dossier d'exigence si plus d'un est défini. +
    4. Choisissez un dossier d'exigence si plus d'un est défini. TestLink recharge la page automatiquement.
    5. Un bloc au milieu de l'espace de travail liste toutes les exigences (des spécifications choisies), qui - sont liées à la fiche de test. Le bloc du dessous 'Exigences disponibles' liste toutes les exigences qui - n'ont pas de relation avec la fiche de test sélectionnée. Un concepteur peut marquer les exigences qui sont - couvertes par cette fiche de test et alors cliquer sur le bouton 'Affecter'. Cette nouvelle fiche de test + sont liées à la fiche de test. Le bloc du dessous 'Exigences disponibles' liste toutes les exigences qui + n'ont pas de relation avec la fiche de test sélectionnée. Un concepteur peut marquer les exigences qui sont + couvertes par cette fiche de test et alors cliquer sur le bouton 'Affecter'. Cette nouvelle fiche de test affectée est affichée dans le bloc du milieu 'Exigences affectées'.

    Attention :

    -Une exigence verrouillée ne peut pas voir sa couverture modifiée. En conséquence, les exigences verrouillées sont listées mais les cases à cocher correspondantes sont désactivées."; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Cahier de test"; -$TLS_htmltext['editTc'] = "

    Objectif :

    -

    La Cahier de Test autorise les utilisateurs à voir et éditer tous les " . - "Dossiers de Test et Fiches de Tests existants. Les fiches de test ont une version " . - " et toutes les versions précédentes sont disponibles et peuvent être vues et gérées ici.

    +Une exigence verrouillée ne peut pas voir sa couverture modifiée. En conséquence, les exigences verrouillées sont listées mais les cases à cocher correspondantes sont désactivées."; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Cahier de test"; +$TLS_htmltext['editTc'] = "

    Objectif :

    +

    La Cahier de Test autorise les utilisateurs à voir et éditer tous les " . + "Dossiers de Test et Fiches de Tests existants. Les fiches de test ont une version " . + " et toutes les versions précédentes sont disponibles et peuvent être vues et gérées ici.

    Pour commencer :

      -
    1. Sélectionner votre projet dans l'arborescence (le noeud racine). Veuillez noter : " . - "Vous pouvez toujours changer le projet actif en sélectionnant un projet différent dans la " . - "liste déroulante dans le coin en haut à droite.
    2. " . - "
    3. Créer un dossier de test en cliquant sur Créer dans Opérations sur les dossiers de tests. " . - "Les dossiers de test peuvent apporter une structure à vos documents de test conformément à vos normes " . - "(tests fonctionnels/non-fonctionnels, composants du produit ou fonctionnalités, requêtes de modifications, etc.). " . - "La description d'un dossier de test peut contenir le contexte des fiches de tests inclus, configuration par défaut," . - "des liens vers les documents utiles, les limitations et autres informations utiles. En général, " . - "toutes les annotations sont communes aux fiches de tests enfants. Les dossiers de test suivent " . - "le 'dossier' métaphore, ses utilisateurs peuvent déplacer ou copier les dossiers de test à l'intérieur " . - "du projet. De plus, ils peuvent les importer ou les exporter (incluant le contenu des fiches de tests).
    4. -
    5. Les dossiers de tests sont des dossiers divisibles. L'utilisateur peut déplacer ou copier les dossiers de tests à l'intérieur " . - "du projet. Les dossiers de tests peuvent être importés ou exportés (incluant les fiches de tests). -
    6. Sélectionnez votre nouveau dossier de test dans l'arborescence et créer une nouvelle fiche de test en " . - "cliquant sur Créer dans Opérations sur les fiches de tests.. Une fiche de test spécifie " . - " une fiche de test particuliere, les résultats attendus et la définition des champs personnalisés " . - "dans le projet (se référer au manuel utilisateur pour plus d'information). Il est également possible " . - "d'affecter des mots clés pour améliorer la traçabilité.
    7. +
    8. Sélectionner votre projet dans l'arborescence (le noeud racine). Veuillez noter : " . + "Vous pouvez toujours changer le projet actif en sélectionnant un projet différent dans la " . + "liste déroulante dans le coin en haut à droite.
    9. " . + "
    10. Créer un dossier de test en cliquant sur Créer dans Opérations sur les dossiers de tests. " . + "Les dossiers de test peuvent apporter une structure à vos documents de test conformément à vos normes " . + "(tests fonctionnels/non-fonctionnels, composants du produit ou fonctionnalités, requêtes de modifications, etc.). " . + "La description d'un dossier de test peut contenir le contexte des fiches de tests inclus, configuration par défaut," . + "des liens vers les documents utiles, les limitations et autres informations utiles. En général, " . + "toutes les annotations sont communes aux fiches de tests enfants. Les dossiers de test suivent " . + "le 'dossier' métaphore, ses utilisateurs peuvent déplacer ou copier les dossiers de test à l'intérieur " . + "du projet. De plus, ils peuvent les importer ou les exporter (incluant le contenu des fiches de tests).
    11. +
    12. Les dossiers de tests sont des dossiers divisibles. L'utilisateur peut déplacer ou copier les dossiers de tests à l'intérieur " . + "du projet. Les dossiers de tests peuvent être importés ou exportés (incluant les fiches de tests). +
    13. Sélectionnez votre nouveau dossier de test dans l'arborescence et créer une nouvelle fiche de test en " . + "cliquant sur Créer dans Opérations sur les fiches de tests.. Une fiche de test spécifie " . + " une fiche de test particuliere, les résultats attendus et la définition des champs personnalisés " . + "dans le projet (se référer au manuel utilisateur pour plus d'information). Il est également possible " . + "d'affecter des mots clés pour améliorer la traçabilité.
    14. Naviguez via l'arborescence sur le côté gauche et éditer les données. Les fiches de tests stockent leur propre historique.
    15. Affectez votre fiche de test créée à la Campagne de test lorsque votre fiche de test est prête.
    -

    Avec TestLink vous pouvez organiser les fiches de tests dans des dossiers de tests." . -"Les dossiers de tests peuvent être imbriqués dans d'autres dossiers de tests. Habituez-vous à créer des hiérarchies de dossiers de tests. - Vous pouvez alors imprimer cette information avec les fiches de tests.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Page de recherche de fiches de test"; -$TLS_htmltext['searchTc'] = "

    Objectif :

    +

    Avec TestLink vous pouvez organiser les fiches de tests dans des dossiers de tests." . + "Les dossiers de tests peuvent être imbriqués dans d'autres dossiers de tests. Habituez-vous à créer des hiérarchies de dossiers de tests. + Vous pouvez alors imprimer cette information avec les fiches de tests.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Page de recherche de fiches de test"; +$TLS_htmltext['searchTc'] = "

    Objectif :

    -

    Navigation selon des mots clés et/ou des phrases. La recherche n'est pas +

    Navigation selon des mots clés et/ou des phrases. La recherche n'est pas sensible à la casse. Le résultat inclut seulement les fiches de tests du projet actuel.

    Pour rechercher :

    @@ -104,13 +99,13 @@
  • Choisir le mot clé requit ou laisser la valeur 'Non appliqué'.
  • Cliquer sur le bouton Rechercher.
  • Toutes les fiches de tests remplissant les conditions sont affichées. Vous pouvez modifier les fiches de test via le lien 'Titre'.
  • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Page de recherche d'exigences"; -$TLS_htmltext['searchReq'] = "

    Objectif :

    +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Page de recherche d'exigences"; +$TLS_htmltext['searchReq'] = "

    Objectif :

    Navigation conformément aux mots-clés et/ou chaînes recherchées. La recherche n'est pas sensible à la casse. Le résultat inclut juste les exigences du projet de test actuel.

    @@ -131,12 +126,12 @@
  • La recherche n'est pas sensible à la casse.
  • Les champs vides sont ignorés.
  • -"; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Page de recherche de dossier d'exigence"; -$TLS_htmltext['searchReqSpec'] = "

    Objectif :

    +"; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Page de recherche de dossier d'exigence"; +$TLS_htmltext['searchReqSpec'] = "

    Objectif :

    Navigation conformément aux mots-clés et/ou chaînes recherchées. La recherche n'est pas sensible à la casse. Le résultat inclut juste les dossiers d'exigences du projet de test actuel.

    @@ -156,35 +151,33 @@
  • Seules les dossiers d'exigences dans le projet courant seront recherchées.
  • >
  • La recherche n'est pas sensible à la casse.
  • Les champs vides sont ignorés.
  • -"; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Imprimer un ensemble de fiches de test"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Objectif :

    +"; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Imprimer un ensemble de fiches de test"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Objectif :

    D'ici vous pouvez imprimer une fiche de test seule, toutes les fiche de tests d'un dossier de tests, ou toutes les fiches de test du projet ou de la campagne de test.

    Commencement :

    1. -

      Sélectionner la partie de la fiche de test que vous voulez afficher, et cliquer sur une fiche de test, +

      Sélectionner la partie de la fiche de test que vous voulez afficher, et cliquer sur une fiche de test, une dossier de tests, ou un projet. Une page imprimable sera affichée.

    2. -
    3. Utilisez la drop-box \"Afficher comme\" dans le cadre de navigation pour spécifier si vous voulez -afficher les informations en HTML, document OpenOffice ou document Microsoft. +

    4. Utilisez la drop-box \"Afficher comme\" dans le cadre de navigation pour spécifier si vous voulez +afficher les informations en HTML, document OpenOffice ou document Microsoft. Voir aide pour plus d'informations.

    5. Utiliser la fonctionnalité d'impression de votre navigateur pour imprimer les informations.
      Note: Faîtes attention à n'imprimer que le cadre à droite.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Conception du dossier d'exigences"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    Vous pouvez gérer le dossier d'exigences.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Conception du dossier d'exigences"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    Vous pouvez gérer le dossier d'exigences.

    Dossier d'exigences

    @@ -209,34 +202,32 @@

    Vous pouvez créer une nouvelle fiche de test pour les exigences en utilisant l'action multiple en sélectionnant les exigences dans l'écran des spécifications. Ces fiches de test sont créés dans le dossier de test avec un nom configuré de la sorte (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Séquence de test créée par exigence - Auto';). Le titre et le périmètre sont copiés dans cette fiche de test.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Imprimer le dossier d'exigences"; //printReq +'Séquence de test créée par exigence - Auto';)
    . Le titre et le périmètre sont copiés dans cette fiche de test.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Imprimer le dossier d'exigences"; // printReq $TLS_htmltext['printReqSpec'] = "

    Objectif :

    Il est possible d'imprimer une seule exigence, toutes les exigences d'un dossier d'exigences, ou toutes les exigences d'un projet.

    Pour commencer :

    1. -

      Sélectionner la partie des exigences que vous voulez afficher, et cliquer sur une exigence, +

      Sélectionner la partie des exigences que vous voulez afficher, et cliquer sur une exigence, un dossier d'exigences, ou un projet. Une page imprimable sera affichée.

    2. -
    3. Utilisez la drop-box \"Afficher comme\" dans le cadre de navigation pour spécifier si vous voulez -afficher les informations en HTML, document OpenOffice ou document Microsoft. +

    4. Utilisez la drop-box \"Afficher comme\" dans le cadre de navigation pour spécifier si vous voulez +afficher les informations en HTML, document OpenOffice ou document Microsoft. Voir aide pour plus d'informations.

    5. Utiliser la fonctionnalité d'impression de votre navigateur pour imprimer les informations.
      Note : Faîtes attention à n'imprimer que le cadre à droite.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Affectation des mots-clés"; -$TLS_htmltext['keywordsAssign'] = "

    Objectif :

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Affectation des mots-clés"; +$TLS_htmltext['keywordsAssign'] = "

    Objectif :

    La page d'affectation des mots-clés est l'endroit où les utilisateurs peuvent affecter par lot les mots clés à un dossier de test ou une fiche de test existante.

    @@ -258,16 +249,15 @@

    TestLink utilise cette approche afin que les anciennes versions des fiches de test dans les campagnes de test ne soient pas impactées par l'affectation des mots-clés faite sur la version la plus récente de la fiche de test. Si vous voulez que vos fiches de tests dans votre campagne de test soient mis à jour, vérifier d'abord que les fiches de tests ont été mis à jour en utilisant la fonctionnalité -'Mise à jour des versions de fiches de test à exécuter ' AVANT de faire l'affectation des mots clés.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Gestion des exécutions"; -$TLS_htmltext['executeTest'] = "

    Objectif :

    +'Mise à jour des versions de fiches de test à exécuter ' AVANT de faire l'affectation des mots clés.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Gestion des exécutions"; +$TLS_htmltext['executeTest'] = "

    Objectif :

    Autorise l'utilisateur à exécuter les fiches de tests. L'utilisateur peut affecter les résultats de test -à des versions de fiche de tests pour la version du produit. Voir l'aide pour plus d'informations à propos des filtres et des actions " . - "(cliquer sur l'icône point d'interrogation).

    +à des versions de fiche de tests pour la version du produit. Voir l'aide pour plus d'informations à propos des filtres et des actions " . + "(cliquer sur l'icône point d'interrogation).

    Pour commencer :

    @@ -276,18 +266,18 @@
  • Sélectionner une version du produit à évaluer dans la liste.
  • Si vous voulez voir que quelques fiches de test à la place de toute l'arborescence, il est possible d'appliquer un filtre. Cliquer sur le bouton \"Appliquer\" - après avoir renseigné les filtres.
  • + après avoir renseigné les filtres.
  • Cliquer sur une fiche de test dans l'arborescence.
  • Remplir le résultat de l'exécution de la fiche de test et toutes notes pertinentes.
  • Sauvegarder les résultats.
  • -

    Remarque : TestLink doit être configuré pour interagir avec votre gestionnaire d'anomalie -si vous voulez créer/tracer un rapport de problème directement depuis la GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description des rapports et métriques de test"; -$TLS_htmltext['showMetrics'] = "

    Les rapports sont reliés à une campagne de test " . - "(définie en haut du navigateur). La campagne de test peut différer de la campagne +

    Remarque : TestLink doit être configuré pour interagir avec votre gestionnaire d'anomalie +si vous voulez créer/tracer un rapport de problème directement depuis la GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description des rapports et métriques de test"; +$TLS_htmltext['showMetrics'] = "

    Les rapports sont reliés à une campagne de test " . + "(définie en haut du navigateur). La campagne de test peut différer de la campagne de test courante pour l'exécution. Vous pouvez aussi sélectionner un format de rapport :

    • Normal - le rapport est affiché en une page web;
    • @@ -300,8 +290,8 @@

      La 'Derniere exécution' d'une fiche de test est un concept utilisé dans plusieurs rapports, et qui est déterminé comme suit :

      • L'ordre dans lequel les versions du produit sont ajoutées à une campagne de test détermine quel version du produit est la plus récente. Les résultats -enregistrés pour la version du produit la plus récente ont préséance sur les résultats liés à des versions du produit plus anciennes. -Par exemple, si vous marquez un test comme 'échoué' dans une version du produit 1, et marqué à 'réussi' dans une version du produit 2, +enregistrés pour la version du produit la plus récente ont préséance sur les résultats liés à des versions du produit plus anciennes. +Par exemple, si vous marquez un test comme 'échoué' dans une version du produit 1, et marqué à 'réussi' dans une version du produit 2, la 'Derniere exécution' sera considérée 'réussi'.
      • Si une fiche de test est exécutée de multiple fois sur la même version du produit, l'exécution la plus récente aura préséance. Par exemple, si la version du produit 3 est affectée à votre équipe et que le testeur 1 enregistre une exécution 'réussi' à 2PM, @@ -325,7 +315,7 @@

        Métriques généraux de la Campagne

        Cette page vous montre seulement le statut le plus à jour d'une campagne de test par version du produit, dossier de test, priorité, mot-clé et indicateurs d'avancement. -Le statut le plus à jour est déterminé par la version du produit la plus récente pour l'exécution de fiche de tests. +Le statut le plus à jour est déterminé par la version du produit la plus récente pour l'exécution de fiche de tests. Si une fiche de test a été exécutée pour de multiples versions du produit, seulement le dernier résultat est pris en compte.

        @@ -337,7 +327,7 @@

        Rapports des cas de test bloqués, échoués et non exécutés

        Ces rapports montrent toutes les fiches de tests actuellement bloquées, échouées ou non exécutées. La 'Derniere exécution' - est de nouveau employée pour déterminer si une fiche de test peut être considérée bloquée, échouée ou non exécutée. Les rapports sur les + est de nouveau employée pour déterminer si une fiche de test peut être considérée bloquée, échouée ou non exécutée. Les rapports sur les fiches de test bloquées et échouées affichent les anomalies associées si l'utilisateur utilise un gestionnaire d'anomalies intégré.

        Matrice de résultats de test

        @@ -357,12 +347,11 @@

        Matrice des anomalies par fiche de test

        Ce rapport montre, pour chaque fiche de test, toutes les anomalies liées, pour la totalité du projet. -Ce rapport est disponible seulement si un système de gestion des anomalies est connecté.

        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Ajouter/Retirer fiches de test"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

        Objectif :

        +Ce rapport est disponible seulement si un système de gestion des anomalies est connecté.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Ajouter/Retirer fiches de test"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

        Objectif :

        Permet à l'utilisateur d'ajouter ou de supprimer des fiches de test dans la campagne de test.

        Pour ajouter ou supprimer des fiches de tests :

        @@ -371,11 +360,11 @@
      • Cocher les fiches de test à ajouter/supprimer.
      • Lorsque c'est fait, cliquez sur le bouton 'ajouter/retirer la sélection' pour ajouter ou supprimer les fiches de tests. Remarque : Ce n'est pas possible d'ajouter le même cas de test plusieurs fois.
      • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assignation d'exécution de fiches de test"; -$TLS_htmltext['tc_exec_assignment'] = "

        Objectif

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assignation d'exécution de fiches de test"; +$TLS_htmltext['tc_exec_assignment'] = "

        Objectif

        Cette page autorise le test leader à affecter l'exécution des fiches de tests à des utilisateurs dans la campagne de test.

        Pour commencer :

        @@ -384,15 +373,15 @@
      • Sélectionner un ou plusieurs testeurs.
      • Cliquez sur le bouton 'Enregistrer' pour enregistrer l'affectation.
      • Cliquez sur 'Envoyer les assignations par email aux testeurs' pour notifier les utilisateurs des affectations réalisées.
      • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Mise à jour des versions de fiches de test à exécuter"; -$TLS_htmltext['planUpdateTC'] = "

        Objectif

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Mise à jour des versions de fiches de test à exécuter"; +$TLS_htmltext['planUpdateTC'] = "

        Objectif

        Cette page autorise la mise à jour d'une fiche de test vers une nouvelle (différente) version si une exigence -de test est changée. Cela arrive souvent lorsque certaines fonctionnalités sont clarifiées pendant la phase de test." . - " L'utilisateur modifie le cahier de test, mais les changements doivent être propagés à la campagne de test réalisée. Autrement la campagne" . - " de test détient la version erronée pour être sûr que les résultats renvoient au bon texte d'une fiche de test.

        +de test est changée. Cela arrive souvent lorsque certaines fonctionnalités sont clarifiées pendant la phase de test." . + " L'utilisateur modifie le cahier de test, mais les changements doivent être propagés à la campagne de test réalisée. Autrement la campagne" . + " de test détient la version erronée pour être sûr que les résultats renvoient au bon texte d'une fiche de test.

        Pour commencer :

          @@ -400,14 +389,13 @@
        1. Choisissez une nouvelle version dans le menu à choix multiples pour chque fiche de test à mettre à jour.
        2. Cliquez sur le bouton 'mettre à jour la campagne de test' pour soumettre les changements.
        3. Pour vérifier : Ouvrez la page d'exécution pour voir le texte de la fiche de test.
        4. -
        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Définition de l'urgence de test"; -$TLS_htmltext['test_urgency'] = "

        Objectif

        -

        TestLink autorise à changer l'urgence des tests pour modifier la priorité de chaque fiche de tests. - La priorité d'un test dépend de la criticité de la fiche de test et de l'urgence définie dans +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Définition de l'urgence de test"; +$TLS_htmltext['test_urgency'] = "

        Objectif

        +

        TestLink autorise à changer l'urgence des tests pour modifier la priorité de chaque fiche de tests. + La priorité d'un test dépend de la criticité de la fiche de test et de l'urgence définie dans la campagne de test. Le test leader peut spécifier un ensemble de fiches de tests qui peuvent être testées prioritairement. Cela aide à s'assurer que les tests les plus importants sont réalisés malgré une contrainte de temps.

        @@ -421,10 +409,9 @@ des changements significatifs.
      • Cliquez sur le bouton 'Définir l'urgence pour les fiches de test' pour soumettre les changements.
      • -

        Par exemple, une fiche de test avec une haute criticité dans une suite de tests avec une urgence basse " . - "sera de priorité moyenne."; - - -// ------------------------------------------------------------------------------------------ - +

        Par exemple, une fiche de test avec une haute criticité dans une suite de tests avec une urgence basse " . + "sera de priorité moyenne."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/id_ID/description.php b/locale/id_ID/description.php index 1d02aa6909..0c7742eb68 100644 --- a/locale/id_ID/description.php +++ b/locale/id_ID/description.php @@ -1,31 +1,31 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

        Options for a generated document

        This table allows the user to filter test cases before they are viewed. If @@ -33,8 +33,8 @@ presented, check or uncheck, click on Filter, and select the desired data level from the tree.

        -

        Document Header: Users can filter out Document Header information. -Document Header information includes: Introduction, Scope, References, +

        Document Header: Users can filter out Document Header information. +Document Header information includes: Introduction, Scope, References, Test Methodology, and Test Limitations.

        Test Case Body: Users can filter out Test Case Body information. Test Case Body information @@ -49,35 +49,35 @@

        Table of Content: TestLink inserts list of all titles with internal hypertext links if checked.

        -

        Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component -in second case.

        "; - -// testPlan.html +

        Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component +in second case.

        "; + +// testPlan.html $TLS_hlp_testPlan = "

        Test Plan

        General

        -

        A test plan is a systematic approach to testing a system such as software. You can organize testing activity with +

        A test plan is a systematic approach to testing a system such as software. You can organize testing activity with particular builds of product in time and trace results.

        Test Execution

        -

        This section is where users can execute test cases (write test results) and -print Test case suite of the Test Plan. This section is where users can track -the results of their test case execution.

        +

        This section is where users can execute test cases (write test results) and +print Test case suite of the Test Plan. This section is where users can track +the results of their test case execution.

        Test Plan Management

        -

        This section, which is only lead accessible, allows users to administrate test plans. -Administering test plans involves creating/editing/deleting plans, -adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can +

        This section, which is only lead accessible, allows users to administrate test plans. +Administering test plans involves creating/editing/deleting plans, +adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can see which plan.
        -Users with lead permissions may also set the priority/risk and ownership of -Test case suites (categories) and create testing milestones.

        - -

        Note: It is possible that users may not see a dropdown containing any Test plans. -In this situation all links (except lead enabled ones) will be unlinked. If you -are in this situation you must contact a lead or admin to grant you the proper -project rights or create a Test Plan for you.

        "; - -// custom_fields.html +Users with lead permissions may also set the priority/risk and ownership of +Test case suites (categories) and create testing milestones.

        + +

        Note: It is possible that users may not see a dropdown containing any Test plans. +In this situation all links (except lead enabled ones) will be unlinked. If you +are in this situation you must contact a lead or admin to grant you the proper +project rights or create a Test Plan for you.

        "; + +// custom_fields.html $TLS_hlp_customFields = "

        Custom Fields

        Following are some facts about the implementation of custom fields:

          @@ -96,7 +96,7 @@
        • Caption variable name (eg: This is the value that is supplied to lang_get() API , or displayed as-is if not found in language file).
        • Custom field type (string, numeric, float, enum, email)
        • -
        • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list +
        • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list and combo types.
          Use the pipe ('|') character to separate possible values for an enumeration. One of the possible values @@ -116,16 +116,16 @@
        • Enable on test plan design. User can change the value during Test Plan design (add test cases to test plan)
        • Available for. User choose to what kind of item the field belows.
        -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

        Executing Test Cases

        Allows users to 'execute' test cases. Execution itself is merely assigning a test case a result (pass,fail,blocked) against a selected build.

        Access to a bug tracking system could be configured. User can directly add a new bugs -and browse exesting ones then.

        "; - -//bug_add.html +and browse exesting ones then.

        "; + +// bug_add.html $TLS_hlp_btsIntegration = "

        Add Bugs to Test Case

        (only if it is configured) TestLink has a very simple integration with Bug Tracking Systems (BTS), @@ -135,7 +135,7 @@

      • Insert new bug.
      • Display existent bug info.
      -

      +

      Process to add a bug

      @@ -144,111 +144,108 @@

    • Step 2: write down the BUGID assigned by BTS.
    • Step 3: write BUGID on the input field.
    • Step 4: use add bug button.
    • -
    + After closing the add bug page, you will see relevant bug data on the execute page. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Setup Filter and Build for test execution

    -

    The left pane consists from navigator through test cases assigned to the current " . -"Test plan and table with settings and filter. These filters allows the user " . -"to refine offered set of test cases before they are executed." . -"Setup your filter, press the \"Apply\" button and select appropriate Test Case " . -"from tree menu.

    +

    The left pane consists from navigator through test cases assigned to the current " . + "Test plan and table with settings and filter. These filters allows the user " . + "to refine offered set of test cases before they are executed." . + "Setup your filter, press the \"Apply\" button and select appropriate Test Case " . + "from tree menu.

    Build

    -

    Users must choose a build that will be connected with a test result. " . -"Builds are the basic component for the current Test Plan. Each test case " . -"may be run more times per build. However the last results is count only. +

    Users must choose a build that will be connected with a test result. " . + "Builds are the basic component for the current Test Plan. Each test case " . + "may be run more times per build. However the last results is count only.
    Builds can be created by leads using the Create New Build page.

    Test Case ID filter

    -

    Users can filter test cases by unique identifier. This ID is created automatically -during create time. Empty box means that the filter doesn't apply.

    +

    Users can filter test cases by unique identifier. This ID is created automatically +during create time. Empty box means that the filter doesn't apply.

    Priority filter

    -

    Users can filter test cases by test priority. Each test case importance is combined" . -"with test urgency within the current Test plan. For example 'HIGH' priority test case " . -"is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

    +

    Users can filter test cases by test priority. Each test case importance is combined" . + "with test urgency within the current Test plan. For example 'HIGH' priority test case " . + "is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

    Result filter

    -

    Users can filter test cases by results. Results are what happened to that test -case during a particular build. Test cases can pass, fail, be blocked, or not be run." . -"This filter is disabled by default.

    +

    Users can filter test cases by results. Results are what happened to that test +case during a particular build. Test cases can pass, fail, be blocked, or not be run." . + "This filter is disabled by default.

    User filter

    -

    Users can filter test cases by their assignee. The check-box allows to include also " . -"\"unassigned\" tests into the resulted set in addtion.

    "; -/* -

    Most Current Result

    -

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted -by the build that is chosen from the dropdown box. In this state the tree will display -the test cases status. -
    Example: User selects build 2 from the dropdown box and doesn't check the 'most -current' checkbox. All test cases will be shown with their status from build 2. -So, if test case 1 passed in build 2 it will be colored green. -
    If the user decideds to check the 'most current' checkbox the tree will be -colored by the test cases most recent result. -
    Ex: User selects build 2 from the dropdown box and this time checks -the 'most current' checkbox. All test cases will be shown with most current -status. So, if test case 1 passed in build 3, even though the user has also selected -build 2, it will be colored green.

    - */ - - -// newest_tcversions.html +

    Users can filter test cases by their assignee. The check-box allows to include also " . + "\"unassigned\" tests into the resulted set in addtion.

    "; +/* + *

    Most Current Result

    + *

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted + * by the build that is chosen from the dropdown box. In this state the tree will display + * the test cases status. + *
    Example: User selects build 2 from the dropdown box and doesn't check the 'most + * current' checkbox. All test cases will be shown with their status from build 2. + * So, if test case 1 passed in build 2 it will be colored green. + *
    If the user decideds to check the 'most current' checkbox the tree will be + * colored by the test cases most recent result. + *
    Ex: User selects build 2 from the dropdown box and this time checks + * the 'most current' checkbox. All test cases will be shown with most current + * status. So, if test case 1 passed in build 3, even though the user has also selected + * build 2, it will be colored green.

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Newest versions of linked Test Cases

    The whole set of Test Cases linked to Test Plan is analyzed, and a list of Test Cases which have a newest version is displayed (against the current set of the Test Plan). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Requirements Coverage


    This feature allows to map a coverage of user or system requirements by test cases. Navigate via link \"Requirement Specification\" in main screen.

    Requirements Specification

    -

    Requirements are grouped by 'Requirements Specification' document which is related to -Test Project.
    TestLink doesn't support versions for both Requirements Specification -and Requirements itself. So, version of document should be added after +

    Requirements are grouped by 'Requirements Specification' document which is related to +Test Project.
    TestLink doesn't support versions for both Requirements Specification +and Requirements itself. So, version of document should be added after a Specification Title. -An user can add simple description or notes to Scope field.

    +An user can add simple description or notes to Scope field.

    -

    Overwritten count of REQs serves for -evaluation Req. coverage in case that not all requirements are added (imported) in. -The value 0 means that current count of requirements is used for metrics.

    -

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test +

    Overwritten count of REQs serves for +evaluation Req. coverage in case that not all requirements are added (imported) in. +The value 0 means that current count of requirements is used for metrics.

    +

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test coverage is 25% (if all these added requirements will be tested).

    Requirements

    Click on title of a created Requirements Specification. You can create, edit, delete or import requirements for the document. Each requirement has title, scope and status. Status should be \"Normal\" or \"Not testable\". Not testable requirements are not counted -to metrics. This parameter should be used for both unimplemented features and -wrong designed requirements.

    +to metrics. This parameter should be used for both unimplemented features and +wrong designed requirements.

    -

    You can create new test cases for requirements by using multi action with checked +

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite -with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = +with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Title and Scope are copied to these Test cases.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Regarding 'Save Custom Fields'

    -If you have defined and assigned to Test Project,
    +If you have defined and assigned to Test Project,
    Custom Fields with:
    'Display on test plan design=true' and
    'Enable on test plan design=true'
    you will see these in this page ONLY for Test Cases linked to Test Plan. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/id_ID/texts.php b/locale/id_ID/texts.php index 01300cc05c..a2d326fded 100644 --- a/locale/id_ID/texts.php +++ b/locale/id_ID/texts.php @@ -1,33 +1,31 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ - - -$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; -$TLS_htmltext['assignReqs'] = "

    Purpose:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ +$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; +$TLS_htmltext['assignReqs'] = "

    Purpose:

    Users can set relations between requirements and test cases. A test designer could define relations 0..n to 0..n. I.e. One test case could be assigned to none, one or more requirements and vice versa. Such traceability matrix helps to investigate test coverage @@ -38,7 +36,7 @@

    1. Choose an Test Case in tree at the left. The combo box with list of Requirements Specifications is shown at the top of workarea.
    2. -
    3. Choose a Requirements Specification Document if more once defined. +
    4. Choose a Requirements Specification Document if more once defined. TestLink automatically reload the page.
    5. A middle block of workarea lists all requirements (from choosen Specification), which are connected with the test case. Bottom block 'Available Requirements' lists all @@ -46,50 +44,48 @@ to the current test case. A designer could mark requirements which are covered by this test case and then click the button 'Assign'. These new assigned test case are shown in the middle block 'Assigned Requirements'.
    6. -
    "; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Test Specification"; -$TLS_htmltext['editTc'] = "

    Purpose:

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Test Specification"; +$TLS_htmltext['editTc'] = "

    Purpose:

    Purpose:

    -

    The Test Specification allows users to view and edit all of the existing " . - "Test Suites and Test Cases. Test Cases are versioned and all " . - "of the previous versions are available and can be viewed and managed here.

    +

    The Test Specification allows users to view and edit all of the existing " . + "Test Suites and Test Cases. Test Cases are versioned and all " . + "of the previous versions are available and can be viewed and managed here.

    Getting Started:

      -
    1. Select your Test Project in the navigation tree (the root node). Please note: " . - "You can always change the activate Test Project by selecting a different one from the " . - "drop-down list in the top-right corner.
    2. -
    3. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . - "bring structure to your test documents according to your conventions (functional/non-functional " . - "tests, product components or features, change requests, etc.). The description of " . - "a Test Suite could hold the scope of the included test cases, default configuration, " . - "links to relevant documents, limitations and other useful information. In general, " . - "all annotations that are common to the Child Test Cases. Test Suites follow " . - "the "folder" metaphor, thus users can move and copy Test Suites within " . - "the Test project. Also, they can be imported or exported (including the contained Test cases).
    4. -
    5. Test suites are scalable folders. User can move or copy Test Suites within " . - "the Test project. Test suites could be imported or exported (include Test cases). -
    6. Select your newly created Test Suite in the navigation tree and create " . - "a new Test Case by clicking on Create Test Case. A Test Case specifies " . - "a particular testing scenario, expected results and custom fields defined " . - "in the Test Project (refer to the user manual for more information). It is also possible " . - "to assign keywords for improved traceability.
    7. +
    8. Select your Test Project in the navigation tree (the root node). Please note: " . + "You can always change the activate Test Project by selecting a different one from the " . + "drop-down list in the top-right corner.
    9. +
    10. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . + "bring structure to your test documents according to your conventions (functional/non-functional " . + "tests, product components or features, change requests, etc.). The description of " . + "a Test Suite could hold the scope of the included test cases, default configuration, " . + "links to relevant documents, limitations and other useful information. In general, " . + "all annotations that are common to the Child Test Cases. Test Suites follow " . + "the "folder" metaphor, thus users can move and copy Test Suites within " . + "the Test project. Also, they can be imported or exported (including the contained Test cases).
    11. +
    12. Test suites are scalable folders. User can move or copy Test Suites within " . + "the Test project. Test suites could be imported or exported (include Test cases). +
    13. Select your newly created Test Suite in the navigation tree and create " . + "a new Test Case by clicking on Create Test Case. A Test Case specifies " . + "a particular testing scenario, expected results and custom fields defined " . + "in the Test Project (refer to the user manual for more information). It is also possible " . + "to assign keywords for improved traceability.
    14. Navigate via the tree view on the left side and edit data. Test cases stores own history.
    15. Assign your created Test Specification to Test Plan when your Test cases are ready.
    -

    With TestLink you organize test cases into test suites." . -"Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. - You can then print this information together with the test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; -$TLS_htmltext['searchTc'] = "

    Purpose:

    +

    With TestLink you organize test cases into test suites." . + "Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. + You can then print this information together with the test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; +$TLS_htmltext['searchTc'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result include just test cases from actual Test Project.

    @@ -101,12 +97,11 @@
  • Choose required keyword or left value 'Not applied'.
  • Click the Search button.
  • All fulfilled test cases are shown. You can modify test cases via 'Title' link.
  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Purpose:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Purpose:

    From here you can print a single test case, all the test cases within a test suite, or all the test cases in a test project or plan.

    Get Started:

    @@ -121,12 +116,11 @@
  • Use your browser's print functionality to actually print the information.
    Note: Make sure to only print the right-hand frame.

  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    Requirements Specification

    @@ -154,12 +148,11 @@

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite with name defined in configuration (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Title and Scope are copied to these Test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; -$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    +'Test suite created by Requirement - Auto';)
    . Title and Scope are copied to these Test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

    @@ -183,16 +176,15 @@

    TestLink uses this approach so that older versions of test cases in test plans are not effected by keyword assignments you make to the most recent version of the test case. If you want your test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

    Purpose:

    +Modified Test Cases' functionality BEFORE making keyword assignments.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

    Purpose:

    Allows user to execute Test cases. User can assign Test result -to Test Case for Build. See help for more information about filter and settings " . - "(click on the question mark icon).

    +to Test Case for Build. See help for more information about filter and settings " . + "(click on the question mark icon).

    Get started:

    @@ -203,13 +195,13 @@
  • Fill out the test case result and any applicable notes or bugs.
  • Save results.
  • -

    Note: TestLink must be configurated to collaborate with your Bug tracker -if you would like to create/trace a problem report directly from the GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; -$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . - "(defined in top of navigator). This Test Plan could differs from the +

    Note: TestLink must be configurated to collaborate with your Bug tracker +if you would like to create/trace a problem report directly from the GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; +$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . + "(defined in top of navigator). This Test Plan could differs from the current Test Plan for execution. You can also select Report format:

    • Normal - report is displayed in web page
    • @@ -326,12 +318,11 @@

      Total Bugs For Each Test Case

      This report shows each test case with all of the bugs filed against it for the entire project. -This report is only available if a Bug Tracking System is connected.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Purpose:

      +This report is only available if a Bug Tracking System is connected.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Purpose:

      Allows user (with lead level permissions) to add or remove test cases into a Test plan.

      To add or remove Test cases:

      @@ -339,11 +330,11 @@
    • Click on a test suite to see all of its test suites and all of its test cases.
    • When you are done click the 'Add / Remove Test Cases' button to add or remove the test cases. Note: Is not possible to add the same test case multiple times.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; -$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; +$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      This page allows test leaders to assign users to particular tests within the Test Plan.

      Get Started

      @@ -352,16 +343,15 @@
    • Select a planned tester.
    • Press button to submit assignement.
    • Open execution page to verify assignment. You can set-up a filter for users.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; -$TLS_htmltext['planUpdateTC'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; +$TLS_htmltext['planUpdateTC'] = "

      Purpose

      This page allows update Test case to a newer (different) version in the case that Test -Specification is changed. It often happens that some functionality is clarified during testing." . - " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . - " plan holds original version to be sure, that results refer to the correct text of a Test case.

      +Specification is changed. It often happens that some functionality is clarified during testing." . + " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . + " plan holds original version to be sure, that results refer to the correct text of a Test case.

      Get Started

        @@ -369,14 +359,13 @@
      1. Choose a new version from bombo boxmenu for particular Test case.
      2. Press button 'Update Test plan' to submit changes.
      3. To verify: Open execution page to view text of the test case(s).
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; -$TLS_htmltext['test_urgency'] = "

      Purpose

      -

      TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. - Test priority depends on both Importance of Test cases and Urgency defined in +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; +$TLS_htmltext['test_urgency'] = "

      Purpose

      +

      TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. + Test priority depends on both Importance of Test cases and Urgency defined in the Test Plan. Test leader should specify a set of test cases that could be tested at first. It helps to assure that testing will cover the most important tests also under time pressure.

      @@ -390,10 +379,9 @@ significant changes.
    • Press the button 'Save' to submit changes.
    • -

      For example, a Test case with a High importance in a Test suite with Low urgency " . - "will be Medium priority."; - - -// ------------------------------------------------------------------------------------------ - +

      For example, a Test case with a High importance in a Test suite with Low urgency " . + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/it_IT/description.php b/locale/it_IT/description.php index db462dd05f..3dc1e3dee2 100644 --- a/locale/it_IT/description.php +++ b/locale/it_IT/description.php @@ -1,31 +1,31 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

      Options for a generated document

      This table allows the user to filter test cases before they are viewed. If @@ -33,8 +33,8 @@ presented, check or uncheck, click on Filter, and select the desired data level from the tree.

      -

      Document Header: Users can filter out Document Header information. -Document Header information includes: Introduction, Scope, References, +

      Document Header: Users can filter out Document Header information. +Document Header information includes: Introduction, Scope, References, Test Methodology, and Test Limitations.

      Test Case Body: Users can filter out Test Case Body information. Test Case Body information @@ -49,35 +49,35 @@

      Table of Content: TestLink inserts list of all titles with internal hypertext links if checked.

      -

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component -in second case.

      "; - -// testPlan.html +

      Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component +in second case.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Test Plan

      General

      -

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with +

      A test plan is a systematic approach to testing a system such as software. You can organize testing activity with particular builds of product in time and trace results.

      Test Execution

      -

      This section is where users can execute test cases (write test results) and -print Test case suite of the Test Plan. This section is where users can track -the results of their test case execution.

      +

      This section is where users can execute test cases (write test results) and +print Test case suite of the Test Plan. This section is where users can track +the results of their test case execution.

      Test Plan Management

      -

      This section, which is only lead accessible, allows users to administrate test plans. -Administering test plans involves creating/editing/deleting plans, -adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can +

      This section, which is only lead accessible, allows users to administrate test plans. +Administering test plans involves creating/editing/deleting plans, +adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can see which plan.
      -Users with lead permissions may also set the priority/risk and ownership of -Test case suites (categories) and create testing milestones.

      - -

      Note: It is possible that users may not see a dropdown containing any Test plans. -In this situation all links (except lead enabled ones) will be unlinked. If you -are in this situation you must contact a lead or admin to grant you the proper -project rights or create a Test Plan for you.

      "; - -// custom_fields.html +Users with lead permissions may also set the priority/risk and ownership of +Test case suites (categories) and create testing milestones.

      + +

      Note: It is possible that users may not see a dropdown containing any Test plans. +In this situation all links (except lead enabled ones) will be unlinked. If you +are in this situation you must contact a lead or admin to grant you the proper +project rights or create a Test Plan for you.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Custom Fields

      Following are some facts about the implementation of custom fields:

        @@ -96,7 +96,7 @@
      • Caption variable name (eg: This is the value that is supplied to lang_get() API , or displayed as-is if not found in language file).
      • Custom field type (string, numeric, float, enum, email)
      • -
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list +
      • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list and combo types.
        Use the pipe ('|') character to separate possible values for an enumeration. One of the possible values @@ -116,16 +116,16 @@
      • Enable on test plan design. User can change the value during Test Plan design (add test cases to test plan)
      • Available for. User choose to what kind of item the field belows.
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      Executing Test Cases

      Allows users to 'execute' test cases. Execution itself is merely assigning a test case a result (pass,fail,blocked) against a selected build.

      Access to a bug tracking system could be configured. User can directly add a new bugs -and browse exesting ones then.

      "; - -//bug_add.html +and browse exesting ones then.

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      Add Bugs to Test Case

      (only if it is configured) TestLink has a very simple integration with Bug Tracking Systems (BTS), @@ -135,7 +135,7 @@

    • Insert new bug.
    • Display existent bug info.
    -

    +

    Process to add a bug

    @@ -144,111 +144,108 @@

  • Step 2: write down the BUGID assigned by BTS.
  • Step 3: write BUGID on the input field.
  • Step 4: use add bug button.
  • - + After closing the add bug page, you will see relevant bug data on the execute page. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    Setup Filter and Build for test execution

    -

    The left pane consists from navigator through test cases assigned to the current " . -"Test plan and table with settings and filter. These filters allows the user " . -"to refine offered set of test cases before they are executed." . -"Setup your filter, press the \"Apply\" button and select appropriate Test Case " . -"from tree menu.

    +

    The left pane consists from navigator through test cases assigned to the current " . + "Test plan and table with settings and filter. These filters allows the user " . + "to refine offered set of test cases before they are executed." . + "Setup your filter, press the \"Apply\" button and select appropriate Test Case " . + "from tree menu.

    Build

    -

    Users must choose a build that will be connected with a test result. " . -"Builds are the basic component for the current Test Plan. Each test case " . -"may be run more times per build. However the last results is count only. +

    Users must choose a build that will be connected with a test result. " . + "Builds are the basic component for the current Test Plan. Each test case " . + "may be run more times per build. However the last results is count only.
    Builds can be created by leads using the Create New Build page.

    Test Case ID filter

    -

    Users can filter test cases by unique identifier. This ID is created automatically -during create time. Empty box means that the filter doesn't apply.

    +

    Users can filter test cases by unique identifier. This ID is created automatically +during create time. Empty box means that the filter doesn't apply.

    Priority filter

    -

    Users can filter test cases by test priority. Each test case importance is combined" . -"with test urgency within the current Test plan. For example 'HIGH' priority test case " . -"is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

    +

    Users can filter test cases by test priority. Each test case importance is combined" . + "with test urgency within the current Test plan. For example 'HIGH' priority test case " . + "is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

    Result filter

    -

    Users can filter test cases by results. Results are what happened to that test -case during a particular build. Test cases can pass, fail, be blocked, or not be run." . -"This filter is disabled by default.

    +

    Users can filter test cases by results. Results are what happened to that test +case during a particular build. Test cases can pass, fail, be blocked, or not be run." . + "This filter is disabled by default.

    User filter

    -

    Users can filter test cases by their assignee. The check-box allows to include also " . -"\"unassigned\" tests into the resulted set in addtion.

    "; -/* -

    Most Current Result

    -

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted -by the build that is chosen from the dropdown box. In this state the tree will display -the test cases status. -
    Example: User selects build 2 from the dropdown box and doesn't check the 'most -current' checkbox. All test cases will be shown with their status from build 2. -So, if test case 1 passed in build 2 it will be colored green. -
    If the user decideds to check the 'most current' checkbox the tree will be -colored by the test cases most recent result. -
    Ex: User selects build 2 from the dropdown box and this time checks -the 'most current' checkbox. All test cases will be shown with most current -status. So, if test case 1 passed in build 3, even though the user has also selected -build 2, it will be colored green.

    - */ - - -// newest_tcversions.html +

    Users can filter test cases by their assignee. The check-box allows to include also " . + "\"unassigned\" tests into the resulted set in addtion.

    "; +/* + *

    Most Current Result

    + *

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted + * by the build that is chosen from the dropdown box. In this state the tree will display + * the test cases status. + *
    Example: User selects build 2 from the dropdown box and doesn't check the 'most + * current' checkbox. All test cases will be shown with their status from build 2. + * So, if test case 1 passed in build 2 it will be colored green. + *
    If the user decideds to check the 'most current' checkbox the tree will be + * colored by the test cases most recent result. + *
    Ex: User selects build 2 from the dropdown box and this time checks + * the 'most current' checkbox. All test cases will be shown with most current + * status. So, if test case 1 passed in build 3, even though the user has also selected + * build 2, it will be colored green.

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    Newest versions of linked Test Cases

    The whole set of Test Cases linked to Test Plan is analyzed, and a list of Test Cases which have a newest version is displayed (against the current set of the Test Plan). -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    Requirements Coverage


    This feature allows to map a coverage of user or system requirements by test cases. Navigate via link \"Requirement Specification\" in main screen.

    Requirements Specification

    -

    Requirements are grouped by 'Requirements Specification' document which is related to -Test Project.
    TestLink doesn't support versions for both Requirements Specification -and Requirements itself. So, version of document should be added after +

    Requirements are grouped by 'Requirements Specification' document which is related to +Test Project.
    TestLink doesn't support versions for both Requirements Specification +and Requirements itself. So, version of document should be added after a Specification Title. -An user can add simple description or notes to Scope field.

    +An user can add simple description or notes to Scope field.

    -

    Overwritten count of REQs serves for -evaluation Req. coverage in case that not all requirements are added (imported) in. -The value 0 means that current count of requirements is used for metrics.

    -

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test +

    Overwritten count of REQs serves for +evaluation Req. coverage in case that not all requirements are added (imported) in. +The value 0 means that current count of requirements is used for metrics.

    +

    E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test coverage is 25% (if all these added requirements will be tested).

    Requirements

    Click on title of a created Requirements Specification. You can create, edit, delete or import requirements for the document. Each requirement has title, scope and status. Status should be \"Normal\" or \"Not testable\". Not testable requirements are not counted -to metrics. This parameter should be used for both unimplemented features and -wrong designed requirements.

    +to metrics. This parameter should be used for both unimplemented features and +wrong designed requirements.

    -

    You can create new test cases for requirements by using multi action with checked +

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite -with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = +with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Title and Scope are copied to these Test cases.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    Regarding 'Save Custom Fields'

    -If you have defined and assigned to Test Project,
    +If you have defined and assigned to Test Project,
    Custom Fields with:
    'Display on test plan design=true' and
    'Enable on test plan design=true'
    you will see these in this page ONLY for Test Cases linked to Test Plan. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/it_IT/texts.php b/locale/it_IT/texts.php index 26954f7be3..c7fdeece80 100644 --- a/locale/it_IT/texts.php +++ b/locale/it_IT/texts.php @@ -1,33 +1,31 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ - - -$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; -$TLS_htmltext['assignReqs'] = "

    Purpose:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ +$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; +$TLS_htmltext['assignReqs'] = "

    Purpose:

    Users can set relations between requirements and test cases. A designer could define relations 0..n to 0..n. I.e. One test case could be assigned to none, one or more test cases and vice versa. Such traceability matrix helps to investigate test coverage @@ -38,7 +36,7 @@

    1. Choose an Test Case in tree at the left. The combo box with list of Requirements Specifications is shown at the top of workarea.
    2. -
    3. Choose a Requirements Specification Document if more once defined. +
    4. Choose a Requirements Specification Document if more once defined. TestLink automatically reload the page.
    5. A middle block of workarea lists all requirements (from choosen Specification), which are connected with the test case. Bottom block 'Available Requirements' lists all @@ -46,50 +44,48 @@ to the current test case. A designer could mark requirements which are covered by this test case and then click the button 'Assign'. These new assigned test case are shown in the middle block 'Assigned Requirements'.
    6. -
    "; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Test Specification"; -$TLS_htmltext['editTc'] = "

    Purpose:

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Test Specification"; +$TLS_htmltext['editTc'] = "

    Purpose:

    Purpose:

    -

    The Test Specification allows users to view and edit all of the existing " . - "Test Suites and Test Cases. Test Cases are versioned and all " . - "of the previous versions are available and can be viewed and managed here.

    +

    The Test Specification allows users to view and edit all of the existing " . + "Test Suites and Test Cases. Test Cases are versioned and all " . + "of the previous versions are available and can be viewed and managed here.

    Getting Started:

      -
    1. Select your Test Project in the navigation tree (the root node). Please note: " . - "You can always change the activate Test Project by selecting a different one from the " . - "drop-down list in the top-right corner.
    2. -
    3. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . - "bring structure to your test documents according to your conventions (functional/non-functional " . - "tests, product components or features, change requests, etc.). The description of " . - "a Test Suite could hold the scope of the included test cases, default configuration, " . - "links to relevant documents, limitations and other useful information. In general, " . - "all annotations that are common to the Child Test Cases. Test Suites follow " . - "the "folder" metaphor, thus users can move and copy Test Suites within " . - "the Test project. Also, they can be imported or exported (including the contained Test cases).
    4. -
    5. Test suites are scalable folders. User can move or copy Test Suites within " . - "the Test project. Test suites could be imported or exported (include Test cases). -
    6. Select your newly created Test Suite in the navigation tree and create " . - "a new Test Case by clicking on Create Test Case. A Test Case specifies " . - "a particular testing scenario, expected results and custom fields defined " . - "in the Test Project (refer to the user manual for more information). It is also possible " . - "to assign keywords for improved traceability.
    7. +
    8. Select your Test Project in the navigation tree (the root node). Please note: " . + "You can always change the activate Test Project by selecting a different one from the " . + "drop-down list in the top-right corner.
    9. +
    10. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . + "bring structure to your test documents according to your conventions (functional/non-functional " . + "tests, product components or features, change requests, etc.). The description of " . + "a Test Suite could hold the scope of the included test cases, default configuration, " . + "links to relevant documents, limitations and other useful information. In general, " . + "all annotations that are common to the Child Test Cases. Test Suites follow " . + "the "folder" metaphor, thus users can move and copy Test Suites within " . + "the Test project. Also, they can be imported or exported (including the contained Test cases).
    11. +
    12. Test suites are scalable folders. User can move or copy Test Suites within " . + "the Test project. Test suites could be imported or exported (include Test cases). +
    13. Select your newly created Test Suite in the navigation tree and create " . + "a new Test Case by clicking on Create Test Case. A Test Case specifies " . + "a particular testing scenario, expected results and custom fields defined " . + "in the Test Project (refer to the user manual for more information). It is also possible " . + "to assign keywords for improved traceability.
    14. Navigate via the tree view on the left side and edit data. Test cases stores own history.
    15. Assign your created Test Specification to Test Plan when your Test cases are ready.
    -

    With TestLink you organize test cases into test suites." . -"Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. - You can then print this information together with the test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; -$TLS_htmltext['searchTc'] = "

    Purpose:

    +

    With TestLink you organize test cases into test suites." . + "Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. + You can then print this information together with the test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; +$TLS_htmltext['searchTc'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result include just test cases from actual Test Project.

    @@ -101,12 +97,11 @@
  • Choose required keyword or left value 'Not applied'.
  • Click the Search button.
  • All fulfilled test cases are shown. You can modify test cases via 'Title' link.
  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    Purpose:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    Purpose:

    From here you can print a single test case, all the test cases within a test suite, or all the test cases in a test project or plan.

    Get Started:

    @@ -121,12 +116,11 @@
  • Use your browser's print functionality to actually print the information.
    Note: Make sure to only print the right-hand frame.

  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    You can manage Requirement Specification documents.

    Requirements Specification

    @@ -154,12 +148,11 @@

    You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite with name defined in configuration (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Title and Scope are copied to these Test cases.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; -$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    +'Test suite created by Requirement - Auto';)
    . Title and Scope are copied to these Test cases.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +$TLS_htmltext['keywordsAssign'] = "

    Purpose:

    The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

    @@ -183,16 +176,15 @@

    TestLink uses this approach so that older versions of test cases in test plans are not effected by keyword assignments you make to the most recent version of the test case. If you want your test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

    Purpose:

    +Modified Test Cases' functionality BEFORE making keyword assignments.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

    Purpose:

    Allows user to execute Test cases. User can assign Test result -to Test Case for Build. See help for more information about filter and settings " . - "(click on the question mark icon).

    +to Test Case for Build. See help for more information about filter and settings " . + "(click on the question mark icon).

    Get started:

    @@ -203,13 +195,13 @@
  • Fill out the test case result and any applicable notes or bugs.
  • Save results.
  • -

    Note: TestLink must be configurated to collaborate with your Bug tracker -if you would like to create/trace a problem report directly from the GUI.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; -$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . - "(defined in top of navigator). This Test Plan could differs from the +

    Note: TestLink must be configurated to collaborate with your Bug tracker +if you would like to create/trace a problem report directly from the GUI.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; +$TLS_htmltext['showMetrics'] = "

    Reports are related to a Test Plan " . + "(defined in top of navigator). This Test Plan could differs from the current Test Plan for execution. You can also select Report format:

    • Normal - report is displayed in web page
    • @@ -326,12 +318,11 @@

      Total Bugs For Each Test Case

      This report shows each test case with all of the bugs filed against it for the entire project. -This report is only available if a Bug Tracking System is connected.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      Purpose:

      +This report is only available if a Bug Tracking System is connected.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      Purpose:

      Allows user (with lead level permissions) to add or remove test cases into a Test plan.

      To add or remove Test cases:

      @@ -339,11 +330,11 @@
    • Click on a test suite to see all of its test suites and all of its test cases.
    • When you are done click the 'Add / Remove Test Cases' button to add or remove the test cases. Note: Is not possible to add the same test case multiple times.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; -$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; +$TLS_htmltext['tc_exec_assignment'] = "

      Purpose

      This page allows test leaders to assign users to particular tests within the Test Plan.

      Get Started

      @@ -352,16 +343,15 @@
    • Select a planned tester.
    • Press button to submit assignement.
    • Open execution page to verify assignment. You can set-up a filter for users.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; -$TLS_htmltext['planUpdateTC'] = "

      Purpose

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; +$TLS_htmltext['planUpdateTC'] = "

      Purpose

      This page allows update Test case to a newer (different) version in the case that Test -Specification is changed. It often happens that some functionality is clarified during testing." . - " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . - " plan holds original version to be sure, that results refer to the correct text of a Test case.

      +Specification is changed. It often happens that some functionality is clarified during testing." . + " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . + " plan holds original version to be sure, that results refer to the correct text of a Test case.

      Get Started

        @@ -369,14 +359,13 @@
      1. Choose a new version from bombo boxmenu for particular Test case.
      2. Press button 'Update Test plan' to submit changes.
      3. To verify: Open execution page to view text of the test case(s).
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; -$TLS_htmltext['test_urgency'] = "

      Purpose

      -

      TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. - Test priority depends on both Importance of Test cases and Urgency defined in +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; +$TLS_htmltext['test_urgency'] = "

      Purpose

      +

      TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. + Test priority depends on both Importance of Test cases and Urgency defined in the Test Plan. Test leader should specify a set of test cases that could be tested at first. It helps to assure that testing will cover the most important tests also under time pressure.

      @@ -390,10 +379,9 @@ significant changes.
    • Press the button 'Save' to submit changes.
    • -

      For example, a Test case with a High importance in a Test suite with Low urgency " . - "will be Medium priority."; - - -// ------------------------------------------------------------------------------------------ - +

      For example, a Test case with a High importance in a Test suite with Low urgency " . + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/ja_JP/description.php b/locale/ja_JP/description.php index a93e030dde..74696d5c0b 100644 --- a/locale/ja_JP/description.php +++ b/locale/ja_JP/description.php @@ -1,54 +1,54 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - *------------------------------------------------------------------- - * Japanese translation - *------------------------------------------------------------------- - * Testing Engineer's Forum (TEF) in Japan - * Working Group of TestLink Japanese Translation Project - * - * http://blues.se.uec.ac.jp/swtest/ - * http://testlinkjp.org/ - * http://sourceforge.jp/projects/testlinkjp/ - * - * Adviser: - * Yasuharu NISHI - * - * Core member: - * Atsushi Nagata, AZMA Daisuke, Hiromi Nishiyama, - * Kaname Mochizuki, Kaoru Nakamura, Kunio Murakami, - * Lumina Nishihara, Marino Suda, Masahide Katsumata, - * Masami Ichikawa, Masataka Yoneta, Sadahiko Hantani, - * Shinichi Sugiyama, Shinsuke Matsuki, Shizuka Ban, - * Takahiro Wada, Toshinori Sawaguchi, Toshiyuki Kawanishi, - * Yasuhiko Okada, Yoichi Kunihiro, Yoshihiro Yoshimura, - * Yukiko Kajino - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + *------------------------------------------------------------------- + * Japanese translation + *------------------------------------------------------------------- + * Testing Engineer's Forum (TEF) in Japan + * Working Group of TestLink Japanese Translation Project + * + * http://blues.se.uec.ac.jp/swtest/ + * http://testlinkjp.org/ + * http://sourceforge.jp/projects/testlinkjp/ + * + * Adviser: + * Yasuharu NISHI + * + * Core member: + * Atsushi Nagata, AZMA Daisuke, Hiromi Nishiyama, + * Kaname Mochizuki, Kaoru Nakamura, Kunio Murakami, + * Lumina Nishihara, Marino Suda, Masahide Katsumata, + * Masami Ichikawa, Masataka Yoneta, Sadahiko Hantani, + * Shinichi Sugiyama, Shinsuke Matsuki, Shizuka Ban, + * Takahiro Wada, Toshinori Sawaguchi, Toshiyuki Kawanishi, + * Yasuhiko Okada, Yoichi Kunihiro, Yoshihiro Yoshimura, + * Yukiko Kajino + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

      テストケースå°åˆ·ã®ã‚ªãƒ—ション

      ã“ã®è¡¨ã«ã‚ˆã‚Šè¡¨ç¤ºã™ã‚‹ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’フィルタリングã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ @@ -75,9 +75,9 @@

      目次: TestLinkã¯å…¨ã¦ã®ã‚¿ã‚¤ãƒˆãƒ«ã®ãƒªã‚¹ãƒˆã‚’内部ã®ãƒã‚¤ãƒ‘ーリンク付ãã§æŒ¿å…¥ã—ã¾ã™ã€‚

      出力形å¼: HTMLã¨MS Wordã®ï¼’種類ã®å½¢å¼ã§å‡ºåŠ›ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ -後者ã®å ´åˆã€ãƒ–ラウザãŒMS Wordã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’自動ã§èª­ã¿è¾¼ã¿ã€ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’表示ã—ã¾ã™ã€‚

      "; - -// testPlan.html +後者ã®å ´åˆã€ãƒ–ラウザãŒMS Wordã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’自動ã§èª­ã¿è¾¼ã¿ã€ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’表示ã—ã¾ã™ã€‚

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      テスト計画

      一般

      @@ -99,9 +99,9 @@

      注æ„: テスト計画ã®ãƒ‰ãƒ­ãƒƒãƒ—ダウンã«ãƒ†ã‚¹ãƒˆè¨ˆç”»ãŒè¡¨ç¤ºã•れãªã„å ´åˆã‚‚ã‚りã¾ã™ã€‚ ã“ã®ã‚ˆã†ãªçжæ³ã§ã¯ã€ã™ã¹ã¦ã®ãƒªãƒ³ã‚¯ã‚’使用ã™ã‚‹ã“ã¨ãŒã§ããªã„ã§ã—ょã†ã€‚ テストリーダもã—ãã¯ç®¡ç†è€…ã«é€£çµ¡ã‚’å–ã‚Šã€æ¨©é™ã‚’アサインã—ã¦ã‚‚らã†ã‹ -æ–°ãŸãªãƒ†ã‚¹ãƒˆè¨ˆç”»ã‚’作æˆã—ã¦ã‚‚らã†ã‚ˆã†ã«ã—ã¦ãã ã•ã„。

      "; - -// custom_fields.html +æ–°ãŸãªãƒ†ã‚¹ãƒˆè¨ˆç”»ã‚’作æˆã—ã¦ã‚‚らã†ã‚ˆã†ã«ã—ã¦ãã ã•ã„。

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      カスタムフィールド

      カスタムフィールドã¯ä»¥ä¸‹ã®ã‚ˆã†ã«å®Ÿè£…ã•れã¦ã„ã¾ã™:

        @@ -145,16 +145,16 @@
      • カスタムフィールドãŒã©ã‚“ãªé …ç›®ã«å±žã—ã¦ã„ã‚‹ã‹ã‚’é¸æŠžã™ã‚‹ã“ã¨ãŒå¯èƒ½ã§ã™ã€‚
      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

      テストケースã®å®Ÿè¡Œ

      ユーザã«ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ã€Œå®Ÿè¡Œã€ã‚’許å¯ã—ã¾ã™ã€‚実行自体ã¯å˜ã«ãƒ“ルドã«å¯¾ã™ã‚‹çµæžœ (æˆåŠŸ,失敗,ブロック)をテストケースã«å‰²ã‚Šå½“ã¦ã¦ã„ã¾ã™ã€‚

      ãƒã‚°ç®¡ç†ã‚·ã‚¹ãƒ†ãƒ ã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã‚ˆã†ã«è¨­å®šã™ã‚‹ã“ã¨ã‚‚å¯èƒ½ã§ã™ã€‚ -ãã®å ´åˆã¯ã€ãƒã‚°ã®ç™»éŒ²ã‚„ã€æ—¢å­˜ãƒã‚°ã®é–²è¦§ãªã©ã‚’ãŠã“ãªã†ã“ã¨ãŒã§ãã¾ã™ã€‚

      "; - -//bug_add.html +ãã®å ´åˆã¯ã€ãƒã‚°ã®ç™»éŒ²ã‚„ã€æ—¢å­˜ãƒã‚°ã®é–²è¦§ãªã©ã‚’ãŠã“ãªã†ã“ã¨ãŒã§ãã¾ã™ã€‚

      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

      テストケースã¨ãƒã‚°ã‚’関連付ã‘ã‚‹

      設定を行ã£ãŸå ´åˆ TestLinkã¯ãƒã‚°ç®¡ç†ã‚·ã‚¹ãƒ†ãƒ (BTS)ã¨ã‚¹ãƒ ãƒ¼ã‚ºã«é€£æºã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
      @@ -176,21 +176,19 @@

    ãƒã‚°è¿½åŠ ãƒšãƒ¼ã‚¸ã‚’é–‰ã˜ãŸå¾Œã€å•題ã¨ãªã£ã¦ã„ã‚‹ãƒã‚°ã®ãƒ‡ãƒ¼ã‚¿ã‚’テスト実行ページã‹ã‚‰ç¢ºã‹ã‚ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    テスト実行時ã®ãƒ“ルドã«ã‚ˆã‚‹ãƒ•ィルタリング

    -

    å·¦å´ã®ã‚·ãƒ¼ãƒˆã¯ã€ç¾åœ¨ã®ãƒ†ã‚¹ãƒˆè¨ˆç”»ã«ã‚¢ã‚µã‚¤ãƒ³ã•れã¦ã„るテストケースã®ãƒŠãƒ“ゲータã€ãŠã‚ˆã³ã€" . -"設定ã¨ãƒ•ィルターã®ä¸€è¦§è¡¨ã§æ§‹æˆã•れã¦ã„ã¾ã™ã€‚" . -"ã“ã®ãƒ•ィルターを使用ã™ã‚‹ã“ã¨ã§ãƒ†ã‚¹ãƒˆå®Ÿè¡Œå‰ã«ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’絞り込むã“ã¨ãŒã§ãã¾ã™ã€‚" . -"フィルターã®ã‚ªãƒ–ションを設定ã—「é©ç”¨ã€ãƒœã‚¿ãƒ³ã‚’クリックã—ãŸå¾Œã«ã€" . -"ツリーã‹ã‚‰ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’é¸æŠžã—ã¾ã™ã€‚

    +

    å·¦å´ã®ã‚·ãƒ¼ãƒˆã¯ã€ç¾åœ¨ã®ãƒ†ã‚¹ãƒˆè¨ˆç”»ã«ã‚¢ã‚µã‚¤ãƒ³ã•れã¦ã„るテストケースã®ãƒŠãƒ“ゲータã€ãŠã‚ˆã³ã€" . "設定ã¨ãƒ•ィルターã®ä¸€è¦§è¡¨ã§æ§‹æˆã•れã¦ã„ã¾ã™ã€‚" . + "ã“ã®ãƒ•ィルターを使用ã™ã‚‹ã“ã¨ã§ãƒ†ã‚¹ãƒˆå®Ÿè¡Œå‰ã«ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’絞り込むã“ã¨ãŒã§ãã¾ã™ã€‚" . + "フィルターã®ã‚ªãƒ–ションを設定ã—「é©ç”¨ã€ãƒœã‚¿ãƒ³ã‚’クリックã—ãŸå¾Œã«ã€" . + "ツリーã‹ã‚‰ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’é¸æŠžã—ã¾ã™ã€‚

    ビルドã«ã‚ˆã‚‹ãƒ•ィルター

    -

    ビルドã”ã¨ã«ãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚" . -"テストケースã®è¨˜éŒ²ã‚’追ã†ãŸã‚ã®æœ€ã‚‚基本的ãªè¦ç´ ãŒãƒ“ルドã§ã™ã€‚" . -"å„テストケースã¯ã€ãƒ“ルド内ã§è¤‡æ•°å›žå®Ÿè¡Œã§ãã¾ã™ãŒæœ€çµ‚çµæžœã¨ã—ã¦ç™»éŒ²ã•れるã®ã¯1ã¤ã®ã¿ã§ã™ã€‚ +

    ビルドã”ã¨ã«ãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚" . "テストケースã®è¨˜éŒ²ã‚’追ã†ãŸã‚ã®æœ€ã‚‚基本的ãªè¦ç´ ãŒãƒ“ルドã§ã™ã€‚" . + "å„テストケースã¯ã€ãƒ“ルド内ã§è¤‡æ•°å›žå®Ÿè¡Œã§ãã¾ã™ãŒæœ€çµ‚çµæžœã¨ã—ã¦ç™»éŒ²ã•れるã®ã¯1ã¤ã®ã¿ã§ã™ã€‚
    æ–°è¦ãƒ“ルドã®ä½œæˆã®ãƒšãƒ¼ã‚¸ã§æ–°è¦ãƒ“ルドを作æˆã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    テストケースã®IDã«ã‚ˆã‚‹ãƒ•ィルター

    @@ -198,42 +196,40 @@ ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ä½œæˆæ™‚ã«è‡ªå‹•ã§ç”Ÿæˆã•れã¾ã™ã€‚ã“ã®æ¬„を空欄ã«ã™ã‚‹ã¨ãƒ•ィルターãŒç„¡åйã«ãªã‚Šã¾ã™ã€‚

    優先度ã«ã‚ˆã‚‹ãƒ•ィルター

    -

    優先度ã«ã‚ˆã‚Šãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚å„テストケースã«ã¯é‡è¦åº¦ãŒã€" . -"テスト計画ã«ã¯ç·Šæ€¥åº¦ãŒè¨­å®šã•れã€å„ªå…ˆåº¦ãŒè¨ˆç®—ã•れã¾ã™ã€‚例ãˆã°ã€å„ªå…ˆåº¦ã€Œé«˜ã€ã®ãƒ•ィルターã§ã¯ã€" . -"é‡è¦åº¦ã‚‚ã—ãã¯ç·Šæ€¥åº¦ãŒã€Œé«˜ã€ã§ã€ã‚‚ã†ä¸€æ–¹ãŒã€Œä¸­ã€ä»¥ä¸Šã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚

    +

    優先度ã«ã‚ˆã‚Šãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚å„テストケースã«ã¯é‡è¦åº¦ãŒã€" . + "テスト計画ã«ã¯ç·Šæ€¥åº¦ãŒè¨­å®šã•れã€å„ªå…ˆåº¦ãŒè¨ˆç®—ã•れã¾ã™ã€‚例ãˆã°ã€å„ªå…ˆåº¦ã€Œé«˜ã€ã®ãƒ•ィルターã§ã¯ã€" . + "é‡è¦åº¦ã‚‚ã—ãã¯ç·Šæ€¥åº¦ãŒã€Œé«˜ã€ã§ã€ã‚‚ã†ä¸€æ–¹ãŒã€Œä¸­ã€ä»¥ä¸Šã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚

    çµæžœã«ã‚ˆã‚‹ãƒ•ィルター

    テストã®çµæžœã”ã¨ã«ãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚ ãƒ†ã‚¹ãƒˆçµæžœã¯ã€ã‚るビルドã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®å®Ÿè¡Œä¸­ã«ä½•ãŒã‚ã£ãŸã‹ã‚’表ã—ã¦ã„ã¾ã™ã€‚ -テストケースã®å®Ÿè¡Œã®çµæžœã¨ã—ã¦ã€æˆåŠŸã€å¤±æ•—ã€ãƒ–ãƒ­ãƒƒã‚¯ã€æœªå®Ÿè¡Œã®ã„ãšã‚Œã‹ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã€‚" . -"ã“ã®ãƒ•ィルターã¯ãƒ‡ãƒ•ォルトã§ã¯ç„¡åйã«ãªã£ã¦ã„ã¾ã™ã€‚

    +テストケースã®å®Ÿè¡Œã®çµæžœã¨ã—ã¦ã€æˆåŠŸã€å¤±æ•—ã€ãƒ–ãƒ­ãƒƒã‚¯ã€æœªå®Ÿè¡Œã®ã„ãšã‚Œã‹ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãŒä¸Žãˆã‚‰ã‚Œã¾ã™ã€‚" . + "ã“ã®ãƒ•ィルターã¯ãƒ‡ãƒ•ォルトã§ã¯ç„¡åйã«ãªã£ã¦ã„ã¾ã™ã€‚

    テスト担当者ã«ã‚ˆã‚‹ãƒ•ィルター

    -

    アサイン計画ã«å¾“ã£ã¦ãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ã¾ãŸã€ã€Œæœªã‚¢ã‚µã‚¤ãƒ³ã‚’å«ã‚€ã€ã®" . -"ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã«ã‚ˆã‚Šã€ã‚¢ã‚µã‚¤ãƒ³ã•れã¦ã„ãªã„テストケースを表示ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    "; -/* -

    最新ã®çµæžœ

    -

    デフォルトã€ã¾ãŸã¯ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ãŒã‚ªãƒ•ã®å ´åˆã€ãƒ„リー㯠-ドロップダウンボックスã‹ã‚‰é¸æŠžã•れãŸãƒ“ルドã«ã‚ˆã£ã¦ã‚½ãƒ¼ãƒˆã•れã¾ã™ã€‚ -ã“ã®çŠ¶æ…‹ã§ã¯ã€ãƒ„リーã«ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãŒè¡¨ç¤ºã•れã¾ã™ã€‚ -
    例: ユーザーãŒã€ãƒ‰ãƒ­ãƒƒãƒ—ダウンボックスã‹ã‚‰ãƒ“ルド2ã‚’é¸æŠžã—ã€ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’ -オフã«ã—ã¾ã™ã€‚ビルド2ã‹ã‚‰ã™ã¹ã¦ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ãŒã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã¨ã¨ã‚‚ã«è¡¨ç¤ºã•れã¾ã™ã€‚ -ã—ãŸãŒã£ã¦ã€ãƒ“ルド2ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹1ãŒãƒ‘スã™ã‚‹ã¨ç·‘色ã«ãªã‚Šã¾ã™ã€‚ -
    ユーザãŒã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’オンã«ã—ãŸå ´åˆã€ -ãƒ„ãƒªãƒ¼ã¯æœ€æ–°ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®çµæžœã§è‰²ãŒæ±ºã¾ã‚Šã¾ã™ã€‚ -
    例: ユーザーãŒãƒ‰ãƒ­ãƒƒãƒ—ダウンボックスã‹ã‚‰ãƒ“ルド2ã‚’é¸æŠžã—ã€ä»Šå›žã¯ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚ -ã™ã¹ã¦ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯æœ€æ–°ã®çŠ¶æ…‹ã§è¡¨ç¤ºã•れã¾ã™ã€‚ ã—ãŸãŒã£ã¦ã€ãƒ“ルド3ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹1ãŒãƒ‘スã—ãŸå ´åˆã€ -ユーザーãŒãƒ“ルド2ã‚‚é¸æŠžã—ã¦ã„ã¦ã‚‚ã€ç·‘色ã«ãªã‚Šã¾ã™ã€‚

    - */ - - -// newest_tcversions.html +

    アサイン計画ã«å¾“ã£ã¦ãƒ•ィルターをã‹ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ã¾ãŸã€ã€Œæœªã‚¢ã‚µã‚¤ãƒ³ã‚’å«ã‚€ã€ã®" . + "ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã«ã‚ˆã‚Šã€ã‚¢ã‚µã‚¤ãƒ³ã•れã¦ã„ãªã„テストケースを表示ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    "; +/* + *

    最新ã®çµæžœ

    + *

    デフォルトã€ã¾ãŸã¯ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ãŒã‚ªãƒ•ã®å ´åˆã€ãƒ„リー㯠+ * ドロップダウンボックスã‹ã‚‰é¸æŠžã•れãŸãƒ“ルドã«ã‚ˆã£ã¦ã‚½ãƒ¼ãƒˆã•れã¾ã™ã€‚ + * ã“ã®çŠ¶æ…‹ã§ã¯ã€ãƒ„リーã«ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ãŒè¡¨ç¤ºã•れã¾ã™ã€‚ + *
    例: ユーザーãŒã€ãƒ‰ãƒ­ãƒƒãƒ—ダウンボックスã‹ã‚‰ãƒ“ルド2ã‚’é¸æŠžã—ã€ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’ + * オフã«ã—ã¾ã™ã€‚ビルド2ã‹ã‚‰ã™ã¹ã¦ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ãŒã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã¨ã¨ã‚‚ã«è¡¨ç¤ºã•れã¾ã™ã€‚ + * ã—ãŸãŒã£ã¦ã€ãƒ“ルド2ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹1ãŒãƒ‘スã™ã‚‹ã¨ç·‘色ã«ãªã‚Šã¾ã™ã€‚ + *
    ユーザãŒã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’オンã«ã—ãŸå ´åˆã€ + * ãƒ„ãƒªãƒ¼ã¯æœ€æ–°ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®çµæžœã§è‰²ãŒæ±ºã¾ã‚Šã¾ã™ã€‚ + *
    例: ユーザーãŒãƒ‰ãƒ­ãƒƒãƒ—ダウンボックスã‹ã‚‰ãƒ“ルド2ã‚’é¸æŠžã—ã€ä»Šå›žã¯ã€Œæœ€æ–°ã€ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã‚’ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚ + * ã™ã¹ã¦ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯æœ€æ–°ã®çŠ¶æ…‹ã§è¡¨ç¤ºã•れã¾ã™ã€‚ ã—ãŸãŒã£ã¦ã€ãƒ“ルド3ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹1ãŒãƒ‘スã—ãŸå ´åˆã€ + * ユーザーãŒãƒ“ルド2ã‚‚é¸æŠžã—ã¦ã„ã¦ã‚‚ã€ç·‘色ã«ãªã‚Šã¾ã™ã€‚

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’関連ã¥ã‘ã‚‹

    テスト計画ã«é–¢é€£ã¥ã‘られãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹å…¨ä½“ã¯åˆ†æžã•ã‚Œã€æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ä¸€è¦§ãŒè¡¨ç¤ºã•れã¾ã™ã€‚ -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    è¦ä»¶ç¶²ç¾…率


    ã“ã®æ©Ÿèƒ½ã‚’用ã„ã‚‹ã¨ã€ãƒ¦ãƒ¼ã‚¶ã¾ãŸã¯ã‚·ã‚¹ãƒ†ãƒ ãŒè¦æ±‚ã™ã‚‹ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ç¶²ç¾…率ã®ãƒžãƒƒãƒ—を作æˆã§ãã¾ã™ã€‚ @@ -266,17 +262,16 @@ (デフォルトã§ã¯ \$tlCfg->req_cfg->default_testsuite_name = 'Test suite created by Requirement - Auto';)。 タイトルã¨ã‚¹ã‚³ãƒ¼ãƒ—ã¯ä½œæˆã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«ã‚³ãƒ”ーã•れã¾ã™ã€‚

    -"; - +"; + $TLS_hlp_req_coverage_table = "

    網羅率:

    \"40% (8/20)\"ã¨ã‚ã£ãŸå ´åˆã€20ã¯ã“ã®è¦ä»¶ã‹ã‚‰ç”Ÿæˆã•れるã¹ãテストケース数〠8ã¯ã€æ—¢ã«ã“ã®è¦ä»¶ã‹ã‚‰ç”Ÿæˆã•れã€ç´ä»˜ã‘られãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹æ•°ã€ã“れらã®å€¤ã‹ã‚‰ç¶²ç¾…率ã¯40%ã¨ãªã‚Šã¾ã™ã€‚ -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

    スコープã®å†…部リンク:

    -

    内部リンクã¯ã€ä»–ã®è¦ä»¶/è¦ä»¶ä»•様ã¸ã®ãƒªãƒ³ã‚¯ã‚’作æˆã™ã‚‹ç›®çš„ã§ç‰¹åˆ¥ãªæ§‹æ–‡ã§æä¾›ã•れã¾ã™ã€‚ +

    内部リンクã¯ã€ä»–ã®è¦ä»¶/è¦ä»¶ä»•様ã¸ã®ãƒªãƒ³ã‚¯ã‚’作æˆã™ã‚‹ç›®çš„ã§ç‰¹åˆ¥ãªæ§‹æ–‡ã§æä¾›ã•れã¾ã™ã€‚ 内部リンクã®å‹•作ã¯ã€è¨­å®šãƒ•ァイルã§å¤‰æ›´ã§ãã¾ã™ã€‚

    使用方法: @@ -294,10 +289,9 @@

    変更ãŒè¡Œã‚れるãŸã³ã«ã€Testlinkã¯ãƒ­ã‚°ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’è¦æ±‚ã—ã¾ã™ã€‚ ã“ã®ãƒ­ã‚°ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã€ãƒˆãƒ¬ãƒ¼ã‚µãƒ“ãƒªãƒ†ã‚£ã‚’ç›®çš„ã«æä¾›ã•れã¾ã™ã€‚ è¦ä»¶ã®ã‚¹ã‚³ãƒ¼ãƒ—ã®ã¿ãŒå¤‰æ›´ã•れãŸå ´åˆã¯ã€æ–°ã—ã„リビジョンを作æˆã™ã‚‹ã‹ã©ã†ã‹ã‚’è‡ªç”±ã«æ±ºã‚ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ スコープ以外ã®ã‚‚ã®ãŒå¤‰æ›´ã•れãŸå ´åˆã¯ã€å¸¸ã«æ–°ã—ã„リビジョンを作æˆã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚

    -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

    ダイレクトリンク:

    ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’ä»–ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¨ç°¡å˜ã«å…±æœ‰ã™ã‚‹ã«ã¯ã€ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã®ä¸Šéƒ¨ã«ã‚る地çƒã®ã‚¢ã‚¤ã‚³ãƒ³ã‚’クリックã—ã¦ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆãƒªãƒ³ã‚¯ã‚’作æˆã—ã¾ã™ã€‚

    @@ -314,12 +308,11 @@ 設定ファイルã§è¨­å®šã§ãã¾ã™ã€‚ 「è¦ä»¶Aã¯è¦ä»¶Bã®è¦ªã€ã¨ã„ã†é–¢é€£ã‚’設定ã™ã‚‹å ´åˆã€ Testlinkã¯ã€ã€Œè¦ä»¶Bã¯è¦ä»¶Aã®å­ã€ã¨ã„ã†é–¢é€£ã‚’暗黙的ã«è¨­å®šã—ã¾ã™

    -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

    スコープã®å†…部リンク:

    -

    内部リンクã¯ã€ä»–ã®è¦ä»¶/è¦ä»¶ä»•様ã¸ã®ãƒªãƒ³ã‚¯ã‚’作æˆã™ã‚‹ç›®çš„ã§ç‰¹åˆ¥ãªæ§‹æ–‡ã§æä¾›ã•れã¾ã™ã€‚ +

    内部リンクã¯ã€ä»–ã®è¦ä»¶/è¦ä»¶ä»•様ã¸ã®ãƒªãƒ³ã‚¯ã‚’作æˆã™ã‚‹ç›®çš„ã§ç‰¹åˆ¥ãªæ§‹æ–‡ã§æä¾›ã•れã¾ã™ã€‚ 内部リンクã®å‹•作ã¯ã€è¨­å®šãƒ•ァイルã§å¤‰æ›´ã§ãã¾ã™ã€‚

    使用方法: @@ -332,39 +325,23 @@ [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
    ã“ã®æ§‹æ–‡ã¯ã€è¦ä»¶ä»•様ã§ã‚‚機能ã—ã¾ã™ (ãƒãƒ¼ã‚¸ãƒ§ãƒ³å±žæ€§ã¯åŠ¹æžœãŒã‚りã¾ã›ã‚“)。
    ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’指定ã—ãªã„å ´åˆã¯ã€ã™ã¹ã¦ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’å«ã‚€è¦ä»¶å…¨ä½“ãŒè¡¨ç¤ºã•れã¾ã™ã€‚

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    「カスタムフィールドã®ä¿å­˜ã€ã«ã¤ã„ã¦

    例ãˆã°ã€ä»¥ä¸‹ã®ã‚«ã‚¹ã‚¿ãƒ ãƒ•ィールドをテストプロジェクトã§å®šç¾©ãŠã‚ˆã³ã‚¢ã‚µã‚¤ãƒ³ã™ã‚‹ã¨ã—ã¾ã™ã€‚
    「テスト計画ã§è¡¨ç¤ºã™ã‚‹=trueã€ãŠã‚ˆã³
    ã€Œãƒ†ã‚¹ãƒˆè¨ˆç”»ã§æœ‰åйã«ã™ã‚‹=trueã€
    ã“ã®ã¨ãã€ãƒ†ã‚¹ãƒˆè¨ˆç”»ã«ã‚¢ã‚µã‚¤ãƒ³ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«é–¢ã™ã‚‹ãƒšãƒ¼ã‚¸ã®ã¿ã§ã“ã®ã‚«ã‚¹ã‚¿ãƒ ãƒ•ィールドãŒè¡¨ç¤ºã•れã„ã¾ã™ã€‚ -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = <<<'TLS_hlp_results_by_tester_per_build_table' テスト担当者ã«é–¢ã™ã‚‹æ›´ãªã‚‹æƒ…å ±
    担当者åをクリックã™ã‚‹ã¨ã€ãã®æ‹…当者ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸå…¨ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¨ã€å½¼ã®ãƒ†ã‚¹ãƒˆé€²æ—ã«é–¢ã™ã‚‹è©³ç´°ã‚’見るã“ã¨ãŒå‡ºæ¥ã¾ã™ã€‚

    注記
    ã“ã®ãƒ¬ãƒãƒ¼ãƒˆã¯ã€æŒ‡å®šã®æ‹…当者ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚Œã€æ´»æ€§åŒ–中ã®å„ビルドã«åŸºã¥ã„ã¦å®Ÿè¡Œã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚
    ãŸã ã—ã€å‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸã®ã¨ã¯åˆ¥ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒå®Ÿæ–½ã—ãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯ã€åˆ¥ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®å®Ÿæ–½ã‚±ãƒ¼ã‚¹ã¨ã—ã¦è¡¨ç¤ºã•れã¾ã™ã€‚ -TLS_hlp_results_by_tester_per_build_table; -/* -"More information about testers:
    -If you click on a tester name in this table, you will get a more detailed overview -about all Test Cases assigned to that user and his testing progress.

    -Note:
    -This Report shows those test cases, which are assigned to a specific user and have been executed -based on each active build. Even if a test case has been executed by another user than the assigned user, -the test case will appear as executed for the assigned user. -"; -*/ - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +TLS_hlp_results_by_tester_per_build_table; + ?> diff --git a/locale/ja_JP/texts.php b/locale/ja_JP/texts.php index c87860fee0..dc853baa21 100644 --- a/locale/ja_JP/texts.php +++ b/locale/ja_JP/texts.php @@ -1,64 +1,61 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - *------------------------------------------------------------------- - * Japanese translation - *------------------------------------------------------------------- - * Testing Engineer's Forum (TEF) in Japan - * Working Group of TestLink Japanese Translation Project - * - * http://blues.se.uec.ac.jp/swtest/ - * http://testlinkjp.org/ - * http://sourceforge.jp/projects/testlinkjp/ - * - * Adviser: - * Yasuharu NISHI - * - * Core member: - * Atsushi Nagata, AZMA Daisuke, Hiromi Nishiyama, - * Kaname Mochizuki, Kaoru Nakamura, Kunio Murakami, - * Lumina Nishihara, Marino Suda, Masahide Katsumata, - * Masami Ichikawa, Masataka Yoneta, Sadahiko Hantani, - * Shinichi Sugiyama, Shinsuke Matsuki, Shizuka Ban, - * Takahiro Wada, Toshinori Sawaguchi, Toshiyuki Kawanishi, - * Yasuhiko Okada, Yoichi Kunihiro, Yoshihiro Yoshimura, - * Yukiko Kajino - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Application error"; -$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . - "logs for details.

    You are welcome to report the problem. Please visit our " . - "website.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "テストケースã«è¦ä»¶ã‚’割り当ã¦ã‚‹"; -$TLS_htmltext['assignReqs'] = "

    目的:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + *------------------------------------------------------------------- + * Japanese translation + *------------------------------------------------------------------- + * Testing Engineer's Forum (TEF) in Japan + * Working Group of TestLink Japanese Translation Project + * + * http://blues.se.uec.ac.jp/swtest/ + * http://testlinkjp.org/ + * http://sourceforge.jp/projects/testlinkjp/ + * + * Adviser: + * Yasuharu NISHI + * + * Core member: + * Atsushi Nagata, AZMA Daisuke, Hiromi Nishiyama, + * Kaname Mochizuki, Kaoru Nakamura, Kunio Murakami, + * Lumina Nishihara, Marino Suda, Masahide Katsumata, + * Masami Ichikawa, Masataka Yoneta, Sadahiko Hantani, + * Shinichi Sugiyama, Shinsuke Matsuki, Shizuka Ban, + * Takahiro Wada, Toshinori Sawaguchi, Toshiyuki Kawanishi, + * Yasuhiko Okada, Yoichi Kunihiro, Yoshihiro Yoshimura, + * Yukiko Kajino + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Application error"; +$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . + "logs for details.

    You are welcome to report the problem. Please visit our " . + "website.

    "; + +$TLS_htmltext_title['assignReqs'] = "テストケースã«è¦ä»¶ã‚’割り当ã¦ã‚‹"; +$TLS_htmltext['assignReqs'] = "

    目的:

    ã“ã®æ©Ÿèƒ½ã«ã‚ˆã‚Šã€è¦ä»¶ã¨ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’関連付ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ テスト設計者ã¯0..n対0..nã®é–¢é€£ä»˜ã‘を定義ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ ã™ãªã‚ã¡ã€è¦ä»¶ã«é–¢é€£ä»˜ã‘られãªã„テストケースãŒã‚ã£ãŸã‚Šã€è¤‡æ•°ã® @@ -82,46 +79,39 @@ æ–°è¦ã«å‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯ä¸­å¤®ã®ãƒ–ロックã®ã€Œå‰²ã‚Šå½“ã¦ã‚‰ã‚ŒãŸè¦ä»¶ã€ã«è¡¨ç¤ºã•れã¾ã™ã€‚

    Warning:

    -å‡çµã•れãŸè¦ä»¶ã¯å¤‰æ›´ã—ã¦ã€ç¶²ç¾…率を更新ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。ãã®ãŸã‚ã€å‡çµã•れãŸè¦ä»¶ã¯ä¸€è¦§ã«è¡¨ç¤ºã•れã¾ã™ãŒã€é–¢é€£ä»˜ã‘ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã¯ç„¡åйã«ãªã‚Šã¾ã™ã€‚"; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "テスト仕様"; -$TLS_htmltext['editTc'] = "

    目的:

    -

    テスト仕様 ã¯ã€å­˜åœ¨ã™ã‚‹ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆãã—ã¦ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ ã®". - "情報を閲覧ã—ãŸã‚Šå¤‰æ›´ã—ãŸã‚Šã™ã‚‹å ´æ‰€ã§ã™ã€‚" . - "ç•°ãªã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’見るã“ã¨ã‚‚ã§ãã¾ã™ã€‚

    +å‡çµã•れãŸè¦ä»¶ã¯å¤‰æ›´ã—ã¦ã€ç¶²ç¾…率を更新ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“。ãã®ãŸã‚ã€å‡çµã•れãŸè¦ä»¶ã¯ä¸€è¦§ã«è¡¨ç¤ºã•れã¾ã™ãŒã€é–¢é€£ä»˜ã‘ã®ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã¯ç„¡åйã«ãªã‚Šã¾ã™ã€‚"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "テスト仕様"; +$TLS_htmltext['editTc'] = "

    目的:

    +

    テスト仕様 ã¯ã€å­˜åœ¨ã™ã‚‹ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆãã—ã¦ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ ã®" . "情報を閲覧ã—ãŸã‚Šå¤‰æ›´ã—ãŸã‚Šã™ã‚‹å ´æ‰€ã§ã™ã€‚" . + "ç•°ãªã‚‹ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’見るã“ã¨ã‚‚ã§ãã¾ã™ã€‚

    ã‚„ã£ã¦ã¿ã¾ã—ょã†ï¼:

      -
    1. テストプロジェクトをナビゲーションã®ãƒ„リーã‹ã‚‰é¸æŠžã—ã¾ã™ã€‚メモ: " . - "テストプロジェクトã®å¤‰æ›´ã¯å³ä¸Šã®" . +
    2. テストプロジェクトをナビゲーションã®ãƒ„リーã‹ã‚‰é¸æŠžã—ã¾ã™ã€‚メモ: " . "テストプロジェクトã®å¤‰æ›´ã¯å³ä¸Šã®" . "ãƒ—ãƒ«ãƒ€ã‚¦ãƒ³ãƒªã‚¹ãƒˆã‚’é¸æŠžã™ã‚‹ã“ã¨ã§ãŠã“ãªã†ã“ã¨ãŒã§ãã¾ã™ã€‚
    3. -
    4. å­ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆä½œæˆãƒœã‚¿ãƒ³ã‚’クリックã—ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã‚’作æˆã—ã¾ã™ã€‚" . - "ã“ã®ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«å¾“ã£ã¦ãƒ†ã‚¹ãƒˆãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆãŒæ§‹æˆã•れã¾ã™" . - "(例ãˆã°ã€æ©Ÿèƒ½/éžæ©Ÿèƒ½ãªã©ã®ç¨®åˆ¥ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚„フィーãƒãƒ£ãƒ¼ã«ã‚ˆã‚‹åˆ†åˆ¥ãªã©)。" . - "テストスイートã«ã¯ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã€ç’°å¢ƒè¨­å®šã€é–¢é€£ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¸ã®å‚ç…§ã€" . - "制é™äº‹é …ã‚„ã€ãれ以外ã«å¿…è¦ãªæƒ…報を記載ã—ã¾ã™ã€‚" . - "一般ã«ã€é…下ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«é–¢ã™ã‚‹æ§˜ã€…ãªå…±é€šã™ã‚‹èª¬æ˜Žã‚’記述ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ã€‚" . - "
    5. テストスイートã¯ã€Œãƒ•ォルダーã€ã®ã‚ˆã†ãªæ¦‚念ã¨ã‚‚ã„ãˆã¾ã™ã€‚ 従ã£ã¦ã€ãƒ†ã‚¹ãƒˆãƒ—ロジェクト内ã§" . - "テストスイートã®ã‚³ãƒ”ーや移動ãŒã§ãã¾ã™ã€‚ã¾ãŸã€ã‚¤ãƒ³ãƒãƒ¼ãƒˆã¨ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆã‚‚å¯èƒ½ã§ã™ (テストケースをå«ã‚ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™)。
    6. -
    7. 作æˆã—ãŸãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã‚’ナビゲーションã‹ã‚‰é¸æŠžã—ã€" . - "テストケースを作æˆãƒœã‚¿ãƒ³ã‚’クリックã™ã‚‹ã“ã¨ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’作æˆã—ã¾ã™ã€‚" . - "テストケースã«ã¯ã€ãƒ†ã‚¹ãƒˆã‚·ãƒŠãƒªã‚ªã€æœŸå¾…çµæžœã‚„テストプロジェクトã§å®šç¾©ã•れãŸã‚«ã‚¹ã‚¿ãƒ ãƒ•ィールド" . - "ãªã©ã‚’記載ã—ã¾ã™ (詳ã—ãã¯ã€ãƒ¦ãƒ¼ã‚¶ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ã‚’å‚ç…§ã—ã¦ãã ã•ã„。" . - "ã¾ãŸã€ãƒˆãƒ¬ãƒ¼ã‚µãƒ“リティã®ãŸã‚ã«ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã‚’割り当ã¦ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚
    8. +
    9. å­ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆä½œæˆãƒœã‚¿ãƒ³ã‚’クリックã—ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã‚’作æˆã—ã¾ã™ã€‚" . + "ã“ã®ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«å¾“ã£ã¦ãƒ†ã‚¹ãƒˆãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆãŒæ§‹æˆã•れã¾ã™" . "(例ãˆã°ã€æ©Ÿèƒ½/éžæ©Ÿèƒ½ãªã©ã®ç¨®åˆ¥ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚„フィーãƒãƒ£ãƒ¼ã«ã‚ˆã‚‹åˆ†åˆ¥ãªã©)。" . + "テストスイートã«ã¯ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã€ç’°å¢ƒè¨­å®šã€é–¢é€£ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¸ã®å‚ç…§ã€" . "制é™äº‹é …ã‚„ã€ãれ以外ã«å¿…è¦ãªæƒ…報を記載ã—ã¾ã™ã€‚" . + "一般ã«ã€é…下ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«é–¢ã™ã‚‹æ§˜ã€…ãªå…±é€šã™ã‚‹èª¬æ˜Žã‚’記述ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ã€‚" . + "
    10. テストスイートã¯ã€Œãƒ•ォルダーã€ã®ã‚ˆã†ãªæ¦‚念ã¨ã‚‚ã„ãˆã¾ã™ã€‚ 従ã£ã¦ã€ãƒ†ã‚¹ãƒˆãƒ—ロジェクト内ã§" . + "テストスイートã®ã‚³ãƒ”ーや移動ãŒã§ãã¾ã™ã€‚ã¾ãŸã€ã‚¤ãƒ³ãƒãƒ¼ãƒˆã¨ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆã‚‚å¯èƒ½ã§ã™ (テストケースをå«ã‚ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™)。
    11. +
    12. 作æˆã—ãŸãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã‚’ナビゲーションã‹ã‚‰é¸æŠžã—ã€" . "テストケースを作æˆãƒœã‚¿ãƒ³ã‚’クリックã™ã‚‹ã“ã¨ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’作æˆã—ã¾ã™ã€‚" . + "テストケースã«ã¯ã€ãƒ†ã‚¹ãƒˆã‚·ãƒŠãƒªã‚ªã€æœŸå¾…çµæžœã‚„テストプロジェクトã§å®šç¾©ã•れãŸã‚«ã‚¹ã‚¿ãƒ ãƒ•ィールド" . + "ãªã©ã‚’記載ã—ã¾ã™ (詳ã—ãã¯ã€ãƒ¦ãƒ¼ã‚¶ãƒžãƒ‹ãƒ¥ã‚¢ãƒ«ã‚’å‚ç…§ã—ã¦ãã ã•ã„。" . + "ã¾ãŸã€ãƒˆãƒ¬ãƒ¼ã‚µãƒ“リティã®ãŸã‚ã«ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã‚’割り当ã¦ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚
    13. 左横ã«ã‚るツリーã§ãƒ‡ãƒ¼ã‚¿ç·¨é›†ã‚’指示ã—ã¾ã™ã€‚
    14. 作æˆã—ãŸãƒ†ã‚¹ãƒˆä»•æ§˜æ›¸ã‚’ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ãŒæº–備完了ã—ãŸã¨ã㫠テスト計画ã«å‰²ã‚Šå½“ã¦ã¾ã™ã€‚
    -

    TestLinkã§ã¯ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«ã‚ˆã£ã¦ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’æ•´ç†ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã§ã—ょã†ã€‚" . -"テストスイートã¯å…¥ã‚Œå­çжã«ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã®ã§ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã®éšŽå±¤ã‚’作るã“ã¨ãŒã§ãã¾ã™ã€‚ -ã“ã®æƒ…å ±ã¯ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¨ã¨ã‚‚ã«å°åˆ·ã•れã¾ã™ã€‚

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "テストケース検索ページ"; -$TLS_htmltext['searchTc'] = "

    目的:

    +

    TestLinkã§ã¯ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«ã‚ˆã£ã¦ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’æ•´ç†ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã§ã—ょã†ã€‚" . + "テストスイートã¯å…¥ã‚Œå­çжã«ã™ã‚‹ã“ã¨ãŒã§ãã‚‹ã®ã§ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã®éšŽå±¤ã‚’作るã“ã¨ãŒã§ãã¾ã™ã€‚ +ã“ã®æƒ…å ±ã¯ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¨ã¨ã‚‚ã«å°åˆ·ã•れã¾ã™ã€‚

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "テストケース検索ページ"; +$TLS_htmltext['searchTc'] = "

    目的:

    キーワードã«å¿œã˜ãŸæ¤œç´¢æ–‡å­—列を入力ã—ã¦ãã ã•ã„ã€‚å¤§æ–‡å­—å°æ–‡å­—ã¯åŒºåˆ¥ã—ã¾ã›ã‚“。 æ¤œç´¢çµæžœã¯ã€ç¾åœ¨ã®ãƒ†ã‚¹ãƒˆãƒ—ロジェクトã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ã¿ã‚’å«ã¿ã¾ã™ã€‚

    @@ -134,13 +124,13 @@
  • å¿…è¦ãªã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã‚’é¸ã¶ã‹ã€ç©ºæ¬„('é©ç”¨ã—ãªã„'ã®æ„)ã‚’é¸ã‚“ã§ä¸‹ã•ã„。
  • 検索ボタンをクリックã—ã¦ä¸‹ã•ã„。
  • å…¨ã¦ã®æ¡ä»¶ã«ä¸€è‡´ã—ãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ãŒè¡¨ç¤ºã•れã¾ã™ã€‚'タイトル'をクリックã™ã‚‹ã“ã¨ã§ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’編集ã§ãã¾ã™ã€‚
  • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "è¦ä»¶æ¤œç´¢"; -$TLS_htmltext['searchReq'] = "

    目的:

    +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "è¦ä»¶æ¤œç´¢"; +$TLS_htmltext['searchReq'] = "

    目的:

    キーワードã«å¿œã˜ãŸæ¤œç´¢æ–‡å­—列を入力ã—ã¦ãã ã•ã„ã€‚å¤§æ–‡å­—å°æ–‡å­—ã¯åŒºåˆ¥ã—ã¾ã›ã‚“。 æ¤œç´¢çµæžœã¯ã€ç¾åœ¨ã®ãƒ†ã‚¹ãƒˆãƒ—ロジェクトã®è¦ä»¶ã®ã¿ã‚’å«ã¿ã¾ã™ã€‚

    @@ -158,12 +148,12 @@

    - ç¾åœ¨ã®ãƒ—ロジェクト内ã®è¦ä»¶ã®ã¿ãŒæ¤œç´¢ã•れã¾ã™ã€‚
    - 検索ã¯å¤§æ–‡å­—å°æ–‡å­—を区別ã—ã¾ã›ã‚“。
    -- 空ã®ãƒ•ィールドã¯è€ƒæ…®ã•れã¾ã›ã‚“。

    "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "è¦ä»¶ä»•様検索"; -$TLS_htmltext['searchReqSpec'] = "

    目的:

    +- 空ã®ãƒ•ィールドã¯è€ƒæ…®ã•れã¾ã›ã‚“。

    "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "è¦ä»¶ä»•様検索"; +$TLS_htmltext['searchReqSpec'] = "

    目的:

    キーワードã«å¿œã˜ãŸæ¤œç´¢æ–‡å­—列を入力ã—ã¦ãã ã•ã„ã€‚å¤§æ–‡å­—å°æ–‡å­—ã¯åŒºåˆ¥ã—ã¾ã›ã‚“。 æ¤œç´¢çµæžœã¯ã€ç¾åœ¨ã®ãƒ†ã‚¹ãƒˆãƒ—ロジェクトã®è¦ä»¶ä»•様ã®ã¿ã‚’å«ã¿ã¾ã™ã€‚

    @@ -181,13 +171,12 @@

    - ç¾åœ¨ã®ãƒ—ロジェクト内ã®è¦ä»¶ã®ã¿ãŒæ¤œç´¢ã•れã¾ã™ã€‚
    - 検索ã¯å¤§æ–‡å­—å°æ–‡å­—を区別ã—ã¾ã›ã‚“。
    -- 空ã®ãƒ•ィールドã¯è€ƒæ…®ã•れã¾ã›ã‚“。

    "; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "テスト仕様ã®å°åˆ·"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    目的:

    +- 空ã®ãƒ•ィールドã¯è€ƒæ…®ã•れã¾ã›ã‚“。

    "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "テスト仕様ã®å°åˆ·"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    目的:

    ã“ã®æ©Ÿèƒ½ã¯å„々ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã€ã¾ãŸã¯ãƒ†ã‚¹ãƒˆãƒ—ロジェクト/テスト計画全体ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’å°åˆ·ã§ãã¾ã™ã€‚

    ã‚„ã£ã¦ã¿ã¾ã—ょã†ï¼:

      @@ -201,12 +190,11 @@
    1. ブラウザã®å°åˆ·æ©Ÿèƒ½ã«ã¦ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’å°åˆ·ã—ã¾ã™ã€‚
      注: å°åˆ·ã§ãã‚‹ã®ã¯ãƒ–ラウザã®å³å´ã®ã¿ã§ã™ã€‚

    2. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "è¦ä»¶ä»•様ã®è¨­è¨ˆ"; -$TLS_htmltext['reqSpecMgmt'] = "

    è¦ä»¶ä»•様ドキュメントを管ç†ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "è¦ä»¶ä»•様ã®è¨­è¨ˆ"; +$TLS_htmltext['reqSpecMgmt'] = "

    è¦ä»¶ä»•様ドキュメントを管ç†ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    è¦ä»¶ä»•様

    @@ -235,11 +223,10 @@ ã“れらã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯ã€TestLinkã®è¨­å®šã§å®šç¾©ã•れãŸåå‰ã®ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«æ ¼ç´ã•れã¾ã™ (デフォルトã§ã¯ \$tlCfg->req_cfg->default_testsuite_name = 'Test suite created by Requirement - Auto';)。 -タイトルã¨ã‚¹ã‚³ãƒ¼ãƒ—ã¯ä½œæˆã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«ã‚³ãƒ”ーã•れã¾ã™ã€‚

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "è¦ä»¶ä»•様ã®å°åˆ·"; //printReq +タイトルã¨ã‚¹ã‚³ãƒ¼ãƒ—ã¯ä½œæˆã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«ã‚³ãƒ”ーã•れã¾ã™ã€‚

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "è¦ä»¶ä»•様ã®å°åˆ·"; // printReq $TLS_htmltext['printReqSpec'] = "

    目的:

    ã“ã“ã‹ã‚‰ã€å˜ä¸€ã®è¦ä»¶ã€è¦ä»¶ä»•様内ã®ã™ã¹ã¦ã®è¦ä»¶ã€ ã¾ãŸã¯ãƒ†ã‚¹ãƒˆãƒ—ロジェクトã®ã™ã¹ã¦ã®è¦ä»¶ã‚’å°åˆ·ã§ãã¾ã™ã€‚

    @@ -257,12 +244,11 @@
  • å®Ÿéš›ã«æƒ…報をå°åˆ·ã™ã‚‹ã®ã¯ã€ãƒ–ラウザã®å°åˆ·æ©Ÿèƒ½ã‚’使用ã—ã¾ã™ã€‚
    注: å³å´ã®ãƒ•レームã®ã¿ã‚’å°åˆ·ã—ã¦ãã ã•ã„。

  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "キーワードã®å‰²ã‚Šå½“ã¦"; -$TLS_htmltext['keywordsAssign'] = "

    目的:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "キーワードã®å‰²ã‚Šå½“ã¦"; +$TLS_htmltext['keywordsAssign'] = "

    目的:

    キーワードã®å‰²ã‚Šå½“ã¦ã§ã¯ã€ãƒ¦ãƒ¼ã‚¶ãŒä¸€æ‹¬ã—ã¦ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã¾ãŸã¯ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã« 一括ã—ã¦ã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã‚’割り当ã¦ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

    @@ -286,16 +272,15 @@ TestLinkã¯ãƒ†ã‚¹ãƒˆè¨ˆç”»ã®å¤ã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¯ã€æœ€æ–°ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«å¯¾ã—ã¦ãŠã“ãªã£ãŸã‚­ãƒ¼ãƒ¯ãƒ¼ãƒ‰ã®å‰²ã‚Šå½“ã¦ã«ã‚ˆã£ã¦å½±éŸ¿ã‚’å—ã‘ã¾ã›ã‚“。 ã‚‚ã—ãƒ†ã‚¹ãƒˆè¨ˆç”»ãŒæ›´æ–°ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’å¿…è¦ã¨ã™ã‚‹ãªã‚‰ã°ã€ã¯ã˜ã‚ã«ã€Œä¿®æ­£ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®æ›´æ–°ã€ 機能をキーワードã®å‰²ã‚Šå½“ã¦ã‚’行ã†å‰ã«ä½¿ç”¨ã—ã€å¯¾è±¡ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ãŒæœ€æ–°ã§ã‚ã‚‹ã“ã¨ã‚’確ã‹ã‚ã¦ãã ã•ã„。 -

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "テストケース実行"; -$TLS_htmltext['executeTest'] = "

    目的:

    +

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "テストケース実行"; +$TLS_htmltext['executeTest'] = "

    目的:

    å„テスト担当者ãŒãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹å®Ÿè¡Œã‚’ãŠã“ãªã†ã“ã¨ãŒã§ãã¾ã™ã€‚ -ユーザã¯ãƒ†ã‚¹ãƒˆçµæžœã‚’ビルドã”ã¨ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«ç™»éŒ²ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" . - "フィルタã€è¨­å®š(セッティング)ã«ã¤ã„ã¦ã®ã„ã‚ã„ã‚ãªæƒ…å ±ã«ã¤ã„ã¦ã¯ãƒ˜ãƒ«ãƒ—ã‚’å‚ç…§ã—ã¦ãã ã•ã„。(「?ã€ã®ã‚¢ã‚¤ã‚³ãƒ³ã‚’クリックã—ã¦ãã ã•ã„。)

    +ユーザã¯ãƒ†ã‚¹ãƒˆçµæžœã‚’ビルドã”ã¨ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«ç™»éŒ²ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚" . + "フィルタã€è¨­å®š(セッティング)ã«ã¤ã„ã¦ã®ã„ã‚ã„ã‚ãªæƒ…å ±ã«ã¤ã„ã¦ã¯ãƒ˜ãƒ«ãƒ—ã‚’å‚ç…§ã—ã¦ãã ã•ã„。(「?ã€ã®ã‚¢ã‚¤ã‚³ãƒ³ã‚’クリックã—ã¦ãã ã•ã„。)

    ã‚„ã£ã¦ã¿ã¾ã—ょã†ï¼

    @@ -307,11 +292,11 @@
  • çµæžœã‚’ä¿å­˜ã—ã¾ã™ã€‚
  • 注: GUI上ã‹ã‚‰éšœå®³ãƒ¬ãƒãƒ¼ãƒˆã‚’作æˆã™ã‚‹ãŸã‚ã«ã¯ã€ -ãƒã‚°ç®¡ç†ã‚·ã‚¹ãƒ†ãƒ ã¨é€£æºã™ã‚‹ã‚ˆã†ã«TestLinkを設定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "テストレãƒãƒ¼ãƒˆã¨æŒ‡æ¨™ã®æ¦‚è¦"; -$TLS_htmltext['showMetrics'] = "

    レãƒãƒ¼ãƒˆã¯ãƒ†ã‚¹ãƒˆè¨ˆç”»ã«é–¢é€£ã—ã¦ã„ã¾ã™ã€‚ " . +ãƒã‚°ç®¡ç†ã‚·ã‚¹ãƒ†ãƒ ã¨é€£æºã™ã‚‹ã‚ˆã†ã«TestLinkを設定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "テストレãƒãƒ¼ãƒˆã¨æŒ‡æ¨™ã®æ¦‚è¦"; +$TLS_htmltext['showMetrics'] = "

    レãƒãƒ¼ãƒˆã¯ãƒ†ã‚¹ãƒˆè¨ˆç”»ã«é–¢é€£ã—ã¦ã„ã¾ã™ã€‚ " . "(上段ã®ãƒŠãƒ“ゲータã«ã‚ˆã‚Šé¸æŠžã—ã¾ã™)。ç¾åœ¨å®Ÿè¡Œä¸­ã®ãƒ†ã‚¹ãƒˆè¨ˆç”»ä»¥å¤–ã®ãƒ†ã‚¹ãƒˆè¨ˆç”»ã‚’é¸æŠžã—㦠レãƒãƒ¼ãƒˆã‚’表示ã™ã‚‹ã“ã¨ã‚‚ã§ãã¾ã™ã€‚以下ã®ãƒ¬ãƒãƒ¼ãƒˆãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã‚’é¸æŠžã™ã‚‹ã“ã¨ãŒã§ãã¾ã™:

      @@ -384,12 +369,11 @@

      棒グラフã¯ã€æˆåŠŸã€å¤±æ•—ã€ãƒ–ãƒ­ãƒƒã‚¯ã€æœªå®Ÿè¡Œã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹æ•°ã‚’近似的ã«ç¤ºã—ã¦ã„ã¾ã™ã€‚

      å„テストケースã®ãƒã‚°ã®åˆè¨ˆ

      -

      ã“ã®ãƒ¬ãƒãƒ¼ãƒˆã¯ã€ãƒ†ã‚¹ãƒˆãƒ—ロジェクト内ã®ãƒã‚°ãŒç™ºè¦‹ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚ã“ã®ãƒ¬ãƒãƒ¼ãƒˆã¯ãƒã‚°ãƒˆãƒ©ã‚­ãƒ³ã‚°ã‚·ã‚¹ãƒ†ãƒ ãŒæŽ¥ç¶šã•れã¦ã„ã‚‹å ´åˆã®ã¿è¡¨ç¤ºã•れã¾ã™ã€‚

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "テスト計画ã¸ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’追加/削除"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      目的:

      +

      ã“ã®ãƒ¬ãƒãƒ¼ãƒˆã¯ã€ãƒ†ã‚¹ãƒˆãƒ—ロジェクト内ã®ãƒã‚°ãŒç™ºè¦‹ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚ã“ã®ãƒ¬ãƒãƒ¼ãƒˆã¯ãƒã‚°ãƒˆãƒ©ã‚­ãƒ³ã‚°ã‚·ã‚¹ãƒ†ãƒ ãŒæŽ¥ç¶šã•れã¦ã„ã‚‹å ´åˆã®ã¿è¡¨ç¤ºã•れã¾ã™ã€‚

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "テスト計画ã¸ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’追加/削除"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      目的:

      リーダー権é™ã‚’æŒã¤ãƒ¦ãƒ¼ã‚¶ã¯ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’テスト計画ã¸è¿½åŠ ã§ãã¾ã™ã€‚

      テストケースã®è¿½åŠ /削除:

      @@ -397,11 +381,11 @@
    • テストスイートをクリックã—ã€å…¨ã¦ã€ã¾ãŸã¯1ã¤ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’表示ã—ã¾ã™ã€‚
    • ã‚ãªãŸãŒè¿½åŠ ã‚’å®Œäº†ã—ãŸã„時ã€ã€Œãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹è¿½åŠ /削除ã€ãƒœã‚¿ãƒ³ã‚’クリックã—ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’インãƒãƒ¼ãƒˆã—ã¦ä¸‹ã•ã„。 注:åŒã˜ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’複数回追加ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“。
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "テストケース実行担当者ã®å‰²ã‚Šå½“ã¦"; -$TLS_htmltext['tc_exec_assignment'] = "

      目的:

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "テストケース実行担当者ã®å‰²ã‚Šå½“ã¦"; +$TLS_htmltext['tc_exec_assignment'] = "

      目的:

      ã“ã®æ©Ÿèƒ½ã«ã‚ˆã‚Šã€å„テストケースã«ã¤ã„ã¦å®Ÿè¡Œã™ã‚‹è²¬ä»»ã‚’æŒã¤æ‹…当者を設定ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚

      ã‚„ã£ã¦ã¿ã¾ã—ょã†ï¼

      @@ -410,15 +394,15 @@
    • 対象ã®ãƒ†ã‚¹ãƒˆæ‹…å½“è€…ã‚’é¸æŠžã—ã¾ã™ã€‚
    • 割り当ã¦ã‚’確定ã™ã‚‹ãŸã‚ã«ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚
    • 実行ページã§å‰²ã‚Šå½“ã¦ã®å®Œäº†ã‚’確èªã—ã¾ã™ã€‚フィルターを割り当ã¦ãŸæ‹…当者ã«ã›ã£ã¦ã„ã—ã¦ã¿ã¦ãã ã•ã„。
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "テスト計画ã«å‰²ã‚Šå½“ã¦ãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’æ›´æ–°ã™ã‚‹"; -$TLS_htmltext['planUpdateTC'] = "

      目的

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "テスト計画ã«å‰²ã‚Šå½“ã¦ãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’æ›´æ–°ã™ã‚‹"; +$TLS_htmltext['planUpdateTC'] = "

      目的

      ã“ã®ãƒšãƒ¼ã‚¸ã§ã¯ã€ãƒ†ã‚¹ãƒˆä»•様上ã§å¤‰æ›´ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã‚’最新ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«æ›´æ–°ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ -テストã®å®Ÿè¡ŒæœŸé–“中ã«ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’明確ã«ã—ãŸã„å ´åˆã¯å¤šãã‚ã‚‹ã§ã—ょã†ã€‚" . -"例ãˆã°ã€ã‚るテスト設計者ãŒãƒ†ã‚¹ãƒˆä»•様を変更ã—ãŸã‘れã©ã‚‚テスト計画ã«ã¯ä¸€é€šã‚Šã®ãƒ†ã‚¹ãƒˆå®Œäº†å¾Œã«å映ã•ã›ãŸã„å ´åˆã€" . -"ã‚‚ã—ãã¯ã€ãƒ†ã‚¹ãƒˆå®Ÿè¡Œã¯ã‚ªãƒªã‚¸ãƒŠãƒ«ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§è¡Œã£ãŸã‘れã©ã‚‚ã€çµæžœã¯ä¿®æ­£ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¨å…±ã«å‚ç…§ã—ãŸã„å ´åˆãªã©ãŒè€ƒãˆã‚‰ã‚Œã¾ã™ã€‚

      +テストã®å®Ÿè¡ŒæœŸé–“中ã«ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’明確ã«ã—ãŸã„å ´åˆã¯å¤šãã‚ã‚‹ã§ã—ょã†ã€‚" . + "例ãˆã°ã€ã‚るテスト設計者ãŒãƒ†ã‚¹ãƒˆä»•様を変更ã—ãŸã‘れã©ã‚‚テスト計画ã«ã¯ä¸€é€šã‚Šã®ãƒ†ã‚¹ãƒˆå®Œäº†å¾Œã«å映ã•ã›ãŸã„å ´åˆã€" . + "ã‚‚ã—ãã¯ã€ãƒ†ã‚¹ãƒˆå®Ÿè¡Œã¯ã‚ªãƒªã‚¸ãƒŠãƒ«ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§è¡Œã£ãŸã‘れã©ã‚‚ã€çµæžœã¯ä¿®æ­£ã•れãŸãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã¨å…±ã«å‚ç…§ã—ãŸã„å ´åˆãªã©ãŒè€ƒãˆã‚‰ã‚Œã¾ã™ã€‚

      ã‚„ã£ã¦ã¿ã¾ã—ょã†ï¼

        @@ -426,12 +410,11 @@
      1. 対象ã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«å¯¾ã—ã¦ãƒ—ルダウンメニューã‹ã‚‰æ–°ãŸãªãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’é¸æŠžã—ã¾ã™ã€‚
      2. 変更を確定ã™ã‚‹ãŸã‚ã«ã€Œãƒ†ã‚¹ãƒˆè¨ˆç”»ã‚’æ›´æ–°ã€ãƒœã‚¿ãƒ³ã‚’クリックã—ã¾ã™ã€‚
      3. 実行ページã®ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®æ–‡ç« ã‚’確èªã—ã¾ã™ã€‚
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "テストã«ç·Šæ€¥åº¦ã‚’設定ã™ã‚‹"; -$TLS_htmltext['test_urgency'] = "

      目的

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "テストã«ç·Šæ€¥åº¦ã‚’設定ã™ã‚‹"; +$TLS_htmltext['test_urgency'] = "

      目的

      TestLinkã§ã¯ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã®å„ªå…ˆåº¦ã«å½±éŸ¿ã‚’与ãˆã‚‹ã€Œç·Šæ€¥åº¦ã€ã‚’テストスイートã«è¨­å®šã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ テストã®å„ªå…ˆåº¦ã¯å„テストケースã®ä½œæˆæ™‚ã«è¨­å®šã™ã‚‹é‡è¦åº¦ã¨ãƒ†ã‚¹ãƒˆè¨ˆç”»ã§å®šç¾©ã™ã‚‹é‡è¦åº¦ ã®ä¸¡æ–¹ã‹ã‚‰è¨ˆç®—ã•れã¾ã™ã€‚テストリーダーã¯å§‹ã‚ã«å®Ÿè¡Œã™ã¹ãテストを指定ã™ã¹ãã§ã—ょã†ã€‚ @@ -446,10 +429,8 @@ ã®å„ªå…ˆåº¦ã‚’上ã’ãŸã‚Šã¨ã„ã£ãŸã“ã¨ãŒå¯èƒ½ã§ã™ã€‚

    • 変更を確定ã™ã‚‹ãŸã‚ã«ã€Œä¿å­˜ã€ãƒœã‚¿ãƒ³ã‚’クリックã—ã¦ãã ã•ã„。
    • -

      一例ã¨ã—ã¦ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«é‡è¦åº¦ã€Œé«˜ã€ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«ç·Šæ€¥åº¦ã€Œä½Žã€ã‚’設定ã™ã‚‹ã¨ " . - "優先度ã¯ã€Œä¸­ã€ã«ãªã‚Šã¾ã™ã€‚"; - - -// ------------------------------------------------------------------------------------------ - -?> \ No newline at end of file +

      一例ã¨ã—ã¦ã€ãƒ†ã‚¹ãƒˆã‚±ãƒ¼ã‚¹ã«é‡è¦åº¦ã€Œé«˜ã€ã€ãƒ†ã‚¹ãƒˆã‚¹ã‚¤ãƒ¼ãƒˆã«ç·Šæ€¥åº¦ã€Œä½Žã€ã‚’設定ã™ã‚‹ã¨ " . "優先度ã¯ã€Œä¸­ã€ã«ãªã‚Šã¾ã™ã€‚"; + +// ------------------------------------------------------------------------------------------ + +?> diff --git a/locale/ko_KR/description.php b/locale/ko_KR/description.php index a4e365e45f..56d3961cf8 100644 --- a/locale/ko_KR/description.php +++ b/locale/ko_KR/description.php @@ -1,66 +1,66 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ---------------------------------------------------------------------------------- - * Korean translation - *------------------------------------------------------------------- - * Translated by Jiun PARK - * (DQA Team, OPENTECH INC. R&D Center) - * E-mail : rustyheart@gmail.com - * Issued Date : 2009/05/27 - * - *------------------------------------------------------------------- - */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ---------------------------------------------------------------------------------- + * Korean translation + *------------------------------------------------------------------- + * Translated by Jiun PARK + * (DQA Team, OPENTECH INC. R&D Center) + * E-mail : rustyheart@gmail.com + * Issued Date : 2009/05/27 + * + *------------------------------------------------------------------- + */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

      문서 ìƒì„±ì˜ 옵션

      -

      사용ìžëŠ” 문서를 ë³´ê¸°ì „ì— ì´ í…Œì´ë¸”ì„ ì‚¬ìš©í•˜ì—¬ 테스트 ì¼€ì´ìŠ¤ë¥¼ ì„ íƒ í•  수 있습니다. -ì„ íƒí•œ(ì²´í¬í•œ) ìžë£ŒëŠ” 표시가 ë©ë‹ˆë‹¤. í‘œì‹œë  ìžë£Œë¥¼ 변경하려면, 필터를 ì„ íƒ ë˜ëŠ” 해제한 후 +

      사용ìžëŠ” 문서를 ë³´ê¸°ì „ì— ì´ í…Œì´ë¸”ì„ ì‚¬ìš©í•˜ì—¬ 테스트 ì¼€ì´ìŠ¤ë¥¼ ì„ íƒ í•  수 있습니다. +ì„ íƒí•œ(ì²´í¬í•œ) ìžë£ŒëŠ” 표시가 ë©ë‹ˆë‹¤. í‘œì‹œë  ìžë£Œë¥¼ 변경하려면, 필터를 ì„ íƒ ë˜ëŠ” 해제한 후 트리ì—서 ì›í•˜ëŠ” ë ˆë²¨ì˜ ìžë£Œë¥¼ í´ë¦­í•˜ì‹œë©´ ë©ë‹ˆë‹¤.

      -

      문서 ë¨¸ë¦¿ë§ : ë¬¸ì„œì˜ ë¨¸ë¦¿ë§ ì •ë³´ë¥¼ ì„ íƒí•  수 있습니다. -ë¬¸ì„œì˜ ë¨¸ë¦¿ë§ ì •ë³´ì—는 다ìŒê³¼ ê°™ì€ ê²ƒë“¤ì´ ìžˆìŠµë‹ˆë‹¤ : 소개, 범위, 참고ìžë£Œ, +

      문서 ë¨¸ë¦¿ë§ : ë¬¸ì„œì˜ ë¨¸ë¦¿ë§ ì •ë³´ë¥¼ ì„ íƒí•  수 있습니다. +ë¬¸ì„œì˜ ë¨¸ë¦¿ë§ ì •ë³´ì—는 다ìŒê³¼ ê°™ì€ ê²ƒë“¤ì´ ìžˆìŠµë‹ˆë‹¤ : 소개, 범위, 참고ìžë£Œ, 테스트 방법론, 테스트 제약사항.

      -

      테스트 ì¼€ì´ìФ 본문 : 테스트 ì¼€ì´ìŠ¤ì˜ ë³¸ë¬¸ 정보를 ì„ íƒí•  수 있습니다. 테스트 ì¼€ì´ìФ +

      테스트 ì¼€ì´ìФ 본문 : 테스트 ì¼€ì´ìŠ¤ì˜ ë³¸ë¬¸ 정보를 ì„ íƒí•  수 있습니다. 테스트 ì¼€ì´ìФ 본문 정보는 다ìŒê³¼ ê°™ì€ ê²ƒë“¤ì´ ìžˆìŠµë‹ˆë‹¤ : 요약, 실행순서, 예ìƒê²°ê³¼, 키워드.

      -

      테스트 ì¼€ì´ìФ 요약 : 사용ìžëŠ” 테스트 ì¼€ì´ìФ ì œëª©ì— ìžˆëŠ” 테스트 ì¼€ì´ìФ -요약정보를 ì„ íƒí•  수 있지만, 테스트 ì¼€ì´ìФ ë³¸ë¬¸ì— ìžˆëŠ” 테스트 ì¼€ì´ìФ 요약 정보는 ì„ íƒí•  -수 없습니다. 테스트 ì¼€ì´ìФ ìš”ì•½ì€ ê°„ë‹¨í•œ 요약과 함께 ì œëª©ì„ ë³´ëŠ” ê²ƒì„ ì§€ì›í•˜ê³ , -실행순서, 예ìƒê²°ê³¼, 키워드를 ìƒëžµí•  수 있ë„ë¡ í•˜ê¸° 위해 부분ì ìœ¼ë¡œ 테스트 ì¼€ì´ìФ 본문ì—서 -분리 ë˜ì–´ 있습니다. 만약 사용ìžê°€ 테스트 ì¼€ì´ìФ ë³¸ë¬¸ì„ ë³´ê² ë‹¤ê³  ì„ íƒí•˜ë©´, 테스트 ì¼€ì´ìФ +

      테스트 ì¼€ì´ìФ 요약 : 사용ìžëŠ” 테스트 ì¼€ì´ìФ ì œëª©ì— ìžˆëŠ” 테스트 ì¼€ì´ìФ +요약정보를 ì„ íƒí•  수 있지만, 테스트 ì¼€ì´ìФ ë³¸ë¬¸ì— ìžˆëŠ” 테스트 ì¼€ì´ìФ 요약 정보는 ì„ íƒí•  +수 없습니다. 테스트 ì¼€ì´ìФ ìš”ì•½ì€ ê°„ë‹¨í•œ 요약과 함께 ì œëª©ì„ ë³´ëŠ” ê²ƒì„ ì§€ì›í•˜ê³ , +실행순서, 예ìƒê²°ê³¼, 키워드를 ìƒëžµí•  수 있ë„ë¡ í•˜ê¸° 위해 부분ì ìœ¼ë¡œ 테스트 ì¼€ì´ìФ 본문ì—서 +분리 ë˜ì–´ 있습니다. 만약 사용ìžê°€ 테스트 ì¼€ì´ìФ ë³¸ë¬¸ì„ ë³´ê² ë‹¤ê³  ì„ íƒí•˜ë©´, 테스트 ì¼€ì´ìФ ìš”ì•½ì€ í•­ìƒ í¬í•¨ë©ë‹ˆë‹¤.

      목차 : ì´ ê°’ì„ ì„ íƒí•˜ë©´ TestLink는 모든 ì œëª©ì„ ë§í¬ë¥¼ 걸어서 표시합니다.

      -

      문서 í˜•ì‹ : ë‹¤ìŒ ì„¸ 가지 형ì‹ì´ 가능합니다 : HTML, OpenOffice Writer, MS Word. HTMLì„ ì œì™¸í•œ -나머지는 브ë¼ìš°ì €ê°€ 해당 S/W ì»´í¬ë„ŒíŠ¸ë¥¼ 호출합니다.

      "; - -// testPlan.html +

      문서 í˜•ì‹ : ë‹¤ìŒ ì„¸ 가지 형ì‹ì´ 가능합니다 : HTML, OpenOffice Writer, MS Word. HTMLì„ ì œì™¸í•œ +나머지는 브ë¼ìš°ì €ê°€ 해당 S/W ì»´í¬ë„ŒíŠ¸ë¥¼ 호출합니다.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      테스트 계íš

      개요

      @@ -68,22 +68,22 @@ 테스트 활ë™ì„ ì¡°ì§í•˜ê³  결과를 ì¶”ì í•  수 있습니다.

      테스트 실행

      -

      ì´ ì„¹ì…˜ì—서 사용ìžëŠ” 테스트 ì¼€ì´ìŠ¤ë¥¼ 실행(결과를 기재)하고 테스트 계íšì„ ì¸ì‡„í•  수 있습니다. -그리고 ì´ ê³³ì—서 사용ìžëŠ” ìžì‹ ì˜ 테스트 ì¼€ì´ìФ 실행 결과를 ì¶”ì í•  수 있습니다.

      +

      ì´ ì„¹ì…˜ì—서 사용ìžëŠ” 테스트 ì¼€ì´ìŠ¤ë¥¼ 실행(결과를 기재)하고 테스트 계íšì„ ì¸ì‡„í•  수 있습니다. +그리고 ì´ ê³³ì—서 사용ìžëŠ” ìžì‹ ì˜ 테스트 ì¼€ì´ìФ 실행 결과를 ì¶”ì í•  수 있습니다.

      테스트 ê³„íš ê´€ë¦¬

      -

      리드 ê¶Œí•œì´ ìžˆëŠ” 사용ìžëŠ”, ì´ ì„¹ì…˜ì—서 테스트 계íšì„ 관리할 수 있습니다. -테스트 계íšì˜ 관리는 계íšì„ ìƒì„±/편집/삭제하고, 계íšì— 테스트 ì¼€ì´ìŠ¤ë“¤ì„ +

      리드 ê¶Œí•œì´ ìžˆëŠ” 사용ìžëŠ”, ì´ ì„¹ì…˜ì—서 테스트 계íšì„ 관리할 수 있습니다. +테스트 계íšì˜ 관리는 계íšì„ ìƒì„±/편집/삭제하고, 계íšì— 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì¶”ê°€/편집/ì‚­ì œ/ì—…ë°ì´íЏ 하고, ë¹Œë“œë“¤ì„ ìƒì„±í•˜ëŠ” 것으로 구성 ë˜ì–´ 있습니다.
      -리드 ê¶Œí•œì´ ìžˆëŠ” 사용ìžëŠ” 우선순위/위험ë„와 테스트 ìŠ¤ìœ„íŠ¸ì˜ ë‹´ë‹¹ìž ì§€ì •, 테스팅 -마ì¼ìŠ¤í†¤ ì§€ì •ì„ í•  수 있습니다.

      - -

      노트: 드롭다운 ìƒìžì— ì–´ë–¤ 테스트 계íšë„ 표시 ë˜ì§€ ì•Šì„ ìˆ˜ 있습니다. -ì´ëŸ° 경우 리드 ê¶Œí•œì´ ìžˆëŠ” ì‚¬ëžŒì´ ì•„ë‹ˆë©´ 아래 ë§í¬ë¥¼ 사용할 수가 없습니다. -ë‹¹ì‹ ì´ ì§€ê¸ˆ ì´ëŸ° ìƒí™©ì´ë¼ë©´ ì ì ˆí•œ 프로ì íЏ ê¶Œí•œì„ ê°€ì§€ê³  있거나 테스트 계íšì„ -ìƒì„±í•  수 있는 리드 ë˜ëŠ” 관리ìžì—게 ì—°ë½ í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤.

      "; - -// custom_fields.html +리드 ê¶Œí•œì´ ìžˆëŠ” 사용ìžëŠ” 우선순위/위험ë„와 테스트 ìŠ¤ìœ„íŠ¸ì˜ ë‹´ë‹¹ìž ì§€ì •, 테스팅 +마ì¼ìŠ¤í†¤ ì§€ì •ì„ í•  수 있습니다.

      + +

      노트: 드롭다운 ìƒìžì— ì–´ë–¤ 테스트 계íšë„ 표시 ë˜ì§€ ì•Šì„ ìˆ˜ 있습니다. +ì´ëŸ° 경우 리드 ê¶Œí•œì´ ìžˆëŠ” ì‚¬ëžŒì´ ì•„ë‹ˆë©´ 아래 ë§í¬ë¥¼ 사용할 수가 없습니다. +ë‹¹ì‹ ì´ ì§€ê¸ˆ ì´ëŸ° ìƒí™©ì´ë¼ë©´ ì ì ˆí•œ 프로ì íЏ ê¶Œí•œì„ ê°€ì§€ê³  있거나 테스트 계íšì„ +ìƒì„±í•  수 있는 리드 ë˜ëŠ” 관리ìžì—게 ì—°ë½ í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      ì‚¬ìš©ìž í•„ë“œ

      다ìŒì€ ì‚¬ìš©ìž í•„ë“œì˜ ì •ì˜ì— 대한 몇가지 사실 입니다 :

        @@ -98,12 +98,12 @@

        ì‚¬ìš©ìž í•„ë“œì˜ ì •ì˜ì—는 다ìŒê³¼ ê°™ì€ ë…¼ë¦¬ì ì¸ ì†ì„±ì´ í¬í•¨ë˜ì–´ 있습니다. :

        • ì‚¬ìš©ìž í•„ë“œ ì´ë¦„
        • -
        • 변수 ì´ë¦„ (예: ì´ê²ƒì€ lang_get APIì— ì˜í•´ 제공ë˜ëŠ” ê°’ì´ê±°ë‚˜, 언어 파ì¼ì—서 찾지 +
        • 변수 ì´ë¦„ (예: ì´ê²ƒì€ lang_get APIì— ì˜í•´ 제공ë˜ëŠ” ê°’ì´ê±°ë‚˜, 언어 파ì¼ì—서 찾지 못할 경우 그대로 표시 ë˜ëŠ” 값입니다).
        • ì‚¬ìš©ìž í•„ë“œ 종류 (string, numeric, float, enum, email)
        • -
        • ì—´ê±° 가능한 값들 (예: RED|YELLOW|BLUE), 목ë¡, 다중 ì„ íƒ ê°€ëŠ¥í•œ 목ë¡, +
        • ì—´ê±° 가능한 값들 (예: RED|YELLOW|BLUE), 목ë¡, 다중 ì„ íƒ ê°€ëŠ¥í•œ 목ë¡, 콤보 박스들.
          -ì—´ê±° 가능한 ê°’ë“¤ì„ êµ¬ë¶„í•˜ê¸° 위해 파ì´í”„ 문ìž('|')를 사용할 수 있습니다. +ì—´ê±° 가능한 ê°’ë“¤ì„ êµ¬ë¶„í•˜ê¸° 위해 파ì´í”„ 문ìž('|')를 사용할 수 있습니다. 값들 중 하나는 공백 문ìžì—´ì„ 사용할 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤.
        • 기본 ê°’ : *ì•„ì§ êµ¬í˜„ë˜ì§€ 않았습니다*
        • @@ -119,26 +119,26 @@
        • 테스트 ê³„íš ì„¤ê³„ì—서 사용. 사용ìžëŠ” 테스트 계íšì„ 설계하면서 ì‚¬ìš©ìž í•„ë“œì˜ ê°’ì„ ë³€ê²½í•  수 있습니다 (테스트 계íšì— 테스트 ì¼€ì´ìФ 추가)
        • 사용할 ê³³. 사용ìžëŠ” ì‚¬ìš©ìž í•„ë“œë¥¼ ì–´ë–¤ 항목 아래ì—서 사용할 ì§€ ì„ íƒí•  수 있습니다.
        -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

        테스트 ì¼€ì´ìФ 실행하기

        -

        사용ìžê°€ 테스트 ì¼€ì´ìŠ¤ë¥¼ '실행' í•  수 있습니다. ì‹¤í–‰ì€ ì„ íƒí•œ ë¹Œë“œì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— +

        사용ìžê°€ 테스트 ì¼€ì´ìŠ¤ë¥¼ '실행' í•  수 있습니다. ì‹¤í–‰ì€ ì„ íƒí•œ ë¹Œë“œì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— ê²°ê³¼(통과, 실패, 중단)를 지정하는 ê²ƒì„ ë§í•©ë‹ˆë‹¤.

        -

        ì„¤ì •ì´ ë˜ì–´ 있다면 버그 ì¶”ì  ì‹œìŠ¤í…œì— ì ‘ì†ì´ 가능합니다. 사용ìžëŠ” 새 버그를 ì§ì ‘ -추가하고 검색할 수 있습니다.

        "; - -//bug_add.html +

        ì„¤ì •ì´ ë˜ì–´ 있다면 버그 ì¶”ì  ì‹œìŠ¤í…œì— ì ‘ì†ì´ 가능합니다. 사용ìžëŠ” 새 버그를 ì§ì ‘ +추가하고 검색할 수 있습니다.

        "; + +// bug_add.html $TLS_hlp_btsIntegration = "

        테스트 ì¼€ì´ìŠ¤ì— ë²„ê·¸ 추가하기

        (설정 ë˜ì–´ ìžˆì„ ê²½ìš°ì—ë§Œ) -TestLink는 버그 ì¶”ì  ì‹œìŠ¤í…œ(BTS)와 아주 단순한 수준으로 통합합니다. -즉, BTSì— ë²„ê·¸ ìƒì„± 요구를 보낼 ìˆ˜ë„ ì—†ê³ , 버그 IDê°’ì„ ë°›ì•„ 올 ìˆ˜ë„ ì—†ìŠµë‹ˆë‹¤. -ì´ í†µí•©ì€ BTSì˜ íŽ˜ì´ì§€ì— 대한 ë§í¬ë¥¼ 사용하는 ê²ƒì„ ë§í•˜ë©°, 다ìŒê³¼ ê°™ì€ ê¸°ëŠ¥ì´ ìžˆìŠµë‹ˆë‹¤ : +TestLink는 버그 ì¶”ì  ì‹œìŠ¤í…œ(BTS)와 아주 단순한 수준으로 통합합니다. +즉, BTSì— ë²„ê·¸ ìƒì„± 요구를 보낼 ìˆ˜ë„ ì—†ê³ , 버그 IDê°’ì„ ë°›ì•„ 올 ìˆ˜ë„ ì—†ìŠµë‹ˆë‹¤. +ì´ í†µí•©ì€ BTSì˜ íŽ˜ì´ì§€ì— 대한 ë§í¬ë¥¼ 사용하는 ê²ƒì„ ë§í•˜ë©°, 다ìŒê³¼ ê°™ì€ ê¸°ëŠ¥ì´ ìžˆìŠµë‹ˆë‹¤ :

        • 새 버그 추가하기.
        • 기존 버그 ì •ë³´ 표시하기.
        -

        +

        버그를 추가하는 순서

        @@ -147,112 +147,108 @@

      • 2 단계 : BTSì—서 í• ë‹¹ëœ BUGID를 ì ìŠµë‹ˆë‹¤.
      • 3 단계 : ìž…ë ¥ í•„ë“œì— BUGID를 ì ìŠµë‹ˆë‹¤.
      • 4 단계 : 버그 추가 ë²„íŠ¼ì„ í´ë¦­í•©ë‹ˆë‹¤.
      • -
      +
    버그 추가 í™”ë©´ì„ ë‹«ìœ¼ë©´, 실행 í™”ë©´ì— ê´€ë ¨ 버그가 표시 ë©ë‹ˆë‹¤. -

    "; - -// execFilter.html +

    "; + +// execFilter.html $TLS_hlp_executeFilter = "

    테스트 ì‹¤í–‰ì„ ìœ„í•œ 필터와 빌드 설정하기

    -

    왼쪽 í™”ë©´ì€ ë„¤ë¹„ê²Œì´í„°, 현재 테스트 계íšì— ì§€ì •ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ê³¼ í•„í„° & 설정" . -"으로 ì´ë£¨ì–´ì ¸ 있습니다. ì´ í•„í„°ë“¤ì€ ì‚¬ìš©ìžê°€ 실행하기 ì „ ì œê³µëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ " . -"구별하기 위해 사용할 수 있습니다." . -"필터를 설정하고, \"ì ìš©\" ë²„íŠ¼ì„ ëˆ„ë¥´ë©´ 트리 ë©”ë‰´ì— ì ì ˆí•œ 테스트 ì¼€ì´ìŠ¤ë“¤ì´ " . -"ì„ íƒë©ë‹ˆë‹¤.

    +

    왼쪽 í™”ë©´ì€ ë„¤ë¹„ê²Œì´í„°, 현재 테스트 계íšì— ì§€ì •ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ê³¼ í•„í„° & 설정" . + "으로 ì´ë£¨ì–´ì ¸ 있습니다. ì´ í•„í„°ë“¤ì€ ì‚¬ìš©ìžê°€ 실행하기 ì „ ì œê³µëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ " . "구별하기 위해 사용할 수 있습니다." . + "필터를 설정하고, \"ì ìš©\" ë²„íŠ¼ì„ ëˆ„ë¥´ë©´ 트리 ë©”ë‰´ì— ì ì ˆí•œ 테스트 ì¼€ì´ìŠ¤ë“¤ì´ " . + "ì„ íƒë©ë‹ˆë‹¤.

    빌드

    -

    사용ìžëŠ” 테스트 결과와 ì—°ê²°ë  ë¹Œë“œë¥¼ 반드시 ì„ íƒí•´ì•¼ 합니다. " . -"빌드는 현재 테스트 계íšì˜ 기본 요소입니다. ê°ê°ì˜ 테스트 ì¼€ì´ìŠ¤ëŠ” " . -"빌드ì—서 여러번 ì‹¤í–‰ë  ìˆ˜ 있습니다. 하지만 마지막 결과는 하나 입니다. +

    사용ìžëŠ” 테스트 결과와 ì—°ê²°ë  ë¹Œë“œë¥¼ 반드시 ì„ íƒí•´ì•¼ 합니다. " . + "빌드는 현재 테스트 계íšì˜ 기본 요소입니다. ê°ê°ì˜ 테스트 ì¼€ì´ìŠ¤ëŠ” " . + "빌드ì—서 여러번 ì‹¤í–‰ë  ìˆ˜ 있습니다. 하지만 마지막 결과는 하나 입니다.
    빌드는 새 빌드 ìƒì„± 화면ì—서 리드가 ìƒì„±í•  수 있습니다.

    테스트 ì¼€ì´ìФ ID í•„í„°

    -

    사용ìžëŠ” 유ì¼í•œ ID로 테스트 ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. ì´ ID는 -테스트 ì¼€ì´ìŠ¤ë¥¼ ìƒì„±í•  때 ìžë™ìœ¼ë¡œ 부여 ë©ë‹ˆë‹¤. ì´ í•„ë“œë¥¼ 공란으로 ë‘ë©´ -필터를 ì ìš©í•˜ì§€ 않겠다는 ì˜ë¯¸ê°€ ë©ë‹ˆë‹¤.

    +

    사용ìžëŠ” 유ì¼í•œ ID로 테스트 ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. ì´ ID는 +테스트 ì¼€ì´ìŠ¤ë¥¼ ìƒì„±í•  때 ìžë™ìœ¼ë¡œ 부여 ë©ë‹ˆë‹¤. ì´ í•„ë“œë¥¼ 공란으로 ë‘ë©´ +필터를 ì ìš©í•˜ì§€ 않겠다는 ì˜ë¯¸ê°€ ë©ë‹ˆë‹¤.

    우선순위 필터

    -

    사용ìžëŠ” 우선순위를 사용하여 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì„ íƒí•  수 있습니다. ê°ê°ì˜ 테스트 -ì¼€ì´ìФ 중요ë„는 현재 테스트 계íšì˜ 테스트 긴급ë„와 함께 ì¡°í•©ë©ë‹ˆë‹¤. 예를 들어, -ì¤‘ìš”ë„ ë˜ëŠ” 긴급ë„ê°€ 높ìŒì´ê³  ë‘번째 ì†ì„±ì´ ì ì–´ë„ 보통 레벨ì´ë©´, ì´ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì˜ -우선순위는 '높ìŒ'ì´ ë©ë‹ˆë‹¤.

    +

    사용ìžëŠ” 우선순위를 사용하여 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì„ íƒí•  수 있습니다. ê°ê°ì˜ 테스트 +ì¼€ì´ìФ 중요ë„는 현재 테스트 계íšì˜ 테스트 긴급ë„와 함께 ì¡°í•©ë©ë‹ˆë‹¤. 예를 들어, +ì¤‘ìš”ë„ ë˜ëŠ” 긴급ë„ê°€ 높ìŒì´ê³  ë‘번째 ì†ì„±ì´ ì ì–´ë„ 보통 레벨ì´ë©´, ì´ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì˜ +우선순위는 '높ìŒ'ì´ ë©ë‹ˆë‹¤.

    ê²°ê³¼ í•„í„°

    -

    사용ìžëŠ” ê²°ê³¼ì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  수 있습니다. 결과는 개별 ë¹Œë“œì˜ í…ŒìŠ¤íŠ¸ -ì¼€ì´ìŠ¤ì— ì¼ì–´ë‚œ ê²ƒì„ ë§í•©ë‹ˆë‹¤. 테스트 ì¼€ì´ìŠ¤ëŠ” 통과, 실패, 중단 ë˜ëŠ” ì‹¤í–‰ì•ˆí•¨ì´ ë  ìˆ˜ -있습니다." . -"ì´ í•„í„°ì˜ ê¸°ë³¸ê°’ì€ ëª¨ë‘ ì„ íƒ ìž…ë‹ˆë‹¤.

    +

    사용ìžëŠ” ê²°ê³¼ì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  수 있습니다. 결과는 개별 ë¹Œë“œì˜ í…ŒìŠ¤íŠ¸ +ì¼€ì´ìŠ¤ì— ì¼ì–´ë‚œ ê²ƒì„ ë§í•©ë‹ˆë‹¤. 테스트 ì¼€ì´ìŠ¤ëŠ” 통과, 실패, 중단 ë˜ëŠ” ì‹¤í–‰ì•ˆí•¨ì´ ë  ìˆ˜ +있습니다." . + "ì´ í•„í„°ì˜ ê¸°ë³¸ê°’ì€ ëª¨ë‘ ì„ íƒ ìž…ë‹ˆë‹¤.

    테스터 필터

    -

    사용ìžëŠ” 담당ìžì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  수 있습니다. \"ì§€ì •ì•ˆëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ -í¬í•¨\" ì²´í¬ìƒìžë¥¼ 사용하면 담당ìžê°€ 없는 테스트 ì¼€ì´ìŠ¤ë„ í¬í•¨í•  수 있습니다.

    "; -/* -

    Most Current Result

    -

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted -by the build that is chosen from the dropdown box. In this state the tree will display -the test cases status. -
    Example: User selects build 2 from the dropdown box and doesn't check the 'most -current' checkbox. All test cases will be shown with their status from build 2. -So, if test case 1 passed in build 2 it will be colored green. -
    If the user decideds to check the 'most current' checkbox the tree will be -colored by the test cases most recent result. -
    Ex: User selects build 2 from the dropdown box and this time checks -the 'most current' checkbox. All test cases will be shown with most current -status. So, if test case 1 passed in build 3, even though the user has also selected -build 2, it will be colored green.

    - */ - - -// newest_tcversions.html +

    사용ìžëŠ” 담당ìžì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•  수 있습니다. \"ì§€ì •ì•ˆëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ +í¬í•¨\" ì²´í¬ìƒìžë¥¼ 사용하면 담당ìžê°€ 없는 테스트 ì¼€ì´ìŠ¤ë„ í¬í•¨í•  수 있습니다.

    "; +/* + *

    Most Current Result

    + *

    By default or if the 'most current' checkbox is unchecked, the tree will be sorted + * by the build that is chosen from the dropdown box. In this state the tree will display + * the test cases status. + *
    Example: User selects build 2 from the dropdown box and doesn't check the 'most + * current' checkbox. All test cases will be shown with their status from build 2. + * So, if test case 1 passed in build 2 it will be colored green. + *
    If the user decideds to check the 'most current' checkbox the tree will be + * colored by the test cases most recent result. + *
    Ex: User selects build 2 from the dropdown box and this time checks + * the 'most current' checkbox. All test cases will be shown with most current + * status. So, if test case 1 passed in build 3, even though the user has also selected + * build 2, it will be colored green.

    + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

    ì—°ê²°ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì˜ ìƒˆ 버전들

    -

    테스트 계íšì— ì—°ê²°ëœ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ë“¤ì„ ë¶„ì„하여, 현재 테스트 계íšì— +

    테스트 계íšì— ì—°ê²°ëœ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ë“¤ì„ ë¶„ì„하여, 현재 테스트 계íšì— í¬í•¨ë˜ì§€ ì•Šì€ ìƒˆ ë²„ì „ì´ ìžˆëŠ” 테스트 ì¼€ì´ìŠ¤ë“¤ì„ í‘œì‹œí•©ë‹ˆë‹¤. -

    "; - - -// requirementsCoverage.html +

    "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

    요구사항 커버리지


    -

    ì´ ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ì—¬ 요구사항과 테스트 ì¼€ì´ìŠ¤ë¥¼ 매핑할 수 있습니다. +

    ì´ ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ì—¬ 요구사항과 테스트 ì¼€ì´ìŠ¤ë¥¼ 매핑할 수 있습니다. ë©”ì¸í™”ë©´ì—서 \"요구사항 명세\"를 ì„ íƒí•˜ì„¸ìš”.

    요구사항 명세

    -

    ìš”êµ¬ì‚¬í•­ì€ í…ŒìŠ¤íŠ¸ 프로ì íŠ¸ì™€ ê´€ë ¨ëœ '요구사항 명세' ë¬¸ì„œë“¤ì˜ ëª¨ìŒìž…니다.
    -TestLink는 요구사항 명세와 요구사항 ìžì²´ì— 대해 ë²„ì „ì„ ì§€ì›í•˜ì§€ 않습니다. 그래서, -ëª…ì„¸ì˜ ì œëª©ì— ë¬¸ì„œì˜ ë²„ì „ì„ ê¸°ìž¬í•˜ëŠ” ë°©ë²•ì„ ì‚¬ìš©í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤. -사용ìžëŠ” 범위 í•„ë“œì— ê°„ë‹¨í•œ 설명ì´ë‚˜ 노트를 남길 수 있습니다.

    - -

    모든 ìš”êµ¬ì‚¬í•­ì˜ ê°œìˆ˜ëŠ” 모든 ìš”êµ¬ì‚¬í•­ì´ TestLinkì— -추가 ë˜ì§€ ì•Šì•˜ì„ ê²½ìš°, ìš”êµ¬ì‚¬í•­ì˜ ì»¤ë²„ë¦¬ì§€ë¥¼ í‰ê°€í•˜ê¸° 위해 제공ë©ë‹ˆë‹¤. ì´ ê°’ì´ 0 -ì´ë©´ TestLinkì— ë“±ë¡ëœ ìš”êµ¬ì‚¬í•­ì˜ í˜„ìž¬ 개수가 ë§¤íŠ¸ë¦­ì— ì‚¬ìš©ë©ë‹ˆë‹¤.

    -

    예제) SRSì— ëª¨ë‘ 200ê°œì˜ ìš”êµ¬ì‚¬í•­ì´ ìžˆëŠ”ë°, ê·¸ 중 50개만 TestLinkì— ì¶”ê°€ ë˜ì—ˆìŠµë‹ˆë‹¤. +

    ìš”êµ¬ì‚¬í•­ì€ í…ŒìŠ¤íŠ¸ 프로ì íŠ¸ì™€ ê´€ë ¨ëœ '요구사항 명세' ë¬¸ì„œë“¤ì˜ ëª¨ìŒìž…니다.
    +TestLink는 요구사항 명세와 요구사항 ìžì²´ì— 대해 ë²„ì „ì„ ì§€ì›í•˜ì§€ 않습니다. 그래서, +ëª…ì„¸ì˜ ì œëª©ì— ë¬¸ì„œì˜ ë²„ì „ì„ ê¸°ìž¬í•˜ëŠ” ë°©ë²•ì„ ì‚¬ìš©í•˜ì‹œê¸° ë°”ëžë‹ˆë‹¤. +사용ìžëŠ” 범위 í•„ë“œì— ê°„ë‹¨í•œ 설명ì´ë‚˜ 노트를 남길 수 있습니다.

    + +

    모든 ìš”êµ¬ì‚¬í•­ì˜ ê°œìˆ˜ëŠ” 모든 ìš”êµ¬ì‚¬í•­ì´ TestLinkì— +추가 ë˜ì§€ ì•Šì•˜ì„ ê²½ìš°, ìš”êµ¬ì‚¬í•­ì˜ ì»¤ë²„ë¦¬ì§€ë¥¼ í‰ê°€í•˜ê¸° 위해 제공ë©ë‹ˆë‹¤. ì´ ê°’ì´ 0 +ì´ë©´ TestLinkì— ë“±ë¡ëœ ìš”êµ¬ì‚¬í•­ì˜ í˜„ìž¬ 개수가 ë§¤íŠ¸ë¦­ì— ì‚¬ìš©ë©ë‹ˆë‹¤.

    +

    예제) SRSì— ëª¨ë‘ 200ê°œì˜ ìš”êµ¬ì‚¬í•­ì´ ìžˆëŠ”ë°, ê·¸ 중 50개만 TestLinkì— ì¶”ê°€ ë˜ì—ˆìŠµë‹ˆë‹¤. ì¶”ê°€ëœ 50ê°œì˜ ìš”êµ¬ì‚¬í•­ì´ ëª¨ë‘ í…ŒìŠ¤íŠ¸ ë˜ì—ˆë‹¤ê³  가정하면, 테스트 커버리지는 25%ê°€ ë©ë‹ˆë‹¤.

    요구사항

    -

    ìƒì„±ëœ 요구사항 ëª…ì„¸ì˜ ì œëª©ì„ í´ë¦­í•˜ì„¸ìš”. ë‹¹ì‹ ì€ ìƒì„±, 편집, ì‚­ì œ, 문서로부터 -요구사항 가져오기를 í•  수 있습니다. ê°ê°ì˜ ìš”êµ¬ì‚¬í•­ì€ ì œëª©, 범위, ìƒíƒœë¥¼ 가집니다. -ìƒíƒœëŠ” \"보통\" ë˜ëŠ” \"테스트 í•  수 ì—†ìŒ\" 중 하나 입니다. 테스트 í•  수 없는 ìš”êµ¬ì‚¬í•­ì€ -매트릭 ê³„ì‚°ì— í¬í•¨ ë˜ì§€ 않습니다. ì´ íŒŒë¼ë¯¸í„°ëŠ” 구현ë˜ì§€ ì•Šì€ ê¸°ëŠ¥ë“¤ê³¼ 잘 못 ì„¤ê³„ëœ -요구사항들ì—ë„ ì‚¬ìš©ë©ë‹ˆë‹¤.

    - -

    ë‹¹ì‹ ì€ ëª…ì„¸ 화면ì—서 ìš”êµ¬ì‚¬í•­ë“¤ì„ ì—¬ëŸ¬ê°œ ì„ íƒí•˜ì—¬ 새로운 테스트 ì¼€ì´ìŠ¤ë“¤ì„ -ìƒì„±í•  수 있습니다. ì´ë ‡ê²Œ ìƒì„±ëœ 테스트 ì¼€ì´ìŠ¤ë“¤ì€ í™˜ê²½ì„¤ì •ì— ì •ì˜ëœ ì´ë¦„ì˜ -테스트 ìŠ¤ìœ„íŠ¸ì— í¬í•¨ë©ë‹ˆë‹¤. (기본값 : $tlCfg->req_cfg->default_testsuite_name = +

    ìƒì„±ëœ 요구사항 ëª…ì„¸ì˜ ì œëª©ì„ í´ë¦­í•˜ì„¸ìš”. ë‹¹ì‹ ì€ ìƒì„±, 편집, ì‚­ì œ, 문서로부터 +요구사항 가져오기를 í•  수 있습니다. ê°ê°ì˜ ìš”êµ¬ì‚¬í•­ì€ ì œëª©, 범위, ìƒíƒœë¥¼ 가집니다. +ìƒíƒœëŠ” \"보통\" ë˜ëŠ” \"테스트 í•  수 ì—†ìŒ\" 중 하나 입니다. 테스트 í•  수 없는 ìš”êµ¬ì‚¬í•­ì€ +매트릭 ê³„ì‚°ì— í¬í•¨ ë˜ì§€ 않습니다. ì´ íŒŒë¼ë¯¸í„°ëŠ” 구현ë˜ì§€ ì•Šì€ ê¸°ëŠ¥ë“¤ê³¼ 잘 못 ì„¤ê³„ëœ +요구사항들ì—ë„ ì‚¬ìš©ë©ë‹ˆë‹¤.

    + +

    ë‹¹ì‹ ì€ ëª…ì„¸ 화면ì—서 ìš”êµ¬ì‚¬í•­ë“¤ì„ ì—¬ëŸ¬ê°œ ì„ íƒí•˜ì—¬ 새로운 테스트 ì¼€ì´ìŠ¤ë“¤ì„ +ìƒì„±í•  수 있습니다. ì´ë ‡ê²Œ ìƒì„±ëœ 테스트 ì¼€ì´ìŠ¤ë“¤ì€ í™˜ê²½ì„¤ì •ì— ì •ì˜ëœ ì´ë¦„ì˜ +테스트 ìŠ¤ìœ„íŠ¸ì— í¬í•¨ë©ë‹ˆë‹¤. (기본값 : $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). 제목과 범위가 테스트 ì¼€ì´ìŠ¤ë¡œ 복사 ë©ë‹ˆë‹¤.

    -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

    'ì‚¬ìš©ìž í•„ë“œ 저장'ì— ê´€ë ¨í•˜ì—¬

    ì‚¬ìš©ìž í•„ë“œë¥¼ ì •ì˜í•˜ì—¬ 테스트 프로ì íŠ¸ì— ì§€ì •í•˜ë ¤ë©´ :
    '테스트 ê³„íš ì„¤ê³„ì— í‘œì‹œ=예'
    '테스트 ê³„íš ì„¤ê³„ì— ì‚¬ìš©=예'
    ì´ ì‚¬ìš©ìž í•„ë“œëŠ” 테스트 계íšì— ì—°ê²°ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì—게만 표시 ë©ë‹ˆë‹¤. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/ko_KR/texts.php b/locale/ko_KR/texts.php index 372249c313..b1577259d2 100644 --- a/locale/ko_KR/texts.php +++ b/locale/ko_KR/texts.php @@ -1,45 +1,44 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ - * Korean translation - *------------------------------------------------------------------- - * Translated by Jiun PARK - * (DQA Team, OPENTECH INC. R&D Center) - * E-mail : rustyheart@gmail.com - * Issued Date : 2009/05/27 - * - *------------------------------------------------------------------- - */ - -$TLS_htmltext_title['assignReqs'] = "테스트 ì¼€ì´ìŠ¤ì— ìš”êµ¬ì‚¬í•­ 지정하기"; -$TLS_htmltext['assignReqs'] = "

    목ì :

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ + * Korean translation + *------------------------------------------------------------------- + * Translated by Jiun PARK + * (DQA Team, OPENTECH INC. R&D Center) + * E-mail : rustyheart@gmail.com + * Issued Date : 2009/05/27 + * + *------------------------------------------------------------------- + */ +$TLS_htmltext_title['assignReqs'] = "테스트 ì¼€ì´ìŠ¤ì— ìš”êµ¬ì‚¬í•­ 지정하기"; +$TLS_htmltext['assignReqs'] = "

    목ì :

    사용ìžëŠ” 요구사항들과 테스트 ì¼€ì´ìŠ¤ë“¤ê°„ì˜ ê´€ê³„ë¥¼ 지정할 수 있습니다. 테스트 설계ìžëŠ” 0..nì—서 0..n까지 관계를 지정할 수 있습니다. 즉, í•˜ë‚˜ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ëŠ” ìš”êµ¬ì‚¬í•­ì„ ì§€ì •í•˜ì§€ 않거나, 하나 ì´ìƒì˜ ìš”êµ¬ì‚¬í•­ì„ ì§€ì •í•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. ì´ëŸ° 관계표시는 ìš”êµ¬ì‚¬í•­ì˜ í…ŒìŠ¤íŠ¸ 커버리지를 -조사하거나 테스트하는 ë™ì•ˆ ì–´ë–¤ ê¸°ëŠ¥ì´ ì‹¤íŒ¨ 했는지를 알아 ë‚´ëŠ”ë° ë„ì›€ì„ ì¤ë‹ˆë‹¤. +조사하거나 테스트하는 ë™ì•ˆ ì–´ë–¤ ê¸°ëŠ¥ì´ ì‹¤íŒ¨ 했는지를 알아 ë‚´ëŠ”ë° ë„ì›€ì„ ì¤ë‹ˆë‹¤. ì´ëŸ° ë¶„ì„ì„ í†µí•´ 모든 기대치가 충족 ë˜ì—ˆìŒì„ 확ì¸í•  수 있습니다.

    시작하기:

    @@ -51,47 +50,45 @@ 화면 아랫부분ì—는 테스트 ì¼€ì´ìŠ¤ì™€ ì—°ê²°ë˜ì§€ ì•Šì€ ëª¨ë“  '사용 가능한 요구사항들'ì„ í‘œì‹œ 합니다. 설계ìžëŠ” ì´ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— ì˜í•´ ë³´ìž¥ì´ ë˜ëŠ” ìš”êµ¬ì‚¬í•­ì„ ì„ íƒí•˜ê³  '지정'ë²„íŠ¼ì„ ëˆ„ë¥´ë©´ ë©ë‹ˆë‹¤. ì´ë ‡ê²Œ ì§€ì •ëœ ìš”êµ¬ì‚¬í•­ë“¤ì€ í™”ë©´ ì¤‘ê°„ë¶€ë¶„ì˜ 'ì§€ì •ëœ ìš”êµ¬ì‚¬í•­ë“¤'ì— í‘œì‹œ ë©ë‹ˆë‹¤. -"; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "테스트 명세"; -$TLS_htmltext['editTc'] = "

    목ì :

    -

    테스트 명세 ì—서 사용ìžëŠ” 모든 테스트 스위트들 ê³¼ 테스트 ì¼€ì´ìŠ¤ë“¤ ì„ " . - "ë³´ê³  편집할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ë“¤ì—는 ë²„ì „ì´ ë©”ê²¨ì ¸ 있고, 모든 ë²„ì „ë“¤ì„ " . - "ì´ ê³³ì—서 관리할 수 있습니다.

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "테스트 명세"; +$TLS_htmltext['editTc'] = "

    목ì :

    +

    테스트 명세 ì—서 사용ìžëŠ” 모든 테스트 스위트들 ê³¼ 테스트 ì¼€ì´ìŠ¤ë“¤ ì„ " . + "ë³´ê³  편집할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ë“¤ì—는 ë²„ì „ì´ ë©”ê²¨ì ¸ 있고, 모든 ë²„ì „ë“¤ì„ " . + "ì´ ê³³ì—서 관리할 수 있습니다.

    시작하기:

      -
    1. ì™¼ìª½ì˜ íŠ¸ë¦¬ì—서 ì œì¼ ìœ„ì— ìžˆëŠ” 테스트 프로ì íŠ¸ë¥¼ ì„ íƒí•˜ì„¸ìš”. 참고: " . - "테스트 프로ì íŠ¸ëŠ” 화면 오른쪽 ìœ„ì— ìžˆëŠ” 드롭다운 리스트박스ì—서 언제든지 변경 í•  수 있습니다.
    2. " . - "
    3. 새 테스트 스위트 ë²„íŠ¼ì„ í´ë¦­í•´ì„œ 새로운 테스트 스위트를 ìƒì„±í•©ë‹ˆë‹¤. 테스트 스위트를 사용하여 " . - "ë‹¹ì‹ ì˜ íŽ¸ì˜ì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ë¬¸ì„œì˜ êµ¬ì¡°ë¥¼ 만들 수 있습니다 (기능/비기능 테스트, " . - "제품 구성 ë˜ëŠ” 사양, 변경 요구, 등). 테스트 ìŠ¤ìœ„íŠ¸ì˜ ì„¤ëª…ì—는 테스트 ì¼€ì´ìŠ¤ì˜ ë²”ìœ„, " . - "기본 환경, ê´€ë ¨ë¬¸ì„œì˜ ë§í¬, 제한사항과 다른 유용한 정보를 ë„£ì„ ìˆ˜ 있습니다. " . - "ì¼ë°˜ì ìœ¼ë¡œ, ì„¤ëª…ì˜ ê¸°ìž¬ì‚¬í•­ì€ í•˜ìœ„ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì— ê³µí†µì ìœ¼ë¡œ ì ìš©ë©ë‹ˆë‹¤." . - "테스트 ì¼€ì´ìŠ¤ëŠ” "í´ë”" 구조를 따릅니다. 그래서 사용ìžëŠ” 테스트 프로ì íŠ¸ë‚´ì—서 " . - "테스트 스위트를 ì´ë™í•˜ê³  복사할 수 있습니다. " . - "ë˜í•œ, 테스트 스위트와 테스트 ì¼€ì´ìŠ¤ë¥¼ 가져오거나 내보낼 수 있습니다.
    4. -
    5. 테스트 스위트는 가변ì ì¸ í´ë”입니다. 테스트 프로ì íЏ ë‚´ì—서 테스트 스위트를 ì´ë™í•˜ê±°ë‚˜ 복사 í•  " . - "수 있습니다. 테스트 스위트는 케스트 ì¼€ì´ìŠ¤ë¥¼ í¬í•¨í•˜ì—¬ 가져오거나 내보낼 수 있습니다. -
    6. 트리메뉴ì—서 새로 ìƒì„±ëœ 테스트 스위트를 ì„ íƒí•˜ê³ , 테스트 ì¼€ì´ìФ ìƒì„± ë²„íŠ¼ì„ í´ë¦­í•´ì„œ 새 " . - "테스트 ì¼€ì´ìŠ¤ë¥¼ 만듭니다. 테스트 ì¼€ì´ìФì—는 테스트 시나리오, ì˜ˆìƒ ê²°ê³¼, 테스트 프로ì íŠ¸ì— " . - "ì •ì˜ëœ ì‚¬ìš©ìž í•„ë“œ(보다 ìžì„¸í•œ 정보는 ì‚¬ìš©ìž ë©”ë‰´ì–¼ì„ ì°¸ê³  하세요)를 기재합니다. " . - "ì¶”ì ì„±ì„ 높ì´ê¸° 위해 키워드 를 지정할 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤.
    7. " . - "
    8. ì™¼ìª½ì˜ íŠ¸ë¦¬ë©”ë‰´ë¥¼ ì´ìš©í•´ 테스트 ì¼€ì´ìŠ¤ë¥¼ íƒìƒ‰í•˜ê³  편집할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ëŠ” ë³€ê²½ëœ ì´ë ¥ì„ 기ë¡í•©ë‹ˆë‹¤.
    9. +
    10. ì™¼ìª½ì˜ íŠ¸ë¦¬ì—서 ì œì¼ ìœ„ì— ìžˆëŠ” 테스트 프로ì íŠ¸ë¥¼ ì„ íƒí•˜ì„¸ìš”. 참고: " . + "테스트 프로ì íŠ¸ëŠ” 화면 오른쪽 ìœ„ì— ìžˆëŠ” 드롭다운 리스트박스ì—서 언제든지 변경 í•  수 있습니다.
    11. " . + "
    12. 새 테스트 스위트 ë²„íŠ¼ì„ í´ë¦­í•´ì„œ 새로운 테스트 스위트를 ìƒì„±í•©ë‹ˆë‹¤. 테스트 스위트를 사용하여 " . + "ë‹¹ì‹ ì˜ íŽ¸ì˜ì— ë”°ë¼ í…ŒìŠ¤íŠ¸ ë¬¸ì„œì˜ êµ¬ì¡°ë¥¼ 만들 수 있습니다 (기능/비기능 테스트, " . + "제품 구성 ë˜ëŠ” 사양, 변경 요구, 등). 테스트 ìŠ¤ìœ„íŠ¸ì˜ ì„¤ëª…ì—는 테스트 ì¼€ì´ìŠ¤ì˜ ë²”ìœ„, " . + "기본 환경, ê´€ë ¨ë¬¸ì„œì˜ ë§í¬, 제한사항과 다른 유용한 정보를 ë„£ì„ ìˆ˜ 있습니다. " . + "ì¼ë°˜ì ìœ¼ë¡œ, ì„¤ëª…ì˜ ê¸°ìž¬ì‚¬í•­ì€ í•˜ìœ„ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì— ê³µí†µì ìœ¼ë¡œ ì ìš©ë©ë‹ˆë‹¤." . + "테스트 ì¼€ì´ìŠ¤ëŠ” "í´ë”" 구조를 따릅니다. 그래서 사용ìžëŠ” 테스트 프로ì íŠ¸ë‚´ì—서 " . + "테스트 스위트를 ì´ë™í•˜ê³  복사할 수 있습니다. " . + "ë˜í•œ, 테스트 스위트와 테스트 ì¼€ì´ìŠ¤ë¥¼ 가져오거나 내보낼 수 있습니다.
    13. +
    14. 테스트 스위트는 가변ì ì¸ í´ë”입니다. 테스트 프로ì íЏ ë‚´ì—서 테스트 스위트를 ì´ë™í•˜ê±°ë‚˜ 복사 í•  " . + "수 있습니다. 테스트 스위트는 케스트 ì¼€ì´ìŠ¤ë¥¼ í¬í•¨í•˜ì—¬ 가져오거나 내보낼 수 있습니다. +
    15. 트리메뉴ì—서 새로 ìƒì„±ëœ 테스트 스위트를 ì„ íƒí•˜ê³ , 테스트 ì¼€ì´ìФ ìƒì„± ë²„íŠ¼ì„ í´ë¦­í•´ì„œ 새 " . + "테스트 ì¼€ì´ìŠ¤ë¥¼ 만듭니다. 테스트 ì¼€ì´ìФì—는 테스트 시나리오, ì˜ˆìƒ ê²°ê³¼, 테스트 프로ì íŠ¸ì— " . + "ì •ì˜ëœ ì‚¬ìš©ìž í•„ë“œ(보다 ìžì„¸í•œ 정보는 ì‚¬ìš©ìž ë©”ë‰´ì–¼ì„ ì°¸ê³  하세요)를 기재합니다. " . + "ì¶”ì ì„±ì„ 높ì´ê¸° 위해 키워드 를 지정할 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤.
    16. " . + "
    17. ì™¼ìª½ì˜ íŠ¸ë¦¬ë©”ë‰´ë¥¼ ì´ìš©í•´ 테스트 ì¼€ì´ìŠ¤ë¥¼ íƒìƒ‰í•˜ê³  편집할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ëŠ” ë³€ê²½ëœ ì´ë ¥ì„ 기ë¡í•©ë‹ˆë‹¤.
    18. 테스트 ì¼€ì´ìŠ¤ë“¤ì´ ì¤€ë¹„ ë˜ë©´, 만들어진 테스트 명세를 테스트 ê³„íš ì— ì§€ì •í•©ë‹ˆë‹¤.
    -

    TestLink를 사용하여 테스트 ì¼€ì´ìŠ¤ë“¤ì„ í…ŒìŠ¤íŠ¸ 스위트로 정리할 수 있습니다." . -"테스트 스위트는 다른 테스트 스위트와 연계 ë  ìˆ˜ 있으며, 계층ì ì¸ 구조로 만들 수 있습니다. - ë‹¹ì‹ ì€ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì™€ 함께 테스트 스위트 ì •ë³´ë„ ê°™ì´ ì¸ì‡„ í•  수 있습니다.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "테스트 ì¼€ì´ìФ 찾기"; -$TLS_htmltext['searchTc'] = "

    목ì :

    +

    TestLink를 사용하여 테스트 ì¼€ì´ìŠ¤ë“¤ì„ í…ŒìŠ¤íŠ¸ 스위트로 정리할 수 있습니다." . + "테스트 스위트는 다른 테스트 스위트와 연계 ë  ìˆ˜ 있으며, 계층ì ì¸ 구조로 만들 수 있습니다. + ë‹¹ì‹ ì€ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì™€ 함께 테스트 스위트 ì •ë³´ë„ ê°™ì´ ì¸ì‡„ í•  수 있습니다.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "테스트 ì¼€ì´ìФ 찾기"; +$TLS_htmltext['searchTc'] = "

    목ì :

    키워드나 문ìžì—´ì´ í¬í•¨ëœ 테스트 ì¼€ì´ìŠ¤ë¥¼ 찾습니다. ì°¾ì„ ë•Œ 대소문ìžë¥¼ 구별하지 않습니다. 검색결과는 ì´ í…ŒìŠ¤íŠ¸ 프로ì íŠ¸ì— í¬í•¨ëœ 테스트 ì¼€ì´ìŠ¤ë§Œ ë³´ì—¬ ì¤ë‹ˆë‹¤.

    @@ -103,21 +100,20 @@
  • 키워드를 ì„ íƒí•˜ê±°ë‚˜ '사용 안함' 으로 내버려 둡니다.
  • ì°¾ê¸°ë²„íŠ¼ì„ í´ë¦­í•©ë‹ˆë‹¤.
  • 해당하는 테스트 ì¼€ì´ìŠ¤ë“¤ì´ í‘œì‹œë©ë‹ˆë‹¤. ì œëª©ì„ í´ë¦­í•˜ë©´ 편집할 수 있습니다.
  • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "테스트 명세 ì¸ì‡„하기"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

    목ì :

    -

    ì´ í™”ë©´ì—서 í•˜ë‚˜ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ, 테스트 ìŠ¤ìœ„íŠ¸ì˜ ëª¨ë“  테스트 ì¼€ì´ìФ, 테스트 프로ì íŠ¸ë‚˜ +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "테스트 명세 ì¸ì‡„하기"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

    목ì :

    +

    ì´ í™”ë©´ì—서 í•˜ë‚˜ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ, 테스트 ìŠ¤ìœ„íŠ¸ì˜ ëª¨ë“  테스트 ì¼€ì´ìФ, 테스트 프로ì íŠ¸ë‚˜ 테스트 계íšì˜ 모든 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì¸ì‡„í•  수 있습니다.

    시작하기:

    1. -

      표시를 ì›í•˜ëŠ” ë¶€ë¶„ì„ ì˜µì…˜ì—서 ì„ íƒí•˜ê³  난 후, 테스트 ì¼€ì´ìŠ¤ë‚˜ 테스트 스위트 í˜¹ì€ +

      표시를 ì›í•˜ëŠ” ë¶€ë¶„ì„ ì˜µì…˜ì—서 ì„ íƒí•˜ê³  난 후, 테스트 ì¼€ì´ìŠ¤ë‚˜ 테스트 스위트 í˜¹ì€ í…ŒìŠ¤íŠ¸ 프로ì íŠ¸ë¥¼ ì„ íƒí•©ë‹ˆë‹¤. 그러면 ì¸ì‡„í•  수 있는 í™”ë©´ì´ ë‚˜íƒ€ë‚©ë‹ˆë‹¤.

    2. -
    3. 문서 ì˜µì…˜ì˜ \"문서 형ì‹\" ì—서 HTML, OpenOffice Writer ë˜ëŠ” MS Word 문서 중 ì›í•˜ëŠ” +

    4. 문서 ì˜µì…˜ì˜ \"문서 형ì‹\" ì—서 HTML, OpenOffice Writer ë˜ëŠ” MS Word 문서 중 ì›í•˜ëŠ” 형ì‹ì„ ì„ íƒ í•©ë‹ˆë‹¤. 보다 ìžì„¸í•œ 정보는 ë„ì›€ë§ ì„ ì°¸ê³  하세요.

      @@ -125,12 +121,11 @@
    5. í™”ë©´ì— ë‚˜íƒ€ë‚œ 정보를 브ë¼ìš°ì €ì˜ ì¸ì‡„ ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ì—¬ 실제 ì¸ì‡„하세요.
      노트: 오른쪽 화면만 출력하ë„ë¡ ì„¤ì • 하시기 ë°”ëžë‹ˆë‹¤.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "요구사항 명세 설계하기"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

    ë‹¹ì‹ ì€ ìš”êµ¬ì‚¬í•­ 명세서를 관리할 수 있습니다.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "요구사항 명세 설계하기"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

    ë‹¹ì‹ ì€ ìš”êµ¬ì‚¬í•­ 명세서를 관리할 수 있습니다.

    요구사항 명세

    @@ -139,7 +134,7 @@ 그래서, ëª…ì„¸ì˜ ì œëª© ë’¤ì— ë¬¸ì„œì˜ ë²„ì „ì„ ê¸°ìž¬ í•  수 있습니다. 사용ìžëŠ” 간단한 설명ì´ë‚˜ 노트를 범위 í•„ë“œì— ê¸°ìž¬í•  수 있습니다.

    -

    모든 ìš”êµ¬ì‚¬í•­ì˜ ê°œìˆ˜ëŠ” 모든 ìš”êµ¬ì‚¬í•­ì´ +

    모든 ìš”êµ¬ì‚¬í•­ì˜ ê°œìˆ˜ëŠ” 모든 ìš”êµ¬ì‚¬í•­ì´ TestLinkì— ì¶”ê°€ ë˜ì§€ ì•Šì•˜ì„ ê²½ìš°, ìš”êµ¬ì‚¬í•­ì˜ ì»¤ë²„ë¦¬ì§€ë¥¼ í‰ê°€í•˜ê¸° 위해 제공ë©ë‹ˆë‹¤. ì´ ê°’ì´ 0ì´ë©´ TestLinkì— ë“±ë¡ëœ ìš”êµ¬ì‚¬í•­ì˜ í˜„ìž¬ 개수가 ë§¤íŠ¸ë¦­ì— ì‚¬ìš©ë©ë‹ˆë‹¤.

    예제) SRSì— ëª¨ë‘ 200ê°œì˜ ìš”êµ¬ì‚¬í•­ì´ ìžˆëŠ”ë°, ê·¸ 중 50개만 TestLinkì— ì¶”ê°€ ë˜ì—ˆìŠµë‹ˆë‹¤. @@ -148,51 +143,49 @@

    요구사항

    -

    ì™¼ìª½ì˜ íŠ¸ë¦¬ì—서 요구사항 ëª…ì„¸ì˜ ì œëª©ì„ í´ë¦­í•˜ì„¸ìš”. 만약 등ë¡ëœ 요구사항 명세가 없으면, " . -"프로ì íЏ ì´ë¦„ì„ í´ë¦­í•´ì„œ ìƒì„± 하세요. ë‹¹ì‹ ì€ ìš”êµ¬ì‚¬í•­ì„ ìƒì„±, 편집, 삭제하거나 +

    ì™¼ìª½ì˜ íŠ¸ë¦¬ì—서 요구사항 ëª…ì„¸ì˜ ì œëª©ì„ í´ë¦­í•˜ì„¸ìš”. 만약 등ë¡ëœ 요구사항 명세가 없으면, " . + "프로ì íЏ ì´ë¦„ì„ í´ë¦­í•´ì„œ ìƒì„± 하세요. ë‹¹ì‹ ì€ ìš”êµ¬ì‚¬í•­ì„ ìƒì„±, 편집, 삭제하거나 문서로부터 가져올 ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. ê°ê°ì˜ ìš”êµ¬ì‚¬í•­ì€ ì œëª©, 범위, ìƒíƒœ 값으로 ì´ë£¨ì–´ì ¸ 있습니다. -ìƒíƒœëŠ” '보통' ë˜ëŠ” '테스트 í•  수 ì—†ìŒ' 중 하나가 ë©ë‹ˆë‹¤. 테스트 í•  수 없는 ìš”êµ¬ì‚¬í•­ë“¤ì€ ë§¤íŠ¸ë¦­ì— +ìƒíƒœëŠ” '보통' ë˜ëŠ” '테스트 í•  수 ì—†ìŒ' 중 하나가 ë©ë‹ˆë‹¤. 테스트 í•  수 없는 ìš”êµ¬ì‚¬í•­ë“¤ì€ ë§¤íŠ¸ë¦­ì— í¬í•¨ë˜ì§€ 않습니다. 구현할 수 없는 기능ì´ë‚˜ 잘 못 ì„¤ê³„ëœ ìš”êµ¬ì‚¬í•­ë“¤ì„ '테스트 í•  수 ì—†ìŒ'으로 표시 하면 ë©ë‹ˆë‹¤.

    ë‹¹ì‹ ì€ ëª…ì„¸ 화면ì—서 ìš”êµ¬ì‚¬í•­ë“¤ì„ ì—¬ëŸ¬ê°œ ì„ íƒí•˜ì—¬ 새로운 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ìƒì„±í•  수 있습니다. ì´ë ‡ê²Œ ìƒì„±ëœ 테스트 ì¼€ì´ìŠ¤ë“¤ì€ í™˜ê²½ì„¤ì •ì— ì •ì˜ëœ ì´ë¦„ì˜ í…ŒìŠ¤íŠ¸ ìŠ¤ìœ„íŠ¸ì— í¬í•¨ë©ë‹ˆë‹¤. (기본값 : \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). 제목과 범위가 테스트 ì¼€ì´ìŠ¤ë¡œ 복사 ë©ë‹ˆë‹¤.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "키워드 지정하기"; -$TLS_htmltext['keywordsAssign'] = "

    목ì :

    -

    키워드 지정 í™”ë©´ì€ í…ŒìŠ¤íŠ¸ 스위트나 테스트 ì¼€ì´ìŠ¤ì— í‚¤ì›Œë“œë¥¼ +'Test suite created by Requirement - Auto';). 제목과 범위가 테스트 ì¼€ì´ìŠ¤ë¡œ 복사 ë©ë‹ˆë‹¤.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "키워드 지정하기"; +$TLS_htmltext['keywordsAssign'] = "

    목ì :

    +

    키워드 지정 í™”ë©´ì€ í…ŒìŠ¤íŠ¸ 스위트나 테스트 ì¼€ì´ìŠ¤ì— í‚¤ì›Œë“œë¥¼ ì¼ê´„ì ìœ¼ë¡œ 지정할 수 있는 곳입니다.

    키워드 지정하기:

    1. ì™¼ìª½ì˜ íŠ¸ë¦¬ì—서 테스트 스위트나 테스트 ì¼€ì´ìŠ¤ë¥¼ ì„ íƒí•©ë‹ˆë‹¤.
    2. -
    3. 오른쪽 í™”ë©´ì˜ ì œì¼ ìœ—ë¶€ë¶„ì—서 테스트 ì¼€ì´ìŠ¤ì— ì‚¬ìš©ê°€ëŠ¥í•œ 키워드를 +
    4. 오른쪽 í™”ë©´ì˜ ì œì¼ ìœ—ë¶€ë¶„ì—서 테스트 ì¼€ì´ìŠ¤ì— ì‚¬ìš©ê°€ëŠ¥í•œ 키워드를 지정할 수 있습니다.
    5. 아래 ì„ íƒí™”ë©´ì—서 보다 세부ì ìœ¼ë¡œ 지정할 수 있습니다.

    테스트 계íšì—서 키워드 ì§€ì •ì— ëŒ€í•œ 중요한 ì •ë³´:

    ëª…ì„¸ì— ëŒ€í•œ 키워드 ì§€ì •ì€ í…ŒìŠ¤íŠ¸ 계íšì— í¬í•¨ëœ 최신 ë²„ì „ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФì—ë§Œ ì˜í–¥ì„ 미칩니다. -만약 테스트 계íšì— ì´ì „ ë²„ì „ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ í¬í•¨ë˜ì–´ 있으면, ë‹¹ì‹ ì´ ì§€ì •í•œ 키워드가 +만약 테스트 계íšì— ì´ì „ ë²„ì „ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ í¬í•¨ë˜ì–´ 있으면, ë‹¹ì‹ ì´ ì§€ì •í•œ 키워드가 테스트 계íšì— 표시 ë˜ì§€ ì•Šì„ ê²ƒìž…ë‹ˆë‹¤.

    -

    TestLinkê°€ ì´ëŸ° ì ‘ê·¼ë°©ë²•ì„ ì‚¬ìš©í•˜ê¸° 때문ì—, 테스트 ì¼€ì´ìŠ¤ì— ìžˆëŠ” ì´ì „ 버전 테스트 ì¼€ì´ìŠ¤ë“¤ì€ +

    TestLinkê°€ ì´ëŸ° ì ‘ê·¼ë°©ë²•ì„ ì‚¬ìš©í•˜ê¸° 때문ì—, 테스트 ì¼€ì´ìŠ¤ì— ìžˆëŠ” ì´ì „ 버전 테스트 ì¼€ì´ìŠ¤ë“¤ì€ ê°€ìž¥ 최근 ë²„ì „ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— ì§€ì •ëœ í‚¤ì›Œë“œê°€ 지정 ë  ìˆ˜ 없습니다. 테스트 계íšì˜ 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì—…ë°ì´íЏ 하려면, '테스트 ì¼€ì´ìФ 버전 업그레ì´ë“œ'를 ì´ìš©í•˜ì—¬ ì—…ë°ì´íЏ 후 키워드 ì§€ì •ì„ ì‚¬ìš©í•˜ì‹œê¸° -ë°”ëžë‹ˆë‹¤.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "테스트 ì¼€ì´ìФ 실행"; -$TLS_htmltext['executeTest'] = "

    목ì :

    +ë°”ëžë‹ˆë‹¤.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "테스트 ì¼€ì´ìФ 실행"; +$TLS_htmltext['executeTest'] = "

    목ì :

    사용ìžê°€ 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì‹¤í–‰í•˜ëŠ” 곳입니다. 사용ìžëŠ” ì„ íƒëœ ë¹Œë“œì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— ì‹¤í–‰ê²°ê³¼ë¥¼ -지정할 수 있습니다. 필터와 ì„¤ì •ì— ëŒ€í•œ ìžì„¸í•œ ì‚¬í•­ì€ ë„움ë§ì„ 참고 하세요 " . - "(물ìŒí‘œ ì•„ì´ì½˜ì„ í´ë¦­í•˜ì„¸ìš”).

    +지정할 수 있습니다. 필터와 ì„¤ì •ì— ëŒ€í•œ ìžì„¸í•œ ì‚¬í•­ì€ ë„움ë§ì„ 참고 하세요 " . + "(물ìŒí‘œ ì•„ì´ì½˜ì„ í´ë¦­í•˜ì„¸ìš”).

    시작하기:

    @@ -203,13 +196,13 @@
  • 테스트 결과와 실행 노트 ë˜ëŠ” 버그를 기ë¡í•©ë‹ˆë‹¤.
  • 결과를 저장합니다.
  • -

    노트: GUIì—서 ì§ì ‘ 버그를 ìƒì„±/ì¶”ì í•˜ë ¤ë©´, TestLinkê°€ 버그 ì¶”ì  ì‹œìŠ¤í…œê³¼ ì—°ë™ ë˜ë„ë¡ -설정ë˜ì–´ 있어야 합니다.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "테스트 보고서와 ë§¤íŠ¸ë¦­ì— ëŒ€í•œ 설명"; -$TLS_htmltext['showMetrics'] = "

    네티게ì´í„°ì˜ ìœ—ë¶€ë¶„ì— ì„ íƒëœ " . - "테스트 계íšì— 대한 보고서들 입니다. 현재 실행하는 테스트 ê³„íš ë§ê³  다른 테스트 계íšì„ ì„ íƒí•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. +

    노트: GUIì—서 ì§ì ‘ 버그를 ìƒì„±/ì¶”ì í•˜ë ¤ë©´, TestLinkê°€ 버그 ì¶”ì  ì‹œìŠ¤í…œê³¼ ì—°ë™ ë˜ë„ë¡ +설정ë˜ì–´ 있어야 합니다.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "테스트 보고서와 ë§¤íŠ¸ë¦­ì— ëŒ€í•œ 설명"; +$TLS_htmltext['showMetrics'] = "

    네티게ì´í„°ì˜ ìœ—ë¶€ë¶„ì— ì„ íƒëœ " . + "테스트 계íšì— 대한 보고서들 입니다. 현재 실행하는 테스트 ê³„íš ë§ê³  다른 테스트 계íšì„ ì„ íƒí•  ìˆ˜ë„ ìžˆìŠµë‹ˆë‹¤. 다ìŒê³¼ ê°™ì€ ë³´ê³ ì„œ 종류를 ì„ íƒí•  수 있습니다:

    • HTML - 웹페ì´ì§€ë¡œ 표시ë˜ëŠ” 보고서
    • @@ -231,17 +224,17 @@ 여기ì—는 테스트 ì¼€ì´ìŠ¤ë“¤ì˜ ê²°ê³¼ë„ í‘œì‹œí•  수 있습니다.

      ì¼ë°˜ì ì¸ 테스트 계íšì˜ 매트릭

      -

      ì´ íŽ˜ì´ì§€ì—서 테스트 계íšì˜ 가장 최근 ìƒíƒœë¥¼ 테스트 스위트별, 담당ìžë³„, 키워드별로 ë³¼ 수 있습니다. -'현재 ìƒíƒœ'는 가장 최근 ë¹Œë“œì˜ ì‹¤í–‰ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì— ì˜í•´ ê²°ì • ë©ë‹ˆë‹¤. 예를 들어, 테스트 ì¼€ì´ìŠ¤ê°€ +

      ì´ íŽ˜ì´ì§€ì—서 테스트 계íšì˜ 가장 최근 ìƒíƒœë¥¼ 테스트 스위트별, 담당ìžë³„, 키워드별로 ë³¼ 수 있습니다. +'현재 ìƒíƒœ'는 가장 최근 ë¹Œë“œì˜ ì‹¤í–‰ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë“¤ì— ì˜í•´ ê²°ì • ë©ë‹ˆë‹¤. 예를 들어, 테스트 ì¼€ì´ìŠ¤ê°€ 여러 ë¹Œë“œë“¤ì— ê±¸ì³ ì‹¤í–‰ ë˜ì—ˆì„ 경우, 가장 마지막 결과만 가져 오게 ë©ë‹ˆë‹¤.

      '마지막 테스트 ê²°ê³¼'는 ë§Žì€ ë³´ê³ ì„œë“¤ì—서 사용ë˜ëŠ” ê°œë…으로, 아래와 ê°™ì´ ì •ì˜ ë©ë‹ˆë‹¤ :

        -
      • 테스트 계íšì— ì¶”ê°€ëœ ë¹Œë“œì˜ ìˆœì„œê°€ 가장 최근 빌드를 결정합니다. 가장 최근 ë¹Œë“œì˜ ê²°ê³¼ê°€ 모든 ì´ì „ -ë¹Œë“œë“¤ì˜ ê²°ê³¼ê°’ì„ ëŒ€í‘œí•©ë‹ˆë‹¤. 예를 들면, 빌드 1ì—서는 '실패'로 íŒì •하고, 빌드 2ì—서는 '통과'로 íŒì • 했다면 +
      • 테스트 계íšì— ì¶”ê°€ëœ ë¹Œë“œì˜ ìˆœì„œê°€ 가장 최근 빌드를 결정합니다. 가장 최근 ë¹Œë“œì˜ ê²°ê³¼ê°€ 모든 ì´ì „ +ë¹Œë“œë“¤ì˜ ê²°ê³¼ê°’ì„ ëŒ€í‘œí•©ë‹ˆë‹¤. 예를 들면, 빌드 1ì—서는 '실패'로 íŒì •하고, 빌드 2ì—서는 '통과'로 íŒì • 했다면 최종 결과는 '통과'ê°€ ë©ë‹ˆë‹¤.
      • -
      • 만약 테스트 ì¼€ì´ìŠ¤ê°€ ê°™ì€ ë¹Œë“œì—서 여러번 ì‹¤í–‰ë  ê²½ìš°, 가장 ìµœê·¼ì˜ ì‹¤í–‰ê²°ê³¼ ê°’ì„ ì‚¬ìš©í•©ë‹ˆë‹¤. -예를 들면, 빌드 3ì´ ì—¬ëŸ¬ë¶„ì˜ íŒ€ì— ë¦´ë¦¬ì¦ˆê°€ ë˜ê³  테스터 1ì´ ì˜¤í›„2ì‹œì— '통과' íŒì •ì„ í•˜ê³ , 테스터 2ê°€ +
      • 만약 테스트 ì¼€ì´ìŠ¤ê°€ ê°™ì€ ë¹Œë“œì—서 여러번 ì‹¤í–‰ë  ê²½ìš°, 가장 ìµœê·¼ì˜ ì‹¤í–‰ê²°ê³¼ ê°’ì„ ì‚¬ìš©í•©ë‹ˆë‹¤. +예를 들면, 빌드 3ì´ ì—¬ëŸ¬ë¶„ì˜ íŒ€ì— ë¦´ë¦¬ì¦ˆê°€ ë˜ê³  테스터 1ì´ ì˜¤í›„2ì‹œì— '통과' íŒì •ì„ í•˜ê³ , 테스터 2ê°€ 오후3ì‹œì— '실패' íŒì •ì„ í•˜ë©´, 최종 결과는 '실패'ê°€ ë©ë‹ˆë‹¤.
      • 빌드ì—서 '실행 안함'ìƒíƒœì¸ 테스트 ì¼€ì´ìŠ¤ëŠ” ê²°ê³¼ ê³„ì‚°ì— í¬í•¨ë˜ì§€ 않습니다. 예를 들면, 빌드 1ì—서 '통과'로 íŒì •하고, 빌드 2ì—서 실행하지 않으면 최종 결과는 '통과'ê°€ ë©ë‹ˆë‹¤.
      • @@ -260,36 +253,36 @@

      모든 빌드 현황

      -

      모든 ë¹Œë“œì˜ ì‹¤í–‰ê²°ê³¼ë¥¼ 표시합니다. ê°ê°ì˜ ë¹Œë“œì— ëŒ€í•´, TC합계, 통과 합계, 통과 %, 실패 합계, -실패 %, 중단 합계, 중단 %, 실행안함 합계, 실행안함 %를 표시합니다. 만약 테스트 ì¼€ì´ìŠ¤ê°€ ê°™ì€ ë¹Œë“œì—서 +

      모든 ë¹Œë“œì˜ ì‹¤í–‰ê²°ê³¼ë¥¼ 표시합니다. ê°ê°ì˜ ë¹Œë“œì— ëŒ€í•´, TC합계, 통과 합계, 통과 %, 실패 합계, +실패 %, 중단 합계, 중단 %, 실행안함 합계, 실행안함 %를 표시합니다. 만약 테스트 ì¼€ì´ìŠ¤ê°€ ê°™ì€ ë¹Œë“œì—서 ë‘번 실행ë˜ë©´, 가장 ìµœê·¼ì— ì‹¤í–‰í•œ ê²°ê³¼ê°’ì´ ê³„ì‚°ì— ì‚¬ìš© ë©ë‹ˆë‹¤.

      매트릭 질ì˜

      -

      ì´ ë³´ê³ ì„œëŠ” ì§ˆì˜ í¼ í™”ë©´ê³¼ ì¿¼ë¦¬ëœ ìžë£Œë¥¼ í¬í•¨í•œ ì§ˆì˜ ê²°ê³¼ 화면으로 구성 ë˜ì–´ 있습니다. -ì§ˆì˜ í¼ í™”ë©´ì—는 4ê°œì˜ ì»¨íŠ¸ë¡¤ë¡œ ëœ ì§ˆì˜ í™”ë©´ì´ í‘œì‹œë©ë‹ˆë‹¤. ê°ê°ì˜ ì»¨íŠ¸ë¡¤ì€ ìµœëŒ€í•œ ë§Žì€ ë¹Œë“œì™€ -테스트 ì¼€ì´ë“¤ì„ 검색할 수 있는 값으로 초기화 ë˜ì–´ 있습니다. 사용ìžê°€ ì»¨íŠ¸ë¡¤ì˜ ê°’ì„ ë³€ê²½í•˜ì—¬, +

      ì´ ë³´ê³ ì„œëŠ” ì§ˆì˜ í¼ í™”ë©´ê³¼ ì¿¼ë¦¬ëœ ìžë£Œë¥¼ í¬í•¨í•œ ì§ˆì˜ ê²°ê³¼ 화면으로 구성 ë˜ì–´ 있습니다. +ì§ˆì˜ í¼ í™”ë©´ì—는 4ê°œì˜ ì»¨íŠ¸ë¡¤ë¡œ ëœ ì§ˆì˜ í™”ë©´ì´ í‘œì‹œë©ë‹ˆë‹¤. ê°ê°ì˜ ì»¨íŠ¸ë¡¤ì€ ìµœëŒ€í•œ ë§Žì€ ë¹Œë“œì™€ +테스트 ì¼€ì´ë“¤ì„ 검색할 수 있는 값으로 초기화 ë˜ì–´ 있습니다. 사용ìžê°€ ì»¨íŠ¸ë¡¤ì˜ ê°’ì„ ë³€ê²½í•˜ì—¬, 특정 테스터, 키워드, 스위트, 빌드를 조합하여 보고서를 만들 수 있습니다.

        -
      • 키워드 0~1ê°œì˜ í‚¤ì›Œë“œë“¤ì„ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ì•„ë¬´ í‚¤ì›Œë“œë„ ì„ íƒí•˜ì§€ ì•Šì€ ê²ƒìž…ë‹ˆë‹¤. -만약 키워드가 지정ë˜ì§€ 않으면, 키워드 ì§€ì •ì— ìƒê´€ ì—†ì´ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ê°€ 관련 ë©ë‹ˆë‹¤. 키워드는 -테스트 명세나 키워드 관리 화면ì—서 지정할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ì— í‚¤ì›Œë“œë¥¼ 지정하는 ê²ƒì€ ëª¨ë“  -테스트 계íšë“¤ê³¼ 테스트 ì¼€ì´ìŠ¤ì˜ ëª¨ë“  ë²„ì „ë“¤ì— í•´ë‹¹ ë©ë‹ˆë‹¤. 특정 í‚¤ì›Œë“œì— ëŒ€í•œ ê²°ê³¼ì— í¥ë¯¸ê°€ 있다면 +
      • 키워드 0~1ê°œì˜ í‚¤ì›Œë“œë“¤ì„ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ì•„ë¬´ í‚¤ì›Œë“œë„ ì„ íƒí•˜ì§€ ì•Šì€ ê²ƒìž…ë‹ˆë‹¤. +만약 키워드가 지정ë˜ì§€ 않으면, 키워드 ì§€ì •ì— ìƒê´€ ì—†ì´ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ê°€ 관련 ë©ë‹ˆë‹¤. 키워드는 +테스트 명세나 키워드 관리 화면ì—서 지정할 수 있습니다. 테스트 ì¼€ì´ìŠ¤ì— í‚¤ì›Œë“œë¥¼ 지정하는 ê²ƒì€ ëª¨ë“  +테스트 계íšë“¤ê³¼ 테스트 ì¼€ì´ìŠ¤ì˜ ëª¨ë“  ë²„ì „ë“¤ì— í•´ë‹¹ ë©ë‹ˆë‹¤. 특정 í‚¤ì›Œë“œì— ëŒ€í•œ ê²°ê³¼ì— í¥ë¯¸ê°€ 있다면 ì´ ì»¨íŠ¸ë¡¤ì„ ì„¤ì •í•˜ë©´ ë©ë‹ˆë‹¤.
      • -
      • ë‹´ë‹¹ìž 0~1ëª…ì˜ ë‹´ë‹¹ìžë¥¼ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ì•„ë¬´ë„ ì„ íƒí•˜ì§€ ì•Šì€ ê²ƒ 입니다. -담당ìžê°€ 지정ë˜ì§€ 않으면, ë‹´ë‹¹ìž ì§€ì •ì— ìƒê´€ ì—†ì´ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ê°€ 관련 ë©ë‹ˆë‹¤. 현재 '지정안ë¨'ì¸ -테스트 ì¼€ì´ìŠ¤ë¥¼ 검색할 수 있는 ë°©ë²•ì€ ì—†ìŠµë‹ˆë‹¤. 담당ìžëŠ” '테스트 ì¼€ì´ìФ 실행 지정' 화면ì—서 지정할 수 있으며, +
      • ë‹´ë‹¹ìž 0~1ëª…ì˜ ë‹´ë‹¹ìžë¥¼ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ì•„ë¬´ë„ ì„ íƒí•˜ì§€ ì•Šì€ ê²ƒ 입니다. +담당ìžê°€ 지정ë˜ì§€ 않으면, ë‹´ë‹¹ìž ì§€ì •ì— ìƒê´€ ì—†ì´ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ê°€ 관련 ë©ë‹ˆë‹¤. 현재 '지정안ë¨'ì¸ +테스트 ì¼€ì´ìŠ¤ë¥¼ 검색할 수 있는 ë°©ë²•ì€ ì—†ìŠµë‹ˆë‹¤. 담당ìžëŠ” '테스트 ì¼€ì´ìФ 실행 지정' 화면ì—서 지정할 수 있으며, 테스트 계íšì˜ 기본요소가 ë©ë‹ˆë‹¤. 만약 특정 담당ìžê°€ 실행한 ê²°ê³¼ì— í¥ë¯¸ê°€ 있다면 ì´ ì»¨íŠ¸ë¡¤ì„ ì„¤ì •í•˜ë©´ ë©ë‹ˆë‹¤.
      • 최ìƒìœ„ 스위트 0~nê°œì˜ ìµœìƒìœ„ 스위트를 ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ëª¨ë“  스위트를 ì„ íƒí•˜ëŠ” 것입니다. -ì„ íƒí•œ 스위트들만 ê²°ê³¼ ë§¤íŠ¸ë¦­ì„ ì ˆì˜í•  때 사용합니다. 특정 ìŠ¤ìœ„íŠ¸ì— ëŒ€í•œ ê²°ê³¼ì— í¥ë¯¸ê°€ 있다면 +ì„ íƒí•œ 스위트들만 ê²°ê³¼ ë§¤íŠ¸ë¦­ì„ ì ˆì˜í•  때 사용합니다. 특정 ìŠ¤ìœ„íŠ¸ì— ëŒ€í•œ ê²°ê³¼ì— í¥ë¯¸ê°€ 있다면 ì´ ì»¨íŠ¸ë¡¤ì„ ì„¤ì •í•˜ë©´ ë©ë‹ˆë‹¤.
      • -
      • 빌드 1~nê°œì˜ ë¹Œë“œë¥¼ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ëª¨ë“  빌드를 ì„ íƒí•˜ëŠ” 것입니다. ì„ íƒí•œ 빌드ì—서 -ìˆ˜í–‰ëœ ê²°ê³¼ë§Œ ë§¤íŠ¸ë¦­ì„ ìƒì„±í•˜ëŠ”ë° ì‚¬ìš© ë©ë‹ˆë‹¤. 예를 들어, 마지막 3ê°œì˜ ë¹Œë“œì—서 ëª‡ê°œì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ 수행 +
      • 빌드 1~nê°œì˜ ë¹Œë“œë¥¼ ì„ íƒí•  수 있습니다. ê¸°ë³¸ê°’ì€ ëª¨ë“  빌드를 ì„ íƒí•˜ëŠ” 것입니다. ì„ íƒí•œ 빌드ì—서 +ìˆ˜í–‰ëœ ê²°ê³¼ë§Œ ë§¤íŠ¸ë¦­ì„ ìƒì„±í•˜ëŠ”ë° ì‚¬ìš© ë©ë‹ˆë‹¤. 예를 들어, 마지막 3ê°œì˜ ë¹Œë“œì—서 ëª‡ê°œì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ 수행 ë˜ì—ˆëŠ”ì§€ë¥¼ 보려면, ì´ ì»¨íŠ¸ë¡¤ì„ ì„¤ì •í•˜ì‹œë©´ ë©ë‹ˆë‹¤. -키워드, 담당ìž, 최ìƒìœ„ 스위트를 지정하는 ê²ƒì€ ìŠ¤ìœ„íŠ¸ë³„, 테스트 계íšë³„ ë§¤íŠ¸ë¦­ì„ ê³„ì‚° í•˜ëŠ”ë° ì‚¬ìš©í•˜ëŠ” 테스트 ì¼€ì´ìŠ¤ë“¤ì˜ -개수를 지정하는 것입니다. 예를 들어서, 담당ìžëŠ” 'Greg', 키워드는 'Priority 1', 그리고 모든 가능한 스위트를 지정했다면, -Gregì—게 ì§€ì •ëœ Priority 1ì¸ ê²ƒë“¤ì´ ì‚¬ìš© ë©ë‹ˆë‹¤. '# 테스트 ì¼€ì´ìФ'는 ì´ëŸ° 3가지 ì»¨íŠ¸ë¡¤ì— ì˜í•œ 테스트 ì¼€ì´ìŠ¤ë“¤ì˜ í•©ì„ -나타냅니다. 빌드 ì„ íƒì€ í…Œì´ìŠ¤ì˜ '통과', '실패', '중단', '실행안함' íŒì •ì— ì˜í–¥ì„ 미칩니다. ìœ„ì— ì„¤ëª…í•œ +키워드, 담당ìž, 최ìƒìœ„ 스위트를 지정하는 ê²ƒì€ ìŠ¤ìœ„íŠ¸ë³„, 테스트 계íšë³„ ë§¤íŠ¸ë¦­ì„ ê³„ì‚° í•˜ëŠ”ë° ì‚¬ìš©í•˜ëŠ” 테스트 ì¼€ì´ìŠ¤ë“¤ì˜ +개수를 지정하는 것입니다. 예를 들어서, 담당ìžëŠ” 'Greg', 키워드는 'Priority 1', 그리고 모든 가능한 스위트를 지정했다면, +Gregì—게 ì§€ì •ëœ Priority 1ì¸ ê²ƒë“¤ì´ ì‚¬ìš© ë©ë‹ˆë‹¤. '# 테스트 ì¼€ì´ìФ'는 ì´ëŸ° 3가지 ì»¨íŠ¸ë¡¤ì— ì˜í•œ 테스트 ì¼€ì´ìŠ¤ë“¤ì˜ í•©ì„ +나타냅니다. 빌드 ì„ íƒì€ í…Œì´ìŠ¤ì˜ '통과', '실패', '중단', '실행안함' íŒì •ì— ì˜í–¥ì„ 미칩니다. ìœ„ì— ì„¤ëª…í•œ '마지막 테스트 ê²°ê³¼' ê·œì¹™ì„ ì°¸ê³  하시기 ë°”ëžë‹ˆë‹¤.

      'ì§ˆì˜ ì‹¤í–‰' ë²„íŠ¼ì„ ëˆ„ë¥´ë©´ ê²°ê³¼ í™”ë©´ì´ í‘œì‹œ ë©ë‹ˆë‹¤.

      @@ -299,39 +292,38 @@
    • 보고서를 ìž‘ì„±í•˜ëŠ”ë° ì‚¬ìš©ëœ ì§ˆì˜ íŒŒë¼ë©”í„°
    • ì „ì²´ 테스트 계íšì˜ 합계
    • 스위트 별 ê²°ê³¼ 합계 (í•© / 통과 / 실패 / 중단 / 실행안함) 와 ìŠ¤ìœ„íŠ¸ì˜ ëª¨ë“  실행 ê²°ê³¼. -만약 테스트 ì¼€ì´ìŠ¤ê°€ 여러 빌드ì—서 여러번 실행 ë˜ì—ˆìœ¼ë©´, ì„ íƒëœ 모든 ë¹Œë“œì˜ ì‹¤í–‰ê²°ê³¼ë¥¼ 표시합니다. +만약 테스트 ì¼€ì´ìŠ¤ê°€ 여러 빌드ì—서 여러번 실행 ë˜ì—ˆìœ¼ë©´, ì„ íƒëœ 모든 ë¹Œë“œì˜ ì‹¤í–‰ê²°ê³¼ë¥¼ 표시합니다. 하지만, 테스트 ìŠ¤ìœ„íŠ¸ì˜ ìš”ì•½ì—는 '마지막 테스트 ê²°ê³¼'ë§Œ í¬í•¨ë©ë‹ˆë‹¤.
    • 중단, 실패, 실행하지 ì•Šì€ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ 보고서들

      -

      ì´ ë³´ê³ ì„œëŠ” 현재 중단, 실패, ì‹¤í–‰ì•ˆë¨ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ë¥¼ ë³´ì—¬ ì¤ë‹ˆë‹¤. (ì¼ë°˜ì ì¸ 테스트 ê³„íš ë§¤íŠ¸ë¦­ì—서 -설명했ë˜)'마지막 테스트 ê²°ê³¼'논리는 ì´ ê³³ì—ì„œë„ ì‚¬ìš© ë©ë‹ˆë‹¤. 중단 ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ 보고서와 ì‹¤íŒ¨ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ +

      ì´ ë³´ê³ ì„œëŠ” 현재 중단, 실패, ì‹¤í–‰ì•ˆë¨ ëª¨ë“  테스트 ì¼€ì´ìŠ¤ë¥¼ ë³´ì—¬ ì¤ë‹ˆë‹¤. (ì¼ë°˜ì ì¸ 테스트 ê³„íš ë§¤íŠ¸ë¦­ì—서 +설명했ë˜)'마지막 테스트 ê²°ê³¼'논리는 ì´ ê³³ì—ì„œë„ ì‚¬ìš© ë©ë‹ˆë‹¤. 중단 ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ 보고서와 ì‹¤íŒ¨ëœ í…ŒìŠ¤íŠ¸ ì¼€ì´ìФ 보고서ì—서는 버그 ì¶”ì  ì‹œìŠ¤í…œì´ ì„¤ì • ë˜ì–´ ìžˆì„ ê²½ìš° ë²„ê·¸ì˜ ì—°ê²°ê´€ê³„ë„ ë³´ì—¬ ì¤ë‹ˆë‹¤.

      테스트 보고서

      -

      테스트 ì¼€ì´ìŠ¤ì˜ ëª¨ë“  ë¹Œë“œì˜ ìƒíƒœë¥¼ ë³¼ 수 있습니다. ê°™ì€ ë¹Œë“œì—서 여러번 ì‹¤í–‰ì´ ë˜ì—ˆë‹¤ë©´ -가장 ìµœê·¼ì˜ ì‹¤í–‰ ê²°ê³¼ 사용 ë©ë‹ˆë‹¤. ìžë£Œì˜ ì–‘ì´ ë§Žë‹¤ë©´ 보다 쉽게 보고서를 보기 위해 엑셀로 내보내기 í•  ê²ƒì„ +

      테스트 ì¼€ì´ìŠ¤ì˜ ëª¨ë“  ë¹Œë“œì˜ ìƒíƒœë¥¼ ë³¼ 수 있습니다. ê°™ì€ ë¹Œë“œì—서 여러번 ì‹¤í–‰ì´ ë˜ì—ˆë‹¤ë©´ +가장 ìµœê·¼ì˜ ì‹¤í–‰ ê²°ê³¼ 사용 ë©ë‹ˆë‹¤. ìžë£Œì˜ ì–‘ì´ ë§Žë‹¤ë©´ 보다 쉽게 보고서를 보기 위해 엑셀로 내보내기 í•  ê²ƒì„ ê¶Œê³ í•©ë‹ˆë‹¤.

      차트 - ì¼ë°˜ì ì¸ 테스트 ê³„íš ë§¤íŠ¸ë¦­

      -

      차트ì—ì„œë„ '마지막 테스트 ê²°ê³¼' 논리가 사용ë©ë‹ˆë‹¤. 현재 테스트 계íšì˜ ë§¤íŠ¸ë¦­ì„ ì‹œê°ì ìœ¼ë¡œ 보여주기 위해 +

      차트ì—ì„œë„ '마지막 테스트 ê²°ê³¼' 논리가 사용ë©ë‹ˆë‹¤. 현재 테스트 계íšì˜ ë§¤íŠ¸ë¦­ì„ ì‹œê°ì ìœ¼ë¡œ 보여주기 위해 그래프가 움ì§ìž…니다. 다ìŒê³¼ ê°™ì€ 4가지 차트가 제공 ë©ë‹ˆë‹¤ :

      • 모든 성공 / 실패 / 중단 / 실행안함 ì— ëŒ€í•œ íŒŒì´ ì°¨íŠ¸
      • 키워드별 ê²°ê³¼ 막대 차트
      • 테스터별 ê²°ê³¼ 막대 차트
      • 최ìƒìœ„ 스위트별 ê²°ê³¼ 막대 차트
      -

      막대 ì°¨íŠ¸ì— ìžˆëŠ” ë§‰ëŒ€ë“¤ì€ í†µê³¼, 실패, 중단, 실행안한 ì¼€ì´ìŠ¤ë“¤ì˜ ëŒ€ê°•ì˜ ìˆ«ìžë¥¼ ì •ì˜í•  수 있으며 +

      막대 ì°¨íŠ¸ì— ìžˆëŠ” ë§‰ëŒ€ë“¤ì€ í†µê³¼, 실패, 중단, 실행안한 ì¼€ì´ìŠ¤ë“¤ì˜ ëŒ€ê°•ì˜ ìˆ«ìžë¥¼ ì •ì˜í•  수 있으며 색으로 구별 ë˜ì–´ 있습니다.

      ê° í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ì— ëŒ€í•œ 모든 버그들

      -

      ì´ ë³´ê³ ì„œëŠ” 현재 프로ì íЏì—서 버그 필드가 값으로 채워져 있는 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ë³´ì—¬ ì¤ë‹ˆë‹¤. -ì´ ë³´ê³ ì„œëŠ” 버그 ì¶”ì  ì‹œìŠ¤í…œì´ ì—°ê²° ë˜ì–´ 있어야 사용할 수 있습니다.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "테스트 계íšì— 테스트 ì¼€ì´ìФ 추가 / 삭제하기"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

      목ì :

      +

      ì´ ë³´ê³ ì„œëŠ” 현재 프로ì íЏì—서 버그 필드가 값으로 채워져 있는 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ë³´ì—¬ ì¤ë‹ˆë‹¤. +ì´ ë³´ê³ ì„œëŠ” 버그 ì¶”ì  ì‹œìŠ¤í…œì´ ì—°ê²° ë˜ì–´ 있어야 사용할 수 있습니다.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "테스트 계íšì— 테스트 ì¼€ì´ìФ 추가 / 삭제하기"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

      목ì :

      (리드 레벨 ê¶Œí•œì„ ê°€ì§„) 사용ìžëŠ” 테스트 계íšì— 테스트 ì¼€ì´ìŠ¤ë¥¼ 추가하거나 삭제할 수 있습니다..

      테스트 ì¼€ì´ìФ 추가 / 삭제하기:

      @@ -339,11 +331,11 @@
    • 테스트 스위트를 í´ë¦­í•˜ì—¬ ê·¸ì†ì— í¬í•¨ëœ 모든 테스트 스위트들과 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ë³´ì´ê²Œ 합니다.
    • 테스트 ì¼€ì´ìŠ¤ë“¤ì„ ì„ íƒí•˜ê³  '테스트 ì¼€ì´ìФ 추가 / ì‚­ì œ' ë²„íŠ¼ì„ í´ë¦­í•©ë‹ˆë‹¤. 노트: ê°™ì€ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ë¥¼ 여러번 추가 í•  수 없습니다.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "테스트를 실행할 테스터 지정하기"; -$TLS_htmltext['tc_exec_assignment'] = "

      목ì 

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "테스트를 실행할 테스터 지정하기"; +$TLS_htmltext['tc_exec_assignment'] = "

      목ì 

      ì´ í™”ë©´ì—서 테스트 리ë”는 테스트 계íšì˜ 개별 í…ŒìŠ¤íŠ¸ë“¤ì„ ì‚¬ìš©ìžì—게 지정할 수 있습니다.

      시작하기

      @@ -352,16 +344,15 @@
    • 테스터를 ì„ íƒí•©ë‹ˆë‹¤.
    • 저장 ë²„íŠ¼ì„ í´ë¦­í•©ë‹ˆë‹¤.
    • ì§€ì •ëœ ì‚¬í•­ì„ í™•ì¸í•˜ë ¤ë©´ 실행 페ì´ì§€ë¥¼ ì—´ì–´ 보시기 ë°”ëžë‹ˆë‹¤. 특정 사용ìžê°€ ì§€ì •ëœ ê²ƒë§Œ 보려면 필터를 설정하면 ë©ë‹ˆë‹¤.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "테스트 계íšì˜ 테스트 ì¼€ì´ìŠ¤ë“¤ ì—…ë°ì´íŠ¸í•˜ê¸°"; -$TLS_htmltext['planUpdateTC'] = "

      목ì 

      -

      테스트 명세가 변경 ë˜ì—ˆì„ 경우, ì´ íŽ˜ì´ì§€ì—서 테스트 ì¼€ì´ìŠ¤ë¥¼ 새 버전으로 ì—…ë°ì´íЏ -í•  수 있습니다. 테스트 ë„중 ì–´ë–¤ ê¸°ëŠ¥ì´ êµ¬ì²´í™” ë˜ë©´ì„œ ì´ëŸ° 경우가 ë°œìƒí•  수 있습니다." . - " 사용ìžëŠ” 테스트 명세를 변경할 경우, 테스트 ê³„íš ì—­ì‹œ 변경해야 합니다. 그렇지 않으면, 테스트" . - " 계íšì—는 여전히 ì›ëž˜ ë²„ì „ì´ ìžˆê²Œ ë©ë‹ˆë‹¤.

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "테스트 계íšì˜ 테스트 ì¼€ì´ìŠ¤ë“¤ ì—…ë°ì´íŠ¸í•˜ê¸°"; +$TLS_htmltext['planUpdateTC'] = "

      목ì 

      +

      테스트 명세가 변경 ë˜ì—ˆì„ 경우, ì´ íŽ˜ì´ì§€ì—서 테스트 ì¼€ì´ìŠ¤ë¥¼ 새 버전으로 ì—…ë°ì´íЏ +í•  수 있습니다. 테스트 ë„중 ì–´ë–¤ ê¸°ëŠ¥ì´ êµ¬ì²´í™” ë˜ë©´ì„œ ì´ëŸ° 경우가 ë°œìƒí•  수 있습니다." . + " 사용ìžëŠ” 테스트 명세를 변경할 경우, 테스트 ê³„íš ì—­ì‹œ 변경해야 합니다. 그렇지 않으면, 테스트" . + " 계íšì—는 여전히 ì›ëž˜ ë²„ì „ì´ ìžˆê²Œ ë©ë‹ˆë‹¤.

      시작하기

        @@ -369,29 +360,27 @@
      1. 개별 테스트 ì¼€ì´ìŠ¤ì˜ ìƒˆ 버전 콤보박스ì—서 ë²„ì „ì„ ì„ íƒí•©ë‹ˆë‹¤.
      2. '테스트 ê³„íš ì—…ë°ì´íЏ'ë²„íŠ¼ì„ ëˆŒëŸ¬ 변경 ì‚¬í•­ì„ ì €ìž¥í•©ë‹ˆë‹¤.
      3. 확ì¸ë°©ë²•: 실행 페ì´ì§€ë¥¼ 열어서 테스트 ì¼€ì´ìŠ¤ì˜ ë‚´ìš©ì„ í™•ì¸í•˜ì„¸ìš”.
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "í…ŒìŠ¤íŠ¸ì˜ ê¸´ê¸‰ë„를 높거나 낮게 설정하기"; -$TLS_htmltext['test_urgency'] = "

      목ì 

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "í…ŒìŠ¤íŠ¸ì˜ ê¸´ê¸‰ë„를 높거나 낮게 설정하기"; +$TLS_htmltext['test_urgency'] = "

      목ì 

      TestLink는 테스트 ì¼€ì´ìŠ¤ì˜ ìš°ì„ ìˆœìœ„ì— ì˜í–¥ì„ 미치는 테스트 ìŠ¤ìœ„íŠ¸ì˜ ê¸´ê¸‰ë„를 설정할 수 있습니다. -테스트 우선순위는 테스트 ì¼€ì´ìŠ¤ì˜ ì¤‘ìš”ë„와 테스트 계íšì˜ 긴급ë„ì— ë”°ë¼ ê²°ì •ë©ë‹ˆë‹¤. 테스트 리ë”는 -특정 테스트 ì¼€ì´ìŠ¤ë“¤ì´ ë¨¼ì € 실행 ë˜ë„ë¡ ì„¤ì • í•  수 있습니다. ì´ ê¸°ëŠ¥ì€ ì‹œê°„ì´ ì´‰ë°•í•  +테스트 우선순위는 테스트 ì¼€ì´ìŠ¤ì˜ ì¤‘ìš”ë„와 테스트 계íšì˜ 긴급ë„ì— ë”°ë¼ ê²°ì •ë©ë‹ˆë‹¤. 테스트 리ë”는 +특정 테스트 ì¼€ì´ìŠ¤ë“¤ì´ ë¨¼ì € 실행 ë˜ë„ë¡ ì„¤ì • í•  수 있습니다. ì´ ê¸°ëŠ¥ì€ ì‹œê°„ì´ ì´‰ë°•í•  경우ì—ë„ ê°€ìž¥ 중요한 테스트 ë“¤ì„ ë°˜ë“œì‹œ 수행하ë„ë¡ í•˜ëŠ”ë° ë„ì›€ì„ ì¤ë‹ˆë‹¤.

      시작하기

      1. ì™¼ìª½ì˜ ë„¤ë¹„ê²Œì´í„°ì—서 긴급ㄷë„를 설정할 테스트 스위트를 ì„ íƒí•˜ì„¸ìš”.
      2. -
      3. ê¸´ê¸‰ë ˆë²¨ì„ ì„ íƒí•˜ì„¸ìš” (높ìŒ, 보통, ë‚®ìŒ). ë³´í†µì´ ê¸°ë³¸ê°’ìž…ë‹ˆë‹¤. - 사용빈ë„ê°€ 떨어지는 것ì—는 우선순위를 낮추고, 중요한 ë³€ê²½ì´ ìžˆëŠ” ê³³ì€ ìš°ì„ ìˆœìœ„ë¥¼ +
      4. ê¸´ê¸‰ë ˆë²¨ì„ ì„ íƒí•˜ì„¸ìš” (높ìŒ, 보통, ë‚®ìŒ). ë³´í†µì´ ê¸°ë³¸ê°’ìž…ë‹ˆë‹¤. + 사용빈ë„ê°€ 떨어지는 것ì—는 우선순위를 낮추고, 중요한 ë³€ê²½ì´ ìžˆëŠ” ê³³ì€ ìš°ì„ ìˆœìœ„ë¥¼ ë†’ì¼ ìˆ˜ 있습니다.
      5. '저장' ë²„íŠ¼ì„ í´ë¦­í•˜ì—¬ 변경 ì‚¬í•­ì„ ì €ìž¥í•©ë‹ˆë‹¤.
      -

      예를 들어, ë‚®ì€ ê¸´ê¸‰ë„ì˜ í…ŒìŠ¤íŠ¸ 스위트 ì•ˆì— ë†’ì€ ì¤‘ìš”ë„ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ 있으면, " . - "우선순위는 보통으로 설정 ë©ë‹ˆë‹¤."; - - -// ------------------------------------------------------------------------------------------ - +

      예를 들어, ë‚®ì€ ê¸´ê¸‰ë„ì˜ í…ŒìŠ¤íŠ¸ 스위트 ì•ˆì— ë†’ì€ ì¤‘ìš”ë„ì˜ í…ŒìŠ¤íŠ¸ ì¼€ì´ìŠ¤ê°€ 있으면, " . + "우선순위는 보통으로 설정 ë©ë‹ˆë‹¤."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/nl_NL/description.php b/locale/nl_NL/description.php index cb76ff8829..ca5bdf912a 100644 --- a/locale/nl_NL/description.php +++ b/locale/nl_NL/description.php @@ -1,43 +1,42 @@ -Opties voor een gegenereerd document -

      In deze tabel kan de gebruiker testcases filteren voordat ze worden bekeken. +

      In deze tabel kan de gebruiker testcases filteren voordat ze worden bekeken. Geselecteerde (aangevinkte) gegevens zullen worden getoond. Om de voorgestelde gegevens te wijzigen, , vink aan of uit, klikt u op Filter, en selecteer het gewenste data niveau van de boom.

      -

      Document Hoofding: Gebruikers kunnen informatie in de hoofding filteren. -Document hoofding informatie omvat: inleiding, bereik, referenties, +

      Document Hoofding: Gebruikers kunnen informatie in de hoofding filteren. +Document hoofding informatie omvat: inleiding, bereik, referenties, testmethodologie en test beperkingen.

      Testcase Body: Gebruikers kunnen testcase body informatie filteren. Testcase Body informatie @@ -52,35 +51,35 @@

      Inhoudsopgave: TestLink voegt een overzicht toe van alle geselecteerde titels met interne hyperlinks

      -

      Uitvoerformaat: Er zijn twee mogelijkheden: HTML en MS Word. Browser roept MS Word component aan -in het tweede geval.

      "; - -// testPlan.html +

      Uitvoerformaat: Er zijn twee mogelijkheden: HTML en MS Word. Browser roept MS Word component aan +in het tweede geval.

      "; + +// testPlan.html $TLS_hlp_testPlan = "

      Testplan

      Algemeen

      -

      Een testplan is een systematische aanpak voor het testen van een systeem zoals software. U kunt het testen van de activiteit organiseren +

      Een testplan is een systematische aanpak voor het testen van een systeem zoals software. U kunt het testen van de activiteit organiseren met bepaalde builds van het product in de tijd en resultaten traceren.

      Tests Uitvoeren

      -

      Dit gedeelte is waar de gebruikers testcases kunnen uitvoeren (testresultaten schrijven) en -een testcase suite van het testplan afdrukken. Deze sectie is waar gebruikers de resultaten kunnen bijhouden -van het uitvoeren van een testcase.

      +

      Dit gedeelte is waar de gebruikers testcases kunnen uitvoeren (testresultaten schrijven) en +een testcase suite van het testplan afdrukken. Deze sectie is waar gebruikers de resultaten kunnen bijhouden +van het uitvoeren van een testcase.

      Testplan beheer

      -

      Deze sectie, die alleen toegankelijk is voor leiders, stelt gebruikers in staat om testplannen te beheren. -Administratie van testplannen omvat het maken/bewerken/verwijderen van de plannen, -toevoegen/bewerken/verwijderen/updaten van testcases in de plannen, builds creëren evenals bepalen wie welke +

      Deze sectie, die alleen toegankelijk is voor leiders, stelt gebruikers in staat om testplannen te beheren. +Administratie van testplannen omvat het maken/bewerken/verwijderen van de plannen, +toevoegen/bewerken/verwijderen/updaten van testcases in de plannen, builds creëren evenals bepalen wie welke plannen kan zien.
      -Gebruikers met leider permissies kunnen ook de prioriteit/risico en de eigendom van -testcase suites (categorieën) en test mijlpalen maken.

      - -

      Opmerking: Het is mogelijk dat gebruikers geen dropdown met testplannen kunnen zien. -In deze situatie zullen alle links (behalve deze geactiveerd door een leider) losgekoppeld zijn. Als u zich -in deze situatie bent moet u contact opnemen met een leider of administrator om u de juiste rechten voor het testplan toe te kennen -or een testplan voor u aan te maken.

      "; - -// custom_fields.html +Gebruikers met leider permissies kunnen ook de prioriteit/risico en de eigendom van +testcase suites (categorieën) en test mijlpalen maken.

      + +

      Opmerking: Het is mogelijk dat gebruikers geen dropdown met testplannen kunnen zien. +In deze situatie zullen alle links (behalve deze geactiveerd door een leider) losgekoppeld zijn. Als u zich +in deze situatie bent moet u contact opnemen met een leider of administrator om u de juiste rechten voor het testplan toe te kennen +or een testplan voor u aan te maken.

      "; + +// custom_fields.html $TLS_hlp_customFields = "

      Gebruikersvelden

      Hier volgen enkele feiten over de implementatie van de gebruikersvelden:

        @@ -99,7 +98,7 @@
      • Bijschrift naam van de variabele (bijvoorbeeld: Dit is de waarde die geleverd wordt aan lang_get () API, of zo weergegeven wordt als deze niet wordt gevonden in een taalbestand).
      • Type gebruikersveld (string, numeric, float, enum, e-mail)
      • -
      • Het bepalen mogelijke waarden (bijvoorbeeld: ROOD|GEEL|BLAUW), die van toepassing zijn in een lijst +
      • Het bepalen mogelijke waarden (bijvoorbeeld: ROOD|GEEL|BLAUW), die van toepassing zijn in een lijst en combo types.
        Gebruik het pijp ('|') karakter om mogelijke waarden voor een opsomming te scheiden. Een mogelijke waarde @@ -119,16 +118,16 @@
      • Aanpassen bij testplan ontwerp. De gebruiker kan de waarde veranderen tijdens het testplan ontwerp (testgevallen aan testplan toevoegen)
      • Beschikbaar voor. De gebruiker kan kiezen om wat voor soort punt het veld gaat.
        • -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

          Testcases uitvoeren

          Hiermee kunnen gebruikers testcases 'uitvoeren'. Uitvoeren zelf is louter het toewijzen van resultaat aan een testcase (OK, gefaald, geblokkeerd) in een geselecteerde build.

          De toegang tot een bug tracking systeem kan worden geconfigureerd. De gebruiker kan dan direct nieuwe bugs toevoegen -en door bestaande bladeren. Zie installatiehandleiding voor meer informatie.

          "; - -//bug_add.html +en door bestaande bladeren. Zie installatiehandleiding voor meer informatie.

          "; + +// bug_add.html $TLS_hlp_btsIntegration = "

          Bugs toevoegen aan een testcase 

          (alleen als dit geconfigureerd is) TestLink heeft een zeer eenvoudige integratie met Bug Tracking Systems (BTS), @@ -138,7 +137,7 @@

        • Nieuwe bug toevoegen.
        • Toon bestaande bug info.
          • -

              +

            Proces om een bug toe te voegen

            @@ -147,12 +146,12 @@   
          • Stap 2: Noteer de BUGID toegewezen door BTS
          •   
          • Stap 3: Schrijf BUGID in het invoerveld
          •   
          • Stap 4: Gebruik bug  toevoegen knop
          • -  
                +  
                Na het sluiten van de bug toevoegen pagina vindt u de relevante bug gegevens op de tests uitvoeren pagina te zien. -

                "; - -// execFilter.html +

                "; + +// execFilter.html $TLS_hlp_executeFilter = "

                Instellingen

                In instellingen kunt u het testplan, build en platform (indien aanwezig) om uit te voeren selecteren @@ -178,85 +177,82 @@

                Trefwoord filter

                -

                U kunt testcases filteren op de trefwoorden die eraan zijn toegewezen. Je kan meerdere trefwoorden kiezen " . -"met CTRL-klik. Als u meer dan één trefwoord koos kun je ". -"beslissen of alleen testcases worden getoond waaraan alle gekozen trefwoorden zijn toegewezen". -"(Radiobutton \"en\") of ten minste één van de gekozen trefwoorden (radioknop \"Of\").

                +

                U kunt testcases filteren op de trefwoorden die eraan zijn toegewezen. Je kan meerdere trefwoorden kiezen " . + "met CTRL-klik. Als u meer dan één trefwoord koos kun je " . + "beslissen of alleen testcases worden getoond waaraan alle gekozen trefwoorden zijn toegewezen" . + "(Radiobutton \"en\") of ten minste één van de gekozen trefwoorden (radioknop \"Of\").

                Prioriteitsfilter

                -

                U kunt testcases filteren op test prioriteit. De test prioriteit is \"testcase belang\" ". -"gecombineerd met \"test dringendheid\" in het huidige testplan.

                +

                U kunt testcases filteren op test prioriteit. De test prioriteit is \"testcase belang\" " . + "gecombineerd met \"test dringendheid\" in het huidige testplan.

                Gebruiker filter

                -

                U kunt testcases filteren die niet zijn toegewezen (\"Niemand\") of toegewezen aan \"Iemand\". ". -"Je kunt ook testcases filteren die aan een specifieke tester zijn toegewezen. Als je een specifieke tester kiest ". -"heb je ook de mogelijkheid om testcases die niet toegewezen zijn erbij te laten zien". -"(geavanceerde filters zijn beschikbaar).

                +

                U kunt testcases filteren die niet zijn toegewezen (\"Niemand\") of toegewezen aan \"Iemand\". " . + "Je kunt ook testcases filteren die aan een specifieke tester zijn toegewezen. Als je een specifieke tester kiest " . + "heb je ook de mogelijkheid om testcases die niet toegewezen zijn erbij te laten zien" . + "(geavanceerde filters zijn beschikbaar).

                Resultaat filter

                -

                U kunt testcases filteren op resultaat (geavanceerde filters zijn beschikbaar). U kunt filteren op ". -"Resultaat \"op gekozen build \", \"op de nieuwste uitvoering\", \"op ALLE builds\", ". -"\"op om het even welke build\" en \"op specifieke build\". Als \"specifieke build\" gekozen is dan kan u". -"de build opgeven.

                "; - - -// newest_tcversions.html +

                U kunt testcases filteren op resultaat (geavanceerde filters zijn beschikbaar). U kunt filteren op " . + "Resultaat \"op gekozen build \", \"op de nieuwste uitvoering\", \"op ALLE builds\", " . + "\"op om het even welke build\" en \"op specifieke build\". Als \"specifieke build\" gekozen is dan kan u" . + "de build opgeven.

                "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

                De nieuwste versies van gekoppelde testcases

                De hele set testcases gekoppeld aan testplan wordt geanalyseerd, en een lijst van testcases waarvan de nieuwste versie wordt weergegeven (vergeleken met de huidige set van het testplan). -

                "; - - -// requirementsCoverage.html +

                "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

                Vereisten dekking


                Deze functie maakt het mogelijk om de ​​dekking in kaart te brengen van de gebruiker- of systeemvereisten door testcases Openen via link \"Vereisten specificatie\" in het hoofdscherm.

                Vereisten specificatie

                -

                Vereisten worden gegroepeerd door een 'Vereisten specificatie' document dat betrekking heeft op het -testproject.
                TestLink ondersteunt geen versiebeheer voor vereisten specificaties  -of vereisten. Dus moet de versie van document worden toegevoegd na +

                Vereisten worden gegroepeerd door een 'Vereisten specificatie' document dat betrekking heeft op het +testproject.
                TestLink ondersteunt geen versiebeheer voor vereisten specificaties +of vereisten. Dus moet de versie van document worden toegevoegd na een specificatie Titel. -Een gebruiker kan eenvoudige beschrijvingen of opmerkingen toevoegen aan het Bereik veld.

                +Een gebruiker kan eenvoudige beschrijvingen of opmerkingen toevoegen aan het Bereik veld.

                -

                Overschreven telling van vereisten dient voor -evaluatie van vereisten dekking in het geval dat niet aan alle vereisten toegevoegd (of geïmporteerd) zijn. -De waarde 0 betekent dat de huidige telling van eisen wordt gebruikt voor de statistieken.

                -

                Bv SRS omvat 200 vereisten, maar slechts 50 worden toegevoegd in TestLink. Test +

                Overschreven telling van vereisten dient voor +evaluatie van vereisten dekking in het geval dat niet aan alle vereisten toegevoegd (of geïmporteerd) zijn. +De waarde 0 betekent dat de huidige telling van eisen wordt gebruikt voor de statistieken.

                +

                Bv SRS omvat 200 vereisten, maar slechts 50 worden toegevoegd in TestLink. Test dekking is 25% (indien alle toegevoegde vereisten worden getest).

                Vereisten

                Klik op de titel van een bestaande Vereisten specificatie. U kunt vereisten maken, bewerken, verwijderen of importeren voor het document. Elke vereiste heeft een titel, bereik en status. Status moet \"normaal\" of \"Niet toetsbaar\" zijn. Niet toetsbare vereisten worden niet meegeteld -in statistieken. Deze parameter moet worden gebruikt voor niet geïmplementeerde functies en -verkeerd ontworpen vereisten.

                +in statistieken. Deze parameter moet worden gebruikt voor niet geïmplementeerde functies en +verkeerd ontworpen vereisten.

                -

                U kunt nieuwe testcases voor de vereisten aanmaken door het gebruik van multi actie met gecontroleerde +

                U kunt nieuwe testcases voor de vereisten aanmaken door het gebruik van multi actie met gecontroleerde vereisten in het specificaties scherm. Deze testcases worden gemaakt in testsuite -met de naam opgegeven in configuratie (standaard is: $tlCfg->req_cfg->default_testsuite_name = +met de naam opgegeven in configuratie (standaard is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";) . Titel en bereik worden gekopieerd naar deze testcases.

                -"; - +"; + $TLS_hlp_req_coverage_table = "

                Dekking:

                -Een waarde van bijvoorbeeld \"40% (8/20)\" betekent dat 20 testcases moeten worden gemaakt om deze vereiste -volledig testen. 8 ervan al zijn gemaakt en gekoppeld aan deze vereiste, die +Een waarde van bijvoorbeeld \"40% (8/20)\" betekent dat 20 testcases moeten worden gemaakt om deze vereiste +volledig testen. 8 ervan al zijn gemaakt en gekoppeld aan deze vereiste, die zo een dekking van 40 procent uitmaken. -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

                Metbetrekking tot 'Gebruikersvelden opslaan'

                Als u gebruikersvelden met
                'Toon bij testplan ontwerp'
                en 'Beschikbaar bij testplan ontwerp'
                -hebt gedefinieerd en toegewezen aan een testproject,
                +hebt gedefinieerd en toegewezen aan een testproject,
                zult u deze op deze pagina alleen zien voor testcases gekoppeld aan het testplan. -"; - -// xxx.html -// $TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/nl_NL/texts.php b/locale/nl_NL/texts.php index eb4e3911c5..2cfb50fff6 100644 --- a/locale/nl_NL/texts.php +++ b/locale/nl_NL/texts.php @@ -1,39 +1,36 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat - * @copyright 2003-2009, TestLink community - * @version CVS: $Id: texts.php,v 1.2 2010/06/24 17:25:53 asimon83 Exp $ - * @link http://www.teamst.org/index.php - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Applicatie fout"; -$TLS_htmltext [ 'error'] = "

                Er is een onverwachte fout gebeurt. Controleer event viewer of ". -"logboek voor meer informatie.

                U bent van harte welkom om het probleem te melden. Ga naar onze ". -"website

                "; - - - -$TLS_htmltext_title['assignReqs'] = "Vereisten toewijzen aan testcases"; -$TLS_htmltext['assignReqs'] = "

                Doel:

                +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat + * @copyright 2003-2009, TestLink community + * @version CVS: $Id: texts.php,v 1.2 2010/06/24 17:25:53 asimon83 Exp $ + * @link http://www.teamst.org/index.php + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Applicatie fout"; +$TLS_htmltext['error'] = "

                Er is een onverwachte fout gebeurt. Controleer event viewer of " . + "logboek voor meer informatie.

                U bent van harte welkom om het probleem te melden. Ga naar onze " . + "website

                "; + +$TLS_htmltext_title['assignReqs'] = "Vereisten toewijzen aan testcases"; +$TLS_htmltext['assignReqs'] = "

                Doel:

                Gebruikers kunnen de relaties tussen vereisten en testcases aanmaken. Een test ontwerper zou kunnen 0..n tot 0..n relaties definiëren. D.w.z Één testcase kan worden toegewezen aan geen, één of meerdere vereisten en vice versa. Dergelijke traceerbaarheidsmatrix helpt test dekking te onderzoeken @@ -44,7 +41,7 @@

                1. Kies een testcase in de boomstructuur aan de linkerkant. De combobox met lijst van vereisten specificaties wordt bovenaan het werkgebied getoond.
                2. -
                3. Kies een vereisten specificatie document als er meerdere zijn gedefinieerd. +
                4. Kies een vereisten specificatie document als er meerdere zijn gedefinieerd. TestLink herlaadt automatisch de pagina.
                5. Een blok in het midden van het werkgebied lijsten toont van alle vereisten (van de gekozen specificatie), die zijn verbonden met de testcase. Het onderste blok toont een lijst met 'Beschikbare vereisten' alle @@ -52,50 +49,48 @@ de huidige test case. Een ontwerper kan vereisten die worden gedekt door deze testcase markeren en klikken op de knop 'Toewijzen'. Deze nieuwe toegewezen testcases worden getoond in het middelste blok 'Toegewezen vereisten'.
                6. -
                "; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Testspecificatie"; -$TLS_htmltext['editTc'] = "

                De Testspecificatie stelt gebruikers in staat alle bestaande testcases te ". -"en aan te passen Testsuites en Testcases.". -"Testcases hebben versiebeheer en alle vorige versies zijn beschikbaar en kunnen hier worden". -"bekeken en beheerd.

                +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Testspecificatie"; +$TLS_htmltext['editTc'] = "

                De Testspecificatie stelt gebruikers in staat alle bestaande testcases te " . + "en aan te passen Testsuites en Testcases." . + "Testcases hebben versiebeheer en alle vorige versies zijn beschikbaar en kunnen hier worden" . + "bekeken en beheerd.

                Aan de slag:

                  -
                1. Kies uw Testproject in de navigatiestructuur (de root node). Let op: ". -"U kunt altijd het actieve testproject wijzigen door een andere optie uit de". -"drop-down lijst in de rechterbovenhoek te kiezen.
                2. -
                3. Maak een nieuwe testsuite door te klikken op Nieuwe testsuite . Testsuites kunnen ". -"structuur brengen in uw testdocumenten volgens uw conventies (functioneel/niet-functioneel". -"testen, product componenten of functies, change requests, etc.). De omschrijving van ". -"een testsuite kan de reikwijdte van de inbegrepen testcases, standaardconfiguratie,". -"links naar relevante documenten, beperkingen en andere nuttige informatie bevatten. In het algemeen, " . -"alle informaties die gemeenschappelijk is voor de onderliggende testcases. Testsuites volgen ". -" zien er uit als "mappen", waardoor gebruikers testsuites kunnen verplaatsen en kopiëren binnen". -"het testproject. Ook kunnen ze worden geïmporteerd of geëxporteerd (inclusief testcases).
                4. -
                5. Testsuites zijn schaalbare mappen. Gebruikers kunnen testsuites verplaatsen of kopiëren binnen ". -"het testproject. Test Suites kunnen worden geïmporteerd of geëxporteerd (inclusief testcases). -
                6. Selecteer uw nieuwe testsuite in de navigatiestructuur en maak ". -"een nieuwe testcases door te klikken op Testcase . Een testcase specificeert ". -"een bepaalde test scenario, verwachte resultaten en de gedefiniëerde gebruikersvelden". -"In het testproject (zie de handleiding voor meer informatie). Het is ook mogelijk ". -"trefwoorden toe te wijzen voor een betere traceerbaarheid.
                7. +
                8. Kies uw Testproject in de navigatiestructuur (de root node). Let op: " . + "U kunt altijd het actieve testproject wijzigen door een andere optie uit de" . + "drop-down lijst in de rechterbovenhoek te kiezen.
                9. +
                10. Maak een nieuwe testsuite door te klikken op Nieuwe testsuite . Testsuites kunnen " . + "structuur brengen in uw testdocumenten volgens uw conventies (functioneel/niet-functioneel" . + "testen, product componenten of functies, change requests, etc.). De omschrijving van " . + "een testsuite kan de reikwijdte van de inbegrepen testcases, standaardconfiguratie," . + "links naar relevante documenten, beperkingen en andere nuttige informatie bevatten. In het algemeen, " . + "alle informaties die gemeenschappelijk is voor de onderliggende testcases. Testsuites volgen " . + " zien er uit als "mappen", waardoor gebruikers testsuites kunnen verplaatsen en kopiëren binnen" . + "het testproject. Ook kunnen ze worden geïmporteerd of geëxporteerd (inclusief testcases).
                11. +
                12. Testsuites zijn schaalbare mappen. Gebruikers kunnen testsuites verplaatsen of kopiëren binnen " . + "het testproject. Test Suites kunnen worden geïmporteerd of geëxporteerd (inclusief testcases). +
                13. Selecteer uw nieuwe testsuite in de navigatiestructuur en maak " . + "een nieuwe testcases door te klikken op Testcase . Een testcase specificeert " . + "een bepaalde test scenario, verwachte resultaten en de gedefiniëerde gebruikersvelden" . + "In het testproject (zie de handleiding voor meer informatie). Het is ook mogelijk " . + "trefwoorden toe te wijzen voor een betere traceerbaarheid.
                14. Navigeer via de boomstructuur aan de linkerkant en bewerk de data. Elke testcase heeft zijn eigen geschiedenis.
                15. Wijs uw gecreëerde testspecificatie voor Testplan wanneer uw testcases klaar zijn.
                -

                Met TestLink kunt u testcases in testsuites organiseren. ". -"Testsuites kunnen worden genest binnen andere testsuites, zodat u hiërarchieën van testsuites kan maken. -Vervolgens kunt u deze informatie samen met de testcases afdrukken.

                "; - - -// ------------------------------------------------------------------------------------------ - -$TLS_htmltext_title['searchTc'] = "Testcase zoeken pagina"; -$TLS_htmltext['searchTc'] = "

                Doel:

                +

                Met TestLink kunt u testcases in testsuites organiseren. " . + "Testsuites kunnen worden genest binnen andere testsuites, zodat u hiërarchieën van testsuites kan maken. +Vervolgens kunt u deze informatie samen met de testcases afdrukken.

                "; + +// ------------------------------------------------------------------------------------------ + +$TLS_htmltext_title['searchTc'] = "Testcase zoeken pagina"; +$TLS_htmltext['searchTc'] = "

                Doel:

                Navigatie op basis van trefwoorden en/of gezochte strings. Het zoeken is niet hoofdlettergevoelig Resultaten bevatten enkel testcases van het actuele testproject.

                @@ -107,13 +102,13 @@
              • Kies een trefwoord of laat de waarde 'Niet van toepassing'.
              • Klik op de knop 'Zoeken'.
              • Alle uitgevoerde testcases worden getoond. U kunt testcases wijzigen via de 'titel' link.
              • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Vereisten zoek pagina"; -$TLS_htmltext['searchReq'] = "

                Doel:

                +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Vereisten zoek pagina"; +$TLS_htmltext['searchReq'] = "

                Doel:

                Navigatie op basis van trefwoorden en/of gezochte strings. Het zoeken is niet hoofdlettergevoelig. Resultaten bevatten enkel vereisten van het actuele testproject.

                @@ -125,12 +120,12 @@
              • Kies het gewenste trefwoord of laat de waarde 'Niet van toepassing'.
              • Klik op 'Zoeken' te klikken.
              • Alle vervulde vereisten worden getoond. U kunt vereisten aanpassen via de 'titel' link.
              • -"; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Vereisten specificatie zoekpagina"; -$TLS_htmltext['searchReqSpec'] = "

                Doel:

                +"; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Vereisten specificatie zoekpagina"; +$TLS_htmltext['searchReqSpec'] = "

                Doel:

                Navigatie op basis van trefwoorden en/of gezochte strings. Het zoeken is niet hoofdlettergevoelig. Resultaten bevatten slechts vereisten specificaties van het actuele testproject.

                @@ -142,35 +137,33 @@
              • Kies de gewenste trefwoorden of laat de waarde 'Niet van toepassing'.
              • Klik op 'Zoeken'.
              • Alle vervulde vereisten specificaties worden getoond. U kunt de vereisten specificaties te wijzigen via de 'Titel' link.
              • -"; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Druk testspecificatie"; //printTC.html -$TLS_htmltext [ 'printTestSpec'] = "

                Doel:

                +"; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Druk testspecificatie"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

                Doel:

                Hier kunt u een enkele testcase of alle testcases het binnen een testsuite afdrukken, of alle testcases in een testproject of testplan.

                Aan de slag:

                1. -

                  Selecteer de onderdelen van de testcases die u wilt weergeven, en klik vervolgens op een test case, +

                  Selecteer de onderdelen van de testcases die u wilt weergeven, en klik vervolgens op een test case, testsuite of het testproject. Een afdrukbare pagina wordt getoond.

                2. -
                3. Met de \"Toon als \" dropbox in het navigatiepaneel kunt u kiezen of u -de informatie wilt weergegeven als HTML, OpenOffice Writer of in een Micosoft Word document. +

                4. Met de \"Toon als \" dropbox in het navigatiepaneel kunt u kiezen of u +de informatie wilt weergegeven als HTML, OpenOffice Writer of in een Micosoft Word document. Zie help voor meer informatie

                  .
                5. Gebruik de printfunctionaliteit van uw browser om de informatie af te drukken.
                  . Opmerking: Zorg ervoor dat u enkel het rechtse frame afdrukt.

                6. -
                "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Vereisten specificatie ontwerp"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

                U kunt vereisten specificatie documenten beheren.

                +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Vereisten specificatie ontwerp"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

                U kunt vereisten specificatie documenten beheren.

                Vereisten specificatie

                @@ -188,8 +181,8 @@

                Vereisten

                -

                Klik op de titel van een bestaande vereisten specificatie. Als er geen bestaan, ". -"klik op de project node om er een te maken. U kunt vereisten maken, bewerken, verwijderen +

                Klik op de titel van een bestaande vereisten specificatie. Als er geen bestaan, " . + "klik op de project node om er een te maken. U kunt vereisten maken, bewerken, verwijderen of importeren voor het document. Elke vereiste heeft een titel, bereik en status. Een status moet ofwel 'Normaal' of 'Niet toetsbaar' zijn. Niet toetsbare vereisten worden niet meegeteld in statistieken. Deze parameter moet worden gebruikt voor niet geïmplementeerde functies en @@ -198,41 +191,39 @@

                U kunt nieuwe testcases voor de vereisten aanmaken door het gebruik van multi actie met gecontroleerde vereisten in het specificatie scherm. Deze testcases worden gemaakt in een testsuite met de naam opgegeven in configuratie (standaard is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';) . Titel en bereik worden gekopieerd naar deze testcases.

                "; - - -$TLS_htmltext_title['printReqSpec'] = "Print vereisten specificatie"; +'Test suite created by Requirement - Auto';)
                . Titel en bereik worden gekopieerd naar deze testcases.

                "; + +$TLS_htmltext_title['printReqSpec'] = "Print vereisten specificatie"; $TLS_htmltext['printReqSpec'] = "

                Doel:

                Vanaf hier kunt u een enkele vereiste af te drukken, alle vereisten binnen een vereisten specificatie, of alle vereisten in een testproject.

                Aan de slag:

                1. -

                  Selecteer de onderdelen van de vereisten die u wilt weergeven, en klik dan op een vereiste, +

                  Selecteer de onderdelen van de vereisten die u wilt weergeven, en klik dan op een vereiste, vereisten specificatie, of het testproject. Een afdrukbare pagina wordt getoond.

                2. -
                3. Met de \"Toon als\" drop-box in het navigatiepaneel kunt u kiezen of u -de informatie wilt weergeven als HTML, OpenOffice Writer of in een Micosoft Word document. +

                4. Met de \"Toon als\" drop-box in het navigatiepaneel kunt u kiezen of u +de informatie wilt weergeven als HTML, OpenOffice Writer of in een Micosoft Word document. Zie help voor meer informatie.

                5. Gebruik de printfunctionaliteit van uw browser om de informatie af te drukken.
                  Opmerking: Zorg ervoor dat u alleen het rechter frame afdrukt.

                6. -
                "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign']= "Trefwoorden toewijzen"; +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Trefwoorden toewijzen"; $TLS_htmltext['keywordsAssign'] = "

                Doel:

                -

                De Trefwoorden toewijzen pagina is de plaats waar gebruikers +

                De Trefwoorden toewijzen pagina is de plaats waar gebruikers trefwoorden kunnen toewijzen aan bestaande testsuites of testcases

                Om trefwoorden toe te wijzen:

                1. Selecteer een testsuite of testcase in de boomstructuur aan de linkerkant.
                2. -
                3. In het veld bovenaan rechts kunt u beschikbare +
                4. In het veld bovenaan rechts kunt u beschikbare trefwoorden toewijzen aan iedere testcase.
                5. In de selecties eronder kunt u testcases toewijzen op een meer granulair niveau.
                6. @@ -247,16 +238,15 @@

                  TestLink gebruikt deze aanpak, zodat oudere versies van testcases in testplannen niet worden beïnvloed door trefwoorden die u aan de meest recente versie van de testcase toewijst. Als u wilt dat de testcases in uw testplan worden bijgewerkt, controleer dan eerst of ze up-to-date met behulp van de 'update -gewijzigde testcases functie 'VOORDAT u trefwoorden toewijst.

                  ". - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest']= "Testcases uitvoeren"; +gewijzigde testcases functie 'VOORDAT u trefwoorden toewijst.

                  " . + + // ------------------------------------------------------------------------------------------ + $TLS_htmltext_title['executeTest'] = "Testcases uitvoeren"; $TLS_htmltext['executeTest'] = "

                  Doel:

                  Hiermee kan de gebruiker testcases uitvoeren. De gebruiker kan een testresultaat toewijzen -aan testcases voor een build. Zie help voor meer informatie over filters en instellingen ". -"(Klik op het vraagteken).

                  +aan testcases voor een build. Zie help voor meer informatie over filters en instellingen " . + "(Klik op het vraagteken).

                  Aan de slag:

                  @@ -264,19 +254,19 @@
                7. Er moet een build voor het testplan gedefinieerd zijn.
                8. Selecteer een build uit de keuzelijst
                9. Als u slechts een paar testcases wilt zien in plaats van de hele boomstructuur, -kunt u filters toepassen. Klik op de \"Toepassen\"-knop +kunt u filters toepassen. Klik op de \"Toepassen\"-knop nadat u de filters heeft veranderd.
                10. Klik op een testcase in de menustructuur.
                11. Vul het testcase resultaat en eventuele notities of bugs in.
                12. Resultaat opslaan.
                -

                Opmerking: TestLink moet worden geconfigureerd om samen te werken met je Bug tracker -als je wilt een probleem rapport rechtstreeks vanuit de GUI wilt maken of zoeken

                ". - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics']= "Beschrijving van de testrapporten en statistieken"; -$TLS_htmltext['showMetrics'] = "

                Rapporten zijn gerelateerd aan een testplan". -"(Gedefinieerd bovenaan de navigatie). Dit testplan kan anders zijn dan het +

                Opmerking: TestLink moet worden geconfigureerd om samen te werken met je Bug tracker +als je wilt een probleem rapport rechtstreeks vanuit de GUI wilt maken of zoeken

                " . + + // ------------------------------------------------------------------------------------------ + $TLS_htmltext_title['showMetrics'] = "Beschrijving van de testrapporten en statistieken"; +$TLS_htmltext['showMetrics'] = "

                Rapporten zijn gerelateerd aan een testplan" . + "(Gedefinieerd bovenaan de navigatie). Dit testplan kan anders zijn dan het huidige testplan voor de uitvoering. U kunt ook een rapport formaat kiezen:

                • Normaal- rapport wordt weergegeven in de webpagina
                • @@ -337,7 +327,7 @@

                  Dit rapport bestaat uit een query formulier pagina en een query resultaten pagina die de opgevraagde gegevens bevat. De Query Form pagina presenteert met een query pagina met 4 velden. Elk veld is ingesteld op een standaard die het aantal testcases en builds maximaliseert waarvoor de query moet worden uitgevoerd. Door de velden te veranderen -kan de gebruiker resultaten filtere en specifieke rapporten voor specifieke eigenaars, trefwoorden, testsuite +kan de gebruiker resultaten filtere en specifieke rapporten voor specifieke eigenaars, trefwoorden, testsuite en build combinaties genereren.

                    @@ -371,7 +361,7 @@
                  • De query parameters die werden gebruikt om het rapport te maken
                  • Totalen voor het gehele testplan
                  • Een uitsplitsing per suite van de totalen (som / OK / gefaald / geblokkeerd / niet uitgevoerd) en alle executies uitgevoerd -op die suite.  Als een test case niet meer dan een keer is uitgevoerd in meerdere meerdere builds zullen alle executies +op die suite.  Als een test case niet meer dan een keer is uitgevoerd in meerdere meerdere builds zullen alle executies weergegeven worden die zijn uitgevoerd met de geselecteerde build. Echter, de samenvatting voor die suite zal alleen de 'laatste testresultaten' voor de geselecteerde build bevatten.
                  • @@ -383,12 +373,12 @@ worden de bijbehorende bugs weergegeven als de gebruiker een geïntegreerd storingmeldingssysteem gebruikt.

                    Testrapport

                    -

                    De status van elke testcase in elke build. Het meest recente resultaat zal worden gebruikt +

                    De status van elke testcase in elke build. Het meest recente resultaat zal worden gebruikt als een testcase meerdere keren werd uitgevoerd op dezelfde build. Het is aan te raden om dit rapport te exporteren naar Excel-formaat voor eenvoudiger browsen als een grote dataset wordt gebruikt.

                    Grafieken - Algemene testplan statistieken

                    -

                    'Laatste testresultaat' logica wordt gebruikt voor alle vier de grafieken die u zult zien. De grafieken zijn geanimeerd om +

                    'Laatste testresultaat' logica wordt gebruikt voor alle vier de grafieken die u zult zien. De grafieken zijn geanimeerd om van de statistieken van het huidige testplan te visualiseren. De vier grafieken zijn:

                    • cirkeldiagram van de totale OK / gefaald / geblokkeerd / niet uitgevoerde testcases
                    • Staafdiagram van de resultaten per trefwoord
                    • @@ -399,11 +389,10 @@

                      Totaal aantal bugs voor elke testcase

                      Dit rapport toont elke testcase met alle bugs ervoor ingediend voor het gehele project. -Dit rapport is alleen beschikbaar als een Bug Tracking Systeem is aangesloten

                      ". - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC']= "Testcases aan testplan toevoegen en verwijderen"; // testSetAdd +Dit rapport is alleen beschikbaar als een Bug Tracking Systeem is aangesloten

                      " . + + // ------------------------------------------------------------------------------------------ + $TLS_htmltext_title['planAddTC'] = "Testcases aan testplan toevoegen en verwijderen"; // testSetAdd $TLS_htmltext['planAddTC'] = "

                      Doel:

                      Hiermee kan een gebruiker (met leider rol) testcases aan een testplan toevoegen of verwijderen.

                      @@ -412,10 +401,10 @@
                    • Klik op een testsuite om alle onderliggende testsuites en testcases te zien.
                    • Als u klaar bent klik op de 'Testcases toevoegen/verwijderen' knop om de testcases toe te voegen of te verwijderen. Let op: Het is niet mogelijk om dezelfde testcase meerdere keren toe te voegen.
                    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment']= "Testers toewijzen"; +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Testers toewijzen"; $TLS_htmltext['tc_exec_assignment'] = "

                      Doel

                      Op deze pagina kunnen testleiders testcases binnen een testplan aan testers toewijzen.

                      @@ -432,15 +421,15 @@
                    • Klik op de root-node in de boomstructuur (het testproject).
                    • Als er toegewezen testcases zijn, zal je een knop om alle toegewezen testcases te verwijderen. Als u erop klikt en bevestigd, alle testers van alle testcases verwijderd worden.
                    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC']= "Update testcases in het testplan"; -$TLS_htmltext [ 'planUpdateTC'] = "

                      Doel

                      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update testcases in het testplan"; +$TLS_htmltext['planUpdateTC'] = "

                      Doel

                      Op deze pagina kunt een testcase bijwerken naar een nieuwere (andere) versie als een test -specificatie is veranderd. Het gebeurt vaak dat sommige functies worden verduidelijkt tijdens de test.". -"Als de gebruiker een testspecificatie wijzigt, moeten veranderingen ook doorgegeven aan het testplan. Anders behoud het ". -"testplan de originele versie om zeker te zijn, dat de resultaten verwijzen naar de juiste tekst van een testcase.

                      +specificatie is veranderd. Het gebeurt vaak dat sommige functies worden verduidelijkt tijdens de test." . + "Als de gebruiker een testspecificatie wijzigt, moeten veranderingen ook doorgegeven aan het testplan. Anders behoud het " . + "testplan de originele versie om zeker te zijn, dat de resultaten verwijzen naar de juiste tekst van een testcase.

                      Aan de slag

                        @@ -448,16 +437,15 @@
                      1. Kies een nieuwe versie in de combo-box voor een bepaalde testcase.
                      2. Klik op de knop 'testplan bijwerken' om de wijzigingen in te dienen.
                      3. Om te controleren: Open tests uitvoeren pagina om de tekst van de testcase(s) te bekijken.
                      4. -
                      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency']= "Geef testen een hoge of lage urgentie"; +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Geef testen een hoge of lage urgentie"; $TLS_htmltext['test_urgency'] = "

                      Doel

                      -

                      TestLink maakt het mogelijk om de urgentie van een testsuite testcases te beïnvloeden. -Test prioriteit is afhankelijk van zowel belang van testcase en urgentie gedefinieerd in -het testplan. De test leider moet een set van testcases selecteren die eerst moeten worden uitgevoerd. -Dit helpt omdat eerst de belangrijkste uitgevoerd worden, +

                      TestLink maakt het mogelijk om de urgentie van een testsuite testcases te beïnvloeden. +Test prioriteit is afhankelijk van zowel belang van testcase en urgentie gedefinieerd in +het testplan. De test leider moet een set van testcases selecteren die eerst moeten worden uitgevoerd. +Dit helpt omdat eerst de belangrijkste uitgevoerd worden, ook onder tijdsdruk.

                      Aan de slag

                      @@ -469,8 +457,8 @@ belangrijke wijzigingen.
                    • Klik op de knop 'Opslaan' om de wijzigingen in te dienen.
                    • -

                      Bijvoorbeeld een testcase met een groot belang in een testsuite met een lage urgentie ". -"zal Medium prioriteit krijgen."; -// ------------------------------------------------------------------------------------------ - +

                      Bijvoorbeeld een testcase met een groot belang in een testsuite met een lage urgentie " . + "zal Medium prioriteit krijgen."; +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/pl_PL/description.php b/locale/pl_PL/description.php index 47a5edb1d6..9922e2fabf 100644 --- a/locale/pl_PL/description.php +++ b/locale/pl_PL/description.php @@ -1,82 +1,82 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

                      Opcje dokumentu

                      -

                      Ta tabela, umożliwia użytkownikowi selekcje przypadków testowych przed ich wyświetleniem. +

                      Ta tabela, umożliwia użytkownikowi selekcje przypadków testowych przed ich wyświetleniem. Znaczone pola będą pokazane w wygenerowanym dokumencie. -W celu zmiany wyświetlanych informacji, zaznacz lub odznacz wybrane pola, następnie kliknij przycisk Filtruj, -w dalszej kolejności na drzewie, w dolnej części okna zaznacz odpowiedni poziom szczegółów zawartych w dokumencie. +W celu zmiany wyświetlanych informacji, zaznacz lub odznacz wybrane pola, następnie kliknij przycisk Filtruj, +w dalszej kolejności na drzewie, w dolnej części okna zaznacz odpowiedni poziom szczegółów zawartych w dokumencie.

                      Nagłówek dokumentu: Użytkownik ma możliwość przefiltrowania nagłówków dokumentu. -Nagłówek powinien zawierać informacje takie jak: wprowadzenie, zakres, odnośniki do dokumentów, +Nagłówek powinien zawierać informacje takie jak: wprowadzenie, zakres, odnośniki do dokumentów, metodologie testów, ograniczenia testów.

                      -

                      Budowa przypadków testowych: Użytkownik może przefiltrować informacje wchodzące w skład budowy głównej części przypadku testowego. -W skład budowy przypadku testowego wchodzą: Cel przypadku testowego, kroki i oczekiwane rezultaty, +

                      Budowa przypadków testowych: Użytkownik może przefiltrować informacje wchodzące w skład budowy głównej części przypadku testowego. +W skład budowy przypadku testowego wchodzą: Cel przypadku testowego, kroki i oczekiwane rezultaty, autor przypadku, pola niestandardowe, powiązane słowa kluczowe i wymagania.

                      -

                      Podsumowanie testu: Użytkownik ma możliwość przefiltrowania samego celu testu poprzez tytuł przypadku testowego, +

                      Podsumowanie testu: Użytkownik ma możliwość przefiltrowania samego celu testu poprzez tytuł przypadku testowego, ale nie zostaną w ten sposób wyłączone pozostałe informacje z budowy głównej części przypadku testowego. -Podsumowanie testu zostało tylko częściowo oddzielone od budowy przypadku testowego, tak aby była możliwość wyświetlania przypadków -tylko w formie tytułu i celu testu (bez wyświetlania kroków). +Podsumowanie testu zostało tylko częściowo oddzielone od budowy przypadku testowego, tak aby była możliwość wyświetlania przypadków +tylko w formie tytułu i celu testu (bez wyświetlania kroków). Jeśli użytkownik wyświetli tylko główną część testu, będzie w nim zawarty cel testu .

                      -

                      Spis treści: Opcja ta tworzy listę wszystkich tytułów przypadków testowych +

                      Spis treści: Opcja ta tworzy listę wszystkich tytułów przypadków testowych z wewnętrznymi linkami w postaci hipertekstu (niezależne fragmenty tekstu połączone hiperlinkami).

                      -

                      Format wyjściowy: Istnieją dwie możliwości: HTML i MS Word. -Przeglądarki odwołują sie do komponentu MS Word w drugiej kolejności.

                      "; - -// testPlan.html +

                      Format wyjściowy: Istnieją dwie możliwości: HTML i MS Word. +Przeglądarki odwołują sie do komponentu MS Word w drugiej kolejności.

                      "; + +// testPlan.html $TLS_hlp_testPlan = "

                      Plan testu

                      Ogólne zasady działania

                      Plan testu jest systemowym podejściem do testowania oprogramowania. Możesz ułożyć testowanie poszczególnych struktur produktów pod względem czasu i osiągniętych rezultatów.

                      Przeprowadzanie testu

                      -

                      Fragment ten jest tym gdzie użytkownik, może przeprowadzić przypadki testowe (opisać rezultaty testu) i -wydrukować strukture przypadku testowego jako plan testu. Fragment ten umożliwia użytkownikowi śledzenie rezultatów przeprowadzanych przez niego przypadków testowych. -

                      +

                      Fragment ten jest tym gdzie użytkownik, może przeprowadzić przypadki testowe (opisać rezultaty testu) i +wydrukować strukture przypadku testowego jako plan testu. Fragment ten umożliwia użytkownikowi śledzenie rezultatów przeprowadzanych przez niego przypadków testowych. +

                      ZarzÄ…dzanie planem testu

                      -

                      Ten fragment, który jest dostępny tylko dla zarzadzających projektem, pozwala użytkownikowi na administrowanie planem testu. -Administrowanie planem testu zawiera tworzenie/edytowanie/usuwanie planów, +

                      Ten fragment, który jest dostępny tylko dla zarzadzających projektem, pozwala użytkownikowi na administrowanie planem testu. +Administrowanie planem testu zawiera tworzenie/edytowanie/usuwanie planów, dodawanie/edytowanie/usuwanie/aktualizacje przypadków testowych w planie testu, tworzenie struktur tak samo jak określenie, kto może obejrzeć który plan.
                      -Użytkownicy z pozwoleniem zarzącającego projektem mogą także określić wagę/ryzyko i przynależność -struktury przypadku testowego (kategorie) oraz tworzenie kroków przypadku testowego.

                      - -

                      Uwaga: Jest możliwe, że użytkownicy mogą nie widzieć listy dropdown zawierającej wszystkie plany testów. -W takiej systuacji wszystkie linki (za wyjątkiem tych, które zostałe aktywowane przez zarządzajacego projektem) będą nie aktywne. Jeżeli jesteś w takiej sytuacji skontaktuj się z zarządzajacym projektem -lub administratorem w celu udostępnienia odpowiednich praw do projektu lub stworzenia planu test dla ciebie.

                      "; - -// custom_fields.html +Użytkownicy z pozwoleniem zarzącającego projektem mogą także określić wagę/ryzyko i przynależność +struktury przypadku testowego (kategorie) oraz tworzenie kroków przypadku testowego.

                      + +

                      Uwaga: Jest możliwe, że użytkownicy mogą nie widzieć listy dropdown zawierającej wszystkie plany testów. +W takiej systuacji wszystkie linki (za wyjątkiem tych, które zostałe aktywowane przez zarządzajacego projektem) będą nie aktywne. Jeżeli jesteś w takiej sytuacji skontaktuj się z zarządzajacym projektem +lub administratorem w celu udostępnienia odpowiednich praw do projektu lub stworzenia planu test dla ciebie.

                      "; + +// custom_fields.html $TLS_hlp_customFields = "

                      pola niestandardowe

                      Klika faktów odnośnie wprowadzania pól niestandardowych:

                        @@ -111,16 +111,16 @@
                      • Uruchomienie projektu planu testu. Użytkownik może zmienić wartość w trakcie tworzenia planu testu ( dodawać przypadek testowy do planu testu)
                      • DostÄ™pność dla. Użytkownik wybiera rodzaju pola do którego przynależy wartość.
                      -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

                      Przeprowadzanie przypadku testowego

                      Przeprowadzanie przypadku testowego. Samo przeprowadzanie przypadku testowego jest w niewielkim stopniu powiązane od rezultatu przypadku testowego (poprawny, niepoprawny, wstrzymany) w przeciwieństwie do wyznaczonego elementu budowy.

                      Można stworzyć dostęp do systemu śledzenie błędu. Użytkownik może bezpośrednio dodawać zgłoszenia o nowych błędach - i wyszukiwać zgłoszenia o starych.

                      "; - -//bug_add.html + i wyszukiwać zgłoszenia o starych.

                      "; + +// bug_add.html $TLS_hlp_btsIntegration = "

                      Dodawanie informacji o błędzie do przypadku testowego

                      (tylko jeżeli jest skonfigurowane) TestLink ma bardzo proste powiądzenie z systemem śledzenia błędu Bug Tracking Systems (BTS), @@ -130,7 +130,7 @@

                    • Umieść nowy błąd.
                    • WyÅ›wietl informacje o istniejÄ…cym błędzie.
                    -

                    +

                    Procedura dodania błędu

                    @@ -139,67 +139,66 @@

                  • Krok 2: zapisać BUGID/ numer błędu nadany przez BTS.
                  • Krok 3: wpisać BUGID w rubryce.
                  • Krok 4: użyć przycisku dodaj błąd.
                  • -
                  +
                Po zamknięciu strony z dodawaniem nowego błędu, zobaczysz odpowiednie informacje o błędzie. -

                "; - -// execFilter.html +

                "; + +// execFilter.html $TLS_hlp_executeFilter = "

                Tworzenie filtra i budowy dla przeprowadzenia testu.

                -

                Lewe okienko zawiera opcje zarządzania przypisanymi przypadkami testowymi" . -"Plan testu i tabela z ustawieniami oraz filtrem. Filtry, które są udostepniane użytkownikowi " . -"w celu ulepszenia oferowanego zestawu " . -"Ustaw swój filtr, przycisnij 'Zatwierdź' i zaznacz odpowiedni przypadek testowy " . -"z menu drzewa .

                +

                Lewe okienko zawiera opcje zarządzania przypisanymi przypadkami testowymi" . + "Plan testu i tabela z ustawieniami oraz filtrem. Filtry, które są udostepniane użytkownikowi " . + "w celu ulepszenia oferowanego zestawu " . + "Ustaw swój filtr, przycisnij 'Zatwierdź' i zaznacz odpowiedni przypadek testowy " . + "z menu drzewa .

                Struktura

                -

                Użytkownicy muszą wybrać strukture, która będzie powiązana z wynikami testu. " . -"struktury są podstawowym komponentem dla bieżącego planu testu. Każdy przypadek testowy " . -"może być przeprowadzony więcej niż jeden raz jeżeli to wynika, z jego struktury. Jednakże liczy się tylko ostatni wynik. +

                Użytkownicy muszą wybrać strukture, która będzie powiązana z wynikami testu. " . + "struktury są podstawowym komponentem dla bieżącego planu testu. Każdy przypadek testowy " . + "może być przeprowadzony więcej niż jeden raz jeżeli to wynika, z jego struktury. Jednakże liczy się tylko ostatni wynik.
                Struktura może być tworzona poprzez zarzadzajacego projektem przez strone umożliwiającą utworzenie nowej struktury.

                Filtr Numeru ID

                -

                Użytkownicy mogą filtrować przypadek testowy poprez indywidualny numer ID. Numer ID jest nadawany automatycznie w czasie tworzenia przypadku testowego. Pusty pasek filtra oznacza, że test nie jest obowiązujący.

                +

                Użytkownicy mogą filtrować przypadek testowy poprez indywidualny numer ID. Numer ID jest nadawany automatycznie w czasie tworzenia przypadku testowego. Pusty pasek filtra oznacza, że test nie jest obowiązujący.

                Filtr Wagi

                -

                Użytkownicy moga filtrować przypadek testowy w zależności od jego wagi. Waga testu składa się z kilku zmiennych" . -"to jak test jest pilny wynika z bieżacego planu testu. Na przykład pryioryet 'WYSOKI' przypadku testowego" . -"Na przykład pryioryet 'WYSOKI' " . " jest wyznaczony w przypadkach gdy pilność lub ważność oznaczona jako 'WYSOKA', a drugi czynnik oznaczony przynajmniej 'ŚREDNI'.

                +

                Użytkownicy moga filtrować przypadek testowy w zależności od jego wagi. Waga testu składa się z kilku zmiennych" . + "to jak test jest pilny wynika z bieżacego planu testu. Na przykład pryioryet 'WYSOKI' przypadku testowego" . + "Na przykład pryioryet 'WYSOKI' " . + " jest wyznaczony w przypadkach gdy pilność lub ważność oznaczona jako 'WYSOKA', a drugi czynnik oznaczony przynajmniej 'ŚREDNI'.

                Filtrowanie rezultatów

                Użytkownicy mogą filtrować przypadki testowe poprzez rezultaty. Rezultaty są wynikem z wykonania określonej struktury przypadku testowego. -Przypadki testowe moga być (poprawne, niepoprawne, zablokowane, nieprzeprowadzone)." . -"Ten filtr jest domyślnie wyłączony.

                +Przypadki testowe moga być (poprawne, niepoprawne, zablokowane, nieprzeprowadzone)." . + "Ten filtr jest domyślnie wyłączony.

                Filtr użytkownika

                -

                Użytkownicy mogą filtrować przypadek testowy pod wględem komu zostały przypisane. Check-box przewiduje także opcję " . -"\" nieprzpisane\" testy, które w rezultatach są umieszczane jako dodatkowe.

                "; -/* -

                Najczęstsze wyniki

                -

                'Najczęstsze wyniki' według ustawień domyślnych ta opcja jest odznaczona check-boxem, wówczas drzewko będzie ułożone -zgodnie ze strukturą wybraną z listy dropdown box. W takiej sytuacji drzewko będzie ułożone -ze względu status przypadku testowego. -
                Przykład: Użytkownik, zaznaczył strukture 2 z listy dropdown box i jednocześnie zaznaczy checkbox opcje -'Najczęstsze wyniki'. Wszystkie przypadki testowe są wyświetlane uwzględniając ich status w strukturze 2. -Więc, jeżeli przypadek testowy 1 będzie określony jako poprawny w strukturze 2 będzie zaznaczony na zielono. -
                Jeżeli użytkownik zdecyduje się zaznaczyć 'najbardziej bieżące' poprzez checkbox drzewko będzie -oznaczone kolorem takim jakim oznaczone są najcześciej przypadki testowe. -
                Przykład: Użytkownik zaznaczył strukture 2 z dropdown box i zaznaczył poprzez checkbox opcje - 'najbardziej bierzące' przypadki testowe. Wtedy zostaną pokazane wszystkie przypadki testowe ze statusem -'najbardziej bierzące'. Więc, jeżeli przypadek testowy 1 jest poprawny w strukturze 3, wtedy jeżeli użytkownik zaznaczy przypadek w strukturze 2 -, to przypadek będzie oznaczony na zielono.

                - */ - - -// newest_tcversions.html +

                Użytkownicy mogą filtrować przypadek testowy pod wględem komu zostały przypisane. Check-box przewiduje także opcję " . + "\" nieprzpisane\" testy, które w rezultatach są umieszczane jako dodatkowe.

                "; +/* + *

                Najczęstsze wyniki

                + *

                'Najczęstsze wyniki' według ustawień domyślnych ta opcja jest odznaczona check-boxem, wówczas drzewko będzie ułożone + * zgodnie ze strukturą wybraną z listy dropdown box. W takiej sytuacji drzewko będzie ułożone + * ze względu status przypadku testowego. + *
                Przykład: Użytkownik, zaznaczył strukture 2 z listy dropdown box i jednocześnie zaznaczy checkbox opcje + * 'Najczęstsze wyniki'. Wszystkie przypadki testowe są wyświetlane uwzględniając ich status w strukturze 2. + * Więc, jeżeli przypadek testowy 1 będzie określony jako poprawny w strukturze 2 będzie zaznaczony na zielono. + *
                Jeżeli użytkownik zdecyduje się zaznaczyć 'najbardziej bieżące' poprzez checkbox drzewko będzie + * oznaczone kolorem takim jakim oznaczone są najcześciej przypadki testowe. + *
                Przykład: Użytkownik zaznaczył strukture 2 z dropdown box i zaznaczył poprzez checkbox opcje + * 'najbardziej bierzące' przypadki testowe. Wtedy zostaną pokazane wszystkie przypadki testowe ze statusem + * 'najbardziej bierzące'. Więc, jeżeli przypadek testowy 1 jest poprawny w strukturze 3, wtedy jeżeli użytkownik zaznaczy przypadek w strukturze 2 + * , to przypadek będzie oznaczony na zielono.

                + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

                Najnowsza wersja powiązanych przypadków testowych

                -

                Jest analizowany cały zestaw przypadków testowych powiązanych do planu testu i lista najnowszych przypadków testowych +

                Jest analizowany cały zestaw przypadków testowych powiązanych do planu testu i lista najnowszych przypadków testowych (w zakresie bieżącego zestawu planu testu). -

                "; - - -// requirementsCoverage.html +

                "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

                Zaspokojenie wymagań


                Własność systemu, która pozwala na dokumentacje pokrycia wymagań systemu lub użytkownika, przez przypadki testowe. @@ -207,14 +206,14 @@

                Zestawy wymagań

                Wymagania są zebrane w 'Zestawach wymagań' dokumencie powiązanym z -projektem testu.
                TestLink nie obejmuje jednocześnie zestawu wymagań, -a także wymagań samych w sobie. Więc, wersja dokumentu powinna być dodana po +projektem testu.
                TestLink nie obejmuje jednocześnie zestawu wymagań, +a także wymagań samych w sobie. Więc, wersja dokumentu powinna być dodana po specyfikacji Tytuł. -Użytkownik może dodać prosty opis notatki do szkicu pola.

                +Użytkownik może dodać prosty opis notatki do szkicu pola.

                Przypisana liczba wymagań służy do -oceny pokrycia wymagań,w przypadku kiedy nie wszystkie wymagania są dodane (zaimportowane). -Wartość 0 oznacza bieżącą liczbę wymagań używaną w celu określenia metryki.

                +oceny pokrycia wymagań,w przypadku kiedy nie wszystkie wymagania są dodane (zaimportowane). +Wartość 0 oznacza bieżącą liczbę wymagań używaną w celu określenia metryki.

                Przykład SRS zawiera 200 wymagań ale tylko 50 jest dodane do TestLink. Pokrycie testu jest 25% (jeżeli wszystkie te wymagania będą dodane).

                @@ -222,26 +221,25 @@

                Kliknij na tytule w celu stworzenia specyfikacji wymagań. Możesz tworzyć, edytować, usuwać lub importować zestaw wymagań dla dokumentu. Każde z wymagań ma tytuł, szkicu i status. Status powinien być \"Normalny\" lub \"Nietestowalny\". Nie testowalne wymagania nie są włączane do metryki. -Ten parametr powinien być użyty dla niezastosowanych cech i żle zaprojektowanych wymagań.

                +Ten parametr powinien być użyty dla niezastosowanych cech i żle zaprojektowanych wymagań.

                Możesz stworzyć nowy przypadek testowy. Możesz stworzyć nowe przypadeki testowe dla wymagań poprzez użycie wielo wątkowej akcji z zaznaczonymi wymaganiami w oknie specyfikacji. Te przypadki testowe są stworzone w schemacie testu -z nazwą określoną w definicji (default is: $tlCfg->req_cfg->default_testsuite_name = +z nazwą określoną w definicji (default is: $tlCfg->req_cfg->default_testsuite_name = \" Zestaw testowy stworzony według wymagań - Auto\";). Tytuł i szkic są kopiowane do tych przypadków testowych.

                -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

                Odnośnie 'Zapisz pola niestandardowe'

                -Jeżeli masz zdefiniowane i przypisane do Projektu Testu,
                +Jeżeli masz zdefiniowane i przypisane do Projektu Testu,
                pola niestandardowe z:
                'Display on test plan design=true' and
                'Enable on test plan design=true'
                Zobaczysz tą strone tylko dla tych przypadków testowych, które są przypisane do planu testu. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/pl_PL/texts.php b/locale/pl_PL/texts.php index ad9943b307..43b4f6e429 100644 --- a/locale/pl_PL/texts.php +++ b/locale/pl_PL/texts.php @@ -14,79 +14,74 @@ * * * Revisions history is not stored for the file - * + * * @package TestLink * @author Martin Havlat - * @copyright 2003-2009, TestLink community + * @copyright 2003-2009, TestLink community * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ * @link http://www.teamst.org/index.php * **/ - // -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Application error"; -$TLS_htmltext['error'] = "

                Unexpected error happens. Please check event viewer or " . - "logs for details.

                You are welcome to report the problem. Please visit our " . - "website.

                "; - - - -$TLS_htmltext_title['assignReqs'] = "Przypisywanie wymagań do przypadków testowych"; -$TLS_htmltext['assignReqs'] = "

                Cel:

                -

                Użytkownicy mogą stworzyć powiązania pomiędzy wymaganiami a przypadkami testowymi. Projektant testu może zdefiniować relacje typu 0..n do 0..n. +$TLS_htmltext_title['error'] = "Application error"; +$TLS_htmltext['error'] = "

                Unexpected error happens. Please check event viewer or " . + "logs for details.

                You are welcome to report the problem. Please visit our " . + "website.

                "; + +$TLS_htmltext_title['assignReqs'] = "Przypisywanie wymagań do przypadków testowych"; +$TLS_htmltext['assignReqs'] = "

                Cel:

                +

                Użytkownicy mogą stworzyć powiązania pomiędzy wymaganiami a przypadkami testowymi. Projektant testu może zdefiniować relacje typu 0..n do 0..n. Przypadek testowy może nie mieć powiązania lub być powiązany do jednego lub więcej wymagań i na odwrót. Taka macierz wspomaga prześledzenie pokrycia testów wzglęcem wymagań oraz znalezieniu wymagań, które nie przeszły testów pozytywnie. Taka analiza stanowi potwierdzenie, że wszystkie sprecyzowane oczekiwania zostały spełnione.

                Jak zacząć:

                1. Wybierz przypadek testowy na drzewku z lewej strony. Okienko wyboru z listą wymagań jest umieszczone na górze strony.
                2. -
                3. Wybierz dokument specyfikacji testowej jeżeli jest stworzony więcej niż jeden. +
                4. Wybierz dokument specyfikacji testowej jeżeli jest stworzony więcej niż jeden. TestLink automatycznie odświeża stronę.
                5. Środkowa część okna zawiera listę wszystkich wymagań (z wybranego dokumentu specyfikacji) które są powiązane do zaznaczonego przypadku testowego. Dolna część okna zawiera listę wszystkich wymagań, które nie mają powiązania do bieżącego przypadku testowego. Projektant może zaznaczyć wymagania, które są pokryte tym przypadkiem testowym a następnie kliknąć przycisk 'Przypisz'. Wówczas te nowo przypisane przypadki testowe będą widoczne w środkowej części okna.
                "; - // -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Specyfikacja testowa"; -$TLS_htmltext['editTc'] = "

                Specyfikacja testowa pozwala użytkownikom na wgląd " . - "i edycje wszystkich istniejących zestawów testów i przypadków testowych. " . - "Przypadki testowe są pogrupowane w wersjach, wszystkie poprzednie wersje są dostępne i mogą być " . - "oglądane oraz zarządzane z tego miejsca.

                - +$TLS_htmltext_title['editTc'] = "Specyfikacja testowa"; +$TLS_htmltext['editTc'] = "

                Specyfikacja testowa pozwala użytkownikom na wgląd " . + "i edycje wszystkich istniejących zestawów testów i przypadków testowych. " . + "Przypadki testowe są pogrupowane w wersjach, wszystkie poprzednie wersje są dostępne i mogą być " . + "oglądane oraz zarządzane z tego miejsca.

                +

                Jak zacząć:

                1. Zaznacz swój projekt testowy w nawigatorze (w głównej cześci). Proszę zwróć uwagę: " . - " Możesz zawsze zmienić aktywny projekt testowy poprzez zaznaczenie innego z " . - "rozwijanej listy w prawym górnym rogu.
                2. + " Możesz zawsze zmienić aktywny projekt testowy poprzez zaznaczenie innego z " . + "rozwijanej listy w prawym górnym rogu.
                3. Stwórz nowy zestaw testów poprzez kliknięcie Utwórz zestaw (Operacje na zestawach testów). Zestawy Testowe mogą " . - "stworzyć strukture dla twojego dokumentu testowego w zależności od przyętej konwencji (funkcjonalny / niefunkcjonalny " . - "testy, części produktu lub jego cechy, zmiana żądań, itp.). Opis " . - "Zestaw testowy może zawierać zarys zawartych przypadków testowych, domyślną konfiguracje, " . - "linki do stosownych dokumentów, ograniczeń i innych istotnych informacji. Generalnie, " . - "wszystkie adnotacje są zawarte w Dziecku Przypadku testowego. Przypadek testowy śledzi " . - "the "folder" metafore, tak więc użytkownicy moga skopiować Zestaw testów z projektu testu " . - "z projektu testu mogą być również, zaimportowane oraz eksportowane (właczając zgromadzone przypadki testowe).
                4. + "stworzyć strukture dla twojego dokumentu testowego w zależności od przyętej konwencji (funkcjonalny / niefunkcjonalny " . + "testy, części produktu lub jego cechy, zmiana żądań, itp.). Opis " . + "Zestaw testowy może zawierać zarys zawartych przypadków testowych, domyślną konfiguracje, " . + "linki do stosownych dokumentów, ograniczeń i innych istotnych informacji. Generalnie, " . + "wszystkie adnotacje są zawarte w Dziecku Przypadku testowego. Przypadek testowy śledzi " . + "the "folder" metafore, tak więc użytkownicy moga skopiować Zestaw testów z projektu testu " . + "z projektu testu mogą być również, zaimportowane oraz eksportowane (właczając zgromadzone przypadki testowe).
                5. Zestawy testów są wymiernymi folderami. Użytkownicy moga przenosić lub kopiować Zestawy Testów z " . - "Projektu testu. Zestawy testów mogą być importowane lub eksportowane (właczając Przypadki testowe). + "Projektu testu. Zestawy testów mogą być importowane lub eksportowane (właczając Przypadki testowe).
                6. Zaznacz swój nowo stworzony Zestaw Testów w nawigatorze i utwórz " . - "nowy Przypadek testowy poprzez kliknięcie na Utwórz (Dzialania na Przypadku testowym). Przypadek testowy obejmuje " . - "określony scenariusz testowania, oczekiwane rezultaty i zdefiniowane pola użytkownika " . - "w Projekcie testu (sprawdź w instrukcji użytkownika dla uzyskania więcej informacji). Jest możliwe " . - "przypisać słowa kluczowe dla zwiększenia efektywności śledzenia.
                7. + "nowy Przypadek testowy poprzez kliknięcie na Utwórz (Dzialania na Przypadku testowym). Przypadek testowy obejmuje " . + "określony scenariusz testowania, oczekiwane rezultaty i zdefiniowane pola użytkownika " . + "w Projekcie testu (sprawdź w instrukcji użytkownika dla uzyskania więcej informacji). Jest możliwe " . + "przypisać słowa kluczowe dla zwiększenia efektywności śledzenia.
                8. Zarządzaj poprzez drzewko nawigatora z lewej strony i edytuj dane. Każdy przypadek testowy zawiera własną historie.
                9. Przypisz stworzoną przez siebie Specyfikacje testową Plan Testu kiedy twój Przypadek testowy jest gotowy.

                Poprzez TestLink mozesz zorganizować Przypadki testowe w Zestawy testowe." . -"Zestawy testowe mogą odnosić się do innych zestawów testowych, umożliwiając Ci tworzenie hierachii Zestawów testowych. + "Zestawy testowe mogą odnosić się do innych zestawów testowych, umożliwiając Ci tworzenie hierachii Zestawów testowych. Możesz wydrukować tą informacje razem z Przypadkami testowymi.

                "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Strona wyszukiwania przypadku testowego"; -$TLS_htmltext['searchTc'] = "

                Cel:

                +$TLS_htmltext_title['searchTc'] = "Strona wyszukiwania przypadku testowego"; +$TLS_htmltext['searchTc'] = "

                Cel:

                Nawigacja poprzez słowa kluczowe lub/ i przeszukiwane ciągi. Podczas wyszukiwania nie są rozróżnione wielkości liter. Resultaty zawierają tylko przypadki testowe z aktualnego Projektu testu.

                @@ -103,8 +98,8 @@ /* contribution by asimon for 2976 */ // requirements search // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Strona wyszukiwania wymagań"; -$TLS_htmltext['searchReq'] = "

                Cel:

                +$TLS_htmltext_title['searchReq'] = "Strona wyszukiwania wymagań"; +$TLS_htmltext['searchReq'] = "

                Cel:

                Nawigacja poprzez słowa kluczowe i/lub przeszukiwane ciągi. Podczas wyszukiwania nie są rozróżnione wielkości liter. Rezultaty zawierają tylko wymagania dla bieżącego projektu.

                @@ -126,8 +121,8 @@ // requirement specification search // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Strona wyszukiwania specyfikacji wymagań"; -$TLS_htmltext['searchReqSpec'] = "

                Cel:

                +$TLS_htmltext_title['searchReqSpec'] = "Strona wyszukiwania specyfikacji wymagań"; +$TLS_htmltext['searchReqSpec'] = "

                Cel:

                Nawigacja poprzez słowa kluczowe i/lub przeszukiwane ciągi. To wyszukiwanie nie rozróżnia wielkich i małych liter. Rezultaty zawierają tylko specyfikacje wymagań dla aktualnego Projektu testu.

                @@ -148,20 +143,19 @@ - Puste pola nie sa brane pod uwagÄ™.

                "; /* end contribution */ - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Wydrukuj dpecyfikacje testowÄ…"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

                Cel:

                +$TLS_htmltext_title['printTestSpec'] = "Wydrukuj dpecyfikacje testowÄ…"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

                Cel:

                Z tego punktu możesz wydrukować pojedyńczy przypadek testowy, wszystkie przypadki testowe w zestawie testowym, lub wszystkie przypadki testowe w projekcie testowym lub planie testu.

                Jak zacząć:

                1. -

                  Zaznacz części Przypadku testowego który chcesz obejrzeć następnie kliknij na przypadek testowy, +

                  Zaznacz części Przypadku testowego który chcesz obejrzeć następnie kliknij na przypadek testowy, zestaw testowy lub projekt testowy. Zostanie wyświetlona strona do druku.

                2. -
                3. Użyj opcji \"pokaż jako\" drop-box w nawigatorze w celu sprecyzowania jakie chcesz aby informacje -były wyświetlone w postaci HTML, OpenOffice Writer lub w postaci dokumentu Micosoft Word. +

                4. Użyj opcji \"pokaż jako\" drop-box w nawigatorze w celu sprecyzowania jakie chcesz aby informacje +były wyświetlone w postaci HTML, OpenOffice Writer lub w postaci dokumentu Micosoft Word. See help w celu uzyskania więcej informacji.

                5. @@ -170,14 +164,13 @@
                "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Projekt dokumentu specyfikacji wymagań"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

                Możesz zarządzać dokumentami specyfikacji wymagań.

                +$TLS_htmltext_title['reqSpecMgmt'] = "Projekt dokumentu specyfikacji wymagań"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

                Możesz zarządzać dokumentami specyfikacji wymagań.

                Specyfikacja wymagań

                -

                Wymagania są zebrane w Dokumencie Specyfikacja Wymagań, które jest powiązane z +

                Wymagania są zebrane w Dokumencie Specyfikacja Wymagań, które jest powiązane z Projektem Testu.
                TestLink nie realizuje (jeszcze) jednocześnie Specyfikacji Wymagań i Wymagań samych w sobie. Więc, wersja dokumentu powinna być dodana po Specyfikacji Tytuł. Użytkownik może dodać prosty opis lub notatkę Szkic pola.

                @@ -185,36 +178,35 @@

                Przypisana liczba wymagań służy do oceny pokrycia wymagań w przypadku jeżeli nie wszystkie wymagania są zawarte w TestLinku. Wartość 0 oznacza bieżącą liczne wymagań, która jest użyta dla metryki.

                -

                Na przykład: SRS zawiera 200 wymagań, ale tylko 50 jest dodane do TestLink. Pokrycie testu jest +

                Na przykład: SRS zawiera 200 wymagań, ale tylko 50 jest dodane do TestLink. Pokrycie testu jest 25% (podsumowując 50 dodanych wymagań będzie testowane).

                Wymagania

                Kliknij na tytule Specyfikacji Wymagań. Jeżeli żaden nie istnieje, " . - "kliknij na oknie projektu w celu utworzenia. Możesz tworzyć, edytować, usuwać, + "kliknij na oknie projektu w celu utworzenia. Możesz tworzyć, edytować, usuwać, lub importować wymagania dla dokumentu. Każde z wymagań ma tytuł, szkic i status. -Status powinien być 'Normalny' lub 'Nietestowalny'. Nietestowalne wymagania nie są wliczane do metryki. +Status powinien być 'Normalny' lub 'Nietestowalny'. Nietestowalne wymagania nie są wliczane do metryki. Ten parametr powinien być użyty dla zarówno cech wymagań które nie zostały zaimplementowane jak i źle zaprojektowane.

                -

                Możesz stworzyć nowy przypadek testowy dla wymagań poprzez zaznaczenie wymagań w oknie specyfikacji. -Te Przypadki testowe są stworzone w Zestawie testowym. +

                Możesz stworzyć nowy przypadek testowy dla wymagań poprzez zaznaczenie wymagań w oknie specyfikacji. +Te Przypadki testowe są stworzone w Zestawie testowym. z nazwą zdefiniowaną w konfiguracji(default is: \$tlCfg->req_cfg->default_testsuite_name = 'Zestaw testowy stworzony według wymagań - Auto';). Tytuł i Szkic sa kopiowane do tych Przypadków testowych.

                "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Wydrukuj specyfikacje wymagań"; //printReq +$TLS_htmltext_title['printReqSpec'] = "Wydrukuj specyfikacje wymagań"; // printReq $TLS_htmltext['printReqSpec'] = "

                Cel:

                Z tego punktu możesz wydrukować pojedyńcze wymaganie, wszystkie wymagania z specyfikacja wymagań lub wszystkie wymagania w projekcie testu.

                Jak zacząć:

                1. -

                  Zaznacz częśc wymagań, które chcesz wyświetlić i kliknij na wymaganiu, +

                  Zaznacz częśc wymagań, które chcesz wyświetlić i kliknij na wymaganiu, specyfikacji wymagań lub na projekcie testu. Będzie pokazana wersja do druku strony.

                2. -
                3. Użyj opcji \"pokaż jako\" drop-box w nawigatorze w celu sprecyzowania jakie chcesz aby informacje -były wyświetlone w postaci HTML, OpenOffice Writer lub w postaci dokumentu Micosoft Word. +

                4. Użyj opcji \"pokaż jako\" drop-box w nawigatorze w celu sprecyzowania jakie chcesz aby informacje +były wyświetlone w postaci HTML, OpenOffice Writer lub w postaci dokumentu Micosoft Word. See help for more information.

                5. @@ -223,42 +215,40 @@
                "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Przypisywanie słów kluczowych"; -$TLS_htmltext['keywordsAssign'] = "

                Cel:

                +$TLS_htmltext_title['keywordsAssign'] = "Przypisywanie słów kluczowych"; +$TLS_htmltext['keywordsAssign'] = "

                Cel:

                To jest stroną gdzie można obserwować powiązanie słów kluczowych do istniejących przypadeków testowych i Zestawów Testowych

                W celu przypisania słów kluczowych:

                  -
                1. Zaznacz Zestaw Testów lub przypadek testowy na drzewku +
                2. Zaznacz Zestaw Testów lub przypadek testowy na drzewku z lewej strony.
                3. -
                4. Rubryka, która pojawia się w prawym górnym rogu pozwala na przypisanie +
                5. Rubryka, która pojawia się w prawym górnym rogu pozwala na przypisanie dowolnego słowa kluczowego do każdego przypadku testowego.
                6. -
                7. Selekcja poniżej pozwoli przypisać przypadeku testowy z +
                8. Selekcja poniżej pozwoli przypisać przypadeku testowy z uwzględnieniem bardziej szczegółowego poziomu.

                Ważne informacje dotyczące przypisywania słów kluczowych w Planie testu:

                -

                Przypisywanie słów kluczowych, którego dokonujesz w specyfikacji dotyczy wyłacznie przypadków testowych, -w twoich planach testów wtedy i tylko wtedy gdy plan testu zawiera najnowszą wersje przypadku testowego. +

                Przypisywanie słów kluczowych, którego dokonujesz w specyfikacji dotyczy wyłacznie przypadków testowych, +w twoich planach testów wtedy i tylko wtedy gdy plan testu zawiera najnowszą wersje przypadku testowego. W przeciwnym wypadku, plan testu, który zawiera starszą wersje przypadku testowego poprzez przypisanie którego dokonujesz, nie pojawi się w planie testu.

                To zastosowanie ma w Testlinku ma takie znaczenie, że przypisania słów kluczowych dokonane w planach testu będą dotyczyć wyłącznie najnowszych wersji przypadków testowych, a nie starszych przypadków testowych. -Jeżeli chcesz, aby twój przypadek testowy był uaktualniony w planie testu, wcześniej sprawdź czy przypadki testowe zostały uaktualnione +Jeżeli chcesz, aby twój przypadek testowy był uaktualniony w planie testu, wcześniej sprawdź czy przypadki testowe zostały uaktualnione poprzez opcje 'uaktualnij modyfikowane przypadki testowe' przed dokonaniem przypisania słów kluczowych.

                "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Wykonanie Przypadku Testowego"; -$TLS_htmltext['executeTest'] = "

                Cel:

                +$TLS_htmltext_title['executeTest'] = "Wykonanie Przypadku Testowego"; +$TLS_htmltext['executeTest'] = "

                Cel:

                -

                Pozwala użytkownikowi na przeprowadzanie przypadków testowych. Użytkownik może przypisać wynik testu +

                Pozwala użytkownikowi na przeprowadzanie przypadków testowych. Użytkownik może przypisać wynik testu do przypadku testowego dla struktury. Sprawdź pomoc w celu uzyskania więcej informacji o filtrach i ustawieniach. " . -"(kliknij na ikone znaku zapytania).

                - + "(kliknij na ikone znaku zapytania).

                +

                Jak zacząć:

                  @@ -266,18 +256,18 @@
                1. Zaznacz strukture z listy down box
                2. Jeżeli chcesz zobaczyć tylko kilka przypadków testowych zamist całego drzewka możesz wybrać stosowne filtry. Kliknij na przycisk \"Zastosuj\"- - po zmianie filtrów.
                3. + po zmianie filtrów.
                4. Kiliknij na przypadku testowym na drzewku.
                5. Uzupełnij wynik przypadku testowego i wszystkie odpowiednie notatki i błędy.
                6. Zapisz rezultat.
                -

                Uwaga: TestLink musi być tak stworzony aby współdziałac z twoim systemem śledzenia błędów BTS +

                Uwaga: TestLink musi być tak stworzony aby współdziałac z twoim systemem śledzenia błędów BTS Jeżeli chcesz stworzyć/ śledzić problem bezpośrednio z GUI.

                "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Opis raportów testu i metryki"; -$TLS_htmltext['showMetrics'] = "

                Raporty są połączone z Planem Testu " . - "(zdefiniowane na górze nawigatora). Ten Plan Testu może się różnić +$TLS_htmltext_title['showMetrics'] = "Opis raportów testu i metryki"; +$TLS_htmltext['showMetrics'] = "

                Raporty są połączone z Planem Testu " . + "(zdefiniowane na górze nawigatora). Ten Plan Testu może się różnić od Planu Testu do wykonania. Możesz wybrac odpowiedni format raportu:

                • Normal - raport jest wyÅ›wietlany na stronie
                • @@ -308,10 +298,10 @@
                • Polecenie w którym struktury sÄ… dodawane do planu testu okreÅ›la, które struktury sÄ… najczÄ™stsze. Wyniki z najnowszych struktur majÄ… pierwszeÅ„stwo przed starszymi wersjami struktur. Dla przykÅ‚adu, jezeli zaznaczysz test jako 'Niepoprawny' w strukturze 1 i zaznaczysz jako 'poprawny' w strukturze 2,najnowsza wersja bÄ™dzie 'poprawny'.
                • -
                • Jeżeli przypadek testowy jest przeprowadzany wielokrotnie na tej samej strukturze to ostani przeprowadzony test jest ważniejszy. +
                • Jeżeli przypadek testowy jest przeprowadzany wielokrotnie na tej samej strukturze to ostani przeprowadzony test jest ważniejszy. Dla przykÅ‚adu, jeżeli struktura 3 jest przypisana do twojego zespoÅ‚u i tester 1 zaznaczy test jako 'poprawny' o drugiej popoÅ‚udniu, a tester 2 oznaczy jako 'niepoprawny' o 3 popoÅ‚udniu - test jest oznaczany jako 'niepoprawny'.
                • -
                • Przypadki testowe wymienine jako 'nie przeprowadzone' w przeciwieÅ„stwie do struktury nie sÄ… brane pod uwagÄ™. Na przykÅ‚ad, jeżeli zaznaczysz przypadek +
                • Przypadki testowe wymienine jako 'nie przeprowadzone' w przeciwieÅ„stwie do struktury nie sÄ… brane pod uwagÄ™. Na przykÅ‚ad, jeżeli zaznaczysz przypadek jako 'poprawny' w strukturze 1 i nie przeprowdzisz go w strukturze 2, ostatni wynik bÄ™dzie okreÅ›lany jako 'poprawny'.

                Następujące tabale są wyświetlane:

                @@ -323,12 +313,12 @@
              • Rezultaty wedÅ‚ug słów kluczowych Lista wszystkich wszystkich słów kluczowych przypisanych do bierzacego planu testu i powiÄ…zanych z nim rezultatów.
              • Rezultaty wedÅ‚ug wÅ‚aÅ›cicela - Lista wedÅ‚ug, której każdy wÅ‚aÅ›cicel ma przypadki testowe przypisane do swojego planu testu. Przypadki testowe, które + Lista wedÅ‚ug, której każdy wÅ‚aÅ›cicel ma przypadki testowe przypisane do swojego planu testu. Przypadki testowe, które sÄ… nieprzydzielone sÄ… zebrane i okreÅ›lone jako 'nieprzydzielone'.

              Ogólny status struktury

              -

              Lista wyników dla przeprowadzonych realizacji każdej struktury. +

              Lista wyników dla przeprowadzonych realizacji każdej struktury. Dla każdej struktury, wszystkich przypadków testowych, wszystkich poprawnych, % poprawnych, wszystkich niepoprawnych, % niepoprawnych, zablokowanych, % zablokowanych, nieprzeprowadzonych, %nieprzeprowadzonych. Jeżeli test byl przeprowadzony dwukrotnie na tej samej strukturze, wynik ostatniego przeprowadzonego testu będzie brany pod uwagę.

              @@ -336,13 +326,13 @@

              Metryka Zapytania

              Ten raport zawiera formularz strony zapytania i stronę wyników zapytania z danymi zapytania. formularz strony zapytania prezentuje strone zapytania z czteroma czynnikami kontrolnymi. -Każdy czynnik kontrolny jest ustawiony domyślnie zwiększając liczbę przypadków testowych i struktur +Każdy czynnik kontrolny jest ustawiony domyślnie zwiększając liczbę przypadków testowych i struktur na podstawie których wykonywane są zapytania. Czynniki alarmujące -umożliwiają użytkownikowi filtrowanie rezultatów, generowanie określonych raportów dla określonych własciceli, słów kluczowych, zestawów +umożliwiają użytkownikowi filtrowanie rezultatów, generowanie określonych raportów dla określonych własciceli, słów kluczowych, zestawów i układów struktur.

                -
              • sÅ‚owa kluczowe 0->1 sÅ‚owa kluczowe mogÄ… być zaznaczone. DomyÅ›lnie, żadne sÅ‚owo kluczowe nie jest zaznaczone. Jeżeli żadne sÅ‚owo kluczowo nie jest zaznaczone, +
              • sÅ‚owa kluczowe 0->1 sÅ‚owa kluczowe mogÄ… być zaznaczone. DomyÅ›lnie, żadne sÅ‚owo kluczowe nie jest zaznaczone. Jeżeli żadne sÅ‚owo kluczowo nie jest zaznaczone, wszystkie przypadki testowe bÄ™dÄ… rozważane bez wzglÄ™du na przypisanie do sÅ‚owa kluczowego. SÅ‚owa kluczowe sÄ… przypisane w specyfikacji testu lub stronach zarzÄ…dzania sÅ‚owami kluczowymi. SÅ‚owa kluczowe przypisane do przypadków testowych rozciÄ…gajÄ… siÄ™ na wszystkie plany testów, i rozciÄ…gajÄ… siÄ™ na wszystkie wersje przypadku testowego. Jeżeli jesteÅ› zainteresowany rezultatammi dla okreÅ›lonego sÅ‚owa kluczowego użyjesz tej kontrolki.
              • @@ -351,16 +341,16 @@ wyszukiwanie 'nieprzypisanych' przypadków testowych. Posiadanie jest przypisane poprzez strone 'Przypisz przeprowadzenie przypadku testowego', i jest wykonane na podstawie podstaw planu testu. Jeżeli jesteÅ› zainteresowany pracÄ… wykonanÄ… przez okreÅ›lonego testera, wykorzystasz tÄ… opcje kontroli.
              • zestaw najwyższego poziomu 0->n zestawy najwyższego poziomu mogÄ… być zaznaczane. DomyÅ›lnie - wszystkie zestawy sÄ… zaznaczone. -Tylko zestawy, które zostaÅ‚y zaznaczone bÄ™dÄ… zapytywane dla uzyskania wyników metryki. Jeżeli jesteÅ› zainteresowany w rezultatach +Tylko zestawy, które zostaÅ‚y zaznaczone bÄ™dÄ… zapytywane dla uzyskania wyników metryki. Jeżeli jesteÅ› zainteresowany w rezultatach dla okreÅ›lonego zestawu użyjesz tej opcji kontroli.
              • -
              • Struktury struktury 1->n mogÄ… zostać wybrane. DomyÅ›lnie - wszystkie struktury sÄ… zaznaczone. Tylko wykonania -przeprowadzone na strukturach zaznaczonych przez ciebie bÄ™dÄ… brane pod uwagÄ™ podczas tworzenia metryki. Na przykÅ‚ad - jeżeli chcesz +
              • Struktury struktury 1->n mogÄ… zostać wybrane. DomyÅ›lnie - wszystkie struktury sÄ… zaznaczone. Tylko wykonania +przeprowadzone na strukturach zaznaczonych przez ciebie bÄ™dÄ… brane pod uwagÄ™ podczas tworzenia metryki. Na przykÅ‚ad - jeżeli chcesz zobaczyć ile przypadków testowych zostaÅ‚o przeprowadzone na ostanich trzech strukturach - użyjesz tej opcji kontroli. Wybór sÅ‚owa kluczowego, wÅ‚aÅ›ciciela i zestaw najwyższego poziomu okreÅ›li liczbÄ™ przypadków testowych dla twojego planu testu sÄ… używane do obliczenia poprzez zestaw i poprzez metrykÄ™ planu. Na przyklad, jeżeli okreÅ›lisz wlaÅ›ciciel = 'Greg', -SÅ‚owo kluczowe='Prioritet 1', i wszystkie dostÄ™pne zestawy testowe, które maja pryiorytet 1 przypadki testowe przypisane do Grega bÄ™dÄ… brane pod uwagÄ™. +SÅ‚owo kluczowe='Prioritet 1', i wszystkie dostÄ™pne zestawy testowe, które maja pryiorytet 1 przypadki testowe przypisane do Grega bÄ™dÄ… brane pod uwagÄ™. Liczba'# przypadków testowych'liczba, która zobaczysz w raporcie bÄ™dzie zmiennÄ… trzech czynników. -Wybór struktury bÄ™dzie miaÅ‚ wpÅ‚yw jeżeli przypadek jest rozważany jako 'poprawny', 'niepoprawny', 'zablokowany' lub 'nieprzeprowadzony' +Wybór struktury bÄ™dzie miaÅ‚ wpÅ‚yw jeżeli przypadek jest rozważany jako 'poprawny', 'niepoprawny', 'zablokowany' lub 'nieprzeprowadzony' ProszÄ™ odnieÅ› siÄ™ do zasad 'Wyników ostatniego testu' takich jak pojawiajÄ… siÄ™ powyżej.

              Kliknij na przycisk 'Zastosuj' aby kontynuować z zapytaniem i wyświetlić strone produkcyjną.

              @@ -370,41 +360,40 @@
            • parametry zapytania użyte do stworzenia raportu
            • podsumowanie caÅ‚ego planu testu
            • przypadajÄ…cych na strukture podsumowanie wszystkich niepowodzeÅ„ (caÅ‚oÅ›ci / poprawnych / niepoprawnych / zablokowanych / nieprzeprowadzonych) i wszystich przeprowadzonych testów -na tej strukturze. Jeżeli test zostaÅ‚ przeprowadzony wiÄ™cej niż jeden raz na wielu strukturach - wszystkie wyniki przeprowadzonych testów bÄ™dÄ… pokazane -tam gdzie zostaÅ‚y zapisane w przeciwieÅ„stwie do struktury. Jednakże, podsumowanie dla zestawu testów bÄ™dzie +na tej strukturze. Jeżeli test zostaÅ‚ przeprowadzony wiÄ™cej niż jeden raz na wielu strukturach - wszystkie wyniki przeprowadzonych testów bÄ™dÄ… pokazane +tam gdzie zostaÅ‚y zapisane w przeciwieÅ„stwie do struktury. Jednakże, podsumowanie dla zestawu testów bÄ™dzie zawieraÅ‚o jedynie 'wynik ostatniego testu' dla zaznaczonych struktur.
            • Raporty o Zablokowanych, Niepoprawnych, Nieprzeprowadzonych przypadkach testowych

              Takie raporty pokazują wszystkie zablokowane, niepoprawne lub nieprzeprowadzone przypadki testowe. Logika 'Ostatnich Wyników testu' (która jest opisana jako ogólna metryka planu testu) jest ponownie stosowana w celu określenia czy - przypadek testowy jest rozważany jako zablokowany, niepoprawny lub nieprzeprowadzony. Raporty o przypadkach testowych oznaczonych jako zablokowanych i niepoprawnych będą + przypadek testowy jest rozważany jako zablokowany, niepoprawny lub nieprzeprowadzony. Raporty o przypadkach testowych oznaczonych jako zablokowanych i niepoprawnych będą wyświetlane w połaczeniu z błędami jeżeli użytkownik używa zintegrowanego systemu śledzenia błędu.

              Raport testu

              -

              Pokazuje status każdego przypadku testowego na każdej strukturze. Jeżeli na tej samej strukturze wielokrtonie przeprowadzany ten sam przypadek testowy -to ostani wynik będzie obowiązujacy. W przypadku gdy będzie użyta duża ilośc danych, +

              Pokazuje status każdego przypadku testowego na każdej strukturze. Jeżeli na tej samej strukturze wielokrtonie przeprowadzany ten sam przypadek testowy +to ostani wynik będzie obowiązujacy. W przypadku gdy będzie użyta duża ilośc danych, zalecane jest weksportowanie raportu do formatu excel w celu zaprwnienia łatwości przeglądania.

              Wykresy - Ogólna Metryka Planu Testu

              -

              Logika 'Wynik ostatniego testu' jest stosowana dla wszystkich czterech wykresów, które zobaczysz. Wykresy są animacją, która jest stosowana w celu pomocy użytkownikowi +

              Logika 'Wynik ostatniego testu' jest stosowana dla wszystkich czterech wykresów, które zobaczysz. Wykresy są animacją, która jest stosowana w celu pomocy użytkownikowi wizualizacji metryki obecnego planu testu. Cztery wykresy możliwe do zastosowania to :

              • Wykres koÅ‚owy ogólny poprawnych / niepoprawny / zablokowany/ przypadków testowych nieprzeprowadzonych
              • Wykres sÅ‚upkowy rezultatów zrealizowany wedÅ‚ug sÅ‚owa kluczowego
              • Wykres sÅ‚upkowy rezultatów zrealizowany wedÅ‚ug wÅ‚aÅ›cicela
              • Wykres sÅ‚upkowy rezultatów zrealizowany wedÅ‚ug Najwyższego poziomu zestawu
              -

              Słupki w wykresie słupkowym są pokolorowane tak aby użytkownik mógł szybko oszacować liczbe przypadków testowych +

              Słupki w wykresie słupkowym są pokolorowane tak aby użytkownik mógł szybko oszacować liczbe przypadków testowych poprawnych, niepoprawnych, zablokowanych, nieprzeprowadzonych.

              Suma błedów dla przypadku testowego

              Ten raport pokazuje każdy przypadek testowy ze wszystkimi błędami jakie pojawiają się w całym projekcie testu. Ten raport jest dostępny tylko wtedy gdy jest podłaczony system śledzenia błędu.

              "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Dodaj /Usuń przypadek testowy z Planu Testu"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

              Cel:

              +$TLS_htmltext_title['planAddTC'] = "Dodaj /Usuń przypadek testowy z Planu Testu"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

              Cel:

              Pozwala użytkownikowi (z odpowiednim poziomem dostępu) dodawać lub usuwać przypadki testowe z Planu Testu.

              Dodawanie lub usuwanie przypadków testowych:

              @@ -415,8 +404,8 @@ "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Przypisywanie testerów do przeprowadzanych testów"; -$TLS_htmltext['tc_exec_assignment'] = "

              Cel

              +$TLS_htmltext_title['tc_exec_assignment'] = "Przypisywanie testerów do przeprowadzanych testów"; +$TLS_htmltext['tc_exec_assignment'] = "

              Cel

              Ta strona pozwala kierownikowi testów na przypisanie użytkowników do poszczególnych testów według Planu Testu.

              Rozpoczęcie

              @@ -428,12 +417,12 @@ "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Zaktualizuj Przypadek Testowy w Planie Testu"; -$TLS_htmltext['planUpdateTC'] = "

              Cel

              +$TLS_htmltext_title['planUpdateTC'] = "Zaktualizuj Przypadek Testowy w Planie Testu"; +$TLS_htmltext['planUpdateTC'] = "

              Cel

              Ta strona pozwala użytkownikowi na uaktalnienie Przypadku Testowego do nowszej (innej) wersji jeżeli Specyfikacja Testu została zmieniona. Często zdarza się, że pewne funkcjonalności zostają wyjaśnione podczas testowania." . - " Użytkownicy zmieniają specyfikacje testową, ale plany testowania musza być także przeniesione na Plan Testu. W przeciwnym wypadku Plan" . - " testu zawiera pierwotną wersje, rezultaty odnoszą się do pierwotnej treści przypadku testowego.

              + " Użytkownicy zmieniają specyfikacje testową, ale plany testowania musza być także przeniesione na Plan Testu. W przeciwnym wypadku Plan" . + " testu zawiera pierwotną wersje, rezultaty odnoszą się do pierwotnej treści przypadku testowego.

              Rozpoczęcie

                @@ -443,13 +432,12 @@
              1. W celu weryfikacji: Otwórz strone przeprowadzenia testu, aby zobaczyć treść przypadku testowego.
              "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Określanie testów według wysokiej lub niskiej pilności"; -$TLS_htmltext['test_urgency'] = "

              Cel

              +$TLS_htmltext_title['test_urgency'] = "Określanie testów według wysokiej lub niskiej pilności"; +$TLS_htmltext['test_urgency'] = "

              Cel

              TestLink pozwala użytkownikowi na ustawnie pilności zestawu testów w celu ustanowienia pierwszeństwa w testowania przypadków testowych. Priorytet testu zależy zarówno od ważności przypadku testowego tak samo jak pilności określonej - w Planie Testu. Kierownik testu powinien określić zestaw przypadków testowych, które powinny być testowane + w Planie Testu. Kierownik testu powinien określić zestaw przypadków testowych, które powinny być testowane jako pierwsze. To rozwiązanie pozwala zapewnić, że najbardziej istotne testy zostaną przeprowadzone nie zależnie od stopnia realizacji testów w czasie.

              Rozpoczęcie

              @@ -460,8 +448,7 @@
            • Kliknij przycisk 'Zapisz' w celu zapisu zmian.
            • Na przykÅ‚ad przypadek testowy z wysokÄ… ważnoÅ›cia w zestawie testowym oznaczonym jako niski " . - "bÄ™dzie miaÅ‚ ważność Å›redniÄ…."; - + "bÄ™dzie miaÅ‚ ważność Å›redniÄ…."; // ------------------------------------------------------------------------------------------ diff --git a/locale/pt_BR/description.php b/locale/pt_BR/description.php index b7504e988d..7669d3175c 100644 --- a/locale/pt_BR/description.php +++ b/locale/pt_BR/description.php @@ -1,25 +1,25 @@ Opções para a geração do documento -

              Esta tabela permite ao usuário filtrar os casos de teste antes de serem visualizados. -Se selecionado (marcado) os dados serão exibidos. Para alterar os dados -apresentados, marque ou desmarque clicando no Filtro, e selecione o nível +

              Esta tabela permite ao usuário filtrar os casos de teste antes de serem visualizados. +Se selecionado (marcado) os dados serão exibidos. Para alterar os dados +apresentados, marque ou desmarque clicando no Filtro, e selecione o nível desejado na árvore de dados.

              -

              Cabeçalho do Documento: Os usuários podem filtrar informações no cabeçalho do documento. -As informações do cabeçalho do documento incluem: Introdução, Escopo, +

              Cabeçalho do Documento: Os usuários podem filtrar informações no cabeçalho do documento. +As informações do cabeçalho do documento incluem: Introdução, Escopo, Referências, Metodologia de Teste, e Limitações de Teste.

              -

              Corpo do Caso de Teste: Os usuários podem filtrar informações do corpo do Caso de Teste. As informações do corpo do Caso de Teste +

              Corpo do Caso de Teste: Os usuários podem filtrar informações do corpo do Caso de Teste. As informações do corpo do Caso de Teste incluem: Resumo, Passos, Resultados Esperados, e Palavras-chave

              -

              Resumo do Caso de Teste: Os usuários podem filtrar informações do Resumo do Caso de Teste através do Título do Caso de Teste, -no entanto, eles não podem filtrar informações do Resumo do Caso de Teste através do Corpo de um Caso de Teste. -O resumo do Caso de Teste foi apenas parcialmente separado do corpo do Caso de Teste a fim de apoiar a visualização -do Título com um breve resumo e a ausência de Passos, Resultados Esperados, -e Palavras-chave. Se um usuário decidir ver o corpo do Caso de Teste, o Resumo do Caso de Teste +

              Resumo do Caso de Teste: Os usuários podem filtrar informações do Resumo do Caso de Teste através do Título do Caso de Teste, +no entanto, eles não podem filtrar informações do Resumo do Caso de Teste através do Corpo de um Caso de Teste. +O resumo do Caso de Teste foi apenas parcialmente separado do corpo do Caso de Teste a fim de apoiar a visualização +do Título com um breve resumo e a ausência de Passos, Resultados Esperados, +e Palavras-chave. Se um usuário decidir ver o corpo do Caso de Teste, o Resumo do Caso de Teste será sempre incluído.

              Tabela de Conteúdo: O TestLink insere uma lista com todos os títulos com seus links internos checados.

              -

              Formatos de Saída: Existem várias possibilidades: HTML, OpenOffice Writer, OpenOffice Calc, Excel, +

              Formatos de Saída: Existem várias possibilidades: HTML, OpenOffice Writer, OpenOffice Calc, Excel, Word ou por E-mail (HTML).

              "; // testPlan.html $TLS_hlp_testPlan = "

              Plano de Teste

              Geral

              -

              O Plano de Teste é uma abordagem sistemática ao teste de um sistema de software. Você pode organizar a atividade de teste com +

              O Plano de Teste é uma abordagem sistemática ao teste de um sistema de software. Você pode organizar a atividade de teste com versões particulares do produto em tempo e resultados rastreáveis.

              Execução do Teste

              -

              Esta é a seção onde os usuários podem executar os Casos de Teste (escrever os resultados dos testes) -e imprimir a Suíte de Casos de Teste do Plano de Teste. Nesta seção os usuários podem -acompanhar os resultados da sua execução dos Caso de Teste.

              +

              Esta é a seção onde os usuários podem executar os Casos de Teste (escrever os resultados dos testes) +e imprimir a Suíte de Casos de Teste do Plano de Teste. Nesta seção os usuários podem +acompanhar os resultados da sua execução dos Caso de Teste.

              Gerenciamento do Plano de Teste

              -

              Esta seção, somente acessível aos líderes, permite que os usuários possam administrar os planos de teste. -A administração de planos de teste envolve a criação/edição/exclusão de planos, acréscimo/edição -/exclusão/atualização dos casos de teste dos planos, criando versões, bem como definindo quem pode +

              Esta seção, somente acessível aos líderes, permite que os usuários possam administrar os planos de teste. +A administração de planos de teste envolve a criação/edição/exclusão de planos, acréscimo/edição +/exclusão/atualização dos casos de teste dos planos, criando versões, bem como definindo quem pode ver qual plano.
              -Usuários com permissão de líder poderão também definir a prioridade/risco e a propriedade das -suites de caso de teste (categorias) e criar marcos de teste.

              +Usuários com permissão de líder poderão também definir a prioridade/risco e a propriedade das +suites de caso de teste (categorias) e criar marcos de teste.

              -

              Nota: É possível que os usuários não possam ver uma lista suspensa que contenha os planos de teste. -Nesta situação, todos os links (exceto para os líderes ativos) serão desvinculados. Se você -estiver nesta situação, contate a administração do TestLink para lhe conceder os -direitos de projeto adequado ou criar um Plano de Teste para você.

              "; +

              Nota: É possível que os usuários não possam ver uma lista suspensa que contenha os planos de teste. +Nesta situação, todos os links (exceto para os líderes ativos) serão desvinculados. Se você +estiver nesta situação, contate a administração do TestLink para lhe conceder os +direitos de projeto adequado ou criar um Plano de Teste para você.

              "; // custom_fields.html $TLS_hlp_customFields = "

              Campos Personalizados

              @@ -96,13 +96,13 @@ atributos:

              • Nome do Campo personalizado.
              • -
              • Capturar o nome da variável (ex: Este é o valor que é fornecido para a API lang_get(), +
              • Capturar o nome da variável (ex: Este é o valor que é fornecido para a API lang_get(), ou exibido como se não for encontrado no arquivo de linguagem).
              • Tipo do Campo personalizado (string, numérico, float, enum, email).
              • -
              • Possibilidade de enumerar os valores (ex: RED|YELLOW|BLUE), aplicável a uma lista, lista de multiseleção +
              • Possibilidade de enumerar os valores (ex: RED|YELLOW|BLUE), aplicável a uma lista, lista de multiseleção e tipos de combo.
                Utilize o caractere pipe ('|') para -separar os possíveis valores para uma enumeração. Um dos possíveis valores pode ser +separar os possíveis valores para uma enumeração. Um dos possíveis valores pode ser uma string vazia.
              • Valor default: NÃO IMPLEMENTADO AINDA.
              • @@ -123,22 +123,22 @@ // execMain.html $TLS_hlp_executeMain = "

                Executar Casos de Teste

                -

                Permite aos usuários 'executar' os Casos de Teste. Execução propriamente -dita é apenas a atribuição do resultado de um Caso de Teste (Passou, +

                Permite aos usuários 'executar' os Casos de Teste. Execução propriamente +dita é apenas a atribuição do resultado de um Caso de Teste (Passou, Com Falha ou Bloqueado) de uma compilação selecionada.

                O acesso a um Bugtracking pode ser configurado. O usuário pode adicionar diretamente novos bugs e navegar pelos existentes. Consulte o manual de instalação para maiores detalhes.

                "; -//bug_add.html +// bug_add.html $TLS_hlp_btsIntegration = "

                Adicionar Bugs ao Caso de Teste

                (Somente se estiver configurado) -O TestLink possui uma integração muito simples com os sistemas de Bugtracking, -mas não é capaz de enviar um pedido de abertura de bug ao Bugtracking ou receber de volta o ID do Bug. +O TestLink possui uma integração muito simples com os sistemas de Bugtracking, +mas não é capaz de enviar um pedido de abertura de bug ao Bugtracking ou receber de volta o ID do Bug. A integração é feita utilizando um link para a página do Bugtracking, com as seguintes características:

                • Inserir novo Bug.
                • Exibição das informações do bug.
                -

                +

                Processo para adicionar um novo bug

                @@ -147,7 +147,7 @@

              • Passo 2: Anote o ID do Bug gerado pelo Bugtracking.
              • Passo 3: Escreva o ID do Bug no campo de entrada.
              • Passo 4: Clique no botão Adicionar Bug
              • -
              +
            Depois de fechar a página de Adição de Bug, os dados relevantes do bug serão exibidos na página de execução.

            "; @@ -155,11 +155,11 @@ // execFilter.html $TLS_hlp_executeFilter = "

            Configurações

            -

            Em Configurações é possível que você selecione o plano de teste, a build e +

            Em Configurações é possível que você selecione o plano de teste, a build e a plataforma (se disponível) para ser executado.

            Plano de Teste

            -

            Você pode escolher o Plano de Teste necessário. De acordo com o plano de teste escolhido, as apropriadas +

            Você pode escolher o Plano de Teste necessário. De acordo com o plano de teste escolhido, as apropriadas builds serão exibidas. Depois de escolher um plano de teste, os filtros serão reiniciados.

            Plataformas

            @@ -170,85 +170,82 @@

            Filtros

            Filtros proporcionam a oportunidade de influenciar ainda mais o conjunto de casos de teste mostrados. -Através dos Filtros é possível diminuir o conjunto de Casos de Teste exibidos. Selecione +Através dos Filtros é possível diminuir o conjunto de Casos de Teste exibidos. Selecione os filtros desejados e clique no botão \"Aplicar\".

            -

            Os Filtros Avançados permitem que você especifique um conjunto de valores para filtros aplicáveis +

            Os Filtros Avançados permitem que você especifique um conjunto de valores para filtros aplicáveis ​​usando Ctrl + Clique dentro de cada ListBox.

            Filtro de Palavra-chave

            Você pode filtrar os Casos de Teste pelas Palavras-chave que foram atribuídas. Você pode escolher " . -"múltiplas Palavras-chave utilizando Ctrl + Clique. Se você escolher mais de uma palavra-chave, você pode " . -"decidir se somente serão exibidos os Casos de Teste que contém todas as Palavras-chave aselecionadas " . -"(botão \"E\") ou pelo menos uma das Palavras-chave escolhidas (botão \"OU\").

            + "múltiplas Palavras-chave utilizando Ctrl + Clique. Se você escolher mais de uma palavra-chave, você pode " . + "decidir se somente serão exibidos os Casos de Teste que contém todas as Palavras-chave aselecionadas " . + "(botão \"E\") ou pelo menos uma das Palavras-chave escolhidas (botão \"OU\").

            Filtro de Prioridade

            Você pode filtrar os Casos de Teste pela prioridade do Teste. A proridade do Teste é a \"importância do Caso de Teste\" " . -"combinado com \"a urgência do Teste\" dentro do Plano de Teste atual.

            + "combinado com \"a urgência do Teste\" dentro do Plano de Teste atual.

            Filtro de Usuário

            Você pode filtrar os Casos de Teste que não estão atribuídos (\"Ninguém\") ou atribuídos a \"Alguém\". " . -"Você também pode filtrar os Casos de Teste que são atribuídos a um testador específico. Se você escolheu um testador " . -"específico, também existe a possibilidade de mostrar os Casos de Teste que estão por serem atribuídos " . -"(Filtros avançados estão disponíveis).

            + "Você também pode filtrar os Casos de Teste que são atribuídos a um testador específico. Se você escolheu um testador " . + "específico, também existe a possibilidade de mostrar os Casos de Teste que estão por serem atribuídos " . + "(Filtros avançados estão disponíveis).

            Filtro de Resultado

            Você pode filtrar os Casos de Teste pelos resultados (Filtros avançados estão disponíveis). Você pode filtrar por " . -"resultado \"na build escolhida para a execução\", \"na última execução\", \"em TODAS as Builds\", " . -"\"em QUALQUER build\" e \"em uma build específica\". Se \"uma build específica\" for escolhida, então você pode " . -"especificar a build.

            "; - + "resultado \"na build escolhida para a execução\", \"na última execução\", \"em TODAS as Builds\", " . + "\"em QUALQUER build\" e \"em uma build específica\". Se \"uma build específica\" for escolhida, então você pode " . + "especificar a build.

            "; // newest_tcversions.html $TLS_hlp_planTcModified = "

            Versões mais recentes do Caso de Teste

            -

            Todo o conjunto de Casos de Teste ligados ao Plano de Teste é analisado, e uma lista de Casos +

            Todo o conjunto de Casos de Teste ligados ao Plano de Teste é analisado, e uma lista de Casos de Teste que têm uma versão mais recente é exibida (contra o conjunto atual do Plano de Teste).

            "; - // requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

            Cobertura de Requisitos


            -

            Este recurso permite mapear uma cobertura de usuário ou requisitos do sistema +

            Este recurso permite mapear uma cobertura de usuário ou requisitos do sistema por Casos de Teste. Navegue através do link \"Especificar Requisitos\" na tela principal.

            Especificação de Requisitos

            -

            Os Requisitos estão agrupados no documento 'Especificação de Requisitos' que está relacionado ao -Projeto de Teste.
            O TestLink ainda não suporta versões para a Especificação de Requisitos e -também para os Requisitos. Assim, a versão do documento deve ser adicionada depois do +

            Os Requisitos estão agrupados no documento 'Especificação de Requisitos' que está relacionado ao +Projeto de Teste.
            O TestLink ainda não suporta versões para a Especificação de Requisitos e +também para os Requisitos. Assim, a versão do documento deve ser adicionada depois do Título da Especificação. -O usuário pode adicionar uma descrição simples ou uma nota no campo Escopo.

            +O usuário pode adicionar uma descrição simples ou uma nota no campo Escopo.

            -

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos requisitos no caso +

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos requisitos no caso de nem todos os requisitos estarem adicionados ao TestLink. -

            O valor 0 significa que a contagem atual de requisitos é usado para métricas.

            -

            Ex: SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes +

            O valor 0 significa que a contagem atual de requisitos é usado para métricas.

            +

            Ex: SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de 25% (se todos estes requisitos forem testados).

            Requisitos

            -

            Clique no título para criar uma Especificação de Requisitos. Você pode criar, editar, deletar +

            Clique no título para criar uma Especificação de Requisitos. Você pode criar, editar, deletar ou importar requisitos para este documento. Cada Requisito tem título, escopo e status. O status deve ser \"Válido\" ou \"Não testado\". Requisitos não testados não são contabilizados -para as métricas. Este parâmetro deve ser utilizado para características não implementadas -e requisitos modelados incorretamente.

            +para as métricas. Este parâmetro deve ser utilizado para características não implementadas +e requisitos modelados incorretamente.

            -

            Você pode criar novos Casos de Teste para os requisitos utilizando multi ações para os requisitos -ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suíte de -Teste com nome definido na configuração (padrão é: $tlCfg->req_cfg->default_testsuite_name = +

            Você pode criar novos Casos de Teste para os requisitos utilizando multi ações para os requisitos +ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suíte de +Teste com nome definido na configuração (padrão é: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Título e Escopo são copiados destes Casos de Teste.

            "; $TLS_hlp_req_coverage_table = "

            Cobertura:

            Um valor por ex. de \"40% (8/20)\" significa que 20 Casos de Teste devem ser criados para testar completamente este -Requisito. 8 destes já foram criados e associados ao Requisito, com +Requisito. 8 destes já foram criados e associados ao Requisito, com a cobertura de 40 %. "; - // req_edit $TLS_hlp_req_edit = "

            Links internos no Escopo:

            -

            Links internos servem ao propósito da criação de links a outros requisitos / especificações de requisitos +

            Links internos servem ao propósito da criação de links a outros requisitos / especificações de requisitos com uma sintaxe especial. O comportamento dos Links internos pode ser alterado no arquivo de configuração.

            Uso: @@ -256,7 +253,7 @@ Link para Requisitos: [req]req_doc_id[/req]
            Link para Especificação de Requisitos: [req_spec]req_spec_doc_id[/req_spec]

            -

            O Projeto de Teste do Requisito / Especificação de Requisitos, uma versão e uma âncora +

            O Projeto de Teste do Requisito / Especificação de Requisitos, uma versão e uma âncora também podem ser especificados:
            [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
            Esta sintaxe também funciona para as especificações de requisito (atributos de versão não tem nenhum efeito).
            @@ -268,7 +265,6 @@ Sempre que alguma coisa além do escopo é alterado, você é forçado a criar uma nova revisão.

            "; - // req_view $TLS_hlp_req_view = "

            Links Diretos:

            É fácil compartilhar este documento com outros, basta clicar no ícone do globo no topo deste documento para criar um link direto.

            @@ -284,14 +280,13 @@

            Relações de Requisitos são usados ​​para relacionamentos de modelos entre os requisitos. Relações personalizadas e a opção de permitir relações entre os requisitos de diferentes projetos de teste podem ser configurados no arquivo de configuração. -Se você definir a relação \"Requisito A é pai do Requisito B\", +Se você definir a relação \"Requisito A é pai do Requisito B\", o Testlink irá definir a relação \"Requisito B é filho do Requisito A\" implicitamente.

            "; - // req_spec_edit $TLS_hlp_req_spec_edit = "

            Links internos no Escopo:

            -

            Links internos servem ao propósito da criação de links a outros requisitos / especificações de requisitos +

            Links internos servem ao propósito da criação de links a outros requisitos / especificações de requisitos com uma sintaxe especial. O comportamento dos Links internos pode ser alterado no arquivo de configuração.

            Uso: @@ -299,24 +294,22 @@ Link para Requisitos: [req]req_doc_id[/req]
            Link para Especificação de Requisitos: [req_spec]req_spec_doc_id[/req_spec]

            -

            O Projeto de Teste do Requisito / Especificação de Requisitos, uma versão e uma âncora +

            O Projeto de Teste do Requisito / Especificação de Requisitos, uma versão e uma âncora também podem ser especificados:
            [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
            Esta sintaxe também funciona para as especificações de requisito (atributos de versão não tem nenhum efeito).
            Se você não especificar a versão do Requisito completo, todas as versões serão exibidas.

            "; - // planAddTC_m1.tpl $TLS_hlp_planAddTC = "

            Sobre 'Campos personalizados salvos'

            -Se você tiver definido e atribuído ao Projeto de Teste,
            +Se você tiver definido e atribuído ao Projeto de Teste,
            Campos Personalizados com:
            'Exibição no desenho do Plano de Teste=true' e
            'Habilitar no desenho do Plano de Teste=true'
            você irá ver nesta página APENAS os Casos de Teste ligados ao Plano de Teste. "; - // resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "Mais informações sobre os testadores
            Se você clicar no nome do testador nesta tabela, você irá ter uma visão mais detalhada @@ -327,9 +320,8 @@ o caso de teste irá aparecer como executado pelo usuário atribuído. "; - // xxx.html -//$TLS_hlp_xxx = ""; +// $TLS_hlp_xxx = ""; // ----- END ------------------------------------------------------------------ ?> diff --git a/locale/pt_BR/texts.php b/locale/pt_BR/texts.php index 9a70f8afd3..3431c06683 100644 --- a/locale/pt_BR/texts.php +++ b/locale/pt_BR/texts.php @@ -14,87 +14,82 @@ * * * Revisions history is not stored for the file - * + * * @package TestLink * @author Martin Havlat - * @copyright 2003-2009, TestLink community + * @copyright 2003-2009, TestLink community * @version CVS: $Id: texts.php,v 1.29 2010/07/22 14:14:44 asimon83 Exp $ * @link http://www.teamst.org/index.php * **/ - // -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Erro na Aplicação"; -$TLS_htmltext['error'] = "

            Um erro inesperado ocorreu. Por favor, verifique o event viewer ou " . - "logs para detalhes.

            Você está convidado para relatar o problema. Por favor, visite nosso " . - "website.

            "; - - - -$TLS_htmltext_title['assignReqs'] = "Atribuir Requisitos aos Casos de Teste"; -$TLS_htmltext['assignReqs'] = "

            Purpose:

            -

            Usuários podem criar relacionamentos entre requisitos e casos de teste. Um arquiteto pode -definir relacionamentos 0..n para 0..n. I.e. Um caso de teste pode ser atribuído para nenhum, um ou mais -requisitos e vice versa. Assim a matriz de rastreabilidade ajuda a investigar a cobertura -dos requisitos de teste e finalmente quais falharam durante os testes. Esta +$TLS_htmltext_title['error'] = "Erro na Aplicação"; +$TLS_htmltext['error'] = "

            Um erro inesperado ocorreu. Por favor, verifique o event viewer ou " . + "logs para detalhes.

            Você está convidado para relatar o problema. Por favor, visite nosso " . + "website.

            "; + +$TLS_htmltext_title['assignReqs'] = "Atribuir Requisitos aos Casos de Teste"; +$TLS_htmltext['assignReqs'] = "

            Purpose:

            +

            Usuários podem criar relacionamentos entre requisitos e casos de teste. Um arquiteto pode +definir relacionamentos 0..n para 0..n. I.e. Um caso de teste pode ser atribuído para nenhum, um ou mais +requisitos e vice versa. Assim a matriz de rastreabilidade ajuda a investigar a cobertura +dos requisitos de teste e finalmente quais falharam durante os testes. Esta análise serve como entrada para o próximo planejamento de teste.

            Iniciar:

              -
            1. Escolha um Caso de Teste na árvore à esquerda. O combo box com a lista de +
            2. Escolha um Caso de Teste na árvore à esquerda. O combo box com a lista de Especificações de Requisitos é exibido no topo da área de trabalho.
            3. -
            4. Escolha um documento de Especificação se mais de um estiver definido. +
            5. Escolha um documento de Especificação se mais de um estiver definido. O TestLink recarregará a página automaticamente.
            6. -
            7. Um bloco ao centro da área de trabalho lista todos os requisitos (para a Especificação selecionada), que - está conectada ao caso de teste. O bloco abaixo 'Requisitos Disponíveis' lista todos - os requisitos que não estão relacionados - ao caso de teste selecionado. Um arquiteto pode selecionar requisitos que são cobertos por este - caso de teste e então clicar em 'Atribuir'. Este novo caso de teste atribuído será exibido no +
            8. Um bloco ao centro da área de trabalho lista todos os requisitos (para a Especificação selecionada), que + está conectada ao caso de teste. O bloco abaixo 'Requisitos Disponíveis' lista todos + os requisitos que não estão relacionados + ao caso de teste selecionado. Um arquiteto pode selecionar requisitos que são cobertos por este + caso de teste e então clicar em 'Atribuir'. Este novo caso de teste atribuído será exibido no bloco central 'Requisitos atribuídos'.
            "; - // -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Especificação de Teste"; -$TLS_htmltext['editTc'] = "

            A Especificação de Teste permite aos usuários visualizar " . - "e editar todas as Suítes de Teste e Casos de Teste existentes. " . - "Os Casos de Teste são versionados e todas as versões anteriores estão disponíveis e podem ser " . - "visualizadas e gerenciadas aqui.

            - +$TLS_htmltext_title['editTc'] = "Especificação de Teste"; +$TLS_htmltext['editTc'] = "

            A Especificação de Teste permite aos usuários visualizar " . + "e editar todas as Suítes de Teste e Casos de Teste existentes. " . + "Os Casos de Teste são versionados e todas as versões anteriores estão disponíveis e podem ser " . + "visualizadas e gerenciadas aqui.

            +

            Iniciar:

            1. Selecione seu Projeto de Teste na árvore de navegação (o nó principal). Observe: " . - "Você sempre poderá trocar o Projeto de Teste ativo selecionando um diferente da " . - "lista drop-down do canto superior esquerdo.
            2. + "Você sempre poderá trocar o Projeto de Teste ativo selecionando um diferente da " . + "lista drop-down do canto superior esquerdo.
            3. Crie uma nova Suíte de Teste clicando em Nova Suíte de Teste. As Suítes de Teste podem " . - "trazer a estrutura da sua documentação de teste conforme suas convenções (testes funcionais/não-funcionais " . - ", produtos, componentes ou características, solicitações de mudança, etc.). A descrição da " . - "Suíte de Teste poderia conter o escopo dos Casos de Teste incluídos, configuração padrão, " . - "links para documentos relevantes, limitações e outras informações usuais. Em geral, " . - "todas anotações que são comuns às Suítes de Teste. As Suítes de Teste seguem " . - "a metáfora do "diretório", assim os usuários podem mover e copiar Suítes de Teste dentro " . - "do Projeto de Teste. Além disso, eles podem ser importados ou exportados (incluindo os Casos de Teste nele contidos).
            4. + "trazer a estrutura da sua documentação de teste conforme suas convenções (testes funcionais/não-funcionais " . + ", produtos, componentes ou características, solicitações de mudança, etc.). A descrição da " . + "Suíte de Teste poderia conter o escopo dos Casos de Teste incluídos, configuração padrão, " . + "links para documentos relevantes, limitações e outras informações usuais. Em geral, " . + "todas anotações que são comuns às Suítes de Teste. As Suítes de Teste seguem " . + "a metáfora do "diretório", assim os usuários podem mover e copiar Suítes de Teste dentro " . + "do Projeto de Teste. Além disso, eles podem ser importados ou exportados (incluindo os Casos de Teste nele contidos).
            5. Suítes de Teste são pastas escaláveis. Os usuários podem mover ou copiar Suítes de Teste dentro " . - "do Projeto de Teste. Suítes de Teste podem ser importadas ou exportadas (incluindo os Casos de Teste). + "do Projeto de Teste. Suítes de Teste podem ser importadas ou exportadas (incluindo os Casos de Teste).
            6. Selecione sua mais nova Suíte de Teste criada na árvore de navegação e crie " . - "um novo Caso de Teste clicando em Criar Caso(s) de Teste. Um Caso de Teste especifica " . - "um cenário de testes particular, resultados esperados e campos personalizados definidos " . - "no Projeto de Teste (consulte o manual do usuário para maiores informações). Também é possível " . - "atribuir palavras-chave para melhorar a rastreabilidade.
            7. + "um novo Caso de Teste clicando em Criar Caso(s) de Teste. Um Caso de Teste especifica " . + "um cenário de testes particular, resultados esperados e campos personalizados definidos " . + "no Projeto de Teste (consulte o manual do usuário para maiores informações). Também é possível " . + "atribuir palavras-chave para melhorar a rastreabilidade.
            8. Navegue pela árvore de navegação do lado esquerdo e edite os dados. Os Casos de Teste armazenam histórico próprio.
            9. Atribua suas Especificações de Teste criadas ao Test Plan quando seus Casos de Teste estiverem prontos.

            Com o TestLink você organiza os Casos de Teste em Suítes de Teste." . -" Suítes de Teste podem ser aninhadas em outras Suítes de Teste, permitindo a você criar hierarquias de Suítes de Teste. + " Suítes de Teste podem ser aninhadas em outras Suítes de Teste, permitindo a você criar hierarquias de Suítes de Teste. Então você pode imprimir esta informação juntamente com o Caso de Teste.

            "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Página de Busca de Casos de Teste"; -$TLS_htmltext['searchTc'] = "

            Objetivo:

            +$TLS_htmltext_title['searchTc'] = "Página de Busca de Casos de Teste"; +$TLS_htmltext['searchTc'] = "

            Objetivo:

            Navegue de acordo com palavras-chave e/ou strings procuradas. A busca não é case sensitive. Os resultados incluem apenas Casos de Teste do Projeto de Teste atual.

            @@ -111,10 +106,10 @@ /* contribution by asimon for 2976 */ // requirements search // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Página de Busca de Requisitos"; -$TLS_htmltext['searchReq'] = "

            Objetivo:

            +$TLS_htmltext_title['searchReq'] = "Página de Busca de Requisitos"; +$TLS_htmltext['searchReq'] = "

            Objetivo:

            -

            Navegue de acordo com as palavras-chave e/ou strings procuradas. A busca não é +

            Navegue de acordo com as palavras-chave e/ou strings procuradas. A busca não é case sensitive. Os resultados incluem somente requisitos do projeto de teste atual.

            Para Pesquisar:

            @@ -134,10 +129,10 @@ // requirement specification search // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Página de Busca de Especificação de Requisitos"; -$TLS_htmltext['searchReqSpec'] = "

            Objetivo:

            +$TLS_htmltext_title['searchReqSpec'] = "Página de Busca de Especificação de Requisitos"; +$TLS_htmltext['searchReqSpec'] = "

            Objetivo:

            -

            Navegue de acordo com as palavras-chave e/ou strings procuradas. A busca não é +

            Navegue de acordo com as palavras-chave e/ou strings procuradas. A busca não é case sensitive. Os resultados incluem somente requisitos do projeto de teste atual.

            Para Pesquisar:

            @@ -156,20 +151,19 @@ - Campos vazios não são considerados.

            "; /* end contribution */ - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificação de Testes"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

            Objetivo:

            -

            A partir daqui você pode imprimir um único caso de teste, todos os casos de teste dentro de uma suite +$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificação de Testes"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

            Objetivo:

            +

            A partir daqui você pode imprimir um único caso de teste, todos os casos de teste dentro de uma suite ou todos os casos de teste de um Projeto de Teste ou Plano de Teste.

            Iniciar:

            1. -

              Selecione os campos dos casos de teste que você deseja exibir, e então clique em um Caso de Teste, +

              Selecione os campos dos casos de teste que você deseja exibir, e então clique em um Caso de Teste, Suíte de Teste, ou Projeto de Teste. Uma página pronta para impressão será exibida.

            2. -
            3. Use a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer -a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. +

            4. Use a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer +a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. Veja Ajuda para maiores informações.

            5. @@ -178,53 +172,51 @@
            "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Modelar Especificação de Requisitos"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

            Você pode gerenciar documentos de Especificação de Requisitos.

            +$TLS_htmltext_title['reqSpecMgmt'] = "Modelar Especificação de Requisitos"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

            Você pode gerenciar documentos de Especificação de Requisitos.

            Especificação de Requisitos

            -

            Requisitos estão agrupados por documentos de Especificação de Requisitos , os quais estão relacionados ao -Projeto de Teste.
            O TestLink não suporta (ainda) versões para Especificação de Requisitos +

            Requisitos estão agrupados por documentos de Especificação de Requisitos , os quais estão relacionados ao +Projeto de Teste.
            O TestLink não suporta (ainda) versões para Especificação de Requisitos e também Requisitos. Logo, a versão do documento deve ser inserida após o Título da Especificação. -Um usuário pode inserir uma descrição simples ou notas no campo Escopo.

            +Um usuário pode inserir uma descrição simples ou notas no campo Escopo.

            -

            Sobrescrever o contador de Requisitos serve para +

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos requisitos no caso de nem todos os requisitos estarem adicionados ao TestLink. -O valor 0 significa que o contador de requisitos atual é utilizado +O valor 0 significa que o contador de requisitos atual é utilizado para métricas.

            -

            E.g. SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de +

            E.g. SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de 25% (se todos estes requisitos forem testados).

            Requisitos

            Clique no título da Especificação de Requisitos criada, e se nenhuma existir, " . - "clique no nó do projeto para criar uma. Você pode criar, editar, excluir + "clique no nó do projeto para criar uma. Você pode criar, editar, excluir ou importar requisitos para o documento. Cada requisito tem um título, escopo e status. -O status deve ser 'Válido' ou 'Não testável'. Requisitos Não Testáveis não são contabilizados -para métricas. Este parâmetro deve ser utilizado para características não implementadas e +O status deve ser 'Válido' ou 'Não testável'. Requisitos Não Testáveis não são contabilizados +para métricas. Este parâmetro deve ser utilizado para características não implementadas e requisitos modelados incorretamente.

            -

            Você pode criar novos casos de teste para os requisitos utilizando multi ações para os -requisitos ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suíte de Teste -com nome definido na configuração (default is: \$tlCfg->req_cfg->default_testsuite_name = +

            Você pode criar novos casos de teste para os requisitos utilizando multi ações para os +requisitos ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suíte de Teste +com nome definido na configuração (default is: \$tlCfg->req_cfg->default_testsuite_name = 'Test suite created by Requirement - Auto';). Título e Escopo são copiados destes Casos de Teste.

            "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Imprimir documento de Especificação de Requisitos"; //printReq +$TLS_htmltext_title['printReqSpec'] = "Imprimir documento de Especificação de Requisitos"; // printReq $TLS_htmltext['printReqSpec'] = "

            Objetivo:

            -

            Através desta opção você pode imprimir um requisito único, todos os requisitos de uma Especificação de Requisitos, +

            Através desta opção você pode imprimir um requisito único, todos os requisitos de uma Especificação de Requisitos, ou todos os requisitos de um Projeto de Teste.

            Iniciar:

            1. -

              Selecione as partes dos requisitos que você deseja exibir, e então clique em requisito, +

              Selecione as partes dos requisitos que você deseja exibir, e então clique em requisito, especificação de requisito ou projeto de teste. A visualização da impressão será exibida.

            2. -
            3. Utilize a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer -a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. +

            4. Utilize a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer +a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. Veja Ajuda para mais informações.

            5. @@ -233,43 +225,41 @@
            "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Atribuição de Palavras-chave"; -$TLS_htmltext['keywordsAssign'] = "

            Objetivo:

            -

            A página de Atribuição de Palavras-chave é o lugar onde os usuários podem +$TLS_htmltext_title['keywordsAssign'] = "Atribuição de Palavras-chave"; +$TLS_htmltext['keywordsAssign'] = "

            Objetivo:

            +

            A página de Atribuição de Palavras-chave é o lugar onde os usuários podem atribuir em lotes Palavras-chave às Suítes de Teste ou Casos de Teste.

            Para Atribuir Palavras-chave:

              -
            1. Selecione uma Suíte de Teste ou Caso de Teste na árvore +
            2. Selecione uma Suíte de Teste ou Caso de Teste na árvore à esquerda.
            3. -
            4. O box no topo da página que exibe informações do lado direito - permitirá a você atribuir palavras-chave para os casos de +
            5. O box no topo da página que exibe informações do lado direito + permitirá a você atribuir palavras-chave para os casos de teste individualmente.
            6. -
            7. A seleção abaixo permite a você atribuir Casos de Teste em um +
            8. A seleção abaixo permite a você atribuir Casos de Teste em um nivel mais granular.

            Informação Importante quanto à Atribuição de Palavras-chave nos Planos de Teste:

            -

            Atribuir Palavras-chave à Suíte de Teste afetará somente Casos de Teste -no seu Plano de Teste somente se o Plano de Teste conter a última versão do Caso de Teste. -Caso contrário, se o Plano de Teste conter versões mais antigas do Caso de Teste, as atribuições que você +

            Atribuir Palavras-chave à Suíte de Teste afetará somente Casos de Teste +no seu Plano de Teste somente se o Plano de Teste conter a última versão do Caso de Teste. +Caso contrário, se o Plano de Teste conter versões mais antigas do Caso de Teste, as atribuições que você fez NÃO aparecerão no Plano de Teste.

            -

            O TestLink usa esta abordagem para que versões mais antigas dos Casos de Teste nos Planos de Teste não sejam afetadas pela atribuição -de Palavras-chave que você fez nas versões mais recentes dos Casos de Teste. Se você deseja seus -Casos de Teste no seu Plano de Teste sejam atualizados, primeiro verifique se eles estão atualizados +

            O TestLink usa esta abordagem para que versões mais antigas dos Casos de Teste nos Planos de Teste não sejam afetadas pela atribuição +de Palavras-chave que você fez nas versões mais recentes dos Casos de Teste. Se você deseja seus +Casos de Teste no seu Plano de Teste sejam atualizados, primeiro verifique se eles estão atualizados utilizando a funcionalidade 'Atualizar Versão dos Casos de Teste' antes de fazer a atribuição das Palavras-chave.

            "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Execução dos Casos de Teste"; -$TLS_htmltext['executeTest'] = "

            Objetivo:

            +$TLS_htmltext_title['executeTest'] = "Execução dos Casos de Teste"; +$TLS_htmltext['executeTest'] = "

            Objetivo:

            -

            Permite aos usuários executar os Casos de Teste. O usuário pode atribuir resultados +

            Permite aos usuários executar os Casos de Teste. O usuário pode atribuir resultados aos Casos de Teste nos Ciclo de Teste. Veja a ajuda para mais informações sobre filtros e configurações " . - "(clique no ícone interrogação).

            + "(clique no ícone interrogação).

            Iniciar:

            @@ -277,19 +267,19 @@
          • O usuário deve definir um Ciclo de Teste para o Plano de Teste.
          • Selecionar um Ciclo de Teste no menu drop down
          • Se você quiser ver apenas alguns poucos casos de teste, em vez de toda a árvore, - você pode escolher quais filtros aplicar. Clique no botão \"Aplicar\" - depois que você alterar os filtros.
          • + você pode escolher quais filtros aplicar. Clique no botão \"Aplicar\" + depois que você alterar os filtros.
          • Clique no Caso de Teste no menu em árvore.
          • Preencha o resultado do Caso de Teste, suas respectivas notas e/ou bugs.
          • Salve os resultados.
          • -

            Nota: O TestLink deve ser configurado para colaborar com seu Bugtracker +

            Nota: O TestLink deve ser configurado para colaborar com seu Bugtracker se você quiser criar ou rastrear problemas reportados diretamente da GUI.

            "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Descrição dos Relatórios de Teste e Métricas"; -$TLS_htmltext['showMetrics'] = "

            Os relatórios estão relacionados a um Plano de Teste " . - "(definido no topo do navegador). Este Plano de Teste pode diferir do Plano de Teste +$TLS_htmltext_title['showMetrics'] = "Descrição dos Relatórios de Teste e Métricas"; +$TLS_htmltext['showMetrics'] = "

            Os relatórios estão relacionados a um Plano de Teste " . + "(definido no topo do navegador). Este Plano de Teste pode diferir do Plano de Teste corrente para execução. Você também pode selecionar formatos dos relatórios:

            • Normal - relatório é exibido em uma página web
            • @@ -312,69 +302,69 @@

              Métricas Gerais do Plano de Teste

              Esta página exibe somente o último status de um Plano de Teste por Suíte de Teste, Testador e palavras-chave. -O 'último status' é determinado pelo ciclo mais recente onde os Casos de Teste foram executados. Por exemplo, +O 'último status' é determinado pelo ciclo mais recente onde os Casos de Teste foram executados. Por exemplo, se um Caso de Teste foi executado em diversos Ciclos de Teste, somente o último resultado é considerado.

              O 'último resultado' é um conceito utilizado em vários relatórios, e é determinado como a seguir:

                -
              • A ordem em cada Ciclo de Teste (Baseline) é adicionada ao Plano de Teste determina qual é o Ciclo de Teste mais recente. Os resultados do Ciclo de Teste -mais recente prevalecerão sobre os Ciclos de Teste mais antigos. Por exemplo, se você marcar um teste com +
              • A ordem em cada Ciclo de Teste (Baseline) é adicionada ao Plano de Teste determina qual é o Ciclo de Teste mais recente. Os resultados do Ciclo de Teste +mais recente prevalecerão sobre os Ciclos de Teste mais antigos. Por exemplo, se você marcar um teste com status 'Falhou' no Ciclo de Teste 1 e no Ciclo de Teste 2 como 'Passou', o último resultado será 'Passou'.
              • -
              • Se um Caso de Teste é executado diversas vezes em um mesmo Ciclo de Teste, o resultado mais recente -prevalecerá. Por exemplo, se o Ciclo de Teste 3 é liberado para a equipe de testes e o Testador 1 marcar 'Passou' as 14h, +
              • Se um Caso de Teste é executado diversas vezes em um mesmo Ciclo de Teste, o resultado mais recente +prevalecerá. Por exemplo, se o Ciclo de Teste 3 é liberado para a equipe de testes e o Testador 1 marcar 'Passou' as 14h, e o Testador 2 marcar 'Falhou' as 15h, isto aparecerá como 'Falhou'.
              • -
              • Casos de Teste marcados como 'Não Executado' no último Ciclo de Teste não serão considerados. Por exemplo, se você marcar -um Caso de Teste como 'Passou' no Ciclo de Teste 1 e não executar no Ciclo de Teste 2, o último resultado será considerado como +
              • Casos de Teste marcados como 'Não Executado' no último Ciclo de Teste não serão considerados. Por exemplo, se você marcar +um Caso de Teste como 'Passou' no Ciclo de Teste 1 e não executar no Ciclo de Teste 2, o último resultado será considerado como 'Passou'.

              As seguintes tabelas são exibidas:

              • Resultados por Suíte de Teste de Nível Top - Lista os resultados Top de cada Suíte de Teste. Total de Casos de Teste, Passou, Falhou, Bloqueado, Não Executado e o percentual + Lista os resultados Top de cada Suíte de Teste. Total de Casos de Teste, Passou, Falhou, Bloqueado, Não Executado e o percentual completo são listados. Um Caso de Teste 'completo' é aquele que foi marcado como Passou, Falhou ou Bloqueado. Os resultados das suites de nível superior incluem as suites filho.
              • Resultados por Palavra-chave - Lista todas as palavras-chave que estão atribuídas aos Casos de Teste no Plano de Teste corrente, e os resultados associados + Lista todas as palavras-chave que estão atribuídas aos Casos de Teste no Plano de Teste corrente, e os resultados associados à eles.
              • Resultados por Testador - Lista cada Testador que tem Casos de Teste associados a ele no Plano de Teste corrente. Os Casos de Teste que + Lista cada Testador que tem Casos de Teste associados a ele no Plano de Teste corrente. Os Casos de Teste que não estão atribuídos são computados abaixo com a descrição 'desatribuir'.

              Status Geral dos Ciclos de Teste

              -

              Lista os resultados de execução para cada Ciclo de Teste. Para cada Ciclo de Teste, o total de Casos de Teste, total com Passou, -% Passou, total Falha, % Falha, Bloqueado, % Bloqueado, Não Executado e % Não Executado. Se um Caso de Teste foi executado +

              Lista os resultados de execução para cada Ciclo de Teste. Para cada Ciclo de Teste, o total de Casos de Teste, total com Passou, +% Passou, total Falha, % Falha, Bloqueado, % Bloqueado, Não Executado e % Não Executado. Se um Caso de Teste foi executado duas vezes no mesmo Ciclo de Teste, a execução mais recente será considerada.

              Métricas da Consulta

              Este relatório consiste em uma página com o formulário de consulta e uma página com os resultados, a qual contém os dados da consulta. -A página com o formulário de consulta apresenta 4 controles. Cada controle está definido com um valor padrão que -maximiza o número de Casos de Teste e Ciclos de Teste que a consulta deve ser executada. Alterar os controles -permite aos usuários filtrar os resultados e gerar relatório específicos para Testadores em específico, palavras-chave, Suítes de Teste +A página com o formulário de consulta apresenta 4 controles. Cada controle está definido com um valor padrão que +maximiza o número de Casos de Teste e Ciclos de Teste que a consulta deve ser executada. Alterar os controles +permite aos usuários filtrar os resultados e gerar relatório específicos para Testadores em específico, palavras-chave, Suítes de Teste e combinação de Ciclos de Teste.

                -
              • Palavras-chave 0->1 palavras-chave podem ser selecionadas. Por padrão, nenhuma palavra-chave é selecionada. Se uma palavra-chave não é -selecionada, então todos os Casos de Teste serão considerados indiferentemente de atribuição de palavras-chave. Palavras-chave são atribuídas -na especificação de testes ou na página Gerenciar Palavra-chave. Palavras-chave atribuídas aos Casos de Teste alcançam todos os Planos de Teste, e -também todas as versões de um Caso de Teste. Se você está interessado nos resultados para uma palavra-chave específica, +
              • Palavras-chave 0->1 palavras-chave podem ser selecionadas. Por padrão, nenhuma palavra-chave é selecionada. Se uma palavra-chave não é +selecionada, então todos os Casos de Teste serão considerados indiferentemente de atribuição de palavras-chave. Palavras-chave são atribuídas +na especificação de testes ou na página Gerenciar Palavra-chave. Palavras-chave atribuídas aos Casos de Teste alcançam todos os Planos de Teste, e +também todas as versões de um Caso de Teste. Se você está interessado nos resultados para uma palavra-chave específica, você deverá alterar este controle.
              • -
              • Testador 0->1 Testadores podem ser selecionados. Por padrão, nenhum Testador é selecionado. Se um Testador não é selecionado, -então todos os Casos de Teste serão considerados indiferentes de Testador atribuído. Atualmente não há funcionalidade -para buscar por Casos de Teste não atribuídos. O Testador é atribuído através da página 'Atribuir Casos de Teste para Execução' -e é feito com base no Plano de Teste. Se você está interessado em trabalhar com um Testador em específico, você deve +
              • Testador 0->1 Testadores podem ser selecionados. Por padrão, nenhum Testador é selecionado. Se um Testador não é selecionado, +então todos os Casos de Teste serão considerados indiferentes de Testador atribuído. Atualmente não há funcionalidade +para buscar por Casos de Teste não atribuídos. O Testador é atribuído através da página 'Atribuir Casos de Teste para Execução' +e é feito com base no Plano de Teste. Se você está interessado em trabalhar com um Testador em específico, você deve alterar este controle.
              • -
              • Suíte de Teste de Nível Top 0->n Suítes de Teste de Nível Top podem ser selecionadas. Por padrão, todas as Suítes de Teste são selecionadas. -Apenas as Suítes de Teste que são selecioadas serão consultadas para as métricas do resultado. Se você está somente interessado em resultados +
              • Suíte de Teste de Nível Top 0->n Suítes de Teste de Nível Top podem ser selecionadas. Por padrão, todas as Suítes de Teste são selecionadas. +Apenas as Suítes de Teste que são selecioadas serão consultadas para as métricas do resultado. Se você está somente interessado em resultados para uma Suíte de Teste específica você precisa alterar este controle.
              • -
              • Ciclos de Teste 1->n Ciclos de Teste podem ser selecionados. Por padrão, todos os Ciclos de Teste são selecionados. Somente execuções -realizadas no Ciclo de Teste que você selecionou serão consideradas quando produzirem métricas. Por exemplo, se você quiser -ver quantos Casos de Teste foram executados nos últimos 3 Ciclos de Teste, você precisa alterar este controle. A seleção de Palavra-chave, -Testador e Suíte de Teste de Nível Top ditarão o número de Casos de Teste do seu Plano de Teste e serão usados para -calcular as métricas por Suite de Teste e Plano de Teste. Por exemplo, se você selecionar o Testador = 'José', palavra-chave = -'Prioridade 1', e todas as Suítes de Teste disponíveis, somente Casos de Teste com Prioridade 1 atribuídos para José serão considerados. +
              • Ciclos de Teste 1->n Ciclos de Teste podem ser selecionados. Por padrão, todos os Ciclos de Teste são selecionados. Somente execuções +realizadas no Ciclo de Teste que você selecionou serão consideradas quando produzirem métricas. Por exemplo, se você quiser +ver quantos Casos de Teste foram executados nos últimos 3 Ciclos de Teste, você precisa alterar este controle. A seleção de Palavra-chave, +Testador e Suíte de Teste de Nível Top ditarão o número de Casos de Teste do seu Plano de Teste e serão usados para +calcular as métricas por Suite de Teste e Plano de Teste. Por exemplo, se você selecionar o Testador = 'José', palavra-chave = +'Prioridade 1', e todas as Suítes de Teste disponíveis, somente Casos de Teste com Prioridade 1 atribuídos para José serão considerados. O '# de Casos de Teste' totais que você verá neste relatório serão influenciados por estes 3 controles. -A seleção dos Ciclos de Teste influenciarão se o Caso de Teste é considerado 'Passou', 'Falhou', 'Bloqueado', ou 'Não Executado'. +A seleção dos Ciclos de Teste influenciarão se o Caso de Teste é considerado 'Passou', 'Falhou', 'Bloqueado', ou 'Não Executado'. Favor classificar com a regra 'Somente os últimos resultados' à medida em que elas aparecem acima.

              Pressione o botão 'Executar Pesquisa' para prosseguir com a consulta e exibir a página com os resultados.

              @@ -383,42 +373,41 @@
              1. o parâmetro da consulta utilizado para criar o relatório
              2. totais para todo o Plano de Teste
              3. -
              4. por um conjunto de particionamento dos totais (Soma / Passou / Falhou / Bloqueado / Não Executado) e todas execuções realizadas -na Suíte de Teste. Se um Caso de Teste foi executado mais de uma vez em múltiplos Ciclos de Teste, todas as execuções que foram gravadas serão -exibidas nos Ciclos de Teste selecionados. No entanto, o resumo para esta Suíte de Teste somente incluirá o último resultado para +
              5. por um conjunto de particionamento dos totais (Soma / Passou / Falhou / Bloqueado / Não Executado) e todas execuções realizadas +na Suíte de Teste. Se um Caso de Teste foi executado mais de uma vez em múltiplos Ciclos de Teste, todas as execuções que foram gravadas serão +exibidas nos Ciclos de Teste selecionados. No entanto, o resumo para esta Suíte de Teste somente incluirá o último resultado para o Ciclo de Teste selecionado.

              Relatórios de Casos de Teste Bloqueados, com Falha e Não Executados

              -

              Estes relatórios exibem todos os Casos de Teste Bloqueados, com Falha e Não Executados. A lógica do último resultado dos testes -(que está descrita nas Métricas Gerais do Plano de Teste) é novamente empregada para determinar se um Caso de Teste deve ser -considerado Bloquedo, com Falha ou Não Executado. Casos de Teste Bloqueado e com Falha exibirão os bugs associados se o usuário +

              Estes relatórios exibem todos os Casos de Teste Bloqueados, com Falha e Não Executados. A lógica do último resultado dos testes +(que está descrita nas Métricas Gerais do Plano de Teste) é novamente empregada para determinar se um Caso de Teste deve ser +considerado Bloquedo, com Falha ou Não Executado. Casos de Teste Bloqueado e com Falha exibirão os bugs associados se o usuário estiver utilizando um sistema de Bugtracking.

              Relatório de Testes

              -

              Exibe o status de cada Caso de Teste em todos os Ciclos de Teste. O resultado da execução mais recente será utilizado -se um Caso de Teste for executado múltiplas vezes em um mesmo Ciclo de Teste. É recomendado exportar este relatório para +

              Exibe o status de cada Caso de Teste em todos os Ciclos de Teste. O resultado da execução mais recente será utilizado +se um Caso de Teste for executado múltiplas vezes em um mesmo Ciclo de Teste. É recomendado exportar este relatório para o formato em Excel para um fácil manuseio se um grande conjunto de dados estiver em utilização.

              Gráficos - Métricas Gerais do Plano de Teste

              -

              A lógica do último resultado é utilizada para todos os gráficos que você verá. Os gráficos são animados para ajudar +

              A lógica do último resultado é utilizada para todos os gráficos que você verá. Os gráficos são animados para ajudar o usuário à visualizar as métricas do Plano de Teste atual. Os quatro gráficos fornecidos são:

              • Gráfico de pizza com todos os Casos de Teste com status Passou, com Falha, Bloqueados e Não Executados
              • Gráfico de barras com os Resultados por palavra-chave
              • Gráfico de barras com os Resultados por Testador
              • Gráfico de barras com os Resultados por Suítes Nível Top
              -

              As seções e barras dos gráficos são coloridos de modo que o usuário possa identificar o número aproximado de Casos de Teste com status +

              As seções e barras dos gráficos são coloridos de modo que o usuário possa identificar o número aproximado de Casos de Teste com status Passou, Falhou, Bloqueado e Não Executado.

              Bugs por Casos de Teste

              -

              Este relatório exibe cada Caso de Teste com todos os bugs abertos para ele em todo o projeto. +

              Este relatório exibe cada Caso de Teste com todos os bugs abertos para ele em todo o projeto. Este relatório está disponível somente se um Bugtracking estiver conectado.

              "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Adicionar / Remover Casos de Teste do Plano de Teste"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

              Objetivo:

              +$TLS_htmltext_title['planAddTC'] = "Adicionar / Remover Casos de Teste do Plano de Teste"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

              Objetivo:

              Permite aos usuários (com perfil de Líder de Testes) a adicionar ou remover Casos de Teste do Plano de Teste.

              Para adicionar ou remover Casos de Teste:

              @@ -429,8 +418,8 @@ "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Atribuir Testadores à Execução de Testes"; -$TLS_htmltext['tc_exec_assignment'] = "

              Objetivo:

              +$TLS_htmltext_title['tc_exec_assignment'] = "Atribuir Testadores à Execução de Testes"; +$TLS_htmltext['tc_exec_assignment'] = "

              Objetivo:

              Esta página permite aos Líderes de Teste atribuir usuários a testes específicos dentro do Plano de Teste.

              Iniciar:

              @@ -442,12 +431,12 @@ "; // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Atualizar Casos de Teste no Plano de Teste"; -$TLS_htmltext['planUpdateTC'] = "

              Objetivo:

              -

              Esta página permite atualizar Casos de Teste para uma versão mais nova (diferente) da +$TLS_htmltext_title['planUpdateTC'] = "Atualizar Casos de Teste no Plano de Teste"; +$TLS_htmltext['planUpdateTC'] = "

              Objetivo:

              +

              Esta página permite atualizar Casos de Teste para uma versão mais nova (diferente) da Especificação de Casos de Teste quando alterada. Isto frequentemente acontece quando uma funcionalidade é alterada durante os testes." . - " O usuário modifica a Especificação de Teste, mas as alterações precisam se propagar ao Plano de Teste também. De qualquer forma," . - " o Plano de Teste mantém as versões originais para garantir que os resultados se referem ao texto correto dos Casos de Teste.

              + " O usuário modifica a Especificação de Teste, mas as alterações precisam se propagar ao Plano de Teste também. De qualquer forma," . + " o Plano de Teste mantém as versões originais para garantir que os resultados se referem ao texto correto dos Casos de Teste.

              Iniciar:

                @@ -457,29 +446,27 @@
              1. Para comprovar: abra a página de execução para verificar o texto do(s) Caso(s) de Teste.
              "; - // ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Especificar testes com prioridade alta ou baixa"; -$TLS_htmltext['test_urgency'] = "

              Objetivo:

              -

              O TestLink permite definir a urgência das Suítes de Teste para afetar a prioridade dos Casos de Teste. - A priorização dos testes depende da importância do Caso de Teste e da urgência definida no Plano de Teste. - O Líder de Teste deve especificar um conjunto de Casos de Teste que devem ser testados primeiro. Isso - ajuda a assegurar que os testes cobrirão os requisitos mais importantes também sob a +$TLS_htmltext_title['test_urgency'] = "Especificar testes com prioridade alta ou baixa"; +$TLS_htmltext['test_urgency'] = "

              Objetivo:

              +

              O TestLink permite definir a urgência das Suítes de Teste para afetar a prioridade dos Casos de Teste. + A priorização dos testes depende da importância do Caso de Teste e da urgência definida no Plano de Teste. + O Líder de Teste deve especificar um conjunto de Casos de Teste que devem ser testados primeiro. Isso + ajuda a assegurar que os testes cobrirão os requisitos mais importantes também sob a pressão do tempo.

              Iniciar:

                -
              1. Escolha uma Suíte de Teste para definiar a urgência do produto/componente no navegador +
              2. Escolha uma Suíte de Teste para definiar a urgência do produto/componente no navegador ao lado esquerdo da janela.
              3. -
              4. Escolha o nível de urgência (Alta, Média ou Baixa). O nível médio é o padrão. Você pode - diminuir a prioridade para partes do produtos não alteradas e aumentar para componentes +
              5. Escolha o nível de urgência (Alta, Média ou Baixa). O nível médio é o padrão. Você pode + diminuir a prioridade para partes do produtos não alteradas e aumentar para componentes com mudanças significativas.
              6. Pressione o botão 'Salvar' para aplicar as alterações.
              -

              Por exemplo, um Caso de Teste com prioridade Alta em uma Suíte de Teste com urgência Baixa +

              Por exemplo, um Caso de Teste com prioridade Alta em uma Suíte de Teste com urgência Baixa será de prioridade Média."; - // ------------------------------------------------------------------------------------------ ?> diff --git a/locale/pt_PT/description.php b/locale/pt_PT/description.php index 93f5693585..6ac91d9d64 100644 --- a/locale/pt_PT/description.php +++ b/locale/pt_PT/description.php @@ -1,87 +1,87 @@ -Opções para a produção do documento -

              Esta tabela permite ao utilizador filtrar os Casos de Teste antes de serem visualizados. -Se selecionado (marcado) os dados serão mostrados. Para alterar os dados -apresentados, marque ou desmarque clicando no Filtro, e selecione o nível +

              Esta tabela permite ao utilizador filtrar os Casos de Teste antes de serem visualizados. +Se selecionado (marcado) os dados serão mostrados. Para alterar os dados +apresentados, marque ou desmarque clicando no Filtro, e selecione o nível desejado na árvore de dados.

              -

              Cabeçalho do Documento: Os utilizadores podem filtrar informações no cabeçalho do documento. -As informações do cabeçalho do documento incluem: Introdução, Âmbito, +

              Cabeçalho do Documento: Os utilizadores podem filtrar informações no cabeçalho do documento. +As informações do cabeçalho do documento incluem: Introdução, Âmbito, Referências, Metodologia de Teste, e Limitações de Teste.

              -

              Corpo do Caso de Teste: Os utilizadores podem filtrar informações do corpo do Caso de Teste. As informações do corpo do Caso de Teste +

              Corpo do Caso de Teste: Os utilizadores podem filtrar informações do corpo do Caso de Teste. As informações do corpo do Caso de Teste incluem: Resumo, Passos, Resultados Esperados, e Palavras Chave

              -

              Resumo do Caso de Teste: Os utilizadores podem filtrar informações do Resumo do Caso de Teste através do Título do Caso de Teste, -no entanto, eles não podem filtrar informações do Resumo do Caso de Teste através do Corpo de um Caso de Teste. -O resumo do Caso de Teste foi apenas parcialmente separado do corpo do Caso de Teste a fim de apoiar a visualização -do Título com um breve resumo e a ausência de Passos, Resultados Esperados, -e Palavras Chave. Se um utilizador decidir ver o corpo do Caso de Teste, o Resumo do Caso de Teste +

              Resumo do Caso de Teste: Os utilizadores podem filtrar informações do Resumo do Caso de Teste através do Título do Caso de Teste, +no entanto, eles não podem filtrar informações do Resumo do Caso de Teste através do Corpo de um Caso de Teste. +O resumo do Caso de Teste foi apenas parcialmente separado do corpo do Caso de Teste a fim de apoiar a visualização +do Título com um breve resumo e a ausência de Passos, Resultados Esperados, +e Palavras Chave. Se um utilizador decidir ver o corpo do Caso de Teste, o Resumo do Caso de Teste será sempre incluído.

              Tabela de Conteúdo: O TestLink insere uma lista com todos os títulos com seus links internos marcados.

              -

              Formatos de Saída: Existem várias possibilidades: HTML, OpenOffice Writer, OpenOffice Calc, Excel, -Word ou por E-mail (HTML).

              "; - -// testPlan.html +

              Formatos de Saída: Existem várias possibilidades: HTML, OpenOffice Writer, OpenOffice Calc, Excel, +Word ou por E-mail (HTML).

              "; + +// testPlan.html $TLS_hlp_testPlan = "

              Plano de Teste

              Geral

              -

              O Plano de Teste é uma abordagem sistemática ao teste de um sistema de software. Você pode organizar a atividade de teste com +

              O Plano de Teste é uma abordagem sistemática ao teste de um sistema de software. Você pode organizar a atividade de teste com versões particulares do produto em tempo e resultados rastreáveis.

              Execução do Teste

              -

              Esta é a secção onde os utilizadores podem executar os Casos de Teste (escrever os resultados dos testes) -e imprimir a Suite de Casos de Teste do Plano de Teste. Nesta secção os utilizadores podem -acompanhar os resultados da sua execução dos Casos de Teste.

              +

              Esta é a secção onde os utilizadores podem executar os Casos de Teste (escrever os resultados dos testes) +e imprimir a Suite de Casos de Teste do Plano de Teste. Nesta secção os utilizadores podem +acompanhar os resultados da sua execução dos Casos de Teste.

              Gestão do Plano de Teste

              -

              Esta secção, apenas acessível aos líderes, permite que os utilizadores possam administrar os Planos de Testes. -A administração de Planos de Testes envolve a criação/edição/eliminação de Planos, acréscimo/edição -/eliminação/atualização dos Casos de Teste dos Planos, criando versões, bem como definindo quem pode +

              Esta secção, apenas acessível aos líderes, permite que os utilizadores possam administrar os Planos de Testes. +A administração de Planos de Testes envolve a criação/edição/eliminação de Planos, acréscimo/edição +/eliminação/atualização dos Casos de Teste dos Planos, criando versões, bem como definindo quem pode ver qual Plano.
              -Utilizadores com permissão de líder poderão também definir a prioridade/risco e a propriedade das -Suites de Caso de Teste (categorias) e criar marcos de teste.

              - -

              Nota: É possível que os utilizadores não possam ver uma lista suspensa que contenha os Planos de Testes. -Nesta situação, todos os links (exceto para os líderes ativos) estarão desativados. Se você -estiver nesta situação, contacte a administração do TestLink para lhe conceder os -direitos de Projecto adequado ou criar um Plano de Teste para você.

              "; - -// custom_fields.html +Utilizadores com permissão de líder poderão também definir a prioridade/risco e a propriedade das +Suites de Caso de Teste (categorias) e criar marcos de teste.

              + +

              Nota: É possível que os utilizadores não possam ver uma lista suspensa que contenha os Planos de Testes. +Nesta situação, todos os links (exceto para os líderes ativos) estarão desativados. Se você +estiver nesta situação, contacte a administração do TestLink para lhe conceder os +direitos de Projecto adequado ou criar um Plano de Teste para você.

              "; + +// custom_fields.html $TLS_hlp_customFields = "

              Campos Personalizados

              Seguem alguns factos sobre a implementação de Campos Personalizados:

                @@ -97,13 +97,13 @@ atributos:

                • Nome do Campo Personalizado.
                • -
                • Capturar o nome da variável (ex: Este é o valor que é fornecido para a API lang_get(), +
                • Capturar o nome da variável (ex: Este é o valor que é fornecido para a API lang_get(), ou mostrado como se não for encontrado no ficheiro de linguagem).
                • Tipo do Campo Personalizado (texto, numérico, decimal, enumeração, email).
                • -
                • Possibilidade de enumerar os valores (ex: RED|YELLOW|BLUE), aplicável a uma lista, lista de multiseleção +
                • Possibilidade de enumerar os valores (ex: RED|YELLOW|BLUE), aplicável a uma lista, lista de multiseleção e tipos de combo.
                  Utilize o caractere pipe ('|') para -separar os possíveis valores para uma enumeração. Um dos possíveis valores pode ser +separar os possíveis valores para uma enumeração. Um dos possíveis valores pode ser um texto vazio.
                • Valor por omissão: NÃO IMPLEMENTADO AINDA.
                • @@ -120,26 +120,26 @@
                • Ativado no Planeamento do Plano de Teste. O utilizador pode alterar o valor durante o planeamento do Plano de Teste (adicionar Casos de Teste ao Plano de Teste).
                • Disponível para o utilizador escolher o tipo de campo.
                -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

                Executar Casos de Teste

                -

                Permite aos utilizadores 'Executar' os Casos de Teste. Uma Execução propriamente -dita é apenas a atribuição do resultado de um Caso de Teste (Passou, +

                Permite aos utilizadores 'Executar' os Casos de Teste. Uma Execução propriamente +dita é apenas a atribuição do resultado de um Caso de Teste (Passou, Falhado ou Bloqueado) de uma compilação selecionada.

                -

                O acesso a um Gestor de Ocorrências (Bugtracker) pode ser configurado. O utilizador pode adicionar diretamente novas Ocorrências e navegar pelas existentes. Consulte o manual de instalação para mais detalhes.

                "; - -//bug_add.html +

                O acesso a um Gestor de Ocorrências (Bugtracker) pode ser configurado. O utilizador pode adicionar diretamente novas Ocorrências e navegar pelas existentes. Consulte o manual de instalação para mais detalhes.

                "; + +// bug_add.html $TLS_hlp_btsIntegration = "

                Adicionar Ocorrências ao Caso de Teste

                (apenas se estiver configurado) -O TestLink possui uma integração muito simples com os sistemas de Gestão de Ocorrências, -mas não é capaz de enviar um pedido de abertura de Ocorrência ao Gestor de Ocorrências ou receber de volta o ID da Ocorrência. +O TestLink possui uma integração muito simples com os sistemas de Gestão de Ocorrências, +mas não é capaz de enviar um pedido de abertura de Ocorrência ao Gestor de Ocorrências ou receber de volta o ID da Ocorrência. A integração é feita utilizando um link para a página do Gestor de Ocorrências, com as seguintes características:

                • Inserir nova Ocorrência.
                • Exibição das informações da Ocorrência.
                -

                +

                Processo para adicionar uma nova Ocorrência

                @@ -148,15 +148,15 @@

              • Passo 2: Anote o ID da Ocorrência gerada pelo Gestor de Ocorrências.
              • Passo 3: Escreva o ID da Ocorrência no campo de entrada.
              • Passo 4: Clique no botão Adicionar Ocorrência
              • -
              +
            Depois de fechar a página de Adição de Ocorrência, os dados relevantes da Ocorrência serão mostrados na página de execução. -

            "; - -// execFilter.html +

            "; + +// execFilter.html $TLS_hlp_executeFilter = "

            Configurações

            -

            Em Configurações é possível que você selecione o Plano de Teste, a Build e +

            Em Configurações é possível que você selecione o Plano de Teste, a Build e a Plataforma (se disponível) para ser executado.

            Plano de Teste

            @@ -170,85 +170,82 @@

            Filtros

            Os Filtros proporcionam a oportunidade de influenciar ainda mais o conjunto de Casos de Teste mostrados. -Através dos Filtros é possível diminuir o conjunto de Casos de Teste mostrados. Selecione +Através dos Filtros é possível diminuir o conjunto de Casos de Teste mostrados. Selecione os filtros desejados e clique no botão \"Aplicar\".

            -

            Os Filtros Avançados permitem que você especifique um conjunto de valores para filtros aplicáveis +

            Os Filtros Avançados permitem que você especifique um conjunto de valores para filtros aplicáveis ​​usando Ctrl + Clique dentro de cada ListBox.

            Filtro de Palavra Chave

            -

            Você pode filtrar os Casos de Teste pelas Palavras Chave que foram atribuídas. Você pode escolher " . -"múltiplas Palavras Chave utilizando Ctrl + Clique. Se você escolher mais que uma Palavra Chave, você pode " . -"decidir se apenas serão mostrados os Casos de Teste que contêm todas as Palavras Chave selecionadas " . -"(botão \"E\") ou pelo menos uma das Palavras Chave escolhidas (botão \"OU\").

            +

            Você pode filtrar os Casos de Teste pelas Palavras Chave que foram atribuídas. Você pode escolher " . + "múltiplas Palavras Chave utilizando Ctrl + Clique. Se você escolher mais que uma Palavra Chave, você pode " . + "decidir se apenas serão mostrados os Casos de Teste que contêm todas as Palavras Chave selecionadas " . + "(botão \"E\") ou pelo menos uma das Palavras Chave escolhidas (botão \"OU\").

            Filtro de Prioridade

            -

            Você pode filtrar os Casos de Teste pela prioridade do Teste. A prioridade do Teste é a \"importância do Caso de Teste\" " . -"combinado com \"a urgência do Teste\" dentro do Plano de Teste atual.

            +

            Você pode filtrar os Casos de Teste pela prioridade do Teste. A prioridade do Teste é a \"importância do Caso de Teste\" " . + "combinado com \"a urgência do Teste\" dentro do Plano de Teste atual.

            Filtro de Utilizador

            -

            Você pode filtrar os Casos de Teste que não estão atribuídos (\"Ninguém\") ou atribuídos a \"Alguém\". " . -"Você também pode filtrar os Casos de Teste que são atribuídos a um Testador específico. Se você escolheu um Testador " . -"específico, também existe a possibilidade de mostrar os Casos de Teste que estão por serem atribuídos " . -"(Filtros avançados estão disponíveis).

            +

            Você pode filtrar os Casos de Teste que não estão atribuídos (\"Ninguém\") ou atribuídos a \"Alguém\". " . + "Você também pode filtrar os Casos de Teste que são atribuídos a um Testador específico. Se você escolheu um Testador " . + "específico, também existe a possibilidade de mostrar os Casos de Teste que estão por serem atribuídos " . + "(Filtros avançados estão disponíveis).

            Filtro de Resultado

            -

            Você pode filtrar os Casos de Teste pelos resultados (Filtros avançados estão disponíveis). Você pode filtrar por " . -"resultado \"na Build escolhida para a execução\", \"na última execução\", \"em TODAS as Builds\", " . -"\"em QUALQUER Build\" e \"em uma Build específica\". Se \"uma Build específica\" for escolhida, então você pode " . -"especificar a Build.

            "; - - -// newest_tcversions.html +

            Você pode filtrar os Casos de Teste pelos resultados (Filtros avançados estão disponíveis). Você pode filtrar por " . + "resultado \"na Build escolhida para a execução\", \"na última execução\", \"em TODAS as Builds\", " . + "\"em QUALQUER Build\" e \"em uma Build específica\". Se \"uma Build específica\" for escolhida, então você pode " . + "especificar a Build.

            "; + +// newest_tcversions.html $TLS_hlp_planTcModified = "

            Versões mais recentes do Caso de Teste

            -

            Todo o conjunto de Casos de Teste ligados ao Plano de Teste é analisado, e uma lista de Casos +

            Todo o conjunto de Casos de Teste ligados ao Plano de Teste é analisado, e uma lista de Casos de Teste que têm uma versão mais recente é mostrada (contra o conjunto atual do Plano de Teste). -

            "; - - -// requirementsCoverage.html +

            "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

            Cobertura de Requisitos


            -

            Este recurso permite mapear uma cobertura de utilizador ou Requisitos do sistema +

            Este recurso permite mapear uma cobertura de utilizador ou Requisitos do sistema por Casos de Teste. Navegue através do link \"Especificar Requisitos\" na tela principal.

            Especificação de Requisitos

            -

            Os Requisitos estão agrupados no documento 'Especificação de Requisitos' que está relacionado ao -Projecto de Testes.
            O TestLink ainda não suporta versões para a Especificação de Requisitos e -também para os Requisitos. Assim, a versão do documento deve ser adicionada depois do +

            Os Requisitos estão agrupados no documento 'Especificação de Requisitos' que está relacionado ao +Projecto de Testes.
            O TestLink ainda não suporta versões para a Especificação de Requisitos e +também para os Requisitos. Assim, a versão do documento deve ser adicionada depois do Título da Especificação. -O utilizador pode adicionar uma descrição simples ou uma nota no campo Âmbito.

            +O utilizador pode adicionar uma descrição simples ou uma nota no campo Âmbito.

            -

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos Requisitos no caso +

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos Requisitos no caso de nem todos os Requisitos estarem adicionados ao TestLink. -

            O valor 0 significa que a contagem atual de Requisitos é usado para métricas.

            -

            Ex: SRS inclui 200 Requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes +

            O valor 0 significa que a contagem atual de Requisitos é usado para métricas.

            +

            Ex: SRS inclui 200 Requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de 25% (se todos estes Requisitos forem testados).

            Requisitos

            -

            Clique no título para criar uma Especificação de Requisitos. Você pode criar, editar, apagar +

            Clique no título para criar uma Especificação de Requisitos. Você pode criar, editar, apagar ou importar Requisitos para este documento. Cada Requisito tem título, âmbito e status. O status deve ser \"Válido\" ou \"Não testado\". Requisitos não testados não são contabilizados -para as métricas. Este parâmetro deve ser utilizado para características não implementadas -e Requisitos modelados incorretamente.

            +para as métricas. Este parâmetro deve ser utilizado para características não implementadas +e Requisitos modelados incorretamente.

            -

            Você pode criar novos Casos de Teste para os Requisitos utilizando multi ações para os Requisitos -ativos na tela de especificação de Requisitos. Estes Casos de Teste são criados dentro da Suite de -Teste com nome definido na configuração (padrão é: $tlCfg->req_cfg->default_testsuite_name = +

            Você pode criar novos Casos de Teste para os Requisitos utilizando multi ações para os Requisitos +ativos na tela de especificação de Requisitos. Estes Casos de Teste são criados dentro da Suite de +Teste com nome definido na configuração (padrão é: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Título e Âmbito são copiados destes Casos de Teste.

            -"; - +"; + $TLS_hlp_req_coverage_table = "

            Cobertura:

            Um valor por ex. de \"40% (8/20)\" significa que 20 Casos de Teste devem ser criados para testar completamente este -Requisito. 8 destes já foram criados e associados ao Requisito, com +Requisito. 8 destes já foram criados e associados ao Requisito, com a cobertura de 40 %. -"; - - -// req_edit +"; + +// req_edit $TLS_hlp_req_edit = "

            Links internos no Âmbito:

            -

            Links internos servem ao propósito da criação de links a outros Requisitos / especificações de Requisitos +

            Links internos servem ao propósito da criação de links a outros Requisitos / especificações de Requisitos com uma sintaxe especial. O comportamento dos Links internos pode ser alterado no ficheiro de configuração.

            Uso: @@ -256,7 +253,7 @@ Link para Requisitos: [req]req_doc_id[/req]
            Link para Especificação de Requisitos: [req_spec]req_spec_doc_id[/req_spec]

            -

            O Projecto de Testes do Requisito / Especificação de Requisitos, uma versão e uma âncora +

            O Projecto de Testes do Requisito / Especificação de Requisitos, uma versão e uma âncora também podem ser especificados:
            [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
            Esta sintaxe também funciona para as especificações de Requisito (atributos de versão não tem nenhum efeito).
            @@ -266,10 +263,9 @@

            Sempre que uma alteração é feita, o Testlink irá pedir uma mensagem de log. Esta mensagem de log serve como rastreabilidade. Se apenas o âmbito do Requisito mudou, você pode decidir se deseja criar uma nova revisão ou não. Sempre que alguma coisa além do âmbito é alterado, você é forçado a criar uma nova revisão.

            -"; - - -// req_view +"; + +// req_view $TLS_hlp_req_view = "

            Links Diretos:

            É fácil compartilhar este documento com outros, basta clicar no ícone do globo no topo deste documento para criar um link direto.

            @@ -284,14 +280,13 @@

            Relações de Requisitos são usados ​​para relacionamentos de modelos entre os Requisitos. Relações personalizadas e a opção de permitir relações entre os Requisitos de diferentes Projectos de Testes podem ser configurados no ficheiro de configuração. -Se você definir a relação \"Requisito A é pai do Requisito B\", +Se você definir a relação \"Requisito A é pai do Requisito B\", o Testlink irá definir a relação \"Requisito B é filho do Requisito A\" implicitamente.

            -"; - - -// req_spec_edit +"; + +// req_spec_edit $TLS_hlp_req_spec_edit = "

            Links internos no Âmbito:

            -

            Links internos servem ao propósito da criação de links a outros Requisitos / especificações de Requisitos +

            Links internos servem ao propósito da criação de links a outros Requisitos / especificações de Requisitos com uma sintaxe especial. O comportamento dos Links internos pode ser alterado no ficheiro de configuração.

            Uso: @@ -299,25 +294,23 @@ Link para Requisitos: [req]req_doc_id[/req]
            Link para Especificação de Requisitos: [req_spec]req_spec_doc_id[/req_spec]

            -

            O Projecto de Testes do Requisito / Especificação de Requisitos, uma versão e uma âncora +

            O Projecto de Testes do Requisito / Especificação de Requisitos, uma versão e uma âncora também podem ser especificados:
            [req tproj=<tproj_prefix> anchor=<anchor_name> version=<version_number>]req_doc_id[/req]
            Esta sintaxe também funciona para as especificações de Requisito (atributos de versão não tem nenhum efeito).
            Se você não especificar a versão do Requisito completo, todas as versões serão mostradas.

            -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

            Sobre 'Campos Personalizados salvos'

            -Se você tiver definido e atribuído ao Projecto de Testes,
            +Se você tiver definido e atribuído ao Projecto de Testes,
            Campos Personalizados com:
            'Mostrar no desenho do Plano de Teste=true' e
            'Activar no desenho do Plano de Teste=true'
            você irá ver nesta página APENAS os Casos de Teste ligados ao Plano de Teste. -"; - - -// resultsByTesterPerBuild.tpl +"; + +// resultsByTesterPerBuild.tpl $TLS_hlp_results_by_tester_per_build_table = "Mais informações sobre os Testadores
            Se você clicar no nome do Testador nesta tabela, você irá ter uma visão mais detalhada sobre todos os Casos de Teste atribuídos para esse utilizador e o seu progresso de teste.

            @@ -325,11 +318,10 @@ Este relatório mostra os Casos de Teste, que são atribuídos a um utilizador específico e foram executados com base em cada Build ativa. Mesmo se um Caso de Teste foi executado por outro utilizador que não o utilizador atribuído, o Caso de Teste irá aparecer como executado pelo utilizador atribuído. -"; - - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/pt_PT/texts.php b/locale/pt_PT/texts.php index 0526dd8cf4..39b27adbae 100644 --- a/locale/pt_PT/texts.php +++ b/locale/pt_PT/texts.php @@ -1,100 +1,95 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * @package TestLink - * @author Martin Havlat - * @copyright 2003-2009, TestLink community - * @version GIT: $Id: texts.php,v 1.9.17 2017/02/20 23:54:34 HelioGuilherme66 Exp $ - * @link http://www.testlink.org/ - * - **/ - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['error'] = "Erro na Aplicação"; -$TLS_htmltext['error'] = "

            Ocorreu um erro inesperado. Por favor, verifique o event viewer ou " . - "logs para detalhes.

            Você está convidado para relatar o problema. Por favor, visite nosso " . - "website.

            "; - - - -$TLS_htmltext_title['assignReqs'] = "Atribuir Requisitos aos Casos de Teste"; -$TLS_htmltext['assignReqs'] = "

            Objetivo:

            -

            Os utilizadores podem criar relacionamentos entre requisitos e casos de teste. Um arquiteto pode -definir relacionamentos 0..n para 0..n., isto é, um caso de teste pode ser atribuído para nenhum, um ou mais -requisitos e vice versa. Assim a matriz de rastreabilidade ajuda a investigar a cobertura -dos requisitos de teste e finalmente quais falharam durante os testes. Esta +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * @package TestLink + * @author Martin Havlat + * @copyright 2003-2009, TestLink community + * @version GIT: $Id: texts.php,v 1.9.17 2017/02/20 23:54:34 HelioGuilherme66 Exp $ + * @link http://www.testlink.org/ + * + **/ + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['error'] = "Erro na Aplicação"; +$TLS_htmltext['error'] = "

            Ocorreu um erro inesperado. Por favor, verifique o event viewer ou " . + "logs para detalhes.

            Você está convidado para relatar o problema. Por favor, visite nosso " . + "website.

            "; + +$TLS_htmltext_title['assignReqs'] = "Atribuir Requisitos aos Casos de Teste"; +$TLS_htmltext['assignReqs'] = "

            Objetivo:

            +

            Os utilizadores podem criar relacionamentos entre requisitos e casos de teste. Um arquiteto pode +definir relacionamentos 0..n para 0..n., isto é, um caso de teste pode ser atribuído para nenhum, um ou mais +requisitos e vice versa. Assim a matriz de rastreabilidade ajuda a investigar a cobertura +dos requisitos de teste e finalmente quais falharam durante os testes. Esta análise serve como entrada para o próximo planeamento de teste.

            Iniciar:

              -
            1. Escolha um Caso de Teste na árvore à esquerda. O combo box com a lista de +
            2. Escolha um Caso de Teste na árvore à esquerda. O combo box com a lista de Especificações de Requisitos é exibido no topo da área de trabalho.
            3. -
            4. Escolha um documento de Especificação se mais de um estiver definido. +
            5. Escolha um documento de Especificação se mais de um estiver definido. O TestLink recarregará a página automaticamente.
            6. -
            7. Um bloco ao centro da área de trabalho lista todos os requisitos (para a Especificação selecionada), que - está conectada ao caso de teste. O bloco abaixo 'Requisitos Disponíveis' lista todos - os requisitos que não estão relacionados - ao caso de teste selecionado. Um arquiteto pode selecionar requisitos que são cobertos por este - caso de teste e então clicar em 'Atribuir'. Este novo caso de teste atribuído será exibido no +
            8. Um bloco ao centro da área de trabalho lista todos os requisitos (para a Especificação selecionada), que + está conectada ao caso de teste. O bloco abaixo 'Requisitos Disponíveis' lista todos + os requisitos que não estão relacionados + ao caso de teste selecionado. Um arquiteto pode selecionar requisitos que são cobertos por este + caso de teste e então clicar em 'Atribuir'. Este novo caso de teste atribuído será exibido no bloco central 'Requisitos atribuídos'.
            9. -
            "; +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Especificação de Teste"; +$TLS_htmltext['editTc'] = "

            A Especificação de Teste permite aos utilizadores visualizar " . + "e editar todas as Suites de Teste e Casos de Teste existentes. " . + "Os Casos de Teste são versionados e todas as versões anteriores estão disponíveis e podem ser " . + "visualizadas e geridas aqui.

            - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Especificação de Teste"; -$TLS_htmltext['editTc'] = "

            A Especificação de Teste permite aos utilizadores visualizar " . - "e editar todas as Suites de Teste e Casos de Teste existentes. " . - "Os Casos de Teste são versionados e todas as versões anteriores estão disponíveis e podem ser " . - "visualizadas e geridas aqui.

            -

            Iniciar:

              -
            1. Selecione o seu Projecto de Testes na árvore de navegação (o nó principal). Observe: " . - "Você poderá sempre trocar o Projecto de Testes activo selecionando um diferente da " . - "lista drop-down do canto superior esquerdo.
            2. -
            3. Crie uma nova Suite de Teste clicando em Nova Suite de Teste. As Suites de Teste podem " . - "trazer a estrutura da sua documentação de teste conforme suas convenções (testes funcionais/não-funcionais " . - ", produtos, componentes ou características, solicitações de mudança, etc.). A descrição da " . - "Suite de Teste poderia conter o âmbito dos Casos de Teste incluídos, configuração padrão, " . - "links para documentos relevantes, limitações e outras informações habituais. Em geral, " . - "todas anotações que são comuns às Suites de Teste. As Suites de Teste seguem " . - "a metáfora do "diretório", assim os utilizadores podem mover e copiar Suites de Teste dentro " . - "do Projecto de Testes. Além disso, eles podem ser importados ou exportados (incluindo os Casos de Teste nele contidos).
            4. -
            5. Suites de Teste são pastas escaláveis. Os utilizadores podem mover ou copiar Suites de Teste dentro " . - "do Projecto de Testes. Suites de Teste podem ser importadas ou exportadas (incluindo os Casos de Teste). -
            6. Selecione sua mais nova Suite de Teste criada na árvore de navegação e crie " . - "um novo Caso de Teste clicando em Criar Caso(s) de Teste. Um Caso de Teste especifica " . - "um cenário de testes particular, resultados esperados e campos personalizados definidos " . - "no Projecto de Testes (consulte o manual do utilizador para maiores informações). Também é possível " . - "atribuir Palavras Chave para melhorar a rastreabilidade.
            7. +
            8. Selecione o seu Projecto de Testes na árvore de navegação (o nó principal). Observe: " . + "Você poderá sempre trocar o Projecto de Testes activo selecionando um diferente da " . + "lista drop-down do canto superior esquerdo.
            9. +
            10. Crie uma nova Suite de Teste clicando em Nova Suite de Teste. As Suites de Teste podem " . + "trazer a estrutura da sua documentação de teste conforme suas convenções (testes funcionais/não-funcionais " . + ", produtos, componentes ou características, solicitações de mudança, etc.). A descrição da " . + "Suite de Teste poderia conter o âmbito dos Casos de Teste incluídos, configuração padrão, " . + "links para documentos relevantes, limitações e outras informações habituais. Em geral, " . + "todas anotações que são comuns às Suites de Teste. As Suites de Teste seguem " . + "a metáfora do "diretório", assim os utilizadores podem mover e copiar Suites de Teste dentro " . + "do Projecto de Testes. Além disso, eles podem ser importados ou exportados (incluindo os Casos de Teste nele contidos).
            11. +
            12. Suites de Teste são pastas escaláveis. Os utilizadores podem mover ou copiar Suites de Teste dentro " . + "do Projecto de Testes. Suites de Teste podem ser importadas ou exportadas (incluindo os Casos de Teste). +
            13. Selecione sua mais nova Suite de Teste criada na árvore de navegação e crie " . + "um novo Caso de Teste clicando em Criar Caso(s) de Teste. Um Caso de Teste especifica " . + "um cenário de testes particular, resultados esperados e campos personalizados definidos " . + "no Projecto de Testes (consulte o manual do utilizador para maiores informações). Também é possível " . + "atribuir Palavras Chave para melhorar a rastreabilidade.
            14. Navegue pela árvore de navegação do lado esquerdo e edite os dados. Os Casos de Teste armazenam histórico próprio.
            15. Atribua as suas Especificações de Teste criadas ao Plano de Teste quando seus Casos de Teste estiverem prontos.
            -

            Com o TestLink você organiza os Casos de Teste em Suites de Teste." . -" Suites de Teste podem ser aninhadas em outras Suites de Teste, permitindo a você criar hierarquias de Suites de Teste. - Então você pode imprimir esta informação juntamente com o Caso de Teste.

            "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Página de Pesquisa de Casos de Teste"; -$TLS_htmltext['searchTc'] = "

            Objetivo:

            +

            Com o TestLink você organiza os Casos de Teste em Suites de Teste." . + " Suites de Teste podem ser aninhadas em outras Suites de Teste, permitindo a você criar hierarquias de Suites de Teste. + Então você pode imprimir esta informação juntamente com o Caso de Teste.

            "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Página de Pesquisa de Casos de Teste"; +$TLS_htmltext['searchTc'] = "

            Objetivo:

            Navegue de acordo com Palavras Chave e/ou texto procuradas. A pesquisa não é sensível a maiúsculas. Os resultados incluem apenas Casos de Teste do Projecto de Testes atual.

            @@ -105,15 +100,15 @@
          • Escolha Palavras Chave exigidas ou deixe o valor do campo 'Não aplicado'.
          • Clique no botão Pesquisar.
          • Todos os Casos de Teste cobertos são exibidos. Você pode modificar os Casos de Teste via link 'Título'.
          • -"; - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Página de Pesquisa de Requisitos"; -$TLS_htmltext['searchReq'] = "

            Objetivo:

            - -

            Navegue de acordo com as Palavras Chave e/ou cadeias de texto procuradas. A pesquisa não é +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Página de Pesquisa de Requisitos"; +$TLS_htmltext['searchReq'] = "

            Objetivo:

            + +

            Navegue de acordo com as Palavras Chave e/ou cadeias de texto procuradas. A pesquisa não é sensível a maiúsculas. Os resultados apenas incluem requisitos do Projecto de Testes atual.

            Para Pesquisar:

            @@ -129,14 +124,14 @@

            - Apenas os Requisitos dentro do projecto atual serão pesquisados.
            - A pesquisa é sensível a maiúsculas.
            -- Campos vazios não são considerados.

            "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Página de Pesquisa de Especificação de Requisitos"; -$TLS_htmltext['searchReqSpec'] = "

            Objetivo:

            - -

            Navegue de acordo com as Palavras Chave e/ou cadeias de texto procuradas. A pesquisa não é +- Campos vazios não são considerados.

            "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Página de Pesquisa de Especificação de Requisitos"; +$TLS_htmltext['searchReqSpec'] = "

            Objetivo:

            + +

            Navegue de acordo com as Palavras Chave e/ou cadeias de texto procuradas. A pesquisa não é sensível a maiúsculas. Os resultados apenas incluem requisitos do Projecto de Testes atual.

            Para Pesquisar:

            @@ -152,123 +147,118 @@

            - Apenas as Especificações de Requisito dentro do projecto atual serão pesquisados.
            - A pesquisa é sensível a maiúsculas.
            -- Campos vazios não são considerados.

            "; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificação de Testes"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

            Objetivo:

            -

            A partir daqui você pode imprimir um único caso de teste, todos os casos de teste dentro de uma suite +- Campos vazios não são considerados.

            "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Imprimir Especificação de Testes"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

            Objetivo:

            +

            A partir daqui você pode imprimir um único caso de teste, todos os casos de teste dentro de uma suite ou todos os casos de teste de um Projecto de Testes ou Plano de Teste.

            Iniciar:

            1. -

              Selecione os campos dos casos de teste que você deseja exibir, e então clique em um Caso de Teste, +

              Selecione os campos dos casos de teste que você deseja exibir, e então clique em um Caso de Teste, Suite de Teste, ou Projecto de Testes. Uma página pronta para impressão será exibida.

            2. -
            3. Use a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer -a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. +

            4. Use a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer +a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. Veja Ajuda para maiores informações.

            5. Use a funcionalidade de impressão do seu browser para imprimir a informação presente.
              Nota: Certifique-se de imprimir apenas o frame direito.

            6. -
            "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Modelar Especificação de Requisitos"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

            Você pode gerir documentos de Especificação de Requisitos.

            +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Modelar Especificação de Requisitos"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

            Você pode gerir documentos de Especificação de Requisitos.

            Especificação de Requisitos

            -

            Requisitos estão agrupados por documentos de Especificação de Requisitos , os quais estão relacionados ao -Projecto de Testes.
            O TestLink não suporta (ainda) versões para Especificação de Requisitos +

            Requisitos estão agrupados por documentos de Especificação de Requisitos , os quais estão relacionados ao +Projecto de Testes.
            O TestLink não suporta (ainda) versões para Especificação de Requisitos e também Requisitos. Logo, a versão do documento deve ser inserida após o Título da Especificação. -Um utilizador pode inserir uma descrição simples ou notas no campo Âmbito.

            +Um utilizador pode inserir uma descrição simples ou notas no campo Âmbito.

            -

            Sobrescrever o contador de Requisitos serve para +

            Sobrescrever o contador de Requisitos serve para avaliar a cobertura dos requisitos no caso de nem todos os requisitos estarem adicionados ao TestLink. -O valor 0 significa que o contador de requisitos atual é utilizado +O valor 0 significa que o contador de requisitos atual é utilizado para métricas.

            -

            E.g. SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de +

            E.g. SRS inclui 200 requisitos, mas somente 50 são adicionados ao Plano de Teste. A cobertura de testes é de 25% (se todos estes requisitos forem testados).

            Requisitos

            -

            Clique no título da Especificação de Requisitos criada, e se nenhuma existir, " . - "clique no nó do projecto para criar uma. Você pode criar, editar, excluir +

            Clique no título da Especificação de Requisitos criada, e se nenhuma existir, " . + "clique no nó do projecto para criar uma. Você pode criar, editar, excluir ou importar requisitos para o documento. Cada Requisito tem um título, âmbito e estado. -O estado deve ser 'Válido' ou 'Não testável'. Requisitos Não Testáveis não são contabilizados -para métricas. Este parâmetro deve ser utilizado para características não implementadas e +O estado deve ser 'Válido' ou 'Não testável'. Requisitos Não Testáveis não são contabilizados +para métricas. Este parâmetro deve ser utilizado para características não implementadas e requisitos modelados incorretamente.

            -

            Você pode criar novos casos de teste para os requisitos utilizando multi ações para os -requisitos ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suite de Teste -com nome definido na configuração (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Título e Âmbito são copiados destes Casos de Teste.

            "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Imprimir documento de Especificação de Requisitos"; //printReq +

            Você pode criar novos casos de teste para os requisitos utilizando multi ações para os +requisitos ativos na tela de especificação de requisitos. Estes Casos de Teste são criados dentro da Suite de Teste +com nome definido na configuração (default is: \$tlCfg->req_cfg->default_testsuite_name = +'Test suite created by Requirement - Auto';). Título e Âmbito são copiados destes Casos de Teste.

            "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Imprimir documento de Especificação de Requisitos"; // printReq $TLS_htmltext['printReqSpec'] = "

            Objetivo:

            -

            Através desta opção você pode imprimir um Requisito único, todos os requisitos de uma Especificação de Requisitos, +

            Através desta opção você pode imprimir um Requisito único, todos os requisitos de uma Especificação de Requisitos, ou todos os requisitos de um Projecto de Testes.

            Iniciar:

            1. -

              Selecione as partes dos requisitos que você deseja exibir, e então clique em Requisito, +

              Selecione as partes dos requisitos que você deseja exibir, e então clique em Requisito, Especificação de Requisitos ou Projecto de Testes. A visualização da impressão será exibida.

            2. -
            3. Utilize a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer -a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. +

            4. Utilize a drop-box \"Mostrar Como\" no painel de navegação para especificar se você quer +a informação exibida como HTML, como documento do Open Office Writer ou num documento do Microsoft Word. Veja Ajuda para mais informações.

            5. Use a funcionalidade de impressão do seu browser para imprimir a informação presente.
              Nota: Certifique-se de imprimir apenas o frame direito.

            6. -
            "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Atribuição de Palavras Chave"; -$TLS_htmltext['keywordsAssign'] = "

            Objetivo:

            -

            A página de Atribuição de Palavras Chave é o lugar onde os utilizadores podem +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Atribuição de Palavras Chave"; +$TLS_htmltext['keywordsAssign'] = "

            Objetivo:

            +

            A página de Atribuição de Palavras Chave é o lugar onde os utilizadores podem atribuir em lotes Palavras Chave às Suites de Teste ou Casos de Teste.

            Para Atribuir Palavras Chave:

              -
            1. Selecione uma Suite de Teste ou Caso de Teste na árvore +
            2. Selecione uma Suite de Teste ou Caso de Teste na árvore à esquerda.
            3. -
            4. A caixa no topo da página que mostra informações do lado direito - permitirá a você atribuir Palavras Chave para os casos de +
            5. A caixa no topo da página que mostra informações do lado direito + permitirá a você atribuir Palavras Chave para os casos de teste individualmente.
            6. -
            7. A seleção abaixo permite a você atribuir Casos de Teste num +
            8. A seleção abaixo permite a você atribuir Casos de Teste num nível mais granular.

            Informação Importante quanto à Atribuição de Palavras Chave nos Planos de Testes:

            -

            Atribuir Palavras Chave à Suite de Teste afetará Casos de Teste -no seu Plano de Teste apenas se o Plano de Teste conter a última versão do Caso de Teste. -Caso contrário, se o Plano de Teste conter versões mais antigas do Caso de Teste, as atribuições que você +

            Atribuir Palavras Chave à Suite de Teste afetará Casos de Teste +no seu Plano de Teste apenas se o Plano de Teste conter a última versão do Caso de Teste. +Caso contrário, se o Plano de Teste conter versões mais antigas do Caso de Teste, as atribuições que você fez NÃO aparecerão no Plano de Teste.

            -

            O TestLink usa esta abordagem para que versões mais antigas dos Casos de Teste nos Planos de Testes não sejam afetadas pela atribuição -de Palavras Chave que você fez nas versões mais recentes dos Casos de Teste. Se você deseja seus -Casos de Teste no seu Plano de Teste sejam atualizados, primeiro verifique se eles estão atualizados -utilizando a funcionalidade 'Atualizar Versão dos Casos de Teste' antes de fazer a atribuição das Palavras Chave.

            "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Execução dos Casos de Teste"; -$TLS_htmltext['executeTest'] = "

            Objetivo:

            - -

            Permite aos utilizadores executar os Casos de Teste. O Utilizador pode atribuir resultados -aos Casos de Teste nos Ciclo de Teste. Veja a ajuda para mais informações sobre filtros e configurações " . - "(clique no ícone interrogação).

            +

            O TestLink usa esta abordagem para que versões mais antigas dos Casos de Teste nos Planos de Testes não sejam afetadas pela atribuição +de Palavras Chave que você fez nas versões mais recentes dos Casos de Teste. Se você deseja seus +Casos de Teste no seu Plano de Teste sejam atualizados, primeiro verifique se eles estão atualizados +utilizando a funcionalidade 'Atualizar Versão dos Casos de Teste' antes de fazer a atribuição das Palavras Chave.

            "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Execução dos Casos de Teste"; +$TLS_htmltext['executeTest'] = "

            Objetivo:

            + +

            Permite aos utilizadores executar os Casos de Teste. O Utilizador pode atribuir resultados +aos Casos de Teste nos Ciclo de Teste. Veja a ajuda para mais informações sobre filtros e configurações " . + "(clique no ícone interrogação).

            Iniciar:

            @@ -276,19 +266,19 @@
          • O utilizador deve definir um Ciclo de Teste para o Plano de Teste.
          • Selecionar um Ciclo de Teste no menu drop down
          • Se você quiser ver apenas alguns poucos casos de teste, em vez de toda a árvore, - você pode escolher quais filtros aplicar. Clique no botão \"Aplicar\" - depois que você alterar os filtros.
          • + você pode escolher quais filtros aplicar. Clique no botão \"Aplicar\" + depois que você alterar os filtros.
          • Clique no Caso de Teste no menu em árvore.
          • Preencha o resultado do Caso de Teste, suas respetivas notas e/ou Ocorrências.
          • Grave os resultados.
          • -

            Nota: O TestLink deve ser configurado para colaborar com seu Gestor de Ocorrências -se você quiser criar ou rastrear problemas reportados diretamente da GUI.

            "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Descrição dos Relatórios de Teste e Métricas"; -$TLS_htmltext['showMetrics'] = "

            Os relatórios estão relacionados a um Plano de Teste " . - "(definido no topo do navegador). Este Plano de Teste pode diferir do Plano de Teste +

            Nota: O TestLink deve ser configurado para colaborar com seu Gestor de Ocorrências +se você quiser criar ou rastrear problemas reportados diretamente da GUI.

            "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Descrição dos Relatórios de Teste e Métricas"; +$TLS_htmltext['showMetrics'] = "

            Os relatórios estão relacionados a um Plano de Teste " . + "(definido no topo do navegador). Este Plano de Teste pode diferir do Plano de Teste corrente para execução. Você também pode selecionar formatos dos relatórios:

            • Normal - relatório é exibido em uma página web
            • @@ -311,69 +301,69 @@

              Métricas Gerais do Plano de Teste

              Esta página apenas mostra o último estado de um Plano de Teste por Suite de Teste, Testador e Palavras Chave. -O 'último estado' é determinado pelo ciclo mais recente onde os Casos de Teste foram executados. Por exemplo, +O 'último estado' é determinado pelo ciclo mais recente onde os Casos de Teste foram executados. Por exemplo, se um Caso de Teste foi executado em diversos Ciclos de Teste, apenas o último resultado é considerado.

              O 'último resultado' é um conceito utilizado em vários relatórios, e é determinado como a seguir:

                -
              • A ordem em cada Ciclo de Teste (Meta) é adicionada ao Plano de Teste determina qual é o Ciclo de Teste mais recente. Os resultados do Ciclo de Teste -mais recente prevalecerão sobre os Ciclos de Teste mais antigos. Por exemplo, se você marcar um teste com +
              • A ordem em cada Ciclo de Teste (Meta) é adicionada ao Plano de Teste determina qual é o Ciclo de Teste mais recente. Os resultados do Ciclo de Teste +mais recente prevalecerão sobre os Ciclos de Teste mais antigos. Por exemplo, se você marcar um teste com estado 'Falhou' no Ciclo de Teste 1 e no Ciclo de Teste 2 como 'Passou', o último resultado será 'Passou'.
              • -
              • Se um Caso de Teste é executado diversas vezes em um mesmo Ciclo de Teste, o resultado mais recente -prevalecerá. Por exemplo, se o Ciclo de Teste 3 é libertado para a equipa de testes e o Testador 1 marcar 'Passou' as 14h, +
              • Se um Caso de Teste é executado diversas vezes em um mesmo Ciclo de Teste, o resultado mais recente +prevalecerá. Por exemplo, se o Ciclo de Teste 3 é libertado para a equipa de testes e o Testador 1 marcar 'Passou' as 14h, e o Testador 2 marcar 'Falhou' as 15h, isto aparecerá como 'Falhou'.
              • -
              • os Casos de Teste marcados como 'Não Executado' no último Ciclo de Teste não serão considerados. Por exemplo, se você marcar -um Caso de Teste como 'Passou' no Ciclo de Teste 1 e não executar no Ciclo de Teste 2, o último resultado será considerado como +
              • os Casos de Teste marcados como 'Não Executado' no último Ciclo de Teste não serão considerados. Por exemplo, se você marcar +um Caso de Teste como 'Passou' no Ciclo de Teste 1 e não executar no Ciclo de Teste 2, o último resultado será considerado como 'Passou'.

              As seguintes tabelas são mostradas:

              • Resultados por Suite de Teste de Nível Top - Lista os resultados Topo de cada Suite de Teste. Total de Casos de Teste, Passou, Falhou, Bloqueado, Não Executado e a percentagem + Lista os resultados Topo de cada Suite de Teste. Total de Casos de Teste, Passou, Falhou, Bloqueado, Não Executado e a percentagem de completos são listados. Um Caso de Teste 'completo' é aquele que foi marcado como Passou, Falhou ou Bloqueado. Os resultados das suites de nível superior incluem as suites filho.
              • Resultados por Palavra Chave - Lista todas as Palavras Chave que estão atribuídas aos Casos de Teste no Plano de Teste corrente, e os resultados associados + Lista todas as Palavras Chave que estão atribuídas aos Casos de Teste no Plano de Teste corrente, e os resultados associados a eles.
              • Resultados por Testador - Lista cada Testador que tem Casos de Teste associados a ele no Plano de Teste corrente. Os Casos de Teste que + Lista cada Testador que tem Casos de Teste associados a ele no Plano de Teste corrente. Os Casos de Teste que não estão atribuídos são calculados abaixo com a descrição 'desatribuir'.

              Estado Geral dos Ciclos de Teste

              -

              Lista os resultados de execução para cada Ciclo de Teste. Para cada Ciclo de Teste, o total de Casos de Teste, total com Passou, -% Passou, total Falha, % Falha, Bloqueado, % Bloqueado, Não Executado e % Não Executado. Se um Caso de Teste foi executado +

              Lista os resultados de execução para cada Ciclo de Teste. Para cada Ciclo de Teste, o total de Casos de Teste, total com Passou, +% Passou, total Falha, % Falha, Bloqueado, % Bloqueado, Não Executado e % Não Executado. Se um Caso de Teste foi executado duas vezes no mesmo Ciclo de Teste, será considerada a execução mais recente.

              Métricas da Consulta

              Este relatório consiste numa página com o formulário de consulta e uma página com os resultados, a qual contém os dados da consulta. -A página com o formulário de consulta apresenta 4 controlos. Cada controlo está definido com um valor padrão que -maximiza o número de Casos de Teste e Ciclos de Teste que a consulta deve ser executada. Alterar os controlos -permite aos utilizadores filtrar os resultados e gerar relatórios específicos para Testadores em específico, Palavras Chave, Suites de Teste +A página com o formulário de consulta apresenta 4 controlos. Cada controlo está definido com um valor padrão que +maximiza o número de Casos de Teste e Ciclos de Teste que a consulta deve ser executada. Alterar os controlos +permite aos utilizadores filtrar os resultados e gerar relatórios específicos para Testadores em específico, Palavras Chave, Suites de Teste e combinação de Ciclos de Teste.

                -
              • Palavras Chave 0->1 Palavras Chave podem ser selecionadas. Por padrão, nenhuma Palavra Chave é selecionada. Se uma Palavra Chave não é -selecionada, então todos os Casos de Teste serão considerados indiferentemente de atribuição de Palavras Chave. Palavras Chave são atribuídas -na especificação de testes ou na página Gerir Palavra Chave. Palavras Chave atribuídas aos Casos de Teste alcançam todos os Planos de Testes, e -também todas as versões de um Caso de Teste. Se você está interessado nos resultados para uma Palavra Chave específica, +
              • Palavras Chave 0->1 Palavras Chave podem ser selecionadas. Por padrão, nenhuma Palavra Chave é selecionada. Se uma Palavra Chave não é +selecionada, então todos os Casos de Teste serão considerados indiferentemente de atribuição de Palavras Chave. Palavras Chave são atribuídas +na especificação de testes ou na página Gerir Palavra Chave. Palavras Chave atribuídas aos Casos de Teste alcançam todos os Planos de Testes, e +também todas as versões de um Caso de Teste. Se você está interessado nos resultados para uma Palavra Chave específica, você deverá alterar este controlo.
              • -
              • Testador 0->1 Testadores podem ser selecionados. Por padrão, nenhum Testador é selecionado. Se um Testador não é selecionado, -então todos os Casos de Teste serão considerados indiferentes de Testador atribuído. Atualmente não há funcionalidade -para pesquisar por Casos de Teste não atribuídos. O Testador é atribuído através da página 'Atribuir Casos de Teste para Execução' -e é feito com base no Plano de Teste. Se você está interessado em trabalhar com um Testador em específico, você deve +
              • Testador 0->1 Testadores podem ser selecionados. Por padrão, nenhum Testador é selecionado. Se um Testador não é selecionado, +então todos os Casos de Teste serão considerados indiferentes de Testador atribuído. Atualmente não há funcionalidade +para pesquisar por Casos de Teste não atribuídos. O Testador é atribuído através da página 'Atribuir Casos de Teste para Execução' +e é feito com base no Plano de Teste. Se você está interessado em trabalhar com um Testador em específico, você deve alterar este controlo.
              • -
              • Suite de Teste de Nível Topo 0->n Suites de Teste de Nível Topo podem ser selecionadas. Por padrão, todas as Suites de Teste são selecionadas. -Apenas as Suites de Teste que são selecionadas serão consultadas para as métricas do resultado. Se você está apenas interessado em resultados +
              • Suite de Teste de Nível Topo 0->n Suites de Teste de Nível Topo podem ser selecionadas. Por padrão, todas as Suites de Teste são selecionadas. +Apenas as Suites de Teste que são selecionadas serão consultadas para as métricas do resultado. Se você está apenas interessado em resultados para uma Suite de Teste específica você precisa alterar este controlo.
              • -
              • Ciclos de Teste 1->n Ciclos de Teste podem ser selecionados. Por padrão, todos os Ciclos de Teste são selecionados. Apenas as execuções -realizadas no Ciclo de Teste que você selecionou serão consideradas quando produzirem métricas. Por exemplo, se você quiser -ver quantos Casos de Teste foram executados nos últimos 3 Ciclos de Teste, você precisa alterar este controlo. A seleção de Palavra Chave, -Testador e Suite de Teste de Nível Topo ditarão o número de Casos de Teste do seu Plano de Teste e serão usados para -calcular as métricas por Suite de Teste e Plano de Teste. Por exemplo, se você selecionar o Testador = 'José', Palavra Chave = -'Prioridade 1', e todas as Suites de Teste disponíveis, apenas Casos de Teste com Prioridade 1 atribuídos para José serão considerados. +
              • Ciclos de Teste 1->n Ciclos de Teste podem ser selecionados. Por padrão, todos os Ciclos de Teste são selecionados. Apenas as execuções +realizadas no Ciclo de Teste que você selecionou serão consideradas quando produzirem métricas. Por exemplo, se você quiser +ver quantos Casos de Teste foram executados nos últimos 3 Ciclos de Teste, você precisa alterar este controlo. A seleção de Palavra Chave, +Testador e Suite de Teste de Nível Topo ditarão o número de Casos de Teste do seu Plano de Teste e serão usados para +calcular as métricas por Suite de Teste e Plano de Teste. Por exemplo, se você selecionar o Testador = 'José', Palavra Chave = +'Prioridade 1', e todas as Suites de Teste disponíveis, apenas Casos de Teste com Prioridade 1 atribuídos para José serão considerados. O '# de Casos de Teste' totais que você verá neste relatório serão influenciados por estes 3 controlos. -A seleção dos Ciclos de Teste influenciarão se o Caso de Teste é considerado 'Passou', 'Falhou', 'Bloqueado', ou 'Não Executado'. +A seleção dos Ciclos de Teste influenciarão se o Caso de Teste é considerado 'Passou', 'Falhou', 'Bloqueado', ou 'Não Executado'. Favor classificar com a regra 'Apenas os últimos resultados' à medida em que elas aparecem acima.

              Pressione o botão 'Executar Pesquisa' para prosseguir com a consulta e exibir a página com os resultados.

              @@ -382,42 +372,41 @@
              1. o parâmetro da consulta utilizado para criar o relatório
              2. totais para todo o Plano de Teste
              3. -
              4. por um conjunto de particionamento dos totais (Soma / Passou / Falhou / Bloqueado / Não Executado) e todas execuções realizadas -na Suite de Teste. Se um Caso de Teste foi executado mais de uma vez em múltiplos Ciclos de Teste, todas as execuções que foram gravadas serão -exibidas nos Ciclos de Teste selecionados. No entanto, o resumo para esta Suite de Teste apenas incluirá o último resultado para +
              5. por um conjunto de particionamento dos totais (Soma / Passou / Falhou / Bloqueado / Não Executado) e todas execuções realizadas +na Suite de Teste. Se um Caso de Teste foi executado mais de uma vez em múltiplos Ciclos de Teste, todas as execuções que foram gravadas serão +exibidas nos Ciclos de Teste selecionados. No entanto, o resumo para esta Suite de Teste apenas incluirá o último resultado para o Ciclo de Teste selecionado.

              Relatórios de Casos de Teste Bloqueados, com Falha e Não Executados

              -

              Estes relatórios mostram todos os Casos de Teste Bloqueados, com Falha e Não Executados. A lógica do último resultado dos testes -(que está descrita nas Métricas Gerais do Plano de Teste) é novamente empregada para determinar se um Caso de Teste deve ser -considerado Bloqueado, com Falha ou Não Executado. Casos de Teste Bloqueado e com Falha exibirão as Ocorrências associadas se o Utilizador +

              Estes relatórios mostram todos os Casos de Teste Bloqueados, com Falha e Não Executados. A lógica do último resultado dos testes +(que está descrita nas Métricas Gerais do Plano de Teste) é novamente empregada para determinar se um Caso de Teste deve ser +considerado Bloqueado, com Falha ou Não Executado. Casos de Teste Bloqueado e com Falha exibirão as Ocorrências associadas se o Utilizador estiver utilizando um sistema de Gestão de Falhas.

              Relatório de Testes

              -

              Mostra o estado de cada Caso de Teste em todos os Ciclos de Teste. O resultado da execução mais recente será utilizado -se um Caso de Teste for executado múltiplas vezes em um mesmo Ciclo de Teste. É recomendado exportar este relatório para +

              Mostra o estado de cada Caso de Teste em todos os Ciclos de Teste. O resultado da execução mais recente será utilizado +se um Caso de Teste for executado múltiplas vezes em um mesmo Ciclo de Teste. É recomendado exportar este relatório para o formato em Excel para um fácil manuseio se um grande conjunto de dados estiver em utilização.

              Gráficos - Métricas Gerais do Plano de Teste

              -

              A lógica do último resultado é utilizada para todos os gráficos que você verá. Os gráficos são animados para ajudar +

              A lógica do último resultado é utilizada para todos os gráficos que você verá. Os gráficos são animados para ajudar o utilizador à visualizar as métricas do Plano de Teste atual. Os quatro gráficos fornecidos são:

              • Gráfico de pizza com todos os Casos de Teste com estado Passou, com Falha, Bloqueados e Não Executados
              • Gráfico de barras com os Resultados por Palavra Chave
              • Gráfico de barras com os Resultados por Testador
              • Gráfico de barras com os Resultados por Suites Nível Topo
              -

              As secções e barras dos gráficos são coloridos de modo que o utilizador possa identificar o número aproximado de Casos de Teste com estado +

              As secções e barras dos gráficos são coloridos de modo que o utilizador possa identificar o número aproximado de Casos de Teste com estado Passou, Falhou, Bloqueado e Não Executado.

              Ocorrências por Casos de Teste

              -

              Este relatório mostra cada Caso de Teste com todos as Ocorrências abertas para ele em todo o projecto. -Este relatório apenas está disponível se estiver conectado um Gestor de Ocorrências.

              "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Adicionar / Remover Casos de Teste do Plano de Teste"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

              Objetivo:

              +

              Este relatório mostra cada Caso de Teste com todos as Ocorrências abertas para ele em todo o projecto. +Este relatório apenas está disponível se estiver conectado um Gestor de Ocorrências.

              "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Adicionar / Remover Casos de Teste do Plano de Teste"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

              Objetivo:

              Permite aos utilizadores (com perfil de Líder de Testes) adicionar ou remover Casos de Teste do Plano de Teste.

              Para adicionar ou remover Casos de Teste:

              @@ -425,11 +414,11 @@
            • Clique na Suite de Teste para ver todas as Suites de Teste e todos os seus Casos de Teste.
            • Quando tiver terminado, clique no botão 'Adicionar / Remover Casos de Teste' para adicionar ou remover os Casos de Teste selecionados. Nota: não é possível adicionar o mesmo Caso de Teste múltiplas vezes.
            • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Atribuir Testadores à Execução de Testes"; -$TLS_htmltext['tc_exec_assignment'] = "

              Objetivo:

              +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Atribuir Testadores à Execução de Testes"; +$TLS_htmltext['tc_exec_assignment'] = "

              Objetivo:

              Esta página permite aos Líderes de Teste atribuir utilizadores a testes específicos dentro do Plano de Teste.

              Iniciar:

              @@ -438,15 +427,15 @@
            • Selecione o Testador conforme planeamento.
            • Pressione o botão 'Gravar' para aplicar a atribuição.
            • Abra a página de execução para verificar a atribuição. Você pode estabelecer um filtro por utilizadores.
            • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Actualizar Casos de Teste no Plano de Teste"; -$TLS_htmltext['planUpdateTC'] = "

              Objetivo:

              -

              Esta página permite atualizar Casos de Teste para uma versão mais nova (diferente) da -Especificação de Casos de Teste quando alterada. Isto frequentemente acontece quando uma funcionalidade é alterada durante os testes." . - " O Utilizador modifica a Especificação de Teste, mas as alterações precisam se propagar ao Plano de Teste também. De qualquer forma," . - " o Plano de Teste mantém as versões originais para garantir que os resultados se referem ao texto correto dos Casos de Teste.

              +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Actualizar Casos de Teste no Plano de Teste"; +$TLS_htmltext['planUpdateTC'] = "

              Objetivo:

              +

              Esta página permite atualizar Casos de Teste para uma versão mais nova (diferente) da +Especificação de Casos de Teste quando alterada. Isto frequentemente acontece quando uma funcionalidade é alterada durante os testes." . + " O Utilizador modifica a Especificação de Teste, mas as alterações precisam se propagar ao Plano de Teste também. De qualquer forma," . + " o Plano de Teste mantém as versões originais para garantir que os resultados se referem ao texto correto dos Casos de Teste.

              Iniciar:

                @@ -454,31 +443,29 @@
              1. Escolha uma nova versão no combo box para um Caso de Teste específico.
              2. Pressione o botão 'Actualizar Plano de Teste' para aplicar alterações.
              3. Para comprovar: abra a página de execução para verificar o texto do(s) Caso(s) de Teste.
              4. -
              "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Especificar testes com prioridade alta ou baixa"; -$TLS_htmltext['test_urgency'] = "

              Objetivo:

              -

              O TestLink permite definir a urgência das Suites de Teste para afetar a prioridade dos Casos de Teste. - A priorização dos testes depende da importância do Caso de Teste e da urgência definida no Plano de Teste. - O Líder de Teste deve especificar um conjunto de Casos de Teste que devem ser testados primeiro. Isso - ajuda a assegurar que os testes cobrirão os requisitos mais importantes também sob a +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Especificar testes com prioridade alta ou baixa"; +$TLS_htmltext['test_urgency'] = "

              Objetivo:

              +

              O TestLink permite definir a urgência das Suites de Teste para afetar a prioridade dos Casos de Teste. + A priorização dos testes depende da importância do Caso de Teste e da urgência definida no Plano de Teste. + O Líder de Teste deve especificar um conjunto de Casos de Teste que devem ser testados primeiro. Isso + ajuda a assegurar que os testes cobrirão os requisitos mais importantes também sob a pressão do tempo.

              Iniciar:

                -
              1. Escolha uma Suite de Teste para definir a urgência do produto/componente no navegador +
              2. Escolha uma Suite de Teste para definir a urgência do produto/componente no navegador ao lado esquerdo da janela.
              3. -
              4. Escolha o nível de urgência (Alta, Média ou Baixa). O nível médio é o padrão. Você pode - diminuir a prioridade para partes do produtos não alteradas e aumentar para componentes +
              5. Escolha o nível de urgência (Alta, Média ou Baixa). O nível médio é o padrão. Você pode + diminuir a prioridade para partes do produtos não alteradas e aumentar para componentes com mudanças significativas.
              6. Pressione o botão 'Gravar' para aplicar as alterações.
              -

              Por exemplo, um Caso de Teste com prioridade Alta em uma Suite de Teste com urgência Baixa - será de prioridade Média."; - - -// ------------------------------------------------------------------------------------------ - +

              Por exemplo, um Caso de Teste com prioridade Alta em uma Suite de Teste com urgência Baixa + será de prioridade Média."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/ru_RU/description.php b/locale/ru_RU/description.php index db462dd05f..3dc1e3dee2 100644 --- a/locale/ru_RU/description.php +++ b/locale/ru_RU/description.php @@ -1,31 +1,31 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html $TLS_hlp_generateDocOptions = "

              Options for a generated document

              This table allows the user to filter test cases before they are viewed. If @@ -33,8 +33,8 @@ presented, check or uncheck, click on Filter, and select the desired data level from the tree.

              -

              Document Header: Users can filter out Document Header information. -Document Header information includes: Introduction, Scope, References, +

              Document Header: Users can filter out Document Header information. +Document Header information includes: Introduction, Scope, References, Test Methodology, and Test Limitations.

              Test Case Body: Users can filter out Test Case Body information. Test Case Body information @@ -49,35 +49,35 @@

              Table of Content: TestLink inserts list of all titles with internal hypertext links if checked.

              -

              Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component -in second case.

              "; - -// testPlan.html +

              Output format: There are two possibilities: HTML and MS Word. Browser calls MS word component +in second case.

              "; + +// testPlan.html $TLS_hlp_testPlan = "

              Test Plan

              General

              -

              A test plan is a systematic approach to testing a system such as software. You can organize testing activity with +

              A test plan is a systematic approach to testing a system such as software. You can organize testing activity with particular builds of product in time and trace results.

              Test Execution

              -

              This section is where users can execute test cases (write test results) and -print Test case suite of the Test Plan. This section is where users can track -the results of their test case execution.

              +

              This section is where users can execute test cases (write test results) and +print Test case suite of the Test Plan. This section is where users can track +the results of their test case execution.

              Test Plan Management

              -

              This section, which is only lead accessible, allows users to administrate test plans. -Administering test plans involves creating/editing/deleting plans, -adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can +

              This section, which is only lead accessible, allows users to administrate test plans. +Administering test plans involves creating/editing/deleting plans, +adding/editing/deleting/updating test cases in plans, creating builds as well as defining who can see which plan.
              -Users with lead permissions may also set the priority/risk and ownership of -Test case suites (categories) and create testing milestones.

              - -

              Note: It is possible that users may not see a dropdown containing any Test plans. -In this situation all links (except lead enabled ones) will be unlinked. If you -are in this situation you must contact a lead or admin to grant you the proper -project rights or create a Test Plan for you.

              "; - -// custom_fields.html +Users with lead permissions may also set the priority/risk and ownership of +Test case suites (categories) and create testing milestones.

              + +

              Note: It is possible that users may not see a dropdown containing any Test plans. +In this situation all links (except lead enabled ones) will be unlinked. If you +are in this situation you must contact a lead or admin to grant you the proper +project rights or create a Test Plan for you.

              "; + +// custom_fields.html $TLS_hlp_customFields = "

              Custom Fields

              Following are some facts about the implementation of custom fields:

                @@ -96,7 +96,7 @@
              • Caption variable name (eg: This is the value that is supplied to lang_get() API , or displayed as-is if not found in language file).
              • Custom field type (string, numeric, float, enum, email)
              • -
              • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list +
              • Enumeration possible values (eg: RED|YELLOW|BLUE), applicable to list, multiselection list and combo types.
                Use the pipe ('|') character to separate possible values for an enumeration. One of the possible values @@ -116,16 +116,16 @@
              • Enable on test plan design. User can change the value during Test Plan design (add test cases to test plan)
              • Available for. User choose to what kind of item the field belows.
              -"; - -// execMain.html +"; + +// execMain.html $TLS_hlp_executeMain = "

              Executing Test Cases

              Allows users to 'execute' test cases. Execution itself is merely assigning a test case a result (pass,fail,blocked) against a selected build.

              Access to a bug tracking system could be configured. User can directly add a new bugs -and browse exesting ones then.

              "; - -//bug_add.html +and browse exesting ones then.

              "; + +// bug_add.html $TLS_hlp_btsIntegration = "

              Add Bugs to Test Case

              (only if it is configured) TestLink has a very simple integration with Bug Tracking Systems (BTS), @@ -135,7 +135,7 @@

            • Insert new bug.
            • Display existent bug info.
            -

            +

            Process to add a bug

            @@ -144,111 +144,108 @@

          • Step 2: write down the BUGID assigned by BTS.
          • Step 3: write BUGID on the input field.
          • Step 4: use add bug button.
          • -
          +
        After closing the add bug page, you will see relevant bug data on the execute page. -

        "; - -// execFilter.html +

        "; + +// execFilter.html $TLS_hlp_executeFilter = "

        Setup Filter and Build for test execution

        -

        The left pane consists from navigator through test cases assigned to the current " . -"Test plan and table with settings and filter. These filters allows the user " . -"to refine offered set of test cases before they are executed." . -"Setup your filter, press the \"Apply\" button and select appropriate Test Case " . -"from tree menu.

        +

        The left pane consists from navigator through test cases assigned to the current " . + "Test plan and table with settings and filter. These filters allows the user " . + "to refine offered set of test cases before they are executed." . + "Setup your filter, press the \"Apply\" button and select appropriate Test Case " . + "from tree menu.

        Build

        -

        Users must choose a build that will be connected with a test result. " . -"Builds are the basic component for the current Test Plan. Each test case " . -"may be run more times per build. However the last results is count only. +

        Users must choose a build that will be connected with a test result. " . + "Builds are the basic component for the current Test Plan. Each test case " . + "may be run more times per build. However the last results is count only.
        Builds can be created by leads using the Create New Build page.

        Test Case ID filter

        -

        Users can filter test cases by unique identifier. This ID is created automatically -during create time. Empty box means that the filter doesn't apply.

        +

        Users can filter test cases by unique identifier. This ID is created automatically +during create time. Empty box means that the filter doesn't apply.

        Priority filter

        -

        Users can filter test cases by test priority. Each test case importance is combined" . -"with test urgency within the current Test plan. For example 'HIGH' priority test case " . -"is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

        +

        Users can filter test cases by test priority. Each test case importance is combined" . + "with test urgency within the current Test plan. For example 'HIGH' priority test case " . + "is shown if importance or urgency is HIGH and second attribute is at least MEDIUM level.

        Result filter

        -

        Users can filter test cases by results. Results are what happened to that test -case during a particular build. Test cases can pass, fail, be blocked, or not be run." . -"This filter is disabled by default.

        +

        Users can filter test cases by results. Results are what happened to that test +case during a particular build. Test cases can pass, fail, be blocked, or not be run." . + "This filter is disabled by default.

        User filter

        -

        Users can filter test cases by their assignee. The check-box allows to include also " . -"\"unassigned\" tests into the resulted set in addtion.

        "; -/* -

        Most Current Result

        -

        By default or if the 'most current' checkbox is unchecked, the tree will be sorted -by the build that is chosen from the dropdown box. In this state the tree will display -the test cases status. -
        Example: User selects build 2 from the dropdown box and doesn't check the 'most -current' checkbox. All test cases will be shown with their status from build 2. -So, if test case 1 passed in build 2 it will be colored green. -
        If the user decideds to check the 'most current' checkbox the tree will be -colored by the test cases most recent result. -
        Ex: User selects build 2 from the dropdown box and this time checks -the 'most current' checkbox. All test cases will be shown with most current -status. So, if test case 1 passed in build 3, even though the user has also selected -build 2, it will be colored green.

        - */ - - -// newest_tcversions.html +

        Users can filter test cases by their assignee. The check-box allows to include also " . + "\"unassigned\" tests into the resulted set in addtion.

        "; +/* + *

        Most Current Result

        + *

        By default or if the 'most current' checkbox is unchecked, the tree will be sorted + * by the build that is chosen from the dropdown box. In this state the tree will display + * the test cases status. + *
        Example: User selects build 2 from the dropdown box and doesn't check the 'most + * current' checkbox. All test cases will be shown with their status from build 2. + * So, if test case 1 passed in build 2 it will be colored green. + *
        If the user decideds to check the 'most current' checkbox the tree will be + * colored by the test cases most recent result. + *
        Ex: User selects build 2 from the dropdown box and this time checks + * the 'most current' checkbox. All test cases will be shown with most current + * status. So, if test case 1 passed in build 3, even though the user has also selected + * build 2, it will be colored green.

        + */ + +// newest_tcversions.html $TLS_hlp_planTcModified = "

        Newest versions of linked Test Cases

        The whole set of Test Cases linked to Test Plan is analyzed, and a list of Test Cases which have a newest version is displayed (against the current set of the Test Plan). -

        "; - - -// requirementsCoverage.html +

        "; + +// requirementsCoverage.html $TLS_hlp_requirementsCoverage = "

        Requirements Coverage


        This feature allows to map a coverage of user or system requirements by test cases. Navigate via link \"Requirement Specification\" in main screen.

        Requirements Specification

        -

        Requirements are grouped by 'Requirements Specification' document which is related to -Test Project.
        TestLink doesn't support versions for both Requirements Specification -and Requirements itself. So, version of document should be added after +

        Requirements are grouped by 'Requirements Specification' document which is related to +Test Project.
        TestLink doesn't support versions for both Requirements Specification +and Requirements itself. So, version of document should be added after a Specification Title. -An user can add simple description or notes to Scope field.

        +An user can add simple description or notes to Scope field.

        -

        Overwritten count of REQs serves for -evaluation Req. coverage in case that not all requirements are added (imported) in. -The value 0 means that current count of requirements is used for metrics.

        -

        E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test +

        Overwritten count of REQs serves for +evaluation Req. coverage in case that not all requirements are added (imported) in. +The value 0 means that current count of requirements is used for metrics.

        +

        E.g. SRS includes 200 requirements but only 50 are added in TestLink. Test coverage is 25% (if all these added requirements will be tested).

        Requirements

        Click on title of a created Requirements Specification. You can create, edit, delete or import requirements for the document. Each requirement has title, scope and status. Status should be \"Normal\" or \"Not testable\". Not testable requirements are not counted -to metrics. This parameter should be used for both unimplemented features and -wrong designed requirements.

        +to metrics. This parameter should be used for both unimplemented features and +wrong designed requirements.

        -

        You can create new test cases for requirements by using multi action with checked +

        You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite -with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = +with name defined in configuration (default is: $tlCfg->req_cfg->default_testsuite_name = \"Test suite created by Requirement - Auto\";). Title and Scope are copied to these Test cases.

        -"; - - -// planAddTC_m1.tpl +"; + +// planAddTC_m1.tpl $TLS_hlp_planAddTC = "

        Regarding 'Save Custom Fields'

        -If you have defined and assigned to Test Project,
        +If you have defined and assigned to Test Project,
        Custom Fields with:
        'Display on test plan design=true' and
        'Enable on test plan design=true'
        you will see these in this page ONLY for Test Cases linked to Test Plan. -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ -?> \ No newline at end of file +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ +?> diff --git a/locale/ru_RU/texts.php b/locale/ru_RU/texts.php index 26954f7be3..c7fdeece80 100644 --- a/locale/ru_RU/texts.php +++ b/locale/ru_RU/texts.php @@ -1,33 +1,31 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ - - -$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; -$TLS_htmltext['assignReqs'] = "

        Purpose:

        +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ +$TLS_htmltext_title['assignReqs'] = "Assign Requirements to Test Case"; +$TLS_htmltext['assignReqs'] = "

        Purpose:

        Users can set relations between requirements and test cases. A designer could define relations 0..n to 0..n. I.e. One test case could be assigned to none, one or more test cases and vice versa. Such traceability matrix helps to investigate test coverage @@ -38,7 +36,7 @@

        1. Choose an Test Case in tree at the left. The combo box with list of Requirements Specifications is shown at the top of workarea.
        2. -
        3. Choose a Requirements Specification Document if more once defined. +
        4. Choose a Requirements Specification Document if more once defined. TestLink automatically reload the page.
        5. A middle block of workarea lists all requirements (from choosen Specification), which are connected with the test case. Bottom block 'Available Requirements' lists all @@ -46,50 +44,48 @@ to the current test case. A designer could mark requirements which are covered by this test case and then click the button 'Assign'. These new assigned test case are shown in the middle block 'Assigned Requirements'.
        6. -
        "; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "Test Specification"; -$TLS_htmltext['editTc'] = "

        Purpose:

        +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "Test Specification"; +$TLS_htmltext['editTc'] = "

        Purpose:

        Purpose:

        -

        The Test Specification allows users to view and edit all of the existing " . - "Test Suites and Test Cases. Test Cases are versioned and all " . - "of the previous versions are available and can be viewed and managed here.

        +

        The Test Specification allows users to view and edit all of the existing " . + "Test Suites and Test Cases. Test Cases are versioned and all " . + "of the previous versions are available and can be viewed and managed here.

        Getting Started:

          -
        1. Select your Test Project in the navigation tree (the root node). Please note: " . - "You can always change the activate Test Project by selecting a different one from the " . - "drop-down list in the top-right corner.
        2. -
        3. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . - "bring structure to your test documents according to your conventions (functional/non-functional " . - "tests, product components or features, change requests, etc.). The description of " . - "a Test Suite could hold the scope of the included test cases, default configuration, " . - "links to relevant documents, limitations and other useful information. In general, " . - "all annotations that are common to the Child Test Cases. Test Suites follow " . - "the "folder" metaphor, thus users can move and copy Test Suites within " . - "the Test project. Also, they can be imported or exported (including the contained Test cases).
        4. -
        5. Test suites are scalable folders. User can move or copy Test Suites within " . - "the Test project. Test suites could be imported or exported (include Test cases). -
        6. Select your newly created Test Suite in the navigation tree and create " . - "a new Test Case by clicking on Create Test Case. A Test Case specifies " . - "a particular testing scenario, expected results and custom fields defined " . - "in the Test Project (refer to the user manual for more information). It is also possible " . - "to assign keywords for improved traceability.
        7. +
        8. Select your Test Project in the navigation tree (the root node). Please note: " . + "You can always change the activate Test Project by selecting a different one from the " . + "drop-down list in the top-right corner.
        9. +
        10. Create a new Test Suite by clicking on New Child Test Suite. Test Suites can " . + "bring structure to your test documents according to your conventions (functional/non-functional " . + "tests, product components or features, change requests, etc.). The description of " . + "a Test Suite could hold the scope of the included test cases, default configuration, " . + "links to relevant documents, limitations and other useful information. In general, " . + "all annotations that are common to the Child Test Cases. Test Suites follow " . + "the "folder" metaphor, thus users can move and copy Test Suites within " . + "the Test project. Also, they can be imported or exported (including the contained Test cases).
        11. +
        12. Test suites are scalable folders. User can move or copy Test Suites within " . + "the Test project. Test suites could be imported or exported (include Test cases). +
        13. Select your newly created Test Suite in the navigation tree and create " . + "a new Test Case by clicking on Create Test Case. A Test Case specifies " . + "a particular testing scenario, expected results and custom fields defined " . + "in the Test Project (refer to the user manual for more information). It is also possible " . + "to assign keywords for improved traceability.
        14. Navigate via the tree view on the left side and edit data. Test cases stores own history.
        15. Assign your created Test Specification to Test Plan when your Test cases are ready.
        -

        With TestLink you organize test cases into test suites." . -"Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. - You can then print this information together with the test cases.

        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; -$TLS_htmltext['searchTc'] = "

        Purpose:

        +

        With TestLink you organize test cases into test suites." . + "Test suites can be nested within other test suites, enabling you to create hierarchies of test suites. + You can then print this information together with the test cases.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "Test Case Search Page"; +$TLS_htmltext['searchTc'] = "

        Purpose:

        Navigation according to keywords and/or searched strings. The search is not case sensitive. Result include just test cases from actual Test Project.

        @@ -101,12 +97,11 @@
      • Choose required keyword or left value 'Not applied'.
      • Click the Search button.
      • All fulfilled test cases are shown. You can modify test cases via 'Title' link.
      • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; //printTC.html -$TLS_htmltext['printTestSpec'] = "

        Purpose:

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "Print Test Specification"; // printTC.html +$TLS_htmltext['printTestSpec'] = "

        Purpose:

        From here you can print a single test case, all the test cases within a test suite, or all the test cases in a test project or plan.

        Get Started:

        @@ -121,12 +116,11 @@
      • Use your browser's print functionality to actually print the information.
        Note: Make sure to only print the right-hand frame.

      • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; //printTC.html -$TLS_htmltext['reqSpecMgmt'] = "

        You can manage Requirement Specification documents.

        +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "Requirements Specification Design"; // printTC.html +$TLS_htmltext['reqSpecMgmt'] = "

        You can manage Requirement Specification documents.

        Requirements Specification

        @@ -154,12 +148,11 @@

        You can create new test cases for requirements by using multi action with checked requirements within the specification screen. These Test Cases are created into Test Suite with name defined in configuration (default is: \$tlCfg->req_cfg->default_testsuite_name = -'Test suite created by Requirement - Auto';). Title and Scope are copied to these Test cases.

        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; -$TLS_htmltext['keywordsAssign'] = "

        Purpose:

        +'Test suite created by Requirement - Auto';)
        . Title and Scope are copied to these Test cases.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "Keyword Assignment"; +$TLS_htmltext['keywordsAssign'] = "

        Purpose:

        The Keyword Assignment page is the place where users can batch assign keywords to the existing Test Suite or Test Case

        @@ -183,16 +176,15 @@

        TestLink uses this approach so that older versions of test cases in test plans are not effected by keyword assignments you make to the most recent version of the test case. If you want your test cases in your test plan to be updated, first verify they are up to date using the 'Update -Modified Test Cases' functionality BEFORE making keyword assignments.

        "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "Test Case Execution"; -$TLS_htmltext['executeTest'] = "

        Purpose:

        +Modified Test Cases' functionality BEFORE making keyword assignments.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "Test Case Execution"; +$TLS_htmltext['executeTest'] = "

        Purpose:

        Allows user to execute Test cases. User can assign Test result -to Test Case for Build. See help for more information about filter and settings " . - "(click on the question mark icon).

        +to Test Case for Build. See help for more information about filter and settings " . + "(click on the question mark icon).

        Get started:

        @@ -203,13 +195,13 @@
      • Fill out the test case result and any applicable notes or bugs.
      • Save results.
      • -

        Note: TestLink must be configurated to collaborate with your Bug tracker -if you would like to create/trace a problem report directly from the GUI.

        "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; -$TLS_htmltext['showMetrics'] = "

        Reports are related to a Test Plan " . - "(defined in top of navigator). This Test Plan could differs from the +

        Note: TestLink must be configurated to collaborate with your Bug tracker +if you would like to create/trace a problem report directly from the GUI.

        "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "Description of Test Reports and Metrics"; +$TLS_htmltext['showMetrics'] = "

        Reports are related to a Test Plan " . + "(defined in top of navigator). This Test Plan could differs from the current Test Plan for execution. You can also select Report format:

        • Normal - report is displayed in web page
        • @@ -326,12 +318,11 @@

          Total Bugs For Each Test Case

          This report shows each test case with all of the bugs filed against it for the entire project. -This report is only available if a Bug Tracking System is connected.

          "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd -$TLS_htmltext['planAddTC'] = "

          Purpose:

          +This report is only available if a Bug Tracking System is connected.

          "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "Add / Remove Test cases to Test Plan"; // testSetAdd +$TLS_htmltext['planAddTC'] = "

          Purpose:

          Allows user (with lead level permissions) to add or remove test cases into a Test plan.

          To add or remove Test cases:

          @@ -339,11 +330,11 @@
        • Click on a test suite to see all of its test suites and all of its test cases.
        • When you are done click the 'Add / Remove Test Cases' button to add or remove the test cases. Note: Is not possible to add the same test case multiple times.
        • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; -$TLS_htmltext['tc_exec_assignment'] = "

          Purpose

          +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "Assign Testers to test execution"; +$TLS_htmltext['tc_exec_assignment'] = "

          Purpose

          This page allows test leaders to assign users to particular tests within the Test Plan.

          Get Started

          @@ -352,16 +343,15 @@
        • Select a planned tester.
        • Press button to submit assignement.
        • Open execution page to verify assignment. You can set-up a filter for users.
        • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; -$TLS_htmltext['planUpdateTC'] = "

          Purpose

          +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "Update Test Cases in the Test Plan"; +$TLS_htmltext['planUpdateTC'] = "

          Purpose

          This page allows update Test case to a newer (different) version in the case that Test -Specification is changed. It often happens that some functionality is clarified during testing." . - " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . - " plan holds original version to be sure, that results refer to the correct text of a Test case.

          +Specification is changed. It often happens that some functionality is clarified during testing." . + " User modifies Test Specification, but changes needs to propagate to Test Plan too. Otherwise Test" . + " plan holds original version to be sure, that results refer to the correct text of a Test case.

          Get Started

            @@ -369,14 +359,13 @@
          1. Choose a new version from bombo boxmenu for particular Test case.
          2. Press button 'Update Test plan' to submit changes.
          3. To verify: Open execution page to view text of the test case(s).
          4. -
          "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; -$TLS_htmltext['test_urgency'] = "

          Purpose

          -

          TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. - Test priority depends on both Importance of Test cases and Urgency defined in +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "Specify tests with high or low urgency"; +$TLS_htmltext['test_urgency'] = "

          Purpose

          +

          TestLink allows set urgency of Test Suite to affect a testing Priority of test cases. + Test priority depends on both Importance of Test cases and Urgency defined in the Test Plan. Test leader should specify a set of test cases that could be tested at first. It helps to assure that testing will cover the most important tests also under time pressure.

          @@ -390,10 +379,9 @@ significant changes.
        • Press the button 'Save' to submit changes.
        • -

          For example, a Test case with a High importance in a Test suite with Low urgency " . - "will be Medium priority."; - - -// ------------------------------------------------------------------------------------------ - +

          For example, a Test case with a High importance in a Test suite with Low urgency " . + "will be Medium priority."; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/locale/tl_lang_parser.php b/locale/tl_lang_parser.php index 395fd60867..5814ce2f86 100644 --- a/locale/tl_lang_parser.php +++ b/locale/tl_lang_parser.php @@ -1,245 +1,208 @@ #!/usr/bin/php - report.txt (RECOMMENDED) - * - * @package TestLink - * @author Martin Havlat, Julian Krien - * @copyright 2003, TestLink community - * @version CVS: $Id: tl_lang_parser.php,v 1.2.6.3 2010/12/12 10:34:14 mx-julian Exp $ - * @link http://www.teamst.org/index.php - * - * @internal Revisions: - * 20100517 - Julian - major changes: improved robustness, script can now also be - * used to update texts.php and description.php - * - **/ - -/** Set path to your en_GB english file */ -$file_eng = 'en_GB/strings.txt'; -//$file_eng = 'en_GB/texts.php'; -//$file_eng = 'en_GB/description.php'; - -/** Set true if you would like to have original file with 'bck' extension */ -$do_backup_file = FALSE; - - - - -// --------------------------------------------------------------------------- -if ($argc < 1) -{ - echo 'Usage: #tl_lang_parser.php '; - exit; -} -else - $file_lang_old = $argv[1]; - -$out = ''; // data for output file -$var_counter = 0; -$var_counter_new = 0; -$new_vars = array(); - -echo "===== Start TestLink lang_parser =====\n"; - -// read english file -if (file_exists($file_eng) && is_readable ($file_eng)) -{ - echo "Master file ($file_eng) is readable OK.\n"; - $lines_eng = file( $file_eng ); -} -else -{ - echo "Master File ($file_eng) is not readable. Exit.\n"; - exit; -} -// read language file -if (file_exists($file_lang_old) && is_readable ($file_lang_old)) -{ - echo "File to be updated ({$file_lang_old}) is readable OK.\n"; - $lines_lang_old = file( $file_lang_old ); -} -else -{ - echo "File to be updated ({$file_lang_old}) is not readable. Exit.\n"; - exit; -} - -$lines_eng_count = sizeof($lines_eng); -$lines_old_count = sizeof($lines_lang_old); -echo "Master file lines = ".($lines_eng_count+1)."\n"; -echo "File to update lines = ".($lines_old_count+1)."\n"; - -// find end of english header: -for( $i = 0; $i < $lines_eng_count; $i++ ) -{ - // parse revision of master file - if (preg_match('/\$Id.+v\s(\S+)\s.*/', $lines_eng[$i], $eng_revision) ) - { - $revision_comment = $eng_revision[1]; - echo "Master file revision: ".$revision_comment."\n"; - } - // search for "*/" at the end of a line - if (preg_match("/\*\//", $lines_eng[$i]) ) - { - echo "Master file: End of header is line = ".($i+1)."\n"; - $begin_line = $i + 1; - $i = $lines_eng_count; - } -} - -// copy existing localization file header -for( $i = 0; $i < $lines_old_count; $i++ ) -{ - if (preg_match("/\*\//", $lines_lang_old[$i]) ) - { - echo "File to be updated: End of header is line = ".($i+1)."\n"; - $begin_line_old = $i + 1; - $i = $lines_old_count; - $out .= " * Scripted update according en_GB string file (version: ".$revision_comment.") \n"; - $out .= " *\n **/\n"; - } - else - $out .= $lines_lang_old[$i]; -} - - -// compile output array based on english file -for( $i = $begin_line; $i < $lines_eng_count; $i++ ) -{ -// echo "$i >> {$lines_eng[$i]}\n"; - - // copy comments: - if (preg_match("/^\/\//", $lines_eng[$i]) ) - { - echo "\n\n=line ".($i+1)."=\nCopy comment to file to be updated:\n". - "-----------------------------------------\n". - trim($lines_eng[$i]). "\n". - "-----------------------------------------\n"; - $out .= $lines_eng[$i]; - } - - // copy empty line - elseif (preg_match('/^([\s\t]*)$/', $lines_eng[$i])) - { - echo "\n\n=line ".($i+1)."=\nCopy empty line to file to be updated\n"; - $out .= "\r\n"; - } - - // parse a line with variable definition - elseif (preg_match('/^\$TLS_(\w+\[?\'?\w*\'?\]?)[\s]*=[\s]*(.*)$/', $lines_eng[$i], $parsed_line)) - { - $var_counter++; - $var_name = '$TLS_'.$parsed_line[1]; - $bLocalized = FALSE; - $localizedLine = ''; -// print_r($parsed_line); - echo "\n\n=line ".($i+1)."=\nFound variable '$var_name' on master file\n"; - - // get localized value if defined - parse old localized strings - for( $k = $begin_line_old; $k < $lines_old_count; $k++ ) - { - if (preg_match('/^\\'.addcslashes($var_name,'\'\[\]').'[\s]*=[\s]*.+$/', $lines_lang_old[$k])) - { - echo "Found localization for variable '$var_name' on file to be updated (line ".($k+1).")\n"; - $bLocalized = TRUE; - $localizedLine = $lines_lang_old[$k]; - - // check if localized value exceed to more lines - semicolon is not found - while (!(preg_match('/;[\s]*$/', $lines_lang_old[$k]) - || preg_match('/;[\s]*[\/]{2}/', $lines_lang_old[$k]))) - { - $k++; - //echo "\t(line $k)Found localization for variable $var_name extends to this line\n"; - $localizedLine .= $lines_lang_old[$k]; - } - $k = $lines_old_count; // exit more parsing old file - } - } - - if ($bLocalized) - { - echo "Keep existing localization on file to be updated:\n". - "-----------------------------------------\n". - trim($localizedLine). "\n". - "-----------------------------------------\n"; - $out .= $localizedLine; - } - else - { - echo "Localization doesn't exists. Copy from master file to file to be updated:\n". - "-----------------------------------------\n". - trim($lines_eng[$i]). "\n"; - //add a todo on newly added lines - //$out .= trim($lines_eng[$i]). " //TODO: localize\r\n"; - $out .= $lines_eng[$i]; - $var_counter_new++; - $new_vars[$i] = $var_name; - - // check multiline value (check semicolon or semicolon with comment) - while (!(preg_match('/^(.*);[\s]*$/', $lines_eng[$i]) - || preg_match('/^(.*);[\s]*[\/]{2}/', $lines_eng[$i]))) - { - $i++; - echo trim($lines_eng[$i]). "\n"; - //add a todo on newly added lines - //$out .= trim($lines_eng[$i]). " //TODO: localize\r\n"; - $out .= $lines_eng[$i]; - } - echo "-----------------------------------------\n"; - - } - } - - // end of file - elseif (preg_match('/^\?\>/', $lines_eng[$i])) - { - $out .= "?>"; - } - - // skip unused multiline values - // must be a multiline value if it is no variable/comment/empty line/end of file - elseif (preg_match('/^.*/', $lines_eng[$i])) - echo "\n\n=line ".($i+1)."=\nSkipped line (expected unused multiline value on master file)\n"; - - // something wrong? - else - { - echo "\n\n=line ".($i+1)."=\nERROR: please fix this line\n" . $lines_eng[$i]; - exit; - } -} - - -// create backup if defined -if ($do_backup_file) - rename($file_lang_old, $file_lang_old.'.bck'); - - -// save output -$fp = fopen($file_lang_old, "w"); -fwrite($fp, $out); -fclose($fp); - -echo "\n\nUpdated file: ".$file_lang_old; -echo "\nCompleted! The script has parsed $var_counter strings and add $var_counter_new new variables.\n"; -echo implode("\n", $new_vars); -echo "\n\n===== Bye =====\n"; - + report.txt (RECOMMENDED) + * + * @package TestLink + * @author Martin Havlat, Julian Krien + * @copyright 2003, TestLink community + * @version CVS: $Id: tl_lang_parser.php,v 1.2.6.3 2010/12/12 10:34:14 mx-julian Exp $ + * @link http://www.teamst.org/index.php + * + * @internal Revisions: + * 20100517 - Julian - major changes: improved robustness, script can now also be + * used to update texts.php and description.php + * + */ + +/** + * Set path to your en_GB english file + */ +$file_eng = 'en_GB/strings.txt'; + +/** + * Set true if you would like to have original file with 'bck' extension + */ +$do_backup_file = false; + +// --------------------------------------------------------------------------- +if ($argc < 1) { + echo 'Usage: #tl_lang_parser.php '; + exit(); +} else { + $file_lang_old = $argv[1]; +} + +$out = ''; // data for output file +$var_counter = 0; +$var_counter_new = 0; +$new_vars = array(); + +echo "===== Start TestLink lang_parser =====\n"; + +// read english file +if (file_exists($file_eng) && is_readable($file_eng)) { + echo "Master file ($file_eng) is readable OK.\n"; + $lines_eng = file($file_eng); +} else { + echo "Master File ($file_eng) is not readable. Exit.\n"; + exit(); +} +// read language file +if (file_exists($file_lang_old) && is_readable($file_lang_old)) { + echo "File to be updated ({$file_lang_old}) is readable OK.\n"; + $lines_lang_old = file($file_lang_old); +} else { + echo "File to be updated ({$file_lang_old}) is not readable. Exit.\n"; + exit(); +} + +$lines_eng_count = count($lines_eng); +$lines_old_count = count($lines_lang_old); +echo "Master file lines = " . ($lines_eng_count + 1) . "\n"; +echo "File to update lines = " . ($lines_old_count + 1) . "\n"; + +// find end of english header: +for ($i = 0; $i < $lines_eng_count; $i ++) { + // parse revision of master file + if (preg_match('/\$Id.+v\s(\S+)\s.*/', $lines_eng[$i], $eng_revision)) { + $revision_comment = $eng_revision[1]; + echo "Master file revision: " . $revision_comment . "\n"; + } + // search for "*/" at the end of a line + if (preg_match("/\*\//", $lines_eng[$i])) { + echo "Master file: End of header is line = " . ($i + 1) . "\n"; + $begin_line = $i + 1; + $i = $lines_eng_count; + } +} + +// copy existing localization file header +for ($i = 0; $i < $lines_old_count; $i ++) { + if (preg_match("/\*\//", $lines_lang_old[$i])) { + echo "File to be updated: End of header is line = " . ($i + 1) . "\n"; + $begin_line_old = $i + 1; + $i = $lines_old_count; + $out .= " * Scripted update according en_GB string file (version: " . + $revision_comment . ") \n"; + $out .= " *\n **/\n"; + } else { + $out .= $lines_lang_old[$i]; + } +} + +// compile output array based on english file +for ($i = $begin_line; $i < $lines_eng_count; $i ++) { + + // copy comments: + if (preg_match("/^\/\//", $lines_eng[$i])) { + echo "\n\n=line " . ($i + 1) . "=\nCopy comment to file to be updated:\n" . + "-----------------------------------------\n" . trim($lines_eng[$i]) . + "\n" . "-----------------------------------------\n"; + $out .= $lines_eng[$i]; + } // copy empty line + elseif (preg_match('/^([\s\t]*)$/', $lines_eng[$i])) { + echo "\n\n=line " . ($i + 1) . + "=\nCopy empty line to file to be updated\n"; + $out .= "\r\n"; + } // parse a line with variable definition + elseif (preg_match('/^\$TLS_(\w+\[?\'?\w*\'?\]?)[\s]*=[\s]*(.*)$/', + $lines_eng[$i], $parsed_line)) { + $var_counter ++; + $var_name = '$TLS_' . $parsed_line[1]; + $bLocalized = false; + $localizedLine = ''; + echo "\n\n=line " . ($i + 1) . + "=\nFound variable '$var_name' on master file\n"; + + // get localized value if defined - parse old localized strings + for ($k = $begin_line_old; $k < $lines_old_count; $k ++) { + if (preg_match( + '/^\\' . addcslashes($var_name, '\'\[\]') . '[\s]*=[\s]*.+$/', + $lines_lang_old[$k])) { + echo "Found localization for variable '$var_name' on file to be updated (line " . + ($k + 1) . ")\n"; + $bLocalized = true; + $localizedLine = $lines_lang_old[$k]; + + // check if localized value exceed to more lines - semicolon is not found + while (! (preg_match('/;[\s]*$/', $lines_lang_old[$k]) || + preg_match('/;[\s]*[\/]{2}/', $lines_lang_old[$k]))) { + $k ++; + $localizedLine .= $lines_lang_old[$k]; + } + $k = $lines_old_count; // exit more parsing old file + } + } + + if ($bLocalized) { + echo "Keep existing localization on file to be updated:\n" . + "-----------------------------------------\n" . + trim($localizedLine) . "\n" . + "-----------------------------------------\n"; + $out .= $localizedLine; + } else { + echo "Localization doesn't exists. Copy from master file to file to be updated:\n" . + "-----------------------------------------\n" . + trim($lines_eng[$i]) . "\n"; + $out .= $lines_eng[$i]; + $var_counter_new ++; + $new_vars[$i] = $var_name; + + // check multiline value (check semicolon or semicolon with comment) + while (! (preg_match('/^(.*);[\s]*$/', $lines_eng[$i]) || + preg_match('/^(.*);[\s]*[\/]{2}/', $lines_eng[$i]))) { + $i ++; + echo trim($lines_eng[$i]) . "\n"; + $out .= $lines_eng[$i]; + } + echo "-----------------------------------------\n"; + } + } // end of file + elseif (preg_match('/^\?\>/', $lines_eng[$i])) { + $out .= "?>"; + } // skip unused multiline values + // must be a multiline value if it is no variable/comment/empty line/end of file + elseif (preg_match('/^.*/', $lines_eng[$i])) { + echo "\n\n=line " . ($i + 1) . + "=\nSkipped line (expected unused multiline value on master file)\n"; + } // something wrong? + else { + echo "\n\n=line " . ($i + 1) . "=\nERROR: please fix this line\n" . + $lines_eng[$i]; + exit(); + } +} + +// create backup if defined +if ($do_backup_file) { + rename($file_lang_old, $file_lang_old . '.bck'); +} + +// save output +$fp = fopen($file_lang_old, "w"); +fwrite($fp, $out); +fclose($fp); + +echo "\n\nUpdated file: " . $file_lang_old; +echo "\nCompleted! The script has parsed $var_counter strings and add $var_counter_new new variables.\n"; +echo implode("\n", $new_vars); +echo "\n\n===== Bye =====\n"; + ?> diff --git a/locale/zh_CN/description.php b/locale/zh_CN/description.php index d3353c4d76..ab519d88a3 100644 --- a/locale/zh_CN/description.php +++ b/locale/zh_CN/description.php @@ -1,33 +1,33 @@ -/ directory. - * This directory is obsolete now. It serves as source for localization contributors only. - * - * ----------------------------------------------------------------------------------- */ - -// printFilter.html //已校对 +/ directory. + * This directory is obsolete now. It serves as source for localization contributors only. + * + * ----------------------------------------------------------------------------------- */ + +// printFilter.html //已校对 $TLS_hlp_generateDocOptions = "

          æ ¹æ®é€‰é¡¹ç”Ÿæˆçš„æ–‡æ¡£

          该列表å…许用户在æµè§ˆæµ‹è¯•用例之å‰å¯¹å…¶è¿›è¡Œè¿‡æ»¤ã€‚ @@ -47,9 +47,9 @@

          表中的内容:TestLink通过内部超连接æ’入所有标题

          -

          导出格å¼ï¼šå…±æœ‰ä¸¤ç§æ ¼å¼ï¼šHTMLå’ŒMS wordã€‚åœ¨ç¬¬äºŒç§æƒ…况下,æµè§ˆå™¨ä¼šè‡ªåŠ¨è°ƒç”¨MS word组件。

          "; - -// testPlan.html //已校对 +

          导出格å¼ï¼šå…±æœ‰ä¸¤ç§æ ¼å¼ï¼šHTMLå’ŒMS wordã€‚åœ¨ç¬¬äºŒç§æƒ…况下,æµè§ˆå™¨ä¼šè‡ªåŠ¨è°ƒç”¨MS word组件。

          "; + +// testPlan.html //已校对 $TLS_hlp_testPlan = "

          测试计划

          一般定义

          @@ -65,9 +65,9 @@ æƒé™é«˜çš„用户å¯ä»¥è®¾ç½®æµ‹è¯•套件(类别)的优先级ï¼é£Žé™©å’Œæ‰€æœ‰å…³ç³»(测试套件由è°è´Ÿè´£),以åŠåˆ›å»ºæµ‹è¯•里程碑。

          注æ„:用户有å¯èƒ½çœ‹ä¸åˆ°ä¸€ä¸ªåŒ…å«ä»»ä½•测试计划的下拉èœå•。 -åœ¨è¿™ç§æƒ…况下,所有的链接(除了管ç†äººå‘˜å¼€å¯çš„)都ä¸èƒ½ä½¿ç”¨ã€‚å¦‚æžœå‡ºçŽ°è¿™ç§æƒ…况,你一定è¦è·Ÿé¢†å¯¼æˆ–管ç†å‘˜è”系,给你在项目中授予适当的æƒé™æˆ–者为你创建一个测试计划。

          "; - -// custom_fields.html //已校对 +åœ¨è¿™ç§æƒ…况下,所有的链接(除了管ç†äººå‘˜å¼€å¯çš„)都ä¸èƒ½ä½¿ç”¨ã€‚å¦‚æžœå‡ºçŽ°è¿™ç§æƒ…况,你一定è¦è·Ÿé¢†å¯¼æˆ–管ç†å‘˜è”系,给你在项目中授予适当的æƒé™æˆ–者为你创建一个测试计划。

          "; + +// custom_fields.html //已校对 $TLS_hlp_customFields = "

          自定义字段

          䏋颿˜¯å…³äºŽè‡ªå®šä¹‰å­—段应用的一些实例:

            @@ -101,14 +101,14 @@
          • å¯ç”¨æµ‹è¯•计划设计。当设计测试计划(呿µ‹è¯•计划中添加测试用例时),用户å¯ä»¥å¯¹å…¶è¿›è¡Œä¿®æ”¹
          • å¯ç”¨äºŽã€‚用户选择什么类型的字段选项。
          -"; - -// execMain.html //已校对 +"; + +// execMain.html //已校对 $TLS_hlp_executeMain = "

          执行测试用例

          å…è®¸ç”¨æˆ·æ‰§è¡Œæµ‹è¯•ç”¨ä¾‹ã€‚æ‰§è¡Œæœ¬èº«åªæ˜¯ä¸€ä¸ªå¯¹é€‰æ‹©çš„æž„建的测试用例分é…结果(通过,失败,é”定)的过程

          -

          通过é…ç½®å¯ä»¥å…³è”到缺陷跟踪系统。用户å¯ä»¥ç›´æŽ¥æ–°å»ºé—®é¢˜å’Œæµè§ˆå·²ç»å­˜åœ¨çš„问题。更多信æ¯è¯·æŸ¥çœ‹å®‰è£…手册。

          "; - -//bug_add.html //已校对 +

          通过é…ç½®å¯ä»¥å…³è”到缺陷跟踪系统。用户å¯ä»¥ç›´æŽ¥æ–°å»ºé—®é¢˜å’Œæµè§ˆå·²ç»å­˜åœ¨çš„问题。更多信æ¯è¯·æŸ¥çœ‹å®‰è£…手册。

          "; + +// bug_add.html //已校对 $TLS_hlp_btsIntegration = "

          给测试用例添加问题

          (仅在已ç»é…置好的情况下) TestLink 仅仅简å•地跟缺陷跟踪系统(BTS)进行了集æˆï¼Œå³ä¸èƒ½å‘BTSå‘é€åˆ›å»ºbug的请求,也ä¸èƒ½å–回bug idå·ã€‚ @@ -117,7 +117,7 @@

        • 添加新问题
        • 显示已存在问题的信æ¯
        -

        +

        添加问题的过程

        @@ -126,59 +126,55 @@

      • 第二步: 记下BTS指定的BUGID
      • 第三步: å°†BUGID写入输入框中
      • 第四步: 点击添加问题按钮
      • -
      +
    关闭添加问题页é¢åŽï¼Œä½ å°†åœ¨æ‰§è¡Œé¡µé¢ä¸Šçœ‹è§ä¸€ä¸ªé—®é¢˜æ•°æ®çš„å…³è”ä¿¡æ¯ã€‚ -

    "; - -// execFilter.html //已校对 +

    "; + +// execFilter.html //已校对 $TLS_hlp_executeFilter = "

    设置过滤器并构建测试的实施

    -

    å·¦æ–¹æ¡†ä¸­åŒ…å«æŒ‡æ´¾ç»™å½“å‰é¡¹ç›®æµ‹è¯•计划的测试用例的导航,左方框的列表包å«äº†æµ‹è¯•用例筛选的过滤器。" . -"这些过滤器å…许用户æç‚¼å‡ºçš„一组测试用例,然åŽåŽ»æ‰§è¡Œã€‚" . -"设置好过滤器,然åŽç‚¹å‡» \"应用\" 按钮并从树形èœå•中选择适当的测试用例 " . -"

    +

    å·¦æ–¹æ¡†ä¸­åŒ…å«æŒ‡æ´¾ç»™å½“å‰é¡¹ç›®æµ‹è¯•计划的测试用例的导航,左方框的列表包å«äº†æµ‹è¯•用例筛选的过滤器。" . "这些过滤器å…许用户æç‚¼å‡ºçš„一组测试用例,然åŽåŽ»æ‰§è¡Œã€‚" . + "设置好过滤器,然åŽç‚¹å‡» \"应用\" 按钮并从树形èœå•中选择适当的测试用例 " . + "

    构建

    -

    用户必须选择一个用æ¥å’Œæµ‹è¯•结果建立连接的构建。" . -"æž„å»ºæ˜¯å½“å‰æµ‹è¯•计划的基本组件。在æ¯ä¸ªæž„建中æ¯ä¸€ä¸ªæµ‹è¯•用例都å¯èƒ½è¢«æ‰§è¡Œå¤šæ¬¡ã€‚" . -"然而统计时åªè®¡å…¥æœ€ç»ˆçš„æ‰§è¡Œç»“果。 +

    用户必须选择一个用æ¥å’Œæµ‹è¯•结果建立连接的构建。" . "æž„å»ºæ˜¯å½“å‰æµ‹è¯•计划的基本组件。在æ¯ä¸ªæž„建中æ¯ä¸€ä¸ªæµ‹è¯•用例都å¯èƒ½è¢«æ‰§è¡Œå¤šæ¬¡ã€‚" . + "然而统计时åªè®¡å…¥æœ€ç»ˆçš„æ‰§è¡Œç»“果。
    项目负责人å¯ä»¥åœ¨æ–°å»ºæž„建页é¢åˆ›å»ºæž„建。

    测试用例ID过滤器

    -

    用户å¯ä»¥è¿‡æ»¤æµ‹è¯•用例通过唯一的标识符。该ID在创建测试用例的时候自动生æˆã€‚ -空列表æ„味ç€è¿˜æ²¡æœ‰åº”用过滤器。

    +

    用户å¯ä»¥è¿‡æ»¤æµ‹è¯•用例通过唯一的标识符。该ID在创建测试用例的时候自动生æˆã€‚ +空列表æ„味ç€è¿˜æ²¡æœ‰åº”用过滤器。

    优先级过滤器

    -

    用户å¯ä»¥é€šè¿‡ä¼˜å…ˆçº§æ¥è¿‡æ»¤æµ‹è¯•用例。æ¯ä¸ªæµ‹è¯•用例的é‡è¦æ€§è¿˜ä¸Žè¯¥æµ‹è¯•ç”¨ä¾‹åœ¨å½“å‰æµ‹è¯•计划里的紧急程度有关。" . -"例如'HIGH'优先级的测试用例会显示那些如果é‡è¦ç¨‹åº¦æ˜¯HIGH,在测试计划中的紧急程度至少是MEDIUM级别的测试用例。

    +

    用户å¯ä»¥é€šè¿‡ä¼˜å…ˆçº§æ¥è¿‡æ»¤æµ‹è¯•用例。æ¯ä¸ªæµ‹è¯•用例的é‡è¦æ€§è¿˜ä¸Žè¯¥æµ‹è¯•ç”¨ä¾‹åœ¨å½“å‰æµ‹è¯•计划里的紧急程度有关。" . + "例如'HIGH'优先级的测试用例会显示那些如果é‡è¦ç¨‹åº¦æ˜¯HIGH,在测试计划中的紧急程度至少是MEDIUM级别的测试用例。

    结果过滤器

    -

    用户å¯ä»¥é€šè¿‡æµ‹è¯•结果过滤测试用例。测试结果是测试用例基于æŸä¸€æž„建的产物。测试用例的状æ€åŒ…括通过,失败,é”定或者尚未è¿è¡Œã€‚" . -"该过滤器默认情况下是ç¦ç”¨çš„。

    +

    用户å¯ä»¥é€šè¿‡æµ‹è¯•结果过滤测试用例。测试结果是测试用例基于æŸä¸€æž„建的产物。测试用例的状æ€åŒ…括通过,失败,é”定或者尚未è¿è¡Œã€‚" . + "该过滤器默认情况下是ç¦ç”¨çš„。

    用户过滤器

    -

    用户å¯ä»¥æ ¹æ®æµ‹è¯•用例的指派者æ¥è¿‡æ»¤æµ‹è¯•用例。å¤é€‰æ¡†å…许包å«\"未指派\"的选项。

    "; -/* -

    当å‰ç»“æžœ

    -

    默认情况下或者没有选择å¤é€‰æ¡†é‡Œçš„"most current"选项时,树形目录将按照下拉选择框里选择的构建排åºã€‚ -这时树形目录将显示测试用例的状æ€ã€‚
    -例如:用户从下æ¥é€‰æ‹©æ¡†é‡Œé€‰æ‹©æž„建2而且没有选择å¤é€‰æ¡†é‡Œçš„"most current"。 -所有测试用例会显示它们在构建2里的执行状æ€ã€‚ -因此,如果测试用例1在构建2里执行通过的情况下,它会显示为绿色。 -
    如果用户选择了å¤é€‰æ¡†é‡Œçš„"most current",那么树形目录里的测试用例将根æ®ä»–们最新的执行结果显示相应的颜色。 -
    例如:如果用户选择了构建2而且选择了å¤é€‰æ¡†é‡Œçš„"most current",那么所有的测试用例将根æ®ä»–ä»¬æœ€è¿‘çš„çŠ¶æ€æ˜¾ç¤ºã€‚ -因此,如果测试用例1在构建3里通过,å³ä½¿ç”¨æˆ·é€‰æ‹©äº†æž„建2,它也会显示为绿色。

    - */ - - -// newest_tcversions.html //已校对 +

    用户å¯ä»¥æ ¹æ®æµ‹è¯•用例的指派者æ¥è¿‡æ»¤æµ‹è¯•用例。å¤é€‰æ¡†å…许包å«\"未指派\"的选项。

    "; +/* + *

    当å‰ç»“æžœ

    + *

    默认情况下或者没有选择å¤é€‰æ¡†é‡Œçš„"most current"选项时,树形目录将按照下拉选择框里选择的构建排åºã€‚ + * 这时树形目录将显示测试用例的状æ€ã€‚
    + * 例如:用户从下æ¥é€‰æ‹©æ¡†é‡Œé€‰æ‹©æž„建2而且没有选择å¤é€‰æ¡†é‡Œçš„"most current"。 + * 所有测试用例会显示它们在构建2里的执行状æ€ã€‚ + * 因此,如果测试用例1在构建2里执行通过的情况下,它会显示为绿色。 + *
    如果用户选择了å¤é€‰æ¡†é‡Œçš„"most current",那么树形目录里的测试用例将根æ®ä»–们最新的执行结果显示相应的颜色。 + *
    例如:如果用户选择了构建2而且选择了å¤é€‰æ¡†é‡Œçš„"most current",那么所有的测试用例将根æ®ä»–ä»¬æœ€è¿‘çš„çŠ¶æ€æ˜¾ç¤ºã€‚ + * 因此,如果测试用例1在构建3里通过,å³ä½¿ç”¨æˆ·é€‰æ‹©äº†æž„建2,它也会显示为绿色。

    + */ + +// newest_tcversions.html //已校对 $TLS_hlp_planTcModified = "

    è¢«å…³è”æµ‹è¯•用例的最新版本

    通过分æžä¸Žæµ‹è¯•计划关è”的所有测试用例,那些有最新版本的测试用例将被罗列出æ¥ï¼ˆç›¸å¯¹åº”äºŽå½“å‰æµ‹è¯•计划的测试用例) -

    "; - - -// requirementsCoverage.html //已校对 +

    "; + +// requirementsCoverage.html //已校对 $TLS_hlp_requirementsCoverage = "

    需求覆盖


    这个功能å…è®¸é€šè¿‡æµ‹è¯•ç”¨ä¾‹æ¥æ˜ å°„对用户或系统需求的覆盖度。 @@ -187,37 +183,36 @@

    需求规格

    éœ€æ±‚æ˜¯æ ¹æ®æµ‹è¯•项目中相关è”çš„'需求规约'文档æ¥ç»„织的。
    TestLink 䏿”¯æŒå³åŒ…å«éœ€æ±‚规约åˆåŒ…å«éœ€æ±‚的版本。 -å› æ­¤ï¼Œåªæœ‰åˆ›å»ºå¥½è§„çº¦ä¹‹åŽæ‰èƒ½å¾€é‡Œæ·»åŠ éœ€æ±‚æ–‡æ¡£ç‰ˆæœ¬ã€‚ +å› æ­¤ï¼Œåªæœ‰åˆ›å»ºå¥½è§„çº¦ä¹‹åŽæ‰èƒ½å¾€é‡Œæ·»åŠ éœ€æ±‚æ–‡æ¡£ç‰ˆæœ¬ã€‚ 标题. -用户于å¯ä»¥å‘范围中添加简å•çš„æè¿°æˆ–注释。

    +用户于å¯ä»¥å‘范围中添加简å•çš„æè¿°æˆ–注释。

    -

    需求覆盖数目用æ¥è¯„估需求覆盖度如果并没有把所有的需求添加(导入)到TestLink的情况下。 -需求覆盖数目的值0 指的是当å‰è¢«ç”¨æ¥åšç»“果分æžçš„需求数é‡ã€‚

    -

    例如 SRS 包å«200个需求,但是仅有50个被添加到TestLink。测试覆盖度为25%(如果这些被添加的需求都将被测试)。 +

    需求覆盖数目用æ¥è¯„估需求覆盖度如果并没有把所有的需求添加(导入)到TestLink的情况下。 +需求覆盖数目的值0 指的是当å‰è¢«ç”¨æ¥åšç»“果分æžçš„需求数é‡ã€‚

    +

    例如 SRS 包å«200个需求,但是仅有50个被添加到TestLink。测试覆盖度为25%(如果这些被添加的需求都将被测试)。

    需求

    点击需求规约的标题,你就å¯ä»¥åˆ›å»ºï¼Œç¼–辑,删除和导入需求文档。æ¯ä¸ªéœ€æ±‚都有标题,范围和状æ€ã€‚ 状æ€åŒ…括 \"有效的\" å’Œ \"ä¸å¯æµ‹è¯•çš„\". ä¸å¯æµ‹è¯•的需求ä¸ä¼šè¢«ç»Ÿè®¡åº¦é‡ã€‚ -è¯¥å‚æ•°ç”¨äºŽæ²¡æœ‰å®žçŽ°çš„åŠŸèƒ½å’Œé”™è¯¯çš„è®¾è®¡éœ€æ±‚ã€‚

    +è¯¥å‚æ•°ç”¨äºŽæ²¡æœ‰å®žçŽ°çš„åŠŸèƒ½å’Œé”™è¯¯çš„è®¾è®¡éœ€æ±‚ã€‚

    ä½ å¯ä»¥åœ¨éœ€æ±‚规约页é¢é€šè¿‡å¤šç§æŸ¥çœ‹éœ€æ±‚的途径为需求创建新的测试用例。 -这些测试用例被包å«åœ¨é€šè¿‡é…置命å的测试套件里。(默认是: $tlCfg->req_cfg->default_testsuite_name = +这些测试用例被包å«åœ¨é€šè¿‡é…置命å的测试套件里。(默认是: $tlCfg->req_cfg->default_testsuite_name = \"通过需求创建测试套件 - 自动\";). 标题和范围被å¤åˆ¶åˆ°è¿™äº›æµ‹è¯•用例。

    -"; - - -// planAddTC_m1.tpl //已校对 +"; + +// planAddTC_m1.tpl //已校对 $TLS_hlp_planAddTC = "

    关于'ä¿å­˜è‡ªå®šä¹‰å­—段'

    -如果你已ç»å®šä¹‰è€Œä¸”指派了关键字到测试项目中,
    +如果你已ç»å®šä¹‰è€Œä¸”指派了关键字到测试项目中,
    自定义字段具有:
    '在测试计划设计里显示=true' 和
    'å¯ç”¨æµ‹è¯•计划设计=true'
    ä½ å°†åªèƒ½åœ¨å·²ç»ä¸Žæµ‹è¯•计划建立关è”的测试用例页é¢çœ‹åˆ°è¿™äº›å…³é”®å­—。 -"; - -// xxx.html -//$TLS_hlp_xxx = ""; - -// ----- END ------------------------------------------------------------------ +"; + +// xxx.html +// $TLS_hlp_xxx = ""; + +// ----- END ------------------------------------------------------------------ ?> diff --git a/locale/zh_CN/texts.php b/locale/zh_CN/texts.php index 234d98e8a5..5c747d7510 100644 --- a/locale/zh_CN/texts.php +++ b/locale/zh_CN/texts.php @@ -1,39 +1,37 @@ -] and $TLS_help_title[] - * or - * $TLS_instruct[] and $TLS_instruct_title[] - * - * - * Revisions history is not stored for the file - * - * ------------------------------------------------------------------------------------ */ -$TLS_htmltext_title['error'] = "Application error"; -$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . - "logs for details.

    You are welcome to report the problem. Please visit our " . - "website.

    "; - - - -$TLS_htmltext_title['assignReqs'] = "分é…需求给测试用例"; //已校对 -$TLS_htmltext['assignReqs'] = "

    目的:

    +] and $TLS_help_title[] + * or + * $TLS_instruct[] and $TLS_instruct_title[] + * + * + * Revisions history is not stored for the file + * + * ------------------------------------------------------------------------------------ */ +$TLS_htmltext_title['error'] = "Application error"; +$TLS_htmltext['error'] = "

    Unexpected error happens. Please check event viewer or " . + "logs for details.

    You are welcome to report the problem. Please visit our " . + "website.

    "; + +$TLS_htmltext_title['assignReqs'] = "分é…需求给测试用例"; // 已校对 +$TLS_htmltext['assignReqs'] = "

    目的:

    用户å¯ä»¥è®¾ç½®æµ‹è¯•套件和需求规约之间的关系. 设计者å¯ä»¥æŠŠæ­¤å¤„çš„æµ‹è¯•å¥—ä»¶å’Œéœ€æ±‚è§„çº¦ä¸€ä¸€å…³è” .例如:一个测试用例å¯ä»¥è¢«å…³è”到零个ã€ä¸€ä¸ªã€å¤šä¸ªæµ‹è¯•套件,å之亦然. 这些å¯è¿½è¸ªçš„æ¨¡åž‹å¸®åŠ©æˆ‘ä»¬åŽ»ç ”ç©¶æµ‹è¯•ç”¨ä¾‹å¯¹éœ€æ±‚çš„è¦†ç›–æƒ…å†µ,并且找出测试用例是å¦é€šè¿‡çš„æƒ…况.这些分æžç”¨æ¥éªŒè¯æµ‹è¯•的覆盖程度是å¦è¾¾åˆ°é¢„期的结果。

    @@ -47,42 +45,38 @@ 底部的'有效的需求'列出了所有尚未关è”åˆ°å½“å‰æµ‹è¯•用例的需求. 测试设计者å¯ä»¥ç‚¹å‡»'指派'按钮把需求指派到测试用例.这些新关è”çš„ 测试用例会在工作区中间的'已指派的需求'中显示. -"; - - -// -------------------------------------------------------------------------------------- -$TLS_htmltext_title['editTc'] = "测试规范"; //已校对 -$TLS_htmltext['editTc'] = "

    目的:

    +"; + +// -------------------------------------------------------------------------------------- +$TLS_htmltext_title['editTc'] = "测试规范"; // 已校对 +$TLS_htmltext['editTc'] = "

    目的:

    目的:

    -

    测试规范 å…许用户查看和编辑所有现有的" . - "测试套件 å’Œ 测试用例. 测试用例默认使用当å‰ç‰ˆæœ¬.". - "所有以å‰çš„历å²ç‰ˆæœ¬éƒ½æ˜¯å¯ç”¨çš„,并且å¯ä»¥åœ¨è¿™é‡Œè¿›è¡ŒæŸ¥çœ‹å’Œç®¡ç†.

    +

    测试规范 å…许用户查看和编辑所有现有的" . "测试套件 å’Œ 测试用例. 测试用例默认使用当å‰ç‰ˆæœ¬." . + "所有以å‰çš„历å²ç‰ˆæœ¬éƒ½æ˜¯å¯ç”¨çš„,并且å¯ä»¥åœ¨è¿™é‡Œè¿›è¡ŒæŸ¥çœ‹å’Œç®¡ç†.

    开始:

      -
    1. 从å³ä¸Šè§’的下拉èœå•中选择你的测试项目. 注æ„: " . - "你永远å¯ä»¥ä»Žå³ä¸Šè§’的下拉èœå•选择改å˜å½“å‰çš„æµ‹è¯•项目." . - ".
    2. +
    3. 从å³ä¸Šè§’的下拉èœå•中选择你的测试项目. 注æ„: " . "你永远å¯ä»¥ä»Žå³ä¸Šè§’的下拉èœå•选择改å˜å½“å‰çš„æµ‹è¯•项目." . + ".
    4. 点击\"测试规范\",ç„¶åŽä»Žä¸­é€‰æ‹©ä¸€ä¸ªæµ‹è¯•套件
    5. -
    6. 点击 新建测试套件将创建一个新的测试套件的å­é›†. " . - "测试套件å­é›†å¯ä»¥ä¸ºä½ çš„æµ‹è¯•文档归类,å½’ç±»å¯ä»¥æ˜¯æŒ‰ç…§ä½ çš„éœ€è¦æ¥è¿›è¡Œ(功能/éžåŠŸèƒ½, 产å“部件, 产å“功能, 需求更改, 等等)." . - "测试套件å­é›†çš„æè¿°ä¸­ä¸­åŒ…å«äº†ç›¸å…³çš„æµ‹è¯•用例的作用域,默认的系统é…置信æ¯ç­‰,他们还å¯èƒ½åŒ…å«å’Œå…¶ä»–一些文档资料链接, æµ‹è¯•å±€é™æ€§, 或者其他信æ¯.通常这些注释是测试套件å­é›†æ‰€å…±åŒå…·æœ‰çš„. 他们构æˆäº†ä¸€ä¸ªæµ‹è¯•套件的文件夹的概念,测试套件å­é›†æ˜¯å¯ä»¥æ‰©å……的文件夹. 用户å¯ä»¥åœ¨åŒä¸€ä¸ªæµ‹è¯•计划里移动或者å¤åˆ¶å®ƒä»¬.åŒæ—¶, 他们å¯ä»¥ä½œä¸ºä¸€ä¸ªæ•´ä½“(包括其中的测试用例)输出或者输入到其他格å¼." .".
    7. -
    8. 在导航树中选择一个刚创建的新的测试套件" . - "ç„¶åŽç‚¹å‡»åˆ›å»ºæµ‹è¯•用例. å°±å¯ä»¥åœ¨è¿™ä¸ªæµ‹è¯•套件å­é›†é‡Œåˆ›å»ºä¸€ä¸ªæ–°çš„æµ‹è¯•用例." . - "一个测试用例定义了一个特有的测试过程,它包括测试的环境, 步骤, 期望的结果, 测试项目中的自定义字段(å‚è§ç”¨æˆ·æ‰‹å†Œ), 还å¯ä»¥ç»™æµ‹è¯•用例指派一个" . - "关键字 以方便跟踪查询.
    9. +
    10. 点击 新建测试套件将创建一个新的测试套件的å­é›†. " . + "测试套件å­é›†å¯ä»¥ä¸ºä½ çš„æµ‹è¯•文档归类,å½’ç±»å¯ä»¥æ˜¯æŒ‰ç…§ä½ çš„éœ€è¦æ¥è¿›è¡Œ(功能/éžåŠŸèƒ½, 产å“部件, 产å“功能, 需求更改, 等等)." . + "测试套件å­é›†çš„æè¿°ä¸­ä¸­åŒ…å«äº†ç›¸å…³çš„æµ‹è¯•用例的作用域,默认的系统é…置信æ¯ç­‰,他们还å¯èƒ½åŒ…å«å’Œå…¶ä»–一些文档资料链接, æµ‹è¯•å±€é™æ€§, 或者其他信æ¯.通常这些注释是测试套件å­é›†æ‰€å…±åŒå…·æœ‰çš„. 他们构æˆäº†ä¸€ä¸ªæµ‹è¯•套件的文件夹的概念,测试套件å­é›†æ˜¯å¯ä»¥æ‰©å……的文件夹. 用户å¯ä»¥åœ¨åŒä¸€ä¸ªæµ‹è¯•计划里移动或者å¤åˆ¶å®ƒä»¬.åŒæ—¶, 他们å¯ä»¥ä½œä¸ºä¸€ä¸ªæ•´ä½“(包括其中的测试用例)输出或者输入到其他格å¼." . + ".
    11. +
    12. 在导航树中选择一个刚创建的新的测试套件" . "ç„¶åŽç‚¹å‡»åˆ›å»ºæµ‹è¯•用例. å°±å¯ä»¥åœ¨è¿™ä¸ªæµ‹è¯•套件å­é›†é‡Œåˆ›å»ºä¸€ä¸ªæ–°çš„æµ‹è¯•用例." . + "一个测试用例定义了一个特有的测试过程,它包括测试的环境, 步骤, 期望的结果, 测试项目中的自定义字段(å‚è§ç”¨æˆ·æ‰‹å†Œ), 还å¯ä»¥ç»™æµ‹è¯•用例指派一个" . + "关键字 以方便跟踪查询.
    13. ä»Žå·¦è¾¹çš„å¯¼èˆªæ ‘é‡Œé€‰æ‹©å’Œç¼–è¾‘æ•°æ®æ¥å®žçŽ°å¯¼èˆªåŠŸèƒ½. 测试用例å¯ä»¥ä¿å­˜è‡ªå·±çš„æ‰€æœ‰åކå².
    14. 测试用例编写完毕åŽ, ä½ å¯ä»¥æŠŠå®ƒçš„æµ‹è¯•规范关è”到 测试计划 .
    -

    TestLinkå¯ä»¥å¸®ä½ æ•´ç†æµ‹è¯•套件,å¯ä»¥æŠŠæµ‹è¯•套件分类æˆä¸ºä¸åŒçš„æµ‹è¯•套件å­é›†. 测试套件å­é›†è¿˜å¯ä»¥åŒ…嫿›´ä¸‹çº§çš„æµ‹è¯•案例å­é›†. - 因此你å¯ä»¥æŠŠè¿™äº›æ‰€æœ‰çš„ä¿¡æ¯æ‰“å°æˆå†Œ." ."

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchTc'] = "测试用例æœç´¢é¡µ"; //已校对 -$TLS_htmltext['searchTc'] = "

    目的:

    +

    TestLinkå¯ä»¥å¸®ä½ æ•´ç†æµ‹è¯•套件,å¯ä»¥æŠŠæµ‹è¯•套件分类æˆä¸ºä¸åŒçš„æµ‹è¯•套件å­é›†. 测试套件å­é›†è¿˜å¯ä»¥åŒ…嫿›´ä¸‹çº§çš„æµ‹è¯•案例å­é›†. + 因此你å¯ä»¥æŠŠè¿™äº›æ‰€æœ‰çš„ä¿¡æ¯æ‰“å°æˆå†Œ." . "

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchTc'] = "测试用例æœç´¢é¡µ"; // 已校对 +$TLS_htmltext['searchTc'] = "

    目的:

    按照关键字和æœç´¢å­—符串æ¥è¿›è¡Œæœç´¢. 英文æœç´¢æ˜¯ä¸åŒºåˆ†å¤§å°å†™. 结果åªåŒ…æ‹¬å½“å‰æµ‹è¯•项目中已有的测试用例.

    @@ -93,26 +87,13 @@
  • 选择必须的关键字或者让该æ ç›®ç•™ç©ºä¸º'ä¸ä½¿ç”¨'.
  • 点击“查找â€.
  • æ‰€æœ‰ç¬¦åˆæœç´¢æ¡ä»¶çš„æµ‹è¯•用例就会显示出æ¥. ä½ å¯ä»¥ç‚¹å‡»'标题'链接开始对测试用例进行其它æ“作.
  • -"; - - - - - - - - - - - - - - -/* contribution by asimon for 2976 */ -// requirements search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; -$TLS_htmltext['searchReq'] = "

    Purpose:

    +"; + +/* contribution by asimon for 2976 */ +// requirements search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReq'] = "Requirement Search Page"; +$TLS_htmltext['searchReq'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirements from actual Test Project.

    @@ -130,12 +111,12 @@

    - Only requirements within the current project will be searched.
    - The search is case-insensitive.
    -- Empty fields are not considered.

    "; - -// requirement specification search -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; -$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    +- Empty fields are not considered.

    "; + +// requirement specification search +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['searchReqSpec'] = "Requirement Specification Search Page"; +$TLS_htmltext['searchReqSpec'] = "

    Purpose:

    Navigation according to keywords and/or searched strings. The search is not case sensitive. Result includes just requirement specifications from actual Test Project.

    @@ -153,13 +134,12 @@

    - Only requirement specifications within the current project will be searched.
    - The search is case-insensitive.
    -- Empty fields are not considered.

    "; -/* end contribution */ - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printTestSpec'] = "打å°éœ€æ±‚规约"; //printTC.html //已校对 -$TLS_htmltext['printTestSpec'] = "

    目的:

    +- Empty fields are not considered.

    "; +/* end contribution */ + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printTestSpec'] = "打å°éœ€æ±‚规约"; // printTC.html //已校对 +$TLS_htmltext['printTestSpec'] = "

    目的:

    在这里你å¯ä»¥æ‰“å°å•个测试用例,测试套件中的所有测试用例或者测试项目或测试计划中的所有测试用例.

    开始:

      @@ -171,21 +151,20 @@
    1. 使用æµè§ˆå™¨çš„æ‰“å°åŠŸèƒ½æ¥è¾“出信æ¯.
      注æ„:ä¿è¯åªæ‰“å°å³è¾¹çš„æ¡†æž¶.

    2. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['reqSpecMgmt'] = "需求规约设计"; //printTC.html //已校对 -$TLS_htmltext['reqSpecMgmt'] = "

    ä½ å¯ä»¥ç®¡ç†éœ€æ±‚规约文档.

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['reqSpecMgmt'] = "需求规约设计"; // printTC.html //已校对 +$TLS_htmltext['reqSpecMgmt'] = "

    ä½ å¯ä»¥ç®¡ç†éœ€æ±‚规约文档.

    需求规约

    需求是由需求规约文档æ¥çº¦å®šçš„,ç„¶åŽå…³è”到测试项目. -
    TestLink(当å‰ç‰ˆæœ¬)æš‚æ—¶è¿˜ä¸æ”¯æŒéœ€æ±‚规约版本中包å«äº†éœ€æ±‚本身的情况. +
    TestLink(当å‰ç‰ˆæœ¬)æš‚æ—¶è¿˜ä¸æ”¯æŒéœ€æ±‚规约版本中包å«äº†éœ€æ±‚本身的情况. 所以,文档的版本必须在需求规约之åŽåˆ›å»ºæ ‡é¢˜. 用户å¯ä»¥æ·»åŠ ç®€å•æè¿°åˆ° 范围 区域.

    -

    需求覆盖数目 +

    需求覆盖数目 是为了统计需求覆盖率而使用的,å¦‚æžœä¸æŠŠæ‰€æœ‰çš„éœ€æ±‚æäº¤åˆ°TestLink管ç†ï¼Œ0那么当å‰ç»“果分æžä¸­éœ€æ±‚的数é‡ä»¥TestLink管ç†èµ·æ¥çš„éœ€æ±‚ä¸ºä¾æ®.

    例如: SRS项目中包括200个需求,ä½†æ˜¯åªæœ‰50个需求被TestLink管ç†èµ·æ¥.那么测试覆盖率就是25%(如果所有的测试需求被测试的情况下).

    @@ -194,49 +173,32 @@

    点击已创建的需求规约,如果项目中还ä¸å­˜åœ¨éœ€æ±‚规约先创建一个.ç„¶åŽä½ å°±å¯ä»¥ä¸ºè¿™ä¸ªéœ€æ±‚规约创建具体的需求。æ¯ä¸ªéœ€æ±‚包括标题,范围和当å‰çжæ€.需求的状æ€å¯ä»¥æ˜¯'有效的'或者'ä¸å¯æµ‹è¯•çš„'.ä¸å¯æµ‹è¯•çš„éœ€æ±‚åœ¨ç»“æžœåˆ†æžæ—¶ä¸è¢«è®¡å…¥ç»Ÿè®¡æ•°æ®ã€‚è¿™ä¸ªå‚æ•°å¯ä»¥è¢«ç”¨æ¥è®¾ç½®é‚£äº›ä¸å¯å®žæ–½çš„功能特点或者错误的需求.

    用户å¯ä»¥åœ¨éœ€æ±‚界é¢ä¸­ä½¿ç”¨å·²åˆ›å»ºçš„需求自动创建测试用例.这些测试用例被创建到å字定义在é…置文件(default is: \$tlCfg->req_cfg->default_testsuite_name ='Test suite created by Requirement - Auto';) -中的测试套件中. 标题和范围被å¤åˆ¶åˆ°æµ‹è¯•用例中.

    "; - - - - - - - - - - - - - - - - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; //printReq +中的测试套件中. 标题和范围被å¤åˆ¶åˆ°æµ‹è¯•用例中.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['printReqSpec'] = "Print Requirement Specification"; // printReq $TLS_htmltext['printReqSpec'] = "

    Purpose:

    You can generate document with the requirements within a requirement specification, or all the requirements in a test project.

    Get Started:

    1. -

      Select the parts of the requirements you want to display, and then click on a +

      Select the parts of the requirements you want to display, and then click on a requirement specification, or the test project. A printable page will be displayed.

    2. -
    3. Use the \"Show As\" drop-box in the navigation pane to specify whether you want -the information displayed as HTML, or in a Pseudo Micosoft Word document. +

    4. Use the \"Show As\" drop-box in the navigation pane to specify whether you want +the information displayed as HTML, or in a Pseudo Micosoft Word document. See help for more information.

    5. Use your browser's print functionality to actually print the information.
      Note: Make sure to only print the right-hand frame.

    6. -
    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['keywordsAssign'] = "指派关键字"; //已校对 -$TLS_htmltext['keywordsAssign'] = "

    目的:

    +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['keywordsAssign'] = "指派关键字"; // 已校对 +$TLS_htmltext['keywordsAssign'] = "

    目的:

    在该功能中用户å¯ä»¥æ‰¹é‡åœ°æŠŠå…³é”®å­—设置到现有的测试用例和测试套件中

    @@ -251,18 +213,17 @@

    å½“ä¸”ä»…å½“æµ‹è¯•è®¡åˆ’ä¸­åŒ…å«æœ€æ–°ç‰ˆæœ¬çš„æµ‹è¯•用例时,你指派的关键字æ‰èƒ½å½±å“到你的测试用例上. 如果你的测试计划中包å«çš„æ˜¯æ—§ç‰ˆæœ¬çš„æµ‹è¯•用例,你设置的关键字将ä¸ä¼šè¢«çœ‹åˆ°ã€‚

    -

    TestLink会使用这ç§è¦æ±‚,以至于你对最新版本的测试用例指派的关键字对测试计划中的旧版本没什么影å“. +

    TestLink会使用这ç§è¦æ±‚,以至于你对最新版本的测试用例指派的关键字对测试计划中的旧版本没什么影å“. å¦‚æžœä½ å¸Œæœ›æµ‹è¯•è®¡åˆ’ä¸­çš„å…³é”®å­—åŠæ—¶æ›´æ–°ï¼Œé¦–先使用'更新修改的测试用例'æ¥éªŒè¯æ˜¯å¦æ˜¯æœ€æ–°ç‰ˆæœ¬ -在指派关键字之å‰.

    "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['executeTest'] = "测试用例执行"; //已校对 -$TLS_htmltext['executeTest'] = "

    目的:

    +在指派关键字之å‰.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['executeTest'] = "测试用例执行"; // 已校对 +$TLS_htmltext['executeTest'] = "

    目的:

    å…许用户执行测试用例.用户为了构建的需è¦å¯ä»¥æŠŠæµ‹è¯•结果和相关测试用例关è”èµ·æ¥. - 查看关于过滤器和设置的更多帮助 " . - "(点击?按钮).

    + 查看关于过滤器和设置的更多帮助 " . + "(点击?按钮).

    开始:

    @@ -273,12 +234,12 @@
  • 完善测试用例的结果和任何åˆé€‚的记录或问题报告.
  • ä¿å­˜ç»“æžœ.
  • -

    注æ„:如果你打算直接创建/跟踪问题,必须先é…ç½®TestLinkå…³è”到相关的bug跟踪工具.

    "; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['showMetrics'] = "测试报告和统计数æ®"; //已校对 -$TLS_htmltext['showMetrics'] = "

    关于测试计划的报告" . - "(在导航æ¡é‡Œå®šä¹‰äº†). 这个测试计划å¯èƒ½ä¸Žå½“剿‰§è¡Œçš„æµ‹è¯•计划ä¸åŒ. å¯ä»¥é€‰æ‹©çš„æ ¼å¼æœ‰:

    +

    注æ„:如果你打算直接创建/跟踪问题,必须先é…ç½®TestLinkå…³è”到相关的bug跟踪工具.

    "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['showMetrics'] = "测试报告和统计数æ®"; // 已校对 +$TLS_htmltext['showMetrics'] = "

    关于测试计划的报告" . + "(在导航æ¡é‡Œå®šä¹‰äº†). 这个测试计划å¯èƒ½ä¸Žå½“剿‰§è¡Œçš„æµ‹è¯•计划ä¸åŒ. å¯ä»¥é€‰æ‹©çš„æ ¼å¼æœ‰:

    • HTML - 报告显示为网页格å¼
    • MS Excel - 报告输出为 Microsoft Excel
    • @@ -353,12 +314,11 @@

      æ¯ä¸ªæµ‹è¯•用例报告的错误总数

      -

      该报表显示了æ¯ä¸ªæµ‹è¯•用例所å‘现的所有错误. 包括全部项目中的所有错误. è¯¥æŠ¥è¡¨åªæœ‰åœ¨å’Œé”™è¯¯è·Ÿè¸ªç³»ç»Ÿæ•´åˆäº†ä»¥åŽæ‰å¯è§.

      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planAddTC'] = "添加/删除测试用例到测试计划"; // testSetAdd //已校对 -$TLS_htmltext['planAddTC'] = "

      目的:

      +

      该报表显示了æ¯ä¸ªæµ‹è¯•用例所å‘现的所有错误. 包括全部项目中的所有错误. è¯¥æŠ¥è¡¨åªæœ‰åœ¨å’Œé”™è¯¯è·Ÿè¸ªç³»ç»Ÿæ•´åˆäº†ä»¥åŽæ‰å¯è§.

      "; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planAddTC'] = "添加/删除测试用例到测试计划"; // testSetAdd //已校对 +$TLS_htmltext['planAddTC'] = "

      目的:

      用户å¯ä»¥ä»Žæµ‹è¯•计划中添加或者删除测试用例(用户的级别至少为项目ç»ç†).

      添加ï¼åˆ é™¤æµ‹è¯•用例的步骤:

      @@ -366,11 +326,11 @@
    • ç‚¹å‡»æµ‹è¯•å¥—ä»¶æŸ¥çœ‹å®ƒçš„æ‰€æœ‰çš„å­æµ‹è¯•å¥—ä»¶ä»¥åŠæ‰€æœ‰çš„æµ‹è¯•用例.
    • 当你点击\"添加/删除测试用例\"æ¥æ·»åŠ æˆ–è€…åˆ é™¤æµ‹è¯•ç”¨ä¾‹æ—¶ 注æ„: ä¸å¯èƒ½å¤šæ¬¡æ·»åŠ ç›¸åŒçš„æµ‹è¯•用例.
    • -"; - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['tc_exec_assignment'] = "ç»™æµ‹è¯•å‘˜åˆ†é…æµ‹è¯•任务"; //已校对 -$TLS_htmltext['tc_exec_assignment'] = "

      目的

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['tc_exec_assignment'] = "ç»™æµ‹è¯•å‘˜åˆ†é…æµ‹è¯•任务"; // 已校对 +$TLS_htmltext['tc_exec_assignment'] = "

      目的

      管ç†è€…é€šè¿‡è¯¥é¡µé¢æ¥å¯¹æµ‹è¯•人员分é…具体测试任务.

      开始

      @@ -379,16 +339,14 @@
    • 选择该项目的测试员.
    • 点击'ä¿å­˜'按钮æäº¤.
    • 打开测试员的执行页é¢éªŒè¯å…³è”的情况.å¯ä»¥ä¸ºä½¿ç”¨è€…设置过滤器.
    • -"; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['planUpdateTC'] = "更新测试计划中的测试用例"; //已校对 -$TLS_htmltext['planUpdateTC'] = "

      目的

      +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['planUpdateTC'] = "更新测试计划中的测试用例"; // 已校对 +$TLS_htmltext['planUpdateTC'] = "

      目的

      如果需求规约版本改å˜äº†ï¼Œå¯ä»¥é€šè¿‡è¯¥é¡µé¢å¯¹æµ‹è¯•用例进行更新. - 在测试过程中ç»å¸¸å‘生添加新的需求的情况." . - " 例如:用户更改了测试规约,但是这个改å˜éœ€è¦ä¼ è¾¾åˆ°æµ‹è¯•计划中. " . - " å¦åˆ™æµ‹è¯•è®¡åˆ’ç»§ç»­ä½¿ç”¨ç€æ—§ç‰ˆæœ¬çš„需求规约,æµ‹è¯•ç»“æžœè¿˜åœ¨å…³è”æµ‹è¯•用例中的字段.

      + 在测试过程中ç»å¸¸å‘生添加新的需求的情况." . " 例如:用户更改了测试规约,但是这个改å˜éœ€è¦ä¼ è¾¾åˆ°æµ‹è¯•计划中. " . + " å¦åˆ™æµ‹è¯•è®¡åˆ’ç»§ç»­ä½¿ç”¨ç€æ—§ç‰ˆæœ¬çš„需求规约,æµ‹è¯•ç»“æžœè¿˜åœ¨å…³è”æµ‹è¯•用例中的字段.

      开始

        @@ -396,13 +354,12 @@
      1. 从å¤é€‰æ¡†ä¸­ä¸ºæŒ‡å®šçš„æµ‹è¯•用例选择新版本.
      2. 点击'更新测试计划'æ¥æäº¤æ”¹å˜.
      3. éªŒè¯æ–¹æ³•:查看执行页é¢ä¸­çš„æµ‹è¯•用例(集).
      4. -
      "; - - -// ------------------------------------------------------------------------------------------ -$TLS_htmltext_title['test_urgency'] = "设置测试的紧急程度"; -$TLS_htmltext['test_urgency'] = "

      目的

      -

      TestLinkå…许设置测试套件的紧急程度æ¥å½±å“测试用例执行的优先级. +"; + +// ------------------------------------------------------------------------------------------ +$TLS_htmltext_title['test_urgency'] = "设置测试的紧急程度"; +$TLS_htmltext['test_urgency'] = "

      目的

      +

      TestLinkå…许设置测试套件的紧急程度æ¥å½±å“测试用例执行的优先级. 测试的优先级å–决于测试用例的é‡è¦ç¨‹åº¦å’Œå®šä¹‰åœ¨æµ‹è¯•计划中的紧急程度两个方é¢. 项目领导者å¯ä»¥è®¾ç½®å“ªä¸€å¥—测试用例先被执行. 使用这个功能æ¥ç¡®ä¿åœ¨æ—¶é—´å…许的情 况下覆盖最é‡è¦çš„æµ‹è¯•用例.

      @@ -414,9 +371,8 @@ 执行的产å“的严é‡ç¨‹åº¦.
    • 点击'ä¿å­˜'æ¥æäº¤æ”¹å˜.
    • -

      例如:一个'高'紧急程度的测试套件中的'低'紧急程度的测试用例在执行时是'中'级别 " .""; - - -// ------------------------------------------------------------------------------------------ - +

      例如:一个'高'紧急程度的测试套件中的'低'紧急程度的测试用例在执行时是'中'级别 " . ""; + +// ------------------------------------------------------------------------------------------ + ?> diff --git a/login.php b/login.php index ff1b6dadbc..ac57efdce5 100644 --- a/login.php +++ b/login.php @@ -1,490 +1,569 @@ - we will redirect to login screen with some message -doBlockingChecks($db,$gui); - -switch($args->action) { - case 'doLogin': - case 'ajaxlogin': - doSessionStart(true); - - // When doing ajax login we need to skip control regarding session already open - // that we use when doing normal login. - // If we do not proceed this way we will enter an infinite loop - $options = new stdClass(); - $options->doSessionExistsCheck = ($args->action =='doLogin'); - $op = doAuthorize($db,$args->login,$args->pwd,$options); - $doAuthPostProcess = true; - $gui->draw = true; - break; - - case 'ajaxcheck': - processAjaxCheck($db); - break; - - - case 'oauth': - // If code is empty then break - if (!isset($args->oauth_code)){ - renderLoginScreen($gui); - die(); - } - - // Switch between oauth providers - // validate providers - $includeOK = false; - $oauth_params = getOAuthProviderCfg($args->oauth_name); - if ($oauth_params != null) { - $g2i = $args->oauth_name . '.php'; - if (!include_once($g2i)) { - die("Oauth client doesn't exist"); - } else { - $includeOK = true; - } - } - - // No good! - if ($includeOK == false) { - renderLoginScreen($gui); - die(); - } - - $user_token = oauth_get_token($oauth_params, $args->oauth_code); - if($user_token->status['status'] == tl::OK) { - doSessionStart(true); - $op = doAuthorize($db,$user_token->options->user,'oauth',$user_token->options); - $doAuthPostProcess = true; - } else { - $gui->note = $user_token->status['msg']; - $gui->draw=true; - renderLoginScreen($gui); - die(); - } - break; - - case 'loginform': - $doRenderLoginScreen = true; - $gui->draw = true; - $op = null; - - // unfortunatelly we use $args->note in order to do some logic. - if( ($args->note=trim($args->note)) == "" ) { - if( $gui->authCfg['SSO_enabled'] ) { - doSessionStart(true); - $doAuthPostProcess = true; - - switch ($gui->authCfg['SSO_method']) { - case 'CLIENT_CERTIFICATE': - $op = doSSOClientCertificate($db,$_SERVER,$gui->authCfg); - break; - - case 'WEBSERVER_VAR': - //DEBUGsyslogOnCloud('Trying to execute SSO using SAML'); - $op = doSSOWebServerVar($db,$gui->authCfg); - break; - } - } - } - break; + we will redirect to login screen with some message +doBlockingChecks($db, $gui); + +switch ($args->action) { + case 'doLogin': + case 'ajaxlogin': + doSessionStart(true); + + // When doing ajax login we need to skip control regarding session already open + // that we use when doing normal login. + // If we do not proceed this way we will enter an infinite loop + $options = new stdClass(); + $options->doSessionExistsCheck = ($args->action == 'doLogin'); + $op = doAuthorize($db, $args->login, $args->pwd, $options); + $doAuthPostProcess = true; + $gui->draw = true; + break; + + case 'ajaxcheck': + processAjaxCheck($db); + break; + + case 'oauth': + // If code is empty then break + if (! isset($args->oauth_code)) { + renderLoginScreen($gui); + die(); + } + + // Switch between oauth providers + // validate providers + $includeOK = false; + $oauth_params = getOAuthProviderCfg($args->oauth_name); + if ($oauth_params != null) { + $g2i = $args->oauth_name . '.php'; + if (! include_once $g2i) { + die("Oauth client doesn't exist"); + } else { + $includeOK = true; + } + } + + // No good! + if (! $includeOK) { + renderLoginScreen($gui); + die(); + } + + $user_token = oauth_get_token($oauth_params, $args->oauth_code); + if ($user_token->status['status'] == tl::OK) { + doSessionStart(true); + $op = doAuthorize($db, $user_token->options->user, 'oauth', + $user_token->options); + $doAuthPostProcess = true; + } else { + $gui->note = $user_token->status['msg']; + $gui->draw = true; + renderLoginScreen($gui); + die(); + } + break; + + case 'loginform': + $doRenderLoginScreen = true; + $gui->draw = true; + $op = null; + + // unfortunatelly we use $args->note in order to do some logic. + if ((($args->note = trim($args->note)) == "") && + ($gui->authCfg['SSO_enabled'])) { + doSessionStart(true); + $doAuthPostProcess = true; + + switch ($gui->authCfg['SSO_method']) { + case 'CLIENT_CERTIFICATE': + $op = doSSOClientCertificate($db, $_SERVER, $gui->authCfg); + break; + + case 'WEBSERVER_VAR': + $op = doSSOWebServerVar($db, $gui->authCfg); + break; + } + } + break; +} + +if ($doAuthPostProcess) { + list ($doRenderLoginScreen, $gui->note) = authorizePostProcessing($args, $op); +} + +if ($doRenderLoginScreen) { + renderLoginScreen($gui); +} + +/** + * Initialize arguments + * + * @return stdClass + */ +function initArgs() +{ + $pwdInputLen = config_get('loginPagePasswordMaxLenght'); + + // 2010904 - eloff - Why is req and reqURI parameters to the login? + $iParams = array( + "note" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "tl_login" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "tl_password" => array( + tlInputParameter::STRING_N, + 0, + $pwdInputLen + ), + "req" => array( + tlInputParameter::STRING_N, + 0, + 4000 + ), + "reqURI" => array( + tlInputParameter::STRING_N, + 0, + 4000 + ), + "action" => array( + tlInputParameter::STRING_N, + 0, + 10 + ), + "destination" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "loginform_token" => array( + tlInputParameter::STRING_N, + 0, + 255 + ), + "viewer" => array( + tlInputParameter::STRING_N, + 0, + 3 + ), + "oauth" => array( + tlInputParameter::STRING_N, + 0, + 100 + ), + "code" => array( + tlInputParameter::STRING_N, + 0, + 4000 + ), + "state" => array( + tlInputParameter::STRING_N, + 0, + 100 + ) + ); + $pParams = R_PARAMS($iParams); + + $args = new stdClass(); + $args->note = $pParams['note']; + $args->login = $pParams['tl_login']; + + $args->pwd = $pParams['tl_password']; + $args->ssodisable = getSSODisable(); + $args->reqURI = urlencode($pParams['req']); + $args->preqURI = urlencode($pParams['reqURI']); + $args->destination = urldecode($pParams['destination']); + $args->loginform_token = urldecode($pParams['loginform_token']); + + $args->viewer = ''; + + $k2c = array( + 'ajaxcheck' => 'do', + 'ajaxlogin' => 'do' + ); + if (isset($k2c[$pParams['action']])) { + $args->action = $pParams['action']; + } elseif (! is_null($args->login)) { + $args->action = 'doLogin'; + // This 'if' branch may be removed in later versions. Kept for compatibility + } elseif (! is_null($pParams['oauth']) && $pParams['oauth']) { + $args->action = 'oauth'; + $args->oauth_name = $pParams['oauth']; + $args->oauth_code = $pParams['code']; + } elseif (! is_null($pParams['state']) && ! is_null($pParams['code'])) { + + // We use state to undertand the provider when the redirect url + // can not have query string, as happens with Microsoft + // state will be 'testlink provider id'$$$state(random string) + // + // read https://auth0.com/docs/protocols/oauth2/oauth-state + // + $args->action = 'oauth'; + $args->oauth_name = explode('$$$', $pParams['state']); + $args->oauth_name = $args->oauth_name[0]; + $args->oauth_code = $pParams['code']; + } else { + $args->action = 'loginform'; + } + + // whitelist oauth_name + if (strcasecmp($args->action, 'oauth') == 0) { + validateOauth($args->oauth_name); + } + + return $args; +} + +/** + * Validate Oauth + */ +function validateOauth($name) +{ + $name = trim($name); + $oauthServers = config_get('OAuthServers'); + $whitelistOK = false; + foreach ($oauthServers as $serverCfg) { + if (strcasecmp($name, $serverCfg['oauth_name']) == 0) { + $whitelistOK = true; + break; + } + } + + if (! $whitelistOK) { + die("Invalid Oauth Service"); + } +} + +/** + * Initialize the interface + * + * @param database $db + * @param stdClass $args + * @return stdClass + */ +function initGui(&$db, $args) +{ + $gui = new stdClass(); + $gui->viewer = $args->viewer; + + $secCfg = config_get('config_check_warning_frequence'); + $gui->securityNotes = ''; + if ((strcmp($secCfg, 'ALWAYS') == 0) || + (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && + ! isset($_SESSION['getSecurityNotesDone']))) { + $_SESSION['getSecurityNotesDone'] = 1; + $gui->securityNotes = getSecurityNotes($db); + } + + $gui->authCfg = config_get('authentication'); + $gui->user_self_signup = config_get('user_self_signup'); + + // Oauth buttons + $oau = config_get('OAuthServers'); + $gui->oauth = array(); + foreach ($oau as $oauth_prov) { + if ($oauth_prov['oauth_enabled']) { + $name = $oauth_prov['oauth_name']; + $gui->oauth[$name] = new stdClass(); + $gui->oauth[$name]->name = ucfirst($name); + $gui->oauth[$name]->link = oauthLink($oauth_prov); + $gui->oauth[$name]->icon = $name . '.png'; + } + } + + if (isset($gui->authCfg['sso_only']) && $gui->authCfg['sso_only']) { + $gui->external_password_mgmt = true; + } else { + $gui->external_password_mgmt = false; + $domain = $gui->authCfg['domain']; + $mm = $gui->authCfg['method']; + if (isset($domain[$mm])) { + $ac = $domain[$mm]; + $gui->external_password_mgmt = ! $ac['allowPasswordManagement']; + } + } + + $gui->login_disabled = (('LDAP' == $gui->authCfg['method']) && + ! checkForLDAPExtension()) ? 1 : 0; + + switch ($args->note) { + case 'expired': + if (! isset($_SESSION)) { + session_start(); + } + session_unset(); + session_destroy(); + $gui->note = lang_get('session_expired'); + $gui->reqURI = null; + break; + + case 'first': + $gui->note = lang_get('your_first_login'); + $gui->reqURI = null; + break; + + case 'lost': + $gui->note = lang_get('passwd_lost'); + $gui->reqURI = null; + break; + + default: + $gui->note = ''; + break; + } + + $gui->ssodisable = 0; + if (property_exists($args, 'ssodisable')) { + $gui->ssodisable = $args->ssodisable; + } + + $gui->reqURI = $args->reqURI ? $args->reqURI : $args->preqURI; + $gui->destination = $args->destination; + $gui->pwdInputMaxLenght = config_get('loginPagePasswordMaxLenght'); + + // Random Background + $imgSet = array(); + $imgSet[] = "wp-testing04.jpg"; + $imgSet[] = "Fedora-24-Default-Wallpaper-1.png"; + $imgSet[] = "fedora-76343.jpg"; + $imgSet[] = "fedora-hex_0.002.png"; + $imgSet[] = "fedora-x.jpeg"; + $imgSet[] = "fedora21.png-1024x640.jpg"; + $imgSet[] = "fedora28.png"; + + $itemQty = count($imgSet) - 1; + $ixx = rand(0, $itemQty); + + $gui->loginBackgroundImg = "gui/templates/dashio/img/login/" . $imgSet[$ixx]; + + return $gui; +} + +/** + * doBlockingChecks + * + * wrong Schema version will BLOCK ANY login action + * + * @param + * database &$dbHandler DataBase Handler + * @param + * stdClass &$guiObj some gui elements that will be used to give feedback + */ +function doBlockingChecks(&$dbHandler, &$guiObj) +{ + $op = checkSchemaVersion($dbHandler); + if ($op['status'] < tl::OK) { + // Houston we have a problem + // This check to kill session was added to avoid following situation + // TestLink 1.9.5 installed + // Install TestLink 1.9.6 in another folder, pointing to same OLD DB + // you logged in TL 1.9.5 => session is created + // you try to login to 1.9.6, you get the Update DB Schema message but + // anyway because a LIVE AND VALID session you are allowed to login => BAD + if (isset($op['kill_session']) && $op['kill_session']) { + session_unset(); + session_destroy(); + } + + $guiObj->draw = false; + $guiObj->note = $op['msg']; + renderLoginScreen($guiObj); + die(); + } +} + +/** + * Render login screen + * + * simple piece of code used to clean up code layout + * + * @global tlLogger $g_tlLogger + * @param stdClass $guiObj + */ +function renderLoginScreen($guiObj) +{ + global $g_tlLogger; + + $logPeriodToDelete = config_get('removeEventsOlderThan'); + $g_tlLogger->deleteEventsFor(null, + strtotime("-{$logPeriodToDelete} days UTC")); + + $smarty = new TLSmarty(); + $smarty->assign('gui', $guiObj); + + $templ = config_get('tpl'); + $tpl = $templ['login']; + + $smarty->display($tpl); +} + +/** + * authorizePostProcessing + * + * @param stdClass $argsObj + * @param array $op + * @return array + */ +function authorizePostProcessing($argsObj, $op) +{ + $note = null; + $renderLoginScreen = false; + if ($op['status'] == tl::OK) { + // Login successful, redirect to destination + logAuditEvent( + TLS("audit_login_succeeded", $argsObj->login, + $_SERVER['REMOTE_ADDR']), "LOGIN", + $_SESSION['currentUser']->dbID, "users"); + + if ($argsObj->action == 'ajaxlogin') { + echo json_encode(array( + 'success' => true + )); + } else { + // If destination param is set redirect to given page ... + if (! empty($argsObj->destination)) { + + // 1) remove host.port from TL_BASE_HREF -> base_folder + // https://hsgdshdjs:80/bsbsbb + // http://fjljfld:8080/Hhhhs + // http://hjhsjdhshdk/ + // $baseURL = str_replace('://',':',TL_BASE_HREF); + $basePieces = explode(':', TL_BASE_HREF); + $howManyPieces = count($basePieces); + switch ($howManyPieces) { + case 2: + case 3: + break; + default: + echo 'Security Check Failure'; + die(); + break; + } + + // http: hjhsjdhshdk/ + // http: hjhsjdhshdk/base_folder + // https: hsgdshdjs: >> 80/bsbsbb + // http: fjljfld: >> 8080/Hhhhs + $dummy = explode('/', $basePieces[$howManyPieces - 1]); + $baseFolder = '/'; + $compo = trim($dummy[1]); + if ($compo != '') { + $baseFolder .= $compo . '/'; + } + + // 2) check base_folder/linkto.php + $where = strpos($argsObj->destination, + $baseFolder . 'linkto.php'); + $checkOK = ($where !== false) && ($where == 0); + if (! $checkOK) { + echo 'Security Check Failure'; + die(); + } + + // 3) validate content after linkto.php? + $dummy = explode($baseFolder . 'linkto.php?'); + $afterLinkTo = $baseFolder . 'linkto.php?' . + cleanInput($dummy[1]); + redirect($afterLinkTo); + } else { + // ... or show main page + $_SESSION['viewer'] = $argsObj->viewer; + $ad = $argsObj->ssodisable ? '&ssodisable=1' : ''; + $ad .= ($argsObj->preqURI ? "&reqURI=" . + urlencode($argsObj->preqURI) : ""); + + $rul = $_SESSION['basehref'] . + "index.php?caller=login&viewer={$argsObj->viewer}" . $ad; + + redirect($rul); + } + exit(); // hmm seems is useless + } + } else { + $note = ''; + if (! $argsObj->ssodisable) { + $note = is_null($op['msg']) ? lang_get('bad_user_passwd') : $op['msg']; + } + + if ($argsObj->action == 'ajaxlogin') { + echo json_encode(array( + 'success' => false, + 'reason' => $note + )); + } else { + $renderLoginScreen = true; + } + } + + return array( + $renderLoginScreen, + $note + ); +} + +/** + * Perform Ajax check + * + * @param database $dbHandler + */ +function processAjaxCheck(&$dbHandler) +{ + // Send a json reply, include localized strings for use in js to display a login form. + doSessionStart(true); + echo json_encode( + array( + 'validSession' => checkSessionValid($dbHandler, false), + 'username_label' => lang_get('login_name'), + 'password_label' => lang_get('password'), + 'login_label' => lang_get('btn_login'), + 'timeout_info' => lang_get('timeout_info') + )); +} + +/** + * Clean input + * + * @param string $input + * @return string|array|NULL + * @see https://css-tricks.com/snippets/php/sanitize-database-inputs/ + */ +function cleanInput($input) +{ + $search = array( + '@]*?>.*?@si', // Strip out javascript + '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags + '@]*?>.*?@siU', // Strip style tags properly + '@@' // Strip multi-line comments + ); + + return preg_replace($search, '', $input); } - -if( $doAuthPostProcess ) { - list($doRenderLoginScreen,$gui->note) = authorizePostProcessing($args,$op); -} - -if( $doRenderLoginScreen ) { - renderLoginScreen($gui); -} - -/** - * - * - */ -function init_args() { - $pwdInputLen = config_get('loginPagePasswordMaxLenght'); - - // 2010904 - eloff - Why is req and reqURI parameters to the login? - $iParams = array("note" => array(tlInputParameter::STRING_N,0,255), - "tl_login" => array(tlInputParameter::STRING_N,0,100), - "tl_password" => array(tlInputParameter::STRING_N,0,$pwdInputLen), - "req" => array(tlInputParameter::STRING_N,0,4000), - "reqURI" => array(tlInputParameter::STRING_N,0,4000), - "action" => array(tlInputParameter::STRING_N,0, 10), - "destination" => array(tlInputParameter::STRING_N, 0, 255), - "loginform_token" => array(tlInputParameter::STRING_N, 0, 255), - "viewer" => array(tlInputParameter::STRING_N, 0, 3), - "oauth" => array(tlInputParameter::STRING_N,0,100), - "code" => array(tlInputParameter::STRING_N,0,4000), - "state" => array(tlInputParameter::STRING_N,0,100), - ); - $pParams = R_PARAMS($iParams); - - $args = new stdClass(); - $args->note = $pParams['note']; - $args->login = $pParams['tl_login']; - - $args->pwd = $pParams['tl_password']; - $args->ssodisable = getSSODisable(); - $args->reqURI = urlencode($pParams['req']); - $args->preqURI = urlencode($pParams['reqURI']); - $args->destination = urldecode($pParams['destination']); - $args->loginform_token = urldecode($pParams['loginform_token']); - - // $args->viewer = $pParams['viewer']; - $args->viewer = ''; - - $k2c = array('ajaxcheck' => 'do','ajaxlogin' => 'do'); - if (isset($k2c[$pParams['action']])) { - $args->action = $pParams['action']; - } else if (!is_null($args->login)) { - $args->action = 'doLogin'; - // This 'if' branch may be removed in later versions. Kept for compatibility - } else if (!is_null($pParams['oauth']) && $pParams['oauth']) { - $args->action = 'oauth'; - $args->oauth_name = $pParams['oauth']; - $args->oauth_code = $pParams['code']; - } else if (!is_null($pParams['state']) && !is_null($pParams['code'])) { - - // We use state to undertand the provider when the redirect url - // can not have query string, as happens with Microsoft - // state will be 'testlink provider id'$$$state(random string) - // - // read https://auth0.com/docs/protocols/oauth2/oauth-state - // - $args->action = 'oauth'; - $args->oauth_name = explode('$$$',$pParams['state']); - $args->oauth_name = $args->oauth_name[0]; - $args->oauth_code = $pParams['code']; - } else { - $args->action = 'loginform'; - } - - // whitelist oauth_name - if (strcasecmp($args->action,'oauth') == 0) { - validateOauth($args->oauth_name); - } - - return $args; -} - -/** - * - */ -function validateOauth($name) { - $name = trim($name); - $oauthServers = config_get('OAuthServers'); - $whitelistOK = false; - foreach ($oauthServers as $serverCfg) { - if (strcasecmp($name, $serverCfg['oauth_name']) == 0) { - $whitelistOK = true; - break; - } - } - - if ($whitelistOK == false) { - die("Invalid Oauth Service"); - } -} - -/** - * - * - */ -function init_gui(&$db,$args) { - $gui = new stdClass(); - $gui->viewer = $args->viewer; - - $secCfg = config_get('config_check_warning_frequence'); - $gui->securityNotes = ''; - if( (strcmp($secCfg, 'ALWAYS') == 0) || - (strcmp($secCfg, 'ONCE_FOR_SESSION') == 0 && !isset($_SESSION['getSecurityNotesDone'])) ) { - $_SESSION['getSecurityNotesDone'] = 1; - $gui->securityNotes = getSecurityNotes($db); - } - - $gui->authCfg = config_get('authentication'); - $gui->user_self_signup = config_get('user_self_signup'); - - // Oauth buttons - $oau = config_get('OAuthServers'); - $gui->oauth = array(); - foreach ($oau as $oauth_prov) { - if ($oauth_prov['oauth_enabled']) { - $name = $oauth_prov['oauth_name']; - $gui->oauth[$name] = new stdClass(); - $gui->oauth[$name]->name = ucfirst($name); - $gui->oauth[$name]->link = oauth_link($oauth_prov); - $gui->oauth[$name]->icon = $name . '.png'; - } - } - - if (isset($gui->authCfg['sso_only']) && $gui->authCfg['sso_only']) { - $gui->external_password_mgmt = true; - } else { - $gui->external_password_mgmt = false; - $domain = $gui->authCfg['domain']; - $mm = $gui->authCfg['method']; - if( isset($domain[$mm]) ) { - $ac = $domain[$mm]; - $gui->external_password_mgmt = !$ac['allowPasswordManagement']; - } - } - - $gui->login_disabled = (('LDAP' == $gui->authCfg['method']) && !checkForLDAPExtension()) ? 1 : 0; - - switch($args->note) { - case 'expired': - if(!isset($_SESSION)) { - session_start(); - } - session_unset(); - session_destroy(); - $gui->note = lang_get('session_expired'); - $gui->reqURI = null; - break; - - case 'first': - $gui->note = lang_get('your_first_login'); - $gui->reqURI = null; - break; - - case 'lost': - $gui->note = lang_get('passwd_lost'); - $gui->reqURI = null; - break; - - default: - $gui->note = ''; - break; - } - - $gui->ssodisable = 0; - if(property_exists($args,'ssodisable')) { - $gui->ssodisable = $args->ssodisable; - } - - $gui->reqURI = $args->reqURI ? $args->reqURI : $args->preqURI; - $gui->destination = $args->destination; - $gui->pwdInputMaxLenght = config_get('loginPagePasswordMaxLenght'); - - - // Random Background - $imgSet = array(); - $imgSet[] = "wp-testing04.jpg"; - $imgSet[] = "Fedora-24-Default-Wallpaper-1.png"; - $imgSet[] = "fedora-76343.jpg"; - $imgSet[] = "fedora-hex_0.002.png"; - $imgSet[] = "fedora-x.jpeg"; - $imgSet[] = "fedora21.png-1024x640.jpg"; - $imgSet[] = "fedora28.png"; - - $itemQty = count($imgSet)-1; - $ixx = rand(0,$itemQty); - - $gui->loginBackgroundImg = - "gui/templates/dashio/img/login/" . $imgSet[$ixx]; - - return $gui; -} - - -/** - * doBlockingChecks - * - * wrong Schema version will BLOCK ANY login action - * - * @param &$dbHandler DataBase Handler - * @param &$guiObj some gui elements that will be used to give feedback - * - */ -function doBlockingChecks(&$dbHandler,&$guiObj) { - $op = checkSchemaVersion($dbHandler); - if( $op['status'] < tl::OK ) { - // Houston we have a problem - // This check to kill session was added to avoid following situation - // TestLink 1.9.5 installed - // Install TestLink 1.9.6 in another folder, pointing to same OLD DB - // you logged in TL 1.9.5 => session is created - // you try to login to 1.9.6, you get the Update DB Schema message but - // anyway because a LIVE AND VALID session you are allowed to login => BAD - if(isset($op['kill_session']) && $op['kill_session']) { - session_unset(); - session_destroy(); - } - - $guiObj->draw = false; - $guiObj->note = $op['msg']; - renderLoginScreen($guiObj); - die(); - } -} - - -/** - * renderLoginScreen - * simple piece of code used to clean up code layout - * - * @global $g_tlLogger - * @param stdClassObject $guiObj - */ -function renderLoginScreen($guiObj) { - global $g_tlLogger; - $templateCfg = templateConfiguration(); - $logPeriodToDelete = config_get('removeEventsOlderThan'); - $g_tlLogger->deleteEventsFor(null, strtotime("-{$logPeriodToDelete} days UTC")); - - $smarty = new TLSmarty(); - $smarty->assign('gui', $guiObj); - - $templ = config_get('tpl'); - $tpl = $templ['login']; - - $smarty->display($tpl); -} - - -/** - * - * @param stdClassObject $argsObj - * @param hash $op - */ -function authorizePostProcessing($argsObj,$op) { - $note = null; - $renderLoginScreen = false; - if($op['status'] == tl::OK) { - // Login successful, redirect to destination - logAuditEvent(TLS("audit_login_succeeded",$argsObj->login, - $_SERVER['REMOTE_ADDR']),"LOGIN",$_SESSION['currentUser']->dbID,"users"); - - if ($argsObj->action == 'ajaxlogin') { - echo json_encode(array('success' => true)); - } else { - // If destination param is set redirect to given page ... - if ( !empty($argsObj->destination) ) { - - // 1) remove host.port from TL_BASE_HREF -> base_folder - // https://hsgdshdjs:80/bsbsbb - // http://fjljfld:8080/Hhhhs - // http://hjhsjdhshdk/ - $baseURL = str_replace('://',':',TL_BASE_HREF); - $basePieces = explode(':',TL_BASE_HREF); - $howManyPieces = count($basePieces); - switch ($howManyPieces) { - case 2: - case 3: - break; - default: - echo 'Security Check Failure'; - die(); - break; - } - - // http: hjhsjdhshdk/ - // http: hjhsjdhshdk/base_folder - // https: hsgdshdjs: >> 80/bsbsbb - // http: fjljfld: >> 8080/Hhhhs - $dummy = explode('/',$basePieces[$howManyPieces-1]); - $baseFolder = '/'; - $compo = trim($dummy[1]); - if ($compo != '') { - $baseFolder .= $compo . '/'; - } - - // 2) check base_folder/linkto.php - $where = strpos($argsObj->destination, $baseFolder . 'linkto.php'); - $checkOK = ($where !== false) && ($where == 0); - if ($checkOK == false) { - echo 'Security Check Failure'; - die(); - } - - // 3) validate content after linkto.php? - $dummy = explode($baseFolder . 'linkto.php?'); - $afterLinkTo = $baseFolder . 'linkto.php?' . cleanInput($dummy[1]); - redirect($afterLinkTo); - } else { - // ... or show main page - $_SESSION['viewer'] = $argsObj->viewer; - $ad = $argsObj->ssodisable ? '&ssodisable=1' : ''; - $ad .= ($argsObj->preqURI ? "&reqURI=".urlencode($argsObj->preqURI) :""); - - $rul = $_SESSION['basehref'] . - "index.php?caller=login&viewer={$argsObj->viewer}" . $ad; - - redirect($rul); - } - exit(); // hmm seems is useless - } - } else { - $note = ''; - if(!$argsObj->ssodisable) { - $note = is_null($op['msg']) ? lang_get('bad_user_passwd') : $op['msg']; - } - - if($argsObj->action == 'ajaxlogin') { - echo json_encode(array('success' => false,'reason' => $note)); - } else { - $renderLoginScreen = true; - } - } - - return array($renderLoginScreen,$note); -} - -/** - * - * - */ -function processAjaxCheck(&$dbHandler) { - // Send a json reply, include localized strings for use in js to display a login form. - doSessionStart(true); - echo json_encode(array('validSession' => checkSessionValid($dbHandler, false), - 'username_label' => lang_get('login_name'), - 'password_label' => lang_get('password'), - 'login_label' => lang_get('btn_login'), - 'timeout_info' => lang_get('timeout_info'))); - -} - - -// from https://css-tricks.com/snippets/php/sanitize-database-inputs/ -function cleanInput($input) { - - $search = array( - '@]*?>.*?@si', // Strip out javascript - '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags - '@]*?>.*?@siU', // Strip style tags properly - '@@' // Strip multi-line comments - ); - - $output = preg_replace($search, '', $input); - return $output; -} \ No newline at end of file diff --git a/logout.php b/logout.php index 93bcd14302..603b64f997 100644 --- a/logout.php +++ b/logout.php @@ -1,49 +1,52 @@ -userID) { - logAuditEvent(TLS("audit_user_logout",$args->userName),"LOGOUT",$args->userID,"users"); -} -session_unset(); -session_destroy(); - -$authCfg = config_get('authentication'); -if(isset($authCfg['SSO_enabled']) && $authCfg['SSO_enabled'] - && $args->ssodisable == FALSE) { - redirect($authCfg['SSO_logout_destination']); -} else { - $std = "login.php?note=logout&viewer={$args->viewer}"; - $std .= $args->ssodisable ? "&ssodisable" : ''; - - $xx = config_get('logoutUrl'); - $lo = is_null($xx) || trim($xx) == '' ? $std : $xx; - redirect($lo); -} -exit(); - - -/** - * - */ -function init_args() { - $args = new stdClass(); - - $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : null; - $args->userName = $args->userID ? $_SESSION['currentUser']->getDisplayName() : ""; - - $args->viewer = isset($_GET['viewer']) ? $_GET['viewer'] : ''; - $args->ssodisable = getSSODisable(); - - return $args; -} \ No newline at end of file +userID) { + logAuditEvent(TLS("audit_user_logout", $args->userName), "LOGOUT", + $args->userID, "users"); +} +session_unset(); +session_destroy(); + +$authCfg = config_get('authentication'); +if (isset($authCfg['SSO_enabled']) && $authCfg['SSO_enabled'] && + ! $args->ssodisable) { + redirect($authCfg['SSO_logout_destination']); +} else { + $std = "login.php?note=logout&viewer={$args->viewer}"; + $std .= $args->ssodisable ? "&ssodisable" : ''; + + $xx = config_get('logoutUrl'); + $lo = is_null($xx) || trim($xx) == '' ? $std : $xx; + redirect($lo); +} +exit(); + +/** + * Initializes the arguments + * + * @return stdClass + */ +function init_args() +{ + $args = new stdClass(); + + $args->userID = isset($_SESSION['userID']) ? $_SESSION['userID'] : null; + $args->userName = $args->userID ? $_SESSION['currentUser']->getDisplayName() : ""; + + $args->viewer = isset($_GET['viewer']) ? $_GET['viewer'] : ''; + $args->ssodisable = getSSODisable(); + + return $args; +} diff --git a/lostPassword.php b/lostPassword.php index 09117ab142..cb1febfda2 100644 --- a/lostPassword.php +++ b/lostPassword.php @@ -1,80 +1,97 @@ -external_password_mgmt = 0; -$gui->page_title = lang_get('page_title_lost_passwd'); -$gui->note = lang_get('your_info_for_passwd'); -$gui->password_mgmt_feedback = ''; -$gui->login = $args->login; -$gui->viewer = $args->viewer; - -$op = doDBConnect($db,database::ONERROREXIT); - -$userID = false; -if ($args->login != "") { - $userID = tlUser::doesUserExist($db,$args->login); - if (!$userID) { - $gui->note = lang_get('bad_user'); - } else { - // need to know if auth method for user allows reset - $user = new tlUser(intval($userID)); - $user->readFromDB($db); - if(tlUser::isPasswordMgtExternal($user->authentication,$user->authentication)) { - $gui->external_password_mgmt = 1; - $gui->password_mgmt_feedback = sprintf(lang_get('password_mgmt_feedback'),trim($args->login)); - } - } -} - -if(!$gui->external_password_mgmt && $userID) { - $result = resetPassword($db,$userID); - $gui->note = $result['msg']; - if ($result['status'] >= tl::OK) { - $user = new tlUser($userID); - if ($user->readFromDB($db) >= tl::OK) { - logAuditEvent(TLS("audit_pwd_reset_requested",$user->login),"PWD_RESET",$userID,"users"); - } - redirect(TL_BASE_HREF ."login.php?note=lost&viewer={$args->viewer}"); - exit(); - } else if ($result['status'] == tlUser::E_EMAILLENGTH) { - $gui->note = lang_get('mail_empty_address'); - } else if ($note != "") { - $gui->note = getUserErrorMessage($result['status']); - } -} - -$smarty = new TLSmarty(); -$smarty->assign('gui',$gui); - -$tpl = str_replace('.php','.tpl',basename($_SERVER['SCRIPT_NAME'])); -if( $args->viewer == 'new' ) { - $tpl = 'lostPassword-model-marcobiedermann.tpl'; -} -$tpl = 'login/' . $tpl; -$smarty->display($tpl); - -/** - * - */ -function init_args() -{ - $iParams = array("login" => array('POST',tlInputParameter::STRING_N,0,30), - "viewer" => array('GET',tlInputParameter::STRING_N, 0, 3)); - - $args = new stdClass(); - I_PARAMS($iParams,$args); - return $args; -} -?> \ No newline at end of file +external_password_mgmt = 0; +$gui->page_title = lang_get('page_title_lost_passwd'); +$gui->note = lang_get('your_info_for_passwd'); +$gui->password_mgmt_feedback = ''; +$gui->login = $args->login; +$gui->viewer = $args->viewer; + +$op = doDBConnect($db, database::ONERROREXIT); + +$userID = false; +if ($args->login != "") { + $userID = tlUser::doesUserExist($db, $args->login); + if (! $userID) { + $gui->note = lang_get('bad_user'); + } else { + // need to know if auth method for user allows reset + $user = new tlUser(intval($userID)); + $user->readFromDB($db); + if (tlUser::isPasswordMgtExternal($user->authentication, + $user->authentication)) { + $gui->external_password_mgmt = 1; + $gui->password_mgmt_feedback = sprintf( + lang_get('password_mgmt_feedback'), trim($args->login)); + } + } +} + +if (! $gui->external_password_mgmt && $userID) { + $result = resetPassword($db, $userID); + $gui->note = $result['msg']; + if ($result['status'] >= tl::OK) { + $user = new tlUser($userID); + if ($user->readFromDB($db) >= tl::OK) { + logAuditEvent(TLS("audit_pwd_reset_requested", $user->login), + "PWD_RESET", $userID, "users"); + } + redirect(TL_BASE_HREF . "login.php?note=lost&viewer={$args->viewer}"); + exit(); + } elseif ($result['status'] == tlUser::E_EMAILLENGTH) { + $gui->note = lang_get('mail_empty_address'); + } elseif ($note != "") { + $gui->note = getUserErrorMessage($result['status']); + } +} + +$smarty = new TLSmarty(); +$smarty->assign('gui', $gui); + +$tpl = str_replace('.php', '.tpl', basename($_SERVER['SCRIPT_NAME'])); +if ($args->viewer == 'new') { + $tpl = 'lostPassword-model-marcobiedermann.tpl'; +} +$tpl = 'login/' . $tpl; +$smarty->display($tpl); + +/** + * Initializes the arguments + * + * @return stdClass + */ +function init_args() +{ + $iParams = array( + "login" => array( + 'POST', + tlInputParameter::STRING_N, + 0, + 30 + ), + "viewer" => array( + 'GET', + tlInputParameter::STRING_N, + 0, + 3 + ) + ); + + $args = new stdClass(); + I_PARAMS($iParams, $args); + return $args; +} +?> diff --git a/ltcp.php b/ltcp.php index d9fdcdc1dd..abfacc4191 100644 --- a/ltcp.php +++ b/ltcp.php @@ -1,140 +1,155 @@ - array(tlInputParameter::STRING_N,$userAPIkeyLen,$userAPIkeyLen), - "testcase" => array(tlInputParameter::STRING_N,0,64) - ]; - } catch (Exception $e) { - echo $e->getMessage(); - exit(); - } - - R_PARAMS($iParams,$args); - $opt = array('setPaths' => true,'clearSession' => true); - - // validate apikey to avoid SQL injection - $args->apikey = trim($args->apikey); - $akl = strlen($args->apikey); - switch($akl) { - case $userAPIkeyLen: - $args->debug = 'USER-APIKEY'; - setUpEnvForRemoteAccess($dbHandler,$args->apikey,null,$opt); - - // returns array element are arrays NOT USER OBJECT!!! - $userSearch = tlUser::getByAPIKey($dbHandler,$args->apikey); - $args->light = 'red'; - if (count($userSearch) == 1) { - $args->light = 'green'; - $userData = current($userSearch); - $user = new tlUser($userData['id']); - $user->readFromDB($dbHandler); - } - break; - - default: - throw new Exception("Aborting - Bad API Key lenght", 1); - break; - } - - $commonText = " - The call signature does not pass the system Checks - operation can not be fullfilled"; - if ($args->light == 'red') { - echo "LTCP-01" . $commonText; - die(); - } - - - // c94048220527a3d038db5c19e1156c08 - - // need to extract testcase information - // PREFIX-NUMBER-VERSION - // example: PPT-8989-2 - // - // Frome prefix we will get testproject info - // in order to check user rights - // - // Trying to mitigate SQL injection I will get prefix of - // all test projects then check array - $tbl = DB_TABLE_PREFIX . 'testprojects'; - $sql = "SELECT prefix,id FROM $tbl "; - $rs = $dbHandler->fetchRowsIntoMap($sql,'prefix'); - $testCasePieces = explode('-',$args->testcase); - - if (count($testCasePieces) != 3) { - echo "LTCP-02" . $commonText; - die(); - } - - $prjPrefix = trim($testCasePieces[0]); - if (!isset($rs[$prjPrefix])) { - echo "LTCP-03" . $commonText; - die(); - } - - $tproject_id = intval($rs[$prjPrefix]['id']); - - // Check rights on test project - $canRead = $user->hasRight($dbHandler,"mgt_view_tc",$tproject_id,null,("getAccess"=="getAccess")); - if ($canRead == false) { - echo "LTCP-04 - System Checks do not allow operation requested"; - die(); - } - - // ---------------------------------------------------------------------------------------------------- - // everything is OK, now need to launch - // https:///lib/testcases/tcPrint.php?show_mode=&testcase_id=72510&tcversion_id=72511 - // - $externalID = $testCasePieces[0] . '-' . $testCasePieces[1]; - $tcaseMgr = new testcase($dbHandler); - $testcase_id = $tcaseMgr->getInternalID($externalID); - $allTCVID = $tcaseMgr->getAllVersionsID($testcase_id); - $idSet = implode(',', $allTCVID); - $tcaseVersionNumber = intval($testCasePieces[2]); - $tbl = DB_TABLE_PREFIX . 'tcversions'; - $sql = " SELECT version,id FROM $tbl - WHERE id IN ($idSet) - AND version = $tcaseVersionNumber"; - $rs = (array)$dbHandler->fetchRowsIntoMap($sql,'version'); - if (count($rs) != 1) { - die(); - } - $tcversion_id = intval($rs[$tcaseVersionNumber]['id']); - - $url2call = "testcase_id=%TC%&tcversion_id=%TCV%"; - $url2call = str_replace(["%TC%","%TCV%"],[$testcase_id,$tcversion_id],$url2call); - // ---------------------------------------------------------------------------------------------------- - $what2launch = "/lib/testcases/tcPrint.php?$url2call"; - header('Location:' . TL_BASE_HREF . $what2launch); - exit(); -} \ No newline at end of file + array( + tlInputParameter::STRING_N, + $userAPIkeyLen, + $userAPIkeyLen + ), + "testcase" => array( + tlInputParameter::STRING_N, + 0, + 64 + ) + ]; + } catch (Exception $e) { + echo $e->getMessage(); + exit(); + } + + R_PARAMS($iParams, $args); + $opt = array( + 'setPaths' => true, + 'clearSession' => true + ); + + // validate apikey to avoid SQL injection + $args->apikey = trim($args->apikey); + $akl = strlen($args->apikey); + switch ($akl) { + case $userAPIkeyLen: + $args->debug = 'USER-APIKEY'; + setUpEnvForRemoteAccess($dbHandler, $args->apikey, null, $opt); + + // returns array element are arrays NOT USER OBJECT!!! + $userSearch = tlUser::getByAPIKey($dbHandler, $args->apikey); + $args->light = 'red'; + if (count($userSearch) == 1) { + $args->light = 'green'; + $userData = current($userSearch); + $user = new tlUser($userData['id']); + $user->readFromDB($dbHandler); + } + break; + + default: + throw new Exception("Aborting - Bad API Key lenght", 1); + break; + } + + $commonText = " - The call signature does not pass the system Checks - operation can not be fullfilled"; + if ($args->light == 'red') { + echo "LTCP-01" . $commonText; + die(); + } + + // c94048220527a3d038db5c19e1156c08 + + // need to extract testcase information + // PREFIX-NUMBER-VERSION + // example: PPT-8989-2 + // + // Frome prefix we will get testproject info + // in order to check user rights + // + // Trying to mitigate SQL injection I will get prefix of + // all test projects then check array + $tbl = DB_TABLE_PREFIX . 'testprojects'; + $sql = "SELECT prefix,id FROM $tbl "; + $rs = $dbHandler->fetchRowsIntoMap($sql, 'prefix'); + $testCasePieces = explode('-', $args->testcase); + + if (count($testCasePieces) != 3) { + echo "LTCP-02" . $commonText; + die(); + } + + $prjPrefix = trim($testCasePieces[0]); + if (! isset($rs[$prjPrefix])) { + echo "LTCP-03" . $commonText; + die(); + } + + $tproject_id = intval($rs[$prjPrefix]['id']); + + // Check rights on test project + $canRead = $user->hasRight($dbHandler, "mgt_view_tc", $tproject_id, null, + true); + if (! $canRead) { + echo "LTCP-04 - System Checks do not allow operation requested"; + die(); + } + + // everything is OK, now need to launch + // https:///lib/testcases/tcPrint.php?show_mode=&testcase_id=72510&tcversion_id=72511 + // + $externalID = $testCasePieces[0] . '-' . $testCasePieces[1]; + $tcaseMgr = new testcase($dbHandler); + $testcase_id = $tcaseMgr->getInternalID($externalID); + $allTCVID = $tcaseMgr->getAllVersionsID($testcase_id); + $idSet = implode(',', $allTCVID); + $tcaseVersionNumber = intval($testCasePieces[2]); + $tbl = DB_TABLE_PREFIX . 'tcversions'; + $sql = " SELECT version,id FROM $tbl + WHERE id IN ($idSet) + AND version = $tcaseVersionNumber"; + $rs = (array) $dbHandler->fetchRowsIntoMap($sql, 'version'); + if (count($rs) != 1) { + die(); + } + $tcversion_id = intval($rs[$tcaseVersionNumber]['id']); + + $url2call = "testcase_id=%TC%&tcversion_id=%TCV%"; + $url2call = str_replace([ + "%TC%", + "%TCV%" + ], [ + $testcase_id, + $tcversion_id + ], $url2call); + + $what2launch = "/lib/testcases/tcPrint.php?$url2call"; + header('Location:' . TL_BASE_HREF . $what2launch); + exit(); +} diff --git a/ltx.php b/ltx.php index 569141f0bf..9c9f1ec9dd 100644 --- a/ltx.php +++ b/ltx.php @@ -1,486 +1,426 @@ -tproject_id = 0; - - if( $args->status_ok ) - { - if($args->tplan_id != '') - { - $hasRight = checkTestPlan($db,$args->user,$args); - if( $hasRight ) - { - $lof = 'launch_outer_' . $args->item; - $lof($smarty,$args); - } - } - } - else - { - echo lang_get('security_check_ko'); - ob_end_flush(); - exit(); - } -} -else -{ - // - // inner frame, parameters passed - // figure out what to display - // - // key: item, value: url to tree management page - $driver = isset($_GET['item']) ? $_GET['item'] : null; - if(is_null($driver)) - { - die(); - } - - $lif = 'launch_inner_' . $driver; - $lif($db,$smarty); -} -ob_end_flush(); - - -/** - * - * - */ -function checkTestPlan(&$db,&$user,&$args) -{ - $hasRight = false; - $tplan_mgr = new testplan($db); - - $item_info = $tplan_mgr->get_by_id($args->tplan_id,array( 'output' => 'minimun')); - if(($op['status_ok'] = !is_null($item_info))) - { - $args->tproject_id = intval($item_info['tproject_id']); - - switch($args->item) - { - case 'exec': - case 'xta2m': - $hasRight = $user->hasRight($db,'testplan_execute', - $args->tproject_id,$args->tplan_id); - break; - - - default: - // need to fail!! - break; - } - } - return $hasRight; -} - - -/** - * - */ -function init_args(&$dbHandler) -{ - $args = new stdClass(); - $args->tplan_id = intval(isset($_GET['tplan_id']) ? $_GET['tplan_id'] : null); - $args->tcversion_id = intval(isset($_GET['tcversion_id']) ? $_GET['tcversion_id'] : null); - $args->platform_id = intval(isset($_GET['platform_id']) ? $_GET['platform_id'] : null); - $args->build_id = intval(isset($_GET['build_id']) ? $_GET['build_id'] : null); - - $args->anchor = isset($_GET['anchor']) ? $_GET['anchor'] : null; - $args->item = isset($_GET['item']) ? $_GET['item'] : null; - - $args->feature_id = isset($_GET['feature_id']) ? $_GET['feature_id'] : null; - - - $args->target_user_id = intval(isset($_GET['user_id']) ? $_GET['user_id'] : null); - $args->user = $_SESSION['currentUser']; - $args->user_id = $_SESSION['userID']; - - // status depends on access request - $cfn = 'check_'; - switch($args->item) - { - case 'exec': - $cfn .= $args->item; - $args->status_ok = ($args->build_id >0); - break; - - case 'xta2m': - $cfn .= $args->item; - $args->status_ok = ($args->target_user_id >0 && $args->tplan_id >0); - break; - - default: - $cfn = ''; - $args->status_ok = false; - break; - } - - if($args->status_ok && $cfn != '') - { - $cfn($dbHandler,$args); - } - return $args; -} - -/** - * - */ -function build_link_exec(&$argsObj) -{ - $lk = isset($_GET['item']) ? "item=" . $_GET['item'] : ''; - - if($argsObj->feature_id >0) - { - $lk .= "&feature_id=" . $argsObj->feature_id; - } - else - { - $lk .= "&tplan_id=" . $argsObj->tplan_id . "&platform_id=" . $argsObj->platform_id; - "&tcversion_id=" . $argsObj->tcversion_id; - } - $lk .= "&build_id=" . $argsObj->build_id; - $lk .= '&load' . (isset($_GET['anchor']) ? '&anchor=' . $_GET['anchor'] : ""); - - return $lk; -} - - - - -/** - * - * - */ -function process_exec(&$dbHandler,$context) -{ - $ret = array(); - $ret['url'] = null; - $ret['msg'] = 'ko'; - - $treeMgr = new tree($dbHandler); - $info = $treeMgr->get_node_hierarchy_info($context['tcversion_id']); - - $ret['url'] = "lib/execute/execSetResults.php?level=testcase" . - "&version_id=" . $context['tcversion_id'] . - "&id=" . $info['parent_id'] . - "&setting_testplan=" . $context['setting_testplan'] . - "&setting_build=" . $context['setting_build'] . - "&setting_platform=" . $context['setting_platform']; - - - - $ret['msg'] = 'ok'; - return $ret; -} - -/** - * xta2m: eXecution Tasks Assigned TO Me - * - */ -function process_xta2m(&$dbHandler,$context) -{ - $ret = array(); - $ret['url'] = null; - $ret['msg'] = 'ko'; - - $treeMgr = new tree($dbHandler); - $info = $treeMgr->get_node_hierarchy_info($context['tcversion_id']); - - $ret['url'] = "lib/execute/execSetResults.php?level=testcase" . - "&version_id=" . $context['tcversion_id'] . - "&id=" . $info['parent_id'] . - "&setting_testplan=" . $context['setting_testplan'] . - "&setting_build=" . $context['setting_build'] . - "&setting_platform=" . $context['setting_platform']; - - - - $ret['msg'] = 'ok'; - return $ret; -} - -/** - * - * - */ -function check_exec(&$dbHandler,&$argsObj) -{ - - if( $argsObj->feature_id >0 ) - { - // get missing data - $tb = DB_TABLE_PREFIX . 'testplan_tcversions'; - $sql = "SELECT testplan_id,platform_id,tcversion_id " . - "FROM {$tb} WHERE id=" . $argsObj->feature_id; - - $rs = $dbHandler->get_recordset($sql); - $argsObj->tplan_id = $rs[0]['testplan_id']; - $argsObj->tcversion_id = $rs[0]['tcversion_id']; - $argsObj->platform_id = $rs[0]['platform_id']; - } - else - { - $argsObj->status_ok = ($argsObj->tplan_id > 0) && - ($argsObj->tcversion_id >0); - } -} - -/** - * - * - */ -function check_xta2m(&$dbHandler,&$argsObj) -{ - $argsObj->status_ok = ($argsObj->target_user_id > 0 && - $argsObj->tplan_id >0); - - if($argsObj->target_user_id != $argsObj->user_id) - { - $argsObj->status_ok = false; - } -} - - -/** - * - * - */ -function launch_inner_exec(&$dbHandler,&$tplMgr) -{ - $itemCode = array('exec' => 'lib/execute/execNavigator.php'); - $op = array('status_ok' => true, 'msg' => ''); - - // First check for keys in _GET that MUST EXIST - // key: key on _GET, value: labelID defined on strings.txt - $mandatoryKeys = array('item' => 'item_not_set', - 'build_id' => 'build_id_not_set'); - - foreach($mandatoryKeys as $key => $labelID) - { - $op['status_ok'] = isset($_GET[$key]); - if( !$op['status_ok']) - { - $op['msg'] = lang_get($labelID); - break; - } - } - - if( $op['status_ok'] ) - { - $op['status_ok'] = isset($_GET['feature_id']); - if( !$op['status_ok'] ) - { - $keySet = array('tplan_id' => 'testplan_not_set', - 'tcversion_id' => 'tcversion_id', - 'platform_id' => 'platform_id_not_set'); - - foreach($keySet as $key => $labelID) - { - $op['status_ok'] = isset($_GET[$key]); - if( !$op['status_ok']) - { - $op['msg'] = lang_get($labelID); - break; - } - } - } - } - - $args = init_args($dbHandler); - if($op['status_ok']) - { - // Set Environment - $tplan_mgr = new testplan($dbHandler); - $info = $tplan_mgr->get_by_id($args->tplan_id,array('output' => 'minimun')); - - if(is_null($info)) - { - die('ltx - tplan info does not exist'); - } - - $tproject_mgr = new testproject($dbHandler); - $tproject_mgr->setSessionProject($info['tproject_id']); - $op['status_ok'] = true; - } - - if($op['status_ok']) - { - // Build name of function to call for doing the job. - $pfn = 'process_' . $args->item; - - $ctx = array(); - $ctx['setting_testplan'] = $args->tplan_id; - $ctx['setting_build'] = $args->build_id; - $ctx['setting_platform'] = $args->platform_id; - $ctx['tcversion_id'] = $args->tcversion_id; - $ctx['tcase_id'] = 0; - $ctx['user_id'] = $args->user_id; - - $jump_to = $pfn($dbHandler,$ctx); - $op['status_ok'] = !is_null($jump_to['url']); - $op['msg'] = $jump_to['msg']; - } - - if($op['status_ok']) - { - $treeframe = $itemCode[$args->item] . - '?loadExecDashboard=0' . - '&setting_testplan=' . $args->tplan_id . - '&setting_build=' . $args->build_id . - '&setting_platform=' . $args->platform_id; - - $tplMgr->assign('title', lang_get('main_page_title')); - $tplMgr->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); - $tplMgr->assign('workframe', $jump_to['url']); - $tplMgr->assign('treeframe', $treeframe); - $tplMgr->display('frmInner.tpl'); - } - else - { - echo $op['msg']; - ob_end_flush(); - exit(); - } -} // function end - -/** - * xta2m: eXecution Tasks Assigned TO Me - * - */ -function launch_inner_xta2m(&$dbHandler,&$tplMgr) -{ - $args = init_args($dbHandler); - - //if($args->status_ok == FALSE) - //{ - // echo 'NOOO'; - // ob_end_flush(); - // exit(); - //} - - $jt = $_SESSION['basehref'] . '/lib/testcases/' . - 'tcAssignedToUser.php?user_id=' . $args->target_user_id . - - $k2c = array('tplan_id','build_id'); - foreach($k2c as $tg) - { - if( property_exists($args,$tg) && $args->$tg > 0 ) - { - $jt .= "&$tg=" . $args->$tg; - } - } - - $tplMgr->assign('workframe', $jt); - $tplMgr->display('workframe.tpl'); -} - -/** - * - */ -function launch_outer_exec(&$tplMgr,$argsObj) -{ - $gui = new stdClass(); - $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; - $gui->navbar_height = config_get('navbar_height'); - - if( $argsObj->tproject_id > 0) - { - $gui->titleframe .= '&testproject=' . $argsObj->tproject_id; - } - $gui->title = lang_get('main_page_title'); - $gui->mainframe = 'ltx.php?' . build_link_exec($argsObj); - - $tplMgr->assign('gui', $gui); - $tplMgr->display('main.tpl'); -} - -/** - * - */ -function launch_outer_xta2m(&$tplMgr,$argsObj) -{ - $gui = new stdClass(); - $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; - $gui->navbar_height = config_get('navbar_height'); - - if( $argsObj->tproject_id > 0) - { - $gui->titleframe .= '&testproject=' . $argsObj->tproject_id; - } - $gui->title = lang_get('main_page_title'); - $gui->mainframe = 'ltx.php?item=xta2m&load=1' . - '&user_id=' . $argsObj->target_user_id . - '&tplan_id=' . $argsObj->tplan_id; - - $tplMgr->assign('gui', $gui); - $tplMgr->display('main.tpl'); -} - -/** - * - * - */ -function buildCookie(&$dbHandler,$itemID,$tprojectID,$cookiePrefix) -{ - $tree_mgr = new tree($dbHandler); - $path = $tree_mgr->get_path($itemID); - $parents = array(); - $parents[] = $tprojectID; - foreach($path as $node) - { - $parents[] = $node['id']; - } - array_pop($parents); - $cookieInfo['path'] = 'a:s%3A/' . implode("/", $parents); - $cookieInfo['value'] = $cookiePrefix . $tprojectID . '_ext-comp-1001' ; - return $cookieInfo; +tproject_id = 0; + + if ($args->status_ok) { + if ($args->tplan_id != '') { + $hasRight = checkTestPlan($db, $args->user, $args); + if ($hasRight) { + $lof = 'launch_outer_' . $args->item; + $lof($smarty, $args); + } + } + } else { + echo lang_get('security_check_ko'); + ob_end_flush(); + exit(); + } +} else { + // + // inner frame, parameters passed + // figure out what to display + // + // key: item, value: url to tree management page + $driver = isset($_GET['item']) ? $_GET['item'] : null; + if (is_null($driver)) { + die(); + } + + $lif = 'launch_inner_' . $driver; + $lif($db, $smarty); +} +ob_end_flush(); + +/** + */ +function checkTestPlan(&$db, &$user, &$args) +{ + $hasRight = false; + $tplan_mgr = new testplan($db); + + $item_info = $tplan_mgr->get_by_id($args->tplan_id, + array( + 'output' => 'minimun' + )); + if ($op['status_ok'] = ! is_null($item_info)) { + $args->tproject_id = intval($item_info['tproject_id']); + + switch ($args->item) { + case 'exec': + case 'xta2m': + $hasRight = $user->hasRight($db, 'testplan_execute', + $args->tproject_id, $args->tplan_id); + break; + + default: + // need to fail!! + break; + } + } + return $hasRight; +} + +/** + */ +function init_args(&$dbHandler) +{ + $args = new stdClass(); + $args->tplan_id = intval( + isset($_GET['tplan_id']) ? $_GET['tplan_id'] : null); + $args->tcversion_id = intval( + isset($_GET['tcversion_id']) ? $_GET['tcversion_id'] : null); + $args->platform_id = intval( + isset($_GET['platform_id']) ? $_GET['platform_id'] : null); + $args->build_id = intval( + isset($_GET['build_id']) ? $_GET['build_id'] : null); + + $args->anchor = isset($_GET['anchor']) ? $_GET['anchor'] : null; + $args->item = isset($_GET['item']) ? $_GET['item'] : null; + + $args->feature_id = isset($_GET['feature_id']) ? $_GET['feature_id'] : null; + + $args->target_user_id = intval( + isset($_GET['user_id']) ? $_GET['user_id'] : null); + $args->user = $_SESSION['currentUser']; + $args->user_id = $_SESSION['userID']; + + // status depends on access request + $cfn = 'check_'; + switch ($args->item) { + case 'exec': + $cfn .= $args->item; + $args->status_ok = ($args->build_id > 0); + break; + + case 'xta2m': + $cfn .= $args->item; + $args->status_ok = ($args->target_user_id > 0 && $args->tplan_id > 0); + break; + + default: + $cfn = ''; + $args->status_ok = false; + break; + } + + if ($args->status_ok && $cfn != '') { + $cfn($dbHandler, $args); + } + return $args; +} + +/** + */ +function build_link_exec(&$argsObj) +{ + $lk = isset($_GET['item']) ? "item=" . $_GET['item'] : ''; + + if ($argsObj->feature_id > 0) { + $lk .= "&feature_id=" . $argsObj->feature_id; + } else { + $lk .= "&tplan_id=" . $argsObj->tplan_id . "&platform_id=" . + $argsObj->platform_id . "&tcversion_id=" . $argsObj->tcversion_id; + } + $lk .= "&build_id=" . $argsObj->build_id; + $lk .= '&load' . (isset($_GET['anchor']) ? '&anchor=' . $_GET['anchor'] : ""); + + return $lk; +} + +/** + */ +function process_exec(&$dbHandler, $context) +{ + $ret = array(); + + $treeMgr = new tree($dbHandler); + $info = $treeMgr->get_node_hierarchy_info($context['tcversion_id']); + + $ret['url'] = "lib/execute/execSetResults.php?level=testcase" . + "&version_id=" . $context['tcversion_id'] . "&id=" . $info['parent_id'] . + "&setting_testplan=" . $context['setting_testplan'] . "&setting_build=" . + $context['setting_build'] . "&setting_platform=" . + $context['setting_platform']; + + $ret['msg'] = 'ok'; + return $ret; +} + +/** + * xta2m: eXecution Tasks Assigned TO Me + */ +function process_xta2m(&$dbHandler, $context) +{ + $ret = array(); + + $treeMgr = new tree($dbHandler); + $info = $treeMgr->get_node_hierarchy_info($context['tcversion_id']); + + $ret['url'] = "lib/execute/execSetResults.php?level=testcase" . + "&version_id=" . $context['tcversion_id'] . "&id=" . $info['parent_id'] . + "&setting_testplan=" . $context['setting_testplan'] . "&setting_build=" . + $context['setting_build'] . "&setting_platform=" . + $context['setting_platform']; + + $ret['msg'] = 'ok'; + return $ret; +} + +/** + */ +function check_exec(&$dbHandler, &$argsObj) +{ + if ($argsObj->feature_id > 0) { + // get missing data + $tb = DB_TABLE_PREFIX . 'testplan_tcversions'; + $sql = "SELECT testplan_id,platform_id,tcversion_id " . + "FROM {$tb} WHERE id=" . $argsObj->feature_id; + + $rs = $dbHandler->get_recordset($sql); + $argsObj->tplan_id = $rs[0]['testplan_id']; + $argsObj->tcversion_id = $rs[0]['tcversion_id']; + $argsObj->platform_id = $rs[0]['platform_id']; + } else { + $argsObj->status_ok = ($argsObj->tplan_id > 0) && + ($argsObj->tcversion_id > 0); + } +} + +/** + */ +function check_xta2m(&$dbHandler, &$argsObj) +{ + $argsObj->status_ok = ($argsObj->target_user_id > 0 && $argsObj->tplan_id > 0); + + if ($argsObj->target_user_id != $argsObj->user_id) { + $argsObj->status_ok = false; + } +} + +/** + */ +function launch_inner_exec(&$dbHandler, &$tplMgr) +{ + $itemCode = array( + 'exec' => 'lib/execute/execNavigator.php' + ); + $op = array( + 'status_ok' => true, + 'msg' => '' + ); + + // First check for keys in _GET that MUST EXIST + // key: key on _GET, value: labelID defined on strings.txt + $mandatoryKeys = array( + 'item' => 'item_not_set', + 'build_id' => 'build_id_not_set' + ); + + foreach ($mandatoryKeys as $key => $labelID) { + $op['status_ok'] = isset($_GET[$key]); + if (! $op['status_ok']) { + $op['msg'] = lang_get($labelID); + break; + } + } + + if ($op['status_ok']) { + $op['status_ok'] = isset($_GET['feature_id']); + if (! $op['status_ok']) { + $keySet = array( + 'tplan_id' => 'testplan_not_set', + 'tcversion_id' => 'tcversion_id', + 'platform_id' => 'platform_id_not_set' + ); + + foreach ($keySet as $key => $labelID) { + $op['status_ok'] = isset($_GET[$key]); + if (! $op['status_ok']) { + $op['msg'] = lang_get($labelID); + break; + } + } + } + } + + $args = init_args($dbHandler); + if ($op['status_ok']) { + // Set Environment + $tplan_mgr = new testplan($dbHandler); + $info = $tplan_mgr->get_by_id($args->tplan_id, + array( + 'output' => 'minimun' + )); + + if (is_null($info)) { + die('ltx - tplan info does not exist'); + } + + $tproject_mgr = new testproject($dbHandler); + $tproject_mgr->setSessionProject($info['tproject_id']); + $op['status_ok'] = true; + } + + if ($op['status_ok']) { + // Build name of function to call for doing the job. + $pfn = 'process_' . $args->item; + + $ctx = array(); + $ctx['setting_testplan'] = $args->tplan_id; + $ctx['setting_build'] = $args->build_id; + $ctx['setting_platform'] = $args->platform_id; + $ctx['tcversion_id'] = $args->tcversion_id; + $ctx['tcase_id'] = 0; + $ctx['user_id'] = $args->user_id; + + $jump_to = $pfn($dbHandler, $ctx); + $op['status_ok'] = ! is_null($jump_to['url']); + $op['msg'] = $jump_to['msg']; + } + + if ($op['status_ok']) { + $treeframe = $itemCode[$args->item] . '?loadExecDashboard=0' . + '&setting_testplan=' . $args->tplan_id . '&setting_build=' . + $args->build_id . '&setting_platform=' . $args->platform_id; + + $tplMgr->assign('title', lang_get('main_page_title')); + $tplMgr->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH); + $tplMgr->assign('workframe', $jump_to['url']); + $tplMgr->assign('treeframe', $treeframe); + $tplMgr->display('frmInner.tpl'); + } else { + echo $op['msg']; + ob_end_flush(); + exit(); + } +} + +// function end + +/** + * xta2m: eXecution Tasks Assigned TO Me + */ +function launch_inner_xta2m(&$dbHandler, &$tplMgr) +{ + $args = init_args($dbHandler); + + $jt = $_SESSION['basehref'] . '/lib/testcases/' . + 'tcAssignedToUser.php?user_id=' . $args->target_user_id . + + $k2c = array( + 'tplan_id', + 'build_id' + ); + foreach ($k2c as $tg) { + if (property_exists($args, $tg) && $args->$tg > 0) { + $jt .= "&$tg=" . $args->$tg; + } + } + + $tplMgr->assign('workframe', $jt); + $tplMgr->display('workframe.tpl'); +} + +/** + */ +function launch_outer_exec(&$tplMgr, $argsObj) +{ + $gui = new stdClass(); + $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; + $gui->navbar_height = config_get('navbar_height'); + + if ($argsObj->tproject_id > 0) { + $gui->titleframe .= '&testproject=' . $argsObj->tproject_id; + } + $gui->title = lang_get('main_page_title'); + $gui->mainframe = 'ltx.php?' . build_link_exec($argsObj); + + $tplMgr->assign('gui', $gui); + $tplMgr->display('main.tpl'); +} + +/** + */ +function launch_outer_xta2m(&$tplMgr, $argsObj) +{ + $gui = new stdClass(); + $gui->titleframe = 'lib/general/navBar.php?caller=linkto'; + $gui->navbar_height = config_get('navbar_height'); + + if ($argsObj->tproject_id > 0) { + $gui->titleframe .= '&testproject=' . $argsObj->tproject_id; + } + $gui->title = lang_get('main_page_title'); + $gui->mainframe = 'ltx.php?item=xta2m&load=1' . '&user_id=' . + $argsObj->target_user_id . '&tplan_id=' . $argsObj->tplan_id; + + $tplMgr->assign('gui', $gui); + $tplMgr->display('main.tpl'); +} + +/** + */ +function buildCookie(&$dbHandler, $itemID, $tprojectID, $cookiePrefix) +{ + $tree_mgr = new tree($dbHandler); + $path = $tree_mgr->get_path($itemID); + $parents = array(); + $parents[] = $tprojectID; + foreach ($path as $node) { + $parents[] = $node['id']; + } + array_pop($parents); + $cookieInfo['path'] = 'a:s%3A/' . implode("/", $parents); + $cookieInfo['value'] = $cookiePrefix . $tprojectID . '_ext-comp-1001'; + return $cookieInfo; } diff --git a/plugin.php b/plugin.php index 94da5c3c78..a6e4a58a9a 100644 --- a/plugin.php +++ b/plugin.php @@ -1,43 +1,45 @@ -name = 'TLTest'; - $this->description = 'Test Plugin'; - - $this->version = '1.0'; - - $this->author = 'Testlink'; - $this->contact = 'raja@star-systems.in'; - $this->url = 'http://www.collab.net'; - } - - function config() - { - return array( - 'config1' => '', - 'config2' => 0 - ); - } - - function hooks() - { - $hooks = array( - 'EVENT_TEST_SUITE_CREATE' => 'testsuite_create', - 'EVENT_TEST_PROJECT_CREATE' => 'testproject_create', - 'EVENT_TEST_PROJECT_UPDATE' => 'testproject_update', - 'EVENT_TEST_CASE_UPDATE' => 'testcase_update', - 'EVENT_TEST_REQUIREMENT_CREATE' => 'testrequirement_create', - 'EVENT_TEST_REQUIREMENT_UPDATE' => 'testrequirement_update', - 'EVENT_TEST_REQUIREMENT_DELETE' => 'testrequirement_delete', - 'EVENT_EXECUTE_TEST' => 'testExecute', - 'EVENT_LEFTMENU_TOP' => 'top_link', - 'EVENT_LEFTMENU_BOTTOM' => 'bottom_link', - 'EVENT_RIGHTMENU_TOP' => 'right_top_link', - 'EVENT_RIGHTMENU_BOTTOM' => 'right_bottom_link', - 'EVENT_TESTRUN_DISPLAY' => 'testrun_display_block' - ); - return $hooks; - } - - function testsuite_create($args) - { - $arg = func_get_args(); // To get all the arguments - $db = $this->db; // To show how to get a Database Connection - echo plugin_lang_get("testsuite_display_message"); - tLog("Im in testsuite create", "WARNING"); - } - - function testproject_create() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestProject Create with id: " . $arg[1] . ", name: " . $arg[2] . ", prefix: " . $arg[3], "WARNING"); - } - - function testproject_update() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestProject Update with id: " . $arg[1] . ", name: " . $arg[2] . ", prefix: " . $arg[3], "WARNING"); - } - - function testcase_update() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestCase Update with id: " . $arg[1] . ", planid: " . $arg[2] . ", title: " . $arg[3] . ", summary" . $arg[4], "WARNING"); - } - - function testrequirement_create() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestRequirement Create with id: " . $arg[1], "WARNING"); - } - - function testrequirement_update() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestRequirement Update with id: " . $arg[1], "WARNING"); - } - - function testrequirement_delete() - { - $arg = func_get_args(); // To get all the arguments - tLog("In TestRequirement Delete with id: " . $arg[1], "WARNING"); - } - - function testExecute() { - $arg = func_get_args(); // To get all the arguments - tLog("In TestRun with testrunid: " . $arg[1] . ", planid: " . $arg[2] . ", buildid: " . $arg[3] . ", testcaseid: " . $arg[4] . ", Notes: " . $arg[5] . ", Status: " . $arg[6], "WARNING"); - } - - function testrun_display_block() { - $args = func_get_args(); - // $args details: $arg[1] -> Testplan Id, $arg[2] -> Build Id, $arg[3] ->TestCase Id, $arg[4] -> TestCase Version Id - return ''; - } - - function bottom_link() - { - $tLink['href'] = ''; - $tLink['label'] = plugin_lang_get('left_bottom_link'); - return $tLink; - } - - function top_link() - { - $tLink['href'] = plugin_page('config.php'); - $tLink['label'] = plugin_lang_get('config'); - return $tLink; - } - - function right_top_link() - { - $tLink['href'] = ''; - $tLink['label'] = plugin_lang_get('right_top_link'); - return $tLink; - } - - function right_bottom_link() - { - $tLink['href'] = ''; - $tLink['label'] = plugin_lang_get('right_bottom_link'); - return $tLink; - } - +name = 'TLTest'; + $this->description = 'Test Plugin'; + + $this->version = '1.0'; + + $this->author = 'Testlink'; + $this->contact = 'raja@star-systems.in'; + $this->url = 'http://www.collab.net'; + } + + function config() + { + return array( + 'config1' => '', + 'config2' => 0 + ); + } + + function hooks() + { + return array( + 'EVENT_TEST_SUITE_CREATE' => 'testsuite_create', + 'EVENT_TEST_PROJECT_CREATE' => 'testproject_create', + 'EVENT_TEST_PROJECT_UPDATE' => 'testproject_update', + 'EVENT_TEST_CASE_UPDATE' => 'testcase_update', + 'EVENT_TEST_REQUIREMENT_CREATE' => 'testrequirement_create', + 'EVENT_TEST_REQUIREMENT_UPDATE' => 'testrequirement_update', + 'EVENT_TEST_REQUIREMENT_DELETE' => 'testrequirement_delete', + 'EVENT_EXECUTE_TEST' => 'testExecute', + 'EVENT_LEFTMENU_TOP' => 'top_link', + 'EVENT_LEFTMENU_BOTTOM' => 'bottom_link', + 'EVENT_RIGHTMENU_TOP' => 'right_top_link', + 'EVENT_RIGHTMENU_BOTTOM' => 'right_bottom_link', + 'EVENT_TESTRUN_DISPLAY' => 'testrun_display_block' + ); + } + + function testsuite_create($args) + { + $arg = func_get_args(); // To get all the arguments + $db = $this->db; // To show how to get a Database Connection + echo plugin_lang_get("testsuite_display_message"); + tLog("Im in testsuite create", "WARNING"); + } + + function testproject_create() + { + $arg = func_get_args(); // To get all the arguments + tLog( + "In TestProject Create with id: " . $arg[1] . ", name: " . $arg[2] . + ", prefix: " . $arg[3], "WARNING"); + } + + function testproject_update() + { + $arg = func_get_args(); // To get all the arguments + tLog( + "In TestProject Update with id: " . $arg[1] . ", name: " . $arg[2] . + ", prefix: " . $arg[3], "WARNING"); + } + + function testcase_update() + { + $arg = func_get_args(); // To get all the arguments + tLog( + "In TestCase Update with id: " . $arg[1] . ", planid: " . $arg[2] . + ", title: " . $arg[3] . ", summary" . $arg[4], "WARNING"); + } + + function testrequirement_create() + { + $arg = func_get_args(); // To get all the arguments + tLog("In TestRequirement Create with id: " . $arg[1], "WARNING"); + } + + function testrequirement_update() + { + $arg = func_get_args(); // To get all the arguments + tLog("In TestRequirement Update with id: " . $arg[1], "WARNING"); + } + + function testrequirement_delete() + { + $arg = func_get_args(); // To get all the arguments + tLog("In TestRequirement Delete with id: " . $arg[1], "WARNING"); + } + + function testExecute() + { + $arg = func_get_args(); // To get all the arguments + tLog( + "In TestRun with testrunid: " . $arg[1] . ", planid: " . $arg[2] . + ", buildid: " . $arg[3] . ", testcaseid: " . $arg[4] . ", Notes: " . + $arg[5] . ", Status: " . $arg[6], "WARNING"); + } + + function testrun_display_block() + { + $args = func_get_args(); + // $args details: $arg[1] -> Testplan Id, $arg[2] -> Build Id, $arg[3] ->TestCase Id, $arg[4] -> TestCase Version Id + return ''; + } + + function bottom_link() + { + $tLink['href'] = ''; + $tLink['label'] = plugin_lang_get('left_bottom_link'); + return $tLink; + } + + function top_link() + { + $tLink['href'] = plugin_page('config.php'); + $tLink['label'] = plugin_lang_get('config'); + return $tLink; + } + + function right_top_link() + { + $tLink['href'] = ''; + $tLink['label'] = plugin_lang_get('right_top_link'); + return $tLink; + } + + function right_bottom_link() + { + $tLink['href'] = ''; + $tLink['label'] = plugin_lang_get('right_bottom_link'); + return $tLink; + } } diff --git a/plugins/TLTest/pages/config.php b/plugins/TLTest/pages/config.php index befbdd7952..248a15568c 100644 --- a/plugins/TLTest/pages/config.php +++ b/plugins/TLTest/pages/config.php @@ -1,37 +1,36 @@ -message = plugin_lang_get('config_page_saved'); // Confirm message - - // Assign to Smarty - $smarty->assign('gui',$gui); - $smarty->display(plugin_file_path('config.tpl')); - return; -} - -$gui->headerMessage = plugin_lang_get('config_page_header_message'); -$gui->title = plugin_lang_get('config_page_title'); -$gui->labelConfig1 = plugin_lang_get('config_label_config1'); -$gui->labelConfig2 = plugin_lang_get('config_label_config2'); -$gui->config1 = plugin_config_get('config1', '', $_SESSION['testprojectID']); -$gui->config2 = plugin_config_get('config2', '', $_SESSION['testprojectID']); -$gui->labelSaveConfig = plugin_lang_get('config_label_save_button'); - -$smarty->assign('gui',$gui); -$smarty->display(plugin_file_path('config.tpl')); \ No newline at end of file +message = plugin_lang_get('config_page_saved'); // Confirm message + + // Assign to Smarty + $smarty->assign('gui', $gui); + $smarty->display(plugin_file_path('config.tpl')); + return; +} + +$gui->headerMessage = plugin_lang_get('config_page_header_message'); +$gui->title = plugin_lang_get('config_page_title'); +$gui->labelConfig1 = plugin_lang_get('config_label_config1'); +$gui->labelConfig2 = plugin_lang_get('config_label_config2'); +$gui->config1 = plugin_config_get('config1', '', $_SESSION['testprojectID']); +$gui->config2 = plugin_config_get('config2', '', $_SESSION['testprojectID']); +$gui->labelSaveConfig = plugin_lang_get('config_label_save_button'); + +$smarty->assign('gui', $gui); +$smarty->display(plugin_file_path('config.tpl')); diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel.php deleted file mode 100644 index cdb4ab9501..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel.php +++ /dev/null @@ -1,796 +0,0 @@ -_workSheetCollection = array(); - $this->_workSheetCollection[] = new PHPExcel_Worksheet($this); - $this->_activeSheetIndex = 0; - - // Create document properties - $this->_properties = new PHPExcel_DocumentProperties(); - - // Create document security - $this->_security = new PHPExcel_DocumentSecurity(); - - // Set named ranges - $this->_namedRanges = array(); - - // Create the cellXf supervisor - $this->_cellXfSupervisor = new PHPExcel_Style(true); - $this->_cellXfSupervisor->bindParent($this); - - // Create the default style - $this->addCellXf(new PHPExcel_Style); - $this->addCellStyleXf(new PHPExcel_Style); - } - - - public function disconnectWorksheets() { - foreach($this->_workSheetCollection as $k => &$worksheet) { - $worksheet->disconnectCells(); - $this->_workSheetCollection[$k] = null; - } - unset($worksheet); - $this->_workSheetCollection = array(); - } - - /** - * Get properties - * - * @return PHPExcel_DocumentProperties - */ - public function getProperties() - { - return $this->_properties; - } - - /** - * Set properties - * - * @param PHPExcel_DocumentProperties $pValue - */ - public function setProperties(PHPExcel_DocumentProperties $pValue) - { - $this->_properties = $pValue; - } - - /** - * Get security - * - * @return PHPExcel_DocumentSecurity - */ - public function getSecurity() - { - return $this->_security; - } - - /** - * Set security - * - * @param PHPExcel_DocumentSecurity $pValue - */ - public function setSecurity(PHPExcel_DocumentSecurity $pValue) - { - $this->_security = $pValue; - } - - /** - * Get active sheet - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_workSheetCollection[$this->_activeSheetIndex]; - } - - /** - * Create sheet and add it to this workbook - * - * @return PHPExcel_Worksheet - */ - public function createSheet($iSheetIndex = null) - { - $newSheet = new PHPExcel_Worksheet($this); - $this->addSheet($newSheet, $iSheetIndex); - return $newSheet; - } - - /** - * Add sheet - * - * @param PHPExcel_Worksheet $pSheet - * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last) - * @return PHPExcel_Worksheet - * @throws Exception - */ - public function addSheet(PHPExcel_Worksheet $pSheet = null, $iSheetIndex = null) - { - if(is_null($iSheetIndex)) - { - $this->_workSheetCollection[] = $pSheet; - } - else - { - // Insert the sheet at the requested index - array_splice( - $this->_workSheetCollection, - $iSheetIndex, - 0, - array($pSheet) - ); - - // Adjust active sheet index if necessary - if ($this->_activeSheetIndex >= $iSheetIndex) { - ++$this->_activeSheetIndex; - } - - } - return $pSheet; - } - - /** - * Remove sheet by index - * - * @param int $pIndex Active sheet index - * @throws Exception - */ - public function removeSheetByIndex($pIndex = 0) - { - if ($pIndex > count($this->_workSheetCollection) - 1) { - throw new Exception("Sheet index is out of bounds."); - } else { - array_splice($this->_workSheetCollection, $pIndex, 1); - } - } - - /** - * Get sheet by index - * - * @param int $pIndex Sheet index - * @return PHPExcel_Worksheet - * @throws Exception - */ - public function getSheet($pIndex = 0) - { - if ($pIndex > count($this->_workSheetCollection) - 1) { - throw new Exception("Sheet index is out of bounds."); - } else { - return $this->_workSheetCollection[$pIndex]; - } - } - - /** - * Get all sheets - * - * @return PHPExcel_Worksheet[] - */ - public function getAllSheets() - { - return $this->_workSheetCollection; - } - - /** - * Get sheet by name - * - * @param string $pName Sheet name - * @return PHPExcel_Worksheet - * @throws Exception - */ - public function getSheetByName($pName = '') - { - $worksheetCount = count($this->_workSheetCollection); - for ($i = 0; $i < $worksheetCount; ++$i) { - if ($this->_workSheetCollection[$i]->getTitle() == $pName) { - return $this->_workSheetCollection[$i]; - } - } - - return null; - } - - /** - * Get index for sheet - * - * @param PHPExcel_Worksheet $pSheet - * @return Sheet index - * @throws Exception - */ - public function getIndex(PHPExcel_Worksheet $pSheet) - { - foreach ($this->_workSheetCollection as $key => $value) { - if ($value->getHashCode() == $pSheet->getHashCode()) { - return $key; - } - } - } - - /** - * Set index for sheet by sheet name. - * - * @param string $sheetName Sheet name to modify index for - * @param int $newIndex New index for the sheet - * @return New sheet index - * @throws Exception - */ - public function setIndexByName($sheetName, $newIndex) - { - $oldIndex = $this->getIndex($this->getSheetByName($sheetName)); - $pSheet = array_splice( - $this->_workSheetCollection, - $oldIndex, - 1 - ); - array_splice( - $this->_workSheetCollection, - $newIndex, - 0, - $pSheet - ); - return $newIndex; - } - - /** - * Get sheet count - * - * @return int - */ - public function getSheetCount() - { - return count($this->_workSheetCollection); - } - - /** - * Get active sheet index - * - * @return int Active sheet index - */ - public function getActiveSheetIndex() - { - return $this->_activeSheetIndex; - } - - /** - * Set active sheet index - * - * @param int $pIndex Active sheet index - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setActiveSheetIndex($pIndex = 0) - { - if ($pIndex > count($this->_workSheetCollection) - 1) { - throw new Exception("Active sheet index is out of bounds."); - } else { - $this->_activeSheetIndex = $pIndex; - } - return $this->getActiveSheet(); - } - - /** - * Set active sheet index by name - * - * @param string $pValue Sheet title - * @return PHPExcel_Worksheet - * @throws Exception - */ - public function setActiveSheetIndexByName($pValue = '') - { - if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) { - $this->setActiveSheetIndex($worksheet->getParent()->getIndex($worksheet)); - return $worksheet; - } - - throw new Exception('Workbook does not contain sheet:' . $pValue); - } - - /** - * Get sheet names - * - * @return string[] - */ - public function getSheetNames() - { - $returnValue = array(); - $worksheetCount = $this->getSheetCount(); - for ($i = 0; $i < $worksheetCount; ++$i) { - array_push($returnValue, $this->getSheet($i)->getTitle()); - } - - return $returnValue; - } - - /** - * Add external sheet - * - * @param PHPExcel_Worksheet $pSheet External sheet to add - * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function addExternalSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null) { - if (!is_null($this->getSheetByName($pSheet->getTitle()))) { - throw new Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first."); - } - - // count how many cellXfs there are in this workbook currently, we will need this below - $countCellXfs = count($this->_cellXfCollection); - - // copy all the shared cellXfs from the external workbook and append them to the current - foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) { - $this->addCellXf(clone $cellXf); - } - - // move sheet to this workbook - $pSheet->rebindParent($this); - - // update the cellXfs - foreach ($pSheet->getCellCollection(false) as $cellID) { - $cell = $pSheet->getCell($cellID); - $cell->setXfIndex( $cell->getXfIndex() + $countCellXfs ); - } - - return $this->addSheet($pSheet, $iSheetIndex); - } - - /** - * Get named ranges - * - * @return PHPExcel_NamedRange[] - */ - public function getNamedRanges() { - return $this->_namedRanges; - } - - /** - * Add named range - * - * @param PHPExcel_NamedRange $namedRange - * @return PHPExcel - */ - public function addNamedRange(PHPExcel_NamedRange $namedRange) { - if ($namedRange->getScope() == null) { - // global scope - $this->_namedRanges[$namedRange->getName()] = $namedRange; - } else { - // local scope - $this->_namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange; - } - return true; - } - - /** - * Get named range - * - * @param string $namedRange - * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope - * @return PHPExcel_NamedRange|null - */ - public function getNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) { - $returnValue = null; - - if ($namedRange != '' && !is_null($namedRange)) { - // first look for global defined name - if (isset($this->_namedRanges[$namedRange])) { - $returnValue = $this->_namedRanges[$namedRange]; - } - - // then look for local defined name (has priority over global defined name if both names exist) - if (!is_null($pSheet) && isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { - $returnValue = $this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange]; - } - } - - return $returnValue; - } - - /** - * Remove named range - * - * @param string $namedRange - * @param PHPExcel_Worksheet|null $pSheet. Scope. Use null for global scope. - * @return PHPExcel - */ - public function removeNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null) { - if (is_null($pSheet)) { - if (isset($this->_namedRanges[$namedRange])) { - unset($this->_namedRanges[$namedRange]); - } - } else { - if (isset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange])) { - unset($this->_namedRanges[$pSheet->getTitle() . '!' . $namedRange]); - } - } - return $this; - } - - /** - * Get worksheet iterator - * - * @return PHPExcel_WorksheetIterator - */ - public function getWorksheetIterator() { - return new PHPExcel_WorksheetIterator($this); - } - - /** - * Copy workbook (!= clone!) - * - * @return PHPExcel - */ - public function copy() { - $copied = clone $this; - - $worksheetCount = count($this->_workSheetCollection); - for ($i = 0; $i < $worksheetCount; ++$i) { - $this->_workSheetCollection[$i] = $this->_workSheetCollection[$i]->copy(); - $this->_workSheetCollection[$i]->rebindParent($this); - } - - return $copied; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - foreach($this as $key => $val) { - if (is_object($val) || (is_array($val))) { - $this->{$key} = unserialize(serialize($val)); - } - } - } - - /** - * Get the workbook collection of cellXfs - * - * @return PHPExcel_Style[] - */ - public function getCellXfCollection() - { - return $this->_cellXfCollection; - } - - /** - * Get cellXf by index - * - * @param int $index - * @return PHPExcel_Style - */ - public function getCellXfByIndex($pIndex = 0) - { - return $this->_cellXfCollection[$pIndex]; - } - - /** - * Get cellXf by hash code - * - * @param string $pValue - * @return PHPExcel_Style|false - */ - public function getCellXfByHashCode($pValue = '') - { - foreach ($this->_cellXfCollection as $cellXf) { - if ($cellXf->getHashCode() == $pValue) { - return $cellXf; - } - } - return false; - } - - /** - * Get default style - * - * @return PHPExcel_Style - * @throws Exception - */ - public function getDefaultStyle() - { - if (isset($this->_cellXfCollection[0])) { - return $this->_cellXfCollection[0]; - } - throw new Exception('No default style found for this workbook'); - } - - /** - * Add a cellXf to the workbook - * - * @param PHPExcel_Style - */ - public function addCellXf(PHPExcel_Style $style) - { - $this->_cellXfCollection[] = $style; - $style->setIndex(count($this->_cellXfCollection) - 1); - } - - /** - * Remove cellXf by index. It is ensured that all cells get their xf index updated. - * - * @param int $pIndex Index to cellXf - * @throws Exception - */ - public function removeCellXfByIndex($pIndex = 0) - { - if ($pIndex > count($this->_cellXfCollection) - 1) { - throw new Exception("CellXf index is out of bounds."); - } else { - // first remove the cellXf - array_splice($this->_cellXfCollection, $pIndex, 1); - - // then update cellXf indexes for cells - foreach ($this->_workSheetCollection as $worksheet) { - foreach ($worksheet->getCellCollection(false) as $cellID) { - $cell = $worksheet->getCell($cellID); - $xfIndex = $cell->getXfIndex(); - if ($xfIndex > $pIndex ) { - // decrease xf index by 1 - $cell->setXfIndex($xfIndex - 1); - } else if ($xfIndex == $pIndex) { - // set to default xf index 0 - $cell->setXfIndex(0); - } - } - } - } - } - - /** - * Get the cellXf supervisor - * - * @return PHPExcel_Style - */ - public function getCellXfSupervisor() - { - return $this->_cellXfSupervisor; - } - - /** - * Get the workbook collection of cellStyleXfs - * - * @return PHPExcel_Style[] - */ - public function getCellStyleXfCollection() - { - return $this->_cellStyleXfCollection; - } - - /** - * Get cellStyleXf by index - * - * @param int $pIndex - * @return PHPExcel_Style - */ - public function getCellStyleXfByIndex($pIndex = 0) - { - return $this->_cellStyleXfCollection[$pIndex]; - } - - /** - * Get cellStyleXf by hash code - * - * @param string $pValue - * @return PHPExcel_Style|false - */ - public function getCellStyleXfByHashCode($pValue = '') - { - foreach ($this->_cellXfStyleCollection as $cellStyleXf) { - if ($cellStyleXf->getHashCode() == $pValue) { - return $cellStyleXf; - } - } - return false; - } - - /** - * Add a cellStyleXf to the workbook - * - * @param PHPExcel_Style $pStyle - */ - public function addCellStyleXf(PHPExcel_Style $pStyle) - { - $this->_cellStyleXfCollection[] = $pStyle; - $pStyle->setIndex(count($this->_cellStyleXfCollection) - 1); - } - - /** - * Remove cellStyleXf by index - * - * @param int $pIndex - * @throws Exception - */ - public function removeCellStyleXfByIndex($pIndex = 0) - { - if ($pIndex > count($this->_cellStyleXfCollection) - 1) { - throw new Exception("CellStyleXf index is out of bounds."); - } else { - array_splice($this->_cellStyleXfCollection, $pIndex, 1); - } - } - - /** - * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells - * and columns in the workbook - */ - public function garbageCollect() - { - // how many references are there to each cellXf ? - $countReferencesCellXf = array(); - foreach ($this->_cellXfCollection as $index => $cellXf) { - $countReferencesCellXf[$index] = 0; - } - - foreach ($this->getWorksheetIterator() as $sheet) { - - // from cells - foreach ($sheet->getCellCollection(false) as $cellID) { - $cell = $sheet->getCell($cellID); - ++$countReferencesCellXf[$cell->getXfIndex()]; - } - - // from row dimensions - foreach ($sheet->getRowDimensions() as $rowDimension) { - if ($rowDimension->getXfIndex() !== null) { - ++$countReferencesCellXf[$rowDimension->getXfIndex()]; - } - } - - // from column dimensions - foreach ($sheet->getColumnDimensions() as $columnDimension) { - ++$countReferencesCellXf[$columnDimension->getXfIndex()]; - } - } - - // remove cellXfs without references and create mapping so we can update xfIndex - // for all cells and columns - $countNeededCellXfs = 0; - foreach ($this->_cellXfCollection as $index => $cellXf) { - if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf - ++$countNeededCellXfs; - } else { - unset($this->_cellXfCollection[$index]); - } - $map[$index] = $countNeededCellXfs - 1; - } - $this->_cellXfCollection = array_values($this->_cellXfCollection); - - // update the index for all cellXfs - foreach ($this->_cellXfCollection as $i => $cellXf) { - $cellXf->setIndex($i); - } - - // make sure there is always at least one cellXf (there should be) - if (count($this->_cellXfCollection) == 0) { - $this->_cellXfCollection[] = new PHPExcel_Style(); - } - - // update the xfIndex for all cells, row dimensions, column dimensions - foreach ($this->getWorksheetIterator() as $sheet) { - - // for all cells - foreach ($sheet->getCellCollection(false) as $cellID) { - $cell = $sheet->getCell($cellID); - $cell->setXfIndex( $map[$cell->getXfIndex()] ); - } - - // for all row dimensions - foreach ($sheet->getRowDimensions() as $rowDimension) { - if ($rowDimension->getXfIndex() !== null) { - $rowDimension->setXfIndex( $map[$rowDimension->getXfIndex()] ); - } - } - - // for all column dimensions - foreach ($sheet->getColumnDimensions() as $columnDimension) { - $columnDimension->setXfIndex( $map[$columnDimension->getXfIndex()] ); - } - } - - // also do garbage collection for all the sheets - foreach ($this->getWorksheetIterator() as $sheet) { - $sheet->garbageCollect(); - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Autoloader.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Autoloader.php deleted file mode 100644 index 1164cf1f7c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Autoloader.php +++ /dev/null @@ -1,60 +0,0 @@ -_currentObject->detach(); - - if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in APC'); - } - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - $this->_cellCache[$pCoord] = true; - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? - * - * @param string $pCoord Coordinate address of the cell to check - * @return void - * @return boolean - */ - public function isDataSet($pCoord) { - // Check if the requested entry is the current object, or exists in the cache - if (parent::isDataSet($pCoord)) { - if ($this->_currentObjectID == $pCoord) { - return true; - } - // Check if the requested entry still exists in apc - $success = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); - if ($success === false) { - // Entry no longer exists in APC, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); - } - return true; - } - return false; - } // function isDataSet() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (parent::isDataSet($pCoord)) { - $obj = apc_fetch($this->_cachePrefix.$pCoord.'.cache'); - if ($obj === false) { - // Entry no longer exists in APC, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); - } - } else { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - $this->_currentObject = unserialize($obj); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - /** - * Delete a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to delete - * @throws Exception - */ - public function deleteCacheData($pCoord) { - // Delete the entry from APC - apc_delete($this->_cachePrefix.$pCoord.'.cache'); - - // Delete the entry from our cell address array - parent::deleteCacheData($pCoord); - } // function deleteCacheData() - - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - // Get a new id for the new file name - $baseUnique = $this->_getUniqueID(); - $newCachePrefix = substr(md5($baseUnique),0,8).'.'; - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - if ($cellID != $this->_currentObjectID) { - $obj = apc_fetch($this->_cachePrefix.$cellID.'.cache'); - if ($obj === false) { - // Entry no longer exists in APC, so clear it from the cache array - parent::deleteCacheData($cellID); - throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); - } - if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in APC'); - } - } - } - $this->_cachePrefix = $newCachePrefix; - } // function copyCellCollection() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - - // Flush the APC cache - $this->__destruct(); - - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - - - public function __construct(PHPExcel_Worksheet $parent, $arguments) { - $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; - - if (is_null($this->_cachePrefix)) { - $baseUnique = $this->_getUniqueID(); - $this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; - $this->_cacheTime = $cacheTime; - - parent::__construct($parent); - } - } // function __construct() - - - public function __destruct() { - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - apc_delete($this->_cachePrefix.$cellID.'.cache'); - } - } // function __destruct() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/CacheBase.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/CacheBase.php deleted file mode 100644 index 3e8cd2fc54..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/CacheBase.php +++ /dev/null @@ -1,172 +0,0 @@ -_parent = $parent; - } // function __construct() - - - /** - * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? - * - * @param string $pCoord Coordinate address of the cell to check - * @return void - * @return boolean - */ - public function isDataSet($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return true; - } - // Check if the requested entry exists in the cache - return isset($this->_cellCache[$pCoord]); - } // function isDataSet() - - - /** - * Add or Update a cell in cache - * - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function updateCacheData(PHPExcel_Cell $cell) { - return $this->addCacheData($cell->getCoordinate(),$cell); - } // function updateCacheData() - - - /** - * Delete a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to delete - * @throws Exception - */ - public function deleteCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - $this->_currentObject->detach(); - $this->_currentObjectID = $this->_currentObject = null; - } - - if (is_object($this->_cellCache[$pCoord])) { - $this->_cellCache[$pCoord]->detach(); - unset($this->_cellCache[$pCoord]); - } - } // function deleteCacheData() - - - /** - * Get a list of all cell addresses currently held in cache - * - * @return array of string - */ - public function getCellList() { - return array_keys($this->_cellCache); - } // function getCellList() - - - /** - * Sort the list of all cell addresses currently held in cache by row and column - * - * @return void - */ - public function getSortedCellList() { - $sortKeys = array(); - foreach (array_keys($this->_cellCache) as $coord) { - list($column,$row) = sscanf($coord,'%[A-Z]%d'); - $sortKeys[sprintf('%09d%3s',$row,$column)] = $coord; - } - ksort($sortKeys); - - return array_values($sortKeys); - } // function sortCellList() - - - protected function _getUniqueID() { - if (function_exists('posix_getpid')) { - $baseUnique = posix_getpid(); - } else { - $baseUnique = mt_rand(); - } - return uniqid($baseUnique,true); - } - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - $this->_parent = $parent; - if ((!is_null($this->_currentObject)) && (is_object($this->_currentObject))) { - $this->_currentObject->attach($parent); - } - } // function copyCellCollection() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/DiscISAM.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/DiscISAM.php deleted file mode 100644 index 349be2c652..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/DiscISAM.php +++ /dev/null @@ -1,157 +0,0 @@ -_currentObject->detach(); - - fseek($this->_fileHandle,0,SEEK_END); - $offset = ftell($this->_fileHandle); - fwrite($this->_fileHandle, serialize($this->_currentObject)); - $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset, - 'sz' => ftell($this->_fileHandle) - $offset - ); - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (!isset($this->_cellCache[$pCoord])) { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']); - $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz'])); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - // Get a new id for the new file name - $baseUnique = $this->_getUniqueID(); - $newFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache'; - // Copy the existing cell cache file - copy ($this->_fileName,$newFileName); - $this->_fileName = $newFileName; - // Open the copied cell cache file - $this->_fileHandle = fopen($this->_fileName,'a+'); - } // function copyCellCollection() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - - // Close down the temporary cache file - $this->__destruct(); - } // function unsetWorksheetCells() - - - public function __construct(PHPExcel_Worksheet $parent) { - parent::__construct($parent); - if (is_null($this->_fileHandle)) { - $baseUnique = $this->_getUniqueID(); - $this->_fileName = PHPExcel_Shared_File::sys_get_temp_dir().'/PHPExcel.'.$baseUnique.'.cache'; - $this->_fileHandle = fopen($this->_fileName,'a+'); - } - } // function __construct() - - - public function __destruct() { - if (!is_null($this->_fileHandle)) { - fclose($this->_fileHandle); - unlink($this->_fileName); - } - $this->_fileHandle = null; - } // function __destruct() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/ICache.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/ICache.php deleted file mode 100644 index 35215a0f64..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/ICache.php +++ /dev/null @@ -1,104 +0,0 @@ -_currentObject->detach(); - - $obj = serialize($this->_currentObject); - if (!$this->_memcache->replace($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { - if (!$this->_memcache->add($this->_cachePrefix.$this->_currentObjectID.'.cache',$obj,NULL,$this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in MemCache'); - } - } - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - $this->_cellCache[$pCoord] = true; - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? - * - * @param string $pCoord Coordinate address of the cell to check - * @return void - * @return boolean - */ - public function isDataSet($pCoord) { - // Check if the requested entry is the current object, or exists in the cache - if (parent::isDataSet($pCoord)) { - if ($this->_currentObjectID == $pCoord) { - return true; - } - // Check if the requested entry still exists in Memcache - $success = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); - if ($success === false) { - // Entry no longer exists in Memcache, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); - } - return true; - } - return false; - } // function isDataSet() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (parent::isDataSet($pCoord)) { - $obj = $this->_memcache->get($this->_cachePrefix.$pCoord.'.cache'); - if ($obj === false) { - // Entry no longer exists in Memcache, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); - } - } else { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - $this->_currentObject = unserialize($obj); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - /** - * Delete a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to delete - * @throws Exception - */ - public function deleteCacheData($pCoord) { - // Delete the entry from Memcache - $this->_memcache->delete($this->_cachePrefix.$pCoord.'.cache'); - - // Delete the entry from our cell address array - parent::deleteCacheData($pCoord); - } // function deleteCacheData() - - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - // Get a new id for the new file name - $baseUnique = $this->_getUniqueID(); - $newCachePrefix = substr(md5($baseUnique),0,8).'.'; - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - if ($cellID != $this->_currentObjectID) { - $obj = $this->_memcache->get($this->_cachePrefix.$cellID.'.cache'); - if ($obj === false) { - // Entry no longer exists in Memcache, so clear it from the cache array - parent::deleteCacheData($cellID); - throw new Exception('Cell entry '.$cellID.' no longer exists in MemCache'); - } - if (!$this->_memcache->add($newCachePrefix.$cellID.'.cache',$obj,NULL,$this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in MemCache'); - } - } - } - $this->_cachePrefix = $newCachePrefix; - } // function copyCellCollection() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - - // Flush the Memcache cache - $this->__destruct(); - - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - - - public function __construct(PHPExcel_Worksheet $parent, $arguments) { - $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost'; - $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211; - $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; - - if (is_null($this->_cachePrefix)) { - $baseUnique = $this->_getUniqueID(); - $this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; - - // Set a new Memcache object and connect to the Memcache server - $this->_memcache = new Memcache(); - if (!$this->_memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) { - throw new Exception('Could not connect to MemCache server at '.$memcacheServer.':'.$memcachePort); - } - $this->_cacheTime = $cacheTime; - - parent::__construct($parent); - } - } // function __construct() - - - public function failureCallback($host, $port) { - throw new Exception('memcache '.$host.':'.$port.' failed'); - } - - - public function __destruct() { - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - $this->_memcache->delete($this->_cachePrefix.$cellID.'.cache'); - } - } // function __destruct() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Memory.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Memory.php deleted file mode 100644 index 1824f72d99..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Memory.php +++ /dev/null @@ -1,98 +0,0 @@ -_cellCache[$pCoord] = $cell; - return $cell; - } // function addCacheData() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - // Check if the entry that has been requested actually exists - if (!isset($this->_cellCache[$pCoord])) { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Return requested entry - return $this->_cellCache[$pCoord]; - } // function getCacheData() - - - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - - $newCollection = array(); - foreach($this->_cellCache as $k => &$cell) { - $newCollection[$k] = clone $cell; - $newCollection[$k]->attach($parent); - } - - $this->_cellCache = $newCollection; - } - - - public function unsetWorksheetCells() { - // Because cells are all stored as intact objects in memory, we need to detach each one from the parent - foreach($this->_cellCache as $k => &$cell) { - $cell->detach(); - $this->_cellCache[$k] = null; - } - unset($cell); - - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemoryGZip.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemoryGZip.php deleted file mode 100644 index 5bc4b99027..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemoryGZip.php +++ /dev/null @@ -1,107 +0,0 @@ -_currentObject->detach(); - - $this->_cellCache[$this->_currentObjectID] = gzdeflate(serialize($this->_currentObject)); - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (!isset($this->_cellCache[$pCoord])) { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - $this->_currentObject = unserialize(gzinflate($this->_cellCache[$pCoord])); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemorySerialized.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemorySerialized.php deleted file mode 100644 index 4fa351b90c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/MemorySerialized.php +++ /dev/null @@ -1,107 +0,0 @@ -_currentObject->detach(); - - $this->_cellCache[$this->_currentObjectID] = serialize($this->_currentObject); - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (!isset($this->_cellCache[$pCoord])) { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - $this->_currentObject = unserialize($this->_cellCache[$pCoord]); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/PHPTemp.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/PHPTemp.php deleted file mode 100644 index 711d5ebc22..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/PHPTemp.php +++ /dev/null @@ -1,157 +0,0 @@ -_currentObject->detach(); - - fseek($this->_fileHandle,0,SEEK_END); - $offset = ftell($this->_fileHandle); - fwrite($this->_fileHandle, serialize($this->_currentObject)); - $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset, - 'sz' => ftell($this->_fileHandle) - $offset - ); - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - if (!isset($this->_cellCache[$pCoord])) { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']); - $this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz'])); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - // Open a new stream for the cell cache data - $newFileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+'); - // Copy the existing cell cache data to the new stream - fseek($this->_fileHandle,0); - while (!feof($this->_fileHandle)) { - fwrite($newFileHandle,fread($this->_fileHandle, 1024)); - } - $this->_fileHandle = $newFileHandle; - } // function copyCellCollection() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - - // Close down the php://temp file - $this->__destruct(); - } // function unsetWorksheetCells() - - - public function __construct(PHPExcel_Worksheet $parent, $memoryCacheSize = '1MB') { - $this->_memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB'; - - parent::__construct($parent); - if (is_null($this->_fileHandle)) { - $this->_fileHandle = fopen('php://temp/maxmemory:'.$this->_memoryCacheSize,'a+'); - } - } // function __construct() - - - public function __destruct() { - if (!is_null($this->_fileHandle)) { - fclose($this->_fileHandle); - } - $this->_fileHandle = null; - } // function __destruct() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Wincache.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Wincache.php deleted file mode 100644 index 844979dbc5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorage/Wincache.php +++ /dev/null @@ -1,230 +0,0 @@ -_currentObject->detach(); - - $obj = serialize($this->_currentObject); - if (wincache_ucache_exists($this->_cachePrefix.$this->_currentObjectID.'.cache')) { - if (!wincache_ucache_set($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in WinCache'); - } - } else { - if (!wincache_ucache_add($this->_cachePrefix.$this->_currentObjectID.'.cache', $obj, $this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in WinCache'); - } - } - - $this->_currentObjectID = $this->_currentObject = null; - } // function _storeData() - - - /** - * Add or Update a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to update - * @param PHPExcel_Cell $cell Cell to update - * @return void - * @throws Exception - */ - public function addCacheData($pCoord, PHPExcel_Cell $cell) { - if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { - $this->_storeData(); - } - $this->_cellCache[$pCoord] = true; - - $this->_currentObjectID = $pCoord; - $this->_currentObject = $cell; - - return $cell; - } // function addCacheData() - - - /** - * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? - * - * @param string $pCoord Coordinate address of the cell to check - * @return void - * @return boolean - */ - public function isDataSet($pCoord) { - // Check if the requested entry is the current object, or exists in the cache - if (parent::isDataSet($pCoord)) { - if ($this->_currentObjectID == $pCoord) { - return true; - } - // Check if the requested entry still exists in cache - $success = wincache_ucache_exists($this->_cachePrefix.$pCoord.'.cache'); - if ($success === false) { - // Entry no longer exists in Wincache, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache'); - } - return true; - } - return false; - } // function isDataSet() - - - /** - * Get cell at a specific coordinate - * - * @param string $pCoord Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found, or null if not found - */ - public function getCacheData($pCoord) { - if ($pCoord === $this->_currentObjectID) { - return $this->_currentObject; - } - $this->_storeData(); - - // Check if the entry that has been requested actually exists - $obj = null; - if (parent::isDataSet($pCoord)) { - $success = false; - $obj = wincache_ucache_get($this->_cachePrefix.$pCoord.'.cache', $success); - if ($success === false) { - // Entry no longer exists in WinCache, so clear it from the cache array - parent::deleteCacheData($pCoord); - throw new Exception('Cell entry '.$cellID.' no longer exists in WinCache'); - } - } else { - // Return null if requested entry doesn't exist in cache - return null; - } - - // Set current entry to the requested entry - $this->_currentObjectID = $pCoord; - $this->_currentObject = unserialize($obj); - // Re-attach the parent worksheet - $this->_currentObject->attach($this->_parent); - - // Return requested entry - return $this->_currentObject; - } // function getCacheData() - - - /** - * Delete a cell in cache identified by coordinate address - * - * @param string $pCoord Coordinate address of the cell to delete - * @throws Exception - */ - public function deleteCacheData($pCoord) { - // Delete the entry from Wincache - wincache_ucache_delete($this->_cachePrefix.$pCoord.'.cache'); - - // Delete the entry from our cell address array - parent::deleteCacheData($pCoord); - } // function deleteCacheData() - - - /** - * Clone the cell collection - * - * @return void - */ - public function copyCellCollection(PHPExcel_Worksheet $parent) { - parent::copyCellCollection($parent); - // Get a new id for the new file name - $baseUnique = $this->_getUniqueID(); - $newCachePrefix = substr(md5($baseUnique),0,8).'.'; - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - if ($cellID != $this->_currentObjectID) { - $success = false; - $obj = wincache_ucache_get($this->_cachePrefix.$cellID.'.cache', $success); - if ($success === false) { - // Entry no longer exists in WinCache, so clear it from the cache array - parent::deleteCacheData($cellID); - throw new Exception('Cell entry '.$cellID.' no longer exists in Wincache'); - } - if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) { - $this->__destruct(); - throw new Exception('Failed to store cell '.$cellID.' in Wincache'); - } - } - } - $this->_cachePrefix = $newCachePrefix; - } // function copyCellCollection() - - - public function unsetWorksheetCells() { - if(!is_null($this->_currentObject)) { - $this->_currentObject->detach(); - $this->_currentObject = $this->_currentObjectID = null; - } - - // Flush the WinCache cache - $this->__destruct(); - - $this->_cellCache = array(); - - // detach ourself from the worksheet, so that it can then delete this object successfully - $this->_parent = null; - } // function unsetWorksheetCells() - - - public function __construct(PHPExcel_Worksheet $parent, $arguments) { - $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; - - if (is_null($this->_cachePrefix)) { - $baseUnique = $this->_getUniqueID(); - $this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; - $this->_cacheTime = $cacheTime; - - parent::__construct($parent); - } - } // function __construct() - - - public function __destruct() { - $cacheList = $this->getCellList(); - foreach($cacheList as $cellID) { - wincache_ucache_delete($this->_cachePrefix.$cellID.'.cache'); - } - } // function __destruct() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorageFactory.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorageFactory.php deleted file mode 100644 index d4c947976d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/CachedObjectStorageFactory.php +++ /dev/null @@ -1,131 +0,0 @@ - array( - ), - self::cache_in_memory_gzip => array( - ), - self::cache_in_memory_serialized => array( - ), - self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB' - ), - self::cache_to_discISAM => array( - ), - self::cache_to_apc => array( 'cacheTime' => 600 - ), - self::cache_to_memcache => array( 'memcacheServer' => 'localhost', - 'memcachePort' => 11211, - 'cacheTime' => 600 - ), - self::cache_to_wincache => array( 'cacheTime' => 600 - ) - ); - - - private static $_storageMethodParameters = array(); - - - public static function getCacheStorageMethod() { - if (!is_null(self::$_cacheStorageMethod)) { - return self::$_cacheStorageMethod; - } - return null; - } // function getCacheStorageMethod() - - - public static function getCacheStorageClass() { - if (!is_null(self::$_cacheStorageClass)) { - return self::$_cacheStorageClass; - } - return null; - } // function getCacheStorageClass() - - - public static function getCacheStorageMethods() { - return self::$_storageMethods; - } // function getCacheStorageMethods() - - - public static function initialize($method = self::cache_in_memory, $arguments = array()) { - if (!in_array($method,self::$_storageMethods)) { - return false; - } - - switch($method) { - case self::cache_to_apc : - if (!function_exists('apc_store')) { - return false; - } - if (apc_sma_info() === false) { - return false; - } - break; - case self::cache_to_memcache : - if (!function_exists('memcache_add')) { - return false; - } - break; - case self::cache_to_wincache : - if (!function_exists('wincache_ucache_add')) { - return false; - } - break; - } - - self::$_storageMethodParameters[$method] = self::$_storageMethodDefaultParameters[$method]; - foreach($arguments as $k => $v) { - if (isset(self::$_storageMethodParameters[$method][$k])) { - self::$_storageMethodParameters[$method][$k] = $v; - } - } - - if (is_null(self::$_cacheStorageMethod)) { - self::$_cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method; - self::$_cacheStorageMethod = $method; - } - return true; - } // function initialize() - - - public static function getInstance(PHPExcel_Worksheet $parent) { - if (is_null(self::$_cacheStorageMethod)) { - self::initialize(); - } - - $instance = new self::$_cacheStorageClass($parent,self::$_storageMethodParameters[self::$_cacheStorageMethod]); - if (!is_null($instance)) { - return $instance; - } - - return false; - } // function getInstance() - -} \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation.php deleted file mode 100644 index 0833129cfb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation.php +++ /dev/null @@ -1,3827 +0,0 @@ -=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})'); - // Named Range of cells - define('CALCULATION_REGEXP_NAMEDRANGE','((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)'); - } else { - // Cell reference (cell or range of cells, with or without a sheet reference) - define('CALCULATION_REGEXP_CELLREF','(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)'); - // Named Range of cells - define('CALCULATION_REGEXP_NAMEDRANGE','(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9\.]*)'); - } -} - - -/** - * PHPExcel_Calculation (Singleton) - * - * @category PHPExcel - * @package PHPExcel_Calculation - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Calculation { - - /** Constants */ - /** Regular Expressions */ - // Numeric operand - const CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?'; - // String operand - const CALCULATION_REGEXP_STRING = '"(?:[^"]|"")*"'; - // Opening bracket - const CALCULATION_REGEXP_OPENBRACE = '\('; - // Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it) - const CALCULATION_REGEXP_FUNCTION = '@?([A-Z][A-Z0-9\.]*)[\s]*\('; - // Cell reference (cell or range of cells, with or without a sheet reference) - const CALCULATION_REGEXP_CELLREF = CALCULATION_REGEXP_CELLREF; - // Named Range of cells - const CALCULATION_REGEXP_NAMEDRANGE = CALCULATION_REGEXP_NAMEDRANGE; - // Error - const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?'; - - - /** constants */ - const RETURN_ARRAY_AS_ERROR = 'error'; - const RETURN_ARRAY_AS_VALUE = 'value'; - const RETURN_ARRAY_AS_ARRAY = 'array'; - - private static $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE; - - - /** - * Instance of this class - * - * @access private - * @var PHPExcel_Calculation - */ - private static $_instance; - - - /** - * Calculation cache - * - * @access private - * @var array - */ - private static $_calculationCache = array (); - - - /** - * Calculation cache enabled - * - * @access private - * @var boolean - */ - private static $_calculationCacheEnabled = true; - - - /** - * Calculation cache expiration time - * - * @access private - * @var float - */ - private static $_calculationCacheExpirationTime = 15; - - - /** - * List of operators that can be used within formulae - * The true/false value indicates whether it is a binary operator or a unary operator - * - * @access private - * @var array - */ - private static $_operators = array('+' => true, '-' => true, '*' => true, '/' => true, - '^' => true, '&' => true, '%' => false, '~' => false, - '>' => true, '<' => true, '=' => true, '>=' => true, - '<=' => true, '<>' => true, '|' => true, ':' => true - ); - - - /** - * List of binary operators (those that expect two operands) - * - * @access private - * @var array - */ - private static $_binaryOperators = array('+' => true, '-' => true, '*' => true, '/' => true, - '^' => true, '&' => true, '>' => true, '<' => true, - '=' => true, '>=' => true, '<=' => true, '<>' => true, - '|' => true, ':' => true - ); - - /** - * Flag to determine how formula errors should be handled - * If true, then a user error will be triggered - * If false, then an exception will be thrown - * - * @access public - * @var boolean - * - */ - public $suppressFormulaErrors = false; - - /** - * Error message for any error that was raised/thrown by the calculation engine - * - * @access public - * @var string - * - */ - public $formulaError = null; - - /** - * Flag to determine whether a debug log should be generated by the calculation engine - * If true, then a debug log will be generated - * If false, then a debug log will not be generated - * - * @access public - * @var boolean - * - */ - public $writeDebugLog = false; - - /** - * Flag to determine whether a debug log should be echoed by the calculation engine - * If true, then a debug log will be echoed - * If false, then a debug log will not be echoed - * A debug log can only be echoed if it is generated - * - * @access public - * @var boolean - * - */ - public $echoDebugLog = false; - - - /** - * An array of the nested cell references accessed by the calculation engine, used for the debug log - * - * @access private - * @var array of string - * - */ - private $debugLogStack = array(); - - /** - * The debug log generated by the calculation engine - * - * @access public - * @var array of string - * - */ - public $debugLog = array(); - private $_cyclicFormulaCount = 0; - private $_cyclicFormulaCell = ''; - public $cyclicFormulaCount = 0; - - - private $_savedPrecision = 12; - - - private static $_localeLanguage = 'en_us'; // US English (default locale) - private static $_validLocaleLanguages = array( 'en' // English (default language) - ); - private static $_localeArgumentSeparator = ','; - private static $_localeFunctions = array(); - public static $_localeBoolean = array( 'TRUE' => 'TRUE', - 'FALSE' => 'FALSE', - 'NULL' => 'NULL' - ); - - - // Constant conversion from text name/value to actual (datatyped) value - private static $_ExcelConstants = array('TRUE' => true, - 'FALSE' => false, - 'NULL' => null - ); - - // PHPExcel functions - private static $_PHPExcelFunctions = array( // PHPExcel functions - 'ABS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'abs', - 'argumentCount' => '1' - ), - 'ACCRINT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINT', - 'argumentCount' => '4-7' - ), - 'ACCRINTM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINTM', - 'argumentCount' => '3-5' - ), - 'ACOS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'acos', - 'argumentCount' => '1' - ), - 'ACOSH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'acosh', - 'argumentCount' => '1' - ), - 'ADDRESS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::CELL_ADDRESS', - 'argumentCount' => '2-5' - ), - 'AMORDEGRC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::AMORDEGRC', - 'argumentCount' => '6,7' - ), - 'AMORLINC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::AMORLINC', - 'argumentCount' => '6,7' - ), - 'AND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_AND', - 'argumentCount' => '1+' - ), - 'AREAS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'ASC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'ASIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'asin', - 'argumentCount' => '1' - ), - 'ASINH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'asinh', - 'argumentCount' => '1' - ), - 'ATAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'atan', - 'argumentCount' => '1' - ), - 'ATAN2' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::ATAN2', - 'argumentCount' => '2' - ), - 'ATANH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'atanh', - 'argumentCount' => '1' - ), - 'AVEDEV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::AVEDEV', - 'argumentCount' => '1+' - ), - 'AVERAGE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGE', - 'argumentCount' => '1+' - ), - 'AVERAGEA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEA', - 'argumentCount' => '1+' - ), - 'AVERAGEIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEIF', - 'argumentCount' => '2,3' - ), - 'AVERAGEIFS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3+' - ), - 'BAHTTEXT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'BESSELI' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELI', - 'argumentCount' => '2' - ), - 'BESSELJ' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELJ', - 'argumentCount' => '2' - ), - 'BESSELK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELK', - 'argumentCount' => '2' - ), - 'BESSELY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELY', - 'argumentCount' => '2' - ), - 'BETADIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::BETADIST', - 'argumentCount' => '3-5' - ), - 'BETAINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::BETAINV', - 'argumentCount' => '3-5' - ), - 'BIN2DEC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTODEC', - 'argumentCount' => '1' - ), - 'BIN2HEX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOHEX', - 'argumentCount' => '1,2' - ), - 'BIN2OCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOOCT', - 'argumentCount' => '1,2' - ), - 'BINOMDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::BINOMDIST', - 'argumentCount' => '4' - ), - 'CEILING' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::CEILING', - 'argumentCount' => '2' - ), - 'CELL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1,2' - ), - 'CHAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::CHARACTER', - 'argumentCount' => '1' - ), - 'CHIDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIDIST', - 'argumentCount' => '2' - ), - 'CHIINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIINV', - 'argumentCount' => '2' - ), - 'CHITEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'CHOOSE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::CHOOSE', - 'argumentCount' => '2+' - ), - 'CLEAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMNONPRINTABLE', - 'argumentCount' => '1' - ), - 'CODE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::ASCIICODE', - 'argumentCount' => '1' - ), - 'COLUMN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMN', - 'argumentCount' => '-1', - 'passByReference' => array(true) - ), - 'COLUMNS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMNS', - 'argumentCount' => '1' - ), - 'COMBIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::COMBIN', - 'argumentCount' => '2' - ), - 'COMPLEX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::COMPLEX', - 'argumentCount' => '2,3' - ), - 'CONCATENATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::CONCATENATE', - 'argumentCount' => '1+' - ), - 'CONFIDENCE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CONFIDENCE', - 'argumentCount' => '3' - ), - 'CONVERT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::CONVERTUOM', - 'argumentCount' => '3' - ), - 'CORREL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', - 'argumentCount' => '2' - ), - 'COS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'cos', - 'argumentCount' => '1' - ), - 'COSH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'cosh', - 'argumentCount' => '1' - ), - 'COUNT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNT', - 'argumentCount' => '1+' - ), - 'COUNTA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTA', - 'argumentCount' => '1+' - ), - 'COUNTBLANK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTBLANK', - 'argumentCount' => '1' - ), - 'COUNTIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTIF', - 'argumentCount' => '2' - ), - 'COUNTIFS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'COUPDAYBS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYBS', - 'argumentCount' => '3,4' - ), - 'COUPDAYS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYS', - 'argumentCount' => '3,4' - ), - 'COUPDAYSNC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYSNC', - 'argumentCount' => '3,4' - ), - 'COUPNCD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNCD', - 'argumentCount' => '3,4' - ), - 'COUPNUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNUM', - 'argumentCount' => '3,4' - ), - 'COUPPCD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::COUPPCD', - 'argumentCount' => '3,4' - ), - 'COVAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::COVAR', - 'argumentCount' => '2' - ), - 'CRITBINOM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CRITBINOM', - 'argumentCount' => '3' - ), - 'CUBEKPIMEMBER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBEMEMBER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBEMEMBERPROPERTY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBERANKEDMEMBER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBESET' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBESETCOUNT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUBEVALUE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_CUBE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'CUMIPMT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::CUMIPMT', - 'argumentCount' => '6' - ), - 'CUMPRINC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::CUMPRINC', - 'argumentCount' => '6' - ), - 'DATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DATE', - 'argumentCount' => '3' - ), - 'DATEDIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEDIF', - 'argumentCount' => '2,3' - ), - 'DATEVALUE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEVALUE', - 'argumentCount' => '1' - ), - 'DAVERAGE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3' - ), - 'DAY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFMONTH', - 'argumentCount' => '1' - ), - 'DAYS360' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYS360', - 'argumentCount' => '2,3' - ), - 'DB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::DB', - 'argumentCount' => '4,5' - ), - 'DCOUNT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNT', - 'argumentCount' => '3' - ), - 'DCOUNTA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNTA', - 'argumentCount' => '3' - ), - 'DDB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::DDB', - 'argumentCount' => '4,5' - ), - 'DEC2BIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOBIN', - 'argumentCount' => '1,2' - ), - 'DEC2HEX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOHEX', - 'argumentCount' => '1,2' - ), - 'DEC2OCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOOCT', - 'argumentCount' => '1,2' - ), - 'DEGREES' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'rad2deg', - 'argumentCount' => '1' - ), - 'DELTA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::DELTA', - 'argumentCount' => '1,2' - ), - 'DEVSQ' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::DEVSQ', - 'argumentCount' => '1+' - ), - 'DGET' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DGET', - 'argumentCount' => '3' - ), - 'DISC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::DISC', - 'argumentCount' => '4,5' - ), - 'DMAX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DMAX', - 'argumentCount' => '3' - ), - 'DMIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DMIN', - 'argumentCount' => '3' - ), - 'DOLLAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::DOLLAR', - 'argumentCount' => '1,2' - ), - 'DOLLARDE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARDE', - 'argumentCount' => '2' - ), - 'DOLLARFR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARFR', - 'argumentCount' => '2' - ), - 'DPRODUCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DPRODUCT', - 'argumentCount' => '3' - ), - 'DSTDEV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEV', - 'argumentCount' => '3' - ), - 'DSTDEVP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEVP', - 'argumentCount' => '3' - ), - 'DSUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DSUM', - 'argumentCount' => '3' - ), - 'DURATION' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '5,6' - ), - 'DVAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DVAR', - 'argumentCount' => '3' - ), - 'DVARP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE, - 'functionCall' => 'PHPExcel_Calculation_Database::DVARP', - 'argumentCount' => '3' - ), - 'EDATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::EDATE', - 'argumentCount' => '2' - ), - 'EFFECT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::EFFECT', - 'argumentCount' => '2' - ), - 'EOMONTH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::EOMONTH', - 'argumentCount' => '2' - ), - 'ERF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::ERF', - 'argumentCount' => '1,2' - ), - 'ERFC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::ERFC', - 'argumentCount' => '1' - ), - 'ERROR.TYPE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::ERROR_TYPE', - 'argumentCount' => '1' - ), - 'EVEN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::EVEN', - 'argumentCount' => '1' - ), - 'EXACT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'EXP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'exp', - 'argumentCount' => '1' - ), - 'EXPONDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::EXPONDIST', - 'argumentCount' => '3' - ), - 'FACT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACT', - 'argumentCount' => '1' - ), - 'FACTDOUBLE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACTDOUBLE', - 'argumentCount' => '1' - ), - 'FALSE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::FALSE', - 'argumentCount' => '0' - ), - 'FDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3' - ), - 'FIND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', - 'argumentCount' => '2,3' - ), - 'FINDB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE', - 'argumentCount' => '2,3' - ), - 'FINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3' - ), - 'FISHER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHER', - 'argumentCount' => '1' - ), - 'FISHERINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHERINV', - 'argumentCount' => '1' - ), - 'FIXED' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::FIXEDFORMAT', - 'argumentCount' => '1-3' - ), - 'FLOOR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::FLOOR', - 'argumentCount' => '2' - ), - 'FORECAST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::FORECAST', - 'argumentCount' => '3' - ), - 'FREQUENCY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'FTEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'FV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::FV', - 'argumentCount' => '3-5' - ), - 'FVSCHEDULE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::FVSCHEDULE', - 'argumentCount' => '2' - ), - 'GAMMADIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMADIST', - 'argumentCount' => '4' - ), - 'GAMMAINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMAINV', - 'argumentCount' => '3' - ), - 'GAMMALN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMALN', - 'argumentCount' => '1' - ), - 'GCD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::GCD', - 'argumentCount' => '1+' - ), - 'GEOMEAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::GEOMEAN', - 'argumentCount' => '1+' - ), - 'GESTEP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::GESTEP', - 'argumentCount' => '1,2' - ), - 'GETPIVOTDATA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2+' - ), - 'GROWTH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::GROWTH', - 'argumentCount' => '1-4' - ), - 'HARMEAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::HARMEAN', - 'argumentCount' => '1+' - ), - 'HEX2BIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOBIN', - 'argumentCount' => '1,2' - ), - 'HEX2DEC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTODEC', - 'argumentCount' => '1' - ), - 'HEX2OCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOOCT', - 'argumentCount' => '1,2' - ), - 'HLOOKUP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3,4' - ), - 'HOUR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::HOUROFDAY', - 'argumentCount' => '1' - ), - 'HYPERLINK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::HYPERLINK', - 'argumentCount' => '1,2', - 'passCellReference'=> true - ), - 'HYPGEOMDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::HYPGEOMDIST', - 'argumentCount' => '4' - ), - 'IF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::STATEMENT_IF', - 'argumentCount' => '1-3' - ), - 'IFERROR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::IFERROR', - 'argumentCount' => '2' - ), - 'IMABS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMABS', - 'argumentCount' => '1' - ), - 'IMAGINARY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMAGINARY', - 'argumentCount' => '1' - ), - 'IMARGUMENT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMARGUMENT', - 'argumentCount' => '1' - ), - 'IMCONJUGATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCONJUGATE', - 'argumentCount' => '1' - ), - 'IMCOS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCOS', - 'argumentCount' => '1' - ), - 'IMDIV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMDIV', - 'argumentCount' => '2' - ), - 'IMEXP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMEXP', - 'argumentCount' => '1' - ), - 'IMLN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLN', - 'argumentCount' => '1' - ), - 'IMLOG10' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG10', - 'argumentCount' => '1' - ), - 'IMLOG2' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG2', - 'argumentCount' => '1' - ), - 'IMPOWER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPOWER', - 'argumentCount' => '2' - ), - 'IMPRODUCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPRODUCT', - 'argumentCount' => '1+' - ), - 'IMREAL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMREAL', - 'argumentCount' => '1' - ), - 'IMSIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSIN', - 'argumentCount' => '1' - ), - 'IMSQRT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSQRT', - 'argumentCount' => '1' - ), - 'IMSUB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUB', - 'argumentCount' => '2' - ), - 'IMSUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUM', - 'argumentCount' => '1+' - ), - 'INDEX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDEX', - 'argumentCount' => '1-4' - ), - 'INDIRECT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDIRECT', - 'argumentCount' => '1,2', - 'passCellReference'=> true - ), - 'INFO' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'INT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::INT', - 'argumentCount' => '1' - ), - 'INTERCEPT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::INTERCEPT', - 'argumentCount' => '2' - ), - 'INTRATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::INTRATE', - 'argumentCount' => '4,5' - ), - 'IPMT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::IPMT', - 'argumentCount' => '4-6' - ), - 'IRR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::IRR', - 'argumentCount' => '1,2' - ), - 'ISBLANK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_BLANK', - 'argumentCount' => '1' - ), - 'ISERR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERR', - 'argumentCount' => '1' - ), - 'ISERROR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERROR', - 'argumentCount' => '1' - ), - 'ISEVEN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_EVEN', - 'argumentCount' => '1' - ), - 'ISLOGICAL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_LOGICAL', - 'argumentCount' => '1' - ), - 'ISNA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NA', - 'argumentCount' => '1' - ), - 'ISNONTEXT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NONTEXT', - 'argumentCount' => '1' - ), - 'ISNUMBER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NUMBER', - 'argumentCount' => '1' - ), - 'ISODD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ODD', - 'argumentCount' => '1' - ), - 'ISPMT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::ISPMT', - 'argumentCount' => '4' - ), - 'ISREF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'ISTEXT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::IS_TEXT', - 'argumentCount' => '1' - ), - 'JIS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'KURT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::KURT', - 'argumentCount' => '1+' - ), - 'LARGE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::LARGE', - 'argumentCount' => '2' - ), - 'LCM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::LCM', - 'argumentCount' => '1+' - ), - 'LEFT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', - 'argumentCount' => '1,2' - ), - 'LEFTB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT', - 'argumentCount' => '1,2' - ), - 'LEN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', - 'argumentCount' => '1' - ), - 'LENB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH', - 'argumentCount' => '1' - ), - 'LINEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::LINEST', - 'argumentCount' => '1-4' - ), - 'LN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'log', - 'argumentCount' => '1' - ), - 'LOG' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::LOG_BASE', - 'argumentCount' => '1,2' - ), - 'LOG10' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'log10', - 'argumentCount' => '1' - ), - 'LOGEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGEST', - 'argumentCount' => '1-4' - ), - 'LOGINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGINV', - 'argumentCount' => '3' - ), - 'LOGNORMDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGNORMDIST', - 'argumentCount' => '3' - ), - 'LOOKUP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::LOOKUP', - 'argumentCount' => '2,3' - ), - 'LOWER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::LOWERCASE', - 'argumentCount' => '1' - ), - 'MATCH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::MATCH', - 'argumentCount' => '2,3' - ), - 'MAX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MAX', - 'argumentCount' => '1+' - ), - 'MAXA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXA', - 'argumentCount' => '1+' - ), - 'MAXIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXIF', - 'argumentCount' => '2+' - ), - 'MDETERM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MDETERM', - 'argumentCount' => '1' - ), - 'MDURATION' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '5,6' - ), - 'MEDIAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MEDIAN', - 'argumentCount' => '1+' - ), - 'MEDIANIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2+' - ), - 'MID' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::MID', - 'argumentCount' => '3' - ), - 'MIDB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::MID', - 'argumentCount' => '3' - ), - 'MIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MIN', - 'argumentCount' => '1+' - ), - 'MINA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MINA', - 'argumentCount' => '1+' - ), - 'MINIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MINIF', - 'argumentCount' => '2+' - ), - 'MINUTE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::MINUTEOFHOUR', - 'argumentCount' => '1' - ), - 'MINVERSE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MINVERSE', - 'argumentCount' => '1' - ), - 'MIRR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::MIRR', - 'argumentCount' => '3' - ), - 'MMULT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MMULT', - 'argumentCount' => '2' - ), - 'MOD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MOD', - 'argumentCount' => '2' - ), - 'MODE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::MODE', - 'argumentCount' => '1+' - ), - 'MONTH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::MONTHOFYEAR', - 'argumentCount' => '1' - ), - 'MROUND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MROUND', - 'argumentCount' => '2' - ), - 'MULTINOMIAL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::MULTINOMIAL', - 'argumentCount' => '1+' - ), - 'N' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::N', - 'argumentCount' => '1' - ), - 'NA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::NA', - 'argumentCount' => '0' - ), - 'NEGBINOMDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::NEGBINOMDIST', - 'argumentCount' => '3' - ), - 'NETWORKDAYS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::NETWORKDAYS', - 'argumentCount' => '2+' - ), - 'NOMINAL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::NOMINAL', - 'argumentCount' => '2' - ), - 'NORMDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMDIST', - 'argumentCount' => '4' - ), - 'NORMINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMINV', - 'argumentCount' => '3' - ), - 'NORMSDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSDIST', - 'argumentCount' => '1' - ), - 'NORMSINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSINV', - 'argumentCount' => '1' - ), - 'NOT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::NOT', - 'argumentCount' => '1' - ), - 'NOW' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DATETIMENOW', - 'argumentCount' => '0' - ), - 'NPER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::NPER', - 'argumentCount' => '3-5' - ), - 'NPV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::NPV', - 'argumentCount' => '2+' - ), - 'OCT2BIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOBIN', - 'argumentCount' => '1,2' - ), - 'OCT2DEC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTODEC', - 'argumentCount' => '1' - ), - 'OCT2HEX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING, - 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOHEX', - 'argumentCount' => '1,2' - ), - 'ODD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::ODD', - 'argumentCount' => '1' - ), - 'ODDFPRICE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '8,9' - ), - 'ODDFYIELD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '8,9' - ), - 'ODDLPRICE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '7,8' - ), - 'ODDLYIELD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '7,8' - ), - 'OFFSET' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::OFFSET', - 'argumentCount' => '3,5', - 'passCellReference'=> true, - 'passByReference' => array(true) - ), - 'OR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_OR', - 'argumentCount' => '1+' - ), - 'PEARSON' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL', - 'argumentCount' => '2' - ), - 'PERCENTILE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTILE', - 'argumentCount' => '2' - ), - 'PERCENTRANK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTRANK', - 'argumentCount' => '2,3' - ), - 'PERMUT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::PERMUT', - 'argumentCount' => '2' - ), - 'PHONETIC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'PI' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'pi', - 'argumentCount' => '0' - ), - 'PMT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PMT', - 'argumentCount' => '3-5' - ), - 'POISSON' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::POISSON', - 'argumentCount' => '3' - ), - 'POWER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::POWER', - 'argumentCount' => '2' - ), - 'PPMT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PPMT', - 'argumentCount' => '4-6' - ), - 'PRICE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PRICE', - 'argumentCount' => '6,7' - ), - 'PRICEDISC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEDISC', - 'argumentCount' => '4,5' - ), - 'PRICEMAT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEMAT', - 'argumentCount' => '5,6' - ), - 'PROB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '3,4' - ), - 'PRODUCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::PRODUCT', - 'argumentCount' => '1+' - ), - 'PROPER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::PROPERCASE', - 'argumentCount' => '1' - ), - 'PV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::PV', - 'argumentCount' => '3-5' - ), - 'QUARTILE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::QUARTILE', - 'argumentCount' => '2' - ), - 'QUOTIENT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::QUOTIENT', - 'argumentCount' => '2' - ), - 'RADIANS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'deg2rad', - 'argumentCount' => '1' - ), - 'RAND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', - 'argumentCount' => '0' - ), - 'RANDBETWEEN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND', - 'argumentCount' => '2' - ), - 'RANK' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::RANK', - 'argumentCount' => '2,3' - ), - 'RATE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::RATE', - 'argumentCount' => '3-6' - ), - 'RECEIVED' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::RECEIVED', - 'argumentCount' => '4-5' - ), - 'REPLACE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', - 'argumentCount' => '4' - ), - 'REPLACEB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE', - 'argumentCount' => '4' - ), - 'REPT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'str_repeat', - 'argumentCount' => '2' - ), - 'RIGHT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', - 'argumentCount' => '1,2' - ), - 'RIGHTB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT', - 'argumentCount' => '1,2' - ), - 'ROMAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROMAN', - 'argumentCount' => '1,2' - ), - 'ROUND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'round', - 'argumentCount' => '2' - ), - 'ROUNDDOWN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDDOWN', - 'argumentCount' => '2' - ), - 'ROUNDUP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDUP', - 'argumentCount' => '2' - ), - 'ROW' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROW', - 'argumentCount' => '-1', - 'passByReference' => array(true) - ), - 'ROWS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROWS', - 'argumentCount' => '1' - ), - 'RSQ' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::RSQ', - 'argumentCount' => '2' - ), - 'RTD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1+' - ), - 'SEARCH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', - 'argumentCount' => '2,3' - ), - 'SEARCHB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE', - 'argumentCount' => '2,3' - ), - 'SECOND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::SECONDOFMINUTE', - 'argumentCount' => '1' - ), - 'SERIESSUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SERIESSUM', - 'argumentCount' => '4' - ), - 'SIGN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SIGN', - 'argumentCount' => '1' - ), - 'SIN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'sin', - 'argumentCount' => '1' - ), - 'SINH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'sinh', - 'argumentCount' => '1' - ), - 'SKEW' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::SKEW', - 'argumentCount' => '1+' - ), - 'SLN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::SLN', - 'argumentCount' => '3' - ), - 'SLOPE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::SLOPE', - 'argumentCount' => '2' - ), - 'SMALL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::SMALL', - 'argumentCount' => '2' - ), - 'SQRT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'sqrt', - 'argumentCount' => '1' - ), - 'SQRTPI' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SQRTPI', - 'argumentCount' => '1' - ), - 'STANDARDIZE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STANDARDIZE', - 'argumentCount' => '3' - ), - 'STDEV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEV', - 'argumentCount' => '1+' - ), - 'STDEVA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVA', - 'argumentCount' => '1+' - ), - 'STDEVP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVP', - 'argumentCount' => '1+' - ), - 'STDEVPA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVPA', - 'argumentCount' => '1+' - ), - 'STEYX' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::STEYX', - 'argumentCount' => '2' - ), - 'SUBSTITUTE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::SUBSTITUTE', - 'argumentCount' => '3,4' - ), - 'SUBTOTAL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUBTOTAL', - 'argumentCount' => '2+' - ), - 'SUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUM', - 'argumentCount' => '1+' - ), - 'SUMIF' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMIF', - 'argumentCount' => '2,3' - ), - 'SUMIFS' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '?' - ), - 'SUMPRODUCT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMPRODUCT', - 'argumentCount' => '1+' - ), - 'SUMSQ' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMSQ', - 'argumentCount' => '1+' - ), - 'SUMX2MY2' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2MY2', - 'argumentCount' => '2' - ), - 'SUMX2PY2' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2PY2', - 'argumentCount' => '2' - ), - 'SUMXMY2' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMXMY2', - 'argumentCount' => '2' - ), - 'SYD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::SYD', - 'argumentCount' => '4' - ), - 'T' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::RETURNSTRING', - 'argumentCount' => '1' - ), - 'TAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'tan', - 'argumentCount' => '1' - ), - 'TANH' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'tanh', - 'argumentCount' => '1' - ), - 'TBILLEQ' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLEQ', - 'argumentCount' => '3' - ), - 'TBILLPRICE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLPRICE', - 'argumentCount' => '3' - ), - 'TBILLYIELD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLYIELD', - 'argumentCount' => '3' - ), - 'TDIST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::TDIST', - 'argumentCount' => '3' - ), - 'TEXT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::TEXTFORMAT', - 'argumentCount' => '2' - ), - 'TIME' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::TIME', - 'argumentCount' => '3' - ), - 'TIMEVALUE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::TIMEVALUE', - 'argumentCount' => '1' - ), - 'TINV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::TINV', - 'argumentCount' => '2' - ), - 'TODAY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DATENOW', - 'argumentCount' => '0' - ), - 'TRANSPOSE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::TRANSPOSE', - 'argumentCount' => '1' - ), - 'TREND' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::TREND', - 'argumentCount' => '1-4' - ), - 'TRIM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMSPACES', - 'argumentCount' => '1' - ), - 'TRIMMEAN' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::TRIMMEAN', - 'argumentCount' => '2' - ), - 'TRUE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL, - 'functionCall' => 'PHPExcel_Calculation_Logical::TRUE', - 'argumentCount' => '0' - ), - 'TRUNC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG, - 'functionCall' => 'PHPExcel_Calculation_MathTrig::TRUNC', - 'argumentCount' => '1,2' - ), - 'TTEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '4' - ), - 'TYPE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::TYPE', - 'argumentCount' => '1' - ), - 'UPPER' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_TextData::UPPERCASE', - 'argumentCount' => '1' - ), - 'USDOLLAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '2' - ), - 'VALUE' => array('category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '1' - ), - 'VAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::VARFunc', - 'argumentCount' => '1+' - ), - 'VARA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::VARA', - 'argumentCount' => '1+' - ), - 'VARP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::VARP', - 'argumentCount' => '1+' - ), - 'VARPA' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::VARPA', - 'argumentCount' => '1+' - ), - 'VDB' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '5-7' - ), - 'VERSION' => array('category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION, - 'functionCall' => 'PHPExcel_Calculation_Functions::VERSION', - 'argumentCount' => '0' - ), - 'VLOOKUP' => array('category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE, - 'functionCall' => 'PHPExcel_Calculation_LookupRef::VLOOKUP', - 'argumentCount' => '3,4' - ), - 'WEEKDAY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFWEEK', - 'argumentCount' => '1,2' - ), - 'WEEKNUM' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::WEEKOFYEAR', - 'argumentCount' => '1,2' - ), - 'WEIBULL' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::WEIBULL', - 'argumentCount' => '4' - ), - 'WORKDAY' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::WORKDAY', - 'argumentCount' => '2+' - ), - 'XIRR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::XIRR', - 'argumentCount' => '2,3' - ), - 'XNPV' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::XNPV', - 'argumentCount' => '3' - ), - 'YEAR' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::YEAR', - 'argumentCount' => '1' - ), - 'YEARFRAC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME, - 'functionCall' => 'PHPExcel_Calculation_DateTime::YEARFRAC', - 'argumentCount' => '2,3' - ), - 'YIELD' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY', - 'argumentCount' => '6,7' - ), - 'YIELDDISC' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDDISC', - 'argumentCount' => '4,5' - ), - 'YIELDMAT' => array('category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL, - 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDMAT', - 'argumentCount' => '5,6' - ), - 'ZTEST' => array('category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL, - 'functionCall' => 'PHPExcel_Calculation_Statistical::ZTEST', - 'argumentCount' => '2-3' - ) - ); - - - // Internal functions used for special control purposes - private static $_controlFunctions = array( - 'MKMATRIX' => array('argumentCount' => '*', - 'functionCall' => 'self::_mkMatrix' - ) - ); - - - - - private function __construct() { - $localeFileDirectory = PHPEXCEL_ROOT.'PHPExcel/locale/'; - foreach (glob($localeFileDirectory.'/*',GLOB_ONLYDIR) as $filename) { - $filename = substr($filename,strlen($localeFileDirectory)+1); - if ($filename != 'en') { - self::$_validLocaleLanguages[] = $filename; - } - } - - $setPrecision = (PHP_INT_SIZE == 4) ? 12 : 16; - $this->_savedPrecision = ini_get('precision'); - if ($this->_savedPrecision < $setPrecision) { - ini_set('precision',$setPrecision); - } - } // function __construct() - - - public function __destruct() { - ini_set('precision',$this->_savedPrecision); - } - - /** - * Get an instance of this class - * - * @access public - * @return PHPExcel_Calculation - */ - public static function getInstance() { - if (!isset(self::$_instance) || is_null(self::$_instance)) { - self::$_instance = new PHPExcel_Calculation(); - } - - return self::$_instance; - } // function getInstance() - - - /** - * Flush the calculation cache for any existing instance of this class - * but only if a PHPExcel_Calculation instance exists - * - * @access public - * @return null - */ - public static function flushInstance() { - if (isset(self::$_instance) && !is_null(self::$_instance)) { - self::$_instance->clearCalculationCache(); - } - } // function flushInstance() - - - /** - * __clone implementation. Cloning should not be allowed in a Singleton! - * - * @access public - * @throws Exception - */ - public final function __clone() { - throw new Exception ('Cloning a Singleton is not allowed!'); - } // function __clone() - - - /** - * Return the locale-specific translation of TRUE - * - * @access public - * @return string locale-specific translation of TRUE - */ - public static function getTRUE() { - return self::$_localeBoolean['TRUE']; - } - - /** - * Return the locale-specific translation of FALSE - * - * @access public - * @return string locale-specific translation of FALSE - */ - public static function getFALSE() { - return self::$_localeBoolean['FALSE']; - } - - /** - * Set the Array Return Type (Array or Value of first element in the array) - * - * @access public - * @param string $returnType Array return type - * @return boolean Success or failure - */ - public static function setArrayReturnType($returnType) { - if (($returnType == self::RETURN_ARRAY_AS_VALUE) || - ($returnType == self::RETURN_ARRAY_AS_ERROR) || - ($returnType == self::RETURN_ARRAY_AS_ARRAY)) { - self::$returnArrayAsType = $returnType; - return true; - } - return false; - } // function setExcelCalendar() - - - /** - * Return the Array Return Type (Array or Value of first element in the array) - * - * @access public - * @return string $returnType Array return type - */ - public static function getArrayReturnType() { - return self::$returnArrayAsType; - } // function getExcelCalendar() - - - /** - * Is calculation caching enabled? - * - * @access public - * @return boolean - */ - public function getCalculationCacheEnabled() { - return self::$_calculationCacheEnabled; - } // function getCalculationCacheEnabled() - - - /** - * Enable/disable calculation cache - * - * @access public - * @param boolean $pValue - */ - public function setCalculationCacheEnabled($pValue = true) { - self::$_calculationCacheEnabled = $pValue; - $this->clearCalculationCache(); - } // function setCalculationCacheEnabled() - - - /** - * Enable calculation cache - */ - public function enableCalculationCache() { - $this->setCalculationCacheEnabled(true); - } // function enableCalculationCache() - - - /** - * Disable calculation cache - */ - public function disableCalculationCache() { - $this->setCalculationCacheEnabled(false); - } // function disableCalculationCache() - - - /** - * Clear calculation cache - */ - public function clearCalculationCache() { - self::$_calculationCache = array(); - } // function clearCalculationCache() - - - /** - * Get calculation cache expiration time - * - * @return float - */ - public function getCalculationCacheExpirationTime() { - return self::$_calculationCacheExpirationTime; - } // getCalculationCacheExpirationTime() - - - /** - * Set calculation cache expiration time - * - * @param float $pValue - */ - public function setCalculationCacheExpirationTime($pValue = 15) { - self::$_calculationCacheExpirationTime = $pValue; - } // function setCalculationCacheExpirationTime() - - - - - /** - * Get the currently defined locale code - * - * @return string - */ - public function getLocale() { - return self::$_localeLanguage; - } // function getLocale() - - - /** - * Set the locale code - * - * @return boolean - */ - public function setLocale($locale='en_us') { - // Identify our locale and language - $language = $locale = strtolower($locale); - if (strpos($locale,'_') !== false) { - list($language) = explode('_',$locale); - } - - // Test whether we have any language data for this language (any locale) - if (in_array($language,self::$_validLocaleLanguages)) { - // initialise language/locale settings - self::$_localeFunctions = array(); - self::$_localeArgumentSeparator = ','; - self::$_localeBoolean = array('TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL'); - // Default is English, if user isn't requesting english, then read the necessary data from the locale files - if ($locale != 'en_us') { - // Search for a file with a list of function names for locale - $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel/locale/'.str_replace('_','/',$locale).'/functions'; - if (!file_exists($functionNamesFile)) { - // If there isn't a locale specific function file, look for a language specific function file - $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel/locale/'.$language.'/functions'; - if (!file_exists($functionNamesFile)) { - return false; - } - } - // Retrieve the list of locale or language specific function names - $localeFunctions = file($functionNamesFile,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - foreach ($localeFunctions as $localeFunction) { - list($localeFunction) = explode('##',$localeFunction); // Strip out comments - if (strpos($localeFunction,'=') !== false) { - list($fName,$lfName) = explode('=',$localeFunction); - $fName = trim($fName); - $lfName = trim($lfName); - if ((isset(self::$_PHPExcelFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) { - self::$_localeFunctions[$fName] = $lfName; - } - } - } - // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions - if (isset(self::$_localeFunctions['TRUE'])) { self::$_localeBoolean['TRUE'] = self::$_localeFunctions['TRUE']; } - if (isset(self::$_localeFunctions['FALSE'])) { self::$_localeBoolean['FALSE'] = self::$_localeFunctions['FALSE']; } - - $configFile = PHPEXCEL_ROOT . 'PHPExcel/locale/'.str_replace('_','/',$locale).'/config'; - if (!file_exists($configFile)) { - $configFile = PHPEXCEL_ROOT . 'PHPExcel/locale/'.$language.'/config'; - } - if (file_exists($configFile)) { - $localeSettings = file($configFile,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - foreach ($localeSettings as $localeSetting) { - list($localeSetting) = explode('##',$localeSetting); // Strip out comments - if (strpos($localeSetting,'=') !== false) { - list($settingName,$settingValue) = explode('=',$localeSetting); - $settingName = strtoupper(trim($settingName)); - switch ($settingName) { - case 'ARGUMENTSEPARATOR' : - self::$_localeArgumentSeparator = trim($settingValue); - break; - } - } - } - } - } - - self::$functionReplaceFromExcel = self::$functionReplaceToExcel = - self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null; - self::$_localeLanguage = $locale; - return true; - } - return false; - } // function setLocale() - - - - public static function _translateSeparator($fromSeparator,$toSeparator,$formula,&$inBraces) { - $strlen = mb_strlen($formula); - for ($i = 0; $i < $strlen; ++$i) { - $chr = mb_substr($formula,$i,1); - switch ($chr) { - case '{' : $inBraces = true; - break; - case '}' : $inBraces = false; - break; - case $fromSeparator : - if (!$inBraces) { - $formula = mb_substr($formula,0,$i).$toSeparator.mb_substr($formula,$i+1); - } - } - } - return $formula; - } - - private static function _translateFormula($from,$to,$formula,$fromSeparator,$toSeparator) { - // Convert any Excel function names to the required language - if (self::$_localeLanguage !== 'en_us') { - $inBraces = false; - // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators - if (strpos($formula,'"') !== false) { - // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded - // the formula - $temp = explode('"',$formula); - $i = false; - foreach($temp as &$value) { - // Only count/replace in alternating array entries - if ($i = !$i) { - $value = preg_replace($from,$to,$value); - $value = self::_translateSeparator($fromSeparator,$toSeparator,$value,$inBraces); - } - } - unset($value); - // Then rebuild the formula string - $formula = implode('"',$temp); - } else { - // If there's no quoted strings, then we do a simple count/replace - $formula = preg_replace($from,$to,$formula); - $formula = self::_translateSeparator($fromSeparator,$toSeparator,$formula,$inBraces); - } - } - - return $formula; - } - - private static $functionReplaceFromExcel = null; - private static $functionReplaceToLocale = null; - - public function _translateFormulaToLocale($formula) { - if (is_null(self::$functionReplaceFromExcel)) { - self::$functionReplaceFromExcel = array(); - foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) { - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui'; - } - foreach(array_keys(self::$_localeBoolean) as $excelBoolean) { - self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; - } - - } - - if (is_null(self::$functionReplaceToLocale)) { - self::$functionReplaceToLocale = array(); - foreach(array_values(self::$_localeFunctions) as $localeFunctionName) { - self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2'; - } - foreach(array_values(self::$_localeBoolean) as $localeBoolean) { - self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2'; - } - } - - return self::_translateFormula(self::$functionReplaceFromExcel,self::$functionReplaceToLocale,$formula,',',self::$_localeArgumentSeparator); - } // function _translateFormulaToLocale() - - - private static $functionReplaceFromLocale = null; - private static $functionReplaceToExcel = null; - - public function _translateFormulaToEnglish($formula) { - if (is_null(self::$functionReplaceFromLocale)) { - self::$functionReplaceFromLocale = array(); - foreach(array_values(self::$_localeFunctions) as $localeFunctionName) { - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui'; - } - foreach(array_values(self::$_localeBoolean) as $excelBoolean) { - self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui'; - } - } - - if (is_null(self::$functionReplaceToExcel)) { - self::$functionReplaceToExcel = array(); - foreach(array_keys(self::$_localeFunctions) as $excelFunctionName) { - self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2'; - } - foreach(array_keys(self::$_localeBoolean) as $excelBoolean) { - self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2'; - } - } - - return self::_translateFormula(self::$functionReplaceFromLocale,self::$functionReplaceToExcel,$formula,self::$_localeArgumentSeparator,','); - } // function _translateFormulaToEnglish() - - - public static function _localeFunc($function) { - if (self::$_localeLanguage !== 'en_us') { - $functionName = trim($function,'('); - if (isset(self::$_localeFunctions[$functionName])) { - $brace = ($functionName != $function); - $function = self::$_localeFunctions[$functionName]; - if ($brace) { $function .= '('; } - } - } - return $function; - } - - - - - /** - * Wrap string values in quotes - * - * @param mixed $value - * @return mixed - */ - public static function _wrapResult($value) { - if (is_string($value)) { - // Error values cannot be "wrapped" - if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) { - // Return Excel errors "as is" - return $value; - } - // Return strings wrapped in quotes - return '"'.$value.'"'; - // Convert numeric errors to NaN error - } else if((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return $value; - } // function _wrapResult() - - - /** - * Remove quotes used as a wrapper to identify string values - * - * @param mixed $value - * @return mixed - */ - public static function _unwrapResult($value) { - if (is_string($value)) { - if ((isset($value{0})) && ($value{0} == '"') && (substr($value,-1) == '"')) { - return substr($value,1,-1); - } - // Convert numeric errors to NaN error - } else if((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) { - return PHPExcel_Calculation_Functions::NaN(); - } - return $value; - } // function _unwrapResult() - - - - - /** - * Calculate cell value (using formula from a cell ID) - * Retained for backward compatibility - * - * @access public - * @param PHPExcel_Cell $pCell Cell to calculate - * @return mixed - * @throws Exception - */ - public function calculate(PHPExcel_Cell $pCell = null) { - try { - return $this->calculateCellValue($pCell); - } catch (Exception $e) { - throw(new Exception($e->getMessage())); - } - } // function calculate() - - - /** - * Calculate the value of a cell formula - * - * @access public - * @param PHPExcel_Cell $pCell Cell to calculate - * @param Boolean $resetLog Flag indicating whether the debug log should be reset or not - * @return mixed - * @throws Exception - */ - public function calculateCellValue(PHPExcel_Cell $pCell = null, $resetLog = true) { - if ($resetLog) { - // Initialise the logging settings if requested - $this->formulaError = null; - $this->debugLog = $this->debugLogStack = array(); - $this->_cyclicFormulaCount = 1; - - $returnArrayAsType = self::$returnArrayAsType; - self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY; - } - - // Read the formula from the cell - if (is_null($pCell)) { - return null; - } - - if ($resetLog) { - self::$returnArrayAsType = $returnArrayAsType; - } - // Execute the calculation for the cell formula - try { - $result = self::_unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell)); - } catch (Exception $e) { - throw(new Exception($e->getMessage())); - } - - if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { - $testResult = PHPExcel_Calculation_Functions::flattenArray($result); - if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) { - return PHPExcel_Calculation_Functions::VALUE(); - } - // If there's only a single cell in the array, then we allow it - if (count($testResult) != 1) { - // If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it - $r = array_keys($result); - $r = array_shift($r); - if (!is_numeric($r)) { return PHPExcel_Calculation_Functions::VALUE(); } - if (is_array($result[$r])) { - $c = array_keys($result[$r]); - $c = array_shift($c); - if (!is_numeric($c)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - } - $result = array_shift($testResult); - } - - if (is_null($result)) { - return 0; - } elseif((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) { - return PHPExcel_Calculation_Functions::NaN(); - } - return $result; - } // function calculateCellValue( - - - /** - * Validate and parse a formula string - * - * @param string $formula Formula to parse - * @return array - * @throws Exception - */ - public function parseFormula($formula) { - // Basic validation that this is indeed a formula - // We return an empty array if not - $formula = trim($formula); - if ((!isset($formula{0})) || ($formula{0} != '=')) return array(); - $formula = ltrim(substr($formula,1)); - if (!isset($formula{0})) return array(); - - // Parse the formula and return the token stack - return $this->_parseFormula($formula); - } // function parseFormula() - - - /** - * Calculate the value of a formula - * - * @param string $formula Formula to parse - * @return mixed - * @throws Exception - */ - public function calculateFormula($formula, $cellID=null, PHPExcel_Cell $pCell = null) { - // Initialise the logging settings - $this->formulaError = null; - $this->debugLog = $this->debugLogStack = array(); - - // Disable calculation cacheing because it only applies to cell calculations, not straight formulae - // But don't actually flush any cache - $resetCache = $this->getCalculationCacheEnabled(); - self::$_calculationCacheEnabled = false; - // Execute the calculation - try { - $result = self::_unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell)); - } catch (Exception $e) { - throw(new Exception($e->getMessage())); - } - - // Reset calculation cacheing to its previous state - self::$_calculationCacheEnabled = $resetCache; - - return $result; - } // function calculateFormula() - - - /** - * Parse a cell formula and calculate its value - * - * @param string $formula The formula to parse and calculate - * @param string $cellID The ID (e.g. A3) of the cell that we are calculating - * @param PHPExcel_Cell $pCell Cell to calculate - * @return mixed - * @throws Exception - */ - public function _calculateFormulaValue($formula, $cellID=null, PHPExcel_Cell $pCell = null) { -// echo ''.$cellID.'
      '; - $cellValue = ''; - - // Basic validation that this is indeed a formula - // We simply return the "cell value" (formula) if not - $formula = trim($formula); - if ($formula{0} != '=') return self::_wrapResult($formula); - $formula = ltrim(substr($formula,1)); - if (!isset($formula{0})) return self::_wrapResult($formula); - - $wsTitle = "\x00Wrk"; - if (!is_null($pCell)) { - $pCellParent = $pCell->getParent(); - if (!is_null($pCellParent)) { - $wsTitle = $pCellParent->getTitle(); - } - } - // Is calculation cacheing enabled? - if (!is_null($cellID)) { - if (self::$_calculationCacheEnabled) { - // Is the value present in calculation cache? -// echo 'Testing cache value
      '; - if (isset(self::$_calculationCache[$wsTitle][$cellID])) { -// echo 'Value is in cache
      '; - $this->_writeDebug('Testing cache value for cell '.$cellID); - // Is cache still valid? - if ((microtime(true) - self::$_calculationCache[$wsTitle][$cellID]['time']) < self::$_calculationCacheExpirationTime) { -// echo 'Cache time is still valid
      '; - $this->_writeDebug('Retrieving value for '.$cellID.' from cache'); - // Return the cached result - $returnValue = self::$_calculationCache[$wsTitle][$cellID]['data']; -// echo 'Retrieving data value of '.$returnValue.' for '.$cellID.' from cache
      '; - if (is_array($returnValue)) { - $returnValue = PHPExcel_Calculation_Functions::flattenArray($returnValue); - return array_shift($returnValue); - } - return $returnValue; - } else { -// echo 'Cache has expired
      '; - $this->_writeDebug('Cache value for '.$cellID.' has expired'); - // Clear the cache if it's no longer valid - unset(self::$_calculationCache[$wsTitle][$cellID]); - } - } - } - } - - if ((in_array($wsTitle.'!'.$cellID,$this->debugLogStack)) && ($wsTitle != "\x00Wrk")) { - if ($this->cyclicFormulaCount <= 0) { - return $this->_raiseFormulaError('Cyclic Reference in Formula'); - } elseif (($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) && - ($this->_cyclicFormulaCell == $wsTitle.'!'.$cellID)) { - return $cellValue; - } elseif ($this->_cyclicFormulaCell == $wsTitle.'!'.$cellID) { - ++$this->_cyclicFormulaCount; - if ($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) { - return $cellValue; - } - } elseif ($this->_cyclicFormulaCell == '') { - $this->_cyclicFormulaCell = $wsTitle.'!'.$cellID; - if ($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) { - return $cellValue; - } - } - } - $this->debugLogStack[] = $wsTitle.'!'.$cellID; - // Parse the formula onto the token stack and calculate the value - $cellValue = $this->_processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell); - array_pop($this->debugLogStack); - - // Save to calculation cache - if (!is_null($cellID)) { - if (self::$_calculationCacheEnabled) { - self::$_calculationCache[$wsTitle][$cellID]['time'] = microtime(true); - self::$_calculationCache[$wsTitle][$cellID]['data'] = $cellValue; - } - } - - // Return the calculated value - return $cellValue; - } // function _calculateFormulaValue() - - - /** - * Ensure that paired matrix operands are both matrices and of the same size - * - * @param mixed &$operand1 First matrix operand - * @param mixed &$operand2 Second matrix operand - * @param integer $resize Flag indicating whether the matrices should be resized to match - * and (if so), whether the smaller dimension should grow or the - * larger should shrink. - * 0 = no resize - * 1 = shrink to fit - * 2 = extend to fit - */ - private static function _checkMatrixOperands(&$operand1,&$operand2,$resize = 1) { - // Examine each of the two operands, and turn them into an array if they aren't one already - // Note that this function should only be called if one or both of the operand is already an array - if (!is_array($operand1)) { - list($matrixRows,$matrixColumns) = self::_getMatrixDimensions($operand2); - $operand1 = array_fill(0,$matrixRows,array_fill(0,$matrixColumns,$operand1)); - $resize = 0; - } elseif (!is_array($operand2)) { - list($matrixRows,$matrixColumns) = self::_getMatrixDimensions($operand1); - $operand2 = array_fill(0,$matrixRows,array_fill(0,$matrixColumns,$operand2)); - $resize = 0; - } - - list($matrix1Rows,$matrix1Columns) = self::_getMatrixDimensions($operand1); - list($matrix2Rows,$matrix2Columns) = self::_getMatrixDimensions($operand2); - if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) { - $resize = 1; - } - - if ($resize == 2) { - // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger - self::_resizeMatricesExtend($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns); - } elseif ($resize == 1) { - // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller - self::_resizeMatricesShrink($operand1,$operand2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns); - } - return array( $matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns); - } // function _checkMatrixOperands() - - - /** - * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0 - * - * @param mixed &$matrix matrix operand - * @return array An array comprising the number of rows, and number of columns - */ - public static function _getMatrixDimensions(&$matrix) { - $matrixRows = count($matrix); - $matrixColumns = 0; - foreach($matrix as $rowKey => $rowValue) { - $matrixColumns = max(count($rowValue),$matrixColumns); - if (!is_array($rowValue)) { - $matrix[$rowKey] = array($rowValue); - } else { - $matrix[$rowKey] = array_values($rowValue); - } - } - $matrix = array_values($matrix); - return array($matrixRows,$matrixColumns); - } // function _getMatrixDimensions() - - - /** - * Ensure that paired matrix operands are both matrices of the same size - * - * @param mixed &$matrix1 First matrix operand - * @param mixed &$matrix2 Second matrix operand - */ - private static function _resizeMatricesShrink(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) { - if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { - if ($matrix2Columns < $matrix1Columns) { - for ($i = 0; $i < $matrix1Rows; ++$i) { - for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) { - unset($matrix1[$i][$j]); - } - } - } - if ($matrix2Rows < $matrix1Rows) { - for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) { - unset($matrix1[$i]); - } - } - } - - if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) { - if ($matrix1Columns < $matrix2Columns) { - for ($i = 0; $i < $matrix2Rows; ++$i) { - for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) { - unset($matrix2[$i][$j]); - } - } - } - if ($matrix1Rows < $matrix2Rows) { - for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) { - unset($matrix2[$i]); - } - } - } - } // function _resizeMatricesShrink() - - - /** - * Ensure that paired matrix operands are both matrices of the same size - * - * @param mixed &$matrix1 First matrix operand - * @param mixed &$matrix2 Second matrix operand - */ - private static function _resizeMatricesExtend(&$matrix1,&$matrix2,$matrix1Rows,$matrix1Columns,$matrix2Rows,$matrix2Columns) { - if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) { - if ($matrix2Columns < $matrix1Columns) { - for ($i = 0; $i < $matrix2Rows; ++$i) { - $x = $matrix2[$i][$matrix2Columns-1]; - for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) { - $matrix2[$i][$j] = $x; - } - } - } - if ($matrix2Rows < $matrix1Rows) { - $x = $matrix2[$matrix2Rows-1]; - for ($i = 0; $i < $matrix1Rows; ++$i) { - $matrix2[$i] = $x; - } - } - } - - if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) { - if ($matrix1Columns < $matrix2Columns) { - for ($i = 0; $i < $matrix1Rows; ++$i) { - $x = $matrix1[$i][$matrix1Columns-1]; - for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) { - $matrix1[$i][$j] = $x; - } - } - } - if ($matrix1Rows < $matrix2Rows) { - $x = $matrix1[$matrix1Rows-1]; - for ($i = 0; $i < $matrix2Rows; ++$i) { - $matrix1[$i] = $x; - } - } - } - } // function _resizeMatricesExtend() - - - /** - * Format details of an operand for display in the log (based on operand type) - * - * @param mixed $value First matrix operand - * @return mixed - */ - private function _showValue($value) { - if ($this->writeDebugLog) { - $testArray = PHPExcel_Calculation_Functions::flattenArray($value); - if (count($testArray) == 1) { - $value = array_pop($testArray); - } - - if (is_array($value)) { - $returnMatrix = array(); - $pad = $rpad = ', '; - foreach($value as $row) { - if (is_array($row)) { - $returnMatrix[] = implode($pad,$row); - $rpad = '; '; - } else { - $returnMatrix[] = $row; - } - } - return '{ '.implode($rpad,$returnMatrix).' }'; - } elseif(is_bool($value)) { - return ($value) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE']; - } - } - return $value; - } // function _showValue() - - - /** - * Format type and details of an operand for display in the log (based on operand type) - * - * @param mixed $value First matrix operand - * @return mixed - */ - private function _showTypeDetails($value) { - if ($this->writeDebugLog) { - $testArray = PHPExcel_Calculation_Functions::flattenArray($value); - if (count($testArray) == 1) { - $value = array_pop($testArray); - } - - if (is_null($value)) { - return 'a null value'; - } elseif (is_float($value)) { - $typeString = 'a floating point number'; - } elseif(is_int($value)) { - $typeString = 'an integer number'; - } elseif(is_bool($value)) { - $typeString = 'a boolean'; - } elseif(is_array($value)) { - $typeString = 'a matrix'; - } else { - if ($value == '') { - return 'an empty string'; - } elseif ($value{0} == '#') { - return 'a '.$value.' error'; - } else { - $typeString = 'a string'; - } - } - return $typeString.' with a value of '.$this->_showValue($value); - } - } // function _showTypeDetails() - - - private static function _convertMatrixReferences($formula) { - static $matrixReplaceFrom = array('{',';','}'); - static $matrixReplaceTo = array('MKMATRIX(MKMATRIX(','),MKMATRIX(','))'); - - // Convert any Excel matrix references to the MKMATRIX() function - if (strpos($formula,'{') !== false) { - // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators - if (strpos($formula,'"') !== false) { - // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded - // the formula - $temp = explode('"',$formula); - // Open and Closed counts used for trapping mismatched braces in the formula - $openCount = $closeCount = 0; - $i = false; - foreach($temp as &$value) { - // Only count/replace in alternating array entries - if ($i = !$i) { - $openCount += substr_count($value,'{'); - $closeCount += substr_count($value,'}'); - $value = str_replace($matrixReplaceFrom,$matrixReplaceTo,$value); - } - } - unset($value); - // Then rebuild the formula string - $formula = implode('"',$temp); - } else { - // If there's no quoted strings, then we do a simple count/replace - $openCount = substr_count($formula,'{'); - $closeCount = substr_count($formula,'}'); - $formula = str_replace($matrixReplaceFrom,$matrixReplaceTo,$formula); - } - // Trap for mismatched braces and trigger an appropriate error - if ($openCount < $closeCount) { - if ($openCount > 0) { - return $this->_raiseFormulaError("Formula Error: Mismatched matrix braces '}'"); - } else { - return $this->_raiseFormulaError("Formula Error: Unexpected '}' encountered"); - } - } elseif ($openCount > $closeCount) { - if ($closeCount > 0) { - return $this->_raiseFormulaError("Formula Error: Mismatched matrix braces '{'"); - } else { - return $this->_raiseFormulaError("Formula Error: Unexpected '{' encountered"); - } - } - } - - return $formula; - } // function _convertMatrixReferences() - - - private static function _mkMatrix() { - return func_get_args(); - } // function _mkMatrix() - - - // Convert infix to postfix notation - private function _parseFormula($formula, PHPExcel_Cell $pCell = null) { - if (($formula = self::_convertMatrixReferences(trim($formula))) === false) { - return false; - } - - // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet), - // so we store the parent worksheet so that we can re-attach it when necessary - $pCellParent = (!is_null($pCell)) ? $pCell->getParent() : null; - - // Binary Operators - // These operators always work on two values - // Array key is the operator, the value indicates whether this is a left or right associative operator - $operatorAssociativity = array('^' => 0, // Exponentiation - '*' => 0, '/' => 0, // Multiplication and Division - '+' => 0, '-' => 0, // Addition and Subtraction - '&' => 0, // Concatenation - '|' => 0, ':' => 0, // Intersect and Range - '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison - ); - // Comparison (Boolean) Operators - // These operators work on two values, but always return a boolean result - $comparisonOperators = array('>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true); - - // Operator Precedence - // This list includes all valid operators, whether binary (including boolean) or unary (such as %) - // Array key is the operator, the value is its precedence - $operatorPrecedence = array(':' => 8, // Range - '|' => 7, // Intersect - '~' => 6, // Negation - '%' => 5, // Percentage - '^' => 4, // Exponentiation - '*' => 3, '/' => 3, // Multiplication and Division - '+' => 2, '-' => 2, // Addition and Subtraction - '&' => 1, // Concatenation - '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison - ); - - $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION. - '|'.self::CALCULATION_REGEXP_NUMBER. - '|'.self::CALCULATION_REGEXP_STRING. - '|'.self::CALCULATION_REGEXP_OPENBRACE. - '|'.self::CALCULATION_REGEXP_CELLREF. - '|'.self::CALCULATION_REGEXP_NAMEDRANGE. - '|'.self::CALCULATION_REGEXP_ERROR. - ')/si'; - - // Start with initialisation - $index = 0; - $stack = new PHPExcel_Token_Stack; - $output = array(); - $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a - // - is a negation or + is a positive operator rather than an operation - $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand - // should be null in a function call - // The guts of the lexical parser - // Loop through the formula extracting each operator and operand in turn - while(true) { -// echo 'Assessing Expression '.substr($formula, $index).'
      '; - $opCharacter = $formula{$index}; // Get the first character of the value at the current index position -// echo 'Initial character of expression block is '.$opCharacter.'
      '; - if ((isset($comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset($comparisonOperators[$formula{$index+1}]))) { - $opCharacter .= $formula{++$index}; -// echo 'Initial character of expression block is comparison operator '.$opCharacter.'
      '; - } - - // Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand - $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match); -// echo '$isOperandOrFunction is '.(($isOperandOrFunction) ? 'True' : 'False').'
      '; -// var_dump($match); - - if ($opCharacter == '-' && !$expectingOperator) { // Is it a negation instead of a minus? -// echo 'Element is a Negation operator
      '; - $stack->push('Unary Operator','~'); // Put a negation on the stack - ++$index; // and drop the negation symbol - } elseif ($opCharacter == '%' && $expectingOperator) { -// echo 'Element is a Percentage operator
      '; - $stack->push('Unary Operator','%'); // Put a percentage on the stack - ++$index; - } elseif ($opCharacter == '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded? -// echo 'Element is a Positive number, not Plus operator
      '; - ++$index; // Drop the redundant plus symbol - } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) { // We have to explicitly deny a tilde or pipe, because they are legal - return $this->_raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression - - } elseif ((isset(self::$_operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack? -// echo 'Element with value '.$opCharacter.' is an Operator
      '; - while($stack->count() > 0 && - ($o2 = $stack->last()) && - isset(self::$_operators[$o2['value']]) && - @($operatorAssociativity[$opCharacter] ? $operatorPrecedence[$opCharacter] < $operatorPrecedence[$o2['value']] : $operatorPrecedence[$opCharacter] <= $operatorPrecedence[$o2['value']])) { - $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output - } - $stack->push('Binary Operator',$opCharacter); // Finally put our current operator onto the stack - ++$index; - $expectingOperator = false; - - } elseif ($opCharacter == ')' && $expectingOperator) { // Are we expecting to close a parenthesis? -// echo 'Element is a Closing bracket
      '; - $expectingOperand = false; - while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( - if (is_null($o2)) return $this->_raiseFormulaError('Formula Error: Unexpected closing brace ")"'); - else $output[] = $o2; - } - $d = $stack->last(2); - if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function? - $functionName = $matches[1]; // Get the function name -// echo 'Closed Function is '.$functionName.'
      '; - $d = $stack->pop(); - $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack) -// if ($argumentCount == 0) { -// echo 'With no arguments
      '; -// } elseif ($argumentCount == 1) { -// echo 'With 1 argument
      '; -// } else { -// echo 'With '.$argumentCount.' arguments
      '; -// } - $output[] = $d; // Dump the argument count on the output - $output[] = $stack->pop(); // Pop the function and push onto the output - if (isset(self::$_controlFunctions[$functionName])) { -// echo 'Built-in function '.$functionName.'
      '; - $expectedArgumentCount = self::$_controlFunctions[$functionName]['argumentCount']; - $functionCall = self::$_controlFunctions[$functionName]['functionCall']; - } elseif (isset(self::$_PHPExcelFunctions[$functionName])) { -// echo 'PHPExcel function '.$functionName.'
      '; - $expectedArgumentCount = self::$_PHPExcelFunctions[$functionName]['argumentCount']; - $functionCall = self::$_PHPExcelFunctions[$functionName]['functionCall']; - } else { // did we somehow push a non-function on the stack? this should never happen - return $this->_raiseFormulaError("Formula Error: Internal error, non-function on stack"); - } - // Check the argument count - $argumentCountError = false; - if (is_numeric($expectedArgumentCount)) { - if ($expectedArgumentCount < 0) { -// echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount).'
      '; - if ($argumentCount > abs($expectedArgumentCount)) { - $argumentCountError = true; - $expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount); - } - } else { -// echo '$expectedArgumentCount is numeric '.$expectedArgumentCount.'
      '; - if ($argumentCount != $expectedArgumentCount) { - $argumentCountError = true; - $expectedArgumentCountString = $expectedArgumentCount; - } - } - } elseif ($expectedArgumentCount != '*') { - $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/',$expectedArgumentCount,$argMatch); -// print_r($argMatch); -// echo '
      '; - switch ($argMatch[2]) { - case '+' : - if ($argumentCount < $argMatch[1]) { - $argumentCountError = true; - $expectedArgumentCountString = $argMatch[1].' or more '; - } - break; - case '-' : - if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) { - $argumentCountError = true; - $expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3]; - } - break; - case ',' : - if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) { - $argumentCountError = true; - $expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3]; - } - break; - } - } - if ($argumentCountError) { - return $this->_raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString." expected"); - } - } - ++$index; - - } elseif ($opCharacter == ',') { // Is this the separator for function arguments? -// echo 'Element is a Function argument separator
      '; - while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last ( - if (is_null($o2)) return $this->_raiseFormulaError("Formula Error: Unexpected ,"); - else $output[] = $o2; // pop the argument expression stuff and push onto the output - } - // If we've a comma when we're expecting an operand, then what we actually have is a null operand; - // so push a null onto the stack - if (($expectingOperand) || (!$expectingOperator)) { - $output[] = array('type' => 'NULL Value', 'value' => self::$_ExcelConstants['NULL'], 'reference' => null); - } - // make sure there was a function - $d = $stack->last(2); - if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) - return $this->_raiseFormulaError("Formula Error: Unexpected ,"); - $d = $stack->pop(); - $stack->push($d['type'],++$d['value'],$d['reference']); // increment the argument count - $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again - $expectingOperator = false; - $expectingOperand = true; - ++$index; - - } elseif ($opCharacter == '(' && !$expectingOperator) { -// echo 'Element is an Opening Bracket
      '; - $stack->push('Brace', '('); - ++$index; - - } elseif ($isOperandOrFunction && !$expectingOperator) { // do we now have a function/variable/number? - $expectingOperator = true; - $expectingOperand = false; - $val = $match[1]; - $length = strlen($val); -// echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function
      '; - - if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) { - $val = preg_replace('/\s/','',$val); -// echo 'Element '.$val.' is a Function
      '; - if (isset(self::$_PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$_controlFunctions[strtoupper($matches[1])])) { // it's a function - $stack->push('Function', strtoupper($val)); - $ax = preg_match('/^\s*(\s*\))/i', substr($formula, $index+$length), $amatch); - if ($ax) { - $stack->push('Operand Count for Function '.self::_localeFunc(strtoupper($val)).')', 0); - $expectingOperator = true; - } else { - $stack->push('Operand Count for Function '.self::_localeFunc(strtoupper($val)).')', 1); - $expectingOperator = false; - } - $stack->push('Brace', '('); - } else { // it's a var w/ implicit multiplication - $output[] = array('type' => 'Value', 'value' => $matches[1], 'reference' => null); - } - } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) { -// echo 'Element '.$val.' is a Cell reference
      '; - // Watch for this case-change when modifying to allow cell references in different worksheets... - // Should only be applied to the actual cell column, not the worksheet name - - // If the last entry on the stack was a : operator, then we have a cell range reference - $testPrevOp = $stack->last(1); - if ($testPrevOp['value'] == ':') { - // If we have a worksheet reference, then we're playing with a 3D reference - if ($matches[2] == '') { - // Otherwise, we 'inherit' the worksheet reference from the start cell reference - // The start of the cell range reference should be the last entry in $output - $startCellRef = $output[count($output)-1]['value']; - preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches); - if ($startMatches[2] > '') { - $val = $startMatches[2].'!'.$val; - } - } else { - return $this->_raiseFormulaError("3D Range references are not yet supported"); - } - } - - $output[] = array('type' => 'Cell Reference', 'value' => $val, 'reference' => $val); -// $expectingOperator = false; - } else { // it's a variable, constant, string, number or boolean -// echo 'Element is a Variable, Constant, String, Number or Boolean
      '; - // If the last entry on the stack was a : operator, then we may have a row or column range reference - $testPrevOp = $stack->last(1); - if ($testPrevOp['value'] == ':') { - $startRowColRef = $output[count($output)-1]['value']; - $rangeWS1 = ''; - if (strpos('!',$startRowColRef) !== false) { - list($rangeWS1,$startRowColRef) = explode('!',$startRowColRef); - } - if ($rangeWS1 != '') $rangeWS1 .= '!'; - $rangeWS2 = $rangeWS1; - if (strpos('!',$val) !== false) { - list($rangeWS2,$val) = explode('!',$val); - } - if ($rangeWS2 != '') $rangeWS2 .= '!'; - if ((is_integer($startRowColRef)) && (ctype_digit($val)) && - ($startRowColRef <= 1048576) && ($val <= 1048576)) { - // Row range - $endRowColRef = (!is_null($pCellParent)) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007 - $output[count($output)-1]['value'] = $rangeWS1.'A'.$startRowColRef; - $val = $rangeWS2.$endRowColRef.$val; - } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) && - (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) { - // Column range - $endRowColRef = (!is_null($pCellParent)) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007 - $output[count($output)-1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1'; - $val = $rangeWS2.$val.$endRowColRef; - } - } - - $localeConstant = false; - if ($opCharacter == '"') { -// echo 'Element is a String
      '; - // UnEscape any quotes within the string - $val = self::_wrapResult(str_replace('""','"',self::_unwrapResult($val))); - } elseif (is_numeric($val)) { -// echo 'Element is a Number
      '; - if ((strpos($val,'.') !== false) || (stripos($val,'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) { -// echo 'Casting '.$val.' to float
      '; - $val = (float) $val; - } else { -// echo 'Casting '.$val.' to integer
      '; - $val = (integer) $val; - } - } elseif (isset(self::$_ExcelConstants[trim(strtoupper($val))])) { - $excelConstant = trim(strtoupper($val)); -// echo 'Element '.$excelConstant.' is an Excel Constant
      '; - $val = self::$_ExcelConstants[$excelConstant]; - } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$_localeBoolean)) !== false) { -// echo 'Element '.$localeConstant.' is an Excel Constant
      '; - $val = self::$_ExcelConstants[$localeConstant]; - } - $details = array('type' => 'Value', 'value' => $val, 'reference' => null); - if ($localeConstant) { $details['localeValue'] = $localeConstant; } - $output[] = $details; - } - $index += $length; - - } elseif ($opCharacter == '$') { // absolute row or column range - ++$index; - } elseif ($opCharacter == ')') { // miscellaneous error checking - if ($expectingOperand) { - $output[] = array('type' => 'Null Value', 'value' => self::$_ExcelConstants['NULL'], 'reference' => null); - $expectingOperand = false; - $expectingOperator = true; - } else { - return $this->_raiseFormulaError("Formula Error: Unexpected ')'"); - } - } elseif (isset(self::$_operators[$opCharacter]) && !$expectingOperator) { - return $this->_raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'"); - } else { // I don't even want to know what you did to get here - return $this->_raiseFormulaError("Formula Error: An unexpected error occured"); - } - // Test for end of formula string - if ($index == strlen($formula)) { - // Did we end with an operator?. - // Only valid for the % unary operator - if ((isset(self::$_operators[$opCharacter])) && ($opCharacter != '%')) { - return $this->_raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands"); - } else { - break; - } - } - // Ignore white space - while (($formula{$index} == "\n") || ($formula{$index} == "\r")) { - ++$index; - } - if ($formula{$index} == ' ') { - while ($formula{$index} == ' ') { - ++$index; - } - // If we're expecting an operator, but only have a space between the previous and next operands (and both are - // Cell References) then we have an INTERSECTION operator -// echo 'Possible Intersect Operator
      '; - if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) && - ($output[count($output)-1]['type'] == 'Cell Reference')) { -// echo 'Element is an Intersect Operator
      '; - while($stack->count() > 0 && - ($o2 = $stack->last()) && - isset(self::$_operators[$o2['value']]) && - @($operatorAssociativity[$opCharacter] ? $operatorPrecedence[$opCharacter] < $operatorPrecedence[$o2['value']] : $operatorPrecedence[$opCharacter] <= $operatorPrecedence[$o2['value']])) { - $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output - } - $stack->push('Binary Operator','|'); // Put an Intersect Operator on the stack - $expectingOperator = false; - } - } - } - - while (!is_null($op = $stack->pop())) { // pop everything off the stack and push onto output - if ($opCharacter['value'] == '(') return $this->_raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced - $output[] = $op; - } - return $output; - } // function _parseFormula() - - - // evaluate postfix notation - private function _processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null) { - if ($tokens == false) return false; - - // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet), - // so we store the parent worksheet so that we can re-attach it when necessary - $pCellParent = (!is_null($pCell)) ? $pCell->getParent() : null; - $stack = new PHPExcel_Token_Stack; - - // Loop through each token in turn - foreach ($tokens as $tokenData) { -// print_r($tokenData); -// echo '
      '; - $token = $tokenData['value']; -// echo 'Token is '.$token.'
      '; - // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack - if (isset(self::$_binaryOperators[$token])) { -// echo 'Token is a binary operator
      '; - // We must have two operands, error if we don't - if (is_null($operand2Data = $stack->pop())) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); - if (is_null($operand1Data = $stack->pop())) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); - // Log what we're doing - $operand1 = $operand1Data['value']; - $operand2 = $operand2Data['value']; - if ($token == ':') { - $this->_writeDebug('Evaluating Range '.$this->_showValue($operand1Data['reference']).$token.$this->_showValue($operand2Data['reference'])); - } else { - $this->_writeDebug('Evaluating '.$this->_showValue($operand1).' '.$token.' '.$this->_showValue($operand2)); - } - // Process the operation in the appropriate manner - switch ($token) { - // Comparison (Boolean) Operators - case '>' : // Greater than - case '<' : // Less than - case '>=' : // Greater than or Equal to - case '<=' : // Less than or Equal to - case '=' : // Equality - case '<>' : // Inequality - $this->_executeBinaryComparisonOperation($cellID,$operand1,$operand2,$token,$stack); - break; - // Binary Operators - case ':' : // Range - $sheet1 = $sheet2 = ''; - if (strpos($operand1Data['reference'],'!') !== false) { - list($sheet1,$operand1Data['reference']) = explode('!',$operand1Data['reference']); - } else { - $sheet1 = (!is_null($pCellParent)) ? $pCellParent->getTitle() : ''; - } - if (strpos($operand2Data['reference'],'!') !== false) { - list($sheet2,$operand2Data['reference']) = explode('!',$operand2Data['reference']); - } else { - $sheet2 = $sheet1; - } - if ($sheet1 == $sheet2) { - if (is_null($operand1Data['reference'])) { - if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) { - $operand1Data['reference'] = $pCell->getColumn().$operand1Data['value']; - } elseif (trim($operand1Data['reference']) == '') { - $operand1Data['reference'] = $pCell->getCoordinate(); - } else { - $operand1Data['reference'] = $operand1Data['value'].$pCell->getRow(); - } - } - if (is_null($operand2Data['reference'])) { - if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) { - $operand2Data['reference'] = $pCell->getColumn().$operand2Data['value']; - } elseif (trim($operand2Data['reference']) == '') { - $operand2Data['reference'] = $pCell->getCoordinate(); - } else { - $operand2Data['reference'] = $operand2Data['value'].$pCell->getRow(); - } - } - - $oData = array_merge(explode(':',$operand1Data['reference']),explode(':',$operand2Data['reference'])); - $oCol = $oRow = array(); - foreach($oData as $oDatum) { - $oCR = PHPExcel_Cell::coordinateFromString($oDatum); - $oCol[] = PHPExcel_Cell::columnIndexFromString($oCR[0]) - 1; - $oRow[] = $oCR[1]; - } - $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow); - if (!is_null($pCellParent)) { - $cellValue = $this->extractCellRange($cellRef, $pCellParent->getParent()->getSheetByName($sheet1), false); - } else { - return $this->_raiseFormulaError('Unable to access Cell Reference'); - } - $stack->push('Cell Reference',$cellValue,$cellRef); - } else { - $stack->push('Error',PHPExcel_Calculation_Functions::REF(),null); - } - - break; - case '+' : // Addition - $this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'plusEquals',$stack); - break; - case '-' : // Subtraction - $this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'minusEquals',$stack); - break; - case '*' : // Multiplication - $this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'arrayTimesEquals',$stack); - break; - case '/' : // Division - $this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'arrayRightDivide',$stack); - break; - case '^' : // Exponential - $this->_executeNumericBinaryOperation($cellID,$operand1,$operand2,$token,'power',$stack); - break; - case '&' : // Concatenation - // If either of the operands is a matrix, we need to treat them both as matrices - // (converting the other operand to a matrix if need be); then perform the required - // matrix operation - if (is_bool($operand1)) { - $operand1 = ($operand1) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE']; - } - if (is_bool($operand2)) { - $operand2 = ($operand2) ? self::$_localeBoolean['TRUE'] : self::$_localeBoolean['FALSE']; - } - if ((is_array($operand1)) || (is_array($operand2))) { - // Ensure that both operands are arrays/matrices - self::_checkMatrixOperands($operand1,$operand2,2); - try { - // Convert operand 1 from a PHP array to a matrix - $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1); - // Perform the required operation against the operand 1 matrix, passing in operand 2 - $matrixResult = $matrix->concat($operand2); - $result = $matrixResult->getArray(); - } catch (Exception $ex) { - $this->_writeDebug('JAMA Matrix Exception: '.$ex->getMessage()); - $result = '#VALUE!'; - } - } else { - $result = '"'.str_replace('""','"',self::_unwrapResult($operand1,'"').self::_unwrapResult($operand2,'"')).'"'; - } - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($result)); - $stack->push('Value',$result); - break; - case '|' : // Intersect - $rowIntersect = array_intersect_key($operand1,$operand2); - $cellIntersect = $oCol = $oRow = array(); - foreach(array_keys($rowIntersect) as $row) { - $oRow[] = $row; - foreach($rowIntersect[$row] as $col => $data) { - $oCol[] = PHPExcel_Cell::columnIndexFromString($col) - 1; - $cellIntersect[$row] = array_intersect_key($operand1[$row],$operand2[$row]); - } - } - $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow); - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($cellIntersect)); - $stack->push('Value',$cellIntersect,$cellRef); - break; - } - - // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on - } elseif (($token === '~') || ($token === '%')) { -// echo 'Token is a unary operator
      '; - if (is_null($arg = $stack->pop())) return $this->_raiseFormulaError('Internal error - Operand value missing from stack'); - $arg = $arg['value']; - if ($token === '~') { -// echo 'Token is a negation operator
      '; - $this->_writeDebug('Evaluating Negation of '.$this->_showValue($arg)); - $multiplier = -1; - } else { -// echo 'Token is a percentile operator
      '; - $this->_writeDebug('Evaluating Percentile of '.$this->_showValue($arg)); - $multiplier = 0.01; - } - if (is_array($arg)) { - self::_checkMatrixOperands($arg,$multiplier,2); - try { - $matrix1 = new PHPExcel_Shared_JAMA_Matrix($arg); - $matrixResult = $matrix1->arrayTimesEquals($multiplier); - $result = $matrixResult->getArray(); - } catch (Exception $ex) { - $this->_writeDebug('JAMA Matrix Exception: '.$ex->getMessage()); - $result = '#VALUE!'; - } - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($result)); - $stack->push('Value',$result); - } else { - $this->_executeNumericBinaryOperation($cellID,$multiplier,$arg,'*','arrayTimesEquals',$stack); - } - - } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) { - $cellRef = null; -// echo 'Element '.$token.' is a Cell reference
      '; - if (isset($matches[8])) { -// echo 'Reference is a Range of cells
      '; - if (is_null($pCell)) { -// We can't access the range, so return a REF error - $cellValue = PHPExcel_Calculation_Functions::REF(); - } else { - $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10]; - if ($matches[2] > '') { - $matches[2] = trim($matches[2],"\"'"); -// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
      '; - $this->_writeDebug('Evaluating Cell Range '.$cellRef.' in worksheet '.$matches[2]); - if (!is_null($pCellParent)) { - $cellValue = $this->extractCellRange($cellRef, $pCellParent->getParent()->getSheetByName($matches[2]), false); - } else { - return $this->_raiseFormulaError('Unable to access Cell Reference'); - } - $this->_writeDebug('Evaluation Result for cells '.$cellRef.' in worksheet '.$matches[2].' is '.$this->_showTypeDetails($cellValue)); -// $cellRef = $matches[2].'!'.$cellRef; - } else { -// echo '$cellRef='.$cellRef.' in current worksheet
      '; - $this->_writeDebug('Evaluating Cell Range '.$cellRef.' in current worksheet'); - if (!is_null($pCellParent)) { - $cellValue = $this->extractCellRange($cellRef, $pCellParent, false); - } else { - return $this->_raiseFormulaError('Unable to access Cell Reference'); - } - $this->_writeDebug('Evaluation Result for cells '.$cellRef.' is '.$this->_showTypeDetails($cellValue)); - } - } - } else { -// echo 'Reference is a single Cell
      '; - if (is_null($pCell)) { -// We can't access the cell, so return a REF error - $cellValue = PHPExcel_Calculation_Functions::REF(); - } else { - $cellRef = $matches[6].$matches[7]; - if ($matches[2] > '') { - $matches[2] = trim($matches[2],"\"'"); -// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
      '; - $this->_writeDebug('Evaluating Cell '.$cellRef.' in worksheet '.$matches[2]); - if (!is_null($pCellParent)) { - if ($pCellParent->getParent()->getSheetByName($matches[2])->cellExists($cellRef)) { - $cellValue = $this->extractCellRange($cellRef, $pCellParent->getParent()->getSheetByName($matches[2]), false); - $pCell->attach($pCellParent); - } else { - $cellValue = null; - } - } else { - return $this->_raiseFormulaError('Unable to access Cell Reference'); - } - $this->_writeDebug('Evaluation Result for cell '.$cellRef.' in worksheet '.$matches[2].' is '.$this->_showTypeDetails($cellValue)); -// $cellRef = $matches[2].'!'.$cellRef; - } else { -// echo '$cellRef='.$cellRef.' in current worksheet
      '; - $this->_writeDebug('Evaluating Cell '.$cellRef.' in current worksheet'); - if ($pCellParent->cellExists($cellRef)) { - $cellValue = $this->extractCellRange($cellRef, $pCellParent, false); - $pCell->attach($pCellParent); - } else { - $cellValue = null; - } - $this->_writeDebug('Evaluation Result for cell '.$cellRef.' is '.$this->_showTypeDetails($cellValue)); - } - } - } - $stack->push('Value',$cellValue,$cellRef); - - // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on - } elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) { -// echo 'Token is a function
      '; - $functionName = $matches[1]; - $argCount = $stack->pop(); - $argCount = $argCount['value']; - if ($functionName != 'MKMATRIX') { - $this->_writeDebug('Evaluating Function '.self::_localeFunc($functionName).'() with '.(($argCount == 0) ? 'no' : $argCount).' argument'.(($argCount == 1) ? '' : 's')); - } - if ((isset(self::$_PHPExcelFunctions[$functionName])) || (isset(self::$_controlFunctions[$functionName]))) { // function - if (isset(self::$_PHPExcelFunctions[$functionName])) { - $functionCall = self::$_PHPExcelFunctions[$functionName]['functionCall']; - $passByReference = isset(self::$_PHPExcelFunctions[$functionName]['passByReference']); - $passCellReference = isset(self::$_PHPExcelFunctions[$functionName]['passCellReference']); - } elseif (isset(self::$_controlFunctions[$functionName])) { - $functionCall = self::$_controlFunctions[$functionName]['functionCall']; - $passByReference = isset(self::$_controlFunctions[$functionName]['passByReference']); - $passCellReference = isset(self::$_controlFunctions[$functionName]['passCellReference']); - } - // get the arguments for this function -// echo 'Function '.$functionName.' expects '.$argCount.' arguments
      '; - $args = $argArrayVals = array(); - for ($i = 0; $i < $argCount; ++$i) { - $arg = $stack->pop(); - $a = $argCount - $i - 1; - if (($passByReference) && - (isset(self::$_PHPExcelFunctions[$functionName]['passByReference'][$a])) && - (self::$_PHPExcelFunctions[$functionName]['passByReference'][$a])) { - if (is_null($arg['reference'])) { - $args[] = $cellID; - if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($cellID); } - } else { - $args[] = $arg['reference']; - if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($arg['reference']); } - } - } else { - $args[] = self::_unwrapResult($arg['value']); - if ($functionName != 'MKMATRIX') { $argArrayVals[] = $this->_showValue($arg['value']); } - } - } - // Reverse the order of the arguments - krsort($args); - if (($passByReference) && ($argCount == 0)) { - $args[] = $cellID; - $argArrayVals[] = $this->_showValue($cellID); - } -// echo 'Arguments are: '; -// print_r($args); -// echo '
      '; - if ($functionName != 'MKMATRIX') { - if ($this->writeDebugLog) { - krsort($argArrayVals); - $this->_writeDebug('Evaluating '. self::_localeFunc($functionName).'( '.implode(self::$_localeArgumentSeparator.' ',PHPExcel_Calculation_Functions::flattenArray($argArrayVals)).' )'); - } - } - // Process each argument in turn, building the return value as an array -// if (($argCount == 1) && (is_array($args[1])) && ($functionName != 'MKMATRIX')) { -// $operand1 = $args[1]; -// $this->_writeDebug('Argument is a matrix: '.$this->_showValue($operand1)); -// $result = array(); -// $row = 0; -// foreach($operand1 as $args) { -// if (is_array($args)) { -// foreach($args as $arg) { -// $this->_writeDebug('Evaluating '.self::_localeFunc($functionName).'( '.$this->_showValue($arg).' )'); -// $r = call_user_func_array($functionCall,$arg); -// $this->_writeDebug('Evaluation Result for '.self::_localeFunc($functionName).'() function call is '.$this->_showTypeDetails($r)); -// $result[$row][] = $r; -// } -// ++$row; -// } else { -// $this->_writeDebug('Evaluating '.self::_localeFunc($functionName).'( '.$this->_showValue($args).' )'); -// $r = call_user_func_array($functionCall,$args); -// $this->_writeDebug('Evaluation Result for '.self::_localeFunc($functionName).'() function call is '.$this->_showTypeDetails($r)); -// $result[] = $r; -// } -// } -// } else { - // Process the argument with the appropriate function call - if ($passCellReference) { - $args[] = $pCell; - } - if (strpos($functionCall,'::') !== false) { - $result = call_user_func_array(explode('::',$functionCall),$args); - } else { - foreach($args as &$arg) { - $arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg); - } - unset($arg); - $result = call_user_func_array($functionCall,$args); - } -// } - if ($functionName != 'MKMATRIX') { - $this->_writeDebug('Evaluation Result for '.self::_localeFunc($functionName).'() function call is '.$this->_showTypeDetails($result)); - } - $stack->push('Value',self::_wrapResult($result)); - } - - } else { - // if the token is a number, boolean, string or an Excel error, push it onto the stack - if (isset(self::$_ExcelConstants[strtoupper($token)])) { - $excelConstant = strtoupper($token); -// echo 'Token is a PHPExcel constant: '.$excelConstant.'
      '; - $stack->push('Constant Value',self::$_ExcelConstants[$excelConstant]); - $this->_writeDebug('Evaluating Constant '.$excelConstant.' as '.$this->_showTypeDetails(self::$_ExcelConstants[$excelConstant])); - } elseif ((is_numeric($token)) || (is_null($token)) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) { -// echo 'Token is a number, boolean, string, null or an Excel error
      '; - $stack->push('Value',$token); - // if the token is a named range, push the named range name onto the stack - } elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) { -// echo 'Token is a named range
      '; - $namedRange = $matches[6]; -// echo 'Named Range is '.$namedRange.'
      '; - $this->_writeDebug('Evaluating Named Range '.$namedRange); - $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellParent : null), false); - $pCell->attach($pCellParent); - $this->_writeDebug('Evaluation Result for named range '.$namedRange.' is '.$this->_showTypeDetails($cellValue)); - $stack->push('Named Range',$cellValue,$namedRange); - } else { - return $this->_raiseFormulaError("undefined variable '$token'"); - } - } - } - // when we're out of tokens, the stack should have a single element, the final result - if ($stack->count() != 1) return $this->_raiseFormulaError("internal error"); - $output = $stack->pop(); - $output = $output['value']; - -// if ((is_array($output)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) { -// return array_shift(PHPExcel_Calculation_Functions::flattenArray($output)); -// } - return $output; - } // function _processTokenStack() - - - private function _validateBinaryOperand($cellID,&$operand,&$stack) { - // Numbers, matrices and booleans can pass straight through, as they're already valid - if (is_string($operand)) { - // We only need special validations for the operand if it is a string - // Start by stripping off the quotation marks we use to identify true excel string values internally - if ($operand > '' && $operand{0} == '"') { $operand = self::_unwrapResult($operand); } - // If the string is a numeric value, we treat it as a numeric, so no further testing - if (!is_numeric($operand)) { - // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations - if ($operand > '' && $operand{0} == '#') { - $stack->push('Value', $operand); - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($operand)); - return false; - } elseif (!PHPExcel_Shared_String::convertToNumberIfFraction($operand)) { - // If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations - $stack->push('Value', '#VALUE!'); - $this->_writeDebug('Evaluation Result is a '.$this->_showTypeDetails('#VALUE!')); - return false; - } - } - } - - // return a true if the value of the operand is one that we can use in normal binary operations - return true; - } // function _validateBinaryOperand() - - - private function _executeBinaryComparisonOperation($cellID,$operand1,$operand2,$operation,&$stack,$recursingArrays=false) { - // If we're dealing with matrix operations, we want a matrix result - if ((is_array($operand1)) || (is_array($operand2))) { - $result = array(); - if ((is_array($operand1)) && (!is_array($operand2))) { - foreach($operand1 as $x => $operandData) { - $this->_writeDebug('Evaluating '.$this->_showValue($operandData).' '.$operation.' '.$this->_showValue($operand2)); - $this->_executeBinaryComparisonOperation($cellID,$operandData,$operand2,$operation,$stack); - $r = $stack->pop(); - $result[$x] = $r['value']; - } - } elseif ((!is_array($operand1)) && (is_array($operand2))) { - foreach($operand2 as $x => $operandData) { - $this->_writeDebug('Evaluating '.$this->_showValue($operand1).' '.$operation.' '.$this->_showValue($operandData)); - $this->_executeBinaryComparisonOperation($cellID,$operand1,$operandData,$operation,$stack); - $r = $stack->pop(); - $result[$x] = $r['value']; - } - } else { - if (!$recursingArrays) { self::_checkMatrixOperands($operand1,$operand2,2); } - foreach($operand1 as $x => $operandData) { - $this->_writeDebug('Evaluating '.$this->_showValue($operandData).' '.$operation.' '.$this->_showValue($operand2[$x])); - $this->_executeBinaryComparisonOperation($cellID,$operandData,$operand2[$x],$operation,$stack,true); - $r = $stack->pop(); - $result[$x] = $r['value']; - } - } - // Log the result details - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($result)); - // And push the result onto the stack - $stack->push('Array',$result); - return true; - } - - // Simple validate the two operands if they are string values - if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { $operand1 = self::_unwrapResult($operand1); } - if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { $operand2 = self::_unwrapResult($operand2); } - - // execute the necessary operation - switch ($operation) { - // Greater than - case '>': - $result = ($operand1 > $operand2); - break; - // Less than - case '<': - $result = ($operand1 < $operand2); - break; - // Equality - case '=': - $result = ($operand1 == $operand2); - break; - // Greater than or equal - case '>=': - $result = ($operand1 >= $operand2); - break; - // Less than or equal - case '<=': - $result = ($operand1 <= $operand2); - break; - // Inequality - case '<>': - $result = ($operand1 != $operand2); - break; - } - - // Log the result details - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($result)); - // And push the result onto the stack - $stack->push('Value',$result); - return true; - } // function _executeBinaryComparisonOperation() - - - private function _executeNumericBinaryOperation($cellID,$operand1,$operand2,$operation,$matrixFunction,&$stack) { - // Validate the two operands - if (!$this->_validateBinaryOperand($cellID,$operand1,$stack)) return false; - if (!$this->_validateBinaryOperand($cellID,$operand2,$stack)) return false; - - $executeMatrixOperation = false; - // If either of the operands is a matrix, we need to treat them both as matrices - // (converting the other operand to a matrix if need be); then perform the required - // matrix operation - if ((is_array($operand1)) || (is_array($operand2))) { - // Ensure that both operands are arrays/matrices - $executeMatrixOperation = true; - $mSize = array(); - list($mSize[],$mSize[],$mSize[],$mSize[]) = self::_checkMatrixOperands($operand1,$operand2,2); - - // But if they're both single cell matrices, then we can treat them as simple values - if (array_sum($mSize) == 4) { - $executeMatrixOperation = false; - $operand1 = $operand1[0][0]; - $operand2 = $operand2[0][0]; - } - } - - if ($executeMatrixOperation) { - try { - // Convert operand 1 from a PHP array to a matrix - $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1); - // Perform the required operation against the operand 1 matrix, passing in operand 2 - $matrixResult = $matrix->$matrixFunction($operand2); - $result = $matrixResult->getArray(); - } catch (Exception $ex) { - $this->_writeDebug('JAMA Matrix Exception: '.$ex->getMessage()); - $result = '#VALUE!'; - } - } else { - if ((PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) && - ((is_string($operand1) && !is_numeric($operand1)) || (is_string($operand2) && !is_numeric($operand2)))) { - $result = PHPExcel_Calculation_Functions::VALUE(); - } else { - // If we're dealing with non-matrix operations, execute the necessary operation - switch ($operation) { - // Addition - case '+': - $result = $operand1+$operand2; - break; - // Subtraction - case '-': - $result = $operand1-$operand2; - break; - // Multiplication - case '*': - $result = $operand1*$operand2; - break; - // Division - case '/': - if ($operand2 == 0) { - // Trap for Divide by Zero error - $stack->push('Value','#DIV/0!'); - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails('#DIV/0!')); - return false; - } else { - $result = $operand1/$operand2; - } - break; - // Power - case '^': - $result = pow($operand1,$operand2); - break; - } - } - } - - // Log the result details - $this->_writeDebug('Evaluation Result is '.$this->_showTypeDetails($result)); - // And push the result onto the stack - $stack->push('Value',$result); - return true; - } // function _executeNumericBinaryOperation() - - - private function _writeDebug($message) { - // Only write the debug log if logging is enabled - if ($this->writeDebugLog) { - if ($this->echoDebugLog) { - echo implode(' -> ',$this->debugLogStack).' -> '.$message,'
      '; - } - $this->debugLog[] = implode(' -> ',$this->debugLogStack).' -> '.$message; - } - } // function _writeDebug() - - - // trigger an error, but nicely, if need be - protected function _raiseFormulaError($errorMessage) { - $this->formulaError = $errorMessage; - if (!$this->suppressFormulaErrors) throw new Exception($errorMessage); - trigger_error($errorMessage, E_USER_ERROR); - } // function _raiseFormulaError() - - - /** - * Extract range values - * - * @param string &$pRange String based range representation - * @param PHPExcel_Worksheet $pSheet Worksheet - * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned. - * @throws Exception - */ - public function extractCellRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog=true) { - // Return value - $returnValue = array (); - -// echo 'extractCellRange('.$pRange.')
      '; - if (!is_null($pSheet)) { -// echo 'Passed sheet name is '.$pSheet->getTitle().'
      '; -// echo 'Range reference is '.$pRange.'
      '; - if (strpos ($pRange, '!') !== false) { -// echo '$pRange reference includes sheet reference
      '; - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pRange, true); - $pSheet = $pSheet->getParent()->getSheetByName($worksheetReference[0]); -// echo 'New sheet name is '.$pSheet->getTitle().'
      '; - $pRange = $worksheetReference[1]; -// echo 'Adjusted Range reference is '.$pRange.'
      '; - } - - // Extract range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); - $pRange = $pSheet->getTitle().'!'.$pRange; - if (!isset($aReferences[1])) { - // Single cell in range - list($currentCol,$currentRow) = sscanf($aReferences[0],'%[A-Z]%d'); - if ($pSheet->cellExists($aReferences[0])) { - $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog); - } else { - $returnValue[$currentRow][$currentCol] = null; - } - } else { - // Extract cell data for all cells in the range - foreach ($aReferences as $reference) { - // Extract range - list($currentCol,$currentRow) = sscanf($reference,'%[A-Z]%d'); - - if ($pSheet->cellExists($reference)) { - $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); - } else { - $returnValue[$currentRow][$currentCol] = null; - } - } - } - } - - // Return - return $returnValue; - } // function extractCellRange() - - - /** - * Extract range values - * - * @param string &$pRange String based range representation - * @param PHPExcel_Worksheet $pSheet Worksheet - * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned. - * @throws Exception - */ - public function extractNamedRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog=true) { - // Return value - $returnValue = array (); - -// echo 'extractNamedRange('.$pRange.')
      '; - if (!is_null($pSheet)) { -// echo 'Current sheet name is '.$pSheet->getTitle().'
      '; -// echo 'Range reference is '.$pRange.'
      '; - if (strpos ($pRange, '!') !== false) { -// echo '$pRange reference includes sheet reference
      '; - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pRange, true); - $pSheet = $pSheet->getParent()->getSheetByName($worksheetReference[0]); -// echo 'New sheet name is '.$pSheet->getTitle().'
      '; - $pRange = $worksheetReference[1]; -// echo 'Adjusted Range reference is '.$pRange.'
      '; - } - - // Named range? - $namedRange = PHPExcel_NamedRange::resolveRange($pRange, $pSheet); - if (!is_null($namedRange)) { - $pSheet = $namedRange->getWorksheet(); -// echo 'Named Range '.$pRange.' ('; - $pRange = $namedRange->getRange(); - $splitRange = PHPExcel_Cell::splitRange($pRange); - // Convert row and column references - if (ctype_alpha($splitRange[0][0])) { - $pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow(); - } elseif(ctype_digit($splitRange[0][0])) { - $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1]; - } -// echo $pRange.') is in sheet '.$namedRange->getWorksheet()->getTitle().'
      '; - -// if ($pSheet->getTitle() != $namedRange->getWorksheet()->getTitle()) { -// if (!$namedRange->getLocalOnly()) { -// $pSheet = $namedRange->getWorksheet(); -// } else { -// return $returnValue; -// } -// } - } else { - return PHPExcel_Calculation_Functions::REF(); - } - - // Extract range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); -// var_dump($aReferences); - if (!isset($aReferences[1])) { - // Single cell (or single column or row) in range - list($currentCol,$currentRow) = PHPExcel_Cell::coordinateFromString($aReferences[0]); - if ($pSheet->cellExists($aReferences[0])) { - $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog); - } else { - $returnValue[$currentRow][$currentCol] = null; - } - } else { - // Extract cell data for all cells in the range - foreach ($aReferences as $reference) { - // Extract range - list($currentCol,$currentRow) = PHPExcel_Cell::coordinateFromString($reference); -// echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'
      '; - if ($pSheet->cellExists($reference)) { - $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog); - } else { - $returnValue[$currentRow][$currentCol] = null; - } - } - } -// print_r($returnValue); -// echo '
      '; - } - - // Return - return $returnValue; - } // function extractNamedRange() - - - /** - * Is a specific function implemented? - * - * @param string $pFunction Function Name - * @return boolean - */ - public function isImplemented($pFunction = '') { - $pFunction = strtoupper ($pFunction); - if (isset(self::$_PHPExcelFunctions[$pFunction])) { - return (self::$_PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY'); - } else { - return false; - } - } // function isImplemented() - - - /** - * Get a list of all implemented functions as an array of function objects - * - * @return array of PHPExcel_Calculation_Function - */ - public function listFunctions() { - // Return value - $returnValue = array(); - // Loop functions - foreach(self::$_PHPExcelFunctions as $functionName => $function) { - if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { - $returnValue[$functionName] = new PHPExcel_Calculation_Function($function['category'], - $functionName, - $function['functionCall'] - ); - } - } - - // Return - return $returnValue; - } // function listFunctions() - - - /** - * Get a list of all Excel function names - * - * @return array - */ - public function listAllFunctionNames() { - return array_keys(self::$_PHPExcelFunctions); - } // function listAllFunctionNames() - - /** - * Get a list of implemented Excel function names - * - * @return array - */ - public function listFunctionNames() { - // Return value - $returnValue = array(); - // Loop functions - foreach(self::$_PHPExcelFunctions as $functionName => $function) { - if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') { - $returnValue[] = $functionName; - } - } - - // Return - return $returnValue; - } // function listFunctionNames() - -} // class PHPExcel_Calculation - - - - -// for internal use -class PHPExcel_Token_Stack { - - private $_stack = array(); - private $_count = 0; - - - public function count() { - return $this->_count; - } // function count() - - - public function push($type,$value,$reference=null) { - $this->_stack[$this->_count++] = array('type' => $type, - 'value' => $value, - 'reference' => $reference - ); - if ($type == 'Function') { - $localeFunction = PHPExcel_Calculation::_localeFunc($value); - if ($localeFunction != $value) { - $this->_stack[($this->_count - 1)]['localeValue'] = $localeFunction; - } - } - } // function push() - - - public function pop() { - if ($this->_count > 0) { - return $this->_stack[--$this->_count]; - } - return null; - } // function pop() - - - public function last($n=1) { - if ($this->_count-$n < 0) { - return null; - } - return $this->_stack[$this->_count-$n]; - } // function last() - - - function __construct() { - } - -} // class PHPExcel_Token_Stack diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Database.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Database.php deleted file mode 100644 index 8696d225b3..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Database.php +++ /dev/null @@ -1,384 +0,0 @@ - $criteriaName) { - $testCondition = array(); - $testConditionCount = 0; - foreach($criteria as $row => $criterion) { - if ($criterion[$key] > '') { - $testCondition[] = '[:'.$criteriaName.']'.PHPExcel_Calculation_Functions::_ifCondition($criterion[$key]); - $testConditionCount++; - } - } - if ($testConditionCount > 1) { - $testConditions[] = 'OR('.implode(',',$testCondition).')'; - $testConditionsCount++; - } elseif($testConditionCount == 1) { - $testConditions[] = $testCondition[0]; - $testConditionsCount++; - } - } - if ($testConditionsCount > 1) { - $testConditionSet = 'AND('.implode(',',$testConditions).')'; - } elseif($testConditionsCount == 1) { - $testConditionSet = $testConditions[0]; - } - - // Loop through each row of the database - foreach($database as $dataRow => $dataValues) { - // Substitute actual values from the database row for our [:placeholders] - $testConditionList = $testConditionSet; - foreach($criteriaNames as $key => $criteriaName) { - $k = array_search($criteriaName,$fieldNames); - if (isset($dataValues[$k])) { - $dataValue = $dataValues[$k]; - $dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::_wrapResult(strtoupper($dataValue)) : $dataValue; - $testConditionList = str_replace('[:'.$criteriaName.']',$dataValue,$testConditionList); - } - } - // evaluate the criteria against the row data - $result = PHPExcel_Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); - // If the row failed to meet the criteria, remove it from the database - if (!$result) { - unset($database[$dataRow]); - } - } - - return $database; - } - - - /** - * DAVERAGE - * - */ - public static function DAVERAGE($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::AVERAGE($colData); - } // function DAVERAGE() - - /** - * DCOUNT - * - */ - public static function DCOUNT($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::COUNT($colData); - } // function DCOUNT() - - /** - * DCOUNTA - * - */ - public static function DCOUNTA($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::COUNTA($colData); - } // function DCOUNTA() - - /** - * DGET - * - */ - public static function DGET($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - if (count($colData) > 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return $colData[0]; - } // function DGET() - - /** - * DMAX - * - */ - public static function DMAX($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::MAX($colData); - } // function DMAX() - - /** - * DMIN - * - */ - public static function DMIN($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::MIN($colData); - } // function DMIN() - - /** - * DPRODUCT - * - */ - public static function DPRODUCT($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_MathTrig::PRODUCT($colData); - } // function DPRODUCT() - - /** - * DSTDEV - * - */ - public static function DSTDEV($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::STDEV($colData); - } // function DSTDEV() - - /** - * DSTDEVP - * - */ - public static function DSTDEVP($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::STDEVP($colData); - } // function DSTDEVP() - - /** - * DSUM - * - */ - public static function DSUM($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_MathTrig::SUM($colData); - } // function DSUM() - - /** - * DVAR - * - */ - public static function DVAR($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::VARFunc($colData); - } // function DVAR() - - /** - * DVARP - * - */ - public static function DVARP($database,$field,$criteria) { - $field = self::__fieldExtract($database,$field); - if (is_null($field)) { - return NULL; - } - - // reduce the database to a set of rows that match all the criteria - $database = self::__filter($database,$criteria); - // extract an array of values for the requested column - $colData = array(); - foreach($database as $row) { - $colData[] = $row[$field]; - } - - // Return - return PHPExcel_Calculation_Statistical::VARP($colData); - } // function DVARP() - - -} // class PHPExcel_Calculation_Database diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/DateTime.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/DateTime.php deleted file mode 100644 index c81895524e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/DateTime.php +++ /dev/null @@ -1,1178 +0,0 @@ -format('m'); - $oYear = (int) $PHPDateObject->format('Y'); - - $adjustmentMonthsString = (string) $adjustmentMonths; - if ($adjustmentMonths > 0) { - $adjustmentMonthsString = '+'.$adjustmentMonths; - } - if ($adjustmentMonths != 0) { - $PHPDateObject->modify($adjustmentMonthsString.' months'); - } - $nMonth = (int) $PHPDateObject->format('m'); - $nYear = (int) $PHPDateObject->format('Y'); - - $monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12); - if ($monthDiff != $adjustmentMonths) { - $adjustDays = (int) $PHPDateObject->format('d'); - $adjustDaysString = '-'.$adjustDays.' days'; - $PHPDateObject->modify($adjustDaysString); - } - return $PHPDateObject; - } // function _adjustDateByMonths() - - - /** - * DATETIMENOW - * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function DATETIMENOW() { - $saveTimeZone = date_default_timezone_get(); - date_default_timezone_set('UTC'); - $retValue = False; - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - $retValue = (float) PHPExcel_Shared_Date::PHPToExcel(time()); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - $retValue = (integer) time(); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - $retValue = new DateTime(); - break; - } - date_default_timezone_set($saveTimeZone); - - return $retValue; - } // function DATETIMENOW() - - - /** - * DATENOW - * - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function DATENOW() { - $saveTimeZone = date_default_timezone_get(); - date_default_timezone_set('UTC'); - $retValue = False; - $excelDateTime = floor(PHPExcel_Shared_Date::PHPToExcel(time())); - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - $retValue = (float) $excelDateTime; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - $retValue = (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateTime) - 3600; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - $retValue = PHPExcel_Shared_Date::ExcelToPHPObject($excelDateTime); - break; - } - date_default_timezone_set($saveTimeZone); - - return $retValue; - } // function DATENOW() - - - /** - * DATE - * - * @param long $year - * @param long $month - * @param long $day - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function DATE($year = 0, $month = 1, $day = 1) { - $year = (integer) PHPExcel_Calculation_Functions::flattenSingleValue($year); - $month = (integer) PHPExcel_Calculation_Functions::flattenSingleValue($month); - $day = (integer) PHPExcel_Calculation_Functions::flattenSingleValue($day); - - $baseYear = PHPExcel_Shared_Date::getExcelCalendar(); - // Validate parameters - if ($year < ($baseYear-1900)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((($baseYear-1900) != 0) && ($year < $baseYear) && ($year >= 1900)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - if (($year < $baseYear) && ($year >= ($baseYear-1900))) { - $year += 1900; - } - - if ($month < 1) { - // Handle year/month adjustment if month < 1 - --$month; - $year += ceil($month / 12) - 1; - $month = 13 - abs($month % 12); - } elseif ($month > 12) { - // Handle year/month adjustment if month > 12 - $year += floor($month / 12); - $month = ($month % 12); - } - - // Re-validate the year parameter after adjustments - if (($year < $baseYear) || ($year >= 10000)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day); - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) $excelDateValue; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return PHPExcel_Shared_Date::ExcelToPHPObject($excelDateValue); - break; - } - } // function DATE() - - - /** - * TIME - * - * @param long $hour - * @param long $minute - * @param long $second - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function TIME($hour = 0, $minute = 0, $second = 0) { - $hour = PHPExcel_Calculation_Functions::flattenSingleValue($hour); - $minute = PHPExcel_Calculation_Functions::flattenSingleValue($minute); - $second = PHPExcel_Calculation_Functions::flattenSingleValue($second); - - if ($hour == '') { $hour = 0; } - if ($minute == '') { $minute = 0; } - if ($second == '') { $second = 0; } - - if ((!is_numeric($hour)) || (!is_numeric($minute)) || (!is_numeric($second))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $hour = (integer) $hour; - $minute = (integer) $minute; - $second = (integer) $second; - - if ($second < 0) { - $minute += floor($second / 60); - $second = 60 - abs($second % 60); - if ($second == 60) { $second = 0; } - } elseif ($second >= 60) { - $minute += floor($second / 60); - $second = $second % 60; - } - if ($minute < 0) { - $hour += floor($minute / 60); - $minute = 60 - abs($minute % 60); - if ($minute == 60) { $minute = 0; } - } elseif ($minute >= 60) { - $hour += floor($minute / 60); - $minute = $minute % 60; - } - - if ($hour > 23) { - $hour = $hour % 24; - } elseif ($hour < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - $date = 0; - $calendar = PHPExcel_Shared_Date::getExcelCalendar(); - if ($calendar != PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900) { - $date = 1; - } - return (float) PHPExcel_Shared_Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::FormattedPHPToExcel(1970, 1, 1, $hour-1, $minute, $second)); // -2147468400; // -2147472000 + 3600 - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - $dayAdjust = 0; - if ($hour < 0) { - $dayAdjust = floor($hour / 24); - $hour = 24 - abs($hour % 24); - if ($hour == 24) { $hour = 0; } - } elseif ($hour >= 24) { - $dayAdjust = floor($hour / 24); - $hour = $hour % 24; - } - $phpDateObject = new DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second); - if ($dayAdjust != 0) { - $phpDateObject->modify($dayAdjust.' days'); - } - return $phpDateObject; - break; - } - } // function TIME() - - - /** - * DATEVALUE - * - * @param string $dateValue - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function DATEVALUE($dateValue = 1) { - $dateValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($dateValue),'"'); - // Strip any ordinals because they're allowed in Excel (English only) - $dateValue = preg_replace('/(\d)(st|nd|rd|th)([ -\/])/Ui','$1$3',$dateValue); - // Convert separators (/ . or space) to hyphens (should also handle dot used for ordinals in some countries, e.g. Denmark, Germany) - $dateValue = str_replace(array('/','.','-',' '),array(' ',' ',' ',' '),$dateValue); - - $yearFound = false; - $t1 = explode(' ',$dateValue); - foreach($t1 as &$t) { - if ((is_numeric($t)) && ($t > 31)) { - if ($yearFound) { - return PHPExcel_Calculation_Functions::VALUE(); - } else { - if ($t < 100) { $t += 1900; } - $yearFound = true; - } - } - } - if ((count($t1) == 1) && (strpos($t,':') != false)) { - // We've been fed a time value without any date - return 0.0; - } elseif (count($t1) == 2) { - // We only have two parts of the date: either day/month or month/year - if ($yearFound) { - array_unshift($t1,1); - } else { - array_push($t1,date('Y')); - } - } - unset($t); - $dateValue = implode(' ',$t1); - - $PHPDateArray = date_parse($dateValue); - if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) { - $testVal1 = strtok($dateValue,'- '); - if ($testVal1 !== False) { - $testVal2 = strtok('- '); - if ($testVal2 !== False) { - $testVal3 = strtok('- '); - if ($testVal3 === False) { - $testVal3 = @strftime('%Y'); - } - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - $PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3); - if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) { - $PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3); - if (($PHPDateArray === False) || ($PHPDateArray['error_count'] > 0)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - } - - if (($PHPDateArray !== False) && ($PHPDateArray['error_count'] == 0)) { - // Execute function - if ($PHPDateArray['year'] == '') { $PHPDateArray['year'] = @strftime('%Y'); } - if ($PHPDateArray['month'] == '') { $PHPDateArray['month'] = @strftime('%m'); } - if ($PHPDateArray['day'] == '') { $PHPDateArray['day'] = @strftime('%d'); } - $excelDateValue = floor(PHPExcel_Shared_Date::FormattedPHPToExcel($PHPDateArray['year'],$PHPDateArray['month'],$PHPDateArray['day'],$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second'])); - - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) $excelDateValue; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return new DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); - break; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function DATEVALUE() - - - /** - * TIMEVALUE - * - * @param string $timeValue - * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object, - * depending on the value of the ReturnDateType flag - */ - public static function TIMEVALUE($timeValue) { - $timeValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($timeValue),'"'); - $timeValue = str_replace(array('/','.'),array('-','-'),$timeValue); - - $PHPDateArray = date_parse($timeValue); - if (($PHPDateArray !== False) && ($PHPDateArray['error_count'] == 0)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($PHPDateArray['year'],$PHPDateArray['month'],$PHPDateArray['day'],$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second']); - } else { - $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel(1900,1,1,$PHPDateArray['hour'],$PHPDateArray['minute'],$PHPDateArray['second']) - 1; - } - - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) $excelDateValue; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) $phpDateValue = PHPExcel_Shared_Date::ExcelToPHP($excelDateValue+25569) - 3600;; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return new DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); - break; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TIMEVALUE() - - - /** - * DATEDIF - * - * @param long $startDate Excel date serial value or a standard date string - * @param long $endDate Excel date serial value or a standard date string - * @param string $unit - * @return long Interval between the dates - */ - public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D') { - $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); - $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); - $unit = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($unit)); - - if (is_string($startDate = self::_getDateValue($startDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($endDate = self::_getDateValue($endDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Validate parameters - if ($startDate >= $endDate) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $difference = $endDate - $startDate; - - $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate); - $startDays = $PHPStartDateObject->format('j'); - $startMonths = $PHPStartDateObject->format('n'); - $startYears = $PHPStartDateObject->format('Y'); - - $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate); - $endDays = $PHPEndDateObject->format('j'); - $endMonths = $PHPEndDateObject->format('n'); - $endYears = $PHPEndDateObject->format('Y'); - - $retVal = PHPExcel_Calculation_Functions::NaN(); - switch ($unit) { - case 'D': - $retVal = intval($difference); - break; - case 'M': - $retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12); - // We're only interested in full months - if ($endDays < $startDays) { - --$retVal; - } - break; - case 'Y': - $retVal = intval($endYears - $startYears); - // We're only interested in full months - if ($endMonths < $startMonths) { - --$retVal; - } elseif (($endMonths == $startMonths) && ($endDays < $startDays)) { - --$retVal; - } - break; - case 'MD': - if ($endDays < $startDays) { - $retVal = $endDays; - $PHPEndDateObject->modify('-'.$endDays.' days'); - $adjustDays = $PHPEndDateObject->format('j'); - if ($adjustDays > $startDays) { - $retVal += ($adjustDays - $startDays); - } - } else { - $retVal = $endDays - $startDays; - } - break; - case 'YM': - $retVal = intval($endMonths - $startMonths); - if ($retVal < 0) $retVal = 12 + $retVal; - // We're only interested in full months - if ($endDays < $startDays) { - --$retVal; - } - break; - case 'YD': - $retVal = intval($difference); - if ($endYears > $startYears) { - while ($endYears > $startYears) { - $PHPEndDateObject->modify('-1 year'); - $endYears = $PHPEndDateObject->format('Y'); - } - $retVal = $PHPEndDateObject->format('z') - $PHPStartDateObject->format('z'); - if ($retVal < 0) { $retVal += 365; } - } - break; - } - return $retVal; - } // function DATEDIF() - - - /** - * DAYS360 - * - * @param long $startDate Excel date serial value or a standard date string - * @param long $endDate Excel date serial value or a standard date string - * @param boolean $method US or European Method - * @return long PHP date/time serial - */ - public static function DAYS360($startDate = 0, $endDate = 0, $method = false) { - $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); - $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); - - if (is_string($startDate = self::_getDateValue($startDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($endDate = self::_getDateValue($endDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Execute function - $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate); - $startDay = $PHPStartDateObject->format('j'); - $startMonth = $PHPStartDateObject->format('n'); - $startYear = $PHPStartDateObject->format('Y'); - - $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate); - $endDay = $PHPEndDateObject->format('j'); - $endMonth = $PHPEndDateObject->format('n'); - $endYear = $PHPEndDateObject->format('Y'); - - return self::_dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, !$method); - } // function DAYS360() - - - /** - * YEARFRAC - * - * Calculates the fraction of the year represented by the number of whole days between two dates (the start_date and the - * end_date). Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or obligations - * to assign to a specific term. - * - * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer) or date object, or a standard date string - * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer) or date object, or a standard date string - * @param integer $method Method used for the calculation - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float fraction of the year - */ - public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0) { - $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); - $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); - $method = PHPExcel_Calculation_Functions::flattenSingleValue($method); - - if (is_string($startDate = self::_getDateValue($startDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($endDate = self::_getDateValue($endDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) { - switch($method) { - case 0 : - return self::DAYS360($startDate,$endDate) / 360; - break; - case 1 : - $days = self::DATEDIF($startDate,$endDate); - $startYear = self::YEAR($startDate); - $endYear = self::YEAR($endDate); - $years = $endYear - $startYear + 1; - $leapDays = 0; - if ($years == 1) { - if (self::_isLeapYear($endYear)) { - $startMonth = self::MONTHOFYEAR($startDate); - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($startMonth < 3) || - (($endMonth * 100 + $endDay) >= (2 * 100 + 29))) { - $leapDays += 1; - } - } - } else { - for($year = $startYear; $year <= $endYear; ++$year) { - if ($year == $startYear) { - $startMonth = self::MONTHOFYEAR($startDate); - $startDay = self::DAYOFMONTH($startDate); - if ($startMonth < 3) { - $leapDays += (self::_isLeapYear($year)) ? 1 : 0; - } - } elseif($year == $endYear) { - $endMonth = self::MONTHOFYEAR($endDate); - $endDay = self::DAYOFMONTH($endDate); - if (($endMonth * 100 + $endDay) >= (2 * 100 + 29)) { - $leapDays += (self::_isLeapYear($year)) ? 1 : 0; - } - } else { - $leapDays += (self::_isLeapYear($year)) ? 1 : 0; - } - } - if ($years == 2) { - if (($leapDays == 0) && (self::_isLeapYear($startYear)) && ($days > 365)) { - $leapDays = 1; - } elseif ($days < 366) { - $years = 1; - } - } - $leapDays /= $years; - } - return $days / (365 + $leapDays); - break; - case 2 : - return self::DATEDIF($startDate,$endDate) / 360; - break; - case 3 : - return self::DATEDIF($startDate,$endDate) / 365; - break; - case 4 : - return self::DAYS360($startDate,$endDate,True) / 360; - break; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function YEARFRAC() - - - /** - * NETWORKDAYS - * - * @param mixed Start date - * @param mixed End date - * @param array of mixed Optional Date Series - * @return long Interval between the dates - */ - public static function NETWORKDAYS($startDate,$endDate) { - // Retrieve the mandatory start and end date that are referenced in the function definition - $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); - $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate); - // Flush the mandatory start and end date that are referenced in the function definition, and get the optional days - $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - array_shift($dateArgs); - array_shift($dateArgs); - - // Validate the start and end dates - if (is_string($startDate = $sDate = self::_getDateValue($startDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $startDate = (float) floor($startDate); - if (is_string($endDate = $eDate = self::_getDateValue($endDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $endDate = (float) floor($endDate); - - if ($sDate > $eDate) { - $startDate = $eDate; - $endDate = $sDate; - } - - // Execute function - $startDoW = 6 - self::DAYOFWEEK($startDate,2); - if ($startDoW < 0) { $startDoW = 0; } - $endDoW = self::DAYOFWEEK($endDate,2); - if ($endDoW >= 6) { $endDoW = 0; } - - $wholeWeekDays = floor(($endDate - $startDate) / 7) * 5; - $partWeekDays = $endDoW + $startDoW; - if ($partWeekDays > 5) { - $partWeekDays -= 5; - } - - // Test any extra holiday parameters - $holidayCountedArray = array(); - foreach ($dateArgs as $holidayDate) { - if (is_string($holidayDate = self::_getDateValue($holidayDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) { - if ((self::DAYOFWEEK($holidayDate,2) < 6) && (!in_array($holidayDate,$holidayCountedArray))) { - --$partWeekDays; - $holidayCountedArray[] = $holidayDate; - } - } - } - - if ($sDate > $eDate) { - return 0 - ($wholeWeekDays + $partWeekDays); - } - return $wholeWeekDays + $partWeekDays; - } // function NETWORKDAYS() - - - /** - * WORKDAY - * - * @param mixed Start date - * @param mixed number of days for adjustment - * @param array of mixed Optional Date Series - * @return long Interval between the dates - */ - public static function WORKDAY($startDate,$endDays) { - // Retrieve the mandatory start date and days that are referenced in the function definition - $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate); - $endDays = (int) PHPExcel_Calculation_Functions::flattenSingleValue($endDays); - // Flush the mandatory start date and days that are referenced in the function definition, and get the optional days - $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - array_shift($dateArgs); - array_shift($dateArgs); - - if ((is_string($startDate = self::_getDateValue($startDate))) || (!is_numeric($endDays))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $startDate = (float) floor($startDate); - // If endDays is 0, we always return startDate - if ($endDays == 0) { return $startDate; } - - $decrementing = ($endDays < 0) ? True : False; - - // Adjust the start date if it falls over a weekend - - $startDoW = self::DAYOFWEEK($startDate,3); - if (self::DAYOFWEEK($startDate,3) >= 5) { - $startDate += ($decrementing) ? -$startDoW + 4: 7 - $startDoW; - ($decrementing) ? $endDays++ : $endDays--; - } - - // Add endDays - $endDate = (float) $startDate + (intval($endDays / 5) * 7) + ($endDays % 5); - - // Adjust the calculated end date if it falls over a weekend - $endDoW = self::DAYOFWEEK($endDate,3); - if ($endDoW >= 5) { - $endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW; - } - - // Test any extra holiday parameters - if (count($dateArgs) > 0) { - $holidayCountedArray = $holidayDates = array(); - foreach ($dateArgs as $holidayDate) { - if ((!is_null($holidayDate)) && (trim($holidayDate) > '')) { - if (is_string($holidayDate = self::_getDateValue($holidayDate))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (self::DAYOFWEEK($holidayDate,3) < 5) { - $holidayDates[] = $holidayDate; - } - } - } - if ($decrementing) { - rsort($holidayDates, SORT_NUMERIC); - } else { - sort($holidayDates, SORT_NUMERIC); - } - foreach ($holidayDates as $holidayDate) { - if ($decrementing) { - if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) { - if (!in_array($holidayDate,$holidayCountedArray)) { - --$endDate; - $holidayCountedArray[] = $holidayDate; - } - } - } else { - if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) { - if (!in_array($holidayDate,$holidayCountedArray)) { - ++$endDate; - $holidayCountedArray[] = $holidayDate; - } - } - } - // Adjust the calculated end date if it falls over a weekend - $endDoW = self::DAYOFWEEK($endDate,3); - if ($endDoW >= 5) { - $endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW; - } - - } - } - - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) $endDate; - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP($endDate); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return PHPExcel_Shared_Date::ExcelToPHPObject($endDate); - break; - } - } // function WORKDAY() - - - /** - * DAYOFMONTH - * - * @param long $dateValue Excel date serial value or a standard date string - * @return int Day - */ - public static function DAYOFMONTH($dateValue = 1) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($dateValue == 0.0) { - return 0; - } elseif ($dateValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); - - return (int) $PHPDateObject->format('j'); - } // function DAYOFMONTH() - - - /** - * DAYOFWEEK - * - * @param long $dateValue Excel date serial value or a standard date string - * @return int Day - */ - public static function DAYOFWEEK($dateValue = 1, $style = 1) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - $style = floor(PHPExcel_Calculation_Functions::flattenSingleValue($style)); - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($dateValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); - $DoW = $PHPDateObject->format('w'); - - $firstDay = 1; - switch ($style) { - case 1: ++$DoW; - break; - case 2: if ($DoW == 0) { $DoW = 7; } - break; - case 3: if ($DoW == 0) { $DoW = 7; } - $firstDay = 0; - --$DoW; - break; - default: - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL) { - // Test for Excel's 1900 leap year, and introduce the error as required - if (($PHPDateObject->format('Y') == 1900) && ($PHPDateObject->format('n') <= 2)) { - --$DoW; - if ($DoW < $firstDay) { - $DoW += 7; - } - } - } - - return (int) $DoW; - } // function DAYOFWEEK() - - - /** - * WEEKOFYEAR - * - * @param long $dateValue Excel date serial value or a standard date string - * @param boolean $method Week begins on Sunday or Monday - * @return int Week Number - */ - public static function WEEKOFYEAR($dateValue = 1, $method = 1) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - $method = floor(PHPExcel_Calculation_Functions::flattenSingleValue($method)); - - if (!is_numeric($method)) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif (($method < 1) || ($method > 2)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($dateValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); - $dayOfYear = $PHPDateObject->format('z'); - $dow = $PHPDateObject->format('w'); - $PHPDateObject->modify('-'.$dayOfYear.' days'); - $dow = $PHPDateObject->format('w'); - $daysInFirstWeek = 7 - (($dow + (2 - $method)) % 7); - $dayOfYear -= $daysInFirstWeek; - $weekOfYear = ceil($dayOfYear / 7) + 1; - - return (int) $weekOfYear; - } // function WEEKOFYEAR() - - - /** - * MONTHOFYEAR - * - * @param long $dateValue Excel date serial value or a standard date string - * @return int Month - */ - public static function MONTHOFYEAR($dateValue = 1) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($dateValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); - - return (int) $PHPDateObject->format('n'); - } // function MONTHOFYEAR() - - - /** - * YEAR - * - * @param long $dateValue Excel date serial value or a standard date string - * @return int Year - */ - public static function YEAR($dateValue = 1) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($dateValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Execute function - $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue); - - return (int) $PHPDateObject->format('Y'); - } // function YEAR() - - - /** - * HOUROFDAY - * - * @param mixed $timeValue Excel time serial value or a standard time string - * @return int Hour - */ - public static function HOUROFDAY($timeValue = 0) { - $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); - - if (!is_numeric($timeValue)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $testVal = strtok($timeValue,'/-: '); - if (strlen($testVal) < strlen($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $timeValue = self::_getTimeValue($timeValue); - if (is_string($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - // Execute function - if ($timeValue >= 1) { - $timeValue = fmod($timeValue,1); - } elseif ($timeValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); - - return (int) gmdate('G',$timeValue); - } // function HOUROFDAY() - - - /** - * MINUTEOFHOUR - * - * @param long $timeValue Excel time serial value or a standard time string - * @return int Minute - */ - public static function MINUTEOFHOUR($timeValue = 0) { - $timeValue = $timeTester = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); - - if (!is_numeric($timeValue)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $testVal = strtok($timeValue,'/-: '); - if (strlen($testVal) < strlen($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $timeValue = self::_getTimeValue($timeValue); - if (is_string($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - // Execute function - if ($timeValue >= 1) { - $timeValue = fmod($timeValue,1); - } elseif ($timeValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); - - return (int) gmdate('i',$timeValue); - } // function MINUTEOFHOUR() - - - /** - * SECONDOFMINUTE - * - * @param long $timeValue Excel time serial value or a standard time string - * @return int Second - */ - public static function SECONDOFMINUTE($timeValue = 0) { - $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue); - - if (!is_numeric($timeValue)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $testVal = strtok($timeValue,'/-: '); - if (strlen($testVal) < strlen($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $timeValue = self::_getTimeValue($timeValue); - if (is_string($timeValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - // Execute function - if ($timeValue >= 1) { - $timeValue = fmod($timeValue,1); - } elseif ($timeValue < 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue); - - return (int) gmdate('s',$timeValue); - } // function SECONDOFMINUTE() - - - /** - * EDATE - * - * Returns the serial number that represents the date that is the indicated number of months before or after a specified date - * (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date of issue. - * - * @param long $dateValue Excel date serial value or a standard date string - * @param int $adjustmentMonths Number of months to adjust by - * @return long Excel date serial value - */ - public static function EDATE($dateValue = 1, $adjustmentMonths = 0) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - $adjustmentMonths = floor(PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths)); - - if (!is_numeric($adjustmentMonths)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Execute function - $PHPDateObject = self::_adjustDateByMonths($dateValue,$adjustmentMonths); - - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject)); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return $PHPDateObject; - break; - } - } // function EDATE() - - - /** - * EOMONTH - * - * Returns the serial number for the last day of the month that is the indicated number of months before or after start_date. - * Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month. - * - * @param long $dateValue Excel date serial value or a standard date string - * @param int $adjustmentMonths Number of months to adjust by - * @return long Excel date serial value - */ - public static function EOMONTH($dateValue = 1, $adjustmentMonths = 0) { - $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue); - $adjustmentMonths = floor(PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths)); - - if (!is_numeric($adjustmentMonths)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_string($dateValue = self::_getDateValue($dateValue))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Execute function - $PHPDateObject = self::_adjustDateByMonths($dateValue,$adjustmentMonths+1); - $adjustDays = (int) $PHPDateObject->format('d'); - $adjustDaysString = '-'.$adjustDays.' days'; - $PHPDateObject->modify($adjustDaysString); - - switch (PHPExcel_Calculation_Functions::getReturnDateType()) { - case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL : - return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC : - return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject)); - break; - case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT : - return $PHPDateObject; - break; - } - } // function EOMONTH() - -} // class PHPExcel_Calculation_DateTime diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Engineering.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Engineering.php deleted file mode 100644 index 9adc2ecdf1..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Engineering.php +++ /dev/null @@ -1,2174 +0,0 @@ - array( 'Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => True ), - 'sg' => array( 'Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => False ), - 'lbm' => array( 'Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => False ), - 'u' => array( 'Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => True ), - 'ozm' => array( 'Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => False ), - 'm' => array( 'Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => True ), - 'mi' => array( 'Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => False ), - 'Nmi' => array( 'Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => False ), - 'in' => array( 'Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => False ), - 'ft' => array( 'Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => False ), - 'yd' => array( 'Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => False ), - 'ang' => array( 'Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => True ), - 'Pica' => array( 'Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => False ), - 'yr' => array( 'Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => False ), - 'day' => array( 'Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => False ), - 'hr' => array( 'Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => False ), - 'mn' => array( 'Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => False ), - 'sec' => array( 'Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => True ), - 'Pa' => array( 'Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => True ), - 'p' => array( 'Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => True ), - 'atm' => array( 'Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => True ), - 'at' => array( 'Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => True ), - 'mmHg' => array( 'Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => True ), - 'N' => array( 'Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => True ), - 'dyn' => array( 'Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => True ), - 'dy' => array( 'Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => True ), - 'lbf' => array( 'Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => False ), - 'J' => array( 'Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => True ), - 'e' => array( 'Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => True ), - 'c' => array( 'Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => True ), - 'cal' => array( 'Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => True ), - 'eV' => array( 'Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => True ), - 'ev' => array( 'Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => True ), - 'HPh' => array( 'Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => False ), - 'hh' => array( 'Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => False ), - 'Wh' => array( 'Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => True ), - 'wh' => array( 'Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => True ), - 'flb' => array( 'Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => False ), - 'BTU' => array( 'Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => False ), - 'btu' => array( 'Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => False ), - 'HP' => array( 'Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => False ), - 'h' => array( 'Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => False ), - 'W' => array( 'Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => True ), - 'w' => array( 'Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => True ), - 'T' => array( 'Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => True ), - 'ga' => array( 'Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => True ), - 'C' => array( 'Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => False ), - 'cel' => array( 'Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => False ), - 'F' => array( 'Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => False ), - 'fah' => array( 'Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => False ), - 'K' => array( 'Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => False ), - 'kel' => array( 'Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => False ), - 'tsp' => array( 'Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => False ), - 'tbs' => array( 'Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => False ), - 'oz' => array( 'Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => False ), - 'cup' => array( 'Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => False ), - 'pt' => array( 'Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => False ), - 'us_pt' => array( 'Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => False ), - 'uk_pt' => array( 'Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => False ), - 'qt' => array( 'Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => False ), - 'gal' => array( 'Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => False ), - 'l' => array( 'Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => True ), - 'lt' => array( 'Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => True ) - ); - - private static $_conversionMultipliers = array( 'Y' => array( 'multiplier' => 1E24, 'name' => 'yotta' ), - 'Z' => array( 'multiplier' => 1E21, 'name' => 'zetta' ), - 'E' => array( 'multiplier' => 1E18, 'name' => 'exa' ), - 'P' => array( 'multiplier' => 1E15, 'name' => 'peta' ), - 'T' => array( 'multiplier' => 1E12, 'name' => 'tera' ), - 'G' => array( 'multiplier' => 1E9, 'name' => 'giga' ), - 'M' => array( 'multiplier' => 1E6, 'name' => 'mega' ), - 'k' => array( 'multiplier' => 1E3, 'name' => 'kilo' ), - 'h' => array( 'multiplier' => 1E2, 'name' => 'hecto' ), - 'e' => array( 'multiplier' => 1E1, 'name' => 'deka' ), - 'd' => array( 'multiplier' => 1E-1, 'name' => 'deci' ), - 'c' => array( 'multiplier' => 1E-2, 'name' => 'centi' ), - 'm' => array( 'multiplier' => 1E-3, 'name' => 'milli' ), - 'u' => array( 'multiplier' => 1E-6, 'name' => 'micro' ), - 'n' => array( 'multiplier' => 1E-9, 'name' => 'nano' ), - 'p' => array( 'multiplier' => 1E-12, 'name' => 'pico' ), - 'f' => array( 'multiplier' => 1E-15, 'name' => 'femto' ), - 'a' => array( 'multiplier' => 1E-18, 'name' => 'atto' ), - 'z' => array( 'multiplier' => 1E-21, 'name' => 'zepto' ), - 'y' => array( 'multiplier' => 1E-24, 'name' => 'yocto' ) - ); - - private static $_unitConversions = array( 'Mass' => array( 'g' => array( 'g' => 1.0, - 'sg' => 6.85220500053478E-05, - 'lbm' => 2.20462291469134E-03, - 'u' => 6.02217000000000E+23, - 'ozm' => 3.52739718003627E-02 - ), - 'sg' => array( 'g' => 1.45938424189287E+04, - 'sg' => 1.0, - 'lbm' => 3.21739194101647E+01, - 'u' => 8.78866000000000E+27, - 'ozm' => 5.14782785944229E+02 - ), - 'lbm' => array( 'g' => 4.5359230974881148E+02, - 'sg' => 3.10810749306493E-02, - 'lbm' => 1.0, - 'u' => 2.73161000000000E+26, - 'ozm' => 1.60000023429410E+01 - ), - 'u' => array( 'g' => 1.66053100460465E-24, - 'sg' => 1.13782988532950E-28, - 'lbm' => 3.66084470330684E-27, - 'u' => 1.0, - 'ozm' => 5.85735238300524E-26 - ), - 'ozm' => array( 'g' => 2.83495152079732E+01, - 'sg' => 1.94256689870811E-03, - 'lbm' => 6.24999908478882E-02, - 'u' => 1.70725600000000E+25, - 'ozm' => 1.0 - ) - ), - 'Distance' => array( 'm' => array( 'm' => 1.0, - 'mi' => 6.21371192237334E-04, - 'Nmi' => 5.39956803455724E-04, - 'in' => 3.93700787401575E+01, - 'ft' => 3.28083989501312E+00, - 'yd' => 1.09361329797891E+00, - 'ang' => 1.00000000000000E+10, - 'Pica' => 2.83464566929116E+03 - ), - 'mi' => array( 'm' => 1.60934400000000E+03, - 'mi' => 1.0, - 'Nmi' => 8.68976241900648E-01, - 'in' => 6.33600000000000E+04, - 'ft' => 5.28000000000000E+03, - 'yd' => 1.76000000000000E+03, - 'ang' => 1.60934400000000E+13, - 'Pica' => 4.56191999999971E+06 - ), - 'Nmi' => array( 'm' => 1.85200000000000E+03, - 'mi' => 1.15077944802354E+00, - 'Nmi' => 1.0, - 'in' => 7.29133858267717E+04, - 'ft' => 6.07611548556430E+03, - 'yd' => 2.02537182785694E+03, - 'ang' => 1.85200000000000E+13, - 'Pica' => 5.24976377952723E+06 - ), - 'in' => array( 'm' => 2.54000000000000E-02, - 'mi' => 1.57828282828283E-05, - 'Nmi' => 1.37149028077754E-05, - 'in' => 1.0, - 'ft' => 8.33333333333333E-02, - 'yd' => 2.77777777686643E-02, - 'ang' => 2.54000000000000E+08, - 'Pica' => 7.19999999999955E+01 - ), - 'ft' => array( 'm' => 3.04800000000000E-01, - 'mi' => 1.89393939393939E-04, - 'Nmi' => 1.64578833693305E-04, - 'in' => 1.20000000000000E+01, - 'ft' => 1.0, - 'yd' => 3.33333333223972E-01, - 'ang' => 3.04800000000000E+09, - 'Pica' => 8.63999999999946E+02 - ), - 'yd' => array( 'm' => 9.14400000300000E-01, - 'mi' => 5.68181818368230E-04, - 'Nmi' => 4.93736501241901E-04, - 'in' => 3.60000000118110E+01, - 'ft' => 3.00000000000000E+00, - 'yd' => 1.0, - 'ang' => 9.14400000300000E+09, - 'Pica' => 2.59200000085023E+03 - ), - 'ang' => array( 'm' => 1.00000000000000E-10, - 'mi' => 6.21371192237334E-14, - 'Nmi' => 5.39956803455724E-14, - 'in' => 3.93700787401575E-09, - 'ft' => 3.28083989501312E-10, - 'yd' => 1.09361329797891E-10, - 'ang' => 1.0, - 'Pica' => 2.83464566929116E-07 - ), - 'Pica' => array( 'm' => 3.52777777777800E-04, - 'mi' => 2.19205948372629E-07, - 'Nmi' => 1.90484761219114E-07, - 'in' => 1.38888888888898E-02, - 'ft' => 1.15740740740748E-03, - 'yd' => 3.85802469009251E-04, - 'ang' => 3.52777777777800E+06, - 'Pica' => 1.0 - ) - ), - 'Time' => array( 'yr' => array( 'yr' => 1.0, - 'day' => 365.25, - 'hr' => 8766.0, - 'mn' => 525960.0, - 'sec' => 31557600.0 - ), - 'day' => array( 'yr' => 2.73785078713210E-03, - 'day' => 1.0, - 'hr' => 24.0, - 'mn' => 1440.0, - 'sec' => 86400.0 - ), - 'hr' => array( 'yr' => 1.14077116130504E-04, - 'day' => 4.16666666666667E-02, - 'hr' => 1.0, - 'mn' => 60.0, - 'sec' => 3600.0 - ), - 'mn' => array( 'yr' => 1.90128526884174E-06, - 'day' => 6.94444444444444E-04, - 'hr' => 1.66666666666667E-02, - 'mn' => 1.0, - 'sec' => 60.0 - ), - 'sec' => array( 'yr' => 3.16880878140289E-08, - 'day' => 1.15740740740741E-05, - 'hr' => 2.77777777777778E-04, - 'mn' => 1.66666666666667E-02, - 'sec' => 1.0 - ) - ), - 'Pressure' => array( 'Pa' => array( 'Pa' => 1.0, - 'p' => 1.0, - 'atm' => 9.86923299998193E-06, - 'at' => 9.86923299998193E-06, - 'mmHg' => 7.50061707998627E-03 - ), - 'p' => array( 'Pa' => 1.0, - 'p' => 1.0, - 'atm' => 9.86923299998193E-06, - 'at' => 9.86923299998193E-06, - 'mmHg' => 7.50061707998627E-03 - ), - 'atm' => array( 'Pa' => 1.01324996583000E+05, - 'p' => 1.01324996583000E+05, - 'atm' => 1.0, - 'at' => 1.0, - 'mmHg' => 760.0 - ), - 'at' => array( 'Pa' => 1.01324996583000E+05, - 'p' => 1.01324996583000E+05, - 'atm' => 1.0, - 'at' => 1.0, - 'mmHg' => 760.0 - ), - 'mmHg' => array( 'Pa' => 1.33322363925000E+02, - 'p' => 1.33322363925000E+02, - 'atm' => 1.31578947368421E-03, - 'at' => 1.31578947368421E-03, - 'mmHg' => 1.0 - ) - ), - 'Force' => array( 'N' => array( 'N' => 1.0, - 'dyn' => 1.0E+5, - 'dy' => 1.0E+5, - 'lbf' => 2.24808923655339E-01 - ), - 'dyn' => array( 'N' => 1.0E-5, - 'dyn' => 1.0, - 'dy' => 1.0, - 'lbf' => 2.24808923655339E-06 - ), - 'dy' => array( 'N' => 1.0E-5, - 'dyn' => 1.0, - 'dy' => 1.0, - 'lbf' => 2.24808923655339E-06 - ), - 'lbf' => array( 'N' => 4.448222, - 'dyn' => 4.448222E+5, - 'dy' => 4.448222E+5, - 'lbf' => 1.0 - ) - ), - 'Energy' => array( 'J' => array( 'J' => 1.0, - 'e' => 9.99999519343231E+06, - 'c' => 2.39006249473467E-01, - 'cal' => 2.38846190642017E-01, - 'eV' => 6.24145700000000E+18, - 'ev' => 6.24145700000000E+18, - 'HPh' => 3.72506430801000E-07, - 'hh' => 3.72506430801000E-07, - 'Wh' => 2.77777916238711E-04, - 'wh' => 2.77777916238711E-04, - 'flb' => 2.37304222192651E+01, - 'BTU' => 9.47815067349015E-04, - 'btu' => 9.47815067349015E-04 - ), - 'e' => array( 'J' => 1.00000048065700E-07, - 'e' => 1.0, - 'c' => 2.39006364353494E-08, - 'cal' => 2.38846305445111E-08, - 'eV' => 6.24146000000000E+11, - 'ev' => 6.24146000000000E+11, - 'HPh' => 3.72506609848824E-14, - 'hh' => 3.72506609848824E-14, - 'Wh' => 2.77778049754611E-11, - 'wh' => 2.77778049754611E-11, - 'flb' => 2.37304336254586E-06, - 'BTU' => 9.47815522922962E-11, - 'btu' => 9.47815522922962E-11 - ), - 'c' => array( 'J' => 4.18399101363672E+00, - 'e' => 4.18398900257312E+07, - 'c' => 1.0, - 'cal' => 9.99330315287563E-01, - 'eV' => 2.61142000000000E+19, - 'ev' => 2.61142000000000E+19, - 'HPh' => 1.55856355899327E-06, - 'hh' => 1.55856355899327E-06, - 'Wh' => 1.16222030532950E-03, - 'wh' => 1.16222030532950E-03, - 'flb' => 9.92878733152102E+01, - 'BTU' => 3.96564972437776E-03, - 'btu' => 3.96564972437776E-03 - ), - 'cal' => array( 'J' => 4.18679484613929E+00, - 'e' => 4.18679283372801E+07, - 'c' => 1.00067013349059E+00, - 'cal' => 1.0, - 'eV' => 2.61317000000000E+19, - 'ev' => 2.61317000000000E+19, - 'HPh' => 1.55960800463137E-06, - 'hh' => 1.55960800463137E-06, - 'Wh' => 1.16299914807955E-03, - 'wh' => 1.16299914807955E-03, - 'flb' => 9.93544094443283E+01, - 'BTU' => 3.96830723907002E-03, - 'btu' => 3.96830723907002E-03 - ), - 'eV' => array( 'J' => 1.60219000146921E-19, - 'e' => 1.60218923136574E-12, - 'c' => 3.82933423195043E-20, - 'cal' => 3.82676978535648E-20, - 'eV' => 1.0, - 'ev' => 1.0, - 'HPh' => 5.96826078912344E-26, - 'hh' => 5.96826078912344E-26, - 'Wh' => 4.45053000026614E-23, - 'wh' => 4.45053000026614E-23, - 'flb' => 3.80206452103492E-18, - 'BTU' => 1.51857982414846E-22, - 'btu' => 1.51857982414846E-22 - ), - 'ev' => array( 'J' => 1.60219000146921E-19, - 'e' => 1.60218923136574E-12, - 'c' => 3.82933423195043E-20, - 'cal' => 3.82676978535648E-20, - 'eV' => 1.0, - 'ev' => 1.0, - 'HPh' => 5.96826078912344E-26, - 'hh' => 5.96826078912344E-26, - 'Wh' => 4.45053000026614E-23, - 'wh' => 4.45053000026614E-23, - 'flb' => 3.80206452103492E-18, - 'BTU' => 1.51857982414846E-22, - 'btu' => 1.51857982414846E-22 - ), - 'HPh' => array( 'J' => 2.68451741316170E+06, - 'e' => 2.68451612283024E+13, - 'c' => 6.41616438565991E+05, - 'cal' => 6.41186757845835E+05, - 'eV' => 1.67553000000000E+25, - 'ev' => 1.67553000000000E+25, - 'HPh' => 1.0, - 'hh' => 1.0, - 'Wh' => 7.45699653134593E+02, - 'wh' => 7.45699653134593E+02, - 'flb' => 6.37047316692964E+07, - 'BTU' => 2.54442605275546E+03, - 'btu' => 2.54442605275546E+03 - ), - 'hh' => array( 'J' => 2.68451741316170E+06, - 'e' => 2.68451612283024E+13, - 'c' => 6.41616438565991E+05, - 'cal' => 6.41186757845835E+05, - 'eV' => 1.67553000000000E+25, - 'ev' => 1.67553000000000E+25, - 'HPh' => 1.0, - 'hh' => 1.0, - 'Wh' => 7.45699653134593E+02, - 'wh' => 7.45699653134593E+02, - 'flb' => 6.37047316692964E+07, - 'BTU' => 2.54442605275546E+03, - 'btu' => 2.54442605275546E+03 - ), - 'Wh' => array( 'J' => 3.59999820554720E+03, - 'e' => 3.59999647518369E+10, - 'c' => 8.60422069219046E+02, - 'cal' => 8.59845857713046E+02, - 'eV' => 2.24692340000000E+22, - 'ev' => 2.24692340000000E+22, - 'HPh' => 1.34102248243839E-03, - 'hh' => 1.34102248243839E-03, - 'Wh' => 1.0, - 'wh' => 1.0, - 'flb' => 8.54294774062316E+04, - 'BTU' => 3.41213254164705E+00, - 'btu' => 3.41213254164705E+00 - ), - 'wh' => array( 'J' => 3.59999820554720E+03, - 'e' => 3.59999647518369E+10, - 'c' => 8.60422069219046E+02, - 'cal' => 8.59845857713046E+02, - 'eV' => 2.24692340000000E+22, - 'ev' => 2.24692340000000E+22, - 'HPh' => 1.34102248243839E-03, - 'hh' => 1.34102248243839E-03, - 'Wh' => 1.0, - 'wh' => 1.0, - 'flb' => 8.54294774062316E+04, - 'BTU' => 3.41213254164705E+00, - 'btu' => 3.41213254164705E+00 - ), - 'flb' => array( 'J' => 4.21400003236424E-02, - 'e' => 4.21399800687660E+05, - 'c' => 1.00717234301644E-02, - 'cal' => 1.00649785509554E-02, - 'eV' => 2.63015000000000E+17, - 'ev' => 2.63015000000000E+17, - 'HPh' => 1.56974211145130E-08, - 'hh' => 1.56974211145130E-08, - 'Wh' => 1.17055614802000E-05, - 'wh' => 1.17055614802000E-05, - 'flb' => 1.0, - 'BTU' => 3.99409272448406E-05, - 'btu' => 3.99409272448406E-05 - ), - 'BTU' => array( 'J' => 1.05505813786749E+03, - 'e' => 1.05505763074665E+10, - 'c' => 2.52165488508168E+02, - 'cal' => 2.51996617135510E+02, - 'eV' => 6.58510000000000E+21, - 'ev' => 6.58510000000000E+21, - 'HPh' => 3.93015941224568E-04, - 'hh' => 3.93015941224568E-04, - 'Wh' => 2.93071851047526E-01, - 'wh' => 2.93071851047526E-01, - 'flb' => 2.50369750774671E+04, - 'BTU' => 1.0, - 'btu' => 1.0, - ), - 'btu' => array( 'J' => 1.05505813786749E+03, - 'e' => 1.05505763074665E+10, - 'c' => 2.52165488508168E+02, - 'cal' => 2.51996617135510E+02, - 'eV' => 6.58510000000000E+21, - 'ev' => 6.58510000000000E+21, - 'HPh' => 3.93015941224568E-04, - 'hh' => 3.93015941224568E-04, - 'Wh' => 2.93071851047526E-01, - 'wh' => 2.93071851047526E-01, - 'flb' => 2.50369750774671E+04, - 'BTU' => 1.0, - 'btu' => 1.0, - ) - ), - 'Power' => array( 'HP' => array( 'HP' => 1.0, - 'h' => 1.0, - 'W' => 7.45701000000000E+02, - 'w' => 7.45701000000000E+02 - ), - 'h' => array( 'HP' => 1.0, - 'h' => 1.0, - 'W' => 7.45701000000000E+02, - 'w' => 7.45701000000000E+02 - ), - 'W' => array( 'HP' => 1.34102006031908E-03, - 'h' => 1.34102006031908E-03, - 'W' => 1.0, - 'w' => 1.0 - ), - 'w' => array( 'HP' => 1.34102006031908E-03, - 'h' => 1.34102006031908E-03, - 'W' => 1.0, - 'w' => 1.0 - ) - ), - 'Magnetism' => array( 'T' => array( 'T' => 1.0, - 'ga' => 10000.0 - ), - 'ga' => array( 'T' => 0.0001, - 'ga' => 1.0 - ) - ), - 'Liquid' => array( 'tsp' => array( 'tsp' => 1.0, - 'tbs' => 3.33333333333333E-01, - 'oz' => 1.66666666666667E-01, - 'cup' => 2.08333333333333E-02, - 'pt' => 1.04166666666667E-02, - 'us_pt' => 1.04166666666667E-02, - 'uk_pt' => 8.67558516821960E-03, - 'qt' => 5.20833333333333E-03, - 'gal' => 1.30208333333333E-03, - 'l' => 4.92999408400710E-03, - 'lt' => 4.92999408400710E-03 - ), - 'tbs' => array( 'tsp' => 3.00000000000000E+00, - 'tbs' => 1.0, - 'oz' => 5.00000000000000E-01, - 'cup' => 6.25000000000000E-02, - 'pt' => 3.12500000000000E-02, - 'us_pt' => 3.12500000000000E-02, - 'uk_pt' => 2.60267555046588E-02, - 'qt' => 1.56250000000000E-02, - 'gal' => 3.90625000000000E-03, - 'l' => 1.47899822520213E-02, - 'lt' => 1.47899822520213E-02 - ), - 'oz' => array( 'tsp' => 6.00000000000000E+00, - 'tbs' => 2.00000000000000E+00, - 'oz' => 1.0, - 'cup' => 1.25000000000000E-01, - 'pt' => 6.25000000000000E-02, - 'us_pt' => 6.25000000000000E-02, - 'uk_pt' => 5.20535110093176E-02, - 'qt' => 3.12500000000000E-02, - 'gal' => 7.81250000000000E-03, - 'l' => 2.95799645040426E-02, - 'lt' => 2.95799645040426E-02 - ), - 'cup' => array( 'tsp' => 4.80000000000000E+01, - 'tbs' => 1.60000000000000E+01, - 'oz' => 8.00000000000000E+00, - 'cup' => 1.0, - 'pt' => 5.00000000000000E-01, - 'us_pt' => 5.00000000000000E-01, - 'uk_pt' => 4.16428088074541E-01, - 'qt' => 2.50000000000000E-01, - 'gal' => 6.25000000000000E-02, - 'l' => 2.36639716032341E-01, - 'lt' => 2.36639716032341E-01 - ), - 'pt' => array( 'tsp' => 9.60000000000000E+01, - 'tbs' => 3.20000000000000E+01, - 'oz' => 1.60000000000000E+01, - 'cup' => 2.00000000000000E+00, - 'pt' => 1.0, - 'us_pt' => 1.0, - 'uk_pt' => 8.32856176149081E-01, - 'qt' => 5.00000000000000E-01, - 'gal' => 1.25000000000000E-01, - 'l' => 4.73279432064682E-01, - 'lt' => 4.73279432064682E-01 - ), - 'us_pt' => array( 'tsp' => 9.60000000000000E+01, - 'tbs' => 3.20000000000000E+01, - 'oz' => 1.60000000000000E+01, - 'cup' => 2.00000000000000E+00, - 'pt' => 1.0, - 'us_pt' => 1.0, - 'uk_pt' => 8.32856176149081E-01, - 'qt' => 5.00000000000000E-01, - 'gal' => 1.25000000000000E-01, - 'l' => 4.73279432064682E-01, - 'lt' => 4.73279432064682E-01 - ), - 'uk_pt' => array( 'tsp' => 1.15266000000000E+02, - 'tbs' => 3.84220000000000E+01, - 'oz' => 1.92110000000000E+01, - 'cup' => 2.40137500000000E+00, - 'pt' => 1.20068750000000E+00, - 'us_pt' => 1.20068750000000E+00, - 'uk_pt' => 1.0, - 'qt' => 6.00343750000000E-01, - 'gal' => 1.50085937500000E-01, - 'l' => 5.68260698087162E-01, - 'lt' => 5.68260698087162E-01 - ), - 'qt' => array( 'tsp' => 1.92000000000000E+02, - 'tbs' => 6.40000000000000E+01, - 'oz' => 3.20000000000000E+01, - 'cup' => 4.00000000000000E+00, - 'pt' => 2.00000000000000E+00, - 'us_pt' => 2.00000000000000E+00, - 'uk_pt' => 1.66571235229816E+00, - 'qt' => 1.0, - 'gal' => 2.50000000000000E-01, - 'l' => 9.46558864129363E-01, - 'lt' => 9.46558864129363E-01 - ), - 'gal' => array( 'tsp' => 7.68000000000000E+02, - 'tbs' => 2.56000000000000E+02, - 'oz' => 1.28000000000000E+02, - 'cup' => 1.60000000000000E+01, - 'pt' => 8.00000000000000E+00, - 'us_pt' => 8.00000000000000E+00, - 'uk_pt' => 6.66284940919265E+00, - 'qt' => 4.00000000000000E+00, - 'gal' => 1.0, - 'l' => 3.78623545651745E+00, - 'lt' => 3.78623545651745E+00 - ), - 'l' => array( 'tsp' => 2.02840000000000E+02, - 'tbs' => 6.76133333333333E+01, - 'oz' => 3.38066666666667E+01, - 'cup' => 4.22583333333333E+00, - 'pt' => 2.11291666666667E+00, - 'us_pt' => 2.11291666666667E+00, - 'uk_pt' => 1.75975569552166E+00, - 'qt' => 1.05645833333333E+00, - 'gal' => 2.64114583333333E-01, - 'l' => 1.0, - 'lt' => 1.0 - ), - 'lt' => array( 'tsp' => 2.02840000000000E+02, - 'tbs' => 6.76133333333333E+01, - 'oz' => 3.38066666666667E+01, - 'cup' => 4.22583333333333E+00, - 'pt' => 2.11291666666667E+00, - 'us_pt' => 2.11291666666667E+00, - 'uk_pt' => 1.75975569552166E+00, - 'qt' => 1.05645833333333E+00, - 'gal' => 2.64114583333333E-01, - 'l' => 1.0, - 'lt' => 1.0 - ) - ) - ); - - - public static function _parseComplex($complexNumber) { - $workString = (string) $complexNumber; - - $realNumber = $imaginary = 0; - // Extract the suffix, if there is one - $suffix = substr($workString,-1); - if (!is_numeric($suffix)) { - $workString = substr($workString,0,-1); - } else { - $suffix = ''; - } - - // Split the input into its Real and Imaginary components - $leadingSign = 0; - if (strlen($workString) > 0) { - $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0; - } - $power = ''; - $realNumber = strtok($workString, '+-'); - if (strtoupper(substr($realNumber,-1)) == 'E') { - $power = strtok('+-'); - ++$leadingSign; - } - - $realNumber = substr($workString,0,strlen($realNumber)+strlen($power)+$leadingSign); - - if ($suffix != '') { - $imaginary = substr($workString,strlen($realNumber)); - - if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) { - $imaginary = $realNumber.'1'; - $realNumber = '0'; - } else if ($imaginary == '') { - $imaginary = $realNumber; - $realNumber = '0'; - } elseif (($imaginary == '+') || ($imaginary == '-')) { - $imaginary .= '1'; - } - } - - return array( 'real' => $realNumber, - 'imaginary' => $imaginary, - 'suffix' => $suffix - ); - } // function _parseComplex() - - - private static function _cleanComplex($complexNumber) { - if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1); - if ($complexNumber{0} == '0') $complexNumber = substr($complexNumber,1); - if ($complexNumber{0} == '.') $complexNumber = '0'.$complexNumber; - if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1); - return $complexNumber; - } - - - private static function _nbrConversionFormat($xVal,$places) { - if (!is_null($places)) { - if (strlen($xVal) <= $places) { - return substr(str_pad($xVal,$places,'0',STR_PAD_LEFT),-10); - } else { - return PHPExcel_Calculation_Functions::NaN(); - } - } - - return substr($xVal,-10); - } // function _nbrConversionFormat() - - - /** - * BESSELI - * - * Returns the modified Bessel function, which is equivalent to the Bessel function evaluated for purely imaginary arguments - * - * @param float $x - * @param float $n - * @return int - */ - public static function BESSELI($x, $n) { - $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); - $n = (is_null($n)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($n); - - if ((is_numeric($x)) && (is_numeric($n))) { - $n = floor($n); - if ($n < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $f_2_PI = 2 * M_PI; - - if (abs($x) <= 30) { - $fTerm = pow($x / 2, $n) / PHPExcel_Calculation_MathTrig::FACT($n); - $nK = 1; - $fResult = $fTerm; - $fSqrX = ($x * $x) / 4; - do { - $fTerm *= $fSqrX; - $fTerm /= ($nK * ($nK + $n)); - $fResult += $fTerm; - } while ((abs($fTerm) > 1e-10) && (++$nK < 100)); - } else { - $fXAbs = abs($x); - $fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs); - if (($n && 1) && ($x < 0)) { - $fResult = -$fResult; - } - } - return $fResult; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BESSELI() - - - /** - * BESSELJ - * - * Returns the Bessel function - * - * @param float $x - * @param float $n - * @return int - */ - public static function BESSELJ($x, $n) { - $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); - $n = (is_null($n)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($n); - - if ((is_numeric($x)) && (is_numeric($n))) { - $n = floor($n); - if ($n < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $f_PI_DIV_2 = M_PI / 2; - $f_PI_DIV_4 = M_PI / 4; - - $fResult = 0; - if (abs($x) <= 30) { - $fTerm = pow($x / 2, $n) / PHPExcel_Calculation_MathTrig::FACT($n); - $nK = 1; - $fResult = $fTerm; - $fSqrX = ($x * $x) / -4; - do { - $fTerm *= $fSqrX; - $fTerm /= ($nK * ($nK + $n)); - $fResult += $fTerm; - } while ((abs($fTerm) > 1e-10) && (++$nK < 100)); - } else { - $fXAbs = abs($x); - $fResult = sqrt(M_2DIVPI / $fXAbs) * cos($fXAbs - $n * $f_PI_DIV_2 - $f_PI_DIV_4); - if (($n && 1) && ($x < 0)) { - $fResult = -$fResult; - } - } - return $fResult; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BESSELJ() - - - private static function _Besselk0($fNum) { - if ($fNum <= 2) { - $fNum2 = $fNum * 0.5; - $y = ($fNum2 * $fNum2); - $fRet = -log($fNum2) * self::BESSELI($fNum, 0) + - (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y * - (0.10750e-3 + $y * 0.74e-5)))))); - } else { - $y = 2 / $fNum; - $fRet = exp(-$fNum) / sqrt($fNum) * - (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y * - (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3)))))); - } - return $fRet; - } // function _Besselk0() - - - private static function _Besselk1($fNum) { - if ($fNum <= 2) { - $fNum2 = $fNum * 0.5; - $y = ($fNum2 * $fNum2); - $fRet = log($fNum2) * self::BESSELI($fNum, 1) + - (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y * - (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum; - } else { - $y = 2 / $fNum; - $fRet = exp(-$fNum) / sqrt($fNum) * - (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y * - (0.325614e-2 + $y * (-0.68245e-3))))))); - } - return $fRet; - } // function _Besselk1() - - - /** - * BESSELK - * - * Returns the modified Bessel function, which is equivalent to the Bessel functions evaluated for purely imaginary arguments. - * - * @param float $x - * @param float $ord - * @return float - */ - public static function BESSELK($x, $ord) { - $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); - - if ((is_numeric($x)) && (is_numeric($ord))) { - if (($ord < 0) || ($x == 0.0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - switch(floor($ord)) { - case 0 : return self::_Besselk0($x); - break; - case 1 : return self::_Besselk1($x); - break; - default : $fTox = 2 / $x; - $fBkm = self::_Besselk0($x); - $fBk = self::_Besselk1($x); - for ($n = 1; $n < $ord; ++$n) { - $fBkp = $fBkm + $n * $fTox * $fBk; - $fBkm = $fBk; - $fBk = $fBkp; - } - } - return $fBk; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BESSELK() - - - private static function _Bessely0($fNum) { - if ($fNum < 8.0) { - $y = ($fNum * $fNum); - $f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733)))); - $f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y)))); - $fRet = $f1 / $f2 + M_2DIVPI * self::BESSELJ($fNum, 0) * log($fNum); - } else { - $z = 8.0 / $fNum; - $y = ($z * $z); - $xx = $fNum - 0.785398164; - $f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6))); - $f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7)))); - $fRet = sqrt(M_2DIVPI / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2); - } - return $fRet; - } // function _Bessely0() - - - private static function _Bessely1($fNum) { - if ($fNum < 8.0) { - $y = ($fNum * $fNum); - $f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y * - (-0.4237922726e7 + $y * 0.8511937935e4))))); - $f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y * - (0.1020426050e6 + $y * (0.3549632885e3 + $y))))); - $fRet = $f1 / $f2 + M_2DIVPI * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum); - } else { - $z = 8.0 / $fNum; - $y = ($z * $z); - $xx = $fNum - 2.356194491; - $f1 = 1 + $y * (0.183105e-2 + $y * (-0.3516396496e-4 + $y * (0.2457520174e-5 + $y * (-0.240337019e6)))); - $f2 = 0.04687499995 + $y * (-0.2002690873e-3 + $y * (0.8449199096e-5 + $y * (-0.88228987e-6 + $y * 0.105787412e-6))); - $fRet = sqrt(M_2DIVPI / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2); - #i12430# ...but this seems to work much better. -// $fRet = sqrt(M_2DIVPI / $fNum) * sin($fNum - 2.356194491); - } - return $fRet; - } // function _Bessely1() - - - /** - * BESSELY - * - * Returns the Bessel function, which is also called the Weber function or the Neumann function. - * - * @param float $x - * @param float $n - * @return int - */ - public static function BESSELY($x, $ord) { - $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x); - $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord); - - if ((is_numeric($x)) && (is_numeric($ord))) { - if (($ord < 0) || ($x == 0.0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - switch(floor($ord)) { - case 0 : return self::_Bessely0($x); - break; - case 1 : return self::_Bessely1($x); - break; - default: $fTox = 2 / $x; - $fBym = self::_Bessely0($x); - $fBy = self::_Bessely1($x); - for ($n = 1; $n < $ord; ++$n) { - $fByp = $n * $fTox * $fBy - $fBym; - $fBym = $fBy; - $fBy = $fByp; - } - } - return $fBy; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BESSELY() - - - /** - * BINTODEC - * - * Return a binary value as Decimal. - * - * @param string $x - * @return string - */ - public static function BINTODEC($x) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $x = floor($x); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[01]/',$x,$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (strlen($x) > 10) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (strlen($x) == 10) { - // Two's Complement - $x = substr($x,-9); - return '-'.(512-bindec($x)); - } - return bindec($x); - } // function BINTODEC() - - - /** - * BINTOHEX - * - * Return a binary value as Hex. - * - * @param string $x - * @return string - */ - public static function BINTOHEX($x, $places=null) { - $x = floor(PHPExcel_Calculation_Functions::flattenSingleValue($x)); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $x = floor($x); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[01]/',$x,$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (strlen($x) > 10) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (strlen($x) == 10) { - // Two's Complement - return str_repeat('F',8).substr(strtoupper(dechex(bindec(substr($x,-9)))),-2); - } - $hexVal = (string) strtoupper(dechex(bindec($x))); - - return self::_nbrConversionFormat($hexVal,$places); - } // function BINTOHEX() - - - /** - * BINTOOCT - * - * Return a binary value as Octal. - * - * @param string $x - * @return string - */ - public static function BINTOOCT($x, $places=null) { - $x = floor(PHPExcel_Calculation_Functions::flattenSingleValue($x)); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $x = floor($x); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[01]/',$x,$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (strlen($x) > 10) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (strlen($x) == 10) { - // Two's Complement - return str_repeat('7',7).substr(strtoupper(decoct(bindec(substr($x,-9)))),-3); - } - $octVal = (string) decoct(bindec($x)); - - return self::_nbrConversionFormat($octVal,$places); - } // function BINTOOCT() - - - /** - * DECTOBIN - * - * Return an octal value as binary. - * - * @param string $x - * @return string - */ - public static function DECTOBIN($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) floor($x); - $r = decbin($x); - if (strlen($r) == 32) { - // Two's Complement - $r = substr($r,-10); - } elseif (strlen($r) > 11) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return self::_nbrConversionFormat($r,$places); - } // function DECTOBIN() - - - /** - * DECTOHEX - * - * Return an octal value as binary. - * - * @param string $x - * @return string - */ - public static function DECTOHEX($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) floor($x); - $r = strtoupper(dechex($x)); - if (strlen($r) == 8) { - // Two's Complement - $r = 'FF'.$r; - } - - return self::_nbrConversionFormat($r,$places); - } // function DECTOHEX() - - - /** - * DECTOOCT - * - * Return an octal value as binary. - * - * @param string $x - * @return string - */ - public static function DECTOOCT($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $x = (int) $x; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[-0123456789.]/',$x,$out)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) floor($x); - $r = decoct($x); - if (strlen($r) == 11) { - // Two's Complement - $r = substr($r,-10); - } - - return self::_nbrConversionFormat($r,$places); - } // function DECTOOCT() - - - /** - * HEXTOBIN - * - * Return a hex value as binary. - * - * @param string $x - * @return string - */ - public static function HEXTOBIN($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $binVal = decbin(hexdec($x)); - - return substr(self::_nbrConversionFormat($binVal,$places),-10); - } // function HEXTOBIN() - - - /** - * HEXTODEC - * - * Return a hex value as octal. - * - * @param string $x - * @return string - */ - public static function HEXTODEC($x) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return hexdec($x); - } // function HEXTODEC() - - - /** - * HEXTOOCT - * - * Return a hex value as octal. - * - * @param string $x - * @return string - */ - public static function HEXTOOCT($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $octVal = decoct(hexdec($x)); - - return self::_nbrConversionFormat($octVal,$places); - } // function HEXTOOCT() - - - /** - * OCTTOBIN - * - * Return an octal value as binary. - * - * @param string $x - * @return string - */ - public static function OCTTOBIN($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $r = decbin(octdec($x)); - - return self::_nbrConversionFormat($r,$places); - } // function OCTTOBIN() - - - /** - * OCTTODEC - * - * Return an octal value as binary. - * - * @param string $x - * @return string - */ - public static function OCTTODEC($x) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return octdec($x); - } // function OCTTODEC() - - - /** - * OCTTOHEX - * - * Return an octal value as hex. - * - * @param string $x - * @return string - */ - public static function OCTTOHEX($x, $places=null) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $places = PHPExcel_Calculation_Functions::flattenSingleValue($places); - - if (is_bool($x)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $x = (string) $x; - if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $hexVal = strtoupper(dechex(octdec($x))); - - return self::_nbrConversionFormat($hexVal,$places); - } // function OCTTOHEX() - - - /** - * COMPLEX - * - * returns a complex number of the form x + yi or x + yj. - * - * @param float $realNumber - * @param float $imaginary - * @param string $suffix - * @return string - */ - public static function COMPLEX($realNumber=0.0, $imaginary=0.0, $suffix='i') { - $realNumber = (is_null($realNumber)) ? 0.0 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($realNumber); - $imaginary = (is_null($imaginary)) ? 0.0 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($imaginary); - $suffix = (is_null($suffix)) ? 'i' : PHPExcel_Calculation_Functions::flattenSingleValue($suffix); - - if (((is_numeric($realNumber)) && (is_numeric($imaginary))) && - (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) { - if ($suffix == '') $suffix = 'i'; - if ($realNumber == 0.0) { - if ($imaginary == 0.0) { - return (string) '0'; - } elseif ($imaginary == 1.0) { - return (string) $suffix; - } elseif ($imaginary == -1.0) { - return (string) '-'.$suffix; - } - return (string) $imaginary.$suffix; - } elseif ($imaginary == 0.0) { - return (string) $realNumber; - } elseif ($imaginary == 1.0) { - return (string) $realNumber.'+'.$suffix; - } elseif ($imaginary == -1.0) { - return (string) $realNumber.'-'.$suffix; - } - if ($imaginary > 0) { $imaginary = (string) '+'.$imaginary; } - return (string) $realNumber.$imaginary.$suffix; - } - - return PHPExcel_Calculation_Functions::VALUE(); - } // function COMPLEX() - - - /** - * IMAGINARY - * - * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return real - */ - public static function IMAGINARY($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - return $parsedComplex['imaginary']; - } // function IMAGINARY() - - - /** - * IMREAL - * - * Returns the real coefficient of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return real - */ - public static function IMREAL($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - return $parsedComplex['real']; - } // function IMREAL() - - - /** - * IMABS - * - * Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return real - */ - public static function IMABS($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - return sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])); - } // function IMABS() - - - /** - * IMARGUMENT - * - * Returns the argument theta of a complex number, i.e. the angle in radians from the real axis to the representation of the number in polar coordinates. - * - * @param string $complexNumber - * @return string - */ - public static function IMARGUMENT($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if ($parsedComplex['real'] == 0.0) { - if ($parsedComplex['imaginary'] == 0.0) { - return 0.0; - } elseif($parsedComplex['imaginary'] < 0.0) { - return M_PI / -2; - } else { - return M_PI / 2; - } - } elseif ($parsedComplex['real'] > 0.0) { - return atan($parsedComplex['imaginary'] / $parsedComplex['real']); - } elseif ($parsedComplex['imaginary'] < 0.0) { - return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real']))); - } else { - return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real'])); - } - } // function IMARGUMENT() - - - /** - * IMCONJUGATE - * - * Returns the complex conjugate of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMCONJUGATE($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if ($parsedComplex['imaginary'] == 0.0) { - return $parsedComplex['real']; - } else { - return self::_cleanComplex(self::COMPLEX($parsedComplex['real'], 0 - $parsedComplex['imaginary'], $parsedComplex['suffix'])); - } - } // function IMCONJUGATE() - - - /** - * IMCOS - * - * Returns the cosine of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMCOS($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if ($parsedComplex['imaginary'] == 0.0) { - return cos($parsedComplex['real']); - } else { - return self::IMCONJUGATE(self::COMPLEX(cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix'])); - } - } // function IMCOS() - - - /** - * IMSIN - * - * Returns the sine of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMSIN($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if ($parsedComplex['imaginary'] == 0.0) { - return sin($parsedComplex['real']); - } else { - return self::COMPLEX(sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),$parsedComplex['suffix']); - } - } // function IMSIN() - - - /** - * IMSQRT - * - * Returns the square root of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMSQRT($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - $theta = self::IMARGUMENT($complexNumber); - $d1 = cos($theta / 2); - $d2 = sin($theta / 2); - $r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($d1 * $r,$d2 * $r); - } else { - return self::COMPLEX($d1 * $r,$d2 * $r,$parsedComplex['suffix']); - } - } // function IMSQRT() - - - /** - * IMLN - * - * Returns the natural logarithm of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMLN($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']))); - $t = self::IMARGUMENT($complexNumber); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($logR,$t); - } else { - return self::COMPLEX($logR,$t,$parsedComplex['suffix']); - } - } // function IMLN() - - - /** - * IMLOG10 - * - * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMLOG10($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return log10($parsedComplex['real']); - } - - return self::IMPRODUCT(log10(EULER),self::IMLN($complexNumber)); - } // function IMLOG10() - - - /** - * IMLOG2 - * - * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMLOG2($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return log($parsedComplex['real'],2); - } - - return self::IMPRODUCT(log(EULER,2),self::IMLN($complexNumber)); - } // function IMLOG2() - - - /** - * IMEXP - * - * Returns the exponential of a complex number in x + yi or x + yj text format. - * - * @param string $complexNumber - * @return string - */ - public static function IMEXP($complexNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) { - return '1'; - } - - $e = exp($parsedComplex['real']); - $eX = $e * cos($parsedComplex['imaginary']); - $eY = $e * sin($parsedComplex['imaginary']); - - if ($parsedComplex['suffix'] == '') { - return self::COMPLEX($eX,$eY); - } else { - return self::COMPLEX($eX,$eY,$parsedComplex['suffix']); - } - } // function IMEXP() - - - /** - * IMPOWER - * - * Returns a complex number in x + yi or x + yj text format raised to a power. - * - * @param string $complexNumber - * @return string - */ - public static function IMPOWER($complexNumber,$realNumber) { - $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber); - $realNumber = PHPExcel_Calculation_Functions::flattenSingleValue($realNumber); - - if (!is_numeric($realNumber)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - $parsedComplex = self::_parseComplex($complexNumber); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - $r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])); - $rPower = pow($r,$realNumber); - $theta = self::IMARGUMENT($complexNumber) * $realNumber; - if ($theta == 0) { - return 1; - } elseif ($parsedComplex['imaginary'] == 0.0) { - return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']); - } else { - return self::COMPLEX($rPower * cos($theta),$rPower * sin($theta),$parsedComplex['suffix']); - } - } // function IMPOWER() - - - /** - * IMDIV - * - * Returns the quotient of two complex numbers in x + yi or x + yj text format. - * - * @param string $complexDividend - * @param string $complexDivisor - * @return real - */ - public static function IMDIV($complexDividend,$complexDivisor) { - $complexDividend = PHPExcel_Calculation_Functions::flattenSingleValue($complexDividend); - $complexDivisor = PHPExcel_Calculation_Functions::flattenSingleValue($complexDivisor); - - $parsedComplexDividend = self::_parseComplex($complexDividend); - if (!is_array($parsedComplexDividend)) { - return $parsedComplexDividend; - } - - $parsedComplexDivisor = self::_parseComplex($complexDivisor); - if (!is_array($parsedComplexDivisor)) { - return $parsedComplexDividend; - } - - if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') && - ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) { - $parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix']; - } - - $d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']); - $d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']); - $d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']); - - $r = $d1/$d3; - $i = $d2/$d3; - - if ($i > 0.0) { - return self::_cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']); - } elseif ($i < 0.0) { - return self::_cleanComplex($r.$i.$parsedComplexDivisor['suffix']); - } else { - return $r; - } - } // function IMDIV() - - - /** - * IMSUB - * - * Returns the difference of two complex numbers in x + yi or x + yj text format. - * - * @param string $complexNumber1 - * @param string $complexNumber2 - * @return real - */ - public static function IMSUB($complexNumber1,$complexNumber2) { - $complexNumber1 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber1); - $complexNumber2 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber2); - - $parsedComplex1 = self::_parseComplex($complexNumber1); - if (!is_array($parsedComplex1)) { - return $parsedComplex1; - } - - $parsedComplex2 = self::_parseComplex($complexNumber2); - if (!is_array($parsedComplex2)) { - return $parsedComplex2; - } - - if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) && - ($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) { - $parsedComplex1['suffix'] = $parsedComplex2['suffix']; - } - - $d1 = $parsedComplex1['real'] - $parsedComplex2['real']; - $d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary']; - - return self::COMPLEX($d1,$d2,$parsedComplex1['suffix']); - } // function IMSUB() - - - /** - * IMSUM - * - * Returns the sum of two or more complex numbers in x + yi or x + yj text format. - * - * @param array of mixed Data Series - * @return real - */ - public static function IMSUM() { - // Return value - $returnValue = self::_parseComplex('0'); - $activeSuffix = ''; - - // Loop through the arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - $parsedComplex = self::_parseComplex($arg); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - - if ($activeSuffix == '') { - $activeSuffix = $parsedComplex['suffix']; - } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - $returnValue['real'] += $parsedComplex['real']; - $returnValue['imaginary'] += $parsedComplex['imaginary']; - } - - if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; } - return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix); - } // function IMSUM() - - - /** - * IMPRODUCT - * - * Returns the product of two or more complex numbers in x + yi or x + yj text format. - * - * @param array of mixed Data Series - * @return real - */ - public static function IMPRODUCT() { - // Return value - $returnValue = self::_parseComplex('1'); - $activeSuffix = ''; - - // Loop through the arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - $parsedComplex = self::_parseComplex($arg); - if (!is_array($parsedComplex)) { - return $parsedComplex; - } - $workValue = $returnValue; - if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) { - $activeSuffix = $parsedComplex['suffix']; - } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) { - return PHPExcel_Calculation_Functions::NaN(); - } - $returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']); - $returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']); - } - - if ($returnValue['imaginary'] == 0.0) { $activeSuffix = ''; } - return self::COMPLEX($returnValue['real'],$returnValue['imaginary'],$activeSuffix); - } // function IMPRODUCT() - - - /** - * DELTA - * - * Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise. - * - * @param float $a - * @param float $b - * @return int - */ - public static function DELTA($a, $b=0) { - $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); - $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); - - return (int) ($a == $b); - } // function DELTA() - - - /** - * GESTEP - * - * Returns 1 if number = step; returns 0 (zero) otherwise - * - * @param float $number - * @param float $step - * @return int - */ - public static function GESTEP($number, $step=0) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $step = PHPExcel_Calculation_Functions::flattenSingleValue($step); - - return (int) ($number >= $step); - } // function GESTEP() - - - // - // Private method to calculate the erf value - // - private static $_two_sqrtpi = 1.128379167095512574; - - public static function _erfVal($x) { - if (abs($x) > 2.2) { - return 1 - self::_erfcVal($x); - } - $sum = $term = $x; - $xsqr = ($x * $x); - $j = 1; - do { - $term *= $xsqr / $j; - $sum -= $term / (2 * $j + 1); - ++$j; - $term *= $xsqr / $j; - $sum += $term / (2 * $j + 1); - ++$j; - if ($sum == 0.0) { - break; - } - } while (abs($term / $sum) > PRECISION); - return self::$_two_sqrtpi * $sum; - } // function _erfVal() - - - /** - * ERF - * - * Returns the error function integrated between lower_limit and upper_limit - * - * @param float $lower lower bound for integrating ERF - * @param float $upper upper bound for integrating ERF. - * If omitted, ERF integrates between zero and lower_limit - * @return int - */ - public static function ERF($lower, $upper = null) { - $lower = PHPExcel_Calculation_Functions::flattenSingleValue($lower); - $upper = PHPExcel_Calculation_Functions::flattenSingleValue($upper); - - if (is_numeric($lower)) { - if ($lower < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (is_null($upper)) { - return self::_erfVal($lower); - } - if (is_numeric($upper)) { - if ($upper < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return self::_erfVal($upper) - self::_erfVal($lower); - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ERF() - - - // - // Private method to calculate the erfc value - // - private static $_one_sqrtpi = 0.564189583547756287; - - private static function _erfcVal($x) { - if (abs($x) < 2.2) { - return 1 - self::_erfVal($x); - } - if ($x < 0) { - return 2 - self::ERFC(-$x); - } - $a = $n = 1; - $b = $c = $x; - $d = ($x * $x) + 0.5; - $q1 = $q2 = $b / $d; - $t = 0; - do { - $t = $a * $n + $b * $x; - $a = $b; - $b = $t; - $t = $c * $n + $d * $x; - $c = $d; - $d = $t; - $n += 0.5; - $q1 = $q2; - $q2 = $b / $d; - } while ((abs($q1 - $q2) / $q2) > PRECISION); - return self::$_one_sqrtpi * exp(-$x * $x) * $q2; - } // function _erfcVal() - - - /** - * ERFC - * - * Returns the complementary ERF function integrated between x and infinity - * - * @param float $x The lower bound for integrating ERF - * @return int - */ - public static function ERFC($x) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - - if (is_numeric($x)) { - if ($x < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return self::_erfcVal($x); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ERFC() - - - /** - * getConversionGroups - * - * @return array - */ - public static function getConversionGroups() { - $conversionGroups = array(); - foreach(self::$_conversionUnits as $conversionUnit) { - $conversionGroups[] = $conversionUnit['Group']; - } - return array_merge(array_unique($conversionGroups)); - } // function getConversionGroups() - - - /** - * getConversionGroupUnits - * - * @return array - */ - public static function getConversionGroupUnits($group = NULL) { - $conversionGroups = array(); - foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) { - if ((is_null($group)) || ($conversionGroup['Group'] == $group)) { - $conversionGroups[$conversionGroup['Group']][] = $conversionUnit; - } - } - return $conversionGroups; - } // function getConversionGroupUnits() - - - /** - * getConversionGroupUnitDetails - * - * @return array - */ - public static function getConversionGroupUnitDetails($group = NULL) { - $conversionGroups = array(); - foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) { - if ((is_null($group)) || ($conversionGroup['Group'] == $group)) { - $conversionGroups[$conversionGroup['Group']][] = array( 'unit' => $conversionUnit, - 'description' => $conversionGroup['Unit Name'] - ); - } - } - return $conversionGroups; - } // function getConversionGroupUnitDetails() - - - /** - * getConversionGroups - * - * @return array - */ - public static function getConversionMultipliers() { - return self::$_conversionMultipliers; - } // function getConversionGroups() - - - /** - * CONVERTUOM - * - * @param float $value - * @param string $fromUOM - * @param string $toUOM - * @return float - */ - public static function CONVERTUOM($value, $fromUOM, $toUOM) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $fromUOM = PHPExcel_Calculation_Functions::flattenSingleValue($fromUOM); - $toUOM = PHPExcel_Calculation_Functions::flattenSingleValue($toUOM); - - if (!is_numeric($value)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $fromMultiplier = 1; - if (isset(self::$_conversionUnits[$fromUOM])) { - $unitGroup1 = self::$_conversionUnits[$fromUOM]['Group']; - } else { - $fromMultiplier = substr($fromUOM,0,1); - $fromUOM = substr($fromUOM,1); - if (isset(self::$_conversionMultipliers[$fromMultiplier])) { - $fromMultiplier = self::$_conversionMultipliers[$fromMultiplier]['multiplier']; - } else { - return PHPExcel_Calculation_Functions::NA(); - } - if ((isset(self::$_conversionUnits[$fromUOM])) && (self::$_conversionUnits[$fromUOM]['AllowPrefix'])) { - $unitGroup1 = self::$_conversionUnits[$fromUOM]['Group']; - } else { - return PHPExcel_Calculation_Functions::NA(); - } - } - $value *= $fromMultiplier; - - $toMultiplier = 1; - if (isset(self::$_conversionUnits[$toUOM])) { - $unitGroup2 = self::$_conversionUnits[$toUOM]['Group']; - } else { - $toMultiplier = substr($toUOM,0,1); - $toUOM = substr($toUOM,1); - if (isset(self::$_conversionMultipliers[$toMultiplier])) { - $toMultiplier = self::$_conversionMultipliers[$toMultiplier]['multiplier']; - } else { - return PHPExcel_Calculation_Functions::NA(); - } - if ((isset(self::$_conversionUnits[$toUOM])) && (self::$_conversionUnits[$toUOM]['AllowPrefix'])) { - $unitGroup2 = self::$_conversionUnits[$toUOM]['Group']; - } else { - return PHPExcel_Calculation_Functions::NA(); - } - } - if ($unitGroup1 != $unitGroup2) { - return PHPExcel_Calculation_Functions::NA(); - } - - if ($fromUOM == $toUOM) { - return 1.0; - } elseif ($unitGroup1 == 'Temperature') { - if (($fromUOM == 'F') || ($fromUOM == 'fah')) { - if (($toUOM == 'F') || ($toUOM == 'fah')) { - return 1.0; - } else { - $value = (($value - 32) / 1.8); - if (($toUOM == 'K') || ($toUOM == 'kel')) { - $value += 273.15; - } - return $value; - } - } elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) && - (($toUOM == 'K') || ($toUOM == 'kel'))) { - return 1.0; - } elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) && - (($toUOM == 'C') || ($toUOM == 'cel'))) { - return 1.0; - } - if (($toUOM == 'F') || ($toUOM == 'fah')) { - if (($fromUOM == 'K') || ($fromUOM == 'kel')) { - $value -= 273.15; - } - return ($value * 1.8) + 32; - } - if (($toUOM == 'C') || ($toUOM == 'cel')) { - return $value - 273.15; - } - return $value + 273.15; - } - return ($value * self::$_unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier; - } // function CONVERTUOM() - -} // class PHPExcel_Calculation_Engineering diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Exception.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Exception.php deleted file mode 100644 index 6c09d5a165..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Exception.php +++ /dev/null @@ -1,52 +0,0 @@ -line = $line; - $e->file = $file; - throw $e; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/ExceptionHandler.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/ExceptionHandler.php deleted file mode 100644 index cc0caa8a29..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/ExceptionHandler.php +++ /dev/null @@ -1,49 +0,0 @@ -modify('+1 day'); - return ($date->format('d') == 1); - } // function _lastDayOfMonth() - - - private static function _firstDayOfMonth($testDate) { - $date = clone $testDate; - return ($date->format('d') == 1); - } // function _lastDayOfMonth() - - - private static function _coupFirstPeriodDate($settlement, $maturity, $frequency, $next) { - $months = 12 / $frequency; - - $result = PHPExcel_Shared_Date::ExcelToPHPObject($maturity); - $eom = self::_lastDayOfMonth($result); - - while ($settlement < PHPExcel_Shared_Date::PHPToExcel($result)) { - $result->modify('-'.$months.' months'); - } - if ($next) { - $result->modify('+'.$months.' months'); - } - - if ($eom) { - $result->modify('-1 day'); - } - - return PHPExcel_Shared_Date::PHPToExcel($result); - } // function _coupFirstPeriodDate() - - - private static function _validFrequency($frequency) { - if (($frequency == 1) || ($frequency == 2) || ($frequency == 4)) { - return true; - } - if ((PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) && - (($frequency == 6) || ($frequency == 12))) { - return true; - } - return false; - } // function _validFrequency() - - - private static function _daysPerYear($year,$basis) { - switch ($basis) { - case 0 : - case 2 : - case 4 : - $daysPerYear = 360; - break; - case 3 : - $daysPerYear = 365; - break; - case 1 : - if (PHPExcel_Calculation_DateTime::_isLeapYear($year)) { - $daysPerYear = 366; - } else { - $daysPerYear = 365; - } - break; - default : - return PHPExcel_Calculation_Functions::NaN(); - } - return $daysPerYear; - } // function _daysPerYear() - - - private static function _interestAndPrincipal($rate=0, $per=0, $nper=0, $pv=0, $fv=0, $type=0) { - $pmt = self::PMT($rate, $nper, $pv, $fv, $type); - $capital = $pv; - for ($i = 1; $i<= $per; ++$i) { - $interest = ($type && $i == 1) ? 0 : -$capital * $rate; - $principal = $pmt - $interest; - $capital += $principal; - } - return array($interest, $principal); - } // function _interestAndPrincipal() - - - /** - * ACCRINT - * - * Returns the discount rate for a security. - * - * @param mixed issue The security's issue date. - * @param mixed firstinter The security's first interest date. - * @param mixed settlement The security's settlement date. - * @param float rate The security's annual coupon rate. - * @param float par The security's par value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function ACCRINT($issue, $firstinter, $settlement, $rate, $par=1000, $frequency=1, $basis=0) { - $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); - $firstinter = PHPExcel_Calculation_Functions::flattenSingleValue($firstinter); - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $rate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $par = (is_null($par)) ? 1000 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($par); - $frequency = (is_null($frequency)) ? 1 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($rate)) && (is_numeric($par))) { - if (($rate <= 0) || ($par <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); - if (!is_numeric($daysBetweenIssueAndSettlement)) { - // return date error - return $daysBetweenIssueAndSettlement; - } - - return $par * $rate * $daysBetweenIssueAndSettlement; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ACCRINT() - - - /** - * ACCRINTM - * - * Returns the discount rate for a security. - * - * @param mixed issue The security's issue date. - * @param mixed settlement The security's settlement date. - * @param float rate The security's annual coupon rate. - * @param float par The security's par value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function ACCRINTM($issue, $settlement, $rate, $par=1000, $basis=0) { - $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $rate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $par = (is_null($par)) ? 1000 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($par); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($rate)) && (is_numeric($par))) { - if (($rate <= 0) || ($par <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); - if (!is_numeric($daysBetweenIssueAndSettlement)) { - // return date error - return $daysBetweenIssueAndSettlement; - } - return $par * $rate * $daysBetweenIssueAndSettlement; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ACCRINTM() - - - public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis=0) { - $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased); - $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod); - $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $period = floor(PHPExcel_Calculation_Functions::flattenSingleValue($period)); - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - $fUsePer = 1.0 / $rate; - - if ($fUsePer < 3.0) { - $amortiseCoeff = 1.0; - } elseif ($fUsePer < 5.0) { - $amortiseCoeff = 1.5; - } elseif ($fUsePer <= 6.0) { - $amortiseCoeff = 2.0; - } else { - $amortiseCoeff = 2.5; - } - - $rate *= $amortiseCoeff; - $fNRate = round(PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis) * $rate * $cost,0); - $cost -= $fNRate; - $fRest = $cost - $salvage; - - for ($n = 0; $n < $period; ++$n) { - $fNRate = round($rate * $cost,0); - $fRest -= $fNRate; - - if ($fRest < 0.0) { - switch ($period - $n) { - case 0 : - case 1 : return round($cost * 0.5,0); - break; - default : return 0.0; - break; - } - } - $cost -= $fNRate; - } - return $fNRate; - } // function AMORDEGRC() - - - public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis=0) { - $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased); - $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod); - $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - $fOneRate = $cost * $rate; - $fCostDelta = $cost - $salvage; - // Note, quirky variation for leap years on the YEARFRAC for this function - $purchasedYear = PHPExcel_Calculation_DateTime::YEAR($purchased); - $yearFrac = PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis); - - if (($basis == 1) && ($yearFrac < 1) && (PHPExcel_Calculation_DateTime::_isLeapYear($purchasedYear))) { - $yearFrac *= 365 / 366; - } - - $f0Rate = $yearFrac * $rate * $cost; - $nNumOfFullPeriods = intval(($cost - $salvage - $f0Rate) / $fOneRate); - - if ($period == 0) { - return $f0Rate; - } elseif ($period <= $nNumOfFullPeriods) { - return $fOneRate; - } elseif ($period == ($nNumOfFullPeriods + 1)) { - return ($fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate); - } else { - return 0.0; - } - } // function AMORLINC() - - - public static function COUPDAYBS($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis); - $prev = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False); - - return PHPExcel_Calculation_DateTime::YEARFRAC($prev, $settlement, $basis) * $daysPerYear; - } // function COUPDAYBS() - - - public static function COUPDAYS($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - switch ($basis) { - case 3: // Actual/365 - return 365 / $frequency; - case 1: // Actual/actual - if ($frequency == 1) { - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($maturity),$basis); - return ($daysPerYear / $frequency); - } else { - $prev = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False); - $next = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True); - return ($next - $prev); - } - default: // US (NASD) 30/360, Actual/360 or European 30/360 - return 360 / $frequency; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function COUPDAYS() - - - public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis); - $next = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True); - - return PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $next, $basis) * $daysPerYear; - } // function COUPDAYSNC() - - - public static function COUPNCD($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True); - } // function COUPNCD() - - - public static function COUPNUM($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $settlement = self::_coupFirstPeriodDate($settlement, $maturity, $frequency, True); - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis) * 365; - - switch ($frequency) { - case 1: // annual payments - return ceil($daysBetweenSettlementAndMaturity / 360); - case 2: // half-yearly - return ceil($daysBetweenSettlementAndMaturity / 180); - case 4: // quarterly - return ceil($daysBetweenSettlementAndMaturity / 90); - case 6: // bimonthly - return ceil($daysBetweenSettlementAndMaturity / 60); - case 12: // monthly - return ceil($daysBetweenSettlementAndMaturity / 30); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function COUPNUM() - - - public static function COUPPCD($settlement, $maturity, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return self::_coupFirstPeriodDate($settlement, $maturity, $frequency, False); - } // function COUPPCD() - - - /** - * CUMIPMT - * - * Returns the cumulative interest paid on a loan between start_period and end_period. - * - * @param float $rate Interest rate per period - * @param int $nper Number of periods - * @param float $pv Present Value - * @param int start The first period in the calculation. - * Payment periods are numbered beginning with 1. - * @param int end The last period in the calculation. - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start); - $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end); - $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($start < 1 || $start > $end) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Calculate - $interest = 0; - for ($per = $start; $per <= $end; ++$per) { - $interest += self::IPMT($rate, $per, $nper, $pv, 0, $type); - } - - return $interest; - } // function CUMIPMT() - - - /** - * CUMPRINC - * - * Returns the cumulative principal paid on a loan between start_period and end_period. - * - * @param float $rate Interest rate per period - * @param int $nper Number of periods - * @param float $pv Present Value - * @param int start The first period in the calculation. - * Payment periods are numbered beginning with 1. - * @param int end The last period in the calculation. - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start); - $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end); - $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($start < 1 || $start > $end) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Calculate - $principal = 0; - for ($per = $start; $per <= $end; ++$per) { - $principal += self::PPMT($rate, $per, $nper, $pv, 0, $type); - } - - return $principal; - } // function CUMPRINC() - - - /** - * DB - * - * Returns the depreciation of an asset for a specified period using the fixed-declining balance method. - * This form of depreciation is used if you want to get a higher depreciation value at the beginning of the depreciation - * (as opposed to linear depreciation). The depreciation value is reduced with every depreciation period by the - * depreciation already deducted from the initial cost. - * - * @param float cost Initial cost of the asset. - * @param float salvage Value at the end of the depreciation. (Sometimes called the salvage value of the asset) - * @param int life Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset) - * @param int period The period for which you want to calculate the depreciation. Period must use the same units as life. - * @param float month Number of months in the first year. If month is omitted, it defaults to 12. - * @return float - */ - public static function DB($cost, $salvage, $life, $period, $month=12) { - $cost = (float) PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $salvage = (float) PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $life = (int) PHPExcel_Calculation_Functions::flattenSingleValue($life); - $period = (int) PHPExcel_Calculation_Functions::flattenSingleValue($period); - $month = (int) PHPExcel_Calculation_Functions::flattenSingleValue($month); - - // Validate - if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($month))) { - if ($cost == 0) { - return 0.0; - } elseif (($cost < 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($month < 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - // Set Fixed Depreciation Rate - $fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life)); - $fixedDepreciationRate = round($fixedDepreciationRate, 3); - - // Loop through each period calculating the depreciation - $previousDepreciation = 0; - for ($per = 1; $per <= $period; ++$per) { - if ($per == 1) { - $depreciation = $cost * $fixedDepreciationRate * $month / 12; - } elseif ($per == ($life + 1)) { - $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate * (12 - $month) / 12; - } else { - $depreciation = ($cost - $previousDepreciation) * $fixedDepreciationRate; - } - $previousDepreciation += $depreciation; - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $depreciation = round($depreciation,2); - } - return $depreciation; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function DB() - - - /** - * DDB - * - * Returns the depreciation of an asset for a specified period using the double-declining balance method or some other method you specify. - * - * @param float cost Initial cost of the asset. - * @param float salvage Value at the end of the depreciation. (Sometimes called the salvage value of the asset) - * @param int life Number of periods over which the asset is depreciated. (Sometimes called the useful life of the asset) - * @param int period The period for which you want to calculate the depreciation. Period must use the same units as life. - * @param float factor The rate at which the balance declines. - * If factor is omitted, it is assumed to be 2 (the double-declining balance method). - * @return float - */ - public static function DDB($cost, $salvage, $life, $period, $factor=2.0) { - $cost = (float) PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $salvage = (float) PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $life = (int) PHPExcel_Calculation_Functions::flattenSingleValue($life); - $period = (int) PHPExcel_Calculation_Functions::flattenSingleValue($period); - $factor = (float) PHPExcel_Calculation_Functions::flattenSingleValue($factor); - - // Validate - if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($factor))) { - if (($cost <= 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($factor <= 0.0) || ($period > $life)) { - return PHPExcel_Calculation_Functions::NaN(); - } - // Set Fixed Depreciation Rate - $fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life)); - $fixedDepreciationRate = round($fixedDepreciationRate, 3); - - // Loop through each period calculating the depreciation - $previousDepreciation = 0; - for ($per = 1; $per <= $period; ++$per) { - $depreciation = min( ($cost - $previousDepreciation) * ($factor / $life), ($cost - $salvage - $previousDepreciation) ); - $previousDepreciation += $depreciation; - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - $depreciation = round($depreciation,2); - } - return $depreciation; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function DDB() - - - /** - * DISC - * - * Returns the discount rate for a security. - * - * @param mixed settlement The security's settlement date. - * The security settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param int price The security's price per $100 face value. - * @param int redemption the security's redemption value per $100 face value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function DISC($settlement, $maturity, $price, $redemption, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $price = (float) PHPExcel_Calculation_Functions::flattenSingleValue($price); - $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) { - if (($price <= 0) || ($redemption <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - - return ((1 - $price / $redemption) / $daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function DISC() - - - /** - * DOLLARDE - * - * Converts a dollar price expressed as an integer part and a fraction part into a dollar price expressed as a decimal number. - * Fractional dollar numbers are sometimes used for security prices. - * - * @param float $fractional_dollar Fractional Dollar - * @param int $fraction Fraction - * @return float - */ - public static function DOLLARDE($fractional_dollar = Null, $fraction = 0) { - $fractional_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($fractional_dollar); - $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction); - - // Validate parameters - if (is_null($fractional_dollar) || $fraction < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($fraction == 0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $dollars = floor($fractional_dollar); - $cents = fmod($fractional_dollar,1); - $cents /= $fraction; - $cents *= pow(10,ceil(log10($fraction))); - return $dollars + $cents; - } // function DOLLARDE() - - - /** - * DOLLARFR - * - * Converts a dollar price expressed as a decimal number into a dollar price expressed as a fraction. - * Fractional dollar numbers are sometimes used for security prices. - * - * @param float $decimal_dollar Decimal Dollar - * @param int $fraction Fraction - * @return float - */ - public static function DOLLARFR($decimal_dollar = Null, $fraction = 0) { - $decimal_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($decimal_dollar); - $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction); - - // Validate parameters - if (is_null($decimal_dollar) || $fraction < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($fraction == 0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $dollars = floor($decimal_dollar); - $cents = fmod($decimal_dollar,1); - $cents *= $fraction; - $cents *= pow(10,-ceil(log10($fraction))); - return $dollars + $cents; - } // function DOLLARFR() - - - /** - * EFFECT - * - * Returns the effective interest rate given the nominal rate and the number of compounding payments per year. - * - * @param float $nominal_rate Nominal interest rate - * @param int $npery Number of compounding payments per year - * @return float - */ - public static function EFFECT($nominal_rate = 0, $npery = 0) { - $nominal_rate = PHPExcel_Calculation_Functions::flattenSingleValue($nominal_rate); - $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery); - - // Validate parameters - if ($nominal_rate <= 0 || $npery < 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return pow((1 + $nominal_rate / $npery), $npery) - 1; - } // function EFFECT() - - - /** - * FV - * - * Returns the Future Value of a cash flow with constant payments and interest rate (annuities). - * - * @param float $rate Interest rate per period - * @param int $nper Number of periods - * @param float $pmt Periodic payment (annuity) - * @param float $pv Present Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Calculate - if (!is_null($rate) && $rate != 0) { - return -$pv * pow(1 + $rate, $nper) - $pmt * (1 + $rate * $type) * (pow(1 + $rate, $nper) - 1) / $rate; - } else { - return -$pv - $pmt * $nper; - } - } // function FV() - - - /** - * FVSCHEDULE - * - */ - public static function FVSCHEDULE($principal, $schedule) { - $principal = PHPExcel_Calculation_Functions::flattenSingleValue($principal); - $schedule = PHPExcel_Calculation_Functions::flattenArray($schedule); - - foreach($schedule as $n) { - $principal *= 1 + $n; - } - - return $principal; - } // function FVSCHEDULE() - - - /** - * INTRATE - * - * Returns the interest rate for a fully invested security. - * - * @param mixed settlement The security's settlement date. - * The security settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param int investment The amount invested in the security. - * @param int redemption The amount to be received at maturity. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $investment = (float) PHPExcel_Calculation_Functions::flattenSingleValue($investment); - $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($investment)) && (is_numeric($redemption)) && (is_numeric($basis))) { - if (($investment <= 0) || ($redemption <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - - return (($redemption / $investment) - 1) / ($daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function INTRATE() - - - /** - * IPMT - * - * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. - * - * @param float $rate Interest rate per period - * @param int $per Period for which we want to find the interest - * @param int $nper Number of periods - * @param float $pv Present Value - * @param float $fv Future Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per); - $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($per <= 0 || $per > $nper) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Calculate - $interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type); - return $interestAndPrincipal[0]; - } // function IPMT() - - - public static function IRR($values, $guess = 0.1) { - if (!is_array($values)) return PHPExcel_Calculation_Functions::VALUE(); - $values = PHPExcel_Calculation_Functions::flattenArray($values); - $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess); - - // create an initial range, with a root somewhere between 0 and guess - $x1 = 0.0; - $x2 = $guess; - $f1 = self::NPV($x1, $values); - $f2 = self::NPV($x2, $values); - for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { - if (($f1 * $f2) < 0.0) break; - if (abs($f1) < abs($f2)) { - $f1 = self::NPV($x1 += 1.6 * ($x1 - $x2), $values); - } else { - $f2 = self::NPV($x2 += 1.6 * ($x2 - $x1), $values); - } - } - if (($f1 * $f2) > 0.0) return PHPExcel_Calculation_Functions::VALUE(); - - $f = self::NPV($x1, $values); - if ($f < 0.0) { - $rtb = $x1; - $dx = $x2 - $x1; - } else { - $rtb = $x2; - $dx = $x1 - $x2; - } - - for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { - $dx *= 0.5; - $x_mid = $rtb + $dx; - $f_mid = self::NPV($x_mid, $values); - if ($f_mid <= 0.0) $rtb = $x_mid; - if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) return $x_mid; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function IRR() - - - /** - * ISPMT - * - * Returns the interest payment for an investment based on an interest rate and a constant payment schedule. - * - * Excel Function: - * =ISPMT(interest_rate, period, number_payments, PV) - * - * interest_rate is the interest rate for the investment - * - * period is the period to calculate the interest rate. It must be betweeen 1 and number_payments. - * - * number_payments is the number of payments for the annuity - * - * PV is the loan amount or present value of the payments - */ - public static function ISPMT() { - // Return value - $returnValue = 0; - - // Get the parameters - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - $interestRate = array_shift($aArgs); - $period = array_shift($aArgs); - $numberPeriods = array_shift($aArgs); - $principleRemaining = array_shift($aArgs); - - // Calculate - $principlePayment = ($principleRemaining * 1.0) / ($numberPeriods * 1.0); - for($i=0; $i <= $period; ++$i) { - $returnValue = $interestRate * $principleRemaining * -1; - $principleRemaining -= $principlePayment; - // principle needs to be 0 after the last payment, don't let floating point screw it up - if($i == $numberPeriods) { - $returnValue = 0; - } - } - return($returnValue); - } // function ISPMT() - - - public static function MIRR($values, $finance_rate, $reinvestment_rate) { - if (!is_array($values)) return PHPExcel_Calculation_Functions::VALUE(); - $values = PHPExcel_Calculation_Functions::flattenArray($values); - $finance_rate = PHPExcel_Calculation_Functions::flattenSingleValue($finance_rate); - $reinvestment_rate = PHPExcel_Calculation_Functions::flattenSingleValue($reinvestment_rate); - $n = count($values); - - $rr = 1.0 + $reinvestment_rate; - $fr = 1.0 + $finance_rate; - - $npv_pos = $npv_neg = 0.0; - foreach($values as $i => $v) { - if ($v >= 0) { - $npv_pos += $v / pow($rr, $i); - } else { - $npv_neg += $v / pow($fr, $i); - } - } - - if (($npv_neg == 0) || ($npv_pos == 0) || ($reinvestment_rate <= -1)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - $mirr = pow((-$npv_pos * pow($rr, $n)) - / ($npv_neg * ($rr)), (1.0 / ($n - 1))) - 1.0; - - return (is_finite($mirr) ? $mirr : PHPExcel_Calculation_Functions::VALUE()); - } // function MIRR() - - - /** - * NOMINAL - * - * Returns the nominal interest rate given the effective rate and the number of compounding payments per year. - * - * @param float $effect_rate Effective interest rate - * @param int $npery Number of compounding payments per year - * @return float - */ - public static function NOMINAL($effect_rate = 0, $npery = 0) { - $effect_rate = PHPExcel_Calculation_Functions::flattenSingleValue($effect_rate); - $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery); - - // Validate parameters - if ($effect_rate <= 0 || $npery < 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Calculate - return $npery * (pow($effect_rate + 1, 1 / $npery) - 1); - } // function NOMINAL() - - - /** - * NPER - * - * Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate. - * - * @param float $rate Interest rate per period - * @param int $pmt Periodic payment (annuity) - * @param float $pv Present Value - * @param float $fv Future Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Calculate - if (!is_null($rate) && $rate != 0) { - if ($pmt == 0 && $pv == 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return log(($pmt * (1 + $rate * $type) / $rate - $fv) / ($pv + $pmt * (1 + $rate * $type) / $rate)) / log(1 + $rate); - } else { - if ($pmt == 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return (-$pv -$fv) / $pmt; - } - } // function NPER() - - - /** - * NPV - * - * Returns the Net Present Value of a cash flow series given a discount rate. - * - * @param float Discount interest rate - * @param array Cash flow series - * @return float - */ - public static function NPV() { - // Return value - $returnValue = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $rate = array_shift($aArgs); - for ($i = 1; $i <= count($aArgs); ++$i) { - // Is it a numeric value? - if (is_numeric($aArgs[$i - 1])) { - $returnValue += $aArgs[$i - 1] / pow(1 + $rate, $i); - } - } - - // Return - return $returnValue; - } // function NPV() - - - /** - * PMT - * - * Returns the constant payment (annuity) for a cash flow with a constant interest rate. - * - * @param float $rate Interest rate per period - * @param int $nper Number of periods - * @param float $pv Present Value - * @param float $fv Future Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Calculate - if (!is_null($rate) && $rate != 0) { - return (-$fv - $pv * pow(1 + $rate, $nper)) / (1 + $rate * $type) / ((pow(1 + $rate, $nper) - 1) / $rate); - } else { - return (-$pv - $fv) / $nper; - } - } // function PMT() - - - /** - * PPMT - * - * Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. - * - * @param float $rate Interest rate per period - * @param int $per Period for which we want to find the interest - * @param int $nper Number of periods - * @param float $pv Present Value - * @param float $fv Future Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per); - $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($per <= 0 || $per > $nper) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Calculate - $interestAndPrincipal = self::_interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type); - return $interestAndPrincipal[1]; - } // function PPMT() - - - public static function PRICE($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $rate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $yield = (float) PHPExcel_Calculation_Functions::flattenSingleValue($yield); - $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); - $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency); - $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - if (is_string($settlement = PHPExcel_Calculation_DateTime::_getDateValue($settlement))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (($settlement > $maturity) || - (!self::_validFrequency($frequency)) || - (($basis < 0) || ($basis > 4))) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $dsc = self::COUPDAYSNC($settlement, $maturity, $frequency, $basis); - $e = self::COUPDAYS($settlement, $maturity, $frequency, $basis); - $n = self::COUPNUM($settlement, $maturity, $frequency, $basis); - $a = self::COUPDAYBS($settlement, $maturity, $frequency, $basis); - - $baseYF = 1.0 + ($yield / $frequency); - $rfp = 100 * ($rate / $frequency); - $de = $dsc / $e; - - $result = $redemption / pow($baseYF, (--$n + $de)); - for($k = 0; $k <= $n; ++$k) { - $result += $rfp / (pow($baseYF, ($k + $de))); - } - $result -= $rfp * ($a / $e); - - return $result; - } // function PRICE() - - - /** - * PRICEDISC - * - * Returns the price per $100 face value of a discounted security. - * - * @param mixed settlement The security's settlement date. - * The security settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param int discount The security's discount rate. - * @param int redemption The security's redemption value per $100 face value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount); - $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($discount)) && (is_numeric($redemption)) && (is_numeric($basis))) { - if (($discount <= 0) || ($redemption <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - - return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function PRICEDISC() - - - /** - * PRICEMAT - * - * Returns the price per $100 face value of a security that pays interest at maturity. - * - * @param mixed settlement The security's settlement date. - * The security's settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param mixed issue The security's issue date. - * @param int rate The security's interest rate at date of issue. - * @param int yield The security's annual yield. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $yield = PHPExcel_Calculation_Functions::flattenSingleValue($yield); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if (is_numeric($rate) && is_numeric($yield)) { - if (($rate <= 0) || ($yield <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis); - if (!is_numeric($daysPerYear)) { - return $daysPerYear; - } - $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); - if (!is_numeric($daysBetweenIssueAndSettlement)) { - // return date error - return $daysBetweenIssueAndSettlement; - } - $daysBetweenIssueAndSettlement *= $daysPerYear; - $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis); - if (!is_numeric($daysBetweenIssueAndMaturity)) { - // return date error - return $daysBetweenIssueAndMaturity; - } - $daysBetweenIssueAndMaturity *= $daysPerYear; - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - $daysBetweenSettlementAndMaturity *= $daysPerYear; - - return ((100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) / - (1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield)) - - (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function PRICEMAT() - - - /** - * PV - * - * Returns the Present Value of a cash flow with constant payments and interest rate (annuities). - * - * @param float $rate Interest rate per period - * @param int $nper Number of periods - * @param float $pmt Periodic payment (annuity) - * @param float $fv Future Value - * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period - * @return float - */ - public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); - $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = PHPExcel_Calculation_Functions::flattenSingleValue($type); - - // Validate parameters - if ($type != 0 && $type != 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - - // Calculate - if (!is_null($rate) && $rate != 0) { - return (-$pmt * (1 + $rate * $type) * ((pow(1 + $rate, $nper) - 1) / $rate) - $fv) / pow(1 + $rate, $nper); - } else { - return -$fv - $pmt * $nper; - } - } // function PV() - - - /** - * RATE - * - **/ - public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1) { - $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper); - $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt); - $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv); - $fv = (is_null($fv)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($fv); - $type = (is_null($type)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($type); - $guess = (is_null($guess)) ? 0.1 : PHPExcel_Calculation_Functions::flattenSingleValue($guess); - - $rate = $guess; - if (abs($rate) < FINANCIAL_PRECISION) { - $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv; - } else { - $f = exp($nper * log(1 + $rate)); - $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; - } - $y0 = $pv + $pmt * $nper + $fv; - $y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; - - // find root by secant method - $i = $x0 = 0.0; - $x1 = $rate; - while ((abs($y0 - $y1) > FINANCIAL_PRECISION) && ($i < FINANCIAL_MAX_ITERATIONS)) { - $rate = ($y1 * $x0 - $y0 * $x1) / ($y1 - $y0); - $x0 = $x1; - $x1 = $rate; - - if (abs($rate) < FINANCIAL_PRECISION) { - $y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv; - } else { - $f = exp($nper * log(1 + $rate)); - $y = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv; - } - - $y0 = $y1; - $y1 = $y; - ++$i; - } - return $rate; - } // function RATE() - - - /** - * RECEIVED - * - * Returns the price per $100 face value of a discounted security. - * - * @param mixed settlement The security's settlement date. - * The security settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param int investment The amount invested in the security. - * @param int discount The security's discount rate. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $investment = (float) PHPExcel_Calculation_Functions::flattenSingleValue($investment); - $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if ((is_numeric($investment)) && (is_numeric($discount)) && (is_numeric($basis))) { - if (($investment <= 0) || ($discount <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - - return $investment / ( 1 - ($discount * $daysBetweenSettlementAndMaturity)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function RECEIVED() - - - /** - * SLN - * - * Returns the straight-line depreciation of an asset for one period - * - * @param cost Initial cost of the asset - * @param salvage Value at the end of the depreciation - * @param life Number of periods over which the asset is depreciated - * @return float - */ - public static function SLN($cost, $salvage, $life) { - $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); - - // Calculate - if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life))) { - if ($life < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return ($cost - $salvage) / $life; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SLN() - - - /** - * SYD - * - * Returns the sum-of-years' digits depreciation of an asset for a specified period. - * - * @param cost Initial cost of the asset - * @param salvage Value at the end of the depreciation - * @param life Number of periods over which the asset is depreciated - * @param period Period - * @return float - */ - public static function SYD($cost, $salvage, $life, $period) { - $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost); - $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage); - $life = PHPExcel_Calculation_Functions::flattenSingleValue($life); - $period = PHPExcel_Calculation_Functions::flattenSingleValue($period); - - // Calculate - if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period))) { - if (($life < 1) || ($period > $life)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SYD() - - - /** - * TBILLEQ - * - * Returns the bond-equivalent yield for a Treasury bill. - * - * @param mixed settlement The Treasury bill's settlement date. - * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. - * @param mixed maturity The Treasury bill's maturity date. - * The maturity date is the date when the Treasury bill expires. - * @param int discount The Treasury bill's discount rate. - * @return float - */ - public static function TBILLEQ($settlement, $maturity, $discount) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount); - - // Use TBILLPRICE for validation - $testValue = self::TBILLPRICE($settlement, $maturity, $discount); - if (is_string($testValue)) { - return $testValue; - } - - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - ++$maturity; - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; - } else { - $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement)); - } - - return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity); - } // function TBILLEQ() - - - /** - * TBILLPRICE - * - * Returns the yield for a Treasury bill. - * - * @param mixed settlement The Treasury bill's settlement date. - * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. - * @param mixed maturity The Treasury bill's maturity date. - * The maturity date is the date when the Treasury bill expires. - * @param int discount The Treasury bill's discount rate. - * @return float - */ - public static function TBILLPRICE($settlement, $maturity, $discount) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount); - - if (is_string($maturity = PHPExcel_Calculation_DateTime::_getDateValue($maturity))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Validate - if (is_numeric($discount)) { - if ($discount <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - ++$maturity; - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - } else { - $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement)); - } - - if ($daysBetweenSettlementAndMaturity > 360) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360)); - if ($price <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return $price; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TBILLPRICE() - - - /** - * TBILLYIELD - * - * Returns the yield for a Treasury bill. - * - * @param mixed settlement The Treasury bill's settlement date. - * The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer. - * @param mixed maturity The Treasury bill's maturity date. - * The maturity date is the date when the Treasury bill expires. - * @param int price The Treasury bill's price per $100 face value. - * @return float - */ - public static function TBILLYIELD($settlement, $maturity, $price) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); - - // Validate - if (is_numeric($price)) { - if ($price <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - ++$maturity; - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360; - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - } else { - $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::_getDateValue($maturity) - PHPExcel_Calculation_DateTime::_getDateValue($settlement)); - } - - if ($daysBetweenSettlementAndMaturity > 360) { - return PHPExcel_Calculation_Functions::NaN(); - } - - return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TBILLYIELD() - - - public static function XIRR($values, $dates, $guess = 0.1) { - if ((!is_array($values)) && (!is_array($dates))) return PHPExcel_Calculation_Functions::VALUE(); - $values = PHPExcel_Calculation_Functions::flattenArray($values); - $dates = PHPExcel_Calculation_Functions::flattenArray($dates); - $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess); - if (count($values) != count($dates)) return PHPExcel_Calculation_Functions::NaN(); - - // create an initial range, with a root somewhere between 0 and guess - $x1 = 0.0; - $x2 = $guess; - $f1 = self::XNPV($x1, $values, $dates); - $f2 = self::XNPV($x2, $values, $dates); - for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { - if (($f1 * $f2) < 0.0) break; - if (abs($f1) < abs($f2)) { - $f1 = self::XNPV($x1 += 1.6 * ($x1 - $x2), $values, $dates); - } else { - $f2 = self::XNPV($x2 += 1.6 * ($x2 - $x1), $values, $dates); - } - } - if (($f1 * $f2) > 0.0) return PHPExcel_Calculation_Functions::VALUE(); - - $f = self::XNPV($x1, $values, $dates); - if ($f < 0.0) { - $rtb = $x1; - $dx = $x2 - $x1; - } else { - $rtb = $x2; - $dx = $x1 - $x2; - } - - for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) { - $dx *= 0.5; - $x_mid = $rtb + $dx; - $f_mid = self::XNPV($x_mid, $values, $dates); - if ($f_mid <= 0.0) $rtb = $x_mid; - if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) return $x_mid; - } - return PHPExcel_Calculation_Functions::VALUE(); - } - - - /** - * XNPV - * - * Returns the net present value for a schedule of cash flows that is not necessarily periodic. - * To calculate the net present value for a series of cash flows that is periodic, use the NPV function. - * - * Excel Function: - * =XNPV(rate,values,dates) - * - * @param float $rate The discount rate to apply to the cash flows. - * @param array of float $values A series of cash flows that corresponds to a schedule of payments in dates. The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment. If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year. The series of values must contain at least one positive value and one negative value. - * @param array of mixed $dates A schedule of payment dates that corresponds to the cash flow payments. The first payment date indicates the beginning of the schedule of payments. All other dates must be later than this date, but they may occur in any order. - * @return float - */ - public static function XNPV($rate, $values, $dates) { - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - if (!is_numeric($rate)) return PHPExcel_Calculation_Functions::VALUE(); - if ((!is_array($values)) || (!is_array($dates))) return PHPExcel_Calculation_Functions::VALUE(); - $values = PHPExcel_Calculation_Functions::flattenArray($values); - $dates = PHPExcel_Calculation_Functions::flattenArray($dates); - $valCount = count($values); - if ($valCount != count($dates)) return PHPExcel_Calculation_Functions::NaN(); - if ((min($values) > 0) || (max($values) < 0)) return PHPExcel_Calculation_Functions::VALUE(); - - $xnpv = 0.0; - for ($i = 0; $i < $valCount; ++$i) { - if (!is_numeric($values[$i])) return PHPExcel_Calculation_Functions::VALUE(); - $xnpv += $values[$i] / pow(1 + $rate, PHPExcel_Calculation_DateTime::DATEDIF($dates[0],$dates[$i],'d') / 365); - } - return (is_finite($xnpv)) ? $xnpv : PHPExcel_Calculation_Functions::VALUE(); - } // function XNPV() - - - /** - * YIELDDISC - * - * Returns the annual yield of a security that pays interest at maturity. - * - * @param mixed settlement The security's settlement date. - * The security's settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param int price The security's price per $100 face value. - * @param int redemption The security's redemption value per $100 face value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); - $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if (is_numeric($price) && is_numeric($redemption)) { - if (($price <= 0) || ($redemption <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis); - if (!is_numeric($daysPerYear)) { - return $daysPerYear; - } - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity,$basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - $daysBetweenSettlementAndMaturity *= $daysPerYear; - - return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function YIELDDISC() - - - /** - * YIELDMAT - * - * Returns the annual yield of a security that pays interest at maturity. - * - * @param mixed settlement The security's settlement date. - * The security's settlement date is the date after the issue date when the security is traded to the buyer. - * @param mixed maturity The security's maturity date. - * The maturity date is the date when the security expires. - * @param mixed issue The security's issue date. - * @param int rate The security's interest rate at date of issue. - * @param int price The security's price per $100 face value. - * @param int basis The type of day count to use. - * 0 or omitted US (NASD) 30/360 - * 1 Actual/actual - * 2 Actual/360 - * 3 Actual/365 - * 4 European 30/360 - * @return float - */ - public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis=0) { - $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement); - $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity); - $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue); - $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate); - $price = PHPExcel_Calculation_Functions::flattenSingleValue($price); - $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis); - - // Validate - if (is_numeric($rate) && is_numeric($price)) { - if (($rate <= 0) || ($price <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $daysPerYear = self::_daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement),$basis); - if (!is_numeric($daysPerYear)) { - return $daysPerYear; - } - $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis); - if (!is_numeric($daysBetweenIssueAndSettlement)) { - // return date error - return $daysBetweenIssueAndSettlement; - } - $daysBetweenIssueAndSettlement *= $daysPerYear; - $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis); - if (!is_numeric($daysBetweenIssueAndMaturity)) { - // return date error - return $daysBetweenIssueAndMaturity; - } - $daysBetweenIssueAndMaturity *= $daysPerYear; - $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis); - if (!is_numeric($daysBetweenSettlementAndMaturity)) { - // return date error - return $daysBetweenSettlementAndMaturity; - } - $daysBetweenSettlementAndMaturity *= $daysPerYear; - - return ((1 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate) - (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) / - (($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) * - ($daysPerYear / $daysBetweenSettlementAndMaturity); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function YIELDMAT() - -} // class PHPExcel_Calculation_Financial diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaParser.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaParser.php deleted file mode 100644 index f8ffe579f4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaParser.php +++ /dev/null @@ -1,614 +0,0 @@ -<"; - const OPERATORS_POSTFIX = "%"; - - /** - * Formula - * - * @var string - */ - private $_formula; - - /** - * Tokens - * - * @var PHPExcel_Calculation_FormulaToken[] - */ - private $_tokens = array(); - - /** - * Create a new PHPExcel_Calculation_FormulaParser - * - * @param string $pFormula Formula to parse - * @throws Exception - */ - public function __construct($pFormula = '') - { - // Check parameters - if (is_null($pFormula)) { - throw new Exception("Invalid parameter passed: formula"); - } - - // Initialise values - $this->_formula = trim($pFormula); - // Parse! - $this->_parseToTokens(); - } - - /** - * Get Formula - * - * @return string - */ - public function getFormula() { - return $this->_formula; - } - - /** - * Get Token - * - * @param int $pId Token id - * @return string - * @throws Exception - */ - public function getToken($pId = 0) { - if (isset($this->_tokens[$pId])) { - return $this->_tokens[$pId]; - } else { - throw new Exception("Token with id $pId does not exist."); - } - } - - /** - * Get Token count - * - * @return string - */ - public function getTokenCount() { - return count($this->_tokens); - } - - /** - * Get Tokens - * - * @return PHPExcel_Calculation_FormulaToken[] - */ - public function getTokens() { - return $this->_tokens; - } - - /** - * Parse to tokens - */ - private function _parseToTokens() { - // No attempt is made to verify formulas; assumes formulas are derived from Excel, where - // they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions. - - // Check if the formula has a valid starting = - $formulaLength = strlen($this->_formula); - if ($formulaLength < 2 || $this->_formula{0} != '=') return; - - // Helper variables - $tokens1 = $tokens2 = $stack = array(); - $inString = $inPath = $inRange = $inError = false; - $token = $previousToken = $nextToken = null; - - $index = 1; - $value = ''; - - $ERRORS = array("#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A"); - $COMPARATORS_MULTI = array(">=", "<=", "<>"); - - while ($index < $formulaLength) { - // state-dependent character evaluation (order is important) - - // double-quoted strings - // embeds are doubled - // end marks token - if ($inString) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { - if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) { - $value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE; - ++$index; - } else { - $inString = false; - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_TEXT); - $value = ""; - } - } else { - $value .= $this->_formula{$index}; - } - ++$index; - continue; - } - - // single-quoted strings (links) - // embeds are double - // end does not mark a token - if ($inPath) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { - if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) { - $value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE; - ++$index; - } else { - $inPath = false; - } - } else { - $value .= $this->_formula{$index}; - } - ++$index; - continue; - } - - // bracked strings (R1C1 range index or linked workbook name) - // no embeds (changed to "()" by Excel) - // end does not mark a token - if ($inRange) { - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) { - $inRange = false; - } - $value .= $this->_formula{$index}; - ++$index; - continue; - } - - // error values - // end marks a token, determined from absolute list of values - if ($inError) { - $value .= $this->_formula{$index}; - ++$index; - if (in_array($value, $ERRORS)) { - $inError = false; - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_ERROR); - $value = ""; - } - continue; - } - - // scientific notation check - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula{$index}) !== false) { - if (strlen($value) > 1) { - if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula{$index}) != 0) { - $value .= $this->_formula{$index}; - ++$index; - continue; - } - } - } - - // independent character evaluation (order not important) - - // establish state-dependent character evaluations - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) { - if (strlen($value > 0)) { // unexpected - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); - $value = ""; - } - $inString = true; - ++$index; - continue; - } - - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) { - if (strlen($value) > 0) { // unexpected - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); - $value = ""; - } - $inPath = true; - ++$index; - continue; - } - - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) { - $inRange = true; - $value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN; - ++$index; - continue; - } - - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) { - if (strlen($value) > 0) { // unexpected - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); - $value = ""; - } - $inError = true; - $value .= PHPExcel_Calculation_FormulaParser::ERROR_START; - ++$index; - continue; - } - - // mark start and end of arrays and array rows - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) { - if (strlen($value) > 0) { // unexpected - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN); - $value = ""; - } - - $tmp = new PHPExcel_Calculation_FormulaToken("ARRAY", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); - $tokens1[] = $tmp; - $stack[] = clone $tmp; - - $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); - $tokens1[] = $tmp; - $stack[] = clone $tmp; - - ++$index; - continue; - } - - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - - $tmp = array_pop($stack); - $tmp->setValue(""); - $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); - $tokens1[] = $tmp; - - $tmp = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT); - $tokens1[] = $tmp; - - $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); - $tokens1[] = $tmp; - $stack[] = clone $tmp; - - ++$index; - continue; - } - - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - - $tmp = array_pop($stack); - $tmp->setValue(""); - $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); - $tokens1[] = $tmp; - - $tmp = array_pop($stack); - $tmp->setValue(""); - $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); - $tokens1[] = $tmp; - - ++$index; - continue; - } - - // trim white-space - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - $tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE); - ++$index; - while (($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) { - ++$index; - } - continue; - } - - // multi-character comparators - if (($index + 2) <= $formulaLength) { - if (in_array(substr($this->_formula, $index, 2), $COMPARATORS_MULTI)) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - $tokens1[] = new PHPExcel_Calculation_FormulaToken(substr($this->_formula, $index, 2), PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); - $index += 2; - continue; - } - } - - // standard infix operators - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula{$index}) !== false) { - if (strlen($value) > 0) { - $tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX); - ++$index; - continue; - } - - // standard postfix operators (only one) - if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula{$index}) !== false) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX); - ++$index; - continue; - } - - // start subexpression or function - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) { - if (strlen($value) > 0) { - $tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); - $tokens1[] = $tmp; - $stack[] = clone $tmp; - $value = ""; - } else { - $tmp = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START); - $tokens1[] = $tmp; - $stack[] = clone $tmp; - } - ++$index; - continue; - } - - // function, subexpression, or array parameters, or operand unions - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - - $tmp = array_pop($stack); - $tmp->setValue(""); - $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); - $stack[] = $tmp; - - if ($tmp->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_UNION); - } else { - $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT); - } - ++$index; - continue; - } - - // stop subexpression - if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) { - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - $value = ""; - } - - $tmp = array_pop($stack); - $tmp->setValue(""); - $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP); - $tokens1[] = $tmp; - - ++$index; - continue; - } - - // token accumulation - $value .= $this->_formula{$index}; - ++$index; - } - - // dump remaining accumulation - if (strlen($value) > 0) { - $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND); - } - - // move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections - $tokenCount = count($tokens1); - for ($i = 0; $i < $tokenCount; ++$i) { - $token = $tokens1[$i]; - if (isset($tokens1[$i - 1])) { - $previousToken = $tokens1[$i - 1]; - } else { - $previousToken = null; - } - if (isset($tokens1[$i + 1])) { - $nextToken = $tokens1[$i + 1]; - } else { - $nextToken = null; - } - - if (is_null($token)) { - continue; - } - - if ($token->getTokenType() != PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE) { - $tokens2[] = $token; - continue; - } - - if (is_null($previousToken)) { - continue; - } - - if (! ( - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) - ) ) { - continue; - } - - if (is_null($nextToken)) { - continue; - } - - if (! ( - (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) || - (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) || - ($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) - ) ) { - continue; - } - - $tokens2[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_INTERSECTION); - } - - // move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators - // to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names - $this->_tokens = array(); - - $tokenCount = count($tokens2); - for ($i = 0; $i < $tokenCount; ++$i) { - $token = $tokens2[$i]; - if (isset($tokens2[$i - 1])) { - $previousToken = $tokens2[$i - 1]; - } else { - $previousToken = null; - } - if (isset($tokens2[$i + 1])) { - $nextToken = $tokens2[$i + 1]; - } else { - $nextToken = null; - } - - if (is_null($token)) { - continue; - } - - if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "-") { - if ($i == 0) { - $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX); - } else if ( - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) || - ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) - ) { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); - } else { - $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX); - } - - $this->_tokens[] = $token; - continue; - } - - if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "+") { - if ($i == 0) { - continue; - } else if ( - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) || - ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) || - ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND) - ) { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); - } else { - continue; - } - - $this->_tokens[] = $token; - continue; - } - - if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) { - if (strpos("<>=", substr($token->getValue(), 0, 1)) !== false) { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); - } else if ($token->getValue() == "&") { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_CONCATENATION); - } else { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH); - } - - $this->_tokens[] = $token; - continue; - } - - if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND && $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) { - if (!is_numeric($token->getValue())) { - if (strtoupper($token->getValue()) == "TRUE" || strtoupper($token->getValue() == "FALSE")) { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL); - } else { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_RANGE); - } - } else { - $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NUMBER); - } - - $this->_tokens[] = $token; - continue; - } - - if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) { - if (strlen($token->getValue() > 0)) { - if (substr($token->getValue(), 0, 1) == "@") { - $token->setValue(substr($token->getValue(), 1)); - } - } - } - - $this->_tokens[] = $token; - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaToken.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaToken.php deleted file mode 100644 index 3045a9a893..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/FormulaToken.php +++ /dev/null @@ -1,176 +0,0 @@ -_value = $pValue; - $this->_tokenType = $pTokenType; - $this->_tokenSubType = $pTokenSubType; - } - - /** - * Get Value - * - * @return string - */ - public function getValue() { - return $this->_value; - } - - /** - * Set Value - * - * @param string $value - */ - public function setValue($value) { - $this->_value = $value; - } - - /** - * Get Token Type (represented by TOKEN_TYPE_*) - * - * @return string - */ - public function getTokenType() { - return $this->_tokenType; - } - - /** - * Set Token Type - * - * @param string $value - */ - public function setTokenType($value = PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN) { - $this->_tokenType = $value; - } - - /** - * Get Token SubType (represented by TOKEN_SUBTYPE_*) - * - * @return string - */ - public function getTokenSubType() { - return $this->_tokenSubType; - } - - /** - * Set Token SubType - * - * @param string $value - */ - public function setTokenSubType($value = PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) { - $this->_tokenSubType = $value; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Function.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Function.php deleted file mode 100644 index 14c9294f25..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Function.php +++ /dev/null @@ -1,149 +0,0 @@ -_category = $pCategory; - $this->_excelName = $pExcelName; - $this->_phpExcelName = $pPHPExcelName; - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Get Category (represented by CATEGORY_*) - * - * @return string - */ - public function getCategory() { - return $this->_category; - } - - /** - * Set Category (represented by CATEGORY_*) - * - * @param string $value - * @throws Exception - */ - public function setCategory($value = null) { - if (!is_null($value)) { - $this->_category = $value; - } else { - throw new Exception("Invalid parameter passed."); - } - } - - /** - * Get Excel name - * - * @return string - */ - public function getExcelName() { - return $this->_excelName; - } - - /** - * Set Excel name - * - * @param string $value - */ - public function setExcelName($value) { - $this->_excelName = $value; - } - - /** - * Get PHPExcel name - * - * @return string - */ - public function getPHPExcelName() { - return $this->_phpExcelName; - } - - /** - * Set PHPExcel name - * - * @param string $value - */ - public function setPHPExcelName($value) { - $this->_phpExcelName = $value; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Functions.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Functions.php deleted file mode 100644 index 33f962adb7..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Functions.php +++ /dev/null @@ -1,802 +0,0 @@ - '#NULL!', - 'divisionbyzero' => '#DIV/0!', - 'value' => '#VALUE!', - 'reference' => '#REF!', - 'name' => '#NAME?', - 'num' => '#NUM!', - 'na' => '#N/A', - 'gettingdata' => '#GETTING_DATA' - ); - - - /** - * Set the Compatibility Mode - * - * @access public - * @category Function Configuration - * @param string $compatibilityMode Compatibility Mode - * Permitted values are: - * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' - * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' - * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc' - * @return boolean (Success or Failure) - */ - public static function setCompatibilityMode($compatibilityMode) { - if (($compatibilityMode == self::COMPATIBILITY_EXCEL) || - ($compatibilityMode == self::COMPATIBILITY_GNUMERIC) || - ($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)) { - self::$compatibilityMode = $compatibilityMode; - return True; - } - return False; - } // function setCompatibilityMode() - - - /** - * Return the current Compatibility Mode - * - * @access public - * @category Function Configuration - * @return string Compatibility Mode - * Possible Return values are: - * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel' - * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric' - * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc' - */ - public static function getCompatibilityMode() { - return self::$compatibilityMode; - } // function getCompatibilityMode() - - - /** - * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object) - * - * @access public - * @category Function Configuration - * @param string $returnDateType Return Date Format - * Permitted values are: - * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' - * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' - * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E' - * @return boolean Success or failure - */ - public static function setReturnDateType($returnDateType) { - if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) || - ($returnDateType == self::RETURNDATE_PHP_OBJECT) || - ($returnDateType == self::RETURNDATE_EXCEL)) { - self::$ReturnDateType = $returnDateType; - return True; - } - return False; - } // function setReturnDateType() - - - /** - * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object) - * - * @access public - * @category Function Configuration - * @return string Return Date Format - * Possible Return values are: - * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P' - * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O' - * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E' - */ - public static function getReturnDateType() { - return self::$ReturnDateType; - } // function getReturnDateType() - - - /** - * DUMMY - * - * @access public - * @category Error Returns - * @return string #Not Yet Implemented - */ - public static function DUMMY() { - return '#Not Yet Implemented'; - } // function DUMMY() - - - /** - * DIV0 - * - * @access public - * @category Error Returns - * @return string #Not Yet Implemented - */ - public static function DIV0() { - return self::$_errorCodes['divisionbyzero']; - } // function DIV0() - - - /** - * NA - * - * Excel Function: - * =NA() - * - * Returns the error value #N/A - * #N/A is the error value that means "no value is available." - * - * @access public - * @category Logical Functions - * @return string #N/A! - */ - public static function NA() { - return self::$_errorCodes['na']; - } // function NA() - - - /** - * NaN - * - * Returns the error value #NUM! - * - * @access public - * @category Error Returns - * @return string #NUM! - */ - public static function NaN() { - return self::$_errorCodes['num']; - } // function NaN() - - - /** - * NAME - * - * Returns the error value #NAME? - * - * @access public - * @category Error Returns - * @return string #NAME? - */ - public static function NAME() { - return self::$_errorCodes['name']; - } // function NAME() - - - /** - * REF - * - * Returns the error value #REF! - * - * @access public - * @category Error Returns - * @return string #REF! - */ - public static function REF() { - return self::$_errorCodes['reference']; - } // function REF() - - - /** - * NULL - * - * Returns the error value #NULL! - * - * @access public - * @category Error Returns - * @return string #REF! - */ - public static function NULL() { - return self::$_errorCodes['null']; - } // function NULL() - - - /** - * VALUE - * - * Returns the error value #VALUE! - * - * @access public - * @category Error Returns - * @return string #VALUE! - */ - public static function VALUE() { - return self::$_errorCodes['value']; - } // function VALUE() - - - public static function isMatrixValue($idx) { - return ((substr_count($idx,'.') <= 1) || (preg_match('/\.[A-Z]/',$idx) > 0)); - } - - - public static function isValue($idx) { - return (substr_count($idx,'.') == 0); - } - - - public static function isCellValue($idx) { - return (substr_count($idx,'.') > 1); - } - - - public static function _ifCondition($condition) { - $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition); - if (!in_array($condition{0},array('>', '<', '='))) { - if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); } - return '='.$condition; - } else { - preg_match('/([<>=]+)(.*)/',$condition,$matches); - list(,$operator,$operand) = $matches; - if (!is_numeric($operand)) { $operand = PHPExcel_Calculation::_wrapResult(strtoupper($operand)); } - return $operator.$operand; - } - } // function _ifCondition() - - - /** - * ERROR_TYPE - * - * @param mixed $value Value to check - * @return boolean - */ - public static function ERROR_TYPE($value = '') { - $value = self::flattenSingleValue($value); - - $i = 1; - foreach(self::$_errorCodes as $errorCode) { - if ($value == $errorCode) { - return $i; - } - ++$i; - } - return self::$_errorCodes['na']; - } // function ERROR_TYPE() - - - /** - * IS_BLANK - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_BLANK($value=null) { - if (!is_null($value)) { - $value = self::flattenSingleValue($value); - } - - return is_null($value); - } // function IS_BLANK() - - - /** - * IS_ERR - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_ERR($value = '') { - $value = self::flattenSingleValue($value); - - return self::IS_ERROR($value) && (!self::IS_NA($value)); - } // function IS_ERR() - - - /** - * IS_ERROR - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_ERROR($value = '') { - $value = self::flattenSingleValue($value); - - return in_array($value, array_values(self::$_errorCodes)); - } // function IS_ERROR() - - - /** - * IS_NA - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_NA($value = '') { - $value = self::flattenSingleValue($value); - - return ($value === self::$_errorCodes['na']); - } // function IS_NA() - - - /** - * IS_EVEN - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_EVEN($value = 0) { - $value = self::flattenSingleValue($value); - - if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) { - return self::$_errorCodes['value']; - } - return ($value % 2 == 0); - } // function IS_EVEN() - - - /** - * IS_ODD - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_ODD($value = null) { - $value = self::flattenSingleValue($value); - - if ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) { - return self::$_errorCodes['value']; - } - return (abs($value) % 2 == 1); - } // function IS_ODD() - - - /** - * IS_NUMBER - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_NUMBER($value = 0) { - $value = self::flattenSingleValue($value); - - if (is_string($value)) { - return False; - } - return is_numeric($value); - } // function IS_NUMBER() - - - /** - * IS_LOGICAL - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_LOGICAL($value = true) { - $value = self::flattenSingleValue($value); - - return is_bool($value); - } // function IS_LOGICAL() - - - /** - * IS_TEXT - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_TEXT($value = '') { - $value = self::flattenSingleValue($value); - - return is_string($value); - } // function IS_TEXT() - - - /** - * IS_NONTEXT - * - * @param mixed $value Value to check - * @return boolean - */ - public static function IS_NONTEXT($value = '') { - return !self::IS_TEXT($value); - } // function IS_NONTEXT() - - - /** - * VERSION - * - * @return string Version information - */ - public static function VERSION() { - return 'PHPExcel 1.7.6, 2011-02-27'; - } // function VERSION() - - - /** - * N - * - * Returns a value converted to a number - * - * @param value The value you want converted - * @return number N converts values listed in the following table - * If value is or refers to N returns - * A number That number - * A date The serial number of that date - * TRUE 1 - * FALSE 0 - * An error value The error value - * Anything else 0 - */ - public static function N($value) { - while (is_array($value)) { - $value = array_shift($value); - } - - switch (gettype($value)) { - case 'double' : - case 'float' : - case 'integer' : - return $value; - break; - case 'boolean' : - return (integer) $value; - break; - case 'string' : - // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { - return $value; - } - break; - } - return 0; - } // function N() - - - /** - * TYPE - * - * Returns a number that identifies the type of a value - * - * @param value The value you want tested - * @return number N converts values listed in the following table - * If value is or refers to N returns - * A number 1 - * Text 2 - * Logical Value 4 - * An error value 16 - * Array or Matrix 64 - */ - public static function TYPE($value) { - $value = self::flattenArrayIndexed($value); - if (is_array($value) && (count($value) > 1)) { - $a = array_keys($value); - $a = array_pop($a); - // Range of cells is an error - if (self::isCellValue($a)) { - return 16; - // Test for Matrix - } elseif (self::isMatrixValue($a)) { - return 64; - } - } elseif(count($value) == 0) { - // Empty Cell - return 1; - } - $value = self::flattenSingleValue($value); - - if ((is_float($value)) || (is_int($value))) { - return 1; - } elseif(is_bool($value)) { - return 4; - } elseif(is_array($value)) { - return 64; - } elseif(is_string($value)) { - // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { - return 16; - } - return 2; - } - return 0; - } // function TYPE() - - - /** - * Convert a multi-dimensional array to a simple 1-dimensional array - * - * @param array $array Array to be flattened - * @return array Flattened array - */ - public static function flattenArray($array) { - if (!is_array($array)) { - return (array) $array; - } - - $arrayValues = array(); - foreach ($array as $value) { - if (is_array($value)) { - foreach ($value as $val) { - if (is_array($val)) { - foreach ($val as $v) { - $arrayValues[] = $v; - } - } else { - $arrayValues[] = $val; - } - } - } else { - $arrayValues[] = $value; - } - } - - return $arrayValues; - } // function flattenArray() - - - /** - * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing - * - * @param array $array Array to be flattened - * @return array Flattened array - */ - public static function flattenArrayIndexed($array) { - if (!is_array($array)) { - return (array) $array; - } - - $arrayValues = array(); - foreach ($array as $k1 => $value) { - if (is_array($value)) { - foreach ($value as $k2 => $val) { - if (is_array($val)) { - foreach ($val as $k3 => $v) { - $arrayValues[$k1.'.'.$k2.'.'.$k3] = $v; - } - } else { - $arrayValues[$k1.'.'.$k2] = $val; - } - } - } else { - $arrayValues[$k1] = $value; - } - } - - return $arrayValues; - } // function flattenArrayIndexed() - - - /** - * Convert an array to a single scalar value by extracting the first element - * - * @param mixed $value Array or scalar value - * @return mixed - */ - public static function flattenSingleValue($value = '') { - while (is_array($value)) { - $value = array_pop($value); - } - - return $value; - } // function flattenSingleValue() - -} // class PHPExcel_Calculation_Functions - - -// -// There are a few mathematical functions that aren't available on all versions of PHP for all platforms -// These functions aren't available in Windows implementations of PHP prior to version 5.3.0 -// So we test if they do exist for this version of PHP/operating platform; and if not we create them -// -if (!function_exists('acosh')) { - function acosh($x) { - return 2 * log(sqrt(($x + 1) / 2) + sqrt(($x - 1) / 2)); - } // function acosh() -} - -if (!function_exists('asinh')) { - function asinh($x) { - return log($x + sqrt(1 + $x * $x)); - } // function asinh() -} - -if (!function_exists('atanh')) { - function atanh($x) { - return (log(1 + $x) - log(1 - $x)) / 2; - } // function atanh() -} - -if (!function_exists('money_format')) { - function money_format($format, $number) { - $regex = array( '/%((?:[\^!\-]|\+|\(|\=.)*)([0-9]+)?(?:#([0-9]+))?', - '(?:\.([0-9]+))?([in%])/' - ); - $regex = implode('', $regex); - if (setlocale(LC_MONETARY, null) == '') { - setlocale(LC_MONETARY, ''); - } - $locale = localeconv(); - $number = floatval($number); - if (!preg_match($regex, $format, $fmatch)) { - trigger_error("No format specified or invalid format", E_USER_WARNING); - return $number; - } - $flags = array( 'fillchar' => preg_match('/\=(.)/', $fmatch[1], $match) ? $match[1] : ' ', - 'nogroup' => preg_match('/\^/', $fmatch[1]) > 0, - 'usesignal' => preg_match('/\+|\(/', $fmatch[1], $match) ? $match[0] : '+', - 'nosimbol' => preg_match('/\!/', $fmatch[1]) > 0, - 'isleft' => preg_match('/\-/', $fmatch[1]) > 0 - ); - $width = trim($fmatch[2]) ? (int)$fmatch[2] : 0; - $left = trim($fmatch[3]) ? (int)$fmatch[3] : 0; - $right = trim($fmatch[4]) ? (int)$fmatch[4] : $locale['int_frac_digits']; - $conversion = $fmatch[5]; - $positive = true; - if ($number < 0) { - $positive = false; - $number *= -1; - } - $letter = $positive ? 'p' : 'n'; - $prefix = $suffix = $cprefix = $csuffix = $signal = ''; - if (!$positive) { - $signal = $locale['negative_sign']; - switch (true) { - case $locale['n_sign_posn'] == 0 || $flags['usesignal'] == '(': - $prefix = '('; - $suffix = ')'; - break; - case $locale['n_sign_posn'] == 1: - $prefix = $signal; - break; - case $locale['n_sign_posn'] == 2: - $suffix = $signal; - break; - case $locale['n_sign_posn'] == 3: - $cprefix = $signal; - break; - case $locale['n_sign_posn'] == 4: - $csuffix = $signal; - break; - } - } - if (!$flags['nosimbol']) { - $currency = $cprefix; - $currency .= ($conversion == 'i' ? $locale['int_curr_symbol'] : $locale['currency_symbol']); - $currency .= $csuffix; - $currency = iconv('ISO-8859-1','UTF-8',$currency); - } else { - $currency = ''; - } - $space = $locale["{$letter}_sep_by_space"] ? ' ' : ''; - - $number = number_format($number, $right, $locale['mon_decimal_point'], $flags['nogroup'] ? '' : $locale['mon_thousands_sep'] ); - $number = explode($locale['mon_decimal_point'], $number); - - $n = strlen($prefix) + strlen($currency); - if ($left > 0 && $left > $n) { - if ($flags['isleft']) { - $number[0] .= str_repeat($flags['fillchar'], $left - $n); - } else { - $number[0] = str_repeat($flags['fillchar'], $left - $n) . $number[0]; - } - } - $number = implode($locale['mon_decimal_point'], $number); - if ($locale["{$letter}_cs_precedes"]) { - $number = $prefix . $currency . $space . $number . $suffix; - } else { - $number = $prefix . $number . $space . $currency . $suffix; - } - if ($width > 0) { - $number = str_pad($number, $width, $flags['fillchar'], $flags['isleft'] ? STR_PAD_RIGHT : STR_PAD_LEFT); - } - $format = str_replace($fmatch[0], $number, $format); - return $format; - } // function money_format() -} - - -// -// Strangely, PHP doesn't have a mb_str_replace multibyte function -// As we'll only ever use this function with UTF-8 characters, we can simply "hard-code" the character set -// -if ((!function_exists('mb_str_replace')) && - (function_exists('mb_substr')) && (function_exists('mb_strlen')) && (function_exists('mb_strpos'))) { - function mb_str_replace($search, $replace, $subject) { - if(is_array($subject)) { - $ret = array(); - foreach($subject as $key => $val) { - $ret[$key] = mb_str_replace($search, $replace, $val); - } - return $ret; - } - - foreach((array) $search as $key => $s) { - if($s == '') { - continue; - } - $r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : ''); - $pos = mb_strpos($subject, $s, 0, 'UTF-8'); - while($pos !== false) { - $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8'); - $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8'); - } - } - return $subject; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Logical.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Logical.php deleted file mode 100644 index 427cc343af..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Logical.php +++ /dev/null @@ -1,290 +0,0 @@ - '') { - if (strpos($sheetText,' ') !== False) { $sheetText = "'".$sheetText."'"; } - $sheetText .='!'; - } - if ((!is_bool($referenceStyle)) || $referenceStyle) { - $rowRelative = $columnRelative = '$'; - $column = PHPExcel_Cell::stringFromColumnIndex($column-1); - if (($relativity == 2) || ($relativity == 4)) { $columnRelative = ''; } - if (($relativity == 3) || ($relativity == 4)) { $rowRelative = ''; } - return $sheetText.$columnRelative.$column.$rowRelative.$row; - } else { - if (($relativity == 2) || ($relativity == 4)) { $column = '['.$column.']'; } - if (($relativity == 3) || ($relativity == 4)) { $row = '['.$row.']'; } - return $sheetText.'R'.$row.'C'.$column; - } - } // function CELL_ADDRESS() - - - /** - * COLUMN - * - * Returns the column number of the given cell reference - * If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array. - * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the - * reference of the cell in which the COLUMN function appears; otherwise this function returns 0. - * - * @param cellAddress A reference to a range of cells for which you want the column numbers - * @return integer or array of integer - */ - public static function COLUMN($cellAddress=Null) { - if (is_null($cellAddress) || trim($cellAddress) === '') { return 0; } - - if (is_array($cellAddress)) { - foreach($cellAddress as $columnKey => $value) { - $columnKey = preg_replace('/[^a-z]/i','',$columnKey); - return (integer) PHPExcel_Cell::columnIndexFromString($columnKey); - } - } else { - if (strpos($cellAddress,'!') !== false) { - list($sheet,$cellAddress) = explode('!',$cellAddress); - } - if (strpos($cellAddress,':') !== false) { - list($startAddress,$endAddress) = explode(':',$cellAddress); - $startAddress = preg_replace('/[^a-z]/i','',$startAddress); - $endAddress = preg_replace('/[^a-z]/i','',$endAddress); - $returnValue = array(); - do { - $returnValue[] = (integer) PHPExcel_Cell::columnIndexFromString($startAddress); - } while ($startAddress++ != $endAddress); - return $returnValue; - } else { - $cellAddress = preg_replace('/[^a-z]/i','',$cellAddress); - return (integer) PHPExcel_Cell::columnIndexFromString($cellAddress); - } - } - } // function COLUMN() - - - /** - * COLUMNS - * - * Returns the number of columns in an array or reference. - * - * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns - * @return integer - */ - public static function COLUMNS($cellAddress=Null) { - if (is_null($cellAddress) || $cellAddress === '') { - return 1; - } elseif (!is_array($cellAddress)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - $x = array_keys($cellAddress); - $x = array_shift($x); - $isMatrix = (is_numeric($x)); - list($columns,$rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress); - - if ($isMatrix) { - return $rows; - } else { - return $columns; - } - } // function COLUMNS() - - - /** - * ROW - * - * Returns the row number of the given cell reference - * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array. - * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the - * reference of the cell in which the ROW function appears; otherwise this function returns 0. - * - * @param cellAddress A reference to a range of cells for which you want the row numbers - * @return integer or array of integer - */ - public static function ROW($cellAddress=Null) { - if (is_null($cellAddress) || trim($cellAddress) === '') { return 0; } - - if (is_array($cellAddress)) { - foreach($cellAddress as $columnKey => $rowValue) { - foreach($rowValue as $rowKey => $cellValue) { - return (integer) preg_replace('/[^0-9]/i','',$rowKey); - } - } - } else { - if (strpos($cellAddress,'!') !== false) { - list($sheet,$cellAddress) = explode('!',$cellAddress); - } - if (strpos($cellAddress,':') !== false) { - list($startAddress,$endAddress) = explode(':',$cellAddress); - $startAddress = preg_replace('/[^0-9]/','',$startAddress); - $endAddress = preg_replace('/[^0-9]/','',$endAddress); - $returnValue = array(); - do { - $returnValue[][] = (integer) $startAddress; - } while ($startAddress++ != $endAddress); - return $returnValue; - } else { - list($cellAddress) = explode(':',$cellAddress); - return (integer) preg_replace('/[^0-9]/','',$cellAddress); - } - } - } // function ROW() - - - /** - * ROWS - * - * Returns the number of rows in an array or reference. - * - * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows - * @return integer - */ - public static function ROWS($cellAddress=Null) { - if (is_null($cellAddress) || $cellAddress === '') { - return 1; - } elseif (!is_array($cellAddress)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - $i = array_keys($cellAddress); - $isMatrix = (is_numeric(array_shift($i))); - list($columns,$rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress); - - if ($isMatrix) { - return $columns; - } else { - return $rows; - } - } // function ROWS() - - - /** - * HYPERLINK - * - * Excel Function: - * =HYPERLINK(linkURL,displayName) - * - * @access public - * @category Logical Functions - * @param string $linkURL Value to check, is also the value returned when no error - * @param string $displayName Value to return when testValue is an error condition - * @return mixed The value of errorpart or testValue determined by error condition - */ - public static function HYPERLINK($linkURL = '', $displayName = null, PHPExcel_Cell $pCell = null) { - $args = func_get_args(); - $pCell = array_pop($args); - - $linkURL = (is_null($linkURL)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($linkURL); - $displayName = (is_null($displayName)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($displayName); - - if ((!is_object($pCell)) || (trim($linkURL) == '')) { - return PHPExcel_Calculation_Functions::REF(); - } - - if ((is_object($displayName)) || trim($displayName) == '') { - $displayName = $linkURL; - } - - $pCell->getHyperlink()->setUrl($linkURL); - - return $displayName; - } // function HYPERLINK() - - - /** - * INDIRECT - * - * Returns the number of rows in an array or reference. - * - * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows - * @return integer - */ - public static function INDIRECT($cellAddress=Null, PHPExcel_Cell $pCell = null) { - $cellAddress = PHPExcel_Calculation_Functions::flattenSingleValue($cellAddress); - if (is_null($cellAddress) || $cellAddress === '') { - return PHPExcel_Calculation_Functions::REF(); - } - - $cellAddress1 = $cellAddress; - $cellAddress2 = NULL; - if (strpos($cellAddress,':') !== false) { - list($cellAddress1,$cellAddress2) = explode(':',$cellAddress); - } - - if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) || - ((!is_null($cellAddress2)) && (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) { - return PHPExcel_Calculation_Functions::REF(); - } - - if (strpos($cellAddress,'!') !== false) { - list($sheetName,$cellAddress) = explode('!',$cellAddress); - $pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName); - } else { - $pSheet = $pCell->getParent(); - } - - return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False); - } // function INDIRECT() - - - /** - * OFFSET - * - * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. - * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and - * the number of columns to be returned. - * - * @param cellAddress The reference from which you want to base the offset. Reference must refer to a cell or - * range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value. - * @param rows The number of rows, up or down, that you want the upper-left cell to refer to. - * Using 5 as the rows argument specifies that the upper-left cell in the reference is - * five rows below reference. Rows can be positive (which means below the starting reference) - * or negative (which means above the starting reference). - * @param cols The number of columns, to the left or right, that you want the upper-left cell of the result - * to refer to. Using 5 as the cols argument specifies that the upper-left cell in the - * reference is five columns to the right of reference. Cols can be positive (which means - * to the right of the starting reference) or negative (which means to the left of the - * starting reference). - * @param height The height, in number of rows, that you want the returned reference to be. Height must be a positive number. - * @param width The width, in number of columns, that you want the returned reference to be. Width must be a positive number. - * @return string A reference to a cell or range of cells - */ - public static function OFFSET($cellAddress=Null,$rows=0,$columns=0,$height=null,$width=null) { - $rows = PHPExcel_Calculation_Functions::flattenSingleValue($rows); - $columns = PHPExcel_Calculation_Functions::flattenSingleValue($columns); - $height = PHPExcel_Calculation_Functions::flattenSingleValue($height); - $width = PHPExcel_Calculation_Functions::flattenSingleValue($width); - if ($cellAddress == Null) { - return 0; - } - - $args = func_get_args(); - $pCell = array_pop($args); - if (!is_object($pCell)) { - return PHPExcel_Calculation_Functions::REF(); - } - - $sheetName = null; - if (strpos($cellAddress,"!")) { - list($sheetName,$cellAddress) = explode("!",$cellAddress); - } - if (strpos($cellAddress,":")) { - list($startCell,$endCell) = explode(":",$cellAddress); - } else { - $startCell = $endCell = $cellAddress; - } - list($startCellColumn,$startCellRow) = PHPExcel_Cell::coordinateFromString($startCell); - list($endCellColumn,$endCellRow) = PHPExcel_Cell::coordinateFromString($endCell); - - $startCellRow += $rows; - $startCellColumn = PHPExcel_Cell::columnIndexFromString($startCellColumn) - 1; - $startCellColumn += $columns; - - if (($startCellRow <= 0) || ($startCellColumn < 0)) { - return PHPExcel_Calculation_Functions::REF(); - } - $endCellColumn = PHPExcel_Cell::columnIndexFromString($endCellColumn) - 1; - if (($width != null) && (!is_object($width))) { - $endCellColumn = $startCellColumn + $width - 1; - } else { - $endCellColumn += $columns; - } - $startCellColumn = PHPExcel_Cell::stringFromColumnIndex($startCellColumn); - - if (($height != null) && (!is_object($height))) { - $endCellRow = $startCellRow + $height - 1; - } else { - $endCellRow += $rows; - } - - if (($endCellRow <= 0) || ($endCellColumn < 0)) { - return PHPExcel_Calculation_Functions::REF(); - } - $endCellColumn = PHPExcel_Cell::stringFromColumnIndex($endCellColumn); - - $cellAddress = $startCellColumn.$startCellRow; - if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) { - $cellAddress .= ':'.$endCellColumn.$endCellRow; - } - - if ($sheetName !== null) { - $pSheet = $pCell->getParent()->getParent()->getSheetByName($sheetName); - } else { - $pSheet = $pCell->getParent(); - } - - return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, False); - } // function OFFSET() - - - public static function CHOOSE() { - $chooseArgs = func_get_args(); - $chosenEntry = PHPExcel_Calculation_Functions::flattenArray(array_shift($chooseArgs)); - $entryCount = count($chooseArgs) - 1; - - if(is_array($chosenEntry)) { - $chosenEntry = array_shift($chosenEntry); - } - if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) { - --$chosenEntry; - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - $chosenEntry = floor($chosenEntry); - if (($chosenEntry <= 0) || ($chosenEntry > $entryCount)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_array($chooseArgs[$chosenEntry])) { - return PHPExcel_Calculation_Functions::flattenArray($chooseArgs[$chosenEntry]); - } else { - return $chooseArgs[$chosenEntry]; - } - } // function CHOOSE() - - - /** - * MATCH - * - * The MATCH function searches for a specified item in a range of cells - * - * @param lookup_value The value that you want to match in lookup_array - * @param lookup_array The range of cells being searched - * @param match_type The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered. - * @return integer The relative position of the found item - */ - public static function MATCH($lookup_value, $lookup_array, $match_type=1) { - $lookup_array = PHPExcel_Calculation_Functions::flattenArray($lookup_array); - $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); - $match_type = (is_null($match_type)) ? 1 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($match_type); - // MATCH is not case sensitive - $lookup_value = strtolower($lookup_value); - - // lookup_value type has to be number, text, or logical values - if ((!is_numeric($lookup_value)) && (!is_string($lookup_value)) && (!is_bool($lookup_value))) { - return PHPExcel_Calculation_Functions::NA(); - } - - // match_type is 0, 1 or -1 - if (($match_type !== 0) && ($match_type !== -1) && ($match_type !== 1)) { - return PHPExcel_Calculation_Functions::NA(); - } - - // lookup_array should not be empty - $lookupArraySize = count($lookup_array); - if ($lookupArraySize <= 0) { - return PHPExcel_Calculation_Functions::NA(); - } - - // lookup_array should contain only number, text, or logical values, or empty (null) cells - foreach($lookup_array as $i => $lookupArrayValue) { - // check the type of the value - if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) && - (!is_bool($lookupArrayValue)) && (!is_null($lookupArrayValue))) { - return PHPExcel_Calculation_Functions::NA(); - } - // convert strings to lowercase for case-insensitive testing - if (is_string($lookupArrayValue)) { - $lookup_array[$i] = strtolower($lookupArrayValue); - } - if ((is_null($lookupArrayValue)) && (($match_type == 1) || ($match_type == -1))) { - $lookup_array = array_slice($lookup_array,0,$i-1); - } - } - - // if match_type is 1 or -1, the list has to be ordered - if ($match_type == 1) { - asort($lookup_array); - $keySet = array_keys($lookup_array); - } elseif($match_type == -1) { - arsort($lookup_array); - $keySet = array_keys($lookup_array); - } - - // ** - // find the match - // ** - // loop on the cells -// var_dump($lookup_array); -// echo '
      '; - foreach($lookup_array as $i => $lookupArrayValue) { - if (($match_type == 0) && ($lookupArrayValue == $lookup_value)) { - // exact match - return ++$i; - } elseif (($match_type == -1) && ($lookupArrayValue <= $lookup_value)) { -// echo '$i = '.$i.' => '; -// var_dump($lookupArrayValue); -// echo '
      '; -// echo 'Keyset = '; -// var_dump($keySet); -// echo '
      '; - $i = array_search($i,$keySet); -// echo '$i='.$i.'
      '; - // if match_type is -1 <=> find the smallest value that is greater than or equal to lookup_value - if ($i < 1){ - // 1st cell was allready smaller than the lookup_value - break; - } else { - // the previous cell was the match - return $keySet[$i-1]+1; - } - } elseif (($match_type == 1) && ($lookupArrayValue >= $lookup_value)) { -// echo '$i = '.$i.' => '; -// var_dump($lookupArrayValue); -// echo '
      '; -// echo 'Keyset = '; -// var_dump($keySet); -// echo '
      '; - $i = array_search($i,$keySet); -// echo '$i='.$i.'
      '; - // if match_type is 1 <=> find the largest value that is less than or equal to lookup_value - if ($i < 1){ - // 1st cell was allready bigger than the lookup_value - break; - } else { - // the previous cell was the match - return $keySet[$i-1]+1; - } - } - } - - // unsuccessful in finding a match, return #N/A error value - return PHPExcel_Calculation_Functions::NA(); - } // function MATCH() - - - /** - * INDEX - * - * Uses an index to choose a value from a reference or array - * implemented: Return the value of a specified cell or array of cells Array form - * not implemented: Return a reference to specified cells Reference form - * - * @param range_array a range of cells or an array constant - * @param row_num selects the row in array from which to return a value. If row_num is omitted, column_num is required. - * @param column_num selects the column in array from which to return a value. If column_num is omitted, row_num is required. - */ - public static function INDEX($arrayValues,$rowNum = 0,$columnNum = 0) { - - if (($rowNum < 0) || ($columnNum < 0)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (!is_array($arrayValues)) { - return PHPExcel_Calculation_Functions::REF(); - } - - $rowKeys = array_keys($arrayValues); - $columnKeys = @array_keys($arrayValues[$rowKeys[0]]); - - if ($columnNum > count($columnKeys)) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($columnNum == 0) { - if ($rowNum == 0) { - return $arrayValues; - } - $rowNum = $rowKeys[--$rowNum]; - $returnArray = array(); - foreach($arrayValues as $arrayColumn) { - if (is_array($arrayColumn)) { - if (isset($arrayColumn[$rowNum])) { - $returnArray[] = $arrayColumn[$rowNum]; - } else { - return $arrayValues[$rowNum]; - } - } else { - return $arrayValues[$rowNum]; - } - } - return $returnArray; - } - $columnNum = $columnKeys[--$columnNum]; - if ($rowNum > count($rowKeys)) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ($rowNum == 0) { - return $arrayValues[$columnNum]; - } - $rowNum = $rowKeys[--$rowNum]; - - return $arrayValues[$rowNum][$columnNum]; - } // function INDEX() - - - /** - * TRANSPOSE - * - * @param array $matrixData A matrix of values - * @return array - * - * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix. - */ - public static function TRANSPOSE($matrixData) { - $returnMatrix = array(); - if (!is_array($matrixData)) { $matrixData = array(array($matrixData)); } - - $column = 0; - foreach($matrixData as $matrixRow) { - $row = 0; - foreach($matrixRow as $matrixCell) { - $returnMatrix[$row][$column] = $matrixCell; - ++$row; - } - ++$column; - } - return $returnMatrix; - } // function TRANSPOSE() - - - private static function _vlookupSort($a,$b) { - $f = array_keys($a); - $firstColumn = array_shift($f); - if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) { - return 0; - } - return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1; - } // function _vlookupSort() - - - /** - * VLOOKUP - * The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number. - * @param lookup_value The value that you want to match in lookup_array - * @param lookup_array The range of cells being searched - * @param index_number The column number in table_array from which the matching value must be returned. The first column is 1. - * @param not_exact_match Determines if you are looking for an exact match based on lookup_value. - * @return mixed The value of the found cell - */ - public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match=true) { - $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); - $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number); - $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match); - - // index_number must be greater than or equal to 1 - if ($index_number < 1) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // index_number must be less than or equal to the number of columns in lookup_array - if ((!is_array($lookup_array)) || (count($lookup_array) < 1)) { - return PHPExcel_Calculation_Functions::REF(); - } else { - $f = array_keys($lookup_array); - $firstRow = array_pop($f); - if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) { - return PHPExcel_Calculation_Functions::REF(); - } else { - $columnKeys = array_keys($lookup_array[$firstRow]); - $returnColumn = $columnKeys[--$index_number]; - $firstColumn = array_shift($columnKeys); - } - } - - if (!$not_exact_match) { - uasort($lookup_array,array('self','_vlookupSort')); - } - - $rowNumber = $rowValue = False; - foreach($lookup_array as $rowKey => $rowData) { - if (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)) { - break; - } - $rowNumber = $rowKey; - $rowValue = $rowData[$firstColumn]; - } - - if ($rowNumber !== false) { - if ((!$not_exact_match) && ($rowValue != $lookup_value)) { - // if an exact match is required, we have what we need to return an appropriate response - return PHPExcel_Calculation_Functions::NA(); - } else { - // otherwise return the appropriate value - return $lookup_array[$rowNumber][$returnColumn]; - } - } - - return PHPExcel_Calculation_Functions::NA(); - } // function VLOOKUP() - - - /** - * LOOKUP - * The LOOKUP function searches for value either from a one-row or one-column range or from an array. - * @param lookup_value The value that you want to match in lookup_array - * @param lookup_vector The range of cells being searched - * @param result_vector The column from which the matching value must be returned - * @return mixed The value of the found cell - */ - public static function LOOKUP($lookup_value, $lookup_vector, $result_vector=null) { - $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value); - - if (!is_array($lookup_vector)) { - return PHPExcel_Calculation_Functions::NA(); - } - $lookupRows = count($lookup_vector); - $l = array_keys($lookup_vector); - $l = array_shift($l); - $lookupColumns = count($lookup_vector[$l]); - if ((($lookupRows == 1) && ($lookupColumns > 1)) || (($lookupRows == 2) && ($lookupColumns != 2))) { - $lookup_vector = self::TRANSPOSE($lookup_vector); - $lookupRows = count($lookup_vector); - $l = array_keys($lookup_vector); - $lookupColumns = count($lookup_vector[array_shift($l)]); - } - - if (is_null($result_vector)) { - $result_vector = $lookup_vector; - } - $resultRows = count($result_vector); - $l = array_keys($result_vector); - $l = array_shift($l); - $resultColumns = count($result_vector[$l]); - if ((($resultRows == 1) && ($resultColumns > 1)) || (($resultRows == 2) && ($resultColumns != 2))) { - $result_vector = self::TRANSPOSE($result_vector); - $resultRows = count($result_vector); - $r = array_keys($result_vector); - $resultColumns = count($result_vector[array_shift($r)]); - } - - if ($lookupRows == 2) { - $result_vector = array_pop($lookup_vector); - $lookup_vector = array_shift($lookup_vector); - } - if ($lookupColumns != 2) { - foreach($lookup_vector as &$value) { - if (is_array($value)) { - $k = array_keys($value); - $key1 = $key2 = array_shift($k); - $key2++; - $dataValue1 = $value[$key1]; - } else { - $key1 = 0; - $key2 = 1; - $dataValue1 = $value; - } - $dataValue2 = array_shift($result_vector); - if (is_array($dataValue2)) { - $dataValue2 = array_shift($dataValue2); - } - $value = array($key1 => $dataValue1, $key2 => $dataValue2); - } - unset($value); - } - - return self::VLOOKUP($lookup_value,$lookup_vector,2); - } // function LOOKUP() - -} // class PHPExcel_Calculation_LookupRef diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/MathTrig.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/MathTrig.php deleted file mode 100644 index 35530274df..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/MathTrig.php +++ /dev/null @@ -1,1241 +0,0 @@ - 1; --$i) { - if (($value % $i) == 0) { - $factorArray = array_merge($factorArray,self::_factors($value / $i)); - $factorArray = array_merge($factorArray,self::_factors($i)); - if ($i <= sqrt($value)) { - break; - } - } - } - if (count($factorArray) > 0) { - rsort($factorArray); - return $factorArray; - } else { - return array((integer) $value); - } - } // function _factors() - - - private static function _romanCut($num, $n) { - return ($num - ($num % $n ) ) / $n; - } // function _romanCut() - - - /** - * ATAN2 - * - * This function calculates the arc tangent of the two variables x and y. It is similar to - * calculating the arc tangent of y ÷ x, except that the signs of both arguments are used - * to determine the quadrant of the result. - * The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a - * point with coordinates (xCoordinate, yCoordinate). The angle is given in radians between - * -pi and pi, excluding -pi. - * - * Note that the Excel ATAN2() function accepts its arguments in the reverse order to the standard - * PHP atan2() function, so we need to reverse them here before calling the PHP atan() function. - * - * Excel Function: - * ATAN2(xCoordinate,yCoordinate) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param float $xCoordinate The x-coordinate of the point. - * @param float $yCoordinate The y-coordinate of the point. - * @return float The inverse tangent of the specified x- and y-coordinates. - */ - public static function ATAN2($xCoordinate, $yCoordinate) { - $xCoordinate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($xCoordinate); - $yCoordinate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($yCoordinate); - - if (($xCoordinate == 0) && ($yCoordinate == 0)) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - return atan2($yCoordinate, $xCoordinate); - } // function REVERSE_ATAN2() - - - /** - * CEILING - * - * Returns number rounded up, away from zero, to the nearest multiple of significance. - * - * @param float $number Number to round - * @param float $significance Significance - * @return float Rounded Number - */ - public static function CEILING($number,$significance=null) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance); - - if ((is_null($significance)) && (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) { - $significance = $number/abs($number); - } - - if ((is_numeric($number)) && (is_numeric($significance))) { - if (self::SIGN($number) == self::SIGN($significance)) { - if ($significance == 0.0) { - return 0; - } - return ceil($number / $significance) * $significance; - } else { - return PHPExcel_Calculation_Functions::NaN(); - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function CEILING() - - - /** - * COMBIN - * - * Returns the number of combinations for a given number of items. Use COMBIN to - * determine the total possible number of groups for a given number of items. - * - * @param int $numObjs Number of different objects - * @param int $numInSet Number of objects in each combination - * @return int Number of combinations - */ - public static function COMBIN($numObjs,$numInSet) { - $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs); - $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet); - - if ((is_numeric($numObjs)) && (is_numeric($numInSet))) { - if ($numObjs < $numInSet) { - return PHPExcel_Calculation_Functions::NaN(); - } elseif ($numInSet < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return round(self::FACT($numObjs) / self::FACT($numObjs - $numInSet)) / self::FACT($numInSet); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function COMBIN() - - - /** - * EVEN - * - * Returns number rounded up to the nearest even integer. - * - * @param float $number Number to round - * @return int Rounded Number - */ - public static function EVEN($number) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - - if (is_null($number)) { - return 0; - } elseif (is_numeric($number)) { - $significance = 2 * self::SIGN($number); - return (int) self::CEILING($number,$significance); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function EVEN() - - - /** - * FACT - * - * Returns the factorial of a number. - * - * @param float $factVal Factorial Value - * @return int Factorial - */ - public static function FACT($factVal) { - $factVal = PHPExcel_Calculation_Functions::flattenSingleValue($factVal); - - if (is_numeric($factVal)) { - if ($factVal < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $factLoop = floor($factVal); - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - if ($factVal > $factLoop) { - return PHPExcel_Calculation_Functions::NaN(); - } - } - - $factorial = 1; - while ($factLoop > 1) { - $factorial *= $factLoop--; - } - return $factorial ; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function FACT() - - - /** - * FACTDOUBLE - * - * Returns the double factorial of a number. - * - * @param float $factVal Factorial Value - * @return int Double Factorial - */ - public static function FACTDOUBLE($factVal) { - $factLoop = floor(PHPExcel_Calculation_Functions::flattenSingleValue($factVal)); - - if (is_numeric($factLoop)) { - if ($factVal < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $factorial = 1; - while ($factLoop > 1) { - $factorial *= $factLoop--; - --$factLoop; - } - return $factorial ; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function FACTDOUBLE() - - - /** - * FLOOR - * - * Rounds number down, toward zero, to the nearest multiple of significance. - * - * @param float $number Number to round - * @param float $significance Significance - * @return float Rounded Number - */ - public static function FLOOR($number,$significance=null) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance); - - if ((is_null($significance)) && (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) { - $significance = $number/abs($number); - } - - if ((is_numeric($number)) && (is_numeric($significance))) { - if ((float) $significance == 0.0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - if (self::SIGN($number) == self::SIGN($significance)) { - return floor($number / $significance) * $significance; - } else { - return PHPExcel_Calculation_Functions::NaN(); - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function FLOOR() - - - /** - * GCD - * - * Returns the greatest common divisor of a series of numbers - * - * @param $array Values to calculate the Greatest Common Divisor - * @return int Greatest Common Divisor - */ - public static function GCD() { - $returnValue = 1; - $allPoweredFactors = array(); - // Loop through arguments - foreach(PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) { - if ($value == 0) { - break; - } - $myFactors = self::_factors($value); - $myCountedFactors = array_count_values($myFactors); - $allValuesFactors[] = $myCountedFactors; - } - $allValuesCount = count($allValuesFactors); - $mergedArray = $allValuesFactors[0]; - for ($i=1;$i < $allValuesCount; ++$i) { - $mergedArray = array_intersect_key($mergedArray,$allValuesFactors[$i]); - } - $mergedArrayValues = count($mergedArray); - if ($mergedArrayValues == 0) { - return $returnValue; - } elseif ($mergedArrayValues > 1) { - foreach($mergedArray as $mergedKey => $mergedValue) { - foreach($allValuesFactors as $highestPowerTest) { - foreach($highestPowerTest as $testKey => $testValue) { - if (($testKey == $mergedKey) && ($testValue < $mergedValue)) { - $mergedArray[$mergedKey] = $testValue; - $mergedValue = $testValue; - } - } - } - } - - $returnValue = 1; - foreach($mergedArray as $key => $value) { - $returnValue *= pow($key,$value); - } - return $returnValue; - } else { - $keys = array_keys($mergedArray); - $key = $keys[0]; - $value = $mergedArray[$key]; - foreach($allValuesFactors as $testValue) { - foreach($testValue as $mergedKey => $mergedValue) { - if (($mergedKey == $key) && ($mergedValue < $value)) { - $value = $mergedValue; - } - } - } - return pow($key,$value); - } - } // function GCD() - - - /** - * INT - * - * Casts a floating point value to an integer - * - * @param float $number Number to cast to an integer - * @return integer Integer value - */ - public static function INT($number) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - - if (is_numeric($number)) { - return (int) floor($number); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function INT() - - - /** - * LCM - * - * Returns the lowest common multiplier of a series of numbers - * - * @param $array Values to calculate the Lowest Common Multiplier - * @return int Lowest Common Multiplier - */ - public static function LCM() { - $returnValue = 1; - $allPoweredFactors = array(); - // Loop through arguments - foreach(PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) { - if (!is_numeric($value)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if ($value == 0) { - return 0; - } elseif ($value < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $myFactors = self::_factors(floor($value)); - $myCountedFactors = array_count_values($myFactors); - $myPoweredFactors = array(); - foreach($myCountedFactors as $myCountedFactor => $myCountedPower) { - $myPoweredFactors[$myCountedFactor] = pow($myCountedFactor,$myCountedPower); - } - foreach($myPoweredFactors as $myPoweredValue => $myPoweredFactor) { - if (array_key_exists($myPoweredValue,$allPoweredFactors)) { - if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) { - $allPoweredFactors[$myPoweredValue] = $myPoweredFactor; - } - } else { - $allPoweredFactors[$myPoweredValue] = $myPoweredFactor; - } - } - } - foreach($allPoweredFactors as $allPoweredFactor) { - $returnValue *= (integer) $allPoweredFactor; - } - return $returnValue; - } // function LCM() - - - /** - * LOG_BASE - * - * Returns the logarithm of a number to a specified base. The default base is 10. - * - * Excel Function: - * LOG(number[,base]) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param float $value The positive real number for which you want the logarithm - * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10. - * @return float - */ - public static function LOG_BASE($number, $base=10) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $base = (is_null($base)) ? 10 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($base); - - return log($number, $base); - } // function LOG_BASE() - - - /** - * MDETERM - * - * @param array $matrixValues A matrix of values - * @return float - */ - public static function MDETERM($matrixValues) { - $matrixData = array(); - if (!is_array($matrixValues)) { $matrixValues = array(array($matrixValues)); } - - $row = $maxColumn = 0; - foreach($matrixValues as $matrixRow) { - $column = 0; - foreach($matrixRow as $matrixCell) { - if ((is_string($matrixCell)) || ($matrixCell === null)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $matrixData[$column][$row] = $matrixCell; - ++$column; - } - if ($column > $maxColumn) { $maxColumn = $column; } - ++$row; - } - if ($row != $maxColumn) { return PHPExcel_Calculation_Functions::VALUE(); } - - try { - $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData); - return $matrix->det(); - } catch (Exception $ex) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } // function MDETERM() - - - /** - * MINVERSE - * - * @param array $matrixValues A matrix of values - * @return array - */ - public static function MINVERSE($matrixValues) { - $matrixData = array(); - if (!is_array($matrixValues)) { $matrixValues = array(array($matrixValues)); } - - $row = $maxColumn = 0; - foreach($matrixValues as $matrixRow) { - $column = 0; - foreach($matrixRow as $matrixCell) { - if ((is_string($matrixCell)) || ($matrixCell === null)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $matrixData[$column][$row] = $matrixCell; - ++$column; - } - if ($column > $maxColumn) { $maxColumn = $column; } - ++$row; - } - if ($row != $maxColumn) { return PHPExcel_Calculation_Functions::VALUE(); } - - try { - $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData); - return $matrix->inverse()->getArray(); - } catch (Exception $ex) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } // function MINVERSE() - - - /** - * MMULT - * - * @param array $matrixData1 A matrix of values - * @param array $matrixData2 A matrix of values - * @return array - */ - public static function MMULT($matrixData1,$matrixData2) { - $matrixAData = $matrixBData = array(); - if (!is_array($matrixData1)) { $matrixData1 = array(array($matrixData1)); } - if (!is_array($matrixData2)) { $matrixData2 = array(array($matrixData2)); } - - $rowA = 0; - foreach($matrixData1 as $matrixRow) { - $columnA = 0; - foreach($matrixRow as $matrixCell) { - if ((is_string($matrixCell)) || ($matrixCell === null)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $matrixAData[$rowA][$columnA] = $matrixCell; - ++$columnA; - } - ++$rowA; - } - try { - $matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData); - $rowB = 0; - foreach($matrixData2 as $matrixRow) { - $columnB = 0; - foreach($matrixRow as $matrixCell) { - if ((is_string($matrixCell)) || ($matrixCell === null)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $matrixBData[$rowB][$columnB] = $matrixCell; - ++$columnB; - } - ++$rowB; - } - $matrixB = new PHPExcel_Shared_JAMA_Matrix($matrixBData); - - if (($rowA != $columnB) || ($rowB != $columnA)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - return $matrixA->times($matrixB)->getArray(); - } catch (Exception $ex) { - return PHPExcel_Calculation_Functions::VALUE(); - } - } // function MMULT() - - - /** - * MOD - * - * @param int $a Dividend - * @param int $b Divisor - * @return int Remainder - */ - public static function MOD($a = 1, $b = 1) { - $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); - $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); - - if ($b == 0.0) { - return PHPExcel_Calculation_Functions::DIV0(); - } elseif (($a < 0.0) && ($b > 0.0)) { - return $b - fmod(abs($a),$b); - } elseif (($a > 0.0) && ($b < 0.0)) { - return $b + fmod($a,abs($b)); - } - - return fmod($a,$b); - } // function MOD() - - - /** - * MROUND - * - * Rounds a number to the nearest multiple of a specified value - * - * @param float $number Number to round - * @param int $multiple Multiple to which you want to round $number - * @return float Rounded Number - */ - public static function MROUND($number,$multiple) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $multiple = PHPExcel_Calculation_Functions::flattenSingleValue($multiple); - - if ((is_numeric($number)) && (is_numeric($multiple))) { - if ($multiple == 0) { - return 0; - } - if ((self::SIGN($number)) == (self::SIGN($multiple))) { - $multiplier = 1 / $multiple; - return round($number * $multiplier) / $multiplier; - } - return PHPExcel_Calculation_Functions::NaN(); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function MROUND() - - - /** - * MULTINOMIAL - * - * Returns the ratio of the factorial of a sum of values to the product of factorials. - * - * @param array of mixed Data Series - * @return float - */ - public static function MULTINOMIAL() { - $summer = 0; - $divisor = 1; - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { - // Is it a numeric value? - if (is_numeric($arg)) { - if ($arg < 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - $summer += floor($arg); - $divisor *= self::FACT($arg); - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - - // Return - if ($summer > 0) { - $summer = self::FACT($summer); - return $summer / $divisor; - } - return 0; - } // function MULTINOMIAL() - - - /** - * ODD - * - * Returns number rounded up to the nearest odd integer. - * - * @param float $number Number to round - * @return int Rounded Number - */ - public static function ODD($number) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - - if (is_null($number)) { - return 1; - } elseif (is_numeric($number)) { - $significance = self::SIGN($number); - if ($significance == 0) { - return 1; - } - - $result = self::CEILING($number,$significance); - if ($result == self::EVEN($result)) { - $result += $significance; - } - - return (int) $result; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ODD() - - - /** - * POWER - * - * Computes x raised to the power y. - * - * @param float $x - * @param float $y - * @return float - */ - public static function POWER($x = 0, $y = 2) { - $x = PHPExcel_Calculation_Functions::flattenSingleValue($x); - $y = PHPExcel_Calculation_Functions::flattenSingleValue($y); - - // Validate parameters - if ($x == 0 && $y <= 0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - // Return - return pow($x, $y); - } // function POWER() - - - /** - * PRODUCT - * - * PRODUCT returns the product of all the values and cells referenced in the argument list. - * - * Excel Function: - * PRODUCT(value1[,value2[, ...]]) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function PRODUCT() { - // Return value - $returnValue = null; - - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = $arg; - } else { - $returnValue *= $arg; - } - } - } - - // Return - if (is_null($returnValue)) { - return 0; - } - return $returnValue; - } // function PRODUCT() - - - /** - * QUOTIENT - * - * QUOTIENT function returns the integer portion of a division. Numerator is the divided number - * and denominator is the divisor. - * - * Excel Function: - * QUOTIENT(value1[,value2[, ...]]) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function QUOTIENT() { - // Return value - $returnValue = null; - - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = ($arg == 0) ? 0 : $arg; - } else { - if (($returnValue == 0) || ($arg == 0)) { - $returnValue = 0; - } else { - $returnValue /= $arg; - } - } - } - } - - // Return - return intval($returnValue); - } // function QUOTIENT() - - - /** - * RAND - * - * @param int $min Minimal value - * @param int $max Maximal value - * @return int Random number - */ - public static function RAND($min = 0, $max = 0) { - $min = PHPExcel_Calculation_Functions::flattenSingleValue($min); - $max = PHPExcel_Calculation_Functions::flattenSingleValue($max); - - if ($min == 0 && $max == 0) { - return (rand(0,10000000)) / 10000000; - } else { - return rand($min, $max); - } - } // function RAND() - - - public static function ROMAN($aValue, $style=0) { - $aValue = (integer) PHPExcel_Calculation_Functions::flattenSingleValue($aValue); - $style = (is_null($style)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($style); - if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if ($aValue == 0) { - return ''; - } - - $mill = Array('', 'M', 'MM', 'MMM', 'MMMM', 'MMMMM'); - $cent = Array('', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'); - $tens = Array('', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'); - $ones = Array('', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'); - - $roman = ''; - while ($aValue > 5999) { - $roman .= 'M'; - $aValue -= 1000; - } - $m = self::_romanCut($aValue, 1000); $aValue %= 1000; - $c = self::_romanCut($aValue, 100); $aValue %= 100; - $t = self::_romanCut($aValue, 10); $aValue %= 10; - - return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue]; - } // function ROMAN() - - - /** - * ROUNDUP - * - * Rounds a number up to a specified number of decimal places - * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number - * @return float Rounded Number - */ - public static function ROUNDUP($number,$digits) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits); - - if ((is_numeric($number)) && (is_numeric($digits))) { - $significance = pow(10,$digits); - if ($number < 0.0) { - return floor($number * $significance) / $significance; - } else { - return ceil($number * $significance) / $significance; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ROUNDUP() - - - /** - * ROUNDDOWN - * - * Rounds a number down to a specified number of decimal places - * - * @param float $number Number to round - * @param int $digits Number of digits to which you want to round $number - * @return float Rounded Number - */ - public static function ROUNDDOWN($number,$digits) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits); - - if ((is_numeric($number)) && (is_numeric($digits))) { - $significance = pow(10,$digits); - if ($number < 0.0) { - return ceil($number * $significance) / $significance; - } else { - return floor($number * $significance) / $significance; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function ROUNDDOWN() - - - /** - * SERIESSUM - * - * Returns the sum of a power series - * - * @param float $x Input value to the power series - * @param float $n Initial power to which you want to raise $x - * @param float $m Step by which to increase $n for each term in the series - * @param array of mixed Data Series - * @return float - */ - public static function SERIESSUM() { - // Return value - $returnValue = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - $x = array_shift($aArgs); - $n = array_shift($aArgs); - $m = array_shift($aArgs); - - if ((is_numeric($x)) && (is_numeric($n)) && (is_numeric($m))) { - // Calculate - $i = 0; - foreach($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $returnValue += $arg * pow($x,$n + ($m * $i++)); - } else { - return PHPExcel_Calculation_Functions::VALUE(); - } - } - // Return - return $returnValue; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SERIESSUM() - - - /** - * SIGN - * - * Determines the sign of a number. Returns 1 if the number is positive, zero (0) - * if the number is 0, and -1 if the number is negative. - * - * @param float $number Number to round - * @return int sign value - */ - public static function SIGN($number) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - - if (is_numeric($number)) { - if ($number == 0.0) { - return 0; - } - return $number / abs($number); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SIGN() - - - /** - * SQRTPI - * - * Returns the square root of (number * pi). - * - * @param float $number Number - * @return float Square Root of Number * Pi - */ - public static function SQRTPI($number) { - $number = PHPExcel_Calculation_Functions::flattenSingleValue($number); - - if (is_numeric($number)) { - if ($number < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return sqrt($number * M_PI) ; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SQRTPI() - - - /** - * SUBTOTAL - * - * Returns a subtotal in a list or database. - * - * @param int the number 1 to 11 that specifies which function to - * use in calculating subtotals within a list. - * @param array of mixed Data Series - * @return float - */ - public static function SUBTOTAL() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $subtotal = array_shift($aArgs); - - if ((is_numeric($subtotal)) && (!is_string($subtotal))) { - switch($subtotal) { - case 1 : - return PHPExcel_Calculation_Statistical::AVERAGE($aArgs); - break; - case 2 : - return PHPExcel_Calculation_Statistical::COUNT($aArgs); - break; - case 3 : - return PHPExcel_Calculation_Statistical::COUNTA($aArgs); - break; - case 4 : - return PHPExcel_Calculation_Statistical::MAX($aArgs); - break; - case 5 : - return PHPExcel_Calculation_Statistical::MIN($aArgs); - break; - case 6 : - return self::PRODUCT($aArgs); - break; - case 7 : - return PHPExcel_Calculation_Statistical::STDEV($aArgs); - break; - case 8 : - return PHPExcel_Calculation_Statistical::STDEVP($aArgs); - break; - case 9 : - return self::SUM($aArgs); - break; - case 10 : - return PHPExcel_Calculation_Statistical::VARFunc($aArgs); - break; - case 11 : - return PHPExcel_Calculation_Statistical::VARP($aArgs); - break; - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SUBTOTAL() - - - /** - * SUM - * - * SUM computes the sum of all the values and cells referenced in the argument list. - * - * Excel Function: - * SUM(value1[,value2[, ...]]) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function SUM() { - // Return value - $returnValue = 0; - - // Loop through the arguments - foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $returnValue += $arg; - } - } - - // Return - return $returnValue; - } // function SUM() - - - /** - * SUMIF - * - * Counts the number of cells that contain numbers within the list of arguments - * - * Excel Function: - * SUMIF(value1[,value2[, ...]],condition) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @param string $condition The criteria that defines which cells will be summed. - * @return float - */ - public static function SUMIF($aArgs,$condition,$sumArgs = array()) { - // Return value - $returnValue = 0; - - $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); - $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); - if (count($sumArgs) == 0) { - $sumArgs = $aArgs; - } - $condition = PHPExcel_Calculation_Functions::_ifCondition($condition); - // Loop through arguments - foreach ($aArgs as $key => $arg) { - if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); } - $testCondition = '='.$arg.$condition; - if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { - // Is it a value within our criteria - $returnValue += $sumArgs[$key]; - } - } - - // Return - return $returnValue; - } // function SUMIF() - - - /** - * SUMPRODUCT - * - * @param mixed $value Value to check - * @return float - */ - public static function SUMPRODUCT() { - $arrayList = func_get_args(); - - $wrkArray = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList)); - $wrkCellCount = count($wrkArray); - - foreach($arrayList as $matrixData) { - $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData); - $count = count($array2); - if ($wrkCellCount != $count) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - foreach ($array2 as $i => $val) { - if (((is_numeric($wrkArray[$i])) && (!is_string($wrkArray[$i]))) && - ((is_numeric($val)) && (!is_string($val)))) { - $wrkArray[$i] *= $val; - } - } - } - - return array_sum($wrkArray); - } // function SUMPRODUCT() - - - /** - * SUMSQ - * - * SUMSQ returns the sum of the squares of the arguments - * - * Excel Function: - * SUMSQ(value1[,value2[, ...]]) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function SUMSQ() { - // Return value - $returnValue = 0; - - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $returnValue += ($arg * $arg); - } - } - - // Return - return $returnValue; - } // function SUMSQ() - - - /** - * SUMX2MY2 - * - * @param mixed $value Value to check - * @return float - */ - public static function SUMX2MY2($matrixData1,$matrixData2) { - $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); - $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); - $count1 = count($array1); - $count2 = count($array2); - if ($count1 < $count2) { - $count = $count1; - } else { - $count = $count2; - } - - $result = 0; - for ($i = 0; $i < $count; ++$i) { - if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && - ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { - $result += ($array1[$i] * $array1[$i]) - ($array2[$i] * $array2[$i]); - } - } - - return $result; - } // function SUMX2MY2() - - - /** - * SUMX2PY2 - * - * @param mixed $value Value to check - * @return float - */ - public static function SUMX2PY2($matrixData1,$matrixData2) { - $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); - $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); - $count1 = count($array1); - $count2 = count($array2); - if ($count1 < $count2) { - $count = $count1; - } else { - $count = $count2; - } - - $result = 0; - for ($i = 0; $i < $count; ++$i) { - if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && - ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { - $result += ($array1[$i] * $array1[$i]) + ($array2[$i] * $array2[$i]); - } - } - - return $result; - } // function SUMX2PY2() - - - /** - * SUMXMY2 - * - * @param mixed $value Value to check - * @return float - */ - public static function SUMXMY2($matrixData1,$matrixData2) { - $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1); - $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2); - $count1 = count($array1); - $count2 = count($array2); - if ($count1 < $count2) { - $count = $count1; - } else { - $count = $count2; - } - - $result = 0; - for ($i = 0; $i < $count; ++$i) { - if (((is_numeric($array1[$i])) && (!is_string($array1[$i]))) && - ((is_numeric($array2[$i])) && (!is_string($array2[$i])))) { - $result += ($array1[$i] - $array2[$i]) * ($array1[$i] - $array2[$i]); - } - } - - return $result; - } // function SUMXMY2() - - - /** - * TRUNC - * - * Truncates value to the number of fractional digits by number_digits. - * - * @param float $value - * @param int $number_digits - * @return float Truncated value - */ - public static function TRUNC($value = 0, $number_digits = 0) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $number_digits = PHPExcel_Calculation_Functions::flattenSingleValue($number_digits); - - // Validate parameters - if ($number_digits < 0) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - // Truncate - if ($number_digits > 0) { - $value = $value * pow(10, $number_digits); - } - $value = intval($value); - if ($number_digits > 0) { - $value = $value / pow(10, $number_digits); - } - - // Return - return $value; - } // function TRUNC() - -} // class PHPExcel_Calculation_MathTrig diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Statistical.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Statistical.php deleted file mode 100644 index 31c92964ad..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/Statistical.php +++ /dev/null @@ -1,3643 +0,0 @@ - $value) { - if ((is_bool($value)) || (is_string($value)) || (is_null($value))) { - unset($array1[$key]); - unset($array2[$key]); - } - } - foreach($array2 as $key => $value) { - if ((is_bool($value)) || (is_string($value)) || (is_null($value))) { - unset($array1[$key]); - unset($array2[$key]); - } - } - $array1 = array_merge($array1); - $array2 = array_merge($array2); - - return True; - } // function _checkTrendArrays() - - - /** - * Beta function. - * - * @author Jaco van Kooten - * - * @param p require p>0 - * @param q require q>0 - * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow - */ - private static function _beta($p, $q) { - if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) { - return 0.0; - } else { - return exp(self::_logBeta($p, $q)); - } - } // function _beta() - - - /** - * Incomplete beta function - * - * @author Jaco van Kooten - * @author Paul Meagher - * - * The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992). - * @param x require 0<=x<=1 - * @param p require p>0 - * @param q require q>0 - * @return 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow - */ - private static function _incompleteBeta($x, $p, $q) { - if ($x <= 0.0) { - return 0.0; - } elseif ($x >= 1.0) { - return 1.0; - } elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) { - return 0.0; - } - $beta_gam = exp((0 - self::_logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x)); - if ($x < ($p + 1.0) / ($p + $q + 2.0)) { - return $beta_gam * self::_betaFraction($x, $p, $q) / $p; - } else { - return 1.0 - ($beta_gam * self::_betaFraction(1 - $x, $q, $p) / $q); - } - } // function _incompleteBeta() - - - // Function cache for _logBeta function - private static $_logBetaCache_p = 0.0; - private static $_logBetaCache_q = 0.0; - private static $_logBetaCache_result = 0.0; - - /** - * The natural logarithm of the beta function. - * @param p require p>0 - * @param q require q>0 - * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow - * @author Jaco van Kooten - */ - private static function _logBeta($p, $q) { - if ($p != self::$_logBetaCache_p || $q != self::$_logBetaCache_q) { - self::$_logBetaCache_p = $p; - self::$_logBetaCache_q = $q; - if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) { - self::$_logBetaCache_result = 0.0; - } else { - self::$_logBetaCache_result = self::_logGamma($p) + self::_logGamma($q) - self::_logGamma($p + $q); - } - } - return self::$_logBetaCache_result; - } // function _logBeta() - - - /** - * Evaluates of continued fraction part of incomplete beta function. - * Based on an idea from Numerical Recipes (W.H. Press et al, 1992). - * @author Jaco van Kooten - */ - private static function _betaFraction($x, $p, $q) { - $c = 1.0; - $sum_pq = $p + $q; - $p_plus = $p + 1.0; - $p_minus = $p - 1.0; - $h = 1.0 - $sum_pq * $x / $p_plus; - if (abs($h) < XMININ) { - $h = XMININ; - } - $h = 1.0 / $h; - $frac = $h; - $m = 1; - $delta = 0.0; - while ($m <= MAX_ITERATIONS && abs($delta-1.0) > PRECISION ) { - $m2 = 2 * $m; - // even index for d - $d = $m * ($q - $m) * $x / ( ($p_minus + $m2) * ($p + $m2)); - $h = 1.0 + $d * $h; - if (abs($h) < XMININ) { - $h = XMININ; - } - $h = 1.0 / $h; - $c = 1.0 + $d / $c; - if (abs($c) < XMININ) { - $c = XMININ; - } - $frac *= $h * $c; - // odd index for d - $d = -($p + $m) * ($sum_pq + $m) * $x / (($p + $m2) * ($p_plus + $m2)); - $h = 1.0 + $d * $h; - if (abs($h) < XMININ) { - $h = XMININ; - } - $h = 1.0 / $h; - $c = 1.0 + $d / $c; - if (abs($c) < XMININ) { - $c = XMININ; - } - $delta = $h * $c; - $frac *= $delta; - ++$m; - } - return $frac; - } // function _betaFraction() - - - /** - * logGamma function - * - * @version 1.1 - * @author Jaco van Kooten - * - * Original author was Jaco van Kooten. Ported to PHP by Paul Meagher. - * - * The natural logarithm of the gamma function.
      - * Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
      - * Applied Mathematics Division
      - * Argonne National Laboratory
      - * Argonne, IL 60439
      - *

      - * References: - *

        - *
      1. W. J. Cody and K. E. Hillstrom, 'Chebyshev Approximations for the Natural - * Logarithm of the Gamma Function,' Math. Comp. 21, 1967, pp. 198-203.
      2. - *
      3. K. E. Hillstrom, ANL/AMD Program ANLC366S, DGAMMA/DLGAMA, May, 1969.
      4. - *
      5. Hart, Et. Al., Computer Approximations, Wiley and sons, New York, 1968.
      6. - *
      - *

      - *

      - * From the original documentation: - *

      - *

      - * This routine calculates the LOG(GAMMA) function for a positive real argument X. - * Computation is based on an algorithm outlined in references 1 and 2. - * The program uses rational functions that theoretically approximate LOG(GAMMA) - * to at least 18 significant decimal digits. The approximation for X > 12 is from - * reference 3, while approximations for X < 12.0 are similar to those in reference - * 1, but are unpublished. The accuracy achieved depends on the arithmetic system, - * the compiler, the intrinsic functions, and proper selection of the - * machine-dependent constants. - *

      - *

      - * Error returns:
      - * The program returns the value XINF for X .LE. 0.0 or when overflow would occur. - * The computation is believed to be free of underflow and overflow. - *

      - * @return MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305 - */ - - // Function cache for logGamma - private static $_logGammaCache_result = 0.0; - private static $_logGammaCache_x = 0.0; - - private static function _logGamma($x) { - // Log Gamma related constants - static $lg_d1 = -0.5772156649015328605195174; - static $lg_d2 = 0.4227843350984671393993777; - static $lg_d4 = 1.791759469228055000094023; - - static $lg_p1 = array( 4.945235359296727046734888, - 201.8112620856775083915565, - 2290.838373831346393026739, - 11319.67205903380828685045, - 28557.24635671635335736389, - 38484.96228443793359990269, - 26377.48787624195437963534, - 7225.813979700288197698961 ); - static $lg_p2 = array( 4.974607845568932035012064, - 542.4138599891070494101986, - 15506.93864978364947665077, - 184793.2904445632425417223, - 1088204.76946882876749847, - 3338152.967987029735917223, - 5106661.678927352456275255, - 3074109.054850539556250927 ); - static $lg_p4 = array( 14745.02166059939948905062, - 2426813.369486704502836312, - 121475557.4045093227939592, - 2663432449.630976949898078, - 29403789566.34553899906876, - 170266573776.5398868392998, - 492612579337.743088758812, - 560625185622.3951465078242 ); - - static $lg_q1 = array( 67.48212550303777196073036, - 1113.332393857199323513008, - 7738.757056935398733233834, - 27639.87074403340708898585, - 54993.10206226157329794414, - 61611.22180066002127833352, - 36351.27591501940507276287, - 8785.536302431013170870835 ); - static $lg_q2 = array( 183.0328399370592604055942, - 7765.049321445005871323047, - 133190.3827966074194402448, - 1136705.821321969608938755, - 5267964.117437946917577538, - 13467014.54311101692290052, - 17827365.30353274213975932, - 9533095.591844353613395747 ); - static $lg_q4 = array( 2690.530175870899333379843, - 639388.5654300092398984238, - 41355999.30241388052042842, - 1120872109.61614794137657, - 14886137286.78813811542398, - 101680358627.2438228077304, - 341747634550.7377132798597, - 446315818741.9713286462081 ); - - static $lg_c = array( -0.001910444077728, - 8.4171387781295e-4, - -5.952379913043012e-4, - 7.93650793500350248e-4, - -0.002777777777777681622553, - 0.08333333333333333331554247, - 0.0057083835261 ); - - // Rough estimate of the fourth root of logGamma_xBig - static $lg_frtbig = 2.25e76; - static $pnt68 = 0.6796875; - - - if ($x == self::$_logGammaCache_x) { - return self::$_logGammaCache_result; - } - $y = $x; - if ($y > 0.0 && $y <= LOG_GAMMA_X_MAX_VALUE) { - if ($y <= EPS) { - $res = -log(y); - } elseif ($y <= 1.5) { - // --------------------- - // EPS .LT. X .LE. 1.5 - // --------------------- - if ($y < $pnt68) { - $corr = -log($y); - $xm1 = $y; - } else { - $corr = 0.0; - $xm1 = $y - 1.0; - } - if ($y <= 0.5 || $y >= $pnt68) { - $xden = 1.0; - $xnum = 0.0; - for ($i = 0; $i < 8; ++$i) { - $xnum = $xnum * $xm1 + $lg_p1[$i]; - $xden = $xden * $xm1 + $lg_q1[$i]; - } - $res = $corr + $xm1 * ($lg_d1 + $xm1 * ($xnum / $xden)); - } else { - $xm2 = $y - 1.0; - $xden = 1.0; - $xnum = 0.0; - for ($i = 0; $i < 8; ++$i) { - $xnum = $xnum * $xm2 + $lg_p2[$i]; - $xden = $xden * $xm2 + $lg_q2[$i]; - } - $res = $corr + $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden)); - } - } elseif ($y <= 4.0) { - // --------------------- - // 1.5 .LT. X .LE. 4.0 - // --------------------- - $xm2 = $y - 2.0; - $xden = 1.0; - $xnum = 0.0; - for ($i = 0; $i < 8; ++$i) { - $xnum = $xnum * $xm2 + $lg_p2[$i]; - $xden = $xden * $xm2 + $lg_q2[$i]; - } - $res = $xm2 * ($lg_d2 + $xm2 * ($xnum / $xden)); - } elseif ($y <= 12.0) { - // ---------------------- - // 4.0 .LT. X .LE. 12.0 - // ---------------------- - $xm4 = $y - 4.0; - $xden = -1.0; - $xnum = 0.0; - for ($i = 0; $i < 8; ++$i) { - $xnum = $xnum * $xm4 + $lg_p4[$i]; - $xden = $xden * $xm4 + $lg_q4[$i]; - } - $res = $lg_d4 + $xm4 * ($xnum / $xden); - } else { - // --------------------------------- - // Evaluate for argument .GE. 12.0 - // --------------------------------- - $res = 0.0; - if ($y <= $lg_frtbig) { - $res = $lg_c[6]; - $ysq = $y * $y; - for ($i = 0; $i < 6; ++$i) - $res = $res / $ysq + $lg_c[$i]; - } - $res /= $y; - $corr = log($y); - $res = $res + log(SQRT2PI) - 0.5 * $corr; - $res += $y * ($corr - 1.0); - } - } else { - // -------------------------- - // Return for bad arguments - // -------------------------- - $res = MAX_VALUE; - } - // ------------------------------ - // Final adjustments and return - // ------------------------------ - self::$_logGammaCache_x = $x; - self::$_logGammaCache_result = $res; - return $res; - } // function _logGamma() - - - // - // Private implementation of the incomplete Gamma function - // - private static function _incompleteGamma($a,$x) { - static $max = 32; - $summer = 0; - for ($n=0; $n<=$max; ++$n) { - $divisor = $a; - for ($i=1; $i<=$n; ++$i) { - $divisor *= ($a + $i); - } - $summer += (pow($x,$n) / $divisor); - } - return pow($x,$a) * exp(0-$x) * $summer; - } // function _incompleteGamma() - - - // - // Private implementation of the Gamma function - // - private static function _gamma($data) { - if ($data == 0.0) return 0; - - static $p0 = 1.000000000190015; - static $p = array ( 1 => 76.18009172947146, - 2 => -86.50532032941677, - 3 => 24.01409824083091, - 4 => -1.231739572450155, - 5 => 1.208650973866179e-3, - 6 => -5.395239384953e-6 - ); - - $y = $x = $data; - $tmp = $x + 5.5; - $tmp -= ($x + 0.5) * log($tmp); - - $summer = $p0; - for ($j=1;$j<=6;++$j) { - $summer += ($p[$j] / ++$y); - } - return exp(0 - $tmp + log(SQRT2PI * $summer / $x)); - } // function _gamma() - - - /*************************************************************************** - * inverse_ncdf.php - * ------------------- - * begin : Friday, January 16, 2004 - * copyright : (C) 2004 Michael Nickerson - * email : nickersonm@yahoo.com - * - ***************************************************************************/ - private static function _inverse_ncdf($p) { - // Inverse ncdf approximation by Peter J. Acklam, implementation adapted to - // PHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as - // a guide. http://home.online.no/~pjacklam/notes/invnorm/index.html - // I have not checked the accuracy of this implementation. Be aware that PHP - // will truncate the coeficcients to 14 digits. - - // You have permission to use and distribute this function freely for - // whatever purpose you want, but please show common courtesy and give credit - // where credit is due. - - // Input paramater is $p - probability - where 0 < p < 1. - - // Coefficients in rational approximations - static $a = array( 1 => -3.969683028665376e+01, - 2 => 2.209460984245205e+02, - 3 => -2.759285104469687e+02, - 4 => 1.383577518672690e+02, - 5 => -3.066479806614716e+01, - 6 => 2.506628277459239e+00 - ); - - static $b = array( 1 => -5.447609879822406e+01, - 2 => 1.615858368580409e+02, - 3 => -1.556989798598866e+02, - 4 => 6.680131188771972e+01, - 5 => -1.328068155288572e+01 - ); - - static $c = array( 1 => -7.784894002430293e-03, - 2 => -3.223964580411365e-01, - 3 => -2.400758277161838e+00, - 4 => -2.549732539343734e+00, - 5 => 4.374664141464968e+00, - 6 => 2.938163982698783e+00 - ); - - static $d = array( 1 => 7.784695709041462e-03, - 2 => 3.224671290700398e-01, - 3 => 2.445134137142996e+00, - 4 => 3.754408661907416e+00 - ); - - // Define lower and upper region break-points. - $p_low = 0.02425; //Use lower region approx. below this - $p_high = 1 - $p_low; //Use upper region approx. above this - - if (0 < $p && $p < $p_low) { - // Rational approximation for lower region. - $q = sqrt(-2 * log($p)); - return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / - (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1); - } elseif ($p_low <= $p && $p <= $p_high) { - // Rational approximation for central region. - $q = $p - 0.5; - $r = $q * $q; - return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q / - ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1); - } elseif ($p_high < $p && $p < 1) { - // Rational approximation for upper region. - $q = sqrt(-2 * log(1 - $p)); - return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / - (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1); - } - // If 0 < p < 1, return a null value - return PHPExcel_Calculation_Functions::NULL(); - } // function _inverse_ncdf() - - - private static function _inverse_ncdf2($prob) { - // Approximation of inverse standard normal CDF developed by - // B. Moro, "The Full Monte," Risk 8(2), Feb 1995, 57-58. - - $a1 = 2.50662823884; - $a2 = -18.61500062529; - $a3 = 41.39119773534; - $a4 = -25.44106049637; - - $b1 = -8.4735109309; - $b2 = 23.08336743743; - $b3 = -21.06224101826; - $b4 = 3.13082909833; - - $c1 = 0.337475482272615; - $c2 = 0.976169019091719; - $c3 = 0.160797971491821; - $c4 = 2.76438810333863E-02; - $c5 = 3.8405729373609E-03; - $c6 = 3.951896511919E-04; - $c7 = 3.21767881768E-05; - $c8 = 2.888167364E-07; - $c9 = 3.960315187E-07; - - $y = $prob - 0.5; - if (abs($y) < 0.42) { - $z = ($y * $y); - $z = $y * ((($a4 * $z + $a3) * $z + $a2) * $z + $a1) / (((($b4 * $z + $b3) * $z + $b2) * $z + $b1) * $z + 1); - } else { - if ($y > 0) { - $z = log(-log(1 - $prob)); - } else { - $z = log(-log($prob)); - } - $z = $c1 + $z * ($c2 + $z * ($c3 + $z * ($c4 + $z * ($c5 + $z * ($c6 + $z * ($c7 + $z * ($c8 + $z * $c9))))))); - if ($y < 0) { - $z = -$z; - } - } - return $z; - } // function _inverse_ncdf2() - - - private static function _inverse_ncdf3($p) { - // ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3. - // Produces the normal deviate Z corresponding to a given lower - // tail area of P; Z is accurate to about 1 part in 10**16. - // - // This is a PHP version of the original FORTRAN code that can - // be found at http://lib.stat.cmu.edu/apstat/ - $split1 = 0.425; - $split2 = 5; - $const1 = 0.180625; - $const2 = 1.6; - - // coefficients for p close to 0.5 - $a0 = 3.3871328727963666080; - $a1 = 1.3314166789178437745E+2; - $a2 = 1.9715909503065514427E+3; - $a3 = 1.3731693765509461125E+4; - $a4 = 4.5921953931549871457E+4; - $a5 = 6.7265770927008700853E+4; - $a6 = 3.3430575583588128105E+4; - $a7 = 2.5090809287301226727E+3; - - $b1 = 4.2313330701600911252E+1; - $b2 = 6.8718700749205790830E+2; - $b3 = 5.3941960214247511077E+3; - $b4 = 2.1213794301586595867E+4; - $b5 = 3.9307895800092710610E+4; - $b6 = 2.8729085735721942674E+4; - $b7 = 5.2264952788528545610E+3; - - // coefficients for p not close to 0, 0.5 or 1. - $c0 = 1.42343711074968357734; - $c1 = 4.63033784615654529590; - $c2 = 5.76949722146069140550; - $c3 = 3.64784832476320460504; - $c4 = 1.27045825245236838258; - $c5 = 2.41780725177450611770E-1; - $c6 = 2.27238449892691845833E-2; - $c7 = 7.74545014278341407640E-4; - - $d1 = 2.05319162663775882187; - $d2 = 1.67638483018380384940; - $d3 = 6.89767334985100004550E-1; - $d4 = 1.48103976427480074590E-1; - $d5 = 1.51986665636164571966E-2; - $d6 = 5.47593808499534494600E-4; - $d7 = 1.05075007164441684324E-9; - - // coefficients for p near 0 or 1. - $e0 = 6.65790464350110377720; - $e1 = 5.46378491116411436990; - $e2 = 1.78482653991729133580; - $e3 = 2.96560571828504891230E-1; - $e4 = 2.65321895265761230930E-2; - $e5 = 1.24266094738807843860E-3; - $e6 = 2.71155556874348757815E-5; - $e7 = 2.01033439929228813265E-7; - - $f1 = 5.99832206555887937690E-1; - $f2 = 1.36929880922735805310E-1; - $f3 = 1.48753612908506148525E-2; - $f4 = 7.86869131145613259100E-4; - $f5 = 1.84631831751005468180E-5; - $f6 = 1.42151175831644588870E-7; - $f7 = 2.04426310338993978564E-15; - - $q = $p - 0.5; - - // computation for p close to 0.5 - if (abs($q) <= split1) { - $R = $const1 - $q * $q; - $z = $q * ((((((($a7 * $R + $a6) * $R + $a5) * $R + $a4) * $R + $a3) * $R + $a2) * $R + $a1) * $R + $a0) / - ((((((($b7 * $R + $b6) * $R + $b5) * $R + $b4) * $R + $b3) * $R + $b2) * $R + $b1) * $R + 1); - } else { - if ($q < 0) { - $R = $p; - } else { - $R = 1 - $p; - } - $R = pow(-log($R),2); - - // computation for p not close to 0, 0.5 or 1. - If ($R <= $split2) { - $R = $R - $const2; - $z = ((((((($c7 * $R + $c6) * $R + $c5) * $R + $c4) * $R + $c3) * $R + $c2) * $R + $c1) * $R + $c0) / - ((((((($d7 * $R + $d6) * $R + $d5) * $R + $d4) * $R + $d3) * $R + $d2) * $R + $d1) * $R + 1); - } else { - // computation for p near 0 or 1. - $R = $R - $split2; - $z = ((((((($e7 * $R + $e6) * $R + $e5) * $R + $e4) * $R + $e3) * $R + $e2) * $R + $e1) * $R + $e0) / - ((((((($f7 * $R + $f6) * $R + $f5) * $R + $f4) * $R + $f3) * $R + $f2) * $R + $f1) * $R + 1); - } - if ($q < 0) { - $z = -$z; - } - } - return $z; - } // function _inverse_ncdf3() - - - /** - * AVEDEV - * - * Returns the average of the absolute deviations of data points from their mean. - * AVEDEV is a measure of the variability in a data set. - * - * Excel Function: - * AVEDEV(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function AVEDEV() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGE($aArgs); - if ($aMean != PHPExcel_Calculation_Functions::DIV0()) { - $aCount = 0; - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = abs($arg - $aMean); - } else { - $returnValue += abs($arg - $aMean); - } - ++$aCount; - } - } - - // Return - if ($aCount == 0) { - return PHPExcel_Calculation_Functions::DIV0(); - } - return $returnValue / $aCount; - } - return PHPExcel_Calculation_Functions::NaN(); - } // function AVEDEV() - - - /** - * AVERAGE - * - * Returns the average (arithmetic mean) of the arguments - * - * Excel Function: - * AVERAGE(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function AVERAGE() { - $returnValue = $aCount = 0; - - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) { - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = $arg; - } else { - $returnValue += $arg; - } - ++$aCount; - } - } - - // Return - if ($aCount > 0) { - return $returnValue / $aCount; - } else { - return PHPExcel_Calculation_Functions::DIV0(); - } - } // function AVERAGE() - - - /** - * AVERAGEA - * - * Returns the average of its arguments, including numbers, text, and logical values - * - * Excel Function: - * AVERAGEA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function AVERAGEA() { - // Return value - $returnValue = null; - - $aCount = 0; - // Loop through arguments - foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) { - if ((is_bool($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - if (is_null($returnValue)) { - $returnValue = $arg; - } else { - $returnValue += $arg; - } - ++$aCount; - } - } - } - - // Return - if ($aCount > 0) { - return $returnValue / $aCount; - } else { - return PHPExcel_Calculation_Functions::DIV0(); - } - } // function AVERAGEA() - - - /** - * AVERAGEIF - * - * Returns the average value from a range of cells that contain numbers within the list of arguments - * - * Excel Function: - * AVERAGEIF(value1[,value2[, ...]],condition) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @param string $condition The criteria that defines which cells will be checked. - * @return float - */ - public static function AVERAGEIF($aArgs,$condition,$averageArgs = array()) { - // Return value - $returnValue = 0; - - $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); - $averageArgs = PHPExcel_Calculation_Functions::flattenArray($averageArgs); - if (count($averageArgs) == 0) { - $averageArgs = $aArgs; - } - $condition = PHPExcel_Calculation_Functions::_ifCondition($condition); - // Loop through arguments - $aCount = 0; - foreach ($aArgs as $key => $arg) { - if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); } - $testCondition = '='.$arg.$condition; - if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { - if ((is_null($returnValue)) || ($arg > $returnValue)) { - $returnValue += $arg; - ++$aCount; - } - } - } - - // Return - if ($aCount > 0) { - return $returnValue / $aCount; - } else { - return PHPExcel_Calculation_Functions::DIV0(); - } - } // function AVERAGEIF() - - - /** - * BETADIST - * - * Returns the beta distribution. - * - * @param float $value Value at which you want to evaluate the distribution - * @param float $alpha Parameter to the distribution - * @param float $beta Parameter to the distribution - * @param boolean $cumulative - * @return float - * - */ - public static function BETADIST($value,$alpha,$beta,$rMin=0,$rMax=1) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); - $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin); - $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax); - - if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) { - if (($value < $rMin) || ($value > $rMax) || ($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($rMin > $rMax) { - $tmp = $rMin; - $rMin = $rMax; - $rMax = $tmp; - } - $value -= $rMin; - $value /= ($rMax - $rMin); - return self::_incompleteBeta($value,$alpha,$beta); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BETADIST() - - - /** - * BETAINV - * - * Returns the inverse of the beta distribution. - * - * @param float $probability Probability at which you want to evaluate the distribution - * @param float $alpha Parameter to the distribution - * @param float $beta Parameter to the distribution - * @param boolean $cumulative - * @return float - * - */ - public static function BETAINV($probability,$alpha,$beta,$rMin=0,$rMax=1) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); - $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin); - $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax); - - if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) { - if (($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax) || ($probability <= 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($rMin > $rMax) { - $tmp = $rMin; - $rMin = $rMax; - $rMax = $tmp; - } - $a = 0; - $b = 2; - - $i = 0; - while ((($b - $a) > PRECISION) && ($i++ < MAX_ITERATIONS)) { - $guess = ($a + $b) / 2; - $result = self::BETADIST($guess, $alpha, $beta); - if (($result == $probability) || ($result == 0)) { - $b = $a; - } elseif ($result > $probability) { - $b = $guess; - } else { - $a = $guess; - } - } - if ($i == MAX_ITERATIONS) { - return PHPExcel_Calculation_Functions::NA(); - } - return round($rMin + $guess * ($rMax - $rMin),12); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BETAINV() - - - /** - * BINOMDIST - * - * Returns the individual term binomial distribution probability. Use BINOMDIST in problems with - * a fixed number of tests or trials, when the outcomes of any trial are only success or failure, - * when trials are independent, and when the probability of success is constant throughout the - * experiment. For example, BINOMDIST can calculate the probability that two of the next three - * babies born are male. - * - * @param float $value Number of successes in trials - * @param float $trials Number of trials - * @param float $probability Probability of success on each trial - * @param boolean $cumulative - * @return float - * - * @todo Cumulative distribution function - * - */ - public static function BINOMDIST($value, $trials, $probability, $cumulative) { - $value = floor(PHPExcel_Calculation_Functions::flattenSingleValue($value)); - $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials)); - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - - if ((is_numeric($value)) && (is_numeric($trials)) && (is_numeric($probability))) { - if (($value < 0) || ($value > $trials)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($probability < 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - $summer = 0; - for ($i = 0; $i <= $value; ++$i) { - $summer += PHPExcel_Calculation_MathTrig::COMBIN($trials,$i) * pow($probability,$i) * pow(1 - $probability,$trials - $i); - } - return $summer; - } else { - return PHPExcel_Calculation_MathTrig::COMBIN($trials,$value) * pow($probability,$value) * pow(1 - $probability,$trials - $value) ; - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function BINOMDIST() - - - /** - * CHIDIST - * - * Returns the one-tailed probability of the chi-squared distribution. - * - * @param float $value Value for the function - * @param float $degrees degrees of freedom - * @return float - */ - public static function CHIDIST($value, $degrees) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); - - if ((is_numeric($value)) && (is_numeric($degrees))) { - if ($degrees < 1) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($value < 0) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - return 1; - } - return PHPExcel_Calculation_Functions::NaN(); - } - return 1 - (self::_incompleteGamma($degrees/2,$value/2) / self::_gamma($degrees/2)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function CHIDIST() - - - /** - * CHIINV - * - * Returns the one-tailed probability of the chi-squared distribution. - * - * @param float $probability Probability for the function - * @param float $degrees degrees of freedom - * @return float - */ - public static function CHIINV($probability, $degrees) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); - - if ((is_numeric($probability)) && (is_numeric($degrees))) { - - $xLo = 100; - $xHi = 0; - - $x = $xNew = 1; - $dx = 1; - $i = 0; - - while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { - // Apply Newton-Raphson step - $result = self::CHIDIST($x, $degrees); - $error = $result - $probability; - if ($error == 0.0) { - $dx = 0; - } elseif ($error < 0.0) { - $xLo = $x; - } else { - $xHi = $x; - } - // Avoid division by zero - if ($result != 0.0) { - $dx = $error / $result; - $xNew = $x - $dx; - } - // If the NR fails to converge (which for example may be the - // case if the initial guess is too rough) we apply a bisection - // step to determine a more narrow interval around the root. - if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) { - $xNew = ($xLo + $xHi) / 2; - $dx = $xNew - $x; - } - $x = $xNew; - } - if ($i == MAX_ITERATIONS) { - return PHPExcel_Calculation_Functions::NA(); - } - return round($x,12); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function CHIINV() - - - /** - * CONFIDENCE - * - * Returns the confidence interval for a population mean - * - * @param float $alpha - * @param float $stdDev Standard Deviation - * @param float $size - * @return float - * - */ - public static function CONFIDENCE($alpha,$stdDev,$size) { - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - $size = floor(PHPExcel_Calculation_Functions::flattenSingleValue($size)); - - if ((is_numeric($alpha)) && (is_numeric($stdDev)) && (is_numeric($size))) { - if (($alpha <= 0) || ($alpha >= 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($stdDev <= 0) || ($size < 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return self::NORMSINV(1 - $alpha / 2) * $stdDev / sqrt($size); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function CONFIDENCE() - - - /** - * CORREL - * - * Returns covariance, the average of the products of deviations for each data point pair. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function CORREL($yValues,$xValues=null) { - if ((is_null($xValues)) || (!is_array($yValues)) || (!is_array($xValues))) { - return PHPExcel_Calculation_Functions::VALUE(); - } - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getCorrelation(); - } // function CORREL() - - - /** - * COUNT - * - * Counts the number of cells that contain numbers within the list of arguments - * - * Excel Function: - * COUNT(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return int - */ - public static function COUNT() { - // Return value - $returnValue = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - ++$returnValue; - } - } - - // Return - return $returnValue; - } // function COUNT() - - - /** - * COUNTA - * - * Counts the number of cells that are not empty within the list of arguments - * - * Excel Function: - * COUNTA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return int - */ - public static function COUNTA() { - // Return value - $returnValue = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric, boolean or string value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { - ++$returnValue; - } - } - - // Return - return $returnValue; - } // function COUNTA() - - - /** - * COUNTBLANK - * - * Counts the number of empty cells within the list of arguments - * - * Excel Function: - * COUNTBLANK(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return int - */ - public static function COUNTBLANK() { - // Return value - $returnValue = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a blank cell? - if ((is_null($arg)) || ((is_string($arg)) && ($arg == ''))) { - ++$returnValue; - } - } - - // Return - return $returnValue; - } // function COUNTBLANK() - - - /** - * COUNTIF - * - * Counts the number of cells that contain numbers within the list of arguments - * - * Excel Function: - * COUNTIF(value1[,value2[, ...]],condition) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param string $condition The criteria that defines which cells will be counted. - * @return int - */ - public static function COUNTIF($aArgs,$condition) { - // Return value - $returnValue = 0; - - $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); - $condition = PHPExcel_Calculation_Functions::_ifCondition($condition); - // Loop through arguments - foreach ($aArgs as $arg) { - if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); } - $testCondition = '='.$arg.$condition; - if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { - // Is it a value within our criteria - ++$returnValue; - } - } - - // Return - return $returnValue; - } // function COUNTIF() - - - /** - * COVAR - * - * Returns covariance, the average of the products of deviations for each data point pair. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function COVAR($yValues,$xValues) { - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getCovariance(); - } // function COVAR() - - - /** - * CRITBINOM - * - * Returns the smallest value for which the cumulative binomial distribution is greater - * than or equal to a criterion value - * - * See http://support.microsoft.com/kb/828117/ for details of the algorithm used - * - * @param float $trials number of Bernoulli trials - * @param float $probability probability of a success on each trial - * @param float $alpha criterion value - * @return int - * - * @todo Warning. This implementation differs from the algorithm detailed on the MS - * web site in that $CumPGuessMinus1 = $CumPGuess - 1 rather than $CumPGuess - $PGuess - * This eliminates a potential endless loop error, but may have an adverse affect on the - * accuracy of the function (although all my tests have so far returned correct results). - * - */ - public static function CRITBINOM($trials, $probability, $alpha) { - $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials)); - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - - if ((is_numeric($trials)) && (is_numeric($probability)) && (is_numeric($alpha))) { - if ($trials < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($probability < 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($alpha < 0) || ($alpha > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($alpha <= 0.5) { - $t = sqrt(log(1 / ($alpha * $alpha))); - $trialsApprox = 0 - ($t + (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t)); - } else { - $t = sqrt(log(1 / pow(1 - $alpha,2))); - $trialsApprox = $t - (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t); - } - $Guess = floor($trials * $probability + $trialsApprox * sqrt($trials * $probability * (1 - $probability))); - if ($Guess < 0) { - $Guess = 0; - } elseif ($Guess > $trials) { - $Guess = $trials; - } - - $TotalUnscaledProbability = $UnscaledPGuess = $UnscaledCumPGuess = 0.0; - $EssentiallyZero = 10e-12; - - $m = floor($trials * $probability); - ++$TotalUnscaledProbability; - if ($m == $Guess) { ++$UnscaledPGuess; } - if ($m <= $Guess) { ++$UnscaledCumPGuess; } - - $PreviousValue = 1; - $Done = False; - $k = $m + 1; - while ((!$Done) && ($k <= $trials)) { - $CurrentValue = $PreviousValue * ($trials - $k + 1) * $probability / ($k * (1 - $probability)); - $TotalUnscaledProbability += $CurrentValue; - if ($k == $Guess) { $UnscaledPGuess += $CurrentValue; } - if ($k <= $Guess) { $UnscaledCumPGuess += $CurrentValue; } - if ($CurrentValue <= $EssentiallyZero) { $Done = True; } - $PreviousValue = $CurrentValue; - ++$k; - } - - $PreviousValue = 1; - $Done = False; - $k = $m - 1; - while ((!$Done) && ($k >= 0)) { - $CurrentValue = $PreviousValue * $k + 1 * (1 - $probability) / (($trials - $k) * $probability); - $TotalUnscaledProbability += $CurrentValue; - if ($k == $Guess) { $UnscaledPGuess += $CurrentValue; } - if ($k <= $Guess) { $UnscaledCumPGuess += $CurrentValue; } - if ($CurrentValue <= $EssentiallyZero) { $Done = True; } - $PreviousValue = $CurrentValue; - --$k; - } - - $PGuess = $UnscaledPGuess / $TotalUnscaledProbability; - $CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability; - -// $CumPGuessMinus1 = $CumPGuess - $PGuess; - $CumPGuessMinus1 = $CumPGuess - 1; - - while (True) { - if (($CumPGuessMinus1 < $alpha) && ($CumPGuess >= $alpha)) { - return $Guess; - } elseif (($CumPGuessMinus1 < $alpha) && ($CumPGuess < $alpha)) { - $PGuessPlus1 = $PGuess * ($trials - $Guess) * $probability / $Guess / (1 - $probability); - $CumPGuessMinus1 = $CumPGuess; - $CumPGuess = $CumPGuess + $PGuessPlus1; - $PGuess = $PGuessPlus1; - ++$Guess; - } elseif (($CumPGuessMinus1 >= $alpha) && ($CumPGuess >= $alpha)) { - $PGuessMinus1 = $PGuess * $Guess * (1 - $probability) / ($trials - $Guess + 1) / $probability; - $CumPGuess = $CumPGuessMinus1; - $CumPGuessMinus1 = $CumPGuessMinus1 - $PGuess; - $PGuess = $PGuessMinus1; - --$Guess; - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function CRITBINOM() - - - /** - * DEVSQ - * - * Returns the sum of squares of deviations of data points from their sample mean. - * - * Excel Function: - * DEVSQ(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function DEVSQ() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGE($aArgs); - if ($aMean != PHPExcel_Calculation_Functions::DIV0()) { - $aCount = -1; - foreach ($aArgs as $k => $arg) { - // Is it a numeric value? - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = pow(($arg - $aMean),2); - } else { - $returnValue += pow(($arg - $aMean),2); - } - ++$aCount; - } - } - - // Return - if (is_null($returnValue)) { - return PHPExcel_Calculation_Functions::NaN(); - } else { - return $returnValue; - } - } - return self::NA(); - } // function DEVSQ() - - - /** - * EXPONDIST - * - * Returns the exponential distribution. Use EXPONDIST to model the time between events, - * such as how long an automated bank teller takes to deliver cash. For example, you can - * use EXPONDIST to determine the probability that the process takes at most 1 minute. - * - * @param float $value Value of the function - * @param float $lambda The parameter value - * @param boolean $cumulative - * @return float - */ - public static function EXPONDIST($value, $lambda, $cumulative) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $lambda = PHPExcel_Calculation_Functions::flattenSingleValue($lambda); - $cumulative = PHPExcel_Calculation_Functions::flattenSingleValue($cumulative); - - if ((is_numeric($value)) && (is_numeric($lambda))) { - if (($value < 0) || ($lambda < 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - return 1 - exp(0-$value*$lambda); - } else { - return $lambda * exp(0-$value*$lambda); - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function EXPONDIST() - - - /** - * FISHER - * - * Returns the Fisher transformation at x. This transformation produces a function that - * is normally distributed rather than skewed. Use this function to perform hypothesis - * testing on the correlation coefficient. - * - * @param float $value - * @return float - */ - public static function FISHER($value) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - - if (is_numeric($value)) { - if (($value <= -1) || ($value >= 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return 0.5 * log((1+$value)/(1-$value)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function FISHER() - - - /** - * FISHERINV - * - * Returns the inverse of the Fisher transformation. Use this transformation when - * analyzing correlations between ranges or arrays of data. If y = FISHER(x), then - * FISHERINV(y) = x. - * - * @param float $value - * @return float - */ - public static function FISHERINV($value) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - - if (is_numeric($value)) { - return (exp(2 * $value) - 1) / (exp(2 * $value) + 1); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function FISHERINV() - - - /** - * FORECAST - * - * Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value. - * - * @param float Value of X for which we want to find Y - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function FORECAST($xValue,$yValues,$xValues) { - $xValue = PHPExcel_Calculation_Functions::flattenSingleValue($xValue); - if (!is_numeric($xValue)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getValueOfYForX($xValue); - } // function FORECAST() - - - /** - * GAMMADIST - * - * Returns the gamma distribution. - * - * @param float $value Value at which you want to evaluate the distribution - * @param float $a Parameter to the distribution - * @param float $b Parameter to the distribution - * @param boolean $cumulative - * @return float - * - */ - public static function GAMMADIST($value,$a,$b,$cumulative) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $a = PHPExcel_Calculation_Functions::flattenSingleValue($a); - $b = PHPExcel_Calculation_Functions::flattenSingleValue($b); - - if ((is_numeric($value)) && (is_numeric($a)) && (is_numeric($b))) { - if (($value < 0) || ($a <= 0) || ($b <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - return self::_incompleteGamma($a,$value / $b) / self::_gamma($a); - } else { - return (1 / (pow($b,$a) * self::_gamma($a))) * pow($value,$a-1) * exp(0-($value / $b)); - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function GAMMADIST() - - - /** - * GAMMAINV - * - * Returns the inverse of the beta distribution. - * - * @param float $probability Probability at which you want to evaluate the distribution - * @param float $alpha Parameter to the distribution - * @param float $beta Parameter to the distribution - * @return float - * - */ - public static function GAMMAINV($probability,$alpha,$beta) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); - - if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta))) { - if (($alpha <= 0) || ($beta <= 0) || ($probability < 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $xLo = 0; - $xHi = $alpha * $beta * 5; - - $x = $xNew = 1; - $error = $pdf = 0; - $dx = 1024; - $i = 0; - - while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { - // Apply Newton-Raphson step - $error = self::GAMMADIST($x, $alpha, $beta, True) - $probability; - if ($error < 0.0) { - $xLo = $x; - } else { - $xHi = $x; - } - $pdf = self::GAMMADIST($x, $alpha, $beta, False); - // Avoid division by zero - if ($pdf != 0.0) { - $dx = $error / $pdf; - $xNew = $x - $dx; - } - // If the NR fails to converge (which for example may be the - // case if the initial guess is too rough) we apply a bisection - // step to determine a more narrow interval around the root. - if (($xNew < $xLo) || ($xNew > $xHi) || ($pdf == 0.0)) { - $xNew = ($xLo + $xHi) / 2; - $dx = $xNew - $x; - } - $x = $xNew; - } - if ($i == MAX_ITERATIONS) { - return PHPExcel_Calculation_Functions::NA(); - } - return $x; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function GAMMAINV() - - - /** - * GAMMALN - * - * Returns the natural logarithm of the gamma function. - * - * @param float $value - * @return float - */ - public static function GAMMALN($value) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - - if (is_numeric($value)) { - if ($value <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return log(self::_gamma($value)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function GAMMALN() - - - /** - * GEOMEAN - * - * Returns the geometric mean of an array or range of positive data. For example, you - * can use GEOMEAN to calculate average growth rate given compound interest with - * variable rates. - * - * Excel Function: - * GEOMEAN(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function GEOMEAN() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - $aMean = PHPExcel_Calculation_MathTrig::PRODUCT($aArgs); - if (is_numeric($aMean) && ($aMean > 0)) { - $aCount = self::COUNT($aArgs) ; - if (self::MIN($aArgs) > 0) { - return pow($aMean, (1 / $aCount)); - } - } - return PHPExcel_Calculation_Functions::NaN(); - } // GEOMEAN() - - - /** - * GROWTH - * - * Returns values along a predicted emponential trend - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @param array of mixed Values of X for which we want to find Y - * @param boolean A logical value specifying whether to force the intersect to equal 0. - * @return array of float - */ - public static function GROWTH($yValues,$xValues=array(),$newValues=array(),$const=True) { - $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues); - $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues); - $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues); - $const = (is_null($const)) ? True : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); - - $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL,$yValues,$xValues,$const); - if (count($newValues) == 0) { - $newValues = $bestFitExponential->getXValues(); - } - - $returnArray = array(); - foreach($newValues as $xValue) { - $returnArray[0][] = $bestFitExponential->getValueOfYForX($xValue); - } - - return $returnArray; - } // function GROWTH() - - - /** - * HARMEAN - * - * Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the - * arithmetic mean of reciprocals. - * - * Excel Function: - * HARMEAN(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function HARMEAN() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::NA(); - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - if (self::MIN($aArgs) < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - $aCount = 0; - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if ($arg <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (is_null($returnValue)) { - $returnValue = (1 / $arg); - } else { - $returnValue += (1 / $arg); - } - ++$aCount; - } - } - - // Return - if ($aCount > 0) { - return 1 / ($returnValue / $aCount); - } else { - return $returnValue; - } - } // function HARMEAN() - - - /** - * HYPGEOMDIST - * - * Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of - * sample successes, given the sample size, population successes, and population size. - * - * @param float $sampleSuccesses Number of successes in the sample - * @param float $sampleNumber Size of the sample - * @param float $populationSuccesses Number of successes in the population - * @param float $populationNumber Population size - * @return float - * - */ - public static function HYPGEOMDIST($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber) { - $sampleSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleSuccesses)); - $sampleNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleNumber)); - $populationSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationSuccesses)); - $populationNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationNumber)); - - if ((is_numeric($sampleSuccesses)) && (is_numeric($sampleNumber)) && (is_numeric($populationSuccesses)) && (is_numeric($populationNumber))) { - if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return PHPExcel_Calculation_MathTrig::COMBIN($populationSuccesses,$sampleSuccesses) * - PHPExcel_Calculation_MathTrig::COMBIN($populationNumber - $populationSuccesses,$sampleNumber - $sampleSuccesses) / - PHPExcel_Calculation_MathTrig::COMBIN($populationNumber,$sampleNumber); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function HYPGEOMDIST() - - - /** - * INTERCEPT - * - * Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function INTERCEPT($yValues,$xValues) { - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getIntersect(); - } // function INTERCEPT() - - - /** - * KURT - * - * Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness - * or flatness of a distribution compared with the normal distribution. Positive - * kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a - * relatively flat distribution. - * - * @param array Data Series - * @return float - */ - public static function KURT() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - $mean = self::AVERAGE($aArgs); - $stdDev = self::STDEV($aArgs); - - if ($stdDev > 0) { - $count = $summer = 0; - // Loop through arguments - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $summer += pow((($arg - $mean) / $stdDev),4) ; - ++$count; - } - } - } - - // Return - if ($count > 3) { - return $summer * ($count * ($count+1) / (($count-1) * ($count-2) * ($count-3))) - (3 * pow($count-1,2) / (($count-2) * ($count-3))); - } - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function KURT() - - - /** - * LARGE - * - * Returns the nth largest value in a data set. You can use this function to - * select a value based on its relative standing. - * - * Excel Function: - * LARGE(value1[,value2[, ...]],entry) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param int $entry Position (ordered from the largest) in the array or range of data to return - * @return float - * - */ - public static function LARGE() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $entry = floor(array_pop($aArgs)); - - if ((is_numeric($entry)) && (!is_string($entry))) { - $mArgs = array(); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - $count = self::COUNT($mArgs); - $entry = floor(--$entry); - if (($entry < 0) || ($entry >= $count) || ($count == 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - rsort($mArgs); - return $mArgs[$entry]; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function LARGE() - - - /** - * LINEST - * - * Calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data, - * and then returns an array that describes the line. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @param boolean A logical value specifying whether to force the intersect to equal 0. - * @param boolean A logical value specifying whether to return additional regression statistics. - * @return array - */ - public static function LINEST($yValues,$xValues=null,$const=True,$stats=False) { - $const = (is_null($const)) ? True : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); - $stats = (is_null($stats)) ? False : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats); - if (is_null($xValues)) $xValues = range(1,count(PHPExcel_Calculation_Functions::flattenArray($yValues))); - - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return 0; - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues,$const); - if ($stats) { - return array( array( $bestFitLinear->getSlope(), - $bestFitLinear->getSlopeSE(), - $bestFitLinear->getGoodnessOfFit(), - $bestFitLinear->getF(), - $bestFitLinear->getSSRegression(), - ), - array( $bestFitLinear->getIntersect(), - $bestFitLinear->getIntersectSE(), - $bestFitLinear->getStdevOfResiduals(), - $bestFitLinear->getDFResiduals(), - $bestFitLinear->getSSResiduals() - ) - ); - } else { - return array( $bestFitLinear->getSlope(), - $bestFitLinear->getIntersect() - ); - } - } // function LINEST() - - - /** - * LOGEST - * - * Calculates an exponential curve that best fits the X and Y data series, - * and then returns an array that describes the line. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @param boolean A logical value specifying whether to force the intersect to equal 0. - * @param boolean A logical value specifying whether to return additional regression statistics. - * @return array - */ - public static function LOGEST($yValues,$xValues=null,$const=True,$stats=False) { - $const = (is_null($const)) ? True : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); - $stats = (is_null($stats)) ? False : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats); - if (is_null($xValues)) $xValues = range(1,count(PHPExcel_Calculation_Functions::flattenArray($yValues))); - - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - foreach($yValues as $value) { - if ($value <= 0.0) { - return PHPExcel_Calculation_Functions::NaN(); - } - } - - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return 1; - } - - $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL,$yValues,$xValues,$const); - if ($stats) { - return array( array( $bestFitExponential->getSlope(), - $bestFitExponential->getSlopeSE(), - $bestFitExponential->getGoodnessOfFit(), - $bestFitExponential->getF(), - $bestFitExponential->getSSRegression(), - ), - array( $bestFitExponential->getIntersect(), - $bestFitExponential->getIntersectSE(), - $bestFitExponential->getStdevOfResiduals(), - $bestFitExponential->getDFResiduals(), - $bestFitExponential->getSSResiduals() - ) - ); - } else { - return array( $bestFitExponential->getSlope(), - $bestFitExponential->getIntersect() - ); - } - } // function LOGEST() - - - /** - * LOGINV - * - * Returns the inverse of the normal cumulative distribution - * - * @param float $value - * @return float - * - * @todo Try implementing P J Acklam's refinement algorithm for greater - * accuracy if I can get my head round the mathematics - * (as described at) http://home.online.no/~pjacklam/notes/invnorm/ - */ - public static function LOGINV($probability, $mean, $stdDev) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - - if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) { - if (($probability < 0) || ($probability > 1) || ($stdDev <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return exp($mean + $stdDev * self::NORMSINV($probability)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function LOGINV() - - - /** - * LOGNORMDIST - * - * Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed - * with parameters mean and standard_dev. - * - * @param float $value - * @return float - */ - public static function LOGNORMDIST($value, $mean, $stdDev) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - - if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { - if (($value <= 0) || ($stdDev <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return self::NORMSDIST((log($value) - $mean) / $stdDev); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function LOGNORMDIST() - - - /** - * MAX - * - * MAX returns the value of the element of the values passed that has the highest value, - * with negative numbers considered smaller than positive numbers. - * - * Excel Function: - * MAX(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MAX() { - // Return value - $returnValue = null; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if ((is_null($returnValue)) || ($arg > $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - if(is_null($returnValue)) { - return 0; - } - return $returnValue; - } // function MAX() - - - /** - * MAXA - * - * Returns the greatest value in a list of arguments, including numbers, text, and logical values - * - * Excel Function: - * MAXA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MAXA() { - // Return value - $returnValue = null; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - if ((is_null($returnValue)) || ($arg > $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - if(is_null($returnValue)) { - return 0; - } - return $returnValue; - } // function MAXA() - - - /** - * MAXIF - * - * Counts the maximum value within a range of cells that contain numbers within the list of arguments - * - * Excel Function: - * MAXIF(value1[,value2[, ...]],condition) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @param string $condition The criteria that defines which cells will be checked. - * @return float - */ - public static function MAXIF($aArgs,$condition,$sumArgs = array()) { - // Return value - $returnValue = null; - - $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); - $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); - if (count($sumArgs) == 0) { - $sumArgs = $aArgs; - } - $condition = PHPExcel_Calculation_Functions::_ifCondition($condition); - // Loop through arguments - foreach ($aArgs as $key => $arg) { - if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); } - $testCondition = '='.$arg.$condition; - if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { - if ((is_null($returnValue)) || ($arg > $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - return $returnValue; - } // function MAXIF() - - - /** - * MEDIAN - * - * Returns the median of the given numbers. The median is the number in the middle of a set of numbers. - * - * Excel Function: - * MEDIAN(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MEDIAN() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::NaN(); - - $mArgs = array(); - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - - $mValueCount = count($mArgs); - if ($mValueCount > 0) { - sort($mArgs,SORT_NUMERIC); - $mValueCount = $mValueCount / 2; - if ($mValueCount == floor($mValueCount)) { - $returnValue = ($mArgs[$mValueCount--] + $mArgs[$mValueCount]) / 2; - } else { - $mValueCount == floor($mValueCount); - $returnValue = $mArgs[$mValueCount]; - } - } - - // Return - return $returnValue; - } // function MEDIAN() - - - /** - * MIN - * - * MIN returns the value of the element of the values passed that has the smallest value, - * with negative numbers considered smaller than positive numbers. - * - * Excel Function: - * MIN(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MIN() { - // Return value - $returnValue = null; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if ((is_null($returnValue)) || ($arg < $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - if(is_null($returnValue)) { - return 0; - } - return $returnValue; - } // function MIN() - - - /** - * MINA - * - * Returns the smallest value in a list of arguments, including numbers, text, and logical values - * - * Excel Function: - * MINA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MINA() { - // Return value - $returnValue = null; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - if ((is_null($returnValue)) || ($arg < $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - if(is_null($returnValue)) { - return 0; - } - return $returnValue; - } // function MINA() - - - /** - * MINIF - * - * Returns the minimum value within a range of cells that contain numbers within the list of arguments - * - * Excel Function: - * MINIF(value1[,value2[, ...]],condition) - * - * @access public - * @category Mathematical and Trigonometric Functions - * @param mixed $arg,... Data values - * @param string $condition The criteria that defines which cells will be checked. - * @return float - */ - public static function MINIF($aArgs,$condition,$sumArgs = array()) { - // Return value - $returnValue = null; - - $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs); - $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs); - if (count($sumArgs) == 0) { - $sumArgs = $aArgs; - } - $condition = PHPExcel_Calculation_Functions::_ifCondition($condition); - // Loop through arguments - foreach ($aArgs as $key => $arg) { - if (!is_numeric($arg)) { $arg = PHPExcel_Calculation::_wrapResult(strtoupper($arg)); } - $testCondition = '='.$arg.$condition; - if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) { - if ((is_null($returnValue)) || ($arg < $returnValue)) { - $returnValue = $arg; - } - } - } - - // Return - return $returnValue; - } // function MINIF() - - - // - // Special variant of array_count_values that isn't limited to strings and integers, - // but can work with floating point numbers as values - // - private static function _modeCalc($data) { - $frequencyArray = array(); - foreach($data as $datum) { - $found = False; - foreach($frequencyArray as $key => $value) { - if ((string) $value['value'] == (string) $datum) { - ++$frequencyArray[$key]['frequency']; - $found = True; - break; - } - } - if (!$found) { - $frequencyArray[] = array('value' => $datum, - 'frequency' => 1 ); - } - } - - foreach($frequencyArray as $key => $value) { - $frequencyList[$key] = $value['frequency']; - $valueList[$key] = $value['value']; - } - array_multisort($frequencyList, SORT_DESC, $valueList, SORT_ASC, SORT_NUMERIC, $frequencyArray); - - if ($frequencyArray[0]['frequency'] == 1) { - return PHPExcel_Calculation_Functions::NA(); - } - return $frequencyArray[0]['value']; - } // function _modeCalc() - - - /** - * MODE - * - * Returns the most frequently occurring, or repetitive, value in an array or range of data - * - * Excel Function: - * MODE(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function MODE() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::NA(); - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - $mArgs = array(); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - - if (count($mArgs) > 0) { - return self::_modeCalc($mArgs); - } - - // Return - return $returnValue; - } // function MODE() - - - /** - * NEGBINOMDIST - * - * Returns the negative binomial distribution. NEGBINOMDIST returns the probability that - * there will be number_f failures before the number_s-th success, when the constant - * probability of a success is probability_s. This function is similar to the binomial - * distribution, except that the number of successes is fixed, and the number of trials is - * variable. Like the binomial, trials are assumed to be independent. - * - * @param float $failures Number of Failures - * @param float $successes Threshold number of Successes - * @param float $probability Probability of success on each trial - * @return float - * - */ - public static function NEGBINOMDIST($failures, $successes, $probability) { - $failures = floor(PHPExcel_Calculation_Functions::flattenSingleValue($failures)); - $successes = floor(PHPExcel_Calculation_Functions::flattenSingleValue($successes)); - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - - if ((is_numeric($failures)) && (is_numeric($successes)) && (is_numeric($probability))) { - if (($failures < 0) || ($successes < 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (($probability < 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) { - if (($failures + $successes - 1) <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - } - return (PHPExcel_Calculation_MathTrig::COMBIN($failures + $successes - 1,$successes - 1)) * (pow($probability,$successes)) * (pow(1 - $probability,$failures)) ; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function NEGBINOMDIST() - - - /** - * NORMDIST - * - * Returns the normal distribution for the specified mean and standard deviation. This - * function has a very wide range of applications in statistics, including hypothesis - * testing. - * - * @param float $value - * @param float $mean Mean Value - * @param float $stdDev Standard Deviation - * @param boolean $cumulative - * @return float - * - */ - public static function NORMDIST($value, $mean, $stdDev, $cumulative) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - - if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { - if ($stdDev < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - return 0.5 * (1 + PHPExcel_Calculation_Engineering::_erfVal(($value - $mean) / ($stdDev * sqrt(2)))); - } else { - return (1 / (SQRT2PI * $stdDev)) * exp(0 - (pow($value - $mean,2) / (2 * ($stdDev * $stdDev)))); - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function NORMDIST() - - - /** - * NORMINV - * - * Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation. - * - * @param float $value - * @param float $mean Mean Value - * @param float $stdDev Standard Deviation - * @return float - * - */ - public static function NORMINV($probability,$mean,$stdDev) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - - if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) { - if (($probability < 0) || ($probability > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ($stdDev < 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return (self::_inverse_ncdf($probability) * $stdDev) + $mean; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function NORMINV() - - - /** - * NORMSDIST - * - * Returns the standard normal cumulative distribution function. The distribution has - * a mean of 0 (zero) and a standard deviation of one. Use this function in place of a - * table of standard normal curve areas. - * - * @param float $value - * @return float - */ - public static function NORMSDIST($value) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - - return self::NORMDIST($value, 0, 1, True); - } // function NORMSDIST() - - - /** - * NORMSINV - * - * Returns the inverse of the standard normal cumulative distribution - * - * @param float $value - * @return float - */ - public static function NORMSINV($value) { - return self::NORMINV($value, 0, 1); - } // function NORMSINV() - - - /** - * PERCENTILE - * - * Returns the nth percentile of values in a range.. - * - * Excel Function: - * PERCENTILE(value1[,value2[, ...]],entry) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param float $entry Percentile value in the range 0..1, inclusive. - * @return float - */ - public static function PERCENTILE() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $entry = array_pop($aArgs); - - if ((is_numeric($entry)) && (!is_string($entry))) { - if (($entry < 0) || ($entry > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $mArgs = array(); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - $mValueCount = count($mArgs); - if ($mValueCount > 0) { - sort($mArgs); - $count = self::COUNT($mArgs); - $index = $entry * ($count-1); - $iBase = floor($index); - if ($index == $iBase) { - return $mArgs[$index]; - } else { - $iNext = $iBase + 1; - $iProportion = $index - $iBase; - return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion) ; - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function PERCENTILE() - - - /** - * PERCENTRANK - * - * Returns the rank of a value in a data set as a percentage of the data set. - * - * @param array of number An array of, or a reference to, a list of numbers. - * @param number The number whose rank you want to find. - * @param number The number of significant digits for the returned percentage value. - * @return float - */ - public static function PERCENTRANK($valueSet,$value,$significance=3) { - $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet); - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $significance = (is_null($significance)) ? 3 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($significance); - - foreach($valueSet as $key => $valueEntry) { - if (!is_numeric($valueEntry)) { - unset($valueSet[$key]); - } - } - sort($valueSet,SORT_NUMERIC); - $valueCount = count($valueSet); - if ($valueCount == 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - - $valueAdjustor = $valueCount - 1; - if (($value < $valueSet[0]) || ($value > $valueSet[$valueAdjustor])) { - return PHPExcel_Calculation_Functions::NA(); - } - - $pos = array_search($value,$valueSet); - if ($pos === False) { - $pos = 0; - $testValue = $valueSet[0]; - while ($testValue < $value) { - $testValue = $valueSet[++$pos]; - } - --$pos; - $pos += (($value - $valueSet[$pos]) / ($testValue - $valueSet[$pos])); - } - - return round($pos / $valueAdjustor,$significance); - } // function PERCENTRANK() - - - /** - * PERMUT - * - * Returns the number of permutations for a given number of objects that can be - * selected from number objects. A permutation is any set or subset of objects or - * events where internal order is significant. Permutations are different from - * combinations, for which the internal order is not significant. Use this function - * for lottery-style probability calculations. - * - * @param int $numObjs Number of different objects - * @param int $numInSet Number of objects in each permutation - * @return int Number of permutations - */ - public static function PERMUT($numObjs,$numInSet) { - $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs); - $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet); - - if ((is_numeric($numObjs)) && (is_numeric($numInSet))) { - $numInSet = floor($numInSet); - if ($numObjs < $numInSet) { - return PHPExcel_Calculation_Functions::NaN(); - } - return round(PHPExcel_Calculation_MathTrig::FACT($numObjs) / PHPExcel_Calculation_MathTrig::FACT($numObjs - $numInSet)); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function PERMUT() - - - /** - * POISSON - * - * Returns the Poisson distribution. A common application of the Poisson distribution - * is predicting the number of events over a specific time, such as the number of - * cars arriving at a toll plaza in 1 minute. - * - * @param float $value - * @param float $mean Mean Value - * @param boolean $cumulative - * @return float - * - */ - public static function POISSON($value, $mean, $cumulative) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - - if ((is_numeric($value)) && (is_numeric($mean))) { - if (($value <= 0) || ($mean <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - $summer = 0; - for ($i = 0; $i <= floor($value); ++$i) { - $summer += pow($mean,$i) / PHPExcel_Calculation_MathTrig::FACT($i); - } - return exp(0-$mean) * $summer; - } else { - return (exp(0-$mean) * pow($mean,$value)) / PHPExcel_Calculation_MathTrig::FACT($value); - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function POISSON() - - - /** - * QUARTILE - * - * Returns the quartile of a data set. - * - * Excel Function: - * QUARTILE(value1[,value2[, ...]],entry) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param int $entry Quartile value in the range 1..3, inclusive. - * @return float - */ - public static function QUARTILE() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $entry = floor(array_pop($aArgs)); - - if ((is_numeric($entry)) && (!is_string($entry))) { - $entry /= 4; - if (($entry < 0) || ($entry > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - return self::PERCENTILE($aArgs,$entry); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function QUARTILE() - - - /** - * RANK - * - * Returns the rank of a number in a list of numbers. - * - * @param number The number whose rank you want to find. - * @param array of number An array of, or a reference to, a list of numbers. - * @param mixed Order to sort the values in the value set - * @return float - */ - public static function RANK($value,$valueSet,$order=0) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet); - $order = (is_null($order)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($order); - - foreach($valueSet as $key => $valueEntry) { - if (!is_numeric($valueEntry)) { - unset($valueSet[$key]); - } - } - - if ($order == 0) { - rsort($valueSet,SORT_NUMERIC); - } else { - sort($valueSet,SORT_NUMERIC); - } - $pos = array_search($value,$valueSet); - if ($pos === False) { - return PHPExcel_Calculation_Functions::NA(); - } - - return ++$pos; - } // function RANK() - - - /** - * RSQ - * - * Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function RSQ($yValues,$xValues) { - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getGoodnessOfFit(); - } // function RSQ() - - - /** - * SKEW - * - * Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry - * of a distribution around its mean. Positive skewness indicates a distribution with an - * asymmetric tail extending toward more positive values. Negative skewness indicates a - * distribution with an asymmetric tail extending toward more negative values. - * - * @param array Data Series - * @return float - */ - public static function SKEW() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - $mean = self::AVERAGE($aArgs); - $stdDev = self::STDEV($aArgs); - - $count = $summer = 0; - // Loop through arguments - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $summer += pow((($arg - $mean) / $stdDev),3) ; - ++$count; - } - } - } - - // Return - if ($count > 2) { - return $summer * ($count / (($count-1) * ($count-2))); - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function SKEW() - - - /** - * SLOPE - * - * Returns the slope of the linear regression line through data points in known_y's and known_x's. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function SLOPE($yValues,$xValues) { - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getSlope(); - } // function SLOPE() - - - /** - * SMALL - * - * Returns the nth smallest value in a data set. You can use this function to - * select a value based on its relative standing. - * - * Excel Function: - * SMALL(value1[,value2[, ...]],entry) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param int $entry Position (ordered from the smallest) in the array or range of data to return - * @return float - */ - public static function SMALL() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $entry = array_pop($aArgs); - - if ((is_numeric($entry)) && (!is_string($entry))) { - $mArgs = array(); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - $count = self::COUNT($mArgs); - $entry = floor(--$entry); - if (($entry < 0) || ($entry >= $count) || ($count == 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - sort($mArgs); - return $mArgs[$entry]; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SMALL() - - - /** - * STANDARDIZE - * - * Returns a normalized value from a distribution characterized by mean and standard_dev. - * - * @param float $value Value to normalize - * @param float $mean Mean Value - * @param float $stdDev Standard Deviation - * @return float Standardized value - */ - public static function STANDARDIZE($value,$mean,$stdDev) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean); - $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev); - - if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) { - if ($stdDev <= 0) { - return PHPExcel_Calculation_Functions::NaN(); - } - return ($value - $mean) / $stdDev ; - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function STANDARDIZE() - - - /** - * STDEV - * - * Estimates standard deviation based on a sample. The standard deviation is a measure of how - * widely values are dispersed from the average value (the mean). - * - * Excel Function: - * STDEV(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function STDEV() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGE($aArgs); - if (!is_null($aMean)) { - $aCount = -1; - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = pow(($arg - $aMean),2); - } else { - $returnValue += pow(($arg - $aMean),2); - } - ++$aCount; - } - } - - // Return - if (($aCount > 0) && ($returnValue >= 0)) { - return sqrt($returnValue / $aCount); - } - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function STDEV() - - - /** - * STDEVA - * - * Estimates standard deviation based on a sample, including numbers, text, and logical values - * - * Excel Function: - * STDEVA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function STDEVA() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGEA($aArgs); - if (!is_null($aMean)) { - $aCount = -1; - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - if (is_null($returnValue)) { - $returnValue = pow(($arg - $aMean),2); - } else { - $returnValue += pow(($arg - $aMean),2); - } - ++$aCount; - } - } - } - - // Return - if (($aCount > 0) && ($returnValue >= 0)) { - return sqrt($returnValue / $aCount); - } - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function STDEVA() - - - /** - * STDEVP - * - * Calculates standard deviation based on the entire population - * - * Excel Function: - * STDEVP(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function STDEVP() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGE($aArgs); - if (!is_null($aMean)) { - $aCount = 0; - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) { - $arg = (integer) $arg; - } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - if (is_null($returnValue)) { - $returnValue = pow(($arg - $aMean),2); - } else { - $returnValue += pow(($arg - $aMean),2); - } - ++$aCount; - } - } - - // Return - if (($aCount > 0) && ($returnValue >= 0)) { - return sqrt($returnValue / $aCount); - } - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function STDEVP() - - - /** - * STDEVPA - * - * Calculates standard deviation based on the entire population, including numbers, text, and logical values - * - * Excel Function: - * STDEVPA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function STDEVPA() { - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - - // Return value - $returnValue = null; - - $aMean = self::AVERAGEA($aArgs); - if (!is_null($aMean)) { - $aCount = 0; - foreach ($aArgs as $k => $arg) { - if ((is_bool($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - if (is_null($returnValue)) { - $returnValue = pow(($arg - $aMean),2); - } else { - $returnValue += pow(($arg - $aMean),2); - } - ++$aCount; - } - } - } - - // Return - if (($aCount > 0) && ($returnValue >= 0)) { - return sqrt($returnValue / $aCount); - } - } - return PHPExcel_Calculation_Functions::DIV0(); - } // function STDEVPA() - - - /** - * STEYX - * - * Returns the standard error of the predicted y-value for each x in the regression. - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @return float - */ - public static function STEYX($yValues,$xValues) { - if (!self::_checkTrendArrays($yValues,$xValues)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - $yValueCount = count($yValues); - $xValueCount = count($xValues); - - if (($yValueCount == 0) || ($yValueCount != $xValueCount)) { - return PHPExcel_Calculation_Functions::NA(); - } elseif ($yValueCount == 1) { - return PHPExcel_Calculation_Functions::DIV0(); - } - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues); - return $bestFitLinear->getStdevOfResiduals(); - } // function STEYX() - - - /** - * TDIST - * - * Returns the probability of Student's T distribution. - * - * @param float $value Value for the function - * @param float $degrees degrees of freedom - * @param float $tails number of tails (1 or 2) - * @return float - */ - public static function TDIST($value, $degrees, $tails) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); - $tails = floor(PHPExcel_Calculation_Functions::flattenSingleValue($tails)); - - if ((is_numeric($value)) && (is_numeric($degrees)) && (is_numeric($tails))) { - if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) { - return PHPExcel_Calculation_Functions::NaN(); - } - // tdist, which finds the probability that corresponds to a given value - // of t with k degrees of freedom. This algorithm is translated from a - // pascal function on p81 of "Statistical Computing in Pascal" by D - // Cooke, A H Craven & G M Clark (1985: Edward Arnold (Pubs.) Ltd: - // London). The above Pascal algorithm is itself a translation of the - // fortran algoritm "AS 3" by B E Cooper of the Atlas Computer - // Laboratory as reported in (among other places) "Applied Statistics - // Algorithms", editied by P Griffiths and I D Hill (1985; Ellis - // Horwood Ltd.; W. Sussex, England). - $tterm = $degrees; - $ttheta = atan2($value,sqrt($tterm)); - $tc = cos($ttheta); - $ts = sin($ttheta); - $tsum = 0; - - if (($degrees % 2) == 1) { - $ti = 3; - $tterm = $tc; - } else { - $ti = 2; - $tterm = 1; - } - - $tsum = $tterm; - while ($ti < $degrees) { - $tterm *= $tc * $tc * ($ti - 1) / $ti; - $tsum += $tterm; - $ti += 2; - } - $tsum *= $ts; - if (($degrees % 2) == 1) { $tsum = M_2DIVPI * ($tsum + $ttheta); } - $tValue = 0.5 * (1 + $tsum); - if ($tails == 1) { - return 1 - abs($tValue); - } else { - return 1 - abs((1 - $tValue) - $tValue); - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TDIST() - - - /** - * TINV - * - * Returns the one-tailed probability of the chi-squared distribution. - * - * @param float $probability Probability for the function - * @param float $degrees degrees of freedom - * @return float - */ - public static function TINV($probability, $degrees) { - $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability); - $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees)); - - if ((is_numeric($probability)) && (is_numeric($degrees))) { - $xLo = 100; - $xHi = 0; - - $x = $xNew = 1; - $dx = 1; - $i = 0; - - while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) { - // Apply Newton-Raphson step - $result = self::TDIST($x, $degrees, 2); - $error = $result - $probability; - if ($error == 0.0) { - $dx = 0; - } elseif ($error < 0.0) { - $xLo = $x; - } else { - $xHi = $x; - } - // Avoid division by zero - if ($result != 0.0) { - $dx = $error / $result; - $xNew = $x - $dx; - } - // If the NR fails to converge (which for example may be the - // case if the initial guess is too rough) we apply a bisection - // step to determine a more narrow interval around the root. - if (($xNew < $xLo) || ($xNew > $xHi) || ($result == 0.0)) { - $xNew = ($xLo + $xHi) / 2; - $dx = $xNew - $x; - } - $x = $xNew; - } - if ($i == MAX_ITERATIONS) { - return PHPExcel_Calculation_Functions::NA(); - } - return round($x,12); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TINV() - - - /** - * TREND - * - * Returns values along a linear trend - * - * @param array of mixed Data Series Y - * @param array of mixed Data Series X - * @param array of mixed Values of X for which we want to find Y - * @param boolean A logical value specifying whether to force the intersect to equal 0. - * @return array of float - */ - public static function TREND($yValues,$xValues=array(),$newValues=array(),$const=True) { - $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues); - $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues); - $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues); - $const = (is_null($const)) ? True : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const); - - $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR,$yValues,$xValues,$const); - if (count($newValues) == 0) { - $newValues = $bestFitLinear->getXValues(); - } - - $returnArray = array(); - foreach($newValues as $xValue) { - $returnArray[0][] = $bestFitLinear->getValueOfYForX($xValue); - } - - return $returnArray; - } // function TREND() - - - /** - * TRIMMEAN - * - * Returns the mean of the interior of a data set. TRIMMEAN calculates the mean - * taken by excluding a percentage of data points from the top and bottom tails - * of a data set. - * - * Excel Function: - * TRIMEAN(value1[,value2[, ...]],$discard) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @param float $discard Percentage to discard - * @return float - */ - public static function TRIMMEAN() { - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - - // Calculate - $percent = array_pop($aArgs); - - if ((is_numeric($percent)) && (!is_string($percent))) { - if (($percent < 0) || ($percent > 1)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $mArgs = array(); - foreach ($aArgs as $arg) { - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $mArgs[] = $arg; - } - } - $discard = floor(self::COUNT($mArgs) * $percent / 2); - sort($mArgs); - for ($i=0; $i < $discard; ++$i) { - array_pop($mArgs); - array_shift($mArgs); - } - return self::AVERAGE($mArgs); - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function TRIMMEAN() - - - /** - * VARFunc - * - * Estimates variance based on a sample. - * - * Excel Function: - * VAR(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function VARFunc() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::DIV0(); - - $summerA = $summerB = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - $aCount = 0; - foreach ($aArgs as $arg) { - if (is_bool($arg)) { $arg = (integer) $arg; } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $summerA += ($arg * $arg); - $summerB += $arg; - ++$aCount; - } - } - - // Return - if ($aCount > 1) { - $summerA *= $aCount; - $summerB *= $summerB; - $returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1)); - } - return $returnValue; - } // function VARFunc() - - - /** - * VARA - * - * Estimates variance based on a sample, including numbers, text, and logical values - * - * Excel Function: - * VARA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function VARA() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::DIV0(); - - $summerA = $summerB = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - $aCount = 0; - foreach ($aArgs as $k => $arg) { - if ((is_string($arg)) && - (PHPExcel_Calculation_Functions::isValue($k))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ((is_string($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - $summerA += ($arg * $arg); - $summerB += $arg; - ++$aCount; - } - } - } - - // Return - if ($aCount > 1) { - $summerA *= $aCount; - $summerB *= $summerB; - $returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1)); - } - return $returnValue; - } // function VARA() - - - /** - * VARP - * - * Calculates variance based on the entire population - * - * Excel Function: - * VARP(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function VARP() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::DIV0(); - - $summerA = $summerB = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - $aCount = 0; - foreach ($aArgs as $arg) { - if (is_bool($arg)) { $arg = (integer) $arg; } - // Is it a numeric value? - if ((is_numeric($arg)) && (!is_string($arg))) { - $summerA += ($arg * $arg); - $summerB += $arg; - ++$aCount; - } - } - - // Return - if ($aCount > 0) { - $summerA *= $aCount; - $summerB *= $summerB; - $returnValue = ($summerA - $summerB) / ($aCount * $aCount); - } - return $returnValue; - } // function VARP() - - - /** - * VARPA - * - * Calculates variance based on the entire population, including numbers, text, and logical values - * - * Excel Function: - * VARPA(value1[,value2[, ...]]) - * - * @access public - * @category Statistical Functions - * @param mixed $arg,... Data values - * @return float - */ - public static function VARPA() { - // Return value - $returnValue = PHPExcel_Calculation_Functions::DIV0(); - - $summerA = $summerB = 0; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()); - $aCount = 0; - foreach ($aArgs as $k => $arg) { - if ((is_string($arg)) && - (PHPExcel_Calculation_Functions::isValue($k))) { - return PHPExcel_Calculation_Functions::VALUE(); - } elseif ((is_string($arg)) && - (!PHPExcel_Calculation_Functions::isMatrixValue($k))) { - } else { - // Is it a numeric value? - if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) { - if (is_bool($arg)) { - $arg = (integer) $arg; - } elseif (is_string($arg)) { - $arg = 0; - } - $summerA += ($arg * $arg); - $summerB += $arg; - ++$aCount; - } - } - } - - // Return - if ($aCount > 0) { - $summerA *= $aCount; - $summerB *= $summerB; - $returnValue = ($summerA - $summerB) / ($aCount * $aCount); - } - return $returnValue; - } // function VARPA() - - - /** - * WEIBULL - * - * Returns the Weibull distribution. Use this distribution in reliability - * analysis, such as calculating a device's mean time to failure. - * - * @param float $value - * @param float $alpha Alpha Parameter - * @param float $beta Beta Parameter - * @param boolean $cumulative - * @return float - * - */ - public static function WEIBULL($value, $alpha, $beta, $cumulative) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha); - $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta); - - if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta))) { - if (($value < 0) || ($alpha <= 0) || ($beta <= 0)) { - return PHPExcel_Calculation_Functions::NaN(); - } - if ((is_numeric($cumulative)) || (is_bool($cumulative))) { - if ($cumulative) { - return 1 - exp(0 - pow($value / $beta,$alpha)); - } else { - return ($alpha / pow($beta,$alpha)) * pow($value,$alpha - 1) * exp(0 - pow($value / $beta,$alpha)); - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function WEIBULL() - - - /** - * ZTEST - * - * Returns the Weibull distribution. Use this distribution in reliability - * analysis, such as calculating a device's mean time to failure. - * - * @param float $value - * @param float $alpha Alpha Parameter - * @param float $beta Beta Parameter - * @param boolean $cumulative - * @return float - * - */ - public static function ZTEST($dataSet, $m0, $sigma=null) { - $dataSet = PHPExcel_Calculation_Functions::flattenArrayIndexed($dataSet); - $m0 = PHPExcel_Calculation_Functions::flattenSingleValue($m0); - $sigma = PHPExcel_Calculation_Functions::flattenSingleValue($sigma); - - if (is_null($sigma)) { - $sigma = self::STDEV($dataSet); - } - $n = count($dataSet); - - return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0)/($sigma/SQRT($n))); - } // function ZTEST() - -} // class PHPExcel_Calculation_Statistical diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/TextData.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/TextData.php deleted file mode 100644 index 9916876257..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/TextData.php +++ /dev/null @@ -1,588 +0,0 @@ -=0 && ord($c{0}) <= 127) - return ord($c{0}); - if (ord($c{0}) >= 192 && ord($c{0}) <= 223) - return (ord($c{0})-192)*64 + (ord($c{1})-128); - if (ord($c{0}) >= 224 && ord($c{0}) <= 239) - return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); - if (ord($c{0}) >= 240 && ord($c{0}) <= 247) - return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); - if (ord($c{0}) >= 248 && ord($c{0}) <= 251) - return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); - if (ord($c{0}) >= 252 && ord($c{0}) <= 253) - return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); - if (ord($c{0}) >= 254 && ord($c{0}) <= 255) //error - return PHPExcel_Calculation_Functions::VALUE(); - return 0; - } // function _uniord() - - /** - * CHARACTER - * - * @param string $character Value - * @return int - */ - public static function CHARACTER($character) { - $character = PHPExcel_Calculation_Functions::flattenSingleValue($character); - - if ((!is_numeric($character)) || ($character < 0)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (function_exists('mb_convert_encoding')) { - return mb_convert_encoding('&#'.intval($character).';', 'UTF-8', 'HTML-ENTITIES'); - } else { - return chr(intval($character)); - } - } - - - /** - * TRIMNONPRINTABLE - * - * @param mixed $value Value to check - * @return string - */ - public static function TRIMNONPRINTABLE($stringValue = '') { - $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue); - - if (is_bool($stringValue)) { - $stringValue = ($stringValue) ? 'TRUE' : 'FALSE'; - } - - if (self::$_invalidChars == Null) { - self::$_invalidChars = range(chr(0),chr(31)); - } - - if (is_string($stringValue) || is_numeric($stringValue)) { - return str_replace(self::$_invalidChars,'',trim($stringValue,"\x00..\x1F")); - } - return Null; - } // function TRIMNONPRINTABLE() - - - /** - * TRIMSPACES - * - * @param mixed $value Value to check - * @return string - */ - public static function TRIMSPACES($stringValue = '') { - $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue); - - if (is_string($stringValue) || is_numeric($stringValue)) { - return trim(preg_replace('/ +/',' ',$stringValue)); - } - return Null; - } // function TRIMSPACES() - - - /** - * ASCIICODE - * - * @param string $character Value - * @return int - */ - public static function ASCIICODE($characters) { - $characters = PHPExcel_Calculation_Functions::flattenSingleValue($characters); - if (is_bool($characters)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $characters = (int) $characters; - } else { - if ($characters) { - $characters = 'True'; - } else { - $characters = 'False'; - } - } - } - - $character = $characters; - if ((function_exists('mb_strlen')) && (function_exists('mb_substr'))) { - if (mb_strlen($characters, 'UTF-8') > 1) { $character = mb_substr($characters, 0, 1, 'UTF-8'); } - return self::_uniord($character); - } else { - if (strlen($characters) > 0) { $character = substr($characters, 0, 1); } - return ord($character); - } - } // function ASCIICODE() - - - /** - * CONCATENATE - * - * @return string - */ - public static function CONCATENATE() { - // Return value - $returnValue = ''; - - // Loop through arguments - $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args()); - foreach ($aArgs as $arg) { - if (is_bool($arg)) { - if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) { - $arg = (int) $arg; - } else { - if ($arg) { - $arg = 'TRUE'; - } else { - $arg = 'FALSE'; - } - } - } - $returnValue .= $arg; - } - - // Return - return $returnValue; - } // function CONCATENATE() - - - /** - * DOLLAR - * - * This function converts a number to text using currency format, with the decimals rounded to the specified place. - * The format used is $#,##0.00_);($#,##0.00).. - * - * @param float $value The value to format - * @param int $decimals The number of digits to display to the right of the decimal point. - * If decimals is negative, number is rounded to the left of the decimal point. - * If you omit decimals, it is assumed to be 2 - * @return string - */ - public static function DOLLAR($value = 0, $decimals = 2) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $decimals = is_null($decimals) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($decimals); - - // Validate parameters - if (!is_numeric($value) || !is_numeric($decimals)) { - return PHPExcel_Calculation_Functions::NaN(); - } - $decimals = floor($decimals); - - if ($decimals > 0) { - return money_format('%.'.$decimals.'n',$value); - } else { - $round = pow(10,abs($decimals)); - if ($value < 0) { $round = 0-$round; } - $value = PHPExcel_Calculation_MathTrig::MROUND($value,$round); - // The implementation of money_format used if the standard PHP function is not available can't handle decimal places of 0, - // so we display to 1 dp and chop off that character and the decimal separator using substr - return substr(money_format('%.1n',$value),0,-2); - } - } // function DOLLAR() - - - /** - * SEARCHSENSITIVE - * - * @param string $needle The string to look for - * @param string $haystack The string in which to look - * @param int $offset Offset within $haystack - * @return string - */ - public static function SEARCHSENSITIVE($needle,$haystack,$offset=1) { - $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle); - $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack); - $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset); - - if (!is_bool($needle)) { - if (is_bool($haystack)) { - $haystack = ($haystack) ? 'TRUE' : 'FALSE'; - } - - if (($offset > 0) && (strlen($haystack) > $offset)) { - if (function_exists('mb_strpos')) { - $pos = mb_strpos($haystack, $needle, --$offset,'UTF-8'); - } else { - $pos = strpos($haystack, $needle, --$offset); - } - if ($pos !== false) { - return ++$pos; - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SEARCHSENSITIVE() - - - /** - * SEARCHINSENSITIVE - * - * @param string $needle The string to look for - * @param string $haystack The string in which to look - * @param int $offset Offset within $haystack - * @return string - */ - public static function SEARCHINSENSITIVE($needle,$haystack,$offset=1) { - $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle); - $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack); - $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset); - - if (!is_bool($needle)) { - if (is_bool($haystack)) { - $haystack = ($haystack) ? 'TRUE' : 'FALSE'; - } - - if (($offset > 0) && (strlen($haystack) > $offset)) { - if (function_exists('mb_stripos')) { - $pos = mb_stripos($haystack, $needle, --$offset,'UTF-8'); - } else { - $pos = stripos($haystack, $needle, --$offset); - } - if ($pos !== false) { - return ++$pos; - } - } - } - return PHPExcel_Calculation_Functions::VALUE(); - } // function SEARCHINSENSITIVE() - - - /** - * FIXEDFORMAT - * - * @param mixed $value Value to check - * @return boolean - */ - public static function FIXEDFORMAT($value,$decimals=2,$no_commas=false) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $decimals = PHPExcel_Calculation_Functions::flattenSingleValue($decimals); - $no_commas = PHPExcel_Calculation_Functions::flattenSingleValue($no_commas); - - $valueResult = round($value,$decimals); - if ($decimals < 0) { $decimals = 0; } - if (!$no_commas) { - $valueResult = number_format($valueResult,$decimals); - } - - return (string) $valueResult; - } // function FIXEDFORMAT() - - - /** - * LEFT - * - * @param string $value Value - * @param int $chars Number of characters - * @return string - */ - public static function LEFT($value = '', $chars = 1) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); - - if ($chars < 0) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_bool($value)) { - $value = ($value) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_substr')) { - return mb_substr($value, 0, $chars, 'UTF-8'); - } else { - return substr($value, 0, $chars); - } - } // function LEFT() - - - /** - * MID - * - * @param string $value Value - * @param int $start Start character - * @param int $chars Number of characters - * @return string - */ - public static function MID($value = '', $start = 1, $chars = null) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $start = PHPExcel_Calculation_Functions::flattenSingleValue($start); - $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); - - if (($start < 1) || ($chars < 0)) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_bool($value)) { - $value = ($value) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_substr')) { - return mb_substr($value, --$start, $chars, 'UTF-8'); - } else { - return substr($value, --$start, $chars); - } - } // function MID() - - - /** - * RIGHT - * - * @param string $value Value - * @param int $chars Number of characters - * @return string - */ - public static function RIGHT($value = '', $chars = 1) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); - - if ($chars < 0) { - return PHPExcel_Calculation_Functions::VALUE(); - } - - if (is_bool($value)) { - $value = ($value) ? 'TRUE' : 'FALSE'; - } - - if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) { - return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8'); - } else { - return substr($value, strlen($value) - $chars); - } - } // function RIGHT() - - - /** - * STRINGLENGTH - * - * @param string $value Value - * @param int $chars Number of characters - * @return string - */ - public static function STRINGLENGTH($value = '') { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - - if (is_bool($value)) { - $value = ($value) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_strlen')) { - return mb_strlen($value, 'UTF-8'); - } else { - return strlen($value); - } - } // function STRINGLENGTH() - - - /** - * LOWERCASE - * - * Converts a string value to upper case. - * - * @param string $mixedCaseString - * @return string - */ - public static function LOWERCASE($mixedCaseString) { - $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); - - if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_convert_case')) { - return mb_convert_case($mixedCaseString, MB_CASE_LOWER, 'UTF-8'); - } else { - return strtoupper($mixedCaseString); - } - } // function LOWERCASE() - - - /** - * UPPERCASE - * - * Converts a string value to upper case. - * - * @param string $mixedCaseString - * @return string - */ - public static function UPPERCASE($mixedCaseString) { - $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); - - if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_convert_case')) { - return mb_convert_case($mixedCaseString, MB_CASE_UPPER, 'UTF-8'); - } else { - return strtoupper($mixedCaseString); - } - } // function UPPERCASE() - - - /** - * PROPERCASE - * - * Converts a string value to upper case. - * - * @param string $mixedCaseString - * @return string - */ - public static function PROPERCASE($mixedCaseString) { - $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString); - - if (is_bool($mixedCaseString)) { - $mixedCaseString = ($mixedCaseString) ? 'TRUE' : 'FALSE'; - } - - if (function_exists('mb_convert_case')) { - return mb_convert_case($mixedCaseString, MB_CASE_TITLE, 'UTF-8'); - } else { - return ucwords($mixedCaseString); - } - } // function PROPERCASE() - - - /** - * REPLACE - * - * @param string $value Value - * @param int $start Start character - * @param int $chars Number of characters - * @return string - */ - public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText) { - $oldText = PHPExcel_Calculation_Functions::flattenSingleValue($oldText); - $start = PHPExcel_Calculation_Functions::flattenSingleValue($start); - $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars); - $newText = PHPExcel_Calculation_Functions::flattenSingleValue($newText); - - $left = self::LEFT($oldText,$start-1); - $right = self::RIGHT($oldText,self::STRINGLENGTH($oldText)-($start+$chars)+1); - - return $left.$newText.$right; - } // function REPLACE() - - - /** - * SUBSTITUTE - * - * @param string $text Value - * @param string $fromText From Value - * @param string $toText To Value - * @param integer $instance Instance Number - * @return string - */ - public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0) { - $text = PHPExcel_Calculation_Functions::flattenSingleValue($text); - $fromText = PHPExcel_Calculation_Functions::flattenSingleValue($fromText); - $toText = PHPExcel_Calculation_Functions::flattenSingleValue($toText); - $instance = floor(PHPExcel_Calculation_Functions::flattenSingleValue($instance)); - - if ($instance == 0) { - if(function_exists('mb_str_replace')) { - return mb_str_replace($fromText,$toText,$text); - } else { - return str_replace($fromText,$toText,$text); - } - } else { - $pos = -1; - while($instance > 0) { - if (function_exists('mb_strpos')) { - $pos = mb_strpos($text, $fromText, $pos+1, 'UTF-8'); - } else { - $pos = strpos($text, $fromText, $pos+1); - } - if ($pos === false) { - break; - } - --$instance; - } - if ($pos !== false) { - if (function_exists('mb_strlen')) { - return self::REPLACE($text,++$pos,mb_strlen($fromText, 'UTF-8'),$toText); - } else { - return self::REPLACE($text,++$pos,strlen($fromText),$toText); - } - } - } - - return $left.$newText.$right; - } // function SUBSTITUTE() - - - /** - * RETURNSTRING - * - * @param mixed $value Value to check - * @return boolean - */ - public static function RETURNSTRING($testValue = '') { - $testValue = PHPExcel_Calculation_Functions::flattenSingleValue($testValue); - - if (is_string($testValue)) { - return $testValue; - } - return Null; - } // function RETURNSTRING() - - - /** - * TEXTFORMAT - * - * @param mixed $value Value to check - * @return boolean - */ - public static function TEXTFORMAT($value,$format) { - $value = PHPExcel_Calculation_Functions::flattenSingleValue($value); - $format = PHPExcel_Calculation_Functions::flattenSingleValue($format); - - if ((is_string($value)) && (!is_numeric($value)) && PHPExcel_Shared_Date::isDateTimeFormatCode($format)) { - $value = PHPExcel_Calculation_DateTime::DATEVALUE($value); - } - - return (string) PHPExcel_Style_NumberFormat::toFormattedString($value,$format); - } // function TEXTFORMAT() - -} // class PHPExcel_Calculation_TextData diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/functionlist.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/functionlist.txt deleted file mode 100644 index 67dbd49cf5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Calculation/functionlist.txt +++ /dev/null @@ -1,351 +0,0 @@ -ABS -ACCRINT -ACCRINTM -ACOS -ACOSH -ADDRESS -AMORDEGRC -AMORLINC -AND -AREAS -ASC -ASIN -ASINH -ATAN -ATAN2 -ATANH -AVEDEV -AVERAGE -AVERAGEA -AVERAGEIF -AVERAGEIFS -BAHTTEXT -BESSELI -BESSELJ -BESSELK -BESSELY -BETADIST -BETAINV -BIN2DEC -BIN2HEX -BIN2OCT -BINOMDIST -CEILING -CELL -CHAR -CHIDIST -CHIINV -CHITEST -CHOOSE -CLEAN -CODE -COLUMN -COLUMNS -COMBIN -COMPLEX -CONCATENATE -CONFIDENCE -CONVERT -CORREL -COS -COSH -COUNT -COUNTA -COUNTBLANK -COUNTIF -COUNTIFS -COUPDAYBS -COUPDAYBS -COUPDAYSNC -COUPNCD -COUPNUM -COUPPCD -COVAR -CRITBINOM -CUBEKPIMEMBER -CUBEMEMBER -CUBEMEMBERPROPERTY -CUBERANKEDMEMBER -CUBESET -CUBESETCOUNT -CUBEVALUE -CUMIPMT -CUMPRINC -DATE -DATEDIF -DATEVALUE -DAVERAGE -DAY -DAYS360 -DB -DCOUNT -DCOUNTA -DDB -DEC2BIN -DEC2HEX -DEC2OCT -DEGREES -DELTA -DEVSQ -DGET -DISC -DMAX -DMIN -DOLLAR -DOLLARDE -DOLLARFR -DPRODUCT -DSTDEV -DSTDEVP -DSUM -DURATION -DVAR -DVARP -EDATE -EFFECT -EOMONTH -ERF -ERFC -ERROR.TYPE -EVEN -EXACT -EXP -EXPONDIST -FACT -FACTDOUBLE -FALSE -FDIST -FIND -FINDB -FINV -FISHER -FISHERINV -FIXED -FLOOR -FORECAST -FREQUENCY -FTEST -FV -FVSCHEDULE -GAMAMDIST -GAMMAINV -GAMMALN -GCD -GEOMEAN -GESTEP -GETPIVOTDATA -GROWTH -HARMEAN -HEX2BIN -HEX2OCT -HLOOKUP -HOUR -HYPERLINK -HYPGEOMDIST -IF -IFERROR -IMABS -IMAGINARY -IMARGUMENT -IMCONJUGATE -IMCOS -IMEXP -IMLN -IMLOG10 -IMLOG2 -IMPOWER -IMPRODUCT -IMREAL -IMSIN -IMSQRT -IMSUB -IMSUM -INDEX -INDIRECT -INFO -INT -INTERCEPT -INTRATE -IPMT -IRR -ISBLANK -ISERR -ISERROR -ISEVEN -ISLOGICAL -ISNA -ISNONTEXT -ISNUMBER -ISODD -ISPMT -ISREF -ISTEXT -JIS -KURT -LARGE -LCM -LEFT -LEFTB -LEN -LENB -LINEST -LN -LOG -LOG10 -LOGEST -LOGINV -LOGNORMDIST -LOOKUP -LOWER -MATCH -MAX -MAXA -MDETERM -MDURATION -MEDIAN -MID -MIDB -MIN -MINA -MINUTE -MINVERSE -MIRR -MMULT -MOD -MODE -MONTH -MROUND -MULTINOMIAL -N -NA -NEGBINOMDIST -NETWORKDAYS -NOMINAL -NORMDIST -NORMINV -NORMSDIST -NORMSINV -NOT -NOW -NPER -NPV -OCT2BIN -OCT2DEC -OCT2HEX -ODD -ODDFPRICE -ODDFYIELD -ODDLPRICE -ODDLYIELD -OFFSET -OR -PEARSON -PERCENTILE -PERCENTRANK -PERMUT -PHONETIC -PI -PMT -POISSON -POWER -PPMT -PRICE -PRICEDISC -PRICEMAT -PROB -PRODUCT -PROPER -PV -QUARTILE -QUOTIENT -RADIANS -RAND -RANDBETWEEN -RANK -RATE -RECEIVED -REPLACE -REPLACEB -REPT -RIGHT -RIGHTB -ROMAN -ROUND -ROUNDDOWN -ROUNDUP -ROW -ROWS -RSQ -RTD -SEARCH -SEARCHB -SECOND -SERIESSUM -SIGN -SIN -SINH -SKEW -SLN -SLOPE -SMALL -SQRT -SQRTPI -STANDARDIZE -STDEV -STDEVA -STDEVP -STDEVPA -STEYX -SUBSTITUTE -SUBTOTAL -SUM -SUMIF -SUMIFS -SUMPRODUCT -SUMSQ -SUMX2MY2 -SUMX2PY2 -SUMXMY2 -SYD -T -TAN -TANH -TBILLEQ -TBILLPRICE -TBILLYIELD -TDIST -TEXT -TIME -TIMEVALUE -TINV -TODAY -TRANSPOSE -TREND -TRIM -TRIMMEAN -TRUE -TRUNC -TTEST -TYPE -UPPER -USDOLLAR -VALUE -VAR -VARA -VARP -VARPA -VDB -VERSION -VLOOKUP -WEEKDAY -WEEKNUM -WEIBULL -WORKDAY -XIRR -XNPV -YEAR -YEARFRAC -YIELD -YIELDDISC -YIELDMAT -ZTEST diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell.php deleted file mode 100644 index 996d68aa75..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell.php +++ /dev/null @@ -1,860 +0,0 @@ -_parent->getCellCacheController()->updateCacheData($this); - return $this; - } - - public function detach() { - $this->_parent = null; - } - - public function attach($parent) { - $this->_parent = $parent; - } - - - /** - * Create a new Cell - * - * @param string $pColumn - * @param int $pRow - * @param mixed $pValue - * @param string $pDataType - * @param PHPExcel_Worksheet $pSheet - * @throws Exception - */ - public function __construct($pColumn = 'A', $pRow = 1, $pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null) - { - // Initialise cell coordinate - $this->_column = strtoupper($pColumn); - $this->_row = $pRow; - - // Initialise cell value - $this->_value = $pValue; - - // Set worksheet - $this->_parent = $pSheet; - - // Set datatype? - if ($pDataType !== null) { - if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; - $this->_dataType = $pDataType; - } else { - if (!self::getValueBinder()->bindValue($this, $pValue)) { - throw new Exception("Value could not be bound to cell."); - } - } - - // set default index to cellXf - $this->_xfIndex = 0; - } - - /** - * Get cell coordinate column - * - * @return string - */ - public function getColumn() - { - return $this->_column; - } - - /** - * Get cell coordinate row - * - * @return int - */ - public function getRow() - { - return $this->_row; - } - - /** - * Get cell coordinate - * - * @return string - */ - public function getCoordinate() - { - return $this->_column . $this->_row; - } - - /** - * Get cell value - * - * @return mixed - */ - public function getValue() - { - return $this->_value; - } - - /** - * Get cell value with formatting - * - * @return string - */ - public function getFormattedValue() - { - return PHPExcel_Style_NumberFormat::toFormattedString( $this->getCalculatedValue(), - $this->_parent->getParent()->getCellXfByIndex($this->getXfIndex())->getNumberFormat()->getFormatCode() - ); - } - - /** - * Set cell value - * - * This clears the cell formula. - * - * @param mixed $pValue Value - * @return PHPExcel_Cell - */ - public function setValue($pValue = null) - { - if (!self::getValueBinder()->bindValue($this, $pValue)) { - throw new Exception("Value could not be bound to cell."); - } - return $this; - } - - /** - * Set cell value (with explicit data type given) - * - * @param mixed $pValue Value - * @param string $pDataType Explicit data type - * @return PHPExcel_Cell - * @throws Exception - */ - public function setValueExplicit($pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) - { - // set the value according to data type - switch ($pDataType) { - case PHPExcel_Cell_DataType::TYPE_STRING2: - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; - case PHPExcel_Cell_DataType::TYPE_STRING: - case PHPExcel_Cell_DataType::TYPE_NULL: - case PHPExcel_Cell_DataType::TYPE_INLINE: - $this->_value = PHPExcel_Cell_DataType::checkString($pValue); - break; - - case PHPExcel_Cell_DataType::TYPE_NUMERIC: - $this->_value = (float)$pValue; - break; - - case PHPExcel_Cell_DataType::TYPE_FORMULA: - $this->_value = (string)$pValue; - break; - - case PHPExcel_Cell_DataType::TYPE_BOOL: - $this->_value = (bool)$pValue; - break; - - case PHPExcel_Cell_DataType::TYPE_ERROR: - $this->_value = PHPExcel_Cell_DataType::checkErrorCode($pValue); - break; - - default: - throw new Exception('Invalid datatype: ' . $pDataType); - break; - } - - // set the datatype - $this->_dataType = $pDataType; - - return $this->notifyCacheController(); - } - - /** - * Get calculated cell value - * - * @return mixed - */ - public function getCalculatedValue($resetLog=true) - { -// echo 'Cell '.$this->getCoordinate().' value is a '.$this->_dataType.' with a value of '.$this->getValue().'
      '; - if ($this->_dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) { - try { -// echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value
      '; - $result = PHPExcel_Calculation::getInstance()->calculateCellValue($this,$resetLog); -// echo $this->getCoordinate().' calculation result is '.$result.'
      '; - } catch ( Exception $ex ) { -// echo 'Calculation Exception: '.$ex->getMessage().'
      '; - $result = '#N/A'; - throw(new Exception($this->getParent()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage())); - } - - if ($result === '#Not Yet Implemented') { -// echo 'Returning fallback value of '.$this->_calculatedValue.' for cell '.$this->getCoordinate().'
      '; - return $this->_calculatedValue; // Fallback if calculation engine does not support the formula. - } -// echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().'
      '; - return $result; - } - -// if (is_null($this->_value)) { -// echo 'Cell '.$this->getCoordinate().' has no value, formula or otherwise
      '; -// return null; -// } -// echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->_value.'
      '; - return $this->_value; - } - - /** - * Set calculated value (used for caching) - * - * @param mixed $pValue Value - * @return PHPExcel_Cell - */ - public function setCalculatedValue($pValue = null) - { - if (!is_null($pValue)) { - $this->_calculatedValue = $pValue; - } - - return $this->notifyCacheController(); - } - - /** - * Get old calculated value (cached) - * - * @return mixed - */ - public function getOldCalculatedValue() - { - return $this->_calculatedValue; - } - - /** - * Get cell data type - * - * @return string - */ - public function getDataType() - { - return $this->_dataType; - } - - /** - * Set cell data type - * - * @param string $pDataType - * @return PHPExcel_Cell - */ - public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING) - { - if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) - $pDataType = PHPExcel_Cell_DataType::TYPE_STRING; - - $this->_dataType = $pDataType; - - return $this->notifyCacheController(); - } - - /** - * Has Data validation? - * - * @return boolean - */ - public function hasDataValidation() - { - if (!isset($this->_parent)) { - throw new Exception('Cannot check for data validation when cell is not bound to a worksheet'); - } - - return $this->_parent->dataValidationExists($this->getCoordinate()); - } - - /** - * Get Data validation - * - * @return PHPExcel_Cell_DataValidation - */ - public function getDataValidation() - { - if (!isset($this->_parent)) { - throw new Exception('Cannot get data validation for cell that is not bound to a worksheet'); - } - - return $this->_parent->getDataValidation($this->getCoordinate()); - } - - /** - * Set Data validation - * - * @param PHPExcel_Cell_DataValidation $pDataValidation - * @throws Exception - * @return PHPExcel_Cell - */ - public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null) - { - if (!isset($this->_parent)) { - throw new Exception('Cannot set data validation for cell that is not bound to a worksheet'); - } - - $this->_parent->setDataValidation($this->getCoordinate(), $pDataValidation); - - return $this->notifyCacheController(); - } - - /** - * Has Hyperlink - * - * @return boolean - */ - public function hasHyperlink() - { - if (!isset($this->_parent)) { - throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet'); - } - - return $this->_parent->hyperlinkExists($this->getCoordinate()); - } - - /** - * Get Hyperlink - * - * @throws Exception - * @return PHPExcel_Cell_Hyperlink - */ - public function getHyperlink() - { - if (!isset($this->_parent)) { - throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet'); - } - - return $this->_parent->getHyperlink($this->getCoordinate()); - } - - /** - * Set Hyperlink - * - * @param PHPExcel_Cell_Hyperlink $pHyperlink - * @throws Exception - * @return PHPExcel_Cell - */ - public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null) - { - if (!isset($this->_parent)) { - throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet'); - } - - $this->_parent->setHyperlink($this->getCoordinate(), $pHyperlink); - - return $this->notifyCacheController(); - } - - /** - * Get parent - * - * @return PHPExcel_Worksheet - */ - public function getParent() { - return $this->_parent; - } - - /** - * Re-bind parent - * - * @param PHPExcel_Worksheet $parent - * @return PHPExcel_Cell - */ - public function rebindParent(PHPExcel_Worksheet $parent) { - $this->_parent = $parent; - - return $this->notifyCacheController(); - } - - /** - * Is cell in a specific range? - * - * @param string $pRange Cell range (e.g. A1:A1) - * @return boolean - */ - public function isInRange($pRange = 'A1:A1') - { - list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange); - - // Translate properties - $myColumn = PHPExcel_Cell::columnIndexFromString($this->getColumn()); - $myRow = $this->getRow(); - - // Verify if cell is in range - return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) && - ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow) - ); - } - - /** - * Coordinate from string - * - * @param string $pCoordinateString - * @return array Array containing column and row (indexes 0 and 1) - * @throws Exception - */ - public static function coordinateFromString($pCoordinateString = 'A1') - { - if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) { - return array($matches[1],$matches[2]); - } elseif ((strpos($pCoordinateString,':') !== false) || (strpos($pCoordinateString,',') !== false)) { - throw new Exception('Cell coordinate string can not be a range of cells.'); - } elseif ($pCoordinateString == '') { - throw new Exception('Cell coordinate can not be zero-length string.'); - } else { - throw new Exception('Invalid cell coordinate '.$pCoordinateString); - } - } - - /** - * Make string row, column or cell coordinate absolute - * - * @param string $pCoordinateString e.g. 'A' or '1' or 'A1' - * @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1' - * @throws Exception - */ - public static function absoluteReference($pCoordinateString = 'A1') - { - if (strpos($pCoordinateString,':') === false && strpos($pCoordinateString,',') === false) { - // Create absolute coordinate - if (ctype_digit($pCoordinateString)) { - return '$'.$pCoordinateString; - } elseif (ctype_alpha($pCoordinateString)) { - return '$'.strtoupper($pCoordinateString); - } - return self::absoluteCoordinate($pCoordinateString); - } else { - throw new Exception("Coordinate string should not be a cell range."); - } - } - - /** - * Make string coordinate absolute - * - * @param string $pCoordinateString e.g. 'A1' - * @return string Absolute coordinate e.g. '$A$1' - * @throws Exception - */ - public static function absoluteCoordinate($pCoordinateString = 'A1') - { - if (strpos($pCoordinateString,':') === false && strpos($pCoordinateString,',') === false) { - // Create absolute coordinate - list($column, $row) = PHPExcel_Cell::coordinateFromString($pCoordinateString); - if ($column[0] == '$') $column = substr($column,1); - if ($row[0] == '$') $row = substr($row,1); - return '$' . $column . '$' . $row; - } else { - throw new Exception("Coordinate string should not be a cell range."); - } - } - - /** - * Split range into coordinate strings - * - * @param string $pRange - * @return array Array containg one or more arrays containing one or two coordinate strings - */ - public static function splitRange($pRange = 'A1:A1') - { - $exploded = explode(',', $pRange); - $counter = count($exploded); - for ($i = 0; $i < $counter; ++$i) { - $exploded[$i] = explode(':', $exploded[$i]); - } - return $exploded; - } - - /** - * Build range from coordinate strings - * - * @param array $pRange Array containg one or more arrays containing one or two coordinate strings - * @return string String representation of $pRange - * @throws Exception - */ - public static function buildRange($pRange) - { - // Verify range - if (!is_array($pRange) || count($pRange) == 0 || !is_array($pRange[0])) { - throw new Exception('Range does not contain any information.'); - } - - // Build range - $imploded = array(); - $counter = count($pRange); - for ($i = 0; $i < $counter; ++$i) { - $pRange[$i] = implode(':', $pRange[$i]); - } - $imploded = implode(',', $pRange); - - return $imploded; - } - - /** - * Calculate range boundaries - * - * @param string $pRange Cell range (e.g. A1:A1) - * @return array Range coordinates (Start Cell, End Cell) where Start Cell and End Cell are arrays (Column Number, Row Number) - */ - public static function rangeBoundaries($pRange = 'A1:A1') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - // Extract range - if (strpos($pRange, ':') === false) { - $rangeA = $rangeB = $pRange; - } else { - list($rangeA, $rangeB) = explode(':', $pRange); - } - - // Calculate range outer borders - $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA); - $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB); - - // Translate column into index - $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]); - $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]); - - return array($rangeStart, $rangeEnd); - } - - /** - * Calculate range dimension - * - * @param string $pRange Cell range (e.g. A1:A1) - * @return array Range dimension (width, height) - */ - public static function rangeDimension($pRange = 'A1:A1') - { - // Calculate range outer borders - list($rangeStart,$rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange); - - return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) ); - } - - /** - * Calculate range boundaries - * - * @param string $pRange Cell range (e.g. A1:A1) - * @return array Range boundaries (staring Column, starting Row, Final Column, Final Row) - */ - public static function getRangeBoundaries($pRange = 'A1:A1') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - // Extract range - if (strpos($pRange, ':') === false) { - $rangeA = $rangeB = $pRange; - } else { - list($rangeA, $rangeB) = explode(':', $pRange); - } - - return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)); - } - - /** - * Column index from string - * - * @param string $pString - * @return int Column index (base 1 !!!) - * @throws Exception - */ - public static function columnIndexFromString($pString = 'A') - { - // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord() - // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant - // memory overhead either - static $_columnLookup = array( - 'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13, - 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26, - 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13, - 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26 - ); - - // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString - // for improved performance - if (isset($pString{0})) { - if (!isset($pString{1})) { - return $_columnLookup[$pString]; - } elseif(!isset($pString{2})) { - return $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}]; - } elseif(!isset($pString{3})) { - return $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}]; - } - } - throw new Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty") . "."); - } - - /** - * String from columnindex - * - * @param int $pColumnIndex Column index (base 0 !!!) - * @return string - */ - public static function stringFromColumnIndex($pColumnIndex = 0) - { - // Determine column string - if ($pColumnIndex < 26) { - return chr(65 + $pColumnIndex); - } elseif ($pColumnIndex < 702) { - return chr(64 + ($pColumnIndex / 26)).chr(65 + $pColumnIndex % 26); - } - return chr(64 + (($pColumnIndex - 26) / 676)).chr(65 + ((($pColumnIndex - 26) % 676) / 26)).chr(65 + $pColumnIndex % 26); - } - - /** - * Extract all cell references in range - * - * @param string $pRange Range (e.g. A1 or A1:A10 or A1:A10 A100:A1000) - * @return array Array containing single cell references - */ - public static function extractAllCellReferencesInRange($pRange = 'A1') { - // Returnvalue - $returnValue = array(); - - // Explode spaces - $cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange))); - foreach ($cellBlocks as $cellBlock) { - // Single cell? - if (strpos($cellBlock,':') === false && strpos($cellBlock,',') === false) { - $returnValue[] = $cellBlock; - continue; - } - - // Range... - $ranges = PHPExcel_Cell::splitRange($cellBlock); - foreach($ranges as $range) { - // Single cell? - if (!isset($range[1])) { - $returnValue[] = $range[0]; - continue; - } - - // Range... - list($rangeStart, $rangeEnd) = $range; - list($startCol, $startRow) = sscanf($rangeStart,'%[A-Z]%d'); - list($endCol, $endRow) = sscanf($rangeEnd,'%[A-Z]%d'); - $endCol++; - - // Current data - $currentCol = $startCol; - $currentRow = $startRow; - - // Loop cells - while ($currentCol != $endCol) { - while ($currentRow <= $endRow) { - $returnValue[] = $currentCol.$currentRow; - ++$currentRow; - } - ++$currentCol; - $currentRow = $startRow; - } - } - } - - // Return value - return $returnValue; - } - - /** - * Compare 2 cells - * - * @param PHPExcel_Cell $a Cell a - * @param PHPExcel_Cell $a Cell b - * @return int Result of comparison (always -1 or 1, never zero!) - */ - public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b) - { - if ($a->_row < $b->_row) { - return -1; - } elseif ($a->_row > $b->_row) { - return 1; - } elseif (PHPExcel_Cell::columnIndexFromString($a->_column) < PHPExcel_Cell::columnIndexFromString($b->_column)) { - return -1; - } else { - return 1; - } - } - - /** - * Get value binder to use - * - * @return PHPExcel_Cell_IValueBinder - */ - public static function getValueBinder() { - if (is_null(self::$_valueBinder)) { - self::$_valueBinder = new PHPExcel_Cell_DefaultValueBinder(); - } - - return self::$_valueBinder; - } - - /** - * Set value binder to use - * - * @param PHPExcel_Cell_IValueBinder $binder - * @throws Exception - */ - public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null) { - if (is_null($binder)) { - throw new Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly."); - } - - self::$_valueBinder = $binder; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } - - /** - * Get index to cellXf - * - * @return int - */ - public function getXfIndex() - { - return $this->_xfIndex; - } - - /** - * Set index to cellXf - * - * @param int $pValue - * @return PHPExcel_Cell - */ - public function setXfIndex($pValue = 0) - { - $this->_xfIndex = $pValue; - - return $this->notifyCacheController(); - } - - - public function setFormulaAttributes($pAttributes) - { - $this->_formulaAttributes = $pAttributes; - return $this; - } - - public function getFormulaAttributes() - { - return $this->_formulaAttributes; - } - -} - diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/AdvancedValueBinder.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/AdvancedValueBinder.php deleted file mode 100644 index df959dfa53..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/AdvancedValueBinder.php +++ /dev/null @@ -1,140 +0,0 @@ -setValueExplicit( True, PHPExcel_Cell_DataType::TYPE_BOOL); - return true; - } elseif($value == PHPExcel_Calculation::getFALSE()) { - $cell->setValueExplicit( False, PHPExcel_Cell_DataType::TYPE_BOOL); - return true; - } - - // Check for number in scientific format - if (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) { - $cell->setValueExplicit( (float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC); - return true; - } - - // Check for percentage - if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) { - // Convert value to number - $cell->setValueExplicit( (float)str_replace('%', '', $value) / 100, PHPExcel_Cell_DataType::TYPE_NUMERIC); - // Set style - $cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE ); - return true; - } - - // Check for time without seconds e.g. '9:45', '09:45' - if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) { - list($h, $m) = explode(':', $value); - $days = $h / 24 + $m / 1440; - // Convert value to number - $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC); - // Set style - $cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3 ); - return true; - } - - // Check for time with seconds '9:45:59', '09:45:59' - if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) { - list($h, $m, $s) = explode(':', $value); - $days = $h / 24 + $m / 1440 + $s / 86400; - // Convert value to number - $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC); - // Set style - $cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4 ); - return true; - } - - // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10' - if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) { - // Convert value to number - $cell->setValueExplicit($d, PHPExcel_Cell_DataType::TYPE_NUMERIC); - // Determine style. Either there is a time part or not. Look for ':' - if (strpos($value, ':') !== false) { - $formatCode = 'yyyy-mm-dd h:mm'; - } else { - $formatCode = 'yyyy-mm-dd'; - } - $cell->getParent()->getStyle( $cell->getCoordinate() )->getNumberFormat()->setFormatCode($formatCode); - return true; - } - - // Check for newline character "\n" - if (strpos($value, "\n") !== false) { - $value = PHPExcel_Shared_String::SanitizeUTF8($value); - $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING); - // Set style - $cell->getParent()->getStyle( $cell->getCoordinate() )->getAlignment()->setWrapText(true); - return true; - } - } - - // Not bound yet? Use parent... - return parent::bindValue($cell, $value); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataType.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataType.php deleted file mode 100644 index 3143cded79..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataType.php +++ /dev/null @@ -1,114 +0,0 @@ - 0, '#DIV/0!' => 1, '#VALUE!' => 2, '#REF!' => 3, '#NAME?' => 4, '#NUM!' => 5, '#N/A' => 6); - - /** - * Get list of error codes - * - * @return array - */ - public static function getErrorCodes() { - return self::$_errorCodes; - } - - /** - * DataType for value - * - * @deprecated Replaced by PHPExcel_Cell_IValueBinder infrastructure - * @param mixed $pValue - * @return int - */ - public static function dataTypeForValue($pValue = null) { - return PHPExcel_Cell_DefaultValueBinder::dataTypeForValue($pValue); - } - - /** - * Check a string that it satisfies Excel requirements - * - * @param mixed Value to sanitize to an Excel string - * @return mixed Sanitized value - */ - public static function checkString($pValue = null) - { - if ($pValue instanceof PHPExcel_RichText) { - // TODO: Sanitize Rich-Text string (max. character count is 32,767) - return $pValue; - } - - // string must never be longer than 32,767 characters, truncate if necessary - $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767); - - // we require that newline is represented as "\n" in core, not as "\r\n" or "\r" - $pValue = str_replace(array("\r\n", "\r"), "\n", $pValue); - - return $pValue; - } - - /** - * Check a value that it is a valid error code - * - * @param mixed Value to sanitize to an Excel error code - * @return string Sanitized value - */ - public static function checkErrorCode($pValue = null) - { - $pValue = (string)$pValue; - - if ( !array_key_exists($pValue, self::$_errorCodes) ) { - $pValue = '#NULL!'; - } - - return $pValue; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataValidation.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataValidation.php deleted file mode 100644 index 950c47709e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DataValidation.php +++ /dev/null @@ -1,474 +0,0 @@ -_formula1 = ''; - $this->_formula2 = ''; - $this->_type = PHPExcel_Cell_DataValidation::TYPE_NONE; - $this->_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP; - $this->_operator = ''; - $this->_allowBlank = false; - $this->_showDropDown = false; - $this->_showInputMessage = false; - $this->_showErrorMessage = false; - $this->_errorTitle = ''; - $this->_error = ''; - $this->_promptTitle = ''; - $this->_prompt = ''; - } - - /** - * Get Formula 1 - * - * @return string - */ - public function getFormula1() { - return $this->_formula1; - } - - /** - * Set Formula 1 - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setFormula1($value = '') { - $this->_formula1 = $value; - return $this; - } - - /** - * Get Formula 2 - * - * @return string - */ - public function getFormula2() { - return $this->_formula2; - } - - /** - * Set Formula 2 - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setFormula2($value = '') { - $this->_formula2 = $value; - return $this; - } - - /** - * Get Type - * - * @return string - */ - public function getType() { - return $this->_type; - } - - /** - * Set Type - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE) { - $this->_type = $value; - return $this; - } - - /** - * Get Error style - * - * @return string - */ - public function getErrorStyle() { - return $this->_errorStyle; - } - - /** - * Set Error style - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP) { - $this->_errorStyle = $value; - return $this; - } - - /** - * Get Operator - * - * @return string - */ - public function getOperator() { - return $this->_operator; - } - - /** - * Set Operator - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setOperator($value = '') { - $this->_operator = $value; - return $this; - } - - /** - * Get Allow Blank - * - * @return boolean - */ - public function getAllowBlank() { - return $this->_allowBlank; - } - - /** - * Set Allow Blank - * - * @param boolean $value - * @return PHPExcel_Cell_DataValidation - */ - public function setAllowBlank($value = false) { - $this->_allowBlank = $value; - return $this; - } - - /** - * Get Show DropDown - * - * @return boolean - */ - public function getShowDropDown() { - return $this->_showDropDown; - } - - /** - * Set Show DropDown - * - * @param boolean $value - * @return PHPExcel_Cell_DataValidation - */ - public function setShowDropDown($value = false) { - $this->_showDropDown = $value; - return $this; - } - - /** - * Get Show InputMessage - * - * @return boolean - */ - public function getShowInputMessage() { - return $this->_showInputMessage; - } - - /** - * Set Show InputMessage - * - * @param boolean $value - * @return PHPExcel_Cell_DataValidation - */ - public function setShowInputMessage($value = false) { - $this->_showInputMessage = $value; - return $this; - } - - /** - * Get Show ErrorMessage - * - * @return boolean - */ - public function getShowErrorMessage() { - return $this->_showErrorMessage; - } - - /** - * Set Show ErrorMessage - * - * @param boolean $value - * @return PHPExcel_Cell_DataValidation - */ - public function setShowErrorMessage($value = false) { - $this->_showErrorMessage = $value; - return $this; - } - - /** - * Get Error title - * - * @return string - */ - public function getErrorTitle() { - return $this->_errorTitle; - } - - /** - * Set Error title - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setErrorTitle($value = '') { - $this->_errorTitle = $value; - return $this; - } - - /** - * Get Error - * - * @return string - */ - public function getError() { - return $this->_error; - } - - /** - * Set Error - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setError($value = '') { - $this->_error = $value; - return $this; - } - - /** - * Get Prompt title - * - * @return string - */ - public function getPromptTitle() { - return $this->_promptTitle; - } - - /** - * Set Prompt title - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setPromptTitle($value = '') { - $this->_promptTitle = $value; - return $this; - } - - /** - * Get Prompt - * - * @return string - */ - public function getPrompt() { - return $this->_prompt; - } - - /** - * Set Prompt - * - * @param string $value - * @return PHPExcel_Cell_DataValidation - */ - public function setPrompt($value = '') { - $this->_prompt = $value; - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_formula1 - . $this->_formula2 - . $this->_type = PHPExcel_Cell_DataValidation::TYPE_NONE - . $this->_errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP - . $this->_operator - . ($this->_allowBlank ? 't' : 'f') - . ($this->_showDropDown ? 't' : 'f') - . ($this->_showInputMessage ? 't' : 'f') - . ($this->_showErrorMessage ? 't' : 'f') - . $this->_errorTitle - . $this->_error - . $this->_promptTitle - . $this->_prompt - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DefaultValueBinder.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DefaultValueBinder.php deleted file mode 100644 index 07134633f0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/DefaultValueBinder.php +++ /dev/null @@ -1,106 +0,0 @@ -setValueExplicit( $value, PHPExcel_Cell_DataType::dataTypeForValue($value) ); - - // Done! - return true; - } - - /** - * DataType for value - * - * @param mixed $pValue - * @return int - */ - public static function dataTypeForValue($pValue = null) { - // Match the value against a few data types - if (is_null($pValue)) { - return PHPExcel_Cell_DataType::TYPE_NULL; - - } elseif ($pValue === '') { - return PHPExcel_Cell_DataType::TYPE_STRING; - - } elseif ($pValue instanceof PHPExcel_RichText) { - return PHPExcel_Cell_DataType::TYPE_STRING; - - } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { - return PHPExcel_Cell_DataType::TYPE_FORMULA; - - } elseif (is_bool($pValue)) { - return PHPExcel_Cell_DataType::TYPE_BOOL; - - } elseif (is_float($pValue) || is_int($pValue)) { - return PHPExcel_Cell_DataType::TYPE_NUMERIC; - - } elseif (preg_match('/^\-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)$/', $pValue)) { - return PHPExcel_Cell_DataType::TYPE_NUMERIC; - - } elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) { - return PHPExcel_Cell_DataType::TYPE_ERROR; - - } else { - return PHPExcel_Cell_DataType::TYPE_STRING; - - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/Hyperlink.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/Hyperlink.php deleted file mode 100644 index dba5e776b0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/Hyperlink.php +++ /dev/null @@ -1,127 +0,0 @@ -_url = $pUrl; - $this->_tooltip = $pTooltip; - } - - /** - * Get URL - * - * @return string - */ - public function getUrl() { - return $this->_url; - } - - /** - * Set URL - * - * @param string $value - * @return PHPExcel_Cell_Hyperlink - */ - public function setUrl($value = '') { - $this->_url = $value; - return $this; - } - - /** - * Get tooltip - * - * @return string - */ - public function getTooltip() { - return $this->_tooltip; - } - - /** - * Set tooltip - * - * @param string $value - * @return PHPExcel_Cell_Hyperlink - */ - public function setTooltip($value = '') { - $this->_tooltip = $value; - return $this; - } - - /** - * Is this hyperlink internal? (to another sheet) - * - * @return boolean - */ - public function isInternal() { - return strpos($this->_url, 'sheet://') !== false; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_url - . $this->_tooltip - . __CLASS__ - ); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/IValueBinder.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/IValueBinder.php deleted file mode 100644 index b175705a50..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Cell/IValueBinder.php +++ /dev/null @@ -1,46 +0,0 @@ -_author = 'Author'; - $this->_text = new PHPExcel_RichText(); - $this->_fillColor = new PHPExcel_Style_Color('FFFFFFE1'); - $this->_alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; - } - - /** - * Get Author - * - * @return string - */ - public function getAuthor() { - return $this->_author; - } - - /** - * Set Author - * - * @param string $pValue - * @return PHPExcel_Comment - */ - public function setAuthor($pValue = '') { - $this->_author = $pValue; - return $this; - } - - /** - * Get Rich text comment - * - * @return PHPExcel_RichText - */ - public function getText() { - return $this->_text; - } - - /** - * Set Rich text comment - * - * @param PHPExcel_RichText $pValue - * @return PHPExcel_Comment - */ - public function setText(PHPExcel_RichText $pValue) { - $this->_text = $pValue; - return $this; - } - - /** - * Get comment width (CSS style, i.e. XXpx or YYpt) - * - * @return string - */ - public function getWidth() { - return $this->_width; - } - - /** - * Set comment width (CSS style, i.e. XXpx or YYpt) - * - * @param string $value - * @return PHPExcel_Comment - */ - public function setWidth($value = '96pt') { - $this->_width = $value; - return $this; - } - - /** - * Get comment height (CSS style, i.e. XXpx or YYpt) - * - * @return string - */ - public function getHeight() { - return $this->_height; - } - - /** - * Set comment height (CSS style, i.e. XXpx or YYpt) - * - * @param string $value - * @return PHPExcel_Comment - */ - public function setHeight($value = '55.5pt') { - $this->_height = $value; - return $this; - } - - /** - * Get left margin (CSS style, i.e. XXpx or YYpt) - * - * @return string - */ - public function getMarginLeft() { - return $this->_marginLeft; - } - - /** - * Set left margin (CSS style, i.e. XXpx or YYpt) - * - * @param string $value - * @return PHPExcel_Comment - */ - public function setMarginLeft($value = '59.25pt') { - $this->_marginLeft = $value; - return $this; - } - - /** - * Get top margin (CSS style, i.e. XXpx or YYpt) - * - * @return string - */ - public function getMarginTop() { - return $this->_marginTop; - } - - /** - * Set top margin (CSS style, i.e. XXpx or YYpt) - * - * @param string $value - * @return PHPExcel_Comment - */ - public function setMarginTop($value = '1.5pt') { - $this->_marginTop = $value; - return $this; - } - - /** - * Is the comment visible by default? - * - * @return boolean - */ - public function getVisible() { - return $this->_visible; - } - - /** - * Set comment default visibility - * - * @param boolean $value - * @return PHPExcel_Comment - */ - public function setVisible($value = false) { - $this->_visible = $value; - return $this; - } - - /** - * Get fill color - * - * @return PHPExcel_Style_Color - */ - public function getFillColor() { - return $this->_fillColor; - } - - /** - * Set Alignment - * - * @param string $pValue - * @return PHPExcel_Comment - */ - public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) { - $this->_alignment = $pValue; - return $this; - } - - /** - * Get Alignment - * - * @return string - */ - public function getAlignment() { - return $this->_alignment; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_author - . $this->_text->getHashCode() - . $this->_width - . $this->_height - . $this->_marginLeft - . $this->_marginTop - . ($this->_visible ? 1 : 0) - . $this->_fillColor->getHashCode() - . $this->_alignment - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentProperties.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentProperties.php deleted file mode 100644 index e1bd0ba0dc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentProperties.php +++ /dev/null @@ -1,588 +0,0 @@ -_lastModifiedBy = $this->_creator; - $this->_created = time(); - $this->_modified = time(); - } - - /** - * Get Creator - * - * @return string - */ - public function getCreator() { - return $this->_creator; - } - - /** - * Set Creator - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setCreator($pValue = '') { - $this->_creator = $pValue; - return $this; - } - - /** - * Get Last Modified By - * - * @return string - */ - public function getLastModifiedBy() { - return $this->_lastModifiedBy; - } - - /** - * Set Last Modified By - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setLastModifiedBy($pValue = '') { - $this->_lastModifiedBy = $pValue; - return $this; - } - - /** - * Get Created - * - * @return datetime - */ - public function getCreated() { - return $this->_created; - } - - /** - * Set Created - * - * @param datetime $pValue - * @return PHPExcel_DocumentProperties - */ - public function setCreated($pValue = null) { - if (is_null($pValue)) { - $pValue = time(); - } elseif (is_string($pValue)) { - if (is_numeric($pValue)) { - $pValue = intval($pValue); - } else { - $pValue = strtotime($pValue); - } - } - - $this->_created = $pValue; - return $this; - } - - /** - * Get Modified - * - * @return datetime - */ - public function getModified() { - return $this->_modified; - } - - /** - * Set Modified - * - * @param datetime $pValue - * @return PHPExcel_DocumentProperties - */ - public function setModified($pValue = null) { - if (is_null($pValue)) { - $pValue = time(); - } elseif (is_string($pValue)) { - if (is_numeric($pValue)) { - $pValue = intval($pValue); - } else { - $pValue = strtotime($pValue); - } - } - - $this->_modified = $pValue; - return $this; - } - - /** - * Get Title - * - * @return string - */ - public function getTitle() { - return $this->_title; - } - - /** - * Set Title - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setTitle($pValue = '') { - $this->_title = $pValue; - return $this; - } - - /** - * Get Description - * - * @return string - */ - public function getDescription() { - return $this->_description; - } - - /** - * Set Description - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setDescription($pValue = '') { - $this->_description = $pValue; - return $this; - } - - /** - * Get Subject - * - * @return string - */ - public function getSubject() { - return $this->_subject; - } - - /** - * Set Subject - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setSubject($pValue = '') { - $this->_subject = $pValue; - return $this; - } - - /** - * Get Keywords - * - * @return string - */ - public function getKeywords() { - return $this->_keywords; - } - - /** - * Set Keywords - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setKeywords($pValue = '') { - $this->_keywords = $pValue; - return $this; - } - - /** - * Get Category - * - * @return string - */ - public function getCategory() { - return $this->_category; - } - - /** - * Set Category - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setCategory($pValue = '') { - $this->_category = $pValue; - return $this; - } - - /** - * Get Company - * - * @return string - */ - public function getCompany() { - return $this->_company; - } - - /** - * Set Company - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setCompany($pValue = '') { - $this->_company = $pValue; - return $this; - } - - /** - * Get Manager - * - * @return string - */ - public function getManager() { - return $this->_manager; - } - - /** - * Set Manager - * - * @param string $pValue - * @return PHPExcel_DocumentProperties - */ - public function setManager($pValue = '') { - $this->_manager = $pValue; - return $this; - } - - /** - * Get a List of Custom Property Names - * - * @return array of string - */ - public function getCustomProperties() { - return array_keys($this->_customProperties); - } - - /** - * Check if a Custom Property is defined - * - * @param string $propertyName - * @return boolean - */ - public function isCustomPropertySet($propertyName) { - return isset($this->_customProperties[$propertyName]); - } - - /** - * Get a Custom Property Value - * - * @param string $propertyName - * @return string - */ - public function getCustomPropertyValue($propertyName) { - if (isset($this->_customProperties[$propertyName])) { - return $this->_customProperties[$propertyName]['value']; - } - - } - - /** - * Get a Custom Property Type - * - * @param string $propertyName - * @return string - */ - public function getCustomPropertyType($propertyName) { - if (isset($this->_customProperties[$propertyName])) { - return $this->_customProperties[$propertyName]['type']; - } - - } - - /** - * Set a Custom Property - * - * @param string $propertyName - * @param mixed $propertyValue - * @param string $propertyType - * 'i' : Integer - * 'f' : Floating Point - * 's' : String - * 'd' : Date/Time - * 'b' : Boolean - * @return PHPExcel_DocumentProperties - */ - public function setCustomProperty($propertyName,$propertyValue='',$propertyType=NULL) { - if ((is_null($propertyType)) || (!in_array($propertyType,array(self::PROPERTY_TYPE_INTEGER, - self::PROPERTY_TYPE_FLOAT, - self::PROPERTY_TYPE_STRING, - self::PROPERTY_TYPE_DATE, - self::PROPERTY_TYPE_BOOLEAN)))) { - if (is_null($propertyValue)) { - $propertyType = self::PROPERTY_TYPE_STRING; - } elseif (is_float($propertyValue)) { - $propertyType = self::PROPERTY_TYPE_FLOAT; - } elseif(is_int($propertyValue)) { - $propertyType = self::PROPERTY_TYPE_INTEGER; - } elseif (is_bool($propertyValue)) { - $propertyType = self::PROPERTY_TYPE_BOOLEAN; - } else { - $propertyType = self::PROPERTY_TYPE_STRING; - } - } - - $this->_customProperties[$propertyName] = array('value' => $propertyValue, 'type' => $propertyType); - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } - - public static function convertProperty($propertyValue,$propertyType) { - switch ($propertyType) { - case 'empty' : // Empty - return ''; - break; - case 'null' : // Null - return NULL; - break; - case 'i1' : // 1-Byte Signed Integer - case 'i2' : // 2-Byte Signed Integer - case 'i4' : // 4-Byte Signed Integer - case 'i8' : // 8-Byte Signed Integer - case 'int' : // Integer - return (int) $propertyValue; - break; - case 'ui1' : // 1-Byte Unsigned Integer - case 'ui2' : // 2-Byte Unsigned Integer - case 'ui4' : // 4-Byte Unsigned Integer - case 'ui8' : // 8-Byte Unsigned Integer - case 'uint' : // Unsigned Integer - return abs((int) $propertyValue); - break; - case 'r4' : // 4-Byte Real Number - case 'r8' : // 8-Byte Real Number - case 'decimal' : // Decimal - return (float) $propertyValue; - break; - case 'lpstr' : // LPSTR - case 'lpwstr' : // LPWSTR - case 'bstr' : // Basic String - return $propertyValue; - break; - case 'date' : // Date and Time - case 'filetime' : // File Time - return strtotime($propertyValue); - break; - case 'bool' : // Boolean - return ($propertyValue == 'true') ? True : False; - break; - case 'cy' : // Currency - case 'error' : // Error Status Code - case 'vector' : // Vector - case 'array' : // Array - case 'blob' : // Binary Blob - case 'oblob' : // Binary Blob Object - case 'stream' : // Binary Stream - case 'ostream' : // Binary Stream Object - case 'storage' : // Binary Storage - case 'ostorage' : // Binary Storage Object - case 'vstream' : // Binary Versioned Stream - case 'clsid' : // Class ID - case 'cf' : // Clipboard Data - return $propertyValue; - break; - } - return $propertyValue; - } - - public static function convertPropertyType($propertyType) { - switch ($propertyType) { - case 'i1' : // 1-Byte Signed Integer - case 'i2' : // 2-Byte Signed Integer - case 'i4' : // 4-Byte Signed Integer - case 'i8' : // 8-Byte Signed Integer - case 'int' : // Integer - case 'ui1' : // 1-Byte Unsigned Integer - case 'ui2' : // 2-Byte Unsigned Integer - case 'ui4' : // 4-Byte Unsigned Integer - case 'ui8' : // 8-Byte Unsigned Integer - case 'uint' : // Unsigned Integer - return self::PROPERTY_TYPE_INTEGER; - break; - case 'r4' : // 4-Byte Real Number - case 'r8' : // 8-Byte Real Number - case 'decimal' : // Decimal - return self::PROPERTY_TYPE_FLOAT; - break; - case 'empty' : // Empty - case 'null' : // Null - case 'lpstr' : // LPSTR - case 'lpwstr' : // LPWSTR - case 'bstr' : // Basic String - return self::PROPERTY_TYPE_STRING; - break; - case 'date' : // Date and Time - case 'filetime' : // File Time - return self::PROPERTY_TYPE_DATE; - break; - case 'bool' : // Boolean - return self::PROPERTY_TYPE_BOOLEAN; - break; - case 'cy' : // Currency - case 'error' : // Error Status Code - case 'vector' : // Vector - case 'array' : // Array - case 'blob' : // Binary Blob - case 'oblob' : // Binary Blob Object - case 'stream' : // Binary Stream - case 'ostream' : // Binary Stream Object - case 'storage' : // Binary Storage - case 'ostorage' : // Binary Storage Object - case 'vstream' : // Binary Versioned Stream - case 'clsid' : // Class ID - case 'cf' : // Clipboard Data - return self::PROPERTY_TYPE_UNKNOWN; - break; - } - return self::PROPERTY_TYPE_UNKNOWN; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentSecurity.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentSecurity.php deleted file mode 100644 index f10902487e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/DocumentSecurity.php +++ /dev/null @@ -1,218 +0,0 @@ -_lockRevision = false; - $this->_lockStructure = false; - $this->_lockWindows = false; - $this->_revisionsPassword = ''; - $this->_workbookPassword = ''; - } - - /** - * Is some sort of dcument security enabled? - * - * @return boolean - */ - function isSecurityEnabled() { - return $this->_lockRevision || - $this->_lockStructure || - $this->_lockWindows; - } - - /** - * Get LockRevision - * - * @return boolean - */ - function getLockRevision() { - return $this->_lockRevision; - } - - /** - * Set LockRevision - * - * @param boolean $pValue - * @return PHPExcel_DocumentSecurity - */ - function setLockRevision($pValue = false) { - $this->_lockRevision = $pValue; - return $this; - } - - /** - * Get LockStructure - * - * @return boolean - */ - function getLockStructure() { - return $this->_lockStructure; - } - - /** - * Set LockStructure - * - * @param boolean $pValue - * @return PHPExcel_DocumentSecurity - */ - function setLockStructure($pValue = false) { - $this->_lockStructure = $pValue; - return $this; - } - - /** - * Get LockWindows - * - * @return boolean - */ - function getLockWindows() { - return $this->_lockWindows; - } - - /** - * Set LockWindows - * - * @param boolean $pValue - * @return PHPExcel_DocumentSecurity - */ - function setLockWindows($pValue = false) { - $this->_lockWindows = $pValue; - return $this; - } - - /** - * Get RevisionsPassword (hashed) - * - * @return string - */ - function getRevisionsPassword() { - return $this->_revisionsPassword; - } - - /** - * Set RevisionsPassword - * - * @param string $pValue - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @return PHPExcel_DocumentSecurity - */ - function setRevisionsPassword($pValue = '', $pAlreadyHashed = false) { - if (!$pAlreadyHashed) { - $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); - } - $this->_revisionsPassword = $pValue; - return $this; - } - - /** - * Get WorkbookPassword (hashed) - * - * @return string - */ - function getWorkbookPassword() { - return $this->_workbookPassword; - } - - /** - * Set WorkbookPassword - * - * @param string $pValue - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @return PHPExcel_DocumentSecurity - */ - function setWorkbookPassword($pValue = '', $pAlreadyHashed = false) { - if (!$pAlreadyHashed) { - $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); - } - $this->_workbookPassword = $pValue; - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/HashTable.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/HashTable.php deleted file mode 100644 index 8ca647e8b9..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/HashTable.php +++ /dev/null @@ -1,202 +0,0 @@ -addFromSource($pSource); - } - } - - /** - * Add HashTable items from source - * - * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from - * @throws Exception - */ - public function addFromSource($pSource = null) { - // Check if an array was passed - if ($pSource == null) { - return; - } else if (!is_array($pSource)) { - throw new Exception('Invalid array parameter passed.'); - } - - foreach ($pSource as $item) { - $this->add($item); - } - } - - /** - * Add HashTable item - * - * @param PHPExcel_IComparable $pSource Item to add - * @throws Exception - */ - public function add(PHPExcel_IComparable $pSource = null) { - $hash = $pSource->getHashCode(); - if (!isset($this->_items[$hash])) { - $this->_items[$hash] = $pSource; - $this->_keyMap[count($this->_items) - 1] = $hash; - } - } - - /** - * Remove HashTable item - * - * @param PHPExcel_IComparable $pSource Item to remove - * @throws Exception - */ - public function remove(PHPExcel_IComparable $pSource = null) { - $hash = $pSource->getHashCode(); - if (isset($this->_items[$hash])) { - unset($this->_items[$hash]); - - $deleteKey = -1; - foreach ($this->_keyMap as $key => $value) { - if ($deleteKey >= 0) { - $this->_keyMap[$key - 1] = $value; - } - - if ($value == $hash) { - $deleteKey = $key; - } - } - unset($this->_keyMap[count($this->_keyMap) - 1]); - } - } - - /** - * Clear HashTable - * - */ - public function clear() { - $this->_items = array(); - $this->_keyMap = array(); - } - - /** - * Count - * - * @return int - */ - public function count() { - return count($this->_items); - } - - /** - * Get index for hash code - * - * @param string $pHashCode - * @return int Index - */ - public function getIndexForHashCode($pHashCode = '') { - return array_search($pHashCode, $this->_keyMap); - } - - /** - * Get by index - * - * @param int $pIndex - * @return PHPExcel_IComparable - * - */ - public function getByIndex($pIndex = 0) { - if (isset($this->_keyMap[$pIndex])) { - return $this->getByHashCode( $this->_keyMap[$pIndex] ); - } - - return null; - } - - /** - * Get by hashcode - * - * @param string $pHashCode - * @return PHPExcel_IComparable - * - */ - public function getByHashCode($pHashCode = '') { - if (isset($this->_items[$pHashCode])) { - return $this->_items[$pHashCode]; - } - - return null; - } - - /** - * HashTable to array - * - * @return PHPExcel_IComparable[] - */ - public function toArray() { - return $this->_items; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/IComparable.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/IComparable.php deleted file mode 100644 index 777c1cd90e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/IComparable.php +++ /dev/null @@ -1,43 +0,0 @@ - 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ), - array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' ) - ); - - /** - * Autoresolve classes - * - * @var array - * @access private - * @static - */ - private static $_autoResolveClasses = array( - 'Excel2007', - 'Excel5', - 'Excel2003XML', - 'OOCalc', - 'SYLK', - 'Gnumeric', - 'CSV', - ); - - /** - * Private constructor for PHPExcel_IOFactory - */ - private function __construct() { } - - /** - * Get search locations - * - * @static - * @access public - * @return array - */ - public static function getSearchLocations() { - return self::$_searchLocations; - } // function getSearchLocations() - - /** - * Set search locations - * - * @static - * @access public - * @param array $value - * @throws Exception - */ - public static function setSearchLocations($value) { - if (is_array($value)) { - self::$_searchLocations = $value; - } else { - throw new Exception('Invalid parameter passed.'); - } - } // function setSearchLocations() - - /** - * Add search location - * - * @static - * @access public - * @param string $type Example: IWriter - * @param string $location Example: PHPExcel/Writer/{0}.php - * @param string $classname Example: PHPExcel_Writer_{0} - */ - public static function addSearchLocation($type = '', $location = '', $classname = '') { - self::$_searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname ); - } // function addSearchLocation() - - /** - * Create PHPExcel_Writer_IWriter - * - * @static - * @access public - * @param PHPExcel $phpExcel - * @param string $writerType Example: Excel2007 - * @return PHPExcel_Writer_IWriter - * @throws Exception - */ - public static function createWriter(PHPExcel $phpExcel, $writerType = '') { - // Search type - $searchType = 'IWriter'; - - // Include class - foreach (self::$_searchLocations as $searchLocation) { - if ($searchLocation['type'] == $searchType) { - $className = str_replace('{0}', $writerType, $searchLocation['class']); - $classFile = str_replace('{0}', $writerType, $searchLocation['path']); - - $instance = new $className($phpExcel); - if (!is_null($instance)) { - return $instance; - } - } - } - - // Nothing found... - throw new Exception("No $searchType found for type $writerType"); - } // function createWriter() - - /** - * Create PHPExcel_Reader_IReader - * - * @static - * @access public - * @param string $readerType Example: Excel2007 - * @return PHPExcel_Reader_IReader - * @throws Exception - */ - public static function createReader($readerType = '') { - // Search type - $searchType = 'IReader'; - - // Include class - foreach (self::$_searchLocations as $searchLocation) { - if ($searchLocation['type'] == $searchType) { - $className = str_replace('{0}', $readerType, $searchLocation['class']); - $classFile = str_replace('{0}', $readerType, $searchLocation['path']); - - $instance = new $className(); - if (!is_null($instance)) { - return $instance; - } - } - } - - // Nothing found... - throw new Exception("No $searchType found for type $readerType"); - } // function createReader() - - /** - * Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution - * - * @static - * @access public - * @param string $pFileName - * @return PHPExcel - * @throws Exception - */ - public static function load($pFilename) { - $reader = self::createReaderForFile($pFilename); - return $reader->load($pFilename); - } // function load() - - /** - * Identify file type using automatic PHPExcel_Reader_IReader resolution - * - * @static - * @access public - * @param string $pFileName - * @return string - * @throws Exception - */ - public static function identify($pFilename) { - $reader = self::createReaderForFile($pFilename); - $className = get_class($reader); - $classType = explode('_',$className); - unset($reader); - return array_pop($classType); - } // function identify() - - /** - * Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution - * - * @static - * @access public - * @param string $pFileName - * @return PHPExcel_Reader_IReader - * @throws Exception - */ - public static function createReaderForFile($pFilename) { - - // First, lucky guess by inspecting file extension - $pathinfo = pathinfo($pFilename); - - if (isset($pathinfo['extension'])) { - switch (strtolower($pathinfo['extension'])) { - case 'xlsx': - $reader = self::createReader('Excel2007'); - break; - case 'xls': - $reader = self::createReader('Excel5'); - break; - case 'ods': - $reader = self::createReader('OOCalc'); - break; - case 'slk': - $reader = self::createReader('SYLK'); - break; - case 'xml': - $reader = self::createReader('Excel2003XML'); - break; - case 'gnumeric': - $reader = self::createReader('Gnumeric'); - break; - case 'csv': - // Do nothing - // We must not try to use CSV reader since it loads - // all files including Excel files etc. - break; - default: - break; - } - - // Let's see if we are lucky - if (isset($reader) && $reader->canRead($pFilename)) { - return $reader; - } - - } - - // If we reach here then "lucky guess" didn't give any result - - // Try loading using self::$_autoResolveClasses - foreach (self::$_autoResolveClasses as $autoResolveClass) { - $reader = self::createReader($autoResolveClass); - if ($reader->canRead($pFilename)) { - return $reader; - } - } - - } // function createReaderForFile() -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/NamedRange.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/NamedRange.php deleted file mode 100644 index 9afb0f9b40..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/NamedRange.php +++ /dev/null @@ -1,245 +0,0 @@ -_worksheet) - * - * @var bool - */ - private $_localOnly; - - /** - * Scope - * - * @var PHPExcel_Worksheet - */ - private $_scope; - - /** - * Create a new NamedRange - * - * @param string $pName - * @param PHPExcel_Worksheet $pWorksheet - * @param string $pRange - * @param bool $pLocalOnly - * @param PHPExcel_Worksheet|null $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope. - */ - public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null) - { - // Validate data - if (is_null($pName) || is_null($pWorksheet)|| is_null($pRange)) { - throw new Exception('Parameters can not be null.'); - } - - // Set local members - $this->_name = $pName; - $this->_worksheet = $pWorksheet; - $this->_range = $pRange; - $this->_localOnly = $pLocalOnly; - $this->_scope = ($pLocalOnly == true) ? - (($pScope == null) ? $pWorksheet : $pScope) : null; - } - - /** - * Get name - * - * @return string - */ - public function getName() { - return $this->_name; - } - - /** - * Set name - * - * @param string $value - * @return PHPExcel_NamedRange - */ - public function setName($value = null) { - if (!is_null($value)) { - // Old title - $oldTitle = $this->_name; - - // Re-attach - if (!is_null($this->_worksheet)) { - $this->_worksheet->getParent()->removeNamedRange($this->_name,$this->_worksheet); - } - $this->_name = $value; - - if (!is_null($this->_worksheet)) { - $this->_worksheet->getParent()->addNamedRange($this); - } - - // New title - $newTitle = $this->_name; - PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->_worksheet->getParent(), $oldTitle, $newTitle); - } - return $this; - } - - /** - * Get worksheet - * - * @return PHPExcel_Worksheet - */ - public function getWorksheet() { - return $this->_worksheet; - } - - /** - * Set worksheet - * - * @param PHPExcel_Worksheet $value - * @return PHPExcel_NamedRange - */ - public function setWorksheet(PHPExcel_Worksheet $value = null) { - if (!is_null($value)) { - $this->_worksheet = $value; - } - return $this; - } - - /** - * Get range - * - * @return string - */ - public function getRange() { - return $this->_range; - } - - /** - * Set range - * - * @param string $value - * @return PHPExcel_NamedRange - */ - public function setRange($value = null) { - if (!is_null($value)) { - $this->_range = $value; - } - return $this; - } - - /** - * Get localOnly - * - * @return bool - */ - public function getLocalOnly() { - return $this->_localOnly; - } - - /** - * Set localOnly - * - * @param bool $value - * @return PHPExcel_NamedRange - */ - public function setLocalOnly($value = false) { - $this->_localOnly = $value; - $this->_scope = $value ? $this->_worksheet : null; - return $this; - } - - /** - * Get scope - * - * @return PHPExcel_Worksheet|null - */ - public function getScope() { - return $this->_scope; - } - - /** - * Set scope - * - * @param PHPExcel_Worksheet|null $value - * @return PHPExcel_NamedRange - */ - public function setScope(PHPExcel_Worksheet $value = null) { - $this->_scope = $value; - $this->_localOnly = ($value == null) ? false : true; - return $this; - } - - /** - * Resolve a named range to a regular cell range - * - * @param string $pNamedRange Named range - * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope - * @return PHPExcel_NamedRange - */ - public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet) { - return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/CSV.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/CSV.php deleted file mode 100644 index 3bac3af0f2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/CSV.php +++ /dev/null @@ -1,411 +0,0 @@ -_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - } // function __construct() - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @access public - * @param string $pFileName - * @return boolean - * @throws Exception - */ - public function canRead($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - return true; - } // function canRead() - - /** - * Loads PHPExcel from file - * - * @access public - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - - // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); - } // function load() - - /** - * Read filter - * - * @access public - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } // function getReadFilter() - - /** - * Set read filter - * - * @access public - * @param PHPExcel_Reader_IReadFilter $pValue - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } // function setReadFilter() - - /** - * Set input encoding - * - * @access public - * @param string $pValue Input encoding - */ - public function setInputEncoding($pValue = 'UTF-8') - { - $this->_inputEncoding = $pValue; - return $this; - } // function setInputEncoding() - - /** - * Get input encoding - * - * @access public - * @return string - */ - public function getInputEncoding() - { - return $this->_inputEncoding; - } // function getInputEncoding() - - /** - * Loads PHPExcel from file into PHPExcel instance - * - * @access public - * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception - */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Create new PHPExcel - while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { - $objPHPExcel->createSheet(); - } - $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex ); - - // Open file - $fileHandle = fopen($pFilename, 'r'); - if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for reading."); - } - - // Skip BOM, if any - switch ($this->_inputEncoding) { - case 'UTF-8': - fgets($fileHandle, 4) == "\xEF\xBB\xBF" ? - fseek($fileHandle, 3) : fseek($fileHandle, 0); - break; - case 'UTF-16LE': - fgets($fileHandle, 3) == "\xFF\xFE" ? - fseek($fileHandle, 2) : fseek($fileHandle, 0); - break; - case 'UTF-16BE': - fgets($fileHandle, 3) == "\xFE\xFF" ? - fseek($fileHandle, 2) : fseek($fileHandle, 0); - break; - case 'UTF-32LE': - fgets($fileHandle, 5) == "\xFF\xFE\x00\x00" ? - fseek($fileHandle, 4) : fseek($fileHandle, 0); - break; - case 'UTF-32BE': - fgets($fileHandle, 5) == "\x00\x00\xFE\xFF" ? - fseek($fileHandle, 4) : fseek($fileHandle, 0); - break; - default: - break; - } - - $escapeEnclosures = array( "\\" . $this->_enclosure, - $this->_enclosure . $this->_enclosure - ); - - // Set our starting row based on whether we're in contiguous mode or not - $currentRow = 1; - if ($this->_contiguous) { - $currentRow = ($this->_contiguousRow == -1) ? $objPHPExcel->getActiveSheet()->getHighestRow(): $this->_contiguousRow; - } - - // Loop through each line of the file in turn - while (($rowData = fgetcsv($fileHandle, 0, $this->_delimiter, $this->_enclosure)) !== FALSE) { - $columnLetter = 'A'; - foreach($rowData as $rowDatum) { - if ($rowDatum != '' && $this->_readFilter->readCell($columnLetter, $currentRow)) { - // Unescape enclosures - $rowDatum = str_replace($escapeEnclosures, $this->_enclosure, $rowDatum); - - // Convert encoding if necessary - if ($this->_inputEncoding !== 'UTF-8') { - $rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->_inputEncoding); - } - - // Set cell value - $objPHPExcel->getActiveSheet()->getCell($columnLetter . $currentRow)->setValue($rowDatum); - } - ++$columnLetter; - } - ++$currentRow; - } - - // Close file - fclose($fileHandle); - - if ($this->_contiguous) { - $this->_contiguousRow = $currentRow; - } - - // Return - return $objPHPExcel; - } // function loadIntoExisting() - - /** - * Get delimiter - * - * @access public - * @return string - */ - public function getDelimiter() { - return $this->_delimiter; - } // function getDelimiter() - - /** - * Set delimiter - * - * @access public - * @param string $pValue Delimiter, defaults to , - * @return PHPExcel_Reader_CSV - */ - public function setDelimiter($pValue = ',') { - $this->_delimiter = $pValue; - return $this; - } // function setDelimiter() - - /** - * Get enclosure - * - * @access public - * @return string - */ - public function getEnclosure() { - return $this->_enclosure; - } // function getEnclosure() - - /** - * Set enclosure - * - * @access public - * @param string $pValue Enclosure, defaults to " - * @return PHPExcel_Reader_CSV - */ - public function setEnclosure($pValue = '"') { - if ($pValue == '') { - $pValue = '"'; - } - $this->_enclosure = $pValue; - return $this; - } // function setEnclosure() - - /** - * Get line ending - * - * @access public - * @return string - */ - public function getLineEnding() { - return $this->_lineEnding; - } // function getLineEnding() - - /** - * Set line ending - * - * @access public - * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) - * @return PHPExcel_Reader_CSV - */ - public function setLineEnding($pValue = PHP_EOL) { - $this->_lineEnding = $pValue; - return $this; - } // function setLineEnding() - - /** - * Get sheet index - * - * @access public - * @return int - */ - public function getSheetIndex() { - return $this->_sheetIndex; - } // function getSheetIndex() - - /** - * Set sheet index - * - * @access public - * @param int $pValue Sheet index - * @return PHPExcel_Reader_CSV - */ - public function setSheetIndex($pValue = 0) { - $this->_sheetIndex = $pValue; - return $this; - } // function setSheetIndex() - - /** - * Set Contiguous - * - * @access public - * @param string $pValue Input encoding - */ - public function setContiguous($contiguous = false) - { - $this->_contiguous = (bool)$contiguous; - if (!$contiguous) { - $this->_contiguousRow = -1; - } - - return $this; - } // function setInputEncoding() - - /** - * Get Contiguous - * - * @access public - * @return boolean - */ - public function getContiguous() { - return $this->_contiguous; - } // function getSheetIndex() - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/DefaultReadFilter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/DefaultReadFilter.php deleted file mode 100644 index 9255f2dfaf..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/DefaultReadFilter.php +++ /dev/null @@ -1,58 +0,0 @@ -_readDataOnly; - } - - /** - * Set read data only - * - * @param boolean $pValue - * @return PHPExcel_Reader_Excel2003XML - */ - public function setReadDataOnly($pValue = false) { - $this->_readDataOnly = $pValue; - return $this; - } - - /** - * Get which sheets to load - * - * @return mixed - */ - public function getLoadSheetsOnly() - { - return $this->_loadSheetsOnly; - } - - /** - * Set which sheets to load - * - * @param mixed $value - * @return PHPExcel_Reader_Excel2003XML - */ - public function setLoadSheetsOnly($value = null) - { - $this->_loadSheetsOnly = is_array($value) ? - $value : array($value); - return $this; - } - - /** - * Set all sheets to load - * - * @return PHPExcel_Reader_Excel2003XML - */ - public function setLoadAllSheets() - { - $this->_loadSheetsOnly = null; - return $this; - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - * @return PHPExcel_Reader_Excel2003XML - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Create a new PHPExcel_Reader_Excel2003XML - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - -// Office xmlns:o="urn:schemas-microsoft-com:office:office" -// Excel xmlns:x="urn:schemas-microsoft-com:office:excel" -// XML Spreadsheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" -// Spreadsheet component xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" -// XML schema xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" -// XML data type xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" -// MS-persist recordset xmlns:rs="urn:schemas-microsoft-com:rowset" -// Rowset xmlns:z="#RowsetSchema" -// - - $signature = array( - '' - ); - - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Read sample data (first 2 KB will do) - $fh = fopen($pFilename, 'r'); - $data = fread($fh, 2048); - fclose($fh); - - $valid = true; - foreach($signature as $match) { - // every part of the signature must be present - if (strpos($data, $match) === false) { - $valid = false; - break; - } - } - - return $valid; - } - - /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object - * - * @param string $pFilename - * @throws Exception - */ - public function listWorksheetNames($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $worksheetNames = array(); - - $xml = simplexml_load_file($pFilename); - $namespaces = $xml->getNamespaces(true); - - $xml_ss = $xml->children($namespaces['ss']); - foreach($xml_ss->Worksheet as $worksheet) { - $worksheet_ss = $worksheet->attributes($namespaces['ss']); - $worksheetNames[] = $worksheet_ss['Name']; - } - - return $worksheetNames; - } - - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - - // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); - } - - private static function identifyFixedStyleValue($styleList,&$styleAttributeValue) { - $styleAttributeValue = strtolower($styleAttributeValue); - foreach($styleList as $style) { - if ($styleAttributeValue == strtolower($style)) { - $styleAttributeValue = $style; - return true; - } - } - return false; - } - - /** - * pixel units to excel width units(units of 1/256th of a character width) - * @param pxs - * @return - */ - private static function _pixel2WidthUnits($pxs) { - $UNIT_OFFSET_MAP = array(0, 36, 73, 109, 146, 182, 219); - - $widthUnits = 256 * ($pxs / 7); - $widthUnits += $UNIT_OFFSET_MAP[($pxs % 7)]; - return $widthUnits; - } - - /** - * excel width units(units of 1/256th of a character width) to pixel units - * @param widthUnits - * @return - */ - private static function _widthUnits2Pixel($widthUnits) { - $pixels = ($widthUnits / 256) * 7; - $offsetWidthUnits = $widthUnits % 256; - $pixels += round($offsetWidthUnits / (256 / 7)); - return $pixels; - } - - - private static function _hex2str($hex) { - return chr(hexdec($hex[1])); - } - - /** - * Loads PHPExcel from file into PHPExcel instance - * - * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception - */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) - { - $fromFormats = array('\-', '\ '); - $toFormats = array('-', ' '); - - $underlineStyles = array ( - PHPExcel_Style_Font::UNDERLINE_NONE, - PHPExcel_Style_Font::UNDERLINE_DOUBLE, - PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING, - PHPExcel_Style_Font::UNDERLINE_SINGLE, - PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING - ); - $verticalAlignmentStyles = array ( - PHPExcel_Style_Alignment::VERTICAL_BOTTOM, - PHPExcel_Style_Alignment::VERTICAL_TOP, - PHPExcel_Style_Alignment::VERTICAL_CENTER, - PHPExcel_Style_Alignment::VERTICAL_JUSTIFY - ); - $horizontalAlignmentStyles = array ( - PHPExcel_Style_Alignment::HORIZONTAL_GENERAL, - PHPExcel_Style_Alignment::HORIZONTAL_LEFT, - PHPExcel_Style_Alignment::HORIZONTAL_RIGHT, - PHPExcel_Style_Alignment::HORIZONTAL_CENTER, - PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS, - PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY - ); - - $timezoneObj = new DateTimeZone('Europe/London'); - $GMT = new DateTimeZone('UTC'); - - - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $xml = simplexml_load_file($pFilename); - $namespaces = $xml->getNamespaces(true); - - $docProps = $objPHPExcel->getProperties(); - if (isset($xml->DocumentProperties[0])) { - foreach($xml->DocumentProperties[0] as $propertyName => $propertyValue) { - switch ($propertyName) { - case 'Title' : - $docProps->setTitle($propertyValue); - break; - case 'Subject' : - $docProps->setSubject($propertyValue); - break; - case 'Author' : - $docProps->setCreator($propertyValue); - break; - case 'Created' : - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - break; - case 'LastAuthor' : - $docProps->setLastModifiedBy($propertyValue); - break; - case 'LastSaved' : - $lastSaveDate = strtotime($propertyValue); - $docProps->setModified($lastSaveDate); - break; - case 'Company' : - $docProps->setCompany($propertyValue); - break; - case 'Category' : - $docProps->setCategory($propertyValue); - break; - case 'Manager' : - $docProps->setManager($propertyValue); - break; - case 'Keywords' : - $docProps->setKeywords($propertyValue); - break; - case 'Description' : - $docProps->setDescription($propertyValue); - break; - } - } - } - if (isset($xml->CustomDocumentProperties)) { - foreach($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) { - $propertyAttributes = $propertyValue->attributes($namespaces['dt']); - $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/','PHPExcel_Reader_Excel2003XML::_hex2str',$propertyName); - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_UNKNOWN; - switch((string) $propertyAttributes) { - case 'string' : - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; - $propertyValue = trim($propertyValue); - break; - case 'boolean' : - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN; - $propertyValue = (bool) $propertyValue; - break; - case 'integer' : - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_INTEGER; - $propertyValue = intval($propertyValue); - break; - case 'float' : - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT; - $propertyValue = floatval($propertyValue); - break; - case 'dateTime.tz' : - $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE; - $propertyValue = strtotime(trim($propertyValue)); - break; - } - $docProps->setCustomProperty($propertyName,$propertyValue,$propertyType); - } - } - - foreach($xml->Styles[0] as $style) { - $style_ss = $style->attributes($namespaces['ss']); - $styleID = (string) $style_ss['ID']; -// echo 'Style ID = '.$styleID.'
      '; - if ($styleID == 'Default') { - $this->_styles['Default'] = array(); - } else { - $this->_styles[$styleID] = $this->_styles['Default']; - } - foreach ($style as $styleType => $styleData) { - $styleAttributes = $styleData->attributes($namespaces['ss']); -// echo $styleType.'
      '; - switch ($styleType) { - case 'Alignment' : - foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) { -// echo $styleAttributeKey.' = '.$styleAttributeValue.'
      '; - $styleAttributeValue = (string) $styleAttributeValue; - switch ($styleAttributeKey) { - case 'Vertical' : - if (self::identifyFixedStyleValue($verticalAlignmentStyles,$styleAttributeValue)) { - $this->_styles[$styleID]['alignment']['vertical'] = $styleAttributeValue; - } - break; - case 'Horizontal' : - if (self::identifyFixedStyleValue($horizontalAlignmentStyles,$styleAttributeValue)) { - $this->_styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue; - } - break; - case 'WrapText' : - $this->_styles[$styleID]['alignment']['wrap'] = true; - break; - } - } - break; - case 'Borders' : - foreach($styleData->Border as $borderStyle) { - $borderAttributes = $borderStyle->attributes($namespaces['ss']); - $thisBorder = array(); - foreach($borderAttributes as $borderStyleKey => $borderStyleValue) { -// echo $borderStyleKey.' = '.$borderStyleValue.'
      '; - switch ($borderStyleKey) { - case 'LineStyle' : - $thisBorder['style'] = PHPExcel_Style_Border::BORDER_MEDIUM; -// $thisBorder['style'] = $borderStyleValue; - break; - case 'Weight' : -// $thisBorder['style'] = $borderStyleValue; - break; - case 'Position' : - $borderPosition = strtolower($borderStyleValue); - break; - case 'Color' : - $borderColour = substr($borderStyleValue,1); - $thisBorder['color']['rgb'] = $borderColour; - break; - } - } - if (count($thisBorder) > 0) { - if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) { - $this->_styles[$styleID]['borders'][$borderPosition] = $thisBorder; - } - } - } - break; - case 'Font' : - foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) { -// echo $styleAttributeKey.' = '.$styleAttributeValue.'
      '; - $styleAttributeValue = (string) $styleAttributeValue; - switch ($styleAttributeKey) { - case 'FontName' : - $this->_styles[$styleID]['font']['name'] = $styleAttributeValue; - break; - case 'Size' : - $this->_styles[$styleID]['font']['size'] = $styleAttributeValue; - break; - case 'Color' : - $this->_styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue,1); - break; - case 'Bold' : - $this->_styles[$styleID]['font']['bold'] = true; - break; - case 'Italic' : - $this->_styles[$styleID]['font']['italic'] = true; - break; - case 'Underline' : - if (self::identifyFixedStyleValue($underlineStyles,$styleAttributeValue)) { - $this->_styles[$styleID]['font']['underline'] = $styleAttributeValue; - } - break; - } - } - break; - case 'Interior' : - foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) { -// echo $styleAttributeKey.' = '.$styleAttributeValue.'
      '; - switch ($styleAttributeKey) { - case 'Color' : - $this->_styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue,1); - break; - } - } - break; - case 'NumberFormat' : - foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) { -// echo $styleAttributeKey.' = '.$styleAttributeValue.'
      '; - $styleAttributeValue = str_replace($fromFormats,$toFormats,$styleAttributeValue); - switch ($styleAttributeValue) { - case 'Short Date' : - $styleAttributeValue = 'dd/mm/yyyy'; - break; - } - if ($styleAttributeValue > '') { - $this->_styles[$styleID]['numberformat']['code'] = $styleAttributeValue; - } - } - break; - case 'Protection' : - foreach($styleAttributes as $styleAttributeKey => $styleAttributeValue) { -// echo $styleAttributeKey.' = '.$styleAttributeValue.'
      '; - } - break; - } - } -// print_r($this->_styles[$styleID]); -// echo '
      '; - } -// echo '
      '; - - $worksheetID = 0; - $xml_ss = $xml->children($namespaces['ss']); - foreach($xml_ss->Worksheet as $worksheet) { - $worksheet_ss = $worksheet->attributes($namespaces['ss']); - - if ((isset($this->_loadSheetsOnly)) && (isset($worksheet_ss['Name'])) && - (!in_array($worksheet_ss['Name'], $this->_loadSheetsOnly))) { - continue; - } - -// echo '

      Worksheet: ',$worksheet_ss['Name'],'

      '; -// - // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); - if (isset($worksheet_ss['Name'])) { - $worksheetName = (string) $worksheet_ss['Name']; - $objPHPExcel->getActiveSheet()->setTitle($worksheetName); - } - - $columnID = 'A'; - if (isset($worksheet->Table->Column)) { - foreach($worksheet->Table->Column as $columnData) { - $columnData_ss = $columnData->attributes($namespaces['ss']); - if (isset($columnData_ss['Index'])) { - $columnID = PHPExcel_Cell::stringFromColumnIndex($columnData_ss['Index']-1); - } - if (isset($columnData_ss['Width'])) { - $columnWidth = $columnData_ss['Width']; -// echo 'Setting column width for '.$columnID.' to '.$columnWidth.'
      '; - $objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4); - } - ++$columnID; - } - } - - $rowID = 1; - if (isset($worksheet->Table->Row)) { - foreach($worksheet->Table->Row as $rowData) { - $rowHasData = false; - $row_ss = $rowData->attributes($namespaces['ss']); - if (isset($row_ss['Index'])) { - $rowID = (integer) $row_ss['Index']; - } -// echo 'Row '.$rowID.'
      '; - - $columnID = 'A'; - foreach($rowData->Cell as $cell) { - - $cell_ss = $cell->attributes($namespaces['ss']); - if (isset($cell_ss['Index'])) { - $columnID = PHPExcel_Cell::stringFromColumnIndex($cell_ss['Index']-1); - } - $cellRange = $columnID.$rowID; - - if (!is_null($this->getReadFilter())) { - if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { - continue; - } - } - - if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) { - $columnTo = $columnID; - if (isset($cell_ss['MergeAcross'])) { - $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1); - } - $rowTo = $rowID; - if (isset($cell_ss['MergeDown'])) { - $rowTo = $rowTo + $cell_ss['MergeDown']; - } - $cellRange .= ':'.$columnTo.$rowTo; - $objPHPExcel->getActiveSheet()->mergeCells($cellRange); - } - - $cellIsSet = $hasCalculatedValue = false; - $cellDataFormula = ''; - if (isset($cell_ss['Formula'])) { - $cellDataFormula = $cell_ss['Formula']; - // added this as a check for array formulas - if (isset($cell_ss['ArrayRange'])) { - $cellDataCSEFormula = $cell_ss['ArrayRange']; -// echo "found an array formula at ".$columnID.$rowID."
      "; - } - $hasCalculatedValue = true; - } - if (isset($cell->Data)) { - $cellValue = $cellData = $cell->Data; - $type = PHPExcel_Cell_DataType::TYPE_NULL; - $cellData_ss = $cellData->attributes($namespaces['ss']); - if (isset($cellData_ss['Type'])) { - $cellDataType = $cellData_ss['Type']; - switch ($cellDataType) { - /* - const TYPE_STRING = 's'; - const TYPE_FORMULA = 'f'; - const TYPE_NUMERIC = 'n'; - const TYPE_BOOL = 'b'; - const TYPE_NULL = 's'; - const TYPE_INLINE = 'inlineStr'; - const TYPE_ERROR = 'e'; - */ - case 'String' : - $type = PHPExcel_Cell_DataType::TYPE_STRING; - break; - case 'Number' : - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $cellValue = (float) $cellValue; - if (floor($cellValue) == $cellValue) { - $cellValue = (integer) $cellValue; - } - break; - case 'Boolean' : - $type = PHPExcel_Cell_DataType::TYPE_BOOL; - $cellValue = ($cellValue != 0); - break; - case 'DateTime' : - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $cellValue = PHPExcel_Shared_Date::PHPToExcel(strtotime($cellValue)); - break; - case 'Error' : - $type = PHPExcel_Cell_DataType::TYPE_ERROR; - break; - } - } - - if ($hasCalculatedValue) { -// echo 'FORMULA
      '; - $type = PHPExcel_Cell_DataType::TYPE_FORMULA; - $columnNumber = PHPExcel_Cell::columnIndexFromString($columnID); - if (substr($cellDataFormula,0,3) == 'of:') { - $cellDataFormula = substr($cellDataFormula,3); -// echo 'Before: ',$cellDataFormula,'
      '; - $temp = explode('"',$cellDataFormula); - $key = false; - foreach($temp as &$value) { - // Only replace in alternate array entries (i.e. non-quoted blocks) - if ($key = !$key) { - $value = str_replace(array('[.','.',']'),'',$value); - } - } - } else { - // Convert R1C1 style references to A1 style references (but only when not quoted) -// echo 'Before: ',$cellDataFormula,'
      '; - $temp = explode('"',$cellDataFormula); - $key = false; - foreach($temp as &$value) { - // Only replace in alternate array entries (i.e. non-quoted blocks) - if ($key = !$key) { - preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/',$value, $cellReferences,PREG_SET_ORDER+PREG_OFFSET_CAPTURE); - // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way - // through the formula from left to right. Reversing means that we work right to left.through - // the formula - $cellReferences = array_reverse($cellReferences); - // Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent, - // then modify the formula to use that new reference - foreach($cellReferences as $cellReference) { - $rowReference = $cellReference[2][0]; - // Empty R reference is the current row - if ($rowReference == '') $rowReference = $rowID; - // Bracketed R references are relative to the current row - if ($rowReference{0} == '[') $rowReference = $rowID + trim($rowReference,'[]'); - $columnReference = $cellReference[4][0]; - // Empty C reference is the current column - if ($columnReference == '') $columnReference = $columnNumber; - // Bracketed C references are relative to the current column - if ($columnReference{0} == '[') $columnReference = $columnNumber + trim($columnReference,'[]'); - $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; - $value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0])); - } - } - } - } - unset($value); - // Then rebuild the formula string - $cellDataFormula = implode('"',$temp); -// echo 'After: ',$cellDataFormula,'
      '; - } - -// echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'
      '; -// - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue),$type); - if ($hasCalculatedValue) { -// echo 'Formula result is '.$cellValue.'
      '; - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue); - } - $cellIsSet = $rowHasData = true; - } - - if (isset($cell->Comment)) { -// echo 'comment found
      '; - $commentAttributes = $cell->Comment->attributes($namespaces['ss']); - $author = 'unknown'; - if (isset($commentAttributes->Author)) { - $author = (string)$commentAttributes->Author; -// echo 'Author: ',$author,'
      '; - } - $node = $cell->Comment->Data->asXML(); -// $annotation = str_replace('html:','',substr($node,49,-10)); -// echo $annotation,'
      '; - $annotation = strip_tags($node); -// echo 'Annotation: ',$annotation,'
      '; - $objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID ) - ->setAuthor( $author ) - ->setText($this->_parseRichText($annotation) ); - } - - if (($cellIsSet) && (isset($cell_ss['StyleID']))) { - $style = (string) $cell_ss['StyleID']; -// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'
      '; - if ((isset($this->_styles[$style])) && (count($this->_styles[$style]) > 0)) { -// echo 'Cell '.$columnID.$rowID.'
      '; -// print_r($this->_styles[$style]); -// echo '
      '; - if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) { - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(NULL); - } - $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->_styles[$style]); - } - } - ++$columnID; - } - - if ($rowHasData) { - if (isset($row_ss['StyleID'])) { - $rowStyle = $row_ss['StyleID']; - } - if (isset($row_ss['Height'])) { - $rowHeight = $row_ss['Height']; -// echo 'Setting row height to '.$rowHeight.'
      '; - $objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight); - } - } - - ++$rowID; - } - } - ++$worksheetID; - } - - // Return - return $objPHPExcel; - } - - private function _parseRichText($is = '') { - $value = new PHPExcel_RichText(); - - $value->createText($is); - - return $value; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007.php deleted file mode 100644 index 642abb1bde..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007.php +++ /dev/null @@ -1,1788 +0,0 @@ -_readDataOnly; - } - - /** - * Set read data only - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. - * Set to false (the default) to advise the Reader to read both data and formatting for cells. - * - * @param boolean $pValue - * - * @return PHPExcel_Reader_Excel2007 - */ - public function setReadDataOnly($pValue = false) { - $this->_readDataOnly = $pValue; - return $this; - } - - /** - * Get which sheets to load - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null - * indicating that all worksheets in the workbook should be loaded. - * - * @return mixed - */ - public function getLoadSheetsOnly() - { - return $this->_loadSheetsOnly; - } - - /** - * Set which sheets to load - * - * @param mixed $value - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. - * If NULL, then it tells the Reader to read all worksheets in the workbook - * - * @return PHPExcel_Reader_Excel2007 - */ - public function setLoadSheetsOnly($value = null) - { - $this->_loadSheetsOnly = is_array($value) ? - $value : array($value); - return $this; - } - - /** - * Set all sheets to load - * Tells the Reader to load all worksheets from the workbook. - * - * @return PHPExcel_Reader_Excel2007 - */ - public function setLoadAllSheets() - { - $this->_loadSheetsOnly = null; - return $this; - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - * @return PHPExcel_Reader_Excel2007 - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Create a new PHPExcel_Reader_Excel2007 instance - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - $this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - // Check if zip class exists - if (!class_exists('ZipArchive')) { - return false; - } - - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $xl = false; - // Load file - $zip = new ZipArchive; - if ($zip->open($pFilename) === true) { - // check if it is an OOXML archive - $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); - foreach ($rels->Relationship as $rel) { - switch ($rel["Type"]) { - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": - if (basename($rel["Target"]) == 'workbook.xml') { - $xl = true; - } - break; - - } - } - $zip->close(); - } - - return $xl; - } - - private static function _castToBool($c) { -// echo 'Initial Cast to Boolean
      '; - $value = isset($c->v) ? (string) $c->v : null; - if ($value == '0') { - return false; - } elseif ($value == '1') { - return true; - } else { - return (bool)$c->v; - } - return $value; - } // function _castToBool() - - private static function _castToError($c) { -// echo 'Initial Cast to Error
      '; - return isset($c->v) ? (string) $c->v : null;; - } // function _castToError() - - private static function _castToString($c) { -// echo 'Initial Cast to String
      '; - return isset($c->v) ? (string) $c->v : null;; - } // function _castToString() - - private function _castToFormula($c,$r,&$cellDataType,&$value,&$calculatedValue,&$sharedFormulas,$castBaseType) { -// echo 'Formula
      '; -// echo '$c->f is '.$c->f.'
      '; - $cellDataType = 'f'; - $value = "={$c->f}"; - $calculatedValue = self::$castBaseType($c); - - // Shared formula? - if (isset($c->f['t']) && strtolower((string)$c->f['t']) == 'shared') { -// echo 'SHARED FORMULA
      '; - $instance = (string)$c->f['si']; - -// echo 'Instance ID = '.$instance.'
      '; -// -// echo 'Shared Formula Array:
      ';
      -//			print_r($sharedFormulas);
      -//			echo '
      '; - if (!isset($sharedFormulas[(string)$c->f['si']])) { -// echo 'SETTING NEW SHARED FORMULA
      '; -// echo 'Master is '.$r.'
      '; -// echo 'Formula is '.$value.'
      '; - $sharedFormulas[$instance] = array( 'master' => $r, - 'formula' => $value - ); -// echo 'New Shared Formula Array:
      ';
      -//				print_r($sharedFormulas);
      -//				echo '
      '; - } else { -// echo 'GETTING SHARED FORMULA
      '; -// echo 'Master is '.$sharedFormulas[$instance]['master'].'
      '; -// echo 'Formula is '.$sharedFormulas[$instance]['formula'].'
      '; - $master = PHPExcel_Cell::coordinateFromString($sharedFormulas[$instance]['master']); - $current = PHPExcel_Cell::coordinateFromString($r); - - $difference = array(0, 0); - $difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]); - $difference[1] = $current[1] - $master[1]; - - $value = $this->_referenceHelper->updateFormulaReferences( $sharedFormulas[$instance]['formula'], - 'A1', - $difference[0], - $difference[1] - ); -// echo 'Adjusted Formula is '.$value.'
      '; - } - } - } - - public function _getFromZipArchive(ZipArchive $archive, $fileName = '') - { - // Root-relative paths - if (strpos($fileName, '//') !== false) - { - $fileName = substr($fileName, strpos($fileName, '//') + 1); - } - $fileName = PHPExcel_Shared_File::realpath($fileName); - - // Apache POI fixes - $contents = $archive->getFromName($fileName); - if ($contents === false) - { - $contents = $archive->getFromName(substr($fileName, 1)); - } - - return $contents; - } - - /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object - * - * @param string $pFilename - * @throws Exception - */ - public function listWorksheetNames($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $worksheetNames = array(); - - $zip = new ZipArchive; - $zip->open($pFilename); - - $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - foreach ($rels->Relationship as $rel) { - switch ($rel["Type"]) { - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": - $xmlWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - - if ($xmlWorkbook->sheets) { - foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { - // Check if sheet should be skipped - $worksheetNames[] = (string) $eleSheet["name"]; - } - } - } - } - - $zip->close(); - - return $worksheetNames; - } - - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @throws Exception - */ - public function load($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Initialisations - $excel = new PHPExcel; - $excel->removeSheetByIndex(0); - if (!$this->_readDataOnly) { - $excel->removeCellStyleXfByIndex(0); // remove the default style - $excel->removeCellXfByIndex(0); // remove the default style - } - $zip = new ZipArchive; - $zip->open($pFilename); - - // Read the theme first, because we need the colour scheme when reading the styles - $wbRels = simplexml_load_string($this->_getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - foreach ($wbRels->Relationship as $rel) { - switch ($rel["Type"]) { - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme": - $themeOrderArray = array('lt1','dk1','lt2','dk2'); - $themeOrderAdditional = count($themeOrderArray); - - $xmlTheme = simplexml_load_string($this->_getFromZipArchive($zip, "xl/{$rel['Target']}")); - if (is_object($xmlTheme)) { - $xmlThemeName = $xmlTheme->attributes(); - $xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); - $themeName = (string)$xmlThemeName['name']; - - $colourScheme = $xmlTheme->themeElements->clrScheme->attributes(); - $colourSchemeName = (string)$colourScheme['name']; - $colourScheme = $xmlTheme->themeElements->clrScheme->children("http://schemas.openxmlformats.org/drawingml/2006/main"); - - $themeColours = array(); - foreach ($colourScheme as $k => $xmlColour) { - $themePos = array_search($k,$themeOrderArray); - if ($themePos === false) { - $themePos = $themeOrderAdditional++; - } - if (isset($xmlColour->sysClr)) { - $xmlColourData = $xmlColour->sysClr->attributes(); - $themeColours[$themePos] = $xmlColourData['lastClr']; - } elseif (isset($xmlColour->srgbClr)) { - $xmlColourData = $xmlColour->srgbClr->attributes(); - $themeColours[$themePos] = $xmlColourData['val']; - } - } - self::$_theme = new PHPExcel_Reader_Excel2007_Theme($themeName,$colourSchemeName,$themeColours); - } - break; - } - } - - $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - foreach ($rels->Relationship as $rel) { - switch ($rel["Type"]) { - case "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties": - $xmlCore = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); - if (is_object($xmlCore)) { - $xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/"); - $xmlCore->registerXPathNamespace("dcterms", "http://purl.org/dc/terms/"); - $xmlCore->registerXPathNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"); - $docProps = $excel->getProperties(); - $docProps->setCreator((string) self::array_item($xmlCore->xpath("dc:creator"))); - $docProps->setLastModifiedBy((string) self::array_item($xmlCore->xpath("cp:lastModifiedBy"))); - $docProps->setCreated(strtotime(self::array_item($xmlCore->xpath("dcterms:created")))); //! respect xsi:type - $docProps->setModified(strtotime(self::array_item($xmlCore->xpath("dcterms:modified")))); //! respect xsi:type - $docProps->setTitle((string) self::array_item($xmlCore->xpath("dc:title"))); - $docProps->setDescription((string) self::array_item($xmlCore->xpath("dc:description"))); - $docProps->setSubject((string) self::array_item($xmlCore->xpath("dc:subject"))); - $docProps->setKeywords((string) self::array_item($xmlCore->xpath("cp:keywords"))); - $docProps->setCategory((string) self::array_item($xmlCore->xpath("cp:category"))); - } - break; - - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties": - $xmlCore = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); - if (is_object($xmlCore)) { - $docProps = $excel->getProperties(); - if (isset($xmlCore->Company)) - $docProps->setCompany((string) $xmlCore->Company); - if (isset($xmlCore->Manager)) - $docProps->setManager((string) $xmlCore->Manager); - } - break; - - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties": - $xmlCore = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); - if (is_object($xmlCore)) { - $docProps = $excel->getProperties(); - foreach ($xmlCore as $xmlProperty) { - $cellDataOfficeAttributes = $xmlProperty->attributes(); - if (isset($cellDataOfficeAttributes['name'])) { - $propertyName = (string) $cellDataOfficeAttributes['name']; - $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); - $attributeType = $cellDataOfficeChildren->getName(); - $attributeValue = (string) $cellDataOfficeChildren->{$attributeType}; - $attributeValue = PHPExcel_DocumentProperties::convertProperty($attributeValue,$attributeType); - $attributeType = PHPExcel_DocumentProperties::convertPropertyType($attributeType); - $docProps->setCustomProperty($propertyName,$attributeValue,$attributeType); - } - } - } - break; - - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": - $dir = dirname($rel["Target"]); - $relsWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships"); - - $sharedStrings = array(); - $xpath = self::array_item($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']")); - $xmlStrings = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$xpath[Target]")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - if (isset($xmlStrings) && isset($xmlStrings->si)) { - foreach ($xmlStrings->si as $val) { - if (isset($val->t)) { - $sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $val->t ); - } elseif (isset($val->r)) { - $sharedStrings[] = $this->_parseRichText($val); - } - } - } - - $worksheets = array(); - foreach ($relsWorkbook->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") { - $worksheets[(string) $ele["Id"]] = $ele["Target"]; - } - } - - $styles = array(); - $cellStyles = array(); - $xpath = self::array_item($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']")); - $xmlStyles = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$xpath[Target]")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - $numFmts = null; - if ($xmlStyles && $xmlStyles->numFmts[0]) { - $numFmts = $xmlStyles->numFmts[0]; - } - if (isset($numFmts) && !is_null($numFmts)) { - $numFmts->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - } - if (!$this->_readDataOnly && $xmlStyles) { - foreach ($xmlStyles->cellXfs->xf as $xf) { - $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; - - if ($xf["numFmtId"]) { - if (isset($numFmts)) { - $tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); - - if (isset($tmpNumFmt["formatCode"])) { - $numFmt = (string) $tmpNumFmt["formatCode"]; - } - } - - if ((int)$xf["numFmtId"] < 164) { - $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); - } - } - //$numFmt = str_replace('mm', 'i', $numFmt); - //$numFmt = str_replace('h', 'H', $numFmt); - - $style = (object) array( - "numFmt" => $numFmt, - "font" => $xmlStyles->fonts->font[intval($xf["fontId"])], - "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])], - "border" => $xmlStyles->borders->border[intval($xf["borderId"])], - "alignment" => $xf->alignment, - "protection" => $xf->protection, - ); - $styles[] = $style; - - // add style to cellXf collection - $objStyle = new PHPExcel_Style; - self::_readStyle($objStyle, $style); - $excel->addCellXf($objStyle); - } - - foreach ($xmlStyles->cellStyleXfs->xf as $xf) { - $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; - if ($numFmts && $xf["numFmtId"]) { - $tmpNumFmt = self::array_item($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]")); - if (isset($tmpNumFmt["formatCode"])) { - $numFmt = (string) $tmpNumFmt["formatCode"]; - } else if ((int)$xf["numFmtId"] < 165) { - $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]); - } - } - - $cellStyle = (object) array( - "numFmt" => $numFmt, - "font" => $xmlStyles->fonts->font[intval($xf["fontId"])], - "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])], - "border" => $xmlStyles->borders->border[intval($xf["borderId"])], - "alignment" => $xf->alignment, - "protection" => $xf->protection, - ); - $cellStyles[] = $cellStyle; - - // add style to cellStyleXf collection - $objStyle = new PHPExcel_Style; - self::_readStyle($objStyle, $cellStyle); - $excel->addCellStyleXf($objStyle); - } - } - - $dxfs = array(); - if (!$this->_readDataOnly && $xmlStyles) { - if ($xmlStyles->dxfs) { - foreach ($xmlStyles->dxfs->dxf as $dxf) { - $style = new PHPExcel_Style; - self::_readStyle($style, $dxf); - $dxfs[] = $style; - } - } - - if ($xmlStyles->cellStyles) - { - foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) { - if (intval($cellStyle['builtinId']) == 0) { - if (isset($cellStyles[intval($cellStyle['xfId'])])) { - // Set default style - $style = new PHPExcel_Style; - self::_readStyle($style, $cellStyles[intval($cellStyle['xfId'])]); - - // normal style, currently not using it for anything - } - } - } - } - } - - $xmlWorkbook = simplexml_load_string($this->_getFromZipArchive($zip, "{$rel['Target']}")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - - // Set base date - if ($xmlWorkbook->workbookPr) { - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); - if (isset($xmlWorkbook->workbookPr['date1904'])) { - $date1904 = (string)$xmlWorkbook->workbookPr['date1904']; - if ($date1904 == "true" || $date1904 == "1") { - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); - } - } - } - - $sheetId = 0; // keep track of new sheet id in final workbook - $oldSheetId = -1; // keep track of old sheet id in final workbook - $countSkippedSheets = 0; // keep track of number of skipped sheets - $mapSheetId = array(); // mapping of sheet ids from old to new - - if ($xmlWorkbook->sheets) - { - foreach ($xmlWorkbook->sheets->sheet as $eleSheet) { - ++$oldSheetId; - - // Check if sheet should be skipped - if (isset($this->_loadSheetsOnly) && !in_array((string) $eleSheet["name"], $this->_loadSheetsOnly)) { - ++$countSkippedSheets; - $mapSheetId[$oldSheetId] = null; - continue; - } - - // Map old sheet id in original workbook to new sheet id. - // They will differ if loadSheetsOnly() is being used - $mapSheetId[$oldSheetId] = $oldSheetId - $countSkippedSheets; - - // Load sheet - $docSheet = $excel->createSheet(); - $docSheet->setTitle((string) $eleSheet["name"]); - $fileWorksheet = $worksheets[(string) self::array_item($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; - $xmlSheet = simplexml_load_string($this->_getFromZipArchive($zip, "$dir/$fileWorksheet")); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - - $sharedFormulas = array(); - - if (isset($eleSheet["state"]) && (string) $eleSheet["state"] != '') { - $docSheet->setSheetState( (string) $eleSheet["state"] ); - } - - if (isset($xmlSheet->sheetViews) && isset($xmlSheet->sheetViews->sheetView)) { - if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) { - $docSheet->getSheetView()->setZoomScale( intval($xmlSheet->sheetViews->sheetView['zoomScale']) ); - } - - if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) { - $docSheet->getSheetView()->setZoomScaleNormal( intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']) ); - } - - if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) { - $docSheet->setShowGridLines((string)$xmlSheet->sheetViews->sheetView['showGridLines'] ? true : false); - } - - if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) { - $docSheet->setShowRowColHeaders((string)$xmlSheet->sheetViews->sheetView['showRowColHeaders'] ? true : false); - } - - if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) { - $docSheet->setRightToLeft((string)$xmlSheet->sheetViews->sheetView['rightToLeft'] ? true : false); - } - - if (isset($xmlSheet->sheetViews->sheetView->pane)) { - if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) { - $docSheet->freezePane( (string)$xmlSheet->sheetViews->sheetView->pane['topLeftCell'] ); - } else { - $xSplit = 0; - $ySplit = 0; - - if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) { - $xSplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['xSplit']); - } - - if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) { - $ySplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['ySplit']); - } - - $docSheet->freezePaneByColumnAndRow($xSplit, $ySplit); - } - } - - if (isset($xmlSheet->sheetViews->sheetView->selection)) { - if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) { - $sqref = (string)$xmlSheet->sheetViews->sheetView->selection['sqref']; - $sqref = explode(' ', $sqref); - $sqref = $sqref[0]; - $docSheet->setSelectedCells($sqref); - } - } - - } - - if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->tabColor)) { - if (isset($xmlSheet->sheetPr->tabColor['rgb'])) { - $docSheet->getTabColor()->setARGB( (string)$xmlSheet->sheetPr->tabColor['rgb'] ); - } - } - - if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->outlinePr)) { - if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) && $xmlSheet->sheetPr->outlinePr['summaryRight'] == false) { - $docSheet->setShowSummaryRight(false); - } else { - $docSheet->setShowSummaryRight(true); - } - - if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) && $xmlSheet->sheetPr->outlinePr['summaryBelow'] == false) { - $docSheet->setShowSummaryBelow(false); - } else { - $docSheet->setShowSummaryBelow(true); - } - } - - if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->pageSetUpPr)) { - if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) && $xmlSheet->sheetPr->pageSetUpPr['fitToPage'] == false) { - $docSheet->getPageSetup()->setFitToPage(false); - } else { - $docSheet->getPageSetup()->setFitToPage(true); - } - } - - if (isset($xmlSheet->sheetFormatPr)) { - if (isset($xmlSheet->sheetFormatPr['customHeight']) && ((string)$xmlSheet->sheetFormatPr['customHeight'] == '1' || strtolower((string)$xmlSheet->sheetFormatPr['customHeight']) == 'true') && isset($xmlSheet->sheetFormatPr['defaultRowHeight'])) { - $docSheet->getDefaultRowDimension()->setRowHeight( (float)$xmlSheet->sheetFormatPr['defaultRowHeight'] ); - } - if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) { - $docSheet->getDefaultColumnDimension()->setWidth( (float)$xmlSheet->sheetFormatPr['defaultColWidth'] ); - } - } - - if (isset($xmlSheet->cols) && !$this->_readDataOnly) { - foreach ($xmlSheet->cols->col as $col) { - for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) { - if ($col["style"] && !$this->_readDataOnly) { - $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"])); - } - if ($col["bestFit"]) { - //$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true); - } - if ($col["hidden"]) { - $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(false); - } - if ($col["collapsed"]) { - $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(true); - } - if ($col["outlineLevel"] > 0) { - $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"])); - } - $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"])); - - if (intval($col["max"]) == 16384) { - break; - } - } - } - } - - if (isset($xmlSheet->printOptions) && !$this->_readDataOnly) { - if ($xmlSheet->printOptions['gridLinesSet'] == 'true' && $xmlSheet->printOptions['gridLinesSet'] == '1') { - $docSheet->setShowGridlines(true); - } - - if ($xmlSheet->printOptions['gridLines'] == 'true' || $xmlSheet->printOptions['gridLines'] == '1') { - $docSheet->setPrintGridlines(true); - } - - if ($xmlSheet->printOptions['horizontalCentered']) { - $docSheet->getPageSetup()->setHorizontalCentered(true); - } - if ($xmlSheet->printOptions['verticalCentered']) { - $docSheet->getPageSetup()->setVerticalCentered(true); - } - } - - if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) { - foreach ($xmlSheet->sheetData->row as $row) { - if ($row["ht"] && !$this->_readDataOnly) { - $docSheet->getRowDimension(intval($row["r"]))->setRowHeight(floatval($row["ht"])); - } - if ($row["hidden"] && !$this->_readDataOnly) { - $docSheet->getRowDimension(intval($row["r"]))->setVisible(false); - } - if ($row["collapsed"]) { - $docSheet->getRowDimension(intval($row["r"]))->setCollapsed(true); - } - if ($row["outlineLevel"] > 0) { - $docSheet->getRowDimension(intval($row["r"]))->setOutlineLevel(intval($row["outlineLevel"])); - } - if ($row["s"] && !$this->_readDataOnly) { - $docSheet->getRowDimension(intval($row["r"]))->setXfIndex(intval($row["s"])); - } - - foreach ($row->c as $c) { - $r = (string) $c["r"]; - $cellDataType = (string) $c["t"]; - $value = null; - $calculatedValue = null; - - // Read cell? - if (!is_null($this->getReadFilter())) { - $coordinates = PHPExcel_Cell::coordinateFromString($r); - - if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) { - continue; - } - } - - // echo 'Reading cell '.$coordinates[0].$coordinates[1].'
      '; - // print_r($c); - // echo '
      '; - // echo 'Cell Data Type is '.$cellDataType.': '; - // - // Read cell! - switch ($cellDataType) { - case "s": - // echo 'String
      '; - if ((string)$c->v != '') { - $value = $sharedStrings[intval($c->v)]; - - if ($value instanceof PHPExcel_RichText) { - $value = clone $value; - } - } else { - $value = ''; - } - - break; - case "b": - // echo 'Boolean
      '; - if (!isset($c->f)) { - $value = self::_castToBool($c); - } else { - // Formula - $this->_castToFormula($c,$r,$cellDataType,$value,$calculatedValue,$sharedFormulas,'_castToBool'); - if (isset($c->f['t'])) { - $att = array(); - $att = $c->f; - $docSheet->getCell($r)->setFormulaAttributes($att); - } - // echo '$calculatedValue = '.$calculatedValue.'
      '; - } - break; - case "inlineStr": - // echo 'Inline String
      '; - $value = $this->_parseRichText($c->is); - - break; - case "e": - // echo 'Error
      '; - if (!isset($c->f)) { - $value = self::_castToError($c); - } else { - // Formula - $this->_castToFormula($c,$r,$cellDataType,$value,$calculatedValue,$sharedFormulas,'_castToError'); - // echo '$calculatedValue = '.$calculatedValue.'
      '; - } - - break; - - default: - // echo 'Default
      '; - if (!isset($c->f)) { - // echo 'Not a Formula
      '; - $value = self::_castToString($c); - } else { - // echo 'Treat as Formula
      '; - // Formula - $this->_castToFormula($c,$r,$cellDataType,$value,$calculatedValue,$sharedFormulas,'_castToString'); - // echo '$calculatedValue = '.$calculatedValue.'
      '; - } - - break; - } - // echo 'Value is '.$value.'
      '; - - // Check for numeric values - if (is_numeric($value) && $cellDataType != 's') { - if ($value == (int)$value) $value = (int)$value; - elseif ($value == (float)$value) $value = (float)$value; - elseif ($value == (double)$value) $value = (double)$value; - } - - // Rich text? - if ($value instanceof PHPExcel_RichText && $this->_readDataOnly) { - $value = $value->getPlainText(); - } - - $cell = $docSheet->getCell($r); - // Assign value - if ($cellDataType != '') { - $cell->setValueExplicit($value, $cellDataType); - } else { - $cell->setValue($value); - } - if (!is_null($calculatedValue)) { - $cell->setCalculatedValue($calculatedValue); - } - - // Style information? - if ($c["s"] && !$this->_readDataOnly) { - // no style index means 0, it seems - $cell->setXfIndex(isset($styles[intval($c["s"])]) ? - intval($c["s"]) : 0); - } - } - } - } - - $conditionals = array(); - if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) { - foreach ($xmlSheet->conditionalFormatting as $conditional) { - foreach ($conditional->cfRule as $cfRule) { - if ( - ( - (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE || - (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS || - (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || - (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION - ) && isset($dxfs[intval($cfRule["dxfId"])]) - ) { - $conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule; - } - } - } - - foreach ($conditionals as $ref => $cfRules) { - ksort($cfRules); - $conditionalStyles = array(); - foreach ($cfRules as $cfRule) { - $objConditional = new PHPExcel_Style_Conditional(); - $objConditional->setConditionType((string)$cfRule["type"]); - $objConditional->setOperatorType((string)$cfRule["operator"]); - - if ((string)$cfRule["text"] != '') { - $objConditional->setText((string)$cfRule["text"]); - } - - if (count($cfRule->formula) > 1) { - foreach ($cfRule->formula as $formula) { - $objConditional->addCondition((string)$formula); - } - } else { - $objConditional->addCondition((string)$cfRule->formula); - } - $objConditional->setStyle(clone $dxfs[intval($cfRule["dxfId"])]); - $conditionalStyles[] = $objConditional; - } - - // Extract all cell references in $ref - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($ref); - foreach ($aReferences as $reference) { - $docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles); - } - } - } - - $aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells"); - if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { - foreach ($aKeys as $key) { - $method = "set" . ucfirst($key); - $docSheet->getProtection()->$method($xmlSheet->sheetProtection[$key] == "true"); - } - } - - if (!$this->_readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) { - $docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], true); - if ($xmlSheet->protectedRanges->protectedRange) { - foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) { - $docSheet->protectCells((string) $protectedRange["sqref"], (string) $protectedRange["password"], true); - } - } - } - - if ($xmlSheet && $xmlSheet->autoFilter && !$this->_readDataOnly) { - $docSheet->setAutoFilter((string) $xmlSheet->autoFilter["ref"]); - } - - if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->_readDataOnly) { - foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) { - $docSheet->mergeCells((string) $mergeCell["ref"]); - } - } - - if ($xmlSheet && $xmlSheet->pageMargins && !$this->_readDataOnly) { - $docPageMargins = $docSheet->getPageMargins(); - $docPageMargins->setLeft(floatval($xmlSheet->pageMargins["left"])); - $docPageMargins->setRight(floatval($xmlSheet->pageMargins["right"])); - $docPageMargins->setTop(floatval($xmlSheet->pageMargins["top"])); - $docPageMargins->setBottom(floatval($xmlSheet->pageMargins["bottom"])); - $docPageMargins->setHeader(floatval($xmlSheet->pageMargins["header"])); - $docPageMargins->setFooter(floatval($xmlSheet->pageMargins["footer"])); - } - - if ($xmlSheet && $xmlSheet->pageSetup && !$this->_readDataOnly) { - $docPageSetup = $docSheet->getPageSetup(); - - if (isset($xmlSheet->pageSetup["orientation"])) { - $docPageSetup->setOrientation((string) $xmlSheet->pageSetup["orientation"]); - } - if (isset($xmlSheet->pageSetup["paperSize"])) { - $docPageSetup->setPaperSize(intval($xmlSheet->pageSetup["paperSize"])); - } - if (isset($xmlSheet->pageSetup["scale"])) { - $docPageSetup->setScale(intval($xmlSheet->pageSetup["scale"]), false); - } - if (isset($xmlSheet->pageSetup["fitToHeight"]) && intval($xmlSheet->pageSetup["fitToHeight"]) >= 0) { - $docPageSetup->setFitToHeight(intval($xmlSheet->pageSetup["fitToHeight"]), false); - } - if (isset($xmlSheet->pageSetup["fitToWidth"]) && intval($xmlSheet->pageSetup["fitToWidth"]) >= 0) { - $docPageSetup->setFitToWidth(intval($xmlSheet->pageSetup["fitToWidth"]), false); - } - if (isset($xmlSheet->pageSetup["firstPageNumber"]) && isset($xmlSheet->pageSetup["useFirstPageNumber"]) && - ((string)$xmlSheet->pageSetup["useFirstPageNumber"] == 'true' || (string)$xmlSheet->pageSetup["useFirstPageNumber"] == '1')) { - $docPageSetup->setFirstPageNumber(intval($xmlSheet->pageSetup["firstPageNumber"])); - } - } - - if ($xmlSheet && $xmlSheet->headerFooter && !$this->_readDataOnly) { - $docHeaderFooter = $docSheet->getHeaderFooter(); - - if (isset($xmlSheet->headerFooter["differentOddEven"]) && - ((string)$xmlSheet->headerFooter["differentOddEven"] == 'true' || (string)$xmlSheet->headerFooter["differentOddEven"] == '1')) { - $docHeaderFooter->setDifferentOddEven(true); - } else { - $docHeaderFooter->setDifferentOddEven(false); - } - if (isset($xmlSheet->headerFooter["differentFirst"]) && - ((string)$xmlSheet->headerFooter["differentFirst"] == 'true' || (string)$xmlSheet->headerFooter["differentFirst"] == '1')) { - $docHeaderFooter->setDifferentFirst(true); - } else { - $docHeaderFooter->setDifferentFirst(false); - } - if (isset($xmlSheet->headerFooter["scaleWithDoc"]) && - ((string)$xmlSheet->headerFooter["scaleWithDoc"] == 'false' || (string)$xmlSheet->headerFooter["scaleWithDoc"] == '0')) { - $docHeaderFooter->setScaleWithDocument(false); - } else { - $docHeaderFooter->setScaleWithDocument(true); - } - if (isset($xmlSheet->headerFooter["alignWithMargins"]) && - ((string)$xmlSheet->headerFooter["alignWithMargins"] == 'false' || (string)$xmlSheet->headerFooter["alignWithMargins"] == '0')) { - $docHeaderFooter->setAlignWithMargins(false); - } else { - $docHeaderFooter->setAlignWithMargins(true); - } - - $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader); - $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter); - $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader); - $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter); - $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader); - $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter); - } - - if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->_readDataOnly) { - foreach ($xmlSheet->rowBreaks->brk as $brk) { - if ($brk["man"]) { - $docSheet->setBreak("A$brk[id]", PHPExcel_Worksheet::BREAK_ROW); - } - } - } - if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->_readDataOnly) { - foreach ($xmlSheet->colBreaks->brk as $brk) { - if ($brk["man"]) { - $docSheet->setBreak(PHPExcel_Cell::stringFromColumnIndex($brk["id"]) . "1", PHPExcel_Worksheet::BREAK_COLUMN); - } - } - } - - if ($xmlSheet && $xmlSheet->dataValidations && !$this->_readDataOnly) { - foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) { - // Uppercase coordinate - $range = strtoupper($dataValidation["sqref"]); - $rangeSet = explode(' ',$range); - foreach($rangeSet as $range) { - $stRange = $docSheet->shrinkRangeToFit($range); - - // Extract all cell references in $range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); - foreach ($aReferences as $reference) { - // Create validation - $docValidation = $docSheet->getCell($reference)->getDataValidation(); - $docValidation->setType((string) $dataValidation["type"]); - $docValidation->setErrorStyle((string) $dataValidation["errorStyle"]); - $docValidation->setOperator((string) $dataValidation["operator"]); - $docValidation->setAllowBlank($dataValidation["allowBlank"] != 0); - $docValidation->setShowDropDown($dataValidation["showDropDown"] == 0); - $docValidation->setShowInputMessage($dataValidation["showInputMessage"] != 0); - $docValidation->setShowErrorMessage($dataValidation["showErrorMessage"] != 0); - $docValidation->setErrorTitle((string) $dataValidation["errorTitle"]); - $docValidation->setError((string) $dataValidation["error"]); - $docValidation->setPromptTitle((string) $dataValidation["promptTitle"]); - $docValidation->setPrompt((string) $dataValidation["prompt"]); - $docValidation->setFormula1((string) $dataValidation->formula1); - $docValidation->setFormula2((string) $dataValidation->formula2); - } - } - } - } - - // Add hyperlinks - $hyperlinks = array(); - if (!$this->_readDataOnly) { - // Locate hyperlink relations - if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { - $relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - foreach ($relsWorksheet->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") { - $hyperlinks[(string)$ele["Id"]] = (string)$ele["Target"]; - } - } - } - - // Loop through hyperlinks - if ($xmlSheet && $xmlSheet->hyperlinks) { - foreach ($xmlSheet->hyperlinks->hyperlink as $hyperlink) { - // Link url - $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - - foreach (PHPExcel_Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) { - $cell = $docSheet->getCell( $cellReference ); - if (isset($linkRel['id'])) { - $cell->getHyperlink()->setUrl( $hyperlinks[ (string)$linkRel['id'] ] ); - } - if (isset($hyperlink['location'])) { - $cell->getHyperlink()->setUrl( 'sheet://' . (string)$hyperlink['location'] ); - } - - // Tooltip - if (isset($hyperlink['tooltip'])) { - $cell->getHyperlink()->setTooltip( (string)$hyperlink['tooltip'] ); - } - } - } - } - } - - // Add comments - $comments = array(); - $vmlComments = array(); - if (!$this->_readDataOnly) { - // Locate comment relations - if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { - $relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - foreach ($relsWorksheet->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") { - $comments[(string)$ele["Id"]] = (string)$ele["Target"]; - } - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") { - $vmlComments[(string)$ele["Id"]] = (string)$ele["Target"]; - } - } - } - - // Loop through comments - foreach ($comments as $relName => $relPath) { - // Load comments file - $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); - $commentsFile = simplexml_load_string($this->_getFromZipArchive($zip, $relPath) ); - - // Utility variables - $authors = array(); - - // Loop through authors - foreach ($commentsFile->authors->author as $author) { - $authors[] = (string)$author; - } - - // Loop through contents - foreach ($commentsFile->commentList->comment as $comment) { - $docSheet->getComment( (string)$comment['ref'] )->setAuthor( $authors[(string)$comment['authorId']] ); - $docSheet->getComment( (string)$comment['ref'] )->setText( $this->_parseRichText($comment->text) ); - } - } - - // Loop through VML comments - foreach ($vmlComments as $relName => $relPath) { - // Load VML comments file - $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath); - $vmlCommentsFile = simplexml_load_string( $this->_getFromZipArchive($zip, $relPath) ); - $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); - - $shapes = $vmlCommentsFile->xpath('//v:shape'); - foreach ($shapes as $shape) { - $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); - - if (isset($shape['style'])) { - $style = (string)$shape['style']; - $fillColor = strtoupper( substr( (string)$shape['fillcolor'], 1 ) ); - $column = null; - $row = null; - - $clientData = $shape->xpath('.//x:ClientData'); - if (is_array($clientData) && count($clientData) > 0) { - $clientData = $clientData[0]; - - if ( isset($clientData['ObjectType']) && (string)$clientData['ObjectType'] == 'Note' ) { - $temp = $clientData->xpath('.//x:Row'); - if (is_array($temp)) $row = $temp[0]; - - $temp = $clientData->xpath('.//x:Column'); - if (is_array($temp)) $column = $temp[0]; - } - } - - if (!is_null($column) && !is_null($row)) { - // Set comment properties - $comment = $docSheet->getCommentByColumnAndRow($column, $row + 1); - $comment->getFillColor()->setRGB( $fillColor ); - - // Parse style - $styleArray = explode(';', str_replace(' ', '', $style)); - foreach ($styleArray as $stylePair) { - $stylePair = explode(':', $stylePair); - - if ($stylePair[0] == 'margin-left') $comment->setMarginLeft($stylePair[1]); - if ($stylePair[0] == 'margin-top') $comment->setMarginTop($stylePair[1]); - if ($stylePair[0] == 'width') $comment->setWidth($stylePair[1]); - if ($stylePair[0] == 'height') $comment->setHeight($stylePair[1]); - if ($stylePair[0] == 'visibility') $comment->setVisible( $stylePair[1] == 'visible' ); - - } - } - } - } - } - - // Header/footer images - if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->_readDataOnly) { - if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { - $relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - $vmlRelationship = ''; - - foreach ($relsWorksheet->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") { - $vmlRelationship = self::dir_add("$dir/$fileWorksheet", $ele["Target"]); - } - } - - if ($vmlRelationship != '') { - // Fetch linked images - $relsVML = simplexml_load_string($this->_getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels' )); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - $drawings = array(); - foreach ($relsVML->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") { - $drawings[(string) $ele["Id"]] = self::dir_add($vmlRelationship, $ele["Target"]); - } - } - - // Fetch VML document - $vmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $vmlRelationship)); - $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); - - $hfImages = array(); - - $shapes = $vmlDrawing->xpath('//v:shape'); - foreach ($shapes as $shape) { - $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml'); - $imageData = $shape->xpath('//v:imagedata'); - $imageData = $imageData[0]; - - $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office'); - $style = self::toCSSArray( (string)$shape['style'] ); - - $hfImages[ (string)$shape['id'] ] = new PHPExcel_Worksheet_HeaderFooterDrawing(); - if (isset($imageData['title'])) { - $hfImages[ (string)$shape['id'] ]->setName( (string)$imageData['title'] ); - } - - $hfImages[ (string)$shape['id'] ]->setPath("zip://$pFilename#" . $drawings[(string)$imageData['relid']], false); - $hfImages[ (string)$shape['id'] ]->setResizeProportional(false); - $hfImages[ (string)$shape['id'] ]->setWidth($style['width']); - $hfImages[ (string)$shape['id'] ]->setHeight($style['height']); - $hfImages[ (string)$shape['id'] ]->setOffsetX($style['margin-left']); - $hfImages[ (string)$shape['id'] ]->setOffsetY($style['margin-top']); - $hfImages[ (string)$shape['id'] ]->setResizeProportional(true); - } - - $docSheet->getHeaderFooter()->setImages($hfImages); - } - } - } - - } - - // TODO: Make sure drawings and graph are loaded differently! - if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) { - $relsWorksheet = simplexml_load_string($this->_getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - $drawings = array(); - foreach ($relsWorksheet->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") { - $drawings[(string) $ele["Id"]] = self::dir_add("$dir/$fileWorksheet", $ele["Target"]); - } - } - if ($xmlSheet->drawing && !$this->_readDataOnly) { - foreach ($xmlSheet->drawing as $drawing) { - $fileDrawing = $drawings[(string) self::array_item($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")]; - $relsDrawing = simplexml_load_string($this->_getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels") ); //~ http://schemas.openxmlformats.org/package/2006/relationships"); - $images = array(); - - if ($relsDrawing && $relsDrawing->Relationship) { - foreach ($relsDrawing->Relationship as $ele) { - if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") { - $images[(string) $ele["Id"]] = self::dir_add($fileDrawing, $ele["Target"]); - } - } - } - $xmlDrawing = simplexml_load_string($this->_getFromZipArchive($zip, $fileDrawing))->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); - - if ($xmlDrawing->oneCellAnchor) { - foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) { - if ($oneCellAnchor->pic->blipFill) { - $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; - $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; - $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; - $objDrawing = new PHPExcel_Worksheet_Drawing; - $objDrawing->setName((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); - $objDrawing->setDescription((string) self::array_item($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); - $objDrawing->setPath("zip://$pFilename#" . $images[(string) self::array_item($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false); - $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex($oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1)); - $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff)); - $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff)); - $objDrawing->setResizeProportional(false); - $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cx"))); - $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($oneCellAnchor->ext->attributes(), "cy"))); - if ($xfrm) { - $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($xfrm->attributes(), "rot"))); - } - if ($outerShdw) { - $shadow = $objDrawing->getShadow(); - $shadow->setVisible(true); - $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad"))); - $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist"))); - $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($outerShdw->attributes(), "dir"))); - $shadow->setAlignment((string) self::array_item($outerShdw->attributes(), "algn")); - $shadow->getColor()->setRGB(self::array_item($outerShdw->srgbClr->attributes(), "val")); - $shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); - } - $objDrawing->setWorksheet($docSheet); - } - } - } - if ($xmlDrawing->twoCellAnchor) { - foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) { - if ($twoCellAnchor->pic->blipFill) { - $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip; - $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm; - $outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw; - $objDrawing = new PHPExcel_Worksheet_Drawing; - $objDrawing->setName((string) self::array_item($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name")); - $objDrawing->setDescription((string) self::array_item($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr")); - $objDrawing->setPath("zip://$pFilename#" . $images[(string) self::array_item($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false); - $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex($twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1)); - $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff)); - $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff)); - $objDrawing->setResizeProportional(false); - - $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($xfrm->ext->attributes(), "cx"))); - $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::array_item($xfrm->ext->attributes(), "cy"))); - - if ($xfrm) { - $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($xfrm->attributes(), "rot"))); - } - if ($outerShdw) { - $shadow = $objDrawing->getShadow(); - $shadow->setVisible(true); - $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "blurRad"))); - $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::array_item($outerShdw->attributes(), "dist"))); - $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::array_item($outerShdw->attributes(), "dir"))); - $shadow->setAlignment((string) self::array_item($outerShdw->attributes(), "algn")); - $shadow->getColor()->setRGB(self::array_item($outerShdw->srgbClr->attributes(), "val")); - $shadow->setAlpha(self::array_item($outerShdw->srgbClr->alpha->attributes(), "val") / 1000); - } - $objDrawing->setWorksheet($docSheet); - } - } - } - - } - } - } - - // Loop through definedNames - if ($xmlWorkbook->definedNames) { - foreach ($xmlWorkbook->definedNames->definedName as $definedName) { - // Extract range - $extractedRange = (string)$definedName; - $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); - if (($spos = strpos($extractedRange,'!')) !== false) { - $extractedRange = substr($extractedRange,0,$spos).str_replace('$', '', substr($extractedRange,$spos)); - } else { - $extractedRange = str_replace('$', '', $extractedRange); - } - - // Valid range? - if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') { - continue; - } - - // Some definedNames are only applicable if we are on the same sheet... - if ((string)$definedName['localSheetId'] != '' && (string)$definedName['localSheetId'] == $sheetId) { - // Switch on type - switch ((string)$definedName['name']) { - - case '_xlnm._FilterDatabase': - $docSheet->setAutoFilter($extractedRange); - break; - - case '_xlnm.Print_Titles': - // Split $extractedRange - $extractedRange = explode(',', $extractedRange); - - // Set print titles - foreach ($extractedRange as $range) { - $matches = array(); - - // check for repeating columns, e g. 'A:A' or 'A:D' - if (preg_match('/^([A-Z]+)\:([A-Z]+)$/', $range, $matches)) { - $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($matches[1], $matches[2])); - } - // check for repeating rows, e.g. '1:1' or '1:5' - elseif (preg_match('/^(\d+)\:(\d+)$/', $range, $matches)) { - $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($matches[1], $matches[2])); - } - } - break; - - case '_xlnm.Print_Area': - $rangeSets = explode(',', $extractedRange); // FIXME: what if sheetname contains comma? - $newRangeSets = array(); - foreach($rangeSets as $rangeSet) { - $range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark? - $rangeSet = isset($range[1]) ? $range[1] : $range[0]; - $newRangeSets[] = str_replace('$', '', $rangeSet); - } - $docSheet->getPageSetup()->setPrintArea(implode(',',$newRangeSets)); - break; - - default: - break; - } - } - } - } - - // Next sheet id - ++$sheetId; - } - - // Loop through definedNames - if ($xmlWorkbook->definedNames) { - foreach ($xmlWorkbook->definedNames->definedName as $definedName) { - // Extract range - $extractedRange = (string)$definedName; - $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); - if (($spos = strpos($extractedRange,'!')) !== false) { - $extractedRange = substr($extractedRange,0,$spos).str_replace('$', '', substr($extractedRange,$spos)); - } else { - $extractedRange = str_replace('$', '', $extractedRange); - } - - // Valid range? - if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') { - continue; - } - - // Some definedNames are only applicable if we are on the same sheet... - if ((string)$definedName['localSheetId'] != '') { - // Local defined name - // Switch on type - switch ((string)$definedName['name']) { - - case '_xlnm._FilterDatabase': - case '_xlnm.Print_Titles': - case '_xlnm.Print_Area': - break; - - default: - $range = explode('!', (string)$definedName); - if (count($range) == 2) { - $range[0] = str_replace("''", "'", $range[0]); - $range[0] = str_replace("'", "", $range[0]); - if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) { - $extractedRange = str_replace('$', '', $range[1]); - $scope = $docSheet->getParent()->getSheet((string)$definedName['localSheetId']); - - $excel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope) ); - } - } - break; - } - } else if (!isset($definedName['localSheetId'])) { - // "Global" definedNames - $locatedSheet = null; - $extractedSheetName = ''; - if (strpos( (string)$definedName, '!' ) !== false) { - // Extract sheet name - $extractedSheetName = PHPExcel_Worksheet::extractSheetTitle( (string)$definedName, true ); - $extractedSheetName = $extractedSheetName[0]; - - // Locate sheet - $locatedSheet = $excel->getSheetByName($extractedSheetName); - - // Modify range - $range = explode('!', $extractedRange); - $extractedRange = isset($range[1]) ? $range[1] : $range[0]; - } - - if (!is_null($locatedSheet)) { - $excel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false) ); - } - } - } - } - } - - if (!$this->_readDataOnly) { - // active sheet index - $activeTab = intval($xmlWorkbook->bookViews->workbookView["activeTab"]); // refers to old sheet index - - // keep active sheet index if sheet is still loaded, else first sheet is set as the active - if (isset($mapSheetId[$activeTab]) && $mapSheetId[$activeTab] !== null) { - $excel->setActiveSheetIndex($mapSheetId[$activeTab]); - } else { - if ($excel->getSheetCount() == 0) - { - $excel->createSheet(); - } - $excel->setActiveSheetIndex(0); - } - } - break; - } - - } - - $zip->close(); - - return $excel; - } - - private static function _readColor($color, $background=false) { - if (isset($color["rgb"])) { - return (string)$color["rgb"]; - } else if (isset($color["indexed"])) { - return PHPExcel_Style_Color::indexedColor($color["indexed"],$background)->getARGB(); - } else if (isset($color["theme"])) { - if (!is_null(self::$_theme)) { - $returnColour = self::$_theme->getColourByIndex((int)$color["theme"]); - if (isset($color["tint"])) { - $tintAdjust = (float) $color["tint"]; - $returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust); - } - return 'FF'.$returnColour; - } - } - - if ($background) { - return 'FFFFFFFF'; - } - return 'FF000000'; - } - - private static function _readStyle($docStyle, $style) { - // format code - if (isset($style->numFmt)) { - $docStyle->getNumberFormat()->setFormatCode($style->numFmt); - } - - // font - if (isset($style->font)) { - $docStyle->getFont()->setName((string) $style->font->name["val"]); - $docStyle->getFont()->setSize((string) $style->font->sz["val"]); - if (isset($style->font->b)) { - $docStyle->getFont()->setBold(!isset($style->font->b["val"]) || $style->font->b["val"] == 'true' || $style->font->b["val"] == '1'); - } - if (isset($style->font->i)) { - $docStyle->getFont()->setItalic(!isset($style->font->i["val"]) || $style->font->i["val"] == 'true' || $style->font->i["val"] == '1'); - } - if (isset($style->font->strike)) { - $docStyle->getFont()->setStrikethrough(!isset($style->font->strike["val"]) || $style->font->strike["val"] == 'true' || $style->font->strike["val"] == '1'); - } - $docStyle->getFont()->getColor()->setARGB(self::_readColor($style->font->color)); - - if (isset($style->font->u) && !isset($style->font->u["val"])) { - $docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); - } else if (isset($style->font->u) && isset($style->font->u["val"])) { - $docStyle->getFont()->setUnderline((string)$style->font->u["val"]); - } - - if (isset($style->font->vertAlign) && isset($style->font->vertAlign["val"])) { - $vertAlign = strtolower((string)$style->font->vertAlign["val"]); - if ($vertAlign == 'superscript') { - $docStyle->getFont()->setSuperScript(true); - } - if ($vertAlign == 'subscript') { - $docStyle->getFont()->setSubScript(true); - } - } - } - - // fill - if (isset($style->fill)) { - if ($style->fill->gradientFill) { - $gradientFill = $style->fill->gradientFill[0]; - if(!empty($gradientFill["type"])) { - $docStyle->getFill()->setFillType((string) $gradientFill["type"]); - } - $docStyle->getFill()->setRotation(floatval($gradientFill["degree"])); - $gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main"); - $docStyle->getFill()->getStartColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=0]"))->color) ); - $docStyle->getFill()->getEndColor()->setARGB(self::_readColor( self::array_item($gradientFill->xpath("sml:stop[@position=1]"))->color) ); - } elseif ($style->fill->patternFill) { - $patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid'; - $docStyle->getFill()->setFillType($patternType); - if ($style->fill->patternFill->fgColor) { - $docStyle->getFill()->getStartColor()->setARGB(self::_readColor($style->fill->patternFill->fgColor,true)); - } else { - $docStyle->getFill()->getStartColor()->setARGB('FF000000'); - } - if ($style->fill->patternFill->bgColor) { - $docStyle->getFill()->getEndColor()->setARGB(self::_readColor($style->fill->patternFill->bgColor,true)); - } - } - } - - // border - if (isset($style->border)) { - $diagonalUp = false; - $diagonalDown = false; - if ($style->border["diagonalUp"] == 'true' || $style->border["diagonalUp"] == 1) { - $diagonalUp = true; - } - if ($style->border["diagonalDown"] == 'true' || $style->border["diagonalDown"] == 1) { - $diagonalDown = true; - } - if ($diagonalUp == false && $diagonalDown == false) { - $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE); - } elseif ($diagonalUp == true && $diagonalDown == false) { - $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP); - } elseif ($diagonalUp == false && $diagonalDown == true) { - $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN); - } elseif ($diagonalUp == true && $diagonalDown == true) { - $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH); - } - self::_readBorder($docStyle->getBorders()->getLeft(), $style->border->left); - self::_readBorder($docStyle->getBorders()->getRight(), $style->border->right); - self::_readBorder($docStyle->getBorders()->getTop(), $style->border->top); - self::_readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom); - self::_readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal); - } - - // alignment - if (isset($style->alignment)) { - $docStyle->getAlignment()->setHorizontal((string) $style->alignment["horizontal"]); - $docStyle->getAlignment()->setVertical((string) $style->alignment["vertical"]); - - $textRotation = 0; - if ((int)$style->alignment["textRotation"] <= 90) { - $textRotation = (int)$style->alignment["textRotation"]; - } else if ((int)$style->alignment["textRotation"] > 90) { - $textRotation = 90 - (int)$style->alignment["textRotation"]; - } - - $docStyle->getAlignment()->setTextRotation(intval($textRotation)); - $docStyle->getAlignment()->setWrapText( (string)$style->alignment["wrapText"] == "true" || (string)$style->alignment["wrapText"] == "1" ); - $docStyle->getAlignment()->setShrinkToFit( (string)$style->alignment["shrinkToFit"] == "true" || (string)$style->alignment["shrinkToFit"] == "1" ); - $docStyle->getAlignment()->setIndent( intval((string)$style->alignment["indent"]) > 0 ? intval((string)$style->alignment["indent"]) : 0 ); - } - - // protection - if (isset($style->protection)) { - if (isset($style->protection['locked'])) { - if ((string)$style->protection['locked'] == 'true') { - $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_PROTECTED); - } else { - $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); - } - } - - if (isset($style->protection['hidden'])) { - if ((string)$style->protection['hidden'] == 'true') { - $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_PROTECTED); - } else { - $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); - } - } - } - } - - private static function _readBorder($docBorder, $eleBorder) { - if (isset($eleBorder["style"])) { - $docBorder->setBorderStyle((string) $eleBorder["style"]); - } - if (isset($eleBorder->color)) { - $docBorder->getColor()->setARGB(self::_readColor($eleBorder->color)); - } - } - - private function _parseRichText($is = null) { - $value = new PHPExcel_RichText(); - - if (isset($is->t)) { - $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) ); - } else { - foreach ($is->r as $run) { - if (!isset($run->rPr)) { - $objText = $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $run->t ) ); - - } else { - $objText = $value->createTextRun( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $run->t ) ); - - if (isset($run->rPr->rFont["val"])) { - $objText->getFont()->setName((string) $run->rPr->rFont["val"]); - } - - if (isset($run->rPr->sz["val"])) { - $objText->getFont()->setSize((string) $run->rPr->sz["val"]); - } - - if (isset($run->rPr->color)) { - $objText->getFont()->setColor( new PHPExcel_Style_Color( self::_readColor($run->rPr->color) ) ); - } - - if ( (isset($run->rPr->b["val"]) && ((string) $run->rPr->b["val"] == 'true' || (string) $run->rPr->b["val"] == '1')) - || (isset($run->rPr->b) && !isset($run->rPr->b["val"])) ) { - $objText->getFont()->setBold(true); - } - - if ( (isset($run->rPr->i["val"]) && ((string) $run->rPr->i["val"] == 'true' || (string) $run->rPr->i["val"] == '1')) - || (isset($run->rPr->i) && !isset($run->rPr->i["val"])) ) { - $objText->getFont()->setItalic(true); - } - - if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign["val"])) { - $vertAlign = strtolower((string)$run->rPr->vertAlign["val"]); - if ($vertAlign == 'superscript') { - $objText->getFont()->setSuperScript(true); - } - if ($vertAlign == 'subscript') { - $objText->getFont()->setSubScript(true); - } - } - - if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) { - $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); - } else if (isset($run->rPr->u) && isset($run->rPr->u["val"])) { - $objText->getFont()->setUnderline((string)$run->rPr->u["val"]); - } - - if ( (isset($run->rPr->strike["val"]) && ((string) $run->rPr->strike["val"] == 'true' || (string) $run->rPr->strike["val"] == '1')) - || (isset($run->rPr->strike) && !isset($run->rPr->strike["val"])) ) { - $objText->getFont()->setStrikethrough(true); - } - } - } - } - - return $value; - } - - private static function array_item($array, $key = 0) { - return (isset($array[$key]) ? $array[$key] : null); - } - - private static function dir_add($base, $add) { - return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); - } - - private static function toCSSArray($style) { - $style = str_replace(array("\r","\n"), "", $style); - - $temp = explode(';', $style); - $style = array(); - foreach ($temp as $item) { - $item = explode(':', $item); - - if (strpos($item[1], 'px') !== false) { - $item[1] = str_replace('px', '', $item[1]); - } - if (strpos($item[1], 'pt') !== false) { - $item[1] = str_replace('pt', '', $item[1]); - $item[1] = PHPExcel_Shared_Font::fontSizeToPixels($item[1]); - } - if (strpos($item[1], 'in') !== false) { - $item[1] = str_replace('in', '', $item[1]); - $item[1] = PHPExcel_Shared_Font::inchSizeToPixels($item[1]); - } - if (strpos($item[1], 'cm') !== false) { - $item[1] = str_replace('cm', '', $item[1]); - $item[1] = PHPExcel_Shared_Font::centimeterSizeToPixels($item[1]); - } - - $style[$item[0]] = $item[1]; - } - - return $style; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007/Theme.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007/Theme.php deleted file mode 100644 index 89e24ffea8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel2007/Theme.php +++ /dev/null @@ -1,124 +0,0 @@ -_themeName = $themeName; - $this->_colourSchemeName = $colourSchemeName; - $this->_colourMap = $colourMap; - } - - /** - * Get Theme Name - * - * @return string - */ - public function getThemeName() - { - return $this->_themeName; - } - - /** - * Get colour Scheme Name - * - * @return string - */ - public function getColourSchemeName() { - return $this->_colourSchemeName; - } - - /** - * Get colour Map Value by Position - * - * @return string - */ - public function getColourByIndex($index=0) { - if (isset($this->_colourMap[$index])) { - return $this->_colourMap[$index]; - } - return null; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5.php deleted file mode 100644 index 327dc2949b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5.php +++ /dev/null @@ -1,6667 +0,0 @@ -_data - * - * @var int - */ - private $_dataSize; - - /** - * Current position in stream - * - * @var integer - */ - private $_pos; - - /** - * Workbook to be returned by the reader. - * - * @var PHPExcel - */ - private $_phpExcel; - - /** - * Worksheet that is currently being built by the reader. - * - * @var PHPExcel_Worksheet - */ - private $_phpSheet; - - /** - * BIFF version - * - * @var int - */ - private $_version; - - /** - * Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95) - * For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE' - * - * @var string - */ - private $_codepage; - - /** - * Shared formats - * - * @var array - */ - private $_formats; - - /** - * Shared fonts - * - * @var array - */ - private $_objFonts; - - /** - * Color palette - * - * @var array - */ - private $_palette; - - /** - * Worksheets - * - * @var array - */ - private $_sheets; - - /** - * External books - * - * @var array - */ - private $_externalBooks; - - /** - * REF structures. Only applies to BIFF8. - * - * @var array - */ - private $_ref; - - /** - * External names - * - * @var array - */ - private $_externalNames; - - /** - * Defined names - * - * @var array - */ - private $_definedname; - - /** - * Shared strings. Only applies to BIFF8. - * - * @var array - */ - private $_sst; - - /** - * Panes are frozen? (in sheet currently being read). See WINDOW2 record. - * - * @var boolean - */ - private $_frozen; - - /** - * Fit printout to number of pages? (in sheet currently being read). See SHEETPR record. - * - * @var boolean - */ - private $_isFitToPages; - - /** - * Objects. One OBJ record contributes with one entry. - * - * @var array - */ - private $_objs; - - /** - * Text Objects. One TXO record corresponds with one entry. - * - * @var array - */ - private $_textObjects; - - /** - * Cell Annotations (BIFF8) - * - * @var array - */ - private $_cellNotes; - - /** - * The combined MSODRAWINGGROUP data - * - * @var string - */ - private $_drawingGroupData; - - /** - * The combined MSODRAWING data (per sheet) - * - * @var string - */ - private $_drawingData; - - /** - * Keep track of XF index - * - * @var int - */ - private $_xfIndex; - - /** - * Mapping of XF index (that is a cell XF) to final index in cellXf collection - * - * @var array - */ - private $_mapCellXfIndex; - - /** - * Mapping of XF index (that is a style XF) to final index in cellStyleXf collection - * - * @var array - */ - private $_mapCellStyleXfIndex; - - /** - * The shared formulas in a sheet. One SHAREDFMLA record contributes with one value. - * - * @var array - */ - private $_sharedFormulas; - - /** - * The shared formula parts in a sheet. One FORMULA record contributes with one value if it - * refers to a shared formula. - * - * @var array - */ - private $_sharedFormulaParts; - - - /** - * Read data only? - * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. - * If false (the default) it will read data and formatting. - * - * @return boolean - */ - public function getReadDataOnly() - { - return $this->_readDataOnly; - } - - /** - * Set read data only - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. - * Set to false (the default) to advise the Reader to read both data and formatting for cells. - * - * @param boolean $pValue - * - * @return PHPExcel_Reader_Excel5 - */ - public function setReadDataOnly($pValue = false) - { - $this->_readDataOnly = $pValue; - return $this; - } - - /** - * Get which sheets to load - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null - * indicating that all worksheets in the workbook should be loaded. - * - * @return mixed - */ - public function getLoadSheetsOnly() - { - return $this->_loadSheetsOnly; - } - - /** - * Set which sheets to load - * - * @param mixed $value - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. - * If NULL, then it tells the Reader to read all worksheets in the workbook - * - * @return PHPExcel_Reader_Excel5 - */ - public function setLoadSheetsOnly($value = null) - { - $this->_loadSheetsOnly = is_array($value) ? - $value : array($value); - return $this; - } - - /** - * Set all sheets to load - * Tells the Reader to load all worksheets from the workbook. - * - * @return PHPExcel_Reader_Excel5 - */ - public function setLoadAllSheets() - { - $this->_loadSheetsOnly = null; - return $this; - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - * @return PHPExcel_Reader_Excel5 - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Create a new PHPExcel_Reader_Excel5 instance - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - try { - // Use ParseXL for the hard work. - $ole = new PHPExcel_Shared_OLERead(); - - // get excel data - $res = $ole->read($pFilename); - return true; - - } catch (Exception $e) { - return false; - } - } - - /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object - * - * @param string $pFilename - * @throws Exception - */ - public function listWorksheetNames($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $worksheetNames = array(); - - // Read the OLE file - $this->_loadOLE($pFilename); - - // total byte size of Excel data (workbook global substream + sheet substreams) - $this->_dataSize = strlen($this->_data); - - $this->_pos = 0; - $this->_sheets = array(); - - // Parse Workbook Global Substream - while ($this->_pos < $this->_dataSize) { - $code = self::_GetInt2d($this->_data, $this->_pos); - - switch ($code) { - case self::XLS_Type_BOF: $this->_readBof(); break; - case self::XLS_Type_SHEET: $this->_readSheet(); break; - case self::XLS_Type_EOF: $this->_readDefault(); break 2; - default: $this->_readDefault(); break; - } - } - - foreach ($this->_sheets as $sheet) { - if ($sheet['sheetType'] != 0x00) { - // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module - continue; - } - - $worksheetNames[] = $sheet['name']; - } - - return $worksheetNames; - } - - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Read the OLE file - $this->_loadOLE($pFilename); - - // Initialisations - $this->_phpExcel = new PHPExcel; - $this->_phpExcel->removeSheetByIndex(0); // remove 1st sheet - if (!$this->_readDataOnly) { - $this->_phpExcel->removeCellStyleXfByIndex(0); // remove the default style - $this->_phpExcel->removeCellXfByIndex(0); // remove the default style - } - - // Read the summary information stream (containing meta data) - $this->_readSummaryInformation(); - - // Read the Additional document summary information stream (containing application-specific meta data) - $this->_readDocumentSummaryInformation(); - - // total byte size of Excel data (workbook global substream + sheet substreams) - $this->_dataSize = strlen($this->_data); - - // initialize - $this->_pos = 0; - $this->_codepage = 'CP1252'; - $this->_formats = array(); - $this->_objFonts = array(); - $this->_palette = array(); - $this->_sheets = array(); - $this->_externalBooks = array(); - $this->_ref = array(); - $this->_definedname = array(); - $this->_sst = array(); - $this->_drawingGroupData = ''; - $this->_xfIndex = ''; - $this->_mapCellXfIndex = array(); - $this->_mapCellStyleXfIndex = array(); - - // Parse Workbook Global Substream - while ($this->_pos < $this->_dataSize) { - $code = self::_GetInt2d($this->_data, $this->_pos); - - switch ($code) { - case self::XLS_Type_BOF: $this->_readBof(); break; - case self::XLS_Type_FILEPASS: $this->_readFilepass(); break; - case self::XLS_Type_CODEPAGE: $this->_readCodepage(); break; - case self::XLS_Type_DATEMODE: $this->_readDateMode(); break; - case self::XLS_Type_FONT: $this->_readFont(); break; - case self::XLS_Type_FORMAT: $this->_readFormat(); break; - case self::XLS_Type_XF: $this->_readXf(); break; - case self::XLS_Type_XFEXT: $this->_readXfExt(); break; - case self::XLS_Type_STYLE: $this->_readStyle(); break; - case self::XLS_Type_PALETTE: $this->_readPalette(); break; - case self::XLS_Type_SHEET: $this->_readSheet(); break; - case self::XLS_Type_EXTERNALBOOK: $this->_readExternalBook(); break; - case self::XLS_Type_EXTERNNAME: $this->_readExternName(); break; - case self::XLS_Type_EXTERNSHEET: $this->_readExternSheet(); break; - case self::XLS_Type_DEFINEDNAME: $this->_readDefinedName(); break; - case self::XLS_Type_MSODRAWINGGROUP: $this->_readMsoDrawingGroup(); break; - case self::XLS_Type_SST: $this->_readSst(); break; - case self::XLS_Type_EOF: $this->_readDefault(); break 2; - default: $this->_readDefault(); break; - } - } - - // Resolve indexed colors for font, fill, and border colors - // Cannot be resolved already in XF record, because PALETTE record comes afterwards - if (!$this->_readDataOnly) { - foreach ($this->_objFonts as $objFont) { - if (isset($objFont->colorIndex)) { - $color = self::_readColor($objFont->colorIndex,$this->_palette,$this->_version); - $objFont->getColor()->setRGB($color['rgb']); - } - } - - foreach ($this->_phpExcel->getCellXfCollection() as $objStyle) { - // fill start and end color - $fill = $objStyle->getFill(); - - if (isset($fill->startcolorIndex)) { - $startColor = self::_readColor($fill->startcolorIndex,$this->_palette,$this->_version); - $fill->getStartColor()->setRGB($startColor['rgb']); - } - - if (isset($fill->endcolorIndex)) { - $endColor = self::_readColor($fill->endcolorIndex,$this->_palette,$this->_version); - $fill->getEndColor()->setRGB($endColor['rgb']); - } - - // border colors - $top = $objStyle->getBorders()->getTop(); - $right = $objStyle->getBorders()->getRight(); - $bottom = $objStyle->getBorders()->getBottom(); - $left = $objStyle->getBorders()->getLeft(); - $diagonal = $objStyle->getBorders()->getDiagonal(); - - if (isset($top->colorIndex)) { - $borderTopColor = self::_readColor($top->colorIndex,$this->_palette,$this->_version); - $top->getColor()->setRGB($borderTopColor['rgb']); - } - - if (isset($right->colorIndex)) { - $borderRightColor = self::_readColor($right->colorIndex,$this->_palette,$this->_version); - $right->getColor()->setRGB($borderRightColor['rgb']); - } - - if (isset($bottom->colorIndex)) { - $borderBottomColor = self::_readColor($bottom->colorIndex,$this->_palette,$this->_version); - $bottom->getColor()->setRGB($borderBottomColor['rgb']); - } - - if (isset($left->colorIndex)) { - $borderLeftColor = self::_readColor($left->colorIndex,$this->_palette,$this->_version); - $left->getColor()->setRGB($borderLeftColor['rgb']); - } - - if (isset($diagonal->colorIndex)) { - $borderDiagonalColor = self::_readColor($diagonal->colorIndex,$this->_palette,$this->_version); - $diagonal->getColor()->setRGB($borderDiagonalColor['rgb']); - } - } - } - - // treat MSODRAWINGGROUP records, workbook-level Escher - if (!$this->_readDataOnly && $this->_drawingGroupData) { - $escherWorkbook = new PHPExcel_Shared_Escher(); - $reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook); - $escherWorkbook = $reader->load($this->_drawingGroupData); - - // debug Escher stream - //$debug = new Debug_Escher(new PHPExcel_Shared_Escher()); - //$debug->load($this->_drawingGroupData); - } - - // Parse the individual sheets - foreach ($this->_sheets as $sheet) { - - if ($sheet['sheetType'] != 0x00) { - // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module - continue; - } - - // check if sheet should be skipped - if (isset($this->_loadSheetsOnly) && !in_array($sheet['name'], $this->_loadSheetsOnly)) { - continue; - } - - // add sheet to PHPExcel object - $this->_phpSheet = $this->_phpExcel->createSheet(); - $this->_phpSheet->setTitle($sheet['name']); - $this->_phpSheet->setSheetState($sheet['sheetState']); - - $this->_pos = $sheet['offset']; - - // Initialize isFitToPages. May change after reading SHEETPR record. - $this->_isFitToPages = false; - - // Initialize drawingData - $this->_drawingData = ''; - - // Initialize objs - $this->_objs = array(); - - // Initialize shared formula parts - $this->_sharedFormulaParts = array(); - - // Initialize shared formulas - $this->_sharedFormulas = array(); - - // Initialize text objs - $this->_textObjects = array(); - - // Initialize cell annotations - $this->_cellNotes = array(); - $this->textObjRef = -1; - - while ($this->_pos <= $this->_dataSize - 4) { - $code = self::_GetInt2d($this->_data, $this->_pos); - - switch ($code) { - case self::XLS_Type_BOF: $this->_readBof(); break; - case self::XLS_Type_PRINTGRIDLINES: $this->_readPrintGridlines(); break; - case self::XLS_Type_DEFAULTROWHEIGHT: $this->_readDefaultRowHeight(); break; - case self::XLS_Type_SHEETPR: $this->_readSheetPr(); break; - case self::XLS_Type_HORIZONTALPAGEBREAKS: $this->_readHorizontalPageBreaks(); break; - case self::XLS_Type_VERTICALPAGEBREAKS: $this->_readVerticalPageBreaks(); break; - case self::XLS_Type_HEADER: $this->_readHeader(); break; - case self::XLS_Type_FOOTER: $this->_readFooter(); break; - case self::XLS_Type_HCENTER: $this->_readHcenter(); break; - case self::XLS_Type_VCENTER: $this->_readVcenter(); break; - case self::XLS_Type_LEFTMARGIN: $this->_readLeftMargin(); break; - case self::XLS_Type_RIGHTMARGIN: $this->_readRightMargin(); break; - case self::XLS_Type_TOPMARGIN: $this->_readTopMargin(); break; - case self::XLS_Type_BOTTOMMARGIN: $this->_readBottomMargin(); break; - case self::XLS_Type_PAGESETUP: $this->_readPageSetup(); break; - case self::XLS_Type_PROTECT: $this->_readProtect(); break; - case self::XLS_Type_SCENPROTECT: $this->_readScenProtect(); break; - case self::XLS_Type_OBJECTPROTECT: $this->_readObjectProtect(); break; - case self::XLS_Type_PASSWORD: $this->_readPassword(); break; - case self::XLS_Type_DEFCOLWIDTH: $this->_readDefColWidth(); break; - case self::XLS_Type_COLINFO: $this->_readColInfo(); break; - case self::XLS_Type_DIMENSION: $this->_readDefault(); break; - case self::XLS_Type_ROW: $this->_readRow(); break; - case self::XLS_Type_DBCELL: $this->_readDefault(); break; - case self::XLS_Type_RK: $this->_readRk(); break; - case self::XLS_Type_LABELSST: $this->_readLabelSst(); break; - case self::XLS_Type_MULRK: $this->_readMulRk(); break; - case self::XLS_Type_NUMBER: $this->_readNumber(); break; - case self::XLS_Type_FORMULA: $this->_readFormula(); break; - case self::XLS_Type_SHAREDFMLA: $this->_readSharedFmla(); break; - case self::XLS_Type_BOOLERR: $this->_readBoolErr(); break; - case self::XLS_Type_MULBLANK: $this->_readMulBlank(); break; - case self::XLS_Type_LABEL: $this->_readLabel(); break; - case self::XLS_Type_BLANK: $this->_readBlank(); break; - case self::XLS_Type_MSODRAWING: $this->_readMsoDrawing(); break; - case self::XLS_Type_OBJ: $this->_readObj(); break; - case self::XLS_Type_WINDOW2: $this->_readWindow2(); break; - case self::XLS_Type_SCL: $this->_readScl(); break; - case self::XLS_Type_PANE: $this->_readPane(); break; - case self::XLS_Type_SELECTION: $this->_readSelection(); break; - case self::XLS_Type_MERGEDCELLS: $this->_readMergedCells(); break; - case self::XLS_Type_HYPERLINK: $this->_readHyperLink(); break; - case self::XLS_Type_DATAVALIDATIONS: $this->_readDataValidations(); break; - case self::XLS_Type_DATAVALIDATION: $this->_readDataValidation(); break; - case self::XLS_Type_SHEETLAYOUT: $this->_readSheetLayout(); break; - case self::XLS_Type_SHEETPROTECTION: $this->_readSheetProtection(); break; - case self::XLS_Type_RANGEPROTECTION: $this->_readRangeProtection(); break; - case self::XLS_Type_NOTE: $this->_readNote(); break; - //case self::XLS_Type_IMDATA: $this->_readImData(); break; - case self::XLS_Type_TXO: $this->_readTextObject(); break; - case self::XLS_Type_CONTINUE: $this->_readContinue(); break; - case self::XLS_Type_EOF: $this->_readDefault(); break 2; - default: $this->_readDefault(); break; - } - - } - - // treat MSODRAWING records, sheet-level Escher - if (!$this->_readDataOnly && $this->_drawingData) { - $escherWorksheet = new PHPExcel_Shared_Escher(); - $reader = new PHPExcel_Reader_Excel5_Escher($escherWorksheet); - $escherWorksheet = $reader->load($this->_drawingData); - - // debug Escher stream - //$debug = new Debug_Escher(new PHPExcel_Shared_Escher()); - //$debug->load($this->_drawingData); - - // get all spContainers in one long array, so they can be mapped to OBJ records - $allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers(); - } - - // treat OBJ records - foreach ($this->_objs as $n => $obj) { -// echo '
      Object reference is ',$n,'
      '; -// var_dump($obj); -// echo '
      '; - - // the first shape container never has a corresponding OBJ record, hence $n + 1 - $spContainer = $allSpContainers[$n + 1]; - - // we skip all spContainers that are a part of a group shape since we cannot yet handle those - if ($spContainer->getNestingLevel() > 1) { - continue; - } - - // calculate the width and height of the shape - list($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($spContainer->getStartCoordinates()); - list($endColumn, $endRow) = PHPExcel_Cell::coordinateFromString($spContainer->getEndCoordinates()); - - $startOffsetX = $spContainer->getStartOffsetX(); - $startOffsetY = $spContainer->getStartOffsetY(); - $endOffsetX = $spContainer->getEndOffsetX(); - $endOffsetY = $spContainer->getEndOffsetY(); - - $width = PHPExcel_Shared_Excel5::getDistanceX($this->_phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX); - $height = PHPExcel_Shared_Excel5::getDistanceY($this->_phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY); - - // calculate offsetX and offsetY of the shape - $offsetX = $startOffsetX * PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, $startColumn) / 1024; - $offsetY = $startOffsetY * PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $startRow) / 256; - - switch ($obj['otObjType']) { - - case 0x19: - // Note -// echo 'Cell Annotation Object
      '; -// echo 'Object ID is ',$obj['idObjID'],'
      '; -// - if (isset($this->_cellNotes[$obj['idObjID']])) { - $cellNote = $this->_cellNotes[$obj['idObjID']]; - -// echo '_cellNotes[',$obj['idObjID'],']: '; -// var_dump($cellNote); -// echo '
      '; -// - if (isset($this->_textObjects[$obj['idObjID']])) { - $textObject = $this->_textObjects[$obj['idObjID']]; -// echo '_textObject: '; -// var_dump($textObject); -// echo '
      '; -// - $this->_cellNotes[$obj['idObjID']]['objTextData'] = $textObject; - $text = $textObject['text']; - } -// echo $text,'
      '; - } - break; - - case 0x08: -// echo 'Picture Object
      '; - // picture - - // get index to BSE entry (1-based) - $BSEindex = $spContainer->getOPT(0x0104); - $BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection(); - $BSE = $BSECollection[$BSEindex - 1]; - $blipType = $BSE->getBlipType(); - - // need check because some blip types are not supported by Escher reader such as EMF - if ($blip = $BSE->getBlip()) { - $ih = imagecreatefromstring($blip->getData()); - $drawing = new PHPExcel_Worksheet_MemoryDrawing(); - $drawing->setImageResource($ih); - - // width, height, offsetX, offsetY - $drawing->setResizeProportional(false); - $drawing->setWidth($width); - $drawing->setHeight($height); - $drawing->setOffsetX($offsetX); - $drawing->setOffsetY($offsetY); - - switch ($blipType) { - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: - $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG); - $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG); - break; - - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: - $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG); - $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG); - break; - } - - $drawing->setWorksheet($this->_phpSheet); - $drawing->setCoordinates($spContainer->getStartCoordinates()); - } - - break; - - default: - // other object type - break; - - } - } - - // treat SHAREDFMLA records - if ($this->_version == self::XLS_BIFF8) { - foreach ($this->_sharedFormulaParts as $cell => $baseCell) { - list($column, $row) = PHPExcel_Cell::coordinateFromString($cell); - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($column, $row, $this->_phpSheet->getTitle()) ) { - $formula = $this->_getFormulaFromStructure($this->_sharedFormulas[$baseCell], $cell); - $this->_phpSheet->getCell($cell)->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA); - } - } - } - - if (count($this->_cellNotes) > 0) { - foreach($this->_cellNotes as $note => $noteDetails) { -// echo 'Cell annotation ',$note,'
      '; -// var_dump($noteDetails); -// echo '
      '; - $cellAddress = str_replace('$','',$noteDetails['cellRef']); - $this->_phpSheet->getComment( $cellAddress ) - ->setAuthor( $noteDetails['author'] ) - ->setText($this->_parseRichText($noteDetails['objTextData']['text']) ); - } - } - } - - // add the named ranges (defined names) - foreach ($this->_definedname as $definedName) { - if ($definedName['isBuiltInName']) { - switch ($definedName['name']) { - - case pack('C', 0x06): - // print area - // in general, formula looks like this: Foo!$C$7:$J$66,Bar!$A$1:$IV$2 - - $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma? - - $extractedRanges = array(); - foreach ($ranges as $range) { - // $range should look like one of these - // Foo!$C$7:$J$66 - // Bar!$A$1:$IV$2 - - $explodes = explode('!', $range); // FIXME: what if sheetname contains exclamation mark? - $sheetName = $explodes[0]; - - if (count($explodes) == 2) { - $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66 - } - } - if ($docSheet = $this->_phpExcel->getSheetByName($sheetName)) { - $docSheet->getPageSetup()->setPrintArea(implode(',', $extractedRanges)); // C7:J66,A1:IV2 - } - break; - - case pack('C', 0x07): - // print titles (repeating rows) - // Assuming BIFF8, there are 3 cases - // 1. repeating rows - // formula looks like this: Sheet!$A$1:$IV$2 - // rows 1-2 repeat - // 2. repeating columns - // formula looks like this: Sheet!$A$1:$B$65536 - // columns A-B repeat - // 3. both repeating rows and repeating columns - // formula looks like this: Sheet!$A$1:$B$65536,Sheet!$A$1:$IV$2 - - $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma? - - foreach ($ranges as $range) { - // $range should look like this one of these - // Sheet!$A$1:$B$65536 - // Sheet!$A$1:$IV$2 - - $explodes = explode('!', $range); - - if (count($explodes) == 2) { - if ($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) { - - $extractedRange = $explodes[1]; - $extractedRange = str_replace('$', '', $extractedRange); - - $coordinateStrings = explode(':', $extractedRange); - if (count($coordinateStrings) == 2) { - list($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[0]); - list($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[1]); - - if ($firstColumn == 'A' and $lastColumn == 'IV') { - // then we have repeating rows - $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($firstRow, $lastRow)); - } elseif ($firstRow == 1 and $lastRow == 65536) { - // then we have repeating columns - $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($firstColumn, $lastColumn)); - } - } - } - } - } - break; - - } - } else { - // Extract range - $explodes = explode('!', $definedName['formula']); - - if (count($explodes) == 2) { - if ($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) { - $extractedRange = $explodes[1]; - $extractedRange = str_replace('$', '', $extractedRange); - - $localOnly = ($definedName['scope'] == 0) ? false : true; - $scope = ($definedName['scope'] == 0) ? - null : $this->_phpExcel->getSheetByName($this->_sheets[$definedName['scope'] - 1]['name']); - - $this->_phpExcel->addNamedRange( new PHPExcel_NamedRange((string)$definedName['name'], $docSheet, $extractedRange, $localOnly, $scope) ); - } - } - } - } - - return $this->_phpExcel; - } - - /** - * Use OLE reader to extract the relevant data streams from the OLE file - * - * @param string $pFilename - */ - private function _loadOLE($pFilename) - { - // OLE reader - $ole = new PHPExcel_Shared_OLERead(); - - // get excel data, - $res = $ole->read($pFilename); - // Get workbook data: workbook stream + sheet streams - $this->_data = $ole->getStream($ole->wrkbook); - - // Get summary information data - $this->_summaryInformation = $ole->getStream($ole->summaryInformation); - - // Get additional document summary information data - $this->_documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); - - // Get user-defined property data -// $this->_userDefinedProperties = $ole->getUserDefinedProperties(); - } - - /** - * Read summary information - */ - private function _readSummaryInformation() - { - if (!isset($this->_summaryInformation)) { - return; - } - - // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) - // offset: 2; size: 2; - // offset: 4; size: 2; OS version - // offset: 6; size: 2; OS indicator - // offset: 8; size: 16 - // offset: 24; size: 4; section count - $secCount = self::_GetInt4d($this->_summaryInformation, 24); - - // offset: 28; size: 16; first section's class id: e0 85 9f f2 f9 4f 68 10 ab 91 08 00 2b 27 b3 d9 - // offset: 44; size: 4 - $secOffset = self::_GetInt4d($this->_summaryInformation, 44); - - // section header - // offset: $secOffset; size: 4; section length - $secLength = self::_GetInt4d($this->_summaryInformation, $secOffset); - - // offset: $secOffset+4; size: 4; property count - $countProperties = self::_GetInt4d($this->_summaryInformation, $secOffset+4); - - // initialize code page (used to resolve string values) - $codePage = 'CP1252'; - - // offset: ($secOffset+8); size: var - // loop through property decarations and properties - for ($i = 0; $i < $countProperties; ++$i) { - - // offset: ($secOffset+8) + (8 * $i); size: 4; property ID - $id = self::_GetInt4d($this->_summaryInformation, ($secOffset+8) + (8 * $i)); - - // Use value of property id as appropriate - // offset: ($secOffset+12) + (8 * $i); size: 4; offset from beginning of section (48) - $offset = self::_GetInt4d($this->_summaryInformation, ($secOffset+12) + (8 * $i)); - - $type = self::_GetInt4d($this->_summaryInformation, $secOffset + $offset); - - // initialize property value - $value = null; - - // extract property value based on property type - switch ($type) { - case 0x02: // 2 byte signed integer - $value = self::_GetInt2d($this->_summaryInformation, $secOffset + 4 + $offset); - break; - - case 0x03: // 4 byte signed integer - $value = self::_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); - break; - - case 0x13: // 4 byte unsigned integer - // not needed yet, fix later if necessary - break; - - case 0x1E: // null-terminated string prepended by dword string length - $byteLength = self::_GetInt4d($this->_summaryInformation, $secOffset + 4 + $offset); - $value = substr($this->_summaryInformation, $secOffset + 8 + $offset, $byteLength); - $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); - $value = rtrim($value); - break; - - case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - // PHP-time - $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->_summaryInformation, $secOffset + 4 + $offset, 8)); - break; - - case 0x47: // Clipboard format - // not needed yet, fix later if necessary - break; - } - - switch ($id) { - case 0x01: // Code Page - $codePage = PHPExcel_Shared_CodePage::NumberToName($value); - break; - - case 0x02: // Title - $this->_phpExcel->getProperties()->setTitle($value); - break; - - case 0x03: // Subject - $this->_phpExcel->getProperties()->setSubject($value); - break; - - case 0x04: // Author (Creator) - $this->_phpExcel->getProperties()->setCreator($value); - break; - - case 0x05: // Keywords - $this->_phpExcel->getProperties()->setKeywords($value); - break; - - case 0x06: // Comments (Description) - $this->_phpExcel->getProperties()->setDescription($value); - break; - - case 0x07: // Template - // Not supported by PHPExcel - break; - - case 0x08: // Last Saved By (LastModifiedBy) - $this->_phpExcel->getProperties()->setLastModifiedBy($value); - break; - - case 0x09: // Revision - // Not supported by PHPExcel - break; - - case 0x0A: // Total Editing Time - // Not supported by PHPExcel - break; - - case 0x0B: // Last Printed - // Not supported by PHPExcel - break; - - case 0x0C: // Created Date/Time - $this->_phpExcel->getProperties()->setCreated($value); - break; - - case 0x0D: // Modified Date/Time - $this->_phpExcel->getProperties()->setModified($value); - break; - - case 0x0E: // Number of Pages - // Not supported by PHPExcel - break; - - case 0x0F: // Number of Words - // Not supported by PHPExcel - break; - - case 0x10: // Number of Characters - // Not supported by PHPExcel - break; - - case 0x11: // Thumbnail - // Not supported by PHPExcel - break; - - case 0x12: // Name of creating application - // Not supported by PHPExcel - break; - - case 0x13: // Security - // Not supported by PHPExcel - break; - - } - } - } - - /** - * Read additional document summary information - */ - private function _readDocumentSummaryInformation() - { - if (!isset($this->_documentSummaryInformation)) { - return; - } - - // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark) - // offset: 2; size: 2; - // offset: 4; size: 2; OS version - // offset: 6; size: 2; OS indicator - // offset: 8; size: 16 - // offset: 24; size: 4; section count - $secCount = self::_GetInt4d($this->_documentSummaryInformation, 24); -// echo '$secCount = ',$secCount,'
      '; - - // offset: 28; size: 16; first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae - // offset: 44; size: 4; first section offset - $secOffset = self::_GetInt4d($this->_documentSummaryInformation, 44); -// echo '$secOffset = ',$secOffset,'
      '; - - // section header - // offset: $secOffset; size: 4; section length - $secLength = self::_GetInt4d($this->_documentSummaryInformation, $secOffset); -// echo '$secLength = ',$secLength,'
      '; - - // offset: $secOffset+4; size: 4; property count - $countProperties = self::_GetInt4d($this->_documentSummaryInformation, $secOffset+4); -// echo '$countProperties = ',$countProperties,'
      '; - - // initialize code page (used to resolve string values) - $codePage = 'CP1252'; - - // offset: ($secOffset+8); size: var - // loop through property decarations and properties - for ($i = 0; $i < $countProperties; ++$i) { -// echo 'Property ',$i,'
      '; - // offset: ($secOffset+8) + (8 * $i); size: 4; property ID - $id = self::_GetInt4d($this->_documentSummaryInformation, ($secOffset+8) + (8 * $i)); -// echo 'ID is ',$id,'
      '; - - // Use value of property id as appropriate - // offset: 60 + 8 * $i; size: 4; offset from beginning of section (48) - $offset = self::_GetInt4d($this->_documentSummaryInformation, ($secOffset+12) + (8 * $i)); - - $type = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + $offset); -// echo 'Type is ',$type,', '; - - // initialize property value - $value = null; - - // extract property value based on property type - switch ($type) { - case 0x02: // 2 byte signed integer - $value = self::_GetInt2d($this->_documentSummaryInformation, $secOffset + 4 + $offset); - break; - - case 0x03: // 4 byte signed integer - $value = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); - break; - - case 0x13: // 4 byte unsigned integer - // not needed yet, fix later if necessary - break; - - case 0x1E: // null-terminated string prepended by dword string length - $byteLength = self::_GetInt4d($this->_documentSummaryInformation, $secOffset + 4 + $offset); - $value = substr($this->_documentSummaryInformation, $secOffset + 8 + $offset, $byteLength); - $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage); - $value = rtrim($value); - break; - - case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) - // PHP-Time - $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->_documentSummaryInformation, $secOffset + 4 + $offset, 8)); - break; - - case 0x47: // Clipboard format - // not needed yet, fix later if necessary - break; - } - - switch ($id) { - case 0x01: // Code Page - $codePage = PHPExcel_Shared_CodePage::NumberToName($value); - break; - - case 0x02: // Category - $this->_phpExcel->getProperties()->setCategory($value); - break; - - case 0x03: // Presentation Target - // Not supported by PHPExcel - break; - - case 0x04: // Bytes - // Not supported by PHPExcel - break; - - case 0x05: // Lines - // Not supported by PHPExcel - break; - - case 0x06: // Paragraphs - // Not supported by PHPExcel - break; - - case 0x07: // Slides - // Not supported by PHPExcel - break; - - case 0x08: // Notes - // Not supported by PHPExcel - break; - - case 0x09: // Hidden Slides - // Not supported by PHPExcel - break; - - case 0x0A: // MM Clips - // Not supported by PHPExcel - break; - - case 0x0B: // Scale Crop - // Not supported by PHPExcel - break; - - case 0x0C: // Heading Pairs - // Not supported by PHPExcel - break; - - case 0x0D: // Titles of Parts - // Not supported by PHPExcel - break; - - case 0x0E: // Manager - $this->_phpExcel->getProperties()->setManager($value); - break; - - case 0x0F: // Company - $this->_phpExcel->getProperties()->setCompany($value); - break; - - case 0x10: // Links up-to-date - // Not supported by PHPExcel - break; - - } - } - } - - /** - * Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record. - */ - private function _readDefault() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); -// $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - } - - - /** - * The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions, - * this record stores a note (cell note). This feature was significantly enhanced in Excel 97. - */ - private function _readNote() - { -// echo 'Read Cell Annotation
      '; - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - $cellAddress = $this->_readBIFF8CellAddress(substr($recordData, 0, 4)); - if ($this->_version == self::XLS_BIFF8) { - $noteObjID = self::_GetInt2d($recordData, 6); - $noteAuthor = self::_readUnicodeStringLong(substr($recordData, 8)); - $noteAuthor = $noteAuthor['value']; -// echo 'Note Address=',$cellAddress,'
      '; -// echo 'Note Object ID=',$noteObjID,'
      '; -// echo 'Note Author=',$noteAuthor,'
      '; -// - $this->_cellNotes[$noteObjID] = array('cellRef' => $cellAddress, - 'objectID' => $noteObjID, - 'author' => $noteAuthor - ); - } else { - $extension = false; - if ($cellAddress == '$B$65536') { - // If the address row is -1 and the column is 0, (which translates as $B$65536) then this is a continuation - // note from the previous cell annotation. We're not yet handling this, so annotations longer than the - // max 2048 bytes will probably throw a wobbly. - $row = self::_GetInt2d($recordData, 0); - $extension = true; - $cellAddress = array_pop(array_keys($this->_phpSheet->getComments())); - } -// echo 'Note Address=',$cellAddress,'
      '; - - $cellAddress = str_replace('$','',$cellAddress); - $noteLength = self::_GetInt2d($recordData, 4); - $noteText = trim(substr($recordData, 6)); -// echo 'Note Length=',$noteLength,'
      '; -// echo 'Note Text=',$noteText,'
      '; - - if ($extension) { - // Concatenate this extension with the currently set comment for the cell - $comment = $this->_phpSheet->getComment( $cellAddress ); - $commentText = $comment->getText()->getPlainText(); - $comment->setText($this->_parseRichText($commentText.$noteText) ); - } else { - // Set comment for the cell - $this->_phpSheet->getComment( $cellAddress ) -// ->setAuthor( $author ) - ->setText($this->_parseRichText($noteText) ); - } - } - - } - - /** - * The TEXT Object record contains the text associated with a cell annotation. - */ - private function _readTextObject() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // recordData consists of an array of subrecords looking like this: - // grbit: 2 bytes; Option Flags - // rot: 2 bytes; rotation - // cchText: 2 bytes; length of the text (in the first continue record) - // cbRuns: 2 bytes; length of the formatting (in the second continue record) - // followed by the continuation records containing the actual text and formatting - $grbitOpts = self::_GetInt2d($recordData, 0); - $rot = self::_GetInt2d($recordData, 2); - $cchText = self::_GetInt2d($recordData, 10); - $cbRuns = self::_GetInt2d($recordData, 12); - $text = $this->_getSplicedRecordData(); - - $this->_textObjects[$this->textObjRef] = array( - 'text' => substr($text["recordData"],$text["spliceOffsets"][0]+1,$cchText), - 'format' => substr($text["recordData"],$text["spliceOffsets"][1],$cbRuns), - 'alignment' => $grbitOpts, - 'rotation' => $rot - ); - -// echo '_readTextObject()
      '; -// var_dump($this->_textObjects[$this->textObjRef]); -// echo '
      '; - } - - /** - * Read BOF - */ - private function _readBof() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 2; size: 2; type of the following data - $substreamType = self::_GetInt2d($recordData, 2); - - switch ($substreamType) { - case self::XLS_WorkbookGlobals: - $version = self::_GetInt2d($recordData, 0); - if (($version != self::XLS_BIFF8) && ($version != self::XLS_BIFF7)) { - throw new Exception('Cannot read this Excel file. Version is too old.'); - } - $this->_version = $version; - break; - - case self::XLS_Worksheet: - // do not use this version information for anything - // it is unreliable (OpenOffice doc, 5.8), use only version information from the global stream - break; - - default: - // substream, e.g. chart - // just skip the entire substream - do { - $code = self::_GetInt2d($this->_data, $this->_pos); - $this->_readDefault(); - } while ($code != self::XLS_Type_EOF && $this->_pos < $this->_dataSize); - break; - } - } - - /** - * FILEPASS - * - * This record is part of the File Protection Block. It - * contains information about the read/write password of the - * file. All record contents following this record will be - * encrypted. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readFilepass() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); -// $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - throw new Exception('Cannot read encrypted file'); - } - - /** - * CODEPAGE - * - * This record stores the text encoding used to write byte - * strings, stored as MS Windows code page identifier. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readCodepage() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; code page identifier - $codepage = self::_GetInt2d($recordData, 0); - - $this->_codepage = PHPExcel_Shared_CodePage::NumberToName($codepage); - } - - /** - * DATEMODE - * - * This record specifies the base date for displaying date - * values. All dates are stored as count of days past this - * base date. In BIFF2-BIFF4 this record is part of the - * Calculation Settings Block. In BIFF5-BIFF8 it is - * stored in the Workbook Globals Substream. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readDateMode() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); - if (ord($recordData{0}) == 1) { - PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); - } - } - - /** - * Read a FONT record - */ - private function _readFont() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - $objFont = new PHPExcel_Style_Font(); - - // offset: 0; size: 2; height of the font (in twips = 1/20 of a point) - $size = self::_GetInt2d($recordData, 0); - $objFont->setSize($size / 20); - - // offset: 2; size: 2; option flags - // bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8) - // bit: 1; mask 0x0002; italic - $isItalic = (0x0002 & self::_GetInt2d($recordData, 2)) >> 1; - if ($isItalic) $objFont->setItalic(true); - - // bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8) - // bit: 3; mask 0x0008; strike - $isStrike = (0x0008 & self::_GetInt2d($recordData, 2)) >> 3; - if ($isStrike) $objFont->setStrikethrough(true); - - // offset: 4; size: 2; colour index - $colorIndex = self::_GetInt2d($recordData, 4); - $objFont->colorIndex = $colorIndex; - - // offset: 6; size: 2; font weight - $weight = self::_GetInt2d($recordData, 6); - switch ($weight) { - case 0x02BC: - $objFont->setBold(true); - break; - } - - // offset: 8; size: 2; escapement type - $escapement = self::_GetInt2d($recordData, 8); - switch ($escapement) { - case 0x0001: - $objFont->setSuperScript(true); - break; - case 0x0002: - $objFont->setSubScript(true); - break; - } - - // offset: 10; size: 1; underline type - $underlineType = ord($recordData{10}); - switch ($underlineType) { - case 0x00: - break; // no underline - case 0x01: - $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); - break; - case 0x02: - $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE); - break; - case 0x21: - $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING); - break; - case 0x22: - $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING); - break; - } - - // offset: 11; size: 1; font family - // offset: 12; size: 1; character set - // offset: 13; size: 1; not used - // offset: 14; size: var; font name - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringShort(substr($recordData, 14)); - } else { - $string = $this->_readByteStringShort(substr($recordData, 14)); - } - $objFont->setName($string['value']); - - $this->_objFonts[] = $objFont; - } - } - - /** - * FORMAT - * - * This record contains information about a number format. - * All FORMAT records occur together in a sequential list. - * - * In BIFF2-BIFF4 other records referencing a FORMAT record - * contain a zero-based index into this list. From BIFF5 on - * the FORMAT record contains the index itself that will be - * used by other records. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readFormat() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - $indexCode = self::_GetInt2d($recordData, 0); - - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringLong(substr($recordData, 2)); - } else { - // BIFF7 - $string = $this->_readByteStringShort(substr($recordData, 2)); - } - - $formatString = $string['value']; - $this->_formats[$indexCode] = $formatString; - } - } - - /** - * XF - Extended Format - * - * This record contains formatting information for cells, rows, columns or styles. - * According to http://support.microsoft.com/kb/147732 there are always at least 15 cell style XF - * and 1 cell XF. - * Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF - * and XF record 15 is a cell XF - * We only read the first cell style XF and skip the remaining cell style XF records - * We read all cell XF records. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readXf() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - $objStyle = new PHPExcel_Style(); - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; Index to FONT record - if (self::_GetInt2d($recordData, 0) < 4) { - $fontIndex = self::_GetInt2d($recordData, 0); - } else { - // this has to do with that index 4 is omitted in all BIFF versions for some strange reason - // check the OpenOffice documentation of the FONT record - $fontIndex = self::_GetInt2d($recordData, 0) - 1; - } - $objStyle->setFont($this->_objFonts[$fontIndex]); - - // offset: 2; size: 2; Index to FORMAT record - $numberFormatIndex = self::_GetInt2d($recordData, 2); - if (isset($this->_formats[$numberFormatIndex])) { - // then we have user-defined format code - $numberformat = array('code' => $this->_formats[$numberFormatIndex]); - } elseif (($code = PHPExcel_Style_NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') { - // then we have built-in format code - $numberformat = array('code' => $code); - } else { - // we set the general format code - $numberformat = array('code' => 'General'); - } - $objStyle->getNumberFormat()->setFormatCode($numberformat['code']); - - // offset: 4; size: 2; XF type, cell protection, and parent style XF - // bit 2-0; mask 0x0007; XF_TYPE_PROT - $xfTypeProt = self::_GetInt2d($recordData, 4); - // bit 0; mask 0x01; 1 = cell is locked - $isLocked = (0x01 & $xfTypeProt) >> 0; - $objStyle->getProtection()->setLocked($isLocked ? - PHPExcel_Style_Protection::PROTECTION_INHERIT : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); - - // bit 1; mask 0x02; 1 = Formula is hidden - $isHidden = (0x02 & $xfTypeProt) >> 1; - $objStyle->getProtection()->setHidden($isHidden ? - PHPExcel_Style_Protection::PROTECTION_PROTECTED : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED); - - // bit 2; mask 0x04; 0 = Cell XF, 1 = Cell Style XF - $isCellStyleXf = (0x04 & $xfTypeProt) >> 2; - - // offset: 6; size: 1; Alignment and text break - // bit 2-0, mask 0x07; horizontal alignment - $horAlign = (0x07 & ord($recordData{6})) >> 0; - switch ($horAlign) { - case 0: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL); - break; - case 1: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); - break; - case 2: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - break; - case 3: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - break; - case 5: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY); - break; - case 6: - $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS); - break; - } - // bit 3, mask 0x08; wrap text - $wrapText = (0x08 & ord($recordData{6})) >> 3; - switch ($wrapText) { - case 0: - $objStyle->getAlignment()->setWrapText(false); - break; - case 1: - $objStyle->getAlignment()->setWrapText(true); - break; - } - // bit 6-4, mask 0x70; vertical alignment - $vertAlign = (0x70 & ord($recordData{6})) >> 4; - switch ($vertAlign) { - case 0: - $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP); - break; - case 1: - $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); - break; - case 2: - $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_BOTTOM); - break; - case 3: - $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_JUSTIFY); - break; - } - - if ($this->_version == self::XLS_BIFF8) { - // offset: 7; size: 1; XF_ROTATION: Text rotation angle - $angle = ord($recordData{7}); - $rotation = 0; - if ($angle <= 90) { - $rotation = $angle; - } else if ($angle <= 180) { - $rotation = 90 - $angle; - } else if ($angle == 255) { - $rotation = -165; - } - $objStyle->getAlignment()->setTextRotation($rotation); - - // offset: 8; size: 1; Indentation, shrink to cell size, and text direction - // bit: 3-0; mask: 0x0F; indent level - $indent = (0x0F & ord($recordData{8})) >> 0; - $objStyle->getAlignment()->setIndent($indent); - - // bit: 4; mask: 0x10; 1 = shrink content to fit into cell - $shrinkToFit = (0x10 & ord($recordData{8})) >> 4; - switch ($shrinkToFit) { - case 0: - $objStyle->getAlignment()->setShrinkToFit(false); - break; - case 1: - $objStyle->getAlignment()->setShrinkToFit(true); - break; - } - - // offset: 9; size: 1; Flags used for attribute groups - - // offset: 10; size: 4; Cell border lines and background area - // bit: 3-0; mask: 0x0000000F; left style - if ($bordersLeftStyle = self::_mapBorderStyle((0x0000000F & self::_GetInt4d($recordData, 10)) >> 0)) { - $objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle); - } - // bit: 7-4; mask: 0x000000F0; right style - if ($bordersRightStyle = self::_mapBorderStyle((0x000000F0 & self::_GetInt4d($recordData, 10)) >> 4)) { - $objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle); - } - // bit: 11-8; mask: 0x00000F00; top style - if ($bordersTopStyle = self::_mapBorderStyle((0x00000F00 & self::_GetInt4d($recordData, 10)) >> 8)) { - $objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle); - } - // bit: 15-12; mask: 0x0000F000; bottom style - if ($bordersBottomStyle = self::_mapBorderStyle((0x0000F000 & self::_GetInt4d($recordData, 10)) >> 12)) { - $objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle); - } - // bit: 22-16; mask: 0x007F0000; left color - $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & self::_GetInt4d($recordData, 10)) >> 16; - - // bit: 29-23; mask: 0x3F800000; right color - $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & self::_GetInt4d($recordData, 10)) >> 23; - - // bit: 30; mask: 0x40000000; 1 = diagonal line from top left to right bottom - $diagonalDown = (0x40000000 & self::_GetInt4d($recordData, 10)) >> 30 ? - true : false; - - // bit: 31; mask: 0x80000000; 1 = diagonal line from bottom left to top right - $diagonalUp = (0x80000000 & self::_GetInt4d($recordData, 10)) >> 31 ? - true : false; - - if ($diagonalUp == false && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE); - } elseif ($diagonalUp == true && $diagonalDown == false) { - $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP); - } elseif ($diagonalUp == false && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN); - } elseif ($diagonalUp == true && $diagonalDown == true) { - $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH); - } - - // offset: 14; size: 4; - // bit: 6-0; mask: 0x0000007F; top color - $objStyle->getBorders()->getTop()->colorIndex = (0x0000007F & self::_GetInt4d($recordData, 14)) >> 0; - - // bit: 13-7; mask: 0x00003F80; bottom color - $objStyle->getBorders()->getBottom()->colorIndex = (0x00003F80 & self::_GetInt4d($recordData, 14)) >> 7; - - // bit: 20-14; mask: 0x001FC000; diagonal color - $objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::_GetInt4d($recordData, 14)) >> 14; - - // bit: 24-21; mask: 0x01E00000; diagonal style - if ($bordersDiagonalStyle = self::_mapBorderStyle((0x01E00000 & self::_GetInt4d($recordData, 14)) >> 21)) { - $objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle); - } - - // bit: 31-26; mask: 0xFC000000 fill pattern - if ($fillType = self::_mapFillPattern((0xFC000000 & self::_GetInt4d($recordData, 14)) >> 26)) { - $objStyle->getFill()->setFillType($fillType); - } - // offset: 18; size: 2; pattern and background colour - // bit: 6-0; mask: 0x007F; color index for pattern color - $objStyle->getFill()->startcolorIndex = (0x007F & self::_GetInt2d($recordData, 18)) >> 0; - - // bit: 13-7; mask: 0x3F80; color index for pattern background - $objStyle->getFill()->endcolorIndex = (0x3F80 & self::_GetInt2d($recordData, 18)) >> 7; - } else { - // BIFF5 - - // offset: 7; size: 1; Text orientation and flags - $orientationAndFlags = ord($recordData{7}); - - // bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation - $xfOrientation = (0x03 & $orientationAndFlags) >> 0; - switch ($xfOrientation) { - case 0: - $objStyle->getAlignment()->setTextRotation(0); - break; - case 1: - $objStyle->getAlignment()->setTextRotation(-165); - break; - case 2: - $objStyle->getAlignment()->setTextRotation(90); - break; - case 3: - $objStyle->getAlignment()->setTextRotation(-90); - break; - } - - // offset: 8; size: 4; cell border lines and background area - $borderAndBackground = self::_GetInt4d($recordData, 8); - - // bit: 6-0; mask: 0x0000007F; color index for pattern color - $objStyle->getFill()->startcolorIndex = (0x0000007F & $borderAndBackground) >> 0; - - // bit: 13-7; mask: 0x00003F80; color index for pattern background - $objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7; - - // bit: 21-16; mask: 0x003F0000; fill pattern - $objStyle->getFill()->setFillType(self::_mapFillPattern((0x003F0000 & $borderAndBackground) >> 16)); - - // bit: 24-22; mask: 0x01C00000; bottom line style - $objStyle->getBorders()->getBottom()->setBorderStyle(self::_mapBorderStyle((0x01C00000 & $borderAndBackground) >> 22)); - - // bit: 31-25; mask: 0xFE000000; bottom line color - $objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25; - - // offset: 12; size: 4; cell border lines - $borderLines = self::_GetInt4d($recordData, 12); - - // bit: 2-0; mask: 0x00000007; top line style - $objStyle->getBorders()->getTop()->setBorderStyle(self::_mapBorderStyle((0x00000007 & $borderLines) >> 0)); - - // bit: 5-3; mask: 0x00000038; left line style - $objStyle->getBorders()->getLeft()->setBorderStyle(self::_mapBorderStyle((0x00000038 & $borderLines) >> 3)); - - // bit: 8-6; mask: 0x000001C0; right line style - $objStyle->getBorders()->getRight()->setBorderStyle(self::_mapBorderStyle((0x000001C0 & $borderLines) >> 6)); - - // bit: 15-9; mask: 0x0000FE00; top line color index - $objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9; - - // bit: 22-16; mask: 0x007F0000; left line color index - $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & $borderLines) >> 16; - - // bit: 29-23; mask: 0x3F800000; right line color index - $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & $borderLines) >> 23; - } - - // add cellStyleXf or cellXf and update mapping - if ($isCellStyleXf) { - // we only read one style XF record which is always the first - if ($this->_xfIndex == 0) { - $this->_phpExcel->addCellStyleXf($objStyle); - $this->_mapCellStyleXfIndex[$this->_xfIndex] = 0; - } - } else { - // we read all cell XF records - $this->_phpExcel->addCellXf($objStyle); - $this->_mapCellXfIndex[$this->_xfIndex] = count($this->_phpExcel->getCellXfCollection()) - 1; - } - - // update XF index for when we read next record - ++$this->_xfIndex; - } - } - - /** - * - */ - private function _readXfExt() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; 0x087D = repeated header - - // offset: 2; size: 2 - - // offset: 4; size: 8; not used - - // offset: 12; size: 2; record version - - // offset: 14; size: 2; index to XF record which this record modifies - $ixfe = self::_GetInt2d($recordData, 14); - - // offset: 16; size: 2; not used - - // offset: 18; size: 2; number of extension properties that follow - $cexts = self::_GetInt2d($recordData, 18); - - // start reading the actual extension data - $offset = 20; - while ($offset < $length) { - // extension type - $extType = self::_GetInt2d($recordData, $offset); - - // extension length - $cb = self::_GetInt2d($recordData, $offset + 2); - - // extension data - $extData = substr($recordData, $offset + 4, $cb); - - switch ($extType) { - case 4: // fill start color - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $fill = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFill(); - $fill->getStartColor()->setRGB($rgb); - unset($fill->startcolorIndex); // normal color index does not apply, discard - } - } - break; - - case 5: // fill end color - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $fill = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFill(); - $fill->getEndColor()->setRGB($rgb); - unset($fill->endcolorIndex); // normal color index does not apply, discard - } - } - break; - - case 7: // border color top - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $top = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getTop(); - $top->getColor()->setRGB($rgb); - unset($top->colorIndex); // normal color index does not apply, discard - } - } - break; - - case 8: // border color bottom - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $bottom = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getBottom(); - $bottom->getColor()->setRGB($rgb); - unset($bottom->colorIndex); // normal color index does not apply, discard - } - } - break; - - case 9: // border color left - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $left = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getLeft(); - $left->getColor()->setRGB($rgb); - unset($left->colorIndex); // normal color index does not apply, discard - } - } - break; - - case 10: // border color right - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $right = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getRight(); - $right->getColor()->setRGB($rgb); - unset($right->colorIndex); // normal color index does not apply, discard - } - } - break; - - case 11: // border color diagonal - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $diagonal = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getDiagonal(); - $diagonal->getColor()->setRGB($rgb); - unset($diagonal->colorIndex); // normal color index does not apply, discard - } - } - break; - - case 13: // font color - $xclfType = self::_GetInt2d($extData, 0); // color type - $xclrValue = substr($extData, 4, 4); // color value (value based on color type) - - if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); - - // modify the relevant style property - if ( isset($this->_mapCellXfIndex[$ixfe]) ) { - $font = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFont(); - $font->getColor()->setRGB($rgb); - unset($font->colorIndex); // normal color index does not apply, discard - } - } - break; - } - - $offset += $cb; - } - } - - } - - /** - * Read STYLE record - */ - private function _readStyle() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; index to XF record and flag for built-in style - $ixfe = self::_GetInt2d($recordData, 0); - - // bit: 11-0; mask 0x0FFF; index to XF record - $xfIndex = (0x0FFF & $ixfe) >> 0; - - // bit: 15; mask 0x8000; 0 = user-defined style, 1 = built-in style - $isBuiltIn = (bool) ((0x8000 & $ixfe) >> 15); - - if ($isBuiltIn) { - // offset: 2; size: 1; identifier for built-in style - $builtInId = ord($recordData{2}); - - switch ($builtInId) { - case 0x00: - // currently, we are not using this for anything - break; - - default: - break; - } - - } else { - // user-defined; not supported by PHPExcel - } - } - } - - /** - * Read PALETTE record - */ - private function _readPalette() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; number of following colors - $nm = self::_GetInt2d($recordData, 0); - - // list of RGB colors - for ($i = 0; $i < $nm; ++$i) { - $rgb = substr($recordData, 2 + 4 * $i, 4); - $this->_palette[] = self::_readRGB($rgb); - } - } - } - - /** - * SHEET - * - * This record is located in the Workbook Globals - * Substream and represents a sheet inside the workbook. - * One SHEET record is written for each sheet. It stores the - * sheet name and a stream offset to the BOF record of the - * respective Sheet Substream within the Workbook Stream. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readSheet() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 4; absolute stream position of the BOF record of the sheet - $rec_offset = self::_GetInt4d($recordData, 0); - - // offset: 4; size: 1; sheet state - switch (ord($recordData{4})) { - case 0x00: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; break; - case 0x01: $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN; break; - case 0x02: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN; break; - default: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; break; - } - - // offset: 5; size: 1; sheet type - $sheetType = ord($recordData{5}); - - // offset: 6; size: var; sheet name - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringShort(substr($recordData, 6)); - $rec_name = $string['value']; - } elseif ($this->_version == self::XLS_BIFF7) { - $string = $this->_readByteStringShort(substr($recordData, 6)); - $rec_name = $string['value']; - } - - $this->_sheets[] = array( - 'name' => $rec_name, - 'offset' => $rec_offset, - 'sheetState' => $sheetState, - 'sheetType' => $sheetType, - ); - } - - /** - * Read EXTERNALBOOK record - */ - private function _readExternalBook() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset within record data - $offset = 0; - - // there are 4 types of records - if (strlen($recordData) > 4) { - // external reference - // offset: 0; size: 2; number of sheet names ($nm) - $nm = self::_GetInt2d($recordData, 0); - $offset += 2; - - // offset: 2; size: var; encoded URL without sheet name (Unicode string, 16-bit length) - $encodedUrlString = self::_readUnicodeStringLong(substr($recordData, 2)); - $offset += $encodedUrlString['size']; - - // offset: var; size: var; list of $nm sheet names (Unicode strings, 16-bit length) - $externalSheetNames = array(); - for ($i = 0; $i < $nm; ++$i) { - $externalSheetNameString = self::_readUnicodeStringLong(substr($recordData, $offset)); - $externalSheetNames[] = $externalSheetNameString['value']; - $offset += $externalSheetNameString['size']; - } - - // store the record data - $this->_externalBooks[] = array( - 'type' => 'external', - 'encodedUrl' => $encodedUrlString['value'], - 'externalSheetNames' => $externalSheetNames, - ); - - } elseif (substr($recordData, 2, 2) == pack('CC', 0x01, 0x04)) { - // internal reference - // offset: 0; size: 2; number of sheet in this document - // offset: 2; size: 2; 0x01 0x04 - $this->_externalBooks[] = array( - 'type' => 'internal', - ); - } elseif (substr($recordData, 0, 4) == pack('vCC', 0x0001, 0x01, 0x3A)) { - // add-in function - // offset: 0; size: 2; 0x0001 - $this->_externalBooks[] = array( - 'type' => 'addInFunction', - ); - } elseif (substr($recordData, 0, 2) == pack('v', 0x0000)) { - // DDE links, OLE links - // offset: 0; size: 2; 0x0000 - // offset: 2; size: var; encoded source document name - $this->_externalBooks[] = array( - 'type' => 'DDEorOLE', - ); - } - } - - /** - * Read EXTERNNAME record. - */ - private function _readExternName() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // external sheet references provided for named cells - if ($this->_version == self::XLS_BIFF8) { - // offset: 0; size: 2; options - $options = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; - - // offset: 4; size: 2; not used - - // offset: 6; size: var - $nameString = self::_readUnicodeStringShort(substr($recordData, 6)); - - // offset: var; size: var; formula data - $offset = 6 + $nameString['size']; - $formula = $this->_getFormulaFromStructure(substr($recordData, $offset)); - - $this->_externalNames[] = array( - 'name' => $nameString['value'], - 'formula' => $formula, - ); - } - } - - /** - * Read EXTERNSHEET record - */ - private function _readExternSheet() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // external sheet references provided for named cells - if ($this->_version == self::XLS_BIFF8) { - // offset: 0; size: 2; number of following ref structures - $nm = self::_GetInt2d($recordData, 0); - for ($i = 0; $i < $nm; ++$i) { - $this->_ref[] = array( - // offset: 2 + 6 * $i; index to EXTERNALBOOK record - 'externalBookIndex' => self::_GetInt2d($recordData, 2 + 6 * $i), - // offset: 4 + 6 * $i; index to first sheet in EXTERNALBOOK record - 'firstSheetIndex' => self::_GetInt2d($recordData, 4 + 6 * $i), - // offset: 6 + 6 * $i; index to last sheet in EXTERNALBOOK record - 'lastSheetIndex' => self::_GetInt2d($recordData, 6 + 6 * $i), - ); - } - } - } - - /** - * DEFINEDNAME - * - * This record is part of a Link Table. It contains the name - * and the token array of an internal defined name. Token - * arrays of defined names contain tokens with aberrant - * token classes. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readDefinedName() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8) { - // retrieves named cells - - // offset: 0; size: 2; option flags - $opts = self::_GetInt2d($recordData, 0); - - // bit: 5; mask: 0x0020; 0 = user-defined name, 1 = built-in-name - $isBuiltInName = (0x0020 & $opts) >> 5; - - // offset: 2; size: 1; keyboard shortcut - - // offset: 3; size: 1; length of the name (character count) - $nlen = ord($recordData{3}); - - // offset: 4; size: 2; size of the formula data (it can happen that this is zero) - // note: there can also be additional data, this is not included in $flen - $flen = self::_GetInt2d($recordData, 4); - - // offset: 8; size: 2; 0=Global name, otherwise index to sheet (1-based) - $scope = self::_GetInt2d($recordData, 8); - - // offset: 14; size: var; Name (Unicode string without length field) - $string = self::_readUnicodeString(substr($recordData, 14), $nlen); - - // offset: var; size: $flen; formula data - $offset = 14 + $string['size']; - $formulaStructure = pack('v', $flen) . substr($recordData, $offset); - - try { - $formula = $this->_getFormulaFromStructure($formulaStructure); - } catch (Exception $e) { - $formula = ''; - } - - $this->_definedname[] = array( - 'isBuiltInName' => $isBuiltInName, - 'name' => $string['value'], - 'formula' => $formula, - 'scope' => $scope, - ); - } - } - - /** - * Read MSODRAWINGGROUP record - */ - private function _readMsoDrawingGroup() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - - // get spliced record data - $splicedRecordData = $this->_getSplicedRecordData(); - $recordData = $splicedRecordData['recordData']; - - $this->_drawingGroupData .= $recordData; - } - - /** - * SST - Shared String Table - * - * This record contains a list of all strings used anywhere - * in the workbook. Each string occurs only once. The - * workbook uses indexes into the list to reference the - * strings. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - **/ - private function _readSst() - { - // offset within (spliced) record data - $pos = 0; - - // get spliced record data - $splicedRecordData = $this->_getSplicedRecordData(); - - $recordData = $splicedRecordData['recordData']; - $spliceOffsets = $splicedRecordData['spliceOffsets']; - - // offset: 0; size: 4; total number of strings in the workbook - $pos += 4; - - // offset: 4; size: 4; number of following strings ($nm) - $nm = self::_GetInt4d($recordData, 4); - $pos += 4; - - // loop through the Unicode strings (16-bit length) - for ($i = 0; $i < $nm; ++$i) { - - // number of characters in the Unicode string - $numChars = self::_GetInt2d($recordData, $pos); - $pos += 2; - - // option flags - $optionFlags = ord($recordData{$pos}); - ++$pos; - - // bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed - $isCompressed = (($optionFlags & 0x01) == 0) ; - - // bit: 2; mask: 0x02; 0 = ordinary; 1 = Asian phonetic - $hasAsian = (($optionFlags & 0x04) != 0); - - // bit: 3; mask: 0x03; 0 = ordinary; 1 = Rich-Text - $hasRichText = (($optionFlags & 0x08) != 0); - - if ($hasRichText) { - // number of Rich-Text formatting runs - $formattingRuns = self::_GetInt2d($recordData, $pos); - $pos += 2; - } - - if ($hasAsian) { - // size of Asian phonetic setting - $extendedRunLength = self::_GetInt4d($recordData, $pos); - $pos += 4; - } - - // expected byte length of character array if not split - $len = ($isCompressed) ? $numChars : $numChars * 2; - - // look up limit position - foreach ($spliceOffsets as $spliceOffset) { - // it can happen that the string is empty, therefore we need - // <= and not just < - if ($pos <= $spliceOffset) { - $limitpos = $spliceOffset; - break; - } - } - - if ($pos + $len <= $limitpos) { - // character array is not split between records - - $retstr = substr($recordData, $pos, $len); - $pos += $len; - - } else { - // character array is split between records - - // first part of character array - $retstr = substr($recordData, $pos, $limitpos - $pos); - - $bytesRead = $limitpos - $pos; - - // remaining characters in Unicode string - $charsLeft = $numChars - (($isCompressed) ? $bytesRead : ($bytesRead / 2)); - - $pos = $limitpos; - - // keep reading the characters - while ($charsLeft > 0) { - - // look up next limit position, in case the string span more than one continue record - foreach ($spliceOffsets as $spliceOffset) { - if ($pos < $spliceOffset) { - $limitpos = $spliceOffset; - break; - } - } - - // repeated option flags - // OpenOffice.org documentation 5.21 - $option = ord($recordData{$pos}); - ++$pos; - - if ($isCompressed && ($option == 0)) { - // 1st fragment compressed - // this fragment compressed - $len = min($charsLeft, $limitpos - $pos); - $retstr .= substr($recordData, $pos, $len); - $charsLeft -= $len; - $isCompressed = true; - - } elseif (!$isCompressed && ($option != 0)) { - // 1st fragment uncompressed - // this fragment uncompressed - $len = min($charsLeft * 2, $limitpos - $pos); - $retstr .= substr($recordData, $pos, $len); - $charsLeft -= $len / 2; - $isCompressed = false; - - } elseif (!$isCompressed && ($option == 0)) { - // 1st fragment uncompressed - // this fragment compressed - $len = min($charsLeft, $limitpos - $pos); - for ($j = 0; $j < $len; ++$j) { - $retstr .= $recordData{$pos + $j} . chr(0); - } - $charsLeft -= $len; - $isCompressed = false; - - } else { - // 1st fragment compressed - // this fragment uncompressed - $newstr = ''; - for ($j = 0; $j < strlen($retstr); ++$j) { - $newstr .= $retstr[$j] . chr(0); - } - $retstr = $newstr; - $len = min($charsLeft * 2, $limitpos - $pos); - $retstr .= substr($recordData, $pos, $len); - $charsLeft -= $len / 2; - $isCompressed = false; - } - - $pos += $len; - } - } - - // convert to UTF-8 - $retstr = self::_encodeUTF16($retstr, $isCompressed); - - // read additional Rich-Text information, if any - $fmtRuns = array(); - if ($hasRichText) { - // list of formatting runs - for ($j = 0; $j < $formattingRuns; ++$j) { - // first formatted character; zero-based - $charPos = self::_GetInt2d($recordData, $pos + $j * 4); - - // index to font record - $fontIndex = self::_GetInt2d($recordData, $pos + 2 + $j * 4); - - $fmtRuns[] = array( - 'charPos' => $charPos, - 'fontIndex' => $fontIndex, - ); - } - $pos += 4 * $formattingRuns; - } - - // read additional Asian phonetics information, if any - if ($hasAsian) { - // For Asian phonetic settings, we skip the extended string data - $pos += $extendedRunLength; - } - - // store the shared sting - $this->_sst[] = array( - 'value' => $retstr, - 'fmtRuns' => $fmtRuns, - ); - } - - // _getSplicedRecordData() takes care of moving current position in data stream - } - - /** - * Read PRINTGRIDLINES record - */ - private function _readPrintGridlines() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { - // offset: 0; size: 2; 0 = do not print sheet grid lines; 1 = print sheet gridlines - $printGridlines = (bool) self::_GetInt2d($recordData, 0); - $this->_phpSheet->setPrintGridlines($printGridlines); - } - } - - /** - * Read DEFAULTROWHEIGHT record - */ - private function _readDefaultRowHeight() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; option flags - // offset: 2; size: 2; default height for unused rows, (twips 1/20 point) - $height = self::_GetInt2d($recordData, 2); - $this->_phpSheet->getDefaultRowDimension()->setRowHeight($height / 20); - } - - /** - * Read SHEETPR record - */ - private function _readSheetPr() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2 - - // bit: 6; mask: 0x0040; 0 = outline buttons above outline group - $isSummaryBelow = (0x0040 & self::_GetInt2d($recordData, 0)) >> 6; - $this->_phpSheet->setShowSummaryBelow($isSummaryBelow); - - // bit: 7; mask: 0x0080; 0 = outline buttons left of outline group - $isSummaryRight = (0x0080 & self::_GetInt2d($recordData, 0)) >> 7; - $this->_phpSheet->setShowSummaryRight($isSummaryRight); - - // bit: 8; mask: 0x100; 0 = scale printout in percent, 1 = fit printout to number of pages - // this corresponds to radio button setting in page setup dialog in Excel - $this->_isFitToPages = (bool) ((0x0100 & self::_GetInt2d($recordData, 0)) >> 8); - } - - /** - * Read HORIZONTALPAGEBREAKS record - */ - private function _readHorizontalPageBreaks() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { - - // offset: 0; size: 2; number of the following row index structures - $nm = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 6 * $nm; list of $nm row index structures - for ($i = 0; $i < $nm; ++$i) { - $r = self::_GetInt2d($recordData, 2 + 6 * $i); - $cf = self::_GetInt2d($recordData, 2 + 6 * $i + 2); - $cl = self::_GetInt2d($recordData, 2 + 6 * $i + 4); - - // not sure why two column indexes are necessary? - $this->_phpSheet->setBreakByColumnAndRow($cf, $r, PHPExcel_Worksheet::BREAK_ROW); - } - } - } - - /** - * Read VERTICALPAGEBREAKS record - */ - private function _readVerticalPageBreaks() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { - // offset: 0; size: 2; number of the following column index structures - $nm = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 6 * $nm; list of $nm row index structures - for ($i = 0; $i < $nm; ++$i) { - $c = self::_GetInt2d($recordData, 2 + 6 * $i); - $rf = self::_GetInt2d($recordData, 2 + 6 * $i + 2); - $rl = self::_GetInt2d($recordData, 2 + 6 * $i + 4); - - // not sure why two row indexes are necessary? - $this->_phpSheet->setBreakByColumnAndRow($c, $rf, PHPExcel_Worksheet::BREAK_COLUMN); - } - } - } - - /** - * Read HEADER record - */ - private function _readHeader() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: var - // realized that $recordData can be empty even when record exists - if ($recordData) { - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringLong($recordData); - } else { - $string = $this->_readByteStringShort($recordData); - } - - $this->_phpSheet->getHeaderFooter()->setOddHeader($string['value']); - $this->_phpSheet->getHeaderFooter()->setEvenHeader($string['value']); - } - } - } - - /** - * Read FOOTER record - */ - private function _readFooter() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: var - // realized that $recordData can be empty even when record exists - if ($recordData) { - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringLong($recordData); - } else { - $string = $this->_readByteStringShort($recordData); - } - $this->_phpSheet->getHeaderFooter()->setOddFooter($string['value']); - $this->_phpSheet->getHeaderFooter()->setEvenFooter($string['value']); - } - } - } - - /** - * Read HCENTER record - */ - private function _readHcenter() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; 0 = print sheet left aligned, 1 = print sheet centered horizontally - $isHorizontalCentered = (bool) self::_GetInt2d($recordData, 0); - - $this->_phpSheet->getPageSetup()->setHorizontalCentered($isHorizontalCentered); - } - } - - /** - * Read VCENTER record - */ - private function _readVcenter() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; 0 = print sheet aligned at top page border, 1 = print sheet vertically centered - $isVerticalCentered = (bool) self::_GetInt2d($recordData, 0); - - $this->_phpSheet->getPageSetup()->setVerticalCentered($isVerticalCentered); - } - } - - /** - * Read LEFTMARGIN record - */ - private function _readLeftMargin() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setLeft(self::_extractNumber($recordData)); - } - } - - /** - * Read RIGHTMARGIN record - */ - private function _readRightMargin() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setRight(self::_extractNumber($recordData)); - } - } - - /** - * Read TOPMARGIN record - */ - private function _readTopMargin() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setTop(self::_extractNumber($recordData)); - } - } - - /** - * Read BOTTOMMARGIN record - */ - private function _readBottomMargin() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 8 - $this->_phpSheet->getPageMargins()->setBottom(self::_extractNumber($recordData)); - } - } - - /** - * Read PAGESETUP record - */ - private function _readPageSetup() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; paper size - $paperSize = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; scaling factor - $scale = self::_GetInt2d($recordData, 2); - - // offset: 6; size: 2; fit worksheet width to this number of pages, 0 = use as many as needed - $fitToWidth = self::_GetInt2d($recordData, 6); - - // offset: 8; size: 2; fit worksheet height to this number of pages, 0 = use as many as needed - $fitToHeight = self::_GetInt2d($recordData, 8); - - // offset: 10; size: 2; option flags - - // bit: 1; mask: 0x0002; 0=landscape, 1=portrait - $isPortrait = (0x0002 & self::_GetInt2d($recordData, 10)) >> 1; - - // bit: 2; mask: 0x0004; 1= paper size, scaling factor, paper orient. not init - // when this bit is set, do not use flags for those properties - $isNotInit = (0x0004 & self::_GetInt2d($recordData, 10)) >> 2; - - if (!$isNotInit) { - $this->_phpSheet->getPageSetup()->setPaperSize($paperSize); - switch ($isPortrait) { - case 0: $this->_phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); break; - case 1: $this->_phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT); break; - } - - $this->_phpSheet->getPageSetup()->setScale($scale, false); - $this->_phpSheet->getPageSetup()->setFitToPage((bool) $this->_isFitToPages); - $this->_phpSheet->getPageSetup()->setFitToWidth($fitToWidth, false); - $this->_phpSheet->getPageSetup()->setFitToHeight($fitToHeight, false); - } - - // offset: 16; size: 8; header margin (IEEE 754 floating-point value) - $marginHeader = self::_extractNumber(substr($recordData, 16, 8)); - $this->_phpSheet->getPageMargins()->setHeader($marginHeader); - - // offset: 24; size: 8; footer margin (IEEE 754 floating-point value) - $marginFooter = self::_extractNumber(substr($recordData, 24, 8)); - $this->_phpSheet->getPageMargins()->setFooter($marginFooter); - } - } - - /** - * PROTECT - Sheet protection (BIFF2 through BIFF8) - * if this record is omitted, then it also means no sheet protection - */ - private function _readProtect() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // offset: 0; size: 2; - - // bit 0, mask 0x01; 1 = sheet is protected - $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; - $this->_phpSheet->getProtection()->setSheet((bool)$bool); - } - - /** - * SCENPROTECT - */ - private function _readScenProtect() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // offset: 0; size: 2; - - // bit: 0, mask 0x01; 1 = scenarios are protected - $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; - - $this->_phpSheet->getProtection()->setScenarios((bool)$bool); - } - - /** - * OBJECTPROTECT - */ - private function _readObjectProtect() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // offset: 0; size: 2; - - // bit: 0, mask 0x01; 1 = objects are protected - $bool = (0x01 & self::_GetInt2d($recordData, 0)) >> 0; - - $this->_phpSheet->getProtection()->setObjects((bool)$bool); - } - - /** - * PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8) - */ - private function _readPassword() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; 16-bit hash value of password - $password = strtoupper(dechex(self::_GetInt2d($recordData, 0))); // the hashed password - $this->_phpSheet->getProtection()->setPassword($password, true); - } - } - - /** - * Read DEFCOLWIDTH record - */ - private function _readDefColWidth() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; default column width - $width = self::_GetInt2d($recordData, 0); - if ($width != 8) { - $this->_phpSheet->getDefaultColumnDimension()->setWidth($width); - } - } - - /** - * Read COLINFO record - */ - private function _readColInfo() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; index to first column in range - $fc = self::_GetInt2d($recordData, 0); // first column index - - // offset: 2; size: 2; index to last column in range - $lc = self::_GetInt2d($recordData, 2); // first column index - - // offset: 4; size: 2; width of the column in 1/256 of the width of the zero character - $width = self::_GetInt2d($recordData, 4); - - // offset: 6; size: 2; index to XF record for default column formatting - $xfIndex = self::_GetInt2d($recordData, 6); - - // offset: 8; size: 2; option flags - - // bit: 0; mask: 0x0001; 1= columns are hidden - $isHidden = (0x0001 & self::_GetInt2d($recordData, 8)) >> 0; - - // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline) - $level = (0x0700 & self::_GetInt2d($recordData, 8)) >> 8; - - // bit: 12; mask: 0x1000; 1 = collapsed - $isCollapsed = (0x1000 & self::_GetInt2d($recordData, 8)) >> 12; - - // offset: 10; size: 2; not used - - for ($i = $fc; $i <= $lc; ++$i) { - if ($lc == 255 || $lc == 256) { - $this->_phpSheet->getDefaultColumnDimension()->setWidth($width / 256); - break; - } - $this->_phpSheet->getColumnDimensionByColumn($i)->setWidth($width / 256); - $this->_phpSheet->getColumnDimensionByColumn($i)->setVisible(!$isHidden); - $this->_phpSheet->getColumnDimensionByColumn($i)->setOutlineLevel($level); - $this->_phpSheet->getColumnDimensionByColumn($i)->setCollapsed($isCollapsed); - $this->_phpSheet->getColumnDimensionByColumn($i)->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - /** - * ROW - * - * This record contains the properties of a single row in a - * sheet. Rows and cells in a sheet are divided into blocks - * of 32 rows. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readRow() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; index of this row - $r = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to column of the first cell which is described by a cell record - - // offset: 4; size: 2; index to column of the last cell which is described by a cell record, increased by 1 - - // offset: 6; size: 2; - - // bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point - $height = (0x7FFF & self::_GetInt2d($recordData, 6)) >> 0; - - // bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height - $useDefaultHeight = (0x8000 & self::_GetInt2d($recordData, 6)) >> 15; - - if (!$useDefaultHeight) { - $this->_phpSheet->getRowDimension($r + 1)->setRowHeight($height / 20); - } - - // offset: 8; size: 2; not used - - // offset: 10; size: 2; not used in BIFF5-BIFF8 - - // offset: 12; size: 4; option flags and default row formatting - - // bit: 2-0: mask: 0x00000007; outline level of the row - $level = (0x00000007 & self::_GetInt4d($recordData, 12)) >> 0; - $this->_phpSheet->getRowDimension($r + 1)->setOutlineLevel($level); - - // bit: 4; mask: 0x00000010; 1 = outline group start or ends here... and is collapsed - $isCollapsed = (0x00000010 & self::_GetInt4d($recordData, 12)) >> 4; - $this->_phpSheet->getRowDimension($r + 1)->setCollapsed($isCollapsed); - - // bit: 5; mask: 0x00000020; 1 = row is hidden - $isHidden = (0x00000020 & self::_GetInt4d($recordData, 12)) >> 5; - $this->_phpSheet->getRowDimension($r + 1)->setVisible(!$isHidden); - - // bit: 7; mask: 0x00000080; 1 = row has explicit format - $hasExplicitFormat = (0x00000080 & self::_GetInt4d($recordData, 12)) >> 7; - - // bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record - $xfIndex = (0x0FFF0000 & self::_GetInt4d($recordData, 12)) >> 16; - - if ($hasExplicitFormat) { - $this->_phpSheet->getRowDimension($r + 1)->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - /** - * Read RK record - * This record represents a cell that contains an RK value - * (encoded integer or floating-point value). If a - * floating-point value cannot be encoded to an RK value, - * a NUMBER record will be written. This record replaces the - * record INTEGER written in BIFF2. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readRk() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to column - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset: 4; size: 2; index to XF record - $xfIndex = self::_GetInt2d($recordData, 4); - - // offset: 6; size: 4; RK value - $rknum = self::_GetInt4d($recordData, 6); - $numValue = self::_GetIEEE754($rknum); - - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - if (!$this->_readDataOnly) { - // add style information - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - - // add cell - $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); - } - } - - /** - * Read LABELSST record - * This record represents a cell that contains a string. It - * replaces the LABEL record and RSTRING record used in - * BIFF2-BIFF5. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readLabelSst() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to column - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset: 4; size: 2; index to XF record - $xfIndex = self::_GetInt2d($recordData, 4); - - // offset: 6; size: 4; index to SST record - $index = self::_GetInt4d($recordData, 6); - - // add cell - if (($fmtRuns = $this->_sst[$index]['fmtRuns']) && !$this->_readDataOnly) { - // then we should treat as rich text - $richText = new PHPExcel_RichText(); - $charPos = 0; - $sstCount = count($this->_sst[$index]['fmtRuns']); - for ($i = 0; $i <= $sstCount; ++$i) { - if (isset($fmtRuns[$i])) { - $text = PHPExcel_Shared_String::Substring($this->_sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos); - $charPos = $fmtRuns[$i]['charPos']; - } else { - $text = PHPExcel_Shared_String::Substring($this->_sst[$index]['value'], $charPos, PHPExcel_Shared_String::CountCharacters($this->_sst[$index]['value'])); - } - - if (PHPExcel_Shared_String::CountCharacters($text) > 0) { - if ($i == 0) { // first text run, no style - $richText->createText($text); - } else { - $textRun = $richText->createTextRun($text); - if (isset($fmtRuns[$i - 1])) { - if ($fmtRuns[$i - 1]['fontIndex'] < 4) { - $fontIndex = $fmtRuns[$i - 1]['fontIndex']; - } else { - // this has to do with that index 4 is omitted in all BIFF versions for some strange reason - // check the OpenOffice documentation of the FONT record - $fontIndex = $fmtRuns[$i - 1]['fontIndex'] - 1; - } - $textRun->setFont(clone $this->_objFonts[$fontIndex]); - } - } - } - } - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($richText, PHPExcel_Cell_DataType::TYPE_STRING); - } else { - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($this->_sst[$index]['value'], PHPExcel_Cell_DataType::TYPE_STRING); - } - - if (!$this->_readDataOnly) { - // add style information - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - /** - * Read MULRK record - * This record represents a cell range containing RK value - * cells. All cells are located in the same row. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readMulRk() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to first column - $colFirst = self::_GetInt2d($recordData, 2); - - // offset: var; size: 2; index to last column - $colLast = self::_GetInt2d($recordData, $length - 2); - $columns = $colLast - $colFirst + 1; - - // offset within record data - $offset = 4; - - for ($i = 0; $i < $columns; ++$i) { - $columnString = PHPExcel_Cell::stringFromColumnIndex($colFirst + $i); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - - // offset: var; size: 2; index to XF record - $xfIndex = self::_GetInt2d($recordData, $offset); - - // offset: var; size: 4; RK value - $numValue = self::_GetIEEE754(self::_GetInt4d($recordData, $offset + 2)); - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - if (!$this->_readDataOnly) { - // add style - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - - // add cell value - $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); - } - - $offset += 6; - } - } - - /** - * Read NUMBER record - * This record represents a cell that contains a - * floating-point value. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readNumber() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size 2; index to column - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset 4; size: 2; index to XF record - $xfIndex = self::_GetInt2d($recordData, 4); - - $numValue = self::_extractNumber(substr($recordData, 6, 8)); - - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - if (!$this->_readDataOnly) { - // add cell style - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - - // add cell value - $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC); - } - } - - /** - * Read FORMULA record + perhaps a following STRING record if formula result is a string - * This record contains the token array and the result of a - * formula cell. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readFormula() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; row index - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; col index - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // offset: 20: size: variable; formula structure - $formulaStructure = substr($recordData, 20); - - // offset: 14: size: 2; option flags, recalculate always, recalculate on open etc. - $options = self::_GetInt2d($recordData, 14); - - // bit: 0; mask: 0x0001; 1 = recalculate always - // bit: 1; mask: 0x0002; 1 = calculate on open - // bit: 2; mask: 0x0008; 1 = part of a shared formula - $isPartOfSharedFormula = (bool) (0x0008 & $options); - - // WARNING: - // We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true - // the formula data may be ordinary formula data, therefore we need to check - // explicitly for the tExp token (0x01) - $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01; - - if ($isPartOfSharedFormula) { - // part of shared formula which means there will be a formula with a tExp token and nothing else - // get the base cell, grab tExp token - $baseRow = self::_GetInt2d($formulaStructure, 3); - $baseCol = self::_GetInt2d($formulaStructure, 5); - $this->_baseCell = PHPExcel_Cell::stringFromColumnIndex($baseCol). ($baseRow + 1); - } - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - - if ($isPartOfSharedFormula) { - // formula is added to this cell after the sheet has been read - $this->_sharedFormulaParts[$columnString . ($row + 1)] = $this->_baseCell; - } - - // offset: 16: size: 4; not used - - // offset: 4; size: 2; XF index - $xfIndex = self::_GetInt2d($recordData, 4); - - // offset: 6; size: 8; result of the formula - if ( (ord($recordData{6}) == 0) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255) ) { - - // String formula. Result follows in appended STRING record - $dataType = PHPExcel_Cell_DataType::TYPE_STRING; - - // read possible SHAREDFMLA record - $code = self::_GetInt2d($this->_data, $this->_pos); - if ($code == self::XLS_Type_SHAREDFMLA) { - $this->_readSharedFmla(); - } - - // read STRING record - $value = $this->_readString(); - - } elseif ((ord($recordData{6}) == 1) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { - - // Boolean formula. Result is in +2; 0=false, 1=true - $dataType = PHPExcel_Cell_DataType::TYPE_BOOL; - $value = (bool) ord($recordData{8}); - - } elseif ((ord($recordData{6}) == 2) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { - - // Error formula. Error code is in +2 - $dataType = PHPExcel_Cell_DataType::TYPE_ERROR; - $value = self::_mapErrorCode(ord($recordData{8})); - - } elseif ((ord($recordData{6}) == 3) - && (ord($recordData{12}) == 255) - && (ord($recordData{13}) == 255)) { - - // Formula result is a null string - $dataType = PHPExcel_Cell_DataType::TYPE_NULL; - $value = ''; - - } else { - - // forumla result is a number, first 14 bytes like _NUMBER record - $dataType = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $value = self::_extractNumber(substr($recordData, 6, 8)); - - } - - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - if (!$this->_readDataOnly) { - // add cell style - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - - // store the formula - if (!$isPartOfSharedFormula) { - // not part of shared formula - // add cell value. If we can read formula, populate with formula, otherwise just used cached value - try { - if ($this->_version != self::XLS_BIFF8) { - throw new Exception('Not BIFF8. Can only read BIFF8 formulas'); - } - $formula = $this->_getFormulaFromStructure($formulaStructure); // get formula in human language - $cell->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA); - - } catch (Exception $e) { - $cell->setValueExplicit($value, $dataType); - } - } else { - if ($this->_version == self::XLS_BIFF8) { - // do nothing at this point, formula id added later in the code - } else { - $cell->setValueExplicit($value, $dataType); - } - } - - // store the cached calculated value - $cell->setCalculatedValue($value); - } - } - - /** - * Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader, - * which usually contains relative references. - * These will be used to construct the formula in each shared formula part after the sheet is read. - */ - private function _readSharedFmla() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0, size: 6; cell range address of the area used by the shared formula, not used for anything - $cellRange = substr($recordData, 0, 6); - $cellRange = $this->_readBIFF5CellRangeAddressFixed($cellRange); // note: even BIFF8 uses BIFF5 syntax - - // offset: 6, size: 1; not used - - // offset: 7, size: 1; number of existing FORMULA records for this shared formula - $no = ord($recordData{7}); - - // offset: 8, size: var; Binary token array of the shared formula - $formula = substr($recordData, 8); - - // at this point we only store the shared formula for later use - $this->_sharedFormulas[$this->_baseCell] = $formula; - - } - - /** - * Read a STRING record from current stream position and advance the stream pointer to next record - * This record is used for storing result from FORMULA record when it is a string, and - * it occurs directly after the FORMULA record - * - * @return string The string contents as UTF-8 - */ - private function _readString() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringLong($recordData); - $value = $string['value']; - } else { - $string = $this->_readByteStringLong($recordData); - $value = $string['value']; - } - - return $value; - } - - /** - * Read BOOLERR record - * This record represents a Boolean value or error value - * cell. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readBoolErr() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; row index - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; column index - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset: 4; size: 2; index to XF record - $xfIndex = self::_GetInt2d($recordData, 4); - - // offset: 6; size: 1; the boolean value or error value - $boolErr = ord($recordData{6}); - - // offset: 7; size: 1; 0=boolean; 1=error - $isError = ord($recordData{7}); - - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - switch ($isError) { - case 0: // boolean - $value = (bool) $boolErr; - - // add cell value - $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_BOOL); - break; - - case 1: // error type - $value = self::_mapErrorCode($boolErr); - - // add cell value - $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_ERROR); - break; - } - - if (!$this->_readDataOnly) { - // add cell style - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - /** - * Read MULBLANK record - * This record represents a cell range of empty cells. All - * cells are located in the same row - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readMulBlank() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to first column - $fc = self::_GetInt2d($recordData, 2); - - // offset: 4; size: 2 x nc; list of indexes to XF records - // add style information - if (!$this->_readDataOnly) { - for ($i = 0; $i < $length / 2 - 3; ++$i) { - $columnString = PHPExcel_Cell::stringFromColumnIndex($fc + $i); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - $xfIndex = self::_GetInt2d($recordData, 4 + 2 * $i); - $this->_phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - // offset: 6; size 2; index to last column (not needed) - } - - /** - * Read LABEL record - * This record represents a cell that contains a string. In - * BIFF8 it is usually replaced by the LABELSST record. - * Excel still uses this record, if it copies unformatted - * text cells to the clipboard. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readLabel() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; index to row - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; index to column - $column = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset: 4; size: 2; XF index - $xfIndex = self::_GetInt2d($recordData, 4); - - // add cell value - // todo: what if string is very long? continue record - if ($this->_version == self::XLS_BIFF8) { - $string = self::_readUnicodeStringLong(substr($recordData, 6)); - $value = $string['value']; - } else { - $string = $this->_readByteStringLong(substr($recordData, 6)); - $value = $string['value']; - } - $cell = $this->_phpSheet->getCell($columnString . ($row + 1)); - $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING); - - if (!$this->_readDataOnly) { - // add cell style - $cell->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - } - - /** - * Read BLANK record - */ - private function _readBlank() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; row index - $row = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; col index - $col = self::_GetInt2d($recordData, 2); - $columnString = PHPExcel_Cell::stringFromColumnIndex($col); - - // Read cell? - if ( !is_null($this->getReadFilter()) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->_phpSheet->getTitle()) ) { - // offset: 4; size: 2; XF index - $xfIndex = self::_GetInt2d($recordData, 4); - - // add style information - if (!$this->_readDataOnly) { - $this->_phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->_mapCellXfIndex[$xfIndex]); - } - } - - } - - /** - * Read MSODRAWING record - */ - private function _readMsoDrawing() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - - // get spliced record data - $splicedRecordData = $this->_getSplicedRecordData(); - $recordData = $splicedRecordData['recordData']; - - $this->_drawingData .= $recordData; - } - - /** - * Read OBJ record - */ - private function _readObj() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly || $this->_version != self::XLS_BIFF8) { - return; - } - - // recordData consists of an array of subrecords looking like this: - // ft: 2 bytes; ftCmo type (0x15) - // cb: 2 bytes; size in bytes of ftCmo data - // ot: 2 bytes; Object Type - // id: 2 bytes; Object id number - // grbit: 2 bytes; Option Flags - // data: var; subrecord data - - // for now, we are just interested in the second subrecord containing the object type - $ftCmoType = self::_GetInt2d($recordData, 0); - $cbCmoSize = self::_GetInt2d($recordData, 2); - $otObjType = self::_GetInt2d($recordData, 4); - $idObjID = self::_GetInt2d($recordData, 6); - $grbitOpts = self::_GetInt2d($recordData, 6); - - $this->_objs[] = array( - 'ftCmoType' => $ftCmoType, - 'cbCmoSize' => $cbCmoSize, - 'otObjType' => $otObjType, - 'idObjID' => $idObjID, - 'grbitOpts' => $grbitOpts - ); - $this->textObjRef = $idObjID; - -// echo '_readObj()
      '; -// var_dump(end($this->_objs)); -// echo '
      '; - } - - /** - * Read WINDOW2 record - */ - private function _readWindow2() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; option flags - $options = self::_GetInt2d($recordData, 0); - - // bit: 1; mask: 0x0002; 0 = do not show gridlines, 1 = show gridlines - $showGridlines = (bool) ((0x0002 & $options) >> 1); - $this->_phpSheet->setShowGridlines($showGridlines); - - // bit: 2; mask: 0x0004; 0 = do not show headers, 1 = show headers - $showRowColHeaders = (bool) ((0x0004 & $options) >> 2); - $this->_phpSheet->setShowRowColHeaders($showRowColHeaders); - - // bit: 3; mask: 0x0008; 0 = panes are not frozen, 1 = panes are frozen - $this->_frozen = (bool) ((0x0008 & $options) >> 3); - - // bit: 6; mask: 0x0040; 0 = columns from left to right, 1 = columns from right to left - $this->_phpSheet->setRightToLeft((bool)((0x0040 & $options) >> 6)); - - // bit: 10; mask: 0x0400; 0 = sheet not active, 1 = sheet active - $isActive = (bool) ((0x0400 & $options) >> 10); - if ($isActive) { - $this->_phpExcel->setActiveSheetIndex($this->_phpExcel->getIndex($this->_phpSheet)); - } - } - - /** - * Read SCL record - */ - private function _readScl() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // offset: 0; size: 2; numerator of the view magnification - $numerator = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; numerator of the view magnification - $denumerator = self::_GetInt2d($recordData, 2); - - // set the zoom scale (in percent) - $this->_phpSheet->getSheetView()->setZoomScale($numerator * 100 / $denumerator); - } - - /** - * Read PANE record - */ - private function _readPane() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; position of vertical split - $px = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; position of horizontal split - $py = self::_GetInt2d($recordData, 2); - - if ($this->_frozen) { - // frozen panes - $this->_phpSheet->freezePane(PHPExcel_Cell::stringFromColumnIndex($px) . ($py + 1)); - } else { - // unfrozen panes; split windows; not supported by PHPExcel core - } - } - } - - /** - * Read SELECTION record. There is one such record for each pane in the sheet. - */ - private function _readSelection() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 1; pane identifier - $paneId = ord($recordData{0}); - - // offset: 1; size: 2; index to row of the active cell - $r = self::_GetInt2d($recordData, 1); - - // offset: 3; size: 2; index to column of the active cell - $c = self::_GetInt2d($recordData, 3); - - // offset: 5; size: 2; index into the following cell range list to the - // entry that contains the active cell - $index = self::_GetInt2d($recordData, 5); - - // offset: 7; size: var; cell range address list containing all selected cell ranges - $data = substr($recordData, 7); - $cellRangeAddressList = $this->_readBIFF5CellRangeAddressList($data); // note: also BIFF8 uses BIFF5 syntax - - $selectedCells = $cellRangeAddressList['cellRangeAddresses'][0]; - - // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!) - if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) { - $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells); - } - - // first row '1' + last row '65536' indicates that full column is selected - if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) { - $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells); - } - - // first column 'A' + last column 'IV' indicates that full row is selected - if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) { - $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells); - } - - $this->_phpSheet->setSelectedCells($selectedCells); - } - } - - private function _includeCellRangeFiltered($cellRangeAddress) - { - $includeCellRange = true; - if (!is_null($this->getReadFilter())) { - $includeCellRange = false; - $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($cellRangeAddress); - $rangeBoundaries[1][0]++; - for ($row = $rangeBoundaries[0][1]; $row <= $rangeBoundaries[1][1]; $row++) { - for ($column = $rangeBoundaries[0][0]; $column != $rangeBoundaries[1][0]; $column++) { - if ($this->getReadFilter()->readCell($column, $row, $this->_phpSheet->getTitle())) { - $includeCellRange = true; - break 2; - } - } - } - } - return $includeCellRange; - } - - /** - * MERGEDCELLS - * - * This record contains the addresses of merged cell ranges - * in the current sheet. - * - * -- "OpenOffice.org's Documentation of the Microsoft - * Excel File Format" - */ - private function _readMergedCells() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) { - $cellRangeAddressList = $this->_readBIFF8CellRangeAddressList($recordData); - foreach ($cellRangeAddressList['cellRangeAddresses'] as $cellRangeAddress) { - if ($this->_includeCellRangeFiltered($cellRangeAddress)) { - $this->_phpSheet->mergeCells($cellRangeAddress); - } - } - } - } - - /** - * Read HYPERLINK record - */ - private function _readHyperLink() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer forward to next record - $this->_pos += 4 + $length; - - if (!$this->_readDataOnly) { - // offset: 0; size: 8; cell range address of all cells containing this hyperlink - try { - $cellRange = $this->_readBIFF8CellRangeAddressFixed($recordData, 0, 8); - } catch (Exception $e) { - return; - } - - // offset: 8, size: 16; GUID of StdLink - - // offset: 24, size: 4; unknown value - - // offset: 28, size: 4; option flags - - // bit: 0; mask: 0x00000001; 0 = no link or extant, 1 = file link or URL - $isFileLinkOrUrl = (0x00000001 & self::_GetInt2d($recordData, 28)) >> 0; - - // bit: 1; mask: 0x00000002; 0 = relative path, 1 = absolute path or URL - $isAbsPathOrUrl = (0x00000001 & self::_GetInt2d($recordData, 28)) >> 1; - - // bit: 2 (and 4); mask: 0x00000014; 0 = no description - $hasDesc = (0x00000014 & self::_GetInt2d($recordData, 28)) >> 2; - - // bit: 3; mask: 0x00000008; 0 = no text, 1 = has text - $hasText = (0x00000008 & self::_GetInt2d($recordData, 28)) >> 3; - - // bit: 7; mask: 0x00000080; 0 = no target frame, 1 = has target frame - $hasFrame = (0x00000080 & self::_GetInt2d($recordData, 28)) >> 7; - - // bit: 8; mask: 0x00000100; 0 = file link or URL, 1 = UNC path (inc. server name) - $isUNC = (0x00000100 & self::_GetInt2d($recordData, 28)) >> 8; - - // offset within record data - $offset = 32; - - if ($hasDesc) { - // offset: 32; size: var; character count of description text - $dl = self::_GetInt4d($recordData, 32); - // offset: 36; size: var; character array of description text, no Unicode string header, always 16-bit characters, zero terminated - $desc = self::_encodeUTF16(substr($recordData, 36, 2 * ($dl - 1)), false); - $offset += 4 + 2 * $dl; - } - if ($hasFrame) { - $fl = self::_GetInt4d($recordData, $offset); - $offset += 4 + 2 * $fl; - } - - // detect type of hyperlink (there are 4 types) - $hyperlinkType = null; - - if ($isUNC) { - $hyperlinkType = 'UNC'; - } else if (!$isFileLinkOrUrl) { - $hyperlinkType = 'workbook'; - } else if (ord($recordData{$offset}) == 0x03) { - $hyperlinkType = 'local'; - } else if (ord($recordData{$offset}) == 0xE0) { - $hyperlinkType = 'URL'; - } - - switch ($hyperlinkType) { - case 'URL': - // section 5.58.2: Hyperlink containing a URL - // e.g. http://example.org/index.php - - // offset: var; size: 16; GUID of URL Moniker - $offset += 16; - // offset: var; size: 4; size (in bytes) of character array of the URL including trailing zero word - $us = self::_GetInt4d($recordData, $offset); - $offset += 4; - // offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated - $url = self::_encodeUTF16(substr($recordData, $offset, $us - 2), false); - $url .= $hasText ? '#' : ''; - $offset += $us; - break; - - case 'local': - // section 5.58.3: Hyperlink to local file - // examples: - // mydoc.txt - // ../../somedoc.xls#Sheet!A1 - - // offset: var; size: 16; GUI of File Moniker - $offset += 16; - - // offset: var; size: 2; directory up-level count. - $upLevelCount = self::_GetInt2d($recordData, $offset); - $offset += 2; - - // offset: var; size: 4; character count of the shortened file path and name, including trailing zero word - $sl = self::_GetInt4d($recordData, $offset); - $offset += 4; - - // offset: var; size: sl; character array of the shortened file path and name in 8.3-DOS-format (compressed Unicode string) - $shortenedFilePath = substr($recordData, $offset, $sl); - $shortenedFilePath = self::_encodeUTF16($shortenedFilePath, true); - $shortenedFilePath = substr($shortenedFilePath, 0, -1); // remove trailing zero - - $offset += $sl; - - // offset: var; size: 24; unknown sequence - $offset += 24; - - // extended file path - // offset: var; size: 4; size of the following file link field including string lenth mark - $sz = self::_GetInt4d($recordData, $offset); - $offset += 4; - - // only present if $sz > 0 - if ($sz > 0) { - // offset: var; size: 4; size of the character array of the extended file path and name - $xl = self::_GetInt4d($recordData, $offset); - $offset += 4; - - // offset: var; size 2; unknown - $offset += 2; - - // offset: var; size $xl; character array of the extended file path and name. - $extendedFilePath = substr($recordData, $offset, $xl); - $extendedFilePath = self::_encodeUTF16($extendedFilePath, false); - $offset += $xl; - } - - // construct the path - $url = str_repeat('..\\', $upLevelCount); - $url .= ($sz > 0) ? - $extendedFilePath : $shortenedFilePath; // use extended path if available - $url .= $hasText ? '#' : ''; - - break; - - - case 'UNC': - // section 5.58.4: Hyperlink to a File with UNC (Universal Naming Convention) Path - // todo: implement - return; - - case 'workbook': - // section 5.58.5: Hyperlink to the Current Workbook - // e.g. Sheet2!B1:C2, stored in text mark field - $url = 'sheet://'; - break; - - default: - return; - - } - - if ($hasText) { - // offset: var; size: 4; character count of text mark including trailing zero word - $tl = self::_GetInt4d($recordData, $offset); - $offset += 4; - // offset: var; size: var; character array of the text mark without the # sign, no Unicode header, always 16-bit characters, zero-terminated - $text = self::_encodeUTF16(substr($recordData, $offset, 2 * ($tl - 1)), false); - $url .= $text; - } - - // apply the hyperlink to all the relevant cells - foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) { - $this->_phpSheet->getCell($coordinate)->getHyperLink()->setUrl($url); - } - } - } - - /** - * Read DATAVALIDATIONS record - */ - private function _readDataValidations() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer forward to next record - $this->_pos += 4 + $length; - } - - /** - * Read DATAVALIDATION record - */ - private function _readDataValidation() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer forward to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // offset: 0; size: 4; Options - $options = self::_GetInt4d($recordData, 0); - - // bit: 0-3; mask: 0x0000000F; type - $type = (0x0000000F & $options) >> 0; - switch ($type) { - case 0x00: $type = PHPExcel_Cell_DataValidation::TYPE_NONE; break; - case 0x01: $type = PHPExcel_Cell_DataValidation::TYPE_WHOLE; break; - case 0x02: $type = PHPExcel_Cell_DataValidation::TYPE_DECIMAL; break; - case 0x03: $type = PHPExcel_Cell_DataValidation::TYPE_LIST; break; - case 0x04: $type = PHPExcel_Cell_DataValidation::TYPE_DATE; break; - case 0x05: $type = PHPExcel_Cell_DataValidation::TYPE_TIME; break; - case 0x06: $type = PHPExcel_Cell_DataValidation::TYPE_TEXTLENGTH; break; - case 0x07: $type = PHPExcel_Cell_DataValidation::TYPE_CUSTOM; break; - } - - // bit: 4-6; mask: 0x00000070; error type - $errorStyle = (0x00000070 & $options) >> 4; - switch ($errorStyle) { - case 0x00: $errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP; break; - case 0x01: $errorStyle = PHPExcel_Cell_DataValidation::STYLE_WARNING; break; - case 0x02: $errorStyle = PHPExcel_Cell_DataValidation::STYLE_INFORMATION; break; - } - - // bit: 7; mask: 0x00000080; 1= formula is explicit (only applies to list) - // I have only seen cases where this is 1 - $explicitFormula = (0x00000080 & $options) >> 7; - - // bit: 8; mask: 0x00000100; 1= empty cells allowed - $allowBlank = (0x00000100 & $options) >> 8; - - // bit: 9; mask: 0x00000200; 1= suppress drop down arrow in list type validity - $suppressDropDown = (0x00000200 & $options) >> 9; - - // bit: 18; mask: 0x00040000; 1= show prompt box if cell selected - $showInputMessage = (0x00040000 & $options) >> 18; - - // bit: 19; mask: 0x00080000; 1= show error box if invalid values entered - $showErrorMessage = (0x00080000 & $options) >> 19; - - // bit: 20-23; mask: 0x00F00000; condition operator - $operator = (0x00F00000 & $options) >> 20; - switch ($operator) { - case 0x00: $operator = PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN ; break; - case 0x01: $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTBETWEEN ; break; - case 0x02: $operator = PHPExcel_Cell_DataValidation::OPERATOR_EQUAL ; break; - case 0x03: $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTEQUAL ; break; - case 0x04: $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHAN ; break; - case 0x05: $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHAN ; break; - case 0x06: $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL; break; - case 0x07: $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHANOREQUAL ; break; - } - - // offset: 4; size: var; title of the prompt box - $offset = 4; - $string = self::_readUnicodeStringLong(substr($recordData, $offset)); - $promptTitle = $string['value'] !== chr(0) ? - $string['value'] : ''; - $offset += $string['size']; - - // offset: var; size: var; title of the error box - $string = self::_readUnicodeStringLong(substr($recordData, $offset)); - $errorTitle = $string['value'] !== chr(0) ? - $string['value'] : ''; - $offset += $string['size']; - - // offset: var; size: var; text of the prompt box - $string = self::_readUnicodeStringLong(substr($recordData, $offset)); - $prompt = $string['value'] !== chr(0) ? - $string['value'] : ''; - $offset += $string['size']; - - // offset: var; size: var; text of the error box - $string = self::_readUnicodeStringLong(substr($recordData, $offset)); - $error = $string['value'] !== chr(0) ? - $string['value'] : ''; - $offset += $string['size']; - - // offset: var; size: 2; size of the formula data for the first condition - $sz1 = self::_GetInt2d($recordData, $offset); - $offset += 2; - - // offset: var; size: 2; not used - $offset += 2; - - // offset: var; size: $sz1; formula data for first condition (without size field) - $formula1 = substr($recordData, $offset, $sz1); - $formula1 = pack('v', $sz1) . $formula1; // prepend the length - try { - $formula1 = $this->_getFormulaFromStructure($formula1); - - // in list type validity, null characters are used as item separators - if ($type == PHPExcel_Cell_DataValidation::TYPE_LIST) { - $formula1 = str_replace(chr(0), ',', $formula1); - } - } catch (Exception $e) { - return; - } - $offset += $sz1; - - // offset: var; size: 2; size of the formula data for the first condition - $sz2 = self::_GetInt2d($recordData, $offset); - $offset += 2; - - // offset: var; size: 2; not used - $offset += 2; - - // offset: var; size: $sz2; formula data for second condition (without size field) - $formula2 = substr($recordData, $offset, $sz2); - $formula2 = pack('v', $sz2) . $formula2; // prepend the length - try { - $formula2 = $this->_getFormulaFromStructure($formula2); - } catch (Exception $e) { - return; - } - $offset += $sz2; - - // offset: var; size: var; cell range address list with - $cellRangeAddressList = $this->_readBIFF8CellRangeAddressList(substr($recordData, $offset)); - $cellRangeAddresses = $cellRangeAddressList['cellRangeAddresses']; - - foreach ($cellRangeAddresses as $cellRange) { - $stRange = $this->_phpSheet->shrinkRangeToFit($cellRange); - $stRange = PHPExcel_Cell::extractAllCellReferencesInRange($stRange); - foreach ($stRange as $coordinate) { - $objValidation = $this->_phpSheet->getCell($coordinate)->getDataValidation(); - $objValidation->setType($type); - $objValidation->setErrorStyle($errorStyle); - $objValidation->setAllowBlank((bool)$allowBlank); - $objValidation->setShowInputMessage((bool)$showInputMessage); - $objValidation->setShowErrorMessage((bool)$showErrorMessage); - $objValidation->setShowDropDown(!$suppressDropDown); - $objValidation->setOperator($operator); - $objValidation->setErrorTitle($errorTitle); - $objValidation->setError($error); - $objValidation->setPromptTitle($promptTitle); - $objValidation->setPrompt($prompt); - $objValidation->setFormula1($formula1); - $objValidation->setFormula2($formula2); - } - } - - } - - /** - * Read SHEETLAYOUT record. Stores sheet tab color information. - */ - private function _readSheetLayout() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // local pointer in record data - $offset = 0; - - if (!$this->_readDataOnly) { - // offset: 0; size: 2; repeated record identifier 0x0862 - - // offset: 2; size: 10; not used - - // offset: 12; size: 4; size of record data - // Excel 2003 uses size of 0x14 (documented), Excel 2007 uses size of 0x28 (not documented?) - $sz = self::_GetInt4d($recordData, 12); - - switch ($sz) { - case 0x14: - // offset: 16; size: 2; color index for sheet tab - $colorIndex = self::_GetInt2d($recordData, 16); - $color = self::_readColor($colorIndex,$this->_palette,$this->_version); - $this->_phpSheet->getTabColor()->setRGB($color['rgb']); - break; - - case 0x28: - // TODO: Investigate structure for .xls SHEETLAYOUT record as saved by MS Office Excel 2007 - return; - break; - } - } - } - - /** - * Read SHEETPROTECTION record (FEATHEADR) - */ - private function _readSheetProtection() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - if ($this->_readDataOnly) { - return; - } - - // offset: 0; size: 2; repeated record header - - // offset: 2; size: 2; FRT cell reference flag (=0 currently) - - // offset: 4; size: 8; Currently not used and set to 0 - - // offset: 12; size: 2; Shared feature type index (2=Enhanced Protetion, 4=SmartTag) - $isf = self::_GetInt2d($recordData, 12); - if ($isf != 2) { - return; - } - - // offset: 14; size: 1; =1 since this is a feat header - - // offset: 15; size: 4; size of rgbHdrSData - - // rgbHdrSData, assume "Enhanced Protection" - // offset: 19; size: 2; option flags - $options = self::_GetInt2d($recordData, 19); - - // bit: 0; mask 0x0001; 1 = user may edit objects, 0 = users must not edit objects - $bool = (0x0001 & $options) >> 0; - $this->_phpSheet->getProtection()->setObjects(!$bool); - - // bit: 1; mask 0x0002; edit scenarios - $bool = (0x0002 & $options) >> 1; - $this->_phpSheet->getProtection()->setScenarios(!$bool); - - // bit: 2; mask 0x0004; format cells - $bool = (0x0004 & $options) >> 2; - $this->_phpSheet->getProtection()->setFormatCells(!$bool); - - // bit: 3; mask 0x0008; format columns - $bool = (0x0008 & $options) >> 3; - $this->_phpSheet->getProtection()->setFormatColumns(!$bool); - - // bit: 4; mask 0x0010; format rows - $bool = (0x0010 & $options) >> 4; - $this->_phpSheet->getProtection()->setFormatRows(!$bool); - - // bit: 5; mask 0x0020; insert columns - $bool = (0x0020 & $options) >> 5; - $this->_phpSheet->getProtection()->setInsertColumns(!$bool); - - // bit: 6; mask 0x0040; insert rows - $bool = (0x0040 & $options) >> 6; - $this->_phpSheet->getProtection()->setInsertRows(!$bool); - - // bit: 7; mask 0x0080; insert hyperlinks - $bool = (0x0080 & $options) >> 7; - $this->_phpSheet->getProtection()->setInsertHyperlinks(!$bool); - - // bit: 8; mask 0x0100; delete columns - $bool = (0x0100 & $options) >> 8; - $this->_phpSheet->getProtection()->setDeleteColumns(!$bool); - - // bit: 9; mask 0x0200; delete rows - $bool = (0x0200 & $options) >> 9; - $this->_phpSheet->getProtection()->setDeleteRows(!$bool); - - // bit: 10; mask 0x0400; select locked cells - $bool = (0x0400 & $options) >> 10; - $this->_phpSheet->getProtection()->setSelectLockedCells(!$bool); - - // bit: 11; mask 0x0800; sort cell range - $bool = (0x0800 & $options) >> 11; - $this->_phpSheet->getProtection()->setSort(!$bool); - - // bit: 12; mask 0x1000; auto filter - $bool = (0x1000 & $options) >> 12; - $this->_phpSheet->getProtection()->setAutoFilter(!$bool); - - // bit: 13; mask 0x2000; pivot tables - $bool = (0x2000 & $options) >> 13; - $this->_phpSheet->getProtection()->setPivotTables(!$bool); - - // bit: 14; mask 0x4000; select unlocked cells - $bool = (0x4000 & $options) >> 14; - $this->_phpSheet->getProtection()->setSelectUnlockedCells(!$bool); - - // offset: 21; size: 2; not used - } - - /** - * Read RANGEPROTECTION record - * Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification, - * where it is referred to as FEAT record - */ - private function _readRangeProtection() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // move stream pointer to next record - $this->_pos += 4 + $length; - - // local pointer in record data - $offset = 0; - - if (!$this->_readDataOnly) { - $offset += 12; - - // offset: 12; size: 2; shared feature type, 2 = enhanced protection, 4 = smart tag - $isf = self::_GetInt2d($recordData, 12); - if ($isf != 2) { - // we only read FEAT records of type 2 - return; - } - $offset += 2; - - $offset += 5; - - // offset: 19; size: 2; count of ref ranges this feature is on - $cref = self::_GetInt2d($recordData, 19); - $offset += 2; - - $offset += 6; - - // offset: 27; size: 8 * $cref; list of cell ranges (like in hyperlink record) - $cellRanges = array(); - for ($i = 0; $i < $cref; ++$i) { - try { - $cellRange = $this->_readBIFF8CellRangeAddressFixed(substr($recordData, 27 + 8 * $i, 8)); - } catch (Exception $e) { - return; - } - $cellRanges[] = $cellRange; - $offset += 8; - } - - // offset: var; size: var; variable length of feature specific data - $rgbFeat = substr($recordData, $offset); - $offset += 4; - - // offset: var; size: 4; the encrypted password (only 16-bit although field is 32-bit) - $wPassword = self::_GetInt4d($recordData, $offset); - $offset += 4; - - // Apply range protection to sheet - if ($cellRanges) { - $this->_phpSheet->protectCells(implode(' ', $cellRanges), strtoupper(dechex($wPassword)), true); - } - } - } - - /** - * Read IMDATA record - */ - private function _readImData() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - - // get spliced record data - $splicedRecordData = $this->_getSplicedRecordData(); - $recordData = $splicedRecordData['recordData']; - - // UNDER CONSTRUCTION - - // offset: 0; size: 2; image format - $cf = self::_GetInt2d($recordData, 0); - - // offset: 2; size: 2; environment from which the file was written - $env = self::_GetInt2d($recordData, 2); - - // offset: 4; size: 4; length of the image data - $lcb = self::_GetInt4d($recordData, 4); - - // offset: 8; size: var; image data - $iData = substr($recordData, 8); - - switch ($cf) { - case 0x09: // Windows bitmap format - // BITMAPCOREINFO - // 1. BITMAPCOREHEADER - // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure - $bcSize = self::_GetInt4d($iData, 0); -// var_dump($bcSize); - - // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels - $bcWidth = self::_GetInt2d($iData, 4); -// var_dump($bcWidth); - - // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels. - $bcHeight = self::_GetInt2d($iData, 6); -// var_dump($bcHeight); - $ih = imagecreatetruecolor($bcWidth, $bcHeight); - - // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1 - - // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24 - $bcBitCount = self::_GetInt2d($iData, 10); -// var_dump($bcBitCount); - - $rgbString = substr($iData, 12); - $rgbTriples = array(); - while (strlen($rgbString) > 0) { - $rgbTriples[] = unpack('Cb/Cg/Cr', $rgbString); - $rgbString = substr($rgbString, 3); - } - $x = 0; - $y = 0; - foreach ($rgbTriples as $i => $rgbTriple) { - $color = imagecolorallocate($ih, $rgbTriple['r'], $rgbTriple['g'], $rgbTriple['b']); - imagesetpixel($ih, $x, $bcHeight - 1 - $y, $color); - $x = ($x + 1) % $bcWidth; - $y = $y + floor(($x + 1) / $bcWidth); - } - //imagepng($ih, 'image.png'); - - $drawing = new PHPExcel_Worksheet_Drawing(); - $drawing->setPath($filename); - $drawing->setWorksheet($this->_phpSheet); - - break; - - case 0x02: // Windows metafile or Macintosh PICT format - case 0x0e: // native format - default; - break; - - } - - // _getSplicedRecordData() takes care of moving current position in data stream - } - - /** - * Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record - * When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented. - * In this case, we must treat the CONTINUE record as a MSODRAWING record - */ - private function _readContinue() - { - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $recordData = substr($this->_data, $this->_pos + 4, $length); - - // check if we are reading drawing data - // this is in case a free CONTINUE record occurs in other circumstances we are unaware of - if ($this->_drawingData == '') { - // move stream pointer to next record - $this->_pos += 4 + $length; - - return; - } - - // check if record data is at least 4 bytes long, otherwise there is no chance this is MSODRAWING data - if ($length < 4) { - // move stream pointer to next record - $this->_pos += 4 + $length; - - return; - } - - // dirty check to see if CONTINUE record could be a camouflaged MSODRAWING record - // look inside CONTINUE record to see if it looks like a part of an Escher stream - // we know that Escher stream may be split at least at - // 0xF003 MsofbtSpgrContainer - // 0xF004 MsofbtSpContainer - // 0xF00D MsofbtClientTextbox - $validSplitPoints = array(0xF003, 0xF004, 0xF00D); // add identifiers if we find more - - $splitPoint = self::_GetInt2d($recordData, 2); - if (in_array($splitPoint, $validSplitPoints)) { - // get spliced record data (and move pointer to next record) - $splicedRecordData = $this->_getSplicedRecordData(); - $this->_drawingData .= $splicedRecordData['recordData']; - - return; - } - - // move stream pointer to next record - $this->_pos += 4 + $length; - - } - - - /** - * Reads a record from current position in data stream and continues reading data as long as CONTINUE - * records are found. Splices the record data pieces and returns the combined string as if record data - * is in one piece. - * Moves to next current position in data stream to start of next record different from a CONtINUE record - * - * @return array - */ - private function _getSplicedRecordData() - { - $data = ''; - $spliceOffsets = array(); - - $i = 0; - $spliceOffsets[0] = 0; - - do { - ++$i; - - // offset: 0; size: 2; identifier - $identifier = self::_GetInt2d($this->_data, $this->_pos); - // offset: 2; size: 2; length - $length = self::_GetInt2d($this->_data, $this->_pos + 2); - $data .= substr($this->_data, $this->_pos + 4, $length); - - $spliceOffsets[$i] = $spliceOffsets[$i - 1] + $length; - - $this->_pos += 4 + $length; - $nextIdentifier = self::_GetInt2d($this->_data, $this->_pos); - } - while ($nextIdentifier == self::XLS_Type_CONTINUE); - - $splicedData = array( - 'recordData' => $data, - 'spliceOffsets' => $spliceOffsets, - ); - - return $splicedData; - - } - - /** - * Convert formula structure into human readable Excel formula like 'A3+A5*5' - * - * @param string $formulaStructure The complete binary data for the formula - * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas - * @return string Human readable formula - */ - private function _getFormulaFromStructure($formulaStructure, $baseCell = 'A1') - { - // offset: 0; size: 2; size of the following formula data - $sz = self::_GetInt2d($formulaStructure, 0); - - // offset: 2; size: sz - $formulaData = substr($formulaStructure, 2, $sz); - - // for debug: dump the formula data - //echo ''; - //echo 'size: ' . $sz . "\n"; - //echo 'the entire formula data: '; - //Debug::dump($formulaData); - //echo "\n----\n"; - - // offset: 2 + sz; size: variable (optional) - if (strlen($formulaStructure) > 2 + $sz) { - $additionalData = substr($formulaStructure, 2 + $sz); - - // for debug: dump the additional data - //echo 'the entire additional data: '; - //Debug::dump($additionalData); - //echo "\n----\n"; - - } else { - $additionalData = ''; - } - - return $this->_getFormulaFromData($formulaData, $additionalData, $baseCell); - } - - /** - * Take formula data and additional data for formula and return human readable formula - * - * @param string $formulaData The binary data for the formula itself - * @param string $additionalData Additional binary data going with the formula - * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas - * @return string Human readable formula - */ - private function _getFormulaFromData($formulaData, $additionalData = '', $baseCell = 'A1') - { - // start parsing the formula data - $tokens = array(); - - while (strlen($formulaData) > 0 and $token = $this->_getNextToken($formulaData, $baseCell)) { - $tokens[] = $token; - $formulaData = substr($formulaData, $token['size']); - - // for debug: dump the token - //var_dump($token); - } - - $formulaString = $this->_createFormulaFromTokens($tokens, $additionalData); - - return $formulaString; - } - - /** - * Take array of tokens together with additional data for formula and return human readable formula - * - * @param array $tokens - * @param array $additionalData Additional binary data going with the formula - * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas - * @return string Human readable formula - */ - private function _createFormulaFromTokens($tokens, $additionalData) - { - // empty formula? - if (count($tokens) == 0) { - return ''; - } - - $formulaStrings = array(); - foreach ($tokens as $token) { - // initialize spaces - $space0 = isset($space0) ? $space0 : ''; // spaces before next token, not tParen - $space1 = isset($space1) ? $space1 : ''; // carriage returns before next token, not tParen - $space2 = isset($space2) ? $space2 : ''; // spaces before opening parenthesis - $space3 = isset($space3) ? $space3 : ''; // carriage returns before opening parenthesis - $space4 = isset($space4) ? $space4 : ''; // spaces before closing parenthesis - $space5 = isset($space5) ? $space5 : ''; // carriage returns before closing parenthesis - - switch ($token['name']) { - case 'tAdd': // addition - case 'tConcat': // addition - case 'tDiv': // division - case 'tEQ': // equality - case 'tGE': // greater than or equal - case 'tGT': // greater than - case 'tIsect': // intersection - case 'tLE': // less than or equal - case 'tList': // less than or equal - case 'tLT': // less than - case 'tMul': // multiplication - case 'tNE': // multiplication - case 'tPower': // power - case 'tRange': // range - case 'tSub': // subtraction - $op2 = array_pop($formulaStrings); - $op1 = array_pop($formulaStrings); - $formulaStrings[] = "$op1$space1$space0{$token['data']}$op2"; - unset($space0, $space1); - break; - case 'tUplus': // unary plus - case 'tUminus': // unary minus - $op = array_pop($formulaStrings); - $formulaStrings[] = "$space1$space0{$token['data']}$op"; - unset($space0, $space1); - break; - case 'tPercent': // percent sign - $op = array_pop($formulaStrings); - $formulaStrings[] = "$op$space1$space0{$token['data']}"; - unset($space0, $space1); - break; - case 'tAttrVolatile': // indicates volatile function - case 'tAttrIf': - case 'tAttrSkip': - case 'tAttrChoose': - // token is only important for Excel formula evaluator - // do nothing - break; - case 'tAttrSpace': // space / carriage return - // space will be used when next token arrives, do not alter formulaString stack - switch ($token['data']['spacetype']) { - case 'type0': - $space0 = str_repeat(' ', $token['data']['spacecount']); - break; - case 'type1': - $space1 = str_repeat("\n", $token['data']['spacecount']); - break; - case 'type2': - $space2 = str_repeat(' ', $token['data']['spacecount']); - break; - case 'type3': - $space3 = str_repeat("\n", $token['data']['spacecount']); - break; - case 'type4': - $space4 = str_repeat(' ', $token['data']['spacecount']); - break; - case 'type5': - $space5 = str_repeat("\n", $token['data']['spacecount']); - break; - } - break; - case 'tAttrSum': // SUM function with one parameter - $op = array_pop($formulaStrings); - $formulaStrings[] = "{$space1}{$space0}SUM($op)"; - unset($space0, $space1); - break; - case 'tFunc': // function with fixed number of arguments - case 'tFuncV': // function with variable number of arguments - if ($token['data']['function'] != '') { - // normal function - $ops = array(); // array of operators - for ($i = 0; $i < $token['data']['args']; ++$i) { - $ops[] = array_pop($formulaStrings); - } - $ops = array_reverse($ops); - $formulaStrings[] = "$space1$space0{$token['data']['function']}(" . implode(',', $ops) . ")"; - unset($space0, $space1); - } else { - // add-in function - $ops = array(); // array of operators - for ($i = 0; $i < $token['data']['args'] - 1; ++$i) { - $ops[] = array_pop($formulaStrings); - } - $ops = array_reverse($ops); - $function = array_pop($formulaStrings); - $formulaStrings[] = "$space1$space0$function(" . implode(',', $ops) . ")"; - unset($space0, $space1); - } - break; - case 'tParen': // parenthesis - $expression = array_pop($formulaStrings); - $formulaStrings[] = "$space3$space2($expression$space5$space4)"; - unset($space2, $space3, $space4, $space5); - break; - case 'tArray': // array constant - $constantArray = self::_readBIFF8ConstantArray($additionalData); - $formulaStrings[] = $space1 . $space0 . $constantArray['value']; - $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data - unset($space0, $space1); - break; - case 'tMemArea': - // bite off chunk of additional data - $cellRangeAddressList = $this->_readBIFF8CellRangeAddressList($additionalData); - $additionalData = substr($additionalData, $cellRangeAddressList['size']); - $formulaStrings[] = "$space1$space0{$token['data']}"; - unset($space0, $space1); - break; - case 'tArea': // cell range address - case 'tBool': // boolean - case 'tErr': // error code - case 'tInt': // integer - case 'tMemErr': - case 'tMemFunc': - case 'tMissArg': - case 'tName': - case 'tNameX': - case 'tNum': // number - case 'tRef': // single cell reference - case 'tRef3d': // 3d cell reference - case 'tArea3d': // 3d cell range reference - case 'tRefN': - case 'tAreaN': - case 'tStr': // string - $formulaStrings[] = "$space1$space0{$token['data']}"; - unset($space0, $space1); - break; - } - } - $formulaString = $formulaStrings[0]; - - // for debug: dump the human readable formula - //echo '----' . "\n"; - //echo 'Formula: ' . $formulaString; - - return $formulaString; - } - - /** - * Fetch next token from binary formula data - * - * @param string Formula data - * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas - * @return array - * @throws Exception - */ - private function _getNextToken($formulaData, $baseCell = 'A1') - { - // offset: 0; size: 1; token id - $id = ord($formulaData[0]); // token id - $name = false; // initialize token name - - switch ($id) { - case 0x03: $name = 'tAdd'; $size = 1; $data = '+'; break; - case 0x04: $name = 'tSub'; $size = 1; $data = '-'; break; - case 0x05: $name = 'tMul'; $size = 1; $data = '*'; break; - case 0x06: $name = 'tDiv'; $size = 1; $data = '/'; break; - case 0x07: $name = 'tPower'; $size = 1; $data = '^'; break; - case 0x08: $name = 'tConcat'; $size = 1; $data = '&'; break; - case 0x09: $name = 'tLT'; $size = 1; $data = '<'; break; - case 0x0A: $name = 'tLE'; $size = 1; $data = '<='; break; - case 0x0B: $name = 'tEQ'; $size = 1; $data = '='; break; - case 0x0C: $name = 'tGE'; $size = 1; $data = '>='; break; - case 0x0D: $name = 'tGT'; $size = 1; $data = '>'; break; - case 0x0E: $name = 'tNE'; $size = 1; $data = '<>'; break; - case 0x0F: $name = 'tIsect'; $size = 1; $data = ' '; break; - case 0x10: $name = 'tList'; $size = 1; $data = ','; break; - case 0x11: $name = 'tRange'; $size = 1; $data = ':'; break; - case 0x12: $name = 'tUplus'; $size = 1; $data = '+'; break; - case 0x13: $name = 'tUminus'; $size = 1; $data = '-'; break; - case 0x14: $name = 'tPercent'; $size = 1; $data = '%'; break; - case 0x15: // parenthesis - $name = 'tParen'; - $size = 1; - $data = null; - break; - case 0x16: // missing argument - $name = 'tMissArg'; - $size = 1; - $data = ''; - break; - case 0x17: // string - $name = 'tStr'; - // offset: 1; size: var; Unicode string, 8-bit string length - $string = self::_readUnicodeStringShort(substr($formulaData, 1)); - $size = 1 + $string['size']; - $data = self::_UTF8toExcelDoubleQuoted($string['value']); - break; - case 0x19: // Special attribute - // offset: 1; size: 1; attribute type flags: - switch (ord($formulaData[1])) { - case 0x01: - $name = 'tAttrVolatile'; - $size = 4; - $data = null; - break; - case 0x02: - $name = 'tAttrIf'; - $size = 4; - $data = null; - break; - case 0x04: - $name = 'tAttrChoose'; - // offset: 2; size: 2; number of choices in the CHOOSE function ($nc, number of parameters decreased by 1) - $nc = self::_GetInt2d($formulaData, 2); - // offset: 4; size: 2 * $nc - // offset: 4 + 2 * $nc; size: 2 - $size = 2 * $nc + 6; - $data = null; - break; - case 0x08: - $name = 'tAttrSkip'; - $size = 4; - $data = null; - break; - case 0x10: - $name = 'tAttrSum'; - $size = 4; - $data = null; - break; - case 0x40: - case 0x41: - $name = 'tAttrSpace'; - $size = 4; - // offset: 2; size: 2; space type and position - switch (ord($formulaData[2])) { - case 0x00: - $spacetype = 'type0'; - break; - case 0x01: - $spacetype = 'type1'; - break; - case 0x02: - $spacetype = 'type2'; - break; - case 0x03: - $spacetype = 'type3'; - break; - case 0x04: - $spacetype = 'type4'; - break; - case 0x05: - $spacetype = 'type5'; - break; - default: - throw new Exception('Unrecognized space type in tAttrSpace token'); - break; - } - // offset: 3; size: 1; number of inserted spaces/carriage returns - $spacecount = ord($formulaData[3]); - - $data = array('spacetype' => $spacetype, 'spacecount' => $spacecount); - break; - default: - throw new Exception('Unrecognized attribute flag in tAttr token'); - break; - } - break; - case 0x1C: // error code - // offset: 1; size: 1; error code - $name = 'tErr'; - $size = 2; - $data = self::_mapErrorCode(ord($formulaData[1])); - break; - case 0x1D: // boolean - // offset: 1; size: 1; 0 = false, 1 = true; - $name = 'tBool'; - $size = 2; - $data = ord($formulaData[1]) ? 'TRUE' : 'FALSE'; - break; - case 0x1E: // integer - // offset: 1; size: 2; unsigned 16-bit integer - $name = 'tInt'; - $size = 3; - $data = self::_GetInt2d($formulaData, 1); - break; - case 0x1F: // number - // offset: 1; size: 8; - $name = 'tNum'; - $size = 9; - $data = self::_extractNumber(substr($formulaData, 1)); - $data = str_replace(',', '.', (string)$data); // in case non-English locale - break; - case 0x20: // array constant - case 0x40: - case 0x60: - // offset: 1; size: 7; not used - $name = 'tArray'; - $size = 8; - $data = null; - break; - case 0x21: // function with fixed number of arguments - case 0x41: - case 0x61: - $name = 'tFunc'; - $size = 3; - // offset: 1; size: 2; index to built-in sheet function - switch (self::_GetInt2d($formulaData, 1)) { - case 2: $function = 'ISNA'; $args = 1; break; - case 3: $function = 'ISERROR'; $args = 1; break; - case 10: $function = 'NA'; $args = 0; break; - case 15: $function = 'SIN'; $args = 1; break; - case 16: $function = 'COS'; $args = 1; break; - case 17: $function = 'TAN'; $args = 1; break; - case 18: $function = 'ATAN'; $args = 1; break; - case 19: $function = 'PI'; $args = 0; break; - case 20: $function = 'SQRT'; $args = 1; break; - case 21: $function = 'EXP'; $args = 1; break; - case 22: $function = 'LN'; $args = 1; break; - case 23: $function = 'LOG10'; $args = 1; break; - case 24: $function = 'ABS'; $args = 1; break; - case 25: $function = 'INT'; $args = 1; break; - case 26: $function = 'SIGN'; $args = 1; break; - case 27: $function = 'ROUND'; $args = 2; break; - case 30: $function = 'REPT'; $args = 2; break; - case 31: $function = 'MID'; $args = 3; break; - case 32: $function = 'LEN'; $args = 1; break; - case 33: $function = 'VALUE'; $args = 1; break; - case 34: $function = 'TRUE'; $args = 0; break; - case 35: $function = 'FALSE'; $args = 0; break; - case 38: $function = 'NOT'; $args = 1; break; - case 39: $function = 'MOD'; $args = 2; break; - case 40: $function = 'DCOUNT'; $args = 3; break; - case 41: $function = 'DSUM'; $args = 3; break; - case 42: $function = 'DAVERAGE'; $args = 3; break; - case 43: $function = 'DMIN'; $args = 3; break; - case 44: $function = 'DMAX'; $args = 3; break; - case 45: $function = 'DSTDEV'; $args = 3; break; - case 48: $function = 'TEXT'; $args = 2; break; - case 61: $function = 'MIRR'; $args = 3; break; - case 63: $function = 'RAND'; $args = 0; break; - case 65: $function = 'DATE'; $args = 3; break; - case 66: $function = 'TIME'; $args = 3; break; - case 67: $function = 'DAY'; $args = 1; break; - case 68: $function = 'MONTH'; $args = 1; break; - case 69: $function = 'YEAR'; $args = 1; break; - case 71: $function = 'HOUR'; $args = 1; break; - case 72: $function = 'MINUTE'; $args = 1; break; - case 73: $function = 'SECOND'; $args = 1; break; - case 74: $function = 'NOW'; $args = 0; break; - case 75: $function = 'AREAS'; $args = 1; break; - case 76: $function = 'ROWS'; $args = 1; break; - case 77: $function = 'COLUMNS'; $args = 1; break; - case 83: $function = 'TRANSPOSE'; $args = 1; break; - case 86: $function = 'TYPE'; $args = 1; break; - case 97: $function = 'ATAN2'; $args = 2; break; - case 98: $function = 'ASIN'; $args = 1; break; - case 99: $function = 'ACOS'; $args = 1; break; - case 105: $function = 'ISREF'; $args = 1; break; - case 111: $function = 'CHAR'; $args = 1; break; - case 112: $function = 'LOWER'; $args = 1; break; - case 113: $function = 'UPPER'; $args = 1; break; - case 114: $function = 'PROPER'; $args = 1; break; - case 117: $function = 'EXACT'; $args = 2; break; - case 118: $function = 'TRIM'; $args = 1; break; - case 119: $function = 'REPLACE'; $args = 4; break; - case 121: $function = 'CODE'; $args = 1; break; - case 126: $function = 'ISERR'; $args = 1; break; - case 127: $function = 'ISTEXT'; $args = 1; break; - case 128: $function = 'ISNUMBER'; $args = 1; break; - case 129: $function = 'ISBLANK'; $args = 1; break; - case 130: $function = 'T'; $args = 1; break; - case 131: $function = 'N'; $args = 1; break; - case 140: $function = 'DATEVALUE'; $args = 1; break; - case 141: $function = 'TIMEVALUE'; $args = 1; break; - case 142: $function = 'SLN'; $args = 3; break; - case 143: $function = 'SYD'; $args = 4; break; - case 162: $function = 'CLEAN'; $args = 1; break; - case 163: $function = 'MDETERM'; $args = 1; break; - case 164: $function = 'MINVERSE'; $args = 1; break; - case 165: $function = 'MMULT'; $args = 2; break; - case 184: $function = 'FACT'; $args = 1; break; - case 189: $function = 'DPRODUCT'; $args = 3; break; - case 190: $function = 'ISNONTEXT'; $args = 1; break; - case 195: $function = 'DSTDEVP'; $args = 3; break; - case 196: $function = 'DVARP'; $args = 3; break; - case 198: $function = 'ISLOGICAL'; $args = 1; break; - case 199: $function = 'DCOUNTA'; $args = 3; break; - case 207: $function = 'REPLACEB'; $args = 4; break; - case 210: $function = 'MIDB'; $args = 3; break; - case 211: $function = 'LENB'; $args = 1; break; - case 212: $function = 'ROUNDUP'; $args = 2; break; - case 213: $function = 'ROUNDDOWN'; $args = 2; break; - case 214: $function = 'ASC'; $args = 1; break; - case 215: $function = 'DBCS'; $args = 1; break; - case 221: $function = 'TODAY'; $args = 0; break; - case 229: $function = 'SINH'; $args = 1; break; - case 230: $function = 'COSH'; $args = 1; break; - case 231: $function = 'TANH'; $args = 1; break; - case 232: $function = 'ASINH'; $args = 1; break; - case 233: $function = 'ACOSH'; $args = 1; break; - case 234: $function = 'ATANH'; $args = 1; break; - case 235: $function = 'DGET'; $args = 3; break; - case 244: $function = 'INFO'; $args = 1; break; - case 252: $function = 'FREQUENCY'; $args = 2; break; - case 261: $function = 'ERROR.TYPE'; $args = 1; break; - case 271: $function = 'GAMMALN'; $args = 1; break; - case 273: $function = 'BINOMDIST'; $args = 4; break; - case 274: $function = 'CHIDIST'; $args = 2; break; - case 275: $function = 'CHIINV'; $args = 2; break; - case 276: $function = 'COMBIN'; $args = 2; break; - case 277: $function = 'CONFIDENCE'; $args = 3; break; - case 278: $function = 'CRITBINOM'; $args = 3; break; - case 279: $function = 'EVEN'; $args = 1; break; - case 280: $function = 'EXPONDIST'; $args = 3; break; - case 281: $function = 'FDIST'; $args = 3; break; - case 282: $function = 'FINV'; $args = 3; break; - case 283: $function = 'FISHER'; $args = 1; break; - case 284: $function = 'FISHERINV'; $args = 1; break; - case 285: $function = 'FLOOR'; $args = 2; break; - case 286: $function = 'GAMMADIST'; $args = 4; break; - case 287: $function = 'GAMMAINV'; $args = 3; break; - case 288: $function = 'CEILING'; $args = 2; break; - case 289: $function = 'HYPGEOMDIST'; $args = 4; break; - case 290: $function = 'LOGNORMDIST'; $args = 3; break; - case 291: $function = 'LOGINV'; $args = 3; break; - case 292: $function = 'NEGBINOMDIST'; $args = 3; break; - case 293: $function = 'NORMDIST'; $args = 4; break; - case 294: $function = 'NORMSDIST'; $args = 1; break; - case 295: $function = 'NORMINV'; $args = 3; break; - case 296: $function = 'NORMSINV'; $args = 1; break; - case 297: $function = 'STANDARDIZE'; $args = 3; break; - case 298: $function = 'ODD'; $args = 1; break; - case 299: $function = 'PERMUT'; $args = 2; break; - case 300: $function = 'POISSON'; $args = 3; break; - case 301: $function = 'TDIST'; $args = 3; break; - case 302: $function = 'WEIBULL'; $args = 4; break; - case 303: $function = 'SUMXMY2'; $args = 2; break; - case 304: $function = 'SUMX2MY2'; $args = 2; break; - case 305: $function = 'SUMX2PY2'; $args = 2; break; - case 306: $function = 'CHITEST'; $args = 2; break; - case 307: $function = 'CORREL'; $args = 2; break; - case 308: $function = 'COVAR'; $args = 2; break; - case 309: $function = 'FORECAST'; $args = 3; break; - case 310: $function = 'FTEST'; $args = 2; break; - case 311: $function = 'INTERCEPT'; $args = 2; break; - case 312: $function = 'PEARSON'; $args = 2; break; - case 313: $function = 'RSQ'; $args = 2; break; - case 314: $function = 'STEYX'; $args = 2; break; - case 315: $function = 'SLOPE'; $args = 2; break; - case 316: $function = 'TTEST'; $args = 4; break; - case 325: $function = 'LARGE'; $args = 2; break; - case 326: $function = 'SMALL'; $args = 2; break; - case 327: $function = 'QUARTILE'; $args = 2; break; - case 328: $function = 'PERCENTILE'; $args = 2; break; - case 331: $function = 'TRIMMEAN'; $args = 2; break; - case 332: $function = 'TINV'; $args = 2; break; - case 337: $function = 'POWER'; $args = 2; break; - case 342: $function = 'RADIANS'; $args = 1; break; - case 343: $function = 'DEGREES'; $args = 1; break; - case 346: $function = 'COUNTIF'; $args = 2; break; - case 347: $function = 'COUNTBLANK'; $args = 1; break; - case 350: $function = 'ISPMT'; $args = 4; break; - case 351: $function = 'DATEDIF'; $args = 3; break; - case 352: $function = 'DATESTRING'; $args = 1; break; - case 353: $function = 'NUMBERSTRING'; $args = 2; break; - case 360: $function = 'PHONETIC'; $args = 1; break; - case 368: $function = 'BAHTTEXT'; $args = 1; break; - default: - throw new Exception('Unrecognized function in formula'); - break; - } - $data = array('function' => $function, 'args' => $args); - break; - case 0x22: // function with variable number of arguments - case 0x42: - case 0x62: - $name = 'tFuncV'; - $size = 4; - // offset: 1; size: 1; number of arguments - $args = ord($formulaData[1]); - // offset: 2: size: 2; index to built-in sheet function - $index = self::_GetInt2d($formulaData, 2); - switch ($index) { - case 0: $function = 'COUNT'; break; - case 1: $function = 'IF'; break; - case 4: $function = 'SUM'; break; - case 5: $function = 'AVERAGE'; break; - case 6: $function = 'MIN'; break; - case 7: $function = 'MAX'; break; - case 8: $function = 'ROW'; break; - case 9: $function = 'COLUMN'; break; - case 11: $function = 'NPV'; break; - case 12: $function = 'STDEV'; break; - case 13: $function = 'DOLLAR'; break; - case 14: $function = 'FIXED'; break; - case 28: $function = 'LOOKUP'; break; - case 29: $function = 'INDEX'; break; - case 36: $function = 'AND'; break; - case 37: $function = 'OR'; break; - case 46: $function = 'VAR'; break; - case 49: $function = 'LINEST'; break; - case 50: $function = 'TREND'; break; - case 51: $function = 'LOGEST'; break; - case 52: $function = 'GROWTH'; break; - case 56: $function = 'PV'; break; - case 57: $function = 'FV'; break; - case 58: $function = 'NPER'; break; - case 59: $function = 'PMT'; break; - case 60: $function = 'RATE'; break; - case 62: $function = 'IRR'; break; - case 64: $function = 'MATCH'; break; - case 70: $function = 'WEEKDAY'; break; - case 78: $function = 'OFFSET'; break; - case 82: $function = 'SEARCH'; break; - case 100: $function = 'CHOOSE'; break; - case 101: $function = 'HLOOKUP'; break; - case 102: $function = 'VLOOKUP'; break; - case 109: $function = 'LOG'; break; - case 115: $function = 'LEFT'; break; - case 116: $function = 'RIGHT'; break; - case 120: $function = 'SUBSTITUTE'; break; - case 124: $function = 'FIND'; break; - case 125: $function = 'CELL'; break; - case 144: $function = 'DDB'; break; - case 148: $function = 'INDIRECT'; break; - case 167: $function = 'IPMT'; break; - case 168: $function = 'PPMT'; break; - case 169: $function = 'COUNTA'; break; - case 183: $function = 'PRODUCT'; break; - case 193: $function = 'STDEVP'; break; - case 194: $function = 'VARP'; break; - case 197: $function = 'TRUNC'; break; - case 204: $function = 'USDOLLAR'; break; - case 205: $function = 'FINDB'; break; - case 206: $function = 'SEARCHB'; break; - case 208: $function = 'LEFTB'; break; - case 209: $function = 'RIGHTB'; break; - case 216: $function = 'RANK'; break; - case 219: $function = 'ADDRESS'; break; - case 220: $function = 'DAYS360'; break; - case 222: $function = 'VDB'; break; - case 227: $function = 'MEDIAN'; break; - case 228: $function = 'SUMPRODUCT'; break; - case 247: $function = 'DB'; break; - case 255: $function = ''; break; - case 269: $function = 'AVEDEV'; break; - case 270: $function = 'BETADIST'; break; - case 272: $function = 'BETAINV'; break; - case 317: $function = 'PROB'; break; - case 318: $function = 'DEVSQ'; break; - case 319: $function = 'GEOMEAN'; break; - case 320: $function = 'HARMEAN'; break; - case 321: $function = 'SUMSQ'; break; - case 322: $function = 'KURT'; break; - case 323: $function = 'SKEW'; break; - case 324: $function = 'ZTEST'; break; - case 329: $function = 'PERCENTRANK'; break; - case 330: $function = 'MODE'; break; - case 336: $function = 'CONCATENATE'; break; - case 344: $function = 'SUBTOTAL'; break; - case 345: $function = 'SUMIF'; break; - case 354: $function = 'ROMAN'; break; - case 358: $function = 'GETPIVOTDATA'; break; - case 359: $function = 'HYPERLINK'; break; - case 361: $function = 'AVERAGEA'; break; - case 362: $function = 'MAXA'; break; - case 363: $function = 'MINA'; break; - case 364: $function = 'STDEVPA'; break; - case 365: $function = 'VARPA'; break; - case 366: $function = 'STDEVA'; break; - case 367: $function = 'VARA'; break; - default: - throw new Exception('Unrecognized function in formula'); - break; - } - $data = array('function' => $function, 'args' => $args); - break; - case 0x23: // index to defined name - case 0x43: - case 0x63: - $name = 'tName'; - $size = 5; - // offset: 1; size: 2; one-based index to definedname record - $definedNameIndex = self::_GetInt2d($formulaData, 1) - 1; - // offset: 2; size: 2; not used - $data = $this->_definedname[$definedNameIndex]['name']; - break; - case 0x24: // single cell reference e.g. A5 - case 0x44: - case 0x64: - $name = 'tRef'; - $size = 5; - $data = $this->_readBIFF8CellAddress(substr($formulaData, 1, 4)); - break; - case 0x25: // cell range reference to cells in the same sheet (2d) - case 0x45: - case 0x65: - $name = 'tArea'; - $size = 9; - $data = $this->_readBIFF8CellRangeAddress(substr($formulaData, 1, 8)); - break; - case 0x26: // Constant reference sub-expression - case 0x46: - case 0x66: - $name = 'tMemArea'; - // offset: 1; size: 4; not used - // offset: 5; size: 2; size of the following subexpression - $subSize = self::_GetInt2d($formulaData, 5); - $size = 7 + $subSize; - $data = $this->_getFormulaFromData(substr($formulaData, 7, $subSize)); - break; - case 0x27: // Deleted constant reference sub-expression - case 0x47: - case 0x67: - $name = 'tMemErr'; - // offset: 1; size: 4; not used - // offset: 5; size: 2; size of the following subexpression - $subSize = self::_GetInt2d($formulaData, 5); - $size = 7 + $subSize; - $data = $this->_getFormulaFromData(substr($formulaData, 7, $subSize)); - break; - case 0x29: // Variable reference sub-expression - case 0x49: - case 0x69: - $name = 'tMemFunc'; - // offset: 1; size: 2; size of the following sub-expression - $subSize = self::_GetInt2d($formulaData, 1); - $size = 3 + $subSize; - $data = $this->_getFormulaFromData(substr($formulaData, 3, $subSize)); - break; - - case 0x2C: // Relative 2d cell reference reference, used in shared formulas and some other places - case 0x4C: - case 0x6C: - $name = 'tRefN'; - $size = 5; - $data = $this->_readBIFF8CellAddressB(substr($formulaData, 1, 4), $baseCell); - break; - - case 0x2D: // Relative 2d range reference - case 0x4D: - case 0x6D: - $name = 'tAreaN'; - $size = 9; - $data = $this->_readBIFF8CellRangeAddressB(substr($formulaData, 1, 8), $baseCell); - break; - - case 0x39: // External name - case 0x59: - case 0x79: - $name = 'tNameX'; - $size = 7; - // offset: 1; size: 2; index to REF entry in EXTERNSHEET record - // offset: 3; size: 2; one-based index to DEFINEDNAME or EXTERNNAME record - $index = self::_GetInt2d($formulaData, 3); - // assume index is to EXTERNNAME record - $data = $this->_externalNames[$index - 1]['name']; - // offset: 5; size: 2; not used - break; - - case 0x3A: // 3d reference to cell - case 0x5A: - case 0x7A: - $name = 'tRef3d'; - $size = 7; - - try { - // offset: 1; size: 2; index to REF entry - $sheetRange = $this->_readSheetRangeByRefIndex(self::_GetInt2d($formulaData, 1)); - // offset: 3; size: 4; cell address - $cellAddress = $this->_readBIFF8CellAddress(substr($formulaData, 3, 4)); - - $data = "$sheetRange!$cellAddress"; - } catch (Exception $e) { - // deleted sheet reference - $data = '#REF!'; - } - - break; - case 0x3B: // 3d reference to cell range - case 0x5B: - case 0x7B: - $name = 'tArea3d'; - $size = 11; - - try { - // offset: 1; size: 2; index to REF entry - $sheetRange = $this->_readSheetRangeByRefIndex(self::_GetInt2d($formulaData, 1)); - // offset: 3; size: 8; cell address - $cellRangeAddress = $this->_readBIFF8CellRangeAddress(substr($formulaData, 3, 8)); - - $data = "$sheetRange!$cellRangeAddress"; - } catch (Exception $e) { - // deleted sheet reference - $data = '#REF!'; - } - - break; - // Unknown cases // don't know how to deal with - default: - throw new Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula'); - break; - } - - return array( - 'id' => $id, - 'name' => $name, - 'size' => $size, - 'data' => $data, - ); - } - - /** - * Reads a cell address in BIFF8 e.g. 'A2' or '$A$2' - * section 3.3.4 - * - * @param string $cellAddressStructure - * @return string - */ - private function _readBIFF8CellAddress($cellAddressStructure) - { - // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) - $row = self::_GetInt2d($cellAddressStructure, 0) + 1; - - // offset: 2; size: 2; index to column or column offset + relative flags - - // bit: 7-0; mask 0x00FF; column index - $column = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($cellAddressStructure, 2)); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($cellAddressStructure, 2))) { - $column = '$' . $column; - } - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($cellAddressStructure, 2))) { - $row = '$' . $row; - } - - return $column . $row; - } - - /** - * Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column - * to indicate offsets from a base cell - * section 3.3.4 - * - * @param string $cellAddressStructure - * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas - * @return string - */ - private function _readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1') - { - list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell); - $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1; - - // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767)) - $rowIndex = self::_GetInt2d($cellAddressStructure, 0); - $row = self::_GetInt2d($cellAddressStructure, 0) + 1; - - // offset: 2; size: 2; index to column or column offset + relative flags - - // bit: 7-0; mask 0x00FF; column index - $colIndex = 0x00FF & self::_GetInt2d($cellAddressStructure, 2); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($cellAddressStructure, 2))) { - $column = PHPExcel_Cell::stringFromColumnIndex($colIndex); - $column = '$' . $column; - } else { - $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256; - $column = PHPExcel_Cell::stringFromColumnIndex($baseCol + $colIndex); - } - - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($cellAddressStructure, 2))) { - $row = '$' . $row; - } else { - $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536; - $row = $baseRow + $rowIndex; - } - - return $column . $row; - } - - /** - * Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1' - * always fixed range - * section 2.5.14 - * - * @param string $subData - * @return string - * @throws Exception - */ - private function _readBIFF5CellRangeAddressFixed($subData) - { - // offset: 0; size: 2; index to first row - $fr = self::_GetInt2d($subData, 0) + 1; - - // offset: 2; size: 2; index to last row - $lr = self::_GetInt2d($subData, 2) + 1; - - // offset: 4; size: 1; index to first column - $fc = ord($subData{4}); - - // offset: 5; size: 1; index to last column - $lc = ord($subData{5}); - - // check values - if ($fr > $lr || $fc > $lc) { - throw new Exception('Not a cell range address'); - } - - // column index to letter - $fc = PHPExcel_Cell::stringFromColumnIndex($fc); - $lc = PHPExcel_Cell::stringFromColumnIndex($lc); - - if ($fr == $lr and $fc == $lc) { - return "$fc$fr"; - } - return "$fc$fr:$lc$lr"; - } - - /** - * Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1' - * always fixed range - * section 2.5.14 - * - * @param string $subData - * @return string - * @throws Exception - */ - private function _readBIFF8CellRangeAddressFixed($subData) - { - // offset: 0; size: 2; index to first row - $fr = self::_GetInt2d($subData, 0) + 1; - - // offset: 2; size: 2; index to last row - $lr = self::_GetInt2d($subData, 2) + 1; - - // offset: 4; size: 2; index to first column - $fc = self::_GetInt2d($subData, 4); - - // offset: 6; size: 2; index to last column - $lc = self::_GetInt2d($subData, 6); - - // check values - if ($fr > $lr || $fc > $lc) { - throw new Exception('Not a cell range address'); - } - - // column index to letter - $fc = PHPExcel_Cell::stringFromColumnIndex($fc); - $lc = PHPExcel_Cell::stringFromColumnIndex($lc); - - if ($fr == $lr and $fc == $lc) { - return "$fc$fr"; - } - return "$fc$fr:$lc$lr"; - } - - /** - * Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6' - * there are flags indicating whether column/row index is relative - * section 3.3.4 - * - * @param string $subData - * @return string - */ - private function _readBIFF8CellRangeAddress($subData) - { - // todo: if cell range is just a single cell, should this funciton - // not just return e.g. 'A1' and not 'A1:A1' ? - - // offset: 0; size: 2; index to first row (0... 65535) (or offset (-32768... 32767)) - $fr = self::_GetInt2d($subData, 0) + 1; - - // offset: 2; size: 2; index to last row (0... 65535) (or offset (-32768... 32767)) - $lr = self::_GetInt2d($subData, 2) + 1; - - // offset: 4; size: 2; index to first column or column offset + relative flags - - // bit: 7-0; mask 0x00FF; column index - $fc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($subData, 4)); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($subData, 4))) { - $fc = '$' . $fc; - } - - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($subData, 4))) { - $fr = '$' . $fr; - } - - // offset: 6; size: 2; index to last column or column offset + relative flags - - // bit: 7-0; mask 0x00FF; column index - $lc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::_GetInt2d($subData, 6)); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($subData, 6))) { - $lc = '$' . $lc; - } - - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($subData, 6))) { - $lr = '$' . $lr; - } - - return "$fc$fr:$lc$lr"; - } - - /** - * Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column - * to indicate offsets from a base cell - * section 3.3.4 - * - * @param string $subData - * @param string $baseCell Base cell - * @return string Cell range address - */ - private function _readBIFF8CellRangeAddressB($subData, $baseCell = 'A1') - { - list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell); - $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1; - - // TODO: if cell range is just a single cell, should this funciton - // not just return e.g. 'A1' and not 'A1:A1' ? - - // offset: 0; size: 2; first row - $frIndex = self::_GetInt2d($subData, 0); // adjust below - - // offset: 2; size: 2; relative index to first row (0... 65535) should be treated as offset (-32768... 32767) - $lrIndex = self::_GetInt2d($subData, 2); // adjust below - - // offset: 4; size: 2; first column with relative/absolute flags - - // bit: 7-0; mask 0x00FF; column index - $fcIndex = 0x00FF & self::_GetInt2d($subData, 4); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($subData, 4))) { - // absolute column index - $fc = PHPExcel_Cell::stringFromColumnIndex($fcIndex); - $fc = '$' . $fc; - } else { - // column offset - $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256; - $fc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $fcIndex); - } - - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($subData, 4))) { - // absolute row index - $fr = $frIndex + 1; - $fr = '$' . $fr; - } else { - // row offset - $frIndex = ($frIndex <= 32767) ? $frIndex : $frIndex - 65536; - $fr = $baseRow + $frIndex; - } - - // offset: 6; size: 2; last column with relative/absolute flags - - // bit: 7-0; mask 0x00FF; column index - $lcIndex = 0x00FF & self::_GetInt2d($subData, 6); - $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; - $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex); - - // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index) - if (!(0x4000 & self::_GetInt2d($subData, 6))) { - // absolute column index - $lc = PHPExcel_Cell::stringFromColumnIndex($lcIndex); - $lc = '$' . $lc; - } else { - // column offset - $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256; - $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex); - } - - // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index) - if (!(0x8000 & self::_GetInt2d($subData, 6))) { - // absolute row index - $lr = $lrIndex + 1; - $lr = '$' . $lr; - } else { - // row offset - $lrIndex = ($lrIndex <= 32767) ? $lrIndex : $lrIndex - 65536; - $lr = $baseRow + $lrIndex; - } - - return "$fc$fr:$lc$lr"; - } - - /** - * Read BIFF8 cell range address list - * section 2.5.15 - * - * @param string $subData - * @return array - */ - private function _readBIFF8CellRangeAddressList($subData) - { - $cellRangeAddresses = array(); - - // offset: 0; size: 2; number of the following cell range addresses - $nm = self::_GetInt2d($subData, 0); - - $offset = 2; - // offset: 2; size: 8 * $nm; list of $nm (fixed) cell range addresses - for ($i = 0; $i < $nm; ++$i) { - $cellRangeAddresses[] = $this->_readBIFF8CellRangeAddressFixed(substr($subData, $offset, 8)); - $offset += 8; - } - - return array( - 'size' => 2 + 8 * $nm, - 'cellRangeAddresses' => $cellRangeAddresses, - ); - } - - /** - * Read BIFF5 cell range address list - * section 2.5.15 - * - * @param string $subData - * @return array - */ - private function _readBIFF5CellRangeAddressList($subData) - { - $cellRangeAddresses = array(); - - // offset: 0; size: 2; number of the following cell range addresses - $nm = self::_GetInt2d($subData, 0); - - $offset = 2; - // offset: 2; size: 6 * $nm; list of $nm (fixed) cell range addresses - for ($i = 0; $i < $nm; ++$i) { - $cellRangeAddresses[] = $this->_readBIFF5CellRangeAddressFixed(substr($subData, $offset, 6)); - $offset += 6; - } - - return array( - 'size' => 2 + 6 * $nm, - 'cellRangeAddresses' => $cellRangeAddresses, - ); - } - - /** - * Get a sheet range like Sheet1:Sheet3 from REF index - * Note: If there is only one sheet in the range, one gets e.g Sheet1 - * It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets, - * in which case an exception is thrown - * - * @param int $index - * @return string|false - * @throws Exception - */ - private function _readSheetRangeByRefIndex($index) - { - if (isset($this->_ref[$index])) { - - $type = $this->_externalBooks[$this->_ref[$index]['externalBookIndex']]['type']; - - switch ($type) { - case 'internal': - // check if we have a deleted 3d reference - if ($this->_ref[$index]['firstSheetIndex'] == 0xFFFF or $this->_ref[$index]['lastSheetIndex'] == 0xFFFF) { - throw new Exception('Deleted sheet reference'); - } - - // we have normal sheet range (collapsed or uncollapsed) - $firstSheetName = $this->_sheets[$this->_ref[$index]['firstSheetIndex']]['name']; - $lastSheetName = $this->_sheets[$this->_ref[$index]['lastSheetIndex']]['name']; - - if ($firstSheetName == $lastSheetName) { - // collapsed sheet range - $sheetRange = $firstSheetName; - } else { - $sheetRange = "$firstSheetName:$lastSheetName"; - } - - // escape the single-quotes - $sheetRange = str_replace("'", "''", $sheetRange); - - // if there are special characters, we need to enclose the range in single-quotes - // todo: check if we have identified the whole set of special characters - // it seems that the following characters are not accepted for sheet names - // and we may assume that they are not present: []*/:\? - if (preg_match("/[ !\"@#£$%&{()}<>=+'|^,;-]/", $sheetRange)) { - $sheetRange = "'$sheetRange'"; - } - - return $sheetRange; - break; - - default: - // TODO: external sheet support - throw new Exception('Excel5 reader only supports internal sheets in fomulas'); - break; - } - } - return false; - } - - /** - * read BIFF8 constant value array from array data - * returns e.g. array('value' => '{1,2;3,4}', 'size' => 40} - * section 2.5.8 - * - * @param string $arrayData - * @return array - */ - private static function _readBIFF8ConstantArray($arrayData) - { - // offset: 0; size: 1; number of columns decreased by 1 - $nc = ord($arrayData[0]); - - // offset: 1; size: 2; number of rows decreased by 1 - $nr = self::_GetInt2d($arrayData, 1); - $size = 3; // initialize - $arrayData = substr($arrayData, 3); - - // offset: 3; size: var; list of ($nc + 1) * ($nr + 1) constant values - $matrixChunks = array(); - for ($r = 1; $r <= $nr + 1; ++$r) { - $items = array(); - for ($c = 1; $c <= $nc + 1; ++$c) { - $constant = self::_readBIFF8Constant($arrayData); - $items[] = $constant['value']; - $arrayData = substr($arrayData, $constant['size']); - $size += $constant['size']; - } - $matrixChunks[] = implode(',', $items); // looks like e.g. '1,"hello"' - } - $matrix = '{' . implode(';', $matrixChunks) . '}'; - - return array( - 'value' => $matrix, - 'size' => $size, - ); - } - - /** - * read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value' - * section 2.5.7 - * returns e.g. array('value' => '5', 'size' => 9) - * - * @param string $valueData - * @return array - */ - private static function _readBIFF8Constant($valueData) - { - // offset: 0; size: 1; identifier for type of constant - $identifier = ord($valueData[0]); - - switch ($identifier) { - case 0x00: // empty constant (what is this?) - $value = ''; - $size = 9; - break; - case 0x01: // number - // offset: 1; size: 8; IEEE 754 floating-point value - $value = self::_extractNumber(substr($valueData, 1, 8)); - $size = 9; - break; - case 0x02: // string value - // offset: 1; size: var; Unicode string, 16-bit string length - $string = self::_readUnicodeStringLong(substr($valueData, 1)); - $value = '"' . $string['value'] . '"'; - $size = 1 + $string['size']; - break; - case 0x04: // boolean - // offset: 1; size: 1; 0 = FALSE, 1 = TRUE - if (ord($valueData[1])) { - $value = 'TRUE'; - } else { - $value = 'FALSE'; - } - $size = 9; - break; - case 0x10: // error code - // offset: 1; size: 1; error code - $value = self::_mapErrorCode(ord($valueData[1])); - $size = 9; - break; - } - return array( - 'value' => $value, - 'size' => $size, - ); - } - - /** - * Extract RGB color - * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4 - * - * @param string $rgb Encoded RGB value (4 bytes) - * @return array - */ - private static function _readRGB($rgb) - { - // offset: 0; size 1; Red component - $r = ord($rgb{0}); - - // offset: 1; size: 1; Green component - $g = ord($rgb{1}); - - // offset: 2; size: 1; Blue component - $b = ord($rgb{2}); - - // HEX notation, e.g. 'FF00FC' - $rgb = sprintf('%02X%02X%02X', $r, $g, $b); - - return array('rgb' => $rgb); - } - - /** - * Read byte string (8-bit string length) - * OpenOffice documentation: 2.5.2 - * - * @param string $subData - * @return array - */ - private function _readByteStringShort($subData) - { - // offset: 0; size: 1; length of the string (character count) - $ln = ord($subData[0]); - - // offset: 1: size: var; character array (8-bit characters) - $value = $this->_decodeCodepage(substr($subData, 1, $ln)); - - return array( - 'value' => $value, - 'size' => 1 + $ln, // size in bytes of data structure - ); - } - - /** - * Read byte string (16-bit string length) - * OpenOffice documentation: 2.5.2 - * - * @param string $subData - * @return array - */ - private function _readByteStringLong($subData) - { - // offset: 0; size: 2; length of the string (character count) - $ln = self::_GetInt2d($subData, 0); - - // offset: 2: size: var; character array (8-bit characters) - $value = $this->_decodeCodepage(substr($subData, 2)); - - //return $string; - return array( - 'value' => $value, - 'size' => 2 + $ln, // size in bytes of data structure - ); - } - - /** - * Extracts an Excel Unicode short string (8-bit string length) - * OpenOffice documentation: 2.5.3 - * function will automatically find out where the Unicode string ends. - * - * @param string $subData - * @return array - */ - private static function _readUnicodeStringShort($subData) - { - $value = ''; - - // offset: 0: size: 1; length of the string (character count) - $characterCount = ord($subData[0]); - - $string = self::_readUnicodeString(substr($subData, 1), $characterCount); - - // add 1 for the string length - $string['size'] += 1; - - return $string; - } - - /** - * Extracts an Excel Unicode long string (16-bit string length) - * OpenOffice documentation: 2.5.3 - * this function is under construction, needs to support rich text, and Asian phonetic settings - * - * @param string $subData - * @return array - */ - private static function _readUnicodeStringLong($subData) - { - $value = ''; - - // offset: 0: size: 2; length of the string (character count) - $characterCount = self::_GetInt2d($subData, 0); - - $string = self::_readUnicodeString(substr($subData, 2), $characterCount); - - // add 2 for the string length - $string['size'] += 2; - - return $string; - } - - /** - * Read Unicode string with no string length field, but with known character count - * this function is under construction, needs to support rich text, and Asian phonetic settings - * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3 - * - * @param string $subData - * @param int $characterCount - * @return array - */ - private static function _readUnicodeString($subData, $characterCount) - { - $value = ''; - - // offset: 0: size: 1; option flags - - // bit: 0; mask: 0x01; character compression (0 = compressed 8-bit, 1 = uncompressed 16-bit) - $isCompressed = !((0x01 & ord($subData[0])) >> 0); - - // bit: 2; mask: 0x04; Asian phonetic settings - $hasAsian = (0x04) & ord($subData[0]) >> 2; - - // bit: 3; mask: 0x08; Rich-Text settings - $hasRichText = (0x08) & ord($subData[0]) >> 3; - - // offset: 1: size: var; character array - // this offset assumes richtext and Asian phonetic settings are off which is generally wrong - // needs to be fixed - $value = self::_encodeUTF16(substr($subData, 1, $isCompressed ? $characterCount : 2 * $characterCount), $isCompressed); - - return array( - 'value' => $value, - 'size' => $isCompressed ? 1 + $characterCount : 1 + 2 * $characterCount, // the size in bytes including the option flags - ); - } - - /** - * Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas. - * Example: hello"world --> "hello""world" - * - * @param string $value UTF-8 encoded string - * @return string - */ - private static function _UTF8toExcelDoubleQuoted($value) - { - return '"' . str_replace('"', '""', $value) . '"'; - } - - /** - * Reads first 8 bytes of a string and return IEEE 754 float - * - * @param string $data Binary string that is at least 8 bytes long - * @return float - */ - private static function _extractNumber($data) - { - $rknumhigh = self::_GetInt4d($data, 4); - $rknumlow = self::_GetInt4d($data, 0); - $sign = ($rknumhigh & 0x80000000) >> 31; - $exp = (($rknumhigh & 0x7ff00000) >> 20) - 1023; - $mantissa = (0x100000 | ($rknumhigh & 0x000fffff)); - $mantissalow1 = ($rknumlow & 0x80000000) >> 31; - $mantissalow2 = ($rknumlow & 0x7fffffff); - $value = $mantissa / pow( 2 , (20 - $exp)); - - if ($mantissalow1 != 0) { - $value += 1 / pow (2 , (21 - $exp)); - } - - $value += $mantissalow2 / pow (2 , (52 - $exp)); - if ($sign) { - $value = -1 * $value; - } - - return $value; - } - - private static function _GetIEEE754($rknum) - { - if (($rknum & 0x02) != 0) { - $value = $rknum >> 2; - } - else { - // changes by mmp, info on IEEE754 encoding from - // research.microsoft.com/~hollasch/cgindex/coding/ieeefloat.html - // The RK format calls for using only the most significant 30 bits - // of the 64 bit floating point value. The other 34 bits are assumed - // to be 0 so we use the upper 30 bits of $rknum as follows... - $sign = ($rknum & 0x80000000) >> 31; - $exp = ($rknum & 0x7ff00000) >> 20; - $mantissa = (0x100000 | ($rknum & 0x000ffffc)); - $value = $mantissa / pow( 2 , (20- ($exp - 1023))); - if ($sign) { - $value = -1 * $value; - } - //end of changes by mmp - } - if (($rknum & 0x01) != 0) { - $value /= 100; - } - return $value; - } - - /** - * Get UTF-8 string from (compressed or uncompressed) UTF-16 string - * - * @param string $string - * @param bool $compressed - * @return string - */ - private static function _encodeUTF16($string, $compressed = '') - { - if ($compressed) { - $string = self::_uncompressByteString($string); - } - - return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', 'UTF-16LE'); - } - - /** - * Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8. - * - * @param string $string - * @return string - */ - private static function _uncompressByteString($string) - { - $uncompressedString = ''; - $strLen = strlen($string); - for ($i = 0; $i < $strLen; ++$i) { - $uncompressedString .= $string[$i] . "\0"; - } - - return $uncompressedString; - } - - /** - * Convert string to UTF-8. Only used for BIFF5. - * - * @param string $string - * @return string - */ - private function _decodeCodepage($string) - { - return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $this->_codepage); - } - - /** - * Read 16-bit unsigned integer - * - * @param string $data - * @param int $pos - * @return int - */ - public static function _GetInt2d($data, $pos) - { - return ord($data[$pos]) | (ord($data[$pos + 1]) << 8); - } - - /** - * Read 32-bit signed integer - * - * @param string $data - * @param int $pos - * @return int - */ - public static function _GetInt4d($data, $pos) - { - // FIX: represent numbers correctly on 64-bit system - // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 - // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems - $_or_24 = ord($data[$pos + 3]); - if ($_or_24 >= 128) { - // negative number - $_ord_24 = -abs((256 - $_or_24) << 24); - } else { - $_ord_24 = ($_or_24 & 127) << 24; - } - return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; - } - - /** - * Read color - * - * @param int $color Indexed color - * @param array $palette Color palette - * @return array RGB color value, example: array('rgb' => 'FF0000') - */ - private static function _readColor($color,$palette,$version) - { - if ($color <= 0x07 || $color >= 0x40) { - // special built-in color - return self::_mapBuiltInColor($color); - } elseif (isset($palette) && isset($palette[$color - 8])) { - // palette color, color index 0x08 maps to pallete index 0 - return $palette[$color - 8]; - } else { - // default color table - if ($version == self::XLS_BIFF8) { - return self::_mapColor($color); - } else { - // BIFF5 - return self::_mapColorBIFF5($color); - } - } - - return $color; - } - - - /** - * Map border style - * OpenOffice documentation: 2.5.11 - * - * @param int $index - * @return string - */ - private static function _mapBorderStyle($index) - { - switch ($index) { - case 0x00: return PHPExcel_Style_Border::BORDER_NONE; - case 0x01: return PHPExcel_Style_Border::BORDER_THIN; - case 0x02: return PHPExcel_Style_Border::BORDER_MEDIUM; - case 0x03: return PHPExcel_Style_Border::BORDER_DASHED; - case 0x04: return PHPExcel_Style_Border::BORDER_DOTTED; - case 0x05: return PHPExcel_Style_Border::BORDER_THICK; - case 0x06: return PHPExcel_Style_Border::BORDER_DOUBLE; - case 0x07: return PHPExcel_Style_Border::BORDER_HAIR; - case 0x08: return PHPExcel_Style_Border::BORDER_MEDIUMDASHED; - case 0x09: return PHPExcel_Style_Border::BORDER_DASHDOT; - case 0x0A: return PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT; - case 0x0B: return PHPExcel_Style_Border::BORDER_DASHDOTDOT; - case 0x0C: return PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; - case 0x0D: return PHPExcel_Style_Border::BORDER_SLANTDASHDOT; - default: return PHPExcel_Style_Border::BORDER_NONE; - } - } - - /** - * Get fill pattern from index - * OpenOffice documentation: 2.5.12 - * - * @param int $index - * @return string - */ - private static function _mapFillPattern($index) - { - switch ($index) { - case 0x00: return PHPExcel_Style_Fill::FILL_NONE; - case 0x01: return PHPExcel_Style_Fill::FILL_SOLID; - case 0x02: return PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY; - case 0x03: return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY; - case 0x04: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY; - case 0x05: return PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL; - case 0x06: return PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL; - case 0x07: return PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN; - case 0x08: return PHPExcel_Style_Fill::FILL_PATTERN_DARKUP; - case 0x09: return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID; - case 0x0A: return PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS; - case 0x0B: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL; - case 0x0C: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL; - case 0x0D: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN; - case 0x0E: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP; - case 0x0F: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID; - case 0x10: return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS; - case 0x11: return PHPExcel_Style_Fill::FILL_PATTERN_GRAY125; - case 0x12: return PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625; - default: return PHPExcel_Style_Fill::FILL_NONE; - } - } - - /** - * Map error code, e.g. '#N/A' - * - * @param int $subData - * @return string - */ - private static function _mapErrorCode($subData) - { - switch ($subData) { - case 0x00: return '#NULL!'; break; - case 0x07: return '#DIV/0!'; break; - case 0x0F: return '#VALUE!'; break; - case 0x17: return '#REF!'; break; - case 0x1D: return '#NAME?'; break; - case 0x24: return '#NUM!'; break; - case 0x2A: return '#N/A'; break; - default: return false; - } - } - - /** - * Map built-in color to RGB value - * - * @param int $color Indexed color - * @return array - */ - private static function _mapBuiltInColor($color) - { - switch ($color) { - case 0x00: return array('rgb' => '000000'); - case 0x01: return array('rgb' => 'FFFFFF'); - case 0x02: return array('rgb' => 'FF0000'); - case 0x03: return array('rgb' => '00FF00'); - case 0x04: return array('rgb' => '0000FF'); - case 0x05: return array('rgb' => 'FFFF00'); - case 0x06: return array('rgb' => 'FF00FF'); - case 0x07: return array('rgb' => '00FFFF'); - case 0x40: return array('rgb' => '000000'); // system window text color - case 0x41: return array('rgb' => 'FFFFFF'); // system window background color - default: return array('rgb' => '000000'); - } - } - - /** - * Map color array from BIFF5 built-in color index - * - * @param int $subData - * @return array - */ - private static function _mapColorBIFF5($subData) - { - switch ($subData) { - case 0x08: return array('rgb' => '000000'); - case 0x09: return array('rgb' => 'FFFFFF'); - case 0x0A: return array('rgb' => 'FF0000'); - case 0x0B: return array('rgb' => '00FF00'); - case 0x0C: return array('rgb' => '0000FF'); - case 0x0D: return array('rgb' => 'FFFF00'); - case 0x0E: return array('rgb' => 'FF00FF'); - case 0x0F: return array('rgb' => '00FFFF'); - case 0x10: return array('rgb' => '800000'); - case 0x11: return array('rgb' => '008000'); - case 0x12: return array('rgb' => '000080'); - case 0x13: return array('rgb' => '808000'); - case 0x14: return array('rgb' => '800080'); - case 0x15: return array('rgb' => '008080'); - case 0x16: return array('rgb' => 'C0C0C0'); - case 0x17: return array('rgb' => '808080'); - case 0x18: return array('rgb' => '8080FF'); - case 0x19: return array('rgb' => '802060'); - case 0x1A: return array('rgb' => 'FFFFC0'); - case 0x1B: return array('rgb' => 'A0E0F0'); - case 0x1C: return array('rgb' => '600080'); - case 0x1D: return array('rgb' => 'FF8080'); - case 0x1E: return array('rgb' => '0080C0'); - case 0x1F: return array('rgb' => 'C0C0FF'); - case 0x20: return array('rgb' => '000080'); - case 0x21: return array('rgb' => 'FF00FF'); - case 0x22: return array('rgb' => 'FFFF00'); - case 0x23: return array('rgb' => '00FFFF'); - case 0x24: return array('rgb' => '800080'); - case 0x25: return array('rgb' => '800000'); - case 0x26: return array('rgb' => '008080'); - case 0x27: return array('rgb' => '0000FF'); - case 0x28: return array('rgb' => '00CFFF'); - case 0x29: return array('rgb' => '69FFFF'); - case 0x2A: return array('rgb' => 'E0FFE0'); - case 0x2B: return array('rgb' => 'FFFF80'); - case 0x2C: return array('rgb' => 'A6CAF0'); - case 0x2D: return array('rgb' => 'DD9CB3'); - case 0x2E: return array('rgb' => 'B38FEE'); - case 0x2F: return array('rgb' => 'E3E3E3'); - case 0x30: return array('rgb' => '2A6FF9'); - case 0x31: return array('rgb' => '3FB8CD'); - case 0x32: return array('rgb' => '488436'); - case 0x33: return array('rgb' => '958C41'); - case 0x34: return array('rgb' => '8E5E42'); - case 0x35: return array('rgb' => 'A0627A'); - case 0x36: return array('rgb' => '624FAC'); - case 0x37: return array('rgb' => '969696'); - case 0x38: return array('rgb' => '1D2FBE'); - case 0x39: return array('rgb' => '286676'); - case 0x3A: return array('rgb' => '004500'); - case 0x3B: return array('rgb' => '453E01'); - case 0x3C: return array('rgb' => '6A2813'); - case 0x3D: return array('rgb' => '85396A'); - case 0x3E: return array('rgb' => '4A3285'); - case 0x3F: return array('rgb' => '424242'); - default: return array('rgb' => '000000'); - } - } - - /** - * Map color array from BIFF8 built-in color index - * - * @param int $subData - * @return array - */ - private static function _mapColor($subData) - { - switch ($subData) { - case 0x08: return array('rgb' => '000000'); - case 0x09: return array('rgb' => 'FFFFFF'); - case 0x0A: return array('rgb' => 'FF0000'); - case 0x0B: return array('rgb' => '00FF00'); - case 0x0C: return array('rgb' => '0000FF'); - case 0x0D: return array('rgb' => 'FFFF00'); - case 0x0E: return array('rgb' => 'FF00FF'); - case 0x0F: return array('rgb' => '00FFFF'); - case 0x10: return array('rgb' => '800000'); - case 0x11: return array('rgb' => '008000'); - case 0x12: return array('rgb' => '000080'); - case 0x13: return array('rgb' => '808000'); - case 0x14: return array('rgb' => '800080'); - case 0x15: return array('rgb' => '008080'); - case 0x16: return array('rgb' => 'C0C0C0'); - case 0x17: return array('rgb' => '808080'); - case 0x18: return array('rgb' => '9999FF'); - case 0x19: return array('rgb' => '993366'); - case 0x1A: return array('rgb' => 'FFFFCC'); - case 0x1B: return array('rgb' => 'CCFFFF'); - case 0x1C: return array('rgb' => '660066'); - case 0x1D: return array('rgb' => 'FF8080'); - case 0x1E: return array('rgb' => '0066CC'); - case 0x1F: return array('rgb' => 'CCCCFF'); - case 0x20: return array('rgb' => '000080'); - case 0x21: return array('rgb' => 'FF00FF'); - case 0x22: return array('rgb' => 'FFFF00'); - case 0x23: return array('rgb' => '00FFFF'); - case 0x24: return array('rgb' => '800080'); - case 0x25: return array('rgb' => '800000'); - case 0x26: return array('rgb' => '008080'); - case 0x27: return array('rgb' => '0000FF'); - case 0x28: return array('rgb' => '00CCFF'); - case 0x29: return array('rgb' => 'CCFFFF'); - case 0x2A: return array('rgb' => 'CCFFCC'); - case 0x2B: return array('rgb' => 'FFFF99'); - case 0x2C: return array('rgb' => '99CCFF'); - case 0x2D: return array('rgb' => 'FF99CC'); - case 0x2E: return array('rgb' => 'CC99FF'); - case 0x2F: return array('rgb' => 'FFCC99'); - case 0x30: return array('rgb' => '3366FF'); - case 0x31: return array('rgb' => '33CCCC'); - case 0x32: return array('rgb' => '99CC00'); - case 0x33: return array('rgb' => 'FFCC00'); - case 0x34: return array('rgb' => 'FF9900'); - case 0x35: return array('rgb' => 'FF6600'); - case 0x36: return array('rgb' => '666699'); - case 0x37: return array('rgb' => '969696'); - case 0x38: return array('rgb' => '003366'); - case 0x39: return array('rgb' => '339966'); - case 0x3A: return array('rgb' => '003300'); - case 0x3B: return array('rgb' => '333300'); - case 0x3C: return array('rgb' => '993300'); - case 0x3D: return array('rgb' => '993366'); - case 0x3E: return array('rgb' => '333399'); - case 0x3F: return array('rgb' => '333333'); - default: return array('rgb' => '000000'); - } - } - - private function _parseRichText($is = '') { - $value = new PHPExcel_RichText(); - - $value->createText($is); - - return $value; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5/Escher.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5/Escher.php deleted file mode 100644 index e1a25bb47a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Excel5/Escher.php +++ /dev/null @@ -1,640 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Reader_Excel5_Escher - * - * @category PHPExcel - * @package PHPExcel_Reader_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Reader_Excel5_Escher -{ - const DGGCONTAINER = 0xF000; - const BSTORECONTAINER = 0xF001; - const DGCONTAINER = 0xF002; - const SPGRCONTAINER = 0xF003; - const SPCONTAINER = 0xF004; - const DGG = 0xF006; - const BSE = 0xF007; - const DG = 0xF008; - const SPGR = 0xF009; - const SP = 0xF00A; - const OPT = 0xF00B; - const CLIENTTEXTBOX = 0xF00D; - const CLIENTANCHOR = 0xF010; - const CLIENTDATA = 0xF011; - const BLIPJPEG = 0xF01D; - const BLIPPNG = 0xF01E; - const SPLITMENUCOLORS = 0xF11E; - const TERTIARYOPT = 0xF122; - - /** - * Escher stream data (binary) - * - * @var string - */ - private $_data; - - /** - * Size in bytes of the Escher stream data - * - * @var int - */ - private $_dataSize; - - /** - * Current position of stream pointer in Escher stream data - * - * @var int - */ - private $_pos; - - /** - * The object to be returned by the reader. Modified during load. - * - * @var mixed - */ - private $_object; - - /** - * Create a new PHPExcel_Reader_Excel5_Escher instance - * - * @param mixed $object - */ - public function __construct($object) - { - $this->_object = $object; - } - - /** - * Load Escher stream data. May be a partial Escher stream. - * - * @param string $data - */ - public function load($data) - { - $this->_data = $data; - - // total byte size of Excel data (workbook global substream + sheet substreams) - $this->_dataSize = strlen($this->_data); - - $this->_pos = 0; - - // Parse Escher stream - while ($this->_pos < $this->_dataSize) { - - // offset: 2; size: 2: Record Type - $fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2); - - switch ($fbt) { - case self::DGGCONTAINER: $this->_readDggContainer(); break; - case self::DGG: $this->_readDgg(); break; - case self::BSTORECONTAINER: $this->_readBstoreContainer(); break; - case self::BSE: $this->_readBSE(); break; - case self::BLIPJPEG: $this->_readBlipJPEG(); break; - case self::BLIPPNG: $this->_readBlipPNG(); break; - case self::OPT: $this->_readOPT(); break; - case self::TERTIARYOPT: $this->_readTertiaryOPT(); break; - case self::SPLITMENUCOLORS: $this->_readSplitMenuColors(); break; - case self::DGCONTAINER: $this->_readDgContainer(); break; - case self::DG: $this->_readDg(); break; - case self::SPGRCONTAINER: $this->_readSpgrContainer(); break; - case self::SPCONTAINER: $this->_readSpContainer(); break; - case self::SPGR: $this->_readSpgr(); break; - case self::SP: $this->_readSp(); break; - case self::CLIENTTEXTBOX: $this->_readClientTextbox(); break; - case self::CLIENTANCHOR: $this->_readClientAnchor(); break; - case self::CLIENTDATA: $this->_readClientData(); break; - default: $this->_readDefault(); break; - } - } - - return $this->_object; - } - - /** - * Read a generic record - */ - private function _readDefault() - { - // offset 0; size: 2; recVer and recInstance - $verInstance = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos); - - // offset: 2; size: 2: Record Type - $fbt = PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos + 2); - - // bit: 0-3; mask: 0x000F; recVer - $recVer = (0x000F & $verInstance) >> 0; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read DggContainer record (Drawing Group Container) - */ - private function _readDggContainer() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // record is a container, read contents - $dggContainer = new PHPExcel_Shared_Escher_DggContainer(); - $this->_object->setDggContainer($dggContainer); - $reader = new PHPExcel_Reader_Excel5_Escher($dggContainer); - $reader->load($recordData); - } - - /** - * Read Dgg record (Drawing Group) - */ - private function _readDgg() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read BstoreContainer record (Blip Store Container) - */ - private function _readBstoreContainer() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // record is a container, read contents - $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer(); - $this->_object->setBstoreContainer($bstoreContainer); - $reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer); - $reader->load($recordData); - } - - /** - * Read BSE record - */ - private function _readBSE() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // add BSE to BstoreContainer - $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); - $this->_object->addBSE($BSE); - - $BSE->setBLIPType($recInstance); - - // offset: 0; size: 1; btWin32 (MSOBLIPTYPE) - $btWin32 = ord($recordData[0]); - - // offset: 1; size: 1; btWin32 (MSOBLIPTYPE) - $btMacOS = ord($recordData[1]); - - // offset: 2; size: 16; MD4 digest - $rgbUid = substr($recordData, 2, 16); - - // offset: 18; size: 2; tag - $tag = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 18); - - // offset: 20; size: 4; size of BLIP in bytes - $size = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 20); - - // offset: 24; size: 4; number of references to this BLIP - $cRef = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 24); - - // offset: 28; size: 4; MSOFO file offset - $foDelay = PHPExcel_Reader_Excel5::_GetInt4d($recordData, 28); - - // offset: 32; size: 1; unused1 - $unused1 = ord($recordData{32}); - - // offset: 33; size: 1; size of nameData in bytes (including null terminator) - $cbName = ord($recordData{33}); - - // offset: 34; size: 1; unused2 - $unused2 = ord($recordData{34}); - - // offset: 35; size: 1; unused3 - $unused3 = ord($recordData{35}); - - // offset: 36; size: $cbName; nameData - $nameData = substr($recordData, 36, $cbName); - - // offset: 36 + $cbName, size: var; the BLIP data - $blipData = substr($recordData, 36 + $cbName); - - // record is a container, read contents - $reader = new PHPExcel_Reader_Excel5_Escher($BSE); - $reader->load($blipData); - } - - /** - * Read BlipJPEG record. Holds raw JPEG image data - */ - private function _readBlipJPEG() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - $pos = 0; - - // offset: 0; size: 16; rgbUid1 (MD4 digest of) - $rgbUid1 = substr($recordData, 0, 16); - $pos += 16; - - // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3 - if (in_array($recInstance, array(0x046B, 0x06E3))) { - $rgbUid2 = substr($recordData, 16, 16); - $pos += 16; - } - - // offset: var; size: 1; tag - $tag = ord($recordData{$pos}); - $pos += 1; - - // offset: var; size: var; the raw image data - $data = substr($recordData, $pos); - - $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); - $blip->setData($data); - - $this->_object->setBlip($blip); - } - - /** - * Read BlipPNG record. Holds raw PNG image data - */ - private function _readBlipPNG() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - $pos = 0; - - // offset: 0; size: 16; rgbUid1 (MD4 digest of) - $rgbUid1 = substr($recordData, 0, 16); - $pos += 16; - - // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3 - if ($recInstance == 0x06E1) { - $rgbUid2 = substr($recordData, 16, 16); - $pos += 16; - } - - // offset: var; size: 1; tag - $tag = ord($recordData{$pos}); - $pos += 1; - - // offset: var; size: var; the raw image data - $data = substr($recordData, $pos); - - $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); - $blip->setData($data); - - $this->_object->setBlip($blip); - } - - /** - * Read OPT record. This record may occur within DggContainer record or SpContainer - */ - private function _readOPT() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - $this->_readOfficeArtRGFOPTE($recordData, $recInstance); - } - - /** - * Read TertiaryOPT record - */ - private function _readTertiaryOPT() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read SplitMenuColors record - */ - private function _readSplitMenuColors() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read DgContainer record (Drawing Container) - */ - private function _readDgContainer() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // record is a container, read contents - $dgContainer = new PHPExcel_Shared_Escher_DgContainer(); - $this->_object->setDgContainer($dgContainer); - $reader = new PHPExcel_Reader_Excel5_Escher($dgContainer); - $escher = $reader->load($recordData); - } - - /** - * Read Dg record (Drawing) - */ - private function _readDg() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read SpgrContainer record (Shape Group Container) - */ - private function _readSpgrContainer() - { - // context is either context DgContainer or SpgrContainer - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // record is a container, read contents - $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer(); - - if ($this->_object instanceof PHPExcel_Shared_Escher_DgContainer) { - // DgContainer - $this->_object->setSpgrContainer($spgrContainer); - } else { - // SpgrContainer - $this->_object->addChild($spgrContainer); - } - - $reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer); - $escher = $reader->load($recordData); - } - - /** - * Read SpContainer record (Shape Container) - */ - private function _readSpContainer() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // add spContainer to spgrContainer - $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); - $this->_object->addChild($spContainer); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // record is a container, read contents - $reader = new PHPExcel_Reader_Excel5_Escher($spContainer); - $escher = $reader->load($recordData); - } - - /** - * Read Spgr record (Shape Group) - */ - private function _readSpgr() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read Sp record (Shape) - */ - private function _readSp() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read ClientTextbox record - */ - private function _readClientTextbox() - { - // offset: 0; size: 2; recVer and recInstance - - // bit: 4-15; mask: 0xFFF0; recInstance - $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::_GetInt2d($this->_data, $this->_pos)) >> 4; - - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read ClientAnchor record. This record holds information about where the shape is anchored in worksheet - */ - private function _readClientAnchor() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - - // offset: 2; size: 2; upper-left corner column index (0-based) - $c1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 2); - - // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width - $startOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 4); - - // offset: 6; size: 2; upper-left corner row index (0-based) - $r1 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 6); - - // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height - $startOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 8); - - // offset: 10; size: 2; bottom-right corner column index (0-based) - $c2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 10); - - // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width - $endOffsetX = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 12); - - // offset: 14; size: 2; bottom-right corner row index (0-based) - $r2 = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 14); - - // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height - $endOffsetY = PHPExcel_Reader_Excel5::_GetInt2d($recordData, 16); - - // set the start coordinates - $this->_object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1)); - - // set the start offsetX - $this->_object->setStartOffsetX($startOffsetX); - - // set the start offsetY - $this->_object->setStartOffsetY($startOffsetY); - - // set the end coordinates - $this->_object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1)); - - // set the end offsetX - $this->_object->setEndOffsetX($endOffsetX); - - // set the end offsetY - $this->_object->setEndOffsetY($endOffsetY); - } - - /** - * Read ClientData record - */ - private function _readClientData() - { - $length = PHPExcel_Reader_Excel5::_GetInt4d($this->_data, $this->_pos + 4); - $recordData = substr($this->_data, $this->_pos + 8, $length); - - // move stream pointer to next record - $this->_pos += 8 + $length; - } - - /** - * Read OfficeArtRGFOPTE table of property-value pairs - * - * @param string $data Binary data - * @param int $n Number of properties - */ - private function _readOfficeArtRGFOPTE($data, $n) { - - $splicedComplexData = substr($data, 6 * $n); - - // loop through property-value pairs - for ($i = 0; $i < $n; ++$i) { - // read 6 bytes at a time - $fopte = substr($data, 6 * $i, 6); - - // offset: 0; size: 2; opid - $opid = PHPExcel_Reader_Excel5::_GetInt2d($fopte, 0); - - // bit: 0-13; mask: 0x3FFF; opid.opid - $opidOpid = (0x3FFF & $opid) >> 0; - - // bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier - $opidFBid = (0x4000 & $opid) >> 14; - - // bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data - $opidFComplex = (0x8000 & $opid) >> 15; - - // offset: 2; size: 4; the value for this property - $op = PHPExcel_Reader_Excel5::_GetInt4d($fopte, 2); - - if ($opidFComplex) { - $complexData = substr($splicedComplexData, 0, $op); - $splicedComplexData = substr($splicedComplexData, $op); - - // we store string value with complex data - $value = $complexData; - } else { - // we store integer value - $value = $op; - } - - $this->_object->setOPT($opidOpid, $value); - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Gnumeric.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Gnumeric.php deleted file mode 100644 index af0b5fe464..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/Gnumeric.php +++ /dev/null @@ -1,914 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** PHPExcel root directory */ -if (!defined('PHPEXCEL_ROOT')) { - /** - * @ignore - */ - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); -} - -/** - * PHPExcel_Reader_Gnumeric - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader -{ - /** - * Read data only? - * Identifies whether the Reader should only read data values for cells, and ignore any formatting information; - * or whether it should read both data and formatting - * - * @var boolean - */ - private $_readDataOnly = false; - - /** - * Restrict which sheets should be loaded? - * This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded. - * - * @var array of string - */ - private $_loadSheetsOnly = null; - - /** - * Formats - * - * @var array - */ - private $_styles = array(); - - /** - * Shared Expressions - * - * @var array - */ - private $_expressions = array(); - - private $_referenceHelper = null; - - /** - * PHPExcel_Reader_IReadFilter instance - * - * @var PHPExcel_Reader_IReadFilter - */ - private $_readFilter = null; - - - /** - * Read data only? - * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. - * If false (the default) it will read data and formatting. - * - * @return boolean - */ - public function getReadDataOnly() { - return $this->_readDataOnly; - } - - /** - * Set read data only - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. - * Set to false (the default) to advise the Reader to read both data and formatting for cells. - * - * @param boolean $pValue - * - * @return PHPExcel_Reader_Gnumeric - */ - public function setReadDataOnly($pValue = false) { - $this->_readDataOnly = $pValue; - return $this; - } - - /** - * Get which sheets to load - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null - * indicating that all worksheets in the workbook should be loaded. - * - * @return mixed - */ - public function getLoadSheetsOnly() - { - return $this->_loadSheetsOnly; - } - - /** - * Set which sheets to load - * - * @param mixed $value - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. - * If NULL, then it tells the Reader to read all worksheets in the workbook - * - * @return PHPExcel_Reader_Gnumeric - */ - public function setLoadSheetsOnly($value = null) - { - $this->_loadSheetsOnly = is_array($value) ? - $value : array($value); - return $this; - } - - /** - * Set all sheets to load - * Tells the Reader to load all worksheets from the workbook. - * - * @return PHPExcel_Reader_Gnumeric - */ - public function setLoadAllSheets() - { - $this->_loadSheetsOnly = null; - return $this; - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - * @return PHPExcel_Reader_Gnumeric - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Create a new PHPExcel_Reader_Gnumeric - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - $this->_referenceHelper = PHPExcel_ReferenceHelper::getInstance(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - // Check if gzlib functions are available - if (!function_exists('gzread')) { - return false; - } - - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Read signature data (first 3 bytes) - $fh = fopen($pFilename, 'r'); - $data = fread($fh, 2); - fclose($fh); - - if ($data != chr(0x1F).chr(0x8B)) { - return false; - } - - return true; - } - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - - // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); - } - - private function _gzfileGetContents($filename) { - $file = @gzopen($filename, 'rb'); - if ($file !== false) { - $data = ''; - while (!gzeof($file)) { - $data .= gzread($file, 1024); - } - gzclose($file); - } - return $data; - } - - /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object - * - * @param string $pFilename - * @throws Exception - */ - public function listWorksheetNames($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $gFileData = $this->_gzfileGetContents($pFilename); - - $xml = simplexml_load_string($gFileData); - $namespacesMeta = $xml->getNamespaces(true); - - $gnmXML = $xml->children($namespacesMeta['gnm']); - - $worksheetNames = array(); - - foreach($gnmXML->Sheets->Sheet as $sheet) { - $worksheetNames[] = (string) $sheet->Name; - } - - return $worksheetNames; - } - - - /** - * Loads PHPExcel from file into PHPExcel instance - * - * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception - */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $timezoneObj = new DateTimeZone('Europe/London'); - $GMT = new DateTimeZone('UTC'); - - $gFileData = $this->_gzfileGetContents($pFilename); - -// echo '<pre>'; -// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8'); -// echo '</pre><hr />'; -// - $xml = simplexml_load_string($gFileData); - $namespacesMeta = $xml->getNamespaces(true); - -// var_dump($namespacesMeta); -// - $gnmXML = $xml->children($namespacesMeta['gnm']); - - $docProps = $objPHPExcel->getProperties(); - // Document Properties are held differently, depending on the version of Gnumeric - if (isset($namespacesMeta['office'])) { - $officeXML = $xml->children($namespacesMeta['office']); - $officeDocXML = $officeXML->{'document-meta'}; - $officeDocMetaXML = $officeDocXML->meta; - - foreach($officeDocMetaXML as $officePropertyData) { - - $officePropertyDC = array(); - if (isset($namespacesMeta['dc'])) { - $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); - } - foreach($officePropertyDC as $propertyName => $propertyValue) { - $propertyValue = (string) $propertyValue; - switch ($propertyName) { - case 'title' : - $docProps->setTitle(trim($propertyValue)); - break; - case 'subject' : - $docProps->setSubject(trim($propertyValue)); - break; - case 'creator' : - $docProps->setCreator(trim($propertyValue)); - $docProps->setLastModifiedBy(trim($propertyValue)); - break; - case 'date' : - $creationDate = strtotime(trim($propertyValue)); - $docProps->setCreated($creationDate); - $docProps->setModified($creationDate); - break; - case 'description' : - $docProps->setDescription(trim($propertyValue)); - break; - } - } - $officePropertyMeta = array(); - if (isset($namespacesMeta['meta'])) { - $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); - } - foreach($officePropertyMeta as $propertyName => $propertyValue) { - $attributes = $propertyValue->attributes($namespacesMeta['meta']); - $propertyValue = (string) $propertyValue; - switch ($propertyName) { - case 'keyword' : - $docProps->setKeywords(trim($propertyValue)); - break; - case 'initial-creator' : - $docProps->setCreator(trim($propertyValue)); - $docProps->setLastModifiedBy(trim($propertyValue)); - break; - case 'creation-date' : - $creationDate = strtotime(trim($propertyValue)); - $docProps->setCreated($creationDate); - $docProps->setModified($creationDate); - break; - case 'user-defined' : - list(,$attrName) = explode(':',$attributes['name']); - switch ($attrName) { - case 'publisher' : - $docProps->setCompany(trim($propertyValue)); - break; - case 'category' : - $docProps->setCategory(trim($propertyValue)); - break; - case 'manager' : - $docProps->setManager(trim($propertyValue)); - break; - } - break; - } - } - } - } elseif (isset($gnmXML->Summary)) { - foreach($gnmXML->Summary->Item as $summaryItem) { - $propertyName = $summaryItem->name; - $propertyValue = $summaryItem->{'val-string'}; - switch ($propertyName) { - case 'title' : - $docProps->setTitle(trim($propertyValue)); - break; - case 'comments' : - $docProps->setDescription(trim($propertyValue)); - break; - case 'keywords' : - $docProps->setKeywords(trim($propertyValue)); - break; - case 'category' : - $docProps->setCategory(trim($propertyValue)); - break; - case 'manager' : - $docProps->setManager(trim($propertyValue)); - break; - case 'author' : - $docProps->setCreator(trim($propertyValue)); - $docProps->setLastModifiedBy(trim($propertyValue)); - break; - case 'company' : - $docProps->setCompany(trim($propertyValue)); - break; - } - } - } - - $worksheetID = 0; - foreach($gnmXML->Sheets->Sheet as $sheet) { - $worksheetName = (string) $sheet->Name; -// echo '<b>Worksheet: ',$worksheetName,'</b><br />'; - if ((isset($this->_loadSheetsOnly)) && (!in_array($worksheetName, $this->_loadSheetsOnly))) { - continue; - } - - $maxRow = $maxCol = 0; - - // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); - $objPHPExcel->getActiveSheet()->setTitle($worksheetName); - - if ((!$this->_readDataOnly) && (isset($sheet->PrintInformation))) { - if (isset($sheet->PrintInformation->Margins)) { - foreach($sheet->PrintInformation->Margins->children('gnm',TRUE) as $key => $margin) { - $marginAttributes = $margin->attributes(); - $marginSize = 72 / 100; // Default - switch($marginAttributes['PrefUnit']) { - case 'mm' : - $marginSize = intval($marginAttributes['Points']) / 100; - break; - } - switch($key) { - case 'top' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize); - break; - case 'bottom' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize); - break; - case 'left' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize); - break; - case 'right' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize); - break; - case 'header' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize); - break; - case 'footer' : - $objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize); - break; - } - } - } - } - - foreach($sheet->Cells->Cell as $cell) { - $cellAttributes = $cell->attributes(); - $row = (int) $cellAttributes->Row + 1; - $column = (int) $cellAttributes->Col; - - if ($row > $maxRow) $maxRow = $row; - if ($column > $maxCol) $maxCol = $column; - - $column = PHPExcel_Cell::stringFromColumnIndex($column); - - // Read cell? - if (!is_null($this->getReadFilter())) { - if (!$this->getReadFilter()->readCell($column, $row, $worksheetName)) { - continue; - } - } - - $ValueType = $cellAttributes->ValueType; - $ExprID = (string) $cellAttributes->ExprID; -// echo 'Cell ',$column,$row,'<br />'; -// echo 'Type is ',$ValueType,'<br />'; -// echo 'Value is ',$cell,'<br />'; - $type = PHPExcel_Cell_DataType::TYPE_FORMULA; - if ($ExprID > '') { - if (((string) $cell) > '') { - - $this->_expressions[$ExprID] = array( 'column' => $cellAttributes->Col, - 'row' => $cellAttributes->Row, - 'formula' => (string) $cell - ); -// echo 'NEW EXPRESSION ',$ExprID,'<br />'; - } else { - $expression = $this->_expressions[$ExprID]; - - $cell = $this->_referenceHelper->updateFormulaReferences( $expression['formula'], - 'A1', - $cellAttributes->Col - $expression['column'], - $cellAttributes->Row - $expression['row'], - $worksheetName - ); -// echo 'SHARED EXPRESSION ',$ExprID,'<br />'; -// echo 'New Value is ',$cell,'<br />'; - } - $type = PHPExcel_Cell_DataType::TYPE_FORMULA; - } else { - switch($ValueType) { - case '10' : // NULL - $type = PHPExcel_Cell_DataType::TYPE_NULL; - break; - case '20' : // Boolean - $type = PHPExcel_Cell_DataType::TYPE_BOOL; - $cell = ($cell == 'TRUE') ? True : False; - break; - case '30' : // Integer - $cell = intval($cell); - case '40' : // Float - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - break; - case '50' : // Error - $type = PHPExcel_Cell_DataType::TYPE_ERROR; - break; - case '60' : // String - $type = PHPExcel_Cell_DataType::TYPE_STRING; - break; - case '70' : // Cell Range - case '80' : // Array - } - } - $objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell,$type); - } - - if ((!$this->_readDataOnly) && (isset($sheet->Objects))) { - foreach($sheet->Objects->children('gnm',TRUE) as $key => $comment) { - $commentAttributes = $comment->attributes(); - // Only comment objects are handled at the moment - if ($commentAttributes->Text) { - $objPHPExcel->getActiveSheet()->getComment( (string)$commentAttributes->ObjectBound ) - ->setAuthor( (string)$commentAttributes->Author ) - ->setText($this->_parseRichText((string)$commentAttributes->Text) ); - } - } - } -// echo '$maxCol=',$maxCol,'; $maxRow=',$maxRow,'<br />'; -// - foreach($sheet->Styles->StyleRegion as $styleRegion) { - $styleAttributes = $styleRegion->attributes(); -// var_dump($styleAttributes); -// echo '<br />'; - - if (($styleAttributes['startRow'] <= $maxRow) && - ($styleAttributes['startCol'] <= $maxCol)) { - - $startColumn = PHPExcel_Cell::stringFromColumnIndex($styleAttributes['startCol']); - $startRow = $styleAttributes['startRow'] + 1; - - $endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : $styleAttributes['endCol']; - $endColumn = PHPExcel_Cell::stringFromColumnIndex($endColumn); - $endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']; - $endRow += 1; - $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow; -// echo $cellRange,'<br />'; - - $styleAttributes = $styleRegion->Style->attributes(); -// var_dump($styleAttributes); -// echo '<br />'; - - // We still set the number format mask for date/time values, even if _readDataOnly is true - if ((!$this->_readDataOnly) || - (PHPExcel_Shared_Date::isDateTimeFormatCode($styleArray['numberformat']['code']))) { - $styleArray = array(); - $styleArray['numberformat']['code'] = (string) $styleAttributes['Format']; - // If _readDataOnly is false, we set all formatting information - if (!$this->_readDataOnly) { - switch($styleAttributes['HAlign']) { - case '1' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; - break; - case '2' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT; - break; - case '4' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT; - break; - case '8' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER; - break; - case '16' : - case '64' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS; - break; - case '32' : - $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY; - break; - } - - switch($styleAttributes['VAlign']) { - case '1' : - $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP; - break; - case '2' : - $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; - break; - case '4' : - $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER; - break; - case '8' : - $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY; - break; - } - - $styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? True : False; - $styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? True : False; - $styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0; - - $RGB = self::_parseGnumericColour($styleAttributes["Fore"]); - $styleArray['font']['color']['rgb'] = $RGB; - $RGB = self::_parseGnumericColour($styleAttributes["Back"]); - $shade = $styleAttributes["Shade"]; - if (($RGB != '000000') || ($shade != '0')) { - $styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB; - $RGB2 = self::_parseGnumericColour($styleAttributes["PatternColor"]); - $styleArray['fill']['endcolor']['rgb'] = $RGB2; - switch($shade) { - case '1' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID; - break; - case '2' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR; - break; - case '3' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_PATH; - break; - case '4' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN; - break; - case '5' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY; - break; - case '6' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID; - break; - case '7' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL; - break; - case '8' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS; - break; - case '9' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKUP; - break; - case '10' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL; - break; - case '11' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625; - break; - case '12' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY125; - break; - case '13' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN; - break; - case '14' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY; - break; - case '15' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID; - break; - case '16' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL; - break; - case '17' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS; - break; - case '18' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP; - break; - case '19' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL; - break; - case '20' : - $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY; - break; - } - } - - $fontAttributes = $styleRegion->Style->Font->attributes(); -// var_dump($fontAttributes); -// echo '<br />'; - $styleArray['font']['name'] = (string) $styleRegion->Style->Font; - $styleArray['font']['size'] = intval($fontAttributes['Unit']); - $styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? True : False; - $styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? True : False; - $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? True : False; - switch($fontAttributes['Underline']) { - case '1' : - $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE; - break; - case '2' : - $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE; - break; - case '3' : - $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING; - break; - case '4' : - $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING; - break; - default : - $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE; - break; - } - switch($fontAttributes['Script']) { - case '1' : - $styleArray['font']['superScript'] = True; - break; - case '-1' : - $styleArray['font']['subScript'] = True; - break; - } - - if (isset($styleRegion->Style->StyleBorder)) { - if (isset($styleRegion->Style->StyleBorder->Top)) { - $styleArray['borders']['top'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes()); - } - if (isset($styleRegion->Style->StyleBorder->Bottom)) { - $styleArray['borders']['bottom'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes()); - } - if (isset($styleRegion->Style->StyleBorder->Left)) { - $styleArray['borders']['left'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes()); - } - if (isset($styleRegion->Style->StyleBorder->Right)) { - $styleArray['borders']['right'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes()); - } - if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) { - $styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); - $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH; - } elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) { - $styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes()); - $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP; - } elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) { - $styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes()); - $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN; - } - } - if (isset($styleRegion->Style->HyperLink)) { - // TO DO - $hyperlink = $styleRegion->Style->HyperLink->attributes(); - } - } -// var_dump($styleArray); -// echo '<br />'; - $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray); - } - } - } - - if ((!$this->_readDataOnly) && (isset($sheet->Cols))) { - // Column Widths - $columnAttributes = $sheet->Cols->attributes(); - $defaultWidth = $columnAttributes['DefaultSizePts'] / 5.4; - $c = 0; - foreach($sheet->Cols->ColInfo as $columnOverride) { - $columnAttributes = $columnOverride->attributes(); - $column = $columnAttributes['No']; - $columnWidth = $columnAttributes['Unit'] / 5.4; - $hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false; - $columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1; - while ($c < $column) { - $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); - ++$c; - } - while (($c < ($column+$columnCount)) && ($c <= $maxCol)) { - $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($columnWidth); - if ($hidden) { - $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setVisible(false); - } - ++$c; - } - } - while ($c <= $maxCol) { - $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth); - ++$c; - } - } - - if ((!$this->_readDataOnly) && (isset($sheet->Rows))) { - // Row Heights - $rowAttributes = $sheet->Rows->attributes(); - $defaultHeight = $rowAttributes['DefaultSizePts']; - $r = 0; - - foreach($sheet->Rows->RowInfo as $rowOverride) { - $rowAttributes = $rowOverride->attributes(); - $row = $rowAttributes['No']; - $rowHeight = $rowAttributes['Unit']; - $hidden = ((isset($rowAttributes['Hidden'])) && ($rowAttributes['Hidden'] == '1')) ? true : false; - $rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1; - while ($r < $row) { - ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); - } - while (($r < ($row+$rowCount)) && ($r < $maxRow)) { - ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight); - if ($hidden) { - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false); - } - } - } - while ($r < $maxRow) { - ++$r; - $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight); - } - } - - // Handle Merged Cells in this worksheet - if (isset($sheet->MergedRegions)) { - foreach($sheet->MergedRegions->Merge as $mergeCells) { - $objPHPExcel->getActiveSheet()->mergeCells($mergeCells); - } - } - - $worksheetID++; - } - - // Loop through definedNames (global named ranges) - if (isset($gnmXML->Names)) { - foreach($gnmXML->Names->Name as $namedRange) { - $name = (string) $namedRange->name; - $range = (string) $namedRange->value; - if (stripos($range, '#REF!') !== false) { - continue; - } - - $range = explode('!',$range); - $range[0] = trim($range[0],"'");; - if ($worksheet = $objPHPExcel->getSheetByName($range[0])) { - $extractedRange = str_replace('$', '', $range[1]); - $objPHPExcel->addNamedRange( new PHPExcel_NamedRange($name, $worksheet, $extractedRange) ); - } - } - } - - - // Return - return $objPHPExcel; - } - - private static function _parseBorderAttributes($borderAttributes) { - $styleArray = array(); - - if (isset($borderAttributes["Color"])) { - $RGB = self::_parseGnumericColour($borderAttributes["Color"]); - $styleArray['color']['rgb'] = $RGB; - } - - switch ($borderAttributes["Style"]) { - case '0' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_NONE; - break; - case '1' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case '2' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM; - break; - case '4' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED; - break; - case '5' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_THICK; - break; - case '6' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOUBLE; - break; - case '7' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED; - break; - case '9' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT; - break; - case '10' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT; - break; - case '11' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOTDOT; - break; - case '12' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; - break; - case '13' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; - break; - case '3' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT; - break; - case '8' : - $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED; - break; - } - return $styleArray; - } - - private function _parseRichText($is = '') { - $value = new PHPExcel_RichText(); - - $value->createText($is); - - return $value; - } - - private static function _parseGnumericColour($gnmColour) { - list($gnmR,$gnmG,$gnmB) = explode(':',$gnmColour); - $gnmR = substr(str_pad($gnmR,4,'0',STR_PAD_RIGHT),0,2); - $gnmG = substr(str_pad($gnmG,4,'0',STR_PAD_RIGHT),0,2); - $gnmB = substr(str_pad($gnmB,4,'0',STR_PAD_RIGHT),0,2); - $RGB = $gnmR.$gnmG.$gnmB; -// echo 'Excel Colour: ',$RGB,'<br />'; - return $RGB; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReadFilter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReadFilter.php deleted file mode 100644 index d5b0cb9c2c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReadFilter.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Reader_IReadFilter - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -interface PHPExcel_Reader_IReadFilter -{ - /** - * Should this cell be read? - * - * @param $column String column index - * @param $row Row index - * @param $worksheetName Optional worksheet name - * @return boolean - */ - public function readCell($column, $row, $worksheetName = ''); -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReader.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReader.php deleted file mode 100644 index d82260a31d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/IReader.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Reader_IReader - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -interface PHPExcel_Reader_IReader -{ - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename); - - /** - * Loads PHPExcel from file - * - * @param string $pFileName - * @throws Exception - */ - public function load($pFilename); -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/OOCalc.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/OOCalc.php deleted file mode 100644 index 93a376bef7..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/OOCalc.php +++ /dev/null @@ -1,582 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** PHPExcel root directory */ -if (!defined('PHPEXCEL_ROOT')) { - /** - * @ignore - */ - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); -} - -/** - * PHPExcel_Reader_OOCalc - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Reader_OOCalc implements PHPExcel_Reader_IReader -{ - /** - * Read data only? - * Identifies whether the Reader should only read data values for cells, and ignore any formatting information; - * or whether it should read both data and formatting - * - * @var boolean - */ - private $_readDataOnly = false; - - /** - * Restrict which sheets should be loaded? - * This property holds an array of worksheet names to be loaded. If null, then all worksheets will be loaded. - * - * @var array of string - */ - private $_loadSheetsOnly = null; - - /** - * Formats - * - * @var array - */ - private $_styles = array(); - - /** - * PHPExcel_Reader_IReadFilter instance - * - * @var PHPExcel_Reader_IReadFilter - */ - private $_readFilter = null; - - - /** - * Read data only? - * If this is true, then the Reader will only read data values for cells, it will not read any formatting information. - * If false (the default) it will read data and formatting. - * - * @return boolean - */ - public function getReadDataOnly() { - return $this->_readDataOnly; - } - - /** - * Set read data only - * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. - * Set to false (the default) to advise the Reader to read both data and formatting for cells. - * - * @param boolean $pValue - * - * @return PHPExcel_Reader_OOCalc - */ - public function setReadDataOnly($pValue = false) { - $this->_readDataOnly = $pValue; - return $this; - } - - /** - * Get which sheets to load - * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null - * indicating that all worksheets in the workbook should be loaded. - * - * @return mixed - */ - public function getLoadSheetsOnly() - { - return $this->_loadSheetsOnly; - } - - /** - * Set which sheets to load - * - * @param mixed $value - * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. - * If NULL, then it tells the Reader to read all worksheets in the workbook - * - * @return PHPExcel_Reader_OOCalc - */ - public function setLoadSheetsOnly($value = null) - { - $this->_loadSheetsOnly = is_array($value) ? - $value : array($value); - return $this; - } - - /** - * Set all sheets to load - * Tells the Reader to load all worksheets from the workbook. - * - * @return PHPExcel_Reader_OOCalc - */ - public function setLoadAllSheets() - { - $this->_loadSheetsOnly = null; - return $this; - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - * @return PHPExcel_Reader_OOCalc - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Create a new PHPExcel_Reader_OOCalc - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - // Check if zip class exists - if (!class_exists('ZipArchive')) { - return false; - } - - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Load file - $zip = new ZipArchive; - if ($zip->open($pFilename) === true) { - // check if it is an OOXML archive - $mimeType = $zip->getFromName("mimetype"); - - $zip->close(); - - return ($mimeType === 'application/vnd.oasis.opendocument.spreadsheet'); - } - - return false; - } - - /** - * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object - * - * @param string $pFilename - * @throws Exception - */ - public function listWorksheetNames($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $worksheetNames = array(); - - $zip = new ZipArchive; - if ($zip->open($pFilename) === true) { - - $xml = simplexml_load_string($zip->getFromName("content.xml")); - $namespacesContent = $xml->getNamespaces(true); - - $workbook = $xml->children($namespacesContent['office']); - foreach($workbook->body->spreadsheet as $workbookData) { - $workbookData = $workbookData->children($namespacesContent['table']); - foreach($workbookData->table as $worksheetDataSet) { - $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); - - $worksheetNames[] = $worksheetDataAttributes['name']; - } - } - } - - return $worksheetNames; - } - - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - - // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); - } - - private static function identifyFixedStyleValue($styleList,&$styleAttributeValue) { - $styleAttributeValue = strtolower($styleAttributeValue); - foreach($styleList as $style) { - if ($styleAttributeValue == strtolower($style)) { - $styleAttributeValue = $style; - return true; - } - } - return false; - } - - /** - * Loads PHPExcel from file into PHPExcel instance - * - * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception - */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - $timezoneObj = new DateTimeZone('Europe/London'); - $GMT = new DateTimeZone('UTC'); - - $zip = new ZipArchive; - if ($zip->open($pFilename) === true) { -// echo '<h1>Meta Information</h1>'; - $xml = simplexml_load_string($zip->getFromName("meta.xml")); - $namespacesMeta = $xml->getNamespaces(true); -// echo '<pre>'; -// print_r($namespacesMeta); -// echo '</pre><hr />'; - - $docProps = $objPHPExcel->getProperties(); - $officeProperty = $xml->children($namespacesMeta['office']); - foreach($officeProperty as $officePropertyData) { - $officePropertyDC = array(); - if (isset($namespacesMeta['dc'])) { - $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']); - } - foreach($officePropertyDC as $propertyName => $propertyValue) { - switch ($propertyName) { - case 'title' : - $docProps->setTitle($propertyValue); - break; - case 'subject' : - $docProps->setSubject($propertyValue); - break; - case 'creator' : - $docProps->setCreator($propertyValue); - $docProps->setLastModifiedBy($propertyValue); - break; - case 'date' : - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - $docProps->setModified($creationDate); - break; - case 'description' : - $docProps->setDescription($propertyValue); - break; - } - } - $officePropertyMeta = array(); - if (isset($namespacesMeta['dc'])) { - $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']); - } - foreach($officePropertyMeta as $propertyName => $propertyValue) { - $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']); - switch ($propertyName) { - case 'initial-creator' : - $docProps->setCreator($propertyValue); - break; - case 'keyword' : - $docProps->setKeywords($propertyValue); - break; - case 'creation-date' : - $creationDate = strtotime($propertyValue); - $docProps->setCreated($creationDate); - break; - case 'user-defined' : - $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; - foreach ($propertyValueAttributes as $key => $value) { - if ($key == 'name') { - $propertyValueName = (string) $value; - } elseif($key == 'value-type') { - switch ($value) { - case 'date' : - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'date'); - $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE; - break; - case 'boolean' : - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'bool'); - $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN; - break; - case 'float' : - $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue,'r4'); - $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT; - break; - default : - $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING; - } - } - } - $docProps->setCustomProperty($propertyValueName,$propertyValue,$propertyValueType); - break; - } - } - } - - -// echo '<h1>Workbook Content</h1>'; - $xml = simplexml_load_string($zip->getFromName("content.xml")); - $namespacesContent = $xml->getNamespaces(true); -// echo '<pre>'; -// print_r($namespacesContent); -// echo '</pre><hr />'; - - $workbook = $xml->children($namespacesContent['office']); - foreach($workbook->body->spreadsheet as $workbookData) { - $workbookData = $workbookData->children($namespacesContent['table']); - $worksheetID = 0; - foreach($workbookData->table as $worksheetDataSet) { - $worksheetData = $worksheetDataSet->children($namespacesContent['table']); -// print_r($worksheetData); -// echo '<br />'; - $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']); -// print_r($worksheetDataAttributes); -// echo '<br />'; - if ((isset($this->_loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) && - (!in_array($worksheetDataAttributes['name'], $this->_loadSheetsOnly))) { - continue; - } - -// echo '<h2>Worksheet '.$worksheetDataAttributes['name'].'</h2>'; - // Create new Worksheet - $objPHPExcel->createSheet(); - $objPHPExcel->setActiveSheetIndex($worksheetID); - if (isset($worksheetDataAttributes['name'])) { - $worksheetName = (string) $worksheetDataAttributes['name']; - $objPHPExcel->getActiveSheet()->setTitle($worksheetName); - } - - $rowID = 1; - foreach($worksheetData as $key => $rowData) { -// echo '<b>'.$key.'</b><br />'; - switch ($key) { - case 'table-header-rows': - foreach ($rowData as $key=>$cellData) { - $rowData = $cellData; - break; - } - case 'table-row' : - $columnID = 'A'; - foreach($rowData as $key => $cellData) { - if (!is_null($this->getReadFilter())) { - if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) { - continue; - } - } - -// echo '<b>'.$columnID.$rowID.'</b><br />'; - $cellDataText = $cellData->children($namespacesContent['text']); - $cellDataOffice = $cellData->children($namespacesContent['office']); - $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']); - $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']); - -// echo 'Office Attributes: '; -// print_r($cellDataOfficeAttributes); -// echo '<br />Table Attributes: '; -// print_r($cellDataTableAttributes); -// echo '<br />Cell Data Text'; -// print_r($cellDataText); -// echo '<br />'; -// - $type = $formatting = $hyperlink = null; - $hasCalculatedValue = false; - $cellDataFormula = ''; - if (isset($cellDataTableAttributes['formula'])) { - $cellDataFormula = $cellDataTableAttributes['formula']; - $hasCalculatedValue = true; - } - - if (isset($cellDataOffice->annotation)) { -// echo 'Cell has comment<br />'; - $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']); - $textArray = array(); - foreach($annotationText as $t) { - foreach($t->span as $text) { - $textArray[] = (string)$text; - } - } - $text = implode("\n",$textArray); -// echo $text,'<br />'; - $objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID ) -// ->setAuthor( $author ) - ->setText($this->_parseRichText($text) ); - } - - if (isset($cellDataText->p)) { -// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />'; - switch ($cellDataOfficeAttributes['value-type']) { - case 'string' : - $type = PHPExcel_Cell_DataType::TYPE_STRING; - $dataValue = $cellDataText->p; - if (isset($dataValue->a)) { - $dataValue = $dataValue->a; - $cellXLinkAttributes = $dataValue->attributes($namespacesContent['xlink']); - $hyperlink = $cellXLinkAttributes['href']; - } - break; - case 'boolean' : - $type = PHPExcel_Cell_DataType::TYPE_BOOL; - $dataValue = ($cellDataText->p == 'TRUE') ? True : False; - break; - case 'float' : - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $dataValue = (float) $cellDataOfficeAttributes['value']; - if (floor($dataValue) == $dataValue) { - $dataValue = (integer) $dataValue; - } - break; - case 'date' : - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); - $dateObj->setTimeZone($timezoneObj); - list($year,$month,$day,$hour,$minute,$second) = explode(' ',$dateObj->format('Y m d H i s')); - $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year,$month,$day,$hour,$minute,$second); - if ($dataValue != floor($dataValue)) { - $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15.' '.PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; - } else { - $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15; - } - break; - case 'time' : - $type = PHPExcel_Cell_DataType::TYPE_NUMERIC; - $dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':',sscanf($cellDataOfficeAttributes['time-value'],'PT%dH%dM%dS')))); - $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4; - break; - } -// echo 'Data value is '.$dataValue.'<br />'; -// if (!is_null($hyperlink)) { -// echo 'Hyperlink is '.$hyperlink.'<br />'; -// } - } - - if ($hasCalculatedValue) { - $type = PHPExcel_Cell_DataType::TYPE_FORMULA; -// echo 'Formula: '.$cellDataFormula.'<br />'; - $cellDataFormula = substr($cellDataFormula,strpos($cellDataFormula,':=')+1); - $temp = explode('"',$cellDataFormula); - $tKey = false; - foreach($temp as &$value) { - // Only replace in alternate array entries (i.e. non-quoted blocks) - if ($tKey = !$tKey) { - $value = preg_replace('/\[\.(.*):\.(.*)\]/Ui','$1:$2',$value); - $value = preg_replace('/\[\.(.*)\]/Ui','$1',$value); - $value = PHPExcel_Calculation::_translateSeparator(';',',',$value,$inBraces); - } - } - unset($value); - // Then rebuild the formula string - $cellDataFormula = implode('"',$temp); -// echo 'Adjusted Formula: '.$cellDataFormula.'<br />'; - } - - if (!is_null($type)) { - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue),$type); - if ($hasCalculatedValue) { -// echo 'Forumla result is '.$dataValue.'<br />'; - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($dataValue); - } - if (($cellDataOfficeAttributes['value-type'] == 'date') || - ($cellDataOfficeAttributes['value-type'] == 'time')) { - $objPHPExcel->getActiveSheet()->getStyle($columnID.$rowID)->getNumberFormat()->setFormatCode($formatting); - } - if (!is_null($hyperlink)) { - $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->getHyperlink()->setUrl($hyperlink); - } - } - - // Merged cells - if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) { - $columnTo = $columnID; - if (isset($cellDataTableAttributes['number-columns-spanned'])) { - $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2); - } - $rowTo = $rowID; - if (isset($cellDataTableAttributes['number-rows-spanned'])) { - $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1; - } - $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo; - $objPHPExcel->getActiveSheet()->mergeCells($cellRange); - } - - if (isset($cellDataTableAttributes['number-columns-repeated'])) { -// echo 'Repeated '.$cellDataTableAttributes['number-columns-repeated'].' times<br />'; - $columnID = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-repeated'] - 2); - } - ++$columnID; - } - ++$rowID; - break; - } - } - ++$worksheetID; - } - } - - } - - // Return - return $objPHPExcel; - } - - private function _parseRichText($is = '') { - $value = new PHPExcel_RichText(); - - $value->createText($is); - - return $value; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/SYLK.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/SYLK.php deleted file mode 100644 index 5c9830aae0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Reader/SYLK.php +++ /dev/null @@ -1,415 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** PHPExcel root directory */ -if (!defined('PHPEXCEL_ROOT')) { - /** - * @ignore - */ - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../'); - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); -} - -/** - * PHPExcel_Reader_SYLK - * - * @category PHPExcel - * @package PHPExcel_Reader - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Reader_SYLK implements PHPExcel_Reader_IReader -{ - /** - * Input encoding - * - * @var string - */ - private $_inputEncoding = 'ANSI'; - - /** - * Sheet index to read - * - * @var int - */ - private $_sheetIndex = 0; - - /** - * Formats - * - * @var array - */ - private $_formats = array(); - - /** - * Format Count - * - * @var int - */ - private $_format = 0; - - /** - * PHPExcel_Reader_IReadFilter instance - * - * @var PHPExcel_Reader_IReadFilter - */ - private $_readFilter = null; - - /** - * Create a new PHPExcel_Reader_SYLK - */ - public function __construct() { - $this->_readFilter = new PHPExcel_Reader_DefaultReadFilter(); - } - - /** - * Can the current PHPExcel_Reader_IReader read the file? - * - * @param string $pFileName - * @return boolean - */ - public function canRead($pFilename) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Read sample data (first 2 KB will do) - $fh = fopen($pFilename, 'r'); - $data = fread($fh, 2048); - fclose($fh); - - // Count delimiters in file - $delimiterCount = substr_count($data, ';'); - if ($delimiterCount < 1) { - return false; - } - - // Analyze first line looking for ID; signature - $lines = explode("\n", $data); - if (substr($lines[0],0,4) != 'ID;P') { - return false; - } - - return true; - } - - /** - * Loads PHPExcel from file - * - * @param string $pFilename - * @return PHPExcel - * @throws Exception - */ - public function load($pFilename) - { - // Create new PHPExcel - $objPHPExcel = new PHPExcel(); - - // Load into this instance - return $this->loadIntoExisting($pFilename, $objPHPExcel); - } - - /** - * Read filter - * - * @return PHPExcel_Reader_IReadFilter - */ - public function getReadFilter() { - return $this->_readFilter; - } - - /** - * Set read filter - * - * @param PHPExcel_Reader_IReadFilter $pValue - */ - public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue) { - $this->_readFilter = $pValue; - return $this; - } - - /** - * Set input encoding - * - * @param string $pValue Input encoding - */ - public function setInputEncoding($pValue = 'ANSI') - { - $this->_inputEncoding = $pValue; - return $this; - } - - /** - * Get input encoding - * - * @return string - */ - public function getInputEncoding() - { - return $this->_inputEncoding; - } - - /** - * Loads PHPExcel from file into PHPExcel instance - * - * @param string $pFilename - * @param PHPExcel $objPHPExcel - * @return PHPExcel - * @throws Exception - */ - public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) - { - // Check if file exists - if (!file_exists($pFilename)) { - throw new Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - - // Create new PHPExcel - while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) { - $objPHPExcel->createSheet(); - } - $objPHPExcel->setActiveSheetIndex( $this->_sheetIndex ); - - $fromFormats = array('\-', '\ '); - $toFormats = array('-', ' '); - - // Open file - $fileHandle = fopen($pFilename, 'r'); - if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for reading."); - } - - // Loop through file - $rowData = array(); - $column = $row = ''; - - // loop through one row (line) at a time in the file - while (($rowData = fgets($fileHandle)) !== FALSE) { - - // convert SYLK encoded $rowData to UTF-8 - $rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData); - - // explode each row at semicolons while taking into account that literal semicolon (;) - // is escaped like this (;;) - $rowData = explode("\t",str_replace('¤',';',str_replace(';',"\t",str_replace(';;','¤',rtrim($rowData))))); - - $dataType = array_shift($rowData); - // Read shared styles - if ($dataType == 'P') { - $formatArray = array(); - foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { - case 'P' : $formatArray['numberformat']['code'] = str_replace($fromFormats,$toFormats,substr($rowDatum,1)); - break; - case 'E' : - case 'F' : $formatArray['font']['name'] = substr($rowDatum,1); - break; - case 'L' : $formatArray['font']['size'] = substr($rowDatum,1); - break; - case 'S' : $styleSettings = substr($rowDatum,1); - for ($i=0;$i<strlen($styleSettings);++$i) { - switch ($styleSettings{$i}) { - case 'I' : $formatArray['font']['italic'] = true; - break; - case 'D' : $formatArray['font']['bold'] = true; - break; - case 'T' : $formatArray['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'B' : $formatArray['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'L' : $formatArray['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'R' : $formatArray['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - } - } - break; - } - } - $this->_formats['P'.$this->_format++] = $formatArray; - // Read cell value data - } elseif ($dataType == 'C') { - $hasCalculatedValue = false; - $cellData = $cellDataFormula = ''; - foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { - case 'C' : - case 'X' : $column = substr($rowDatum,1); - break; - case 'R' : - case 'Y' : $row = substr($rowDatum,1); - break; - case 'K' : $cellData = substr($rowDatum,1); - break; - case 'E' : $cellDataFormula = '='.substr($rowDatum,1); - // Convert R1C1 style references to A1 style references (but only when not quoted) - $temp = explode('"',$cellDataFormula); - $key = false; - foreach($temp as &$value) { - // Only count/replace in alternate array entries - if ($key = !$key) { - preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/',$value, $cellReferences,PREG_SET_ORDER+PREG_OFFSET_CAPTURE); - // Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way - // through the formula from left to right. Reversing means that we work right to left.through - // the formula - $cellReferences = array_reverse($cellReferences); - // Loop through each R1C1 style reference in turn, converting it to its A1 style equivalent, - // then modify the formula to use that new reference - foreach($cellReferences as $cellReference) { - $rowReference = $cellReference[2][0]; - // Empty R reference is the current row - if ($rowReference == '') $rowReference = $row; - // Bracketed R references are relative to the current row - if ($rowReference{0} == '[') $rowReference = $row + trim($rowReference,'[]'); - $columnReference = $cellReference[4][0]; - // Empty C reference is the current column - if ($columnReference == '') $columnReference = $column; - // Bracketed C references are relative to the current column - if ($columnReference{0} == '[') $columnReference = $column + trim($columnReference,'[]'); - $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; - - $value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0])); - } - } - } - unset($value); - // Then rebuild the formula string - $cellDataFormula = implode('"',$temp); - $hasCalculatedValue = true; - break; - } - } - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); - $cellData = PHPExcel_Calculation::_unwrapResult($cellData); - - // Set cell value - $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData); - if ($hasCalculatedValue) { - $cellData = PHPExcel_Calculation::_unwrapResult($cellData); - $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData); - } - // Read cell formatting - } elseif ($dataType == 'F') { - $formatStyle = $columnWidth = $styleSettings = ''; - $styleData = array(); - foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { - case 'C' : - case 'X' : $column = substr($rowDatum,1); - break; - case 'R' : - case 'Y' : $row = substr($rowDatum,1); - break; - case 'P' : $formatStyle = $rowDatum; - break; - case 'W' : list($startCol,$endCol,$columnWidth) = explode(' ',substr($rowDatum,1)); - break; - case 'S' : $styleSettings = substr($rowDatum,1); - for ($i=0;$i<strlen($styleSettings);++$i) { - switch ($styleSettings{$i}) { - case 'I' : $styleData['font']['italic'] = true; - break; - case 'D' : $styleData['font']['bold'] = true; - break; - case 'T' : $styleData['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'B' : $styleData['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'L' : $styleData['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - case 'R' : $styleData['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN; - break; - } - } - break; - } - } - if (($formatStyle > '') && ($column > '') && ($row > '')) { - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); - $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->_formats[$formatStyle]); - } - if ((count($styleData) > 0) && ($column > '') && ($row > '')) { - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1); - $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData); - } - if ($columnWidth > '') { - if ($startCol == $endCol) { - $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1); - $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); - } else { - $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1); - $endCol = PHPExcel_Cell::stringFromColumnIndex($endCol-1); - $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth); - do { - $objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth); - } while ($startCol != $endCol); - } - } - } else { - foreach($rowData as $rowDatum) { - switch($rowDatum{0}) { - case 'C' : - case 'X' : $column = substr($rowDatum,1); - break; - case 'R' : - case 'Y' : $row = substr($rowDatum,1); - break; - } - } - } - } - - // Close file - fclose($fileHandle); - - // Return - return $objPHPExcel; - } - - /** - * Get sheet index - * - * @return int - */ - public function getSheetIndex() { - return $this->_sheetIndex; - } - - /** - * Set sheet index - * - * @param int $pValue Sheet index - * @return PHPExcel_Reader_SYLK - */ - public function setSheetIndex($pValue = 0) { - $this->_sheetIndex = $pValue; - return $this; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/ReferenceHelper.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/ReferenceHelper.php deleted file mode 100644 index 74a12d20ab..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/ReferenceHelper.php +++ /dev/null @@ -1,632 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_ReferenceHelper (Singleton) - * - * @category PHPExcel - * @package PHPExcel - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_ReferenceHelper -{ - /** Constants */ - /** Regular Expressions */ - const REFHELPER_REGEXP_CELLREF = '((\w*|\'[^!]*\')!)?(?<![:a-z\$])(\$?[a-z]{1,3}\$?\d+)(?=[^:!\d\'])'; - const REFHELPER_REGEXP_CELLRANGE = '((\w*|\'[^!]*\')!)?(\$?[a-z]{1,3}\$?\d+):(\$?[a-z]{1,3}\$?\d+)'; - const REFHELPER_REGEXP_ROWRANGE = '((\w*|\'[^!]*\')!)?(\$?\d+):(\$?\d+)'; - const REFHELPER_REGEXP_COLRANGE = '((\w*|\'[^!]*\')!)?(\$?[a-z]{1,3}):(\$?[a-z]{1,3})'; - - /** - * Instance of this class - * - * @var PHPExcel_ReferenceHelper - */ - private static $_instance; - - /** - * Get an instance of this class - * - * @return PHPExcel_ReferenceHelper - */ - public static function getInstance() { - if (!isset(self::$_instance) || is_null(self::$_instance)) { - self::$_instance = new PHPExcel_ReferenceHelper(); - } - - return self::$_instance; - } - - /** - * Create a new PHPExcel_ReferenceHelper - */ - protected function __construct() { - } - - /** - * Insert a new column, updating all possible related data - * - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to insert - * @param int $pNumRows Number of rows to insert - * @throws Exception - */ - public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, PHPExcel_Worksheet $pSheet = null) { - $aCellCollection = $pSheet->getCellCollection(); - - // Get coordinates of $pBefore - $beforeColumn = 'A'; - $beforeRow = 1; - list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString( $pBefore ); - - - // Clear cells if we are removing columns or rows - $highestColumn = $pSheet->getHighestColumn(); - $highestRow = $pSheet->getHighestRow(); - - // 1. Clear column strips if we are removing columns - if ($pNumCols < 0 && PHPExcel_Cell::columnIndexFromString($beforeColumn) - 2 + $pNumCols > 0) { - for ($i = 1; $i <= $highestRow - 1; ++$i) { - for ($j = PHPExcel_Cell::columnIndexFromString($beforeColumn) - 1 + $pNumCols; $j <= PHPExcel_Cell::columnIndexFromString($beforeColumn) - 2; ++$j) { - $coordinate = PHPExcel_Cell::stringFromColumnIndex($j) . $i; - $pSheet->removeConditionalStyles($coordinate); - if ($pSheet->cellExists($coordinate)) { - $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); - $pSheet->getCell($coordinate)->setXfIndex(0); - } - } - } - } - - // 2. Clear row strips if we are removing rows - if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) { - for ($i = PHPExcel_Cell::columnIndexFromString($beforeColumn) - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { - for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) { - $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . $j; - $pSheet->removeConditionalStyles($coordinate); - if ($pSheet->cellExists($coordinate)) { - $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL); - $pSheet->getCell($coordinate)->setXfIndex(0); - } - } - } - } - - - // Loop through cells, bottom-up, and change cell coordinates - while (($cellID = ($pNumCols < 0 || $pNumRows < 0) ? array_shift($aCellCollection) : array_pop($aCellCollection))) { - $cell = $pSheet->getCell($cellID); - - // New coordinates - $newCoordinates = PHPExcel_Cell::stringFromColumnIndex( PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1 + $pNumCols ) . ($cell->getRow() + $pNumRows); - - // Should the cell be updated? Move value and cellXf index from one cell to another. - if ((PHPExcel_Cell::columnIndexFromString( $cell->getColumn() ) >= PHPExcel_Cell::columnIndexFromString($beforeColumn)) && - ($cell->getRow() >= $beforeRow)) { - - // Update cell styles - $pSheet->getCell($newCoordinates)->setXfIndex($cell->getXfIndex()); - $cell->setXfIndex(0); - - // Insert this cell at its new location - if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { - // Formula should be adjusted - $pSheet->getCell($newCoordinates) - ->setValue($this->updateFormulaReferences($cell->getValue(), - $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); - } else { - // Formula should not be adjusted - $pSheet->getCell($newCoordinates)->setValue($cell->getValue()); - } - - // Clear the original cell - $pSheet->getCell($cell->getCoordinate())->setValue(''); - - } else { - /* We don't need to update styles for rows/columns before our insertion position, - but we do still need to adjust any formulae in those cells */ - if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { - // Formula should be adjusted - $cell->setValue($this->updateFormulaReferences($cell->getValue(), - $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle())); - } - - } - } - - - // Duplicate styles for the newly inserted cells - $highestColumn = $pSheet->getHighestColumn(); - $highestRow = $pSheet->getHighestRow(); - - if ($pNumCols > 0 && PHPExcel_Cell::columnIndexFromString($beforeColumn) - 2 > 0) { - for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) { - - // Style - $coordinate = PHPExcel_Cell::stringFromColumnIndex( PHPExcel_Cell::columnIndexFromString($beforeColumn) - 2 ) . $i; - if ($pSheet->cellExists($coordinate)) { - $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); - $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? - $pSheet->getConditionalStyles($coordinate) : false; - for ($j = PHPExcel_Cell::columnIndexFromString($beforeColumn) - 1; $j <= PHPExcel_Cell::columnIndexFromString($beforeColumn) - 2 + $pNumCols; ++$j) { - $pSheet->getCellByColumnAndRow($j, $i)->setXfIndex($xfIndex); - if ($conditionalStyles) { - $cloned = array(); - foreach ($conditionalStyles as $conditionalStyle) { - $cloned[] = clone $conditionalStyle; - } - $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($j) . $i, $cloned); - } - } - } - - } - } - - if ($pNumRows > 0 && $beforeRow - 1 > 0) { - for ($i = PHPExcel_Cell::columnIndexFromString($beforeColumn) - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) { - - // Style - $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . ($beforeRow - 1); - if ($pSheet->cellExists($coordinate)) { - $xfIndex = $pSheet->getCell($coordinate)->getXfIndex(); - $conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ? - $pSheet->getConditionalStyles($coordinate) : false; - for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) { - $pSheet->getCell(PHPExcel_Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex); - if ($conditionalStyles) { - $cloned = array(); - foreach ($conditionalStyles as $conditionalStyle) { - $cloned[] = clone $conditionalStyle; - } - $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($i) . $j, $cloned); - } - } - } - } - } - - - // Update worksheet: column dimensions - $aColumnDimensions = array_reverse($pSheet->getColumnDimensions(), true); - if (count($aColumnDimensions) > 0) { - foreach ($aColumnDimensions as $objColumnDimension) { - $newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows); - list($newReference) = PHPExcel_Cell::coordinateFromString($newReference); - if ($objColumnDimension->getColumnIndex() != $newReference) { - $objColumnDimension->setColumnIndex($newReference); - } - } - $pSheet->refreshColumnDimensions(); - } - - - // Update worksheet: row dimensions - $aRowDimensions = array_reverse($pSheet->getRowDimensions(), true); - if (count($aRowDimensions) > 0) { - foreach ($aRowDimensions as $objRowDimension) { - $newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows); - list(, $newReference) = PHPExcel_Cell::coordinateFromString($newReference); - if ($objRowDimension->getRowIndex() != $newReference) { - $objRowDimension->setRowIndex($newReference); - } - } - $pSheet->refreshRowDimensions(); - - $copyDimension = $pSheet->getRowDimension($beforeRow - 1); - for ($i = $beforeRow; $i <= $beforeRow - 1 + $pNumRows; ++$i) { - $newDimension = $pSheet->getRowDimension($i); - $newDimension->setRowHeight($copyDimension->getRowHeight()); - $newDimension->setVisible($copyDimension->getVisible()); - $newDimension->setOutlineLevel($copyDimension->getOutlineLevel()); - $newDimension->setCollapsed($copyDimension->getCollapsed()); - } - } - - - // Update worksheet: breaks - $aBreaks = array_reverse($pSheet->getBreaks(), true); - foreach ($aBreaks as $key => $value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - if ($key != $newReference) { - $pSheet->setBreak( $newReference, $value ); - $pSheet->setBreak( $key, PHPExcel_Worksheet::BREAK_NONE ); - } - } - - // Update worksheet: comments - $aComments = $pSheet->getComments(); - $aNewComments = array(); // the new array of all comments - foreach ($aComments as $key => &$value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - $aNewComments[$newReference] = $value; - } - $pSheet->setComments($aNewComments); // replace the comments array - - // Update worksheet: hyperlinks - $aHyperlinkCollection = array_reverse($pSheet->getHyperlinkCollection(), true); - foreach ($aHyperlinkCollection as $key => $value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - if ($key != $newReference) { - $pSheet->setHyperlink( $newReference, $value ); - $pSheet->setHyperlink( $key, null ); - } - } - - - // Update worksheet: data validations - $aDataValidationCollection = array_reverse($pSheet->getDataValidationCollection(), true); - foreach ($aDataValidationCollection as $key => $value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - if ($key != $newReference) { - $pSheet->setDataValidation( $newReference, $value ); - $pSheet->setDataValidation( $key, null ); - } - } - - - // Update worksheet: merge cells - $aMergeCells = $pSheet->getMergeCells(); - $aNewMergeCells = array(); // the new array of all merge cells - foreach ($aMergeCells as $key => &$value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - $aNewMergeCells[$newReference] = $newReference; - } - $pSheet->setMergeCells($aNewMergeCells); // replace the merge cells array - - - // Update worksheet: protected cells - $aProtectedCells = array_reverse($pSheet->getProtectedCells(), true); - foreach ($aProtectedCells as $key => $value) { - $newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows); - if ($key != $newReference) { - $pSheet->protectCells( $newReference, $value, true ); - $pSheet->unprotectCells( $key ); - } - } - - - // Update worksheet: autofilter - if ($pSheet->getAutoFilter() != '') { - $pSheet->setAutoFilter( $this->updateCellReference($pSheet->getAutoFilter(), $pBefore, $pNumCols, $pNumRows) ); - } - - - // Update worksheet: freeze pane - if ($pSheet->getFreezePane() != '') { - $pSheet->freezePane( $this->updateCellReference($pSheet->getFreezePane(), $pBefore, $pNumCols, $pNumRows) ); - } - - - // Page setup - if ($pSheet->getPageSetup()->isPrintAreaSet()) { - $pSheet->getPageSetup()->setPrintArea( $this->updateCellReference($pSheet->getPageSetup()->getPrintArea(), $pBefore, $pNumCols, $pNumRows) ); - } - - - // Update worksheet: drawings - $aDrawings = $pSheet->getDrawingCollection(); - foreach ($aDrawings as $objDrawing) { - $newReference = $this->updateCellReference($objDrawing->getCoordinates(), $pBefore, $pNumCols, $pNumRows); - if ($objDrawing->getCoordinates() != $newReference) { - $objDrawing->setCoordinates($newReference); - } - } - - - // Update workbook: named ranges - if (count($pSheet->getParent()->getNamedRanges()) > 0) { - foreach ($pSheet->getParent()->getNamedRanges() as $namedRange) { - if ($namedRange->getWorksheet()->getHashCode() == $pSheet->getHashCode()) { - $namedRange->setRange( - $this->updateCellReference($namedRange->getRange(), $pBefore, $pNumCols, $pNumRows) - ); - } - } - } - - // Garbage collect - $pSheet->garbageCollect(); - } - - /** - * Update references within formulas - * - * @param string $pFormula Formula to update - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to insert - * @param int $pNumRows Number of rows to insert - * @return string Updated formula - * @throws Exception - */ - public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '') { - // Update cell references in the formula - $formulaBlocks = explode('"',$pFormula); - $i = false; - foreach($formulaBlocks as &$formulaBlock) { - // Ignore blocks that were enclosed in quotes (alternating entries in the $formulaBlocks array after the explode) - if ($i = !$i) { - $adjustCount = 0; - $newCellTokens = $cellTokens = array(); - // Search for row ranges (e.g. 'Sheet1'!3:5 or 3:5) with or without $ absolutes (e.g. $3:5) - $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_ROWRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); - if ($matchCount > 0) { - foreach($matches as $match) { - $fromString = ($match[2] > '') ? $match[2].'!' : ''; - $fromString .= $match[3].':'.$match[4]; - $modified3 = substr($this->updateCellReference('$A'.$match[3],$pBefore,$pNumCols,$pNumRows),2); - $modified4 = substr($this->updateCellReference('$A'.$match[4],$pBefore,$pNumCols,$pNumRows),2); - - if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) { - if (($match[2] == '') || (trim($match[2],"'") == $sheetName)) { - $toString = ($match[2] > '') ? $match[2].'!' : ''; - $toString .= $modified3.':'.$modified4; - // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = 100000; - $row = 10000000+trim($match[3],'$'); - $cellIndex = $column.$row; - - $newCellTokens[$cellIndex] = preg_quote($toString); - $cellTokens[$cellIndex] = '/(?<!\d)'.preg_quote($fromString).'(?!\d)/i'; - ++$adjustCount; - } - } - } - } - // Search for column ranges (e.g. 'Sheet1'!C:E or C:E) with or without $ absolutes (e.g. $C:E) - $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_COLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); - if ($matchCount > 0) { - foreach($matches as $match) { - $fromString = ($match[2] > '') ? $match[2].'!' : ''; - $fromString .= $match[3].':'.$match[4]; - $modified3 = substr($this->updateCellReference($match[3].'$1',$pBefore,$pNumCols,$pNumRows),0,-2); - $modified4 = substr($this->updateCellReference($match[4].'$1',$pBefore,$pNumCols,$pNumRows),0,-2); - - if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) { - if (($match[2] == '') || (trim($match[2],"'") == $sheetName)) { - $toString = ($match[2] > '') ? $match[2].'!' : ''; - $toString .= $modified3.':'.$modified4; - // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($match[3],'$')) + 100000; - $row = 10000000; - $cellIndex = $column.$row; - - $newCellTokens[$cellIndex] = preg_quote($toString); - $cellTokens[$cellIndex] = '/(?<![A-Z])'.preg_quote($fromString).'(?![A-Z])/i'; - ++$adjustCount; - } - } - } - } - // Search for cell ranges (e.g. 'Sheet1'!A3:C5 or A3:C5) with or without $ absolutes (e.g. $A1:C$5) - $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); - if ($matchCount > 0) { - foreach($matches as $match) { - $fromString = ($match[2] > '') ? $match[2].'!' : ''; - $fromString .= $match[3].':'.$match[4]; - $modified3 = $this->updateCellReference($match[3],$pBefore,$pNumCols,$pNumRows); - $modified4 = $this->updateCellReference($match[4],$pBefore,$pNumCols,$pNumRows); - - if ($match[3].$match[4] !== $modified3.$modified4) { - if (($match[2] == '') || (trim($match[2],"'") == $sheetName)) { - $toString = ($match[2] > '') ? $match[2].'!' : ''; - $toString .= $modified3.':'.$modified4; - list($column,$row) = PHPExcel_Cell::coordinateFromString($match[3]); - // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($column,'$')) + 100000; - $row = trim($row,'$') + 10000000; - $cellIndex = $column.$row; - - $newCellTokens[$cellIndex] = preg_quote($toString); - $cellTokens[$cellIndex] = '/(?<![A-Z])'.preg_quote($fromString).'(?!\d)/i'; - ++$adjustCount; - } - } - } - } - // Search for cell references (e.g. 'Sheet1'!A3 or C5) with or without $ absolutes (e.g. $A1 or C$5) - $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_CELLREF.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER); - if ($matchCount > 0) { - foreach($matches as $match) { - $fromString = ($match[2] > '') ? $match[2].'!' : ''; - $fromString .= $match[3]; - $modified3 = $this->updateCellReference($match[3],$pBefore,$pNumCols,$pNumRows); - - if ($match[3] !== $modified3) { - if (($match[2] == '') || (trim($match[2],"'") == $sheetName)) { - $toString = ($match[2] > '') ? $match[2].'!' : ''; - $toString .= $modified3; - list($column,$row) = PHPExcel_Cell::coordinateFromString($match[3]); - // Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more - $column = PHPExcel_Cell::columnIndexFromString(trim($column,'$')) + 100000; - $row = trim($row,'$') + 10000000; - $cellIndex = $column.$row; - - $newCellTokens[$cellIndex] = preg_quote($toString); - $cellTokens[$cellIndex] = '/(?<![A-Z])'.preg_quote($fromString).'(?!\d)/i'; - ++$adjustCount; - } - } - } - } - if ($adjustCount > 0) { - krsort($cellTokens); - krsort($newCellTokens); - // Update cell references in the formula - $formulaBlock = str_replace('\\','',preg_replace($cellTokens,$newCellTokens,$formulaBlock)); - } - } - } - unset($formulaBlock); - - // Then rebuild the formula string - return implode('"',$formulaBlocks); - } - - /** - * Update cell reference - * - * @param string $pCellRange Cell range - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to increment - * @param int $pNumRows Number of rows to increment - * @return string Updated cell range - * @throws Exception - */ - public function updateCellReference($pCellRange = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { - // Is it in another worksheet? Will not have to update anything. - if (strpos($pCellRange, "!") !== false) { - return $pCellRange; - // Is it a range or a single cell? - } elseif (strpos($pCellRange, ':') === false && strpos($pCellRange, ',') === false) { - // Single cell - return $this->_updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows); - } elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) { - // Range - return $this->_updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows); - } else { - // Return original - return $pCellRange; - } - } - - /** - * Update named formulas (i.e. containing worksheet references / named ranges) - * - * @param PHPExcel $pPhpExcel Object to update - * @param string $oldName Old name (name to replace) - * @param string $newName New name - */ - public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '') { - if ($oldName == '') { - return; - } - - foreach ($pPhpExcel->getWorksheetIterator() as $sheet) { - foreach ($sheet->getCellCollection(false) as $cellID) { - $cell = $sheet->getCell($cellID); - if (!is_null($cell) && $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) { - $formula = $cell->getValue(); - if (strpos($formula, $oldName) !== false) { - $formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula); - $formula = str_replace($oldName . "!", $newName . "!", $formula); - $cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA); - } - } - } - } - } - - /** - * Update cell range - * - * @param string $pCellRange Cell range (e.g. 'B2:D4', 'B:C' or '2:3') - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to increment - * @param int $pNumRows Number of rows to increment - * @return string Updated cell range - * @throws Exception - */ - private function _updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { - if (strpos($pCellRange,':') !== false || strpos($pCellRange, ',') !== false) { - // Update range - $range = PHPExcel_Cell::splitRange($pCellRange); - $ic = count($range); - for ($i = 0; $i < $ic; ++$i) { - $jc = count($range[$i]); - for ($j = 0; $j < $jc; ++$j) { - if (ctype_alpha($range[$i][$j])) { - $r = PHPExcel_Cell::coordinateFromString($this->_updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows)); - $range[$i][$j] = $r[0]; - } elseif(ctype_digit($range[$i][$j])) { - $r = PHPExcel_Cell::coordinateFromString($this->_updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows)); - $range[$i][$j] = $r[1]; - } else { - $range[$i][$j] = $this->_updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows); - } - } - } - - // Recreate range string - return PHPExcel_Cell::buildRange($range); - } else { - throw new Exception("Only cell ranges may be passed to this method."); - } - } - - /** - * Update single cell reference - * - * @param string $pCellReference Single cell reference - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to increment - * @param int $pNumRows Number of rows to increment - * @return string Updated cell reference - * @throws Exception - */ - private function _updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0) { - if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) { - // Get coordinates of $pBefore - list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString( $pBefore ); - - // Get coordinates of $pCellReference - list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString( $pCellReference ); - - // Verify which parts should be updated - $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && - PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn)); - - $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && - $newRow >= $beforeRow); - - // Create new column reference - if ($updateColumn) { - $newColumn = PHPExcel_Cell::stringFromColumnIndex( PHPExcel_Cell::columnIndexFromString($newColumn) - 1 + $pNumCols ); - } - - // Create new row reference - if ($updateRow) { - $newRow = $newRow + $pNumRows; - } - - // Return new reference - return $newColumn . $newRow; - } else { - throw new Exception("Only single cell references may be passed to this method."); - } - } - - /** - * __clone implementation. Cloning should not be allowed in a Singleton! - * - * @throws Exception - */ - public final function __clone() { - throw new Exception("Cloning a Singleton is not allowed!"); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText.php deleted file mode 100644 index 57d3ce4d19..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText.php +++ /dev/null @@ -1,196 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_RichText - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_RichText implements PHPExcel_IComparable -{ - /** - * Rich text elements - * - * @var PHPExcel_RichText_ITextElement[] - */ - private $_richTextElements; - - /** - * Create a new PHPExcel_RichText instance - * - * @param PHPExcel_Cell $pParent - * @throws Exception - */ - public function __construct(PHPExcel_Cell $pCell = null) - { - // Initialise variables - $this->_richTextElements = array(); - - // Rich-Text string attached to cell? - if (!is_null($pCell)) { - // Add cell text and style - if ($pCell->getValue() != "") { - $objRun = new PHPExcel_RichText_Run($pCell->getValue()); - $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont()); - $this->addText($objRun); - } - - // Set parent value - $pCell->setValueExplicit($this, PHPExcel_Cell_DataType::TYPE_STRING); - } - } - - /** - * Add text - * - * @param PHPExcel_RichText_ITextElement $pText Rich text element - * @throws Exception - * @return PHPExcel_RichText - */ - public function addText(PHPExcel_RichText_ITextElement $pText = null) - { - $this->_richTextElements[] = $pText; - return $this; - } - - /** - * Create text - * - * @param string $pText Text - * @return PHPExcel_RichText_TextElement - * @throws Exception - */ - public function createText($pText = '') - { - $objText = new PHPExcel_RichText_TextElement($pText); - $this->addText($objText); - return $objText; - } - - /** - * Create text run - * - * @param string $pText Text - * @return PHPExcel_RichText_Run - * @throws Exception - */ - public function createTextRun($pText = '') - { - $objText = new PHPExcel_RichText_Run($pText); - $this->addText($objText); - return $objText; - } - - /** - * Get plain text - * - * @return string - */ - public function getPlainText() - { - // Return value - $returnValue = ''; - - // Loop through all PHPExcel_RichText_ITextElement - foreach ($this->_richTextElements as $text) { - $returnValue .= $text->getText(); - } - - // Return - return $returnValue; - } - - /** - * Convert to string - * - * @return string - */ - public function __toString() { - return $this->getPlainText(); - } - - /** - * Get Rich Text elements - * - * @return PHPExcel_RichText_ITextElement[] - */ - public function getRichTextElements() - { - return $this->_richTextElements; - } - - /** - * Set Rich Text elements - * - * @param PHPExcel_RichText_ITextElement[] $pElements Array of elements - * @throws Exception - * @return PHPExcel_RichText - */ - public function setRichTextElements($pElements = null) - { - if (is_array($pElements)) { - $this->_richTextElements = $pElements; - } else { - throw new Exception("Invalid PHPExcel_RichText_ITextElement[] array passed."); - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - $hashElements = ''; - foreach ($this->_richTextElements as $element) { - $hashElements .= $element->getHashCode(); - } - - return md5( - $hashElements - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/ITextElement.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/ITextElement.php deleted file mode 100644 index e355f8bb20..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/ITextElement.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -/** - * PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_RichText_ITextElement - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -interface PHPExcel_RichText_ITextElement -{ - /** - * Get text - * - * @return string Text - */ - public function getText(); - - /** - * Set text - * - * @param $pText string Text - * @return PHPExcel_RichText_ITextElement - */ - public function setText($pText = ''); - - /** - * Get font - * - * @return PHPExcel_Style_Font - */ - public function getFont(); - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode(); -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/Run.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/Run.php deleted file mode 100644 index 55b5927023..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/Run.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_RichText_Run - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_RichText_Run extends PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement -{ - /** - * Font - * - * @var PHPExcel_Style_Font - */ - private $_font; - - /** - * Create a new PHPExcel_RichText_Run instance - * - * @param string $pText Text - */ - public function __construct($pText = '') - { - // Initialise variables - $this->setText($pText); - $this->_font = new PHPExcel_Style_Font(); - } - - /** - * Get font - * - * @return PHPExcel_Style_Font - */ - public function getFont() { - return $this->_font; - } - - /** - * Set font - * - * @param PHPExcel_Style_Font $pFont Font - * @throws Exception - * @return PHPExcel_RichText_ITextElement - */ - public function setFont(PHPExcel_Style_Font $pFont = null) { - $this->_font = $pFont; - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->getText() - . $this->_font->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/TextElement.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/TextElement.php deleted file mode 100644 index a9a2c05b1c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/RichText/TextElement.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php -/** - * PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_RichText_TextElement - * - * @category PHPExcel - * @package PHPExcel_RichText - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_RichText_TextElement implements PHPExcel_RichText_ITextElement -{ - /** - * Text - * - * @var string - */ - private $_text; - - /** - * Create a new PHPExcel_RichText_TextElement instance - * - * @param string $pText Text - */ - public function __construct($pText = '') - { - // Initialise variables - $this->_text = $pText; - } - - /** - * Get text - * - * @return string Text - */ - public function getText() { - return $this->_text; - } - - /** - * Set text - * - * @param $pText string Text - * @return PHPExcel_RichText_ITextElement - */ - public function setText($pText = '') { - $this->_text = $pText; - return $this; - } - - /** - * Get font - * - * @return PHPExcel_Style_Font - */ - public function getFont() { - return null; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_text - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Settings.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Settings.php deleted file mode 100644 index f1967cd1a7..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Settings.php +++ /dev/null @@ -1,93 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Settings - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** PHPExcel root directory */ -if (!defined('PHPEXCEL_ROOT')) { - /** - * @ignore - */ - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../'); - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); -} - - -class PHPExcel_Settings -{ - /** constants */ - const PCLZIP = 'PHPExcel_Shared_ZipArchive'; - const ZIPARCHIVE = 'ZipArchive'; - - - private static $_zipClass = self::ZIPARCHIVE; - - - /** - * Set the Zip Class to use (PCLZip or ZipArchive) - * - * @param string $zipClass PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive - * @return boolean Success or failure - */ - public static function setZipClass($zipClass) { - if (($zipClass == self::PCLZIP) || - ($zipClass == self::ZIPARCHIVE)) { - self::$_zipClass = $zipClass; - return True; - } - return False; - } // function setZipClass() - - - /** - * Return the Zip Class to use (PCLZip or ZipArchive) - * - * @return string Zip Class to use - PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive - */ - public static function getZipClass() { - return self::$_zipClass; - } // function getZipClass() - - - public static function getCacheStorageMethod() { - return PHPExcel_CachedObjectStorageFactory::$_cacheStorageMethod; - } // function getCacheStorageMethod() - - - public static function getCacheStorageClass() { - return PHPExcel_CachedObjectStorageFactory::$_cacheStorageClass; - } // function getCacheStorageClass() - - - public static function setCacheStorageMethod($method = PHPExcel_CachedObjectStorageFactory::cache_in_memory, $arguments = array()) { - return PHPExcel_CachedObjectStorageFactory::initialize($method,$arguments); - } // function setCacheStorageMethod() - - - public static function setLocale($locale){ - return PHPExcel_Calculation::getInstance()->setLocale($locale); - } // function setLocale() - -} \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/CodePage.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/CodePage.php deleted file mode 100644 index 7c8854b860..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/CodePage.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_CodePage - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_CodePage -{ - /** - * Convert Microsoft Code Page Identifier to Code Page Name which iconv - * and mbstring understands - * - * @param int $number Microsoft Code Page Indentifier - * @return string Code Page Name - * @throws Exception - */ - public static function NumberToName($codePage = '1252') - { - switch ($codePage) { - case 367: return 'ASCII'; break; // ASCII - case 437: return 'CP437'; break; // OEM US - case 720: throw new Exception('Code page 720 not supported.'); - break; // OEM Arabic - case 737: return 'CP737'; break; // OEM Greek - case 775: return 'CP775'; break; // OEM Baltic - case 850: return 'CP850'; break; // OEM Latin I - case 852: return 'CP852'; break; // OEM Latin II (Central European) - case 855: return 'CP855'; break; // OEM Cyrillic - case 857: return 'CP857'; break; // OEM Turkish - case 858: return 'CP858'; break; // OEM Multilingual Latin I with Euro - case 860: return 'CP860'; break; // OEM Portugese - case 861: return 'CP861'; break; // OEM Icelandic - case 862: return 'CP862'; break; // OEM Hebrew - case 863: return 'CP863'; break; // OEM Canadian (French) - case 864: return 'CP864'; break; // OEM Arabic - case 865: return 'CP865'; break; // OEM Nordic - case 866: return 'CP866'; break; // OEM Cyrillic (Russian) - case 869: return 'CP869'; break; // OEM Greek (Modern) - case 874: return 'CP874'; break; // ANSI Thai - case 932: return 'CP932'; break; // ANSI Japanese Shift-JIS - case 936: return 'CP936'; break; // ANSI Chinese Simplified GBK - case 949: return 'CP949'; break; // ANSI Korean (Wansung) - case 950: return 'CP950'; break; // ANSI Chinese Traditional BIG5 - case 1200: return 'UTF-16LE'; break; // UTF-16 (BIFF8) - case 1250: return 'CP1250'; break; // ANSI Latin II (Central European) - case 1251: return 'CP1251'; break; // ANSI Cyrillic - case 0: // CodePage is not always correctly set when the xls file was saved by Apple's Numbers program - case 1252: return 'CP1252'; break; // ANSI Latin I (BIFF4-BIFF7) - case 1253: return 'CP1253'; break; // ANSI Greek - case 1254: return 'CP1254'; break; // ANSI Turkish - case 1255: return 'CP1255'; break; // ANSI Hebrew - case 1256: return 'CP1256'; break; // ANSI Arabic - case 1257: return 'CP1257'; break; // ANSI Baltic - case 1258: return 'CP1258'; break; // ANSI Vietnamese - case 1361: return 'CP1361'; break; // ANSI Korean (Johab) - case 10000: return 'MAC'; break; // Apple Roman - case 32768: return 'MAC'; break; // Apple Roman - case 32769: throw new Exception('Code page 32769 not supported.'); - break; // ANSI Latin I (BIFF2-BIFF3) - case 65001: return 'UTF-8'; break; // Unicode (UTF-8) - } - - throw new Exception('Unknown codepage: ' . $codePage); - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Date.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Date.php deleted file mode 100644 index 16cf6a19ef..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Date.php +++ /dev/null @@ -1,315 +0,0 @@ -<?php - -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_Date - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Date -{ - /** constants */ - const CALENDAR_WINDOWS_1900 = 1900; // Base date of 1st Jan 1900 = 1.0 - const CALENDAR_MAC_1904 = 1904; // Base date of 2nd Jan 1904 = 1.0 - - private static $ExcelBaseDate = self::CALENDAR_WINDOWS_1900; - - public static $dateTimeObjectType = 'DateTime'; - - - /** - * Set the Excel calendar (Windows 1900 or Mac 1904) - * - * @param integer $baseDate Excel base date - * @return boolean Success or failure - */ - public static function setExcelCalendar($baseDate) { - if (($baseDate == self::CALENDAR_WINDOWS_1900) || - ($baseDate == self::CALENDAR_MAC_1904)) { - self::$ExcelBaseDate = $baseDate; - return True; - } - return False; - } // function setExcelCalendar() - - - /** - * Return the Excel calendar (Windows 1900 or Mac 1904) - * - * @return integer $baseDate Excel base date - */ - public static function getExcelCalendar() { - return self::$ExcelBaseDate; - } // function getExcelCalendar() - - - /** - * Convert a date from Excel to PHP - * - * @param long $dateValue Excel date/time value - * @return long PHP serialized date/time - */ - public static function ExcelToPHP($dateValue = 0) { - if (self::$ExcelBaseDate == self::CALENDAR_WINDOWS_1900) { - $myExcelBaseDate = 25569; - // Adjust for the spurious 29-Feb-1900 (Day 60) - if ($dateValue < 60) { - --$myExcelBaseDate; - } - } else { - $myExcelBaseDate = 24107; - } - - // Perform conversion - if ($dateValue >= 1) { - $utcDays = $dateValue - $myExcelBaseDate; - $returnValue = round($utcDays * 24 * 60 * 60); - if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) { - $returnValue = (integer) $returnValue; - } - } else { - $hours = round($dateValue * 24); - $mins = round($dateValue * 24 * 60) - round($hours * 60); - $secs = round($dateValue * 24 * 60 * 60) - round($hours * 60 * 60) - round($mins * 60); - $returnValue = (integer) gmmktime($hours, $mins, $secs); - } - - // Return - return $returnValue; - } // function ExcelToPHP() - - - /** - * Convert a date from Excel to a PHP Date/Time object - * - * @param long $dateValue Excel date/time value - * @return long PHP date/time object - */ - public static function ExcelToPHPObject($dateValue = 0) { - $dateTime = self::ExcelToPHP($dateValue); - $days = floor($dateTime / 86400); - $time = round((($dateTime / 86400) - $days) * 86400); - $hours = round($time / 3600); - $minutes = round($time / 60) - ($hours * 60); - $seconds = round($time) - ($hours * 3600) - ($minutes * 60); - - $dateObj = date_create('1-Jan-1970+'.$days.' days'); - $dateObj->setTime($hours,$minutes,$seconds); - - return $dateObj; - } // function ExcelToPHPObject() - - - /** - * Convert a date from PHP to Excel - * - * @param mixed $dateValue PHP serialized date/time or date object - * @return mixed Excel date/time value - * or boolean False on failure - */ - public static function PHPToExcel($dateValue = 0) { - $saveTimeZone = date_default_timezone_get(); - date_default_timezone_set('UTC'); - $retValue = False; - if ((is_object($dateValue)) && ($dateValue instanceof self::$dateTimeObjectType)) { - $retValue = self::FormattedPHPToExcel( $dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), - $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s') - ); - } elseif (is_numeric($dateValue)) { - $retValue = self::FormattedPHPToExcel( date('Y',$dateValue), date('m',$dateValue), date('d',$dateValue), - date('H',$dateValue), date('i',$dateValue), date('s',$dateValue) - ); - } - date_default_timezone_set($saveTimeZone); - - return $retValue; - } // function PHPToExcel() - - - /** - * FormattedPHPToExcel - * - * @param long $year - * @param long $month - * @param long $day - * @param long $hours - * @param long $minutes - * @param long $seconds - * @return long Excel date/time value - */ - public static function FormattedPHPToExcel($year, $month, $day, $hours=0, $minutes=0, $seconds=0) { - if (self::$ExcelBaseDate == self::CALENDAR_WINDOWS_1900) { - // - // Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel - // This affects every date following 28th February 1900 - // - $excel1900isLeapYear = True; - if (($year == 1900) && ($month <= 2)) { $excel1900isLeapYear = False; } - $myExcelBaseDate = 2415020; - } else { - $myExcelBaseDate = 2416481; - $excel1900isLeapYear = False; - } - - // Julian base date Adjustment - if ($month > 2) { - $month = $month - 3; - } else { - $month = $month + 9; - --$year; - } - - // Calculate the Julian Date, then subtract the Excel base date (JD 2415020 = 31-Dec-1899 Giving Excel Date of 0) - $century = substr($year,0,2); - $decade = substr($year,2,2); - $excelDate = floor((146097 * $century) / 4) + floor((1461 * $decade) / 4) + floor((153 * $month + 2) / 5) + $day + 1721119 - $myExcelBaseDate + $excel1900isLeapYear; - - $excelTime = (($hours * 3600) + ($minutes * 60) + $seconds) / 86400; - - return (float) $excelDate + $excelTime; - } // function FormattedPHPToExcel() - - - /** - * Is a given cell a date/time? - * - * @param PHPExcel_Cell $pCell - * @return boolean - */ - public static function isDateTime(PHPExcel_Cell $pCell) { - return self::isDateTimeFormat($pCell->getParent()->getStyle($pCell->getCoordinate())->getNumberFormat()); - } // function isDateTime() - - - /** - * Is a given number format a date/time? - * - * @param PHPExcel_Style_NumberFormat $pFormat - * @return boolean - */ - public static function isDateTimeFormat(PHPExcel_Style_NumberFormat $pFormat) { - return self::isDateTimeFormatCode($pFormat->getFormatCode()); - } // function isDateTimeFormat() - - - private static $possibleDateFormatCharacters = 'ymdHs'; - - /** - * Is a given number format code a date/time? - * - * @param string $pFormatCode - * @return boolean - */ - public static function isDateTimeFormatCode($pFormatCode = '') { - // Switch on formatcode - switch ($pFormatCode) { - case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYSLASH: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYMINUS: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMMINUS: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_MYMINUS: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME1: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME2: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME5: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME6: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME7: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME8: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX14: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX16: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX17: - case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22: - return true; - } - - // Typically number, currency or accounting (or occasionally fraction) formats - if ((substr($pFormatCode,0,1) == '_') || (substr($pFormatCode,0,2) == '0 ')) { - return false; - } - // Try checking for any of the date formatting characters that don't appear within square braces - if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i',$pFormatCode)) { - // We might also have a format mask containing quoted strings... - // we don't want to test for any of our characters within the quoted blocks - if (strpos($pFormatCode,'"') !== false) { - $i = false; - foreach(explode('"',$pFormatCode) as $subVal) { - // Only test in alternate array entries (the non-quoted blocks) - if (($i = !$i) && (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i',$subVal))) { - return true; - } - } - return false; - } - return true; - } - - // No date... - return false; - } // function isDateTimeFormatCode() - - - /** - * Convert a date/time string to Excel time - * - * @param string $dateValue Examples: '2009-12-31', '2009-12-31 15:59', '2009-12-31 15:59:10' - * @return float|false Excel date/time serial value - */ - public static function stringToExcel($dateValue = '') { - if (strlen($dateValue) < 2) - return false; - if (!preg_match('/^(\d{1,4}[ \.\/\-][A-Z]{3,9}([ \.\/\-]\d{1,4})?|[A-Z]{3,9}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?|\d{1,4}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?)( \d{1,2}:\d{1,2}(:\d{1,2})?)?$/iu', $dateValue)) - return false; - - $dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue); - - if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) { - return false; - } else { - if (strpos($dateValue, ':') !== false) { - $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($dateValue); - if ($timeValue === PHPExcel_Calculation_Functions::VALUE()) { - return false; - } - $dateValueNew += $timeValue; - } - return $dateValueNew; - } - - - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Drawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Drawing.php deleted file mode 100644 index 3367f272b6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Drawing.php +++ /dev/null @@ -1,272 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_Drawing - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Drawing -{ - /** - * Convert pixels to EMU - * - * @param int $pValue Value in pixels - * @return int Value in EMU - */ - public static function pixelsToEMU($pValue = 0) { - return round($pValue * 9525); - } - - /** - * Convert EMU to pixels - * - * @param int $pValue Value in EMU - * @return int Value in pixels - */ - public static function EMUToPixels($pValue = 0) { - if ($pValue != 0) { - return round($pValue / 9525); - } else { - return 0; - } - } - - /** - * Convert pixels to column width. Exact algorithm not known. - * By inspection of a real Excel file using Calibri 11, one finds 1000px ~ 142.85546875 - * This gives a conversion factor of 7. Also, we assume that pixels and font size are proportional. - * - * @param int $pValue Value in pixels - * @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook - * @return int Value in cell dimension - */ - public static function pixelsToCellDimension($pValue = 0, PHPExcel_Style_Font $pDefaultFont) { - // Font name and size - $name = $pDefaultFont->getName(); - $size = $pDefaultFont->getSize(); - - if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { - // Exact width can be determined - $colWidth = $pValue - * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width'] - / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px']; - } else { - // We don't have data for this particular font and size, use approximation by - // extrapolating from Calibri 11 - $colWidth = $pValue * 11 - * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] - / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / $size; - } - - return $colWidth; - } - - /** - * Convert column width from (intrinsic) Excel units to pixels - * - * @param float $pValue Value in cell dimension - * @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook - * @return int Value in pixels - */ - public static function cellDimensionToPixels($pValue = 0, PHPExcel_Style_Font $pDefaultFont) { - // Font name and size - $name = $pDefaultFont->getName(); - $size = $pDefaultFont->getSize(); - - if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) { - // Exact width can be determined - $colWidth = $pValue - * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px'] - / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width']; - - } else { - // We don't have data for this particular font and size, use approximation by - // extrapolating from Calibri 11 - $colWidth = $pValue * $size - * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] - / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / 11; - } - - // Round pixels to closest integer - $colWidth = (int) round($colWidth); - - return $colWidth; - } - - /** - * Convert pixels to points - * - * @param int $pValue Value in pixels - * @return int Value in points - */ - public static function pixelsToPoints($pValue = 0) { - return $pValue * 0.67777777; - } - - /** - * Convert points to pixels - * - * @param int $pValue Value in points - * @return int Value in pixels - */ - public static function pointsToPixels($pValue = 0) { - if ($pValue != 0) { - return (int) ceil($pValue * 1.333333333); - } else { - return 0; - } - } - - /** - * Convert degrees to angle - * - * @param int $pValue Degrees - * @return int Angle - */ - public static function degreesToAngle($pValue = 0) { - return (int)round($pValue * 60000); - } - - /** - * Convert angle to degrees - * - * @param int $pValue Angle - * @return int Degrees - */ - public static function angleToDegrees($pValue = 0) { - if ($pValue != 0) { - return round($pValue / 60000); - } else { - return 0; - } - } - - /** - * Create a new image from file. By alexander at alexauto dot nl - * - * @link http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214 - * @param string $filename Path to Windows DIB (BMP) image - * @return resource - */ - public static function imagecreatefrombmp($p_sFile) - { - // Load the image into a string - $file = fopen($p_sFile,"rb"); - $read = fread($file,10); - while(!feof($file)&&($read<>"")) - $read .= fread($file,1024); - - $temp = unpack("H*",$read); - $hex = $temp[1]; - $header = substr($hex,0,108); - - // Process the header - // Structure: http://www.fastgraph.com/help/bmp_header_format.html - if (substr($header,0,4)=="424d") - { - // Cut it in parts of 2 bytes - $header_parts = str_split($header,2); - - // Get the width 4 bytes - $width = hexdec($header_parts[19].$header_parts[18]); - - // Get the height 4 bytes - $height = hexdec($header_parts[23].$header_parts[22]); - - // Unset the header params - unset($header_parts); - } - - // Define starting X and Y - $x = 0; - $y = 1; - - // Create newimage - $image = imagecreatetruecolor($width,$height); - - // Grab the body from the image - $body = substr($hex,108); - - // Calculate if padding at the end-line is needed - // Divided by two to keep overview. - // 1 byte = 2 HEX-chars - $body_size = (strlen($body)/2); - $header_size = ($width*$height); - - // Use end-line padding? Only when needed - $usePadding = ($body_size>($header_size*3)+4); - - // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption - // Calculate the next DWORD-position in the body - for ($i=0;$i<$body_size;$i+=3) - { - // Calculate line-ending and padding - if ($x>=$width) - { - // If padding needed, ignore image-padding - // Shift i to the ending of the current 32-bit-block - if ($usePadding) - $i += $width%4; - - // Reset horizontal position - $x = 0; - - // Raise the height-position (bottom-up) - $y++; - - // Reached the image-height? Break the for-loop - if ($y>$height) - break; - } - - // Calculation of the RGB-pixel (defined as BGR in image-data) - // Define $i_pos as absolute position in the body - $i_pos = $i*2; - $r = hexdec($body[$i_pos+4].$body[$i_pos+5]); - $g = hexdec($body[$i_pos+2].$body[$i_pos+3]); - $b = hexdec($body[$i_pos].$body[$i_pos+1]); - - // Calculate and draw the pixel - $color = imagecolorallocate($image,$r,$g,$b); - imagesetpixel($image,$x,$height-$y,$color); - - // Raise the horizontal position - $x++; - } - - // Unset the body / free the memory - unset($body); - - // Return image-object - return $image; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher.php deleted file mode 100644 index 5547096071..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher -{ - /** - * Drawing Group Container - * - * @var PHPExcel_Shared_Escher_DggContainer - */ - private $_dggContainer; - - /** - * Drawing Container - * - * @var PHPExcel_Shared_Escher_DgContainer - */ - private $_dgContainer; - - /** - * Get Drawing Group Container - * - * @return PHPExcel_Shared_Escher_DgContainer - */ - public function getDggContainer() - { - return $this->_dggContainer; - } - - /** - * Set Drawing Group Container - * - * @param PHPExcel_Shared_Escher_DggContainer $dggContainer - */ - public function setDggContainer($dggContainer) - { - return $this->_dggContainer = $dggContainer; - } - - /** - * Get Drawing Container - * - * @return PHPExcel_Shared_Escher_DgContainer - */ - public function getDgContainer() - { - return $this->_dgContainer; - } - - /** - * Set Drawing Container - * - * @param PHPExcel_Shared_Escher_DgContainer $dgContainer - */ - public function setDgContainer($dgContainer) - { - return $this->_dgContainer = $dgContainer; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer.php deleted file mode 100644 index 7e17e464a3..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DgContainer - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DgContainer -{ - /** - * Drawing index, 1-based. - * - * @var int - */ - private $_dgId; - - /** - * Last shape index in this drawing - * - * @var int - */ - private $_lastSpId; - - private $_spgrContainer = null; - - public function getDgId() - { - return $this->_dgId; - } - - public function setDgId($value) - { - $this->_dgId = $value; - } - - public function getLastSpId() - { - return $this->_lastSpId; - } - - public function setLastSpId($value) - { - $this->_lastSpId = $value; - } - - public function getSpgrContainer() - { - return $this->_spgrContainer; - } - - public function setSpgrContainer($spgrContainer) - { - return $this->_spgrContainer = $spgrContainer; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php deleted file mode 100644 index c11d765712..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php +++ /dev/null @@ -1,109 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DgContainer_SpgrContainer - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DgContainer_SpgrContainer -{ - /** - * Parent Shape Group Container - * - * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer - */ - private $_parent; - - /** - * Shape Container collection - * - * @var array - */ - private $_children = array(); - - /** - * Set parent Shape Group Container - * - * @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent - */ - public function setParent($parent) - { - $this->_parent = $parent; - } - - /** - * Get the parent Shape Group Container if any - * - * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer|null - */ - public function getParent() - { - return $this->_parent; - } - - /** - * Add a child. This will be either spgrContainer or spContainer - * - * @param mixed $child - */ - public function addChild($child) - { - $this->_children[] = $child; - $child->setParent($this); - } - - /** - * Get collection of Shape Containers - */ - public function getChildren() - { - return $this->_children; - } - - /** - * Recursively get all spContainers within this spgrContainer - * - * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer[] - */ - public function getAllSpContainers() - { - $allSpContainers = array(); - - foreach ($this->_children as $child) { - if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { - $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers()); - } else { - $allSpContainers[] = $child; - } - } - - return $allSpContainers; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php deleted file mode 100644 index a3bd3cd65b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php +++ /dev/null @@ -1,368 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer -{ - /** - * Parent Shape Group Container - * - * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer - */ - private $_parent; - - /** - * Is this a group shape? - * - * @var boolean - */ - private $_spgr = false; - - /** - * Shape type - * - * @var int - */ - private $_spType; - - /** - * Shape index (usually group shape has index 0, and the rest: 1,2,3...) - * - * @var boolean - */ - private $_spId; - - /** - * Array of options - * - * @var array - */ - private $_OPT; - - /** - * Cell coordinates of upper-left corner of shape, e.g. 'A1' - * - * @var string - */ - private $_startCoordinates; - - /** - * Horizontal offset of upper-left corner of shape measured in 1/1024 of column width - * - * @var int - */ - private $_startOffsetX; - - /** - * Vertical offset of upper-left corner of shape measured in 1/256 of row height - * - * @var int - */ - private $_startOffsetY; - - /** - * Cell coordinates of bottom-right corner of shape, e.g. 'B2' - * - * @var string - */ - private $_endCoordinates; - - /** - * Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width - * - * @var int - */ - private $_endOffsetX; - - /** - * Vertical offset of bottom-right corner of shape measured in 1/256 of row height - * - * @var int - */ - private $_endOffsetY; - - /** - * Set parent Shape Group Container - * - * @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent - */ - public function setParent($parent) - { - $this->_parent = $parent; - } - - /** - * Get the parent Shape Group Container - * - * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer - */ - public function getParent() - { - return $this->_parent; - } - - /** - * Set whether this is a group shape - * - * @param boolean $value - */ - public function setSpgr($value = false) - { - $this->_spgr = $value; - } - - /** - * Get whether this is a group shape - * - * @return boolean - */ - public function getSpgr() - { - return $this->_spgr; - } - - /** - * Set the shape type - * - * @param int $value - */ - public function setSpType($value) - { - $this->_spType = $value; - } - - /** - * Get the shape type - * - * @return int - */ - public function getSpType() - { - return $this->_spType; - } - - /** - * Set the shape index - * - * @param int $value - */ - public function setSpId($value) - { - $this->_spId = $value; - } - - /** - * Get the shape index - * - * @return int - */ - public function getSpId() - { - return $this->_spId; - } - - /** - * Set an option for the Shape Group Container - * - * @param int $property The number specifies the option - * @param mixed $value - */ - public function setOPT($property, $value) - { - $this->_OPT[$property] = $value; - } - - /** - * Get an option for the Shape Group Container - * - * @param int $property The number specifies the option - * @return mixed - */ - public function getOPT($property) - { - if (isset($this->_OPT[$property])) { - return $this->_OPT[$property]; - } - return null; - } - - /** - * Get the collection of options - * - * @return array - */ - public function getOPTCollection() - { - return $this->_OPT; - } - - /** - * Set cell coordinates of upper-left corner of shape - * - * @param string $value - */ - public function setStartCoordinates($value = 'A1') - { - $this->_startCoordinates = $value; - } - - /** - * Get cell coordinates of upper-left corner of shape - * - * @return string - */ - public function getStartCoordinates() - { - return $this->_startCoordinates; - } - - /** - * Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width - * - * @param int $startOffsetX - */ - public function setStartOffsetX($startOffsetX = 0) - { - $this->_startOffsetX = $startOffsetX; - } - - /** - * Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width - * - * @return int - */ - public function getStartOffsetX() - { - return $this->_startOffsetX; - } - - /** - * Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height - * - * @param int $startOffsetY - */ - public function setStartOffsetY($startOffsetY = 0) - { - $this->_startOffsetY = $startOffsetY; - } - - /** - * Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height - * - * @return int - */ - public function getStartOffsetY() - { - return $this->_startOffsetY; - } - - /** - * Set cell coordinates of bottom-right corner of shape - * - * @param string $value - */ - public function setEndCoordinates($value = 'A1') - { - $this->_endCoordinates = $value; - } - - /** - * Get cell coordinates of bottom-right corner of shape - * - * @return string - */ - public function getEndCoordinates() - { - return $this->_endCoordinates; - } - - /** - * Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width - * - * @param int $startOffsetX - */ - public function setEndOffsetX($endOffsetX = 0) - { - $this->_endOffsetX = $endOffsetX; - } - - /** - * Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width - * - * @return int - */ - public function getEndOffsetX() - { - return $this->_endOffsetX; - } - - /** - * Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height - * - * @param int $endOffsetY - */ - public function setEndOffsetY($endOffsetY = 0) - { - $this->_endOffsetY = $endOffsetY; - } - - /** - * Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height - * - * @return int - */ - public function getEndOffsetY() - { - return $this->_endOffsetY; - } - - /** - * Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and - * the dgContainer. A value of 1 = immediately within first spgrContainer - * Higher nesting level occurs if and only if spContainer is part of a shape group - * - * @return int Nesting level - */ - public function getNestingLevel() - { - $nestingLevel = 0; - - $parent = $this->getParent(); - while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) { - ++$nestingLevel; - $parent = $parent->getParent(); - } - - return $nestingLevel; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer.php deleted file mode 100644 index 39b57d0207..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer.php +++ /dev/null @@ -1,203 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DggContainer - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DggContainer -{ - /** - * Maximum shape index of all shapes in all drawings increased by one - * - * @var int - */ - private $_spIdMax; - - /** - * Total number of drawings saved - * - * @var int - */ - private $_cDgSaved; - - /** - * Total number of shapes saved (including group shapes) - * - * @var int - */ - private $_cSpSaved; - - /** - * BLIP Store Container - * - * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer - */ - private $_bstoreContainer; - - /** - * Array of options for the drawing group - * - * @var array - */ - private $_OPT = array(); - - /** - * Array of identifier clusters containg information about the maximum shape identifiers - * - * @var array - */ - private $_IDCLs = array(); - - /** - * Get maximum shape index of all shapes in all drawings (plus one) - * - * @return int - */ - public function getSpIdMax() - { - return $this->_spIdMax; - } - - /** - * Set maximum shape index of all shapes in all drawings (plus one) - * - * @param int - */ - public function setSpIdMax($value) - { - $this->_spIdMax = $value; - } - - /** - * Get total number of drawings saved - * - * @return int - */ - public function getCDgSaved() - { - return $this->_cDgSaved; - } - - /** - * Set total number of drawings saved - * - * @param int - */ - public function setCDgSaved($value) - { - $this->_cDgSaved = $value; - } - - /** - * Get total number of shapes saved (including group shapes) - * - * @return int - */ - public function getCSpSaved() - { - return $this->_cSpSaved; - } - - /** - * Set total number of shapes saved (including group shapes) - * - * @param int - */ - public function setCSpSaved($value) - { - $this->_cSpSaved = $value; - } - - /** - * Get BLIP Store Container - * - * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer - */ - public function getBstoreContainer() - { - return $this->_bstoreContainer; - } - - /** - * Set BLIP Store Container - * - * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $bstoreContainer - */ - public function setBstoreContainer($bstoreContainer) - { - $this->_bstoreContainer = $bstoreContainer; - } - - /** - * Set an option for the drawing group - * - * @param int $property The number specifies the option - * @param mixed $value - */ - public function setOPT($property, $value) - { - $this->_OPT[$property] = $value; - } - - /** - * Get an option for the drawing group - * - * @param int $property The number specifies the option - * @return mixed - */ - public function getOPT($property) - { - if (isset($this->_OPT[$property])) { - return $this->_OPT[$property]; - } - return null; - } - - /** - * Get identifier clusters - * - * @return array - */ - public function getIDCLs() - { - return $this->_IDCLs; - } - - /** - * Set identifier clusters. array(<drawingId> => <max shape id>, ...) - * - * @param array $pValue - */ - public function setIDCLs($pValue) - { - $this->_IDCLs = $pValue; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php deleted file mode 100644 index 8ac8f556ab..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DggContainer_BstoreContainer - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DggContainer_BstoreContainer -{ - /** - * BLIP Store Entries. Each of them holds one BLIP (Big Large Image or Picture) - * - * @var array - */ - private $_BSECollection = array(); - - /** - * Add a BLIP Store Entry - * - * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $BSE - */ - public function addBSE($BSE) - { - $this->_BSECollection[] = $BSE; - $BSE->setParent($this); - } - - /** - * Get the collection of BLIP Store Entries - * - * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE[] - */ - public function getBSECollection() - { - return $this->_BSECollection; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php deleted file mode 100644 index 9b31bb5e2e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE -{ - const BLIPTYPE_ERROR = 0x00; - const BLIPTYPE_UNKNOWN = 0x01; - const BLIPTYPE_EMF = 0x02; - const BLIPTYPE_WMF = 0x03; - const BLIPTYPE_PICT = 0x04; - const BLIPTYPE_JPEG = 0x05; - const BLIPTYPE_PNG = 0x06; - const BLIPTYPE_DIB = 0x07; - const BLIPTYPE_TIFF = 0x11; - const BLIPTYPE_CMYKJPEG = 0x12; - - /** - * The parent BLIP Store Entry Container - * - * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer - */ - private $_parent; - - /** - * The BLIP (Big Large Image or Picture) - * - * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip - */ - private $_blip; - - /** - * The BLIP type - * - * @var int - */ - private $_blipType; - - /** - * Set parent BLIP Store Entry Container - * - * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer $parent - */ - public function setParent($parent) - { - $this->_parent = $parent; - } - - /** - * Get the BLIP - * - * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip - */ - public function getBlip() - { - return $this->_blip; - } - - /** - * Set the BLIP - * - * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip $blip - */ - public function setBlip($blip) - { - $this->_blip = $blip; - $blip->setParent($this); - } - - /** - * Get the BLIP type - * - * @return int - */ - public function getBlipType() - { - return $this->_blipType; - } - - /** - * Set the BLIP type - * - * @param int - */ - public function setBlipType($blipType) - { - $this->_blipType = $blipType; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php deleted file mode 100644 index 4a6d4e4c4f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip - * - * @category PHPExcel - * @package PHPExcel_Shared_Escher - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip -{ - /** - * The parent BSE - * - * @var PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE - */ - private $_parent; - - /** - * Raw image data - * - * @var string - */ - private $_data; - - /** - * Get the raw image data - * - * @return string - */ - public function getData() - { - return $this->_data; - } - - /** - * Set the raw image data - * - * @param string - */ - public function setData($data) - { - $this->_data = $data; - } - - /** - * Set parent BSE - * - * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent - */ - public function setParent($parent) - { - $this->_parent = $parent; - } - - /** - * Get parent BSE - * - * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent - */ - public function getParent() - { - return $this->_parent; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Excel5.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Excel5.php deleted file mode 100644 index f6bced5034..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Excel5.php +++ /dev/null @@ -1,317 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_Excel5 - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Excel5 -{ - /** - * Get the width of a column in pixels. We use the relationship y = ceil(7x) where - * x is the width in intrinsic Excel units (measuring width in number of normal characters) - * This holds for Arial 10 - * - * @param PHPExcel_Worksheet $sheet The sheet - * @param integer $col The column - * @return integer The width in pixels - */ - public static function sizeCol($sheet, $col = 'A') - { - // default font of the workbook - $font = $sheet->getParent()->getDefaultStyle()->getFont(); - - $columnDimensions = $sheet->getColumnDimensions(); - - // first find the true column width in pixels (uncollapsed and unhidden) - if ( isset($columnDimensions[$col]) and $columnDimensions[$col]->getWidth() != -1 ) { - - // then we have column dimension with explicit width - $columnDimension = $columnDimensions[$col]; - $width = $columnDimension->getWidth(); - $pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); - - } else if ($sheet->getDefaultColumnDimension()->getWidth() != -1) { - - // then we have default column dimension with explicit width - $defaultColumnDimension = $sheet->getDefaultColumnDimension(); - $width = $defaultColumnDimension->getWidth(); - $pixelWidth = PHPExcel_Shared_Drawing::cellDimensionToPixels($width, $font); - - } else { - - // we don't even have any default column dimension. Width depends on default font - $pixelWidth = PHPExcel_Shared_Font::getDefaultColumnWidthByFont($font, true); - } - - // now find the effective column width in pixels - if (isset($columnDimensions[$col]) and !$columnDimensions[$col]->getVisible()) { - $effectivePixelWidth = 0; - } else { - $effectivePixelWidth = $pixelWidth; - } - - return $effectivePixelWidth; - } - - /** - * Convert the height of a cell from user's units to pixels. By interpolation - * the relationship is: y = 4/3x. If the height hasn't been set by the user we - * use the default value. If the row is hidden we use a value of zero. - * - * @param PHPExcel_Worksheet $sheet The sheet - * @param integer $row The row index (1-based) - * @return integer The width in pixels - */ - public static function sizeRow($sheet, $row = 1) - { - // default font of the workbook - $font = $sheet->getParent()->getDefaultStyle()->getFont(); - - $rowDimensions = $sheet->getRowDimensions(); - - // first find the true row height in pixels (uncollapsed and unhidden) - if ( isset($rowDimensions[$row]) and $rowDimensions[$row]->getRowHeight() != -1) { - - // then we have a row dimension - $rowDimension = $rowDimensions[$row]; - $rowHeight = $rowDimension->getRowHeight(); - $pixelRowHeight = (int) ceil(4 * $rowHeight / 3); // here we assume Arial 10 - - } else if ($sheet->getDefaultRowDimension()->getRowHeight() != -1) { - - // then we have a default row dimension with explicit height - $defaultRowDimension = $sheet->getDefaultRowDimension(); - $rowHeight = $defaultRowDimension->getRowHeight(); - $pixelRowHeight = PHPExcel_Shared_Drawing::pointsToPixels($rowHeight); - - } else { - - // we don't even have any default row dimension. Height depends on default font - $pointRowHeight = PHPExcel_Shared_Font::getDefaultRowHeightByFont($font); - $pixelRowHeight = PHPExcel_Shared_Font::fontSizeToPixels($pointRowHeight); - - } - - // now find the effective row height in pixels - if ( isset($rowDimensions[$row]) and !$rowDimensions[$row]->getVisible() ) { - $effectivePixelRowHeight = 0; - } else { - $effectivePixelRowHeight = $pixelRowHeight; - } - - return $effectivePixelRowHeight; - } - - /** - * Get the horizontal distance in pixels between two anchors - * The distanceX is found as sum of all the spanning columns widths minus correction for the two offsets - * - * @param PHPExcel_Worksheet $sheet - * @param string $startColumn - * @param integer $startOffset Offset within start cell measured in 1/1024 of the cell width - * @param string $endColumn - * @param integer $endOffset Offset within end cell measured in 1/1024 of the cell width - * @return integer Horizontal measured in pixels - */ - public static function getDistanceX(PHPExcel_Worksheet $sheet, $startColumn = 'A', $startOffsetX = 0, $endColumn = 'A', $endOffsetX = 0) - { - $distanceX = 0; - - // add the widths of the spanning columns - $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1; // 1-based - $endColumnIndex = PHPExcel_Cell::columnIndexFromString($endColumn) - 1; // 1-based - for ($i = $startColumnIndex; $i <= $endColumnIndex; ++$i) { - $distanceX += self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($i)); - } - - // correct for offsetX in startcell - $distanceX -= (int) floor(self::sizeCol($sheet, $startColumn) * $startOffsetX / 1024); - - // correct for offsetX in endcell - $distanceX -= (int) floor(self::sizeCol($sheet, $endColumn) * (1 - $endOffsetX / 1024)); - - return $distanceX; - } - - /** - * Get the vertical distance in pixels between two anchors - * The distanceY is found as sum of all the spanning rows minus two offsets - * - * @param PHPExcel_Worksheet $sheet - * @param string $startRow (1-based) - * @param integer $startOffset Offset within start cell measured in 1/256 of the cell height - * @param string $endRow (1-based) - * @param integer $endOffset Offset within end cell measured in 1/256 of the cell height - * @return integer Vertical distance measured in pixels - */ - public static function getDistanceY(PHPExcel_Worksheet $sheet, $startRow = 1, $startOffsetY = 0, $endRow = 1, $endOffsetY = 0) - { - $distanceY = 0; - - // add the widths of the spanning rows - for ($row = $startRow; $row <= $endRow; ++$row) { - $distanceY += self::sizeRow($sheet, $row); - } - - // correct for offsetX in startcell - $distanceY -= (int) floor(self::sizeRow($sheet, $startRow) * $startOffsetY / 256); - - // correct for offsetX in endcell - $distanceY -= (int) floor(self::sizeRow($sheet, $endRow) * (1 - $endOffsetY / 256)); - - return $distanceY; - } - - /** - * Convert 1-cell anchor coordinates to 2-cell anchor coordinates - * This function is ported from PEAR Spreadsheet_Writer_Excel with small modifications - * - * Calculate the vertices that define the position of the image as required by - * the OBJ record. - * - * +------------+------------+ - * | A | B | - * +-----+------------+------------+ - * | |(x1,y1) | | - * | 1 |(A1)._______|______ | - * | | | | | - * | | | | | - * +-----+----| BITMAP |-----+ - * | | | | | - * | 2 | |______________. | - * | | | (B2)| - * | | | (x2,y2)| - * +---- +------------+------------+ - * - * Example of a bitmap that covers some of the area from cell A1 to cell B2. - * - * Based on the width and height of the bitmap we need to calculate 8 vars: - * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. - * The width and height of the cells are also variable and have to be taken into - * account. - * The values of $col_start and $row_start are passed in from the calling - * function. The values of $col_end and $row_end are calculated by subtracting - * the width and height of the bitmap from the width and height of the - * underlying cells. - * The vertices are expressed as a percentage of the underlying cell width as - * follows (rhs values are in pixels): - * - * x1 = X / W *1024 - * y1 = Y / H *256 - * x2 = (X-1) / W *1024 - * y2 = (Y-1) / H *256 - * - * Where: X is distance from the left side of the underlying cell - * Y is distance from the top of the underlying cell - * W is the width of the cell - * H is the height of the cell - * - * @param PHPExcel_Worksheet $sheet - * @param string $coordinates E.g. 'A1' - * @param integer $offsetX Horizontal offset in pixels - * @param integer $offsetY Vertical offset in pixels - * @param integer $width Width in pixels - * @param integer $height Height in pixels - * @return array - */ - public static function oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height) - { - list($column, $row) = PHPExcel_Cell::coordinateFromString($coordinates); - $col_start = PHPExcel_Cell::columnIndexFromString($column) - 1; - $row_start = $row - 1; - - $x1 = $offsetX; - $y1 = $offsetY; - - // Initialise end cell to the same as the start cell - $col_end = $col_start; // Col containing lower right corner of object - $row_end = $row_start; // Row containing bottom right corner of object - - // Zero the specified offset if greater than the cell dimensions - if ($x1 >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start))) { - $x1 = 0; - } - if ($y1 >= self::sizeRow($sheet, $row_start + 1)) { - $y1 = 0; - } - - $width = $width + $x1 -1; - $height = $height + $y1 -1; - - // Subtract the underlying cell widths to find the end cell of the image - while ($width >= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end))) { - $width -= self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)); - ++$col_end; - } - - // Subtract the underlying cell heights to find the end cell of the image - while ($height >= self::sizeRow($sheet, $row_end + 1)) { - $height -= self::sizeRow($sheet, $row_end + 1); - ++$row_end; - } - - // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell - // with zero height or width. - if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) == 0) { - return; - } - if (self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) == 0) { - return; - } - if (self::sizeRow($sheet, $row_start + 1) == 0) { - return; - } - if (self::sizeRow($sheet, $row_end + 1) == 0) { - return; - } - - // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) * 1024; - $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; - $x2 = ($width + 1) / self::sizeCol($sheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object - $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object - - $startCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_start) . ($row_start + 1); - $endCoordinates = PHPExcel_Cell::stringFromColumnIndex($col_end) . ($row_end + 1); - - $twoAnchor = array( - 'startCoordinates' => $startCoordinates, - 'startOffsetX' => $x1, - 'startOffsetY' => $y1, - 'endCoordinates' => $endCoordinates, - 'endOffsetX' => $x2, - 'endOffsetY' => $y2, - ); - - return $twoAnchor; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/File.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/File.php deleted file mode 100644 index 75532f6c78..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/File.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_File - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_File -{ - /** - * Verify if a file exists - * - * @param string $pFilename Filename - * @return bool - */ - public static function file_exists($pFilename) { - // Sick construction, but it seems that - // file_exists returns strange values when - // doing the original file_exists on ZIP archives... - if ( strtolower(substr($pFilename, 0, 3)) == 'zip' ) { - // Open ZIP file and verify if the file exists - $zipFile = substr($pFilename, 6, strpos($pFilename, '#') - 6); - $archiveFile = substr($pFilename, strpos($pFilename, '#') + 1); - - $zip = new ZipArchive(); - if ($zip->open($zipFile) === true) { - $returnValue = ($zip->getFromName($archiveFile) !== false); - $zip->close(); - return $returnValue; - } else { - return false; - } - } else { - // Regular file_exists - return file_exists($pFilename); - } - } - - /** - * Returns canonicalized absolute pathname, also for ZIP archives - * - * @param string $pFilename - * @return string - */ - public static function realpath($pFilename) { - // Returnvalue - $returnValue = ''; - - // Try using realpath() - if (file_exists($pFilename)) { - $returnValue = realpath($pFilename); - } - - // Found something? - if ($returnValue == '' || is_null($returnValue)) { - $pathArray = explode('/' , $pFilename); - while(in_array('..', $pathArray) && $pathArray[0] != '..') { - for ($i = 0; $i < count($pathArray); ++$i) { - if ($pathArray[$i] == '..' && $i > 0) { - unset($pathArray[$i]); - unset($pathArray[$i - 1]); - break; - } - } - } - $returnValue = implode('/', $pathArray); - } - - // Return - return $returnValue; - } - - /** - * Get the systems temporary directory. - * - * @return string - */ - public static function sys_get_temp_dir() - { - // sys_get_temp_dir is only available since PHP 5.2.1 - // http://php.net/manual/en/function.sys-get-temp-dir.php#94119 - - if ( !function_exists('sys_get_temp_dir')) { - if ($temp = getenv('TMP') ) { - if (file_exists($temp)) { return realpath($temp); } - } - if ($temp = getenv('TEMP') ) { - if (file_exists($temp)) { return realpath($temp); } - } - if ($temp = getenv('TMPDIR') ) { - if (file_exists($temp)) { return realpath($temp); } - } - - // trick for creating a file in system's temporary dir - // without knowing the path of the system's temporary dir - $temp = tempnam(__FILE__, ''); - if (file_exists($temp)) { - unlink($temp); - return realpath(dirname($temp)); - } - - return null; - } - - // use ordinary built-in PHP function - // There should be no problem with the 5.2.4 Suhosin realpath() bug, because this line should only - // be called if we're running 5.2.1 or earlier - return realpath(sys_get_temp_dir()); - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Font.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Font.php deleted file mode 100644 index a0535688ac..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/Font.php +++ /dev/null @@ -1,763 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_Font - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_Font -{ - /* Methods for resolving autosize value */ - const AUTOSIZE_METHOD_APPROX = 'approx'; - const AUTOSIZE_METHOD_EXACT = 'exact'; - - /** Character set codes used by BIFF5-8 in Font records */ - const CHARSET_ANSI_LATIN = 0x00; - const CHARSET_SYSTEM_DEFAULT = 0x01; - const CHARSET_SYMBOL = 0x02; - const CHARSET_APPLE_ROMAN = 0x4D; - const CHARSET_ANSI_JAPANESE_SHIFTJIS = 0x80; - const CHARSET_ANSI_KOREAN_HANGUL = 0x81; - const CHARSET_ANSI_KOREAN_JOHAB = 0x82; - const CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86; - const CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88; - const CHARSET_ANSI_GREEK = 0xA1; - const CHARSET_ANSI_TURKISH = 0xA2; - const CHARSET_ANSI_VIETNAMESE = 0xA3; - const CHARSET_ANSI_HEBREW = 0xB1; - const CHARSET_ANSI_ARABIC = 0xB2; - const CHARSET_ANSI_BALTIC = 0xBA; - const CHARSET_ANSI_CYRILLIC = 0xCC; - const CHARSET_ANSI_THAI = 0xDE; - const CHARSET_ANSI_LATIN_II = 0xEE; - const CHARSET_OEM_LATIN_I = 0xFF; - - // XXX: Constants created! - /** Font filenames */ - const ARIAL = 'arial.ttf'; - const ARIAL_BOLD = 'arialbd.ttf'; - const ARIAL_ITALIC = 'ariali.ttf'; - const ARIAL_BOLD_ITALIC = 'arialbi.ttf'; - - const CALIBRI = 'CALIBRI.TTF'; - const CALIBRI_BOLD = 'CALIBRIB.TTF'; - const CALIBRI_ITALIC = 'CALIBRII.TTF'; - const CALIBRI_BOLD_ITALIC = 'CALIBRIZ.TTF'; - - const COMIC_SANS_MS = 'comic.ttf'; - const COMIC_SANS_MS_BOLD = 'comicbd.ttf'; - - const COURIER_NEW = 'cour.ttf'; - const COURIER_NEW_BOLD = 'courbd.ttf'; - const COURIER_NEW_ITALIC = 'couri.ttf'; - const COURIER_NEW_BOLD_ITALIC = 'courbi.ttf'; - - const GEORGIA = 'georgia.ttf'; - const GEORGIA_BOLD = 'georgiab.ttf'; - const GEORGIA_ITALIC = 'georgiai.ttf'; - const GEORGIA_BOLD_ITALIC = 'georgiaz.ttf'; - - const IMPACT = 'impact.ttf'; - - const LIBERATION_SANS = 'LiberationSans-Regular.ttf'; - const LIBERATION_SANS_BOLD = 'LiberationSans-Bold.ttf'; - const LIBERATION_SANS_ITALIC = 'LiberationSans-Italic.ttf'; - const LIBERATION_SANS_BOLD_ITALIC = 'LiberationSans-BoldItalic.ttf'; - - const LUCIDA_CONSOLE = 'lucon.ttf'; - const LUCIDA_SANS_UNICODE = 'l_10646.ttf'; - - const MICROSOFT_SANS_SERIF = 'micross.ttf'; - - const PALATINO_LINOTYPE = 'pala.ttf'; - const PALATINO_LINOTYPE_BOLD = 'palab.ttf'; - const PALATINO_LINOTYPE_ITALIC = 'palai.ttf'; - const PALATINO_LINOTYPE_BOLD_ITALIC = 'palabi.ttf'; - - const SYMBOL = 'symbol.ttf'; - - const TAHOMA = 'tahoma.ttf'; - const TAHOMA_BOLD = 'tahomabd.ttf'; - - const TIMES_NEW_ROMAN = 'times.ttf'; - const TIMES_NEW_ROMAN_BOLD = 'timesbd.ttf'; - const TIMES_NEW_ROMAN_ITALIC = 'timesi.ttf'; - const TIMES_NEW_ROMAN_BOLD_ITALIC = 'timesbi.ttf'; - - const TREBUCHET_MS = 'trebuc.ttf'; - const TREBUCHET_MS_BOLD = 'trebucbd.ttf'; - const TREBUCHET_MS_ITALIC = 'trebucit.ttf'; - const TREBUCHET_MS_BOLD_ITALIC = 'trebucbi.ttf'; - - const VERDANA = 'verdana.ttf'; - const VERDANA_BOLD = 'verdanab.ttf'; - const VERDANA_ITALIC = 'verdanai.ttf'; - const VERDANA_BOLD_ITALIC = 'verdanaz.ttf'; - - /** - * AutoSize method - * - * @var string - */ - private static $autoSizeMethod = self::AUTOSIZE_METHOD_APPROX; - - /** - * Path to folder containing TrueType font .ttf files - * - * @var string - */ - private static $trueTypeFontPath = null; - - /** - * How wide is a default column for a given default font and size? - * Empirical data found by inspecting real Excel files and reading off the pixel width - * in Microsoft Office Excel 2007. - * - * @var array - */ - public static $defaultColumnWidths = array( - 'Arial' => array( - 1 => array('px' => 24, 'width' => 12.00000000), - 2 => array('px' => 24, 'width' => 12.00000000), - 3 => array('px' => 32, 'width' => 10.66406250), - 4 => array('px' => 32, 'width' => 10.66406250), - 5 => array('px' => 40, 'width' => 10.00000000), - 6 => array('px' => 48, 'width' => 9.59765625), - 7 => array('px' => 48, 'width' => 9.59765625), - 8 => array('px' => 56, 'width' => 9.33203125), - 9 => array('px' => 64, 'width' => 9.14062500), - 10 => array('px' => 64, 'width' => 9.14062500), - ), - 'Calibri' => array( - 1 => array('px' => 24, 'width' => 12.00000000), - 2 => array('px' => 24, 'width' => 12.00000000), - 3 => array('px' => 32, 'width' => 10.66406250), - 4 => array('px' => 32, 'width' => 10.66406250), - 5 => array('px' => 40, 'width' => 10.00000000), - 6 => array('px' => 48, 'width' => 9.59765625), - 7 => array('px' => 48, 'width' => 9.59765625), - 8 => array('px' => 56, 'width' => 9.33203125), - 9 => array('px' => 56, 'width' => 9.33203125), - 10 => array('px' => 64, 'width' => 9.14062500), - 11 => array('px' => 64, 'width' => 9.14062500), - ), - 'Verdana' => array( - 1 => array('px' => 24, 'width' => 12.00000000), - 2 => array('px' => 24, 'width' => 12.00000000), - 3 => array('px' => 32, 'width' => 10.66406250), - 4 => array('px' => 32, 'width' => 10.66406250), - 5 => array('px' => 40, 'width' => 10.00000000), - 6 => array('px' => 48, 'width' => 9.59765625), - 7 => array('px' => 48, 'width' => 9.59765625), - 8 => array('px' => 64, 'width' => 9.14062500), - 9 => array('px' => 72, 'width' => 9.00000000), - 10 => array('px' => 72, 'width' => 9.00000000), - ), - ); - - /** - * Set autoSize method - * - * @param string $pValue - */ - public static function setAutoSizeMethod($pValue = 'approx') - { - self::$autoSizeMethod = $pValue; - } - - /** - * Get autoSize method - * - * @return string - */ - public static function getAutoSizeMethod() - { - return self::$autoSizeMethod; - } - - /** - * Set the path to the folder containing .ttf files. There should be a trailing slash. - * Typical locations on variout some platforms: - * <ul> - * <li>C:/Windows/Fonts/</li> - * <li>/usr/share/fonts/truetype/</li> - * <li>~/.fonts/</li> - * </ul> - * - * @param string $pValue - */ - public static function setTrueTypeFontPath($pValue = '') - { - self::$trueTypeFontPath = $pValue; - } - - /** - * Get the path to the folder containing .ttf files. - * - * @return string - */ - public static function getTrueTypeFontPath() - { - return self::$trueTypeFontPath; - } - - /** - * Calculate an (approximate) OpenXML column width, based on font size and text contained - * - * @param int $fontSize Font size (in pixels or points) - * @param bool $fontSizeInPixels Is the font size specified in pixels (true) or in points (false) ? - * @param string $cellText Text to calculate width - * @param int $rotation Rotation angle - * @return int Column width - */ - public static function calculateColumnWidth(PHPExcel_Style_Font $font, $cellText = '', $rotation = 0, PHPExcel_Style_Font $defaultFont = null) { - - // If it is rich text, use plain text - if ($cellText instanceof PHPExcel_RichText) { - $cellText = $cellText->getPlainText(); - } - - // Special case if there are one or more newline characters ("\n") - if (strpos($cellText, "\n") !== false) { - $lineTexts = explode("\n", $cellText); - $lineWitdhs = array(); - foreach ($lineTexts as $lineText) { - $lineWidths[] = self::calculateColumnWidth($font, $lineText, $rotation = 0, $defaultFont); - } - return max($lineWidths); // width of longest line in cell - } - - // Try to get the exact text width in pixels - try { - // If autosize method is set to 'approx', use approximation - if (self::$autoSizeMethod == self::AUTOSIZE_METHOD_APPROX) { - throw new Exception('AutoSize method is set to approx'); - } - - // Width of text in pixels excl. padding - $columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation); - - // Excel adds some padding, use 1.07 of the width of an 'n' glyph - $columnWidth += ceil(self::getTextWidthPixelsExact('0', $font, 0) * 1.07); // pixels incl. padding - - } catch (Exception $e) { - // Width of text in pixels excl. padding, approximation - $columnWidth = self::getTextWidthPixelsApprox($cellText, $font, $rotation); - - // Excel adds some padding, just use approx width of 'n' glyph - $columnWidth += self::getTextWidthPixelsApprox('n', $font, 0); - } - - // Convert from pixel width to column width - $columnWidth = PHPExcel_Shared_Drawing::pixelsToCellDimension($columnWidth, $defaultFont); - - // Return - return round($columnWidth, 6); - } - - /** - * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle - * - * @param string $text - * @param PHPExcel_Style_Font - * @param int $rotation - * @return int - * @throws Exception - */ - public static function getTextWidthPixelsExact($text, PHPExcel_Style_Font $font, $rotation = 0) { - if (!function_exists('imagettfbbox')) { - throw new Exception('GD library needs to be enabled'); - } - - // font size should really be supplied in pixels in GD2, - // but since GD2 seems to assume 72dpi, pixels and points are the same - $fontFile = self::getTrueTypeFontFileFromFont($font); - $textBox = imagettfbbox($font->getSize(), $rotation, $fontFile, $text); - - // Get corners positions - $lowerLeftCornerX = $textBox[0]; - $lowerLeftCornerY = $textBox[1]; - $lowerRightCornerX = $textBox[2]; - $lowerRightCornerY = $textBox[3]; - $upperRightCornerX = $textBox[4]; - $upperRightCornerY = $textBox[5]; - $upperLeftCornerX = $textBox[6]; - $upperLeftCornerY = $textBox[7]; - - // Consider the rotation when calculating the width - $textWidth = max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX); - - return $textWidth; - } - - /** - * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle - * - * @param string $columnText - * @param PHPExcel_Style_Font $font - * @param int $rotation - * @return int Text width in pixels (no padding added) - */ - public static function getTextWidthPixelsApprox($columnText, PHPExcel_Style_Font $font = null, $rotation = 0) - { - $fontName = $font->getName(); - $fontSize = $font->getSize(); - - // Calculate column width in pixels. We assume fixed glyph width. Result varies with font name and size. - switch ($fontName) { - case 'Calibri': - // value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font. - $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); - $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size - break; - - case 'Arial': - // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font. - $columnWidth = (int) (7 * PHPExcel_Shared_String::CountCharacters($columnText)); - $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size - break; - - case 'Verdana': - // value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font. - $columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText)); - $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size - break; - - default: - // just assume Calibri - $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText)); - $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size - break; - } - - // Calculate approximate rotated column width - if ($rotation !== 0) { - if ($rotation == -165) { - // stacked text - $columnWidth = 4; // approximation - } else { - // rotated text - $columnWidth = $columnWidth * cos(deg2rad($rotation)) - + $fontSize * abs(sin(deg2rad($rotation))) / 5; // approximation - } - } - - // pixel width is an integer - $columnWidth = (int) $columnWidth; - return $columnWidth; - } - - /** - * Calculate an (approximate) pixel size, based on a font points size - * - * @param int $fontSizeInPoints Font size (in points) - * @return int Font size (in pixels) - */ - public static function fontSizeToPixels($fontSizeInPoints = 11) { - return (int) ((4 / 3) * $fontSizeInPoints); - } - - /** - * Calculate an (approximate) pixel size, based on inch size - * - * @param int $sizeInInch Font size (in inch) - * @return int Size (in pixels) - */ - public static function inchSizeToPixels($sizeInInch = 1) { - return ($sizeInInch * 96); - } - - /** - * Calculate an (approximate) pixel size, based on centimeter size - * - * @param int $sizeInCm Font size (in centimeters) - * @return int Size (in pixels) - */ - public static function centimeterSizeToPixels($sizeInCm = 1) { - return ($sizeInCm * 37.795275591); - } - - /** - * Returns the font path given the font - * - * @param PHPExcel_Style_Font - * @return string Path to TrueType font file - */ - public static function getTrueTypeFontFileFromFont($font) { - if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) { - throw new Exception('Valid directory to TrueType Font files not specified'); - } - - $name = $font->getName(); - $bold = $font->getBold(); - $italic = $font->getItalic(); - - // Check if we can map font to true type font file - switch ($name) { - case 'Arial': - $fontFile = ( - $bold ? ($italic ? self::ARIAL_BOLD_ITALIC : self::ARIAL_BOLD) - : ($italic ? self::ARIAL_ITALIC : self::ARIAL) - ); - break; - - case 'Calibri': - $fontFile = ( - $bold ? ($italic ? self::CALIBRI_BOLD_ITALIC : self::CALIBRI_BOLD) - : ($italic ? self::CALIBRI_ITALIC : self::CALIBRI) - ); - break; - - case 'Courier New': - $fontFile = ( - $bold ? ($italic ? self::COURIER_NEW_BOLD_ITALIC : self::COURIER_NEW_BOLD) - : ($italic ? self::COURIER_NEW_ITALIC : self::COURIER_NEW) - ); - break; - - case 'Comic Sans MS': - $fontFile = ( - $bold ? self::COMIC_SANS_MS_BOLD : self::COMIC_SANS_MS - ); - break; - - case 'Georgia': - $fontFile = ( - $bold ? ($italic ? self::GEORGIA_BOLD_ITALIC : self::GEORGIA_BOLD) - : ($italic ? self::GEORGIA_ITALIC : self::GEORGIA) - ); - break; - - case 'Impact': - $fontFile = self::IMPACT; - break; - - case 'Liberation Sans': - $fontFile = ( - $bold ? ($italic ? self::LIBERATION_SANS_BOLD_ITALIC : self::LIBERATION_SANS_BOLD) - : ($italic ? self::LIBERATION_SANS_ITALIC : self::LIBERATION_SANS) - ); - break; - - case 'Lucida Console': - $fontFile = self::LUCIDA_CONSOLE; - break; - - case 'Lucida Sans Unicode': - $fontFile = self::LUCIDA_SANS_UNICODE; - break; - - case 'Microsoft Sans Serif': - $fontFile = self::MICROSOFT_SANS_SERIF; - break; - - case 'Palatino Linotype': - $fontFile = ( - $bold ? ($italic ? self::PALATINO_LINOTYPE_BOLD_ITALIC : self::PALATINO_LINOTYPE_BOLD) - : ($italic ? self::PALATINO_LINOTYPE_ITALIC : self::PALATINO_LINOTYPE) - ); - break; - - case 'Symbol': - $fontFile = self::SYMBOL; - break; - - case 'Tahoma': - $fontFile = ( - $bold ? self::TAHOMA_BOLD : self::TAHOMA - ); - break; - - case 'Times New Roman': - $fontFile = ( - $bold ? ($italic ? self::TIMES_NEW_ROMAN_BOLD_ITALIC : self::TIMES_NEW_ROMAN_BOLD) - : ($italic ? self::TIMES_NEW_ROMAN_ITALIC : self::TIMES_NEW_ROMAN) - ); - break; - - case 'Trebuchet MS': - $fontFile = ( - $bold ? ($italic ? self::TREBUCHET_MS_BOLD_ITALIC : self::TREBUCHET_MS_BOLD) - : ($italic ? self::TREBUCHET_MS_ITALIC : self::TREBUCHET_MS) - ); - break; - - case 'Verdana': - $fontFile = ( - $bold ? ($italic ? self::VERDANA_BOLD_ITALIC : self::VERDANA_BOLD) - : ($italic ? self::VERDANA_ITALIC : self::VERDANA) - ); - break; - - default: - throw new Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file'); - break; - } - - $fontFile = self::$trueTypeFontPath . $fontFile; - - // Check if file actually exists - if (!file_exists($fontFile)) { - throw New Exception('TrueType Font file not found'); - } - - return $fontFile; - } - - /** - * Returns the associated charset for the font name. - * - * @param string $name Font name - * @return int Character set code - */ - public static function getCharsetFromFontName($name) - { - switch ($name) { - // Add more cases. Check FONT records in real Excel files. - case 'EucrosiaUPC': return self::CHARSET_ANSI_THAI; - case 'Wingdings': return self::CHARSET_SYMBOL; - case 'Wingdings 2': return self::CHARSET_SYMBOL; - case 'Wingdings 3': return self::CHARSET_SYMBOL; - default: return self::CHARSET_ANSI_LATIN; - } - } - - /** - * Get the effective column width for columns without a column dimension or column with width -1 - * For example, for Calibri 11 this is 9.140625 (64 px) - * - * @param PHPExcel_Style_Font $font The workbooks default font - * @param boolean $pPixels true = return column width in pixels, false = return in OOXML units - * @return mixed Column width - */ - public static function getDefaultColumnWidthByFont(PHPExcel_Style_Font $font, $pPixels = false) - { - if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) { - // Exact width can be determined - $columnWidth = $pPixels ? - self::$defaultColumnWidths[$font->getName()][$font->getSize()]['px'] - : self::$defaultColumnWidths[$font->getName()][$font->getSize()]['width']; - - } else { - // We don't have data for this particular font and size, use approximation by - // extrapolating from Calibri 11 - $columnWidth = $pPixels ? - self::$defaultColumnWidths['Calibri'][11]['px'] - : self::$defaultColumnWidths['Calibri'][11]['width']; - $columnWidth = $columnWidth * $font->getSize() / 11; - - // Round pixels to closest integer - if ($pPixels) { - $columnWidth = (int) round($columnWidth); - } - } - - return $columnWidth; - } - - /** - * Get the effective row height for rows without a row dimension or rows with height -1 - * For example, for Calibri 11 this is 15 points - * - * @param PHPExcel_Style_Font $font The workbooks default font - * @return float Row height in points - */ - public static function getDefaultRowHeightByFont(PHPExcel_Style_Font $font) - { - switch ($font->getName()) { - case 'Arial': - switch ($font->getSize()) { - case 10: - // inspection of Arial 10 workbook says 12.75pt ~17px - $rowHeight = 12.75; - break; - - case 9: - // inspection of Arial 9 workbook says 12.00pt ~16px - $rowHeight = 12; - break; - - case 8: - // inspection of Arial 8 workbook says 11.25pt ~15px - $rowHeight = 11.25; - break; - - case 7: - // inspection of Arial 7 workbook says 9.00pt ~12px - $rowHeight = 9; - break; - - case 6: - case 5: - // inspection of Arial 5,6 workbook says 8.25pt ~11px - $rowHeight = 8.25; - break; - - case 4: - // inspection of Arial 4 workbook says 6.75pt ~9px - $rowHeight = 6.75; - break; - - case 3: - // inspection of Arial 3 workbook says 6.00pt ~8px - $rowHeight = 6; - break; - - case 2: - case 1: - // inspection of Arial 1,2 workbook says 5.25pt ~7px - $rowHeight = 5.25; - break; - - default: - // use Arial 10 workbook as an approximation, extrapolation - $rowHeight = 12.75 * $font->getSize() / 10; - break; - } - break; - - case 'Calibri': - switch ($font->getSize()) { - case 11: - // inspection of Calibri 11 workbook says 15.00pt ~20px - $rowHeight = 15; - break; - - case 10: - // inspection of Calibri 10 workbook says 12.75pt ~17px - $rowHeight = 12.75; - break; - - case 9: - // inspection of Calibri 9 workbook says 12.00pt ~16px - $rowHeight = 12; - break; - - case 8: - // inspection of Calibri 8 workbook says 11.25pt ~15px - $rowHeight = 11.25; - break; - - case 7: - // inspection of Calibri 7 workbook says 9.00pt ~12px - $rowHeight = 9; - break; - - case 6: - case 5: - // inspection of Calibri 5,6 workbook says 8.25pt ~11px - $rowHeight = 8.25; - break; - - case 4: - // inspection of Calibri 4 workbook says 6.75pt ~9px - $rowHeight = 6.75; - break; - - case 3: - // inspection of Calibri 3 workbook says 6.00pt ~8px - $rowHeight = 6.00; - break; - - case 2: - case 1: - // inspection of Calibri 1,2 workbook says 5.25pt ~7px - $rowHeight = 5.25; - break; - - default: - // use Calibri 11 workbook as an approximation, extrapolation - $rowHeight = 15 * $font->getSize() / 11; - break; - } - break; - - case 'Verdana': - switch ($font->getSize()) { - case 10: - // inspection of Verdana 10 workbook says 12.75pt ~17px - $rowHeight = 12.75; - break; - - case 9: - // inspection of Verdana 9 workbook says 11.25pt ~15px - $rowHeight = 11.25; - break; - - case 8: - // inspection of Verdana 8 workbook says 10.50pt ~14px - $rowHeight = 10.50; - break; - - case 7: - // inspection of Verdana 7 workbook says 9.00pt ~12px - $rowHeight = 9.00; - break; - - case 6: - case 5: - // inspection of Verdana 5,6 workbook says 8.25pt ~11px - $rowHeight = 8.25; - break; - - case 4: - // inspection of Verdana 4 workbook says 6.75pt ~9px - $rowHeight = 6.75; - break; - - case 3: - // inspection of Verdana 3 workbook says 6.00pt ~8px - $rowHeight = 6; - break; - - case 2: - case 1: - // inspection of Verdana 1,2 workbook says 5.25pt ~7px - $rowHeight = 5.25; - break; - - default: - // use Verdana 10 workbook as an approximation, extrapolation - $rowHeight = 12.75 * $font->getSize() / 10; - break; - } - break; - - default: - // just use Calibri as an approximation - $rowHeight = 15 * $font->getSize() / 11; - break; - } - - return $rowHeight; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CHANGELOG.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CHANGELOG.TXT deleted file mode 100644 index 1c18a5da35..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CHANGELOG.TXT +++ /dev/null @@ -1,16 +0,0 @@ -Mar 1, 2005 11:15 AST by PM - -+ For consistency, renamed Math.php to Maths.java, utils to util, - tests to test, docs to doc - - -+ Removed conditional logic from top of Matrix class. - -+ Switched to using hypo function in Maths.php for all php-hypot calls. - NOTE TO SELF: Need to make sure that all decompositions have been - switched over to using the bundled hypo. - -Feb 25, 2005 at 10:00 AST by PM - -+ Recommend using simpler Error.php instead of JAMA_Error.php but - can be persuaded otherwise. - diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CholeskyDecomposition.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CholeskyDecomposition.php deleted file mode 100644 index 9d064f9e63..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/CholeskyDecomposition.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php -/** - * @package JAMA - * - * Cholesky decomposition class - * - * For a symmetric, positive definite matrix A, the Cholesky decomposition - * is an lower triangular matrix L so that A = L*L'. - * - * If the matrix is not symmetric or positive definite, the constructor - * returns a partial decomposition and sets an internal flag that may - * be queried by the isSPD() method. - * - * @author Paul Meagher - * @author Michael Bommarito - * @version 1.2 - */ -class CholeskyDecomposition { - - /** - * Decomposition storage - * @var array - * @access private - */ - private $L = array(); - - /** - * Matrix row and column dimension - * @var int - * @access private - */ - private $m; - - /** - * Symmetric positive definite flag - * @var boolean - * @access private - */ - private $isspd = true; - - - /** - * CholeskyDecomposition - * - * Class constructor - decomposes symmetric positive definite matrix - * @param mixed Matrix square symmetric positive definite matrix - */ - public function __construct($A = null) { - if ($A instanceof Matrix) { - $this->L = $A->getArray(); - $this->m = $A->getRowDimension(); - - for($i = 0; $i < $this->m; ++$i) { - for($j = $i; $j < $this->m; ++$j) { - for($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) { - $sum -= $this->L[$i][$k] * $this->L[$j][$k]; - } - if ($i == $j) { - if ($sum >= 0) { - $this->L[$i][$i] = sqrt($sum); - } else { - $this->isspd = false; - } - } else { - if ($this->L[$i][$i] != 0) { - $this->L[$j][$i] = $sum / $this->L[$i][$i]; - } - } - } - - for ($k = $i+1; $k < $this->m; ++$k) { - $this->L[$i][$k] = 0.0; - } - } - } else { - throw new Exception(JAMAError(ArgumentTypeException)); - } - } // function __construct() - - - /** - * Is the matrix symmetric and positive definite? - * - * @return boolean - */ - public function isSPD() { - return $this->isspd; - } // function isSPD() - - - /** - * getL - * - * Return triangular factor. - * @return Matrix Lower triangular matrix - */ - public function getL() { - return new Matrix($this->L); - } // function getL() - - - /** - * Solve A*X = B - * - * @param $B Row-equal matrix - * @return Matrix L * L' * X = B - */ - public function solve($B = null) { - if ($B instanceof Matrix) { - if ($B->getRowDimension() == $this->m) { - if ($this->isspd) { - $X = $B->getArrayCopy(); - $nx = $B->getColumnDimension(); - - for ($k = 0; $k < $this->m; ++$k) { - for ($i = $k + 1; $i < $this->m; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X[$i][$j] -= $X[$k][$j] * $this->L[$i][$k]; - } - } - for ($j = 0; $j < $nx; ++$j) { - $X[$k][$j] /= $this->L[$k][$k]; - } - } - - for ($k = $this->m - 1; $k >= 0; --$k) { - for ($j = 0; $j < $nx; ++$j) { - $X[$k][$j] /= $this->L[$k][$k]; - } - for ($i = 0; $i < $k; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X[$i][$j] -= $X[$k][$j] * $this->L[$k][$i]; - } - } - } - - return new Matrix($X, $this->m, $nx); - } else { - throw new Exception(JAMAError(MatrixSPDException)); - } - } else { - throw new Exception(JAMAError(MatrixDimensionException)); - } - } else { - throw new Exception(JAMAError(ArgumentTypeException)); - } - } // function solve() - -} // class CholeskyDecomposition diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php deleted file mode 100644 index 2a696d00f8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php +++ /dev/null @@ -1,862 +0,0 @@ -<?php -/** - * @package JAMA - * - * Class to obtain eigenvalues and eigenvectors of a real matrix. - * - * If A is symmetric, then A = V*D*V' where the eigenvalue matrix D - * is diagonal and the eigenvector matrix V is orthogonal (i.e. - * A = V.times(D.times(V.transpose())) and V.times(V.transpose()) - * equals the identity matrix). - * - * If A is not symmetric, then the eigenvalue matrix D is block diagonal - * with the real eigenvalues in 1-by-1 blocks and any complex eigenvalues, - * lambda + i*mu, in 2-by-2 blocks, [lambda, mu; -mu, lambda]. The - * columns of V represent the eigenvectors in the sense that A*V = V*D, - * i.e. A.times(V) equals V.times(D). The matrix V may be badly - * conditioned, or even singular, so the validity of the equation - * A = V*D*inverse(V) depends upon V.cond(). - * - * @author Paul Meagher - * @license PHP v3.0 - * @version 1.1 - */ -class EigenvalueDecomposition { - - /** - * Row and column dimension (square matrix). - * @var int - */ - private $n; - - /** - * Internal symmetry flag. - * @var int - */ - private $issymmetric; - - /** - * Arrays for internal storage of eigenvalues. - * @var array - */ - private $d = array(); - private $e = array(); - - /** - * Array for internal storage of eigenvectors. - * @var array - */ - private $V = array(); - - /** - * Array for internal storage of nonsymmetric Hessenberg form. - * @var array - */ - private $H = array(); - - /** - * Working storage for nonsymmetric algorithm. - * @var array - */ - private $ort; - - /** - * Used for complex scalar division. - * @var float - */ - private $cdivr; - private $cdivi; - - - /** - * Symmetric Householder reduction to tridiagonal form. - * - * @access private - */ - private function tred2 () { - // This is derived from the Algol procedures tred2 by - // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for - // Auto. Comp., Vol.ii-Linear Algebra, and the corresponding - // Fortran subroutine in EISPACK. - $this->d = $this->V[$this->n-1]; - // Householder reduction to tridiagonal form. - for ($i = $this->n-1; $i > 0; --$i) { - $i_ = $i -1; - // Scale to avoid under/overflow. - $h = $scale = 0.0; - $scale += array_sum(array_map(abs, $this->d)); - if ($scale == 0.0) { - $this->e[$i] = $this->d[$i_]; - $this->d = array_slice($this->V[$i_], 0, $i_); - for ($j = 0; $j < $i; ++$j) { - $this->V[$j][$i] = $this->V[$i][$j] = 0.0; - } - } else { - // Generate Householder vector. - for ($k = 0; $k < $i; ++$k) { - $this->d[$k] /= $scale; - $h += pow($this->d[$k], 2); - } - $f = $this->d[$i_]; - $g = sqrt($h); - if ($f > 0) { - $g = -$g; - } - $this->e[$i] = $scale * $g; - $h = $h - $f * $g; - $this->d[$i_] = $f - $g; - for ($j = 0; $j < $i; ++$j) { - $this->e[$j] = 0.0; - } - // Apply similarity transformation to remaining columns. - for ($j = 0; $j < $i; ++$j) { - $f = $this->d[$j]; - $this->V[$j][$i] = $f; - $g = $this->e[$j] + $this->V[$j][$j] * $f; - for ($k = $j+1; $k <= $i_; ++$k) { - $g += $this->V[$k][$j] * $this->d[$k]; - $this->e[$k] += $this->V[$k][$j] * $f; - } - $this->e[$j] = $g; - } - $f = 0.0; - for ($j = 0; $j < $i; ++$j) { - $this->e[$j] /= $h; - $f += $this->e[$j] * $this->d[$j]; - } - $hh = $f / (2 * $h); - for ($j=0; $j < $i; ++$j) { - $this->e[$j] -= $hh * $this->d[$j]; - } - for ($j = 0; $j < $i; ++$j) { - $f = $this->d[$j]; - $g = $this->e[$j]; - for ($k = $j; $k <= $i_; ++$k) { - $this->V[$k][$j] -= ($f * $this->e[$k] + $g * $this->d[$k]); - } - $this->d[$j] = $this->V[$i-1][$j]; - $this->V[$i][$j] = 0.0; - } - } - $this->d[$i] = $h; - } - - // Accumulate transformations. - for ($i = 0; $i < $this->n-1; ++$i) { - $this->V[$this->n-1][$i] = $this->V[$i][$i]; - $this->V[$i][$i] = 1.0; - $h = $this->d[$i+1]; - if ($h != 0.0) { - for ($k = 0; $k <= $i; ++$k) { - $this->d[$k] = $this->V[$k][$i+1] / $h; - } - for ($j = 0; $j <= $i; ++$j) { - $g = 0.0; - for ($k = 0; $k <= $i; ++$k) { - $g += $this->V[$k][$i+1] * $this->V[$k][$j]; - } - for ($k = 0; $k <= $i; ++$k) { - $this->V[$k][$j] -= $g * $this->d[$k]; - } - } - } - for ($k = 0; $k <= $i; ++$k) { - $this->V[$k][$i+1] = 0.0; - } - } - - $this->d = $this->V[$this->n-1]; - $this->V[$this->n-1] = array_fill(0, $j, 0.0); - $this->V[$this->n-1][$this->n-1] = 1.0; - $this->e[0] = 0.0; - } - - - /** - * Symmetric tridiagonal QL algorithm. - * - * This is derived from the Algol procedures tql2, by - * Bowdler, Martin, Reinsch, and Wilkinson, Handbook for - * Auto. Comp., Vol.ii-Linear Algebra, and the corresponding - * Fortran subroutine in EISPACK. - * - * @access private - */ - private function tql2() { - for ($i = 1; $i < $this->n; ++$i) { - $this->e[$i-1] = $this->e[$i]; - } - $this->e[$this->n-1] = 0.0; - $f = 0.0; - $tst1 = 0.0; - $eps = pow(2.0,-52.0); - - for ($l = 0; $l < $this->n; ++$l) { - // Find small subdiagonal element - $tst1 = max($tst1, abs($this->d[$l]) + abs($this->e[$l])); - $m = $l; - while ($m < $this->n) { - if (abs($this->e[$m]) <= $eps * $tst1) - break; - ++$m; - } - // If m == l, $this->d[l] is an eigenvalue, - // otherwise, iterate. - if ($m > $l) { - $iter = 0; - do { - // Could check iteration count here. - $iter += 1; - // Compute implicit shift - $g = $this->d[$l]; - $p = ($this->d[$l+1] - $g) / (2.0 * $this->e[$l]); - $r = hypo($p, 1.0); - if ($p < 0) - $r *= -1; - $this->d[$l] = $this->e[$l] / ($p + $r); - $this->d[$l+1] = $this->e[$l] * ($p + $r); - $dl1 = $this->d[$l+1]; - $h = $g - $this->d[$l]; - for ($i = $l + 2; $i < $this->n; ++$i) - $this->d[$i] -= $h; - $f += $h; - // Implicit QL transformation. - $p = $this->d[$m]; - $c = 1.0; - $c2 = $c3 = $c; - $el1 = $this->e[$l + 1]; - $s = $s2 = 0.0; - for ($i = $m-1; $i >= $l; --$i) { - $c3 = $c2; - $c2 = $c; - $s2 = $s; - $g = $c * $this->e[$i]; - $h = $c * $p; - $r = hypo($p, $this->e[$i]); - $this->e[$i+1] = $s * $r; - $s = $this->e[$i] / $r; - $c = $p / $r; - $p = $c * $this->d[$i] - $s * $g; - $this->d[$i+1] = $h + $s * ($c * $g + $s * $this->d[$i]); - // Accumulate transformation. - for ($k = 0; $k < $this->n; ++$k) { - $h = $this->V[$k][$i+1]; - $this->V[$k][$i+1] = $s * $this->V[$k][$i] + $c * $h; - $this->V[$k][$i] = $c * $this->V[$k][$i] - $s * $h; - } - } - $p = -$s * $s2 * $c3 * $el1 * $this->e[$l] / $dl1; - $this->e[$l] = $s * $p; - $this->d[$l] = $c * $p; - // Check for convergence. - } while (abs($this->e[$l]) > $eps * $tst1); - } - $this->d[$l] = $this->d[$l] + $f; - $this->e[$l] = 0.0; - } - - // Sort eigenvalues and corresponding vectors. - for ($i = 0; $i < $this->n - 1; ++$i) { - $k = $i; - $p = $this->d[$i]; - for ($j = $i+1; $j < $this->n; ++$j) { - if ($this->d[$j] < $p) { - $k = $j; - $p = $this->d[$j]; - } - } - if ($k != $i) { - $this->d[$k] = $this->d[$i]; - $this->d[$i] = $p; - for ($j = 0; $j < $this->n; ++$j) { - $p = $this->V[$j][$i]; - $this->V[$j][$i] = $this->V[$j][$k]; - $this->V[$j][$k] = $p; - } - } - } - } - - - /** - * Nonsymmetric reduction to Hessenberg form. - * - * This is derived from the Algol procedures orthes and ortran, - * by Martin and Wilkinson, Handbook for Auto. Comp., - * Vol.ii-Linear Algebra, and the corresponding - * Fortran subroutines in EISPACK. - * - * @access private - */ - private function orthes () { - $low = 0; - $high = $this->n-1; - - for ($m = $low+1; $m <= $high-1; ++$m) { - // Scale column. - $scale = 0.0; - for ($i = $m; $i <= $high; ++$i) { - $scale = $scale + abs($this->H[$i][$m-1]); - } - if ($scale != 0.0) { - // Compute Householder transformation. - $h = 0.0; - for ($i = $high; $i >= $m; --$i) { - $this->ort[$i] = $this->H[$i][$m-1] / $scale; - $h += $this->ort[$i] * $this->ort[$i]; - } - $g = sqrt($h); - if ($this->ort[$m] > 0) { - $g *= -1; - } - $h -= $this->ort[$m] * $g; - $this->ort[$m] -= $g; - // Apply Householder similarity transformation - // H = (I -u * u' / h) * H * (I -u * u') / h) - for ($j = $m; $j < $this->n; ++$j) { - $f = 0.0; - for ($i = $high; $i >= $m; --$i) { - $f += $this->ort[$i] * $this->H[$i][$j]; - } - $f /= $h; - for ($i = $m; $i <= $high; ++$i) { - $this->H[$i][$j] -= $f * $this->ort[$i]; - } - } - for ($i = 0; $i <= $high; ++$i) { - $f = 0.0; - for ($j = $high; $j >= $m; --$j) { - $f += $this->ort[$j] * $this->H[$i][$j]; - } - $f = $f / $h; - for ($j = $m; $j <= $high; ++$j) { - $this->H[$i][$j] -= $f * $this->ort[$j]; - } - } - $this->ort[$m] = $scale * $this->ort[$m]; - $this->H[$m][$m-1] = $scale * $g; - } - } - - // Accumulate transformations (Algol's ortran). - for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - $this->V[$i][$j] = ($i == $j ? 1.0 : 0.0); - } - } - for ($m = $high-1; $m >= $low+1; --$m) { - if ($this->H[$m][$m-1] != 0.0) { - for ($i = $m+1; $i <= $high; ++$i) { - $this->ort[$i] = $this->H[$i][$m-1]; - } - for ($j = $m; $j <= $high; ++$j) { - $g = 0.0; - for ($i = $m; $i <= $high; ++$i) { - $g += $this->ort[$i] * $this->V[$i][$j]; - } - // Double division avoids possible underflow - $g = ($g / $this->ort[$m]) / $this->H[$m][$m-1]; - for ($i = $m; $i <= $high; ++$i) { - $this->V[$i][$j] += $g * $this->ort[$i]; - } - } - } - } - } - - - /** - * Performs complex division. - * - * @access private - */ - private function cdiv($xr, $xi, $yr, $yi) { - if (abs($yr) > abs($yi)) { - $r = $yi / $yr; - $d = $yr + $r * $yi; - $this->cdivr = ($xr + $r * $xi) / $d; - $this->cdivi = ($xi - $r * $xr) / $d; - } else { - $r = $yr / $yi; - $d = $yi + $r * $yr; - $this->cdivr = ($r * $xr + $xi) / $d; - $this->cdivi = ($r * $xi - $xr) / $d; - } - } - - - /** - * Nonsymmetric reduction from Hessenberg to real Schur form. - * - * Code is derived from the Algol procedure hqr2, - * by Martin and Wilkinson, Handbook for Auto. Comp., - * Vol.ii-Linear Algebra, and the corresponding - * Fortran subroutine in EISPACK. - * - * @access private - */ - private function hqr2 () { - // Initialize - $nn = $this->n; - $n = $nn - 1; - $low = 0; - $high = $nn - 1; - $eps = pow(2.0, -52.0); - $exshift = 0.0; - $p = $q = $r = $s = $z = 0; - // Store roots isolated by balanc and compute matrix norm - $norm = 0.0; - - for ($i = 0; $i < $nn; ++$i) { - if (($i < $low) OR ($i > $high)) { - $this->d[$i] = $this->H[$i][$i]; - $this->e[$i] = 0.0; - } - for ($j = max($i-1, 0); $j < $nn; ++$j) { - $norm = $norm + abs($this->H[$i][$j]); - } - } - - // Outer loop over eigenvalue index - $iter = 0; - while ($n >= $low) { - // Look for single small sub-diagonal element - $l = $n; - while ($l > $low) { - $s = abs($this->H[$l-1][$l-1]) + abs($this->H[$l][$l]); - if ($s == 0.0) { - $s = $norm; - } - if (abs($this->H[$l][$l-1]) < $eps * $s) { - break; - } - --$l; - } - // Check for convergence - // One root found - if ($l == $n) { - $this->H[$n][$n] = $this->H[$n][$n] + $exshift; - $this->d[$n] = $this->H[$n][$n]; - $this->e[$n] = 0.0; - --$n; - $iter = 0; - // Two roots found - } else if ($l == $n-1) { - $w = $this->H[$n][$n-1] * $this->H[$n-1][$n]; - $p = ($this->H[$n-1][$n-1] - $this->H[$n][$n]) / 2.0; - $q = $p * $p + $w; - $z = sqrt(abs($q)); - $this->H[$n][$n] = $this->H[$n][$n] + $exshift; - $this->H[$n-1][$n-1] = $this->H[$n-1][$n-1] + $exshift; - $x = $this->H[$n][$n]; - // Real pair - if ($q >= 0) { - if ($p >= 0) { - $z = $p + $z; - } else { - $z = $p - $z; - } - $this->d[$n-1] = $x + $z; - $this->d[$n] = $this->d[$n-1]; - if ($z != 0.0) { - $this->d[$n] = $x - $w / $z; - } - $this->e[$n-1] = 0.0; - $this->e[$n] = 0.0; - $x = $this->H[$n][$n-1]; - $s = abs($x) + abs($z); - $p = $x / $s; - $q = $z / $s; - $r = sqrt($p * $p + $q * $q); - $p = $p / $r; - $q = $q / $r; - // Row modification - for ($j = $n-1; $j < $nn; ++$j) { - $z = $this->H[$n-1][$j]; - $this->H[$n-1][$j] = $q * $z + $p * $this->H[$n][$j]; - $this->H[$n][$j] = $q * $this->H[$n][$j] - $p * $z; - } - // Column modification - for ($i = 0; $i <= n; ++$i) { - $z = $this->H[$i][$n-1]; - $this->H[$i][$n-1] = $q * $z + $p * $this->H[$i][$n]; - $this->H[$i][$n] = $q * $this->H[$i][$n] - $p * $z; - } - // Accumulate transformations - for ($i = $low; $i <= $high; ++$i) { - $z = $this->V[$i][$n-1]; - $this->V[$i][$n-1] = $q * $z + $p * $this->V[$i][$n]; - $this->V[$i][$n] = $q * $this->V[$i][$n] - $p * $z; - } - // Complex pair - } else { - $this->d[$n-1] = $x + $p; - $this->d[$n] = $x + $p; - $this->e[$n-1] = $z; - $this->e[$n] = -$z; - } - $n = $n - 2; - $iter = 0; - // No convergence yet - } else { - // Form shift - $x = $this->H[$n][$n]; - $y = 0.0; - $w = 0.0; - if ($l < $n) { - $y = $this->H[$n-1][$n-1]; - $w = $this->H[$n][$n-1] * $this->H[$n-1][$n]; - } - // Wilkinson's original ad hoc shift - if ($iter == 10) { - $exshift += $x; - for ($i = $low; $i <= $n; ++$i) { - $this->H[$i][$i] -= $x; - } - $s = abs($this->H[$n][$n-1]) + abs($this->H[$n-1][$n-2]); - $x = $y = 0.75 * $s; - $w = -0.4375 * $s * $s; - } - // MATLAB's new ad hoc shift - if ($iter == 30) { - $s = ($y - $x) / 2.0; - $s = $s * $s + $w; - if ($s > 0) { - $s = sqrt($s); - if ($y < $x) { - $s = -$s; - } - $s = $x - $w / (($y - $x) / 2.0 + $s); - for ($i = $low; $i <= $n; ++$i) { - $this->H[$i][$i] -= $s; - } - $exshift += $s; - $x = $y = $w = 0.964; - } - } - // Could check iteration count here. - $iter = $iter + 1; - // Look for two consecutive small sub-diagonal elements - $m = $n - 2; - while ($m >= $l) { - $z = $this->H[$m][$m]; - $r = $x - $z; - $s = $y - $z; - $p = ($r * $s - $w) / $this->H[$m+1][$m] + $this->H[$m][$m+1]; - $q = $this->H[$m+1][$m+1] - $z - $r - $s; - $r = $this->H[$m+2][$m+1]; - $s = abs($p) + abs($q) + abs($r); - $p = $p / $s; - $q = $q / $s; - $r = $r / $s; - if ($m == $l) { - break; - } - if (abs($this->H[$m][$m-1]) * (abs($q) + abs($r)) < - $eps * (abs($p) * (abs($this->H[$m-1][$m-1]) + abs($z) + abs($this->H[$m+1][$m+1])))) { - break; - } - --$m; - } - for ($i = $m + 2; $i <= $n; ++$i) { - $this->H[$i][$i-2] = 0.0; - if ($i > $m+2) { - $this->H[$i][$i-3] = 0.0; - } - } - // Double QR step involving rows l:n and columns m:n - for ($k = $m; $k <= $n-1; ++$k) { - $notlast = ($k != $n-1); - if ($k != $m) { - $p = $this->H[$k][$k-1]; - $q = $this->H[$k+1][$k-1]; - $r = ($notlast ? $this->H[$k+2][$k-1] : 0.0); - $x = abs($p) + abs($q) + abs($r); - if ($x != 0.0) { - $p = $p / $x; - $q = $q / $x; - $r = $r / $x; - } - } - if ($x == 0.0) { - break; - } - $s = sqrt($p * $p + $q * $q + $r * $r); - if ($p < 0) { - $s = -$s; - } - if ($s != 0) { - if ($k != $m) { - $this->H[$k][$k-1] = -$s * $x; - } elseif ($l != $m) { - $this->H[$k][$k-1] = -$this->H[$k][$k-1]; - } - $p = $p + $s; - $x = $p / $s; - $y = $q / $s; - $z = $r / $s; - $q = $q / $p; - $r = $r / $p; - // Row modification - for ($j = $k; $j < $nn; ++$j) { - $p = $this->H[$k][$j] + $q * $this->H[$k+1][$j]; - if ($notlast) { - $p = $p + $r * $this->H[$k+2][$j]; - $this->H[$k+2][$j] = $this->H[$k+2][$j] - $p * $z; - } - $this->H[$k][$j] = $this->H[$k][$j] - $p * $x; - $this->H[$k+1][$j] = $this->H[$k+1][$j] - $p * $y; - } - // Column modification - for ($i = 0; $i <= min($n, $k+3); ++$i) { - $p = $x * $this->H[$i][$k] + $y * $this->H[$i][$k+1]; - if ($notlast) { - $p = $p + $z * $this->H[$i][$k+2]; - $this->H[$i][$k+2] = $this->H[$i][$k+2] - $p * $r; - } - $this->H[$i][$k] = $this->H[$i][$k] - $p; - $this->H[$i][$k+1] = $this->H[$i][$k+1] - $p * $q; - } - // Accumulate transformations - for ($i = $low; $i <= $high; ++$i) { - $p = $x * $this->V[$i][$k] + $y * $this->V[$i][$k+1]; - if ($notlast) { - $p = $p + $z * $this->V[$i][$k+2]; - $this->V[$i][$k+2] = $this->V[$i][$k+2] - $p * $r; - } - $this->V[$i][$k] = $this->V[$i][$k] - $p; - $this->V[$i][$k+1] = $this->V[$i][$k+1] - $p * $q; - } - } // ($s != 0) - } // k loop - } // check convergence - } // while ($n >= $low) - - // Backsubstitute to find vectors of upper triangular form - if ($norm == 0.0) { - return; - } - - for ($n = $nn-1; $n >= 0; --$n) { - $p = $this->d[$n]; - $q = $this->e[$n]; - // Real vector - if ($q == 0) { - $l = $n; - $this->H[$n][$n] = 1.0; - for ($i = $n-1; $i >= 0; --$i) { - $w = $this->H[$i][$i] - $p; - $r = 0.0; - for ($j = $l; $j <= $n; ++$j) { - $r = $r + $this->H[$i][$j] * $this->H[$j][$n]; - } - if ($this->e[$i] < 0.0) { - $z = $w; - $s = $r; - } else { - $l = $i; - if ($this->e[$i] == 0.0) { - if ($w != 0.0) { - $this->H[$i][$n] = -$r / $w; - } else { - $this->H[$i][$n] = -$r / ($eps * $norm); - } - // Solve real equations - } else { - $x = $this->H[$i][$i+1]; - $y = $this->H[$i+1][$i]; - $q = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i]; - $t = ($x * $s - $z * $r) / $q; - $this->H[$i][$n] = $t; - if (abs($x) > abs($z)) { - $this->H[$i+1][$n] = (-$r - $w * $t) / $x; - } else { - $this->H[$i+1][$n] = (-$s - $y * $t) / $z; - } - } - // Overflow control - $t = abs($this->H[$i][$n]); - if (($eps * $t) * $t > 1) { - for ($j = $i; $j <= $n; ++$j) { - $this->H[$j][$n] = $this->H[$j][$n] / $t; - } - } - } - } - // Complex vector - } else if ($q < 0) { - $l = $n-1; - // Last vector component imaginary so matrix is triangular - if (abs($this->H[$n][$n-1]) > abs($this->H[$n-1][$n])) { - $this->H[$n-1][$n-1] = $q / $this->H[$n][$n-1]; - $this->H[$n-1][$n] = -($this->H[$n][$n] - $p) / $this->H[$n][$n-1]; - } else { - $this->cdiv(0.0, -$this->H[$n-1][$n], $this->H[$n-1][$n-1] - $p, $q); - $this->H[$n-1][$n-1] = $this->cdivr; - $this->H[$n-1][$n] = $this->cdivi; - } - $this->H[$n][$n-1] = 0.0; - $this->H[$n][$n] = 1.0; - for ($i = $n-2; $i >= 0; --$i) { - // double ra,sa,vr,vi; - $ra = 0.0; - $sa = 0.0; - for ($j = $l; $j <= $n; ++$j) { - $ra = $ra + $this->H[$i][$j] * $this->H[$j][$n-1]; - $sa = $sa + $this->H[$i][$j] * $this->H[$j][$n]; - } - $w = $this->H[$i][$i] - $p; - if ($this->e[$i] < 0.0) { - $z = $w; - $r = $ra; - $s = $sa; - } else { - $l = $i; - if ($this->e[$i] == 0) { - $this->cdiv(-$ra, -$sa, $w, $q); - $this->H[$i][$n-1] = $this->cdivr; - $this->H[$i][$n] = $this->cdivi; - } else { - // Solve complex equations - $x = $this->H[$i][$i+1]; - $y = $this->H[$i+1][$i]; - $vr = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i] - $q * $q; - $vi = ($this->d[$i] - $p) * 2.0 * $q; - if ($vr == 0.0 & $vi == 0.0) { - $vr = $eps * $norm * (abs($w) + abs($q) + abs($x) + abs($y) + abs($z)); - } - $this->cdiv($x * $r - $z * $ra + $q * $sa, $x * $s - $z * $sa - $q * $ra, $vr, $vi); - $this->H[$i][$n-1] = $this->cdivr; - $this->H[$i][$n] = $this->cdivi; - if (abs($x) > (abs($z) + abs($q))) { - $this->H[$i+1][$n-1] = (-$ra - $w * $this->H[$i][$n-1] + $q * $this->H[$i][$n]) / $x; - $this->H[$i+1][$n] = (-$sa - $w * $this->H[$i][$n] - $q * $this->H[$i][$n-1]) / $x; - } else { - $this->cdiv(-$r - $y * $this->H[$i][$n-1], -$s - $y * $this->H[$i][$n], $z, $q); - $this->H[$i+1][$n-1] = $this->cdivr; - $this->H[$i+1][$n] = $this->cdivi; - } - } - // Overflow control - $t = max(abs($this->H[$i][$n-1]),abs($this->H[$i][$n])); - if (($eps * $t) * $t > 1) { - for ($j = $i; $j <= $n; ++$j) { - $this->H[$j][$n-1] = $this->H[$j][$n-1] / $t; - $this->H[$j][$n] = $this->H[$j][$n] / $t; - } - } - } // end else - } // end for - } // end else for complex case - } // end for - - // Vectors of isolated roots - for ($i = 0; $i < $nn; ++$i) { - if ($i < $low | $i > $high) { - for ($j = $i; $j < $nn; ++$j) { - $this->V[$i][$j] = $this->H[$i][$j]; - } - } - } - - // Back transformation to get eigenvectors of original matrix - for ($j = $nn-1; $j >= $low; --$j) { - for ($i = $low; $i <= $high; ++$i) { - $z = 0.0; - for ($k = $low; $k <= min($j,$high); ++$k) { - $z = $z + $this->V[$i][$k] * $this->H[$k][$j]; - } - $this->V[$i][$j] = $z; - } - } - } // end hqr2 - - - /** - * Constructor: Check for symmetry, then construct the eigenvalue decomposition - * - * @access public - * @param A Square matrix - * @return Structure to access D and V. - */ - public function __construct($Arg) { - $this->A = $Arg->getArray(); - $this->n = $Arg->getColumnDimension(); - - $issymmetric = true; - for ($j = 0; ($j < $this->n) & $issymmetric; ++$j) { - for ($i = 0; ($i < $this->n) & $issymmetric; ++$i) { - $issymmetric = ($this->A[$i][$j] == $this->A[$j][$i]); - } - } - - if ($issymmetric) { - $this->V = $this->A; - // Tridiagonalize. - $this->tred2(); - // Diagonalize. - $this->tql2(); - } else { - $this->H = $this->A; - $this->ort = array(); - // Reduce to Hessenberg form. - $this->orthes(); - // Reduce Hessenberg to real Schur form. - $this->hqr2(); - } - } - - - /** - * Return the eigenvector matrix - * - * @access public - * @return V - */ - public function getV() { - return new Matrix($this->V, $this->n, $this->n); - } - - - /** - * Return the real parts of the eigenvalues - * - * @access public - * @return real(diag(D)) - */ - public function getRealEigenvalues() { - return $this->d; - } - - - /** - * Return the imaginary parts of the eigenvalues - * - * @access public - * @return imag(diag(D)) - */ - public function getImagEigenvalues() { - return $this->e; - } - - - /** - * Return the block diagonal eigenvalue matrix - * - * @access public - * @return D - */ - public function getD() { - for ($i = 0; $i < $this->n; ++$i) { - $D[$i] = array_fill(0, $this->n, 0.0); - $D[$i][$i] = $this->d[$i]; - if ($this->e[$i] == 0) { - continue; - } - $o = ($this->e[$i] > 0) ? $i + 1 : $i - 1; - $D[$i][$o] = $this->e[$i]; - } - return new Matrix($D); - } - -} // class EigenvalueDecomposition diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/LUDecomposition.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/LUDecomposition.php deleted file mode 100644 index 6c797a6ce0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/LUDecomposition.php +++ /dev/null @@ -1,258 +0,0 @@ -<?php -/** - * @package JAMA - * - * For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n - * unit lower triangular matrix L, an n-by-n upper triangular matrix U, - * and a permutation vector piv of length m so that A(piv,:) = L*U. - * If m < n, then L is m-by-m and U is m-by-n. - * - * The LU decompostion with pivoting always exists, even if the matrix is - * singular, so the constructor will never fail. The primary use of the - * LU decomposition is in the solution of square systems of simultaneous - * linear equations. This will fail if isNonsingular() returns false. - * - * @author Paul Meagher - * @author Bartosz Matosiuk - * @author Michael Bommarito - * @version 1.1 - * @license PHP v3.0 - */ -class PHPExcel_Shared_JAMA_LUDecomposition { - - const MatrixSingularException = "Can only perform operation on singular matrix."; - const MatrixSquareException = "Mismatched Row dimension"; - - /** - * Decomposition storage - * @var array - */ - private $LU = array(); - - /** - * Row dimension. - * @var int - */ - private $m; - - /** - * Column dimension. - * @var int - */ - private $n; - - /** - * Pivot sign. - * @var int - */ - private $pivsign; - - /** - * Internal storage of pivot vector. - * @var array - */ - private $piv = array(); - - - /** - * LU Decomposition constructor. - * - * @param $A Rectangular matrix - * @return Structure to access L, U and piv. - */ - public function __construct($A) { - if ($A instanceof PHPExcel_Shared_JAMA_Matrix) { - // Use a "left-looking", dot-product, Crout/Doolittle algorithm. - $this->LU = $A->getArray(); - $this->m = $A->getRowDimension(); - $this->n = $A->getColumnDimension(); - for ($i = 0; $i < $this->m; ++$i) { - $this->piv[$i] = $i; - } - $this->pivsign = 1; - $LUrowi = $LUcolj = array(); - - // Outer loop. - for ($j = 0; $j < $this->n; ++$j) { - // Make a copy of the j-th column to localize references. - for ($i = 0; $i < $this->m; ++$i) { - $LUcolj[$i] = &$this->LU[$i][$j]; - } - // Apply previous transformations. - for ($i = 0; $i < $this->m; ++$i) { - $LUrowi = $this->LU[$i]; - // Most of the time is spent in the following dot product. - $kmax = min($i,$j); - $s = 0.0; - for ($k = 0; $k < $kmax; ++$k) { - $s += $LUrowi[$k] * $LUcolj[$k]; - } - $LUrowi[$j] = $LUcolj[$i] -= $s; - } - // Find pivot and exchange if necessary. - $p = $j; - for ($i = $j+1; $i < $this->m; ++$i) { - if (abs($LUcolj[$i]) > abs($LUcolj[$p])) { - $p = $i; - } - } - if ($p != $j) { - for ($k = 0; $k < $this->n; ++$k) { - $t = $this->LU[$p][$k]; - $this->LU[$p][$k] = $this->LU[$j][$k]; - $this->LU[$j][$k] = $t; - } - $k = $this->piv[$p]; - $this->piv[$p] = $this->piv[$j]; - $this->piv[$j] = $k; - $this->pivsign = $this->pivsign * -1; - } - // Compute multipliers. - if (($j < $this->m) && ($this->LU[$j][$j] != 0.0)) { - for ($i = $j+1; $i < $this->m; ++$i) { - $this->LU[$i][$j] /= $this->LU[$j][$j]; - } - } - } - } else { - throw new Exception(PHPExcel_Shared_JAMA_Matrix::ArgumentTypeException); - } - } // function __construct() - - - /** - * Get lower triangular factor. - * - * @return array Lower triangular factor - */ - public function getL() { - for ($i = 0; $i < $this->m; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i > $j) { - $L[$i][$j] = $this->LU[$i][$j]; - } elseif ($i == $j) { - $L[$i][$j] = 1.0; - } else { - $L[$i][$j] = 0.0; - } - } - } - return new PHPExcel_Shared_JAMA_Matrix($L); - } // function getL() - - - /** - * Get upper triangular factor. - * - * @return array Upper triangular factor - */ - public function getU() { - for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i <= $j) { - $U[$i][$j] = $this->LU[$i][$j]; - } else { - $U[$i][$j] = 0.0; - } - } - } - return new PHPExcel_Shared_JAMA_Matrix($U); - } // function getU() - - - /** - * Return pivot permutation vector. - * - * @return array Pivot vector - */ - public function getPivot() { - return $this->piv; - } // function getPivot() - - - /** - * Alias for getPivot - * - * @see getPivot - */ - public function getDoublePivot() { - return $this->getPivot(); - } // function getDoublePivot() - - - /** - * Is the matrix nonsingular? - * - * @return true if U, and hence A, is nonsingular. - */ - public function isNonsingular() { - for ($j = 0; $j < $this->n; ++$j) { - if ($this->LU[$j][$j] == 0) { - return false; - } - } - return true; - } // function isNonsingular() - - - /** - * Count determinants - * - * @return array d matrix deterninat - */ - public function det() { - if ($this->m == $this->n) { - $d = $this->pivsign; - for ($j = 0; $j < $this->n; ++$j) { - $d *= $this->LU[$j][$j]; - } - return $d; - } else { - throw new Exception(PHPExcel_Shared_JAMA_Matrix::MatrixDimensionException); - } - } // function det() - - - /** - * Solve A*X = B - * - * @param $B A Matrix with as many rows as A and any number of columns. - * @return X so that L*U*X = B(piv,:) - * @exception IllegalArgumentException Matrix row dimensions must agree. - * @exception RuntimeException Matrix is singular. - */ - public function solve($B) { - if ($B->getRowDimension() == $this->m) { - if ($this->isNonsingular()) { - // Copy right hand side with pivoting - $nx = $B->getColumnDimension(); - $X = $B->getMatrix($this->piv, 0, $nx-1); - // Solve L*Y = B(piv,:) - for ($k = 0; $k < $this->n; ++$k) { - for ($i = $k+1; $i < $this->n; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; - } - } - } - // Solve U*X = Y; - for ($k = $this->n-1; $k >= 0; --$k) { - for ($j = 0; $j < $nx; ++$j) { - $X->A[$k][$j] /= $this->LU[$k][$k]; - } - for ($i = 0; $i < $k; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k]; - } - } - } - return $X; - } else { - throw new Exception(self::MatrixSingularException); - } - } else { - throw new Exception(self::MatrixSquareException); - } - } // function solve() - -} // class PHPExcel_Shared_JAMA_LUDecomposition diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/Matrix.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/Matrix.php deleted file mode 100644 index aae40e4c57..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/Matrix.php +++ /dev/null @@ -1,1059 +0,0 @@ -<?php -/** - * @package JAMA - */ - -/** PHPExcel root directory */ -if (!defined('PHPEXCEL_ROOT')) { - /** - * @ignore - */ - define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../../'); - require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); -} - - -/* - * Matrix class - * - * @author Paul Meagher - * @author Michael Bommarito - * @author Lukasz Karapuda - * @author Bartek Matosiuk - * @version 1.8 - * @license PHP v3.0 - * @see http://math.nist.gov/javanumerics/jama/ - */ -class PHPExcel_Shared_JAMA_Matrix { - - - const PolymorphicArgumentException = "Invalid argument pattern for polymorphic function."; - const ArgumentTypeException = "Invalid argument type."; - const ArgumentBoundsException = "Invalid argument range."; - const MatrixDimensionException = "Matrix dimensions are not equal."; - const ArrayLengthException = "Array length must be a multiple of m."; - - /** - * Matrix storage - * - * @var array - * @access public - */ - public $A = array(); - - /** - * Matrix row dimension - * - * @var int - * @access private - */ - private $m; - - /** - * Matrix column dimension - * - * @var int - * @access private - */ - private $n; - - - /** - * Polymorphic constructor - * - * As PHP has no support for polymorphic constructors, we hack our own sort of polymorphism using func_num_args, func_get_arg, and gettype. In essence, we're just implementing a simple RTTI filter and calling the appropriate constructor. - */ - public function __construct() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - //Rectangular matrix - m x n initialized from 2D array - case 'array': - $this->m = count($args[0]); - $this->n = count($args[0][0]); - $this->A = $args[0]; - break; - //Square matrix - n x n - case 'integer': - $this->m = $args[0]; - $this->n = $args[0]; - $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); - break; - //Rectangular matrix - m x n - case 'integer,integer': - $this->m = $args[0]; - $this->n = $args[1]; - $this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0)); - break; - //Rectangular matrix - m x n initialized from packed array - case 'array,integer': - $this->m = $args[1]; - if ($this->m != 0) { - $this->n = count($args[0]) / $this->m; - } else { - $this->n = 0; - } - if (($this->m * $this->n) == count($args[0])) { - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $this->A[$i][$j] = $args[0][$i + $j * $this->m]; - } - } - } else { - throw new Exception(self::ArrayLengthException); - } - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function __construct() - - - /** - * getArray - * - * @return array Matrix array - */ - public function getArray() { - return $this->A; - } // function getArray() - - - /** - * getRowDimension - * - * @return int Row dimension - */ - public function getRowDimension() { - return $this->m; - } // function getRowDimension() - - - /** - * getColumnDimension - * - * @return int Column dimension - */ - public function getColumnDimension() { - return $this->n; - } // function getColumnDimension() - - - /** - * get - * - * Get the i,j-th element of the matrix. - * @param int $i Row position - * @param int $j Column position - * @return mixed Element (int/float/double) - */ - public function get($i = null, $j = null) { - return $this->A[$i][$j]; - } // function get() - - - /** - * getMatrix - * - * Get a submatrix - * @param int $i0 Initial row index - * @param int $iF Final row index - * @param int $j0 Initial column index - * @param int $jF Final column index - * @return Matrix Submatrix - */ - public function getMatrix() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - //A($i0...; $j0...) - case 'integer,integer': - list($i0, $j0) = $args; - if ($i0 >= 0) { $m = $this->m - $i0; } else { throw new Exception(self::ArgumentBoundsException); } - if ($j0 >= 0) { $n = $this->n - $j0; } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); - for($i = $i0; $i < $this->m; ++$i) { - for($j = $j0; $j < $this->n; ++$j) { - $R->set($i, $j, $this->A[$i][$j]); - } - } - return $R; - break; - //A($i0...$iF; $j0...$jF) - case 'integer,integer,integer,integer': - list($i0, $iF, $j0, $jF) = $args; - if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new Exception(self::ArgumentBoundsException); } - if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1); - for($i = $i0; $i <= $iF; ++$i) { - for($j = $j0; $j <= $jF; ++$j) { - $R->set($i - $i0, $j - $j0, $this->A[$i][$j]); - } - } - return $R; - break; - //$R = array of row indices; $C = array of column indices - case 'array,array': - list($RL, $CL) = $args; - if (count($RL) > 0) { $m = count($RL); } else { throw new Exception(self::ArgumentBoundsException); } - if (count($CL) > 0) { $n = count($CL); } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); - for($i = 0; $i < $m; ++$i) { - for($j = 0; $j < $n; ++$j) { - $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]); - } - } - return $R; - break; - //$RL = array of row indices; $CL = array of column indices - case 'array,array': - list($RL, $CL) = $args; - if (count($RL) > 0) { $m = count($RL); } else { throw new Exception(self::ArgumentBoundsException); } - if (count($CL) > 0) { $n = count($CL); } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); - for($i = 0; $i < $m; ++$i) { - for($j = 0; $j < $n; ++$j) { - $R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]); - } - } - return $R; - break; - //A($i0...$iF); $CL = array of column indices - case 'integer,integer,array': - list($i0, $iF, $CL) = $args; - if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new Exception(self::ArgumentBoundsException); } - if (count($CL) > 0) { $n = count($CL); } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); - for($i = $i0; $i < $iF; ++$i) { - for($j = 0; $j < $n; ++$j) { - $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]); - } - } - return $R; - break; - //$RL = array of row indices - case 'array,integer,integer': - list($RL, $j0, $jF) = $args; - if (count($RL) > 0) { $m = count($RL); } else { throw new Exception(self::ArgumentBoundsException); } - if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new Exception(self::ArgumentBoundsException); } - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1); - for($i = 0; $i < $m; ++$i) { - for($j = $j0; $j <= $jF; ++$j) { - $R->set($i, $j - $j0, $this->A[$RL[$i]][$j]); - } - } - return $R; - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function getMatrix() - - - /** - * checkMatrixDimensions - * - * Is matrix B the same size? - * @param Matrix $B Matrix B - * @return boolean - */ - public function checkMatrixDimensions($B = null) { - if ($B instanceof PHPExcel_Shared_JAMA_Matrix) { - if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) { - return true; - } else { - throw new Exception(self::MatrixDimensionException); - } - } else { - throw new Exception(self::ArgumentTypeException); - } - } // function checkMatrixDimensions() - - - - /** - * set - * - * Set the i,j-th element of the matrix. - * @param int $i Row position - * @param int $j Column position - * @param mixed $c Int/float/double value - * @return mixed Element (int/float/double) - */ - public function set($i = null, $j = null, $c = null) { - // Optimized set version just has this - $this->A[$i][$j] = $c; - } // function set() - - - /** - * identity - * - * Generate an identity matrix. - * @param int $m Row dimension - * @param int $n Column dimension - * @return Matrix Identity matrix - */ - public function identity($m = null, $n = null) { - return $this->diagonal($m, $n, 1); - } // function identity() - - - /** - * diagonal - * - * Generate a diagonal matrix - * @param int $m Row dimension - * @param int $n Column dimension - * @param mixed $c Diagonal value - * @return Matrix Diagonal matrix - */ - public function diagonal($m = null, $n = null, $c = 1) { - $R = new PHPExcel_Shared_JAMA_Matrix($m, $n); - for($i = 0; $i < $m; ++$i) { - $R->set($i, $i, $c); - } - return $R; - } // function diagonal() - - - /** - * getMatrixByRow - * - * Get a submatrix by row index/range - * @param int $i0 Initial row index - * @param int $iF Final row index - * @return Matrix Submatrix - */ - public function getMatrixByRow($i0 = null, $iF = null) { - if (is_int($i0)) { - if (is_int($iF)) { - return $this->getMatrix($i0, 0, $iF + 1, $this->n); - } else { - return $this->getMatrix($i0, 0, $i0 + 1, $this->n); - } - } else { - throw new Exception(self::ArgumentTypeException); - } - } // function getMatrixByRow() - - - /** - * getMatrixByCol - * - * Get a submatrix by column index/range - * @param int $i0 Initial column index - * @param int $iF Final column index - * @return Matrix Submatrix - */ - public function getMatrixByCol($j0 = null, $jF = null) { - if (is_int($j0)) { - if (is_int($jF)) { - return $this->getMatrix(0, $j0, $this->m, $jF + 1); - } else { - return $this->getMatrix(0, $j0, $this->m, $j0 + 1); - } - } else { - throw new Exception(self::ArgumentTypeException); - } - } // function getMatrixByCol() - - - /** - * transpose - * - * Tranpose matrix - * @return Matrix Transposed matrix - */ - public function transpose() { - $R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $R->set($j, $i, $this->A[$i][$j]); - } - } - return $R; - } // function transpose() - - - /** - * trace - * - * Sum of diagonal elements - * @return float Sum of diagonal elements - */ - public function trace() { - $s = 0; - $n = min($this->m, $this->n); - for($i = 0; $i < $n; ++$i) { - $s += $this->A[$i][$i]; - } - return $s; - } // function trace() - - - /** - * uminus - * - * Unary minus matrix -A - * @return Matrix Unary minus matrix - */ - public function uminus() { - } // function uminus() - - - /** - * plus - * - * A + B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function plus() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]); - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function plus() - - - /** - * plusEquals - * - * A = A + B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function plusEquals() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $validValues = True; - $value = $M->get($i, $j); - if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); - } - if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { - $value = trim($value,'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); - } - if ($validValues) { - $this->A[$i][$j] += $value; - } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); - } - } - } - return $this; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function plusEquals() - - - /** - * minus - * - * A - B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function minus() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]); - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function minus() - - - /** - * minusEquals - * - * A = A - B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function minusEquals() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $validValues = True; - $value = $M->get($i, $j); - if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); - } - if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { - $value = trim($value,'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); - } - if ($validValues) { - $this->A[$i][$j] -= $value; - } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); - } - } - } - return $this; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function minusEquals() - - - /** - * arrayTimes - * - * Element-by-element multiplication - * Cij = Aij * Bij - * @param mixed $B Matrix/Array - * @return Matrix Matrix Cij - */ - public function arrayTimes() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]); - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayTimes() - - - /** - * arrayTimesEquals - * - * Element-by-element multiplication - * Aij = Aij * Bij - * @param mixed $B Matrix/Array - * @return Matrix Matrix Aij - */ - public function arrayTimesEquals() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $validValues = True; - $value = $M->get($i, $j); - if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); - } - if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { - $value = trim($value,'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); - } - if ($validValues) { - $this->A[$i][$j] *= $value; - } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); - } - } - } - return $this; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayTimesEquals() - - - /** - * arrayRightDivide - * - * Element-by-element right division - * A / B - * @param Matrix $B Matrix B - * @return Matrix Division result - */ - public function arrayRightDivide() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $validValues = True; - $value = $M->get($i, $j); - if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); - } - if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { - $value = trim($value,'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); - } - if ($validValues) { - if ($value == 0) { - // Trap for Divide by Zero error - $M->set($i, $j, '#DIV/0!'); - } else { - $M->set($i, $j, $this->A[$i][$j] / $value); - } - } else { - $M->set($i, $j, PHPExcel_Calculation_Functions::NaN()); - } - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayRightDivide() - - - /** - * arrayRightDivideEquals - * - * Element-by-element right division - * Aij = Aij / Bij - * @param mixed $B Matrix/Array - * @return Matrix Matrix Aij - */ - public function arrayRightDivideEquals() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j); - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayRightDivideEquals() - - - /** - * arrayLeftDivide - * - * Element-by-element Left division - * A / B - * @param Matrix $B Matrix B - * @return Matrix Division result - */ - public function arrayLeftDivide() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]); - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayLeftDivide() - - - /** - * arrayLeftDivideEquals - * - * Element-by-element Left division - * Aij = Aij / Bij - * @param mixed $B Matrix/Array - * @return Matrix Matrix Aij - */ - public function arrayLeftDivideEquals() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j]; - } - } - return $M; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function arrayLeftDivideEquals() - - - /** - * times - * - * Matrix multiplication - * @param mixed $n Matrix/Array/Scalar - * @return Matrix Product - */ - public function times() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $B = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - if ($this->n == $B->m) { - $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); - for($j = 0; $j < $B->n; ++$j) { - for ($k = 0; $k < $this->n; ++$k) { - $Bcolj[$k] = $B->A[$k][$j]; - } - for($i = 0; $i < $this->m; ++$i) { - $Arowi = $this->A[$i]; - $s = 0; - for($k = 0; $k < $this->n; ++$k) { - $s += $Arowi[$k] * $Bcolj[$k]; - } - $C->A[$i][$j] = $s; - } - } - return $C; - } else { - throw new Exception(JAMAError(MatrixDimensionMismatch)); - } - break; - case 'array': - $B = new PHPExcel_Shared_JAMA_Matrix($args[0]); - if ($this->n == $B->m) { - $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n); - for($i = 0; $i < $C->m; ++$i) { - for($j = 0; $j < $C->n; ++$j) { - $s = "0"; - for($k = 0; $k < $C->n; ++$k) { - $s += $this->A[$i][$k] * $B->A[$k][$j]; - } - $C->A[$i][$j] = $s; - } - } - return $C; - } else { - throw new Exception(JAMAError(MatrixDimensionMismatch)); - } - return $M; - break; - case 'integer': - $C = new PHPExcel_Shared_JAMA_Matrix($this->A); - for($i = 0; $i < $C->m; ++$i) { - for($j = 0; $j < $C->n; ++$j) { - $C->A[$i][$j] *= $args[0]; - } - } - return $C; - break; - case 'double': - $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n); - for($i = 0; $i < $C->m; ++$i) { - for($j = 0; $j < $C->n; ++$j) { - $C->A[$i][$j] = $args[0] * $this->A[$i][$j]; - } - } - return $C; - break; - case 'float': - $C = new PHPExcel_Shared_JAMA_Matrix($this->A); - for($i = 0; $i < $C->m; ++$i) { - for($j = 0; $j < $C->n; ++$j) { - $C->A[$i][$j] *= $args[0]; - } - } - return $C; - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function times() - - - /** - * power - * - * A = A ^ B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function power() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - break; - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $validValues = True; - $value = $M->get($i, $j); - if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]); - } - if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) { - $value = trim($value,'"'); - $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value); - } - if ($validValues) { - $this->A[$i][$j] = pow($this->A[$i][$j],$value); - } else { - $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN(); - } - } - } - return $this; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function power() - - - /** - * concat - * - * A = A & B - * @param mixed $B Matrix/Array - * @return Matrix Sum - */ - public function concat() { - if (func_num_args() > 0) { - $args = func_get_args(); - $match = implode(",", array_map('gettype', $args)); - - switch($match) { - case 'object': - if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) { $M = $args[0]; } else { throw new Exception(self::ArgumentTypeException); } - case 'array': - $M = new PHPExcel_Shared_JAMA_Matrix($args[0]); - break; - default: - throw new Exception(self::PolymorphicArgumentException); - break; - } - $this->checkMatrixDimensions($M); - for($i = 0; $i < $this->m; ++$i) { - for($j = 0; $j < $this->n; ++$j) { - $this->A[$i][$j] = trim($this->A[$i][$j],'"').trim($M->get($i, $j),'"'); - } - } - return $this; - } else { - throw new Exception(self::PolymorphicArgumentException); - } - } // function concat() - - - /** - * Solve A*X = B. - * - * @param Matrix $B Right hand side - * @return Matrix ... Solution if A is square, least squares solution otherwise - */ - public function solve($B) { - if ($this->m == $this->n) { - $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this); - return $LU->solve($B); - } else { - $QR = new QRDecomposition($this); - return $QR->solve($B); - } - } // function solve() - - - /** - * Matrix inverse or pseudoinverse. - * - * @return Matrix ... Inverse(A) if A is square, pseudoinverse otherwise. - */ - public function inverse() { - return $this->solve($this->identity($this->m, $this->m)); - } // function inverse() - - - /** - * det - * - * Calculate determinant - * @return float Determinant - */ - public function det() { - $L = new PHPExcel_Shared_JAMA_LUDecomposition($this); - return $L->det(); - } // function det() - - -} // class PHPExcel_Shared_JAMA_Matrix diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/QRDecomposition.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/QRDecomposition.php deleted file mode 100644 index 49293d7eca..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/QRDecomposition.php +++ /dev/null @@ -1,234 +0,0 @@ -<?php -/** - * @package JAMA - * - * For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n - * orthogonal matrix Q and an n-by-n upper triangular matrix R so that - * A = Q*R. - * - * The QR decompostion always exists, even if the matrix does not have - * full rank, so the constructor will never fail. The primary use of the - * QR decomposition is in the least squares solution of nonsquare systems - * of simultaneous linear equations. This will fail if isFullRank() - * returns false. - * - * @author Paul Meagher - * @license PHP v3.0 - * @version 1.1 - */ -class PHPExcel_Shared_JAMA_QRDecomposition { - - const MatrixRankException = "Can only perform operation on full-rank matrix."; - - /** - * Array for internal storage of decomposition. - * @var array - */ - private $QR = array(); - - /** - * Row dimension. - * @var integer - */ - private $m; - - /** - * Column dimension. - * @var integer - */ - private $n; - - /** - * Array for internal storage of diagonal of R. - * @var array - */ - private $Rdiag = array(); - - - /** - * QR Decomposition computed by Householder reflections. - * - * @param matrix $A Rectangular matrix - * @return Structure to access R and the Householder vectors and compute Q. - */ - public function __construct($A) { - if($A instanceof PHPExcel_Shared_JAMA_Matrix) { - // Initialize. - $this->QR = $A->getArrayCopy(); - $this->m = $A->getRowDimension(); - $this->n = $A->getColumnDimension(); - // Main loop. - for ($k = 0; $k < $this->n; ++$k) { - // Compute 2-norm of k-th column without under/overflow. - $nrm = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $nrm = hypo($nrm, $this->QR[$i][$k]); - } - if ($nrm != 0.0) { - // Form k-th Householder vector. - if ($this->QR[$k][$k] < 0) { - $nrm = -$nrm; - } - for ($i = $k; $i < $this->m; ++$i) { - $this->QR[$i][$k] /= $nrm; - } - $this->QR[$k][$k] += 1.0; - // Apply transformation to remaining columns. - for ($j = $k+1; $j < $this->n; ++$j) { - $s = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $s += $this->QR[$i][$k] * $this->QR[$i][$j]; - } - $s = -$s/$this->QR[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $this->QR[$i][$j] += $s * $this->QR[$i][$k]; - } - } - } - $this->Rdiag[$k] = -$nrm; - } - } else { - throw new Exception(PHPExcel_Shared_JAMA_Matrix::ArgumentTypeException); - } - } // function __construct() - - - /** - * Is the matrix full rank? - * - * @return boolean true if R, and hence A, has full rank, else false. - */ - public function isFullRank() { - for ($j = 0; $j < $this->n; ++$j) { - if ($this->Rdiag[$j] == 0) { - return false; - } - } - return true; - } // function isFullRank() - - - /** - * Return the Householder vectors - * - * @return Matrix Lower trapezoidal matrix whose columns define the reflections - */ - public function getH() { - for ($i = 0; $i < $this->m; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i >= $j) { - $H[$i][$j] = $this->QR[$i][$j]; - } else { - $H[$i][$j] = 0.0; - } - } - } - return new PHPExcel_Shared_JAMA_Matrix($H); - } // function getH() - - - /** - * Return the upper triangular factor - * - * @return Matrix upper triangular factor - */ - public function getR() { - for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - if ($i < $j) { - $R[$i][$j] = $this->QR[$i][$j]; - } elseif ($i == $j) { - $R[$i][$j] = $this->Rdiag[$i]; - } else { - $R[$i][$j] = 0.0; - } - } - } - return new PHPExcel_Shared_JAMA_Matrix($R); - } // function getR() - - - /** - * Generate and return the (economy-sized) orthogonal factor - * - * @return Matrix orthogonal factor - */ - public function getQ() { - for ($k = $this->n-1; $k >= 0; --$k) { - for ($i = 0; $i < $this->m; ++$i) { - $Q[$i][$k] = 0.0; - } - $Q[$k][$k] = 1.0; - for ($j = $k; $j < $this->n; ++$j) { - if ($this->QR[$k][$k] != 0) { - $s = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $s += $this->QR[$i][$k] * $Q[$i][$j]; - } - $s = -$s/$this->QR[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $Q[$i][$j] += $s * $this->QR[$i][$k]; - } - } - } - } - /* - for($i = 0; $i < count($Q); ++$i) { - for($j = 0; $j < count($Q); ++$j) { - if(! isset($Q[$i][$j]) ) { - $Q[$i][$j] = 0; - } - } - } - */ - return new PHPExcel_Shared_JAMA_Matrix($Q); - } // function getQ() - - - /** - * Least squares solution of A*X = B - * - * @param Matrix $B A Matrix with as many rows as A and any number of columns. - * @return Matrix Matrix that minimizes the two norm of Q*R*X-B. - */ - public function solve($B) { - if ($B->getRowDimension() == $this->m) { - if ($this->isFullRank()) { - // Copy right hand side - $nx = $B->getColumnDimension(); - $X = $B->getArrayCopy(); - // Compute Y = transpose(Q)*B - for ($k = 0; $k < $this->n; ++$k) { - for ($j = 0; $j < $nx; ++$j) { - $s = 0.0; - for ($i = $k; $i < $this->m; ++$i) { - $s += $this->QR[$i][$k] * $X[$i][$j]; - } - $s = -$s/$this->QR[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $X[$i][$j] += $s * $this->QR[$i][$k]; - } - } - } - // Solve R*X = Y; - for ($k = $this->n-1; $k >= 0; --$k) { - for ($j = 0; $j < $nx; ++$j) { - $X[$k][$j] /= $this->Rdiag[$k]; - } - for ($i = 0; $i < $k; ++$i) { - for ($j = 0; $j < $nx; ++$j) { - $X[$i][$j] -= $X[$k][$j]* $this->QR[$i][$k]; - } - } - } - $X = new PHPExcel_Shared_JAMA_Matrix($X); - return ($X->getMatrix(0, $this->n-1, 0, $nx)); - } else { - throw new Exception(self::MatrixRankException); - } - } else { - throw new Exception(PHPExcel_Shared_JAMA_Matrix::MatrixDimensionException); - } - } // function solve() - -} // PHPExcel_Shared_JAMA_class QRDecomposition diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/SingularValueDecomposition.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/SingularValueDecomposition.php deleted file mode 100644 index a4b096c595..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/SingularValueDecomposition.php +++ /dev/null @@ -1,526 +0,0 @@ -<?php -/** - * @package JAMA - * - * For an m-by-n matrix A with m >= n, the singular value decomposition is - * an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and - * an n-by-n orthogonal matrix V so that A = U*S*V'. - * - * The singular values, sigma[$k] = S[$k][$k], are ordered so that - * sigma[0] >= sigma[1] >= ... >= sigma[n-1]. - * - * The singular value decompostion always exists, so the constructor will - * never fail. The matrix condition number and the effective numerical - * rank can be computed from this decomposition. - * - * @author Paul Meagher - * @license PHP v3.0 - * @version 1.1 - */ -class SingularValueDecomposition { - - /** - * Internal storage of U. - * @var array - */ - private $U = array(); - - /** - * Internal storage of V. - * @var array - */ - private $V = array(); - - /** - * Internal storage of singular values. - * @var array - */ - private $s = array(); - - /** - * Row dimension. - * @var int - */ - private $m; - - /** - * Column dimension. - * @var int - */ - private $n; - - - /** - * Construct the singular value decomposition - * - * Derived from LINPACK code. - * - * @param $A Rectangular matrix - * @return Structure to access U, S and V. - */ - public function __construct($Arg) { - - // Initialize. - $A = $Arg->getArrayCopy(); - $this->m = $Arg->getRowDimension(); - $this->n = $Arg->getColumnDimension(); - $nu = min($this->m, $this->n); - $e = array(); - $work = array(); - $wantu = true; - $wantv = true; - $nct = min($this->m - 1, $this->n); - $nrt = max(0, min($this->n - 2, $this->m)); - - // Reduce A to bidiagonal form, storing the diagonal elements - // in s and the super-diagonal elements in e. - for ($k = 0; $k < max($nct,$nrt); ++$k) { - - if ($k < $nct) { - // Compute the transformation for the k-th column and - // place the k-th diagonal in s[$k]. - // Compute 2-norm of k-th column without under/overflow. - $this->s[$k] = 0; - for ($i = $k; $i < $this->m; ++$i) { - $this->s[$k] = hypo($this->s[$k], $A[$i][$k]); - } - if ($this->s[$k] != 0.0) { - if ($A[$k][$k] < 0.0) { - $this->s[$k] = -$this->s[$k]; - } - for ($i = $k; $i < $this->m; ++$i) { - $A[$i][$k] /= $this->s[$k]; - } - $A[$k][$k] += 1.0; - } - $this->s[$k] = -$this->s[$k]; - } - - for ($j = $k + 1; $j < $this->n; ++$j) { - if (($k < $nct) & ($this->s[$k] != 0.0)) { - // Apply the transformation. - $t = 0; - for ($i = $k; $i < $this->m; ++$i) { - $t += $A[$i][$k] * $A[$i][$j]; - } - $t = -$t / $A[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $A[$i][$j] += $t * $A[$i][$k]; - } - // Place the k-th row of A into e for the - // subsequent calculation of the row transformation. - $e[$j] = $A[$k][$j]; - } - } - - if ($wantu AND ($k < $nct)) { - // Place the transformation in U for subsequent back - // multiplication. - for ($i = $k; $i < $this->m; ++$i) { - $this->U[$i][$k] = $A[$i][$k]; - } - } - - if ($k < $nrt) { - // Compute the k-th row transformation and place the - // k-th super-diagonal in e[$k]. - // Compute 2-norm without under/overflow. - $e[$k] = 0; - for ($i = $k + 1; $i < $this->n; ++$i) { - $e[$k] = hypo($e[$k], $e[$i]); - } - if ($e[$k] != 0.0) { - if ($e[$k+1] < 0.0) { - $e[$k] = -$e[$k]; - } - for ($i = $k + 1; $i < $this->n; ++$i) { - $e[$i] /= $e[$k]; - } - $e[$k+1] += 1.0; - } - $e[$k] = -$e[$k]; - if (($k+1 < $this->m) AND ($e[$k] != 0.0)) { - // Apply the transformation. - for ($i = $k+1; $i < $this->m; ++$i) { - $work[$i] = 0.0; - } - for ($j = $k+1; $j < $this->n; ++$j) { - for ($i = $k+1; $i < $this->m; ++$i) { - $work[$i] += $e[$j] * $A[$i][$j]; - } - } - for ($j = $k + 1; $j < $this->n; ++$j) { - $t = -$e[$j] / $e[$k+1]; - for ($i = $k + 1; $i < $this->m; ++$i) { - $A[$i][$j] += $t * $work[$i]; - } - } - } - if ($wantv) { - // Place the transformation in V for subsequent - // back multiplication. - for ($i = $k + 1; $i < $this->n; ++$i) { - $this->V[$i][$k] = $e[$i]; - } - } - } - } - - // Set up the final bidiagonal matrix or order p. - $p = min($this->n, $this->m + 1); - if ($nct < $this->n) { - $this->s[$nct] = $A[$nct][$nct]; - } - if ($this->m < $p) { - $this->s[$p-1] = 0.0; - } - if ($nrt + 1 < $p) { - $e[$nrt] = $A[$nrt][$p-1]; - } - $e[$p-1] = 0.0; - // If required, generate U. - if ($wantu) { - for ($j = $nct; $j < $nu; ++$j) { - for ($i = 0; $i < $this->m; ++$i) { - $this->U[$i][$j] = 0.0; - } - $this->U[$j][$j] = 1.0; - } - for ($k = $nct - 1; $k >= 0; --$k) { - if ($this->s[$k] != 0.0) { - for ($j = $k + 1; $j < $nu; ++$j) { - $t = 0; - for ($i = $k; $i < $this->m; ++$i) { - $t += $this->U[$i][$k] * $this->U[$i][$j]; - } - $t = -$t / $this->U[$k][$k]; - for ($i = $k; $i < $this->m; ++$i) { - $this->U[$i][$j] += $t * $this->U[$i][$k]; - } - } - for ($i = $k; $i < $this->m; ++$i ) { - $this->U[$i][$k] = -$this->U[$i][$k]; - } - $this->U[$k][$k] = 1.0 + $this->U[$k][$k]; - for ($i = 0; $i < $k - 1; ++$i) { - $this->U[$i][$k] = 0.0; - } - } else { - for ($i = 0; $i < $this->m; ++$i) { - $this->U[$i][$k] = 0.0; - } - $this->U[$k][$k] = 1.0; - } - } - } - - // If required, generate V. - if ($wantv) { - for ($k = $this->n - 1; $k >= 0; --$k) { - if (($k < $nrt) AND ($e[$k] != 0.0)) { - for ($j = $k + 1; $j < $nu; ++$j) { - $t = 0; - for ($i = $k + 1; $i < $this->n; ++$i) { - $t += $this->V[$i][$k]* $this->V[$i][$j]; - } - $t = -$t / $this->V[$k+1][$k]; - for ($i = $k + 1; $i < $this->n; ++$i) { - $this->V[$i][$j] += $t * $this->V[$i][$k]; - } - } - } - for ($i = 0; $i < $this->n; ++$i) { - $this->V[$i][$k] = 0.0; - } - $this->V[$k][$k] = 1.0; - } - } - - // Main iteration loop for the singular values. - $pp = $p - 1; - $iter = 0; - $eps = pow(2.0, -52.0); - - while ($p > 0) { - // Here is where a test for too many iterations would go. - // This section of the program inspects for negligible - // elements in the s and e arrays. On completion the - // variables kase and k are set as follows: - // kase = 1 if s(p) and e[k-1] are negligible and k<p - // kase = 2 if s(k) is negligible and k<p - // kase = 3 if e[k-1] is negligible, k<p, and - // s(k), ..., s(p) are not negligible (qr step). - // kase = 4 if e(p-1) is negligible (convergence). - for ($k = $p - 2; $k >= -1; --$k) { - if ($k == -1) { - break; - } - if (abs($e[$k]) <= $eps * (abs($this->s[$k]) + abs($this->s[$k+1]))) { - $e[$k] = 0.0; - break; - } - } - if ($k == $p - 2) { - $kase = 4; - } else { - for ($ks = $p - 1; $ks >= $k; --$ks) { - if ($ks == $k) { - break; - } - $t = ($ks != $p ? abs($e[$ks]) : 0.) + ($ks != $k + 1 ? abs($e[$ks-1]) : 0.); - if (abs($this->s[$ks]) <= $eps * $t) { - $this->s[$ks] = 0.0; - break; - } - } - if ($ks == $k) { - $kase = 3; - } else if ($ks == $p-1) { - $kase = 1; - } else { - $kase = 2; - $k = $ks; - } - } - ++$k; - - // Perform the task indicated by kase. - switch ($kase) { - // Deflate negligible s(p). - case 1: - $f = $e[$p-2]; - $e[$p-2] = 0.0; - for ($j = $p - 2; $j >= $k; --$j) { - $t = hypo($this->s[$j],$f); - $cs = $this->s[$j] / $t; - $sn = $f / $t; - $this->s[$j] = $t; - if ($j != $k) { - $f = -$sn * $e[$j-1]; - $e[$j-1] = $cs * $e[$j-1]; - } - if ($wantv) { - for ($i = 0; $i < $this->n; ++$i) { - $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$p-1]; - $this->V[$i][$p-1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$p-1]; - $this->V[$i][$j] = $t; - } - } - } - break; - // Split at negligible s(k). - case 2: - $f = $e[$k-1]; - $e[$k-1] = 0.0; - for ($j = $k; $j < $p; ++$j) { - $t = hypo($this->s[$j], $f); - $cs = $this->s[$j] / $t; - $sn = $f / $t; - $this->s[$j] = $t; - $f = -$sn * $e[$j]; - $e[$j] = $cs * $e[$j]; - if ($wantu) { - for ($i = 0; $i < $this->m; ++$i) { - $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$k-1]; - $this->U[$i][$k-1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$k-1]; - $this->U[$i][$j] = $t; - } - } - } - break; - // Perform one qr step. - case 3: - // Calculate the shift. - $scale = max(max(max(max( - abs($this->s[$p-1]),abs($this->s[$p-2])),abs($e[$p-2])), - abs($this->s[$k])), abs($e[$k])); - $sp = $this->s[$p-1] / $scale; - $spm1 = $this->s[$p-2] / $scale; - $epm1 = $e[$p-2] / $scale; - $sk = $this->s[$k] / $scale; - $ek = $e[$k] / $scale; - $b = (($spm1 + $sp) * ($spm1 - $sp) + $epm1 * $epm1) / 2.0; - $c = ($sp * $epm1) * ($sp * $epm1); - $shift = 0.0; - if (($b != 0.0) || ($c != 0.0)) { - $shift = sqrt($b * $b + $c); - if ($b < 0.0) { - $shift = -$shift; - } - $shift = $c / ($b + $shift); - } - $f = ($sk + $sp) * ($sk - $sp) + $shift; - $g = $sk * $ek; - // Chase zeros. - for ($j = $k; $j < $p-1; ++$j) { - $t = hypo($f,$g); - $cs = $f/$t; - $sn = $g/$t; - if ($j != $k) { - $e[$j-1] = $t; - } - $f = $cs * $this->s[$j] + $sn * $e[$j]; - $e[$j] = $cs * $e[$j] - $sn * $this->s[$j]; - $g = $sn * $this->s[$j+1]; - $this->s[$j+1] = $cs * $this->s[$j+1]; - if ($wantv) { - for ($i = 0; $i < $this->n; ++$i) { - $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$j+1]; - $this->V[$i][$j+1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$j+1]; - $this->V[$i][$j] = $t; - } - } - $t = hypo($f,$g); - $cs = $f/$t; - $sn = $g/$t; - $this->s[$j] = $t; - $f = $cs * $e[$j] + $sn * $this->s[$j+1]; - $this->s[$j+1] = -$sn * $e[$j] + $cs * $this->s[$j+1]; - $g = $sn * $e[$j+1]; - $e[$j+1] = $cs * $e[$j+1]; - if ($wantu && ($j < $this->m - 1)) { - for ($i = 0; $i < $this->m; ++$i) { - $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$j+1]; - $this->U[$i][$j+1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$j+1]; - $this->U[$i][$j] = $t; - } - } - } - $e[$p-2] = $f; - $iter = $iter + 1; - break; - // Convergence. - case 4: - // Make the singular values positive. - if ($this->s[$k] <= 0.0) { - $this->s[$k] = ($this->s[$k] < 0.0 ? -$this->s[$k] : 0.0); - if ($wantv) { - for ($i = 0; $i <= $pp; ++$i) { - $this->V[$i][$k] = -$this->V[$i][$k]; - } - } - } - // Order the singular values. - while ($k < $pp) { - if ($this->s[$k] >= $this->s[$k+1]) { - break; - } - $t = $this->s[$k]; - $this->s[$k] = $this->s[$k+1]; - $this->s[$k+1] = $t; - if ($wantv AND ($k < $this->n - 1)) { - for ($i = 0; $i < $this->n; ++$i) { - $t = $this->V[$i][$k+1]; - $this->V[$i][$k+1] = $this->V[$i][$k]; - $this->V[$i][$k] = $t; - } - } - if ($wantu AND ($k < $this->m-1)) { - for ($i = 0; $i < $this->m; ++$i) { - $t = $this->U[$i][$k+1]; - $this->U[$i][$k+1] = $this->U[$i][$k]; - $this->U[$i][$k] = $t; - } - } - ++$k; - } - $iter = 0; - --$p; - break; - } // end switch - } // end while - - } // end constructor - - - /** - * Return the left singular vectors - * - * @access public - * @return U - */ - public function getU() { - return new Matrix($this->U, $this->m, min($this->m + 1, $this->n)); - } - - - /** - * Return the right singular vectors - * - * @access public - * @return V - */ - public function getV() { - return new Matrix($this->V); - } - - - /** - * Return the one-dimensional array of singular values - * - * @access public - * @return diagonal of S. - */ - public function getSingularValues() { - return $this->s; - } - - - /** - * Return the diagonal matrix of singular values - * - * @access public - * @return S - */ - public function getS() { - for ($i = 0; $i < $this->n; ++$i) { - for ($j = 0; $j < $this->n; ++$j) { - $S[$i][$j] = 0.0; - } - $S[$i][$i] = $this->s[$i]; - } - return new Matrix($S); - } - - - /** - * Two norm - * - * @access public - * @return max(S) - */ - public function norm2() { - return $this->s[0]; - } - - - /** - * Two norm condition number - * - * @access public - * @return max(S)/min(S) - */ - public function cond() { - return $this->s[0] / $this->s[min($this->m, $this->n) - 1]; - } - - - /** - * Effective numerical matrix rank - * - * @access public - * @return Number of nonnegligible singular values. - */ - public function rank() { - $eps = pow(2.0, -52.0); - $tol = max($this->m, $this->n) * $this->s[0] * $eps; - $r = 0; - for ($i = 0; $i < count($this->s); ++$i) { - if ($this->s[$i] > $tol) { - ++$r; - } - } - return $r; - } - -} // class SingularValueDecomposition diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/docs.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/docs.php deleted file mode 100644 index d27a42f76e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/docs.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -require_once "includes/header.php"; -require_once "includes/navbar.php"; -require_once "sections/Home.php"; -require_once "includes/footer.php"; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/download.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/download.php deleted file mode 100644 index 2df6e0c94e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/download.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** -* Script to create REGRESS package for download -* -* @author Mike Bommarito -* @author Paul Meagher -* @version 0.3 -* @modified Apr 2, 2006 -* -* Note: Script requires the PEAR Archive_Tar package be installed: -* -* @see http://pear.php.net/package/Archive_Tar -*/ - -// name and directory of package -$pkgName = "JAMA"; - -// root of PHP/Math build directory -$buildDir = substr(dirname(__FILE__), 0, -5 - strlen($pkgName)); - -// switch to PHP/Math build directory -chdir($buildDir); - -$tarName = "$pkgName.tar.gz"; - -$tarPath = $buildDir.$pkgName."/downloads/".$tarName; - -if($_GET['op'] == "download") { - - require_once('Archive/Tar.php'); - - $tar = new Archive_Tar($tarPath); - - // create $pkgName archive under $pkgName folder - $files = glob("$pkgName/*.php"); - $files = array_merge($files, glob("$pkgName/*.TXT")); - $files = array_merge($files, glob("$pkgName/docs/*.php")); - $files = array_merge($files, glob("$pkgName/docs/includes/*.php")); - $files = array_merge($files, glob("$pkgName/examples/*.php")); - $files = array_merge($files, glob("$pkgName/tests/*.php")); - $files = array_merge($files, glob("$pkgName/utils/*.php")); - - $tar->create($files); - - // create the download url - $webDir = substr($_SERVER['PHP_SELF'], 0, -18); - $urlPath = "http://".$_SERVER['HTTP_HOST'].$webDir."/downloads"; - - // redirect to download url - header("Location: $urlPath/$tarName"); - -} - -include_once "includes/header.php"; -include_once "includes/navbar.php"; -?> -<p> -Download current version: -</p> -<ul> - <li><a href='<?php echo $_SERVER['PHP_SELF']."?op=download"; ?>'><?php echo $tarName ?></a></li> -</ul> -<?php -include_once "includes/footer.php"; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/example.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/example.php deleted file mode 100644 index d76c0f5f43..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/example.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php -include_once "includes/header.php"; -include_once "includes/navbar.php"; -?> -<h2>Magic Square Example</h2> -<p> -The Jama distribution comes with a magic square example that is used to -test and benchmark the LU, QR, SVD and symmetric Eig decompositions. -The example outputs a multi-column table with these column headings: -</p> - -<table border='1' cellpadding='5' cellspacing='0' align='center'> - <tr> - <td><b>n</b></td> - <td>Order of magic square.</td> - </tr> - <tr> - <td><b>trace</b></td> - <td>Diagonal sum, should be the magic sum, (n^3 + n)/2.</td> - </tr> - <tr> - <td><b>max_eig</b></td> - <td>Maximum eigenvalue of (A + A')/2, should equal trace.</td> - </tr> - <tr> - <td><b>rank</b></td> - <td>Linear algebraic rank, should equal n if n is odd, be less than n if n is even.</td> - </tr> - <tr> - <td><b>cond</b></td> - <td>L_2 condition number, ratio of singular values.</td> - </tr> - <tr> - <td><b>lu_res</b></td> - <td>test of LU factorization, norm1(L*U-A(p,:))/(n*eps).</td> - </tr> - <tr> - <td><b>qr_res</b></td> - <td>test of QR factorization, norm1(Q*R-A)/(n*eps).</td> - </tr> -</table> -<p> -Running the Java-based version of the matix square example produces these results: -</p> - -<table border='1' align='center'> - <tr> - <th> n </th> - <th> trace </th> - <th> max_eig </th> - <th> rank </th> - <th> cond </th> - <th> lu_res </th> - <th> qr_res </th> - </tr> - <tr> - <td>3</td><td>15</td><td>15.000</td><td>3</td><td>4.330</td><td>0.000</td><td>11.333</td> - </tr> - <tr> - <td>4</td><td>34</td><td>34.000</td><td>3</td><td> Inf</td><td>0.000</td><td>13.500</td> - <tr> - <td>5</td><td>65</td><td>65.000</td><td>5</td><td>5.462</td><td>0.000</td><td>14.400</td> - </tr> - <tr> - <td>6</td><td>111</td><td>111.000</td><td>5</td><td> Inf</td><td>5.333</td><td>16.000</td> - </tr> - <tr> - <td>7</td><td>175</td><td>175.000</td><td>7</td><td>7.111</td><td>2.286</td><td>37.714</td> - </tr> - <tr> - <td>8</td><td>260</td><td>260.000</td><td>3</td><td> Inf</td><td>0.000</td><td>59.000</td> - </tr> - <tr> - <td>9</td><td>369</td><td>369.000</td><td>9</td><td>9.102</td><td>7.111</td><td>53.333</td> - </tr> - <tr> - <td>10</td><td>505</td><td>505.000</td><td>7</td><td> Inf</td><td>3.200</td><td>159.200</td> - </tr> - <tr> - <td>11</td><td>671</td><td>671.000</td><td>11</td><td>11.102</td><td>2.909</td><td>215.273</td> - </tr> - <tr> - <td>12</td><td>870</td><td>870.000</td><td>3</td><td> Inf</td><td>0.000</td><td>185.333</td> - </tr> - <tr> - <td>13</td><td>1105</td><td>1105.000</td><td>13</td><td>13.060</td><td>4.923</td><td>313.846</td> - </tr> - <tr> - <td>14</td><td>1379</td><td>1379.000</td><td>9</td><td> Inf</td><td>4.571</td><td>540.571</td> - </tr> - <tr> - <td>15</td><td>1695</td><td>1695.000</td><td>15</td><td>15.062</td><td>4.267</td><td>242.133</td> - </tr> - <tr> - <td>16</td><td>2056</td><td>2056.000</td><td>3</td><td> Inf</td><td>0.000</td><td>488.500</td> - </tr> - <tr> - <td>17</td><td>2465</td><td>2465.000</td><td>17</td><td>17.042</td><td>7.529</td><td>267.294</td> - </tr> - <tr> - <td>18</td><td>2925</td><td>2925.000</td><td>11</td><td> Inf</td><td>7.111</td><td>520.889</td> - </tr> - <tr> - <td>19</td><td>3439</td><td>3439.000</td><td>19</td><td>19.048</td><td>16.842</td><td>387.368</td> - </tr> - <tr> - <td>20</td><td>4010</td><td>4010.000</td><td>3</td><td> Inf</td><td>14.400</td><td>584.800</td> - </tr> - <tr> - <td>21</td><td>4641</td><td>4641.000</td><td>21</td><td>21.035</td><td>6.095</td><td>1158.095</td> - </tr> - <tr> - <td>22</td><td>5335</td><td>5335.000</td><td>13</td><td> Inf</td><td>6.545</td><td>1132.364</td> - </tr> - <tr> - <td>23</td><td>6095</td><td>6095.000</td><td>23</td><td>23.037</td><td>11.130</td><td>1268.870</td> - </tr> - <tr> - <td>24</td><td>6924</td><td>6924.000</td><td>3</td><td> Inf</td><td>10.667</td><td>827.500</td> - </tr> - <tr> - <td>25</td><td>7825</td><td>7825.000</td><td>25</td><td>25.029</td><td>35.840</td><td>1190.400</td> - </tr> - <tr> - <td>26</td><td>8801</td><td>8801.000</td><td>15</td><td> Inf</td><td>4.923</td><td>1859.077</td> - </tr> - <tr> - <td>27</td><td>9855</td><td>9855.000</td><td>27</td><td>27.032</td><td>37.926</td><td>1365.333</td> - </tr> - <tr> - <td>28</td><td>10990</td><td>10990.000</td><td>3</td><td> Inf</td><td>34.286</td><td>1365.714</td> - </tr> - <tr> - <td>29</td><td>12209</td><td>12209.000</td><td>29</td><td>29.025</td><td>30.897</td><td>1647.448</td> - </tr> - <tr> - <td>30</td><td>13515</td><td>13515.000</td><td>17</td><td> Inf</td><td>8.533</td><td>2571.733</td> - </tr> - <tr> - <td>31</td><td>14911</td><td>14911.000</td><td>31</td><td>31.027</td><td>33.032</td><td>1426.581</td> - </tr> - <tr> - <td>32</td><td>16400</td><td>16400.000</td><td>3</td><td> Inf</td><td>0.000</td><td>1600.125</td> - </tr> -</table> -<center>Elapsed Time = 0.710 seconds</center> - -<p> -The magic square example does not fare well when <a href='../examples/MagicSquareExample.php'>run as a PHP script</a>. For a 32x32 matrix array -it takes around a second to complete just the last row of computations in the above table. -Hopefully this result will spur PHP developers to find optimizations and better attuned algorithms -to speed things up. Matrix algebra is a great testing ground for ideas about time and memory -performance optimation. Keep in perspective that PHP JAMA scripts are still plenty fast for use as -a tool for learning about matrix algebra and quickly extending your knowledge with new scripts -to apply knowledge. -</p> - -<p> -To learn more about the subject of magic squares you can visit the <a href='http://mathforum.org/alejandre/magic.square.html'>Drexel Math Forum on Magic Squares</a>. -You can also learn more by carefully examining the <code>MagicSquareExample.php</code> source code below. -</p> - -<?php -highlight_file("../examples/MagicSquareExample.php"); -include_once "includes/footer.php"; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/credits.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/credits.php deleted file mode 100644 index efc91c228c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/credits.php +++ /dev/null @@ -1,14 +0,0 @@ - <div id="credits"> - <p> - Brought to you by: - </p> - <ul> - <li><a href="http://math.nist.gov/">National Institute of Standards and Technology</a></li> - <li><a href="http://math.nist.gov/">MathWorks</a></li> - <li><a href="http://math.nist.gov/javanumerics/jama/">JAMA : A Java Matrix Package</a></li> - <li>Paul Meagher</li> - <li>Michael Bommarito</li> - <li>Lukasz Karapuda</li> - <li>Bartek Matosiuk</li> - </ul> - </div> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/footer.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/footer.php deleted file mode 100644 index 7fb2bd61bf..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/footer.php +++ /dev/null @@ -1,2 +0,0 @@ - </body> -</html> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/header.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/header.php deleted file mode 100644 index 10d32a3254..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/header.php +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> - <head> - <title>JAMA v1.0.1</title> - <meta name="description" content="JAMA v1.0.1 - Port of the proposed standard Java Matrix Library to PHP" /> - <meta name="robots" content="index, follow" /> - <meta name="keywords" content="php, matrix, matrix library, cholesky decomposition, eigenvalue decomposition, eigenvector, lu decomposition, qr decomposition, singular value decomposition" /> - <link rel="stylesheet" type="text/css" href="style.css" /> - </head> - <body> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/navbar.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/navbar.php deleted file mode 100644 index 873d34d6f4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/includes/navbar.php +++ /dev/null @@ -1,5 +0,0 @@ -<center> - <hr /> - [ <a href="index.php">index.php</a> ] [ <a href="docs.php">docs.php</a> ] [ <a href="package.php">package.php</a> ] [ <a href="test.php">test.php</a> ] [ <a href="example.php">example.php</a> ] [ <a href="download.php">download.php</a> ] - <hr /> -</center> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/index.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/index.php deleted file mode 100644 index 42a491e583..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/index.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include_once "includes/header.php"; -include_once "includes/navbar.php"; -?> - -<p> -JAMA is a proposed standard matrix class for Java. The JAMA introduction -describes "JAMA : A Java Matrix Package" in this way: -</p> - -<blockquote> -JAMA is a basic linear algebra package for Java. It provides user-level classes for -constructing and manipulating real, dense matrices. It is meant to provide sufficient -functionality for routine problems, packaged in a way that is natural and understandable -to non-experts. It is intended to serve as the standard matrix class for Java, and -will be proposed as such to the Java Grande Forum and then to Sun. A straightforward -public-domain reference implementation has been developed by the MathWorks and NIST as -a strawman for such a class. We are releasing this version in order to obtain public -comment. There is no guarantee that future versions of JAMA will be compatible with this one. -</blockquote> - -<p> -The development team below has successfully ported the JAMA API to PHP. You can explore -this site to learn more about this project and it's current development status. -</p> - -<?php -include_once "includes/credits.php"; -include_once "includes/footer.php"; -?> \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/package.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/package.php deleted file mode 100644 index 07f84929b5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/package.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -include_once "includes/header.php"; -include_once "includes/navbar.php"; -?> -<p> -Source Listing: -</p> -<ul> - <?php - chdir("../"); - $files = glob("*.php"); - $files = array_merge($files, glob("util/*.php")); - foreach ($files as $fileName) { - ?> - <li><a href="package.php?view=<?php echo sha1($fileName);?>"><?php echo $fileName;?></a>&nbsp;-&nbsp;<?php echo date ("F d Y - g:i a", filemtime($fileName));?></li> - <?php - } - ?> -</ul> -<?php -if( isset($_REQUEST['view']) ) { - $hash = $_REQUEST['view']; - $n = array_search($hash, array_map(sha1, $files)); - $fileName = $files[$n]; - ?> - <hr /> - Viewing: <?php echo $fileName;?> - <hr /> - <?php - highlight_file($fileName); - ?> - <hr /> -<?php -} -include_once "includes/footer.php"; -?> - diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/test.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/test.php deleted file mode 100644 index d5478a0562..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/docs/test.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -include_once "includes/header.php"; -include_once "includes/navbar.php"; -?> -<p> -The first script your should run when you install Jama is the TestMatrix.php script. -</p> -<p> -This will run the unit tests for methods in the <code>Matrix.php</code> class. Because -the Matrix.php class can be used to invoke all the decomposition methods the <code>TestMatrix.php</code> -script is a test suite for the whole Jama package. -</p> -<p> -The original <code>TestMatrix.java</code> code uses try/catch error handling. We will -eventually create a build of JAMA that will take advantage of PHP5's new try/catch error -handling capabilities. This will improve our ability to replicate all the unit tests that -appeared in the original (except for some print methods that may not be worth porting). -</p> -<p> -You can <a href='../test/TestMatrix.php'>run the TestMatrix.php script</a> to see what -unit tests are currently implemented. The source of the <code>TestMatrix.php</code> script -is provided below. It is worth studying carefully for an example of how to do matrix algebra -programming with Jama. -</p> -<?php -highlight_file("../test/TestMatrix.php"); -include_once "includes/footer.php"; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LMQuadTest.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LMQuadTest.php deleted file mode 100644 index 2f316de973..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LMQuadTest.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -/** - * quadratic (p-o)'S'S(p-o) - * solve for o, S - * S is a single scale factor - */ -class LMQuadTest { - - /** - * @param array[] $x - * @param array[] $a - */ - function val($x, $a) { - if (count($a) != 3) die ("Wrong number of elements in array a"); - if (count($x) != 2) die ("Wrong number of elements in array x"); - - $ox = $a[0]; - $oy = $a[1]; - $s = $a[2]; - - $sdx = $s * ($x[0] - $ox); - $sdy = $s * ($x[1] - $oy); - - return ($sdx * $sdx) + ($sdy * $sdy); - } // function val() - - - /** - * z = (p-o)'S'S(p-o) - * dz/dp = 2S'S(p-o) - * - * z = (s*(px-ox))^2 + (s*(py-oy))^2 - * dz/dox = -2(s*(px-ox))*s - * dz/ds = 2*s*[(px-ox)^2 + (py-oy)^2] - * - * z = (s*dx)^2 + (s*dy)^2 - * dz/ds = 2(s*dx)*dx + 2(s*dy)*dy - * - * @param array[] $x - * @param array[] $a - * @param int $a_k - * @param array[] $a - */ - function grad($x, $a, $a_k) { - if (count($a) != 3) die ("Wrong number of elements in array a"); - if (count($x) != 2) die ("Wrong number of elements in array x"); - if ($a_k < 3) die ("a_k=".$a_k); - - $ox = $a[0]; - $oy = $a[1]; - $s = $a[2]; - - $dx = ($x[0] - $ox); - $dy = ($x[1] - $oy); - - if ($a_k == 0) - return -2.*$s*$s*$dx; - elseif ($a_k == 1) - return -2.*$s*$s*$dy; - else - return 2.*$s*($dx*$dx + $dy*$dy); - } // function grad() - - - /** - * @return array[] $a - */ - function initial() { - $a[0] = 0.05; - $a[1] = 0.1; - $a[2] = 1.0; - - return $a; - } // function initial() - - - /** - * @return Object[] $a - */ - function testdata() { - $npts = 25; - - $a[0] = 0.; - $a[1] = 0.; - $a[2] = 0.9; - - $i = 0; - - for ($r = -2; $r <= 2; ++$r) { - for ($c = -2; $c <= 2; ++$c) { - $x[$i][0] = $c; - $x[$i][1] = $r; - $y[$i] = $this->val($x[$i], $a); - print("Quad ".$c.",".$r." -> ".$y[$i]."<br />"); - $s[$i] = 1.; - ++$i; - } - } - print("quad x= "); - - $qx = new Matrix($x); - $qx->print(10, 2); - - print("quad y= "); - $qy = new Matrix($y, $npts); - $qy->print(10, 2); - - $o[0] = $x; - $o[1] = $a; - $o[2] = $y; - $o[3] = $s; - - return $o; - } // function testdata() - -} // class LMQuadTest diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation.php deleted file mode 100644 index 5b74286135..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -require_once "../Matrix.php"; - -/** - * Given n points (x0,y0)...(xn-1,yn-1), the following methid computes - * the polynomial factors of the n-1't degree polynomial passing through - * the n points. - * - * Example: Passing in three points (2,3) (1,4) and (3,7) will produce - * the results [2.5, -8.5, 10] which means that the points are on the - * curve y = 2.5x² - 8.5x + 10. - * - * @see http://geosoft.no/software/lagrange/LagrangeInterpolation.java.html - * @author Jacob Dreyer - * @author Paul Meagher (port to PHP and minor changes) - * - * @param x[] float - * @param y[] float - */ -class LagrangeInterpolation { - - public function findPolynomialFactors($x, $y) { - $n = count($x); - - $data = array(); // double[n][n]; - $rhs = array(); // double[n]; - - for ($i = 0; $i < $n; ++$i) { - $v = 1; - for ($j = 0; $j < $n; ++$j) { - $data[$i][$n-$j-1] = $v; - $v *= $x[$i]; - } - $rhs[$i] = $y[$i]; - } - - // Solve m * s = b - $m = new Matrix($data); - $b = new Matrix($rhs, $n); - - $s = $m->solve($b); - - return $s->getRowPackedCopy(); - } // function findPolynomialFactors() - -} // class LagrangeInterpolation - - -$x = array(2.0, 1.0, 3.0); -$y = array(3.0, 4.0, 7.0); - -$li = new LagrangeInterpolation; -$f = $li->findPolynomialFactors($x, $y); - - -for ($i = 0; $i < 3; ++$i) { - echo $f[$i]."<br />"; -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation2.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation2.php deleted file mode 100644 index e7529c5f16..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LagrangeInterpolation2.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -require_once "../Matrix.php"; - -/** - * Given n points (x0,y0)...(xn-1,yn-1), the following method computes - * the polynomial factors of the n-1't degree polynomial passing through - * the n points. - * - * Example: Passing in three points (2,3) (1,4) and (3,7) will produce - * the results [2.5, -8.5, 10] which means that the points are on the - * curve y = 2.5x² - 8.5x + 10. - * - * @see http://geosoft.no/software/lagrange/LagrangeInterpolation.java.html - * @see http://source.freehep.org/jcvsweb/ilc/LCSIM/wdview/lcsim/src/org/lcsim/fit/polynomial/PolynomialFitter.java - * @author Jacob Dreyer - * @author Paul Meagher (port to PHP and minor changes) - * - * @param x[] float - * @param y[] float - */ -class LagrangeInterpolation { - - public function findPolynomialFactors($x, $y) { - $n = count($x); - - $data = array(); // double[n][n]; - $rhs = array(); // double[n]; - - for ($i = 0; $i < $n; ++$i) { - $v = 1; - for ($j = 0; $j < $n; ++$j) { - $data[$i][$n-$j-1] = $v; - $v *= $x[$i]; - } - $rhs[$i] = $y[$i]; - } - - // Solve m * s = b - $m = new Matrix($data); - $b = new Matrix($rhs, $n); - - $s = $m->solve($b); - - return $s->getRowPackedCopy(); - } // function findPolynomialFactors() - -} // class LagrangeInterpolation - - -$x = array(2.0, 1.0, 3.0); -$y = array(3.0, 4.0, 7.0); - -$li = new LagrangeInterpolation; -$f = $li->findPolynomialFactors($x, $y); - -for ($i = 0; $i < 3; ++$i) { - echo $f[$i]."<br />"; -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LevenbergMarquardt.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LevenbergMarquardt.php deleted file mode 100644 index 7cfd5f8997..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/LevenbergMarquardt.php +++ /dev/null @@ -1,185 +0,0 @@ -<?php - -// Levenberg-Marquardt in PHP - -// http://www.idiom.com/~zilla/Computer/Javanumeric/LM.java - -class LevenbergMarquardt { - - /** - * Calculate the current sum-squared-error - * - * Chi-squared is the distribution of squared Gaussian errors, - * thus the name. - * - * @param double[][] $x - * @param double[] $a - * @param double[] $y, - * @param double[] $s, - * @param object $f - */ - function chiSquared($x, $a, $y, $s, $f) { - $npts = count($y); - $sum = 0.0; - - for ($i = 0; $i < $npts; ++$i) { - $d = $y[$i] - $f->val($x[$i], $a); - $d = $d / $s[$i]; - $sum = $sum + ($d*$d); - } - - return $sum; - } // function chiSquared() - - - /** - * Minimize E = sum {(y[k] - f(x[k],a)) / s[k]}^2 - * The individual errors are optionally scaled by s[k]. - * Note that LMfunc implements the value and gradient of f(x,a), - * NOT the value and gradient of E with respect to a! - * - * @param x array of domain points, each may be multidimensional - * @param y corresponding array of values - * @param a the parameters/state of the model - * @param vary false to indicate the corresponding a[k] is to be held fixed - * @param s2 sigma^2 for point i - * @param lambda blend between steepest descent (lambda high) and - * jump to bottom of quadratic (lambda zero). - * Start with 0.001. - * @param termepsilon termination accuracy (0.01) - * @param maxiter stop and return after this many iterations if not done - * @param verbose set to zero (no prints), 1, 2 - * - * @return the new lambda for future iterations. - * Can use this and maxiter to interleave the LM descent with some other - * task, setting maxiter to something small. - */ - function solve($x, $a, $y, $s, $vary, $f, $lambda, $termepsilon, $maxiter, $verbose) { - $npts = count($y); - $nparm = count($a); - - if ($verbose > 0) { - print("solve x[".count($x)."][".count($x[0])."]"); - print(" a[".count($a)."]"); - println(" y[".count(length)."]"); - } - - $e0 = $this->chiSquared($x, $a, $y, $s, $f); - - //double lambda = 0.001; - $done = false; - - // g = gradient, H = hessian, d = step to minimum - // H d = -g, solve for d - $H = array(); - $g = array(); - - //double[] d = new double[nparm]; - - $oos2 = array(); - - for($i = 0; $i < $npts; ++$i) { - $oos2[$i] = 1./($s[$i]*$s[$i]); - } - $iter = 0; - $term = 0; // termination count test - - do { - ++$iter; - - // hessian approximation - for( $r = 0; $r < $nparm; ++$r) { - for( $c = 0; $c < $nparm; ++$c) { - for( $i = 0; $i < $npts; ++$i) { - if ($i == 0) $H[$r][$c] = 0.; - $xi = $x[$i]; - $H[$r][$c] += ($oos2[$i] * $f->grad($xi, $a, $r) * $f->grad($xi, $a, $c)); - } //npts - } //c - } //r - - // boost diagonal towards gradient descent - for( $r = 0; $r < $nparm; ++$r) - $H[$r][$r] *= (1. + $lambda); - - // gradient - for( $r = 0; $r < $nparm; ++$r) { - for( $i = 0; $i < $npts; ++$i) { - if ($i == 0) $g[$r] = 0.; - $xi = $x[$i]; - $g[$r] += ($oos2[$i] * ($y[$i]-$f->val($xi,$a)) * $f->grad($xi, $a, $r)); - } - } //npts - - // scale (for consistency with NR, not necessary) - if ($false) { - for( $r = 0; $r < $nparm; ++$r) { - $g[$r] = -0.5 * $g[$r]; - for( $c = 0; $c < $nparm; ++$c) { - $H[$r][$c] *= 0.5; - } - } - } - - // solve H d = -g, evaluate error at new location - //double[] d = DoubleMatrix.solve(H, g); -// double[] d = (new Matrix(H)).lu().solve(new Matrix(g, nparm)).getRowPackedCopy(); - //double[] na = DoubleVector.add(a, d); -// double[] na = (new Matrix(a, nparm)).plus(new Matrix(d, nparm)).getRowPackedCopy(); -// double e1 = chiSquared(x, na, y, s, f); - -// if (verbose > 0) { -// System.out.println("\n\niteration "+iter+" lambda = "+lambda); -// System.out.print("a = "); -// (new Matrix(a, nparm)).print(10, 2); -// if (verbose > 1) { -// System.out.print("H = "); -// (new Matrix(H)).print(10, 2); -// System.out.print("g = "); -// (new Matrix(g, nparm)).print(10, 2); -// System.out.print("d = "); -// (new Matrix(d, nparm)).print(10, 2); -// } -// System.out.print("e0 = " + e0 + ": "); -// System.out.print("moved from "); -// (new Matrix(a, nparm)).print(10, 2); -// System.out.print("e1 = " + e1 + ": "); -// if (e1 < e0) { -// System.out.print("to "); -// (new Matrix(na, nparm)).print(10, 2); -// } else { -// System.out.println("move rejected"); -// } -// } - - // termination test (slightly different than NR) -// if (Math.abs(e1-e0) > termepsilon) { -// term = 0; -// } else { -// term++; -// if (term == 4) { -// System.out.println("terminating after " + iter + " iterations"); -// done = true; -// } -// } -// if (iter >= maxiter) done = true; - - // in the C++ version, found that changing this to e1 >= e0 - // was not a good idea. See comment there. - // -// if (e1 > e0 || Double.isNaN(e1)) { // new location worse than before -// lambda *= 10.; -// } else { // new location better, accept new parameters -// lambda *= 0.1; -// e0 = e1; -// // simply assigning a = na will not get results copied back to caller -// for( int i = 0; i < nparm; i++ ) { -// if (vary[i]) a[i] = na[i]; -// } -// } - } while(!$done); - - return $lambda; - } // function solve() - -} // class LevenbergMarquardt diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/MagicSquareExample.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/MagicSquareExample.php deleted file mode 100644 index e6c93d05b2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/MagicSquareExample.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php -/** -* @package JAMA -*/ - -require_once "../Matrix.php"; - -/** -* Example of use of Matrix Class, featuring magic squares. -*/ -class MagicSquareExample { - - /** - * Generate magic square test matrix. - * @param int n dimension of matrix - */ - function magic($n) { - - // Odd order - - if (($n % 2) == 1) { - $a = ($n+1)/2; - $b = ($n+1); - for ($j = 0; $j < $n; ++$j) - for ($i = 0; $i < $n; ++$i) - $M[$i][$j] = $n*(($i+$j+$a) % $n) + (($i+2*$j+$b) % $n) + 1; - - // Doubly Even Order - - } else if (($n % 4) == 0) { - for ($j = 0; $j < $n; ++$j) { - for ($i = 0; $i < $n; ++$i) { - if ((($i+1)/2)%2 == (($j+1)/2)%2) - $M[$i][$j] = $n*$n-$n*$i-$j; - else - $M[$i][$j] = $n*$i+$j+1; - } - } - - // Singly Even Order - - } else { - - $p = $n/2; - $k = ($n-2)/4; - $A = $this->magic($p); - $M = array(); - for ($j = 0; $j < $p; ++$j) { - for ($i = 0; $i < $p; ++$i) { - $aij = $A->get($i,$j); - $M[$i][$j] = $aij; - $M[$i][$j+$p] = $aij + 2*$p*$p; - $M[$i+$p][$j] = $aij + 3*$p*$p; - $M[$i+$p][$j+$p] = $aij + $p*$p; - } - } - - for ($i = 0; $i < $p; ++$i) { - for ($j = 0; $j < $k; ++$j) { - $t = $M[$i][$j]; - $M[$i][$j] = $M[$i+$p][$j]; - $M[$i+$p][$j] = $t; - } - for ($j = $n-$k+1; $j < $n; ++$j) { - $t = $M[$i][$j]; - $M[$i][$j] = $M[$i+$p][$j]; - $M[$i+$p][$j] = $t; - } - } - - $t = $M[$k][0]; $M[$k][0] = $M[$k+$p][0]; $M[$k+$p][0] = $t; - $t = $M[$k][$k]; $M[$k][$k] = $M[$k+$p][$k]; $M[$k+$p][$k] = $t; - - } - - return new Matrix($M); - - } - - /** - * Simple function to replicate PHP 5 behaviour - */ - function microtime_float() { - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); - } - - /** - * Tests LU, QR, SVD and symmetric Eig decompositions. - * - * n = order of magic square. - * trace = diagonal sum, should be the magic sum, (n^3 + n)/2. - * max_eig = maximum eigenvalue of (A + A')/2, should equal trace. - * rank = linear algebraic rank, should equal n if n is odd, - * be less than n if n is even. - * cond = L_2 condition number, ratio of singular values. - * lu_res = test of LU factorization, norm1(L*U-A(p,:))/(n*eps). - * qr_res = test of QR factorization, norm1(Q*R-A)/(n*eps). - */ - function main() { - ?> - <p>Test of Matrix Class, using magic squares.</p> - <p>See MagicSquareExample.main() for an explanation.</p> - <table border='1' cellspacing='0' cellpadding='4'> - <tr> - <th>n</th> - <th>trace</th> - <th>max_eig</th> - <th>rank</th> - <th>cond</th> - <th>lu_res</th> - <th>qr_res</th> - </tr> - <?php - $start_time = $this->microtime_float(); - $eps = pow(2.0,-52.0); - for ($n = 3; $n <= 6; ++$n) { - echo "<tr>"; - - echo "<td align='right'>$n</td>"; - - $M = $this->magic($n); - $t = (int) $M->trace(); - - echo "<td align='right'>$t</td>"; - - $O = $M->plus($M->transpose()); - $E = new EigenvalueDecomposition($O->times(0.5)); - $d = $E->getRealEigenvalues(); - - echo "<td align='right'>".$d[$n-1]."</td>"; - - $r = $M->rank(); - - echo "<td align='right'>".$r."</td>"; - - $c = $M->cond(); - - if ($c < 1/$eps) - echo "<td align='right'>".sprintf("%.3f",$c)."</td>"; - else - echo "<td align='right'>Inf</td>"; - - $LU = new LUDecomposition($M); - $L = $LU->getL(); - $U = $LU->getU(); - $p = $LU->getPivot(); - // Java version: R = L.times(U).minus(M.getMatrix(p,0,n-1)); - $S = $L->times($U); - $R = $S->minus($M->getMatrix($p,0,$n-1)); - $res = $R->norm1()/($n*$eps); - - echo "<td align='right'>".sprintf("%.3f",$res)."</td>"; - - $QR = new QRDecomposition($M); - $Q = $QR->getQ(); - $R = $QR->getR(); - $S = $Q->times($R); - $R = $S->minus($M); - $res = $R->norm1()/($n*$eps); - - echo "<td align='right'>".sprintf("%.3f",$res)."</td>"; - - echo "</tr>"; - - } - echo "<table>"; - echo "<br />"; - - $stop_time = $this->microtime_float(); - $etime = $stop_time - $start_time; - - echo "<p>Elapsed time is ". sprintf("%.4f",$etime) ." seconds.</p>"; - - } - -} - -$magic = new MagicSquareExample(); -$magic->main(); - -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/Stats.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/Stats.php deleted file mode 100644 index 38bc4b7d86..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/Stats.php +++ /dev/null @@ -1,1605 +0,0 @@ -<?php -// -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.0 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Authors: Jesus M. Castagnetto <jmcastagnetto@php.net> | -// +----------------------------------------------------------------------+ -// -// $Id: Stats.php,v 1.15 2003/06/01 11:40:30 jmcastagnetto Exp $ -// - -include_once 'PEAR.php'; - -/** -* @package Math_Stats -*/ - -// Constants for defining the statistics to calculate /*{{{*/ -/** -* STATS_BASIC to generate the basic descriptive statistics -*/ -define('STATS_BASIC', 1); -/** -* STATS_FULL to generate also higher moments, mode, median, etc. -*/ -define('STATS_FULL', 2); -/*}}}*/ - -// Constants describing the data set format /*{{{*/ -/** -* STATS_DATA_SIMPLE for an array of numeric values. This is the default. -* e.g. $data = array(2,3,4,5,1,1,6); -*/ -define('STATS_DATA_SIMPLE', 0); -/** -* STATS_DATA_CUMMULATIVE for an associative array of frequency values, -* where in each array entry, the index is the data point and the -* value the count (frequency): -* e.g. $data = array(3=>4, 2.3=>5, 1.25=>6, 0.5=>3) -*/ -define('STATS_DATA_CUMMULATIVE', 1); -/*}}}*/ - -// Constants defining how to handle nulls /*{{{*/ -/** -* STATS_REJECT_NULL, reject data sets with null values. This is the default. -* Any non-numeric value is considered a null in this context. -*/ -define('STATS_REJECT_NULL', -1); -/** -* STATS_IGNORE_NULL, ignore null values and prune them from the data. -* Any non-numeric value is considered a null in this context. -*/ -define('STATS_IGNORE_NULL', -2); -/** -* STATS_USE_NULL_AS_ZERO, assign the value of 0 (zero) to null values. -* Any non-numeric value is considered a null in this context. -*/ -define('STATS_USE_NULL_AS_ZERO', -3); -/*}}}*/ - -/** -* A class to calculate descriptive statistics from a data set. -* Data sets can be simple arrays of data, or a cummulative hash. -* The second form is useful when passing large data set, -* for example the data set: -* -* <pre> -* $data1 = array (1,2,1,1,1,1,3,3,4.1,3,2,2,4.1,1,1,2,3,3,2,2,1,1,2,2); -* </pre> -* -* can be epxressed more compactly as: -* -* <pre> -* $data2 = array('1'=>9, '2'=>8, '3'=>5, '4.1'=>2); -* </pre> -* -* Example of use: -* -* <pre> -* include_once 'Math/Stats.php'; -* $s = new Math_Stats(); -* $s->setData($data1); -* // or -* // $s->setData($data2, STATS_DATA_CUMMULATIVE); -* $stats = $s->calcBasic(); -* echo 'Mean: '.$stats['mean'].' StDev: '.$stats['stdev'].' <br />\n'; -* -* // using data with nulls -* // first ignoring them: -* $data3 = array(1.2, 'foo', 2.4, 3.1, 4.2, 3.2, null, 5.1, 6.2); -* $s->setNullOption(STATS_IGNORE_NULL); -* $s->setData($data3); -* $stats3 = $s->calcFull(); -* -* // and then assuming nulls == 0 -* $s->setNullOption(STATS_USE_NULL_AS_ZERO); -* $s->setData($data3); -* $stats3 = $s->calcFull(); -* </pre> -* -* Originally this class was part of NumPHP (Numeric PHP package) -* -* @author Jesus M. Castagnetto <jmcastagnetto@php.net> -* @version 0.8 -* @access public -* @package Math_Stats -*/ -class Base {/*{{{*/ - // properties /*{{{*/ - - /** - * The simple or cummulative data set. - * Null by default. - * - * @access private - * @var array - */ - public $_data = null; - - /** - * Expanded data set. Only set when cummulative data - * is being used. Null by default. - * - * @access private - * @var array - */ - public $_dataExpanded = null; - - /** - * Flag for data type, one of STATS_DATA_SIMPLE or - * STATS_DATA_CUMMULATIVE. Null by default. - * - * @access private - * @var int - */ - public $_dataOption = null; - - /** - * Flag for null handling options. One of STATS_REJECT_NULL, - * STATS_IGNORE_NULL or STATS_USE_NULL_AS_ZERO - * - * @access private - * @var int - */ - public $_nullOption; - - /** - * Array for caching result values, should be reset - * when using setData() - * - * @access private - * @var array - */ - public $_calculatedValues = array(); - - /*}}}*/ - - /** - * Constructor for the class - * - * @access public - * @param optional int $nullOption how to handle null values - * @return object Math_Stats - */ - function Math_Stats($nullOption=STATS_REJECT_NULL) {/*{{{*/ - $this->_nullOption = $nullOption; - }/*}}}*/ - - /** - * Sets and verifies the data, checking for nulls and using - * the current null handling option - * - * @access public - * @param array $arr the data set - * @param optional int $opt data format: STATS_DATA_CUMMULATIVE or STATS_DATA_SIMPLE (default) - * @return mixed true on success, a PEAR_Error object otherwise - */ - function setData($arr, $opt=STATS_DATA_SIMPLE) {/*{{{*/ - if (!is_array($arr)) { - return PEAR::raiseError('invalid data, an array of numeric data was expected'); - } - $this->_data = null; - $this->_dataExpanded = null; - $this->_dataOption = null; - $this->_calculatedValues = array(); - if ($opt == STATS_DATA_SIMPLE) { - $this->_dataOption = $opt; - $this->_data = array_values($arr); - } else if ($opt == STATS_DATA_CUMMULATIVE) { - $this->_dataOption = $opt; - $this->_data = $arr; - $this->_dataExpanded = array(); - } - return $this->_validate(); - }/*}}}*/ - - /** - * Returns the data which might have been modified - * according to the current null handling options. - * - * @access public - * @param boolean $expanded whether to return a expanded list, default is false - * @return mixed array of data on success, a PEAR_Error object otherwise - * @see _validate() - */ - function getData($expanded=false) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if ($this->_dataOption == STATS_DATA_CUMMULATIVE && $expanded) { - return $this->_dataExpanded; - } else { - return $this->_data; - } - }/*}}}*/ - - /** - * Sets the null handling option. - * Must be called before assigning a new data set containing null values - * - * @access public - * @return mixed true on success, a PEAR_Error object otherwise - * @see _validate() - */ - function setNullOption($nullOption) {/*{{{*/ - if ($nullOption == STATS_REJECT_NULL - || $nullOption == STATS_IGNORE_NULL - || $nullOption == STATS_USE_NULL_AS_ZERO) { - $this->_nullOption = $nullOption; - return true; - } else { - return PEAR::raiseError('invalid null handling option expecting: '. - 'STATS_REJECT_NULL, STATS_IGNORE_NULL or STATS_USE_NULL_AS_ZERO'); - } - }/*}}}*/ - - /** - * Transforms the data by substracting each entry from the mean and - * dividing by its standard deviation. This will reset all pre-calculated - * values to their original (unset) defaults. - * - * @access public - * @return mixed true on success, a PEAR_Error object otherwise - * @see mean() - * @see stDev() - * @see setData() - */ - function studentize() {/*{{{*/ - $mean = $this->mean(); - if (PEAR::isError($mean)) { - return $mean; - } - $std = $this->stDev(); - if (PEAR::isError($std)) { - return $std; - } - if ($std == 0) { - return PEAR::raiseError('cannot studentize data, standard deviation is zero.'); - } - $arr = array(); - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach ($this->_data as $val=>$freq) { - $newval = ($val - $mean) / $std; - $arr["$newval"] = $freq; - } - } else { - foreach ($this->_data as $val) { - $newval = ($val - $mean) / $std; - $arr[] = $newval; - } - } - return $this->setData($arr, $this->_dataOption); - }/*}}}*/ - - /** - * Transforms the data by substracting each entry from the mean. - * This will reset all pre-calculated values to their original (unset) defaults. - * - * @access public - * @return mixed true on success, a PEAR_Error object otherwise - * @see mean() - * @see setData() - */ - function center() {/*{{{*/ - $mean = $this->mean(); - if (PEAR::isError($mean)) { - return $mean; - } - $arr = array(); - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach ($this->_data as $val=>$freq) { - $newval = $val - $mean; - $arr["$newval"] = $freq; - } - } else { - foreach ($this->_data as $val) { - $newval = $val - $mean; - $arr[] = $newval; - } - } - return $this->setData($arr, $this->_dataOption); - }/*}}}*/ - - /** - * Calculates the basic or full statistics for the data set - * - * @access public - * @param int $mode one of STATS_BASIC or STATS_FULL - * @param boolean $returnErrorObject whether the raw PEAR_Error (when true, default), - * or only the error message will be returned (when false), if an error happens. - * @return mixed an associative array of statistics on success, a PEAR_Error object otherwise - * @see calcBasic() - * @see calcFull() - */ - function calc($mode, $returnErrorObject=true) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if ($mode == STATS_BASIC) { - return $this->calcBasic($returnErrorObject); - } elseif ($mode == STATS_FULL) { - return $this->calcFull($returnErrorObject); - } else { - return PEAR::raiseError('incorrect mode, expected STATS_BASIC or STATS_FULL'); - } - }/*}}}*/ - - /** - * Calculates a basic set of statistics - * - * @access public - * @param boolean $returnErrorObject whether the raw PEAR_Error (when true, default), - * or only the error message will be returned (when false), if an error happens. - * @return mixed an associative array of statistics on success, a PEAR_Error object otherwise - * @see calc() - * @see calcFull() - */ - function calcBasic($returnErrorObject=true) {/*{{{*/ - return array ( - 'min' => $this->__format($this->min(), $returnErrorObject), - 'max' => $this->__format($this->max(), $returnErrorObject), - 'sum' => $this->__format($this->sum(), $returnErrorObject), - 'sum2' => $this->__format($this->sum2(), $returnErrorObject), - 'count' => $this->__format($this->count(), $returnErrorObject), - 'mean' => $this->__format($this->mean(), $returnErrorObject), - 'stdev' => $this->__format($this->stDev(), $returnErrorObject), - 'variance' => $this->__format($this->variance(), $returnErrorObject), - 'range' => $this->__format($this->range(), $returnErrorObject) - ); - }/*}}}*/ - - /** - * Calculates a full set of statistics - * - * @access public - * @param boolean $returnErrorObject whether the raw PEAR_Error (when true, default), - * or only the error message will be returned (when false), if an error happens. - * @return mixed an associative array of statistics on success, a PEAR_Error object otherwise - * @see calc() - * @see calcBasic() - */ - function calcFull($returnErrorObject=true) {/*{{{*/ - return array ( - 'min' => $this->__format($this->min(), $returnErrorObject), - 'max' => $this->__format($this->max(), $returnErrorObject), - 'sum' => $this->__format($this->sum(), $returnErrorObject), - 'sum2' => $this->__format($this->sum2(), $returnErrorObject), - 'count' => $this->__format($this->count(), $returnErrorObject), - 'mean' => $this->__format($this->mean(), $returnErrorObject), - 'median' => $this->__format($this->median(), $returnErrorObject), - 'mode' => $this->__format($this->mode(), $returnErrorObject), - 'midrange' => $this->__format($this->midrange(), $returnErrorObject), - 'geometric_mean' => $this->__format($this->geometricMean(), $returnErrorObject), - 'harmonic_mean' => $this->__format($this->harmonicMean(), $returnErrorObject), - 'stdev' => $this->__format($this->stDev(), $returnErrorObject), - 'absdev' => $this->__format($this->absDev(), $returnErrorObject), - 'variance' => $this->__format($this->variance(), $returnErrorObject), - 'range' => $this->__format($this->range(), $returnErrorObject), - 'std_error_of_mean' => $this->__format($this->stdErrorOfMean(), $returnErrorObject), - 'skewness' => $this->__format($this->skewness(), $returnErrorObject), - 'kurtosis' => $this->__format($this->kurtosis(), $returnErrorObject), - 'coeff_of_variation' => $this->__format($this->coeffOfVariation(), $returnErrorObject), - 'sample_central_moments' => array ( - 1 => $this->__format($this->sampleCentralMoment(1), $returnErrorObject), - 2 => $this->__format($this->sampleCentralMoment(2), $returnErrorObject), - 3 => $this->__format($this->sampleCentralMoment(3), $returnErrorObject), - 4 => $this->__format($this->sampleCentralMoment(4), $returnErrorObject), - 5 => $this->__format($this->sampleCentralMoment(5), $returnErrorObject) - ), - 'sample_raw_moments' => array ( - 1 => $this->__format($this->sampleRawMoment(1), $returnErrorObject), - 2 => $this->__format($this->sampleRawMoment(2), $returnErrorObject), - 3 => $this->__format($this->sampleRawMoment(3), $returnErrorObject), - 4 => $this->__format($this->sampleRawMoment(4), $returnErrorObject), - 5 => $this->__format($this->sampleRawMoment(5), $returnErrorObject) - ), - 'frequency' => $this->__format($this->frequency(), $returnErrorObject), - 'quartiles' => $this->__format($this->quartiles(), $returnErrorObject), - 'interquartile_range' => $this->__format($this->interquartileRange(), $returnErrorObject), - 'interquartile_mean' => $this->__format($this->interquartileMean(), $returnErrorObject), - 'quartile_deviation' => $this->__format($this->quartileDeviation(), $returnErrorObject), - 'quartile_variation_coefficient' => $this->__format($this->quartileVariationCoefficient(), $returnErrorObject), - 'quartile_skewness_coefficient' => $this->__format($this->quartileSkewnessCoefficient(), $returnErrorObject) - ); - }/*}}}*/ - - /** - * Calculates the minimum of a data set. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the minimum value on success, a PEAR_Error object otherwise - * @see calc() - * @see max() - */ - function min() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('min', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $min = min(array_keys($this->_data)); - } else { - $min = min($this->_data); - } - $this->_calculatedValues['min'] = $min; - } - return $this->_calculatedValues['min']; - }/*}}}*/ - - /** - * Calculates the maximum of a data set. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the maximum value on success, a PEAR_Error object otherwise - * @see calc() - * @see min() - */ - function max() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('max', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $max = max(array_keys($this->_data)); - } else { - $max = max($this->_data); - } - $this->_calculatedValues['max'] = $max; - } - return $this->_calculatedValues['max']; - }/*}}}*/ - - /** - * Calculates SUM { xi } - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the sum on success, a PEAR_Error object otherwise - * @see calc() - * @see sum2() - * @see sumN() - */ - function sum() {/*{{{*/ - if (!array_key_exists('sum', $this->_calculatedValues)) { - $sum = $this->sumN(1); - if (PEAR::isError($sum)) { - return $sum; - } else { - $this->_calculatedValues['sum'] = $sum; - } - } - return $this->_calculatedValues['sum']; - }/*}}}*/ - - /** - * Calculates SUM { (xi)^2 } - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the sum on success, a PEAR_Error object otherwise - * @see calc() - * @see sum() - * @see sumN() - */ - function sum2() {/*{{{*/ - if (!array_key_exists('sum2', $this->_calculatedValues)) { - $sum2 = $this->sumN(2); - if (PEAR::isError($sum2)) { - return $sum2; - } else { - $this->_calculatedValues['sum2'] = $sum2; - } - } - return $this->_calculatedValues['sum2']; - }/*}}}*/ - - /** - * Calculates SUM { (xi)^n } - * Handles cummulative data sets correctly - * - * @access public - * @param numeric $n the exponent - * @return mixed the sum on success, a PEAR_Error object otherwise - * @see calc() - * @see sum() - * @see sum2() - */ - function sumN($n) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - $sumN = 0; - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach($this->_data as $val=>$freq) { - $sumN += $freq * pow((double)$val, (double)$n); - } - } else { - foreach($this->_data as $val) { - $sumN += pow((double)$val, (double)$n); - } - } - return $sumN; - }/*}}}*/ - - /** - * Calculates PROD { (xi) }, (the product of all observations) - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the product on success, a PEAR_Error object otherwise - * @see productN() - */ - function product() {/*{{{*/ - if (!array_key_exists('product', $this->_calculatedValues)) { - $product = $this->productN(1); - if (PEAR::isError($product)) { - return $product; - } else { - $this->_calculatedValues['product'] = $product; - } - } - return $this->_calculatedValues['product']; - }/*}}}*/ - - /** - * Calculates PROD { (xi)^n }, which is the product of all observations - * Handles cummulative data sets correctly - * - * @access public - * @param numeric $n the exponent - * @return mixed the product on success, a PEAR_Error object otherwise - * @see product() - */ - function productN($n) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - $prodN = 1.0; - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach($this->_data as $val=>$freq) { - if ($val == 0) { - return 0.0; - } - $prodN *= $freq * pow((double)$val, (double)$n); - } - } else { - foreach($this->_data as $val) { - if ($val == 0) { - return 0.0; - } - $prodN *= pow((double)$val, (double)$n); - } - } - return $prodN; - - }/*}}}*/ - - /** - * Calculates the number of data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the count on success, a PEAR_Error object otherwise - * @see calc() - */ - function count() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('count', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $count = count($this->_dataExpanded); - } else { - $count = count($this->_data); - } - $this->_calculatedValues['count'] = $count; - } - return $this->_calculatedValues['count']; - }/*}}}*/ - - /** - * Calculates the mean (average) of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the mean value on success, a PEAR_Error object otherwise - * @see calc() - * @see sum() - * @see count() - */ - function mean() {/*{{{*/ - if (!array_key_exists('mean', $this->_calculatedValues)) { - $sum = $this->sum(); - if (PEAR::isError($sum)) { - return $sum; - } - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $this->_calculatedValues['mean'] = $sum / $count; - } - return $this->_calculatedValues['mean']; - }/*}}}*/ - - /** - * Calculates the range of the data set = max - min - * - * @access public - * @return mixed the value of the range on success, a PEAR_Error object otherwise. - */ - function range() {/*{{{*/ - if (!array_key_exists('range', $this->_calculatedValues)) { - $min = $this->min(); - if (PEAR::isError($min)) { - return $min; - } - $max = $this->max(); - if (PEAR::isError($max)) { - return $max; - } - $this->_calculatedValues['range'] = $max - $min; - } - return $this->_calculatedValues['range']; - - }/*}}}*/ - - /** - * Calculates the variance (unbiased) of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the variance value on success, a PEAR_Error object otherwise - * @see calc() - * @see __sumdiff() - * @see count() - */ - function variance() {/*{{{*/ - if (!array_key_exists('variance', $this->_calculatedValues)) { - $variance = $this->__calcVariance(); - if (PEAR::isError($variance)) { - return $variance; - } - $this->_calculatedValues['variance'] = $variance; - } - return $this->_calculatedValues['variance']; - }/*}}}*/ - - /** - * Calculates the standard deviation (unbiased) of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the standard deviation on success, a PEAR_Error object otherwise - * @see calc() - * @see variance() - */ - function stDev() {/*{{{*/ - if (!array_key_exists('stDev', $this->_calculatedValues)) { - $variance = $this->variance(); - if (PEAR::isError($variance)) { - return $variance; - } - $this->_calculatedValues['stDev'] = sqrt($variance); - } - return $this->_calculatedValues['stDev']; - }/*}}}*/ - - /** - * Calculates the variance (unbiased) of the data points in the set - * given a fixed mean (average) value. Not used in calcBasic(), calcFull() - * or calc(). - * Handles cummulative data sets correctly - * - * @access public - * @param numeric $mean the fixed mean value - * @return mixed the variance on success, a PEAR_Error object otherwise - * @see __sumdiff() - * @see count() - * @see variance() - */ - function varianceWithMean($mean) {/*{{{*/ - return $this->__calcVariance($mean); - }/*}}}*/ - - /** - * Calculates the standard deviation (unbiased) of the data points in the set - * given a fixed mean (average) value. Not used in calcBasic(), calcFull() - * or calc(). - * Handles cummulative data sets correctly - * - * @access public - * @param numeric $mean the fixed mean value - * @return mixed the standard deviation on success, a PEAR_Error object otherwise - * @see varianceWithMean() - * @see stDev() - */ - function stDevWithMean($mean) {/*{{{*/ - $varianceWM = $this->varianceWithMean($mean); - if (PEAR::isError($varianceWM)) { - return $varianceWM; - } - return sqrt($varianceWM); - }/*}}}*/ - - /** - * Calculates the absolute deviation of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the absolute deviation on success, a PEAR_Error object otherwise - * @see calc() - * @see __sumabsdev() - * @see count() - * @see absDevWithMean() - */ - function absDev() {/*{{{*/ - if (!array_key_exists('absDev', $this->_calculatedValues)) { - $absDev = $this->__calcAbsoluteDeviation(); - if (PEAR::isError($absdev)) { - return $absdev; - } - $this->_calculatedValues['absDev'] = $absDev; - } - return $this->_calculatedValues['absDev']; - }/*}}}*/ - - /** - * Calculates the absolute deviation of the data points in the set - * given a fixed mean (average) value. Not used in calcBasic(), calcFull() - * or calc(). - * Handles cummulative data sets correctly - * - * @access public - * @param numeric $mean the fixed mean value - * @return mixed the absolute deviation on success, a PEAR_Error object otherwise - * @see __sumabsdev() - * @see absDev() - */ - function absDevWithMean($mean) {/*{{{*/ - return $this->__calcAbsoluteDeviation($mean); - }/*}}}*/ - - /** - * Calculates the skewness of the data distribution in the set - * The skewness measures the degree of asymmetry of a distribution, - * and is related to the third central moment of a distribution. - * A normal distribution has a skewness = 0 - * A distribution with a tail off towards the high end of the scale - * (positive skew) has a skewness > 0 - * A distribution with a tail off towards the low end of the scale - * (negative skew) has a skewness < 0 - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the skewness value on success, a PEAR_Error object otherwise - * @see __sumdiff() - * @see count() - * @see stDev() - * @see calc() - */ - function skewness() {/*{{{*/ - if (!array_key_exists('skewness', $this->_calculatedValues)) { - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $stDev = $this->stDev(); - if (PEAR::isError($stDev)) { - return $stDev; - } - $sumdiff3 = $this->__sumdiff(3); - if (PEAR::isError($sumdiff3)) { - return $sumdiff3; - } - $this->_calculatedValues['skewness'] = ($sumdiff3 / ($count * pow($stDev, 3))); - } - return $this->_calculatedValues['skewness']; - }/*}}}*/ - - /** - * Calculates the kurtosis of the data distribution in the set - * The kurtosis measures the degrees of peakedness of a distribution. - * It is also called the "excess" or "excess coefficient", and is - * a normalized form of the fourth central moment of a distribution. - * A normal distributions has kurtosis = 0 - * A narrow and peaked (leptokurtic) distribution has a - * kurtosis > 0 - * A flat and wide (platykurtic) distribution has a kurtosis < 0 - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the kurtosis value on success, a PEAR_Error object otherwise - * @see __sumdiff() - * @see count() - * @see stDev() - * @see calc() - */ - function kurtosis() {/*{{{*/ - if (!array_key_exists('kurtosis', $this->_calculatedValues)) { - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $stDev = $this->stDev(); - if (PEAR::isError($stDev)) { - return $stDev; - } - $sumdiff4 = $this->__sumdiff(4); - if (PEAR::isError($sumdiff4)) { - return $sumdiff4; - } - $this->_calculatedValues['kurtosis'] = ($sumdiff4 / ($count * pow($stDev, 4))) - 3; - } - return $this->_calculatedValues['kurtosis']; - }/*}}}*/ - - /** - * Calculates the median of a data set. - * The median is the value such that half of the points are below it - * in a sorted data set. - * If the number of values is odd, it is the middle item. - * If the number of values is even, is the average of the two middle items. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the median value on success, a PEAR_Error object otherwise - * @see count() - * @see calc() - */ - function median() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('median', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $arr =& $this->_dataExpanded; - } else { - $arr =& $this->_data; - } - $n = $this->count(); - if (PEAR::isError($n)) { - return $n; - } - $h = intval($n / 2); - if ($n % 2 == 0) { - $median = ($arr[$h] + $arr[$h - 1]) / 2; - } else { - $median = $arr[$h + 1]; - } - $this->_calculatedValues['median'] = $median; - } - return $this->_calculatedValues['median']; - }/*}}}*/ - - /** - * Calculates the mode of a data set. - * The mode is the value with the highest frequency in the data set. - * There can be more than one mode. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed an array of mode value on success, a PEAR_Error object otherwise - * @see frequency() - * @see calc() - */ - function mode() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('mode', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $arr = $this->_data; - } else { - $arr = $this->frequency(); - } - arsort($arr); - $mcount = 1; - foreach ($arr as $val=>$freq) { - if ($mcount == 1) { - $mode = array($val); - $mfreq = $freq; - ++$mcount; - continue; - } - if ($mfreq == $freq) - $mode[] = $val; - if ($mfreq > $freq) - break; - } - $this->_calculatedValues['mode'] = $mode; - } - return $this->_calculatedValues['mode']; - }/*}}}*/ - - /** - * Calculates the midrange of a data set. - * The midrange is the average of the minimum and maximum of the data set. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the midrange value on success, a PEAR_Error object otherwise - * @see min() - * @see max() - * @see calc() - */ - function midrange() {/*{{{*/ - if (!array_key_exists('midrange', $this->_calculatedValues)) { - $min = $this->min(); - if (PEAR::isError($min)) { - return $min; - } - $max = $this->max(); - if (PEAR::isError($max)) { - return $max; - } - $this->_calculatedValues['midrange'] = (($max + $min) / 2); - } - return $this->_calculatedValues['midrange']; - }/*}}}*/ - - /** - * Calculates the geometrical mean of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the geometrical mean value on success, a PEAR_Error object otherwise - * @see calc() - * @see product() - * @see count() - */ - function geometricMean() {/*{{{*/ - if (!array_key_exists('geometricMean', $this->_calculatedValues)) { - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $prod = $this->product(); - if (PEAR::isError($prod)) { - return $prod; - } - if ($prod == 0.0) { - return 0.0; - } - if ($prod < 0) { - return PEAR::raiseError('The product of the data set is negative, geometric mean undefined.'); - } - $this->_calculatedValues['geometricMean'] = pow($prod , 1 / $count); - } - return $this->_calculatedValues['geometricMean']; - }/*}}}*/ - - /** - * Calculates the harmonic mean of the data points in the set - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the harmonic mean value on success, a PEAR_Error object otherwise - * @see calc() - * @see count() - */ - function harmonicMean() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('harmonicMean', $this->_calculatedValues)) { - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $invsum = 0.0; - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach($this->_data as $val=>$freq) { - if ($val == 0) { - return PEAR::raiseError('cannot calculate a '. - 'harmonic mean with data values of zero.'); - } - $invsum += $freq / $val; - } - } else { - foreach($this->_data as $val) { - if ($val == 0) { - return PEAR::raiseError('cannot calculate a '. - 'harmonic mean with data values of zero.'); - } - $invsum += 1 / $val; - } - } - $this->_calculatedValues['harmonicMean'] = $count / $invsum; - } - return $this->_calculatedValues['harmonicMean']; - }/*}}}*/ - - /** - * Calculates the nth central moment (m{n}) of a data set. - * - * The definition of a sample central moment is: - * - * m{n} = 1/N * SUM { (xi - avg)^n } - * - * where: N = sample size, avg = sample mean. - * - * @access public - * @param integer $n moment to calculate - * @return mixed the numeric value of the moment on success, PEAR_Error otherwise - */ - function sampleCentralMoment($n) {/*{{{*/ - if (!is_int($n) || $n < 1) { - return PEAR::isError('moment must be a positive integer >= 1.'); - } - - if ($n == 1) { - return 0; - } - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - if ($count == 0) { - return PEAR::raiseError("Cannot calculate {$n}th sample moment, ". - 'there are zero data entries'); - } - $sum = $this->__sumdiff($n); - if (PEAR::isError($sum)) { - return $sum; - } - return ($sum / $count); - }/*}}}*/ - - /** - * Calculates the nth raw moment (m{n}) of a data set. - * - * The definition of a sample central moment is: - * - * m{n} = 1/N * SUM { xi^n } - * - * where: N = sample size, avg = sample mean. - * - * @access public - * @param integer $n moment to calculate - * @return mixed the numeric value of the moment on success, PEAR_Error otherwise - */ - function sampleRawMoment($n) {/*{{{*/ - if (!is_int($n) || $n < 1) { - return PEAR::isError('moment must be a positive integer >= 1.'); - } - - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - if ($count == 0) { - return PEAR::raiseError("Cannot calculate {$n}th raw moment, ". - 'there are zero data entries.'); - } - $sum = $this->sumN($n); - if (PEAR::isError($sum)) { - return $sum; - } - return ($sum / $count); - }/*}}}*/ - - - /** - * Calculates the coefficient of variation of a data set. - * The coefficient of variation measures the spread of a set of data - * as a proportion of its mean. It is often expressed as a percentage. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed the coefficient of variation on success, a PEAR_Error object otherwise - * @see stDev() - * @see mean() - * @see calc() - */ - function coeffOfVariation() {/*{{{*/ - if (!array_key_exists('coeffOfVariation', $this->_calculatedValues)) { - $mean = $this->mean(); - if (PEAR::isError($mean)) { - return $mean; - } - if ($mean == 0.0) { - return PEAR::raiseError('cannot calculate the coefficient '. - 'of variation, mean of sample is zero'); - } - $stDev = $this->stDev(); - if (PEAR::isError($stDev)) { - return $stDev; - } - - $this->_calculatedValues['coeffOfVariation'] = $stDev / $mean; - } - return $this->_calculatedValues['coeffOfVariation']; - }/*}}}*/ - - /** - * Calculates the standard error of the mean. - * It is the standard deviation of the sampling distribution of - * the mean. The formula is: - * - * S.E. Mean = SD / (N)^(1/2) - * - * This formula does not assume a normal distribution, and shows - * that the size of the standard error of the mean is inversely - * proportional to the square root of the sample size. - * - * @access public - * @return mixed the standard error of the mean on success, a PEAR_Error object otherwise - * @see stDev() - * @see count() - * @see calc() - */ - function stdErrorOfMean() {/*{{{*/ - if (!array_key_exists('stdErrorOfMean', $this->_calculatedValues)) { - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $stDev = $this->stDev(); - if (PEAR::isError($stDev)) { - return $stDev; - } - $this->_calculatedValues['stdErrorOfMean'] = $stDev / sqrt($count); - } - return $this->_calculatedValues['stdErrorOfMean']; - }/*}}}*/ - - /** - * Calculates the value frequency table of a data set. - * Handles cummulative data sets correctly - * - * @access public - * @return mixed an associative array of value=>frequency items on success, a PEAR_Error object otherwise - * @see min() - * @see max() - * @see calc() - */ - function frequency() {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (!array_key_exists('frequency', $this->_calculatedValues)) { - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $freq = $this->_data; - } else { - $freq = array(); - foreach ($this->_data as $val) { - $freq["$val"]++; - } - ksort($freq); - } - $this->_calculatedValues['frequency'] = $freq; - } - return $this->_calculatedValues['frequency']; - }/*}}}*/ - - /** - * The quartiles are defined as the values that divide a sorted - * data set into four equal-sized subsets, and correspond to the - * 25th, 50th, and 75th percentiles. - * - * @access public - * @return mixed an associative array of quartiles on success, a PEAR_Error otherwise - * @see percentile() - */ - function quartiles() {/*{{{*/ - if (!array_key_exists('quartiles', $this->_calculatedValues)) { - $q1 = $this->percentile(25); - if (PEAR::isError($q1)) { - return $q1; - } - $q2 = $this->percentile(50); - if (PEAR::isError($q2)) { - return $q2; - } - $q3 = $this->percentile(75); - if (PEAR::isError($q3)) { - return $q3; - } - $this->_calculatedValues['quartiles'] = array ( - '25' => $q1, - '50' => $q2, - '75' => $q3 - ); - } - return $this->_calculatedValues['quartiles']; - }/*}}}*/ - - /** - * The interquartile mean is defined as the mean of the values left - * after discarding the lower 25% and top 25% ranked values, i.e.: - * - * interquart mean = mean(<P(25),P(75)>) - * - * where: P = percentile - * - * @todo need to double check the equation - * @access public - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - */ - function interquartileMean() {/*{{{*/ - if (!array_key_exists('interquartileMean', $this->_calculatedValues)) { - $quart = $this->quartiles(); - if (PEAR::isError($quart)) { - return $quart; - } - $q3 = $quart['75']; - $q1 = $quart['25']; - $sum = 0; - $n = 0; - foreach ($this->getData(true) as $val) { - if ($val >= $q1 && $val <= $q3) { - $sum += $val; - ++$n; - } - } - if ($n == 0) { - return PEAR::raiseError('error calculating interquartile mean, '. - 'empty interquartile range of values.'); - } - $this->_calculatedValues['interquartileMean'] = $sum / $n; - } - return $this->_calculatedValues['interquartileMean']; - }/*}}}*/ - - /** - * The interquartile range is the distance between the 75th and 25th - * percentiles. Basically the range of the middle 50% of the data set, - * and thus is not affected by outliers or extreme values. - * - * interquart range = P(75) - P(25) - * - * where: P = percentile - * - * @access public - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - */ - function interquartileRange() {/*{{{*/ - if (!array_key_exists('interquartileRange', $this->_calculatedValues)) { - $quart = $this->quartiles(); - if (PEAR::isError($quart)) { - return $quart; - } - $q3 = $quart['75']; - $q1 = $quart['25']; - $this->_calculatedValues['interquartileRange'] = $q3 - $q1; - } - return $this->_calculatedValues['interquartileRange']; - }/*}}}*/ - - /** - * The quartile deviation is half of the interquartile range value - * - * quart dev = (P(75) - P(25)) / 2 - * - * where: P = percentile - * - * @access public - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - * @see interquartileRange() - */ - function quartileDeviation() {/*{{{*/ - if (!array_key_exists('quartileDeviation', $this->_calculatedValues)) { - $iqr = $this->interquartileRange(); - if (PEAR::isError($iqr)) { - return $iqr; - } - $this->_calculatedValues['quartileDeviation'] = $iqr / 2; - } - return $this->_calculatedValues['quartileDeviation']; - }/*}}}*/ - - /** - * The quartile variation coefficient is defines as follows: - * - * quart var coeff = 100 * (P(75) - P(25)) / (P(75) + P(25)) - * - * where: P = percentile - * - * @todo need to double check the equation - * @access public - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - */ - function quartileVariationCoefficient() {/*{{{*/ - if (!array_key_exists('quartileVariationCoefficient', $this->_calculatedValues)) { - $quart = $this->quartiles(); - if (PEAR::isError($quart)) { - return $quart; - } - $q3 = $quart['75']; - $q1 = $quart['25']; - $d = $q3 - $q1; - $s = $q3 + $q1; - $this->_calculatedValues['quartileVariationCoefficient'] = 100 * $d / $s; - } - return $this->_calculatedValues['quartileVariationCoefficient']; - }/*}}}*/ - - /** - * The quartile skewness coefficient (also known as Bowley Skewness), - * is defined as follows: - * - * quart skewness coeff = (P(25) - 2*P(50) + P(75)) / (P(75) - P(25)) - * - * where: P = percentile - * - * @todo need to double check the equation - * @access public - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - */ - function quartileSkewnessCoefficient() {/*{{{*/ - if (!array_key_exists('quartileSkewnessCoefficient', $this->_calculatedValues)) { - $quart = $this->quartiles(); - if (PEAR::isError($quart)) { - return $quart; - } - $q3 = $quart['75']; - $q2 = $quart['50']; - $q1 = $quart['25']; - $d = $q3 - 2*$q2 + $q1; - $s = $q3 - $q1; - $this->_calculatedValues['quartileSkewnessCoefficient'] = $d / $s; - } - return $this->_calculatedValues['quartileSkewnessCoefficient']; - }/*}}}*/ - - /** - * The pth percentile is the value such that p% of the a sorted data set - * is smaller than it, and (100 - p)% of the data is larger. - * - * A quick algorithm to pick the appropriate value from a sorted data - * set is as follows: - * - * - Count the number of values: n - * - Calculate the position of the value in the data list: i = p * (n + 1) - * - if i is an integer, return the data at that position - * - if i < 1, return the minimum of the data set - * - if i > n, return the maximum of the data set - * - otherwise, average the entries at adjacent positions to i - * - * The median is the 50th percentile value. - * - * @todo need to double check generality of the algorithm - * - * @access public - * @param numeric $p the percentile to estimate, e.g. 25 for 25th percentile - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see quartiles() - * @see median() - */ - function percentile($p) {/*{{{*/ - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - $data =& $this->_dataExpanded; - } else { - $data =& $this->_data; - } - $obsidx = $p * ($count + 1) / 100; - if (intval($obsidx) == $obsidx) { - return $data[($obsidx - 1)]; - } elseif ($obsidx < 1) { - return $data[0]; - } elseif ($obsidx > $count) { - return $data[($count - 1)]; - } else { - $left = floor($obsidx - 1); - $right = ceil($obsidx - 1); - return ($data[$left] + $data[$right]) / 2; - } - }/*}}}*/ - - // private methods - - /** - * Utility function to calculate: SUM { (xi - mean)^n } - * - * @access private - * @param numeric $power the exponent - * @param optional double $mean the data set mean value - * @return mixed the sum on success, a PEAR_Error object otherwise - * - * @see stDev() - * @see variaceWithMean(); - * @see skewness(); - * @see kurtosis(); - */ - function __sumdiff($power, $mean=null) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (is_null($mean)) { - $mean = $this->mean(); - if (PEAR::isError($mean)) { - return $mean; - } - } - $sdiff = 0; - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach ($this->_data as $val=>$freq) { - $sdiff += $freq * pow((double)($val - $mean), (double)$power); - } - } else { - foreach ($this->_data as $val) - $sdiff += pow((double)($val - $mean), (double)$power); - } - return $sdiff; - }/*}}}*/ - - /** - * Utility function to calculate the variance with or without - * a fixed mean - * - * @access private - * @param $mean the fixed mean to use, null as default - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see variance() - * @see varianceWithMean() - */ - function __calcVariance($mean = null) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - $sumdiff2 = $this->__sumdiff(2, $mean); - if (PEAR::isError($sumdiff2)) { - return $sumdiff2; - } - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - if ($count == 1) { - return PEAR::raiseError('cannot calculate variance of a singe data point'); - } - return ($sumdiff2 / ($count - 1)); - }/*}}}*/ - - /** - * Utility function to calculate the absolute deviation with or without - * a fixed mean - * - * @access private - * @param $mean the fixed mean to use, null as default - * @return mixed a numeric value on success, a PEAR_Error otherwise - * @see absDev() - * @see absDevWithMean() - */ - function __calcAbsoluteDeviation($mean = null) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - $count = $this->count(); - if (PEAR::isError($count)) { - return $count; - } - $sumabsdev = $this->__sumabsdev($mean); - if (PEAR::isError($sumabsdev)) { - return $sumabsdev; - } - return $sumabsdev / $count; - }/*}}}*/ - - /** - * Utility function to calculate: SUM { | xi - mean | } - * - * @access private - * @param optional double $mean the mean value for the set or population - * @return mixed the sum on success, a PEAR_Error object otherwise - * - * @see absDev() - * @see absDevWithMean() - */ - function __sumabsdev($mean=null) {/*{{{*/ - if ($this->_data == null) { - return PEAR::raiseError('data has not been set'); - } - if (is_null($mean)) { - $mean = $this->mean(); - } - $sdev = 0; - if ($this->_dataOption == STATS_DATA_CUMMULATIVE) { - foreach ($this->_data as $val=>$freq) { - $sdev += $freq * abs($val - $mean); - } - } else { - foreach ($this->_data as $val) { - $sdev += abs($val - $mean); - } - } - return $sdev; - }/*}}}*/ - - /** - * Utility function to format a PEAR_Error to be used by calc(), - * calcBasic() and calcFull() - * - * @access private - * @param mixed $v value to be formatted - * @param boolean $returnErrorObject whether the raw PEAR_Error (when true, default), - * or only the error message will be returned (when false) - * @return mixed if the value is a PEAR_Error object, and $useErrorObject - * is false, then a string with the error message will be returned, - * otherwise the value will not be modified and returned as passed. - */ - function __format($v, $useErrorObject=true) {/*{{{*/ - if (PEAR::isError($v) && $useErrorObject == false) { - return $v->getMessage(); - } else { - return $v; - } - }/*}}}*/ - - /** - * Utility function to validate the data and modify it - * according to the current null handling option - * - * @access private - * @return mixed true on success, a PEAR_Error object otherwise - * - * @see setData() - */ - function _validate() {/*{{{*/ - $flag = ($this->_dataOption == STATS_DATA_CUMMULATIVE); - foreach ($this->_data as $key=>$value) { - $d = ($flag) ? $key : $value; - $v = ($flag) ? $value : $key; - if (!is_numeric($d)) { - switch ($this->_nullOption) { - case STATS_IGNORE_NULL : - unset($this->_data["$key"]); - break; - case STATS_USE_NULL_AS_ZERO: - if ($flag) { - unset($this->_data["$key"]); - $this->_data[0] += $v; - } else { - $this->_data[$key] = 0; - } - break; - case STATS_REJECT_NULL : - default: - return PEAR::raiseError('data rejected, contains NULL values'); - break; - } - } - } - if ($flag) { - ksort($this->_data); - $this->_dataExpanded = array(); - foreach ($this->_data as $val=>$freq) { - $this->_dataExpanded = array_pad($this->_dataExpanded, count($this->_dataExpanded) + $freq, $val); - } - sort($this->_dataExpanded); - } else { - sort($this->_data); - } - return true; - }/*}}}*/ - -}/*}}}*/ - -// vim: ts=4:sw=4:et: -// vim6: fdl=1: fdm=marker: - -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/benchmark.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/benchmark.php deleted file mode 100644 index 1b963b46be..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/benchmark.php +++ /dev/null @@ -1,263 +0,0 @@ -<?php - -error_reporting(E_ALL); - -/** - * @package JAMA - */ - -require_once '../Matrix.php'; -require_once 'Stats.php'; - - -/** - * Example of use of Matrix Class, featuring magic squares. - */ -class Benchmark { - public $stat; - - - /** - * Simple function to replicate PHP 5 behaviour - */ - function microtime_float() { - list($usec, $sec) = explode(" ", microtime()); - - return ((float)$usec + (float)$sec); - } // function microtime_float() - - - function displayStats($times = null) { - $this->stat->setData($times); - $stats = $this->stat->calcFull(); - - echo '<table style="margin-left:32px;">'; - echo '<tr><td style="text-align:right;"><b>n:</b><td style="text-align:right;">' . $stats['count'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>Mean:</b><td style="text-align:right;">' . $stats['mean'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>Min.:</b><td style="text-align:right;">' . $stats['min'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>Max.:</b><td style="text-align:right;">' . $stats['max'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>&sigma;:</b><td style="text-align:right;">' . $stats['stdev'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>Variance:</b><td style="text-align:right;">' . $stats['variance'] . ' </td></tr>'; - echo '<tr><td style="text-align:right;"><b>Range:</b><td style="text-align:right;">' . $stats['range'] . ' </td></tr>'; - echo '</table>'; - - return $stats; - } // function displayStats() - - - function runEig($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new EigenvalueDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runEig() - - - function runLU($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new LUDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runLU() - - - function runQR($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new QRDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runQR() - - - function runCholesky($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new CholeskyDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runCholesky() - - - function runSVD($n = 4, $t = 100) { - $times = array(); - - for ($i = 0; $i < $t; ++$i) { - $M = Matrix::random($n, $n); - $start_time = $this->microtime_float(); - $E = new SingularValueDecomposition($M); - $stop_time = $this->microtime_float(); - $times[] = $stop_time - $start_time; - } - - return $times; - } // function runSVD() - - - function run() { - $n = 8; - $t = 16; - $sum = 0; - echo "<b>Cholesky decomposition: $t random {$n}x{$n} matrices</b><br />"; - $r = $this->displayStats($this->runCholesky($n, $t)); - $sum += $r['mean'] * $n; - - echo '<hr />'; - - echo "<b>Eigenvalue decomposition: $t random {$n}x{$n} matrices</b><br />"; - $r = $this->displayStats($this->runEig($n, $t)); - $sum += $r['mean'] * $n; - - echo '<hr />'; - - echo "<b>LU decomposition: $t random {$n}x{$n} matrices</b><br />"; - $r = $this->displayStats($this->runLU($n, $t)); - $sum += $r['mean'] * $n; - - echo '<hr />'; - - echo "<b>QR decomposition: $t random {$n}x{$n} matrices</b><br />"; - $r = $this->displayStats($this->runQR($n, $t)); - $sum += $r['mean'] * $n; - - echo '<hr />'; - - echo "<b>Singular Value decomposition: $t random {$n}x{$n} matrices</b><br />"; - $r = $this->displayStats($this->runSVD($n, $t)); - $sum += $r['mean'] * $n; - - return $sum; - } // function run() - - - public function __construct() { - $this->stat = new Base(); - } // function Benchmark() - -} // class Benchmark (end MagicSquareExample) - - -$benchmark = new Benchmark(); - -switch($_REQUEST['decomposition']) { - case 'cholesky': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "<b>Cholesky decomposition: $t random {$i}x{$i} matrices</b><br />"; - $s = $benchmark->displayStats($benchmark->runCholesky($i, $t)); - $m[$i] = $s['mean']; - echo "<br />"; - } - echo '<pre>'; - foreach($m as $x => $y) { - echo "$x\t" . 1000*$y . "\n"; - } - echo '</pre>'; - break; - case 'eigenvalue': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "<b>Eigenvalue decomposition: $t random {$i}x{$i} matrices</b><br />"; - $s = $benchmark->displayStats($benchmark->runEig($i, $t)); - $m[$i] = $s['mean']; - echo "<br />"; - } - echo '<pre>'; - foreach($m as $x => $y) { - echo "$x\t" . 1000*$y . "\n"; - } - echo '</pre>'; - break; - case 'lu': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "<b>LU decomposition: $t random {$i}x{$i} matrices</b><br />"; - $s = $benchmark->displayStats($benchmark->runLU($i, $t)); - $m[$i] = $s['mean']; - echo "<br />"; - } - echo '<pre>'; - foreach($m as $x => $y) { - echo "$x\t" . 1000*$y . "\n"; - } - echo '</pre>'; - break; - case 'qr': - $m = array(); - for ($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "<b>QR decomposition: $t random {$i}x{$i} matrices</b><br />"; - $s = $benchmark->displayStats($benchmark->runQR($i, $t)); - $m[$i] = $s['mean']; - echo "<br />"; - } - echo '<pre>'; - foreach($m as $x => $y) { - echo "$x\t" . 1000*$y . "\n"; - } - echo '</pre>'; - break; - case 'svd': - $m = array(); - for($i = 2; $i <= 8; $i *= 2) { - $t = 32 / $i; - echo "<b>Singular value decomposition: $t random {$i}x{$i} matrices</b><br />"; - $s = $benchmark->displayStats($benchmark->runSVD($i, $t)); - $m[$i] = $s['mean']; - echo "<br />"; - } - echo '<pre>'; - foreach($m as $x => $y) { - echo "$x\t" . 1000*$y . "\n"; - } - echo '</pre>'; - break; - case 'all': - $s = $benchmark->run(); - print("<br /><b>Total<b>: {$s}s<br />"); - break; - default: - ?> - <ul> - <li><a href="benchmark.php?decomposition=all">Complete Benchmark</a> - <ul> - <li><a href="benchmark.php?decomposition=cholesky">Cholesky</a></li> - <li><a href="benchmark.php?decomposition=eigenvalue">Eigenvalue</a></li> - <li><a href="benchmark.php?decomposition=lu">LU</a></li> - <li><a href="benchmark.php?decomposition=qr">QR</a></li> - <li><a href="benchmark.php?decomposition=svd">Singular Value</a></li> - </ul> - </li> - </ul> - <?php - break; -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/polyfit.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/polyfit.php deleted file mode 100644 index bc02fd62e6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/polyfit.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -require_once "../Matrix.php"; -/* -* @package JAMA -* @author Michael Bommarito -* @author Paul Meagher -* @version 0.1 -* -* Function to fit an order n polynomial function through -* a series of x-y data points using least squares. -* -* @param $X array x values -* @param $Y array y values -* @param $n int order of polynomial to be used for fitting -* @returns array $coeffs of polynomial coefficients -* Pre-Conditions: the system is not underdetermined: sizeof($X) > $n+1 -*/ -function polyfit($X, $Y, $n) { - for ($i = 0; $i < sizeof($X); ++$i) - for ($j = 0; $j <= $n; ++$j) - $A[$i][$j] = pow($X[$i], $j); - for ($i=0; $i < sizeof($Y); ++$i) - $B[$i] = array($Y[$i]); - $matrixA = new Matrix($A); - $matrixB = new Matrix($B); - $C = $matrixA->solve($matrixB); - return $C->getMatrix(0, $n, 0, 1); -} - -function printpoly( $C = null ) { - for($i = $C->m - 1; $i >= 0; --$i) { - $r = $C->get($i, 0); - if ( abs($r) <= pow(10, -9) ) - $r = 0; - if ($i == $C->m - 1) - echo $r . "x<sup>$i</sup>"; - else if ($i < $C->m - 1) - echo " + " . $r . "x<sup>$i</sup>"; - else if ($i == 0) - echo " + " . $r; - } -} - -$X = array(0,1,2,3,4,5); -$Y = array(4,3,12,67,228, 579); -$points = new Matrix(array($X, $Y)); -$points->toHTML(); -printpoly(polyfit($X, $Y, 4)); - -echo '<hr />'; - -$X = array(0,1,2,3,4,5); -$Y = array(1,2,5,10,17, 26); -$points = new Matrix(array($X, $Y)); -$points->toHTML(); -printpoly(polyfit($X, $Y, 2)); - -echo '<hr />'; - -$X = array(0,1,2,3,4,5,6); -$Y = array(-90,-104,-178,-252,-26, 1160, 4446); -$points = new Matrix(array($X, $Y)); -$points->toHTML(); -printpoly(polyfit($X, $Y, 5)); - -echo '<hr />'; - -$X = array(0,1,2,3,4); -$Y = array(mt_rand(0, 10), mt_rand(40, 80), mt_rand(240, 400), mt_rand(1800, 2215), mt_rand(8000, 9000)); -$points = new Matrix(array($X, $Y)); -$points->toHTML(); -printpoly(polyfit($X, $Y, 3)); -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/tile.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/tile.php deleted file mode 100644 index 7a47ea57b2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/examples/tile.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -include "../Matrix.php"; - -/** -* Tiling of matrix X in [rowWise by colWise] dimension. Tiling -* creates a larger matrix than the original data X. Example, if -* X is to be tiled in a [3 x 4] manner, then: -* -* / \ -* | X X X X | -* C = | X X X X | -* | X X X X | -* \ / -* -* @param X Matrix -* @param rowWise int -* @param colWise int -* @return Matrix -*/ - -function tile(&$X, $rowWise, $colWise){ - - $xArray = $X->getArray(); - print_r($xArray); - - $countRow = 0; - $countColumn = 0; - - $m = $X->getRowDimension(); - $n = $X->getColumnDimension(); - - if( $rowWise<1 || $colWise<1 ){ - die("tile : Array index is out-of-bound."); - } - - $newRowDim = $m*$rowWise; - $newColDim = $n*$colWise; - - $result = array(); - - for($i=0 ; $i<$newRowDim; ++$i) { - - $holder = array(); - - for($j=0 ; $j<$newColDim ; ++$j) { - - $holder[$j] = $xArray[$countRow][$countColumn++]; - - // reset the column-index to zero to avoid reference to out-of-bound index in xArray[][] - - if($countColumn == $n) { $countColumn = 0; } - - } // end for - - ++$countRow; - - // reset the row-index to zero to avoid reference to out-of-bound index in xArray[][] - - if($countRow == $m) { $countRow = 0; } - - $result[$i] = $holder; - - } // end for - - return new Matrix($result); - -} - - -$X =array(1,2,3,4,5,6,7,8,9); -$nRow = 3; -$nCol = 3; -$tiled_matrix = tile(new Matrix($X), $nRow, $nCol); -echo "<pre>"; -print_r($tiled_matrix); -echo "</pre>"; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/tests/TestMatrix.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/tests/TestMatrix.php deleted file mode 100644 index 5290ceb5af..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/tests/TestMatrix.php +++ /dev/null @@ -1,415 +0,0 @@ -<?php - -require_once "../Matrix.php"; - -class TestMatrix { - - function TestMatrix() { - - // define test variables - - $errorCount = 0; - $warningCount = 0; - $columnwise = array(1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.); - $rowwise = array(1.,4.,7.,10.,2.,5.,8.,11.,3.,6.,9.,12.); - $avals = array(array(1.,4.,7.,10.),array(2.,5.,8.,11.),array(3.,6.,9.,12.)); - $rankdef = $avals; - $tvals = array(array(1.,2.,3.),array(4.,5.,6.),array(7.,8.,9.),array(10.,11.,12.)); - $subavals = array(array(5.,8.,11.),array(6.,9.,12.)); - $rvals = array(array(1.,4.,7.),array(2.,5.,8.,11.),array(3.,6.,9.,12.)); - $pvals = array(array(1.,1.,1.),array(1.,2.,3.),array(1.,3.,6.)); - $ivals = array(array(1.,0.,0.,0.),array(0.,1.,0.,0.),array(0.,0.,1.,0.)); - $evals = array(array(0.,1.,0.,0.),array(1.,0.,2.e-7,0.),array(0.,-2.e-7,0.,1.),array(0.,0.,1.,0.)); - $square = array(array(166.,188.,210.),array(188.,214.,240.),array(210.,240.,270.)); - $sqSolution = array(array(13.),array(15.)); - $condmat = array(array(1.,3.),array(7.,9.)); - $rows = 3; - $cols = 4; - $invalidID = 5; /* should trigger bad shape for construction with val */ - $raggedr = 0; /* (raggedr,raggedc) should be out of bounds in ragged array */ - $raggedc = 4; - $validID = 3; /* leading dimension of intended test Matrices */ - $nonconformld = 4; /* leading dimension which is valid, but nonconforming */ - $ib = 1; /* index ranges for sub Matrix */ - $ie = 2; - $jb = 1; - $je = 3; - $rowindexset = array(1,2); - $badrowindexset = array(1,3); - $columnindexset = array(1,2,3); - $badcolumnindexset = array(1,2,4); - $columnsummax = 33.; - $rowsummax = 30.; - $sumofdiagonals = 15; - $sumofsquares = 650; - - /** - * Test matrix methods - */ - - /** - * Constructors and constructor-like methods: - * - * Matrix(double[], int) - * Matrix(double[][]) - * Matrix(int, int) - * Matrix(int, int, double) - * Matrix(int, int, double[][]) - * constructWithCopy(double[][]) - * random(int,int) - * identity(int) - */ - echo "<p>Testing constructors and constructor-like methods...</p>"; - - $A = new Matrix($columnwise, 3); - if($A instanceof Matrix) { - $this->try_success("Column-packed constructor..."); - } else - $errorCount = $this->try_failure($errorCount, "Column-packed constructor...", "Unable to construct Matrix"); - - $T = new Matrix($tvals); - if($T instanceof Matrix) - $this->try_success("2D array constructor..."); - else - $errorCount = $this->try_failure($errorCount, "2D array constructor...", "Unable to construct Matrix"); - - $A = new Matrix($columnwise, $validID); - $B = new Matrix($avals); - $tmp = $B->get(0,0); - $avals[0][0] = 0.0; - $C = $B->minus($A); - $avals[0][0] = $tmp; - $B = Matrix::constructWithCopy($avals); - $tmp = $B->get(0,0); - $avals[0][0] = 0.0; - /** check that constructWithCopy behaves properly **/ - if ( ( $tmp - $B->get(0,0) ) != 0.0 ) - $errorCount = $this->try_failure($errorCount,"constructWithCopy... ","copy not effected... data visible outside"); - else - $this->try_success("constructWithCopy... ",""); - - $I = new Matrix($ivals); - if ( $this->checkMatrices($I,Matrix::identity(3,4)) ) - $this->try_success("identity... ",""); - else - $errorCount = $this->try_failure($errorCount,"identity... ","identity Matrix not successfully created"); - - /** - * Access Methods: - * - * getColumnDimension() - * getRowDimension() - * getArray() - * getArrayCopy() - * getColumnPackedCopy() - * getRowPackedCopy() - * get(int,int) - * getMatrix(int,int,int,int) - * getMatrix(int,int,int[]) - * getMatrix(int[],int,int) - * getMatrix(int[],int[]) - * set(int,int,double) - * setMatrix(int,int,int,int,Matrix) - * setMatrix(int,int,int[],Matrix) - * setMatrix(int[],int,int,Matrix) - * setMatrix(int[],int[],Matrix) - */ - print "<p>Testing access methods...</p>"; - - $B = new Matrix($avals); - if($B->getRowDimension() == $rows) - $this->try_success("getRowDimension..."); - else - $errorCount = $this->try_failure($errorCount, "getRowDimension..."); - - if($B->getColumnDimension() == $cols) - $this->try_success("getColumnDimension..."); - else - $errorCount = $this->try_failure($errorCount, "getColumnDimension..."); - - $barray = $B->getArray(); - if($this->checkArrays($barray, $avals)) - $this->try_success("getArray..."); - else - $errorCount = $this->try_failure($errorCount, "getArray..."); - - $bpacked = $B->getColumnPackedCopy(); - if($this->checkArrays($bpacked, $columnwise)) - $this->try_success("getColumnPackedCopy..."); - else - $errorCount = $this->try_failure($errorCount, "getColumnPackedCopy..."); - - $bpacked = $B->getRowPackedCopy(); - if($this->checkArrays($bpacked, $rowwise)) - $this->try_success("getRowPackedCopy..."); - else - $errorCount = $this->try_failure($errorCount, "getRowPackedCopy..."); - - /** - * Array-like methods: - * minus - * minusEquals - * plus - * plusEquals - * arrayLeftDivide - * arrayLeftDivideEquals - * arrayRightDivide - * arrayRightDivideEquals - * arrayTimes - * arrayTimesEquals - * uminus - */ - print "<p>Testing array-like methods...</p>"; - - /** - * I/O methods: - * read - * print - * serializable: - * writeObject - * readObject - */ - print "<p>Testing I/O methods...</p>"; - - /** - * Test linear algebra methods - */ - echo "<p>Testing linear algebra methods...<p>"; - - $A = new Matrix($columnwise, 3); - if( $this->checkMatrices($A->transpose(), $T) ) - $this->try_success("Transpose check..."); - else - $errorCount = $this->try_failure($errorCount, "Transpose check...", "Matrices are not equal"); - - if($this->checkScalars($A->norm1(), $columnsummax)) - $this->try_success("Maximum column sum..."); - else - $errorCount = $this->try_failure($errorCount, "Maximum column sum...", "Incorrect: " . $A->norm1() . " != " . $columnsummax); - - if($this->checkScalars($A->normInf(), $rowsummax)) - $this->try_success("Maximum row sum..."); - else - $errorCount = $this->try_failure($errorCount, "Maximum row sum...", "Incorrect: " . $A->normInf() . " != " . $rowsummax ); - - if($this->checkScalars($A->normF(), sqrt($sumofsquares))) - $this->try_success("Frobenius norm..."); - else - $errorCount = $this->try_failure($errorCount, "Frobenius norm...", "Incorrect:" . $A->normF() . " != " . sqrt($sumofsquares)); - - if($this->checkScalars($A->trace(), $sumofdiagonals)) - $this->try_success("Matrix trace..."); - else - $errorCount = $this->try_failure($errorCount, "Matrix trace...", "Incorrect: " . $A->trace() . " != " . $sumofdiagonals); - - $B = $A->getMatrix(0, $A->getRowDimension(), 0, $A->getRowDimension()); - if( $B->det() == 0 ) - $this->try_success("Matrix determinant..."); - else - $errorCount = $this->try_failure($errorCount, "Matrix determinant...", "Incorrect: " . $B->det() . " != " . 0); - - $A = new Matrix($columnwise,3); - $SQ = new Matrix($square); - if ($this->checkMatrices($SQ, $A->times($A->transpose()))) - $this->try_success("times(Matrix)..."); - else { - $errorCount = $this->try_failure($errorCount, "times(Matrix)...", "Unable to multiply matrices"); - $SQ->toHTML(); - $AT->toHTML(); - } - - $A = new Matrix($columnwise, 4); - - $QR = $A->qr(); - $R = $QR->getR(); - $Q = $QR->getQ(); - if($this->checkMatrices($A, $Q->times($R))) - $this->try_success("QRDecomposition...",""); - else - $errorCount = $this->try_failure($errorCount,"QRDecomposition...","incorrect qr decomposition calculation"); - - $A = new Matrix($columnwise, 4); - $SVD = $A->svd(); - $U = $SVD->getU(); - $S = $SVD->getS(); - $V = $SVD->getV(); - if ($this->checkMatrices($A, $U->times($S->times($V->transpose())))) - $this->try_success("SingularValueDecomposition...",""); - else - $errorCount = $this->try_failure($errorCount,"SingularValueDecomposition...","incorrect singular value decomposition calculation"); - - $n = $A->getColumnDimension(); - $A = $A->getMatrix(0,$n-1,0,$n-1); - $A->set(0,0,0.); - - $LU = $A->lu(); - $L = $LU->getL(); - if ( $this->checkMatrices($A->getMatrix($LU->getPivot(),0,$n-1), $L->times($LU->getU())) ) - $this->try_success("LUDecomposition...",""); - else - $errorCount = $this->try_failure($errorCount,"LUDecomposition...","incorrect LU decomposition calculation"); - - $X = $A->inverse(); - if ( $this->checkMatrices($A->times($X),Matrix::identity(3,3)) ) - $this->try_success("inverse()...",""); - else - $errorCount = $this->try_failure($errorCount, "inverse()...","incorrect inverse calculation"); - - $DEF = new Matrix($rankdef); - if($this->checkScalars($DEF->rank(), min($DEF->getRowDimension(), $DEF->getColumnDimension())-1)) - $this->try_success("Rank..."); - else - $this->try_failure("Rank...", "incorrect rank calculation"); - - $B = new Matrix($condmat); - $SVD = $B->svd(); - $singularvalues = $SVD->getSingularValues(); - if($this->checkScalars($B->cond(), $singularvalues[0]/$singularvalues[min($B->getRowDimension(), $B->getColumnDimension())-1])) - $this->try_success("Condition number..."); - else - $this->try_failure("Condition number...", "incorrect condition number calculation"); - - $SUB = new Matrix($subavals); - $O = new Matrix($SUB->getRowDimension(),1,1.0); - $SOL = new Matrix($sqSolution); - $SQ = $SUB->getMatrix(0,$SUB->getRowDimension()-1,0,$SUB->getRowDimension()-1); - if ( $this->checkMatrices($SQ->solve($SOL),$O) ) - $this->try_success("solve()...",""); - else - $errorCount = $this->try_failure($errorCount,"solve()...","incorrect lu solve calculation"); - - $A = new Matrix($pvals); - $Chol = $A->chol(); - $L = $Chol->getL(); - if ( $this->checkMatrices($A, $L->times($L->transpose())) ) - $this->try_success("CholeskyDecomposition...",""); - else - $errorCount = $this->try_failure($errorCount,"CholeskyDecomposition...","incorrect Cholesky decomposition calculation"); - - $X = $Chol->solve(Matrix::identity(3,3)); - if ( $this->checkMatrices($A->times($X), Matrix::identity(3,3)) ) - $this->try_success("CholeskyDecomposition solve()...",""); - else - $errorCount = $this->try_failure($errorCount,"CholeskyDecomposition solve()...","incorrect Choleskydecomposition solve calculation"); - - $Eig = $A->eig(); - $D = $Eig->getD(); - $V = $Eig->getV(); - if( $this->checkMatrices($A->times($V),$V->times($D)) ) - $this->try_success("EigenvalueDecomposition (symmetric)...",""); - else - $errorCount = $this->try_failure($errorCount,"EigenvalueDecomposition (symmetric)...","incorrect symmetric Eigenvalue decomposition calculation"); - - $A = new Matrix($evals); - $Eig = $A->eig(); - $D = $Eig->getD(); - $V = $Eig->getV(); - if ( $this->checkMatrices($A->times($V),$V->times($D)) ) - $this->try_success("EigenvalueDecomposition (nonsymmetric)...",""); - else - $errorCount = $this->try_failure($errorCount,"EigenvalueDecomposition (nonsymmetric)...","incorrect nonsymmetric Eigenvalue decomposition calculation"); - - print("<b>{$errorCount} total errors</b>."); - } - - /** - * Print appropriate messages for successful outcome try - * @param string $s - * @param string $e - */ - function try_success($s, $e = "") { - print "> ". $s ."success<br />"; - if ($e != "") - print "> Message: ". $e ."<br />"; - } - - /** - * Print appropriate messages for unsuccessful outcome try - * @param int $count - * @param string $s - * @param string $e - * @return int incremented counter - */ - function try_failure($count, $s, $e="") { - print "> ". $s ."*** failure ***<br />> Message: ". $e ."<br />"; - return ++$count; - } - - /** - * Print appropriate messages for unsuccessful outcome try - * @param int $count - * @param string $s - * @param string $e - * @return int incremented counter - */ - function try_warning($count, $s, $e="") { - print "> ". $s ."*** warning ***<br />> Message: ". $e ."<br />"; - return ++$count; - } - - /** - * Check magnitude of difference of "scalars". - * @param float $x - * @param float $y - */ - function checkScalars($x, $y) { - $eps = pow(2.0,-52.0); - if ($x == 0 & abs($y) < 10*$eps) return; - if ($y == 0 & abs($x) < 10*$eps) return; - if (abs($x-$y) > 10 * $eps * max(abs($x),abs($y))) - return false; - else - return true; - } - - /** - * Check norm of difference of "vectors". - * @param float $x[] - * @param float $y[] - */ - function checkVectors($x, $y) { - $nx = count($x); - $ny = count($y); - if ($nx == $ny) - for($i=0; $i < $nx; ++$i) - $this->checkScalars($x[$i],$y[$i]); - else - die("Attempt to compare vectors of different lengths"); - } - - /** - * Check norm of difference of "arrays". - * @param float $x[][] - * @param float $y[][] - */ - function checkArrays($x, $y) { - $A = new Matrix($x); - $B = new Matrix($y); - return $this->checkMatrices($A,$B); - } - - /** - * Check norm of difference of "matrices". - * @param matrix $X - * @param matrix $Y - */ - function checkMatrices($X = null, $Y = null) { - if( $X == null || $Y == null ) - return false; - - $eps = pow(2.0,-52.0); - if ($X->norm1() == 0. & $Y->norm1() < 10*$eps) return true; - if ($Y->norm1() == 0. & $X->norm1() < 10*$eps) return true; - - $A = $X->minus($Y); - - if ($A->norm1() > 1000 * $eps * max($X->norm1(),$Y->norm1())) - die("The norm of (X-Y) is too large: ".$A->norm1()); - else - return true; - } - -} - -$test = new TestMatrix; -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Error.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Error.php deleted file mode 100644 index e73252b3d6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Error.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * @package JAMA - * - * Error handling - * @author Michael Bommarito - * @version 01292005 - */ - -//Language constant -define('JAMALANG', 'EN'); - - -//All errors may be defined by the following format: -//define('ExceptionName', N); -//$error['lang'][ExceptionName] = 'Error message'; -$error = array(); - -/* -I've used Babelfish and a little poor knowledge of Romance/Germanic languages for the translations here. -Feel free to correct anything that looks amiss to you. -*/ - -define('PolymorphicArgumentException', -1); -$error['EN'][PolymorphicArgumentException] = "Invalid argument pattern for polymorphic function."; -$error['FR'][PolymorphicArgumentException] = "Modèle inadmissible d'argument pour la fonction polymorphe.". -$error['DE'][PolymorphicArgumentException] = "Unzulässiges Argumentmuster für polymorphe Funktion."; - -define('ArgumentTypeException', -2); -$error['EN'][ArgumentTypeException] = "Invalid argument type."; -$error['FR'][ArgumentTypeException] = "Type inadmissible d'argument."; -$error['DE'][ArgumentTypeException] = "Unzulässige Argumentart."; - -define('ArgumentBoundsException', -3); -$error['EN'][ArgumentBoundsException] = "Invalid argument range."; -$error['FR'][ArgumentBoundsException] = "Gamme inadmissible d'argument."; -$error['DE'][ArgumentBoundsException] = "Unzulässige Argumentstrecke."; - -define('MatrixDimensionException', -4); -$error['EN'][MatrixDimensionException] = "Matrix dimensions are not equal."; -$error['FR'][MatrixDimensionException] = "Les dimensions de Matrix ne sont pas égales."; -$error['DE'][MatrixDimensionException] = "Matrixmaße sind nicht gleich."; - -define('PrecisionLossException', -5); -$error['EN'][PrecisionLossException] = "Significant precision loss detected."; -$error['FR'][PrecisionLossException] = "Perte significative de précision détectée."; -$error['DE'][PrecisionLossException] = "Bedeutender Präzision Verlust ermittelte."; - -define('MatrixSPDException', -6); -$error['EN'][MatrixSPDException] = "Can only perform operation on symmetric positive definite matrix."; -$error['FR'][MatrixSPDException] = "Perte significative de précision détectée."; -$error['DE'][MatrixSPDException] = "Bedeutender Präzision Verlust ermittelte."; - -define('MatrixSingularException', -7); -$error['EN'][MatrixSingularException] = "Can only perform operation on singular matrix."; - -define('MatrixRankException', -8); -$error['EN'][MatrixRankException] = "Can only perform operation on full-rank matrix."; - -define('ArrayLengthException', -9); -$error['EN'][ArrayLengthException] = "Array length must be a multiple of m."; - -define('RowLengthException', -10); -$error['EN'][RowLengthException] = "All rows must have the same length."; - -/** - * Custom error handler - * @param int $num Error number - */ -function JAMAError($errorNumber = null) { - global $error; - - if (isset($errorNumber)) { - if (isset($error[JAMALANG][$errorNumber])) { - return $error[JAMALANG][$errorNumber]; - } else { - return $error['EN'][$errorNumber]; - } - } else { - return ("Invalid argument to JAMAError()"); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Maths.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Maths.php deleted file mode 100644 index f5e2a37216..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/JAMA/utils/Maths.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * @package JAMA - * - * Pythagorean Theorem: - * - * a = 3 - * b = 4 - * r = sqrt(square(a) + square(b)) - * r = 5 - * - * r = sqrt(a^2 + b^2) without under/overflow. - */ -function hypo($a, $b) { - if (abs($a) > abs($b)) { - $r = $b / $a; - $r = abs($a) * sqrt(1 + $r * $r); - } elseif ($b != 0) { - $r = $a / $b; - $r = abs($b) * sqrt(1 + $r * $r); - } else { - $r = 0.0; - } - return $r; -} // function hypo() - - -/** - * Mike Bommarito's version. - * Compute n-dimensional hyotheneuse. - * -function hypot() { - $s = 0; - foreach (func_get_args() as $d) { - if (is_numeric($d)) { - $s += pow($d, 2); - } else { - throw new Exception(JAMAError(ArgumentTypeException)); - } - } - return sqrt($s); -} -*/ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE.php deleted file mode 100644 index a5c8dd1d00..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE.php +++ /dev/null @@ -1,531 +0,0 @@ -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Xavier Noguer <xnoguer@php.net> | -// | Based on OLE::Storage_Lite by Kawai, Takanori | -// +----------------------------------------------------------------------+ -// -// $Id: OLE.php,v 1.13 2007/03/07 14:38:25 schmidt Exp $ - - -/** -* Array for storing OLE instances that are accessed from -* OLE_ChainedBlockStream::stream_open(). -* @var array -*/ -$GLOBALS['_OLE_INSTANCES'] = array(); - -/** -* OLE package base class. -* -* @author Xavier Noguer <xnoguer@php.net> -* @author Christian Schmidt <schmidt@php.net> -* @category PHPExcel -* @package PHPExcel_Shared_OLE -*/ -class PHPExcel_Shared_OLE -{ - const OLE_PPS_TYPE_ROOT = 5; - const OLE_PPS_TYPE_DIR = 1; - const OLE_PPS_TYPE_FILE = 2; - const OLE_DATA_SIZE_SMALL = 0x1000; - const OLE_LONG_INT_SIZE = 4; - const OLE_PPS_SIZE = 0x80; - - /** - * The file handle for reading an OLE container - * @var resource - */ - public $_file_handle; - - /** - * Array of PPS's found on the OLE container - * @var array - */ - public $_list = array(); - - /** - * Root directory of OLE container - * @var OLE_PPS_Root - */ - public $root; - - /** - * Big Block Allocation Table - * @var array (blockId => nextBlockId) - */ - public $bbat; - - /** - * Short Block Allocation Table - * @var array (blockId => nextBlockId) - */ - public $sbat; - - /** - * Size of big blocks. This is usually 512. - * @var int number of octets per block. - */ - public $bigBlockSize; - - /** - * Size of small blocks. This is usually 64. - * @var int number of octets per block - */ - public $smallBlockSize; - - /** - * Reads an OLE container from the contents of the file given. - * - * @acces public - * @param string $file - * @return mixed true on success, PEAR_Error on failure - */ - public function read($file) - { - $fh = fopen($file, "r"); - if (!$fh) { - throw new Exception("Can't open file $file"); - } - $this->_file_handle = $fh; - - $signature = fread($fh, 8); - if ("\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" != $signature) { - throw new Exception("File doesn't seem to be an OLE container."); - } - fseek($fh, 28); - if (fread($fh, 2) != "\xFE\xFF") { - // This shouldn't be a problem in practice - throw new Exception("Only Little-Endian encoding is supported."); - } - // Size of blocks and short blocks in bytes - $this->bigBlockSize = pow(2, self::_readInt2($fh)); - $this->smallBlockSize = pow(2, self::_readInt2($fh)); - - // Skip UID, revision number and version number - fseek($fh, 44); - // Number of blocks in Big Block Allocation Table - $bbatBlockCount = self::_readInt4($fh); - - // Root chain 1st block - $directoryFirstBlockId = self::_readInt4($fh); - - // Skip unused bytes - fseek($fh, 56); - // Streams shorter than this are stored using small blocks - $this->bigBlockThreshold = self::_readInt4($fh); - // Block id of first sector in Short Block Allocation Table - $sbatFirstBlockId = self::_readInt4($fh); - // Number of blocks in Short Block Allocation Table - $sbbatBlockCount = self::_readInt4($fh); - // Block id of first sector in Master Block Allocation Table - $mbatFirstBlockId = self::_readInt4($fh); - // Number of blocks in Master Block Allocation Table - $mbbatBlockCount = self::_readInt4($fh); - $this->bbat = array(); - - // Remaining 4 * 109 bytes of current block is beginning of Master - // Block Allocation Table - $mbatBlocks = array(); - for ($i = 0; $i < 109; ++$i) { - $mbatBlocks[] = self::_readInt4($fh); - } - - // Read rest of Master Block Allocation Table (if any is left) - $pos = $this->_getBlockOffset($mbatFirstBlockId); - for ($i = 0; $i < $mbbatBlockCount; ++$i) { - fseek($fh, $pos); - for ($j = 0; $j < $this->bigBlockSize / 4 - 1; ++$j) { - $mbatBlocks[] = self::_readInt4($fh); - } - // Last block id in each block points to next block - $pos = $this->_getBlockOffset(self::_readInt4($fh)); - } - - // Read Big Block Allocation Table according to chain specified by - // $mbatBlocks - for ($i = 0; $i < $bbatBlockCount; ++$i) { - $pos = $this->_getBlockOffset($mbatBlocks[$i]); - fseek($fh, $pos); - for ($j = 0 ; $j < $this->bigBlockSize / 4; ++$j) { - $this->bbat[] = self::_readInt4($fh); - } - } - - // Read short block allocation table (SBAT) - $this->sbat = array(); - $shortBlockCount = $sbbatBlockCount * $this->bigBlockSize / 4; - $sbatFh = $this->getStream($sbatFirstBlockId); - for ($blockId = 0; $blockId < $shortBlockCount; ++$blockId) { - $this->sbat[$blockId] = self::_readInt4($sbatFh); - } - fclose($sbatFh); - - $this->_readPpsWks($directoryFirstBlockId); - - return true; - } - - /** - * @param int block id - * @param int byte offset from beginning of file - * @access public - */ - public function _getBlockOffset($blockId) - { - return 512 + $blockId * $this->bigBlockSize; - } - - /** - * Returns a stream for use with fread() etc. External callers should - * use PHPExcel_Shared_OLE_PPS_File::getStream(). - * @param int|PPS block id or PPS - * @return resource read-only stream - */ - public function getStream($blockIdOrPps) - { - static $isRegistered = false; - if (!$isRegistered) { - stream_wrapper_register('ole-chainedblockstream', - 'PHPExcel_Shared_OLE_ChainedBlockStream'); - $isRegistered = true; - } - - // Store current instance in global array, so that it can be accessed - // in OLE_ChainedBlockStream::stream_open(). - // Object is removed from self::$instances in OLE_Stream::close(). - $GLOBALS['_OLE_INSTANCES'][] = $this; - $instanceId = end(array_keys($GLOBALS['_OLE_INSTANCES'])); - - $path = 'ole-chainedblockstream://oleInstanceId=' . $instanceId; - if ($blockIdOrPps instanceof PHPExcel_Shared_OLE_PPS) { - $path .= '&blockId=' . $blockIdOrPps->_StartBlock; - $path .= '&size=' . $blockIdOrPps->Size; - } else { - $path .= '&blockId=' . $blockIdOrPps; - } - return fopen($path, 'r'); - } - - /** - * Reads a signed char. - * @param resource file handle - * @return int - * @access public - */ - private static function _readInt1($fh) - { - list(, $tmp) = unpack("c", fread($fh, 1)); - return $tmp; - } - - /** - * Reads an unsigned short (2 octets). - * @param resource file handle - * @return int - * @access public - */ - private static function _readInt2($fh) - { - list(, $tmp) = unpack("v", fread($fh, 2)); - return $tmp; - } - - /** - * Reads an unsigned long (4 octets). - * @param resource file handle - * @return int - * @access public - */ - private static function _readInt4($fh) - { - list(, $tmp) = unpack("V", fread($fh, 4)); - return $tmp; - } - - /** - * Gets information about all PPS's on the OLE container from the PPS WK's - * creates an OLE_PPS object for each one. - * - * @access public - * @param integer the block id of the first block - * @return mixed true on success, PEAR_Error on failure - */ - public function _readPpsWks($blockId) - { - $fh = $this->getStream($blockId); - for ($pos = 0; ; $pos += 128) { - fseek($fh, $pos, SEEK_SET); - $nameUtf16 = fread($fh, 64); - $nameLength = self::_readInt2($fh); - $nameUtf16 = substr($nameUtf16, 0, $nameLength - 2); - // Simple conversion from UTF-16LE to ISO-8859-1 - $name = str_replace("\x00", "", $nameUtf16); - $type = self::_readInt1($fh); - switch ($type) { - case self::OLE_PPS_TYPE_ROOT: - $pps = new PHPExcel_Shared_OLE_PPS_Root(null, null, array()); - $this->root = $pps; - break; - case self::OLE_PPS_TYPE_DIR: - $pps = new PHPExcel_Shared_OLE_PPS(null, null, null, null, null, - null, null, null, null, array()); - break; - case self::OLE_PPS_TYPE_FILE: - $pps = new PHPExcel_Shared_OLE_PPS_File($name); - break; - default: - continue; - } - fseek($fh, 1, SEEK_CUR); - $pps->Type = $type; - $pps->Name = $name; - $pps->PrevPps = self::_readInt4($fh); - $pps->NextPps = self::_readInt4($fh); - $pps->DirPps = self::_readInt4($fh); - fseek($fh, 20, SEEK_CUR); - $pps->Time1st = self::OLE2LocalDate(fread($fh, 8)); - $pps->Time2nd = self::OLE2LocalDate(fread($fh, 8)); - $pps->_StartBlock = self::_readInt4($fh); - $pps->Size = self::_readInt4($fh); - $pps->No = count($this->_list); - $this->_list[] = $pps; - - // check if the PPS tree (starting from root) is complete - if (isset($this->root) && - $this->_ppsTreeComplete($this->root->No)) { - - break; - } - } - fclose($fh); - - // Initialize $pps->children on directories - foreach ($this->_list as $pps) { - if ($pps->Type == self::OLE_PPS_TYPE_DIR || $pps->Type == self::OLE_PPS_TYPE_ROOT) { - $nos = array($pps->DirPps); - $pps->children = array(); - while ($nos) { - $no = array_pop($nos); - if ($no != -1) { - $childPps = $this->_list[$no]; - $nos[] = $childPps->PrevPps; - $nos[] = $childPps->NextPps; - $pps->children[] = $childPps; - } - } - } - } - - return true; - } - - /** - * It checks whether the PPS tree is complete (all PPS's read) - * starting with the given PPS (not necessarily root) - * - * @access public - * @param integer $index The index of the PPS from which we are checking - * @return boolean Whether the PPS tree for the given PPS is complete - */ - public function _ppsTreeComplete($index) - { - return isset($this->_list[$index]) && - ($pps = $this->_list[$index]) && - ($pps->PrevPps == -1 || - $this->_ppsTreeComplete($pps->PrevPps)) && - ($pps->NextPps == -1 || - $this->_ppsTreeComplete($pps->NextPps)) && - ($pps->DirPps == -1 || - $this->_ppsTreeComplete($pps->DirPps)); - } - - /** - * Checks whether a PPS is a File PPS or not. - * If there is no PPS for the index given, it will return false. - * - * @access public - * @param integer $index The index for the PPS - * @return bool true if it's a File PPS, false otherwise - */ - public function isFile($index) - { - if (isset($this->_list[$index])) { - return ($this->_list[$index]->Type == self::OLE_PPS_TYPE_FILE); - } - return false; - } - - /** - * Checks whether a PPS is a Root PPS or not. - * If there is no PPS for the index given, it will return false. - * - * @access public - * @param integer $index The index for the PPS. - * @return bool true if it's a Root PPS, false otherwise - */ - public function isRoot($index) - { - if (isset($this->_list[$index])) { - return ($this->_list[$index]->Type == self::OLE_PPS_TYPE_ROOT); - } - return false; - } - - /** - * Gives the total number of PPS's found in the OLE container. - * - * @access public - * @return integer The total number of PPS's found in the OLE container - */ - public function ppsTotal() - { - return count($this->_list); - } - - /** - * Gets data from a PPS - * If there is no PPS for the index given, it will return an empty string. - * - * @access public - * @param integer $index The index for the PPS - * @param integer $position The position from which to start reading - * (relative to the PPS) - * @param integer $length The amount of bytes to read (at most) - * @return string The binary string containing the data requested - * @see OLE_PPS_File::getStream() - */ - public function getData($index, $position, $length) - { - // if position is not valid return empty string - if (!isset($this->_list[$index]) || ($position >= $this->_list[$index]->Size) || ($position < 0)) { - return ''; - } - $fh = $this->getStream($this->_list[$index]); - $data = stream_get_contents($fh, $length, $position); - fclose($fh); - return $data; - } - - /** - * Gets the data length from a PPS - * If there is no PPS for the index given, it will return 0. - * - * @access public - * @param integer $index The index for the PPS - * @return integer The amount of bytes in data the PPS has - */ - public function getDataLength($index) - { - if (isset($this->_list[$index])) { - return $this->_list[$index]->Size; - } - return 0; - } - - /** - * Utility function to transform ASCII text to Unicode - * - * @access public - * @static - * @param string $ascii The ASCII string to transform - * @return string The string in Unicode - */ - public static function Asc2Ucs($ascii) - { - $rawname = ''; - for ($i = 0; $i < strlen($ascii); ++$i) { - $rawname .= $ascii{$i} . "\x00"; - } - return $rawname; - } - - /** - * Utility function - * Returns a string for the OLE container with the date given - * - * @access public - * @static - * @param integer $date A timestamp - * @return string The string for the OLE container - */ - public static function LocalDate2OLE($date = null) - { - if (!isset($date)) { - return "\x00\x00\x00\x00\x00\x00\x00\x00"; - } - - // factor used for separating numbers into 4 bytes parts - $factor = pow(2, 32); - - // days from 1-1-1601 until the beggining of UNIX era - $days = 134774; - // calculate seconds - $big_date = $days*24*3600 + gmmktime(date("H",$date),date("i",$date),date("s",$date), - date("m",$date),date("d",$date),date("Y",$date)); - // multiply just to make MS happy - $big_date *= 10000000; - - $high_part = floor($big_date / $factor); - // lower 4 bytes - $low_part = floor((($big_date / $factor) - $high_part) * $factor); - - // Make HEX string - $res = ''; - - for ($i = 0; $i < 4; ++$i) { - $hex = $low_part % 0x100; - $res .= pack('c', $hex); - $low_part /= 0x100; - } - for ($i = 0; $i < 4; ++$i) { - $hex = $high_part % 0x100; - $res .= pack('c', $hex); - $high_part /= 0x100; - } - return $res; - } - - /** - * Returns a timestamp from an OLE container's date - * - * @access public - * @static - * @param integer $string A binary string with the encoded date - * @return string The timestamp corresponding to the string - */ - public static function OLE2LocalDate($string) - { - if (strlen($string) != 8) { - return new PEAR_Error("Expecting 8 byte string"); - } - - // factor used for separating numbers into 4 bytes parts - $factor = pow(2,32); - list(, $high_part) = unpack('V', substr($string, 4, 4)); - list(, $low_part) = unpack('V', substr($string, 0, 4)); - - $big_date = ($high_part * $factor) + $low_part; - // translate to seconds - $big_date /= 10000000; - - // days from 1-1-1601 until the beggining of UNIX era - $days = 134774; - - // translate to seconds from beggining of UNIX era - $big_date -= $days * 24 * 3600; - return floor($big_date); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/ChainedBlockStream.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/ChainedBlockStream.php deleted file mode 100644 index b838b96c27..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/ChainedBlockStream.php +++ /dev/null @@ -1,224 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (C) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_OLE - * @copyright Copyright (c) 2006 - 2007 Christian Schmidt - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -/** - * PHPExcel_Shared_OLE_ChainedBlockStream - * - * Stream wrapper for reading data stored in an OLE file. Implements methods - * for PHP's stream_wrapper_register(). For creating streams using this - * wrapper, use PHPExcel_Shared_OLE_PPS_File::getStream(). - * - * @category PHPExcel - * @package PHPExcel_Shared_OLE - */ -class PHPExcel_Shared_OLE_ChainedBlockStream -{ - /** - * The OLE container of the file that is being read. - * @var OLE - */ - public $ole; - - /** - * Parameters specified by fopen(). - * @var array - */ - public $params; - - /** - * The binary data of the file. - * @var string - */ - public $data; - - /** - * The file pointer. - * @var int byte offset - */ - public $pos; - - /** - * Implements support for fopen(). - * For creating streams using this wrapper, use OLE_PPS_File::getStream(). - * @param string resource name including scheme, e.g. - * ole-chainedblockstream://oleInstanceId=1 - * @param string only "r" is supported - * @param int mask of STREAM_REPORT_ERRORS and STREAM_USE_PATH - * @param string absolute path of the opened stream (out parameter) - * @return bool true on success - */ - public function stream_open($path, $mode, $options, &$openedPath) - { - if ($mode != 'r') { - if ($options & STREAM_REPORT_ERRORS) { - trigger_error('Only reading is supported', E_USER_WARNING); - } - return false; - } - - // 25 is length of "ole-chainedblockstream://" - parse_str(substr($path, 25), $this->params); - if (!isset($this->params['oleInstanceId'], - $this->params['blockId'], - $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']])) { - - if ($options & STREAM_REPORT_ERRORS) { - trigger_error('OLE stream not found', E_USER_WARNING); - } - return false; - } - $this->ole = $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']]; - - $blockId = $this->params['blockId']; - $this->data = ''; - if (isset($this->params['size']) && - $this->params['size'] < $this->ole->bigBlockThreshold && - $blockId != $this->ole->root->_StartBlock) { - - // Block id refers to small blocks - $rootPos = $this->ole->_getBlockOffset($this->ole->root->_StartBlock); - while ($blockId != -2) { - $pos = $rootPos + $blockId * $this->ole->bigBlockSize; - $blockId = $this->ole->sbat[$blockId]; - fseek($this->ole->_file_handle, $pos); - $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize); - } - } else { - // Block id refers to big blocks - while ($blockId != -2) { - $pos = $this->ole->_getBlockOffset($blockId); - fseek($this->ole->_file_handle, $pos); - $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize); - $blockId = $this->ole->bbat[$blockId]; - } - } - if (isset($this->params['size'])) { - $this->data = substr($this->data, 0, $this->params['size']); - } - - if ($options & STREAM_USE_PATH) { - $openedPath = $path; - } - - return true; - } - - /** - * Implements support for fclose(). - * @return string - */ - public function stream_close() - { - $this->ole = null; - unset($GLOBALS['_OLE_INSTANCES']); - } - - /** - * Implements support for fread(), fgets() etc. - * @param int maximum number of bytes to read - * @return string - */ - public function stream_read($count) - { - if ($this->stream_eof()) { - return false; - } - $s = substr($this->data, $this->pos, $count); - $this->pos += $count; - return $s; - } - - /** - * Implements support for feof(). - * @return bool TRUE if the file pointer is at EOF; otherwise FALSE - */ - public function stream_eof() - { - $eof = $this->pos >= strlen($this->data); - // Workaround for bug in PHP 5.0.x: http://bugs.php.net/27508 - if (version_compare(PHP_VERSION, '5.0', '>=') && - version_compare(PHP_VERSION, '5.1', '<')) { - - $eof = !$eof; - } - return $eof; - } - - /** - * Returns the position of the file pointer, i.e. its offset into the file - * stream. Implements support for ftell(). - * @return int - */ - public function stream_tell() - { - return $this->pos; - } - - /** - * Implements support for fseek(). - * @param int byte offset - * @param int SEEK_SET, SEEK_CUR or SEEK_END - * @return bool - */ - public function stream_seek($offset, $whence) - { - if ($whence == SEEK_SET && $offset >= 0) { - $this->pos = $offset; - } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) { - $this->pos += $offset; - } elseif ($whence == SEEK_END && -$offset <= sizeof($this->data)) { - $this->pos = strlen($this->data) + $offset; - } else { - return false; - } - return true; - } - - /** - * Implements support for fstat(). Currently the only supported field is - * "size". - * @return array - */ - public function stream_stat() - { - return array( - 'size' => strlen($this->data), - ); - } - - // Methods used by stream_wrapper_register() that are not implemented: - // bool stream_flush ( void ) - // int stream_write ( string data ) - // bool rename ( string path_from, string path_to ) - // bool mkdir ( string path, int mode, int options ) - // bool rmdir ( string path, int options ) - // bool dir_opendir ( string path, int options ) - // array url_stat ( string path, int flags ) - // string dir_readdir ( void ) - // bool dir_rewinddir ( void ) - // bool dir_closedir ( void ) -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS.php deleted file mode 100644 index e3d4673ab9..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS.php +++ /dev/null @@ -1,216 +0,0 @@ -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Xavier Noguer <xnoguer@php.net> | -// | Based on OLE::Storage_Lite by Kawai, Takanori | -// +----------------------------------------------------------------------+ -// -// $Id: PPS.php,v 1.7 2007/02/13 21:00:42 schmidt Exp $ - - -/** -* Class for creating PPS's for OLE containers -* -* @author Xavier Noguer <xnoguer@php.net> -* @category PHPExcel -* @package PHPExcel_Shared_OLE -*/ -class PHPExcel_Shared_OLE_PPS -{ - /** - * The PPS index - * @var integer - */ - public $No; - - /** - * The PPS name (in Unicode) - * @var string - */ - public $Name; - - /** - * The PPS type. Dir, Root or File - * @var integer - */ - public $Type; - - /** - * The index of the previous PPS - * @var integer - */ - public $PrevPps; - - /** - * The index of the next PPS - * @var integer - */ - public $NextPps; - - /** - * The index of it's first child if this is a Dir or Root PPS - * @var integer - */ - public $DirPps; - - /** - * A timestamp - * @var integer - */ - public $Time1st; - - /** - * A timestamp - * @var integer - */ - public $Time2nd; - - /** - * Starting block (small or big) for this PPS's data inside the container - * @var integer - */ - public $_StartBlock; - - /** - * The size of the PPS's data (in bytes) - * @var integer - */ - public $Size; - - /** - * The PPS's data (only used if it's not using a temporary file) - * @var string - */ - public $_data; - - /** - * Array of child PPS's (only used by Root and Dir PPS's) - * @var array - */ - public $children = array(); - - /** - * Pointer to OLE container - * @var OLE - */ - public $ole; - - /** - * The constructor - * - * @access public - * @param integer $No The PPS index - * @param string $name The PPS name - * @param integer $type The PPS type. Dir, Root or File - * @param integer $prev The index of the previous PPS - * @param integer $next The index of the next PPS - * @param integer $dir The index of it's first child if this is a Dir or Root PPS - * @param integer $time_1st A timestamp - * @param integer $time_2nd A timestamp - * @param string $data The (usually binary) source data of the PPS - * @param array $children Array containing children PPS for this PPS - */ - public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children) - { - $this->No = $No; - $this->Name = $name; - $this->Type = $type; - $this->PrevPps = $prev; - $this->NextPps = $next; - $this->DirPps = $dir; - $this->Time1st = $time_1st; - $this->Time2nd = $time_2nd; - $this->_data = $data; - $this->children = $children; - if ($data != '') { - $this->Size = strlen($data); - } else { - $this->Size = 0; - } - } - - /** - * Returns the amount of data saved for this PPS - * - * @access public - * @return integer The amount of data (in bytes) - */ - public function _DataLen() - { - if (!isset($this->_data)) { - return 0; - } - //if (isset($this->_PPS_FILE)) { - // fseek($this->_PPS_FILE, 0); - // $stats = fstat($this->_PPS_FILE); - // return $stats[7]; - //} else { - return strlen($this->_data); - //} - } - - /** - * Returns a string with the PPS's WK (What is a WK?) - * - * @access public - * @return string The binary string - */ - public function _getPpsWk() - { - $ret = str_pad($this->Name,64,"\x00"); - - $ret .= pack("v", strlen($this->Name) + 2) // 66 - . pack("c", $this->Type) // 67 - . pack("c", 0x00) //UK // 68 - . pack("V", $this->PrevPps) //Prev // 72 - . pack("V", $this->NextPps) //Next // 76 - . pack("V", $this->DirPps) //Dir // 80 - . "\x00\x09\x02\x00" // 84 - . "\x00\x00\x00\x00" // 88 - . "\xc0\x00\x00\x00" // 92 - . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root - . "\x00\x00\x00\x00" // 100 - . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time1st) // 108 - . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time2nd) // 116 - . pack("V", isset($this->_StartBlock)? - $this->_StartBlock:0) // 120 - . pack("V", $this->Size) // 124 - . pack("V", 0); // 128 - return $ret; - } - - /** - * Updates index and pointers to previous, next and children PPS's for this - * PPS. I don't think it'll work with Dir PPS's. - * - * @access public - * @param array &$pps_array Reference to the array of PPS's for the whole OLE - * container - * @return integer The index for this PPS - */ - public function _savePpsSetPnt(&$pps_array) - { - $pps_array[count($pps_array)] = &$this; - $this->No = count($pps_array) - 1; - $this->PrevPps = 0xFFFFFFFF; - $this->NextPps = 0xFFFFFFFF; - if (count($this->children) > 0) { - $this->DirPps = $this->children[0]->_savePpsSetPnt($pps_array); - } else { - $this->DirPps = 0xFFFFFFFF; - } - return $this->No; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/File.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/File.php deleted file mode 100644 index f061f568cc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/File.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Xavier Noguer <xnoguer@php.net> | -// | Based on OLE::Storage_Lite by Kawai, Takanori | -// +----------------------------------------------------------------------+ -// -// $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $ - - -/** -* Class for creating File PPS's for OLE containers -* -* @author Xavier Noguer <xnoguer@php.net> -* @category PHPExcel -* @package PHPExcel_Shared_OLE -*/ -class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS - { - /** - * The constructor - * - * @access public - * @param string $name The name of the file (in Unicode) - * @see OLE::Asc2Ucs() - */ - public function __construct($name) - { - parent::__construct( - null, - $name, - PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE, - null, - null, - null, - null, - null, - '', - array()); - } - - /** - * Initialization method. Has to be called right after OLE_PPS_File(). - * - * @access public - * @return mixed true on success - */ - public function init() - { - return true; - } - - /** - * Append data to PPS - * - * @access public - * @param string $data The data to append - */ - public function append($data) - { - $this->_data .= $data; - } - - /** - * Returns a stream for reading this file using fread() etc. - * @return resource a read-only stream - */ - public function getStream() - { - $this->ole->getStream($this); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/Root.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/Root.php deleted file mode 100644 index e736851504..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLE/PPS/Root.php +++ /dev/null @@ -1,465 +0,0 @@ -<?php -/* vim: set expandtab tabstop=4 shiftwidth=4: */ -// +----------------------------------------------------------------------+ -// | PHP Version 4 | -// +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2002 The PHP Group | -// +----------------------------------------------------------------------+ -// | This source file is subject to version 2.02 of the PHP license, | -// | that is bundled with this package in the file LICENSE, and is | -// | available at through the world-wide-web at | -// | http://www.php.net/license/2_02.txt. | -// | If you did not receive a copy of the PHP license and are unable to | -// | obtain it through the world-wide-web, please send a note to | -// | license@php.net so we can mail you a copy immediately. | -// +----------------------------------------------------------------------+ -// | Author: Xavier Noguer <xnoguer@php.net> | -// | Based on OLE::Storage_Lite by Kawai, Takanori | -// +----------------------------------------------------------------------+ -// -// $Id: Root.php,v 1.9 2005/04/23 21:53:49 dufuz Exp $ - - -/** -* Class for creating Root PPS's for OLE containers -* -* @author Xavier Noguer <xnoguer@php.net> -* @category PHPExcel -* @package PHPExcel_Shared_OLE -*/ -class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS - { - - /** - * Directory for temporary files - * @var string - */ - protected $_tmp_dir = ''; - - /** - * @param integer $time_1st A timestamp - * @param integer $time_2nd A timestamp - */ - public function __construct($time_1st, $time_2nd, $raChild) - { - $this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); - - parent::__construct( - null, - PHPExcel_Shared_OLE::Asc2Ucs('Root Entry'), - PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT, - null, - null, - null, - $time_1st, - $time_2nd, - null, - $raChild); - } - - /** - * Method for saving the whole OLE container (including files). - * In fact, if called with an empty argument (or '-'), it saves to a - * temporary file and then outputs it's contents to stdout. - * If a resource pointer to a stream created by fopen() is passed - * it will be used, but you have to close such stream by yourself. - * - * @param string|resource $filename The name of the file or stream where to save the OLE container. - * @access public - * @return mixed true on success - */ - public function save($filename) - { - // Initial Setting for saving - $this->_BIG_BLOCK_SIZE = pow(2, - ((isset($this->_BIG_BLOCK_SIZE))? self::_adjust2($this->_BIG_BLOCK_SIZE) : 9)); - $this->_SMALL_BLOCK_SIZE= pow(2, - ((isset($this->_SMALL_BLOCK_SIZE))? self::_adjust2($this->_SMALL_BLOCK_SIZE): 6)); - - if (is_resource($filename)) { - $this->_FILEH_ = $filename; - } else if ($filename == '-' || $filename == '') { - $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root"); - $this->_FILEH_ = fopen($this->_tmp_filename,"w+b"); - if ($this->_FILEH_ == false) { - throw new Exception("Can't create temporary file."); - } - } else { - $this->_FILEH_ = fopen($filename, "wb"); - } - if ($this->_FILEH_ == false) { - throw new Exception("Can't open $filename. It may be in use or protected."); - } - // Make an array of PPS's (for Save) - $aList = array(); - $this->_savePpsSetPnt($aList); - // calculate values for header - list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo); - // Save Header - $this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt); - - // Make Small Data string (write SBD) - $this->_data = $this->_makeSmallData($aList); - - // Write BB - $this->_saveBigData($iSBDcnt, $aList); - // Write PPS - $this->_savePps($aList); - // Write Big Block Depot and BDList and Adding Header informations - $this->_saveBbd($iSBDcnt, $iBBcnt, $iPPScnt); - - if (!is_resource($filename)) { - fclose($this->_FILEH_); - } - - return true; - } - - /** - * Calculate some numbers - * - * @access public - * @param array $raList Reference to an array of PPS's - * @return array The array of numbers - */ - public function _calcSize(&$raList) - { - // Calculate Basic Setting - list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0); - $iSmallLen = 0; - $iSBcnt = 0; - $iCount = count($raList); - for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { - $raList[$i]->Size = $raList[$i]->_DataLen(); - if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { - $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); - } else { - $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); - } - } - } - $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE; - $iSlCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); - $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0); - $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) + - (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0)); - $iCnt = count($raList); - $iBdCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; - $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0)); - - return array($iSBDcnt, $iBBcnt, $iPPScnt); - } - - /** - * Helper function for caculating a magic value for block sizes - * - * @access public - * @param integer $i2 The argument - * @see save() - * @return integer - */ - private static function _adjust2($i2) - { - $iWk = log($i2)/log(2); - return ($iWk > floor($iWk))? floor($iWk)+1:$iWk; - } - - /** - * Save OLE header - * - * @access public - * @param integer $iSBDcnt - * @param integer $iBBcnt - * @param integer $iPPScnt - */ - public function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt) - { - $FILE = $this->_FILEH_; - - // Calculate Basic Setting - $iBlCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; - $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; - - $iBdExL = 0; - $iAll = $iBBcnt + $iPPScnt + $iSBDcnt; - $iAllW = $iAll; - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); - $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); - - // Calculate BD count - if ($iBdCnt > $i1stBdL) { - while (1) { - ++$iBdExL; - ++$iAllW; - $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0); - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0); - if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) { - break; - } - } - } - - // Save Header - fwrite($FILE, - "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1" - . "\x00\x00\x00\x00" - . "\x00\x00\x00\x00" - . "\x00\x00\x00\x00" - . "\x00\x00\x00\x00" - . pack("v", 0x3b) - . pack("v", 0x03) - . pack("v", -2) - . pack("v", 9) - . pack("v", 6) - . pack("v", 0) - . "\x00\x00\x00\x00" - . "\x00\x00\x00\x00" - . pack("V", $iBdCnt) - . pack("V", $iBBcnt+$iSBDcnt) //ROOT START - . pack("V", 0) - . pack("V", 0x1000) - . pack("V", $iSBDcnt ? 0 : -2) //Small Block Depot - . pack("V", $iSBDcnt) - ); - // Extra BDList Start, Count - if ($iBdCnt < $i1stBdL) { - fwrite($FILE, - pack("V", -2). // Extra BDList Start - pack("V", 0) // Extra BDList Count - ); - } else { - fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL)); - } - - // BDList - for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; ++$i) { - fwrite($FILE, pack("V", $iAll+$i)); - } - if ($i < $i1stBdL) { - $jB = $i1stBdL - $i; - for ($j = 0; $j < $jB; ++$j) { - fwrite($FILE, (pack("V", -1))); - } - } - } - - /** - * Saving big data (PPS's with data bigger than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) - * - * @access public - * @param integer $iStBlk - * @param array &$raList Reference to array of PPS's - */ - public function _saveBigData($iStBlk, &$raList) - { - $FILE = $this->_FILEH_; - - // cycle through PPS's - $iCount = count($raList); - for ($i = 0; $i < $iCount; ++$i) { - if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) { - $raList[$i]->Size = $raList[$i]->_DataLen(); - if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) || - (($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) - { - // Write Data - //if (isset($raList[$i]->_PPS_FILE)) { - // $iLen = 0; - // fseek($raList[$i]->_PPS_FILE, 0); // To The Top - // while($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { - // $iLen += strlen($sBuff); - // fwrite($FILE, $sBuff); - // } - //} else { - fwrite($FILE, $raList[$i]->_data); - //} - - if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) { - fwrite($FILE, str_repeat("\x00", $this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE))); - } - // Set For PPS - $raList[$i]->_StartBlock = $iStBlk; - $iStBlk += - (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) + - (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0)); - } - // Close file for each PPS, and unlink it - //if (isset($raList[$i]->_PPS_FILE)) { - // fclose($raList[$i]->_PPS_FILE); - // $raList[$i]->_PPS_FILE = null; - // unlink($raList[$i]->_tmp_filename); - //} - } - } - } - - /** - * get small data (PPS's with data smaller than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) - * - * @access public - * @param array &$raList Reference to array of PPS's - */ - public function _makeSmallData(&$raList) - { - $sRes = ''; - $FILE = $this->_FILEH_; - $iSmBlk = 0; - - $iCount = count($raList); - for ($i = 0; $i < $iCount; ++$i) { - // Make SBD, small data string - if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) { - if ($raList[$i]->Size <= 0) { - continue; - } - if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) { - $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) - + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); - // Add to SBD - $jB = $iSmbCnt - 1; - for ($j = 0; $j < $jB; ++$j) { - fwrite($FILE, pack("V", $j+$iSmBlk+1)); - } - fwrite($FILE, pack("V", -2)); - - //// Add to Data String(this will be written for RootEntry) - //if ($raList[$i]->_PPS_FILE) { - // fseek($raList[$i]->_PPS_FILE, 0); // To The Top - // while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) { - // $sRes .= $sBuff; - // } - //} else { - $sRes .= $raList[$i]->_data; - //} - if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) { - $sRes .= str_repeat("\x00",$this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); - } - // Set for PPS - $raList[$i]->_StartBlock = $iSmBlk; - $iSmBlk += $iSmbCnt; - } - } - } - $iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE); - if ($iSmBlk % $iSbCnt) { - $iB = $iSbCnt - ($iSmBlk % $iSbCnt); - for ($i = 0; $i < $iB; ++$i) { - fwrite($FILE, pack("V", -1)); - } - } - return $sRes; - } - - /** - * Saves all the PPS's WKs - * - * @access public - * @param array $raList Reference to an array with all PPS's - */ - public function _savePps(&$raList) - { - // Save each PPS WK - $iC = count($raList); - for ($i = 0; $i < $iC; ++$i) { - fwrite($this->_FILEH_, $raList[$i]->_getPpsWk()); - } - // Adjust for Block - $iCnt = count($raList); - $iBCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE; - if ($iCnt % $iBCnt) { - fwrite($this->_FILEH_, str_repeat("\x00",($iBCnt - ($iCnt % $iBCnt)) * PHPExcel_Shared_OLE::OLE_PPS_SIZE)); - } - } - - /** - * Saving Big Block Depot - * - * @access public - * @param integer $iSbdSize - * @param integer $iBsize - * @param integer $iPpsCnt - */ - public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt) - { - $FILE = $this->_FILEH_; - // Calculate Basic Setting - $iBbCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; - $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE; - - $iBdExL = 0; - $iAll = $iBsize + $iPpsCnt + $iSbdSize; - $iAllW = $iAll; - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); - $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); - // Calculate BD count - if ($iBdCnt >$i1stBdL) { - while (1) { - ++$iBdExL; - ++$iAllW; - $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0); - $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0); - if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) { - break; - } - } - } - - // Making BD - // Set for SBD - if ($iSbdSize > 0) { - for ($i = 0; $i < ($iSbdSize - 1); ++$i) { - fwrite($FILE, pack("V", $i+1)); - } - fwrite($FILE, pack("V", -2)); - } - // Set for B - for ($i = 0; $i < ($iBsize - 1); ++$i) { - fwrite($FILE, pack("V", $i+$iSbdSize+1)); - } - fwrite($FILE, pack("V", -2)); - - // Set for PPS - for ($i = 0; $i < ($iPpsCnt - 1); ++$i) { - fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1)); - } - fwrite($FILE, pack("V", -2)); - // Set for BBD itself ( 0xFFFFFFFD : BBD) - for ($i = 0; $i < $iBdCnt; ++$i) { - fwrite($FILE, pack("V", 0xFFFFFFFD)); - } - // Set for ExtraBDList - for ($i = 0; $i < $iBdExL; ++$i) { - fwrite($FILE, pack("V", 0xFFFFFFFC)); - } - // Adjust for Block - if (($iAllW + $iBdCnt) % $iBbCnt) { - $iBlock = ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt)); - for ($i = 0; $i < $iBlock; ++$i) { - fwrite($FILE, pack("V", -1)); - } - } - // Extra BDList - if ($iBdCnt > $i1stBdL) { - $iN=0; - $iNb=0; - for ($i = $i1stBdL;$i < $iBdCnt; $i++, ++$iN) { - if ($iN >= ($iBbCnt - 1)) { - $iN = 0; - ++$iNb; - fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb)); - } - fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i)); - } - if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) { - $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)); - for ($i = 0; $i < $iB; ++$i) { - fwrite($FILE, pack("V", -1)); - } - } - fwrite($FILE, pack("V", -2)); - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLERead.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLERead.php deleted file mode 100644 index d6a58d6bcd..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/OLERead.php +++ /dev/null @@ -1,317 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -define('IDENTIFIER_OLE', pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1)); - -class PHPExcel_Shared_OLERead { - private $data = ''; - - // OLE identifier - const IDENTIFIER_OLE = IDENTIFIER_OLE; - - // Size of a sector = 512 bytes - const BIG_BLOCK_SIZE = 0x200; - - // Size of a short sector = 64 bytes - const SMALL_BLOCK_SIZE = 0x40; - - // Size of a directory entry always = 128 bytes - const PROPERTY_STORAGE_BLOCK_SIZE = 0x80; - - // Minimum size of a standard stream = 4096 bytes, streams smaller than this are stored as short streams - const SMALL_BLOCK_THRESHOLD = 0x1000; - - // header offsets - const NUM_BIG_BLOCK_DEPOT_BLOCKS_POS = 0x2c; - const ROOT_START_BLOCK_POS = 0x30; - const SMALL_BLOCK_DEPOT_BLOCK_POS = 0x3c; - const EXTENSION_BLOCK_POS = 0x44; - const NUM_EXTENSION_BLOCK_POS = 0x48; - const BIG_BLOCK_DEPOT_BLOCKS_POS = 0x4c; - - // property storage offsets (directory offsets) - const SIZE_OF_NAME_POS = 0x40; - const TYPE_POS = 0x42; - const START_BLOCK_POS = 0x74; - const SIZE_POS = 0x78; - - - - public $wrkbook = null; - public $summaryInformation = null; - public $documentSummaryInformation = null; - - - /** - * Read the file - * - * @param $sFileName string Filename - * @throws Exception - */ - public function read($sFileName) - { - // Check if file exists and is readable - if(!is_readable($sFileName)) { - throw new Exception("Could not open " . $sFileName . " for reading! File does not exist, or it is not readable."); - } - - // Get the file data - $this->data = file_get_contents($sFileName); - - // Check OLE identifier - if (substr($this->data, 0, 8) != self::IDENTIFIER_OLE) { - throw new Exception('The filename ' . $sFileName . ' is not recognised as an OLE file'); - } - - // Total number of sectors used for the SAT - $this->numBigBlockDepotBlocks = self::_GetInt4d($this->data, self::NUM_BIG_BLOCK_DEPOT_BLOCKS_POS); - - // SecID of the first sector of the directory stream - $this->rootStartBlock = self::_GetInt4d($this->data, self::ROOT_START_BLOCK_POS); - - // SecID of the first sector of the SSAT (or -2 if not extant) - $this->sbdStartBlock = self::_GetInt4d($this->data, self::SMALL_BLOCK_DEPOT_BLOCK_POS); - - // SecID of the first sector of the MSAT (or -2 if no additional sectors are used) - $this->extensionBlock = self::_GetInt4d($this->data, self::EXTENSION_BLOCK_POS); - - // Total number of sectors used by MSAT - $this->numExtensionBlocks = self::_GetInt4d($this->data, self::NUM_EXTENSION_BLOCK_POS); - - $bigBlockDepotBlocks = array(); - $pos = self::BIG_BLOCK_DEPOT_BLOCKS_POS; - - $bbdBlocks = $this->numBigBlockDepotBlocks; - - if ($this->numExtensionBlocks != 0) { - $bbdBlocks = (self::BIG_BLOCK_SIZE - self::BIG_BLOCK_DEPOT_BLOCKS_POS)/4; - } - - for ($i = 0; $i < $bbdBlocks; ++$i) { - $bigBlockDepotBlocks[$i] = self::_GetInt4d($this->data, $pos); - $pos += 4; - } - - for ($j = 0; $j < $this->numExtensionBlocks; ++$j) { - $pos = ($this->extensionBlock + 1) * self::BIG_BLOCK_SIZE; - $blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, self::BIG_BLOCK_SIZE / 4 - 1); - - for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; ++$i) { - $bigBlockDepotBlocks[$i] = self::_GetInt4d($this->data, $pos); - $pos += 4; - } - - $bbdBlocks += $blocksToRead; - if ($bbdBlocks < $this->numBigBlockDepotBlocks) { - $this->extensionBlock = self::_GetInt4d($this->data, $pos); - } - } - - $pos = $index = 0; - $this->bigBlockChain = array(); - - $bbs = self::BIG_BLOCK_SIZE / 4; - for ($i = 0; $i < $this->numBigBlockDepotBlocks; ++$i) { - $pos = ($bigBlockDepotBlocks[$i] + 1) * self::BIG_BLOCK_SIZE; - - for ($j = 0 ; $j < $bbs; ++$j) { - $this->bigBlockChain[$index] = self::_GetInt4d($this->data, $pos); - $pos += 4 ; - ++$index; - } - } - - $pos = $index = 0; - $sbdBlock = $this->sbdStartBlock; - $this->smallBlockChain = array(); - - while ($sbdBlock != -2) { - $pos = ($sbdBlock + 1) * self::BIG_BLOCK_SIZE; - - for ($j = 0; $j < $bbs; ++$j) { - $this->smallBlockChain[$index] = self::_GetInt4d($this->data, $pos); - $pos += 4; - ++$index; - } - - $sbdBlock = $this->bigBlockChain[$sbdBlock]; - } - - // read the directory stream - $block = $this->rootStartBlock; - $this->entry = $this->_readData($block); - - $this->_readPropertySets(); - } - - /** - * Extract binary stream data - * - * @return string - */ - public function getStream($stream) - { - if (is_null($stream)) { - return null; - } - - $streamData = ''; - - if ($this->props[$stream]['size'] < self::SMALL_BLOCK_THRESHOLD) { - $rootdata = $this->_readData($this->props[$this->rootentry]['startBlock']); - - $block = $this->props[$stream]['startBlock']; - - while ($block != -2) { - $pos = $block * self::SMALL_BLOCK_SIZE; - $streamData .= substr($rootdata, $pos, self::SMALL_BLOCK_SIZE); - - $block = $this->smallBlockChain[$block]; - } - - return $streamData; - } else { - $numBlocks = $this->props[$stream]['size'] / self::BIG_BLOCK_SIZE; - if ($this->props[$stream]['size'] % self::BIG_BLOCK_SIZE != 0) { - ++$numBlocks; - } - - if ($numBlocks == 0) return ''; - - $block = $this->props[$stream]['startBlock']; - - while ($block != -2) { - $pos = ($block + 1) * self::BIG_BLOCK_SIZE; - $streamData .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); - $block = $this->bigBlockChain[$block]; - } - - return $streamData; - } - } - - /** - * Read a standard stream (by joining sectors using information from SAT) - * - * @param int $bl Sector ID where the stream starts - * @return string Data for standard stream - */ - private function _readData($bl) - { - $block = $bl; - $data = ''; - - while ($block != -2) { - $pos = ($block + 1) * self::BIG_BLOCK_SIZE; - $data .= substr($this->data, $pos, self::BIG_BLOCK_SIZE); - $block = $this->bigBlockChain[$block]; - } - return $data; - } - - /** - * Read entries in the directory stream. - */ - private function _readPropertySets() { - $offset = 0; - - // loop through entires, each entry is 128 bytes - $entryLen = strlen($this->entry); - while ($offset < $entryLen) { - // entry data (128 bytes) - $d = substr($this->entry, $offset, self::PROPERTY_STORAGE_BLOCK_SIZE); - - // size in bytes of name - $nameSize = ord($d[self::SIZE_OF_NAME_POS]) | (ord($d[self::SIZE_OF_NAME_POS+1]) << 8); - - // type of entry - $type = ord($d[self::TYPE_POS]); - - // sectorID of first sector or short sector, if this entry refers to a stream (the case with workbook) - // sectorID of first sector of the short-stream container stream, if this entry is root entry - $startBlock = self::_GetInt4d($d, self::START_BLOCK_POS); - - $size = self::_GetInt4d($d, self::SIZE_POS); - - $name = str_replace("\x00", "", substr($d,0,$nameSize)); - - $this->props[] = array ( - 'name' => $name, - 'type' => $type, - 'startBlock' => $startBlock, - 'size' => $size); - - // Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook) - if (($name == 'Workbook') || ($name == 'Book') || ($name == 'WORKBOOK') || ($name == 'BOOK')) { - $this->wrkbook = count($this->props) - 1; - } - - // Root entry - if ($name == 'Root Entry' || $name == 'ROOT ENTRY' || $name == 'R') { - $this->rootentry = count($this->props) - 1; - } - - // Summary information - if ($name == chr(5) . 'SummaryInformation') { -// echo 'Summary Information<br />'; - $this->summaryInformation = count($this->props) - 1; - } - - // Additional Document Summary information - if ($name == chr(5) . 'DocumentSummaryInformation') { -// echo 'Document Summary Information<br />'; - $this->documentSummaryInformation = count($this->props) - 1; - } - - $offset += self::PROPERTY_STORAGE_BLOCK_SIZE; - } - - } - - /** - * Read 4 bytes of data at specified position - * - * @param string $data - * @param int $pos - * @return int - */ - private static function _GetInt4d($data, $pos) - { - // FIX: represent numbers correctly on 64-bit system - // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 - // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems - $_or_24 = ord($data[$pos + 3]); - if ($_or_24 >= 128) { - // negative number - $_ord_24 = -abs((256 - $_or_24) << 24); - } else { - $_ord_24 = ($_or_24 & 127) << 24; - } - return ord($data[$pos]) | (ord($data[$pos + 1]) << 8) | (ord($data[$pos + 2]) << 16) | $_ord_24; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/gnu-lgpl.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/gnu-lgpl.txt deleted file mode 100644 index cbee875ba6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/gnu-lgpl.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/pclzip.lib.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/pclzip.lib.php deleted file mode 100644 index 4bf05a5236..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/pclzip.lib.php +++ /dev/null @@ -1,5694 +0,0 @@ -<?php -// -------------------------------------------------------------------------------- -// PhpConcept Library - Zip Module 2.8.2 -// -------------------------------------------------------------------------------- -// License GNU/LGPL - Vincent Blavet - August 2009 -// http://www.phpconcept.net -// -------------------------------------------------------------------------------- -// -// Presentation : -// PclZip is a PHP library that manage ZIP archives. -// So far tests show that archives generated by PclZip are readable by -// WinZip application and other tools. -// -// Description : -// See readme.txt and http://www.phpconcept.net -// -// Warning : -// This library and the associated files are non commercial, non professional -// work. -// It should not have unexpected results. However if any damage is caused by -// this software the author can not be responsible. -// The use of this software is at the risk of the user. -// -// -------------------------------------------------------------------------------- -// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $ -// -------------------------------------------------------------------------------- - - // ----- Constants - if (!defined('PCLZIP_READ_BLOCK_SIZE')) { - define( 'PCLZIP_READ_BLOCK_SIZE', 2048 ); - } - - // ----- File list separator - // In version 1.x of PclZip, the separator for file list is a space - // (which is not a very smart choice, specifically for windows paths !). - // A better separator should be a comma (,). This constant gives you the - // abilty to change that. - // However notice that changing this value, may have impact on existing - // scripts, using space separated filenames. - // Recommanded values for compatibility with older versions : - //define( 'PCLZIP_SEPARATOR', ' ' ); - // Recommanded values for smart separation of filenames. - if (!defined('PCLZIP_SEPARATOR')) { - define( 'PCLZIP_SEPARATOR', ',' ); - } - - // ----- Error configuration - // 0 : PclZip Class integrated error handling - // 1 : PclError external library error handling. By enabling this - // you must ensure that you have included PclError library. - // [2,...] : reserved for futur use - if (!defined('PCLZIP_ERROR_EXTERNAL')) { - define( 'PCLZIP_ERROR_EXTERNAL', 0 ); - } - - // ----- Optional static temporary directory - // By default temporary files are generated in the script current - // path. - // If defined : - // - MUST BE terminated by a '/'. - // - MUST be a valid, already created directory - // Samples : - // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' ); - // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' ); - if (!defined('PCLZIP_TEMPORARY_DIR')) { - define( 'PCLZIP_TEMPORARY_DIR', '' ); - } - - // ----- Optional threshold ratio for use of temporary files - // Pclzip sense the size of the file to add/extract and decide to - // use or not temporary file. The algorythm is looking for - // memory_limit of PHP and apply a ratio. - // threshold = memory_limit * ratio. - // Recommended values are under 0.5. Default 0.47. - // Samples : - // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 ); - if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) { - define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 ); - } - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED ***** -// -------------------------------------------------------------------------------- - - // ----- Global variables - $g_pclzip_version = "2.8.2"; - - // ----- Error codes - // -1 : Unable to open file in binary write mode - // -2 : Unable to open file in binary read mode - // -3 : Invalid parameters - // -4 : File does not exist - // -5 : Filename is too long (max. 255) - // -6 : Not a valid zip file - // -7 : Invalid extracted file size - // -8 : Unable to create directory - // -9 : Invalid archive extension - // -10 : Invalid archive format - // -11 : Unable to delete file (unlink) - // -12 : Unable to rename file (rename) - // -13 : Invalid header checksum - // -14 : Invalid archive size - define( 'PCLZIP_ERR_USER_ABORTED', 2 ); - define( 'PCLZIP_ERR_NO_ERROR', 0 ); - define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 ); - define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 ); - define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 ); - define( 'PCLZIP_ERR_MISSING_FILE', -4 ); - define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 ); - define( 'PCLZIP_ERR_INVALID_ZIP', -6 ); - define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 ); - define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 ); - define( 'PCLZIP_ERR_BAD_EXTENSION', -9 ); - define( 'PCLZIP_ERR_BAD_FORMAT', -10 ); - define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 ); - define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 ); - define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 ); - define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 ); - define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 ); - define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 ); - define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 ); - define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 ); - define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 ); - define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 ); - define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 ); - - // ----- Options values - define( 'PCLZIP_OPT_PATH', 77001 ); - define( 'PCLZIP_OPT_ADD_PATH', 77002 ); - define( 'PCLZIP_OPT_REMOVE_PATH', 77003 ); - define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 ); - define( 'PCLZIP_OPT_SET_CHMOD', 77005 ); - define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 ); - define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 ); - define( 'PCLZIP_OPT_BY_NAME', 77008 ); - define( 'PCLZIP_OPT_BY_INDEX', 77009 ); - define( 'PCLZIP_OPT_BY_EREG', 77010 ); - define( 'PCLZIP_OPT_BY_PREG', 77011 ); - define( 'PCLZIP_OPT_COMMENT', 77012 ); - define( 'PCLZIP_OPT_ADD_COMMENT', 77013 ); - define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 ); - define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 ); - define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 ); - define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 ); - // Having big trouble with crypt. Need to multiply 2 long int - // which is not correctly supported by PHP ... - //define( 'PCLZIP_OPT_CRYPT', 77018 ); - define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 ); - define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 ); - define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias - define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 ); - define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias - define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 ); - define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias - - // ----- File description attributes - define( 'PCLZIP_ATT_FILE_NAME', 79001 ); - define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 ); - define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 ); - define( 'PCLZIP_ATT_FILE_MTIME', 79004 ); - define( 'PCLZIP_ATT_FILE_CONTENT', 79005 ); - define( 'PCLZIP_ATT_FILE_COMMENT', 79006 ); - - // ----- Call backs values - define( 'PCLZIP_CB_PRE_EXTRACT', 78001 ); - define( 'PCLZIP_CB_POST_EXTRACT', 78002 ); - define( 'PCLZIP_CB_PRE_ADD', 78003 ); - define( 'PCLZIP_CB_POST_ADD', 78004 ); - /* For futur use - define( 'PCLZIP_CB_PRE_LIST', 78005 ); - define( 'PCLZIP_CB_POST_LIST', 78006 ); - define( 'PCLZIP_CB_PRE_DELETE', 78007 ); - define( 'PCLZIP_CB_POST_DELETE', 78008 ); - */ - - // -------------------------------------------------------------------------------- - // Class : PclZip - // Description : - // PclZip is the class that represent a Zip archive. - // The public methods allow the manipulation of the archive. - // Attributes : - // Attributes must not be accessed directly. - // Methods : - // PclZip() : Object creator - // create() : Creates the Zip archive - // listContent() : List the content of the Zip archive - // extract() : Extract the content of the archive - // properties() : List the properties of the archive - // -------------------------------------------------------------------------------- - class PclZip - { - // ----- Filename of the zip file - var $zipname = ''; - - // ----- File descriptor of the zip file - var $zip_fd = 0; - - // ----- Internal error handling - var $error_code = 1; - var $error_string = ''; - - // ----- Current status of the magic_quotes_runtime - // This value store the php configuration for magic_quotes - // The class can then disable the magic_quotes and reset it after - var $magic_quotes_status; - - // -------------------------------------------------------------------------------- - // Function : PclZip() - // Description : - // Creates a PclZip object and set the name of the associated Zip archive - // filename. - // Note that no real action is taken, if the archive does not exist it is not - // created. Use create() for that. - // -------------------------------------------------------------------------------- - function PclZip($p_zipname) - { - - // ----- Tests the zlib - if (!function_exists('gzopen')) - { - die('Abort '.basename(__FILE__).' : Missing zlib extensions'); - } - - // ----- Set the attributes - $this->zipname = $p_zipname; - $this->zip_fd = 0; - $this->magic_quotes_status = -1; - - // ----- Return - return; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // create($p_filelist, $p_add_dir="", $p_remove_dir="") - // create($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two different synopsis. The first one is historical. - // This method creates a Zip Archive. The Zip file is created in the - // filesystem. The files and directories indicated in $p_filelist - // are added in the archive. See the parameters description for the - // supported format of $p_filelist. - // When a directory is in the list, the directory and its content is added - // in the archive. - // In this synopsis, the function takes an optional variable list of - // options. See bellow the supported options. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function create($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove from the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Invalid number / type of arguments"); - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - if ($v_string != '') { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - else { - } - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // add($p_filelist, $p_add_dir="", $p_remove_dir="") - // add($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two synopsis. The first one is historical. - // This methods add the list of files in an existing archive. - // If a file with the same name already exists, it is added at the end of the - // archive, the first one is still present. - // If the archive does not exist, it is created. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_OPT_ADD_COMMENT : - // PCLZIP_OPT_PREPEND_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function add($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_ADD_COMMENT => 'optional', - PCLZIP_OPT_PREPEND_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : listContent() - // Description : - // This public method, gives the list of the files and directories, with their - // properties. - // The properties of each entries in the list are (used also in other functions) : - // filename : Name of the file. For a create or add action it is the filename - // given by the user. For an extract function it is the filename - // of the extracted file. - // stored_filename : Name of the file / directory stored in the archive. - // size : Size of the stored file. - // compressed_size : Size of the file's data compressed in the archive - // (without the headers overhead) - // mtime : Last known modification date of the file (UNIX timestamp) - // comment : Comment associated with the file - // folder : true | false - // index : index of the file in the archive - // status : status of the action (depending of the action) : - // Values are : - // ok : OK ! - // filtered : the file / dir is not extracted (filtered by user) - // already_a_directory : the file can not be extracted because a - // directory with the same name already exists - // write_protected : the file can not be extracted because a file - // with the same name already exists and is - // write protected - // newer_exist : the file was not extracted because a newer file exists - // path_creation_fail : the file is not extracted because the folder - // does not exist and can not be created - // write_error : the file was not extracted because there was a - // error while writing the file - // read_error : the file was not extracted because there was a error - // while reading the file - // invalid_header : the file was not extracted because of an archive - // format error (bad file header) - // Note that each time a method can continue operating when there - // is an action error on a file, the error is only logged in the file status. - // Return Values : - // 0 on an unrecoverable failure, - // The list of the files in the archive. - // -------------------------------------------------------------------------------- - function listContent() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Call the extracting fct - $p_list = array(); - if (($v_result = $this->privList($p_list)) != 1) - { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // extract($p_path="./", $p_remove_path="") - // extract([$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method extract all the files / directories from the archive to the - // folder indicated in $p_path. - // If you want to ignore the 'root' part of path of the memorized files - // you can indicate this in the optional $p_remove_path parameter. - // By default, if a newer file with the same name already exists, the - // file is not extracted. - // - // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions - // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append - // at the end of the path value of PCLZIP_OPT_PATH. - // Parameters : - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 or a negative value on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function extract() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Trace - - // ----- Call the extracting fct - $p_list = array(); - $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, - $v_remove_all_path, $v_options); - if ($v_result < 1) { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - - // -------------------------------------------------------------------------------- - // Function : - // extractByIndex($p_index, $p_path="./", $p_remove_path="") - // extractByIndex($p_index, [$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method is doing a partial extract of the archive. - // The extracted files or folders are identified by their index in the - // archive (from 0 to n). - // Note that if the index identify a folder, only the folder entry is - // extracted, not all the files included in the archive. - // Parameters : - // $p_index : A single index (integer) or a string of indexes of files to - // extract. The form of the string is "0,4-6,8-12" with only numbers - // and '-' for range or ',' to separate ranges. No spaces or ';' - // are allowed. - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and - // not as files. - // The resulting content is in a new field 'content' in the file - // structure. - // This option must be used alone (any other options are ignored). - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - //function extractByIndex($p_index, options...) - function extractByIndex($p_index) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - } - else { - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Trace - - // ----- Trick - // Here I want to reuse extractByRule(), so I need to parse the $p_index - // with privParseOptions() - $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); - $v_options_trick = array(); - $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, - array (PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Call the extracting fct - if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // delete([$p_option, $p_option_value, ...]) - // Description : - // This method removes files from the archive. - // If no parameters are given, then all the archive is emptied. - // Parameters : - // None or optional arguments. - // Options : - // PCLZIP_OPT_BY_INDEX : - // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : - // PCLZIP_OPT_BY_PREG : - // Return Values : - // 0 on failure, - // The list of the files which are still present in the archive. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function delete() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Call the delete fct - $v_list = array(); - if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { - $this->privSwapBackMagicQuotes(); - unset($v_list); - return(0); - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : deleteByIndex() - // Description : - // ***** Deprecated ***** - // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. - // -------------------------------------------------------------------------------- - function deleteByIndex($p_index) - { - - $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : properties() - // Description : - // This method gives the properties of the archive. - // The properties are : - // nb : Number of files in the archive - // comment : Comment associated with the archive file - // status : not_exist, ok - // Parameters : - // None - // Return Values : - // 0 on failure, - // An array with the archive properties. - // -------------------------------------------------------------------------------- - function properties() - { - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - $this->privSwapBackMagicQuotes(); - return(0); - } - - // ----- Default properties - $v_prop = array(); - $v_prop['comment'] = ''; - $v_prop['nb'] = 0; - $v_prop['status'] = 'not_exist'; - - // ----- Look if file exists - if (@is_file($this->zipname)) - { - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return 0; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return 0; - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Set the user attributes - $v_prop['comment'] = $v_central_dir['comment']; - $v_prop['nb'] = $v_central_dir['entries']; - $v_prop['status'] = 'ok'; - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_prop; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : duplicate() - // Description : - // This method creates an archive by copying the content of an other one. If - // the archive already exist, it is replaced by the new one without any warning. - // Parameters : - // $p_archive : The filename of a valid archive, or - // a valid PclZip object. - // Return Values : - // 1 on success. - // 0 or a negative value on error (error code). - // -------------------------------------------------------------------------------- - function duplicate($p_archive) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) - { - - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive->zipname); - } - - // ----- Look if the $p_archive is a string (so a filename) - else if (is_string($p_archive)) - { - - // ----- Check that $p_archive is a valid zip file - // TBC : Should also check the archive format - if (!is_file($p_archive)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); - $v_result = PCLZIP_ERR_MISSING_FILE; - } - else { - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive); - } - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : merge() - // Description : - // This method merge the $p_archive_to_add archive at the end of the current - // one ($this). - // If the archive ($this) does not exist, the merge becomes a duplicate. - // If the $p_archive_to_add archive does not exist, the merge is a success. - // Parameters : - // $p_archive_to_add : It can be directly the filename of a valid zip archive, - // or a PclZip object archive. - // Return Values : - // 1 on success, - // 0 or negative values on error (see below). - // -------------------------------------------------------------------------------- - function merge($p_archive_to_add) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) - { - - // ----- Merge the archive - $v_result = $this->privMerge($p_archive_to_add); - } - - // ----- Look if the $p_archive_to_add is a string (so a filename) - else if (is_string($p_archive_to_add)) - { - - // ----- Create a temporary archive - $v_object_archive = new PclZip($p_archive_to_add); - - // ----- Merge the archive - $v_result = $this->privMerge($v_object_archive); - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : errorCode() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorCode() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorCode()); - } - else { - return($this->error_code); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorName() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorName($p_with_code=false) - { - $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', - PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', - PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', - PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', - PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', - PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', - PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', - PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', - PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', - PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', - PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', - PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', - PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', - PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', - PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', - PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', - PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', - PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', - PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' - ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' - ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' - ); - - if (isset($v_name[$this->error_code])) { - $v_value = $v_name[$this->error_code]; - } - else { - $v_value = 'NoName'; - } - - if ($p_with_code) { - return($v_value.' ('.$this->error_code.')'); - } - else { - return($v_value); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorInfo() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorInfo($p_full=false) - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorString()); - } - else { - if ($p_full) { - return($this->errorName(true)." : ".$this->error_string); - } - else { - return($this->error_string." [code ".$this->error_code."]"); - } - } - } - // -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** -// ***** ***** -// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** -// -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : privCheckFormat() - // Description : - // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) - // Parameters : - // $p_level : Level of check. Default 0. - // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) - // Return Values : - // true on success, - // false on error, the error code is set. - // -------------------------------------------------------------------------------- - function privCheckFormat($p_level=0) - { - $v_result = true; - - // ----- Reset the file system cache - clearstatcache(); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the file exits - if (!is_file($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - return(false); - } - - // ----- Check that the file is readeable - if (!is_readable($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - return(false); - } - - // ----- Check the magic code - // TBC - - // ----- Check the central header - // TBC - - // ----- Check each file header - // TBC - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privParseOptions() - // Description : - // This internal methods reads the variable list of arguments ($p_options_list, - // $p_size) and generate an array with the options and values ($v_result_list). - // $v_requested_options contains the options that can be present and those that - // must be present. - // $v_requested_options is an array, with the option value as key, and 'optional', - // or 'mandatory' as value. - // Parameters : - // See above. - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) - { - $v_result=1; - - // ----- Read the options - $i=0; - while ($i<$p_size) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$p_options_list[$i]])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for next option - switch ($p_options_list[$i]) { - // ----- Look for options that request a path value - case PCLZIP_OPT_PATH : - case PCLZIP_OPT_REMOVE_PATH : - case PCLZIP_OPT_ADD_PATH : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_THRESHOLD : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - // ----- Check the value - $v_value = $p_options_list[$i+1]; - if ((!is_integer($v_value)) || ($v_value<0)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Get the value (and convert it in bytes) - $v_result_list[$p_options_list[$i]] = $v_value*1048576; - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_ON : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_TEMP_FILE_OFF : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); - return PclZip::errorCode(); - } - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if ( is_string($p_options_list[$i+1]) - && ($p_options_list[$i+1] != '')) { - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - } - else { - } - break; - - // ----- Look for options that request an array of string for value - case PCLZIP_OPT_BY_NAME : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an EREG or PREG expression - case PCLZIP_OPT_BY_EREG : - // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG - // to PCLZIP_OPT_BY_PREG - $p_options_list[$i] = PCLZIP_OPT_BY_PREG; - case PCLZIP_OPT_BY_PREG : - //case PCLZIP_OPT_CRYPT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that takes a string - case PCLZIP_OPT_COMMENT : - case PCLZIP_OPT_ADD_COMMENT : - case PCLZIP_OPT_PREPEND_COMMENT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, - "Missing parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, - "Wrong parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an array of index - case PCLZIP_OPT_BY_INDEX : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_work_list = array(); - if (is_string($p_options_list[$i+1])) { - - // ----- Remove spaces - $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); - - // ----- Parse items - $v_work_list = explode(",", $p_options_list[$i+1]); - } - else if (is_integer($p_options_list[$i+1])) { - $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_work_list = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Reduce the index list - // each index item in the list must be a couple with a start and - // an end value : [0,3], [5-5], [8-10], ... - // ----- Check the format of each item - $v_sort_flag=false; - $v_sort_value=0; - for ($j=0; $j<sizeof($v_work_list); $j++) { - // ----- Explode the item - $v_item_list = explode("-", $v_work_list[$j]); - $v_size_item_list = sizeof($v_item_list); - - // ----- TBC : Here we might check that each item is a - // real integer ... - - // ----- Look for single value - if ($v_size_item_list == 1) { - // ----- Set the option value - $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; - $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0]; - } - elseif ($v_size_item_list == 2) { - // ----- Set the option value - $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0]; - $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - - // ----- Look for list sort - if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) { - $v_sort_flag=true; - - // ----- TBC : An automatic sort should be writen ... - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start']; - } - - // ----- Sort the items - if ($v_sort_flag) { - // TBC : To Be Completed - } - - // ----- Next option - $i++; - break; - - // ----- Look for options that request no value - case PCLZIP_OPT_REMOVE_ALL_PATH : - case PCLZIP_OPT_EXTRACT_AS_STRING : - case PCLZIP_OPT_NO_COMPRESSION : - case PCLZIP_OPT_EXTRACT_IN_OUTPUT : - case PCLZIP_OPT_REPLACE_NEWER : - case PCLZIP_OPT_STOP_ON_ERROR : - $v_result_list[$p_options_list[$i]] = true; - break; - - // ----- Look for options that request an octal value - case PCLZIP_OPT_SET_CHMOD : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - $i++; - break; - - // ----- Look for options that request a call-back - case PCLZIP_CB_PRE_EXTRACT : - case PCLZIP_CB_POST_EXTRACT : - case PCLZIP_CB_PRE_ADD : - case PCLZIP_CB_POST_ADD : - /* for futur use - case PCLZIP_CB_PRE_DELETE : - case PCLZIP_CB_POST_DELETE : - case PCLZIP_CB_PRE_LIST : - case PCLZIP_CB_POST_LIST : - */ - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_function_name = $p_options_list[$i+1]; - - // ----- Check that the value is a valid existing function - if (!function_exists($v_function_name)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Set the attribute - $v_result_list[$p_options_list[$i]] = $v_function_name; - $i++; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '" - .$p_options_list[$i]."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Next options - $i++; - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($v_result_list[$key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - - // ----- Return - return PclZip::errorCode(); - } - } - } - } - - // ----- Look for default values - if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOptionDefaultThreshold() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privOptionDefaultThreshold(&$p_options) - { - $v_result=1; - - if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { - return $v_result; - } - - // ----- Get 'memory_limit' configuration value - $v_memory_limit = ini_get('memory_limit'); - $v_memory_limit = trim($v_memory_limit); - $last = strtolower(substr($v_memory_limit, -1)); - - if($last == 'g') - //$v_memory_limit = $v_memory_limit*1024*1024*1024; - $v_memory_limit = $v_memory_limit*1073741824; - if($last == 'm') - //$v_memory_limit = $v_memory_limit*1024*1024; - $v_memory_limit = $v_memory_limit*1048576; - if($last == 'k') - $v_memory_limit = $v_memory_limit*1024; - - $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); - - - // ----- Sanity check : No threshold if value lower than 1M - if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { - unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrParseAtt() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) - { - $v_result=1; - - // ----- For each file in the list check the attributes - foreach ($p_file_list as $v_key => $v_value) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$v_key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for attribute - switch ($v_key) { - case PCLZIP_ATT_FILE_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['filename'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - break; - - case PCLZIP_ATT_FILE_NEW_SHORT_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_short_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - case PCLZIP_ATT_FILE_NEW_FULL_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_full_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - // ----- Look for options that takes a string - case PCLZIP_ATT_FILE_COMMENT : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['comment'] = $v_value; - break; - - case PCLZIP_ATT_FILE_MTIME : - if (!is_integer($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['mtime'] = $v_value; - break; - - case PCLZIP_ATT_FILE_CONTENT : - $p_filedescr['content'] = $v_value; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '".$v_key."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($p_file_list[$key])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - return PclZip::errorCode(); - } - } - } - } - - // end foreach - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrExpand() - // Description : - // This method look for each item of the list to see if its a file, a folder - // or a string to be added as file. For any other type of files (link, other) - // just ignore the item. - // Then prepare the information that will be stored for that file. - // When its a folder, expand the folder with all the files that are in that - // folder (recursively). - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrExpand(&$p_filedescr_list, &$p_options) - { - $v_result=1; - - // ----- Create a result list - $v_result_list = array(); - - // ----- Look each entry - for ($i=0; $i<sizeof($p_filedescr_list); $i++) { - - // ----- Get filedescr - $v_descr = $p_filedescr_list[$i]; - - // ----- Reduce the filename - $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false); - $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']); - - // ----- Look for real file or folder - if (file_exists($v_descr['filename'])) { - if (@is_file($v_descr['filename'])) { - $v_descr['type'] = 'file'; - } - else if (@is_dir($v_descr['filename'])) { - $v_descr['type'] = 'folder'; - } - else if (@is_link($v_descr['filename'])) { - // skip - continue; - } - else { - // skip - continue; - } - } - - // ----- Look for string added as file - else if (isset($v_descr['content'])) { - $v_descr['type'] = 'virtual_file'; - } - - // ----- Missing file - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Calculate the stored filename - $this->privCalculateStoredFilename($v_descr, $p_options); - - // ----- Add the descriptor in result list - $v_result_list[sizeof($v_result_list)] = $v_descr; - - // ----- Look for folder - if ($v_descr['type'] == 'folder') { - // ----- List of items in folder - $v_dirlist_descr = array(); - $v_dirlist_nb = 0; - if ($v_folder_handler = @opendir($v_descr['filename'])) { - while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - - // ----- Skip '.' and '..' - if (($v_item_handler == '.') || ($v_item_handler == '..')) { - continue; - } - - // ----- Compose the full filename - $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - - // ----- Look for different stored filename - // Because the name of the folder was changed, the name of the - // files/sub-folders also change - if (($v_descr['stored_filename'] != $v_descr['filename']) - && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { - if ($v_descr['stored_filename'] != '') { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; - } - else { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; - } - } - - $v_dirlist_nb++; - } - - @closedir($v_folder_handler); - } - else { - // TBC : unable to open folder in read mode - } - - // ----- Expand each element of the list - if ($v_dirlist_nb != 0) { - // ----- Expand - if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - return $v_result; - } - - // ----- Concat the resulting list - $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - } - else { - } - - // ----- Free local array - unset($v_dirlist_descr); - } - } - - // ----- Get the result list - $p_filedescr_list = $v_result_list; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCreate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCreate($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the file in write mode - if (($v_result = $this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Add the list of files - $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); - - // ----- Close - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAdd() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAdd($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Look if the archive exists or is empty - if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) - { - - // ----- Do a create - $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); - - // ----- Return - return $v_result; - } - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Create the Central Dir files header - for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++) - { - // ----- Create the file header - if ($v_header_list[$i]['status'] == 'ok') { - if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = $v_central_dir['comment']; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { - $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOpenFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privOpenFd($p_mode) - { - $v_result=1; - - // ----- Look if already open - if ($this->zip_fd != 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCloseFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privCloseFd() - { - $v_result=1; - - if ($this->zip_fd != 0) - @fclose($this->zip_fd); - $this->zip_fd = 0; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddList() - // Description : - // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is - // different from the real path of the file. This is usefull if you want to have PclTar - // running in any directory, and memorize relative path from an other directory. - // Parameters : - // $p_list : An array containing the file or directory names to add in the tar - // $p_result_list : list of added files with their properties (specially the status field) - // $p_add_dir : Path to add in the filename path archived - // $p_remove_dir : Path to remove in the filename path archived - // Return Values : - // -------------------------------------------------------------------------------- -// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) - function privAddList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Create the Central Dir files header - for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++) - { - // ----- Create the file header - if ($v_header_list[$i]['status'] == 'ok') { - if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) { - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileList() - // Description : - // Parameters : - // $p_filedescr_list : An array containing the file description - // or directory names to add in the zip - // $p_result_list : list of added files with their properties (specially the status field) - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_header = array(); - - // ----- Recuperate the current number of elt in list - $v_nb = sizeof($p_result_list); - - // ----- Loop on the files - for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) { - // ----- Format the filename - $p_filedescr_list[$j]['filename'] - = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false); - - - // ----- Skip empty file names - // TBC : Can this be possible ? not checked in DescrParseAtt ? - if ($p_filedescr_list[$j]['filename'] == "") { - continue; - } - - // ----- Check the filename - if ( ($p_filedescr_list[$j]['type'] != 'virtual_file') - && (!file_exists($p_filedescr_list[$j]['filename']))) { - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist"); - return PclZip::errorCode(); - } - - // ----- Look if it is a file or a dir with no all path remove option - // or a dir with all its path removed -// if ( (is_file($p_filedescr_list[$j]['filename'])) -// || ( is_dir($p_filedescr_list[$j]['filename']) - if ( ($p_filedescr_list[$j]['type'] == 'file') - || ($p_filedescr_list[$j]['type'] == 'virtual_file') - || ( ($p_filedescr_list[$j]['type'] == 'folder') - && ( !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]) - || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) - ) { - - // ----- Add the file - $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header, - $p_options); - if ($v_result != 1) { - return $v_result; - } - - // ----- Store the file infos - $p_result_list[$v_nb++] = $v_header; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=1; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - // TBC : Already done in the fileAtt check ... ? - if ($p_filename == "") { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for a stored different filename - /* TBC : Removed - if (isset($p_filedescr['stored_filename'])) { - $v_stored_filename = $p_filedescr['stored_filename']; - } - else { - $v_stored_filename = $p_filedescr['stored_filename']; - } - */ - - // ----- Set the file properties - clearstatcache(); - $p_header['version'] = 20; - $p_header['version_extracted'] = 10; - $p_header['flag'] = 0; - $p_header['compression'] = 0; - $p_header['crc'] = 0; - $p_header['compressed_size'] = 0; - $p_header['filename_len'] = strlen($p_filename); - $p_header['extra_len'] = 0; - $p_header['disk'] = 0; - $p_header['internal'] = 0; - $p_header['offset'] = 0; - $p_header['filename'] = $p_filename; -// TBC : Removed $p_header['stored_filename'] = $v_stored_filename; - $p_header['stored_filename'] = $p_filedescr['stored_filename']; - $p_header['extra'] = ''; - $p_header['status'] = 'ok'; - $p_header['index'] = -1; - - // ----- Look for regular file - if ($p_filedescr['type']=='file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for regular folder - else if ($p_filedescr['type']=='folder') { - $p_header['external'] = 0x00000010; - $p_header['mtime'] = filemtime($p_filename); - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for virtual file - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = strlen($p_filedescr['content']); - } - - - // ----- Look for filetime - if (isset($p_filedescr['mtime'])) { - $p_header['mtime'] = $p_filedescr['mtime']; - } - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['mtime'] = time(); - } - else { - $p_header['mtime'] = filemtime($p_filename); - } - - // ------ Look for file comment - if (isset($p_filedescr['comment'])) { - $p_header['comment_len'] = strlen($p_filedescr['comment']); - $p_header['comment'] = $p_filedescr['comment']; - } - else { - $p_header['comment_len'] = 0; - $p_header['comment'] = ''; - } - - // ----- Look for pre-add callback - if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_header['status'] = "skipped"; - $v_result = 1; - } - - // ----- Update the informations - // Only some fields can be modified - if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { - $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - } - } - - // ----- Look for empty stored filename - if ($p_header['stored_filename'] == "") { - $p_header['status'] = "filtered"; - } - - // ----- Check the path length - if (strlen($p_header['stored_filename']) > 0xFF) { - $p_header['status'] = 'filename_too_long'; - } - - // ----- Look if no error, or file not skipped - if ($p_header['status'] == 'ok') { - - // ----- Look for a file - if ($p_filedescr['type'] == 'file') { - // ----- Look for using temporary file to zip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { - $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Use "in memory" zip algo - else { - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); - - // ----- Close the file - @fclose($v_file); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - - } - - } - - // ----- Look for a virtual file (a file from string) - else if ($p_filedescr['type'] == 'virtual_file') { - - $v_content = $p_filedescr['content']; - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - } - - // ----- Look for a directory - else if ($p_filedescr['type'] == 'folder') { - // ----- Look for directory last '/' - if (@substr($p_header['stored_filename'], -1) != '/') { - $p_header['stored_filename'] .= '/'; - } - - // ----- Set the file properties - $p_header['size'] = 0; - //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked - $p_header['external'] = 0x00000010; // Value for a folder : to be checked - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) - { - return $v_result; - } - } - } - - // ----- Look for post-add callback - if (isset($p_options[PCLZIP_CB_POST_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Ignored - $v_result = 1; - } - - // ----- Update the informations - // Nothing can be modified - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=PCLZIP_ERR_NO_ERROR; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Creates a compressed temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = filesize($p_filename); - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @gzputs($v_file_compressed, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file); - @gzclose($v_file_compressed); - - // ----- Check the minimum file size - if (filesize($v_gzip_temp_name) < 18) { - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); - return PclZip::errorCode(); - } - - // ----- Extract the compressed attributes - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the gzip file header - $v_binary_data = @fread($v_file_compressed, 10); - $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); - - // ----- Check some parameters - $v_data_header['os'] = bin2hex($v_data_header['os']); - - // ----- Read the gzip file footer - @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); - $v_binary_data = @fread($v_file_compressed, 8); - $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); - - // ----- Set the attributes - $p_header['compression'] = ord($v_data_header['cm']); - //$p_header['mtime'] = $v_data_header['mtime']; - $p_header['crc'] = $v_data_footer['crc']; - $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - return $v_result; - } - - // ----- Add the compressed data - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) - { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - fseek($v_file_compressed, 10); - $v_size = $p_header['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file_compressed, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Unlink the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCalculateStoredFilename() - // Description : - // Based on file descriptor properties and global options, this method - // calculate the filename that will be stored in the archive. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCalculateStoredFilename(&$p_filedescr, &$p_options) - { - $v_result=1; - - // ----- Working variables - $p_filename = $p_filedescr['filename']; - if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { - $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; - } - else { - $p_add_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { - $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; - } - else { - $p_remove_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - else { - $p_remove_all_dir = 0; - } - - - // ----- Look for full name change - if (isset($p_filedescr['new_full_name'])) { - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); - } - - // ----- Look for path and/or short name change - else { - - // ----- Look for short name change - // Its when we cahnge just the filename but not the path - if (isset($p_filedescr['new_short_name'])) { - $v_path_info = pathinfo($p_filename); - $v_dir = ''; - if ($v_path_info['dirname'] != '') { - $v_dir = $v_path_info['dirname'].'/'; - } - $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - } - else { - // ----- Calculate the stored filename - $v_stored_filename = $p_filename; - } - - // ----- Look for all path to remove - if ($p_remove_all_dir) { - $v_stored_filename = basename($p_filename); - } - // ----- Look for partial path remove - else if ($p_remove_dir != "") { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= "/"; - - if ( (substr($p_filename, 0, 2) == "./") - || (substr($p_remove_dir, 0, 2) == "./")) { - - if ( (substr($p_filename, 0, 2) == "./") - && (substr($p_remove_dir, 0, 2) != "./")) { - $p_remove_dir = "./".$p_remove_dir; - } - if ( (substr($p_filename, 0, 2) != "./") - && (substr($p_remove_dir, 0, 2) == "./")) { - $p_remove_dir = substr($p_remove_dir, 2); - } - } - - $v_compare = PclZipUtilPathInclusion($p_remove_dir, - $v_stored_filename); - if ($v_compare > 0) { - if ($v_compare == 2) { - $v_stored_filename = ""; - } - else { - $v_stored_filename = substr($v_stored_filename, - strlen($p_remove_dir)); - } - } - } - - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); - - // ----- Look for path to add - if ($p_add_dir != "") { - if (substr($p_add_dir, -1) == "/") - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir."/".$v_stored_filename; - } - } - - // ----- Filename (reduce the path of stored name) - $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); - $p_filedescr['stored_filename'] = $v_stored_filename; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteFileHeader(&$p_header) - { - $v_result=1; - - // ----- Store the offset position of the file - $p_header['offset'] = ftell($this->zip_fd); - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, - $p_header['version_extracted'], $p_header['flag'], - $p_header['compression'], $v_mtime, $v_mdate, - $p_header['crc'], $p_header['compressed_size'], - $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len']); - - // ----- Write the first 148 bytes of the header in the archive - fputs($this->zip_fd, $v_binary_data, 30); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralFileHeader(&$p_header) - { - $v_result=1; - - // TBC - //for(reset($p_header); $key = key($p_header); next($p_header)) { - //} - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - - // ----- Packed data - $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, - $p_header['version'], $p_header['version_extracted'], - $p_header['flag'], $p_header['compression'], - $v_mtime, $v_mdate, $p_header['crc'], - $p_header['compressed_size'], $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len'], $p_header['comment_len'], - $p_header['disk'], $p_header['internal'], - $p_header['external'], $p_header['offset']); - - // ----- Write the 42 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 46); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - if ($p_header['comment_len'] != 0) - { - fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) - { - $v_result=1; - - // ----- Packed data - $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, - $p_nb_entries, $p_size, - $p_offset, strlen($p_comment)); - - // ----- Write the 22 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 22); - - // ----- Write the variable fields - if (strlen($p_comment) != 0) - { - fputs($this->zip_fd, $p_comment, strlen($p_comment)); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privList() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privList(&$p_list) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of Central Dir - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_central_dir['offset'])) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - for ($i=0; $i<$v_central_dir['entries']; $i++) - { - // ----- Read the file header - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - $v_header['index'] = $i; - - // ----- Get the only interesting attributes - $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); - unset($v_header); - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privConvertHeader2FileInfo() - // Description : - // This function takes the file informations from the central directory - // entries and extract the interesting parameters that will be given back. - // The resulting file infos are set in the array $p_info - // $p_info['filename'] : Filename with full path. Given by user (add), - // extracted in the filesystem (extract). - // $p_info['stored_filename'] : Stored filename in the archive. - // $p_info['size'] = Size of the file. - // $p_info['compressed_size'] = Compressed size of the file. - // $p_info['mtime'] = Last modification date of the file. - // $p_info['comment'] = Comment associated with the file. - // $p_info['folder'] = true/false : indicates if the entry is a folder or not. - // $p_info['status'] = status of the action on the file. - // $p_info['crc'] = CRC of the file content. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privConvertHeader2FileInfo($p_header, &$p_info) - { - $v_result=1; - - // ----- Get the interesting attributes - $v_temp_path = PclZipUtilPathReduction($p_header['filename']); - $p_info['filename'] = $v_temp_path; - $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); - $p_info['stored_filename'] = $v_temp_path; - $p_info['size'] = $p_header['size']; - $p_info['compressed_size'] = $p_header['compressed_size']; - $p_info['mtime'] = $p_header['mtime']; - $p_info['comment'] = $p_header['comment']; - $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); - $p_info['index'] = $p_header['index']; - $p_info['status'] = $p_header['status']; - $p_info['crc'] = $p_header['crc']; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractByRule() - // Description : - // Extract a file or directory depending of rules (by index, by name, ...) - // Parameters : - // $p_file_list : An array where will be placed the properties of each - // extracted file - // $p_path : Path to add while writing the extracted files - // $p_remove_path : Path to remove (from the file memorized path) while writing the - // extracted files. If the path does not match the file path, - // the file is extracted with its memorized path. - // $p_remove_path does not apply to 'list' mode. - // $p_path and $p_remove_path are commulative. - // Return Values : - // 1 on success,0 or less on error (see error code list) - // -------------------------------------------------------------------------------- - function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check the path - if ( ($p_path == "") - || ( (substr($p_path, 0, 1) != "/") - && (substr($p_path, 0, 3) != "../") - && (substr($p_path,1,2)!=":/"))) - $p_path = "./".$p_path; - - // ----- Reduce the path last (and duplicated) '/' - if (($p_path != "./") && ($p_path != "/")) - { - // ----- Look for the path end '/' - while (substr($p_path, -1) == "/") - { - $p_path = substr($p_path, 0, strlen($p_path)-1); - } - } - - // ----- Look for path to remove format (should end by /) - if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) - { - $p_remove_path .= '/'; - } - $p_remove_path_size = strlen($p_remove_path); - - // ----- Open the zip file - if (($v_result = $this->privOpenFd('rb')) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - - // ----- Read each entry - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read next Central dir entry - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Store the index - $v_header['index'] = $i; - - // ----- Store the file position - $v_pos_entry = ftell($this->zip_fd); - - // ----- Look for the specific extract rules - $v_extract = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) { - - // ----- Look for a directory - if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { - - // ----- Look if the directory is in the filename path - if ( (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_extract = true; - } - } - // ----- Look for a filename - elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_extract = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) { - - if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_extract = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - - // ----- Look for no rule, which means extract all the archive - else { - $v_extract = true; - } - - // ----- Check compression method - if ( ($v_extract) - && ( ($v_header['compression'] != 8) - && ($v_header['compression'] != 0))) { - $v_header['status'] = 'unsupported_compression'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, - "Filename '".$v_header['stored_filename']."' is " - ."compressed by an unsupported compression " - ."method (".$v_header['compression'].") "); - - return PclZip::errorCode(); - } - } - - // ----- Check encrypted files - if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - $v_header['status'] = 'unsupported_encryption'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, - "Unsupported encryption for " - ." filename '".$v_header['stored_filename'] - ."'"); - - return PclZip::errorCode(); - } - } - - // ----- Look for real extraction - if (($v_extract) && ($v_header['status'] != 'ok')) { - $v_result = $this->privConvertHeader2FileInfo($v_header, - $p_file_list[$v_nb_extracted++]); - if ($v_result != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - $v_extract = false; - } - - // ----- Look for real extraction - if ($v_extract) - { - - // ----- Go to the file position - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_header['offset'])) - { - // ----- Close the zip file - $this->privCloseFd(); - - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for extraction as string - if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { - - $v_string = ''; - - // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Set the file content - $p_file_list[$v_nb_extracted]['content'] = $v_string; - - // ----- Next extracted file - $v_nb_extracted++; - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for extraction in standard output - elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) - && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { - // ----- Extracting the file in standard output - $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for normal extraction - else { - // ----- Extracting the file - $v_result1 = $this->privExtractFile($v_header, - $p_path, $p_remove_path, - $p_remove_all_path, - $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - } - } - - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFile() - // Description : - // Parameters : - // Return Values : - // - // 1 : ... ? - // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback - // -------------------------------------------------------------------------------- - function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for all path to remove - if ($p_remove_all_path == true) { - // ----- Look for folder entry that not need to be extracted - if (($p_entry['external']&0x00000010)==0x00000010) { - - $p_entry['status'] = "filtered"; - - return $v_result; - } - - // ----- Get the basename of the path - $p_entry['filename'] = basename($p_entry['filename']); - } - - // ----- Look for path to remove - else if ($p_remove_path != "") - { - if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) - { - - // ----- Change the file status - $p_entry['status'] = "filtered"; - - // ----- Return - return $v_result; - } - - $p_remove_path_size = strlen($p_remove_path); - if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) - { - - // ----- Remove the path - $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - - } - } - - // ----- Add the path - if ($p_path != '') { - $p_entry['filename'] = $p_path."/".$p_entry['filename']; - } - - // ----- Check a base_dir_restriction - if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - $v_inclusion - = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); - if ($v_inclusion == 0) { - - PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, - "Filename '".$p_entry['filename']."' is " - ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - - return PclZip::errorCode(); - } - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Look for specific actions while the file exist - if (file_exists($p_entry['filename'])) - { - - // ----- Look if file is a directory - if (is_dir($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "already_a_directory"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, - "Filename '".$p_entry['filename']."' is " - ."already used by an existing directory"); - - return PclZip::errorCode(); - } - } - // ----- Look if file is write protected - else if (!is_writeable($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "write_protected"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Filename '".$p_entry['filename']."' exists " - ."and is write protected"); - - return PclZip::errorCode(); - } - } - - // ----- Look if the extracted file is older - else if (filemtime($p_entry['filename']) > $p_entry['mtime']) - { - // ----- Change the file status - if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) - && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - } - else { - $p_entry['status'] = "newer_exist"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Newer version of '".$p_entry['filename']."' exists " - ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - - return PclZip::errorCode(); - } - } - } - else { - } - } - - // ----- Check the directory availability and create it if necessary - else { - if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) - $v_dir_to_check = $p_entry['filename']; - else if (!strstr($p_entry['filename'], "/")) - $v_dir_to_check = ""; - else - $v_dir_to_check = dirname($p_entry['filename']); - - if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - - // ----- Change the file status - $p_entry['status'] = "path_creation_fail"; - - // ----- Return - //return $v_result; - $v_result = 1; - } - } - } - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file - if ($p_entry['compression'] == 0) { - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) - { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - // ----- Return - return $v_result; - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - /* Try to speed up the code - $v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_binary_data, $v_read_size); - */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Closing the destination file - fclose($v_dest_file); - - // ----- Change the file mtime - touch($p_entry['filename'], $p_entry['mtime']); - - - } - else { - // ----- TBC - // Need to be finished - if (($p_entry['flag'] & 1) == 1) { - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); - return PclZip::errorCode(); - } - - - // ----- Look for using temporary file to unzip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { - $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Look for extract in memory - else { - - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = @gzinflate($v_buffer); - unset($v_buffer); - if ($v_file_content === FALSE) { - - // ----- Change the file status - // TBC - $p_entry['status'] = "error"; - - return $v_result; - } - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - return $v_result; - } - - // ----- Write the uncompressed data - @fwrite($v_dest_file, $v_file_content, $p_entry['size']); - unset($v_file_content); - - // ----- Closing the destination file - @fclose($v_dest_file); - - } - - // ----- Change the file mtime - @touch($p_entry['filename'], $p_entry['mtime']); - } - - // ----- Look for chmod option - if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - - // ----- Change the mode of the file - @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); - } - - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileUsingTempFile(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Creates a temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - - // ----- Write gz file format header - $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); - @fwrite($v_dest_file, $v_binary_data, 10); - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Write gz file format footer - $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); - @fwrite($v_dest_file, $v_binary_data, 8); - - // ----- Close the temporary file - @fclose($v_dest_file); - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - $p_entry['status'] = "write_error"; - return $v_result; - } - - // ----- Open the temporary gz file - if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { - @fclose($v_dest_file); - $p_entry['status'] = "read_error"; - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['size']; - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($v_src_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - @fclose($v_dest_file); - @gzclose($v_src_file); - - // ----- Delete the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileInOutput() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileInOutput(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - // ----- Trace - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - if ($p_entry['compressed_size'] == $p_entry['size']) { - - // ----- Read the file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Send the file to the output - echo $v_buffer; - unset($v_buffer); - } - else { - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = gzinflate($v_buffer); - unset($v_buffer); - - // ----- Send the file to the output - echo $v_file_content; - unset($v_file_content); - } - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileAsString() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) - { - $v_result=1; - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - // if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); - } - else { - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC - } - } - - // ----- Trace - } - else { - // TBC : error : can not extract a folder in a string - } - - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Swap the content to header - $v_local_header['content'] = $p_string; - $p_string = ''; - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Swap back the content to header - $p_string = $v_local_header['content']; - unset($v_local_header['content']); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x04034b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 26); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 26) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); - - // ----- Get filename - $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - - // ----- Get extra_fields - if ($v_data['extra_len'] != 0) { - $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); - } - else { - $p_header['extra'] = ''; - } - - // ----- Extract properties - $p_header['version_extracted'] = $v_data['version']; - $p_header['compression'] = $v_data['compression']; - $p_header['size'] = $v_data['size']; - $p_header['compressed_size'] = $v_data['compressed_size']; - $p_header['crc'] = $v_data['crc']; - $p_header['flag'] = $v_data['flag']; - $p_header['filename_len'] = $v_data['filename_len']; - - // ----- Recuperate date in UNIX format - $p_header['mdate'] = $v_data['mdate']; - $p_header['mtime'] = $v_data['mtime']; - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // TBC - //for(reset($v_data); $key = key($v_data); next($v_data)) { - //} - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set the status field - $p_header['status'] = "ok"; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadCentralFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x02014b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 42); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 42) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); - - // ----- Get filename - if ($p_header['filename_len'] != 0) - $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); - else - $p_header['filename'] = ''; - - // ----- Get extra - if ($p_header['extra_len'] != 0) - $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); - else - $p_header['extra'] = ''; - - // ----- Get comment - if ($p_header['comment_len'] != 0) - $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); - else - $p_header['comment'] = ''; - - // ----- Extract properties - - // ----- Recuperate date in UNIX format - //if ($p_header['mdate'] && $p_header['mtime']) - // TBC : bug : this was ignoring time with 0/0/0 - if (1) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set default status to ok - $p_header['status'] = 'ok'; - - // ----- Look if it is a directory - if (substr($p_header['filename'], -1) == '/') { - //$p_header['external'] = 0x41FF0010; - $p_header['external'] = 0x00000010; - } - - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCheckFileHeaders() - // Description : - // Parameters : - // Return Values : - // 1 on success, - // 0 on error; - // -------------------------------------------------------------------------------- - function privCheckFileHeaders(&$p_local_header, &$p_central_header) - { - $v_result=1; - - // ----- Check the static values - // TBC - if ($p_local_header['filename'] != $p_central_header['filename']) { - } - if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - } - if ($p_local_header['flag'] != $p_central_header['flag']) { - } - if ($p_local_header['compression'] != $p_central_header['compression']) { - } - if ($p_local_header['mtime'] != $p_central_header['mtime']) { - } - if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - } - - // ----- Look for flag bit 3 - if (($p_local_header['flag'] & 8) == 8) { - $p_local_header['size'] = $p_central_header['size']; - $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - $p_local_header['crc'] = $p_central_header['crc']; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadEndCentralDir() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadEndCentralDir(&$p_central_dir) - { - $v_result=1; - - // ----- Go to the end of the zip file - $v_size = filesize($this->zipname); - @fseek($this->zip_fd, $v_size); - if (@ftell($this->zip_fd) != $v_size) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- First try : look if this is an archive with no commentaries (most of the time) - // in this case the end of central dir is at 22 bytes of the file end - $v_found = 0; - if ($v_size > 26) { - @fseek($this->zip_fd, $v_size-22); - if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read for bytes - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = @unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] == 0x06054b50) { - $v_found = 1; - } - - $v_pos = ftell($this->zip_fd); - } - - // ----- Go back to the maximum possible size of the Central Dir End Record - if (!$v_found) { - $v_maximum_size = 65557; // 0xFFFF + 22; - if ($v_maximum_size > $v_size) - $v_maximum_size = $v_size; - @fseek($this->zip_fd, $v_size-$v_maximum_size); - if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read byte per byte in order to find the signature - $v_pos = ftell($this->zip_fd); - $v_bytes = 0x00000000; - while ($v_pos < $v_size) - { - // ----- Read a byte - $v_byte = @fread($this->zip_fd, 1); - - // ----- Add the byte - //$v_bytes = ($v_bytes << 8) | Ord($v_byte); - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); - - // ----- Compare the bytes - if ($v_bytes == 0x504b0506) - { - $v_pos++; - break; - } - - $v_pos++; - } - - // ----- Look if not found end of central dir - if ($v_pos == $v_size) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Read the first 18 bytes of the header - $v_binary_data = fread($this->zip_fd, 18); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 18) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); - - // ----- Check the global size - if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - - // ----- Removed in release 2.2 see readme file - // The check of the file size is a little too strict. - // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. - // While decrypted, zip has training 0 bytes - if (0) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, - 'The central dir is not at the end of the archive.' - .' Some trailing bytes exists after the archive.'); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Get comment - if ($v_data['comment_size'] != 0) { - $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); - } - else - $p_central_dir['comment'] = ''; - - $p_central_dir['entries'] = $v_data['entries']; - $p_central_dir['disk_entries'] = $v_data['disk_entries']; - $p_central_dir['offset'] = $v_data['offset']; - $p_central_dir['size'] = $v_data['size']; - $p_central_dir['disk'] = $v_data['disk']; - $p_central_dir['disk_start'] = $v_data['disk_start']; - - // TBC - //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - //} - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDeleteByRule() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDeleteByRule(&$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Scan all the files - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - $v_header_list = array(); - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read the file header - $v_header_list[$v_nb_extracted] = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - - return $v_result; - } - - - // ----- Store the index - $v_header_list[$v_nb_extracted]['index'] = $i; - - // ----- Look for the specific extract rules - $v_found = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) { - - // ----- Look for a directory - if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") { - - // ----- Look if the directory is in the filename path - if ( (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ - && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - } - // ----- Look for a filename - elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_found = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) { - - if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_found = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - else { - $v_found = true; - } - - // ----- Look for deletion - if ($v_found) - { - unset($v_header_list[$v_nb_extracted]); - } - else - { - $v_nb_extracted++; - } - } - - // ----- Look if something need to be deleted - if ($v_nb_extracted > 0) { - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Creates a temporary zip archive - $v_temp_zip = new PclZip($v_zip_temp_name); - - // ----- Open the temporary zip file in write mode - if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Look which file need to be kept - for ($i=0; $i<sizeof($v_header_list); $i++) { - - // ----- Calculate the position of the header - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_local_header = array(); - if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Check that local file header is same as central file header - if ($this->privCheckFileHeaders($v_local_header, - $v_header_list[$i]) != 1) { - // TBC - } - unset($v_local_header); - - // ----- Write the file header - if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Read/write the data block - if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_temp_zip->zip_fd); - - // ----- Re-Create the Central Dir files header - for ($i=0; $i<sizeof($v_header_list); $i++) { - // ----- Create the file header - if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) { - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Transform the header to a 'usable' info - $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { - // ----- Reset the file list - unset($v_header_list); - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Close - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Destroy the temporary archive - unset($v_temp_zip); - } - - // ----- Remove every files : reset the file - else if ($v_central_dir['entries'] != 0) { - $this->privCloseFd(); - - if (($v_result = $this->privOpenFd('wb')) != 1) { - return $v_result; - } - - if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - return $v_result; - } - - $this->privCloseFd(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDirCheck() - // Description : - // Check if a directory exists, if not it creates it and all the parents directory - // which may be useful. - // Parameters : - // $p_dir : Directory path to check. - // Return Values : - // 1 : OK - // -1 : Unable to create directory - // -------------------------------------------------------------------------------- - function privDirCheck($p_dir, $p_is_dir=false) - { - $v_result = 1; - - - // ----- Remove the final '/' - if (($p_is_dir) && (substr($p_dir, -1)=='/')) - { - $p_dir = substr($p_dir, 0, strlen($p_dir)-1); - } - - // ----- Check the directory availability - if ((is_dir($p_dir)) || ($p_dir == "")) - { - return 1; - } - - // ----- Extract parent directory - $p_parent_dir = dirname($p_dir); - - // ----- Just a check - if ($p_parent_dir != $p_dir) - { - // ----- Look for parent directory - if ($p_parent_dir != "") - { - if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) - { - return $v_result; - } - } - } - - // ----- Create the directory - if (!@mkdir($p_dir, 0777)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privMerge() - // Description : - // If $p_archive_to_add does not exist, the function exit with a success result. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privMerge(&$p_archive_to_add) - { - $v_result=1; - - // ----- Look if the archive_to_add exists - if (!is_file($p_archive_to_add->zipname)) - { - - // ----- Nothing to merge, so merge is a success - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Look if the archive exists - if (!is_file($this->zipname)) - { - - // ----- Do a duplicate - $v_result = $this->privDuplicate($p_archive_to_add->zipname); - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Open the archive_to_add file - if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) - { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir_to_add = array(); - if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - return $v_result; - } - - // ----- Go to beginning of File - @rewind($p_archive_to_add->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the files from the archive_to_add into the temporary file - $v_size = $v_central_dir_to_add['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_zip_temp_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the block of file headers from the archive_to_add - $v_size = $v_central_dir_to_add['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Merge the file comments - $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; - - // ----- Calculate the size of the (new) central header - $v_size = @ftell($v_zip_temp_fd)-$v_offset; - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive fd - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - @fclose($v_zip_temp_fd); - $this->zip_fd = null; - - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDuplicate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDuplicate($p_archive_filename) - { - $v_result=1; - - // ----- Look if the $p_archive_filename exists - if (!is_file($p_archive_filename)) - { - - // ----- Nothing to duplicate, so duplicate is a success. - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) - { - $this->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = filesize($p_archive_filename); - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorLog() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorLog($p_error_code=0, $p_error_string='') - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclError($p_error_code, $p_error_string); - } - else { - $this->error_code = $p_error_code; - $this->error_string = $p_error_string; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorReset() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorReset() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclErrorReset(); - } - else { - $this->error_code = 0; - $this->error_string = ''; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDisableMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDisableMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if already done - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Get and memorize the magic_quote value - $this->magic_quotes_status = @get_magic_quotes_runtime(); - - // ----- Disable magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime(0); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privSwapBackMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privSwapBackMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if something to do - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Swap back magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime($this->magic_quotes_status); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - } - // End of class - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathReduction() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilPathReduction($p_dir) - { - $v_result = ""; - - // ----- Look for not empty path - if ($p_dir != "") { - // ----- Explode path by directory names - $v_list = explode("/", $p_dir); - - // ----- Study directories from last to first - $v_skip = 0; - for ($i=sizeof($v_list)-1; $i>=0; $i--) { - // ----- Look for current path - if ($v_list[$i] == ".") { - // ----- Ignore this directory - // Should be the first $i=0, but no check is done - } - else if ($v_list[$i] == "..") { - $v_skip++; - } - else if ($v_list[$i] == "") { - // ----- First '/' i.e. root slash - if ($i == 0) { - $v_result = "/".$v_result; - if ($v_skip > 0) { - // ----- It is an invalid path, so the path is not modified - // TBC - $v_result = $p_dir; - $v_skip = 0; - } - } - // ----- Last '/' i.e. indicates a directory - else if ($i == (sizeof($v_list)-1)) { - $v_result = $v_list[$i]; - } - // ----- Double '/' inside the path - else { - // ----- Ignore only the double '//' in path, - // but not the first and last '/' - } - } - else { - // ----- Look for item to skip - if ($v_skip > 0) { - $v_skip--; - } - else { - $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); - } - } - } - - // ----- Look for skip - if ($v_skip > 0) { - while ($v_skip > 0) { - $v_result = '../'.$v_result; - $v_skip--; - } - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathInclusion() - // Description : - // This function indicates if the path $p_path is under the $p_dir tree. Or, - // said in an other way, if the file or sub-dir $p_path is inside the dir - // $p_dir. - // The function indicates also if the path is exactly the same as the dir. - // This function supports path with duplicated '/' like '//', but does not - // support '.' or '..' statements. - // Parameters : - // Return Values : - // 0 if $p_path is not inside directory $p_dir - // 1 if $p_path is inside directory $p_dir - // 2 if $p_path is exactly the same as $p_dir - // -------------------------------------------------------------------------------- - function PclZipUtilPathInclusion($p_dir, $p_path) - { - $v_result = 1; - - // ----- Look for path beginning by ./ - if ( ($p_dir == '.') - || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { - $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - } - if ( ($p_path == '.') - || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { - $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - } - - // ----- Explode dir and path by directory separator - $v_list_dir = explode("/", $p_dir); - $v_list_dir_size = sizeof($v_list_dir); - $v_list_path = explode("/", $p_path); - $v_list_path_size = sizeof($v_list_path); - - // ----- Study directories paths - $i = 0; - $j = 0; - while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - - // ----- Look for empty dir (path reduction) - if ($v_list_dir[$i] == '') { - $i++; - continue; - } - if ($v_list_path[$j] == '') { - $j++; - continue; - } - - // ----- Compare the items - if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - $v_result = 0; - } - - // ----- Next items - $i++; - $j++; - } - - // ----- Look if everything seems to be the same - if ($v_result) { - // ----- Skip all the empty items - while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; - while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - - if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { - // ----- There are exactly the same - $v_result = 2; - } - else if ($i < $v_list_dir_size) { - // ----- The path is shorter than the dir - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilCopyBlock() - // Description : - // Parameters : - // $p_mode : read/write compression mode - // 0 : src & dest normal - // 1 : src gzip, dest normal - // 2 : src normal, dest gzip - // 3 : src & dest gzip - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) - { - $v_result = 1; - - if ($p_mode==0) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==1) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==2) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==3) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilRename() - // Description : - // This function tries to do a simple rename() function. If it fails, it - // tries to copy the $p_src file in a new $p_dest file and then unlink the - // first one. - // Parameters : - // $p_src : Old filename - // $p_dest : New filename - // Return Values : - // 1 on success, 0 on failure. - // -------------------------------------------------------------------------------- - function PclZipUtilRename($p_src, $p_dest) - { - $v_result = 1; - - // ----- Try to rename the files - if (!@rename($p_src, $p_dest)) { - - // ----- Try to copy & unlink the src - if (!@copy($p_src, $p_dest)) { - $v_result = 0; - } - else if (!@unlink($p_src)) { - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilOptionText() - // Description : - // Translate option value in text. Mainly for debug purpose. - // Parameters : - // $p_option : the option value. - // Return Values : - // The option text value. - // -------------------------------------------------------------------------------- - function PclZipUtilOptionText($p_option) - { - - $v_list = get_defined_constants(); - for (reset($v_list); $v_key = key($v_list); next($v_list)) { - $v_prefix = substr($v_key, 0, 10); - if (( ($v_prefix == 'PCLZIP_OPT') - || ($v_prefix == 'PCLZIP_CB_') - || ($v_prefix == 'PCLZIP_ATT')) - && ($v_list[$v_key] == $p_option)) { - return $v_key; - } - } - - $v_result = 'Unknown'; - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilTranslateWinPath() - // Description : - // Translate windows path by replacing '\' by '/' and optionally removing - // drive letter. - // Parameters : - // $p_path : path to translate. - // $p_remove_disk_letter : true | false - // Return Values : - // The path translated. - // -------------------------------------------------------------------------------- - function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) - { - if (stristr(php_uname(), 'windows')) { - // ----- Look for potential disk letter - if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { - $p_path = substr($p_path, $v_position+1); - } - // ----- Change potential windows directory separator - if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { - $p_path = strtr($p_path, '\\', '/'); - } - } - return $p_path; - } - // -------------------------------------------------------------------------------- - - -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/readme.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/readme.txt deleted file mode 100644 index 6ed8839477..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PCLZip/readme.txt +++ /dev/null @@ -1,421 +0,0 @@ -// -------------------------------------------------------------------------------- -// PclZip 2.8.2 - readme.txt -// -------------------------------------------------------------------------------- -// License GNU/LGPL - August 2009 -// Vincent Blavet - vincent@phpconcept.net -// http://www.phpconcept.net -// -------------------------------------------------------------------------------- -// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $ -// -------------------------------------------------------------------------------- - - - -0 - Sommaire -============ - 1 - Introduction - 2 - What's new - 3 - Corrected bugs - 4 - Known bugs or limitations - 5 - License - 6 - Warning - 7 - Documentation - 8 - Author - 9 - Contribute - -1 - Introduction -================ - - PclZip is a library that allow you to manage a Zip archive. - - Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip - -2 - What's new -============== - - Version 2.8.2 : - - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with - extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string - can also be modified in the post-extract call back. - **Bugs correction : - - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly - - Remove use of eval() and do direct call to callback functions - - Correct support of 64bits systems (Thanks to WordPress team) - - Version 2.8.1 : - - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is - deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will - automatically replace it by PCLZIP_OPT_BY_PREG. - - Version 2.8 : - - Improve extraction of zip archive for large files by using temporary files - This feature is working like the one defined in r2.7. - Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF, - PCLZIP_OPT_TEMP_FILE_THRESHOLD - - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto - sense of temporary file use. - - Bug correction : Reduce filepath in returned file list to remove ennoying - './/' preambule in file path. - - Version 2.7 : - - Improve creation of zip archive for large files : - PclZip will now autosense the configured memory and use temporary files - when large file is suspected. - This feature can also ne triggered by manual options in create() and add() - methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files, - 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic, - 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size - threshold to use temporary files. - Using "temporary files" rather than "memory" might take more time, but - might give the ability to zip very large files : - Tested on my win laptop with a 88Mo file : - Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo) - Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo) - - Replace use of mktime() by time() to limit the E_STRICT error messages. - - Bug correction : When adding files with full windows path (drive letter) - PclZip is now working. Before, if the drive letter is not the default - path, PclZip was not able to add the file. - - Version 2.6 : - - Code optimisation - - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to - add a comment for a specific file. (Don't really know if this is usefull) - - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string - as a file. - - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with - a file. - - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted - with current time - - Add CRC value in the informations returned back for each file after an - action. - - Add missing closedir() statement. - - When adding a folder, and removing the path of this folder, files were - incorrectly added with a '/' at the beginning. Which means files are - related to root in unix systems. Corrected. - - Add conditional if before constant definition. This will allow users - to redefine constants without changing the file, and then improve - upgrade of pclzip code for new versions. - - Version 2.5 : - - Introduce the ability to add file/folder with individual properties (file descriptor). - This gives for example the ability to change the filename of a zipped file. - . Able to add files individually - . Able to change full name - . Able to change short name - . Compatible with global options - - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME - - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE - - Add a security control feature. PclZip can extract any file in any folder - of a system. People may use this to upload a zip file and try to override - a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the - ability to forgive any directory transversal behavior. - - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path - - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION - - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend - by current path (getcwd()) - - Version 2.4 : - - Code improvment : try to speed up the code by removing unusefull call to pack() - - Correct bug in delete() : delete() should be called with no argument. This was not - the case in 2.3. This is corrected in 2.4. - - Correct a bug in path_inclusion function. When the path has several '../../', the - result was bad. - - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will - disable it while working and det it back to its original value. - This resolve a lots of bad formated archive errors. - - Bug correction : PclZip now correctly unzip file in some specific situation, - when compressed content has same size as uncompressed content. - - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', - directories are not any more created. - - Code improvment : correct unclosed opendir(), better handling of . and .. in - loops. - - - Version 2.3 : - - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not - give the same result in PHP4 and PHP5 .... - - Version 2.2 : - - Try development of PCLZIP_OPT_CRYPT ..... - However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, - the result (greater than a long) is not supported by PHP. Even the use of bcmath - functions does not help. I did not find yet a solution ...; - - Add missing '/' at end of directory entries - - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or - error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. - - Corrected : Bad "version need to extract" field in local file header - - Add private method privCheckFileHeaders() in order to check local and central - file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives - the ability to have a local file header without size, compressed size and crc filled. - - Add a generic status 'error' for file status - - Add control of compression type. PclZip only support deflate compression method. - Before v2.2, PclZip does not check the compression method used in an archive while - extracting. With v2.2 PclZip returns a new error status for a file using an unsupported - compression method. New status is "unsupported_compression". New error code is - PCLZIP_ERR_UNSUPPORTED_COMPRESSION. - - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files - when errors like 'a folder with same name exists' or 'a newer file exists' or - 'a write protected file' exists, rather than set a status for the concerning file - and resume the extract of the zip. - - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the - replacement of the file, even if a newer version of the file exists. - Note that today if a file with the same name already exists but is older it will be - replaced by the extracted one. - - Improve PclZipUtilOption() - - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central - directory structure is the last data in the archive. Crypt encryption/decryption of - zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. - - Version 2.1 : - - Add the ability to abort the extraction by using a user callback function. - The user can now return the value '2' in its callback which indicates to stop the - extraction. For a pre call-back extract is stopped before the extration of the current - file. For a post call back, the extraction is stopped after. - - Add the ability to extract a file (or several files) directly in the standard output. - This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). - - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, - PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments - in the zip archive. - - When merging two archives, the comments are not any more lost, but merged, with a - blank space separator. - - Corrected bug : Files are not deleted when all files are asked to be deleted. - - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. - - - Version 2.0 : - ***** Warning : Some new features may break the backward compatibility for your scripts. - Please carefully read the readme file. - - Add the ability to delete by Index, name and regular expression. This feature is - performed by the method delete(), which uses the optional parameters - PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. - - Add the ability to extract by regular expression. To extract by regexp you must use the method - extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG - (depending if you want to use ereg() or preg_match() syntax) followed by the - regular expression pattern. - - Add the ability to extract by index, directly with the extract() method. This is a - code improvment of the extractByIndex() method. - - Add the ability to extract by name. To extract by name you must use the method - extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to - extract or an array of filenames to extract. To extract all a folder, use the folder - name rather than the filename with a '/' at the end. - - Add the ability to add files without compression. This is done with a new attribute - which is PCLZIP_OPT_NO_COMPRESSION. - - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly - in a string without using any file (or temporary file). - - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. - The default separator is now a comma (,) and not any more a blank space. - THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with - your script. - - Improve algorythm performance by removing the use of temporary files when adding or - extracting files in an archive. - - Add (correct) detection of empty filename zipping. This can occurs when the removed - path is the same - as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. - - Add better support for windows paths (thanks for help from manus@manusfreedom.com). - - Corrected bug : When the archive file already exists with size=0, the add() method - fails. Corrected in 2.0. - - Remove the use of OS_WINDOWS constant. Use php_uname() function rather. - - Control the order of index ranges in extract by index feature. - - Change the internal management of folders (better handling of internal flag). - - - Version 1.3 : - - Removing the double include check. This is now done by include_once() and require_once() - PHP directives. - - Changing the error handling mecanism : Remove the use of an external error library. - The former PclError...() functions are replaced by internal equivalent methods. - By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. - Introducing the use of constants for error codes rather than integer values. This will help - in futur improvment. - Introduction of error handling functions like errorCode(), errorName() and errorInfo(). - - Remove the deprecated use of calling function with arguments passed by reference. - - Add the calling of extract(), extractByIndex(), create() and add() functions - with variable options rather than fixed arguments. - - Add the ability to remove all the file path while extracting or adding, - without any need to specify the path to remove. - This is available for extract(), extractByIndex(), create() and add() functionS by using - the new variable options parameters : - - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. - - Ability to change the mode of a file after the extraction (chmod()). - This is available for extract() and extractByIndex() functionS by using - the new variable options parameters. - - PCLZIP_OPT_SET_CHMOD : by setting the value of this option. - - Ability to definition call-back options. These call-back will be called during the adding, - or the extracting of file (extract(), extractByIndex(), create() and add() functions) : - - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user - can trigerred the change the filename of the extracted file. The user can triggered the - skip of the extraction. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. - Nothing can be triggered from that point. - - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user - can trigerred the change the stored filename of the added file. The user can triggered the - skip of the add. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_ADD : will be called after each add of a file. - Nothing can be triggered from that point. - - Two status are added in the file list returned as function result : skipped & filename_too_long - 'skipped' is used when a call-back function ask for skipping the file. - 'filename_too_long' is used while adding a file with a too long filename to archive (the file is - not added) - - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into - a directory. - - Add a check of the presence of the archive file before some actions (like list, ...) - - Add the initialisation of field "index" in header array. This means that by - default index will be -1 when not explicitly set by the methods. - - Version 1.2 : - - Adding a duplicate function. - - Adding a merge function. The merge function is a "quick merge" function, - it just append the content of an archive at the end of the first one. There - is no check for duplicate files or more recent files. - - Improve the search of the central directory end. - - Version 1.1.2 : - - - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license - (see License section). - - Adding the optional support of a static temporary directory. You will need to configure - the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. - - Improving the rename() function. In some cases rename() does not work (different - Filesystems), so it will be replaced by a copy() + unlink() functions. - - Version 1.1.1 : - - - Maintenance release, no new feature. - - Version 1.1 : - - - New method Add() : adding files in the archive - - New method ExtractByIndex() : partial extract of the archive, files are identified by - their index in the archive - - New method DeleteByIndex() : delete some files/folder entries from the archive, - files are identified by their index in the archive. - - Adding a test of the zlib extension presence. If not present abort the script. - - Version 1.0.1 : - - - No new feature - - -3 - Corrected bugs -================== - - Corrected in Version 2.0 : - - Corrected : During an extraction, if a call-back fucntion is used and try to skip - a file, all the extraction process is stopped. - - Corrected in Version 1.3 : - - Corrected : Support of static synopsis for method extract() is broken. - - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). - - Corrected : When an extract is done with a remove_path parameter, the entry for - the directory with exactly the same path is not skipped/filtered. - - Corrected : extractByIndex() and deleteByIndex() were not managing index in the - right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This - is due to a sort of the index resulting table that puts 11 before 3-5 (sort on - string and not interger). The sort is temporarilly removed, this means that - you must provide a sorted list of index ranges. - - Corrected in Version 1.2 : - - - Nothing. - - Corrected in Version 1.1.2 : - - - Corrected : Winzip is unable to delete or add new files in a PclZip created archives. - - Corrected in Version 1.1.1 : - - - Corrected : When archived file is not compressed (0% compression), the - extract method fails. - - Corrected in Version 1.1 : - - - Corrected : Adding a complete tree of folder may result in a bad archive - creation. - - Corrected in Version 1.0.1 : - - - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - - -4 - Known bugs or limitations -============================= - - Please publish bugs reports in SourceForge : - http://sourceforge.net/tracker/?group_id=40254&atid=427564 - - In Version 2.x : - - PclZip does only support file uncompressed or compressed with deflate (compression method 8) - - PclZip does not support password protected zip archive - - Some concern were seen when changing mtime of a file while archiving. - Seems to be linked to Daylight Saving Time (PclTest_changing_mtime). - - In Version 1.2 : - - - merge() methods does not check for duplicate files or last date of modifications. - - In Version 1.1 : - - - Limitation : Using 'extract' fields in the file header in the zip archive is not supported. - - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to - add a file in a PclZip created archive. (Corrected in v.1.2) - - In Version 1.0.1 : - - - Adding a complete tree of folder may result in a bad archive - creation. (Corrected in V.1.1). - - Path given to methods must be in the unix format (/) and not the Windows format (\). - Workaround : Use only / directory separators. - - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz - added suffix. Files with these names may already exist and may be overwritten. - Workaround : none. - - PclZip does not check if the zlib extension is present. If it is absent, the zip - file is not created and the lib abort without warning. - Workaround : enable the zlib extension on the php install - - In Version 1.0 : - - - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - (Corrected in v.1.0.1) - - Limitation : Multi-disk zip archive are not supported. - - -5 - License -=========== - - Since version 1.1.2, PclZip Library is released under GNU/LGPL license. - This library is free, so you can use it at no cost. - - HOWEVER, if you release a script, an application, a library or any kind of - code using PclZip library (or a part of it), YOU MUST : - - Indicate in the documentation (or a readme file), that your work - uses PclZip Library, and make a reference to the author and the web site - http://www.phpconcept.net - - Gives the ability to the final user to update the PclZip libary. - - I will also appreciate that you send me a mail (vincent@phpconcept.net), just to - be aware that someone is using PclZip. - - For more information about GNU/LGPL license : http://www.gnu.org - -6 - Warning -================= - - This library and the associated files are non commercial, non professional work. - It should not have unexpected results. However if any damage is caused by this software - the author can not be responsible. - The use of this software is at the risk of the user. - -7 - Documentation -================= - PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php - A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/ - -8 - Author -========== - - This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. - -9 - Contribute -============== - If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. - If you can help in financing PhpConcept hosting service, please go to - http://www.phpconcept.net/soutien.php diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/2dbarcodes.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/2dbarcodes.php deleted file mode 100644 index 8b73857d23..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/2dbarcodes.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php -//============================================================+ -// File name : 2dbarcodes.php -// Version : 1.0.007 -// Begin : 2009-04-07 -// Last Update : 2010-08-08 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2009-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : PHP class to creates array representations for -// 2D barcodes to be used with TCPDF. -// -//============================================================+ - -/** - * PHP class to creates array representations for 2D barcodes to be used with TCPDF. - * @package com.tecnick.tcpdf - * @abstract Functions for generating string representation of 2D barcodes. - * @author Nicola Asuni - * @copyright 2009-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.007 - */ - - /** - * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> - * @name TCPDFBarcode - * @package com.tecnick.tcpdf - * @version 1.0.007 - * @author Nicola Asuni - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - */ -class TCPDF2DBarcode { - - /** - * @var array representation of barcode. - * @access protected - */ - protected $barcode_array = false; - - /** - * This is the class constructor. - * Return an array representations for 2D barcodes:<ul> - * <li>$arrcode['code'] code to be printed on text label</li> - * <li>$arrcode['num_rows'] required number of rows</li> - * <li>$arrcode['num_cols'] required number of columns</li> - * <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul> - * @param string $code code to print - * @param string $type type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li></ul> - */ - public function __construct($code, $type) { - $this->setBarcode($code, $type); - } - - /** - * Return an array representations of barcode. - * @return array - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Set the barcode. - * @param string $code code to print - * @param string $type type of barcode: <ul><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>QRCODE : QR-CODE Low error correction</li><li>QRCODE,L : QR-CODE Low error correction</li><li>QRCODE,M : QR-CODE Medium error correction</li><li>QRCODE,Q : QR-CODE Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li></ul> - * @return array - */ - public function setBarcode($code, $type) { - $mode = explode(',', $type); - $qrtype = strtoupper($mode[0]); - switch ($qrtype) { - case 'QRCODE': { // QR-CODE - require_once(dirname(__FILE__).'/qrcode.php'); - if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) { - $mode[1] = 'L'; // Ddefault: Low error correction - } - $qrcode = new QRcode($code, strtoupper($mode[1])); - $this->barcode_array = $qrcode->getBarcodeArray(); - break; - } - case 'PDF417': { // PDF417 (ISO/IEC 15438:2006) - require_once(dirname(__FILE__).'/pdf417.php'); - if (!isset($mode[1]) OR ($mode[1] === '')) { - $aspectratio = 2; // default aspect ratio (width / height) - } else { - $aspectratio = floatval($mode[1]); - } - if (!isset($mode[2]) OR ($mode[2] === '')) { - $ecl = -1; // default error correction level (auto) - } else { - $ecl = intval($mode[2]); - } - // set macro block - $macro = array(); - if (isset($mode[3]) AND ($mode[3] !== '') AND isset($mode[4]) AND ($mode[4] !== '') AND isset($mode[5]) AND ($mode[5] !== '')) { - $macro['segment_total'] = intval($mode[3]); - $macro['segment_index'] = intval($mode[4]); - $macro['file_id'] = strtr($mode[5], "\xff", ','); - for ($i = 0; $i < 7; ++$i) { - $o = $i + 6; - if (isset($mode[$o]) AND ($mode[$o] !== '')) { - // add option - $macro['option_'.$i] = strtr($mode[$o], "\xff", ','); - } - } - } - $qrcode = new PDF417($code, $ecl, $aspectratio, $macro); - $this->barcode_array = $qrcode->getBarcodeArray(); - break; - } - case 'RAW': - case 'RAW2': { // RAW MODE - // remove spaces - $code = preg_replace('/[\s]*/si', '', $code); - if (strlen($code) < 3) { - break; - } - if ($qrtype == 'RAW') { - // comma-separated rows - $rows = explode(',', $code); - } else { // RAW2 - // rows enclosed in square parentheses - $code = substr($code, 1, -1); - $rows = explode('][', $code); - } - $this->barcode_array['num_rows'] = count($rows); - $this->barcode_array['num_cols'] = strlen($rows[0]); - $this->barcode_array['bcode'] = array(); - foreach ($rows as $r) { - $this->barcode_array['bcode'][] = str_split($r, 1); - } - break; - } - case 'TEST': { // TEST MODE - $this->barcode_array['num_rows'] = 5; - $this->barcode_array['num_cols'] = 15; - $this->barcode_array['bcode'] = array( - array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1), - array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0), - array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0), - array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0), - array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0)); - break; - } - default: { - $this->barcode_array = false; - } - } - } -} // end of class - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/CHANGELOG.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/CHANGELOG.TXT deleted file mode 100644 index 2583192f43..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/CHANGELOG.TXT +++ /dev/null @@ -1,1782 +0,0 @@ -5.9.009 (2010-10-21) - - HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction. - -5.9.008 (2010-10-21) - - Bug item #3091502 "Bookmark oddity" was fixed. - - HTML internal links now accepts page number and Y position. - - The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27). - -5.9.007 (2010-10-20) - - Method adjustCellPadding() was fixed to handle bad input. - -5.9.006 (2010-10-19) - - Support for AES 256 bit encryption was added (see example n. 16). - - Method getNumLines() was fixed for the empty string case. - -5.9.005 (2010-10-18) - - Method addPageRegion() was changed to accept regions starting exactly from the top of the page. - -5.9.004 (2010-10-18) - - A bug related to annotations was fixed. - - The file unicode_data.php was canged to encapsulate all data in a class. - - The file htmlcolors.php was changed to remove the global variable. - -5.9.003 (2010-10-15) - - Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion(). - - A bug on Right-To-Left alignment was fixed. - -5.9.002 (2010-10-08) - - Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4). - -5.9.001 (2010-10-07) - - The problem of blank page for nobr table higher than a single page was fixed. - -5.9.000 (2010-10-06) - - Support for text stretching and spacing (kerning) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing(). - - Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63). - - The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods. - - Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5). - - Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5). - - Method write1DBarcode() was improved to permit custom labels (see example n. 27). - - Method ImagePngAlpha() now includes support for ImageMagick to improve performances. - - XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods. - - The signature of getNumLines() and getStringHeight() methods is changed. - - Example n. 57 was updated. - -// ------------------------------------------------------------------- - -5.8.034 (2010-09-27) - - A bug related to SetFont on XObject templates was fixed. - -5.8.033 (2010-09-25) - - A problem with Footer() and multiple columns was fixed. - -5.8.032 (2010-09-22) - - Bug #3073165 "Issues with changes to addHTMLVertSpace()" was fixed. - -5.8.031 (2010-09-20) - - Bug #3071961 "Spaces in HTML" was fixed. - -5.8.030 (2010-09-17) - - SVG support was improved and some bugs were fixed. - -5.8.029 (2010-09-16) - - A problem with HTML borders was fixed. - -5.8.028 (2010-09-13) - - Bug #3065224 "mcrypt_create_iv error on TCPDF 5.8.027 on PHP 5.3.2" was fixed. - -5.8.027 (2010-09-13) - - Bug #3065118 "mcrypt_decrypt error on TCPDF 5.8.026 on PHP 5.3.2" was fixed. - -5.8.026 (2010-09-13) - - A bug on addHTMLTOC() method was fixed. Note: be sure that the #TOC_PAGE_NUMBER# template has enough width to be printed correctly. - -5.8.025 (2010-09-09) - - Bug #3062692 "Textarea inside a table" was fixed. - -5.8.024 (2010-09-08) - - Bug #3062005 "Undefined variable: ann_obj_id" was fixed. - -5.8.023 (2010-08-31) - - Forms bug added on version 5.8.019 was fixed. - -5.8.022 (2010-08-31) - - Bug #3056632 "SVG rendered vertically flipped" was fixed. - -5.8.021 (2010-08-30) - - A new CID-0 'chinese' font was added for traditional Chinese. - - Bug #3054287 'Inner tags are ignored due to "align" attribute' was fixed. - -5.8.020 (2010-08-26) - - CSS "catch-all" class selector is now supported. - -5.8.019 (2010-08-26) - - XObject Templates now includes support for links and annotations. - - A problem related to link alignment on cell was fixed. - - A problem related to SVG styles was fixed. - -5.8.018 (2010-08-25) - - Method getNumberOfColumns() was added. - - A problem related to table header was fixed. - - Method getSVGTransformMatrix() was fixed to apply SVG transformations in the correct order. - - SVG support was improved and several bugs were fixed. - -5.8.017 (2010-08-25) - - This version includes support for XObject Templates (see the new example n. 62). - - Methods starttemplate(), endTemplate() and printTemplate() were added (see the new example n. 62). - -5.8.016 (2010-08-24) - - Alignment problem on write2DBarcode was fixed. - -5.8.015 (2010-08-24) - - A problem arised with the latest bugfix was fixed. - -5.8.014 (2010-08-23) - - Method _getxobjectdict() was added for better compatibility with external extensions. - - A bug related to radiobuttons was fixed. - - Bug #3051509 "new line after punctuation marks" was fixed (partially). - -5.8.013 (2010-08-23) - - SVG support for 'direction' property was added. - - A problem on default width calculation for linear barcodes was fixed. - - New option was added to write1DBarcode() method to improve alignments (see example n. 27). - - Bug #3050896 "Nested HTML tables: styles are not applied" was fixed. - - Method _putresourcedict() was improved to include external XObject templates. - -5.8.012 (2010-08-22) - - Support for SVG 'text-anchor' property was added. - -5.8.011 (2010-08-21) - - Method write1DBarcode() was improved to be backward compatible (check the new example n. 27). - - Support for CSS width and height properties on images were added. - -5.8.010 (2010-08-20) - - Documentation of unhtmlentities() was fixed. - - The 'fitwidth' option was added and border color problem was fixed on write1DBarcode() method (check the example n. 27). - -5.8.009 (2010-08-20) - - Internal object numbering was improved. - - Some errors in object encryption were fixed. - -5.8.008 (2010-08-19) - - Method write1DBarcode() was changed, check the example n. 27. - - Method Footer() was changed to account for barcode changes. - - Automatic calculation of K_PATH_URL constant was fixed on configuration file. - - Method setEqualColumns() was fixed for $width=0 case. - - Method AddTOC() was fixed for multipage and multicolumn modes. - - Better support for SVG "font-family" property. - - A problem on default Page Zoom mode was fixed. - - Several Annotation bugs were fixed. - -5.8.007 (2010-08-18) - - A bug affecting HTML tables was fixed. - - Bug #3047500 "SVG not rendering paths properly" was fixed. - -5.8.006 (2010-08-17) - - A bug affecting HTML table nesting was fixed. - -5.8.005 (2010-08-17) - - A bug affecting the HTML 'select' tag in certain conditions was fixed. - -5.8.004 (2010-08-17) - - Better support for HTML "font-family" property. - - A bug related to HTML multicolumn was fixed. - -5.8.003 (2010-08-16) - - Better support for HTML "font-family" property. - -5.8.002 (2010-08-14) - - HTML alignments were improved - - IMPORTANT: Default regular expression to find spaces has been changed to exclude the non-breaking-space (160 DEC- A0 HEX). If you are using setSpacesRE() method, please read the new documentation. - - Example n. 1 was updated. - -5.8.001 (2010-08-12) - - Bug #3043650 "subsetchars incorrectly cached" was fixed. - -5.8.000 (2010-08-11) - - A control to avoid bookmarking page 0 was added. - - addTOC() method now includes support for multicolumn mode. - - Support for tables in multicolumn mode was improved. - - Example n.10 was updated. - - All trimming functions were replaced with stringLeftTrim(), stringRightTrim() and stringTrim(). - - HTML alignments were improved. - ------------------------------------------------------------- - -5.7.003 (2010-08-08) - - Bug #3041263 "php source ending is bad" was fixed (all PHP files were updated, including fonts). - -5.7.002 (2010-08-06) - - Methods copyPage(), movePage() and deletePage() were changed to account for internal markings. - -5.7.001 (2010-08-05) - - Bug #3040105 "Broken PDF when using TOC (example 45)" was fixed. - -5.7.000 (2010-08-03) - - CSS borders are now supported for HTML tables and other block tags (see example n. 61); - - Cell borders were improved (see example n. 57); - - Minor bugs were fixed. -encry ------------------------------------------------------------- - -5.6.000 (2010-07-31) - - A bug with object IDs was fixes. - - Performances were improved. - ------------------------------------------------------------- - -5.5.015 (2010-07-29) - - Automatic fix for unclosed self-closing tag. - - Support for deprecated 's' and 'strike' tags was added. - - Empty list items problem was fixed. - -5.5.014 (2010-07-15) - - Support for external images was improved. - -5.5.013 (2010-07-14) - - Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong). - -5.5.012 (2010-07-14) - - Bug #3029310 "Font baseline inconsistencies with line-height and font-size" was fixed. - - Bug #3029338 "FI and FO output destination filename bug" was fixed. - -5.5.011 (2010-07-09) - - Support for multiple CSS classes was added. - - The method getColumn() was added to return the current column number. - - Some regular Expressions were fixed to be more compatible with UTF-8. - -5.5.010 (2010-07-06) - - Bug item #3025772 "Borders in all image functions are still flawed" was fixed. - -5.5.009 (2010-07-05) - - A problem related to last page footer was fixed. - - Image alignments and fit-on-page features were improved. - -5.5.008 (2010-07-02) - - A problem on table header alignment in booklet mode was fixed. - - Default graphic vars are now applied for setHeader(); - -5.5.007 (2010-07-02) - - Attribute "readonly" was added to input and textarea form fields. - - Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5). - - Text-Fit feature was added on MultiCell() method only for simple text mode (see example n. 5). - -5.5.006 (2010-06-29) - - getStringHeight() and getNumLines() methods were fixed. - -5.5.005 (2010-06-28) - - Bug #3022170 "getFontDescent() does not return correct descent value" was fixed. - - Some problems with multicolumn mode were fixed. - -5.5.004 (2010-06-27) - - Bug #3021803 "SVG Border" was fixed. - -5.5.003 (2010-06-26) - - On Write() method, blank lines at the beginning of a page or column are now automatically removed. - -5.5.002 (2010-06-24) - - ToUnicode Identity-H name was replaced with a full CMap (to avoid preflight syntax error). - - Bug #3020638 "str_split() not available in php4" was fixed. - - Bug #3020665 "file_get_contents() too many parameters for php4" was fixed. - -5.5.001 (2010-06-23) - - A problem on image streams was fixed. - -5.5.000 (2010-06-22) - - Several PDF syntax errors (and related bugs) were fixed. - - Bug #3019090 "/Length values are wrong if AES encryption is used" was fixed. - ------------------------------------------------------------- - -5.4.003 (2010-06-19) - - A problem related to page boxes was fixed. - - Bug #3016920 "Font subsetting issues when editing pdf" was partially fixed (Note that flattening transparency layers is currently incompatible with TrueTypeUnicode fonts). - -5.4.002 (2010-06-18) - - A problem related with setProtection() method was fixed. - -5.4.001 (2010-06-18) - - A problem related with setProtection() method was fixed. - -5.4.000 (2010-06-18) - - The method setSignatureAppearance() was added, check the example n. 52. - - Several problems related to font subsetting were fixed. - ------------------------------------------------------------- - -5.3.010 (2010-06-15) - - Previous release was corrupted. - -5.3.009 (2010-06-15) - - Bug #3015934 "Bullets don't display correctly" was fixed. - -5.3.008 (2010-06-13) - - This version fixes some problems of SVG rasterization. - -5.3.007 (2010-06-13) - - This version improves SVG support. - -5.3.006 (2010-06-10) - - This version includes a change in uniqid calls for backward compatibility with PHP4. - -5.3.005 (2010-06-09) - - The method getPageSizeFromFormat() was changed to include all standard page formats (includes 281 page formats + variation). - -5.3.004 (2010-06-08) - - Bug #3013291 "HTML table cell width" was fixed. - - Bug #3013294 "HTML table cell alignment" was fixed. - - The columns widths of HTML tables are now inherited from the first row. - -5.3.003 (2010-06-08) - - Bug #3013102 "HTML table header misaligned after page break" was fixed. - -5.3.002 (2010-06-07) - - The methods setFontSubsetting() and setFontSubsetting() were added to control the default font subsetting mode (see example n. 1). - - Bug #3012596 "Whitespace should not appeared after use Thai top characters" was fixed. - - Examples n. 1, 14, and 54 were updated. - -5.3.001 (2010-06-06) - - Barcode PDF417 was improved to support Macro Code Blocks (see example n. 50). - -5.3.000 (2010-06-05) - - License was changed to GNU-LGPLv3 (see the updated LICENSE.TXT file). - - PDF417 barcode support was added (check the example n. 50). - - The method write2DBarcode() was improved (some parameters were added and other changed - check example n. 50). - ------------------------------------------------------------- - -5.2.000 (2010-06-02) - - IMPORTANT: Support for font subsetting was added by default to reduce the size of documents using large unicode font files. - If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font. - If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF. - - The signature of the SetFont() and AddFont() methods were changed to include the font subsetting option (subsetting is applied by default). - - Examples 14 and 54 were updated. - ------------------------------------------------------------- - -5.1.002 (2010-05-27) - - Bug #3007818 "SetAutoPageBreak fails with MultiCell" was fixed. - - A bug related to MultiCell() minimun height was fixed. - -5.1.001 (2010-05-26) - - The problem of blank page after table was fixed. - -5.1.000 (2010-05-25) - - This version includes support for CSS (Cascading Style Sheets) (see example n. 61). - - The convertHTMLColorToDec() method was improved. - ------------------------------------------------------------- - -5.0.014 (2010-05-21) - - A problem on color and style of HTML links was fixed. - - A bug relative to gradients was fixed. - - The getStringHeight() method was added and getNumLines() method was improved. - - All examples were updated. - -5.0.013 (2010-05-19) - - A bug related to page-breaks and table cells was fixed. - -5.0.012 (2010-05-19) - - Page orientation bug was fixed. - - The access to method setPageFormat() was changed to 'protected' because it is not intended to be directly called. - -5.0.011 (2010-05-19) - - Page orientation bug was fixed. - - Bug #3003966 "Multiple columns and nested lists" was fixed. - -5.0.010 (2010-05-17) - - The methods setPageFormat(), setPageOrientation() and related methods were extended to include page boxes, page rotations and page transitions. - - The method setPageBoxes() was added to set page boundaries (MediaBox, CropBox, BleedBox, TrimBox, ArtBox); - - A bug relative to underline, overline and linethrough was fixed. - -5.0.009 (2010-05-16) - - Bug #3002381 "Multiple columns and nested lists" was fixed. - -5.0.008 (2010-05-15) - - Bug "Columns WriteHTML and Justification" was fixed. - -5.0.007 (2010-05-14) - - Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed. - - Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed. - -5.0.006 (2010-05-13) - - Length of hr tag was fixed. - - An error on 2d barcode method was fixed. - -5.0.005 (2010-05-12) - - WARNING: The logic of permissions on the SetProtection() method has been inverted and extended (see example 16). Now you have to specify the features you want to block. - - SetProtection() method was extended to support RSA and AES 128 encryption and public-keys (see example 16). - - Bug #2999489 "setEqualColumns() and TOC uses wrong columns" was fixed (see the example 10). - -5.0.004 (2010-05-10) - - HTML line alignment when using sub and sup tags was fixed. - -5.0.003 (2010-05-07) - - Horizontal alignment was fixed for images and barcodes. Now the X coordinate is always relative to the left margin. Use GetAbsX() instead of GetX() to get the X relative to left margin. - - Header() method was changed to account for new image alignment rules. - -5.0.002 (2010-05-06) - - Bookmark() and related methods were fixed to accept HTML code. - - A problem on HTML links was fixed. - -5.0.001 (2010-05-06) - - Protected method _putstream was re-added for backward compatibility. - - The following method were added to display HTML Table Of Content (see example n. 59): - addTOCPage(), endTOCPage(), addHTMLTOC(). - -5.0.000 (2010-05-05) - - Method ImageSVG() was added to embedd SVG images (see example n. 58). Note that not all SVG images are supported. - - Method setRasterizeVectorImages() was added to enable/disable rasterization for vector images via ImageMagick library. - - Method RoundedRectXY() was added. - - Method PieSectorXY() was added. - - Gradient() method is now public and support new features. - - Shading to transparency is now supported. - - Image alignments were fixed. - - Support for dynamic images were improved. - - PDF_IMAGE_SCALE_RATIO has been changed to 1.25 for better compatibility with SVG. - - RAW and RAW2 modes were added to 2D Barcodes (see example n. 50). - - Automatic padding feature was added on barcodes (see examples n. 27 and 50). - - Bug #2995003 "Reproduced thead bug" was fixed. - - The Output() method now accepts FI and FD destinations to save the document on server before sending it to the client. - - Ellipse() method was improved and fixed (see page 2 of example n. 12). - ------------------------------------------------------------- - -4.9.018 (2010-04-21) - - Bug item #2990356 "Current font size not respected with more than two HTML <p>" was fixed. - -4.9.017 (2010-04-21) - - Bug item #2990224 "Different behaviour for equivalent HTML strings" was fixed. - - Bug item #2990314 "Dash is not appearing with SHY character" was fixed. - -4.9.016 (2010-04-20) - - An error on htmlcolors.php was fixed. - - getImageFileType() method was improved. - - GIF images with transparency are now better supported. - - Automatic page orientation was improved. - -4.9.015 (2010-04-20) - - A new method copyPage() was added to clone pages (see example n. 44). - - Support for text overline was added. - - Underline and linethrough methods were fixed. - - Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed. - -4.9.014 (2010-04-18) - - Bug item #2988845 was fixed. - -4.9.013 (2010-04-15) - - Image() and ImageEPS() methods were fixed and improved; $fitonpage parameter was added. - -4.9.012 (2010-04-12) - - The hyphenateText() method was added to automatically hyphenate text (see example n. 46). - -4.9.011 (2010-04-07) - - Vertical alignments for Cell() method were improved (see example n. 57). - -4.9.010 (2010-04-06) - - Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57). - - Text() method was extended to include all Cell() parameters. - - HTML line alignment procedure was changed to fix some bugs. - -4.9.009 (2010-04-05) - - Text() method was fixed for backward compatibility. - -4.9.008 (2010-04-03) - - Additional line space after table header was removed. - - Support for HTML lists in multicolumn mode was added. - - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26). - - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill. - -4.9.007 (2010-04-03) - - Font Descent computation was fixed (patch #2981441). - -4.9.006 (2010-04-02) - - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML. - - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information. - -4.9.005 (2010-04-01) - - Bug# 2980354 "Wrong File attachment description with security" was fixed. - - Several problems with HTML line alignment were fixed. - - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language. - - A problem with font name directory was fixed. - - A bug on _destroy() method was fixed. - -4.9.004 (2010-03-31) - - Patch #979681 "GetCharWidth - default character width" was applied (bugfix). - -4.9.003 (2010-03-30) - - Problem of first <br /> on multiple columns was fixed. - - HTML line alignment was fixed. - - A QR-code bug was fixed. - -4.9.002 (2010-03-29) - - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied. - - Bug #2978607 "2D Barcodes are wrong" was fixed. - - A problem with HTML block tags was fixed. - - Artificial italic for CID-0 fonts was added. - - Several multicolumn bugs were fixed. - - Support for HTML tables on multicolumn was added. - -4.9.001 (2010-03-28) - - QR Code minor bug was fixed. - - Multicolumn mode was added (see the new example n. 10). - - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn(). - - Thai diacritics support were changed (note that this is incompatible with html justification). - -4.9.000 (2010-03-27) - - QR Code (2D barcode) support was added (see example n. 50). - - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark(). - - Limited support for CSS line-height property was added. - - Gradient method now supports Gray, RGB and CMYK space color. - - Example n. 51 was updated. - - Vertical alignment of font inside cell was fixed. - - Support for multiple Thai diacritics was added. - - Bug item #2974929 "Duplicate case values" was fixed. - - Bug item #2976729 "File attachment not working with security" was fixed. - ------------------------------------------------------------- - -4.8.039 (2010-03-20) - - Problems related to custom locale settings were fixed. - - Problems related to HTML on Header and Footer were fixed. - -4.8.038 (2010-03-13) - - Various bugs related to page-break in HTML mode were fixed. - - Bug item #2968974 "Another <thead> pagebreak problem" was fixed. - - Bug item #2969276 "justification problem" was fixed. - - Bug item #2969289 "bug when using justified text and custom headers" was fixed. - - Images are now automatically resized to be contained on the page. - - Some HTML line alignments were fixed. - - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins. - -4.8.037 (2010-03-03) - - Bug item #2962068 was fixed. - - Bug item #2967017 "Problems with <thead> and pagebreaks" was fixed. - - Bug item #2967023 "table header lost with pagebreak" was fixed. - - Bug item #2967032 "Header lost with nested tables" was fixed. - -4.8.036 (2010-02-24) - - Automatic page break for HTML images was improved. - - Example 10 was updated. - - Japanese was removed from example 8 because the freeserif font doesn't contain japanese (you can display it using arialunicid0 font). - -4.8.035 (2010-02-23) - - Automatic page break for HTML images was added. - - Support for multicolumn HTML was added (example 10 was updated). - -4.8.034 (2010-02-17) - - Language files were updated. - -4.8.033 (2010-02-12) - - A bug related to protection mode with links was fixed. - -4.8.032 (2010-02-04) - - A bug related to $maxh parameter on Write() and MultiCell() was fixed. - - Support for body tag was added. - -4.8.031 (2010-01-30) - - Bug item #2941589 "paragraph justify not working on some non-C locales" was fixed. - -4.8.030 (2010-01-27) - - Some text alignment cases were fixed. - -4.8.029 (2010-01-27) - - Bug item #2941057 "TOC Error in PDF File Output" was fixed. - - Some text alignment cases were fixed. - -4.8.028 (2010-01-26) - - Text alignment for RTL mode was fixed. - -4.8.027 (2010-01-25) - - Bug item #2938412 "Table related problems - thead, nobr, table width" was fixed. - -4.8.026 (2010-01-19) - - The misspelled word "lenght" was replaced with "length" in some variables and comments. - -4.8.025 (2010-01-18) - - addExtGState() method was improved to reuse existing ExtGState objects. - -4.8.024 (2010-01-15) - - Justification mode for HTML was fixed (Bug item #2932470). - -4.8.023 (2010-01-15) - - Bug item #2932470 "Some HTML entities breaks justification" was fixed. - -4.8.022 (2010-01-14) - - Source code documentation was fixed. - -4.8.021 (2010-01-03) - - A Bug relative to Table Of Content index was fixed. - -4.8.020 (2009-12-21) - - Bug item #2918545 "Display problem of the first row of a table with larger font" was fixed. - - A Bug relative to table rowspan mode was fixed. - -4.8.019 (2009-12-16) - - Bug item #2915684 "Image size" was fixed. - - Bug item #2914995 "Image jpeg quality" was fixed. - - The signature of the Image() method was changed (check the documentation for the $resize parameter). - -4.8.018 (2009-12-15) - - Bug item #2914352 "write error" was fixed. - -4.8.017 (2009-11-27) - - THEAD problem when table is used on header/footer was fixed. - - A first line alignment on HTML justification was fixed. - - Method getImageFileType() was added. - - Images with unknown extension and type are now supported via ImageMagick PHP extension. - -4.8.016 (2009-11-21) - - Document Information Dictionary was fixed. - - CSS attributes 'page-break-before', 'page-break-after' and 'page-break-inside' are now supported. - - Problem of unclosed last page was fixed. - - Problem of 'thead' unnecessarily repeated on the next page was fixed. - -4.8.015 (2009-11-20) - - A problem with some PNG transparency images was fixed. - - Bug #2900762 "Sort issues in Bookmarks" was fixed. - - Text justification was fixed for various modes: underline, strikeout and background. - -4.8.014 (2009-11-04) - - Bug item #2891316 "writeHTML, underlining replacing spaces" was fixed. - - The handling of temporary RTL text direction mode was fixed. - -4.8.013 (2009-10-26) - - Bug item #2884729 "Problem with word-wrap and hyphen" was fixed. - -4.8.012 (2009-10-23) - - Table cell alignments for RTL booklet mode were fixed. - - Images and barcode alignments for booklet mode were fixed. - -4.8.011 (2009-10-22) - - DejaVu fonts were updated to latest version. - -4.8.010 (2009-10-21) - - Bookmark for TOC page was added. - - Signature of addTOC() method is changed. - - Bookmarks are now automatically sorted by page and Y position. - - Example n. 45 was updated. - - Example n. 55 was added to display all charactes available on core fonts. - -4.8.009 (2009-09-30) - - Compatibility with PHP 5.3 was improved. - - All examples were updated. - - Index file for examples was added. - -4.8.008 (2009-09-29) - - Example 49 was updated. - - Underline and linethrough now works with cell stretching mode. - -4.8.007 (2009-09-23) - - Infinite loop problem caused by nobr attribute was fixed. - -4.8.006 (2009-09-23) - - Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed. - - Support for text-indent CSS attribute was added. - - Method rollbackTransaction() was changed to support self-reassigment of previous object (check source code documentation). - - Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: <tr nobr="true">...</tr>). - -4.8.005 (2009-09-17) - - A bug relative to multiple transformations and annotations was fixed. - -4.8.004 (2009-09-16) - - A bug on _putannotsrefs() method was fixed. - -4.8.003 (2009-09-15) - - Bug item #2858754 "Division by zero" was fixed. - - A bug relative to HTML list items was fixed. - - A bug relative to form fields on multiple pages was fixed. - - PolyLine() method was added (see example n. 12). - - Signature of Polygon() method was changed. - -4.8.002 (2009-09-12) - - A problem related to CID-0 fonts offset was fixed: if the $cw[1] entry on the CID-0 font file is not defined, then a CID keys offset is introduced. - -4.8.001 (2009-09-09) - - The appearance streams (AP) for anotations form fields was fixed (see examples n. 14 and 54). - - Radiobuttons were fixed. - -4.8.000 (2009-09-07) - - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54). - - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button(). - - Support for Widget annotations was improved. - - Alignment of annotation objects was fixed (examples 36 and 41 were updated). - - addJavascriptObject() method was added. - - Signature of Image() method was changed. - - htmlcolors.php file was updated. - ------------------------------------------------------------- - -4.7.003 (2009-09-03) - - Support for TCPDF methods on HTML was improved (see example n. 49). - -4.7.002 (2009-09-02) - - Bug item #2848892 "writeHTML + table: Gaps between rows" was fixed. - - JavaScript support was fixed (see example n. 53). - -4.7.001 (2009-08-30) - - The Polygon() and Arrow() methods were fixed and improved (see example n. 12). - -4.7.000 (2009-08-29) - - This is a major release. - - Some procedures were internally optimized. - - The problem of mixed signature and annotations was fixed (example n. 52). - -4.6.030 (2009-08-29) - - IMPORTANT: percentages on table cell widths are now relative to the full table width (as in standard HTML). - - Various minor bugs were fixed. - - Example n. 52 (digital signature) was updated. - -4.6.029 (2009-08-26) - - PHP4 version was fixed. - -4.6.028 (2009-08-25) - - Signature algorithm was finally fixed (see example n. 52). - -4.6.027 (2009-08-24) - - TCPDF now supports unembedded TrueTypeUnicode Fonts (just comment the $file entry on the fonts' php file. - -4.6.026 (2009-08-21) - - Bug #2841693 "Problem with MultiCell and ishtml and justification" was fixed. - - Signature functions were improved but not yet fixed (tcpdf.crt and example n. 52 were updated). - -4.6.025 (2009-08-17) - - Carriage returns (\r) were removed from source code. - - Problem related to set_magic_quotes_runtime() depracated was fixed. - -4.6.024 (2009-08-07) - - Bug item #2833556 "justification using other units than mm" was fixed. - - Documentation was fixed/updated. - -4.6.023 (2009-08-02) - - Bug item #2830537 "MirrorH can show mask for transparent PNGs" was fixed. - -4.6.022 (2009-07-24) - - A bug relative to single line printing when using WriteHTMLCell() was fixed. - - Signature support were improved but is still experimental. - - Fonts Free and Dejavu were updated to latest versions. - -4.6.021 (2009-07-20) - - Bug item #2824015 "XHTML Ampersand &amp; in hyperlink bug" was fixed. - - Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed. - - Links alignment on justified text was fixed. - - Unicode "\u" modifier was added to re_spaces variable by default. - -4.6.020 (2009-07-16) - - Bug item #2821921 "issue in example 18" was fixed. - - Signature of SetRTL() method was changed. - -4.6.019 (2009-07-13) - - Bug item #2820703 "xref table broken" was fixed. - -4.6.018 (2009-07-10) - - Bug item #2819319 "Text over text" was fixed. - - Method Arrow() was added to print graphic arrows (example 12 was updated). - -4.6.017 (2009-07-05) - - Bug item #2816079 "Example 48 not working" was fixed. - - The signature of the checkPageBreak() was changed. The parameter $addpage was added to turn off the automatic page creation. - -4.6.016 (2009-06-16) - - Method setSpacesRE() was added to set the regular expression used for detecting withespaces or word separators. If you are using chinese, try: setSpacesRE('/[\s\p{Z}\p{Lo}]/');, otherwise you can use setSpacesRE('/[\s\p{Z}]/'); - - The method _putinfo() now automatically fills the metadata with '?' in case of empty string. - -4.6.015 (2009-06-11) - - Bug #2804667 "word wrap bug" was fixed. - -4.6.014 (2009-06-04) - - Bug #2800931 "Table thead tag bug" was fixed. - - A bug related to <pre> tag was fixed. - -4.6.013 (2009-05-28) - - List bullets position was fixed for RTL languages. - -4.6.012 (2009-05-23) - - setUserRights() method doesn't work anymore unless you call the setSignature() method with the Adobe private key! - -4.6.011 (2009-05-18) - - Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation). - -4.6.010 (2009-05-17) - - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null. - - <tcpdf> tag indent problem was fixed. - - $y parameter was added to checkPageBreak() method. - - Bug n. 2791773 "writeHTML" was fixed. - -4.6.009 (2009-05-13) - - xref table for embedded files was fixed. - -4.6.008 (2009-05-07) - - setSignature() method was improved (but is still experimental). - - Example n. 52 was added. - -4.6.007 (2009-05-05) - - Bug #2786685 "writeHtmlCell and <br /> in custom footer" was fixed. - - Table header repeating bug was fixed. - - Some newlines and tabs are now automatically removed from HTML strings. - -4.6.006 (2009-04-28) - - Support for "<a name="...">...</a>" was added. - - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces). - -4.6.005 (2009-04-25) - - Points (pt) conversion in getHTMLUnitToUnits() was fixed. - - Default tcpdf.pem certificate file was added. - - Experimental support for signing document was added but it is not yet completed (some help is needed - I think that the calculation of the ByteRange is OK and the problem is on the signature calculation). - -4.6.004 (2009-04-23) - - Method deletePage() was added to delete pages (see example n. 44). - -4.6.003 (2009-04-21) - - The caching mechanism of the UTF8StringToArray() method was fixed. - -4.6.002 (2009-04-20) - - Documentation of rollbackTransaction() method was fixed. - - The setImageScale() and getImageScale() methods now set and get the adjusting parameter used by pixelsToUnits() method. - - HTML images now support other units of measure than pixels (getHTMLUnitToUnits() is now used instead of pixelsToUnits()). - - WARNING: PDF_IMAGE_SCALE_RATIO has been changed by default to 1. - -4.6.001 (2009-04-17) - - Spaces between HTML block tags are now automatically removed. - - The bug related to cMargin changes between tables was fixed. - -4.6.000 (2009-04-16) - - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods: - zero coordinates for $x and $y are now valid coordinates; - set $x and $y as empty strings to get the current value. - - Some error caused by 'empty' funtion were fixed. - - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false. - - HTML on footer bug was fixed. - - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43. - -4.5.043 (2009-04-15) - - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27): - C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9 - C39+ : CODE 39 with checksum - C39E : CODE 39 EXTENDED - C39E+ : CODE 39 EXTENDED + CHECKSUM - C93 : CODE 93 - USS-93 - S25 : Standard 2 of 5 - S25+ : Standard 2 of 5 + CHECKSUM - I25 : Interleaved 2 of 5 - I25+ : Interleaved 2 of 5 + CHECKSUM - C128A : CODE 128 A - C128B : CODE 128 B - C128C : CODE 128 C - EAN2 : 2-Digits UPC-Based Extention - EAN5 : 5-Digits UPC-Based Extention - EAN8 : EAN 8 - EAN13 : EAN 13 - UPCA : UPC-A - UPCE : UPC-E - MSI : MSI (Variation of Plessey code) - MSI+ : MSI + CHECKSUM (modulo 11) - POSTNET : POSTNET - PLANET : PLANET - RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX : KIX (Klant index - Customer index) - IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 (NOTE: requires BCMath PHP extension) - CODABAR : CODABAR - CODE11 : CODE 11 - PHARMA : PHARMACODE - PHARMA2T : PHARMACODE TWO-TRACKS - -4.5.042 (2009-04-15) - - Method Write() was fixed for the strings containing only zero value. - -4.5.041 (2009-04-14) - - Barcode methods were fixed. - -4.5.040 (2009-04-14) - - Method Write() was fixed to handle empty strings. - -4.5.039 (2009-04-11) - - Support for linear barcodes was extended (see example n. 27 and barcodes.php documentation). - -4.5.038 (2009-04-10) - - Write() method was improved to support separators for Japanese, Korean, Chinese Traditional and Chinese Simplified. - -4.5.037 (2009-04-09) - - General performances were improved. - - The signature of the method utf8Bidi() was changed. - - The method UniArrSubString() was added. - - Experimental support for 2D barcodes were added (see example n. 50 and 2dbarcodes.php class). - -4.5.036 (2009-04-03) - - TCPDF methods can be called inside the HTML code (see example n. 49). - - All tag attributes, such as <p align="center"> must be enclosed within double quotes. - -4.5.035 (2009-03-28) - - Bug #2717436 "writeHTML rowspan problem (continued)" was fixed. - - Bug #2719090 "writeHTML fix follow up" was fixed. - - The method _putuserrights() was changed to avoid Adobe Reader 9.1 crash. This broken the 'trick' that was used to display forms in Acrobat Reader. - -4.5.034 (2009-03-27) - - Bug #2716914 "Bug writeHTML of a table in body and footer related with pb" was fixed. - - Bug #2717056 ] "writeHTML problem when setting tr style" was fixed. - - The signature of the Cell() method was changed. - -4.5.033 (2009-03-27) - - The support for rowspan/colspan on HTML tables was improved (see example n. 48). - -4.5.032 (2009-03-23) - - setPrintFooter(false) bug was fixed. - -4.5.031 (2009-03-20) - - Table header support was extended to multiple pages. - -4.5.030 (2009-03-20) - - thead tag is now supported on HTML tables (header rows are repeated after page breaks). - - The startTransaction() was improved to autocommit. - - List bullets now uses the foreground color (putHtmlListBullet()). - -4.5.029 (2009-03-19) - - The following methods were added to UNDO commands (see example 47): startTransaction(), commitTransaction(), rollbackTransaction(). - - All examples were updated. - -4.5.028 (2009-03-18) - - Bug #2690945 "List Bugs" was fixed. - - HTML text alignment on lists was fixed. - - The constant PDF_FONT_MONOSPACED was added to the configuration file to define the default monospaced font. - - The following methods were fixed: getPageWidth(), getPageHeight(), getBreakMargin(). - - All examples were updated. - -4.5.027 (2009-03-16) - - Method getPageDimensions() was added to get page dimensions. - - The signature of the following methos were changed: getPageWidth(), getPageHeight(), getBreakMargin(). - - _parsepng() method was fixed for PNG URL images (fread bug). - -4.5.026 (2009-03-11) - - Bug #2681793 affecting URL images with spaces was fixed. - -4.5.025 (2009-03-10) - - A small bug affecting hyphenation support was fixed. - - The method SetDefaultMonospacedFont() was added to define the default monospaced font. - -4.5.024 (2009-03-07) - - The bug #2666493 was fixed "Footer corrupts document". - -4.5.023 (2009-03-06) - - The bug #2666688 was fixed "Rowspan in tables". - -4.5.022 (2009-03-05) - - The bug #2659676 was fixed "refer to #2157099 test 4 < BR > problem still not fixed". - - addTOC() function bug was fixed. - -4.5.020 (2009-03-03) - - The following bug was fixed: "function removeSHY corrupts unicode". - -4.5.019 (2009-02-28) - - The problem of decimal separator using different locale was fixed. - - The text hyphenation is now supported (see example n. 46). - -4.5.018 (2009-02-26) - - The _destroy() method was added to unset all class variables and frees memory. - - Now it's possible to call Output() method multiple times. - -4.5.017 (2009-02-24) - - A minor bug that raises a PHP warning was fixed. - -4.5.016 (2009-02-24) - - Bug item #2631200 "getNumLines() counts wrong" was fixed. - - Multiple attachments bug was fixed. - - All class variables are now cleared on Output() for memory otpimization. - -4.5.015 (2009-02-18) - - Bug item #2612553 "function Write() must not break a line on &nbsp; character" was fixed. - -4.5.014 (2009-02-13) - - Bug item #2595015 "POSTNET Barcode Checksum Error" was fixed (on barcode.php). - - Pagebreak bug for barcode was fixed. - -4.5.013 (2009-02-12) - - border attribute is now supported on HTML images (only accepts the same values accepted by Cell()). - -4.5.012 (2009-02-12) - - An error on image border feature was fixed. - -4.5.011 (2009-02-12) - - HTML links for images are now supported. - - height attribute is now supported on HTML cells. - - $border parameter was added to Image() and ImageEps() methods. - - The method getNumLines() was added to estimate the number of lines required for the specified text. - -4.5.010 (2009-01-29) - - Bug n. 2546108 "BarCode Y position" was fixed. - -4.5.009 (2009-01-26) - - Bug n. 2538094 "Empty pdf file created" was fixed. - -4.5.008 (2009-01-26) - - setPage() method was fixed to correctly restore graphic states. - - Source code was cleaned up for performances. - -4.5.007 (2009-01-24) - - checkPageBreak() and write1DBarcode() methods were fixed. - - Source code was cleaned up for performances. - - barcodes.php was updated. - -4.5.006 (2009-01-23) - - getHTMLUnitToPoints() method was replaced by getHTMLUnitToUnits() to fix HTML units bugs. - -4.5.005 (2009-01-23) - - Page closing bug was fixed. - -4.5.004 (2009-01-21) - - The access of convertHTMLColorToDec() method was changed to public - - Fixed bug on UL tag. - -4.5.003 (2009-01-19) - - Fonts on different folders are now supported. - -4.5.002 (2009-01-07) - - addTOC() function was improved (see example n. 45). - -4.5.001 (2009-01-04) - - The signature of startPageGroup() function was changed. - - Method Footer() was improved to automatically print page or page-group number (see example n. 23). - - Protected method formatTOCPageNumber() was added to customize the format of page numbers on the Table Of Content. - - The signature of addTOC() was changed to include the font used for page numbers. - -4.5.000 (2009-01-03) - - A new $diskcache parameter was added to class constructor to enable disk caching and reduce RAM memory usage (see example n. 43). - - The method movePageTo() was added to move pages to previous positions (see example n. 44). - - The methods getAliasNumPage() and getPageNumGroupAlias() were added to get the alias for page number (needed when using movepageTo()). - - The methods addTOC() was added to print a Table Of Content (see example n. 45). - - Imagick class constant was removed for better compatibility with PHP4. - - All existing examples were updated and new examples were added. - -4.4.009 (2008-12-29) - - Examples 1 and 35 were fixed. - -4.4.008 (2008-12-28) - - Bug #2472169 "Unordered bullet size not adjusted for unit type" was fixed. - -4.4.007 (2008-12-23) - - Bug #2459935 "no unit conversion for header line" was fixed. - - Example n. 42 for image alpha channel was added. - - All examples were updated. - -4.4.006 (2008-12-11) - - Method setLIsymbol() was changed to reflect latest changes in HTML list handling. - -4.4.005 (2008-12-10) - - Bug item #2413870 "ordered list override value" was fixed. - -4.4.004 (2008-12-10) - - The protected method getHTMLUnitToPoints() was added to accept various HTML units of measure (em, ex, px, in, cm, mm, pt, pc, %). - - The method intToRoman() was added to convert integer number to Roman representation. - - Support fot HTML lists was improved: the CSS property list-style-type is now supported. - -4.4.003 (2008-12-09) - - Bug item #2412147 "Warning on line 3367" was fixed. - - Method setHtmlLinksStyle() was added to set default HTML link colors and font style. - - Method addHtmlLink() was changed to use color and style defined on the inline CSS. - -4.4.002 (2008-12-09) - - Borders on Multicell() were fixed. - - Problem of Multicell() on Header function (Bug item #2407579) was fixed. - - Problem on graphics tranformations applied to Multicell() was fixed. - - Support for ImageMagick was added. - - Width calculation for nested tables was fixed. - -4.4.001 (2008-12-08) - - Some missing core fonts were added on fonts directory. - - CID0 fonts rendering was fixed. - - HTML support was improved (<pre> and <tt> tags are now supported). - - Bug item #2406022 "Left padding bug in MultiCell with maxh" was fixed. - -4.4.000 (2008-12-07) - - File attachments are now supported (see example n. 41). - - Font functions were optimized to reduce document size. - - makefont.php was updated. - - Linux binaries were added on /fonts/utils - - All fonts were updated. - - $autopadding parameter was added to Multicell() to disable automatic padding features. - - $maxh parameter was added to Multicell() and Write() to set a maximum height. - -4.3.009 (2008-12-05) - - Bug item #2392989 (Custom header + setlinewidth + cell border bug) was fixed. - -4.3.008 (2008-12-05) - - Bug item #2390566 "rect bug" was fixed. - - File path was fixed for font embedded files. - - SetFont() method signature was changed to include the font filename. - - Some font-related methods were improved. - - Methods getFontFamily() and getFontStyle() were added. - -4.3.007 (2008-12-03) - - PNG alpha channel is now supported (GD library is required). - - AddFont() function now support custom font file path on $file parameter. - - The default width variable ($dw) is now always defined for any font. - - The 'Style' attribute on CID-0 fonts was removed because of protection bug. - -4.3.006 (2008-12-01) - - A regular expression on getHtmlDomArray() to find HTML tags was fixed. - -4.3.005 (2008-11-25) - - makefont.php was fixed. - - Bug item #2339877 was fixed (false loop condition detected on WriteHTML()). - - Bug item #2336733 was fixed (lasth value update on Multicell() when border and fill are disabled). - - Bug item #2342303 was fixed (automatic page-break on Image() and ImageEPS()). - -4.3.004 (2008-11-19) - - Function _textstring() was fixed (bug 2309051). - - All examples were updated. - -4.3.003 (2008-11-18) - - CID-0 font bug was fixed. - - Some functions were optimized. - - Function getGroupPageNoFormatted() was added. - - Example n. 23 was updated. - -4.3.002 (2008-11-17) - - Bug item #2305518 "CID-0 font don't work with encryption" was fixed. - -4.3.001 (2008-11-17) - - Bug item #2300007 "download mimetype pdf" was fixed. - - Double quotes were replaced by single quotes to improve PHP performances. - - A bug relative to HTML cell borders was fixed. - -4.3.000 (2008-11-14) - - The function setOpenCell() was added to set the top/bottom cell sides to be open or closed when the cell cross the page. - - A bug relative to list items indentation was fixed. - - A bug relative to borders on HTML tables and Multicell was fixed. - - A bug relative to rowspanned cells was fixed. - - A bug relative to html images across pages was fixed. - -4.2.009 (2008-11-13) - - Spaces between li tags are now automatically removed. - -4.2.008 (2008-11-12) - - A bug relative to fill color on next page was fixed. - -4.2.007 (2008-11-12) - - The function setListIndentWidth() was added to set custom indentation widht for HTML lists. - -4.2.006 (2008-11-06) - - A bug relative to HTML justification was fixed. - -4.2.005 (2008-11-06) - - A bug relative to HTML justification was fixed. - - The methods formatPageNumber() and PageNoFormatted() were added to format page numbers. - - Default Footer() method was changed to use PageNoFormatted() instead of PageNo(). - - Example 6 was updated. - -4.2.004 (2008-11-04) - - Bug item n. 2217039 "filename handling improvement" was fixed. - -4.2.003 (2008-10-31) - - Font style bug was fixed. - -4.2.002 (2008-10-31) - - Bug item #2210922 (htm element br not work) was fixed. - - Write() function was improved to support margin changes. - -4.2.001 (2008-10-30) - - setHtmlVSpace($tagvs) function was added to set custom vertical spaces for HTML tags. - - writeHTML() function now support margin changes during execution. - - Signature of addHTMLVertSpace() function is changed. - -4.2.000 (2008-10-29) - - htmlcolors.php was changed to support class-loaders. - - ImageEps() function was improved in performances. - - Signature of Link() And Annotation() functions were changed. - - (Bug item #2198926) Links and Annotations alignment were fixed (support for geometric tranformations was added). - - rowspan mode for HTML table cells was improved and fixed. - - Booklet mode for double-sided pages was added; see SetBooklet() function and example n. 40. - - lastPage() signature is changed. - - Signature of Write() function is changed. - - Some HTML justification problems were fixed. - - Some functions were fixed to better support RTL mode. - - Example n. 10 was changed to support RTL mode. - - All examples were updated. - -4.1.004 (2008-10-23) - - unicode_data.php was changed to support class-loaders. - - Bug item #2186040/2 (writeHTML margin problem) was fixed. - -4.1.003 (2008-10-22) - - Bug item #2185399 was fixed (rowspan and page break). - - Bugs item #2186040 was fixed (writeHTML margin problem). - - Newline after table was removed. - -4.1.002 (2008-10-21) - - Bug item #2184525 was fixed (rowspan on HTML cell). - -4.1.001 (2008-10-21) - - Support for "start" attribute was added to HTML ordered list. - - unicode_data.php file was changed to include UTF-8 to ASCII table. - - Some functions were modified to better support UTF-8 extensions to core fonts. - - Support for images on HTML lists was improved. - - Examples n. 1 and 6 were updated. - -4.1.000 (2008-10-18) - - Page-break bug using HTML content was fixed. - - The "false" parameter was reintroduced to class_exists function on PHP5 version to avoid autoload. - - addHtmlLink() function was improved to support internal links (i.e.: <a href="#23">link to page 23</a>). - - Justification alignment is now supported on HTML (see example n. 39). - - example_006.php was updated. - -4.0.033 (2008-10-13) - - Bug n. 2157099 was fixed. - - SetX() and SetY() functions were improved. - - SetY() includes a new parameter to avoid the X reset. - -4.0.032 (2008-10-10) - - Bug n. 2156926 was fixed (bold, italic, underlined, linethrough). - - setStyle() method was removed. - - Configuration file was changed to use helvetica (non-unicode) font by default. - - The use of mixed font types was improved. - - All examples were updated. - -4.0.031 (2008-10-09) - - _putannots() and _putbookmarks() links alignments were fixed. - -4.0.030 (2008-10-07) - - _putbookmarks() function was fixed. - - _putannots() was fixed to include internal links. - -4.0.029 (2008-09-27) - - Infinite loop bug was fixed [Bug item #130309]. - - Multicell() problem on Header() was fixed. - -4.0.028 (2008-09-26) - - setLIsymbol() was added to set the LI symbol used on UL lists. - - Missing $padding and $encryption_key variables declarations were added [Bug item #2129058]. - -4.0.027 (2008-09-19) - - Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed. - - arailunicid0.php font was updated. - - The problem of javascript form fields duplication after saving was fixed. - -4.0.026 (2008-09-17) - - convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation. - - The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large - - Example n. 6 was updated. - -4.0.025 (2008-09-15) - - _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding. - - arialunicid0 font was added (see the new example n. 38). - - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php. - -4.0.024 (2008-09-12) - - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4. - - support for Spot Colors were added. Check the new example n. 37 and the following new functions: - AddSpotColor() - SetDrawSpotColor() - SetFillSpotColor() - SetTextSpotColor() - _putspotcolors() - - Bookmark() function was improved to fix wrong levels. - - $lasth changes after header/footer calls were fixed. - -4.0.023 (2008-09-05) - - Some HTML related problems were fixed. - - Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php). - -4.0.022 (2008-08-28) - - Line height on HTML was fixed. - - Image inside an HTML cell problem was fixed. - - A new "zarbold" persian font was added. - -4.0.021 (2008-08-24) - - HTTP headers were fixed on Output function(). - - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents. - - Function Write() was fixed. - - The problem of additional vertical spaces on HTML was fixed. - - The problem of frame around HTML links was fixed. - -4.0.020 (2008-08-15) - - "[2052259] WriteHTML <u> & <b>" bug was fixed. - -4.0.019 (2008-08-13) - - "Rowspan on first cell" bug was fixed. - -4.0.018 (2008-08-08) - - Default cellpadding for HTML tables was fixed. - - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7). - - HTML links are now correclty shifted during line alignments. - - function getAliasNbPages() was added and Footer() was updated. - - RowSpan mode for HTML tables was fixed. - - Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed. - - ImageEPS() function was improved and RTL alignment was fixed (see example_032.php). - -4.0.017 (2008-08-05) - - Missing CNZ and CEO style modes were added to Rect() function. - - Fonts utils were updated to include support for OpenType fonts. - - getLastH() function was added. - -4.0.016 (2008-07-30) - - setPageMark() function was added. This function must be called after calling Image() function for a background image. - -4.0.015 (2008-07-29) - - Some functions were changed to support different page formats (see example_028.php). - - The signature of setPage() function is changed. - -4.0.014 (2008-07-29) - - K_PATH_MAIN calculation on tcpdf_config.php was fixed. - - HTML support for EPS/AI images was added (see example_006.php). - - Bugs item #2030807 "Truncated text on multipage html fields" was fixed. - - PDF header bug was fixed. - - helvetica was added as default font family. - - Stroke mode was fixed on Text function. - - several minor bugs were fixed. - -4.0.013 (2008-07-27) - - Bugs item #2027799 " Big spaces between lines after page break" was fixed. - - K_PATH_MAIN calculation on tcpdf_config.php was changed. - - Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message. - -4.0.012 (2008-07-24) - - Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions. - - The following functions were added: - setHeader() - setFooter() - getImageRBX() - getImageRBY() - getCellHeightRatio() - getHeaderFont() - getFooterFont() - getRTL() - getBarcode() - getHeaderData() - getHeaderMargin() - getFooterMargin() - -4.0.011 (2008-07-23) - - Font support was improved. - - The folder /fonts/utils contains new utilities and instructions for embedd font files. - - Documentation was updated. - -4.0.010 (2008-07-22) - - HTML tables were fixed to work across pages. - - Header() and Footer() functions were updated to preserve previous settings. - - example_035.php was added. - -4.0.009 (2008-07-21) - - UTF8StringToArray() function was fixed for non-unicode mode. - -4.0.008 (2008-07-21) - - Barcodes alignment was fixed (see example_027.php). - - unicode_data.php was updated. - - Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed. - -4.0.007 (2008-07-18) - - str_split was replaced by preg_split for compatibility with PHP4 version. - - Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php). - -4.0.006 (2008-07-16) - - HTML rowspan bug was fixed. - - Line style for MultiCell() was fixed. - - WriteHTML() function was improved. - - CODE128C barcode was fixed (barcodes.php). - -4.0.005 (2008-07-11) - - Bug [2015715] "PHP Error/Warning" was fixed. - -4.0.004 (2008-07-09) - - HTML cell internal padding was fixed. - -4.0.003 (2008-07-08) - - Removed URL encoding when F option is selected on Output() function. - - fixed some minor bugs in html tables. - -4.0.002 (2008-07-07) - - Bug [2000861] was still unfixed and has been fixed. - -4.0.001 (2008-07-05) - - Bug [2000861] was fixed. - -4.0.000 (2008-07-03) - - THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES - - Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed). - - HTML support was completely rewritten and improved (see example 6). - - Alignments parameters were fixed. - - Functions GetArrStringWidth() and GetStringWidth() now include font parameters. - - Fonts support was improved. - - All core fonts were replaced and moved to fonts/ directory. - - The following functions were added: getMargins(), getFontSize(), getFontSizePt(). - - File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated. - - Multicell and WriteHTMLCell fill function was fixed. - - Several minor bugs were fixed. - - barcodes.php was updated. - - All examples were updated. - ------------------------------------------------------------- - -3.1.001 (2008-06-13) - - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed. - - Vera font was removed, DejaVu font and Free fonts were updated. - - Image handling was improved. - - All examples were updated. - -3.1.000 (2008-06-11) - - setPDFVersion() was added to change the default PDF version (currently 1.7). - - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29). - - SetDisplayMode() signature was changed (new options were added). - - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30). - - PieSector() function was added to render render pie charts (see example 31). - - ImageEps() was added to display EPS and AI images with limited support (see example 32). - - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added. - - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions. - - HTML lists were improved and could be nested (you may now represent trees). - - AddFont() bug was fixed. - - _putfonts() bug was fixed. - - graphics functions were fixed. - - unicode_data.php file was updated (fixed). - - almohanad font was updated. - - example 18 was updated (Farsi and Arabic languages). - - source code cleanup. - - All examples were updated and new examples were added. - -3.0.015 (2008-06-06) - - AddPage() function signature is changed to include page format. - - example 28 was added to show page format changes. - - setPageUnit() function was added to change the page units of measure. - - setPageFormat() function was added to change the page format and orientation between pages. - - setPageOrientation() function was added to change the page orientation. - - Arabic font shaping was fixed for laa letter and square boxes (see the example 18). - -3.0.014 (2008-06-04) - - Arabic font shaping was fixed. - - setDefaultTableColumns() function was added. - - $cell_height_ratio variable was added. - - setCellHeightRatio() function was added to define the default height of cell repect font height. - -3.0.013 (2008-06-03) - - Multicell height parameter was fixed. - - Arabic font shaping was improved. - - unicode_data.php was updated. - -3.0.012 (2008-05-30) - - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file. - - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated). - - Arabic font shaping was improved. - - TranslateY() function was fixed (bug [1977962]). - - setVisibility() function was fixed. - - writeBarcode() function was fixed to scale using $xref parameter. - - All examples were updated. - -3.0.011 (2008-05-23) - - CMYK color support was added to all graphic functions. - - HTML table support was improved: - -- now it's possible to include additional html tags inside a cell; - -- colspan attribute was added. - - example 006 was updated. - -3.0.010 (2008-05-21) - - fixed $laa_array inclusion on utf8Bidi() function. - -3.0.009 (2008-05-20) - - unicode_data.php was updated. - - Arabic laa letter problem was fixed. - -3.0.008 (2008-05-12) - - Arabic support was fixed and improved (unicode_data.php was updated). - - Polycurve() function was added to draw a poly-Bezier curve. - - list items alignment was fixed. - - example 6 was updated. - -3.0.007 (2008-05-06) - - Arabic support was fixed and improved. - - AlMohanad (arabic) font was added. - - C128 barcode bugs were fixed. - -3.0.006 (2008-04-21) - - Condition to check negative width values was added. - -3.0.005 (2008-04-18) - - back-Slash character escape was fixed on writeHTML() function. - - Exampe 6 was updated. - -3.0.004 (2008-04-11) - - Bug [1939304] (Right to Left Issue) was fixed. - -3.0.003 (2008-04-07) - - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed. - - "face" attribute of "font" tag is now fully supported. - -3.0.002 (2008-04-01) - - Write() functions now return the number of cells and not the number of lines. - - TCPDF is released under LGPL 2.1, or any later version. - -3.0.001 (2008-05-28) - - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng(). - - function writeBarcode() was fixed. - - all examples were updated. - - example 27 was added to show various barcodes. - -3.0.000 (2008-03-27) - - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug. - - Image-related functions were rewritten. - - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9). - - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM. - - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22). - - Page Groups were added (see example 23). - - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24). - - All private variables and functions were changed to protected. - - setAlpha() function was added to give transparency support for all objects (see example 25). - - Clipping and stroke modes were added to Text() function (see example 26). - - All examples were moved to "examples" directory. - - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9). - -2.9.000 (2008-03-26) - - htmlcolors.php file was added to include html colors. - - Support for HTML color names and three-digit hexadecimal color codes was added. - - private function convertColorHexToDec() was renamed convertHTMLColorToDec(). - - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported). - - Write() function were fixed. - - example_006.php was updated. - - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14) - -2.8.000 (2008-03-20) - - Private variables were changed to protected. - - Function Write() was fixed and improved. - - Support for dl, dt, dd, del HTML tags was introduced. - - Line-trought mode was added for HTML and text. - - Text vertical alignment on cells were fixed. - - Examples were updated to reflect changes. - -2.7.002 (2008-03-13) - - Bug "[1912142] Encrypted PDF created/modified date" was fixed. - -2.7.001 (2008-03-10) - - Cell justification was fixed for non-unicode mode. - -2.7.000 (2008-03-09) - - Cell() stretching mode 4 (forced character spacing) was fixed. - - writeHTMLCell() now uses Multicell() to write. - - Multicell() has a new parameter $ishtml to act as writeHTMLCell(). - - Write() speed was improved for non-arabic strings. - - Example n. 20 was changed. - -2.6.000 (2008-03-07) - - various alignments bugs were fixed. - -2.5.000 (2008-03-07) - - Several bugs were fixed. - - example_019.php was added to test non-unicode mode using old fonts. - -2.4.000 (2008-03-06) - - RTL support was deeply improved. - - GetStringWidth() was fixed to support RTL languages. - - Text() RTL alignment was fixed. - - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi(). - - example_018.php was added and test_unicode.php was removed. - -2.3.000 (2008-03-05) - - MultiCell() signature is changed. Now support multiple columns across pages (see example_017). - - Write() signature is changed. Now support the cell mode to be used with MultiCell. - - Header() and Footer() were changed. - - The following functions were added: UTF8ArrSubString() and unichr(). - - Examples were updated to reflect last changes. - -2.2.004 (2008-03-04) - - Several examples were added. - - AddPage() Header() and Footer() were fixed. - - Documentation is now available on http://www.tcpdf.org - -2.2.003 (2008-03-03) - - [1894853] Performance of MultiCell() was improved. - - RadioButton and ListBox functions were added. - - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf. - -2.2.002 (2008-02-28) - - [1900495] html images path was fixed. - - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library. - -2.2.001 (2008-02-16) - - The bug "[1894700] bug with replace relative path" was fixed - - Justification was fixed - -2.2.000 (2008-02-12) - - fixed javascript bug introduced with latest release - -2.1.002 (2008-02-12) - - Justify function was fixed on PHP4 version. - - Bookmank function was added ([1578250] Table of contents). - - Javascript and Form fields support was added ([1796359] Form fields). - -2.1.001 (2008-02-10) - - The bug "[1885776] Race Condition in function justitfy" was fixed. - - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed. - -2.1.000 (2008-01-07) - - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file - - Bidirectional Algorithm to correctly reverse bidirectional languages was added. - - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed. - - SetCellPadding function was added. - - writeHTML was updated with new parameters. - - Text function was fixed. - - MultiCell function was fixed, now works also across multiple pages. - - Line width was fixed on Header and Footer functions and <hr> tag. - - "GetImageSize" was renamed "getimagesize". - - Document version was changed from 1.3 to 1.5. - - _begindoc() function was fixed. - - ChangeDate was fixed and ModDate was added. - - The following functions were added: - setPage() : Move pointer to the specified document page. - getPage() : Get current document page number. - lastpage() : Reset pointer to the last document page. - getNumPages() : Get the total number of inserted pages. - GetNumChars() : count the number of (UTF-8) characters in a string. - - $stretch parameter was added to Cell() function to fit text on cell: - 0 = disabled - 1 = horizontal scaling only if necessary - 2 = forced horizontal scaling - 3 = character spacing only if necessary - 4 = forced character spacing - - Line function was fixed for RTL. - - Graphic transformation functions were added [1811158]: - StartTransform() - StopTransform() - ScaleX() - ScaleY() - ScaleXY() - Scale() - MirrorH() - MirrorV() - MirrorP() - MirrorL() - TranslateX() - TranslateY() - Translate() - Rotate() - SkewX() - SkewY() - Skew() - - Graphic function were added/updated [1688549]: - SetLineStyle() - _outPoint() - _outLine() - _outRect() - _outCurve() - Line() - Rect() - Curve - Ellipse - Circle - Polygon - RegularPolygon - -2.0.000 (2008-01-04) - - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files. - - setRTL($enable) method was added to manually enable/disable the RTL text direction. - - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left. - - RC4 40bit encryption was added. Check the SetProtection method. - - [1815213] Improved image support for GIF, JPEG, PNG formats. - - [1800094] Attribute "value" was added to ordered list items <li>. - - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be: - T: top-right for LTR or top-left for RTL - M: middle-right for LTR or middle-left for RTL - B: bottom-right for LTR or bottom-left for RTL - N: next line - - Attribute "align" was added to <img> html tag to set the above image "align" parameter. Possible values are: - top: top-right for LTR or top-left for RTL - middle: middle-right for LTR or middle-left for RTL - bottom: bottom-right for LTR or bottom-left for RTL - - [1798103] newline was added after </ul>, </ol> and </p> tages. - - [1816393] Documentation was updated. - - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages; - - The method lastPage() was added to move the pointer on the last page; - ------------------------------------------------------------- - -1.53.0.TC034 (2007-07-30) - - fixed htmlentities conversion. - - MultiCell() function returns the number of cells. - -1.53.0.TC033 (2007-07-30) - - fixed bug 1762550: case sensitive for font files - - NOTE: all fonts files names must be in lowercase! - -1.53.0.TC032 (2007-07-27) - - setLastH method was added to resolve bug 1689071. - - all fonts names were converted in lowercase (bug 1713005). - - bug 1740954 was fixed. - - justification was added as Cell option. - -1.53.0.TC031 (2007-03-20) - - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text. - -1.53.0.TC030 (2007-03-06) - - fixed bug on PHP4 version. - -1.53.0.TC029 (2007-03-06) - - DejaVu Fonts were added. - -1.53.0.TC028 (2007-03-03) - - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information. - - Greek language were added on example sentences. - - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer. - -1.53.0.TC027 (2006-12-14) - - $attr['face'] bug were fixed. - - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files. - -1.53.0.TC026 (2006-10-28) - - writeHTML function call were fixed on examples. - -1.53.0.TC025 (2006-10-27) - - Bugs item #1421290 were fixed (0D - 0A substitution in some characters) - - Bugs item #1573174 were fixed (MultiCell documentation) - -1.53.0.TC024 (2006-09-26) - - getPageHeight() function were fixed (bug 1543476). - - fixed missing breaks on closedHTMLTagHandler function (bug 1535263). - - fixed extra spaces on Write function (bug 1535262). - -1.53.0.TC023 (2006-08-04) - - paths to barcode directory were fixed. - - documentation were updated. - -1.53.0.TC022 (2006-07-16) - - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists() - -1.53.0.TC021 (2006-07-01) - - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support) - -1.53.0.TC020 (2006-06-23) - - code cleanup - -1.53.0.TC019 (2006-05-21) - - fixed <strong> and <em> closing tags - -1.53.0.TC018 (2006-05-18) - - fixed font names bug - -1.53.0.TC017 (2006-05-18) - - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder. - - new free unicode fonts were included on /fonts/freefont. - - test_unicode.php example were exended. - - parameter $fill were added on Write, writeHTML and writeHTMLCell functions. - - documentation were updated. - -1.53.0.TC016 (2006-03-09) - - fixed closing <strong> tag on html parser. - -1.53.0.TC016 (2005-08-28) - - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class). - - fixed problem when mb_internal_encoding is set. - -1.53.0.TC014 (2005-05-29) - - fixed WriteHTMLCell new page issue. - -1.53.0.TC013 (2005-05-29) - - fixed WriteHTMLCell across pages. - -1.53.0.TC012 (2005-05-29) - - font color attribute bug were fixed. - -1.53.0.TC011 (2005-03-31) - - SetFont function were fixed (thank Sjaak Lauwers for bug notice). - -1.53.0.TC010 (2005-03-22) - - the html functions were improved (thanks to Manfred Vervuert for bug reporting). - -1.53.0.TC009 (2005-03-19) - - a wrong reference to convertColorHexToDec were fixed. - -1.53.0.TC008 (2005-02-07) - - removed some extra bytes from PHP files. - -1.53.0.TC007 (2005-01-08) - - fill attribute were removed from writeHTMLCell method. - -1.53.0.TC006 (2005-01-08) - - the documentation were updated. - -1.53.0.TC005 (2005-01-05) - - Steven Wittens's unicode methods were removed. - - All unicode methods were rewritten from scratch. - - TCPDF is now licensed as LGPL. - -1.53.0.TC004 (2005-01-04) - - this changelog were added. - - removed commercial fonts for licensing issue. - - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html). - - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist. - -EOF -------------------------------------------------------- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/LICENSE.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/LICENSE.TXT deleted file mode 100644 index daf21f7d3e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/LICENSE.TXT +++ /dev/null @@ -1,858 +0,0 @@ -********************************************************************** -* TCPDF LICENSE -********************************************************************** - - TCPDF is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - -********************************************************************** -********************************************************************** - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - -********************************************************************** -********************************************************************** - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. - -********************************************************************** -********************************************************************** diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/README.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/README.TXT deleted file mode 100644 index 65dd26cc1f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/README.TXT +++ /dev/null @@ -1,86 +0,0 @@ -TCPDF - README -============================================================ - -I WISH TO IMPROVE AND EXPAND TCPDF BUT I NEED YOUR SUPPORT. -PLEASE MAKE A DONATION: -http://sourceforge.net/donate/index.php?group_id=128076 - ------------------------------------------------------------- - -Name: TCPDF -Version: 5.9.009 -Release date: 2010-10-21 -Author: Nicola Asuni - -Copyright (c) 2002-2010: - Nicola Asuni - Tecnick.com s.r.l. - Via Della Pace, 11 - 09044 Quartucciu (CA) - ITALY - www.tecnick.com - -URLs: - http: www.tcpdf.org - http: www.sourceforge.net/projects/tcpdf - -Description: - TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. - -Main Features: - * no external libraries are required for the basic functions; - * all standard page formats, custom page formats, custom margins and units of measure; - * UTF-8 Unicode and Right-To-Left languages; - * TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; - * font subsetting; - * methods to publish some XHTML + CSS code, Javascript and Forms; - * images, graphic (geometric figures) and transformation methods; - * supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http: www.imagemagick.org/www/formats.html) - * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417; - * Grayscale, RGB, CMYK, Spot Colors and Transparencies; - * automatic page header and footer management; - * document encryption up to 256 bit and digital signature certifications; - * transactions to UNDO commands; - * PDF annotations, including links, text and file attachments; - * text rendering modes (fill, stroke and clipping); - * multiple columns mode; - * no-write page regions; - * bookmarks and table of content; - * text hyphenation; - * text stretching and spacing (tracking/kerning); - * automatic page break, line break and text alignments including justification; - * automatic page numbering and page groups; - * move and delete pages; - * page compression (requires php-zlib extension); - * XOBject Templates; - -Installation (full instructions on http: www.tcpdf.org): - 1. copy the folder on your Web server - 2. set your installation path and other parameters on the config/tcpdf_config.php - 3. call the examples/example_001.php page with your browser to see an example - -Source Code Documentation: - doc/index.html - -For Additional Documentation: - http: www.tcpdf.org - -License - Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. - - TCPDF is free software: you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - TCPDF is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with TCPDF. If not, see <http://www.gnu.org/licenses/>. - - See LICENSE.TXT file for more information. - -============================================================ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/barcodes.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/barcodes.php deleted file mode 100644 index 4efb7a47cc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/barcodes.php +++ /dev/null @@ -1,1969 +0,0 @@ -<?php -//============================================================+ -// File name : barcodes.php -// Version : 1.0.011 -// Begin : 2008-06-09 -// Last Update : 2010-08-08 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2008-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : PHP class to creates array representations for -// common 1D barcodes to be used with TCPDF. -// -//============================================================+ - -/** - * PHP class to creates array representations for common 1D barcodes to be used with TCPDF. - * @package com.tecnick.tcpdf - * @abstract Functions for generating string representation of common 1D barcodes. - * @author Nicola Asuni - * @copyright 2008-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.011 - */ - - /** - * PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> - * @name TCPDFBarcode - * @package com.tecnick.tcpdf - * @version 1.0.011 - * @author Nicola Asuni - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - */ -class TCPDFBarcode { - - /** - * @var array representation of barcode. - * @access protected - */ - protected $barcode_array; - - /** - * This is the class constructor. - * Return an array representations for common 1D barcodes:<ul> - * <li>$arrcode['code'] code to be printed on text label</li> - * <li>$arrcode['maxh'] max bar height</li> - * <li>$arrcode['maxw'] max bar width</li> - * <li>$arrcode['bcode'][$k] single bar or space in $k position</li> - * <li>$arrcode['bcode'][$k]['t'] bar type: true = bar, false = space.</li> - * <li>$arrcode['bcode'][$k]['w'] bar width in units.</li> - * <li>$arrcode['bcode'][$k]['h'] bar height in units.</li> - * <li>$arrcode['bcode'][$k]['p'] bar top position (0 = top, 1 = middle)</li></ul> - * @param string $code code to print - * @param string $type type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul> - */ - public function __construct($code, $type) { - $this->setBarcode($code, $type); - } - - /** - * Return an array representations of barcode. - * @return array - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Set the barcode. - * @param string $code code to print - * @param string $type type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul> - * @return array - */ - public function setBarcode($code, $type) { - switch (strtoupper($type)) { - case 'C39': { // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. - $arrcode = $this->barcode_code39($code, false, false); - break; - } - case 'C39+': { // CODE 39 with checksum - $arrcode = $this->barcode_code39($code, false, true); - break; - } - case 'C39E': { // CODE 39 EXTENDED - $arrcode = $this->barcode_code39($code, true, false); - break; - } - case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM - $arrcode = $this->barcode_code39($code, true, true); - break; - } - case 'C93': { // CODE 93 - USS-93 - $arrcode = $this->barcode_code93($code); - break; - } - case 'S25': { // Standard 2 of 5 - $arrcode = $this->barcode_s25($code, false); - break; - } - case 'S25+': { // Standard 2 of 5 + CHECKSUM - $arrcode = $this->barcode_s25($code, true); - break; - } - case 'I25': { // Interleaved 2 of 5 - $arrcode = $this->barcode_i25($code, false); - break; - } - case 'I25+': { // Interleaved 2 of 5 + CHECKSUM - $arrcode = $this->barcode_i25($code, true); - break; - } - case 'C128A': { // CODE 128 A - $arrcode = $this->barcode_c128($code, 'A'); - break; - } - case 'C128B': { // CODE 128 B - $arrcode = $this->barcode_c128($code, 'B'); - break; - } - case 'C128C': { // CODE 128 C - $arrcode = $this->barcode_c128($code, 'C'); - break; - } - case 'EAN2': { // 2-Digits UPC-Based Extention - $arrcode = $this->barcode_eanext($code, 2); - break; - } - case 'EAN5': { // 5-Digits UPC-Based Extention - $arrcode = $this->barcode_eanext($code, 5); - break; - } - case 'EAN8': { // EAN 8 - $arrcode = $this->barcode_eanupc($code, 8); - break; - } - case 'EAN13': { // EAN 13 - $arrcode = $this->barcode_eanupc($code, 13); - break; - } - case 'UPCA': { // UPC-A - $arrcode = $this->barcode_eanupc($code, 12); - break; - } - case 'UPCE': { // UPC-E - $arrcode = $this->barcode_eanupc($code, 6); - break; - } - case 'MSI': { // MSI (Variation of Plessey code) - $arrcode = $this->barcode_msi($code, false); - break; - } - case 'MSI+': { // MSI + CHECKSUM (modulo 11) - $arrcode = $this->barcode_msi($code, true); - break; - } - case 'POSTNET': { // POSTNET - $arrcode = $this->barcode_postnet($code, false); - break; - } - case 'PLANET': { // PLANET - $arrcode = $this->barcode_postnet($code, true); - break; - } - case 'RMS4CC': { // RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - $arrcode = $this->barcode_rms4cc($code, false); - break; - } - case 'KIX': { // KIX (Klant index - Customer index) - $arrcode = $this->barcode_rms4cc($code, true); - break; - } - case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 - $arrcode = $this->barcode_imb($code); - break; - } - case 'CODABAR': { // CODABAR - $arrcode = $this->barcode_codabar($code); - break; - } - case 'CODE11': { // CODE 11 - $arrcode = $this->barcode_code11($code); - break; - } - case 'PHARMA': { // PHARMACODE - $arrcode = $this->barcode_pharmacode($code); - break; - } - case 'PHARMA2T': { // PHARMACODE TWO-TRACKS - $arrcode = $this->barcode_pharmacode2t($code); - break; - } - default: { - $this->barcode_array = false; - $arrcode = false; - break; - } - } - $this->barcode_array = $arrcode; - } - - /** - * CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. - * General-purpose code in very wide use world-wide - * @param string $code code to represent. - * @param boolean $checksum if true add a checksum to the code - * @return array barcode representation. - * @access protected - */ - protected function barcode_code39($code, $extended=false, $checksum=false) { - $chr['0'] = '111221211'; - $chr['1'] = '211211112'; - $chr['2'] = '112211112'; - $chr['3'] = '212211111'; - $chr['4'] = '111221112'; - $chr['5'] = '211221111'; - $chr['6'] = '112221111'; - $chr['7'] = '111211212'; - $chr['8'] = '211211211'; - $chr['9'] = '112211211'; - $chr['A'] = '211112112'; - $chr['B'] = '112112112'; - $chr['C'] = '212112111'; - $chr['D'] = '111122112'; - $chr['E'] = '211122111'; - $chr['F'] = '112122111'; - $chr['G'] = '111112212'; - $chr['H'] = '211112211'; - $chr['I'] = '112112211'; - $chr['J'] = '111122211'; - $chr['K'] = '211111122'; - $chr['L'] = '112111122'; - $chr['M'] = '212111121'; - $chr['N'] = '111121122'; - $chr['O'] = '211121121'; - $chr['P'] = '112121121'; - $chr['Q'] = '111111222'; - $chr['R'] = '211111221'; - $chr['S'] = '112111221'; - $chr['T'] = '111121221'; - $chr['U'] = '221111112'; - $chr['V'] = '122111112'; - $chr['W'] = '222111111'; - $chr['X'] = '121121112'; - $chr['Y'] = '221121111'; - $chr['Z'] = '122121111'; - $chr['-'] = '121111212'; - $chr['.'] = '221111211'; - $chr[' '] = '122111211'; - $chr['$'] = '121212111'; - $chr['/'] = '121211121'; - $chr['+'] = '121112121'; - $chr['%'] = '111212121'; - $chr['*'] = '121121211'; - - $code = strtoupper($code); - if ($extended) { - // extended mode - $code = $this->encode_code39_ext($code); - } - if ($code === false) { - return false; - } - if ($checksum) { - // checksum - $code .= $this->checksum_code39($code); - } - // add start and stop codes - $code = '*'.$code.'*'; - - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $char = $code{$i}; - if(!isset($chr[$char])) { - // invalid character - return false; - } - for ($j = 0; $j < 9; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $chr[$char]{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - $bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0); - $bararray['maxw'] += 1; - ++$k; - } - return $bararray; - } - - /** - * Encode a string to be used for CODE 39 Extended mode. - * @param string $code code to represent. - * @return encoded string. - * @access protected - */ - protected function encode_code39_ext($code) { - $encode = array( - chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', - chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', - chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K', - chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', - chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', - chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', - chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', - chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', - chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', - chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', - chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', - chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', - chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', - chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', - chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', - chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', - chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', - chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', - chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', - chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', - chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', - chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', - chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', - chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', - chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', - chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', - chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', - chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', - chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', - chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', - chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', - chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); - $code_ext = ''; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - if (ord($code{$i}) > 127) { - return false; - } - $code_ext .= $encode[$code{$i}]; - } - return $code_ext; - } - - /** - * Calculate CODE 39 checksum (modulo 43). - * @param string $code code to represent. - * @return char checksum. - * @access protected - */ - protected function checksum_code39($code) { - $chars = array( - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); - $sum = 0; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - $k = array_keys($chars, $code{$i}); - $sum += $k[0]; - } - $j = ($sum % 43); - return $chars[$j]; - } - - /** - * CODE 93 - USS-93 - * Compact code similar to Code 39 - * @param string $code code to represent. - * @param boolean $checksum if true add a checksum to the code - * @return array barcode representation. - * @access protected - */ - protected function barcode_code93($code) { - $chr['0'] = '131112'; - $chr['1'] = '111213'; - $chr['2'] = '111312'; - $chr['3'] = '111411'; - $chr['4'] = '121113'; - $chr['5'] = '121212'; - $chr['6'] = '121311'; - $chr['7'] = '111114'; - $chr['8'] = '131211'; - $chr['9'] = '141111'; - $chr['A'] = '211113'; - $chr['B'] = '211212'; - $chr['C'] = '211311'; - $chr['D'] = '221112'; - $chr['E'] = '221211'; - $chr['F'] = '231111'; - $chr['G'] = '112113'; - $chr['H'] = '112212'; - $chr['I'] = '112311'; - $chr['J'] = '122112'; - $chr['K'] = '132111'; - $chr['L'] = '111123'; - $chr['M'] = '111222'; - $chr['N'] = '111321'; - $chr['O'] = '121122'; - $chr['P'] = '131121'; - $chr['Q'] = '212112'; - $chr['R'] = '212211'; - $chr['S'] = '211122'; - $chr['T'] = '211221'; - $chr['U'] = '221121'; - $chr['V'] = '222111'; - $chr['W'] = '112122'; - $chr['X'] = '112221'; - $chr['Y'] = '122121'; - $chr['Z'] = '123111'; - $chr['-'] = '121131'; - $chr['.'] = '311112'; - $chr[' '] = '311211'; - $chr['$'] = '321111'; - $chr['/'] = '112131'; - $chr['+'] = '113121'; - $chr['%'] = '211131'; - $chr[128] = '121221'; // ($) - $chr[129] = '311121'; // (/) - $chr[130] = '122211'; // (+) - $chr[131] = '312111'; // (%) - $chr['*'] = '111141'; - $code = strtoupper($code); - $encode = array( - chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C', - chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G', - chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '£K', - chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O', - chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S', - chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W', - chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A', - chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E', - chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C', - chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G', - chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K', - chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O', - chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', - chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', - chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F', - chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J', - chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', - chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', - chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', - chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', - chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', - chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', - chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K', - chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O', - chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C', - chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G', - chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K', - chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O', - chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S', - chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W', - chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P', - chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T'); - $code_ext = ''; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - if (ord($code{$i}) > 127) { - return false; - } - $code_ext .= $encode[$code{$i}]; - } - // checksum - $code .= $this->checksum_code93($code); - // add start and stop codes - $code = '*'.$code.'*'; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $char = $code{$i}; - if(!isset($chr[$char])) { - // invalid character - return false; - } - for ($j = 0; $j < 6; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $chr[$char]{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - $bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0); - $bararray['maxw'] += 1; - ++$k; - return $bararray; - } - - /** - * Calculate CODE 93 checksum (modulo 47). - * @param string $code code to represent. - * @return string checksum code. - * @access protected - */ - protected function checksum_code93($code) { - $chars = array( - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); - // translate special characters - $code = strtr($code, chr(128).chr(129).chr(130).chr(131), '$/+%'); - $len = strlen($code); - // calculate check digit C - $p = 1; - $check = 0; - for ($i = ($len - 1); $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); - $check += ($k[0] * $p); - ++$p; - if ($p > 20) { - $p = 1; - } - } - $check %= 47; - $c = $chars[$check]; - $code .= $c; - // calculate check digit K - $p = 1; - $check = 0; - for ($i = $len; $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); - $check += ($k[0] * $p); - ++$p; - if ($p > 15) { - $p = 1; - } - } - $check %= 47; - $k = $chars[$check]; - return $c.$k; - } - - /** - * Checksum for standard 2 of 5 barcodes. - * @param string $code code to process. - * @return int checksum. - * @access protected - */ - protected function checksum_s25($code) { - $len = strlen($code); - $sum = 0; - for ($i = 0; $i < $len; $i+=2) { - $sum += $code{$i}; - } - $sum *= 3; - for ($i = 1; $i < $len; $i+=2) { - $sum += ($code{$i}); - } - $r = $sum % 10; - if($r > 0) { - $r = (10 - $r); - } - return $r; - } - - /** - * MSI. - * Variation of Plessey code, with similar applications - * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param string $code code to represent. - * @param boolean $checksum if true add a checksum to the code (modulo 11) - * @return array barcode representation. - * @access protected - */ - protected function barcode_msi($code, $checksum=false) { - $chr['0'] = '100100100100'; - $chr['1'] = '100100100110'; - $chr['2'] = '100100110100'; - $chr['3'] = '100100110110'; - $chr['4'] = '100110100100'; - $chr['5'] = '100110100110'; - $chr['6'] = '100110110100'; - $chr['7'] = '100110110110'; - $chr['8'] = '110100100100'; - $chr['9'] = '110100100110'; - $chr['A'] = '110100110100'; - $chr['B'] = '110100110110'; - $chr['C'] = '110110100100'; - $chr['D'] = '110110100110'; - $chr['E'] = '110110110100'; - $chr['F'] = '110110110110'; - if ($checksum) { - // add checksum - $clen = strlen($code); - $p = 2; - $check = 0; - for ($i = ($clen - 1); $i >= 0; --$i) { - $check += (hexdec($code{$i}) * $p); - ++$p; - if ($p > 7) { - $p = 2; - } - } - $check %= 11; - if ($check > 0) { - $check = 11 - $check; - } - $code .= $check; - } - $seq = '110'; // left guard - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $digit = $code{$i}; - if (!isset($chr[$digit])) { - // invalid character - return false; - } - $seq .= $chr[$digit]; - } - $seq .= '1001'; // right guard - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * Standard 2 of 5 barcodes. - * Used in airline ticket marking, photofinishing - * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param string $code code to represent. - * @param boolean $checksum if true add a checksum to the code - * @return array barcode representation. - * @access protected - */ - protected function barcode_s25($code, $checksum=false) { - $chr['0'] = '10101110111010'; - $chr['1'] = '11101010101110'; - $chr['2'] = '10111010101110'; - $chr['3'] = '11101110101010'; - $chr['4'] = '10101110101110'; - $chr['5'] = '11101011101010'; - $chr['6'] = '10111011101010'; - $chr['7'] = '10101011101110'; - $chr['8'] = '10101110111010'; - $chr['9'] = '10111010111010'; - if ($checksum) { - // add checksum - $code .= $this->checksum_s25($code); - } - if((strlen($code) % 2) != 0) { - // add leading zero if code-length is odd - $code = '0'.$code; - } - $seq = '11011010'; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $digit = $code{$i}; - if (!isset($chr[$digit])) { - // invalid character - return false; - } - $seq .= $chr[$digit]; - } - $seq .= '1101011'; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * Convert binary barcode sequence to TCPDF barcode array - * @param string $seq barcode as binary sequence - * òparam array $bararray TCPDF barcode array to fill up - * @return array barcode representation. - * @access protected - */ - protected function binseq_to_array($seq, $bararray) { - $len = strlen($seq); - $w = 0; - $k = 0; - for ($i = 0; $i < $len; ++$i) { - $w += 1; - if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq{$i} != $seq{($i+1)}))) { - if ($seq{$i} == '1') { - $t = true; // bar - } else { - $t = false; // space - } - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - $w = 0; - } - } - return $bararray; - } - - /** - * Interleaved 2 of 5 barcodes. - * Compact numeric code, widely used in industry, air cargo - * Contains digits (0 to 9) and encodes the data in the width of both bars and spaces. - * @param string $code code to represent. - * @param boolean $checksum if true add a checksum to the code - * @return array barcode representation. - * @access protected - */ - protected function barcode_i25($code, $checksum=false) { - $chr['0'] = '11221'; - $chr['1'] = '21112'; - $chr['2'] = '12112'; - $chr['3'] = '22111'; - $chr['4'] = '11212'; - $chr['5'] = '21211'; - $chr['6'] = '12211'; - $chr['7'] = '11122'; - $chr['8'] = '21121'; - $chr['9'] = '12121'; - $chr['A'] = '11'; - $chr['Z'] = '21'; - if ($checksum) { - // add checksum - $code .= $this->checksum_s25($code); - } - if((strlen($code) % 2) != 0) { - // add leading zero if code-length is odd - $code = '0'.$code; - } - // add start and stop codes - $code = 'AA'.strtolower($code).'ZA'; - - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; $i = ($i + 2)) { - $char_bar = $code{$i}; - $char_space = $code{$i+1}; - if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) { - // invalid character - return false; - } - // create a bar-space sequence - $seq = ''; - $chrlen = strlen($chr[$char_bar]); - for ($s = 0; $s < $chrlen; $s++){ - $seq .= $chr[$char_bar]{$s} . $chr[$char_space]{$s}; - } - $seqlen = strlen($seq); - for ($j = 0; $j < $seqlen; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $seq{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - return $bararray; - } - - /** - * C128 barcodes. - * Very capable code, excellent density, high reliability; in very wide use world-wide - * @param string $code code to represent. - * @param string $type barcode type: A, B or C - * @return array barcode representation. - * @access protected - */ - protected function barcode_c128($code, $type='B') { - $chr = array( - '212222', /* 00 */ - '222122', /* 01 */ - '222221', /* 02 */ - '121223', /* 03 */ - '121322', /* 04 */ - '131222', /* 05 */ - '122213', /* 06 */ - '122312', /* 07 */ - '132212', /* 08 */ - '221213', /* 09 */ - '221312', /* 10 */ - '231212', /* 11 */ - '112232', /* 12 */ - '122132', /* 13 */ - '122231', /* 14 */ - '113222', /* 15 */ - '123122', /* 16 */ - '123221', /* 17 */ - '223211', /* 18 */ - '221132', /* 19 */ - '221231', /* 20 */ - '213212', /* 21 */ - '223112', /* 22 */ - '312131', /* 23 */ - '311222', /* 24 */ - '321122', /* 25 */ - '321221', /* 26 */ - '312212', /* 27 */ - '322112', /* 28 */ - '322211', /* 29 */ - '212123', /* 30 */ - '212321', /* 31 */ - '232121', /* 32 */ - '111323', /* 33 */ - '131123', /* 34 */ - '131321', /* 35 */ - '112313', /* 36 */ - '132113', /* 37 */ - '132311', /* 38 */ - '211313', /* 39 */ - '231113', /* 40 */ - '231311', /* 41 */ - '112133', /* 42 */ - '112331', /* 43 */ - '132131', /* 44 */ - '113123', /* 45 */ - '113321', /* 46 */ - '133121', /* 47 */ - '313121', /* 48 */ - '211331', /* 49 */ - '231131', /* 50 */ - '213113', /* 51 */ - '213311', /* 52 */ - '213131', /* 53 */ - '311123', /* 54 */ - '311321', /* 55 */ - '331121', /* 56 */ - '312113', /* 57 */ - '312311', /* 58 */ - '332111', /* 59 */ - '314111', /* 60 */ - '221411', /* 61 */ - '431111', /* 62 */ - '111224', /* 63 */ - '111422', /* 64 */ - '121124', /* 65 */ - '121421', /* 66 */ - '141122', /* 67 */ - '141221', /* 68 */ - '112214', /* 69 */ - '112412', /* 70 */ - '122114', /* 71 */ - '122411', /* 72 */ - '142112', /* 73 */ - '142211', /* 74 */ - '241211', /* 75 */ - '221114', /* 76 */ - '413111', /* 77 */ - '241112', /* 78 */ - '134111', /* 79 */ - '111242', /* 80 */ - '121142', /* 81 */ - '121241', /* 82 */ - '114212', /* 83 */ - '124112', /* 84 */ - '124211', /* 85 */ - '411212', /* 86 */ - '421112', /* 87 */ - '421211', /* 88 */ - '212141', /* 89 */ - '214121', /* 90 */ - '412121', /* 91 */ - '111143', /* 92 */ - '111341', /* 93 */ - '131141', /* 94 */ - '114113', /* 95 */ - '114311', /* 96 */ - '411113', /* 97 */ - '411311', /* 98 */ - '113141', /* 99 */ - '114131', /* 100 */ - '311141', /* 101 */ - '411131', /* 102 */ - '211412', /* 103 START A */ - '211214', /* 104 START B */ - '211232', /* 105 START C */ - '233111', /* STOP */ - '200000' /* END */ - ); - $keys = ''; - switch(strtoupper($type)) { - case 'A': { - $startid = 103; - $keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'; - for ($i = 0; $i < 32; ++$i) { - $keys .= chr($i); - } - break; - } - case 'B': { - $startid = 104; - $keys = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.chr(127); - break; - } - case 'C': { - $startid = 105; - $keys = ''; - if ((strlen($code) % 2) != 0) { - // The length of barcode value must be even ($code). You must pad the number with zeros - return false; - } - for ($i = 0; $i <= 99; ++$i) { - $keys .= chr($i); - } - $new_code = ''; - $hclen = (strlen($code) / 2); - for ($i = 0; $i < $hclen; ++$i) { - $new_code .= chr(intval($code{(2 * $i)}.$code{(2 * $i + 1)})); - } - $code = $new_code; - break; - } - default: { - return false; - } - } - // calculate check character - $sum = $startid; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $sum += (strpos($keys, $code{$i}) * ($i+1)); - } - $check = ($sum % 103); - // add start, check and stop codes - $code = chr($startid).$code.chr($check).chr(106).chr(107); - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $len = strlen($code); - for ($i = 0; $i < $len; ++$i) { - $ck = strpos($keys, $code{$i}); - if (($i == 0) OR ($i > ($len-4))) { - $char_num = ord($code{$i}); - $seq = $chr[$char_num]; - } elseif(($ck >= 0) AND isset($chr[$ck])) { - $seq = $chr[$ck]; - } else { - // invalid character - return false; - } - for ($j = 0; $j < 6; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $seq{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - return $bararray; - } - - /** - * EAN13 and UPC-A barcodes. - * EAN13: European Article Numbering international retail product code - * UPC-A: Universal product code seen on almost all retail products in the USA and Canada - * UPC-E: Short version of UPC symbol - * @param string $code code to represent. - * @param string $len barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A - * @return array barcode representation. - * @access protected - */ - protected function barcode_eanupc($code, $len=13) { - $upce = false; - if ($len == 6) { - $len = 12; // UPC-A - $upce = true; // UPC-E mode - } - $data_len = $len - 1; - //Padding - $code = str_pad($code, $data_len, '0', STR_PAD_LEFT); - $code_len = strlen($code); - // calculate check digit - $sum_a = 0; - for ($i = 1; $i < $data_len; $i+=2) { - $sum_a += $code{$i}; - } - if ($len > 12) { - $sum_a *= 3; - } - $sum_b = 0; - for ($i = 0; $i < $data_len; $i+=2) { - $sum_b += ($code{$i}); - } - if ($len < 13) { - $sum_b *= 3; - } - $r = ($sum_a + $sum_b) % 10; - if($r > 0) { - $r = (10 - $r); - } - if ($code_len == $data_len) { - // add check digit - $code .= $r; - } elseif ($r !== intval($code{$data_len})) { - // wrong checkdigit - return false; - } - if ($len == 12) { - // UPC-A - $code = '0'.$code; - ++$len; - } - if ($upce) { - // convert UPC-A to UPC-E - $tmp = substr($code, 4, 3); - if (($tmp == '000') OR ($tmp == '100') OR ($tmp == '200')) { - // manufacturer code ends in 000, 100, or 200 - $upce_code = substr($code, 2, 2).substr($code, 9, 3).substr($code, 4, 1); - } else { - $tmp = substr($code, 5, 2); - if ($tmp == '00') { - // manufacturer code ends in 00 - $upce_code = substr($code, 2, 3).substr($code, 10, 2).'3'; - } else { - $tmp = substr($code, 6, 1); - if ($tmp == '0') { - // manufacturer code ends in 0 - $upce_code = substr($code, 2, 4).substr($code, 11, 1).'4'; - } else { - // manufacturer code does not end in zero - $upce_code = substr($code, 2, 5).substr($code, 11, 1); - } - } - } - } - //Convert digits to bars - $codes = array( - 'A'=>array( // left odd parity - '0'=>'0001101', - '1'=>'0011001', - '2'=>'0010011', - '3'=>'0111101', - '4'=>'0100011', - '5'=>'0110001', - '6'=>'0101111', - '7'=>'0111011', - '8'=>'0110111', - '9'=>'0001011'), - 'B'=>array( // left even parity - '0'=>'0100111', - '1'=>'0110011', - '2'=>'0011011', - '3'=>'0100001', - '4'=>'0011101', - '5'=>'0111001', - '6'=>'0000101', - '7'=>'0010001', - '8'=>'0001001', - '9'=>'0010111'), - 'C'=>array( // right - '0'=>'1110010', - '1'=>'1100110', - '2'=>'1101100', - '3'=>'1000010', - '4'=>'1011100', - '5'=>'1001110', - '6'=>'1010000', - '7'=>'1000100', - '8'=>'1001000', - '9'=>'1110100') - ); - $parities = array( - '0'=>array('A','A','A','A','A','A'), - '1'=>array('A','A','B','A','B','B'), - '2'=>array('A','A','B','B','A','B'), - '3'=>array('A','A','B','B','B','A'), - '4'=>array('A','B','A','A','B','B'), - '5'=>array('A','B','B','A','A','B'), - '6'=>array('A','B','B','B','A','A'), - '7'=>array('A','B','A','B','A','B'), - '8'=>array('A','B','A','B','B','A'), - '9'=>array('A','B','B','A','B','A') - ); - $upce_parities = array(); - $upce_parities[0] = array( - '0'=>array('B','B','B','A','A','A'), - '1'=>array('B','B','A','B','A','A'), - '2'=>array('B','B','A','A','B','A'), - '3'=>array('B','B','A','A','A','B'), - '4'=>array('B','A','B','B','A','A'), - '5'=>array('B','A','A','B','B','A'), - '6'=>array('B','A','A','A','B','B'), - '7'=>array('B','A','B','A','B','A'), - '8'=>array('B','A','B','A','A','B'), - '9'=>array('B','A','A','B','A','B') - ); - $upce_parities[1] = array( - '0'=>array('A','A','A','B','B','B'), - '1'=>array('A','A','B','A','B','B'), - '2'=>array('A','A','B','B','A','B'), - '3'=>array('A','A','B','B','B','A'), - '4'=>array('A','B','A','A','B','B'), - '5'=>array('A','B','B','A','A','B'), - '6'=>array('A','B','B','B','A','A'), - '7'=>array('A','B','A','B','A','B'), - '8'=>array('A','B','A','B','B','A'), - '9'=>array('A','B','B','A','B','A') - ); - $k = 0; - $seq = '101'; // left guard bar - if ($upce) { - $bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $p = $upce_parities[$code{1}][$r]; - for ($i = 0; $i < 6; ++$i) { - $seq .= $codes[$p[$i]][$upce_code{$i}]; - } - $seq .= '010101'; // right guard bar - } else { - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $half_len = ceil($len / 2); - if ($len == 8) { - for ($i = 0; $i < $half_len; ++$i) { - $seq .= $codes['A'][$code{$i}]; - } - } else { - $p = $parities[$code{0}]; - for ($i = 1; $i < $half_len; ++$i) { - $seq .= $codes[$p[$i-1]][$code{$i}]; - } - } - $seq .= '01010'; // center guard bar - for ($i = $half_len; $i < $len; ++$i) { - $seq .= $codes['C'][$code{$i}]; - } - $seq .= '101'; // right guard bar - } - $clen = strlen($seq); - $w = 0; - for ($i = 0; $i < $clen; ++$i) { - $w += 1; - if (($i == ($clen - 1)) OR (($i < ($clen - 1)) AND ($seq{$i} != $seq{($i+1)}))) { - if ($seq{$i} == '1') { - $t = true; // bar - } else { - $t = false; // space - } - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - $w = 0; - } - } - return $bararray; - } - - /** - * UPC-Based Extentions - * 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers - * 5-Digit Ext.: Used to mark suggested retail price of books - * @param string $code code to represent. - * @param string $len barcode type: 2 = 2-Digit, 5 = 5-Digit - * @return array barcode representation. - * @access protected - */ - protected function barcode_eanext($code, $len=5) { - //Padding - $code = str_pad($code, $len, '0', STR_PAD_LEFT); - // calculate check digit - if ($len == 2) { - $r = $code % 4; - } elseif ($len == 5) { - $r = (3 * ($code{0} + $code{2} + $code{4})) + (9 * ($code{1} + $code{3})); - $r %= 10; - } else { - return false; - } - //Convert digits to bars - $codes = array( - 'A'=>array( // left odd parity - '0'=>'0001101', - '1'=>'0011001', - '2'=>'0010011', - '3'=>'0111101', - '4'=>'0100011', - '5'=>'0110001', - '6'=>'0101111', - '7'=>'0111011', - '8'=>'0110111', - '9'=>'0001011'), - 'B'=>array( // left even parity - '0'=>'0100111', - '1'=>'0110011', - '2'=>'0011011', - '3'=>'0100001', - '4'=>'0011101', - '5'=>'0111001', - '6'=>'0000101', - '7'=>'0010001', - '8'=>'0001001', - '9'=>'0010111') - ); - $parities = array(); - $parities[2] = array( - '0'=>array('A','A'), - '1'=>array('A','B'), - '2'=>array('B','A'), - '3'=>array('B','B') - ); - $parities[5] = array( - '0'=>array('B','B','A','A','A'), - '1'=>array('B','A','B','A','A'), - '2'=>array('B','A','A','B','A'), - '3'=>array('B','A','A','A','B'), - '4'=>array('A','B','B','A','A'), - '5'=>array('A','A','B','B','A'), - '6'=>array('A','A','A','B','B'), - '7'=>array('A','B','A','B','A'), - '8'=>array('A','B','A','A','B'), - '9'=>array('A','A','B','A','B') - ); - $p = $parities[$len][$r]; - $seq = '1011'; // left guard bar - $seq .= $codes[$p[0]][$code{0}]; - for ($i = 1; $i < $len; ++$i) { - $seq .= '01'; // separator - $seq .= $codes[$p[$i]][$code{$i}]; - } - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * POSTNET and PLANET barcodes. - * Used by U.S. Postal Service for automated mail sorting - * @param string $code zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD. - * @param boolean $planet if true print the PLANET barcode, otherwise print POSTNET - * @return array barcode representation. - * @access protected - */ - protected function barcode_postnet($code, $planet=false) { - // bar lenght - if ($planet) { - $barlen = Array( - 0 => Array(1,1,2,2,2), - 1 => Array(2,2,2,1,1), - 2 => Array(2,2,1,2,1), - 3 => Array(2,2,1,1,2), - 4 => Array(2,1,2,2,1), - 5 => Array(2,1,2,1,2), - 6 => Array(2,1,1,2,2), - 7 => Array(1,2,2,2,1), - 8 => Array(1,2,2,1,2), - 9 => Array(1,2,1,2,2) - ); - } else { - $barlen = Array( - 0 => Array(2,2,1,1,1), - 1 => Array(1,1,1,2,2), - 2 => Array(1,1,2,1,2), - 3 => Array(1,1,2,2,1), - 4 => Array(1,2,1,1,2), - 5 => Array(1,2,1,2,1), - 6 => Array(1,2,2,1,1), - 7 => Array(2,1,1,1,2), - 8 => Array(2,1,1,2,1), - 9 => Array(2,1,2,1,1) - ); - } - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 2, 'bcode' => array()); - $k = 0; - $code = str_replace('-', '', $code); - $code = str_replace(' ', '', $code); - $len = strlen($code); - // calculate checksum - $sum = 0; - for ($i = 0; $i < $len; ++$i) { - $sum += intval($code{$i}); - } - $chkd = ($sum % 10); - if($chkd > 0) { - $chkd = (10 - $chkd); - } - $code .= $chkd; - $len = strlen($code); - // start bar - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - for ($i = 0; $i < $len; ++$i) { - for ($j = 0; $j < 5; ++$j) { - $h = $barlen[$code{$i}][$j]; - $p = floor(1 / $h); - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - } - } - // end bar - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 1; - return $bararray; - } - - /** - * RMS4CC - CBC - KIX - * RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index) - * RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service. - * @param string $code code to print - * @param boolean $kix if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code. - * @return array barcode representation. - * @access protected - */ - protected function barcode_rms4cc($code, $kix=false) { - $notkix = !$kix; - // bar mode - // 1 = pos 1, length 2 - // 2 = pos 1, length 3 - // 3 = pos 2, length 1 - // 4 = pos 2, length 2 - $barmode = array( - '0' => array(3,3,2,2), - '1' => array(3,4,1,2), - '2' => array(3,4,2,1), - '3' => array(4,3,1,2), - '4' => array(4,3,2,1), - '5' => array(4,4,1,1), - '6' => array(3,1,4,2), - '7' => array(3,2,3,2), - '8' => array(3,2,4,1), - '9' => array(4,1,3,2), - 'A' => array(4,1,4,1), - 'B' => array(4,2,3,1), - 'C' => array(3,1,2,4), - 'D' => array(3,2,1,4), - 'E' => array(3,2,2,3), - 'F' => array(4,1,1,4), - 'G' => array(4,1,2,3), - 'H' => array(4,2,1,3), - 'I' => array(1,3,4,2), - 'J' => array(1,4,3,2), - 'K' => array(1,4,4,1), - 'L' => array(2,3,3,2), - 'M' => array(2,3,4,1), - 'N' => array(2,4,3,1), - 'O' => array(1,3,2,4), - 'P' => array(1,4,1,4), - 'Q' => array(1,4,2,3), - 'R' => array(2,3,1,4), - 'S' => array(2,3,2,3), - 'T' => array(2,4,1,3), - 'U' => array(1,1,4,4), - 'V' => array(1,2,3,4), - 'W' => array(1,2,4,3), - 'X' => array(2,1,3,4), - 'Y' => array(2,1,4,3), - 'Z' => array(2,2,3,3) - ); - $code = strtoupper($code); - $len = strlen($code); - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array()); - if ($notkix) { - // table for checksum calculation (row,col) - $checktable = array( - '0' => array(1,1), - '1' => array(1,2), - '2' => array(1,3), - '3' => array(1,4), - '4' => array(1,5), - '5' => array(1,0), - '6' => array(2,1), - '7' => array(2,2), - '8' => array(2,3), - '9' => array(2,4), - 'A' => array(2,5), - 'B' => array(2,0), - 'C' => array(3,1), - 'D' => array(3,2), - 'E' => array(3,3), - 'F' => array(3,4), - 'G' => array(3,5), - 'H' => array(3,0), - 'I' => array(4,1), - 'J' => array(4,2), - 'K' => array(4,3), - 'L' => array(4,4), - 'M' => array(4,5), - 'N' => array(4,0), - 'O' => array(5,1), - 'P' => array(5,2), - 'Q' => array(5,3), - 'R' => array(5,4), - 'S' => array(5,5), - 'T' => array(5,0), - 'U' => array(0,1), - 'V' => array(0,2), - 'W' => array(0,3), - 'X' => array(0,4), - 'Y' => array(0,5), - 'Z' => array(0,0) - ); - $row = 0; - $col = 0; - for ($i = 0; $i < $len; ++$i) { - $row += $checktable[$code{$i}][0]; - $col += $checktable[$code{$i}][1]; - } - $row %= 6; - $col %= 6; - $chk = array_keys($checktable, array($row,$col)); - $code .= $chk[0]; - ++$len; - } - $k = 0; - if ($notkix) { - // start bar - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - } - for ($i = 0; $i < $len; ++$i) { - for ($j = 0; $j < 4; ++$j) { - switch ($barmode[$code{$i}][$j]) { - case 1: { - $p = 0; - $h = 2; - break; - } - case 2: { - $p = 0; - $h = 3; - break; - } - case 3: { - $p = 1; - $h = 1; - break; - } - case 4: { - $p = 1; - $h = 2; - break; - } - } - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - } - } - if ($notkix) { - // stop bar - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 3, 'p' => 0); - $bararray['maxw'] += 1; - } - return $bararray; - } - - /** - * CODABAR barcodes. - * Older code often used in library systems, sometimes in blood banks - * @param string $code code to represent. - * @return array barcode representation. - * @access protected - */ - protected function barcode_codabar($code) { - $chr = array( - '0' => '11111221', - '1' => '11112211', - '2' => '11121121', - '3' => '22111111', - '4' => '11211211', - '5' => '21111211', - '6' => '12111121', - '7' => '12112111', - '8' => '12211111', - '9' => '21121111', - '-' => '11122111', - '$' => '11221111', - ':' => '21112121', - '/' => '21211121', - '.' => '21212111', - '+' => '11222221', - 'A' => '11221211', - 'B' => '12121121', - 'C' => '11121221', - 'D' => '11122211' - ); - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $w = 0; - $seq = ''; - $code = 'A'.strtoupper($code).'A'; - $len = strlen($code); - for ($i = 0; $i < $len; ++$i) { - if (!isset($chr[$code{$i}])) { - return false; - } - $seq = $chr[$code{$i}]; - for ($j = 0; $j < 8; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $seq{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - return $bararray; - } - - /** - * CODE11 barcodes. - * Used primarily for labeling telecommunications equipment - * @param string $code code to represent. - * @return array barcode representation. - * @access protected - */ - protected function barcode_code11($code) { - $chr = array( - '0' => '111121', - '1' => '211121', - '2' => '121121', - '3' => '221111', - '4' => '112121', - '5' => '212111', - '6' => '122111', - '7' => '111221', - '8' => '211211', - '9' => '211111', - '-' => '112111', - 'S' => '112211' - ); - - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $w = 0; - $seq = ''; - $len = strlen($code); - // calculate check digit C - $p = 1; - $check = 0; - for ($i = ($len - 1); $i >= 0; --$i) { - $digit = $code{$i}; - if ($digit == '-') { - $dval = 10; - } else { - $dval = intval($digit); - } - $check += ($dval * $p); - ++$p; - if ($p > 10) { - $p = 1; - } - } - $check %= 11; - if ($check == 10) { - $check = '-'; - } - $code .= $check; - if ($len > 10) { - // calculate check digit K - $p = 1; - $check = 0; - for ($i = $len; $i >= 0; --$i) { - $digit = $code{$i}; - if ($digit == '-') { - $dval = 10; - } else { - $dval = intval($digit); - } - $check += ($dval * $p); - ++$p; - if ($p > 9) { - $p = 1; - } - } - $check %= 11; - $code .= $check; - ++$len; - } - $code = 'S'.$code.'S'; - $len += 3; - for ($i = 0; $i < $len; ++$i) { - if (!isset($chr[$code{$i}])) { - return false; - } - $seq = $chr[$code{$i}]; - for ($j = 0; $j < 6; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $seq{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - return $bararray; - } - - /** - * Pharmacode - * Contains digits (0 to 9) - * @param string $code code to represent. - * @return array barcode representation. - * @access protected - */ - protected function barcode_pharmacode($code) { - $seq = ''; - $code = intval($code); - while ($code > 0) { - if (($code % 2) == 0) { - $seq .= '11100'; - $code -= 2; - } else { - $seq .= '100'; - $code -= 1; - } - $code /= 2; - } - $seq = substr($seq, 0, -2); - $seq = strrev($seq); - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * Pharmacode two-track - * Contains digits (0 to 9) - * @param string $code code to represent. - * @return array barcode representation. - * @access protected - */ - protected function barcode_pharmacode2t($code) { - $seq = ''; - $code = intval($code); - do { - switch ($code % 3) { - case 0: { - $seq .= '3'; - $code = ($code - 3) / 3; - break; - } - case 1: { - $seq .= '1'; - $code = ($code - 1) / 3; - break; - } - case 2: { - $seq .= '2'; - $code = ($code - 2) / 3; - break; - } - } - } while($code != 0); - $seq = strrev($seq); - $k = 0; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 2, 'bcode' => array()); - $len = strlen($seq); - for ($i = 0; $i < $len; ++$i) { - switch ($seq{$i}) { - case '1': { - $p = 1; - $h = 1; - break; - } - case '2': { - $p = 0; - $h = 1; - break; - } - case '3': { - $p = 0; - $h = 2; - break; - } - } - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - } - unset($bararray['bcode'][($k - 1)]); - --$bararray['maxw']; - return $bararray; - } - - - /** - * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 - * (requires PHP bcmath extension) - * Intelligent Mail barcode is a 65-bar code for use on mail in the United States. - * The fields are described as follows:<ul><li>The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0–4. The allowable encoding ranges shall be 00–04, 10–14, 20–24, 30–34, 40–44, 50–54, 60–64, 70–74, 80–84, and 90–94.</li><li>The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000http://it2.php.net/manual/en/function.dechex.php–999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.</li><li>The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.</li><li>The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000–999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000–99999, 000000000–999999999, and 00000000000–99999999999.</li></ul> - * @param string $code code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode) - * @return array barcode representation. - * @access protected - */ - protected function barcode_imb($code) { - $asc_chr = array(4,0,2,6,3,5,1,9,8,7,1,2,0,6,4,8,2,9,5,3,0,1,3,7,4,6,8,9,2,0,5,1,9,4,3,8,6,7,1,2,4,3,9,5,7,8,3,0,2,1,4,0,9,1,7,0,2,4,6,3,7,1,9,5,8); - $dsc_chr = array(7,1,9,5,8,0,2,4,6,3,5,8,9,7,3,0,6,1,7,4,6,8,9,2,5,1,7,5,4,3,8,7,6,0,2,5,4,9,3,0,1,6,8,2,0,4,5,9,6,7,5,2,6,3,8,5,1,9,8,7,4,0,2,6,3); - $asc_pos = array(3,0,8,11,1,12,8,11,10,6,4,12,2,7,9,6,7,9,2,8,4,0,12,7,10,9,0,7,10,5,7,9,6,8,2,12,1,4,2,0,1,5,4,6,12,1,0,9,4,7,5,10,2,6,9,11,2,12,6,7,5,11,0,3,2); - $dsc_pos = array(2,10,12,5,9,1,5,4,3,9,11,5,10,1,6,3,4,1,10,0,2,11,8,6,1,12,3,8,6,4,4,11,0,6,1,9,11,5,3,7,3,10,7,11,8,2,10,3,5,8,0,3,12,11,8,4,5,1,3,0,7,12,9,8,10); - $code_arr = explode('-', $code); - $tracking_number = $code_arr[0]; - if (isset($code_arr[1])) { - $routing_code = $code_arr[1]; - } else { - $routing_code = ''; - } - // Conversion of Routing Code - switch (strlen($routing_code)) { - case 0: { - $binary_code = 0; - break; - } - case 5: { - $binary_code = bcadd($routing_code, '1'); - break; - } - case 9: { - $binary_code = bcadd($routing_code, '100001'); - break; - } - case 11: { - $binary_code = bcadd($routing_code, '1000100001'); - break; - } - default: { - return false; - break; - } - } - $binary_code = bcmul($binary_code, 10); - $binary_code = bcadd($binary_code, $tracking_number{0}); - $binary_code = bcmul($binary_code, 5); - $binary_code = bcadd($binary_code, $tracking_number{1}); - $binary_code .= substr($tracking_number, 2, 18); - // convert to hexadecimal - $binary_code = $this->dec_to_hex($binary_code); - // pad to get 13 bytes - $binary_code = str_pad($binary_code, 26, '0', STR_PAD_LEFT); - // convert string to array of bytes - $binary_code_arr = chunk_split($binary_code, 2, "\r"); - $binary_code_arr = substr($binary_code_arr, 0, -1); - $binary_code_arr = explode("\r", $binary_code_arr); - // calculate frame check sequence - $fcs = $this->imb_crc11fcs($binary_code_arr); - // exclude first 2 bits from first byte - $first_byte = sprintf('%2s', dechex((hexdec($binary_code_arr[0]) << 2) >> 2)); - $binary_code_102bit = $first_byte.substr($binary_code, 2); - // convert binary data to codewords - $codewords = array(); - $data = $this->hex_to_dec($binary_code_102bit); - $codewords[0] = bcmod($data, 636) * 2; - $data = bcdiv($data, 636); - for ($i = 1; $i < 9; ++$i) { - $codewords[$i] = bcmod($data, 1365); - $data = bcdiv($data, 1365); - } - $codewords[9] = $data; - if (($fcs >> 10) == 1) { - $codewords[9] += 659; - } - // generate lookup tables - $table2of13 = $this->imb_tables(2, 78); - $table5of13 = $this->imb_tables(5, 1287); - // convert codewords to characters - $characters = array(); - $bitmask = 512; - foreach($codewords as $k => $val) { - if ($val <= 1286) { - $chrcode = $table5of13[$val]; - } else { - $chrcode = $table2of13[($val - 1287)]; - } - if (($fcs & $bitmask) > 0) { - // bitwise invert - $chrcode = ((~$chrcode) & 8191); - } - $characters[] = $chrcode; - $bitmask /= 2; - } - $characters = array_reverse($characters); - // build bars - $k = 0; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array()); - for ($i = 0; $i < 65; ++$i) { - $asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0); - $dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0); - if ($asc AND $dsc) { - // full bar (F) - $p = 0; - $h = 3; - } elseif ($asc) { - // ascender (A) - $p = 0; - $h = 2; - } elseif ($dsc) { - // descender (D) - $p = 1; - $h = 2; - } else { - // tracker (T) - $p = 1; - $h = 1; - } - $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); - $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); - $bararray['maxw'] += 2; - } - unset($bararray['bcode'][($k - 1)]); - --$bararray['maxw']; - return $bararray; - } - - /** - * Convert large integer number to hexadecimal representation. - * (requires PHP bcmath extension) - * @param string $number number to convert specified as a string - * @return string hexadecimal representation - */ - public function dec_to_hex($number) { - $i = 0; - $hex = array(); - if($number == 0) { - return '00'; - } - while($number > 0) { - if($number == 0) { - array_push($hex, '0'); - } else { - array_push($hex, strtoupper(dechex(bcmod($number, '16')))); - $number = bcdiv($number, '16', 0); - } - } - $hex = array_reverse($hex); - return implode($hex); - } - - /** - * Convert large hexadecimal number to decimal representation (string). - * (requires PHP bcmath extension) - * @param string $hex hexadecimal number to convert specified as a string - * @return string hexadecimal representation - */ - public function hex_to_dec($hex) { - $dec = 0; - $bitval = 1; - $len = strlen($hex); - for($pos = ($len - 1); $pos >= 0; --$pos) { - $dec = bcadd($dec, bcmul(hexdec($hex{$pos}), $bitval)); - $bitval = bcmul($bitval, 16); - } - return $dec; - } - - /** - * Intelligent Mail Barcode calculation of Frame Check Sequence - * @param string $code_arr array of hexadecimal values (13 bytes holding 102 bits right justified). - * @return int 11 bit Frame Check Sequence as integer (decimal base) - * @access protected - */ - protected function imb_crc11fcs($code_arr) { - $genpoly = 0x0F35; // generator polynomial - $fcs = 0x07FF; // Frame Check Sequence - // do most significant byte skipping the 2 most significant bits - $data = hexdec($code_arr[0]) << 5; - for ($bit = 2; $bit < 8; ++$bit) { - if (($fcs ^ $data) & 0x400) { - $fcs = ($fcs << 1) ^ $genpoly; - } else { - $fcs = ($fcs << 1); - } - $fcs &= 0x7FF; - $data <<= 1; - } - // do rest of bytes - for ($byte = 1; $byte < 13; ++$byte) { - $data = hexdec($code_arr[$byte]) << 3; - for ($bit = 0; $bit < 8; ++$bit) { - if (($fcs ^ $data) & 0x400) { - $fcs = ($fcs << 1) ^ $genpoly; - } else { - $fcs = ($fcs << 1); - } - $fcs &= 0x7FF; - $data <<= 1; - } - } - return $fcs; - } - - /** - * Reverse unsigned short value - * @param int $num value to reversr - * @return int reversed value - * @access protected - */ - protected function imb_reverse_us($num) { - $rev = 0; - for ($i = 0; $i < 16; ++$i) { - $rev <<= 1; - $rev |= ($num & 1); - $num >>= 1; - } - return $rev; - } - - /** - * generate Nof13 tables used for Intelligent Mail Barcode - * @param int $n is the type of table: 2 for 2of13 table, 5 for 5of13table - * @param int $size size of table (78 for n=2 and 1287 for n=5) - * @return array requested table - * @access protected - */ - protected function imb_tables($n, $size) { - $table = array(); - $lli = 0; // LUT lower index - $lui = $size - 1; // LUT upper index - for ($count = 0; $count < 8192; ++$count) { - $bit_count = 0; - for ($bit_index = 0; $bit_index < 13; ++$bit_index) { - $bit_count += intval(($count & (1 << $bit_index)) != 0); - } - // if we don't have the right number of bits on, go on to the next value - if ($bit_count == $n) { - $reverse = ($this->imb_reverse_us($count) >> 3); - // if the reverse is less than count, we have already visited this pair before - if ($reverse >= $count) { - // If count is symmetric, place it at the first free slot from the end of the list. - // Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list - if ($reverse == $count) { - $table[$lui] = $count; - --$lui; - } else { - $table[$lli] = $count; - ++$lli; - $table[$lli] = $reverse; - ++$lli; - } - } - } - } - return $table; - } - -} // end of class -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_1.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_1.txt deleted file mode 100644 index 4025de9303..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_1.txt +++ /dev/null @@ -1,19 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc. - -Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa. - -Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu. - -Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra. - -Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc. - -Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa. - -Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu. - -Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra. - -Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_2.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_2.txt deleted file mode 100644 index cd7bfe68c3..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/chapter_demo_2.txt +++ /dev/null @@ -1,23 +0,0 @@ -<p><strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.</p> - -<img src="../images/image_demo.jpg" width="54mm" height="80mm" /> - -<p style="background-color:yellow;"><i>Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.</i></p> - -<p>Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.</p> - -<p style="color:navy;">Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.</p> - -<p>Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.</p> - -<p><strong>Lorem ipsum</strong> dolor sit amet, consectetur adipiscing elit. In sed imperdiet lectus. Phasellus quis velit velit, non condimentum quam. Sed neque urna, ultrices ac volutpat vel, laoreet vitae augue. Sed vel velit erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras eget velit nulla, eu sagittis elit. Nunc ac arcu est, in lobortis tellus. Praesent condimentum rhoncus sodales. In hac habitasse platea dictumst. Proin porta eros pharetra enim tincidunt dignissim nec vel dolor. Cras sapien elit, ornare ac dignissim eu, ultricies ac eros. Maecenas augue magna, ultrices a congue in, mollis eu nulla. Nunc venenatis massa at est eleifend faucibus. Vivamus sed risus lectus, nec interdum nunc.</p> - -<img src="../images/image_demo.jpg" width="54mm" height="80mm" /> - -<p style="background-color:yellow;"><i>Fusce et felis vitae diam lobortis sollicitudin. Aenean tincidunt accumsan nisi, id vehicula quam laoreet elementum. Phasellus egestas interdum erat, et viverra ipsum ultricies ac. Praesent sagittis augue at augue volutpat eleifend. Cras nec orci neque. Mauris bibendum posuere blandit. Donec feugiat mollis dui sit amet pellentesque. Sed a enim justo. Donec tincidunt, nisl eget elementum aliquam, odio ipsum ultrices quam, eu porttitor ligula urna at lorem. Donec varius, eros et convallis laoreet, ligula tellus consequat felis, ut ornare metus tellus sodales velit. Duis sed diam ante. Ut rutrum malesuada massa, vitae consectetur ipsum rhoncus sed. Suspendisse potenti. Pellentesque a congue massa.</i></p> - -<p>Integer non sem eget neque mattis accumsan. Maecenas eu nisl mauris, sit amet interdum ipsum. In pharetra erat vel lectus venenatis elementum. Nulla non elit ligula, sit amet mollis urna. Morbi ut gravida est. Mauris tincidunt sem et turpis molestie malesuada. Curabitur vel nulla risus, sed mollis erat. Suspendisse vehicula accumsan purus nec varius. Donec fermentum lorem id felis sodales dictum. Quisque et dolor ipsum. Nam luctus consectetur dui vitae fermentum. Curabitur sodales consequat augue, id ultricies augue tempor ac. Aliquam ac magna id ipsum vehicula bibendum. Sed elementum congue tristique. Phasellus vel lorem eu lectus porta sodales. Etiam neque tortor, sagittis id pharetra quis, laoreet vel arcu.</p> - -<p style="color:navy;">Cras quam mi, ornare laoreet laoreet vel, vehicula at lacus. Maecenas a lacus accumsan augue convallis sagittis sed quis odio. Morbi sit amet turpis diam, dictum convallis urna. Cras eget interdum augue. Cras eu nisi sit amet dolor faucibus porttitor. Suspendisse potenti. Nunc vitae dolor risus, at cursus libero. Suspendisse bibendum tellus non nibh hendrerit tristique. Mauris eget orci elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam porta libero non ante laoreet semper. Proin volutpat sodales mi, ac fermentum erat sagittis in. Vivamus at viverra felis. Ut pretium facilisis ante et pharetra.</p> - -<p>Nulla facilisi. Cras varius quam eget libero aliquam vitae tincidunt leo rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque a nisl massa, quis pretium urna. Proin vel porttitor tortor. Cras rhoncus congue velit in bibendum. Donec pharetra semper augue id lacinia. Quisque magna quam, hendrerit eu aliquam et, pellentesque ut tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas nulla quam, rutrum eu feugiat at, elementum eu libero. Maecenas ullamcorper leo et turpis rutrum ac laoreet eros faucibus. Phasellus condimentum lorem quis neque imperdiet quis molestie enim iaculis. Phasellus risus est, vestibulum ut convallis ultrices, dignissim nec erat. Etiam congue lobortis laoreet. Nulla ut neque sed velit dapibus semper. Quisque nec dolor id nibh eleifend iaculis. Vivamus vitae fermentum odio. Etiam malesuada quam in nulla aliquam sed convallis dui feugiat.</p> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/table_data_demo.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/table_data_demo.txt deleted file mode 100644 index 5a48a42e77..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/table_data_demo.txt +++ /dev/null @@ -1,15 +0,0 @@ -Austria;Vienna;83859;8075 -Belgium;Brussels;30518;10192 -Denmark;Copenhagen;43094;5295 -Finland;Helsinki;304529;5147 -France;Paris;543965;58728 -Germany;Berlin;357022;82057 -Greece;Athens;131625;10511 -Ireland;Dublin;70723;3694 -Italy;Roma;301316;57563 -Luxembourg;Luxembourg;2586;424 -Netherlands;Amsterdam;41526;15654 -Portugal;Lisbon;91906;9957 -Spain;Madrid;504790;39348 -Sweden;Stockholm;410934;8839 -United Kingdom;London;243820;58862 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/utf8test.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/utf8test.txt deleted file mode 100644 index 723a37d84b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/cache/utf8test.txt +++ /dev/null @@ -1,122 +0,0 @@ -Sentences that contain all letters commonly used in a language --------------------------------------------------------------- - -Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> -- 2001-09-02 - -This file is UTF-8 encoded. - - -Danish (da) ---------- - - Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen - Wolther spillede pÃ¥ xylofon. - (= Quiz contestants were eating strawbery with cream while Wolther - the circus clown played on xylophone.) - -German (de) ------------ - - Falsches Üben von Xylophonmusik quält jeden größeren Zwerg - (= Wrongful practicing of xylophone music tortures every larger dwarf) - - Zwölf Boxkämpfer jagten Eva quer über den Sylter Deich - (= Twelve boxing fighters hunted Eva across the dike of Sylt) - - Heizölrückstoßabdämpfung - (= fuel oil recoil absorber) - (jqvwxy missing, but all non-ASCII letters in one word) - -English (en) ------------- - - The quick brown fox jumps over the lazy dog - -Spanish (es) ------------- - - El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y - frío, añoraba a su querido cachorro. - (Contains every letter and every accent, but not every combination - of vowel + acute.) - -French (fr) ------------ - - Portez ce vieux whisky au juge blond qui fume sur son île intérieure, à - côté de l'alcôve ovoïde, où les bûches se consument dans l'âtre, ce - qui lui permet de penser à la cænogenèse de l'être dont il est question - dans la cause ambiguë entendue à Moÿ, dans un capharnaüm qui, - pense-t-il, diminue çà et là la qualité de son Å“uvre. - - l'île exiguë - Où l'obèse jury mûr - Fête l'haï volapük, - Âne ex aéquo au whist, - Ôtez ce vÅ“u déçu. - - Le cÅ“ur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en - canoë au delà des îles, près du mälström où brûlent les novæ. - -Irish Gaelic (ga) ------------------ - - D'fhuascail Ãosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ãdhaimh - -Hungarian (hu) --------------- - - ÃrvíztűrÅ‘ tükörfúrógép - (= flood-proof mirror-drilling machine, only all non-ASCII letters) - -Icelandic (is) --------------- - - Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa - - Sævör grét áðan því úlpan var ónýt - (some ASCII letters missing) - -Greek (el) -------------- - - Γαζέες καὶ μυÏτιὲς δὲν θὰ βÏá¿¶ πιὰ στὸ χÏυσαφὶ ξέφωτο - (= No more shall I see acacias or myrtles in the golden clearing) - - Ξεσκεπάζω τὴν ψυχοφθόÏα βδελυγμία - (= I uncover the soul-destroying abhorrence) - -Hebrew (iw) ------------ - - ? דג סקרן שט ×‘×™× ×ž×וכזב ולפתע ×ž×¦× ×œ×• חברה ×יך הקליטה - -Polish (pl) ------------ - - Pchnąć w tÄ™ łódź jeża lub osiem skrzyÅ„ fig - (= To push a hedgehog or eight bins of figs in this boat) - - Zażółć gęślÄ… jaźń - -Russian (ru) ------------- - - Ð’ чащах юга жил бы цитруÑ? Да, но фальшивый ÑкземплÑÑ€! - (= Would a citrus live in the bushes of south? Yes, but only a fake one!) - -Thai (th) ---------- - - [--------------------------|------------------------] - ๠เป็นมนุษย์สุดประเสริà¸à¹€à¸¥à¸´à¸¨à¸„ุณค่า à¸à¸§à¹ˆà¸²à¸šà¸£à¸£à¸”าà¸à¸¹à¸‡à¸ªà¸±à¸•ว์เดรัจฉาน - จงà¸à¹ˆà¸²à¸Ÿà¸±à¸™à¸žà¸±à¸’นาวิชาà¸à¸²à¸£ อย่าล้างผลาà¸à¸¤à¹…เข่นฆ่าบีฑาใคร - ไม่ถือโทษโà¸à¸£à¸˜à¹à¸Šà¹ˆà¸‡à¸‹à¸±à¸”ฮึดฮัดด่า หัดอภัยเหมือนà¸à¸µà¸¬à¸²à¸­à¸±à¸Šà¸Œà¸²à¸ªà¸±à¸¢ - ปà¸à¸´à¸šà¸±à¸•ิประพฤติà¸à¸Žà¸à¸³à¸«à¸™à¸”ใจ พูดจาให้จ๊ะๆ จ๋าๆ น่าฟังเอย ฯ - - [The copyright for the Thai example is owned by The Computer - Association of Thailand under the Royal Patronage of His Majesty the - King.] - -Please let me know if you find others! Special thanks to the people -from all over the world who contributed these sentences. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/bra.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/bra.php deleted file mode 100644 index ebaadd309d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/bra.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -//============================================================+ -// File name : eng.php -// Begin : 2004-03-03 -// Last Update : 2010-08-08 -// -// Description : Language module for TCPDF -// (contains translated texts) -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * TCPDF language file (contains translated texts). - * @package com.tecnick.tcpdf - * @abstract TCPDF language file. - * @author Nicola Asuni - * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-03-03 - */ - -// ENGLISH - -global $l; -$l = Array(); - -// PAGE META DESCRIPTORS -------------------------------------- - -$l['a_meta_charset'] = 'UTF-8'; -$l['a_meta_dir'] = 'ltr'; -$l['a_meta_language'] = 'pt'; - -// TRANSLATIONS -------------------------------------- -$l['w_page'] = 'página'; - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/eng.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/eng.php deleted file mode 100644 index b63f787aa4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/eng.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -//============================================================+ -// File name : eng.php -// Begin : 2004-03-03 -// Last Update : 2010-08-08 -// -// Description : Language module for TCPDF -// (contains translated texts) -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * TCPDF language file (contains translated texts). - * @package com.tecnick.tcpdf - * @abstract TCPDF language file. - * @author Nicola Asuni - * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-03-03 - */ - -// ENGLISH - -global $l; -$l = Array(); - -// PAGE META DESCRIPTORS -------------------------------------- - -$l['a_meta_charset'] = 'UTF-8'; -$l['a_meta_dir'] = 'ltr'; -$l['a_meta_language'] = 'en'; - -// TRANSLATIONS -------------------------------------- -$l['w_page'] = 'page'; - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ger.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ger.php deleted file mode 100644 index a4b7ae77d4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ger.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -//============================================================+ -// File name : eng.php -// Begin : 2004-03-03 -// Last Update : 2010-08-08 -// -// Description : Language module for TCPDF -// (contains translated texts) -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * TCPDF language file (contains translated texts). - * @package com.tecnick.tcpdf - * @abstract TCPDF language file. - * @author Nicola Asuni - * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-03-03 - */ - -// ENGLISH - -global $l; -$l = Array(); - -// PAGE META DESCRIPTORS -------------------------------------- - -$l['a_meta_charset'] = 'UTF-8'; -$l['a_meta_dir'] = 'ltr'; -$l['a_meta_language'] = 'de'; - -// TRANSLATIONS -------------------------------------- -$l['w_page'] = 'seite'; - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ita.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ita.php deleted file mode 100644 index 04393cd199..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/lang/ita.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -//============================================================+ -// File name : ita.php -// Begin : 2004-03-03 -// Last Update : 2010-08-08 -// -// Description : Language module for TCPDF -// (contains translated texts) -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * TCPDF language file (contains translated texts). - * @package com.tecnick.tcpdf - * @abstract TCPDF language file. - * @author Nicola Asuni - * @copyright 2004-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-03-03 - */ - -// ENGLISH - -global $l; -$l = Array(); - -// PAGE META DESCRIPTORS -------------------------------------- - -$l['a_meta_charset'] = 'UTF-8'; -$l['a_meta_dir'] = 'ltr'; -$l['a_meta_language'] = 'it'; - -// TRANSLATIONS -------------------------------------- -$l['w_page'] = 'pagina'; - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config.php deleted file mode 100644 index 8b662117f4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config.php +++ /dev/null @@ -1,243 +0,0 @@ -<?php -//============================================================+ -// File name : tcpdf_config.php -// Begin : 2004-06-11 -// Last Update : 2010-08-19 -// -// Description : Configuration file for TCPDF. -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * Configuration file for TCPDF. - * @author Nicola Asuni - * @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @package com.tecnick.tcpdf - * @version 4.9.005 - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-10-27 - */ - -// If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored. - -if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { - - // DOCUMENT_ROOT fix for IIS Webserver - if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) { - if(isset($_SERVER['SCRIPT_FILENAME'])) { - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); - } elseif(isset($_SERVER['PATH_TRANSLATED'])) { - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); - } else { - // define here your DOCUMENT_ROOT path if the previous fails - $_SERVER['DOCUMENT_ROOT'] = '/var/www'; - } - } - - // Automatic calculation for the following K_PATH_MAIN constant - $k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config')))); - if (substr($k_path_main, -1) != '/') { - $k_path_main .= '/'; - } - - /** - * Installation path (/var/www/tcpdf/). - * By default it is automatically calculated but you can also set it as a fixed string to improve performances. - */ - define ('K_PATH_MAIN', $k_path_main); - - // Automatic calculation for the following K_PATH_URL constant - $k_path_url = $k_path_main; // default value for console mode - if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { - if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') { - $k_path_url = 'https://'; - } else { - $k_path_url = 'http://'; - } - $k_path_url .= $_SERVER['HTTP_HOST']; - $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1))); - } - - /** - * URL path to tcpdf installation folder (http://localhost/tcpdf/). - * By default it is automatically calculated but you can also set it as a fixed string to improve performances. - */ - define ('K_PATH_URL', $k_path_url); - - /** - * path for PDF fonts - * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts - */ - define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); - - /** - * cache directory for temporary files (full path) - */ - define ('K_PATH_CACHE', K_PATH_MAIN.'cache/'); - - /** - * cache directory for temporary files (url path) - */ - define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/'); - - /** - *images directory - */ - define ('K_PATH_IMAGES', K_PATH_MAIN.'images/'); - - /** - * blank image - */ - define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); - - /** - * page format - */ - define ('PDF_PAGE_FORMAT', 'A4'); - - /** - * page orientation (P=portrait, L=landscape) - */ - define ('PDF_PAGE_ORIENTATION', 'P'); - - /** - * document creator - */ - define ('PDF_CREATOR', 'TCPDF'); - - /** - * document author - */ - define ('PDF_AUTHOR', 'TCPDF'); - - /** - * header title - */ - define ('PDF_HEADER_TITLE', 'TCPDF Example'); - - /** - * header description string - */ - define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); - - /** - * image logo - */ - define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); - - /** - * header logo image width [mm] - */ - define ('PDF_HEADER_LOGO_WIDTH', 30); - - /** - * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch] - */ - define ('PDF_UNIT', 'mm'); - - /** - * header margin - */ - define ('PDF_MARGIN_HEADER', 5); - - /** - * footer margin - */ - define ('PDF_MARGIN_FOOTER', 10); - - /** - * top margin - */ - define ('PDF_MARGIN_TOP', 27); - - /** - * bottom margin - */ - define ('PDF_MARGIN_BOTTOM', 25); - - /** - * left margin - */ - define ('PDF_MARGIN_LEFT', 15); - - /** - * right margin - */ - define ('PDF_MARGIN_RIGHT', 15); - - /** - * default main font name - */ - define ('PDF_FONT_NAME_MAIN', 'helvetica'); - - /** - * default main font size - */ - define ('PDF_FONT_SIZE_MAIN', 10); - - /** - * default data font name - */ - define ('PDF_FONT_NAME_DATA', 'helvetica'); - - /** - * default data font size - */ - define ('PDF_FONT_SIZE_DATA', 8); - - /** - * default monospaced font name - */ - define ('PDF_FONT_MONOSPACED', 'courier'); - - /** - * ratio used to adjust the conversion of pixels to user units - */ - define ('PDF_IMAGE_SCALE_RATIO', 1.25); - - /** - * magnification factor for titles - */ - define('HEAD_MAGNIFICATION', 1.1); - - /** - * height of cell repect font height - */ - define('K_CELL_HEIGHT_RATIO', 1.25); - - /** - * title magnification respect main font size - */ - define('K_TITLE_MAGNIFICATION', 1.3); - - /** - * reduction factor for small font - */ - define('K_SMALL_RATIO', 2/3); - - /** - * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language - */ - define('K_THAI_TOPCHARS', true); - - /** - * if true allows to call TCPDF methods using HTML syntax - * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. - */ - define('K_TCPDF_CALLS_IN_HTML', true); -} - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config_alt.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config_alt.php deleted file mode 100644 index b3a91845b5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/config/tcpdf_config_alt.php +++ /dev/null @@ -1,237 +0,0 @@ -<?php -//============================================================+ -// File name : tcpdf_config.php -// Begin : 2004-06-11 -// Last Update : 2010-08-19 -// -// Description : Alternative configuration file for TCPDF. -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com s.r.l. -// Via Della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * Alternative configuration file for TCPDF. - * @author Nicola Asuni - * @copyright 2004-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @package com.tecnick.tcpdf - * @version 4.9.005 - * @link http://tcpdf.sourceforge.net - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2004-10-27 - */ - -// DOCUMENT_ROOT fix for IIS Webserver -if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) { - if(isset($_SERVER['SCRIPT_FILENAME'])) { - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); - } elseif(isset($_SERVER['PATH_TRANSLATED'])) { - $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); - } else { - // define here your DOCUMENT_ROOT path if the previous fails - $_SERVER['DOCUMENT_ROOT'] = '/var/www'; - } -} - -// Automatic calculation for the following K_PATH_MAIN constant -$k_path_main = str_replace( '\\', '/', realpath(substr(dirname(__FILE__), 0, 0-strlen('config')))); -if (substr($k_path_main, -1) != '/') { - $k_path_main .= '/'; -} - -/** - * Installation path (/var/www/tcpdf/). - * By default it is automatically calculated but you can also set it as a fixed string to improve performances. - */ -define ('K_PATH_MAIN', $k_path_main); - -// Automatic calculation for the following K_PATH_URL constant -if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { - if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') { - $k_path_url = 'https://'; - } else { - $k_path_url = 'http://'; - } - $k_path_url .= $_SERVER['HTTP_HOST']; - $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1))); -} - -/** - * URL path to tcpdf installation folder (http://localhost/tcpdf/). - * By default it is automatically calculated but you can also set it as a fixed string to improve performances.. - */ -define ('K_PATH_URL', $k_path_url); - -/** - * path for PDF fonts - * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts - */ -define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); - -/** - * cache directory for temporary files (full path) - */ -define ('K_PATH_CACHE', K_PATH_MAIN.'cache/'); - -/** - * cache directory for temporary files (url path) - */ -define ('K_PATH_URL_CACHE', K_PATH_URL.'cache/'); - -/** - *images directory - */ -define ('K_PATH_IMAGES', K_PATH_MAIN.'images/'); - -/** - * blank image - */ -define ('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png'); - -/** - * page format - */ -define ('PDF_PAGE_FORMAT', 'A4'); - -/** - * page orientation (P=portrait, L=landscape) - */ -define ('PDF_PAGE_ORIENTATION', 'P'); - -/** - * document creator - */ -define ('PDF_CREATOR', 'TCPDF'); - -/** - * document author - */ -define ('PDF_AUTHOR', 'TCPDF'); - -/** - * header title - */ -define ('PDF_HEADER_TITLE', 'TCPDF Example'); - -/** - * header description string - */ -define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); - -/** - * image logo - */ -define ('PDF_HEADER_LOGO', 'tcpdf_logo.jpg'); - -/** - * header logo image width [mm] - */ -define ('PDF_HEADER_LOGO_WIDTH', 30); - -/** - * document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch] - */ -define ('PDF_UNIT', 'mm'); - -/** - * header margin - */ -define ('PDF_MARGIN_HEADER', 5); - -/** - * footer margin - */ -define ('PDF_MARGIN_FOOTER', 10); - -/** - * top margin - */ -define ('PDF_MARGIN_TOP', 27); - -/** - * bottom margin - */ -define ('PDF_MARGIN_BOTTOM', 25); - -/** - * left margin - */ -define ('PDF_MARGIN_LEFT', 15); - -/** - * right margin - */ -define ('PDF_MARGIN_RIGHT', 15); - -/** - * default main font name - */ -define ('PDF_FONT_NAME_MAIN', 'helvetica'); - -/** - * default main font size - */ -define ('PDF_FONT_SIZE_MAIN', 10); - -/** - * default data font name - */ -define ('PDF_FONT_NAME_DATA', 'helvetica'); - -/** - * default data font size - */ -define ('PDF_FONT_SIZE_DATA', 8); - -/** - * default monospaced font name - */ -define ('PDF_FONT_MONOSPACED', 'courier'); - -/** - * ratio used to adjust the conversion of pixels to user units - */ -define ('PDF_IMAGE_SCALE_RATIO', 1.25); - -/** - * magnification factor for titles - */ -define('HEAD_MAGNIFICATION', 1.1); - -/** - * height of cell repect font height - */ -define('K_CELL_HEIGHT_RATIO', 1.25); - -/** - * title magnification respect main font size - */ -define('K_TITLE_MAGNIFICATION', 1.3); - -/** - * reduction factor for small font - */ -define('K_SMALL_RATIO', 2/3); - -/** - * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language - */ -define('K_THAI_TOPCHARS', true); - -/** - * if true allows to call TCPDF methods using HTML syntax - * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. - */ -define('K_TCPDF_CALLS_IN_HTML', true); - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/README.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/README.TXT deleted file mode 100644 index c27086f285..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/README.TXT +++ /dev/null @@ -1,3 +0,0 @@ -This folder contains fonts descriptions for TCPDF. -All fonts names must be in lowercase. -Please read the documentation on subfolders for copyright, license and other information. \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.ctg.z deleted file mode 100644 index e096e5cc35..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.z deleted file mode 100644 index 41df8dab10..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/ZarBold.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.ctg.z deleted file mode 100644 index 8e9b577e4e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.php deleted file mode 100644 index 74114c8ceb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='AlMohanad'; -$desc=array('Ascent'=>1093,'Descent'=>-509,'CapHeight'=>1093,'Flags'=>32,'FontBBox'=>'[-278 -507 1124 1093]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-136; -$ut=64; -$dw=600; -$cw=array( - 0=>0,32=>139,33=>185,34=>308,35=>278,36=>278,37=>556,38=>463,39=>154,40=>185,41=>185,42=>278,43=>317,44=>139,45=>185,46=>139, - 47=>154,48=>278,49=>278,50=>278,51=>278,52=>278,53=>278,54=>278,55=>278,56=>278,57=>278,58=>185,59=>185,60=>317,61=>317,62=>317, - 63=>278,64=>517,65=>401,66=>371,67=>401,68=>402,69=>371,70=>339,71=>432,72=>430,73=>214,74=>278,75=>424,76=>369,77=>524,78=>401, - 79=>432,80=>339,81=>432,82=>396,83=>309,84=>371,85=>401,86=>401,87=>556,88=>401,89=>401,90=>371,91=>185,92=>154,93=>185,94=>323, - 95=>278,96=>185,97=>278,98=>309,99=>247,100=>309,101=>247,102=>185,103=>278,104=>309,105=>154,106=>185,107=>309,108=>154,109=>463,110=>309, - 111=>278,112=>309,113=>309,114=>247,115=>216,116=>185,117=>309,118=>278,119=>401,120=>278,121=>278,122=>247,123=>219,124=>122,125=>219,126=>289, - 8364=>278,1027=>339,8218=>185,1107=>254,8222=>278,8230=>556,8224=>278,8225=>278,710=>185,8240=>556,352=>309,8249=>185,338=>556,1036=>432,381=>371,1039=>432, - 8216=>185,8217=>185,8220=>278,8221=>278,8226=>194,8211=>278,8212=>556,732=>185,8482=>556,353=>216,8250=>185,339=>401,1116=>297,382=>247,376=>401,161=>185, - 162=>278,163=>278,164=>278,165=>278,166=>122,167=>278,168=>185,169=>415,170=>167,171=>278,172=>317,174=>415,175=>185,176=>222,177=>317,178=>167, - 179=>167,180=>185,181=>309,182=>300,183=>139,184=>185,185=>167,186=>183,187=>278,188=>417,189=>417,190=>417,191=>278,192=>401,193=>401,194=>401, - 195=>401,196=>401,197=>401,198=>556,199=>401,200=>371,201=>371,202=>371,203=>371,204=>216,205=>216,206=>216,207=>216,208=>401,209=>401,210=>432, - 211=>432,212=>432,213=>432,214=>432,215=>317,216=>432,217=>401,218=>401,219=>401,220=>401,221=>401,222=>339,223=>309,224=>278,225=>278,226=>278, - 227=>278,228=>278,229=>278,230=>401,231=>247,232=>247,233=>247,234=>247,235=>247,236=>154,237=>154,238=>154,239=>154,240=>278,241=>309,242=>278, - 243=>278,244=>278,245=>278,246=>278,247=>317,248=>278,249=>309,250=>309,251=>309,252=>309,253=>278,254=>309,255=>278,256=>401,257=>278,258=>401, - 259=>278,260=>401,261=>278,262=>401,263=>247,264=>401,265=>247,266=>401,267=>247,268=>401,269=>247,270=>401,271=>309,272=>401,273=>309,274=>371, - 275=>247,276=>371,277=>247,278=>371,279=>247,280=>371,281=>247,282=>371,283=>247,284=>432,285=>278,286=>432,287=>278,288=>432,289=>278,290=>432, - 291=>278,292=>432,293=>309,294=>432,295=>309,296=>216,297=>154,298=>216,299=>154,300=>216,301=>154,302=>216,303=>154,304=>216,305=>154,306=>490, - 307=>270,308=>278,309=>185,310=>432,311=>309,312=>297,313=>371,314=>154,315=>371,316=>154,317=>371,318=>154,319=>371,320=>293,321=>371,322=>154, - 323=>401,324=>309,325=>401,326=>309,327=>401,328=>309,329=>391,330=>401,331=>309,332=>432,333=>278,334=>432,335=>278,336=>432,337=>278,340=>401, - 341=>247,342=>401,343=>247,344=>401,345=>247,346=>309,347=>216,348=>309,349=>216,350=>309,351=>216,354=>371,355=>185,356=>371,357=>185,358=>371, - 359=>185,360=>401,361=>309,362=>401,363=>309,364=>401,365=>309,366=>401,367=>309,368=>401,369=>309,370=>401,371=>309,372=>556,373=>401,374=>401, - 375=>278,377=>371,378=>247,379=>371,380=>247,383=>185,450=>317,477=>247,484=>432,485=>278,536=>309,537=>216,538=>371,539=>185,658=>282,711=>185, - 728=>185,729=>185,730=>185,731=>185,733=>185,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, - 779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0, - 795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0, - 811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0, - 827=>0,828=>0,829=>0,830=>0,831=>0,864=>0,865=>0,884=>111,885=>111,890=>0,894=>185,900=>100,901=>183,902=>401,903=>139,904=>451, - 905=>532,906=>316,908=>451,910=>501,911=>451,912=>183,913=>401,914=>371,915=>339,916=>422,917=>371,918=>371,919=>432,920=>432,921=>216,922=>432, - 923=>401,924=>524,925=>401,926=>361,927=>432,928=>451,929=>339,931=>361,932=>371,933=>401,934=>482,935=>401,936=>482,937=>451,938=>0,939=>401, - 940=>336,941=>244,942=>336,943=>183,944=>306,945=>336,946=>306,947=>306,948=>306,949=>244,950=>275,951=>336,952=>306,953=>183,954=>338,955=>275, - 956=>336,957=>275,958=>275,959=>306,960=>336,961=>306,962=>244,963=>306,964=>244,965=>306,966=>367,967=>275,968=>397,969=>397,970=>183,971=>306, - 972=>306,973=>306,974=>397,976=>306,977=>306,978=>401,979=>401,980=>401,981=>367,982=>336,986=>283,987=>237,988=>339,989=>261,1024=>371,1025=>371, - 1026=>371,1028=>401,1029=>309,1030=>216,1031=>216,1032=>278,1033=>573,1034=>573,1035=>449,1037=>432,1038=>401,1040=>401,1041=>371,1042=>371,1043=>328,1044=>432, - 1045=>371,1046=>615,1047=>313,1048=>429,1049=>429,1050=>424,1051=>432,1052=>524,1053=>432,1054=>432,1055=>430,1056=>339,1057=>401,1058=>371,1059=>401,1060=>444, - 1061=>401,1062=>429,1063=>432,1064=>618,1065=>618,1066=>482,1067=>539,1068=>350,1069=>401,1070=>619,1071=>408,1072=>278,1073=>278,1074=>279,1075=>246,1076=>309, - 1077=>247,1078=>417,1079=>227,1080=>319,1081=>319,1082=>297,1083=>302,1084=>376,1085=>309,1086=>278,1087=>309,1088=>309,1089=>247,1090=>274,1091=>278,1092=>458, - 1093=>278,1094=>309,1095=>309,1096=>454,1097=>454,1098=>340,1099=>423,1100=>284,1101=>247,1102=>439,1103=>284,1104=>247,1105=>247,1106=>309,1108=>247,1109=>216, - 1110=>154,1111=>154,1112=>185,1113=>440,1114=>437,1115=>309,1117=>309,1118=>278,1119=>309,1164=>339,1165=>284,1166=>339,1167=>309,1168=>339,1169=>254,1170=>339, - 1171=>254,1172=>339,1173=>254,1174=>615,1175=>417,1176=>322,1177=>216,1178=>432,1179=>297,1180=>432,1181=>297,1182=>432,1183=>297,1184=>537,1185=>352,1186=>432, - 1187=>309,1188=>563,1189=>408,1190=>432,1191=>461,1192=>401,1193=>247,1194=>401,1195=>247,1196=>371,1197=>274,1198=>401,1199=>278,1200=>401,1201=>278,1202=>401, - 1203=>278,1204=>581,1205=>432,1206=>432,1207=>309,1208=>432,1209=>309,1210=>432,1211=>309,1212=>367,1213=>247,1214=>367,1215=>247,1216=>216,1217=>615,1218=>417, - 1219=>432,1220=>297,1223=>432,1224=>309,1227=>432,1228=>309,1232=>401,1233=>278,1234=>401,1235=>278,1236=>556,1237=>401,1238=>371,1239=>247,1240=>367,1241=>247, - 1242=>367,1243=>247,1244=>615,1245=>417,1246=>313,1247=>227,1248=>322,1249=>216,1250=>432,1251=>309,1252=>432,1253=>309,1254=>432,1255=>278,1256=>432,1257=>278, - 1258=>432,1259=>278,1260=>401,1261=>247,1262=>401,1263=>278,1264=>401,1265=>278,1266=>401,1267=>278,1268=>432,1269=>309,1272=>548,1273=>423,1488=>280,1489=>280, - 1490=>174,1491=>280,1492=>280,1493=>158,1494=>158,1495=>280,1496=>280,1497=>158,1498=>287,1499=>280,1500=>280,1501=>280,1502=>280,1503=>156,1504=>158,1505=>280, - 1506=>280,1507=>292,1508=>280,1509=>273,1510=>280,1511=>305,1512=>285,1513=>299,1514=>280,1548=>195,1563=>246,1567=>340,1569=>392,1570=>306,1571=>247,1572=>447, - 1573=>247,1574=>602,1575=>192,1576=>635,1577=>369,1578=>635,1579=>635,1580=>548,1581=>1173,1582=>548,1583=>363,1584=>363,1585=>439,1586=>442,1587=>875,1588=>875, - 1589=>1061,1590=>1061,1591=>811,1592=>811,1593=>549,1594=>547,1600=>389,1601=>755,1602=>574,1603=>717,1604=>555,1605=>423,1606=>532,1607=>371,1608=>454,1609=>633, - 1610=>643,1611=>-19,1612=>-26,1613=>-20,1614=>-19,1615=>-18,1616=>-19,1617=>-19,1618=>-15,1632=>383,1633=>383,1634=>383,1635=>383,1636=>383,1637=>383,1638=>383, - 1639=>383,1640=>383,1641=>383,1642=>383,1645=>398,7936=>336,7937=>336,7938=>336,7939=>336,7940=>336,7941=>336,7942=>336,7943=>336,7944=>401,7945=>401,7946=>401, - 7947=>401,7948=>401,7949=>401,7950=>401,7951=>401,7952=>244,7953=>244,7954=>244,7955=>244,7956=>244,7957=>244,7960=>371,7961=>371,7962=>371,7963=>371,7964=>371, - 7965=>371,7968=>336,7969=>336,7970=>336,7971=>336,7972=>336,7973=>336,7974=>336,7975=>336,7976=>432,7977=>432,7978=>432,7979=>432,7980=>432,7981=>432,7982=>432, - 7983=>432,7984=>183,7985=>183,7986=>183,7987=>183,7988=>183,7989=>183,7990=>183,7991=>183,7992=>216,7993=>216,7994=>216,7995=>216,7996=>216,7997=>216,7998=>216, - 7999=>216,8000=>306,8001=>306,8002=>306,8003=>306,8004=>306,8005=>306,8008=>432,8009=>432,8010=>432,8011=>432,8012=>432,8013=>432,8016=>306,8017=>306,8018=>306, - 8019=>306,8020=>306,8021=>306,8022=>306,8023=>306,8025=>401,8027=>401,8029=>401,8031=>401,8032=>397,8033=>397,8034=>397,8035=>397,8036=>397,8037=>397,8038=>397, - 8039=>397,8040=>451,8041=>451,8042=>451,8043=>451,8044=>451,8045=>451,8046=>451,8047=>451,8048=>336,8049=>336,8050=>244,8051=>244,8052=>336,8053=>336,8054=>183, - 8055=>183,8056=>306,8057=>306,8058=>306,8059=>306,8060=>397,8061=>397,8064=>336,8065=>336,8066=>336,8067=>336,8068=>336,8069=>336,8070=>336,8071=>336,8072=>401, - 8073=>401,8074=>401,8075=>401,8076=>401,8077=>401,8078=>401,8079=>401,8080=>336,8081=>336,8082=>336,8083=>336,8084=>336,8085=>336,8086=>336,8087=>336,8088=>432, - 8089=>432,8090=>432,8091=>432,8092=>432,8093=>432,8094=>432,8095=>432,8096=>397,8097=>397,8098=>397,8099=>397,8100=>397,8101=>397,8102=>397,8103=>397,8104=>451, - 8105=>451,8106=>451,8107=>451,8108=>451,8109=>451,8110=>451,8111=>451,8112=>336,8113=>336,8114=>336,8115=>336,8116=>336,8118=>336,8119=>336,8120=>401,8121=>401, - 8122=>401,8123=>401,8124=>401,8125=>278,8126=>0,8127=>278,8128=>278,8129=>306,8130=>336,8131=>336,8132=>336,8134=>336,8135=>336,8136=>371,8137=>371,8138=>432, - 8139=>432,8140=>432,8141=>278,8142=>278,8143=>278,8144=>183,8145=>183,8146=>183,8147=>183,8150=>183,8151=>183,8152=>216,8153=>216,8154=>216,8155=>216,8157=>278, - 8158=>278,8159=>278,8160=>306,8161=>306,8162=>306,8163=>306,8164=>306,8165=>306,8166=>306,8167=>306,8168=>401,8169=>401,8170=>401,8171=>401,8172=>339,8173=>306, - 8174=>306,8175=>278,8178=>397,8179=>397,8180=>397,8182=>397,8183=>397,8184=>432,8185=>432,8186=>451,8187=>451,8188=>451,8189=>278,8190=>278,8208=>185,8209=>185, - 8219=>185,8223=>278,8227=>311,8241=>1011,8248=>261,8251=>404,8253=>386,8255=>529,8256=>529,8257=>188,8258=>517,8259=>185,8260=>93,8261=>184,8262=>184,8267=>300, - 8308=>167,8309=>556,8321=>167,8322=>167,8323=>167,8324=>167,8352=>394,8353=>401,8354=>435,8355=>339,8356=>278,8357=>463,8358=>401,8359=>389,8361=>556,8470=>530, - 8471=>415,8479=>401,8483=>401,8486=>451,8487=>451,8494=>306,8498=>339,8543=>417,8706=>274,8710=>340,8721=>396,8722=>317,8730=>305,8734=>418,8800=>317,8804=>317, - 8805=>317,9674=>274,12353=>556,12354=>556,12355=>556,12356=>556,12357=>556,12358=>556,12359=>556,12360=>556,12361=>556,12362=>556,12363=>556,12364=>556,12365=>556,12366=>556, - 12367=>556,12368=>556,12369=>556,12370=>556,12371=>556,12372=>556,12373=>556,12374=>556,12375=>556,12376=>556,12377=>556,12378=>556,12379=>556,12380=>556,12381=>556,12382=>556, - 12383=>556,12384=>556,12385=>556,12386=>556,12387=>556,12388=>556,12389=>556,12390=>556,12391=>556,12392=>556,12393=>556,12394=>556,12395=>556,12396=>556,12397=>556,12398=>556, - 12399=>556,12400=>556,12401=>556,12402=>556,12403=>556,12404=>556,12405=>556,12406=>556,12407=>556,12408=>556,12409=>556,12410=>556,12411=>556,12412=>556,12413=>556,12414=>556, - 12415=>556,12416=>556,12417=>556,12418=>556,12419=>556,12420=>556,12421=>556,12422=>556,12423=>556,12424=>556,12425=>556,12426=>556,12427=>556,12428=>556,12429=>556,12430=>556, - 12431=>556,12432=>556,12433=>556,12434=>556,12435=>556,12449=>556,12450=>556,12451=>556,12452=>556,12453=>556,12454=>556,12455=>556,12456=>556,12457=>556,12458=>556,12459=>556, - 12460=>556,12461=>556,12462=>556,12463=>556,12464=>556,12465=>556,12466=>556,12467=>556,12468=>556,12469=>556,12470=>556,12471=>556,12472=>556,12473=>556,12474=>556,12475=>556, - 12476=>556,12477=>556,12478=>556,12479=>556,12480=>556,12481=>556,12482=>556,12483=>556,12484=>556,12485=>556,12486=>556,12487=>556,12488=>556,12489=>556,12490=>556,12491=>556, - 12492=>556,12493=>556,12494=>556,12495=>556,12496=>556,12497=>556,12498=>556,12499=>556,12500=>556,12501=>556,12502=>556,12503=>556,12504=>556,12505=>556,12506=>556,12507=>556, - 12508=>556,12509=>556,12510=>556,12511=>556,12512=>556,12513=>556,12514=>556,12515=>556,12516=>556,12517=>556,12518=>556,12519=>556,12520=>556,12521=>556,12522=>556,12523=>556, - 12524=>556,12525=>556,12526=>556,12527=>556,12528=>556,12529=>556,12530=>556,12531=>556,12532=>556,12533=>556,12534=>556,63033=>278,63034=>278,63035=>278,63036=>278,63037=>278, - 63038=>278,63039=>278,63040=>278,63041=>278,63171=>185,63196=>278,64256=>309,64257=>309,64258=>309,64259=>463,64260=>463,64262=>402,64606=>0,64607=>0,64608=>0,64609=>0, - 64610=>0,64830=>467,64831=>467,65010=>814,65152=>392,65153=>306,65154=>281,65155=>247,65156=>250,65157=>447,65158=>412,65159=>247,65160=>222,65161=>602,65162=>535,65163=>360, - 65164=>329,65165=>192,65166=>220,65167=>635,65168=>644,65169=>338,65170=>321,65171=>369,65172=>419,65173=>635,65174=>644,65175=>345,65176=>336,65177=>635,65178=>644,65179=>393, - 65180=>345,65181=>548,65182=>553,65183=>637,65184=>652,65185=>548,65186=>546,65187=>637,65188=>656,65189=>548,65190=>544,65191=>637,65192=>656,65193=>363,65194=>439,65195=>363, - 65196=>439,65197=>440,65198=>471,65199=>439,65200=>474,65201=>875,65202=>871,65203=>608,65204=>588,65205=>875,65206=>871,65207=>609,65208=>587,65209=>1061,65210=>1033,65211=>794, - 65212=>758,65213=>1061,65214=>1033,65215=>794,65216=>761,65217=>811,65218=>793,65219=>659,65220=>647,65221=>811,65222=>793,65223=>659,65224=>642,65225=>549,65226=>481,65227=>512, - 65228=>409,65229=>547,65230=>476,65231=>512,65232=>409,65233=>755,65234=>748,65235=>416,65236=>442,65237=>574,65238=>550,65239=>416,65240=>442,65241=>717,65242=>687,65243=>883, - 65244=>409,65245=>555,65246=>511,65247=>338,65248=>297,65249=>423,65250=>478,65251=>489,65252=>476,65253=>532,65254=>548,65255=>336,65256=>326,65257=>371,65258=>391,65259=>524, - 65260=>412,65261=>454,65262=>412,65263=>633,65264=>566,65265=>643,65266=>560,65267=>357,65268=>333,65269=>623,65270=>617,65271=>603,65272=>621,65273=>576,65274=>617,65275=>576, - 65276=>625); -$enc=''; -$diff=''; -$file='almohanad.z'; -$ctg='almohanad.ctg.z'; -$originalsize=227760; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.z deleted file mode 100644 index 27426a68f0..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/almohanad.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-simplified.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-simplified.php deleted file mode 100644 index 5a0ede4cd1..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-simplified.php +++ /dev/null @@ -1,1768 +0,0 @@ -<?php -$type='cidfont0'; -$name='ArialUnicodeMS'; -$desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-100; -$ut=50; -$dw=1000; -$cw=array( - 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, - 48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556, - 64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, - 80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>500, - 96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, - 112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,8364=>556, - 1027=>567,8218=>222,402=>278,8222=>333,8230=>1000,8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,1036=>584,381=>611,1039=>723,8216=>222, - 8217=>222,8220=>333,8221=>333,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>500,8250=>333,339=>944,1116=>437,382=>500,376=>667,160=>278,161=>333, - 162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>500,176=>400,177=>584, - 178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667, - 194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722, - 210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, - 226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556, - 242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, - 258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500,268=>722,269=>500,270=>722,271=>627,272=>722,273=>556, - 274=>667,275=>556,276=>667,277=>556,278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556,288=>778,289=>556, - 290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>222,298=>278,299=>222,300=>278,301=>222,302=>278,303=>222,304=>278,305=>278, - 306=>751,307=>444,308=>500,309=>222,310=>667,311=>500,312=>437,313=>556,314=>222,315=>556,316=>222,317=>556,318=>222,319=>556,320=>318,321=>556, - 322=>222,323=>722,324=>556,325=>722,326=>556,327=>722,328=>556,329=>626,330=>723,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, - 340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500,350=>667,351=>500,354=>611,355=>278,356=>611,357=>406, - 358=>611,359=>278,360=>722,361=>556,362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556,372=>944,373=>722, - 374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>222,384=>556,385=>740,386=>655,387=>556,388=>556,389=>556,390=>722,391=>766,392=>579, - 393=>722,394=>789,395=>655,396=>556,397=>557,398=>667,399=>729,400=>604,401=>611,403=>791,404=>649,405=>806,406=>245,407=>322,408=>667,409=>500, - 410=>322,411=>500,412=>833,413=>722,414=>556,415=>778,416=>776,417=>556,418=>1019,419=>782,420=>735,421=>556,422=>722,423=>667,424=>500,425=>602, - 426=>366,427=>278,428=>571,429=>278,430=>611,431=>776,432=>620,433=>748,434=>667,435=>752,436=>615,437=>611,438=>500,439=>628,440=>628,441=>526, - 442=>480,443=>556,444=>556,445=>526,446=>556,447=>556,448=>278,449=>464,450=>474,451=>278,452=>1333,453=>1222,454=>1056,455=>1030,456=>778,457=>444, - 458=>1222,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722, - 474=>556,475=>722,476=>556,477=>556,478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556,488=>667,489=>500, - 490=>778,491=>556,492=>778,493=>556,494=>534,495=>534,496=>222,497=>1333,498=>1222,499=>1056,500=>778,501=>556,506=>667,507=>556,508=>1000,509=>889, - 510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667,519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556, - 526=>778,527=>556,528=>722,529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500, - 598=>556,599=>556,600=>556,601=>556,602=>777,603=>485,604=>485,605=>686,606=>519,607=>260,608=>556,609=>556,610=>557,611=>500,612=>500,613=>556, - 614=>556,615=>556,616=>242,617=>282,618=>356,619=>356,620=>425,621=>222,622=>635,623=>833,624=>833,625=>833,626=>556,627=>556,628=>558,629=>556, - 630=>715,631=>674,632=>558,633=>333,634=>333,635=>333,636=>333,637=>333,638=>312,639=>312,640=>530,641=>530,642=>500,643=>216,644=>276,645=>216, - 646=>222,647=>278,648=>278,649=>596,650=>558,651=>556,652=>500,653=>722,654=>500,655=>500,656=>500,657=>564,658=>530,659=>530,660=>464,661=>464, - 662=>464,663=>500,664=>614,665=>526,666=>519,667=>557,668=>558,669=>222,670=>500,671=>416,672=>556,673=>464,674=>464,675=>966,676=>966,677=>1030, - 678=>689,679=>484,680=>718,688=>326,689=>326,690=>153,691=>201,692=>201,693=>201,694=>304,695=>389,696=>278,697=>222,698=>372,699=>222,700=>222, - 701=>222,702=>222,703=>222,704=>250,705=>250,706=>320,707=>320,708=>320,709=>320,711=>333,712=>192,713=>333,714=>333,715=>333,716=>192,717=>333, - 718=>333,719=>333,720=>300,721=>300,722=>222,723=>222,724=>340,725=>340,726=>280,727=>362,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, - 736=>278,737=>153,738=>270,739=>274,740=>325,741=>360,742=>360,743=>360,744=>360,745=>360,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, - 774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0, - 790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0, - 806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, - 822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, - 864=>0,865=>0,884=>308,885=>308,890=>278,894=>278,900=>278,901=>278,902=>667,903=>278,904=>704,905=>759,906=>315,908=>778,910=>746,911=>758, - 912=>222,913=>667,914=>667,915=>550,916=>682,917=>667,918=>611,919=>722,920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>650,927=>778, - 928=>722,929=>667,931=>602,932=>611,933=>667,934=>808,935=>667,936=>804,937=>758,938=>278,939=>667,940=>576,941=>434,942=>556,943=>222,944=>551, - 945=>576,946=>563,947=>500,948=>557,949=>434,950=>440,951=>556,952=>556,953=>222,954=>498,955=>500,956=>553,957=>500,958=>432,959=>556,960=>678, - 961=>571,962=>472,963=>619,964=>382,965=>551,966=>649,967=>522,968=>729,969=>766,970=>222,971=>551,972=>556,973=>551,974=>766,976=>563,977=>616, - 978=>631,979=>726,980=>631,981=>644,982=>781,986=>722,988=>578,990=>570,992=>692,994=>880,995=>833,996=>684,997=>558,998=>680,999=>529,1000=>557, - 1001=>505,1002=>623,1003=>603,1004=>610,1005=>611,1006=>568,1007=>434,1008=>600,1009=>571,1010=>500,1011=>222,1025=>667,1026=>865,1028=>717,1029=>667,1030=>278, - 1031=>278,1032=>500,1033=>1105,1034=>1009,1035=>867,1038=>635,1040=>667,1041=>655,1042=>667,1043=>567,1044=>677,1045=>667,1046=>923,1047=>604,1048=>722,1049=>722, - 1050=>584,1051=>705,1052=>833,1053=>722,1054=>778,1055=>723,1056=>667,1057=>722,1058=>611,1059=>635,1060=>760,1061=>667,1062=>740,1063=>684,1064=>920,1065=>939, - 1066=>793,1067=>883,1068=>655,1069=>717,1070=>1006,1071=>722,1072=>556,1073=>573,1074=>531,1075=>383,1076=>583,1077=>556,1078=>669,1079=>458,1080=>559,1081=>559, - 1082=>437,1083=>571,1084=>683,1085=>552,1086=>556,1087=>542,1088=>556,1089=>500,1090=>458,1091=>500,1092=>823,1093=>500,1094=>562,1095=>533,1096=>802,1097=>823, - 1098=>620,1099=>717,1100=>523,1101=>510,1102=>744,1103=>542,1105=>556,1106=>556,1107=>383,1108=>510,1109=>500,1110=>222,1111=>278,1112=>222,1113=>873,1114=>811, - 1115=>556,1118=>500,1119=>542,1120=>976,1121=>766,1122=>656,1123=>521,1124=>950,1125=>694,1126=>667,1127=>597,1128=>952,1129=>817,1130=>654,1131=>600,1132=>932, - 1133=>817,1134=>604,1135=>458,1136=>804,1137=>729,1138=>778,1139=>556,1140=>667,1141=>500,1142=>667,1143=>500,1144=>1279,1145=>1060,1146=>778,1147=>556,1148=>976, - 1149=>766,1150=>976,1151=>766,1152=>722,1153=>514,1154=>686,1155=>334,1156=>382,1157=>334,1158=>334,1168=>435,1169=>339,1170=>567,1171=>383,1172=>656,1173=>556, - 1174=>923,1175=>669,1176=>604,1177=>458,1178=>584,1179=>437,1180=>584,1181=>437,1182=>584,1183=>437,1184=>764,1185=>537,1186=>741,1187=>573,1188=>900,1189=>670, - 1190=>736,1191=>560,1192=>778,1193=>560,1194=>722,1195=>500,1196=>611,1197=>458,1198=>667,1199=>500,1200=>667,1201=>500,1202=>667,1203=>500,1204=>916,1205=>661, - 1206=>684,1207=>533,1208=>684,1209=>533,1210=>684,1211=>556,1212=>829,1213=>667,1214=>829,1215=>667,1216=>278,1217=>923,1218=>669,1219=>584,1220=>437,1223=>735, - 1224=>570,1227=>684,1228=>533,1232=>667,1233=>556,1234=>667,1235=>556,1236=>1000,1237=>889,1238=>667,1239=>556,1240=>729,1241=>556,1242=>729,1243=>556,1244=>923, - 1245=>669,1246=>604,1247=>458,1248=>604,1249=>492,1250=>722,1251=>559,1252=>722,1253=>559,1254=>778,1255=>556,1256=>778,1257=>556,1258=>778,1259=>556,1262=>635, - 1263=>500,1264=>635,1265=>500,1266=>635,1267=>500,1268=>684,1269=>533,1272=>883,1273=>717,1329=>635,1330=>531,1331=>583,1332=>583,1333=>531,1334=>531,1335=>427, - 1336=>531,1337=>750,1338=>635,1339=>531,1340=>375,1341=>583,1342=>698,1343=>531,1344=>427,1345=>531,1346=>583,1347=>531,1348=>635,1349=>698,1350=>635,1351=>635, - 1352=>531,1353=>531,1354=>698,1355=>531,1356=>635,1357=>531,1358=>698,1359=>583,1360=>479,1361=>583,1362=>531,1363=>698,1364=>698,1365=>635,1366=>750,1369=>271, - 1370=>271,1371=>150,1372=>300,1373=>271,1374=>271,1375=>420,1377=>583,1378=>427,1379=>427,1380=>427,1381=>427,1382=>427,1383=>427,1384=>427,1385=>459,1386=>427, - 1387=>427,1388=>323,1389=>531,1390=>427,1391=>427,1392=>427,1393=>427,1394=>427,1395=>427,1396=>427,1397=>271,1398=>427,1399=>375,1400=>427,1401=>375,1402=>583, - 1403=>427,1404=>427,1405=>427,1406=>427,1407=>583,1408=>427,1409=>427,1410=>323,1411=>583,1412=>375,1413=>375,1414=>583,1415=>527,1417=>271,1425=>360,1426=>360, - 1427=>360,1428=>360,1429=>360,1430=>360,1431=>360,1432=>360,1433=>360,1434=>360,1435=>360,1436=>360,1437=>360,1438=>360,1439=>360,1440=>360,1441=>360,1443=>360, - 1444=>360,1445=>360,1446=>360,1447=>360,1448=>360,1449=>360,1450=>360,1451=>360,1452=>360,1453=>360,1454=>360,1455=>360,1456=>360,1457=>360,1458=>360,1459=>360, - 1460=>360,1461=>360,1462=>360,1463=>360,1464=>360,1465=>360,1467=>360,1468=>360,1469=>360,1470=>366,1471=>360,1472=>225,1473=>360,1474=>360,1475=>238,1476=>360, - 1488=>577,1489=>563,1490=>411,1491=>512,1492=>594,1493=>316,1494=>326,1495=>594,1496=>594,1497=>316,1498=>507,1499=>527,1500=>484,1501=>594,1502=>594,1503=>316, - 1504=>338,1505=>604,1506=>550,1507=>567,1508=>569,1509=>505,1510=>514,1511=>583,1512=>507,1513=>700,1514=>633,1520=>590,1521=>590,1522=>590,1523=>216,1524=>412, - 1548=>278,1563=>278,1567=>556,1569=>529,1570=>243,1571=>243,1572=>470,1573=>243,1574=>731,1575=>243,1576=>771,1577=>514,1578=>771,1579=>771,1580=>544,1581=>544, - 1582=>544,1583=>430,1584=>430,1585=>421,1586=>421,1587=>1194,1588=>1194,1589=>1291,1590=>1291,1591=>843,1592=>843,1593=>594,1594=>594,1600=>279,1601=>957,1602=>800, - 1603=>757,1604=>662,1605=>589,1606=>692,1607=>514,1608=>470,1609=>731,1610=>731,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0, - 1632=>480,1633=>480,1634=>480,1635=>480,1636=>480,1637=>480,1638=>480,1639=>480,1640=>480,1641=>480,1642=>547,1643=>278,1644=>278,1645=>438,1648=>0,1649=>243, - 1650=>243,1651=>243,1652=>0,1653=>380,1654=>470,1655=>548,1656=>772,1657=>771,1658=>771,1659=>771,1660=>771,1661=>771,1662=>771,1663=>771,1664=>771,1665=>544, - 1666=>544,1667=>544,1668=>544,1669=>544,1670=>544,1671=>544,1672=>430,1673=>430,1674=>430,1675=>430,1676=>430,1677=>430,1678=>430,1679=>430,1680=>430,1681=>421, - 1682=>421,1683=>421,1684=>421,1685=>421,1686=>419,1687=>421,1688=>421,1689=>421,1690=>1194,1691=>1194,1692=>1194,1693=>1291,1694=>1291,1695=>843,1696=>594,1697=>957, - 1698=>957,1699=>957,1700=>957,1701=>957,1702=>957,1703=>800,1704=>800,1705=>828,1706=>1058,1707=>828,1708=>757,1709=>757,1710=>757,1711=>828,1712=>828,1713=>828, - 1714=>828,1715=>828,1716=>828,1717=>662,1718=>662,1719=>662,1722=>692,1723=>692,1724=>692,1725=>692,1726=>706,1728=>514,1729=>509,1730=>509,1731=>509,1732=>470, - 1733=>470,1734=>470,1735=>470,1736=>470,1737=>470,1738=>470,1739=>470,1740=>731,1741=>841,1742=>731,1744=>731,1745=>731,1746=>550,1747=>550,1748=>279,1749=>514, - 1750=>726,1751=>558,1752=>321,1753=>318,1754=>342,1755=>373,1756=>716,1757=>688,1758=>852,1759=>288,1760=>288,1761=>388,1762=>350,1763=>716,1764=>146,1765=>282, - 1766=>339,1767=>339,1768=>415,1769=>514,1770=>220,1771=>220,1772=>220,1773=>350,1776=>480,1777=>480,1778=>480,1779=>480,1780=>480,1781=>480,1782=>480,1783=>480, - 1784=>480,1785=>480,2305=>0,2306=>0,2307=>294,2309=>693,2310=>910,2311=>533,2312=>533,2313=>590,2314=>713,2315=>920,2316=>677,2317=>611,2318=>611,2319=>611, - 2320=>611,2321=>910,2322=>910,2323=>910,2324=>910,2325=>667,2326=>732,2327=>593,2328=>639,2329=>624,2330=>688,2331=>713,2332=>688,2333=>712,2334=>697,2335=>502, - 2336=>533,2337=>583,2338=>523,2339=>693,2340=>585,2341=>638,2342=>533,2343=>640,2344=>585,2345=>585,2346=>565,2347=>699,2348=>592,2349=>689,2350=>633,2351=>600, - 2352=>486,2353=>486,2354=>680,2355=>730,2356=>730,2357=>592,2358=>684,2359=>608,2360=>646,2361=>546,2364=>0,2365=>373,2366=>319,2367=>319,2368=>319,2369=>0, - 2370=>0,2371=>0,2372=>0,2373=>0,2374=>0,2375=>0,2376=>0,2377=>319,2378=>319,2379=>319,2380=>319,2381=>0,2384=>884,2385=>0,2386=>0,2387=>0, - 2388=>0,2392=>667,2393=>732,2394=>593,2395=>688,2396=>583,2397=>523,2398=>699,2399=>600,2400=>920,2401=>677,2402=>0,2403=>0,2404=>331,2405=>513,2406=>639, - 2407=>639,2408=>639,2409=>639,2410=>639,2411=>639,2412=>639,2413=>639,2414=>639,2415=>639,2416=>362,2433=>0,2434=>430,2435=>430,2437=>786,2438=>1030,2439=>582, - 2440=>603,2441=>648,2442=>757,2443=>758,2444=>630,2447=>685,2448=>746,2451=>711,2452=>776,2453=>779,2454=>655,2455=>606,2456=>645,2457=>661,2458=>554,2459=>585, - 2460=>729,2461=>752,2462=>893,2463=>567,2464=>625,2465=>648,2466=>567,2467=>598,2468=>680,2469=>645,2470=>609,2471=>596,2472=>595,2474=>635,2475=>780,2476=>593, - 2477=>677,2478=>621,2479=>601,2480=>593,2482=>640,2486=>598,2487=>596,2488=>637,2489=>582,2492=>0,2494=>245,2495=>245,2496=>245,2497=>0,2498=>0,2499=>0, - 2500=>0,2503=>309,2504=>309,2507=>932,2508=>932,2509=>0,2519=>245,2524=>648,2525=>553,2527=>596,2528=>758,2529=>630,2530=>0,2531=>335,2534=>610,2535=>559, - 2536=>595,2537=>711,2538=>610,2539=>661,2540=>661,2541=>559,2542=>661,2543=>600,2544=>593,2545=>593,2546=>601,2547=>567,2548=>601,2549=>699,2550=>661,2551=>267, - 2552=>610,2553=>424,2554=>548,2562=>0,2565=>691,2566=>936,2567=>803,2568=>803,2569=>678,2570=>678,2575=>557,2576=>691,2579=>678,2580=>691,2581=>602,2582=>567, - 2583=>641,2584=>688,2585=>565,2586=>592,2587=>603,2588=>591,2589=>541,2590=>558,2591=>543,2592=>581,2593=>596,2594=>640,2595=>640,2596=>591,2597=>564,2598=>640, - 2599=>564,2600=>581,2602=>564,2603=>551,2604=>560,2605=>549,2606=>558,2607=>652,2608=>540,2610=>677,2611=>677,2613=>601,2614=>558,2616=>558,2617=>549,2620=>0, - 2622=>246,2623=>246,2624=>246,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>567,2650=>690,2651=>591,2652=>591,2654=>581,2662=>591, - 2663=>591,2664=>591,2665=>591,2666=>591,2667=>591,2668=>591,2669=>591,2670=>591,2671=>591,2672=>0,2673=>0,2674=>557,2675=>678,2676=>894,2689=>0,2690=>0, - 2691=>300,2693=>781,2694=>1044,2695=>589,2696=>589,2697=>560,2698=>758,2699=>806,2701=>781,2703=>781,2704=>781,2705=>1044,2707=>1044,2708=>1044,2709=>413,2710=>773, - 2711=>606,2712=>558,2713=>483,2714=>600,2715=>691,2716=>811,2717=>647,2718=>651,2719=>453,2720=>450,2721=>425,2722=>478,2723=>694,2724=>534,2725=>553,2726=>446, - 2727=>541,2728=>582,2730=>572,2731=>437,2732=>663,2733=>756,2734=>594,2735=>493,2736=>392,2738=>613,2739=>656,2741=>538,2742=>611,2743=>507,2744=>663,2745=>587, - 2748=>0,2749=>478,2750=>273,2751=>273,2752=>273,2753=>0,2754=>0,2755=>0,2756=>0,2757=>0,2759=>0,2760=>0,2761=>273,2763=>273,2764=>273,2765=>0, - 2768=>843,2784=>893,2790=>625,2791=>625,2792=>625,2793=>625,2794=>625,2795=>625,2796=>625,2797=>625,2798=>625,2799=>625,2817=>0,2818=>306,2819=>391,2821=>590, - 2822=>808,2823=>658,2824=>658,2825=>633,2826=>654,2827=>636,2828=>540,2831=>560,2832=>938,2835=>600,2836=>973,2837=>603,2838=>620,2839=>620,2840=>605,2841=>712, - 2842=>579,2843=>579,2844=>593,2845=>564,2846=>581,2847=>604,2848=>578,2849=>579,2850=>579,2851=>607,2852=>579,2853=>587,2854=>579,2855=>602,2856=>579,2858=>605, - 2859=>728,2860=>579,2861=>643,2862=>605,2863=>628,2864=>619,2866=>653,2867=>593,2870=>620,2871=>605,2872=>605,2873=>579,2876=>0,2877=>333,2878=>218,2879=>0, - 2880=>294,2881=>0,2882=>0,2883=>0,2887=>479,2888=>479,2891=>1026,2892=>1026,2893=>0,2902=>0,2903=>218,2908=>579,2909=>579,2911=>599,2912=>636,2913=>540, - 2918=>578,2919=>480,2920=>480,2921=>622,2922=>506,2923=>605,2924=>529,2925=>548,2926=>512,2927=>528,2928=>561,2946=>0,2947=>742,2949=>1002,2950=>1118,2951=>994, - 2952=>660,2953=>1012,2954=>1231,2958=>726,2959=>731,2960=>870,2962=>763,2963=>763,2964=>1636,2965=>667,2969=>830,2970=>584,2972=>876,2974=>986,2975=>802,2979=>1295, - 2980=>656,2984=>630,2985=>1012,2986=>694,2990=>727,2991=>790,2992=>545,2993=>718,2994=>821,2995=>871,2996=>724,2997=>873,2999=>1087,3000=>1098,3001=>1274,3006=>547, - 3007=>172,3008=>93,3009=>519,3010=>814,3014=>748,3015=>681,3016=>956,3018=>1666,3019=>1666,3020=>1994,3021=>0,3031=>871,3047=>667,3048=>1012,3049=>751,3050=>740, - 3051=>924,3052=>884,3053=>726,3054=>1002,3055=>825,3056=>717,3057=>719,3058=>774,3073=>365,3074=>601,3075=>346,3077=>720,3078=>786,3079=>567,3080=>1159,3081=>690, - 3082=>1047,3083=>1299,3084=>913,3086=>625,3087=>625,3088=>712,3090=>655,3091=>655,3092=>862,3093=>515,3094=>680,3095=>526,3096=>943,3097=>655,3098=>684,3099=>684, - 3100=>670,3101=>1205,3102=>732,3103=>888,3104=>597,3105=>709,3106=>709,3107=>809,3108=>715,3109=>702,3110=>702,3111=>702,3112=>607,3114=>623,3115=>623,3116=>681, - 3117=>681,3118=>932,3119=>1203,3120=>597,3121=>893,3122=>631,3123=>608,3125=>620,3126=>541,3127=>667,3128=>640,3129=>911,3134=>644,3135=>298,3136=>298,3137=>361, - 3138=>682,3139=>342,3140=>704,3142=>624,3143=>624,3144=>900,3146=>849,3147=>849,3148=>976,3149=>669,3157=>298,3158=>119,3168=>1620,3169=>1281,3174=>840,3175=>840, - 3176=>840,3177=>840,3178=>840,3179=>840,3180=>840,3181=>840,3182=>840,3183=>840,3202=>440,3203=>251,3205=>654,3206=>654,3207=>631,3208=>891,3209=>957,3210=>1293, - 3211=>1044,3212=>744,3214=>650,3215=>650,3216=>659,3218=>667,3219=>667,3220=>667,3221=>462,3222=>749,3223=>543,3224=>779,3225=>674,3226=>682,3227=>660,3228=>667, - 3229=>1171,3230=>926,3231=>671,3232=>557,3233=>669,3234=>669,3235=>728,3236=>544,3237=>672,3238=>672,3239=>672,3240=>560,3242=>668,3243=>668,3244=>681,3245=>687, - 3246=>972,3247=>1101,3248=>556,3249=>677,3250=>661,3251=>545,3253=>666,3254=>553,3255=>670,3256=>549,3257=>716,3262=>425,3263=>341,3264=>680,3265=>354,3266=>714, - 3267=>386,3268=>638,3270=>307,3271=>670,3272=>462,3274=>908,3275=>1251,3276=>434,3277=>336,3285=>344,3286=>404,3294=>673,3296=>1695,3297=>978,3302=>549,3303=>549, - 3304=>549,3305=>549,3306=>549,3307=>549,3308=>549,3309=>549,3310=>549,3311=>549,3330=>368,3331=>305,3333=>1201,3334=>1351,3335=>905,3336=>1459,3337=>635,3338=>1198, - 3339=>861,3340=>957,3342=>1211,3343=>1202,3344=>1839,3346=>642,3347=>1114,3348=>1195,3349=>861,3350=>982,3351=>874,3352=>1354,3353=>957,3354=>1016,3355=>1266,3356=>712, - 3357=>1454,3358=>1215,3359=>563,3360=>565,3361=>1192,3362=>1244,3363=>1268,3364=>878,3365=>966,3366=>545,3367=>879,3368=>879,3370=>1031,3371=>1175,3372=>1334,3373=>546, - 3374=>643,3375=>949,3376=>642,3377=>555,3378=>945,3379=>631,3380=>553,3381=>959,3382=>936,3383=>1122,3384=>1190,3385=>1112,3390=>475,3391=>418,3392=>442,3393=>340, - 3394=>340,3395=>473,3398=>640,3399=>530,3400=>1279,3402=>1368,3403=>1258,3404=>1447,3405=>0,3415=>553,3424=>861,3425=>1100,3430=>1095,3431=>929,3432=>854,3433=>1181, - 3434=>658,3435=>972,3436=>1210,3437=>650,3438=>959,3439=>896,3585=>595,3586=>648,3587=>665,3588=>608,3589=>608,3590=>665,3591=>471,3592=>556,3593=>652,3594=>664, - 3595=>681,3596=>816,3597=>849,3598=>620,3599=>620,3600=>541,3601=>785,3602=>826,3603=>887,3604=>598,3605=>605,3606=>595,3607=>650,3608=>541,3609=>652,3610=>608, - 3611=>608,3612=>630,3613=>630,3614=>695,3615=>695,3616=>620,3617=>581,3618=>588,3619=>501,3620=>595,3621=>569,3622=>620,3623=>519,3624=>592,3625=>659,3626=>574, - 3627=>654,3628=>695,3629=>566,3630=>574,3631=>517,3632=>452,3633=>0,3634=>496,3635=>496,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, - 3647=>687,3648=>302,3649=>571,3650=>478,3651=>515,3652=>515,3653=>496,3654=>506,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0, - 3663=>555,3664=>598,3665=>640,3666=>688,3667=>690,3668=>657,3669=>657,3670=>635,3671=>839,3672=>693,3673=>769,3674=>673,3675=>994,3713=>775,3714=>707,3716=>724, - 3719=>524,3720=>690,3722=>678,3725=>711,3732=>719,3733=>834,3734=>776,3735=>916,3737=>744,3738=>740,3739=>740,3740=>834,3741=>834,3742=>854,3743=>854,3745=>775, - 3746=>724,3747=>697,3749=>700,3751=>700,3754=>708,3755=>916,3757=>700,3758=>697,3759=>658,3760=>432,3761=>534,3762=>476,3763=>476,3764=>778,3765=>778,3766=>778, - 3767=>778,3768=>778,3769=>778,3771=>778,3772=>778,3773=>670,3776=>420,3777=>806,3778=>430,3779=>446,3780=>346,3782=>571,3784=>778,3785=>778,3786=>778,3787=>778, - 3788=>778,3789=>778,3792=>721,3793=>719,3794=>601,3795=>711,3796=>686,3797=>686,3798=>834,3799=>756,3800=>724,3801=>906,3804=>1272,3805=>1272,3840=>600,3841=>600, - 3842=>600,3843=>600,3844=>600,3845=>600,3846=>600,3847=>600,3848=>600,3849=>600,3850=>600,3851=>600,3852=>600,3853=>600,3854=>600,3855=>600,3856=>600,3857=>600, - 3858=>600,3859=>600,3860=>600,3861=>600,3862=>600,3863=>600,3864=>600,3865=>600,3866=>600,3867=>600,3868=>600,3869=>600,3870=>600,3871=>600,3872=>600,3873=>600, - 3874=>600,3875=>600,3876=>600,3877=>600,3878=>600,3879=>600,3880=>600,3881=>600,3882=>600,3883=>600,3884=>600,3885=>600,3886=>600,3887=>600,3888=>600,3889=>600, - 3890=>600,3891=>600,3892=>600,3893=>600,3894=>600,3895=>600,3896=>600,3897=>600,3898=>600,3899=>600,3900=>600,3901=>600,3902=>600,3903=>600,3904=>600,3905=>600, - 3906=>600,3907=>600,3908=>600,3909=>600,3910=>600,3911=>600,3913=>600,3914=>600,3915=>600,3916=>600,3917=>600,3918=>600,3919=>600,3920=>600,3921=>600,3922=>600, - 3923=>600,3924=>600,3925=>600,3926=>600,3927=>600,3928=>600,3929=>600,3930=>600,3931=>600,3932=>600,3933=>600,3934=>600,3935=>600,3936=>600,3937=>600,3938=>600, - 3939=>600,3940=>600,3941=>600,3942=>600,3943=>600,3944=>600,3945=>600,3953=>600,3954=>600,3955=>600,3956=>600,3957=>600,3958=>600,3959=>600,3960=>600,3961=>600, - 3962=>600,3963=>600,3964=>600,3965=>600,3966=>600,3967=>600,3968=>600,3969=>600,3970=>600,3971=>600,3972=>600,3973=>600,3974=>600,3975=>600,3976=>600,3977=>600, - 3978=>600,3979=>600,3984=>600,3985=>600,3986=>600,3987=>600,3988=>600,3989=>600,3991=>600,3993=>600,3994=>600,3995=>600,3996=>600,3997=>600,3998=>600,3999=>600, - 4000=>600,4001=>600,4002=>600,4003=>600,4004=>600,4005=>600,4006=>600,4007=>600,4008=>600,4009=>600,4010=>600,4011=>600,4012=>600,4013=>600,4017=>600,4018=>600, - 4019=>600,4020=>600,4021=>600,4022=>600,4023=>600,4025=>600,4256=>662,4257=>677,4258=>708,4259=>696,4260=>609,4261=>790,4262=>664,4263=>785,4264=>560,4265=>634, - 4266=>782,4267=>701,4268=>629,4269=>682,4270=>705,4271=>692,4272=>734,4273=>615,4274=>592,4275=>680,4276=>679,4277=>705,4278=>643,4279=>623,4280=>623,4281=>629, - 4282=>633,4283=>770,4284=>592,4285=>662,4286=>629,4287=>672,4288=>735,4289=>576,4290=>606,4291=>605,4292=>676,4293=>792,4304=>435,4305=>556,4306=>565,4307=>872, - 4308=>506,4309=>544,4310=>723,4311=>868,4312=>530,4313=>532,4314=>955,4315=>552,4316=>565,4317=>712,4318=>547,4319=>574,4320=>685,4321=>554,4322=>806,4323=>810, - 4324=>777,4325=>502,4326=>686,4327=>512,4328=>552,4329=>496,4330=>568,4331=>552,4332=>592,4333=>565,4334=>552,4335=>741,4336=>549,4337=>659,4338=>559,4339=>524, - 4340=>482,4341=>565,4342=>822,4347=>506,4352=>1000,4353=>1000,4354=>1000,4355=>1000,4356=>1000,4357=>1000,4358=>1000,4359=>1000,4360=>1000,4361=>1000,4362=>1000,4363=>1000, - 4364=>1000,4365=>1000,4366=>1000,4367=>1000,4368=>1000,4369=>1000,4370=>1000,4371=>1000,4372=>1000,4373=>1000,4374=>1000,4375=>1000,4376=>1000,4377=>1000,4378=>1000,4379=>1000, - 4380=>1000,4381=>1000,4382=>1000,4383=>1000,4384=>1000,4385=>1000,4386=>1000,4387=>1000,4388=>1000,4389=>1000,4390=>1000,4391=>1000,4392=>1000,4393=>1000,4394=>1000,4395=>1000, - 4396=>1000,4397=>1000,4398=>1000,4399=>1000,4400=>1000,4401=>1000,4402=>1000,4403=>1000,4404=>1000,4405=>1000,4406=>1000,4407=>1000,4408=>1000,4409=>1000,4410=>1000,4411=>1000, - 4412=>1000,4413=>1000,4414=>1000,4415=>1000,4416=>1000,4417=>1000,4418=>1000,4419=>1000,4420=>1000,4421=>1000,4422=>1000,4423=>1000,4424=>1000,4425=>1000,4426=>1000,4427=>1000, - 4428=>1000,4429=>1000,4430=>1000,4431=>1000,4432=>1000,4433=>1000,4434=>1000,4435=>1000,4436=>1000,4437=>1000,4438=>1000,4439=>1000,4440=>1000,4441=>1000,4447=>1000,4448=>1000, - 4449=>1000,4450=>1000,4451=>1000,4452=>1000,4453=>1000,4454=>1000,4455=>1000,4456=>1000,4457=>1000,4458=>1000,4459=>1000,4460=>1000,4461=>1000,4462=>1000,4463=>1000,4464=>1000, - 4465=>1000,4466=>1000,4467=>1000,4468=>1000,4469=>1000,4470=>1000,4471=>1000,4472=>1000,4473=>1000,4474=>1000,4475=>1000,4476=>1000,4477=>1000,4478=>1000,4479=>1000,4480=>1000, - 4481=>1000,4482=>1000,4483=>1000,4484=>1000,4485=>1000,4486=>1000,4487=>1000,4488=>1000,4489=>1000,4490=>1000,4491=>1000,4492=>1000,4493=>1000,4494=>1000,4495=>1000,4496=>1000, - 4497=>1000,4498=>1000,4499=>1000,4500=>1000,4501=>1000,4502=>1000,4503=>1000,4504=>1000,4505=>1000,4506=>1000,4507=>1000,4508=>1000,4509=>1000,4510=>1000,4511=>1000,4512=>1000, - 4513=>1000,4514=>1000,4520=>1000,4521=>1000,4522=>1000,4523=>1000,4524=>1000,4525=>1000,4526=>1000,4527=>1000,4528=>1000,4529=>1000,4530=>1000,4531=>1000,4532=>1000,4533=>1000, - 4534=>1000,4535=>1000,4536=>1000,4537=>1000,4538=>1000,4539=>1000,4540=>1000,4541=>1000,4542=>1000,4543=>1000,4544=>1000,4545=>1000,4546=>1000,4547=>1000,4548=>1000,4549=>1000, - 4550=>1000,4551=>1000,4552=>1000,4553=>1000,4554=>1000,4555=>1000,4556=>1000,4557=>1000,4558=>1000,4559=>1000,4560=>1000,4561=>1000,4562=>1000,4563=>1000,4564=>1000,4565=>1000, - 4566=>1000,4567=>1000,4568=>1000,4569=>1000,4570=>1000,4571=>1000,4572=>1000,4573=>1000,4574=>1000,4575=>1000,4576=>1000,4577=>1000,4578=>1000,4579=>1000,4580=>1000,4581=>1000, - 4582=>1000,4583=>1000,4584=>1000,4585=>1000,4586=>1000,4587=>1000,4588=>1000,4589=>1000,4590=>1000,4591=>1000,4592=>1000,4593=>1000,4594=>1000,4595=>1000,4596=>1000,4597=>1000, - 4598=>1000,4599=>1000,4600=>1000,4601=>1000,7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722,7691=>556, - 7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556, - 7708=>667,7709=>556,7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722,7721=>556,7722=>722,7723=>556, - 7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, - 7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556, - 7756=>778,7757=>556,7758=>778,7759=>556,7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722,7771=>333, - 7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278, - 7788=>611,7789=>278,7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556, - 7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, - 7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556,7831=>278,7832=>722,7833=>500,7834=>556,7835=>278, - 7840=>667,7841=>556,7842=>667,7843=>556,7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667,7855=>556, - 7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556, - 7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778,7885=>556,7886=>778,7887=>556, - 7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778,7895=>556,7896=>778,7897=>556,7898=>776,7899=>556,7900=>776,7901=>556,7902=>776,7903=>556, - 7904=>776,7905=>556,7906=>776,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>620,7914=>776,7915=>620,7916=>776,7917=>620,7918=>776,7919=>620, - 7920=>776,7921=>620,7922=>667,7923=>500,7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>576,7937=>576,7938=>576,7939=>576,7940=>576,7941=>576, - 7942=>576,7943=>576,7944=>667,7945=>667,7946=>680,7947=>680,7948=>680,7949=>680,7950=>718,7951=>718,7952=>434,7953=>434,7954=>434,7955=>434,7956=>434,7957=>434, - 7960=>692,7961=>692,7962=>823,7963=>823,7964=>823,7965=>823,7968=>556,7969=>556,7970=>556,7971=>556,7972=>556,7973=>556,7974=>556,7975=>556,7976=>747,7977=>747, - 7978=>878,7979=>878,7980=>878,7981=>878,7982=>923,7983=>923,7984=>222,7985=>222,7986=>222,7987=>222,7988=>222,7989=>222,7990=>222,7991=>222,7992=>303,7993=>303, - 7994=>434,7995=>434,7996=>434,7997=>434,7998=>479,7999=>479,8000=>556,8001=>556,8002=>556,8003=>556,8004=>556,8005=>556,8008=>778,8009=>778,8010=>894,8011=>894, - 8012=>894,8013=>894,8016=>551,8017=>551,8018=>551,8019=>551,8020=>551,8021=>551,8022=>551,8023=>551,8025=>777,8027=>893,8029=>885,8031=>940,8032=>766,8033=>766, - 8034=>766,8035=>766,8036=>766,8037=>766,8038=>766,8039=>766,8040=>758,8041=>758,8042=>874,8043=>874,8044=>868,8045=>867,8046=>911,8047=>911,8048=>576,8049=>576, - 8050=>434,8051=>434,8052=>556,8053=>556,8054=>222,8055=>222,8056=>556,8057=>556,8058=>551,8059=>551,8060=>766,8061=>766,8064=>576,8065=>576,8066=>576,8067=>576, - 8068=>576,8069=>576,8070=>576,8071=>576,8072=>667,8073=>667,8074=>680,8075=>680,8076=>680,8077=>680,8078=>718,8079=>718,8080=>556,8081=>556,8082=>556,8083=>556, - 8084=>556,8085=>556,8086=>556,8087=>556,8088=>747,8089=>747,8090=>878,8091=>878,8092=>878,8093=>878,8094=>923,8095=>923,8096=>766,8097=>766,8098=>766,8099=>766, - 8100=>766,8101=>766,8102=>766,8103=>766,8104=>758,8105=>758,8106=>874,8107=>874,8108=>868,8109=>867,8110=>911,8111=>911,8112=>576,8113=>576,8114=>576,8115=>576, - 8116=>576,8118=>576,8119=>576,8120=>667,8121=>667,8122=>667,8123=>667,8124=>667,8125=>278,8126=>278,8127=>278,8128=>278,8129=>278,8130=>556,8131=>556,8132=>556, - 8134=>556,8135=>556,8136=>693,8137=>704,8138=>748,8139=>759,8140=>722,8141=>278,8142=>278,8143=>278,8144=>222,8145=>222,8146=>222,8147=>222,8150=>222,8151=>222, - 8152=>278,8153=>278,8154=>304,8155=>304,8157=>278,8158=>278,8159=>278,8160=>551,8161=>551,8162=>551,8163=>551,8164=>571,8165=>571,8166=>551,8167=>551,8168=>667, - 8169=>667,8170=>742,8171=>746,8172=>693,8173=>278,8174=>278,8175=>278,8178=>766,8179=>766,8180=>766,8182=>766,8183=>766,8184=>778,8185=>778,8186=>758,8187=>758, - 8188=>758,8189=>278,8190=>278,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>100,8202=>50,8203=>0,8204=>0, - 8205=>0,8208=>333,8209=>333,8210=>556,8213=>564,8214=>428,8215=>500,8219=>222,8223=>333,8227=>350,8228=>278,8229=>556,8231=>278,8232=>0,8233=>0,8241=>1330, - 8242=>222,8243=>372,8244=>522,8245=>206,8246=>356,8247=>506,8248=>312,8251=>1000,8252=>471,8253=>556,8254=>500,8255=>945,8256=>945,8257=>312,8258=>820,8259=>333, - 8260=>167,8261=>278,8262=>278,8304=>333,8308=>333,8309=>333,8310=>333,8311=>333,8312=>333,8313=>333,8314=>333,8315=>333,8316=>333,8317=>210,8318=>210,8319=>333, - 8320=>333,8321=>333,8322=>333,8323=>333,8324=>333,8325=>333,8326=>333,8327=>333,8328=>333,8329=>333,8330=>333,8331=>333,8332=>333,8333=>210,8334=>210,8352=>556, - 8353=>556,8354=>556,8355=>556,8356=>556,8357=>833,8358=>556,8359=>556,8360=>1024,8361=>940,8362=>784,8363=>556,8400=>600,8401=>600,8402=>600,8403=>600,8404=>700, - 8405=>700,8406=>600,8407=>600,8408=>600,8409=>600,8410=>600,8411=>600,8412=>600,8413=>900,8414=>900,8415=>900,8416=>900,8417=>700,8448=>889,8449=>889,8450=>667, - 8451=>1022,8452=>611,8453=>889,8454=>889,8455=>501,8456=>667,8457=>921,8458=>510,8459=>906,8460=>988,8461=>722,8462=>500,8463=>500,8464=>688,8465=>553,8466=>708, - 8467=>291,8468=>778,8469=>722,8470=>1073,8471=>737,8472=>740,8473=>556,8474=>722,8475=>927,8476=>795,8477=>667,8478=>667,8479=>667,8480=>1000,8481=>1174,8483=>722, - 8484=>611,8485=>542,8486=>768,8487=>768,8488=>698,8489=>321,8490=>667,8491=>667,8492=>927,8493=>646,8494=>556,8495=>385,8496=>615,8497=>688,8498=>611,8499=>1115, - 8500=>406,8501=>688,8502=>688,8503=>344,8504=>688,8531=>834,8532=>834,8533=>834,8534=>834,8535=>834,8536=>834,8537=>834,8538=>834,8539=>834,8540=>834,8541=>834, - 8542=>834,8543=>834,8544=>278,8545=>555,8546=>832,8547=>933,8548=>667,8549=>934,8550=>1031,8551=>1268,8552=>944,8553=>667,8554=>944,8555=>1035,8556=>556,8557=>722, - 8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>700,8564=>500,8565=>700,8566=>922,8567=>1144,8568=>712,8569=>500,8570=>712,8571=>934,8572=>222,8573=>500, - 8574=>556,8575=>833,8576=>983,8577=>722,8578=>983,8592=>713,8593=>713,8594=>713,8595=>713,8596=>713,8597=>713,8598=>713,8599=>713,8600=>713,8601=>713,8602=>713, - 8603=>713,8604=>713,8605=>713,8606=>713,8607=>713,8608=>713,8609=>713,8610=>713,8611=>713,8612=>713,8613=>713,8614=>713,8615=>713,8616=>713,8617=>713,8618=>713, - 8619=>713,8620=>713,8621=>813,8622=>813,8623=>713,8624=>713,8625=>713,8626=>713,8627=>713,8628=>713,8629=>713,8630=>713,8631=>713,8632=>713,8633=>713,8634=>800, - 8635=>800,8636=>713,8637=>713,8638=>713,8639=>713,8640=>713,8641=>713,8642=>713,8643=>713,8644=>713,8645=>713,8646=>713,8647=>713,8648=>713,8649=>713,8650=>713, - 8651=>713,8652=>713,8653=>713,8654=>950,8655=>713,8656=>713,8657=>713,8658=>713,8659=>713,8660=>863,8661=>713,8662=>713,8663=>713,8664=>713,8665=>713,8666=>713, - 8667=>713,8668=>813,8669=>813,8670=>713,8671=>713,8672=>713,8673=>713,8674=>713,8675=>713,8676=>713,8677=>713,8678=>713,8679=>713,8680=>713,8681=>713,8682=>713, - 8704=>600,8705=>600,8706=>494,8707=>600,8708=>600,8709=>800,8710=>612,8711=>612,8712=>549,8713=>549,8714=>549,8715=>549,8716=>549,8717=>549,8718=>549,8719=>823, - 8720=>823,8721=>713,8722=>584,8723=>584,8724=>584,8725=>167,8726=>278,8727=>389,8728=>400,8729=>400,8730=>600,8731=>600,8732=>600,8733=>549,8734=>549,8735=>584, - 8736=>584,8737=>584,8738=>584,8739=>260,8740=>444,8741=>418,8742=>602,8743=>561,8744=>561,8745=>561,8746=>561,8747=>506,8748=>806,8749=>1106,8750=>506,8751=>806, - 8752=>1106,8753=>506,8754=>506,8755=>506,8756=>561,8757=>561,8758=>422,8759=>561,8760=>584,8761=>584,8762=>584,8763=>584,8764=>584,8765=>584,8766=>584,8767=>584, - 8768=>422,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584,8775=>584,8776=>584,8777=>584,8778=>584,8779=>584,8780=>584,8781=>584,8782=>584,8783=>584, - 8784=>584,8785=>584,8786=>584,8787=>584,8788=>737,8789=>737,8790=>584,8791=>584,8792=>584,8793=>584,8794=>584,8795=>584,8796=>584,8797=>584,8798=>584,8799=>584, - 8800=>584,8801=>584,8802=>584,8803=>584,8804=>584,8805=>584,8806=>584,8807=>584,8808=>584,8809=>584,8810=>969,8811=>969,8812=>584,8813=>584,8814=>584,8815=>584, - 8816=>584,8817=>584,8818=>584,8819=>584,8820=>584,8821=>584,8822=>584,8823=>584,8824=>584,8825=>584,8826=>584,8827=>584,8828=>584,8829=>584,8830=>584,8831=>584, - 8832=>584,8833=>584,8834=>678,8835=>678,8836=>678,8837=>678,8838=>678,8839=>678,8840=>678,8841=>678,8842=>678,8843=>678,8844=>561,8845=>561,8846=>561,8847=>678, - 8848=>678,8849=>673,8850=>673,8851=>561,8852=>561,8853=>800,8854=>800,8855=>800,8856=>800,8857=>800,8858=>800,8859=>800,8860=>800,8861=>800,8862=>800,8863=>800, - 8864=>800,8865=>800,8866=>549,8867=>549,8868=>549,8869=>549,8870=>399,8871=>399,8872=>549,8873=>549,8874=>549,8875=>672,8876=>549,8877=>549,8878=>549,8879=>672, - 8880=>549,8881=>549,8882=>549,8883=>549,8884=>549,8885=>549,8886=>713,8887=>713,8888=>713,8889=>549,8890=>549,8891=>584,8892=>584,8893=>584,8894=>584,8895=>584, - 8896=>561,8897=>561,8898=>561,8899=>561,8900=>549,8901=>250,8902=>549,8903=>649,8904=>630,8905=>630,8906=>630,8907=>630,8908=>630,8909=>584,8910=>561,8911=>561, - 8912=>668,8913=>668,8914=>668,8915=>668,8916=>561,8917=>602,8918=>584,8919=>584,8920=>1354,8921=>1354,8922=>584,8923=>584,8924=>584,8925=>584,8926=>584,8927=>584, - 8928=>584,8929=>584,8930=>673,8931=>673,8932=>673,8933=>673,8934=>584,8935=>584,8936=>584,8937=>584,8938=>584,8939=>584,8940=>584,8941=>584,8942=>278,8943=>1000, - 8944=>1000,8945=>1000,8960=>549,8962=>549,8963=>549,8964=>549,8965=>549,8966=>549,8967=>549,8968=>449,8969=>449,8970=>449,8971=>449,8972=>549,8973=>549,8974=>549, - 8975=>549,8976=>549,8977=>549,8978=>800,8979=>800,8980=>549,8981=>549,8982=>549,8983=>650,8984=>780,8985=>549,8986=>549,8987=>549,8988=>549,8989=>549,8990=>549, - 8991=>549,8992=>506,8993=>506,8994=>713,8995=>713,8996=>1000,8997=>1000,8998=>1000,8999=>1000,9000=>1000,9001=>329,9002=>329,9003=>1000,9004=>549,9005=>549,9006=>549, - 9007=>549,9008=>549,9009=>549,9010=>549,9011=>549,9012=>549,9013=>549,9014=>600,9015=>600,9016=>600,9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600, - 9023=>600,9024=>600,9025=>600,9026=>600,9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600,9037=>600,9038=>600, - 9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600,9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600, - 9055=>600,9056=>600,9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600,9067=>600,9068=>600,9069=>600,9070=>600, - 9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600,9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9109=>600,9216=>600,9217=>600,9218=>600, - 9219=>600,9220=>600,9221=>600,9222=>600,9223=>600,9224=>600,9225=>600,9226=>600,9227=>600,9228=>600,9229=>600,9230=>600,9231=>600,9232=>600,9233=>600,9234=>600, - 9235=>600,9236=>600,9237=>600,9238=>600,9239=>600,9240=>600,9241=>600,9242=>600,9243=>600,9244=>600,9245=>600,9246=>600,9247=>600,9248=>600,9249=>600,9250=>600, - 9251=>600,9252=>600,9280=>604,9281=>604,9282=>604,9283=>604,9284=>604,9285=>604,9286=>750,9287=>750,9288=>750,9289=>750,9290=>604,9312=>1000,9313=>1000,9314=>1000, - 9315=>1000,9316=>1000,9317=>1000,9318=>1000,9319=>1000,9320=>1000,9321=>1000,9322=>1000,9323=>1000,9324=>1000,9325=>1000,9326=>1000,9327=>1000,9328=>1000,9329=>1000,9330=>1000, - 9331=>1000,9332=>1000,9333=>1000,9334=>1000,9335=>1000,9336=>1000,9337=>1000,9338=>1000,9339=>1000,9340=>1000,9341=>1000,9342=>1000,9343=>1000,9344=>1000,9345=>1000,9346=>1000, - 9347=>1000,9348=>1000,9349=>1000,9350=>1000,9351=>1000,9352=>1000,9353=>1000,9354=>1000,9355=>1000,9356=>1000,9357=>1000,9358=>1000,9359=>1000,9360=>1000,9361=>1000,9362=>1000, - 9363=>1000,9364=>1000,9365=>1000,9366=>1000,9367=>1000,9368=>1000,9369=>1000,9370=>1000,9371=>1000,9372=>1000,9373=>1000,9374=>1000,9375=>1000,9376=>1000,9377=>1000,9378=>1000, - 9379=>1000,9380=>1000,9381=>1000,9382=>1000,9383=>1000,9384=>1000,9385=>1000,9386=>1000,9387=>1000,9388=>1000,9389=>1000,9390=>1000,9391=>1000,9392=>1000,9393=>1000,9394=>1000, - 9395=>1000,9396=>1000,9397=>1000,9398=>1000,9399=>1000,9400=>1000,9401=>1000,9402=>1000,9403=>1000,9404=>1000,9405=>1000,9406=>1000,9407=>1000,9408=>1000,9409=>1000,9410=>1000, - 9411=>1000,9412=>1000,9413=>1000,9414=>1000,9415=>1000,9416=>1000,9417=>1000,9418=>1000,9419=>1000,9420=>1000,9421=>1000,9422=>1000,9423=>1000,9424=>1000,9425=>1000,9426=>1000, - 9427=>1000,9428=>1000,9429=>1000,9430=>1000,9431=>1000,9432=>1000,9433=>1000,9434=>1000,9435=>1000,9436=>1000,9437=>1000,9438=>1000,9439=>1000,9440=>1000,9441=>1000,9442=>1000, - 9443=>1000,9444=>1000,9445=>1000,9446=>1000,9447=>1000,9448=>1000,9449=>1000,9450=>1000,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600, - 9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600, - 9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600, - 9512=>600,9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600,9527=>600, - 9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600, - 9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600, - 9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600, - 9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600, - 9592=>600,9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600,9607=>600, - 9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600, - 9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600, - 9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600, - 9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600,9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600, - 9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600,9693=>600,9694=>600,9695=>600,9696=>600,9697=>600, - 9698=>600,9699=>600,9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9728=>750,9729=>1000, - 9730=>750,9731=>750,9732=>1000,9733=>816,9734=>823,9735=>500,9736=>500,9737=>800,9738=>800,9739=>800,9740=>800,9741=>800,9742=>719,9743=>719,9744=>734,9745=>734, - 9746=>734,9747=>762,9754=>960,9755=>960,9756=>939,9757=>939,9758=>939,9759=>939,9760=>750,9761=>600,9762=>750,9763=>750,9764=>580,9765=>460,9766=>444,9767=>650, - 9768=>444,9769=>768,9770=>800,9771=>850,9772=>675,9773=>800,9774=>750,9775=>750,9776=>900,9777=>900,9778=>900,9779=>900,9780=>900,9781=>900,9782=>900,9783=>900, - 9784=>750,9785=>750,9786=>750,9787=>750,9788=>750,9789=>750,9790=>750,9791=>740,9792=>740,9793=>740,9794=>740,9795=>653,9796=>490,9797=>632,9798=>780,9799=>560, - 9800=>838,9801=>780,9802=>734,9803=>887,9804=>780,9805=>1080,9806=>896,9807=>1080,9808=>804,9809=>868,9810=>922,9811=>696,9812=>1000,9813=>1000,9814=>1000,9815=>1000, - 9816=>1000,9817=>1000,9818=>1000,9819=>1000,9820=>1000,9821=>1000,9822=>1000,9823=>1000,9824=>722,9825=>734,9826=>674,9827=>804,9828=>722,9829=>734,9830=>674,9831=>804, - 9832=>860,9833=>423,9834=>592,9835=>750,9836=>750,9837=>439,9838=>439,9839=>439,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791,9993=>690, - 9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846,10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759, - 10012=>754,10013=>494,10014=>552,10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823,10026=>789,10027=>841,10028=>823, - 10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749,10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708, - 10045=>682,10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786,10056=>787,10057=>713,10058=>791,10059=>785,10061=>873, - 10063=>762,10064=>762,10065=>759,10066=>759,10070=>784,10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544,10084=>910, - 10085=>667,10086=>760,10087=>760,10102=>788,10103=>788,10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788,10114=>788, - 10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788,10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788, - 10131=>788,10132=>894,10136=>748,10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924,10147=>924,10148=>917,10149=>930, - 10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867,10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771, - 10167=>888,10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,12288=>1000,12289=>1000,12290=>1000,12291=>1000,12292=>1000,12293=>1000,12294=>1000,12295=>1000, - 12296=>1000,12297=>1000,12298=>1000,12299=>1000,12300=>1000,12301=>1000,12302=>1000,12303=>1000,12304=>1000,12305=>1000,12306=>1000,12307=>1000,12308=>1000,12309=>1000,12310=>1000,12311=>1000, - 12312=>1000,12313=>1000,12314=>1000,12315=>1000,12316=>1000,12317=>1000,12318=>1000,12319=>1000,12320=>1000,12321=>1000,12322=>1000,12323=>1000,12324=>1000,12325=>1000,12326=>1000,12327=>1000, - 12328=>1000,12329=>1000,12330=>1000,12331=>1000,12332=>1000,12333=>1000,12334=>1000,12335=>1000,12336=>1000,12337=>1000,12338=>1000,12339=>1000,12340=>1000,12341=>1000,12342=>1000,12343=>1000, - 12351=>1000,12353=>1000,12354=>1000,12355=>1000,12356=>1000,12357=>1000,12358=>1000,12359=>1000,12360=>1000,12361=>1000,12362=>1000,12363=>1000,12364=>1000,12365=>1000,12366=>1000,12367=>1000, - 12368=>1000,12369=>1000,12370=>1000,12371=>1000,12372=>1000,12373=>1000,12374=>1000,12375=>1000,12376=>1000,12377=>1000,12378=>1000,12379=>1000,12380=>1000,12381=>1000,12382=>1000,12383=>1000, - 12384=>1000,12385=>1000,12386=>1000,12387=>1000,12388=>1000,12389=>1000,12390=>1000,12391=>1000,12392=>1000,12393=>1000,12394=>1000,12395=>1000,12396=>1000,12397=>1000,12398=>1000,12399=>1000, - 12400=>1000,12401=>1000,12402=>1000,12403=>1000,12404=>1000,12405=>1000,12406=>1000,12407=>1000,12408=>1000,12409=>1000,12410=>1000,12411=>1000,12412=>1000,12413=>1000,12414=>1000,12415=>1000, - 12416=>1000,12417=>1000,12418=>1000,12419=>1000,12420=>1000,12421=>1000,12422=>1000,12423=>1000,12424=>1000,12425=>1000,12426=>1000,12427=>1000,12428=>1000,12429=>1000,12430=>1000,12431=>1000, - 12432=>1000,12433=>1000,12434=>1000,12435=>1000,12436=>1000,12441=>1000,12442=>1000,12443=>1000,12444=>1000,12445=>1000,12446=>1000,12449=>1000,12450=>1000,12451=>1000,12452=>1000,12453=>1000, - 12454=>1000,12455=>1000,12456=>1000,12457=>1000,12458=>1000,12459=>1000,12460=>1000,12461=>1000,12462=>1000,12463=>1000,12464=>1000,12465=>1000,12466=>1000,12467=>1000,12468=>1000,12469=>1000, - 12470=>1000,12471=>1000,12472=>1000,12473=>1000,12474=>1000,12475=>1000,12476=>1000,12477=>1000,12478=>1000,12479=>1000,12480=>1000,12481=>1000,12482=>1000,12483=>1000,12484=>1000,12485=>1000, - 12486=>1000,12487=>1000,12488=>1000,12489=>1000,12490=>1000,12491=>1000,12492=>1000,12493=>1000,12494=>1000,12495=>1000,12496=>1000,12497=>1000,12498=>1000,12499=>1000,12500=>1000,12501=>1000, - 12502=>1000,12503=>1000,12504=>1000,12505=>1000,12506=>1000,12507=>1000,12508=>1000,12509=>1000,12510=>1000,12511=>1000,12512=>1000,12513=>1000,12514=>1000,12515=>1000,12516=>1000,12517=>1000, - 12518=>1000,12519=>1000,12520=>1000,12521=>1000,12522=>1000,12523=>1000,12524=>1000,12525=>1000,12526=>1000,12527=>1000,12528=>1000,12529=>1000,12530=>1000,12531=>1000,12532=>1000,12533=>1000, - 12534=>1000,12535=>1000,12536=>1000,12537=>1000,12538=>1000,12539=>1000,12540=>1000,12541=>1000,12542=>1000,12549=>1000,12550=>1000,12551=>1000,12552=>1000,12553=>1000,12554=>1000,12555=>1000, - 12556=>1000,12557=>1000,12558=>1000,12559=>1000,12560=>1000,12561=>1000,12562=>1000,12563=>1000,12564=>1000,12565=>1000,12566=>1000,12567=>1000,12568=>1000,12569=>1000,12570=>1000,12571=>1000, - 12572=>1000,12573=>1000,12574=>1000,12575=>1000,12576=>1000,12577=>1000,12578=>1000,12579=>1000,12580=>1000,12581=>1000,12582=>1000,12583=>1000,12584=>1000,12585=>1000,12586=>1000,12587=>1000, - 12588=>1000,12593=>1000,12594=>1000,12595=>1000,12596=>1000,12597=>1000,12598=>1000,12599=>1000,12600=>1000,12601=>1000,12602=>1000,12603=>1000,12604=>1000,12605=>1000,12606=>1000,12607=>1000, - 12608=>1000,12609=>1000,12610=>1000,12611=>1000,12612=>1000,12613=>1000,12614=>1000,12615=>1000,12616=>1000,12617=>1000,12618=>1000,12619=>1000,12620=>1000,12621=>1000,12622=>1000,12623=>1000, - 12624=>1000,12625=>1000,12626=>1000,12627=>1000,12628=>1000,12629=>1000,12630=>1000,12631=>1000,12632=>1000,12633=>1000,12634=>1000,12635=>1000,12636=>1000,12637=>1000,12638=>1000,12639=>1000, - 12640=>1000,12641=>1000,12642=>1000,12643=>1000,12644=>1000,12645=>1000,12646=>1000,12647=>1000,12648=>1000,12649=>1000,12650=>1000,12651=>1000,12652=>1000,12653=>1000,12654=>1000,12655=>1000, - 12656=>1000,12657=>1000,12658=>1000,12659=>1000,12660=>1000,12661=>1000,12662=>1000,12663=>1000,12664=>1000,12665=>1000,12666=>1000,12667=>1000,12668=>1000,12669=>1000,12670=>1000,12671=>1000, - 12672=>1000,12673=>1000,12674=>1000,12675=>1000,12676=>1000,12677=>1000,12678=>1000,12679=>1000,12680=>1000,12681=>1000,12682=>1000,12683=>1000,12684=>1000,12685=>1000,12686=>1000,12688=>1000, - 12689=>1000,12690=>1000,12691=>1000,12692=>1000,12693=>1000,12694=>1000,12695=>1000,12696=>1000,12697=>1000,12698=>1000,12699=>1000,12700=>1000,12701=>1000,12702=>1000,12703=>1000,12800=>1000, - 12801=>1000,12802=>1000,12803=>1000,12804=>1000,12805=>1000,12806=>1000,12807=>1000,12808=>1000,12809=>1000,12810=>1000,12811=>1000,12812=>1000,12813=>1000,12814=>1000,12815=>1000,12816=>1000, - 12817=>1000,12818=>1000,12819=>1000,12820=>1000,12821=>1000,12822=>1000,12823=>1000,12824=>1000,12825=>1000,12826=>1000,12827=>1000,12828=>1000,12832=>1000,12833=>1000,12834=>1000,12835=>1000, - 12836=>1000,12837=>1000,12838=>1000,12839=>1000,12840=>1000,12841=>1000,12842=>1000,12843=>1000,12844=>1000,12845=>1000,12846=>1000,12847=>1000,12848=>1000,12849=>1000,12850=>1000,12851=>1000, - 12852=>1000,12853=>1000,12854=>1000,12855=>1000,12856=>1000,12857=>1000,12858=>1000,12859=>1000,12860=>1000,12861=>1000,12862=>1000,12863=>1000,12864=>1000,12865=>1000,12866=>1000,12867=>1000, - 12896=>1000,12897=>1000,12898=>1000,12899=>1000,12900=>1000,12901=>1000,12902=>1000,12903=>1000,12904=>1000,12905=>1000,12906=>1000,12907=>1000,12908=>1000,12909=>1000,12910=>1000,12911=>1000, - 12912=>1000,12913=>1000,12914=>1000,12915=>1000,12916=>1000,12917=>1000,12918=>1000,12919=>1000,12920=>1000,12921=>1000,12922=>1000,12923=>1000,12927=>1000,12928=>1000,12929=>1000,12930=>1000, - 12931=>1000,12932=>1000,12933=>1000,12934=>1000,12935=>1000,12936=>1000,12937=>1000,12938=>1000,12939=>1000,12940=>1000,12941=>1000,12942=>1000,12943=>1000,12944=>1000,12945=>1000,12946=>1000, - 12947=>1000,12948=>1000,12949=>1000,12950=>1000,12951=>1000,12952=>1000,12953=>1000,12954=>1000,12955=>1000,12956=>1000,12957=>1000,12958=>1000,12959=>1000,12960=>1000,12961=>1000,12962=>1000, - 12963=>1000,12964=>1000,12965=>1000,12966=>1000,12967=>1000,12968=>1000,12969=>1000,12970=>1000,12971=>1000,12972=>1000,12973=>1000,12974=>1000,12975=>1000,12976=>1000,12992=>1000,12993=>1000, - 12994=>1000,12995=>1000,12996=>1000,12997=>1000,12998=>1000,12999=>1000,13000=>1000,13001=>1000,13002=>1000,13003=>1000,13008=>1000,13009=>1000,13010=>1000,13011=>1000,13012=>1000,13013=>1000, - 13014=>1000,13015=>1000,13016=>1000,13017=>1000,13018=>1000,13019=>1000,13020=>1000,13021=>1000,13022=>1000,13023=>1000,13024=>1000,13025=>1000,13026=>1000,13027=>1000,13028=>1000,13029=>1000, - 13030=>1000,13031=>1000,13032=>1000,13033=>1000,13034=>1000,13035=>1000,13036=>1000,13037=>1000,13038=>1000,13039=>1000,13040=>1000,13041=>1000,13042=>1000,13043=>1000,13044=>1000,13045=>1000, - 13046=>1000,13047=>1000,13048=>1000,13049=>1000,13050=>1000,13051=>1000,13052=>1000,13053=>1000,13054=>1000,13056=>1000,13057=>1000,13058=>1000,13059=>1000,13060=>1000,13061=>1000,13062=>1000, - 13063=>1000,13064=>1000,13065=>1000,13066=>1000,13067=>1000,13068=>1000,13069=>1000,13070=>1000,13071=>1000,13072=>1000,13073=>1000,13074=>1000,13075=>1000,13076=>1000,13077=>1000,13078=>1000, - 13079=>1000,13080=>1000,13081=>1000,13082=>1000,13083=>1000,13084=>1000,13085=>1000,13086=>1000,13087=>1000,13088=>1000,13089=>1000,13090=>1000,13091=>1000,13092=>1000,13093=>1000,13094=>1000, - 13095=>1000,13096=>1000,13097=>1000,13098=>1000,13099=>1000,13100=>1000,13101=>1000,13102=>1000,13103=>1000,13104=>1000,13105=>1000,13106=>1000,13107=>1000,13108=>1000,13109=>1000,13110=>1000, - 13111=>1000,13112=>1000,13113=>1000,13114=>1000,13115=>1000,13116=>1000,13117=>1000,13118=>1000,13119=>1000,13120=>1000,13121=>1000,13122=>1000,13123=>1000,13124=>1000,13125=>1000,13126=>1000, - 13127=>1000,13128=>1000,13129=>1000,13130=>1000,13131=>1000,13132=>1000,13133=>1000,13134=>1000,13135=>1000,13136=>1000,13137=>1000,13138=>1000,13139=>1000,13140=>1000,13141=>1000,13142=>1000, - 13143=>1000,13144=>1000,13145=>1000,13146=>1000,13147=>1000,13148=>1000,13149=>1000,13150=>1000,13151=>1000,13152=>1000,13153=>1000,13154=>1000,13155=>1000,13156=>1000,13157=>1000,13158=>1000, - 13159=>1000,13160=>1000,13161=>1000,13162=>1000,13163=>1000,13164=>1000,13165=>1000,13166=>1000,13167=>1000,13168=>1000,13169=>1000,13170=>1000,13171=>1000,13172=>1000,13173=>1000,13174=>1000, - 13179=>1000,13180=>1000,13181=>1000,13182=>1000,13183=>1000,13184=>1000,13185=>1000,13186=>1000,13187=>1000,13188=>1000,13189=>1000,13190=>1000,13191=>1000,13192=>1000,13193=>1000,13194=>1000, - 13195=>1000,13196=>1000,13197=>1000,13198=>1000,13199=>1000,13200=>1000,13201=>1000,13202=>1000,13203=>1000,13204=>1000,13205=>1000,13206=>1000,13207=>1000,13208=>1000,13209=>1000,13210=>1000, - 13211=>1000,13212=>1000,13213=>1000,13214=>1000,13215=>1000,13216=>1000,13217=>1000,13218=>1000,13219=>1000,13220=>1000,13221=>1000,13222=>1000,13223=>1000,13224=>1000,13225=>1000,13226=>1000, - 13227=>1000,13228=>1000,13229=>1000,13230=>1000,13231=>1000,13232=>1000,13233=>1000,13234=>1000,13235=>1000,13236=>1000,13237=>1000,13238=>1000,13239=>1000,13240=>1000,13241=>1000,13242=>1000, - 13243=>1000,13244=>1000,13245=>1000,13246=>1000,13247=>1000,13248=>1000,13249=>1000,13250=>1000,13251=>1000,13252=>1000,13253=>1000,13254=>1000,13255=>1000,13256=>1000,13257=>1000,13258=>1000, - 13259=>1000,13260=>1000,13261=>1000,13262=>1000,13263=>1000,13264=>1000,13265=>1000,13266=>1000,13267=>1000,13268=>1000,13269=>1000,13270=>1000,13271=>1000,13272=>1000,13273=>1000,13274=>1000, - 13275=>1000,13276=>1000,13277=>1000,13280=>1000,13281=>1000,13282=>1000,13283=>1000,13284=>1000,13285=>1000,13286=>1000,13287=>1000,13288=>1000,13289=>1000,13290=>1000,13291=>1000,13292=>1000, - 13293=>1000,13294=>1000,13295=>1000,13296=>1000,13297=>1000,13298=>1000,13299=>1000,13300=>1000,13301=>1000,13302=>1000,13303=>1000,13304=>1000,13305=>1000,13306=>1000,13307=>1000,13308=>1000, - 13309=>1000,13310=>1000,59393=>316,59394=>507,59395=>507,59396=>484,59397=>484,59416=>0,59492=>480,59495=>480,59536=>458,59557=>466,59558=>480,59559=>903,61441=>500,61442=>500, - 63232=>541,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>849, - 63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>333,63261=>287,63744=>1000,63745=>1000,63746=>1000, - 63747=>1000,63748=>1000,63749=>1000,63750=>1000,63751=>1000,63752=>1000,63753=>1000,63754=>1000,63755=>1000,63756=>1000,63757=>1000,63758=>1000,63759=>1000,63760=>1000,63761=>1000,63762=>1000, - 63763=>1000,63764=>1000,63765=>1000,63766=>1000,63767=>1000,63768=>1000,63769=>1000,63770=>1000,63771=>1000,63772=>1000,63773=>1000,63774=>1000,63775=>1000,63776=>1000,63777=>1000,63778=>1000, - 63779=>1000,63780=>1000,63781=>1000,63782=>1000,63783=>1000,63784=>1000,63785=>1000,63786=>1000,63787=>1000,63788=>1000,63789=>1000,63790=>1000,63791=>1000,63792=>1000,63793=>1000,63794=>1000, - 63795=>1000,63796=>1000,63797=>1000,63798=>1000,63799=>1000,63800=>1000,63801=>1000,63802=>1000,63803=>1000,63804=>1000,63805=>1000,63806=>1000,63807=>1000,63808=>1000,63809=>1000,63810=>1000, - 63811=>1000,63812=>1000,63813=>1000,63814=>1000,63815=>1000,63816=>1000,63817=>1000,63818=>1000,63819=>1000,63820=>1000,63821=>1000,63822=>1000,63823=>1000,63824=>1000,63825=>1000,63826=>1000, - 63827=>1000,63828=>1000,63829=>1000,63830=>1000,63831=>1000,63832=>1000,63833=>1000,63834=>1000,63835=>1000,63836=>1000,63837=>1000,63838=>1000,63839=>1000,63840=>1000,63841=>1000,63842=>1000, - 63843=>1000,63844=>1000,63845=>1000,63846=>1000,63847=>1000,63848=>1000,63849=>1000,63850=>1000,63851=>1000,63852=>1000,63853=>1000,63854=>1000,63855=>1000,63856=>1000,63857=>1000,63858=>1000, - 63859=>1000,63860=>1000,63861=>1000,63862=>1000,63863=>1000,63864=>1000,63865=>1000,63866=>1000,63867=>1000,63868=>1000,63869=>1000,63870=>1000,63871=>1000,63872=>1000,63873=>1000,63874=>1000, - 63875=>1000,63876=>1000,63877=>1000,63878=>1000,63879=>1000,63880=>1000,63881=>1000,63882=>1000,63883=>1000,63884=>1000,63885=>1000,63886=>1000,63887=>1000,63888=>1000,63889=>1000,63890=>1000, - 63891=>1000,63892=>1000,63893=>1000,63894=>1000,63895=>1000,63896=>1000,63897=>1000,63898=>1000,63899=>1000,63900=>1000,63901=>1000,63902=>1000,63903=>1000,63904=>1000,63905=>1000,63906=>1000, - 63907=>1000,63908=>1000,63909=>1000,63910=>1000,63911=>1000,63912=>1000,63913=>1000,63914=>1000,63915=>1000,63916=>1000,63917=>1000,63918=>1000,63919=>1000,63920=>1000,63921=>1000,63922=>1000, - 63923=>1000,63924=>1000,63925=>1000,63926=>1000,63927=>1000,63928=>1000,63929=>1000,63930=>1000,63931=>1000,63932=>1000,63933=>1000,63934=>1000,63935=>1000,63936=>1000,63937=>1000,63938=>1000, - 63939=>1000,63940=>1000,63941=>1000,63942=>1000,63943=>1000,63944=>1000,63945=>1000,63946=>1000,63947=>1000,63948=>1000,63949=>1000,63950=>1000,63951=>1000,63952=>1000,63953=>1000,63954=>1000, - 63955=>1000,63956=>1000,63957=>1000,63958=>1000,63959=>1000,63960=>1000,63961=>1000,63962=>1000,63963=>1000,63964=>1000,63965=>1000,63966=>1000,63967=>1000,63968=>1000,63969=>1000,63970=>1000, - 63971=>1000,63972=>1000,63973=>1000,63974=>1000,63975=>1000,63976=>1000,63977=>1000,63978=>1000,63979=>1000,63980=>1000,63981=>1000,63982=>1000,63983=>1000,63984=>1000,63985=>1000,63986=>1000, - 63987=>1000,63988=>1000,63989=>1000,63990=>1000,63991=>1000,63992=>1000,63993=>1000,63994=>1000,63995=>1000,63996=>1000,63997=>1000,63998=>1000,63999=>1000,64000=>1000,64001=>1000,64002=>1000, - 64003=>1000,64004=>1000,64005=>1000,64006=>1000,64007=>1000,64008=>1000,64009=>1000,64010=>1000,64011=>1000,64012=>1000,64013=>1000,64014=>1000,64015=>1000,64016=>1000,64017=>1000,64018=>1000, - 64019=>1000,64020=>1000,64021=>1000,64022=>1000,64023=>1000,64024=>1000,64025=>1000,64026=>1000,64027=>1000,64028=>1000,64029=>1000,64030=>1000,64031=>1000,64032=>1000,64033=>1000,64034=>1000, - 64035=>1000,64036=>1000,64037=>1000,64038=>1000,64039=>1000,64040=>1000,64041=>1000,64042=>1000,64043=>1000,64044=>1000,64045=>1000,64256=>537,64257=>500,64258=>500,64259=>778,64260=>750, - 64261=>532,64262=>758,64275=>784,64276=>784,64277=>784,64278=>784,64279=>893,64286=>333,64287=>590,64288=>550,64289=>709,64290=>649,64291=>730,64292=>656,64293=>605,64294=>730, - 64295=>633,64296=>794,64297=>584,64298=>700,64299=>700,64300=>700,64301=>700,64302=>577,64303=>577,64304=>577,64305=>563,64306=>411,64307=>512,64308=>594,64309=>316,64310=>326, - 64312=>594,64313=>316,64314=>507,64315=>527,64316=>484,64318=>594,64320=>338,64321=>604,64323=>567,64324=>569,64326=>514,64327=>583,64328=>507,64329=>700,64330=>633,64331=>316, - 64332=>563,64333=>527,64334=>569,64335=>577,64336=>243,64337=>273,64338=>771,64339=>788,64340=>276,64341=>243,64342=>771,64343=>788,64344=>276,64345=>243,64346=>771,64347=>788, - 64348=>276,64349=>243,64350=>771,64351=>788,64352=>276,64353=>243,64354=>771,64355=>788,64356=>276,64357=>243,64358=>771,64359=>788,64360=>276,64361=>243,64362=>957,64363=>903, - 64364=>466,64365=>480,64366=>957,64367=>903,64368=>466,64369=>480,64370=>544,64371=>658,64372=>646,64373=>637,64374=>544,64375=>658,64376=>646,64377=>637,64378=>544,64379=>658, - 64380=>646,64381=>637,64382=>544,64383=>658,64384=>646,64385=>637,64386=>430,64387=>458,64388=>430,64389=>458,64390=>430,64391=>458,64392=>430,64393=>458,64394=>421,64395=>436, - 64396=>421,64397=>436,64398=>828,64399=>942,64400=>432,64401=>549,64402=>828,64403=>942,64404=>432,64405=>549,64406=>828,64407=>942,64408=>432,64409=>549,64410=>828,64411=>942, - 64412=>432,64413=>549,64414=>692,64415=>723,64416=>692,64417=>723,64418=>276,64419=>243,64420=>514,64421=>477,64422=>514,64423=>509,64424=>273,64425=>427,64426=>706,64427=>706, - 64428=>686,64429=>686,64430=>550,64431=>461,64432=>550,64433=>461,64467=>757,64468=>733,64469=>432,64470=>549,64471=>470,64472=>466,64473=>470,64474=>466,64475=>470,64476=>466, - 64477=>470,64478=>470,64479=>466,64480=>470,64481=>466,64482=>470,64483=>466,64484=>781,64485=>933,64486=>276,64487=>243,64488=>276,64489=>243,64490=>547,64491=>517,64492=>783, - 64493=>753,64494=>740,64495=>710,64496=>740,64497=>710,64498=>740,64499=>710,64500=>740,64501=>710,64502=>1207,64503=>1177,64504=>517,64505=>1067,64506=>1037,64507=>517,64508=>731, - 64509=>793,64510=>276,64511=>243,64512=>932,64513=>932,64514=>914,64515=>1067,64516=>1077,64517=>935,64518=>935,64519=>935,64520=>917,64521=>1070,64522=>1080,64523=>932,64524=>932, - 64525=>932,64526=>914,64527=>1067,64528=>1077,64529=>932,64530=>914,64531=>1067,64532=>1077,64533=>1305,64534=>1287,64535=>1305,64536=>1287,64537=>1305,64538=>1305,64539=>1287,64540=>1429, - 64541=>1429,64542=>1429,64543=>1411,64544=>1476,64545=>1458,64546=>1476,64547=>1476,64548=>1476,64549=>1458,64550=>1392,64551=>1374,64552=>1374,64553=>1245,64554=>1227,64555=>1245,64556=>1227, - 64557=>1125,64558=>1125,64559=>1125,64560=>1107,64561=>1260,64562=>1270,64563=>1125,64564=>1107,64565=>1260,64566=>1270,64567=>706,64568=>1091,64569=>1091,64570=>1091,64571=>1106,64572=>1073, - 64573=>1226,64574=>1236,64575=>932,64576=>932,64577=>932,64578=>914,64579=>1067,64580=>1077,64581=>1140,64582=>1140,64583=>1140,64584=>1122,64585=>1275,64586=>1285,64587=>932,64588=>932, - 64589=>932,64590=>914,64591=>1067,64592=>1077,64593=>1345,64594=>1327,64595=>1480,64596=>1490,64597=>932,64598=>932,64599=>932,64600=>914,64601=>1067,64602=>1077,64603=>430,64604=>421, - 64605=>731,64606=>296,64607=>300,64608=>300,64609=>300,64610=>300,64611=>300,64612=>680,64613=>680,64614=>884,64615=>967,64616=>1037,64617=>1047,64618=>680,64619=>680,64620=>884, - 64621=>967,64622=>1037,64623=>1047,64624=>680,64625=>680,64626=>884,64627=>967,64628=>1037,64629=>1047,64630=>680,64631=>680,64632=>884,64633=>967,64634=>1037,64635=>1047,64636=>1274, - 64637=>1284,64638=>1274,64639=>1284,64640=>821,64641=>1221,64642=>1188,64643=>1341,64644=>1351,64645=>884,64646=>1037,64647=>1047,64648=>806,64649=>1173,64650=>680,64651=>680,64652=>884, - 64653=>967,64654=>1037,64655=>1047,64656=>793,64657=>680,64658=>680,64659=>884,64660=>967,64661=>1037,64662=>1047,64663=>911,64664=>911,64665=>911,64666=>806,64667=>679,64668=>911, - 64669=>911,64670=>911,64671=>806,64672=>679,64673=>911,64674=>911,64675=>911,64676=>806,64677=>679,64678=>806,64679=>1284,64680=>1179,64681=>1284,64682=>1179,64683=>1284,64684=>1179, - 64685=>1408,64686=>1408,64687=>1408,64688=>1303,64689=>1455,64690=>1455,64691=>1350,64692=>1455,64693=>1455,64694=>1455,64695=>1350,64696=>1371,64697=>1266,64698=>1224,64699=>1119,64700=>1224, - 64701=>1119,64702=>1104,64703=>1104,64704=>1104,64705=>999,64706=>1104,64707=>999,64708=>1070,64709=>1070,64710=>1070,64711=>676,64712=>965,64713=>911,64714=>911,64715=>911,64716=>806, - 64717=>679,64718=>1119,64719=>1119,64720=>1119,64721=>1014,64722=>911,64723=>911,64724=>911,64725=>806,64726=>679,64727=>1324,64728=>1219,64729=>686,64730=>911,64731=>911,64732=>911, - 64733=>806,64734=>679,64735=>776,64736=>649,64737=>776,64738=>649,64739=>776,64740=>649,64741=>776,64742=>649,64743=>1303,64744=>1176,64745=>1303,64746=>1176,64747=>793,64748=>1082, - 64749=>776,64750=>776,64751=>649,64752=>776,64753=>649,64754=>306,64755=>302,64756=>298,64757=>1527,64758=>1537,64759=>1380,64760=>1390,64761=>1380,64762=>1390,64763=>1564,64764=>1574, - 64765=>1564,64766=>1574,64767=>1440,64768=>1450,64769=>1440,64770=>1450,64771=>1440,64772=>1450,64773=>1611,64774=>1621,64775=>1611,64776=>1621,64777=>1429,64778=>1429,64779=>1429,64780=>1411, - 64781=>1207,64782=>1207,64783=>1254,64784=>1254,64785=>1527,64786=>1537,64787=>1348,64788=>1358,64789=>1348,64790=>1358,64791=>1564,64792=>1574,64793=>1564,64794=>1574,64795=>1431,64796=>1441, - 64797=>1431,64798=>1441,64799=>1431,64800=>1441,64801=>1611,64802=>1621,64803=>1611,64804=>1621,64805=>1429,64806=>1429,64807=>1429,64808=>1411,64809=>1207,64810=>1207,64811=>1254,64812=>1254, - 64813=>1408,64814=>1408,64815=>1408,64816=>1303,64817=>1176,64818=>1176,64819=>1266,64820=>1408,64821=>1408,64822=>1408,64823=>1408,64824=>1408,64825=>1408,64826=>1266,64827=>1266,64828=>273, - 64829=>243,64830=>600,64831=>600,64848=>1444,64849=>1541,64850=>1549,64851=>1444,64852=>1444,64853=>1444,64854=>1444,64855=>1444,64856=>1830,64857=>1817,64858=>1975,64859=>1964,64860=>2046, - 64861=>2046,64862=>2202,64863=>1962,64864=>1941,64865=>1941,64866=>1944,64867=>1836,64868=>2114,64869=>2093,64870=>1991,64871=>2049,64872=>1941,64873=>2212,64874=>1962,64875=>1941,64876=>1944, - 64877=>1836,64878=>2249,64879=>2096,64880=>1988,64881=>1925,64882=>1904,64883=>1799,64884=>2070,64885=>1833,64886=>1729,64887=>1652,64888=>1881,64889=>1729,64890=>1892,64891=>1881,64892=>1759, - 64893=>1637,64894=>1670,64895=>1654,64896=>1522,64897=>1686,64898=>1675,64899=>1549,64900=>1541,64901=>1522,64902=>1444,64903=>1436,64904=>1444,64905=>1757,64906=>1652,64907=>1975,64908=>1757, - 64909=>1652,64910=>1757,64911=>1652,64914=>1757,64915=>1857,64916=>1752,64917=>1444,64918=>1675,64919=>1522,64920=>1444,64921=>1675,64922=>1581,64923=>1570,64924=>1417,64925=>1362,64926=>1686, - 64927=>1686,64928=>1675,64929=>1686,64930=>1675,64931=>1581,64932=>1570,64933=>1975,64934=>2069,64935=>1964,64936=>2202,64937=>2259,64938=>2212,64939=>2259,64940=>1686,64941=>1581,64942=>1686, - 64943=>1686,64944=>1581,64945=>1870,64946=>1817,64947=>1686,64948=>1637,64949=>1444,64950=>1892,64951=>1886,64952=>1549,64953=>1975,64954=>1444,64955=>1723,64956=>1522,64957=>1541,64958=>2080, - 64959=>2080,64960=>1975,64961=>1817,64962=>1686,64963=>1499,64964=>1757,64965=>1883,64966=>2212,64967=>1686,65008=>1523,65009=>1172,65010=>1159,65011=>1356,65012=>2111,65013=>2258,65014=>2130, - 65015=>1552,65016=>2046,65017=>1856,65018=>1930,65019=>1070,65056=>450,65057=>450,65058=>450,65059=>450,65072=>1000,65073=>1000,65074=>1000,65075=>1000,65076=>1000,65077=>1000,65078=>1000, - 65079=>1000,65080=>1000,65081=>1000,65082=>1000,65083=>1000,65084=>1000,65085=>1000,65086=>1000,65087=>1000,65088=>1000,65089=>1000,65090=>1000,65091=>1000,65092=>1000,65097=>1000,65098=>1000, - 65099=>1000,65100=>1000,65101=>1000,65102=>1000,65103=>1000,65104=>167,65105=>250,65106=>167,65108=>167,65109=>167,65110=>334,65111=>167,65112=>600,65113=>200,65114=>200,65115=>200, - 65116=>200,65117=>200,65118=>200,65119=>334,65120=>400,65121=>233,65122=>350,65123=>200,65124=>350,65125=>350,65126=>350,65128=>167,65129=>334,65130=>533,65131=>609,65136=>300, - 65137=>298,65138=>296,65140=>298,65142=>300,65143=>298,65144=>300,65145=>302,65146=>298,65147=>296,65148=>306,65149=>306,65150=>154,65151=>154,65152=>529,65153=>243,65154=>273, - 65155=>243,65156=>273,65157=>470,65158=>466,65159=>243,65160=>273,65161=>731,65162=>793,65163=>276,65164=>243,65165=>243,65166=>273,65167=>771,65168=>788,65169=>276,65170=>243, - 65171=>514,65172=>477,65173=>771,65174=>788,65175=>276,65176=>243,65177=>771,65178=>788,65179=>276,65180=>243,65181=>544,65182=>658,65183=>646,65184=>637,65185=>544,65186=>658, - 65187=>646,65188=>637,65189=>544,65190=>658,65191=>646,65192=>637,65193=>430,65194=>458,65195=>430,65196=>458,65197=>421,65198=>436,65199=>421,65200=>436,65201=>1194,65202=>1194, - 65203=>770,65204=>770,65205=>1194,65206=>1194,65207=>770,65208=>770,65209=>1291,65210=>1291,65211=>817,65212=>817,65213=>1291,65214=>1291,65215=>817,65216=>817,65217=>843,65218=>843, - 65219=>733,65220=>733,65221=>843,65222=>843,65223=>733,65224=>733,65225=>594,65226=>556,65227=>586,65228=>554,65229=>594,65230=>556,65231=>586,65232=>554,65233=>957,65234=>903, - 65235=>466,65236=>480,65237=>800,65238=>823,65239=>466,65240=>480,65241=>757,65242=>733,65243=>432,65244=>549,65245=>662,65246=>673,65247=>273,65248=>243,65249=>589,65250=>640, - 65251=>481,65252=>532,65253=>692,65254=>723,65255=>276,65256=>243,65257=>514,65258=>477,65259=>686,65260=>405,65261=>470,65262=>466,65263=>731,65264=>793,65265=>731,65266=>803, - 65267=>276,65268=>243,65269=>551,65270=>603,65271=>551,65272=>603,65273=>551,65274=>603,65275=>551,65276=>603,65281=>1000,65282=>1000,65283=>1000,65284=>1000,65285=>1000,65286=>1000, - 65287=>1000,65288=>1000,65289=>1000,65290=>1000,65291=>1000,65292=>1000,65293=>1000,65294=>1000,65295=>1000,65296=>1000,65297=>1000,65298=>1000,65299=>1000,65300=>1000,65301=>1000,65302=>1000, - 65303=>1000,65304=>1000,65305=>1000,65306=>1000,65307=>1000,65308=>1000,65309=>1000,65310=>1000,65311=>1000,65312=>1000,65313=>1000,65314=>1000,65315=>1000,65316=>1000,65317=>1000,65318=>1000, - 65319=>1000,65320=>1000,65321=>1000,65322=>1000,65323=>1000,65324=>1000,65325=>1000,65326=>1000,65327=>1000,65328=>1000,65329=>1000,65330=>1000,65331=>1000,65332=>1000,65333=>1000,65334=>1000, - 65335=>1000,65336=>1000,65337=>1000,65338=>1000,65339=>1000,65340=>1000,65341=>1000,65342=>1000,65343=>1000,65344=>1000,65345=>1000,65346=>1000,65347=>1000,65348=>1000,65349=>1000,65350=>1000, - 65351=>1000,65352=>1000,65353=>1000,65354=>1000,65355=>1000,65356=>1000,65357=>1000,65358=>1000,65359=>1000,65360=>1000,65361=>1000,65362=>1000,65363=>1000,65364=>1000,65365=>1000,65366=>1000, - 65367=>1000,65368=>1000,65369=>1000,65370=>1000,65371=>1000,65372=>1000,65373=>1000,65374=>1000,65377=>500,65378=>500,65379=>500,65380=>500,65381=>500,65382=>500,65383=>500,65384=>500, - 65385=>500,65386=>500,65387=>500,65388=>500,65389=>500,65390=>500,65391=>500,65392=>500,65393=>500,65394=>500,65395=>500,65396=>500,65397=>500,65398=>500,65399=>500,65400=>500, - 65401=>500,65402=>500,65403=>500,65404=>500,65405=>500,65406=>500,65407=>500,65408=>500,65409=>500,65410=>500,65411=>500,65412=>500,65413=>500,65414=>500,65415=>500,65416=>500, - 65417=>500,65418=>500,65419=>500,65420=>500,65421=>500,65422=>500,65423=>500,65424=>500,65425=>500,65426=>500,65427=>500,65428=>500,65429=>500,65430=>500,65431=>500,65432=>500, - 65433=>500,65434=>500,65435=>500,65436=>500,65437=>500,65438=>500,65439=>500,65440=>500,65441=>500,65442=>500,65443=>500,65444=>500,65445=>500,65446=>500,65447=>500,65448=>500, - 65449=>500,65450=>500,65451=>500,65452=>500,65453=>500,65454=>500,65455=>500,65456=>500,65457=>500,65458=>500,65459=>500,65460=>500,65461=>500,65462=>500,65463=>500,65464=>500, - 65465=>500,65466=>500,65467=>500,65468=>500,65469=>500,65470=>500,65474=>500,65475=>500,65476=>500,65477=>500,65478=>500,65479=>500,65482=>500,65483=>500,65484=>500,65485=>500, - 65486=>500,65487=>500,65490=>500,65491=>500,65492=>500,65493=>500,65494=>500,65495=>500,65498=>500,65499=>500,65500=>500,65504=>1000,65505=>1000,65506=>1000,65507=>1000,65508=>1000, - 65509=>1000,65510=>1000,65512=>500,65513=>500,65514=>500,65515=>500,65516=>500,65517=>500,65518=>500,65532=>1000,65533=>1000,19968=>1000,19969=>1000,19970=>1000,19971=>1000,19972=>1000, - 19973=>1000,19974=>1000,19975=>1000,19976=>1000,19977=>1000,19978=>1000,19979=>1000,19980=>1000,19981=>1000,19982=>1000,19983=>1000,19984=>1000,19985=>1000,19986=>1000,19987=>1000,19988=>1000, - 19989=>1000,19990=>1000,19991=>1000,19992=>1000,19993=>1000,19994=>1000,19995=>1000,19996=>1000,19997=>1000,19998=>1000,19999=>1000,20000=>1000,20001=>1000,20002=>1000,20003=>1000,20004=>1000, - 20005=>1000,20006=>1000,20007=>1000,20008=>1000,20009=>1000,20010=>1000,20011=>1000,20012=>1000,20013=>1000,20014=>1000,20015=>1000,20016=>1000,20017=>1000,20018=>1000,20019=>1000,20020=>1000, - 20021=>1000,20022=>1000,20023=>1000,20024=>1000,20025=>1000,20026=>1000,20027=>1000,20028=>1000,20029=>1000,20030=>1000,20031=>1000,20032=>1000,20033=>1000,20034=>1000,20035=>1000,20036=>1000, - 20037=>1000,20038=>1000,20039=>1000,20040=>1000,20041=>1000,20042=>1000,20043=>1000,20044=>1000,20045=>1000,20046=>1000,20047=>1000,20048=>1000,20049=>1000,20050=>1000,20051=>1000,20052=>1000, - 20053=>1000,20054=>1000,20055=>1000,20056=>1000,20057=>1000,20058=>1000,20059=>1000,20060=>1000,20061=>1000,20062=>1000,20063=>1000,20064=>1000,20065=>1000,20066=>1000,20067=>1000,20068=>1000, - 20069=>1000,20070=>1000,20071=>1000,20072=>1000,20073=>1000,20074=>1000,20075=>1000,20076=>1000,20077=>1000,20078=>1000,20079=>1000,20080=>1000,20081=>1000,20082=>1000,20083=>1000,20084=>1000, - 20085=>1000,20086=>1000,20087=>1000,20088=>1000,20089=>1000,20090=>1000,20091=>1000,20092=>1000,20093=>1000,20094=>1000,20095=>1000,20096=>1000,20097=>1000,20098=>1000,20099=>1000,20100=>1000, - 20101=>1000,20102=>1000,20103=>1000,20104=>1000,20105=>1000,20106=>1000,20107=>1000,20108=>1000,20109=>1000,20110=>1000,20111=>1000,20112=>1000,20113=>1000,20114=>1000,20115=>1000,20116=>1000, - 20117=>1000,20118=>1000,20119=>1000,20120=>1000,20121=>1000,20122=>1000,20123=>1000,20124=>1000,20125=>1000,20126=>1000,20127=>1000,20128=>1000,20129=>1000,20130=>1000,20131=>1000,20132=>1000, - 20133=>1000,20134=>1000,20135=>1000,20136=>1000,20137=>1000,20138=>1000,20139=>1000,20140=>1000,20141=>1000,20142=>1000,20143=>1000,20144=>1000,20145=>1000,20146=>1000,20147=>1000,20148=>1000, - 20149=>1000,20150=>1000,20151=>1000,20152=>1000,20153=>1000,20154=>1000,20155=>1000,20156=>1000,20157=>1000,20158=>1000,20159=>1000,20160=>1000,20161=>1000,20162=>1000,20163=>1000,20164=>1000, - 20165=>1000,20166=>1000,20167=>1000,20168=>1000,20169=>1000,20170=>1000,20171=>1000,20172=>1000,20173=>1000,20174=>1000,20175=>1000,20176=>1000,20177=>1000,20178=>1000,20179=>1000,20180=>1000, - 20181=>1000,20182=>1000,20183=>1000,20184=>1000,20185=>1000,20186=>1000,20187=>1000,20188=>1000,20189=>1000,20190=>1000,20191=>1000,20192=>1000,20193=>1000,20194=>1000,20195=>1000,20196=>1000, - 20197=>1000,20198=>1000,20199=>1000,20200=>1000,20201=>1000,20202=>1000,20203=>1000,20204=>1000,20205=>1000,20206=>1000,20207=>1000,20208=>1000,20209=>1000,20210=>1000,20211=>1000,20212=>1000, - 20213=>1000,20214=>1000,20215=>1000,20216=>1000,20217=>1000,20218=>1000,20219=>1000,20220=>1000,20221=>1000,20222=>1000,20223=>1000,20224=>1000,20225=>1000,20226=>1000,20227=>1000,20228=>1000, - 20229=>1000,20230=>1000,20231=>1000,20232=>1000,20233=>1000,20234=>1000,20235=>1000,20236=>1000,20237=>1000,20238=>1000,20239=>1000,20240=>1000,20241=>1000,20242=>1000,20243=>1000,20244=>1000, - 20245=>1000,20246=>1000,20247=>1000,20248=>1000,20249=>1000,20250=>1000,20251=>1000,20252=>1000,20253=>1000,20254=>1000,20255=>1000,20256=>1000,20257=>1000,20258=>1000,20259=>1000,20260=>1000, - 20261=>1000,20262=>1000,20263=>1000,20264=>1000,20265=>1000,20266=>1000,20267=>1000,20268=>1000,20269=>1000,20270=>1000,20271=>1000,20272=>1000,20273=>1000,20274=>1000,20275=>1000,20276=>1000, - 20277=>1000,20278=>1000,20279=>1000,20280=>1000,20281=>1000,20282=>1000,20283=>1000,20284=>1000,20285=>1000,20286=>1000,20287=>1000,20288=>1000,20289=>1000,20290=>1000,20291=>1000,20292=>1000, - 20293=>1000,20294=>1000,20295=>1000,20296=>1000,20297=>1000,20298=>1000,20299=>1000,20300=>1000,20301=>1000,20302=>1000,20303=>1000,20304=>1000,20305=>1000,20306=>1000,20307=>1000,20308=>1000, - 20309=>1000,20310=>1000,20311=>1000,20312=>1000,20313=>1000,20314=>1000,20315=>1000,20316=>1000,20317=>1000,20318=>1000,20319=>1000,20320=>1000,20321=>1000,20322=>1000,20323=>1000,20324=>1000, - 20325=>1000,20326=>1000,20327=>1000,20328=>1000,20329=>1000,20330=>1000,20331=>1000,20332=>1000,20333=>1000,20334=>1000,20335=>1000,20336=>1000,20337=>1000,20338=>1000,20339=>1000,20340=>1000, - 20341=>1000,20342=>1000,20343=>1000,20344=>1000,20345=>1000,20346=>1000,20347=>1000,20348=>1000,20349=>1000,20350=>1000,20351=>1000,20352=>1000,20353=>1000,20354=>1000,20355=>1000,20356=>1000, - 20357=>1000,20358=>1000,20359=>1000,20360=>1000,20361=>1000,20362=>1000,20363=>1000,20364=>1000,20365=>1000,20366=>1000,20367=>1000,20368=>1000,20369=>1000,20370=>1000,20371=>1000,20372=>1000, - 20373=>1000,20374=>1000,20375=>1000,20376=>1000,20377=>1000,20378=>1000,20379=>1000,20380=>1000,20381=>1000,20382=>1000,20383=>1000,20384=>1000,20385=>1000,20386=>1000,20387=>1000,20388=>1000, - 20389=>1000,20390=>1000,20391=>1000,20392=>1000,20393=>1000,20394=>1000,20395=>1000,20396=>1000,20397=>1000,20398=>1000,20399=>1000,20400=>1000,20401=>1000,20402=>1000,20403=>1000,20404=>1000, - 20405=>1000,20406=>1000,20407=>1000,20408=>1000,20409=>1000,20410=>1000,20411=>1000,20412=>1000,20413=>1000,20414=>1000,20415=>1000,20416=>1000,20417=>1000,20418=>1000,20419=>1000,20420=>1000, - 20421=>1000,20422=>1000,20423=>1000,20424=>1000,20425=>1000,20426=>1000,20427=>1000,20428=>1000,20429=>1000,20430=>1000,20431=>1000,20432=>1000,20433=>1000,20434=>1000,20435=>1000,20436=>1000, - 20437=>1000,20438=>1000,20439=>1000,20440=>1000,20441=>1000,20442=>1000,20443=>1000,20444=>1000,20445=>1000,20446=>1000,20447=>1000,20448=>1000,20449=>1000,20450=>1000,20451=>1000,20452=>1000, - 20453=>1000,20454=>1000,20455=>1000,20456=>1000,20457=>1000,20458=>1000,20459=>1000,20460=>1000,20461=>1000,20462=>1000,20463=>1000,20464=>1000,20465=>1000,20466=>1000,20467=>1000,20468=>1000, - 20469=>1000,20470=>1000,20471=>1000,20472=>1000,20473=>1000,20474=>1000,20475=>1000,20476=>1000,20477=>1000,20478=>1000,20479=>1000,20480=>1000,20481=>1000,20482=>1000,20483=>1000,20484=>1000, - 20485=>1000,20486=>1000,20487=>1000,20488=>1000,20489=>1000,20490=>1000,20491=>1000,20492=>1000,20493=>1000,20494=>1000,20495=>1000,20496=>1000,20497=>1000,20498=>1000,20499=>1000,20500=>1000, - 20501=>1000,20502=>1000,20503=>1000,20504=>1000,20505=>1000,20506=>1000,20507=>1000,20508=>1000,20509=>1000,20510=>1000,20511=>1000,20512=>1000,20513=>1000,20514=>1000,20515=>1000,20516=>1000, - 20517=>1000,20518=>1000,20519=>1000,20520=>1000,20521=>1000,20522=>1000,20523=>1000,20524=>1000,20525=>1000,20526=>1000,20527=>1000,20528=>1000,20529=>1000,20530=>1000,20531=>1000,20532=>1000, - 20533=>1000,20534=>1000,20535=>1000,20536=>1000,20537=>1000,20538=>1000,20539=>1000,20540=>1000,20541=>1000,20542=>1000,20543=>1000,20544=>1000,20545=>1000,20546=>1000,20547=>1000,20548=>1000, - 20549=>1000,20550=>1000,20551=>1000,20552=>1000,20553=>1000,20554=>1000,20555=>1000,20556=>1000,20557=>1000,20558=>1000,20559=>1000,20560=>1000,20561=>1000,20562=>1000,20563=>1000,20564=>1000, - 20565=>1000,20566=>1000,20567=>1000,20568=>1000,20569=>1000,20570=>1000,20571=>1000,20572=>1000,20573=>1000,20574=>1000,20575=>1000,20576=>1000,20577=>1000,20578=>1000,20579=>1000,20580=>1000, - 20581=>1000,20582=>1000,20583=>1000,20584=>1000,20585=>1000,20586=>1000,20587=>1000,20588=>1000,20589=>1000,20590=>1000,20591=>1000,20592=>1000,20593=>1000,20594=>1000,20595=>1000,20596=>1000, - 20597=>1000,20598=>1000,20599=>1000,20600=>1000,20601=>1000,20602=>1000,20603=>1000,20604=>1000,20605=>1000,20606=>1000,20607=>1000,20608=>1000,20609=>1000,20610=>1000,20611=>1000,20612=>1000, - 20613=>1000,20614=>1000,20615=>1000,20616=>1000,20617=>1000,20618=>1000,20619=>1000,20620=>1000,20621=>1000,20622=>1000,20623=>1000,20624=>1000,20625=>1000,20626=>1000,20627=>1000,20628=>1000, - 20629=>1000,20630=>1000,20631=>1000,20632=>1000,20633=>1000,20634=>1000,20635=>1000,20636=>1000,20637=>1000,20638=>1000,20639=>1000,20640=>1000,20641=>1000,20642=>1000,20643=>1000,20644=>1000, - 20645=>1000,20646=>1000,20647=>1000,20648=>1000,20649=>1000,20650=>1000,20651=>1000,20652=>1000,20653=>1000,20654=>1000,20655=>1000,20656=>1000,20657=>1000,20658=>1000,20659=>1000,20660=>1000, - 20661=>1000,20662=>1000,20663=>1000,20664=>1000,20665=>1000,20666=>1000,20667=>1000,20668=>1000,20669=>1000,20670=>1000,20671=>1000,20672=>1000,20673=>1000,20674=>1000,20675=>1000,20676=>1000, - 20677=>1000,20678=>1000,20679=>1000,20680=>1000,20681=>1000,20682=>1000,20683=>1000,20684=>1000,20685=>1000,20686=>1000,20687=>1000,20688=>1000,20689=>1000,20690=>1000,20691=>1000,20692=>1000, - 20693=>1000,20694=>1000,20695=>1000,20696=>1000,20697=>1000,20698=>1000,20699=>1000,20700=>1000,20701=>1000,20702=>1000,20703=>1000,20704=>1000,20705=>1000,20706=>1000,20707=>1000,20708=>1000, - 20709=>1000,20710=>1000,20711=>1000,20712=>1000,20713=>1000,20714=>1000,20715=>1000,20716=>1000,20717=>1000,20718=>1000,20719=>1000,20720=>1000,20721=>1000,20722=>1000,20723=>1000,20724=>1000, - 20725=>1000,20726=>1000,20727=>1000,20728=>1000,20729=>1000,20730=>1000,20731=>1000,20732=>1000,20733=>1000,20734=>1000,20735=>1000,20736=>1000,20737=>1000,20738=>1000,20739=>1000,20740=>1000, - 20741=>1000,20742=>1000,20743=>1000,20744=>1000,20745=>1000,20746=>1000,20747=>1000,20748=>1000,20749=>1000,20750=>1000,20751=>1000,20752=>1000,20753=>1000,20754=>1000,20755=>1000,20756=>1000, - 20757=>1000,20758=>1000,20759=>1000,20760=>1000,20761=>1000,20762=>1000,20763=>1000,20764=>1000,20765=>1000,20766=>1000,20767=>1000,20768=>1000,20769=>1000,20770=>1000,20771=>1000,20772=>1000, - 20773=>1000,20774=>1000,20775=>1000,20776=>1000,20777=>1000,20778=>1000,20779=>1000,20780=>1000,20781=>1000,20782=>1000,20783=>1000,20784=>1000,20785=>1000,20786=>1000,20787=>1000,20788=>1000, - 20789=>1000,20790=>1000,20791=>1000,20792=>1000,20793=>1000,20794=>1000,20795=>1000,20796=>1000,20797=>1000,20798=>1000,20799=>1000,20800=>1000,20801=>1000,20802=>1000,20803=>1000,20804=>1000, - 20805=>1000,20806=>1000,20807=>1000,20808=>1000,20809=>1000,20810=>1000,20811=>1000,20812=>1000,20813=>1000,20814=>1000,20815=>1000,20816=>1000,20817=>1000,20818=>1000,20819=>1000,20820=>1000, - 20821=>1000,20822=>1000,20823=>1000,20824=>1000,20825=>1000,20826=>1000,20827=>1000,20828=>1000,20829=>1000,20830=>1000,20831=>1000,20832=>1000,20833=>1000,20834=>1000,20835=>1000,20836=>1000, - 20837=>1000,20838=>1000,20839=>1000,20840=>1000,20841=>1000,20842=>1000,20843=>1000,20844=>1000,20845=>1000,20846=>1000,20847=>1000,20848=>1000,20849=>1000,20850=>1000,20851=>1000,20852=>1000, - 20853=>1000,20854=>1000,20855=>1000,20856=>1000,20857=>1000,20858=>1000,20859=>1000,20860=>1000,20861=>1000,20862=>1000,20863=>1000,20864=>1000,20865=>1000,20866=>1000,20867=>1000,20868=>1000, - 20869=>1000,20870=>1000,20871=>1000,20872=>1000,20873=>1000,20874=>1000,20875=>1000,20876=>1000,20877=>1000,20878=>1000,20879=>1000,20880=>1000,20881=>1000,20882=>1000,20883=>1000,20884=>1000, - 20885=>1000,20886=>1000,20887=>1000,20888=>1000,20889=>1000,20890=>1000,20891=>1000,20892=>1000,20893=>1000,20894=>1000,20895=>1000,20896=>1000,20897=>1000,20898=>1000,20899=>1000,20900=>1000, - 20901=>1000,20902=>1000,20903=>1000,20904=>1000,20905=>1000,20906=>1000,20907=>1000,20908=>1000,20909=>1000,20910=>1000,20911=>1000,20912=>1000,20913=>1000,20914=>1000,20915=>1000,20916=>1000, - 20917=>1000,20918=>1000,20919=>1000,20920=>1000,20921=>1000,20922=>1000,20923=>1000,20924=>1000,20925=>1000,20926=>1000,20927=>1000,20928=>1000,20929=>1000,20930=>1000,20931=>1000,20932=>1000, - 20933=>1000,20934=>1000,20935=>1000,20936=>1000,20937=>1000,20938=>1000,20939=>1000,20940=>1000,20941=>1000,20942=>1000,20943=>1000,20944=>1000,20945=>1000,20946=>1000,20947=>1000,20948=>1000, - 20949=>1000,20950=>1000,20951=>1000,20952=>1000,20953=>1000,20954=>1000,20955=>1000,20956=>1000,20957=>1000,20958=>1000,20959=>1000,20960=>1000,20961=>1000,20962=>1000,20963=>1000,20964=>1000, - 20965=>1000,20966=>1000,20967=>1000,20968=>1000,20969=>1000,20970=>1000,20971=>1000,20972=>1000,20973=>1000,20974=>1000,20975=>1000,20976=>1000,20977=>1000,20978=>1000,20979=>1000,20980=>1000, - 20981=>1000,20982=>1000,20983=>1000,20984=>1000,20985=>1000,20986=>1000,20987=>1000,20988=>1000,20989=>1000,20990=>1000,20991=>1000,20992=>1000,20993=>1000,20994=>1000,20995=>1000,20996=>1000, - 20997=>1000,20998=>1000,20999=>1000,21000=>1000,21001=>1000,21002=>1000,21003=>1000,21004=>1000,21005=>1000,21006=>1000,21007=>1000,21008=>1000,21009=>1000,21010=>1000,21011=>1000,21012=>1000, - 21013=>1000,21014=>1000,21015=>1000,21016=>1000,21017=>1000,21018=>1000,21019=>1000,21020=>1000,21021=>1000,21022=>1000,21023=>1000,21024=>1000,21025=>1000,21026=>1000,21027=>1000,21028=>1000, - 21029=>1000,21030=>1000,21031=>1000,21032=>1000,21033=>1000,21034=>1000,21035=>1000,21036=>1000,21037=>1000,21038=>1000,21039=>1000,21040=>1000,21041=>1000,21042=>1000,21043=>1000,21044=>1000, - 21045=>1000,21046=>1000,21047=>1000,21048=>1000,21049=>1000,21050=>1000,21051=>1000,21052=>1000,21053=>1000,21054=>1000,21055=>1000,21056=>1000,21057=>1000,21058=>1000,21059=>1000,21060=>1000, - 21061=>1000,21062=>1000,21063=>1000,21064=>1000,21065=>1000,21066=>1000,21067=>1000,21068=>1000,21069=>1000,21070=>1000,21071=>1000,21072=>1000,21073=>1000,21074=>1000,21075=>1000,21076=>1000, - 21077=>1000,21078=>1000,21079=>1000,21080=>1000,21081=>1000,21082=>1000,21083=>1000,21084=>1000,21085=>1000,21086=>1000,21087=>1000,21088=>1000,21089=>1000,21090=>1000,21091=>1000,21092=>1000, - 21093=>1000,21094=>1000,21095=>1000,21096=>1000,21097=>1000,21098=>1000,21099=>1000,21100=>1000,21101=>1000,21102=>1000,21103=>1000,21104=>1000,21105=>1000,21106=>1000,21107=>1000,21108=>1000, - 21109=>1000,21110=>1000,21111=>1000,21112=>1000,21113=>1000,21114=>1000,21115=>1000,21116=>1000,21117=>1000,21118=>1000,21119=>1000,21120=>1000,21121=>1000,21122=>1000,21123=>1000,21124=>1000, - 21125=>1000,21126=>1000,21127=>1000,21128=>1000,21129=>1000,21130=>1000,21131=>1000,21132=>1000,21133=>1000,21134=>1000,21135=>1000,21136=>1000,21137=>1000,21138=>1000,21139=>1000,21140=>1000, - 21141=>1000,21142=>1000,21143=>1000,21144=>1000,21145=>1000,21146=>1000,21147=>1000,21148=>1000,21149=>1000,21150=>1000,21151=>1000,21152=>1000,21153=>1000,21154=>1000,21155=>1000,21156=>1000, - 21157=>1000,21158=>1000,21159=>1000,21160=>1000,21161=>1000,21162=>1000,21163=>1000,21164=>1000,21165=>1000,21166=>1000,21167=>1000,21168=>1000,21169=>1000,21170=>1000,21171=>1000,21172=>1000, - 21173=>1000,21174=>1000,21175=>1000,21176=>1000,21177=>1000,21178=>1000,21179=>1000,21180=>1000,21181=>1000,21182=>1000,21183=>1000,21184=>1000,21185=>1000,21186=>1000,21187=>1000,21188=>1000, - 21189=>1000,21190=>1000,21191=>1000,21192=>1000,21193=>1000,21194=>1000,21195=>1000,21196=>1000,21197=>1000,21198=>1000,21199=>1000,21200=>1000,21201=>1000,21202=>1000,21203=>1000,21204=>1000, - 21205=>1000,21206=>1000,21207=>1000,21208=>1000,21209=>1000,21210=>1000,21211=>1000,21212=>1000,21213=>1000,21214=>1000,21215=>1000,21216=>1000,21217=>1000,21218=>1000,21219=>1000,21220=>1000, - 21221=>1000,21222=>1000,21223=>1000,21224=>1000,21225=>1000,21226=>1000,21227=>1000,21228=>1000,21229=>1000,21230=>1000,21231=>1000,21232=>1000,21233=>1000,21234=>1000,21235=>1000,21236=>1000, - 21237=>1000,21238=>1000,21239=>1000,21240=>1000,21241=>1000,21242=>1000,21243=>1000,21244=>1000,21245=>1000,21246=>1000,21247=>1000,21248=>1000,21249=>1000,21250=>1000,21251=>1000,21252=>1000, - 21253=>1000,21254=>1000,21255=>1000,21256=>1000,21257=>1000,21258=>1000,21259=>1000,21260=>1000,21261=>1000,21262=>1000,21263=>1000,21264=>1000,21265=>1000,21266=>1000,21267=>1000,21268=>1000, - 21269=>1000,21270=>1000,21271=>1000,21272=>1000,21273=>1000,21274=>1000,21275=>1000,21276=>1000,21277=>1000,21278=>1000,21279=>1000,21280=>1000,21281=>1000,21282=>1000,21283=>1000,21284=>1000, - 21285=>1000,21286=>1000,21287=>1000,21288=>1000,21289=>1000,21290=>1000,21291=>1000,21292=>1000,21293=>994,21294=>1000,21295=>1000,21296=>1000,21297=>1000,21298=>1000,21299=>1000,21300=>1000, - 21301=>1000,21302=>1000,21303=>1000,21304=>1000,21305=>1000,21306=>1000,21307=>1000,21308=>1000,21309=>1000,21310=>1000,21311=>1000,21312=>1000,21313=>1000,21314=>1000,21315=>1000,21316=>1000, - 21317=>1000,21318=>1000,21319=>1000,21320=>1000,21321=>1000,21322=>1000,21323=>1000,21324=>1000,21325=>1000,21326=>1000,21327=>1000,21328=>1000,21329=>1000,21330=>1000,21331=>1000,21332=>1000, - 21333=>1000,21334=>1000,21335=>1000,21336=>1000,21337=>1000,21338=>1000,21339=>1000,21340=>1000,21341=>1000,21342=>1000,21343=>1000,21344=>1000,21345=>1000,21346=>1000,21347=>1000,21348=>1000, - 21349=>1000,21350=>1000,21351=>1000,21352=>1000,21353=>1000,21354=>1000,21355=>1000,21356=>1000,21357=>1000,21358=>1000,21359=>1000,21360=>1000,21361=>1000,21362=>1000,21363=>1000,21364=>1000, - 21365=>1000,21366=>1000,21367=>1000,21368=>1000,21369=>1000,21370=>1000,21371=>1000,21372=>1000,21373=>1000,21374=>1000,21375=>1000,21376=>1000,21377=>1000,21378=>1000,21379=>1000,21380=>1000, - 21381=>1000,21382=>1000,21383=>1000,21384=>1000,21385=>1000,21386=>1000,21387=>1000,21388=>1000,21389=>1000,21390=>1000,21391=>1000,21392=>1000,21393=>1000,21394=>1000,21395=>1000,21396=>1000, - 21397=>1000,21398=>1000,21399=>1000,21400=>1000,21401=>1000,21402=>1000,21403=>1000,21404=>1000,21405=>1000,21406=>1000,21407=>1000,21408=>1000,21409=>1000,21410=>1000,21411=>1000,21412=>1000, - 21413=>1000,21414=>1000,21415=>1000,21416=>1000,21417=>1000,21418=>1000,21419=>1000,21420=>1000,21421=>1000,21422=>1000,21423=>1000,21424=>1000,21425=>1000,21426=>1000,21427=>1000,21428=>1000, - 21429=>1000,21430=>1000,21431=>1000,21432=>1000,21433=>1000,21434=>1000,21435=>1000,21436=>1000,21437=>1000,21438=>1000,21439=>1000,21440=>1000,21441=>1000,21442=>1000,21443=>1000,21444=>1000, - 21445=>1000,21446=>1000,21447=>1000,21448=>1000,21449=>1000,21450=>1000,21451=>1000,21452=>1000,21453=>1000,21454=>1000,21455=>1000,21456=>1000,21457=>1000,21458=>1000,21459=>1000,21460=>1000, - 21461=>1000,21462=>1000,21463=>1000,21464=>1000,21465=>1000,21466=>1000,21467=>1000,21468=>1000,21469=>1000,21470=>1000,21471=>1000,21472=>1000,21473=>1000,21474=>1000,21475=>1000,21476=>1000, - 21477=>1000,21478=>1000,21479=>1000,21480=>1000,21481=>1000,21482=>1000,21483=>1000,21484=>1000,21485=>1000,21486=>1000,21487=>1000,21488=>1000,21489=>1000,21490=>1000,21491=>1000,21492=>1000, - 21493=>1000,21494=>1000,21495=>1000,21496=>1000,21497=>1000,21498=>1000,21499=>1000,21500=>1000,21501=>1000,21502=>1000,21503=>1000,21504=>1000,21505=>1000,21506=>1000,21507=>1000,21508=>1000, - 21509=>1000,21510=>1000,21511=>1000,21512=>1000,21513=>1000,21514=>1000,21515=>1000,21516=>1000,21517=>1000,21518=>1000,21519=>1000,21520=>1000,21521=>1000,21522=>1000,21523=>1000,21524=>1000, - 21525=>1000,21526=>1000,21527=>1000,21528=>1000,21529=>1000,21530=>1000,21531=>1000,21532=>1000,21533=>1000,21534=>1000,21535=>1000,21536=>1000,21537=>1000,21538=>1000,21539=>1000,21540=>1000, - 21541=>1000,21542=>1000,21543=>1000,21544=>1000,21545=>1000,21546=>1000,21547=>1000,21548=>1000,21549=>1000,21550=>1000,21551=>1000,21552=>1000,21553=>1000,21554=>1000,21555=>1000,21556=>1000, - 21557=>1000,21558=>1000,21559=>1000,21560=>1000,21561=>1000,21562=>1000,21563=>1000,21564=>1000,21565=>1000,21566=>1000,21567=>1000,21568=>1000,21569=>1000,21570=>1000,21571=>1000,21572=>1000, - 21573=>1000,21574=>1000,21575=>1000,21576=>1000,21577=>1000,21578=>1000,21579=>1000,21580=>1000,21581=>1000,21582=>1000,21583=>1000,21584=>1000,21585=>1000,21586=>1000,21587=>1000,21588=>1000, - 21589=>1000,21590=>1000,21591=>1000,21592=>1000,21593=>1000,21594=>1000,21595=>1000,21596=>1000,21597=>1000,21598=>1000,21599=>1000,21600=>1000,21601=>1000,21602=>1000,21603=>1000,21604=>1000, - 21605=>1000,21606=>1000,21607=>1000,21608=>1000,21609=>1000,21610=>1000,21611=>1000,21612=>1000,21613=>1000,21614=>1000,21615=>1000,21616=>1000,21617=>1000,21618=>1000,21619=>1000,21620=>1000, - 21621=>1000,21622=>1000,21623=>1000,21624=>1000,21625=>1000,21626=>1000,21627=>1000,21628=>1000,21629=>1000,21630=>1000,21631=>1000,21632=>1000,21633=>1000,21634=>1000,21635=>1000,21636=>1000, - 21637=>1000,21638=>1000,21639=>1000,21640=>1000,21641=>1000,21642=>1000,21643=>1000,21644=>1000,21645=>1000,21646=>1000,21647=>1000,21648=>1000,21649=>1000,21650=>1000,21651=>1000,21652=>1000, - 21653=>1000,21654=>1000,21655=>1000,21656=>1000,21657=>1000,21658=>1000,21659=>1000,21660=>1000,21661=>1000,21662=>1000,21663=>1000,21664=>1000,21665=>1000,21666=>1000,21667=>1000,21668=>1000, - 21669=>1000,21670=>1000,21671=>1000,21672=>1000,21673=>1000,21674=>1000,21675=>1000,21676=>1000,21677=>1000,21678=>1000,21679=>1000,21680=>1000,21681=>1000,21682=>1000,21683=>1000,21684=>1000, - 21685=>1000,21686=>1000,21687=>1000,21688=>1000,21689=>1000,21690=>1000,21691=>1000,21692=>1000,21693=>1000,21694=>1000,21695=>1000,21696=>1000,21697=>1000,21698=>1000,21699=>1000,21700=>1000, - 21701=>1000,21702=>1000,21703=>1000,21704=>1000,21705=>1000,21706=>1000,21707=>1000,21708=>1000,21709=>1000,21710=>1000,21711=>1000,21712=>1000,21713=>1000,21714=>1000,21715=>1000,21716=>1000, - 21717=>1000,21718=>1000,21719=>1000,21720=>1000,21721=>1000,21722=>1000,21723=>1000,21724=>1000,21725=>1000,21726=>1000,21727=>1000,21728=>1000,21729=>1000,21730=>1000,21731=>1000,21732=>1000, - 21733=>1000,21734=>1000,21735=>1000,21736=>1000,21737=>1000,21738=>1000,21739=>1000,21740=>1000,21741=>1000,21742=>1000,21743=>1000,21744=>1000,21745=>1000,21746=>1000,21747=>1000,21748=>1000, - 21749=>1000,21750=>1000,21751=>1000,21752=>1000,21753=>1000,21754=>1000,21755=>1000,21756=>1000,21757=>1000,21758=>1000,21759=>1000,21760=>1000,21761=>1000,21762=>1000,21763=>1000,21764=>1000, - 21765=>1000,21766=>1000,21767=>1000,21768=>1000,21769=>1000,21770=>1000,21771=>1000,21772=>1000,21773=>1000,21774=>1000,21775=>1000,21776=>1000,21777=>1000,21778=>1000,21779=>1000,21780=>1000, - 21781=>1000,21782=>1000,21783=>1000,21784=>1000,21785=>1000,21786=>1000,21787=>1000,21788=>1000,21789=>1000,21790=>1000,21791=>1000,21792=>1000,21793=>1000,21794=>1000,21795=>1000,21796=>1000, - 21797=>1000,21798=>1000,21799=>1000,21800=>1000,21801=>1000,21802=>1000,21803=>1000,21804=>1000,21805=>1000,21806=>1000,21807=>1000,21808=>1000,21809=>1000,21810=>1000,21811=>1000,21812=>1000, - 21813=>1000,21814=>1000,21815=>1000,21816=>1000,21817=>1000,21818=>1000,21819=>1000,21820=>1000,21821=>1000,21822=>1000,21823=>1000,21824=>1000,21825=>1000,21826=>1000,21827=>1000,21828=>1000, - 21829=>1000,21830=>1000,21831=>1000,21832=>1000,21833=>1000,21834=>1000,21835=>1000,21836=>1000,21837=>1000,21838=>1000,21839=>1000,21840=>1000,21841=>1000,21842=>1000,21843=>1000,21844=>1000, - 21845=>1000,21846=>1000,21847=>1000,21848=>1000,21849=>1000,21850=>1000,21851=>1000,21852=>1000,21853=>1000,21854=>1000,21855=>1000,21856=>1000,21857=>1000,21858=>1000,21859=>1000,21860=>1000, - 21861=>1000,21862=>1000,21863=>1000,21864=>1000,21865=>1000,21866=>1000,21867=>1000,21868=>1000,21869=>1000,21870=>1000,21871=>1000,21872=>1000,21873=>1000,21874=>1000,21875=>1000,21876=>1000, - 21877=>1000,21878=>1000,21879=>1000,21880=>1000,21881=>1000,21882=>1000,21883=>1000,21884=>1000,21885=>1000,21886=>1000,21887=>1000,21888=>1000,21889=>1000,21890=>1000,21891=>1000,21892=>1000, - 21893=>1000,21894=>1000,21895=>1000,21896=>1000,21897=>1000,21898=>1000,21899=>1000,21900=>1000,21901=>1000,21902=>1000,21903=>1000,21904=>1000,21905=>1000,21906=>1000,21907=>1000,21908=>1000, - 21909=>1000,21910=>1000,21911=>1000,21912=>1000,21913=>1000,21914=>1000,21915=>1000,21916=>1000,21917=>1000,21918=>1000,21919=>1000,21920=>1000,21921=>1000,21922=>1000,21923=>1000,21924=>1000, - 21925=>1000,21926=>1000,21927=>1000,21928=>1000,21929=>1000,21930=>1000,21931=>1000,21932=>1000,21933=>1000,21934=>1000,21935=>1000,21936=>1000,21937=>1000,21938=>1000,21939=>1000,21940=>1000, - 21941=>1000,21942=>1000,21943=>1000,21944=>1000,21945=>1000,21946=>1000,21947=>1000,21948=>1000,21949=>1000,21950=>1000,21951=>1000,21952=>1000,21953=>1000,21954=>1000,21955=>1000,21956=>1000, - 21957=>1000,21958=>1000,21959=>1000,21960=>1000,21961=>1000,21962=>1000,21963=>1000,21964=>1000,21965=>1000,21966=>1000,21967=>1000,21968=>1000,21969=>1000,21970=>1000,21971=>1000,21972=>1000, - 21973=>1000,21974=>1000,21975=>1000,21976=>1000,21977=>1000,21978=>1000,21979=>1000,21980=>1000,21981=>1000,21982=>1000,21983=>1000,21984=>1000,21985=>1000,21986=>1000,21987=>1000,21988=>1000, - 21989=>1000,21990=>1000,21991=>1000,21992=>1000,21993=>1000,21994=>1000,21995=>1000,21996=>1000,21997=>1000,21998=>1000,21999=>1000,22000=>1000,22001=>1000,22002=>1000,22003=>1000,22004=>1000, - 22005=>1000,22006=>1000,22007=>1000,22008=>1000,22009=>1000,22010=>1000,22011=>1000,22012=>1000,22013=>1000,22014=>1000,22015=>1000,22016=>1000,22017=>1000,22018=>1000,22019=>1000,22020=>1000, - 22021=>1000,22022=>1000,22023=>1000,22024=>1000,22025=>1000,22026=>1000,22027=>1000,22028=>1000,22029=>1000,22030=>1000,22031=>1000,22032=>1000,22033=>1000,22034=>1000,22035=>1000,22036=>1000, - 22037=>1000,22038=>1000,22039=>1000,22040=>1000,22041=>1000,22042=>1000,22043=>1000,22044=>1000,22045=>1000,22046=>1000,22047=>1000,22048=>1000,22049=>1000,22050=>1000,22051=>1000,22052=>1000, - 22053=>1000,22054=>1000,22055=>1000,22056=>1000,22057=>1000,22058=>1000,22059=>1000,22060=>1000,22061=>1000,22062=>1000,22063=>1000,22064=>1000,22065=>1000,22066=>1000,22067=>1000,22068=>1000, - 22069=>1000,22070=>1000,22071=>1000,22072=>1000,22073=>1000,22074=>1000,22075=>1000,22076=>1000,22077=>1000,22078=>1000,22079=>1000,22080=>1000,22081=>1000,22082=>1000,22083=>1000,22084=>1000, - 22085=>1000,22086=>1000,22087=>1000,22088=>1000,22089=>1000,22090=>1000,22091=>1000,22092=>1000,22093=>1000,22094=>1000,22095=>1000,22096=>1000,22097=>1000,22098=>1000,22099=>1000,22100=>1000, - 22101=>1000,22102=>1000,22103=>1000,22104=>1000,22105=>1000,22106=>1000,22107=>1000,22108=>1000,22109=>1000,22110=>1000,22111=>1000,22112=>1000,22113=>1000,22114=>1000,22115=>1000,22116=>1000, - 22117=>1000,22118=>1000,22119=>1000,22120=>1000,22121=>1000,22122=>1000,22123=>1000,22124=>1000,22125=>1000,22126=>1000,22127=>1000,22128=>1000,22129=>1000,22130=>1000,22131=>1000,22132=>1000, - 22133=>1000,22134=>1000,22135=>1000,22136=>1000,22137=>1000,22138=>1000,22139=>1000,22140=>1000,22141=>1000,22142=>1000,22143=>1000,22144=>1000,22145=>1000,22146=>1000,22147=>1000,22148=>1000, - 22149=>1000,22150=>1000,22151=>1000,22152=>1000,22153=>1000,22154=>1000,22155=>1000,22156=>1000,22157=>1000,22158=>1000,22159=>1000,22160=>1000,22161=>1000,22162=>1000,22163=>1000,22164=>1000, - 22165=>1000,22166=>1000,22167=>1000,22168=>1000,22169=>1000,22170=>1000,22171=>1000,22172=>1000,22173=>1000,22174=>1000,22175=>1000,22176=>1000,22177=>1000,22178=>1000,22179=>1000,22180=>1000, - 22181=>1000,22182=>1000,22183=>1000,22184=>1000,22185=>1000,22186=>1000,22187=>1000,22188=>1000,22189=>1000,22190=>1000,22191=>1000,22192=>1000,22193=>1000,22194=>1000,22195=>1000,22196=>1000, - 22197=>1000,22198=>1000,22199=>1000,22200=>1000,22201=>1000,22202=>1000,22203=>1000,22204=>1000,22205=>1000,22206=>1000,22207=>1000,22208=>1000,22209=>1000,22210=>1000,22211=>1000,22212=>1000, - 22213=>1000,22214=>1000,22215=>1000,22216=>1000,22217=>1000,22218=>1000,22219=>1000,22220=>1000,22221=>1000,22222=>1000,22223=>1000,22224=>1000,22225=>1000,22226=>1000,22227=>1000,22228=>1000, - 22229=>1000,22230=>1000,22231=>1000,22232=>1000,22233=>1000,22234=>1000,22235=>1000,22236=>1000,22237=>1000,22238=>1000,22239=>1000,22240=>1000,22241=>1000,22242=>1000,22243=>1000,22244=>1000, - 22245=>1000,22246=>1000,22247=>1000,22248=>1000,22249=>1000,22250=>1000,22251=>1000,22252=>1000,22253=>1000,22254=>1000,22255=>1000,22256=>1000,22257=>1000,22258=>1000,22259=>1000,22260=>1000, - 22261=>1000,22262=>1000,22263=>1000,22264=>1000,22265=>1000,22266=>1000,22267=>1000,22268=>1000,22269=>1000,22270=>1000,22271=>1000,22272=>1000,22273=>1000,22274=>1000,22275=>1000,22276=>1000, - 22277=>1000,22278=>1000,22279=>1000,22280=>1000,22281=>1000,22282=>1000,22283=>1000,22284=>1000,22285=>1000,22286=>1000,22287=>1000,22288=>1000,22289=>1000,22290=>1000,22291=>1000,22292=>1000, - 22293=>1000,22294=>1000,22295=>1000,22296=>1000,22297=>1000,22298=>1000,22299=>1000,22300=>1000,22301=>1000,22302=>1000,22303=>1000,22304=>1000,22305=>1000,22306=>1000,22307=>1000,22308=>1000, - 22309=>1000,22310=>1000,22311=>1000,22312=>1000,22313=>1000,22314=>1000,22315=>1000,22316=>1000,22317=>1000,22318=>1000,22319=>1000,22320=>1000,22321=>1000,22322=>1000,22323=>1000,22324=>1000, - 22325=>1000,22326=>1000,22327=>1000,22328=>1000,22329=>1000,22330=>1000,22331=>1000,22332=>1000,22333=>1000,22334=>1000,22335=>1000,22336=>1000,22337=>1000,22338=>1000,22339=>1000,22340=>1000, - 22341=>1000,22342=>1000,22343=>1000,22344=>1000,22345=>1000,22346=>1000,22347=>1000,22348=>1000,22349=>1000,22350=>1000,22351=>1000,22352=>1000,22353=>1000,22354=>1000,22355=>1000,22356=>1000, - 22357=>1000,22358=>1000,22359=>1000,22360=>1000,22361=>1000,22362=>1000,22363=>1000,22364=>1000,22365=>1000,22366=>1000,22367=>1000,22368=>1000,22369=>1000,22370=>1000,22371=>1000,22372=>1000, - 22373=>1000,22374=>1000,22375=>1000,22376=>1000,22377=>1000,22378=>1000,22379=>1000,22380=>1000,22381=>1000,22382=>1000,22383=>1000,22384=>1000,22385=>1000,22386=>1000,22387=>1000,22388=>1000, - 22389=>1000,22390=>1000,22391=>1000,22392=>1000,22393=>1000,22394=>1000,22395=>1000,22396=>1000,22397=>1000,22398=>1000,22399=>1000,22400=>1000,22401=>1000,22402=>1000,22403=>1000,22404=>1000, - 22405=>1000,22406=>1000,22407=>1000,22408=>1000,22409=>1000,22410=>1000,22411=>1000,22412=>1000,22413=>1000,22414=>1000,22415=>1000,22416=>1000,22417=>1000,22418=>1000,22419=>1000,22420=>1000, - 22421=>1000,22422=>1000,22423=>1000,22424=>1000,22425=>1000,22426=>1000,22427=>1000,22428=>1000,22429=>1000,22430=>1000,22431=>1000,22432=>1000,22433=>1000,22434=>1000,22435=>1000,22436=>1000, - 22437=>1000,22438=>1000,22439=>1000,22440=>1000,22441=>1000,22442=>1000,22443=>1000,22444=>1000,22445=>1000,22446=>1000,22447=>1000,22448=>1000,22449=>1000,22450=>1000,22451=>1000,22452=>1000, - 22453=>1000,22454=>1000,22455=>1000,22456=>1000,22457=>1000,22458=>1000,22459=>1000,22460=>1000,22461=>1000,22462=>1000,22463=>1000,22464=>1000,22465=>1000,22466=>1000,22467=>1000,22468=>1000, - 22469=>1000,22470=>1000,22471=>1000,22472=>1000,22473=>1000,22474=>1000,22475=>1000,22476=>1000,22477=>1000,22478=>1000,22479=>1000,22480=>1000,22481=>1000,22482=>1000,22483=>1000,22484=>1000, - 22485=>1000,22486=>1000,22487=>1000,22488=>1000,22489=>1000,22490=>1000,22491=>1000,22492=>1000,22493=>1000,22494=>1000,22495=>1000,22496=>1000,22497=>1000,22498=>1000,22499=>1000,22500=>1000, - 22501=>1000,22502=>1000,22503=>1000,22504=>1000,22505=>1000,22506=>1000,22507=>1000,22508=>1000,22509=>1000,22510=>1000,22511=>1000,22512=>1000,22513=>1000,22514=>1000,22515=>1000,22516=>1000, - 22517=>1000,22518=>1000,22519=>1000,22520=>1000,22521=>1000,22522=>1000,22523=>1000,22524=>1000,22525=>1000,22526=>1000,22527=>1000,22528=>1000,22529=>1000,22530=>1000,22531=>1000,22532=>1000, - 22533=>1000,22534=>1000,22535=>1000,22536=>1000,22537=>1000,22538=>1000,22539=>1000,22540=>1000,22541=>1000,22542=>1000,22543=>1000,22544=>1000,22545=>1000,22546=>1000,22547=>1000,22548=>1000, - 22549=>1000,22550=>1000,22551=>1000,22552=>1000,22553=>1000,22554=>1000,22555=>1000,22556=>1000,22557=>1000,22558=>1000,22559=>1000,22560=>1000,22561=>1000,22562=>1000,22563=>1000,22564=>1000, - 22565=>1000,22566=>1000,22567=>1000,22568=>1000,22569=>1000,22570=>1000,22571=>1000,22572=>1000,22573=>1000,22574=>1000,22575=>1000,22576=>1000,22577=>1000,22578=>1000,22579=>1000,22580=>1000, - 22581=>1000,22582=>1000,22583=>1000,22584=>1000,22585=>1000,22586=>1000,22587=>1000,22588=>1000,22589=>1000,22590=>1000,22591=>1000,22592=>1000,22593=>1000,22594=>1000,22595=>1000,22596=>1000, - 22597=>1000,22598=>1000,22599=>1000,22600=>1000,22601=>1000,22602=>1000,22603=>1000,22604=>1000,22605=>1000,22606=>1000,22607=>1000,22608=>1000,22609=>1000,22610=>1000,22611=>1000,22612=>1000, - 22613=>1000,22614=>1000,22615=>1000,22616=>1000,22617=>1000,22618=>1000,22619=>1000,22620=>1000,22621=>1000,22622=>1000,22623=>1000,22624=>1000,22625=>1000,22626=>1000,22627=>1000,22628=>1000, - 22629=>1000,22630=>1000,22631=>1000,22632=>1000,22633=>1000,22634=>1000,22635=>1000,22636=>1000,22637=>1000,22638=>1000,22639=>1000,22640=>1000,22641=>1000,22642=>1000,22643=>1000,22644=>1000, - 22645=>1000,22646=>1000,22647=>1000,22648=>1000,22649=>1000,22650=>1000,22651=>1000,22652=>1000,22653=>1000,22654=>1000,22655=>1000,22656=>1000,22657=>1000,22658=>1000,22659=>1000,22660=>1000, - 22661=>1000,22662=>1000,22663=>1000,22664=>1000,22665=>1000,22666=>1000,22667=>1000,22668=>1000,22669=>1000,22670=>1000,22671=>1000,22672=>1000,22673=>1000,22674=>1000,22675=>1000,22676=>1000, - 22677=>1000,22678=>1000,22679=>1000,22680=>1000,22681=>1000,22682=>1000,22683=>1000,22684=>1000,22685=>1000,22686=>1000,22687=>1000,22688=>1000,22689=>1000,22690=>1000,22691=>1000,22692=>1000, - 22693=>1000,22694=>1000,22695=>1000,22696=>1000,22697=>1000,22698=>1000,22699=>1000,22700=>1000,22701=>1000,22702=>1000,22703=>1000,22704=>1000,22705=>1000,22706=>1000,22707=>1000,22708=>1000, - 22709=>1000,22710=>1000,22711=>1000,22712=>1000,22713=>1000,22714=>1000,22715=>1000,22716=>1000,22717=>1000,22718=>1000,22719=>1000,22720=>1000,22721=>1000,22722=>1000,22723=>1000,22724=>1000, - 22725=>1000,22726=>1000,22727=>1000,22728=>1000,22729=>1000,22730=>1000,22731=>1000,22732=>1000,22733=>1000,22734=>1000,22735=>1000,22736=>1000,22737=>1000,22738=>1000,22739=>1000,22740=>1000, - 22741=>1000,22742=>1000,22743=>1000,22744=>1000,22745=>1000,22746=>1000,22747=>1000,22748=>1000,22749=>1000,22750=>1000,22751=>1000,22752=>1000,22753=>1000,22754=>1000,22755=>1000,22756=>1000, - 22757=>1000,22758=>1000,22759=>1000,22760=>1000,22761=>1000,22762=>1000,22763=>1000,22764=>1000,22765=>1000,22766=>1000,22767=>1000,22768=>1000,22769=>1000,22770=>1000,22771=>1000,22772=>1000, - 22773=>1000,22774=>1000,22775=>1000,22776=>1000,22777=>1000,22778=>1000,22779=>1000,22780=>1000,22781=>1000,22782=>1000,22783=>1000,22784=>1000,22785=>1000,22786=>1000,22787=>1000,22788=>1000, - 22789=>1000,22790=>1000,22791=>1000,22792=>1000,22793=>1000,22794=>1000,22795=>1000,22796=>1000,22797=>1000,22798=>1000,22799=>1000,22800=>1000,22801=>1000,22802=>1000,22803=>1000,22804=>1000, - 22805=>1000,22806=>1000,22807=>1000,22808=>1000,22809=>1000,22810=>1000,22811=>1000,22812=>1000,22813=>1000,22814=>1000,22815=>1000,22816=>1000,22817=>1000,22818=>1000,22819=>1000,22820=>1000, - 22821=>1000,22822=>1000,22823=>1000,22824=>1000,22825=>1000,22826=>1000,22827=>1000,22828=>1000,22829=>1000,22830=>1000,22831=>1000,22832=>1000,22833=>1000,22834=>1000,22835=>1000,22836=>1000, - 22837=>1000,22838=>1000,22839=>1000,22840=>1000,22841=>1000,22842=>1000,22843=>1000,22844=>1000,22845=>1000,22846=>1000,22847=>1000,22848=>1000,22849=>1000,22850=>1000,22851=>1000,22852=>1000, - 22853=>1000,22854=>1000,22855=>1000,22856=>1000,22857=>1000,22858=>1000,22859=>1000,22860=>1000,22861=>1000,22862=>1000,22863=>1000,22864=>1000,22865=>1000,22866=>1000,22867=>1000,22868=>1000, - 22869=>1000,22870=>1000,22871=>1000,22872=>1000,22873=>1000,22874=>1000,22875=>1000,22876=>1000,22877=>1000,22878=>1000,22879=>1000,22880=>1000,22881=>1000,22882=>1000,22883=>1000,22884=>1000, - 22885=>1000,22886=>1000,22887=>1000,22888=>1000,22889=>1000,22890=>1000,22891=>1000,22892=>1000,22893=>1000,22894=>1000,22895=>1000,22896=>1000,22897=>1000,22898=>1000,22899=>1000,22900=>1000, - 22901=>1000,22902=>1000,22903=>1000,22904=>1000,22905=>1000,22906=>1000,22907=>1000,22908=>1000,22909=>1000,22910=>1000,22911=>1000,22912=>1000,22913=>1000,22914=>1000,22915=>1000,22916=>1000, - 22917=>1000,22918=>1000,22919=>1000,22920=>1000,22921=>1000,22922=>1000,22923=>1000,22924=>1000,22925=>1000,22926=>1000,22927=>1000,22928=>1000,22929=>1000,22930=>1000,22931=>1000,22932=>1000, - 22933=>1000,22934=>1000,22935=>1000,22936=>1000,22937=>1000,22938=>1000,22939=>1000,22940=>1000,22941=>1000,22942=>1000,22943=>1000,22944=>1000,22945=>1000,22946=>1000,22947=>1000,22948=>1000, - 22949=>1000,22950=>1000,22951=>1000,22952=>1000,22953=>1000,22954=>1000,22955=>1000,22956=>1000,22957=>1000,22958=>1000,22959=>1000,22960=>1000,22961=>1000,22962=>1000,22963=>1000,22964=>1000, - 22965=>1000,22966=>1000,22967=>1000,22968=>1000,22969=>1000,22970=>1000,22971=>1000,22972=>1000,22973=>1000,22974=>1000,22975=>1000,22976=>1000,22977=>1000,22978=>1000,22979=>1000,22980=>1000, - 22981=>1000,22982=>1000,22983=>1000,22984=>1000,22985=>1000,22986=>1000,22987=>1000,22988=>1000,22989=>1000,22990=>1000,22991=>1000,22992=>1000,22993=>1000,22994=>1000,22995=>1000,22996=>1000, - 22997=>1000,22998=>1000,22999=>1000,23000=>1000,23001=>1000,23002=>1000,23003=>1000,23004=>1000,23005=>1000,23006=>1000,23007=>1000,23008=>1000,23009=>1000,23010=>1000,23011=>1000,23012=>1000, - 23013=>1000,23014=>1000,23015=>1000,23016=>1000,23017=>1000,23018=>1000,23019=>1000,23020=>1000,23021=>1000,23022=>1000,23023=>1000,23024=>1000,23025=>1000,23026=>1000,23027=>1000,23028=>1000, - 23029=>1000,23030=>1000,23031=>1000,23032=>1000,23033=>1000,23034=>1000,23035=>1000,23036=>1000,23037=>1000,23038=>1000,23039=>1000,23040=>1000,23041=>1000,23042=>1000,23043=>1000,23044=>1000, - 23045=>1000,23046=>1000,23047=>1000,23048=>1000,23049=>1000,23050=>1000,23051=>1000,23052=>1000,23053=>1000,23054=>1000,23055=>1000,23056=>1000,23057=>1000,23058=>1000,23059=>1000,23060=>1000, - 23061=>1000,23062=>1000,23063=>1000,23064=>1000,23065=>1000,23066=>1000,23067=>1000,23068=>1000,23069=>1000,23070=>1000,23071=>1000,23072=>1000,23073=>1000,23074=>1000,23075=>1000,23076=>1000, - 23077=>1000,23078=>1000,23079=>1000,23080=>1000,23081=>1000,23082=>1000,23083=>1000,23084=>1000,23085=>1000,23086=>1000,23087=>1000,23088=>1000,23089=>1000,23090=>1000,23091=>1000,23092=>1000, - 23093=>1000,23094=>1000,23095=>1000,23096=>1000,23097=>1000,23098=>1000,23099=>1000,23100=>1000,23101=>1000,23102=>1000,23103=>1000,23104=>1000,23105=>1000,23106=>1000,23107=>1000,23108=>1000, - 23109=>1000,23110=>1000,23111=>1000,23112=>1000,23113=>1000,23114=>1000,23115=>1000,23116=>1000,23117=>1000,23118=>1000,23119=>1000,23120=>1000,23121=>1000,23122=>1000,23123=>1000,23124=>1000, - 23125=>1000,23126=>1000,23127=>1000,23128=>1000,23129=>1000,23130=>1000,23131=>1000,23132=>1000,23133=>1000,23134=>1000,23135=>1000,23136=>1000,23137=>1000,23138=>1000,23139=>1000,23140=>1000, - 23141=>1000,23142=>1000,23143=>1000,23144=>1000,23145=>1000,23146=>1000,23147=>1000,23148=>1000,23149=>1000,23150=>1000,23151=>1000,23152=>1000,23153=>1000,23154=>1000,23155=>1000,23156=>1000, - 23157=>1000,23158=>1000,23159=>1000,23160=>1000,23161=>1000,23162=>1000,23163=>1000,23164=>1000,23165=>1000,23166=>1000,23167=>1000,23168=>1000,23169=>1000,23170=>1000,23171=>1000,23172=>1000, - 23173=>1000,23174=>1000,23175=>1000,23176=>1000,23177=>1000,23178=>1000,23179=>1000,23180=>1000,23181=>1000,23182=>1000,23183=>1000,23184=>1000,23185=>1000,23186=>1000,23187=>1000,23188=>1000, - 23189=>1000,23190=>1000,23191=>1000,23192=>1000,23193=>1000,23194=>1000,23195=>1000,23196=>1000,23197=>1000,23198=>1000,23199=>1000,23200=>1000,23201=>1000,23202=>1000,23203=>1000,23204=>1000, - 23205=>1000,23206=>1000,23207=>1000,23208=>1000,23209=>1000,23210=>1000,23211=>1000,23212=>1000,23213=>1000,23214=>1000,23215=>1000,23216=>1000,23217=>1000,23218=>1000,23219=>1000,23220=>1000, - 23221=>1000,23222=>1000,23223=>1000,23224=>1000,23225=>1000,23226=>1000,23227=>1000,23228=>1000,23229=>1000,23230=>1000,23231=>1000,23232=>1000,23233=>1000,23234=>1000,23235=>1000,23236=>1000, - 23237=>1000,23238=>1000,23239=>1000,23240=>1000,23241=>1000,23242=>1000,23243=>1000,23244=>1000,23245=>1000,23246=>1000,23247=>1000,23248=>1000,23249=>1000,23250=>1000,23251=>1000,23252=>1000, - 23253=>1000,23254=>1000,23255=>1000,23256=>1000,23257=>1000,23258=>1000,23259=>1000,23260=>1000,23261=>1000,23262=>1000,23263=>1000,23264=>1000,23265=>1000,23266=>1000,23267=>1000,23268=>1000, - 23269=>1000,23270=>1000,23271=>1000,23272=>1000,23273=>1000,23274=>1000,23275=>1000,23276=>1000,23277=>1000,23278=>1000,23279=>1000,23280=>1000,23281=>1000,23282=>1000,23283=>1000,23284=>1000, - 23285=>1000,23286=>1000,23287=>1000,23288=>1000,23289=>1000,23290=>1000,23291=>1000,23292=>1000,23293=>1000,23294=>1000,23295=>1000,23296=>1000,23297=>1000,23298=>1000,23299=>1000,23300=>1000, - 23301=>1000,23302=>1000,23303=>1000,23304=>1000,23305=>1000,23306=>1000,23307=>1000,23308=>1000,23309=>1000,23310=>1000,23311=>1000,23312=>1000,23313=>1000,23314=>1000,23315=>1000,23316=>1000, - 23317=>1000,23318=>1000,23319=>1000,23320=>1000,23321=>1000,23322=>1000,23323=>1000,23324=>1000,23325=>1000,23326=>1000,23327=>1000,23328=>1000,23329=>1000,23330=>1000,23331=>1000,23332=>1000, - 23333=>1000,23334=>1000,23335=>1000,23336=>1000,23337=>1000,23338=>1000,23339=>1000,23340=>1000,23341=>1000,23342=>1000,23343=>1000,23344=>1000,23345=>1000,23346=>1000,23347=>1000,23348=>1000, - 23349=>1000,23350=>1000,23351=>1000,23352=>1000,23353=>1000,23354=>1000,23355=>1000,23356=>1000,23357=>1000,23358=>1000,23359=>1000,23360=>1000,23361=>1000,23362=>1000,23363=>1000,23364=>1000, - 23365=>1000,23366=>1000,23367=>1000,23368=>1000,23369=>1000,23370=>1000,23371=>1000,23372=>1000,23373=>1000,23374=>1000,23375=>1000,23376=>1000,23377=>1000,23378=>1000,23379=>1000,23380=>1000, - 23381=>1000,23382=>1000,23383=>1000,23384=>1000,23385=>1000,23386=>1000,23387=>1000,23388=>1000,23389=>1000,23390=>1000,23391=>1000,23392=>1000,23393=>1000,23394=>1000,23395=>1000,23396=>1000, - 23397=>1000,23398=>1000,23399=>1000,23400=>1000,23401=>1000,23402=>1000,23403=>1000,23404=>1000,23405=>1000,23406=>1000,23407=>1000,23408=>1000,23409=>1000,23410=>1000,23411=>1000,23412=>1000, - 23413=>1000,23414=>1000,23415=>1000,23416=>1000,23417=>1000,23418=>1000,23419=>1000,23420=>1000,23421=>1000,23422=>1000,23423=>1000,23424=>1000,23425=>1000,23426=>1000,23427=>1000,23428=>1000, - 23429=>1000,23430=>1000,23431=>1000,23432=>1000,23433=>1000,23434=>1000,23435=>1000,23436=>1000,23437=>1000,23438=>1000,23439=>1000,23440=>1000,23441=>1000,23442=>1000,23443=>1000,23444=>1000, - 23445=>1000,23446=>1000,23447=>1000,23448=>1000,23449=>1000,23450=>1000,23451=>1000,23452=>1000,23453=>1000,23454=>1000,23455=>1000,23456=>1000,23457=>1000,23458=>1000,23459=>1000,23460=>1000, - 23461=>1000,23462=>1000,23463=>1000,23464=>1000,23465=>1000,23466=>1000,23467=>1000,23468=>1000,23469=>1000,23470=>1000,23471=>1000,23472=>1000,23473=>1000,23474=>1000,23475=>1000,23476=>1000, - 23477=>1000,23478=>1000,23479=>1000,23480=>1000,23481=>1000,23482=>1000,23483=>1000,23484=>1000,23485=>1000,23486=>1000,23487=>1000,23488=>1000,23489=>1000,23490=>1000,23491=>1000,23492=>1000, - 23493=>1000,23494=>1000,23495=>1000,23496=>1000,23497=>1000,23498=>1000,23499=>1000,23500=>1000,23501=>1000,23502=>1000,23503=>1000,23504=>1000,23505=>1000,23506=>1000,23507=>1000,23508=>1000, - 23509=>1000,23510=>1000,23511=>1000,23512=>1000,23513=>1000,23514=>1000,23515=>1000,23516=>1000,23517=>1000,23518=>1000,23519=>1000,23520=>1000,23521=>1000,23522=>1000,23523=>1000,23524=>1000, - 23525=>1000,23526=>1000,23527=>1000,23528=>1000,23529=>1000,23530=>1000,23531=>1000,23532=>1000,23533=>1000,23534=>1000,23535=>1000,23536=>1000,23537=>1000,23538=>1000,23539=>1000,23540=>1000, - 23541=>1000,23542=>1000,23543=>1000,23544=>1000,23545=>1000,23546=>1000,23547=>1000,23548=>1000,23549=>1000,23550=>1000,23551=>1000,23552=>1000,23553=>1000,23554=>1000,23555=>1000,23556=>1000, - 23557=>1000,23558=>1000,23559=>1000,23560=>1000,23561=>1000,23562=>1000,23563=>1000,23564=>1000,23565=>1000,23566=>1000,23567=>1000,23568=>1000,23569=>1000,23570=>1000,23571=>1000,23572=>1000, - 23573=>1000,23574=>1000,23575=>1000,23576=>1000,23577=>1000,23578=>1000,23579=>1000,23580=>1000,23581=>1000,23582=>1000,23583=>1000,23584=>1000,23585=>1000,23586=>1000,23587=>1000,23588=>1000, - 23589=>1000,23590=>1000,23591=>1000,23592=>1000,23593=>1000,23594=>1000,23595=>1000,23596=>1000,23597=>1000,23598=>1000,23599=>1000,23600=>1000,23601=>1000,23602=>1000,23603=>1000,23604=>1000, - 23605=>1000,23606=>1000,23607=>1000,23608=>1000,23609=>1000,23610=>1000,23611=>1000,23612=>1000,23613=>1000,23614=>1000,23615=>1000,23616=>1000,23617=>1000,23618=>1000,23619=>1000,23620=>1000, - 23621=>1000,23622=>1000,23623=>1000,23624=>1000,23625=>1000,23626=>1000,23627=>1000,23628=>1000,23629=>1000,23630=>1000,23631=>1000,23632=>1000,23633=>1000,23634=>1000,23635=>1000,23636=>1000, - 23637=>1000,23638=>1000,23639=>1000,23640=>1000,23641=>1000,23642=>1000,23643=>1000,23644=>1000,23645=>1000,23646=>1000,23647=>1000,23648=>1000,23649=>1000,23650=>1000,23651=>1000,23652=>1000, - 23653=>1000,23654=>1000,23655=>1000,23656=>1000,23657=>1000,23658=>1000,23659=>1000,23660=>1000,23661=>1000,23662=>1000,23663=>1000,23664=>1000,23665=>1000,23666=>1000,23667=>1000,23668=>1000, - 23669=>1000,23670=>1000,23671=>1000,23672=>1000,23673=>1000,23674=>1000,23675=>1000,23676=>1000,23677=>1000,23678=>1000,23679=>1000,23680=>1000,23681=>1000,23682=>1000,23683=>1000,23684=>1000, - 23685=>1000,23686=>1000,23687=>1000,23688=>1000,23689=>1000,23690=>1000,23691=>1000,23692=>1000,23693=>1000,23694=>1000,23695=>1000,23696=>1000,23697=>1000,23698=>1000,23699=>1000,23700=>1000, - 23701=>1000,23702=>1000,23703=>1000,23704=>1000,23705=>1000,23706=>1000,23707=>1000,23708=>1000,23709=>1000,23710=>1000,23711=>1000,23712=>1000,23713=>1000,23714=>1000,23715=>1000,23716=>1000, - 23717=>1000,23718=>1000,23719=>1000,23720=>1000,23721=>1000,23722=>1000,23723=>1000,23724=>1000,23725=>1000,23726=>1000,23727=>1000,23728=>1000,23729=>1000,23730=>1000,23731=>1000,23732=>1000, - 23733=>1000,23734=>1000,23735=>1000,23736=>1000,23737=>1000,23738=>1000,23739=>1000,23740=>1000,23741=>1000,23742=>1000,23743=>1000,23744=>1000,23745=>1000,23746=>1000,23747=>1000,23748=>1000, - 23749=>1000,23750=>1000,23751=>1000,23752=>1000,23753=>1000,23754=>1000,23755=>1000,23756=>1000,23757=>1000,23758=>1000,23759=>1000,23760=>1000,23761=>1000,23762=>1000,23763=>1000,23764=>1000, - 23765=>1000,23766=>1000,23767=>1000,23768=>1000,23769=>1000,23770=>1000,23771=>1000,23772=>1000,23773=>1000,23774=>1000,23775=>1000,23776=>1000,23777=>1000,23778=>1000,23779=>1000,23780=>1000, - 23781=>1000,23782=>1000,23783=>1000,23784=>1000,23785=>1000,23786=>1000,23787=>1000,23788=>1000,23789=>1000,23790=>1000,23791=>1000,23792=>1000,23793=>1000,23794=>1000,23795=>1000,23796=>1000, - 23797=>1000,23798=>1000,23799=>1000,23800=>1000,23801=>1000,23802=>1000,23803=>1000,23804=>1000,23805=>1000,23806=>1000,23807=>1000,23808=>1000,23809=>1000,23810=>1000,23811=>1000,23812=>1000, - 23813=>1000,23814=>1000,23815=>1000,23816=>1000,23817=>1000,23818=>1000,23819=>1000,23820=>1000,23821=>1000,23822=>1000,23823=>1000,23824=>1000,23825=>1000,23826=>1000,23827=>1000,23828=>1000, - 23829=>1000,23830=>1000,23831=>1000,23832=>1000,23833=>1000,23834=>1000,23835=>1000,23836=>1000,23837=>1000,23838=>1000,23839=>1000,23840=>1000,23841=>1000,23842=>1000,23843=>1000,23844=>1000, - 23845=>1000,23846=>1000,23847=>1000,23848=>1000,23849=>1000,23850=>1000,23851=>1000,23852=>1000,23853=>1000,23854=>1000,23855=>1000,23856=>1000,23857=>1000,23858=>1000,23859=>1000,23860=>1000, - 23861=>1000,23862=>1000,23863=>1000,23864=>1000,23865=>1000,23866=>1000,23867=>1000,23868=>1000,23869=>1000,23870=>1000,23871=>1000,23872=>1000,23873=>1000,23874=>1000,23875=>1000,23876=>1000, - 23877=>1000,23878=>1000,23879=>1000,23880=>1000,23881=>1000,23882=>1000,23883=>1000,23884=>1000,23885=>1000,23886=>1000,23887=>1000,23888=>1000,23889=>1000,23890=>1000,23891=>1000,23892=>1000, - 23893=>1000,23894=>1000,23895=>1000,23896=>1000,23897=>1000,23898=>1000,23899=>1000,23900=>1000,23901=>1000,23902=>1000,23903=>1000,23904=>1000,23905=>1000,23906=>1000,23907=>1000,23908=>1000, - 23909=>1000,23910=>1000,23911=>1000,23912=>1000,23913=>1000,23914=>1000,23915=>1000,23916=>1000,23917=>1000,23918=>1000,23919=>1000,23920=>1000,23921=>1000,23922=>1000,23923=>1000,23924=>1000, - 23925=>1000,23926=>1000,23927=>1000,23928=>1000,23929=>1000,23930=>1000,23931=>1000,23932=>1000,23933=>1000,23934=>1000,23935=>1000,23936=>1000,23937=>1000,23938=>1000,23939=>1000,23940=>1000, - 23941=>1000,23942=>1000,23943=>1000,23944=>1000,23945=>1000,23946=>1000,23947=>1000,23948=>1000,23949=>1000,23950=>1000,23951=>1000,23952=>1000,23953=>1000,23954=>1000,23955=>1000,23956=>1000, - 23957=>1000,23958=>1000,23959=>1000,23960=>1000,23961=>1000,23962=>1000,23963=>1000,23964=>1000,23965=>1000,23966=>1000,23967=>1000,23968=>1000,23969=>1000,23970=>1000,23971=>1000,23972=>1000, - 23973=>1000,23974=>1000,23975=>1000,23976=>1000,23977=>1000,23978=>1000,23979=>1000,23980=>1000,23981=>1000,23982=>1000,23983=>1000,23984=>1000,23985=>1000,23986=>1000,23987=>1000,23988=>1000, - 23989=>1000,23990=>1000,23991=>1000,23992=>1000,23993=>1000,23994=>1000,23995=>1000,23996=>1000,23997=>1000,23998=>1000,23999=>1000,24000=>1000,24001=>1000,24002=>1000,24003=>1000,24004=>1000, - 24005=>1000,24006=>1000,24007=>1000,24008=>1000,24009=>1000,24010=>1000,24011=>1000,24012=>1000,24013=>1000,24014=>1000,24015=>1000,24016=>1000,24017=>1000,24018=>1000,24019=>1000,24020=>1000, - 24021=>1000,24022=>1000,24023=>1000,24024=>1000,24025=>1000,24026=>1000,24027=>1000,24028=>1000,24029=>1000,24030=>1000,24031=>1000,24032=>1000,24033=>1000,24034=>1000,24035=>1000,24036=>1000, - 24037=>1000,24038=>1000,24039=>1000,24040=>1000,24041=>1000,24042=>1000,24043=>1000,24044=>1000,24045=>1000,24046=>1000,24047=>1000,24048=>1000,24049=>1000,24050=>1000,24051=>1000,24052=>1000, - 24053=>1000,24054=>1000,24055=>1000,24056=>1000,24057=>1000,24058=>1000,24059=>1000,24060=>1000,24061=>1000,24062=>1000,24063=>1000,24064=>1000,24065=>1000,24066=>1000,24067=>1000,24068=>1000, - 24069=>1000,24070=>1000,24071=>1000,24072=>1000,24073=>1000,24074=>1000,24075=>1000,24076=>1000,24077=>1000,24078=>1000,24079=>1000,24080=>1000,24081=>1000,24082=>1000,24083=>1000,24084=>1000, - 24085=>1000,24086=>1000,24087=>1000,24088=>1000,24089=>1000,24090=>1000,24091=>1000,24092=>1000,24093=>1000,24094=>1000,24095=>1000,24096=>1000,24097=>1000,24098=>1000,24099=>1000,24100=>1000, - 24101=>1000,24102=>1000,24103=>1000,24104=>1000,24105=>1000,24106=>1000,24107=>1000,24108=>1000,24109=>1000,24110=>1000,24111=>1000,24112=>1000,24113=>1000,24114=>1000,24115=>1000,24116=>1000, - 24117=>1000,24118=>1000,24119=>1000,24120=>1000,24121=>1000,24122=>1000,24123=>1000,24124=>1000,24125=>1000,24126=>1000,24127=>1000,24128=>1000,24129=>1000,24130=>1000,24131=>1000,24132=>1000, - 24133=>1000,24134=>1000,24135=>1000,24136=>1000,24137=>1000,24138=>1000,24139=>1000,24140=>1000,24141=>1000,24142=>1000,24143=>1000,24144=>1000,24145=>1000,24146=>1000,24147=>1000,24148=>1000, - 24149=>1000,24150=>1000,24151=>1000,24152=>1000,24153=>1000,24154=>1000,24155=>1000,24156=>1000,24157=>1000,24158=>1000,24159=>1000,24160=>1000,24161=>1000,24162=>1000,24163=>1000,24164=>1000, - 24165=>1000,24166=>1000,24167=>1000,24168=>1000,24169=>1000,24170=>1000,24171=>1000,24172=>1000,24173=>1000,24174=>1000,24175=>1000,24176=>1000,24177=>1000,24178=>1000,24179=>1000,24180=>1000, - 24181=>1000,24182=>1000,24183=>1000,24184=>1000,24185=>1000,24186=>1000,24187=>1000,24188=>1000,24189=>1000,24190=>1000,24191=>1000,24192=>1000,24193=>1000,24194=>1000,24195=>1000,24196=>1000, - 24197=>1000,24198=>1000,24199=>1000,24200=>1000,24201=>1000,24202=>1000,24203=>1000,24204=>1000,24205=>1000,24206=>1000,24207=>1000,24208=>1000,24209=>1000,24210=>1000,24211=>1000,24212=>1000, - 24213=>1000,24214=>1000,24215=>1000,24216=>1000,24217=>1000,24218=>1000,24219=>1000,24220=>1000,24221=>1000,24222=>1000,24223=>1000,24224=>1000,24225=>1000,24226=>1000,24227=>1000,24228=>1000, - 24229=>1000,24230=>1000,24231=>1000,24232=>1000,24233=>1000,24234=>1000,24235=>1000,24236=>1000,24237=>1000,24238=>1000,24239=>1000,24240=>1000,24241=>1000,24242=>1000,24243=>1000,24244=>1000, - 24245=>1000,24246=>1000,24247=>1000,24248=>1000,24249=>1000,24250=>1000,24251=>1000,24252=>1000,24253=>1000,24254=>1000,24255=>1000,24256=>1000,24257=>1000,24258=>1000,24259=>1000,24260=>1000, - 24261=>1000,24262=>1000,24263=>1000,24264=>1000,24265=>1000,24266=>1000,24267=>1000,24268=>1000,24269=>1000,24270=>1000,24271=>1000,24272=>1000,24273=>1000,24274=>1000,24275=>1000,24276=>1000, - 24277=>1000,24278=>1000,24279=>1000,24280=>1000,24281=>1000,24282=>1000,24283=>1000,24284=>1000,24285=>1000,24286=>1000,24287=>1000,24288=>1000,24289=>1000,24290=>1000,24291=>1000,24292=>1000, - 24293=>1000,24294=>1000,24295=>1000,24296=>1000,24297=>1000,24298=>1000,24299=>1000,24300=>1000,24301=>1000,24302=>1000,24303=>1000,24304=>1000,24305=>1000,24306=>1000,24307=>1000,24308=>1000, - 24309=>1000,24310=>1000,24311=>1000,24312=>1000,24313=>1000,24314=>1000,24315=>1000,24316=>1000,24317=>1000,24318=>1000,24319=>1000,24320=>1000,24321=>1000,24322=>1000,24323=>1000,24324=>1000, - 24325=>1000,24326=>1000,24327=>1000,24328=>1000,24329=>1000,24330=>1000,24331=>1000,24332=>1000,24333=>1000,24334=>1000,24335=>1000,24336=>1000,24337=>1000,24338=>1000,24339=>1000,24340=>1000, - 24341=>1000,24342=>1000,24343=>1000,24344=>1000,24345=>1000,24346=>1000,24347=>1000,24348=>1000,24349=>1000,24350=>1000,24351=>1000,24352=>1000,24353=>1000,24354=>1000,24355=>1000,24356=>1000, - 24357=>1000,24358=>1000,24359=>1000,24360=>1000,24361=>1000,24362=>1000,24363=>1000,24364=>1000,24365=>1000,24366=>1000,24367=>1000,24368=>1000,24369=>1000,24370=>1000,24371=>1000,24372=>1000, - 24373=>1000,24374=>1000,24375=>1000,24376=>1000,24377=>1000,24378=>1000,24379=>1000,24380=>1000,24381=>1000,24382=>1000,24383=>1000,24384=>1000,24385=>1000,24386=>1000,24387=>1000,24388=>1000, - 24389=>1000,24390=>1000,24391=>1000,24392=>1000,24393=>1000,24394=>1000,24395=>1000,24396=>1000,24397=>1000,24398=>1000,24399=>1000,24400=>1000,24401=>1000,24402=>1000,24403=>1000,24404=>1000, - 24405=>1000,24406=>1000,24407=>1000,24408=>1000,24409=>1000,24410=>1000,24411=>1000,24412=>1000,24413=>1000,24414=>1000,24415=>1000,24416=>1000,24417=>1000,24418=>1000,24419=>1000,24420=>1000, - 24421=>1000,24422=>1000,24423=>1000,24424=>1000,24425=>1000,24426=>1000,24427=>1000,24428=>1000,24429=>1000,24430=>1000,24431=>1000,24432=>1000,24433=>1000,24434=>1000,24435=>1000,24436=>1000, - 24437=>1000,24438=>1000,24439=>1000,24440=>1000,24441=>1000,24442=>1000,24443=>1000,24444=>1000,24445=>1000,24446=>1000,24447=>1000,24448=>1000,24449=>1000,24450=>1000,24451=>1000,24452=>1000, - 24453=>1000,24454=>1000,24455=>1000,24456=>1000,24457=>1000,24458=>1000,24459=>1000,24460=>1000,24461=>1000,24462=>1000,24463=>1000,24464=>1000,24465=>1000,24466=>1000,24467=>1000,24468=>1000, - 24469=>1000,24470=>1000,24471=>1000,24472=>1000,24473=>1000,24474=>1000,24475=>1000,24476=>1000,24477=>1000,24478=>1000,24479=>1000,24480=>1000,24481=>1000,24482=>1000,24483=>1000,24484=>1000, - 24485=>1000,24486=>1000,24487=>1000,24488=>1000,24489=>1000,24490=>1000,24491=>1000,24492=>1000,24493=>1000,24494=>1000,24495=>1000,24496=>1000,24497=>1000,24498=>1000,24499=>1000,24500=>1000, - 24501=>1000,24502=>1000,24503=>1000,24504=>1000,24505=>1000,24506=>1000,24507=>1000,24508=>1000,24509=>1000,24510=>1000,24511=>1000,24512=>1000,24513=>1000,24514=>1000,24515=>1000,24516=>1000, - 24517=>1000,24518=>1000,24519=>1000,24520=>1000,24521=>1000,24522=>1000,24523=>1000,24524=>1000,24525=>1000,24526=>1000,24527=>1000,24528=>1000,24529=>1000,24530=>1000,24531=>1000,24532=>1000, - 24533=>1000,24534=>1000,24535=>1000,24536=>1000,24537=>1000,24538=>1000,24539=>1000,24540=>1000,24541=>1000,24542=>1000,24543=>1000,24544=>1000,24545=>1000,24546=>1000,24547=>1000,24548=>1000, - 24549=>1000,24550=>1000,24551=>1000,24552=>1000,24553=>1000,24554=>1000,24555=>1000,24556=>1000,24557=>1000,24558=>1000,24559=>1000,24560=>1000,24561=>1000,24562=>1000,24563=>1000,24564=>1000, - 24565=>1000,24566=>1000,24567=>1000,24568=>1000,24569=>1000,24570=>1000,24571=>1000,24572=>1000,24573=>1000,24574=>1000,24575=>1000,24576=>1000,24577=>1000,24578=>1000,24579=>1000,24580=>1000, - 24581=>1000,24582=>1000,24583=>1000,24584=>1000,24585=>1000,24586=>1000,24587=>1000,24588=>1000,24589=>1000,24590=>1000,24591=>1000,24592=>1000,24593=>1000,24594=>1000,24595=>1000,24596=>1000, - 24597=>1000,24598=>1000,24599=>1000,24600=>1000,24601=>1000,24602=>1000,24603=>1000,24604=>1000,24605=>1000,24606=>1000,24607=>1000,24608=>1000,24609=>1000,24610=>1000,24611=>1000,24612=>1000, - 24613=>1000,24614=>1000,24615=>1000,24616=>1000,24617=>1000,24618=>1000,24619=>1000,24620=>1000,24621=>1000,24622=>1000,24623=>1000,24624=>1000,24625=>1000,24626=>1000,24627=>1000,24628=>1000, - 24629=>1000,24630=>1000,24631=>1000,24632=>1000,24633=>1000,24634=>1000,24635=>1000,24636=>1000,24637=>1000,24638=>1000,24639=>1000,24640=>1000,24641=>1000,24642=>1000,24643=>1000,24644=>1000, - 24645=>1000,24646=>1000,24647=>1000,24648=>1000,24649=>1000,24650=>1000,24651=>1000,24652=>1000,24653=>1000,24654=>1000,24655=>1000,24656=>1000,24657=>1000,24658=>1000,24659=>1000,24660=>1000, - 24661=>1000,24662=>1000,24663=>1000,24664=>1000,24665=>1000,24666=>1000,24667=>1000,24668=>1000,24669=>1000,24670=>1000,24671=>1000,24672=>1000,24673=>1000,24674=>1000,24675=>1000,24676=>1000, - 24677=>1000,24678=>1000,24679=>1000,24680=>1000,24681=>1000,24682=>1000,24683=>1000,24684=>1000,24685=>1000,24686=>1000,24687=>1000,24688=>1000,24689=>1000,24690=>1000,24691=>1000,24692=>1000, - 24693=>1000,24694=>1000,24695=>1000,24696=>1000,24697=>1000,24698=>1000,24699=>1000,24700=>1000,24701=>1000,24702=>1000,24703=>1000,24704=>1000,24705=>1000,24706=>1000,24707=>1000,24708=>1000, - 24709=>1000,24710=>1000,24711=>1000,24712=>1000,24713=>1000,24714=>1000,24715=>1000,24716=>1000,24717=>1000,24718=>1000,24719=>1000,24720=>1000,24721=>1000,24722=>1000,24723=>1000,24724=>1000, - 24725=>1000,24726=>1000,24727=>1000,24728=>1000,24729=>1000,24730=>1000,24731=>1000,24732=>1000,24733=>1000,24734=>1000,24735=>1000,24736=>1000,24737=>1000,24738=>1000,24739=>1000,24740=>1000, - 24741=>1000,24742=>1000,24743=>1000,24744=>1000,24745=>1000,24746=>1000,24747=>1000,24748=>1000,24749=>1000,24750=>1000,24751=>1000,24752=>1000,24753=>1000,24754=>1000,24755=>1000,24756=>1000, - 24757=>1000,24758=>1000,24759=>1000,24760=>1000,24761=>1000,24762=>1000,24763=>1000,24764=>1000,24765=>1000,24766=>1000,24767=>1000,24768=>1000,24769=>1000,24770=>1000,24771=>1000,24772=>1000, - 24773=>1000,24774=>1000,24775=>1000,24776=>1000,24777=>1000,24778=>1000,24779=>1000,24780=>1000,24781=>1000,24782=>1000,24783=>1000,24784=>1000,24785=>1000,24786=>1000,24787=>1000,24788=>1000, - 24789=>1000,24790=>1000,24791=>1000,24792=>1000,24793=>1000,24794=>1000,24795=>1000,24796=>1000,24797=>1000,24798=>1000,24799=>1000,24800=>1000,24801=>1000,24802=>1000,24803=>1000,24804=>1000, - 24805=>1000,24806=>1000,24807=>1000,24808=>1000,24809=>1000,24810=>1000,24811=>1000,24812=>1000,24813=>1000,24814=>1000,24815=>1000,24816=>1000,24817=>1000,24818=>1000,24819=>1000,24820=>1000, - 24821=>1000,24822=>1000,24823=>1000,24824=>1000,24825=>1000,24826=>1000,24827=>1000,24828=>1000,24829=>1000,24830=>1000,24831=>1000,24832=>1000,24833=>1000,24834=>1000,24835=>1000,24836=>1000, - 24837=>1000,24838=>1000,24839=>1000,24840=>1000,24841=>1000,24842=>1000,24843=>1000,24844=>1000,24845=>1000,24846=>1000,24847=>1000,24848=>1000,24849=>1000,24850=>1000,24851=>1000,24852=>1000, - 24853=>1000,24854=>1000,24855=>1000,24856=>1000,24857=>1000,24858=>1000,24859=>1000,24860=>1000,24861=>1000,24862=>1000,24863=>1000,24864=>1000,24865=>1000,24866=>1000,24867=>1000,24868=>1000, - 24869=>1000,24870=>1000,24871=>1000,24872=>1000,24873=>1000,24874=>1000,24875=>1000,24876=>1000,24877=>1000,24878=>1000,24879=>1000,24880=>1000,24881=>1000,24882=>1000,24883=>1000,24884=>1000, - 24885=>1000,24886=>1000,24887=>1000,24888=>1000,24889=>1000,24890=>1000,24891=>1000,24892=>1000,24893=>1000,24894=>1000,24895=>1000,24896=>1000,24897=>1000,24898=>1000,24899=>1000,24900=>1000, - 24901=>1000,24902=>1000,24903=>1000,24904=>1000,24905=>1000,24906=>1000,24907=>1000,24908=>1000,24909=>1000,24910=>1000,24911=>1000,24912=>1000,24913=>1000,24914=>1000,24915=>1000,24916=>1000, - 24917=>1000,24918=>1000,24919=>1000,24920=>1000,24921=>1000,24922=>1000,24923=>1000,24924=>1000,24925=>1000,24926=>1000,24927=>1000,24928=>1000,24929=>1000,24930=>1000,24931=>1000,24932=>1000, - 24933=>1000,24934=>1000,24935=>1000,24936=>1000,24937=>1000,24938=>1000,24939=>1000,24940=>1000,24941=>1000,24942=>1000,24943=>1000,24944=>1000,24945=>1000,24946=>1000,24947=>1000,24948=>1000, - 24949=>1000,24950=>1000,24951=>1000,24952=>1000,24953=>1000,24954=>1000,24955=>1000,24956=>1000,24957=>1000,24958=>1000,24959=>1000,24960=>1000,24961=>1001,24962=>1000,24963=>1000,24964=>1000, - 24965=>1000,24966=>1000,24967=>1000,24968=>1000,24969=>1000,24970=>1000,24971=>1000,24972=>1000,24973=>1000,24974=>1000,24975=>1000,24976=>1000,24977=>1000,24978=>1000,24979=>1000,24980=>1000, - 24981=>1000,24982=>1000,24983=>1000,24984=>1000,24985=>1000,24986=>1000,24987=>1000,24988=>1000,24989=>1000,24990=>1000,24991=>1000,24992=>1000,24993=>1000,24994=>1000,24995=>1000,24996=>1000, - 24997=>1000,24998=>1000,24999=>1000,25000=>1000,25001=>1000,25002=>1000,25003=>1000,25004=>1000,25005=>1000,25006=>1000,25007=>1000,25008=>1000,25009=>1000,25010=>1000,25011=>1000,25012=>1000, - 25013=>1000,25014=>1000,25015=>1000,25016=>1000,25017=>1000,25018=>1000,25019=>1000,25020=>1000,25021=>1000,25022=>1000,25023=>1000,25024=>1000,25025=>1000,25026=>1000,25027=>1000,25028=>1000, - 25029=>1000,25030=>1000,25031=>1000,25032=>1000,25033=>1000,25034=>1000,25035=>1000,25036=>1000,25037=>1000,25038=>1000,25039=>1000,25040=>1000,25041=>1000,25042=>1000,25043=>1000,25044=>1000, - 25045=>1000,25046=>1000,25047=>1000,25048=>1000,25049=>1000,25050=>1000,25051=>1000,25052=>1000,25053=>1000,25054=>1000,25055=>1000,25056=>1000,25057=>1000,25058=>1000,25059=>1000,25060=>1000, - 25061=>1000,25062=>1000,25063=>1000,25064=>1000,25065=>1000,25066=>1000,25067=>1000,25068=>1000,25069=>1000,25070=>1000,25071=>1000,25072=>1000,25073=>1000,25074=>1000,25075=>1000,25076=>1000, - 25077=>1000,25078=>1000,25079=>1000,25080=>1000,25081=>1000,25082=>1000,25083=>1000,25084=>1000,25085=>1000,25086=>1000,25087=>1000,25088=>1000,25089=>1000,25090=>1000,25091=>1000,25092=>1000, - 25093=>1000,25094=>1000,25095=>1000,25096=>1000,25097=>1000,25098=>1000,25099=>1000,25100=>1000,25101=>1000,25102=>1000,25103=>1000,25104=>1000,25105=>1000,25106=>1000,25107=>1000,25108=>1000, - 25109=>1000,25110=>1000,25111=>1000,25112=>1000,25113=>1000,25114=>1000,25115=>1000,25116=>1000,25117=>1000,25118=>1000,25119=>1000,25120=>1000,25121=>1000,25122=>1000,25123=>1000,25124=>1000, - 25125=>1000,25126=>1000,25127=>1000,25128=>1000,25129=>1000,25130=>1000,25131=>1000,25132=>1000,25133=>1000,25134=>1000,25135=>1000,25136=>1000,25137=>1000,25138=>1000,25139=>1000,25140=>1000, - 25141=>1000,25142=>1000,25143=>1000,25144=>1000,25145=>1000,25146=>1000,25147=>1000,25148=>1000,25149=>1000,25150=>1000,25151=>1000,25152=>1000,25153=>1000,25154=>1000,25155=>1000,25156=>1000, - 25157=>1000,25158=>1000,25159=>1000,25160=>1000,25161=>1000,25162=>1000,25163=>1000,25164=>1000,25165=>1000,25166=>1000,25167=>1000,25168=>1000,25169=>1000,25170=>1000,25171=>1000,25172=>1000, - 25173=>1000,25174=>1000,25175=>1000,25176=>1000,25177=>1000,25178=>1000,25179=>1000,25180=>1000,25181=>1000,25182=>1000,25183=>1000,25184=>1000,25185=>1000,25186=>1000,25187=>1000,25188=>1000, - 25189=>1000,25190=>1000,25191=>1000,25192=>1000,25193=>1000,25194=>1000,25195=>1000,25196=>1000,25197=>1000,25198=>1000,25199=>1000,25200=>1000,25201=>1000,25202=>1000,25203=>1000,25204=>1000, - 25205=>1000,25206=>1000,25207=>1000,25208=>1000,25209=>1000,25210=>1000,25211=>1000,25212=>1000,25213=>1000,25214=>1000,25215=>1000,25216=>1000,25217=>1000,25218=>1000,25219=>1000,25220=>1000, - 25221=>1000,25222=>1000,25223=>1000,25224=>1000,25225=>1000,25226=>1000,25227=>1000,25228=>1000,25229=>1000,25230=>1000,25231=>1000,25232=>1000,25233=>1000,25234=>1000,25235=>1000,25236=>1000, - 25237=>1000,25238=>1000,25239=>1000,25240=>1000,25241=>1000,25242=>1000,25243=>1000,25244=>1000,25245=>1000,25246=>1000,25247=>1000,25248=>1000,25249=>1000,25250=>1000,25251=>1000,25252=>1000, - 25253=>1000,25254=>1000,25255=>1000,25256=>1000,25257=>1000,25258=>1000,25259=>1000,25260=>1000,25261=>1000,25262=>1000,25263=>1000,25264=>1000,25265=>1000,25266=>1000,25267=>1000,25268=>1000, - 25269=>1000,25270=>1000,25271=>1000,25272=>1000,25273=>1000,25274=>1000,25275=>1000,25276=>1000,25277=>1000,25278=>1000,25279=>1000,25280=>1000,25281=>1000,25282=>1000,25283=>1000,25284=>1000, - 25285=>1000,25286=>1000,25287=>1000,25288=>1000,25289=>1000,25290=>1000,25291=>1000,25292=>1000,25293=>1000,25294=>1000,25295=>1000,25296=>1000,25297=>1000,25298=>1000,25299=>1000,25300=>1000, - 25301=>1000,25302=>1000,25303=>1000,25304=>1000,25305=>1000,25306=>1000,25307=>1000,25308=>1000,25309=>1000,25310=>1000,25311=>1000,25312=>1000,25313=>1000,25314=>1000,25315=>1000,25316=>1000, - 25317=>1000,25318=>1000,25319=>1000,25320=>1000,25321=>1000,25322=>1000,25323=>1000,25324=>1000,25325=>1000,25326=>1000,25327=>1000,25328=>1000,25329=>1000,25330=>1000,25331=>1000,25332=>1000, - 25333=>1000,25334=>1000,25335=>1000,25336=>1000,25337=>1000,25338=>1000,25339=>1000,25340=>1000,25341=>1000,25342=>1000,25343=>1000,25344=>1000,25345=>1000,25346=>1000,25347=>1000,25348=>1000, - 25349=>1000,25350=>1000,25351=>1000,25352=>1000,25353=>1000,25354=>1000,25355=>1000,25356=>1000,25357=>1000,25358=>1000,25359=>1000,25360=>1000,25361=>1000,25362=>1000,25363=>1000,25364=>1000, - 25365=>1000,25366=>1000,25367=>1000,25368=>1000,25369=>1000,25370=>1000,25371=>1000,25372=>1000,25373=>1000,25374=>1000,25375=>1000,25376=>1000,25377=>1000,25378=>1000,25379=>1000,25380=>1000, - 25381=>1000,25382=>1000,25383=>1000,25384=>1000,25385=>1000,25386=>1000,25387=>1000,25388=>1000,25389=>1000,25390=>1000,25391=>1000,25392=>1000,25393=>1000,25394=>1000,25395=>1000,25396=>1000, - 25397=>1000,25398=>1000,25399=>1000,25400=>1000,25401=>1000,25402=>1000,25403=>1000,25404=>1000,25405=>1000,25406=>1000,25407=>1000,25408=>1000,25409=>1000,25410=>1000,25411=>1000,25412=>1000, - 25413=>1000,25414=>1000,25415=>1000,25416=>1000,25417=>1000,25418=>1000,25419=>1000,25420=>1000,25421=>1000,25422=>1000,25423=>1000,25424=>1000,25425=>1000,25426=>1000,25427=>1000,25428=>1000, - 25429=>1000,25430=>1000,25431=>1000,25432=>1000,25433=>1000,25434=>1000,25435=>1000,25436=>1000,25437=>1000,25438=>1000,25439=>1000,25440=>1000,25441=>1000,25442=>1000,25443=>1000,25444=>1000, - 25445=>1000,25446=>1000,25447=>1000,25448=>1000,25449=>1000,25450=>1000,25451=>1000,25452=>1000,25453=>1000,25454=>1000,25455=>1000,25456=>1000,25457=>1000,25458=>1000,25459=>1000,25460=>1000, - 25461=>1000,25462=>1000,25463=>1000,25464=>1000,25465=>1000,25466=>1000,25467=>1000,25468=>1000,25469=>1000,25470=>1000,25471=>1000,25472=>1000,25473=>1000,25474=>1000,25475=>1000,25476=>1000, - 25477=>1000,25478=>1000,25479=>1000,25480=>1000,25481=>1000,25482=>1000,25483=>1000,25484=>1000,25485=>1000,25486=>1000,25487=>1000,25488=>1000,25489=>1000,25490=>1000,25491=>1000,25492=>1000, - 25493=>1000,25494=>1000,25495=>1000,25496=>1000,25497=>1000,25498=>1000,25499=>1000,25500=>1000,25501=>1000,25502=>1000,25503=>1000,25504=>1000,25505=>1000,25506=>1000,25507=>1000,25508=>1000, - 25509=>1000,25510=>1000,25511=>1000,25512=>1000,25513=>1000,25514=>1000,25515=>1000,25516=>1000,25517=>1000,25518=>1000,25519=>1000,25520=>1000,25521=>1000,25522=>1000,25523=>1000,25524=>1000, - 25525=>1000,25526=>1000,25527=>1000,25528=>1000,25529=>1000,25530=>1000,25531=>1000,25532=>1000,25533=>1000,25534=>1000,25535=>1000,25536=>1000,25537=>1000,25538=>1000,25539=>1000,25540=>1000, - 25541=>1000,25542=>1000,25543=>1000,25544=>1000,25545=>1000,25546=>1000,25547=>1000,25548=>1000,25549=>1000,25550=>1000,25551=>1000,25552=>1000,25553=>1000,25554=>1000,25555=>1000,25556=>1000, - 25557=>1000,25558=>1000,25559=>1000,25560=>1000,25561=>1000,25562=>1000,25563=>1000,25564=>1000,25565=>1000,25566=>1000,25567=>1000,25568=>1000,25569=>1000,25570=>1000,25571=>1000,25572=>1000, - 25573=>1000,25574=>1000,25575=>1000,25576=>1000,25577=>1000,25578=>1000,25579=>1000,25580=>1000,25581=>1000,25582=>1000,25583=>1000,25584=>1000,25585=>1000,25586=>1000,25587=>1000,25588=>1000, - 25589=>1000,25590=>1000,25591=>1000,25592=>1000,25593=>1000,25594=>1000,25595=>1000,25596=>1000,25597=>1000,25598=>1000,25599=>1000,25600=>1000,25601=>1000,25602=>1000,25603=>1000,25604=>1000, - 25605=>1000,25606=>1000,25607=>1000,25608=>1000,25609=>1000,25610=>1000,25611=>1000,25612=>1000,25613=>1000,25614=>1000,25615=>1000,25616=>1000,25617=>1000,25618=>1000,25619=>1000,25620=>1000, - 25621=>1000,25622=>1000,25623=>1000,25624=>1000,25625=>1000,25626=>1000,25627=>1000,25628=>1000,25629=>1000,25630=>1000,25631=>1000,25632=>1000,25633=>1000,25634=>1000,25635=>1000,25636=>1000, - 25637=>1000,25638=>1000,25639=>1000,25640=>1000,25641=>1000,25642=>1000,25643=>1000,25644=>1000,25645=>1000,25646=>1000,25647=>1000,25648=>1000,25649=>1000,25650=>1000,25651=>1000,25652=>1000, - 25653=>1000,25654=>1000,25655=>1000,25656=>1000,25657=>1000,25658=>1000,25659=>1000,25660=>1000,25661=>1000,25662=>1000,25663=>1000,25664=>1000,25665=>1000,25666=>1000,25667=>1000,25668=>1000, - 25669=>1000,25670=>1000,25671=>1000,25672=>1000,25673=>1000,25674=>1000,25675=>1000,25676=>1000,25677=>1000,25678=>1000,25679=>1000,25680=>1000,25681=>1000,25682=>1000,25683=>1000,25684=>1000, - 25685=>1000,25686=>1000,25687=>1000,25688=>1000,25689=>1000,25690=>1000,25691=>1000,25692=>1000,25693=>1000,25694=>1000,25695=>1000,25696=>1000,25697=>1000,25698=>1000,25699=>1000,25700=>1000, - 25701=>1000,25702=>1000,25703=>1000,25704=>1000,25705=>1000,25706=>1000,25707=>1000,25708=>1000,25709=>1000,25710=>1000,25711=>1000,25712=>1000,25713=>1000,25714=>1000,25715=>1000,25716=>1000, - 25717=>1000,25718=>1000,25719=>1000,25720=>1000,25721=>1000,25722=>1000,25723=>1000,25724=>1000,25725=>1000,25726=>1000,25727=>1000,25728=>1000,25729=>1000,25730=>1000,25731=>1000,25732=>1000, - 25733=>1000,25734=>1000,25735=>1000,25736=>1000,25737=>1000,25738=>1000,25739=>1000,25740=>1000,25741=>1000,25742=>1000,25743=>1000,25744=>1000,25745=>1000,25746=>1000,25747=>1000,25748=>1000, - 25749=>1000,25750=>1000,25751=>1000,25752=>1000,25753=>1000,25754=>1000,25755=>1000,25756=>1000,25757=>1000,25758=>1000,25759=>1000,25760=>1000,25761=>1000,25762=>1000,25763=>1000,25764=>1000, - 25765=>1000,25766=>1000,25767=>1000,25768=>1000,25769=>1000,25770=>1000,25771=>1000,25772=>1000,25773=>1000,25774=>1000,25775=>1000,25776=>1000,25777=>1000,25778=>1000,25779=>1000,25780=>1000, - 25781=>1000,25782=>1000,25783=>1000,25784=>1000,25785=>1000,25786=>1000,25787=>1000,25788=>1000,25789=>1000,25790=>1000,25791=>1000,25792=>1000,25793=>1000,25794=>1000,25795=>1000,25796=>1000, - 25797=>1000,25798=>1000,25799=>1000,25800=>1000,25801=>1000,25802=>1000,25803=>1000,25804=>1000,25805=>1000,25806=>1000,25807=>1000,25808=>1000,25809=>1000,25810=>1000,25811=>1000,25812=>1000, - 25813=>1000,25814=>1000,25815=>1000,25816=>1000,25817=>1000,25818=>1000,25819=>1000,25820=>1000,25821=>1000,25822=>1000,25823=>1000,25824=>1000,25825=>1000,25826=>1000,25827=>1000,25828=>1000, - 25829=>1000,25830=>1000,25831=>1000,25832=>1000,25833=>1000,25834=>1000,25835=>1000,25836=>1000,25837=>1000,25838=>1000,25839=>1000,25840=>1000,25841=>1000,25842=>1000,25843=>1000,25844=>1000, - 25845=>1000,25846=>1000,25847=>1000,25848=>1000,25849=>1000,25850=>1000,25851=>1000,25852=>1000,25853=>1000,25854=>1000,25855=>1000,25856=>1000,25857=>1000,25858=>1000,25859=>1000,25860=>1000, - 25861=>1000,25862=>1000,25863=>1000,25864=>1000,25865=>1000,25866=>1000,25867=>1000,25868=>1000,25869=>1000,25870=>1000,25871=>1000,25872=>1000,25873=>1000,25874=>1000,25875=>1000,25876=>1000, - 25877=>1000,25878=>1000,25879=>1000,25880=>1000,25881=>1000,25882=>1000,25883=>1000,25884=>1000,25885=>1000,25886=>1000,25887=>1000,25888=>1000,25889=>1000,25890=>1000,25891=>1000,25892=>1000, - 25893=>1000,25894=>1000,25895=>1000,25896=>1000,25897=>1000,25898=>1000,25899=>1000,25900=>1000,25901=>1000,25902=>1000,25903=>1000,25904=>1000,25905=>1000,25906=>1000,25907=>1000,25908=>1000, - 25909=>1000,25910=>1000,25911=>1000,25912=>1000,25913=>1000,25914=>1000,25915=>1000,25916=>1000,25917=>1000,25918=>1000,25919=>1000,25920=>1000,25921=>1000,25922=>1000,25923=>1000,25924=>1000, - 25925=>1000,25926=>1000,25927=>1000,25928=>1000,25929=>1000,25930=>1000,25931=>1000,25932=>1000,25933=>1000,25934=>1000,25935=>1000,25936=>1000,25937=>1000,25938=>1000,25939=>1000,25940=>1000, - 25941=>1000,25942=>1000,25943=>1000,25944=>1000,25945=>1000,25946=>1000,25947=>1000,25948=>1000,25949=>1000,25950=>1000,25951=>1000,25952=>1000,25953=>1000,25954=>1000,25955=>1000,25956=>1000, - 25957=>1000,25958=>1000,25959=>1000,25960=>1000,25961=>1000,25962=>1000,25963=>1000,25964=>1000,25965=>1000,25966=>1000,25967=>1000,25968=>1000,25969=>1000,25970=>1000,25971=>1000,25972=>1000, - 25973=>1000,25974=>1000,25975=>1000,25976=>1000,25977=>1000,25978=>1000,25979=>1000,25980=>1000,25981=>1000,25982=>1000,25983=>1000,25984=>1000,25985=>1000,25986=>1000,25987=>1000,25988=>1000, - 25989=>1000,25990=>1000,25991=>1000,25992=>1000,25993=>1000,25994=>1000,25995=>1000,25996=>1000,25997=>1000,25998=>1000,25999=>1000,26000=>1000,26001=>1000,26002=>1000,26003=>1000,26004=>1000, - 26005=>1000,26006=>1000,26007=>1000,26008=>1000,26009=>1000,26010=>1000,26011=>1000,26012=>1000,26013=>1000,26014=>1000,26015=>1000,26016=>1000,26017=>1000,26018=>1000,26019=>1000,26020=>1000, - 26021=>1000,26022=>1000,26023=>1000,26024=>1000,26025=>1000,26026=>1000,26027=>1000,26028=>1000,26029=>1000,26030=>1000,26031=>1000,26032=>1000,26033=>1000,26034=>1000,26035=>1000,26036=>1000, - 26037=>1000,26038=>1000,26039=>1000,26040=>1000,26041=>1000,26042=>1000,26043=>1000,26044=>1000,26045=>1000,26046=>1000,26047=>1000,26048=>1000,26049=>1000,26050=>1000,26051=>1000,26052=>1000, - 26053=>1000,26054=>1000,26055=>1000,26056=>1000,26057=>1000,26058=>1000,26059=>1000,26060=>1000,26061=>1000,26062=>1000,26063=>1000,26064=>1000,26065=>1000,26066=>1000,26067=>1000,26068=>1000, - 26069=>1000,26070=>1000,26071=>1000,26072=>1000,26073=>1000,26074=>1000,26075=>1000,26076=>1000,26077=>1000,26078=>1000,26079=>1000,26080=>1000,26081=>1000,26082=>1000,26083=>1000,26084=>1000, - 26085=>1000,26086=>1000,26087=>1000,26088=>1000,26089=>1000,26090=>1000,26091=>1000,26092=>1000,26093=>1000,26094=>1000,26095=>1000,26096=>1000,26097=>1000,26098=>1000,26099=>1000,26100=>1000, - 26101=>1000,26102=>1000,26103=>1000,26104=>1000,26105=>1000,26106=>1000,26107=>1000,26108=>1000,26109=>1000,26110=>1000,26111=>1000,26112=>1000,26113=>1000,26114=>1000,26115=>1000,26116=>1000, - 26117=>1000,26118=>1000,26119=>1000,26120=>1000,26121=>1000,26122=>1000,26123=>1000,26124=>1000,26125=>1000,26126=>1000,26127=>1000,26128=>1000,26129=>1000,26130=>1000,26131=>1000,26132=>1000, - 26133=>1000,26134=>1000,26135=>1000,26136=>1000,26137=>1000,26138=>1000,26139=>1000,26140=>1000,26141=>1000,26142=>1000,26143=>1000,26144=>1000,26145=>1000,26146=>1000,26147=>1000,26148=>1000, - 26149=>1000,26150=>1000,26151=>1000,26152=>1000,26153=>1000,26154=>1000,26155=>1000,26156=>1000,26157=>1000,26158=>1000,26159=>1000,26160=>1000,26161=>1000,26162=>1000,26163=>1000,26164=>1000, - 26165=>1000,26166=>1000,26167=>1000,26168=>1000,26169=>1000,26170=>1000,26171=>1000,26172=>1000,26173=>1000,26174=>1000,26175=>1000,26176=>1000,26177=>1000,26178=>1000,26179=>1000,26180=>1000, - 26181=>1000,26182=>1000,26183=>1000,26184=>1000,26185=>1000,26186=>1000,26187=>1000,26188=>1000,26189=>1000,26190=>1000,26191=>1000,26192=>1000,26193=>1000,26194=>1000,26195=>1000,26196=>1000, - 26197=>1000,26198=>1000,26199=>1000,26200=>1000,26201=>1000,26202=>1000,26203=>1000,26204=>1000,26205=>1000,26206=>1000,26207=>1000,26208=>1000,26209=>1000,26210=>1000,26211=>1000,26212=>1000, - 26213=>1000,26214=>1000,26215=>1000,26216=>1000,26217=>1000,26218=>1000,26219=>1000,26220=>1000,26221=>1000,26222=>1000,26223=>1000,26224=>1000,26225=>1000,26226=>1000,26227=>1000,26228=>1000, - 26229=>1000,26230=>1000,26231=>1000,26232=>1000,26233=>1000,26234=>1000,26235=>1000,26236=>1000,26237=>1000,26238=>1000,26239=>1000,26240=>1000,26241=>1000,26242=>1000,26243=>1000,26244=>1000, - 26245=>1000,26246=>1000,26247=>1000,26248=>1000,26249=>1000,26250=>1000,26251=>1000,26252=>1000,26253=>1000,26254=>1000,26255=>1000,26256=>1000,26257=>1000,26258=>1000,26259=>1000,26260=>1000, - 26261=>1000,26262=>1000,26263=>1000,26264=>1000,26265=>1000,26266=>1000,26267=>1000,26268=>1000,26269=>1000,26270=>1000,26271=>1000,26272=>1000,26273=>1000,26274=>1000,26275=>1000,26276=>1000, - 26277=>1000,26278=>1000,26279=>1000,26280=>1000,26281=>1000,26282=>1000,26283=>1000,26284=>1000,26285=>1000,26286=>1000,26287=>1000,26288=>1000,26289=>1000,26290=>1000,26291=>1000,26292=>1000, - 26293=>1000,26294=>1000,26295=>1000,26296=>1000,26297=>1000,26298=>1000,26299=>1000,26300=>1000,26301=>1000,26302=>1000,26303=>1000,26304=>1000,26305=>1000,26306=>1000,26307=>1000,26308=>1000, - 26309=>1000,26310=>1000,26311=>1000,26312=>1000,26313=>1000,26314=>1000,26315=>1000,26316=>1000,26317=>1000,26318=>1000,26319=>1000,26320=>1000,26321=>1000,26322=>1000,26323=>1000,26324=>1000, - 26325=>1000,26326=>1000,26327=>1000,26328=>1000,26329=>1000,26330=>1000,26331=>1000,26332=>1000,26333=>1000,26334=>1000,26335=>1000,26336=>1000,26337=>1000,26338=>1000,26339=>1000,26340=>1000, - 26341=>1000,26342=>1000,26343=>1000,26344=>1000,26345=>1000,26346=>1000,26347=>1000,26348=>1000,26349=>1000,26350=>1000,26351=>1000,26352=>1000,26353=>1000,26354=>1000,26355=>1000,26356=>1000, - 26357=>1000,26358=>1000,26359=>1000,26360=>1000,26361=>1000,26362=>1000,26363=>1000,26364=>1000,26365=>1000,26366=>1000,26367=>1000,26368=>1000,26369=>1000,26370=>1000,26371=>1000,26372=>1000, - 26373=>1000,26374=>1000,26375=>1000,26376=>1000,26377=>1000,26378=>1000,26379=>1000,26380=>1000,26381=>1000,26382=>1000,26383=>1000,26384=>1000,26385=>1000,26386=>1000,26387=>1000,26388=>1000, - 26389=>1000,26390=>1000,26391=>1000,26392=>1000,26393=>1000,26394=>1000,26395=>1000,26396=>1000,26397=>1000,26398=>1000,26399=>1000,26400=>1000,26401=>1000,26402=>1000,26403=>1000,26404=>1000, - 26405=>1000,26406=>1000,26407=>1000,26408=>1000,26409=>1000,26410=>1000,26411=>1000,26412=>1000,26413=>1000,26414=>1000,26415=>1000,26416=>1000,26417=>1000,26418=>1000,26419=>1000,26420=>1000, - 26421=>1000,26422=>1000,26423=>1000,26424=>1000,26425=>1000,26426=>1000,26427=>1000,26428=>1000,26429=>1000,26430=>1000,26431=>1000,26432=>1000,26433=>1000,26434=>1000,26435=>1000,26436=>1000, - 26437=>1000,26438=>1000,26439=>1000,26440=>1000,26441=>1000,26442=>1000,26443=>1000,26444=>1000,26445=>1000,26446=>1000,26447=>1000,26448=>1000,26449=>1000,26450=>1000,26451=>1000,26452=>1000, - 26453=>1000,26454=>1000,26455=>1000,26456=>1000,26457=>1000,26458=>1000,26459=>1000,26460=>1000,26461=>1000,26462=>1000,26463=>1000,26464=>1000,26465=>1000,26466=>1000,26467=>1000,26468=>1000, - 26469=>1000,26470=>1000,26471=>1000,26472=>1000,26473=>1000,26474=>1000,26475=>1000,26476=>1000,26477=>1000,26478=>1000,26479=>1000,26480=>1000,26481=>1000,26482=>1000,26483=>1000,26484=>1000, - 26485=>1000,26486=>1000,26487=>1000,26488=>1000,26489=>1000,26490=>1000,26491=>1000,26492=>1000,26493=>1000,26494=>1000,26495=>1000,26496=>1000,26497=>1000,26498=>1000,26499=>1000,26500=>1000, - 26501=>1000,26502=>1000,26503=>1000,26504=>1000,26505=>1000,26506=>1000,26507=>1000,26508=>1000,26509=>1000,26510=>1000,26511=>1000,26512=>1000,26513=>1000,26514=>1000,26515=>1000,26516=>1000, - 26517=>1000,26518=>1000,26519=>1000,26520=>1000,26521=>1000,26522=>1000,26523=>1000,26524=>1000,26525=>1000,26526=>1000,26527=>1000,26528=>1000,26529=>1000,26530=>1000,26531=>1000,26532=>1000, - 26533=>1000,26534=>1000,26535=>1000,26536=>1000,26537=>1000,26538=>1000,26539=>1000,26540=>1000,26541=>1000,26542=>1000,26543=>1000,26544=>1000,26545=>1000,26546=>1000,26547=>1000,26548=>1000, - 26549=>1000,26550=>1000,26551=>1000,26552=>1000,26553=>1000,26554=>1000,26555=>1000,26556=>1000,26557=>1000,26558=>1000,26559=>1000,26560=>1000,26561=>1000,26562=>1000,26563=>1000,26564=>1000, - 26565=>1000,26566=>1000,26567=>1000,26568=>1000,26569=>1000,26570=>1000,26571=>1000,26572=>1000,26573=>1000,26574=>1000,26575=>1000,26576=>1000,26577=>1000,26578=>1000,26579=>1000,26580=>1000, - 26581=>1000,26582=>1000,26583=>1000,26584=>1000,26585=>1000,26586=>1000,26587=>1000,26588=>1000,26589=>1000,26590=>1000,26591=>1000,26592=>1000,26593=>1000,26594=>1000,26595=>1000,26596=>1000, - 26597=>1000,26598=>1000,26599=>1000,26600=>1000,26601=>1000,26602=>1000,26603=>1000,26604=>1000,26605=>1000,26606=>1000,26607=>1000,26608=>1000,26609=>1000,26610=>1000,26611=>1000,26612=>1000, - 26613=>1000,26614=>1000,26615=>1000,26616=>1000,26617=>1000,26618=>1000,26619=>1000,26620=>1000,26621=>1000,26622=>1000,26623=>1000,26624=>1000,26625=>1000,26626=>1000,26627=>1000,26628=>1000, - 26629=>1000,26630=>1000,26631=>1000,26632=>1000,26633=>1000,26634=>1000,26635=>1000,26636=>1000,26637=>1000,26638=>1000,26639=>1000,26640=>1000,26641=>1000,26642=>1000,26643=>1000,26644=>1000, - 26645=>1000,26646=>1000,26647=>1000,26648=>1000,26649=>1000,26650=>1000,26651=>1000,26652=>1000,26653=>1000,26654=>1000,26655=>1000,26656=>1000,26657=>1000,26658=>1000,26659=>1000,26660=>1000, - 26661=>1000,26662=>1000,26663=>1000,26664=>1000,26665=>1000,26666=>1000,26667=>1000,26668=>1000,26669=>1000,26670=>1000,26671=>1000,26672=>1000,26673=>1000,26674=>1000,26675=>1000,26676=>1000, - 26677=>1000,26678=>1000,26679=>1000,26680=>1000,26681=>1000,26682=>1000,26683=>1000,26684=>1000,26685=>1000,26686=>1000,26687=>1000,26688=>1000,26689=>1000,26690=>1000,26691=>1000,26692=>1000, - 26693=>1000,26694=>1000,26695=>1000,26696=>1000,26697=>1000,26698=>1000,26699=>1000,26700=>1000,26701=>1000,26702=>1000,26703=>1000,26704=>1000,26705=>1000,26706=>1000,26707=>1000,26708=>1000, - 26709=>1000,26710=>1000,26711=>1000,26712=>1000,26713=>1000,26714=>1000,26715=>1000,26716=>1000,26717=>1000,26718=>1000,26719=>1000,26720=>1000,26721=>1000,26722=>1000,26723=>1000,26724=>1000, - 26725=>1000,26726=>1000,26727=>1000,26728=>1000,26729=>1000,26730=>1000,26731=>1000,26732=>1000,26733=>1000,26734=>1000,26735=>1000,26736=>1000,26737=>1000,26738=>1000,26739=>1000,26740=>1000, - 26741=>1000,26742=>1000,26743=>1000,26744=>1000,26745=>1000,26746=>1000,26747=>1000,26748=>1000,26749=>1000,26750=>1000,26751=>1000,26752=>1000,26753=>1000,26754=>1000,26755=>1000,26756=>1000, - 26757=>1000,26758=>1000,26759=>1000,26760=>1000,26761=>1000,26762=>1000,26763=>1000,26764=>1000,26765=>1000,26766=>1000,26767=>1000,26768=>1000,26769=>1000,26770=>1000,26771=>1000,26772=>1000, - 26773=>1000,26774=>1000,26775=>1000,26776=>1000,26777=>1000,26778=>1000,26779=>1000,26780=>1000,26781=>1000,26782=>1000,26783=>1000,26784=>1000,26785=>1000,26786=>1000,26787=>1000,26788=>1000, - 26789=>1000,26790=>1000,26791=>1000,26792=>1000,26793=>1000,26794=>1000,26795=>1000,26796=>1000,26797=>1000,26798=>1000,26799=>1000,26800=>1000,26801=>1000,26802=>1000,26803=>1000,26804=>1000, - 26805=>1000,26806=>1000,26807=>1000,26808=>1000,26809=>1000,26810=>1000,26811=>1000,26812=>1000,26813=>1000,26814=>1000,26815=>1000,26816=>1000,26817=>1000,26818=>1000,26819=>1000,26820=>1000, - 26821=>1000,26822=>1000,26823=>1000,26824=>1000,26825=>1000,26826=>1000,26827=>1000,26828=>1000,26829=>1000,26830=>1000,26831=>1000,26832=>1000,26833=>1000,26834=>1000,26835=>1000,26836=>1000, - 26837=>1000,26838=>1000,26839=>1000,26840=>1000,26841=>1000,26842=>1000,26843=>1000,26844=>1000,26845=>1000,26846=>1000,26847=>1000,26848=>1000,26849=>1000,26850=>1000,26851=>1000,26852=>1000, - 26853=>1000,26854=>1000,26855=>1000,26856=>1000,26857=>1000,26858=>1000,26859=>1000,26860=>1000,26861=>1000,26862=>1000,26863=>1000,26864=>1000,26865=>1000,26866=>1000,26867=>1000,26868=>1000, - 26869=>1000,26870=>1000,26871=>1000,26872=>1000,26873=>1000,26874=>1000,26875=>1000,26876=>1000,26877=>1000,26878=>1000,26879=>1000,26880=>1000,26881=>1000,26882=>1000,26883=>1000,26884=>1000, - 26885=>1000,26886=>1000,26887=>1000,26888=>1000,26889=>1000,26890=>1000,26891=>1000,26892=>1000,26893=>1000,26894=>1000,26895=>1000,26896=>1000,26897=>1000,26898=>1000,26899=>1000,26900=>1000, - 26901=>1000,26902=>1000,26903=>1000,26904=>1000,26905=>1000,26906=>1000,26907=>1000,26908=>1000,26909=>1000,26910=>1000,26911=>1000,26912=>1000,26913=>1000,26914=>1000,26915=>1000,26916=>1000, - 26917=>1000,26918=>1000,26919=>1000,26920=>1000,26921=>1000,26922=>1000,26923=>1000,26924=>1000,26925=>1000,26926=>1000,26927=>1000,26928=>1000,26929=>1000,26930=>1000,26931=>1000,26932=>1000, - 26933=>1000,26934=>1000,26935=>1000,26936=>1000,26937=>1000,26938=>1000,26939=>1000,26940=>1000,26941=>1000,26942=>1000,26943=>1000,26944=>1000,26945=>1000,26946=>1000,26947=>1000,26948=>1000, - 26949=>1000,26950=>1000,26951=>1000,26952=>1000,26953=>1000,26954=>1000,26955=>1000,26956=>1000,26957=>1000,26958=>1000,26959=>1000,26960=>1000,26961=>1000,26962=>1000,26963=>1000,26964=>1000, - 26965=>1000,26966=>1000,26967=>1000,26968=>1000,26969=>1000,26970=>1000,26971=>1000,26972=>1000,26973=>1000,26974=>1000,26975=>1000,26976=>1000,26977=>1000,26978=>1000,26979=>1000,26980=>1000, - 26981=>1000,26982=>1000,26983=>1000,26984=>1000,26985=>1000,26986=>1000,26987=>1000,26988=>1000,26989=>1000,26990=>1000,26991=>1000,26992=>1000,26993=>1000,26994=>1000,26995=>1000,26996=>1000, - 26997=>1000,26998=>1000,26999=>1000,27000=>1000,27001=>1000,27002=>1000,27003=>1000,27004=>1000,27005=>1000,27006=>1000,27007=>1000,27008=>1000,27009=>1000,27010=>1000,27011=>1000,27012=>1000, - 27013=>1000,27014=>1000,27015=>1000,27016=>1000,27017=>1000,27018=>1000,27019=>1000,27020=>1000,27021=>1000,27022=>1000,27023=>1000,27024=>1000,27025=>1000,27026=>1000,27027=>1000,27028=>1000, - 27029=>1000,27030=>1000,27031=>1000,27032=>1000,27033=>1000,27034=>1000,27035=>1000,27036=>1000,27037=>1000,27038=>1000,27039=>1000,27040=>1000,27041=>1000,27042=>1000,27043=>1000,27044=>1000, - 27045=>1000,27046=>1000,27047=>1000,27048=>1000,27049=>1000,27050=>1000,27051=>1000,27052=>1000,27053=>1000,27054=>1000,27055=>1000,27056=>1000,27057=>1000,27058=>1000,27059=>1000,27060=>1000, - 27061=>1000,27062=>1000,27063=>1000,27064=>1000,27065=>1000,27066=>1000,27067=>1000,27068=>1000,27069=>1000,27070=>1000,27071=>1000,27072=>1000,27073=>1000,27074=>1000,27075=>1000,27076=>1000, - 27077=>1000,27078=>1000,27079=>1000,27080=>1000,27081=>1000,27082=>1000,27083=>1000,27084=>1000,27085=>1000,27086=>1000,27087=>1000,27088=>1000,27089=>1000,27090=>1000,27091=>1000,27092=>1000, - 27093=>1000,27094=>1000,27095=>1000,27096=>1000,27097=>1000,27098=>1000,27099=>1000,27100=>1000,27101=>1000,27102=>1000,27103=>1000,27104=>1000,27105=>1000,27106=>1000,27107=>1000,27108=>1000, - 27109=>1000,27110=>1000,27111=>1000,27112=>1000,27113=>1000,27114=>1000,27115=>1000,27116=>1000,27117=>1000,27118=>1000,27119=>1000,27120=>1000,27121=>1000,27122=>1000,27123=>1000,27124=>1000, - 27125=>1000,27126=>1000,27127=>1000,27128=>1000,27129=>1000,27130=>1000,27131=>1000,27132=>1000,27133=>1000,27134=>1000,27135=>1000,27136=>1000,27137=>1000,27138=>1000,27139=>1000,27140=>1000, - 27141=>1000,27142=>1000,27143=>1000,27144=>1000,27145=>1000,27146=>1000,27147=>1000,27148=>1000,27149=>1000,27150=>1000,27151=>1000,27152=>1000,27153=>1000,27154=>1000,27155=>1000,27156=>1000, - 27157=>1000,27158=>1000,27159=>1000,27160=>1000,27161=>1000,27162=>1000,27163=>1000,27164=>1000,27165=>1000,27166=>1000,27167=>1000,27168=>1000,27169=>1000,27170=>1000,27171=>1000,27172=>1000, - 27173=>1000,27174=>1000,27175=>1000,27176=>1000,27177=>1000,27178=>1000,27179=>1000,27180=>1000,27181=>1000,27182=>1000,27183=>1000,27184=>1000,27185=>1000,27186=>1000,27187=>1000,27188=>1000, - 27189=>1000,27190=>1000,27191=>1000,27192=>1000,27193=>1000,27194=>1000,27195=>1000,27196=>1000,27197=>1000,27198=>1000,27199=>1000,27200=>1000,27201=>1000,27202=>1000,27203=>1000,27204=>1000, - 27205=>1000,27206=>1000,27207=>1000,27208=>1000,27209=>1000,27210=>1000,27211=>1000,27212=>1000,27213=>1000,27214=>1000,27215=>1000,27216=>1000,27217=>1000,27218=>1000,27219=>1000,27220=>1000, - 27221=>1000,27222=>1000,27223=>1000,27224=>1000,27225=>1000,27226=>1000,27227=>1000,27228=>1000,27229=>1000,27230=>1000,27231=>1000,27232=>1000,27233=>1000,27234=>1000,27235=>1000,27236=>1000, - 27237=>1000,27238=>1000,27239=>1000,27240=>1000,27241=>1000,27242=>1000,27243=>1000,27244=>1000,27245=>1000,27246=>1000,27247=>1000,27248=>1000,27249=>1000,27250=>1000,27251=>1000,27252=>1000, - 27253=>1000,27254=>1000,27255=>1000,27256=>1000,27257=>1000,27258=>1000,27259=>1000,27260=>1000,27261=>1000,27262=>1000,27263=>1000,27264=>1000,27265=>1000,27266=>1000,27267=>1000,27268=>1000, - 27269=>1000,27270=>1000,27271=>1000,27272=>1000,27273=>1000,27274=>1000,27275=>1000,27276=>1000,27277=>1000,27278=>1000,27279=>1000,27280=>1000,27281=>1000,27282=>1000,27283=>1000,27284=>1000, - 27285=>1000,27286=>1000,27287=>1000,27288=>1000,27289=>1000,27290=>1000,27291=>1000,27292=>1000,27293=>1000,27294=>1000,27295=>1000,27296=>1000,27297=>1000,27298=>1000,27299=>1000,27300=>1000, - 27301=>1000,27302=>1000,27303=>1000,27304=>1000,27305=>1000,27306=>1000,27307=>1000,27308=>1000,27309=>1000,27310=>1000,27311=>1000,27312=>1000,27313=>1000,27314=>1000,27315=>1000,27316=>1000, - 27317=>1000,27318=>1000,27319=>1000,27320=>1000,27321=>1000,27322=>1000,27323=>1000,27324=>1000,27325=>1000,27326=>1000,27327=>1000,27328=>1000,27329=>1000,27330=>1000,27331=>1000,27332=>1000, - 27333=>1000,27334=>1000,27335=>1000,27336=>1000,27337=>1000,27338=>1000,27339=>1000,27340=>1000,27341=>1000,27342=>1000,27343=>1000,27344=>1000,27345=>1000,27346=>1000,27347=>1000,27348=>1000, - 27349=>1000,27350=>1000,27351=>1000,27352=>1000,27353=>1000,27354=>1000,27355=>1000,27356=>1000,27357=>1000,27358=>1000,27359=>1000,27360=>1000,27361=>1000,27362=>1000,27363=>1000,27364=>1000, - 27365=>1000,27366=>1000,27367=>1000,27368=>1000,27369=>1000,27370=>1000,27371=>1000,27372=>1000,27373=>1000,27374=>1000,27375=>1000,27376=>1000,27377=>1000,27378=>1000,27379=>1000,27380=>1000, - 27381=>1000,27382=>1000,27383=>1000,27384=>1000,27385=>1000,27386=>1000,27387=>1000,27388=>1000,27389=>1000,27390=>1000,27391=>1000,27392=>1000,27393=>1000,27394=>1000,27395=>1000,27396=>1000, - 27397=>1000,27398=>1000,27399=>1000,27400=>1000,27401=>1000,27402=>1000,27403=>1000,27404=>1000,27405=>1000,27406=>1000,27407=>1000,27408=>1000,27409=>1000,27410=>1000,27411=>1000,27412=>1000, - 27413=>1000,27414=>1000,27415=>1000,27416=>1000,27417=>1000,27418=>1000,27419=>1000,27420=>1000,27421=>1000,27422=>1000,27423=>1000,27424=>1000,27425=>1000,27426=>1000,27427=>1000,27428=>1000, - 27429=>1000,27430=>1000,27431=>1000,27432=>1000,27433=>1000,27434=>1000,27435=>1000,27436=>1000,27437=>1000,27438=>1000,27439=>1000,27440=>1000,27441=>1000,27442=>1000,27443=>1000,27444=>1000, - 27445=>1000,27446=>1000,27447=>1000,27448=>1000,27449=>1000,27450=>1000,27451=>1000,27452=>1000,27453=>1000,27454=>1000,27455=>1000,27456=>1000,27457=>1000,27458=>1000,27459=>1000,27460=>1000, - 27461=>1000,27462=>1000,27463=>1000,27464=>1000,27465=>1000,27466=>1000,27467=>1000,27468=>1000,27469=>1000,27470=>1000,27471=>1000,27472=>1000,27473=>1000,27474=>1000,27475=>1000,27476=>1000, - 27477=>1000,27478=>1000,27479=>1000,27480=>1000,27481=>1000,27482=>1000,27483=>1000,27484=>1000,27485=>1000,27486=>1000,27487=>1000,27488=>1000,27489=>1000,27490=>1000,27491=>1000,27492=>1000, - 27493=>1000,27494=>1000,27495=>1000,27496=>1000,27497=>1000,27498=>1000,27499=>1000,27500=>1000,27501=>1000,27502=>1000,27503=>1000,27504=>1000,27505=>1000,27506=>1000,27507=>1000,27508=>1000, - 27509=>1000,27510=>1000,27511=>1000,27512=>1000,27513=>1000,27514=>1000,27515=>1000,27516=>1000,27517=>1000,27518=>1000,27519=>1000,27520=>1000,27521=>1000,27522=>1000,27523=>1000,27524=>1000, - 27525=>1000,27526=>1000,27527=>1000,27528=>1000,27529=>1000,27530=>1000,27531=>1000,27532=>1000,27533=>1000,27534=>1000,27535=>1000,27536=>1000,27537=>1000,27538=>1000,27539=>1000,27540=>1000, - 27541=>1000,27542=>1000,27543=>1000,27544=>1000,27545=>1000,27546=>1000,27547=>1000,27548=>1000,27549=>1000,27550=>1000,27551=>1000,27552=>1000,27553=>1000,27554=>1000,27555=>1000,27556=>1000, - 27557=>1000,27558=>1000,27559=>1000,27560=>1000,27561=>1000,27562=>1000,27563=>1000,27564=>1000,27565=>1000,27566=>1000,27567=>1000,27568=>1000,27569=>1000,27570=>1000,27571=>1000,27572=>1000, - 27573=>1000,27574=>1000,27575=>1000,27576=>1000,27577=>1000,27578=>1000,27579=>1000,27580=>1000,27581=>1000,27582=>1000,27583=>1000,27584=>1000,27585=>1000,27586=>1000,27587=>1000,27588=>1000, - 27589=>1000,27590=>1000,27591=>1000,27592=>1000,27593=>1000,27594=>1000,27595=>1000,27596=>1000,27597=>1000,27598=>1000,27599=>1000,27600=>1000,27601=>1000,27602=>1000,27603=>1000,27604=>1000, - 27605=>1000,27606=>1000,27607=>1000,27608=>1000,27609=>1000,27610=>1000,27611=>1000,27612=>1000,27613=>1000,27614=>1000,27615=>1000,27616=>1000,27617=>1000,27618=>1000,27619=>1000,27620=>1000, - 27621=>1000,27622=>1000,27623=>1000,27624=>1000,27625=>1000,27626=>1000,27627=>1000,27628=>1000,27629=>1000,27630=>1000,27631=>1000,27632=>1000,27633=>1000,27634=>1000,27635=>1000,27636=>1000, - 27637=>1000,27638=>1000,27639=>1000,27640=>1000,27641=>1000,27642=>1000,27643=>1000,27644=>1000,27645=>1000,27646=>1000,27647=>1000,27648=>1000,27649=>1000,27650=>1000,27651=>1000,27652=>1000, - 27653=>1000,27654=>1000,27655=>1000,27656=>1000,27657=>1000,27658=>1000,27659=>1000,27660=>1000,27661=>1000,27662=>1000,27663=>1000,27664=>1000,27665=>1000,27666=>1000,27667=>1000,27668=>1000, - 27669=>1000,27670=>1000,27671=>1000,27672=>1000,27673=>1000,27674=>1000,27675=>1000,27676=>1000,27677=>1000,27678=>1000,27679=>1000,27680=>1000,27681=>1000,27682=>1000,27683=>1000,27684=>1000, - 27685=>1000,27686=>1000,27687=>1000,27688=>1000,27689=>1000,27690=>1000,27691=>1000,27692=>1000,27693=>1000,27694=>1000,27695=>1000,27696=>1000,27697=>1000,27698=>1000,27699=>1000,27700=>1000, - 27701=>1000,27702=>1000,27703=>1000,27704=>1000,27705=>1000,27706=>1000,27707=>1000,27708=>1000,27709=>1000,27710=>1000,27711=>1000,27712=>1000,27713=>1000,27714=>1000,27715=>1000,27716=>1000, - 27717=>1000,27718=>1000,27719=>1000,27720=>1000,27721=>1000,27722=>1000,27723=>1000,27724=>1000,27725=>1000,27726=>1000,27727=>1000,27728=>1000,27729=>1000,27730=>1000,27731=>1000,27732=>1000, - 27733=>1000,27734=>1000,27735=>1000,27736=>1000,27737=>1000,27738=>1000,27739=>1000,27740=>1000,27741=>1000,27742=>1000,27743=>1000,27744=>1000,27745=>1000,27746=>1000,27747=>1000,27748=>1000, - 27749=>1000,27750=>1000,27751=>1000,27752=>1000,27753=>1000,27754=>1000,27755=>1000,27756=>1000,27757=>1000,27758=>1000,27759=>1000,27760=>1000,27761=>1000,27762=>1000,27763=>1000,27764=>1000, - 27765=>1000,27766=>1000,27767=>1000,27768=>1000,27769=>1000,27770=>1000,27771=>1000,27772=>1000,27773=>1000,27774=>1000,27775=>1000,27776=>1000,27777=>1000,27778=>1000,27779=>1000,27780=>1000, - 27781=>1000,27782=>1000,27783=>1000,27784=>1000,27785=>1000,27786=>1000,27787=>1000,27788=>1000,27789=>1000,27790=>1000,27791=>1000,27792=>1000,27793=>1000,27794=>1000,27795=>1000,27796=>1000, - 27797=>1000,27798=>1000,27799=>1000,27800=>1000,27801=>1000,27802=>1000,27803=>1000,27804=>1000,27805=>1000,27806=>1000,27807=>1000,27808=>1000,27809=>1000,27810=>1000,27811=>1000,27812=>1000, - 27813=>1000,27814=>1000,27815=>1000,27816=>1000,27817=>1000,27818=>1000,27819=>1000,27820=>1000,27821=>1000,27822=>1000,27823=>1000,27824=>1000,27825=>1000,27826=>1000,27827=>1000,27828=>1000, - 27829=>1000,27830=>1000,27831=>1000,27832=>1000,27833=>1000,27834=>1000,27835=>1000,27836=>1000,27837=>1000,27838=>1000,27839=>1000,27840=>1000,27841=>1000,27842=>1000,27843=>1000,27844=>1000, - 27845=>1000,27846=>1000,27847=>1000,27848=>1000,27849=>1000,27850=>1000,27851=>1000,27852=>1000,27853=>1000,27854=>1000,27855=>1000,27856=>1000,27857=>1000,27858=>1000,27859=>1000,27860=>1000, - 27861=>1000,27862=>1000,27863=>1000,27864=>1000,27865=>1000,27866=>1000,27867=>1000,27868=>1000,27869=>1000,27870=>1000,27871=>1000,27872=>1000,27873=>1000,27874=>1000,27875=>1000,27876=>1000, - 27877=>1000,27878=>1000,27879=>1000,27880=>1000,27881=>1000,27882=>1000,27883=>1000,27884=>1000,27885=>1000,27886=>1000,27887=>1000,27888=>1000,27889=>1000,27890=>1000,27891=>1000,27892=>1000, - 27893=>1000,27894=>1000,27895=>1000,27896=>1000,27897=>1000,27898=>1000,27899=>1000,27900=>1000,27901=>1000,27902=>1000,27903=>1000,27904=>1000,27905=>1000,27906=>1000,27907=>1000,27908=>1000, - 27909=>1000,27910=>1000,27911=>1000,27912=>1000,27913=>1000,27914=>1000,27915=>1000,27916=>1000,27917=>1000,27918=>1000,27919=>1000,27920=>1000,27921=>1000,27922=>1000,27923=>1000,27924=>1000, - 27925=>1000,27926=>1000,27927=>1000,27928=>1000,27929=>1000,27930=>1000,27931=>1000,27932=>1000,27933=>1000,27934=>1000,27935=>1000,27936=>1000,27937=>1000,27938=>1000,27939=>1000,27940=>1000, - 27941=>1000,27942=>1000,27943=>1000,27944=>1000,27945=>1000,27946=>1000,27947=>1000,27948=>1000,27949=>1000,27950=>1000,27951=>1000,27952=>1000,27953=>1000,27954=>1000,27955=>1000,27956=>1000, - 27957=>1000,27958=>1000,27959=>1000,27960=>1000,27961=>1000,27962=>1000,27963=>1000,27964=>1000,27965=>1000,27966=>1000,27967=>1000,27968=>1000,27969=>1000,27970=>1000,27971=>1000,27972=>1000, - 27973=>1000,27974=>1000,27975=>1000,27976=>1000,27977=>1000,27978=>1000,27979=>1000,27980=>1000,27981=>1000,27982=>1000,27983=>1000,27984=>1000,27985=>1000,27986=>1000,27987=>1000,27988=>1000, - 27989=>1000,27990=>1000,27991=>1000,27992=>1000,27993=>1000,27994=>1000,27995=>1000,27996=>1000,27997=>1000,27998=>1000,27999=>1000,28000=>1000,28001=>1000,28002=>1000,28003=>1000,28004=>1000, - 28005=>1000,28006=>1000,28007=>1000,28008=>1000,28009=>1000,28010=>1000,28011=>1000,28012=>1000,28013=>1000,28014=>1000,28015=>1000,28016=>1000,28017=>1000,28018=>1000,28019=>1000,28020=>1000, - 28021=>1000,28022=>1000,28023=>1000,28024=>1000,28025=>1000,28026=>1000,28027=>1000,28028=>1000,28029=>1000,28030=>1000,28031=>1000,28032=>1000,28033=>1000,28034=>1000,28035=>1000,28036=>1000, - 28037=>1000,28038=>1000,28039=>1000,28040=>1000,28041=>1000,28042=>1000,28043=>1000,28044=>1000,28045=>1000,28046=>1000,28047=>1000,28048=>1000,28049=>1000,28050=>1000,28051=>1000,28052=>1000, - 28053=>1000,28054=>1000,28055=>1000,28056=>1000,28057=>1000,28058=>1000,28059=>1000,28060=>1000,28061=>1000,28062=>1000,28063=>1000,28064=>1000,28065=>1000,28066=>1000,28067=>1000,28068=>1000, - 28069=>1000,28070=>1000,28071=>1000,28072=>1000,28073=>1000,28074=>1000,28075=>1000,28076=>1000,28077=>1000,28078=>1000,28079=>1000,28080=>1000,28081=>1000,28082=>1000,28083=>1000,28084=>1000, - 28085=>1000,28086=>1000,28087=>1000,28088=>1000,28089=>1000,28090=>1000,28091=>1000,28092=>1000,28093=>1000,28094=>1000,28095=>1000,28096=>1000,28097=>1000,28098=>1000,28099=>1000,28100=>1000, - 28101=>1000,28102=>1000,28103=>1000,28104=>1000,28105=>1000,28106=>1000,28107=>1000,28108=>1000,28109=>1000,28110=>1000,28111=>1000,28112=>1000,28113=>1000,28114=>1000,28115=>1000,28116=>1000, - 28117=>1000,28118=>1000,28119=>1000,28120=>1000,28121=>1000,28122=>1000,28123=>1000,28124=>1000,28125=>1000,28126=>1000,28127=>1000,28128=>1000,28129=>1000,28130=>1000,28131=>1000,28132=>1000, - 28133=>1000,28134=>1000,28135=>1000,28136=>1000,28137=>1000,28138=>1000,28139=>1000,28140=>1000,28141=>1000,28142=>1000,28143=>1000,28144=>1000,28145=>1000,28146=>1000,28147=>1000,28148=>1000, - 28149=>1000,28150=>1000,28151=>1000,28152=>1000,28153=>1000,28154=>1000,28155=>1000,28156=>1000,28157=>1000,28158=>1000,28159=>1000,28160=>1000,28161=>1000,28162=>1000,28163=>1000,28164=>1000, - 28165=>1000,28166=>1000,28167=>1000,28168=>1000,28169=>1000,28170=>1000,28171=>1000,28172=>1000,28173=>1000,28174=>1000,28175=>1000,28176=>1000,28177=>1000,28178=>1000,28179=>1000,28180=>1000, - 28181=>1000,28182=>1000,28183=>1000,28184=>1000,28185=>1000,28186=>1000,28187=>1000,28188=>1000,28189=>1000,28190=>1000,28191=>1000,28192=>1000,28193=>1000,28194=>1000,28195=>1000,28196=>1000, - 28197=>1000,28198=>1000,28199=>1000,28200=>1000,28201=>1000,28202=>1000,28203=>1000,28204=>1000,28205=>1000,28206=>1000,28207=>1000,28208=>1000,28209=>1000,28210=>1000,28211=>1000,28212=>1000, - 28213=>1000,28214=>1000,28215=>1000,28216=>1000,28217=>1000,28218=>1000,28219=>1000,28220=>1000,28221=>1000,28222=>1000,28223=>1000,28224=>1000,28225=>1000,28226=>1000,28227=>1000,28228=>1000, - 28229=>1000,28230=>1000,28231=>1000,28232=>1000,28233=>1000,28234=>1000,28235=>1000,28236=>1000,28237=>1000,28238=>1000,28239=>1000,28240=>1000,28241=>1000,28242=>1000,28243=>1000,28244=>1000, - 28245=>1000,28246=>1000,28247=>1000,28248=>1000,28249=>1000,28250=>1000,28251=>1000,28252=>1000,28253=>1000,28254=>1000,28255=>1000,28256=>1000,28257=>1000,28258=>1000,28259=>1000,28260=>1000, - 28261=>1000,28262=>1000,28263=>1000,28264=>1000,28265=>1000,28266=>1000,28267=>1000,28268=>1000,28269=>1000,28270=>1000,28271=>1000,28272=>1000,28273=>1000,28274=>1000,28275=>1000,28276=>1000, - 28277=>1000,28278=>1000,28279=>1000,28280=>1000,28281=>1000,28282=>1000,28283=>1000,28284=>1000,28285=>1000,28286=>1000,28287=>1000,28288=>1000,28289=>1000,28290=>1000,28291=>1000,28292=>1000, - 28293=>1000,28294=>1000,28295=>1000,28296=>1000,28297=>1000,28298=>1000,28299=>1000,28300=>1000,28301=>1000,28302=>1000,28303=>1000,28304=>1000,28305=>1000,28306=>1000,28307=>1000,28308=>1000, - 28309=>1000,28310=>1000,28311=>1000,28312=>1000,28313=>1000,28314=>1000,28315=>1000,28316=>1000,28317=>1000,28318=>1000,28319=>1000,28320=>1000,28321=>1000,28322=>1000,28323=>1000,28324=>1000, - 28325=>1000,28326=>1000,28327=>1000,28328=>1000,28329=>1000,28330=>1000,28331=>1000,28332=>1000,28333=>1000,28334=>1000,28335=>1000,28336=>1000,28337=>1000,28338=>1000,28339=>1000,28340=>1000, - 28341=>1000,28342=>1000,28343=>1000,28344=>1000,28345=>1000,28346=>1000,28347=>1000,28348=>1000,28349=>1000,28350=>1000,28351=>1000,28352=>1000,28353=>1000,28354=>1000,28355=>1000,28356=>1000, - 28357=>1000,28358=>1000,28359=>1000,28360=>1000,28361=>1000,28362=>1000,28363=>1000,28364=>1000,28365=>1000,28366=>1000,28367=>1000,28368=>1000,28369=>1000,28370=>1000,28371=>1000,28372=>1000, - 28373=>1000,28374=>1000,28375=>1000,28376=>1000,28377=>1000,28378=>1000,28379=>1000,28380=>1000,28381=>1000,28382=>1000,28383=>1000,28384=>1000,28385=>1000,28386=>1000,28387=>1000,28388=>1000, - 28389=>1000,28390=>1000,28391=>1000,28392=>1000,28393=>1000,28394=>1000,28395=>1000,28396=>1000,28397=>1000,28398=>1000,28399=>1000,28400=>1000,28401=>1000,28402=>1000,28403=>1000,28404=>1000, - 28405=>1000,28406=>1000,28407=>1000,28408=>1000,28409=>1000,28410=>1000,28411=>1000,28412=>1000,28413=>1000,28414=>1000,28415=>1000,28416=>1000,28417=>1000,28418=>1000,28419=>1000,28420=>1000, - 28421=>1000,28422=>1000,28423=>1000,28424=>1000,28425=>1000,28426=>1000,28427=>1000,28428=>1000,28429=>1000,28430=>1000,28431=>1000,28432=>1000,28433=>1000,28434=>1000,28435=>1000,28436=>1000, - 28437=>1000,28438=>1000,28439=>1000,28440=>1000,28441=>1000,28442=>1000,28443=>1000,28444=>1000,28445=>1000,28446=>1000,28447=>1000,28448=>1000,28449=>1000,28450=>1000,28451=>1000,28452=>1000, - 28453=>1000,28454=>1000,28455=>1000,28456=>1000,28457=>1000,28458=>1000,28459=>1000,28460=>1000,28461=>1000,28462=>1000,28463=>1000,28464=>1000,28465=>1000,28466=>1000,28467=>1000,28468=>1000, - 28469=>1000,28470=>1000,28471=>1000,28472=>1000,28473=>1000,28474=>1000,28475=>1000,28476=>1000,28477=>1000,28478=>1000,28479=>1000,28480=>1000,28481=>1000,28482=>1000,28483=>1000,28484=>1000, - 28485=>1000,28486=>1000,28487=>1000,28488=>1000,28489=>1000,28490=>1000,28491=>1000,28492=>1000,28493=>1000,28494=>1000,28495=>1000,28496=>1000,28497=>1000,28498=>1000,28499=>1000,28500=>1000, - 28501=>1000,28502=>1000,28503=>1000,28504=>1000,28505=>1000,28506=>1000,28507=>1000,28508=>1000,28509=>1000,28510=>1000,28511=>1000,28512=>1000,28513=>1000,28514=>1000,28515=>1000,28516=>1000, - 28517=>1000,28518=>1000,28519=>1000,28520=>1000,28521=>1000,28522=>1000,28523=>1000,28524=>1000,28525=>1000,28526=>1000,28527=>1000,28528=>1000,28529=>1000,28530=>1000,28531=>1000,28532=>1000, - 28533=>1000,28534=>1000,28535=>1000,28536=>1000,28537=>1000,28538=>1000,28539=>1000,28540=>1000,28541=>1000,28542=>1000,28543=>1000,28544=>1000,28545=>1000,28546=>1000,28547=>1000,28548=>1000, - 28549=>1000,28550=>1000,28551=>1000,28552=>1000,28553=>1000,28554=>1000,28555=>1000,28556=>1000,28557=>1000,28558=>1000,28559=>1000,28560=>1000,28561=>1000,28562=>1000,28563=>1000,28564=>1000, - 28565=>1000,28566=>1000,28567=>1000,28568=>1000,28569=>1000,28570=>1000,28571=>1000,28572=>1000,28573=>1000,28574=>1000,28575=>1000,28576=>1000,28577=>1000,28578=>1000,28579=>1000,28580=>1000, - 28581=>1000,28582=>1000,28583=>1000,28584=>1000,28585=>1000,28586=>1000,28587=>1000,28588=>1000,28589=>1000,28590=>1000,28591=>1000,28592=>1000,28593=>1000,28594=>1000,28595=>1000,28596=>1000, - 28597=>1000,28598=>1000,28599=>1000,28600=>1000,28601=>1000,28602=>1000,28603=>1000,28604=>1000,28605=>1000,28606=>1000,28607=>1000,28608=>1000,28609=>1000,28610=>1000,28611=>1000,28612=>1000, - 28613=>1000,28614=>1000,28615=>1000,28616=>1000,28617=>1000,28618=>1000,28619=>1000,28620=>1000,28621=>1000,28622=>1000,28623=>1000,28624=>1000,28625=>1000,28626=>1000,28627=>1000,28628=>1000, - 28629=>1000,28630=>1000,28631=>1000,28632=>1000,28633=>1000,28634=>1000,28635=>1000,28636=>1000,28637=>1000,28638=>1000,28639=>1000,28640=>1000,28641=>1000,28642=>1000,28643=>1000,28644=>1000, - 28645=>1000,28646=>1000,28647=>1000,28648=>1000,28649=>1000,28650=>1000,28651=>1000,28652=>1000,28653=>1000,28654=>1000,28655=>1000,28656=>1000,28657=>1000,28658=>1000,28659=>1000,28660=>1000, - 28661=>1000,28662=>1000,28663=>1000,28664=>1000,28665=>1000,28666=>1000,28667=>1000,28668=>1000,28669=>1000,28670=>1000,28671=>1000,28672=>1000,28673=>1000,28674=>1000,28675=>1000,28676=>1000, - 28677=>1000,28678=>1000,28679=>1000,28680=>1000,28681=>1000,28682=>1000,28683=>1000,28684=>1000,28685=>1000,28686=>1000,28687=>1000,28688=>1000,28689=>1000,28690=>1000,28691=>1000,28692=>1000, - 28693=>1000,28694=>1000,28695=>1000,28696=>1000,28697=>1000,28698=>1000,28699=>1000,28700=>1000,28701=>1000,28702=>1000,28703=>1000,28704=>1000,28705=>1000,28706=>1000,28707=>1000,28708=>1000, - 28709=>1000,28710=>1000,28711=>1000,28712=>1000,28713=>1000,28714=>1000,28715=>1000,28716=>1000,28717=>1000,28718=>1000,28719=>1000,28720=>1000,28721=>1000,28722=>1000,28723=>1000,28724=>1000, - 28725=>1000,28726=>1000,28727=>1000,28728=>1000,28729=>1000,28730=>1000,28731=>1000,28732=>1000,28733=>1000,28734=>1000,28735=>1000,28736=>1000,28737=>1000,28738=>1000,28739=>1000,28740=>1000, - 28741=>1000,28742=>1000,28743=>1000,28744=>1000,28745=>1000,28746=>1000,28747=>1000,28748=>1000,28749=>1000,28750=>1000,28751=>1000,28752=>1000,28753=>1000,28754=>1000,28755=>1000,28756=>1000, - 28757=>1000,28758=>1000,28759=>1000,28760=>1000,28761=>1000,28762=>1000,28763=>1000,28764=>1000,28765=>1000,28766=>1000,28767=>1000,28768=>1000,28769=>1000,28770=>1000,28771=>1000,28772=>1000, - 28773=>1000,28774=>1000,28775=>1000,28776=>1000,28777=>1000,28778=>1000,28779=>1000,28780=>1000,28781=>1000,28782=>1000,28783=>1000,28784=>1000,28785=>1000,28786=>1000,28787=>1000,28788=>1000, - 28789=>1000,28790=>1000,28791=>1000,28792=>1000,28793=>1000,28794=>1000,28795=>1000,28796=>1000,28797=>1000,28798=>1000,28799=>1000,28800=>1000,28801=>1000,28802=>1000,28803=>1000,28804=>1000, - 28805=>1000,28806=>1000,28807=>1000,28808=>1000,28809=>1000,28810=>1000,28811=>1000,28812=>1000,28813=>1000,28814=>1000,28815=>1000,28816=>1000,28817=>1000,28818=>1000,28819=>1000,28820=>1000, - 28821=>1000,28822=>1000,28823=>1000,28824=>1000,28825=>1000,28826=>1000,28827=>1000,28828=>1000,28829=>1000,28830=>1000,28831=>1000,28832=>1000,28833=>1000,28834=>1000,28835=>1000,28836=>1000, - 28837=>1000,28838=>1000,28839=>1000,28840=>1000,28841=>1000,28842=>1000,28843=>1000,28844=>1000,28845=>1000,28846=>1000,28847=>1000,28848=>1000,28849=>1000,28850=>1000,28851=>1000,28852=>1000, - 28853=>1000,28854=>1000,28855=>1000,28856=>1000,28857=>1000,28858=>1000,28859=>1000,28860=>1000,28861=>1000,28862=>1000,28863=>1000,28864=>1000,28865=>1000,28866=>1000,28867=>1000,28868=>1000, - 28869=>1000,28870=>1000,28871=>1000,28872=>1000,28873=>1000,28874=>1000,28875=>1000,28876=>1000,28877=>1000,28878=>1000,28879=>1000,28880=>1000,28881=>1000,28882=>1000,28883=>1000,28884=>1000, - 28885=>1000,28886=>1000,28887=>1000,28888=>1000,28889=>1000,28890=>1000,28891=>1000,28892=>1000,28893=>1000,28894=>1000,28895=>1000,28896=>1000,28897=>1000,28898=>1000,28899=>1000,28900=>1000, - 28901=>1000,28902=>1000,28903=>1000,28904=>1000,28905=>1000,28906=>1000,28907=>1000,28908=>1000,28909=>1000,28910=>1000,28911=>1000,28912=>1000,28913=>1000,28914=>1000,28915=>1000,28916=>1000, - 28917=>1000,28918=>1000,28919=>1000,28920=>1000,28921=>1000,28922=>1000,28923=>1000,28924=>1000,28925=>1000,28926=>1000,28927=>1000,28928=>1000,28929=>1000,28930=>1000,28931=>1000,28932=>1000, - 28933=>1000,28934=>1000,28935=>1000,28936=>1000,28937=>1000,28938=>1000,28939=>1000,28940=>1000,28941=>1000,28942=>1000,28943=>1000,28944=>1000,28945=>1000,28946=>1000,28947=>1000,28948=>1000, - 28949=>1000,28950=>1000,28951=>1000,28952=>1000,28953=>1000,28954=>1000,28955=>1000,28956=>1000,28957=>1000,28958=>1000,28959=>1000,28960=>1000,28961=>1000,28962=>1000,28963=>1000,28964=>1000, - 28965=>1000,28966=>1000,28967=>1000,28968=>1000,28969=>1000,28970=>1000,28971=>1000,28972=>1000,28973=>1000,28974=>1000,28975=>1000,28976=>1000,28977=>1000,28978=>1000,28979=>1000,28980=>1000, - 28981=>1000,28982=>1000,28983=>1000,28984=>1000,28985=>1000,28986=>1000,28987=>1000,28988=>1000,28989=>1000,28990=>1000,28991=>1000,28992=>1000,28993=>1000,28994=>1000,28995=>1000,28996=>1000, - 28997=>1000,28998=>1000,28999=>1000,29000=>1000,29001=>1000,29002=>1000,29003=>1000,29004=>1000,29005=>1000,29006=>1000,29007=>1000,29008=>1000,29009=>1000,29010=>1000,29011=>1000,29012=>1000, - 29013=>1000,29014=>1000,29015=>1000,29016=>1000,29017=>1000,29018=>1000,29019=>1000,29020=>1000,29021=>1000,29022=>1000,29023=>1000,29024=>1000,29025=>1000,29026=>1000,29027=>1000,29028=>1000, - 29029=>1000,29030=>1000,29031=>1000,29032=>1000,29033=>1000,29034=>1000,29035=>1000,29036=>1000,29037=>1000,29038=>1000,29039=>1000,29040=>1000,29041=>1000,29042=>1000,29043=>1000,29044=>1000, - 29045=>1000,29046=>1000,29047=>1000,29048=>1000,29049=>1000,29050=>1000,29051=>1000,29052=>1000,29053=>1000,29054=>1000,29055=>1000,29056=>1000,29057=>1000,29058=>1000,29059=>1000,29060=>1000, - 29061=>1000,29062=>1000,29063=>1000,29064=>1000,29065=>1000,29066=>1000,29067=>1000,29068=>1000,29069=>1000,29070=>1000,29071=>1000,29072=>1000,29073=>1000,29074=>1000,29075=>1000,29076=>1000, - 29077=>1000,29078=>1000,29079=>1000,29080=>1000,29081=>1000,29082=>1000,29083=>1000,29084=>1000,29085=>1000,29086=>1000,29087=>1000,29088=>1000,29089=>1000,29090=>1000,29091=>1000,29092=>1000, - 29093=>1000,29094=>1000,29095=>1000,29096=>1000,29097=>1000,29098=>1000,29099=>1000,29100=>1000,29101=>1000,29102=>1000,29103=>1000,29104=>1000,29105=>1000,29106=>1000,29107=>1000,29108=>1000, - 29109=>1000,29110=>1000,29111=>1000,29112=>1000,29113=>1000,29114=>1000,29115=>1000,29116=>1000,29117=>1000,29118=>1000,29119=>1000,29120=>1000,29121=>1000,29122=>1000,29123=>1000,29124=>1000, - 29125=>1000,29126=>1000,29127=>1000,29128=>1000,29129=>1000,29130=>1000,29131=>1000,29132=>1000,29133=>1000,29134=>1000,29135=>1000,29136=>1000,29137=>1000,29138=>1000,29139=>1000,29140=>1000, - 29141=>1000,29142=>1000,29143=>1000,29144=>1000,29145=>1000,29146=>1000,29147=>1000,29148=>1000,29149=>1000,29150=>1000,29151=>1000,29152=>1000,29153=>1000,29154=>1000,29155=>1000,29156=>1000, - 29157=>1000,29158=>1000,29159=>1000,29160=>1000,29161=>1000,29162=>1000,29163=>1000,29164=>1000,29165=>1000,29166=>1000,29167=>1000,29168=>1000,29169=>1000,29170=>1000,29171=>1000,29172=>1000, - 29173=>1000,29174=>1000,29175=>1000,29176=>1000,29177=>1000,29178=>1000,29179=>1000,29180=>1000,29181=>1000,29182=>1000,29183=>1000,29184=>1000,29185=>1000,29186=>1000,29187=>1000,29188=>1000, - 29189=>1000,29190=>1000,29191=>1000,29192=>1000,29193=>1000,29194=>1000,29195=>1000,29196=>1000,29197=>1000,29198=>1000,29199=>1000,29200=>1000,29201=>1000,29202=>1000,29203=>1000,29204=>1000, - 29205=>1000,29206=>1000,29207=>1000,29208=>1000,29209=>1000,29210=>1000,29211=>1000,29212=>1000,29213=>1000,29214=>1000,29215=>1000,29216=>1000,29217=>1000,29218=>1000,29219=>1000,29220=>1000, - 29221=>1000,29222=>1000,29223=>1000,29224=>1000,29225=>1000,29226=>1000,29227=>1000,29228=>1000,29229=>1000,29230=>1000,29231=>1000,29232=>1000,29233=>1000,29234=>1000,29235=>1000,29236=>1000, - 29237=>1000,29238=>1000,29239=>1000,29240=>1000,29241=>1000,29242=>1000,29243=>1000,29244=>1000,29245=>1000,29246=>1000,29247=>1000,29248=>1000,29249=>1000,29250=>1000,29251=>1000,29252=>1000, - 29253=>1000,29254=>1000,29255=>1000,29256=>1000,29257=>1000,29258=>1000,29259=>1000,29260=>1000,29261=>1000,29262=>1000,29263=>1000,29264=>1000,29265=>1000,29266=>1000,29267=>1000,29268=>1000, - 29269=>1000,29270=>1000,29271=>1000,29272=>1000,29273=>1000,29274=>1000,29275=>1000,29276=>1000,29277=>1000,29278=>1000,29279=>1000,29280=>1000,29281=>1000,29282=>1000,29283=>1000,29284=>1000, - 29285=>1000,29286=>1000,29287=>1000,29288=>1000,29289=>1000,29290=>1000,29291=>1000,29292=>1000,29293=>1000,29294=>1000,29295=>1000,29296=>1000,29297=>1000,29298=>1000,29299=>1000,29300=>1000, - 29301=>1000,29302=>1000,29303=>1000,29304=>1000,29305=>1000,29306=>1000,29307=>1000,29308=>1000,29309=>1000,29310=>1000,29311=>1000,29312=>1000,29313=>1000,29314=>1000,29315=>1000,29316=>1000, - 29317=>1000,29318=>1000,29319=>1000,29320=>1000,29321=>1000,29322=>1000,29323=>1000,29324=>1000,29325=>1000,29326=>1000,29327=>1000,29328=>1000,29329=>1000,29330=>1000,29331=>1000,29332=>1000, - 29333=>1000,29334=>1000,29335=>1000,29336=>1000,29337=>1000,29338=>1000,29339=>1000,29340=>1000,29341=>1000,29342=>1000,29343=>1000,29344=>1000,29345=>1000,29346=>1000,29347=>1000,29348=>1000, - 29349=>1000,29350=>1000,29351=>1000,29352=>1000,29353=>1000,29354=>1000,29355=>1000,29356=>1000,29357=>1000,29358=>1000,29359=>1000,29360=>1000,29361=>1000,29362=>1000,29363=>1000,29364=>1000, - 29365=>1000,29366=>1000,29367=>1000,29368=>1000,29369=>1000,29370=>1000,29371=>1000,29372=>1000,29373=>1000,29374=>1000,29375=>1000,29376=>1000,29377=>1000,29378=>1000,29379=>1000,29380=>1000, - 29381=>1000,29382=>1000,29383=>1000,29384=>1000,29385=>1000,29386=>1000,29387=>1000,29388=>1000,29389=>1000,29390=>1000,29391=>1000,29392=>1000,29393=>1000,29394=>1000,29395=>1000,29396=>1000, - 29397=>1000,29398=>1000,29399=>1000,29400=>1000,29401=>1000,29402=>1000,29403=>1000,29404=>1000,29405=>1000,29406=>1000,29407=>1000,29408=>1000,29409=>1000,29410=>1000,29411=>1000,29412=>1000, - 29413=>1000,29414=>1000,29415=>1000,29416=>1000,29417=>1000,29418=>1000,29419=>1000,29420=>1000,29421=>1000,29422=>1000,29423=>1000,29424=>1000,29425=>1000,29426=>1000,29427=>1000,29428=>1000, - 29429=>1000,29430=>1000,29431=>1000,29432=>1000,29433=>1000,29434=>1000,29435=>1000,29436=>1000,29437=>1000,29438=>1000,29439=>1000,29440=>1000,29441=>1000,29442=>1000,29443=>1000,29444=>1000, - 29445=>1000,29446=>1000,29447=>1000,29448=>1000,29449=>1000,29450=>1000,29451=>1000,29452=>1000,29453=>1000,29454=>1000,29455=>1000,29456=>1000,29457=>1000,29458=>1000,29459=>1000,29460=>1000, - 29461=>1000,29462=>1000,29463=>1000,29464=>1000,29465=>1000,29466=>1000,29467=>1000,29468=>1000,29469=>1000,29470=>1000,29471=>1000,29472=>1000,29473=>1000,29474=>1000,29475=>1000,29476=>1000, - 29477=>1000,29478=>1000,29479=>1000,29480=>1000,29481=>1000,29482=>1000,29483=>1000,29484=>1000,29485=>1000,29486=>1000,29487=>1000,29488=>1000,29489=>1000,29490=>1000,29491=>1000,29492=>1000, - 29493=>1000,29494=>1000,29495=>1000,29496=>1000,29497=>1000,29498=>1000,29499=>1000,29500=>1000,29501=>1000,29502=>1000,29503=>1000,29504=>1000,29505=>1000,29506=>1000,29507=>1000,29508=>1000, - 29509=>1000,29510=>1000,29511=>1000,29512=>1000,29513=>1000,29514=>1000,29515=>1000,29516=>1000,29517=>1000,29518=>1000,29519=>1000,29520=>1000,29521=>1000,29522=>1000,29523=>1000,29524=>1000, - 29525=>1000,29526=>1000,29527=>1000,29528=>1000,29529=>1000,29530=>1000,29531=>1000,29532=>1000,29533=>1000,29534=>1000,29535=>1000,29536=>1000,29537=>1000,29538=>1000,29539=>1000,29540=>1000, - 29541=>1000,29542=>1000,29543=>1000,29544=>1000,29545=>1000,29546=>1000,29547=>1000,29548=>1000,29549=>1000,29550=>1000,29551=>1000,29552=>1000,29553=>1000,29554=>1000,29555=>1000,29556=>1000, - 29557=>1000,29558=>1000,29559=>1000,29560=>1000,29561=>1000,29562=>1000,29563=>1000,29564=>1000,29565=>1000,29566=>1000,29567=>1000,29568=>1000,29569=>1000,29570=>1000,29571=>1000,29572=>1000, - 29573=>1000,29574=>1000,29575=>1000,29576=>1000,29577=>1000,29578=>1000,29579=>1000,29580=>1000,29581=>1000,29582=>1000,29583=>1000,29584=>1000,29585=>1000,29586=>1000,29587=>1000,29588=>1000, - 29589=>1000,29590=>1000,29591=>1000,29592=>1000,29593=>1000,29594=>1000,29595=>1000,29596=>1000,29597=>1000,29598=>1000,29599=>1000,29600=>1000,29601=>1000,29602=>1000,29603=>1000,29604=>1000, - 29605=>1000,29606=>1000,29607=>1000,29608=>1000,29609=>1000,29610=>1000,29611=>1000,29612=>1000,29613=>1000,29614=>1000,29615=>1000,29616=>1000,29617=>1000,29618=>1000,29619=>1000,29620=>1000, - 29621=>1000,29622=>1000,29623=>1000,29624=>1000,29625=>1000,29626=>1000,29627=>1000,29628=>1000,29629=>1000,29630=>1000,29631=>1000,29632=>1000,29633=>1000,29634=>1000,29635=>1000,29636=>1000, - 29637=>1000,29638=>1000,29639=>1000,29640=>1000,29641=>1000,29642=>1000,29643=>1000,29644=>1000,29645=>1000,29646=>1000,29647=>1000,29648=>1000,29649=>1000,29650=>1000,29651=>1000,29652=>1000, - 29653=>1000,29654=>1000,29655=>1000,29656=>1000,29657=>1000,29658=>1000,29659=>1000,29660=>1000,29661=>1000,29662=>1000,29663=>1000,29664=>1000,29665=>1000,29666=>1000,29667=>1000,29668=>1000, - 29669=>1000,29670=>1000,29671=>1000,29672=>1000,29673=>1000,29674=>1000,29675=>1000,29676=>1000,29677=>1000,29678=>1000,29679=>1000,29680=>1000,29681=>1000,29682=>1000,29683=>1000,29684=>1000, - 29685=>1000,29686=>1000,29687=>1000,29688=>1000,29689=>1000,29690=>1000,29691=>1000,29692=>1000,29693=>1000,29694=>1000,29695=>1000,29696=>1000,29697=>1000,29698=>1000,29699=>1000,29700=>1000, - 29701=>1000,29702=>1000,29703=>1000,29704=>1000,29705=>1000,29706=>1000,29707=>1000,29708=>1000,29709=>1000,29710=>1000,29711=>1000,29712=>1000,29713=>1000,29714=>1000,29715=>1000,29716=>1000, - 29717=>1000,29718=>1000,29719=>1000,29720=>1000,29721=>1000,29722=>1000,29723=>1000,29724=>1000,29725=>1000,29726=>1000,29727=>1000,29728=>1000,29729=>1000,29730=>1000,29731=>1000,29732=>1000, - 29733=>1000,29734=>1000,29735=>1000,29736=>1000,29737=>1000,29738=>1000,29739=>1000,29740=>1000,29741=>1000,29742=>1000,29743=>1000,29744=>1000,29745=>1000,29746=>1000,29747=>1000,29748=>1000, - 29749=>1000,29750=>1000,29751=>1000,29752=>1000,29753=>1000,29754=>1000,29755=>1000,29756=>1000,29757=>1000,29758=>1000,29759=>1000,29760=>1000,29761=>1000,29762=>1000,29763=>1000,29764=>1000, - 29765=>1000,29766=>1000,29767=>1000,29768=>1000,29769=>1000,29770=>1000,29771=>1000,29772=>1000,29773=>1000,29774=>1000,29775=>1000,29776=>1000,29777=>1000,29778=>1000,29779=>1000,29780=>1000, - 29781=>1000,29782=>1000,29783=>1000,29784=>1000,29785=>1000,29786=>1000,29787=>1000,29788=>1000,29789=>1000,29790=>1000,29791=>1000,29792=>1000,29793=>1000,29794=>1000,29795=>1000,29796=>1000, - 29797=>1000,29798=>1000,29799=>1000,29800=>1000,29801=>1000,29802=>1000,29803=>1000,29804=>1000,29805=>1000,29806=>1000,29807=>1000,29808=>1000,29809=>1000,29810=>1000,29811=>1000,29812=>1000, - 29813=>1000,29814=>1000,29815=>1000,29816=>1000,29817=>1000,29818=>1000,29819=>1000,29820=>1000,29821=>1000,29822=>1000,29823=>1000,29824=>1000,29825=>1000,29826=>1000,29827=>1000,29828=>1000, - 29829=>1000,29830=>1000,29831=>1000,29832=>1000,29833=>1000,29834=>1000,29835=>1000,29836=>1000,29837=>1000,29838=>1000,29839=>1000,29840=>1000,29841=>1000,29842=>1000,29843=>1000,29844=>1000, - 29845=>1000,29846=>1000,29847=>1000,29848=>1000,29849=>1000,29850=>1000,29851=>1000,29852=>1000,29853=>1000,29854=>1000,29855=>1000,29856=>1000,29857=>1000,29858=>1000,29859=>1000,29860=>1000, - 29861=>1000,29862=>1000,29863=>1000,29864=>1000,29865=>1000,29866=>1000,29867=>1000,29868=>1000,29869=>1000,29870=>1000,29871=>1000,29872=>1000,29873=>1000,29874=>1000,29875=>1000,29876=>1000, - 29877=>1000,29878=>1000,29879=>1000,29880=>1000,29881=>1000,29882=>1000,29883=>1000,29884=>1000,29885=>1000,29886=>1000,29887=>1000,29888=>1000,29889=>1000,29890=>1000,29891=>1000,29892=>1000, - 29893=>1000,29894=>1000,29895=>1000,29896=>1000,29897=>1000,29898=>1000,29899=>1000,29900=>1000,29901=>1000,29902=>1000,29903=>1000,29904=>1000,29905=>1000,29906=>1000,29907=>1000,29908=>1000, - 29909=>1000,29910=>1000,29911=>1000,29912=>1000,29913=>1000,29914=>1000,29915=>1000,29916=>1000,29917=>1000,29918=>1000,29919=>1000,29920=>1000,29921=>1000,29922=>1000,29923=>1000,29924=>1000, - 29925=>1000,29926=>1000,29927=>1000,29928=>1000,29929=>1000,29930=>1000,29931=>1000,29932=>1000,29933=>1000,29934=>1000,29935=>1000,29936=>1000,29937=>1000,29938=>1000,29939=>1000,29940=>1000, - 29941=>1000,29942=>1000,29943=>1000,29944=>1000,29945=>1000,29946=>1000,29947=>1000,29948=>1000,29949=>1000,29950=>1000,29951=>1000,29952=>1000,29953=>1000,29954=>1000,29955=>1000,29956=>1000, - 29957=>1000,29958=>1000,29959=>1000,29960=>1000,29961=>1000,29962=>1000,29963=>1000,29964=>1000,29965=>1000,29966=>1000,29967=>1000,29968=>1000,29969=>1000,29970=>1000,29971=>1000,29972=>1000, - 29973=>1000,29974=>1000,29975=>1000,29976=>1000,29977=>1000,29978=>1000,29979=>1000,29980=>1000,29981=>1000,29982=>1000,29983=>1000,29984=>1000,29985=>1000,29986=>1000,29987=>1000,29988=>1000, - 29989=>1000,29990=>1000,29991=>1000,29992=>1000,29993=>1000,29994=>1000,29995=>1000,29996=>1000,29997=>1000,29998=>1000,29999=>1000,30000=>1000,30001=>1000,30002=>1000,30003=>1000,30004=>1000, - 30005=>1000,30006=>1000,30007=>1000,30008=>1000,30009=>1000,30010=>1000,30011=>1000,30012=>1000,30013=>1000,30014=>1000,30015=>1000,30016=>1000,30017=>1000,30018=>1000,30019=>1000,30020=>1000, - 30021=>1000,30022=>1000,30023=>1000,30024=>1000,30025=>1000,30026=>1000,30027=>1000,30028=>1000,30029=>1000,30030=>1000,30031=>1000,30032=>1000,30033=>1000,30034=>1000,30035=>1000,30036=>1000, - 30037=>1000,30038=>1000,30039=>1000,30040=>1000,30041=>1000,30042=>1000,30043=>1000,30044=>1000,30045=>1000,30046=>1000,30047=>1000,30048=>1000,30049=>1000,30050=>1000,30051=>1000,30052=>1000, - 30053=>1000,30054=>1000,30055=>1000,30056=>1000,30057=>1000,30058=>1000,30059=>1000,30060=>1000,30061=>1000,30062=>1000,30063=>1000,30064=>1000,30065=>1000,30066=>1000,30067=>1000,30068=>1000, - 30069=>1000,30070=>1000,30071=>1000,30072=>1000,30073=>1000,30074=>1000,30075=>1000,30076=>1000,30077=>1000,30078=>1000,30079=>1000,30080=>1000,30081=>1000,30082=>1000,30083=>1000,30084=>1000, - 30085=>1000,30086=>1000,30087=>1000,30088=>1000,30089=>1000,30090=>1000,30091=>1000,30092=>1000,30093=>1000,30094=>1000,30095=>1000,30096=>1000,30097=>1000,30098=>1000,30099=>1000,30100=>1000, - 30101=>1000,30102=>1000,30103=>1000,30104=>1000,30105=>1000,30106=>1000,30107=>1000,30108=>1000,30109=>1000,30110=>1000,30111=>1000,30112=>1000,30113=>1000,30114=>1000,30115=>1000,30116=>1000, - 30117=>1000,30118=>1000,30119=>1000,30120=>1000,30121=>1000,30122=>1000,30123=>1000,30124=>1000,30125=>1000,30126=>1000,30127=>1000,30128=>1000,30129=>1000,30130=>1000,30131=>1000,30132=>1000, - 30133=>1000,30134=>1000,30135=>1000,30136=>1000,30137=>1000,30138=>1000,30139=>1000,30140=>1000,30141=>1000,30142=>1000,30143=>1000,30144=>1000,30145=>1000,30146=>1000,30147=>1000,30148=>1000, - 30149=>1000,30150=>1000,30151=>1000,30152=>1000,30153=>1000,30154=>1000,30155=>1000,30156=>1000,30157=>1000,30158=>1000,30159=>1000,30160=>1000,30161=>1000,30162=>1000,30163=>1000,30164=>1000, - 30165=>1000,30166=>1000,30167=>1000,30168=>1000,30169=>1000,30170=>1000,30171=>1000,30172=>1000,30173=>1000,30174=>1000,30175=>1000,30176=>1000,30177=>1000,30178=>1000,30179=>1000,30180=>1000, - 30181=>1000,30182=>1000,30183=>1000,30184=>1000,30185=>1000,30186=>1000,30187=>1000,30188=>1000,30189=>1000,30190=>1000,30191=>1000,30192=>1000,30193=>1000,30194=>1000,30195=>1000,30196=>1000, - 30197=>1000,30198=>1000,30199=>1000,30200=>1000,30201=>1000,30202=>1000,30203=>1000,30204=>1000,30205=>1000,30206=>1000,30207=>1000,30208=>1000,30209=>1000,30210=>1000,30211=>1000,30212=>1000, - 30213=>1000,30214=>1000,30215=>1000,30216=>1000,30217=>1000,30218=>1000,30219=>1000,30220=>1000,30221=>1000,30222=>1000,30223=>1000,30224=>1000,30225=>1000,30226=>1000,30227=>1000,30228=>1000, - 30229=>1000,30230=>1000,30231=>1000,30232=>1000,30233=>1000,30234=>1000,30235=>1000,30236=>1000,30237=>1000,30238=>1000,30239=>1000,30240=>1000,30241=>1000,30242=>1000,30243=>1000,30244=>1000, - 30245=>1000,30246=>1000,30247=>1000,30248=>1000,30249=>1000,30250=>1000,30251=>1000,30252=>1000,30253=>1000,30254=>1000,30255=>1000,30256=>1000,30257=>1000,30258=>1000,30259=>1000,30260=>1000, - 30261=>1000,30262=>1000,30263=>1000,30264=>1000,30265=>1000,30266=>1000,30267=>1000,30268=>1000,30269=>1000,30270=>1000,30271=>1000,30272=>1000,30273=>1000,30274=>1000,30275=>1000,30276=>1000, - 30277=>1000,30278=>1000,30279=>1000,30280=>1000,30281=>1000,30282=>1000,30283=>1000,30284=>1000,30285=>1000,30286=>1000,30287=>1000,30288=>1000,30289=>1000,30290=>1000,30291=>1000,30292=>1000, - 30293=>1000,30294=>1000,30295=>1000,30296=>1000,30297=>1000,30298=>1000,30299=>1000,30300=>1000,30301=>1000,30302=>1000,30303=>1000,30304=>1000,30305=>1000,30306=>1000,30307=>1000,30308=>1000, - 30309=>1000,30310=>1000,30311=>1000,30312=>1000,30313=>1000,30314=>1000,30315=>1000,30316=>1000,30317=>1000,30318=>1000,30319=>1000,30320=>1000,30321=>1000,30322=>1000,30323=>1000,30324=>1000, - 30325=>1000,30326=>1000,30327=>1000,30328=>1000,30329=>1000,30330=>1000,30331=>1000,30332=>1000,30333=>1000,30334=>1000,30335=>1000,30336=>1000,30337=>1000,30338=>1000,30339=>1000,30340=>1000, - 30341=>1000,30342=>1000,30343=>1000,30344=>1000,30345=>1000,30346=>1000,30347=>1000,30348=>1000,30349=>1000,30350=>1000,30351=>1000,30352=>1000,30353=>1000,30354=>1000,30355=>1000,30356=>1000, - 30357=>1000,30358=>1000,30359=>1000,30360=>1000,30361=>1000,30362=>1000,30363=>1000,30364=>1000,30365=>1000,30366=>1000,30367=>1000,30368=>1000,30369=>1000,30370=>1000,30371=>1000,30372=>1000, - 30373=>1000,30374=>1000,30375=>1000,30376=>1000,30377=>1000,30378=>1000,30379=>1000,30380=>1000,30381=>1000,30382=>1000,30383=>1000,30384=>1000,30385=>1000,30386=>1000,30387=>1000,30388=>1000, - 30389=>1000,30390=>1000,30391=>1000,30392=>1000,30393=>1000,30394=>1000,30395=>1000,30396=>1000,30397=>1000,30398=>1000,30399=>1000,30400=>1000,30401=>1000,30402=>1000,30403=>1000,30404=>1000, - 30405=>1000,30406=>1000,30407=>1000,30408=>1000,30409=>1000,30410=>1000,30411=>1000,30412=>1000,30413=>1000,30414=>1000,30415=>1000,30416=>1000,30417=>1000,30418=>1000,30419=>1000,30420=>1000, - 30421=>1000,30422=>1000,30423=>1000,30424=>1000,30425=>1000,30426=>1000,30427=>1000,30428=>1000,30429=>1000,30430=>1000,30431=>1000,30432=>1000,30433=>1000,30434=>1000,30435=>1000,30436=>1000, - 30437=>1000,30438=>1000,30439=>1000,30440=>1000,30441=>1000,30442=>1000,30443=>1000,30444=>1000,30445=>1000,30446=>1000,30447=>1000,30448=>1000,30449=>1000,30450=>1000,30451=>1000,30452=>1000, - 30453=>1000,30454=>1000,30455=>1000,30456=>1000,30457=>1000,30458=>1000,30459=>1000,30460=>1000,30461=>1000,30462=>1000,30463=>1000,30464=>1000,30465=>1000,30466=>1000,30467=>1000,30468=>1000, - 30469=>1000,30470=>1000,30471=>1000,30472=>1000,30473=>1000,30474=>1000,30475=>1000,30476=>1000,30477=>1000,30478=>1000,30479=>1000,30480=>1000,30481=>1000,30482=>1000,30483=>1000,30484=>1000, - 30485=>1000,30486=>1000,30487=>1000,30488=>1000,30489=>1000,30490=>1000,30491=>1000,30492=>1000,30493=>1000,30494=>1000,30495=>1000,30496=>1000,30497=>1000,30498=>1000,30499=>1000,30500=>1000, - 30501=>1000,30502=>1000,30503=>1000,30504=>1000,30505=>1000,30506=>1000,30507=>1000,30508=>1000,30509=>1000,30510=>1000,30511=>1000,30512=>1000,30513=>1000,30514=>1000,30515=>1000,30516=>1000, - 30517=>1000,30518=>1000,30519=>1000,30520=>1000,30521=>1000,30522=>1000,30523=>1000,30524=>1000,30525=>1000,30526=>1000,30527=>1000,30528=>1000,30529=>1000,30530=>1000,30531=>1000,30532=>1000, - 30533=>1000,30534=>1000,30535=>1000,30536=>1000,30537=>1000,30538=>1000,30539=>1000,30540=>1000,30541=>1000,30542=>1000,30543=>1000,30544=>1000,30545=>1000,30546=>1000,30547=>1000,30548=>1000, - 30549=>1000,30550=>1000,30551=>1000,30552=>1000,30553=>1000,30554=>1000,30555=>1000,30556=>1000,30557=>1000,30558=>1000,30559=>1000,30560=>1000,30561=>1000,30562=>1000,30563=>1000,30564=>1000, - 30565=>1000,30566=>1000,30567=>1000,30568=>1000,30569=>1000,30570=>1000,30571=>1000,30572=>1000,30573=>1000,30574=>1000,30575=>1000,30576=>1000,30577=>1000,30578=>1000,30579=>1000,30580=>1000, - 30581=>1000,30582=>1000,30583=>1000,30584=>1000,30585=>1000,30586=>1000,30587=>1000,30588=>1000,30589=>1000,30590=>1000,30591=>1000,30592=>1000,30593=>1000,30594=>1000,30595=>1000,30596=>1000, - 30597=>1000,30598=>1000,30599=>1000,30600=>1000,30601=>1000,30602=>1000,30603=>1000,30604=>1000,30605=>1000,30606=>1000,30607=>1000,30608=>1000,30609=>1000,30610=>1000,30611=>1000,30612=>1000, - 30613=>1000,30614=>1000,30615=>1000,30616=>1000,30617=>1000,30618=>1000,30619=>1000,30620=>1000,30621=>1000,30622=>1000,30623=>1000,30624=>1000,30625=>1000,30626=>1000,30627=>1000,30628=>1000, - 30629=>1000,30630=>1000,30631=>1000,30632=>1000,30633=>1000,30634=>1000,30635=>1000,30636=>1000,30637=>1000,30638=>1000,30639=>1000,30640=>1000,30641=>1000,30642=>1000,30643=>1000,30644=>1000, - 30645=>1000,30646=>1000,30647=>1000,30648=>1000,30649=>1000,30650=>1000,30651=>1000,30652=>1000,30653=>1000,30654=>1000,30655=>1000,30656=>1000,30657=>1000,30658=>1000,30659=>1000,30660=>1000, - 30661=>1000,30662=>1000,30663=>1000,30664=>1000,30665=>1000,30666=>1000,30667=>1000,30668=>1000,30669=>1000,30670=>1000,30671=>1000,30672=>1000,30673=>1000,30674=>1000,30675=>1000,30676=>1000, - 30677=>1000,30678=>1000,30679=>1000,30680=>1000,30681=>1000,30682=>1000,30683=>1000,30684=>1000,30685=>1000,30686=>1000,30687=>1000,30688=>1000,30689=>1000,30690=>1000,30691=>1000,30692=>1000, - 30693=>1000,30694=>1000,30695=>1000,30696=>1000,30697=>1000,30698=>1000,30699=>1000,30700=>1000,30701=>1000,30702=>1000,30703=>1000,30704=>1000,30705=>1000,30706=>1000,30707=>1000,30708=>1000, - 30709=>1000,30710=>1000,30711=>1000,30712=>1000,30713=>1000,30714=>1000,30715=>1000,30716=>1000,30717=>1000,30718=>1000,30719=>1000,30720=>1000,30721=>1000,30722=>1000,30723=>1000,30724=>1000, - 30725=>1000,30726=>1000,30727=>1000,30728=>1000,30729=>1000,30730=>1000,30731=>1000,30732=>1000,30733=>1000,30734=>1000,30735=>1000,30736=>1000,30737=>1000,30738=>1000,30739=>1000,30740=>1000, - 30741=>1000,30742=>1000,30743=>1000,30744=>1000,30745=>1000,30746=>1000,30747=>1000,30748=>1000,30749=>1000,30750=>1000,30751=>1000,30752=>1000,30753=>1000,30754=>1000,30755=>1000,30756=>1000, - 30757=>1000,30758=>1000,30759=>1000,30760=>1000,30761=>1000,30762=>1000,30763=>1000,30764=>1000,30765=>1000,30766=>1000,30767=>1000,30768=>1000,30769=>1000,30770=>1000,30771=>1000,30772=>1000, - 30773=>1000,30774=>1000,30775=>1000,30776=>1000,30777=>1000,30778=>1000,30779=>1000,30780=>1000,30781=>1000,30782=>1000,30783=>1000,30784=>1000,30785=>1000,30786=>1000,30787=>1000,30788=>1000, - 30789=>1000,30790=>1000,30791=>1000,30792=>1000,30793=>1000,30794=>1000,30795=>1000,30796=>1000,30797=>1000,30798=>1000,30799=>1000,30800=>1000,30801=>1000,30802=>1000,30803=>1000,30804=>1000, - 30805=>1000,30806=>1000,30807=>1000,30808=>1000,30809=>1000,30810=>1000,30811=>1000,30812=>1000,30813=>1000,30814=>1000,30815=>1000,30816=>1000,30817=>1000,30818=>1000,30819=>1000,30820=>1000, - 30821=>1000,30822=>1000,30823=>1000,30824=>1000,30825=>1000,30826=>1000,30827=>1000,30828=>1000,30829=>1000,30830=>1000,30831=>1000,30832=>1000,30833=>1000,30834=>1000,30835=>1000,30836=>1000, - 30837=>1000,30838=>1000,30839=>1000,30840=>1000,30841=>1000,30842=>1000,30843=>1000,30844=>1000,30845=>1000,30846=>1000,30847=>1000,30848=>1000,30849=>1000,30850=>1000,30851=>1000,30852=>1000, - 30853=>1000,30854=>1000,30855=>1000,30856=>1000,30857=>1000,30858=>1000,30859=>1000,30860=>1000,30861=>1000,30862=>1000,30863=>1000,30864=>1000,30865=>1000,30866=>1000,30867=>1000,30868=>1000, - 30869=>1000,30870=>1000,30871=>1000,30872=>1000,30873=>1000,30874=>1000,30875=>1000,30876=>1000,30877=>1000,30878=>1000,30879=>1000,30880=>1000,30881=>1000,30882=>1000,30883=>1000,30884=>1000, - 30885=>1000,30886=>1000,30887=>1000,30888=>1000,30889=>1000,30890=>1000,30891=>1000,30892=>1000,30893=>1000,30894=>1000,30895=>1000,30896=>1000,30897=>1000,30898=>1000,30899=>1000,30900=>1000, - 30901=>1000,30902=>1000,30903=>1000,30904=>1000,30905=>1000,30906=>1000,30907=>1000,30908=>1000,30909=>1000,30910=>1000,30911=>1000,30912=>1000,30913=>1000,30914=>1000,30915=>1000,30916=>1000, - 30917=>1000,30918=>1000,30919=>1000,30920=>1000,30921=>1000,30922=>1000,30923=>1000,30924=>1000,30925=>1000,30926=>1000,30927=>1000,30928=>1000,30929=>1000,30930=>1000,30931=>1000,30932=>1000, - 30933=>1000,30934=>1000,30935=>1000,30936=>1000,30937=>1000,30938=>1000,30939=>1000,30940=>1000,30941=>1000,30942=>1000,30943=>1000,30944=>1000,30945=>1000,30946=>1000,30947=>1000,30948=>1000, - 30949=>1000,30950=>1000,30951=>1000,30952=>1000,30953=>1000,30954=>1000,30955=>1000,30956=>1000,30957=>1000,30958=>1000,30959=>1000,30960=>1000,30961=>1000,30962=>1000,30963=>1000,30964=>1000, - 30965=>1000,30966=>1000,30967=>1000,30968=>1000,30969=>1000,30970=>1000,30971=>1000,30972=>1000,30973=>1000,30974=>1000,30975=>1000,30976=>1000,30977=>1000,30978=>1000,30979=>1000,30980=>1000, - 30981=>1000,30982=>1000,30983=>1000,30984=>1000,30985=>1000,30986=>1000,30987=>1000,30988=>1000,30989=>1000,30990=>1000,30991=>1000,30992=>1000,30993=>1000,30994=>1000,30995=>1000,30996=>1000, - 30997=>1000,30998=>1000,30999=>1000,31000=>1000,31001=>1000,31002=>1000,31003=>1000,31004=>1000,31005=>1000,31006=>1000,31007=>1000,31008=>1000,31009=>1000,31010=>1000,31011=>1000,31012=>1000, - 31013=>1000,31014=>1000,31015=>1000,31016=>1000,31017=>1000,31018=>1000,31019=>1000,31020=>1000,31021=>1000,31022=>1000,31023=>1000,31024=>1000,31025=>1000,31026=>1000,31027=>1000,31028=>1000, - 31029=>1000,31030=>1000,31031=>1000,31032=>1000,31033=>1000,31034=>1000,31035=>1000,31036=>1000,31037=>1000,31038=>1000,31039=>1000,31040=>1000,31041=>1000,31042=>1000,31043=>1000,31044=>1000, - 31045=>1000,31046=>1000,31047=>1000,31048=>1000,31049=>1000,31050=>1000,31051=>1000,31052=>1000,31053=>1000,31054=>1000,31055=>1000,31056=>1000,31057=>1000,31058=>1000,31059=>1000,31060=>1000, - 31061=>1000,31062=>1000,31063=>1000,31064=>1000,31065=>1000,31066=>1000,31067=>1000,31068=>1000,31069=>1000,31070=>1000,31071=>1000,31072=>1000,31073=>1000,31074=>1000,31075=>1000,31076=>1000, - 31077=>1000,31078=>1000,31079=>1000,31080=>1000,31081=>1000,31082=>1000,31083=>1000,31084=>1000,31085=>1000,31086=>1000,31087=>1000,31088=>1000,31089=>1000,31090=>1000,31091=>1000,31092=>1000, - 31093=>1000,31094=>1000,31095=>1000,31096=>1000,31097=>1000,31098=>1000,31099=>1000,31100=>1000,31101=>1000,31102=>1000,31103=>1000,31104=>1000,31105=>1000,31106=>1000,31107=>1000,31108=>1000, - 31109=>1000,31110=>1000,31111=>1000,31112=>1000,31113=>1000,31114=>1000,31115=>1000,31116=>1000,31117=>1000,31118=>1000,31119=>1000,31120=>1000,31121=>1000,31122=>1000,31123=>1000,31124=>1000, - 31125=>1000,31126=>1000,31127=>1000,31128=>1000,31129=>1000,31130=>1000,31131=>1000,31132=>1000,31133=>1000,31134=>1000,31135=>1000,31136=>1000,31137=>1000,31138=>1000,31139=>1000,31140=>1000, - 31141=>1000,31142=>1000,31143=>1000,31144=>1000,31145=>1000,31146=>1000,31147=>1000,31148=>1000,31149=>1000,31150=>1000,31151=>1000,31152=>1000,31153=>1000,31154=>1000,31155=>1000,31156=>1000, - 31157=>1000,31158=>1000,31159=>1000,31160=>1000,31161=>1000,31162=>1000,31163=>1000,31164=>1000,31165=>1000,31166=>1000,31167=>1000,31168=>1000,31169=>1000,31170=>1000,31171=>1000,31172=>1000, - 31173=>1000,31174=>1000,31175=>1000,31176=>1000,31177=>1000,31178=>1000,31179=>1000,31180=>1000,31181=>1000,31182=>1000,31183=>1000,31184=>1000,31185=>1000,31186=>1000,31187=>1000,31188=>1000, - 31189=>1000,31190=>1000,31191=>1000,31192=>1000,31193=>1000,31194=>1000,31195=>1000,31196=>1000,31197=>1000,31198=>1000,31199=>1000,31200=>1000,31201=>1000,31202=>1000,31203=>1000,31204=>1000, - 31205=>1000,31206=>1000,31207=>1000,31208=>1000,31209=>1000,31210=>1000,31211=>1000,31212=>1000,31213=>1000,31214=>1000,31215=>1000,31216=>1000,31217=>1000,31218=>1000,31219=>1000,31220=>1000, - 31221=>1000,31222=>1000,31223=>1000,31224=>1000,31225=>1000,31226=>1000,31227=>1000,31228=>1000,31229=>1000,31230=>1000,31231=>1000,31232=>1000,31233=>1000,31234=>1000,31235=>1000,31236=>1000, - 31237=>1000,31238=>1000,31239=>1000,31240=>1000,31241=>1000,31242=>1000,31243=>1000,31244=>1000,31245=>1000,31246=>1000,31247=>1000,31248=>1000,31249=>1000,31250=>1000,31251=>1000,31252=>1000, - 31253=>1000,31254=>1000,31255=>1000,31256=>1000,31257=>1000,31258=>1000,31259=>1000,31260=>1000,31261=>1000,31262=>1000,31263=>1000,31264=>1000,31265=>1000,31266=>1000,31267=>1000,31268=>1000, - 31269=>1000,31270=>1000,31271=>1000,31272=>1000,31273=>1000,31274=>1000,31275=>1000,31276=>1000,31277=>1000,31278=>1000,31279=>1000,31280=>1000,31281=>1000,31282=>1000,31283=>1000,31284=>1000, - 31285=>1000,31286=>1000,31287=>1000,31288=>1000,31289=>1000,31290=>1000,31291=>1000,31292=>1000,31293=>1000,31294=>1000,31295=>1000,31296=>1000,31297=>1000,31298=>1000,31299=>1000,31300=>1000, - 31301=>1000,31302=>1000,31303=>1000,31304=>1000,31305=>1000,31306=>1000,31307=>1000,31308=>1000,31309=>1000,31310=>1000,31311=>1000,31312=>1000,31313=>1000,31314=>1000,31315=>1000,31316=>1000, - 31317=>1000,31318=>1000,31319=>1000,31320=>1000,31321=>1000,31322=>1000,31323=>1000,31324=>1000,31325=>1000,31326=>1000,31327=>1000,31328=>1000,31329=>1000,31330=>1000,31331=>1000,31332=>1000, - 31333=>1000,31334=>1000,31335=>1000,31336=>1000,31337=>1000,31338=>1000,31339=>1000,31340=>1000,31341=>1000,31342=>1000,31343=>1000,31344=>1000,31345=>1000,31346=>1000,31347=>1000,31348=>1000, - 31349=>1000,31350=>1000,31351=>1000,31352=>1000,31353=>1000,31354=>1000,31355=>1000,31356=>1000,31357=>1000,31358=>1000,31359=>1000,31360=>1000,31361=>1000,31362=>1000,31363=>1000,31364=>1000, - 31365=>1000,31366=>1000,31367=>1000,31368=>1000,31369=>1000,31370=>1000,31371=>1000,31372=>1000,31373=>1000,31374=>1000,31375=>1000,31376=>1000,31377=>1000,31378=>1000,31379=>1000,31380=>1000, - 31381=>1000,31382=>1000,31383=>1000,31384=>1000,31385=>1000,31386=>1000,31387=>1000,31388=>1000,31389=>1000,31390=>1000,31391=>1000,31392=>1000,31393=>1000,31394=>1000,31395=>1000,31396=>1000, - 31397=>1000,31398=>1000,31399=>1000,31400=>1000,31401=>1000,31402=>1000,31403=>1000,31404=>1000,31405=>1000,31406=>1000,31407=>1000,31408=>1000,31409=>1000,31410=>1000,31411=>1000,31412=>1000, - 31413=>1000,31414=>1000,31415=>1000,31416=>1000,31417=>1000,31418=>1000,31419=>1000,31420=>1000,31421=>1000,31422=>1000,31423=>1000,31424=>1000,31425=>1000,31426=>1000,31427=>1000,31428=>1000, - 31429=>1000,31430=>1000,31431=>1000,31432=>1000,31433=>1000,31434=>1000,31435=>1000,31436=>1000,31437=>1000,31438=>1000,31439=>1000,31440=>1000,31441=>1000,31442=>1000,31443=>1000,31444=>1000, - 31445=>1000,31446=>1000,31447=>1000,31448=>1000,31449=>1000,31450=>1000,31451=>1000,31452=>1000,31453=>1000,31454=>1000,31455=>1000,31456=>1000,31457=>1000,31458=>1000,31459=>1000,31460=>1000, - 31461=>1000,31462=>1000,31463=>1000,31464=>1000,31465=>1000,31466=>1000,31467=>1000,31468=>1000,31469=>1000,31470=>1000,31471=>1000,31472=>1000,31473=>1000,31474=>1000,31475=>1000,31476=>1000, - 31477=>1000,31478=>1000,31479=>1000,31480=>1000,31481=>1000,31482=>1000,31483=>1000,31484=>1000,31485=>1000,31486=>1000,31487=>1000,31488=>1000,31489=>1000,31490=>1000,31491=>1000,31492=>1000, - 31493=>1000,31494=>1000,31495=>1000,31496=>1000,31497=>1000,31498=>1000,31499=>1000,31500=>1000,31501=>1000,31502=>1000,31503=>1000,31504=>1000,31505=>1000,31506=>1000,31507=>1000,31508=>1000, - 31509=>1000,31510=>1000,31511=>1000,31512=>1000,31513=>1000,31514=>1000,31515=>1000,31516=>1000,31517=>1000,31518=>1000,31519=>1000,31520=>1000,31521=>1000,31522=>1000,31523=>1000,31524=>1000, - 31525=>1000,31526=>1000,31527=>1000,31528=>1000,31529=>1000,31530=>1000,31531=>1000,31532=>1000,31533=>1000,31534=>1000,31535=>1000,31536=>1000,31537=>1000,31538=>1000,31539=>1000,31540=>1000, - 31541=>1000,31542=>1000,31543=>1000,31544=>1000,31545=>1000,31546=>1000,31547=>1000,31548=>1000,31549=>1000,31550=>1000,31551=>1000,31552=>1000,31553=>1000,31554=>1000,31555=>1000,31556=>1000, - 31557=>1000,31558=>1000,31559=>1000,31560=>1000,31561=>1000,31562=>1000,31563=>1000,31564=>1000,31565=>1000,31566=>1000,31567=>1000,31568=>1000,31569=>1000,31570=>1000,31571=>1000,31572=>1000, - 31573=>1000,31574=>1000,31575=>1000,31576=>1000,31577=>1000,31578=>1000,31579=>1000,31580=>1000,31581=>1000,31582=>1000,31583=>1000,31584=>1000,31585=>1000,31586=>1000,31587=>1000,31588=>1000, - 31589=>1000,31590=>1000,31591=>1000,31592=>1000,31593=>1000,31594=>1000,31595=>1000,31596=>1000,31597=>1000,31598=>1000,31599=>1000,31600=>1000,31601=>1000,31602=>1000,31603=>1000,31604=>1000, - 31605=>1000,31606=>1000,31607=>1000,31608=>1000,31609=>1000,31610=>1000,31611=>1000,31612=>1000,31613=>1000,31614=>1000,31615=>1000,31616=>1000,31617=>1000,31618=>1000,31619=>1000,31620=>1000, - 31621=>1000,31622=>1000,31623=>1000,31624=>1000,31625=>1000,31626=>1000,31627=>1000,31628=>1000,31629=>1000,31630=>1000,31631=>1000,31632=>1000,31633=>1000,31634=>1000,31635=>1000,31636=>1000, - 31637=>1000,31638=>1000,31639=>1000,31640=>1000,31641=>1000,31642=>1000,31643=>1000,31644=>1000,31645=>1000,31646=>1000,31647=>1000,31648=>1000,31649=>1000,31650=>1000,31651=>1000,31652=>1000, - 31653=>1000,31654=>1000,31655=>1000,31656=>1000,31657=>1000,31658=>1000,31659=>1000,31660=>1000,31661=>1000,31662=>1000,31663=>1000,31664=>1000,31665=>1000,31666=>1000,31667=>1000,31668=>1000, - 31669=>1000,31670=>1000,31671=>1000,31672=>1000,31673=>1000,31674=>1000,31675=>1000,31676=>1000,31677=>1000,31678=>1000,31679=>1000,31680=>1000,31681=>1000,31682=>1000,31683=>1000,31684=>1000, - 31685=>1000,31686=>1000,31687=>1000,31688=>1000,31689=>1000,31690=>1000,31691=>1000,31692=>1000,31693=>1000,31694=>1000,31695=>1000,31696=>1000,31697=>1000,31698=>1000,31699=>1000,31700=>1000, - 31701=>1000,31702=>1000,31703=>1000,31704=>1000,31705=>1000,31706=>1000,31707=>1000,31708=>1000,31709=>1000,31710=>1000,31711=>1000,31712=>1000,31713=>1000,31714=>1000,31715=>1000,31716=>1000, - 31717=>1000,31718=>1000,31719=>1000,31720=>1000,31721=>1000,31722=>1000,31723=>1000,31724=>1000,31725=>1000,31726=>1000,31727=>1000,31728=>1000,31729=>1000,31730=>1000,31731=>1000,31732=>1000, - 31733=>1000,31734=>1000,31735=>1000,31736=>1000,31737=>1000,31738=>1000,31739=>1000,31740=>1000,31741=>1000,31742=>1000,31743=>1000,31744=>1000,31745=>1000,31746=>1000,31747=>1000,31748=>1000, - 31749=>1000,31750=>1000,31751=>1000,31752=>1000,31753=>1000,31754=>1000,31755=>1000,31756=>1000,31757=>1000,31758=>1000,31759=>1000,31760=>1000,31761=>1000,31762=>1000,31763=>1000,31764=>1000, - 31765=>1000,31766=>1000,31767=>1000,31768=>1000,31769=>1000,31770=>1000,31771=>1000,31772=>1000,31773=>1000,31774=>1000,31775=>1000,31776=>1000,31777=>1000,31778=>1000,31779=>1000,31780=>1000, - 31781=>1000,31782=>1000,31783=>1000,31784=>1000,31785=>1000,31786=>1000,31787=>1000,31788=>1000,31789=>1000,31790=>1000,31791=>1000,31792=>1000,31793=>1000,31794=>1000,31795=>1000,31796=>1000, - 31797=>1000,31798=>1000,31799=>1000,31800=>1000,31801=>1000,31802=>1000,31803=>1000,31804=>1000,31805=>1000,31806=>1000,31807=>1000,31808=>1000,31809=>1000,31810=>1000,31811=>1000,31812=>1000, - 31813=>1000,31814=>1000,31815=>1000,31816=>1000,31817=>1000,31818=>1000,31819=>1000,31820=>1000,31821=>1000,31822=>1000,31823=>1000,31824=>1000,31825=>1000,31826=>1000,31827=>1000,31828=>1000, - 31829=>1000,31830=>1000,31831=>1000,31832=>1000,31833=>1000,31834=>1000,31835=>1000,31836=>1000,31837=>1000,31838=>1000,31839=>1000,31840=>1000,31841=>1000,31842=>1000,31843=>1000,31844=>1000, - 31845=>1000,31846=>1000,31847=>1000,31848=>1000,31849=>1000,31850=>1000,31851=>1000,31852=>1000,31853=>1000,31854=>1000,31855=>1000,31856=>1000,31857=>1000,31858=>1000,31859=>1000,31860=>1000, - 31861=>1000,31862=>1000,31863=>1000,31864=>1000,31865=>1000,31866=>1000,31867=>1000,31868=>1000,31869=>1000,31870=>1000,31871=>1000,31872=>1000,31873=>1000,31874=>1000,31875=>1000,31876=>1000, - 31877=>1000,31878=>1000,31879=>1000,31880=>1000,31881=>1000,31882=>1000,31883=>1000,31884=>1000,31885=>1000,31886=>1000,31887=>1000,31888=>1000,31889=>1000,31890=>1000,31891=>1000,31892=>1000, - 31893=>1000,31894=>1000,31895=>1000,31896=>1000,31897=>1000,31898=>1000,31899=>1000,31900=>1000,31901=>1000,31902=>1000,31903=>1000,31904=>1000,31905=>1000,31906=>1000,31907=>1000,31908=>1000, - 31909=>1000,31910=>1000,31911=>1000,31912=>1000,31913=>1000,31914=>1000,31915=>1000,31916=>1000,31917=>1000,31918=>1000,31919=>1000,31920=>1000,31921=>1000,31922=>1000,31923=>1000,31924=>1000, - 31925=>1000,31926=>1000,31927=>1000,31928=>1000,31929=>1000,31930=>1000,31931=>1000,31932=>1000,31933=>1000,31934=>1000,31935=>1000,31936=>1000,31937=>1000,31938=>1000,31939=>1000,31940=>1000, - 31941=>1000,31942=>1000,31943=>1000,31944=>1000,31945=>1000,31946=>1000,31947=>1000,31948=>1000,31949=>1000,31950=>1000,31951=>1000,31952=>1000,31953=>1000,31954=>1000,31955=>1000,31956=>1000, - 31957=>1000,31958=>1000,31959=>1000,31960=>1000,31961=>1000,31962=>1000,31963=>1000,31964=>1000,31965=>1000,31966=>1000,31967=>1000,31968=>1000,31969=>1000,31970=>1000,31971=>1000,31972=>1000, - 31973=>1000,31974=>1000,31975=>1000,31976=>1000,31977=>1000,31978=>1000,31979=>1000,31980=>1000,31981=>1000,31982=>1000,31983=>1000,31984=>1000,31985=>1000,31986=>1000,31987=>1000,31988=>1000, - 31989=>1000,31990=>1000,31991=>1000,31992=>1000,31993=>1000,31994=>1000,31995=>1000,31996=>1000,31997=>1000,31998=>1000,31999=>1000,32000=>1000,32001=>1000,32002=>1000,32003=>1000,32004=>1000, - 32005=>1000,32006=>1000,32007=>1000,32008=>1000,32009=>1000,32010=>1000,32011=>1000,32012=>1000,32013=>1000,32014=>1000,32015=>1000,32016=>1000,32017=>1000,32018=>1000,32019=>1000,32020=>1000, - 32021=>1000,32022=>1000,32023=>1000,32024=>1000,32025=>1000,32026=>1000,32027=>1000,32028=>1000,32029=>1000,32030=>1000,32031=>1000,32032=>1000,32033=>1000,32034=>1000,32035=>1000,32036=>1000, - 32037=>1000,32038=>1000,32039=>1000,32040=>1000,32041=>1000,32042=>1000,32043=>1000,32044=>1000,32045=>1000,32046=>1000,32047=>1000,32048=>1000,32049=>1000,32050=>1000,32051=>1000,32052=>1000, - 32053=>1000,32054=>1000,32055=>1000,32056=>1000,32057=>1000,32058=>1000,32059=>1000,32060=>1000,32061=>1000,32062=>1000,32063=>1000,32064=>1000,32065=>1000,32066=>1000,32067=>1000,32068=>1000, - 32069=>1000,32070=>1000,32071=>1000,32072=>1000,32073=>1000,32074=>1000,32075=>1000,32076=>1000,32077=>1000,32078=>1000,32079=>1000,32080=>1000,32081=>1000,32082=>1000,32083=>1000,32084=>1000, - 32085=>1000,32086=>1000,32087=>1000,32088=>1000,32089=>1000,32090=>1000,32091=>1000,32092=>1000,32093=>1000,32094=>1000,32095=>1000,32096=>1000,32097=>1000,32098=>1000,32099=>1000,32100=>1000, - 32101=>1000,32102=>1000,32103=>1000,32104=>1000,32105=>1000,32106=>1000,32107=>1000,32108=>1000,32109=>1000,32110=>1000,32111=>1000,32112=>1000,32113=>1000,32114=>1000,32115=>1000,32116=>1000, - 32117=>1000,32118=>1000,32119=>1000,32120=>1000,32121=>1000,32122=>1000,32123=>1000,32124=>1000,32125=>1000,32126=>1000,32127=>1000,32128=>1000,32129=>1000,32130=>1000,32131=>1000,32132=>1000, - 32133=>1000,32134=>1000,32135=>1000,32136=>1000,32137=>1000,32138=>1000,32139=>1000,32140=>1000,32141=>1000,32142=>1000,32143=>1000,32144=>1000,32145=>1000,32146=>1000,32147=>1000,32148=>1000, - 32149=>1000,32150=>1000,32151=>1000,32152=>1000,32153=>1000,32154=>1000,32155=>1000,32156=>1000,32157=>1000,32158=>1000,32159=>1000,32160=>1000,32161=>1000,32162=>1000,32163=>1000,32164=>1000, - 32165=>1000,32166=>1000,32167=>1000,32168=>1000,32169=>1000,32170=>1000,32171=>1000,32172=>1000,32173=>1000,32174=>1000,32175=>1000,32176=>1000,32177=>1000,32178=>1000,32179=>1000,32180=>1000, - 32181=>1000,32182=>1000,32183=>1000,32184=>1000,32185=>1000,32186=>1000,32187=>1000,32188=>1000,32189=>1000,32190=>1000,32191=>1000,32192=>1000,32193=>1000,32194=>1000,32195=>1000,32196=>1000, - 32197=>1000,32198=>1000,32199=>1000,32200=>1000,32201=>1000,32202=>1000,32203=>1000,32204=>1000,32205=>1000,32206=>1000,32207=>1000,32208=>1000,32209=>1000,32210=>1000,32211=>1000,32212=>1000, - 32213=>1000,32214=>1000,32215=>1000,32216=>1000,32217=>1000,32218=>1000,32219=>1000,32220=>1000,32221=>1000,32222=>1000,32223=>1000,32224=>1000,32225=>1000,32226=>1000,32227=>1000,32228=>1000, - 32229=>1000,32230=>1000,32231=>1000,32232=>1000,32233=>1000,32234=>1000,32235=>1000,32236=>1000,32237=>1000,32238=>1000,32239=>1000,32240=>1000,32241=>1000,32242=>1000,32243=>1000,32244=>1000, - 32245=>1000,32246=>1000,32247=>1000,32248=>1000,32249=>1000,32250=>1000,32251=>1000,32252=>1000,32253=>1000,32254=>1000,32255=>1000,32256=>1000,32257=>1000,32258=>1000,32259=>1000,32260=>1000, - 32261=>1000,32262=>1000,32263=>1000,32264=>1000,32265=>1000,32266=>1000,32267=>1000,32268=>1000,32269=>1000,32270=>1000,32271=>1000,32272=>1000,32273=>1000,32274=>1000,32275=>1000,32276=>1000, - 32277=>1000,32278=>1000,32279=>1000,32280=>1000,32281=>1000,32282=>1000,32283=>1000,32284=>1000,32285=>1000,32286=>1000,32287=>1000,32288=>1000,32289=>1000,32290=>1000,32291=>1000,32292=>1000, - 32293=>1000,32294=>1000,32295=>1000,32296=>1000,32297=>1000,32298=>1000,32299=>1000,32300=>1000,32301=>1000,32302=>1000,32303=>1000,32304=>1000,32305=>1000,32306=>1000,32307=>1000,32308=>1000, - 32309=>1000,32310=>1000,32311=>1000,32312=>1000,32313=>1000,32314=>1000,32315=>1000,32316=>1000,32317=>1000,32318=>1000,32319=>1000,32320=>1000,32321=>1000,32322=>1000,32323=>1000,32324=>1000, - 32325=>1000,32326=>1000,32327=>1000,32328=>1000,32329=>1000,32330=>1000,32331=>1000,32332=>1000,32333=>1000,32334=>1000,32335=>1000,32336=>1000,32337=>1000,32338=>1000,32339=>1000,32340=>1000, - 32341=>1000,32342=>1000,32343=>1000,32344=>1000,32345=>1000,32346=>1000,32347=>1000,32348=>1000,32349=>1000,32350=>1000,32351=>1000,32352=>1000,32353=>1000,32354=>1000,32355=>1000,32356=>1000, - 32357=>1000,32358=>1000,32359=>1000,32360=>1000,32361=>1000,32362=>1000,32363=>1000,32364=>1000,32365=>1000,32366=>1000,32367=>1000,32368=>1000,32369=>1000,32370=>1000,32371=>1000,32372=>1000, - 32373=>1000,32374=>1000,32375=>1000,32376=>1000,32377=>1000,32378=>1000,32379=>1000,32380=>1000,32381=>1000,32382=>1000,32383=>1000,32384=>1000,32385=>1000,32386=>1000,32387=>1000,32388=>1000, - 32389=>1000,32390=>1000,32391=>1000,32392=>1000,32393=>1000,32394=>1000,32395=>1000,32396=>1000,32397=>1000,32398=>1000,32399=>1000,32400=>1000,32401=>1000,32402=>1000,32403=>1000,32404=>1000, - 32405=>1000,32406=>1000,32407=>1000,32408=>1000,32409=>1000,32410=>1000,32411=>1000,32412=>1000,32413=>1000,32414=>1000,32415=>1000,32416=>1000,32417=>1000,32418=>1000,32419=>1000,32420=>1000, - 32421=>1000,32422=>1000,32423=>1000,32424=>1000,32425=>1000,32426=>1000,32427=>1000,32428=>1000,32429=>1000,32430=>1000,32431=>1000,32432=>1000,32433=>1000,32434=>1000,32435=>1000,32436=>1000, - 32437=>1000,32438=>1000,32439=>1000,32440=>1000,32441=>1000,32442=>1000,32443=>1000,32444=>1000,32445=>1000,32446=>1000,32447=>1000,32448=>1000,32449=>1000,32450=>1000,32451=>1000,32452=>1000, - 32453=>1000,32454=>1000,32455=>1000,32456=>1000,32457=>1000,32458=>1000,32459=>1000,32460=>1000,32461=>1000,32462=>1000,32463=>1000,32464=>1000,32465=>1000,32466=>1000,32467=>1000,32468=>1000, - 32469=>1000,32470=>1000,32471=>1000,32472=>1000,32473=>1000,32474=>1000,32475=>1000,32476=>1000,32477=>1000,32478=>1000,32479=>1000,32480=>1000,32481=>1000,32482=>1000,32483=>1000,32484=>1000, - 32485=>1000,32486=>1000,32487=>1000,32488=>1000,32489=>1000,32490=>1000,32491=>1000,32492=>1000,32493=>1000,32494=>1000,32495=>1000,32496=>1000,32497=>1000,32498=>1000,32499=>1000,32500=>1000, - 32501=>1000,32502=>1000,32503=>1000,32504=>1000,32505=>1000,32506=>1000,32507=>1000,32508=>1000,32509=>1000,32510=>1000,32511=>1000,32512=>1000,32513=>1000,32514=>1000,32515=>1000,32516=>1000, - 32517=>1000,32518=>1000,32519=>1000,32520=>1000,32521=>1000,32522=>1000,32523=>1000,32524=>1000,32525=>1000,32526=>1000,32527=>1000,32528=>1000,32529=>1000,32530=>1000,32531=>1000,32532=>1000, - 32533=>1000,32534=>1000,32535=>1000,32536=>1000,32537=>1000,32538=>1000,32539=>1000,32540=>1000,32541=>1000,32542=>1000,32543=>1000,32544=>1000,32545=>1000,32546=>1000,32547=>1000,32548=>1000, - 32549=>1000,32550=>1000,32551=>1000,32552=>1000,32553=>1000,32554=>1000,32555=>1000,32556=>1000,32557=>1000,32558=>1000,32559=>1000,32560=>1000,32561=>1000,32562=>1000,32563=>1000,32564=>1000, - 32565=>1000,32566=>1000,32567=>1000,32568=>1000,32569=>1000,32570=>1000,32571=>1000,32572=>1000,32573=>1000,32574=>1000,32575=>1000,32576=>1000,32577=>1000,32578=>1000,32579=>1000,32580=>1000, - 32581=>1000,32582=>1000,32583=>1000,32584=>1000,32585=>1000,32586=>1000,32587=>1000,32588=>1000,32589=>1000,32590=>1000,32591=>1000,32592=>1000,32593=>1000,32594=>1000,32595=>1000,32596=>1000, - 32597=>1000,32598=>1000,32599=>1000,32600=>1000,32601=>1000,32602=>1000,32603=>1000,32604=>1000,32605=>1000,32606=>1000,32607=>1000,32608=>1000,32609=>1000,32610=>1000,32611=>1000,32612=>1000, - 32613=>1000,32614=>1000,32615=>1000,32616=>1000,32617=>1000,32618=>1000,32619=>1000,32620=>1000,32621=>1000,32622=>1000,32623=>1000,32624=>1000,32625=>1000,32626=>1000,32627=>1000,32628=>1000, - 32629=>1000,32630=>1000,32631=>1000,32632=>1000,32633=>1000,32634=>1000,32635=>1000,32636=>1000,32637=>1000,32638=>1000,32639=>1000,32640=>1000,32641=>1000,32642=>1000,32643=>1000,32644=>1000, - 32645=>1000,32646=>1000,32647=>1000,32648=>1000,32649=>1000,32650=>1000,32651=>1000,32652=>1000,32653=>1000,32654=>1000,32655=>1000,32656=>1000,32657=>1000,32658=>1000,32659=>1000,32660=>1000, - 32661=>1000,32662=>1000,32663=>1000,32664=>1000,32665=>1000,32666=>1000,32667=>1000,32668=>1000,32669=>1000,32670=>1000,32671=>1000,32672=>1000,32673=>1000,32674=>1000,32675=>1000,32676=>1000, - 32677=>1000,32678=>1000,32679=>1000,32680=>1000,32681=>1000,32682=>1000,32683=>1000,32684=>1000,32685=>1000,32686=>1000,32687=>1000,32688=>1000,32689=>1000,32690=>1000,32691=>1000,32692=>1000, - 32693=>1000,32694=>1000,32695=>1000,32696=>1000,32697=>1000,32698=>1000,32699=>1000,32700=>1000,32701=>1000,32702=>1000,32703=>1000,32704=>1000,32705=>1000,32706=>1000,32707=>1000,32708=>1000, - 32709=>1000,32710=>1000,32711=>1000,32712=>1000,32713=>1000,32714=>1000,32715=>1000,32716=>1000,32717=>1000,32718=>1000,32719=>1000,32720=>1000,32721=>1000,32722=>1000,32723=>1000,32724=>1000, - 32725=>1000,32726=>1000,32727=>1000,32728=>1000,32729=>1000,32730=>1000,32731=>1000,32732=>1000,32733=>1000,32734=>1000,32735=>1000,32736=>1000,32737=>1000,32738=>1000,32739=>1000,32740=>1000, - 32741=>1000,32742=>1000,32743=>1000,32744=>1000,32745=>1000,32746=>1000,32747=>1000,32748=>1000,32749=>1000,32750=>1000,32751=>1000,32752=>1000,32753=>1000,32754=>1000,32755=>1000,32756=>1000, - 32757=>1000,32758=>1000,32759=>1000,32760=>1000,32761=>1000,32762=>1000,32763=>1000,32764=>1000,32765=>1000,32766=>1000,32767=>1000,32768=>1000,32769=>1000,32770=>1000,32771=>1000,32772=>1000, - 32773=>1000,32774=>1000,32775=>1000,32776=>1000,32777=>1000,32778=>1000,32779=>1000,32780=>1000,32781=>1000,32782=>1000,32783=>1000,32784=>1000,32785=>1000,32786=>1000,32787=>1000,32788=>1000, - 32789=>1000,32790=>1000,32791=>1000,32792=>1000,32793=>1000,32794=>1000,32795=>1000,32796=>1000,32797=>1000,32798=>1000,32799=>1000,32800=>1000,32801=>1000,32802=>1000,32803=>1000,32804=>1000, - 32805=>1000,32806=>1000,32807=>1000,32808=>1000,32809=>1000,32810=>1000,32811=>1000,32812=>1000,32813=>1000,32814=>1000,32815=>1000,32816=>1000,32817=>1000,32818=>1000,32819=>1000,32820=>1000, - 32821=>1000,32822=>1000,32823=>1000,32824=>1000,32825=>1000,32826=>1000,32827=>1000,32828=>1000,32829=>1000,32830=>1000,32831=>1000,32832=>1000,32833=>1000,32834=>1000,32835=>1000,32836=>1000, - 32837=>1000,32838=>1000,32839=>1000,32840=>1000,32841=>1000,32842=>1000,32843=>1000,32844=>1000,32845=>1000,32846=>1000,32847=>1000,32848=>1000,32849=>1000,32850=>1000,32851=>1000,32852=>1000, - 32853=>1000,32854=>1000,32855=>1000,32856=>1000,32857=>1000,32858=>1000,32859=>1000,32860=>1000,32861=>1000,32862=>1000,32863=>1000,32864=>1000,32865=>1000,32866=>1000,32867=>1000,32868=>1000, - 32869=>1000,32870=>1000,32871=>1000,32872=>1000,32873=>1000,32874=>1000,32875=>1000,32876=>1000,32877=>1000,32878=>1000,32879=>1000,32880=>1000,32881=>1000,32882=>1000,32883=>1000,32884=>1000, - 32885=>1000,32886=>1000,32887=>1000,32888=>1000,32889=>1000,32890=>1000,32891=>1000,32892=>1000,32893=>1000,32894=>1000,32895=>1000,32896=>1000,32897=>1000,32898=>1000,32899=>1000,32900=>1000, - 32901=>1000,32902=>1000,32903=>1000,32904=>1000,32905=>1000,32906=>1000,32907=>1000,32908=>1000,32909=>1000,32910=>1000,32911=>1000,32912=>1000,32913=>1000,32914=>1000,32915=>1000,32916=>1000, - 32917=>1000,32918=>1000,32919=>1000,32920=>1000,32921=>1000,32922=>1000,32923=>1000,32924=>1000,32925=>1000,32926=>1000,32927=>1000,32928=>1000,32929=>1000,32930=>1000,32931=>1000,32932=>1000, - 32933=>1000,32934=>1000,32935=>1000,32936=>1000,32937=>1000,32938=>1000,32939=>1000,32940=>1000,32941=>1000,32942=>1000,32943=>1000,32944=>1000,32945=>1000,32946=>1000,32947=>1000,32948=>1000, - 32949=>1000,32950=>1000,32951=>1000,32952=>1000,32953=>1000,32954=>1000,32955=>1000,32956=>1000,32957=>1000,32958=>1000,32959=>1000,32960=>1000,32961=>1000,32962=>1000,32963=>1000,32964=>1000, - 32965=>1000,32966=>1000,32967=>1000,32968=>1000,32969=>1000,32970=>1000,32971=>1000,32972=>1000,32973=>1000,32974=>1000,32975=>1000,32976=>1000,32977=>1000,32978=>1000,32979=>1000,32980=>1000, - 32981=>1000,32982=>1000,32983=>1000,32984=>1000,32985=>1000,32986=>1000,32987=>1000,32988=>1000,32989=>1000,32990=>1000,32991=>1000,32992=>1000,32993=>1000,32994=>1000,32995=>1000,32996=>1000, - 32997=>1000,32998=>1000,32999=>1000,33000=>1000,33001=>1000,33002=>1000,33003=>1000,33004=>1000,33005=>1000,33006=>1000,33007=>1000,33008=>1000,33009=>1000,33010=>1000,33011=>1000,33012=>1000, - 33013=>1000,33014=>1000,33015=>1000,33016=>1000,33017=>1000,33018=>1000,33019=>1000,33020=>1000,33021=>1000,33022=>1000,33023=>1000,33024=>1000,33025=>1000,33026=>1000,33027=>1000,33028=>1000, - 33029=>1000,33030=>1000,33031=>1000,33032=>1000,33033=>1000,33034=>1000,33035=>1000,33036=>1000,33037=>1000,33038=>1000,33039=>1000,33040=>1000,33041=>1000,33042=>1000,33043=>1000,33044=>1000, - 33045=>1000,33046=>1000,33047=>1000,33048=>1000,33049=>1000,33050=>1000,33051=>1000,33052=>1000,33053=>1000,33054=>1000,33055=>1000,33056=>1000,33057=>1000,33058=>1000,33059=>1000,33060=>1000, - 33061=>1000,33062=>1000,33063=>1000,33064=>1000,33065=>1000,33066=>1000,33067=>1000,33068=>1000,33069=>1000,33070=>1000,33071=>1000,33072=>1000,33073=>1000,33074=>1000,33075=>1000,33076=>1000, - 33077=>1000,33078=>1000,33079=>1000,33080=>1000,33081=>1000,33082=>1000,33083=>1000,33084=>1000,33085=>1000,33086=>1000,33087=>1000,33088=>1000,33089=>1000,33090=>1000,33091=>1000,33092=>1000, - 33093=>1000,33094=>1000,33095=>1000,33096=>1000,33097=>1000,33098=>1000,33099=>1000,33100=>1000,33101=>1000,33102=>1000,33103=>1000,33104=>1000,33105=>1000,33106=>1000,33107=>1000,33108=>1000, - 33109=>1000,33110=>1000,33111=>1000,33112=>1000,33113=>1000,33114=>1000,33115=>1000,33116=>1000,33117=>1000,33118=>1000,33119=>1000,33120=>1000,33121=>1000,33122=>1000,33123=>1000,33124=>1000, - 33125=>1000,33126=>1000,33127=>1000,33128=>1000,33129=>1000,33130=>1000,33131=>1000,33132=>1000,33133=>1000,33134=>1000,33135=>1000,33136=>1000,33137=>1000,33138=>1000,33139=>1000,33140=>1000, - 33141=>1000,33142=>1000,33143=>1000,33144=>1000,33145=>1000,33146=>1000,33147=>1000,33148=>1000,33149=>1000,33150=>1000,33151=>1000,33152=>1000,33153=>1000,33154=>1000,33155=>1000,33156=>1000, - 33157=>1000,33158=>1000,33159=>1000,33160=>1000,33161=>1000,33162=>1000,33163=>1000,33164=>1000,33165=>1000,33166=>1000,33167=>1000,33168=>1000,33169=>1000,33170=>1000,33171=>1000,33172=>1000, - 33173=>1000,33174=>1000,33175=>1000,33176=>1000,33177=>1000,33178=>1000,33179=>1000,33180=>1000,33181=>1000,33182=>1000,33183=>1000,33184=>1000,33185=>1000,33186=>1000,33187=>1000,33188=>1000, - 33189=>1000,33190=>1000,33191=>1000,33192=>1000,33193=>1000,33194=>1000,33195=>1000,33196=>1000,33197=>1000,33198=>1000,33199=>1000,33200=>1000,33201=>1000,33202=>1000,33203=>1000,33204=>1000, - 33205=>1000,33206=>1000,33207=>1000,33208=>1000,33209=>1000,33210=>1000,33211=>1000,33212=>1000,33213=>1000,33214=>1000,33215=>1000,33216=>1000,33217=>1000,33218=>1000,33219=>1000,33220=>1000, - 33221=>1000,33222=>1000,33223=>1000,33224=>1000,33225=>1000,33226=>1000,33227=>1000,33228=>1000,33229=>1000,33230=>1000,33231=>1000,33232=>1000,33233=>1000,33234=>1000,33235=>1000,33236=>1000, - 33237=>1000,33238=>1000,33239=>1000,33240=>1000,33241=>1000,33242=>1000,33243=>1000,33244=>1000,33245=>1000,33246=>1000,33247=>1000,33248=>1000,33249=>1000,33250=>1000,33251=>1000,33252=>1000, - 33253=>1000,33254=>1000,33255=>1000,33256=>1000,33257=>1000,33258=>1000,33259=>1000,33260=>1000,33261=>1000,33262=>1000,33263=>1000,33264=>1000,33265=>1000,33266=>1000,33267=>1000,33268=>1000, - 33269=>1000,33270=>1000,33271=>1000,33272=>1000,33273=>1000,33274=>1000,33275=>1000,33276=>1000,33277=>1000,33278=>1000,33279=>1000,33280=>1000,33281=>1000,33282=>1000,33283=>1000,33284=>1000, - 33285=>1000,33286=>1000,33287=>1000,33288=>1000,33289=>1000,33290=>1000,33291=>1000,33292=>1000,33293=>1000,33294=>1000,33295=>1000,33296=>1000,33297=>1000,33298=>1000,33299=>1000,33300=>1000, - 33301=>1000,33302=>1000,33303=>1000,33304=>1000,33305=>1000,33306=>1000,33307=>1000,33308=>1000,33309=>1000,33310=>1000,33311=>1000,33312=>1000,33313=>1000,33314=>1000,33315=>1000,33316=>1000, - 33317=>1000,33318=>1000,33319=>1000,33320=>1000,33321=>1000,33322=>1000,33323=>1000,33324=>1000,33325=>1000,33326=>1000,33327=>1000,33328=>1000,33329=>1000,33330=>1000,33331=>1000,33332=>1000, - 33333=>1000,33334=>1000,33335=>1000,33336=>1000,33337=>1000,33338=>1000,33339=>1000,33340=>1000,33341=>1000,33342=>1000,33343=>1000,33344=>1000,33345=>1000,33346=>1000,33347=>1000,33348=>1000, - 33349=>1000,33350=>1000,33351=>1000,33352=>1000,33353=>1000,33354=>1000,33355=>1000,33356=>1000,33357=>1000,33358=>1000,33359=>1000,33360=>1000,33361=>1000,33362=>1000,33363=>1000,33364=>1000, - 33365=>1000,33366=>1000,33367=>1000,33368=>1000,33369=>1000,33370=>1000,33371=>1000,33372=>1000,33373=>1000,33374=>1000,33375=>1000,33376=>1000,33377=>1000,33378=>1000,33379=>1000,33380=>1000, - 33381=>1000,33382=>1000,33383=>1000,33384=>1000,33385=>1000,33386=>1000,33387=>1000,33388=>1000,33389=>1000,33390=>1000,33391=>1000,33392=>1000,33393=>1000,33394=>1000,33395=>1000,33396=>1000, - 33397=>1000,33398=>1000,33399=>1000,33400=>1000,33401=>1000,33402=>1000,33403=>1000,33404=>1000,33405=>1000,33406=>1000,33407=>1000,33408=>1000,33409=>1000,33410=>1000,33411=>1000,33412=>1000, - 33413=>1000,33414=>1000,33415=>1000,33416=>1000,33417=>1000,33418=>1000,33419=>1000,33420=>1000,33421=>1000,33422=>1000,33423=>1000,33424=>1000,33425=>1000,33426=>1000,33427=>1000,33428=>1000, - 33429=>1000,33430=>1000,33431=>1000,33432=>1000,33433=>1000,33434=>1000,33435=>1000,33436=>1000,33437=>1000,33438=>1000,33439=>1000,33440=>1000,33441=>1000,33442=>1000,33443=>1000,33444=>1000, - 33445=>1000,33446=>1000,33447=>1000,33448=>1000,33449=>1000,33450=>1000,33451=>1000,33452=>1000,33453=>1000,33454=>1000,33455=>1000,33456=>1000,33457=>1000,33458=>1000,33459=>1000,33460=>1000, - 33461=>1000,33462=>1000,33463=>1000,33464=>1000,33465=>1000,33466=>1000,33467=>1000,33468=>1000,33469=>1000,33470=>1000,33471=>1000,33472=>1000,33473=>1000,33474=>1000,33475=>1000,33476=>1000, - 33477=>1000,33478=>1000,33479=>1000,33480=>1000,33481=>1000,33482=>1000,33483=>1000,33484=>1000,33485=>1000,33486=>1000,33487=>1000,33488=>1000,33489=>1000,33490=>1000,33491=>1000,33492=>1000, - 33493=>1000,33494=>1000,33495=>1000,33496=>1000,33497=>1000,33498=>1000,33499=>1000,33500=>1000,33501=>1000,33502=>1000,33503=>1000,33504=>1000,33505=>1000,33506=>1000,33507=>1000,33508=>1000, - 33509=>1000,33510=>1000,33511=>1000,33512=>1000,33513=>1000,33514=>1000,33515=>1000,33516=>1000,33517=>1000,33518=>1000,33519=>1000,33520=>1000,33521=>1000,33522=>1000,33523=>1000,33524=>1000, - 33525=>1000,33526=>1000,33527=>1000,33528=>1000,33529=>1000,33530=>1000,33531=>1000,33532=>1000,33533=>1000,33534=>1000,33535=>1000,33536=>1000,33537=>1000,33538=>1000,33539=>1000,33540=>1000, - 33541=>1000,33542=>1000,33543=>1000,33544=>1000,33545=>1000,33546=>1000,33547=>1000,33548=>1000,33549=>1000,33550=>1000,33551=>1000,33552=>1000,33553=>1000,33554=>1000,33555=>1000,33556=>1000, - 33557=>1000,33558=>1000,33559=>1000,33560=>1000,33561=>1000,33562=>1000,33563=>1000,33564=>1000,33565=>1000,33566=>1000,33567=>1000,33568=>1000,33569=>1000,33570=>1000,33571=>1000,33572=>1000, - 33573=>1000,33574=>1000,33575=>1000,33576=>1000,33577=>1000,33578=>1000,33579=>1000,33580=>1000,33581=>1000,33582=>1000,33583=>1000,33584=>1000,33585=>1000,33586=>1000,33587=>1000,33588=>1000, - 33589=>1000,33590=>1000,33591=>1000,33592=>1000,33593=>1000,33594=>1000,33595=>1000,33596=>1000,33597=>1000,33598=>1000,33599=>1000,33600=>1000,33601=>1000,33602=>1000,33603=>1000,33604=>1000, - 33605=>1000,33606=>1000,33607=>1000,33608=>1000,33609=>1000,33610=>1000,33611=>1000,33612=>1000,33613=>1000,33614=>1000,33615=>1000,33616=>1000,33617=>1000,33618=>1000,33619=>1000,33620=>1000, - 33621=>1000,33622=>1000,33623=>1000,33624=>1000,33625=>1000,33626=>1000,33627=>1000,33628=>1000,33629=>1000,33630=>1000,33631=>1000,33632=>1000,33633=>1000,33634=>1000,33635=>1000,33636=>1000, - 33637=>1000,33638=>1000,33639=>1000,33640=>1000,33641=>1000,33642=>1000,33643=>1000,33644=>1000,33645=>1000,33646=>1000,33647=>1000,33648=>1000,33649=>1000,33650=>1000,33651=>1000,33652=>1000, - 33653=>1000,33654=>1000,33655=>1000,33656=>1000,33657=>1000,33658=>1000,33659=>1000,33660=>1000,33661=>1000,33662=>1000,33663=>1000,33664=>1000,33665=>1000,33666=>1000,33667=>1000,33668=>1000, - 33669=>1000,33670=>1000,33671=>1000,33672=>1000,33673=>1000,33674=>1000,33675=>1000,33676=>1000,33677=>1000,33678=>1000,33679=>1000,33680=>1000,33681=>1000,33682=>1000,33683=>1000,33684=>1000, - 33685=>1000,33686=>1000,33687=>1000,33688=>1000,33689=>1000,33690=>1000,33691=>1000,33692=>1000,33693=>1000,33694=>1000,33695=>1000,33696=>1000,33697=>1000,33698=>1000,33699=>1000,33700=>1000, - 33701=>1000,33702=>1000,33703=>1000,33704=>1000,33705=>1000,33706=>1000,33707=>1000,33708=>1000,33709=>1000,33710=>1000,33711=>1000,33712=>1000,33713=>1000,33714=>1000,33715=>1000,33716=>1000, - 33717=>1000,33718=>1000,33719=>1000,33720=>1000,33721=>1000,33722=>1000,33723=>1000,33724=>1000,33725=>1000,33726=>1000,33727=>1000,33728=>1000,33729=>1000,33730=>1000,33731=>1000,33732=>1000, - 33733=>1000,33734=>1000,33735=>1000,33736=>1000,33737=>1000,33738=>1000,33739=>1000,33740=>1000,33741=>1000,33742=>1000,33743=>1000,33744=>1000,33745=>1000,33746=>1000,33747=>1000,33748=>1000, - 33749=>1000,33750=>1000,33751=>1000,33752=>1000,33753=>1000,33754=>1000,33755=>1000,33756=>1000,33757=>1000,33758=>1000,33759=>1000,33760=>1000,33761=>1000,33762=>1000,33763=>1000,33764=>1000, - 33765=>1000,33766=>1000,33767=>1000,33768=>1000,33769=>1000,33770=>1000,33771=>1000,33772=>1000,33773=>1000,33774=>1000,33775=>1000,33776=>1000,33777=>1000,33778=>1000,33779=>1000,33780=>1000, - 33781=>1000,33782=>1000,33783=>1000,33784=>1000,33785=>1000,33786=>1000,33787=>1000,33788=>1000,33789=>1000,33790=>1000,33791=>1000,33792=>1000,33793=>1000,33794=>1000,33795=>1000,33796=>1000, - 33797=>1000,33798=>1000,33799=>1000,33800=>1000,33801=>1000,33802=>1000,33803=>1000,33804=>1000,33805=>1000,33806=>1000,33807=>1000,33808=>1000,33809=>1000,33810=>1000,33811=>1000,33812=>1000, - 33813=>1000,33814=>1000,33815=>1000,33816=>1000,33817=>1000,33818=>1000,33819=>1000,33820=>1000,33821=>1000,33822=>1000,33823=>1000,33824=>1000,33825=>1000,33826=>1000,33827=>1000,33828=>1000, - 33829=>1000,33830=>1000,33831=>1000,33832=>1000,33833=>1000,33834=>1000,33835=>1000,33836=>1000,33837=>1000,33838=>1000,33839=>1000,33840=>1000,33841=>1000,33842=>1000,33843=>1000,33844=>1000, - 33845=>1000,33846=>1000,33847=>1000,33848=>1000,33849=>1000,33850=>1000,33851=>1000,33852=>1000,33853=>1000,33854=>1000,33855=>1000,33856=>1000,33857=>1000,33858=>1000,33859=>1000,33860=>1000, - 33861=>1000,33862=>1000,33863=>1000,33864=>1000,33865=>1000,33866=>1000,33867=>1000,33868=>1000,33869=>1000,33870=>1000,33871=>1000,33872=>1000,33873=>1000,33874=>1000,33875=>1000,33876=>1000, - 33877=>1000,33878=>1000,33879=>1000,33880=>1000,33881=>1000,33882=>1000,33883=>1000,33884=>1000,33885=>1000,33886=>1000,33887=>1000,33888=>1000,33889=>1000,33890=>1000,33891=>1000,33892=>1000, - 33893=>1000,33894=>1000,33895=>1000,33896=>1000,33897=>1000,33898=>1000,33899=>1000,33900=>1000,33901=>1000,33902=>1000,33903=>1000,33904=>1000,33905=>1000,33906=>1000,33907=>1000,33908=>1000, - 33909=>1000,33910=>1000,33911=>1000,33912=>1000,33913=>1000,33914=>1000,33915=>1000,33916=>1000,33917=>1000,33918=>1000,33919=>1000,33920=>1000,33921=>1000,33922=>1000,33923=>1000,33924=>1000, - 33925=>1000,33926=>1000,33927=>1000,33928=>1000,33929=>1000,33930=>1000,33931=>1000,33932=>1000,33933=>1000,33934=>1000,33935=>1000,33936=>1000,33937=>1000,33938=>1000,33939=>1000,33940=>1000, - 33941=>1000,33942=>1000,33943=>1000,33944=>1000,33945=>1000,33946=>1000,33947=>1000,33948=>1000,33949=>1000,33950=>1000,33951=>1000,33952=>1000,33953=>1000,33954=>1000,33955=>1000,33956=>1000, - 33957=>1000,33958=>1000,33959=>1000,33960=>1000,33961=>1000,33962=>1000,33963=>1000,33964=>1000,33965=>1000,33966=>1000,33967=>1000,33968=>1000,33969=>1000,33970=>1000,33971=>1000,33972=>1000, - 33973=>1000,33974=>1000,33975=>1000,33976=>1000,33977=>1000,33978=>1000,33979=>1000,33980=>1000,33981=>1000,33982=>1000,33983=>1000,33984=>1000,33985=>1000,33986=>1000,33987=>1000,33988=>1000, - 33989=>1000,33990=>1000,33991=>1000,33992=>1000,33993=>1000,33994=>1000,33995=>1000,33996=>1000,33997=>1000,33998=>1000,33999=>1000,34000=>1000,34001=>1000,34002=>1000,34003=>1000,34004=>1000, - 34005=>1000,34006=>1000,34007=>1000,34008=>1000,34009=>1000,34010=>1000,34011=>1000,34012=>1000,34013=>1000,34014=>1000,34015=>1000,34016=>1000,34017=>1000,34018=>1000,34019=>1000,34020=>1000, - 34021=>1000,34022=>1000,34023=>1000,34024=>1000,34025=>1000,34026=>1000,34027=>1000,34028=>1000,34029=>1000,34030=>1000,34031=>1000,34032=>1000,34033=>1000,34034=>1000,34035=>1000,34036=>1000, - 34037=>1000,34038=>1000,34039=>1000,34040=>1000,34041=>1000,34042=>1000,34043=>1000,34044=>1000,34045=>1000,34046=>1000,34047=>1000,34048=>1000,34049=>1000,34050=>1000,34051=>1000,34052=>1000, - 34053=>1000,34054=>1000,34055=>1000,34056=>1000,34057=>1000,34058=>1000,34059=>1000,34060=>1000,34061=>1000,34062=>1000,34063=>1000,34064=>1000,34065=>1000,34066=>1000,34067=>1000,34068=>1000, - 34069=>1000,34070=>1000,34071=>1000,34072=>1000,34073=>1000,34074=>1000,34075=>1000,34076=>1000,34077=>1000,34078=>1000,34079=>1000,34080=>1000,34081=>1000,34082=>1000,34083=>1000,34084=>1000, - 34085=>1000,34086=>1000,34087=>1000,34088=>1000,34089=>1000,34090=>1000,34091=>1000,34092=>1000,34093=>1000,34094=>1000,34095=>1000,34096=>1000,34097=>1000,34098=>1000,34099=>1000,34100=>1000, - 34101=>1000,34102=>1000,34103=>1000,34104=>1000,34105=>1000,34106=>1000,34107=>1000,34108=>1000,34109=>1000,34110=>1000,34111=>1000,34112=>1000,34113=>1000,34114=>1000,34115=>1000,34116=>1000, - 34117=>1000,34118=>1000,34119=>1000,34120=>1000,34121=>1000,34122=>1000,34123=>1000,34124=>1000,34125=>1000,34126=>1000,34127=>1000,34128=>1000,34129=>1000,34130=>1000,34131=>1000,34132=>1000, - 34133=>1000,34134=>1000,34135=>1000,34136=>1000,34137=>1000,34138=>1000,34139=>1000,34140=>1000,34141=>1000,34142=>1000,34143=>1000,34144=>1000,34145=>1000,34146=>1000,34147=>1000,34148=>1000, - 34149=>1000,34150=>1000,34151=>1000,34152=>1000,34153=>1000,34154=>1000,34155=>1000,34156=>1000,34157=>1000,34158=>1000,34159=>1000,34160=>1000,34161=>1000,34162=>1000,34163=>1000,34164=>1000, - 34165=>1000,34166=>1000,34167=>1000,34168=>1000,34169=>1000,34170=>1000,34171=>1000,34172=>1000,34173=>1000,34174=>1000,34175=>1000,34176=>1000,34177=>1000,34178=>1000,34179=>1000,34180=>1000, - 34181=>1000,34182=>1000,34183=>1000,34184=>1000,34185=>1000,34186=>1000,34187=>1000,34188=>1000,34189=>1000,34190=>1000,34191=>1000,34192=>1000,34193=>1000,34194=>1000,34195=>1000,34196=>1000, - 34197=>1000,34198=>1000,34199=>1000,34200=>1000,34201=>1000,34202=>1000,34203=>1000,34204=>1000,34205=>1000,34206=>1000,34207=>1000,34208=>1000,34209=>1000,34210=>1000,34211=>1000,34212=>1000, - 34213=>1000,34214=>1000,34215=>1000,34216=>1000,34217=>1000,34218=>1000,34219=>1000,34220=>1000,34221=>1000,34222=>1000,34223=>1000,34224=>1000,34225=>1000,34226=>1000,34227=>1000,34228=>1000, - 34229=>1000,34230=>1000,34231=>1000,34232=>1000,34233=>1000,34234=>1000,34235=>1000,34236=>1000,34237=>1000,34238=>1000,34239=>1000,34240=>1000,34241=>1000,34242=>1000,34243=>1000,34244=>1000, - 34245=>1000,34246=>1000,34247=>1000,34248=>1000,34249=>1000,34250=>1000,34251=>1000,34252=>1000,34253=>1000,34254=>1000,34255=>1000,34256=>1000,34257=>1000,34258=>1000,34259=>1000,34260=>1000, - 34261=>1000,34262=>1000,34263=>1000,34264=>1000,34265=>1000,34266=>1000,34267=>1000,34268=>1000,34269=>1000,34270=>1000,34271=>1000,34272=>1000,34273=>1000,34274=>1000,34275=>1000,34276=>1000, - 34277=>1000,34278=>1000,34279=>1000,34280=>1000,34281=>1000,34282=>1000,34283=>1000,34284=>1000,34285=>1000,34286=>1000,34287=>1000,34288=>1000,34289=>1000,34290=>1000,34291=>1000,34292=>1000, - 34293=>1000,34294=>1000,34295=>1000,34296=>1000,34297=>1000,34298=>1000,34299=>1000,34300=>1000,34301=>1000,34302=>1000,34303=>1000,34304=>1000,34305=>1000,34306=>1000,34307=>1000,34308=>1000, - 34309=>1000,34310=>1000,34311=>1000,34312=>1000,34313=>1000,34314=>1000,34315=>1000,34316=>1000,34317=>1000,34318=>1000,34319=>1000,34320=>1000,34321=>1000,34322=>1000,34323=>1000,34324=>1000, - 34325=>1000,34326=>1000,34327=>1000,34328=>1000,34329=>1000,34330=>1000,34331=>1000,34332=>1000,34333=>1000,34334=>1000,34335=>1000,34336=>1000,34337=>1000,34338=>1000,34339=>1000,34340=>1000, - 34341=>1000,34342=>1000,34343=>1000,34344=>1000,34345=>1000,34346=>1000,34347=>1000,34348=>1000,34349=>1000,34350=>1000,34351=>1000,34352=>1000,34353=>1000,34354=>1000,34355=>1000,34356=>1000, - 34357=>1000,34358=>1000,34359=>1000,34360=>1000,34361=>1000,34362=>1000,34363=>1000,34364=>1000,34365=>1000,34366=>1000,34367=>1000,34368=>1000,34369=>1000,34370=>1000,34371=>1000,34372=>1000, - 34373=>1000,34374=>1000,34375=>1000,34376=>1000,34377=>1000,34378=>1000,34379=>1000,34380=>1000,34381=>1000,34382=>1000,34383=>1000,34384=>1000,34385=>1000,34386=>1000,34387=>1000,34388=>1000, - 34389=>1000,34390=>1000,34391=>1000,34392=>1000,34393=>1000,34394=>1000,34395=>1000,34396=>1000,34397=>1000,34398=>1000,34399=>1000,34400=>1000,34401=>1000,34402=>1000,34403=>1000,34404=>1000, - 34405=>1000,34406=>1000,34407=>1000,34408=>1000,34409=>1000,34410=>1000,34411=>1000,34412=>1000,34413=>1000,34414=>1000,34415=>1000,34416=>1000,34417=>1000,34418=>1000,34419=>1000,34420=>1000, - 34421=>1000,34422=>1000,34423=>1000,34424=>1000,34425=>1000,34426=>1000,34427=>1000,34428=>1000,34429=>1000,34430=>1000,34431=>1000,34432=>1000,34433=>1000,34434=>1000,34435=>1000,34436=>1000, - 34437=>1000,34438=>1000,34439=>1000,34440=>1000,34441=>1000,34442=>1000,34443=>1000,34444=>1000,34445=>1000,34446=>1000,34447=>1000,34448=>1000,34449=>1000,34450=>1000,34451=>1000,34452=>1000, - 34453=>1000,34454=>1000,34455=>1000,34456=>1000,34457=>1000,34458=>1000,34459=>1000,34460=>1000,34461=>1000,34462=>1000,34463=>1000,34464=>1000,34465=>1000,34466=>1000,34467=>1000,34468=>1000, - 34469=>1000,34470=>1000,34471=>1000,34472=>1000,34473=>1000,34474=>1000,34475=>1000,34476=>1000,34477=>1000,34478=>1000,34479=>1000,34480=>1000,34481=>1000,34482=>1000,34483=>1000,34484=>1000, - 34485=>1000,34486=>1000,34487=>1000,34488=>1000,34489=>1000,34490=>1000,34491=>1000,34492=>1000,34493=>1000,34494=>1000,34495=>1000,34496=>1000,34497=>1000,34498=>1000,34499=>1000,34500=>1000, - 34501=>1000,34502=>1000,34503=>1000,34504=>1000,34505=>1000,34506=>1000,34507=>1000,34508=>1000,34509=>1000,34510=>1000,34511=>1000,34512=>1000,34513=>1000,34514=>1000,34515=>1000,34516=>1000, - 34517=>1000,34518=>1000,34519=>1000,34520=>1000,34521=>1000,34522=>1000,34523=>1000,34524=>1000,34525=>1000,34526=>1000,34527=>1000,34528=>1000,34529=>1000,34530=>1000,34531=>1000,34532=>1000, - 34533=>1000,34534=>1000,34535=>1000,34536=>1000,34537=>1000,34538=>1000,34539=>1000,34540=>1000,34541=>1000,34542=>1000,34543=>1000,34544=>1000,34545=>1000,34546=>1000,34547=>1000,34548=>1000, - 34549=>1000,34550=>1000,34551=>1000,34552=>1000,34553=>1000,34554=>1000,34555=>1000,34556=>1000,34557=>1000,34558=>1000,34559=>1000,34560=>1000,34561=>1000,34562=>1000,34563=>1000,34564=>1000, - 34565=>1000,34566=>1000,34567=>1000,34568=>1000,34569=>1000,34570=>1000,34571=>1000,34572=>1000,34573=>1000,34574=>1000,34575=>1000,34576=>1000,34577=>1000,34578=>1000,34579=>1000,34580=>1000, - 34581=>1000,34582=>1000,34583=>1000,34584=>1000,34585=>1000,34586=>1000,34587=>1000,34588=>1000,34589=>1000,34590=>1000,34591=>1000,34592=>1000,34593=>1000,34594=>1000,34595=>1000,34596=>1000, - 34597=>1000,34598=>1000,34599=>1000,34600=>1000,34601=>1000,34602=>1000,34603=>1000,34604=>1000,34605=>1000,34606=>1000,34607=>1000,34608=>1000,34609=>1000,34610=>1000,34611=>1000,34612=>1000, - 34613=>1000,34614=>1000,34615=>1000,34616=>1000,34617=>1000,34618=>1000,34619=>1000,34620=>1000,34621=>1000,34622=>1000,34623=>1000,34624=>1000,34625=>1000,34626=>1000,34627=>1000,34628=>1000, - 34629=>1000,34630=>1000,34631=>1000,34632=>1000,34633=>1000,34634=>1000,34635=>1000,34636=>1000,34637=>1000,34638=>1000,34639=>1000,34640=>1000,34641=>1000,34642=>1000,34643=>1000,34644=>1000, - 34645=>1000,34646=>1000,34647=>1000,34648=>1000,34649=>1000,34650=>1000,34651=>1000,34652=>1000,34653=>1000,34654=>1000,34655=>1000,34656=>1000,34657=>1000,34658=>1000,34659=>1000,34660=>1000, - 34661=>1000,34662=>1000,34663=>1000,34664=>1000,34665=>1000,34666=>1000,34667=>1000,34668=>1000,34669=>1000,34670=>1000,34671=>1000,34672=>1000,34673=>1000,34674=>1000,34675=>1000,34676=>1000, - 34677=>1000,34678=>1000,34679=>1000,34680=>1000,34681=>1000,34682=>1000,34683=>1000,34684=>1000,34685=>1000,34686=>1000,34687=>1000,34688=>1000,34689=>1000,34690=>1000,34691=>1000,34692=>1000, - 34693=>1000,34694=>1000,34695=>1000,34696=>1000,34697=>1000,34698=>1000,34699=>1000,34700=>1000,34701=>1000,34702=>1000,34703=>1000,34704=>1000,34705=>1000,34706=>1000,34707=>1000,34708=>1000, - 34709=>1000,34710=>1000,34711=>1000,34712=>1000,34713=>1000,34714=>1000,34715=>1000,34716=>1000,34717=>1000,34718=>1000,34719=>1000,34720=>1000,34721=>1000,34722=>1000,34723=>1000,34724=>1000, - 34725=>1000,34726=>1000,34727=>1000,34728=>1000,34729=>1000,34730=>1000,34731=>1000,34732=>1000,34733=>1000,34734=>1000,34735=>1000,34736=>1000,34737=>1000,34738=>1000,34739=>1000,34740=>1000, - 34741=>1000,34742=>1000,34743=>1000,34744=>1000,34745=>1000,34746=>1000,34747=>1000,34748=>1000,34749=>1000,34750=>1000,34751=>1000,34752=>1000,34753=>1000,34754=>1000,34755=>1000,34756=>1000, - 34757=>1000,34758=>1000,34759=>1000,34760=>1000,34761=>1000,34762=>1000,34763=>1000,34764=>1000,34765=>1000,34766=>1000,34767=>1000,34768=>1000,34769=>1000,34770=>1000,34771=>1000,34772=>1000, - 34773=>1000,34774=>1000,34775=>1000,34776=>1000,34777=>1000,34778=>1000,34779=>1000,34780=>1000,34781=>1000,34782=>1000,34783=>1000,34784=>1000,34785=>1000,34786=>1000,34787=>1000,34788=>1000, - 34789=>1000,34790=>1000,34791=>1000,34792=>1000,34793=>1000,34794=>1000,34795=>1000,34796=>1000,34797=>1000,34798=>1000,34799=>1000,34800=>1000,34801=>1000,34802=>1000,34803=>1000,34804=>1000, - 34805=>1000,34806=>1000,34807=>1000,34808=>1000,34809=>1000,34810=>1000,34811=>1000,34812=>1000,34813=>1000,34814=>1000,34815=>1000,34816=>1000,34817=>1000,34818=>1000,34819=>1000,34820=>1000, - 34821=>1000,34822=>1000,34823=>1000,34824=>1000,34825=>1000,34826=>1000,34827=>1000,34828=>1000,34829=>1000,34830=>1000,34831=>1000,34832=>1000,34833=>1000,34834=>1000,34835=>1000,34836=>1000, - 34837=>1000,34838=>1000,34839=>1000,34840=>1000,34841=>1000,34842=>1000,34843=>1000,34844=>1000,34845=>1000,34846=>1000,34847=>1000,34848=>1000,34849=>1000,34850=>1000,34851=>1000,34852=>1000, - 34853=>1000,34854=>1000,34855=>1000,34856=>1000,34857=>1000,34858=>1000,34859=>1000,34860=>1000,34861=>1000,34862=>1000,34863=>1000,34864=>1000,34865=>1000,34866=>1000,34867=>1000,34868=>1000, - 34869=>1000,34870=>1000,34871=>1000,34872=>1000,34873=>1000,34874=>1000,34875=>1000,34876=>1000,34877=>1000,34878=>1000,34879=>1000,34880=>1000,34881=>1000,34882=>1000,34883=>1000,34884=>1000, - 34885=>1000,34886=>1000,34887=>1000,34888=>1000,34889=>1000,34890=>1000,34891=>1000,34892=>1000,34893=>1000,34894=>1000,34895=>1000,34896=>1000,34897=>1000,34898=>1000,34899=>1000,34900=>1000, - 34901=>1000,34902=>1000,34903=>1000,34904=>1000,34905=>1000,34906=>1000,34907=>1000,34908=>1000,34909=>1000,34910=>1000,34911=>1000,34912=>1000,34913=>1000,34914=>1000,34915=>1000,34916=>1000, - 34917=>1000,34918=>1000,34919=>1000,34920=>1000,34921=>1000,34922=>1000,34923=>1000,34924=>1000,34925=>1000,34926=>1000,34927=>1000,34928=>1000,34929=>1000,34930=>1000,34931=>1000,34932=>1000, - 34933=>1000,34934=>1000,34935=>1000,34936=>1000,34937=>1000,34938=>1000,34939=>1000,34940=>1000,34941=>1000,34942=>1000,34943=>1000,34944=>1000,34945=>1000,34946=>1000,34947=>1000,34948=>1000, - 34949=>1000,34950=>1000,34951=>1000,34952=>1000,34953=>1000,34954=>1000,34955=>1000,34956=>1000,34957=>1000,34958=>1000,34959=>1000,34960=>1000,34961=>1000,34962=>1000,34963=>1000,34964=>1000, - 34965=>1000,34966=>1000,34967=>1000,34968=>1000,34969=>1000,34970=>1000,34971=>1000,34972=>1000,34973=>1000,34974=>1000,34975=>1000,34976=>1000,34977=>1000,34978=>1000,34979=>1000,34980=>1000, - 34981=>1000,34982=>1000,34983=>1000,34984=>1000,34985=>1000,34986=>1000,34987=>1000,34988=>1000,34989=>1000,34990=>1000,34991=>1000,34992=>1000,34993=>1000,34994=>1000,34995=>1000,34996=>1000, - 34997=>1000,34998=>1000,34999=>1000,35000=>1000,35001=>1000,35002=>1000,35003=>1000,35004=>1000,35005=>1000,35006=>1000,35007=>1000,35008=>1000,35009=>1000,35010=>1000,35011=>1000,35012=>1000, - 35013=>1000,35014=>1000,35015=>1000,35016=>1000,35017=>1000,35018=>1000,35019=>1000,35020=>1000,35021=>1000,35022=>1000,35023=>1000,35024=>1000,35025=>1000,35026=>1000,35027=>1000,35028=>1000, - 35029=>1000,35030=>1000,35031=>1000,35032=>1000,35033=>1000,35034=>1000,35035=>1000,35036=>1000,35037=>1000,35038=>1000,35039=>1000,35040=>1000,35041=>1000,35042=>1000,35043=>1000,35044=>1000, - 35045=>1000,35046=>1000,35047=>1000,35048=>1000,35049=>1000,35050=>1000,35051=>1000,35052=>1000,35053=>1000,35054=>1000,35055=>1000,35056=>1000,35057=>1000,35058=>1000,35059=>1000,35060=>1000, - 35061=>1000,35062=>1000,35063=>1000,35064=>1000,35065=>1000,35066=>1000,35067=>1000,35068=>1000,35069=>1000,35070=>1000,35071=>1000,35072=>1000,35073=>1000,35074=>1000,35075=>1000,35076=>1000, - 35077=>1000,35078=>1000,35079=>1000,35080=>1000,35081=>1000,35082=>1000,35083=>1000,35084=>1000,35085=>1000,35086=>1000,35087=>1000,35088=>1000,35089=>1000,35090=>1000,35091=>1000,35092=>1000, - 35093=>1000,35094=>1000,35095=>1000,35096=>1000,35097=>1000,35098=>1000,35099=>1000,35100=>1000,35101=>1000,35102=>1000,35103=>1000,35104=>1000,35105=>1000,35106=>1000,35107=>1000,35108=>1000, - 35109=>1000,35110=>1000,35111=>1000,35112=>1000,35113=>1000,35114=>1000,35115=>1000,35116=>1000,35117=>1000,35118=>1000,35119=>1000,35120=>1000,35121=>1000,35122=>1000,35123=>1000,35124=>1000, - 35125=>1000,35126=>1000,35127=>1000,35128=>1000,35129=>1000,35130=>1000,35131=>1000,35132=>1000,35133=>1000,35134=>1000,35135=>1000,35136=>1000,35137=>1000,35138=>1000,35139=>1000,35140=>1000, - 35141=>1000,35142=>1000,35143=>1000,35144=>1000,35145=>1000,35146=>1000,35147=>1000,35148=>1000,35149=>1000,35150=>1000,35151=>1000,35152=>1000,35153=>1000,35154=>1000,35155=>1000,35156=>1000, - 35157=>1000,35158=>1000,35159=>1000,35160=>1000,35161=>1000,35162=>1000,35163=>1000,35164=>1000,35165=>1000,35166=>1000,35167=>1000,35168=>1000,35169=>1000,35170=>1000,35171=>1000,35172=>1000, - 35173=>1000,35174=>1000,35175=>1000,35176=>1000,35177=>1000,35178=>1000,35179=>1000,35180=>1000,35181=>1000,35182=>1000,35183=>1000,35184=>1000,35185=>1000,35186=>1000,35187=>1000,35188=>1000, - 35189=>1000,35190=>1000,35191=>1000,35192=>1000,35193=>1000,35194=>1000,35195=>1000,35196=>1000,35197=>1000,35198=>1000,35199=>1000,35200=>1000,35201=>1000,35202=>1000,35203=>1000,35204=>1000, - 35205=>1000,35206=>1000,35207=>1000,35208=>1000,35209=>1000,35210=>1000,35211=>1000,35212=>1000,35213=>1000,35214=>1000,35215=>1000,35216=>1000,35217=>1000,35218=>1000,35219=>1000,35220=>1000, - 35221=>1000,35222=>1000,35223=>1000,35224=>1000,35225=>1000,35226=>1000,35227=>1000,35228=>1000,35229=>1000,35230=>1000,35231=>1000,35232=>1000,35233=>1000,35234=>1000,35235=>1000,35236=>1000, - 35237=>1000,35238=>1000,35239=>1000,35240=>1000,35241=>1000,35242=>1000,35243=>1000,35244=>1000,35245=>1000,35246=>1000,35247=>1000,35248=>1000,35249=>1000,35250=>1000,35251=>1000,35252=>1000, - 35253=>1000,35254=>1000,35255=>1000,35256=>1000,35257=>1000,35258=>1000,35259=>1000,35260=>1000,35261=>1000,35262=>1000,35263=>1000,35264=>1000,35265=>1000,35266=>1000,35267=>1000,35268=>1000, - 35269=>1000,35270=>1000,35271=>1000,35272=>1000,35273=>1000,35274=>1000,35275=>1000,35276=>1000,35277=>1000,35278=>1000,35279=>1000,35280=>1000,35281=>1000,35282=>1000,35283=>1000,35284=>1000, - 35285=>1000,35286=>1000,35287=>1000,35288=>1000,35289=>1000,35290=>1000,35291=>1000,35292=>1000,35293=>1000,35294=>1000,35295=>1000,35296=>1000,35297=>1000,35298=>1000,35299=>1000,35300=>1000, - 35301=>1000,35302=>1000,35303=>1000,35304=>1000,35305=>1000,35306=>1000,35307=>1000,35308=>1000,35309=>1000,35310=>1000,35311=>1000,35312=>1000,35313=>1000,35314=>1000,35315=>1000,35316=>1000, - 35317=>1000,35318=>1000,35319=>1000,35320=>1000,35321=>1000,35322=>1000,35323=>1000,35324=>1000,35325=>1000,35326=>1000,35327=>1000,35328=>1000,35329=>1000,35330=>1000,35331=>1000,35332=>1000, - 35333=>1000,35334=>1000,35335=>1000,35336=>1000,35337=>1000,35338=>1000,35339=>1000,35340=>1000,35341=>1000,35342=>1000,35343=>1000,35344=>1000,35345=>1000,35346=>1000,35347=>1000,35348=>1000, - 35349=>1000,35350=>1000,35351=>1000,35352=>1000,35353=>1000,35354=>1000,35355=>1000,35356=>1000,35357=>1000,35358=>1000,35359=>1000,35360=>1000,35361=>1000,35362=>1000,35363=>1000,35364=>1000, - 35365=>1000,35366=>1000,35367=>1000,35368=>1000,35369=>1000,35370=>1000,35371=>1000,35372=>1000,35373=>1000,35374=>1000,35375=>1000,35376=>1000,35377=>1000,35378=>1000,35379=>1000,35380=>1000, - 35381=>1000,35382=>1000,35383=>1000,35384=>1000,35385=>1000,35386=>1000,35387=>1000,35388=>1000,35389=>1000,35390=>1000,35391=>1000,35392=>1000,35393=>1000,35394=>1000,35395=>1000,35396=>1000, - 35397=>1000,35398=>1000,35399=>1000,35400=>1000,35401=>1000,35402=>1000,35403=>1000,35404=>1000,35405=>1000,35406=>1000,35407=>1000,35408=>1000,35409=>1000,35410=>1000,35411=>1000,35412=>1000, - 35413=>1000,35414=>1000,35415=>1000,35416=>1000,35417=>1000,35418=>1000,35419=>1000,35420=>1000,35421=>1000,35422=>1000,35423=>1000,35424=>1000,35425=>1000,35426=>1000,35427=>1000,35428=>1000, - 35429=>1000,35430=>1000,35431=>1000,35432=>1000,35433=>1000,35434=>1000,35435=>1000,35436=>1000,35437=>1000,35438=>1000,35439=>1000,35440=>1000,35441=>1000,35442=>1000,35443=>1000,35444=>1000, - 35445=>1000,35446=>1000,35447=>1000,35448=>1000,35449=>1000,35450=>1000,35451=>1000,35452=>1000,35453=>1000,35454=>1000,35455=>1000,35456=>1000,35457=>1000,35458=>1000,35459=>1000,35460=>1000, - 35461=>1000,35462=>1000,35463=>1000,35464=>1000,35465=>1000,35466=>1000,35467=>1000,35468=>1000,35469=>1000,35470=>1000,35471=>1000,35472=>1000,35473=>1000,35474=>1000,35475=>1000,35476=>1000, - 35477=>1000,35478=>1000,35479=>1000,35480=>1000,35481=>1000,35482=>1000,35483=>1000,35484=>1000,35485=>1000,35486=>1000,35487=>1000,35488=>1000,35489=>1000,35490=>1000,35491=>1000,35492=>1000, - 35493=>1000,35494=>1000,35495=>1000,35496=>1000,35497=>1000,35498=>1000,35499=>1000,35500=>1000,35501=>1000,35502=>1000,35503=>1000,35504=>1000,35505=>1000,35506=>1000,35507=>1000,35508=>1000, - 35509=>1000,35510=>1000,35511=>1000,35512=>1000,35513=>1000,35514=>1000,35515=>1000,35516=>1000,35517=>1000,35518=>1000,35519=>1000,35520=>1000,35521=>1000,35522=>1000,35523=>1000,35524=>1000, - 35525=>1000,35526=>1000,35527=>1000,35528=>1000,35529=>1000,35530=>1000,35531=>1000,35532=>1000,35533=>1000,35534=>1000,35535=>1000,35536=>1000,35537=>1000,35538=>1000,35539=>1000,35540=>1000, - 35541=>1000,35542=>1000,35543=>1000,35544=>1000,35545=>1000,35546=>1000,35547=>1000,35548=>1000,35549=>1000,35550=>1000,35551=>1000,35552=>1000,35553=>1000,35554=>1000,35555=>1000,35556=>1000, - 35557=>1000,35558=>1000,35559=>1000,35560=>1000,35561=>1000,35562=>1000,35563=>1000,35564=>1000,35565=>1000,35566=>1000,35567=>1000,35568=>1000,35569=>1000,35570=>1000,35571=>1000,35572=>1000, - 35573=>1000,35574=>1000,35575=>1000,35576=>1000,35577=>1000,35578=>1000,35579=>1000,35580=>1000,35581=>1000,35582=>1000,35583=>1000,35584=>1000,35585=>1000,35586=>1000,35587=>1000,35588=>1000, - 35589=>1000,35590=>1000,35591=>1000,35592=>1000,35593=>1000,35594=>1000,35595=>1000,35596=>1000,35597=>1000,35598=>1000,35599=>1000,35600=>1000,35601=>1000,35602=>1000,35603=>1000,35604=>1000, - 35605=>1000,35606=>1000,35607=>1000,35608=>1000,35609=>1000,35610=>1000,35611=>1000,35612=>1000,35613=>1000,35614=>1000,35615=>1000,35616=>1000,35617=>1000,35618=>1000,35619=>1000,35620=>1000, - 35621=>1000,35622=>1000,35623=>1000,35624=>1000,35625=>1000,35626=>1000,35627=>1000,35628=>1000,35629=>1000,35630=>1000,35631=>1000,35632=>1000,35633=>1000,35634=>1000,35635=>1000,35636=>1000, - 35637=>1000,35638=>1000,35639=>1000,35640=>1000,35641=>1000,35642=>1000,35643=>1000,35644=>1000,35645=>1000,35646=>1000,35647=>1000,35648=>1000,35649=>1000,35650=>1000,35651=>1000,35652=>1000, - 35653=>1000,35654=>1000,35655=>1000,35656=>1000,35657=>1000,35658=>1000,35659=>1000,35660=>1000,35661=>1000,35662=>1000,35663=>1000,35664=>1000,35665=>1000,35666=>1000,35667=>1000,35668=>1000, - 35669=>1000,35670=>1000,35671=>1000,35672=>1000,35673=>1000,35674=>1000,35675=>1000,35676=>1000,35677=>1000,35678=>1000,35679=>1000,35680=>1000,35681=>1000,35682=>1000,35683=>1000,35684=>1000, - 35685=>1000,35686=>1000,35687=>1000,35688=>1000,35689=>1000,35690=>1000,35691=>1000,35692=>1000,35693=>1000,35694=>1000,35695=>1000,35696=>1000,35697=>1000,35698=>1000,35699=>1000,35700=>1000, - 35701=>1000,35702=>1000,35703=>1000,35704=>1000,35705=>1000,35706=>1000,35707=>1000,35708=>1000,35709=>1000,35710=>1000,35711=>1000,35712=>1000,35713=>1000,35714=>1000,35715=>1000,35716=>1000, - 35717=>1000,35718=>1000,35719=>1000,35720=>1000,35721=>1000,35722=>1000,35723=>1000,35724=>1000,35725=>1000,35726=>1000,35727=>1000,35728=>1000,35729=>1000,35730=>1000,35731=>1000,35732=>1000, - 35733=>1000,35734=>1000,35735=>1000,35736=>1000,35737=>1000,35738=>1000,35739=>1000,35740=>1000,35741=>1000,35742=>1000,35743=>1000,35744=>1000,35745=>1000,35746=>1000,35747=>1000,35748=>1000, - 35749=>1000,35750=>1000,35751=>1000,35752=>1000,35753=>1000,35754=>1000,35755=>1000,35756=>1000,35757=>1000,35758=>1000,35759=>1000,35760=>1000,35761=>1000,35762=>1000,35763=>1000,35764=>1000, - 35765=>1000,35766=>1000,35767=>1000,35768=>1000,35769=>1000,35770=>1000,35771=>1000,35772=>1000,35773=>1000,35774=>1000,35775=>1000,35776=>1000,35777=>1000,35778=>1000,35779=>1000,35780=>1000, - 35781=>1000,35782=>1000,35783=>1000,35784=>1000,35785=>1000,35786=>1000,35787=>1000,35788=>1000,35789=>1000,35790=>1000,35791=>1000,35792=>1000,35793=>1000,35794=>1000,35795=>1000,35796=>1000, - 35797=>1000,35798=>1000,35799=>1000,35800=>1000,35801=>1000,35802=>1000,35803=>1000,35804=>1000,35805=>1000,35806=>1000,35807=>1000,35808=>1000,35809=>1000,35810=>1000,35811=>1000,35812=>1000, - 35813=>1000,35814=>1000,35815=>1000,35816=>1000,35817=>1000,35818=>1000,35819=>1000,35820=>1000,35821=>1000,35822=>1000,35823=>1000,35824=>1000,35825=>1000,35826=>1000,35827=>1000,35828=>1000, - 35829=>1000,35830=>1000,35831=>1000,35832=>1000,35833=>1000,35834=>1000,35835=>1000,35836=>1000,35837=>1000,35838=>1000,35839=>1000,35840=>1000,35841=>1000,35842=>1000,35843=>1000,35844=>1000, - 35845=>1000,35846=>1000,35847=>1000,35848=>1000,35849=>1000,35850=>1000,35851=>1000,35852=>1000,35853=>1000,35854=>1000,35855=>1000,35856=>1000,35857=>1000,35858=>1000,35859=>1000,35860=>1000, - 35861=>1000,35862=>1000,35863=>1000,35864=>1000,35865=>1000,35866=>1000,35867=>1000,35868=>1000,35869=>1000,35870=>1000,35871=>1000,35872=>1000,35873=>1000,35874=>1000,35875=>1000,35876=>1000, - 35877=>1000,35878=>1000,35879=>1000,35880=>1000,35881=>1000,35882=>1000,35883=>1000,35884=>1000,35885=>1000,35886=>1000,35887=>1000,35888=>1000,35889=>1000,35890=>1000,35891=>1000,35892=>1000, - 35893=>1000,35894=>1000,35895=>1000,35896=>1000,35897=>1000,35898=>1000,35899=>1000,35900=>1000,35901=>1000,35902=>1000,35903=>1000,35904=>1000,35905=>1000,35906=>1000,35907=>1000,35908=>1000, - 35909=>1000,35910=>1000,35911=>1000,35912=>1000,35913=>1000,35914=>1000,35915=>1000,35916=>1000,35917=>1000,35918=>1000,35919=>1000,35920=>1000,35921=>1000,35922=>1000,35923=>1000,35924=>1000, - 35925=>1000,35926=>1000,35927=>1000,35928=>1000,35929=>1000,35930=>1000,35931=>1000,35932=>1000,35933=>1000,35934=>1000,35935=>1000,35936=>1000,35937=>1000,35938=>1000,35939=>1000,35940=>1000, - 35941=>1000,35942=>1000,35943=>1000,35944=>1000,35945=>1000,35946=>1000,35947=>1000,35948=>1000,35949=>1000,35950=>1000,35951=>1000,35952=>1000,35953=>1000,35954=>1000,35955=>1000,35956=>1000, - 35957=>1000,35958=>1000,35959=>1000,35960=>1000,35961=>1000,35962=>1000,35963=>1000,35964=>1000,35965=>1000,35966=>1000,35967=>1000,35968=>1000,35969=>1000,35970=>1000,35971=>1000,35972=>1000, - 35973=>1000,35974=>1000,35975=>1000,35976=>1000,35977=>1000,35978=>1000,35979=>1000,35980=>1000,35981=>1000,35982=>1000,35983=>1000,35984=>1000,35985=>1000,35986=>1000,35987=>1000,35988=>1000, - 35989=>1000,35990=>1000,35991=>1000,35992=>1000,35993=>1000,35994=>1000,35995=>1000,35996=>1000,35997=>1000,35998=>1000,35999=>1000,36000=>1000,36001=>1000,36002=>1000,36003=>1000,36004=>1000, - 36005=>1000,36006=>1000,36007=>1000,36008=>1000,36009=>1000,36010=>1000,36011=>1000,36012=>1000,36013=>1000,36014=>1000,36015=>1000,36016=>1000,36017=>1000,36018=>1000,36019=>1000,36020=>1000, - 36021=>1000,36022=>1000,36023=>1000,36024=>1000,36025=>1000,36026=>1000,36027=>1000,36028=>1000,36029=>1000,36030=>1000,36031=>1000,36032=>1000,36033=>1000,36034=>1000,36035=>1000,36036=>1000, - 36037=>1000,36038=>1000,36039=>1000,36040=>1000,36041=>1000,36042=>1000,36043=>1000,36044=>1000,36045=>1000,36046=>1000,36047=>1000,36048=>1000,36049=>1000,36050=>1000,36051=>1000,36052=>1000, - 36053=>1000,36054=>1000,36055=>1000,36056=>1000,36057=>1000,36058=>1000,36059=>1000,36060=>1000,36061=>1000,36062=>1000,36063=>1000,36064=>1000,36065=>1000,36066=>1000,36067=>1000,36068=>1000, - 36069=>1000,36070=>1000,36071=>1000,36072=>1000,36073=>1000,36074=>1000,36075=>1000,36076=>1000,36077=>1000,36078=>1000,36079=>1000,36080=>1000,36081=>1000,36082=>1000,36083=>1000,36084=>1000, - 36085=>1000,36086=>1000,36087=>1000,36088=>1000,36089=>1000,36090=>1000,36091=>1000,36092=>1000,36093=>1000,36094=>1000,36095=>1000,36096=>1000,36097=>1000,36098=>1000,36099=>1000,36100=>1000, - 36101=>1000,36102=>1000,36103=>1000,36104=>1000,36105=>1000,36106=>1000,36107=>1000,36108=>1000,36109=>1000,36110=>1000,36111=>1000,36112=>1000,36113=>1000,36114=>1000,36115=>1000,36116=>1000, - 36117=>1000,36118=>1000,36119=>1000,36120=>1000,36121=>1000,36122=>1000,36123=>1000,36124=>1000,36125=>1000,36126=>1000,36127=>1000,36128=>1000,36129=>1000,36130=>1000,36131=>1000,36132=>1000, - 36133=>1000,36134=>1000,36135=>1000,36136=>1000,36137=>1000,36138=>1000,36139=>1000,36140=>1000,36141=>1000,36142=>1000,36143=>1000,36144=>1000,36145=>1000,36146=>1000,36147=>1000,36148=>1000, - 36149=>1000,36150=>1000,36151=>1000,36152=>1000,36153=>1000,36154=>1000,36155=>1000,36156=>1000,36157=>1000,36158=>1000,36159=>1000,36160=>1000,36161=>1000,36162=>1000,36163=>1000,36164=>1000, - 36165=>1000,36166=>1000,36167=>1000,36168=>1000,36169=>1000,36170=>1000,36171=>1000,36172=>1000,36173=>1000,36174=>1000,36175=>1000,36176=>1000,36177=>1000,36178=>1000,36179=>1000,36180=>1000, - 36181=>1000,36182=>1000,36183=>1000,36184=>1000,36185=>1000,36186=>1000,36187=>1000,36188=>1000,36189=>1000,36190=>1000,36191=>1000,36192=>1000,36193=>1000,36194=>1000,36195=>1000,36196=>1000, - 36197=>1000,36198=>1000,36199=>1000,36200=>1000,36201=>1000,36202=>1000,36203=>1000,36204=>1000,36205=>1000,36206=>1000,36207=>1000,36208=>1000,36209=>1000,36210=>1000,36211=>1000,36212=>1000, - 36213=>1000,36214=>1000,36215=>1000,36216=>1000,36217=>1000,36218=>1000,36219=>1000,36220=>1000,36221=>1000,36222=>1000,36223=>1000,36224=>1000,36225=>1000,36226=>1000,36227=>1000,36228=>1000, - 36229=>1000,36230=>1000,36231=>1000,36232=>1000,36233=>1000,36234=>1000,36235=>1000,36236=>1000,36237=>1000,36238=>1000,36239=>1000,36240=>1000,36241=>1000,36242=>1000,36243=>1000,36244=>1000, - 36245=>1000,36246=>1000,36247=>1000,36248=>1000,36249=>1000,36250=>1000,36251=>1000,36252=>1000,36253=>1000,36254=>1000,36255=>1000,36256=>1000,36257=>1000,36258=>1000,36259=>1000,36260=>1000, - 36261=>1000,36262=>1000,36263=>1000,36264=>1000,36265=>1000,36266=>1000,36267=>1000,36268=>1000,36269=>1000,36270=>1000,36271=>1000,36272=>1000,36273=>1000,36274=>1000,36275=>1000,36276=>1000, - 36277=>1000,36278=>1000,36279=>1000,36280=>1000,36281=>1000,36282=>1000,36283=>1000,36284=>1000,36285=>1000,36286=>1000,36287=>1000,36288=>1000,36289=>1000,36290=>1000,36291=>1000,36292=>1000, - 36293=>1000,36294=>1000,36295=>1000,36296=>1000,36297=>1000,36298=>1000,36299=>1000,36300=>1000,36301=>1000,36302=>1000,36303=>1000,36304=>1000,36305=>1000,36306=>1000,36307=>1000,36308=>1000, - 36309=>1000,36310=>1000,36311=>1000,36312=>1000,36313=>1000,36314=>1000,36315=>1000,36316=>1000,36317=>1000,36318=>1000,36319=>1000,36320=>1000,36321=>1000,36322=>1000,36323=>1000,36324=>1000, - 36325=>1000,36326=>1000,36327=>1000,36328=>1000,36329=>1000,36330=>1000,36331=>1000,36332=>1000,36333=>1000,36334=>1000,36335=>1000,36336=>1000,36337=>1000,36338=>1000,36339=>1000,36340=>1000, - 36341=>1000,36342=>1000,36343=>1000,36344=>1000,36345=>1000,36346=>1000,36347=>1000,36348=>1000,36349=>1000,36350=>1000,36351=>1000,36352=>1000,36353=>1000,36354=>1000,36355=>1000,36356=>1000, - 36357=>1000,36358=>1000,36359=>1000,36360=>1000,36361=>1000,36362=>1000,36363=>1000,36364=>1000,36365=>1000,36366=>1000,36367=>1000,36368=>1000,36369=>1000,36370=>1000,36371=>1000,36372=>1000, - 36373=>1000,36374=>1000,36375=>1000,36376=>1000,36377=>1000,36378=>1000,36379=>1000,36380=>1000,36381=>1000,36382=>1000,36383=>1000,36384=>1000,36385=>1000,36386=>1000,36387=>1000,36388=>1000, - 36389=>1000,36390=>1000,36391=>1000,36392=>1000,36393=>1000,36394=>1000,36395=>1000,36396=>1000,36397=>1000,36398=>1000,36399=>1000,36400=>1000,36401=>1000,36402=>1000,36403=>1000,36404=>1000, - 36405=>1000,36406=>1000,36407=>1000,36408=>1000,36409=>1000,36410=>1000,36411=>1000,36412=>1000,36413=>1000,36414=>1000,36415=>1000,36416=>1000,36417=>1000,36418=>1000,36419=>1000,36420=>1000, - 36421=>1000,36422=>1000,36423=>1000,36424=>1000,36425=>1000,36426=>1000,36427=>1000,36428=>1000,36429=>1000,36430=>1000,36431=>1000,36432=>1000,36433=>1000,36434=>1000,36435=>1000,36436=>1000, - 36437=>1000,36438=>1000,36439=>1000,36440=>1000,36441=>1000,36442=>1000,36443=>1000,36444=>1000,36445=>1000,36446=>1000,36447=>1000,36448=>1000,36449=>1000,36450=>1000,36451=>1000,36452=>1000, - 36453=>1000,36454=>1000,36455=>1000,36456=>1000,36457=>1000,36458=>1000,36459=>1000,36460=>1000,36461=>1000,36462=>1000,36463=>1000,36464=>1000,36465=>1000,36466=>1000,36467=>1000,36468=>1000, - 36469=>1000,36470=>1000,36471=>1000,36472=>1000,36473=>1000,36474=>1000,36475=>1000,36476=>1000,36477=>1000,36478=>1000,36479=>1000,36480=>1000,36481=>1000,36482=>1000,36483=>1000,36484=>1000, - 36485=>1000,36486=>1000,36487=>1000,36488=>1000,36489=>1000,36490=>1000,36491=>1000,36492=>1000,36493=>1000,36494=>1000,36495=>1000,36496=>1000,36497=>1000,36498=>1000,36499=>1000,36500=>1000, - 36501=>1000,36502=>1000,36503=>1000,36504=>1000,36505=>1000,36506=>1000,36507=>1000,36508=>1000,36509=>1000,36510=>1000,36511=>1000,36512=>1000,36513=>1000,36514=>1000,36515=>1000,36516=>1000, - 36517=>1000,36518=>1000,36519=>1000,36520=>1000,36521=>1000,36522=>1000,36523=>1000,36524=>1000,36525=>1000,36526=>1000,36527=>1000,36528=>1000,36529=>1000,36530=>1000,36531=>1000,36532=>1000, - 36533=>1000,36534=>1000,36535=>1000,36536=>1000,36537=>1000,36538=>1000,36539=>1000,36540=>1000,36541=>1000,36542=>1000,36543=>1000,36544=>1000,36545=>1000,36546=>1000,36547=>1000,36548=>1000, - 36549=>1000,36550=>1000,36551=>1000,36552=>1000,36553=>1000,36554=>1000,36555=>1000,36556=>1000,36557=>1000,36558=>1000,36559=>1000,36560=>1000,36561=>1000,36562=>1000,36563=>1000,36564=>1000, - 36565=>1000,36566=>1000,36567=>1000,36568=>1000,36569=>1000,36570=>1000,36571=>1000,36572=>1000,36573=>1000,36574=>1000,36575=>1000,36576=>1000,36577=>1000,36578=>1000,36579=>1000,36580=>1000, - 36581=>1000,36582=>1000,36583=>1000,36584=>1000,36585=>1000,36586=>1000,36587=>1000,36588=>1000,36589=>1000,36590=>1000,36591=>1000,36592=>1000,36593=>1000,36594=>1000,36595=>1000,36596=>1000, - 36597=>1000,36598=>1000,36599=>1000,36600=>1000,36601=>1000,36602=>1000,36603=>1000,36604=>1000,36605=>1000,36606=>1000,36607=>1000,36608=>1000,36609=>1000,36610=>1000,36611=>1000,36612=>1000, - 36613=>1000,36614=>1000,36615=>1000,36616=>1000,36617=>1000,36618=>1000,36619=>1000,36620=>1000,36621=>1000,36622=>1000,36623=>1000,36624=>1000,36625=>1000,36626=>1000,36627=>1000,36628=>1000, - 36629=>1000,36630=>1000,36631=>1000,36632=>1000,36633=>1000,36634=>1000,36635=>1000,36636=>1000,36637=>1000,36638=>1000,36639=>1000,36640=>1000,36641=>1000,36642=>1000,36643=>1000,36644=>1000, - 36645=>1000,36646=>1000,36647=>1000,36648=>1000,36649=>1000,36650=>1000,36651=>1000,36652=>1000,36653=>1000,36654=>1000,36655=>1000,36656=>1000,36657=>1000,36658=>1000,36659=>1000,36660=>1000, - 36661=>1000,36662=>1000,36663=>1000,36664=>1000,36665=>1000,36666=>1000,36667=>1000,36668=>1000,36669=>1000,36670=>1000,36671=>1000,36672=>1000,36673=>1000,36674=>1000,36675=>1000,36676=>1000, - 36677=>1000,36678=>1000,36679=>1000,36680=>1000,36681=>1000,36682=>1000,36683=>1000,36684=>1000,36685=>1000,36686=>1000,36687=>1000,36688=>1000,36689=>1000,36690=>1000,36691=>1000,36692=>1000, - 36693=>1000,36694=>1000,36695=>1000,36696=>1000,36697=>1000,36698=>1000,36699=>1000,36700=>1000,36701=>1000,36702=>1000,36703=>1000,36704=>1000,36705=>1000,36706=>1000,36707=>1000,36708=>1000, - 36709=>1000,36710=>1000,36711=>1000,36712=>1000,36713=>1000,36714=>1000,36715=>1000,36716=>1000,36717=>1000,36718=>1000,36719=>1000,36720=>1000,36721=>1000,36722=>1000,36723=>1000,36724=>1000, - 36725=>1000,36726=>1000,36727=>1000,36728=>1000,36729=>1000,36730=>1000,36731=>1000,36732=>1000,36733=>1000,36734=>1000,36735=>1000,36736=>1000,36737=>1000,36738=>1000,36739=>1000,36740=>1000, - 36741=>1000,36742=>1000,36743=>1000,36744=>1000,36745=>1000,36746=>1000,36747=>1000,36748=>1000,36749=>1000,36750=>1000,36751=>1000,36752=>1000,36753=>1000,36754=>1000,36755=>1000,36756=>1000, - 36757=>1000,36758=>1000,36759=>1000,36760=>1000,36761=>1000,36762=>1000,36763=>1000,36764=>1000,36765=>1000,36766=>1000,36767=>1000,36768=>1000,36769=>1000,36770=>1000,36771=>1000,36772=>1000, - 36773=>1000,36774=>1000,36775=>1000,36776=>1000,36777=>1000,36778=>1000,36779=>1000,36780=>1000,36781=>1000,36782=>1000,36783=>1000,36784=>1000,36785=>1000,36786=>1000,36787=>1000,36788=>1000, - 36789=>1000,36790=>1000,36791=>1000,36792=>1000,36793=>1000,36794=>1000,36795=>1000,36796=>1000,36797=>1000,36798=>1000,36799=>1000,36800=>1000,36801=>1000,36802=>1000,36803=>1000,36804=>1000, - 36805=>1000,36806=>1000,36807=>1000,36808=>1000,36809=>1000,36810=>1000,36811=>1000,36812=>1000,36813=>1000,36814=>1000,36815=>1000,36816=>1000,36817=>1000,36818=>1000,36819=>1000,36820=>1000, - 36821=>1000,36822=>1000,36823=>1000,36824=>1000,36825=>1000,36826=>1000,36827=>1000,36828=>1000,36829=>1000,36830=>1000,36831=>1000,36832=>1000,36833=>1000,36834=>1000,36835=>1000,36836=>1000, - 36837=>1000,36838=>1000,36839=>1000,36840=>1000,36841=>1000,36842=>1000,36843=>1000,36844=>1000,36845=>1000,36846=>1000,36847=>1000,36848=>1000,36849=>1000,36850=>1000,36851=>1000,36852=>1000, - 36853=>1000,36854=>1000,36855=>1000,36856=>1000,36857=>1000,36858=>1000,36859=>1000,36860=>1000,36861=>1000,36862=>1000,36863=>1000,36864=>1000,36865=>1000,36866=>1000,36867=>1000,36868=>1000, - 36869=>1000,36870=>1000,36871=>1000,36872=>1000,36873=>1000,36874=>1000,36875=>1000,36876=>1000,36877=>1000,36878=>1000,36879=>1000,36880=>1000,36881=>1000,36882=>1000,36883=>1000,36884=>1000, - 36885=>1000,36886=>1000,36887=>1000,36888=>1000,36889=>1000,36890=>1000,36891=>1000,36892=>1000,36893=>1000,36894=>1000,36895=>1000,36896=>1000,36897=>1000,36898=>1000,36899=>1000,36900=>1000, - 36901=>1000,36902=>1000,36903=>1000,36904=>1000,36905=>1000,36906=>1000,36907=>1000,36908=>1000,36909=>1000,36910=>1000,36911=>1000,36912=>1000,36913=>1000,36914=>1000,36915=>1000,36916=>1000, - 36917=>1000,36918=>1000,36919=>1000,36920=>1000,36921=>1000,36922=>1000,36923=>1000,36924=>1000,36925=>1000,36926=>1000,36927=>1000,36928=>1000,36929=>1000,36930=>1000,36931=>1000,36932=>1000, - 36933=>1000,36934=>1000,36935=>1000,36936=>1000,36937=>1000,36938=>1000,36939=>1000,36940=>1000,36941=>1000,36942=>1000,36943=>1000,36944=>1000,36945=>1000,36946=>1000,36947=>1000,36948=>1000, - 36949=>1000,36950=>1000,36951=>1000,36952=>1000,36953=>1000,36954=>1000,36955=>1000,36956=>1000,36957=>1000,36958=>1000,36959=>1000,36960=>1000,36961=>1000,36962=>1000,36963=>1000,36964=>1000, - 36965=>1000,36966=>1000,36967=>1000,36968=>1000,36969=>1000,36970=>1000,36971=>1000,36972=>1000,36973=>1000,36974=>1000,36975=>1000,36976=>1000,36977=>1000,36978=>1000,36979=>1000,36980=>1000, - 36981=>1000,36982=>1000,36983=>1000,36984=>1000,36985=>1000,36986=>1000,36987=>1000,36988=>1000,36989=>1000,36990=>1000,36991=>1000,36992=>1000,36993=>1000,36994=>1000,36995=>1000,36996=>1000, - 36997=>1000,36998=>1000,36999=>1000,37000=>1000,37001=>1000,37002=>1000,37003=>1000,37004=>1000,37005=>1000,37006=>1000,37007=>1000,37008=>1000,37009=>1000,37010=>1000,37011=>1000,37012=>1000, - 37013=>1000,37014=>1000,37015=>1000,37016=>1000,37017=>1000,37018=>1000,37019=>1000,37020=>1000,37021=>1000,37022=>1000,37023=>1000,37024=>1000,37025=>1000,37026=>1000,37027=>1000,37028=>1000, - 37029=>1000,37030=>1000,37031=>1000,37032=>1000,37033=>1000,37034=>1000,37035=>1000,37036=>1000,37037=>1000,37038=>1000,37039=>1000,37040=>1000,37041=>1000,37042=>1000,37043=>1000,37044=>1000, - 37045=>1000,37046=>1000,37047=>1000,37048=>1000,37049=>1000,37050=>1000,37051=>1000,37052=>1000,37053=>1000,37054=>1000,37055=>1000,37056=>1000,37057=>1000,37058=>1000,37059=>1000,37060=>1000, - 37061=>1000,37062=>1000,37063=>1000,37064=>1000,37065=>1000,37066=>1000,37067=>1000,37068=>1000,37069=>1000,37070=>1000,37071=>1000,37072=>1000,37073=>1000,37074=>1000,37075=>1000,37076=>1000, - 37077=>1000,37078=>1000,37079=>1000,37080=>1000,37081=>1000,37082=>1000,37083=>1000,37084=>1000,37085=>1000,37086=>1000,37087=>1000,37088=>1000,37089=>1000,37090=>1000,37091=>1000,37092=>1000, - 37093=>1000,37094=>1000,37095=>1000,37096=>1000,37097=>1000,37098=>1000,37099=>1000,37100=>1000,37101=>1000,37102=>1000,37103=>1000,37104=>1000,37105=>1000,37106=>1000,37107=>1000,37108=>1000, - 37109=>1000,37110=>1000,37111=>1000,37112=>1000,37113=>1000,37114=>1000,37115=>1000,37116=>1000,37117=>1000,37118=>1000,37119=>1000,37120=>1000,37121=>1000,37122=>1000,37123=>1000,37124=>1000, - 37125=>1000,37126=>1000,37127=>1000,37128=>1000,37129=>1000,37130=>1000,37131=>1000,37132=>1000,37133=>1000,37134=>1000,37135=>1000,37136=>1000,37137=>1000,37138=>1000,37139=>1000,37140=>1000, - 37141=>1000,37142=>1000,37143=>1000,37144=>1000,37145=>1000,37146=>1000,37147=>1000,37148=>1000,37149=>1000,37150=>1000,37151=>1000,37152=>1000,37153=>1000,37154=>1000,37155=>1000,37156=>1000, - 37157=>1000,37158=>1000,37159=>1000,37160=>1000,37161=>1000,37162=>1000,37163=>1000,37164=>1000,37165=>1000,37166=>1000,37167=>1000,37168=>1000,37169=>1000,37170=>1000,37171=>1000,37172=>1000, - 37173=>1000,37174=>1000,37175=>1000,37176=>1000,37177=>1000,37178=>1000,37179=>1000,37180=>1000,37181=>1000,37182=>1000,37183=>1000,37184=>1000,37185=>1000,37186=>1000,37187=>1000,37188=>1000, - 37189=>1000,37190=>1000,37191=>1000,37192=>1000,37193=>1000,37194=>1000,37195=>1000,37196=>1000,37197=>1000,37198=>1000,37199=>1000,37200=>1000,37201=>1000,37202=>1000,37203=>1000,37204=>1000, - 37205=>1000,37206=>1000,37207=>1000,37208=>1000,37209=>1000,37210=>1000,37211=>1000,37212=>1000,37213=>1000,37214=>1000,37215=>1000,37216=>1000,37217=>1000,37218=>1000,37219=>1000,37220=>1000, - 37221=>1000,37222=>1000,37223=>1000,37224=>1000,37225=>1000,37226=>1000,37227=>1000,37228=>1000,37229=>1000,37230=>1000,37231=>1000,37232=>1000,37233=>1000,37234=>1000,37235=>1000,37236=>1000, - 37237=>1000,37238=>1000,37239=>1000,37240=>1000,37241=>1000,37242=>1000,37243=>1000,37244=>1000,37245=>1000,37246=>1000,37247=>1000,37248=>1000,37249=>1000,37250=>1000,37251=>1000,37252=>1000, - 37253=>1000,37254=>1000,37255=>1000,37256=>1000,37257=>1000,37258=>1000,37259=>1000,37260=>1000,37261=>1000,37262=>1000,37263=>1000,37264=>1000,37265=>1000,37266=>1000,37267=>1000,37268=>1000, - 37269=>1000,37270=>1000,37271=>1000,37272=>1000,37273=>1000,37274=>1000,37275=>1000,37276=>1000,37277=>1000,37278=>1000,37279=>1000,37280=>1000,37281=>1000,37282=>1000,37283=>1000,37284=>1000, - 37285=>1000,37286=>1000,37287=>1000,37288=>1000,37289=>1000,37290=>1000,37291=>1000,37292=>1000,37293=>1000,37294=>1000,37295=>1000,37296=>1000,37297=>1000,37298=>1000,37299=>1000,37300=>1000, - 37301=>1000,37302=>1000,37303=>1000,37304=>1000,37305=>1000,37306=>1000,37307=>1000,37308=>1000,37309=>1000,37310=>1000,37311=>1000,37312=>1000,37313=>1000,37314=>1000,37315=>1000,37316=>1000, - 37317=>1000,37318=>1000,37319=>1000,37320=>1000,37321=>1000,37322=>1000,37323=>1000,37324=>1000,37325=>1000,37326=>1000,37327=>1000,37328=>1000,37329=>1000,37330=>1000,37331=>1000,37332=>1000, - 37333=>1000,37334=>1000,37335=>1000,37336=>1000,37337=>1000,37338=>1000,37339=>1000,37340=>1000,37341=>1000,37342=>1000,37343=>1000,37344=>1000,37345=>1000,37346=>1000,37347=>1000,37348=>1000, - 37349=>1000,37350=>1000,37351=>1000,37352=>1000,37353=>1000,37354=>1000,37355=>1000,37356=>1000,37357=>1000,37358=>1000,37359=>1000,37360=>1000,37361=>1000,37362=>1000,37363=>1000,37364=>1000, - 37365=>1000,37366=>1000,37367=>1000,37368=>1000,37369=>1000,37370=>1000,37371=>1000,37372=>1000,37373=>1000,37374=>1000,37375=>1000,37376=>1000,37377=>1000,37378=>1000,37379=>1000,37380=>1000, - 37381=>1000,37382=>1000,37383=>1000,37384=>1000,37385=>1000,37386=>1000,37387=>1000,37388=>1000,37389=>1000,37390=>1000,37391=>1000,37392=>1000,37393=>1000,37394=>1000,37395=>1000,37396=>1000, - 37397=>1000,37398=>1000,37399=>1000,37400=>1000,37401=>1000,37402=>1000,37403=>1000,37404=>1000,37405=>1000,37406=>1000,37407=>1000,37408=>1000,37409=>1000,37410=>1000,37411=>1000,37412=>1000, - 37413=>1000,37414=>1000,37415=>1000,37416=>1000,37417=>1000,37418=>1000,37419=>1000,37420=>1000,37421=>1000,37422=>1000,37423=>1000,37424=>1000,37425=>1000,37426=>1000,37427=>1000,37428=>1000, - 37429=>1000,37430=>1000,37431=>1000,37432=>1000,37433=>1000,37434=>1000,37435=>1000,37436=>1000,37437=>1000,37438=>1000,37439=>1000,37440=>1000,37441=>1000,37442=>1000,37443=>1000,37444=>1000, - 37445=>1000,37446=>1000,37447=>1000,37448=>1000,37449=>1000,37450=>1000,37451=>1000,37452=>1000,37453=>1000,37454=>1000,37455=>1000,37456=>1000,37457=>1000,37458=>1000,37459=>1000,37460=>1000, - 37461=>1000,37462=>1000,37463=>1000,37464=>1000,37465=>1000,37466=>1000,37467=>1000,37468=>1000,37469=>1000,37470=>1000,37471=>1000,37472=>1000,37473=>1000,37474=>1000,37475=>1000,37476=>1000, - 37477=>1000,37478=>1000,37479=>1000,37480=>1000,37481=>1000,37482=>1000,37483=>1000,37484=>1000,37485=>1000,37486=>1000,37487=>1000,37488=>1000,37489=>1000,37490=>1000,37491=>1000,37492=>1000, - 37493=>1000,37494=>1000,37495=>1000,37496=>1000,37497=>1000,37498=>1000,37499=>1000,37500=>1000,37501=>1000,37502=>1000,37503=>1000,37504=>1000,37505=>1000,37506=>1000,37507=>1000,37508=>1000, - 37509=>1000,37510=>1000,37511=>1000,37512=>1000,37513=>1000,37514=>1000,37515=>1000,37516=>1000,37517=>1000,37518=>1000,37519=>1000,37520=>1000,37521=>1000,37522=>1000,37523=>1000,37524=>1000, - 37525=>1000,37526=>1000,37527=>1000,37528=>1000,37529=>1000,37530=>1000,37531=>1000,37532=>1000,37533=>1000,37534=>1000,37535=>1000,37536=>1000,37537=>1000,37538=>1000,37539=>1000,37540=>1000, - 37541=>1000,37542=>1000,37543=>1000,37544=>1000,37545=>1000,37546=>1000,37547=>1000,37548=>1000,37549=>1000,37550=>1000,37551=>1000,37552=>1000,37553=>1000,37554=>1000,37555=>1000,37556=>1000, - 37557=>1000,37558=>1000,37559=>1000,37560=>1000,37561=>1000,37562=>1000,37563=>1000,37564=>1000,37565=>1000,37566=>1000,37567=>1000,37568=>1000,37569=>1000,37570=>1000,37571=>1000,37572=>1000, - 37573=>1000,37574=>1000,37575=>1000,37576=>1000,37577=>1000,37578=>1000,37579=>1000,37580=>1000,37581=>1000,37582=>1000,37583=>1000,37584=>1000,37585=>1000,37586=>1000,37587=>1000,37588=>1000, - 37589=>1000,37590=>1000,37591=>1000,37592=>1000,37593=>1000,37594=>1000,37595=>1000,37596=>1000,37597=>1000,37598=>1000,37599=>1000,37600=>1000,37601=>1000,37602=>1000,37603=>1000,37604=>1000, - 37605=>1000,37606=>1000,37607=>1000,37608=>1000,37609=>1000,37610=>1000,37611=>1000,37612=>1000,37613=>1000,37614=>1000,37615=>1000,37616=>1000,37617=>1000,37618=>1000,37619=>1000,37620=>1000, - 37621=>1000,37622=>1000,37623=>1000,37624=>1000,37625=>1000,37626=>1000,37627=>1000,37628=>1000,37629=>1000,37630=>1000,37631=>1000,37632=>1000,37633=>1000,37634=>1000,37635=>1000,37636=>1000, - 37637=>1000,37638=>1000,37639=>1000,37640=>1000,37641=>1000,37642=>1000,37643=>1000,37644=>1000,37645=>1000,37646=>1000,37647=>1000,37648=>1000,37649=>1000,37650=>1000,37651=>1000,37652=>1000, - 37653=>1000,37654=>1000,37655=>1000,37656=>1000,37657=>1000,37658=>1000,37659=>1000,37660=>1000,37661=>1000,37662=>1000,37663=>1000,37664=>1000,37665=>1000,37666=>1000,37667=>1000,37668=>1000, - 37669=>1000,37670=>1000,37671=>1000,37672=>1000,37673=>1000,37674=>1000,37675=>1000,37676=>1000,37677=>1000,37678=>1000,37679=>1000,37680=>1000,37681=>1000,37682=>1000,37683=>1000,37684=>1000, - 37685=>1000,37686=>1000,37687=>1000,37688=>1000,37689=>1000,37690=>1000,37691=>1000,37692=>1000,37693=>1000,37694=>1000,37695=>1000,37696=>1000,37697=>1000,37698=>1000,37699=>1000,37700=>1000, - 37701=>1000,37702=>1000,37703=>1000,37704=>1000,37705=>1000,37706=>1000,37707=>1000,37708=>1000,37709=>1000,37710=>1000,37711=>1000,37712=>1000,37713=>1000,37714=>1000,37715=>1000,37716=>1000, - 37717=>1000,37718=>1000,37719=>1000,37720=>1000,37721=>1000,37722=>1000,37723=>1000,37724=>1000,37725=>1000,37726=>1000,37727=>1000,37728=>1000,37729=>1000,37730=>1000,37731=>1000,37732=>1000, - 37733=>1000,37734=>1000,37735=>1000,37736=>1000,37737=>1000,37738=>1000,37739=>1000,37740=>1000,37741=>1000,37742=>1000,37743=>1000,37744=>1000,37745=>1000,37746=>1000,37747=>1000,37748=>1000, - 37749=>1000,37750=>1000,37751=>1000,37752=>1000,37753=>1000,37754=>1000,37755=>1000,37756=>1000,37757=>1000,37758=>1000,37759=>1000,37760=>1000,37761=>1000,37762=>1000,37763=>1000,37764=>1000, - 37765=>1000,37766=>1000,37767=>1000,37768=>1000,37769=>1000,37770=>1000,37771=>1000,37772=>1000,37773=>1000,37774=>1000,37775=>1000,37776=>1000,37777=>1000,37778=>1000,37779=>1000,37780=>1000, - 37781=>1000,37782=>1000,37783=>1000,37784=>1000,37785=>1000,37786=>1000,37787=>1000,37788=>1000,37789=>1000,37790=>1000,37791=>1000,37792=>1000,37793=>1000,37794=>1000,37795=>1000,37796=>1000, - 37797=>1000,37798=>1000,37799=>1000,37800=>1000,37801=>1000,37802=>1000,37803=>1000,37804=>1000,37805=>1000,37806=>1000,37807=>1000,37808=>1000,37809=>1000,37810=>1000,37811=>1000,37812=>1000, - 37813=>1000,37814=>1000,37815=>1000,37816=>1000,37817=>1000,37818=>1000,37819=>1000,37820=>1000,37821=>1000,37822=>1000,37823=>1000,37824=>1000,37825=>1000,37826=>1000,37827=>1000,37828=>1000, - 37829=>1000,37830=>1000,37831=>1000,37832=>1000,37833=>1000,37834=>1000,37835=>1000,37836=>1000,37837=>1000,37838=>1000,37839=>1000,37840=>1000,37841=>1000,37842=>1000,37843=>1000,37844=>1000, - 37845=>1000,37846=>1000,37847=>1000,37848=>1000,37849=>1000,37850=>1000,37851=>1000,37852=>1000,37853=>1000,37854=>1000,37855=>1000,37856=>1000,37857=>1000,37858=>1000,37859=>1000,37860=>1000, - 37861=>1000,37862=>1000,37863=>1000,37864=>1000,37865=>1000,37866=>1000,37867=>1000,37868=>1000,37869=>1000,37870=>1000,37871=>1000,37872=>1000,37873=>1000,37874=>1000,37875=>1000,37876=>1000, - 37877=>1000,37878=>1000,37879=>1000,37880=>1000,37881=>1000,37882=>1000,37883=>1000,37884=>1000,37885=>1000,37886=>1000,37887=>1000,37888=>1000,37889=>1000,37890=>1000,37891=>1000,37892=>1000, - 37893=>1000,37894=>1000,37895=>1000,37896=>1000,37897=>1000,37898=>1000,37899=>1000,37900=>1000,37901=>1000,37902=>1000,37903=>1000,37904=>1000,37905=>1000,37906=>1000,37907=>1000,37908=>1000, - 37909=>1000,37910=>1000,37911=>1000,37912=>1000,37913=>1000,37914=>1000,37915=>1000,37916=>1000,37917=>1000,37918=>1000,37919=>1000,37920=>1000,37921=>1000,37922=>1000,37923=>1000,37924=>1000, - 37925=>1000,37926=>1000,37927=>998,37928=>1000,37929=>1000,37930=>1000,37931=>1000,37932=>1000,37933=>1000,37934=>1000,37935=>1000,37936=>1000,37937=>1000,37938=>1000,37939=>1000,37940=>1000, - 37941=>1000,37942=>1000,37943=>1000,37944=>1000,37945=>1000,37946=>1000,37947=>1000,37948=>1000,37949=>1000,37950=>1000,37951=>1000,37952=>1000,37953=>1000,37954=>1000,37955=>1000,37956=>1000, - 37957=>1000,37958=>1000,37959=>1000,37960=>1000,37961=>1000,37962=>1000,37963=>1000,37964=>1000,37965=>1000,37966=>1000,37967=>1000,37968=>1000,37969=>1000,37970=>1000,37971=>1000,37972=>1000, - 37973=>1000,37974=>1000,37975=>1000,37976=>1000,37977=>1000,37978=>1000,37979=>1000,37980=>1000,37981=>1000,37982=>1000,37983=>1000,37984=>1000,37985=>1000,37986=>1000,37987=>1000,37988=>1000, - 37989=>1000,37990=>1000,37991=>1000,37992=>1000,37993=>1000,37994=>1000,37995=>1000,37996=>1000,37997=>1000,37998=>1000,37999=>1000,38000=>1000,38001=>1000,38002=>1000,38003=>1000,38004=>1000, - 38005=>1000,38006=>1000,38007=>1000,38008=>1000,38009=>1000,38010=>1000,38011=>1000,38012=>1000,38013=>1000,38014=>1000,38015=>1000,38016=>1000,38017=>1000,38018=>1000,38019=>1000,38020=>1000, - 38021=>1000,38022=>1000,38023=>1000,38024=>1000,38025=>1000,38026=>1000,38027=>1000,38028=>1000,38029=>1000,38030=>1000,38031=>1000,38032=>1000,38033=>1000,38034=>1000,38035=>1000,38036=>1000, - 38037=>1000,38038=>1000,38039=>1000,38040=>1000,38041=>1000,38042=>1000,38043=>1000,38044=>1000,38045=>1000,38046=>1000,38047=>1000,38048=>1000,38049=>1000,38050=>1000,38051=>1000,38052=>1000, - 38053=>1000,38054=>1000,38055=>1000,38056=>1000,38057=>1000,38058=>1000,38059=>1000,38060=>1000,38061=>1000,38062=>1000,38063=>1000,38064=>1000,38065=>1000,38066=>1000,38067=>1000,38068=>1000, - 38069=>1000,38070=>1000,38071=>1000,38072=>1000,38073=>1000,38074=>1000,38075=>1000,38076=>1000,38077=>1000,38078=>1000,38079=>1000,38080=>1000,38081=>1000,38082=>1000,38083=>1000,38084=>1000, - 38085=>1000,38086=>1000,38087=>1000,38088=>1000,38089=>1000,38090=>1000,38091=>1000,38092=>1000,38093=>1000,38094=>1000,38095=>1000,38096=>1000,38097=>1000,38098=>1000,38099=>1000,38100=>1000, - 38101=>1000,38102=>1000,38103=>1000,38104=>1000,38105=>1000,38106=>1000,38107=>1000,38108=>1000,38109=>1000,38110=>1000,38111=>1000,38112=>1000,38113=>1000,38114=>1000,38115=>1000,38116=>1000, - 38117=>1000,38118=>1000,38119=>1000,38120=>1000,38121=>1000,38122=>1000,38123=>1000,38124=>1000,38125=>1000,38126=>1000,38127=>1000,38128=>1000,38129=>1000,38130=>1000,38131=>1000,38132=>1000, - 38133=>1000,38134=>1000,38135=>1000,38136=>1000,38137=>1000,38138=>1000,38139=>1000,38140=>1000,38141=>1000,38142=>1000,38143=>1000,38144=>1000,38145=>1000,38146=>1000,38147=>1000,38148=>1000, - 38149=>1000,38150=>1000,38151=>1000,38152=>1000,38153=>1000,38154=>1000,38155=>1000,38156=>1000,38157=>1000,38158=>1000,38159=>1000,38160=>1000,38161=>1000,38162=>1000,38163=>1000,38164=>1000, - 38165=>1000,38166=>1000,38167=>1000,38168=>1000,38169=>1000,38170=>1000,38171=>1000,38172=>1000,38173=>1000,38174=>1000,38175=>1000,38176=>1000,38177=>1000,38178=>1000,38179=>1000,38180=>1000, - 38181=>1000,38182=>1000,38183=>1000,38184=>1000,38185=>1000,38186=>1000,38187=>1000,38188=>1000,38189=>1000,38190=>1000,38191=>1000,38192=>1000,38193=>1000,38194=>1000,38195=>1000,38196=>1000, - 38197=>1000,38198=>1000,38199=>1000,38200=>1000,38201=>1000,38202=>1000,38203=>1000,38204=>1000,38205=>1000,38206=>1000,38207=>1000,38208=>1000,38209=>1000,38210=>1000,38211=>1000,38212=>1000, - 38213=>1000,38214=>1000,38215=>1000,38216=>1000,38217=>1000,38218=>1000,38219=>1000,38220=>1000,38221=>1000,38222=>1000,38223=>1000,38224=>1000,38225=>1000,38226=>1000,38227=>1000,38228=>1000, - 38229=>1000,38230=>1000,38231=>1000,38232=>1000,38233=>1000,38234=>1000,38235=>1000,38236=>1000,38237=>1000,38238=>1000,38239=>1000,38240=>1000,38241=>1000,38242=>1000,38243=>1000,38244=>1000, - 38245=>1000,38246=>1000,38247=>1000,38248=>1000,38249=>1000,38250=>1000,38251=>1000,38252=>1000,38253=>1000,38254=>1000,38255=>1000,38256=>1000,38257=>1000,38258=>1000,38259=>1000,38260=>1000, - 38261=>1000,38262=>1000,38263=>1000,38264=>1000,38265=>1000,38266=>1000,38267=>1000,38268=>1000,38269=>1000,38270=>1000,38271=>1000,38272=>1000,38273=>1000,38274=>1000,38275=>1000,38276=>1000, - 38277=>1000,38278=>1000,38279=>1000,38280=>1000,38281=>1000,38282=>1000,38283=>1000,38284=>1000,38285=>1000,38286=>1000,38287=>1000,38288=>1000,38289=>1000,38290=>1000,38291=>1000,38292=>1000, - 38293=>1000,38294=>1000,38295=>1000,38296=>1000,38297=>1000,38298=>1000,38299=>1000,38300=>1000,38301=>1000,38302=>1000,38303=>1000,38304=>1000,38305=>1000,38306=>1000,38307=>1000,38308=>1000, - 38309=>1000,38310=>1000,38311=>1000,38312=>1000,38313=>1000,38314=>1000,38315=>1000,38316=>1000,38317=>1000,38318=>1000,38319=>1000,38320=>1000,38321=>1000,38322=>1000,38323=>1000,38324=>1000, - 38325=>1000,38326=>1000,38327=>1000,38328=>1000,38329=>1000,38330=>1000,38331=>1000,38332=>1000,38333=>1000,38334=>1000,38335=>1000,38336=>1000,38337=>1000,38338=>1000,38339=>1000,38340=>1000, - 38341=>1000,38342=>1000,38343=>1000,38344=>1000,38345=>1000,38346=>1000,38347=>1000,38348=>1000,38349=>1000,38350=>1000,38351=>1000,38352=>1000,38353=>1000,38354=>1000,38355=>1000,38356=>1000, - 38357=>1000,38358=>1000,38359=>1000,38360=>1000,38361=>1000,38362=>1000,38363=>1000,38364=>1000,38365=>1000,38366=>1000,38367=>1000,38368=>1000,38369=>1000,38370=>1000,38371=>1000,38372=>1000, - 38373=>1000,38374=>1000,38375=>1000,38376=>1000,38377=>1000,38378=>1000,38379=>1000,38380=>1000,38381=>1000,38382=>1000,38383=>1000,38384=>1000,38385=>1000,38386=>1000,38387=>1000,38388=>1000, - 38389=>1000,38390=>1000,38391=>1000,38392=>1000,38393=>1000,38394=>1000,38395=>1000,38396=>1000,38397=>1000,38398=>1000,38399=>1000,38400=>1000,38401=>1000,38402=>1000,38403=>1000,38404=>1000, - 38405=>1000,38406=>1000,38407=>1000,38408=>1000,38409=>1000,38410=>1000,38411=>1000,38412=>1000,38413=>1000,38414=>1000,38415=>1000,38416=>1000,38417=>1000,38418=>1000,38419=>1000,38420=>1000, - 38421=>1000,38422=>1000,38423=>1000,38424=>1000,38425=>1000,38426=>1000,38427=>1000,38428=>1000,38429=>1000,38430=>1000,38431=>1000,38432=>1000,38433=>1000,38434=>1000,38435=>1000,38436=>1000, - 38437=>1000,38438=>1000,38439=>1000,38440=>1000,38441=>1000,38442=>1000,38443=>1000,38444=>1000,38445=>1000,38446=>1000,38447=>1000,38448=>1000,38449=>1000,38450=>1000,38451=>1000,38452=>1000, - 38453=>1000,38454=>1000,38455=>1000,38456=>1000,38457=>1000,38458=>1000,38459=>1000,38460=>1000,38461=>1000,38462=>1000,38463=>1000,38464=>1000,38465=>1000,38466=>1000,38467=>1000,38468=>1000, - 38469=>1000,38470=>1000,38471=>1000,38472=>1000,38473=>1000,38474=>1000,38475=>1000,38476=>1000,38477=>1000,38478=>1000,38479=>1000,38480=>1000,38481=>1000,38482=>1000,38483=>1000,38484=>1000, - 38485=>1000,38486=>1000,38487=>1000,38488=>1000,38489=>1000,38490=>1000,38491=>1000,38492=>1000,38493=>1000,38494=>1000,38495=>1000,38496=>1000,38497=>1000,38498=>1000,38499=>1000,38500=>1000, - 38501=>1000,38502=>1000,38503=>1000,38504=>1000,38505=>1000,38506=>1000,38507=>1000,38508=>1000,38509=>1000,38510=>1000,38511=>1000,38512=>1000,38513=>1000,38514=>1000,38515=>1000,38516=>1000, - 38517=>1000,38518=>1000,38519=>1000,38520=>1000,38521=>1000,38522=>1000,38523=>1000,38524=>1000,38525=>1000,38526=>1000,38527=>1000,38528=>1000,38529=>1000,38530=>1000,38531=>1000,38532=>1000, - 38533=>1000,38534=>1000,38535=>1000,38536=>1000,38537=>1000,38538=>1000,38539=>1000,38540=>1000,38541=>1000,38542=>1000,38543=>1000,38544=>1000,38545=>1000,38546=>1000,38547=>1000,38548=>1000, - 38549=>1000,38550=>1000,38551=>1000,38552=>1000,38553=>1000,38554=>1000,38555=>1000,38556=>1000,38557=>1000,38558=>1000,38559=>1000,38560=>1000,38561=>1000,38562=>1000,38563=>1000,38564=>1000, - 38565=>1000,38566=>1000,38567=>1000,38568=>1000,38569=>1000,38570=>1000,38571=>1000,38572=>1000,38573=>1000,38574=>1000,38575=>1000,38576=>1000,38577=>1000,38578=>1000,38579=>1000,38580=>1000, - 38581=>1000,38582=>1000,38583=>1000,38584=>1000,38585=>1000,38586=>1000,38587=>1000,38588=>1000,38589=>1000,38590=>1000,38591=>1000,38592=>1000,38593=>1000,38594=>1000,38595=>1000,38596=>1000, - 38597=>1000,38598=>1000,38599=>1000,38600=>1000,38601=>1000,38602=>1000,38603=>1000,38604=>1000,38605=>1000,38606=>1000,38607=>1000,38608=>1000,38609=>1000,38610=>1000,38611=>1000,38612=>1000, - 38613=>1000,38614=>1000,38615=>1000,38616=>1000,38617=>1000,38618=>1000,38619=>1000,38620=>1000,38621=>1000,38622=>1000,38623=>1000,38624=>1000,38625=>1000,38626=>1000,38627=>1000,38628=>1000, - 38629=>1000,38630=>1000,38631=>1000,38632=>1000,38633=>1000,38634=>1000,38635=>1000,38636=>1000,38637=>1000,38638=>1000,38639=>1000,38640=>1000,38641=>1000,38642=>1000,38643=>1000,38644=>1000, - 38645=>1000,38646=>1000,38647=>1000,38648=>1000,38649=>1000,38650=>1000,38651=>1000,38652=>1000,38653=>1000,38654=>1000,38655=>1000,38656=>1000,38657=>1000,38658=>1000,38659=>1000,38660=>1000, - 38661=>1000,38662=>1000,38663=>1000,38664=>1000,38665=>1000,38666=>1000,38667=>1000,38668=>1000,38669=>1000,38670=>1000,38671=>1000,38672=>1000,38673=>1000,38674=>1000,38675=>1000,38676=>1000, - 38677=>1000,38678=>1000,38679=>1000,38680=>1000,38681=>1000,38682=>1000,38683=>1000,38684=>1000,38685=>1000,38686=>1000,38687=>1000,38688=>1000,38689=>1000,38690=>1000,38691=>1000,38692=>1000, - 38693=>1000,38694=>1000,38695=>1000,38696=>1000,38697=>1000,38698=>1000,38699=>1000,38700=>1000,38701=>1000,38702=>1000,38703=>1000,38704=>1000,38705=>1000,38706=>1000,38707=>1000,38708=>1000, - 38709=>1000,38710=>1000,38711=>1000,38712=>1000,38713=>1000,38714=>1000,38715=>1000,38716=>1000,38717=>1000,38718=>1000,38719=>1000,38720=>1000,38721=>1000,38722=>1000,38723=>1000,38724=>1000, - 38725=>1000,38726=>1000,38727=>1000,38728=>1000,38729=>1000,38730=>1000,38731=>1000,38732=>1000,38733=>1000,38734=>1000,38735=>1000,38736=>1000,38737=>1000,38738=>1000,38739=>1000,38740=>1000, - 38741=>1000,38742=>1000,38743=>1000,38744=>1000,38745=>1000,38746=>1000,38747=>1000,38748=>1000,38749=>1000,38750=>1000,38751=>1000,38752=>1000,38753=>1000,38754=>1000,38755=>1000,38756=>1000, - 38757=>1000,38758=>1000,38759=>1000,38760=>1000,38761=>1000,38762=>1000,38763=>1000,38764=>1000,38765=>1000,38766=>1000,38767=>1000,38768=>1000,38769=>1000,38770=>1000,38771=>1000,38772=>1000, - 38773=>1000,38774=>1000,38775=>1000,38776=>1000,38777=>1000,38778=>1000,38779=>1000,38780=>1000,38781=>1000,38782=>1000,38783=>1000,38784=>1000,38785=>1000,38786=>1000,38787=>1000,38788=>1000, - 38789=>1000,38790=>1000,38791=>1000,38792=>1000,38793=>1000,38794=>1000,38795=>1000,38796=>1000,38797=>1000,38798=>1000,38799=>1000,38800=>1000,38801=>1000,38802=>1000,38803=>1000,38804=>1000, - 38805=>1000,38806=>1000,38807=>1000,38808=>1000,38809=>1000,38810=>1000,38811=>1000,38812=>1000,38813=>1000,38814=>1000,38815=>1000,38816=>1000,38817=>1000,38818=>1000,38819=>1000,38820=>1000, - 38821=>1000,38822=>1000,38823=>1000,38824=>1000,38825=>1000,38826=>1000,38827=>1000,38828=>1000,38829=>1000,38830=>1000,38831=>1000,38832=>1000,38833=>1000,38834=>1000,38835=>1000,38836=>1000, - 38837=>1000,38838=>1000,38839=>1000,38840=>1000,38841=>1000,38842=>1000,38843=>1000,38844=>1000,38845=>1000,38846=>1000,38847=>1000,38848=>1000,38849=>1000,38850=>1000,38851=>1000,38852=>1000, - 38853=>1000,38854=>1000,38855=>1000,38856=>1000,38857=>1000,38858=>1000,38859=>1000,38860=>1000,38861=>1000,38862=>1000,38863=>1000,38864=>1000,38865=>1000,38866=>1000,38867=>1000,38868=>1000, - 38869=>1000,38870=>1000,38871=>1000,38872=>1000,38873=>1000,38874=>1000,38875=>1000,38876=>1000,38877=>1000,38878=>1000,38879=>1000,38880=>1000,38881=>1000,38882=>1000,38883=>1000,38884=>1000, - 38885=>1000,38886=>1000,38887=>1000,38888=>1000,38889=>1000,38890=>1000,38891=>1000,38892=>1000,38893=>1000,38894=>1000,38895=>1000,38896=>1000,38897=>1000,38898=>1000,38899=>1000,38900=>1000, - 38901=>1000,38902=>1000,38903=>1000,38904=>1000,38905=>1000,38906=>1000,38907=>1000,38908=>1000,38909=>1000,38910=>1000,38911=>1000,38912=>1000,38913=>1000,38914=>1000,38915=>1000,38916=>1000, - 38917=>1000,38918=>1000,38919=>1000,38920=>1000,38921=>1000,38922=>1000,38923=>1000,38924=>1000,38925=>1000,38926=>1000,38927=>1000,38928=>1000,38929=>1000,38930=>1000,38931=>1000,38932=>1000, - 38933=>1000,38934=>1000,38935=>1000,38936=>1000,38937=>1000,38938=>1000,38939=>1000,38940=>1000,38941=>1000,38942=>1000,38943=>1000,38944=>1000,38945=>1000,38946=>1000,38947=>1000,38948=>1000, - 38949=>1000,38950=>1000,38951=>1000,38952=>1000,38953=>1000,38954=>1000,38955=>1000,38956=>1000,38957=>1000,38958=>1000,38959=>1000,38960=>1000,38961=>1000,38962=>1000,38963=>1000,38964=>1000, - 38965=>1000,38966=>1000,38967=>1000,38968=>1000,38969=>1000,38970=>1000,38971=>1000,38972=>1000,38973=>1000,38974=>1000,38975=>1000,38976=>1000,38977=>1000,38978=>1000,38979=>1000,38980=>1000, - 38981=>1000,38982=>1000,38983=>1000,38984=>1000,38985=>1000,38986=>1000,38987=>1000,38988=>1000,38989=>1000,38990=>1000,38991=>1000,38992=>1000,38993=>1000,38994=>1000,38995=>1000,38996=>1000, - 38997=>1000,38998=>1000,38999=>1000,39000=>1000,39001=>1000,39002=>1000,39003=>1000,39004=>1000,39005=>1000,39006=>1000,39007=>1000,39008=>1000,39009=>1000,39010=>1000,39011=>1000,39012=>1000, - 39013=>1000,39014=>1000,39015=>1000,39016=>1000,39017=>1000,39018=>1000,39019=>1000,39020=>1000,39021=>1000,39022=>1000,39023=>1000,39024=>1000,39025=>1000,39026=>1000,39027=>1000,39028=>1000, - 39029=>1000,39030=>1000,39031=>1000,39032=>1000,39033=>1000,39034=>1000,39035=>1000,39036=>1000,39037=>1000,39038=>1000,39039=>1000,39040=>1000,39041=>1000,39042=>1000,39043=>1000,39044=>1000, - 39045=>1000,39046=>1000,39047=>1000,39048=>1000,39049=>1000,39050=>1000,39051=>1000,39052=>1000,39053=>1000,39054=>1000,39055=>1000,39056=>1000,39057=>1000,39058=>1000,39059=>1000,39060=>1000, - 39061=>1000,39062=>1000,39063=>1000,39064=>1000,39065=>1000,39066=>1000,39067=>1000,39068=>1000,39069=>1000,39070=>1000,39071=>1000,39072=>1000,39073=>1000,39074=>1000,39075=>1000,39076=>1000, - 39077=>1000,39078=>1000,39079=>1000,39080=>1000,39081=>1000,39082=>1000,39083=>1000,39084=>1000,39085=>1000,39086=>1000,39087=>1000,39088=>1000,39089=>1000,39090=>1000,39091=>1000,39092=>1000, - 39093=>1000,39094=>1000,39095=>1000,39096=>1000,39097=>1000,39098=>1000,39099=>1000,39100=>1000,39101=>1000,39102=>1000,39103=>1000,39104=>1000,39105=>1000,39106=>1000,39107=>1000,39108=>1000, - 39109=>1000,39110=>1000,39111=>1000,39112=>1000,39113=>1000,39114=>1000,39115=>1000,39116=>1000,39117=>1000,39118=>1000,39119=>1000,39120=>1000,39121=>1000,39122=>1000,39123=>1000,39124=>1000, - 39125=>1000,39126=>1000,39127=>1000,39128=>1000,39129=>1000,39130=>1000,39131=>1000,39132=>1000,39133=>1000,39134=>1000,39135=>1000,39136=>1000,39137=>1000,39138=>1000,39139=>1000,39140=>1000, - 39141=>1000,39142=>1000,39143=>1000,39144=>1000,39145=>1000,39146=>1000,39147=>1000,39148=>1000,39149=>1000,39150=>1000,39151=>1000,39152=>1000,39153=>1000,39154=>1000,39155=>1000,39156=>1000, - 39157=>1000,39158=>1000,39159=>1000,39160=>1000,39161=>1000,39162=>1000,39163=>1000,39164=>1000,39165=>1000,39166=>1000,39167=>1000,39168=>1000,39169=>1000,39170=>1000,39171=>1000,39172=>1000, - 39173=>1000,39174=>1000,39175=>1000,39176=>1000,39177=>1000,39178=>1000,39179=>1000,39180=>1000,39181=>1000,39182=>1000,39183=>1000,39184=>1000,39185=>1000,39186=>1000,39187=>1000,39188=>1000, - 39189=>1000,39190=>1000,39191=>1000,39192=>1000,39193=>1000,39194=>1000,39195=>1000,39196=>1000,39197=>1000,39198=>1000,39199=>1000,39200=>1000,39201=>1000,39202=>1000,39203=>1000,39204=>1000, - 39205=>1000,39206=>1000,39207=>1000,39208=>1000,39209=>1000,39210=>1000,39211=>1000,39212=>1000,39213=>1000,39214=>1000,39215=>1000,39216=>1000,39217=>1000,39218=>1000,39219=>1000,39220=>1000, - 39221=>1000,39222=>1000,39223=>1000,39224=>1000,39225=>1000,39226=>1000,39227=>1000,39228=>1000,39229=>1000,39230=>1000,39231=>1000,39232=>1000,39233=>1000,39234=>1000,39235=>1000,39236=>1000, - 39237=>1000,39238=>1000,39239=>1000,39240=>1000,39241=>1000,39242=>1000,39243=>1000,39244=>1000,39245=>1000,39246=>1000,39247=>1000,39248=>1000,39249=>1000,39250=>1000,39251=>1000,39252=>1000, - 39253=>1000,39254=>1000,39255=>1000,39256=>1000,39257=>1000,39258=>1000,39259=>1000,39260=>1000,39261=>1000,39262=>1000,39263=>1000,39264=>1000,39265=>1000,39266=>1000,39267=>1000,39268=>1000, - 39269=>1000,39270=>1000,39271=>1000,39272=>1000,39273=>1000,39274=>1000,39275=>1000,39276=>1000,39277=>1000,39278=>1000,39279=>1000,39280=>1000,39281=>1000,39282=>1000,39283=>1000,39284=>1000, - 39285=>1000,39286=>1000,39287=>1000,39288=>1000,39289=>1000,39290=>1000,39291=>1000,39292=>1000,39293=>1000,39294=>1000,39295=>1000,39296=>1000,39297=>1000,39298=>1000,39299=>1000,39300=>1000, - 39301=>1000,39302=>1000,39303=>1000,39304=>1000,39305=>1000,39306=>1000,39307=>1000,39308=>1000,39309=>1000,39310=>1000,39311=>1000,39312=>1000,39313=>1000,39314=>1000,39315=>1000,39316=>1000, - 39317=>1000,39318=>1000,39319=>1000,39320=>1000,39321=>1000,39322=>1000,39323=>1000,39324=>1000,39325=>1000,39326=>1000,39327=>1000,39328=>1000,39329=>1000,39330=>1000,39331=>1000,39332=>1000, - 39333=>1000,39334=>1000,39335=>1000,39336=>1000,39337=>1000,39338=>1000,39339=>1000,39340=>1000,39341=>1000,39342=>1000,39343=>1000,39344=>1000,39345=>1000,39346=>1000,39347=>1000,39348=>1000, - 39349=>1000,39350=>1000,39351=>1000,39352=>1000,39353=>1000,39354=>1000,39355=>1000,39356=>1000,39357=>1000,39358=>1000,39359=>1000,39360=>1000,39361=>1000,39362=>1000,39363=>1000,39364=>1000, - 39365=>1000,39366=>1000,39367=>1000,39368=>1000,39369=>1000,39370=>1000,39371=>1000,39372=>1000,39373=>1000,39374=>1000,39375=>1000,39376=>1000,39377=>1000,39378=>1000,39379=>1000,39380=>1000, - 39381=>1000,39382=>1000,39383=>1000,39384=>1000,39385=>1000,39386=>1000,39387=>1000,39388=>1000,39389=>1000,39390=>1000,39391=>1000,39392=>1000,39393=>1000,39394=>1000,39395=>1000,39396=>1000, - 39397=>1000,39398=>1000,39399=>1000,39400=>1000,39401=>1000,39402=>1000,39403=>1000,39404=>1000,39405=>1000,39406=>1000,39407=>1000,39408=>1000,39409=>1000,39410=>1000,39411=>1000,39412=>1000, - 39413=>1000,39414=>1000,39415=>1000,39416=>1000,39417=>1000,39418=>1000,39419=>1000,39420=>1000,39421=>1000,39422=>1000,39423=>1000,39424=>1000,39425=>1000,39426=>1000,39427=>1000,39428=>1000, - 39429=>1000,39430=>1000,39431=>1000,39432=>1000,39433=>1000,39434=>1000,39435=>1000,39436=>1000,39437=>1000,39438=>1000,39439=>1000,39440=>1000,39441=>1000,39442=>1000,39443=>1000,39444=>1000, - 39445=>1000,39446=>1000,39447=>1000,39448=>1000,39449=>1000,39450=>1000,39451=>1000,39452=>1000,39453=>1000,39454=>1000,39455=>1000,39456=>1000,39457=>1000,39458=>1000,39459=>1000,39460=>1000, - 39461=>1000,39462=>1000,39463=>1000,39464=>1000,39465=>1000,39466=>1000,39467=>1000,39468=>1000,39469=>1000,39470=>1000,39471=>1000,39472=>1000,39473=>1000,39474=>1000,39475=>1000,39476=>1000, - 39477=>1000,39478=>1000,39479=>1000,39480=>1000,39481=>1000,39482=>1000,39483=>1000,39484=>1000,39485=>1000,39486=>1000,39487=>1000,39488=>1000,39489=>1000,39490=>1000,39491=>1000,39492=>1000, - 39493=>1000,39494=>1000,39495=>1000,39496=>1000,39497=>1000,39498=>1000,39499=>1000,39500=>1000,39501=>1000,39502=>1000,39503=>1000,39504=>1000,39505=>1000,39506=>1000,39507=>1000,39508=>1000, - 39509=>1000,39510=>1000,39511=>1000,39512=>1000,39513=>1000,39514=>1000,39515=>1000,39516=>1000,39517=>1000,39518=>1000,39519=>1000,39520=>1000,39521=>1000,39522=>1000,39523=>1000,39524=>1000, - 39525=>1000,39526=>1000,39527=>1000,39528=>1000,39529=>1000,39530=>1000,39531=>1000,39532=>1000,39533=>1000,39534=>1000,39535=>1000,39536=>1000,39537=>1000,39538=>1000,39539=>1000,39540=>1000, - 39541=>1000,39542=>1000,39543=>1000,39544=>1000,39545=>1000,39546=>1000,39547=>1000,39548=>1000,39549=>1000,39550=>1000,39551=>1000,39552=>1000,39553=>1000,39554=>1000,39555=>1000,39556=>1000, - 39557=>1000,39558=>1000,39559=>1000,39560=>1000,39561=>1000,39562=>1000,39563=>1000,39564=>1000,39565=>1000,39566=>1000,39567=>1000,39568=>1000,39569=>1000,39570=>1000,39571=>1000,39572=>1000, - 39573=>1000,39574=>1000,39575=>1000,39576=>1000,39577=>1000,39578=>1000,39579=>1000,39580=>1000,39581=>1000,39582=>1000,39583=>1000,39584=>1000,39585=>1000,39586=>1000,39587=>1000,39588=>1000, - 39589=>1000,39590=>1000,39591=>1000,39592=>1000,39593=>1000,39594=>1000,39595=>1000,39596=>1000,39597=>1000,39598=>1000,39599=>1000,39600=>1000,39601=>1000,39602=>1000,39603=>1000,39604=>1000, - 39605=>1000,39606=>1000,39607=>1000,39608=>1000,39609=>1000,39610=>1000,39611=>1000,39612=>1000,39613=>1000,39614=>1000,39615=>1000,39616=>1000,39617=>1000,39618=>1000,39619=>1000,39620=>1000, - 39621=>1000,39622=>1000,39623=>1000,39624=>1000,39625=>1000,39626=>1000,39627=>1000,39628=>1000,39629=>1000,39630=>1000,39631=>1000,39632=>1000,39633=>1000,39634=>1000,39635=>1000,39636=>1000, - 39637=>1000,39638=>1000,39639=>1000,39640=>1000,39641=>1000,39642=>1000,39643=>1000,39644=>1000,39645=>1000,39646=>1000,39647=>1000,39648=>1000,39649=>1000,39650=>1000,39651=>1000,39652=>1000, - 39653=>1000,39654=>1000,39655=>1000,39656=>1000,39657=>1000,39658=>1000,39659=>1000,39660=>1000,39661=>1000,39662=>1000,39663=>1000,39664=>1000,39665=>1000,39666=>1000,39667=>1000,39668=>1000, - 39669=>1000,39670=>1000,39671=>1000,39672=>1000,39673=>1000,39674=>1000,39675=>1000,39676=>1000,39677=>1000,39678=>1000,39679=>1000,39680=>1000,39681=>1000,39682=>1000,39683=>1000,39684=>1000, - 39685=>1000,39686=>1000,39687=>1000,39688=>1000,39689=>1000,39690=>1000,39691=>1000,39692=>1000,39693=>1000,39694=>1000,39695=>1000,39696=>1000,39697=>1000,39698=>1000,39699=>1000,39700=>1000, - 39701=>1000,39702=>1000,39703=>1000,39704=>1000,39705=>1000,39706=>1000,39707=>1000,39708=>1000,39709=>1000,39710=>1000,39711=>1000,39712=>1000,39713=>1000,39714=>1000,39715=>1000,39716=>1000, - 39717=>1000,39718=>1000,39719=>1000,39720=>1000,39721=>1000,39722=>1000,39723=>1000,39724=>1000,39725=>1000,39726=>1000,39727=>1000,39728=>1000,39729=>1000,39730=>1000,39731=>1000,39732=>1000, - 39733=>1000,39734=>1000,39735=>1000,39736=>1000,39737=>1000,39738=>1000,39739=>1000,39740=>1000,39741=>1000,39742=>1000,39743=>1000,39744=>1000,39745=>1000,39746=>1000,39747=>1000,39748=>1000, - 39749=>1000,39750=>1000,39751=>1000,39752=>1000,39753=>1000,39754=>1000,39755=>1000,39756=>1000,39757=>1000,39758=>1000,39759=>1000,39760=>1000,39761=>1000,39762=>1000,39763=>1000,39764=>1000, - 39765=>1000,39766=>1000,39767=>1000,39768=>1000,39769=>1000,39770=>1000,39771=>1000,39772=>1000,39773=>1000,39774=>1000,39775=>1000,39776=>1000,39777=>1000,39778=>1000,39779=>1000,39780=>1000, - 39781=>1000,39782=>1000,39783=>1000,39784=>1000,39785=>1000,39786=>1000,39787=>1000,39788=>1000,39789=>1000,39790=>1000,39791=>1000,39792=>1000,39793=>1000,39794=>1000,39795=>1000,39796=>1000, - 39797=>1000,39798=>1000,39799=>1000,39800=>1000,39801=>1000,39802=>1000,39803=>1000,39804=>1000,39805=>1000,39806=>1000,39807=>1000,39808=>1000,39809=>1000,39810=>1000,39811=>1000,39812=>1000, - 39813=>1000,39814=>1000,39815=>1000,39816=>1000,39817=>1000,39818=>1000,39819=>1000,39820=>1000,39821=>1000,39822=>1000,39823=>1000,39824=>1000,39825=>1000,39826=>1000,39827=>1000,39828=>1000, - 39829=>1000,39830=>1000,39831=>1000,39832=>1000,39833=>1000,39834=>1000,39835=>1000,39836=>1000,39837=>1000,39838=>1000,39839=>1000,39840=>1000,39841=>1000,39842=>1000,39843=>1000,39844=>1000, - 39845=>1000,39846=>1000,39847=>1000,39848=>1000,39849=>1000,39850=>1000,39851=>1000,39852=>1000,39853=>1000,39854=>1000,39855=>1000,39856=>1000,39857=>1000,39858=>1000,39859=>1000,39860=>1000, - 39861=>1000,39862=>1000,39863=>1000,39864=>1000,39865=>1000,39866=>1000,39867=>1000,39868=>1000,39869=>1000,39870=>1000,39871=>1000,39872=>1000,39873=>1000,39874=>1000,39875=>1000,39876=>1000, - 39877=>1000,39878=>1000,39879=>1000,39880=>1000,39881=>1000,39882=>1000,39883=>1000,39884=>1000,39885=>1000,39886=>1000,39887=>1000,39888=>1000,39889=>1000,39890=>1000,39891=>1000,39892=>1000, - 39893=>1000,39894=>1000,39895=>1000,39896=>1000,39897=>1000,39898=>1000,39899=>1000,39900=>1000,39901=>1000,39902=>1000,39903=>1000,39904=>1000,39905=>1000,39906=>1000,39907=>1000,39908=>1000, - 39909=>1000,39910=>1000,39911=>1000,39912=>1000,39913=>1000,39914=>1000,39915=>1000,39916=>1000,39917=>1000,39918=>1000,39919=>1000,39920=>1000,39921=>1000,39922=>1000,39923=>1000,39924=>1000, - 39925=>1000,39926=>1000,39927=>1000,39928=>1000,39929=>1000,39930=>1000,39931=>1000,39932=>1000,39933=>1000,39934=>1000,39935=>1000,39936=>1000,39937=>1000,39938=>1000,39939=>1000,39940=>1000, - 39941=>1000,39942=>1000,39943=>1000,39944=>1000,39945=>1000,39946=>1000,39947=>1000,39948=>1000,39949=>1000,39950=>1000,39951=>1000,39952=>1000,39953=>1000,39954=>1000,39955=>1000,39956=>1000, - 39957=>1000,39958=>1000,39959=>1000,39960=>1000,39961=>1000,39962=>1000,39963=>1000,39964=>1000,39965=>1000,39966=>1000,39967=>1000,39968=>1000,39969=>1000,39970=>1000,39971=>1000,39972=>1000, - 39973=>1000,39974=>1000,39975=>1000,39976=>1000,39977=>1000,39978=>1000,39979=>1000,39980=>1000,39981=>1000,39982=>1000,39983=>1000,39984=>1000,39985=>1000,39986=>1000,39987=>1000,39988=>1000, - 39989=>1000,39990=>1000,39991=>1000,39992=>1000,39993=>1000,39994=>1000,39995=>1000,39996=>1000,39997=>1000,39998=>1000,39999=>1000,40000=>1000,40001=>1000,40002=>1000,40003=>1000,40004=>1000, - 40005=>1000,40006=>1000,40007=>1000,40008=>1000,40009=>1000,40010=>1000,40011=>1000,40012=>1000,40013=>1000,40014=>1000,40015=>1000,40016=>1000,40017=>1000,40018=>1000,40019=>1000,40020=>1000, - 40021=>1000,40022=>1000,40023=>1000,40024=>1000,40025=>1000,40026=>1000,40027=>1000,40028=>1000,40029=>1000,40030=>1000,40031=>1000,40032=>1000,40033=>1000,40034=>1000,40035=>1000,40036=>1000, - 40037=>1000,40038=>1000,40039=>1000,40040=>1000,40041=>1000,40042=>1000,40043=>1000,40044=>1000,40045=>1000,40046=>1000,40047=>1000,40048=>1000,40049=>1000,40050=>1000,40051=>1000,40052=>1000, - 40053=>1000,40054=>1000,40055=>1000,40056=>1000,40057=>1000,40058=>1000,40059=>1000,40060=>1000,40061=>1000,40062=>1000,40063=>1000,40064=>1000,40065=>1000,40066=>1000,40067=>1000,40068=>1000, - 40069=>1000,40070=>1000,40071=>1000,40072=>1000,40073=>1000,40074=>1000,40075=>1000,40076=>1000,40077=>1000,40078=>1000,40079=>1000,40080=>1000,40081=>1000,40082=>1000,40083=>1000,40084=>1000, - 40085=>1000,40086=>1000,40087=>1000,40088=>1000,40089=>1000,40090=>1000,40091=>1000,40092=>1000,40093=>1000,40094=>1000,40095=>1000,40096=>1000,40097=>1000,40098=>1000,40099=>1000,40100=>1000, - 40101=>1000,40102=>1000,40103=>1000,40104=>1000,40105=>1000,40106=>1000,40107=>1000,40108=>1000,40109=>1000,40110=>1000,40111=>1000,40112=>1000,40113=>1000,40114=>1000,40115=>1000,40116=>1000, - 40117=>1000,40118=>1000,40119=>1000,40120=>1000,40121=>1000,40122=>1000,40123=>1000,40124=>1000,40125=>1000,40126=>1000,40127=>1000,40128=>1000,40129=>1000,40130=>1000,40131=>1000,40132=>1000, - 40133=>1000,40134=>1000,40135=>1000,40136=>1000,40137=>1000,40138=>1000,40139=>1000,40140=>1000,40141=>1000,40142=>1000,40143=>1000,40144=>1000,40145=>1000,40146=>1000,40147=>1000,40148=>1000, - 40149=>1000,40150=>1000,40151=>1000,40152=>1000,40153=>1000,40154=>1000,40155=>1000,40156=>1000,40157=>1000,40158=>1000,40159=>1000,40160=>1000,40161=>1000,40162=>1000,40163=>1000,40164=>1000, - 40165=>1000,40166=>1000,40167=>1000,40168=>1000,40169=>1000,40170=>1000,40171=>1000,40172=>1000,40173=>1000,40174=>1000,40175=>1000,40176=>1000,40177=>1000,40178=>1000,40179=>1000,40180=>1000, - 40181=>1000,40182=>1000,40183=>1000,40184=>1000,40185=>1000,40186=>1000,40187=>1000,40188=>1000,40189=>1000,40190=>1000,40191=>1000,40192=>1000,40193=>1000,40194=>1000,40195=>1000,40196=>1000, - 40197=>1000,40198=>1000,40199=>1000,40200=>1000,40201=>1000,40202=>1000,40203=>1000,40204=>1000,40205=>1000,40206=>1000,40207=>1000,40208=>1000,40209=>1000,40210=>1000,40211=>1000,40212=>1000, - 40213=>1000,40214=>1000,40215=>1000,40216=>1000,40217=>1000,40218=>1000,40219=>1000,40220=>1000,40221=>1000,40222=>1000,40223=>1000,40224=>1000,40225=>1000,40226=>1000,40227=>1000,40228=>1000, - 40229=>1000,40230=>1000,40231=>1000,40232=>1000,40233=>1000,40234=>1000,40235=>1000,40236=>1000,40237=>1000,40238=>1000,40239=>1000,40240=>1000,40241=>1000,40242=>1000,40243=>1000,40244=>1000, - 40245=>1000,40246=>1000,40247=>1000,40248=>1000,40249=>1000,40250=>1000,40251=>1000,40252=>1000,40253=>1000,40254=>1000,40255=>1000,40256=>1000,40257=>1000,40258=>1000,40259=>1000,40260=>1000, - 40261=>1000,40262=>1000,40263=>1000,40264=>1000,40265=>1000,40266=>1000,40267=>1000,40268=>1000,40269=>1000,40270=>1000,40271=>1000,40272=>1000,40273=>1000,40274=>1000,40275=>1000,40276=>1000, - 40277=>1000,40278=>1000,40279=>1000,40280=>1000,40281=>1000,40282=>1000,40283=>1000,40284=>1000,40285=>1000,40286=>1000,40287=>1000,40288=>1000,40289=>1000,40290=>1000,40291=>1000,40292=>1000, - 40293=>1000,40294=>1000,40295=>1000,40296=>1000,40297=>1000,40298=>1000,40299=>1000,40300=>1000,40301=>1000,40302=>1000,40303=>1000,40304=>1000,40305=>1000,40306=>1000,40307=>1000,40308=>1000, - 40309=>1000,40310=>1000,40311=>1000,40312=>1000,40313=>1000,40314=>1000,40315=>1000,40316=>1000,40317=>1000,40318=>1000,40319=>1000,40320=>1000,40321=>1000,40322=>1000,40323=>1000,40324=>1000, - 40325=>1000,40326=>1000,40327=>1000,40328=>1000,40329=>1000,40330=>1000,40331=>1000,40332=>1000,40333=>1000,40334=>1000,40335=>1000,40336=>1000,40337=>1000,40338=>1000,40339=>1000,40340=>1000, - 40341=>1000,40342=>1000,40343=>1000,40344=>1000,40345=>1000,40346=>1000,40347=>1000,40348=>1000,40349=>1000,40350=>1000,40351=>1000,40352=>1000,40353=>1000,40354=>1000,40355=>1000,40356=>1000, - 40357=>1000,40358=>1000,40359=>1000,40360=>1000,40361=>1000,40362=>1000,40363=>1000,40364=>1000,40365=>1000,40366=>1000,40367=>1000,40368=>1000,40369=>1000,40370=>1000,40371=>1000,40372=>1000, - 40373=>1000,40374=>1000,40375=>1000,40376=>1000,40377=>1000,40378=>1000,40379=>1000,40380=>1000,40381=>1000,40382=>1000,40383=>1000,40384=>1000,40385=>1000,40386=>1000,40387=>1000,40388=>1000, - 40389=>1000,40390=>1000,40391=>1000,40392=>1000,40393=>1000,40394=>1000,40395=>1000,40396=>1000,40397=>1000,40398=>1000,40399=>1000,40400=>1000,40401=>1000,40402=>1000,40403=>1000,40404=>1000, - 40405=>1000,40406=>1000,40407=>1000,40408=>1000,40409=>1000,40410=>1000,40411=>1000,40412=>1000,40413=>1000,40414=>1000,40415=>1000,40416=>1000,40417=>1000,40418=>1000,40419=>1000,40420=>1000, - 40421=>1000,40422=>1000,40423=>1000,40424=>1000,40425=>1000,40426=>1000,40427=>1000,40428=>1000,40429=>1000,40430=>1000,40431=>1000,40432=>1000,40433=>1000,40434=>1000,40435=>1000,40436=>1000, - 40437=>1000,40438=>1000,40439=>1000,40440=>1000,40441=>1000,40442=>1000,40443=>1000,40444=>1000,40445=>1000,40446=>1000,40447=>1000,40448=>1000,40449=>1000,40450=>1000,40451=>1000,40452=>1000, - 40453=>1000,40454=>1000,40455=>1000,40456=>1000,40457=>1000,40458=>1000,40459=>1000,40460=>1000,40461=>1000,40462=>1000,40463=>1000,40464=>1000,40465=>1000,40466=>1000,40467=>1000,40468=>1000, - 40469=>1000,40470=>1000,40471=>1000,40472=>1000,40473=>1000,40474=>1000,40475=>1000,40476=>1000,40477=>1000,40478=>1000,40479=>1000,40480=>1000,40481=>1000,40482=>1000,40483=>1000,40484=>1000, - 40485=>1000,40486=>1000,40487=>1000,40488=>1000,40489=>1000,40490=>1000,40491=>1000,40492=>1000,40493=>1000,40494=>1000,40495=>1000,40496=>1000,40497=>1000,40498=>1000,40499=>1000,40500=>1000, - 40501=>1000,40502=>1000,40503=>1000,40504=>1000,40505=>1000,40506=>1000,40507=>1000,40508=>1000,40509=>1000,40510=>1000,40511=>1000,40512=>1000,40513=>1000,40514=>1000,40515=>1000,40516=>1000, - 40517=>1000,40518=>1000,40519=>1000,40520=>1000,40521=>1000,40522=>1000,40523=>1000,40524=>1000,40525=>1000,40526=>1000,40527=>1000,40528=>1000,40529=>1000,40530=>1000,40531=>1000,40532=>1000, - 40533=>1000,40534=>1000,40535=>1000,40536=>1000,40537=>1000,40538=>1000,40539=>1000,40540=>1000,40541=>1000,40542=>1000,40543=>1000,40544=>1000,40545=>1000,40546=>1000,40547=>1000,40548=>1000, - 40549=>1000,40550=>1000,40551=>1000,40552=>1000,40553=>1000,40554=>1000,40555=>1000,40556=>1000,40557=>1000,40558=>1000,40559=>1000,40560=>1000,40561=>1000,40562=>1000,40563=>1000,40564=>1000, - 40565=>1000,40566=>1000,40567=>1000,40568=>1000,40569=>1000,40570=>1000,40571=>1000,40572=>1000,40573=>1000,40574=>1000,40575=>1000,40576=>1000,40577=>1000,40578=>1000,40579=>1000,40580=>1000, - 40581=>1000,40582=>1000,40583=>1000,40584=>1000,40585=>1000,40586=>1000,40587=>1000,40588=>1000,40589=>1000,40590=>1000,40591=>1000,40592=>1000,40593=>1000,40594=>1000,40595=>1000,40596=>1000, - 40597=>1000,40598=>1000,40599=>1000,40600=>1000,40601=>1000,40602=>1000,40603=>1000,40604=>1000,40605=>1000,40606=>1000,40607=>1000,40608=>1000,40609=>1000,40610=>1000,40611=>1000,40612=>1000, - 40613=>1000,40614=>1000,40615=>1000,40616=>1000,40617=>1000,40618=>1000,40619=>1000,40620=>1000,40621=>1000,40622=>1000,40623=>1000,40624=>1000,40625=>1000,40626=>1000,40627=>1000,40628=>1000, - 40629=>1000,40630=>1000,40631=>1000,40632=>1000,40633=>1000,40634=>1000,40635=>1000,40636=>1000,40637=>1000,40638=>1000,40639=>1000,40640=>1000,40641=>1000,40642=>1000,40643=>1000,40644=>1000, - 40645=>1000,40646=>1000,40647=>1000,40648=>1000,40649=>1000,40650=>1000,40651=>1000,40652=>1000,40653=>1000,40654=>1000,40655=>1000,40656=>1000,40657=>1000,40658=>1000,40659=>1000,40660=>1000, - 40661=>1000,40662=>1000,40663=>1000,40664=>1000,40665=>1000,40666=>1000,40667=>1000,40668=>1000,40669=>1000,40670=>1000,40671=>1000,40672=>1000,40673=>1000,40674=>1000,40675=>1000,40676=>1000, - 40677=>1000,40678=>1000,40679=>1000,40680=>1000,40681=>1000,40682=>1000,40683=>1000,40684=>1000,40685=>1000,40686=>1000,40687=>1000,40688=>1000,40689=>1000,40690=>1000,40691=>1000,40692=>1000, - 40693=>1000,40694=>1000,40695=>1000,40696=>1000,40697=>1000,40698=>1000,40699=>1000,40700=>1000,40701=>1000,40702=>1000,40703=>1000,40704=>1000,40705=>1000,40706=>1000,40707=>1000,40708=>1000, - 40709=>1000,40710=>1000,40711=>1000,40712=>1000,40713=>1000,40714=>1000,40715=>1000,40716=>1000,40717=>1000,40718=>1000,40719=>1000,40720=>1000,40721=>1000,40722=>1000,40723=>1000,40724=>1000, - 40725=>1000,40726=>1000,40727=>1000,40728=>1000,40729=>1000,40730=>1000,40731=>1000,40732=>1000,40733=>1000,40734=>1000,40735=>1000,40736=>1000,40737=>1000,40738=>1000,40739=>1000,40740=>1000, - 40741=>1000,40742=>1000,40743=>1000,40744=>1000,40745=>1000,40746=>1000,40747=>1000,40748=>1000,40749=>1000,40750=>1000,40751=>1000,40752=>1000,40753=>1000,40754=>1000,40755=>1000,40756=>1000, - 40757=>1000,40758=>1000,40759=>1000,40760=>1000,40761=>1000,40762=>1000,40763=>1000,40764=>1000,40765=>1000,40766=>1000,40767=>1000,40768=>1000,40769=>1000,40770=>1000,40771=>1000,40772=>1000, - 40773=>1000,40774=>1000,40775=>1000,40776=>1000,40777=>1000,40778=>1000,40779=>1000,40780=>1000,40781=>1000,40782=>1000,40783=>1000,40784=>1000,40785=>1000,40786=>1000,40787=>1000,40788=>1000, - 40789=>1000,40790=>1000,40791=>1000,40792=>1000,40793=>1000,40794=>1000,40795=>1000,40796=>1000,40797=>1000,40798=>1000,40799=>1000,40800=>1000,40801=>1000,40802=>1000,40803=>1000,40804=>1000, - 40805=>1000,40806=>1000,40807=>1000,40808=>1000,40809=>1000,40810=>1000,40811=>1000,40812=>1000,40813=>1000,40814=>1000,40815=>1000,40816=>1000,40817=>1000,40818=>1000,40819=>1000,40820=>1000, - 40821=>1000,40822=>1000,40823=>1000,40824=>1000,40825=>1000,40826=>1000,40827=>1000,40828=>1000,40829=>1000,40830=>1000,40831=>1000,40832=>1000,40833=>1000,40834=>1000,40835=>1000,40836=>1000, - 40837=>1000,40838=>1000,40839=>1000,40840=>1000,40841=>1000,40842=>1000,40843=>1000,40844=>1000,40845=>1000,40846=>1000,40847=>1000,40848=>1000,40849=>1000,40850=>1000,40851=>1000,40852=>1000, - 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, - 40869=>1000); -$diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -//$enc='UniCNS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ac15.php'); - -$enc='UniGB-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -include(dirname(__FILE__).'/uni2cid_ag15.php'); - -//$enc='UniKS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ak12.php'); - -//$enc='UniJIS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -//include(dirname(__FILE__).'/uni2cid_aj16.php'); -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-traditional.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-traditional.php deleted file mode 100644 index 80903a05d8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-chinese-traditional.php +++ /dev/null @@ -1,1768 +0,0 @@ -<?php -$type='cidfont0'; -$name='ArialUnicodeMS'; -$desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-100; -$ut=50; -$dw=1000; -$cw=array( - 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, - 48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556, - 64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, - 80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>500, - 96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, - 112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,8364=>556, - 1027=>567,8218=>222,402=>278,8222=>333,8230=>1000,8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,1036=>584,381=>611,1039=>723,8216=>222, - 8217=>222,8220=>333,8221=>333,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>500,8250=>333,339=>944,1116=>437,382=>500,376=>667,160=>278,161=>333, - 162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>500,176=>400,177=>584, - 178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667, - 194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722, - 210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, - 226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556, - 242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, - 258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500,268=>722,269=>500,270=>722,271=>627,272=>722,273=>556, - 274=>667,275=>556,276=>667,277=>556,278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556,288=>778,289=>556, - 290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>222,298=>278,299=>222,300=>278,301=>222,302=>278,303=>222,304=>278,305=>278, - 306=>751,307=>444,308=>500,309=>222,310=>667,311=>500,312=>437,313=>556,314=>222,315=>556,316=>222,317=>556,318=>222,319=>556,320=>318,321=>556, - 322=>222,323=>722,324=>556,325=>722,326=>556,327=>722,328=>556,329=>626,330=>723,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, - 340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500,350=>667,351=>500,354=>611,355=>278,356=>611,357=>406, - 358=>611,359=>278,360=>722,361=>556,362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556,372=>944,373=>722, - 374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>222,384=>556,385=>740,386=>655,387=>556,388=>556,389=>556,390=>722,391=>766,392=>579, - 393=>722,394=>789,395=>655,396=>556,397=>557,398=>667,399=>729,400=>604,401=>611,403=>791,404=>649,405=>806,406=>245,407=>322,408=>667,409=>500, - 410=>322,411=>500,412=>833,413=>722,414=>556,415=>778,416=>776,417=>556,418=>1019,419=>782,420=>735,421=>556,422=>722,423=>667,424=>500,425=>602, - 426=>366,427=>278,428=>571,429=>278,430=>611,431=>776,432=>620,433=>748,434=>667,435=>752,436=>615,437=>611,438=>500,439=>628,440=>628,441=>526, - 442=>480,443=>556,444=>556,445=>526,446=>556,447=>556,448=>278,449=>464,450=>474,451=>278,452=>1333,453=>1222,454=>1056,455=>1030,456=>778,457=>444, - 458=>1222,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722, - 474=>556,475=>722,476=>556,477=>556,478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556,488=>667,489=>500, - 490=>778,491=>556,492=>778,493=>556,494=>534,495=>534,496=>222,497=>1333,498=>1222,499=>1056,500=>778,501=>556,506=>667,507=>556,508=>1000,509=>889, - 510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667,519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556, - 526=>778,527=>556,528=>722,529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500, - 598=>556,599=>556,600=>556,601=>556,602=>777,603=>485,604=>485,605=>686,606=>519,607=>260,608=>556,609=>556,610=>557,611=>500,612=>500,613=>556, - 614=>556,615=>556,616=>242,617=>282,618=>356,619=>356,620=>425,621=>222,622=>635,623=>833,624=>833,625=>833,626=>556,627=>556,628=>558,629=>556, - 630=>715,631=>674,632=>558,633=>333,634=>333,635=>333,636=>333,637=>333,638=>312,639=>312,640=>530,641=>530,642=>500,643=>216,644=>276,645=>216, - 646=>222,647=>278,648=>278,649=>596,650=>558,651=>556,652=>500,653=>722,654=>500,655=>500,656=>500,657=>564,658=>530,659=>530,660=>464,661=>464, - 662=>464,663=>500,664=>614,665=>526,666=>519,667=>557,668=>558,669=>222,670=>500,671=>416,672=>556,673=>464,674=>464,675=>966,676=>966,677=>1030, - 678=>689,679=>484,680=>718,688=>326,689=>326,690=>153,691=>201,692=>201,693=>201,694=>304,695=>389,696=>278,697=>222,698=>372,699=>222,700=>222, - 701=>222,702=>222,703=>222,704=>250,705=>250,706=>320,707=>320,708=>320,709=>320,711=>333,712=>192,713=>333,714=>333,715=>333,716=>192,717=>333, - 718=>333,719=>333,720=>300,721=>300,722=>222,723=>222,724=>340,725=>340,726=>280,727=>362,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, - 736=>278,737=>153,738=>270,739=>274,740=>325,741=>360,742=>360,743=>360,744=>360,745=>360,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, - 774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0, - 790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0, - 806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, - 822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, - 864=>0,865=>0,884=>308,885=>308,890=>278,894=>278,900=>278,901=>278,902=>667,903=>278,904=>704,905=>759,906=>315,908=>778,910=>746,911=>758, - 912=>222,913=>667,914=>667,915=>550,916=>682,917=>667,918=>611,919=>722,920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>650,927=>778, - 928=>722,929=>667,931=>602,932=>611,933=>667,934=>808,935=>667,936=>804,937=>758,938=>278,939=>667,940=>576,941=>434,942=>556,943=>222,944=>551, - 945=>576,946=>563,947=>500,948=>557,949=>434,950=>440,951=>556,952=>556,953=>222,954=>498,955=>500,956=>553,957=>500,958=>432,959=>556,960=>678, - 961=>571,962=>472,963=>619,964=>382,965=>551,966=>649,967=>522,968=>729,969=>766,970=>222,971=>551,972=>556,973=>551,974=>766,976=>563,977=>616, - 978=>631,979=>726,980=>631,981=>644,982=>781,986=>722,988=>578,990=>570,992=>692,994=>880,995=>833,996=>684,997=>558,998=>680,999=>529,1000=>557, - 1001=>505,1002=>623,1003=>603,1004=>610,1005=>611,1006=>568,1007=>434,1008=>600,1009=>571,1010=>500,1011=>222,1025=>667,1026=>865,1028=>717,1029=>667,1030=>278, - 1031=>278,1032=>500,1033=>1105,1034=>1009,1035=>867,1038=>635,1040=>667,1041=>655,1042=>667,1043=>567,1044=>677,1045=>667,1046=>923,1047=>604,1048=>722,1049=>722, - 1050=>584,1051=>705,1052=>833,1053=>722,1054=>778,1055=>723,1056=>667,1057=>722,1058=>611,1059=>635,1060=>760,1061=>667,1062=>740,1063=>684,1064=>920,1065=>939, - 1066=>793,1067=>883,1068=>655,1069=>717,1070=>1006,1071=>722,1072=>556,1073=>573,1074=>531,1075=>383,1076=>583,1077=>556,1078=>669,1079=>458,1080=>559,1081=>559, - 1082=>437,1083=>571,1084=>683,1085=>552,1086=>556,1087=>542,1088=>556,1089=>500,1090=>458,1091=>500,1092=>823,1093=>500,1094=>562,1095=>533,1096=>802,1097=>823, - 1098=>620,1099=>717,1100=>523,1101=>510,1102=>744,1103=>542,1105=>556,1106=>556,1107=>383,1108=>510,1109=>500,1110=>222,1111=>278,1112=>222,1113=>873,1114=>811, - 1115=>556,1118=>500,1119=>542,1120=>976,1121=>766,1122=>656,1123=>521,1124=>950,1125=>694,1126=>667,1127=>597,1128=>952,1129=>817,1130=>654,1131=>600,1132=>932, - 1133=>817,1134=>604,1135=>458,1136=>804,1137=>729,1138=>778,1139=>556,1140=>667,1141=>500,1142=>667,1143=>500,1144=>1279,1145=>1060,1146=>778,1147=>556,1148=>976, - 1149=>766,1150=>976,1151=>766,1152=>722,1153=>514,1154=>686,1155=>334,1156=>382,1157=>334,1158=>334,1168=>435,1169=>339,1170=>567,1171=>383,1172=>656,1173=>556, - 1174=>923,1175=>669,1176=>604,1177=>458,1178=>584,1179=>437,1180=>584,1181=>437,1182=>584,1183=>437,1184=>764,1185=>537,1186=>741,1187=>573,1188=>900,1189=>670, - 1190=>736,1191=>560,1192=>778,1193=>560,1194=>722,1195=>500,1196=>611,1197=>458,1198=>667,1199=>500,1200=>667,1201=>500,1202=>667,1203=>500,1204=>916,1205=>661, - 1206=>684,1207=>533,1208=>684,1209=>533,1210=>684,1211=>556,1212=>829,1213=>667,1214=>829,1215=>667,1216=>278,1217=>923,1218=>669,1219=>584,1220=>437,1223=>735, - 1224=>570,1227=>684,1228=>533,1232=>667,1233=>556,1234=>667,1235=>556,1236=>1000,1237=>889,1238=>667,1239=>556,1240=>729,1241=>556,1242=>729,1243=>556,1244=>923, - 1245=>669,1246=>604,1247=>458,1248=>604,1249=>492,1250=>722,1251=>559,1252=>722,1253=>559,1254=>778,1255=>556,1256=>778,1257=>556,1258=>778,1259=>556,1262=>635, - 1263=>500,1264=>635,1265=>500,1266=>635,1267=>500,1268=>684,1269=>533,1272=>883,1273=>717,1329=>635,1330=>531,1331=>583,1332=>583,1333=>531,1334=>531,1335=>427, - 1336=>531,1337=>750,1338=>635,1339=>531,1340=>375,1341=>583,1342=>698,1343=>531,1344=>427,1345=>531,1346=>583,1347=>531,1348=>635,1349=>698,1350=>635,1351=>635, - 1352=>531,1353=>531,1354=>698,1355=>531,1356=>635,1357=>531,1358=>698,1359=>583,1360=>479,1361=>583,1362=>531,1363=>698,1364=>698,1365=>635,1366=>750,1369=>271, - 1370=>271,1371=>150,1372=>300,1373=>271,1374=>271,1375=>420,1377=>583,1378=>427,1379=>427,1380=>427,1381=>427,1382=>427,1383=>427,1384=>427,1385=>459,1386=>427, - 1387=>427,1388=>323,1389=>531,1390=>427,1391=>427,1392=>427,1393=>427,1394=>427,1395=>427,1396=>427,1397=>271,1398=>427,1399=>375,1400=>427,1401=>375,1402=>583, - 1403=>427,1404=>427,1405=>427,1406=>427,1407=>583,1408=>427,1409=>427,1410=>323,1411=>583,1412=>375,1413=>375,1414=>583,1415=>527,1417=>271,1425=>360,1426=>360, - 1427=>360,1428=>360,1429=>360,1430=>360,1431=>360,1432=>360,1433=>360,1434=>360,1435=>360,1436=>360,1437=>360,1438=>360,1439=>360,1440=>360,1441=>360,1443=>360, - 1444=>360,1445=>360,1446=>360,1447=>360,1448=>360,1449=>360,1450=>360,1451=>360,1452=>360,1453=>360,1454=>360,1455=>360,1456=>360,1457=>360,1458=>360,1459=>360, - 1460=>360,1461=>360,1462=>360,1463=>360,1464=>360,1465=>360,1467=>360,1468=>360,1469=>360,1470=>366,1471=>360,1472=>225,1473=>360,1474=>360,1475=>238,1476=>360, - 1488=>577,1489=>563,1490=>411,1491=>512,1492=>594,1493=>316,1494=>326,1495=>594,1496=>594,1497=>316,1498=>507,1499=>527,1500=>484,1501=>594,1502=>594,1503=>316, - 1504=>338,1505=>604,1506=>550,1507=>567,1508=>569,1509=>505,1510=>514,1511=>583,1512=>507,1513=>700,1514=>633,1520=>590,1521=>590,1522=>590,1523=>216,1524=>412, - 1548=>278,1563=>278,1567=>556,1569=>529,1570=>243,1571=>243,1572=>470,1573=>243,1574=>731,1575=>243,1576=>771,1577=>514,1578=>771,1579=>771,1580=>544,1581=>544, - 1582=>544,1583=>430,1584=>430,1585=>421,1586=>421,1587=>1194,1588=>1194,1589=>1291,1590=>1291,1591=>843,1592=>843,1593=>594,1594=>594,1600=>279,1601=>957,1602=>800, - 1603=>757,1604=>662,1605=>589,1606=>692,1607=>514,1608=>470,1609=>731,1610=>731,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0, - 1632=>480,1633=>480,1634=>480,1635=>480,1636=>480,1637=>480,1638=>480,1639=>480,1640=>480,1641=>480,1642=>547,1643=>278,1644=>278,1645=>438,1648=>0,1649=>243, - 1650=>243,1651=>243,1652=>0,1653=>380,1654=>470,1655=>548,1656=>772,1657=>771,1658=>771,1659=>771,1660=>771,1661=>771,1662=>771,1663=>771,1664=>771,1665=>544, - 1666=>544,1667=>544,1668=>544,1669=>544,1670=>544,1671=>544,1672=>430,1673=>430,1674=>430,1675=>430,1676=>430,1677=>430,1678=>430,1679=>430,1680=>430,1681=>421, - 1682=>421,1683=>421,1684=>421,1685=>421,1686=>419,1687=>421,1688=>421,1689=>421,1690=>1194,1691=>1194,1692=>1194,1693=>1291,1694=>1291,1695=>843,1696=>594,1697=>957, - 1698=>957,1699=>957,1700=>957,1701=>957,1702=>957,1703=>800,1704=>800,1705=>828,1706=>1058,1707=>828,1708=>757,1709=>757,1710=>757,1711=>828,1712=>828,1713=>828, - 1714=>828,1715=>828,1716=>828,1717=>662,1718=>662,1719=>662,1722=>692,1723=>692,1724=>692,1725=>692,1726=>706,1728=>514,1729=>509,1730=>509,1731=>509,1732=>470, - 1733=>470,1734=>470,1735=>470,1736=>470,1737=>470,1738=>470,1739=>470,1740=>731,1741=>841,1742=>731,1744=>731,1745=>731,1746=>550,1747=>550,1748=>279,1749=>514, - 1750=>726,1751=>558,1752=>321,1753=>318,1754=>342,1755=>373,1756=>716,1757=>688,1758=>852,1759=>288,1760=>288,1761=>388,1762=>350,1763=>716,1764=>146,1765=>282, - 1766=>339,1767=>339,1768=>415,1769=>514,1770=>220,1771=>220,1772=>220,1773=>350,1776=>480,1777=>480,1778=>480,1779=>480,1780=>480,1781=>480,1782=>480,1783=>480, - 1784=>480,1785=>480,2305=>0,2306=>0,2307=>294,2309=>693,2310=>910,2311=>533,2312=>533,2313=>590,2314=>713,2315=>920,2316=>677,2317=>611,2318=>611,2319=>611, - 2320=>611,2321=>910,2322=>910,2323=>910,2324=>910,2325=>667,2326=>732,2327=>593,2328=>639,2329=>624,2330=>688,2331=>713,2332=>688,2333=>712,2334=>697,2335=>502, - 2336=>533,2337=>583,2338=>523,2339=>693,2340=>585,2341=>638,2342=>533,2343=>640,2344=>585,2345=>585,2346=>565,2347=>699,2348=>592,2349=>689,2350=>633,2351=>600, - 2352=>486,2353=>486,2354=>680,2355=>730,2356=>730,2357=>592,2358=>684,2359=>608,2360=>646,2361=>546,2364=>0,2365=>373,2366=>319,2367=>319,2368=>319,2369=>0, - 2370=>0,2371=>0,2372=>0,2373=>0,2374=>0,2375=>0,2376=>0,2377=>319,2378=>319,2379=>319,2380=>319,2381=>0,2384=>884,2385=>0,2386=>0,2387=>0, - 2388=>0,2392=>667,2393=>732,2394=>593,2395=>688,2396=>583,2397=>523,2398=>699,2399=>600,2400=>920,2401=>677,2402=>0,2403=>0,2404=>331,2405=>513,2406=>639, - 2407=>639,2408=>639,2409=>639,2410=>639,2411=>639,2412=>639,2413=>639,2414=>639,2415=>639,2416=>362,2433=>0,2434=>430,2435=>430,2437=>786,2438=>1030,2439=>582, - 2440=>603,2441=>648,2442=>757,2443=>758,2444=>630,2447=>685,2448=>746,2451=>711,2452=>776,2453=>779,2454=>655,2455=>606,2456=>645,2457=>661,2458=>554,2459=>585, - 2460=>729,2461=>752,2462=>893,2463=>567,2464=>625,2465=>648,2466=>567,2467=>598,2468=>680,2469=>645,2470=>609,2471=>596,2472=>595,2474=>635,2475=>780,2476=>593, - 2477=>677,2478=>621,2479=>601,2480=>593,2482=>640,2486=>598,2487=>596,2488=>637,2489=>582,2492=>0,2494=>245,2495=>245,2496=>245,2497=>0,2498=>0,2499=>0, - 2500=>0,2503=>309,2504=>309,2507=>932,2508=>932,2509=>0,2519=>245,2524=>648,2525=>553,2527=>596,2528=>758,2529=>630,2530=>0,2531=>335,2534=>610,2535=>559, - 2536=>595,2537=>711,2538=>610,2539=>661,2540=>661,2541=>559,2542=>661,2543=>600,2544=>593,2545=>593,2546=>601,2547=>567,2548=>601,2549=>699,2550=>661,2551=>267, - 2552=>610,2553=>424,2554=>548,2562=>0,2565=>691,2566=>936,2567=>803,2568=>803,2569=>678,2570=>678,2575=>557,2576=>691,2579=>678,2580=>691,2581=>602,2582=>567, - 2583=>641,2584=>688,2585=>565,2586=>592,2587=>603,2588=>591,2589=>541,2590=>558,2591=>543,2592=>581,2593=>596,2594=>640,2595=>640,2596=>591,2597=>564,2598=>640, - 2599=>564,2600=>581,2602=>564,2603=>551,2604=>560,2605=>549,2606=>558,2607=>652,2608=>540,2610=>677,2611=>677,2613=>601,2614=>558,2616=>558,2617=>549,2620=>0, - 2622=>246,2623=>246,2624=>246,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>567,2650=>690,2651=>591,2652=>591,2654=>581,2662=>591, - 2663=>591,2664=>591,2665=>591,2666=>591,2667=>591,2668=>591,2669=>591,2670=>591,2671=>591,2672=>0,2673=>0,2674=>557,2675=>678,2676=>894,2689=>0,2690=>0, - 2691=>300,2693=>781,2694=>1044,2695=>589,2696=>589,2697=>560,2698=>758,2699=>806,2701=>781,2703=>781,2704=>781,2705=>1044,2707=>1044,2708=>1044,2709=>413,2710=>773, - 2711=>606,2712=>558,2713=>483,2714=>600,2715=>691,2716=>811,2717=>647,2718=>651,2719=>453,2720=>450,2721=>425,2722=>478,2723=>694,2724=>534,2725=>553,2726=>446, - 2727=>541,2728=>582,2730=>572,2731=>437,2732=>663,2733=>756,2734=>594,2735=>493,2736=>392,2738=>613,2739=>656,2741=>538,2742=>611,2743=>507,2744=>663,2745=>587, - 2748=>0,2749=>478,2750=>273,2751=>273,2752=>273,2753=>0,2754=>0,2755=>0,2756=>0,2757=>0,2759=>0,2760=>0,2761=>273,2763=>273,2764=>273,2765=>0, - 2768=>843,2784=>893,2790=>625,2791=>625,2792=>625,2793=>625,2794=>625,2795=>625,2796=>625,2797=>625,2798=>625,2799=>625,2817=>0,2818=>306,2819=>391,2821=>590, - 2822=>808,2823=>658,2824=>658,2825=>633,2826=>654,2827=>636,2828=>540,2831=>560,2832=>938,2835=>600,2836=>973,2837=>603,2838=>620,2839=>620,2840=>605,2841=>712, - 2842=>579,2843=>579,2844=>593,2845=>564,2846=>581,2847=>604,2848=>578,2849=>579,2850=>579,2851=>607,2852=>579,2853=>587,2854=>579,2855=>602,2856=>579,2858=>605, - 2859=>728,2860=>579,2861=>643,2862=>605,2863=>628,2864=>619,2866=>653,2867=>593,2870=>620,2871=>605,2872=>605,2873=>579,2876=>0,2877=>333,2878=>218,2879=>0, - 2880=>294,2881=>0,2882=>0,2883=>0,2887=>479,2888=>479,2891=>1026,2892=>1026,2893=>0,2902=>0,2903=>218,2908=>579,2909=>579,2911=>599,2912=>636,2913=>540, - 2918=>578,2919=>480,2920=>480,2921=>622,2922=>506,2923=>605,2924=>529,2925=>548,2926=>512,2927=>528,2928=>561,2946=>0,2947=>742,2949=>1002,2950=>1118,2951=>994, - 2952=>660,2953=>1012,2954=>1231,2958=>726,2959=>731,2960=>870,2962=>763,2963=>763,2964=>1636,2965=>667,2969=>830,2970=>584,2972=>876,2974=>986,2975=>802,2979=>1295, - 2980=>656,2984=>630,2985=>1012,2986=>694,2990=>727,2991=>790,2992=>545,2993=>718,2994=>821,2995=>871,2996=>724,2997=>873,2999=>1087,3000=>1098,3001=>1274,3006=>547, - 3007=>172,3008=>93,3009=>519,3010=>814,3014=>748,3015=>681,3016=>956,3018=>1666,3019=>1666,3020=>1994,3021=>0,3031=>871,3047=>667,3048=>1012,3049=>751,3050=>740, - 3051=>924,3052=>884,3053=>726,3054=>1002,3055=>825,3056=>717,3057=>719,3058=>774,3073=>365,3074=>601,3075=>346,3077=>720,3078=>786,3079=>567,3080=>1159,3081=>690, - 3082=>1047,3083=>1299,3084=>913,3086=>625,3087=>625,3088=>712,3090=>655,3091=>655,3092=>862,3093=>515,3094=>680,3095=>526,3096=>943,3097=>655,3098=>684,3099=>684, - 3100=>670,3101=>1205,3102=>732,3103=>888,3104=>597,3105=>709,3106=>709,3107=>809,3108=>715,3109=>702,3110=>702,3111=>702,3112=>607,3114=>623,3115=>623,3116=>681, - 3117=>681,3118=>932,3119=>1203,3120=>597,3121=>893,3122=>631,3123=>608,3125=>620,3126=>541,3127=>667,3128=>640,3129=>911,3134=>644,3135=>298,3136=>298,3137=>361, - 3138=>682,3139=>342,3140=>704,3142=>624,3143=>624,3144=>900,3146=>849,3147=>849,3148=>976,3149=>669,3157=>298,3158=>119,3168=>1620,3169=>1281,3174=>840,3175=>840, - 3176=>840,3177=>840,3178=>840,3179=>840,3180=>840,3181=>840,3182=>840,3183=>840,3202=>440,3203=>251,3205=>654,3206=>654,3207=>631,3208=>891,3209=>957,3210=>1293, - 3211=>1044,3212=>744,3214=>650,3215=>650,3216=>659,3218=>667,3219=>667,3220=>667,3221=>462,3222=>749,3223=>543,3224=>779,3225=>674,3226=>682,3227=>660,3228=>667, - 3229=>1171,3230=>926,3231=>671,3232=>557,3233=>669,3234=>669,3235=>728,3236=>544,3237=>672,3238=>672,3239=>672,3240=>560,3242=>668,3243=>668,3244=>681,3245=>687, - 3246=>972,3247=>1101,3248=>556,3249=>677,3250=>661,3251=>545,3253=>666,3254=>553,3255=>670,3256=>549,3257=>716,3262=>425,3263=>341,3264=>680,3265=>354,3266=>714, - 3267=>386,3268=>638,3270=>307,3271=>670,3272=>462,3274=>908,3275=>1251,3276=>434,3277=>336,3285=>344,3286=>404,3294=>673,3296=>1695,3297=>978,3302=>549,3303=>549, - 3304=>549,3305=>549,3306=>549,3307=>549,3308=>549,3309=>549,3310=>549,3311=>549,3330=>368,3331=>305,3333=>1201,3334=>1351,3335=>905,3336=>1459,3337=>635,3338=>1198, - 3339=>861,3340=>957,3342=>1211,3343=>1202,3344=>1839,3346=>642,3347=>1114,3348=>1195,3349=>861,3350=>982,3351=>874,3352=>1354,3353=>957,3354=>1016,3355=>1266,3356=>712, - 3357=>1454,3358=>1215,3359=>563,3360=>565,3361=>1192,3362=>1244,3363=>1268,3364=>878,3365=>966,3366=>545,3367=>879,3368=>879,3370=>1031,3371=>1175,3372=>1334,3373=>546, - 3374=>643,3375=>949,3376=>642,3377=>555,3378=>945,3379=>631,3380=>553,3381=>959,3382=>936,3383=>1122,3384=>1190,3385=>1112,3390=>475,3391=>418,3392=>442,3393=>340, - 3394=>340,3395=>473,3398=>640,3399=>530,3400=>1279,3402=>1368,3403=>1258,3404=>1447,3405=>0,3415=>553,3424=>861,3425=>1100,3430=>1095,3431=>929,3432=>854,3433=>1181, - 3434=>658,3435=>972,3436=>1210,3437=>650,3438=>959,3439=>896,3585=>595,3586=>648,3587=>665,3588=>608,3589=>608,3590=>665,3591=>471,3592=>556,3593=>652,3594=>664, - 3595=>681,3596=>816,3597=>849,3598=>620,3599=>620,3600=>541,3601=>785,3602=>826,3603=>887,3604=>598,3605=>605,3606=>595,3607=>650,3608=>541,3609=>652,3610=>608, - 3611=>608,3612=>630,3613=>630,3614=>695,3615=>695,3616=>620,3617=>581,3618=>588,3619=>501,3620=>595,3621=>569,3622=>620,3623=>519,3624=>592,3625=>659,3626=>574, - 3627=>654,3628=>695,3629=>566,3630=>574,3631=>517,3632=>452,3633=>0,3634=>496,3635=>496,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, - 3647=>687,3648=>302,3649=>571,3650=>478,3651=>515,3652=>515,3653=>496,3654=>506,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0, - 3663=>555,3664=>598,3665=>640,3666=>688,3667=>690,3668=>657,3669=>657,3670=>635,3671=>839,3672=>693,3673=>769,3674=>673,3675=>994,3713=>775,3714=>707,3716=>724, - 3719=>524,3720=>690,3722=>678,3725=>711,3732=>719,3733=>834,3734=>776,3735=>916,3737=>744,3738=>740,3739=>740,3740=>834,3741=>834,3742=>854,3743=>854,3745=>775, - 3746=>724,3747=>697,3749=>700,3751=>700,3754=>708,3755=>916,3757=>700,3758=>697,3759=>658,3760=>432,3761=>534,3762=>476,3763=>476,3764=>778,3765=>778,3766=>778, - 3767=>778,3768=>778,3769=>778,3771=>778,3772=>778,3773=>670,3776=>420,3777=>806,3778=>430,3779=>446,3780=>346,3782=>571,3784=>778,3785=>778,3786=>778,3787=>778, - 3788=>778,3789=>778,3792=>721,3793=>719,3794=>601,3795=>711,3796=>686,3797=>686,3798=>834,3799=>756,3800=>724,3801=>906,3804=>1272,3805=>1272,3840=>600,3841=>600, - 3842=>600,3843=>600,3844=>600,3845=>600,3846=>600,3847=>600,3848=>600,3849=>600,3850=>600,3851=>600,3852=>600,3853=>600,3854=>600,3855=>600,3856=>600,3857=>600, - 3858=>600,3859=>600,3860=>600,3861=>600,3862=>600,3863=>600,3864=>600,3865=>600,3866=>600,3867=>600,3868=>600,3869=>600,3870=>600,3871=>600,3872=>600,3873=>600, - 3874=>600,3875=>600,3876=>600,3877=>600,3878=>600,3879=>600,3880=>600,3881=>600,3882=>600,3883=>600,3884=>600,3885=>600,3886=>600,3887=>600,3888=>600,3889=>600, - 3890=>600,3891=>600,3892=>600,3893=>600,3894=>600,3895=>600,3896=>600,3897=>600,3898=>600,3899=>600,3900=>600,3901=>600,3902=>600,3903=>600,3904=>600,3905=>600, - 3906=>600,3907=>600,3908=>600,3909=>600,3910=>600,3911=>600,3913=>600,3914=>600,3915=>600,3916=>600,3917=>600,3918=>600,3919=>600,3920=>600,3921=>600,3922=>600, - 3923=>600,3924=>600,3925=>600,3926=>600,3927=>600,3928=>600,3929=>600,3930=>600,3931=>600,3932=>600,3933=>600,3934=>600,3935=>600,3936=>600,3937=>600,3938=>600, - 3939=>600,3940=>600,3941=>600,3942=>600,3943=>600,3944=>600,3945=>600,3953=>600,3954=>600,3955=>600,3956=>600,3957=>600,3958=>600,3959=>600,3960=>600,3961=>600, - 3962=>600,3963=>600,3964=>600,3965=>600,3966=>600,3967=>600,3968=>600,3969=>600,3970=>600,3971=>600,3972=>600,3973=>600,3974=>600,3975=>600,3976=>600,3977=>600, - 3978=>600,3979=>600,3984=>600,3985=>600,3986=>600,3987=>600,3988=>600,3989=>600,3991=>600,3993=>600,3994=>600,3995=>600,3996=>600,3997=>600,3998=>600,3999=>600, - 4000=>600,4001=>600,4002=>600,4003=>600,4004=>600,4005=>600,4006=>600,4007=>600,4008=>600,4009=>600,4010=>600,4011=>600,4012=>600,4013=>600,4017=>600,4018=>600, - 4019=>600,4020=>600,4021=>600,4022=>600,4023=>600,4025=>600,4256=>662,4257=>677,4258=>708,4259=>696,4260=>609,4261=>790,4262=>664,4263=>785,4264=>560,4265=>634, - 4266=>782,4267=>701,4268=>629,4269=>682,4270=>705,4271=>692,4272=>734,4273=>615,4274=>592,4275=>680,4276=>679,4277=>705,4278=>643,4279=>623,4280=>623,4281=>629, - 4282=>633,4283=>770,4284=>592,4285=>662,4286=>629,4287=>672,4288=>735,4289=>576,4290=>606,4291=>605,4292=>676,4293=>792,4304=>435,4305=>556,4306=>565,4307=>872, - 4308=>506,4309=>544,4310=>723,4311=>868,4312=>530,4313=>532,4314=>955,4315=>552,4316=>565,4317=>712,4318=>547,4319=>574,4320=>685,4321=>554,4322=>806,4323=>810, - 4324=>777,4325=>502,4326=>686,4327=>512,4328=>552,4329=>496,4330=>568,4331=>552,4332=>592,4333=>565,4334=>552,4335=>741,4336=>549,4337=>659,4338=>559,4339=>524, - 4340=>482,4341=>565,4342=>822,4347=>506,4352=>1000,4353=>1000,4354=>1000,4355=>1000,4356=>1000,4357=>1000,4358=>1000,4359=>1000,4360=>1000,4361=>1000,4362=>1000,4363=>1000, - 4364=>1000,4365=>1000,4366=>1000,4367=>1000,4368=>1000,4369=>1000,4370=>1000,4371=>1000,4372=>1000,4373=>1000,4374=>1000,4375=>1000,4376=>1000,4377=>1000,4378=>1000,4379=>1000, - 4380=>1000,4381=>1000,4382=>1000,4383=>1000,4384=>1000,4385=>1000,4386=>1000,4387=>1000,4388=>1000,4389=>1000,4390=>1000,4391=>1000,4392=>1000,4393=>1000,4394=>1000,4395=>1000, - 4396=>1000,4397=>1000,4398=>1000,4399=>1000,4400=>1000,4401=>1000,4402=>1000,4403=>1000,4404=>1000,4405=>1000,4406=>1000,4407=>1000,4408=>1000,4409=>1000,4410=>1000,4411=>1000, - 4412=>1000,4413=>1000,4414=>1000,4415=>1000,4416=>1000,4417=>1000,4418=>1000,4419=>1000,4420=>1000,4421=>1000,4422=>1000,4423=>1000,4424=>1000,4425=>1000,4426=>1000,4427=>1000, - 4428=>1000,4429=>1000,4430=>1000,4431=>1000,4432=>1000,4433=>1000,4434=>1000,4435=>1000,4436=>1000,4437=>1000,4438=>1000,4439=>1000,4440=>1000,4441=>1000,4447=>1000,4448=>1000, - 4449=>1000,4450=>1000,4451=>1000,4452=>1000,4453=>1000,4454=>1000,4455=>1000,4456=>1000,4457=>1000,4458=>1000,4459=>1000,4460=>1000,4461=>1000,4462=>1000,4463=>1000,4464=>1000, - 4465=>1000,4466=>1000,4467=>1000,4468=>1000,4469=>1000,4470=>1000,4471=>1000,4472=>1000,4473=>1000,4474=>1000,4475=>1000,4476=>1000,4477=>1000,4478=>1000,4479=>1000,4480=>1000, - 4481=>1000,4482=>1000,4483=>1000,4484=>1000,4485=>1000,4486=>1000,4487=>1000,4488=>1000,4489=>1000,4490=>1000,4491=>1000,4492=>1000,4493=>1000,4494=>1000,4495=>1000,4496=>1000, - 4497=>1000,4498=>1000,4499=>1000,4500=>1000,4501=>1000,4502=>1000,4503=>1000,4504=>1000,4505=>1000,4506=>1000,4507=>1000,4508=>1000,4509=>1000,4510=>1000,4511=>1000,4512=>1000, - 4513=>1000,4514=>1000,4520=>1000,4521=>1000,4522=>1000,4523=>1000,4524=>1000,4525=>1000,4526=>1000,4527=>1000,4528=>1000,4529=>1000,4530=>1000,4531=>1000,4532=>1000,4533=>1000, - 4534=>1000,4535=>1000,4536=>1000,4537=>1000,4538=>1000,4539=>1000,4540=>1000,4541=>1000,4542=>1000,4543=>1000,4544=>1000,4545=>1000,4546=>1000,4547=>1000,4548=>1000,4549=>1000, - 4550=>1000,4551=>1000,4552=>1000,4553=>1000,4554=>1000,4555=>1000,4556=>1000,4557=>1000,4558=>1000,4559=>1000,4560=>1000,4561=>1000,4562=>1000,4563=>1000,4564=>1000,4565=>1000, - 4566=>1000,4567=>1000,4568=>1000,4569=>1000,4570=>1000,4571=>1000,4572=>1000,4573=>1000,4574=>1000,4575=>1000,4576=>1000,4577=>1000,4578=>1000,4579=>1000,4580=>1000,4581=>1000, - 4582=>1000,4583=>1000,4584=>1000,4585=>1000,4586=>1000,4587=>1000,4588=>1000,4589=>1000,4590=>1000,4591=>1000,4592=>1000,4593=>1000,4594=>1000,4595=>1000,4596=>1000,4597=>1000, - 4598=>1000,4599=>1000,4600=>1000,4601=>1000,7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722,7691=>556, - 7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556, - 7708=>667,7709=>556,7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722,7721=>556,7722=>722,7723=>556, - 7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, - 7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556, - 7756=>778,7757=>556,7758=>778,7759=>556,7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722,7771=>333, - 7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278, - 7788=>611,7789=>278,7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556, - 7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, - 7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556,7831=>278,7832=>722,7833=>500,7834=>556,7835=>278, - 7840=>667,7841=>556,7842=>667,7843=>556,7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667,7855=>556, - 7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556, - 7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778,7885=>556,7886=>778,7887=>556, - 7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778,7895=>556,7896=>778,7897=>556,7898=>776,7899=>556,7900=>776,7901=>556,7902=>776,7903=>556, - 7904=>776,7905=>556,7906=>776,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>620,7914=>776,7915=>620,7916=>776,7917=>620,7918=>776,7919=>620, - 7920=>776,7921=>620,7922=>667,7923=>500,7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>576,7937=>576,7938=>576,7939=>576,7940=>576,7941=>576, - 7942=>576,7943=>576,7944=>667,7945=>667,7946=>680,7947=>680,7948=>680,7949=>680,7950=>718,7951=>718,7952=>434,7953=>434,7954=>434,7955=>434,7956=>434,7957=>434, - 7960=>692,7961=>692,7962=>823,7963=>823,7964=>823,7965=>823,7968=>556,7969=>556,7970=>556,7971=>556,7972=>556,7973=>556,7974=>556,7975=>556,7976=>747,7977=>747, - 7978=>878,7979=>878,7980=>878,7981=>878,7982=>923,7983=>923,7984=>222,7985=>222,7986=>222,7987=>222,7988=>222,7989=>222,7990=>222,7991=>222,7992=>303,7993=>303, - 7994=>434,7995=>434,7996=>434,7997=>434,7998=>479,7999=>479,8000=>556,8001=>556,8002=>556,8003=>556,8004=>556,8005=>556,8008=>778,8009=>778,8010=>894,8011=>894, - 8012=>894,8013=>894,8016=>551,8017=>551,8018=>551,8019=>551,8020=>551,8021=>551,8022=>551,8023=>551,8025=>777,8027=>893,8029=>885,8031=>940,8032=>766,8033=>766, - 8034=>766,8035=>766,8036=>766,8037=>766,8038=>766,8039=>766,8040=>758,8041=>758,8042=>874,8043=>874,8044=>868,8045=>867,8046=>911,8047=>911,8048=>576,8049=>576, - 8050=>434,8051=>434,8052=>556,8053=>556,8054=>222,8055=>222,8056=>556,8057=>556,8058=>551,8059=>551,8060=>766,8061=>766,8064=>576,8065=>576,8066=>576,8067=>576, - 8068=>576,8069=>576,8070=>576,8071=>576,8072=>667,8073=>667,8074=>680,8075=>680,8076=>680,8077=>680,8078=>718,8079=>718,8080=>556,8081=>556,8082=>556,8083=>556, - 8084=>556,8085=>556,8086=>556,8087=>556,8088=>747,8089=>747,8090=>878,8091=>878,8092=>878,8093=>878,8094=>923,8095=>923,8096=>766,8097=>766,8098=>766,8099=>766, - 8100=>766,8101=>766,8102=>766,8103=>766,8104=>758,8105=>758,8106=>874,8107=>874,8108=>868,8109=>867,8110=>911,8111=>911,8112=>576,8113=>576,8114=>576,8115=>576, - 8116=>576,8118=>576,8119=>576,8120=>667,8121=>667,8122=>667,8123=>667,8124=>667,8125=>278,8126=>278,8127=>278,8128=>278,8129=>278,8130=>556,8131=>556,8132=>556, - 8134=>556,8135=>556,8136=>693,8137=>704,8138=>748,8139=>759,8140=>722,8141=>278,8142=>278,8143=>278,8144=>222,8145=>222,8146=>222,8147=>222,8150=>222,8151=>222, - 8152=>278,8153=>278,8154=>304,8155=>304,8157=>278,8158=>278,8159=>278,8160=>551,8161=>551,8162=>551,8163=>551,8164=>571,8165=>571,8166=>551,8167=>551,8168=>667, - 8169=>667,8170=>742,8171=>746,8172=>693,8173=>278,8174=>278,8175=>278,8178=>766,8179=>766,8180=>766,8182=>766,8183=>766,8184=>778,8185=>778,8186=>758,8187=>758, - 8188=>758,8189=>278,8190=>278,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>100,8202=>50,8203=>0,8204=>0, - 8205=>0,8208=>333,8209=>333,8210=>556,8213=>564,8214=>428,8215=>500,8219=>222,8223=>333,8227=>350,8228=>278,8229=>556,8231=>278,8232=>0,8233=>0,8241=>1330, - 8242=>222,8243=>372,8244=>522,8245=>206,8246=>356,8247=>506,8248=>312,8251=>1000,8252=>471,8253=>556,8254=>500,8255=>945,8256=>945,8257=>312,8258=>820,8259=>333, - 8260=>167,8261=>278,8262=>278,8304=>333,8308=>333,8309=>333,8310=>333,8311=>333,8312=>333,8313=>333,8314=>333,8315=>333,8316=>333,8317=>210,8318=>210,8319=>333, - 8320=>333,8321=>333,8322=>333,8323=>333,8324=>333,8325=>333,8326=>333,8327=>333,8328=>333,8329=>333,8330=>333,8331=>333,8332=>333,8333=>210,8334=>210,8352=>556, - 8353=>556,8354=>556,8355=>556,8356=>556,8357=>833,8358=>556,8359=>556,8360=>1024,8361=>940,8362=>784,8363=>556,8400=>600,8401=>600,8402=>600,8403=>600,8404=>700, - 8405=>700,8406=>600,8407=>600,8408=>600,8409=>600,8410=>600,8411=>600,8412=>600,8413=>900,8414=>900,8415=>900,8416=>900,8417=>700,8448=>889,8449=>889,8450=>667, - 8451=>1022,8452=>611,8453=>889,8454=>889,8455=>501,8456=>667,8457=>921,8458=>510,8459=>906,8460=>988,8461=>722,8462=>500,8463=>500,8464=>688,8465=>553,8466=>708, - 8467=>291,8468=>778,8469=>722,8470=>1073,8471=>737,8472=>740,8473=>556,8474=>722,8475=>927,8476=>795,8477=>667,8478=>667,8479=>667,8480=>1000,8481=>1174,8483=>722, - 8484=>611,8485=>542,8486=>768,8487=>768,8488=>698,8489=>321,8490=>667,8491=>667,8492=>927,8493=>646,8494=>556,8495=>385,8496=>615,8497=>688,8498=>611,8499=>1115, - 8500=>406,8501=>688,8502=>688,8503=>344,8504=>688,8531=>834,8532=>834,8533=>834,8534=>834,8535=>834,8536=>834,8537=>834,8538=>834,8539=>834,8540=>834,8541=>834, - 8542=>834,8543=>834,8544=>278,8545=>555,8546=>832,8547=>933,8548=>667,8549=>934,8550=>1031,8551=>1268,8552=>944,8553=>667,8554=>944,8555=>1035,8556=>556,8557=>722, - 8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>700,8564=>500,8565=>700,8566=>922,8567=>1144,8568=>712,8569=>500,8570=>712,8571=>934,8572=>222,8573=>500, - 8574=>556,8575=>833,8576=>983,8577=>722,8578=>983,8592=>713,8593=>713,8594=>713,8595=>713,8596=>713,8597=>713,8598=>713,8599=>713,8600=>713,8601=>713,8602=>713, - 8603=>713,8604=>713,8605=>713,8606=>713,8607=>713,8608=>713,8609=>713,8610=>713,8611=>713,8612=>713,8613=>713,8614=>713,8615=>713,8616=>713,8617=>713,8618=>713, - 8619=>713,8620=>713,8621=>813,8622=>813,8623=>713,8624=>713,8625=>713,8626=>713,8627=>713,8628=>713,8629=>713,8630=>713,8631=>713,8632=>713,8633=>713,8634=>800, - 8635=>800,8636=>713,8637=>713,8638=>713,8639=>713,8640=>713,8641=>713,8642=>713,8643=>713,8644=>713,8645=>713,8646=>713,8647=>713,8648=>713,8649=>713,8650=>713, - 8651=>713,8652=>713,8653=>713,8654=>950,8655=>713,8656=>713,8657=>713,8658=>713,8659=>713,8660=>863,8661=>713,8662=>713,8663=>713,8664=>713,8665=>713,8666=>713, - 8667=>713,8668=>813,8669=>813,8670=>713,8671=>713,8672=>713,8673=>713,8674=>713,8675=>713,8676=>713,8677=>713,8678=>713,8679=>713,8680=>713,8681=>713,8682=>713, - 8704=>600,8705=>600,8706=>494,8707=>600,8708=>600,8709=>800,8710=>612,8711=>612,8712=>549,8713=>549,8714=>549,8715=>549,8716=>549,8717=>549,8718=>549,8719=>823, - 8720=>823,8721=>713,8722=>584,8723=>584,8724=>584,8725=>167,8726=>278,8727=>389,8728=>400,8729=>400,8730=>600,8731=>600,8732=>600,8733=>549,8734=>549,8735=>584, - 8736=>584,8737=>584,8738=>584,8739=>260,8740=>444,8741=>418,8742=>602,8743=>561,8744=>561,8745=>561,8746=>561,8747=>506,8748=>806,8749=>1106,8750=>506,8751=>806, - 8752=>1106,8753=>506,8754=>506,8755=>506,8756=>561,8757=>561,8758=>422,8759=>561,8760=>584,8761=>584,8762=>584,8763=>584,8764=>584,8765=>584,8766=>584,8767=>584, - 8768=>422,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584,8775=>584,8776=>584,8777=>584,8778=>584,8779=>584,8780=>584,8781=>584,8782=>584,8783=>584, - 8784=>584,8785=>584,8786=>584,8787=>584,8788=>737,8789=>737,8790=>584,8791=>584,8792=>584,8793=>584,8794=>584,8795=>584,8796=>584,8797=>584,8798=>584,8799=>584, - 8800=>584,8801=>584,8802=>584,8803=>584,8804=>584,8805=>584,8806=>584,8807=>584,8808=>584,8809=>584,8810=>969,8811=>969,8812=>584,8813=>584,8814=>584,8815=>584, - 8816=>584,8817=>584,8818=>584,8819=>584,8820=>584,8821=>584,8822=>584,8823=>584,8824=>584,8825=>584,8826=>584,8827=>584,8828=>584,8829=>584,8830=>584,8831=>584, - 8832=>584,8833=>584,8834=>678,8835=>678,8836=>678,8837=>678,8838=>678,8839=>678,8840=>678,8841=>678,8842=>678,8843=>678,8844=>561,8845=>561,8846=>561,8847=>678, - 8848=>678,8849=>673,8850=>673,8851=>561,8852=>561,8853=>800,8854=>800,8855=>800,8856=>800,8857=>800,8858=>800,8859=>800,8860=>800,8861=>800,8862=>800,8863=>800, - 8864=>800,8865=>800,8866=>549,8867=>549,8868=>549,8869=>549,8870=>399,8871=>399,8872=>549,8873=>549,8874=>549,8875=>672,8876=>549,8877=>549,8878=>549,8879=>672, - 8880=>549,8881=>549,8882=>549,8883=>549,8884=>549,8885=>549,8886=>713,8887=>713,8888=>713,8889=>549,8890=>549,8891=>584,8892=>584,8893=>584,8894=>584,8895=>584, - 8896=>561,8897=>561,8898=>561,8899=>561,8900=>549,8901=>250,8902=>549,8903=>649,8904=>630,8905=>630,8906=>630,8907=>630,8908=>630,8909=>584,8910=>561,8911=>561, - 8912=>668,8913=>668,8914=>668,8915=>668,8916=>561,8917=>602,8918=>584,8919=>584,8920=>1354,8921=>1354,8922=>584,8923=>584,8924=>584,8925=>584,8926=>584,8927=>584, - 8928=>584,8929=>584,8930=>673,8931=>673,8932=>673,8933=>673,8934=>584,8935=>584,8936=>584,8937=>584,8938=>584,8939=>584,8940=>584,8941=>584,8942=>278,8943=>1000, - 8944=>1000,8945=>1000,8960=>549,8962=>549,8963=>549,8964=>549,8965=>549,8966=>549,8967=>549,8968=>449,8969=>449,8970=>449,8971=>449,8972=>549,8973=>549,8974=>549, - 8975=>549,8976=>549,8977=>549,8978=>800,8979=>800,8980=>549,8981=>549,8982=>549,8983=>650,8984=>780,8985=>549,8986=>549,8987=>549,8988=>549,8989=>549,8990=>549, - 8991=>549,8992=>506,8993=>506,8994=>713,8995=>713,8996=>1000,8997=>1000,8998=>1000,8999=>1000,9000=>1000,9001=>329,9002=>329,9003=>1000,9004=>549,9005=>549,9006=>549, - 9007=>549,9008=>549,9009=>549,9010=>549,9011=>549,9012=>549,9013=>549,9014=>600,9015=>600,9016=>600,9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600, - 9023=>600,9024=>600,9025=>600,9026=>600,9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600,9037=>600,9038=>600, - 9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600,9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600, - 9055=>600,9056=>600,9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600,9067=>600,9068=>600,9069=>600,9070=>600, - 9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600,9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9109=>600,9216=>600,9217=>600,9218=>600, - 9219=>600,9220=>600,9221=>600,9222=>600,9223=>600,9224=>600,9225=>600,9226=>600,9227=>600,9228=>600,9229=>600,9230=>600,9231=>600,9232=>600,9233=>600,9234=>600, - 9235=>600,9236=>600,9237=>600,9238=>600,9239=>600,9240=>600,9241=>600,9242=>600,9243=>600,9244=>600,9245=>600,9246=>600,9247=>600,9248=>600,9249=>600,9250=>600, - 9251=>600,9252=>600,9280=>604,9281=>604,9282=>604,9283=>604,9284=>604,9285=>604,9286=>750,9287=>750,9288=>750,9289=>750,9290=>604,9312=>1000,9313=>1000,9314=>1000, - 9315=>1000,9316=>1000,9317=>1000,9318=>1000,9319=>1000,9320=>1000,9321=>1000,9322=>1000,9323=>1000,9324=>1000,9325=>1000,9326=>1000,9327=>1000,9328=>1000,9329=>1000,9330=>1000, - 9331=>1000,9332=>1000,9333=>1000,9334=>1000,9335=>1000,9336=>1000,9337=>1000,9338=>1000,9339=>1000,9340=>1000,9341=>1000,9342=>1000,9343=>1000,9344=>1000,9345=>1000,9346=>1000, - 9347=>1000,9348=>1000,9349=>1000,9350=>1000,9351=>1000,9352=>1000,9353=>1000,9354=>1000,9355=>1000,9356=>1000,9357=>1000,9358=>1000,9359=>1000,9360=>1000,9361=>1000,9362=>1000, - 9363=>1000,9364=>1000,9365=>1000,9366=>1000,9367=>1000,9368=>1000,9369=>1000,9370=>1000,9371=>1000,9372=>1000,9373=>1000,9374=>1000,9375=>1000,9376=>1000,9377=>1000,9378=>1000, - 9379=>1000,9380=>1000,9381=>1000,9382=>1000,9383=>1000,9384=>1000,9385=>1000,9386=>1000,9387=>1000,9388=>1000,9389=>1000,9390=>1000,9391=>1000,9392=>1000,9393=>1000,9394=>1000, - 9395=>1000,9396=>1000,9397=>1000,9398=>1000,9399=>1000,9400=>1000,9401=>1000,9402=>1000,9403=>1000,9404=>1000,9405=>1000,9406=>1000,9407=>1000,9408=>1000,9409=>1000,9410=>1000, - 9411=>1000,9412=>1000,9413=>1000,9414=>1000,9415=>1000,9416=>1000,9417=>1000,9418=>1000,9419=>1000,9420=>1000,9421=>1000,9422=>1000,9423=>1000,9424=>1000,9425=>1000,9426=>1000, - 9427=>1000,9428=>1000,9429=>1000,9430=>1000,9431=>1000,9432=>1000,9433=>1000,9434=>1000,9435=>1000,9436=>1000,9437=>1000,9438=>1000,9439=>1000,9440=>1000,9441=>1000,9442=>1000, - 9443=>1000,9444=>1000,9445=>1000,9446=>1000,9447=>1000,9448=>1000,9449=>1000,9450=>1000,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600, - 9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600, - 9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600, - 9512=>600,9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600,9527=>600, - 9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600, - 9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600, - 9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600, - 9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600, - 9592=>600,9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600,9607=>600, - 9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600, - 9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600, - 9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600, - 9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600,9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600, - 9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600,9693=>600,9694=>600,9695=>600,9696=>600,9697=>600, - 9698=>600,9699=>600,9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9728=>750,9729=>1000, - 9730=>750,9731=>750,9732=>1000,9733=>816,9734=>823,9735=>500,9736=>500,9737=>800,9738=>800,9739=>800,9740=>800,9741=>800,9742=>719,9743=>719,9744=>734,9745=>734, - 9746=>734,9747=>762,9754=>960,9755=>960,9756=>939,9757=>939,9758=>939,9759=>939,9760=>750,9761=>600,9762=>750,9763=>750,9764=>580,9765=>460,9766=>444,9767=>650, - 9768=>444,9769=>768,9770=>800,9771=>850,9772=>675,9773=>800,9774=>750,9775=>750,9776=>900,9777=>900,9778=>900,9779=>900,9780=>900,9781=>900,9782=>900,9783=>900, - 9784=>750,9785=>750,9786=>750,9787=>750,9788=>750,9789=>750,9790=>750,9791=>740,9792=>740,9793=>740,9794=>740,9795=>653,9796=>490,9797=>632,9798=>780,9799=>560, - 9800=>838,9801=>780,9802=>734,9803=>887,9804=>780,9805=>1080,9806=>896,9807=>1080,9808=>804,9809=>868,9810=>922,9811=>696,9812=>1000,9813=>1000,9814=>1000,9815=>1000, - 9816=>1000,9817=>1000,9818=>1000,9819=>1000,9820=>1000,9821=>1000,9822=>1000,9823=>1000,9824=>722,9825=>734,9826=>674,9827=>804,9828=>722,9829=>734,9830=>674,9831=>804, - 9832=>860,9833=>423,9834=>592,9835=>750,9836=>750,9837=>439,9838=>439,9839=>439,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791,9993=>690, - 9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846,10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759, - 10012=>754,10013=>494,10014=>552,10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823,10026=>789,10027=>841,10028=>823, - 10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749,10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708, - 10045=>682,10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786,10056=>787,10057=>713,10058=>791,10059=>785,10061=>873, - 10063=>762,10064=>762,10065=>759,10066=>759,10070=>784,10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544,10084=>910, - 10085=>667,10086=>760,10087=>760,10102=>788,10103=>788,10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788,10114=>788, - 10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788,10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788, - 10131=>788,10132=>894,10136=>748,10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924,10147=>924,10148=>917,10149=>930, - 10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867,10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771, - 10167=>888,10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,12288=>1000,12289=>1000,12290=>1000,12291=>1000,12292=>1000,12293=>1000,12294=>1000,12295=>1000, - 12296=>1000,12297=>1000,12298=>1000,12299=>1000,12300=>1000,12301=>1000,12302=>1000,12303=>1000,12304=>1000,12305=>1000,12306=>1000,12307=>1000,12308=>1000,12309=>1000,12310=>1000,12311=>1000, - 12312=>1000,12313=>1000,12314=>1000,12315=>1000,12316=>1000,12317=>1000,12318=>1000,12319=>1000,12320=>1000,12321=>1000,12322=>1000,12323=>1000,12324=>1000,12325=>1000,12326=>1000,12327=>1000, - 12328=>1000,12329=>1000,12330=>1000,12331=>1000,12332=>1000,12333=>1000,12334=>1000,12335=>1000,12336=>1000,12337=>1000,12338=>1000,12339=>1000,12340=>1000,12341=>1000,12342=>1000,12343=>1000, - 12351=>1000,12353=>1000,12354=>1000,12355=>1000,12356=>1000,12357=>1000,12358=>1000,12359=>1000,12360=>1000,12361=>1000,12362=>1000,12363=>1000,12364=>1000,12365=>1000,12366=>1000,12367=>1000, - 12368=>1000,12369=>1000,12370=>1000,12371=>1000,12372=>1000,12373=>1000,12374=>1000,12375=>1000,12376=>1000,12377=>1000,12378=>1000,12379=>1000,12380=>1000,12381=>1000,12382=>1000,12383=>1000, - 12384=>1000,12385=>1000,12386=>1000,12387=>1000,12388=>1000,12389=>1000,12390=>1000,12391=>1000,12392=>1000,12393=>1000,12394=>1000,12395=>1000,12396=>1000,12397=>1000,12398=>1000,12399=>1000, - 12400=>1000,12401=>1000,12402=>1000,12403=>1000,12404=>1000,12405=>1000,12406=>1000,12407=>1000,12408=>1000,12409=>1000,12410=>1000,12411=>1000,12412=>1000,12413=>1000,12414=>1000,12415=>1000, - 12416=>1000,12417=>1000,12418=>1000,12419=>1000,12420=>1000,12421=>1000,12422=>1000,12423=>1000,12424=>1000,12425=>1000,12426=>1000,12427=>1000,12428=>1000,12429=>1000,12430=>1000,12431=>1000, - 12432=>1000,12433=>1000,12434=>1000,12435=>1000,12436=>1000,12441=>1000,12442=>1000,12443=>1000,12444=>1000,12445=>1000,12446=>1000,12449=>1000,12450=>1000,12451=>1000,12452=>1000,12453=>1000, - 12454=>1000,12455=>1000,12456=>1000,12457=>1000,12458=>1000,12459=>1000,12460=>1000,12461=>1000,12462=>1000,12463=>1000,12464=>1000,12465=>1000,12466=>1000,12467=>1000,12468=>1000,12469=>1000, - 12470=>1000,12471=>1000,12472=>1000,12473=>1000,12474=>1000,12475=>1000,12476=>1000,12477=>1000,12478=>1000,12479=>1000,12480=>1000,12481=>1000,12482=>1000,12483=>1000,12484=>1000,12485=>1000, - 12486=>1000,12487=>1000,12488=>1000,12489=>1000,12490=>1000,12491=>1000,12492=>1000,12493=>1000,12494=>1000,12495=>1000,12496=>1000,12497=>1000,12498=>1000,12499=>1000,12500=>1000,12501=>1000, - 12502=>1000,12503=>1000,12504=>1000,12505=>1000,12506=>1000,12507=>1000,12508=>1000,12509=>1000,12510=>1000,12511=>1000,12512=>1000,12513=>1000,12514=>1000,12515=>1000,12516=>1000,12517=>1000, - 12518=>1000,12519=>1000,12520=>1000,12521=>1000,12522=>1000,12523=>1000,12524=>1000,12525=>1000,12526=>1000,12527=>1000,12528=>1000,12529=>1000,12530=>1000,12531=>1000,12532=>1000,12533=>1000, - 12534=>1000,12535=>1000,12536=>1000,12537=>1000,12538=>1000,12539=>1000,12540=>1000,12541=>1000,12542=>1000,12549=>1000,12550=>1000,12551=>1000,12552=>1000,12553=>1000,12554=>1000,12555=>1000, - 12556=>1000,12557=>1000,12558=>1000,12559=>1000,12560=>1000,12561=>1000,12562=>1000,12563=>1000,12564=>1000,12565=>1000,12566=>1000,12567=>1000,12568=>1000,12569=>1000,12570=>1000,12571=>1000, - 12572=>1000,12573=>1000,12574=>1000,12575=>1000,12576=>1000,12577=>1000,12578=>1000,12579=>1000,12580=>1000,12581=>1000,12582=>1000,12583=>1000,12584=>1000,12585=>1000,12586=>1000,12587=>1000, - 12588=>1000,12593=>1000,12594=>1000,12595=>1000,12596=>1000,12597=>1000,12598=>1000,12599=>1000,12600=>1000,12601=>1000,12602=>1000,12603=>1000,12604=>1000,12605=>1000,12606=>1000,12607=>1000, - 12608=>1000,12609=>1000,12610=>1000,12611=>1000,12612=>1000,12613=>1000,12614=>1000,12615=>1000,12616=>1000,12617=>1000,12618=>1000,12619=>1000,12620=>1000,12621=>1000,12622=>1000,12623=>1000, - 12624=>1000,12625=>1000,12626=>1000,12627=>1000,12628=>1000,12629=>1000,12630=>1000,12631=>1000,12632=>1000,12633=>1000,12634=>1000,12635=>1000,12636=>1000,12637=>1000,12638=>1000,12639=>1000, - 12640=>1000,12641=>1000,12642=>1000,12643=>1000,12644=>1000,12645=>1000,12646=>1000,12647=>1000,12648=>1000,12649=>1000,12650=>1000,12651=>1000,12652=>1000,12653=>1000,12654=>1000,12655=>1000, - 12656=>1000,12657=>1000,12658=>1000,12659=>1000,12660=>1000,12661=>1000,12662=>1000,12663=>1000,12664=>1000,12665=>1000,12666=>1000,12667=>1000,12668=>1000,12669=>1000,12670=>1000,12671=>1000, - 12672=>1000,12673=>1000,12674=>1000,12675=>1000,12676=>1000,12677=>1000,12678=>1000,12679=>1000,12680=>1000,12681=>1000,12682=>1000,12683=>1000,12684=>1000,12685=>1000,12686=>1000,12688=>1000, - 12689=>1000,12690=>1000,12691=>1000,12692=>1000,12693=>1000,12694=>1000,12695=>1000,12696=>1000,12697=>1000,12698=>1000,12699=>1000,12700=>1000,12701=>1000,12702=>1000,12703=>1000,12800=>1000, - 12801=>1000,12802=>1000,12803=>1000,12804=>1000,12805=>1000,12806=>1000,12807=>1000,12808=>1000,12809=>1000,12810=>1000,12811=>1000,12812=>1000,12813=>1000,12814=>1000,12815=>1000,12816=>1000, - 12817=>1000,12818=>1000,12819=>1000,12820=>1000,12821=>1000,12822=>1000,12823=>1000,12824=>1000,12825=>1000,12826=>1000,12827=>1000,12828=>1000,12832=>1000,12833=>1000,12834=>1000,12835=>1000, - 12836=>1000,12837=>1000,12838=>1000,12839=>1000,12840=>1000,12841=>1000,12842=>1000,12843=>1000,12844=>1000,12845=>1000,12846=>1000,12847=>1000,12848=>1000,12849=>1000,12850=>1000,12851=>1000, - 12852=>1000,12853=>1000,12854=>1000,12855=>1000,12856=>1000,12857=>1000,12858=>1000,12859=>1000,12860=>1000,12861=>1000,12862=>1000,12863=>1000,12864=>1000,12865=>1000,12866=>1000,12867=>1000, - 12896=>1000,12897=>1000,12898=>1000,12899=>1000,12900=>1000,12901=>1000,12902=>1000,12903=>1000,12904=>1000,12905=>1000,12906=>1000,12907=>1000,12908=>1000,12909=>1000,12910=>1000,12911=>1000, - 12912=>1000,12913=>1000,12914=>1000,12915=>1000,12916=>1000,12917=>1000,12918=>1000,12919=>1000,12920=>1000,12921=>1000,12922=>1000,12923=>1000,12927=>1000,12928=>1000,12929=>1000,12930=>1000, - 12931=>1000,12932=>1000,12933=>1000,12934=>1000,12935=>1000,12936=>1000,12937=>1000,12938=>1000,12939=>1000,12940=>1000,12941=>1000,12942=>1000,12943=>1000,12944=>1000,12945=>1000,12946=>1000, - 12947=>1000,12948=>1000,12949=>1000,12950=>1000,12951=>1000,12952=>1000,12953=>1000,12954=>1000,12955=>1000,12956=>1000,12957=>1000,12958=>1000,12959=>1000,12960=>1000,12961=>1000,12962=>1000, - 12963=>1000,12964=>1000,12965=>1000,12966=>1000,12967=>1000,12968=>1000,12969=>1000,12970=>1000,12971=>1000,12972=>1000,12973=>1000,12974=>1000,12975=>1000,12976=>1000,12992=>1000,12993=>1000, - 12994=>1000,12995=>1000,12996=>1000,12997=>1000,12998=>1000,12999=>1000,13000=>1000,13001=>1000,13002=>1000,13003=>1000,13008=>1000,13009=>1000,13010=>1000,13011=>1000,13012=>1000,13013=>1000, - 13014=>1000,13015=>1000,13016=>1000,13017=>1000,13018=>1000,13019=>1000,13020=>1000,13021=>1000,13022=>1000,13023=>1000,13024=>1000,13025=>1000,13026=>1000,13027=>1000,13028=>1000,13029=>1000, - 13030=>1000,13031=>1000,13032=>1000,13033=>1000,13034=>1000,13035=>1000,13036=>1000,13037=>1000,13038=>1000,13039=>1000,13040=>1000,13041=>1000,13042=>1000,13043=>1000,13044=>1000,13045=>1000, - 13046=>1000,13047=>1000,13048=>1000,13049=>1000,13050=>1000,13051=>1000,13052=>1000,13053=>1000,13054=>1000,13056=>1000,13057=>1000,13058=>1000,13059=>1000,13060=>1000,13061=>1000,13062=>1000, - 13063=>1000,13064=>1000,13065=>1000,13066=>1000,13067=>1000,13068=>1000,13069=>1000,13070=>1000,13071=>1000,13072=>1000,13073=>1000,13074=>1000,13075=>1000,13076=>1000,13077=>1000,13078=>1000, - 13079=>1000,13080=>1000,13081=>1000,13082=>1000,13083=>1000,13084=>1000,13085=>1000,13086=>1000,13087=>1000,13088=>1000,13089=>1000,13090=>1000,13091=>1000,13092=>1000,13093=>1000,13094=>1000, - 13095=>1000,13096=>1000,13097=>1000,13098=>1000,13099=>1000,13100=>1000,13101=>1000,13102=>1000,13103=>1000,13104=>1000,13105=>1000,13106=>1000,13107=>1000,13108=>1000,13109=>1000,13110=>1000, - 13111=>1000,13112=>1000,13113=>1000,13114=>1000,13115=>1000,13116=>1000,13117=>1000,13118=>1000,13119=>1000,13120=>1000,13121=>1000,13122=>1000,13123=>1000,13124=>1000,13125=>1000,13126=>1000, - 13127=>1000,13128=>1000,13129=>1000,13130=>1000,13131=>1000,13132=>1000,13133=>1000,13134=>1000,13135=>1000,13136=>1000,13137=>1000,13138=>1000,13139=>1000,13140=>1000,13141=>1000,13142=>1000, - 13143=>1000,13144=>1000,13145=>1000,13146=>1000,13147=>1000,13148=>1000,13149=>1000,13150=>1000,13151=>1000,13152=>1000,13153=>1000,13154=>1000,13155=>1000,13156=>1000,13157=>1000,13158=>1000, - 13159=>1000,13160=>1000,13161=>1000,13162=>1000,13163=>1000,13164=>1000,13165=>1000,13166=>1000,13167=>1000,13168=>1000,13169=>1000,13170=>1000,13171=>1000,13172=>1000,13173=>1000,13174=>1000, - 13179=>1000,13180=>1000,13181=>1000,13182=>1000,13183=>1000,13184=>1000,13185=>1000,13186=>1000,13187=>1000,13188=>1000,13189=>1000,13190=>1000,13191=>1000,13192=>1000,13193=>1000,13194=>1000, - 13195=>1000,13196=>1000,13197=>1000,13198=>1000,13199=>1000,13200=>1000,13201=>1000,13202=>1000,13203=>1000,13204=>1000,13205=>1000,13206=>1000,13207=>1000,13208=>1000,13209=>1000,13210=>1000, - 13211=>1000,13212=>1000,13213=>1000,13214=>1000,13215=>1000,13216=>1000,13217=>1000,13218=>1000,13219=>1000,13220=>1000,13221=>1000,13222=>1000,13223=>1000,13224=>1000,13225=>1000,13226=>1000, - 13227=>1000,13228=>1000,13229=>1000,13230=>1000,13231=>1000,13232=>1000,13233=>1000,13234=>1000,13235=>1000,13236=>1000,13237=>1000,13238=>1000,13239=>1000,13240=>1000,13241=>1000,13242=>1000, - 13243=>1000,13244=>1000,13245=>1000,13246=>1000,13247=>1000,13248=>1000,13249=>1000,13250=>1000,13251=>1000,13252=>1000,13253=>1000,13254=>1000,13255=>1000,13256=>1000,13257=>1000,13258=>1000, - 13259=>1000,13260=>1000,13261=>1000,13262=>1000,13263=>1000,13264=>1000,13265=>1000,13266=>1000,13267=>1000,13268=>1000,13269=>1000,13270=>1000,13271=>1000,13272=>1000,13273=>1000,13274=>1000, - 13275=>1000,13276=>1000,13277=>1000,13280=>1000,13281=>1000,13282=>1000,13283=>1000,13284=>1000,13285=>1000,13286=>1000,13287=>1000,13288=>1000,13289=>1000,13290=>1000,13291=>1000,13292=>1000, - 13293=>1000,13294=>1000,13295=>1000,13296=>1000,13297=>1000,13298=>1000,13299=>1000,13300=>1000,13301=>1000,13302=>1000,13303=>1000,13304=>1000,13305=>1000,13306=>1000,13307=>1000,13308=>1000, - 13309=>1000,13310=>1000,59393=>316,59394=>507,59395=>507,59396=>484,59397=>484,59416=>0,59492=>480,59495=>480,59536=>458,59557=>466,59558=>480,59559=>903,61441=>500,61442=>500, - 63232=>541,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>849, - 63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>333,63261=>287,63744=>1000,63745=>1000,63746=>1000, - 63747=>1000,63748=>1000,63749=>1000,63750=>1000,63751=>1000,63752=>1000,63753=>1000,63754=>1000,63755=>1000,63756=>1000,63757=>1000,63758=>1000,63759=>1000,63760=>1000,63761=>1000,63762=>1000, - 63763=>1000,63764=>1000,63765=>1000,63766=>1000,63767=>1000,63768=>1000,63769=>1000,63770=>1000,63771=>1000,63772=>1000,63773=>1000,63774=>1000,63775=>1000,63776=>1000,63777=>1000,63778=>1000, - 63779=>1000,63780=>1000,63781=>1000,63782=>1000,63783=>1000,63784=>1000,63785=>1000,63786=>1000,63787=>1000,63788=>1000,63789=>1000,63790=>1000,63791=>1000,63792=>1000,63793=>1000,63794=>1000, - 63795=>1000,63796=>1000,63797=>1000,63798=>1000,63799=>1000,63800=>1000,63801=>1000,63802=>1000,63803=>1000,63804=>1000,63805=>1000,63806=>1000,63807=>1000,63808=>1000,63809=>1000,63810=>1000, - 63811=>1000,63812=>1000,63813=>1000,63814=>1000,63815=>1000,63816=>1000,63817=>1000,63818=>1000,63819=>1000,63820=>1000,63821=>1000,63822=>1000,63823=>1000,63824=>1000,63825=>1000,63826=>1000, - 63827=>1000,63828=>1000,63829=>1000,63830=>1000,63831=>1000,63832=>1000,63833=>1000,63834=>1000,63835=>1000,63836=>1000,63837=>1000,63838=>1000,63839=>1000,63840=>1000,63841=>1000,63842=>1000, - 63843=>1000,63844=>1000,63845=>1000,63846=>1000,63847=>1000,63848=>1000,63849=>1000,63850=>1000,63851=>1000,63852=>1000,63853=>1000,63854=>1000,63855=>1000,63856=>1000,63857=>1000,63858=>1000, - 63859=>1000,63860=>1000,63861=>1000,63862=>1000,63863=>1000,63864=>1000,63865=>1000,63866=>1000,63867=>1000,63868=>1000,63869=>1000,63870=>1000,63871=>1000,63872=>1000,63873=>1000,63874=>1000, - 63875=>1000,63876=>1000,63877=>1000,63878=>1000,63879=>1000,63880=>1000,63881=>1000,63882=>1000,63883=>1000,63884=>1000,63885=>1000,63886=>1000,63887=>1000,63888=>1000,63889=>1000,63890=>1000, - 63891=>1000,63892=>1000,63893=>1000,63894=>1000,63895=>1000,63896=>1000,63897=>1000,63898=>1000,63899=>1000,63900=>1000,63901=>1000,63902=>1000,63903=>1000,63904=>1000,63905=>1000,63906=>1000, - 63907=>1000,63908=>1000,63909=>1000,63910=>1000,63911=>1000,63912=>1000,63913=>1000,63914=>1000,63915=>1000,63916=>1000,63917=>1000,63918=>1000,63919=>1000,63920=>1000,63921=>1000,63922=>1000, - 63923=>1000,63924=>1000,63925=>1000,63926=>1000,63927=>1000,63928=>1000,63929=>1000,63930=>1000,63931=>1000,63932=>1000,63933=>1000,63934=>1000,63935=>1000,63936=>1000,63937=>1000,63938=>1000, - 63939=>1000,63940=>1000,63941=>1000,63942=>1000,63943=>1000,63944=>1000,63945=>1000,63946=>1000,63947=>1000,63948=>1000,63949=>1000,63950=>1000,63951=>1000,63952=>1000,63953=>1000,63954=>1000, - 63955=>1000,63956=>1000,63957=>1000,63958=>1000,63959=>1000,63960=>1000,63961=>1000,63962=>1000,63963=>1000,63964=>1000,63965=>1000,63966=>1000,63967=>1000,63968=>1000,63969=>1000,63970=>1000, - 63971=>1000,63972=>1000,63973=>1000,63974=>1000,63975=>1000,63976=>1000,63977=>1000,63978=>1000,63979=>1000,63980=>1000,63981=>1000,63982=>1000,63983=>1000,63984=>1000,63985=>1000,63986=>1000, - 63987=>1000,63988=>1000,63989=>1000,63990=>1000,63991=>1000,63992=>1000,63993=>1000,63994=>1000,63995=>1000,63996=>1000,63997=>1000,63998=>1000,63999=>1000,64000=>1000,64001=>1000,64002=>1000, - 64003=>1000,64004=>1000,64005=>1000,64006=>1000,64007=>1000,64008=>1000,64009=>1000,64010=>1000,64011=>1000,64012=>1000,64013=>1000,64014=>1000,64015=>1000,64016=>1000,64017=>1000,64018=>1000, - 64019=>1000,64020=>1000,64021=>1000,64022=>1000,64023=>1000,64024=>1000,64025=>1000,64026=>1000,64027=>1000,64028=>1000,64029=>1000,64030=>1000,64031=>1000,64032=>1000,64033=>1000,64034=>1000, - 64035=>1000,64036=>1000,64037=>1000,64038=>1000,64039=>1000,64040=>1000,64041=>1000,64042=>1000,64043=>1000,64044=>1000,64045=>1000,64256=>537,64257=>500,64258=>500,64259=>778,64260=>750, - 64261=>532,64262=>758,64275=>784,64276=>784,64277=>784,64278=>784,64279=>893,64286=>333,64287=>590,64288=>550,64289=>709,64290=>649,64291=>730,64292=>656,64293=>605,64294=>730, - 64295=>633,64296=>794,64297=>584,64298=>700,64299=>700,64300=>700,64301=>700,64302=>577,64303=>577,64304=>577,64305=>563,64306=>411,64307=>512,64308=>594,64309=>316,64310=>326, - 64312=>594,64313=>316,64314=>507,64315=>527,64316=>484,64318=>594,64320=>338,64321=>604,64323=>567,64324=>569,64326=>514,64327=>583,64328=>507,64329=>700,64330=>633,64331=>316, - 64332=>563,64333=>527,64334=>569,64335=>577,64336=>243,64337=>273,64338=>771,64339=>788,64340=>276,64341=>243,64342=>771,64343=>788,64344=>276,64345=>243,64346=>771,64347=>788, - 64348=>276,64349=>243,64350=>771,64351=>788,64352=>276,64353=>243,64354=>771,64355=>788,64356=>276,64357=>243,64358=>771,64359=>788,64360=>276,64361=>243,64362=>957,64363=>903, - 64364=>466,64365=>480,64366=>957,64367=>903,64368=>466,64369=>480,64370=>544,64371=>658,64372=>646,64373=>637,64374=>544,64375=>658,64376=>646,64377=>637,64378=>544,64379=>658, - 64380=>646,64381=>637,64382=>544,64383=>658,64384=>646,64385=>637,64386=>430,64387=>458,64388=>430,64389=>458,64390=>430,64391=>458,64392=>430,64393=>458,64394=>421,64395=>436, - 64396=>421,64397=>436,64398=>828,64399=>942,64400=>432,64401=>549,64402=>828,64403=>942,64404=>432,64405=>549,64406=>828,64407=>942,64408=>432,64409=>549,64410=>828,64411=>942, - 64412=>432,64413=>549,64414=>692,64415=>723,64416=>692,64417=>723,64418=>276,64419=>243,64420=>514,64421=>477,64422=>514,64423=>509,64424=>273,64425=>427,64426=>706,64427=>706, - 64428=>686,64429=>686,64430=>550,64431=>461,64432=>550,64433=>461,64467=>757,64468=>733,64469=>432,64470=>549,64471=>470,64472=>466,64473=>470,64474=>466,64475=>470,64476=>466, - 64477=>470,64478=>470,64479=>466,64480=>470,64481=>466,64482=>470,64483=>466,64484=>781,64485=>933,64486=>276,64487=>243,64488=>276,64489=>243,64490=>547,64491=>517,64492=>783, - 64493=>753,64494=>740,64495=>710,64496=>740,64497=>710,64498=>740,64499=>710,64500=>740,64501=>710,64502=>1207,64503=>1177,64504=>517,64505=>1067,64506=>1037,64507=>517,64508=>731, - 64509=>793,64510=>276,64511=>243,64512=>932,64513=>932,64514=>914,64515=>1067,64516=>1077,64517=>935,64518=>935,64519=>935,64520=>917,64521=>1070,64522=>1080,64523=>932,64524=>932, - 64525=>932,64526=>914,64527=>1067,64528=>1077,64529=>932,64530=>914,64531=>1067,64532=>1077,64533=>1305,64534=>1287,64535=>1305,64536=>1287,64537=>1305,64538=>1305,64539=>1287,64540=>1429, - 64541=>1429,64542=>1429,64543=>1411,64544=>1476,64545=>1458,64546=>1476,64547=>1476,64548=>1476,64549=>1458,64550=>1392,64551=>1374,64552=>1374,64553=>1245,64554=>1227,64555=>1245,64556=>1227, - 64557=>1125,64558=>1125,64559=>1125,64560=>1107,64561=>1260,64562=>1270,64563=>1125,64564=>1107,64565=>1260,64566=>1270,64567=>706,64568=>1091,64569=>1091,64570=>1091,64571=>1106,64572=>1073, - 64573=>1226,64574=>1236,64575=>932,64576=>932,64577=>932,64578=>914,64579=>1067,64580=>1077,64581=>1140,64582=>1140,64583=>1140,64584=>1122,64585=>1275,64586=>1285,64587=>932,64588=>932, - 64589=>932,64590=>914,64591=>1067,64592=>1077,64593=>1345,64594=>1327,64595=>1480,64596=>1490,64597=>932,64598=>932,64599=>932,64600=>914,64601=>1067,64602=>1077,64603=>430,64604=>421, - 64605=>731,64606=>296,64607=>300,64608=>300,64609=>300,64610=>300,64611=>300,64612=>680,64613=>680,64614=>884,64615=>967,64616=>1037,64617=>1047,64618=>680,64619=>680,64620=>884, - 64621=>967,64622=>1037,64623=>1047,64624=>680,64625=>680,64626=>884,64627=>967,64628=>1037,64629=>1047,64630=>680,64631=>680,64632=>884,64633=>967,64634=>1037,64635=>1047,64636=>1274, - 64637=>1284,64638=>1274,64639=>1284,64640=>821,64641=>1221,64642=>1188,64643=>1341,64644=>1351,64645=>884,64646=>1037,64647=>1047,64648=>806,64649=>1173,64650=>680,64651=>680,64652=>884, - 64653=>967,64654=>1037,64655=>1047,64656=>793,64657=>680,64658=>680,64659=>884,64660=>967,64661=>1037,64662=>1047,64663=>911,64664=>911,64665=>911,64666=>806,64667=>679,64668=>911, - 64669=>911,64670=>911,64671=>806,64672=>679,64673=>911,64674=>911,64675=>911,64676=>806,64677=>679,64678=>806,64679=>1284,64680=>1179,64681=>1284,64682=>1179,64683=>1284,64684=>1179, - 64685=>1408,64686=>1408,64687=>1408,64688=>1303,64689=>1455,64690=>1455,64691=>1350,64692=>1455,64693=>1455,64694=>1455,64695=>1350,64696=>1371,64697=>1266,64698=>1224,64699=>1119,64700=>1224, - 64701=>1119,64702=>1104,64703=>1104,64704=>1104,64705=>999,64706=>1104,64707=>999,64708=>1070,64709=>1070,64710=>1070,64711=>676,64712=>965,64713=>911,64714=>911,64715=>911,64716=>806, - 64717=>679,64718=>1119,64719=>1119,64720=>1119,64721=>1014,64722=>911,64723=>911,64724=>911,64725=>806,64726=>679,64727=>1324,64728=>1219,64729=>686,64730=>911,64731=>911,64732=>911, - 64733=>806,64734=>679,64735=>776,64736=>649,64737=>776,64738=>649,64739=>776,64740=>649,64741=>776,64742=>649,64743=>1303,64744=>1176,64745=>1303,64746=>1176,64747=>793,64748=>1082, - 64749=>776,64750=>776,64751=>649,64752=>776,64753=>649,64754=>306,64755=>302,64756=>298,64757=>1527,64758=>1537,64759=>1380,64760=>1390,64761=>1380,64762=>1390,64763=>1564,64764=>1574, - 64765=>1564,64766=>1574,64767=>1440,64768=>1450,64769=>1440,64770=>1450,64771=>1440,64772=>1450,64773=>1611,64774=>1621,64775=>1611,64776=>1621,64777=>1429,64778=>1429,64779=>1429,64780=>1411, - 64781=>1207,64782=>1207,64783=>1254,64784=>1254,64785=>1527,64786=>1537,64787=>1348,64788=>1358,64789=>1348,64790=>1358,64791=>1564,64792=>1574,64793=>1564,64794=>1574,64795=>1431,64796=>1441, - 64797=>1431,64798=>1441,64799=>1431,64800=>1441,64801=>1611,64802=>1621,64803=>1611,64804=>1621,64805=>1429,64806=>1429,64807=>1429,64808=>1411,64809=>1207,64810=>1207,64811=>1254,64812=>1254, - 64813=>1408,64814=>1408,64815=>1408,64816=>1303,64817=>1176,64818=>1176,64819=>1266,64820=>1408,64821=>1408,64822=>1408,64823=>1408,64824=>1408,64825=>1408,64826=>1266,64827=>1266,64828=>273, - 64829=>243,64830=>600,64831=>600,64848=>1444,64849=>1541,64850=>1549,64851=>1444,64852=>1444,64853=>1444,64854=>1444,64855=>1444,64856=>1830,64857=>1817,64858=>1975,64859=>1964,64860=>2046, - 64861=>2046,64862=>2202,64863=>1962,64864=>1941,64865=>1941,64866=>1944,64867=>1836,64868=>2114,64869=>2093,64870=>1991,64871=>2049,64872=>1941,64873=>2212,64874=>1962,64875=>1941,64876=>1944, - 64877=>1836,64878=>2249,64879=>2096,64880=>1988,64881=>1925,64882=>1904,64883=>1799,64884=>2070,64885=>1833,64886=>1729,64887=>1652,64888=>1881,64889=>1729,64890=>1892,64891=>1881,64892=>1759, - 64893=>1637,64894=>1670,64895=>1654,64896=>1522,64897=>1686,64898=>1675,64899=>1549,64900=>1541,64901=>1522,64902=>1444,64903=>1436,64904=>1444,64905=>1757,64906=>1652,64907=>1975,64908=>1757, - 64909=>1652,64910=>1757,64911=>1652,64914=>1757,64915=>1857,64916=>1752,64917=>1444,64918=>1675,64919=>1522,64920=>1444,64921=>1675,64922=>1581,64923=>1570,64924=>1417,64925=>1362,64926=>1686, - 64927=>1686,64928=>1675,64929=>1686,64930=>1675,64931=>1581,64932=>1570,64933=>1975,64934=>2069,64935=>1964,64936=>2202,64937=>2259,64938=>2212,64939=>2259,64940=>1686,64941=>1581,64942=>1686, - 64943=>1686,64944=>1581,64945=>1870,64946=>1817,64947=>1686,64948=>1637,64949=>1444,64950=>1892,64951=>1886,64952=>1549,64953=>1975,64954=>1444,64955=>1723,64956=>1522,64957=>1541,64958=>2080, - 64959=>2080,64960=>1975,64961=>1817,64962=>1686,64963=>1499,64964=>1757,64965=>1883,64966=>2212,64967=>1686,65008=>1523,65009=>1172,65010=>1159,65011=>1356,65012=>2111,65013=>2258,65014=>2130, - 65015=>1552,65016=>2046,65017=>1856,65018=>1930,65019=>1070,65056=>450,65057=>450,65058=>450,65059=>450,65072=>1000,65073=>1000,65074=>1000,65075=>1000,65076=>1000,65077=>1000,65078=>1000, - 65079=>1000,65080=>1000,65081=>1000,65082=>1000,65083=>1000,65084=>1000,65085=>1000,65086=>1000,65087=>1000,65088=>1000,65089=>1000,65090=>1000,65091=>1000,65092=>1000,65097=>1000,65098=>1000, - 65099=>1000,65100=>1000,65101=>1000,65102=>1000,65103=>1000,65104=>167,65105=>250,65106=>167,65108=>167,65109=>167,65110=>334,65111=>167,65112=>600,65113=>200,65114=>200,65115=>200, - 65116=>200,65117=>200,65118=>200,65119=>334,65120=>400,65121=>233,65122=>350,65123=>200,65124=>350,65125=>350,65126=>350,65128=>167,65129=>334,65130=>533,65131=>609,65136=>300, - 65137=>298,65138=>296,65140=>298,65142=>300,65143=>298,65144=>300,65145=>302,65146=>298,65147=>296,65148=>306,65149=>306,65150=>154,65151=>154,65152=>529,65153=>243,65154=>273, - 65155=>243,65156=>273,65157=>470,65158=>466,65159=>243,65160=>273,65161=>731,65162=>793,65163=>276,65164=>243,65165=>243,65166=>273,65167=>771,65168=>788,65169=>276,65170=>243, - 65171=>514,65172=>477,65173=>771,65174=>788,65175=>276,65176=>243,65177=>771,65178=>788,65179=>276,65180=>243,65181=>544,65182=>658,65183=>646,65184=>637,65185=>544,65186=>658, - 65187=>646,65188=>637,65189=>544,65190=>658,65191=>646,65192=>637,65193=>430,65194=>458,65195=>430,65196=>458,65197=>421,65198=>436,65199=>421,65200=>436,65201=>1194,65202=>1194, - 65203=>770,65204=>770,65205=>1194,65206=>1194,65207=>770,65208=>770,65209=>1291,65210=>1291,65211=>817,65212=>817,65213=>1291,65214=>1291,65215=>817,65216=>817,65217=>843,65218=>843, - 65219=>733,65220=>733,65221=>843,65222=>843,65223=>733,65224=>733,65225=>594,65226=>556,65227=>586,65228=>554,65229=>594,65230=>556,65231=>586,65232=>554,65233=>957,65234=>903, - 65235=>466,65236=>480,65237=>800,65238=>823,65239=>466,65240=>480,65241=>757,65242=>733,65243=>432,65244=>549,65245=>662,65246=>673,65247=>273,65248=>243,65249=>589,65250=>640, - 65251=>481,65252=>532,65253=>692,65254=>723,65255=>276,65256=>243,65257=>514,65258=>477,65259=>686,65260=>405,65261=>470,65262=>466,65263=>731,65264=>793,65265=>731,65266=>803, - 65267=>276,65268=>243,65269=>551,65270=>603,65271=>551,65272=>603,65273=>551,65274=>603,65275=>551,65276=>603,65281=>1000,65282=>1000,65283=>1000,65284=>1000,65285=>1000,65286=>1000, - 65287=>1000,65288=>1000,65289=>1000,65290=>1000,65291=>1000,65292=>1000,65293=>1000,65294=>1000,65295=>1000,65296=>1000,65297=>1000,65298=>1000,65299=>1000,65300=>1000,65301=>1000,65302=>1000, - 65303=>1000,65304=>1000,65305=>1000,65306=>1000,65307=>1000,65308=>1000,65309=>1000,65310=>1000,65311=>1000,65312=>1000,65313=>1000,65314=>1000,65315=>1000,65316=>1000,65317=>1000,65318=>1000, - 65319=>1000,65320=>1000,65321=>1000,65322=>1000,65323=>1000,65324=>1000,65325=>1000,65326=>1000,65327=>1000,65328=>1000,65329=>1000,65330=>1000,65331=>1000,65332=>1000,65333=>1000,65334=>1000, - 65335=>1000,65336=>1000,65337=>1000,65338=>1000,65339=>1000,65340=>1000,65341=>1000,65342=>1000,65343=>1000,65344=>1000,65345=>1000,65346=>1000,65347=>1000,65348=>1000,65349=>1000,65350=>1000, - 65351=>1000,65352=>1000,65353=>1000,65354=>1000,65355=>1000,65356=>1000,65357=>1000,65358=>1000,65359=>1000,65360=>1000,65361=>1000,65362=>1000,65363=>1000,65364=>1000,65365=>1000,65366=>1000, - 65367=>1000,65368=>1000,65369=>1000,65370=>1000,65371=>1000,65372=>1000,65373=>1000,65374=>1000,65377=>500,65378=>500,65379=>500,65380=>500,65381=>500,65382=>500,65383=>500,65384=>500, - 65385=>500,65386=>500,65387=>500,65388=>500,65389=>500,65390=>500,65391=>500,65392=>500,65393=>500,65394=>500,65395=>500,65396=>500,65397=>500,65398=>500,65399=>500,65400=>500, - 65401=>500,65402=>500,65403=>500,65404=>500,65405=>500,65406=>500,65407=>500,65408=>500,65409=>500,65410=>500,65411=>500,65412=>500,65413=>500,65414=>500,65415=>500,65416=>500, - 65417=>500,65418=>500,65419=>500,65420=>500,65421=>500,65422=>500,65423=>500,65424=>500,65425=>500,65426=>500,65427=>500,65428=>500,65429=>500,65430=>500,65431=>500,65432=>500, - 65433=>500,65434=>500,65435=>500,65436=>500,65437=>500,65438=>500,65439=>500,65440=>500,65441=>500,65442=>500,65443=>500,65444=>500,65445=>500,65446=>500,65447=>500,65448=>500, - 65449=>500,65450=>500,65451=>500,65452=>500,65453=>500,65454=>500,65455=>500,65456=>500,65457=>500,65458=>500,65459=>500,65460=>500,65461=>500,65462=>500,65463=>500,65464=>500, - 65465=>500,65466=>500,65467=>500,65468=>500,65469=>500,65470=>500,65474=>500,65475=>500,65476=>500,65477=>500,65478=>500,65479=>500,65482=>500,65483=>500,65484=>500,65485=>500, - 65486=>500,65487=>500,65490=>500,65491=>500,65492=>500,65493=>500,65494=>500,65495=>500,65498=>500,65499=>500,65500=>500,65504=>1000,65505=>1000,65506=>1000,65507=>1000,65508=>1000, - 65509=>1000,65510=>1000,65512=>500,65513=>500,65514=>500,65515=>500,65516=>500,65517=>500,65518=>500,65532=>1000,65533=>1000,19968=>1000,19969=>1000,19970=>1000,19971=>1000,19972=>1000, - 19973=>1000,19974=>1000,19975=>1000,19976=>1000,19977=>1000,19978=>1000,19979=>1000,19980=>1000,19981=>1000,19982=>1000,19983=>1000,19984=>1000,19985=>1000,19986=>1000,19987=>1000,19988=>1000, - 19989=>1000,19990=>1000,19991=>1000,19992=>1000,19993=>1000,19994=>1000,19995=>1000,19996=>1000,19997=>1000,19998=>1000,19999=>1000,20000=>1000,20001=>1000,20002=>1000,20003=>1000,20004=>1000, - 20005=>1000,20006=>1000,20007=>1000,20008=>1000,20009=>1000,20010=>1000,20011=>1000,20012=>1000,20013=>1000,20014=>1000,20015=>1000,20016=>1000,20017=>1000,20018=>1000,20019=>1000,20020=>1000, - 20021=>1000,20022=>1000,20023=>1000,20024=>1000,20025=>1000,20026=>1000,20027=>1000,20028=>1000,20029=>1000,20030=>1000,20031=>1000,20032=>1000,20033=>1000,20034=>1000,20035=>1000,20036=>1000, - 20037=>1000,20038=>1000,20039=>1000,20040=>1000,20041=>1000,20042=>1000,20043=>1000,20044=>1000,20045=>1000,20046=>1000,20047=>1000,20048=>1000,20049=>1000,20050=>1000,20051=>1000,20052=>1000, - 20053=>1000,20054=>1000,20055=>1000,20056=>1000,20057=>1000,20058=>1000,20059=>1000,20060=>1000,20061=>1000,20062=>1000,20063=>1000,20064=>1000,20065=>1000,20066=>1000,20067=>1000,20068=>1000, - 20069=>1000,20070=>1000,20071=>1000,20072=>1000,20073=>1000,20074=>1000,20075=>1000,20076=>1000,20077=>1000,20078=>1000,20079=>1000,20080=>1000,20081=>1000,20082=>1000,20083=>1000,20084=>1000, - 20085=>1000,20086=>1000,20087=>1000,20088=>1000,20089=>1000,20090=>1000,20091=>1000,20092=>1000,20093=>1000,20094=>1000,20095=>1000,20096=>1000,20097=>1000,20098=>1000,20099=>1000,20100=>1000, - 20101=>1000,20102=>1000,20103=>1000,20104=>1000,20105=>1000,20106=>1000,20107=>1000,20108=>1000,20109=>1000,20110=>1000,20111=>1000,20112=>1000,20113=>1000,20114=>1000,20115=>1000,20116=>1000, - 20117=>1000,20118=>1000,20119=>1000,20120=>1000,20121=>1000,20122=>1000,20123=>1000,20124=>1000,20125=>1000,20126=>1000,20127=>1000,20128=>1000,20129=>1000,20130=>1000,20131=>1000,20132=>1000, - 20133=>1000,20134=>1000,20135=>1000,20136=>1000,20137=>1000,20138=>1000,20139=>1000,20140=>1000,20141=>1000,20142=>1000,20143=>1000,20144=>1000,20145=>1000,20146=>1000,20147=>1000,20148=>1000, - 20149=>1000,20150=>1000,20151=>1000,20152=>1000,20153=>1000,20154=>1000,20155=>1000,20156=>1000,20157=>1000,20158=>1000,20159=>1000,20160=>1000,20161=>1000,20162=>1000,20163=>1000,20164=>1000, - 20165=>1000,20166=>1000,20167=>1000,20168=>1000,20169=>1000,20170=>1000,20171=>1000,20172=>1000,20173=>1000,20174=>1000,20175=>1000,20176=>1000,20177=>1000,20178=>1000,20179=>1000,20180=>1000, - 20181=>1000,20182=>1000,20183=>1000,20184=>1000,20185=>1000,20186=>1000,20187=>1000,20188=>1000,20189=>1000,20190=>1000,20191=>1000,20192=>1000,20193=>1000,20194=>1000,20195=>1000,20196=>1000, - 20197=>1000,20198=>1000,20199=>1000,20200=>1000,20201=>1000,20202=>1000,20203=>1000,20204=>1000,20205=>1000,20206=>1000,20207=>1000,20208=>1000,20209=>1000,20210=>1000,20211=>1000,20212=>1000, - 20213=>1000,20214=>1000,20215=>1000,20216=>1000,20217=>1000,20218=>1000,20219=>1000,20220=>1000,20221=>1000,20222=>1000,20223=>1000,20224=>1000,20225=>1000,20226=>1000,20227=>1000,20228=>1000, - 20229=>1000,20230=>1000,20231=>1000,20232=>1000,20233=>1000,20234=>1000,20235=>1000,20236=>1000,20237=>1000,20238=>1000,20239=>1000,20240=>1000,20241=>1000,20242=>1000,20243=>1000,20244=>1000, - 20245=>1000,20246=>1000,20247=>1000,20248=>1000,20249=>1000,20250=>1000,20251=>1000,20252=>1000,20253=>1000,20254=>1000,20255=>1000,20256=>1000,20257=>1000,20258=>1000,20259=>1000,20260=>1000, - 20261=>1000,20262=>1000,20263=>1000,20264=>1000,20265=>1000,20266=>1000,20267=>1000,20268=>1000,20269=>1000,20270=>1000,20271=>1000,20272=>1000,20273=>1000,20274=>1000,20275=>1000,20276=>1000, - 20277=>1000,20278=>1000,20279=>1000,20280=>1000,20281=>1000,20282=>1000,20283=>1000,20284=>1000,20285=>1000,20286=>1000,20287=>1000,20288=>1000,20289=>1000,20290=>1000,20291=>1000,20292=>1000, - 20293=>1000,20294=>1000,20295=>1000,20296=>1000,20297=>1000,20298=>1000,20299=>1000,20300=>1000,20301=>1000,20302=>1000,20303=>1000,20304=>1000,20305=>1000,20306=>1000,20307=>1000,20308=>1000, - 20309=>1000,20310=>1000,20311=>1000,20312=>1000,20313=>1000,20314=>1000,20315=>1000,20316=>1000,20317=>1000,20318=>1000,20319=>1000,20320=>1000,20321=>1000,20322=>1000,20323=>1000,20324=>1000, - 20325=>1000,20326=>1000,20327=>1000,20328=>1000,20329=>1000,20330=>1000,20331=>1000,20332=>1000,20333=>1000,20334=>1000,20335=>1000,20336=>1000,20337=>1000,20338=>1000,20339=>1000,20340=>1000, - 20341=>1000,20342=>1000,20343=>1000,20344=>1000,20345=>1000,20346=>1000,20347=>1000,20348=>1000,20349=>1000,20350=>1000,20351=>1000,20352=>1000,20353=>1000,20354=>1000,20355=>1000,20356=>1000, - 20357=>1000,20358=>1000,20359=>1000,20360=>1000,20361=>1000,20362=>1000,20363=>1000,20364=>1000,20365=>1000,20366=>1000,20367=>1000,20368=>1000,20369=>1000,20370=>1000,20371=>1000,20372=>1000, - 20373=>1000,20374=>1000,20375=>1000,20376=>1000,20377=>1000,20378=>1000,20379=>1000,20380=>1000,20381=>1000,20382=>1000,20383=>1000,20384=>1000,20385=>1000,20386=>1000,20387=>1000,20388=>1000, - 20389=>1000,20390=>1000,20391=>1000,20392=>1000,20393=>1000,20394=>1000,20395=>1000,20396=>1000,20397=>1000,20398=>1000,20399=>1000,20400=>1000,20401=>1000,20402=>1000,20403=>1000,20404=>1000, - 20405=>1000,20406=>1000,20407=>1000,20408=>1000,20409=>1000,20410=>1000,20411=>1000,20412=>1000,20413=>1000,20414=>1000,20415=>1000,20416=>1000,20417=>1000,20418=>1000,20419=>1000,20420=>1000, - 20421=>1000,20422=>1000,20423=>1000,20424=>1000,20425=>1000,20426=>1000,20427=>1000,20428=>1000,20429=>1000,20430=>1000,20431=>1000,20432=>1000,20433=>1000,20434=>1000,20435=>1000,20436=>1000, - 20437=>1000,20438=>1000,20439=>1000,20440=>1000,20441=>1000,20442=>1000,20443=>1000,20444=>1000,20445=>1000,20446=>1000,20447=>1000,20448=>1000,20449=>1000,20450=>1000,20451=>1000,20452=>1000, - 20453=>1000,20454=>1000,20455=>1000,20456=>1000,20457=>1000,20458=>1000,20459=>1000,20460=>1000,20461=>1000,20462=>1000,20463=>1000,20464=>1000,20465=>1000,20466=>1000,20467=>1000,20468=>1000, - 20469=>1000,20470=>1000,20471=>1000,20472=>1000,20473=>1000,20474=>1000,20475=>1000,20476=>1000,20477=>1000,20478=>1000,20479=>1000,20480=>1000,20481=>1000,20482=>1000,20483=>1000,20484=>1000, - 20485=>1000,20486=>1000,20487=>1000,20488=>1000,20489=>1000,20490=>1000,20491=>1000,20492=>1000,20493=>1000,20494=>1000,20495=>1000,20496=>1000,20497=>1000,20498=>1000,20499=>1000,20500=>1000, - 20501=>1000,20502=>1000,20503=>1000,20504=>1000,20505=>1000,20506=>1000,20507=>1000,20508=>1000,20509=>1000,20510=>1000,20511=>1000,20512=>1000,20513=>1000,20514=>1000,20515=>1000,20516=>1000, - 20517=>1000,20518=>1000,20519=>1000,20520=>1000,20521=>1000,20522=>1000,20523=>1000,20524=>1000,20525=>1000,20526=>1000,20527=>1000,20528=>1000,20529=>1000,20530=>1000,20531=>1000,20532=>1000, - 20533=>1000,20534=>1000,20535=>1000,20536=>1000,20537=>1000,20538=>1000,20539=>1000,20540=>1000,20541=>1000,20542=>1000,20543=>1000,20544=>1000,20545=>1000,20546=>1000,20547=>1000,20548=>1000, - 20549=>1000,20550=>1000,20551=>1000,20552=>1000,20553=>1000,20554=>1000,20555=>1000,20556=>1000,20557=>1000,20558=>1000,20559=>1000,20560=>1000,20561=>1000,20562=>1000,20563=>1000,20564=>1000, - 20565=>1000,20566=>1000,20567=>1000,20568=>1000,20569=>1000,20570=>1000,20571=>1000,20572=>1000,20573=>1000,20574=>1000,20575=>1000,20576=>1000,20577=>1000,20578=>1000,20579=>1000,20580=>1000, - 20581=>1000,20582=>1000,20583=>1000,20584=>1000,20585=>1000,20586=>1000,20587=>1000,20588=>1000,20589=>1000,20590=>1000,20591=>1000,20592=>1000,20593=>1000,20594=>1000,20595=>1000,20596=>1000, - 20597=>1000,20598=>1000,20599=>1000,20600=>1000,20601=>1000,20602=>1000,20603=>1000,20604=>1000,20605=>1000,20606=>1000,20607=>1000,20608=>1000,20609=>1000,20610=>1000,20611=>1000,20612=>1000, - 20613=>1000,20614=>1000,20615=>1000,20616=>1000,20617=>1000,20618=>1000,20619=>1000,20620=>1000,20621=>1000,20622=>1000,20623=>1000,20624=>1000,20625=>1000,20626=>1000,20627=>1000,20628=>1000, - 20629=>1000,20630=>1000,20631=>1000,20632=>1000,20633=>1000,20634=>1000,20635=>1000,20636=>1000,20637=>1000,20638=>1000,20639=>1000,20640=>1000,20641=>1000,20642=>1000,20643=>1000,20644=>1000, - 20645=>1000,20646=>1000,20647=>1000,20648=>1000,20649=>1000,20650=>1000,20651=>1000,20652=>1000,20653=>1000,20654=>1000,20655=>1000,20656=>1000,20657=>1000,20658=>1000,20659=>1000,20660=>1000, - 20661=>1000,20662=>1000,20663=>1000,20664=>1000,20665=>1000,20666=>1000,20667=>1000,20668=>1000,20669=>1000,20670=>1000,20671=>1000,20672=>1000,20673=>1000,20674=>1000,20675=>1000,20676=>1000, - 20677=>1000,20678=>1000,20679=>1000,20680=>1000,20681=>1000,20682=>1000,20683=>1000,20684=>1000,20685=>1000,20686=>1000,20687=>1000,20688=>1000,20689=>1000,20690=>1000,20691=>1000,20692=>1000, - 20693=>1000,20694=>1000,20695=>1000,20696=>1000,20697=>1000,20698=>1000,20699=>1000,20700=>1000,20701=>1000,20702=>1000,20703=>1000,20704=>1000,20705=>1000,20706=>1000,20707=>1000,20708=>1000, - 20709=>1000,20710=>1000,20711=>1000,20712=>1000,20713=>1000,20714=>1000,20715=>1000,20716=>1000,20717=>1000,20718=>1000,20719=>1000,20720=>1000,20721=>1000,20722=>1000,20723=>1000,20724=>1000, - 20725=>1000,20726=>1000,20727=>1000,20728=>1000,20729=>1000,20730=>1000,20731=>1000,20732=>1000,20733=>1000,20734=>1000,20735=>1000,20736=>1000,20737=>1000,20738=>1000,20739=>1000,20740=>1000, - 20741=>1000,20742=>1000,20743=>1000,20744=>1000,20745=>1000,20746=>1000,20747=>1000,20748=>1000,20749=>1000,20750=>1000,20751=>1000,20752=>1000,20753=>1000,20754=>1000,20755=>1000,20756=>1000, - 20757=>1000,20758=>1000,20759=>1000,20760=>1000,20761=>1000,20762=>1000,20763=>1000,20764=>1000,20765=>1000,20766=>1000,20767=>1000,20768=>1000,20769=>1000,20770=>1000,20771=>1000,20772=>1000, - 20773=>1000,20774=>1000,20775=>1000,20776=>1000,20777=>1000,20778=>1000,20779=>1000,20780=>1000,20781=>1000,20782=>1000,20783=>1000,20784=>1000,20785=>1000,20786=>1000,20787=>1000,20788=>1000, - 20789=>1000,20790=>1000,20791=>1000,20792=>1000,20793=>1000,20794=>1000,20795=>1000,20796=>1000,20797=>1000,20798=>1000,20799=>1000,20800=>1000,20801=>1000,20802=>1000,20803=>1000,20804=>1000, - 20805=>1000,20806=>1000,20807=>1000,20808=>1000,20809=>1000,20810=>1000,20811=>1000,20812=>1000,20813=>1000,20814=>1000,20815=>1000,20816=>1000,20817=>1000,20818=>1000,20819=>1000,20820=>1000, - 20821=>1000,20822=>1000,20823=>1000,20824=>1000,20825=>1000,20826=>1000,20827=>1000,20828=>1000,20829=>1000,20830=>1000,20831=>1000,20832=>1000,20833=>1000,20834=>1000,20835=>1000,20836=>1000, - 20837=>1000,20838=>1000,20839=>1000,20840=>1000,20841=>1000,20842=>1000,20843=>1000,20844=>1000,20845=>1000,20846=>1000,20847=>1000,20848=>1000,20849=>1000,20850=>1000,20851=>1000,20852=>1000, - 20853=>1000,20854=>1000,20855=>1000,20856=>1000,20857=>1000,20858=>1000,20859=>1000,20860=>1000,20861=>1000,20862=>1000,20863=>1000,20864=>1000,20865=>1000,20866=>1000,20867=>1000,20868=>1000, - 20869=>1000,20870=>1000,20871=>1000,20872=>1000,20873=>1000,20874=>1000,20875=>1000,20876=>1000,20877=>1000,20878=>1000,20879=>1000,20880=>1000,20881=>1000,20882=>1000,20883=>1000,20884=>1000, - 20885=>1000,20886=>1000,20887=>1000,20888=>1000,20889=>1000,20890=>1000,20891=>1000,20892=>1000,20893=>1000,20894=>1000,20895=>1000,20896=>1000,20897=>1000,20898=>1000,20899=>1000,20900=>1000, - 20901=>1000,20902=>1000,20903=>1000,20904=>1000,20905=>1000,20906=>1000,20907=>1000,20908=>1000,20909=>1000,20910=>1000,20911=>1000,20912=>1000,20913=>1000,20914=>1000,20915=>1000,20916=>1000, - 20917=>1000,20918=>1000,20919=>1000,20920=>1000,20921=>1000,20922=>1000,20923=>1000,20924=>1000,20925=>1000,20926=>1000,20927=>1000,20928=>1000,20929=>1000,20930=>1000,20931=>1000,20932=>1000, - 20933=>1000,20934=>1000,20935=>1000,20936=>1000,20937=>1000,20938=>1000,20939=>1000,20940=>1000,20941=>1000,20942=>1000,20943=>1000,20944=>1000,20945=>1000,20946=>1000,20947=>1000,20948=>1000, - 20949=>1000,20950=>1000,20951=>1000,20952=>1000,20953=>1000,20954=>1000,20955=>1000,20956=>1000,20957=>1000,20958=>1000,20959=>1000,20960=>1000,20961=>1000,20962=>1000,20963=>1000,20964=>1000, - 20965=>1000,20966=>1000,20967=>1000,20968=>1000,20969=>1000,20970=>1000,20971=>1000,20972=>1000,20973=>1000,20974=>1000,20975=>1000,20976=>1000,20977=>1000,20978=>1000,20979=>1000,20980=>1000, - 20981=>1000,20982=>1000,20983=>1000,20984=>1000,20985=>1000,20986=>1000,20987=>1000,20988=>1000,20989=>1000,20990=>1000,20991=>1000,20992=>1000,20993=>1000,20994=>1000,20995=>1000,20996=>1000, - 20997=>1000,20998=>1000,20999=>1000,21000=>1000,21001=>1000,21002=>1000,21003=>1000,21004=>1000,21005=>1000,21006=>1000,21007=>1000,21008=>1000,21009=>1000,21010=>1000,21011=>1000,21012=>1000, - 21013=>1000,21014=>1000,21015=>1000,21016=>1000,21017=>1000,21018=>1000,21019=>1000,21020=>1000,21021=>1000,21022=>1000,21023=>1000,21024=>1000,21025=>1000,21026=>1000,21027=>1000,21028=>1000, - 21029=>1000,21030=>1000,21031=>1000,21032=>1000,21033=>1000,21034=>1000,21035=>1000,21036=>1000,21037=>1000,21038=>1000,21039=>1000,21040=>1000,21041=>1000,21042=>1000,21043=>1000,21044=>1000, - 21045=>1000,21046=>1000,21047=>1000,21048=>1000,21049=>1000,21050=>1000,21051=>1000,21052=>1000,21053=>1000,21054=>1000,21055=>1000,21056=>1000,21057=>1000,21058=>1000,21059=>1000,21060=>1000, - 21061=>1000,21062=>1000,21063=>1000,21064=>1000,21065=>1000,21066=>1000,21067=>1000,21068=>1000,21069=>1000,21070=>1000,21071=>1000,21072=>1000,21073=>1000,21074=>1000,21075=>1000,21076=>1000, - 21077=>1000,21078=>1000,21079=>1000,21080=>1000,21081=>1000,21082=>1000,21083=>1000,21084=>1000,21085=>1000,21086=>1000,21087=>1000,21088=>1000,21089=>1000,21090=>1000,21091=>1000,21092=>1000, - 21093=>1000,21094=>1000,21095=>1000,21096=>1000,21097=>1000,21098=>1000,21099=>1000,21100=>1000,21101=>1000,21102=>1000,21103=>1000,21104=>1000,21105=>1000,21106=>1000,21107=>1000,21108=>1000, - 21109=>1000,21110=>1000,21111=>1000,21112=>1000,21113=>1000,21114=>1000,21115=>1000,21116=>1000,21117=>1000,21118=>1000,21119=>1000,21120=>1000,21121=>1000,21122=>1000,21123=>1000,21124=>1000, - 21125=>1000,21126=>1000,21127=>1000,21128=>1000,21129=>1000,21130=>1000,21131=>1000,21132=>1000,21133=>1000,21134=>1000,21135=>1000,21136=>1000,21137=>1000,21138=>1000,21139=>1000,21140=>1000, - 21141=>1000,21142=>1000,21143=>1000,21144=>1000,21145=>1000,21146=>1000,21147=>1000,21148=>1000,21149=>1000,21150=>1000,21151=>1000,21152=>1000,21153=>1000,21154=>1000,21155=>1000,21156=>1000, - 21157=>1000,21158=>1000,21159=>1000,21160=>1000,21161=>1000,21162=>1000,21163=>1000,21164=>1000,21165=>1000,21166=>1000,21167=>1000,21168=>1000,21169=>1000,21170=>1000,21171=>1000,21172=>1000, - 21173=>1000,21174=>1000,21175=>1000,21176=>1000,21177=>1000,21178=>1000,21179=>1000,21180=>1000,21181=>1000,21182=>1000,21183=>1000,21184=>1000,21185=>1000,21186=>1000,21187=>1000,21188=>1000, - 21189=>1000,21190=>1000,21191=>1000,21192=>1000,21193=>1000,21194=>1000,21195=>1000,21196=>1000,21197=>1000,21198=>1000,21199=>1000,21200=>1000,21201=>1000,21202=>1000,21203=>1000,21204=>1000, - 21205=>1000,21206=>1000,21207=>1000,21208=>1000,21209=>1000,21210=>1000,21211=>1000,21212=>1000,21213=>1000,21214=>1000,21215=>1000,21216=>1000,21217=>1000,21218=>1000,21219=>1000,21220=>1000, - 21221=>1000,21222=>1000,21223=>1000,21224=>1000,21225=>1000,21226=>1000,21227=>1000,21228=>1000,21229=>1000,21230=>1000,21231=>1000,21232=>1000,21233=>1000,21234=>1000,21235=>1000,21236=>1000, - 21237=>1000,21238=>1000,21239=>1000,21240=>1000,21241=>1000,21242=>1000,21243=>1000,21244=>1000,21245=>1000,21246=>1000,21247=>1000,21248=>1000,21249=>1000,21250=>1000,21251=>1000,21252=>1000, - 21253=>1000,21254=>1000,21255=>1000,21256=>1000,21257=>1000,21258=>1000,21259=>1000,21260=>1000,21261=>1000,21262=>1000,21263=>1000,21264=>1000,21265=>1000,21266=>1000,21267=>1000,21268=>1000, - 21269=>1000,21270=>1000,21271=>1000,21272=>1000,21273=>1000,21274=>1000,21275=>1000,21276=>1000,21277=>1000,21278=>1000,21279=>1000,21280=>1000,21281=>1000,21282=>1000,21283=>1000,21284=>1000, - 21285=>1000,21286=>1000,21287=>1000,21288=>1000,21289=>1000,21290=>1000,21291=>1000,21292=>1000,21293=>994,21294=>1000,21295=>1000,21296=>1000,21297=>1000,21298=>1000,21299=>1000,21300=>1000, - 21301=>1000,21302=>1000,21303=>1000,21304=>1000,21305=>1000,21306=>1000,21307=>1000,21308=>1000,21309=>1000,21310=>1000,21311=>1000,21312=>1000,21313=>1000,21314=>1000,21315=>1000,21316=>1000, - 21317=>1000,21318=>1000,21319=>1000,21320=>1000,21321=>1000,21322=>1000,21323=>1000,21324=>1000,21325=>1000,21326=>1000,21327=>1000,21328=>1000,21329=>1000,21330=>1000,21331=>1000,21332=>1000, - 21333=>1000,21334=>1000,21335=>1000,21336=>1000,21337=>1000,21338=>1000,21339=>1000,21340=>1000,21341=>1000,21342=>1000,21343=>1000,21344=>1000,21345=>1000,21346=>1000,21347=>1000,21348=>1000, - 21349=>1000,21350=>1000,21351=>1000,21352=>1000,21353=>1000,21354=>1000,21355=>1000,21356=>1000,21357=>1000,21358=>1000,21359=>1000,21360=>1000,21361=>1000,21362=>1000,21363=>1000,21364=>1000, - 21365=>1000,21366=>1000,21367=>1000,21368=>1000,21369=>1000,21370=>1000,21371=>1000,21372=>1000,21373=>1000,21374=>1000,21375=>1000,21376=>1000,21377=>1000,21378=>1000,21379=>1000,21380=>1000, - 21381=>1000,21382=>1000,21383=>1000,21384=>1000,21385=>1000,21386=>1000,21387=>1000,21388=>1000,21389=>1000,21390=>1000,21391=>1000,21392=>1000,21393=>1000,21394=>1000,21395=>1000,21396=>1000, - 21397=>1000,21398=>1000,21399=>1000,21400=>1000,21401=>1000,21402=>1000,21403=>1000,21404=>1000,21405=>1000,21406=>1000,21407=>1000,21408=>1000,21409=>1000,21410=>1000,21411=>1000,21412=>1000, - 21413=>1000,21414=>1000,21415=>1000,21416=>1000,21417=>1000,21418=>1000,21419=>1000,21420=>1000,21421=>1000,21422=>1000,21423=>1000,21424=>1000,21425=>1000,21426=>1000,21427=>1000,21428=>1000, - 21429=>1000,21430=>1000,21431=>1000,21432=>1000,21433=>1000,21434=>1000,21435=>1000,21436=>1000,21437=>1000,21438=>1000,21439=>1000,21440=>1000,21441=>1000,21442=>1000,21443=>1000,21444=>1000, - 21445=>1000,21446=>1000,21447=>1000,21448=>1000,21449=>1000,21450=>1000,21451=>1000,21452=>1000,21453=>1000,21454=>1000,21455=>1000,21456=>1000,21457=>1000,21458=>1000,21459=>1000,21460=>1000, - 21461=>1000,21462=>1000,21463=>1000,21464=>1000,21465=>1000,21466=>1000,21467=>1000,21468=>1000,21469=>1000,21470=>1000,21471=>1000,21472=>1000,21473=>1000,21474=>1000,21475=>1000,21476=>1000, - 21477=>1000,21478=>1000,21479=>1000,21480=>1000,21481=>1000,21482=>1000,21483=>1000,21484=>1000,21485=>1000,21486=>1000,21487=>1000,21488=>1000,21489=>1000,21490=>1000,21491=>1000,21492=>1000, - 21493=>1000,21494=>1000,21495=>1000,21496=>1000,21497=>1000,21498=>1000,21499=>1000,21500=>1000,21501=>1000,21502=>1000,21503=>1000,21504=>1000,21505=>1000,21506=>1000,21507=>1000,21508=>1000, - 21509=>1000,21510=>1000,21511=>1000,21512=>1000,21513=>1000,21514=>1000,21515=>1000,21516=>1000,21517=>1000,21518=>1000,21519=>1000,21520=>1000,21521=>1000,21522=>1000,21523=>1000,21524=>1000, - 21525=>1000,21526=>1000,21527=>1000,21528=>1000,21529=>1000,21530=>1000,21531=>1000,21532=>1000,21533=>1000,21534=>1000,21535=>1000,21536=>1000,21537=>1000,21538=>1000,21539=>1000,21540=>1000, - 21541=>1000,21542=>1000,21543=>1000,21544=>1000,21545=>1000,21546=>1000,21547=>1000,21548=>1000,21549=>1000,21550=>1000,21551=>1000,21552=>1000,21553=>1000,21554=>1000,21555=>1000,21556=>1000, - 21557=>1000,21558=>1000,21559=>1000,21560=>1000,21561=>1000,21562=>1000,21563=>1000,21564=>1000,21565=>1000,21566=>1000,21567=>1000,21568=>1000,21569=>1000,21570=>1000,21571=>1000,21572=>1000, - 21573=>1000,21574=>1000,21575=>1000,21576=>1000,21577=>1000,21578=>1000,21579=>1000,21580=>1000,21581=>1000,21582=>1000,21583=>1000,21584=>1000,21585=>1000,21586=>1000,21587=>1000,21588=>1000, - 21589=>1000,21590=>1000,21591=>1000,21592=>1000,21593=>1000,21594=>1000,21595=>1000,21596=>1000,21597=>1000,21598=>1000,21599=>1000,21600=>1000,21601=>1000,21602=>1000,21603=>1000,21604=>1000, - 21605=>1000,21606=>1000,21607=>1000,21608=>1000,21609=>1000,21610=>1000,21611=>1000,21612=>1000,21613=>1000,21614=>1000,21615=>1000,21616=>1000,21617=>1000,21618=>1000,21619=>1000,21620=>1000, - 21621=>1000,21622=>1000,21623=>1000,21624=>1000,21625=>1000,21626=>1000,21627=>1000,21628=>1000,21629=>1000,21630=>1000,21631=>1000,21632=>1000,21633=>1000,21634=>1000,21635=>1000,21636=>1000, - 21637=>1000,21638=>1000,21639=>1000,21640=>1000,21641=>1000,21642=>1000,21643=>1000,21644=>1000,21645=>1000,21646=>1000,21647=>1000,21648=>1000,21649=>1000,21650=>1000,21651=>1000,21652=>1000, - 21653=>1000,21654=>1000,21655=>1000,21656=>1000,21657=>1000,21658=>1000,21659=>1000,21660=>1000,21661=>1000,21662=>1000,21663=>1000,21664=>1000,21665=>1000,21666=>1000,21667=>1000,21668=>1000, - 21669=>1000,21670=>1000,21671=>1000,21672=>1000,21673=>1000,21674=>1000,21675=>1000,21676=>1000,21677=>1000,21678=>1000,21679=>1000,21680=>1000,21681=>1000,21682=>1000,21683=>1000,21684=>1000, - 21685=>1000,21686=>1000,21687=>1000,21688=>1000,21689=>1000,21690=>1000,21691=>1000,21692=>1000,21693=>1000,21694=>1000,21695=>1000,21696=>1000,21697=>1000,21698=>1000,21699=>1000,21700=>1000, - 21701=>1000,21702=>1000,21703=>1000,21704=>1000,21705=>1000,21706=>1000,21707=>1000,21708=>1000,21709=>1000,21710=>1000,21711=>1000,21712=>1000,21713=>1000,21714=>1000,21715=>1000,21716=>1000, - 21717=>1000,21718=>1000,21719=>1000,21720=>1000,21721=>1000,21722=>1000,21723=>1000,21724=>1000,21725=>1000,21726=>1000,21727=>1000,21728=>1000,21729=>1000,21730=>1000,21731=>1000,21732=>1000, - 21733=>1000,21734=>1000,21735=>1000,21736=>1000,21737=>1000,21738=>1000,21739=>1000,21740=>1000,21741=>1000,21742=>1000,21743=>1000,21744=>1000,21745=>1000,21746=>1000,21747=>1000,21748=>1000, - 21749=>1000,21750=>1000,21751=>1000,21752=>1000,21753=>1000,21754=>1000,21755=>1000,21756=>1000,21757=>1000,21758=>1000,21759=>1000,21760=>1000,21761=>1000,21762=>1000,21763=>1000,21764=>1000, - 21765=>1000,21766=>1000,21767=>1000,21768=>1000,21769=>1000,21770=>1000,21771=>1000,21772=>1000,21773=>1000,21774=>1000,21775=>1000,21776=>1000,21777=>1000,21778=>1000,21779=>1000,21780=>1000, - 21781=>1000,21782=>1000,21783=>1000,21784=>1000,21785=>1000,21786=>1000,21787=>1000,21788=>1000,21789=>1000,21790=>1000,21791=>1000,21792=>1000,21793=>1000,21794=>1000,21795=>1000,21796=>1000, - 21797=>1000,21798=>1000,21799=>1000,21800=>1000,21801=>1000,21802=>1000,21803=>1000,21804=>1000,21805=>1000,21806=>1000,21807=>1000,21808=>1000,21809=>1000,21810=>1000,21811=>1000,21812=>1000, - 21813=>1000,21814=>1000,21815=>1000,21816=>1000,21817=>1000,21818=>1000,21819=>1000,21820=>1000,21821=>1000,21822=>1000,21823=>1000,21824=>1000,21825=>1000,21826=>1000,21827=>1000,21828=>1000, - 21829=>1000,21830=>1000,21831=>1000,21832=>1000,21833=>1000,21834=>1000,21835=>1000,21836=>1000,21837=>1000,21838=>1000,21839=>1000,21840=>1000,21841=>1000,21842=>1000,21843=>1000,21844=>1000, - 21845=>1000,21846=>1000,21847=>1000,21848=>1000,21849=>1000,21850=>1000,21851=>1000,21852=>1000,21853=>1000,21854=>1000,21855=>1000,21856=>1000,21857=>1000,21858=>1000,21859=>1000,21860=>1000, - 21861=>1000,21862=>1000,21863=>1000,21864=>1000,21865=>1000,21866=>1000,21867=>1000,21868=>1000,21869=>1000,21870=>1000,21871=>1000,21872=>1000,21873=>1000,21874=>1000,21875=>1000,21876=>1000, - 21877=>1000,21878=>1000,21879=>1000,21880=>1000,21881=>1000,21882=>1000,21883=>1000,21884=>1000,21885=>1000,21886=>1000,21887=>1000,21888=>1000,21889=>1000,21890=>1000,21891=>1000,21892=>1000, - 21893=>1000,21894=>1000,21895=>1000,21896=>1000,21897=>1000,21898=>1000,21899=>1000,21900=>1000,21901=>1000,21902=>1000,21903=>1000,21904=>1000,21905=>1000,21906=>1000,21907=>1000,21908=>1000, - 21909=>1000,21910=>1000,21911=>1000,21912=>1000,21913=>1000,21914=>1000,21915=>1000,21916=>1000,21917=>1000,21918=>1000,21919=>1000,21920=>1000,21921=>1000,21922=>1000,21923=>1000,21924=>1000, - 21925=>1000,21926=>1000,21927=>1000,21928=>1000,21929=>1000,21930=>1000,21931=>1000,21932=>1000,21933=>1000,21934=>1000,21935=>1000,21936=>1000,21937=>1000,21938=>1000,21939=>1000,21940=>1000, - 21941=>1000,21942=>1000,21943=>1000,21944=>1000,21945=>1000,21946=>1000,21947=>1000,21948=>1000,21949=>1000,21950=>1000,21951=>1000,21952=>1000,21953=>1000,21954=>1000,21955=>1000,21956=>1000, - 21957=>1000,21958=>1000,21959=>1000,21960=>1000,21961=>1000,21962=>1000,21963=>1000,21964=>1000,21965=>1000,21966=>1000,21967=>1000,21968=>1000,21969=>1000,21970=>1000,21971=>1000,21972=>1000, - 21973=>1000,21974=>1000,21975=>1000,21976=>1000,21977=>1000,21978=>1000,21979=>1000,21980=>1000,21981=>1000,21982=>1000,21983=>1000,21984=>1000,21985=>1000,21986=>1000,21987=>1000,21988=>1000, - 21989=>1000,21990=>1000,21991=>1000,21992=>1000,21993=>1000,21994=>1000,21995=>1000,21996=>1000,21997=>1000,21998=>1000,21999=>1000,22000=>1000,22001=>1000,22002=>1000,22003=>1000,22004=>1000, - 22005=>1000,22006=>1000,22007=>1000,22008=>1000,22009=>1000,22010=>1000,22011=>1000,22012=>1000,22013=>1000,22014=>1000,22015=>1000,22016=>1000,22017=>1000,22018=>1000,22019=>1000,22020=>1000, - 22021=>1000,22022=>1000,22023=>1000,22024=>1000,22025=>1000,22026=>1000,22027=>1000,22028=>1000,22029=>1000,22030=>1000,22031=>1000,22032=>1000,22033=>1000,22034=>1000,22035=>1000,22036=>1000, - 22037=>1000,22038=>1000,22039=>1000,22040=>1000,22041=>1000,22042=>1000,22043=>1000,22044=>1000,22045=>1000,22046=>1000,22047=>1000,22048=>1000,22049=>1000,22050=>1000,22051=>1000,22052=>1000, - 22053=>1000,22054=>1000,22055=>1000,22056=>1000,22057=>1000,22058=>1000,22059=>1000,22060=>1000,22061=>1000,22062=>1000,22063=>1000,22064=>1000,22065=>1000,22066=>1000,22067=>1000,22068=>1000, - 22069=>1000,22070=>1000,22071=>1000,22072=>1000,22073=>1000,22074=>1000,22075=>1000,22076=>1000,22077=>1000,22078=>1000,22079=>1000,22080=>1000,22081=>1000,22082=>1000,22083=>1000,22084=>1000, - 22085=>1000,22086=>1000,22087=>1000,22088=>1000,22089=>1000,22090=>1000,22091=>1000,22092=>1000,22093=>1000,22094=>1000,22095=>1000,22096=>1000,22097=>1000,22098=>1000,22099=>1000,22100=>1000, - 22101=>1000,22102=>1000,22103=>1000,22104=>1000,22105=>1000,22106=>1000,22107=>1000,22108=>1000,22109=>1000,22110=>1000,22111=>1000,22112=>1000,22113=>1000,22114=>1000,22115=>1000,22116=>1000, - 22117=>1000,22118=>1000,22119=>1000,22120=>1000,22121=>1000,22122=>1000,22123=>1000,22124=>1000,22125=>1000,22126=>1000,22127=>1000,22128=>1000,22129=>1000,22130=>1000,22131=>1000,22132=>1000, - 22133=>1000,22134=>1000,22135=>1000,22136=>1000,22137=>1000,22138=>1000,22139=>1000,22140=>1000,22141=>1000,22142=>1000,22143=>1000,22144=>1000,22145=>1000,22146=>1000,22147=>1000,22148=>1000, - 22149=>1000,22150=>1000,22151=>1000,22152=>1000,22153=>1000,22154=>1000,22155=>1000,22156=>1000,22157=>1000,22158=>1000,22159=>1000,22160=>1000,22161=>1000,22162=>1000,22163=>1000,22164=>1000, - 22165=>1000,22166=>1000,22167=>1000,22168=>1000,22169=>1000,22170=>1000,22171=>1000,22172=>1000,22173=>1000,22174=>1000,22175=>1000,22176=>1000,22177=>1000,22178=>1000,22179=>1000,22180=>1000, - 22181=>1000,22182=>1000,22183=>1000,22184=>1000,22185=>1000,22186=>1000,22187=>1000,22188=>1000,22189=>1000,22190=>1000,22191=>1000,22192=>1000,22193=>1000,22194=>1000,22195=>1000,22196=>1000, - 22197=>1000,22198=>1000,22199=>1000,22200=>1000,22201=>1000,22202=>1000,22203=>1000,22204=>1000,22205=>1000,22206=>1000,22207=>1000,22208=>1000,22209=>1000,22210=>1000,22211=>1000,22212=>1000, - 22213=>1000,22214=>1000,22215=>1000,22216=>1000,22217=>1000,22218=>1000,22219=>1000,22220=>1000,22221=>1000,22222=>1000,22223=>1000,22224=>1000,22225=>1000,22226=>1000,22227=>1000,22228=>1000, - 22229=>1000,22230=>1000,22231=>1000,22232=>1000,22233=>1000,22234=>1000,22235=>1000,22236=>1000,22237=>1000,22238=>1000,22239=>1000,22240=>1000,22241=>1000,22242=>1000,22243=>1000,22244=>1000, - 22245=>1000,22246=>1000,22247=>1000,22248=>1000,22249=>1000,22250=>1000,22251=>1000,22252=>1000,22253=>1000,22254=>1000,22255=>1000,22256=>1000,22257=>1000,22258=>1000,22259=>1000,22260=>1000, - 22261=>1000,22262=>1000,22263=>1000,22264=>1000,22265=>1000,22266=>1000,22267=>1000,22268=>1000,22269=>1000,22270=>1000,22271=>1000,22272=>1000,22273=>1000,22274=>1000,22275=>1000,22276=>1000, - 22277=>1000,22278=>1000,22279=>1000,22280=>1000,22281=>1000,22282=>1000,22283=>1000,22284=>1000,22285=>1000,22286=>1000,22287=>1000,22288=>1000,22289=>1000,22290=>1000,22291=>1000,22292=>1000, - 22293=>1000,22294=>1000,22295=>1000,22296=>1000,22297=>1000,22298=>1000,22299=>1000,22300=>1000,22301=>1000,22302=>1000,22303=>1000,22304=>1000,22305=>1000,22306=>1000,22307=>1000,22308=>1000, - 22309=>1000,22310=>1000,22311=>1000,22312=>1000,22313=>1000,22314=>1000,22315=>1000,22316=>1000,22317=>1000,22318=>1000,22319=>1000,22320=>1000,22321=>1000,22322=>1000,22323=>1000,22324=>1000, - 22325=>1000,22326=>1000,22327=>1000,22328=>1000,22329=>1000,22330=>1000,22331=>1000,22332=>1000,22333=>1000,22334=>1000,22335=>1000,22336=>1000,22337=>1000,22338=>1000,22339=>1000,22340=>1000, - 22341=>1000,22342=>1000,22343=>1000,22344=>1000,22345=>1000,22346=>1000,22347=>1000,22348=>1000,22349=>1000,22350=>1000,22351=>1000,22352=>1000,22353=>1000,22354=>1000,22355=>1000,22356=>1000, - 22357=>1000,22358=>1000,22359=>1000,22360=>1000,22361=>1000,22362=>1000,22363=>1000,22364=>1000,22365=>1000,22366=>1000,22367=>1000,22368=>1000,22369=>1000,22370=>1000,22371=>1000,22372=>1000, - 22373=>1000,22374=>1000,22375=>1000,22376=>1000,22377=>1000,22378=>1000,22379=>1000,22380=>1000,22381=>1000,22382=>1000,22383=>1000,22384=>1000,22385=>1000,22386=>1000,22387=>1000,22388=>1000, - 22389=>1000,22390=>1000,22391=>1000,22392=>1000,22393=>1000,22394=>1000,22395=>1000,22396=>1000,22397=>1000,22398=>1000,22399=>1000,22400=>1000,22401=>1000,22402=>1000,22403=>1000,22404=>1000, - 22405=>1000,22406=>1000,22407=>1000,22408=>1000,22409=>1000,22410=>1000,22411=>1000,22412=>1000,22413=>1000,22414=>1000,22415=>1000,22416=>1000,22417=>1000,22418=>1000,22419=>1000,22420=>1000, - 22421=>1000,22422=>1000,22423=>1000,22424=>1000,22425=>1000,22426=>1000,22427=>1000,22428=>1000,22429=>1000,22430=>1000,22431=>1000,22432=>1000,22433=>1000,22434=>1000,22435=>1000,22436=>1000, - 22437=>1000,22438=>1000,22439=>1000,22440=>1000,22441=>1000,22442=>1000,22443=>1000,22444=>1000,22445=>1000,22446=>1000,22447=>1000,22448=>1000,22449=>1000,22450=>1000,22451=>1000,22452=>1000, - 22453=>1000,22454=>1000,22455=>1000,22456=>1000,22457=>1000,22458=>1000,22459=>1000,22460=>1000,22461=>1000,22462=>1000,22463=>1000,22464=>1000,22465=>1000,22466=>1000,22467=>1000,22468=>1000, - 22469=>1000,22470=>1000,22471=>1000,22472=>1000,22473=>1000,22474=>1000,22475=>1000,22476=>1000,22477=>1000,22478=>1000,22479=>1000,22480=>1000,22481=>1000,22482=>1000,22483=>1000,22484=>1000, - 22485=>1000,22486=>1000,22487=>1000,22488=>1000,22489=>1000,22490=>1000,22491=>1000,22492=>1000,22493=>1000,22494=>1000,22495=>1000,22496=>1000,22497=>1000,22498=>1000,22499=>1000,22500=>1000, - 22501=>1000,22502=>1000,22503=>1000,22504=>1000,22505=>1000,22506=>1000,22507=>1000,22508=>1000,22509=>1000,22510=>1000,22511=>1000,22512=>1000,22513=>1000,22514=>1000,22515=>1000,22516=>1000, - 22517=>1000,22518=>1000,22519=>1000,22520=>1000,22521=>1000,22522=>1000,22523=>1000,22524=>1000,22525=>1000,22526=>1000,22527=>1000,22528=>1000,22529=>1000,22530=>1000,22531=>1000,22532=>1000, - 22533=>1000,22534=>1000,22535=>1000,22536=>1000,22537=>1000,22538=>1000,22539=>1000,22540=>1000,22541=>1000,22542=>1000,22543=>1000,22544=>1000,22545=>1000,22546=>1000,22547=>1000,22548=>1000, - 22549=>1000,22550=>1000,22551=>1000,22552=>1000,22553=>1000,22554=>1000,22555=>1000,22556=>1000,22557=>1000,22558=>1000,22559=>1000,22560=>1000,22561=>1000,22562=>1000,22563=>1000,22564=>1000, - 22565=>1000,22566=>1000,22567=>1000,22568=>1000,22569=>1000,22570=>1000,22571=>1000,22572=>1000,22573=>1000,22574=>1000,22575=>1000,22576=>1000,22577=>1000,22578=>1000,22579=>1000,22580=>1000, - 22581=>1000,22582=>1000,22583=>1000,22584=>1000,22585=>1000,22586=>1000,22587=>1000,22588=>1000,22589=>1000,22590=>1000,22591=>1000,22592=>1000,22593=>1000,22594=>1000,22595=>1000,22596=>1000, - 22597=>1000,22598=>1000,22599=>1000,22600=>1000,22601=>1000,22602=>1000,22603=>1000,22604=>1000,22605=>1000,22606=>1000,22607=>1000,22608=>1000,22609=>1000,22610=>1000,22611=>1000,22612=>1000, - 22613=>1000,22614=>1000,22615=>1000,22616=>1000,22617=>1000,22618=>1000,22619=>1000,22620=>1000,22621=>1000,22622=>1000,22623=>1000,22624=>1000,22625=>1000,22626=>1000,22627=>1000,22628=>1000, - 22629=>1000,22630=>1000,22631=>1000,22632=>1000,22633=>1000,22634=>1000,22635=>1000,22636=>1000,22637=>1000,22638=>1000,22639=>1000,22640=>1000,22641=>1000,22642=>1000,22643=>1000,22644=>1000, - 22645=>1000,22646=>1000,22647=>1000,22648=>1000,22649=>1000,22650=>1000,22651=>1000,22652=>1000,22653=>1000,22654=>1000,22655=>1000,22656=>1000,22657=>1000,22658=>1000,22659=>1000,22660=>1000, - 22661=>1000,22662=>1000,22663=>1000,22664=>1000,22665=>1000,22666=>1000,22667=>1000,22668=>1000,22669=>1000,22670=>1000,22671=>1000,22672=>1000,22673=>1000,22674=>1000,22675=>1000,22676=>1000, - 22677=>1000,22678=>1000,22679=>1000,22680=>1000,22681=>1000,22682=>1000,22683=>1000,22684=>1000,22685=>1000,22686=>1000,22687=>1000,22688=>1000,22689=>1000,22690=>1000,22691=>1000,22692=>1000, - 22693=>1000,22694=>1000,22695=>1000,22696=>1000,22697=>1000,22698=>1000,22699=>1000,22700=>1000,22701=>1000,22702=>1000,22703=>1000,22704=>1000,22705=>1000,22706=>1000,22707=>1000,22708=>1000, - 22709=>1000,22710=>1000,22711=>1000,22712=>1000,22713=>1000,22714=>1000,22715=>1000,22716=>1000,22717=>1000,22718=>1000,22719=>1000,22720=>1000,22721=>1000,22722=>1000,22723=>1000,22724=>1000, - 22725=>1000,22726=>1000,22727=>1000,22728=>1000,22729=>1000,22730=>1000,22731=>1000,22732=>1000,22733=>1000,22734=>1000,22735=>1000,22736=>1000,22737=>1000,22738=>1000,22739=>1000,22740=>1000, - 22741=>1000,22742=>1000,22743=>1000,22744=>1000,22745=>1000,22746=>1000,22747=>1000,22748=>1000,22749=>1000,22750=>1000,22751=>1000,22752=>1000,22753=>1000,22754=>1000,22755=>1000,22756=>1000, - 22757=>1000,22758=>1000,22759=>1000,22760=>1000,22761=>1000,22762=>1000,22763=>1000,22764=>1000,22765=>1000,22766=>1000,22767=>1000,22768=>1000,22769=>1000,22770=>1000,22771=>1000,22772=>1000, - 22773=>1000,22774=>1000,22775=>1000,22776=>1000,22777=>1000,22778=>1000,22779=>1000,22780=>1000,22781=>1000,22782=>1000,22783=>1000,22784=>1000,22785=>1000,22786=>1000,22787=>1000,22788=>1000, - 22789=>1000,22790=>1000,22791=>1000,22792=>1000,22793=>1000,22794=>1000,22795=>1000,22796=>1000,22797=>1000,22798=>1000,22799=>1000,22800=>1000,22801=>1000,22802=>1000,22803=>1000,22804=>1000, - 22805=>1000,22806=>1000,22807=>1000,22808=>1000,22809=>1000,22810=>1000,22811=>1000,22812=>1000,22813=>1000,22814=>1000,22815=>1000,22816=>1000,22817=>1000,22818=>1000,22819=>1000,22820=>1000, - 22821=>1000,22822=>1000,22823=>1000,22824=>1000,22825=>1000,22826=>1000,22827=>1000,22828=>1000,22829=>1000,22830=>1000,22831=>1000,22832=>1000,22833=>1000,22834=>1000,22835=>1000,22836=>1000, - 22837=>1000,22838=>1000,22839=>1000,22840=>1000,22841=>1000,22842=>1000,22843=>1000,22844=>1000,22845=>1000,22846=>1000,22847=>1000,22848=>1000,22849=>1000,22850=>1000,22851=>1000,22852=>1000, - 22853=>1000,22854=>1000,22855=>1000,22856=>1000,22857=>1000,22858=>1000,22859=>1000,22860=>1000,22861=>1000,22862=>1000,22863=>1000,22864=>1000,22865=>1000,22866=>1000,22867=>1000,22868=>1000, - 22869=>1000,22870=>1000,22871=>1000,22872=>1000,22873=>1000,22874=>1000,22875=>1000,22876=>1000,22877=>1000,22878=>1000,22879=>1000,22880=>1000,22881=>1000,22882=>1000,22883=>1000,22884=>1000, - 22885=>1000,22886=>1000,22887=>1000,22888=>1000,22889=>1000,22890=>1000,22891=>1000,22892=>1000,22893=>1000,22894=>1000,22895=>1000,22896=>1000,22897=>1000,22898=>1000,22899=>1000,22900=>1000, - 22901=>1000,22902=>1000,22903=>1000,22904=>1000,22905=>1000,22906=>1000,22907=>1000,22908=>1000,22909=>1000,22910=>1000,22911=>1000,22912=>1000,22913=>1000,22914=>1000,22915=>1000,22916=>1000, - 22917=>1000,22918=>1000,22919=>1000,22920=>1000,22921=>1000,22922=>1000,22923=>1000,22924=>1000,22925=>1000,22926=>1000,22927=>1000,22928=>1000,22929=>1000,22930=>1000,22931=>1000,22932=>1000, - 22933=>1000,22934=>1000,22935=>1000,22936=>1000,22937=>1000,22938=>1000,22939=>1000,22940=>1000,22941=>1000,22942=>1000,22943=>1000,22944=>1000,22945=>1000,22946=>1000,22947=>1000,22948=>1000, - 22949=>1000,22950=>1000,22951=>1000,22952=>1000,22953=>1000,22954=>1000,22955=>1000,22956=>1000,22957=>1000,22958=>1000,22959=>1000,22960=>1000,22961=>1000,22962=>1000,22963=>1000,22964=>1000, - 22965=>1000,22966=>1000,22967=>1000,22968=>1000,22969=>1000,22970=>1000,22971=>1000,22972=>1000,22973=>1000,22974=>1000,22975=>1000,22976=>1000,22977=>1000,22978=>1000,22979=>1000,22980=>1000, - 22981=>1000,22982=>1000,22983=>1000,22984=>1000,22985=>1000,22986=>1000,22987=>1000,22988=>1000,22989=>1000,22990=>1000,22991=>1000,22992=>1000,22993=>1000,22994=>1000,22995=>1000,22996=>1000, - 22997=>1000,22998=>1000,22999=>1000,23000=>1000,23001=>1000,23002=>1000,23003=>1000,23004=>1000,23005=>1000,23006=>1000,23007=>1000,23008=>1000,23009=>1000,23010=>1000,23011=>1000,23012=>1000, - 23013=>1000,23014=>1000,23015=>1000,23016=>1000,23017=>1000,23018=>1000,23019=>1000,23020=>1000,23021=>1000,23022=>1000,23023=>1000,23024=>1000,23025=>1000,23026=>1000,23027=>1000,23028=>1000, - 23029=>1000,23030=>1000,23031=>1000,23032=>1000,23033=>1000,23034=>1000,23035=>1000,23036=>1000,23037=>1000,23038=>1000,23039=>1000,23040=>1000,23041=>1000,23042=>1000,23043=>1000,23044=>1000, - 23045=>1000,23046=>1000,23047=>1000,23048=>1000,23049=>1000,23050=>1000,23051=>1000,23052=>1000,23053=>1000,23054=>1000,23055=>1000,23056=>1000,23057=>1000,23058=>1000,23059=>1000,23060=>1000, - 23061=>1000,23062=>1000,23063=>1000,23064=>1000,23065=>1000,23066=>1000,23067=>1000,23068=>1000,23069=>1000,23070=>1000,23071=>1000,23072=>1000,23073=>1000,23074=>1000,23075=>1000,23076=>1000, - 23077=>1000,23078=>1000,23079=>1000,23080=>1000,23081=>1000,23082=>1000,23083=>1000,23084=>1000,23085=>1000,23086=>1000,23087=>1000,23088=>1000,23089=>1000,23090=>1000,23091=>1000,23092=>1000, - 23093=>1000,23094=>1000,23095=>1000,23096=>1000,23097=>1000,23098=>1000,23099=>1000,23100=>1000,23101=>1000,23102=>1000,23103=>1000,23104=>1000,23105=>1000,23106=>1000,23107=>1000,23108=>1000, - 23109=>1000,23110=>1000,23111=>1000,23112=>1000,23113=>1000,23114=>1000,23115=>1000,23116=>1000,23117=>1000,23118=>1000,23119=>1000,23120=>1000,23121=>1000,23122=>1000,23123=>1000,23124=>1000, - 23125=>1000,23126=>1000,23127=>1000,23128=>1000,23129=>1000,23130=>1000,23131=>1000,23132=>1000,23133=>1000,23134=>1000,23135=>1000,23136=>1000,23137=>1000,23138=>1000,23139=>1000,23140=>1000, - 23141=>1000,23142=>1000,23143=>1000,23144=>1000,23145=>1000,23146=>1000,23147=>1000,23148=>1000,23149=>1000,23150=>1000,23151=>1000,23152=>1000,23153=>1000,23154=>1000,23155=>1000,23156=>1000, - 23157=>1000,23158=>1000,23159=>1000,23160=>1000,23161=>1000,23162=>1000,23163=>1000,23164=>1000,23165=>1000,23166=>1000,23167=>1000,23168=>1000,23169=>1000,23170=>1000,23171=>1000,23172=>1000, - 23173=>1000,23174=>1000,23175=>1000,23176=>1000,23177=>1000,23178=>1000,23179=>1000,23180=>1000,23181=>1000,23182=>1000,23183=>1000,23184=>1000,23185=>1000,23186=>1000,23187=>1000,23188=>1000, - 23189=>1000,23190=>1000,23191=>1000,23192=>1000,23193=>1000,23194=>1000,23195=>1000,23196=>1000,23197=>1000,23198=>1000,23199=>1000,23200=>1000,23201=>1000,23202=>1000,23203=>1000,23204=>1000, - 23205=>1000,23206=>1000,23207=>1000,23208=>1000,23209=>1000,23210=>1000,23211=>1000,23212=>1000,23213=>1000,23214=>1000,23215=>1000,23216=>1000,23217=>1000,23218=>1000,23219=>1000,23220=>1000, - 23221=>1000,23222=>1000,23223=>1000,23224=>1000,23225=>1000,23226=>1000,23227=>1000,23228=>1000,23229=>1000,23230=>1000,23231=>1000,23232=>1000,23233=>1000,23234=>1000,23235=>1000,23236=>1000, - 23237=>1000,23238=>1000,23239=>1000,23240=>1000,23241=>1000,23242=>1000,23243=>1000,23244=>1000,23245=>1000,23246=>1000,23247=>1000,23248=>1000,23249=>1000,23250=>1000,23251=>1000,23252=>1000, - 23253=>1000,23254=>1000,23255=>1000,23256=>1000,23257=>1000,23258=>1000,23259=>1000,23260=>1000,23261=>1000,23262=>1000,23263=>1000,23264=>1000,23265=>1000,23266=>1000,23267=>1000,23268=>1000, - 23269=>1000,23270=>1000,23271=>1000,23272=>1000,23273=>1000,23274=>1000,23275=>1000,23276=>1000,23277=>1000,23278=>1000,23279=>1000,23280=>1000,23281=>1000,23282=>1000,23283=>1000,23284=>1000, - 23285=>1000,23286=>1000,23287=>1000,23288=>1000,23289=>1000,23290=>1000,23291=>1000,23292=>1000,23293=>1000,23294=>1000,23295=>1000,23296=>1000,23297=>1000,23298=>1000,23299=>1000,23300=>1000, - 23301=>1000,23302=>1000,23303=>1000,23304=>1000,23305=>1000,23306=>1000,23307=>1000,23308=>1000,23309=>1000,23310=>1000,23311=>1000,23312=>1000,23313=>1000,23314=>1000,23315=>1000,23316=>1000, - 23317=>1000,23318=>1000,23319=>1000,23320=>1000,23321=>1000,23322=>1000,23323=>1000,23324=>1000,23325=>1000,23326=>1000,23327=>1000,23328=>1000,23329=>1000,23330=>1000,23331=>1000,23332=>1000, - 23333=>1000,23334=>1000,23335=>1000,23336=>1000,23337=>1000,23338=>1000,23339=>1000,23340=>1000,23341=>1000,23342=>1000,23343=>1000,23344=>1000,23345=>1000,23346=>1000,23347=>1000,23348=>1000, - 23349=>1000,23350=>1000,23351=>1000,23352=>1000,23353=>1000,23354=>1000,23355=>1000,23356=>1000,23357=>1000,23358=>1000,23359=>1000,23360=>1000,23361=>1000,23362=>1000,23363=>1000,23364=>1000, - 23365=>1000,23366=>1000,23367=>1000,23368=>1000,23369=>1000,23370=>1000,23371=>1000,23372=>1000,23373=>1000,23374=>1000,23375=>1000,23376=>1000,23377=>1000,23378=>1000,23379=>1000,23380=>1000, - 23381=>1000,23382=>1000,23383=>1000,23384=>1000,23385=>1000,23386=>1000,23387=>1000,23388=>1000,23389=>1000,23390=>1000,23391=>1000,23392=>1000,23393=>1000,23394=>1000,23395=>1000,23396=>1000, - 23397=>1000,23398=>1000,23399=>1000,23400=>1000,23401=>1000,23402=>1000,23403=>1000,23404=>1000,23405=>1000,23406=>1000,23407=>1000,23408=>1000,23409=>1000,23410=>1000,23411=>1000,23412=>1000, - 23413=>1000,23414=>1000,23415=>1000,23416=>1000,23417=>1000,23418=>1000,23419=>1000,23420=>1000,23421=>1000,23422=>1000,23423=>1000,23424=>1000,23425=>1000,23426=>1000,23427=>1000,23428=>1000, - 23429=>1000,23430=>1000,23431=>1000,23432=>1000,23433=>1000,23434=>1000,23435=>1000,23436=>1000,23437=>1000,23438=>1000,23439=>1000,23440=>1000,23441=>1000,23442=>1000,23443=>1000,23444=>1000, - 23445=>1000,23446=>1000,23447=>1000,23448=>1000,23449=>1000,23450=>1000,23451=>1000,23452=>1000,23453=>1000,23454=>1000,23455=>1000,23456=>1000,23457=>1000,23458=>1000,23459=>1000,23460=>1000, - 23461=>1000,23462=>1000,23463=>1000,23464=>1000,23465=>1000,23466=>1000,23467=>1000,23468=>1000,23469=>1000,23470=>1000,23471=>1000,23472=>1000,23473=>1000,23474=>1000,23475=>1000,23476=>1000, - 23477=>1000,23478=>1000,23479=>1000,23480=>1000,23481=>1000,23482=>1000,23483=>1000,23484=>1000,23485=>1000,23486=>1000,23487=>1000,23488=>1000,23489=>1000,23490=>1000,23491=>1000,23492=>1000, - 23493=>1000,23494=>1000,23495=>1000,23496=>1000,23497=>1000,23498=>1000,23499=>1000,23500=>1000,23501=>1000,23502=>1000,23503=>1000,23504=>1000,23505=>1000,23506=>1000,23507=>1000,23508=>1000, - 23509=>1000,23510=>1000,23511=>1000,23512=>1000,23513=>1000,23514=>1000,23515=>1000,23516=>1000,23517=>1000,23518=>1000,23519=>1000,23520=>1000,23521=>1000,23522=>1000,23523=>1000,23524=>1000, - 23525=>1000,23526=>1000,23527=>1000,23528=>1000,23529=>1000,23530=>1000,23531=>1000,23532=>1000,23533=>1000,23534=>1000,23535=>1000,23536=>1000,23537=>1000,23538=>1000,23539=>1000,23540=>1000, - 23541=>1000,23542=>1000,23543=>1000,23544=>1000,23545=>1000,23546=>1000,23547=>1000,23548=>1000,23549=>1000,23550=>1000,23551=>1000,23552=>1000,23553=>1000,23554=>1000,23555=>1000,23556=>1000, - 23557=>1000,23558=>1000,23559=>1000,23560=>1000,23561=>1000,23562=>1000,23563=>1000,23564=>1000,23565=>1000,23566=>1000,23567=>1000,23568=>1000,23569=>1000,23570=>1000,23571=>1000,23572=>1000, - 23573=>1000,23574=>1000,23575=>1000,23576=>1000,23577=>1000,23578=>1000,23579=>1000,23580=>1000,23581=>1000,23582=>1000,23583=>1000,23584=>1000,23585=>1000,23586=>1000,23587=>1000,23588=>1000, - 23589=>1000,23590=>1000,23591=>1000,23592=>1000,23593=>1000,23594=>1000,23595=>1000,23596=>1000,23597=>1000,23598=>1000,23599=>1000,23600=>1000,23601=>1000,23602=>1000,23603=>1000,23604=>1000, - 23605=>1000,23606=>1000,23607=>1000,23608=>1000,23609=>1000,23610=>1000,23611=>1000,23612=>1000,23613=>1000,23614=>1000,23615=>1000,23616=>1000,23617=>1000,23618=>1000,23619=>1000,23620=>1000, - 23621=>1000,23622=>1000,23623=>1000,23624=>1000,23625=>1000,23626=>1000,23627=>1000,23628=>1000,23629=>1000,23630=>1000,23631=>1000,23632=>1000,23633=>1000,23634=>1000,23635=>1000,23636=>1000, - 23637=>1000,23638=>1000,23639=>1000,23640=>1000,23641=>1000,23642=>1000,23643=>1000,23644=>1000,23645=>1000,23646=>1000,23647=>1000,23648=>1000,23649=>1000,23650=>1000,23651=>1000,23652=>1000, - 23653=>1000,23654=>1000,23655=>1000,23656=>1000,23657=>1000,23658=>1000,23659=>1000,23660=>1000,23661=>1000,23662=>1000,23663=>1000,23664=>1000,23665=>1000,23666=>1000,23667=>1000,23668=>1000, - 23669=>1000,23670=>1000,23671=>1000,23672=>1000,23673=>1000,23674=>1000,23675=>1000,23676=>1000,23677=>1000,23678=>1000,23679=>1000,23680=>1000,23681=>1000,23682=>1000,23683=>1000,23684=>1000, - 23685=>1000,23686=>1000,23687=>1000,23688=>1000,23689=>1000,23690=>1000,23691=>1000,23692=>1000,23693=>1000,23694=>1000,23695=>1000,23696=>1000,23697=>1000,23698=>1000,23699=>1000,23700=>1000, - 23701=>1000,23702=>1000,23703=>1000,23704=>1000,23705=>1000,23706=>1000,23707=>1000,23708=>1000,23709=>1000,23710=>1000,23711=>1000,23712=>1000,23713=>1000,23714=>1000,23715=>1000,23716=>1000, - 23717=>1000,23718=>1000,23719=>1000,23720=>1000,23721=>1000,23722=>1000,23723=>1000,23724=>1000,23725=>1000,23726=>1000,23727=>1000,23728=>1000,23729=>1000,23730=>1000,23731=>1000,23732=>1000, - 23733=>1000,23734=>1000,23735=>1000,23736=>1000,23737=>1000,23738=>1000,23739=>1000,23740=>1000,23741=>1000,23742=>1000,23743=>1000,23744=>1000,23745=>1000,23746=>1000,23747=>1000,23748=>1000, - 23749=>1000,23750=>1000,23751=>1000,23752=>1000,23753=>1000,23754=>1000,23755=>1000,23756=>1000,23757=>1000,23758=>1000,23759=>1000,23760=>1000,23761=>1000,23762=>1000,23763=>1000,23764=>1000, - 23765=>1000,23766=>1000,23767=>1000,23768=>1000,23769=>1000,23770=>1000,23771=>1000,23772=>1000,23773=>1000,23774=>1000,23775=>1000,23776=>1000,23777=>1000,23778=>1000,23779=>1000,23780=>1000, - 23781=>1000,23782=>1000,23783=>1000,23784=>1000,23785=>1000,23786=>1000,23787=>1000,23788=>1000,23789=>1000,23790=>1000,23791=>1000,23792=>1000,23793=>1000,23794=>1000,23795=>1000,23796=>1000, - 23797=>1000,23798=>1000,23799=>1000,23800=>1000,23801=>1000,23802=>1000,23803=>1000,23804=>1000,23805=>1000,23806=>1000,23807=>1000,23808=>1000,23809=>1000,23810=>1000,23811=>1000,23812=>1000, - 23813=>1000,23814=>1000,23815=>1000,23816=>1000,23817=>1000,23818=>1000,23819=>1000,23820=>1000,23821=>1000,23822=>1000,23823=>1000,23824=>1000,23825=>1000,23826=>1000,23827=>1000,23828=>1000, - 23829=>1000,23830=>1000,23831=>1000,23832=>1000,23833=>1000,23834=>1000,23835=>1000,23836=>1000,23837=>1000,23838=>1000,23839=>1000,23840=>1000,23841=>1000,23842=>1000,23843=>1000,23844=>1000, - 23845=>1000,23846=>1000,23847=>1000,23848=>1000,23849=>1000,23850=>1000,23851=>1000,23852=>1000,23853=>1000,23854=>1000,23855=>1000,23856=>1000,23857=>1000,23858=>1000,23859=>1000,23860=>1000, - 23861=>1000,23862=>1000,23863=>1000,23864=>1000,23865=>1000,23866=>1000,23867=>1000,23868=>1000,23869=>1000,23870=>1000,23871=>1000,23872=>1000,23873=>1000,23874=>1000,23875=>1000,23876=>1000, - 23877=>1000,23878=>1000,23879=>1000,23880=>1000,23881=>1000,23882=>1000,23883=>1000,23884=>1000,23885=>1000,23886=>1000,23887=>1000,23888=>1000,23889=>1000,23890=>1000,23891=>1000,23892=>1000, - 23893=>1000,23894=>1000,23895=>1000,23896=>1000,23897=>1000,23898=>1000,23899=>1000,23900=>1000,23901=>1000,23902=>1000,23903=>1000,23904=>1000,23905=>1000,23906=>1000,23907=>1000,23908=>1000, - 23909=>1000,23910=>1000,23911=>1000,23912=>1000,23913=>1000,23914=>1000,23915=>1000,23916=>1000,23917=>1000,23918=>1000,23919=>1000,23920=>1000,23921=>1000,23922=>1000,23923=>1000,23924=>1000, - 23925=>1000,23926=>1000,23927=>1000,23928=>1000,23929=>1000,23930=>1000,23931=>1000,23932=>1000,23933=>1000,23934=>1000,23935=>1000,23936=>1000,23937=>1000,23938=>1000,23939=>1000,23940=>1000, - 23941=>1000,23942=>1000,23943=>1000,23944=>1000,23945=>1000,23946=>1000,23947=>1000,23948=>1000,23949=>1000,23950=>1000,23951=>1000,23952=>1000,23953=>1000,23954=>1000,23955=>1000,23956=>1000, - 23957=>1000,23958=>1000,23959=>1000,23960=>1000,23961=>1000,23962=>1000,23963=>1000,23964=>1000,23965=>1000,23966=>1000,23967=>1000,23968=>1000,23969=>1000,23970=>1000,23971=>1000,23972=>1000, - 23973=>1000,23974=>1000,23975=>1000,23976=>1000,23977=>1000,23978=>1000,23979=>1000,23980=>1000,23981=>1000,23982=>1000,23983=>1000,23984=>1000,23985=>1000,23986=>1000,23987=>1000,23988=>1000, - 23989=>1000,23990=>1000,23991=>1000,23992=>1000,23993=>1000,23994=>1000,23995=>1000,23996=>1000,23997=>1000,23998=>1000,23999=>1000,24000=>1000,24001=>1000,24002=>1000,24003=>1000,24004=>1000, - 24005=>1000,24006=>1000,24007=>1000,24008=>1000,24009=>1000,24010=>1000,24011=>1000,24012=>1000,24013=>1000,24014=>1000,24015=>1000,24016=>1000,24017=>1000,24018=>1000,24019=>1000,24020=>1000, - 24021=>1000,24022=>1000,24023=>1000,24024=>1000,24025=>1000,24026=>1000,24027=>1000,24028=>1000,24029=>1000,24030=>1000,24031=>1000,24032=>1000,24033=>1000,24034=>1000,24035=>1000,24036=>1000, - 24037=>1000,24038=>1000,24039=>1000,24040=>1000,24041=>1000,24042=>1000,24043=>1000,24044=>1000,24045=>1000,24046=>1000,24047=>1000,24048=>1000,24049=>1000,24050=>1000,24051=>1000,24052=>1000, - 24053=>1000,24054=>1000,24055=>1000,24056=>1000,24057=>1000,24058=>1000,24059=>1000,24060=>1000,24061=>1000,24062=>1000,24063=>1000,24064=>1000,24065=>1000,24066=>1000,24067=>1000,24068=>1000, - 24069=>1000,24070=>1000,24071=>1000,24072=>1000,24073=>1000,24074=>1000,24075=>1000,24076=>1000,24077=>1000,24078=>1000,24079=>1000,24080=>1000,24081=>1000,24082=>1000,24083=>1000,24084=>1000, - 24085=>1000,24086=>1000,24087=>1000,24088=>1000,24089=>1000,24090=>1000,24091=>1000,24092=>1000,24093=>1000,24094=>1000,24095=>1000,24096=>1000,24097=>1000,24098=>1000,24099=>1000,24100=>1000, - 24101=>1000,24102=>1000,24103=>1000,24104=>1000,24105=>1000,24106=>1000,24107=>1000,24108=>1000,24109=>1000,24110=>1000,24111=>1000,24112=>1000,24113=>1000,24114=>1000,24115=>1000,24116=>1000, - 24117=>1000,24118=>1000,24119=>1000,24120=>1000,24121=>1000,24122=>1000,24123=>1000,24124=>1000,24125=>1000,24126=>1000,24127=>1000,24128=>1000,24129=>1000,24130=>1000,24131=>1000,24132=>1000, - 24133=>1000,24134=>1000,24135=>1000,24136=>1000,24137=>1000,24138=>1000,24139=>1000,24140=>1000,24141=>1000,24142=>1000,24143=>1000,24144=>1000,24145=>1000,24146=>1000,24147=>1000,24148=>1000, - 24149=>1000,24150=>1000,24151=>1000,24152=>1000,24153=>1000,24154=>1000,24155=>1000,24156=>1000,24157=>1000,24158=>1000,24159=>1000,24160=>1000,24161=>1000,24162=>1000,24163=>1000,24164=>1000, - 24165=>1000,24166=>1000,24167=>1000,24168=>1000,24169=>1000,24170=>1000,24171=>1000,24172=>1000,24173=>1000,24174=>1000,24175=>1000,24176=>1000,24177=>1000,24178=>1000,24179=>1000,24180=>1000, - 24181=>1000,24182=>1000,24183=>1000,24184=>1000,24185=>1000,24186=>1000,24187=>1000,24188=>1000,24189=>1000,24190=>1000,24191=>1000,24192=>1000,24193=>1000,24194=>1000,24195=>1000,24196=>1000, - 24197=>1000,24198=>1000,24199=>1000,24200=>1000,24201=>1000,24202=>1000,24203=>1000,24204=>1000,24205=>1000,24206=>1000,24207=>1000,24208=>1000,24209=>1000,24210=>1000,24211=>1000,24212=>1000, - 24213=>1000,24214=>1000,24215=>1000,24216=>1000,24217=>1000,24218=>1000,24219=>1000,24220=>1000,24221=>1000,24222=>1000,24223=>1000,24224=>1000,24225=>1000,24226=>1000,24227=>1000,24228=>1000, - 24229=>1000,24230=>1000,24231=>1000,24232=>1000,24233=>1000,24234=>1000,24235=>1000,24236=>1000,24237=>1000,24238=>1000,24239=>1000,24240=>1000,24241=>1000,24242=>1000,24243=>1000,24244=>1000, - 24245=>1000,24246=>1000,24247=>1000,24248=>1000,24249=>1000,24250=>1000,24251=>1000,24252=>1000,24253=>1000,24254=>1000,24255=>1000,24256=>1000,24257=>1000,24258=>1000,24259=>1000,24260=>1000, - 24261=>1000,24262=>1000,24263=>1000,24264=>1000,24265=>1000,24266=>1000,24267=>1000,24268=>1000,24269=>1000,24270=>1000,24271=>1000,24272=>1000,24273=>1000,24274=>1000,24275=>1000,24276=>1000, - 24277=>1000,24278=>1000,24279=>1000,24280=>1000,24281=>1000,24282=>1000,24283=>1000,24284=>1000,24285=>1000,24286=>1000,24287=>1000,24288=>1000,24289=>1000,24290=>1000,24291=>1000,24292=>1000, - 24293=>1000,24294=>1000,24295=>1000,24296=>1000,24297=>1000,24298=>1000,24299=>1000,24300=>1000,24301=>1000,24302=>1000,24303=>1000,24304=>1000,24305=>1000,24306=>1000,24307=>1000,24308=>1000, - 24309=>1000,24310=>1000,24311=>1000,24312=>1000,24313=>1000,24314=>1000,24315=>1000,24316=>1000,24317=>1000,24318=>1000,24319=>1000,24320=>1000,24321=>1000,24322=>1000,24323=>1000,24324=>1000, - 24325=>1000,24326=>1000,24327=>1000,24328=>1000,24329=>1000,24330=>1000,24331=>1000,24332=>1000,24333=>1000,24334=>1000,24335=>1000,24336=>1000,24337=>1000,24338=>1000,24339=>1000,24340=>1000, - 24341=>1000,24342=>1000,24343=>1000,24344=>1000,24345=>1000,24346=>1000,24347=>1000,24348=>1000,24349=>1000,24350=>1000,24351=>1000,24352=>1000,24353=>1000,24354=>1000,24355=>1000,24356=>1000, - 24357=>1000,24358=>1000,24359=>1000,24360=>1000,24361=>1000,24362=>1000,24363=>1000,24364=>1000,24365=>1000,24366=>1000,24367=>1000,24368=>1000,24369=>1000,24370=>1000,24371=>1000,24372=>1000, - 24373=>1000,24374=>1000,24375=>1000,24376=>1000,24377=>1000,24378=>1000,24379=>1000,24380=>1000,24381=>1000,24382=>1000,24383=>1000,24384=>1000,24385=>1000,24386=>1000,24387=>1000,24388=>1000, - 24389=>1000,24390=>1000,24391=>1000,24392=>1000,24393=>1000,24394=>1000,24395=>1000,24396=>1000,24397=>1000,24398=>1000,24399=>1000,24400=>1000,24401=>1000,24402=>1000,24403=>1000,24404=>1000, - 24405=>1000,24406=>1000,24407=>1000,24408=>1000,24409=>1000,24410=>1000,24411=>1000,24412=>1000,24413=>1000,24414=>1000,24415=>1000,24416=>1000,24417=>1000,24418=>1000,24419=>1000,24420=>1000, - 24421=>1000,24422=>1000,24423=>1000,24424=>1000,24425=>1000,24426=>1000,24427=>1000,24428=>1000,24429=>1000,24430=>1000,24431=>1000,24432=>1000,24433=>1000,24434=>1000,24435=>1000,24436=>1000, - 24437=>1000,24438=>1000,24439=>1000,24440=>1000,24441=>1000,24442=>1000,24443=>1000,24444=>1000,24445=>1000,24446=>1000,24447=>1000,24448=>1000,24449=>1000,24450=>1000,24451=>1000,24452=>1000, - 24453=>1000,24454=>1000,24455=>1000,24456=>1000,24457=>1000,24458=>1000,24459=>1000,24460=>1000,24461=>1000,24462=>1000,24463=>1000,24464=>1000,24465=>1000,24466=>1000,24467=>1000,24468=>1000, - 24469=>1000,24470=>1000,24471=>1000,24472=>1000,24473=>1000,24474=>1000,24475=>1000,24476=>1000,24477=>1000,24478=>1000,24479=>1000,24480=>1000,24481=>1000,24482=>1000,24483=>1000,24484=>1000, - 24485=>1000,24486=>1000,24487=>1000,24488=>1000,24489=>1000,24490=>1000,24491=>1000,24492=>1000,24493=>1000,24494=>1000,24495=>1000,24496=>1000,24497=>1000,24498=>1000,24499=>1000,24500=>1000, - 24501=>1000,24502=>1000,24503=>1000,24504=>1000,24505=>1000,24506=>1000,24507=>1000,24508=>1000,24509=>1000,24510=>1000,24511=>1000,24512=>1000,24513=>1000,24514=>1000,24515=>1000,24516=>1000, - 24517=>1000,24518=>1000,24519=>1000,24520=>1000,24521=>1000,24522=>1000,24523=>1000,24524=>1000,24525=>1000,24526=>1000,24527=>1000,24528=>1000,24529=>1000,24530=>1000,24531=>1000,24532=>1000, - 24533=>1000,24534=>1000,24535=>1000,24536=>1000,24537=>1000,24538=>1000,24539=>1000,24540=>1000,24541=>1000,24542=>1000,24543=>1000,24544=>1000,24545=>1000,24546=>1000,24547=>1000,24548=>1000, - 24549=>1000,24550=>1000,24551=>1000,24552=>1000,24553=>1000,24554=>1000,24555=>1000,24556=>1000,24557=>1000,24558=>1000,24559=>1000,24560=>1000,24561=>1000,24562=>1000,24563=>1000,24564=>1000, - 24565=>1000,24566=>1000,24567=>1000,24568=>1000,24569=>1000,24570=>1000,24571=>1000,24572=>1000,24573=>1000,24574=>1000,24575=>1000,24576=>1000,24577=>1000,24578=>1000,24579=>1000,24580=>1000, - 24581=>1000,24582=>1000,24583=>1000,24584=>1000,24585=>1000,24586=>1000,24587=>1000,24588=>1000,24589=>1000,24590=>1000,24591=>1000,24592=>1000,24593=>1000,24594=>1000,24595=>1000,24596=>1000, - 24597=>1000,24598=>1000,24599=>1000,24600=>1000,24601=>1000,24602=>1000,24603=>1000,24604=>1000,24605=>1000,24606=>1000,24607=>1000,24608=>1000,24609=>1000,24610=>1000,24611=>1000,24612=>1000, - 24613=>1000,24614=>1000,24615=>1000,24616=>1000,24617=>1000,24618=>1000,24619=>1000,24620=>1000,24621=>1000,24622=>1000,24623=>1000,24624=>1000,24625=>1000,24626=>1000,24627=>1000,24628=>1000, - 24629=>1000,24630=>1000,24631=>1000,24632=>1000,24633=>1000,24634=>1000,24635=>1000,24636=>1000,24637=>1000,24638=>1000,24639=>1000,24640=>1000,24641=>1000,24642=>1000,24643=>1000,24644=>1000, - 24645=>1000,24646=>1000,24647=>1000,24648=>1000,24649=>1000,24650=>1000,24651=>1000,24652=>1000,24653=>1000,24654=>1000,24655=>1000,24656=>1000,24657=>1000,24658=>1000,24659=>1000,24660=>1000, - 24661=>1000,24662=>1000,24663=>1000,24664=>1000,24665=>1000,24666=>1000,24667=>1000,24668=>1000,24669=>1000,24670=>1000,24671=>1000,24672=>1000,24673=>1000,24674=>1000,24675=>1000,24676=>1000, - 24677=>1000,24678=>1000,24679=>1000,24680=>1000,24681=>1000,24682=>1000,24683=>1000,24684=>1000,24685=>1000,24686=>1000,24687=>1000,24688=>1000,24689=>1000,24690=>1000,24691=>1000,24692=>1000, - 24693=>1000,24694=>1000,24695=>1000,24696=>1000,24697=>1000,24698=>1000,24699=>1000,24700=>1000,24701=>1000,24702=>1000,24703=>1000,24704=>1000,24705=>1000,24706=>1000,24707=>1000,24708=>1000, - 24709=>1000,24710=>1000,24711=>1000,24712=>1000,24713=>1000,24714=>1000,24715=>1000,24716=>1000,24717=>1000,24718=>1000,24719=>1000,24720=>1000,24721=>1000,24722=>1000,24723=>1000,24724=>1000, - 24725=>1000,24726=>1000,24727=>1000,24728=>1000,24729=>1000,24730=>1000,24731=>1000,24732=>1000,24733=>1000,24734=>1000,24735=>1000,24736=>1000,24737=>1000,24738=>1000,24739=>1000,24740=>1000, - 24741=>1000,24742=>1000,24743=>1000,24744=>1000,24745=>1000,24746=>1000,24747=>1000,24748=>1000,24749=>1000,24750=>1000,24751=>1000,24752=>1000,24753=>1000,24754=>1000,24755=>1000,24756=>1000, - 24757=>1000,24758=>1000,24759=>1000,24760=>1000,24761=>1000,24762=>1000,24763=>1000,24764=>1000,24765=>1000,24766=>1000,24767=>1000,24768=>1000,24769=>1000,24770=>1000,24771=>1000,24772=>1000, - 24773=>1000,24774=>1000,24775=>1000,24776=>1000,24777=>1000,24778=>1000,24779=>1000,24780=>1000,24781=>1000,24782=>1000,24783=>1000,24784=>1000,24785=>1000,24786=>1000,24787=>1000,24788=>1000, - 24789=>1000,24790=>1000,24791=>1000,24792=>1000,24793=>1000,24794=>1000,24795=>1000,24796=>1000,24797=>1000,24798=>1000,24799=>1000,24800=>1000,24801=>1000,24802=>1000,24803=>1000,24804=>1000, - 24805=>1000,24806=>1000,24807=>1000,24808=>1000,24809=>1000,24810=>1000,24811=>1000,24812=>1000,24813=>1000,24814=>1000,24815=>1000,24816=>1000,24817=>1000,24818=>1000,24819=>1000,24820=>1000, - 24821=>1000,24822=>1000,24823=>1000,24824=>1000,24825=>1000,24826=>1000,24827=>1000,24828=>1000,24829=>1000,24830=>1000,24831=>1000,24832=>1000,24833=>1000,24834=>1000,24835=>1000,24836=>1000, - 24837=>1000,24838=>1000,24839=>1000,24840=>1000,24841=>1000,24842=>1000,24843=>1000,24844=>1000,24845=>1000,24846=>1000,24847=>1000,24848=>1000,24849=>1000,24850=>1000,24851=>1000,24852=>1000, - 24853=>1000,24854=>1000,24855=>1000,24856=>1000,24857=>1000,24858=>1000,24859=>1000,24860=>1000,24861=>1000,24862=>1000,24863=>1000,24864=>1000,24865=>1000,24866=>1000,24867=>1000,24868=>1000, - 24869=>1000,24870=>1000,24871=>1000,24872=>1000,24873=>1000,24874=>1000,24875=>1000,24876=>1000,24877=>1000,24878=>1000,24879=>1000,24880=>1000,24881=>1000,24882=>1000,24883=>1000,24884=>1000, - 24885=>1000,24886=>1000,24887=>1000,24888=>1000,24889=>1000,24890=>1000,24891=>1000,24892=>1000,24893=>1000,24894=>1000,24895=>1000,24896=>1000,24897=>1000,24898=>1000,24899=>1000,24900=>1000, - 24901=>1000,24902=>1000,24903=>1000,24904=>1000,24905=>1000,24906=>1000,24907=>1000,24908=>1000,24909=>1000,24910=>1000,24911=>1000,24912=>1000,24913=>1000,24914=>1000,24915=>1000,24916=>1000, - 24917=>1000,24918=>1000,24919=>1000,24920=>1000,24921=>1000,24922=>1000,24923=>1000,24924=>1000,24925=>1000,24926=>1000,24927=>1000,24928=>1000,24929=>1000,24930=>1000,24931=>1000,24932=>1000, - 24933=>1000,24934=>1000,24935=>1000,24936=>1000,24937=>1000,24938=>1000,24939=>1000,24940=>1000,24941=>1000,24942=>1000,24943=>1000,24944=>1000,24945=>1000,24946=>1000,24947=>1000,24948=>1000, - 24949=>1000,24950=>1000,24951=>1000,24952=>1000,24953=>1000,24954=>1000,24955=>1000,24956=>1000,24957=>1000,24958=>1000,24959=>1000,24960=>1000,24961=>1001,24962=>1000,24963=>1000,24964=>1000, - 24965=>1000,24966=>1000,24967=>1000,24968=>1000,24969=>1000,24970=>1000,24971=>1000,24972=>1000,24973=>1000,24974=>1000,24975=>1000,24976=>1000,24977=>1000,24978=>1000,24979=>1000,24980=>1000, - 24981=>1000,24982=>1000,24983=>1000,24984=>1000,24985=>1000,24986=>1000,24987=>1000,24988=>1000,24989=>1000,24990=>1000,24991=>1000,24992=>1000,24993=>1000,24994=>1000,24995=>1000,24996=>1000, - 24997=>1000,24998=>1000,24999=>1000,25000=>1000,25001=>1000,25002=>1000,25003=>1000,25004=>1000,25005=>1000,25006=>1000,25007=>1000,25008=>1000,25009=>1000,25010=>1000,25011=>1000,25012=>1000, - 25013=>1000,25014=>1000,25015=>1000,25016=>1000,25017=>1000,25018=>1000,25019=>1000,25020=>1000,25021=>1000,25022=>1000,25023=>1000,25024=>1000,25025=>1000,25026=>1000,25027=>1000,25028=>1000, - 25029=>1000,25030=>1000,25031=>1000,25032=>1000,25033=>1000,25034=>1000,25035=>1000,25036=>1000,25037=>1000,25038=>1000,25039=>1000,25040=>1000,25041=>1000,25042=>1000,25043=>1000,25044=>1000, - 25045=>1000,25046=>1000,25047=>1000,25048=>1000,25049=>1000,25050=>1000,25051=>1000,25052=>1000,25053=>1000,25054=>1000,25055=>1000,25056=>1000,25057=>1000,25058=>1000,25059=>1000,25060=>1000, - 25061=>1000,25062=>1000,25063=>1000,25064=>1000,25065=>1000,25066=>1000,25067=>1000,25068=>1000,25069=>1000,25070=>1000,25071=>1000,25072=>1000,25073=>1000,25074=>1000,25075=>1000,25076=>1000, - 25077=>1000,25078=>1000,25079=>1000,25080=>1000,25081=>1000,25082=>1000,25083=>1000,25084=>1000,25085=>1000,25086=>1000,25087=>1000,25088=>1000,25089=>1000,25090=>1000,25091=>1000,25092=>1000, - 25093=>1000,25094=>1000,25095=>1000,25096=>1000,25097=>1000,25098=>1000,25099=>1000,25100=>1000,25101=>1000,25102=>1000,25103=>1000,25104=>1000,25105=>1000,25106=>1000,25107=>1000,25108=>1000, - 25109=>1000,25110=>1000,25111=>1000,25112=>1000,25113=>1000,25114=>1000,25115=>1000,25116=>1000,25117=>1000,25118=>1000,25119=>1000,25120=>1000,25121=>1000,25122=>1000,25123=>1000,25124=>1000, - 25125=>1000,25126=>1000,25127=>1000,25128=>1000,25129=>1000,25130=>1000,25131=>1000,25132=>1000,25133=>1000,25134=>1000,25135=>1000,25136=>1000,25137=>1000,25138=>1000,25139=>1000,25140=>1000, - 25141=>1000,25142=>1000,25143=>1000,25144=>1000,25145=>1000,25146=>1000,25147=>1000,25148=>1000,25149=>1000,25150=>1000,25151=>1000,25152=>1000,25153=>1000,25154=>1000,25155=>1000,25156=>1000, - 25157=>1000,25158=>1000,25159=>1000,25160=>1000,25161=>1000,25162=>1000,25163=>1000,25164=>1000,25165=>1000,25166=>1000,25167=>1000,25168=>1000,25169=>1000,25170=>1000,25171=>1000,25172=>1000, - 25173=>1000,25174=>1000,25175=>1000,25176=>1000,25177=>1000,25178=>1000,25179=>1000,25180=>1000,25181=>1000,25182=>1000,25183=>1000,25184=>1000,25185=>1000,25186=>1000,25187=>1000,25188=>1000, - 25189=>1000,25190=>1000,25191=>1000,25192=>1000,25193=>1000,25194=>1000,25195=>1000,25196=>1000,25197=>1000,25198=>1000,25199=>1000,25200=>1000,25201=>1000,25202=>1000,25203=>1000,25204=>1000, - 25205=>1000,25206=>1000,25207=>1000,25208=>1000,25209=>1000,25210=>1000,25211=>1000,25212=>1000,25213=>1000,25214=>1000,25215=>1000,25216=>1000,25217=>1000,25218=>1000,25219=>1000,25220=>1000, - 25221=>1000,25222=>1000,25223=>1000,25224=>1000,25225=>1000,25226=>1000,25227=>1000,25228=>1000,25229=>1000,25230=>1000,25231=>1000,25232=>1000,25233=>1000,25234=>1000,25235=>1000,25236=>1000, - 25237=>1000,25238=>1000,25239=>1000,25240=>1000,25241=>1000,25242=>1000,25243=>1000,25244=>1000,25245=>1000,25246=>1000,25247=>1000,25248=>1000,25249=>1000,25250=>1000,25251=>1000,25252=>1000, - 25253=>1000,25254=>1000,25255=>1000,25256=>1000,25257=>1000,25258=>1000,25259=>1000,25260=>1000,25261=>1000,25262=>1000,25263=>1000,25264=>1000,25265=>1000,25266=>1000,25267=>1000,25268=>1000, - 25269=>1000,25270=>1000,25271=>1000,25272=>1000,25273=>1000,25274=>1000,25275=>1000,25276=>1000,25277=>1000,25278=>1000,25279=>1000,25280=>1000,25281=>1000,25282=>1000,25283=>1000,25284=>1000, - 25285=>1000,25286=>1000,25287=>1000,25288=>1000,25289=>1000,25290=>1000,25291=>1000,25292=>1000,25293=>1000,25294=>1000,25295=>1000,25296=>1000,25297=>1000,25298=>1000,25299=>1000,25300=>1000, - 25301=>1000,25302=>1000,25303=>1000,25304=>1000,25305=>1000,25306=>1000,25307=>1000,25308=>1000,25309=>1000,25310=>1000,25311=>1000,25312=>1000,25313=>1000,25314=>1000,25315=>1000,25316=>1000, - 25317=>1000,25318=>1000,25319=>1000,25320=>1000,25321=>1000,25322=>1000,25323=>1000,25324=>1000,25325=>1000,25326=>1000,25327=>1000,25328=>1000,25329=>1000,25330=>1000,25331=>1000,25332=>1000, - 25333=>1000,25334=>1000,25335=>1000,25336=>1000,25337=>1000,25338=>1000,25339=>1000,25340=>1000,25341=>1000,25342=>1000,25343=>1000,25344=>1000,25345=>1000,25346=>1000,25347=>1000,25348=>1000, - 25349=>1000,25350=>1000,25351=>1000,25352=>1000,25353=>1000,25354=>1000,25355=>1000,25356=>1000,25357=>1000,25358=>1000,25359=>1000,25360=>1000,25361=>1000,25362=>1000,25363=>1000,25364=>1000, - 25365=>1000,25366=>1000,25367=>1000,25368=>1000,25369=>1000,25370=>1000,25371=>1000,25372=>1000,25373=>1000,25374=>1000,25375=>1000,25376=>1000,25377=>1000,25378=>1000,25379=>1000,25380=>1000, - 25381=>1000,25382=>1000,25383=>1000,25384=>1000,25385=>1000,25386=>1000,25387=>1000,25388=>1000,25389=>1000,25390=>1000,25391=>1000,25392=>1000,25393=>1000,25394=>1000,25395=>1000,25396=>1000, - 25397=>1000,25398=>1000,25399=>1000,25400=>1000,25401=>1000,25402=>1000,25403=>1000,25404=>1000,25405=>1000,25406=>1000,25407=>1000,25408=>1000,25409=>1000,25410=>1000,25411=>1000,25412=>1000, - 25413=>1000,25414=>1000,25415=>1000,25416=>1000,25417=>1000,25418=>1000,25419=>1000,25420=>1000,25421=>1000,25422=>1000,25423=>1000,25424=>1000,25425=>1000,25426=>1000,25427=>1000,25428=>1000, - 25429=>1000,25430=>1000,25431=>1000,25432=>1000,25433=>1000,25434=>1000,25435=>1000,25436=>1000,25437=>1000,25438=>1000,25439=>1000,25440=>1000,25441=>1000,25442=>1000,25443=>1000,25444=>1000, - 25445=>1000,25446=>1000,25447=>1000,25448=>1000,25449=>1000,25450=>1000,25451=>1000,25452=>1000,25453=>1000,25454=>1000,25455=>1000,25456=>1000,25457=>1000,25458=>1000,25459=>1000,25460=>1000, - 25461=>1000,25462=>1000,25463=>1000,25464=>1000,25465=>1000,25466=>1000,25467=>1000,25468=>1000,25469=>1000,25470=>1000,25471=>1000,25472=>1000,25473=>1000,25474=>1000,25475=>1000,25476=>1000, - 25477=>1000,25478=>1000,25479=>1000,25480=>1000,25481=>1000,25482=>1000,25483=>1000,25484=>1000,25485=>1000,25486=>1000,25487=>1000,25488=>1000,25489=>1000,25490=>1000,25491=>1000,25492=>1000, - 25493=>1000,25494=>1000,25495=>1000,25496=>1000,25497=>1000,25498=>1000,25499=>1000,25500=>1000,25501=>1000,25502=>1000,25503=>1000,25504=>1000,25505=>1000,25506=>1000,25507=>1000,25508=>1000, - 25509=>1000,25510=>1000,25511=>1000,25512=>1000,25513=>1000,25514=>1000,25515=>1000,25516=>1000,25517=>1000,25518=>1000,25519=>1000,25520=>1000,25521=>1000,25522=>1000,25523=>1000,25524=>1000, - 25525=>1000,25526=>1000,25527=>1000,25528=>1000,25529=>1000,25530=>1000,25531=>1000,25532=>1000,25533=>1000,25534=>1000,25535=>1000,25536=>1000,25537=>1000,25538=>1000,25539=>1000,25540=>1000, - 25541=>1000,25542=>1000,25543=>1000,25544=>1000,25545=>1000,25546=>1000,25547=>1000,25548=>1000,25549=>1000,25550=>1000,25551=>1000,25552=>1000,25553=>1000,25554=>1000,25555=>1000,25556=>1000, - 25557=>1000,25558=>1000,25559=>1000,25560=>1000,25561=>1000,25562=>1000,25563=>1000,25564=>1000,25565=>1000,25566=>1000,25567=>1000,25568=>1000,25569=>1000,25570=>1000,25571=>1000,25572=>1000, - 25573=>1000,25574=>1000,25575=>1000,25576=>1000,25577=>1000,25578=>1000,25579=>1000,25580=>1000,25581=>1000,25582=>1000,25583=>1000,25584=>1000,25585=>1000,25586=>1000,25587=>1000,25588=>1000, - 25589=>1000,25590=>1000,25591=>1000,25592=>1000,25593=>1000,25594=>1000,25595=>1000,25596=>1000,25597=>1000,25598=>1000,25599=>1000,25600=>1000,25601=>1000,25602=>1000,25603=>1000,25604=>1000, - 25605=>1000,25606=>1000,25607=>1000,25608=>1000,25609=>1000,25610=>1000,25611=>1000,25612=>1000,25613=>1000,25614=>1000,25615=>1000,25616=>1000,25617=>1000,25618=>1000,25619=>1000,25620=>1000, - 25621=>1000,25622=>1000,25623=>1000,25624=>1000,25625=>1000,25626=>1000,25627=>1000,25628=>1000,25629=>1000,25630=>1000,25631=>1000,25632=>1000,25633=>1000,25634=>1000,25635=>1000,25636=>1000, - 25637=>1000,25638=>1000,25639=>1000,25640=>1000,25641=>1000,25642=>1000,25643=>1000,25644=>1000,25645=>1000,25646=>1000,25647=>1000,25648=>1000,25649=>1000,25650=>1000,25651=>1000,25652=>1000, - 25653=>1000,25654=>1000,25655=>1000,25656=>1000,25657=>1000,25658=>1000,25659=>1000,25660=>1000,25661=>1000,25662=>1000,25663=>1000,25664=>1000,25665=>1000,25666=>1000,25667=>1000,25668=>1000, - 25669=>1000,25670=>1000,25671=>1000,25672=>1000,25673=>1000,25674=>1000,25675=>1000,25676=>1000,25677=>1000,25678=>1000,25679=>1000,25680=>1000,25681=>1000,25682=>1000,25683=>1000,25684=>1000, - 25685=>1000,25686=>1000,25687=>1000,25688=>1000,25689=>1000,25690=>1000,25691=>1000,25692=>1000,25693=>1000,25694=>1000,25695=>1000,25696=>1000,25697=>1000,25698=>1000,25699=>1000,25700=>1000, - 25701=>1000,25702=>1000,25703=>1000,25704=>1000,25705=>1000,25706=>1000,25707=>1000,25708=>1000,25709=>1000,25710=>1000,25711=>1000,25712=>1000,25713=>1000,25714=>1000,25715=>1000,25716=>1000, - 25717=>1000,25718=>1000,25719=>1000,25720=>1000,25721=>1000,25722=>1000,25723=>1000,25724=>1000,25725=>1000,25726=>1000,25727=>1000,25728=>1000,25729=>1000,25730=>1000,25731=>1000,25732=>1000, - 25733=>1000,25734=>1000,25735=>1000,25736=>1000,25737=>1000,25738=>1000,25739=>1000,25740=>1000,25741=>1000,25742=>1000,25743=>1000,25744=>1000,25745=>1000,25746=>1000,25747=>1000,25748=>1000, - 25749=>1000,25750=>1000,25751=>1000,25752=>1000,25753=>1000,25754=>1000,25755=>1000,25756=>1000,25757=>1000,25758=>1000,25759=>1000,25760=>1000,25761=>1000,25762=>1000,25763=>1000,25764=>1000, - 25765=>1000,25766=>1000,25767=>1000,25768=>1000,25769=>1000,25770=>1000,25771=>1000,25772=>1000,25773=>1000,25774=>1000,25775=>1000,25776=>1000,25777=>1000,25778=>1000,25779=>1000,25780=>1000, - 25781=>1000,25782=>1000,25783=>1000,25784=>1000,25785=>1000,25786=>1000,25787=>1000,25788=>1000,25789=>1000,25790=>1000,25791=>1000,25792=>1000,25793=>1000,25794=>1000,25795=>1000,25796=>1000, - 25797=>1000,25798=>1000,25799=>1000,25800=>1000,25801=>1000,25802=>1000,25803=>1000,25804=>1000,25805=>1000,25806=>1000,25807=>1000,25808=>1000,25809=>1000,25810=>1000,25811=>1000,25812=>1000, - 25813=>1000,25814=>1000,25815=>1000,25816=>1000,25817=>1000,25818=>1000,25819=>1000,25820=>1000,25821=>1000,25822=>1000,25823=>1000,25824=>1000,25825=>1000,25826=>1000,25827=>1000,25828=>1000, - 25829=>1000,25830=>1000,25831=>1000,25832=>1000,25833=>1000,25834=>1000,25835=>1000,25836=>1000,25837=>1000,25838=>1000,25839=>1000,25840=>1000,25841=>1000,25842=>1000,25843=>1000,25844=>1000, - 25845=>1000,25846=>1000,25847=>1000,25848=>1000,25849=>1000,25850=>1000,25851=>1000,25852=>1000,25853=>1000,25854=>1000,25855=>1000,25856=>1000,25857=>1000,25858=>1000,25859=>1000,25860=>1000, - 25861=>1000,25862=>1000,25863=>1000,25864=>1000,25865=>1000,25866=>1000,25867=>1000,25868=>1000,25869=>1000,25870=>1000,25871=>1000,25872=>1000,25873=>1000,25874=>1000,25875=>1000,25876=>1000, - 25877=>1000,25878=>1000,25879=>1000,25880=>1000,25881=>1000,25882=>1000,25883=>1000,25884=>1000,25885=>1000,25886=>1000,25887=>1000,25888=>1000,25889=>1000,25890=>1000,25891=>1000,25892=>1000, - 25893=>1000,25894=>1000,25895=>1000,25896=>1000,25897=>1000,25898=>1000,25899=>1000,25900=>1000,25901=>1000,25902=>1000,25903=>1000,25904=>1000,25905=>1000,25906=>1000,25907=>1000,25908=>1000, - 25909=>1000,25910=>1000,25911=>1000,25912=>1000,25913=>1000,25914=>1000,25915=>1000,25916=>1000,25917=>1000,25918=>1000,25919=>1000,25920=>1000,25921=>1000,25922=>1000,25923=>1000,25924=>1000, - 25925=>1000,25926=>1000,25927=>1000,25928=>1000,25929=>1000,25930=>1000,25931=>1000,25932=>1000,25933=>1000,25934=>1000,25935=>1000,25936=>1000,25937=>1000,25938=>1000,25939=>1000,25940=>1000, - 25941=>1000,25942=>1000,25943=>1000,25944=>1000,25945=>1000,25946=>1000,25947=>1000,25948=>1000,25949=>1000,25950=>1000,25951=>1000,25952=>1000,25953=>1000,25954=>1000,25955=>1000,25956=>1000, - 25957=>1000,25958=>1000,25959=>1000,25960=>1000,25961=>1000,25962=>1000,25963=>1000,25964=>1000,25965=>1000,25966=>1000,25967=>1000,25968=>1000,25969=>1000,25970=>1000,25971=>1000,25972=>1000, - 25973=>1000,25974=>1000,25975=>1000,25976=>1000,25977=>1000,25978=>1000,25979=>1000,25980=>1000,25981=>1000,25982=>1000,25983=>1000,25984=>1000,25985=>1000,25986=>1000,25987=>1000,25988=>1000, - 25989=>1000,25990=>1000,25991=>1000,25992=>1000,25993=>1000,25994=>1000,25995=>1000,25996=>1000,25997=>1000,25998=>1000,25999=>1000,26000=>1000,26001=>1000,26002=>1000,26003=>1000,26004=>1000, - 26005=>1000,26006=>1000,26007=>1000,26008=>1000,26009=>1000,26010=>1000,26011=>1000,26012=>1000,26013=>1000,26014=>1000,26015=>1000,26016=>1000,26017=>1000,26018=>1000,26019=>1000,26020=>1000, - 26021=>1000,26022=>1000,26023=>1000,26024=>1000,26025=>1000,26026=>1000,26027=>1000,26028=>1000,26029=>1000,26030=>1000,26031=>1000,26032=>1000,26033=>1000,26034=>1000,26035=>1000,26036=>1000, - 26037=>1000,26038=>1000,26039=>1000,26040=>1000,26041=>1000,26042=>1000,26043=>1000,26044=>1000,26045=>1000,26046=>1000,26047=>1000,26048=>1000,26049=>1000,26050=>1000,26051=>1000,26052=>1000, - 26053=>1000,26054=>1000,26055=>1000,26056=>1000,26057=>1000,26058=>1000,26059=>1000,26060=>1000,26061=>1000,26062=>1000,26063=>1000,26064=>1000,26065=>1000,26066=>1000,26067=>1000,26068=>1000, - 26069=>1000,26070=>1000,26071=>1000,26072=>1000,26073=>1000,26074=>1000,26075=>1000,26076=>1000,26077=>1000,26078=>1000,26079=>1000,26080=>1000,26081=>1000,26082=>1000,26083=>1000,26084=>1000, - 26085=>1000,26086=>1000,26087=>1000,26088=>1000,26089=>1000,26090=>1000,26091=>1000,26092=>1000,26093=>1000,26094=>1000,26095=>1000,26096=>1000,26097=>1000,26098=>1000,26099=>1000,26100=>1000, - 26101=>1000,26102=>1000,26103=>1000,26104=>1000,26105=>1000,26106=>1000,26107=>1000,26108=>1000,26109=>1000,26110=>1000,26111=>1000,26112=>1000,26113=>1000,26114=>1000,26115=>1000,26116=>1000, - 26117=>1000,26118=>1000,26119=>1000,26120=>1000,26121=>1000,26122=>1000,26123=>1000,26124=>1000,26125=>1000,26126=>1000,26127=>1000,26128=>1000,26129=>1000,26130=>1000,26131=>1000,26132=>1000, - 26133=>1000,26134=>1000,26135=>1000,26136=>1000,26137=>1000,26138=>1000,26139=>1000,26140=>1000,26141=>1000,26142=>1000,26143=>1000,26144=>1000,26145=>1000,26146=>1000,26147=>1000,26148=>1000, - 26149=>1000,26150=>1000,26151=>1000,26152=>1000,26153=>1000,26154=>1000,26155=>1000,26156=>1000,26157=>1000,26158=>1000,26159=>1000,26160=>1000,26161=>1000,26162=>1000,26163=>1000,26164=>1000, - 26165=>1000,26166=>1000,26167=>1000,26168=>1000,26169=>1000,26170=>1000,26171=>1000,26172=>1000,26173=>1000,26174=>1000,26175=>1000,26176=>1000,26177=>1000,26178=>1000,26179=>1000,26180=>1000, - 26181=>1000,26182=>1000,26183=>1000,26184=>1000,26185=>1000,26186=>1000,26187=>1000,26188=>1000,26189=>1000,26190=>1000,26191=>1000,26192=>1000,26193=>1000,26194=>1000,26195=>1000,26196=>1000, - 26197=>1000,26198=>1000,26199=>1000,26200=>1000,26201=>1000,26202=>1000,26203=>1000,26204=>1000,26205=>1000,26206=>1000,26207=>1000,26208=>1000,26209=>1000,26210=>1000,26211=>1000,26212=>1000, - 26213=>1000,26214=>1000,26215=>1000,26216=>1000,26217=>1000,26218=>1000,26219=>1000,26220=>1000,26221=>1000,26222=>1000,26223=>1000,26224=>1000,26225=>1000,26226=>1000,26227=>1000,26228=>1000, - 26229=>1000,26230=>1000,26231=>1000,26232=>1000,26233=>1000,26234=>1000,26235=>1000,26236=>1000,26237=>1000,26238=>1000,26239=>1000,26240=>1000,26241=>1000,26242=>1000,26243=>1000,26244=>1000, - 26245=>1000,26246=>1000,26247=>1000,26248=>1000,26249=>1000,26250=>1000,26251=>1000,26252=>1000,26253=>1000,26254=>1000,26255=>1000,26256=>1000,26257=>1000,26258=>1000,26259=>1000,26260=>1000, - 26261=>1000,26262=>1000,26263=>1000,26264=>1000,26265=>1000,26266=>1000,26267=>1000,26268=>1000,26269=>1000,26270=>1000,26271=>1000,26272=>1000,26273=>1000,26274=>1000,26275=>1000,26276=>1000, - 26277=>1000,26278=>1000,26279=>1000,26280=>1000,26281=>1000,26282=>1000,26283=>1000,26284=>1000,26285=>1000,26286=>1000,26287=>1000,26288=>1000,26289=>1000,26290=>1000,26291=>1000,26292=>1000, - 26293=>1000,26294=>1000,26295=>1000,26296=>1000,26297=>1000,26298=>1000,26299=>1000,26300=>1000,26301=>1000,26302=>1000,26303=>1000,26304=>1000,26305=>1000,26306=>1000,26307=>1000,26308=>1000, - 26309=>1000,26310=>1000,26311=>1000,26312=>1000,26313=>1000,26314=>1000,26315=>1000,26316=>1000,26317=>1000,26318=>1000,26319=>1000,26320=>1000,26321=>1000,26322=>1000,26323=>1000,26324=>1000, - 26325=>1000,26326=>1000,26327=>1000,26328=>1000,26329=>1000,26330=>1000,26331=>1000,26332=>1000,26333=>1000,26334=>1000,26335=>1000,26336=>1000,26337=>1000,26338=>1000,26339=>1000,26340=>1000, - 26341=>1000,26342=>1000,26343=>1000,26344=>1000,26345=>1000,26346=>1000,26347=>1000,26348=>1000,26349=>1000,26350=>1000,26351=>1000,26352=>1000,26353=>1000,26354=>1000,26355=>1000,26356=>1000, - 26357=>1000,26358=>1000,26359=>1000,26360=>1000,26361=>1000,26362=>1000,26363=>1000,26364=>1000,26365=>1000,26366=>1000,26367=>1000,26368=>1000,26369=>1000,26370=>1000,26371=>1000,26372=>1000, - 26373=>1000,26374=>1000,26375=>1000,26376=>1000,26377=>1000,26378=>1000,26379=>1000,26380=>1000,26381=>1000,26382=>1000,26383=>1000,26384=>1000,26385=>1000,26386=>1000,26387=>1000,26388=>1000, - 26389=>1000,26390=>1000,26391=>1000,26392=>1000,26393=>1000,26394=>1000,26395=>1000,26396=>1000,26397=>1000,26398=>1000,26399=>1000,26400=>1000,26401=>1000,26402=>1000,26403=>1000,26404=>1000, - 26405=>1000,26406=>1000,26407=>1000,26408=>1000,26409=>1000,26410=>1000,26411=>1000,26412=>1000,26413=>1000,26414=>1000,26415=>1000,26416=>1000,26417=>1000,26418=>1000,26419=>1000,26420=>1000, - 26421=>1000,26422=>1000,26423=>1000,26424=>1000,26425=>1000,26426=>1000,26427=>1000,26428=>1000,26429=>1000,26430=>1000,26431=>1000,26432=>1000,26433=>1000,26434=>1000,26435=>1000,26436=>1000, - 26437=>1000,26438=>1000,26439=>1000,26440=>1000,26441=>1000,26442=>1000,26443=>1000,26444=>1000,26445=>1000,26446=>1000,26447=>1000,26448=>1000,26449=>1000,26450=>1000,26451=>1000,26452=>1000, - 26453=>1000,26454=>1000,26455=>1000,26456=>1000,26457=>1000,26458=>1000,26459=>1000,26460=>1000,26461=>1000,26462=>1000,26463=>1000,26464=>1000,26465=>1000,26466=>1000,26467=>1000,26468=>1000, - 26469=>1000,26470=>1000,26471=>1000,26472=>1000,26473=>1000,26474=>1000,26475=>1000,26476=>1000,26477=>1000,26478=>1000,26479=>1000,26480=>1000,26481=>1000,26482=>1000,26483=>1000,26484=>1000, - 26485=>1000,26486=>1000,26487=>1000,26488=>1000,26489=>1000,26490=>1000,26491=>1000,26492=>1000,26493=>1000,26494=>1000,26495=>1000,26496=>1000,26497=>1000,26498=>1000,26499=>1000,26500=>1000, - 26501=>1000,26502=>1000,26503=>1000,26504=>1000,26505=>1000,26506=>1000,26507=>1000,26508=>1000,26509=>1000,26510=>1000,26511=>1000,26512=>1000,26513=>1000,26514=>1000,26515=>1000,26516=>1000, - 26517=>1000,26518=>1000,26519=>1000,26520=>1000,26521=>1000,26522=>1000,26523=>1000,26524=>1000,26525=>1000,26526=>1000,26527=>1000,26528=>1000,26529=>1000,26530=>1000,26531=>1000,26532=>1000, - 26533=>1000,26534=>1000,26535=>1000,26536=>1000,26537=>1000,26538=>1000,26539=>1000,26540=>1000,26541=>1000,26542=>1000,26543=>1000,26544=>1000,26545=>1000,26546=>1000,26547=>1000,26548=>1000, - 26549=>1000,26550=>1000,26551=>1000,26552=>1000,26553=>1000,26554=>1000,26555=>1000,26556=>1000,26557=>1000,26558=>1000,26559=>1000,26560=>1000,26561=>1000,26562=>1000,26563=>1000,26564=>1000, - 26565=>1000,26566=>1000,26567=>1000,26568=>1000,26569=>1000,26570=>1000,26571=>1000,26572=>1000,26573=>1000,26574=>1000,26575=>1000,26576=>1000,26577=>1000,26578=>1000,26579=>1000,26580=>1000, - 26581=>1000,26582=>1000,26583=>1000,26584=>1000,26585=>1000,26586=>1000,26587=>1000,26588=>1000,26589=>1000,26590=>1000,26591=>1000,26592=>1000,26593=>1000,26594=>1000,26595=>1000,26596=>1000, - 26597=>1000,26598=>1000,26599=>1000,26600=>1000,26601=>1000,26602=>1000,26603=>1000,26604=>1000,26605=>1000,26606=>1000,26607=>1000,26608=>1000,26609=>1000,26610=>1000,26611=>1000,26612=>1000, - 26613=>1000,26614=>1000,26615=>1000,26616=>1000,26617=>1000,26618=>1000,26619=>1000,26620=>1000,26621=>1000,26622=>1000,26623=>1000,26624=>1000,26625=>1000,26626=>1000,26627=>1000,26628=>1000, - 26629=>1000,26630=>1000,26631=>1000,26632=>1000,26633=>1000,26634=>1000,26635=>1000,26636=>1000,26637=>1000,26638=>1000,26639=>1000,26640=>1000,26641=>1000,26642=>1000,26643=>1000,26644=>1000, - 26645=>1000,26646=>1000,26647=>1000,26648=>1000,26649=>1000,26650=>1000,26651=>1000,26652=>1000,26653=>1000,26654=>1000,26655=>1000,26656=>1000,26657=>1000,26658=>1000,26659=>1000,26660=>1000, - 26661=>1000,26662=>1000,26663=>1000,26664=>1000,26665=>1000,26666=>1000,26667=>1000,26668=>1000,26669=>1000,26670=>1000,26671=>1000,26672=>1000,26673=>1000,26674=>1000,26675=>1000,26676=>1000, - 26677=>1000,26678=>1000,26679=>1000,26680=>1000,26681=>1000,26682=>1000,26683=>1000,26684=>1000,26685=>1000,26686=>1000,26687=>1000,26688=>1000,26689=>1000,26690=>1000,26691=>1000,26692=>1000, - 26693=>1000,26694=>1000,26695=>1000,26696=>1000,26697=>1000,26698=>1000,26699=>1000,26700=>1000,26701=>1000,26702=>1000,26703=>1000,26704=>1000,26705=>1000,26706=>1000,26707=>1000,26708=>1000, - 26709=>1000,26710=>1000,26711=>1000,26712=>1000,26713=>1000,26714=>1000,26715=>1000,26716=>1000,26717=>1000,26718=>1000,26719=>1000,26720=>1000,26721=>1000,26722=>1000,26723=>1000,26724=>1000, - 26725=>1000,26726=>1000,26727=>1000,26728=>1000,26729=>1000,26730=>1000,26731=>1000,26732=>1000,26733=>1000,26734=>1000,26735=>1000,26736=>1000,26737=>1000,26738=>1000,26739=>1000,26740=>1000, - 26741=>1000,26742=>1000,26743=>1000,26744=>1000,26745=>1000,26746=>1000,26747=>1000,26748=>1000,26749=>1000,26750=>1000,26751=>1000,26752=>1000,26753=>1000,26754=>1000,26755=>1000,26756=>1000, - 26757=>1000,26758=>1000,26759=>1000,26760=>1000,26761=>1000,26762=>1000,26763=>1000,26764=>1000,26765=>1000,26766=>1000,26767=>1000,26768=>1000,26769=>1000,26770=>1000,26771=>1000,26772=>1000, - 26773=>1000,26774=>1000,26775=>1000,26776=>1000,26777=>1000,26778=>1000,26779=>1000,26780=>1000,26781=>1000,26782=>1000,26783=>1000,26784=>1000,26785=>1000,26786=>1000,26787=>1000,26788=>1000, - 26789=>1000,26790=>1000,26791=>1000,26792=>1000,26793=>1000,26794=>1000,26795=>1000,26796=>1000,26797=>1000,26798=>1000,26799=>1000,26800=>1000,26801=>1000,26802=>1000,26803=>1000,26804=>1000, - 26805=>1000,26806=>1000,26807=>1000,26808=>1000,26809=>1000,26810=>1000,26811=>1000,26812=>1000,26813=>1000,26814=>1000,26815=>1000,26816=>1000,26817=>1000,26818=>1000,26819=>1000,26820=>1000, - 26821=>1000,26822=>1000,26823=>1000,26824=>1000,26825=>1000,26826=>1000,26827=>1000,26828=>1000,26829=>1000,26830=>1000,26831=>1000,26832=>1000,26833=>1000,26834=>1000,26835=>1000,26836=>1000, - 26837=>1000,26838=>1000,26839=>1000,26840=>1000,26841=>1000,26842=>1000,26843=>1000,26844=>1000,26845=>1000,26846=>1000,26847=>1000,26848=>1000,26849=>1000,26850=>1000,26851=>1000,26852=>1000, - 26853=>1000,26854=>1000,26855=>1000,26856=>1000,26857=>1000,26858=>1000,26859=>1000,26860=>1000,26861=>1000,26862=>1000,26863=>1000,26864=>1000,26865=>1000,26866=>1000,26867=>1000,26868=>1000, - 26869=>1000,26870=>1000,26871=>1000,26872=>1000,26873=>1000,26874=>1000,26875=>1000,26876=>1000,26877=>1000,26878=>1000,26879=>1000,26880=>1000,26881=>1000,26882=>1000,26883=>1000,26884=>1000, - 26885=>1000,26886=>1000,26887=>1000,26888=>1000,26889=>1000,26890=>1000,26891=>1000,26892=>1000,26893=>1000,26894=>1000,26895=>1000,26896=>1000,26897=>1000,26898=>1000,26899=>1000,26900=>1000, - 26901=>1000,26902=>1000,26903=>1000,26904=>1000,26905=>1000,26906=>1000,26907=>1000,26908=>1000,26909=>1000,26910=>1000,26911=>1000,26912=>1000,26913=>1000,26914=>1000,26915=>1000,26916=>1000, - 26917=>1000,26918=>1000,26919=>1000,26920=>1000,26921=>1000,26922=>1000,26923=>1000,26924=>1000,26925=>1000,26926=>1000,26927=>1000,26928=>1000,26929=>1000,26930=>1000,26931=>1000,26932=>1000, - 26933=>1000,26934=>1000,26935=>1000,26936=>1000,26937=>1000,26938=>1000,26939=>1000,26940=>1000,26941=>1000,26942=>1000,26943=>1000,26944=>1000,26945=>1000,26946=>1000,26947=>1000,26948=>1000, - 26949=>1000,26950=>1000,26951=>1000,26952=>1000,26953=>1000,26954=>1000,26955=>1000,26956=>1000,26957=>1000,26958=>1000,26959=>1000,26960=>1000,26961=>1000,26962=>1000,26963=>1000,26964=>1000, - 26965=>1000,26966=>1000,26967=>1000,26968=>1000,26969=>1000,26970=>1000,26971=>1000,26972=>1000,26973=>1000,26974=>1000,26975=>1000,26976=>1000,26977=>1000,26978=>1000,26979=>1000,26980=>1000, - 26981=>1000,26982=>1000,26983=>1000,26984=>1000,26985=>1000,26986=>1000,26987=>1000,26988=>1000,26989=>1000,26990=>1000,26991=>1000,26992=>1000,26993=>1000,26994=>1000,26995=>1000,26996=>1000, - 26997=>1000,26998=>1000,26999=>1000,27000=>1000,27001=>1000,27002=>1000,27003=>1000,27004=>1000,27005=>1000,27006=>1000,27007=>1000,27008=>1000,27009=>1000,27010=>1000,27011=>1000,27012=>1000, - 27013=>1000,27014=>1000,27015=>1000,27016=>1000,27017=>1000,27018=>1000,27019=>1000,27020=>1000,27021=>1000,27022=>1000,27023=>1000,27024=>1000,27025=>1000,27026=>1000,27027=>1000,27028=>1000, - 27029=>1000,27030=>1000,27031=>1000,27032=>1000,27033=>1000,27034=>1000,27035=>1000,27036=>1000,27037=>1000,27038=>1000,27039=>1000,27040=>1000,27041=>1000,27042=>1000,27043=>1000,27044=>1000, - 27045=>1000,27046=>1000,27047=>1000,27048=>1000,27049=>1000,27050=>1000,27051=>1000,27052=>1000,27053=>1000,27054=>1000,27055=>1000,27056=>1000,27057=>1000,27058=>1000,27059=>1000,27060=>1000, - 27061=>1000,27062=>1000,27063=>1000,27064=>1000,27065=>1000,27066=>1000,27067=>1000,27068=>1000,27069=>1000,27070=>1000,27071=>1000,27072=>1000,27073=>1000,27074=>1000,27075=>1000,27076=>1000, - 27077=>1000,27078=>1000,27079=>1000,27080=>1000,27081=>1000,27082=>1000,27083=>1000,27084=>1000,27085=>1000,27086=>1000,27087=>1000,27088=>1000,27089=>1000,27090=>1000,27091=>1000,27092=>1000, - 27093=>1000,27094=>1000,27095=>1000,27096=>1000,27097=>1000,27098=>1000,27099=>1000,27100=>1000,27101=>1000,27102=>1000,27103=>1000,27104=>1000,27105=>1000,27106=>1000,27107=>1000,27108=>1000, - 27109=>1000,27110=>1000,27111=>1000,27112=>1000,27113=>1000,27114=>1000,27115=>1000,27116=>1000,27117=>1000,27118=>1000,27119=>1000,27120=>1000,27121=>1000,27122=>1000,27123=>1000,27124=>1000, - 27125=>1000,27126=>1000,27127=>1000,27128=>1000,27129=>1000,27130=>1000,27131=>1000,27132=>1000,27133=>1000,27134=>1000,27135=>1000,27136=>1000,27137=>1000,27138=>1000,27139=>1000,27140=>1000, - 27141=>1000,27142=>1000,27143=>1000,27144=>1000,27145=>1000,27146=>1000,27147=>1000,27148=>1000,27149=>1000,27150=>1000,27151=>1000,27152=>1000,27153=>1000,27154=>1000,27155=>1000,27156=>1000, - 27157=>1000,27158=>1000,27159=>1000,27160=>1000,27161=>1000,27162=>1000,27163=>1000,27164=>1000,27165=>1000,27166=>1000,27167=>1000,27168=>1000,27169=>1000,27170=>1000,27171=>1000,27172=>1000, - 27173=>1000,27174=>1000,27175=>1000,27176=>1000,27177=>1000,27178=>1000,27179=>1000,27180=>1000,27181=>1000,27182=>1000,27183=>1000,27184=>1000,27185=>1000,27186=>1000,27187=>1000,27188=>1000, - 27189=>1000,27190=>1000,27191=>1000,27192=>1000,27193=>1000,27194=>1000,27195=>1000,27196=>1000,27197=>1000,27198=>1000,27199=>1000,27200=>1000,27201=>1000,27202=>1000,27203=>1000,27204=>1000, - 27205=>1000,27206=>1000,27207=>1000,27208=>1000,27209=>1000,27210=>1000,27211=>1000,27212=>1000,27213=>1000,27214=>1000,27215=>1000,27216=>1000,27217=>1000,27218=>1000,27219=>1000,27220=>1000, - 27221=>1000,27222=>1000,27223=>1000,27224=>1000,27225=>1000,27226=>1000,27227=>1000,27228=>1000,27229=>1000,27230=>1000,27231=>1000,27232=>1000,27233=>1000,27234=>1000,27235=>1000,27236=>1000, - 27237=>1000,27238=>1000,27239=>1000,27240=>1000,27241=>1000,27242=>1000,27243=>1000,27244=>1000,27245=>1000,27246=>1000,27247=>1000,27248=>1000,27249=>1000,27250=>1000,27251=>1000,27252=>1000, - 27253=>1000,27254=>1000,27255=>1000,27256=>1000,27257=>1000,27258=>1000,27259=>1000,27260=>1000,27261=>1000,27262=>1000,27263=>1000,27264=>1000,27265=>1000,27266=>1000,27267=>1000,27268=>1000, - 27269=>1000,27270=>1000,27271=>1000,27272=>1000,27273=>1000,27274=>1000,27275=>1000,27276=>1000,27277=>1000,27278=>1000,27279=>1000,27280=>1000,27281=>1000,27282=>1000,27283=>1000,27284=>1000, - 27285=>1000,27286=>1000,27287=>1000,27288=>1000,27289=>1000,27290=>1000,27291=>1000,27292=>1000,27293=>1000,27294=>1000,27295=>1000,27296=>1000,27297=>1000,27298=>1000,27299=>1000,27300=>1000, - 27301=>1000,27302=>1000,27303=>1000,27304=>1000,27305=>1000,27306=>1000,27307=>1000,27308=>1000,27309=>1000,27310=>1000,27311=>1000,27312=>1000,27313=>1000,27314=>1000,27315=>1000,27316=>1000, - 27317=>1000,27318=>1000,27319=>1000,27320=>1000,27321=>1000,27322=>1000,27323=>1000,27324=>1000,27325=>1000,27326=>1000,27327=>1000,27328=>1000,27329=>1000,27330=>1000,27331=>1000,27332=>1000, - 27333=>1000,27334=>1000,27335=>1000,27336=>1000,27337=>1000,27338=>1000,27339=>1000,27340=>1000,27341=>1000,27342=>1000,27343=>1000,27344=>1000,27345=>1000,27346=>1000,27347=>1000,27348=>1000, - 27349=>1000,27350=>1000,27351=>1000,27352=>1000,27353=>1000,27354=>1000,27355=>1000,27356=>1000,27357=>1000,27358=>1000,27359=>1000,27360=>1000,27361=>1000,27362=>1000,27363=>1000,27364=>1000, - 27365=>1000,27366=>1000,27367=>1000,27368=>1000,27369=>1000,27370=>1000,27371=>1000,27372=>1000,27373=>1000,27374=>1000,27375=>1000,27376=>1000,27377=>1000,27378=>1000,27379=>1000,27380=>1000, - 27381=>1000,27382=>1000,27383=>1000,27384=>1000,27385=>1000,27386=>1000,27387=>1000,27388=>1000,27389=>1000,27390=>1000,27391=>1000,27392=>1000,27393=>1000,27394=>1000,27395=>1000,27396=>1000, - 27397=>1000,27398=>1000,27399=>1000,27400=>1000,27401=>1000,27402=>1000,27403=>1000,27404=>1000,27405=>1000,27406=>1000,27407=>1000,27408=>1000,27409=>1000,27410=>1000,27411=>1000,27412=>1000, - 27413=>1000,27414=>1000,27415=>1000,27416=>1000,27417=>1000,27418=>1000,27419=>1000,27420=>1000,27421=>1000,27422=>1000,27423=>1000,27424=>1000,27425=>1000,27426=>1000,27427=>1000,27428=>1000, - 27429=>1000,27430=>1000,27431=>1000,27432=>1000,27433=>1000,27434=>1000,27435=>1000,27436=>1000,27437=>1000,27438=>1000,27439=>1000,27440=>1000,27441=>1000,27442=>1000,27443=>1000,27444=>1000, - 27445=>1000,27446=>1000,27447=>1000,27448=>1000,27449=>1000,27450=>1000,27451=>1000,27452=>1000,27453=>1000,27454=>1000,27455=>1000,27456=>1000,27457=>1000,27458=>1000,27459=>1000,27460=>1000, - 27461=>1000,27462=>1000,27463=>1000,27464=>1000,27465=>1000,27466=>1000,27467=>1000,27468=>1000,27469=>1000,27470=>1000,27471=>1000,27472=>1000,27473=>1000,27474=>1000,27475=>1000,27476=>1000, - 27477=>1000,27478=>1000,27479=>1000,27480=>1000,27481=>1000,27482=>1000,27483=>1000,27484=>1000,27485=>1000,27486=>1000,27487=>1000,27488=>1000,27489=>1000,27490=>1000,27491=>1000,27492=>1000, - 27493=>1000,27494=>1000,27495=>1000,27496=>1000,27497=>1000,27498=>1000,27499=>1000,27500=>1000,27501=>1000,27502=>1000,27503=>1000,27504=>1000,27505=>1000,27506=>1000,27507=>1000,27508=>1000, - 27509=>1000,27510=>1000,27511=>1000,27512=>1000,27513=>1000,27514=>1000,27515=>1000,27516=>1000,27517=>1000,27518=>1000,27519=>1000,27520=>1000,27521=>1000,27522=>1000,27523=>1000,27524=>1000, - 27525=>1000,27526=>1000,27527=>1000,27528=>1000,27529=>1000,27530=>1000,27531=>1000,27532=>1000,27533=>1000,27534=>1000,27535=>1000,27536=>1000,27537=>1000,27538=>1000,27539=>1000,27540=>1000, - 27541=>1000,27542=>1000,27543=>1000,27544=>1000,27545=>1000,27546=>1000,27547=>1000,27548=>1000,27549=>1000,27550=>1000,27551=>1000,27552=>1000,27553=>1000,27554=>1000,27555=>1000,27556=>1000, - 27557=>1000,27558=>1000,27559=>1000,27560=>1000,27561=>1000,27562=>1000,27563=>1000,27564=>1000,27565=>1000,27566=>1000,27567=>1000,27568=>1000,27569=>1000,27570=>1000,27571=>1000,27572=>1000, - 27573=>1000,27574=>1000,27575=>1000,27576=>1000,27577=>1000,27578=>1000,27579=>1000,27580=>1000,27581=>1000,27582=>1000,27583=>1000,27584=>1000,27585=>1000,27586=>1000,27587=>1000,27588=>1000, - 27589=>1000,27590=>1000,27591=>1000,27592=>1000,27593=>1000,27594=>1000,27595=>1000,27596=>1000,27597=>1000,27598=>1000,27599=>1000,27600=>1000,27601=>1000,27602=>1000,27603=>1000,27604=>1000, - 27605=>1000,27606=>1000,27607=>1000,27608=>1000,27609=>1000,27610=>1000,27611=>1000,27612=>1000,27613=>1000,27614=>1000,27615=>1000,27616=>1000,27617=>1000,27618=>1000,27619=>1000,27620=>1000, - 27621=>1000,27622=>1000,27623=>1000,27624=>1000,27625=>1000,27626=>1000,27627=>1000,27628=>1000,27629=>1000,27630=>1000,27631=>1000,27632=>1000,27633=>1000,27634=>1000,27635=>1000,27636=>1000, - 27637=>1000,27638=>1000,27639=>1000,27640=>1000,27641=>1000,27642=>1000,27643=>1000,27644=>1000,27645=>1000,27646=>1000,27647=>1000,27648=>1000,27649=>1000,27650=>1000,27651=>1000,27652=>1000, - 27653=>1000,27654=>1000,27655=>1000,27656=>1000,27657=>1000,27658=>1000,27659=>1000,27660=>1000,27661=>1000,27662=>1000,27663=>1000,27664=>1000,27665=>1000,27666=>1000,27667=>1000,27668=>1000, - 27669=>1000,27670=>1000,27671=>1000,27672=>1000,27673=>1000,27674=>1000,27675=>1000,27676=>1000,27677=>1000,27678=>1000,27679=>1000,27680=>1000,27681=>1000,27682=>1000,27683=>1000,27684=>1000, - 27685=>1000,27686=>1000,27687=>1000,27688=>1000,27689=>1000,27690=>1000,27691=>1000,27692=>1000,27693=>1000,27694=>1000,27695=>1000,27696=>1000,27697=>1000,27698=>1000,27699=>1000,27700=>1000, - 27701=>1000,27702=>1000,27703=>1000,27704=>1000,27705=>1000,27706=>1000,27707=>1000,27708=>1000,27709=>1000,27710=>1000,27711=>1000,27712=>1000,27713=>1000,27714=>1000,27715=>1000,27716=>1000, - 27717=>1000,27718=>1000,27719=>1000,27720=>1000,27721=>1000,27722=>1000,27723=>1000,27724=>1000,27725=>1000,27726=>1000,27727=>1000,27728=>1000,27729=>1000,27730=>1000,27731=>1000,27732=>1000, - 27733=>1000,27734=>1000,27735=>1000,27736=>1000,27737=>1000,27738=>1000,27739=>1000,27740=>1000,27741=>1000,27742=>1000,27743=>1000,27744=>1000,27745=>1000,27746=>1000,27747=>1000,27748=>1000, - 27749=>1000,27750=>1000,27751=>1000,27752=>1000,27753=>1000,27754=>1000,27755=>1000,27756=>1000,27757=>1000,27758=>1000,27759=>1000,27760=>1000,27761=>1000,27762=>1000,27763=>1000,27764=>1000, - 27765=>1000,27766=>1000,27767=>1000,27768=>1000,27769=>1000,27770=>1000,27771=>1000,27772=>1000,27773=>1000,27774=>1000,27775=>1000,27776=>1000,27777=>1000,27778=>1000,27779=>1000,27780=>1000, - 27781=>1000,27782=>1000,27783=>1000,27784=>1000,27785=>1000,27786=>1000,27787=>1000,27788=>1000,27789=>1000,27790=>1000,27791=>1000,27792=>1000,27793=>1000,27794=>1000,27795=>1000,27796=>1000, - 27797=>1000,27798=>1000,27799=>1000,27800=>1000,27801=>1000,27802=>1000,27803=>1000,27804=>1000,27805=>1000,27806=>1000,27807=>1000,27808=>1000,27809=>1000,27810=>1000,27811=>1000,27812=>1000, - 27813=>1000,27814=>1000,27815=>1000,27816=>1000,27817=>1000,27818=>1000,27819=>1000,27820=>1000,27821=>1000,27822=>1000,27823=>1000,27824=>1000,27825=>1000,27826=>1000,27827=>1000,27828=>1000, - 27829=>1000,27830=>1000,27831=>1000,27832=>1000,27833=>1000,27834=>1000,27835=>1000,27836=>1000,27837=>1000,27838=>1000,27839=>1000,27840=>1000,27841=>1000,27842=>1000,27843=>1000,27844=>1000, - 27845=>1000,27846=>1000,27847=>1000,27848=>1000,27849=>1000,27850=>1000,27851=>1000,27852=>1000,27853=>1000,27854=>1000,27855=>1000,27856=>1000,27857=>1000,27858=>1000,27859=>1000,27860=>1000, - 27861=>1000,27862=>1000,27863=>1000,27864=>1000,27865=>1000,27866=>1000,27867=>1000,27868=>1000,27869=>1000,27870=>1000,27871=>1000,27872=>1000,27873=>1000,27874=>1000,27875=>1000,27876=>1000, - 27877=>1000,27878=>1000,27879=>1000,27880=>1000,27881=>1000,27882=>1000,27883=>1000,27884=>1000,27885=>1000,27886=>1000,27887=>1000,27888=>1000,27889=>1000,27890=>1000,27891=>1000,27892=>1000, - 27893=>1000,27894=>1000,27895=>1000,27896=>1000,27897=>1000,27898=>1000,27899=>1000,27900=>1000,27901=>1000,27902=>1000,27903=>1000,27904=>1000,27905=>1000,27906=>1000,27907=>1000,27908=>1000, - 27909=>1000,27910=>1000,27911=>1000,27912=>1000,27913=>1000,27914=>1000,27915=>1000,27916=>1000,27917=>1000,27918=>1000,27919=>1000,27920=>1000,27921=>1000,27922=>1000,27923=>1000,27924=>1000, - 27925=>1000,27926=>1000,27927=>1000,27928=>1000,27929=>1000,27930=>1000,27931=>1000,27932=>1000,27933=>1000,27934=>1000,27935=>1000,27936=>1000,27937=>1000,27938=>1000,27939=>1000,27940=>1000, - 27941=>1000,27942=>1000,27943=>1000,27944=>1000,27945=>1000,27946=>1000,27947=>1000,27948=>1000,27949=>1000,27950=>1000,27951=>1000,27952=>1000,27953=>1000,27954=>1000,27955=>1000,27956=>1000, - 27957=>1000,27958=>1000,27959=>1000,27960=>1000,27961=>1000,27962=>1000,27963=>1000,27964=>1000,27965=>1000,27966=>1000,27967=>1000,27968=>1000,27969=>1000,27970=>1000,27971=>1000,27972=>1000, - 27973=>1000,27974=>1000,27975=>1000,27976=>1000,27977=>1000,27978=>1000,27979=>1000,27980=>1000,27981=>1000,27982=>1000,27983=>1000,27984=>1000,27985=>1000,27986=>1000,27987=>1000,27988=>1000, - 27989=>1000,27990=>1000,27991=>1000,27992=>1000,27993=>1000,27994=>1000,27995=>1000,27996=>1000,27997=>1000,27998=>1000,27999=>1000,28000=>1000,28001=>1000,28002=>1000,28003=>1000,28004=>1000, - 28005=>1000,28006=>1000,28007=>1000,28008=>1000,28009=>1000,28010=>1000,28011=>1000,28012=>1000,28013=>1000,28014=>1000,28015=>1000,28016=>1000,28017=>1000,28018=>1000,28019=>1000,28020=>1000, - 28021=>1000,28022=>1000,28023=>1000,28024=>1000,28025=>1000,28026=>1000,28027=>1000,28028=>1000,28029=>1000,28030=>1000,28031=>1000,28032=>1000,28033=>1000,28034=>1000,28035=>1000,28036=>1000, - 28037=>1000,28038=>1000,28039=>1000,28040=>1000,28041=>1000,28042=>1000,28043=>1000,28044=>1000,28045=>1000,28046=>1000,28047=>1000,28048=>1000,28049=>1000,28050=>1000,28051=>1000,28052=>1000, - 28053=>1000,28054=>1000,28055=>1000,28056=>1000,28057=>1000,28058=>1000,28059=>1000,28060=>1000,28061=>1000,28062=>1000,28063=>1000,28064=>1000,28065=>1000,28066=>1000,28067=>1000,28068=>1000, - 28069=>1000,28070=>1000,28071=>1000,28072=>1000,28073=>1000,28074=>1000,28075=>1000,28076=>1000,28077=>1000,28078=>1000,28079=>1000,28080=>1000,28081=>1000,28082=>1000,28083=>1000,28084=>1000, - 28085=>1000,28086=>1000,28087=>1000,28088=>1000,28089=>1000,28090=>1000,28091=>1000,28092=>1000,28093=>1000,28094=>1000,28095=>1000,28096=>1000,28097=>1000,28098=>1000,28099=>1000,28100=>1000, - 28101=>1000,28102=>1000,28103=>1000,28104=>1000,28105=>1000,28106=>1000,28107=>1000,28108=>1000,28109=>1000,28110=>1000,28111=>1000,28112=>1000,28113=>1000,28114=>1000,28115=>1000,28116=>1000, - 28117=>1000,28118=>1000,28119=>1000,28120=>1000,28121=>1000,28122=>1000,28123=>1000,28124=>1000,28125=>1000,28126=>1000,28127=>1000,28128=>1000,28129=>1000,28130=>1000,28131=>1000,28132=>1000, - 28133=>1000,28134=>1000,28135=>1000,28136=>1000,28137=>1000,28138=>1000,28139=>1000,28140=>1000,28141=>1000,28142=>1000,28143=>1000,28144=>1000,28145=>1000,28146=>1000,28147=>1000,28148=>1000, - 28149=>1000,28150=>1000,28151=>1000,28152=>1000,28153=>1000,28154=>1000,28155=>1000,28156=>1000,28157=>1000,28158=>1000,28159=>1000,28160=>1000,28161=>1000,28162=>1000,28163=>1000,28164=>1000, - 28165=>1000,28166=>1000,28167=>1000,28168=>1000,28169=>1000,28170=>1000,28171=>1000,28172=>1000,28173=>1000,28174=>1000,28175=>1000,28176=>1000,28177=>1000,28178=>1000,28179=>1000,28180=>1000, - 28181=>1000,28182=>1000,28183=>1000,28184=>1000,28185=>1000,28186=>1000,28187=>1000,28188=>1000,28189=>1000,28190=>1000,28191=>1000,28192=>1000,28193=>1000,28194=>1000,28195=>1000,28196=>1000, - 28197=>1000,28198=>1000,28199=>1000,28200=>1000,28201=>1000,28202=>1000,28203=>1000,28204=>1000,28205=>1000,28206=>1000,28207=>1000,28208=>1000,28209=>1000,28210=>1000,28211=>1000,28212=>1000, - 28213=>1000,28214=>1000,28215=>1000,28216=>1000,28217=>1000,28218=>1000,28219=>1000,28220=>1000,28221=>1000,28222=>1000,28223=>1000,28224=>1000,28225=>1000,28226=>1000,28227=>1000,28228=>1000, - 28229=>1000,28230=>1000,28231=>1000,28232=>1000,28233=>1000,28234=>1000,28235=>1000,28236=>1000,28237=>1000,28238=>1000,28239=>1000,28240=>1000,28241=>1000,28242=>1000,28243=>1000,28244=>1000, - 28245=>1000,28246=>1000,28247=>1000,28248=>1000,28249=>1000,28250=>1000,28251=>1000,28252=>1000,28253=>1000,28254=>1000,28255=>1000,28256=>1000,28257=>1000,28258=>1000,28259=>1000,28260=>1000, - 28261=>1000,28262=>1000,28263=>1000,28264=>1000,28265=>1000,28266=>1000,28267=>1000,28268=>1000,28269=>1000,28270=>1000,28271=>1000,28272=>1000,28273=>1000,28274=>1000,28275=>1000,28276=>1000, - 28277=>1000,28278=>1000,28279=>1000,28280=>1000,28281=>1000,28282=>1000,28283=>1000,28284=>1000,28285=>1000,28286=>1000,28287=>1000,28288=>1000,28289=>1000,28290=>1000,28291=>1000,28292=>1000, - 28293=>1000,28294=>1000,28295=>1000,28296=>1000,28297=>1000,28298=>1000,28299=>1000,28300=>1000,28301=>1000,28302=>1000,28303=>1000,28304=>1000,28305=>1000,28306=>1000,28307=>1000,28308=>1000, - 28309=>1000,28310=>1000,28311=>1000,28312=>1000,28313=>1000,28314=>1000,28315=>1000,28316=>1000,28317=>1000,28318=>1000,28319=>1000,28320=>1000,28321=>1000,28322=>1000,28323=>1000,28324=>1000, - 28325=>1000,28326=>1000,28327=>1000,28328=>1000,28329=>1000,28330=>1000,28331=>1000,28332=>1000,28333=>1000,28334=>1000,28335=>1000,28336=>1000,28337=>1000,28338=>1000,28339=>1000,28340=>1000, - 28341=>1000,28342=>1000,28343=>1000,28344=>1000,28345=>1000,28346=>1000,28347=>1000,28348=>1000,28349=>1000,28350=>1000,28351=>1000,28352=>1000,28353=>1000,28354=>1000,28355=>1000,28356=>1000, - 28357=>1000,28358=>1000,28359=>1000,28360=>1000,28361=>1000,28362=>1000,28363=>1000,28364=>1000,28365=>1000,28366=>1000,28367=>1000,28368=>1000,28369=>1000,28370=>1000,28371=>1000,28372=>1000, - 28373=>1000,28374=>1000,28375=>1000,28376=>1000,28377=>1000,28378=>1000,28379=>1000,28380=>1000,28381=>1000,28382=>1000,28383=>1000,28384=>1000,28385=>1000,28386=>1000,28387=>1000,28388=>1000, - 28389=>1000,28390=>1000,28391=>1000,28392=>1000,28393=>1000,28394=>1000,28395=>1000,28396=>1000,28397=>1000,28398=>1000,28399=>1000,28400=>1000,28401=>1000,28402=>1000,28403=>1000,28404=>1000, - 28405=>1000,28406=>1000,28407=>1000,28408=>1000,28409=>1000,28410=>1000,28411=>1000,28412=>1000,28413=>1000,28414=>1000,28415=>1000,28416=>1000,28417=>1000,28418=>1000,28419=>1000,28420=>1000, - 28421=>1000,28422=>1000,28423=>1000,28424=>1000,28425=>1000,28426=>1000,28427=>1000,28428=>1000,28429=>1000,28430=>1000,28431=>1000,28432=>1000,28433=>1000,28434=>1000,28435=>1000,28436=>1000, - 28437=>1000,28438=>1000,28439=>1000,28440=>1000,28441=>1000,28442=>1000,28443=>1000,28444=>1000,28445=>1000,28446=>1000,28447=>1000,28448=>1000,28449=>1000,28450=>1000,28451=>1000,28452=>1000, - 28453=>1000,28454=>1000,28455=>1000,28456=>1000,28457=>1000,28458=>1000,28459=>1000,28460=>1000,28461=>1000,28462=>1000,28463=>1000,28464=>1000,28465=>1000,28466=>1000,28467=>1000,28468=>1000, - 28469=>1000,28470=>1000,28471=>1000,28472=>1000,28473=>1000,28474=>1000,28475=>1000,28476=>1000,28477=>1000,28478=>1000,28479=>1000,28480=>1000,28481=>1000,28482=>1000,28483=>1000,28484=>1000, - 28485=>1000,28486=>1000,28487=>1000,28488=>1000,28489=>1000,28490=>1000,28491=>1000,28492=>1000,28493=>1000,28494=>1000,28495=>1000,28496=>1000,28497=>1000,28498=>1000,28499=>1000,28500=>1000, - 28501=>1000,28502=>1000,28503=>1000,28504=>1000,28505=>1000,28506=>1000,28507=>1000,28508=>1000,28509=>1000,28510=>1000,28511=>1000,28512=>1000,28513=>1000,28514=>1000,28515=>1000,28516=>1000, - 28517=>1000,28518=>1000,28519=>1000,28520=>1000,28521=>1000,28522=>1000,28523=>1000,28524=>1000,28525=>1000,28526=>1000,28527=>1000,28528=>1000,28529=>1000,28530=>1000,28531=>1000,28532=>1000, - 28533=>1000,28534=>1000,28535=>1000,28536=>1000,28537=>1000,28538=>1000,28539=>1000,28540=>1000,28541=>1000,28542=>1000,28543=>1000,28544=>1000,28545=>1000,28546=>1000,28547=>1000,28548=>1000, - 28549=>1000,28550=>1000,28551=>1000,28552=>1000,28553=>1000,28554=>1000,28555=>1000,28556=>1000,28557=>1000,28558=>1000,28559=>1000,28560=>1000,28561=>1000,28562=>1000,28563=>1000,28564=>1000, - 28565=>1000,28566=>1000,28567=>1000,28568=>1000,28569=>1000,28570=>1000,28571=>1000,28572=>1000,28573=>1000,28574=>1000,28575=>1000,28576=>1000,28577=>1000,28578=>1000,28579=>1000,28580=>1000, - 28581=>1000,28582=>1000,28583=>1000,28584=>1000,28585=>1000,28586=>1000,28587=>1000,28588=>1000,28589=>1000,28590=>1000,28591=>1000,28592=>1000,28593=>1000,28594=>1000,28595=>1000,28596=>1000, - 28597=>1000,28598=>1000,28599=>1000,28600=>1000,28601=>1000,28602=>1000,28603=>1000,28604=>1000,28605=>1000,28606=>1000,28607=>1000,28608=>1000,28609=>1000,28610=>1000,28611=>1000,28612=>1000, - 28613=>1000,28614=>1000,28615=>1000,28616=>1000,28617=>1000,28618=>1000,28619=>1000,28620=>1000,28621=>1000,28622=>1000,28623=>1000,28624=>1000,28625=>1000,28626=>1000,28627=>1000,28628=>1000, - 28629=>1000,28630=>1000,28631=>1000,28632=>1000,28633=>1000,28634=>1000,28635=>1000,28636=>1000,28637=>1000,28638=>1000,28639=>1000,28640=>1000,28641=>1000,28642=>1000,28643=>1000,28644=>1000, - 28645=>1000,28646=>1000,28647=>1000,28648=>1000,28649=>1000,28650=>1000,28651=>1000,28652=>1000,28653=>1000,28654=>1000,28655=>1000,28656=>1000,28657=>1000,28658=>1000,28659=>1000,28660=>1000, - 28661=>1000,28662=>1000,28663=>1000,28664=>1000,28665=>1000,28666=>1000,28667=>1000,28668=>1000,28669=>1000,28670=>1000,28671=>1000,28672=>1000,28673=>1000,28674=>1000,28675=>1000,28676=>1000, - 28677=>1000,28678=>1000,28679=>1000,28680=>1000,28681=>1000,28682=>1000,28683=>1000,28684=>1000,28685=>1000,28686=>1000,28687=>1000,28688=>1000,28689=>1000,28690=>1000,28691=>1000,28692=>1000, - 28693=>1000,28694=>1000,28695=>1000,28696=>1000,28697=>1000,28698=>1000,28699=>1000,28700=>1000,28701=>1000,28702=>1000,28703=>1000,28704=>1000,28705=>1000,28706=>1000,28707=>1000,28708=>1000, - 28709=>1000,28710=>1000,28711=>1000,28712=>1000,28713=>1000,28714=>1000,28715=>1000,28716=>1000,28717=>1000,28718=>1000,28719=>1000,28720=>1000,28721=>1000,28722=>1000,28723=>1000,28724=>1000, - 28725=>1000,28726=>1000,28727=>1000,28728=>1000,28729=>1000,28730=>1000,28731=>1000,28732=>1000,28733=>1000,28734=>1000,28735=>1000,28736=>1000,28737=>1000,28738=>1000,28739=>1000,28740=>1000, - 28741=>1000,28742=>1000,28743=>1000,28744=>1000,28745=>1000,28746=>1000,28747=>1000,28748=>1000,28749=>1000,28750=>1000,28751=>1000,28752=>1000,28753=>1000,28754=>1000,28755=>1000,28756=>1000, - 28757=>1000,28758=>1000,28759=>1000,28760=>1000,28761=>1000,28762=>1000,28763=>1000,28764=>1000,28765=>1000,28766=>1000,28767=>1000,28768=>1000,28769=>1000,28770=>1000,28771=>1000,28772=>1000, - 28773=>1000,28774=>1000,28775=>1000,28776=>1000,28777=>1000,28778=>1000,28779=>1000,28780=>1000,28781=>1000,28782=>1000,28783=>1000,28784=>1000,28785=>1000,28786=>1000,28787=>1000,28788=>1000, - 28789=>1000,28790=>1000,28791=>1000,28792=>1000,28793=>1000,28794=>1000,28795=>1000,28796=>1000,28797=>1000,28798=>1000,28799=>1000,28800=>1000,28801=>1000,28802=>1000,28803=>1000,28804=>1000, - 28805=>1000,28806=>1000,28807=>1000,28808=>1000,28809=>1000,28810=>1000,28811=>1000,28812=>1000,28813=>1000,28814=>1000,28815=>1000,28816=>1000,28817=>1000,28818=>1000,28819=>1000,28820=>1000, - 28821=>1000,28822=>1000,28823=>1000,28824=>1000,28825=>1000,28826=>1000,28827=>1000,28828=>1000,28829=>1000,28830=>1000,28831=>1000,28832=>1000,28833=>1000,28834=>1000,28835=>1000,28836=>1000, - 28837=>1000,28838=>1000,28839=>1000,28840=>1000,28841=>1000,28842=>1000,28843=>1000,28844=>1000,28845=>1000,28846=>1000,28847=>1000,28848=>1000,28849=>1000,28850=>1000,28851=>1000,28852=>1000, - 28853=>1000,28854=>1000,28855=>1000,28856=>1000,28857=>1000,28858=>1000,28859=>1000,28860=>1000,28861=>1000,28862=>1000,28863=>1000,28864=>1000,28865=>1000,28866=>1000,28867=>1000,28868=>1000, - 28869=>1000,28870=>1000,28871=>1000,28872=>1000,28873=>1000,28874=>1000,28875=>1000,28876=>1000,28877=>1000,28878=>1000,28879=>1000,28880=>1000,28881=>1000,28882=>1000,28883=>1000,28884=>1000, - 28885=>1000,28886=>1000,28887=>1000,28888=>1000,28889=>1000,28890=>1000,28891=>1000,28892=>1000,28893=>1000,28894=>1000,28895=>1000,28896=>1000,28897=>1000,28898=>1000,28899=>1000,28900=>1000, - 28901=>1000,28902=>1000,28903=>1000,28904=>1000,28905=>1000,28906=>1000,28907=>1000,28908=>1000,28909=>1000,28910=>1000,28911=>1000,28912=>1000,28913=>1000,28914=>1000,28915=>1000,28916=>1000, - 28917=>1000,28918=>1000,28919=>1000,28920=>1000,28921=>1000,28922=>1000,28923=>1000,28924=>1000,28925=>1000,28926=>1000,28927=>1000,28928=>1000,28929=>1000,28930=>1000,28931=>1000,28932=>1000, - 28933=>1000,28934=>1000,28935=>1000,28936=>1000,28937=>1000,28938=>1000,28939=>1000,28940=>1000,28941=>1000,28942=>1000,28943=>1000,28944=>1000,28945=>1000,28946=>1000,28947=>1000,28948=>1000, - 28949=>1000,28950=>1000,28951=>1000,28952=>1000,28953=>1000,28954=>1000,28955=>1000,28956=>1000,28957=>1000,28958=>1000,28959=>1000,28960=>1000,28961=>1000,28962=>1000,28963=>1000,28964=>1000, - 28965=>1000,28966=>1000,28967=>1000,28968=>1000,28969=>1000,28970=>1000,28971=>1000,28972=>1000,28973=>1000,28974=>1000,28975=>1000,28976=>1000,28977=>1000,28978=>1000,28979=>1000,28980=>1000, - 28981=>1000,28982=>1000,28983=>1000,28984=>1000,28985=>1000,28986=>1000,28987=>1000,28988=>1000,28989=>1000,28990=>1000,28991=>1000,28992=>1000,28993=>1000,28994=>1000,28995=>1000,28996=>1000, - 28997=>1000,28998=>1000,28999=>1000,29000=>1000,29001=>1000,29002=>1000,29003=>1000,29004=>1000,29005=>1000,29006=>1000,29007=>1000,29008=>1000,29009=>1000,29010=>1000,29011=>1000,29012=>1000, - 29013=>1000,29014=>1000,29015=>1000,29016=>1000,29017=>1000,29018=>1000,29019=>1000,29020=>1000,29021=>1000,29022=>1000,29023=>1000,29024=>1000,29025=>1000,29026=>1000,29027=>1000,29028=>1000, - 29029=>1000,29030=>1000,29031=>1000,29032=>1000,29033=>1000,29034=>1000,29035=>1000,29036=>1000,29037=>1000,29038=>1000,29039=>1000,29040=>1000,29041=>1000,29042=>1000,29043=>1000,29044=>1000, - 29045=>1000,29046=>1000,29047=>1000,29048=>1000,29049=>1000,29050=>1000,29051=>1000,29052=>1000,29053=>1000,29054=>1000,29055=>1000,29056=>1000,29057=>1000,29058=>1000,29059=>1000,29060=>1000, - 29061=>1000,29062=>1000,29063=>1000,29064=>1000,29065=>1000,29066=>1000,29067=>1000,29068=>1000,29069=>1000,29070=>1000,29071=>1000,29072=>1000,29073=>1000,29074=>1000,29075=>1000,29076=>1000, - 29077=>1000,29078=>1000,29079=>1000,29080=>1000,29081=>1000,29082=>1000,29083=>1000,29084=>1000,29085=>1000,29086=>1000,29087=>1000,29088=>1000,29089=>1000,29090=>1000,29091=>1000,29092=>1000, - 29093=>1000,29094=>1000,29095=>1000,29096=>1000,29097=>1000,29098=>1000,29099=>1000,29100=>1000,29101=>1000,29102=>1000,29103=>1000,29104=>1000,29105=>1000,29106=>1000,29107=>1000,29108=>1000, - 29109=>1000,29110=>1000,29111=>1000,29112=>1000,29113=>1000,29114=>1000,29115=>1000,29116=>1000,29117=>1000,29118=>1000,29119=>1000,29120=>1000,29121=>1000,29122=>1000,29123=>1000,29124=>1000, - 29125=>1000,29126=>1000,29127=>1000,29128=>1000,29129=>1000,29130=>1000,29131=>1000,29132=>1000,29133=>1000,29134=>1000,29135=>1000,29136=>1000,29137=>1000,29138=>1000,29139=>1000,29140=>1000, - 29141=>1000,29142=>1000,29143=>1000,29144=>1000,29145=>1000,29146=>1000,29147=>1000,29148=>1000,29149=>1000,29150=>1000,29151=>1000,29152=>1000,29153=>1000,29154=>1000,29155=>1000,29156=>1000, - 29157=>1000,29158=>1000,29159=>1000,29160=>1000,29161=>1000,29162=>1000,29163=>1000,29164=>1000,29165=>1000,29166=>1000,29167=>1000,29168=>1000,29169=>1000,29170=>1000,29171=>1000,29172=>1000, - 29173=>1000,29174=>1000,29175=>1000,29176=>1000,29177=>1000,29178=>1000,29179=>1000,29180=>1000,29181=>1000,29182=>1000,29183=>1000,29184=>1000,29185=>1000,29186=>1000,29187=>1000,29188=>1000, - 29189=>1000,29190=>1000,29191=>1000,29192=>1000,29193=>1000,29194=>1000,29195=>1000,29196=>1000,29197=>1000,29198=>1000,29199=>1000,29200=>1000,29201=>1000,29202=>1000,29203=>1000,29204=>1000, - 29205=>1000,29206=>1000,29207=>1000,29208=>1000,29209=>1000,29210=>1000,29211=>1000,29212=>1000,29213=>1000,29214=>1000,29215=>1000,29216=>1000,29217=>1000,29218=>1000,29219=>1000,29220=>1000, - 29221=>1000,29222=>1000,29223=>1000,29224=>1000,29225=>1000,29226=>1000,29227=>1000,29228=>1000,29229=>1000,29230=>1000,29231=>1000,29232=>1000,29233=>1000,29234=>1000,29235=>1000,29236=>1000, - 29237=>1000,29238=>1000,29239=>1000,29240=>1000,29241=>1000,29242=>1000,29243=>1000,29244=>1000,29245=>1000,29246=>1000,29247=>1000,29248=>1000,29249=>1000,29250=>1000,29251=>1000,29252=>1000, - 29253=>1000,29254=>1000,29255=>1000,29256=>1000,29257=>1000,29258=>1000,29259=>1000,29260=>1000,29261=>1000,29262=>1000,29263=>1000,29264=>1000,29265=>1000,29266=>1000,29267=>1000,29268=>1000, - 29269=>1000,29270=>1000,29271=>1000,29272=>1000,29273=>1000,29274=>1000,29275=>1000,29276=>1000,29277=>1000,29278=>1000,29279=>1000,29280=>1000,29281=>1000,29282=>1000,29283=>1000,29284=>1000, - 29285=>1000,29286=>1000,29287=>1000,29288=>1000,29289=>1000,29290=>1000,29291=>1000,29292=>1000,29293=>1000,29294=>1000,29295=>1000,29296=>1000,29297=>1000,29298=>1000,29299=>1000,29300=>1000, - 29301=>1000,29302=>1000,29303=>1000,29304=>1000,29305=>1000,29306=>1000,29307=>1000,29308=>1000,29309=>1000,29310=>1000,29311=>1000,29312=>1000,29313=>1000,29314=>1000,29315=>1000,29316=>1000, - 29317=>1000,29318=>1000,29319=>1000,29320=>1000,29321=>1000,29322=>1000,29323=>1000,29324=>1000,29325=>1000,29326=>1000,29327=>1000,29328=>1000,29329=>1000,29330=>1000,29331=>1000,29332=>1000, - 29333=>1000,29334=>1000,29335=>1000,29336=>1000,29337=>1000,29338=>1000,29339=>1000,29340=>1000,29341=>1000,29342=>1000,29343=>1000,29344=>1000,29345=>1000,29346=>1000,29347=>1000,29348=>1000, - 29349=>1000,29350=>1000,29351=>1000,29352=>1000,29353=>1000,29354=>1000,29355=>1000,29356=>1000,29357=>1000,29358=>1000,29359=>1000,29360=>1000,29361=>1000,29362=>1000,29363=>1000,29364=>1000, - 29365=>1000,29366=>1000,29367=>1000,29368=>1000,29369=>1000,29370=>1000,29371=>1000,29372=>1000,29373=>1000,29374=>1000,29375=>1000,29376=>1000,29377=>1000,29378=>1000,29379=>1000,29380=>1000, - 29381=>1000,29382=>1000,29383=>1000,29384=>1000,29385=>1000,29386=>1000,29387=>1000,29388=>1000,29389=>1000,29390=>1000,29391=>1000,29392=>1000,29393=>1000,29394=>1000,29395=>1000,29396=>1000, - 29397=>1000,29398=>1000,29399=>1000,29400=>1000,29401=>1000,29402=>1000,29403=>1000,29404=>1000,29405=>1000,29406=>1000,29407=>1000,29408=>1000,29409=>1000,29410=>1000,29411=>1000,29412=>1000, - 29413=>1000,29414=>1000,29415=>1000,29416=>1000,29417=>1000,29418=>1000,29419=>1000,29420=>1000,29421=>1000,29422=>1000,29423=>1000,29424=>1000,29425=>1000,29426=>1000,29427=>1000,29428=>1000, - 29429=>1000,29430=>1000,29431=>1000,29432=>1000,29433=>1000,29434=>1000,29435=>1000,29436=>1000,29437=>1000,29438=>1000,29439=>1000,29440=>1000,29441=>1000,29442=>1000,29443=>1000,29444=>1000, - 29445=>1000,29446=>1000,29447=>1000,29448=>1000,29449=>1000,29450=>1000,29451=>1000,29452=>1000,29453=>1000,29454=>1000,29455=>1000,29456=>1000,29457=>1000,29458=>1000,29459=>1000,29460=>1000, - 29461=>1000,29462=>1000,29463=>1000,29464=>1000,29465=>1000,29466=>1000,29467=>1000,29468=>1000,29469=>1000,29470=>1000,29471=>1000,29472=>1000,29473=>1000,29474=>1000,29475=>1000,29476=>1000, - 29477=>1000,29478=>1000,29479=>1000,29480=>1000,29481=>1000,29482=>1000,29483=>1000,29484=>1000,29485=>1000,29486=>1000,29487=>1000,29488=>1000,29489=>1000,29490=>1000,29491=>1000,29492=>1000, - 29493=>1000,29494=>1000,29495=>1000,29496=>1000,29497=>1000,29498=>1000,29499=>1000,29500=>1000,29501=>1000,29502=>1000,29503=>1000,29504=>1000,29505=>1000,29506=>1000,29507=>1000,29508=>1000, - 29509=>1000,29510=>1000,29511=>1000,29512=>1000,29513=>1000,29514=>1000,29515=>1000,29516=>1000,29517=>1000,29518=>1000,29519=>1000,29520=>1000,29521=>1000,29522=>1000,29523=>1000,29524=>1000, - 29525=>1000,29526=>1000,29527=>1000,29528=>1000,29529=>1000,29530=>1000,29531=>1000,29532=>1000,29533=>1000,29534=>1000,29535=>1000,29536=>1000,29537=>1000,29538=>1000,29539=>1000,29540=>1000, - 29541=>1000,29542=>1000,29543=>1000,29544=>1000,29545=>1000,29546=>1000,29547=>1000,29548=>1000,29549=>1000,29550=>1000,29551=>1000,29552=>1000,29553=>1000,29554=>1000,29555=>1000,29556=>1000, - 29557=>1000,29558=>1000,29559=>1000,29560=>1000,29561=>1000,29562=>1000,29563=>1000,29564=>1000,29565=>1000,29566=>1000,29567=>1000,29568=>1000,29569=>1000,29570=>1000,29571=>1000,29572=>1000, - 29573=>1000,29574=>1000,29575=>1000,29576=>1000,29577=>1000,29578=>1000,29579=>1000,29580=>1000,29581=>1000,29582=>1000,29583=>1000,29584=>1000,29585=>1000,29586=>1000,29587=>1000,29588=>1000, - 29589=>1000,29590=>1000,29591=>1000,29592=>1000,29593=>1000,29594=>1000,29595=>1000,29596=>1000,29597=>1000,29598=>1000,29599=>1000,29600=>1000,29601=>1000,29602=>1000,29603=>1000,29604=>1000, - 29605=>1000,29606=>1000,29607=>1000,29608=>1000,29609=>1000,29610=>1000,29611=>1000,29612=>1000,29613=>1000,29614=>1000,29615=>1000,29616=>1000,29617=>1000,29618=>1000,29619=>1000,29620=>1000, - 29621=>1000,29622=>1000,29623=>1000,29624=>1000,29625=>1000,29626=>1000,29627=>1000,29628=>1000,29629=>1000,29630=>1000,29631=>1000,29632=>1000,29633=>1000,29634=>1000,29635=>1000,29636=>1000, - 29637=>1000,29638=>1000,29639=>1000,29640=>1000,29641=>1000,29642=>1000,29643=>1000,29644=>1000,29645=>1000,29646=>1000,29647=>1000,29648=>1000,29649=>1000,29650=>1000,29651=>1000,29652=>1000, - 29653=>1000,29654=>1000,29655=>1000,29656=>1000,29657=>1000,29658=>1000,29659=>1000,29660=>1000,29661=>1000,29662=>1000,29663=>1000,29664=>1000,29665=>1000,29666=>1000,29667=>1000,29668=>1000, - 29669=>1000,29670=>1000,29671=>1000,29672=>1000,29673=>1000,29674=>1000,29675=>1000,29676=>1000,29677=>1000,29678=>1000,29679=>1000,29680=>1000,29681=>1000,29682=>1000,29683=>1000,29684=>1000, - 29685=>1000,29686=>1000,29687=>1000,29688=>1000,29689=>1000,29690=>1000,29691=>1000,29692=>1000,29693=>1000,29694=>1000,29695=>1000,29696=>1000,29697=>1000,29698=>1000,29699=>1000,29700=>1000, - 29701=>1000,29702=>1000,29703=>1000,29704=>1000,29705=>1000,29706=>1000,29707=>1000,29708=>1000,29709=>1000,29710=>1000,29711=>1000,29712=>1000,29713=>1000,29714=>1000,29715=>1000,29716=>1000, - 29717=>1000,29718=>1000,29719=>1000,29720=>1000,29721=>1000,29722=>1000,29723=>1000,29724=>1000,29725=>1000,29726=>1000,29727=>1000,29728=>1000,29729=>1000,29730=>1000,29731=>1000,29732=>1000, - 29733=>1000,29734=>1000,29735=>1000,29736=>1000,29737=>1000,29738=>1000,29739=>1000,29740=>1000,29741=>1000,29742=>1000,29743=>1000,29744=>1000,29745=>1000,29746=>1000,29747=>1000,29748=>1000, - 29749=>1000,29750=>1000,29751=>1000,29752=>1000,29753=>1000,29754=>1000,29755=>1000,29756=>1000,29757=>1000,29758=>1000,29759=>1000,29760=>1000,29761=>1000,29762=>1000,29763=>1000,29764=>1000, - 29765=>1000,29766=>1000,29767=>1000,29768=>1000,29769=>1000,29770=>1000,29771=>1000,29772=>1000,29773=>1000,29774=>1000,29775=>1000,29776=>1000,29777=>1000,29778=>1000,29779=>1000,29780=>1000, - 29781=>1000,29782=>1000,29783=>1000,29784=>1000,29785=>1000,29786=>1000,29787=>1000,29788=>1000,29789=>1000,29790=>1000,29791=>1000,29792=>1000,29793=>1000,29794=>1000,29795=>1000,29796=>1000, - 29797=>1000,29798=>1000,29799=>1000,29800=>1000,29801=>1000,29802=>1000,29803=>1000,29804=>1000,29805=>1000,29806=>1000,29807=>1000,29808=>1000,29809=>1000,29810=>1000,29811=>1000,29812=>1000, - 29813=>1000,29814=>1000,29815=>1000,29816=>1000,29817=>1000,29818=>1000,29819=>1000,29820=>1000,29821=>1000,29822=>1000,29823=>1000,29824=>1000,29825=>1000,29826=>1000,29827=>1000,29828=>1000, - 29829=>1000,29830=>1000,29831=>1000,29832=>1000,29833=>1000,29834=>1000,29835=>1000,29836=>1000,29837=>1000,29838=>1000,29839=>1000,29840=>1000,29841=>1000,29842=>1000,29843=>1000,29844=>1000, - 29845=>1000,29846=>1000,29847=>1000,29848=>1000,29849=>1000,29850=>1000,29851=>1000,29852=>1000,29853=>1000,29854=>1000,29855=>1000,29856=>1000,29857=>1000,29858=>1000,29859=>1000,29860=>1000, - 29861=>1000,29862=>1000,29863=>1000,29864=>1000,29865=>1000,29866=>1000,29867=>1000,29868=>1000,29869=>1000,29870=>1000,29871=>1000,29872=>1000,29873=>1000,29874=>1000,29875=>1000,29876=>1000, - 29877=>1000,29878=>1000,29879=>1000,29880=>1000,29881=>1000,29882=>1000,29883=>1000,29884=>1000,29885=>1000,29886=>1000,29887=>1000,29888=>1000,29889=>1000,29890=>1000,29891=>1000,29892=>1000, - 29893=>1000,29894=>1000,29895=>1000,29896=>1000,29897=>1000,29898=>1000,29899=>1000,29900=>1000,29901=>1000,29902=>1000,29903=>1000,29904=>1000,29905=>1000,29906=>1000,29907=>1000,29908=>1000, - 29909=>1000,29910=>1000,29911=>1000,29912=>1000,29913=>1000,29914=>1000,29915=>1000,29916=>1000,29917=>1000,29918=>1000,29919=>1000,29920=>1000,29921=>1000,29922=>1000,29923=>1000,29924=>1000, - 29925=>1000,29926=>1000,29927=>1000,29928=>1000,29929=>1000,29930=>1000,29931=>1000,29932=>1000,29933=>1000,29934=>1000,29935=>1000,29936=>1000,29937=>1000,29938=>1000,29939=>1000,29940=>1000, - 29941=>1000,29942=>1000,29943=>1000,29944=>1000,29945=>1000,29946=>1000,29947=>1000,29948=>1000,29949=>1000,29950=>1000,29951=>1000,29952=>1000,29953=>1000,29954=>1000,29955=>1000,29956=>1000, - 29957=>1000,29958=>1000,29959=>1000,29960=>1000,29961=>1000,29962=>1000,29963=>1000,29964=>1000,29965=>1000,29966=>1000,29967=>1000,29968=>1000,29969=>1000,29970=>1000,29971=>1000,29972=>1000, - 29973=>1000,29974=>1000,29975=>1000,29976=>1000,29977=>1000,29978=>1000,29979=>1000,29980=>1000,29981=>1000,29982=>1000,29983=>1000,29984=>1000,29985=>1000,29986=>1000,29987=>1000,29988=>1000, - 29989=>1000,29990=>1000,29991=>1000,29992=>1000,29993=>1000,29994=>1000,29995=>1000,29996=>1000,29997=>1000,29998=>1000,29999=>1000,30000=>1000,30001=>1000,30002=>1000,30003=>1000,30004=>1000, - 30005=>1000,30006=>1000,30007=>1000,30008=>1000,30009=>1000,30010=>1000,30011=>1000,30012=>1000,30013=>1000,30014=>1000,30015=>1000,30016=>1000,30017=>1000,30018=>1000,30019=>1000,30020=>1000, - 30021=>1000,30022=>1000,30023=>1000,30024=>1000,30025=>1000,30026=>1000,30027=>1000,30028=>1000,30029=>1000,30030=>1000,30031=>1000,30032=>1000,30033=>1000,30034=>1000,30035=>1000,30036=>1000, - 30037=>1000,30038=>1000,30039=>1000,30040=>1000,30041=>1000,30042=>1000,30043=>1000,30044=>1000,30045=>1000,30046=>1000,30047=>1000,30048=>1000,30049=>1000,30050=>1000,30051=>1000,30052=>1000, - 30053=>1000,30054=>1000,30055=>1000,30056=>1000,30057=>1000,30058=>1000,30059=>1000,30060=>1000,30061=>1000,30062=>1000,30063=>1000,30064=>1000,30065=>1000,30066=>1000,30067=>1000,30068=>1000, - 30069=>1000,30070=>1000,30071=>1000,30072=>1000,30073=>1000,30074=>1000,30075=>1000,30076=>1000,30077=>1000,30078=>1000,30079=>1000,30080=>1000,30081=>1000,30082=>1000,30083=>1000,30084=>1000, - 30085=>1000,30086=>1000,30087=>1000,30088=>1000,30089=>1000,30090=>1000,30091=>1000,30092=>1000,30093=>1000,30094=>1000,30095=>1000,30096=>1000,30097=>1000,30098=>1000,30099=>1000,30100=>1000, - 30101=>1000,30102=>1000,30103=>1000,30104=>1000,30105=>1000,30106=>1000,30107=>1000,30108=>1000,30109=>1000,30110=>1000,30111=>1000,30112=>1000,30113=>1000,30114=>1000,30115=>1000,30116=>1000, - 30117=>1000,30118=>1000,30119=>1000,30120=>1000,30121=>1000,30122=>1000,30123=>1000,30124=>1000,30125=>1000,30126=>1000,30127=>1000,30128=>1000,30129=>1000,30130=>1000,30131=>1000,30132=>1000, - 30133=>1000,30134=>1000,30135=>1000,30136=>1000,30137=>1000,30138=>1000,30139=>1000,30140=>1000,30141=>1000,30142=>1000,30143=>1000,30144=>1000,30145=>1000,30146=>1000,30147=>1000,30148=>1000, - 30149=>1000,30150=>1000,30151=>1000,30152=>1000,30153=>1000,30154=>1000,30155=>1000,30156=>1000,30157=>1000,30158=>1000,30159=>1000,30160=>1000,30161=>1000,30162=>1000,30163=>1000,30164=>1000, - 30165=>1000,30166=>1000,30167=>1000,30168=>1000,30169=>1000,30170=>1000,30171=>1000,30172=>1000,30173=>1000,30174=>1000,30175=>1000,30176=>1000,30177=>1000,30178=>1000,30179=>1000,30180=>1000, - 30181=>1000,30182=>1000,30183=>1000,30184=>1000,30185=>1000,30186=>1000,30187=>1000,30188=>1000,30189=>1000,30190=>1000,30191=>1000,30192=>1000,30193=>1000,30194=>1000,30195=>1000,30196=>1000, - 30197=>1000,30198=>1000,30199=>1000,30200=>1000,30201=>1000,30202=>1000,30203=>1000,30204=>1000,30205=>1000,30206=>1000,30207=>1000,30208=>1000,30209=>1000,30210=>1000,30211=>1000,30212=>1000, - 30213=>1000,30214=>1000,30215=>1000,30216=>1000,30217=>1000,30218=>1000,30219=>1000,30220=>1000,30221=>1000,30222=>1000,30223=>1000,30224=>1000,30225=>1000,30226=>1000,30227=>1000,30228=>1000, - 30229=>1000,30230=>1000,30231=>1000,30232=>1000,30233=>1000,30234=>1000,30235=>1000,30236=>1000,30237=>1000,30238=>1000,30239=>1000,30240=>1000,30241=>1000,30242=>1000,30243=>1000,30244=>1000, - 30245=>1000,30246=>1000,30247=>1000,30248=>1000,30249=>1000,30250=>1000,30251=>1000,30252=>1000,30253=>1000,30254=>1000,30255=>1000,30256=>1000,30257=>1000,30258=>1000,30259=>1000,30260=>1000, - 30261=>1000,30262=>1000,30263=>1000,30264=>1000,30265=>1000,30266=>1000,30267=>1000,30268=>1000,30269=>1000,30270=>1000,30271=>1000,30272=>1000,30273=>1000,30274=>1000,30275=>1000,30276=>1000, - 30277=>1000,30278=>1000,30279=>1000,30280=>1000,30281=>1000,30282=>1000,30283=>1000,30284=>1000,30285=>1000,30286=>1000,30287=>1000,30288=>1000,30289=>1000,30290=>1000,30291=>1000,30292=>1000, - 30293=>1000,30294=>1000,30295=>1000,30296=>1000,30297=>1000,30298=>1000,30299=>1000,30300=>1000,30301=>1000,30302=>1000,30303=>1000,30304=>1000,30305=>1000,30306=>1000,30307=>1000,30308=>1000, - 30309=>1000,30310=>1000,30311=>1000,30312=>1000,30313=>1000,30314=>1000,30315=>1000,30316=>1000,30317=>1000,30318=>1000,30319=>1000,30320=>1000,30321=>1000,30322=>1000,30323=>1000,30324=>1000, - 30325=>1000,30326=>1000,30327=>1000,30328=>1000,30329=>1000,30330=>1000,30331=>1000,30332=>1000,30333=>1000,30334=>1000,30335=>1000,30336=>1000,30337=>1000,30338=>1000,30339=>1000,30340=>1000, - 30341=>1000,30342=>1000,30343=>1000,30344=>1000,30345=>1000,30346=>1000,30347=>1000,30348=>1000,30349=>1000,30350=>1000,30351=>1000,30352=>1000,30353=>1000,30354=>1000,30355=>1000,30356=>1000, - 30357=>1000,30358=>1000,30359=>1000,30360=>1000,30361=>1000,30362=>1000,30363=>1000,30364=>1000,30365=>1000,30366=>1000,30367=>1000,30368=>1000,30369=>1000,30370=>1000,30371=>1000,30372=>1000, - 30373=>1000,30374=>1000,30375=>1000,30376=>1000,30377=>1000,30378=>1000,30379=>1000,30380=>1000,30381=>1000,30382=>1000,30383=>1000,30384=>1000,30385=>1000,30386=>1000,30387=>1000,30388=>1000, - 30389=>1000,30390=>1000,30391=>1000,30392=>1000,30393=>1000,30394=>1000,30395=>1000,30396=>1000,30397=>1000,30398=>1000,30399=>1000,30400=>1000,30401=>1000,30402=>1000,30403=>1000,30404=>1000, - 30405=>1000,30406=>1000,30407=>1000,30408=>1000,30409=>1000,30410=>1000,30411=>1000,30412=>1000,30413=>1000,30414=>1000,30415=>1000,30416=>1000,30417=>1000,30418=>1000,30419=>1000,30420=>1000, - 30421=>1000,30422=>1000,30423=>1000,30424=>1000,30425=>1000,30426=>1000,30427=>1000,30428=>1000,30429=>1000,30430=>1000,30431=>1000,30432=>1000,30433=>1000,30434=>1000,30435=>1000,30436=>1000, - 30437=>1000,30438=>1000,30439=>1000,30440=>1000,30441=>1000,30442=>1000,30443=>1000,30444=>1000,30445=>1000,30446=>1000,30447=>1000,30448=>1000,30449=>1000,30450=>1000,30451=>1000,30452=>1000, - 30453=>1000,30454=>1000,30455=>1000,30456=>1000,30457=>1000,30458=>1000,30459=>1000,30460=>1000,30461=>1000,30462=>1000,30463=>1000,30464=>1000,30465=>1000,30466=>1000,30467=>1000,30468=>1000, - 30469=>1000,30470=>1000,30471=>1000,30472=>1000,30473=>1000,30474=>1000,30475=>1000,30476=>1000,30477=>1000,30478=>1000,30479=>1000,30480=>1000,30481=>1000,30482=>1000,30483=>1000,30484=>1000, - 30485=>1000,30486=>1000,30487=>1000,30488=>1000,30489=>1000,30490=>1000,30491=>1000,30492=>1000,30493=>1000,30494=>1000,30495=>1000,30496=>1000,30497=>1000,30498=>1000,30499=>1000,30500=>1000, - 30501=>1000,30502=>1000,30503=>1000,30504=>1000,30505=>1000,30506=>1000,30507=>1000,30508=>1000,30509=>1000,30510=>1000,30511=>1000,30512=>1000,30513=>1000,30514=>1000,30515=>1000,30516=>1000, - 30517=>1000,30518=>1000,30519=>1000,30520=>1000,30521=>1000,30522=>1000,30523=>1000,30524=>1000,30525=>1000,30526=>1000,30527=>1000,30528=>1000,30529=>1000,30530=>1000,30531=>1000,30532=>1000, - 30533=>1000,30534=>1000,30535=>1000,30536=>1000,30537=>1000,30538=>1000,30539=>1000,30540=>1000,30541=>1000,30542=>1000,30543=>1000,30544=>1000,30545=>1000,30546=>1000,30547=>1000,30548=>1000, - 30549=>1000,30550=>1000,30551=>1000,30552=>1000,30553=>1000,30554=>1000,30555=>1000,30556=>1000,30557=>1000,30558=>1000,30559=>1000,30560=>1000,30561=>1000,30562=>1000,30563=>1000,30564=>1000, - 30565=>1000,30566=>1000,30567=>1000,30568=>1000,30569=>1000,30570=>1000,30571=>1000,30572=>1000,30573=>1000,30574=>1000,30575=>1000,30576=>1000,30577=>1000,30578=>1000,30579=>1000,30580=>1000, - 30581=>1000,30582=>1000,30583=>1000,30584=>1000,30585=>1000,30586=>1000,30587=>1000,30588=>1000,30589=>1000,30590=>1000,30591=>1000,30592=>1000,30593=>1000,30594=>1000,30595=>1000,30596=>1000, - 30597=>1000,30598=>1000,30599=>1000,30600=>1000,30601=>1000,30602=>1000,30603=>1000,30604=>1000,30605=>1000,30606=>1000,30607=>1000,30608=>1000,30609=>1000,30610=>1000,30611=>1000,30612=>1000, - 30613=>1000,30614=>1000,30615=>1000,30616=>1000,30617=>1000,30618=>1000,30619=>1000,30620=>1000,30621=>1000,30622=>1000,30623=>1000,30624=>1000,30625=>1000,30626=>1000,30627=>1000,30628=>1000, - 30629=>1000,30630=>1000,30631=>1000,30632=>1000,30633=>1000,30634=>1000,30635=>1000,30636=>1000,30637=>1000,30638=>1000,30639=>1000,30640=>1000,30641=>1000,30642=>1000,30643=>1000,30644=>1000, - 30645=>1000,30646=>1000,30647=>1000,30648=>1000,30649=>1000,30650=>1000,30651=>1000,30652=>1000,30653=>1000,30654=>1000,30655=>1000,30656=>1000,30657=>1000,30658=>1000,30659=>1000,30660=>1000, - 30661=>1000,30662=>1000,30663=>1000,30664=>1000,30665=>1000,30666=>1000,30667=>1000,30668=>1000,30669=>1000,30670=>1000,30671=>1000,30672=>1000,30673=>1000,30674=>1000,30675=>1000,30676=>1000, - 30677=>1000,30678=>1000,30679=>1000,30680=>1000,30681=>1000,30682=>1000,30683=>1000,30684=>1000,30685=>1000,30686=>1000,30687=>1000,30688=>1000,30689=>1000,30690=>1000,30691=>1000,30692=>1000, - 30693=>1000,30694=>1000,30695=>1000,30696=>1000,30697=>1000,30698=>1000,30699=>1000,30700=>1000,30701=>1000,30702=>1000,30703=>1000,30704=>1000,30705=>1000,30706=>1000,30707=>1000,30708=>1000, - 30709=>1000,30710=>1000,30711=>1000,30712=>1000,30713=>1000,30714=>1000,30715=>1000,30716=>1000,30717=>1000,30718=>1000,30719=>1000,30720=>1000,30721=>1000,30722=>1000,30723=>1000,30724=>1000, - 30725=>1000,30726=>1000,30727=>1000,30728=>1000,30729=>1000,30730=>1000,30731=>1000,30732=>1000,30733=>1000,30734=>1000,30735=>1000,30736=>1000,30737=>1000,30738=>1000,30739=>1000,30740=>1000, - 30741=>1000,30742=>1000,30743=>1000,30744=>1000,30745=>1000,30746=>1000,30747=>1000,30748=>1000,30749=>1000,30750=>1000,30751=>1000,30752=>1000,30753=>1000,30754=>1000,30755=>1000,30756=>1000, - 30757=>1000,30758=>1000,30759=>1000,30760=>1000,30761=>1000,30762=>1000,30763=>1000,30764=>1000,30765=>1000,30766=>1000,30767=>1000,30768=>1000,30769=>1000,30770=>1000,30771=>1000,30772=>1000, - 30773=>1000,30774=>1000,30775=>1000,30776=>1000,30777=>1000,30778=>1000,30779=>1000,30780=>1000,30781=>1000,30782=>1000,30783=>1000,30784=>1000,30785=>1000,30786=>1000,30787=>1000,30788=>1000, - 30789=>1000,30790=>1000,30791=>1000,30792=>1000,30793=>1000,30794=>1000,30795=>1000,30796=>1000,30797=>1000,30798=>1000,30799=>1000,30800=>1000,30801=>1000,30802=>1000,30803=>1000,30804=>1000, - 30805=>1000,30806=>1000,30807=>1000,30808=>1000,30809=>1000,30810=>1000,30811=>1000,30812=>1000,30813=>1000,30814=>1000,30815=>1000,30816=>1000,30817=>1000,30818=>1000,30819=>1000,30820=>1000, - 30821=>1000,30822=>1000,30823=>1000,30824=>1000,30825=>1000,30826=>1000,30827=>1000,30828=>1000,30829=>1000,30830=>1000,30831=>1000,30832=>1000,30833=>1000,30834=>1000,30835=>1000,30836=>1000, - 30837=>1000,30838=>1000,30839=>1000,30840=>1000,30841=>1000,30842=>1000,30843=>1000,30844=>1000,30845=>1000,30846=>1000,30847=>1000,30848=>1000,30849=>1000,30850=>1000,30851=>1000,30852=>1000, - 30853=>1000,30854=>1000,30855=>1000,30856=>1000,30857=>1000,30858=>1000,30859=>1000,30860=>1000,30861=>1000,30862=>1000,30863=>1000,30864=>1000,30865=>1000,30866=>1000,30867=>1000,30868=>1000, - 30869=>1000,30870=>1000,30871=>1000,30872=>1000,30873=>1000,30874=>1000,30875=>1000,30876=>1000,30877=>1000,30878=>1000,30879=>1000,30880=>1000,30881=>1000,30882=>1000,30883=>1000,30884=>1000, - 30885=>1000,30886=>1000,30887=>1000,30888=>1000,30889=>1000,30890=>1000,30891=>1000,30892=>1000,30893=>1000,30894=>1000,30895=>1000,30896=>1000,30897=>1000,30898=>1000,30899=>1000,30900=>1000, - 30901=>1000,30902=>1000,30903=>1000,30904=>1000,30905=>1000,30906=>1000,30907=>1000,30908=>1000,30909=>1000,30910=>1000,30911=>1000,30912=>1000,30913=>1000,30914=>1000,30915=>1000,30916=>1000, - 30917=>1000,30918=>1000,30919=>1000,30920=>1000,30921=>1000,30922=>1000,30923=>1000,30924=>1000,30925=>1000,30926=>1000,30927=>1000,30928=>1000,30929=>1000,30930=>1000,30931=>1000,30932=>1000, - 30933=>1000,30934=>1000,30935=>1000,30936=>1000,30937=>1000,30938=>1000,30939=>1000,30940=>1000,30941=>1000,30942=>1000,30943=>1000,30944=>1000,30945=>1000,30946=>1000,30947=>1000,30948=>1000, - 30949=>1000,30950=>1000,30951=>1000,30952=>1000,30953=>1000,30954=>1000,30955=>1000,30956=>1000,30957=>1000,30958=>1000,30959=>1000,30960=>1000,30961=>1000,30962=>1000,30963=>1000,30964=>1000, - 30965=>1000,30966=>1000,30967=>1000,30968=>1000,30969=>1000,30970=>1000,30971=>1000,30972=>1000,30973=>1000,30974=>1000,30975=>1000,30976=>1000,30977=>1000,30978=>1000,30979=>1000,30980=>1000, - 30981=>1000,30982=>1000,30983=>1000,30984=>1000,30985=>1000,30986=>1000,30987=>1000,30988=>1000,30989=>1000,30990=>1000,30991=>1000,30992=>1000,30993=>1000,30994=>1000,30995=>1000,30996=>1000, - 30997=>1000,30998=>1000,30999=>1000,31000=>1000,31001=>1000,31002=>1000,31003=>1000,31004=>1000,31005=>1000,31006=>1000,31007=>1000,31008=>1000,31009=>1000,31010=>1000,31011=>1000,31012=>1000, - 31013=>1000,31014=>1000,31015=>1000,31016=>1000,31017=>1000,31018=>1000,31019=>1000,31020=>1000,31021=>1000,31022=>1000,31023=>1000,31024=>1000,31025=>1000,31026=>1000,31027=>1000,31028=>1000, - 31029=>1000,31030=>1000,31031=>1000,31032=>1000,31033=>1000,31034=>1000,31035=>1000,31036=>1000,31037=>1000,31038=>1000,31039=>1000,31040=>1000,31041=>1000,31042=>1000,31043=>1000,31044=>1000, - 31045=>1000,31046=>1000,31047=>1000,31048=>1000,31049=>1000,31050=>1000,31051=>1000,31052=>1000,31053=>1000,31054=>1000,31055=>1000,31056=>1000,31057=>1000,31058=>1000,31059=>1000,31060=>1000, - 31061=>1000,31062=>1000,31063=>1000,31064=>1000,31065=>1000,31066=>1000,31067=>1000,31068=>1000,31069=>1000,31070=>1000,31071=>1000,31072=>1000,31073=>1000,31074=>1000,31075=>1000,31076=>1000, - 31077=>1000,31078=>1000,31079=>1000,31080=>1000,31081=>1000,31082=>1000,31083=>1000,31084=>1000,31085=>1000,31086=>1000,31087=>1000,31088=>1000,31089=>1000,31090=>1000,31091=>1000,31092=>1000, - 31093=>1000,31094=>1000,31095=>1000,31096=>1000,31097=>1000,31098=>1000,31099=>1000,31100=>1000,31101=>1000,31102=>1000,31103=>1000,31104=>1000,31105=>1000,31106=>1000,31107=>1000,31108=>1000, - 31109=>1000,31110=>1000,31111=>1000,31112=>1000,31113=>1000,31114=>1000,31115=>1000,31116=>1000,31117=>1000,31118=>1000,31119=>1000,31120=>1000,31121=>1000,31122=>1000,31123=>1000,31124=>1000, - 31125=>1000,31126=>1000,31127=>1000,31128=>1000,31129=>1000,31130=>1000,31131=>1000,31132=>1000,31133=>1000,31134=>1000,31135=>1000,31136=>1000,31137=>1000,31138=>1000,31139=>1000,31140=>1000, - 31141=>1000,31142=>1000,31143=>1000,31144=>1000,31145=>1000,31146=>1000,31147=>1000,31148=>1000,31149=>1000,31150=>1000,31151=>1000,31152=>1000,31153=>1000,31154=>1000,31155=>1000,31156=>1000, - 31157=>1000,31158=>1000,31159=>1000,31160=>1000,31161=>1000,31162=>1000,31163=>1000,31164=>1000,31165=>1000,31166=>1000,31167=>1000,31168=>1000,31169=>1000,31170=>1000,31171=>1000,31172=>1000, - 31173=>1000,31174=>1000,31175=>1000,31176=>1000,31177=>1000,31178=>1000,31179=>1000,31180=>1000,31181=>1000,31182=>1000,31183=>1000,31184=>1000,31185=>1000,31186=>1000,31187=>1000,31188=>1000, - 31189=>1000,31190=>1000,31191=>1000,31192=>1000,31193=>1000,31194=>1000,31195=>1000,31196=>1000,31197=>1000,31198=>1000,31199=>1000,31200=>1000,31201=>1000,31202=>1000,31203=>1000,31204=>1000, - 31205=>1000,31206=>1000,31207=>1000,31208=>1000,31209=>1000,31210=>1000,31211=>1000,31212=>1000,31213=>1000,31214=>1000,31215=>1000,31216=>1000,31217=>1000,31218=>1000,31219=>1000,31220=>1000, - 31221=>1000,31222=>1000,31223=>1000,31224=>1000,31225=>1000,31226=>1000,31227=>1000,31228=>1000,31229=>1000,31230=>1000,31231=>1000,31232=>1000,31233=>1000,31234=>1000,31235=>1000,31236=>1000, - 31237=>1000,31238=>1000,31239=>1000,31240=>1000,31241=>1000,31242=>1000,31243=>1000,31244=>1000,31245=>1000,31246=>1000,31247=>1000,31248=>1000,31249=>1000,31250=>1000,31251=>1000,31252=>1000, - 31253=>1000,31254=>1000,31255=>1000,31256=>1000,31257=>1000,31258=>1000,31259=>1000,31260=>1000,31261=>1000,31262=>1000,31263=>1000,31264=>1000,31265=>1000,31266=>1000,31267=>1000,31268=>1000, - 31269=>1000,31270=>1000,31271=>1000,31272=>1000,31273=>1000,31274=>1000,31275=>1000,31276=>1000,31277=>1000,31278=>1000,31279=>1000,31280=>1000,31281=>1000,31282=>1000,31283=>1000,31284=>1000, - 31285=>1000,31286=>1000,31287=>1000,31288=>1000,31289=>1000,31290=>1000,31291=>1000,31292=>1000,31293=>1000,31294=>1000,31295=>1000,31296=>1000,31297=>1000,31298=>1000,31299=>1000,31300=>1000, - 31301=>1000,31302=>1000,31303=>1000,31304=>1000,31305=>1000,31306=>1000,31307=>1000,31308=>1000,31309=>1000,31310=>1000,31311=>1000,31312=>1000,31313=>1000,31314=>1000,31315=>1000,31316=>1000, - 31317=>1000,31318=>1000,31319=>1000,31320=>1000,31321=>1000,31322=>1000,31323=>1000,31324=>1000,31325=>1000,31326=>1000,31327=>1000,31328=>1000,31329=>1000,31330=>1000,31331=>1000,31332=>1000, - 31333=>1000,31334=>1000,31335=>1000,31336=>1000,31337=>1000,31338=>1000,31339=>1000,31340=>1000,31341=>1000,31342=>1000,31343=>1000,31344=>1000,31345=>1000,31346=>1000,31347=>1000,31348=>1000, - 31349=>1000,31350=>1000,31351=>1000,31352=>1000,31353=>1000,31354=>1000,31355=>1000,31356=>1000,31357=>1000,31358=>1000,31359=>1000,31360=>1000,31361=>1000,31362=>1000,31363=>1000,31364=>1000, - 31365=>1000,31366=>1000,31367=>1000,31368=>1000,31369=>1000,31370=>1000,31371=>1000,31372=>1000,31373=>1000,31374=>1000,31375=>1000,31376=>1000,31377=>1000,31378=>1000,31379=>1000,31380=>1000, - 31381=>1000,31382=>1000,31383=>1000,31384=>1000,31385=>1000,31386=>1000,31387=>1000,31388=>1000,31389=>1000,31390=>1000,31391=>1000,31392=>1000,31393=>1000,31394=>1000,31395=>1000,31396=>1000, - 31397=>1000,31398=>1000,31399=>1000,31400=>1000,31401=>1000,31402=>1000,31403=>1000,31404=>1000,31405=>1000,31406=>1000,31407=>1000,31408=>1000,31409=>1000,31410=>1000,31411=>1000,31412=>1000, - 31413=>1000,31414=>1000,31415=>1000,31416=>1000,31417=>1000,31418=>1000,31419=>1000,31420=>1000,31421=>1000,31422=>1000,31423=>1000,31424=>1000,31425=>1000,31426=>1000,31427=>1000,31428=>1000, - 31429=>1000,31430=>1000,31431=>1000,31432=>1000,31433=>1000,31434=>1000,31435=>1000,31436=>1000,31437=>1000,31438=>1000,31439=>1000,31440=>1000,31441=>1000,31442=>1000,31443=>1000,31444=>1000, - 31445=>1000,31446=>1000,31447=>1000,31448=>1000,31449=>1000,31450=>1000,31451=>1000,31452=>1000,31453=>1000,31454=>1000,31455=>1000,31456=>1000,31457=>1000,31458=>1000,31459=>1000,31460=>1000, - 31461=>1000,31462=>1000,31463=>1000,31464=>1000,31465=>1000,31466=>1000,31467=>1000,31468=>1000,31469=>1000,31470=>1000,31471=>1000,31472=>1000,31473=>1000,31474=>1000,31475=>1000,31476=>1000, - 31477=>1000,31478=>1000,31479=>1000,31480=>1000,31481=>1000,31482=>1000,31483=>1000,31484=>1000,31485=>1000,31486=>1000,31487=>1000,31488=>1000,31489=>1000,31490=>1000,31491=>1000,31492=>1000, - 31493=>1000,31494=>1000,31495=>1000,31496=>1000,31497=>1000,31498=>1000,31499=>1000,31500=>1000,31501=>1000,31502=>1000,31503=>1000,31504=>1000,31505=>1000,31506=>1000,31507=>1000,31508=>1000, - 31509=>1000,31510=>1000,31511=>1000,31512=>1000,31513=>1000,31514=>1000,31515=>1000,31516=>1000,31517=>1000,31518=>1000,31519=>1000,31520=>1000,31521=>1000,31522=>1000,31523=>1000,31524=>1000, - 31525=>1000,31526=>1000,31527=>1000,31528=>1000,31529=>1000,31530=>1000,31531=>1000,31532=>1000,31533=>1000,31534=>1000,31535=>1000,31536=>1000,31537=>1000,31538=>1000,31539=>1000,31540=>1000, - 31541=>1000,31542=>1000,31543=>1000,31544=>1000,31545=>1000,31546=>1000,31547=>1000,31548=>1000,31549=>1000,31550=>1000,31551=>1000,31552=>1000,31553=>1000,31554=>1000,31555=>1000,31556=>1000, - 31557=>1000,31558=>1000,31559=>1000,31560=>1000,31561=>1000,31562=>1000,31563=>1000,31564=>1000,31565=>1000,31566=>1000,31567=>1000,31568=>1000,31569=>1000,31570=>1000,31571=>1000,31572=>1000, - 31573=>1000,31574=>1000,31575=>1000,31576=>1000,31577=>1000,31578=>1000,31579=>1000,31580=>1000,31581=>1000,31582=>1000,31583=>1000,31584=>1000,31585=>1000,31586=>1000,31587=>1000,31588=>1000, - 31589=>1000,31590=>1000,31591=>1000,31592=>1000,31593=>1000,31594=>1000,31595=>1000,31596=>1000,31597=>1000,31598=>1000,31599=>1000,31600=>1000,31601=>1000,31602=>1000,31603=>1000,31604=>1000, - 31605=>1000,31606=>1000,31607=>1000,31608=>1000,31609=>1000,31610=>1000,31611=>1000,31612=>1000,31613=>1000,31614=>1000,31615=>1000,31616=>1000,31617=>1000,31618=>1000,31619=>1000,31620=>1000, - 31621=>1000,31622=>1000,31623=>1000,31624=>1000,31625=>1000,31626=>1000,31627=>1000,31628=>1000,31629=>1000,31630=>1000,31631=>1000,31632=>1000,31633=>1000,31634=>1000,31635=>1000,31636=>1000, - 31637=>1000,31638=>1000,31639=>1000,31640=>1000,31641=>1000,31642=>1000,31643=>1000,31644=>1000,31645=>1000,31646=>1000,31647=>1000,31648=>1000,31649=>1000,31650=>1000,31651=>1000,31652=>1000, - 31653=>1000,31654=>1000,31655=>1000,31656=>1000,31657=>1000,31658=>1000,31659=>1000,31660=>1000,31661=>1000,31662=>1000,31663=>1000,31664=>1000,31665=>1000,31666=>1000,31667=>1000,31668=>1000, - 31669=>1000,31670=>1000,31671=>1000,31672=>1000,31673=>1000,31674=>1000,31675=>1000,31676=>1000,31677=>1000,31678=>1000,31679=>1000,31680=>1000,31681=>1000,31682=>1000,31683=>1000,31684=>1000, - 31685=>1000,31686=>1000,31687=>1000,31688=>1000,31689=>1000,31690=>1000,31691=>1000,31692=>1000,31693=>1000,31694=>1000,31695=>1000,31696=>1000,31697=>1000,31698=>1000,31699=>1000,31700=>1000, - 31701=>1000,31702=>1000,31703=>1000,31704=>1000,31705=>1000,31706=>1000,31707=>1000,31708=>1000,31709=>1000,31710=>1000,31711=>1000,31712=>1000,31713=>1000,31714=>1000,31715=>1000,31716=>1000, - 31717=>1000,31718=>1000,31719=>1000,31720=>1000,31721=>1000,31722=>1000,31723=>1000,31724=>1000,31725=>1000,31726=>1000,31727=>1000,31728=>1000,31729=>1000,31730=>1000,31731=>1000,31732=>1000, - 31733=>1000,31734=>1000,31735=>1000,31736=>1000,31737=>1000,31738=>1000,31739=>1000,31740=>1000,31741=>1000,31742=>1000,31743=>1000,31744=>1000,31745=>1000,31746=>1000,31747=>1000,31748=>1000, - 31749=>1000,31750=>1000,31751=>1000,31752=>1000,31753=>1000,31754=>1000,31755=>1000,31756=>1000,31757=>1000,31758=>1000,31759=>1000,31760=>1000,31761=>1000,31762=>1000,31763=>1000,31764=>1000, - 31765=>1000,31766=>1000,31767=>1000,31768=>1000,31769=>1000,31770=>1000,31771=>1000,31772=>1000,31773=>1000,31774=>1000,31775=>1000,31776=>1000,31777=>1000,31778=>1000,31779=>1000,31780=>1000, - 31781=>1000,31782=>1000,31783=>1000,31784=>1000,31785=>1000,31786=>1000,31787=>1000,31788=>1000,31789=>1000,31790=>1000,31791=>1000,31792=>1000,31793=>1000,31794=>1000,31795=>1000,31796=>1000, - 31797=>1000,31798=>1000,31799=>1000,31800=>1000,31801=>1000,31802=>1000,31803=>1000,31804=>1000,31805=>1000,31806=>1000,31807=>1000,31808=>1000,31809=>1000,31810=>1000,31811=>1000,31812=>1000, - 31813=>1000,31814=>1000,31815=>1000,31816=>1000,31817=>1000,31818=>1000,31819=>1000,31820=>1000,31821=>1000,31822=>1000,31823=>1000,31824=>1000,31825=>1000,31826=>1000,31827=>1000,31828=>1000, - 31829=>1000,31830=>1000,31831=>1000,31832=>1000,31833=>1000,31834=>1000,31835=>1000,31836=>1000,31837=>1000,31838=>1000,31839=>1000,31840=>1000,31841=>1000,31842=>1000,31843=>1000,31844=>1000, - 31845=>1000,31846=>1000,31847=>1000,31848=>1000,31849=>1000,31850=>1000,31851=>1000,31852=>1000,31853=>1000,31854=>1000,31855=>1000,31856=>1000,31857=>1000,31858=>1000,31859=>1000,31860=>1000, - 31861=>1000,31862=>1000,31863=>1000,31864=>1000,31865=>1000,31866=>1000,31867=>1000,31868=>1000,31869=>1000,31870=>1000,31871=>1000,31872=>1000,31873=>1000,31874=>1000,31875=>1000,31876=>1000, - 31877=>1000,31878=>1000,31879=>1000,31880=>1000,31881=>1000,31882=>1000,31883=>1000,31884=>1000,31885=>1000,31886=>1000,31887=>1000,31888=>1000,31889=>1000,31890=>1000,31891=>1000,31892=>1000, - 31893=>1000,31894=>1000,31895=>1000,31896=>1000,31897=>1000,31898=>1000,31899=>1000,31900=>1000,31901=>1000,31902=>1000,31903=>1000,31904=>1000,31905=>1000,31906=>1000,31907=>1000,31908=>1000, - 31909=>1000,31910=>1000,31911=>1000,31912=>1000,31913=>1000,31914=>1000,31915=>1000,31916=>1000,31917=>1000,31918=>1000,31919=>1000,31920=>1000,31921=>1000,31922=>1000,31923=>1000,31924=>1000, - 31925=>1000,31926=>1000,31927=>1000,31928=>1000,31929=>1000,31930=>1000,31931=>1000,31932=>1000,31933=>1000,31934=>1000,31935=>1000,31936=>1000,31937=>1000,31938=>1000,31939=>1000,31940=>1000, - 31941=>1000,31942=>1000,31943=>1000,31944=>1000,31945=>1000,31946=>1000,31947=>1000,31948=>1000,31949=>1000,31950=>1000,31951=>1000,31952=>1000,31953=>1000,31954=>1000,31955=>1000,31956=>1000, - 31957=>1000,31958=>1000,31959=>1000,31960=>1000,31961=>1000,31962=>1000,31963=>1000,31964=>1000,31965=>1000,31966=>1000,31967=>1000,31968=>1000,31969=>1000,31970=>1000,31971=>1000,31972=>1000, - 31973=>1000,31974=>1000,31975=>1000,31976=>1000,31977=>1000,31978=>1000,31979=>1000,31980=>1000,31981=>1000,31982=>1000,31983=>1000,31984=>1000,31985=>1000,31986=>1000,31987=>1000,31988=>1000, - 31989=>1000,31990=>1000,31991=>1000,31992=>1000,31993=>1000,31994=>1000,31995=>1000,31996=>1000,31997=>1000,31998=>1000,31999=>1000,32000=>1000,32001=>1000,32002=>1000,32003=>1000,32004=>1000, - 32005=>1000,32006=>1000,32007=>1000,32008=>1000,32009=>1000,32010=>1000,32011=>1000,32012=>1000,32013=>1000,32014=>1000,32015=>1000,32016=>1000,32017=>1000,32018=>1000,32019=>1000,32020=>1000, - 32021=>1000,32022=>1000,32023=>1000,32024=>1000,32025=>1000,32026=>1000,32027=>1000,32028=>1000,32029=>1000,32030=>1000,32031=>1000,32032=>1000,32033=>1000,32034=>1000,32035=>1000,32036=>1000, - 32037=>1000,32038=>1000,32039=>1000,32040=>1000,32041=>1000,32042=>1000,32043=>1000,32044=>1000,32045=>1000,32046=>1000,32047=>1000,32048=>1000,32049=>1000,32050=>1000,32051=>1000,32052=>1000, - 32053=>1000,32054=>1000,32055=>1000,32056=>1000,32057=>1000,32058=>1000,32059=>1000,32060=>1000,32061=>1000,32062=>1000,32063=>1000,32064=>1000,32065=>1000,32066=>1000,32067=>1000,32068=>1000, - 32069=>1000,32070=>1000,32071=>1000,32072=>1000,32073=>1000,32074=>1000,32075=>1000,32076=>1000,32077=>1000,32078=>1000,32079=>1000,32080=>1000,32081=>1000,32082=>1000,32083=>1000,32084=>1000, - 32085=>1000,32086=>1000,32087=>1000,32088=>1000,32089=>1000,32090=>1000,32091=>1000,32092=>1000,32093=>1000,32094=>1000,32095=>1000,32096=>1000,32097=>1000,32098=>1000,32099=>1000,32100=>1000, - 32101=>1000,32102=>1000,32103=>1000,32104=>1000,32105=>1000,32106=>1000,32107=>1000,32108=>1000,32109=>1000,32110=>1000,32111=>1000,32112=>1000,32113=>1000,32114=>1000,32115=>1000,32116=>1000, - 32117=>1000,32118=>1000,32119=>1000,32120=>1000,32121=>1000,32122=>1000,32123=>1000,32124=>1000,32125=>1000,32126=>1000,32127=>1000,32128=>1000,32129=>1000,32130=>1000,32131=>1000,32132=>1000, - 32133=>1000,32134=>1000,32135=>1000,32136=>1000,32137=>1000,32138=>1000,32139=>1000,32140=>1000,32141=>1000,32142=>1000,32143=>1000,32144=>1000,32145=>1000,32146=>1000,32147=>1000,32148=>1000, - 32149=>1000,32150=>1000,32151=>1000,32152=>1000,32153=>1000,32154=>1000,32155=>1000,32156=>1000,32157=>1000,32158=>1000,32159=>1000,32160=>1000,32161=>1000,32162=>1000,32163=>1000,32164=>1000, - 32165=>1000,32166=>1000,32167=>1000,32168=>1000,32169=>1000,32170=>1000,32171=>1000,32172=>1000,32173=>1000,32174=>1000,32175=>1000,32176=>1000,32177=>1000,32178=>1000,32179=>1000,32180=>1000, - 32181=>1000,32182=>1000,32183=>1000,32184=>1000,32185=>1000,32186=>1000,32187=>1000,32188=>1000,32189=>1000,32190=>1000,32191=>1000,32192=>1000,32193=>1000,32194=>1000,32195=>1000,32196=>1000, - 32197=>1000,32198=>1000,32199=>1000,32200=>1000,32201=>1000,32202=>1000,32203=>1000,32204=>1000,32205=>1000,32206=>1000,32207=>1000,32208=>1000,32209=>1000,32210=>1000,32211=>1000,32212=>1000, - 32213=>1000,32214=>1000,32215=>1000,32216=>1000,32217=>1000,32218=>1000,32219=>1000,32220=>1000,32221=>1000,32222=>1000,32223=>1000,32224=>1000,32225=>1000,32226=>1000,32227=>1000,32228=>1000, - 32229=>1000,32230=>1000,32231=>1000,32232=>1000,32233=>1000,32234=>1000,32235=>1000,32236=>1000,32237=>1000,32238=>1000,32239=>1000,32240=>1000,32241=>1000,32242=>1000,32243=>1000,32244=>1000, - 32245=>1000,32246=>1000,32247=>1000,32248=>1000,32249=>1000,32250=>1000,32251=>1000,32252=>1000,32253=>1000,32254=>1000,32255=>1000,32256=>1000,32257=>1000,32258=>1000,32259=>1000,32260=>1000, - 32261=>1000,32262=>1000,32263=>1000,32264=>1000,32265=>1000,32266=>1000,32267=>1000,32268=>1000,32269=>1000,32270=>1000,32271=>1000,32272=>1000,32273=>1000,32274=>1000,32275=>1000,32276=>1000, - 32277=>1000,32278=>1000,32279=>1000,32280=>1000,32281=>1000,32282=>1000,32283=>1000,32284=>1000,32285=>1000,32286=>1000,32287=>1000,32288=>1000,32289=>1000,32290=>1000,32291=>1000,32292=>1000, - 32293=>1000,32294=>1000,32295=>1000,32296=>1000,32297=>1000,32298=>1000,32299=>1000,32300=>1000,32301=>1000,32302=>1000,32303=>1000,32304=>1000,32305=>1000,32306=>1000,32307=>1000,32308=>1000, - 32309=>1000,32310=>1000,32311=>1000,32312=>1000,32313=>1000,32314=>1000,32315=>1000,32316=>1000,32317=>1000,32318=>1000,32319=>1000,32320=>1000,32321=>1000,32322=>1000,32323=>1000,32324=>1000, - 32325=>1000,32326=>1000,32327=>1000,32328=>1000,32329=>1000,32330=>1000,32331=>1000,32332=>1000,32333=>1000,32334=>1000,32335=>1000,32336=>1000,32337=>1000,32338=>1000,32339=>1000,32340=>1000, - 32341=>1000,32342=>1000,32343=>1000,32344=>1000,32345=>1000,32346=>1000,32347=>1000,32348=>1000,32349=>1000,32350=>1000,32351=>1000,32352=>1000,32353=>1000,32354=>1000,32355=>1000,32356=>1000, - 32357=>1000,32358=>1000,32359=>1000,32360=>1000,32361=>1000,32362=>1000,32363=>1000,32364=>1000,32365=>1000,32366=>1000,32367=>1000,32368=>1000,32369=>1000,32370=>1000,32371=>1000,32372=>1000, - 32373=>1000,32374=>1000,32375=>1000,32376=>1000,32377=>1000,32378=>1000,32379=>1000,32380=>1000,32381=>1000,32382=>1000,32383=>1000,32384=>1000,32385=>1000,32386=>1000,32387=>1000,32388=>1000, - 32389=>1000,32390=>1000,32391=>1000,32392=>1000,32393=>1000,32394=>1000,32395=>1000,32396=>1000,32397=>1000,32398=>1000,32399=>1000,32400=>1000,32401=>1000,32402=>1000,32403=>1000,32404=>1000, - 32405=>1000,32406=>1000,32407=>1000,32408=>1000,32409=>1000,32410=>1000,32411=>1000,32412=>1000,32413=>1000,32414=>1000,32415=>1000,32416=>1000,32417=>1000,32418=>1000,32419=>1000,32420=>1000, - 32421=>1000,32422=>1000,32423=>1000,32424=>1000,32425=>1000,32426=>1000,32427=>1000,32428=>1000,32429=>1000,32430=>1000,32431=>1000,32432=>1000,32433=>1000,32434=>1000,32435=>1000,32436=>1000, - 32437=>1000,32438=>1000,32439=>1000,32440=>1000,32441=>1000,32442=>1000,32443=>1000,32444=>1000,32445=>1000,32446=>1000,32447=>1000,32448=>1000,32449=>1000,32450=>1000,32451=>1000,32452=>1000, - 32453=>1000,32454=>1000,32455=>1000,32456=>1000,32457=>1000,32458=>1000,32459=>1000,32460=>1000,32461=>1000,32462=>1000,32463=>1000,32464=>1000,32465=>1000,32466=>1000,32467=>1000,32468=>1000, - 32469=>1000,32470=>1000,32471=>1000,32472=>1000,32473=>1000,32474=>1000,32475=>1000,32476=>1000,32477=>1000,32478=>1000,32479=>1000,32480=>1000,32481=>1000,32482=>1000,32483=>1000,32484=>1000, - 32485=>1000,32486=>1000,32487=>1000,32488=>1000,32489=>1000,32490=>1000,32491=>1000,32492=>1000,32493=>1000,32494=>1000,32495=>1000,32496=>1000,32497=>1000,32498=>1000,32499=>1000,32500=>1000, - 32501=>1000,32502=>1000,32503=>1000,32504=>1000,32505=>1000,32506=>1000,32507=>1000,32508=>1000,32509=>1000,32510=>1000,32511=>1000,32512=>1000,32513=>1000,32514=>1000,32515=>1000,32516=>1000, - 32517=>1000,32518=>1000,32519=>1000,32520=>1000,32521=>1000,32522=>1000,32523=>1000,32524=>1000,32525=>1000,32526=>1000,32527=>1000,32528=>1000,32529=>1000,32530=>1000,32531=>1000,32532=>1000, - 32533=>1000,32534=>1000,32535=>1000,32536=>1000,32537=>1000,32538=>1000,32539=>1000,32540=>1000,32541=>1000,32542=>1000,32543=>1000,32544=>1000,32545=>1000,32546=>1000,32547=>1000,32548=>1000, - 32549=>1000,32550=>1000,32551=>1000,32552=>1000,32553=>1000,32554=>1000,32555=>1000,32556=>1000,32557=>1000,32558=>1000,32559=>1000,32560=>1000,32561=>1000,32562=>1000,32563=>1000,32564=>1000, - 32565=>1000,32566=>1000,32567=>1000,32568=>1000,32569=>1000,32570=>1000,32571=>1000,32572=>1000,32573=>1000,32574=>1000,32575=>1000,32576=>1000,32577=>1000,32578=>1000,32579=>1000,32580=>1000, - 32581=>1000,32582=>1000,32583=>1000,32584=>1000,32585=>1000,32586=>1000,32587=>1000,32588=>1000,32589=>1000,32590=>1000,32591=>1000,32592=>1000,32593=>1000,32594=>1000,32595=>1000,32596=>1000, - 32597=>1000,32598=>1000,32599=>1000,32600=>1000,32601=>1000,32602=>1000,32603=>1000,32604=>1000,32605=>1000,32606=>1000,32607=>1000,32608=>1000,32609=>1000,32610=>1000,32611=>1000,32612=>1000, - 32613=>1000,32614=>1000,32615=>1000,32616=>1000,32617=>1000,32618=>1000,32619=>1000,32620=>1000,32621=>1000,32622=>1000,32623=>1000,32624=>1000,32625=>1000,32626=>1000,32627=>1000,32628=>1000, - 32629=>1000,32630=>1000,32631=>1000,32632=>1000,32633=>1000,32634=>1000,32635=>1000,32636=>1000,32637=>1000,32638=>1000,32639=>1000,32640=>1000,32641=>1000,32642=>1000,32643=>1000,32644=>1000, - 32645=>1000,32646=>1000,32647=>1000,32648=>1000,32649=>1000,32650=>1000,32651=>1000,32652=>1000,32653=>1000,32654=>1000,32655=>1000,32656=>1000,32657=>1000,32658=>1000,32659=>1000,32660=>1000, - 32661=>1000,32662=>1000,32663=>1000,32664=>1000,32665=>1000,32666=>1000,32667=>1000,32668=>1000,32669=>1000,32670=>1000,32671=>1000,32672=>1000,32673=>1000,32674=>1000,32675=>1000,32676=>1000, - 32677=>1000,32678=>1000,32679=>1000,32680=>1000,32681=>1000,32682=>1000,32683=>1000,32684=>1000,32685=>1000,32686=>1000,32687=>1000,32688=>1000,32689=>1000,32690=>1000,32691=>1000,32692=>1000, - 32693=>1000,32694=>1000,32695=>1000,32696=>1000,32697=>1000,32698=>1000,32699=>1000,32700=>1000,32701=>1000,32702=>1000,32703=>1000,32704=>1000,32705=>1000,32706=>1000,32707=>1000,32708=>1000, - 32709=>1000,32710=>1000,32711=>1000,32712=>1000,32713=>1000,32714=>1000,32715=>1000,32716=>1000,32717=>1000,32718=>1000,32719=>1000,32720=>1000,32721=>1000,32722=>1000,32723=>1000,32724=>1000, - 32725=>1000,32726=>1000,32727=>1000,32728=>1000,32729=>1000,32730=>1000,32731=>1000,32732=>1000,32733=>1000,32734=>1000,32735=>1000,32736=>1000,32737=>1000,32738=>1000,32739=>1000,32740=>1000, - 32741=>1000,32742=>1000,32743=>1000,32744=>1000,32745=>1000,32746=>1000,32747=>1000,32748=>1000,32749=>1000,32750=>1000,32751=>1000,32752=>1000,32753=>1000,32754=>1000,32755=>1000,32756=>1000, - 32757=>1000,32758=>1000,32759=>1000,32760=>1000,32761=>1000,32762=>1000,32763=>1000,32764=>1000,32765=>1000,32766=>1000,32767=>1000,32768=>1000,32769=>1000,32770=>1000,32771=>1000,32772=>1000, - 32773=>1000,32774=>1000,32775=>1000,32776=>1000,32777=>1000,32778=>1000,32779=>1000,32780=>1000,32781=>1000,32782=>1000,32783=>1000,32784=>1000,32785=>1000,32786=>1000,32787=>1000,32788=>1000, - 32789=>1000,32790=>1000,32791=>1000,32792=>1000,32793=>1000,32794=>1000,32795=>1000,32796=>1000,32797=>1000,32798=>1000,32799=>1000,32800=>1000,32801=>1000,32802=>1000,32803=>1000,32804=>1000, - 32805=>1000,32806=>1000,32807=>1000,32808=>1000,32809=>1000,32810=>1000,32811=>1000,32812=>1000,32813=>1000,32814=>1000,32815=>1000,32816=>1000,32817=>1000,32818=>1000,32819=>1000,32820=>1000, - 32821=>1000,32822=>1000,32823=>1000,32824=>1000,32825=>1000,32826=>1000,32827=>1000,32828=>1000,32829=>1000,32830=>1000,32831=>1000,32832=>1000,32833=>1000,32834=>1000,32835=>1000,32836=>1000, - 32837=>1000,32838=>1000,32839=>1000,32840=>1000,32841=>1000,32842=>1000,32843=>1000,32844=>1000,32845=>1000,32846=>1000,32847=>1000,32848=>1000,32849=>1000,32850=>1000,32851=>1000,32852=>1000, - 32853=>1000,32854=>1000,32855=>1000,32856=>1000,32857=>1000,32858=>1000,32859=>1000,32860=>1000,32861=>1000,32862=>1000,32863=>1000,32864=>1000,32865=>1000,32866=>1000,32867=>1000,32868=>1000, - 32869=>1000,32870=>1000,32871=>1000,32872=>1000,32873=>1000,32874=>1000,32875=>1000,32876=>1000,32877=>1000,32878=>1000,32879=>1000,32880=>1000,32881=>1000,32882=>1000,32883=>1000,32884=>1000, - 32885=>1000,32886=>1000,32887=>1000,32888=>1000,32889=>1000,32890=>1000,32891=>1000,32892=>1000,32893=>1000,32894=>1000,32895=>1000,32896=>1000,32897=>1000,32898=>1000,32899=>1000,32900=>1000, - 32901=>1000,32902=>1000,32903=>1000,32904=>1000,32905=>1000,32906=>1000,32907=>1000,32908=>1000,32909=>1000,32910=>1000,32911=>1000,32912=>1000,32913=>1000,32914=>1000,32915=>1000,32916=>1000, - 32917=>1000,32918=>1000,32919=>1000,32920=>1000,32921=>1000,32922=>1000,32923=>1000,32924=>1000,32925=>1000,32926=>1000,32927=>1000,32928=>1000,32929=>1000,32930=>1000,32931=>1000,32932=>1000, - 32933=>1000,32934=>1000,32935=>1000,32936=>1000,32937=>1000,32938=>1000,32939=>1000,32940=>1000,32941=>1000,32942=>1000,32943=>1000,32944=>1000,32945=>1000,32946=>1000,32947=>1000,32948=>1000, - 32949=>1000,32950=>1000,32951=>1000,32952=>1000,32953=>1000,32954=>1000,32955=>1000,32956=>1000,32957=>1000,32958=>1000,32959=>1000,32960=>1000,32961=>1000,32962=>1000,32963=>1000,32964=>1000, - 32965=>1000,32966=>1000,32967=>1000,32968=>1000,32969=>1000,32970=>1000,32971=>1000,32972=>1000,32973=>1000,32974=>1000,32975=>1000,32976=>1000,32977=>1000,32978=>1000,32979=>1000,32980=>1000, - 32981=>1000,32982=>1000,32983=>1000,32984=>1000,32985=>1000,32986=>1000,32987=>1000,32988=>1000,32989=>1000,32990=>1000,32991=>1000,32992=>1000,32993=>1000,32994=>1000,32995=>1000,32996=>1000, - 32997=>1000,32998=>1000,32999=>1000,33000=>1000,33001=>1000,33002=>1000,33003=>1000,33004=>1000,33005=>1000,33006=>1000,33007=>1000,33008=>1000,33009=>1000,33010=>1000,33011=>1000,33012=>1000, - 33013=>1000,33014=>1000,33015=>1000,33016=>1000,33017=>1000,33018=>1000,33019=>1000,33020=>1000,33021=>1000,33022=>1000,33023=>1000,33024=>1000,33025=>1000,33026=>1000,33027=>1000,33028=>1000, - 33029=>1000,33030=>1000,33031=>1000,33032=>1000,33033=>1000,33034=>1000,33035=>1000,33036=>1000,33037=>1000,33038=>1000,33039=>1000,33040=>1000,33041=>1000,33042=>1000,33043=>1000,33044=>1000, - 33045=>1000,33046=>1000,33047=>1000,33048=>1000,33049=>1000,33050=>1000,33051=>1000,33052=>1000,33053=>1000,33054=>1000,33055=>1000,33056=>1000,33057=>1000,33058=>1000,33059=>1000,33060=>1000, - 33061=>1000,33062=>1000,33063=>1000,33064=>1000,33065=>1000,33066=>1000,33067=>1000,33068=>1000,33069=>1000,33070=>1000,33071=>1000,33072=>1000,33073=>1000,33074=>1000,33075=>1000,33076=>1000, - 33077=>1000,33078=>1000,33079=>1000,33080=>1000,33081=>1000,33082=>1000,33083=>1000,33084=>1000,33085=>1000,33086=>1000,33087=>1000,33088=>1000,33089=>1000,33090=>1000,33091=>1000,33092=>1000, - 33093=>1000,33094=>1000,33095=>1000,33096=>1000,33097=>1000,33098=>1000,33099=>1000,33100=>1000,33101=>1000,33102=>1000,33103=>1000,33104=>1000,33105=>1000,33106=>1000,33107=>1000,33108=>1000, - 33109=>1000,33110=>1000,33111=>1000,33112=>1000,33113=>1000,33114=>1000,33115=>1000,33116=>1000,33117=>1000,33118=>1000,33119=>1000,33120=>1000,33121=>1000,33122=>1000,33123=>1000,33124=>1000, - 33125=>1000,33126=>1000,33127=>1000,33128=>1000,33129=>1000,33130=>1000,33131=>1000,33132=>1000,33133=>1000,33134=>1000,33135=>1000,33136=>1000,33137=>1000,33138=>1000,33139=>1000,33140=>1000, - 33141=>1000,33142=>1000,33143=>1000,33144=>1000,33145=>1000,33146=>1000,33147=>1000,33148=>1000,33149=>1000,33150=>1000,33151=>1000,33152=>1000,33153=>1000,33154=>1000,33155=>1000,33156=>1000, - 33157=>1000,33158=>1000,33159=>1000,33160=>1000,33161=>1000,33162=>1000,33163=>1000,33164=>1000,33165=>1000,33166=>1000,33167=>1000,33168=>1000,33169=>1000,33170=>1000,33171=>1000,33172=>1000, - 33173=>1000,33174=>1000,33175=>1000,33176=>1000,33177=>1000,33178=>1000,33179=>1000,33180=>1000,33181=>1000,33182=>1000,33183=>1000,33184=>1000,33185=>1000,33186=>1000,33187=>1000,33188=>1000, - 33189=>1000,33190=>1000,33191=>1000,33192=>1000,33193=>1000,33194=>1000,33195=>1000,33196=>1000,33197=>1000,33198=>1000,33199=>1000,33200=>1000,33201=>1000,33202=>1000,33203=>1000,33204=>1000, - 33205=>1000,33206=>1000,33207=>1000,33208=>1000,33209=>1000,33210=>1000,33211=>1000,33212=>1000,33213=>1000,33214=>1000,33215=>1000,33216=>1000,33217=>1000,33218=>1000,33219=>1000,33220=>1000, - 33221=>1000,33222=>1000,33223=>1000,33224=>1000,33225=>1000,33226=>1000,33227=>1000,33228=>1000,33229=>1000,33230=>1000,33231=>1000,33232=>1000,33233=>1000,33234=>1000,33235=>1000,33236=>1000, - 33237=>1000,33238=>1000,33239=>1000,33240=>1000,33241=>1000,33242=>1000,33243=>1000,33244=>1000,33245=>1000,33246=>1000,33247=>1000,33248=>1000,33249=>1000,33250=>1000,33251=>1000,33252=>1000, - 33253=>1000,33254=>1000,33255=>1000,33256=>1000,33257=>1000,33258=>1000,33259=>1000,33260=>1000,33261=>1000,33262=>1000,33263=>1000,33264=>1000,33265=>1000,33266=>1000,33267=>1000,33268=>1000, - 33269=>1000,33270=>1000,33271=>1000,33272=>1000,33273=>1000,33274=>1000,33275=>1000,33276=>1000,33277=>1000,33278=>1000,33279=>1000,33280=>1000,33281=>1000,33282=>1000,33283=>1000,33284=>1000, - 33285=>1000,33286=>1000,33287=>1000,33288=>1000,33289=>1000,33290=>1000,33291=>1000,33292=>1000,33293=>1000,33294=>1000,33295=>1000,33296=>1000,33297=>1000,33298=>1000,33299=>1000,33300=>1000, - 33301=>1000,33302=>1000,33303=>1000,33304=>1000,33305=>1000,33306=>1000,33307=>1000,33308=>1000,33309=>1000,33310=>1000,33311=>1000,33312=>1000,33313=>1000,33314=>1000,33315=>1000,33316=>1000, - 33317=>1000,33318=>1000,33319=>1000,33320=>1000,33321=>1000,33322=>1000,33323=>1000,33324=>1000,33325=>1000,33326=>1000,33327=>1000,33328=>1000,33329=>1000,33330=>1000,33331=>1000,33332=>1000, - 33333=>1000,33334=>1000,33335=>1000,33336=>1000,33337=>1000,33338=>1000,33339=>1000,33340=>1000,33341=>1000,33342=>1000,33343=>1000,33344=>1000,33345=>1000,33346=>1000,33347=>1000,33348=>1000, - 33349=>1000,33350=>1000,33351=>1000,33352=>1000,33353=>1000,33354=>1000,33355=>1000,33356=>1000,33357=>1000,33358=>1000,33359=>1000,33360=>1000,33361=>1000,33362=>1000,33363=>1000,33364=>1000, - 33365=>1000,33366=>1000,33367=>1000,33368=>1000,33369=>1000,33370=>1000,33371=>1000,33372=>1000,33373=>1000,33374=>1000,33375=>1000,33376=>1000,33377=>1000,33378=>1000,33379=>1000,33380=>1000, - 33381=>1000,33382=>1000,33383=>1000,33384=>1000,33385=>1000,33386=>1000,33387=>1000,33388=>1000,33389=>1000,33390=>1000,33391=>1000,33392=>1000,33393=>1000,33394=>1000,33395=>1000,33396=>1000, - 33397=>1000,33398=>1000,33399=>1000,33400=>1000,33401=>1000,33402=>1000,33403=>1000,33404=>1000,33405=>1000,33406=>1000,33407=>1000,33408=>1000,33409=>1000,33410=>1000,33411=>1000,33412=>1000, - 33413=>1000,33414=>1000,33415=>1000,33416=>1000,33417=>1000,33418=>1000,33419=>1000,33420=>1000,33421=>1000,33422=>1000,33423=>1000,33424=>1000,33425=>1000,33426=>1000,33427=>1000,33428=>1000, - 33429=>1000,33430=>1000,33431=>1000,33432=>1000,33433=>1000,33434=>1000,33435=>1000,33436=>1000,33437=>1000,33438=>1000,33439=>1000,33440=>1000,33441=>1000,33442=>1000,33443=>1000,33444=>1000, - 33445=>1000,33446=>1000,33447=>1000,33448=>1000,33449=>1000,33450=>1000,33451=>1000,33452=>1000,33453=>1000,33454=>1000,33455=>1000,33456=>1000,33457=>1000,33458=>1000,33459=>1000,33460=>1000, - 33461=>1000,33462=>1000,33463=>1000,33464=>1000,33465=>1000,33466=>1000,33467=>1000,33468=>1000,33469=>1000,33470=>1000,33471=>1000,33472=>1000,33473=>1000,33474=>1000,33475=>1000,33476=>1000, - 33477=>1000,33478=>1000,33479=>1000,33480=>1000,33481=>1000,33482=>1000,33483=>1000,33484=>1000,33485=>1000,33486=>1000,33487=>1000,33488=>1000,33489=>1000,33490=>1000,33491=>1000,33492=>1000, - 33493=>1000,33494=>1000,33495=>1000,33496=>1000,33497=>1000,33498=>1000,33499=>1000,33500=>1000,33501=>1000,33502=>1000,33503=>1000,33504=>1000,33505=>1000,33506=>1000,33507=>1000,33508=>1000, - 33509=>1000,33510=>1000,33511=>1000,33512=>1000,33513=>1000,33514=>1000,33515=>1000,33516=>1000,33517=>1000,33518=>1000,33519=>1000,33520=>1000,33521=>1000,33522=>1000,33523=>1000,33524=>1000, - 33525=>1000,33526=>1000,33527=>1000,33528=>1000,33529=>1000,33530=>1000,33531=>1000,33532=>1000,33533=>1000,33534=>1000,33535=>1000,33536=>1000,33537=>1000,33538=>1000,33539=>1000,33540=>1000, - 33541=>1000,33542=>1000,33543=>1000,33544=>1000,33545=>1000,33546=>1000,33547=>1000,33548=>1000,33549=>1000,33550=>1000,33551=>1000,33552=>1000,33553=>1000,33554=>1000,33555=>1000,33556=>1000, - 33557=>1000,33558=>1000,33559=>1000,33560=>1000,33561=>1000,33562=>1000,33563=>1000,33564=>1000,33565=>1000,33566=>1000,33567=>1000,33568=>1000,33569=>1000,33570=>1000,33571=>1000,33572=>1000, - 33573=>1000,33574=>1000,33575=>1000,33576=>1000,33577=>1000,33578=>1000,33579=>1000,33580=>1000,33581=>1000,33582=>1000,33583=>1000,33584=>1000,33585=>1000,33586=>1000,33587=>1000,33588=>1000, - 33589=>1000,33590=>1000,33591=>1000,33592=>1000,33593=>1000,33594=>1000,33595=>1000,33596=>1000,33597=>1000,33598=>1000,33599=>1000,33600=>1000,33601=>1000,33602=>1000,33603=>1000,33604=>1000, - 33605=>1000,33606=>1000,33607=>1000,33608=>1000,33609=>1000,33610=>1000,33611=>1000,33612=>1000,33613=>1000,33614=>1000,33615=>1000,33616=>1000,33617=>1000,33618=>1000,33619=>1000,33620=>1000, - 33621=>1000,33622=>1000,33623=>1000,33624=>1000,33625=>1000,33626=>1000,33627=>1000,33628=>1000,33629=>1000,33630=>1000,33631=>1000,33632=>1000,33633=>1000,33634=>1000,33635=>1000,33636=>1000, - 33637=>1000,33638=>1000,33639=>1000,33640=>1000,33641=>1000,33642=>1000,33643=>1000,33644=>1000,33645=>1000,33646=>1000,33647=>1000,33648=>1000,33649=>1000,33650=>1000,33651=>1000,33652=>1000, - 33653=>1000,33654=>1000,33655=>1000,33656=>1000,33657=>1000,33658=>1000,33659=>1000,33660=>1000,33661=>1000,33662=>1000,33663=>1000,33664=>1000,33665=>1000,33666=>1000,33667=>1000,33668=>1000, - 33669=>1000,33670=>1000,33671=>1000,33672=>1000,33673=>1000,33674=>1000,33675=>1000,33676=>1000,33677=>1000,33678=>1000,33679=>1000,33680=>1000,33681=>1000,33682=>1000,33683=>1000,33684=>1000, - 33685=>1000,33686=>1000,33687=>1000,33688=>1000,33689=>1000,33690=>1000,33691=>1000,33692=>1000,33693=>1000,33694=>1000,33695=>1000,33696=>1000,33697=>1000,33698=>1000,33699=>1000,33700=>1000, - 33701=>1000,33702=>1000,33703=>1000,33704=>1000,33705=>1000,33706=>1000,33707=>1000,33708=>1000,33709=>1000,33710=>1000,33711=>1000,33712=>1000,33713=>1000,33714=>1000,33715=>1000,33716=>1000, - 33717=>1000,33718=>1000,33719=>1000,33720=>1000,33721=>1000,33722=>1000,33723=>1000,33724=>1000,33725=>1000,33726=>1000,33727=>1000,33728=>1000,33729=>1000,33730=>1000,33731=>1000,33732=>1000, - 33733=>1000,33734=>1000,33735=>1000,33736=>1000,33737=>1000,33738=>1000,33739=>1000,33740=>1000,33741=>1000,33742=>1000,33743=>1000,33744=>1000,33745=>1000,33746=>1000,33747=>1000,33748=>1000, - 33749=>1000,33750=>1000,33751=>1000,33752=>1000,33753=>1000,33754=>1000,33755=>1000,33756=>1000,33757=>1000,33758=>1000,33759=>1000,33760=>1000,33761=>1000,33762=>1000,33763=>1000,33764=>1000, - 33765=>1000,33766=>1000,33767=>1000,33768=>1000,33769=>1000,33770=>1000,33771=>1000,33772=>1000,33773=>1000,33774=>1000,33775=>1000,33776=>1000,33777=>1000,33778=>1000,33779=>1000,33780=>1000, - 33781=>1000,33782=>1000,33783=>1000,33784=>1000,33785=>1000,33786=>1000,33787=>1000,33788=>1000,33789=>1000,33790=>1000,33791=>1000,33792=>1000,33793=>1000,33794=>1000,33795=>1000,33796=>1000, - 33797=>1000,33798=>1000,33799=>1000,33800=>1000,33801=>1000,33802=>1000,33803=>1000,33804=>1000,33805=>1000,33806=>1000,33807=>1000,33808=>1000,33809=>1000,33810=>1000,33811=>1000,33812=>1000, - 33813=>1000,33814=>1000,33815=>1000,33816=>1000,33817=>1000,33818=>1000,33819=>1000,33820=>1000,33821=>1000,33822=>1000,33823=>1000,33824=>1000,33825=>1000,33826=>1000,33827=>1000,33828=>1000, - 33829=>1000,33830=>1000,33831=>1000,33832=>1000,33833=>1000,33834=>1000,33835=>1000,33836=>1000,33837=>1000,33838=>1000,33839=>1000,33840=>1000,33841=>1000,33842=>1000,33843=>1000,33844=>1000, - 33845=>1000,33846=>1000,33847=>1000,33848=>1000,33849=>1000,33850=>1000,33851=>1000,33852=>1000,33853=>1000,33854=>1000,33855=>1000,33856=>1000,33857=>1000,33858=>1000,33859=>1000,33860=>1000, - 33861=>1000,33862=>1000,33863=>1000,33864=>1000,33865=>1000,33866=>1000,33867=>1000,33868=>1000,33869=>1000,33870=>1000,33871=>1000,33872=>1000,33873=>1000,33874=>1000,33875=>1000,33876=>1000, - 33877=>1000,33878=>1000,33879=>1000,33880=>1000,33881=>1000,33882=>1000,33883=>1000,33884=>1000,33885=>1000,33886=>1000,33887=>1000,33888=>1000,33889=>1000,33890=>1000,33891=>1000,33892=>1000, - 33893=>1000,33894=>1000,33895=>1000,33896=>1000,33897=>1000,33898=>1000,33899=>1000,33900=>1000,33901=>1000,33902=>1000,33903=>1000,33904=>1000,33905=>1000,33906=>1000,33907=>1000,33908=>1000, - 33909=>1000,33910=>1000,33911=>1000,33912=>1000,33913=>1000,33914=>1000,33915=>1000,33916=>1000,33917=>1000,33918=>1000,33919=>1000,33920=>1000,33921=>1000,33922=>1000,33923=>1000,33924=>1000, - 33925=>1000,33926=>1000,33927=>1000,33928=>1000,33929=>1000,33930=>1000,33931=>1000,33932=>1000,33933=>1000,33934=>1000,33935=>1000,33936=>1000,33937=>1000,33938=>1000,33939=>1000,33940=>1000, - 33941=>1000,33942=>1000,33943=>1000,33944=>1000,33945=>1000,33946=>1000,33947=>1000,33948=>1000,33949=>1000,33950=>1000,33951=>1000,33952=>1000,33953=>1000,33954=>1000,33955=>1000,33956=>1000, - 33957=>1000,33958=>1000,33959=>1000,33960=>1000,33961=>1000,33962=>1000,33963=>1000,33964=>1000,33965=>1000,33966=>1000,33967=>1000,33968=>1000,33969=>1000,33970=>1000,33971=>1000,33972=>1000, - 33973=>1000,33974=>1000,33975=>1000,33976=>1000,33977=>1000,33978=>1000,33979=>1000,33980=>1000,33981=>1000,33982=>1000,33983=>1000,33984=>1000,33985=>1000,33986=>1000,33987=>1000,33988=>1000, - 33989=>1000,33990=>1000,33991=>1000,33992=>1000,33993=>1000,33994=>1000,33995=>1000,33996=>1000,33997=>1000,33998=>1000,33999=>1000,34000=>1000,34001=>1000,34002=>1000,34003=>1000,34004=>1000, - 34005=>1000,34006=>1000,34007=>1000,34008=>1000,34009=>1000,34010=>1000,34011=>1000,34012=>1000,34013=>1000,34014=>1000,34015=>1000,34016=>1000,34017=>1000,34018=>1000,34019=>1000,34020=>1000, - 34021=>1000,34022=>1000,34023=>1000,34024=>1000,34025=>1000,34026=>1000,34027=>1000,34028=>1000,34029=>1000,34030=>1000,34031=>1000,34032=>1000,34033=>1000,34034=>1000,34035=>1000,34036=>1000, - 34037=>1000,34038=>1000,34039=>1000,34040=>1000,34041=>1000,34042=>1000,34043=>1000,34044=>1000,34045=>1000,34046=>1000,34047=>1000,34048=>1000,34049=>1000,34050=>1000,34051=>1000,34052=>1000, - 34053=>1000,34054=>1000,34055=>1000,34056=>1000,34057=>1000,34058=>1000,34059=>1000,34060=>1000,34061=>1000,34062=>1000,34063=>1000,34064=>1000,34065=>1000,34066=>1000,34067=>1000,34068=>1000, - 34069=>1000,34070=>1000,34071=>1000,34072=>1000,34073=>1000,34074=>1000,34075=>1000,34076=>1000,34077=>1000,34078=>1000,34079=>1000,34080=>1000,34081=>1000,34082=>1000,34083=>1000,34084=>1000, - 34085=>1000,34086=>1000,34087=>1000,34088=>1000,34089=>1000,34090=>1000,34091=>1000,34092=>1000,34093=>1000,34094=>1000,34095=>1000,34096=>1000,34097=>1000,34098=>1000,34099=>1000,34100=>1000, - 34101=>1000,34102=>1000,34103=>1000,34104=>1000,34105=>1000,34106=>1000,34107=>1000,34108=>1000,34109=>1000,34110=>1000,34111=>1000,34112=>1000,34113=>1000,34114=>1000,34115=>1000,34116=>1000, - 34117=>1000,34118=>1000,34119=>1000,34120=>1000,34121=>1000,34122=>1000,34123=>1000,34124=>1000,34125=>1000,34126=>1000,34127=>1000,34128=>1000,34129=>1000,34130=>1000,34131=>1000,34132=>1000, - 34133=>1000,34134=>1000,34135=>1000,34136=>1000,34137=>1000,34138=>1000,34139=>1000,34140=>1000,34141=>1000,34142=>1000,34143=>1000,34144=>1000,34145=>1000,34146=>1000,34147=>1000,34148=>1000, - 34149=>1000,34150=>1000,34151=>1000,34152=>1000,34153=>1000,34154=>1000,34155=>1000,34156=>1000,34157=>1000,34158=>1000,34159=>1000,34160=>1000,34161=>1000,34162=>1000,34163=>1000,34164=>1000, - 34165=>1000,34166=>1000,34167=>1000,34168=>1000,34169=>1000,34170=>1000,34171=>1000,34172=>1000,34173=>1000,34174=>1000,34175=>1000,34176=>1000,34177=>1000,34178=>1000,34179=>1000,34180=>1000, - 34181=>1000,34182=>1000,34183=>1000,34184=>1000,34185=>1000,34186=>1000,34187=>1000,34188=>1000,34189=>1000,34190=>1000,34191=>1000,34192=>1000,34193=>1000,34194=>1000,34195=>1000,34196=>1000, - 34197=>1000,34198=>1000,34199=>1000,34200=>1000,34201=>1000,34202=>1000,34203=>1000,34204=>1000,34205=>1000,34206=>1000,34207=>1000,34208=>1000,34209=>1000,34210=>1000,34211=>1000,34212=>1000, - 34213=>1000,34214=>1000,34215=>1000,34216=>1000,34217=>1000,34218=>1000,34219=>1000,34220=>1000,34221=>1000,34222=>1000,34223=>1000,34224=>1000,34225=>1000,34226=>1000,34227=>1000,34228=>1000, - 34229=>1000,34230=>1000,34231=>1000,34232=>1000,34233=>1000,34234=>1000,34235=>1000,34236=>1000,34237=>1000,34238=>1000,34239=>1000,34240=>1000,34241=>1000,34242=>1000,34243=>1000,34244=>1000, - 34245=>1000,34246=>1000,34247=>1000,34248=>1000,34249=>1000,34250=>1000,34251=>1000,34252=>1000,34253=>1000,34254=>1000,34255=>1000,34256=>1000,34257=>1000,34258=>1000,34259=>1000,34260=>1000, - 34261=>1000,34262=>1000,34263=>1000,34264=>1000,34265=>1000,34266=>1000,34267=>1000,34268=>1000,34269=>1000,34270=>1000,34271=>1000,34272=>1000,34273=>1000,34274=>1000,34275=>1000,34276=>1000, - 34277=>1000,34278=>1000,34279=>1000,34280=>1000,34281=>1000,34282=>1000,34283=>1000,34284=>1000,34285=>1000,34286=>1000,34287=>1000,34288=>1000,34289=>1000,34290=>1000,34291=>1000,34292=>1000, - 34293=>1000,34294=>1000,34295=>1000,34296=>1000,34297=>1000,34298=>1000,34299=>1000,34300=>1000,34301=>1000,34302=>1000,34303=>1000,34304=>1000,34305=>1000,34306=>1000,34307=>1000,34308=>1000, - 34309=>1000,34310=>1000,34311=>1000,34312=>1000,34313=>1000,34314=>1000,34315=>1000,34316=>1000,34317=>1000,34318=>1000,34319=>1000,34320=>1000,34321=>1000,34322=>1000,34323=>1000,34324=>1000, - 34325=>1000,34326=>1000,34327=>1000,34328=>1000,34329=>1000,34330=>1000,34331=>1000,34332=>1000,34333=>1000,34334=>1000,34335=>1000,34336=>1000,34337=>1000,34338=>1000,34339=>1000,34340=>1000, - 34341=>1000,34342=>1000,34343=>1000,34344=>1000,34345=>1000,34346=>1000,34347=>1000,34348=>1000,34349=>1000,34350=>1000,34351=>1000,34352=>1000,34353=>1000,34354=>1000,34355=>1000,34356=>1000, - 34357=>1000,34358=>1000,34359=>1000,34360=>1000,34361=>1000,34362=>1000,34363=>1000,34364=>1000,34365=>1000,34366=>1000,34367=>1000,34368=>1000,34369=>1000,34370=>1000,34371=>1000,34372=>1000, - 34373=>1000,34374=>1000,34375=>1000,34376=>1000,34377=>1000,34378=>1000,34379=>1000,34380=>1000,34381=>1000,34382=>1000,34383=>1000,34384=>1000,34385=>1000,34386=>1000,34387=>1000,34388=>1000, - 34389=>1000,34390=>1000,34391=>1000,34392=>1000,34393=>1000,34394=>1000,34395=>1000,34396=>1000,34397=>1000,34398=>1000,34399=>1000,34400=>1000,34401=>1000,34402=>1000,34403=>1000,34404=>1000, - 34405=>1000,34406=>1000,34407=>1000,34408=>1000,34409=>1000,34410=>1000,34411=>1000,34412=>1000,34413=>1000,34414=>1000,34415=>1000,34416=>1000,34417=>1000,34418=>1000,34419=>1000,34420=>1000, - 34421=>1000,34422=>1000,34423=>1000,34424=>1000,34425=>1000,34426=>1000,34427=>1000,34428=>1000,34429=>1000,34430=>1000,34431=>1000,34432=>1000,34433=>1000,34434=>1000,34435=>1000,34436=>1000, - 34437=>1000,34438=>1000,34439=>1000,34440=>1000,34441=>1000,34442=>1000,34443=>1000,34444=>1000,34445=>1000,34446=>1000,34447=>1000,34448=>1000,34449=>1000,34450=>1000,34451=>1000,34452=>1000, - 34453=>1000,34454=>1000,34455=>1000,34456=>1000,34457=>1000,34458=>1000,34459=>1000,34460=>1000,34461=>1000,34462=>1000,34463=>1000,34464=>1000,34465=>1000,34466=>1000,34467=>1000,34468=>1000, - 34469=>1000,34470=>1000,34471=>1000,34472=>1000,34473=>1000,34474=>1000,34475=>1000,34476=>1000,34477=>1000,34478=>1000,34479=>1000,34480=>1000,34481=>1000,34482=>1000,34483=>1000,34484=>1000, - 34485=>1000,34486=>1000,34487=>1000,34488=>1000,34489=>1000,34490=>1000,34491=>1000,34492=>1000,34493=>1000,34494=>1000,34495=>1000,34496=>1000,34497=>1000,34498=>1000,34499=>1000,34500=>1000, - 34501=>1000,34502=>1000,34503=>1000,34504=>1000,34505=>1000,34506=>1000,34507=>1000,34508=>1000,34509=>1000,34510=>1000,34511=>1000,34512=>1000,34513=>1000,34514=>1000,34515=>1000,34516=>1000, - 34517=>1000,34518=>1000,34519=>1000,34520=>1000,34521=>1000,34522=>1000,34523=>1000,34524=>1000,34525=>1000,34526=>1000,34527=>1000,34528=>1000,34529=>1000,34530=>1000,34531=>1000,34532=>1000, - 34533=>1000,34534=>1000,34535=>1000,34536=>1000,34537=>1000,34538=>1000,34539=>1000,34540=>1000,34541=>1000,34542=>1000,34543=>1000,34544=>1000,34545=>1000,34546=>1000,34547=>1000,34548=>1000, - 34549=>1000,34550=>1000,34551=>1000,34552=>1000,34553=>1000,34554=>1000,34555=>1000,34556=>1000,34557=>1000,34558=>1000,34559=>1000,34560=>1000,34561=>1000,34562=>1000,34563=>1000,34564=>1000, - 34565=>1000,34566=>1000,34567=>1000,34568=>1000,34569=>1000,34570=>1000,34571=>1000,34572=>1000,34573=>1000,34574=>1000,34575=>1000,34576=>1000,34577=>1000,34578=>1000,34579=>1000,34580=>1000, - 34581=>1000,34582=>1000,34583=>1000,34584=>1000,34585=>1000,34586=>1000,34587=>1000,34588=>1000,34589=>1000,34590=>1000,34591=>1000,34592=>1000,34593=>1000,34594=>1000,34595=>1000,34596=>1000, - 34597=>1000,34598=>1000,34599=>1000,34600=>1000,34601=>1000,34602=>1000,34603=>1000,34604=>1000,34605=>1000,34606=>1000,34607=>1000,34608=>1000,34609=>1000,34610=>1000,34611=>1000,34612=>1000, - 34613=>1000,34614=>1000,34615=>1000,34616=>1000,34617=>1000,34618=>1000,34619=>1000,34620=>1000,34621=>1000,34622=>1000,34623=>1000,34624=>1000,34625=>1000,34626=>1000,34627=>1000,34628=>1000, - 34629=>1000,34630=>1000,34631=>1000,34632=>1000,34633=>1000,34634=>1000,34635=>1000,34636=>1000,34637=>1000,34638=>1000,34639=>1000,34640=>1000,34641=>1000,34642=>1000,34643=>1000,34644=>1000, - 34645=>1000,34646=>1000,34647=>1000,34648=>1000,34649=>1000,34650=>1000,34651=>1000,34652=>1000,34653=>1000,34654=>1000,34655=>1000,34656=>1000,34657=>1000,34658=>1000,34659=>1000,34660=>1000, - 34661=>1000,34662=>1000,34663=>1000,34664=>1000,34665=>1000,34666=>1000,34667=>1000,34668=>1000,34669=>1000,34670=>1000,34671=>1000,34672=>1000,34673=>1000,34674=>1000,34675=>1000,34676=>1000, - 34677=>1000,34678=>1000,34679=>1000,34680=>1000,34681=>1000,34682=>1000,34683=>1000,34684=>1000,34685=>1000,34686=>1000,34687=>1000,34688=>1000,34689=>1000,34690=>1000,34691=>1000,34692=>1000, - 34693=>1000,34694=>1000,34695=>1000,34696=>1000,34697=>1000,34698=>1000,34699=>1000,34700=>1000,34701=>1000,34702=>1000,34703=>1000,34704=>1000,34705=>1000,34706=>1000,34707=>1000,34708=>1000, - 34709=>1000,34710=>1000,34711=>1000,34712=>1000,34713=>1000,34714=>1000,34715=>1000,34716=>1000,34717=>1000,34718=>1000,34719=>1000,34720=>1000,34721=>1000,34722=>1000,34723=>1000,34724=>1000, - 34725=>1000,34726=>1000,34727=>1000,34728=>1000,34729=>1000,34730=>1000,34731=>1000,34732=>1000,34733=>1000,34734=>1000,34735=>1000,34736=>1000,34737=>1000,34738=>1000,34739=>1000,34740=>1000, - 34741=>1000,34742=>1000,34743=>1000,34744=>1000,34745=>1000,34746=>1000,34747=>1000,34748=>1000,34749=>1000,34750=>1000,34751=>1000,34752=>1000,34753=>1000,34754=>1000,34755=>1000,34756=>1000, - 34757=>1000,34758=>1000,34759=>1000,34760=>1000,34761=>1000,34762=>1000,34763=>1000,34764=>1000,34765=>1000,34766=>1000,34767=>1000,34768=>1000,34769=>1000,34770=>1000,34771=>1000,34772=>1000, - 34773=>1000,34774=>1000,34775=>1000,34776=>1000,34777=>1000,34778=>1000,34779=>1000,34780=>1000,34781=>1000,34782=>1000,34783=>1000,34784=>1000,34785=>1000,34786=>1000,34787=>1000,34788=>1000, - 34789=>1000,34790=>1000,34791=>1000,34792=>1000,34793=>1000,34794=>1000,34795=>1000,34796=>1000,34797=>1000,34798=>1000,34799=>1000,34800=>1000,34801=>1000,34802=>1000,34803=>1000,34804=>1000, - 34805=>1000,34806=>1000,34807=>1000,34808=>1000,34809=>1000,34810=>1000,34811=>1000,34812=>1000,34813=>1000,34814=>1000,34815=>1000,34816=>1000,34817=>1000,34818=>1000,34819=>1000,34820=>1000, - 34821=>1000,34822=>1000,34823=>1000,34824=>1000,34825=>1000,34826=>1000,34827=>1000,34828=>1000,34829=>1000,34830=>1000,34831=>1000,34832=>1000,34833=>1000,34834=>1000,34835=>1000,34836=>1000, - 34837=>1000,34838=>1000,34839=>1000,34840=>1000,34841=>1000,34842=>1000,34843=>1000,34844=>1000,34845=>1000,34846=>1000,34847=>1000,34848=>1000,34849=>1000,34850=>1000,34851=>1000,34852=>1000, - 34853=>1000,34854=>1000,34855=>1000,34856=>1000,34857=>1000,34858=>1000,34859=>1000,34860=>1000,34861=>1000,34862=>1000,34863=>1000,34864=>1000,34865=>1000,34866=>1000,34867=>1000,34868=>1000, - 34869=>1000,34870=>1000,34871=>1000,34872=>1000,34873=>1000,34874=>1000,34875=>1000,34876=>1000,34877=>1000,34878=>1000,34879=>1000,34880=>1000,34881=>1000,34882=>1000,34883=>1000,34884=>1000, - 34885=>1000,34886=>1000,34887=>1000,34888=>1000,34889=>1000,34890=>1000,34891=>1000,34892=>1000,34893=>1000,34894=>1000,34895=>1000,34896=>1000,34897=>1000,34898=>1000,34899=>1000,34900=>1000, - 34901=>1000,34902=>1000,34903=>1000,34904=>1000,34905=>1000,34906=>1000,34907=>1000,34908=>1000,34909=>1000,34910=>1000,34911=>1000,34912=>1000,34913=>1000,34914=>1000,34915=>1000,34916=>1000, - 34917=>1000,34918=>1000,34919=>1000,34920=>1000,34921=>1000,34922=>1000,34923=>1000,34924=>1000,34925=>1000,34926=>1000,34927=>1000,34928=>1000,34929=>1000,34930=>1000,34931=>1000,34932=>1000, - 34933=>1000,34934=>1000,34935=>1000,34936=>1000,34937=>1000,34938=>1000,34939=>1000,34940=>1000,34941=>1000,34942=>1000,34943=>1000,34944=>1000,34945=>1000,34946=>1000,34947=>1000,34948=>1000, - 34949=>1000,34950=>1000,34951=>1000,34952=>1000,34953=>1000,34954=>1000,34955=>1000,34956=>1000,34957=>1000,34958=>1000,34959=>1000,34960=>1000,34961=>1000,34962=>1000,34963=>1000,34964=>1000, - 34965=>1000,34966=>1000,34967=>1000,34968=>1000,34969=>1000,34970=>1000,34971=>1000,34972=>1000,34973=>1000,34974=>1000,34975=>1000,34976=>1000,34977=>1000,34978=>1000,34979=>1000,34980=>1000, - 34981=>1000,34982=>1000,34983=>1000,34984=>1000,34985=>1000,34986=>1000,34987=>1000,34988=>1000,34989=>1000,34990=>1000,34991=>1000,34992=>1000,34993=>1000,34994=>1000,34995=>1000,34996=>1000, - 34997=>1000,34998=>1000,34999=>1000,35000=>1000,35001=>1000,35002=>1000,35003=>1000,35004=>1000,35005=>1000,35006=>1000,35007=>1000,35008=>1000,35009=>1000,35010=>1000,35011=>1000,35012=>1000, - 35013=>1000,35014=>1000,35015=>1000,35016=>1000,35017=>1000,35018=>1000,35019=>1000,35020=>1000,35021=>1000,35022=>1000,35023=>1000,35024=>1000,35025=>1000,35026=>1000,35027=>1000,35028=>1000, - 35029=>1000,35030=>1000,35031=>1000,35032=>1000,35033=>1000,35034=>1000,35035=>1000,35036=>1000,35037=>1000,35038=>1000,35039=>1000,35040=>1000,35041=>1000,35042=>1000,35043=>1000,35044=>1000, - 35045=>1000,35046=>1000,35047=>1000,35048=>1000,35049=>1000,35050=>1000,35051=>1000,35052=>1000,35053=>1000,35054=>1000,35055=>1000,35056=>1000,35057=>1000,35058=>1000,35059=>1000,35060=>1000, - 35061=>1000,35062=>1000,35063=>1000,35064=>1000,35065=>1000,35066=>1000,35067=>1000,35068=>1000,35069=>1000,35070=>1000,35071=>1000,35072=>1000,35073=>1000,35074=>1000,35075=>1000,35076=>1000, - 35077=>1000,35078=>1000,35079=>1000,35080=>1000,35081=>1000,35082=>1000,35083=>1000,35084=>1000,35085=>1000,35086=>1000,35087=>1000,35088=>1000,35089=>1000,35090=>1000,35091=>1000,35092=>1000, - 35093=>1000,35094=>1000,35095=>1000,35096=>1000,35097=>1000,35098=>1000,35099=>1000,35100=>1000,35101=>1000,35102=>1000,35103=>1000,35104=>1000,35105=>1000,35106=>1000,35107=>1000,35108=>1000, - 35109=>1000,35110=>1000,35111=>1000,35112=>1000,35113=>1000,35114=>1000,35115=>1000,35116=>1000,35117=>1000,35118=>1000,35119=>1000,35120=>1000,35121=>1000,35122=>1000,35123=>1000,35124=>1000, - 35125=>1000,35126=>1000,35127=>1000,35128=>1000,35129=>1000,35130=>1000,35131=>1000,35132=>1000,35133=>1000,35134=>1000,35135=>1000,35136=>1000,35137=>1000,35138=>1000,35139=>1000,35140=>1000, - 35141=>1000,35142=>1000,35143=>1000,35144=>1000,35145=>1000,35146=>1000,35147=>1000,35148=>1000,35149=>1000,35150=>1000,35151=>1000,35152=>1000,35153=>1000,35154=>1000,35155=>1000,35156=>1000, - 35157=>1000,35158=>1000,35159=>1000,35160=>1000,35161=>1000,35162=>1000,35163=>1000,35164=>1000,35165=>1000,35166=>1000,35167=>1000,35168=>1000,35169=>1000,35170=>1000,35171=>1000,35172=>1000, - 35173=>1000,35174=>1000,35175=>1000,35176=>1000,35177=>1000,35178=>1000,35179=>1000,35180=>1000,35181=>1000,35182=>1000,35183=>1000,35184=>1000,35185=>1000,35186=>1000,35187=>1000,35188=>1000, - 35189=>1000,35190=>1000,35191=>1000,35192=>1000,35193=>1000,35194=>1000,35195=>1000,35196=>1000,35197=>1000,35198=>1000,35199=>1000,35200=>1000,35201=>1000,35202=>1000,35203=>1000,35204=>1000, - 35205=>1000,35206=>1000,35207=>1000,35208=>1000,35209=>1000,35210=>1000,35211=>1000,35212=>1000,35213=>1000,35214=>1000,35215=>1000,35216=>1000,35217=>1000,35218=>1000,35219=>1000,35220=>1000, - 35221=>1000,35222=>1000,35223=>1000,35224=>1000,35225=>1000,35226=>1000,35227=>1000,35228=>1000,35229=>1000,35230=>1000,35231=>1000,35232=>1000,35233=>1000,35234=>1000,35235=>1000,35236=>1000, - 35237=>1000,35238=>1000,35239=>1000,35240=>1000,35241=>1000,35242=>1000,35243=>1000,35244=>1000,35245=>1000,35246=>1000,35247=>1000,35248=>1000,35249=>1000,35250=>1000,35251=>1000,35252=>1000, - 35253=>1000,35254=>1000,35255=>1000,35256=>1000,35257=>1000,35258=>1000,35259=>1000,35260=>1000,35261=>1000,35262=>1000,35263=>1000,35264=>1000,35265=>1000,35266=>1000,35267=>1000,35268=>1000, - 35269=>1000,35270=>1000,35271=>1000,35272=>1000,35273=>1000,35274=>1000,35275=>1000,35276=>1000,35277=>1000,35278=>1000,35279=>1000,35280=>1000,35281=>1000,35282=>1000,35283=>1000,35284=>1000, - 35285=>1000,35286=>1000,35287=>1000,35288=>1000,35289=>1000,35290=>1000,35291=>1000,35292=>1000,35293=>1000,35294=>1000,35295=>1000,35296=>1000,35297=>1000,35298=>1000,35299=>1000,35300=>1000, - 35301=>1000,35302=>1000,35303=>1000,35304=>1000,35305=>1000,35306=>1000,35307=>1000,35308=>1000,35309=>1000,35310=>1000,35311=>1000,35312=>1000,35313=>1000,35314=>1000,35315=>1000,35316=>1000, - 35317=>1000,35318=>1000,35319=>1000,35320=>1000,35321=>1000,35322=>1000,35323=>1000,35324=>1000,35325=>1000,35326=>1000,35327=>1000,35328=>1000,35329=>1000,35330=>1000,35331=>1000,35332=>1000, - 35333=>1000,35334=>1000,35335=>1000,35336=>1000,35337=>1000,35338=>1000,35339=>1000,35340=>1000,35341=>1000,35342=>1000,35343=>1000,35344=>1000,35345=>1000,35346=>1000,35347=>1000,35348=>1000, - 35349=>1000,35350=>1000,35351=>1000,35352=>1000,35353=>1000,35354=>1000,35355=>1000,35356=>1000,35357=>1000,35358=>1000,35359=>1000,35360=>1000,35361=>1000,35362=>1000,35363=>1000,35364=>1000, - 35365=>1000,35366=>1000,35367=>1000,35368=>1000,35369=>1000,35370=>1000,35371=>1000,35372=>1000,35373=>1000,35374=>1000,35375=>1000,35376=>1000,35377=>1000,35378=>1000,35379=>1000,35380=>1000, - 35381=>1000,35382=>1000,35383=>1000,35384=>1000,35385=>1000,35386=>1000,35387=>1000,35388=>1000,35389=>1000,35390=>1000,35391=>1000,35392=>1000,35393=>1000,35394=>1000,35395=>1000,35396=>1000, - 35397=>1000,35398=>1000,35399=>1000,35400=>1000,35401=>1000,35402=>1000,35403=>1000,35404=>1000,35405=>1000,35406=>1000,35407=>1000,35408=>1000,35409=>1000,35410=>1000,35411=>1000,35412=>1000, - 35413=>1000,35414=>1000,35415=>1000,35416=>1000,35417=>1000,35418=>1000,35419=>1000,35420=>1000,35421=>1000,35422=>1000,35423=>1000,35424=>1000,35425=>1000,35426=>1000,35427=>1000,35428=>1000, - 35429=>1000,35430=>1000,35431=>1000,35432=>1000,35433=>1000,35434=>1000,35435=>1000,35436=>1000,35437=>1000,35438=>1000,35439=>1000,35440=>1000,35441=>1000,35442=>1000,35443=>1000,35444=>1000, - 35445=>1000,35446=>1000,35447=>1000,35448=>1000,35449=>1000,35450=>1000,35451=>1000,35452=>1000,35453=>1000,35454=>1000,35455=>1000,35456=>1000,35457=>1000,35458=>1000,35459=>1000,35460=>1000, - 35461=>1000,35462=>1000,35463=>1000,35464=>1000,35465=>1000,35466=>1000,35467=>1000,35468=>1000,35469=>1000,35470=>1000,35471=>1000,35472=>1000,35473=>1000,35474=>1000,35475=>1000,35476=>1000, - 35477=>1000,35478=>1000,35479=>1000,35480=>1000,35481=>1000,35482=>1000,35483=>1000,35484=>1000,35485=>1000,35486=>1000,35487=>1000,35488=>1000,35489=>1000,35490=>1000,35491=>1000,35492=>1000, - 35493=>1000,35494=>1000,35495=>1000,35496=>1000,35497=>1000,35498=>1000,35499=>1000,35500=>1000,35501=>1000,35502=>1000,35503=>1000,35504=>1000,35505=>1000,35506=>1000,35507=>1000,35508=>1000, - 35509=>1000,35510=>1000,35511=>1000,35512=>1000,35513=>1000,35514=>1000,35515=>1000,35516=>1000,35517=>1000,35518=>1000,35519=>1000,35520=>1000,35521=>1000,35522=>1000,35523=>1000,35524=>1000, - 35525=>1000,35526=>1000,35527=>1000,35528=>1000,35529=>1000,35530=>1000,35531=>1000,35532=>1000,35533=>1000,35534=>1000,35535=>1000,35536=>1000,35537=>1000,35538=>1000,35539=>1000,35540=>1000, - 35541=>1000,35542=>1000,35543=>1000,35544=>1000,35545=>1000,35546=>1000,35547=>1000,35548=>1000,35549=>1000,35550=>1000,35551=>1000,35552=>1000,35553=>1000,35554=>1000,35555=>1000,35556=>1000, - 35557=>1000,35558=>1000,35559=>1000,35560=>1000,35561=>1000,35562=>1000,35563=>1000,35564=>1000,35565=>1000,35566=>1000,35567=>1000,35568=>1000,35569=>1000,35570=>1000,35571=>1000,35572=>1000, - 35573=>1000,35574=>1000,35575=>1000,35576=>1000,35577=>1000,35578=>1000,35579=>1000,35580=>1000,35581=>1000,35582=>1000,35583=>1000,35584=>1000,35585=>1000,35586=>1000,35587=>1000,35588=>1000, - 35589=>1000,35590=>1000,35591=>1000,35592=>1000,35593=>1000,35594=>1000,35595=>1000,35596=>1000,35597=>1000,35598=>1000,35599=>1000,35600=>1000,35601=>1000,35602=>1000,35603=>1000,35604=>1000, - 35605=>1000,35606=>1000,35607=>1000,35608=>1000,35609=>1000,35610=>1000,35611=>1000,35612=>1000,35613=>1000,35614=>1000,35615=>1000,35616=>1000,35617=>1000,35618=>1000,35619=>1000,35620=>1000, - 35621=>1000,35622=>1000,35623=>1000,35624=>1000,35625=>1000,35626=>1000,35627=>1000,35628=>1000,35629=>1000,35630=>1000,35631=>1000,35632=>1000,35633=>1000,35634=>1000,35635=>1000,35636=>1000, - 35637=>1000,35638=>1000,35639=>1000,35640=>1000,35641=>1000,35642=>1000,35643=>1000,35644=>1000,35645=>1000,35646=>1000,35647=>1000,35648=>1000,35649=>1000,35650=>1000,35651=>1000,35652=>1000, - 35653=>1000,35654=>1000,35655=>1000,35656=>1000,35657=>1000,35658=>1000,35659=>1000,35660=>1000,35661=>1000,35662=>1000,35663=>1000,35664=>1000,35665=>1000,35666=>1000,35667=>1000,35668=>1000, - 35669=>1000,35670=>1000,35671=>1000,35672=>1000,35673=>1000,35674=>1000,35675=>1000,35676=>1000,35677=>1000,35678=>1000,35679=>1000,35680=>1000,35681=>1000,35682=>1000,35683=>1000,35684=>1000, - 35685=>1000,35686=>1000,35687=>1000,35688=>1000,35689=>1000,35690=>1000,35691=>1000,35692=>1000,35693=>1000,35694=>1000,35695=>1000,35696=>1000,35697=>1000,35698=>1000,35699=>1000,35700=>1000, - 35701=>1000,35702=>1000,35703=>1000,35704=>1000,35705=>1000,35706=>1000,35707=>1000,35708=>1000,35709=>1000,35710=>1000,35711=>1000,35712=>1000,35713=>1000,35714=>1000,35715=>1000,35716=>1000, - 35717=>1000,35718=>1000,35719=>1000,35720=>1000,35721=>1000,35722=>1000,35723=>1000,35724=>1000,35725=>1000,35726=>1000,35727=>1000,35728=>1000,35729=>1000,35730=>1000,35731=>1000,35732=>1000, - 35733=>1000,35734=>1000,35735=>1000,35736=>1000,35737=>1000,35738=>1000,35739=>1000,35740=>1000,35741=>1000,35742=>1000,35743=>1000,35744=>1000,35745=>1000,35746=>1000,35747=>1000,35748=>1000, - 35749=>1000,35750=>1000,35751=>1000,35752=>1000,35753=>1000,35754=>1000,35755=>1000,35756=>1000,35757=>1000,35758=>1000,35759=>1000,35760=>1000,35761=>1000,35762=>1000,35763=>1000,35764=>1000, - 35765=>1000,35766=>1000,35767=>1000,35768=>1000,35769=>1000,35770=>1000,35771=>1000,35772=>1000,35773=>1000,35774=>1000,35775=>1000,35776=>1000,35777=>1000,35778=>1000,35779=>1000,35780=>1000, - 35781=>1000,35782=>1000,35783=>1000,35784=>1000,35785=>1000,35786=>1000,35787=>1000,35788=>1000,35789=>1000,35790=>1000,35791=>1000,35792=>1000,35793=>1000,35794=>1000,35795=>1000,35796=>1000, - 35797=>1000,35798=>1000,35799=>1000,35800=>1000,35801=>1000,35802=>1000,35803=>1000,35804=>1000,35805=>1000,35806=>1000,35807=>1000,35808=>1000,35809=>1000,35810=>1000,35811=>1000,35812=>1000, - 35813=>1000,35814=>1000,35815=>1000,35816=>1000,35817=>1000,35818=>1000,35819=>1000,35820=>1000,35821=>1000,35822=>1000,35823=>1000,35824=>1000,35825=>1000,35826=>1000,35827=>1000,35828=>1000, - 35829=>1000,35830=>1000,35831=>1000,35832=>1000,35833=>1000,35834=>1000,35835=>1000,35836=>1000,35837=>1000,35838=>1000,35839=>1000,35840=>1000,35841=>1000,35842=>1000,35843=>1000,35844=>1000, - 35845=>1000,35846=>1000,35847=>1000,35848=>1000,35849=>1000,35850=>1000,35851=>1000,35852=>1000,35853=>1000,35854=>1000,35855=>1000,35856=>1000,35857=>1000,35858=>1000,35859=>1000,35860=>1000, - 35861=>1000,35862=>1000,35863=>1000,35864=>1000,35865=>1000,35866=>1000,35867=>1000,35868=>1000,35869=>1000,35870=>1000,35871=>1000,35872=>1000,35873=>1000,35874=>1000,35875=>1000,35876=>1000, - 35877=>1000,35878=>1000,35879=>1000,35880=>1000,35881=>1000,35882=>1000,35883=>1000,35884=>1000,35885=>1000,35886=>1000,35887=>1000,35888=>1000,35889=>1000,35890=>1000,35891=>1000,35892=>1000, - 35893=>1000,35894=>1000,35895=>1000,35896=>1000,35897=>1000,35898=>1000,35899=>1000,35900=>1000,35901=>1000,35902=>1000,35903=>1000,35904=>1000,35905=>1000,35906=>1000,35907=>1000,35908=>1000, - 35909=>1000,35910=>1000,35911=>1000,35912=>1000,35913=>1000,35914=>1000,35915=>1000,35916=>1000,35917=>1000,35918=>1000,35919=>1000,35920=>1000,35921=>1000,35922=>1000,35923=>1000,35924=>1000, - 35925=>1000,35926=>1000,35927=>1000,35928=>1000,35929=>1000,35930=>1000,35931=>1000,35932=>1000,35933=>1000,35934=>1000,35935=>1000,35936=>1000,35937=>1000,35938=>1000,35939=>1000,35940=>1000, - 35941=>1000,35942=>1000,35943=>1000,35944=>1000,35945=>1000,35946=>1000,35947=>1000,35948=>1000,35949=>1000,35950=>1000,35951=>1000,35952=>1000,35953=>1000,35954=>1000,35955=>1000,35956=>1000, - 35957=>1000,35958=>1000,35959=>1000,35960=>1000,35961=>1000,35962=>1000,35963=>1000,35964=>1000,35965=>1000,35966=>1000,35967=>1000,35968=>1000,35969=>1000,35970=>1000,35971=>1000,35972=>1000, - 35973=>1000,35974=>1000,35975=>1000,35976=>1000,35977=>1000,35978=>1000,35979=>1000,35980=>1000,35981=>1000,35982=>1000,35983=>1000,35984=>1000,35985=>1000,35986=>1000,35987=>1000,35988=>1000, - 35989=>1000,35990=>1000,35991=>1000,35992=>1000,35993=>1000,35994=>1000,35995=>1000,35996=>1000,35997=>1000,35998=>1000,35999=>1000,36000=>1000,36001=>1000,36002=>1000,36003=>1000,36004=>1000, - 36005=>1000,36006=>1000,36007=>1000,36008=>1000,36009=>1000,36010=>1000,36011=>1000,36012=>1000,36013=>1000,36014=>1000,36015=>1000,36016=>1000,36017=>1000,36018=>1000,36019=>1000,36020=>1000, - 36021=>1000,36022=>1000,36023=>1000,36024=>1000,36025=>1000,36026=>1000,36027=>1000,36028=>1000,36029=>1000,36030=>1000,36031=>1000,36032=>1000,36033=>1000,36034=>1000,36035=>1000,36036=>1000, - 36037=>1000,36038=>1000,36039=>1000,36040=>1000,36041=>1000,36042=>1000,36043=>1000,36044=>1000,36045=>1000,36046=>1000,36047=>1000,36048=>1000,36049=>1000,36050=>1000,36051=>1000,36052=>1000, - 36053=>1000,36054=>1000,36055=>1000,36056=>1000,36057=>1000,36058=>1000,36059=>1000,36060=>1000,36061=>1000,36062=>1000,36063=>1000,36064=>1000,36065=>1000,36066=>1000,36067=>1000,36068=>1000, - 36069=>1000,36070=>1000,36071=>1000,36072=>1000,36073=>1000,36074=>1000,36075=>1000,36076=>1000,36077=>1000,36078=>1000,36079=>1000,36080=>1000,36081=>1000,36082=>1000,36083=>1000,36084=>1000, - 36085=>1000,36086=>1000,36087=>1000,36088=>1000,36089=>1000,36090=>1000,36091=>1000,36092=>1000,36093=>1000,36094=>1000,36095=>1000,36096=>1000,36097=>1000,36098=>1000,36099=>1000,36100=>1000, - 36101=>1000,36102=>1000,36103=>1000,36104=>1000,36105=>1000,36106=>1000,36107=>1000,36108=>1000,36109=>1000,36110=>1000,36111=>1000,36112=>1000,36113=>1000,36114=>1000,36115=>1000,36116=>1000, - 36117=>1000,36118=>1000,36119=>1000,36120=>1000,36121=>1000,36122=>1000,36123=>1000,36124=>1000,36125=>1000,36126=>1000,36127=>1000,36128=>1000,36129=>1000,36130=>1000,36131=>1000,36132=>1000, - 36133=>1000,36134=>1000,36135=>1000,36136=>1000,36137=>1000,36138=>1000,36139=>1000,36140=>1000,36141=>1000,36142=>1000,36143=>1000,36144=>1000,36145=>1000,36146=>1000,36147=>1000,36148=>1000, - 36149=>1000,36150=>1000,36151=>1000,36152=>1000,36153=>1000,36154=>1000,36155=>1000,36156=>1000,36157=>1000,36158=>1000,36159=>1000,36160=>1000,36161=>1000,36162=>1000,36163=>1000,36164=>1000, - 36165=>1000,36166=>1000,36167=>1000,36168=>1000,36169=>1000,36170=>1000,36171=>1000,36172=>1000,36173=>1000,36174=>1000,36175=>1000,36176=>1000,36177=>1000,36178=>1000,36179=>1000,36180=>1000, - 36181=>1000,36182=>1000,36183=>1000,36184=>1000,36185=>1000,36186=>1000,36187=>1000,36188=>1000,36189=>1000,36190=>1000,36191=>1000,36192=>1000,36193=>1000,36194=>1000,36195=>1000,36196=>1000, - 36197=>1000,36198=>1000,36199=>1000,36200=>1000,36201=>1000,36202=>1000,36203=>1000,36204=>1000,36205=>1000,36206=>1000,36207=>1000,36208=>1000,36209=>1000,36210=>1000,36211=>1000,36212=>1000, - 36213=>1000,36214=>1000,36215=>1000,36216=>1000,36217=>1000,36218=>1000,36219=>1000,36220=>1000,36221=>1000,36222=>1000,36223=>1000,36224=>1000,36225=>1000,36226=>1000,36227=>1000,36228=>1000, - 36229=>1000,36230=>1000,36231=>1000,36232=>1000,36233=>1000,36234=>1000,36235=>1000,36236=>1000,36237=>1000,36238=>1000,36239=>1000,36240=>1000,36241=>1000,36242=>1000,36243=>1000,36244=>1000, - 36245=>1000,36246=>1000,36247=>1000,36248=>1000,36249=>1000,36250=>1000,36251=>1000,36252=>1000,36253=>1000,36254=>1000,36255=>1000,36256=>1000,36257=>1000,36258=>1000,36259=>1000,36260=>1000, - 36261=>1000,36262=>1000,36263=>1000,36264=>1000,36265=>1000,36266=>1000,36267=>1000,36268=>1000,36269=>1000,36270=>1000,36271=>1000,36272=>1000,36273=>1000,36274=>1000,36275=>1000,36276=>1000, - 36277=>1000,36278=>1000,36279=>1000,36280=>1000,36281=>1000,36282=>1000,36283=>1000,36284=>1000,36285=>1000,36286=>1000,36287=>1000,36288=>1000,36289=>1000,36290=>1000,36291=>1000,36292=>1000, - 36293=>1000,36294=>1000,36295=>1000,36296=>1000,36297=>1000,36298=>1000,36299=>1000,36300=>1000,36301=>1000,36302=>1000,36303=>1000,36304=>1000,36305=>1000,36306=>1000,36307=>1000,36308=>1000, - 36309=>1000,36310=>1000,36311=>1000,36312=>1000,36313=>1000,36314=>1000,36315=>1000,36316=>1000,36317=>1000,36318=>1000,36319=>1000,36320=>1000,36321=>1000,36322=>1000,36323=>1000,36324=>1000, - 36325=>1000,36326=>1000,36327=>1000,36328=>1000,36329=>1000,36330=>1000,36331=>1000,36332=>1000,36333=>1000,36334=>1000,36335=>1000,36336=>1000,36337=>1000,36338=>1000,36339=>1000,36340=>1000, - 36341=>1000,36342=>1000,36343=>1000,36344=>1000,36345=>1000,36346=>1000,36347=>1000,36348=>1000,36349=>1000,36350=>1000,36351=>1000,36352=>1000,36353=>1000,36354=>1000,36355=>1000,36356=>1000, - 36357=>1000,36358=>1000,36359=>1000,36360=>1000,36361=>1000,36362=>1000,36363=>1000,36364=>1000,36365=>1000,36366=>1000,36367=>1000,36368=>1000,36369=>1000,36370=>1000,36371=>1000,36372=>1000, - 36373=>1000,36374=>1000,36375=>1000,36376=>1000,36377=>1000,36378=>1000,36379=>1000,36380=>1000,36381=>1000,36382=>1000,36383=>1000,36384=>1000,36385=>1000,36386=>1000,36387=>1000,36388=>1000, - 36389=>1000,36390=>1000,36391=>1000,36392=>1000,36393=>1000,36394=>1000,36395=>1000,36396=>1000,36397=>1000,36398=>1000,36399=>1000,36400=>1000,36401=>1000,36402=>1000,36403=>1000,36404=>1000, - 36405=>1000,36406=>1000,36407=>1000,36408=>1000,36409=>1000,36410=>1000,36411=>1000,36412=>1000,36413=>1000,36414=>1000,36415=>1000,36416=>1000,36417=>1000,36418=>1000,36419=>1000,36420=>1000, - 36421=>1000,36422=>1000,36423=>1000,36424=>1000,36425=>1000,36426=>1000,36427=>1000,36428=>1000,36429=>1000,36430=>1000,36431=>1000,36432=>1000,36433=>1000,36434=>1000,36435=>1000,36436=>1000, - 36437=>1000,36438=>1000,36439=>1000,36440=>1000,36441=>1000,36442=>1000,36443=>1000,36444=>1000,36445=>1000,36446=>1000,36447=>1000,36448=>1000,36449=>1000,36450=>1000,36451=>1000,36452=>1000, - 36453=>1000,36454=>1000,36455=>1000,36456=>1000,36457=>1000,36458=>1000,36459=>1000,36460=>1000,36461=>1000,36462=>1000,36463=>1000,36464=>1000,36465=>1000,36466=>1000,36467=>1000,36468=>1000, - 36469=>1000,36470=>1000,36471=>1000,36472=>1000,36473=>1000,36474=>1000,36475=>1000,36476=>1000,36477=>1000,36478=>1000,36479=>1000,36480=>1000,36481=>1000,36482=>1000,36483=>1000,36484=>1000, - 36485=>1000,36486=>1000,36487=>1000,36488=>1000,36489=>1000,36490=>1000,36491=>1000,36492=>1000,36493=>1000,36494=>1000,36495=>1000,36496=>1000,36497=>1000,36498=>1000,36499=>1000,36500=>1000, - 36501=>1000,36502=>1000,36503=>1000,36504=>1000,36505=>1000,36506=>1000,36507=>1000,36508=>1000,36509=>1000,36510=>1000,36511=>1000,36512=>1000,36513=>1000,36514=>1000,36515=>1000,36516=>1000, - 36517=>1000,36518=>1000,36519=>1000,36520=>1000,36521=>1000,36522=>1000,36523=>1000,36524=>1000,36525=>1000,36526=>1000,36527=>1000,36528=>1000,36529=>1000,36530=>1000,36531=>1000,36532=>1000, - 36533=>1000,36534=>1000,36535=>1000,36536=>1000,36537=>1000,36538=>1000,36539=>1000,36540=>1000,36541=>1000,36542=>1000,36543=>1000,36544=>1000,36545=>1000,36546=>1000,36547=>1000,36548=>1000, - 36549=>1000,36550=>1000,36551=>1000,36552=>1000,36553=>1000,36554=>1000,36555=>1000,36556=>1000,36557=>1000,36558=>1000,36559=>1000,36560=>1000,36561=>1000,36562=>1000,36563=>1000,36564=>1000, - 36565=>1000,36566=>1000,36567=>1000,36568=>1000,36569=>1000,36570=>1000,36571=>1000,36572=>1000,36573=>1000,36574=>1000,36575=>1000,36576=>1000,36577=>1000,36578=>1000,36579=>1000,36580=>1000, - 36581=>1000,36582=>1000,36583=>1000,36584=>1000,36585=>1000,36586=>1000,36587=>1000,36588=>1000,36589=>1000,36590=>1000,36591=>1000,36592=>1000,36593=>1000,36594=>1000,36595=>1000,36596=>1000, - 36597=>1000,36598=>1000,36599=>1000,36600=>1000,36601=>1000,36602=>1000,36603=>1000,36604=>1000,36605=>1000,36606=>1000,36607=>1000,36608=>1000,36609=>1000,36610=>1000,36611=>1000,36612=>1000, - 36613=>1000,36614=>1000,36615=>1000,36616=>1000,36617=>1000,36618=>1000,36619=>1000,36620=>1000,36621=>1000,36622=>1000,36623=>1000,36624=>1000,36625=>1000,36626=>1000,36627=>1000,36628=>1000, - 36629=>1000,36630=>1000,36631=>1000,36632=>1000,36633=>1000,36634=>1000,36635=>1000,36636=>1000,36637=>1000,36638=>1000,36639=>1000,36640=>1000,36641=>1000,36642=>1000,36643=>1000,36644=>1000, - 36645=>1000,36646=>1000,36647=>1000,36648=>1000,36649=>1000,36650=>1000,36651=>1000,36652=>1000,36653=>1000,36654=>1000,36655=>1000,36656=>1000,36657=>1000,36658=>1000,36659=>1000,36660=>1000, - 36661=>1000,36662=>1000,36663=>1000,36664=>1000,36665=>1000,36666=>1000,36667=>1000,36668=>1000,36669=>1000,36670=>1000,36671=>1000,36672=>1000,36673=>1000,36674=>1000,36675=>1000,36676=>1000, - 36677=>1000,36678=>1000,36679=>1000,36680=>1000,36681=>1000,36682=>1000,36683=>1000,36684=>1000,36685=>1000,36686=>1000,36687=>1000,36688=>1000,36689=>1000,36690=>1000,36691=>1000,36692=>1000, - 36693=>1000,36694=>1000,36695=>1000,36696=>1000,36697=>1000,36698=>1000,36699=>1000,36700=>1000,36701=>1000,36702=>1000,36703=>1000,36704=>1000,36705=>1000,36706=>1000,36707=>1000,36708=>1000, - 36709=>1000,36710=>1000,36711=>1000,36712=>1000,36713=>1000,36714=>1000,36715=>1000,36716=>1000,36717=>1000,36718=>1000,36719=>1000,36720=>1000,36721=>1000,36722=>1000,36723=>1000,36724=>1000, - 36725=>1000,36726=>1000,36727=>1000,36728=>1000,36729=>1000,36730=>1000,36731=>1000,36732=>1000,36733=>1000,36734=>1000,36735=>1000,36736=>1000,36737=>1000,36738=>1000,36739=>1000,36740=>1000, - 36741=>1000,36742=>1000,36743=>1000,36744=>1000,36745=>1000,36746=>1000,36747=>1000,36748=>1000,36749=>1000,36750=>1000,36751=>1000,36752=>1000,36753=>1000,36754=>1000,36755=>1000,36756=>1000, - 36757=>1000,36758=>1000,36759=>1000,36760=>1000,36761=>1000,36762=>1000,36763=>1000,36764=>1000,36765=>1000,36766=>1000,36767=>1000,36768=>1000,36769=>1000,36770=>1000,36771=>1000,36772=>1000, - 36773=>1000,36774=>1000,36775=>1000,36776=>1000,36777=>1000,36778=>1000,36779=>1000,36780=>1000,36781=>1000,36782=>1000,36783=>1000,36784=>1000,36785=>1000,36786=>1000,36787=>1000,36788=>1000, - 36789=>1000,36790=>1000,36791=>1000,36792=>1000,36793=>1000,36794=>1000,36795=>1000,36796=>1000,36797=>1000,36798=>1000,36799=>1000,36800=>1000,36801=>1000,36802=>1000,36803=>1000,36804=>1000, - 36805=>1000,36806=>1000,36807=>1000,36808=>1000,36809=>1000,36810=>1000,36811=>1000,36812=>1000,36813=>1000,36814=>1000,36815=>1000,36816=>1000,36817=>1000,36818=>1000,36819=>1000,36820=>1000, - 36821=>1000,36822=>1000,36823=>1000,36824=>1000,36825=>1000,36826=>1000,36827=>1000,36828=>1000,36829=>1000,36830=>1000,36831=>1000,36832=>1000,36833=>1000,36834=>1000,36835=>1000,36836=>1000, - 36837=>1000,36838=>1000,36839=>1000,36840=>1000,36841=>1000,36842=>1000,36843=>1000,36844=>1000,36845=>1000,36846=>1000,36847=>1000,36848=>1000,36849=>1000,36850=>1000,36851=>1000,36852=>1000, - 36853=>1000,36854=>1000,36855=>1000,36856=>1000,36857=>1000,36858=>1000,36859=>1000,36860=>1000,36861=>1000,36862=>1000,36863=>1000,36864=>1000,36865=>1000,36866=>1000,36867=>1000,36868=>1000, - 36869=>1000,36870=>1000,36871=>1000,36872=>1000,36873=>1000,36874=>1000,36875=>1000,36876=>1000,36877=>1000,36878=>1000,36879=>1000,36880=>1000,36881=>1000,36882=>1000,36883=>1000,36884=>1000, - 36885=>1000,36886=>1000,36887=>1000,36888=>1000,36889=>1000,36890=>1000,36891=>1000,36892=>1000,36893=>1000,36894=>1000,36895=>1000,36896=>1000,36897=>1000,36898=>1000,36899=>1000,36900=>1000, - 36901=>1000,36902=>1000,36903=>1000,36904=>1000,36905=>1000,36906=>1000,36907=>1000,36908=>1000,36909=>1000,36910=>1000,36911=>1000,36912=>1000,36913=>1000,36914=>1000,36915=>1000,36916=>1000, - 36917=>1000,36918=>1000,36919=>1000,36920=>1000,36921=>1000,36922=>1000,36923=>1000,36924=>1000,36925=>1000,36926=>1000,36927=>1000,36928=>1000,36929=>1000,36930=>1000,36931=>1000,36932=>1000, - 36933=>1000,36934=>1000,36935=>1000,36936=>1000,36937=>1000,36938=>1000,36939=>1000,36940=>1000,36941=>1000,36942=>1000,36943=>1000,36944=>1000,36945=>1000,36946=>1000,36947=>1000,36948=>1000, - 36949=>1000,36950=>1000,36951=>1000,36952=>1000,36953=>1000,36954=>1000,36955=>1000,36956=>1000,36957=>1000,36958=>1000,36959=>1000,36960=>1000,36961=>1000,36962=>1000,36963=>1000,36964=>1000, - 36965=>1000,36966=>1000,36967=>1000,36968=>1000,36969=>1000,36970=>1000,36971=>1000,36972=>1000,36973=>1000,36974=>1000,36975=>1000,36976=>1000,36977=>1000,36978=>1000,36979=>1000,36980=>1000, - 36981=>1000,36982=>1000,36983=>1000,36984=>1000,36985=>1000,36986=>1000,36987=>1000,36988=>1000,36989=>1000,36990=>1000,36991=>1000,36992=>1000,36993=>1000,36994=>1000,36995=>1000,36996=>1000, - 36997=>1000,36998=>1000,36999=>1000,37000=>1000,37001=>1000,37002=>1000,37003=>1000,37004=>1000,37005=>1000,37006=>1000,37007=>1000,37008=>1000,37009=>1000,37010=>1000,37011=>1000,37012=>1000, - 37013=>1000,37014=>1000,37015=>1000,37016=>1000,37017=>1000,37018=>1000,37019=>1000,37020=>1000,37021=>1000,37022=>1000,37023=>1000,37024=>1000,37025=>1000,37026=>1000,37027=>1000,37028=>1000, - 37029=>1000,37030=>1000,37031=>1000,37032=>1000,37033=>1000,37034=>1000,37035=>1000,37036=>1000,37037=>1000,37038=>1000,37039=>1000,37040=>1000,37041=>1000,37042=>1000,37043=>1000,37044=>1000, - 37045=>1000,37046=>1000,37047=>1000,37048=>1000,37049=>1000,37050=>1000,37051=>1000,37052=>1000,37053=>1000,37054=>1000,37055=>1000,37056=>1000,37057=>1000,37058=>1000,37059=>1000,37060=>1000, - 37061=>1000,37062=>1000,37063=>1000,37064=>1000,37065=>1000,37066=>1000,37067=>1000,37068=>1000,37069=>1000,37070=>1000,37071=>1000,37072=>1000,37073=>1000,37074=>1000,37075=>1000,37076=>1000, - 37077=>1000,37078=>1000,37079=>1000,37080=>1000,37081=>1000,37082=>1000,37083=>1000,37084=>1000,37085=>1000,37086=>1000,37087=>1000,37088=>1000,37089=>1000,37090=>1000,37091=>1000,37092=>1000, - 37093=>1000,37094=>1000,37095=>1000,37096=>1000,37097=>1000,37098=>1000,37099=>1000,37100=>1000,37101=>1000,37102=>1000,37103=>1000,37104=>1000,37105=>1000,37106=>1000,37107=>1000,37108=>1000, - 37109=>1000,37110=>1000,37111=>1000,37112=>1000,37113=>1000,37114=>1000,37115=>1000,37116=>1000,37117=>1000,37118=>1000,37119=>1000,37120=>1000,37121=>1000,37122=>1000,37123=>1000,37124=>1000, - 37125=>1000,37126=>1000,37127=>1000,37128=>1000,37129=>1000,37130=>1000,37131=>1000,37132=>1000,37133=>1000,37134=>1000,37135=>1000,37136=>1000,37137=>1000,37138=>1000,37139=>1000,37140=>1000, - 37141=>1000,37142=>1000,37143=>1000,37144=>1000,37145=>1000,37146=>1000,37147=>1000,37148=>1000,37149=>1000,37150=>1000,37151=>1000,37152=>1000,37153=>1000,37154=>1000,37155=>1000,37156=>1000, - 37157=>1000,37158=>1000,37159=>1000,37160=>1000,37161=>1000,37162=>1000,37163=>1000,37164=>1000,37165=>1000,37166=>1000,37167=>1000,37168=>1000,37169=>1000,37170=>1000,37171=>1000,37172=>1000, - 37173=>1000,37174=>1000,37175=>1000,37176=>1000,37177=>1000,37178=>1000,37179=>1000,37180=>1000,37181=>1000,37182=>1000,37183=>1000,37184=>1000,37185=>1000,37186=>1000,37187=>1000,37188=>1000, - 37189=>1000,37190=>1000,37191=>1000,37192=>1000,37193=>1000,37194=>1000,37195=>1000,37196=>1000,37197=>1000,37198=>1000,37199=>1000,37200=>1000,37201=>1000,37202=>1000,37203=>1000,37204=>1000, - 37205=>1000,37206=>1000,37207=>1000,37208=>1000,37209=>1000,37210=>1000,37211=>1000,37212=>1000,37213=>1000,37214=>1000,37215=>1000,37216=>1000,37217=>1000,37218=>1000,37219=>1000,37220=>1000, - 37221=>1000,37222=>1000,37223=>1000,37224=>1000,37225=>1000,37226=>1000,37227=>1000,37228=>1000,37229=>1000,37230=>1000,37231=>1000,37232=>1000,37233=>1000,37234=>1000,37235=>1000,37236=>1000, - 37237=>1000,37238=>1000,37239=>1000,37240=>1000,37241=>1000,37242=>1000,37243=>1000,37244=>1000,37245=>1000,37246=>1000,37247=>1000,37248=>1000,37249=>1000,37250=>1000,37251=>1000,37252=>1000, - 37253=>1000,37254=>1000,37255=>1000,37256=>1000,37257=>1000,37258=>1000,37259=>1000,37260=>1000,37261=>1000,37262=>1000,37263=>1000,37264=>1000,37265=>1000,37266=>1000,37267=>1000,37268=>1000, - 37269=>1000,37270=>1000,37271=>1000,37272=>1000,37273=>1000,37274=>1000,37275=>1000,37276=>1000,37277=>1000,37278=>1000,37279=>1000,37280=>1000,37281=>1000,37282=>1000,37283=>1000,37284=>1000, - 37285=>1000,37286=>1000,37287=>1000,37288=>1000,37289=>1000,37290=>1000,37291=>1000,37292=>1000,37293=>1000,37294=>1000,37295=>1000,37296=>1000,37297=>1000,37298=>1000,37299=>1000,37300=>1000, - 37301=>1000,37302=>1000,37303=>1000,37304=>1000,37305=>1000,37306=>1000,37307=>1000,37308=>1000,37309=>1000,37310=>1000,37311=>1000,37312=>1000,37313=>1000,37314=>1000,37315=>1000,37316=>1000, - 37317=>1000,37318=>1000,37319=>1000,37320=>1000,37321=>1000,37322=>1000,37323=>1000,37324=>1000,37325=>1000,37326=>1000,37327=>1000,37328=>1000,37329=>1000,37330=>1000,37331=>1000,37332=>1000, - 37333=>1000,37334=>1000,37335=>1000,37336=>1000,37337=>1000,37338=>1000,37339=>1000,37340=>1000,37341=>1000,37342=>1000,37343=>1000,37344=>1000,37345=>1000,37346=>1000,37347=>1000,37348=>1000, - 37349=>1000,37350=>1000,37351=>1000,37352=>1000,37353=>1000,37354=>1000,37355=>1000,37356=>1000,37357=>1000,37358=>1000,37359=>1000,37360=>1000,37361=>1000,37362=>1000,37363=>1000,37364=>1000, - 37365=>1000,37366=>1000,37367=>1000,37368=>1000,37369=>1000,37370=>1000,37371=>1000,37372=>1000,37373=>1000,37374=>1000,37375=>1000,37376=>1000,37377=>1000,37378=>1000,37379=>1000,37380=>1000, - 37381=>1000,37382=>1000,37383=>1000,37384=>1000,37385=>1000,37386=>1000,37387=>1000,37388=>1000,37389=>1000,37390=>1000,37391=>1000,37392=>1000,37393=>1000,37394=>1000,37395=>1000,37396=>1000, - 37397=>1000,37398=>1000,37399=>1000,37400=>1000,37401=>1000,37402=>1000,37403=>1000,37404=>1000,37405=>1000,37406=>1000,37407=>1000,37408=>1000,37409=>1000,37410=>1000,37411=>1000,37412=>1000, - 37413=>1000,37414=>1000,37415=>1000,37416=>1000,37417=>1000,37418=>1000,37419=>1000,37420=>1000,37421=>1000,37422=>1000,37423=>1000,37424=>1000,37425=>1000,37426=>1000,37427=>1000,37428=>1000, - 37429=>1000,37430=>1000,37431=>1000,37432=>1000,37433=>1000,37434=>1000,37435=>1000,37436=>1000,37437=>1000,37438=>1000,37439=>1000,37440=>1000,37441=>1000,37442=>1000,37443=>1000,37444=>1000, - 37445=>1000,37446=>1000,37447=>1000,37448=>1000,37449=>1000,37450=>1000,37451=>1000,37452=>1000,37453=>1000,37454=>1000,37455=>1000,37456=>1000,37457=>1000,37458=>1000,37459=>1000,37460=>1000, - 37461=>1000,37462=>1000,37463=>1000,37464=>1000,37465=>1000,37466=>1000,37467=>1000,37468=>1000,37469=>1000,37470=>1000,37471=>1000,37472=>1000,37473=>1000,37474=>1000,37475=>1000,37476=>1000, - 37477=>1000,37478=>1000,37479=>1000,37480=>1000,37481=>1000,37482=>1000,37483=>1000,37484=>1000,37485=>1000,37486=>1000,37487=>1000,37488=>1000,37489=>1000,37490=>1000,37491=>1000,37492=>1000, - 37493=>1000,37494=>1000,37495=>1000,37496=>1000,37497=>1000,37498=>1000,37499=>1000,37500=>1000,37501=>1000,37502=>1000,37503=>1000,37504=>1000,37505=>1000,37506=>1000,37507=>1000,37508=>1000, - 37509=>1000,37510=>1000,37511=>1000,37512=>1000,37513=>1000,37514=>1000,37515=>1000,37516=>1000,37517=>1000,37518=>1000,37519=>1000,37520=>1000,37521=>1000,37522=>1000,37523=>1000,37524=>1000, - 37525=>1000,37526=>1000,37527=>1000,37528=>1000,37529=>1000,37530=>1000,37531=>1000,37532=>1000,37533=>1000,37534=>1000,37535=>1000,37536=>1000,37537=>1000,37538=>1000,37539=>1000,37540=>1000, - 37541=>1000,37542=>1000,37543=>1000,37544=>1000,37545=>1000,37546=>1000,37547=>1000,37548=>1000,37549=>1000,37550=>1000,37551=>1000,37552=>1000,37553=>1000,37554=>1000,37555=>1000,37556=>1000, - 37557=>1000,37558=>1000,37559=>1000,37560=>1000,37561=>1000,37562=>1000,37563=>1000,37564=>1000,37565=>1000,37566=>1000,37567=>1000,37568=>1000,37569=>1000,37570=>1000,37571=>1000,37572=>1000, - 37573=>1000,37574=>1000,37575=>1000,37576=>1000,37577=>1000,37578=>1000,37579=>1000,37580=>1000,37581=>1000,37582=>1000,37583=>1000,37584=>1000,37585=>1000,37586=>1000,37587=>1000,37588=>1000, - 37589=>1000,37590=>1000,37591=>1000,37592=>1000,37593=>1000,37594=>1000,37595=>1000,37596=>1000,37597=>1000,37598=>1000,37599=>1000,37600=>1000,37601=>1000,37602=>1000,37603=>1000,37604=>1000, - 37605=>1000,37606=>1000,37607=>1000,37608=>1000,37609=>1000,37610=>1000,37611=>1000,37612=>1000,37613=>1000,37614=>1000,37615=>1000,37616=>1000,37617=>1000,37618=>1000,37619=>1000,37620=>1000, - 37621=>1000,37622=>1000,37623=>1000,37624=>1000,37625=>1000,37626=>1000,37627=>1000,37628=>1000,37629=>1000,37630=>1000,37631=>1000,37632=>1000,37633=>1000,37634=>1000,37635=>1000,37636=>1000, - 37637=>1000,37638=>1000,37639=>1000,37640=>1000,37641=>1000,37642=>1000,37643=>1000,37644=>1000,37645=>1000,37646=>1000,37647=>1000,37648=>1000,37649=>1000,37650=>1000,37651=>1000,37652=>1000, - 37653=>1000,37654=>1000,37655=>1000,37656=>1000,37657=>1000,37658=>1000,37659=>1000,37660=>1000,37661=>1000,37662=>1000,37663=>1000,37664=>1000,37665=>1000,37666=>1000,37667=>1000,37668=>1000, - 37669=>1000,37670=>1000,37671=>1000,37672=>1000,37673=>1000,37674=>1000,37675=>1000,37676=>1000,37677=>1000,37678=>1000,37679=>1000,37680=>1000,37681=>1000,37682=>1000,37683=>1000,37684=>1000, - 37685=>1000,37686=>1000,37687=>1000,37688=>1000,37689=>1000,37690=>1000,37691=>1000,37692=>1000,37693=>1000,37694=>1000,37695=>1000,37696=>1000,37697=>1000,37698=>1000,37699=>1000,37700=>1000, - 37701=>1000,37702=>1000,37703=>1000,37704=>1000,37705=>1000,37706=>1000,37707=>1000,37708=>1000,37709=>1000,37710=>1000,37711=>1000,37712=>1000,37713=>1000,37714=>1000,37715=>1000,37716=>1000, - 37717=>1000,37718=>1000,37719=>1000,37720=>1000,37721=>1000,37722=>1000,37723=>1000,37724=>1000,37725=>1000,37726=>1000,37727=>1000,37728=>1000,37729=>1000,37730=>1000,37731=>1000,37732=>1000, - 37733=>1000,37734=>1000,37735=>1000,37736=>1000,37737=>1000,37738=>1000,37739=>1000,37740=>1000,37741=>1000,37742=>1000,37743=>1000,37744=>1000,37745=>1000,37746=>1000,37747=>1000,37748=>1000, - 37749=>1000,37750=>1000,37751=>1000,37752=>1000,37753=>1000,37754=>1000,37755=>1000,37756=>1000,37757=>1000,37758=>1000,37759=>1000,37760=>1000,37761=>1000,37762=>1000,37763=>1000,37764=>1000, - 37765=>1000,37766=>1000,37767=>1000,37768=>1000,37769=>1000,37770=>1000,37771=>1000,37772=>1000,37773=>1000,37774=>1000,37775=>1000,37776=>1000,37777=>1000,37778=>1000,37779=>1000,37780=>1000, - 37781=>1000,37782=>1000,37783=>1000,37784=>1000,37785=>1000,37786=>1000,37787=>1000,37788=>1000,37789=>1000,37790=>1000,37791=>1000,37792=>1000,37793=>1000,37794=>1000,37795=>1000,37796=>1000, - 37797=>1000,37798=>1000,37799=>1000,37800=>1000,37801=>1000,37802=>1000,37803=>1000,37804=>1000,37805=>1000,37806=>1000,37807=>1000,37808=>1000,37809=>1000,37810=>1000,37811=>1000,37812=>1000, - 37813=>1000,37814=>1000,37815=>1000,37816=>1000,37817=>1000,37818=>1000,37819=>1000,37820=>1000,37821=>1000,37822=>1000,37823=>1000,37824=>1000,37825=>1000,37826=>1000,37827=>1000,37828=>1000, - 37829=>1000,37830=>1000,37831=>1000,37832=>1000,37833=>1000,37834=>1000,37835=>1000,37836=>1000,37837=>1000,37838=>1000,37839=>1000,37840=>1000,37841=>1000,37842=>1000,37843=>1000,37844=>1000, - 37845=>1000,37846=>1000,37847=>1000,37848=>1000,37849=>1000,37850=>1000,37851=>1000,37852=>1000,37853=>1000,37854=>1000,37855=>1000,37856=>1000,37857=>1000,37858=>1000,37859=>1000,37860=>1000, - 37861=>1000,37862=>1000,37863=>1000,37864=>1000,37865=>1000,37866=>1000,37867=>1000,37868=>1000,37869=>1000,37870=>1000,37871=>1000,37872=>1000,37873=>1000,37874=>1000,37875=>1000,37876=>1000, - 37877=>1000,37878=>1000,37879=>1000,37880=>1000,37881=>1000,37882=>1000,37883=>1000,37884=>1000,37885=>1000,37886=>1000,37887=>1000,37888=>1000,37889=>1000,37890=>1000,37891=>1000,37892=>1000, - 37893=>1000,37894=>1000,37895=>1000,37896=>1000,37897=>1000,37898=>1000,37899=>1000,37900=>1000,37901=>1000,37902=>1000,37903=>1000,37904=>1000,37905=>1000,37906=>1000,37907=>1000,37908=>1000, - 37909=>1000,37910=>1000,37911=>1000,37912=>1000,37913=>1000,37914=>1000,37915=>1000,37916=>1000,37917=>1000,37918=>1000,37919=>1000,37920=>1000,37921=>1000,37922=>1000,37923=>1000,37924=>1000, - 37925=>1000,37926=>1000,37927=>998,37928=>1000,37929=>1000,37930=>1000,37931=>1000,37932=>1000,37933=>1000,37934=>1000,37935=>1000,37936=>1000,37937=>1000,37938=>1000,37939=>1000,37940=>1000, - 37941=>1000,37942=>1000,37943=>1000,37944=>1000,37945=>1000,37946=>1000,37947=>1000,37948=>1000,37949=>1000,37950=>1000,37951=>1000,37952=>1000,37953=>1000,37954=>1000,37955=>1000,37956=>1000, - 37957=>1000,37958=>1000,37959=>1000,37960=>1000,37961=>1000,37962=>1000,37963=>1000,37964=>1000,37965=>1000,37966=>1000,37967=>1000,37968=>1000,37969=>1000,37970=>1000,37971=>1000,37972=>1000, - 37973=>1000,37974=>1000,37975=>1000,37976=>1000,37977=>1000,37978=>1000,37979=>1000,37980=>1000,37981=>1000,37982=>1000,37983=>1000,37984=>1000,37985=>1000,37986=>1000,37987=>1000,37988=>1000, - 37989=>1000,37990=>1000,37991=>1000,37992=>1000,37993=>1000,37994=>1000,37995=>1000,37996=>1000,37997=>1000,37998=>1000,37999=>1000,38000=>1000,38001=>1000,38002=>1000,38003=>1000,38004=>1000, - 38005=>1000,38006=>1000,38007=>1000,38008=>1000,38009=>1000,38010=>1000,38011=>1000,38012=>1000,38013=>1000,38014=>1000,38015=>1000,38016=>1000,38017=>1000,38018=>1000,38019=>1000,38020=>1000, - 38021=>1000,38022=>1000,38023=>1000,38024=>1000,38025=>1000,38026=>1000,38027=>1000,38028=>1000,38029=>1000,38030=>1000,38031=>1000,38032=>1000,38033=>1000,38034=>1000,38035=>1000,38036=>1000, - 38037=>1000,38038=>1000,38039=>1000,38040=>1000,38041=>1000,38042=>1000,38043=>1000,38044=>1000,38045=>1000,38046=>1000,38047=>1000,38048=>1000,38049=>1000,38050=>1000,38051=>1000,38052=>1000, - 38053=>1000,38054=>1000,38055=>1000,38056=>1000,38057=>1000,38058=>1000,38059=>1000,38060=>1000,38061=>1000,38062=>1000,38063=>1000,38064=>1000,38065=>1000,38066=>1000,38067=>1000,38068=>1000, - 38069=>1000,38070=>1000,38071=>1000,38072=>1000,38073=>1000,38074=>1000,38075=>1000,38076=>1000,38077=>1000,38078=>1000,38079=>1000,38080=>1000,38081=>1000,38082=>1000,38083=>1000,38084=>1000, - 38085=>1000,38086=>1000,38087=>1000,38088=>1000,38089=>1000,38090=>1000,38091=>1000,38092=>1000,38093=>1000,38094=>1000,38095=>1000,38096=>1000,38097=>1000,38098=>1000,38099=>1000,38100=>1000, - 38101=>1000,38102=>1000,38103=>1000,38104=>1000,38105=>1000,38106=>1000,38107=>1000,38108=>1000,38109=>1000,38110=>1000,38111=>1000,38112=>1000,38113=>1000,38114=>1000,38115=>1000,38116=>1000, - 38117=>1000,38118=>1000,38119=>1000,38120=>1000,38121=>1000,38122=>1000,38123=>1000,38124=>1000,38125=>1000,38126=>1000,38127=>1000,38128=>1000,38129=>1000,38130=>1000,38131=>1000,38132=>1000, - 38133=>1000,38134=>1000,38135=>1000,38136=>1000,38137=>1000,38138=>1000,38139=>1000,38140=>1000,38141=>1000,38142=>1000,38143=>1000,38144=>1000,38145=>1000,38146=>1000,38147=>1000,38148=>1000, - 38149=>1000,38150=>1000,38151=>1000,38152=>1000,38153=>1000,38154=>1000,38155=>1000,38156=>1000,38157=>1000,38158=>1000,38159=>1000,38160=>1000,38161=>1000,38162=>1000,38163=>1000,38164=>1000, - 38165=>1000,38166=>1000,38167=>1000,38168=>1000,38169=>1000,38170=>1000,38171=>1000,38172=>1000,38173=>1000,38174=>1000,38175=>1000,38176=>1000,38177=>1000,38178=>1000,38179=>1000,38180=>1000, - 38181=>1000,38182=>1000,38183=>1000,38184=>1000,38185=>1000,38186=>1000,38187=>1000,38188=>1000,38189=>1000,38190=>1000,38191=>1000,38192=>1000,38193=>1000,38194=>1000,38195=>1000,38196=>1000, - 38197=>1000,38198=>1000,38199=>1000,38200=>1000,38201=>1000,38202=>1000,38203=>1000,38204=>1000,38205=>1000,38206=>1000,38207=>1000,38208=>1000,38209=>1000,38210=>1000,38211=>1000,38212=>1000, - 38213=>1000,38214=>1000,38215=>1000,38216=>1000,38217=>1000,38218=>1000,38219=>1000,38220=>1000,38221=>1000,38222=>1000,38223=>1000,38224=>1000,38225=>1000,38226=>1000,38227=>1000,38228=>1000, - 38229=>1000,38230=>1000,38231=>1000,38232=>1000,38233=>1000,38234=>1000,38235=>1000,38236=>1000,38237=>1000,38238=>1000,38239=>1000,38240=>1000,38241=>1000,38242=>1000,38243=>1000,38244=>1000, - 38245=>1000,38246=>1000,38247=>1000,38248=>1000,38249=>1000,38250=>1000,38251=>1000,38252=>1000,38253=>1000,38254=>1000,38255=>1000,38256=>1000,38257=>1000,38258=>1000,38259=>1000,38260=>1000, - 38261=>1000,38262=>1000,38263=>1000,38264=>1000,38265=>1000,38266=>1000,38267=>1000,38268=>1000,38269=>1000,38270=>1000,38271=>1000,38272=>1000,38273=>1000,38274=>1000,38275=>1000,38276=>1000, - 38277=>1000,38278=>1000,38279=>1000,38280=>1000,38281=>1000,38282=>1000,38283=>1000,38284=>1000,38285=>1000,38286=>1000,38287=>1000,38288=>1000,38289=>1000,38290=>1000,38291=>1000,38292=>1000, - 38293=>1000,38294=>1000,38295=>1000,38296=>1000,38297=>1000,38298=>1000,38299=>1000,38300=>1000,38301=>1000,38302=>1000,38303=>1000,38304=>1000,38305=>1000,38306=>1000,38307=>1000,38308=>1000, - 38309=>1000,38310=>1000,38311=>1000,38312=>1000,38313=>1000,38314=>1000,38315=>1000,38316=>1000,38317=>1000,38318=>1000,38319=>1000,38320=>1000,38321=>1000,38322=>1000,38323=>1000,38324=>1000, - 38325=>1000,38326=>1000,38327=>1000,38328=>1000,38329=>1000,38330=>1000,38331=>1000,38332=>1000,38333=>1000,38334=>1000,38335=>1000,38336=>1000,38337=>1000,38338=>1000,38339=>1000,38340=>1000, - 38341=>1000,38342=>1000,38343=>1000,38344=>1000,38345=>1000,38346=>1000,38347=>1000,38348=>1000,38349=>1000,38350=>1000,38351=>1000,38352=>1000,38353=>1000,38354=>1000,38355=>1000,38356=>1000, - 38357=>1000,38358=>1000,38359=>1000,38360=>1000,38361=>1000,38362=>1000,38363=>1000,38364=>1000,38365=>1000,38366=>1000,38367=>1000,38368=>1000,38369=>1000,38370=>1000,38371=>1000,38372=>1000, - 38373=>1000,38374=>1000,38375=>1000,38376=>1000,38377=>1000,38378=>1000,38379=>1000,38380=>1000,38381=>1000,38382=>1000,38383=>1000,38384=>1000,38385=>1000,38386=>1000,38387=>1000,38388=>1000, - 38389=>1000,38390=>1000,38391=>1000,38392=>1000,38393=>1000,38394=>1000,38395=>1000,38396=>1000,38397=>1000,38398=>1000,38399=>1000,38400=>1000,38401=>1000,38402=>1000,38403=>1000,38404=>1000, - 38405=>1000,38406=>1000,38407=>1000,38408=>1000,38409=>1000,38410=>1000,38411=>1000,38412=>1000,38413=>1000,38414=>1000,38415=>1000,38416=>1000,38417=>1000,38418=>1000,38419=>1000,38420=>1000, - 38421=>1000,38422=>1000,38423=>1000,38424=>1000,38425=>1000,38426=>1000,38427=>1000,38428=>1000,38429=>1000,38430=>1000,38431=>1000,38432=>1000,38433=>1000,38434=>1000,38435=>1000,38436=>1000, - 38437=>1000,38438=>1000,38439=>1000,38440=>1000,38441=>1000,38442=>1000,38443=>1000,38444=>1000,38445=>1000,38446=>1000,38447=>1000,38448=>1000,38449=>1000,38450=>1000,38451=>1000,38452=>1000, - 38453=>1000,38454=>1000,38455=>1000,38456=>1000,38457=>1000,38458=>1000,38459=>1000,38460=>1000,38461=>1000,38462=>1000,38463=>1000,38464=>1000,38465=>1000,38466=>1000,38467=>1000,38468=>1000, - 38469=>1000,38470=>1000,38471=>1000,38472=>1000,38473=>1000,38474=>1000,38475=>1000,38476=>1000,38477=>1000,38478=>1000,38479=>1000,38480=>1000,38481=>1000,38482=>1000,38483=>1000,38484=>1000, - 38485=>1000,38486=>1000,38487=>1000,38488=>1000,38489=>1000,38490=>1000,38491=>1000,38492=>1000,38493=>1000,38494=>1000,38495=>1000,38496=>1000,38497=>1000,38498=>1000,38499=>1000,38500=>1000, - 38501=>1000,38502=>1000,38503=>1000,38504=>1000,38505=>1000,38506=>1000,38507=>1000,38508=>1000,38509=>1000,38510=>1000,38511=>1000,38512=>1000,38513=>1000,38514=>1000,38515=>1000,38516=>1000, - 38517=>1000,38518=>1000,38519=>1000,38520=>1000,38521=>1000,38522=>1000,38523=>1000,38524=>1000,38525=>1000,38526=>1000,38527=>1000,38528=>1000,38529=>1000,38530=>1000,38531=>1000,38532=>1000, - 38533=>1000,38534=>1000,38535=>1000,38536=>1000,38537=>1000,38538=>1000,38539=>1000,38540=>1000,38541=>1000,38542=>1000,38543=>1000,38544=>1000,38545=>1000,38546=>1000,38547=>1000,38548=>1000, - 38549=>1000,38550=>1000,38551=>1000,38552=>1000,38553=>1000,38554=>1000,38555=>1000,38556=>1000,38557=>1000,38558=>1000,38559=>1000,38560=>1000,38561=>1000,38562=>1000,38563=>1000,38564=>1000, - 38565=>1000,38566=>1000,38567=>1000,38568=>1000,38569=>1000,38570=>1000,38571=>1000,38572=>1000,38573=>1000,38574=>1000,38575=>1000,38576=>1000,38577=>1000,38578=>1000,38579=>1000,38580=>1000, - 38581=>1000,38582=>1000,38583=>1000,38584=>1000,38585=>1000,38586=>1000,38587=>1000,38588=>1000,38589=>1000,38590=>1000,38591=>1000,38592=>1000,38593=>1000,38594=>1000,38595=>1000,38596=>1000, - 38597=>1000,38598=>1000,38599=>1000,38600=>1000,38601=>1000,38602=>1000,38603=>1000,38604=>1000,38605=>1000,38606=>1000,38607=>1000,38608=>1000,38609=>1000,38610=>1000,38611=>1000,38612=>1000, - 38613=>1000,38614=>1000,38615=>1000,38616=>1000,38617=>1000,38618=>1000,38619=>1000,38620=>1000,38621=>1000,38622=>1000,38623=>1000,38624=>1000,38625=>1000,38626=>1000,38627=>1000,38628=>1000, - 38629=>1000,38630=>1000,38631=>1000,38632=>1000,38633=>1000,38634=>1000,38635=>1000,38636=>1000,38637=>1000,38638=>1000,38639=>1000,38640=>1000,38641=>1000,38642=>1000,38643=>1000,38644=>1000, - 38645=>1000,38646=>1000,38647=>1000,38648=>1000,38649=>1000,38650=>1000,38651=>1000,38652=>1000,38653=>1000,38654=>1000,38655=>1000,38656=>1000,38657=>1000,38658=>1000,38659=>1000,38660=>1000, - 38661=>1000,38662=>1000,38663=>1000,38664=>1000,38665=>1000,38666=>1000,38667=>1000,38668=>1000,38669=>1000,38670=>1000,38671=>1000,38672=>1000,38673=>1000,38674=>1000,38675=>1000,38676=>1000, - 38677=>1000,38678=>1000,38679=>1000,38680=>1000,38681=>1000,38682=>1000,38683=>1000,38684=>1000,38685=>1000,38686=>1000,38687=>1000,38688=>1000,38689=>1000,38690=>1000,38691=>1000,38692=>1000, - 38693=>1000,38694=>1000,38695=>1000,38696=>1000,38697=>1000,38698=>1000,38699=>1000,38700=>1000,38701=>1000,38702=>1000,38703=>1000,38704=>1000,38705=>1000,38706=>1000,38707=>1000,38708=>1000, - 38709=>1000,38710=>1000,38711=>1000,38712=>1000,38713=>1000,38714=>1000,38715=>1000,38716=>1000,38717=>1000,38718=>1000,38719=>1000,38720=>1000,38721=>1000,38722=>1000,38723=>1000,38724=>1000, - 38725=>1000,38726=>1000,38727=>1000,38728=>1000,38729=>1000,38730=>1000,38731=>1000,38732=>1000,38733=>1000,38734=>1000,38735=>1000,38736=>1000,38737=>1000,38738=>1000,38739=>1000,38740=>1000, - 38741=>1000,38742=>1000,38743=>1000,38744=>1000,38745=>1000,38746=>1000,38747=>1000,38748=>1000,38749=>1000,38750=>1000,38751=>1000,38752=>1000,38753=>1000,38754=>1000,38755=>1000,38756=>1000, - 38757=>1000,38758=>1000,38759=>1000,38760=>1000,38761=>1000,38762=>1000,38763=>1000,38764=>1000,38765=>1000,38766=>1000,38767=>1000,38768=>1000,38769=>1000,38770=>1000,38771=>1000,38772=>1000, - 38773=>1000,38774=>1000,38775=>1000,38776=>1000,38777=>1000,38778=>1000,38779=>1000,38780=>1000,38781=>1000,38782=>1000,38783=>1000,38784=>1000,38785=>1000,38786=>1000,38787=>1000,38788=>1000, - 38789=>1000,38790=>1000,38791=>1000,38792=>1000,38793=>1000,38794=>1000,38795=>1000,38796=>1000,38797=>1000,38798=>1000,38799=>1000,38800=>1000,38801=>1000,38802=>1000,38803=>1000,38804=>1000, - 38805=>1000,38806=>1000,38807=>1000,38808=>1000,38809=>1000,38810=>1000,38811=>1000,38812=>1000,38813=>1000,38814=>1000,38815=>1000,38816=>1000,38817=>1000,38818=>1000,38819=>1000,38820=>1000, - 38821=>1000,38822=>1000,38823=>1000,38824=>1000,38825=>1000,38826=>1000,38827=>1000,38828=>1000,38829=>1000,38830=>1000,38831=>1000,38832=>1000,38833=>1000,38834=>1000,38835=>1000,38836=>1000, - 38837=>1000,38838=>1000,38839=>1000,38840=>1000,38841=>1000,38842=>1000,38843=>1000,38844=>1000,38845=>1000,38846=>1000,38847=>1000,38848=>1000,38849=>1000,38850=>1000,38851=>1000,38852=>1000, - 38853=>1000,38854=>1000,38855=>1000,38856=>1000,38857=>1000,38858=>1000,38859=>1000,38860=>1000,38861=>1000,38862=>1000,38863=>1000,38864=>1000,38865=>1000,38866=>1000,38867=>1000,38868=>1000, - 38869=>1000,38870=>1000,38871=>1000,38872=>1000,38873=>1000,38874=>1000,38875=>1000,38876=>1000,38877=>1000,38878=>1000,38879=>1000,38880=>1000,38881=>1000,38882=>1000,38883=>1000,38884=>1000, - 38885=>1000,38886=>1000,38887=>1000,38888=>1000,38889=>1000,38890=>1000,38891=>1000,38892=>1000,38893=>1000,38894=>1000,38895=>1000,38896=>1000,38897=>1000,38898=>1000,38899=>1000,38900=>1000, - 38901=>1000,38902=>1000,38903=>1000,38904=>1000,38905=>1000,38906=>1000,38907=>1000,38908=>1000,38909=>1000,38910=>1000,38911=>1000,38912=>1000,38913=>1000,38914=>1000,38915=>1000,38916=>1000, - 38917=>1000,38918=>1000,38919=>1000,38920=>1000,38921=>1000,38922=>1000,38923=>1000,38924=>1000,38925=>1000,38926=>1000,38927=>1000,38928=>1000,38929=>1000,38930=>1000,38931=>1000,38932=>1000, - 38933=>1000,38934=>1000,38935=>1000,38936=>1000,38937=>1000,38938=>1000,38939=>1000,38940=>1000,38941=>1000,38942=>1000,38943=>1000,38944=>1000,38945=>1000,38946=>1000,38947=>1000,38948=>1000, - 38949=>1000,38950=>1000,38951=>1000,38952=>1000,38953=>1000,38954=>1000,38955=>1000,38956=>1000,38957=>1000,38958=>1000,38959=>1000,38960=>1000,38961=>1000,38962=>1000,38963=>1000,38964=>1000, - 38965=>1000,38966=>1000,38967=>1000,38968=>1000,38969=>1000,38970=>1000,38971=>1000,38972=>1000,38973=>1000,38974=>1000,38975=>1000,38976=>1000,38977=>1000,38978=>1000,38979=>1000,38980=>1000, - 38981=>1000,38982=>1000,38983=>1000,38984=>1000,38985=>1000,38986=>1000,38987=>1000,38988=>1000,38989=>1000,38990=>1000,38991=>1000,38992=>1000,38993=>1000,38994=>1000,38995=>1000,38996=>1000, - 38997=>1000,38998=>1000,38999=>1000,39000=>1000,39001=>1000,39002=>1000,39003=>1000,39004=>1000,39005=>1000,39006=>1000,39007=>1000,39008=>1000,39009=>1000,39010=>1000,39011=>1000,39012=>1000, - 39013=>1000,39014=>1000,39015=>1000,39016=>1000,39017=>1000,39018=>1000,39019=>1000,39020=>1000,39021=>1000,39022=>1000,39023=>1000,39024=>1000,39025=>1000,39026=>1000,39027=>1000,39028=>1000, - 39029=>1000,39030=>1000,39031=>1000,39032=>1000,39033=>1000,39034=>1000,39035=>1000,39036=>1000,39037=>1000,39038=>1000,39039=>1000,39040=>1000,39041=>1000,39042=>1000,39043=>1000,39044=>1000, - 39045=>1000,39046=>1000,39047=>1000,39048=>1000,39049=>1000,39050=>1000,39051=>1000,39052=>1000,39053=>1000,39054=>1000,39055=>1000,39056=>1000,39057=>1000,39058=>1000,39059=>1000,39060=>1000, - 39061=>1000,39062=>1000,39063=>1000,39064=>1000,39065=>1000,39066=>1000,39067=>1000,39068=>1000,39069=>1000,39070=>1000,39071=>1000,39072=>1000,39073=>1000,39074=>1000,39075=>1000,39076=>1000, - 39077=>1000,39078=>1000,39079=>1000,39080=>1000,39081=>1000,39082=>1000,39083=>1000,39084=>1000,39085=>1000,39086=>1000,39087=>1000,39088=>1000,39089=>1000,39090=>1000,39091=>1000,39092=>1000, - 39093=>1000,39094=>1000,39095=>1000,39096=>1000,39097=>1000,39098=>1000,39099=>1000,39100=>1000,39101=>1000,39102=>1000,39103=>1000,39104=>1000,39105=>1000,39106=>1000,39107=>1000,39108=>1000, - 39109=>1000,39110=>1000,39111=>1000,39112=>1000,39113=>1000,39114=>1000,39115=>1000,39116=>1000,39117=>1000,39118=>1000,39119=>1000,39120=>1000,39121=>1000,39122=>1000,39123=>1000,39124=>1000, - 39125=>1000,39126=>1000,39127=>1000,39128=>1000,39129=>1000,39130=>1000,39131=>1000,39132=>1000,39133=>1000,39134=>1000,39135=>1000,39136=>1000,39137=>1000,39138=>1000,39139=>1000,39140=>1000, - 39141=>1000,39142=>1000,39143=>1000,39144=>1000,39145=>1000,39146=>1000,39147=>1000,39148=>1000,39149=>1000,39150=>1000,39151=>1000,39152=>1000,39153=>1000,39154=>1000,39155=>1000,39156=>1000, - 39157=>1000,39158=>1000,39159=>1000,39160=>1000,39161=>1000,39162=>1000,39163=>1000,39164=>1000,39165=>1000,39166=>1000,39167=>1000,39168=>1000,39169=>1000,39170=>1000,39171=>1000,39172=>1000, - 39173=>1000,39174=>1000,39175=>1000,39176=>1000,39177=>1000,39178=>1000,39179=>1000,39180=>1000,39181=>1000,39182=>1000,39183=>1000,39184=>1000,39185=>1000,39186=>1000,39187=>1000,39188=>1000, - 39189=>1000,39190=>1000,39191=>1000,39192=>1000,39193=>1000,39194=>1000,39195=>1000,39196=>1000,39197=>1000,39198=>1000,39199=>1000,39200=>1000,39201=>1000,39202=>1000,39203=>1000,39204=>1000, - 39205=>1000,39206=>1000,39207=>1000,39208=>1000,39209=>1000,39210=>1000,39211=>1000,39212=>1000,39213=>1000,39214=>1000,39215=>1000,39216=>1000,39217=>1000,39218=>1000,39219=>1000,39220=>1000, - 39221=>1000,39222=>1000,39223=>1000,39224=>1000,39225=>1000,39226=>1000,39227=>1000,39228=>1000,39229=>1000,39230=>1000,39231=>1000,39232=>1000,39233=>1000,39234=>1000,39235=>1000,39236=>1000, - 39237=>1000,39238=>1000,39239=>1000,39240=>1000,39241=>1000,39242=>1000,39243=>1000,39244=>1000,39245=>1000,39246=>1000,39247=>1000,39248=>1000,39249=>1000,39250=>1000,39251=>1000,39252=>1000, - 39253=>1000,39254=>1000,39255=>1000,39256=>1000,39257=>1000,39258=>1000,39259=>1000,39260=>1000,39261=>1000,39262=>1000,39263=>1000,39264=>1000,39265=>1000,39266=>1000,39267=>1000,39268=>1000, - 39269=>1000,39270=>1000,39271=>1000,39272=>1000,39273=>1000,39274=>1000,39275=>1000,39276=>1000,39277=>1000,39278=>1000,39279=>1000,39280=>1000,39281=>1000,39282=>1000,39283=>1000,39284=>1000, - 39285=>1000,39286=>1000,39287=>1000,39288=>1000,39289=>1000,39290=>1000,39291=>1000,39292=>1000,39293=>1000,39294=>1000,39295=>1000,39296=>1000,39297=>1000,39298=>1000,39299=>1000,39300=>1000, - 39301=>1000,39302=>1000,39303=>1000,39304=>1000,39305=>1000,39306=>1000,39307=>1000,39308=>1000,39309=>1000,39310=>1000,39311=>1000,39312=>1000,39313=>1000,39314=>1000,39315=>1000,39316=>1000, - 39317=>1000,39318=>1000,39319=>1000,39320=>1000,39321=>1000,39322=>1000,39323=>1000,39324=>1000,39325=>1000,39326=>1000,39327=>1000,39328=>1000,39329=>1000,39330=>1000,39331=>1000,39332=>1000, - 39333=>1000,39334=>1000,39335=>1000,39336=>1000,39337=>1000,39338=>1000,39339=>1000,39340=>1000,39341=>1000,39342=>1000,39343=>1000,39344=>1000,39345=>1000,39346=>1000,39347=>1000,39348=>1000, - 39349=>1000,39350=>1000,39351=>1000,39352=>1000,39353=>1000,39354=>1000,39355=>1000,39356=>1000,39357=>1000,39358=>1000,39359=>1000,39360=>1000,39361=>1000,39362=>1000,39363=>1000,39364=>1000, - 39365=>1000,39366=>1000,39367=>1000,39368=>1000,39369=>1000,39370=>1000,39371=>1000,39372=>1000,39373=>1000,39374=>1000,39375=>1000,39376=>1000,39377=>1000,39378=>1000,39379=>1000,39380=>1000, - 39381=>1000,39382=>1000,39383=>1000,39384=>1000,39385=>1000,39386=>1000,39387=>1000,39388=>1000,39389=>1000,39390=>1000,39391=>1000,39392=>1000,39393=>1000,39394=>1000,39395=>1000,39396=>1000, - 39397=>1000,39398=>1000,39399=>1000,39400=>1000,39401=>1000,39402=>1000,39403=>1000,39404=>1000,39405=>1000,39406=>1000,39407=>1000,39408=>1000,39409=>1000,39410=>1000,39411=>1000,39412=>1000, - 39413=>1000,39414=>1000,39415=>1000,39416=>1000,39417=>1000,39418=>1000,39419=>1000,39420=>1000,39421=>1000,39422=>1000,39423=>1000,39424=>1000,39425=>1000,39426=>1000,39427=>1000,39428=>1000, - 39429=>1000,39430=>1000,39431=>1000,39432=>1000,39433=>1000,39434=>1000,39435=>1000,39436=>1000,39437=>1000,39438=>1000,39439=>1000,39440=>1000,39441=>1000,39442=>1000,39443=>1000,39444=>1000, - 39445=>1000,39446=>1000,39447=>1000,39448=>1000,39449=>1000,39450=>1000,39451=>1000,39452=>1000,39453=>1000,39454=>1000,39455=>1000,39456=>1000,39457=>1000,39458=>1000,39459=>1000,39460=>1000, - 39461=>1000,39462=>1000,39463=>1000,39464=>1000,39465=>1000,39466=>1000,39467=>1000,39468=>1000,39469=>1000,39470=>1000,39471=>1000,39472=>1000,39473=>1000,39474=>1000,39475=>1000,39476=>1000, - 39477=>1000,39478=>1000,39479=>1000,39480=>1000,39481=>1000,39482=>1000,39483=>1000,39484=>1000,39485=>1000,39486=>1000,39487=>1000,39488=>1000,39489=>1000,39490=>1000,39491=>1000,39492=>1000, - 39493=>1000,39494=>1000,39495=>1000,39496=>1000,39497=>1000,39498=>1000,39499=>1000,39500=>1000,39501=>1000,39502=>1000,39503=>1000,39504=>1000,39505=>1000,39506=>1000,39507=>1000,39508=>1000, - 39509=>1000,39510=>1000,39511=>1000,39512=>1000,39513=>1000,39514=>1000,39515=>1000,39516=>1000,39517=>1000,39518=>1000,39519=>1000,39520=>1000,39521=>1000,39522=>1000,39523=>1000,39524=>1000, - 39525=>1000,39526=>1000,39527=>1000,39528=>1000,39529=>1000,39530=>1000,39531=>1000,39532=>1000,39533=>1000,39534=>1000,39535=>1000,39536=>1000,39537=>1000,39538=>1000,39539=>1000,39540=>1000, - 39541=>1000,39542=>1000,39543=>1000,39544=>1000,39545=>1000,39546=>1000,39547=>1000,39548=>1000,39549=>1000,39550=>1000,39551=>1000,39552=>1000,39553=>1000,39554=>1000,39555=>1000,39556=>1000, - 39557=>1000,39558=>1000,39559=>1000,39560=>1000,39561=>1000,39562=>1000,39563=>1000,39564=>1000,39565=>1000,39566=>1000,39567=>1000,39568=>1000,39569=>1000,39570=>1000,39571=>1000,39572=>1000, - 39573=>1000,39574=>1000,39575=>1000,39576=>1000,39577=>1000,39578=>1000,39579=>1000,39580=>1000,39581=>1000,39582=>1000,39583=>1000,39584=>1000,39585=>1000,39586=>1000,39587=>1000,39588=>1000, - 39589=>1000,39590=>1000,39591=>1000,39592=>1000,39593=>1000,39594=>1000,39595=>1000,39596=>1000,39597=>1000,39598=>1000,39599=>1000,39600=>1000,39601=>1000,39602=>1000,39603=>1000,39604=>1000, - 39605=>1000,39606=>1000,39607=>1000,39608=>1000,39609=>1000,39610=>1000,39611=>1000,39612=>1000,39613=>1000,39614=>1000,39615=>1000,39616=>1000,39617=>1000,39618=>1000,39619=>1000,39620=>1000, - 39621=>1000,39622=>1000,39623=>1000,39624=>1000,39625=>1000,39626=>1000,39627=>1000,39628=>1000,39629=>1000,39630=>1000,39631=>1000,39632=>1000,39633=>1000,39634=>1000,39635=>1000,39636=>1000, - 39637=>1000,39638=>1000,39639=>1000,39640=>1000,39641=>1000,39642=>1000,39643=>1000,39644=>1000,39645=>1000,39646=>1000,39647=>1000,39648=>1000,39649=>1000,39650=>1000,39651=>1000,39652=>1000, - 39653=>1000,39654=>1000,39655=>1000,39656=>1000,39657=>1000,39658=>1000,39659=>1000,39660=>1000,39661=>1000,39662=>1000,39663=>1000,39664=>1000,39665=>1000,39666=>1000,39667=>1000,39668=>1000, - 39669=>1000,39670=>1000,39671=>1000,39672=>1000,39673=>1000,39674=>1000,39675=>1000,39676=>1000,39677=>1000,39678=>1000,39679=>1000,39680=>1000,39681=>1000,39682=>1000,39683=>1000,39684=>1000, - 39685=>1000,39686=>1000,39687=>1000,39688=>1000,39689=>1000,39690=>1000,39691=>1000,39692=>1000,39693=>1000,39694=>1000,39695=>1000,39696=>1000,39697=>1000,39698=>1000,39699=>1000,39700=>1000, - 39701=>1000,39702=>1000,39703=>1000,39704=>1000,39705=>1000,39706=>1000,39707=>1000,39708=>1000,39709=>1000,39710=>1000,39711=>1000,39712=>1000,39713=>1000,39714=>1000,39715=>1000,39716=>1000, - 39717=>1000,39718=>1000,39719=>1000,39720=>1000,39721=>1000,39722=>1000,39723=>1000,39724=>1000,39725=>1000,39726=>1000,39727=>1000,39728=>1000,39729=>1000,39730=>1000,39731=>1000,39732=>1000, - 39733=>1000,39734=>1000,39735=>1000,39736=>1000,39737=>1000,39738=>1000,39739=>1000,39740=>1000,39741=>1000,39742=>1000,39743=>1000,39744=>1000,39745=>1000,39746=>1000,39747=>1000,39748=>1000, - 39749=>1000,39750=>1000,39751=>1000,39752=>1000,39753=>1000,39754=>1000,39755=>1000,39756=>1000,39757=>1000,39758=>1000,39759=>1000,39760=>1000,39761=>1000,39762=>1000,39763=>1000,39764=>1000, - 39765=>1000,39766=>1000,39767=>1000,39768=>1000,39769=>1000,39770=>1000,39771=>1000,39772=>1000,39773=>1000,39774=>1000,39775=>1000,39776=>1000,39777=>1000,39778=>1000,39779=>1000,39780=>1000, - 39781=>1000,39782=>1000,39783=>1000,39784=>1000,39785=>1000,39786=>1000,39787=>1000,39788=>1000,39789=>1000,39790=>1000,39791=>1000,39792=>1000,39793=>1000,39794=>1000,39795=>1000,39796=>1000, - 39797=>1000,39798=>1000,39799=>1000,39800=>1000,39801=>1000,39802=>1000,39803=>1000,39804=>1000,39805=>1000,39806=>1000,39807=>1000,39808=>1000,39809=>1000,39810=>1000,39811=>1000,39812=>1000, - 39813=>1000,39814=>1000,39815=>1000,39816=>1000,39817=>1000,39818=>1000,39819=>1000,39820=>1000,39821=>1000,39822=>1000,39823=>1000,39824=>1000,39825=>1000,39826=>1000,39827=>1000,39828=>1000, - 39829=>1000,39830=>1000,39831=>1000,39832=>1000,39833=>1000,39834=>1000,39835=>1000,39836=>1000,39837=>1000,39838=>1000,39839=>1000,39840=>1000,39841=>1000,39842=>1000,39843=>1000,39844=>1000, - 39845=>1000,39846=>1000,39847=>1000,39848=>1000,39849=>1000,39850=>1000,39851=>1000,39852=>1000,39853=>1000,39854=>1000,39855=>1000,39856=>1000,39857=>1000,39858=>1000,39859=>1000,39860=>1000, - 39861=>1000,39862=>1000,39863=>1000,39864=>1000,39865=>1000,39866=>1000,39867=>1000,39868=>1000,39869=>1000,39870=>1000,39871=>1000,39872=>1000,39873=>1000,39874=>1000,39875=>1000,39876=>1000, - 39877=>1000,39878=>1000,39879=>1000,39880=>1000,39881=>1000,39882=>1000,39883=>1000,39884=>1000,39885=>1000,39886=>1000,39887=>1000,39888=>1000,39889=>1000,39890=>1000,39891=>1000,39892=>1000, - 39893=>1000,39894=>1000,39895=>1000,39896=>1000,39897=>1000,39898=>1000,39899=>1000,39900=>1000,39901=>1000,39902=>1000,39903=>1000,39904=>1000,39905=>1000,39906=>1000,39907=>1000,39908=>1000, - 39909=>1000,39910=>1000,39911=>1000,39912=>1000,39913=>1000,39914=>1000,39915=>1000,39916=>1000,39917=>1000,39918=>1000,39919=>1000,39920=>1000,39921=>1000,39922=>1000,39923=>1000,39924=>1000, - 39925=>1000,39926=>1000,39927=>1000,39928=>1000,39929=>1000,39930=>1000,39931=>1000,39932=>1000,39933=>1000,39934=>1000,39935=>1000,39936=>1000,39937=>1000,39938=>1000,39939=>1000,39940=>1000, - 39941=>1000,39942=>1000,39943=>1000,39944=>1000,39945=>1000,39946=>1000,39947=>1000,39948=>1000,39949=>1000,39950=>1000,39951=>1000,39952=>1000,39953=>1000,39954=>1000,39955=>1000,39956=>1000, - 39957=>1000,39958=>1000,39959=>1000,39960=>1000,39961=>1000,39962=>1000,39963=>1000,39964=>1000,39965=>1000,39966=>1000,39967=>1000,39968=>1000,39969=>1000,39970=>1000,39971=>1000,39972=>1000, - 39973=>1000,39974=>1000,39975=>1000,39976=>1000,39977=>1000,39978=>1000,39979=>1000,39980=>1000,39981=>1000,39982=>1000,39983=>1000,39984=>1000,39985=>1000,39986=>1000,39987=>1000,39988=>1000, - 39989=>1000,39990=>1000,39991=>1000,39992=>1000,39993=>1000,39994=>1000,39995=>1000,39996=>1000,39997=>1000,39998=>1000,39999=>1000,40000=>1000,40001=>1000,40002=>1000,40003=>1000,40004=>1000, - 40005=>1000,40006=>1000,40007=>1000,40008=>1000,40009=>1000,40010=>1000,40011=>1000,40012=>1000,40013=>1000,40014=>1000,40015=>1000,40016=>1000,40017=>1000,40018=>1000,40019=>1000,40020=>1000, - 40021=>1000,40022=>1000,40023=>1000,40024=>1000,40025=>1000,40026=>1000,40027=>1000,40028=>1000,40029=>1000,40030=>1000,40031=>1000,40032=>1000,40033=>1000,40034=>1000,40035=>1000,40036=>1000, - 40037=>1000,40038=>1000,40039=>1000,40040=>1000,40041=>1000,40042=>1000,40043=>1000,40044=>1000,40045=>1000,40046=>1000,40047=>1000,40048=>1000,40049=>1000,40050=>1000,40051=>1000,40052=>1000, - 40053=>1000,40054=>1000,40055=>1000,40056=>1000,40057=>1000,40058=>1000,40059=>1000,40060=>1000,40061=>1000,40062=>1000,40063=>1000,40064=>1000,40065=>1000,40066=>1000,40067=>1000,40068=>1000, - 40069=>1000,40070=>1000,40071=>1000,40072=>1000,40073=>1000,40074=>1000,40075=>1000,40076=>1000,40077=>1000,40078=>1000,40079=>1000,40080=>1000,40081=>1000,40082=>1000,40083=>1000,40084=>1000, - 40085=>1000,40086=>1000,40087=>1000,40088=>1000,40089=>1000,40090=>1000,40091=>1000,40092=>1000,40093=>1000,40094=>1000,40095=>1000,40096=>1000,40097=>1000,40098=>1000,40099=>1000,40100=>1000, - 40101=>1000,40102=>1000,40103=>1000,40104=>1000,40105=>1000,40106=>1000,40107=>1000,40108=>1000,40109=>1000,40110=>1000,40111=>1000,40112=>1000,40113=>1000,40114=>1000,40115=>1000,40116=>1000, - 40117=>1000,40118=>1000,40119=>1000,40120=>1000,40121=>1000,40122=>1000,40123=>1000,40124=>1000,40125=>1000,40126=>1000,40127=>1000,40128=>1000,40129=>1000,40130=>1000,40131=>1000,40132=>1000, - 40133=>1000,40134=>1000,40135=>1000,40136=>1000,40137=>1000,40138=>1000,40139=>1000,40140=>1000,40141=>1000,40142=>1000,40143=>1000,40144=>1000,40145=>1000,40146=>1000,40147=>1000,40148=>1000, - 40149=>1000,40150=>1000,40151=>1000,40152=>1000,40153=>1000,40154=>1000,40155=>1000,40156=>1000,40157=>1000,40158=>1000,40159=>1000,40160=>1000,40161=>1000,40162=>1000,40163=>1000,40164=>1000, - 40165=>1000,40166=>1000,40167=>1000,40168=>1000,40169=>1000,40170=>1000,40171=>1000,40172=>1000,40173=>1000,40174=>1000,40175=>1000,40176=>1000,40177=>1000,40178=>1000,40179=>1000,40180=>1000, - 40181=>1000,40182=>1000,40183=>1000,40184=>1000,40185=>1000,40186=>1000,40187=>1000,40188=>1000,40189=>1000,40190=>1000,40191=>1000,40192=>1000,40193=>1000,40194=>1000,40195=>1000,40196=>1000, - 40197=>1000,40198=>1000,40199=>1000,40200=>1000,40201=>1000,40202=>1000,40203=>1000,40204=>1000,40205=>1000,40206=>1000,40207=>1000,40208=>1000,40209=>1000,40210=>1000,40211=>1000,40212=>1000, - 40213=>1000,40214=>1000,40215=>1000,40216=>1000,40217=>1000,40218=>1000,40219=>1000,40220=>1000,40221=>1000,40222=>1000,40223=>1000,40224=>1000,40225=>1000,40226=>1000,40227=>1000,40228=>1000, - 40229=>1000,40230=>1000,40231=>1000,40232=>1000,40233=>1000,40234=>1000,40235=>1000,40236=>1000,40237=>1000,40238=>1000,40239=>1000,40240=>1000,40241=>1000,40242=>1000,40243=>1000,40244=>1000, - 40245=>1000,40246=>1000,40247=>1000,40248=>1000,40249=>1000,40250=>1000,40251=>1000,40252=>1000,40253=>1000,40254=>1000,40255=>1000,40256=>1000,40257=>1000,40258=>1000,40259=>1000,40260=>1000, - 40261=>1000,40262=>1000,40263=>1000,40264=>1000,40265=>1000,40266=>1000,40267=>1000,40268=>1000,40269=>1000,40270=>1000,40271=>1000,40272=>1000,40273=>1000,40274=>1000,40275=>1000,40276=>1000, - 40277=>1000,40278=>1000,40279=>1000,40280=>1000,40281=>1000,40282=>1000,40283=>1000,40284=>1000,40285=>1000,40286=>1000,40287=>1000,40288=>1000,40289=>1000,40290=>1000,40291=>1000,40292=>1000, - 40293=>1000,40294=>1000,40295=>1000,40296=>1000,40297=>1000,40298=>1000,40299=>1000,40300=>1000,40301=>1000,40302=>1000,40303=>1000,40304=>1000,40305=>1000,40306=>1000,40307=>1000,40308=>1000, - 40309=>1000,40310=>1000,40311=>1000,40312=>1000,40313=>1000,40314=>1000,40315=>1000,40316=>1000,40317=>1000,40318=>1000,40319=>1000,40320=>1000,40321=>1000,40322=>1000,40323=>1000,40324=>1000, - 40325=>1000,40326=>1000,40327=>1000,40328=>1000,40329=>1000,40330=>1000,40331=>1000,40332=>1000,40333=>1000,40334=>1000,40335=>1000,40336=>1000,40337=>1000,40338=>1000,40339=>1000,40340=>1000, - 40341=>1000,40342=>1000,40343=>1000,40344=>1000,40345=>1000,40346=>1000,40347=>1000,40348=>1000,40349=>1000,40350=>1000,40351=>1000,40352=>1000,40353=>1000,40354=>1000,40355=>1000,40356=>1000, - 40357=>1000,40358=>1000,40359=>1000,40360=>1000,40361=>1000,40362=>1000,40363=>1000,40364=>1000,40365=>1000,40366=>1000,40367=>1000,40368=>1000,40369=>1000,40370=>1000,40371=>1000,40372=>1000, - 40373=>1000,40374=>1000,40375=>1000,40376=>1000,40377=>1000,40378=>1000,40379=>1000,40380=>1000,40381=>1000,40382=>1000,40383=>1000,40384=>1000,40385=>1000,40386=>1000,40387=>1000,40388=>1000, - 40389=>1000,40390=>1000,40391=>1000,40392=>1000,40393=>1000,40394=>1000,40395=>1000,40396=>1000,40397=>1000,40398=>1000,40399=>1000,40400=>1000,40401=>1000,40402=>1000,40403=>1000,40404=>1000, - 40405=>1000,40406=>1000,40407=>1000,40408=>1000,40409=>1000,40410=>1000,40411=>1000,40412=>1000,40413=>1000,40414=>1000,40415=>1000,40416=>1000,40417=>1000,40418=>1000,40419=>1000,40420=>1000, - 40421=>1000,40422=>1000,40423=>1000,40424=>1000,40425=>1000,40426=>1000,40427=>1000,40428=>1000,40429=>1000,40430=>1000,40431=>1000,40432=>1000,40433=>1000,40434=>1000,40435=>1000,40436=>1000, - 40437=>1000,40438=>1000,40439=>1000,40440=>1000,40441=>1000,40442=>1000,40443=>1000,40444=>1000,40445=>1000,40446=>1000,40447=>1000,40448=>1000,40449=>1000,40450=>1000,40451=>1000,40452=>1000, - 40453=>1000,40454=>1000,40455=>1000,40456=>1000,40457=>1000,40458=>1000,40459=>1000,40460=>1000,40461=>1000,40462=>1000,40463=>1000,40464=>1000,40465=>1000,40466=>1000,40467=>1000,40468=>1000, - 40469=>1000,40470=>1000,40471=>1000,40472=>1000,40473=>1000,40474=>1000,40475=>1000,40476=>1000,40477=>1000,40478=>1000,40479=>1000,40480=>1000,40481=>1000,40482=>1000,40483=>1000,40484=>1000, - 40485=>1000,40486=>1000,40487=>1000,40488=>1000,40489=>1000,40490=>1000,40491=>1000,40492=>1000,40493=>1000,40494=>1000,40495=>1000,40496=>1000,40497=>1000,40498=>1000,40499=>1000,40500=>1000, - 40501=>1000,40502=>1000,40503=>1000,40504=>1000,40505=>1000,40506=>1000,40507=>1000,40508=>1000,40509=>1000,40510=>1000,40511=>1000,40512=>1000,40513=>1000,40514=>1000,40515=>1000,40516=>1000, - 40517=>1000,40518=>1000,40519=>1000,40520=>1000,40521=>1000,40522=>1000,40523=>1000,40524=>1000,40525=>1000,40526=>1000,40527=>1000,40528=>1000,40529=>1000,40530=>1000,40531=>1000,40532=>1000, - 40533=>1000,40534=>1000,40535=>1000,40536=>1000,40537=>1000,40538=>1000,40539=>1000,40540=>1000,40541=>1000,40542=>1000,40543=>1000,40544=>1000,40545=>1000,40546=>1000,40547=>1000,40548=>1000, - 40549=>1000,40550=>1000,40551=>1000,40552=>1000,40553=>1000,40554=>1000,40555=>1000,40556=>1000,40557=>1000,40558=>1000,40559=>1000,40560=>1000,40561=>1000,40562=>1000,40563=>1000,40564=>1000, - 40565=>1000,40566=>1000,40567=>1000,40568=>1000,40569=>1000,40570=>1000,40571=>1000,40572=>1000,40573=>1000,40574=>1000,40575=>1000,40576=>1000,40577=>1000,40578=>1000,40579=>1000,40580=>1000, - 40581=>1000,40582=>1000,40583=>1000,40584=>1000,40585=>1000,40586=>1000,40587=>1000,40588=>1000,40589=>1000,40590=>1000,40591=>1000,40592=>1000,40593=>1000,40594=>1000,40595=>1000,40596=>1000, - 40597=>1000,40598=>1000,40599=>1000,40600=>1000,40601=>1000,40602=>1000,40603=>1000,40604=>1000,40605=>1000,40606=>1000,40607=>1000,40608=>1000,40609=>1000,40610=>1000,40611=>1000,40612=>1000, - 40613=>1000,40614=>1000,40615=>1000,40616=>1000,40617=>1000,40618=>1000,40619=>1000,40620=>1000,40621=>1000,40622=>1000,40623=>1000,40624=>1000,40625=>1000,40626=>1000,40627=>1000,40628=>1000, - 40629=>1000,40630=>1000,40631=>1000,40632=>1000,40633=>1000,40634=>1000,40635=>1000,40636=>1000,40637=>1000,40638=>1000,40639=>1000,40640=>1000,40641=>1000,40642=>1000,40643=>1000,40644=>1000, - 40645=>1000,40646=>1000,40647=>1000,40648=>1000,40649=>1000,40650=>1000,40651=>1000,40652=>1000,40653=>1000,40654=>1000,40655=>1000,40656=>1000,40657=>1000,40658=>1000,40659=>1000,40660=>1000, - 40661=>1000,40662=>1000,40663=>1000,40664=>1000,40665=>1000,40666=>1000,40667=>1000,40668=>1000,40669=>1000,40670=>1000,40671=>1000,40672=>1000,40673=>1000,40674=>1000,40675=>1000,40676=>1000, - 40677=>1000,40678=>1000,40679=>1000,40680=>1000,40681=>1000,40682=>1000,40683=>1000,40684=>1000,40685=>1000,40686=>1000,40687=>1000,40688=>1000,40689=>1000,40690=>1000,40691=>1000,40692=>1000, - 40693=>1000,40694=>1000,40695=>1000,40696=>1000,40697=>1000,40698=>1000,40699=>1000,40700=>1000,40701=>1000,40702=>1000,40703=>1000,40704=>1000,40705=>1000,40706=>1000,40707=>1000,40708=>1000, - 40709=>1000,40710=>1000,40711=>1000,40712=>1000,40713=>1000,40714=>1000,40715=>1000,40716=>1000,40717=>1000,40718=>1000,40719=>1000,40720=>1000,40721=>1000,40722=>1000,40723=>1000,40724=>1000, - 40725=>1000,40726=>1000,40727=>1000,40728=>1000,40729=>1000,40730=>1000,40731=>1000,40732=>1000,40733=>1000,40734=>1000,40735=>1000,40736=>1000,40737=>1000,40738=>1000,40739=>1000,40740=>1000, - 40741=>1000,40742=>1000,40743=>1000,40744=>1000,40745=>1000,40746=>1000,40747=>1000,40748=>1000,40749=>1000,40750=>1000,40751=>1000,40752=>1000,40753=>1000,40754=>1000,40755=>1000,40756=>1000, - 40757=>1000,40758=>1000,40759=>1000,40760=>1000,40761=>1000,40762=>1000,40763=>1000,40764=>1000,40765=>1000,40766=>1000,40767=>1000,40768=>1000,40769=>1000,40770=>1000,40771=>1000,40772=>1000, - 40773=>1000,40774=>1000,40775=>1000,40776=>1000,40777=>1000,40778=>1000,40779=>1000,40780=>1000,40781=>1000,40782=>1000,40783=>1000,40784=>1000,40785=>1000,40786=>1000,40787=>1000,40788=>1000, - 40789=>1000,40790=>1000,40791=>1000,40792=>1000,40793=>1000,40794=>1000,40795=>1000,40796=>1000,40797=>1000,40798=>1000,40799=>1000,40800=>1000,40801=>1000,40802=>1000,40803=>1000,40804=>1000, - 40805=>1000,40806=>1000,40807=>1000,40808=>1000,40809=>1000,40810=>1000,40811=>1000,40812=>1000,40813=>1000,40814=>1000,40815=>1000,40816=>1000,40817=>1000,40818=>1000,40819=>1000,40820=>1000, - 40821=>1000,40822=>1000,40823=>1000,40824=>1000,40825=>1000,40826=>1000,40827=>1000,40828=>1000,40829=>1000,40830=>1000,40831=>1000,40832=>1000,40833=>1000,40834=>1000,40835=>1000,40836=>1000, - 40837=>1000,40838=>1000,40839=>1000,40840=>1000,40841=>1000,40842=>1000,40843=>1000,40844=>1000,40845=>1000,40846=>1000,40847=>1000,40848=>1000,40849=>1000,40850=>1000,40851=>1000,40852=>1000, - 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, - 40869=>1000); -$diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -$enc='UniCNS-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -include(dirname(__FILE__).'/uni2cid_ac15.php'); - -//$enc='UniGB-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -//include(dirname(__FILE__).'/uni2cid_ag15.php'); - -//$enc='UniKS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ak12.php'); - -//$enc='UniJIS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -//include(dirname(__FILE__).'/uni2cid_aj16.php'); -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-japanese.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-japanese.php deleted file mode 100644 index 554d58b05c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-japanese.php +++ /dev/null @@ -1,1768 +0,0 @@ -<?php -$type='cidfont0'; -$name='ArialUnicodeMS'; -$desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-100; -$ut=50; -$dw=1000; -$cw=array( - 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, - 48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556, - 64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, - 80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>500, - 96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, - 112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,8364=>556, - 1027=>567,8218=>222,402=>278,8222=>333,8230=>1000,8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,1036=>584,381=>611,1039=>723,8216=>222, - 8217=>222,8220=>333,8221=>333,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>500,8250=>333,339=>944,1116=>437,382=>500,376=>667,160=>278,161=>333, - 162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>500,176=>400,177=>584, - 178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667, - 194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722, - 210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, - 226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556, - 242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, - 258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500,268=>722,269=>500,270=>722,271=>627,272=>722,273=>556, - 274=>667,275=>556,276=>667,277=>556,278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556,288=>778,289=>556, - 290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>222,298=>278,299=>222,300=>278,301=>222,302=>278,303=>222,304=>278,305=>278, - 306=>751,307=>444,308=>500,309=>222,310=>667,311=>500,312=>437,313=>556,314=>222,315=>556,316=>222,317=>556,318=>222,319=>556,320=>318,321=>556, - 322=>222,323=>722,324=>556,325=>722,326=>556,327=>722,328=>556,329=>626,330=>723,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, - 340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500,350=>667,351=>500,354=>611,355=>278,356=>611,357=>406, - 358=>611,359=>278,360=>722,361=>556,362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556,372=>944,373=>722, - 374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>222,384=>556,385=>740,386=>655,387=>556,388=>556,389=>556,390=>722,391=>766,392=>579, - 393=>722,394=>789,395=>655,396=>556,397=>557,398=>667,399=>729,400=>604,401=>611,403=>791,404=>649,405=>806,406=>245,407=>322,408=>667,409=>500, - 410=>322,411=>500,412=>833,413=>722,414=>556,415=>778,416=>776,417=>556,418=>1019,419=>782,420=>735,421=>556,422=>722,423=>667,424=>500,425=>602, - 426=>366,427=>278,428=>571,429=>278,430=>611,431=>776,432=>620,433=>748,434=>667,435=>752,436=>615,437=>611,438=>500,439=>628,440=>628,441=>526, - 442=>480,443=>556,444=>556,445=>526,446=>556,447=>556,448=>278,449=>464,450=>474,451=>278,452=>1333,453=>1222,454=>1056,455=>1030,456=>778,457=>444, - 458=>1222,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722, - 474=>556,475=>722,476=>556,477=>556,478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556,488=>667,489=>500, - 490=>778,491=>556,492=>778,493=>556,494=>534,495=>534,496=>222,497=>1333,498=>1222,499=>1056,500=>778,501=>556,506=>667,507=>556,508=>1000,509=>889, - 510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667,519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556, - 526=>778,527=>556,528=>722,529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500, - 598=>556,599=>556,600=>556,601=>556,602=>777,603=>485,604=>485,605=>686,606=>519,607=>260,608=>556,609=>556,610=>557,611=>500,612=>500,613=>556, - 614=>556,615=>556,616=>242,617=>282,618=>356,619=>356,620=>425,621=>222,622=>635,623=>833,624=>833,625=>833,626=>556,627=>556,628=>558,629=>556, - 630=>715,631=>674,632=>558,633=>333,634=>333,635=>333,636=>333,637=>333,638=>312,639=>312,640=>530,641=>530,642=>500,643=>216,644=>276,645=>216, - 646=>222,647=>278,648=>278,649=>596,650=>558,651=>556,652=>500,653=>722,654=>500,655=>500,656=>500,657=>564,658=>530,659=>530,660=>464,661=>464, - 662=>464,663=>500,664=>614,665=>526,666=>519,667=>557,668=>558,669=>222,670=>500,671=>416,672=>556,673=>464,674=>464,675=>966,676=>966,677=>1030, - 678=>689,679=>484,680=>718,688=>326,689=>326,690=>153,691=>201,692=>201,693=>201,694=>304,695=>389,696=>278,697=>222,698=>372,699=>222,700=>222, - 701=>222,702=>222,703=>222,704=>250,705=>250,706=>320,707=>320,708=>320,709=>320,711=>333,712=>192,713=>333,714=>333,715=>333,716=>192,717=>333, - 718=>333,719=>333,720=>300,721=>300,722=>222,723=>222,724=>340,725=>340,726=>280,727=>362,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, - 736=>278,737=>153,738=>270,739=>274,740=>325,741=>360,742=>360,743=>360,744=>360,745=>360,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, - 774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0, - 790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0, - 806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, - 822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, - 864=>0,865=>0,884=>308,885=>308,890=>278,894=>278,900=>278,901=>278,902=>667,903=>278,904=>704,905=>759,906=>315,908=>778,910=>746,911=>758, - 912=>222,913=>667,914=>667,915=>550,916=>682,917=>667,918=>611,919=>722,920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>650,927=>778, - 928=>722,929=>667,931=>602,932=>611,933=>667,934=>808,935=>667,936=>804,937=>758,938=>278,939=>667,940=>576,941=>434,942=>556,943=>222,944=>551, - 945=>576,946=>563,947=>500,948=>557,949=>434,950=>440,951=>556,952=>556,953=>222,954=>498,955=>500,956=>553,957=>500,958=>432,959=>556,960=>678, - 961=>571,962=>472,963=>619,964=>382,965=>551,966=>649,967=>522,968=>729,969=>766,970=>222,971=>551,972=>556,973=>551,974=>766,976=>563,977=>616, - 978=>631,979=>726,980=>631,981=>644,982=>781,986=>722,988=>578,990=>570,992=>692,994=>880,995=>833,996=>684,997=>558,998=>680,999=>529,1000=>557, - 1001=>505,1002=>623,1003=>603,1004=>610,1005=>611,1006=>568,1007=>434,1008=>600,1009=>571,1010=>500,1011=>222,1025=>667,1026=>865,1028=>717,1029=>667,1030=>278, - 1031=>278,1032=>500,1033=>1105,1034=>1009,1035=>867,1038=>635,1040=>667,1041=>655,1042=>667,1043=>567,1044=>677,1045=>667,1046=>923,1047=>604,1048=>722,1049=>722, - 1050=>584,1051=>705,1052=>833,1053=>722,1054=>778,1055=>723,1056=>667,1057=>722,1058=>611,1059=>635,1060=>760,1061=>667,1062=>740,1063=>684,1064=>920,1065=>939, - 1066=>793,1067=>883,1068=>655,1069=>717,1070=>1006,1071=>722,1072=>556,1073=>573,1074=>531,1075=>383,1076=>583,1077=>556,1078=>669,1079=>458,1080=>559,1081=>559, - 1082=>437,1083=>571,1084=>683,1085=>552,1086=>556,1087=>542,1088=>556,1089=>500,1090=>458,1091=>500,1092=>823,1093=>500,1094=>562,1095=>533,1096=>802,1097=>823, - 1098=>620,1099=>717,1100=>523,1101=>510,1102=>744,1103=>542,1105=>556,1106=>556,1107=>383,1108=>510,1109=>500,1110=>222,1111=>278,1112=>222,1113=>873,1114=>811, - 1115=>556,1118=>500,1119=>542,1120=>976,1121=>766,1122=>656,1123=>521,1124=>950,1125=>694,1126=>667,1127=>597,1128=>952,1129=>817,1130=>654,1131=>600,1132=>932, - 1133=>817,1134=>604,1135=>458,1136=>804,1137=>729,1138=>778,1139=>556,1140=>667,1141=>500,1142=>667,1143=>500,1144=>1279,1145=>1060,1146=>778,1147=>556,1148=>976, - 1149=>766,1150=>976,1151=>766,1152=>722,1153=>514,1154=>686,1155=>334,1156=>382,1157=>334,1158=>334,1168=>435,1169=>339,1170=>567,1171=>383,1172=>656,1173=>556, - 1174=>923,1175=>669,1176=>604,1177=>458,1178=>584,1179=>437,1180=>584,1181=>437,1182=>584,1183=>437,1184=>764,1185=>537,1186=>741,1187=>573,1188=>900,1189=>670, - 1190=>736,1191=>560,1192=>778,1193=>560,1194=>722,1195=>500,1196=>611,1197=>458,1198=>667,1199=>500,1200=>667,1201=>500,1202=>667,1203=>500,1204=>916,1205=>661, - 1206=>684,1207=>533,1208=>684,1209=>533,1210=>684,1211=>556,1212=>829,1213=>667,1214=>829,1215=>667,1216=>278,1217=>923,1218=>669,1219=>584,1220=>437,1223=>735, - 1224=>570,1227=>684,1228=>533,1232=>667,1233=>556,1234=>667,1235=>556,1236=>1000,1237=>889,1238=>667,1239=>556,1240=>729,1241=>556,1242=>729,1243=>556,1244=>923, - 1245=>669,1246=>604,1247=>458,1248=>604,1249=>492,1250=>722,1251=>559,1252=>722,1253=>559,1254=>778,1255=>556,1256=>778,1257=>556,1258=>778,1259=>556,1262=>635, - 1263=>500,1264=>635,1265=>500,1266=>635,1267=>500,1268=>684,1269=>533,1272=>883,1273=>717,1329=>635,1330=>531,1331=>583,1332=>583,1333=>531,1334=>531,1335=>427, - 1336=>531,1337=>750,1338=>635,1339=>531,1340=>375,1341=>583,1342=>698,1343=>531,1344=>427,1345=>531,1346=>583,1347=>531,1348=>635,1349=>698,1350=>635,1351=>635, - 1352=>531,1353=>531,1354=>698,1355=>531,1356=>635,1357=>531,1358=>698,1359=>583,1360=>479,1361=>583,1362=>531,1363=>698,1364=>698,1365=>635,1366=>750,1369=>271, - 1370=>271,1371=>150,1372=>300,1373=>271,1374=>271,1375=>420,1377=>583,1378=>427,1379=>427,1380=>427,1381=>427,1382=>427,1383=>427,1384=>427,1385=>459,1386=>427, - 1387=>427,1388=>323,1389=>531,1390=>427,1391=>427,1392=>427,1393=>427,1394=>427,1395=>427,1396=>427,1397=>271,1398=>427,1399=>375,1400=>427,1401=>375,1402=>583, - 1403=>427,1404=>427,1405=>427,1406=>427,1407=>583,1408=>427,1409=>427,1410=>323,1411=>583,1412=>375,1413=>375,1414=>583,1415=>527,1417=>271,1425=>360,1426=>360, - 1427=>360,1428=>360,1429=>360,1430=>360,1431=>360,1432=>360,1433=>360,1434=>360,1435=>360,1436=>360,1437=>360,1438=>360,1439=>360,1440=>360,1441=>360,1443=>360, - 1444=>360,1445=>360,1446=>360,1447=>360,1448=>360,1449=>360,1450=>360,1451=>360,1452=>360,1453=>360,1454=>360,1455=>360,1456=>360,1457=>360,1458=>360,1459=>360, - 1460=>360,1461=>360,1462=>360,1463=>360,1464=>360,1465=>360,1467=>360,1468=>360,1469=>360,1470=>366,1471=>360,1472=>225,1473=>360,1474=>360,1475=>238,1476=>360, - 1488=>577,1489=>563,1490=>411,1491=>512,1492=>594,1493=>316,1494=>326,1495=>594,1496=>594,1497=>316,1498=>507,1499=>527,1500=>484,1501=>594,1502=>594,1503=>316, - 1504=>338,1505=>604,1506=>550,1507=>567,1508=>569,1509=>505,1510=>514,1511=>583,1512=>507,1513=>700,1514=>633,1520=>590,1521=>590,1522=>590,1523=>216,1524=>412, - 1548=>278,1563=>278,1567=>556,1569=>529,1570=>243,1571=>243,1572=>470,1573=>243,1574=>731,1575=>243,1576=>771,1577=>514,1578=>771,1579=>771,1580=>544,1581=>544, - 1582=>544,1583=>430,1584=>430,1585=>421,1586=>421,1587=>1194,1588=>1194,1589=>1291,1590=>1291,1591=>843,1592=>843,1593=>594,1594=>594,1600=>279,1601=>957,1602=>800, - 1603=>757,1604=>662,1605=>589,1606=>692,1607=>514,1608=>470,1609=>731,1610=>731,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0, - 1632=>480,1633=>480,1634=>480,1635=>480,1636=>480,1637=>480,1638=>480,1639=>480,1640=>480,1641=>480,1642=>547,1643=>278,1644=>278,1645=>438,1648=>0,1649=>243, - 1650=>243,1651=>243,1652=>0,1653=>380,1654=>470,1655=>548,1656=>772,1657=>771,1658=>771,1659=>771,1660=>771,1661=>771,1662=>771,1663=>771,1664=>771,1665=>544, - 1666=>544,1667=>544,1668=>544,1669=>544,1670=>544,1671=>544,1672=>430,1673=>430,1674=>430,1675=>430,1676=>430,1677=>430,1678=>430,1679=>430,1680=>430,1681=>421, - 1682=>421,1683=>421,1684=>421,1685=>421,1686=>419,1687=>421,1688=>421,1689=>421,1690=>1194,1691=>1194,1692=>1194,1693=>1291,1694=>1291,1695=>843,1696=>594,1697=>957, - 1698=>957,1699=>957,1700=>957,1701=>957,1702=>957,1703=>800,1704=>800,1705=>828,1706=>1058,1707=>828,1708=>757,1709=>757,1710=>757,1711=>828,1712=>828,1713=>828, - 1714=>828,1715=>828,1716=>828,1717=>662,1718=>662,1719=>662,1722=>692,1723=>692,1724=>692,1725=>692,1726=>706,1728=>514,1729=>509,1730=>509,1731=>509,1732=>470, - 1733=>470,1734=>470,1735=>470,1736=>470,1737=>470,1738=>470,1739=>470,1740=>731,1741=>841,1742=>731,1744=>731,1745=>731,1746=>550,1747=>550,1748=>279,1749=>514, - 1750=>726,1751=>558,1752=>321,1753=>318,1754=>342,1755=>373,1756=>716,1757=>688,1758=>852,1759=>288,1760=>288,1761=>388,1762=>350,1763=>716,1764=>146,1765=>282, - 1766=>339,1767=>339,1768=>415,1769=>514,1770=>220,1771=>220,1772=>220,1773=>350,1776=>480,1777=>480,1778=>480,1779=>480,1780=>480,1781=>480,1782=>480,1783=>480, - 1784=>480,1785=>480,2305=>0,2306=>0,2307=>294,2309=>693,2310=>910,2311=>533,2312=>533,2313=>590,2314=>713,2315=>920,2316=>677,2317=>611,2318=>611,2319=>611, - 2320=>611,2321=>910,2322=>910,2323=>910,2324=>910,2325=>667,2326=>732,2327=>593,2328=>639,2329=>624,2330=>688,2331=>713,2332=>688,2333=>712,2334=>697,2335=>502, - 2336=>533,2337=>583,2338=>523,2339=>693,2340=>585,2341=>638,2342=>533,2343=>640,2344=>585,2345=>585,2346=>565,2347=>699,2348=>592,2349=>689,2350=>633,2351=>600, - 2352=>486,2353=>486,2354=>680,2355=>730,2356=>730,2357=>592,2358=>684,2359=>608,2360=>646,2361=>546,2364=>0,2365=>373,2366=>319,2367=>319,2368=>319,2369=>0, - 2370=>0,2371=>0,2372=>0,2373=>0,2374=>0,2375=>0,2376=>0,2377=>319,2378=>319,2379=>319,2380=>319,2381=>0,2384=>884,2385=>0,2386=>0,2387=>0, - 2388=>0,2392=>667,2393=>732,2394=>593,2395=>688,2396=>583,2397=>523,2398=>699,2399=>600,2400=>920,2401=>677,2402=>0,2403=>0,2404=>331,2405=>513,2406=>639, - 2407=>639,2408=>639,2409=>639,2410=>639,2411=>639,2412=>639,2413=>639,2414=>639,2415=>639,2416=>362,2433=>0,2434=>430,2435=>430,2437=>786,2438=>1030,2439=>582, - 2440=>603,2441=>648,2442=>757,2443=>758,2444=>630,2447=>685,2448=>746,2451=>711,2452=>776,2453=>779,2454=>655,2455=>606,2456=>645,2457=>661,2458=>554,2459=>585, - 2460=>729,2461=>752,2462=>893,2463=>567,2464=>625,2465=>648,2466=>567,2467=>598,2468=>680,2469=>645,2470=>609,2471=>596,2472=>595,2474=>635,2475=>780,2476=>593, - 2477=>677,2478=>621,2479=>601,2480=>593,2482=>640,2486=>598,2487=>596,2488=>637,2489=>582,2492=>0,2494=>245,2495=>245,2496=>245,2497=>0,2498=>0,2499=>0, - 2500=>0,2503=>309,2504=>309,2507=>932,2508=>932,2509=>0,2519=>245,2524=>648,2525=>553,2527=>596,2528=>758,2529=>630,2530=>0,2531=>335,2534=>610,2535=>559, - 2536=>595,2537=>711,2538=>610,2539=>661,2540=>661,2541=>559,2542=>661,2543=>600,2544=>593,2545=>593,2546=>601,2547=>567,2548=>601,2549=>699,2550=>661,2551=>267, - 2552=>610,2553=>424,2554=>548,2562=>0,2565=>691,2566=>936,2567=>803,2568=>803,2569=>678,2570=>678,2575=>557,2576=>691,2579=>678,2580=>691,2581=>602,2582=>567, - 2583=>641,2584=>688,2585=>565,2586=>592,2587=>603,2588=>591,2589=>541,2590=>558,2591=>543,2592=>581,2593=>596,2594=>640,2595=>640,2596=>591,2597=>564,2598=>640, - 2599=>564,2600=>581,2602=>564,2603=>551,2604=>560,2605=>549,2606=>558,2607=>652,2608=>540,2610=>677,2611=>677,2613=>601,2614=>558,2616=>558,2617=>549,2620=>0, - 2622=>246,2623=>246,2624=>246,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>567,2650=>690,2651=>591,2652=>591,2654=>581,2662=>591, - 2663=>591,2664=>591,2665=>591,2666=>591,2667=>591,2668=>591,2669=>591,2670=>591,2671=>591,2672=>0,2673=>0,2674=>557,2675=>678,2676=>894,2689=>0,2690=>0, - 2691=>300,2693=>781,2694=>1044,2695=>589,2696=>589,2697=>560,2698=>758,2699=>806,2701=>781,2703=>781,2704=>781,2705=>1044,2707=>1044,2708=>1044,2709=>413,2710=>773, - 2711=>606,2712=>558,2713=>483,2714=>600,2715=>691,2716=>811,2717=>647,2718=>651,2719=>453,2720=>450,2721=>425,2722=>478,2723=>694,2724=>534,2725=>553,2726=>446, - 2727=>541,2728=>582,2730=>572,2731=>437,2732=>663,2733=>756,2734=>594,2735=>493,2736=>392,2738=>613,2739=>656,2741=>538,2742=>611,2743=>507,2744=>663,2745=>587, - 2748=>0,2749=>478,2750=>273,2751=>273,2752=>273,2753=>0,2754=>0,2755=>0,2756=>0,2757=>0,2759=>0,2760=>0,2761=>273,2763=>273,2764=>273,2765=>0, - 2768=>843,2784=>893,2790=>625,2791=>625,2792=>625,2793=>625,2794=>625,2795=>625,2796=>625,2797=>625,2798=>625,2799=>625,2817=>0,2818=>306,2819=>391,2821=>590, - 2822=>808,2823=>658,2824=>658,2825=>633,2826=>654,2827=>636,2828=>540,2831=>560,2832=>938,2835=>600,2836=>973,2837=>603,2838=>620,2839=>620,2840=>605,2841=>712, - 2842=>579,2843=>579,2844=>593,2845=>564,2846=>581,2847=>604,2848=>578,2849=>579,2850=>579,2851=>607,2852=>579,2853=>587,2854=>579,2855=>602,2856=>579,2858=>605, - 2859=>728,2860=>579,2861=>643,2862=>605,2863=>628,2864=>619,2866=>653,2867=>593,2870=>620,2871=>605,2872=>605,2873=>579,2876=>0,2877=>333,2878=>218,2879=>0, - 2880=>294,2881=>0,2882=>0,2883=>0,2887=>479,2888=>479,2891=>1026,2892=>1026,2893=>0,2902=>0,2903=>218,2908=>579,2909=>579,2911=>599,2912=>636,2913=>540, - 2918=>578,2919=>480,2920=>480,2921=>622,2922=>506,2923=>605,2924=>529,2925=>548,2926=>512,2927=>528,2928=>561,2946=>0,2947=>742,2949=>1002,2950=>1118,2951=>994, - 2952=>660,2953=>1012,2954=>1231,2958=>726,2959=>731,2960=>870,2962=>763,2963=>763,2964=>1636,2965=>667,2969=>830,2970=>584,2972=>876,2974=>986,2975=>802,2979=>1295, - 2980=>656,2984=>630,2985=>1012,2986=>694,2990=>727,2991=>790,2992=>545,2993=>718,2994=>821,2995=>871,2996=>724,2997=>873,2999=>1087,3000=>1098,3001=>1274,3006=>547, - 3007=>172,3008=>93,3009=>519,3010=>814,3014=>748,3015=>681,3016=>956,3018=>1666,3019=>1666,3020=>1994,3021=>0,3031=>871,3047=>667,3048=>1012,3049=>751,3050=>740, - 3051=>924,3052=>884,3053=>726,3054=>1002,3055=>825,3056=>717,3057=>719,3058=>774,3073=>365,3074=>601,3075=>346,3077=>720,3078=>786,3079=>567,3080=>1159,3081=>690, - 3082=>1047,3083=>1299,3084=>913,3086=>625,3087=>625,3088=>712,3090=>655,3091=>655,3092=>862,3093=>515,3094=>680,3095=>526,3096=>943,3097=>655,3098=>684,3099=>684, - 3100=>670,3101=>1205,3102=>732,3103=>888,3104=>597,3105=>709,3106=>709,3107=>809,3108=>715,3109=>702,3110=>702,3111=>702,3112=>607,3114=>623,3115=>623,3116=>681, - 3117=>681,3118=>932,3119=>1203,3120=>597,3121=>893,3122=>631,3123=>608,3125=>620,3126=>541,3127=>667,3128=>640,3129=>911,3134=>644,3135=>298,3136=>298,3137=>361, - 3138=>682,3139=>342,3140=>704,3142=>624,3143=>624,3144=>900,3146=>849,3147=>849,3148=>976,3149=>669,3157=>298,3158=>119,3168=>1620,3169=>1281,3174=>840,3175=>840, - 3176=>840,3177=>840,3178=>840,3179=>840,3180=>840,3181=>840,3182=>840,3183=>840,3202=>440,3203=>251,3205=>654,3206=>654,3207=>631,3208=>891,3209=>957,3210=>1293, - 3211=>1044,3212=>744,3214=>650,3215=>650,3216=>659,3218=>667,3219=>667,3220=>667,3221=>462,3222=>749,3223=>543,3224=>779,3225=>674,3226=>682,3227=>660,3228=>667, - 3229=>1171,3230=>926,3231=>671,3232=>557,3233=>669,3234=>669,3235=>728,3236=>544,3237=>672,3238=>672,3239=>672,3240=>560,3242=>668,3243=>668,3244=>681,3245=>687, - 3246=>972,3247=>1101,3248=>556,3249=>677,3250=>661,3251=>545,3253=>666,3254=>553,3255=>670,3256=>549,3257=>716,3262=>425,3263=>341,3264=>680,3265=>354,3266=>714, - 3267=>386,3268=>638,3270=>307,3271=>670,3272=>462,3274=>908,3275=>1251,3276=>434,3277=>336,3285=>344,3286=>404,3294=>673,3296=>1695,3297=>978,3302=>549,3303=>549, - 3304=>549,3305=>549,3306=>549,3307=>549,3308=>549,3309=>549,3310=>549,3311=>549,3330=>368,3331=>305,3333=>1201,3334=>1351,3335=>905,3336=>1459,3337=>635,3338=>1198, - 3339=>861,3340=>957,3342=>1211,3343=>1202,3344=>1839,3346=>642,3347=>1114,3348=>1195,3349=>861,3350=>982,3351=>874,3352=>1354,3353=>957,3354=>1016,3355=>1266,3356=>712, - 3357=>1454,3358=>1215,3359=>563,3360=>565,3361=>1192,3362=>1244,3363=>1268,3364=>878,3365=>966,3366=>545,3367=>879,3368=>879,3370=>1031,3371=>1175,3372=>1334,3373=>546, - 3374=>643,3375=>949,3376=>642,3377=>555,3378=>945,3379=>631,3380=>553,3381=>959,3382=>936,3383=>1122,3384=>1190,3385=>1112,3390=>475,3391=>418,3392=>442,3393=>340, - 3394=>340,3395=>473,3398=>640,3399=>530,3400=>1279,3402=>1368,3403=>1258,3404=>1447,3405=>0,3415=>553,3424=>861,3425=>1100,3430=>1095,3431=>929,3432=>854,3433=>1181, - 3434=>658,3435=>972,3436=>1210,3437=>650,3438=>959,3439=>896,3585=>595,3586=>648,3587=>665,3588=>608,3589=>608,3590=>665,3591=>471,3592=>556,3593=>652,3594=>664, - 3595=>681,3596=>816,3597=>849,3598=>620,3599=>620,3600=>541,3601=>785,3602=>826,3603=>887,3604=>598,3605=>605,3606=>595,3607=>650,3608=>541,3609=>652,3610=>608, - 3611=>608,3612=>630,3613=>630,3614=>695,3615=>695,3616=>620,3617=>581,3618=>588,3619=>501,3620=>595,3621=>569,3622=>620,3623=>519,3624=>592,3625=>659,3626=>574, - 3627=>654,3628=>695,3629=>566,3630=>574,3631=>517,3632=>452,3633=>0,3634=>496,3635=>496,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, - 3647=>687,3648=>302,3649=>571,3650=>478,3651=>515,3652=>515,3653=>496,3654=>506,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0, - 3663=>555,3664=>598,3665=>640,3666=>688,3667=>690,3668=>657,3669=>657,3670=>635,3671=>839,3672=>693,3673=>769,3674=>673,3675=>994,3713=>775,3714=>707,3716=>724, - 3719=>524,3720=>690,3722=>678,3725=>711,3732=>719,3733=>834,3734=>776,3735=>916,3737=>744,3738=>740,3739=>740,3740=>834,3741=>834,3742=>854,3743=>854,3745=>775, - 3746=>724,3747=>697,3749=>700,3751=>700,3754=>708,3755=>916,3757=>700,3758=>697,3759=>658,3760=>432,3761=>534,3762=>476,3763=>476,3764=>778,3765=>778,3766=>778, - 3767=>778,3768=>778,3769=>778,3771=>778,3772=>778,3773=>670,3776=>420,3777=>806,3778=>430,3779=>446,3780=>346,3782=>571,3784=>778,3785=>778,3786=>778,3787=>778, - 3788=>778,3789=>778,3792=>721,3793=>719,3794=>601,3795=>711,3796=>686,3797=>686,3798=>834,3799=>756,3800=>724,3801=>906,3804=>1272,3805=>1272,3840=>600,3841=>600, - 3842=>600,3843=>600,3844=>600,3845=>600,3846=>600,3847=>600,3848=>600,3849=>600,3850=>600,3851=>600,3852=>600,3853=>600,3854=>600,3855=>600,3856=>600,3857=>600, - 3858=>600,3859=>600,3860=>600,3861=>600,3862=>600,3863=>600,3864=>600,3865=>600,3866=>600,3867=>600,3868=>600,3869=>600,3870=>600,3871=>600,3872=>600,3873=>600, - 3874=>600,3875=>600,3876=>600,3877=>600,3878=>600,3879=>600,3880=>600,3881=>600,3882=>600,3883=>600,3884=>600,3885=>600,3886=>600,3887=>600,3888=>600,3889=>600, - 3890=>600,3891=>600,3892=>600,3893=>600,3894=>600,3895=>600,3896=>600,3897=>600,3898=>600,3899=>600,3900=>600,3901=>600,3902=>600,3903=>600,3904=>600,3905=>600, - 3906=>600,3907=>600,3908=>600,3909=>600,3910=>600,3911=>600,3913=>600,3914=>600,3915=>600,3916=>600,3917=>600,3918=>600,3919=>600,3920=>600,3921=>600,3922=>600, - 3923=>600,3924=>600,3925=>600,3926=>600,3927=>600,3928=>600,3929=>600,3930=>600,3931=>600,3932=>600,3933=>600,3934=>600,3935=>600,3936=>600,3937=>600,3938=>600, - 3939=>600,3940=>600,3941=>600,3942=>600,3943=>600,3944=>600,3945=>600,3953=>600,3954=>600,3955=>600,3956=>600,3957=>600,3958=>600,3959=>600,3960=>600,3961=>600, - 3962=>600,3963=>600,3964=>600,3965=>600,3966=>600,3967=>600,3968=>600,3969=>600,3970=>600,3971=>600,3972=>600,3973=>600,3974=>600,3975=>600,3976=>600,3977=>600, - 3978=>600,3979=>600,3984=>600,3985=>600,3986=>600,3987=>600,3988=>600,3989=>600,3991=>600,3993=>600,3994=>600,3995=>600,3996=>600,3997=>600,3998=>600,3999=>600, - 4000=>600,4001=>600,4002=>600,4003=>600,4004=>600,4005=>600,4006=>600,4007=>600,4008=>600,4009=>600,4010=>600,4011=>600,4012=>600,4013=>600,4017=>600,4018=>600, - 4019=>600,4020=>600,4021=>600,4022=>600,4023=>600,4025=>600,4256=>662,4257=>677,4258=>708,4259=>696,4260=>609,4261=>790,4262=>664,4263=>785,4264=>560,4265=>634, - 4266=>782,4267=>701,4268=>629,4269=>682,4270=>705,4271=>692,4272=>734,4273=>615,4274=>592,4275=>680,4276=>679,4277=>705,4278=>643,4279=>623,4280=>623,4281=>629, - 4282=>633,4283=>770,4284=>592,4285=>662,4286=>629,4287=>672,4288=>735,4289=>576,4290=>606,4291=>605,4292=>676,4293=>792,4304=>435,4305=>556,4306=>565,4307=>872, - 4308=>506,4309=>544,4310=>723,4311=>868,4312=>530,4313=>532,4314=>955,4315=>552,4316=>565,4317=>712,4318=>547,4319=>574,4320=>685,4321=>554,4322=>806,4323=>810, - 4324=>777,4325=>502,4326=>686,4327=>512,4328=>552,4329=>496,4330=>568,4331=>552,4332=>592,4333=>565,4334=>552,4335=>741,4336=>549,4337=>659,4338=>559,4339=>524, - 4340=>482,4341=>565,4342=>822,4347=>506,4352=>1000,4353=>1000,4354=>1000,4355=>1000,4356=>1000,4357=>1000,4358=>1000,4359=>1000,4360=>1000,4361=>1000,4362=>1000,4363=>1000, - 4364=>1000,4365=>1000,4366=>1000,4367=>1000,4368=>1000,4369=>1000,4370=>1000,4371=>1000,4372=>1000,4373=>1000,4374=>1000,4375=>1000,4376=>1000,4377=>1000,4378=>1000,4379=>1000, - 4380=>1000,4381=>1000,4382=>1000,4383=>1000,4384=>1000,4385=>1000,4386=>1000,4387=>1000,4388=>1000,4389=>1000,4390=>1000,4391=>1000,4392=>1000,4393=>1000,4394=>1000,4395=>1000, - 4396=>1000,4397=>1000,4398=>1000,4399=>1000,4400=>1000,4401=>1000,4402=>1000,4403=>1000,4404=>1000,4405=>1000,4406=>1000,4407=>1000,4408=>1000,4409=>1000,4410=>1000,4411=>1000, - 4412=>1000,4413=>1000,4414=>1000,4415=>1000,4416=>1000,4417=>1000,4418=>1000,4419=>1000,4420=>1000,4421=>1000,4422=>1000,4423=>1000,4424=>1000,4425=>1000,4426=>1000,4427=>1000, - 4428=>1000,4429=>1000,4430=>1000,4431=>1000,4432=>1000,4433=>1000,4434=>1000,4435=>1000,4436=>1000,4437=>1000,4438=>1000,4439=>1000,4440=>1000,4441=>1000,4447=>1000,4448=>1000, - 4449=>1000,4450=>1000,4451=>1000,4452=>1000,4453=>1000,4454=>1000,4455=>1000,4456=>1000,4457=>1000,4458=>1000,4459=>1000,4460=>1000,4461=>1000,4462=>1000,4463=>1000,4464=>1000, - 4465=>1000,4466=>1000,4467=>1000,4468=>1000,4469=>1000,4470=>1000,4471=>1000,4472=>1000,4473=>1000,4474=>1000,4475=>1000,4476=>1000,4477=>1000,4478=>1000,4479=>1000,4480=>1000, - 4481=>1000,4482=>1000,4483=>1000,4484=>1000,4485=>1000,4486=>1000,4487=>1000,4488=>1000,4489=>1000,4490=>1000,4491=>1000,4492=>1000,4493=>1000,4494=>1000,4495=>1000,4496=>1000, - 4497=>1000,4498=>1000,4499=>1000,4500=>1000,4501=>1000,4502=>1000,4503=>1000,4504=>1000,4505=>1000,4506=>1000,4507=>1000,4508=>1000,4509=>1000,4510=>1000,4511=>1000,4512=>1000, - 4513=>1000,4514=>1000,4520=>1000,4521=>1000,4522=>1000,4523=>1000,4524=>1000,4525=>1000,4526=>1000,4527=>1000,4528=>1000,4529=>1000,4530=>1000,4531=>1000,4532=>1000,4533=>1000, - 4534=>1000,4535=>1000,4536=>1000,4537=>1000,4538=>1000,4539=>1000,4540=>1000,4541=>1000,4542=>1000,4543=>1000,4544=>1000,4545=>1000,4546=>1000,4547=>1000,4548=>1000,4549=>1000, - 4550=>1000,4551=>1000,4552=>1000,4553=>1000,4554=>1000,4555=>1000,4556=>1000,4557=>1000,4558=>1000,4559=>1000,4560=>1000,4561=>1000,4562=>1000,4563=>1000,4564=>1000,4565=>1000, - 4566=>1000,4567=>1000,4568=>1000,4569=>1000,4570=>1000,4571=>1000,4572=>1000,4573=>1000,4574=>1000,4575=>1000,4576=>1000,4577=>1000,4578=>1000,4579=>1000,4580=>1000,4581=>1000, - 4582=>1000,4583=>1000,4584=>1000,4585=>1000,4586=>1000,4587=>1000,4588=>1000,4589=>1000,4590=>1000,4591=>1000,4592=>1000,4593=>1000,4594=>1000,4595=>1000,4596=>1000,4597=>1000, - 4598=>1000,4599=>1000,4600=>1000,4601=>1000,7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722,7691=>556, - 7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556, - 7708=>667,7709=>556,7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722,7721=>556,7722=>722,7723=>556, - 7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, - 7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556, - 7756=>778,7757=>556,7758=>778,7759=>556,7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722,7771=>333, - 7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278, - 7788=>611,7789=>278,7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556, - 7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, - 7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556,7831=>278,7832=>722,7833=>500,7834=>556,7835=>278, - 7840=>667,7841=>556,7842=>667,7843=>556,7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667,7855=>556, - 7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556, - 7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778,7885=>556,7886=>778,7887=>556, - 7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778,7895=>556,7896=>778,7897=>556,7898=>776,7899=>556,7900=>776,7901=>556,7902=>776,7903=>556, - 7904=>776,7905=>556,7906=>776,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>620,7914=>776,7915=>620,7916=>776,7917=>620,7918=>776,7919=>620, - 7920=>776,7921=>620,7922=>667,7923=>500,7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>576,7937=>576,7938=>576,7939=>576,7940=>576,7941=>576, - 7942=>576,7943=>576,7944=>667,7945=>667,7946=>680,7947=>680,7948=>680,7949=>680,7950=>718,7951=>718,7952=>434,7953=>434,7954=>434,7955=>434,7956=>434,7957=>434, - 7960=>692,7961=>692,7962=>823,7963=>823,7964=>823,7965=>823,7968=>556,7969=>556,7970=>556,7971=>556,7972=>556,7973=>556,7974=>556,7975=>556,7976=>747,7977=>747, - 7978=>878,7979=>878,7980=>878,7981=>878,7982=>923,7983=>923,7984=>222,7985=>222,7986=>222,7987=>222,7988=>222,7989=>222,7990=>222,7991=>222,7992=>303,7993=>303, - 7994=>434,7995=>434,7996=>434,7997=>434,7998=>479,7999=>479,8000=>556,8001=>556,8002=>556,8003=>556,8004=>556,8005=>556,8008=>778,8009=>778,8010=>894,8011=>894, - 8012=>894,8013=>894,8016=>551,8017=>551,8018=>551,8019=>551,8020=>551,8021=>551,8022=>551,8023=>551,8025=>777,8027=>893,8029=>885,8031=>940,8032=>766,8033=>766, - 8034=>766,8035=>766,8036=>766,8037=>766,8038=>766,8039=>766,8040=>758,8041=>758,8042=>874,8043=>874,8044=>868,8045=>867,8046=>911,8047=>911,8048=>576,8049=>576, - 8050=>434,8051=>434,8052=>556,8053=>556,8054=>222,8055=>222,8056=>556,8057=>556,8058=>551,8059=>551,8060=>766,8061=>766,8064=>576,8065=>576,8066=>576,8067=>576, - 8068=>576,8069=>576,8070=>576,8071=>576,8072=>667,8073=>667,8074=>680,8075=>680,8076=>680,8077=>680,8078=>718,8079=>718,8080=>556,8081=>556,8082=>556,8083=>556, - 8084=>556,8085=>556,8086=>556,8087=>556,8088=>747,8089=>747,8090=>878,8091=>878,8092=>878,8093=>878,8094=>923,8095=>923,8096=>766,8097=>766,8098=>766,8099=>766, - 8100=>766,8101=>766,8102=>766,8103=>766,8104=>758,8105=>758,8106=>874,8107=>874,8108=>868,8109=>867,8110=>911,8111=>911,8112=>576,8113=>576,8114=>576,8115=>576, - 8116=>576,8118=>576,8119=>576,8120=>667,8121=>667,8122=>667,8123=>667,8124=>667,8125=>278,8126=>278,8127=>278,8128=>278,8129=>278,8130=>556,8131=>556,8132=>556, - 8134=>556,8135=>556,8136=>693,8137=>704,8138=>748,8139=>759,8140=>722,8141=>278,8142=>278,8143=>278,8144=>222,8145=>222,8146=>222,8147=>222,8150=>222,8151=>222, - 8152=>278,8153=>278,8154=>304,8155=>304,8157=>278,8158=>278,8159=>278,8160=>551,8161=>551,8162=>551,8163=>551,8164=>571,8165=>571,8166=>551,8167=>551,8168=>667, - 8169=>667,8170=>742,8171=>746,8172=>693,8173=>278,8174=>278,8175=>278,8178=>766,8179=>766,8180=>766,8182=>766,8183=>766,8184=>778,8185=>778,8186=>758,8187=>758, - 8188=>758,8189=>278,8190=>278,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>100,8202=>50,8203=>0,8204=>0, - 8205=>0,8208=>333,8209=>333,8210=>556,8213=>564,8214=>428,8215=>500,8219=>222,8223=>333,8227=>350,8228=>278,8229=>556,8231=>278,8232=>0,8233=>0,8241=>1330, - 8242=>222,8243=>372,8244=>522,8245=>206,8246=>356,8247=>506,8248=>312,8251=>1000,8252=>471,8253=>556,8254=>500,8255=>945,8256=>945,8257=>312,8258=>820,8259=>333, - 8260=>167,8261=>278,8262=>278,8304=>333,8308=>333,8309=>333,8310=>333,8311=>333,8312=>333,8313=>333,8314=>333,8315=>333,8316=>333,8317=>210,8318=>210,8319=>333, - 8320=>333,8321=>333,8322=>333,8323=>333,8324=>333,8325=>333,8326=>333,8327=>333,8328=>333,8329=>333,8330=>333,8331=>333,8332=>333,8333=>210,8334=>210,8352=>556, - 8353=>556,8354=>556,8355=>556,8356=>556,8357=>833,8358=>556,8359=>556,8360=>1024,8361=>940,8362=>784,8363=>556,8400=>600,8401=>600,8402=>600,8403=>600,8404=>700, - 8405=>700,8406=>600,8407=>600,8408=>600,8409=>600,8410=>600,8411=>600,8412=>600,8413=>900,8414=>900,8415=>900,8416=>900,8417=>700,8448=>889,8449=>889,8450=>667, - 8451=>1022,8452=>611,8453=>889,8454=>889,8455=>501,8456=>667,8457=>921,8458=>510,8459=>906,8460=>988,8461=>722,8462=>500,8463=>500,8464=>688,8465=>553,8466=>708, - 8467=>291,8468=>778,8469=>722,8470=>1073,8471=>737,8472=>740,8473=>556,8474=>722,8475=>927,8476=>795,8477=>667,8478=>667,8479=>667,8480=>1000,8481=>1174,8483=>722, - 8484=>611,8485=>542,8486=>768,8487=>768,8488=>698,8489=>321,8490=>667,8491=>667,8492=>927,8493=>646,8494=>556,8495=>385,8496=>615,8497=>688,8498=>611,8499=>1115, - 8500=>406,8501=>688,8502=>688,8503=>344,8504=>688,8531=>834,8532=>834,8533=>834,8534=>834,8535=>834,8536=>834,8537=>834,8538=>834,8539=>834,8540=>834,8541=>834, - 8542=>834,8543=>834,8544=>278,8545=>555,8546=>832,8547=>933,8548=>667,8549=>934,8550=>1031,8551=>1268,8552=>944,8553=>667,8554=>944,8555=>1035,8556=>556,8557=>722, - 8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>700,8564=>500,8565=>700,8566=>922,8567=>1144,8568=>712,8569=>500,8570=>712,8571=>934,8572=>222,8573=>500, - 8574=>556,8575=>833,8576=>983,8577=>722,8578=>983,8592=>713,8593=>713,8594=>713,8595=>713,8596=>713,8597=>713,8598=>713,8599=>713,8600=>713,8601=>713,8602=>713, - 8603=>713,8604=>713,8605=>713,8606=>713,8607=>713,8608=>713,8609=>713,8610=>713,8611=>713,8612=>713,8613=>713,8614=>713,8615=>713,8616=>713,8617=>713,8618=>713, - 8619=>713,8620=>713,8621=>813,8622=>813,8623=>713,8624=>713,8625=>713,8626=>713,8627=>713,8628=>713,8629=>713,8630=>713,8631=>713,8632=>713,8633=>713,8634=>800, - 8635=>800,8636=>713,8637=>713,8638=>713,8639=>713,8640=>713,8641=>713,8642=>713,8643=>713,8644=>713,8645=>713,8646=>713,8647=>713,8648=>713,8649=>713,8650=>713, - 8651=>713,8652=>713,8653=>713,8654=>950,8655=>713,8656=>713,8657=>713,8658=>713,8659=>713,8660=>863,8661=>713,8662=>713,8663=>713,8664=>713,8665=>713,8666=>713, - 8667=>713,8668=>813,8669=>813,8670=>713,8671=>713,8672=>713,8673=>713,8674=>713,8675=>713,8676=>713,8677=>713,8678=>713,8679=>713,8680=>713,8681=>713,8682=>713, - 8704=>600,8705=>600,8706=>494,8707=>600,8708=>600,8709=>800,8710=>612,8711=>612,8712=>549,8713=>549,8714=>549,8715=>549,8716=>549,8717=>549,8718=>549,8719=>823, - 8720=>823,8721=>713,8722=>584,8723=>584,8724=>584,8725=>167,8726=>278,8727=>389,8728=>400,8729=>400,8730=>600,8731=>600,8732=>600,8733=>549,8734=>549,8735=>584, - 8736=>584,8737=>584,8738=>584,8739=>260,8740=>444,8741=>418,8742=>602,8743=>561,8744=>561,8745=>561,8746=>561,8747=>506,8748=>806,8749=>1106,8750=>506,8751=>806, - 8752=>1106,8753=>506,8754=>506,8755=>506,8756=>561,8757=>561,8758=>422,8759=>561,8760=>584,8761=>584,8762=>584,8763=>584,8764=>584,8765=>584,8766=>584,8767=>584, - 8768=>422,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584,8775=>584,8776=>584,8777=>584,8778=>584,8779=>584,8780=>584,8781=>584,8782=>584,8783=>584, - 8784=>584,8785=>584,8786=>584,8787=>584,8788=>737,8789=>737,8790=>584,8791=>584,8792=>584,8793=>584,8794=>584,8795=>584,8796=>584,8797=>584,8798=>584,8799=>584, - 8800=>584,8801=>584,8802=>584,8803=>584,8804=>584,8805=>584,8806=>584,8807=>584,8808=>584,8809=>584,8810=>969,8811=>969,8812=>584,8813=>584,8814=>584,8815=>584, - 8816=>584,8817=>584,8818=>584,8819=>584,8820=>584,8821=>584,8822=>584,8823=>584,8824=>584,8825=>584,8826=>584,8827=>584,8828=>584,8829=>584,8830=>584,8831=>584, - 8832=>584,8833=>584,8834=>678,8835=>678,8836=>678,8837=>678,8838=>678,8839=>678,8840=>678,8841=>678,8842=>678,8843=>678,8844=>561,8845=>561,8846=>561,8847=>678, - 8848=>678,8849=>673,8850=>673,8851=>561,8852=>561,8853=>800,8854=>800,8855=>800,8856=>800,8857=>800,8858=>800,8859=>800,8860=>800,8861=>800,8862=>800,8863=>800, - 8864=>800,8865=>800,8866=>549,8867=>549,8868=>549,8869=>549,8870=>399,8871=>399,8872=>549,8873=>549,8874=>549,8875=>672,8876=>549,8877=>549,8878=>549,8879=>672, - 8880=>549,8881=>549,8882=>549,8883=>549,8884=>549,8885=>549,8886=>713,8887=>713,8888=>713,8889=>549,8890=>549,8891=>584,8892=>584,8893=>584,8894=>584,8895=>584, - 8896=>561,8897=>561,8898=>561,8899=>561,8900=>549,8901=>250,8902=>549,8903=>649,8904=>630,8905=>630,8906=>630,8907=>630,8908=>630,8909=>584,8910=>561,8911=>561, - 8912=>668,8913=>668,8914=>668,8915=>668,8916=>561,8917=>602,8918=>584,8919=>584,8920=>1354,8921=>1354,8922=>584,8923=>584,8924=>584,8925=>584,8926=>584,8927=>584, - 8928=>584,8929=>584,8930=>673,8931=>673,8932=>673,8933=>673,8934=>584,8935=>584,8936=>584,8937=>584,8938=>584,8939=>584,8940=>584,8941=>584,8942=>278,8943=>1000, - 8944=>1000,8945=>1000,8960=>549,8962=>549,8963=>549,8964=>549,8965=>549,8966=>549,8967=>549,8968=>449,8969=>449,8970=>449,8971=>449,8972=>549,8973=>549,8974=>549, - 8975=>549,8976=>549,8977=>549,8978=>800,8979=>800,8980=>549,8981=>549,8982=>549,8983=>650,8984=>780,8985=>549,8986=>549,8987=>549,8988=>549,8989=>549,8990=>549, - 8991=>549,8992=>506,8993=>506,8994=>713,8995=>713,8996=>1000,8997=>1000,8998=>1000,8999=>1000,9000=>1000,9001=>329,9002=>329,9003=>1000,9004=>549,9005=>549,9006=>549, - 9007=>549,9008=>549,9009=>549,9010=>549,9011=>549,9012=>549,9013=>549,9014=>600,9015=>600,9016=>600,9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600, - 9023=>600,9024=>600,9025=>600,9026=>600,9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600,9037=>600,9038=>600, - 9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600,9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600, - 9055=>600,9056=>600,9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600,9067=>600,9068=>600,9069=>600,9070=>600, - 9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600,9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9109=>600,9216=>600,9217=>600,9218=>600, - 9219=>600,9220=>600,9221=>600,9222=>600,9223=>600,9224=>600,9225=>600,9226=>600,9227=>600,9228=>600,9229=>600,9230=>600,9231=>600,9232=>600,9233=>600,9234=>600, - 9235=>600,9236=>600,9237=>600,9238=>600,9239=>600,9240=>600,9241=>600,9242=>600,9243=>600,9244=>600,9245=>600,9246=>600,9247=>600,9248=>600,9249=>600,9250=>600, - 9251=>600,9252=>600,9280=>604,9281=>604,9282=>604,9283=>604,9284=>604,9285=>604,9286=>750,9287=>750,9288=>750,9289=>750,9290=>604,9312=>1000,9313=>1000,9314=>1000, - 9315=>1000,9316=>1000,9317=>1000,9318=>1000,9319=>1000,9320=>1000,9321=>1000,9322=>1000,9323=>1000,9324=>1000,9325=>1000,9326=>1000,9327=>1000,9328=>1000,9329=>1000,9330=>1000, - 9331=>1000,9332=>1000,9333=>1000,9334=>1000,9335=>1000,9336=>1000,9337=>1000,9338=>1000,9339=>1000,9340=>1000,9341=>1000,9342=>1000,9343=>1000,9344=>1000,9345=>1000,9346=>1000, - 9347=>1000,9348=>1000,9349=>1000,9350=>1000,9351=>1000,9352=>1000,9353=>1000,9354=>1000,9355=>1000,9356=>1000,9357=>1000,9358=>1000,9359=>1000,9360=>1000,9361=>1000,9362=>1000, - 9363=>1000,9364=>1000,9365=>1000,9366=>1000,9367=>1000,9368=>1000,9369=>1000,9370=>1000,9371=>1000,9372=>1000,9373=>1000,9374=>1000,9375=>1000,9376=>1000,9377=>1000,9378=>1000, - 9379=>1000,9380=>1000,9381=>1000,9382=>1000,9383=>1000,9384=>1000,9385=>1000,9386=>1000,9387=>1000,9388=>1000,9389=>1000,9390=>1000,9391=>1000,9392=>1000,9393=>1000,9394=>1000, - 9395=>1000,9396=>1000,9397=>1000,9398=>1000,9399=>1000,9400=>1000,9401=>1000,9402=>1000,9403=>1000,9404=>1000,9405=>1000,9406=>1000,9407=>1000,9408=>1000,9409=>1000,9410=>1000, - 9411=>1000,9412=>1000,9413=>1000,9414=>1000,9415=>1000,9416=>1000,9417=>1000,9418=>1000,9419=>1000,9420=>1000,9421=>1000,9422=>1000,9423=>1000,9424=>1000,9425=>1000,9426=>1000, - 9427=>1000,9428=>1000,9429=>1000,9430=>1000,9431=>1000,9432=>1000,9433=>1000,9434=>1000,9435=>1000,9436=>1000,9437=>1000,9438=>1000,9439=>1000,9440=>1000,9441=>1000,9442=>1000, - 9443=>1000,9444=>1000,9445=>1000,9446=>1000,9447=>1000,9448=>1000,9449=>1000,9450=>1000,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600, - 9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600, - 9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600, - 9512=>600,9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600,9527=>600, - 9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600, - 9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600, - 9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600, - 9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600, - 9592=>600,9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600,9607=>600, - 9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600, - 9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600, - 9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600, - 9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600,9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600, - 9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600,9693=>600,9694=>600,9695=>600,9696=>600,9697=>600, - 9698=>600,9699=>600,9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9728=>750,9729=>1000, - 9730=>750,9731=>750,9732=>1000,9733=>816,9734=>823,9735=>500,9736=>500,9737=>800,9738=>800,9739=>800,9740=>800,9741=>800,9742=>719,9743=>719,9744=>734,9745=>734, - 9746=>734,9747=>762,9754=>960,9755=>960,9756=>939,9757=>939,9758=>939,9759=>939,9760=>750,9761=>600,9762=>750,9763=>750,9764=>580,9765=>460,9766=>444,9767=>650, - 9768=>444,9769=>768,9770=>800,9771=>850,9772=>675,9773=>800,9774=>750,9775=>750,9776=>900,9777=>900,9778=>900,9779=>900,9780=>900,9781=>900,9782=>900,9783=>900, - 9784=>750,9785=>750,9786=>750,9787=>750,9788=>750,9789=>750,9790=>750,9791=>740,9792=>740,9793=>740,9794=>740,9795=>653,9796=>490,9797=>632,9798=>780,9799=>560, - 9800=>838,9801=>780,9802=>734,9803=>887,9804=>780,9805=>1080,9806=>896,9807=>1080,9808=>804,9809=>868,9810=>922,9811=>696,9812=>1000,9813=>1000,9814=>1000,9815=>1000, - 9816=>1000,9817=>1000,9818=>1000,9819=>1000,9820=>1000,9821=>1000,9822=>1000,9823=>1000,9824=>722,9825=>734,9826=>674,9827=>804,9828=>722,9829=>734,9830=>674,9831=>804, - 9832=>860,9833=>423,9834=>592,9835=>750,9836=>750,9837=>439,9838=>439,9839=>439,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791,9993=>690, - 9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846,10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759, - 10012=>754,10013=>494,10014=>552,10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823,10026=>789,10027=>841,10028=>823, - 10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749,10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708, - 10045=>682,10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786,10056=>787,10057=>713,10058=>791,10059=>785,10061=>873, - 10063=>762,10064=>762,10065=>759,10066=>759,10070=>784,10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544,10084=>910, - 10085=>667,10086=>760,10087=>760,10102=>788,10103=>788,10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788,10114=>788, - 10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788,10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788, - 10131=>788,10132=>894,10136=>748,10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924,10147=>924,10148=>917,10149=>930, - 10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867,10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771, - 10167=>888,10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,12288=>1000,12289=>1000,12290=>1000,12291=>1000,12292=>1000,12293=>1000,12294=>1000,12295=>1000, - 12296=>1000,12297=>1000,12298=>1000,12299=>1000,12300=>1000,12301=>1000,12302=>1000,12303=>1000,12304=>1000,12305=>1000,12306=>1000,12307=>1000,12308=>1000,12309=>1000,12310=>1000,12311=>1000, - 12312=>1000,12313=>1000,12314=>1000,12315=>1000,12316=>1000,12317=>1000,12318=>1000,12319=>1000,12320=>1000,12321=>1000,12322=>1000,12323=>1000,12324=>1000,12325=>1000,12326=>1000,12327=>1000, - 12328=>1000,12329=>1000,12330=>1000,12331=>1000,12332=>1000,12333=>1000,12334=>1000,12335=>1000,12336=>1000,12337=>1000,12338=>1000,12339=>1000,12340=>1000,12341=>1000,12342=>1000,12343=>1000, - 12351=>1000,12353=>1000,12354=>1000,12355=>1000,12356=>1000,12357=>1000,12358=>1000,12359=>1000,12360=>1000,12361=>1000,12362=>1000,12363=>1000,12364=>1000,12365=>1000,12366=>1000,12367=>1000, - 12368=>1000,12369=>1000,12370=>1000,12371=>1000,12372=>1000,12373=>1000,12374=>1000,12375=>1000,12376=>1000,12377=>1000,12378=>1000,12379=>1000,12380=>1000,12381=>1000,12382=>1000,12383=>1000, - 12384=>1000,12385=>1000,12386=>1000,12387=>1000,12388=>1000,12389=>1000,12390=>1000,12391=>1000,12392=>1000,12393=>1000,12394=>1000,12395=>1000,12396=>1000,12397=>1000,12398=>1000,12399=>1000, - 12400=>1000,12401=>1000,12402=>1000,12403=>1000,12404=>1000,12405=>1000,12406=>1000,12407=>1000,12408=>1000,12409=>1000,12410=>1000,12411=>1000,12412=>1000,12413=>1000,12414=>1000,12415=>1000, - 12416=>1000,12417=>1000,12418=>1000,12419=>1000,12420=>1000,12421=>1000,12422=>1000,12423=>1000,12424=>1000,12425=>1000,12426=>1000,12427=>1000,12428=>1000,12429=>1000,12430=>1000,12431=>1000, - 12432=>1000,12433=>1000,12434=>1000,12435=>1000,12436=>1000,12441=>1000,12442=>1000,12443=>1000,12444=>1000,12445=>1000,12446=>1000,12449=>1000,12450=>1000,12451=>1000,12452=>1000,12453=>1000, - 12454=>1000,12455=>1000,12456=>1000,12457=>1000,12458=>1000,12459=>1000,12460=>1000,12461=>1000,12462=>1000,12463=>1000,12464=>1000,12465=>1000,12466=>1000,12467=>1000,12468=>1000,12469=>1000, - 12470=>1000,12471=>1000,12472=>1000,12473=>1000,12474=>1000,12475=>1000,12476=>1000,12477=>1000,12478=>1000,12479=>1000,12480=>1000,12481=>1000,12482=>1000,12483=>1000,12484=>1000,12485=>1000, - 12486=>1000,12487=>1000,12488=>1000,12489=>1000,12490=>1000,12491=>1000,12492=>1000,12493=>1000,12494=>1000,12495=>1000,12496=>1000,12497=>1000,12498=>1000,12499=>1000,12500=>1000,12501=>1000, - 12502=>1000,12503=>1000,12504=>1000,12505=>1000,12506=>1000,12507=>1000,12508=>1000,12509=>1000,12510=>1000,12511=>1000,12512=>1000,12513=>1000,12514=>1000,12515=>1000,12516=>1000,12517=>1000, - 12518=>1000,12519=>1000,12520=>1000,12521=>1000,12522=>1000,12523=>1000,12524=>1000,12525=>1000,12526=>1000,12527=>1000,12528=>1000,12529=>1000,12530=>1000,12531=>1000,12532=>1000,12533=>1000, - 12534=>1000,12535=>1000,12536=>1000,12537=>1000,12538=>1000,12539=>1000,12540=>1000,12541=>1000,12542=>1000,12549=>1000,12550=>1000,12551=>1000,12552=>1000,12553=>1000,12554=>1000,12555=>1000, - 12556=>1000,12557=>1000,12558=>1000,12559=>1000,12560=>1000,12561=>1000,12562=>1000,12563=>1000,12564=>1000,12565=>1000,12566=>1000,12567=>1000,12568=>1000,12569=>1000,12570=>1000,12571=>1000, - 12572=>1000,12573=>1000,12574=>1000,12575=>1000,12576=>1000,12577=>1000,12578=>1000,12579=>1000,12580=>1000,12581=>1000,12582=>1000,12583=>1000,12584=>1000,12585=>1000,12586=>1000,12587=>1000, - 12588=>1000,12593=>1000,12594=>1000,12595=>1000,12596=>1000,12597=>1000,12598=>1000,12599=>1000,12600=>1000,12601=>1000,12602=>1000,12603=>1000,12604=>1000,12605=>1000,12606=>1000,12607=>1000, - 12608=>1000,12609=>1000,12610=>1000,12611=>1000,12612=>1000,12613=>1000,12614=>1000,12615=>1000,12616=>1000,12617=>1000,12618=>1000,12619=>1000,12620=>1000,12621=>1000,12622=>1000,12623=>1000, - 12624=>1000,12625=>1000,12626=>1000,12627=>1000,12628=>1000,12629=>1000,12630=>1000,12631=>1000,12632=>1000,12633=>1000,12634=>1000,12635=>1000,12636=>1000,12637=>1000,12638=>1000,12639=>1000, - 12640=>1000,12641=>1000,12642=>1000,12643=>1000,12644=>1000,12645=>1000,12646=>1000,12647=>1000,12648=>1000,12649=>1000,12650=>1000,12651=>1000,12652=>1000,12653=>1000,12654=>1000,12655=>1000, - 12656=>1000,12657=>1000,12658=>1000,12659=>1000,12660=>1000,12661=>1000,12662=>1000,12663=>1000,12664=>1000,12665=>1000,12666=>1000,12667=>1000,12668=>1000,12669=>1000,12670=>1000,12671=>1000, - 12672=>1000,12673=>1000,12674=>1000,12675=>1000,12676=>1000,12677=>1000,12678=>1000,12679=>1000,12680=>1000,12681=>1000,12682=>1000,12683=>1000,12684=>1000,12685=>1000,12686=>1000,12688=>1000, - 12689=>1000,12690=>1000,12691=>1000,12692=>1000,12693=>1000,12694=>1000,12695=>1000,12696=>1000,12697=>1000,12698=>1000,12699=>1000,12700=>1000,12701=>1000,12702=>1000,12703=>1000,12800=>1000, - 12801=>1000,12802=>1000,12803=>1000,12804=>1000,12805=>1000,12806=>1000,12807=>1000,12808=>1000,12809=>1000,12810=>1000,12811=>1000,12812=>1000,12813=>1000,12814=>1000,12815=>1000,12816=>1000, - 12817=>1000,12818=>1000,12819=>1000,12820=>1000,12821=>1000,12822=>1000,12823=>1000,12824=>1000,12825=>1000,12826=>1000,12827=>1000,12828=>1000,12832=>1000,12833=>1000,12834=>1000,12835=>1000, - 12836=>1000,12837=>1000,12838=>1000,12839=>1000,12840=>1000,12841=>1000,12842=>1000,12843=>1000,12844=>1000,12845=>1000,12846=>1000,12847=>1000,12848=>1000,12849=>1000,12850=>1000,12851=>1000, - 12852=>1000,12853=>1000,12854=>1000,12855=>1000,12856=>1000,12857=>1000,12858=>1000,12859=>1000,12860=>1000,12861=>1000,12862=>1000,12863=>1000,12864=>1000,12865=>1000,12866=>1000,12867=>1000, - 12896=>1000,12897=>1000,12898=>1000,12899=>1000,12900=>1000,12901=>1000,12902=>1000,12903=>1000,12904=>1000,12905=>1000,12906=>1000,12907=>1000,12908=>1000,12909=>1000,12910=>1000,12911=>1000, - 12912=>1000,12913=>1000,12914=>1000,12915=>1000,12916=>1000,12917=>1000,12918=>1000,12919=>1000,12920=>1000,12921=>1000,12922=>1000,12923=>1000,12927=>1000,12928=>1000,12929=>1000,12930=>1000, - 12931=>1000,12932=>1000,12933=>1000,12934=>1000,12935=>1000,12936=>1000,12937=>1000,12938=>1000,12939=>1000,12940=>1000,12941=>1000,12942=>1000,12943=>1000,12944=>1000,12945=>1000,12946=>1000, - 12947=>1000,12948=>1000,12949=>1000,12950=>1000,12951=>1000,12952=>1000,12953=>1000,12954=>1000,12955=>1000,12956=>1000,12957=>1000,12958=>1000,12959=>1000,12960=>1000,12961=>1000,12962=>1000, - 12963=>1000,12964=>1000,12965=>1000,12966=>1000,12967=>1000,12968=>1000,12969=>1000,12970=>1000,12971=>1000,12972=>1000,12973=>1000,12974=>1000,12975=>1000,12976=>1000,12992=>1000,12993=>1000, - 12994=>1000,12995=>1000,12996=>1000,12997=>1000,12998=>1000,12999=>1000,13000=>1000,13001=>1000,13002=>1000,13003=>1000,13008=>1000,13009=>1000,13010=>1000,13011=>1000,13012=>1000,13013=>1000, - 13014=>1000,13015=>1000,13016=>1000,13017=>1000,13018=>1000,13019=>1000,13020=>1000,13021=>1000,13022=>1000,13023=>1000,13024=>1000,13025=>1000,13026=>1000,13027=>1000,13028=>1000,13029=>1000, - 13030=>1000,13031=>1000,13032=>1000,13033=>1000,13034=>1000,13035=>1000,13036=>1000,13037=>1000,13038=>1000,13039=>1000,13040=>1000,13041=>1000,13042=>1000,13043=>1000,13044=>1000,13045=>1000, - 13046=>1000,13047=>1000,13048=>1000,13049=>1000,13050=>1000,13051=>1000,13052=>1000,13053=>1000,13054=>1000,13056=>1000,13057=>1000,13058=>1000,13059=>1000,13060=>1000,13061=>1000,13062=>1000, - 13063=>1000,13064=>1000,13065=>1000,13066=>1000,13067=>1000,13068=>1000,13069=>1000,13070=>1000,13071=>1000,13072=>1000,13073=>1000,13074=>1000,13075=>1000,13076=>1000,13077=>1000,13078=>1000, - 13079=>1000,13080=>1000,13081=>1000,13082=>1000,13083=>1000,13084=>1000,13085=>1000,13086=>1000,13087=>1000,13088=>1000,13089=>1000,13090=>1000,13091=>1000,13092=>1000,13093=>1000,13094=>1000, - 13095=>1000,13096=>1000,13097=>1000,13098=>1000,13099=>1000,13100=>1000,13101=>1000,13102=>1000,13103=>1000,13104=>1000,13105=>1000,13106=>1000,13107=>1000,13108=>1000,13109=>1000,13110=>1000, - 13111=>1000,13112=>1000,13113=>1000,13114=>1000,13115=>1000,13116=>1000,13117=>1000,13118=>1000,13119=>1000,13120=>1000,13121=>1000,13122=>1000,13123=>1000,13124=>1000,13125=>1000,13126=>1000, - 13127=>1000,13128=>1000,13129=>1000,13130=>1000,13131=>1000,13132=>1000,13133=>1000,13134=>1000,13135=>1000,13136=>1000,13137=>1000,13138=>1000,13139=>1000,13140=>1000,13141=>1000,13142=>1000, - 13143=>1000,13144=>1000,13145=>1000,13146=>1000,13147=>1000,13148=>1000,13149=>1000,13150=>1000,13151=>1000,13152=>1000,13153=>1000,13154=>1000,13155=>1000,13156=>1000,13157=>1000,13158=>1000, - 13159=>1000,13160=>1000,13161=>1000,13162=>1000,13163=>1000,13164=>1000,13165=>1000,13166=>1000,13167=>1000,13168=>1000,13169=>1000,13170=>1000,13171=>1000,13172=>1000,13173=>1000,13174=>1000, - 13179=>1000,13180=>1000,13181=>1000,13182=>1000,13183=>1000,13184=>1000,13185=>1000,13186=>1000,13187=>1000,13188=>1000,13189=>1000,13190=>1000,13191=>1000,13192=>1000,13193=>1000,13194=>1000, - 13195=>1000,13196=>1000,13197=>1000,13198=>1000,13199=>1000,13200=>1000,13201=>1000,13202=>1000,13203=>1000,13204=>1000,13205=>1000,13206=>1000,13207=>1000,13208=>1000,13209=>1000,13210=>1000, - 13211=>1000,13212=>1000,13213=>1000,13214=>1000,13215=>1000,13216=>1000,13217=>1000,13218=>1000,13219=>1000,13220=>1000,13221=>1000,13222=>1000,13223=>1000,13224=>1000,13225=>1000,13226=>1000, - 13227=>1000,13228=>1000,13229=>1000,13230=>1000,13231=>1000,13232=>1000,13233=>1000,13234=>1000,13235=>1000,13236=>1000,13237=>1000,13238=>1000,13239=>1000,13240=>1000,13241=>1000,13242=>1000, - 13243=>1000,13244=>1000,13245=>1000,13246=>1000,13247=>1000,13248=>1000,13249=>1000,13250=>1000,13251=>1000,13252=>1000,13253=>1000,13254=>1000,13255=>1000,13256=>1000,13257=>1000,13258=>1000, - 13259=>1000,13260=>1000,13261=>1000,13262=>1000,13263=>1000,13264=>1000,13265=>1000,13266=>1000,13267=>1000,13268=>1000,13269=>1000,13270=>1000,13271=>1000,13272=>1000,13273=>1000,13274=>1000, - 13275=>1000,13276=>1000,13277=>1000,13280=>1000,13281=>1000,13282=>1000,13283=>1000,13284=>1000,13285=>1000,13286=>1000,13287=>1000,13288=>1000,13289=>1000,13290=>1000,13291=>1000,13292=>1000, - 13293=>1000,13294=>1000,13295=>1000,13296=>1000,13297=>1000,13298=>1000,13299=>1000,13300=>1000,13301=>1000,13302=>1000,13303=>1000,13304=>1000,13305=>1000,13306=>1000,13307=>1000,13308=>1000, - 13309=>1000,13310=>1000,59393=>316,59394=>507,59395=>507,59396=>484,59397=>484,59416=>0,59492=>480,59495=>480,59536=>458,59557=>466,59558=>480,59559=>903,61441=>500,61442=>500, - 63232=>541,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>849, - 63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>333,63261=>287,63744=>1000,63745=>1000,63746=>1000, - 63747=>1000,63748=>1000,63749=>1000,63750=>1000,63751=>1000,63752=>1000,63753=>1000,63754=>1000,63755=>1000,63756=>1000,63757=>1000,63758=>1000,63759=>1000,63760=>1000,63761=>1000,63762=>1000, - 63763=>1000,63764=>1000,63765=>1000,63766=>1000,63767=>1000,63768=>1000,63769=>1000,63770=>1000,63771=>1000,63772=>1000,63773=>1000,63774=>1000,63775=>1000,63776=>1000,63777=>1000,63778=>1000, - 63779=>1000,63780=>1000,63781=>1000,63782=>1000,63783=>1000,63784=>1000,63785=>1000,63786=>1000,63787=>1000,63788=>1000,63789=>1000,63790=>1000,63791=>1000,63792=>1000,63793=>1000,63794=>1000, - 63795=>1000,63796=>1000,63797=>1000,63798=>1000,63799=>1000,63800=>1000,63801=>1000,63802=>1000,63803=>1000,63804=>1000,63805=>1000,63806=>1000,63807=>1000,63808=>1000,63809=>1000,63810=>1000, - 63811=>1000,63812=>1000,63813=>1000,63814=>1000,63815=>1000,63816=>1000,63817=>1000,63818=>1000,63819=>1000,63820=>1000,63821=>1000,63822=>1000,63823=>1000,63824=>1000,63825=>1000,63826=>1000, - 63827=>1000,63828=>1000,63829=>1000,63830=>1000,63831=>1000,63832=>1000,63833=>1000,63834=>1000,63835=>1000,63836=>1000,63837=>1000,63838=>1000,63839=>1000,63840=>1000,63841=>1000,63842=>1000, - 63843=>1000,63844=>1000,63845=>1000,63846=>1000,63847=>1000,63848=>1000,63849=>1000,63850=>1000,63851=>1000,63852=>1000,63853=>1000,63854=>1000,63855=>1000,63856=>1000,63857=>1000,63858=>1000, - 63859=>1000,63860=>1000,63861=>1000,63862=>1000,63863=>1000,63864=>1000,63865=>1000,63866=>1000,63867=>1000,63868=>1000,63869=>1000,63870=>1000,63871=>1000,63872=>1000,63873=>1000,63874=>1000, - 63875=>1000,63876=>1000,63877=>1000,63878=>1000,63879=>1000,63880=>1000,63881=>1000,63882=>1000,63883=>1000,63884=>1000,63885=>1000,63886=>1000,63887=>1000,63888=>1000,63889=>1000,63890=>1000, - 63891=>1000,63892=>1000,63893=>1000,63894=>1000,63895=>1000,63896=>1000,63897=>1000,63898=>1000,63899=>1000,63900=>1000,63901=>1000,63902=>1000,63903=>1000,63904=>1000,63905=>1000,63906=>1000, - 63907=>1000,63908=>1000,63909=>1000,63910=>1000,63911=>1000,63912=>1000,63913=>1000,63914=>1000,63915=>1000,63916=>1000,63917=>1000,63918=>1000,63919=>1000,63920=>1000,63921=>1000,63922=>1000, - 63923=>1000,63924=>1000,63925=>1000,63926=>1000,63927=>1000,63928=>1000,63929=>1000,63930=>1000,63931=>1000,63932=>1000,63933=>1000,63934=>1000,63935=>1000,63936=>1000,63937=>1000,63938=>1000, - 63939=>1000,63940=>1000,63941=>1000,63942=>1000,63943=>1000,63944=>1000,63945=>1000,63946=>1000,63947=>1000,63948=>1000,63949=>1000,63950=>1000,63951=>1000,63952=>1000,63953=>1000,63954=>1000, - 63955=>1000,63956=>1000,63957=>1000,63958=>1000,63959=>1000,63960=>1000,63961=>1000,63962=>1000,63963=>1000,63964=>1000,63965=>1000,63966=>1000,63967=>1000,63968=>1000,63969=>1000,63970=>1000, - 63971=>1000,63972=>1000,63973=>1000,63974=>1000,63975=>1000,63976=>1000,63977=>1000,63978=>1000,63979=>1000,63980=>1000,63981=>1000,63982=>1000,63983=>1000,63984=>1000,63985=>1000,63986=>1000, - 63987=>1000,63988=>1000,63989=>1000,63990=>1000,63991=>1000,63992=>1000,63993=>1000,63994=>1000,63995=>1000,63996=>1000,63997=>1000,63998=>1000,63999=>1000,64000=>1000,64001=>1000,64002=>1000, - 64003=>1000,64004=>1000,64005=>1000,64006=>1000,64007=>1000,64008=>1000,64009=>1000,64010=>1000,64011=>1000,64012=>1000,64013=>1000,64014=>1000,64015=>1000,64016=>1000,64017=>1000,64018=>1000, - 64019=>1000,64020=>1000,64021=>1000,64022=>1000,64023=>1000,64024=>1000,64025=>1000,64026=>1000,64027=>1000,64028=>1000,64029=>1000,64030=>1000,64031=>1000,64032=>1000,64033=>1000,64034=>1000, - 64035=>1000,64036=>1000,64037=>1000,64038=>1000,64039=>1000,64040=>1000,64041=>1000,64042=>1000,64043=>1000,64044=>1000,64045=>1000,64256=>537,64257=>500,64258=>500,64259=>778,64260=>750, - 64261=>532,64262=>758,64275=>784,64276=>784,64277=>784,64278=>784,64279=>893,64286=>333,64287=>590,64288=>550,64289=>709,64290=>649,64291=>730,64292=>656,64293=>605,64294=>730, - 64295=>633,64296=>794,64297=>584,64298=>700,64299=>700,64300=>700,64301=>700,64302=>577,64303=>577,64304=>577,64305=>563,64306=>411,64307=>512,64308=>594,64309=>316,64310=>326, - 64312=>594,64313=>316,64314=>507,64315=>527,64316=>484,64318=>594,64320=>338,64321=>604,64323=>567,64324=>569,64326=>514,64327=>583,64328=>507,64329=>700,64330=>633,64331=>316, - 64332=>563,64333=>527,64334=>569,64335=>577,64336=>243,64337=>273,64338=>771,64339=>788,64340=>276,64341=>243,64342=>771,64343=>788,64344=>276,64345=>243,64346=>771,64347=>788, - 64348=>276,64349=>243,64350=>771,64351=>788,64352=>276,64353=>243,64354=>771,64355=>788,64356=>276,64357=>243,64358=>771,64359=>788,64360=>276,64361=>243,64362=>957,64363=>903, - 64364=>466,64365=>480,64366=>957,64367=>903,64368=>466,64369=>480,64370=>544,64371=>658,64372=>646,64373=>637,64374=>544,64375=>658,64376=>646,64377=>637,64378=>544,64379=>658, - 64380=>646,64381=>637,64382=>544,64383=>658,64384=>646,64385=>637,64386=>430,64387=>458,64388=>430,64389=>458,64390=>430,64391=>458,64392=>430,64393=>458,64394=>421,64395=>436, - 64396=>421,64397=>436,64398=>828,64399=>942,64400=>432,64401=>549,64402=>828,64403=>942,64404=>432,64405=>549,64406=>828,64407=>942,64408=>432,64409=>549,64410=>828,64411=>942, - 64412=>432,64413=>549,64414=>692,64415=>723,64416=>692,64417=>723,64418=>276,64419=>243,64420=>514,64421=>477,64422=>514,64423=>509,64424=>273,64425=>427,64426=>706,64427=>706, - 64428=>686,64429=>686,64430=>550,64431=>461,64432=>550,64433=>461,64467=>757,64468=>733,64469=>432,64470=>549,64471=>470,64472=>466,64473=>470,64474=>466,64475=>470,64476=>466, - 64477=>470,64478=>470,64479=>466,64480=>470,64481=>466,64482=>470,64483=>466,64484=>781,64485=>933,64486=>276,64487=>243,64488=>276,64489=>243,64490=>547,64491=>517,64492=>783, - 64493=>753,64494=>740,64495=>710,64496=>740,64497=>710,64498=>740,64499=>710,64500=>740,64501=>710,64502=>1207,64503=>1177,64504=>517,64505=>1067,64506=>1037,64507=>517,64508=>731, - 64509=>793,64510=>276,64511=>243,64512=>932,64513=>932,64514=>914,64515=>1067,64516=>1077,64517=>935,64518=>935,64519=>935,64520=>917,64521=>1070,64522=>1080,64523=>932,64524=>932, - 64525=>932,64526=>914,64527=>1067,64528=>1077,64529=>932,64530=>914,64531=>1067,64532=>1077,64533=>1305,64534=>1287,64535=>1305,64536=>1287,64537=>1305,64538=>1305,64539=>1287,64540=>1429, - 64541=>1429,64542=>1429,64543=>1411,64544=>1476,64545=>1458,64546=>1476,64547=>1476,64548=>1476,64549=>1458,64550=>1392,64551=>1374,64552=>1374,64553=>1245,64554=>1227,64555=>1245,64556=>1227, - 64557=>1125,64558=>1125,64559=>1125,64560=>1107,64561=>1260,64562=>1270,64563=>1125,64564=>1107,64565=>1260,64566=>1270,64567=>706,64568=>1091,64569=>1091,64570=>1091,64571=>1106,64572=>1073, - 64573=>1226,64574=>1236,64575=>932,64576=>932,64577=>932,64578=>914,64579=>1067,64580=>1077,64581=>1140,64582=>1140,64583=>1140,64584=>1122,64585=>1275,64586=>1285,64587=>932,64588=>932, - 64589=>932,64590=>914,64591=>1067,64592=>1077,64593=>1345,64594=>1327,64595=>1480,64596=>1490,64597=>932,64598=>932,64599=>932,64600=>914,64601=>1067,64602=>1077,64603=>430,64604=>421, - 64605=>731,64606=>296,64607=>300,64608=>300,64609=>300,64610=>300,64611=>300,64612=>680,64613=>680,64614=>884,64615=>967,64616=>1037,64617=>1047,64618=>680,64619=>680,64620=>884, - 64621=>967,64622=>1037,64623=>1047,64624=>680,64625=>680,64626=>884,64627=>967,64628=>1037,64629=>1047,64630=>680,64631=>680,64632=>884,64633=>967,64634=>1037,64635=>1047,64636=>1274, - 64637=>1284,64638=>1274,64639=>1284,64640=>821,64641=>1221,64642=>1188,64643=>1341,64644=>1351,64645=>884,64646=>1037,64647=>1047,64648=>806,64649=>1173,64650=>680,64651=>680,64652=>884, - 64653=>967,64654=>1037,64655=>1047,64656=>793,64657=>680,64658=>680,64659=>884,64660=>967,64661=>1037,64662=>1047,64663=>911,64664=>911,64665=>911,64666=>806,64667=>679,64668=>911, - 64669=>911,64670=>911,64671=>806,64672=>679,64673=>911,64674=>911,64675=>911,64676=>806,64677=>679,64678=>806,64679=>1284,64680=>1179,64681=>1284,64682=>1179,64683=>1284,64684=>1179, - 64685=>1408,64686=>1408,64687=>1408,64688=>1303,64689=>1455,64690=>1455,64691=>1350,64692=>1455,64693=>1455,64694=>1455,64695=>1350,64696=>1371,64697=>1266,64698=>1224,64699=>1119,64700=>1224, - 64701=>1119,64702=>1104,64703=>1104,64704=>1104,64705=>999,64706=>1104,64707=>999,64708=>1070,64709=>1070,64710=>1070,64711=>676,64712=>965,64713=>911,64714=>911,64715=>911,64716=>806, - 64717=>679,64718=>1119,64719=>1119,64720=>1119,64721=>1014,64722=>911,64723=>911,64724=>911,64725=>806,64726=>679,64727=>1324,64728=>1219,64729=>686,64730=>911,64731=>911,64732=>911, - 64733=>806,64734=>679,64735=>776,64736=>649,64737=>776,64738=>649,64739=>776,64740=>649,64741=>776,64742=>649,64743=>1303,64744=>1176,64745=>1303,64746=>1176,64747=>793,64748=>1082, - 64749=>776,64750=>776,64751=>649,64752=>776,64753=>649,64754=>306,64755=>302,64756=>298,64757=>1527,64758=>1537,64759=>1380,64760=>1390,64761=>1380,64762=>1390,64763=>1564,64764=>1574, - 64765=>1564,64766=>1574,64767=>1440,64768=>1450,64769=>1440,64770=>1450,64771=>1440,64772=>1450,64773=>1611,64774=>1621,64775=>1611,64776=>1621,64777=>1429,64778=>1429,64779=>1429,64780=>1411, - 64781=>1207,64782=>1207,64783=>1254,64784=>1254,64785=>1527,64786=>1537,64787=>1348,64788=>1358,64789=>1348,64790=>1358,64791=>1564,64792=>1574,64793=>1564,64794=>1574,64795=>1431,64796=>1441, - 64797=>1431,64798=>1441,64799=>1431,64800=>1441,64801=>1611,64802=>1621,64803=>1611,64804=>1621,64805=>1429,64806=>1429,64807=>1429,64808=>1411,64809=>1207,64810=>1207,64811=>1254,64812=>1254, - 64813=>1408,64814=>1408,64815=>1408,64816=>1303,64817=>1176,64818=>1176,64819=>1266,64820=>1408,64821=>1408,64822=>1408,64823=>1408,64824=>1408,64825=>1408,64826=>1266,64827=>1266,64828=>273, - 64829=>243,64830=>600,64831=>600,64848=>1444,64849=>1541,64850=>1549,64851=>1444,64852=>1444,64853=>1444,64854=>1444,64855=>1444,64856=>1830,64857=>1817,64858=>1975,64859=>1964,64860=>2046, - 64861=>2046,64862=>2202,64863=>1962,64864=>1941,64865=>1941,64866=>1944,64867=>1836,64868=>2114,64869=>2093,64870=>1991,64871=>2049,64872=>1941,64873=>2212,64874=>1962,64875=>1941,64876=>1944, - 64877=>1836,64878=>2249,64879=>2096,64880=>1988,64881=>1925,64882=>1904,64883=>1799,64884=>2070,64885=>1833,64886=>1729,64887=>1652,64888=>1881,64889=>1729,64890=>1892,64891=>1881,64892=>1759, - 64893=>1637,64894=>1670,64895=>1654,64896=>1522,64897=>1686,64898=>1675,64899=>1549,64900=>1541,64901=>1522,64902=>1444,64903=>1436,64904=>1444,64905=>1757,64906=>1652,64907=>1975,64908=>1757, - 64909=>1652,64910=>1757,64911=>1652,64914=>1757,64915=>1857,64916=>1752,64917=>1444,64918=>1675,64919=>1522,64920=>1444,64921=>1675,64922=>1581,64923=>1570,64924=>1417,64925=>1362,64926=>1686, - 64927=>1686,64928=>1675,64929=>1686,64930=>1675,64931=>1581,64932=>1570,64933=>1975,64934=>2069,64935=>1964,64936=>2202,64937=>2259,64938=>2212,64939=>2259,64940=>1686,64941=>1581,64942=>1686, - 64943=>1686,64944=>1581,64945=>1870,64946=>1817,64947=>1686,64948=>1637,64949=>1444,64950=>1892,64951=>1886,64952=>1549,64953=>1975,64954=>1444,64955=>1723,64956=>1522,64957=>1541,64958=>2080, - 64959=>2080,64960=>1975,64961=>1817,64962=>1686,64963=>1499,64964=>1757,64965=>1883,64966=>2212,64967=>1686,65008=>1523,65009=>1172,65010=>1159,65011=>1356,65012=>2111,65013=>2258,65014=>2130, - 65015=>1552,65016=>2046,65017=>1856,65018=>1930,65019=>1070,65056=>450,65057=>450,65058=>450,65059=>450,65072=>1000,65073=>1000,65074=>1000,65075=>1000,65076=>1000,65077=>1000,65078=>1000, - 65079=>1000,65080=>1000,65081=>1000,65082=>1000,65083=>1000,65084=>1000,65085=>1000,65086=>1000,65087=>1000,65088=>1000,65089=>1000,65090=>1000,65091=>1000,65092=>1000,65097=>1000,65098=>1000, - 65099=>1000,65100=>1000,65101=>1000,65102=>1000,65103=>1000,65104=>167,65105=>250,65106=>167,65108=>167,65109=>167,65110=>334,65111=>167,65112=>600,65113=>200,65114=>200,65115=>200, - 65116=>200,65117=>200,65118=>200,65119=>334,65120=>400,65121=>233,65122=>350,65123=>200,65124=>350,65125=>350,65126=>350,65128=>167,65129=>334,65130=>533,65131=>609,65136=>300, - 65137=>298,65138=>296,65140=>298,65142=>300,65143=>298,65144=>300,65145=>302,65146=>298,65147=>296,65148=>306,65149=>306,65150=>154,65151=>154,65152=>529,65153=>243,65154=>273, - 65155=>243,65156=>273,65157=>470,65158=>466,65159=>243,65160=>273,65161=>731,65162=>793,65163=>276,65164=>243,65165=>243,65166=>273,65167=>771,65168=>788,65169=>276,65170=>243, - 65171=>514,65172=>477,65173=>771,65174=>788,65175=>276,65176=>243,65177=>771,65178=>788,65179=>276,65180=>243,65181=>544,65182=>658,65183=>646,65184=>637,65185=>544,65186=>658, - 65187=>646,65188=>637,65189=>544,65190=>658,65191=>646,65192=>637,65193=>430,65194=>458,65195=>430,65196=>458,65197=>421,65198=>436,65199=>421,65200=>436,65201=>1194,65202=>1194, - 65203=>770,65204=>770,65205=>1194,65206=>1194,65207=>770,65208=>770,65209=>1291,65210=>1291,65211=>817,65212=>817,65213=>1291,65214=>1291,65215=>817,65216=>817,65217=>843,65218=>843, - 65219=>733,65220=>733,65221=>843,65222=>843,65223=>733,65224=>733,65225=>594,65226=>556,65227=>586,65228=>554,65229=>594,65230=>556,65231=>586,65232=>554,65233=>957,65234=>903, - 65235=>466,65236=>480,65237=>800,65238=>823,65239=>466,65240=>480,65241=>757,65242=>733,65243=>432,65244=>549,65245=>662,65246=>673,65247=>273,65248=>243,65249=>589,65250=>640, - 65251=>481,65252=>532,65253=>692,65254=>723,65255=>276,65256=>243,65257=>514,65258=>477,65259=>686,65260=>405,65261=>470,65262=>466,65263=>731,65264=>793,65265=>731,65266=>803, - 65267=>276,65268=>243,65269=>551,65270=>603,65271=>551,65272=>603,65273=>551,65274=>603,65275=>551,65276=>603,65281=>1000,65282=>1000,65283=>1000,65284=>1000,65285=>1000,65286=>1000, - 65287=>1000,65288=>1000,65289=>1000,65290=>1000,65291=>1000,65292=>1000,65293=>1000,65294=>1000,65295=>1000,65296=>1000,65297=>1000,65298=>1000,65299=>1000,65300=>1000,65301=>1000,65302=>1000, - 65303=>1000,65304=>1000,65305=>1000,65306=>1000,65307=>1000,65308=>1000,65309=>1000,65310=>1000,65311=>1000,65312=>1000,65313=>1000,65314=>1000,65315=>1000,65316=>1000,65317=>1000,65318=>1000, - 65319=>1000,65320=>1000,65321=>1000,65322=>1000,65323=>1000,65324=>1000,65325=>1000,65326=>1000,65327=>1000,65328=>1000,65329=>1000,65330=>1000,65331=>1000,65332=>1000,65333=>1000,65334=>1000, - 65335=>1000,65336=>1000,65337=>1000,65338=>1000,65339=>1000,65340=>1000,65341=>1000,65342=>1000,65343=>1000,65344=>1000,65345=>1000,65346=>1000,65347=>1000,65348=>1000,65349=>1000,65350=>1000, - 65351=>1000,65352=>1000,65353=>1000,65354=>1000,65355=>1000,65356=>1000,65357=>1000,65358=>1000,65359=>1000,65360=>1000,65361=>1000,65362=>1000,65363=>1000,65364=>1000,65365=>1000,65366=>1000, - 65367=>1000,65368=>1000,65369=>1000,65370=>1000,65371=>1000,65372=>1000,65373=>1000,65374=>1000,65377=>500,65378=>500,65379=>500,65380=>500,65381=>500,65382=>500,65383=>500,65384=>500, - 65385=>500,65386=>500,65387=>500,65388=>500,65389=>500,65390=>500,65391=>500,65392=>500,65393=>500,65394=>500,65395=>500,65396=>500,65397=>500,65398=>500,65399=>500,65400=>500, - 65401=>500,65402=>500,65403=>500,65404=>500,65405=>500,65406=>500,65407=>500,65408=>500,65409=>500,65410=>500,65411=>500,65412=>500,65413=>500,65414=>500,65415=>500,65416=>500, - 65417=>500,65418=>500,65419=>500,65420=>500,65421=>500,65422=>500,65423=>500,65424=>500,65425=>500,65426=>500,65427=>500,65428=>500,65429=>500,65430=>500,65431=>500,65432=>500, - 65433=>500,65434=>500,65435=>500,65436=>500,65437=>500,65438=>500,65439=>500,65440=>500,65441=>500,65442=>500,65443=>500,65444=>500,65445=>500,65446=>500,65447=>500,65448=>500, - 65449=>500,65450=>500,65451=>500,65452=>500,65453=>500,65454=>500,65455=>500,65456=>500,65457=>500,65458=>500,65459=>500,65460=>500,65461=>500,65462=>500,65463=>500,65464=>500, - 65465=>500,65466=>500,65467=>500,65468=>500,65469=>500,65470=>500,65474=>500,65475=>500,65476=>500,65477=>500,65478=>500,65479=>500,65482=>500,65483=>500,65484=>500,65485=>500, - 65486=>500,65487=>500,65490=>500,65491=>500,65492=>500,65493=>500,65494=>500,65495=>500,65498=>500,65499=>500,65500=>500,65504=>1000,65505=>1000,65506=>1000,65507=>1000,65508=>1000, - 65509=>1000,65510=>1000,65512=>500,65513=>500,65514=>500,65515=>500,65516=>500,65517=>500,65518=>500,65532=>1000,65533=>1000,19968=>1000,19969=>1000,19970=>1000,19971=>1000,19972=>1000, - 19973=>1000,19974=>1000,19975=>1000,19976=>1000,19977=>1000,19978=>1000,19979=>1000,19980=>1000,19981=>1000,19982=>1000,19983=>1000,19984=>1000,19985=>1000,19986=>1000,19987=>1000,19988=>1000, - 19989=>1000,19990=>1000,19991=>1000,19992=>1000,19993=>1000,19994=>1000,19995=>1000,19996=>1000,19997=>1000,19998=>1000,19999=>1000,20000=>1000,20001=>1000,20002=>1000,20003=>1000,20004=>1000, - 20005=>1000,20006=>1000,20007=>1000,20008=>1000,20009=>1000,20010=>1000,20011=>1000,20012=>1000,20013=>1000,20014=>1000,20015=>1000,20016=>1000,20017=>1000,20018=>1000,20019=>1000,20020=>1000, - 20021=>1000,20022=>1000,20023=>1000,20024=>1000,20025=>1000,20026=>1000,20027=>1000,20028=>1000,20029=>1000,20030=>1000,20031=>1000,20032=>1000,20033=>1000,20034=>1000,20035=>1000,20036=>1000, - 20037=>1000,20038=>1000,20039=>1000,20040=>1000,20041=>1000,20042=>1000,20043=>1000,20044=>1000,20045=>1000,20046=>1000,20047=>1000,20048=>1000,20049=>1000,20050=>1000,20051=>1000,20052=>1000, - 20053=>1000,20054=>1000,20055=>1000,20056=>1000,20057=>1000,20058=>1000,20059=>1000,20060=>1000,20061=>1000,20062=>1000,20063=>1000,20064=>1000,20065=>1000,20066=>1000,20067=>1000,20068=>1000, - 20069=>1000,20070=>1000,20071=>1000,20072=>1000,20073=>1000,20074=>1000,20075=>1000,20076=>1000,20077=>1000,20078=>1000,20079=>1000,20080=>1000,20081=>1000,20082=>1000,20083=>1000,20084=>1000, - 20085=>1000,20086=>1000,20087=>1000,20088=>1000,20089=>1000,20090=>1000,20091=>1000,20092=>1000,20093=>1000,20094=>1000,20095=>1000,20096=>1000,20097=>1000,20098=>1000,20099=>1000,20100=>1000, - 20101=>1000,20102=>1000,20103=>1000,20104=>1000,20105=>1000,20106=>1000,20107=>1000,20108=>1000,20109=>1000,20110=>1000,20111=>1000,20112=>1000,20113=>1000,20114=>1000,20115=>1000,20116=>1000, - 20117=>1000,20118=>1000,20119=>1000,20120=>1000,20121=>1000,20122=>1000,20123=>1000,20124=>1000,20125=>1000,20126=>1000,20127=>1000,20128=>1000,20129=>1000,20130=>1000,20131=>1000,20132=>1000, - 20133=>1000,20134=>1000,20135=>1000,20136=>1000,20137=>1000,20138=>1000,20139=>1000,20140=>1000,20141=>1000,20142=>1000,20143=>1000,20144=>1000,20145=>1000,20146=>1000,20147=>1000,20148=>1000, - 20149=>1000,20150=>1000,20151=>1000,20152=>1000,20153=>1000,20154=>1000,20155=>1000,20156=>1000,20157=>1000,20158=>1000,20159=>1000,20160=>1000,20161=>1000,20162=>1000,20163=>1000,20164=>1000, - 20165=>1000,20166=>1000,20167=>1000,20168=>1000,20169=>1000,20170=>1000,20171=>1000,20172=>1000,20173=>1000,20174=>1000,20175=>1000,20176=>1000,20177=>1000,20178=>1000,20179=>1000,20180=>1000, - 20181=>1000,20182=>1000,20183=>1000,20184=>1000,20185=>1000,20186=>1000,20187=>1000,20188=>1000,20189=>1000,20190=>1000,20191=>1000,20192=>1000,20193=>1000,20194=>1000,20195=>1000,20196=>1000, - 20197=>1000,20198=>1000,20199=>1000,20200=>1000,20201=>1000,20202=>1000,20203=>1000,20204=>1000,20205=>1000,20206=>1000,20207=>1000,20208=>1000,20209=>1000,20210=>1000,20211=>1000,20212=>1000, - 20213=>1000,20214=>1000,20215=>1000,20216=>1000,20217=>1000,20218=>1000,20219=>1000,20220=>1000,20221=>1000,20222=>1000,20223=>1000,20224=>1000,20225=>1000,20226=>1000,20227=>1000,20228=>1000, - 20229=>1000,20230=>1000,20231=>1000,20232=>1000,20233=>1000,20234=>1000,20235=>1000,20236=>1000,20237=>1000,20238=>1000,20239=>1000,20240=>1000,20241=>1000,20242=>1000,20243=>1000,20244=>1000, - 20245=>1000,20246=>1000,20247=>1000,20248=>1000,20249=>1000,20250=>1000,20251=>1000,20252=>1000,20253=>1000,20254=>1000,20255=>1000,20256=>1000,20257=>1000,20258=>1000,20259=>1000,20260=>1000, - 20261=>1000,20262=>1000,20263=>1000,20264=>1000,20265=>1000,20266=>1000,20267=>1000,20268=>1000,20269=>1000,20270=>1000,20271=>1000,20272=>1000,20273=>1000,20274=>1000,20275=>1000,20276=>1000, - 20277=>1000,20278=>1000,20279=>1000,20280=>1000,20281=>1000,20282=>1000,20283=>1000,20284=>1000,20285=>1000,20286=>1000,20287=>1000,20288=>1000,20289=>1000,20290=>1000,20291=>1000,20292=>1000, - 20293=>1000,20294=>1000,20295=>1000,20296=>1000,20297=>1000,20298=>1000,20299=>1000,20300=>1000,20301=>1000,20302=>1000,20303=>1000,20304=>1000,20305=>1000,20306=>1000,20307=>1000,20308=>1000, - 20309=>1000,20310=>1000,20311=>1000,20312=>1000,20313=>1000,20314=>1000,20315=>1000,20316=>1000,20317=>1000,20318=>1000,20319=>1000,20320=>1000,20321=>1000,20322=>1000,20323=>1000,20324=>1000, - 20325=>1000,20326=>1000,20327=>1000,20328=>1000,20329=>1000,20330=>1000,20331=>1000,20332=>1000,20333=>1000,20334=>1000,20335=>1000,20336=>1000,20337=>1000,20338=>1000,20339=>1000,20340=>1000, - 20341=>1000,20342=>1000,20343=>1000,20344=>1000,20345=>1000,20346=>1000,20347=>1000,20348=>1000,20349=>1000,20350=>1000,20351=>1000,20352=>1000,20353=>1000,20354=>1000,20355=>1000,20356=>1000, - 20357=>1000,20358=>1000,20359=>1000,20360=>1000,20361=>1000,20362=>1000,20363=>1000,20364=>1000,20365=>1000,20366=>1000,20367=>1000,20368=>1000,20369=>1000,20370=>1000,20371=>1000,20372=>1000, - 20373=>1000,20374=>1000,20375=>1000,20376=>1000,20377=>1000,20378=>1000,20379=>1000,20380=>1000,20381=>1000,20382=>1000,20383=>1000,20384=>1000,20385=>1000,20386=>1000,20387=>1000,20388=>1000, - 20389=>1000,20390=>1000,20391=>1000,20392=>1000,20393=>1000,20394=>1000,20395=>1000,20396=>1000,20397=>1000,20398=>1000,20399=>1000,20400=>1000,20401=>1000,20402=>1000,20403=>1000,20404=>1000, - 20405=>1000,20406=>1000,20407=>1000,20408=>1000,20409=>1000,20410=>1000,20411=>1000,20412=>1000,20413=>1000,20414=>1000,20415=>1000,20416=>1000,20417=>1000,20418=>1000,20419=>1000,20420=>1000, - 20421=>1000,20422=>1000,20423=>1000,20424=>1000,20425=>1000,20426=>1000,20427=>1000,20428=>1000,20429=>1000,20430=>1000,20431=>1000,20432=>1000,20433=>1000,20434=>1000,20435=>1000,20436=>1000, - 20437=>1000,20438=>1000,20439=>1000,20440=>1000,20441=>1000,20442=>1000,20443=>1000,20444=>1000,20445=>1000,20446=>1000,20447=>1000,20448=>1000,20449=>1000,20450=>1000,20451=>1000,20452=>1000, - 20453=>1000,20454=>1000,20455=>1000,20456=>1000,20457=>1000,20458=>1000,20459=>1000,20460=>1000,20461=>1000,20462=>1000,20463=>1000,20464=>1000,20465=>1000,20466=>1000,20467=>1000,20468=>1000, - 20469=>1000,20470=>1000,20471=>1000,20472=>1000,20473=>1000,20474=>1000,20475=>1000,20476=>1000,20477=>1000,20478=>1000,20479=>1000,20480=>1000,20481=>1000,20482=>1000,20483=>1000,20484=>1000, - 20485=>1000,20486=>1000,20487=>1000,20488=>1000,20489=>1000,20490=>1000,20491=>1000,20492=>1000,20493=>1000,20494=>1000,20495=>1000,20496=>1000,20497=>1000,20498=>1000,20499=>1000,20500=>1000, - 20501=>1000,20502=>1000,20503=>1000,20504=>1000,20505=>1000,20506=>1000,20507=>1000,20508=>1000,20509=>1000,20510=>1000,20511=>1000,20512=>1000,20513=>1000,20514=>1000,20515=>1000,20516=>1000, - 20517=>1000,20518=>1000,20519=>1000,20520=>1000,20521=>1000,20522=>1000,20523=>1000,20524=>1000,20525=>1000,20526=>1000,20527=>1000,20528=>1000,20529=>1000,20530=>1000,20531=>1000,20532=>1000, - 20533=>1000,20534=>1000,20535=>1000,20536=>1000,20537=>1000,20538=>1000,20539=>1000,20540=>1000,20541=>1000,20542=>1000,20543=>1000,20544=>1000,20545=>1000,20546=>1000,20547=>1000,20548=>1000, - 20549=>1000,20550=>1000,20551=>1000,20552=>1000,20553=>1000,20554=>1000,20555=>1000,20556=>1000,20557=>1000,20558=>1000,20559=>1000,20560=>1000,20561=>1000,20562=>1000,20563=>1000,20564=>1000, - 20565=>1000,20566=>1000,20567=>1000,20568=>1000,20569=>1000,20570=>1000,20571=>1000,20572=>1000,20573=>1000,20574=>1000,20575=>1000,20576=>1000,20577=>1000,20578=>1000,20579=>1000,20580=>1000, - 20581=>1000,20582=>1000,20583=>1000,20584=>1000,20585=>1000,20586=>1000,20587=>1000,20588=>1000,20589=>1000,20590=>1000,20591=>1000,20592=>1000,20593=>1000,20594=>1000,20595=>1000,20596=>1000, - 20597=>1000,20598=>1000,20599=>1000,20600=>1000,20601=>1000,20602=>1000,20603=>1000,20604=>1000,20605=>1000,20606=>1000,20607=>1000,20608=>1000,20609=>1000,20610=>1000,20611=>1000,20612=>1000, - 20613=>1000,20614=>1000,20615=>1000,20616=>1000,20617=>1000,20618=>1000,20619=>1000,20620=>1000,20621=>1000,20622=>1000,20623=>1000,20624=>1000,20625=>1000,20626=>1000,20627=>1000,20628=>1000, - 20629=>1000,20630=>1000,20631=>1000,20632=>1000,20633=>1000,20634=>1000,20635=>1000,20636=>1000,20637=>1000,20638=>1000,20639=>1000,20640=>1000,20641=>1000,20642=>1000,20643=>1000,20644=>1000, - 20645=>1000,20646=>1000,20647=>1000,20648=>1000,20649=>1000,20650=>1000,20651=>1000,20652=>1000,20653=>1000,20654=>1000,20655=>1000,20656=>1000,20657=>1000,20658=>1000,20659=>1000,20660=>1000, - 20661=>1000,20662=>1000,20663=>1000,20664=>1000,20665=>1000,20666=>1000,20667=>1000,20668=>1000,20669=>1000,20670=>1000,20671=>1000,20672=>1000,20673=>1000,20674=>1000,20675=>1000,20676=>1000, - 20677=>1000,20678=>1000,20679=>1000,20680=>1000,20681=>1000,20682=>1000,20683=>1000,20684=>1000,20685=>1000,20686=>1000,20687=>1000,20688=>1000,20689=>1000,20690=>1000,20691=>1000,20692=>1000, - 20693=>1000,20694=>1000,20695=>1000,20696=>1000,20697=>1000,20698=>1000,20699=>1000,20700=>1000,20701=>1000,20702=>1000,20703=>1000,20704=>1000,20705=>1000,20706=>1000,20707=>1000,20708=>1000, - 20709=>1000,20710=>1000,20711=>1000,20712=>1000,20713=>1000,20714=>1000,20715=>1000,20716=>1000,20717=>1000,20718=>1000,20719=>1000,20720=>1000,20721=>1000,20722=>1000,20723=>1000,20724=>1000, - 20725=>1000,20726=>1000,20727=>1000,20728=>1000,20729=>1000,20730=>1000,20731=>1000,20732=>1000,20733=>1000,20734=>1000,20735=>1000,20736=>1000,20737=>1000,20738=>1000,20739=>1000,20740=>1000, - 20741=>1000,20742=>1000,20743=>1000,20744=>1000,20745=>1000,20746=>1000,20747=>1000,20748=>1000,20749=>1000,20750=>1000,20751=>1000,20752=>1000,20753=>1000,20754=>1000,20755=>1000,20756=>1000, - 20757=>1000,20758=>1000,20759=>1000,20760=>1000,20761=>1000,20762=>1000,20763=>1000,20764=>1000,20765=>1000,20766=>1000,20767=>1000,20768=>1000,20769=>1000,20770=>1000,20771=>1000,20772=>1000, - 20773=>1000,20774=>1000,20775=>1000,20776=>1000,20777=>1000,20778=>1000,20779=>1000,20780=>1000,20781=>1000,20782=>1000,20783=>1000,20784=>1000,20785=>1000,20786=>1000,20787=>1000,20788=>1000, - 20789=>1000,20790=>1000,20791=>1000,20792=>1000,20793=>1000,20794=>1000,20795=>1000,20796=>1000,20797=>1000,20798=>1000,20799=>1000,20800=>1000,20801=>1000,20802=>1000,20803=>1000,20804=>1000, - 20805=>1000,20806=>1000,20807=>1000,20808=>1000,20809=>1000,20810=>1000,20811=>1000,20812=>1000,20813=>1000,20814=>1000,20815=>1000,20816=>1000,20817=>1000,20818=>1000,20819=>1000,20820=>1000, - 20821=>1000,20822=>1000,20823=>1000,20824=>1000,20825=>1000,20826=>1000,20827=>1000,20828=>1000,20829=>1000,20830=>1000,20831=>1000,20832=>1000,20833=>1000,20834=>1000,20835=>1000,20836=>1000, - 20837=>1000,20838=>1000,20839=>1000,20840=>1000,20841=>1000,20842=>1000,20843=>1000,20844=>1000,20845=>1000,20846=>1000,20847=>1000,20848=>1000,20849=>1000,20850=>1000,20851=>1000,20852=>1000, - 20853=>1000,20854=>1000,20855=>1000,20856=>1000,20857=>1000,20858=>1000,20859=>1000,20860=>1000,20861=>1000,20862=>1000,20863=>1000,20864=>1000,20865=>1000,20866=>1000,20867=>1000,20868=>1000, - 20869=>1000,20870=>1000,20871=>1000,20872=>1000,20873=>1000,20874=>1000,20875=>1000,20876=>1000,20877=>1000,20878=>1000,20879=>1000,20880=>1000,20881=>1000,20882=>1000,20883=>1000,20884=>1000, - 20885=>1000,20886=>1000,20887=>1000,20888=>1000,20889=>1000,20890=>1000,20891=>1000,20892=>1000,20893=>1000,20894=>1000,20895=>1000,20896=>1000,20897=>1000,20898=>1000,20899=>1000,20900=>1000, - 20901=>1000,20902=>1000,20903=>1000,20904=>1000,20905=>1000,20906=>1000,20907=>1000,20908=>1000,20909=>1000,20910=>1000,20911=>1000,20912=>1000,20913=>1000,20914=>1000,20915=>1000,20916=>1000, - 20917=>1000,20918=>1000,20919=>1000,20920=>1000,20921=>1000,20922=>1000,20923=>1000,20924=>1000,20925=>1000,20926=>1000,20927=>1000,20928=>1000,20929=>1000,20930=>1000,20931=>1000,20932=>1000, - 20933=>1000,20934=>1000,20935=>1000,20936=>1000,20937=>1000,20938=>1000,20939=>1000,20940=>1000,20941=>1000,20942=>1000,20943=>1000,20944=>1000,20945=>1000,20946=>1000,20947=>1000,20948=>1000, - 20949=>1000,20950=>1000,20951=>1000,20952=>1000,20953=>1000,20954=>1000,20955=>1000,20956=>1000,20957=>1000,20958=>1000,20959=>1000,20960=>1000,20961=>1000,20962=>1000,20963=>1000,20964=>1000, - 20965=>1000,20966=>1000,20967=>1000,20968=>1000,20969=>1000,20970=>1000,20971=>1000,20972=>1000,20973=>1000,20974=>1000,20975=>1000,20976=>1000,20977=>1000,20978=>1000,20979=>1000,20980=>1000, - 20981=>1000,20982=>1000,20983=>1000,20984=>1000,20985=>1000,20986=>1000,20987=>1000,20988=>1000,20989=>1000,20990=>1000,20991=>1000,20992=>1000,20993=>1000,20994=>1000,20995=>1000,20996=>1000, - 20997=>1000,20998=>1000,20999=>1000,21000=>1000,21001=>1000,21002=>1000,21003=>1000,21004=>1000,21005=>1000,21006=>1000,21007=>1000,21008=>1000,21009=>1000,21010=>1000,21011=>1000,21012=>1000, - 21013=>1000,21014=>1000,21015=>1000,21016=>1000,21017=>1000,21018=>1000,21019=>1000,21020=>1000,21021=>1000,21022=>1000,21023=>1000,21024=>1000,21025=>1000,21026=>1000,21027=>1000,21028=>1000, - 21029=>1000,21030=>1000,21031=>1000,21032=>1000,21033=>1000,21034=>1000,21035=>1000,21036=>1000,21037=>1000,21038=>1000,21039=>1000,21040=>1000,21041=>1000,21042=>1000,21043=>1000,21044=>1000, - 21045=>1000,21046=>1000,21047=>1000,21048=>1000,21049=>1000,21050=>1000,21051=>1000,21052=>1000,21053=>1000,21054=>1000,21055=>1000,21056=>1000,21057=>1000,21058=>1000,21059=>1000,21060=>1000, - 21061=>1000,21062=>1000,21063=>1000,21064=>1000,21065=>1000,21066=>1000,21067=>1000,21068=>1000,21069=>1000,21070=>1000,21071=>1000,21072=>1000,21073=>1000,21074=>1000,21075=>1000,21076=>1000, - 21077=>1000,21078=>1000,21079=>1000,21080=>1000,21081=>1000,21082=>1000,21083=>1000,21084=>1000,21085=>1000,21086=>1000,21087=>1000,21088=>1000,21089=>1000,21090=>1000,21091=>1000,21092=>1000, - 21093=>1000,21094=>1000,21095=>1000,21096=>1000,21097=>1000,21098=>1000,21099=>1000,21100=>1000,21101=>1000,21102=>1000,21103=>1000,21104=>1000,21105=>1000,21106=>1000,21107=>1000,21108=>1000, - 21109=>1000,21110=>1000,21111=>1000,21112=>1000,21113=>1000,21114=>1000,21115=>1000,21116=>1000,21117=>1000,21118=>1000,21119=>1000,21120=>1000,21121=>1000,21122=>1000,21123=>1000,21124=>1000, - 21125=>1000,21126=>1000,21127=>1000,21128=>1000,21129=>1000,21130=>1000,21131=>1000,21132=>1000,21133=>1000,21134=>1000,21135=>1000,21136=>1000,21137=>1000,21138=>1000,21139=>1000,21140=>1000, - 21141=>1000,21142=>1000,21143=>1000,21144=>1000,21145=>1000,21146=>1000,21147=>1000,21148=>1000,21149=>1000,21150=>1000,21151=>1000,21152=>1000,21153=>1000,21154=>1000,21155=>1000,21156=>1000, - 21157=>1000,21158=>1000,21159=>1000,21160=>1000,21161=>1000,21162=>1000,21163=>1000,21164=>1000,21165=>1000,21166=>1000,21167=>1000,21168=>1000,21169=>1000,21170=>1000,21171=>1000,21172=>1000, - 21173=>1000,21174=>1000,21175=>1000,21176=>1000,21177=>1000,21178=>1000,21179=>1000,21180=>1000,21181=>1000,21182=>1000,21183=>1000,21184=>1000,21185=>1000,21186=>1000,21187=>1000,21188=>1000, - 21189=>1000,21190=>1000,21191=>1000,21192=>1000,21193=>1000,21194=>1000,21195=>1000,21196=>1000,21197=>1000,21198=>1000,21199=>1000,21200=>1000,21201=>1000,21202=>1000,21203=>1000,21204=>1000, - 21205=>1000,21206=>1000,21207=>1000,21208=>1000,21209=>1000,21210=>1000,21211=>1000,21212=>1000,21213=>1000,21214=>1000,21215=>1000,21216=>1000,21217=>1000,21218=>1000,21219=>1000,21220=>1000, - 21221=>1000,21222=>1000,21223=>1000,21224=>1000,21225=>1000,21226=>1000,21227=>1000,21228=>1000,21229=>1000,21230=>1000,21231=>1000,21232=>1000,21233=>1000,21234=>1000,21235=>1000,21236=>1000, - 21237=>1000,21238=>1000,21239=>1000,21240=>1000,21241=>1000,21242=>1000,21243=>1000,21244=>1000,21245=>1000,21246=>1000,21247=>1000,21248=>1000,21249=>1000,21250=>1000,21251=>1000,21252=>1000, - 21253=>1000,21254=>1000,21255=>1000,21256=>1000,21257=>1000,21258=>1000,21259=>1000,21260=>1000,21261=>1000,21262=>1000,21263=>1000,21264=>1000,21265=>1000,21266=>1000,21267=>1000,21268=>1000, - 21269=>1000,21270=>1000,21271=>1000,21272=>1000,21273=>1000,21274=>1000,21275=>1000,21276=>1000,21277=>1000,21278=>1000,21279=>1000,21280=>1000,21281=>1000,21282=>1000,21283=>1000,21284=>1000, - 21285=>1000,21286=>1000,21287=>1000,21288=>1000,21289=>1000,21290=>1000,21291=>1000,21292=>1000,21293=>994,21294=>1000,21295=>1000,21296=>1000,21297=>1000,21298=>1000,21299=>1000,21300=>1000, - 21301=>1000,21302=>1000,21303=>1000,21304=>1000,21305=>1000,21306=>1000,21307=>1000,21308=>1000,21309=>1000,21310=>1000,21311=>1000,21312=>1000,21313=>1000,21314=>1000,21315=>1000,21316=>1000, - 21317=>1000,21318=>1000,21319=>1000,21320=>1000,21321=>1000,21322=>1000,21323=>1000,21324=>1000,21325=>1000,21326=>1000,21327=>1000,21328=>1000,21329=>1000,21330=>1000,21331=>1000,21332=>1000, - 21333=>1000,21334=>1000,21335=>1000,21336=>1000,21337=>1000,21338=>1000,21339=>1000,21340=>1000,21341=>1000,21342=>1000,21343=>1000,21344=>1000,21345=>1000,21346=>1000,21347=>1000,21348=>1000, - 21349=>1000,21350=>1000,21351=>1000,21352=>1000,21353=>1000,21354=>1000,21355=>1000,21356=>1000,21357=>1000,21358=>1000,21359=>1000,21360=>1000,21361=>1000,21362=>1000,21363=>1000,21364=>1000, - 21365=>1000,21366=>1000,21367=>1000,21368=>1000,21369=>1000,21370=>1000,21371=>1000,21372=>1000,21373=>1000,21374=>1000,21375=>1000,21376=>1000,21377=>1000,21378=>1000,21379=>1000,21380=>1000, - 21381=>1000,21382=>1000,21383=>1000,21384=>1000,21385=>1000,21386=>1000,21387=>1000,21388=>1000,21389=>1000,21390=>1000,21391=>1000,21392=>1000,21393=>1000,21394=>1000,21395=>1000,21396=>1000, - 21397=>1000,21398=>1000,21399=>1000,21400=>1000,21401=>1000,21402=>1000,21403=>1000,21404=>1000,21405=>1000,21406=>1000,21407=>1000,21408=>1000,21409=>1000,21410=>1000,21411=>1000,21412=>1000, - 21413=>1000,21414=>1000,21415=>1000,21416=>1000,21417=>1000,21418=>1000,21419=>1000,21420=>1000,21421=>1000,21422=>1000,21423=>1000,21424=>1000,21425=>1000,21426=>1000,21427=>1000,21428=>1000, - 21429=>1000,21430=>1000,21431=>1000,21432=>1000,21433=>1000,21434=>1000,21435=>1000,21436=>1000,21437=>1000,21438=>1000,21439=>1000,21440=>1000,21441=>1000,21442=>1000,21443=>1000,21444=>1000, - 21445=>1000,21446=>1000,21447=>1000,21448=>1000,21449=>1000,21450=>1000,21451=>1000,21452=>1000,21453=>1000,21454=>1000,21455=>1000,21456=>1000,21457=>1000,21458=>1000,21459=>1000,21460=>1000, - 21461=>1000,21462=>1000,21463=>1000,21464=>1000,21465=>1000,21466=>1000,21467=>1000,21468=>1000,21469=>1000,21470=>1000,21471=>1000,21472=>1000,21473=>1000,21474=>1000,21475=>1000,21476=>1000, - 21477=>1000,21478=>1000,21479=>1000,21480=>1000,21481=>1000,21482=>1000,21483=>1000,21484=>1000,21485=>1000,21486=>1000,21487=>1000,21488=>1000,21489=>1000,21490=>1000,21491=>1000,21492=>1000, - 21493=>1000,21494=>1000,21495=>1000,21496=>1000,21497=>1000,21498=>1000,21499=>1000,21500=>1000,21501=>1000,21502=>1000,21503=>1000,21504=>1000,21505=>1000,21506=>1000,21507=>1000,21508=>1000, - 21509=>1000,21510=>1000,21511=>1000,21512=>1000,21513=>1000,21514=>1000,21515=>1000,21516=>1000,21517=>1000,21518=>1000,21519=>1000,21520=>1000,21521=>1000,21522=>1000,21523=>1000,21524=>1000, - 21525=>1000,21526=>1000,21527=>1000,21528=>1000,21529=>1000,21530=>1000,21531=>1000,21532=>1000,21533=>1000,21534=>1000,21535=>1000,21536=>1000,21537=>1000,21538=>1000,21539=>1000,21540=>1000, - 21541=>1000,21542=>1000,21543=>1000,21544=>1000,21545=>1000,21546=>1000,21547=>1000,21548=>1000,21549=>1000,21550=>1000,21551=>1000,21552=>1000,21553=>1000,21554=>1000,21555=>1000,21556=>1000, - 21557=>1000,21558=>1000,21559=>1000,21560=>1000,21561=>1000,21562=>1000,21563=>1000,21564=>1000,21565=>1000,21566=>1000,21567=>1000,21568=>1000,21569=>1000,21570=>1000,21571=>1000,21572=>1000, - 21573=>1000,21574=>1000,21575=>1000,21576=>1000,21577=>1000,21578=>1000,21579=>1000,21580=>1000,21581=>1000,21582=>1000,21583=>1000,21584=>1000,21585=>1000,21586=>1000,21587=>1000,21588=>1000, - 21589=>1000,21590=>1000,21591=>1000,21592=>1000,21593=>1000,21594=>1000,21595=>1000,21596=>1000,21597=>1000,21598=>1000,21599=>1000,21600=>1000,21601=>1000,21602=>1000,21603=>1000,21604=>1000, - 21605=>1000,21606=>1000,21607=>1000,21608=>1000,21609=>1000,21610=>1000,21611=>1000,21612=>1000,21613=>1000,21614=>1000,21615=>1000,21616=>1000,21617=>1000,21618=>1000,21619=>1000,21620=>1000, - 21621=>1000,21622=>1000,21623=>1000,21624=>1000,21625=>1000,21626=>1000,21627=>1000,21628=>1000,21629=>1000,21630=>1000,21631=>1000,21632=>1000,21633=>1000,21634=>1000,21635=>1000,21636=>1000, - 21637=>1000,21638=>1000,21639=>1000,21640=>1000,21641=>1000,21642=>1000,21643=>1000,21644=>1000,21645=>1000,21646=>1000,21647=>1000,21648=>1000,21649=>1000,21650=>1000,21651=>1000,21652=>1000, - 21653=>1000,21654=>1000,21655=>1000,21656=>1000,21657=>1000,21658=>1000,21659=>1000,21660=>1000,21661=>1000,21662=>1000,21663=>1000,21664=>1000,21665=>1000,21666=>1000,21667=>1000,21668=>1000, - 21669=>1000,21670=>1000,21671=>1000,21672=>1000,21673=>1000,21674=>1000,21675=>1000,21676=>1000,21677=>1000,21678=>1000,21679=>1000,21680=>1000,21681=>1000,21682=>1000,21683=>1000,21684=>1000, - 21685=>1000,21686=>1000,21687=>1000,21688=>1000,21689=>1000,21690=>1000,21691=>1000,21692=>1000,21693=>1000,21694=>1000,21695=>1000,21696=>1000,21697=>1000,21698=>1000,21699=>1000,21700=>1000, - 21701=>1000,21702=>1000,21703=>1000,21704=>1000,21705=>1000,21706=>1000,21707=>1000,21708=>1000,21709=>1000,21710=>1000,21711=>1000,21712=>1000,21713=>1000,21714=>1000,21715=>1000,21716=>1000, - 21717=>1000,21718=>1000,21719=>1000,21720=>1000,21721=>1000,21722=>1000,21723=>1000,21724=>1000,21725=>1000,21726=>1000,21727=>1000,21728=>1000,21729=>1000,21730=>1000,21731=>1000,21732=>1000, - 21733=>1000,21734=>1000,21735=>1000,21736=>1000,21737=>1000,21738=>1000,21739=>1000,21740=>1000,21741=>1000,21742=>1000,21743=>1000,21744=>1000,21745=>1000,21746=>1000,21747=>1000,21748=>1000, - 21749=>1000,21750=>1000,21751=>1000,21752=>1000,21753=>1000,21754=>1000,21755=>1000,21756=>1000,21757=>1000,21758=>1000,21759=>1000,21760=>1000,21761=>1000,21762=>1000,21763=>1000,21764=>1000, - 21765=>1000,21766=>1000,21767=>1000,21768=>1000,21769=>1000,21770=>1000,21771=>1000,21772=>1000,21773=>1000,21774=>1000,21775=>1000,21776=>1000,21777=>1000,21778=>1000,21779=>1000,21780=>1000, - 21781=>1000,21782=>1000,21783=>1000,21784=>1000,21785=>1000,21786=>1000,21787=>1000,21788=>1000,21789=>1000,21790=>1000,21791=>1000,21792=>1000,21793=>1000,21794=>1000,21795=>1000,21796=>1000, - 21797=>1000,21798=>1000,21799=>1000,21800=>1000,21801=>1000,21802=>1000,21803=>1000,21804=>1000,21805=>1000,21806=>1000,21807=>1000,21808=>1000,21809=>1000,21810=>1000,21811=>1000,21812=>1000, - 21813=>1000,21814=>1000,21815=>1000,21816=>1000,21817=>1000,21818=>1000,21819=>1000,21820=>1000,21821=>1000,21822=>1000,21823=>1000,21824=>1000,21825=>1000,21826=>1000,21827=>1000,21828=>1000, - 21829=>1000,21830=>1000,21831=>1000,21832=>1000,21833=>1000,21834=>1000,21835=>1000,21836=>1000,21837=>1000,21838=>1000,21839=>1000,21840=>1000,21841=>1000,21842=>1000,21843=>1000,21844=>1000, - 21845=>1000,21846=>1000,21847=>1000,21848=>1000,21849=>1000,21850=>1000,21851=>1000,21852=>1000,21853=>1000,21854=>1000,21855=>1000,21856=>1000,21857=>1000,21858=>1000,21859=>1000,21860=>1000, - 21861=>1000,21862=>1000,21863=>1000,21864=>1000,21865=>1000,21866=>1000,21867=>1000,21868=>1000,21869=>1000,21870=>1000,21871=>1000,21872=>1000,21873=>1000,21874=>1000,21875=>1000,21876=>1000, - 21877=>1000,21878=>1000,21879=>1000,21880=>1000,21881=>1000,21882=>1000,21883=>1000,21884=>1000,21885=>1000,21886=>1000,21887=>1000,21888=>1000,21889=>1000,21890=>1000,21891=>1000,21892=>1000, - 21893=>1000,21894=>1000,21895=>1000,21896=>1000,21897=>1000,21898=>1000,21899=>1000,21900=>1000,21901=>1000,21902=>1000,21903=>1000,21904=>1000,21905=>1000,21906=>1000,21907=>1000,21908=>1000, - 21909=>1000,21910=>1000,21911=>1000,21912=>1000,21913=>1000,21914=>1000,21915=>1000,21916=>1000,21917=>1000,21918=>1000,21919=>1000,21920=>1000,21921=>1000,21922=>1000,21923=>1000,21924=>1000, - 21925=>1000,21926=>1000,21927=>1000,21928=>1000,21929=>1000,21930=>1000,21931=>1000,21932=>1000,21933=>1000,21934=>1000,21935=>1000,21936=>1000,21937=>1000,21938=>1000,21939=>1000,21940=>1000, - 21941=>1000,21942=>1000,21943=>1000,21944=>1000,21945=>1000,21946=>1000,21947=>1000,21948=>1000,21949=>1000,21950=>1000,21951=>1000,21952=>1000,21953=>1000,21954=>1000,21955=>1000,21956=>1000, - 21957=>1000,21958=>1000,21959=>1000,21960=>1000,21961=>1000,21962=>1000,21963=>1000,21964=>1000,21965=>1000,21966=>1000,21967=>1000,21968=>1000,21969=>1000,21970=>1000,21971=>1000,21972=>1000, - 21973=>1000,21974=>1000,21975=>1000,21976=>1000,21977=>1000,21978=>1000,21979=>1000,21980=>1000,21981=>1000,21982=>1000,21983=>1000,21984=>1000,21985=>1000,21986=>1000,21987=>1000,21988=>1000, - 21989=>1000,21990=>1000,21991=>1000,21992=>1000,21993=>1000,21994=>1000,21995=>1000,21996=>1000,21997=>1000,21998=>1000,21999=>1000,22000=>1000,22001=>1000,22002=>1000,22003=>1000,22004=>1000, - 22005=>1000,22006=>1000,22007=>1000,22008=>1000,22009=>1000,22010=>1000,22011=>1000,22012=>1000,22013=>1000,22014=>1000,22015=>1000,22016=>1000,22017=>1000,22018=>1000,22019=>1000,22020=>1000, - 22021=>1000,22022=>1000,22023=>1000,22024=>1000,22025=>1000,22026=>1000,22027=>1000,22028=>1000,22029=>1000,22030=>1000,22031=>1000,22032=>1000,22033=>1000,22034=>1000,22035=>1000,22036=>1000, - 22037=>1000,22038=>1000,22039=>1000,22040=>1000,22041=>1000,22042=>1000,22043=>1000,22044=>1000,22045=>1000,22046=>1000,22047=>1000,22048=>1000,22049=>1000,22050=>1000,22051=>1000,22052=>1000, - 22053=>1000,22054=>1000,22055=>1000,22056=>1000,22057=>1000,22058=>1000,22059=>1000,22060=>1000,22061=>1000,22062=>1000,22063=>1000,22064=>1000,22065=>1000,22066=>1000,22067=>1000,22068=>1000, - 22069=>1000,22070=>1000,22071=>1000,22072=>1000,22073=>1000,22074=>1000,22075=>1000,22076=>1000,22077=>1000,22078=>1000,22079=>1000,22080=>1000,22081=>1000,22082=>1000,22083=>1000,22084=>1000, - 22085=>1000,22086=>1000,22087=>1000,22088=>1000,22089=>1000,22090=>1000,22091=>1000,22092=>1000,22093=>1000,22094=>1000,22095=>1000,22096=>1000,22097=>1000,22098=>1000,22099=>1000,22100=>1000, - 22101=>1000,22102=>1000,22103=>1000,22104=>1000,22105=>1000,22106=>1000,22107=>1000,22108=>1000,22109=>1000,22110=>1000,22111=>1000,22112=>1000,22113=>1000,22114=>1000,22115=>1000,22116=>1000, - 22117=>1000,22118=>1000,22119=>1000,22120=>1000,22121=>1000,22122=>1000,22123=>1000,22124=>1000,22125=>1000,22126=>1000,22127=>1000,22128=>1000,22129=>1000,22130=>1000,22131=>1000,22132=>1000, - 22133=>1000,22134=>1000,22135=>1000,22136=>1000,22137=>1000,22138=>1000,22139=>1000,22140=>1000,22141=>1000,22142=>1000,22143=>1000,22144=>1000,22145=>1000,22146=>1000,22147=>1000,22148=>1000, - 22149=>1000,22150=>1000,22151=>1000,22152=>1000,22153=>1000,22154=>1000,22155=>1000,22156=>1000,22157=>1000,22158=>1000,22159=>1000,22160=>1000,22161=>1000,22162=>1000,22163=>1000,22164=>1000, - 22165=>1000,22166=>1000,22167=>1000,22168=>1000,22169=>1000,22170=>1000,22171=>1000,22172=>1000,22173=>1000,22174=>1000,22175=>1000,22176=>1000,22177=>1000,22178=>1000,22179=>1000,22180=>1000, - 22181=>1000,22182=>1000,22183=>1000,22184=>1000,22185=>1000,22186=>1000,22187=>1000,22188=>1000,22189=>1000,22190=>1000,22191=>1000,22192=>1000,22193=>1000,22194=>1000,22195=>1000,22196=>1000, - 22197=>1000,22198=>1000,22199=>1000,22200=>1000,22201=>1000,22202=>1000,22203=>1000,22204=>1000,22205=>1000,22206=>1000,22207=>1000,22208=>1000,22209=>1000,22210=>1000,22211=>1000,22212=>1000, - 22213=>1000,22214=>1000,22215=>1000,22216=>1000,22217=>1000,22218=>1000,22219=>1000,22220=>1000,22221=>1000,22222=>1000,22223=>1000,22224=>1000,22225=>1000,22226=>1000,22227=>1000,22228=>1000, - 22229=>1000,22230=>1000,22231=>1000,22232=>1000,22233=>1000,22234=>1000,22235=>1000,22236=>1000,22237=>1000,22238=>1000,22239=>1000,22240=>1000,22241=>1000,22242=>1000,22243=>1000,22244=>1000, - 22245=>1000,22246=>1000,22247=>1000,22248=>1000,22249=>1000,22250=>1000,22251=>1000,22252=>1000,22253=>1000,22254=>1000,22255=>1000,22256=>1000,22257=>1000,22258=>1000,22259=>1000,22260=>1000, - 22261=>1000,22262=>1000,22263=>1000,22264=>1000,22265=>1000,22266=>1000,22267=>1000,22268=>1000,22269=>1000,22270=>1000,22271=>1000,22272=>1000,22273=>1000,22274=>1000,22275=>1000,22276=>1000, - 22277=>1000,22278=>1000,22279=>1000,22280=>1000,22281=>1000,22282=>1000,22283=>1000,22284=>1000,22285=>1000,22286=>1000,22287=>1000,22288=>1000,22289=>1000,22290=>1000,22291=>1000,22292=>1000, - 22293=>1000,22294=>1000,22295=>1000,22296=>1000,22297=>1000,22298=>1000,22299=>1000,22300=>1000,22301=>1000,22302=>1000,22303=>1000,22304=>1000,22305=>1000,22306=>1000,22307=>1000,22308=>1000, - 22309=>1000,22310=>1000,22311=>1000,22312=>1000,22313=>1000,22314=>1000,22315=>1000,22316=>1000,22317=>1000,22318=>1000,22319=>1000,22320=>1000,22321=>1000,22322=>1000,22323=>1000,22324=>1000, - 22325=>1000,22326=>1000,22327=>1000,22328=>1000,22329=>1000,22330=>1000,22331=>1000,22332=>1000,22333=>1000,22334=>1000,22335=>1000,22336=>1000,22337=>1000,22338=>1000,22339=>1000,22340=>1000, - 22341=>1000,22342=>1000,22343=>1000,22344=>1000,22345=>1000,22346=>1000,22347=>1000,22348=>1000,22349=>1000,22350=>1000,22351=>1000,22352=>1000,22353=>1000,22354=>1000,22355=>1000,22356=>1000, - 22357=>1000,22358=>1000,22359=>1000,22360=>1000,22361=>1000,22362=>1000,22363=>1000,22364=>1000,22365=>1000,22366=>1000,22367=>1000,22368=>1000,22369=>1000,22370=>1000,22371=>1000,22372=>1000, - 22373=>1000,22374=>1000,22375=>1000,22376=>1000,22377=>1000,22378=>1000,22379=>1000,22380=>1000,22381=>1000,22382=>1000,22383=>1000,22384=>1000,22385=>1000,22386=>1000,22387=>1000,22388=>1000, - 22389=>1000,22390=>1000,22391=>1000,22392=>1000,22393=>1000,22394=>1000,22395=>1000,22396=>1000,22397=>1000,22398=>1000,22399=>1000,22400=>1000,22401=>1000,22402=>1000,22403=>1000,22404=>1000, - 22405=>1000,22406=>1000,22407=>1000,22408=>1000,22409=>1000,22410=>1000,22411=>1000,22412=>1000,22413=>1000,22414=>1000,22415=>1000,22416=>1000,22417=>1000,22418=>1000,22419=>1000,22420=>1000, - 22421=>1000,22422=>1000,22423=>1000,22424=>1000,22425=>1000,22426=>1000,22427=>1000,22428=>1000,22429=>1000,22430=>1000,22431=>1000,22432=>1000,22433=>1000,22434=>1000,22435=>1000,22436=>1000, - 22437=>1000,22438=>1000,22439=>1000,22440=>1000,22441=>1000,22442=>1000,22443=>1000,22444=>1000,22445=>1000,22446=>1000,22447=>1000,22448=>1000,22449=>1000,22450=>1000,22451=>1000,22452=>1000, - 22453=>1000,22454=>1000,22455=>1000,22456=>1000,22457=>1000,22458=>1000,22459=>1000,22460=>1000,22461=>1000,22462=>1000,22463=>1000,22464=>1000,22465=>1000,22466=>1000,22467=>1000,22468=>1000, - 22469=>1000,22470=>1000,22471=>1000,22472=>1000,22473=>1000,22474=>1000,22475=>1000,22476=>1000,22477=>1000,22478=>1000,22479=>1000,22480=>1000,22481=>1000,22482=>1000,22483=>1000,22484=>1000, - 22485=>1000,22486=>1000,22487=>1000,22488=>1000,22489=>1000,22490=>1000,22491=>1000,22492=>1000,22493=>1000,22494=>1000,22495=>1000,22496=>1000,22497=>1000,22498=>1000,22499=>1000,22500=>1000, - 22501=>1000,22502=>1000,22503=>1000,22504=>1000,22505=>1000,22506=>1000,22507=>1000,22508=>1000,22509=>1000,22510=>1000,22511=>1000,22512=>1000,22513=>1000,22514=>1000,22515=>1000,22516=>1000, - 22517=>1000,22518=>1000,22519=>1000,22520=>1000,22521=>1000,22522=>1000,22523=>1000,22524=>1000,22525=>1000,22526=>1000,22527=>1000,22528=>1000,22529=>1000,22530=>1000,22531=>1000,22532=>1000, - 22533=>1000,22534=>1000,22535=>1000,22536=>1000,22537=>1000,22538=>1000,22539=>1000,22540=>1000,22541=>1000,22542=>1000,22543=>1000,22544=>1000,22545=>1000,22546=>1000,22547=>1000,22548=>1000, - 22549=>1000,22550=>1000,22551=>1000,22552=>1000,22553=>1000,22554=>1000,22555=>1000,22556=>1000,22557=>1000,22558=>1000,22559=>1000,22560=>1000,22561=>1000,22562=>1000,22563=>1000,22564=>1000, - 22565=>1000,22566=>1000,22567=>1000,22568=>1000,22569=>1000,22570=>1000,22571=>1000,22572=>1000,22573=>1000,22574=>1000,22575=>1000,22576=>1000,22577=>1000,22578=>1000,22579=>1000,22580=>1000, - 22581=>1000,22582=>1000,22583=>1000,22584=>1000,22585=>1000,22586=>1000,22587=>1000,22588=>1000,22589=>1000,22590=>1000,22591=>1000,22592=>1000,22593=>1000,22594=>1000,22595=>1000,22596=>1000, - 22597=>1000,22598=>1000,22599=>1000,22600=>1000,22601=>1000,22602=>1000,22603=>1000,22604=>1000,22605=>1000,22606=>1000,22607=>1000,22608=>1000,22609=>1000,22610=>1000,22611=>1000,22612=>1000, - 22613=>1000,22614=>1000,22615=>1000,22616=>1000,22617=>1000,22618=>1000,22619=>1000,22620=>1000,22621=>1000,22622=>1000,22623=>1000,22624=>1000,22625=>1000,22626=>1000,22627=>1000,22628=>1000, - 22629=>1000,22630=>1000,22631=>1000,22632=>1000,22633=>1000,22634=>1000,22635=>1000,22636=>1000,22637=>1000,22638=>1000,22639=>1000,22640=>1000,22641=>1000,22642=>1000,22643=>1000,22644=>1000, - 22645=>1000,22646=>1000,22647=>1000,22648=>1000,22649=>1000,22650=>1000,22651=>1000,22652=>1000,22653=>1000,22654=>1000,22655=>1000,22656=>1000,22657=>1000,22658=>1000,22659=>1000,22660=>1000, - 22661=>1000,22662=>1000,22663=>1000,22664=>1000,22665=>1000,22666=>1000,22667=>1000,22668=>1000,22669=>1000,22670=>1000,22671=>1000,22672=>1000,22673=>1000,22674=>1000,22675=>1000,22676=>1000, - 22677=>1000,22678=>1000,22679=>1000,22680=>1000,22681=>1000,22682=>1000,22683=>1000,22684=>1000,22685=>1000,22686=>1000,22687=>1000,22688=>1000,22689=>1000,22690=>1000,22691=>1000,22692=>1000, - 22693=>1000,22694=>1000,22695=>1000,22696=>1000,22697=>1000,22698=>1000,22699=>1000,22700=>1000,22701=>1000,22702=>1000,22703=>1000,22704=>1000,22705=>1000,22706=>1000,22707=>1000,22708=>1000, - 22709=>1000,22710=>1000,22711=>1000,22712=>1000,22713=>1000,22714=>1000,22715=>1000,22716=>1000,22717=>1000,22718=>1000,22719=>1000,22720=>1000,22721=>1000,22722=>1000,22723=>1000,22724=>1000, - 22725=>1000,22726=>1000,22727=>1000,22728=>1000,22729=>1000,22730=>1000,22731=>1000,22732=>1000,22733=>1000,22734=>1000,22735=>1000,22736=>1000,22737=>1000,22738=>1000,22739=>1000,22740=>1000, - 22741=>1000,22742=>1000,22743=>1000,22744=>1000,22745=>1000,22746=>1000,22747=>1000,22748=>1000,22749=>1000,22750=>1000,22751=>1000,22752=>1000,22753=>1000,22754=>1000,22755=>1000,22756=>1000, - 22757=>1000,22758=>1000,22759=>1000,22760=>1000,22761=>1000,22762=>1000,22763=>1000,22764=>1000,22765=>1000,22766=>1000,22767=>1000,22768=>1000,22769=>1000,22770=>1000,22771=>1000,22772=>1000, - 22773=>1000,22774=>1000,22775=>1000,22776=>1000,22777=>1000,22778=>1000,22779=>1000,22780=>1000,22781=>1000,22782=>1000,22783=>1000,22784=>1000,22785=>1000,22786=>1000,22787=>1000,22788=>1000, - 22789=>1000,22790=>1000,22791=>1000,22792=>1000,22793=>1000,22794=>1000,22795=>1000,22796=>1000,22797=>1000,22798=>1000,22799=>1000,22800=>1000,22801=>1000,22802=>1000,22803=>1000,22804=>1000, - 22805=>1000,22806=>1000,22807=>1000,22808=>1000,22809=>1000,22810=>1000,22811=>1000,22812=>1000,22813=>1000,22814=>1000,22815=>1000,22816=>1000,22817=>1000,22818=>1000,22819=>1000,22820=>1000, - 22821=>1000,22822=>1000,22823=>1000,22824=>1000,22825=>1000,22826=>1000,22827=>1000,22828=>1000,22829=>1000,22830=>1000,22831=>1000,22832=>1000,22833=>1000,22834=>1000,22835=>1000,22836=>1000, - 22837=>1000,22838=>1000,22839=>1000,22840=>1000,22841=>1000,22842=>1000,22843=>1000,22844=>1000,22845=>1000,22846=>1000,22847=>1000,22848=>1000,22849=>1000,22850=>1000,22851=>1000,22852=>1000, - 22853=>1000,22854=>1000,22855=>1000,22856=>1000,22857=>1000,22858=>1000,22859=>1000,22860=>1000,22861=>1000,22862=>1000,22863=>1000,22864=>1000,22865=>1000,22866=>1000,22867=>1000,22868=>1000, - 22869=>1000,22870=>1000,22871=>1000,22872=>1000,22873=>1000,22874=>1000,22875=>1000,22876=>1000,22877=>1000,22878=>1000,22879=>1000,22880=>1000,22881=>1000,22882=>1000,22883=>1000,22884=>1000, - 22885=>1000,22886=>1000,22887=>1000,22888=>1000,22889=>1000,22890=>1000,22891=>1000,22892=>1000,22893=>1000,22894=>1000,22895=>1000,22896=>1000,22897=>1000,22898=>1000,22899=>1000,22900=>1000, - 22901=>1000,22902=>1000,22903=>1000,22904=>1000,22905=>1000,22906=>1000,22907=>1000,22908=>1000,22909=>1000,22910=>1000,22911=>1000,22912=>1000,22913=>1000,22914=>1000,22915=>1000,22916=>1000, - 22917=>1000,22918=>1000,22919=>1000,22920=>1000,22921=>1000,22922=>1000,22923=>1000,22924=>1000,22925=>1000,22926=>1000,22927=>1000,22928=>1000,22929=>1000,22930=>1000,22931=>1000,22932=>1000, - 22933=>1000,22934=>1000,22935=>1000,22936=>1000,22937=>1000,22938=>1000,22939=>1000,22940=>1000,22941=>1000,22942=>1000,22943=>1000,22944=>1000,22945=>1000,22946=>1000,22947=>1000,22948=>1000, - 22949=>1000,22950=>1000,22951=>1000,22952=>1000,22953=>1000,22954=>1000,22955=>1000,22956=>1000,22957=>1000,22958=>1000,22959=>1000,22960=>1000,22961=>1000,22962=>1000,22963=>1000,22964=>1000, - 22965=>1000,22966=>1000,22967=>1000,22968=>1000,22969=>1000,22970=>1000,22971=>1000,22972=>1000,22973=>1000,22974=>1000,22975=>1000,22976=>1000,22977=>1000,22978=>1000,22979=>1000,22980=>1000, - 22981=>1000,22982=>1000,22983=>1000,22984=>1000,22985=>1000,22986=>1000,22987=>1000,22988=>1000,22989=>1000,22990=>1000,22991=>1000,22992=>1000,22993=>1000,22994=>1000,22995=>1000,22996=>1000, - 22997=>1000,22998=>1000,22999=>1000,23000=>1000,23001=>1000,23002=>1000,23003=>1000,23004=>1000,23005=>1000,23006=>1000,23007=>1000,23008=>1000,23009=>1000,23010=>1000,23011=>1000,23012=>1000, - 23013=>1000,23014=>1000,23015=>1000,23016=>1000,23017=>1000,23018=>1000,23019=>1000,23020=>1000,23021=>1000,23022=>1000,23023=>1000,23024=>1000,23025=>1000,23026=>1000,23027=>1000,23028=>1000, - 23029=>1000,23030=>1000,23031=>1000,23032=>1000,23033=>1000,23034=>1000,23035=>1000,23036=>1000,23037=>1000,23038=>1000,23039=>1000,23040=>1000,23041=>1000,23042=>1000,23043=>1000,23044=>1000, - 23045=>1000,23046=>1000,23047=>1000,23048=>1000,23049=>1000,23050=>1000,23051=>1000,23052=>1000,23053=>1000,23054=>1000,23055=>1000,23056=>1000,23057=>1000,23058=>1000,23059=>1000,23060=>1000, - 23061=>1000,23062=>1000,23063=>1000,23064=>1000,23065=>1000,23066=>1000,23067=>1000,23068=>1000,23069=>1000,23070=>1000,23071=>1000,23072=>1000,23073=>1000,23074=>1000,23075=>1000,23076=>1000, - 23077=>1000,23078=>1000,23079=>1000,23080=>1000,23081=>1000,23082=>1000,23083=>1000,23084=>1000,23085=>1000,23086=>1000,23087=>1000,23088=>1000,23089=>1000,23090=>1000,23091=>1000,23092=>1000, - 23093=>1000,23094=>1000,23095=>1000,23096=>1000,23097=>1000,23098=>1000,23099=>1000,23100=>1000,23101=>1000,23102=>1000,23103=>1000,23104=>1000,23105=>1000,23106=>1000,23107=>1000,23108=>1000, - 23109=>1000,23110=>1000,23111=>1000,23112=>1000,23113=>1000,23114=>1000,23115=>1000,23116=>1000,23117=>1000,23118=>1000,23119=>1000,23120=>1000,23121=>1000,23122=>1000,23123=>1000,23124=>1000, - 23125=>1000,23126=>1000,23127=>1000,23128=>1000,23129=>1000,23130=>1000,23131=>1000,23132=>1000,23133=>1000,23134=>1000,23135=>1000,23136=>1000,23137=>1000,23138=>1000,23139=>1000,23140=>1000, - 23141=>1000,23142=>1000,23143=>1000,23144=>1000,23145=>1000,23146=>1000,23147=>1000,23148=>1000,23149=>1000,23150=>1000,23151=>1000,23152=>1000,23153=>1000,23154=>1000,23155=>1000,23156=>1000, - 23157=>1000,23158=>1000,23159=>1000,23160=>1000,23161=>1000,23162=>1000,23163=>1000,23164=>1000,23165=>1000,23166=>1000,23167=>1000,23168=>1000,23169=>1000,23170=>1000,23171=>1000,23172=>1000, - 23173=>1000,23174=>1000,23175=>1000,23176=>1000,23177=>1000,23178=>1000,23179=>1000,23180=>1000,23181=>1000,23182=>1000,23183=>1000,23184=>1000,23185=>1000,23186=>1000,23187=>1000,23188=>1000, - 23189=>1000,23190=>1000,23191=>1000,23192=>1000,23193=>1000,23194=>1000,23195=>1000,23196=>1000,23197=>1000,23198=>1000,23199=>1000,23200=>1000,23201=>1000,23202=>1000,23203=>1000,23204=>1000, - 23205=>1000,23206=>1000,23207=>1000,23208=>1000,23209=>1000,23210=>1000,23211=>1000,23212=>1000,23213=>1000,23214=>1000,23215=>1000,23216=>1000,23217=>1000,23218=>1000,23219=>1000,23220=>1000, - 23221=>1000,23222=>1000,23223=>1000,23224=>1000,23225=>1000,23226=>1000,23227=>1000,23228=>1000,23229=>1000,23230=>1000,23231=>1000,23232=>1000,23233=>1000,23234=>1000,23235=>1000,23236=>1000, - 23237=>1000,23238=>1000,23239=>1000,23240=>1000,23241=>1000,23242=>1000,23243=>1000,23244=>1000,23245=>1000,23246=>1000,23247=>1000,23248=>1000,23249=>1000,23250=>1000,23251=>1000,23252=>1000, - 23253=>1000,23254=>1000,23255=>1000,23256=>1000,23257=>1000,23258=>1000,23259=>1000,23260=>1000,23261=>1000,23262=>1000,23263=>1000,23264=>1000,23265=>1000,23266=>1000,23267=>1000,23268=>1000, - 23269=>1000,23270=>1000,23271=>1000,23272=>1000,23273=>1000,23274=>1000,23275=>1000,23276=>1000,23277=>1000,23278=>1000,23279=>1000,23280=>1000,23281=>1000,23282=>1000,23283=>1000,23284=>1000, - 23285=>1000,23286=>1000,23287=>1000,23288=>1000,23289=>1000,23290=>1000,23291=>1000,23292=>1000,23293=>1000,23294=>1000,23295=>1000,23296=>1000,23297=>1000,23298=>1000,23299=>1000,23300=>1000, - 23301=>1000,23302=>1000,23303=>1000,23304=>1000,23305=>1000,23306=>1000,23307=>1000,23308=>1000,23309=>1000,23310=>1000,23311=>1000,23312=>1000,23313=>1000,23314=>1000,23315=>1000,23316=>1000, - 23317=>1000,23318=>1000,23319=>1000,23320=>1000,23321=>1000,23322=>1000,23323=>1000,23324=>1000,23325=>1000,23326=>1000,23327=>1000,23328=>1000,23329=>1000,23330=>1000,23331=>1000,23332=>1000, - 23333=>1000,23334=>1000,23335=>1000,23336=>1000,23337=>1000,23338=>1000,23339=>1000,23340=>1000,23341=>1000,23342=>1000,23343=>1000,23344=>1000,23345=>1000,23346=>1000,23347=>1000,23348=>1000, - 23349=>1000,23350=>1000,23351=>1000,23352=>1000,23353=>1000,23354=>1000,23355=>1000,23356=>1000,23357=>1000,23358=>1000,23359=>1000,23360=>1000,23361=>1000,23362=>1000,23363=>1000,23364=>1000, - 23365=>1000,23366=>1000,23367=>1000,23368=>1000,23369=>1000,23370=>1000,23371=>1000,23372=>1000,23373=>1000,23374=>1000,23375=>1000,23376=>1000,23377=>1000,23378=>1000,23379=>1000,23380=>1000, - 23381=>1000,23382=>1000,23383=>1000,23384=>1000,23385=>1000,23386=>1000,23387=>1000,23388=>1000,23389=>1000,23390=>1000,23391=>1000,23392=>1000,23393=>1000,23394=>1000,23395=>1000,23396=>1000, - 23397=>1000,23398=>1000,23399=>1000,23400=>1000,23401=>1000,23402=>1000,23403=>1000,23404=>1000,23405=>1000,23406=>1000,23407=>1000,23408=>1000,23409=>1000,23410=>1000,23411=>1000,23412=>1000, - 23413=>1000,23414=>1000,23415=>1000,23416=>1000,23417=>1000,23418=>1000,23419=>1000,23420=>1000,23421=>1000,23422=>1000,23423=>1000,23424=>1000,23425=>1000,23426=>1000,23427=>1000,23428=>1000, - 23429=>1000,23430=>1000,23431=>1000,23432=>1000,23433=>1000,23434=>1000,23435=>1000,23436=>1000,23437=>1000,23438=>1000,23439=>1000,23440=>1000,23441=>1000,23442=>1000,23443=>1000,23444=>1000, - 23445=>1000,23446=>1000,23447=>1000,23448=>1000,23449=>1000,23450=>1000,23451=>1000,23452=>1000,23453=>1000,23454=>1000,23455=>1000,23456=>1000,23457=>1000,23458=>1000,23459=>1000,23460=>1000, - 23461=>1000,23462=>1000,23463=>1000,23464=>1000,23465=>1000,23466=>1000,23467=>1000,23468=>1000,23469=>1000,23470=>1000,23471=>1000,23472=>1000,23473=>1000,23474=>1000,23475=>1000,23476=>1000, - 23477=>1000,23478=>1000,23479=>1000,23480=>1000,23481=>1000,23482=>1000,23483=>1000,23484=>1000,23485=>1000,23486=>1000,23487=>1000,23488=>1000,23489=>1000,23490=>1000,23491=>1000,23492=>1000, - 23493=>1000,23494=>1000,23495=>1000,23496=>1000,23497=>1000,23498=>1000,23499=>1000,23500=>1000,23501=>1000,23502=>1000,23503=>1000,23504=>1000,23505=>1000,23506=>1000,23507=>1000,23508=>1000, - 23509=>1000,23510=>1000,23511=>1000,23512=>1000,23513=>1000,23514=>1000,23515=>1000,23516=>1000,23517=>1000,23518=>1000,23519=>1000,23520=>1000,23521=>1000,23522=>1000,23523=>1000,23524=>1000, - 23525=>1000,23526=>1000,23527=>1000,23528=>1000,23529=>1000,23530=>1000,23531=>1000,23532=>1000,23533=>1000,23534=>1000,23535=>1000,23536=>1000,23537=>1000,23538=>1000,23539=>1000,23540=>1000, - 23541=>1000,23542=>1000,23543=>1000,23544=>1000,23545=>1000,23546=>1000,23547=>1000,23548=>1000,23549=>1000,23550=>1000,23551=>1000,23552=>1000,23553=>1000,23554=>1000,23555=>1000,23556=>1000, - 23557=>1000,23558=>1000,23559=>1000,23560=>1000,23561=>1000,23562=>1000,23563=>1000,23564=>1000,23565=>1000,23566=>1000,23567=>1000,23568=>1000,23569=>1000,23570=>1000,23571=>1000,23572=>1000, - 23573=>1000,23574=>1000,23575=>1000,23576=>1000,23577=>1000,23578=>1000,23579=>1000,23580=>1000,23581=>1000,23582=>1000,23583=>1000,23584=>1000,23585=>1000,23586=>1000,23587=>1000,23588=>1000, - 23589=>1000,23590=>1000,23591=>1000,23592=>1000,23593=>1000,23594=>1000,23595=>1000,23596=>1000,23597=>1000,23598=>1000,23599=>1000,23600=>1000,23601=>1000,23602=>1000,23603=>1000,23604=>1000, - 23605=>1000,23606=>1000,23607=>1000,23608=>1000,23609=>1000,23610=>1000,23611=>1000,23612=>1000,23613=>1000,23614=>1000,23615=>1000,23616=>1000,23617=>1000,23618=>1000,23619=>1000,23620=>1000, - 23621=>1000,23622=>1000,23623=>1000,23624=>1000,23625=>1000,23626=>1000,23627=>1000,23628=>1000,23629=>1000,23630=>1000,23631=>1000,23632=>1000,23633=>1000,23634=>1000,23635=>1000,23636=>1000, - 23637=>1000,23638=>1000,23639=>1000,23640=>1000,23641=>1000,23642=>1000,23643=>1000,23644=>1000,23645=>1000,23646=>1000,23647=>1000,23648=>1000,23649=>1000,23650=>1000,23651=>1000,23652=>1000, - 23653=>1000,23654=>1000,23655=>1000,23656=>1000,23657=>1000,23658=>1000,23659=>1000,23660=>1000,23661=>1000,23662=>1000,23663=>1000,23664=>1000,23665=>1000,23666=>1000,23667=>1000,23668=>1000, - 23669=>1000,23670=>1000,23671=>1000,23672=>1000,23673=>1000,23674=>1000,23675=>1000,23676=>1000,23677=>1000,23678=>1000,23679=>1000,23680=>1000,23681=>1000,23682=>1000,23683=>1000,23684=>1000, - 23685=>1000,23686=>1000,23687=>1000,23688=>1000,23689=>1000,23690=>1000,23691=>1000,23692=>1000,23693=>1000,23694=>1000,23695=>1000,23696=>1000,23697=>1000,23698=>1000,23699=>1000,23700=>1000, - 23701=>1000,23702=>1000,23703=>1000,23704=>1000,23705=>1000,23706=>1000,23707=>1000,23708=>1000,23709=>1000,23710=>1000,23711=>1000,23712=>1000,23713=>1000,23714=>1000,23715=>1000,23716=>1000, - 23717=>1000,23718=>1000,23719=>1000,23720=>1000,23721=>1000,23722=>1000,23723=>1000,23724=>1000,23725=>1000,23726=>1000,23727=>1000,23728=>1000,23729=>1000,23730=>1000,23731=>1000,23732=>1000, - 23733=>1000,23734=>1000,23735=>1000,23736=>1000,23737=>1000,23738=>1000,23739=>1000,23740=>1000,23741=>1000,23742=>1000,23743=>1000,23744=>1000,23745=>1000,23746=>1000,23747=>1000,23748=>1000, - 23749=>1000,23750=>1000,23751=>1000,23752=>1000,23753=>1000,23754=>1000,23755=>1000,23756=>1000,23757=>1000,23758=>1000,23759=>1000,23760=>1000,23761=>1000,23762=>1000,23763=>1000,23764=>1000, - 23765=>1000,23766=>1000,23767=>1000,23768=>1000,23769=>1000,23770=>1000,23771=>1000,23772=>1000,23773=>1000,23774=>1000,23775=>1000,23776=>1000,23777=>1000,23778=>1000,23779=>1000,23780=>1000, - 23781=>1000,23782=>1000,23783=>1000,23784=>1000,23785=>1000,23786=>1000,23787=>1000,23788=>1000,23789=>1000,23790=>1000,23791=>1000,23792=>1000,23793=>1000,23794=>1000,23795=>1000,23796=>1000, - 23797=>1000,23798=>1000,23799=>1000,23800=>1000,23801=>1000,23802=>1000,23803=>1000,23804=>1000,23805=>1000,23806=>1000,23807=>1000,23808=>1000,23809=>1000,23810=>1000,23811=>1000,23812=>1000, - 23813=>1000,23814=>1000,23815=>1000,23816=>1000,23817=>1000,23818=>1000,23819=>1000,23820=>1000,23821=>1000,23822=>1000,23823=>1000,23824=>1000,23825=>1000,23826=>1000,23827=>1000,23828=>1000, - 23829=>1000,23830=>1000,23831=>1000,23832=>1000,23833=>1000,23834=>1000,23835=>1000,23836=>1000,23837=>1000,23838=>1000,23839=>1000,23840=>1000,23841=>1000,23842=>1000,23843=>1000,23844=>1000, - 23845=>1000,23846=>1000,23847=>1000,23848=>1000,23849=>1000,23850=>1000,23851=>1000,23852=>1000,23853=>1000,23854=>1000,23855=>1000,23856=>1000,23857=>1000,23858=>1000,23859=>1000,23860=>1000, - 23861=>1000,23862=>1000,23863=>1000,23864=>1000,23865=>1000,23866=>1000,23867=>1000,23868=>1000,23869=>1000,23870=>1000,23871=>1000,23872=>1000,23873=>1000,23874=>1000,23875=>1000,23876=>1000, - 23877=>1000,23878=>1000,23879=>1000,23880=>1000,23881=>1000,23882=>1000,23883=>1000,23884=>1000,23885=>1000,23886=>1000,23887=>1000,23888=>1000,23889=>1000,23890=>1000,23891=>1000,23892=>1000, - 23893=>1000,23894=>1000,23895=>1000,23896=>1000,23897=>1000,23898=>1000,23899=>1000,23900=>1000,23901=>1000,23902=>1000,23903=>1000,23904=>1000,23905=>1000,23906=>1000,23907=>1000,23908=>1000, - 23909=>1000,23910=>1000,23911=>1000,23912=>1000,23913=>1000,23914=>1000,23915=>1000,23916=>1000,23917=>1000,23918=>1000,23919=>1000,23920=>1000,23921=>1000,23922=>1000,23923=>1000,23924=>1000, - 23925=>1000,23926=>1000,23927=>1000,23928=>1000,23929=>1000,23930=>1000,23931=>1000,23932=>1000,23933=>1000,23934=>1000,23935=>1000,23936=>1000,23937=>1000,23938=>1000,23939=>1000,23940=>1000, - 23941=>1000,23942=>1000,23943=>1000,23944=>1000,23945=>1000,23946=>1000,23947=>1000,23948=>1000,23949=>1000,23950=>1000,23951=>1000,23952=>1000,23953=>1000,23954=>1000,23955=>1000,23956=>1000, - 23957=>1000,23958=>1000,23959=>1000,23960=>1000,23961=>1000,23962=>1000,23963=>1000,23964=>1000,23965=>1000,23966=>1000,23967=>1000,23968=>1000,23969=>1000,23970=>1000,23971=>1000,23972=>1000, - 23973=>1000,23974=>1000,23975=>1000,23976=>1000,23977=>1000,23978=>1000,23979=>1000,23980=>1000,23981=>1000,23982=>1000,23983=>1000,23984=>1000,23985=>1000,23986=>1000,23987=>1000,23988=>1000, - 23989=>1000,23990=>1000,23991=>1000,23992=>1000,23993=>1000,23994=>1000,23995=>1000,23996=>1000,23997=>1000,23998=>1000,23999=>1000,24000=>1000,24001=>1000,24002=>1000,24003=>1000,24004=>1000, - 24005=>1000,24006=>1000,24007=>1000,24008=>1000,24009=>1000,24010=>1000,24011=>1000,24012=>1000,24013=>1000,24014=>1000,24015=>1000,24016=>1000,24017=>1000,24018=>1000,24019=>1000,24020=>1000, - 24021=>1000,24022=>1000,24023=>1000,24024=>1000,24025=>1000,24026=>1000,24027=>1000,24028=>1000,24029=>1000,24030=>1000,24031=>1000,24032=>1000,24033=>1000,24034=>1000,24035=>1000,24036=>1000, - 24037=>1000,24038=>1000,24039=>1000,24040=>1000,24041=>1000,24042=>1000,24043=>1000,24044=>1000,24045=>1000,24046=>1000,24047=>1000,24048=>1000,24049=>1000,24050=>1000,24051=>1000,24052=>1000, - 24053=>1000,24054=>1000,24055=>1000,24056=>1000,24057=>1000,24058=>1000,24059=>1000,24060=>1000,24061=>1000,24062=>1000,24063=>1000,24064=>1000,24065=>1000,24066=>1000,24067=>1000,24068=>1000, - 24069=>1000,24070=>1000,24071=>1000,24072=>1000,24073=>1000,24074=>1000,24075=>1000,24076=>1000,24077=>1000,24078=>1000,24079=>1000,24080=>1000,24081=>1000,24082=>1000,24083=>1000,24084=>1000, - 24085=>1000,24086=>1000,24087=>1000,24088=>1000,24089=>1000,24090=>1000,24091=>1000,24092=>1000,24093=>1000,24094=>1000,24095=>1000,24096=>1000,24097=>1000,24098=>1000,24099=>1000,24100=>1000, - 24101=>1000,24102=>1000,24103=>1000,24104=>1000,24105=>1000,24106=>1000,24107=>1000,24108=>1000,24109=>1000,24110=>1000,24111=>1000,24112=>1000,24113=>1000,24114=>1000,24115=>1000,24116=>1000, - 24117=>1000,24118=>1000,24119=>1000,24120=>1000,24121=>1000,24122=>1000,24123=>1000,24124=>1000,24125=>1000,24126=>1000,24127=>1000,24128=>1000,24129=>1000,24130=>1000,24131=>1000,24132=>1000, - 24133=>1000,24134=>1000,24135=>1000,24136=>1000,24137=>1000,24138=>1000,24139=>1000,24140=>1000,24141=>1000,24142=>1000,24143=>1000,24144=>1000,24145=>1000,24146=>1000,24147=>1000,24148=>1000, - 24149=>1000,24150=>1000,24151=>1000,24152=>1000,24153=>1000,24154=>1000,24155=>1000,24156=>1000,24157=>1000,24158=>1000,24159=>1000,24160=>1000,24161=>1000,24162=>1000,24163=>1000,24164=>1000, - 24165=>1000,24166=>1000,24167=>1000,24168=>1000,24169=>1000,24170=>1000,24171=>1000,24172=>1000,24173=>1000,24174=>1000,24175=>1000,24176=>1000,24177=>1000,24178=>1000,24179=>1000,24180=>1000, - 24181=>1000,24182=>1000,24183=>1000,24184=>1000,24185=>1000,24186=>1000,24187=>1000,24188=>1000,24189=>1000,24190=>1000,24191=>1000,24192=>1000,24193=>1000,24194=>1000,24195=>1000,24196=>1000, - 24197=>1000,24198=>1000,24199=>1000,24200=>1000,24201=>1000,24202=>1000,24203=>1000,24204=>1000,24205=>1000,24206=>1000,24207=>1000,24208=>1000,24209=>1000,24210=>1000,24211=>1000,24212=>1000, - 24213=>1000,24214=>1000,24215=>1000,24216=>1000,24217=>1000,24218=>1000,24219=>1000,24220=>1000,24221=>1000,24222=>1000,24223=>1000,24224=>1000,24225=>1000,24226=>1000,24227=>1000,24228=>1000, - 24229=>1000,24230=>1000,24231=>1000,24232=>1000,24233=>1000,24234=>1000,24235=>1000,24236=>1000,24237=>1000,24238=>1000,24239=>1000,24240=>1000,24241=>1000,24242=>1000,24243=>1000,24244=>1000, - 24245=>1000,24246=>1000,24247=>1000,24248=>1000,24249=>1000,24250=>1000,24251=>1000,24252=>1000,24253=>1000,24254=>1000,24255=>1000,24256=>1000,24257=>1000,24258=>1000,24259=>1000,24260=>1000, - 24261=>1000,24262=>1000,24263=>1000,24264=>1000,24265=>1000,24266=>1000,24267=>1000,24268=>1000,24269=>1000,24270=>1000,24271=>1000,24272=>1000,24273=>1000,24274=>1000,24275=>1000,24276=>1000, - 24277=>1000,24278=>1000,24279=>1000,24280=>1000,24281=>1000,24282=>1000,24283=>1000,24284=>1000,24285=>1000,24286=>1000,24287=>1000,24288=>1000,24289=>1000,24290=>1000,24291=>1000,24292=>1000, - 24293=>1000,24294=>1000,24295=>1000,24296=>1000,24297=>1000,24298=>1000,24299=>1000,24300=>1000,24301=>1000,24302=>1000,24303=>1000,24304=>1000,24305=>1000,24306=>1000,24307=>1000,24308=>1000, - 24309=>1000,24310=>1000,24311=>1000,24312=>1000,24313=>1000,24314=>1000,24315=>1000,24316=>1000,24317=>1000,24318=>1000,24319=>1000,24320=>1000,24321=>1000,24322=>1000,24323=>1000,24324=>1000, - 24325=>1000,24326=>1000,24327=>1000,24328=>1000,24329=>1000,24330=>1000,24331=>1000,24332=>1000,24333=>1000,24334=>1000,24335=>1000,24336=>1000,24337=>1000,24338=>1000,24339=>1000,24340=>1000, - 24341=>1000,24342=>1000,24343=>1000,24344=>1000,24345=>1000,24346=>1000,24347=>1000,24348=>1000,24349=>1000,24350=>1000,24351=>1000,24352=>1000,24353=>1000,24354=>1000,24355=>1000,24356=>1000, - 24357=>1000,24358=>1000,24359=>1000,24360=>1000,24361=>1000,24362=>1000,24363=>1000,24364=>1000,24365=>1000,24366=>1000,24367=>1000,24368=>1000,24369=>1000,24370=>1000,24371=>1000,24372=>1000, - 24373=>1000,24374=>1000,24375=>1000,24376=>1000,24377=>1000,24378=>1000,24379=>1000,24380=>1000,24381=>1000,24382=>1000,24383=>1000,24384=>1000,24385=>1000,24386=>1000,24387=>1000,24388=>1000, - 24389=>1000,24390=>1000,24391=>1000,24392=>1000,24393=>1000,24394=>1000,24395=>1000,24396=>1000,24397=>1000,24398=>1000,24399=>1000,24400=>1000,24401=>1000,24402=>1000,24403=>1000,24404=>1000, - 24405=>1000,24406=>1000,24407=>1000,24408=>1000,24409=>1000,24410=>1000,24411=>1000,24412=>1000,24413=>1000,24414=>1000,24415=>1000,24416=>1000,24417=>1000,24418=>1000,24419=>1000,24420=>1000, - 24421=>1000,24422=>1000,24423=>1000,24424=>1000,24425=>1000,24426=>1000,24427=>1000,24428=>1000,24429=>1000,24430=>1000,24431=>1000,24432=>1000,24433=>1000,24434=>1000,24435=>1000,24436=>1000, - 24437=>1000,24438=>1000,24439=>1000,24440=>1000,24441=>1000,24442=>1000,24443=>1000,24444=>1000,24445=>1000,24446=>1000,24447=>1000,24448=>1000,24449=>1000,24450=>1000,24451=>1000,24452=>1000, - 24453=>1000,24454=>1000,24455=>1000,24456=>1000,24457=>1000,24458=>1000,24459=>1000,24460=>1000,24461=>1000,24462=>1000,24463=>1000,24464=>1000,24465=>1000,24466=>1000,24467=>1000,24468=>1000, - 24469=>1000,24470=>1000,24471=>1000,24472=>1000,24473=>1000,24474=>1000,24475=>1000,24476=>1000,24477=>1000,24478=>1000,24479=>1000,24480=>1000,24481=>1000,24482=>1000,24483=>1000,24484=>1000, - 24485=>1000,24486=>1000,24487=>1000,24488=>1000,24489=>1000,24490=>1000,24491=>1000,24492=>1000,24493=>1000,24494=>1000,24495=>1000,24496=>1000,24497=>1000,24498=>1000,24499=>1000,24500=>1000, - 24501=>1000,24502=>1000,24503=>1000,24504=>1000,24505=>1000,24506=>1000,24507=>1000,24508=>1000,24509=>1000,24510=>1000,24511=>1000,24512=>1000,24513=>1000,24514=>1000,24515=>1000,24516=>1000, - 24517=>1000,24518=>1000,24519=>1000,24520=>1000,24521=>1000,24522=>1000,24523=>1000,24524=>1000,24525=>1000,24526=>1000,24527=>1000,24528=>1000,24529=>1000,24530=>1000,24531=>1000,24532=>1000, - 24533=>1000,24534=>1000,24535=>1000,24536=>1000,24537=>1000,24538=>1000,24539=>1000,24540=>1000,24541=>1000,24542=>1000,24543=>1000,24544=>1000,24545=>1000,24546=>1000,24547=>1000,24548=>1000, - 24549=>1000,24550=>1000,24551=>1000,24552=>1000,24553=>1000,24554=>1000,24555=>1000,24556=>1000,24557=>1000,24558=>1000,24559=>1000,24560=>1000,24561=>1000,24562=>1000,24563=>1000,24564=>1000, - 24565=>1000,24566=>1000,24567=>1000,24568=>1000,24569=>1000,24570=>1000,24571=>1000,24572=>1000,24573=>1000,24574=>1000,24575=>1000,24576=>1000,24577=>1000,24578=>1000,24579=>1000,24580=>1000, - 24581=>1000,24582=>1000,24583=>1000,24584=>1000,24585=>1000,24586=>1000,24587=>1000,24588=>1000,24589=>1000,24590=>1000,24591=>1000,24592=>1000,24593=>1000,24594=>1000,24595=>1000,24596=>1000, - 24597=>1000,24598=>1000,24599=>1000,24600=>1000,24601=>1000,24602=>1000,24603=>1000,24604=>1000,24605=>1000,24606=>1000,24607=>1000,24608=>1000,24609=>1000,24610=>1000,24611=>1000,24612=>1000, - 24613=>1000,24614=>1000,24615=>1000,24616=>1000,24617=>1000,24618=>1000,24619=>1000,24620=>1000,24621=>1000,24622=>1000,24623=>1000,24624=>1000,24625=>1000,24626=>1000,24627=>1000,24628=>1000, - 24629=>1000,24630=>1000,24631=>1000,24632=>1000,24633=>1000,24634=>1000,24635=>1000,24636=>1000,24637=>1000,24638=>1000,24639=>1000,24640=>1000,24641=>1000,24642=>1000,24643=>1000,24644=>1000, - 24645=>1000,24646=>1000,24647=>1000,24648=>1000,24649=>1000,24650=>1000,24651=>1000,24652=>1000,24653=>1000,24654=>1000,24655=>1000,24656=>1000,24657=>1000,24658=>1000,24659=>1000,24660=>1000, - 24661=>1000,24662=>1000,24663=>1000,24664=>1000,24665=>1000,24666=>1000,24667=>1000,24668=>1000,24669=>1000,24670=>1000,24671=>1000,24672=>1000,24673=>1000,24674=>1000,24675=>1000,24676=>1000, - 24677=>1000,24678=>1000,24679=>1000,24680=>1000,24681=>1000,24682=>1000,24683=>1000,24684=>1000,24685=>1000,24686=>1000,24687=>1000,24688=>1000,24689=>1000,24690=>1000,24691=>1000,24692=>1000, - 24693=>1000,24694=>1000,24695=>1000,24696=>1000,24697=>1000,24698=>1000,24699=>1000,24700=>1000,24701=>1000,24702=>1000,24703=>1000,24704=>1000,24705=>1000,24706=>1000,24707=>1000,24708=>1000, - 24709=>1000,24710=>1000,24711=>1000,24712=>1000,24713=>1000,24714=>1000,24715=>1000,24716=>1000,24717=>1000,24718=>1000,24719=>1000,24720=>1000,24721=>1000,24722=>1000,24723=>1000,24724=>1000, - 24725=>1000,24726=>1000,24727=>1000,24728=>1000,24729=>1000,24730=>1000,24731=>1000,24732=>1000,24733=>1000,24734=>1000,24735=>1000,24736=>1000,24737=>1000,24738=>1000,24739=>1000,24740=>1000, - 24741=>1000,24742=>1000,24743=>1000,24744=>1000,24745=>1000,24746=>1000,24747=>1000,24748=>1000,24749=>1000,24750=>1000,24751=>1000,24752=>1000,24753=>1000,24754=>1000,24755=>1000,24756=>1000, - 24757=>1000,24758=>1000,24759=>1000,24760=>1000,24761=>1000,24762=>1000,24763=>1000,24764=>1000,24765=>1000,24766=>1000,24767=>1000,24768=>1000,24769=>1000,24770=>1000,24771=>1000,24772=>1000, - 24773=>1000,24774=>1000,24775=>1000,24776=>1000,24777=>1000,24778=>1000,24779=>1000,24780=>1000,24781=>1000,24782=>1000,24783=>1000,24784=>1000,24785=>1000,24786=>1000,24787=>1000,24788=>1000, - 24789=>1000,24790=>1000,24791=>1000,24792=>1000,24793=>1000,24794=>1000,24795=>1000,24796=>1000,24797=>1000,24798=>1000,24799=>1000,24800=>1000,24801=>1000,24802=>1000,24803=>1000,24804=>1000, - 24805=>1000,24806=>1000,24807=>1000,24808=>1000,24809=>1000,24810=>1000,24811=>1000,24812=>1000,24813=>1000,24814=>1000,24815=>1000,24816=>1000,24817=>1000,24818=>1000,24819=>1000,24820=>1000, - 24821=>1000,24822=>1000,24823=>1000,24824=>1000,24825=>1000,24826=>1000,24827=>1000,24828=>1000,24829=>1000,24830=>1000,24831=>1000,24832=>1000,24833=>1000,24834=>1000,24835=>1000,24836=>1000, - 24837=>1000,24838=>1000,24839=>1000,24840=>1000,24841=>1000,24842=>1000,24843=>1000,24844=>1000,24845=>1000,24846=>1000,24847=>1000,24848=>1000,24849=>1000,24850=>1000,24851=>1000,24852=>1000, - 24853=>1000,24854=>1000,24855=>1000,24856=>1000,24857=>1000,24858=>1000,24859=>1000,24860=>1000,24861=>1000,24862=>1000,24863=>1000,24864=>1000,24865=>1000,24866=>1000,24867=>1000,24868=>1000, - 24869=>1000,24870=>1000,24871=>1000,24872=>1000,24873=>1000,24874=>1000,24875=>1000,24876=>1000,24877=>1000,24878=>1000,24879=>1000,24880=>1000,24881=>1000,24882=>1000,24883=>1000,24884=>1000, - 24885=>1000,24886=>1000,24887=>1000,24888=>1000,24889=>1000,24890=>1000,24891=>1000,24892=>1000,24893=>1000,24894=>1000,24895=>1000,24896=>1000,24897=>1000,24898=>1000,24899=>1000,24900=>1000, - 24901=>1000,24902=>1000,24903=>1000,24904=>1000,24905=>1000,24906=>1000,24907=>1000,24908=>1000,24909=>1000,24910=>1000,24911=>1000,24912=>1000,24913=>1000,24914=>1000,24915=>1000,24916=>1000, - 24917=>1000,24918=>1000,24919=>1000,24920=>1000,24921=>1000,24922=>1000,24923=>1000,24924=>1000,24925=>1000,24926=>1000,24927=>1000,24928=>1000,24929=>1000,24930=>1000,24931=>1000,24932=>1000, - 24933=>1000,24934=>1000,24935=>1000,24936=>1000,24937=>1000,24938=>1000,24939=>1000,24940=>1000,24941=>1000,24942=>1000,24943=>1000,24944=>1000,24945=>1000,24946=>1000,24947=>1000,24948=>1000, - 24949=>1000,24950=>1000,24951=>1000,24952=>1000,24953=>1000,24954=>1000,24955=>1000,24956=>1000,24957=>1000,24958=>1000,24959=>1000,24960=>1000,24961=>1001,24962=>1000,24963=>1000,24964=>1000, - 24965=>1000,24966=>1000,24967=>1000,24968=>1000,24969=>1000,24970=>1000,24971=>1000,24972=>1000,24973=>1000,24974=>1000,24975=>1000,24976=>1000,24977=>1000,24978=>1000,24979=>1000,24980=>1000, - 24981=>1000,24982=>1000,24983=>1000,24984=>1000,24985=>1000,24986=>1000,24987=>1000,24988=>1000,24989=>1000,24990=>1000,24991=>1000,24992=>1000,24993=>1000,24994=>1000,24995=>1000,24996=>1000, - 24997=>1000,24998=>1000,24999=>1000,25000=>1000,25001=>1000,25002=>1000,25003=>1000,25004=>1000,25005=>1000,25006=>1000,25007=>1000,25008=>1000,25009=>1000,25010=>1000,25011=>1000,25012=>1000, - 25013=>1000,25014=>1000,25015=>1000,25016=>1000,25017=>1000,25018=>1000,25019=>1000,25020=>1000,25021=>1000,25022=>1000,25023=>1000,25024=>1000,25025=>1000,25026=>1000,25027=>1000,25028=>1000, - 25029=>1000,25030=>1000,25031=>1000,25032=>1000,25033=>1000,25034=>1000,25035=>1000,25036=>1000,25037=>1000,25038=>1000,25039=>1000,25040=>1000,25041=>1000,25042=>1000,25043=>1000,25044=>1000, - 25045=>1000,25046=>1000,25047=>1000,25048=>1000,25049=>1000,25050=>1000,25051=>1000,25052=>1000,25053=>1000,25054=>1000,25055=>1000,25056=>1000,25057=>1000,25058=>1000,25059=>1000,25060=>1000, - 25061=>1000,25062=>1000,25063=>1000,25064=>1000,25065=>1000,25066=>1000,25067=>1000,25068=>1000,25069=>1000,25070=>1000,25071=>1000,25072=>1000,25073=>1000,25074=>1000,25075=>1000,25076=>1000, - 25077=>1000,25078=>1000,25079=>1000,25080=>1000,25081=>1000,25082=>1000,25083=>1000,25084=>1000,25085=>1000,25086=>1000,25087=>1000,25088=>1000,25089=>1000,25090=>1000,25091=>1000,25092=>1000, - 25093=>1000,25094=>1000,25095=>1000,25096=>1000,25097=>1000,25098=>1000,25099=>1000,25100=>1000,25101=>1000,25102=>1000,25103=>1000,25104=>1000,25105=>1000,25106=>1000,25107=>1000,25108=>1000, - 25109=>1000,25110=>1000,25111=>1000,25112=>1000,25113=>1000,25114=>1000,25115=>1000,25116=>1000,25117=>1000,25118=>1000,25119=>1000,25120=>1000,25121=>1000,25122=>1000,25123=>1000,25124=>1000, - 25125=>1000,25126=>1000,25127=>1000,25128=>1000,25129=>1000,25130=>1000,25131=>1000,25132=>1000,25133=>1000,25134=>1000,25135=>1000,25136=>1000,25137=>1000,25138=>1000,25139=>1000,25140=>1000, - 25141=>1000,25142=>1000,25143=>1000,25144=>1000,25145=>1000,25146=>1000,25147=>1000,25148=>1000,25149=>1000,25150=>1000,25151=>1000,25152=>1000,25153=>1000,25154=>1000,25155=>1000,25156=>1000, - 25157=>1000,25158=>1000,25159=>1000,25160=>1000,25161=>1000,25162=>1000,25163=>1000,25164=>1000,25165=>1000,25166=>1000,25167=>1000,25168=>1000,25169=>1000,25170=>1000,25171=>1000,25172=>1000, - 25173=>1000,25174=>1000,25175=>1000,25176=>1000,25177=>1000,25178=>1000,25179=>1000,25180=>1000,25181=>1000,25182=>1000,25183=>1000,25184=>1000,25185=>1000,25186=>1000,25187=>1000,25188=>1000, - 25189=>1000,25190=>1000,25191=>1000,25192=>1000,25193=>1000,25194=>1000,25195=>1000,25196=>1000,25197=>1000,25198=>1000,25199=>1000,25200=>1000,25201=>1000,25202=>1000,25203=>1000,25204=>1000, - 25205=>1000,25206=>1000,25207=>1000,25208=>1000,25209=>1000,25210=>1000,25211=>1000,25212=>1000,25213=>1000,25214=>1000,25215=>1000,25216=>1000,25217=>1000,25218=>1000,25219=>1000,25220=>1000, - 25221=>1000,25222=>1000,25223=>1000,25224=>1000,25225=>1000,25226=>1000,25227=>1000,25228=>1000,25229=>1000,25230=>1000,25231=>1000,25232=>1000,25233=>1000,25234=>1000,25235=>1000,25236=>1000, - 25237=>1000,25238=>1000,25239=>1000,25240=>1000,25241=>1000,25242=>1000,25243=>1000,25244=>1000,25245=>1000,25246=>1000,25247=>1000,25248=>1000,25249=>1000,25250=>1000,25251=>1000,25252=>1000, - 25253=>1000,25254=>1000,25255=>1000,25256=>1000,25257=>1000,25258=>1000,25259=>1000,25260=>1000,25261=>1000,25262=>1000,25263=>1000,25264=>1000,25265=>1000,25266=>1000,25267=>1000,25268=>1000, - 25269=>1000,25270=>1000,25271=>1000,25272=>1000,25273=>1000,25274=>1000,25275=>1000,25276=>1000,25277=>1000,25278=>1000,25279=>1000,25280=>1000,25281=>1000,25282=>1000,25283=>1000,25284=>1000, - 25285=>1000,25286=>1000,25287=>1000,25288=>1000,25289=>1000,25290=>1000,25291=>1000,25292=>1000,25293=>1000,25294=>1000,25295=>1000,25296=>1000,25297=>1000,25298=>1000,25299=>1000,25300=>1000, - 25301=>1000,25302=>1000,25303=>1000,25304=>1000,25305=>1000,25306=>1000,25307=>1000,25308=>1000,25309=>1000,25310=>1000,25311=>1000,25312=>1000,25313=>1000,25314=>1000,25315=>1000,25316=>1000, - 25317=>1000,25318=>1000,25319=>1000,25320=>1000,25321=>1000,25322=>1000,25323=>1000,25324=>1000,25325=>1000,25326=>1000,25327=>1000,25328=>1000,25329=>1000,25330=>1000,25331=>1000,25332=>1000, - 25333=>1000,25334=>1000,25335=>1000,25336=>1000,25337=>1000,25338=>1000,25339=>1000,25340=>1000,25341=>1000,25342=>1000,25343=>1000,25344=>1000,25345=>1000,25346=>1000,25347=>1000,25348=>1000, - 25349=>1000,25350=>1000,25351=>1000,25352=>1000,25353=>1000,25354=>1000,25355=>1000,25356=>1000,25357=>1000,25358=>1000,25359=>1000,25360=>1000,25361=>1000,25362=>1000,25363=>1000,25364=>1000, - 25365=>1000,25366=>1000,25367=>1000,25368=>1000,25369=>1000,25370=>1000,25371=>1000,25372=>1000,25373=>1000,25374=>1000,25375=>1000,25376=>1000,25377=>1000,25378=>1000,25379=>1000,25380=>1000, - 25381=>1000,25382=>1000,25383=>1000,25384=>1000,25385=>1000,25386=>1000,25387=>1000,25388=>1000,25389=>1000,25390=>1000,25391=>1000,25392=>1000,25393=>1000,25394=>1000,25395=>1000,25396=>1000, - 25397=>1000,25398=>1000,25399=>1000,25400=>1000,25401=>1000,25402=>1000,25403=>1000,25404=>1000,25405=>1000,25406=>1000,25407=>1000,25408=>1000,25409=>1000,25410=>1000,25411=>1000,25412=>1000, - 25413=>1000,25414=>1000,25415=>1000,25416=>1000,25417=>1000,25418=>1000,25419=>1000,25420=>1000,25421=>1000,25422=>1000,25423=>1000,25424=>1000,25425=>1000,25426=>1000,25427=>1000,25428=>1000, - 25429=>1000,25430=>1000,25431=>1000,25432=>1000,25433=>1000,25434=>1000,25435=>1000,25436=>1000,25437=>1000,25438=>1000,25439=>1000,25440=>1000,25441=>1000,25442=>1000,25443=>1000,25444=>1000, - 25445=>1000,25446=>1000,25447=>1000,25448=>1000,25449=>1000,25450=>1000,25451=>1000,25452=>1000,25453=>1000,25454=>1000,25455=>1000,25456=>1000,25457=>1000,25458=>1000,25459=>1000,25460=>1000, - 25461=>1000,25462=>1000,25463=>1000,25464=>1000,25465=>1000,25466=>1000,25467=>1000,25468=>1000,25469=>1000,25470=>1000,25471=>1000,25472=>1000,25473=>1000,25474=>1000,25475=>1000,25476=>1000, - 25477=>1000,25478=>1000,25479=>1000,25480=>1000,25481=>1000,25482=>1000,25483=>1000,25484=>1000,25485=>1000,25486=>1000,25487=>1000,25488=>1000,25489=>1000,25490=>1000,25491=>1000,25492=>1000, - 25493=>1000,25494=>1000,25495=>1000,25496=>1000,25497=>1000,25498=>1000,25499=>1000,25500=>1000,25501=>1000,25502=>1000,25503=>1000,25504=>1000,25505=>1000,25506=>1000,25507=>1000,25508=>1000, - 25509=>1000,25510=>1000,25511=>1000,25512=>1000,25513=>1000,25514=>1000,25515=>1000,25516=>1000,25517=>1000,25518=>1000,25519=>1000,25520=>1000,25521=>1000,25522=>1000,25523=>1000,25524=>1000, - 25525=>1000,25526=>1000,25527=>1000,25528=>1000,25529=>1000,25530=>1000,25531=>1000,25532=>1000,25533=>1000,25534=>1000,25535=>1000,25536=>1000,25537=>1000,25538=>1000,25539=>1000,25540=>1000, - 25541=>1000,25542=>1000,25543=>1000,25544=>1000,25545=>1000,25546=>1000,25547=>1000,25548=>1000,25549=>1000,25550=>1000,25551=>1000,25552=>1000,25553=>1000,25554=>1000,25555=>1000,25556=>1000, - 25557=>1000,25558=>1000,25559=>1000,25560=>1000,25561=>1000,25562=>1000,25563=>1000,25564=>1000,25565=>1000,25566=>1000,25567=>1000,25568=>1000,25569=>1000,25570=>1000,25571=>1000,25572=>1000, - 25573=>1000,25574=>1000,25575=>1000,25576=>1000,25577=>1000,25578=>1000,25579=>1000,25580=>1000,25581=>1000,25582=>1000,25583=>1000,25584=>1000,25585=>1000,25586=>1000,25587=>1000,25588=>1000, - 25589=>1000,25590=>1000,25591=>1000,25592=>1000,25593=>1000,25594=>1000,25595=>1000,25596=>1000,25597=>1000,25598=>1000,25599=>1000,25600=>1000,25601=>1000,25602=>1000,25603=>1000,25604=>1000, - 25605=>1000,25606=>1000,25607=>1000,25608=>1000,25609=>1000,25610=>1000,25611=>1000,25612=>1000,25613=>1000,25614=>1000,25615=>1000,25616=>1000,25617=>1000,25618=>1000,25619=>1000,25620=>1000, - 25621=>1000,25622=>1000,25623=>1000,25624=>1000,25625=>1000,25626=>1000,25627=>1000,25628=>1000,25629=>1000,25630=>1000,25631=>1000,25632=>1000,25633=>1000,25634=>1000,25635=>1000,25636=>1000, - 25637=>1000,25638=>1000,25639=>1000,25640=>1000,25641=>1000,25642=>1000,25643=>1000,25644=>1000,25645=>1000,25646=>1000,25647=>1000,25648=>1000,25649=>1000,25650=>1000,25651=>1000,25652=>1000, - 25653=>1000,25654=>1000,25655=>1000,25656=>1000,25657=>1000,25658=>1000,25659=>1000,25660=>1000,25661=>1000,25662=>1000,25663=>1000,25664=>1000,25665=>1000,25666=>1000,25667=>1000,25668=>1000, - 25669=>1000,25670=>1000,25671=>1000,25672=>1000,25673=>1000,25674=>1000,25675=>1000,25676=>1000,25677=>1000,25678=>1000,25679=>1000,25680=>1000,25681=>1000,25682=>1000,25683=>1000,25684=>1000, - 25685=>1000,25686=>1000,25687=>1000,25688=>1000,25689=>1000,25690=>1000,25691=>1000,25692=>1000,25693=>1000,25694=>1000,25695=>1000,25696=>1000,25697=>1000,25698=>1000,25699=>1000,25700=>1000, - 25701=>1000,25702=>1000,25703=>1000,25704=>1000,25705=>1000,25706=>1000,25707=>1000,25708=>1000,25709=>1000,25710=>1000,25711=>1000,25712=>1000,25713=>1000,25714=>1000,25715=>1000,25716=>1000, - 25717=>1000,25718=>1000,25719=>1000,25720=>1000,25721=>1000,25722=>1000,25723=>1000,25724=>1000,25725=>1000,25726=>1000,25727=>1000,25728=>1000,25729=>1000,25730=>1000,25731=>1000,25732=>1000, - 25733=>1000,25734=>1000,25735=>1000,25736=>1000,25737=>1000,25738=>1000,25739=>1000,25740=>1000,25741=>1000,25742=>1000,25743=>1000,25744=>1000,25745=>1000,25746=>1000,25747=>1000,25748=>1000, - 25749=>1000,25750=>1000,25751=>1000,25752=>1000,25753=>1000,25754=>1000,25755=>1000,25756=>1000,25757=>1000,25758=>1000,25759=>1000,25760=>1000,25761=>1000,25762=>1000,25763=>1000,25764=>1000, - 25765=>1000,25766=>1000,25767=>1000,25768=>1000,25769=>1000,25770=>1000,25771=>1000,25772=>1000,25773=>1000,25774=>1000,25775=>1000,25776=>1000,25777=>1000,25778=>1000,25779=>1000,25780=>1000, - 25781=>1000,25782=>1000,25783=>1000,25784=>1000,25785=>1000,25786=>1000,25787=>1000,25788=>1000,25789=>1000,25790=>1000,25791=>1000,25792=>1000,25793=>1000,25794=>1000,25795=>1000,25796=>1000, - 25797=>1000,25798=>1000,25799=>1000,25800=>1000,25801=>1000,25802=>1000,25803=>1000,25804=>1000,25805=>1000,25806=>1000,25807=>1000,25808=>1000,25809=>1000,25810=>1000,25811=>1000,25812=>1000, - 25813=>1000,25814=>1000,25815=>1000,25816=>1000,25817=>1000,25818=>1000,25819=>1000,25820=>1000,25821=>1000,25822=>1000,25823=>1000,25824=>1000,25825=>1000,25826=>1000,25827=>1000,25828=>1000, - 25829=>1000,25830=>1000,25831=>1000,25832=>1000,25833=>1000,25834=>1000,25835=>1000,25836=>1000,25837=>1000,25838=>1000,25839=>1000,25840=>1000,25841=>1000,25842=>1000,25843=>1000,25844=>1000, - 25845=>1000,25846=>1000,25847=>1000,25848=>1000,25849=>1000,25850=>1000,25851=>1000,25852=>1000,25853=>1000,25854=>1000,25855=>1000,25856=>1000,25857=>1000,25858=>1000,25859=>1000,25860=>1000, - 25861=>1000,25862=>1000,25863=>1000,25864=>1000,25865=>1000,25866=>1000,25867=>1000,25868=>1000,25869=>1000,25870=>1000,25871=>1000,25872=>1000,25873=>1000,25874=>1000,25875=>1000,25876=>1000, - 25877=>1000,25878=>1000,25879=>1000,25880=>1000,25881=>1000,25882=>1000,25883=>1000,25884=>1000,25885=>1000,25886=>1000,25887=>1000,25888=>1000,25889=>1000,25890=>1000,25891=>1000,25892=>1000, - 25893=>1000,25894=>1000,25895=>1000,25896=>1000,25897=>1000,25898=>1000,25899=>1000,25900=>1000,25901=>1000,25902=>1000,25903=>1000,25904=>1000,25905=>1000,25906=>1000,25907=>1000,25908=>1000, - 25909=>1000,25910=>1000,25911=>1000,25912=>1000,25913=>1000,25914=>1000,25915=>1000,25916=>1000,25917=>1000,25918=>1000,25919=>1000,25920=>1000,25921=>1000,25922=>1000,25923=>1000,25924=>1000, - 25925=>1000,25926=>1000,25927=>1000,25928=>1000,25929=>1000,25930=>1000,25931=>1000,25932=>1000,25933=>1000,25934=>1000,25935=>1000,25936=>1000,25937=>1000,25938=>1000,25939=>1000,25940=>1000, - 25941=>1000,25942=>1000,25943=>1000,25944=>1000,25945=>1000,25946=>1000,25947=>1000,25948=>1000,25949=>1000,25950=>1000,25951=>1000,25952=>1000,25953=>1000,25954=>1000,25955=>1000,25956=>1000, - 25957=>1000,25958=>1000,25959=>1000,25960=>1000,25961=>1000,25962=>1000,25963=>1000,25964=>1000,25965=>1000,25966=>1000,25967=>1000,25968=>1000,25969=>1000,25970=>1000,25971=>1000,25972=>1000, - 25973=>1000,25974=>1000,25975=>1000,25976=>1000,25977=>1000,25978=>1000,25979=>1000,25980=>1000,25981=>1000,25982=>1000,25983=>1000,25984=>1000,25985=>1000,25986=>1000,25987=>1000,25988=>1000, - 25989=>1000,25990=>1000,25991=>1000,25992=>1000,25993=>1000,25994=>1000,25995=>1000,25996=>1000,25997=>1000,25998=>1000,25999=>1000,26000=>1000,26001=>1000,26002=>1000,26003=>1000,26004=>1000, - 26005=>1000,26006=>1000,26007=>1000,26008=>1000,26009=>1000,26010=>1000,26011=>1000,26012=>1000,26013=>1000,26014=>1000,26015=>1000,26016=>1000,26017=>1000,26018=>1000,26019=>1000,26020=>1000, - 26021=>1000,26022=>1000,26023=>1000,26024=>1000,26025=>1000,26026=>1000,26027=>1000,26028=>1000,26029=>1000,26030=>1000,26031=>1000,26032=>1000,26033=>1000,26034=>1000,26035=>1000,26036=>1000, - 26037=>1000,26038=>1000,26039=>1000,26040=>1000,26041=>1000,26042=>1000,26043=>1000,26044=>1000,26045=>1000,26046=>1000,26047=>1000,26048=>1000,26049=>1000,26050=>1000,26051=>1000,26052=>1000, - 26053=>1000,26054=>1000,26055=>1000,26056=>1000,26057=>1000,26058=>1000,26059=>1000,26060=>1000,26061=>1000,26062=>1000,26063=>1000,26064=>1000,26065=>1000,26066=>1000,26067=>1000,26068=>1000, - 26069=>1000,26070=>1000,26071=>1000,26072=>1000,26073=>1000,26074=>1000,26075=>1000,26076=>1000,26077=>1000,26078=>1000,26079=>1000,26080=>1000,26081=>1000,26082=>1000,26083=>1000,26084=>1000, - 26085=>1000,26086=>1000,26087=>1000,26088=>1000,26089=>1000,26090=>1000,26091=>1000,26092=>1000,26093=>1000,26094=>1000,26095=>1000,26096=>1000,26097=>1000,26098=>1000,26099=>1000,26100=>1000, - 26101=>1000,26102=>1000,26103=>1000,26104=>1000,26105=>1000,26106=>1000,26107=>1000,26108=>1000,26109=>1000,26110=>1000,26111=>1000,26112=>1000,26113=>1000,26114=>1000,26115=>1000,26116=>1000, - 26117=>1000,26118=>1000,26119=>1000,26120=>1000,26121=>1000,26122=>1000,26123=>1000,26124=>1000,26125=>1000,26126=>1000,26127=>1000,26128=>1000,26129=>1000,26130=>1000,26131=>1000,26132=>1000, - 26133=>1000,26134=>1000,26135=>1000,26136=>1000,26137=>1000,26138=>1000,26139=>1000,26140=>1000,26141=>1000,26142=>1000,26143=>1000,26144=>1000,26145=>1000,26146=>1000,26147=>1000,26148=>1000, - 26149=>1000,26150=>1000,26151=>1000,26152=>1000,26153=>1000,26154=>1000,26155=>1000,26156=>1000,26157=>1000,26158=>1000,26159=>1000,26160=>1000,26161=>1000,26162=>1000,26163=>1000,26164=>1000, - 26165=>1000,26166=>1000,26167=>1000,26168=>1000,26169=>1000,26170=>1000,26171=>1000,26172=>1000,26173=>1000,26174=>1000,26175=>1000,26176=>1000,26177=>1000,26178=>1000,26179=>1000,26180=>1000, - 26181=>1000,26182=>1000,26183=>1000,26184=>1000,26185=>1000,26186=>1000,26187=>1000,26188=>1000,26189=>1000,26190=>1000,26191=>1000,26192=>1000,26193=>1000,26194=>1000,26195=>1000,26196=>1000, - 26197=>1000,26198=>1000,26199=>1000,26200=>1000,26201=>1000,26202=>1000,26203=>1000,26204=>1000,26205=>1000,26206=>1000,26207=>1000,26208=>1000,26209=>1000,26210=>1000,26211=>1000,26212=>1000, - 26213=>1000,26214=>1000,26215=>1000,26216=>1000,26217=>1000,26218=>1000,26219=>1000,26220=>1000,26221=>1000,26222=>1000,26223=>1000,26224=>1000,26225=>1000,26226=>1000,26227=>1000,26228=>1000, - 26229=>1000,26230=>1000,26231=>1000,26232=>1000,26233=>1000,26234=>1000,26235=>1000,26236=>1000,26237=>1000,26238=>1000,26239=>1000,26240=>1000,26241=>1000,26242=>1000,26243=>1000,26244=>1000, - 26245=>1000,26246=>1000,26247=>1000,26248=>1000,26249=>1000,26250=>1000,26251=>1000,26252=>1000,26253=>1000,26254=>1000,26255=>1000,26256=>1000,26257=>1000,26258=>1000,26259=>1000,26260=>1000, - 26261=>1000,26262=>1000,26263=>1000,26264=>1000,26265=>1000,26266=>1000,26267=>1000,26268=>1000,26269=>1000,26270=>1000,26271=>1000,26272=>1000,26273=>1000,26274=>1000,26275=>1000,26276=>1000, - 26277=>1000,26278=>1000,26279=>1000,26280=>1000,26281=>1000,26282=>1000,26283=>1000,26284=>1000,26285=>1000,26286=>1000,26287=>1000,26288=>1000,26289=>1000,26290=>1000,26291=>1000,26292=>1000, - 26293=>1000,26294=>1000,26295=>1000,26296=>1000,26297=>1000,26298=>1000,26299=>1000,26300=>1000,26301=>1000,26302=>1000,26303=>1000,26304=>1000,26305=>1000,26306=>1000,26307=>1000,26308=>1000, - 26309=>1000,26310=>1000,26311=>1000,26312=>1000,26313=>1000,26314=>1000,26315=>1000,26316=>1000,26317=>1000,26318=>1000,26319=>1000,26320=>1000,26321=>1000,26322=>1000,26323=>1000,26324=>1000, - 26325=>1000,26326=>1000,26327=>1000,26328=>1000,26329=>1000,26330=>1000,26331=>1000,26332=>1000,26333=>1000,26334=>1000,26335=>1000,26336=>1000,26337=>1000,26338=>1000,26339=>1000,26340=>1000, - 26341=>1000,26342=>1000,26343=>1000,26344=>1000,26345=>1000,26346=>1000,26347=>1000,26348=>1000,26349=>1000,26350=>1000,26351=>1000,26352=>1000,26353=>1000,26354=>1000,26355=>1000,26356=>1000, - 26357=>1000,26358=>1000,26359=>1000,26360=>1000,26361=>1000,26362=>1000,26363=>1000,26364=>1000,26365=>1000,26366=>1000,26367=>1000,26368=>1000,26369=>1000,26370=>1000,26371=>1000,26372=>1000, - 26373=>1000,26374=>1000,26375=>1000,26376=>1000,26377=>1000,26378=>1000,26379=>1000,26380=>1000,26381=>1000,26382=>1000,26383=>1000,26384=>1000,26385=>1000,26386=>1000,26387=>1000,26388=>1000, - 26389=>1000,26390=>1000,26391=>1000,26392=>1000,26393=>1000,26394=>1000,26395=>1000,26396=>1000,26397=>1000,26398=>1000,26399=>1000,26400=>1000,26401=>1000,26402=>1000,26403=>1000,26404=>1000, - 26405=>1000,26406=>1000,26407=>1000,26408=>1000,26409=>1000,26410=>1000,26411=>1000,26412=>1000,26413=>1000,26414=>1000,26415=>1000,26416=>1000,26417=>1000,26418=>1000,26419=>1000,26420=>1000, - 26421=>1000,26422=>1000,26423=>1000,26424=>1000,26425=>1000,26426=>1000,26427=>1000,26428=>1000,26429=>1000,26430=>1000,26431=>1000,26432=>1000,26433=>1000,26434=>1000,26435=>1000,26436=>1000, - 26437=>1000,26438=>1000,26439=>1000,26440=>1000,26441=>1000,26442=>1000,26443=>1000,26444=>1000,26445=>1000,26446=>1000,26447=>1000,26448=>1000,26449=>1000,26450=>1000,26451=>1000,26452=>1000, - 26453=>1000,26454=>1000,26455=>1000,26456=>1000,26457=>1000,26458=>1000,26459=>1000,26460=>1000,26461=>1000,26462=>1000,26463=>1000,26464=>1000,26465=>1000,26466=>1000,26467=>1000,26468=>1000, - 26469=>1000,26470=>1000,26471=>1000,26472=>1000,26473=>1000,26474=>1000,26475=>1000,26476=>1000,26477=>1000,26478=>1000,26479=>1000,26480=>1000,26481=>1000,26482=>1000,26483=>1000,26484=>1000, - 26485=>1000,26486=>1000,26487=>1000,26488=>1000,26489=>1000,26490=>1000,26491=>1000,26492=>1000,26493=>1000,26494=>1000,26495=>1000,26496=>1000,26497=>1000,26498=>1000,26499=>1000,26500=>1000, - 26501=>1000,26502=>1000,26503=>1000,26504=>1000,26505=>1000,26506=>1000,26507=>1000,26508=>1000,26509=>1000,26510=>1000,26511=>1000,26512=>1000,26513=>1000,26514=>1000,26515=>1000,26516=>1000, - 26517=>1000,26518=>1000,26519=>1000,26520=>1000,26521=>1000,26522=>1000,26523=>1000,26524=>1000,26525=>1000,26526=>1000,26527=>1000,26528=>1000,26529=>1000,26530=>1000,26531=>1000,26532=>1000, - 26533=>1000,26534=>1000,26535=>1000,26536=>1000,26537=>1000,26538=>1000,26539=>1000,26540=>1000,26541=>1000,26542=>1000,26543=>1000,26544=>1000,26545=>1000,26546=>1000,26547=>1000,26548=>1000, - 26549=>1000,26550=>1000,26551=>1000,26552=>1000,26553=>1000,26554=>1000,26555=>1000,26556=>1000,26557=>1000,26558=>1000,26559=>1000,26560=>1000,26561=>1000,26562=>1000,26563=>1000,26564=>1000, - 26565=>1000,26566=>1000,26567=>1000,26568=>1000,26569=>1000,26570=>1000,26571=>1000,26572=>1000,26573=>1000,26574=>1000,26575=>1000,26576=>1000,26577=>1000,26578=>1000,26579=>1000,26580=>1000, - 26581=>1000,26582=>1000,26583=>1000,26584=>1000,26585=>1000,26586=>1000,26587=>1000,26588=>1000,26589=>1000,26590=>1000,26591=>1000,26592=>1000,26593=>1000,26594=>1000,26595=>1000,26596=>1000, - 26597=>1000,26598=>1000,26599=>1000,26600=>1000,26601=>1000,26602=>1000,26603=>1000,26604=>1000,26605=>1000,26606=>1000,26607=>1000,26608=>1000,26609=>1000,26610=>1000,26611=>1000,26612=>1000, - 26613=>1000,26614=>1000,26615=>1000,26616=>1000,26617=>1000,26618=>1000,26619=>1000,26620=>1000,26621=>1000,26622=>1000,26623=>1000,26624=>1000,26625=>1000,26626=>1000,26627=>1000,26628=>1000, - 26629=>1000,26630=>1000,26631=>1000,26632=>1000,26633=>1000,26634=>1000,26635=>1000,26636=>1000,26637=>1000,26638=>1000,26639=>1000,26640=>1000,26641=>1000,26642=>1000,26643=>1000,26644=>1000, - 26645=>1000,26646=>1000,26647=>1000,26648=>1000,26649=>1000,26650=>1000,26651=>1000,26652=>1000,26653=>1000,26654=>1000,26655=>1000,26656=>1000,26657=>1000,26658=>1000,26659=>1000,26660=>1000, - 26661=>1000,26662=>1000,26663=>1000,26664=>1000,26665=>1000,26666=>1000,26667=>1000,26668=>1000,26669=>1000,26670=>1000,26671=>1000,26672=>1000,26673=>1000,26674=>1000,26675=>1000,26676=>1000, - 26677=>1000,26678=>1000,26679=>1000,26680=>1000,26681=>1000,26682=>1000,26683=>1000,26684=>1000,26685=>1000,26686=>1000,26687=>1000,26688=>1000,26689=>1000,26690=>1000,26691=>1000,26692=>1000, - 26693=>1000,26694=>1000,26695=>1000,26696=>1000,26697=>1000,26698=>1000,26699=>1000,26700=>1000,26701=>1000,26702=>1000,26703=>1000,26704=>1000,26705=>1000,26706=>1000,26707=>1000,26708=>1000, - 26709=>1000,26710=>1000,26711=>1000,26712=>1000,26713=>1000,26714=>1000,26715=>1000,26716=>1000,26717=>1000,26718=>1000,26719=>1000,26720=>1000,26721=>1000,26722=>1000,26723=>1000,26724=>1000, - 26725=>1000,26726=>1000,26727=>1000,26728=>1000,26729=>1000,26730=>1000,26731=>1000,26732=>1000,26733=>1000,26734=>1000,26735=>1000,26736=>1000,26737=>1000,26738=>1000,26739=>1000,26740=>1000, - 26741=>1000,26742=>1000,26743=>1000,26744=>1000,26745=>1000,26746=>1000,26747=>1000,26748=>1000,26749=>1000,26750=>1000,26751=>1000,26752=>1000,26753=>1000,26754=>1000,26755=>1000,26756=>1000, - 26757=>1000,26758=>1000,26759=>1000,26760=>1000,26761=>1000,26762=>1000,26763=>1000,26764=>1000,26765=>1000,26766=>1000,26767=>1000,26768=>1000,26769=>1000,26770=>1000,26771=>1000,26772=>1000, - 26773=>1000,26774=>1000,26775=>1000,26776=>1000,26777=>1000,26778=>1000,26779=>1000,26780=>1000,26781=>1000,26782=>1000,26783=>1000,26784=>1000,26785=>1000,26786=>1000,26787=>1000,26788=>1000, - 26789=>1000,26790=>1000,26791=>1000,26792=>1000,26793=>1000,26794=>1000,26795=>1000,26796=>1000,26797=>1000,26798=>1000,26799=>1000,26800=>1000,26801=>1000,26802=>1000,26803=>1000,26804=>1000, - 26805=>1000,26806=>1000,26807=>1000,26808=>1000,26809=>1000,26810=>1000,26811=>1000,26812=>1000,26813=>1000,26814=>1000,26815=>1000,26816=>1000,26817=>1000,26818=>1000,26819=>1000,26820=>1000, - 26821=>1000,26822=>1000,26823=>1000,26824=>1000,26825=>1000,26826=>1000,26827=>1000,26828=>1000,26829=>1000,26830=>1000,26831=>1000,26832=>1000,26833=>1000,26834=>1000,26835=>1000,26836=>1000, - 26837=>1000,26838=>1000,26839=>1000,26840=>1000,26841=>1000,26842=>1000,26843=>1000,26844=>1000,26845=>1000,26846=>1000,26847=>1000,26848=>1000,26849=>1000,26850=>1000,26851=>1000,26852=>1000, - 26853=>1000,26854=>1000,26855=>1000,26856=>1000,26857=>1000,26858=>1000,26859=>1000,26860=>1000,26861=>1000,26862=>1000,26863=>1000,26864=>1000,26865=>1000,26866=>1000,26867=>1000,26868=>1000, - 26869=>1000,26870=>1000,26871=>1000,26872=>1000,26873=>1000,26874=>1000,26875=>1000,26876=>1000,26877=>1000,26878=>1000,26879=>1000,26880=>1000,26881=>1000,26882=>1000,26883=>1000,26884=>1000, - 26885=>1000,26886=>1000,26887=>1000,26888=>1000,26889=>1000,26890=>1000,26891=>1000,26892=>1000,26893=>1000,26894=>1000,26895=>1000,26896=>1000,26897=>1000,26898=>1000,26899=>1000,26900=>1000, - 26901=>1000,26902=>1000,26903=>1000,26904=>1000,26905=>1000,26906=>1000,26907=>1000,26908=>1000,26909=>1000,26910=>1000,26911=>1000,26912=>1000,26913=>1000,26914=>1000,26915=>1000,26916=>1000, - 26917=>1000,26918=>1000,26919=>1000,26920=>1000,26921=>1000,26922=>1000,26923=>1000,26924=>1000,26925=>1000,26926=>1000,26927=>1000,26928=>1000,26929=>1000,26930=>1000,26931=>1000,26932=>1000, - 26933=>1000,26934=>1000,26935=>1000,26936=>1000,26937=>1000,26938=>1000,26939=>1000,26940=>1000,26941=>1000,26942=>1000,26943=>1000,26944=>1000,26945=>1000,26946=>1000,26947=>1000,26948=>1000, - 26949=>1000,26950=>1000,26951=>1000,26952=>1000,26953=>1000,26954=>1000,26955=>1000,26956=>1000,26957=>1000,26958=>1000,26959=>1000,26960=>1000,26961=>1000,26962=>1000,26963=>1000,26964=>1000, - 26965=>1000,26966=>1000,26967=>1000,26968=>1000,26969=>1000,26970=>1000,26971=>1000,26972=>1000,26973=>1000,26974=>1000,26975=>1000,26976=>1000,26977=>1000,26978=>1000,26979=>1000,26980=>1000, - 26981=>1000,26982=>1000,26983=>1000,26984=>1000,26985=>1000,26986=>1000,26987=>1000,26988=>1000,26989=>1000,26990=>1000,26991=>1000,26992=>1000,26993=>1000,26994=>1000,26995=>1000,26996=>1000, - 26997=>1000,26998=>1000,26999=>1000,27000=>1000,27001=>1000,27002=>1000,27003=>1000,27004=>1000,27005=>1000,27006=>1000,27007=>1000,27008=>1000,27009=>1000,27010=>1000,27011=>1000,27012=>1000, - 27013=>1000,27014=>1000,27015=>1000,27016=>1000,27017=>1000,27018=>1000,27019=>1000,27020=>1000,27021=>1000,27022=>1000,27023=>1000,27024=>1000,27025=>1000,27026=>1000,27027=>1000,27028=>1000, - 27029=>1000,27030=>1000,27031=>1000,27032=>1000,27033=>1000,27034=>1000,27035=>1000,27036=>1000,27037=>1000,27038=>1000,27039=>1000,27040=>1000,27041=>1000,27042=>1000,27043=>1000,27044=>1000, - 27045=>1000,27046=>1000,27047=>1000,27048=>1000,27049=>1000,27050=>1000,27051=>1000,27052=>1000,27053=>1000,27054=>1000,27055=>1000,27056=>1000,27057=>1000,27058=>1000,27059=>1000,27060=>1000, - 27061=>1000,27062=>1000,27063=>1000,27064=>1000,27065=>1000,27066=>1000,27067=>1000,27068=>1000,27069=>1000,27070=>1000,27071=>1000,27072=>1000,27073=>1000,27074=>1000,27075=>1000,27076=>1000, - 27077=>1000,27078=>1000,27079=>1000,27080=>1000,27081=>1000,27082=>1000,27083=>1000,27084=>1000,27085=>1000,27086=>1000,27087=>1000,27088=>1000,27089=>1000,27090=>1000,27091=>1000,27092=>1000, - 27093=>1000,27094=>1000,27095=>1000,27096=>1000,27097=>1000,27098=>1000,27099=>1000,27100=>1000,27101=>1000,27102=>1000,27103=>1000,27104=>1000,27105=>1000,27106=>1000,27107=>1000,27108=>1000, - 27109=>1000,27110=>1000,27111=>1000,27112=>1000,27113=>1000,27114=>1000,27115=>1000,27116=>1000,27117=>1000,27118=>1000,27119=>1000,27120=>1000,27121=>1000,27122=>1000,27123=>1000,27124=>1000, - 27125=>1000,27126=>1000,27127=>1000,27128=>1000,27129=>1000,27130=>1000,27131=>1000,27132=>1000,27133=>1000,27134=>1000,27135=>1000,27136=>1000,27137=>1000,27138=>1000,27139=>1000,27140=>1000, - 27141=>1000,27142=>1000,27143=>1000,27144=>1000,27145=>1000,27146=>1000,27147=>1000,27148=>1000,27149=>1000,27150=>1000,27151=>1000,27152=>1000,27153=>1000,27154=>1000,27155=>1000,27156=>1000, - 27157=>1000,27158=>1000,27159=>1000,27160=>1000,27161=>1000,27162=>1000,27163=>1000,27164=>1000,27165=>1000,27166=>1000,27167=>1000,27168=>1000,27169=>1000,27170=>1000,27171=>1000,27172=>1000, - 27173=>1000,27174=>1000,27175=>1000,27176=>1000,27177=>1000,27178=>1000,27179=>1000,27180=>1000,27181=>1000,27182=>1000,27183=>1000,27184=>1000,27185=>1000,27186=>1000,27187=>1000,27188=>1000, - 27189=>1000,27190=>1000,27191=>1000,27192=>1000,27193=>1000,27194=>1000,27195=>1000,27196=>1000,27197=>1000,27198=>1000,27199=>1000,27200=>1000,27201=>1000,27202=>1000,27203=>1000,27204=>1000, - 27205=>1000,27206=>1000,27207=>1000,27208=>1000,27209=>1000,27210=>1000,27211=>1000,27212=>1000,27213=>1000,27214=>1000,27215=>1000,27216=>1000,27217=>1000,27218=>1000,27219=>1000,27220=>1000, - 27221=>1000,27222=>1000,27223=>1000,27224=>1000,27225=>1000,27226=>1000,27227=>1000,27228=>1000,27229=>1000,27230=>1000,27231=>1000,27232=>1000,27233=>1000,27234=>1000,27235=>1000,27236=>1000, - 27237=>1000,27238=>1000,27239=>1000,27240=>1000,27241=>1000,27242=>1000,27243=>1000,27244=>1000,27245=>1000,27246=>1000,27247=>1000,27248=>1000,27249=>1000,27250=>1000,27251=>1000,27252=>1000, - 27253=>1000,27254=>1000,27255=>1000,27256=>1000,27257=>1000,27258=>1000,27259=>1000,27260=>1000,27261=>1000,27262=>1000,27263=>1000,27264=>1000,27265=>1000,27266=>1000,27267=>1000,27268=>1000, - 27269=>1000,27270=>1000,27271=>1000,27272=>1000,27273=>1000,27274=>1000,27275=>1000,27276=>1000,27277=>1000,27278=>1000,27279=>1000,27280=>1000,27281=>1000,27282=>1000,27283=>1000,27284=>1000, - 27285=>1000,27286=>1000,27287=>1000,27288=>1000,27289=>1000,27290=>1000,27291=>1000,27292=>1000,27293=>1000,27294=>1000,27295=>1000,27296=>1000,27297=>1000,27298=>1000,27299=>1000,27300=>1000, - 27301=>1000,27302=>1000,27303=>1000,27304=>1000,27305=>1000,27306=>1000,27307=>1000,27308=>1000,27309=>1000,27310=>1000,27311=>1000,27312=>1000,27313=>1000,27314=>1000,27315=>1000,27316=>1000, - 27317=>1000,27318=>1000,27319=>1000,27320=>1000,27321=>1000,27322=>1000,27323=>1000,27324=>1000,27325=>1000,27326=>1000,27327=>1000,27328=>1000,27329=>1000,27330=>1000,27331=>1000,27332=>1000, - 27333=>1000,27334=>1000,27335=>1000,27336=>1000,27337=>1000,27338=>1000,27339=>1000,27340=>1000,27341=>1000,27342=>1000,27343=>1000,27344=>1000,27345=>1000,27346=>1000,27347=>1000,27348=>1000, - 27349=>1000,27350=>1000,27351=>1000,27352=>1000,27353=>1000,27354=>1000,27355=>1000,27356=>1000,27357=>1000,27358=>1000,27359=>1000,27360=>1000,27361=>1000,27362=>1000,27363=>1000,27364=>1000, - 27365=>1000,27366=>1000,27367=>1000,27368=>1000,27369=>1000,27370=>1000,27371=>1000,27372=>1000,27373=>1000,27374=>1000,27375=>1000,27376=>1000,27377=>1000,27378=>1000,27379=>1000,27380=>1000, - 27381=>1000,27382=>1000,27383=>1000,27384=>1000,27385=>1000,27386=>1000,27387=>1000,27388=>1000,27389=>1000,27390=>1000,27391=>1000,27392=>1000,27393=>1000,27394=>1000,27395=>1000,27396=>1000, - 27397=>1000,27398=>1000,27399=>1000,27400=>1000,27401=>1000,27402=>1000,27403=>1000,27404=>1000,27405=>1000,27406=>1000,27407=>1000,27408=>1000,27409=>1000,27410=>1000,27411=>1000,27412=>1000, - 27413=>1000,27414=>1000,27415=>1000,27416=>1000,27417=>1000,27418=>1000,27419=>1000,27420=>1000,27421=>1000,27422=>1000,27423=>1000,27424=>1000,27425=>1000,27426=>1000,27427=>1000,27428=>1000, - 27429=>1000,27430=>1000,27431=>1000,27432=>1000,27433=>1000,27434=>1000,27435=>1000,27436=>1000,27437=>1000,27438=>1000,27439=>1000,27440=>1000,27441=>1000,27442=>1000,27443=>1000,27444=>1000, - 27445=>1000,27446=>1000,27447=>1000,27448=>1000,27449=>1000,27450=>1000,27451=>1000,27452=>1000,27453=>1000,27454=>1000,27455=>1000,27456=>1000,27457=>1000,27458=>1000,27459=>1000,27460=>1000, - 27461=>1000,27462=>1000,27463=>1000,27464=>1000,27465=>1000,27466=>1000,27467=>1000,27468=>1000,27469=>1000,27470=>1000,27471=>1000,27472=>1000,27473=>1000,27474=>1000,27475=>1000,27476=>1000, - 27477=>1000,27478=>1000,27479=>1000,27480=>1000,27481=>1000,27482=>1000,27483=>1000,27484=>1000,27485=>1000,27486=>1000,27487=>1000,27488=>1000,27489=>1000,27490=>1000,27491=>1000,27492=>1000, - 27493=>1000,27494=>1000,27495=>1000,27496=>1000,27497=>1000,27498=>1000,27499=>1000,27500=>1000,27501=>1000,27502=>1000,27503=>1000,27504=>1000,27505=>1000,27506=>1000,27507=>1000,27508=>1000, - 27509=>1000,27510=>1000,27511=>1000,27512=>1000,27513=>1000,27514=>1000,27515=>1000,27516=>1000,27517=>1000,27518=>1000,27519=>1000,27520=>1000,27521=>1000,27522=>1000,27523=>1000,27524=>1000, - 27525=>1000,27526=>1000,27527=>1000,27528=>1000,27529=>1000,27530=>1000,27531=>1000,27532=>1000,27533=>1000,27534=>1000,27535=>1000,27536=>1000,27537=>1000,27538=>1000,27539=>1000,27540=>1000, - 27541=>1000,27542=>1000,27543=>1000,27544=>1000,27545=>1000,27546=>1000,27547=>1000,27548=>1000,27549=>1000,27550=>1000,27551=>1000,27552=>1000,27553=>1000,27554=>1000,27555=>1000,27556=>1000, - 27557=>1000,27558=>1000,27559=>1000,27560=>1000,27561=>1000,27562=>1000,27563=>1000,27564=>1000,27565=>1000,27566=>1000,27567=>1000,27568=>1000,27569=>1000,27570=>1000,27571=>1000,27572=>1000, - 27573=>1000,27574=>1000,27575=>1000,27576=>1000,27577=>1000,27578=>1000,27579=>1000,27580=>1000,27581=>1000,27582=>1000,27583=>1000,27584=>1000,27585=>1000,27586=>1000,27587=>1000,27588=>1000, - 27589=>1000,27590=>1000,27591=>1000,27592=>1000,27593=>1000,27594=>1000,27595=>1000,27596=>1000,27597=>1000,27598=>1000,27599=>1000,27600=>1000,27601=>1000,27602=>1000,27603=>1000,27604=>1000, - 27605=>1000,27606=>1000,27607=>1000,27608=>1000,27609=>1000,27610=>1000,27611=>1000,27612=>1000,27613=>1000,27614=>1000,27615=>1000,27616=>1000,27617=>1000,27618=>1000,27619=>1000,27620=>1000, - 27621=>1000,27622=>1000,27623=>1000,27624=>1000,27625=>1000,27626=>1000,27627=>1000,27628=>1000,27629=>1000,27630=>1000,27631=>1000,27632=>1000,27633=>1000,27634=>1000,27635=>1000,27636=>1000, - 27637=>1000,27638=>1000,27639=>1000,27640=>1000,27641=>1000,27642=>1000,27643=>1000,27644=>1000,27645=>1000,27646=>1000,27647=>1000,27648=>1000,27649=>1000,27650=>1000,27651=>1000,27652=>1000, - 27653=>1000,27654=>1000,27655=>1000,27656=>1000,27657=>1000,27658=>1000,27659=>1000,27660=>1000,27661=>1000,27662=>1000,27663=>1000,27664=>1000,27665=>1000,27666=>1000,27667=>1000,27668=>1000, - 27669=>1000,27670=>1000,27671=>1000,27672=>1000,27673=>1000,27674=>1000,27675=>1000,27676=>1000,27677=>1000,27678=>1000,27679=>1000,27680=>1000,27681=>1000,27682=>1000,27683=>1000,27684=>1000, - 27685=>1000,27686=>1000,27687=>1000,27688=>1000,27689=>1000,27690=>1000,27691=>1000,27692=>1000,27693=>1000,27694=>1000,27695=>1000,27696=>1000,27697=>1000,27698=>1000,27699=>1000,27700=>1000, - 27701=>1000,27702=>1000,27703=>1000,27704=>1000,27705=>1000,27706=>1000,27707=>1000,27708=>1000,27709=>1000,27710=>1000,27711=>1000,27712=>1000,27713=>1000,27714=>1000,27715=>1000,27716=>1000, - 27717=>1000,27718=>1000,27719=>1000,27720=>1000,27721=>1000,27722=>1000,27723=>1000,27724=>1000,27725=>1000,27726=>1000,27727=>1000,27728=>1000,27729=>1000,27730=>1000,27731=>1000,27732=>1000, - 27733=>1000,27734=>1000,27735=>1000,27736=>1000,27737=>1000,27738=>1000,27739=>1000,27740=>1000,27741=>1000,27742=>1000,27743=>1000,27744=>1000,27745=>1000,27746=>1000,27747=>1000,27748=>1000, - 27749=>1000,27750=>1000,27751=>1000,27752=>1000,27753=>1000,27754=>1000,27755=>1000,27756=>1000,27757=>1000,27758=>1000,27759=>1000,27760=>1000,27761=>1000,27762=>1000,27763=>1000,27764=>1000, - 27765=>1000,27766=>1000,27767=>1000,27768=>1000,27769=>1000,27770=>1000,27771=>1000,27772=>1000,27773=>1000,27774=>1000,27775=>1000,27776=>1000,27777=>1000,27778=>1000,27779=>1000,27780=>1000, - 27781=>1000,27782=>1000,27783=>1000,27784=>1000,27785=>1000,27786=>1000,27787=>1000,27788=>1000,27789=>1000,27790=>1000,27791=>1000,27792=>1000,27793=>1000,27794=>1000,27795=>1000,27796=>1000, - 27797=>1000,27798=>1000,27799=>1000,27800=>1000,27801=>1000,27802=>1000,27803=>1000,27804=>1000,27805=>1000,27806=>1000,27807=>1000,27808=>1000,27809=>1000,27810=>1000,27811=>1000,27812=>1000, - 27813=>1000,27814=>1000,27815=>1000,27816=>1000,27817=>1000,27818=>1000,27819=>1000,27820=>1000,27821=>1000,27822=>1000,27823=>1000,27824=>1000,27825=>1000,27826=>1000,27827=>1000,27828=>1000, - 27829=>1000,27830=>1000,27831=>1000,27832=>1000,27833=>1000,27834=>1000,27835=>1000,27836=>1000,27837=>1000,27838=>1000,27839=>1000,27840=>1000,27841=>1000,27842=>1000,27843=>1000,27844=>1000, - 27845=>1000,27846=>1000,27847=>1000,27848=>1000,27849=>1000,27850=>1000,27851=>1000,27852=>1000,27853=>1000,27854=>1000,27855=>1000,27856=>1000,27857=>1000,27858=>1000,27859=>1000,27860=>1000, - 27861=>1000,27862=>1000,27863=>1000,27864=>1000,27865=>1000,27866=>1000,27867=>1000,27868=>1000,27869=>1000,27870=>1000,27871=>1000,27872=>1000,27873=>1000,27874=>1000,27875=>1000,27876=>1000, - 27877=>1000,27878=>1000,27879=>1000,27880=>1000,27881=>1000,27882=>1000,27883=>1000,27884=>1000,27885=>1000,27886=>1000,27887=>1000,27888=>1000,27889=>1000,27890=>1000,27891=>1000,27892=>1000, - 27893=>1000,27894=>1000,27895=>1000,27896=>1000,27897=>1000,27898=>1000,27899=>1000,27900=>1000,27901=>1000,27902=>1000,27903=>1000,27904=>1000,27905=>1000,27906=>1000,27907=>1000,27908=>1000, - 27909=>1000,27910=>1000,27911=>1000,27912=>1000,27913=>1000,27914=>1000,27915=>1000,27916=>1000,27917=>1000,27918=>1000,27919=>1000,27920=>1000,27921=>1000,27922=>1000,27923=>1000,27924=>1000, - 27925=>1000,27926=>1000,27927=>1000,27928=>1000,27929=>1000,27930=>1000,27931=>1000,27932=>1000,27933=>1000,27934=>1000,27935=>1000,27936=>1000,27937=>1000,27938=>1000,27939=>1000,27940=>1000, - 27941=>1000,27942=>1000,27943=>1000,27944=>1000,27945=>1000,27946=>1000,27947=>1000,27948=>1000,27949=>1000,27950=>1000,27951=>1000,27952=>1000,27953=>1000,27954=>1000,27955=>1000,27956=>1000, - 27957=>1000,27958=>1000,27959=>1000,27960=>1000,27961=>1000,27962=>1000,27963=>1000,27964=>1000,27965=>1000,27966=>1000,27967=>1000,27968=>1000,27969=>1000,27970=>1000,27971=>1000,27972=>1000, - 27973=>1000,27974=>1000,27975=>1000,27976=>1000,27977=>1000,27978=>1000,27979=>1000,27980=>1000,27981=>1000,27982=>1000,27983=>1000,27984=>1000,27985=>1000,27986=>1000,27987=>1000,27988=>1000, - 27989=>1000,27990=>1000,27991=>1000,27992=>1000,27993=>1000,27994=>1000,27995=>1000,27996=>1000,27997=>1000,27998=>1000,27999=>1000,28000=>1000,28001=>1000,28002=>1000,28003=>1000,28004=>1000, - 28005=>1000,28006=>1000,28007=>1000,28008=>1000,28009=>1000,28010=>1000,28011=>1000,28012=>1000,28013=>1000,28014=>1000,28015=>1000,28016=>1000,28017=>1000,28018=>1000,28019=>1000,28020=>1000, - 28021=>1000,28022=>1000,28023=>1000,28024=>1000,28025=>1000,28026=>1000,28027=>1000,28028=>1000,28029=>1000,28030=>1000,28031=>1000,28032=>1000,28033=>1000,28034=>1000,28035=>1000,28036=>1000, - 28037=>1000,28038=>1000,28039=>1000,28040=>1000,28041=>1000,28042=>1000,28043=>1000,28044=>1000,28045=>1000,28046=>1000,28047=>1000,28048=>1000,28049=>1000,28050=>1000,28051=>1000,28052=>1000, - 28053=>1000,28054=>1000,28055=>1000,28056=>1000,28057=>1000,28058=>1000,28059=>1000,28060=>1000,28061=>1000,28062=>1000,28063=>1000,28064=>1000,28065=>1000,28066=>1000,28067=>1000,28068=>1000, - 28069=>1000,28070=>1000,28071=>1000,28072=>1000,28073=>1000,28074=>1000,28075=>1000,28076=>1000,28077=>1000,28078=>1000,28079=>1000,28080=>1000,28081=>1000,28082=>1000,28083=>1000,28084=>1000, - 28085=>1000,28086=>1000,28087=>1000,28088=>1000,28089=>1000,28090=>1000,28091=>1000,28092=>1000,28093=>1000,28094=>1000,28095=>1000,28096=>1000,28097=>1000,28098=>1000,28099=>1000,28100=>1000, - 28101=>1000,28102=>1000,28103=>1000,28104=>1000,28105=>1000,28106=>1000,28107=>1000,28108=>1000,28109=>1000,28110=>1000,28111=>1000,28112=>1000,28113=>1000,28114=>1000,28115=>1000,28116=>1000, - 28117=>1000,28118=>1000,28119=>1000,28120=>1000,28121=>1000,28122=>1000,28123=>1000,28124=>1000,28125=>1000,28126=>1000,28127=>1000,28128=>1000,28129=>1000,28130=>1000,28131=>1000,28132=>1000, - 28133=>1000,28134=>1000,28135=>1000,28136=>1000,28137=>1000,28138=>1000,28139=>1000,28140=>1000,28141=>1000,28142=>1000,28143=>1000,28144=>1000,28145=>1000,28146=>1000,28147=>1000,28148=>1000, - 28149=>1000,28150=>1000,28151=>1000,28152=>1000,28153=>1000,28154=>1000,28155=>1000,28156=>1000,28157=>1000,28158=>1000,28159=>1000,28160=>1000,28161=>1000,28162=>1000,28163=>1000,28164=>1000, - 28165=>1000,28166=>1000,28167=>1000,28168=>1000,28169=>1000,28170=>1000,28171=>1000,28172=>1000,28173=>1000,28174=>1000,28175=>1000,28176=>1000,28177=>1000,28178=>1000,28179=>1000,28180=>1000, - 28181=>1000,28182=>1000,28183=>1000,28184=>1000,28185=>1000,28186=>1000,28187=>1000,28188=>1000,28189=>1000,28190=>1000,28191=>1000,28192=>1000,28193=>1000,28194=>1000,28195=>1000,28196=>1000, - 28197=>1000,28198=>1000,28199=>1000,28200=>1000,28201=>1000,28202=>1000,28203=>1000,28204=>1000,28205=>1000,28206=>1000,28207=>1000,28208=>1000,28209=>1000,28210=>1000,28211=>1000,28212=>1000, - 28213=>1000,28214=>1000,28215=>1000,28216=>1000,28217=>1000,28218=>1000,28219=>1000,28220=>1000,28221=>1000,28222=>1000,28223=>1000,28224=>1000,28225=>1000,28226=>1000,28227=>1000,28228=>1000, - 28229=>1000,28230=>1000,28231=>1000,28232=>1000,28233=>1000,28234=>1000,28235=>1000,28236=>1000,28237=>1000,28238=>1000,28239=>1000,28240=>1000,28241=>1000,28242=>1000,28243=>1000,28244=>1000, - 28245=>1000,28246=>1000,28247=>1000,28248=>1000,28249=>1000,28250=>1000,28251=>1000,28252=>1000,28253=>1000,28254=>1000,28255=>1000,28256=>1000,28257=>1000,28258=>1000,28259=>1000,28260=>1000, - 28261=>1000,28262=>1000,28263=>1000,28264=>1000,28265=>1000,28266=>1000,28267=>1000,28268=>1000,28269=>1000,28270=>1000,28271=>1000,28272=>1000,28273=>1000,28274=>1000,28275=>1000,28276=>1000, - 28277=>1000,28278=>1000,28279=>1000,28280=>1000,28281=>1000,28282=>1000,28283=>1000,28284=>1000,28285=>1000,28286=>1000,28287=>1000,28288=>1000,28289=>1000,28290=>1000,28291=>1000,28292=>1000, - 28293=>1000,28294=>1000,28295=>1000,28296=>1000,28297=>1000,28298=>1000,28299=>1000,28300=>1000,28301=>1000,28302=>1000,28303=>1000,28304=>1000,28305=>1000,28306=>1000,28307=>1000,28308=>1000, - 28309=>1000,28310=>1000,28311=>1000,28312=>1000,28313=>1000,28314=>1000,28315=>1000,28316=>1000,28317=>1000,28318=>1000,28319=>1000,28320=>1000,28321=>1000,28322=>1000,28323=>1000,28324=>1000, - 28325=>1000,28326=>1000,28327=>1000,28328=>1000,28329=>1000,28330=>1000,28331=>1000,28332=>1000,28333=>1000,28334=>1000,28335=>1000,28336=>1000,28337=>1000,28338=>1000,28339=>1000,28340=>1000, - 28341=>1000,28342=>1000,28343=>1000,28344=>1000,28345=>1000,28346=>1000,28347=>1000,28348=>1000,28349=>1000,28350=>1000,28351=>1000,28352=>1000,28353=>1000,28354=>1000,28355=>1000,28356=>1000, - 28357=>1000,28358=>1000,28359=>1000,28360=>1000,28361=>1000,28362=>1000,28363=>1000,28364=>1000,28365=>1000,28366=>1000,28367=>1000,28368=>1000,28369=>1000,28370=>1000,28371=>1000,28372=>1000, - 28373=>1000,28374=>1000,28375=>1000,28376=>1000,28377=>1000,28378=>1000,28379=>1000,28380=>1000,28381=>1000,28382=>1000,28383=>1000,28384=>1000,28385=>1000,28386=>1000,28387=>1000,28388=>1000, - 28389=>1000,28390=>1000,28391=>1000,28392=>1000,28393=>1000,28394=>1000,28395=>1000,28396=>1000,28397=>1000,28398=>1000,28399=>1000,28400=>1000,28401=>1000,28402=>1000,28403=>1000,28404=>1000, - 28405=>1000,28406=>1000,28407=>1000,28408=>1000,28409=>1000,28410=>1000,28411=>1000,28412=>1000,28413=>1000,28414=>1000,28415=>1000,28416=>1000,28417=>1000,28418=>1000,28419=>1000,28420=>1000, - 28421=>1000,28422=>1000,28423=>1000,28424=>1000,28425=>1000,28426=>1000,28427=>1000,28428=>1000,28429=>1000,28430=>1000,28431=>1000,28432=>1000,28433=>1000,28434=>1000,28435=>1000,28436=>1000, - 28437=>1000,28438=>1000,28439=>1000,28440=>1000,28441=>1000,28442=>1000,28443=>1000,28444=>1000,28445=>1000,28446=>1000,28447=>1000,28448=>1000,28449=>1000,28450=>1000,28451=>1000,28452=>1000, - 28453=>1000,28454=>1000,28455=>1000,28456=>1000,28457=>1000,28458=>1000,28459=>1000,28460=>1000,28461=>1000,28462=>1000,28463=>1000,28464=>1000,28465=>1000,28466=>1000,28467=>1000,28468=>1000, - 28469=>1000,28470=>1000,28471=>1000,28472=>1000,28473=>1000,28474=>1000,28475=>1000,28476=>1000,28477=>1000,28478=>1000,28479=>1000,28480=>1000,28481=>1000,28482=>1000,28483=>1000,28484=>1000, - 28485=>1000,28486=>1000,28487=>1000,28488=>1000,28489=>1000,28490=>1000,28491=>1000,28492=>1000,28493=>1000,28494=>1000,28495=>1000,28496=>1000,28497=>1000,28498=>1000,28499=>1000,28500=>1000, - 28501=>1000,28502=>1000,28503=>1000,28504=>1000,28505=>1000,28506=>1000,28507=>1000,28508=>1000,28509=>1000,28510=>1000,28511=>1000,28512=>1000,28513=>1000,28514=>1000,28515=>1000,28516=>1000, - 28517=>1000,28518=>1000,28519=>1000,28520=>1000,28521=>1000,28522=>1000,28523=>1000,28524=>1000,28525=>1000,28526=>1000,28527=>1000,28528=>1000,28529=>1000,28530=>1000,28531=>1000,28532=>1000, - 28533=>1000,28534=>1000,28535=>1000,28536=>1000,28537=>1000,28538=>1000,28539=>1000,28540=>1000,28541=>1000,28542=>1000,28543=>1000,28544=>1000,28545=>1000,28546=>1000,28547=>1000,28548=>1000, - 28549=>1000,28550=>1000,28551=>1000,28552=>1000,28553=>1000,28554=>1000,28555=>1000,28556=>1000,28557=>1000,28558=>1000,28559=>1000,28560=>1000,28561=>1000,28562=>1000,28563=>1000,28564=>1000, - 28565=>1000,28566=>1000,28567=>1000,28568=>1000,28569=>1000,28570=>1000,28571=>1000,28572=>1000,28573=>1000,28574=>1000,28575=>1000,28576=>1000,28577=>1000,28578=>1000,28579=>1000,28580=>1000, - 28581=>1000,28582=>1000,28583=>1000,28584=>1000,28585=>1000,28586=>1000,28587=>1000,28588=>1000,28589=>1000,28590=>1000,28591=>1000,28592=>1000,28593=>1000,28594=>1000,28595=>1000,28596=>1000, - 28597=>1000,28598=>1000,28599=>1000,28600=>1000,28601=>1000,28602=>1000,28603=>1000,28604=>1000,28605=>1000,28606=>1000,28607=>1000,28608=>1000,28609=>1000,28610=>1000,28611=>1000,28612=>1000, - 28613=>1000,28614=>1000,28615=>1000,28616=>1000,28617=>1000,28618=>1000,28619=>1000,28620=>1000,28621=>1000,28622=>1000,28623=>1000,28624=>1000,28625=>1000,28626=>1000,28627=>1000,28628=>1000, - 28629=>1000,28630=>1000,28631=>1000,28632=>1000,28633=>1000,28634=>1000,28635=>1000,28636=>1000,28637=>1000,28638=>1000,28639=>1000,28640=>1000,28641=>1000,28642=>1000,28643=>1000,28644=>1000, - 28645=>1000,28646=>1000,28647=>1000,28648=>1000,28649=>1000,28650=>1000,28651=>1000,28652=>1000,28653=>1000,28654=>1000,28655=>1000,28656=>1000,28657=>1000,28658=>1000,28659=>1000,28660=>1000, - 28661=>1000,28662=>1000,28663=>1000,28664=>1000,28665=>1000,28666=>1000,28667=>1000,28668=>1000,28669=>1000,28670=>1000,28671=>1000,28672=>1000,28673=>1000,28674=>1000,28675=>1000,28676=>1000, - 28677=>1000,28678=>1000,28679=>1000,28680=>1000,28681=>1000,28682=>1000,28683=>1000,28684=>1000,28685=>1000,28686=>1000,28687=>1000,28688=>1000,28689=>1000,28690=>1000,28691=>1000,28692=>1000, - 28693=>1000,28694=>1000,28695=>1000,28696=>1000,28697=>1000,28698=>1000,28699=>1000,28700=>1000,28701=>1000,28702=>1000,28703=>1000,28704=>1000,28705=>1000,28706=>1000,28707=>1000,28708=>1000, - 28709=>1000,28710=>1000,28711=>1000,28712=>1000,28713=>1000,28714=>1000,28715=>1000,28716=>1000,28717=>1000,28718=>1000,28719=>1000,28720=>1000,28721=>1000,28722=>1000,28723=>1000,28724=>1000, - 28725=>1000,28726=>1000,28727=>1000,28728=>1000,28729=>1000,28730=>1000,28731=>1000,28732=>1000,28733=>1000,28734=>1000,28735=>1000,28736=>1000,28737=>1000,28738=>1000,28739=>1000,28740=>1000, - 28741=>1000,28742=>1000,28743=>1000,28744=>1000,28745=>1000,28746=>1000,28747=>1000,28748=>1000,28749=>1000,28750=>1000,28751=>1000,28752=>1000,28753=>1000,28754=>1000,28755=>1000,28756=>1000, - 28757=>1000,28758=>1000,28759=>1000,28760=>1000,28761=>1000,28762=>1000,28763=>1000,28764=>1000,28765=>1000,28766=>1000,28767=>1000,28768=>1000,28769=>1000,28770=>1000,28771=>1000,28772=>1000, - 28773=>1000,28774=>1000,28775=>1000,28776=>1000,28777=>1000,28778=>1000,28779=>1000,28780=>1000,28781=>1000,28782=>1000,28783=>1000,28784=>1000,28785=>1000,28786=>1000,28787=>1000,28788=>1000, - 28789=>1000,28790=>1000,28791=>1000,28792=>1000,28793=>1000,28794=>1000,28795=>1000,28796=>1000,28797=>1000,28798=>1000,28799=>1000,28800=>1000,28801=>1000,28802=>1000,28803=>1000,28804=>1000, - 28805=>1000,28806=>1000,28807=>1000,28808=>1000,28809=>1000,28810=>1000,28811=>1000,28812=>1000,28813=>1000,28814=>1000,28815=>1000,28816=>1000,28817=>1000,28818=>1000,28819=>1000,28820=>1000, - 28821=>1000,28822=>1000,28823=>1000,28824=>1000,28825=>1000,28826=>1000,28827=>1000,28828=>1000,28829=>1000,28830=>1000,28831=>1000,28832=>1000,28833=>1000,28834=>1000,28835=>1000,28836=>1000, - 28837=>1000,28838=>1000,28839=>1000,28840=>1000,28841=>1000,28842=>1000,28843=>1000,28844=>1000,28845=>1000,28846=>1000,28847=>1000,28848=>1000,28849=>1000,28850=>1000,28851=>1000,28852=>1000, - 28853=>1000,28854=>1000,28855=>1000,28856=>1000,28857=>1000,28858=>1000,28859=>1000,28860=>1000,28861=>1000,28862=>1000,28863=>1000,28864=>1000,28865=>1000,28866=>1000,28867=>1000,28868=>1000, - 28869=>1000,28870=>1000,28871=>1000,28872=>1000,28873=>1000,28874=>1000,28875=>1000,28876=>1000,28877=>1000,28878=>1000,28879=>1000,28880=>1000,28881=>1000,28882=>1000,28883=>1000,28884=>1000, - 28885=>1000,28886=>1000,28887=>1000,28888=>1000,28889=>1000,28890=>1000,28891=>1000,28892=>1000,28893=>1000,28894=>1000,28895=>1000,28896=>1000,28897=>1000,28898=>1000,28899=>1000,28900=>1000, - 28901=>1000,28902=>1000,28903=>1000,28904=>1000,28905=>1000,28906=>1000,28907=>1000,28908=>1000,28909=>1000,28910=>1000,28911=>1000,28912=>1000,28913=>1000,28914=>1000,28915=>1000,28916=>1000, - 28917=>1000,28918=>1000,28919=>1000,28920=>1000,28921=>1000,28922=>1000,28923=>1000,28924=>1000,28925=>1000,28926=>1000,28927=>1000,28928=>1000,28929=>1000,28930=>1000,28931=>1000,28932=>1000, - 28933=>1000,28934=>1000,28935=>1000,28936=>1000,28937=>1000,28938=>1000,28939=>1000,28940=>1000,28941=>1000,28942=>1000,28943=>1000,28944=>1000,28945=>1000,28946=>1000,28947=>1000,28948=>1000, - 28949=>1000,28950=>1000,28951=>1000,28952=>1000,28953=>1000,28954=>1000,28955=>1000,28956=>1000,28957=>1000,28958=>1000,28959=>1000,28960=>1000,28961=>1000,28962=>1000,28963=>1000,28964=>1000, - 28965=>1000,28966=>1000,28967=>1000,28968=>1000,28969=>1000,28970=>1000,28971=>1000,28972=>1000,28973=>1000,28974=>1000,28975=>1000,28976=>1000,28977=>1000,28978=>1000,28979=>1000,28980=>1000, - 28981=>1000,28982=>1000,28983=>1000,28984=>1000,28985=>1000,28986=>1000,28987=>1000,28988=>1000,28989=>1000,28990=>1000,28991=>1000,28992=>1000,28993=>1000,28994=>1000,28995=>1000,28996=>1000, - 28997=>1000,28998=>1000,28999=>1000,29000=>1000,29001=>1000,29002=>1000,29003=>1000,29004=>1000,29005=>1000,29006=>1000,29007=>1000,29008=>1000,29009=>1000,29010=>1000,29011=>1000,29012=>1000, - 29013=>1000,29014=>1000,29015=>1000,29016=>1000,29017=>1000,29018=>1000,29019=>1000,29020=>1000,29021=>1000,29022=>1000,29023=>1000,29024=>1000,29025=>1000,29026=>1000,29027=>1000,29028=>1000, - 29029=>1000,29030=>1000,29031=>1000,29032=>1000,29033=>1000,29034=>1000,29035=>1000,29036=>1000,29037=>1000,29038=>1000,29039=>1000,29040=>1000,29041=>1000,29042=>1000,29043=>1000,29044=>1000, - 29045=>1000,29046=>1000,29047=>1000,29048=>1000,29049=>1000,29050=>1000,29051=>1000,29052=>1000,29053=>1000,29054=>1000,29055=>1000,29056=>1000,29057=>1000,29058=>1000,29059=>1000,29060=>1000, - 29061=>1000,29062=>1000,29063=>1000,29064=>1000,29065=>1000,29066=>1000,29067=>1000,29068=>1000,29069=>1000,29070=>1000,29071=>1000,29072=>1000,29073=>1000,29074=>1000,29075=>1000,29076=>1000, - 29077=>1000,29078=>1000,29079=>1000,29080=>1000,29081=>1000,29082=>1000,29083=>1000,29084=>1000,29085=>1000,29086=>1000,29087=>1000,29088=>1000,29089=>1000,29090=>1000,29091=>1000,29092=>1000, - 29093=>1000,29094=>1000,29095=>1000,29096=>1000,29097=>1000,29098=>1000,29099=>1000,29100=>1000,29101=>1000,29102=>1000,29103=>1000,29104=>1000,29105=>1000,29106=>1000,29107=>1000,29108=>1000, - 29109=>1000,29110=>1000,29111=>1000,29112=>1000,29113=>1000,29114=>1000,29115=>1000,29116=>1000,29117=>1000,29118=>1000,29119=>1000,29120=>1000,29121=>1000,29122=>1000,29123=>1000,29124=>1000, - 29125=>1000,29126=>1000,29127=>1000,29128=>1000,29129=>1000,29130=>1000,29131=>1000,29132=>1000,29133=>1000,29134=>1000,29135=>1000,29136=>1000,29137=>1000,29138=>1000,29139=>1000,29140=>1000, - 29141=>1000,29142=>1000,29143=>1000,29144=>1000,29145=>1000,29146=>1000,29147=>1000,29148=>1000,29149=>1000,29150=>1000,29151=>1000,29152=>1000,29153=>1000,29154=>1000,29155=>1000,29156=>1000, - 29157=>1000,29158=>1000,29159=>1000,29160=>1000,29161=>1000,29162=>1000,29163=>1000,29164=>1000,29165=>1000,29166=>1000,29167=>1000,29168=>1000,29169=>1000,29170=>1000,29171=>1000,29172=>1000, - 29173=>1000,29174=>1000,29175=>1000,29176=>1000,29177=>1000,29178=>1000,29179=>1000,29180=>1000,29181=>1000,29182=>1000,29183=>1000,29184=>1000,29185=>1000,29186=>1000,29187=>1000,29188=>1000, - 29189=>1000,29190=>1000,29191=>1000,29192=>1000,29193=>1000,29194=>1000,29195=>1000,29196=>1000,29197=>1000,29198=>1000,29199=>1000,29200=>1000,29201=>1000,29202=>1000,29203=>1000,29204=>1000, - 29205=>1000,29206=>1000,29207=>1000,29208=>1000,29209=>1000,29210=>1000,29211=>1000,29212=>1000,29213=>1000,29214=>1000,29215=>1000,29216=>1000,29217=>1000,29218=>1000,29219=>1000,29220=>1000, - 29221=>1000,29222=>1000,29223=>1000,29224=>1000,29225=>1000,29226=>1000,29227=>1000,29228=>1000,29229=>1000,29230=>1000,29231=>1000,29232=>1000,29233=>1000,29234=>1000,29235=>1000,29236=>1000, - 29237=>1000,29238=>1000,29239=>1000,29240=>1000,29241=>1000,29242=>1000,29243=>1000,29244=>1000,29245=>1000,29246=>1000,29247=>1000,29248=>1000,29249=>1000,29250=>1000,29251=>1000,29252=>1000, - 29253=>1000,29254=>1000,29255=>1000,29256=>1000,29257=>1000,29258=>1000,29259=>1000,29260=>1000,29261=>1000,29262=>1000,29263=>1000,29264=>1000,29265=>1000,29266=>1000,29267=>1000,29268=>1000, - 29269=>1000,29270=>1000,29271=>1000,29272=>1000,29273=>1000,29274=>1000,29275=>1000,29276=>1000,29277=>1000,29278=>1000,29279=>1000,29280=>1000,29281=>1000,29282=>1000,29283=>1000,29284=>1000, - 29285=>1000,29286=>1000,29287=>1000,29288=>1000,29289=>1000,29290=>1000,29291=>1000,29292=>1000,29293=>1000,29294=>1000,29295=>1000,29296=>1000,29297=>1000,29298=>1000,29299=>1000,29300=>1000, - 29301=>1000,29302=>1000,29303=>1000,29304=>1000,29305=>1000,29306=>1000,29307=>1000,29308=>1000,29309=>1000,29310=>1000,29311=>1000,29312=>1000,29313=>1000,29314=>1000,29315=>1000,29316=>1000, - 29317=>1000,29318=>1000,29319=>1000,29320=>1000,29321=>1000,29322=>1000,29323=>1000,29324=>1000,29325=>1000,29326=>1000,29327=>1000,29328=>1000,29329=>1000,29330=>1000,29331=>1000,29332=>1000, - 29333=>1000,29334=>1000,29335=>1000,29336=>1000,29337=>1000,29338=>1000,29339=>1000,29340=>1000,29341=>1000,29342=>1000,29343=>1000,29344=>1000,29345=>1000,29346=>1000,29347=>1000,29348=>1000, - 29349=>1000,29350=>1000,29351=>1000,29352=>1000,29353=>1000,29354=>1000,29355=>1000,29356=>1000,29357=>1000,29358=>1000,29359=>1000,29360=>1000,29361=>1000,29362=>1000,29363=>1000,29364=>1000, - 29365=>1000,29366=>1000,29367=>1000,29368=>1000,29369=>1000,29370=>1000,29371=>1000,29372=>1000,29373=>1000,29374=>1000,29375=>1000,29376=>1000,29377=>1000,29378=>1000,29379=>1000,29380=>1000, - 29381=>1000,29382=>1000,29383=>1000,29384=>1000,29385=>1000,29386=>1000,29387=>1000,29388=>1000,29389=>1000,29390=>1000,29391=>1000,29392=>1000,29393=>1000,29394=>1000,29395=>1000,29396=>1000, - 29397=>1000,29398=>1000,29399=>1000,29400=>1000,29401=>1000,29402=>1000,29403=>1000,29404=>1000,29405=>1000,29406=>1000,29407=>1000,29408=>1000,29409=>1000,29410=>1000,29411=>1000,29412=>1000, - 29413=>1000,29414=>1000,29415=>1000,29416=>1000,29417=>1000,29418=>1000,29419=>1000,29420=>1000,29421=>1000,29422=>1000,29423=>1000,29424=>1000,29425=>1000,29426=>1000,29427=>1000,29428=>1000, - 29429=>1000,29430=>1000,29431=>1000,29432=>1000,29433=>1000,29434=>1000,29435=>1000,29436=>1000,29437=>1000,29438=>1000,29439=>1000,29440=>1000,29441=>1000,29442=>1000,29443=>1000,29444=>1000, - 29445=>1000,29446=>1000,29447=>1000,29448=>1000,29449=>1000,29450=>1000,29451=>1000,29452=>1000,29453=>1000,29454=>1000,29455=>1000,29456=>1000,29457=>1000,29458=>1000,29459=>1000,29460=>1000, - 29461=>1000,29462=>1000,29463=>1000,29464=>1000,29465=>1000,29466=>1000,29467=>1000,29468=>1000,29469=>1000,29470=>1000,29471=>1000,29472=>1000,29473=>1000,29474=>1000,29475=>1000,29476=>1000, - 29477=>1000,29478=>1000,29479=>1000,29480=>1000,29481=>1000,29482=>1000,29483=>1000,29484=>1000,29485=>1000,29486=>1000,29487=>1000,29488=>1000,29489=>1000,29490=>1000,29491=>1000,29492=>1000, - 29493=>1000,29494=>1000,29495=>1000,29496=>1000,29497=>1000,29498=>1000,29499=>1000,29500=>1000,29501=>1000,29502=>1000,29503=>1000,29504=>1000,29505=>1000,29506=>1000,29507=>1000,29508=>1000, - 29509=>1000,29510=>1000,29511=>1000,29512=>1000,29513=>1000,29514=>1000,29515=>1000,29516=>1000,29517=>1000,29518=>1000,29519=>1000,29520=>1000,29521=>1000,29522=>1000,29523=>1000,29524=>1000, - 29525=>1000,29526=>1000,29527=>1000,29528=>1000,29529=>1000,29530=>1000,29531=>1000,29532=>1000,29533=>1000,29534=>1000,29535=>1000,29536=>1000,29537=>1000,29538=>1000,29539=>1000,29540=>1000, - 29541=>1000,29542=>1000,29543=>1000,29544=>1000,29545=>1000,29546=>1000,29547=>1000,29548=>1000,29549=>1000,29550=>1000,29551=>1000,29552=>1000,29553=>1000,29554=>1000,29555=>1000,29556=>1000, - 29557=>1000,29558=>1000,29559=>1000,29560=>1000,29561=>1000,29562=>1000,29563=>1000,29564=>1000,29565=>1000,29566=>1000,29567=>1000,29568=>1000,29569=>1000,29570=>1000,29571=>1000,29572=>1000, - 29573=>1000,29574=>1000,29575=>1000,29576=>1000,29577=>1000,29578=>1000,29579=>1000,29580=>1000,29581=>1000,29582=>1000,29583=>1000,29584=>1000,29585=>1000,29586=>1000,29587=>1000,29588=>1000, - 29589=>1000,29590=>1000,29591=>1000,29592=>1000,29593=>1000,29594=>1000,29595=>1000,29596=>1000,29597=>1000,29598=>1000,29599=>1000,29600=>1000,29601=>1000,29602=>1000,29603=>1000,29604=>1000, - 29605=>1000,29606=>1000,29607=>1000,29608=>1000,29609=>1000,29610=>1000,29611=>1000,29612=>1000,29613=>1000,29614=>1000,29615=>1000,29616=>1000,29617=>1000,29618=>1000,29619=>1000,29620=>1000, - 29621=>1000,29622=>1000,29623=>1000,29624=>1000,29625=>1000,29626=>1000,29627=>1000,29628=>1000,29629=>1000,29630=>1000,29631=>1000,29632=>1000,29633=>1000,29634=>1000,29635=>1000,29636=>1000, - 29637=>1000,29638=>1000,29639=>1000,29640=>1000,29641=>1000,29642=>1000,29643=>1000,29644=>1000,29645=>1000,29646=>1000,29647=>1000,29648=>1000,29649=>1000,29650=>1000,29651=>1000,29652=>1000, - 29653=>1000,29654=>1000,29655=>1000,29656=>1000,29657=>1000,29658=>1000,29659=>1000,29660=>1000,29661=>1000,29662=>1000,29663=>1000,29664=>1000,29665=>1000,29666=>1000,29667=>1000,29668=>1000, - 29669=>1000,29670=>1000,29671=>1000,29672=>1000,29673=>1000,29674=>1000,29675=>1000,29676=>1000,29677=>1000,29678=>1000,29679=>1000,29680=>1000,29681=>1000,29682=>1000,29683=>1000,29684=>1000, - 29685=>1000,29686=>1000,29687=>1000,29688=>1000,29689=>1000,29690=>1000,29691=>1000,29692=>1000,29693=>1000,29694=>1000,29695=>1000,29696=>1000,29697=>1000,29698=>1000,29699=>1000,29700=>1000, - 29701=>1000,29702=>1000,29703=>1000,29704=>1000,29705=>1000,29706=>1000,29707=>1000,29708=>1000,29709=>1000,29710=>1000,29711=>1000,29712=>1000,29713=>1000,29714=>1000,29715=>1000,29716=>1000, - 29717=>1000,29718=>1000,29719=>1000,29720=>1000,29721=>1000,29722=>1000,29723=>1000,29724=>1000,29725=>1000,29726=>1000,29727=>1000,29728=>1000,29729=>1000,29730=>1000,29731=>1000,29732=>1000, - 29733=>1000,29734=>1000,29735=>1000,29736=>1000,29737=>1000,29738=>1000,29739=>1000,29740=>1000,29741=>1000,29742=>1000,29743=>1000,29744=>1000,29745=>1000,29746=>1000,29747=>1000,29748=>1000, - 29749=>1000,29750=>1000,29751=>1000,29752=>1000,29753=>1000,29754=>1000,29755=>1000,29756=>1000,29757=>1000,29758=>1000,29759=>1000,29760=>1000,29761=>1000,29762=>1000,29763=>1000,29764=>1000, - 29765=>1000,29766=>1000,29767=>1000,29768=>1000,29769=>1000,29770=>1000,29771=>1000,29772=>1000,29773=>1000,29774=>1000,29775=>1000,29776=>1000,29777=>1000,29778=>1000,29779=>1000,29780=>1000, - 29781=>1000,29782=>1000,29783=>1000,29784=>1000,29785=>1000,29786=>1000,29787=>1000,29788=>1000,29789=>1000,29790=>1000,29791=>1000,29792=>1000,29793=>1000,29794=>1000,29795=>1000,29796=>1000, - 29797=>1000,29798=>1000,29799=>1000,29800=>1000,29801=>1000,29802=>1000,29803=>1000,29804=>1000,29805=>1000,29806=>1000,29807=>1000,29808=>1000,29809=>1000,29810=>1000,29811=>1000,29812=>1000, - 29813=>1000,29814=>1000,29815=>1000,29816=>1000,29817=>1000,29818=>1000,29819=>1000,29820=>1000,29821=>1000,29822=>1000,29823=>1000,29824=>1000,29825=>1000,29826=>1000,29827=>1000,29828=>1000, - 29829=>1000,29830=>1000,29831=>1000,29832=>1000,29833=>1000,29834=>1000,29835=>1000,29836=>1000,29837=>1000,29838=>1000,29839=>1000,29840=>1000,29841=>1000,29842=>1000,29843=>1000,29844=>1000, - 29845=>1000,29846=>1000,29847=>1000,29848=>1000,29849=>1000,29850=>1000,29851=>1000,29852=>1000,29853=>1000,29854=>1000,29855=>1000,29856=>1000,29857=>1000,29858=>1000,29859=>1000,29860=>1000, - 29861=>1000,29862=>1000,29863=>1000,29864=>1000,29865=>1000,29866=>1000,29867=>1000,29868=>1000,29869=>1000,29870=>1000,29871=>1000,29872=>1000,29873=>1000,29874=>1000,29875=>1000,29876=>1000, - 29877=>1000,29878=>1000,29879=>1000,29880=>1000,29881=>1000,29882=>1000,29883=>1000,29884=>1000,29885=>1000,29886=>1000,29887=>1000,29888=>1000,29889=>1000,29890=>1000,29891=>1000,29892=>1000, - 29893=>1000,29894=>1000,29895=>1000,29896=>1000,29897=>1000,29898=>1000,29899=>1000,29900=>1000,29901=>1000,29902=>1000,29903=>1000,29904=>1000,29905=>1000,29906=>1000,29907=>1000,29908=>1000, - 29909=>1000,29910=>1000,29911=>1000,29912=>1000,29913=>1000,29914=>1000,29915=>1000,29916=>1000,29917=>1000,29918=>1000,29919=>1000,29920=>1000,29921=>1000,29922=>1000,29923=>1000,29924=>1000, - 29925=>1000,29926=>1000,29927=>1000,29928=>1000,29929=>1000,29930=>1000,29931=>1000,29932=>1000,29933=>1000,29934=>1000,29935=>1000,29936=>1000,29937=>1000,29938=>1000,29939=>1000,29940=>1000, - 29941=>1000,29942=>1000,29943=>1000,29944=>1000,29945=>1000,29946=>1000,29947=>1000,29948=>1000,29949=>1000,29950=>1000,29951=>1000,29952=>1000,29953=>1000,29954=>1000,29955=>1000,29956=>1000, - 29957=>1000,29958=>1000,29959=>1000,29960=>1000,29961=>1000,29962=>1000,29963=>1000,29964=>1000,29965=>1000,29966=>1000,29967=>1000,29968=>1000,29969=>1000,29970=>1000,29971=>1000,29972=>1000, - 29973=>1000,29974=>1000,29975=>1000,29976=>1000,29977=>1000,29978=>1000,29979=>1000,29980=>1000,29981=>1000,29982=>1000,29983=>1000,29984=>1000,29985=>1000,29986=>1000,29987=>1000,29988=>1000, - 29989=>1000,29990=>1000,29991=>1000,29992=>1000,29993=>1000,29994=>1000,29995=>1000,29996=>1000,29997=>1000,29998=>1000,29999=>1000,30000=>1000,30001=>1000,30002=>1000,30003=>1000,30004=>1000, - 30005=>1000,30006=>1000,30007=>1000,30008=>1000,30009=>1000,30010=>1000,30011=>1000,30012=>1000,30013=>1000,30014=>1000,30015=>1000,30016=>1000,30017=>1000,30018=>1000,30019=>1000,30020=>1000, - 30021=>1000,30022=>1000,30023=>1000,30024=>1000,30025=>1000,30026=>1000,30027=>1000,30028=>1000,30029=>1000,30030=>1000,30031=>1000,30032=>1000,30033=>1000,30034=>1000,30035=>1000,30036=>1000, - 30037=>1000,30038=>1000,30039=>1000,30040=>1000,30041=>1000,30042=>1000,30043=>1000,30044=>1000,30045=>1000,30046=>1000,30047=>1000,30048=>1000,30049=>1000,30050=>1000,30051=>1000,30052=>1000, - 30053=>1000,30054=>1000,30055=>1000,30056=>1000,30057=>1000,30058=>1000,30059=>1000,30060=>1000,30061=>1000,30062=>1000,30063=>1000,30064=>1000,30065=>1000,30066=>1000,30067=>1000,30068=>1000, - 30069=>1000,30070=>1000,30071=>1000,30072=>1000,30073=>1000,30074=>1000,30075=>1000,30076=>1000,30077=>1000,30078=>1000,30079=>1000,30080=>1000,30081=>1000,30082=>1000,30083=>1000,30084=>1000, - 30085=>1000,30086=>1000,30087=>1000,30088=>1000,30089=>1000,30090=>1000,30091=>1000,30092=>1000,30093=>1000,30094=>1000,30095=>1000,30096=>1000,30097=>1000,30098=>1000,30099=>1000,30100=>1000, - 30101=>1000,30102=>1000,30103=>1000,30104=>1000,30105=>1000,30106=>1000,30107=>1000,30108=>1000,30109=>1000,30110=>1000,30111=>1000,30112=>1000,30113=>1000,30114=>1000,30115=>1000,30116=>1000, - 30117=>1000,30118=>1000,30119=>1000,30120=>1000,30121=>1000,30122=>1000,30123=>1000,30124=>1000,30125=>1000,30126=>1000,30127=>1000,30128=>1000,30129=>1000,30130=>1000,30131=>1000,30132=>1000, - 30133=>1000,30134=>1000,30135=>1000,30136=>1000,30137=>1000,30138=>1000,30139=>1000,30140=>1000,30141=>1000,30142=>1000,30143=>1000,30144=>1000,30145=>1000,30146=>1000,30147=>1000,30148=>1000, - 30149=>1000,30150=>1000,30151=>1000,30152=>1000,30153=>1000,30154=>1000,30155=>1000,30156=>1000,30157=>1000,30158=>1000,30159=>1000,30160=>1000,30161=>1000,30162=>1000,30163=>1000,30164=>1000, - 30165=>1000,30166=>1000,30167=>1000,30168=>1000,30169=>1000,30170=>1000,30171=>1000,30172=>1000,30173=>1000,30174=>1000,30175=>1000,30176=>1000,30177=>1000,30178=>1000,30179=>1000,30180=>1000, - 30181=>1000,30182=>1000,30183=>1000,30184=>1000,30185=>1000,30186=>1000,30187=>1000,30188=>1000,30189=>1000,30190=>1000,30191=>1000,30192=>1000,30193=>1000,30194=>1000,30195=>1000,30196=>1000, - 30197=>1000,30198=>1000,30199=>1000,30200=>1000,30201=>1000,30202=>1000,30203=>1000,30204=>1000,30205=>1000,30206=>1000,30207=>1000,30208=>1000,30209=>1000,30210=>1000,30211=>1000,30212=>1000, - 30213=>1000,30214=>1000,30215=>1000,30216=>1000,30217=>1000,30218=>1000,30219=>1000,30220=>1000,30221=>1000,30222=>1000,30223=>1000,30224=>1000,30225=>1000,30226=>1000,30227=>1000,30228=>1000, - 30229=>1000,30230=>1000,30231=>1000,30232=>1000,30233=>1000,30234=>1000,30235=>1000,30236=>1000,30237=>1000,30238=>1000,30239=>1000,30240=>1000,30241=>1000,30242=>1000,30243=>1000,30244=>1000, - 30245=>1000,30246=>1000,30247=>1000,30248=>1000,30249=>1000,30250=>1000,30251=>1000,30252=>1000,30253=>1000,30254=>1000,30255=>1000,30256=>1000,30257=>1000,30258=>1000,30259=>1000,30260=>1000, - 30261=>1000,30262=>1000,30263=>1000,30264=>1000,30265=>1000,30266=>1000,30267=>1000,30268=>1000,30269=>1000,30270=>1000,30271=>1000,30272=>1000,30273=>1000,30274=>1000,30275=>1000,30276=>1000, - 30277=>1000,30278=>1000,30279=>1000,30280=>1000,30281=>1000,30282=>1000,30283=>1000,30284=>1000,30285=>1000,30286=>1000,30287=>1000,30288=>1000,30289=>1000,30290=>1000,30291=>1000,30292=>1000, - 30293=>1000,30294=>1000,30295=>1000,30296=>1000,30297=>1000,30298=>1000,30299=>1000,30300=>1000,30301=>1000,30302=>1000,30303=>1000,30304=>1000,30305=>1000,30306=>1000,30307=>1000,30308=>1000, - 30309=>1000,30310=>1000,30311=>1000,30312=>1000,30313=>1000,30314=>1000,30315=>1000,30316=>1000,30317=>1000,30318=>1000,30319=>1000,30320=>1000,30321=>1000,30322=>1000,30323=>1000,30324=>1000, - 30325=>1000,30326=>1000,30327=>1000,30328=>1000,30329=>1000,30330=>1000,30331=>1000,30332=>1000,30333=>1000,30334=>1000,30335=>1000,30336=>1000,30337=>1000,30338=>1000,30339=>1000,30340=>1000, - 30341=>1000,30342=>1000,30343=>1000,30344=>1000,30345=>1000,30346=>1000,30347=>1000,30348=>1000,30349=>1000,30350=>1000,30351=>1000,30352=>1000,30353=>1000,30354=>1000,30355=>1000,30356=>1000, - 30357=>1000,30358=>1000,30359=>1000,30360=>1000,30361=>1000,30362=>1000,30363=>1000,30364=>1000,30365=>1000,30366=>1000,30367=>1000,30368=>1000,30369=>1000,30370=>1000,30371=>1000,30372=>1000, - 30373=>1000,30374=>1000,30375=>1000,30376=>1000,30377=>1000,30378=>1000,30379=>1000,30380=>1000,30381=>1000,30382=>1000,30383=>1000,30384=>1000,30385=>1000,30386=>1000,30387=>1000,30388=>1000, - 30389=>1000,30390=>1000,30391=>1000,30392=>1000,30393=>1000,30394=>1000,30395=>1000,30396=>1000,30397=>1000,30398=>1000,30399=>1000,30400=>1000,30401=>1000,30402=>1000,30403=>1000,30404=>1000, - 30405=>1000,30406=>1000,30407=>1000,30408=>1000,30409=>1000,30410=>1000,30411=>1000,30412=>1000,30413=>1000,30414=>1000,30415=>1000,30416=>1000,30417=>1000,30418=>1000,30419=>1000,30420=>1000, - 30421=>1000,30422=>1000,30423=>1000,30424=>1000,30425=>1000,30426=>1000,30427=>1000,30428=>1000,30429=>1000,30430=>1000,30431=>1000,30432=>1000,30433=>1000,30434=>1000,30435=>1000,30436=>1000, - 30437=>1000,30438=>1000,30439=>1000,30440=>1000,30441=>1000,30442=>1000,30443=>1000,30444=>1000,30445=>1000,30446=>1000,30447=>1000,30448=>1000,30449=>1000,30450=>1000,30451=>1000,30452=>1000, - 30453=>1000,30454=>1000,30455=>1000,30456=>1000,30457=>1000,30458=>1000,30459=>1000,30460=>1000,30461=>1000,30462=>1000,30463=>1000,30464=>1000,30465=>1000,30466=>1000,30467=>1000,30468=>1000, - 30469=>1000,30470=>1000,30471=>1000,30472=>1000,30473=>1000,30474=>1000,30475=>1000,30476=>1000,30477=>1000,30478=>1000,30479=>1000,30480=>1000,30481=>1000,30482=>1000,30483=>1000,30484=>1000, - 30485=>1000,30486=>1000,30487=>1000,30488=>1000,30489=>1000,30490=>1000,30491=>1000,30492=>1000,30493=>1000,30494=>1000,30495=>1000,30496=>1000,30497=>1000,30498=>1000,30499=>1000,30500=>1000, - 30501=>1000,30502=>1000,30503=>1000,30504=>1000,30505=>1000,30506=>1000,30507=>1000,30508=>1000,30509=>1000,30510=>1000,30511=>1000,30512=>1000,30513=>1000,30514=>1000,30515=>1000,30516=>1000, - 30517=>1000,30518=>1000,30519=>1000,30520=>1000,30521=>1000,30522=>1000,30523=>1000,30524=>1000,30525=>1000,30526=>1000,30527=>1000,30528=>1000,30529=>1000,30530=>1000,30531=>1000,30532=>1000, - 30533=>1000,30534=>1000,30535=>1000,30536=>1000,30537=>1000,30538=>1000,30539=>1000,30540=>1000,30541=>1000,30542=>1000,30543=>1000,30544=>1000,30545=>1000,30546=>1000,30547=>1000,30548=>1000, - 30549=>1000,30550=>1000,30551=>1000,30552=>1000,30553=>1000,30554=>1000,30555=>1000,30556=>1000,30557=>1000,30558=>1000,30559=>1000,30560=>1000,30561=>1000,30562=>1000,30563=>1000,30564=>1000, - 30565=>1000,30566=>1000,30567=>1000,30568=>1000,30569=>1000,30570=>1000,30571=>1000,30572=>1000,30573=>1000,30574=>1000,30575=>1000,30576=>1000,30577=>1000,30578=>1000,30579=>1000,30580=>1000, - 30581=>1000,30582=>1000,30583=>1000,30584=>1000,30585=>1000,30586=>1000,30587=>1000,30588=>1000,30589=>1000,30590=>1000,30591=>1000,30592=>1000,30593=>1000,30594=>1000,30595=>1000,30596=>1000, - 30597=>1000,30598=>1000,30599=>1000,30600=>1000,30601=>1000,30602=>1000,30603=>1000,30604=>1000,30605=>1000,30606=>1000,30607=>1000,30608=>1000,30609=>1000,30610=>1000,30611=>1000,30612=>1000, - 30613=>1000,30614=>1000,30615=>1000,30616=>1000,30617=>1000,30618=>1000,30619=>1000,30620=>1000,30621=>1000,30622=>1000,30623=>1000,30624=>1000,30625=>1000,30626=>1000,30627=>1000,30628=>1000, - 30629=>1000,30630=>1000,30631=>1000,30632=>1000,30633=>1000,30634=>1000,30635=>1000,30636=>1000,30637=>1000,30638=>1000,30639=>1000,30640=>1000,30641=>1000,30642=>1000,30643=>1000,30644=>1000, - 30645=>1000,30646=>1000,30647=>1000,30648=>1000,30649=>1000,30650=>1000,30651=>1000,30652=>1000,30653=>1000,30654=>1000,30655=>1000,30656=>1000,30657=>1000,30658=>1000,30659=>1000,30660=>1000, - 30661=>1000,30662=>1000,30663=>1000,30664=>1000,30665=>1000,30666=>1000,30667=>1000,30668=>1000,30669=>1000,30670=>1000,30671=>1000,30672=>1000,30673=>1000,30674=>1000,30675=>1000,30676=>1000, - 30677=>1000,30678=>1000,30679=>1000,30680=>1000,30681=>1000,30682=>1000,30683=>1000,30684=>1000,30685=>1000,30686=>1000,30687=>1000,30688=>1000,30689=>1000,30690=>1000,30691=>1000,30692=>1000, - 30693=>1000,30694=>1000,30695=>1000,30696=>1000,30697=>1000,30698=>1000,30699=>1000,30700=>1000,30701=>1000,30702=>1000,30703=>1000,30704=>1000,30705=>1000,30706=>1000,30707=>1000,30708=>1000, - 30709=>1000,30710=>1000,30711=>1000,30712=>1000,30713=>1000,30714=>1000,30715=>1000,30716=>1000,30717=>1000,30718=>1000,30719=>1000,30720=>1000,30721=>1000,30722=>1000,30723=>1000,30724=>1000, - 30725=>1000,30726=>1000,30727=>1000,30728=>1000,30729=>1000,30730=>1000,30731=>1000,30732=>1000,30733=>1000,30734=>1000,30735=>1000,30736=>1000,30737=>1000,30738=>1000,30739=>1000,30740=>1000, - 30741=>1000,30742=>1000,30743=>1000,30744=>1000,30745=>1000,30746=>1000,30747=>1000,30748=>1000,30749=>1000,30750=>1000,30751=>1000,30752=>1000,30753=>1000,30754=>1000,30755=>1000,30756=>1000, - 30757=>1000,30758=>1000,30759=>1000,30760=>1000,30761=>1000,30762=>1000,30763=>1000,30764=>1000,30765=>1000,30766=>1000,30767=>1000,30768=>1000,30769=>1000,30770=>1000,30771=>1000,30772=>1000, - 30773=>1000,30774=>1000,30775=>1000,30776=>1000,30777=>1000,30778=>1000,30779=>1000,30780=>1000,30781=>1000,30782=>1000,30783=>1000,30784=>1000,30785=>1000,30786=>1000,30787=>1000,30788=>1000, - 30789=>1000,30790=>1000,30791=>1000,30792=>1000,30793=>1000,30794=>1000,30795=>1000,30796=>1000,30797=>1000,30798=>1000,30799=>1000,30800=>1000,30801=>1000,30802=>1000,30803=>1000,30804=>1000, - 30805=>1000,30806=>1000,30807=>1000,30808=>1000,30809=>1000,30810=>1000,30811=>1000,30812=>1000,30813=>1000,30814=>1000,30815=>1000,30816=>1000,30817=>1000,30818=>1000,30819=>1000,30820=>1000, - 30821=>1000,30822=>1000,30823=>1000,30824=>1000,30825=>1000,30826=>1000,30827=>1000,30828=>1000,30829=>1000,30830=>1000,30831=>1000,30832=>1000,30833=>1000,30834=>1000,30835=>1000,30836=>1000, - 30837=>1000,30838=>1000,30839=>1000,30840=>1000,30841=>1000,30842=>1000,30843=>1000,30844=>1000,30845=>1000,30846=>1000,30847=>1000,30848=>1000,30849=>1000,30850=>1000,30851=>1000,30852=>1000, - 30853=>1000,30854=>1000,30855=>1000,30856=>1000,30857=>1000,30858=>1000,30859=>1000,30860=>1000,30861=>1000,30862=>1000,30863=>1000,30864=>1000,30865=>1000,30866=>1000,30867=>1000,30868=>1000, - 30869=>1000,30870=>1000,30871=>1000,30872=>1000,30873=>1000,30874=>1000,30875=>1000,30876=>1000,30877=>1000,30878=>1000,30879=>1000,30880=>1000,30881=>1000,30882=>1000,30883=>1000,30884=>1000, - 30885=>1000,30886=>1000,30887=>1000,30888=>1000,30889=>1000,30890=>1000,30891=>1000,30892=>1000,30893=>1000,30894=>1000,30895=>1000,30896=>1000,30897=>1000,30898=>1000,30899=>1000,30900=>1000, - 30901=>1000,30902=>1000,30903=>1000,30904=>1000,30905=>1000,30906=>1000,30907=>1000,30908=>1000,30909=>1000,30910=>1000,30911=>1000,30912=>1000,30913=>1000,30914=>1000,30915=>1000,30916=>1000, - 30917=>1000,30918=>1000,30919=>1000,30920=>1000,30921=>1000,30922=>1000,30923=>1000,30924=>1000,30925=>1000,30926=>1000,30927=>1000,30928=>1000,30929=>1000,30930=>1000,30931=>1000,30932=>1000, - 30933=>1000,30934=>1000,30935=>1000,30936=>1000,30937=>1000,30938=>1000,30939=>1000,30940=>1000,30941=>1000,30942=>1000,30943=>1000,30944=>1000,30945=>1000,30946=>1000,30947=>1000,30948=>1000, - 30949=>1000,30950=>1000,30951=>1000,30952=>1000,30953=>1000,30954=>1000,30955=>1000,30956=>1000,30957=>1000,30958=>1000,30959=>1000,30960=>1000,30961=>1000,30962=>1000,30963=>1000,30964=>1000, - 30965=>1000,30966=>1000,30967=>1000,30968=>1000,30969=>1000,30970=>1000,30971=>1000,30972=>1000,30973=>1000,30974=>1000,30975=>1000,30976=>1000,30977=>1000,30978=>1000,30979=>1000,30980=>1000, - 30981=>1000,30982=>1000,30983=>1000,30984=>1000,30985=>1000,30986=>1000,30987=>1000,30988=>1000,30989=>1000,30990=>1000,30991=>1000,30992=>1000,30993=>1000,30994=>1000,30995=>1000,30996=>1000, - 30997=>1000,30998=>1000,30999=>1000,31000=>1000,31001=>1000,31002=>1000,31003=>1000,31004=>1000,31005=>1000,31006=>1000,31007=>1000,31008=>1000,31009=>1000,31010=>1000,31011=>1000,31012=>1000, - 31013=>1000,31014=>1000,31015=>1000,31016=>1000,31017=>1000,31018=>1000,31019=>1000,31020=>1000,31021=>1000,31022=>1000,31023=>1000,31024=>1000,31025=>1000,31026=>1000,31027=>1000,31028=>1000, - 31029=>1000,31030=>1000,31031=>1000,31032=>1000,31033=>1000,31034=>1000,31035=>1000,31036=>1000,31037=>1000,31038=>1000,31039=>1000,31040=>1000,31041=>1000,31042=>1000,31043=>1000,31044=>1000, - 31045=>1000,31046=>1000,31047=>1000,31048=>1000,31049=>1000,31050=>1000,31051=>1000,31052=>1000,31053=>1000,31054=>1000,31055=>1000,31056=>1000,31057=>1000,31058=>1000,31059=>1000,31060=>1000, - 31061=>1000,31062=>1000,31063=>1000,31064=>1000,31065=>1000,31066=>1000,31067=>1000,31068=>1000,31069=>1000,31070=>1000,31071=>1000,31072=>1000,31073=>1000,31074=>1000,31075=>1000,31076=>1000, - 31077=>1000,31078=>1000,31079=>1000,31080=>1000,31081=>1000,31082=>1000,31083=>1000,31084=>1000,31085=>1000,31086=>1000,31087=>1000,31088=>1000,31089=>1000,31090=>1000,31091=>1000,31092=>1000, - 31093=>1000,31094=>1000,31095=>1000,31096=>1000,31097=>1000,31098=>1000,31099=>1000,31100=>1000,31101=>1000,31102=>1000,31103=>1000,31104=>1000,31105=>1000,31106=>1000,31107=>1000,31108=>1000, - 31109=>1000,31110=>1000,31111=>1000,31112=>1000,31113=>1000,31114=>1000,31115=>1000,31116=>1000,31117=>1000,31118=>1000,31119=>1000,31120=>1000,31121=>1000,31122=>1000,31123=>1000,31124=>1000, - 31125=>1000,31126=>1000,31127=>1000,31128=>1000,31129=>1000,31130=>1000,31131=>1000,31132=>1000,31133=>1000,31134=>1000,31135=>1000,31136=>1000,31137=>1000,31138=>1000,31139=>1000,31140=>1000, - 31141=>1000,31142=>1000,31143=>1000,31144=>1000,31145=>1000,31146=>1000,31147=>1000,31148=>1000,31149=>1000,31150=>1000,31151=>1000,31152=>1000,31153=>1000,31154=>1000,31155=>1000,31156=>1000, - 31157=>1000,31158=>1000,31159=>1000,31160=>1000,31161=>1000,31162=>1000,31163=>1000,31164=>1000,31165=>1000,31166=>1000,31167=>1000,31168=>1000,31169=>1000,31170=>1000,31171=>1000,31172=>1000, - 31173=>1000,31174=>1000,31175=>1000,31176=>1000,31177=>1000,31178=>1000,31179=>1000,31180=>1000,31181=>1000,31182=>1000,31183=>1000,31184=>1000,31185=>1000,31186=>1000,31187=>1000,31188=>1000, - 31189=>1000,31190=>1000,31191=>1000,31192=>1000,31193=>1000,31194=>1000,31195=>1000,31196=>1000,31197=>1000,31198=>1000,31199=>1000,31200=>1000,31201=>1000,31202=>1000,31203=>1000,31204=>1000, - 31205=>1000,31206=>1000,31207=>1000,31208=>1000,31209=>1000,31210=>1000,31211=>1000,31212=>1000,31213=>1000,31214=>1000,31215=>1000,31216=>1000,31217=>1000,31218=>1000,31219=>1000,31220=>1000, - 31221=>1000,31222=>1000,31223=>1000,31224=>1000,31225=>1000,31226=>1000,31227=>1000,31228=>1000,31229=>1000,31230=>1000,31231=>1000,31232=>1000,31233=>1000,31234=>1000,31235=>1000,31236=>1000, - 31237=>1000,31238=>1000,31239=>1000,31240=>1000,31241=>1000,31242=>1000,31243=>1000,31244=>1000,31245=>1000,31246=>1000,31247=>1000,31248=>1000,31249=>1000,31250=>1000,31251=>1000,31252=>1000, - 31253=>1000,31254=>1000,31255=>1000,31256=>1000,31257=>1000,31258=>1000,31259=>1000,31260=>1000,31261=>1000,31262=>1000,31263=>1000,31264=>1000,31265=>1000,31266=>1000,31267=>1000,31268=>1000, - 31269=>1000,31270=>1000,31271=>1000,31272=>1000,31273=>1000,31274=>1000,31275=>1000,31276=>1000,31277=>1000,31278=>1000,31279=>1000,31280=>1000,31281=>1000,31282=>1000,31283=>1000,31284=>1000, - 31285=>1000,31286=>1000,31287=>1000,31288=>1000,31289=>1000,31290=>1000,31291=>1000,31292=>1000,31293=>1000,31294=>1000,31295=>1000,31296=>1000,31297=>1000,31298=>1000,31299=>1000,31300=>1000, - 31301=>1000,31302=>1000,31303=>1000,31304=>1000,31305=>1000,31306=>1000,31307=>1000,31308=>1000,31309=>1000,31310=>1000,31311=>1000,31312=>1000,31313=>1000,31314=>1000,31315=>1000,31316=>1000, - 31317=>1000,31318=>1000,31319=>1000,31320=>1000,31321=>1000,31322=>1000,31323=>1000,31324=>1000,31325=>1000,31326=>1000,31327=>1000,31328=>1000,31329=>1000,31330=>1000,31331=>1000,31332=>1000, - 31333=>1000,31334=>1000,31335=>1000,31336=>1000,31337=>1000,31338=>1000,31339=>1000,31340=>1000,31341=>1000,31342=>1000,31343=>1000,31344=>1000,31345=>1000,31346=>1000,31347=>1000,31348=>1000, - 31349=>1000,31350=>1000,31351=>1000,31352=>1000,31353=>1000,31354=>1000,31355=>1000,31356=>1000,31357=>1000,31358=>1000,31359=>1000,31360=>1000,31361=>1000,31362=>1000,31363=>1000,31364=>1000, - 31365=>1000,31366=>1000,31367=>1000,31368=>1000,31369=>1000,31370=>1000,31371=>1000,31372=>1000,31373=>1000,31374=>1000,31375=>1000,31376=>1000,31377=>1000,31378=>1000,31379=>1000,31380=>1000, - 31381=>1000,31382=>1000,31383=>1000,31384=>1000,31385=>1000,31386=>1000,31387=>1000,31388=>1000,31389=>1000,31390=>1000,31391=>1000,31392=>1000,31393=>1000,31394=>1000,31395=>1000,31396=>1000, - 31397=>1000,31398=>1000,31399=>1000,31400=>1000,31401=>1000,31402=>1000,31403=>1000,31404=>1000,31405=>1000,31406=>1000,31407=>1000,31408=>1000,31409=>1000,31410=>1000,31411=>1000,31412=>1000, - 31413=>1000,31414=>1000,31415=>1000,31416=>1000,31417=>1000,31418=>1000,31419=>1000,31420=>1000,31421=>1000,31422=>1000,31423=>1000,31424=>1000,31425=>1000,31426=>1000,31427=>1000,31428=>1000, - 31429=>1000,31430=>1000,31431=>1000,31432=>1000,31433=>1000,31434=>1000,31435=>1000,31436=>1000,31437=>1000,31438=>1000,31439=>1000,31440=>1000,31441=>1000,31442=>1000,31443=>1000,31444=>1000, - 31445=>1000,31446=>1000,31447=>1000,31448=>1000,31449=>1000,31450=>1000,31451=>1000,31452=>1000,31453=>1000,31454=>1000,31455=>1000,31456=>1000,31457=>1000,31458=>1000,31459=>1000,31460=>1000, - 31461=>1000,31462=>1000,31463=>1000,31464=>1000,31465=>1000,31466=>1000,31467=>1000,31468=>1000,31469=>1000,31470=>1000,31471=>1000,31472=>1000,31473=>1000,31474=>1000,31475=>1000,31476=>1000, - 31477=>1000,31478=>1000,31479=>1000,31480=>1000,31481=>1000,31482=>1000,31483=>1000,31484=>1000,31485=>1000,31486=>1000,31487=>1000,31488=>1000,31489=>1000,31490=>1000,31491=>1000,31492=>1000, - 31493=>1000,31494=>1000,31495=>1000,31496=>1000,31497=>1000,31498=>1000,31499=>1000,31500=>1000,31501=>1000,31502=>1000,31503=>1000,31504=>1000,31505=>1000,31506=>1000,31507=>1000,31508=>1000, - 31509=>1000,31510=>1000,31511=>1000,31512=>1000,31513=>1000,31514=>1000,31515=>1000,31516=>1000,31517=>1000,31518=>1000,31519=>1000,31520=>1000,31521=>1000,31522=>1000,31523=>1000,31524=>1000, - 31525=>1000,31526=>1000,31527=>1000,31528=>1000,31529=>1000,31530=>1000,31531=>1000,31532=>1000,31533=>1000,31534=>1000,31535=>1000,31536=>1000,31537=>1000,31538=>1000,31539=>1000,31540=>1000, - 31541=>1000,31542=>1000,31543=>1000,31544=>1000,31545=>1000,31546=>1000,31547=>1000,31548=>1000,31549=>1000,31550=>1000,31551=>1000,31552=>1000,31553=>1000,31554=>1000,31555=>1000,31556=>1000, - 31557=>1000,31558=>1000,31559=>1000,31560=>1000,31561=>1000,31562=>1000,31563=>1000,31564=>1000,31565=>1000,31566=>1000,31567=>1000,31568=>1000,31569=>1000,31570=>1000,31571=>1000,31572=>1000, - 31573=>1000,31574=>1000,31575=>1000,31576=>1000,31577=>1000,31578=>1000,31579=>1000,31580=>1000,31581=>1000,31582=>1000,31583=>1000,31584=>1000,31585=>1000,31586=>1000,31587=>1000,31588=>1000, - 31589=>1000,31590=>1000,31591=>1000,31592=>1000,31593=>1000,31594=>1000,31595=>1000,31596=>1000,31597=>1000,31598=>1000,31599=>1000,31600=>1000,31601=>1000,31602=>1000,31603=>1000,31604=>1000, - 31605=>1000,31606=>1000,31607=>1000,31608=>1000,31609=>1000,31610=>1000,31611=>1000,31612=>1000,31613=>1000,31614=>1000,31615=>1000,31616=>1000,31617=>1000,31618=>1000,31619=>1000,31620=>1000, - 31621=>1000,31622=>1000,31623=>1000,31624=>1000,31625=>1000,31626=>1000,31627=>1000,31628=>1000,31629=>1000,31630=>1000,31631=>1000,31632=>1000,31633=>1000,31634=>1000,31635=>1000,31636=>1000, - 31637=>1000,31638=>1000,31639=>1000,31640=>1000,31641=>1000,31642=>1000,31643=>1000,31644=>1000,31645=>1000,31646=>1000,31647=>1000,31648=>1000,31649=>1000,31650=>1000,31651=>1000,31652=>1000, - 31653=>1000,31654=>1000,31655=>1000,31656=>1000,31657=>1000,31658=>1000,31659=>1000,31660=>1000,31661=>1000,31662=>1000,31663=>1000,31664=>1000,31665=>1000,31666=>1000,31667=>1000,31668=>1000, - 31669=>1000,31670=>1000,31671=>1000,31672=>1000,31673=>1000,31674=>1000,31675=>1000,31676=>1000,31677=>1000,31678=>1000,31679=>1000,31680=>1000,31681=>1000,31682=>1000,31683=>1000,31684=>1000, - 31685=>1000,31686=>1000,31687=>1000,31688=>1000,31689=>1000,31690=>1000,31691=>1000,31692=>1000,31693=>1000,31694=>1000,31695=>1000,31696=>1000,31697=>1000,31698=>1000,31699=>1000,31700=>1000, - 31701=>1000,31702=>1000,31703=>1000,31704=>1000,31705=>1000,31706=>1000,31707=>1000,31708=>1000,31709=>1000,31710=>1000,31711=>1000,31712=>1000,31713=>1000,31714=>1000,31715=>1000,31716=>1000, - 31717=>1000,31718=>1000,31719=>1000,31720=>1000,31721=>1000,31722=>1000,31723=>1000,31724=>1000,31725=>1000,31726=>1000,31727=>1000,31728=>1000,31729=>1000,31730=>1000,31731=>1000,31732=>1000, - 31733=>1000,31734=>1000,31735=>1000,31736=>1000,31737=>1000,31738=>1000,31739=>1000,31740=>1000,31741=>1000,31742=>1000,31743=>1000,31744=>1000,31745=>1000,31746=>1000,31747=>1000,31748=>1000, - 31749=>1000,31750=>1000,31751=>1000,31752=>1000,31753=>1000,31754=>1000,31755=>1000,31756=>1000,31757=>1000,31758=>1000,31759=>1000,31760=>1000,31761=>1000,31762=>1000,31763=>1000,31764=>1000, - 31765=>1000,31766=>1000,31767=>1000,31768=>1000,31769=>1000,31770=>1000,31771=>1000,31772=>1000,31773=>1000,31774=>1000,31775=>1000,31776=>1000,31777=>1000,31778=>1000,31779=>1000,31780=>1000, - 31781=>1000,31782=>1000,31783=>1000,31784=>1000,31785=>1000,31786=>1000,31787=>1000,31788=>1000,31789=>1000,31790=>1000,31791=>1000,31792=>1000,31793=>1000,31794=>1000,31795=>1000,31796=>1000, - 31797=>1000,31798=>1000,31799=>1000,31800=>1000,31801=>1000,31802=>1000,31803=>1000,31804=>1000,31805=>1000,31806=>1000,31807=>1000,31808=>1000,31809=>1000,31810=>1000,31811=>1000,31812=>1000, - 31813=>1000,31814=>1000,31815=>1000,31816=>1000,31817=>1000,31818=>1000,31819=>1000,31820=>1000,31821=>1000,31822=>1000,31823=>1000,31824=>1000,31825=>1000,31826=>1000,31827=>1000,31828=>1000, - 31829=>1000,31830=>1000,31831=>1000,31832=>1000,31833=>1000,31834=>1000,31835=>1000,31836=>1000,31837=>1000,31838=>1000,31839=>1000,31840=>1000,31841=>1000,31842=>1000,31843=>1000,31844=>1000, - 31845=>1000,31846=>1000,31847=>1000,31848=>1000,31849=>1000,31850=>1000,31851=>1000,31852=>1000,31853=>1000,31854=>1000,31855=>1000,31856=>1000,31857=>1000,31858=>1000,31859=>1000,31860=>1000, - 31861=>1000,31862=>1000,31863=>1000,31864=>1000,31865=>1000,31866=>1000,31867=>1000,31868=>1000,31869=>1000,31870=>1000,31871=>1000,31872=>1000,31873=>1000,31874=>1000,31875=>1000,31876=>1000, - 31877=>1000,31878=>1000,31879=>1000,31880=>1000,31881=>1000,31882=>1000,31883=>1000,31884=>1000,31885=>1000,31886=>1000,31887=>1000,31888=>1000,31889=>1000,31890=>1000,31891=>1000,31892=>1000, - 31893=>1000,31894=>1000,31895=>1000,31896=>1000,31897=>1000,31898=>1000,31899=>1000,31900=>1000,31901=>1000,31902=>1000,31903=>1000,31904=>1000,31905=>1000,31906=>1000,31907=>1000,31908=>1000, - 31909=>1000,31910=>1000,31911=>1000,31912=>1000,31913=>1000,31914=>1000,31915=>1000,31916=>1000,31917=>1000,31918=>1000,31919=>1000,31920=>1000,31921=>1000,31922=>1000,31923=>1000,31924=>1000, - 31925=>1000,31926=>1000,31927=>1000,31928=>1000,31929=>1000,31930=>1000,31931=>1000,31932=>1000,31933=>1000,31934=>1000,31935=>1000,31936=>1000,31937=>1000,31938=>1000,31939=>1000,31940=>1000, - 31941=>1000,31942=>1000,31943=>1000,31944=>1000,31945=>1000,31946=>1000,31947=>1000,31948=>1000,31949=>1000,31950=>1000,31951=>1000,31952=>1000,31953=>1000,31954=>1000,31955=>1000,31956=>1000, - 31957=>1000,31958=>1000,31959=>1000,31960=>1000,31961=>1000,31962=>1000,31963=>1000,31964=>1000,31965=>1000,31966=>1000,31967=>1000,31968=>1000,31969=>1000,31970=>1000,31971=>1000,31972=>1000, - 31973=>1000,31974=>1000,31975=>1000,31976=>1000,31977=>1000,31978=>1000,31979=>1000,31980=>1000,31981=>1000,31982=>1000,31983=>1000,31984=>1000,31985=>1000,31986=>1000,31987=>1000,31988=>1000, - 31989=>1000,31990=>1000,31991=>1000,31992=>1000,31993=>1000,31994=>1000,31995=>1000,31996=>1000,31997=>1000,31998=>1000,31999=>1000,32000=>1000,32001=>1000,32002=>1000,32003=>1000,32004=>1000, - 32005=>1000,32006=>1000,32007=>1000,32008=>1000,32009=>1000,32010=>1000,32011=>1000,32012=>1000,32013=>1000,32014=>1000,32015=>1000,32016=>1000,32017=>1000,32018=>1000,32019=>1000,32020=>1000, - 32021=>1000,32022=>1000,32023=>1000,32024=>1000,32025=>1000,32026=>1000,32027=>1000,32028=>1000,32029=>1000,32030=>1000,32031=>1000,32032=>1000,32033=>1000,32034=>1000,32035=>1000,32036=>1000, - 32037=>1000,32038=>1000,32039=>1000,32040=>1000,32041=>1000,32042=>1000,32043=>1000,32044=>1000,32045=>1000,32046=>1000,32047=>1000,32048=>1000,32049=>1000,32050=>1000,32051=>1000,32052=>1000, - 32053=>1000,32054=>1000,32055=>1000,32056=>1000,32057=>1000,32058=>1000,32059=>1000,32060=>1000,32061=>1000,32062=>1000,32063=>1000,32064=>1000,32065=>1000,32066=>1000,32067=>1000,32068=>1000, - 32069=>1000,32070=>1000,32071=>1000,32072=>1000,32073=>1000,32074=>1000,32075=>1000,32076=>1000,32077=>1000,32078=>1000,32079=>1000,32080=>1000,32081=>1000,32082=>1000,32083=>1000,32084=>1000, - 32085=>1000,32086=>1000,32087=>1000,32088=>1000,32089=>1000,32090=>1000,32091=>1000,32092=>1000,32093=>1000,32094=>1000,32095=>1000,32096=>1000,32097=>1000,32098=>1000,32099=>1000,32100=>1000, - 32101=>1000,32102=>1000,32103=>1000,32104=>1000,32105=>1000,32106=>1000,32107=>1000,32108=>1000,32109=>1000,32110=>1000,32111=>1000,32112=>1000,32113=>1000,32114=>1000,32115=>1000,32116=>1000, - 32117=>1000,32118=>1000,32119=>1000,32120=>1000,32121=>1000,32122=>1000,32123=>1000,32124=>1000,32125=>1000,32126=>1000,32127=>1000,32128=>1000,32129=>1000,32130=>1000,32131=>1000,32132=>1000, - 32133=>1000,32134=>1000,32135=>1000,32136=>1000,32137=>1000,32138=>1000,32139=>1000,32140=>1000,32141=>1000,32142=>1000,32143=>1000,32144=>1000,32145=>1000,32146=>1000,32147=>1000,32148=>1000, - 32149=>1000,32150=>1000,32151=>1000,32152=>1000,32153=>1000,32154=>1000,32155=>1000,32156=>1000,32157=>1000,32158=>1000,32159=>1000,32160=>1000,32161=>1000,32162=>1000,32163=>1000,32164=>1000, - 32165=>1000,32166=>1000,32167=>1000,32168=>1000,32169=>1000,32170=>1000,32171=>1000,32172=>1000,32173=>1000,32174=>1000,32175=>1000,32176=>1000,32177=>1000,32178=>1000,32179=>1000,32180=>1000, - 32181=>1000,32182=>1000,32183=>1000,32184=>1000,32185=>1000,32186=>1000,32187=>1000,32188=>1000,32189=>1000,32190=>1000,32191=>1000,32192=>1000,32193=>1000,32194=>1000,32195=>1000,32196=>1000, - 32197=>1000,32198=>1000,32199=>1000,32200=>1000,32201=>1000,32202=>1000,32203=>1000,32204=>1000,32205=>1000,32206=>1000,32207=>1000,32208=>1000,32209=>1000,32210=>1000,32211=>1000,32212=>1000, - 32213=>1000,32214=>1000,32215=>1000,32216=>1000,32217=>1000,32218=>1000,32219=>1000,32220=>1000,32221=>1000,32222=>1000,32223=>1000,32224=>1000,32225=>1000,32226=>1000,32227=>1000,32228=>1000, - 32229=>1000,32230=>1000,32231=>1000,32232=>1000,32233=>1000,32234=>1000,32235=>1000,32236=>1000,32237=>1000,32238=>1000,32239=>1000,32240=>1000,32241=>1000,32242=>1000,32243=>1000,32244=>1000, - 32245=>1000,32246=>1000,32247=>1000,32248=>1000,32249=>1000,32250=>1000,32251=>1000,32252=>1000,32253=>1000,32254=>1000,32255=>1000,32256=>1000,32257=>1000,32258=>1000,32259=>1000,32260=>1000, - 32261=>1000,32262=>1000,32263=>1000,32264=>1000,32265=>1000,32266=>1000,32267=>1000,32268=>1000,32269=>1000,32270=>1000,32271=>1000,32272=>1000,32273=>1000,32274=>1000,32275=>1000,32276=>1000, - 32277=>1000,32278=>1000,32279=>1000,32280=>1000,32281=>1000,32282=>1000,32283=>1000,32284=>1000,32285=>1000,32286=>1000,32287=>1000,32288=>1000,32289=>1000,32290=>1000,32291=>1000,32292=>1000, - 32293=>1000,32294=>1000,32295=>1000,32296=>1000,32297=>1000,32298=>1000,32299=>1000,32300=>1000,32301=>1000,32302=>1000,32303=>1000,32304=>1000,32305=>1000,32306=>1000,32307=>1000,32308=>1000, - 32309=>1000,32310=>1000,32311=>1000,32312=>1000,32313=>1000,32314=>1000,32315=>1000,32316=>1000,32317=>1000,32318=>1000,32319=>1000,32320=>1000,32321=>1000,32322=>1000,32323=>1000,32324=>1000, - 32325=>1000,32326=>1000,32327=>1000,32328=>1000,32329=>1000,32330=>1000,32331=>1000,32332=>1000,32333=>1000,32334=>1000,32335=>1000,32336=>1000,32337=>1000,32338=>1000,32339=>1000,32340=>1000, - 32341=>1000,32342=>1000,32343=>1000,32344=>1000,32345=>1000,32346=>1000,32347=>1000,32348=>1000,32349=>1000,32350=>1000,32351=>1000,32352=>1000,32353=>1000,32354=>1000,32355=>1000,32356=>1000, - 32357=>1000,32358=>1000,32359=>1000,32360=>1000,32361=>1000,32362=>1000,32363=>1000,32364=>1000,32365=>1000,32366=>1000,32367=>1000,32368=>1000,32369=>1000,32370=>1000,32371=>1000,32372=>1000, - 32373=>1000,32374=>1000,32375=>1000,32376=>1000,32377=>1000,32378=>1000,32379=>1000,32380=>1000,32381=>1000,32382=>1000,32383=>1000,32384=>1000,32385=>1000,32386=>1000,32387=>1000,32388=>1000, - 32389=>1000,32390=>1000,32391=>1000,32392=>1000,32393=>1000,32394=>1000,32395=>1000,32396=>1000,32397=>1000,32398=>1000,32399=>1000,32400=>1000,32401=>1000,32402=>1000,32403=>1000,32404=>1000, - 32405=>1000,32406=>1000,32407=>1000,32408=>1000,32409=>1000,32410=>1000,32411=>1000,32412=>1000,32413=>1000,32414=>1000,32415=>1000,32416=>1000,32417=>1000,32418=>1000,32419=>1000,32420=>1000, - 32421=>1000,32422=>1000,32423=>1000,32424=>1000,32425=>1000,32426=>1000,32427=>1000,32428=>1000,32429=>1000,32430=>1000,32431=>1000,32432=>1000,32433=>1000,32434=>1000,32435=>1000,32436=>1000, - 32437=>1000,32438=>1000,32439=>1000,32440=>1000,32441=>1000,32442=>1000,32443=>1000,32444=>1000,32445=>1000,32446=>1000,32447=>1000,32448=>1000,32449=>1000,32450=>1000,32451=>1000,32452=>1000, - 32453=>1000,32454=>1000,32455=>1000,32456=>1000,32457=>1000,32458=>1000,32459=>1000,32460=>1000,32461=>1000,32462=>1000,32463=>1000,32464=>1000,32465=>1000,32466=>1000,32467=>1000,32468=>1000, - 32469=>1000,32470=>1000,32471=>1000,32472=>1000,32473=>1000,32474=>1000,32475=>1000,32476=>1000,32477=>1000,32478=>1000,32479=>1000,32480=>1000,32481=>1000,32482=>1000,32483=>1000,32484=>1000, - 32485=>1000,32486=>1000,32487=>1000,32488=>1000,32489=>1000,32490=>1000,32491=>1000,32492=>1000,32493=>1000,32494=>1000,32495=>1000,32496=>1000,32497=>1000,32498=>1000,32499=>1000,32500=>1000, - 32501=>1000,32502=>1000,32503=>1000,32504=>1000,32505=>1000,32506=>1000,32507=>1000,32508=>1000,32509=>1000,32510=>1000,32511=>1000,32512=>1000,32513=>1000,32514=>1000,32515=>1000,32516=>1000, - 32517=>1000,32518=>1000,32519=>1000,32520=>1000,32521=>1000,32522=>1000,32523=>1000,32524=>1000,32525=>1000,32526=>1000,32527=>1000,32528=>1000,32529=>1000,32530=>1000,32531=>1000,32532=>1000, - 32533=>1000,32534=>1000,32535=>1000,32536=>1000,32537=>1000,32538=>1000,32539=>1000,32540=>1000,32541=>1000,32542=>1000,32543=>1000,32544=>1000,32545=>1000,32546=>1000,32547=>1000,32548=>1000, - 32549=>1000,32550=>1000,32551=>1000,32552=>1000,32553=>1000,32554=>1000,32555=>1000,32556=>1000,32557=>1000,32558=>1000,32559=>1000,32560=>1000,32561=>1000,32562=>1000,32563=>1000,32564=>1000, - 32565=>1000,32566=>1000,32567=>1000,32568=>1000,32569=>1000,32570=>1000,32571=>1000,32572=>1000,32573=>1000,32574=>1000,32575=>1000,32576=>1000,32577=>1000,32578=>1000,32579=>1000,32580=>1000, - 32581=>1000,32582=>1000,32583=>1000,32584=>1000,32585=>1000,32586=>1000,32587=>1000,32588=>1000,32589=>1000,32590=>1000,32591=>1000,32592=>1000,32593=>1000,32594=>1000,32595=>1000,32596=>1000, - 32597=>1000,32598=>1000,32599=>1000,32600=>1000,32601=>1000,32602=>1000,32603=>1000,32604=>1000,32605=>1000,32606=>1000,32607=>1000,32608=>1000,32609=>1000,32610=>1000,32611=>1000,32612=>1000, - 32613=>1000,32614=>1000,32615=>1000,32616=>1000,32617=>1000,32618=>1000,32619=>1000,32620=>1000,32621=>1000,32622=>1000,32623=>1000,32624=>1000,32625=>1000,32626=>1000,32627=>1000,32628=>1000, - 32629=>1000,32630=>1000,32631=>1000,32632=>1000,32633=>1000,32634=>1000,32635=>1000,32636=>1000,32637=>1000,32638=>1000,32639=>1000,32640=>1000,32641=>1000,32642=>1000,32643=>1000,32644=>1000, - 32645=>1000,32646=>1000,32647=>1000,32648=>1000,32649=>1000,32650=>1000,32651=>1000,32652=>1000,32653=>1000,32654=>1000,32655=>1000,32656=>1000,32657=>1000,32658=>1000,32659=>1000,32660=>1000, - 32661=>1000,32662=>1000,32663=>1000,32664=>1000,32665=>1000,32666=>1000,32667=>1000,32668=>1000,32669=>1000,32670=>1000,32671=>1000,32672=>1000,32673=>1000,32674=>1000,32675=>1000,32676=>1000, - 32677=>1000,32678=>1000,32679=>1000,32680=>1000,32681=>1000,32682=>1000,32683=>1000,32684=>1000,32685=>1000,32686=>1000,32687=>1000,32688=>1000,32689=>1000,32690=>1000,32691=>1000,32692=>1000, - 32693=>1000,32694=>1000,32695=>1000,32696=>1000,32697=>1000,32698=>1000,32699=>1000,32700=>1000,32701=>1000,32702=>1000,32703=>1000,32704=>1000,32705=>1000,32706=>1000,32707=>1000,32708=>1000, - 32709=>1000,32710=>1000,32711=>1000,32712=>1000,32713=>1000,32714=>1000,32715=>1000,32716=>1000,32717=>1000,32718=>1000,32719=>1000,32720=>1000,32721=>1000,32722=>1000,32723=>1000,32724=>1000, - 32725=>1000,32726=>1000,32727=>1000,32728=>1000,32729=>1000,32730=>1000,32731=>1000,32732=>1000,32733=>1000,32734=>1000,32735=>1000,32736=>1000,32737=>1000,32738=>1000,32739=>1000,32740=>1000, - 32741=>1000,32742=>1000,32743=>1000,32744=>1000,32745=>1000,32746=>1000,32747=>1000,32748=>1000,32749=>1000,32750=>1000,32751=>1000,32752=>1000,32753=>1000,32754=>1000,32755=>1000,32756=>1000, - 32757=>1000,32758=>1000,32759=>1000,32760=>1000,32761=>1000,32762=>1000,32763=>1000,32764=>1000,32765=>1000,32766=>1000,32767=>1000,32768=>1000,32769=>1000,32770=>1000,32771=>1000,32772=>1000, - 32773=>1000,32774=>1000,32775=>1000,32776=>1000,32777=>1000,32778=>1000,32779=>1000,32780=>1000,32781=>1000,32782=>1000,32783=>1000,32784=>1000,32785=>1000,32786=>1000,32787=>1000,32788=>1000, - 32789=>1000,32790=>1000,32791=>1000,32792=>1000,32793=>1000,32794=>1000,32795=>1000,32796=>1000,32797=>1000,32798=>1000,32799=>1000,32800=>1000,32801=>1000,32802=>1000,32803=>1000,32804=>1000, - 32805=>1000,32806=>1000,32807=>1000,32808=>1000,32809=>1000,32810=>1000,32811=>1000,32812=>1000,32813=>1000,32814=>1000,32815=>1000,32816=>1000,32817=>1000,32818=>1000,32819=>1000,32820=>1000, - 32821=>1000,32822=>1000,32823=>1000,32824=>1000,32825=>1000,32826=>1000,32827=>1000,32828=>1000,32829=>1000,32830=>1000,32831=>1000,32832=>1000,32833=>1000,32834=>1000,32835=>1000,32836=>1000, - 32837=>1000,32838=>1000,32839=>1000,32840=>1000,32841=>1000,32842=>1000,32843=>1000,32844=>1000,32845=>1000,32846=>1000,32847=>1000,32848=>1000,32849=>1000,32850=>1000,32851=>1000,32852=>1000, - 32853=>1000,32854=>1000,32855=>1000,32856=>1000,32857=>1000,32858=>1000,32859=>1000,32860=>1000,32861=>1000,32862=>1000,32863=>1000,32864=>1000,32865=>1000,32866=>1000,32867=>1000,32868=>1000, - 32869=>1000,32870=>1000,32871=>1000,32872=>1000,32873=>1000,32874=>1000,32875=>1000,32876=>1000,32877=>1000,32878=>1000,32879=>1000,32880=>1000,32881=>1000,32882=>1000,32883=>1000,32884=>1000, - 32885=>1000,32886=>1000,32887=>1000,32888=>1000,32889=>1000,32890=>1000,32891=>1000,32892=>1000,32893=>1000,32894=>1000,32895=>1000,32896=>1000,32897=>1000,32898=>1000,32899=>1000,32900=>1000, - 32901=>1000,32902=>1000,32903=>1000,32904=>1000,32905=>1000,32906=>1000,32907=>1000,32908=>1000,32909=>1000,32910=>1000,32911=>1000,32912=>1000,32913=>1000,32914=>1000,32915=>1000,32916=>1000, - 32917=>1000,32918=>1000,32919=>1000,32920=>1000,32921=>1000,32922=>1000,32923=>1000,32924=>1000,32925=>1000,32926=>1000,32927=>1000,32928=>1000,32929=>1000,32930=>1000,32931=>1000,32932=>1000, - 32933=>1000,32934=>1000,32935=>1000,32936=>1000,32937=>1000,32938=>1000,32939=>1000,32940=>1000,32941=>1000,32942=>1000,32943=>1000,32944=>1000,32945=>1000,32946=>1000,32947=>1000,32948=>1000, - 32949=>1000,32950=>1000,32951=>1000,32952=>1000,32953=>1000,32954=>1000,32955=>1000,32956=>1000,32957=>1000,32958=>1000,32959=>1000,32960=>1000,32961=>1000,32962=>1000,32963=>1000,32964=>1000, - 32965=>1000,32966=>1000,32967=>1000,32968=>1000,32969=>1000,32970=>1000,32971=>1000,32972=>1000,32973=>1000,32974=>1000,32975=>1000,32976=>1000,32977=>1000,32978=>1000,32979=>1000,32980=>1000, - 32981=>1000,32982=>1000,32983=>1000,32984=>1000,32985=>1000,32986=>1000,32987=>1000,32988=>1000,32989=>1000,32990=>1000,32991=>1000,32992=>1000,32993=>1000,32994=>1000,32995=>1000,32996=>1000, - 32997=>1000,32998=>1000,32999=>1000,33000=>1000,33001=>1000,33002=>1000,33003=>1000,33004=>1000,33005=>1000,33006=>1000,33007=>1000,33008=>1000,33009=>1000,33010=>1000,33011=>1000,33012=>1000, - 33013=>1000,33014=>1000,33015=>1000,33016=>1000,33017=>1000,33018=>1000,33019=>1000,33020=>1000,33021=>1000,33022=>1000,33023=>1000,33024=>1000,33025=>1000,33026=>1000,33027=>1000,33028=>1000, - 33029=>1000,33030=>1000,33031=>1000,33032=>1000,33033=>1000,33034=>1000,33035=>1000,33036=>1000,33037=>1000,33038=>1000,33039=>1000,33040=>1000,33041=>1000,33042=>1000,33043=>1000,33044=>1000, - 33045=>1000,33046=>1000,33047=>1000,33048=>1000,33049=>1000,33050=>1000,33051=>1000,33052=>1000,33053=>1000,33054=>1000,33055=>1000,33056=>1000,33057=>1000,33058=>1000,33059=>1000,33060=>1000, - 33061=>1000,33062=>1000,33063=>1000,33064=>1000,33065=>1000,33066=>1000,33067=>1000,33068=>1000,33069=>1000,33070=>1000,33071=>1000,33072=>1000,33073=>1000,33074=>1000,33075=>1000,33076=>1000, - 33077=>1000,33078=>1000,33079=>1000,33080=>1000,33081=>1000,33082=>1000,33083=>1000,33084=>1000,33085=>1000,33086=>1000,33087=>1000,33088=>1000,33089=>1000,33090=>1000,33091=>1000,33092=>1000, - 33093=>1000,33094=>1000,33095=>1000,33096=>1000,33097=>1000,33098=>1000,33099=>1000,33100=>1000,33101=>1000,33102=>1000,33103=>1000,33104=>1000,33105=>1000,33106=>1000,33107=>1000,33108=>1000, - 33109=>1000,33110=>1000,33111=>1000,33112=>1000,33113=>1000,33114=>1000,33115=>1000,33116=>1000,33117=>1000,33118=>1000,33119=>1000,33120=>1000,33121=>1000,33122=>1000,33123=>1000,33124=>1000, - 33125=>1000,33126=>1000,33127=>1000,33128=>1000,33129=>1000,33130=>1000,33131=>1000,33132=>1000,33133=>1000,33134=>1000,33135=>1000,33136=>1000,33137=>1000,33138=>1000,33139=>1000,33140=>1000, - 33141=>1000,33142=>1000,33143=>1000,33144=>1000,33145=>1000,33146=>1000,33147=>1000,33148=>1000,33149=>1000,33150=>1000,33151=>1000,33152=>1000,33153=>1000,33154=>1000,33155=>1000,33156=>1000, - 33157=>1000,33158=>1000,33159=>1000,33160=>1000,33161=>1000,33162=>1000,33163=>1000,33164=>1000,33165=>1000,33166=>1000,33167=>1000,33168=>1000,33169=>1000,33170=>1000,33171=>1000,33172=>1000, - 33173=>1000,33174=>1000,33175=>1000,33176=>1000,33177=>1000,33178=>1000,33179=>1000,33180=>1000,33181=>1000,33182=>1000,33183=>1000,33184=>1000,33185=>1000,33186=>1000,33187=>1000,33188=>1000, - 33189=>1000,33190=>1000,33191=>1000,33192=>1000,33193=>1000,33194=>1000,33195=>1000,33196=>1000,33197=>1000,33198=>1000,33199=>1000,33200=>1000,33201=>1000,33202=>1000,33203=>1000,33204=>1000, - 33205=>1000,33206=>1000,33207=>1000,33208=>1000,33209=>1000,33210=>1000,33211=>1000,33212=>1000,33213=>1000,33214=>1000,33215=>1000,33216=>1000,33217=>1000,33218=>1000,33219=>1000,33220=>1000, - 33221=>1000,33222=>1000,33223=>1000,33224=>1000,33225=>1000,33226=>1000,33227=>1000,33228=>1000,33229=>1000,33230=>1000,33231=>1000,33232=>1000,33233=>1000,33234=>1000,33235=>1000,33236=>1000, - 33237=>1000,33238=>1000,33239=>1000,33240=>1000,33241=>1000,33242=>1000,33243=>1000,33244=>1000,33245=>1000,33246=>1000,33247=>1000,33248=>1000,33249=>1000,33250=>1000,33251=>1000,33252=>1000, - 33253=>1000,33254=>1000,33255=>1000,33256=>1000,33257=>1000,33258=>1000,33259=>1000,33260=>1000,33261=>1000,33262=>1000,33263=>1000,33264=>1000,33265=>1000,33266=>1000,33267=>1000,33268=>1000, - 33269=>1000,33270=>1000,33271=>1000,33272=>1000,33273=>1000,33274=>1000,33275=>1000,33276=>1000,33277=>1000,33278=>1000,33279=>1000,33280=>1000,33281=>1000,33282=>1000,33283=>1000,33284=>1000, - 33285=>1000,33286=>1000,33287=>1000,33288=>1000,33289=>1000,33290=>1000,33291=>1000,33292=>1000,33293=>1000,33294=>1000,33295=>1000,33296=>1000,33297=>1000,33298=>1000,33299=>1000,33300=>1000, - 33301=>1000,33302=>1000,33303=>1000,33304=>1000,33305=>1000,33306=>1000,33307=>1000,33308=>1000,33309=>1000,33310=>1000,33311=>1000,33312=>1000,33313=>1000,33314=>1000,33315=>1000,33316=>1000, - 33317=>1000,33318=>1000,33319=>1000,33320=>1000,33321=>1000,33322=>1000,33323=>1000,33324=>1000,33325=>1000,33326=>1000,33327=>1000,33328=>1000,33329=>1000,33330=>1000,33331=>1000,33332=>1000, - 33333=>1000,33334=>1000,33335=>1000,33336=>1000,33337=>1000,33338=>1000,33339=>1000,33340=>1000,33341=>1000,33342=>1000,33343=>1000,33344=>1000,33345=>1000,33346=>1000,33347=>1000,33348=>1000, - 33349=>1000,33350=>1000,33351=>1000,33352=>1000,33353=>1000,33354=>1000,33355=>1000,33356=>1000,33357=>1000,33358=>1000,33359=>1000,33360=>1000,33361=>1000,33362=>1000,33363=>1000,33364=>1000, - 33365=>1000,33366=>1000,33367=>1000,33368=>1000,33369=>1000,33370=>1000,33371=>1000,33372=>1000,33373=>1000,33374=>1000,33375=>1000,33376=>1000,33377=>1000,33378=>1000,33379=>1000,33380=>1000, - 33381=>1000,33382=>1000,33383=>1000,33384=>1000,33385=>1000,33386=>1000,33387=>1000,33388=>1000,33389=>1000,33390=>1000,33391=>1000,33392=>1000,33393=>1000,33394=>1000,33395=>1000,33396=>1000, - 33397=>1000,33398=>1000,33399=>1000,33400=>1000,33401=>1000,33402=>1000,33403=>1000,33404=>1000,33405=>1000,33406=>1000,33407=>1000,33408=>1000,33409=>1000,33410=>1000,33411=>1000,33412=>1000, - 33413=>1000,33414=>1000,33415=>1000,33416=>1000,33417=>1000,33418=>1000,33419=>1000,33420=>1000,33421=>1000,33422=>1000,33423=>1000,33424=>1000,33425=>1000,33426=>1000,33427=>1000,33428=>1000, - 33429=>1000,33430=>1000,33431=>1000,33432=>1000,33433=>1000,33434=>1000,33435=>1000,33436=>1000,33437=>1000,33438=>1000,33439=>1000,33440=>1000,33441=>1000,33442=>1000,33443=>1000,33444=>1000, - 33445=>1000,33446=>1000,33447=>1000,33448=>1000,33449=>1000,33450=>1000,33451=>1000,33452=>1000,33453=>1000,33454=>1000,33455=>1000,33456=>1000,33457=>1000,33458=>1000,33459=>1000,33460=>1000, - 33461=>1000,33462=>1000,33463=>1000,33464=>1000,33465=>1000,33466=>1000,33467=>1000,33468=>1000,33469=>1000,33470=>1000,33471=>1000,33472=>1000,33473=>1000,33474=>1000,33475=>1000,33476=>1000, - 33477=>1000,33478=>1000,33479=>1000,33480=>1000,33481=>1000,33482=>1000,33483=>1000,33484=>1000,33485=>1000,33486=>1000,33487=>1000,33488=>1000,33489=>1000,33490=>1000,33491=>1000,33492=>1000, - 33493=>1000,33494=>1000,33495=>1000,33496=>1000,33497=>1000,33498=>1000,33499=>1000,33500=>1000,33501=>1000,33502=>1000,33503=>1000,33504=>1000,33505=>1000,33506=>1000,33507=>1000,33508=>1000, - 33509=>1000,33510=>1000,33511=>1000,33512=>1000,33513=>1000,33514=>1000,33515=>1000,33516=>1000,33517=>1000,33518=>1000,33519=>1000,33520=>1000,33521=>1000,33522=>1000,33523=>1000,33524=>1000, - 33525=>1000,33526=>1000,33527=>1000,33528=>1000,33529=>1000,33530=>1000,33531=>1000,33532=>1000,33533=>1000,33534=>1000,33535=>1000,33536=>1000,33537=>1000,33538=>1000,33539=>1000,33540=>1000, - 33541=>1000,33542=>1000,33543=>1000,33544=>1000,33545=>1000,33546=>1000,33547=>1000,33548=>1000,33549=>1000,33550=>1000,33551=>1000,33552=>1000,33553=>1000,33554=>1000,33555=>1000,33556=>1000, - 33557=>1000,33558=>1000,33559=>1000,33560=>1000,33561=>1000,33562=>1000,33563=>1000,33564=>1000,33565=>1000,33566=>1000,33567=>1000,33568=>1000,33569=>1000,33570=>1000,33571=>1000,33572=>1000, - 33573=>1000,33574=>1000,33575=>1000,33576=>1000,33577=>1000,33578=>1000,33579=>1000,33580=>1000,33581=>1000,33582=>1000,33583=>1000,33584=>1000,33585=>1000,33586=>1000,33587=>1000,33588=>1000, - 33589=>1000,33590=>1000,33591=>1000,33592=>1000,33593=>1000,33594=>1000,33595=>1000,33596=>1000,33597=>1000,33598=>1000,33599=>1000,33600=>1000,33601=>1000,33602=>1000,33603=>1000,33604=>1000, - 33605=>1000,33606=>1000,33607=>1000,33608=>1000,33609=>1000,33610=>1000,33611=>1000,33612=>1000,33613=>1000,33614=>1000,33615=>1000,33616=>1000,33617=>1000,33618=>1000,33619=>1000,33620=>1000, - 33621=>1000,33622=>1000,33623=>1000,33624=>1000,33625=>1000,33626=>1000,33627=>1000,33628=>1000,33629=>1000,33630=>1000,33631=>1000,33632=>1000,33633=>1000,33634=>1000,33635=>1000,33636=>1000, - 33637=>1000,33638=>1000,33639=>1000,33640=>1000,33641=>1000,33642=>1000,33643=>1000,33644=>1000,33645=>1000,33646=>1000,33647=>1000,33648=>1000,33649=>1000,33650=>1000,33651=>1000,33652=>1000, - 33653=>1000,33654=>1000,33655=>1000,33656=>1000,33657=>1000,33658=>1000,33659=>1000,33660=>1000,33661=>1000,33662=>1000,33663=>1000,33664=>1000,33665=>1000,33666=>1000,33667=>1000,33668=>1000, - 33669=>1000,33670=>1000,33671=>1000,33672=>1000,33673=>1000,33674=>1000,33675=>1000,33676=>1000,33677=>1000,33678=>1000,33679=>1000,33680=>1000,33681=>1000,33682=>1000,33683=>1000,33684=>1000, - 33685=>1000,33686=>1000,33687=>1000,33688=>1000,33689=>1000,33690=>1000,33691=>1000,33692=>1000,33693=>1000,33694=>1000,33695=>1000,33696=>1000,33697=>1000,33698=>1000,33699=>1000,33700=>1000, - 33701=>1000,33702=>1000,33703=>1000,33704=>1000,33705=>1000,33706=>1000,33707=>1000,33708=>1000,33709=>1000,33710=>1000,33711=>1000,33712=>1000,33713=>1000,33714=>1000,33715=>1000,33716=>1000, - 33717=>1000,33718=>1000,33719=>1000,33720=>1000,33721=>1000,33722=>1000,33723=>1000,33724=>1000,33725=>1000,33726=>1000,33727=>1000,33728=>1000,33729=>1000,33730=>1000,33731=>1000,33732=>1000, - 33733=>1000,33734=>1000,33735=>1000,33736=>1000,33737=>1000,33738=>1000,33739=>1000,33740=>1000,33741=>1000,33742=>1000,33743=>1000,33744=>1000,33745=>1000,33746=>1000,33747=>1000,33748=>1000, - 33749=>1000,33750=>1000,33751=>1000,33752=>1000,33753=>1000,33754=>1000,33755=>1000,33756=>1000,33757=>1000,33758=>1000,33759=>1000,33760=>1000,33761=>1000,33762=>1000,33763=>1000,33764=>1000, - 33765=>1000,33766=>1000,33767=>1000,33768=>1000,33769=>1000,33770=>1000,33771=>1000,33772=>1000,33773=>1000,33774=>1000,33775=>1000,33776=>1000,33777=>1000,33778=>1000,33779=>1000,33780=>1000, - 33781=>1000,33782=>1000,33783=>1000,33784=>1000,33785=>1000,33786=>1000,33787=>1000,33788=>1000,33789=>1000,33790=>1000,33791=>1000,33792=>1000,33793=>1000,33794=>1000,33795=>1000,33796=>1000, - 33797=>1000,33798=>1000,33799=>1000,33800=>1000,33801=>1000,33802=>1000,33803=>1000,33804=>1000,33805=>1000,33806=>1000,33807=>1000,33808=>1000,33809=>1000,33810=>1000,33811=>1000,33812=>1000, - 33813=>1000,33814=>1000,33815=>1000,33816=>1000,33817=>1000,33818=>1000,33819=>1000,33820=>1000,33821=>1000,33822=>1000,33823=>1000,33824=>1000,33825=>1000,33826=>1000,33827=>1000,33828=>1000, - 33829=>1000,33830=>1000,33831=>1000,33832=>1000,33833=>1000,33834=>1000,33835=>1000,33836=>1000,33837=>1000,33838=>1000,33839=>1000,33840=>1000,33841=>1000,33842=>1000,33843=>1000,33844=>1000, - 33845=>1000,33846=>1000,33847=>1000,33848=>1000,33849=>1000,33850=>1000,33851=>1000,33852=>1000,33853=>1000,33854=>1000,33855=>1000,33856=>1000,33857=>1000,33858=>1000,33859=>1000,33860=>1000, - 33861=>1000,33862=>1000,33863=>1000,33864=>1000,33865=>1000,33866=>1000,33867=>1000,33868=>1000,33869=>1000,33870=>1000,33871=>1000,33872=>1000,33873=>1000,33874=>1000,33875=>1000,33876=>1000, - 33877=>1000,33878=>1000,33879=>1000,33880=>1000,33881=>1000,33882=>1000,33883=>1000,33884=>1000,33885=>1000,33886=>1000,33887=>1000,33888=>1000,33889=>1000,33890=>1000,33891=>1000,33892=>1000, - 33893=>1000,33894=>1000,33895=>1000,33896=>1000,33897=>1000,33898=>1000,33899=>1000,33900=>1000,33901=>1000,33902=>1000,33903=>1000,33904=>1000,33905=>1000,33906=>1000,33907=>1000,33908=>1000, - 33909=>1000,33910=>1000,33911=>1000,33912=>1000,33913=>1000,33914=>1000,33915=>1000,33916=>1000,33917=>1000,33918=>1000,33919=>1000,33920=>1000,33921=>1000,33922=>1000,33923=>1000,33924=>1000, - 33925=>1000,33926=>1000,33927=>1000,33928=>1000,33929=>1000,33930=>1000,33931=>1000,33932=>1000,33933=>1000,33934=>1000,33935=>1000,33936=>1000,33937=>1000,33938=>1000,33939=>1000,33940=>1000, - 33941=>1000,33942=>1000,33943=>1000,33944=>1000,33945=>1000,33946=>1000,33947=>1000,33948=>1000,33949=>1000,33950=>1000,33951=>1000,33952=>1000,33953=>1000,33954=>1000,33955=>1000,33956=>1000, - 33957=>1000,33958=>1000,33959=>1000,33960=>1000,33961=>1000,33962=>1000,33963=>1000,33964=>1000,33965=>1000,33966=>1000,33967=>1000,33968=>1000,33969=>1000,33970=>1000,33971=>1000,33972=>1000, - 33973=>1000,33974=>1000,33975=>1000,33976=>1000,33977=>1000,33978=>1000,33979=>1000,33980=>1000,33981=>1000,33982=>1000,33983=>1000,33984=>1000,33985=>1000,33986=>1000,33987=>1000,33988=>1000, - 33989=>1000,33990=>1000,33991=>1000,33992=>1000,33993=>1000,33994=>1000,33995=>1000,33996=>1000,33997=>1000,33998=>1000,33999=>1000,34000=>1000,34001=>1000,34002=>1000,34003=>1000,34004=>1000, - 34005=>1000,34006=>1000,34007=>1000,34008=>1000,34009=>1000,34010=>1000,34011=>1000,34012=>1000,34013=>1000,34014=>1000,34015=>1000,34016=>1000,34017=>1000,34018=>1000,34019=>1000,34020=>1000, - 34021=>1000,34022=>1000,34023=>1000,34024=>1000,34025=>1000,34026=>1000,34027=>1000,34028=>1000,34029=>1000,34030=>1000,34031=>1000,34032=>1000,34033=>1000,34034=>1000,34035=>1000,34036=>1000, - 34037=>1000,34038=>1000,34039=>1000,34040=>1000,34041=>1000,34042=>1000,34043=>1000,34044=>1000,34045=>1000,34046=>1000,34047=>1000,34048=>1000,34049=>1000,34050=>1000,34051=>1000,34052=>1000, - 34053=>1000,34054=>1000,34055=>1000,34056=>1000,34057=>1000,34058=>1000,34059=>1000,34060=>1000,34061=>1000,34062=>1000,34063=>1000,34064=>1000,34065=>1000,34066=>1000,34067=>1000,34068=>1000, - 34069=>1000,34070=>1000,34071=>1000,34072=>1000,34073=>1000,34074=>1000,34075=>1000,34076=>1000,34077=>1000,34078=>1000,34079=>1000,34080=>1000,34081=>1000,34082=>1000,34083=>1000,34084=>1000, - 34085=>1000,34086=>1000,34087=>1000,34088=>1000,34089=>1000,34090=>1000,34091=>1000,34092=>1000,34093=>1000,34094=>1000,34095=>1000,34096=>1000,34097=>1000,34098=>1000,34099=>1000,34100=>1000, - 34101=>1000,34102=>1000,34103=>1000,34104=>1000,34105=>1000,34106=>1000,34107=>1000,34108=>1000,34109=>1000,34110=>1000,34111=>1000,34112=>1000,34113=>1000,34114=>1000,34115=>1000,34116=>1000, - 34117=>1000,34118=>1000,34119=>1000,34120=>1000,34121=>1000,34122=>1000,34123=>1000,34124=>1000,34125=>1000,34126=>1000,34127=>1000,34128=>1000,34129=>1000,34130=>1000,34131=>1000,34132=>1000, - 34133=>1000,34134=>1000,34135=>1000,34136=>1000,34137=>1000,34138=>1000,34139=>1000,34140=>1000,34141=>1000,34142=>1000,34143=>1000,34144=>1000,34145=>1000,34146=>1000,34147=>1000,34148=>1000, - 34149=>1000,34150=>1000,34151=>1000,34152=>1000,34153=>1000,34154=>1000,34155=>1000,34156=>1000,34157=>1000,34158=>1000,34159=>1000,34160=>1000,34161=>1000,34162=>1000,34163=>1000,34164=>1000, - 34165=>1000,34166=>1000,34167=>1000,34168=>1000,34169=>1000,34170=>1000,34171=>1000,34172=>1000,34173=>1000,34174=>1000,34175=>1000,34176=>1000,34177=>1000,34178=>1000,34179=>1000,34180=>1000, - 34181=>1000,34182=>1000,34183=>1000,34184=>1000,34185=>1000,34186=>1000,34187=>1000,34188=>1000,34189=>1000,34190=>1000,34191=>1000,34192=>1000,34193=>1000,34194=>1000,34195=>1000,34196=>1000, - 34197=>1000,34198=>1000,34199=>1000,34200=>1000,34201=>1000,34202=>1000,34203=>1000,34204=>1000,34205=>1000,34206=>1000,34207=>1000,34208=>1000,34209=>1000,34210=>1000,34211=>1000,34212=>1000, - 34213=>1000,34214=>1000,34215=>1000,34216=>1000,34217=>1000,34218=>1000,34219=>1000,34220=>1000,34221=>1000,34222=>1000,34223=>1000,34224=>1000,34225=>1000,34226=>1000,34227=>1000,34228=>1000, - 34229=>1000,34230=>1000,34231=>1000,34232=>1000,34233=>1000,34234=>1000,34235=>1000,34236=>1000,34237=>1000,34238=>1000,34239=>1000,34240=>1000,34241=>1000,34242=>1000,34243=>1000,34244=>1000, - 34245=>1000,34246=>1000,34247=>1000,34248=>1000,34249=>1000,34250=>1000,34251=>1000,34252=>1000,34253=>1000,34254=>1000,34255=>1000,34256=>1000,34257=>1000,34258=>1000,34259=>1000,34260=>1000, - 34261=>1000,34262=>1000,34263=>1000,34264=>1000,34265=>1000,34266=>1000,34267=>1000,34268=>1000,34269=>1000,34270=>1000,34271=>1000,34272=>1000,34273=>1000,34274=>1000,34275=>1000,34276=>1000, - 34277=>1000,34278=>1000,34279=>1000,34280=>1000,34281=>1000,34282=>1000,34283=>1000,34284=>1000,34285=>1000,34286=>1000,34287=>1000,34288=>1000,34289=>1000,34290=>1000,34291=>1000,34292=>1000, - 34293=>1000,34294=>1000,34295=>1000,34296=>1000,34297=>1000,34298=>1000,34299=>1000,34300=>1000,34301=>1000,34302=>1000,34303=>1000,34304=>1000,34305=>1000,34306=>1000,34307=>1000,34308=>1000, - 34309=>1000,34310=>1000,34311=>1000,34312=>1000,34313=>1000,34314=>1000,34315=>1000,34316=>1000,34317=>1000,34318=>1000,34319=>1000,34320=>1000,34321=>1000,34322=>1000,34323=>1000,34324=>1000, - 34325=>1000,34326=>1000,34327=>1000,34328=>1000,34329=>1000,34330=>1000,34331=>1000,34332=>1000,34333=>1000,34334=>1000,34335=>1000,34336=>1000,34337=>1000,34338=>1000,34339=>1000,34340=>1000, - 34341=>1000,34342=>1000,34343=>1000,34344=>1000,34345=>1000,34346=>1000,34347=>1000,34348=>1000,34349=>1000,34350=>1000,34351=>1000,34352=>1000,34353=>1000,34354=>1000,34355=>1000,34356=>1000, - 34357=>1000,34358=>1000,34359=>1000,34360=>1000,34361=>1000,34362=>1000,34363=>1000,34364=>1000,34365=>1000,34366=>1000,34367=>1000,34368=>1000,34369=>1000,34370=>1000,34371=>1000,34372=>1000, - 34373=>1000,34374=>1000,34375=>1000,34376=>1000,34377=>1000,34378=>1000,34379=>1000,34380=>1000,34381=>1000,34382=>1000,34383=>1000,34384=>1000,34385=>1000,34386=>1000,34387=>1000,34388=>1000, - 34389=>1000,34390=>1000,34391=>1000,34392=>1000,34393=>1000,34394=>1000,34395=>1000,34396=>1000,34397=>1000,34398=>1000,34399=>1000,34400=>1000,34401=>1000,34402=>1000,34403=>1000,34404=>1000, - 34405=>1000,34406=>1000,34407=>1000,34408=>1000,34409=>1000,34410=>1000,34411=>1000,34412=>1000,34413=>1000,34414=>1000,34415=>1000,34416=>1000,34417=>1000,34418=>1000,34419=>1000,34420=>1000, - 34421=>1000,34422=>1000,34423=>1000,34424=>1000,34425=>1000,34426=>1000,34427=>1000,34428=>1000,34429=>1000,34430=>1000,34431=>1000,34432=>1000,34433=>1000,34434=>1000,34435=>1000,34436=>1000, - 34437=>1000,34438=>1000,34439=>1000,34440=>1000,34441=>1000,34442=>1000,34443=>1000,34444=>1000,34445=>1000,34446=>1000,34447=>1000,34448=>1000,34449=>1000,34450=>1000,34451=>1000,34452=>1000, - 34453=>1000,34454=>1000,34455=>1000,34456=>1000,34457=>1000,34458=>1000,34459=>1000,34460=>1000,34461=>1000,34462=>1000,34463=>1000,34464=>1000,34465=>1000,34466=>1000,34467=>1000,34468=>1000, - 34469=>1000,34470=>1000,34471=>1000,34472=>1000,34473=>1000,34474=>1000,34475=>1000,34476=>1000,34477=>1000,34478=>1000,34479=>1000,34480=>1000,34481=>1000,34482=>1000,34483=>1000,34484=>1000, - 34485=>1000,34486=>1000,34487=>1000,34488=>1000,34489=>1000,34490=>1000,34491=>1000,34492=>1000,34493=>1000,34494=>1000,34495=>1000,34496=>1000,34497=>1000,34498=>1000,34499=>1000,34500=>1000, - 34501=>1000,34502=>1000,34503=>1000,34504=>1000,34505=>1000,34506=>1000,34507=>1000,34508=>1000,34509=>1000,34510=>1000,34511=>1000,34512=>1000,34513=>1000,34514=>1000,34515=>1000,34516=>1000, - 34517=>1000,34518=>1000,34519=>1000,34520=>1000,34521=>1000,34522=>1000,34523=>1000,34524=>1000,34525=>1000,34526=>1000,34527=>1000,34528=>1000,34529=>1000,34530=>1000,34531=>1000,34532=>1000, - 34533=>1000,34534=>1000,34535=>1000,34536=>1000,34537=>1000,34538=>1000,34539=>1000,34540=>1000,34541=>1000,34542=>1000,34543=>1000,34544=>1000,34545=>1000,34546=>1000,34547=>1000,34548=>1000, - 34549=>1000,34550=>1000,34551=>1000,34552=>1000,34553=>1000,34554=>1000,34555=>1000,34556=>1000,34557=>1000,34558=>1000,34559=>1000,34560=>1000,34561=>1000,34562=>1000,34563=>1000,34564=>1000, - 34565=>1000,34566=>1000,34567=>1000,34568=>1000,34569=>1000,34570=>1000,34571=>1000,34572=>1000,34573=>1000,34574=>1000,34575=>1000,34576=>1000,34577=>1000,34578=>1000,34579=>1000,34580=>1000, - 34581=>1000,34582=>1000,34583=>1000,34584=>1000,34585=>1000,34586=>1000,34587=>1000,34588=>1000,34589=>1000,34590=>1000,34591=>1000,34592=>1000,34593=>1000,34594=>1000,34595=>1000,34596=>1000, - 34597=>1000,34598=>1000,34599=>1000,34600=>1000,34601=>1000,34602=>1000,34603=>1000,34604=>1000,34605=>1000,34606=>1000,34607=>1000,34608=>1000,34609=>1000,34610=>1000,34611=>1000,34612=>1000, - 34613=>1000,34614=>1000,34615=>1000,34616=>1000,34617=>1000,34618=>1000,34619=>1000,34620=>1000,34621=>1000,34622=>1000,34623=>1000,34624=>1000,34625=>1000,34626=>1000,34627=>1000,34628=>1000, - 34629=>1000,34630=>1000,34631=>1000,34632=>1000,34633=>1000,34634=>1000,34635=>1000,34636=>1000,34637=>1000,34638=>1000,34639=>1000,34640=>1000,34641=>1000,34642=>1000,34643=>1000,34644=>1000, - 34645=>1000,34646=>1000,34647=>1000,34648=>1000,34649=>1000,34650=>1000,34651=>1000,34652=>1000,34653=>1000,34654=>1000,34655=>1000,34656=>1000,34657=>1000,34658=>1000,34659=>1000,34660=>1000, - 34661=>1000,34662=>1000,34663=>1000,34664=>1000,34665=>1000,34666=>1000,34667=>1000,34668=>1000,34669=>1000,34670=>1000,34671=>1000,34672=>1000,34673=>1000,34674=>1000,34675=>1000,34676=>1000, - 34677=>1000,34678=>1000,34679=>1000,34680=>1000,34681=>1000,34682=>1000,34683=>1000,34684=>1000,34685=>1000,34686=>1000,34687=>1000,34688=>1000,34689=>1000,34690=>1000,34691=>1000,34692=>1000, - 34693=>1000,34694=>1000,34695=>1000,34696=>1000,34697=>1000,34698=>1000,34699=>1000,34700=>1000,34701=>1000,34702=>1000,34703=>1000,34704=>1000,34705=>1000,34706=>1000,34707=>1000,34708=>1000, - 34709=>1000,34710=>1000,34711=>1000,34712=>1000,34713=>1000,34714=>1000,34715=>1000,34716=>1000,34717=>1000,34718=>1000,34719=>1000,34720=>1000,34721=>1000,34722=>1000,34723=>1000,34724=>1000, - 34725=>1000,34726=>1000,34727=>1000,34728=>1000,34729=>1000,34730=>1000,34731=>1000,34732=>1000,34733=>1000,34734=>1000,34735=>1000,34736=>1000,34737=>1000,34738=>1000,34739=>1000,34740=>1000, - 34741=>1000,34742=>1000,34743=>1000,34744=>1000,34745=>1000,34746=>1000,34747=>1000,34748=>1000,34749=>1000,34750=>1000,34751=>1000,34752=>1000,34753=>1000,34754=>1000,34755=>1000,34756=>1000, - 34757=>1000,34758=>1000,34759=>1000,34760=>1000,34761=>1000,34762=>1000,34763=>1000,34764=>1000,34765=>1000,34766=>1000,34767=>1000,34768=>1000,34769=>1000,34770=>1000,34771=>1000,34772=>1000, - 34773=>1000,34774=>1000,34775=>1000,34776=>1000,34777=>1000,34778=>1000,34779=>1000,34780=>1000,34781=>1000,34782=>1000,34783=>1000,34784=>1000,34785=>1000,34786=>1000,34787=>1000,34788=>1000, - 34789=>1000,34790=>1000,34791=>1000,34792=>1000,34793=>1000,34794=>1000,34795=>1000,34796=>1000,34797=>1000,34798=>1000,34799=>1000,34800=>1000,34801=>1000,34802=>1000,34803=>1000,34804=>1000, - 34805=>1000,34806=>1000,34807=>1000,34808=>1000,34809=>1000,34810=>1000,34811=>1000,34812=>1000,34813=>1000,34814=>1000,34815=>1000,34816=>1000,34817=>1000,34818=>1000,34819=>1000,34820=>1000, - 34821=>1000,34822=>1000,34823=>1000,34824=>1000,34825=>1000,34826=>1000,34827=>1000,34828=>1000,34829=>1000,34830=>1000,34831=>1000,34832=>1000,34833=>1000,34834=>1000,34835=>1000,34836=>1000, - 34837=>1000,34838=>1000,34839=>1000,34840=>1000,34841=>1000,34842=>1000,34843=>1000,34844=>1000,34845=>1000,34846=>1000,34847=>1000,34848=>1000,34849=>1000,34850=>1000,34851=>1000,34852=>1000, - 34853=>1000,34854=>1000,34855=>1000,34856=>1000,34857=>1000,34858=>1000,34859=>1000,34860=>1000,34861=>1000,34862=>1000,34863=>1000,34864=>1000,34865=>1000,34866=>1000,34867=>1000,34868=>1000, - 34869=>1000,34870=>1000,34871=>1000,34872=>1000,34873=>1000,34874=>1000,34875=>1000,34876=>1000,34877=>1000,34878=>1000,34879=>1000,34880=>1000,34881=>1000,34882=>1000,34883=>1000,34884=>1000, - 34885=>1000,34886=>1000,34887=>1000,34888=>1000,34889=>1000,34890=>1000,34891=>1000,34892=>1000,34893=>1000,34894=>1000,34895=>1000,34896=>1000,34897=>1000,34898=>1000,34899=>1000,34900=>1000, - 34901=>1000,34902=>1000,34903=>1000,34904=>1000,34905=>1000,34906=>1000,34907=>1000,34908=>1000,34909=>1000,34910=>1000,34911=>1000,34912=>1000,34913=>1000,34914=>1000,34915=>1000,34916=>1000, - 34917=>1000,34918=>1000,34919=>1000,34920=>1000,34921=>1000,34922=>1000,34923=>1000,34924=>1000,34925=>1000,34926=>1000,34927=>1000,34928=>1000,34929=>1000,34930=>1000,34931=>1000,34932=>1000, - 34933=>1000,34934=>1000,34935=>1000,34936=>1000,34937=>1000,34938=>1000,34939=>1000,34940=>1000,34941=>1000,34942=>1000,34943=>1000,34944=>1000,34945=>1000,34946=>1000,34947=>1000,34948=>1000, - 34949=>1000,34950=>1000,34951=>1000,34952=>1000,34953=>1000,34954=>1000,34955=>1000,34956=>1000,34957=>1000,34958=>1000,34959=>1000,34960=>1000,34961=>1000,34962=>1000,34963=>1000,34964=>1000, - 34965=>1000,34966=>1000,34967=>1000,34968=>1000,34969=>1000,34970=>1000,34971=>1000,34972=>1000,34973=>1000,34974=>1000,34975=>1000,34976=>1000,34977=>1000,34978=>1000,34979=>1000,34980=>1000, - 34981=>1000,34982=>1000,34983=>1000,34984=>1000,34985=>1000,34986=>1000,34987=>1000,34988=>1000,34989=>1000,34990=>1000,34991=>1000,34992=>1000,34993=>1000,34994=>1000,34995=>1000,34996=>1000, - 34997=>1000,34998=>1000,34999=>1000,35000=>1000,35001=>1000,35002=>1000,35003=>1000,35004=>1000,35005=>1000,35006=>1000,35007=>1000,35008=>1000,35009=>1000,35010=>1000,35011=>1000,35012=>1000, - 35013=>1000,35014=>1000,35015=>1000,35016=>1000,35017=>1000,35018=>1000,35019=>1000,35020=>1000,35021=>1000,35022=>1000,35023=>1000,35024=>1000,35025=>1000,35026=>1000,35027=>1000,35028=>1000, - 35029=>1000,35030=>1000,35031=>1000,35032=>1000,35033=>1000,35034=>1000,35035=>1000,35036=>1000,35037=>1000,35038=>1000,35039=>1000,35040=>1000,35041=>1000,35042=>1000,35043=>1000,35044=>1000, - 35045=>1000,35046=>1000,35047=>1000,35048=>1000,35049=>1000,35050=>1000,35051=>1000,35052=>1000,35053=>1000,35054=>1000,35055=>1000,35056=>1000,35057=>1000,35058=>1000,35059=>1000,35060=>1000, - 35061=>1000,35062=>1000,35063=>1000,35064=>1000,35065=>1000,35066=>1000,35067=>1000,35068=>1000,35069=>1000,35070=>1000,35071=>1000,35072=>1000,35073=>1000,35074=>1000,35075=>1000,35076=>1000, - 35077=>1000,35078=>1000,35079=>1000,35080=>1000,35081=>1000,35082=>1000,35083=>1000,35084=>1000,35085=>1000,35086=>1000,35087=>1000,35088=>1000,35089=>1000,35090=>1000,35091=>1000,35092=>1000, - 35093=>1000,35094=>1000,35095=>1000,35096=>1000,35097=>1000,35098=>1000,35099=>1000,35100=>1000,35101=>1000,35102=>1000,35103=>1000,35104=>1000,35105=>1000,35106=>1000,35107=>1000,35108=>1000, - 35109=>1000,35110=>1000,35111=>1000,35112=>1000,35113=>1000,35114=>1000,35115=>1000,35116=>1000,35117=>1000,35118=>1000,35119=>1000,35120=>1000,35121=>1000,35122=>1000,35123=>1000,35124=>1000, - 35125=>1000,35126=>1000,35127=>1000,35128=>1000,35129=>1000,35130=>1000,35131=>1000,35132=>1000,35133=>1000,35134=>1000,35135=>1000,35136=>1000,35137=>1000,35138=>1000,35139=>1000,35140=>1000, - 35141=>1000,35142=>1000,35143=>1000,35144=>1000,35145=>1000,35146=>1000,35147=>1000,35148=>1000,35149=>1000,35150=>1000,35151=>1000,35152=>1000,35153=>1000,35154=>1000,35155=>1000,35156=>1000, - 35157=>1000,35158=>1000,35159=>1000,35160=>1000,35161=>1000,35162=>1000,35163=>1000,35164=>1000,35165=>1000,35166=>1000,35167=>1000,35168=>1000,35169=>1000,35170=>1000,35171=>1000,35172=>1000, - 35173=>1000,35174=>1000,35175=>1000,35176=>1000,35177=>1000,35178=>1000,35179=>1000,35180=>1000,35181=>1000,35182=>1000,35183=>1000,35184=>1000,35185=>1000,35186=>1000,35187=>1000,35188=>1000, - 35189=>1000,35190=>1000,35191=>1000,35192=>1000,35193=>1000,35194=>1000,35195=>1000,35196=>1000,35197=>1000,35198=>1000,35199=>1000,35200=>1000,35201=>1000,35202=>1000,35203=>1000,35204=>1000, - 35205=>1000,35206=>1000,35207=>1000,35208=>1000,35209=>1000,35210=>1000,35211=>1000,35212=>1000,35213=>1000,35214=>1000,35215=>1000,35216=>1000,35217=>1000,35218=>1000,35219=>1000,35220=>1000, - 35221=>1000,35222=>1000,35223=>1000,35224=>1000,35225=>1000,35226=>1000,35227=>1000,35228=>1000,35229=>1000,35230=>1000,35231=>1000,35232=>1000,35233=>1000,35234=>1000,35235=>1000,35236=>1000, - 35237=>1000,35238=>1000,35239=>1000,35240=>1000,35241=>1000,35242=>1000,35243=>1000,35244=>1000,35245=>1000,35246=>1000,35247=>1000,35248=>1000,35249=>1000,35250=>1000,35251=>1000,35252=>1000, - 35253=>1000,35254=>1000,35255=>1000,35256=>1000,35257=>1000,35258=>1000,35259=>1000,35260=>1000,35261=>1000,35262=>1000,35263=>1000,35264=>1000,35265=>1000,35266=>1000,35267=>1000,35268=>1000, - 35269=>1000,35270=>1000,35271=>1000,35272=>1000,35273=>1000,35274=>1000,35275=>1000,35276=>1000,35277=>1000,35278=>1000,35279=>1000,35280=>1000,35281=>1000,35282=>1000,35283=>1000,35284=>1000, - 35285=>1000,35286=>1000,35287=>1000,35288=>1000,35289=>1000,35290=>1000,35291=>1000,35292=>1000,35293=>1000,35294=>1000,35295=>1000,35296=>1000,35297=>1000,35298=>1000,35299=>1000,35300=>1000, - 35301=>1000,35302=>1000,35303=>1000,35304=>1000,35305=>1000,35306=>1000,35307=>1000,35308=>1000,35309=>1000,35310=>1000,35311=>1000,35312=>1000,35313=>1000,35314=>1000,35315=>1000,35316=>1000, - 35317=>1000,35318=>1000,35319=>1000,35320=>1000,35321=>1000,35322=>1000,35323=>1000,35324=>1000,35325=>1000,35326=>1000,35327=>1000,35328=>1000,35329=>1000,35330=>1000,35331=>1000,35332=>1000, - 35333=>1000,35334=>1000,35335=>1000,35336=>1000,35337=>1000,35338=>1000,35339=>1000,35340=>1000,35341=>1000,35342=>1000,35343=>1000,35344=>1000,35345=>1000,35346=>1000,35347=>1000,35348=>1000, - 35349=>1000,35350=>1000,35351=>1000,35352=>1000,35353=>1000,35354=>1000,35355=>1000,35356=>1000,35357=>1000,35358=>1000,35359=>1000,35360=>1000,35361=>1000,35362=>1000,35363=>1000,35364=>1000, - 35365=>1000,35366=>1000,35367=>1000,35368=>1000,35369=>1000,35370=>1000,35371=>1000,35372=>1000,35373=>1000,35374=>1000,35375=>1000,35376=>1000,35377=>1000,35378=>1000,35379=>1000,35380=>1000, - 35381=>1000,35382=>1000,35383=>1000,35384=>1000,35385=>1000,35386=>1000,35387=>1000,35388=>1000,35389=>1000,35390=>1000,35391=>1000,35392=>1000,35393=>1000,35394=>1000,35395=>1000,35396=>1000, - 35397=>1000,35398=>1000,35399=>1000,35400=>1000,35401=>1000,35402=>1000,35403=>1000,35404=>1000,35405=>1000,35406=>1000,35407=>1000,35408=>1000,35409=>1000,35410=>1000,35411=>1000,35412=>1000, - 35413=>1000,35414=>1000,35415=>1000,35416=>1000,35417=>1000,35418=>1000,35419=>1000,35420=>1000,35421=>1000,35422=>1000,35423=>1000,35424=>1000,35425=>1000,35426=>1000,35427=>1000,35428=>1000, - 35429=>1000,35430=>1000,35431=>1000,35432=>1000,35433=>1000,35434=>1000,35435=>1000,35436=>1000,35437=>1000,35438=>1000,35439=>1000,35440=>1000,35441=>1000,35442=>1000,35443=>1000,35444=>1000, - 35445=>1000,35446=>1000,35447=>1000,35448=>1000,35449=>1000,35450=>1000,35451=>1000,35452=>1000,35453=>1000,35454=>1000,35455=>1000,35456=>1000,35457=>1000,35458=>1000,35459=>1000,35460=>1000, - 35461=>1000,35462=>1000,35463=>1000,35464=>1000,35465=>1000,35466=>1000,35467=>1000,35468=>1000,35469=>1000,35470=>1000,35471=>1000,35472=>1000,35473=>1000,35474=>1000,35475=>1000,35476=>1000, - 35477=>1000,35478=>1000,35479=>1000,35480=>1000,35481=>1000,35482=>1000,35483=>1000,35484=>1000,35485=>1000,35486=>1000,35487=>1000,35488=>1000,35489=>1000,35490=>1000,35491=>1000,35492=>1000, - 35493=>1000,35494=>1000,35495=>1000,35496=>1000,35497=>1000,35498=>1000,35499=>1000,35500=>1000,35501=>1000,35502=>1000,35503=>1000,35504=>1000,35505=>1000,35506=>1000,35507=>1000,35508=>1000, - 35509=>1000,35510=>1000,35511=>1000,35512=>1000,35513=>1000,35514=>1000,35515=>1000,35516=>1000,35517=>1000,35518=>1000,35519=>1000,35520=>1000,35521=>1000,35522=>1000,35523=>1000,35524=>1000, - 35525=>1000,35526=>1000,35527=>1000,35528=>1000,35529=>1000,35530=>1000,35531=>1000,35532=>1000,35533=>1000,35534=>1000,35535=>1000,35536=>1000,35537=>1000,35538=>1000,35539=>1000,35540=>1000, - 35541=>1000,35542=>1000,35543=>1000,35544=>1000,35545=>1000,35546=>1000,35547=>1000,35548=>1000,35549=>1000,35550=>1000,35551=>1000,35552=>1000,35553=>1000,35554=>1000,35555=>1000,35556=>1000, - 35557=>1000,35558=>1000,35559=>1000,35560=>1000,35561=>1000,35562=>1000,35563=>1000,35564=>1000,35565=>1000,35566=>1000,35567=>1000,35568=>1000,35569=>1000,35570=>1000,35571=>1000,35572=>1000, - 35573=>1000,35574=>1000,35575=>1000,35576=>1000,35577=>1000,35578=>1000,35579=>1000,35580=>1000,35581=>1000,35582=>1000,35583=>1000,35584=>1000,35585=>1000,35586=>1000,35587=>1000,35588=>1000, - 35589=>1000,35590=>1000,35591=>1000,35592=>1000,35593=>1000,35594=>1000,35595=>1000,35596=>1000,35597=>1000,35598=>1000,35599=>1000,35600=>1000,35601=>1000,35602=>1000,35603=>1000,35604=>1000, - 35605=>1000,35606=>1000,35607=>1000,35608=>1000,35609=>1000,35610=>1000,35611=>1000,35612=>1000,35613=>1000,35614=>1000,35615=>1000,35616=>1000,35617=>1000,35618=>1000,35619=>1000,35620=>1000, - 35621=>1000,35622=>1000,35623=>1000,35624=>1000,35625=>1000,35626=>1000,35627=>1000,35628=>1000,35629=>1000,35630=>1000,35631=>1000,35632=>1000,35633=>1000,35634=>1000,35635=>1000,35636=>1000, - 35637=>1000,35638=>1000,35639=>1000,35640=>1000,35641=>1000,35642=>1000,35643=>1000,35644=>1000,35645=>1000,35646=>1000,35647=>1000,35648=>1000,35649=>1000,35650=>1000,35651=>1000,35652=>1000, - 35653=>1000,35654=>1000,35655=>1000,35656=>1000,35657=>1000,35658=>1000,35659=>1000,35660=>1000,35661=>1000,35662=>1000,35663=>1000,35664=>1000,35665=>1000,35666=>1000,35667=>1000,35668=>1000, - 35669=>1000,35670=>1000,35671=>1000,35672=>1000,35673=>1000,35674=>1000,35675=>1000,35676=>1000,35677=>1000,35678=>1000,35679=>1000,35680=>1000,35681=>1000,35682=>1000,35683=>1000,35684=>1000, - 35685=>1000,35686=>1000,35687=>1000,35688=>1000,35689=>1000,35690=>1000,35691=>1000,35692=>1000,35693=>1000,35694=>1000,35695=>1000,35696=>1000,35697=>1000,35698=>1000,35699=>1000,35700=>1000, - 35701=>1000,35702=>1000,35703=>1000,35704=>1000,35705=>1000,35706=>1000,35707=>1000,35708=>1000,35709=>1000,35710=>1000,35711=>1000,35712=>1000,35713=>1000,35714=>1000,35715=>1000,35716=>1000, - 35717=>1000,35718=>1000,35719=>1000,35720=>1000,35721=>1000,35722=>1000,35723=>1000,35724=>1000,35725=>1000,35726=>1000,35727=>1000,35728=>1000,35729=>1000,35730=>1000,35731=>1000,35732=>1000, - 35733=>1000,35734=>1000,35735=>1000,35736=>1000,35737=>1000,35738=>1000,35739=>1000,35740=>1000,35741=>1000,35742=>1000,35743=>1000,35744=>1000,35745=>1000,35746=>1000,35747=>1000,35748=>1000, - 35749=>1000,35750=>1000,35751=>1000,35752=>1000,35753=>1000,35754=>1000,35755=>1000,35756=>1000,35757=>1000,35758=>1000,35759=>1000,35760=>1000,35761=>1000,35762=>1000,35763=>1000,35764=>1000, - 35765=>1000,35766=>1000,35767=>1000,35768=>1000,35769=>1000,35770=>1000,35771=>1000,35772=>1000,35773=>1000,35774=>1000,35775=>1000,35776=>1000,35777=>1000,35778=>1000,35779=>1000,35780=>1000, - 35781=>1000,35782=>1000,35783=>1000,35784=>1000,35785=>1000,35786=>1000,35787=>1000,35788=>1000,35789=>1000,35790=>1000,35791=>1000,35792=>1000,35793=>1000,35794=>1000,35795=>1000,35796=>1000, - 35797=>1000,35798=>1000,35799=>1000,35800=>1000,35801=>1000,35802=>1000,35803=>1000,35804=>1000,35805=>1000,35806=>1000,35807=>1000,35808=>1000,35809=>1000,35810=>1000,35811=>1000,35812=>1000, - 35813=>1000,35814=>1000,35815=>1000,35816=>1000,35817=>1000,35818=>1000,35819=>1000,35820=>1000,35821=>1000,35822=>1000,35823=>1000,35824=>1000,35825=>1000,35826=>1000,35827=>1000,35828=>1000, - 35829=>1000,35830=>1000,35831=>1000,35832=>1000,35833=>1000,35834=>1000,35835=>1000,35836=>1000,35837=>1000,35838=>1000,35839=>1000,35840=>1000,35841=>1000,35842=>1000,35843=>1000,35844=>1000, - 35845=>1000,35846=>1000,35847=>1000,35848=>1000,35849=>1000,35850=>1000,35851=>1000,35852=>1000,35853=>1000,35854=>1000,35855=>1000,35856=>1000,35857=>1000,35858=>1000,35859=>1000,35860=>1000, - 35861=>1000,35862=>1000,35863=>1000,35864=>1000,35865=>1000,35866=>1000,35867=>1000,35868=>1000,35869=>1000,35870=>1000,35871=>1000,35872=>1000,35873=>1000,35874=>1000,35875=>1000,35876=>1000, - 35877=>1000,35878=>1000,35879=>1000,35880=>1000,35881=>1000,35882=>1000,35883=>1000,35884=>1000,35885=>1000,35886=>1000,35887=>1000,35888=>1000,35889=>1000,35890=>1000,35891=>1000,35892=>1000, - 35893=>1000,35894=>1000,35895=>1000,35896=>1000,35897=>1000,35898=>1000,35899=>1000,35900=>1000,35901=>1000,35902=>1000,35903=>1000,35904=>1000,35905=>1000,35906=>1000,35907=>1000,35908=>1000, - 35909=>1000,35910=>1000,35911=>1000,35912=>1000,35913=>1000,35914=>1000,35915=>1000,35916=>1000,35917=>1000,35918=>1000,35919=>1000,35920=>1000,35921=>1000,35922=>1000,35923=>1000,35924=>1000, - 35925=>1000,35926=>1000,35927=>1000,35928=>1000,35929=>1000,35930=>1000,35931=>1000,35932=>1000,35933=>1000,35934=>1000,35935=>1000,35936=>1000,35937=>1000,35938=>1000,35939=>1000,35940=>1000, - 35941=>1000,35942=>1000,35943=>1000,35944=>1000,35945=>1000,35946=>1000,35947=>1000,35948=>1000,35949=>1000,35950=>1000,35951=>1000,35952=>1000,35953=>1000,35954=>1000,35955=>1000,35956=>1000, - 35957=>1000,35958=>1000,35959=>1000,35960=>1000,35961=>1000,35962=>1000,35963=>1000,35964=>1000,35965=>1000,35966=>1000,35967=>1000,35968=>1000,35969=>1000,35970=>1000,35971=>1000,35972=>1000, - 35973=>1000,35974=>1000,35975=>1000,35976=>1000,35977=>1000,35978=>1000,35979=>1000,35980=>1000,35981=>1000,35982=>1000,35983=>1000,35984=>1000,35985=>1000,35986=>1000,35987=>1000,35988=>1000, - 35989=>1000,35990=>1000,35991=>1000,35992=>1000,35993=>1000,35994=>1000,35995=>1000,35996=>1000,35997=>1000,35998=>1000,35999=>1000,36000=>1000,36001=>1000,36002=>1000,36003=>1000,36004=>1000, - 36005=>1000,36006=>1000,36007=>1000,36008=>1000,36009=>1000,36010=>1000,36011=>1000,36012=>1000,36013=>1000,36014=>1000,36015=>1000,36016=>1000,36017=>1000,36018=>1000,36019=>1000,36020=>1000, - 36021=>1000,36022=>1000,36023=>1000,36024=>1000,36025=>1000,36026=>1000,36027=>1000,36028=>1000,36029=>1000,36030=>1000,36031=>1000,36032=>1000,36033=>1000,36034=>1000,36035=>1000,36036=>1000, - 36037=>1000,36038=>1000,36039=>1000,36040=>1000,36041=>1000,36042=>1000,36043=>1000,36044=>1000,36045=>1000,36046=>1000,36047=>1000,36048=>1000,36049=>1000,36050=>1000,36051=>1000,36052=>1000, - 36053=>1000,36054=>1000,36055=>1000,36056=>1000,36057=>1000,36058=>1000,36059=>1000,36060=>1000,36061=>1000,36062=>1000,36063=>1000,36064=>1000,36065=>1000,36066=>1000,36067=>1000,36068=>1000, - 36069=>1000,36070=>1000,36071=>1000,36072=>1000,36073=>1000,36074=>1000,36075=>1000,36076=>1000,36077=>1000,36078=>1000,36079=>1000,36080=>1000,36081=>1000,36082=>1000,36083=>1000,36084=>1000, - 36085=>1000,36086=>1000,36087=>1000,36088=>1000,36089=>1000,36090=>1000,36091=>1000,36092=>1000,36093=>1000,36094=>1000,36095=>1000,36096=>1000,36097=>1000,36098=>1000,36099=>1000,36100=>1000, - 36101=>1000,36102=>1000,36103=>1000,36104=>1000,36105=>1000,36106=>1000,36107=>1000,36108=>1000,36109=>1000,36110=>1000,36111=>1000,36112=>1000,36113=>1000,36114=>1000,36115=>1000,36116=>1000, - 36117=>1000,36118=>1000,36119=>1000,36120=>1000,36121=>1000,36122=>1000,36123=>1000,36124=>1000,36125=>1000,36126=>1000,36127=>1000,36128=>1000,36129=>1000,36130=>1000,36131=>1000,36132=>1000, - 36133=>1000,36134=>1000,36135=>1000,36136=>1000,36137=>1000,36138=>1000,36139=>1000,36140=>1000,36141=>1000,36142=>1000,36143=>1000,36144=>1000,36145=>1000,36146=>1000,36147=>1000,36148=>1000, - 36149=>1000,36150=>1000,36151=>1000,36152=>1000,36153=>1000,36154=>1000,36155=>1000,36156=>1000,36157=>1000,36158=>1000,36159=>1000,36160=>1000,36161=>1000,36162=>1000,36163=>1000,36164=>1000, - 36165=>1000,36166=>1000,36167=>1000,36168=>1000,36169=>1000,36170=>1000,36171=>1000,36172=>1000,36173=>1000,36174=>1000,36175=>1000,36176=>1000,36177=>1000,36178=>1000,36179=>1000,36180=>1000, - 36181=>1000,36182=>1000,36183=>1000,36184=>1000,36185=>1000,36186=>1000,36187=>1000,36188=>1000,36189=>1000,36190=>1000,36191=>1000,36192=>1000,36193=>1000,36194=>1000,36195=>1000,36196=>1000, - 36197=>1000,36198=>1000,36199=>1000,36200=>1000,36201=>1000,36202=>1000,36203=>1000,36204=>1000,36205=>1000,36206=>1000,36207=>1000,36208=>1000,36209=>1000,36210=>1000,36211=>1000,36212=>1000, - 36213=>1000,36214=>1000,36215=>1000,36216=>1000,36217=>1000,36218=>1000,36219=>1000,36220=>1000,36221=>1000,36222=>1000,36223=>1000,36224=>1000,36225=>1000,36226=>1000,36227=>1000,36228=>1000, - 36229=>1000,36230=>1000,36231=>1000,36232=>1000,36233=>1000,36234=>1000,36235=>1000,36236=>1000,36237=>1000,36238=>1000,36239=>1000,36240=>1000,36241=>1000,36242=>1000,36243=>1000,36244=>1000, - 36245=>1000,36246=>1000,36247=>1000,36248=>1000,36249=>1000,36250=>1000,36251=>1000,36252=>1000,36253=>1000,36254=>1000,36255=>1000,36256=>1000,36257=>1000,36258=>1000,36259=>1000,36260=>1000, - 36261=>1000,36262=>1000,36263=>1000,36264=>1000,36265=>1000,36266=>1000,36267=>1000,36268=>1000,36269=>1000,36270=>1000,36271=>1000,36272=>1000,36273=>1000,36274=>1000,36275=>1000,36276=>1000, - 36277=>1000,36278=>1000,36279=>1000,36280=>1000,36281=>1000,36282=>1000,36283=>1000,36284=>1000,36285=>1000,36286=>1000,36287=>1000,36288=>1000,36289=>1000,36290=>1000,36291=>1000,36292=>1000, - 36293=>1000,36294=>1000,36295=>1000,36296=>1000,36297=>1000,36298=>1000,36299=>1000,36300=>1000,36301=>1000,36302=>1000,36303=>1000,36304=>1000,36305=>1000,36306=>1000,36307=>1000,36308=>1000, - 36309=>1000,36310=>1000,36311=>1000,36312=>1000,36313=>1000,36314=>1000,36315=>1000,36316=>1000,36317=>1000,36318=>1000,36319=>1000,36320=>1000,36321=>1000,36322=>1000,36323=>1000,36324=>1000, - 36325=>1000,36326=>1000,36327=>1000,36328=>1000,36329=>1000,36330=>1000,36331=>1000,36332=>1000,36333=>1000,36334=>1000,36335=>1000,36336=>1000,36337=>1000,36338=>1000,36339=>1000,36340=>1000, - 36341=>1000,36342=>1000,36343=>1000,36344=>1000,36345=>1000,36346=>1000,36347=>1000,36348=>1000,36349=>1000,36350=>1000,36351=>1000,36352=>1000,36353=>1000,36354=>1000,36355=>1000,36356=>1000, - 36357=>1000,36358=>1000,36359=>1000,36360=>1000,36361=>1000,36362=>1000,36363=>1000,36364=>1000,36365=>1000,36366=>1000,36367=>1000,36368=>1000,36369=>1000,36370=>1000,36371=>1000,36372=>1000, - 36373=>1000,36374=>1000,36375=>1000,36376=>1000,36377=>1000,36378=>1000,36379=>1000,36380=>1000,36381=>1000,36382=>1000,36383=>1000,36384=>1000,36385=>1000,36386=>1000,36387=>1000,36388=>1000, - 36389=>1000,36390=>1000,36391=>1000,36392=>1000,36393=>1000,36394=>1000,36395=>1000,36396=>1000,36397=>1000,36398=>1000,36399=>1000,36400=>1000,36401=>1000,36402=>1000,36403=>1000,36404=>1000, - 36405=>1000,36406=>1000,36407=>1000,36408=>1000,36409=>1000,36410=>1000,36411=>1000,36412=>1000,36413=>1000,36414=>1000,36415=>1000,36416=>1000,36417=>1000,36418=>1000,36419=>1000,36420=>1000, - 36421=>1000,36422=>1000,36423=>1000,36424=>1000,36425=>1000,36426=>1000,36427=>1000,36428=>1000,36429=>1000,36430=>1000,36431=>1000,36432=>1000,36433=>1000,36434=>1000,36435=>1000,36436=>1000, - 36437=>1000,36438=>1000,36439=>1000,36440=>1000,36441=>1000,36442=>1000,36443=>1000,36444=>1000,36445=>1000,36446=>1000,36447=>1000,36448=>1000,36449=>1000,36450=>1000,36451=>1000,36452=>1000, - 36453=>1000,36454=>1000,36455=>1000,36456=>1000,36457=>1000,36458=>1000,36459=>1000,36460=>1000,36461=>1000,36462=>1000,36463=>1000,36464=>1000,36465=>1000,36466=>1000,36467=>1000,36468=>1000, - 36469=>1000,36470=>1000,36471=>1000,36472=>1000,36473=>1000,36474=>1000,36475=>1000,36476=>1000,36477=>1000,36478=>1000,36479=>1000,36480=>1000,36481=>1000,36482=>1000,36483=>1000,36484=>1000, - 36485=>1000,36486=>1000,36487=>1000,36488=>1000,36489=>1000,36490=>1000,36491=>1000,36492=>1000,36493=>1000,36494=>1000,36495=>1000,36496=>1000,36497=>1000,36498=>1000,36499=>1000,36500=>1000, - 36501=>1000,36502=>1000,36503=>1000,36504=>1000,36505=>1000,36506=>1000,36507=>1000,36508=>1000,36509=>1000,36510=>1000,36511=>1000,36512=>1000,36513=>1000,36514=>1000,36515=>1000,36516=>1000, - 36517=>1000,36518=>1000,36519=>1000,36520=>1000,36521=>1000,36522=>1000,36523=>1000,36524=>1000,36525=>1000,36526=>1000,36527=>1000,36528=>1000,36529=>1000,36530=>1000,36531=>1000,36532=>1000, - 36533=>1000,36534=>1000,36535=>1000,36536=>1000,36537=>1000,36538=>1000,36539=>1000,36540=>1000,36541=>1000,36542=>1000,36543=>1000,36544=>1000,36545=>1000,36546=>1000,36547=>1000,36548=>1000, - 36549=>1000,36550=>1000,36551=>1000,36552=>1000,36553=>1000,36554=>1000,36555=>1000,36556=>1000,36557=>1000,36558=>1000,36559=>1000,36560=>1000,36561=>1000,36562=>1000,36563=>1000,36564=>1000, - 36565=>1000,36566=>1000,36567=>1000,36568=>1000,36569=>1000,36570=>1000,36571=>1000,36572=>1000,36573=>1000,36574=>1000,36575=>1000,36576=>1000,36577=>1000,36578=>1000,36579=>1000,36580=>1000, - 36581=>1000,36582=>1000,36583=>1000,36584=>1000,36585=>1000,36586=>1000,36587=>1000,36588=>1000,36589=>1000,36590=>1000,36591=>1000,36592=>1000,36593=>1000,36594=>1000,36595=>1000,36596=>1000, - 36597=>1000,36598=>1000,36599=>1000,36600=>1000,36601=>1000,36602=>1000,36603=>1000,36604=>1000,36605=>1000,36606=>1000,36607=>1000,36608=>1000,36609=>1000,36610=>1000,36611=>1000,36612=>1000, - 36613=>1000,36614=>1000,36615=>1000,36616=>1000,36617=>1000,36618=>1000,36619=>1000,36620=>1000,36621=>1000,36622=>1000,36623=>1000,36624=>1000,36625=>1000,36626=>1000,36627=>1000,36628=>1000, - 36629=>1000,36630=>1000,36631=>1000,36632=>1000,36633=>1000,36634=>1000,36635=>1000,36636=>1000,36637=>1000,36638=>1000,36639=>1000,36640=>1000,36641=>1000,36642=>1000,36643=>1000,36644=>1000, - 36645=>1000,36646=>1000,36647=>1000,36648=>1000,36649=>1000,36650=>1000,36651=>1000,36652=>1000,36653=>1000,36654=>1000,36655=>1000,36656=>1000,36657=>1000,36658=>1000,36659=>1000,36660=>1000, - 36661=>1000,36662=>1000,36663=>1000,36664=>1000,36665=>1000,36666=>1000,36667=>1000,36668=>1000,36669=>1000,36670=>1000,36671=>1000,36672=>1000,36673=>1000,36674=>1000,36675=>1000,36676=>1000, - 36677=>1000,36678=>1000,36679=>1000,36680=>1000,36681=>1000,36682=>1000,36683=>1000,36684=>1000,36685=>1000,36686=>1000,36687=>1000,36688=>1000,36689=>1000,36690=>1000,36691=>1000,36692=>1000, - 36693=>1000,36694=>1000,36695=>1000,36696=>1000,36697=>1000,36698=>1000,36699=>1000,36700=>1000,36701=>1000,36702=>1000,36703=>1000,36704=>1000,36705=>1000,36706=>1000,36707=>1000,36708=>1000, - 36709=>1000,36710=>1000,36711=>1000,36712=>1000,36713=>1000,36714=>1000,36715=>1000,36716=>1000,36717=>1000,36718=>1000,36719=>1000,36720=>1000,36721=>1000,36722=>1000,36723=>1000,36724=>1000, - 36725=>1000,36726=>1000,36727=>1000,36728=>1000,36729=>1000,36730=>1000,36731=>1000,36732=>1000,36733=>1000,36734=>1000,36735=>1000,36736=>1000,36737=>1000,36738=>1000,36739=>1000,36740=>1000, - 36741=>1000,36742=>1000,36743=>1000,36744=>1000,36745=>1000,36746=>1000,36747=>1000,36748=>1000,36749=>1000,36750=>1000,36751=>1000,36752=>1000,36753=>1000,36754=>1000,36755=>1000,36756=>1000, - 36757=>1000,36758=>1000,36759=>1000,36760=>1000,36761=>1000,36762=>1000,36763=>1000,36764=>1000,36765=>1000,36766=>1000,36767=>1000,36768=>1000,36769=>1000,36770=>1000,36771=>1000,36772=>1000, - 36773=>1000,36774=>1000,36775=>1000,36776=>1000,36777=>1000,36778=>1000,36779=>1000,36780=>1000,36781=>1000,36782=>1000,36783=>1000,36784=>1000,36785=>1000,36786=>1000,36787=>1000,36788=>1000, - 36789=>1000,36790=>1000,36791=>1000,36792=>1000,36793=>1000,36794=>1000,36795=>1000,36796=>1000,36797=>1000,36798=>1000,36799=>1000,36800=>1000,36801=>1000,36802=>1000,36803=>1000,36804=>1000, - 36805=>1000,36806=>1000,36807=>1000,36808=>1000,36809=>1000,36810=>1000,36811=>1000,36812=>1000,36813=>1000,36814=>1000,36815=>1000,36816=>1000,36817=>1000,36818=>1000,36819=>1000,36820=>1000, - 36821=>1000,36822=>1000,36823=>1000,36824=>1000,36825=>1000,36826=>1000,36827=>1000,36828=>1000,36829=>1000,36830=>1000,36831=>1000,36832=>1000,36833=>1000,36834=>1000,36835=>1000,36836=>1000, - 36837=>1000,36838=>1000,36839=>1000,36840=>1000,36841=>1000,36842=>1000,36843=>1000,36844=>1000,36845=>1000,36846=>1000,36847=>1000,36848=>1000,36849=>1000,36850=>1000,36851=>1000,36852=>1000, - 36853=>1000,36854=>1000,36855=>1000,36856=>1000,36857=>1000,36858=>1000,36859=>1000,36860=>1000,36861=>1000,36862=>1000,36863=>1000,36864=>1000,36865=>1000,36866=>1000,36867=>1000,36868=>1000, - 36869=>1000,36870=>1000,36871=>1000,36872=>1000,36873=>1000,36874=>1000,36875=>1000,36876=>1000,36877=>1000,36878=>1000,36879=>1000,36880=>1000,36881=>1000,36882=>1000,36883=>1000,36884=>1000, - 36885=>1000,36886=>1000,36887=>1000,36888=>1000,36889=>1000,36890=>1000,36891=>1000,36892=>1000,36893=>1000,36894=>1000,36895=>1000,36896=>1000,36897=>1000,36898=>1000,36899=>1000,36900=>1000, - 36901=>1000,36902=>1000,36903=>1000,36904=>1000,36905=>1000,36906=>1000,36907=>1000,36908=>1000,36909=>1000,36910=>1000,36911=>1000,36912=>1000,36913=>1000,36914=>1000,36915=>1000,36916=>1000, - 36917=>1000,36918=>1000,36919=>1000,36920=>1000,36921=>1000,36922=>1000,36923=>1000,36924=>1000,36925=>1000,36926=>1000,36927=>1000,36928=>1000,36929=>1000,36930=>1000,36931=>1000,36932=>1000, - 36933=>1000,36934=>1000,36935=>1000,36936=>1000,36937=>1000,36938=>1000,36939=>1000,36940=>1000,36941=>1000,36942=>1000,36943=>1000,36944=>1000,36945=>1000,36946=>1000,36947=>1000,36948=>1000, - 36949=>1000,36950=>1000,36951=>1000,36952=>1000,36953=>1000,36954=>1000,36955=>1000,36956=>1000,36957=>1000,36958=>1000,36959=>1000,36960=>1000,36961=>1000,36962=>1000,36963=>1000,36964=>1000, - 36965=>1000,36966=>1000,36967=>1000,36968=>1000,36969=>1000,36970=>1000,36971=>1000,36972=>1000,36973=>1000,36974=>1000,36975=>1000,36976=>1000,36977=>1000,36978=>1000,36979=>1000,36980=>1000, - 36981=>1000,36982=>1000,36983=>1000,36984=>1000,36985=>1000,36986=>1000,36987=>1000,36988=>1000,36989=>1000,36990=>1000,36991=>1000,36992=>1000,36993=>1000,36994=>1000,36995=>1000,36996=>1000, - 36997=>1000,36998=>1000,36999=>1000,37000=>1000,37001=>1000,37002=>1000,37003=>1000,37004=>1000,37005=>1000,37006=>1000,37007=>1000,37008=>1000,37009=>1000,37010=>1000,37011=>1000,37012=>1000, - 37013=>1000,37014=>1000,37015=>1000,37016=>1000,37017=>1000,37018=>1000,37019=>1000,37020=>1000,37021=>1000,37022=>1000,37023=>1000,37024=>1000,37025=>1000,37026=>1000,37027=>1000,37028=>1000, - 37029=>1000,37030=>1000,37031=>1000,37032=>1000,37033=>1000,37034=>1000,37035=>1000,37036=>1000,37037=>1000,37038=>1000,37039=>1000,37040=>1000,37041=>1000,37042=>1000,37043=>1000,37044=>1000, - 37045=>1000,37046=>1000,37047=>1000,37048=>1000,37049=>1000,37050=>1000,37051=>1000,37052=>1000,37053=>1000,37054=>1000,37055=>1000,37056=>1000,37057=>1000,37058=>1000,37059=>1000,37060=>1000, - 37061=>1000,37062=>1000,37063=>1000,37064=>1000,37065=>1000,37066=>1000,37067=>1000,37068=>1000,37069=>1000,37070=>1000,37071=>1000,37072=>1000,37073=>1000,37074=>1000,37075=>1000,37076=>1000, - 37077=>1000,37078=>1000,37079=>1000,37080=>1000,37081=>1000,37082=>1000,37083=>1000,37084=>1000,37085=>1000,37086=>1000,37087=>1000,37088=>1000,37089=>1000,37090=>1000,37091=>1000,37092=>1000, - 37093=>1000,37094=>1000,37095=>1000,37096=>1000,37097=>1000,37098=>1000,37099=>1000,37100=>1000,37101=>1000,37102=>1000,37103=>1000,37104=>1000,37105=>1000,37106=>1000,37107=>1000,37108=>1000, - 37109=>1000,37110=>1000,37111=>1000,37112=>1000,37113=>1000,37114=>1000,37115=>1000,37116=>1000,37117=>1000,37118=>1000,37119=>1000,37120=>1000,37121=>1000,37122=>1000,37123=>1000,37124=>1000, - 37125=>1000,37126=>1000,37127=>1000,37128=>1000,37129=>1000,37130=>1000,37131=>1000,37132=>1000,37133=>1000,37134=>1000,37135=>1000,37136=>1000,37137=>1000,37138=>1000,37139=>1000,37140=>1000, - 37141=>1000,37142=>1000,37143=>1000,37144=>1000,37145=>1000,37146=>1000,37147=>1000,37148=>1000,37149=>1000,37150=>1000,37151=>1000,37152=>1000,37153=>1000,37154=>1000,37155=>1000,37156=>1000, - 37157=>1000,37158=>1000,37159=>1000,37160=>1000,37161=>1000,37162=>1000,37163=>1000,37164=>1000,37165=>1000,37166=>1000,37167=>1000,37168=>1000,37169=>1000,37170=>1000,37171=>1000,37172=>1000, - 37173=>1000,37174=>1000,37175=>1000,37176=>1000,37177=>1000,37178=>1000,37179=>1000,37180=>1000,37181=>1000,37182=>1000,37183=>1000,37184=>1000,37185=>1000,37186=>1000,37187=>1000,37188=>1000, - 37189=>1000,37190=>1000,37191=>1000,37192=>1000,37193=>1000,37194=>1000,37195=>1000,37196=>1000,37197=>1000,37198=>1000,37199=>1000,37200=>1000,37201=>1000,37202=>1000,37203=>1000,37204=>1000, - 37205=>1000,37206=>1000,37207=>1000,37208=>1000,37209=>1000,37210=>1000,37211=>1000,37212=>1000,37213=>1000,37214=>1000,37215=>1000,37216=>1000,37217=>1000,37218=>1000,37219=>1000,37220=>1000, - 37221=>1000,37222=>1000,37223=>1000,37224=>1000,37225=>1000,37226=>1000,37227=>1000,37228=>1000,37229=>1000,37230=>1000,37231=>1000,37232=>1000,37233=>1000,37234=>1000,37235=>1000,37236=>1000, - 37237=>1000,37238=>1000,37239=>1000,37240=>1000,37241=>1000,37242=>1000,37243=>1000,37244=>1000,37245=>1000,37246=>1000,37247=>1000,37248=>1000,37249=>1000,37250=>1000,37251=>1000,37252=>1000, - 37253=>1000,37254=>1000,37255=>1000,37256=>1000,37257=>1000,37258=>1000,37259=>1000,37260=>1000,37261=>1000,37262=>1000,37263=>1000,37264=>1000,37265=>1000,37266=>1000,37267=>1000,37268=>1000, - 37269=>1000,37270=>1000,37271=>1000,37272=>1000,37273=>1000,37274=>1000,37275=>1000,37276=>1000,37277=>1000,37278=>1000,37279=>1000,37280=>1000,37281=>1000,37282=>1000,37283=>1000,37284=>1000, - 37285=>1000,37286=>1000,37287=>1000,37288=>1000,37289=>1000,37290=>1000,37291=>1000,37292=>1000,37293=>1000,37294=>1000,37295=>1000,37296=>1000,37297=>1000,37298=>1000,37299=>1000,37300=>1000, - 37301=>1000,37302=>1000,37303=>1000,37304=>1000,37305=>1000,37306=>1000,37307=>1000,37308=>1000,37309=>1000,37310=>1000,37311=>1000,37312=>1000,37313=>1000,37314=>1000,37315=>1000,37316=>1000, - 37317=>1000,37318=>1000,37319=>1000,37320=>1000,37321=>1000,37322=>1000,37323=>1000,37324=>1000,37325=>1000,37326=>1000,37327=>1000,37328=>1000,37329=>1000,37330=>1000,37331=>1000,37332=>1000, - 37333=>1000,37334=>1000,37335=>1000,37336=>1000,37337=>1000,37338=>1000,37339=>1000,37340=>1000,37341=>1000,37342=>1000,37343=>1000,37344=>1000,37345=>1000,37346=>1000,37347=>1000,37348=>1000, - 37349=>1000,37350=>1000,37351=>1000,37352=>1000,37353=>1000,37354=>1000,37355=>1000,37356=>1000,37357=>1000,37358=>1000,37359=>1000,37360=>1000,37361=>1000,37362=>1000,37363=>1000,37364=>1000, - 37365=>1000,37366=>1000,37367=>1000,37368=>1000,37369=>1000,37370=>1000,37371=>1000,37372=>1000,37373=>1000,37374=>1000,37375=>1000,37376=>1000,37377=>1000,37378=>1000,37379=>1000,37380=>1000, - 37381=>1000,37382=>1000,37383=>1000,37384=>1000,37385=>1000,37386=>1000,37387=>1000,37388=>1000,37389=>1000,37390=>1000,37391=>1000,37392=>1000,37393=>1000,37394=>1000,37395=>1000,37396=>1000, - 37397=>1000,37398=>1000,37399=>1000,37400=>1000,37401=>1000,37402=>1000,37403=>1000,37404=>1000,37405=>1000,37406=>1000,37407=>1000,37408=>1000,37409=>1000,37410=>1000,37411=>1000,37412=>1000, - 37413=>1000,37414=>1000,37415=>1000,37416=>1000,37417=>1000,37418=>1000,37419=>1000,37420=>1000,37421=>1000,37422=>1000,37423=>1000,37424=>1000,37425=>1000,37426=>1000,37427=>1000,37428=>1000, - 37429=>1000,37430=>1000,37431=>1000,37432=>1000,37433=>1000,37434=>1000,37435=>1000,37436=>1000,37437=>1000,37438=>1000,37439=>1000,37440=>1000,37441=>1000,37442=>1000,37443=>1000,37444=>1000, - 37445=>1000,37446=>1000,37447=>1000,37448=>1000,37449=>1000,37450=>1000,37451=>1000,37452=>1000,37453=>1000,37454=>1000,37455=>1000,37456=>1000,37457=>1000,37458=>1000,37459=>1000,37460=>1000, - 37461=>1000,37462=>1000,37463=>1000,37464=>1000,37465=>1000,37466=>1000,37467=>1000,37468=>1000,37469=>1000,37470=>1000,37471=>1000,37472=>1000,37473=>1000,37474=>1000,37475=>1000,37476=>1000, - 37477=>1000,37478=>1000,37479=>1000,37480=>1000,37481=>1000,37482=>1000,37483=>1000,37484=>1000,37485=>1000,37486=>1000,37487=>1000,37488=>1000,37489=>1000,37490=>1000,37491=>1000,37492=>1000, - 37493=>1000,37494=>1000,37495=>1000,37496=>1000,37497=>1000,37498=>1000,37499=>1000,37500=>1000,37501=>1000,37502=>1000,37503=>1000,37504=>1000,37505=>1000,37506=>1000,37507=>1000,37508=>1000, - 37509=>1000,37510=>1000,37511=>1000,37512=>1000,37513=>1000,37514=>1000,37515=>1000,37516=>1000,37517=>1000,37518=>1000,37519=>1000,37520=>1000,37521=>1000,37522=>1000,37523=>1000,37524=>1000, - 37525=>1000,37526=>1000,37527=>1000,37528=>1000,37529=>1000,37530=>1000,37531=>1000,37532=>1000,37533=>1000,37534=>1000,37535=>1000,37536=>1000,37537=>1000,37538=>1000,37539=>1000,37540=>1000, - 37541=>1000,37542=>1000,37543=>1000,37544=>1000,37545=>1000,37546=>1000,37547=>1000,37548=>1000,37549=>1000,37550=>1000,37551=>1000,37552=>1000,37553=>1000,37554=>1000,37555=>1000,37556=>1000, - 37557=>1000,37558=>1000,37559=>1000,37560=>1000,37561=>1000,37562=>1000,37563=>1000,37564=>1000,37565=>1000,37566=>1000,37567=>1000,37568=>1000,37569=>1000,37570=>1000,37571=>1000,37572=>1000, - 37573=>1000,37574=>1000,37575=>1000,37576=>1000,37577=>1000,37578=>1000,37579=>1000,37580=>1000,37581=>1000,37582=>1000,37583=>1000,37584=>1000,37585=>1000,37586=>1000,37587=>1000,37588=>1000, - 37589=>1000,37590=>1000,37591=>1000,37592=>1000,37593=>1000,37594=>1000,37595=>1000,37596=>1000,37597=>1000,37598=>1000,37599=>1000,37600=>1000,37601=>1000,37602=>1000,37603=>1000,37604=>1000, - 37605=>1000,37606=>1000,37607=>1000,37608=>1000,37609=>1000,37610=>1000,37611=>1000,37612=>1000,37613=>1000,37614=>1000,37615=>1000,37616=>1000,37617=>1000,37618=>1000,37619=>1000,37620=>1000, - 37621=>1000,37622=>1000,37623=>1000,37624=>1000,37625=>1000,37626=>1000,37627=>1000,37628=>1000,37629=>1000,37630=>1000,37631=>1000,37632=>1000,37633=>1000,37634=>1000,37635=>1000,37636=>1000, - 37637=>1000,37638=>1000,37639=>1000,37640=>1000,37641=>1000,37642=>1000,37643=>1000,37644=>1000,37645=>1000,37646=>1000,37647=>1000,37648=>1000,37649=>1000,37650=>1000,37651=>1000,37652=>1000, - 37653=>1000,37654=>1000,37655=>1000,37656=>1000,37657=>1000,37658=>1000,37659=>1000,37660=>1000,37661=>1000,37662=>1000,37663=>1000,37664=>1000,37665=>1000,37666=>1000,37667=>1000,37668=>1000, - 37669=>1000,37670=>1000,37671=>1000,37672=>1000,37673=>1000,37674=>1000,37675=>1000,37676=>1000,37677=>1000,37678=>1000,37679=>1000,37680=>1000,37681=>1000,37682=>1000,37683=>1000,37684=>1000, - 37685=>1000,37686=>1000,37687=>1000,37688=>1000,37689=>1000,37690=>1000,37691=>1000,37692=>1000,37693=>1000,37694=>1000,37695=>1000,37696=>1000,37697=>1000,37698=>1000,37699=>1000,37700=>1000, - 37701=>1000,37702=>1000,37703=>1000,37704=>1000,37705=>1000,37706=>1000,37707=>1000,37708=>1000,37709=>1000,37710=>1000,37711=>1000,37712=>1000,37713=>1000,37714=>1000,37715=>1000,37716=>1000, - 37717=>1000,37718=>1000,37719=>1000,37720=>1000,37721=>1000,37722=>1000,37723=>1000,37724=>1000,37725=>1000,37726=>1000,37727=>1000,37728=>1000,37729=>1000,37730=>1000,37731=>1000,37732=>1000, - 37733=>1000,37734=>1000,37735=>1000,37736=>1000,37737=>1000,37738=>1000,37739=>1000,37740=>1000,37741=>1000,37742=>1000,37743=>1000,37744=>1000,37745=>1000,37746=>1000,37747=>1000,37748=>1000, - 37749=>1000,37750=>1000,37751=>1000,37752=>1000,37753=>1000,37754=>1000,37755=>1000,37756=>1000,37757=>1000,37758=>1000,37759=>1000,37760=>1000,37761=>1000,37762=>1000,37763=>1000,37764=>1000, - 37765=>1000,37766=>1000,37767=>1000,37768=>1000,37769=>1000,37770=>1000,37771=>1000,37772=>1000,37773=>1000,37774=>1000,37775=>1000,37776=>1000,37777=>1000,37778=>1000,37779=>1000,37780=>1000, - 37781=>1000,37782=>1000,37783=>1000,37784=>1000,37785=>1000,37786=>1000,37787=>1000,37788=>1000,37789=>1000,37790=>1000,37791=>1000,37792=>1000,37793=>1000,37794=>1000,37795=>1000,37796=>1000, - 37797=>1000,37798=>1000,37799=>1000,37800=>1000,37801=>1000,37802=>1000,37803=>1000,37804=>1000,37805=>1000,37806=>1000,37807=>1000,37808=>1000,37809=>1000,37810=>1000,37811=>1000,37812=>1000, - 37813=>1000,37814=>1000,37815=>1000,37816=>1000,37817=>1000,37818=>1000,37819=>1000,37820=>1000,37821=>1000,37822=>1000,37823=>1000,37824=>1000,37825=>1000,37826=>1000,37827=>1000,37828=>1000, - 37829=>1000,37830=>1000,37831=>1000,37832=>1000,37833=>1000,37834=>1000,37835=>1000,37836=>1000,37837=>1000,37838=>1000,37839=>1000,37840=>1000,37841=>1000,37842=>1000,37843=>1000,37844=>1000, - 37845=>1000,37846=>1000,37847=>1000,37848=>1000,37849=>1000,37850=>1000,37851=>1000,37852=>1000,37853=>1000,37854=>1000,37855=>1000,37856=>1000,37857=>1000,37858=>1000,37859=>1000,37860=>1000, - 37861=>1000,37862=>1000,37863=>1000,37864=>1000,37865=>1000,37866=>1000,37867=>1000,37868=>1000,37869=>1000,37870=>1000,37871=>1000,37872=>1000,37873=>1000,37874=>1000,37875=>1000,37876=>1000, - 37877=>1000,37878=>1000,37879=>1000,37880=>1000,37881=>1000,37882=>1000,37883=>1000,37884=>1000,37885=>1000,37886=>1000,37887=>1000,37888=>1000,37889=>1000,37890=>1000,37891=>1000,37892=>1000, - 37893=>1000,37894=>1000,37895=>1000,37896=>1000,37897=>1000,37898=>1000,37899=>1000,37900=>1000,37901=>1000,37902=>1000,37903=>1000,37904=>1000,37905=>1000,37906=>1000,37907=>1000,37908=>1000, - 37909=>1000,37910=>1000,37911=>1000,37912=>1000,37913=>1000,37914=>1000,37915=>1000,37916=>1000,37917=>1000,37918=>1000,37919=>1000,37920=>1000,37921=>1000,37922=>1000,37923=>1000,37924=>1000, - 37925=>1000,37926=>1000,37927=>998,37928=>1000,37929=>1000,37930=>1000,37931=>1000,37932=>1000,37933=>1000,37934=>1000,37935=>1000,37936=>1000,37937=>1000,37938=>1000,37939=>1000,37940=>1000, - 37941=>1000,37942=>1000,37943=>1000,37944=>1000,37945=>1000,37946=>1000,37947=>1000,37948=>1000,37949=>1000,37950=>1000,37951=>1000,37952=>1000,37953=>1000,37954=>1000,37955=>1000,37956=>1000, - 37957=>1000,37958=>1000,37959=>1000,37960=>1000,37961=>1000,37962=>1000,37963=>1000,37964=>1000,37965=>1000,37966=>1000,37967=>1000,37968=>1000,37969=>1000,37970=>1000,37971=>1000,37972=>1000, - 37973=>1000,37974=>1000,37975=>1000,37976=>1000,37977=>1000,37978=>1000,37979=>1000,37980=>1000,37981=>1000,37982=>1000,37983=>1000,37984=>1000,37985=>1000,37986=>1000,37987=>1000,37988=>1000, - 37989=>1000,37990=>1000,37991=>1000,37992=>1000,37993=>1000,37994=>1000,37995=>1000,37996=>1000,37997=>1000,37998=>1000,37999=>1000,38000=>1000,38001=>1000,38002=>1000,38003=>1000,38004=>1000, - 38005=>1000,38006=>1000,38007=>1000,38008=>1000,38009=>1000,38010=>1000,38011=>1000,38012=>1000,38013=>1000,38014=>1000,38015=>1000,38016=>1000,38017=>1000,38018=>1000,38019=>1000,38020=>1000, - 38021=>1000,38022=>1000,38023=>1000,38024=>1000,38025=>1000,38026=>1000,38027=>1000,38028=>1000,38029=>1000,38030=>1000,38031=>1000,38032=>1000,38033=>1000,38034=>1000,38035=>1000,38036=>1000, - 38037=>1000,38038=>1000,38039=>1000,38040=>1000,38041=>1000,38042=>1000,38043=>1000,38044=>1000,38045=>1000,38046=>1000,38047=>1000,38048=>1000,38049=>1000,38050=>1000,38051=>1000,38052=>1000, - 38053=>1000,38054=>1000,38055=>1000,38056=>1000,38057=>1000,38058=>1000,38059=>1000,38060=>1000,38061=>1000,38062=>1000,38063=>1000,38064=>1000,38065=>1000,38066=>1000,38067=>1000,38068=>1000, - 38069=>1000,38070=>1000,38071=>1000,38072=>1000,38073=>1000,38074=>1000,38075=>1000,38076=>1000,38077=>1000,38078=>1000,38079=>1000,38080=>1000,38081=>1000,38082=>1000,38083=>1000,38084=>1000, - 38085=>1000,38086=>1000,38087=>1000,38088=>1000,38089=>1000,38090=>1000,38091=>1000,38092=>1000,38093=>1000,38094=>1000,38095=>1000,38096=>1000,38097=>1000,38098=>1000,38099=>1000,38100=>1000, - 38101=>1000,38102=>1000,38103=>1000,38104=>1000,38105=>1000,38106=>1000,38107=>1000,38108=>1000,38109=>1000,38110=>1000,38111=>1000,38112=>1000,38113=>1000,38114=>1000,38115=>1000,38116=>1000, - 38117=>1000,38118=>1000,38119=>1000,38120=>1000,38121=>1000,38122=>1000,38123=>1000,38124=>1000,38125=>1000,38126=>1000,38127=>1000,38128=>1000,38129=>1000,38130=>1000,38131=>1000,38132=>1000, - 38133=>1000,38134=>1000,38135=>1000,38136=>1000,38137=>1000,38138=>1000,38139=>1000,38140=>1000,38141=>1000,38142=>1000,38143=>1000,38144=>1000,38145=>1000,38146=>1000,38147=>1000,38148=>1000, - 38149=>1000,38150=>1000,38151=>1000,38152=>1000,38153=>1000,38154=>1000,38155=>1000,38156=>1000,38157=>1000,38158=>1000,38159=>1000,38160=>1000,38161=>1000,38162=>1000,38163=>1000,38164=>1000, - 38165=>1000,38166=>1000,38167=>1000,38168=>1000,38169=>1000,38170=>1000,38171=>1000,38172=>1000,38173=>1000,38174=>1000,38175=>1000,38176=>1000,38177=>1000,38178=>1000,38179=>1000,38180=>1000, - 38181=>1000,38182=>1000,38183=>1000,38184=>1000,38185=>1000,38186=>1000,38187=>1000,38188=>1000,38189=>1000,38190=>1000,38191=>1000,38192=>1000,38193=>1000,38194=>1000,38195=>1000,38196=>1000, - 38197=>1000,38198=>1000,38199=>1000,38200=>1000,38201=>1000,38202=>1000,38203=>1000,38204=>1000,38205=>1000,38206=>1000,38207=>1000,38208=>1000,38209=>1000,38210=>1000,38211=>1000,38212=>1000, - 38213=>1000,38214=>1000,38215=>1000,38216=>1000,38217=>1000,38218=>1000,38219=>1000,38220=>1000,38221=>1000,38222=>1000,38223=>1000,38224=>1000,38225=>1000,38226=>1000,38227=>1000,38228=>1000, - 38229=>1000,38230=>1000,38231=>1000,38232=>1000,38233=>1000,38234=>1000,38235=>1000,38236=>1000,38237=>1000,38238=>1000,38239=>1000,38240=>1000,38241=>1000,38242=>1000,38243=>1000,38244=>1000, - 38245=>1000,38246=>1000,38247=>1000,38248=>1000,38249=>1000,38250=>1000,38251=>1000,38252=>1000,38253=>1000,38254=>1000,38255=>1000,38256=>1000,38257=>1000,38258=>1000,38259=>1000,38260=>1000, - 38261=>1000,38262=>1000,38263=>1000,38264=>1000,38265=>1000,38266=>1000,38267=>1000,38268=>1000,38269=>1000,38270=>1000,38271=>1000,38272=>1000,38273=>1000,38274=>1000,38275=>1000,38276=>1000, - 38277=>1000,38278=>1000,38279=>1000,38280=>1000,38281=>1000,38282=>1000,38283=>1000,38284=>1000,38285=>1000,38286=>1000,38287=>1000,38288=>1000,38289=>1000,38290=>1000,38291=>1000,38292=>1000, - 38293=>1000,38294=>1000,38295=>1000,38296=>1000,38297=>1000,38298=>1000,38299=>1000,38300=>1000,38301=>1000,38302=>1000,38303=>1000,38304=>1000,38305=>1000,38306=>1000,38307=>1000,38308=>1000, - 38309=>1000,38310=>1000,38311=>1000,38312=>1000,38313=>1000,38314=>1000,38315=>1000,38316=>1000,38317=>1000,38318=>1000,38319=>1000,38320=>1000,38321=>1000,38322=>1000,38323=>1000,38324=>1000, - 38325=>1000,38326=>1000,38327=>1000,38328=>1000,38329=>1000,38330=>1000,38331=>1000,38332=>1000,38333=>1000,38334=>1000,38335=>1000,38336=>1000,38337=>1000,38338=>1000,38339=>1000,38340=>1000, - 38341=>1000,38342=>1000,38343=>1000,38344=>1000,38345=>1000,38346=>1000,38347=>1000,38348=>1000,38349=>1000,38350=>1000,38351=>1000,38352=>1000,38353=>1000,38354=>1000,38355=>1000,38356=>1000, - 38357=>1000,38358=>1000,38359=>1000,38360=>1000,38361=>1000,38362=>1000,38363=>1000,38364=>1000,38365=>1000,38366=>1000,38367=>1000,38368=>1000,38369=>1000,38370=>1000,38371=>1000,38372=>1000, - 38373=>1000,38374=>1000,38375=>1000,38376=>1000,38377=>1000,38378=>1000,38379=>1000,38380=>1000,38381=>1000,38382=>1000,38383=>1000,38384=>1000,38385=>1000,38386=>1000,38387=>1000,38388=>1000, - 38389=>1000,38390=>1000,38391=>1000,38392=>1000,38393=>1000,38394=>1000,38395=>1000,38396=>1000,38397=>1000,38398=>1000,38399=>1000,38400=>1000,38401=>1000,38402=>1000,38403=>1000,38404=>1000, - 38405=>1000,38406=>1000,38407=>1000,38408=>1000,38409=>1000,38410=>1000,38411=>1000,38412=>1000,38413=>1000,38414=>1000,38415=>1000,38416=>1000,38417=>1000,38418=>1000,38419=>1000,38420=>1000, - 38421=>1000,38422=>1000,38423=>1000,38424=>1000,38425=>1000,38426=>1000,38427=>1000,38428=>1000,38429=>1000,38430=>1000,38431=>1000,38432=>1000,38433=>1000,38434=>1000,38435=>1000,38436=>1000, - 38437=>1000,38438=>1000,38439=>1000,38440=>1000,38441=>1000,38442=>1000,38443=>1000,38444=>1000,38445=>1000,38446=>1000,38447=>1000,38448=>1000,38449=>1000,38450=>1000,38451=>1000,38452=>1000, - 38453=>1000,38454=>1000,38455=>1000,38456=>1000,38457=>1000,38458=>1000,38459=>1000,38460=>1000,38461=>1000,38462=>1000,38463=>1000,38464=>1000,38465=>1000,38466=>1000,38467=>1000,38468=>1000, - 38469=>1000,38470=>1000,38471=>1000,38472=>1000,38473=>1000,38474=>1000,38475=>1000,38476=>1000,38477=>1000,38478=>1000,38479=>1000,38480=>1000,38481=>1000,38482=>1000,38483=>1000,38484=>1000, - 38485=>1000,38486=>1000,38487=>1000,38488=>1000,38489=>1000,38490=>1000,38491=>1000,38492=>1000,38493=>1000,38494=>1000,38495=>1000,38496=>1000,38497=>1000,38498=>1000,38499=>1000,38500=>1000, - 38501=>1000,38502=>1000,38503=>1000,38504=>1000,38505=>1000,38506=>1000,38507=>1000,38508=>1000,38509=>1000,38510=>1000,38511=>1000,38512=>1000,38513=>1000,38514=>1000,38515=>1000,38516=>1000, - 38517=>1000,38518=>1000,38519=>1000,38520=>1000,38521=>1000,38522=>1000,38523=>1000,38524=>1000,38525=>1000,38526=>1000,38527=>1000,38528=>1000,38529=>1000,38530=>1000,38531=>1000,38532=>1000, - 38533=>1000,38534=>1000,38535=>1000,38536=>1000,38537=>1000,38538=>1000,38539=>1000,38540=>1000,38541=>1000,38542=>1000,38543=>1000,38544=>1000,38545=>1000,38546=>1000,38547=>1000,38548=>1000, - 38549=>1000,38550=>1000,38551=>1000,38552=>1000,38553=>1000,38554=>1000,38555=>1000,38556=>1000,38557=>1000,38558=>1000,38559=>1000,38560=>1000,38561=>1000,38562=>1000,38563=>1000,38564=>1000, - 38565=>1000,38566=>1000,38567=>1000,38568=>1000,38569=>1000,38570=>1000,38571=>1000,38572=>1000,38573=>1000,38574=>1000,38575=>1000,38576=>1000,38577=>1000,38578=>1000,38579=>1000,38580=>1000, - 38581=>1000,38582=>1000,38583=>1000,38584=>1000,38585=>1000,38586=>1000,38587=>1000,38588=>1000,38589=>1000,38590=>1000,38591=>1000,38592=>1000,38593=>1000,38594=>1000,38595=>1000,38596=>1000, - 38597=>1000,38598=>1000,38599=>1000,38600=>1000,38601=>1000,38602=>1000,38603=>1000,38604=>1000,38605=>1000,38606=>1000,38607=>1000,38608=>1000,38609=>1000,38610=>1000,38611=>1000,38612=>1000, - 38613=>1000,38614=>1000,38615=>1000,38616=>1000,38617=>1000,38618=>1000,38619=>1000,38620=>1000,38621=>1000,38622=>1000,38623=>1000,38624=>1000,38625=>1000,38626=>1000,38627=>1000,38628=>1000, - 38629=>1000,38630=>1000,38631=>1000,38632=>1000,38633=>1000,38634=>1000,38635=>1000,38636=>1000,38637=>1000,38638=>1000,38639=>1000,38640=>1000,38641=>1000,38642=>1000,38643=>1000,38644=>1000, - 38645=>1000,38646=>1000,38647=>1000,38648=>1000,38649=>1000,38650=>1000,38651=>1000,38652=>1000,38653=>1000,38654=>1000,38655=>1000,38656=>1000,38657=>1000,38658=>1000,38659=>1000,38660=>1000, - 38661=>1000,38662=>1000,38663=>1000,38664=>1000,38665=>1000,38666=>1000,38667=>1000,38668=>1000,38669=>1000,38670=>1000,38671=>1000,38672=>1000,38673=>1000,38674=>1000,38675=>1000,38676=>1000, - 38677=>1000,38678=>1000,38679=>1000,38680=>1000,38681=>1000,38682=>1000,38683=>1000,38684=>1000,38685=>1000,38686=>1000,38687=>1000,38688=>1000,38689=>1000,38690=>1000,38691=>1000,38692=>1000, - 38693=>1000,38694=>1000,38695=>1000,38696=>1000,38697=>1000,38698=>1000,38699=>1000,38700=>1000,38701=>1000,38702=>1000,38703=>1000,38704=>1000,38705=>1000,38706=>1000,38707=>1000,38708=>1000, - 38709=>1000,38710=>1000,38711=>1000,38712=>1000,38713=>1000,38714=>1000,38715=>1000,38716=>1000,38717=>1000,38718=>1000,38719=>1000,38720=>1000,38721=>1000,38722=>1000,38723=>1000,38724=>1000, - 38725=>1000,38726=>1000,38727=>1000,38728=>1000,38729=>1000,38730=>1000,38731=>1000,38732=>1000,38733=>1000,38734=>1000,38735=>1000,38736=>1000,38737=>1000,38738=>1000,38739=>1000,38740=>1000, - 38741=>1000,38742=>1000,38743=>1000,38744=>1000,38745=>1000,38746=>1000,38747=>1000,38748=>1000,38749=>1000,38750=>1000,38751=>1000,38752=>1000,38753=>1000,38754=>1000,38755=>1000,38756=>1000, - 38757=>1000,38758=>1000,38759=>1000,38760=>1000,38761=>1000,38762=>1000,38763=>1000,38764=>1000,38765=>1000,38766=>1000,38767=>1000,38768=>1000,38769=>1000,38770=>1000,38771=>1000,38772=>1000, - 38773=>1000,38774=>1000,38775=>1000,38776=>1000,38777=>1000,38778=>1000,38779=>1000,38780=>1000,38781=>1000,38782=>1000,38783=>1000,38784=>1000,38785=>1000,38786=>1000,38787=>1000,38788=>1000, - 38789=>1000,38790=>1000,38791=>1000,38792=>1000,38793=>1000,38794=>1000,38795=>1000,38796=>1000,38797=>1000,38798=>1000,38799=>1000,38800=>1000,38801=>1000,38802=>1000,38803=>1000,38804=>1000, - 38805=>1000,38806=>1000,38807=>1000,38808=>1000,38809=>1000,38810=>1000,38811=>1000,38812=>1000,38813=>1000,38814=>1000,38815=>1000,38816=>1000,38817=>1000,38818=>1000,38819=>1000,38820=>1000, - 38821=>1000,38822=>1000,38823=>1000,38824=>1000,38825=>1000,38826=>1000,38827=>1000,38828=>1000,38829=>1000,38830=>1000,38831=>1000,38832=>1000,38833=>1000,38834=>1000,38835=>1000,38836=>1000, - 38837=>1000,38838=>1000,38839=>1000,38840=>1000,38841=>1000,38842=>1000,38843=>1000,38844=>1000,38845=>1000,38846=>1000,38847=>1000,38848=>1000,38849=>1000,38850=>1000,38851=>1000,38852=>1000, - 38853=>1000,38854=>1000,38855=>1000,38856=>1000,38857=>1000,38858=>1000,38859=>1000,38860=>1000,38861=>1000,38862=>1000,38863=>1000,38864=>1000,38865=>1000,38866=>1000,38867=>1000,38868=>1000, - 38869=>1000,38870=>1000,38871=>1000,38872=>1000,38873=>1000,38874=>1000,38875=>1000,38876=>1000,38877=>1000,38878=>1000,38879=>1000,38880=>1000,38881=>1000,38882=>1000,38883=>1000,38884=>1000, - 38885=>1000,38886=>1000,38887=>1000,38888=>1000,38889=>1000,38890=>1000,38891=>1000,38892=>1000,38893=>1000,38894=>1000,38895=>1000,38896=>1000,38897=>1000,38898=>1000,38899=>1000,38900=>1000, - 38901=>1000,38902=>1000,38903=>1000,38904=>1000,38905=>1000,38906=>1000,38907=>1000,38908=>1000,38909=>1000,38910=>1000,38911=>1000,38912=>1000,38913=>1000,38914=>1000,38915=>1000,38916=>1000, - 38917=>1000,38918=>1000,38919=>1000,38920=>1000,38921=>1000,38922=>1000,38923=>1000,38924=>1000,38925=>1000,38926=>1000,38927=>1000,38928=>1000,38929=>1000,38930=>1000,38931=>1000,38932=>1000, - 38933=>1000,38934=>1000,38935=>1000,38936=>1000,38937=>1000,38938=>1000,38939=>1000,38940=>1000,38941=>1000,38942=>1000,38943=>1000,38944=>1000,38945=>1000,38946=>1000,38947=>1000,38948=>1000, - 38949=>1000,38950=>1000,38951=>1000,38952=>1000,38953=>1000,38954=>1000,38955=>1000,38956=>1000,38957=>1000,38958=>1000,38959=>1000,38960=>1000,38961=>1000,38962=>1000,38963=>1000,38964=>1000, - 38965=>1000,38966=>1000,38967=>1000,38968=>1000,38969=>1000,38970=>1000,38971=>1000,38972=>1000,38973=>1000,38974=>1000,38975=>1000,38976=>1000,38977=>1000,38978=>1000,38979=>1000,38980=>1000, - 38981=>1000,38982=>1000,38983=>1000,38984=>1000,38985=>1000,38986=>1000,38987=>1000,38988=>1000,38989=>1000,38990=>1000,38991=>1000,38992=>1000,38993=>1000,38994=>1000,38995=>1000,38996=>1000, - 38997=>1000,38998=>1000,38999=>1000,39000=>1000,39001=>1000,39002=>1000,39003=>1000,39004=>1000,39005=>1000,39006=>1000,39007=>1000,39008=>1000,39009=>1000,39010=>1000,39011=>1000,39012=>1000, - 39013=>1000,39014=>1000,39015=>1000,39016=>1000,39017=>1000,39018=>1000,39019=>1000,39020=>1000,39021=>1000,39022=>1000,39023=>1000,39024=>1000,39025=>1000,39026=>1000,39027=>1000,39028=>1000, - 39029=>1000,39030=>1000,39031=>1000,39032=>1000,39033=>1000,39034=>1000,39035=>1000,39036=>1000,39037=>1000,39038=>1000,39039=>1000,39040=>1000,39041=>1000,39042=>1000,39043=>1000,39044=>1000, - 39045=>1000,39046=>1000,39047=>1000,39048=>1000,39049=>1000,39050=>1000,39051=>1000,39052=>1000,39053=>1000,39054=>1000,39055=>1000,39056=>1000,39057=>1000,39058=>1000,39059=>1000,39060=>1000, - 39061=>1000,39062=>1000,39063=>1000,39064=>1000,39065=>1000,39066=>1000,39067=>1000,39068=>1000,39069=>1000,39070=>1000,39071=>1000,39072=>1000,39073=>1000,39074=>1000,39075=>1000,39076=>1000, - 39077=>1000,39078=>1000,39079=>1000,39080=>1000,39081=>1000,39082=>1000,39083=>1000,39084=>1000,39085=>1000,39086=>1000,39087=>1000,39088=>1000,39089=>1000,39090=>1000,39091=>1000,39092=>1000, - 39093=>1000,39094=>1000,39095=>1000,39096=>1000,39097=>1000,39098=>1000,39099=>1000,39100=>1000,39101=>1000,39102=>1000,39103=>1000,39104=>1000,39105=>1000,39106=>1000,39107=>1000,39108=>1000, - 39109=>1000,39110=>1000,39111=>1000,39112=>1000,39113=>1000,39114=>1000,39115=>1000,39116=>1000,39117=>1000,39118=>1000,39119=>1000,39120=>1000,39121=>1000,39122=>1000,39123=>1000,39124=>1000, - 39125=>1000,39126=>1000,39127=>1000,39128=>1000,39129=>1000,39130=>1000,39131=>1000,39132=>1000,39133=>1000,39134=>1000,39135=>1000,39136=>1000,39137=>1000,39138=>1000,39139=>1000,39140=>1000, - 39141=>1000,39142=>1000,39143=>1000,39144=>1000,39145=>1000,39146=>1000,39147=>1000,39148=>1000,39149=>1000,39150=>1000,39151=>1000,39152=>1000,39153=>1000,39154=>1000,39155=>1000,39156=>1000, - 39157=>1000,39158=>1000,39159=>1000,39160=>1000,39161=>1000,39162=>1000,39163=>1000,39164=>1000,39165=>1000,39166=>1000,39167=>1000,39168=>1000,39169=>1000,39170=>1000,39171=>1000,39172=>1000, - 39173=>1000,39174=>1000,39175=>1000,39176=>1000,39177=>1000,39178=>1000,39179=>1000,39180=>1000,39181=>1000,39182=>1000,39183=>1000,39184=>1000,39185=>1000,39186=>1000,39187=>1000,39188=>1000, - 39189=>1000,39190=>1000,39191=>1000,39192=>1000,39193=>1000,39194=>1000,39195=>1000,39196=>1000,39197=>1000,39198=>1000,39199=>1000,39200=>1000,39201=>1000,39202=>1000,39203=>1000,39204=>1000, - 39205=>1000,39206=>1000,39207=>1000,39208=>1000,39209=>1000,39210=>1000,39211=>1000,39212=>1000,39213=>1000,39214=>1000,39215=>1000,39216=>1000,39217=>1000,39218=>1000,39219=>1000,39220=>1000, - 39221=>1000,39222=>1000,39223=>1000,39224=>1000,39225=>1000,39226=>1000,39227=>1000,39228=>1000,39229=>1000,39230=>1000,39231=>1000,39232=>1000,39233=>1000,39234=>1000,39235=>1000,39236=>1000, - 39237=>1000,39238=>1000,39239=>1000,39240=>1000,39241=>1000,39242=>1000,39243=>1000,39244=>1000,39245=>1000,39246=>1000,39247=>1000,39248=>1000,39249=>1000,39250=>1000,39251=>1000,39252=>1000, - 39253=>1000,39254=>1000,39255=>1000,39256=>1000,39257=>1000,39258=>1000,39259=>1000,39260=>1000,39261=>1000,39262=>1000,39263=>1000,39264=>1000,39265=>1000,39266=>1000,39267=>1000,39268=>1000, - 39269=>1000,39270=>1000,39271=>1000,39272=>1000,39273=>1000,39274=>1000,39275=>1000,39276=>1000,39277=>1000,39278=>1000,39279=>1000,39280=>1000,39281=>1000,39282=>1000,39283=>1000,39284=>1000, - 39285=>1000,39286=>1000,39287=>1000,39288=>1000,39289=>1000,39290=>1000,39291=>1000,39292=>1000,39293=>1000,39294=>1000,39295=>1000,39296=>1000,39297=>1000,39298=>1000,39299=>1000,39300=>1000, - 39301=>1000,39302=>1000,39303=>1000,39304=>1000,39305=>1000,39306=>1000,39307=>1000,39308=>1000,39309=>1000,39310=>1000,39311=>1000,39312=>1000,39313=>1000,39314=>1000,39315=>1000,39316=>1000, - 39317=>1000,39318=>1000,39319=>1000,39320=>1000,39321=>1000,39322=>1000,39323=>1000,39324=>1000,39325=>1000,39326=>1000,39327=>1000,39328=>1000,39329=>1000,39330=>1000,39331=>1000,39332=>1000, - 39333=>1000,39334=>1000,39335=>1000,39336=>1000,39337=>1000,39338=>1000,39339=>1000,39340=>1000,39341=>1000,39342=>1000,39343=>1000,39344=>1000,39345=>1000,39346=>1000,39347=>1000,39348=>1000, - 39349=>1000,39350=>1000,39351=>1000,39352=>1000,39353=>1000,39354=>1000,39355=>1000,39356=>1000,39357=>1000,39358=>1000,39359=>1000,39360=>1000,39361=>1000,39362=>1000,39363=>1000,39364=>1000, - 39365=>1000,39366=>1000,39367=>1000,39368=>1000,39369=>1000,39370=>1000,39371=>1000,39372=>1000,39373=>1000,39374=>1000,39375=>1000,39376=>1000,39377=>1000,39378=>1000,39379=>1000,39380=>1000, - 39381=>1000,39382=>1000,39383=>1000,39384=>1000,39385=>1000,39386=>1000,39387=>1000,39388=>1000,39389=>1000,39390=>1000,39391=>1000,39392=>1000,39393=>1000,39394=>1000,39395=>1000,39396=>1000, - 39397=>1000,39398=>1000,39399=>1000,39400=>1000,39401=>1000,39402=>1000,39403=>1000,39404=>1000,39405=>1000,39406=>1000,39407=>1000,39408=>1000,39409=>1000,39410=>1000,39411=>1000,39412=>1000, - 39413=>1000,39414=>1000,39415=>1000,39416=>1000,39417=>1000,39418=>1000,39419=>1000,39420=>1000,39421=>1000,39422=>1000,39423=>1000,39424=>1000,39425=>1000,39426=>1000,39427=>1000,39428=>1000, - 39429=>1000,39430=>1000,39431=>1000,39432=>1000,39433=>1000,39434=>1000,39435=>1000,39436=>1000,39437=>1000,39438=>1000,39439=>1000,39440=>1000,39441=>1000,39442=>1000,39443=>1000,39444=>1000, - 39445=>1000,39446=>1000,39447=>1000,39448=>1000,39449=>1000,39450=>1000,39451=>1000,39452=>1000,39453=>1000,39454=>1000,39455=>1000,39456=>1000,39457=>1000,39458=>1000,39459=>1000,39460=>1000, - 39461=>1000,39462=>1000,39463=>1000,39464=>1000,39465=>1000,39466=>1000,39467=>1000,39468=>1000,39469=>1000,39470=>1000,39471=>1000,39472=>1000,39473=>1000,39474=>1000,39475=>1000,39476=>1000, - 39477=>1000,39478=>1000,39479=>1000,39480=>1000,39481=>1000,39482=>1000,39483=>1000,39484=>1000,39485=>1000,39486=>1000,39487=>1000,39488=>1000,39489=>1000,39490=>1000,39491=>1000,39492=>1000, - 39493=>1000,39494=>1000,39495=>1000,39496=>1000,39497=>1000,39498=>1000,39499=>1000,39500=>1000,39501=>1000,39502=>1000,39503=>1000,39504=>1000,39505=>1000,39506=>1000,39507=>1000,39508=>1000, - 39509=>1000,39510=>1000,39511=>1000,39512=>1000,39513=>1000,39514=>1000,39515=>1000,39516=>1000,39517=>1000,39518=>1000,39519=>1000,39520=>1000,39521=>1000,39522=>1000,39523=>1000,39524=>1000, - 39525=>1000,39526=>1000,39527=>1000,39528=>1000,39529=>1000,39530=>1000,39531=>1000,39532=>1000,39533=>1000,39534=>1000,39535=>1000,39536=>1000,39537=>1000,39538=>1000,39539=>1000,39540=>1000, - 39541=>1000,39542=>1000,39543=>1000,39544=>1000,39545=>1000,39546=>1000,39547=>1000,39548=>1000,39549=>1000,39550=>1000,39551=>1000,39552=>1000,39553=>1000,39554=>1000,39555=>1000,39556=>1000, - 39557=>1000,39558=>1000,39559=>1000,39560=>1000,39561=>1000,39562=>1000,39563=>1000,39564=>1000,39565=>1000,39566=>1000,39567=>1000,39568=>1000,39569=>1000,39570=>1000,39571=>1000,39572=>1000, - 39573=>1000,39574=>1000,39575=>1000,39576=>1000,39577=>1000,39578=>1000,39579=>1000,39580=>1000,39581=>1000,39582=>1000,39583=>1000,39584=>1000,39585=>1000,39586=>1000,39587=>1000,39588=>1000, - 39589=>1000,39590=>1000,39591=>1000,39592=>1000,39593=>1000,39594=>1000,39595=>1000,39596=>1000,39597=>1000,39598=>1000,39599=>1000,39600=>1000,39601=>1000,39602=>1000,39603=>1000,39604=>1000, - 39605=>1000,39606=>1000,39607=>1000,39608=>1000,39609=>1000,39610=>1000,39611=>1000,39612=>1000,39613=>1000,39614=>1000,39615=>1000,39616=>1000,39617=>1000,39618=>1000,39619=>1000,39620=>1000, - 39621=>1000,39622=>1000,39623=>1000,39624=>1000,39625=>1000,39626=>1000,39627=>1000,39628=>1000,39629=>1000,39630=>1000,39631=>1000,39632=>1000,39633=>1000,39634=>1000,39635=>1000,39636=>1000, - 39637=>1000,39638=>1000,39639=>1000,39640=>1000,39641=>1000,39642=>1000,39643=>1000,39644=>1000,39645=>1000,39646=>1000,39647=>1000,39648=>1000,39649=>1000,39650=>1000,39651=>1000,39652=>1000, - 39653=>1000,39654=>1000,39655=>1000,39656=>1000,39657=>1000,39658=>1000,39659=>1000,39660=>1000,39661=>1000,39662=>1000,39663=>1000,39664=>1000,39665=>1000,39666=>1000,39667=>1000,39668=>1000, - 39669=>1000,39670=>1000,39671=>1000,39672=>1000,39673=>1000,39674=>1000,39675=>1000,39676=>1000,39677=>1000,39678=>1000,39679=>1000,39680=>1000,39681=>1000,39682=>1000,39683=>1000,39684=>1000, - 39685=>1000,39686=>1000,39687=>1000,39688=>1000,39689=>1000,39690=>1000,39691=>1000,39692=>1000,39693=>1000,39694=>1000,39695=>1000,39696=>1000,39697=>1000,39698=>1000,39699=>1000,39700=>1000, - 39701=>1000,39702=>1000,39703=>1000,39704=>1000,39705=>1000,39706=>1000,39707=>1000,39708=>1000,39709=>1000,39710=>1000,39711=>1000,39712=>1000,39713=>1000,39714=>1000,39715=>1000,39716=>1000, - 39717=>1000,39718=>1000,39719=>1000,39720=>1000,39721=>1000,39722=>1000,39723=>1000,39724=>1000,39725=>1000,39726=>1000,39727=>1000,39728=>1000,39729=>1000,39730=>1000,39731=>1000,39732=>1000, - 39733=>1000,39734=>1000,39735=>1000,39736=>1000,39737=>1000,39738=>1000,39739=>1000,39740=>1000,39741=>1000,39742=>1000,39743=>1000,39744=>1000,39745=>1000,39746=>1000,39747=>1000,39748=>1000, - 39749=>1000,39750=>1000,39751=>1000,39752=>1000,39753=>1000,39754=>1000,39755=>1000,39756=>1000,39757=>1000,39758=>1000,39759=>1000,39760=>1000,39761=>1000,39762=>1000,39763=>1000,39764=>1000, - 39765=>1000,39766=>1000,39767=>1000,39768=>1000,39769=>1000,39770=>1000,39771=>1000,39772=>1000,39773=>1000,39774=>1000,39775=>1000,39776=>1000,39777=>1000,39778=>1000,39779=>1000,39780=>1000, - 39781=>1000,39782=>1000,39783=>1000,39784=>1000,39785=>1000,39786=>1000,39787=>1000,39788=>1000,39789=>1000,39790=>1000,39791=>1000,39792=>1000,39793=>1000,39794=>1000,39795=>1000,39796=>1000, - 39797=>1000,39798=>1000,39799=>1000,39800=>1000,39801=>1000,39802=>1000,39803=>1000,39804=>1000,39805=>1000,39806=>1000,39807=>1000,39808=>1000,39809=>1000,39810=>1000,39811=>1000,39812=>1000, - 39813=>1000,39814=>1000,39815=>1000,39816=>1000,39817=>1000,39818=>1000,39819=>1000,39820=>1000,39821=>1000,39822=>1000,39823=>1000,39824=>1000,39825=>1000,39826=>1000,39827=>1000,39828=>1000, - 39829=>1000,39830=>1000,39831=>1000,39832=>1000,39833=>1000,39834=>1000,39835=>1000,39836=>1000,39837=>1000,39838=>1000,39839=>1000,39840=>1000,39841=>1000,39842=>1000,39843=>1000,39844=>1000, - 39845=>1000,39846=>1000,39847=>1000,39848=>1000,39849=>1000,39850=>1000,39851=>1000,39852=>1000,39853=>1000,39854=>1000,39855=>1000,39856=>1000,39857=>1000,39858=>1000,39859=>1000,39860=>1000, - 39861=>1000,39862=>1000,39863=>1000,39864=>1000,39865=>1000,39866=>1000,39867=>1000,39868=>1000,39869=>1000,39870=>1000,39871=>1000,39872=>1000,39873=>1000,39874=>1000,39875=>1000,39876=>1000, - 39877=>1000,39878=>1000,39879=>1000,39880=>1000,39881=>1000,39882=>1000,39883=>1000,39884=>1000,39885=>1000,39886=>1000,39887=>1000,39888=>1000,39889=>1000,39890=>1000,39891=>1000,39892=>1000, - 39893=>1000,39894=>1000,39895=>1000,39896=>1000,39897=>1000,39898=>1000,39899=>1000,39900=>1000,39901=>1000,39902=>1000,39903=>1000,39904=>1000,39905=>1000,39906=>1000,39907=>1000,39908=>1000, - 39909=>1000,39910=>1000,39911=>1000,39912=>1000,39913=>1000,39914=>1000,39915=>1000,39916=>1000,39917=>1000,39918=>1000,39919=>1000,39920=>1000,39921=>1000,39922=>1000,39923=>1000,39924=>1000, - 39925=>1000,39926=>1000,39927=>1000,39928=>1000,39929=>1000,39930=>1000,39931=>1000,39932=>1000,39933=>1000,39934=>1000,39935=>1000,39936=>1000,39937=>1000,39938=>1000,39939=>1000,39940=>1000, - 39941=>1000,39942=>1000,39943=>1000,39944=>1000,39945=>1000,39946=>1000,39947=>1000,39948=>1000,39949=>1000,39950=>1000,39951=>1000,39952=>1000,39953=>1000,39954=>1000,39955=>1000,39956=>1000, - 39957=>1000,39958=>1000,39959=>1000,39960=>1000,39961=>1000,39962=>1000,39963=>1000,39964=>1000,39965=>1000,39966=>1000,39967=>1000,39968=>1000,39969=>1000,39970=>1000,39971=>1000,39972=>1000, - 39973=>1000,39974=>1000,39975=>1000,39976=>1000,39977=>1000,39978=>1000,39979=>1000,39980=>1000,39981=>1000,39982=>1000,39983=>1000,39984=>1000,39985=>1000,39986=>1000,39987=>1000,39988=>1000, - 39989=>1000,39990=>1000,39991=>1000,39992=>1000,39993=>1000,39994=>1000,39995=>1000,39996=>1000,39997=>1000,39998=>1000,39999=>1000,40000=>1000,40001=>1000,40002=>1000,40003=>1000,40004=>1000, - 40005=>1000,40006=>1000,40007=>1000,40008=>1000,40009=>1000,40010=>1000,40011=>1000,40012=>1000,40013=>1000,40014=>1000,40015=>1000,40016=>1000,40017=>1000,40018=>1000,40019=>1000,40020=>1000, - 40021=>1000,40022=>1000,40023=>1000,40024=>1000,40025=>1000,40026=>1000,40027=>1000,40028=>1000,40029=>1000,40030=>1000,40031=>1000,40032=>1000,40033=>1000,40034=>1000,40035=>1000,40036=>1000, - 40037=>1000,40038=>1000,40039=>1000,40040=>1000,40041=>1000,40042=>1000,40043=>1000,40044=>1000,40045=>1000,40046=>1000,40047=>1000,40048=>1000,40049=>1000,40050=>1000,40051=>1000,40052=>1000, - 40053=>1000,40054=>1000,40055=>1000,40056=>1000,40057=>1000,40058=>1000,40059=>1000,40060=>1000,40061=>1000,40062=>1000,40063=>1000,40064=>1000,40065=>1000,40066=>1000,40067=>1000,40068=>1000, - 40069=>1000,40070=>1000,40071=>1000,40072=>1000,40073=>1000,40074=>1000,40075=>1000,40076=>1000,40077=>1000,40078=>1000,40079=>1000,40080=>1000,40081=>1000,40082=>1000,40083=>1000,40084=>1000, - 40085=>1000,40086=>1000,40087=>1000,40088=>1000,40089=>1000,40090=>1000,40091=>1000,40092=>1000,40093=>1000,40094=>1000,40095=>1000,40096=>1000,40097=>1000,40098=>1000,40099=>1000,40100=>1000, - 40101=>1000,40102=>1000,40103=>1000,40104=>1000,40105=>1000,40106=>1000,40107=>1000,40108=>1000,40109=>1000,40110=>1000,40111=>1000,40112=>1000,40113=>1000,40114=>1000,40115=>1000,40116=>1000, - 40117=>1000,40118=>1000,40119=>1000,40120=>1000,40121=>1000,40122=>1000,40123=>1000,40124=>1000,40125=>1000,40126=>1000,40127=>1000,40128=>1000,40129=>1000,40130=>1000,40131=>1000,40132=>1000, - 40133=>1000,40134=>1000,40135=>1000,40136=>1000,40137=>1000,40138=>1000,40139=>1000,40140=>1000,40141=>1000,40142=>1000,40143=>1000,40144=>1000,40145=>1000,40146=>1000,40147=>1000,40148=>1000, - 40149=>1000,40150=>1000,40151=>1000,40152=>1000,40153=>1000,40154=>1000,40155=>1000,40156=>1000,40157=>1000,40158=>1000,40159=>1000,40160=>1000,40161=>1000,40162=>1000,40163=>1000,40164=>1000, - 40165=>1000,40166=>1000,40167=>1000,40168=>1000,40169=>1000,40170=>1000,40171=>1000,40172=>1000,40173=>1000,40174=>1000,40175=>1000,40176=>1000,40177=>1000,40178=>1000,40179=>1000,40180=>1000, - 40181=>1000,40182=>1000,40183=>1000,40184=>1000,40185=>1000,40186=>1000,40187=>1000,40188=>1000,40189=>1000,40190=>1000,40191=>1000,40192=>1000,40193=>1000,40194=>1000,40195=>1000,40196=>1000, - 40197=>1000,40198=>1000,40199=>1000,40200=>1000,40201=>1000,40202=>1000,40203=>1000,40204=>1000,40205=>1000,40206=>1000,40207=>1000,40208=>1000,40209=>1000,40210=>1000,40211=>1000,40212=>1000, - 40213=>1000,40214=>1000,40215=>1000,40216=>1000,40217=>1000,40218=>1000,40219=>1000,40220=>1000,40221=>1000,40222=>1000,40223=>1000,40224=>1000,40225=>1000,40226=>1000,40227=>1000,40228=>1000, - 40229=>1000,40230=>1000,40231=>1000,40232=>1000,40233=>1000,40234=>1000,40235=>1000,40236=>1000,40237=>1000,40238=>1000,40239=>1000,40240=>1000,40241=>1000,40242=>1000,40243=>1000,40244=>1000, - 40245=>1000,40246=>1000,40247=>1000,40248=>1000,40249=>1000,40250=>1000,40251=>1000,40252=>1000,40253=>1000,40254=>1000,40255=>1000,40256=>1000,40257=>1000,40258=>1000,40259=>1000,40260=>1000, - 40261=>1000,40262=>1000,40263=>1000,40264=>1000,40265=>1000,40266=>1000,40267=>1000,40268=>1000,40269=>1000,40270=>1000,40271=>1000,40272=>1000,40273=>1000,40274=>1000,40275=>1000,40276=>1000, - 40277=>1000,40278=>1000,40279=>1000,40280=>1000,40281=>1000,40282=>1000,40283=>1000,40284=>1000,40285=>1000,40286=>1000,40287=>1000,40288=>1000,40289=>1000,40290=>1000,40291=>1000,40292=>1000, - 40293=>1000,40294=>1000,40295=>1000,40296=>1000,40297=>1000,40298=>1000,40299=>1000,40300=>1000,40301=>1000,40302=>1000,40303=>1000,40304=>1000,40305=>1000,40306=>1000,40307=>1000,40308=>1000, - 40309=>1000,40310=>1000,40311=>1000,40312=>1000,40313=>1000,40314=>1000,40315=>1000,40316=>1000,40317=>1000,40318=>1000,40319=>1000,40320=>1000,40321=>1000,40322=>1000,40323=>1000,40324=>1000, - 40325=>1000,40326=>1000,40327=>1000,40328=>1000,40329=>1000,40330=>1000,40331=>1000,40332=>1000,40333=>1000,40334=>1000,40335=>1000,40336=>1000,40337=>1000,40338=>1000,40339=>1000,40340=>1000, - 40341=>1000,40342=>1000,40343=>1000,40344=>1000,40345=>1000,40346=>1000,40347=>1000,40348=>1000,40349=>1000,40350=>1000,40351=>1000,40352=>1000,40353=>1000,40354=>1000,40355=>1000,40356=>1000, - 40357=>1000,40358=>1000,40359=>1000,40360=>1000,40361=>1000,40362=>1000,40363=>1000,40364=>1000,40365=>1000,40366=>1000,40367=>1000,40368=>1000,40369=>1000,40370=>1000,40371=>1000,40372=>1000, - 40373=>1000,40374=>1000,40375=>1000,40376=>1000,40377=>1000,40378=>1000,40379=>1000,40380=>1000,40381=>1000,40382=>1000,40383=>1000,40384=>1000,40385=>1000,40386=>1000,40387=>1000,40388=>1000, - 40389=>1000,40390=>1000,40391=>1000,40392=>1000,40393=>1000,40394=>1000,40395=>1000,40396=>1000,40397=>1000,40398=>1000,40399=>1000,40400=>1000,40401=>1000,40402=>1000,40403=>1000,40404=>1000, - 40405=>1000,40406=>1000,40407=>1000,40408=>1000,40409=>1000,40410=>1000,40411=>1000,40412=>1000,40413=>1000,40414=>1000,40415=>1000,40416=>1000,40417=>1000,40418=>1000,40419=>1000,40420=>1000, - 40421=>1000,40422=>1000,40423=>1000,40424=>1000,40425=>1000,40426=>1000,40427=>1000,40428=>1000,40429=>1000,40430=>1000,40431=>1000,40432=>1000,40433=>1000,40434=>1000,40435=>1000,40436=>1000, - 40437=>1000,40438=>1000,40439=>1000,40440=>1000,40441=>1000,40442=>1000,40443=>1000,40444=>1000,40445=>1000,40446=>1000,40447=>1000,40448=>1000,40449=>1000,40450=>1000,40451=>1000,40452=>1000, - 40453=>1000,40454=>1000,40455=>1000,40456=>1000,40457=>1000,40458=>1000,40459=>1000,40460=>1000,40461=>1000,40462=>1000,40463=>1000,40464=>1000,40465=>1000,40466=>1000,40467=>1000,40468=>1000, - 40469=>1000,40470=>1000,40471=>1000,40472=>1000,40473=>1000,40474=>1000,40475=>1000,40476=>1000,40477=>1000,40478=>1000,40479=>1000,40480=>1000,40481=>1000,40482=>1000,40483=>1000,40484=>1000, - 40485=>1000,40486=>1000,40487=>1000,40488=>1000,40489=>1000,40490=>1000,40491=>1000,40492=>1000,40493=>1000,40494=>1000,40495=>1000,40496=>1000,40497=>1000,40498=>1000,40499=>1000,40500=>1000, - 40501=>1000,40502=>1000,40503=>1000,40504=>1000,40505=>1000,40506=>1000,40507=>1000,40508=>1000,40509=>1000,40510=>1000,40511=>1000,40512=>1000,40513=>1000,40514=>1000,40515=>1000,40516=>1000, - 40517=>1000,40518=>1000,40519=>1000,40520=>1000,40521=>1000,40522=>1000,40523=>1000,40524=>1000,40525=>1000,40526=>1000,40527=>1000,40528=>1000,40529=>1000,40530=>1000,40531=>1000,40532=>1000, - 40533=>1000,40534=>1000,40535=>1000,40536=>1000,40537=>1000,40538=>1000,40539=>1000,40540=>1000,40541=>1000,40542=>1000,40543=>1000,40544=>1000,40545=>1000,40546=>1000,40547=>1000,40548=>1000, - 40549=>1000,40550=>1000,40551=>1000,40552=>1000,40553=>1000,40554=>1000,40555=>1000,40556=>1000,40557=>1000,40558=>1000,40559=>1000,40560=>1000,40561=>1000,40562=>1000,40563=>1000,40564=>1000, - 40565=>1000,40566=>1000,40567=>1000,40568=>1000,40569=>1000,40570=>1000,40571=>1000,40572=>1000,40573=>1000,40574=>1000,40575=>1000,40576=>1000,40577=>1000,40578=>1000,40579=>1000,40580=>1000, - 40581=>1000,40582=>1000,40583=>1000,40584=>1000,40585=>1000,40586=>1000,40587=>1000,40588=>1000,40589=>1000,40590=>1000,40591=>1000,40592=>1000,40593=>1000,40594=>1000,40595=>1000,40596=>1000, - 40597=>1000,40598=>1000,40599=>1000,40600=>1000,40601=>1000,40602=>1000,40603=>1000,40604=>1000,40605=>1000,40606=>1000,40607=>1000,40608=>1000,40609=>1000,40610=>1000,40611=>1000,40612=>1000, - 40613=>1000,40614=>1000,40615=>1000,40616=>1000,40617=>1000,40618=>1000,40619=>1000,40620=>1000,40621=>1000,40622=>1000,40623=>1000,40624=>1000,40625=>1000,40626=>1000,40627=>1000,40628=>1000, - 40629=>1000,40630=>1000,40631=>1000,40632=>1000,40633=>1000,40634=>1000,40635=>1000,40636=>1000,40637=>1000,40638=>1000,40639=>1000,40640=>1000,40641=>1000,40642=>1000,40643=>1000,40644=>1000, - 40645=>1000,40646=>1000,40647=>1000,40648=>1000,40649=>1000,40650=>1000,40651=>1000,40652=>1000,40653=>1000,40654=>1000,40655=>1000,40656=>1000,40657=>1000,40658=>1000,40659=>1000,40660=>1000, - 40661=>1000,40662=>1000,40663=>1000,40664=>1000,40665=>1000,40666=>1000,40667=>1000,40668=>1000,40669=>1000,40670=>1000,40671=>1000,40672=>1000,40673=>1000,40674=>1000,40675=>1000,40676=>1000, - 40677=>1000,40678=>1000,40679=>1000,40680=>1000,40681=>1000,40682=>1000,40683=>1000,40684=>1000,40685=>1000,40686=>1000,40687=>1000,40688=>1000,40689=>1000,40690=>1000,40691=>1000,40692=>1000, - 40693=>1000,40694=>1000,40695=>1000,40696=>1000,40697=>1000,40698=>1000,40699=>1000,40700=>1000,40701=>1000,40702=>1000,40703=>1000,40704=>1000,40705=>1000,40706=>1000,40707=>1000,40708=>1000, - 40709=>1000,40710=>1000,40711=>1000,40712=>1000,40713=>1000,40714=>1000,40715=>1000,40716=>1000,40717=>1000,40718=>1000,40719=>1000,40720=>1000,40721=>1000,40722=>1000,40723=>1000,40724=>1000, - 40725=>1000,40726=>1000,40727=>1000,40728=>1000,40729=>1000,40730=>1000,40731=>1000,40732=>1000,40733=>1000,40734=>1000,40735=>1000,40736=>1000,40737=>1000,40738=>1000,40739=>1000,40740=>1000, - 40741=>1000,40742=>1000,40743=>1000,40744=>1000,40745=>1000,40746=>1000,40747=>1000,40748=>1000,40749=>1000,40750=>1000,40751=>1000,40752=>1000,40753=>1000,40754=>1000,40755=>1000,40756=>1000, - 40757=>1000,40758=>1000,40759=>1000,40760=>1000,40761=>1000,40762=>1000,40763=>1000,40764=>1000,40765=>1000,40766=>1000,40767=>1000,40768=>1000,40769=>1000,40770=>1000,40771=>1000,40772=>1000, - 40773=>1000,40774=>1000,40775=>1000,40776=>1000,40777=>1000,40778=>1000,40779=>1000,40780=>1000,40781=>1000,40782=>1000,40783=>1000,40784=>1000,40785=>1000,40786=>1000,40787=>1000,40788=>1000, - 40789=>1000,40790=>1000,40791=>1000,40792=>1000,40793=>1000,40794=>1000,40795=>1000,40796=>1000,40797=>1000,40798=>1000,40799=>1000,40800=>1000,40801=>1000,40802=>1000,40803=>1000,40804=>1000, - 40805=>1000,40806=>1000,40807=>1000,40808=>1000,40809=>1000,40810=>1000,40811=>1000,40812=>1000,40813=>1000,40814=>1000,40815=>1000,40816=>1000,40817=>1000,40818=>1000,40819=>1000,40820=>1000, - 40821=>1000,40822=>1000,40823=>1000,40824=>1000,40825=>1000,40826=>1000,40827=>1000,40828=>1000,40829=>1000,40830=>1000,40831=>1000,40832=>1000,40833=>1000,40834=>1000,40835=>1000,40836=>1000, - 40837=>1000,40838=>1000,40839=>1000,40840=>1000,40841=>1000,40842=>1000,40843=>1000,40844=>1000,40845=>1000,40846=>1000,40847=>1000,40848=>1000,40849=>1000,40850=>1000,40851=>1000,40852=>1000, - 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, - 40869=>1000); -$diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -//$enc='UniCNS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ac15.php'); - -//$enc='UniGB-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -//include(dirname(__FILE__).'/uni2cid_ag15.php'); - -//$enc='UniKS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ak12.php'); - -$enc='UniJIS-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -include(dirname(__FILE__).'/uni2cid_aj16.php'); -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-korean.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-korean.php deleted file mode 100644 index c07a25e02b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0-korean.php +++ /dev/null @@ -1,1768 +0,0 @@ -<?php -$type='cidfont0'; -$name='ArialUnicodeMS'; -$desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-100; -$ut=50; -$dw=1000; -$cw=array( - 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, - 48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556, - 64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, - 80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>500, - 96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, - 112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,8364=>556, - 1027=>567,8218=>222,402=>278,8222=>333,8230=>1000,8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,1036=>584,381=>611,1039=>723,8216=>222, - 8217=>222,8220=>333,8221=>333,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>500,8250=>333,339=>944,1116=>437,382=>500,376=>667,160=>278,161=>333, - 162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>500,176=>400,177=>584, - 178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667, - 194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722, - 210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, - 226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556, - 242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, - 258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500,268=>722,269=>500,270=>722,271=>627,272=>722,273=>556, - 274=>667,275=>556,276=>667,277=>556,278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556,288=>778,289=>556, - 290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>222,298=>278,299=>222,300=>278,301=>222,302=>278,303=>222,304=>278,305=>278, - 306=>751,307=>444,308=>500,309=>222,310=>667,311=>500,312=>437,313=>556,314=>222,315=>556,316=>222,317=>556,318=>222,319=>556,320=>318,321=>556, - 322=>222,323=>722,324=>556,325=>722,326=>556,327=>722,328=>556,329=>626,330=>723,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, - 340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500,350=>667,351=>500,354=>611,355=>278,356=>611,357=>406, - 358=>611,359=>278,360=>722,361=>556,362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556,372=>944,373=>722, - 374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>222,384=>556,385=>740,386=>655,387=>556,388=>556,389=>556,390=>722,391=>766,392=>579, - 393=>722,394=>789,395=>655,396=>556,397=>557,398=>667,399=>729,400=>604,401=>611,403=>791,404=>649,405=>806,406=>245,407=>322,408=>667,409=>500, - 410=>322,411=>500,412=>833,413=>722,414=>556,415=>778,416=>776,417=>556,418=>1019,419=>782,420=>735,421=>556,422=>722,423=>667,424=>500,425=>602, - 426=>366,427=>278,428=>571,429=>278,430=>611,431=>776,432=>620,433=>748,434=>667,435=>752,436=>615,437=>611,438=>500,439=>628,440=>628,441=>526, - 442=>480,443=>556,444=>556,445=>526,446=>556,447=>556,448=>278,449=>464,450=>474,451=>278,452=>1333,453=>1222,454=>1056,455=>1030,456=>778,457=>444, - 458=>1222,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722, - 474=>556,475=>722,476=>556,477=>556,478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556,488=>667,489=>500, - 490=>778,491=>556,492=>778,493=>556,494=>534,495=>534,496=>222,497=>1333,498=>1222,499=>1056,500=>778,501=>556,506=>667,507=>556,508=>1000,509=>889, - 510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667,519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556, - 526=>778,527=>556,528=>722,529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500, - 598=>556,599=>556,600=>556,601=>556,602=>777,603=>485,604=>485,605=>686,606=>519,607=>260,608=>556,609=>556,610=>557,611=>500,612=>500,613=>556, - 614=>556,615=>556,616=>242,617=>282,618=>356,619=>356,620=>425,621=>222,622=>635,623=>833,624=>833,625=>833,626=>556,627=>556,628=>558,629=>556, - 630=>715,631=>674,632=>558,633=>333,634=>333,635=>333,636=>333,637=>333,638=>312,639=>312,640=>530,641=>530,642=>500,643=>216,644=>276,645=>216, - 646=>222,647=>278,648=>278,649=>596,650=>558,651=>556,652=>500,653=>722,654=>500,655=>500,656=>500,657=>564,658=>530,659=>530,660=>464,661=>464, - 662=>464,663=>500,664=>614,665=>526,666=>519,667=>557,668=>558,669=>222,670=>500,671=>416,672=>556,673=>464,674=>464,675=>966,676=>966,677=>1030, - 678=>689,679=>484,680=>718,688=>326,689=>326,690=>153,691=>201,692=>201,693=>201,694=>304,695=>389,696=>278,697=>222,698=>372,699=>222,700=>222, - 701=>222,702=>222,703=>222,704=>250,705=>250,706=>320,707=>320,708=>320,709=>320,711=>333,712=>192,713=>333,714=>333,715=>333,716=>192,717=>333, - 718=>333,719=>333,720=>300,721=>300,722=>222,723=>222,724=>340,725=>340,726=>280,727=>362,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, - 736=>278,737=>153,738=>270,739=>274,740=>325,741=>360,742=>360,743=>360,744=>360,745=>360,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, - 774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0, - 790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0, - 806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, - 822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, - 864=>0,865=>0,884=>308,885=>308,890=>278,894=>278,900=>278,901=>278,902=>667,903=>278,904=>704,905=>759,906=>315,908=>778,910=>746,911=>758, - 912=>222,913=>667,914=>667,915=>550,916=>682,917=>667,918=>611,919=>722,920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>650,927=>778, - 928=>722,929=>667,931=>602,932=>611,933=>667,934=>808,935=>667,936=>804,937=>758,938=>278,939=>667,940=>576,941=>434,942=>556,943=>222,944=>551, - 945=>576,946=>563,947=>500,948=>557,949=>434,950=>440,951=>556,952=>556,953=>222,954=>498,955=>500,956=>553,957=>500,958=>432,959=>556,960=>678, - 961=>571,962=>472,963=>619,964=>382,965=>551,966=>649,967=>522,968=>729,969=>766,970=>222,971=>551,972=>556,973=>551,974=>766,976=>563,977=>616, - 978=>631,979=>726,980=>631,981=>644,982=>781,986=>722,988=>578,990=>570,992=>692,994=>880,995=>833,996=>684,997=>558,998=>680,999=>529,1000=>557, - 1001=>505,1002=>623,1003=>603,1004=>610,1005=>611,1006=>568,1007=>434,1008=>600,1009=>571,1010=>500,1011=>222,1025=>667,1026=>865,1028=>717,1029=>667,1030=>278, - 1031=>278,1032=>500,1033=>1105,1034=>1009,1035=>867,1038=>635,1040=>667,1041=>655,1042=>667,1043=>567,1044=>677,1045=>667,1046=>923,1047=>604,1048=>722,1049=>722, - 1050=>584,1051=>705,1052=>833,1053=>722,1054=>778,1055=>723,1056=>667,1057=>722,1058=>611,1059=>635,1060=>760,1061=>667,1062=>740,1063=>684,1064=>920,1065=>939, - 1066=>793,1067=>883,1068=>655,1069=>717,1070=>1006,1071=>722,1072=>556,1073=>573,1074=>531,1075=>383,1076=>583,1077=>556,1078=>669,1079=>458,1080=>559,1081=>559, - 1082=>437,1083=>571,1084=>683,1085=>552,1086=>556,1087=>542,1088=>556,1089=>500,1090=>458,1091=>500,1092=>823,1093=>500,1094=>562,1095=>533,1096=>802,1097=>823, - 1098=>620,1099=>717,1100=>523,1101=>510,1102=>744,1103=>542,1105=>556,1106=>556,1107=>383,1108=>510,1109=>500,1110=>222,1111=>278,1112=>222,1113=>873,1114=>811, - 1115=>556,1118=>500,1119=>542,1120=>976,1121=>766,1122=>656,1123=>521,1124=>950,1125=>694,1126=>667,1127=>597,1128=>952,1129=>817,1130=>654,1131=>600,1132=>932, - 1133=>817,1134=>604,1135=>458,1136=>804,1137=>729,1138=>778,1139=>556,1140=>667,1141=>500,1142=>667,1143=>500,1144=>1279,1145=>1060,1146=>778,1147=>556,1148=>976, - 1149=>766,1150=>976,1151=>766,1152=>722,1153=>514,1154=>686,1155=>334,1156=>382,1157=>334,1158=>334,1168=>435,1169=>339,1170=>567,1171=>383,1172=>656,1173=>556, - 1174=>923,1175=>669,1176=>604,1177=>458,1178=>584,1179=>437,1180=>584,1181=>437,1182=>584,1183=>437,1184=>764,1185=>537,1186=>741,1187=>573,1188=>900,1189=>670, - 1190=>736,1191=>560,1192=>778,1193=>560,1194=>722,1195=>500,1196=>611,1197=>458,1198=>667,1199=>500,1200=>667,1201=>500,1202=>667,1203=>500,1204=>916,1205=>661, - 1206=>684,1207=>533,1208=>684,1209=>533,1210=>684,1211=>556,1212=>829,1213=>667,1214=>829,1215=>667,1216=>278,1217=>923,1218=>669,1219=>584,1220=>437,1223=>735, - 1224=>570,1227=>684,1228=>533,1232=>667,1233=>556,1234=>667,1235=>556,1236=>1000,1237=>889,1238=>667,1239=>556,1240=>729,1241=>556,1242=>729,1243=>556,1244=>923, - 1245=>669,1246=>604,1247=>458,1248=>604,1249=>492,1250=>722,1251=>559,1252=>722,1253=>559,1254=>778,1255=>556,1256=>778,1257=>556,1258=>778,1259=>556,1262=>635, - 1263=>500,1264=>635,1265=>500,1266=>635,1267=>500,1268=>684,1269=>533,1272=>883,1273=>717,1329=>635,1330=>531,1331=>583,1332=>583,1333=>531,1334=>531,1335=>427, - 1336=>531,1337=>750,1338=>635,1339=>531,1340=>375,1341=>583,1342=>698,1343=>531,1344=>427,1345=>531,1346=>583,1347=>531,1348=>635,1349=>698,1350=>635,1351=>635, - 1352=>531,1353=>531,1354=>698,1355=>531,1356=>635,1357=>531,1358=>698,1359=>583,1360=>479,1361=>583,1362=>531,1363=>698,1364=>698,1365=>635,1366=>750,1369=>271, - 1370=>271,1371=>150,1372=>300,1373=>271,1374=>271,1375=>420,1377=>583,1378=>427,1379=>427,1380=>427,1381=>427,1382=>427,1383=>427,1384=>427,1385=>459,1386=>427, - 1387=>427,1388=>323,1389=>531,1390=>427,1391=>427,1392=>427,1393=>427,1394=>427,1395=>427,1396=>427,1397=>271,1398=>427,1399=>375,1400=>427,1401=>375,1402=>583, - 1403=>427,1404=>427,1405=>427,1406=>427,1407=>583,1408=>427,1409=>427,1410=>323,1411=>583,1412=>375,1413=>375,1414=>583,1415=>527,1417=>271,1425=>360,1426=>360, - 1427=>360,1428=>360,1429=>360,1430=>360,1431=>360,1432=>360,1433=>360,1434=>360,1435=>360,1436=>360,1437=>360,1438=>360,1439=>360,1440=>360,1441=>360,1443=>360, - 1444=>360,1445=>360,1446=>360,1447=>360,1448=>360,1449=>360,1450=>360,1451=>360,1452=>360,1453=>360,1454=>360,1455=>360,1456=>360,1457=>360,1458=>360,1459=>360, - 1460=>360,1461=>360,1462=>360,1463=>360,1464=>360,1465=>360,1467=>360,1468=>360,1469=>360,1470=>366,1471=>360,1472=>225,1473=>360,1474=>360,1475=>238,1476=>360, - 1488=>577,1489=>563,1490=>411,1491=>512,1492=>594,1493=>316,1494=>326,1495=>594,1496=>594,1497=>316,1498=>507,1499=>527,1500=>484,1501=>594,1502=>594,1503=>316, - 1504=>338,1505=>604,1506=>550,1507=>567,1508=>569,1509=>505,1510=>514,1511=>583,1512=>507,1513=>700,1514=>633,1520=>590,1521=>590,1522=>590,1523=>216,1524=>412, - 1548=>278,1563=>278,1567=>556,1569=>529,1570=>243,1571=>243,1572=>470,1573=>243,1574=>731,1575=>243,1576=>771,1577=>514,1578=>771,1579=>771,1580=>544,1581=>544, - 1582=>544,1583=>430,1584=>430,1585=>421,1586=>421,1587=>1194,1588=>1194,1589=>1291,1590=>1291,1591=>843,1592=>843,1593=>594,1594=>594,1600=>279,1601=>957,1602=>800, - 1603=>757,1604=>662,1605=>589,1606=>692,1607=>514,1608=>470,1609=>731,1610=>731,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0, - 1632=>480,1633=>480,1634=>480,1635=>480,1636=>480,1637=>480,1638=>480,1639=>480,1640=>480,1641=>480,1642=>547,1643=>278,1644=>278,1645=>438,1648=>0,1649=>243, - 1650=>243,1651=>243,1652=>0,1653=>380,1654=>470,1655=>548,1656=>772,1657=>771,1658=>771,1659=>771,1660=>771,1661=>771,1662=>771,1663=>771,1664=>771,1665=>544, - 1666=>544,1667=>544,1668=>544,1669=>544,1670=>544,1671=>544,1672=>430,1673=>430,1674=>430,1675=>430,1676=>430,1677=>430,1678=>430,1679=>430,1680=>430,1681=>421, - 1682=>421,1683=>421,1684=>421,1685=>421,1686=>419,1687=>421,1688=>421,1689=>421,1690=>1194,1691=>1194,1692=>1194,1693=>1291,1694=>1291,1695=>843,1696=>594,1697=>957, - 1698=>957,1699=>957,1700=>957,1701=>957,1702=>957,1703=>800,1704=>800,1705=>828,1706=>1058,1707=>828,1708=>757,1709=>757,1710=>757,1711=>828,1712=>828,1713=>828, - 1714=>828,1715=>828,1716=>828,1717=>662,1718=>662,1719=>662,1722=>692,1723=>692,1724=>692,1725=>692,1726=>706,1728=>514,1729=>509,1730=>509,1731=>509,1732=>470, - 1733=>470,1734=>470,1735=>470,1736=>470,1737=>470,1738=>470,1739=>470,1740=>731,1741=>841,1742=>731,1744=>731,1745=>731,1746=>550,1747=>550,1748=>279,1749=>514, - 1750=>726,1751=>558,1752=>321,1753=>318,1754=>342,1755=>373,1756=>716,1757=>688,1758=>852,1759=>288,1760=>288,1761=>388,1762=>350,1763=>716,1764=>146,1765=>282, - 1766=>339,1767=>339,1768=>415,1769=>514,1770=>220,1771=>220,1772=>220,1773=>350,1776=>480,1777=>480,1778=>480,1779=>480,1780=>480,1781=>480,1782=>480,1783=>480, - 1784=>480,1785=>480,2305=>0,2306=>0,2307=>294,2309=>693,2310=>910,2311=>533,2312=>533,2313=>590,2314=>713,2315=>920,2316=>677,2317=>611,2318=>611,2319=>611, - 2320=>611,2321=>910,2322=>910,2323=>910,2324=>910,2325=>667,2326=>732,2327=>593,2328=>639,2329=>624,2330=>688,2331=>713,2332=>688,2333=>712,2334=>697,2335=>502, - 2336=>533,2337=>583,2338=>523,2339=>693,2340=>585,2341=>638,2342=>533,2343=>640,2344=>585,2345=>585,2346=>565,2347=>699,2348=>592,2349=>689,2350=>633,2351=>600, - 2352=>486,2353=>486,2354=>680,2355=>730,2356=>730,2357=>592,2358=>684,2359=>608,2360=>646,2361=>546,2364=>0,2365=>373,2366=>319,2367=>319,2368=>319,2369=>0, - 2370=>0,2371=>0,2372=>0,2373=>0,2374=>0,2375=>0,2376=>0,2377=>319,2378=>319,2379=>319,2380=>319,2381=>0,2384=>884,2385=>0,2386=>0,2387=>0, - 2388=>0,2392=>667,2393=>732,2394=>593,2395=>688,2396=>583,2397=>523,2398=>699,2399=>600,2400=>920,2401=>677,2402=>0,2403=>0,2404=>331,2405=>513,2406=>639, - 2407=>639,2408=>639,2409=>639,2410=>639,2411=>639,2412=>639,2413=>639,2414=>639,2415=>639,2416=>362,2433=>0,2434=>430,2435=>430,2437=>786,2438=>1030,2439=>582, - 2440=>603,2441=>648,2442=>757,2443=>758,2444=>630,2447=>685,2448=>746,2451=>711,2452=>776,2453=>779,2454=>655,2455=>606,2456=>645,2457=>661,2458=>554,2459=>585, - 2460=>729,2461=>752,2462=>893,2463=>567,2464=>625,2465=>648,2466=>567,2467=>598,2468=>680,2469=>645,2470=>609,2471=>596,2472=>595,2474=>635,2475=>780,2476=>593, - 2477=>677,2478=>621,2479=>601,2480=>593,2482=>640,2486=>598,2487=>596,2488=>637,2489=>582,2492=>0,2494=>245,2495=>245,2496=>245,2497=>0,2498=>0,2499=>0, - 2500=>0,2503=>309,2504=>309,2507=>932,2508=>932,2509=>0,2519=>245,2524=>648,2525=>553,2527=>596,2528=>758,2529=>630,2530=>0,2531=>335,2534=>610,2535=>559, - 2536=>595,2537=>711,2538=>610,2539=>661,2540=>661,2541=>559,2542=>661,2543=>600,2544=>593,2545=>593,2546=>601,2547=>567,2548=>601,2549=>699,2550=>661,2551=>267, - 2552=>610,2553=>424,2554=>548,2562=>0,2565=>691,2566=>936,2567=>803,2568=>803,2569=>678,2570=>678,2575=>557,2576=>691,2579=>678,2580=>691,2581=>602,2582=>567, - 2583=>641,2584=>688,2585=>565,2586=>592,2587=>603,2588=>591,2589=>541,2590=>558,2591=>543,2592=>581,2593=>596,2594=>640,2595=>640,2596=>591,2597=>564,2598=>640, - 2599=>564,2600=>581,2602=>564,2603=>551,2604=>560,2605=>549,2606=>558,2607=>652,2608=>540,2610=>677,2611=>677,2613=>601,2614=>558,2616=>558,2617=>549,2620=>0, - 2622=>246,2623=>246,2624=>246,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>567,2650=>690,2651=>591,2652=>591,2654=>581,2662=>591, - 2663=>591,2664=>591,2665=>591,2666=>591,2667=>591,2668=>591,2669=>591,2670=>591,2671=>591,2672=>0,2673=>0,2674=>557,2675=>678,2676=>894,2689=>0,2690=>0, - 2691=>300,2693=>781,2694=>1044,2695=>589,2696=>589,2697=>560,2698=>758,2699=>806,2701=>781,2703=>781,2704=>781,2705=>1044,2707=>1044,2708=>1044,2709=>413,2710=>773, - 2711=>606,2712=>558,2713=>483,2714=>600,2715=>691,2716=>811,2717=>647,2718=>651,2719=>453,2720=>450,2721=>425,2722=>478,2723=>694,2724=>534,2725=>553,2726=>446, - 2727=>541,2728=>582,2730=>572,2731=>437,2732=>663,2733=>756,2734=>594,2735=>493,2736=>392,2738=>613,2739=>656,2741=>538,2742=>611,2743=>507,2744=>663,2745=>587, - 2748=>0,2749=>478,2750=>273,2751=>273,2752=>273,2753=>0,2754=>0,2755=>0,2756=>0,2757=>0,2759=>0,2760=>0,2761=>273,2763=>273,2764=>273,2765=>0, - 2768=>843,2784=>893,2790=>625,2791=>625,2792=>625,2793=>625,2794=>625,2795=>625,2796=>625,2797=>625,2798=>625,2799=>625,2817=>0,2818=>306,2819=>391,2821=>590, - 2822=>808,2823=>658,2824=>658,2825=>633,2826=>654,2827=>636,2828=>540,2831=>560,2832=>938,2835=>600,2836=>973,2837=>603,2838=>620,2839=>620,2840=>605,2841=>712, - 2842=>579,2843=>579,2844=>593,2845=>564,2846=>581,2847=>604,2848=>578,2849=>579,2850=>579,2851=>607,2852=>579,2853=>587,2854=>579,2855=>602,2856=>579,2858=>605, - 2859=>728,2860=>579,2861=>643,2862=>605,2863=>628,2864=>619,2866=>653,2867=>593,2870=>620,2871=>605,2872=>605,2873=>579,2876=>0,2877=>333,2878=>218,2879=>0, - 2880=>294,2881=>0,2882=>0,2883=>0,2887=>479,2888=>479,2891=>1026,2892=>1026,2893=>0,2902=>0,2903=>218,2908=>579,2909=>579,2911=>599,2912=>636,2913=>540, - 2918=>578,2919=>480,2920=>480,2921=>622,2922=>506,2923=>605,2924=>529,2925=>548,2926=>512,2927=>528,2928=>561,2946=>0,2947=>742,2949=>1002,2950=>1118,2951=>994, - 2952=>660,2953=>1012,2954=>1231,2958=>726,2959=>731,2960=>870,2962=>763,2963=>763,2964=>1636,2965=>667,2969=>830,2970=>584,2972=>876,2974=>986,2975=>802,2979=>1295, - 2980=>656,2984=>630,2985=>1012,2986=>694,2990=>727,2991=>790,2992=>545,2993=>718,2994=>821,2995=>871,2996=>724,2997=>873,2999=>1087,3000=>1098,3001=>1274,3006=>547, - 3007=>172,3008=>93,3009=>519,3010=>814,3014=>748,3015=>681,3016=>956,3018=>1666,3019=>1666,3020=>1994,3021=>0,3031=>871,3047=>667,3048=>1012,3049=>751,3050=>740, - 3051=>924,3052=>884,3053=>726,3054=>1002,3055=>825,3056=>717,3057=>719,3058=>774,3073=>365,3074=>601,3075=>346,3077=>720,3078=>786,3079=>567,3080=>1159,3081=>690, - 3082=>1047,3083=>1299,3084=>913,3086=>625,3087=>625,3088=>712,3090=>655,3091=>655,3092=>862,3093=>515,3094=>680,3095=>526,3096=>943,3097=>655,3098=>684,3099=>684, - 3100=>670,3101=>1205,3102=>732,3103=>888,3104=>597,3105=>709,3106=>709,3107=>809,3108=>715,3109=>702,3110=>702,3111=>702,3112=>607,3114=>623,3115=>623,3116=>681, - 3117=>681,3118=>932,3119=>1203,3120=>597,3121=>893,3122=>631,3123=>608,3125=>620,3126=>541,3127=>667,3128=>640,3129=>911,3134=>644,3135=>298,3136=>298,3137=>361, - 3138=>682,3139=>342,3140=>704,3142=>624,3143=>624,3144=>900,3146=>849,3147=>849,3148=>976,3149=>669,3157=>298,3158=>119,3168=>1620,3169=>1281,3174=>840,3175=>840, - 3176=>840,3177=>840,3178=>840,3179=>840,3180=>840,3181=>840,3182=>840,3183=>840,3202=>440,3203=>251,3205=>654,3206=>654,3207=>631,3208=>891,3209=>957,3210=>1293, - 3211=>1044,3212=>744,3214=>650,3215=>650,3216=>659,3218=>667,3219=>667,3220=>667,3221=>462,3222=>749,3223=>543,3224=>779,3225=>674,3226=>682,3227=>660,3228=>667, - 3229=>1171,3230=>926,3231=>671,3232=>557,3233=>669,3234=>669,3235=>728,3236=>544,3237=>672,3238=>672,3239=>672,3240=>560,3242=>668,3243=>668,3244=>681,3245=>687, - 3246=>972,3247=>1101,3248=>556,3249=>677,3250=>661,3251=>545,3253=>666,3254=>553,3255=>670,3256=>549,3257=>716,3262=>425,3263=>341,3264=>680,3265=>354,3266=>714, - 3267=>386,3268=>638,3270=>307,3271=>670,3272=>462,3274=>908,3275=>1251,3276=>434,3277=>336,3285=>344,3286=>404,3294=>673,3296=>1695,3297=>978,3302=>549,3303=>549, - 3304=>549,3305=>549,3306=>549,3307=>549,3308=>549,3309=>549,3310=>549,3311=>549,3330=>368,3331=>305,3333=>1201,3334=>1351,3335=>905,3336=>1459,3337=>635,3338=>1198, - 3339=>861,3340=>957,3342=>1211,3343=>1202,3344=>1839,3346=>642,3347=>1114,3348=>1195,3349=>861,3350=>982,3351=>874,3352=>1354,3353=>957,3354=>1016,3355=>1266,3356=>712, - 3357=>1454,3358=>1215,3359=>563,3360=>565,3361=>1192,3362=>1244,3363=>1268,3364=>878,3365=>966,3366=>545,3367=>879,3368=>879,3370=>1031,3371=>1175,3372=>1334,3373=>546, - 3374=>643,3375=>949,3376=>642,3377=>555,3378=>945,3379=>631,3380=>553,3381=>959,3382=>936,3383=>1122,3384=>1190,3385=>1112,3390=>475,3391=>418,3392=>442,3393=>340, - 3394=>340,3395=>473,3398=>640,3399=>530,3400=>1279,3402=>1368,3403=>1258,3404=>1447,3405=>0,3415=>553,3424=>861,3425=>1100,3430=>1095,3431=>929,3432=>854,3433=>1181, - 3434=>658,3435=>972,3436=>1210,3437=>650,3438=>959,3439=>896,3585=>595,3586=>648,3587=>665,3588=>608,3589=>608,3590=>665,3591=>471,3592=>556,3593=>652,3594=>664, - 3595=>681,3596=>816,3597=>849,3598=>620,3599=>620,3600=>541,3601=>785,3602=>826,3603=>887,3604=>598,3605=>605,3606=>595,3607=>650,3608=>541,3609=>652,3610=>608, - 3611=>608,3612=>630,3613=>630,3614=>695,3615=>695,3616=>620,3617=>581,3618=>588,3619=>501,3620=>595,3621=>569,3622=>620,3623=>519,3624=>592,3625=>659,3626=>574, - 3627=>654,3628=>695,3629=>566,3630=>574,3631=>517,3632=>452,3633=>0,3634=>496,3635=>496,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, - 3647=>687,3648=>302,3649=>571,3650=>478,3651=>515,3652=>515,3653=>496,3654=>506,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0, - 3663=>555,3664=>598,3665=>640,3666=>688,3667=>690,3668=>657,3669=>657,3670=>635,3671=>839,3672=>693,3673=>769,3674=>673,3675=>994,3713=>775,3714=>707,3716=>724, - 3719=>524,3720=>690,3722=>678,3725=>711,3732=>719,3733=>834,3734=>776,3735=>916,3737=>744,3738=>740,3739=>740,3740=>834,3741=>834,3742=>854,3743=>854,3745=>775, - 3746=>724,3747=>697,3749=>700,3751=>700,3754=>708,3755=>916,3757=>700,3758=>697,3759=>658,3760=>432,3761=>534,3762=>476,3763=>476,3764=>778,3765=>778,3766=>778, - 3767=>778,3768=>778,3769=>778,3771=>778,3772=>778,3773=>670,3776=>420,3777=>806,3778=>430,3779=>446,3780=>346,3782=>571,3784=>778,3785=>778,3786=>778,3787=>778, - 3788=>778,3789=>778,3792=>721,3793=>719,3794=>601,3795=>711,3796=>686,3797=>686,3798=>834,3799=>756,3800=>724,3801=>906,3804=>1272,3805=>1272,3840=>600,3841=>600, - 3842=>600,3843=>600,3844=>600,3845=>600,3846=>600,3847=>600,3848=>600,3849=>600,3850=>600,3851=>600,3852=>600,3853=>600,3854=>600,3855=>600,3856=>600,3857=>600, - 3858=>600,3859=>600,3860=>600,3861=>600,3862=>600,3863=>600,3864=>600,3865=>600,3866=>600,3867=>600,3868=>600,3869=>600,3870=>600,3871=>600,3872=>600,3873=>600, - 3874=>600,3875=>600,3876=>600,3877=>600,3878=>600,3879=>600,3880=>600,3881=>600,3882=>600,3883=>600,3884=>600,3885=>600,3886=>600,3887=>600,3888=>600,3889=>600, - 3890=>600,3891=>600,3892=>600,3893=>600,3894=>600,3895=>600,3896=>600,3897=>600,3898=>600,3899=>600,3900=>600,3901=>600,3902=>600,3903=>600,3904=>600,3905=>600, - 3906=>600,3907=>600,3908=>600,3909=>600,3910=>600,3911=>600,3913=>600,3914=>600,3915=>600,3916=>600,3917=>600,3918=>600,3919=>600,3920=>600,3921=>600,3922=>600, - 3923=>600,3924=>600,3925=>600,3926=>600,3927=>600,3928=>600,3929=>600,3930=>600,3931=>600,3932=>600,3933=>600,3934=>600,3935=>600,3936=>600,3937=>600,3938=>600, - 3939=>600,3940=>600,3941=>600,3942=>600,3943=>600,3944=>600,3945=>600,3953=>600,3954=>600,3955=>600,3956=>600,3957=>600,3958=>600,3959=>600,3960=>600,3961=>600, - 3962=>600,3963=>600,3964=>600,3965=>600,3966=>600,3967=>600,3968=>600,3969=>600,3970=>600,3971=>600,3972=>600,3973=>600,3974=>600,3975=>600,3976=>600,3977=>600, - 3978=>600,3979=>600,3984=>600,3985=>600,3986=>600,3987=>600,3988=>600,3989=>600,3991=>600,3993=>600,3994=>600,3995=>600,3996=>600,3997=>600,3998=>600,3999=>600, - 4000=>600,4001=>600,4002=>600,4003=>600,4004=>600,4005=>600,4006=>600,4007=>600,4008=>600,4009=>600,4010=>600,4011=>600,4012=>600,4013=>600,4017=>600,4018=>600, - 4019=>600,4020=>600,4021=>600,4022=>600,4023=>600,4025=>600,4256=>662,4257=>677,4258=>708,4259=>696,4260=>609,4261=>790,4262=>664,4263=>785,4264=>560,4265=>634, - 4266=>782,4267=>701,4268=>629,4269=>682,4270=>705,4271=>692,4272=>734,4273=>615,4274=>592,4275=>680,4276=>679,4277=>705,4278=>643,4279=>623,4280=>623,4281=>629, - 4282=>633,4283=>770,4284=>592,4285=>662,4286=>629,4287=>672,4288=>735,4289=>576,4290=>606,4291=>605,4292=>676,4293=>792,4304=>435,4305=>556,4306=>565,4307=>872, - 4308=>506,4309=>544,4310=>723,4311=>868,4312=>530,4313=>532,4314=>955,4315=>552,4316=>565,4317=>712,4318=>547,4319=>574,4320=>685,4321=>554,4322=>806,4323=>810, - 4324=>777,4325=>502,4326=>686,4327=>512,4328=>552,4329=>496,4330=>568,4331=>552,4332=>592,4333=>565,4334=>552,4335=>741,4336=>549,4337=>659,4338=>559,4339=>524, - 4340=>482,4341=>565,4342=>822,4347=>506,4352=>1000,4353=>1000,4354=>1000,4355=>1000,4356=>1000,4357=>1000,4358=>1000,4359=>1000,4360=>1000,4361=>1000,4362=>1000,4363=>1000, - 4364=>1000,4365=>1000,4366=>1000,4367=>1000,4368=>1000,4369=>1000,4370=>1000,4371=>1000,4372=>1000,4373=>1000,4374=>1000,4375=>1000,4376=>1000,4377=>1000,4378=>1000,4379=>1000, - 4380=>1000,4381=>1000,4382=>1000,4383=>1000,4384=>1000,4385=>1000,4386=>1000,4387=>1000,4388=>1000,4389=>1000,4390=>1000,4391=>1000,4392=>1000,4393=>1000,4394=>1000,4395=>1000, - 4396=>1000,4397=>1000,4398=>1000,4399=>1000,4400=>1000,4401=>1000,4402=>1000,4403=>1000,4404=>1000,4405=>1000,4406=>1000,4407=>1000,4408=>1000,4409=>1000,4410=>1000,4411=>1000, - 4412=>1000,4413=>1000,4414=>1000,4415=>1000,4416=>1000,4417=>1000,4418=>1000,4419=>1000,4420=>1000,4421=>1000,4422=>1000,4423=>1000,4424=>1000,4425=>1000,4426=>1000,4427=>1000, - 4428=>1000,4429=>1000,4430=>1000,4431=>1000,4432=>1000,4433=>1000,4434=>1000,4435=>1000,4436=>1000,4437=>1000,4438=>1000,4439=>1000,4440=>1000,4441=>1000,4447=>1000,4448=>1000, - 4449=>1000,4450=>1000,4451=>1000,4452=>1000,4453=>1000,4454=>1000,4455=>1000,4456=>1000,4457=>1000,4458=>1000,4459=>1000,4460=>1000,4461=>1000,4462=>1000,4463=>1000,4464=>1000, - 4465=>1000,4466=>1000,4467=>1000,4468=>1000,4469=>1000,4470=>1000,4471=>1000,4472=>1000,4473=>1000,4474=>1000,4475=>1000,4476=>1000,4477=>1000,4478=>1000,4479=>1000,4480=>1000, - 4481=>1000,4482=>1000,4483=>1000,4484=>1000,4485=>1000,4486=>1000,4487=>1000,4488=>1000,4489=>1000,4490=>1000,4491=>1000,4492=>1000,4493=>1000,4494=>1000,4495=>1000,4496=>1000, - 4497=>1000,4498=>1000,4499=>1000,4500=>1000,4501=>1000,4502=>1000,4503=>1000,4504=>1000,4505=>1000,4506=>1000,4507=>1000,4508=>1000,4509=>1000,4510=>1000,4511=>1000,4512=>1000, - 4513=>1000,4514=>1000,4520=>1000,4521=>1000,4522=>1000,4523=>1000,4524=>1000,4525=>1000,4526=>1000,4527=>1000,4528=>1000,4529=>1000,4530=>1000,4531=>1000,4532=>1000,4533=>1000, - 4534=>1000,4535=>1000,4536=>1000,4537=>1000,4538=>1000,4539=>1000,4540=>1000,4541=>1000,4542=>1000,4543=>1000,4544=>1000,4545=>1000,4546=>1000,4547=>1000,4548=>1000,4549=>1000, - 4550=>1000,4551=>1000,4552=>1000,4553=>1000,4554=>1000,4555=>1000,4556=>1000,4557=>1000,4558=>1000,4559=>1000,4560=>1000,4561=>1000,4562=>1000,4563=>1000,4564=>1000,4565=>1000, - 4566=>1000,4567=>1000,4568=>1000,4569=>1000,4570=>1000,4571=>1000,4572=>1000,4573=>1000,4574=>1000,4575=>1000,4576=>1000,4577=>1000,4578=>1000,4579=>1000,4580=>1000,4581=>1000, - 4582=>1000,4583=>1000,4584=>1000,4585=>1000,4586=>1000,4587=>1000,4588=>1000,4589=>1000,4590=>1000,4591=>1000,4592=>1000,4593=>1000,4594=>1000,4595=>1000,4596=>1000,4597=>1000, - 4598=>1000,4599=>1000,4600=>1000,4601=>1000,7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722,7691=>556, - 7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556, - 7708=>667,7709=>556,7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722,7721=>556,7722=>722,7723=>556, - 7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, - 7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556, - 7756=>778,7757=>556,7758=>778,7759=>556,7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722,7771=>333, - 7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278, - 7788=>611,7789=>278,7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556, - 7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, - 7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556,7831=>278,7832=>722,7833=>500,7834=>556,7835=>278, - 7840=>667,7841=>556,7842=>667,7843=>556,7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667,7855=>556, - 7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556, - 7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778,7885=>556,7886=>778,7887=>556, - 7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778,7895=>556,7896=>778,7897=>556,7898=>776,7899=>556,7900=>776,7901=>556,7902=>776,7903=>556, - 7904=>776,7905=>556,7906=>776,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>620,7914=>776,7915=>620,7916=>776,7917=>620,7918=>776,7919=>620, - 7920=>776,7921=>620,7922=>667,7923=>500,7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>576,7937=>576,7938=>576,7939=>576,7940=>576,7941=>576, - 7942=>576,7943=>576,7944=>667,7945=>667,7946=>680,7947=>680,7948=>680,7949=>680,7950=>718,7951=>718,7952=>434,7953=>434,7954=>434,7955=>434,7956=>434,7957=>434, - 7960=>692,7961=>692,7962=>823,7963=>823,7964=>823,7965=>823,7968=>556,7969=>556,7970=>556,7971=>556,7972=>556,7973=>556,7974=>556,7975=>556,7976=>747,7977=>747, - 7978=>878,7979=>878,7980=>878,7981=>878,7982=>923,7983=>923,7984=>222,7985=>222,7986=>222,7987=>222,7988=>222,7989=>222,7990=>222,7991=>222,7992=>303,7993=>303, - 7994=>434,7995=>434,7996=>434,7997=>434,7998=>479,7999=>479,8000=>556,8001=>556,8002=>556,8003=>556,8004=>556,8005=>556,8008=>778,8009=>778,8010=>894,8011=>894, - 8012=>894,8013=>894,8016=>551,8017=>551,8018=>551,8019=>551,8020=>551,8021=>551,8022=>551,8023=>551,8025=>777,8027=>893,8029=>885,8031=>940,8032=>766,8033=>766, - 8034=>766,8035=>766,8036=>766,8037=>766,8038=>766,8039=>766,8040=>758,8041=>758,8042=>874,8043=>874,8044=>868,8045=>867,8046=>911,8047=>911,8048=>576,8049=>576, - 8050=>434,8051=>434,8052=>556,8053=>556,8054=>222,8055=>222,8056=>556,8057=>556,8058=>551,8059=>551,8060=>766,8061=>766,8064=>576,8065=>576,8066=>576,8067=>576, - 8068=>576,8069=>576,8070=>576,8071=>576,8072=>667,8073=>667,8074=>680,8075=>680,8076=>680,8077=>680,8078=>718,8079=>718,8080=>556,8081=>556,8082=>556,8083=>556, - 8084=>556,8085=>556,8086=>556,8087=>556,8088=>747,8089=>747,8090=>878,8091=>878,8092=>878,8093=>878,8094=>923,8095=>923,8096=>766,8097=>766,8098=>766,8099=>766, - 8100=>766,8101=>766,8102=>766,8103=>766,8104=>758,8105=>758,8106=>874,8107=>874,8108=>868,8109=>867,8110=>911,8111=>911,8112=>576,8113=>576,8114=>576,8115=>576, - 8116=>576,8118=>576,8119=>576,8120=>667,8121=>667,8122=>667,8123=>667,8124=>667,8125=>278,8126=>278,8127=>278,8128=>278,8129=>278,8130=>556,8131=>556,8132=>556, - 8134=>556,8135=>556,8136=>693,8137=>704,8138=>748,8139=>759,8140=>722,8141=>278,8142=>278,8143=>278,8144=>222,8145=>222,8146=>222,8147=>222,8150=>222,8151=>222, - 8152=>278,8153=>278,8154=>304,8155=>304,8157=>278,8158=>278,8159=>278,8160=>551,8161=>551,8162=>551,8163=>551,8164=>571,8165=>571,8166=>551,8167=>551,8168=>667, - 8169=>667,8170=>742,8171=>746,8172=>693,8173=>278,8174=>278,8175=>278,8178=>766,8179=>766,8180=>766,8182=>766,8183=>766,8184=>778,8185=>778,8186=>758,8187=>758, - 8188=>758,8189=>278,8190=>278,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>100,8202=>50,8203=>0,8204=>0, - 8205=>0,8208=>333,8209=>333,8210=>556,8213=>564,8214=>428,8215=>500,8219=>222,8223=>333,8227=>350,8228=>278,8229=>556,8231=>278,8232=>0,8233=>0,8241=>1330, - 8242=>222,8243=>372,8244=>522,8245=>206,8246=>356,8247=>506,8248=>312,8251=>1000,8252=>471,8253=>556,8254=>500,8255=>945,8256=>945,8257=>312,8258=>820,8259=>333, - 8260=>167,8261=>278,8262=>278,8304=>333,8308=>333,8309=>333,8310=>333,8311=>333,8312=>333,8313=>333,8314=>333,8315=>333,8316=>333,8317=>210,8318=>210,8319=>333, - 8320=>333,8321=>333,8322=>333,8323=>333,8324=>333,8325=>333,8326=>333,8327=>333,8328=>333,8329=>333,8330=>333,8331=>333,8332=>333,8333=>210,8334=>210,8352=>556, - 8353=>556,8354=>556,8355=>556,8356=>556,8357=>833,8358=>556,8359=>556,8360=>1024,8361=>940,8362=>784,8363=>556,8400=>600,8401=>600,8402=>600,8403=>600,8404=>700, - 8405=>700,8406=>600,8407=>600,8408=>600,8409=>600,8410=>600,8411=>600,8412=>600,8413=>900,8414=>900,8415=>900,8416=>900,8417=>700,8448=>889,8449=>889,8450=>667, - 8451=>1022,8452=>611,8453=>889,8454=>889,8455=>501,8456=>667,8457=>921,8458=>510,8459=>906,8460=>988,8461=>722,8462=>500,8463=>500,8464=>688,8465=>553,8466=>708, - 8467=>291,8468=>778,8469=>722,8470=>1073,8471=>737,8472=>740,8473=>556,8474=>722,8475=>927,8476=>795,8477=>667,8478=>667,8479=>667,8480=>1000,8481=>1174,8483=>722, - 8484=>611,8485=>542,8486=>768,8487=>768,8488=>698,8489=>321,8490=>667,8491=>667,8492=>927,8493=>646,8494=>556,8495=>385,8496=>615,8497=>688,8498=>611,8499=>1115, - 8500=>406,8501=>688,8502=>688,8503=>344,8504=>688,8531=>834,8532=>834,8533=>834,8534=>834,8535=>834,8536=>834,8537=>834,8538=>834,8539=>834,8540=>834,8541=>834, - 8542=>834,8543=>834,8544=>278,8545=>555,8546=>832,8547=>933,8548=>667,8549=>934,8550=>1031,8551=>1268,8552=>944,8553=>667,8554=>944,8555=>1035,8556=>556,8557=>722, - 8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>700,8564=>500,8565=>700,8566=>922,8567=>1144,8568=>712,8569=>500,8570=>712,8571=>934,8572=>222,8573=>500, - 8574=>556,8575=>833,8576=>983,8577=>722,8578=>983,8592=>713,8593=>713,8594=>713,8595=>713,8596=>713,8597=>713,8598=>713,8599=>713,8600=>713,8601=>713,8602=>713, - 8603=>713,8604=>713,8605=>713,8606=>713,8607=>713,8608=>713,8609=>713,8610=>713,8611=>713,8612=>713,8613=>713,8614=>713,8615=>713,8616=>713,8617=>713,8618=>713, - 8619=>713,8620=>713,8621=>813,8622=>813,8623=>713,8624=>713,8625=>713,8626=>713,8627=>713,8628=>713,8629=>713,8630=>713,8631=>713,8632=>713,8633=>713,8634=>800, - 8635=>800,8636=>713,8637=>713,8638=>713,8639=>713,8640=>713,8641=>713,8642=>713,8643=>713,8644=>713,8645=>713,8646=>713,8647=>713,8648=>713,8649=>713,8650=>713, - 8651=>713,8652=>713,8653=>713,8654=>950,8655=>713,8656=>713,8657=>713,8658=>713,8659=>713,8660=>863,8661=>713,8662=>713,8663=>713,8664=>713,8665=>713,8666=>713, - 8667=>713,8668=>813,8669=>813,8670=>713,8671=>713,8672=>713,8673=>713,8674=>713,8675=>713,8676=>713,8677=>713,8678=>713,8679=>713,8680=>713,8681=>713,8682=>713, - 8704=>600,8705=>600,8706=>494,8707=>600,8708=>600,8709=>800,8710=>612,8711=>612,8712=>549,8713=>549,8714=>549,8715=>549,8716=>549,8717=>549,8718=>549,8719=>823, - 8720=>823,8721=>713,8722=>584,8723=>584,8724=>584,8725=>167,8726=>278,8727=>389,8728=>400,8729=>400,8730=>600,8731=>600,8732=>600,8733=>549,8734=>549,8735=>584, - 8736=>584,8737=>584,8738=>584,8739=>260,8740=>444,8741=>418,8742=>602,8743=>561,8744=>561,8745=>561,8746=>561,8747=>506,8748=>806,8749=>1106,8750=>506,8751=>806, - 8752=>1106,8753=>506,8754=>506,8755=>506,8756=>561,8757=>561,8758=>422,8759=>561,8760=>584,8761=>584,8762=>584,8763=>584,8764=>584,8765=>584,8766=>584,8767=>584, - 8768=>422,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584,8775=>584,8776=>584,8777=>584,8778=>584,8779=>584,8780=>584,8781=>584,8782=>584,8783=>584, - 8784=>584,8785=>584,8786=>584,8787=>584,8788=>737,8789=>737,8790=>584,8791=>584,8792=>584,8793=>584,8794=>584,8795=>584,8796=>584,8797=>584,8798=>584,8799=>584, - 8800=>584,8801=>584,8802=>584,8803=>584,8804=>584,8805=>584,8806=>584,8807=>584,8808=>584,8809=>584,8810=>969,8811=>969,8812=>584,8813=>584,8814=>584,8815=>584, - 8816=>584,8817=>584,8818=>584,8819=>584,8820=>584,8821=>584,8822=>584,8823=>584,8824=>584,8825=>584,8826=>584,8827=>584,8828=>584,8829=>584,8830=>584,8831=>584, - 8832=>584,8833=>584,8834=>678,8835=>678,8836=>678,8837=>678,8838=>678,8839=>678,8840=>678,8841=>678,8842=>678,8843=>678,8844=>561,8845=>561,8846=>561,8847=>678, - 8848=>678,8849=>673,8850=>673,8851=>561,8852=>561,8853=>800,8854=>800,8855=>800,8856=>800,8857=>800,8858=>800,8859=>800,8860=>800,8861=>800,8862=>800,8863=>800, - 8864=>800,8865=>800,8866=>549,8867=>549,8868=>549,8869=>549,8870=>399,8871=>399,8872=>549,8873=>549,8874=>549,8875=>672,8876=>549,8877=>549,8878=>549,8879=>672, - 8880=>549,8881=>549,8882=>549,8883=>549,8884=>549,8885=>549,8886=>713,8887=>713,8888=>713,8889=>549,8890=>549,8891=>584,8892=>584,8893=>584,8894=>584,8895=>584, - 8896=>561,8897=>561,8898=>561,8899=>561,8900=>549,8901=>250,8902=>549,8903=>649,8904=>630,8905=>630,8906=>630,8907=>630,8908=>630,8909=>584,8910=>561,8911=>561, - 8912=>668,8913=>668,8914=>668,8915=>668,8916=>561,8917=>602,8918=>584,8919=>584,8920=>1354,8921=>1354,8922=>584,8923=>584,8924=>584,8925=>584,8926=>584,8927=>584, - 8928=>584,8929=>584,8930=>673,8931=>673,8932=>673,8933=>673,8934=>584,8935=>584,8936=>584,8937=>584,8938=>584,8939=>584,8940=>584,8941=>584,8942=>278,8943=>1000, - 8944=>1000,8945=>1000,8960=>549,8962=>549,8963=>549,8964=>549,8965=>549,8966=>549,8967=>549,8968=>449,8969=>449,8970=>449,8971=>449,8972=>549,8973=>549,8974=>549, - 8975=>549,8976=>549,8977=>549,8978=>800,8979=>800,8980=>549,8981=>549,8982=>549,8983=>650,8984=>780,8985=>549,8986=>549,8987=>549,8988=>549,8989=>549,8990=>549, - 8991=>549,8992=>506,8993=>506,8994=>713,8995=>713,8996=>1000,8997=>1000,8998=>1000,8999=>1000,9000=>1000,9001=>329,9002=>329,9003=>1000,9004=>549,9005=>549,9006=>549, - 9007=>549,9008=>549,9009=>549,9010=>549,9011=>549,9012=>549,9013=>549,9014=>600,9015=>600,9016=>600,9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600, - 9023=>600,9024=>600,9025=>600,9026=>600,9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600,9037=>600,9038=>600, - 9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600,9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600, - 9055=>600,9056=>600,9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600,9067=>600,9068=>600,9069=>600,9070=>600, - 9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600,9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9109=>600,9216=>600,9217=>600,9218=>600, - 9219=>600,9220=>600,9221=>600,9222=>600,9223=>600,9224=>600,9225=>600,9226=>600,9227=>600,9228=>600,9229=>600,9230=>600,9231=>600,9232=>600,9233=>600,9234=>600, - 9235=>600,9236=>600,9237=>600,9238=>600,9239=>600,9240=>600,9241=>600,9242=>600,9243=>600,9244=>600,9245=>600,9246=>600,9247=>600,9248=>600,9249=>600,9250=>600, - 9251=>600,9252=>600,9280=>604,9281=>604,9282=>604,9283=>604,9284=>604,9285=>604,9286=>750,9287=>750,9288=>750,9289=>750,9290=>604,9312=>1000,9313=>1000,9314=>1000, - 9315=>1000,9316=>1000,9317=>1000,9318=>1000,9319=>1000,9320=>1000,9321=>1000,9322=>1000,9323=>1000,9324=>1000,9325=>1000,9326=>1000,9327=>1000,9328=>1000,9329=>1000,9330=>1000, - 9331=>1000,9332=>1000,9333=>1000,9334=>1000,9335=>1000,9336=>1000,9337=>1000,9338=>1000,9339=>1000,9340=>1000,9341=>1000,9342=>1000,9343=>1000,9344=>1000,9345=>1000,9346=>1000, - 9347=>1000,9348=>1000,9349=>1000,9350=>1000,9351=>1000,9352=>1000,9353=>1000,9354=>1000,9355=>1000,9356=>1000,9357=>1000,9358=>1000,9359=>1000,9360=>1000,9361=>1000,9362=>1000, - 9363=>1000,9364=>1000,9365=>1000,9366=>1000,9367=>1000,9368=>1000,9369=>1000,9370=>1000,9371=>1000,9372=>1000,9373=>1000,9374=>1000,9375=>1000,9376=>1000,9377=>1000,9378=>1000, - 9379=>1000,9380=>1000,9381=>1000,9382=>1000,9383=>1000,9384=>1000,9385=>1000,9386=>1000,9387=>1000,9388=>1000,9389=>1000,9390=>1000,9391=>1000,9392=>1000,9393=>1000,9394=>1000, - 9395=>1000,9396=>1000,9397=>1000,9398=>1000,9399=>1000,9400=>1000,9401=>1000,9402=>1000,9403=>1000,9404=>1000,9405=>1000,9406=>1000,9407=>1000,9408=>1000,9409=>1000,9410=>1000, - 9411=>1000,9412=>1000,9413=>1000,9414=>1000,9415=>1000,9416=>1000,9417=>1000,9418=>1000,9419=>1000,9420=>1000,9421=>1000,9422=>1000,9423=>1000,9424=>1000,9425=>1000,9426=>1000, - 9427=>1000,9428=>1000,9429=>1000,9430=>1000,9431=>1000,9432=>1000,9433=>1000,9434=>1000,9435=>1000,9436=>1000,9437=>1000,9438=>1000,9439=>1000,9440=>1000,9441=>1000,9442=>1000, - 9443=>1000,9444=>1000,9445=>1000,9446=>1000,9447=>1000,9448=>1000,9449=>1000,9450=>1000,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600, - 9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600, - 9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600, - 9512=>600,9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600,9527=>600, - 9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600, - 9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600, - 9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600, - 9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600, - 9592=>600,9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600,9607=>600, - 9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600, - 9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600, - 9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600, - 9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600,9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600, - 9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600,9693=>600,9694=>600,9695=>600,9696=>600,9697=>600, - 9698=>600,9699=>600,9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9728=>750,9729=>1000, - 9730=>750,9731=>750,9732=>1000,9733=>816,9734=>823,9735=>500,9736=>500,9737=>800,9738=>800,9739=>800,9740=>800,9741=>800,9742=>719,9743=>719,9744=>734,9745=>734, - 9746=>734,9747=>762,9754=>960,9755=>960,9756=>939,9757=>939,9758=>939,9759=>939,9760=>750,9761=>600,9762=>750,9763=>750,9764=>580,9765=>460,9766=>444,9767=>650, - 9768=>444,9769=>768,9770=>800,9771=>850,9772=>675,9773=>800,9774=>750,9775=>750,9776=>900,9777=>900,9778=>900,9779=>900,9780=>900,9781=>900,9782=>900,9783=>900, - 9784=>750,9785=>750,9786=>750,9787=>750,9788=>750,9789=>750,9790=>750,9791=>740,9792=>740,9793=>740,9794=>740,9795=>653,9796=>490,9797=>632,9798=>780,9799=>560, - 9800=>838,9801=>780,9802=>734,9803=>887,9804=>780,9805=>1080,9806=>896,9807=>1080,9808=>804,9809=>868,9810=>922,9811=>696,9812=>1000,9813=>1000,9814=>1000,9815=>1000, - 9816=>1000,9817=>1000,9818=>1000,9819=>1000,9820=>1000,9821=>1000,9822=>1000,9823=>1000,9824=>722,9825=>734,9826=>674,9827=>804,9828=>722,9829=>734,9830=>674,9831=>804, - 9832=>860,9833=>423,9834=>592,9835=>750,9836=>750,9837=>439,9838=>439,9839=>439,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791,9993=>690, - 9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846,10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759, - 10012=>754,10013=>494,10014=>552,10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823,10026=>789,10027=>841,10028=>823, - 10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749,10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708, - 10045=>682,10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786,10056=>787,10057=>713,10058=>791,10059=>785,10061=>873, - 10063=>762,10064=>762,10065=>759,10066=>759,10070=>784,10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544,10084=>910, - 10085=>667,10086=>760,10087=>760,10102=>788,10103=>788,10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788,10114=>788, - 10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788,10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788, - 10131=>788,10132=>894,10136=>748,10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924,10147=>924,10148=>917,10149=>930, - 10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867,10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771, - 10167=>888,10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,12288=>1000,12289=>1000,12290=>1000,12291=>1000,12292=>1000,12293=>1000,12294=>1000,12295=>1000, - 12296=>1000,12297=>1000,12298=>1000,12299=>1000,12300=>1000,12301=>1000,12302=>1000,12303=>1000,12304=>1000,12305=>1000,12306=>1000,12307=>1000,12308=>1000,12309=>1000,12310=>1000,12311=>1000, - 12312=>1000,12313=>1000,12314=>1000,12315=>1000,12316=>1000,12317=>1000,12318=>1000,12319=>1000,12320=>1000,12321=>1000,12322=>1000,12323=>1000,12324=>1000,12325=>1000,12326=>1000,12327=>1000, - 12328=>1000,12329=>1000,12330=>1000,12331=>1000,12332=>1000,12333=>1000,12334=>1000,12335=>1000,12336=>1000,12337=>1000,12338=>1000,12339=>1000,12340=>1000,12341=>1000,12342=>1000,12343=>1000, - 12351=>1000,12353=>1000,12354=>1000,12355=>1000,12356=>1000,12357=>1000,12358=>1000,12359=>1000,12360=>1000,12361=>1000,12362=>1000,12363=>1000,12364=>1000,12365=>1000,12366=>1000,12367=>1000, - 12368=>1000,12369=>1000,12370=>1000,12371=>1000,12372=>1000,12373=>1000,12374=>1000,12375=>1000,12376=>1000,12377=>1000,12378=>1000,12379=>1000,12380=>1000,12381=>1000,12382=>1000,12383=>1000, - 12384=>1000,12385=>1000,12386=>1000,12387=>1000,12388=>1000,12389=>1000,12390=>1000,12391=>1000,12392=>1000,12393=>1000,12394=>1000,12395=>1000,12396=>1000,12397=>1000,12398=>1000,12399=>1000, - 12400=>1000,12401=>1000,12402=>1000,12403=>1000,12404=>1000,12405=>1000,12406=>1000,12407=>1000,12408=>1000,12409=>1000,12410=>1000,12411=>1000,12412=>1000,12413=>1000,12414=>1000,12415=>1000, - 12416=>1000,12417=>1000,12418=>1000,12419=>1000,12420=>1000,12421=>1000,12422=>1000,12423=>1000,12424=>1000,12425=>1000,12426=>1000,12427=>1000,12428=>1000,12429=>1000,12430=>1000,12431=>1000, - 12432=>1000,12433=>1000,12434=>1000,12435=>1000,12436=>1000,12441=>1000,12442=>1000,12443=>1000,12444=>1000,12445=>1000,12446=>1000,12449=>1000,12450=>1000,12451=>1000,12452=>1000,12453=>1000, - 12454=>1000,12455=>1000,12456=>1000,12457=>1000,12458=>1000,12459=>1000,12460=>1000,12461=>1000,12462=>1000,12463=>1000,12464=>1000,12465=>1000,12466=>1000,12467=>1000,12468=>1000,12469=>1000, - 12470=>1000,12471=>1000,12472=>1000,12473=>1000,12474=>1000,12475=>1000,12476=>1000,12477=>1000,12478=>1000,12479=>1000,12480=>1000,12481=>1000,12482=>1000,12483=>1000,12484=>1000,12485=>1000, - 12486=>1000,12487=>1000,12488=>1000,12489=>1000,12490=>1000,12491=>1000,12492=>1000,12493=>1000,12494=>1000,12495=>1000,12496=>1000,12497=>1000,12498=>1000,12499=>1000,12500=>1000,12501=>1000, - 12502=>1000,12503=>1000,12504=>1000,12505=>1000,12506=>1000,12507=>1000,12508=>1000,12509=>1000,12510=>1000,12511=>1000,12512=>1000,12513=>1000,12514=>1000,12515=>1000,12516=>1000,12517=>1000, - 12518=>1000,12519=>1000,12520=>1000,12521=>1000,12522=>1000,12523=>1000,12524=>1000,12525=>1000,12526=>1000,12527=>1000,12528=>1000,12529=>1000,12530=>1000,12531=>1000,12532=>1000,12533=>1000, - 12534=>1000,12535=>1000,12536=>1000,12537=>1000,12538=>1000,12539=>1000,12540=>1000,12541=>1000,12542=>1000,12549=>1000,12550=>1000,12551=>1000,12552=>1000,12553=>1000,12554=>1000,12555=>1000, - 12556=>1000,12557=>1000,12558=>1000,12559=>1000,12560=>1000,12561=>1000,12562=>1000,12563=>1000,12564=>1000,12565=>1000,12566=>1000,12567=>1000,12568=>1000,12569=>1000,12570=>1000,12571=>1000, - 12572=>1000,12573=>1000,12574=>1000,12575=>1000,12576=>1000,12577=>1000,12578=>1000,12579=>1000,12580=>1000,12581=>1000,12582=>1000,12583=>1000,12584=>1000,12585=>1000,12586=>1000,12587=>1000, - 12588=>1000,12593=>1000,12594=>1000,12595=>1000,12596=>1000,12597=>1000,12598=>1000,12599=>1000,12600=>1000,12601=>1000,12602=>1000,12603=>1000,12604=>1000,12605=>1000,12606=>1000,12607=>1000, - 12608=>1000,12609=>1000,12610=>1000,12611=>1000,12612=>1000,12613=>1000,12614=>1000,12615=>1000,12616=>1000,12617=>1000,12618=>1000,12619=>1000,12620=>1000,12621=>1000,12622=>1000,12623=>1000, - 12624=>1000,12625=>1000,12626=>1000,12627=>1000,12628=>1000,12629=>1000,12630=>1000,12631=>1000,12632=>1000,12633=>1000,12634=>1000,12635=>1000,12636=>1000,12637=>1000,12638=>1000,12639=>1000, - 12640=>1000,12641=>1000,12642=>1000,12643=>1000,12644=>1000,12645=>1000,12646=>1000,12647=>1000,12648=>1000,12649=>1000,12650=>1000,12651=>1000,12652=>1000,12653=>1000,12654=>1000,12655=>1000, - 12656=>1000,12657=>1000,12658=>1000,12659=>1000,12660=>1000,12661=>1000,12662=>1000,12663=>1000,12664=>1000,12665=>1000,12666=>1000,12667=>1000,12668=>1000,12669=>1000,12670=>1000,12671=>1000, - 12672=>1000,12673=>1000,12674=>1000,12675=>1000,12676=>1000,12677=>1000,12678=>1000,12679=>1000,12680=>1000,12681=>1000,12682=>1000,12683=>1000,12684=>1000,12685=>1000,12686=>1000,12688=>1000, - 12689=>1000,12690=>1000,12691=>1000,12692=>1000,12693=>1000,12694=>1000,12695=>1000,12696=>1000,12697=>1000,12698=>1000,12699=>1000,12700=>1000,12701=>1000,12702=>1000,12703=>1000,12800=>1000, - 12801=>1000,12802=>1000,12803=>1000,12804=>1000,12805=>1000,12806=>1000,12807=>1000,12808=>1000,12809=>1000,12810=>1000,12811=>1000,12812=>1000,12813=>1000,12814=>1000,12815=>1000,12816=>1000, - 12817=>1000,12818=>1000,12819=>1000,12820=>1000,12821=>1000,12822=>1000,12823=>1000,12824=>1000,12825=>1000,12826=>1000,12827=>1000,12828=>1000,12832=>1000,12833=>1000,12834=>1000,12835=>1000, - 12836=>1000,12837=>1000,12838=>1000,12839=>1000,12840=>1000,12841=>1000,12842=>1000,12843=>1000,12844=>1000,12845=>1000,12846=>1000,12847=>1000,12848=>1000,12849=>1000,12850=>1000,12851=>1000, - 12852=>1000,12853=>1000,12854=>1000,12855=>1000,12856=>1000,12857=>1000,12858=>1000,12859=>1000,12860=>1000,12861=>1000,12862=>1000,12863=>1000,12864=>1000,12865=>1000,12866=>1000,12867=>1000, - 12896=>1000,12897=>1000,12898=>1000,12899=>1000,12900=>1000,12901=>1000,12902=>1000,12903=>1000,12904=>1000,12905=>1000,12906=>1000,12907=>1000,12908=>1000,12909=>1000,12910=>1000,12911=>1000, - 12912=>1000,12913=>1000,12914=>1000,12915=>1000,12916=>1000,12917=>1000,12918=>1000,12919=>1000,12920=>1000,12921=>1000,12922=>1000,12923=>1000,12927=>1000,12928=>1000,12929=>1000,12930=>1000, - 12931=>1000,12932=>1000,12933=>1000,12934=>1000,12935=>1000,12936=>1000,12937=>1000,12938=>1000,12939=>1000,12940=>1000,12941=>1000,12942=>1000,12943=>1000,12944=>1000,12945=>1000,12946=>1000, - 12947=>1000,12948=>1000,12949=>1000,12950=>1000,12951=>1000,12952=>1000,12953=>1000,12954=>1000,12955=>1000,12956=>1000,12957=>1000,12958=>1000,12959=>1000,12960=>1000,12961=>1000,12962=>1000, - 12963=>1000,12964=>1000,12965=>1000,12966=>1000,12967=>1000,12968=>1000,12969=>1000,12970=>1000,12971=>1000,12972=>1000,12973=>1000,12974=>1000,12975=>1000,12976=>1000,12992=>1000,12993=>1000, - 12994=>1000,12995=>1000,12996=>1000,12997=>1000,12998=>1000,12999=>1000,13000=>1000,13001=>1000,13002=>1000,13003=>1000,13008=>1000,13009=>1000,13010=>1000,13011=>1000,13012=>1000,13013=>1000, - 13014=>1000,13015=>1000,13016=>1000,13017=>1000,13018=>1000,13019=>1000,13020=>1000,13021=>1000,13022=>1000,13023=>1000,13024=>1000,13025=>1000,13026=>1000,13027=>1000,13028=>1000,13029=>1000, - 13030=>1000,13031=>1000,13032=>1000,13033=>1000,13034=>1000,13035=>1000,13036=>1000,13037=>1000,13038=>1000,13039=>1000,13040=>1000,13041=>1000,13042=>1000,13043=>1000,13044=>1000,13045=>1000, - 13046=>1000,13047=>1000,13048=>1000,13049=>1000,13050=>1000,13051=>1000,13052=>1000,13053=>1000,13054=>1000,13056=>1000,13057=>1000,13058=>1000,13059=>1000,13060=>1000,13061=>1000,13062=>1000, - 13063=>1000,13064=>1000,13065=>1000,13066=>1000,13067=>1000,13068=>1000,13069=>1000,13070=>1000,13071=>1000,13072=>1000,13073=>1000,13074=>1000,13075=>1000,13076=>1000,13077=>1000,13078=>1000, - 13079=>1000,13080=>1000,13081=>1000,13082=>1000,13083=>1000,13084=>1000,13085=>1000,13086=>1000,13087=>1000,13088=>1000,13089=>1000,13090=>1000,13091=>1000,13092=>1000,13093=>1000,13094=>1000, - 13095=>1000,13096=>1000,13097=>1000,13098=>1000,13099=>1000,13100=>1000,13101=>1000,13102=>1000,13103=>1000,13104=>1000,13105=>1000,13106=>1000,13107=>1000,13108=>1000,13109=>1000,13110=>1000, - 13111=>1000,13112=>1000,13113=>1000,13114=>1000,13115=>1000,13116=>1000,13117=>1000,13118=>1000,13119=>1000,13120=>1000,13121=>1000,13122=>1000,13123=>1000,13124=>1000,13125=>1000,13126=>1000, - 13127=>1000,13128=>1000,13129=>1000,13130=>1000,13131=>1000,13132=>1000,13133=>1000,13134=>1000,13135=>1000,13136=>1000,13137=>1000,13138=>1000,13139=>1000,13140=>1000,13141=>1000,13142=>1000, - 13143=>1000,13144=>1000,13145=>1000,13146=>1000,13147=>1000,13148=>1000,13149=>1000,13150=>1000,13151=>1000,13152=>1000,13153=>1000,13154=>1000,13155=>1000,13156=>1000,13157=>1000,13158=>1000, - 13159=>1000,13160=>1000,13161=>1000,13162=>1000,13163=>1000,13164=>1000,13165=>1000,13166=>1000,13167=>1000,13168=>1000,13169=>1000,13170=>1000,13171=>1000,13172=>1000,13173=>1000,13174=>1000, - 13179=>1000,13180=>1000,13181=>1000,13182=>1000,13183=>1000,13184=>1000,13185=>1000,13186=>1000,13187=>1000,13188=>1000,13189=>1000,13190=>1000,13191=>1000,13192=>1000,13193=>1000,13194=>1000, - 13195=>1000,13196=>1000,13197=>1000,13198=>1000,13199=>1000,13200=>1000,13201=>1000,13202=>1000,13203=>1000,13204=>1000,13205=>1000,13206=>1000,13207=>1000,13208=>1000,13209=>1000,13210=>1000, - 13211=>1000,13212=>1000,13213=>1000,13214=>1000,13215=>1000,13216=>1000,13217=>1000,13218=>1000,13219=>1000,13220=>1000,13221=>1000,13222=>1000,13223=>1000,13224=>1000,13225=>1000,13226=>1000, - 13227=>1000,13228=>1000,13229=>1000,13230=>1000,13231=>1000,13232=>1000,13233=>1000,13234=>1000,13235=>1000,13236=>1000,13237=>1000,13238=>1000,13239=>1000,13240=>1000,13241=>1000,13242=>1000, - 13243=>1000,13244=>1000,13245=>1000,13246=>1000,13247=>1000,13248=>1000,13249=>1000,13250=>1000,13251=>1000,13252=>1000,13253=>1000,13254=>1000,13255=>1000,13256=>1000,13257=>1000,13258=>1000, - 13259=>1000,13260=>1000,13261=>1000,13262=>1000,13263=>1000,13264=>1000,13265=>1000,13266=>1000,13267=>1000,13268=>1000,13269=>1000,13270=>1000,13271=>1000,13272=>1000,13273=>1000,13274=>1000, - 13275=>1000,13276=>1000,13277=>1000,13280=>1000,13281=>1000,13282=>1000,13283=>1000,13284=>1000,13285=>1000,13286=>1000,13287=>1000,13288=>1000,13289=>1000,13290=>1000,13291=>1000,13292=>1000, - 13293=>1000,13294=>1000,13295=>1000,13296=>1000,13297=>1000,13298=>1000,13299=>1000,13300=>1000,13301=>1000,13302=>1000,13303=>1000,13304=>1000,13305=>1000,13306=>1000,13307=>1000,13308=>1000, - 13309=>1000,13310=>1000,59393=>316,59394=>507,59395=>507,59396=>484,59397=>484,59416=>0,59492=>480,59495=>480,59536=>458,59557=>466,59558=>480,59559=>903,61441=>500,61442=>500, - 63232=>541,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>849, - 63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>333,63261=>287,63744=>1000,63745=>1000,63746=>1000, - 63747=>1000,63748=>1000,63749=>1000,63750=>1000,63751=>1000,63752=>1000,63753=>1000,63754=>1000,63755=>1000,63756=>1000,63757=>1000,63758=>1000,63759=>1000,63760=>1000,63761=>1000,63762=>1000, - 63763=>1000,63764=>1000,63765=>1000,63766=>1000,63767=>1000,63768=>1000,63769=>1000,63770=>1000,63771=>1000,63772=>1000,63773=>1000,63774=>1000,63775=>1000,63776=>1000,63777=>1000,63778=>1000, - 63779=>1000,63780=>1000,63781=>1000,63782=>1000,63783=>1000,63784=>1000,63785=>1000,63786=>1000,63787=>1000,63788=>1000,63789=>1000,63790=>1000,63791=>1000,63792=>1000,63793=>1000,63794=>1000, - 63795=>1000,63796=>1000,63797=>1000,63798=>1000,63799=>1000,63800=>1000,63801=>1000,63802=>1000,63803=>1000,63804=>1000,63805=>1000,63806=>1000,63807=>1000,63808=>1000,63809=>1000,63810=>1000, - 63811=>1000,63812=>1000,63813=>1000,63814=>1000,63815=>1000,63816=>1000,63817=>1000,63818=>1000,63819=>1000,63820=>1000,63821=>1000,63822=>1000,63823=>1000,63824=>1000,63825=>1000,63826=>1000, - 63827=>1000,63828=>1000,63829=>1000,63830=>1000,63831=>1000,63832=>1000,63833=>1000,63834=>1000,63835=>1000,63836=>1000,63837=>1000,63838=>1000,63839=>1000,63840=>1000,63841=>1000,63842=>1000, - 63843=>1000,63844=>1000,63845=>1000,63846=>1000,63847=>1000,63848=>1000,63849=>1000,63850=>1000,63851=>1000,63852=>1000,63853=>1000,63854=>1000,63855=>1000,63856=>1000,63857=>1000,63858=>1000, - 63859=>1000,63860=>1000,63861=>1000,63862=>1000,63863=>1000,63864=>1000,63865=>1000,63866=>1000,63867=>1000,63868=>1000,63869=>1000,63870=>1000,63871=>1000,63872=>1000,63873=>1000,63874=>1000, - 63875=>1000,63876=>1000,63877=>1000,63878=>1000,63879=>1000,63880=>1000,63881=>1000,63882=>1000,63883=>1000,63884=>1000,63885=>1000,63886=>1000,63887=>1000,63888=>1000,63889=>1000,63890=>1000, - 63891=>1000,63892=>1000,63893=>1000,63894=>1000,63895=>1000,63896=>1000,63897=>1000,63898=>1000,63899=>1000,63900=>1000,63901=>1000,63902=>1000,63903=>1000,63904=>1000,63905=>1000,63906=>1000, - 63907=>1000,63908=>1000,63909=>1000,63910=>1000,63911=>1000,63912=>1000,63913=>1000,63914=>1000,63915=>1000,63916=>1000,63917=>1000,63918=>1000,63919=>1000,63920=>1000,63921=>1000,63922=>1000, - 63923=>1000,63924=>1000,63925=>1000,63926=>1000,63927=>1000,63928=>1000,63929=>1000,63930=>1000,63931=>1000,63932=>1000,63933=>1000,63934=>1000,63935=>1000,63936=>1000,63937=>1000,63938=>1000, - 63939=>1000,63940=>1000,63941=>1000,63942=>1000,63943=>1000,63944=>1000,63945=>1000,63946=>1000,63947=>1000,63948=>1000,63949=>1000,63950=>1000,63951=>1000,63952=>1000,63953=>1000,63954=>1000, - 63955=>1000,63956=>1000,63957=>1000,63958=>1000,63959=>1000,63960=>1000,63961=>1000,63962=>1000,63963=>1000,63964=>1000,63965=>1000,63966=>1000,63967=>1000,63968=>1000,63969=>1000,63970=>1000, - 63971=>1000,63972=>1000,63973=>1000,63974=>1000,63975=>1000,63976=>1000,63977=>1000,63978=>1000,63979=>1000,63980=>1000,63981=>1000,63982=>1000,63983=>1000,63984=>1000,63985=>1000,63986=>1000, - 63987=>1000,63988=>1000,63989=>1000,63990=>1000,63991=>1000,63992=>1000,63993=>1000,63994=>1000,63995=>1000,63996=>1000,63997=>1000,63998=>1000,63999=>1000,64000=>1000,64001=>1000,64002=>1000, - 64003=>1000,64004=>1000,64005=>1000,64006=>1000,64007=>1000,64008=>1000,64009=>1000,64010=>1000,64011=>1000,64012=>1000,64013=>1000,64014=>1000,64015=>1000,64016=>1000,64017=>1000,64018=>1000, - 64019=>1000,64020=>1000,64021=>1000,64022=>1000,64023=>1000,64024=>1000,64025=>1000,64026=>1000,64027=>1000,64028=>1000,64029=>1000,64030=>1000,64031=>1000,64032=>1000,64033=>1000,64034=>1000, - 64035=>1000,64036=>1000,64037=>1000,64038=>1000,64039=>1000,64040=>1000,64041=>1000,64042=>1000,64043=>1000,64044=>1000,64045=>1000,64256=>537,64257=>500,64258=>500,64259=>778,64260=>750, - 64261=>532,64262=>758,64275=>784,64276=>784,64277=>784,64278=>784,64279=>893,64286=>333,64287=>590,64288=>550,64289=>709,64290=>649,64291=>730,64292=>656,64293=>605,64294=>730, - 64295=>633,64296=>794,64297=>584,64298=>700,64299=>700,64300=>700,64301=>700,64302=>577,64303=>577,64304=>577,64305=>563,64306=>411,64307=>512,64308=>594,64309=>316,64310=>326, - 64312=>594,64313=>316,64314=>507,64315=>527,64316=>484,64318=>594,64320=>338,64321=>604,64323=>567,64324=>569,64326=>514,64327=>583,64328=>507,64329=>700,64330=>633,64331=>316, - 64332=>563,64333=>527,64334=>569,64335=>577,64336=>243,64337=>273,64338=>771,64339=>788,64340=>276,64341=>243,64342=>771,64343=>788,64344=>276,64345=>243,64346=>771,64347=>788, - 64348=>276,64349=>243,64350=>771,64351=>788,64352=>276,64353=>243,64354=>771,64355=>788,64356=>276,64357=>243,64358=>771,64359=>788,64360=>276,64361=>243,64362=>957,64363=>903, - 64364=>466,64365=>480,64366=>957,64367=>903,64368=>466,64369=>480,64370=>544,64371=>658,64372=>646,64373=>637,64374=>544,64375=>658,64376=>646,64377=>637,64378=>544,64379=>658, - 64380=>646,64381=>637,64382=>544,64383=>658,64384=>646,64385=>637,64386=>430,64387=>458,64388=>430,64389=>458,64390=>430,64391=>458,64392=>430,64393=>458,64394=>421,64395=>436, - 64396=>421,64397=>436,64398=>828,64399=>942,64400=>432,64401=>549,64402=>828,64403=>942,64404=>432,64405=>549,64406=>828,64407=>942,64408=>432,64409=>549,64410=>828,64411=>942, - 64412=>432,64413=>549,64414=>692,64415=>723,64416=>692,64417=>723,64418=>276,64419=>243,64420=>514,64421=>477,64422=>514,64423=>509,64424=>273,64425=>427,64426=>706,64427=>706, - 64428=>686,64429=>686,64430=>550,64431=>461,64432=>550,64433=>461,64467=>757,64468=>733,64469=>432,64470=>549,64471=>470,64472=>466,64473=>470,64474=>466,64475=>470,64476=>466, - 64477=>470,64478=>470,64479=>466,64480=>470,64481=>466,64482=>470,64483=>466,64484=>781,64485=>933,64486=>276,64487=>243,64488=>276,64489=>243,64490=>547,64491=>517,64492=>783, - 64493=>753,64494=>740,64495=>710,64496=>740,64497=>710,64498=>740,64499=>710,64500=>740,64501=>710,64502=>1207,64503=>1177,64504=>517,64505=>1067,64506=>1037,64507=>517,64508=>731, - 64509=>793,64510=>276,64511=>243,64512=>932,64513=>932,64514=>914,64515=>1067,64516=>1077,64517=>935,64518=>935,64519=>935,64520=>917,64521=>1070,64522=>1080,64523=>932,64524=>932, - 64525=>932,64526=>914,64527=>1067,64528=>1077,64529=>932,64530=>914,64531=>1067,64532=>1077,64533=>1305,64534=>1287,64535=>1305,64536=>1287,64537=>1305,64538=>1305,64539=>1287,64540=>1429, - 64541=>1429,64542=>1429,64543=>1411,64544=>1476,64545=>1458,64546=>1476,64547=>1476,64548=>1476,64549=>1458,64550=>1392,64551=>1374,64552=>1374,64553=>1245,64554=>1227,64555=>1245,64556=>1227, - 64557=>1125,64558=>1125,64559=>1125,64560=>1107,64561=>1260,64562=>1270,64563=>1125,64564=>1107,64565=>1260,64566=>1270,64567=>706,64568=>1091,64569=>1091,64570=>1091,64571=>1106,64572=>1073, - 64573=>1226,64574=>1236,64575=>932,64576=>932,64577=>932,64578=>914,64579=>1067,64580=>1077,64581=>1140,64582=>1140,64583=>1140,64584=>1122,64585=>1275,64586=>1285,64587=>932,64588=>932, - 64589=>932,64590=>914,64591=>1067,64592=>1077,64593=>1345,64594=>1327,64595=>1480,64596=>1490,64597=>932,64598=>932,64599=>932,64600=>914,64601=>1067,64602=>1077,64603=>430,64604=>421, - 64605=>731,64606=>296,64607=>300,64608=>300,64609=>300,64610=>300,64611=>300,64612=>680,64613=>680,64614=>884,64615=>967,64616=>1037,64617=>1047,64618=>680,64619=>680,64620=>884, - 64621=>967,64622=>1037,64623=>1047,64624=>680,64625=>680,64626=>884,64627=>967,64628=>1037,64629=>1047,64630=>680,64631=>680,64632=>884,64633=>967,64634=>1037,64635=>1047,64636=>1274, - 64637=>1284,64638=>1274,64639=>1284,64640=>821,64641=>1221,64642=>1188,64643=>1341,64644=>1351,64645=>884,64646=>1037,64647=>1047,64648=>806,64649=>1173,64650=>680,64651=>680,64652=>884, - 64653=>967,64654=>1037,64655=>1047,64656=>793,64657=>680,64658=>680,64659=>884,64660=>967,64661=>1037,64662=>1047,64663=>911,64664=>911,64665=>911,64666=>806,64667=>679,64668=>911, - 64669=>911,64670=>911,64671=>806,64672=>679,64673=>911,64674=>911,64675=>911,64676=>806,64677=>679,64678=>806,64679=>1284,64680=>1179,64681=>1284,64682=>1179,64683=>1284,64684=>1179, - 64685=>1408,64686=>1408,64687=>1408,64688=>1303,64689=>1455,64690=>1455,64691=>1350,64692=>1455,64693=>1455,64694=>1455,64695=>1350,64696=>1371,64697=>1266,64698=>1224,64699=>1119,64700=>1224, - 64701=>1119,64702=>1104,64703=>1104,64704=>1104,64705=>999,64706=>1104,64707=>999,64708=>1070,64709=>1070,64710=>1070,64711=>676,64712=>965,64713=>911,64714=>911,64715=>911,64716=>806, - 64717=>679,64718=>1119,64719=>1119,64720=>1119,64721=>1014,64722=>911,64723=>911,64724=>911,64725=>806,64726=>679,64727=>1324,64728=>1219,64729=>686,64730=>911,64731=>911,64732=>911, - 64733=>806,64734=>679,64735=>776,64736=>649,64737=>776,64738=>649,64739=>776,64740=>649,64741=>776,64742=>649,64743=>1303,64744=>1176,64745=>1303,64746=>1176,64747=>793,64748=>1082, - 64749=>776,64750=>776,64751=>649,64752=>776,64753=>649,64754=>306,64755=>302,64756=>298,64757=>1527,64758=>1537,64759=>1380,64760=>1390,64761=>1380,64762=>1390,64763=>1564,64764=>1574, - 64765=>1564,64766=>1574,64767=>1440,64768=>1450,64769=>1440,64770=>1450,64771=>1440,64772=>1450,64773=>1611,64774=>1621,64775=>1611,64776=>1621,64777=>1429,64778=>1429,64779=>1429,64780=>1411, - 64781=>1207,64782=>1207,64783=>1254,64784=>1254,64785=>1527,64786=>1537,64787=>1348,64788=>1358,64789=>1348,64790=>1358,64791=>1564,64792=>1574,64793=>1564,64794=>1574,64795=>1431,64796=>1441, - 64797=>1431,64798=>1441,64799=>1431,64800=>1441,64801=>1611,64802=>1621,64803=>1611,64804=>1621,64805=>1429,64806=>1429,64807=>1429,64808=>1411,64809=>1207,64810=>1207,64811=>1254,64812=>1254, - 64813=>1408,64814=>1408,64815=>1408,64816=>1303,64817=>1176,64818=>1176,64819=>1266,64820=>1408,64821=>1408,64822=>1408,64823=>1408,64824=>1408,64825=>1408,64826=>1266,64827=>1266,64828=>273, - 64829=>243,64830=>600,64831=>600,64848=>1444,64849=>1541,64850=>1549,64851=>1444,64852=>1444,64853=>1444,64854=>1444,64855=>1444,64856=>1830,64857=>1817,64858=>1975,64859=>1964,64860=>2046, - 64861=>2046,64862=>2202,64863=>1962,64864=>1941,64865=>1941,64866=>1944,64867=>1836,64868=>2114,64869=>2093,64870=>1991,64871=>2049,64872=>1941,64873=>2212,64874=>1962,64875=>1941,64876=>1944, - 64877=>1836,64878=>2249,64879=>2096,64880=>1988,64881=>1925,64882=>1904,64883=>1799,64884=>2070,64885=>1833,64886=>1729,64887=>1652,64888=>1881,64889=>1729,64890=>1892,64891=>1881,64892=>1759, - 64893=>1637,64894=>1670,64895=>1654,64896=>1522,64897=>1686,64898=>1675,64899=>1549,64900=>1541,64901=>1522,64902=>1444,64903=>1436,64904=>1444,64905=>1757,64906=>1652,64907=>1975,64908=>1757, - 64909=>1652,64910=>1757,64911=>1652,64914=>1757,64915=>1857,64916=>1752,64917=>1444,64918=>1675,64919=>1522,64920=>1444,64921=>1675,64922=>1581,64923=>1570,64924=>1417,64925=>1362,64926=>1686, - 64927=>1686,64928=>1675,64929=>1686,64930=>1675,64931=>1581,64932=>1570,64933=>1975,64934=>2069,64935=>1964,64936=>2202,64937=>2259,64938=>2212,64939=>2259,64940=>1686,64941=>1581,64942=>1686, - 64943=>1686,64944=>1581,64945=>1870,64946=>1817,64947=>1686,64948=>1637,64949=>1444,64950=>1892,64951=>1886,64952=>1549,64953=>1975,64954=>1444,64955=>1723,64956=>1522,64957=>1541,64958=>2080, - 64959=>2080,64960=>1975,64961=>1817,64962=>1686,64963=>1499,64964=>1757,64965=>1883,64966=>2212,64967=>1686,65008=>1523,65009=>1172,65010=>1159,65011=>1356,65012=>2111,65013=>2258,65014=>2130, - 65015=>1552,65016=>2046,65017=>1856,65018=>1930,65019=>1070,65056=>450,65057=>450,65058=>450,65059=>450,65072=>1000,65073=>1000,65074=>1000,65075=>1000,65076=>1000,65077=>1000,65078=>1000, - 65079=>1000,65080=>1000,65081=>1000,65082=>1000,65083=>1000,65084=>1000,65085=>1000,65086=>1000,65087=>1000,65088=>1000,65089=>1000,65090=>1000,65091=>1000,65092=>1000,65097=>1000,65098=>1000, - 65099=>1000,65100=>1000,65101=>1000,65102=>1000,65103=>1000,65104=>167,65105=>250,65106=>167,65108=>167,65109=>167,65110=>334,65111=>167,65112=>600,65113=>200,65114=>200,65115=>200, - 65116=>200,65117=>200,65118=>200,65119=>334,65120=>400,65121=>233,65122=>350,65123=>200,65124=>350,65125=>350,65126=>350,65128=>167,65129=>334,65130=>533,65131=>609,65136=>300, - 65137=>298,65138=>296,65140=>298,65142=>300,65143=>298,65144=>300,65145=>302,65146=>298,65147=>296,65148=>306,65149=>306,65150=>154,65151=>154,65152=>529,65153=>243,65154=>273, - 65155=>243,65156=>273,65157=>470,65158=>466,65159=>243,65160=>273,65161=>731,65162=>793,65163=>276,65164=>243,65165=>243,65166=>273,65167=>771,65168=>788,65169=>276,65170=>243, - 65171=>514,65172=>477,65173=>771,65174=>788,65175=>276,65176=>243,65177=>771,65178=>788,65179=>276,65180=>243,65181=>544,65182=>658,65183=>646,65184=>637,65185=>544,65186=>658, - 65187=>646,65188=>637,65189=>544,65190=>658,65191=>646,65192=>637,65193=>430,65194=>458,65195=>430,65196=>458,65197=>421,65198=>436,65199=>421,65200=>436,65201=>1194,65202=>1194, - 65203=>770,65204=>770,65205=>1194,65206=>1194,65207=>770,65208=>770,65209=>1291,65210=>1291,65211=>817,65212=>817,65213=>1291,65214=>1291,65215=>817,65216=>817,65217=>843,65218=>843, - 65219=>733,65220=>733,65221=>843,65222=>843,65223=>733,65224=>733,65225=>594,65226=>556,65227=>586,65228=>554,65229=>594,65230=>556,65231=>586,65232=>554,65233=>957,65234=>903, - 65235=>466,65236=>480,65237=>800,65238=>823,65239=>466,65240=>480,65241=>757,65242=>733,65243=>432,65244=>549,65245=>662,65246=>673,65247=>273,65248=>243,65249=>589,65250=>640, - 65251=>481,65252=>532,65253=>692,65254=>723,65255=>276,65256=>243,65257=>514,65258=>477,65259=>686,65260=>405,65261=>470,65262=>466,65263=>731,65264=>793,65265=>731,65266=>803, - 65267=>276,65268=>243,65269=>551,65270=>603,65271=>551,65272=>603,65273=>551,65274=>603,65275=>551,65276=>603,65281=>1000,65282=>1000,65283=>1000,65284=>1000,65285=>1000,65286=>1000, - 65287=>1000,65288=>1000,65289=>1000,65290=>1000,65291=>1000,65292=>1000,65293=>1000,65294=>1000,65295=>1000,65296=>1000,65297=>1000,65298=>1000,65299=>1000,65300=>1000,65301=>1000,65302=>1000, - 65303=>1000,65304=>1000,65305=>1000,65306=>1000,65307=>1000,65308=>1000,65309=>1000,65310=>1000,65311=>1000,65312=>1000,65313=>1000,65314=>1000,65315=>1000,65316=>1000,65317=>1000,65318=>1000, - 65319=>1000,65320=>1000,65321=>1000,65322=>1000,65323=>1000,65324=>1000,65325=>1000,65326=>1000,65327=>1000,65328=>1000,65329=>1000,65330=>1000,65331=>1000,65332=>1000,65333=>1000,65334=>1000, - 65335=>1000,65336=>1000,65337=>1000,65338=>1000,65339=>1000,65340=>1000,65341=>1000,65342=>1000,65343=>1000,65344=>1000,65345=>1000,65346=>1000,65347=>1000,65348=>1000,65349=>1000,65350=>1000, - 65351=>1000,65352=>1000,65353=>1000,65354=>1000,65355=>1000,65356=>1000,65357=>1000,65358=>1000,65359=>1000,65360=>1000,65361=>1000,65362=>1000,65363=>1000,65364=>1000,65365=>1000,65366=>1000, - 65367=>1000,65368=>1000,65369=>1000,65370=>1000,65371=>1000,65372=>1000,65373=>1000,65374=>1000,65377=>500,65378=>500,65379=>500,65380=>500,65381=>500,65382=>500,65383=>500,65384=>500, - 65385=>500,65386=>500,65387=>500,65388=>500,65389=>500,65390=>500,65391=>500,65392=>500,65393=>500,65394=>500,65395=>500,65396=>500,65397=>500,65398=>500,65399=>500,65400=>500, - 65401=>500,65402=>500,65403=>500,65404=>500,65405=>500,65406=>500,65407=>500,65408=>500,65409=>500,65410=>500,65411=>500,65412=>500,65413=>500,65414=>500,65415=>500,65416=>500, - 65417=>500,65418=>500,65419=>500,65420=>500,65421=>500,65422=>500,65423=>500,65424=>500,65425=>500,65426=>500,65427=>500,65428=>500,65429=>500,65430=>500,65431=>500,65432=>500, - 65433=>500,65434=>500,65435=>500,65436=>500,65437=>500,65438=>500,65439=>500,65440=>500,65441=>500,65442=>500,65443=>500,65444=>500,65445=>500,65446=>500,65447=>500,65448=>500, - 65449=>500,65450=>500,65451=>500,65452=>500,65453=>500,65454=>500,65455=>500,65456=>500,65457=>500,65458=>500,65459=>500,65460=>500,65461=>500,65462=>500,65463=>500,65464=>500, - 65465=>500,65466=>500,65467=>500,65468=>500,65469=>500,65470=>500,65474=>500,65475=>500,65476=>500,65477=>500,65478=>500,65479=>500,65482=>500,65483=>500,65484=>500,65485=>500, - 65486=>500,65487=>500,65490=>500,65491=>500,65492=>500,65493=>500,65494=>500,65495=>500,65498=>500,65499=>500,65500=>500,65504=>1000,65505=>1000,65506=>1000,65507=>1000,65508=>1000, - 65509=>1000,65510=>1000,65512=>500,65513=>500,65514=>500,65515=>500,65516=>500,65517=>500,65518=>500,65532=>1000,65533=>1000,19968=>1000,19969=>1000,19970=>1000,19971=>1000,19972=>1000, - 19973=>1000,19974=>1000,19975=>1000,19976=>1000,19977=>1000,19978=>1000,19979=>1000,19980=>1000,19981=>1000,19982=>1000,19983=>1000,19984=>1000,19985=>1000,19986=>1000,19987=>1000,19988=>1000, - 19989=>1000,19990=>1000,19991=>1000,19992=>1000,19993=>1000,19994=>1000,19995=>1000,19996=>1000,19997=>1000,19998=>1000,19999=>1000,20000=>1000,20001=>1000,20002=>1000,20003=>1000,20004=>1000, - 20005=>1000,20006=>1000,20007=>1000,20008=>1000,20009=>1000,20010=>1000,20011=>1000,20012=>1000,20013=>1000,20014=>1000,20015=>1000,20016=>1000,20017=>1000,20018=>1000,20019=>1000,20020=>1000, - 20021=>1000,20022=>1000,20023=>1000,20024=>1000,20025=>1000,20026=>1000,20027=>1000,20028=>1000,20029=>1000,20030=>1000,20031=>1000,20032=>1000,20033=>1000,20034=>1000,20035=>1000,20036=>1000, - 20037=>1000,20038=>1000,20039=>1000,20040=>1000,20041=>1000,20042=>1000,20043=>1000,20044=>1000,20045=>1000,20046=>1000,20047=>1000,20048=>1000,20049=>1000,20050=>1000,20051=>1000,20052=>1000, - 20053=>1000,20054=>1000,20055=>1000,20056=>1000,20057=>1000,20058=>1000,20059=>1000,20060=>1000,20061=>1000,20062=>1000,20063=>1000,20064=>1000,20065=>1000,20066=>1000,20067=>1000,20068=>1000, - 20069=>1000,20070=>1000,20071=>1000,20072=>1000,20073=>1000,20074=>1000,20075=>1000,20076=>1000,20077=>1000,20078=>1000,20079=>1000,20080=>1000,20081=>1000,20082=>1000,20083=>1000,20084=>1000, - 20085=>1000,20086=>1000,20087=>1000,20088=>1000,20089=>1000,20090=>1000,20091=>1000,20092=>1000,20093=>1000,20094=>1000,20095=>1000,20096=>1000,20097=>1000,20098=>1000,20099=>1000,20100=>1000, - 20101=>1000,20102=>1000,20103=>1000,20104=>1000,20105=>1000,20106=>1000,20107=>1000,20108=>1000,20109=>1000,20110=>1000,20111=>1000,20112=>1000,20113=>1000,20114=>1000,20115=>1000,20116=>1000, - 20117=>1000,20118=>1000,20119=>1000,20120=>1000,20121=>1000,20122=>1000,20123=>1000,20124=>1000,20125=>1000,20126=>1000,20127=>1000,20128=>1000,20129=>1000,20130=>1000,20131=>1000,20132=>1000, - 20133=>1000,20134=>1000,20135=>1000,20136=>1000,20137=>1000,20138=>1000,20139=>1000,20140=>1000,20141=>1000,20142=>1000,20143=>1000,20144=>1000,20145=>1000,20146=>1000,20147=>1000,20148=>1000, - 20149=>1000,20150=>1000,20151=>1000,20152=>1000,20153=>1000,20154=>1000,20155=>1000,20156=>1000,20157=>1000,20158=>1000,20159=>1000,20160=>1000,20161=>1000,20162=>1000,20163=>1000,20164=>1000, - 20165=>1000,20166=>1000,20167=>1000,20168=>1000,20169=>1000,20170=>1000,20171=>1000,20172=>1000,20173=>1000,20174=>1000,20175=>1000,20176=>1000,20177=>1000,20178=>1000,20179=>1000,20180=>1000, - 20181=>1000,20182=>1000,20183=>1000,20184=>1000,20185=>1000,20186=>1000,20187=>1000,20188=>1000,20189=>1000,20190=>1000,20191=>1000,20192=>1000,20193=>1000,20194=>1000,20195=>1000,20196=>1000, - 20197=>1000,20198=>1000,20199=>1000,20200=>1000,20201=>1000,20202=>1000,20203=>1000,20204=>1000,20205=>1000,20206=>1000,20207=>1000,20208=>1000,20209=>1000,20210=>1000,20211=>1000,20212=>1000, - 20213=>1000,20214=>1000,20215=>1000,20216=>1000,20217=>1000,20218=>1000,20219=>1000,20220=>1000,20221=>1000,20222=>1000,20223=>1000,20224=>1000,20225=>1000,20226=>1000,20227=>1000,20228=>1000, - 20229=>1000,20230=>1000,20231=>1000,20232=>1000,20233=>1000,20234=>1000,20235=>1000,20236=>1000,20237=>1000,20238=>1000,20239=>1000,20240=>1000,20241=>1000,20242=>1000,20243=>1000,20244=>1000, - 20245=>1000,20246=>1000,20247=>1000,20248=>1000,20249=>1000,20250=>1000,20251=>1000,20252=>1000,20253=>1000,20254=>1000,20255=>1000,20256=>1000,20257=>1000,20258=>1000,20259=>1000,20260=>1000, - 20261=>1000,20262=>1000,20263=>1000,20264=>1000,20265=>1000,20266=>1000,20267=>1000,20268=>1000,20269=>1000,20270=>1000,20271=>1000,20272=>1000,20273=>1000,20274=>1000,20275=>1000,20276=>1000, - 20277=>1000,20278=>1000,20279=>1000,20280=>1000,20281=>1000,20282=>1000,20283=>1000,20284=>1000,20285=>1000,20286=>1000,20287=>1000,20288=>1000,20289=>1000,20290=>1000,20291=>1000,20292=>1000, - 20293=>1000,20294=>1000,20295=>1000,20296=>1000,20297=>1000,20298=>1000,20299=>1000,20300=>1000,20301=>1000,20302=>1000,20303=>1000,20304=>1000,20305=>1000,20306=>1000,20307=>1000,20308=>1000, - 20309=>1000,20310=>1000,20311=>1000,20312=>1000,20313=>1000,20314=>1000,20315=>1000,20316=>1000,20317=>1000,20318=>1000,20319=>1000,20320=>1000,20321=>1000,20322=>1000,20323=>1000,20324=>1000, - 20325=>1000,20326=>1000,20327=>1000,20328=>1000,20329=>1000,20330=>1000,20331=>1000,20332=>1000,20333=>1000,20334=>1000,20335=>1000,20336=>1000,20337=>1000,20338=>1000,20339=>1000,20340=>1000, - 20341=>1000,20342=>1000,20343=>1000,20344=>1000,20345=>1000,20346=>1000,20347=>1000,20348=>1000,20349=>1000,20350=>1000,20351=>1000,20352=>1000,20353=>1000,20354=>1000,20355=>1000,20356=>1000, - 20357=>1000,20358=>1000,20359=>1000,20360=>1000,20361=>1000,20362=>1000,20363=>1000,20364=>1000,20365=>1000,20366=>1000,20367=>1000,20368=>1000,20369=>1000,20370=>1000,20371=>1000,20372=>1000, - 20373=>1000,20374=>1000,20375=>1000,20376=>1000,20377=>1000,20378=>1000,20379=>1000,20380=>1000,20381=>1000,20382=>1000,20383=>1000,20384=>1000,20385=>1000,20386=>1000,20387=>1000,20388=>1000, - 20389=>1000,20390=>1000,20391=>1000,20392=>1000,20393=>1000,20394=>1000,20395=>1000,20396=>1000,20397=>1000,20398=>1000,20399=>1000,20400=>1000,20401=>1000,20402=>1000,20403=>1000,20404=>1000, - 20405=>1000,20406=>1000,20407=>1000,20408=>1000,20409=>1000,20410=>1000,20411=>1000,20412=>1000,20413=>1000,20414=>1000,20415=>1000,20416=>1000,20417=>1000,20418=>1000,20419=>1000,20420=>1000, - 20421=>1000,20422=>1000,20423=>1000,20424=>1000,20425=>1000,20426=>1000,20427=>1000,20428=>1000,20429=>1000,20430=>1000,20431=>1000,20432=>1000,20433=>1000,20434=>1000,20435=>1000,20436=>1000, - 20437=>1000,20438=>1000,20439=>1000,20440=>1000,20441=>1000,20442=>1000,20443=>1000,20444=>1000,20445=>1000,20446=>1000,20447=>1000,20448=>1000,20449=>1000,20450=>1000,20451=>1000,20452=>1000, - 20453=>1000,20454=>1000,20455=>1000,20456=>1000,20457=>1000,20458=>1000,20459=>1000,20460=>1000,20461=>1000,20462=>1000,20463=>1000,20464=>1000,20465=>1000,20466=>1000,20467=>1000,20468=>1000, - 20469=>1000,20470=>1000,20471=>1000,20472=>1000,20473=>1000,20474=>1000,20475=>1000,20476=>1000,20477=>1000,20478=>1000,20479=>1000,20480=>1000,20481=>1000,20482=>1000,20483=>1000,20484=>1000, - 20485=>1000,20486=>1000,20487=>1000,20488=>1000,20489=>1000,20490=>1000,20491=>1000,20492=>1000,20493=>1000,20494=>1000,20495=>1000,20496=>1000,20497=>1000,20498=>1000,20499=>1000,20500=>1000, - 20501=>1000,20502=>1000,20503=>1000,20504=>1000,20505=>1000,20506=>1000,20507=>1000,20508=>1000,20509=>1000,20510=>1000,20511=>1000,20512=>1000,20513=>1000,20514=>1000,20515=>1000,20516=>1000, - 20517=>1000,20518=>1000,20519=>1000,20520=>1000,20521=>1000,20522=>1000,20523=>1000,20524=>1000,20525=>1000,20526=>1000,20527=>1000,20528=>1000,20529=>1000,20530=>1000,20531=>1000,20532=>1000, - 20533=>1000,20534=>1000,20535=>1000,20536=>1000,20537=>1000,20538=>1000,20539=>1000,20540=>1000,20541=>1000,20542=>1000,20543=>1000,20544=>1000,20545=>1000,20546=>1000,20547=>1000,20548=>1000, - 20549=>1000,20550=>1000,20551=>1000,20552=>1000,20553=>1000,20554=>1000,20555=>1000,20556=>1000,20557=>1000,20558=>1000,20559=>1000,20560=>1000,20561=>1000,20562=>1000,20563=>1000,20564=>1000, - 20565=>1000,20566=>1000,20567=>1000,20568=>1000,20569=>1000,20570=>1000,20571=>1000,20572=>1000,20573=>1000,20574=>1000,20575=>1000,20576=>1000,20577=>1000,20578=>1000,20579=>1000,20580=>1000, - 20581=>1000,20582=>1000,20583=>1000,20584=>1000,20585=>1000,20586=>1000,20587=>1000,20588=>1000,20589=>1000,20590=>1000,20591=>1000,20592=>1000,20593=>1000,20594=>1000,20595=>1000,20596=>1000, - 20597=>1000,20598=>1000,20599=>1000,20600=>1000,20601=>1000,20602=>1000,20603=>1000,20604=>1000,20605=>1000,20606=>1000,20607=>1000,20608=>1000,20609=>1000,20610=>1000,20611=>1000,20612=>1000, - 20613=>1000,20614=>1000,20615=>1000,20616=>1000,20617=>1000,20618=>1000,20619=>1000,20620=>1000,20621=>1000,20622=>1000,20623=>1000,20624=>1000,20625=>1000,20626=>1000,20627=>1000,20628=>1000, - 20629=>1000,20630=>1000,20631=>1000,20632=>1000,20633=>1000,20634=>1000,20635=>1000,20636=>1000,20637=>1000,20638=>1000,20639=>1000,20640=>1000,20641=>1000,20642=>1000,20643=>1000,20644=>1000, - 20645=>1000,20646=>1000,20647=>1000,20648=>1000,20649=>1000,20650=>1000,20651=>1000,20652=>1000,20653=>1000,20654=>1000,20655=>1000,20656=>1000,20657=>1000,20658=>1000,20659=>1000,20660=>1000, - 20661=>1000,20662=>1000,20663=>1000,20664=>1000,20665=>1000,20666=>1000,20667=>1000,20668=>1000,20669=>1000,20670=>1000,20671=>1000,20672=>1000,20673=>1000,20674=>1000,20675=>1000,20676=>1000, - 20677=>1000,20678=>1000,20679=>1000,20680=>1000,20681=>1000,20682=>1000,20683=>1000,20684=>1000,20685=>1000,20686=>1000,20687=>1000,20688=>1000,20689=>1000,20690=>1000,20691=>1000,20692=>1000, - 20693=>1000,20694=>1000,20695=>1000,20696=>1000,20697=>1000,20698=>1000,20699=>1000,20700=>1000,20701=>1000,20702=>1000,20703=>1000,20704=>1000,20705=>1000,20706=>1000,20707=>1000,20708=>1000, - 20709=>1000,20710=>1000,20711=>1000,20712=>1000,20713=>1000,20714=>1000,20715=>1000,20716=>1000,20717=>1000,20718=>1000,20719=>1000,20720=>1000,20721=>1000,20722=>1000,20723=>1000,20724=>1000, - 20725=>1000,20726=>1000,20727=>1000,20728=>1000,20729=>1000,20730=>1000,20731=>1000,20732=>1000,20733=>1000,20734=>1000,20735=>1000,20736=>1000,20737=>1000,20738=>1000,20739=>1000,20740=>1000, - 20741=>1000,20742=>1000,20743=>1000,20744=>1000,20745=>1000,20746=>1000,20747=>1000,20748=>1000,20749=>1000,20750=>1000,20751=>1000,20752=>1000,20753=>1000,20754=>1000,20755=>1000,20756=>1000, - 20757=>1000,20758=>1000,20759=>1000,20760=>1000,20761=>1000,20762=>1000,20763=>1000,20764=>1000,20765=>1000,20766=>1000,20767=>1000,20768=>1000,20769=>1000,20770=>1000,20771=>1000,20772=>1000, - 20773=>1000,20774=>1000,20775=>1000,20776=>1000,20777=>1000,20778=>1000,20779=>1000,20780=>1000,20781=>1000,20782=>1000,20783=>1000,20784=>1000,20785=>1000,20786=>1000,20787=>1000,20788=>1000, - 20789=>1000,20790=>1000,20791=>1000,20792=>1000,20793=>1000,20794=>1000,20795=>1000,20796=>1000,20797=>1000,20798=>1000,20799=>1000,20800=>1000,20801=>1000,20802=>1000,20803=>1000,20804=>1000, - 20805=>1000,20806=>1000,20807=>1000,20808=>1000,20809=>1000,20810=>1000,20811=>1000,20812=>1000,20813=>1000,20814=>1000,20815=>1000,20816=>1000,20817=>1000,20818=>1000,20819=>1000,20820=>1000, - 20821=>1000,20822=>1000,20823=>1000,20824=>1000,20825=>1000,20826=>1000,20827=>1000,20828=>1000,20829=>1000,20830=>1000,20831=>1000,20832=>1000,20833=>1000,20834=>1000,20835=>1000,20836=>1000, - 20837=>1000,20838=>1000,20839=>1000,20840=>1000,20841=>1000,20842=>1000,20843=>1000,20844=>1000,20845=>1000,20846=>1000,20847=>1000,20848=>1000,20849=>1000,20850=>1000,20851=>1000,20852=>1000, - 20853=>1000,20854=>1000,20855=>1000,20856=>1000,20857=>1000,20858=>1000,20859=>1000,20860=>1000,20861=>1000,20862=>1000,20863=>1000,20864=>1000,20865=>1000,20866=>1000,20867=>1000,20868=>1000, - 20869=>1000,20870=>1000,20871=>1000,20872=>1000,20873=>1000,20874=>1000,20875=>1000,20876=>1000,20877=>1000,20878=>1000,20879=>1000,20880=>1000,20881=>1000,20882=>1000,20883=>1000,20884=>1000, - 20885=>1000,20886=>1000,20887=>1000,20888=>1000,20889=>1000,20890=>1000,20891=>1000,20892=>1000,20893=>1000,20894=>1000,20895=>1000,20896=>1000,20897=>1000,20898=>1000,20899=>1000,20900=>1000, - 20901=>1000,20902=>1000,20903=>1000,20904=>1000,20905=>1000,20906=>1000,20907=>1000,20908=>1000,20909=>1000,20910=>1000,20911=>1000,20912=>1000,20913=>1000,20914=>1000,20915=>1000,20916=>1000, - 20917=>1000,20918=>1000,20919=>1000,20920=>1000,20921=>1000,20922=>1000,20923=>1000,20924=>1000,20925=>1000,20926=>1000,20927=>1000,20928=>1000,20929=>1000,20930=>1000,20931=>1000,20932=>1000, - 20933=>1000,20934=>1000,20935=>1000,20936=>1000,20937=>1000,20938=>1000,20939=>1000,20940=>1000,20941=>1000,20942=>1000,20943=>1000,20944=>1000,20945=>1000,20946=>1000,20947=>1000,20948=>1000, - 20949=>1000,20950=>1000,20951=>1000,20952=>1000,20953=>1000,20954=>1000,20955=>1000,20956=>1000,20957=>1000,20958=>1000,20959=>1000,20960=>1000,20961=>1000,20962=>1000,20963=>1000,20964=>1000, - 20965=>1000,20966=>1000,20967=>1000,20968=>1000,20969=>1000,20970=>1000,20971=>1000,20972=>1000,20973=>1000,20974=>1000,20975=>1000,20976=>1000,20977=>1000,20978=>1000,20979=>1000,20980=>1000, - 20981=>1000,20982=>1000,20983=>1000,20984=>1000,20985=>1000,20986=>1000,20987=>1000,20988=>1000,20989=>1000,20990=>1000,20991=>1000,20992=>1000,20993=>1000,20994=>1000,20995=>1000,20996=>1000, - 20997=>1000,20998=>1000,20999=>1000,21000=>1000,21001=>1000,21002=>1000,21003=>1000,21004=>1000,21005=>1000,21006=>1000,21007=>1000,21008=>1000,21009=>1000,21010=>1000,21011=>1000,21012=>1000, - 21013=>1000,21014=>1000,21015=>1000,21016=>1000,21017=>1000,21018=>1000,21019=>1000,21020=>1000,21021=>1000,21022=>1000,21023=>1000,21024=>1000,21025=>1000,21026=>1000,21027=>1000,21028=>1000, - 21029=>1000,21030=>1000,21031=>1000,21032=>1000,21033=>1000,21034=>1000,21035=>1000,21036=>1000,21037=>1000,21038=>1000,21039=>1000,21040=>1000,21041=>1000,21042=>1000,21043=>1000,21044=>1000, - 21045=>1000,21046=>1000,21047=>1000,21048=>1000,21049=>1000,21050=>1000,21051=>1000,21052=>1000,21053=>1000,21054=>1000,21055=>1000,21056=>1000,21057=>1000,21058=>1000,21059=>1000,21060=>1000, - 21061=>1000,21062=>1000,21063=>1000,21064=>1000,21065=>1000,21066=>1000,21067=>1000,21068=>1000,21069=>1000,21070=>1000,21071=>1000,21072=>1000,21073=>1000,21074=>1000,21075=>1000,21076=>1000, - 21077=>1000,21078=>1000,21079=>1000,21080=>1000,21081=>1000,21082=>1000,21083=>1000,21084=>1000,21085=>1000,21086=>1000,21087=>1000,21088=>1000,21089=>1000,21090=>1000,21091=>1000,21092=>1000, - 21093=>1000,21094=>1000,21095=>1000,21096=>1000,21097=>1000,21098=>1000,21099=>1000,21100=>1000,21101=>1000,21102=>1000,21103=>1000,21104=>1000,21105=>1000,21106=>1000,21107=>1000,21108=>1000, - 21109=>1000,21110=>1000,21111=>1000,21112=>1000,21113=>1000,21114=>1000,21115=>1000,21116=>1000,21117=>1000,21118=>1000,21119=>1000,21120=>1000,21121=>1000,21122=>1000,21123=>1000,21124=>1000, - 21125=>1000,21126=>1000,21127=>1000,21128=>1000,21129=>1000,21130=>1000,21131=>1000,21132=>1000,21133=>1000,21134=>1000,21135=>1000,21136=>1000,21137=>1000,21138=>1000,21139=>1000,21140=>1000, - 21141=>1000,21142=>1000,21143=>1000,21144=>1000,21145=>1000,21146=>1000,21147=>1000,21148=>1000,21149=>1000,21150=>1000,21151=>1000,21152=>1000,21153=>1000,21154=>1000,21155=>1000,21156=>1000, - 21157=>1000,21158=>1000,21159=>1000,21160=>1000,21161=>1000,21162=>1000,21163=>1000,21164=>1000,21165=>1000,21166=>1000,21167=>1000,21168=>1000,21169=>1000,21170=>1000,21171=>1000,21172=>1000, - 21173=>1000,21174=>1000,21175=>1000,21176=>1000,21177=>1000,21178=>1000,21179=>1000,21180=>1000,21181=>1000,21182=>1000,21183=>1000,21184=>1000,21185=>1000,21186=>1000,21187=>1000,21188=>1000, - 21189=>1000,21190=>1000,21191=>1000,21192=>1000,21193=>1000,21194=>1000,21195=>1000,21196=>1000,21197=>1000,21198=>1000,21199=>1000,21200=>1000,21201=>1000,21202=>1000,21203=>1000,21204=>1000, - 21205=>1000,21206=>1000,21207=>1000,21208=>1000,21209=>1000,21210=>1000,21211=>1000,21212=>1000,21213=>1000,21214=>1000,21215=>1000,21216=>1000,21217=>1000,21218=>1000,21219=>1000,21220=>1000, - 21221=>1000,21222=>1000,21223=>1000,21224=>1000,21225=>1000,21226=>1000,21227=>1000,21228=>1000,21229=>1000,21230=>1000,21231=>1000,21232=>1000,21233=>1000,21234=>1000,21235=>1000,21236=>1000, - 21237=>1000,21238=>1000,21239=>1000,21240=>1000,21241=>1000,21242=>1000,21243=>1000,21244=>1000,21245=>1000,21246=>1000,21247=>1000,21248=>1000,21249=>1000,21250=>1000,21251=>1000,21252=>1000, - 21253=>1000,21254=>1000,21255=>1000,21256=>1000,21257=>1000,21258=>1000,21259=>1000,21260=>1000,21261=>1000,21262=>1000,21263=>1000,21264=>1000,21265=>1000,21266=>1000,21267=>1000,21268=>1000, - 21269=>1000,21270=>1000,21271=>1000,21272=>1000,21273=>1000,21274=>1000,21275=>1000,21276=>1000,21277=>1000,21278=>1000,21279=>1000,21280=>1000,21281=>1000,21282=>1000,21283=>1000,21284=>1000, - 21285=>1000,21286=>1000,21287=>1000,21288=>1000,21289=>1000,21290=>1000,21291=>1000,21292=>1000,21293=>994,21294=>1000,21295=>1000,21296=>1000,21297=>1000,21298=>1000,21299=>1000,21300=>1000, - 21301=>1000,21302=>1000,21303=>1000,21304=>1000,21305=>1000,21306=>1000,21307=>1000,21308=>1000,21309=>1000,21310=>1000,21311=>1000,21312=>1000,21313=>1000,21314=>1000,21315=>1000,21316=>1000, - 21317=>1000,21318=>1000,21319=>1000,21320=>1000,21321=>1000,21322=>1000,21323=>1000,21324=>1000,21325=>1000,21326=>1000,21327=>1000,21328=>1000,21329=>1000,21330=>1000,21331=>1000,21332=>1000, - 21333=>1000,21334=>1000,21335=>1000,21336=>1000,21337=>1000,21338=>1000,21339=>1000,21340=>1000,21341=>1000,21342=>1000,21343=>1000,21344=>1000,21345=>1000,21346=>1000,21347=>1000,21348=>1000, - 21349=>1000,21350=>1000,21351=>1000,21352=>1000,21353=>1000,21354=>1000,21355=>1000,21356=>1000,21357=>1000,21358=>1000,21359=>1000,21360=>1000,21361=>1000,21362=>1000,21363=>1000,21364=>1000, - 21365=>1000,21366=>1000,21367=>1000,21368=>1000,21369=>1000,21370=>1000,21371=>1000,21372=>1000,21373=>1000,21374=>1000,21375=>1000,21376=>1000,21377=>1000,21378=>1000,21379=>1000,21380=>1000, - 21381=>1000,21382=>1000,21383=>1000,21384=>1000,21385=>1000,21386=>1000,21387=>1000,21388=>1000,21389=>1000,21390=>1000,21391=>1000,21392=>1000,21393=>1000,21394=>1000,21395=>1000,21396=>1000, - 21397=>1000,21398=>1000,21399=>1000,21400=>1000,21401=>1000,21402=>1000,21403=>1000,21404=>1000,21405=>1000,21406=>1000,21407=>1000,21408=>1000,21409=>1000,21410=>1000,21411=>1000,21412=>1000, - 21413=>1000,21414=>1000,21415=>1000,21416=>1000,21417=>1000,21418=>1000,21419=>1000,21420=>1000,21421=>1000,21422=>1000,21423=>1000,21424=>1000,21425=>1000,21426=>1000,21427=>1000,21428=>1000, - 21429=>1000,21430=>1000,21431=>1000,21432=>1000,21433=>1000,21434=>1000,21435=>1000,21436=>1000,21437=>1000,21438=>1000,21439=>1000,21440=>1000,21441=>1000,21442=>1000,21443=>1000,21444=>1000, - 21445=>1000,21446=>1000,21447=>1000,21448=>1000,21449=>1000,21450=>1000,21451=>1000,21452=>1000,21453=>1000,21454=>1000,21455=>1000,21456=>1000,21457=>1000,21458=>1000,21459=>1000,21460=>1000, - 21461=>1000,21462=>1000,21463=>1000,21464=>1000,21465=>1000,21466=>1000,21467=>1000,21468=>1000,21469=>1000,21470=>1000,21471=>1000,21472=>1000,21473=>1000,21474=>1000,21475=>1000,21476=>1000, - 21477=>1000,21478=>1000,21479=>1000,21480=>1000,21481=>1000,21482=>1000,21483=>1000,21484=>1000,21485=>1000,21486=>1000,21487=>1000,21488=>1000,21489=>1000,21490=>1000,21491=>1000,21492=>1000, - 21493=>1000,21494=>1000,21495=>1000,21496=>1000,21497=>1000,21498=>1000,21499=>1000,21500=>1000,21501=>1000,21502=>1000,21503=>1000,21504=>1000,21505=>1000,21506=>1000,21507=>1000,21508=>1000, - 21509=>1000,21510=>1000,21511=>1000,21512=>1000,21513=>1000,21514=>1000,21515=>1000,21516=>1000,21517=>1000,21518=>1000,21519=>1000,21520=>1000,21521=>1000,21522=>1000,21523=>1000,21524=>1000, - 21525=>1000,21526=>1000,21527=>1000,21528=>1000,21529=>1000,21530=>1000,21531=>1000,21532=>1000,21533=>1000,21534=>1000,21535=>1000,21536=>1000,21537=>1000,21538=>1000,21539=>1000,21540=>1000, - 21541=>1000,21542=>1000,21543=>1000,21544=>1000,21545=>1000,21546=>1000,21547=>1000,21548=>1000,21549=>1000,21550=>1000,21551=>1000,21552=>1000,21553=>1000,21554=>1000,21555=>1000,21556=>1000, - 21557=>1000,21558=>1000,21559=>1000,21560=>1000,21561=>1000,21562=>1000,21563=>1000,21564=>1000,21565=>1000,21566=>1000,21567=>1000,21568=>1000,21569=>1000,21570=>1000,21571=>1000,21572=>1000, - 21573=>1000,21574=>1000,21575=>1000,21576=>1000,21577=>1000,21578=>1000,21579=>1000,21580=>1000,21581=>1000,21582=>1000,21583=>1000,21584=>1000,21585=>1000,21586=>1000,21587=>1000,21588=>1000, - 21589=>1000,21590=>1000,21591=>1000,21592=>1000,21593=>1000,21594=>1000,21595=>1000,21596=>1000,21597=>1000,21598=>1000,21599=>1000,21600=>1000,21601=>1000,21602=>1000,21603=>1000,21604=>1000, - 21605=>1000,21606=>1000,21607=>1000,21608=>1000,21609=>1000,21610=>1000,21611=>1000,21612=>1000,21613=>1000,21614=>1000,21615=>1000,21616=>1000,21617=>1000,21618=>1000,21619=>1000,21620=>1000, - 21621=>1000,21622=>1000,21623=>1000,21624=>1000,21625=>1000,21626=>1000,21627=>1000,21628=>1000,21629=>1000,21630=>1000,21631=>1000,21632=>1000,21633=>1000,21634=>1000,21635=>1000,21636=>1000, - 21637=>1000,21638=>1000,21639=>1000,21640=>1000,21641=>1000,21642=>1000,21643=>1000,21644=>1000,21645=>1000,21646=>1000,21647=>1000,21648=>1000,21649=>1000,21650=>1000,21651=>1000,21652=>1000, - 21653=>1000,21654=>1000,21655=>1000,21656=>1000,21657=>1000,21658=>1000,21659=>1000,21660=>1000,21661=>1000,21662=>1000,21663=>1000,21664=>1000,21665=>1000,21666=>1000,21667=>1000,21668=>1000, - 21669=>1000,21670=>1000,21671=>1000,21672=>1000,21673=>1000,21674=>1000,21675=>1000,21676=>1000,21677=>1000,21678=>1000,21679=>1000,21680=>1000,21681=>1000,21682=>1000,21683=>1000,21684=>1000, - 21685=>1000,21686=>1000,21687=>1000,21688=>1000,21689=>1000,21690=>1000,21691=>1000,21692=>1000,21693=>1000,21694=>1000,21695=>1000,21696=>1000,21697=>1000,21698=>1000,21699=>1000,21700=>1000, - 21701=>1000,21702=>1000,21703=>1000,21704=>1000,21705=>1000,21706=>1000,21707=>1000,21708=>1000,21709=>1000,21710=>1000,21711=>1000,21712=>1000,21713=>1000,21714=>1000,21715=>1000,21716=>1000, - 21717=>1000,21718=>1000,21719=>1000,21720=>1000,21721=>1000,21722=>1000,21723=>1000,21724=>1000,21725=>1000,21726=>1000,21727=>1000,21728=>1000,21729=>1000,21730=>1000,21731=>1000,21732=>1000, - 21733=>1000,21734=>1000,21735=>1000,21736=>1000,21737=>1000,21738=>1000,21739=>1000,21740=>1000,21741=>1000,21742=>1000,21743=>1000,21744=>1000,21745=>1000,21746=>1000,21747=>1000,21748=>1000, - 21749=>1000,21750=>1000,21751=>1000,21752=>1000,21753=>1000,21754=>1000,21755=>1000,21756=>1000,21757=>1000,21758=>1000,21759=>1000,21760=>1000,21761=>1000,21762=>1000,21763=>1000,21764=>1000, - 21765=>1000,21766=>1000,21767=>1000,21768=>1000,21769=>1000,21770=>1000,21771=>1000,21772=>1000,21773=>1000,21774=>1000,21775=>1000,21776=>1000,21777=>1000,21778=>1000,21779=>1000,21780=>1000, - 21781=>1000,21782=>1000,21783=>1000,21784=>1000,21785=>1000,21786=>1000,21787=>1000,21788=>1000,21789=>1000,21790=>1000,21791=>1000,21792=>1000,21793=>1000,21794=>1000,21795=>1000,21796=>1000, - 21797=>1000,21798=>1000,21799=>1000,21800=>1000,21801=>1000,21802=>1000,21803=>1000,21804=>1000,21805=>1000,21806=>1000,21807=>1000,21808=>1000,21809=>1000,21810=>1000,21811=>1000,21812=>1000, - 21813=>1000,21814=>1000,21815=>1000,21816=>1000,21817=>1000,21818=>1000,21819=>1000,21820=>1000,21821=>1000,21822=>1000,21823=>1000,21824=>1000,21825=>1000,21826=>1000,21827=>1000,21828=>1000, - 21829=>1000,21830=>1000,21831=>1000,21832=>1000,21833=>1000,21834=>1000,21835=>1000,21836=>1000,21837=>1000,21838=>1000,21839=>1000,21840=>1000,21841=>1000,21842=>1000,21843=>1000,21844=>1000, - 21845=>1000,21846=>1000,21847=>1000,21848=>1000,21849=>1000,21850=>1000,21851=>1000,21852=>1000,21853=>1000,21854=>1000,21855=>1000,21856=>1000,21857=>1000,21858=>1000,21859=>1000,21860=>1000, - 21861=>1000,21862=>1000,21863=>1000,21864=>1000,21865=>1000,21866=>1000,21867=>1000,21868=>1000,21869=>1000,21870=>1000,21871=>1000,21872=>1000,21873=>1000,21874=>1000,21875=>1000,21876=>1000, - 21877=>1000,21878=>1000,21879=>1000,21880=>1000,21881=>1000,21882=>1000,21883=>1000,21884=>1000,21885=>1000,21886=>1000,21887=>1000,21888=>1000,21889=>1000,21890=>1000,21891=>1000,21892=>1000, - 21893=>1000,21894=>1000,21895=>1000,21896=>1000,21897=>1000,21898=>1000,21899=>1000,21900=>1000,21901=>1000,21902=>1000,21903=>1000,21904=>1000,21905=>1000,21906=>1000,21907=>1000,21908=>1000, - 21909=>1000,21910=>1000,21911=>1000,21912=>1000,21913=>1000,21914=>1000,21915=>1000,21916=>1000,21917=>1000,21918=>1000,21919=>1000,21920=>1000,21921=>1000,21922=>1000,21923=>1000,21924=>1000, - 21925=>1000,21926=>1000,21927=>1000,21928=>1000,21929=>1000,21930=>1000,21931=>1000,21932=>1000,21933=>1000,21934=>1000,21935=>1000,21936=>1000,21937=>1000,21938=>1000,21939=>1000,21940=>1000, - 21941=>1000,21942=>1000,21943=>1000,21944=>1000,21945=>1000,21946=>1000,21947=>1000,21948=>1000,21949=>1000,21950=>1000,21951=>1000,21952=>1000,21953=>1000,21954=>1000,21955=>1000,21956=>1000, - 21957=>1000,21958=>1000,21959=>1000,21960=>1000,21961=>1000,21962=>1000,21963=>1000,21964=>1000,21965=>1000,21966=>1000,21967=>1000,21968=>1000,21969=>1000,21970=>1000,21971=>1000,21972=>1000, - 21973=>1000,21974=>1000,21975=>1000,21976=>1000,21977=>1000,21978=>1000,21979=>1000,21980=>1000,21981=>1000,21982=>1000,21983=>1000,21984=>1000,21985=>1000,21986=>1000,21987=>1000,21988=>1000, - 21989=>1000,21990=>1000,21991=>1000,21992=>1000,21993=>1000,21994=>1000,21995=>1000,21996=>1000,21997=>1000,21998=>1000,21999=>1000,22000=>1000,22001=>1000,22002=>1000,22003=>1000,22004=>1000, - 22005=>1000,22006=>1000,22007=>1000,22008=>1000,22009=>1000,22010=>1000,22011=>1000,22012=>1000,22013=>1000,22014=>1000,22015=>1000,22016=>1000,22017=>1000,22018=>1000,22019=>1000,22020=>1000, - 22021=>1000,22022=>1000,22023=>1000,22024=>1000,22025=>1000,22026=>1000,22027=>1000,22028=>1000,22029=>1000,22030=>1000,22031=>1000,22032=>1000,22033=>1000,22034=>1000,22035=>1000,22036=>1000, - 22037=>1000,22038=>1000,22039=>1000,22040=>1000,22041=>1000,22042=>1000,22043=>1000,22044=>1000,22045=>1000,22046=>1000,22047=>1000,22048=>1000,22049=>1000,22050=>1000,22051=>1000,22052=>1000, - 22053=>1000,22054=>1000,22055=>1000,22056=>1000,22057=>1000,22058=>1000,22059=>1000,22060=>1000,22061=>1000,22062=>1000,22063=>1000,22064=>1000,22065=>1000,22066=>1000,22067=>1000,22068=>1000, - 22069=>1000,22070=>1000,22071=>1000,22072=>1000,22073=>1000,22074=>1000,22075=>1000,22076=>1000,22077=>1000,22078=>1000,22079=>1000,22080=>1000,22081=>1000,22082=>1000,22083=>1000,22084=>1000, - 22085=>1000,22086=>1000,22087=>1000,22088=>1000,22089=>1000,22090=>1000,22091=>1000,22092=>1000,22093=>1000,22094=>1000,22095=>1000,22096=>1000,22097=>1000,22098=>1000,22099=>1000,22100=>1000, - 22101=>1000,22102=>1000,22103=>1000,22104=>1000,22105=>1000,22106=>1000,22107=>1000,22108=>1000,22109=>1000,22110=>1000,22111=>1000,22112=>1000,22113=>1000,22114=>1000,22115=>1000,22116=>1000, - 22117=>1000,22118=>1000,22119=>1000,22120=>1000,22121=>1000,22122=>1000,22123=>1000,22124=>1000,22125=>1000,22126=>1000,22127=>1000,22128=>1000,22129=>1000,22130=>1000,22131=>1000,22132=>1000, - 22133=>1000,22134=>1000,22135=>1000,22136=>1000,22137=>1000,22138=>1000,22139=>1000,22140=>1000,22141=>1000,22142=>1000,22143=>1000,22144=>1000,22145=>1000,22146=>1000,22147=>1000,22148=>1000, - 22149=>1000,22150=>1000,22151=>1000,22152=>1000,22153=>1000,22154=>1000,22155=>1000,22156=>1000,22157=>1000,22158=>1000,22159=>1000,22160=>1000,22161=>1000,22162=>1000,22163=>1000,22164=>1000, - 22165=>1000,22166=>1000,22167=>1000,22168=>1000,22169=>1000,22170=>1000,22171=>1000,22172=>1000,22173=>1000,22174=>1000,22175=>1000,22176=>1000,22177=>1000,22178=>1000,22179=>1000,22180=>1000, - 22181=>1000,22182=>1000,22183=>1000,22184=>1000,22185=>1000,22186=>1000,22187=>1000,22188=>1000,22189=>1000,22190=>1000,22191=>1000,22192=>1000,22193=>1000,22194=>1000,22195=>1000,22196=>1000, - 22197=>1000,22198=>1000,22199=>1000,22200=>1000,22201=>1000,22202=>1000,22203=>1000,22204=>1000,22205=>1000,22206=>1000,22207=>1000,22208=>1000,22209=>1000,22210=>1000,22211=>1000,22212=>1000, - 22213=>1000,22214=>1000,22215=>1000,22216=>1000,22217=>1000,22218=>1000,22219=>1000,22220=>1000,22221=>1000,22222=>1000,22223=>1000,22224=>1000,22225=>1000,22226=>1000,22227=>1000,22228=>1000, - 22229=>1000,22230=>1000,22231=>1000,22232=>1000,22233=>1000,22234=>1000,22235=>1000,22236=>1000,22237=>1000,22238=>1000,22239=>1000,22240=>1000,22241=>1000,22242=>1000,22243=>1000,22244=>1000, - 22245=>1000,22246=>1000,22247=>1000,22248=>1000,22249=>1000,22250=>1000,22251=>1000,22252=>1000,22253=>1000,22254=>1000,22255=>1000,22256=>1000,22257=>1000,22258=>1000,22259=>1000,22260=>1000, - 22261=>1000,22262=>1000,22263=>1000,22264=>1000,22265=>1000,22266=>1000,22267=>1000,22268=>1000,22269=>1000,22270=>1000,22271=>1000,22272=>1000,22273=>1000,22274=>1000,22275=>1000,22276=>1000, - 22277=>1000,22278=>1000,22279=>1000,22280=>1000,22281=>1000,22282=>1000,22283=>1000,22284=>1000,22285=>1000,22286=>1000,22287=>1000,22288=>1000,22289=>1000,22290=>1000,22291=>1000,22292=>1000, - 22293=>1000,22294=>1000,22295=>1000,22296=>1000,22297=>1000,22298=>1000,22299=>1000,22300=>1000,22301=>1000,22302=>1000,22303=>1000,22304=>1000,22305=>1000,22306=>1000,22307=>1000,22308=>1000, - 22309=>1000,22310=>1000,22311=>1000,22312=>1000,22313=>1000,22314=>1000,22315=>1000,22316=>1000,22317=>1000,22318=>1000,22319=>1000,22320=>1000,22321=>1000,22322=>1000,22323=>1000,22324=>1000, - 22325=>1000,22326=>1000,22327=>1000,22328=>1000,22329=>1000,22330=>1000,22331=>1000,22332=>1000,22333=>1000,22334=>1000,22335=>1000,22336=>1000,22337=>1000,22338=>1000,22339=>1000,22340=>1000, - 22341=>1000,22342=>1000,22343=>1000,22344=>1000,22345=>1000,22346=>1000,22347=>1000,22348=>1000,22349=>1000,22350=>1000,22351=>1000,22352=>1000,22353=>1000,22354=>1000,22355=>1000,22356=>1000, - 22357=>1000,22358=>1000,22359=>1000,22360=>1000,22361=>1000,22362=>1000,22363=>1000,22364=>1000,22365=>1000,22366=>1000,22367=>1000,22368=>1000,22369=>1000,22370=>1000,22371=>1000,22372=>1000, - 22373=>1000,22374=>1000,22375=>1000,22376=>1000,22377=>1000,22378=>1000,22379=>1000,22380=>1000,22381=>1000,22382=>1000,22383=>1000,22384=>1000,22385=>1000,22386=>1000,22387=>1000,22388=>1000, - 22389=>1000,22390=>1000,22391=>1000,22392=>1000,22393=>1000,22394=>1000,22395=>1000,22396=>1000,22397=>1000,22398=>1000,22399=>1000,22400=>1000,22401=>1000,22402=>1000,22403=>1000,22404=>1000, - 22405=>1000,22406=>1000,22407=>1000,22408=>1000,22409=>1000,22410=>1000,22411=>1000,22412=>1000,22413=>1000,22414=>1000,22415=>1000,22416=>1000,22417=>1000,22418=>1000,22419=>1000,22420=>1000, - 22421=>1000,22422=>1000,22423=>1000,22424=>1000,22425=>1000,22426=>1000,22427=>1000,22428=>1000,22429=>1000,22430=>1000,22431=>1000,22432=>1000,22433=>1000,22434=>1000,22435=>1000,22436=>1000, - 22437=>1000,22438=>1000,22439=>1000,22440=>1000,22441=>1000,22442=>1000,22443=>1000,22444=>1000,22445=>1000,22446=>1000,22447=>1000,22448=>1000,22449=>1000,22450=>1000,22451=>1000,22452=>1000, - 22453=>1000,22454=>1000,22455=>1000,22456=>1000,22457=>1000,22458=>1000,22459=>1000,22460=>1000,22461=>1000,22462=>1000,22463=>1000,22464=>1000,22465=>1000,22466=>1000,22467=>1000,22468=>1000, - 22469=>1000,22470=>1000,22471=>1000,22472=>1000,22473=>1000,22474=>1000,22475=>1000,22476=>1000,22477=>1000,22478=>1000,22479=>1000,22480=>1000,22481=>1000,22482=>1000,22483=>1000,22484=>1000, - 22485=>1000,22486=>1000,22487=>1000,22488=>1000,22489=>1000,22490=>1000,22491=>1000,22492=>1000,22493=>1000,22494=>1000,22495=>1000,22496=>1000,22497=>1000,22498=>1000,22499=>1000,22500=>1000, - 22501=>1000,22502=>1000,22503=>1000,22504=>1000,22505=>1000,22506=>1000,22507=>1000,22508=>1000,22509=>1000,22510=>1000,22511=>1000,22512=>1000,22513=>1000,22514=>1000,22515=>1000,22516=>1000, - 22517=>1000,22518=>1000,22519=>1000,22520=>1000,22521=>1000,22522=>1000,22523=>1000,22524=>1000,22525=>1000,22526=>1000,22527=>1000,22528=>1000,22529=>1000,22530=>1000,22531=>1000,22532=>1000, - 22533=>1000,22534=>1000,22535=>1000,22536=>1000,22537=>1000,22538=>1000,22539=>1000,22540=>1000,22541=>1000,22542=>1000,22543=>1000,22544=>1000,22545=>1000,22546=>1000,22547=>1000,22548=>1000, - 22549=>1000,22550=>1000,22551=>1000,22552=>1000,22553=>1000,22554=>1000,22555=>1000,22556=>1000,22557=>1000,22558=>1000,22559=>1000,22560=>1000,22561=>1000,22562=>1000,22563=>1000,22564=>1000, - 22565=>1000,22566=>1000,22567=>1000,22568=>1000,22569=>1000,22570=>1000,22571=>1000,22572=>1000,22573=>1000,22574=>1000,22575=>1000,22576=>1000,22577=>1000,22578=>1000,22579=>1000,22580=>1000, - 22581=>1000,22582=>1000,22583=>1000,22584=>1000,22585=>1000,22586=>1000,22587=>1000,22588=>1000,22589=>1000,22590=>1000,22591=>1000,22592=>1000,22593=>1000,22594=>1000,22595=>1000,22596=>1000, - 22597=>1000,22598=>1000,22599=>1000,22600=>1000,22601=>1000,22602=>1000,22603=>1000,22604=>1000,22605=>1000,22606=>1000,22607=>1000,22608=>1000,22609=>1000,22610=>1000,22611=>1000,22612=>1000, - 22613=>1000,22614=>1000,22615=>1000,22616=>1000,22617=>1000,22618=>1000,22619=>1000,22620=>1000,22621=>1000,22622=>1000,22623=>1000,22624=>1000,22625=>1000,22626=>1000,22627=>1000,22628=>1000, - 22629=>1000,22630=>1000,22631=>1000,22632=>1000,22633=>1000,22634=>1000,22635=>1000,22636=>1000,22637=>1000,22638=>1000,22639=>1000,22640=>1000,22641=>1000,22642=>1000,22643=>1000,22644=>1000, - 22645=>1000,22646=>1000,22647=>1000,22648=>1000,22649=>1000,22650=>1000,22651=>1000,22652=>1000,22653=>1000,22654=>1000,22655=>1000,22656=>1000,22657=>1000,22658=>1000,22659=>1000,22660=>1000, - 22661=>1000,22662=>1000,22663=>1000,22664=>1000,22665=>1000,22666=>1000,22667=>1000,22668=>1000,22669=>1000,22670=>1000,22671=>1000,22672=>1000,22673=>1000,22674=>1000,22675=>1000,22676=>1000, - 22677=>1000,22678=>1000,22679=>1000,22680=>1000,22681=>1000,22682=>1000,22683=>1000,22684=>1000,22685=>1000,22686=>1000,22687=>1000,22688=>1000,22689=>1000,22690=>1000,22691=>1000,22692=>1000, - 22693=>1000,22694=>1000,22695=>1000,22696=>1000,22697=>1000,22698=>1000,22699=>1000,22700=>1000,22701=>1000,22702=>1000,22703=>1000,22704=>1000,22705=>1000,22706=>1000,22707=>1000,22708=>1000, - 22709=>1000,22710=>1000,22711=>1000,22712=>1000,22713=>1000,22714=>1000,22715=>1000,22716=>1000,22717=>1000,22718=>1000,22719=>1000,22720=>1000,22721=>1000,22722=>1000,22723=>1000,22724=>1000, - 22725=>1000,22726=>1000,22727=>1000,22728=>1000,22729=>1000,22730=>1000,22731=>1000,22732=>1000,22733=>1000,22734=>1000,22735=>1000,22736=>1000,22737=>1000,22738=>1000,22739=>1000,22740=>1000, - 22741=>1000,22742=>1000,22743=>1000,22744=>1000,22745=>1000,22746=>1000,22747=>1000,22748=>1000,22749=>1000,22750=>1000,22751=>1000,22752=>1000,22753=>1000,22754=>1000,22755=>1000,22756=>1000, - 22757=>1000,22758=>1000,22759=>1000,22760=>1000,22761=>1000,22762=>1000,22763=>1000,22764=>1000,22765=>1000,22766=>1000,22767=>1000,22768=>1000,22769=>1000,22770=>1000,22771=>1000,22772=>1000, - 22773=>1000,22774=>1000,22775=>1000,22776=>1000,22777=>1000,22778=>1000,22779=>1000,22780=>1000,22781=>1000,22782=>1000,22783=>1000,22784=>1000,22785=>1000,22786=>1000,22787=>1000,22788=>1000, - 22789=>1000,22790=>1000,22791=>1000,22792=>1000,22793=>1000,22794=>1000,22795=>1000,22796=>1000,22797=>1000,22798=>1000,22799=>1000,22800=>1000,22801=>1000,22802=>1000,22803=>1000,22804=>1000, - 22805=>1000,22806=>1000,22807=>1000,22808=>1000,22809=>1000,22810=>1000,22811=>1000,22812=>1000,22813=>1000,22814=>1000,22815=>1000,22816=>1000,22817=>1000,22818=>1000,22819=>1000,22820=>1000, - 22821=>1000,22822=>1000,22823=>1000,22824=>1000,22825=>1000,22826=>1000,22827=>1000,22828=>1000,22829=>1000,22830=>1000,22831=>1000,22832=>1000,22833=>1000,22834=>1000,22835=>1000,22836=>1000, - 22837=>1000,22838=>1000,22839=>1000,22840=>1000,22841=>1000,22842=>1000,22843=>1000,22844=>1000,22845=>1000,22846=>1000,22847=>1000,22848=>1000,22849=>1000,22850=>1000,22851=>1000,22852=>1000, - 22853=>1000,22854=>1000,22855=>1000,22856=>1000,22857=>1000,22858=>1000,22859=>1000,22860=>1000,22861=>1000,22862=>1000,22863=>1000,22864=>1000,22865=>1000,22866=>1000,22867=>1000,22868=>1000, - 22869=>1000,22870=>1000,22871=>1000,22872=>1000,22873=>1000,22874=>1000,22875=>1000,22876=>1000,22877=>1000,22878=>1000,22879=>1000,22880=>1000,22881=>1000,22882=>1000,22883=>1000,22884=>1000, - 22885=>1000,22886=>1000,22887=>1000,22888=>1000,22889=>1000,22890=>1000,22891=>1000,22892=>1000,22893=>1000,22894=>1000,22895=>1000,22896=>1000,22897=>1000,22898=>1000,22899=>1000,22900=>1000, - 22901=>1000,22902=>1000,22903=>1000,22904=>1000,22905=>1000,22906=>1000,22907=>1000,22908=>1000,22909=>1000,22910=>1000,22911=>1000,22912=>1000,22913=>1000,22914=>1000,22915=>1000,22916=>1000, - 22917=>1000,22918=>1000,22919=>1000,22920=>1000,22921=>1000,22922=>1000,22923=>1000,22924=>1000,22925=>1000,22926=>1000,22927=>1000,22928=>1000,22929=>1000,22930=>1000,22931=>1000,22932=>1000, - 22933=>1000,22934=>1000,22935=>1000,22936=>1000,22937=>1000,22938=>1000,22939=>1000,22940=>1000,22941=>1000,22942=>1000,22943=>1000,22944=>1000,22945=>1000,22946=>1000,22947=>1000,22948=>1000, - 22949=>1000,22950=>1000,22951=>1000,22952=>1000,22953=>1000,22954=>1000,22955=>1000,22956=>1000,22957=>1000,22958=>1000,22959=>1000,22960=>1000,22961=>1000,22962=>1000,22963=>1000,22964=>1000, - 22965=>1000,22966=>1000,22967=>1000,22968=>1000,22969=>1000,22970=>1000,22971=>1000,22972=>1000,22973=>1000,22974=>1000,22975=>1000,22976=>1000,22977=>1000,22978=>1000,22979=>1000,22980=>1000, - 22981=>1000,22982=>1000,22983=>1000,22984=>1000,22985=>1000,22986=>1000,22987=>1000,22988=>1000,22989=>1000,22990=>1000,22991=>1000,22992=>1000,22993=>1000,22994=>1000,22995=>1000,22996=>1000, - 22997=>1000,22998=>1000,22999=>1000,23000=>1000,23001=>1000,23002=>1000,23003=>1000,23004=>1000,23005=>1000,23006=>1000,23007=>1000,23008=>1000,23009=>1000,23010=>1000,23011=>1000,23012=>1000, - 23013=>1000,23014=>1000,23015=>1000,23016=>1000,23017=>1000,23018=>1000,23019=>1000,23020=>1000,23021=>1000,23022=>1000,23023=>1000,23024=>1000,23025=>1000,23026=>1000,23027=>1000,23028=>1000, - 23029=>1000,23030=>1000,23031=>1000,23032=>1000,23033=>1000,23034=>1000,23035=>1000,23036=>1000,23037=>1000,23038=>1000,23039=>1000,23040=>1000,23041=>1000,23042=>1000,23043=>1000,23044=>1000, - 23045=>1000,23046=>1000,23047=>1000,23048=>1000,23049=>1000,23050=>1000,23051=>1000,23052=>1000,23053=>1000,23054=>1000,23055=>1000,23056=>1000,23057=>1000,23058=>1000,23059=>1000,23060=>1000, - 23061=>1000,23062=>1000,23063=>1000,23064=>1000,23065=>1000,23066=>1000,23067=>1000,23068=>1000,23069=>1000,23070=>1000,23071=>1000,23072=>1000,23073=>1000,23074=>1000,23075=>1000,23076=>1000, - 23077=>1000,23078=>1000,23079=>1000,23080=>1000,23081=>1000,23082=>1000,23083=>1000,23084=>1000,23085=>1000,23086=>1000,23087=>1000,23088=>1000,23089=>1000,23090=>1000,23091=>1000,23092=>1000, - 23093=>1000,23094=>1000,23095=>1000,23096=>1000,23097=>1000,23098=>1000,23099=>1000,23100=>1000,23101=>1000,23102=>1000,23103=>1000,23104=>1000,23105=>1000,23106=>1000,23107=>1000,23108=>1000, - 23109=>1000,23110=>1000,23111=>1000,23112=>1000,23113=>1000,23114=>1000,23115=>1000,23116=>1000,23117=>1000,23118=>1000,23119=>1000,23120=>1000,23121=>1000,23122=>1000,23123=>1000,23124=>1000, - 23125=>1000,23126=>1000,23127=>1000,23128=>1000,23129=>1000,23130=>1000,23131=>1000,23132=>1000,23133=>1000,23134=>1000,23135=>1000,23136=>1000,23137=>1000,23138=>1000,23139=>1000,23140=>1000, - 23141=>1000,23142=>1000,23143=>1000,23144=>1000,23145=>1000,23146=>1000,23147=>1000,23148=>1000,23149=>1000,23150=>1000,23151=>1000,23152=>1000,23153=>1000,23154=>1000,23155=>1000,23156=>1000, - 23157=>1000,23158=>1000,23159=>1000,23160=>1000,23161=>1000,23162=>1000,23163=>1000,23164=>1000,23165=>1000,23166=>1000,23167=>1000,23168=>1000,23169=>1000,23170=>1000,23171=>1000,23172=>1000, - 23173=>1000,23174=>1000,23175=>1000,23176=>1000,23177=>1000,23178=>1000,23179=>1000,23180=>1000,23181=>1000,23182=>1000,23183=>1000,23184=>1000,23185=>1000,23186=>1000,23187=>1000,23188=>1000, - 23189=>1000,23190=>1000,23191=>1000,23192=>1000,23193=>1000,23194=>1000,23195=>1000,23196=>1000,23197=>1000,23198=>1000,23199=>1000,23200=>1000,23201=>1000,23202=>1000,23203=>1000,23204=>1000, - 23205=>1000,23206=>1000,23207=>1000,23208=>1000,23209=>1000,23210=>1000,23211=>1000,23212=>1000,23213=>1000,23214=>1000,23215=>1000,23216=>1000,23217=>1000,23218=>1000,23219=>1000,23220=>1000, - 23221=>1000,23222=>1000,23223=>1000,23224=>1000,23225=>1000,23226=>1000,23227=>1000,23228=>1000,23229=>1000,23230=>1000,23231=>1000,23232=>1000,23233=>1000,23234=>1000,23235=>1000,23236=>1000, - 23237=>1000,23238=>1000,23239=>1000,23240=>1000,23241=>1000,23242=>1000,23243=>1000,23244=>1000,23245=>1000,23246=>1000,23247=>1000,23248=>1000,23249=>1000,23250=>1000,23251=>1000,23252=>1000, - 23253=>1000,23254=>1000,23255=>1000,23256=>1000,23257=>1000,23258=>1000,23259=>1000,23260=>1000,23261=>1000,23262=>1000,23263=>1000,23264=>1000,23265=>1000,23266=>1000,23267=>1000,23268=>1000, - 23269=>1000,23270=>1000,23271=>1000,23272=>1000,23273=>1000,23274=>1000,23275=>1000,23276=>1000,23277=>1000,23278=>1000,23279=>1000,23280=>1000,23281=>1000,23282=>1000,23283=>1000,23284=>1000, - 23285=>1000,23286=>1000,23287=>1000,23288=>1000,23289=>1000,23290=>1000,23291=>1000,23292=>1000,23293=>1000,23294=>1000,23295=>1000,23296=>1000,23297=>1000,23298=>1000,23299=>1000,23300=>1000, - 23301=>1000,23302=>1000,23303=>1000,23304=>1000,23305=>1000,23306=>1000,23307=>1000,23308=>1000,23309=>1000,23310=>1000,23311=>1000,23312=>1000,23313=>1000,23314=>1000,23315=>1000,23316=>1000, - 23317=>1000,23318=>1000,23319=>1000,23320=>1000,23321=>1000,23322=>1000,23323=>1000,23324=>1000,23325=>1000,23326=>1000,23327=>1000,23328=>1000,23329=>1000,23330=>1000,23331=>1000,23332=>1000, - 23333=>1000,23334=>1000,23335=>1000,23336=>1000,23337=>1000,23338=>1000,23339=>1000,23340=>1000,23341=>1000,23342=>1000,23343=>1000,23344=>1000,23345=>1000,23346=>1000,23347=>1000,23348=>1000, - 23349=>1000,23350=>1000,23351=>1000,23352=>1000,23353=>1000,23354=>1000,23355=>1000,23356=>1000,23357=>1000,23358=>1000,23359=>1000,23360=>1000,23361=>1000,23362=>1000,23363=>1000,23364=>1000, - 23365=>1000,23366=>1000,23367=>1000,23368=>1000,23369=>1000,23370=>1000,23371=>1000,23372=>1000,23373=>1000,23374=>1000,23375=>1000,23376=>1000,23377=>1000,23378=>1000,23379=>1000,23380=>1000, - 23381=>1000,23382=>1000,23383=>1000,23384=>1000,23385=>1000,23386=>1000,23387=>1000,23388=>1000,23389=>1000,23390=>1000,23391=>1000,23392=>1000,23393=>1000,23394=>1000,23395=>1000,23396=>1000, - 23397=>1000,23398=>1000,23399=>1000,23400=>1000,23401=>1000,23402=>1000,23403=>1000,23404=>1000,23405=>1000,23406=>1000,23407=>1000,23408=>1000,23409=>1000,23410=>1000,23411=>1000,23412=>1000, - 23413=>1000,23414=>1000,23415=>1000,23416=>1000,23417=>1000,23418=>1000,23419=>1000,23420=>1000,23421=>1000,23422=>1000,23423=>1000,23424=>1000,23425=>1000,23426=>1000,23427=>1000,23428=>1000, - 23429=>1000,23430=>1000,23431=>1000,23432=>1000,23433=>1000,23434=>1000,23435=>1000,23436=>1000,23437=>1000,23438=>1000,23439=>1000,23440=>1000,23441=>1000,23442=>1000,23443=>1000,23444=>1000, - 23445=>1000,23446=>1000,23447=>1000,23448=>1000,23449=>1000,23450=>1000,23451=>1000,23452=>1000,23453=>1000,23454=>1000,23455=>1000,23456=>1000,23457=>1000,23458=>1000,23459=>1000,23460=>1000, - 23461=>1000,23462=>1000,23463=>1000,23464=>1000,23465=>1000,23466=>1000,23467=>1000,23468=>1000,23469=>1000,23470=>1000,23471=>1000,23472=>1000,23473=>1000,23474=>1000,23475=>1000,23476=>1000, - 23477=>1000,23478=>1000,23479=>1000,23480=>1000,23481=>1000,23482=>1000,23483=>1000,23484=>1000,23485=>1000,23486=>1000,23487=>1000,23488=>1000,23489=>1000,23490=>1000,23491=>1000,23492=>1000, - 23493=>1000,23494=>1000,23495=>1000,23496=>1000,23497=>1000,23498=>1000,23499=>1000,23500=>1000,23501=>1000,23502=>1000,23503=>1000,23504=>1000,23505=>1000,23506=>1000,23507=>1000,23508=>1000, - 23509=>1000,23510=>1000,23511=>1000,23512=>1000,23513=>1000,23514=>1000,23515=>1000,23516=>1000,23517=>1000,23518=>1000,23519=>1000,23520=>1000,23521=>1000,23522=>1000,23523=>1000,23524=>1000, - 23525=>1000,23526=>1000,23527=>1000,23528=>1000,23529=>1000,23530=>1000,23531=>1000,23532=>1000,23533=>1000,23534=>1000,23535=>1000,23536=>1000,23537=>1000,23538=>1000,23539=>1000,23540=>1000, - 23541=>1000,23542=>1000,23543=>1000,23544=>1000,23545=>1000,23546=>1000,23547=>1000,23548=>1000,23549=>1000,23550=>1000,23551=>1000,23552=>1000,23553=>1000,23554=>1000,23555=>1000,23556=>1000, - 23557=>1000,23558=>1000,23559=>1000,23560=>1000,23561=>1000,23562=>1000,23563=>1000,23564=>1000,23565=>1000,23566=>1000,23567=>1000,23568=>1000,23569=>1000,23570=>1000,23571=>1000,23572=>1000, - 23573=>1000,23574=>1000,23575=>1000,23576=>1000,23577=>1000,23578=>1000,23579=>1000,23580=>1000,23581=>1000,23582=>1000,23583=>1000,23584=>1000,23585=>1000,23586=>1000,23587=>1000,23588=>1000, - 23589=>1000,23590=>1000,23591=>1000,23592=>1000,23593=>1000,23594=>1000,23595=>1000,23596=>1000,23597=>1000,23598=>1000,23599=>1000,23600=>1000,23601=>1000,23602=>1000,23603=>1000,23604=>1000, - 23605=>1000,23606=>1000,23607=>1000,23608=>1000,23609=>1000,23610=>1000,23611=>1000,23612=>1000,23613=>1000,23614=>1000,23615=>1000,23616=>1000,23617=>1000,23618=>1000,23619=>1000,23620=>1000, - 23621=>1000,23622=>1000,23623=>1000,23624=>1000,23625=>1000,23626=>1000,23627=>1000,23628=>1000,23629=>1000,23630=>1000,23631=>1000,23632=>1000,23633=>1000,23634=>1000,23635=>1000,23636=>1000, - 23637=>1000,23638=>1000,23639=>1000,23640=>1000,23641=>1000,23642=>1000,23643=>1000,23644=>1000,23645=>1000,23646=>1000,23647=>1000,23648=>1000,23649=>1000,23650=>1000,23651=>1000,23652=>1000, - 23653=>1000,23654=>1000,23655=>1000,23656=>1000,23657=>1000,23658=>1000,23659=>1000,23660=>1000,23661=>1000,23662=>1000,23663=>1000,23664=>1000,23665=>1000,23666=>1000,23667=>1000,23668=>1000, - 23669=>1000,23670=>1000,23671=>1000,23672=>1000,23673=>1000,23674=>1000,23675=>1000,23676=>1000,23677=>1000,23678=>1000,23679=>1000,23680=>1000,23681=>1000,23682=>1000,23683=>1000,23684=>1000, - 23685=>1000,23686=>1000,23687=>1000,23688=>1000,23689=>1000,23690=>1000,23691=>1000,23692=>1000,23693=>1000,23694=>1000,23695=>1000,23696=>1000,23697=>1000,23698=>1000,23699=>1000,23700=>1000, - 23701=>1000,23702=>1000,23703=>1000,23704=>1000,23705=>1000,23706=>1000,23707=>1000,23708=>1000,23709=>1000,23710=>1000,23711=>1000,23712=>1000,23713=>1000,23714=>1000,23715=>1000,23716=>1000, - 23717=>1000,23718=>1000,23719=>1000,23720=>1000,23721=>1000,23722=>1000,23723=>1000,23724=>1000,23725=>1000,23726=>1000,23727=>1000,23728=>1000,23729=>1000,23730=>1000,23731=>1000,23732=>1000, - 23733=>1000,23734=>1000,23735=>1000,23736=>1000,23737=>1000,23738=>1000,23739=>1000,23740=>1000,23741=>1000,23742=>1000,23743=>1000,23744=>1000,23745=>1000,23746=>1000,23747=>1000,23748=>1000, - 23749=>1000,23750=>1000,23751=>1000,23752=>1000,23753=>1000,23754=>1000,23755=>1000,23756=>1000,23757=>1000,23758=>1000,23759=>1000,23760=>1000,23761=>1000,23762=>1000,23763=>1000,23764=>1000, - 23765=>1000,23766=>1000,23767=>1000,23768=>1000,23769=>1000,23770=>1000,23771=>1000,23772=>1000,23773=>1000,23774=>1000,23775=>1000,23776=>1000,23777=>1000,23778=>1000,23779=>1000,23780=>1000, - 23781=>1000,23782=>1000,23783=>1000,23784=>1000,23785=>1000,23786=>1000,23787=>1000,23788=>1000,23789=>1000,23790=>1000,23791=>1000,23792=>1000,23793=>1000,23794=>1000,23795=>1000,23796=>1000, - 23797=>1000,23798=>1000,23799=>1000,23800=>1000,23801=>1000,23802=>1000,23803=>1000,23804=>1000,23805=>1000,23806=>1000,23807=>1000,23808=>1000,23809=>1000,23810=>1000,23811=>1000,23812=>1000, - 23813=>1000,23814=>1000,23815=>1000,23816=>1000,23817=>1000,23818=>1000,23819=>1000,23820=>1000,23821=>1000,23822=>1000,23823=>1000,23824=>1000,23825=>1000,23826=>1000,23827=>1000,23828=>1000, - 23829=>1000,23830=>1000,23831=>1000,23832=>1000,23833=>1000,23834=>1000,23835=>1000,23836=>1000,23837=>1000,23838=>1000,23839=>1000,23840=>1000,23841=>1000,23842=>1000,23843=>1000,23844=>1000, - 23845=>1000,23846=>1000,23847=>1000,23848=>1000,23849=>1000,23850=>1000,23851=>1000,23852=>1000,23853=>1000,23854=>1000,23855=>1000,23856=>1000,23857=>1000,23858=>1000,23859=>1000,23860=>1000, - 23861=>1000,23862=>1000,23863=>1000,23864=>1000,23865=>1000,23866=>1000,23867=>1000,23868=>1000,23869=>1000,23870=>1000,23871=>1000,23872=>1000,23873=>1000,23874=>1000,23875=>1000,23876=>1000, - 23877=>1000,23878=>1000,23879=>1000,23880=>1000,23881=>1000,23882=>1000,23883=>1000,23884=>1000,23885=>1000,23886=>1000,23887=>1000,23888=>1000,23889=>1000,23890=>1000,23891=>1000,23892=>1000, - 23893=>1000,23894=>1000,23895=>1000,23896=>1000,23897=>1000,23898=>1000,23899=>1000,23900=>1000,23901=>1000,23902=>1000,23903=>1000,23904=>1000,23905=>1000,23906=>1000,23907=>1000,23908=>1000, - 23909=>1000,23910=>1000,23911=>1000,23912=>1000,23913=>1000,23914=>1000,23915=>1000,23916=>1000,23917=>1000,23918=>1000,23919=>1000,23920=>1000,23921=>1000,23922=>1000,23923=>1000,23924=>1000, - 23925=>1000,23926=>1000,23927=>1000,23928=>1000,23929=>1000,23930=>1000,23931=>1000,23932=>1000,23933=>1000,23934=>1000,23935=>1000,23936=>1000,23937=>1000,23938=>1000,23939=>1000,23940=>1000, - 23941=>1000,23942=>1000,23943=>1000,23944=>1000,23945=>1000,23946=>1000,23947=>1000,23948=>1000,23949=>1000,23950=>1000,23951=>1000,23952=>1000,23953=>1000,23954=>1000,23955=>1000,23956=>1000, - 23957=>1000,23958=>1000,23959=>1000,23960=>1000,23961=>1000,23962=>1000,23963=>1000,23964=>1000,23965=>1000,23966=>1000,23967=>1000,23968=>1000,23969=>1000,23970=>1000,23971=>1000,23972=>1000, - 23973=>1000,23974=>1000,23975=>1000,23976=>1000,23977=>1000,23978=>1000,23979=>1000,23980=>1000,23981=>1000,23982=>1000,23983=>1000,23984=>1000,23985=>1000,23986=>1000,23987=>1000,23988=>1000, - 23989=>1000,23990=>1000,23991=>1000,23992=>1000,23993=>1000,23994=>1000,23995=>1000,23996=>1000,23997=>1000,23998=>1000,23999=>1000,24000=>1000,24001=>1000,24002=>1000,24003=>1000,24004=>1000, - 24005=>1000,24006=>1000,24007=>1000,24008=>1000,24009=>1000,24010=>1000,24011=>1000,24012=>1000,24013=>1000,24014=>1000,24015=>1000,24016=>1000,24017=>1000,24018=>1000,24019=>1000,24020=>1000, - 24021=>1000,24022=>1000,24023=>1000,24024=>1000,24025=>1000,24026=>1000,24027=>1000,24028=>1000,24029=>1000,24030=>1000,24031=>1000,24032=>1000,24033=>1000,24034=>1000,24035=>1000,24036=>1000, - 24037=>1000,24038=>1000,24039=>1000,24040=>1000,24041=>1000,24042=>1000,24043=>1000,24044=>1000,24045=>1000,24046=>1000,24047=>1000,24048=>1000,24049=>1000,24050=>1000,24051=>1000,24052=>1000, - 24053=>1000,24054=>1000,24055=>1000,24056=>1000,24057=>1000,24058=>1000,24059=>1000,24060=>1000,24061=>1000,24062=>1000,24063=>1000,24064=>1000,24065=>1000,24066=>1000,24067=>1000,24068=>1000, - 24069=>1000,24070=>1000,24071=>1000,24072=>1000,24073=>1000,24074=>1000,24075=>1000,24076=>1000,24077=>1000,24078=>1000,24079=>1000,24080=>1000,24081=>1000,24082=>1000,24083=>1000,24084=>1000, - 24085=>1000,24086=>1000,24087=>1000,24088=>1000,24089=>1000,24090=>1000,24091=>1000,24092=>1000,24093=>1000,24094=>1000,24095=>1000,24096=>1000,24097=>1000,24098=>1000,24099=>1000,24100=>1000, - 24101=>1000,24102=>1000,24103=>1000,24104=>1000,24105=>1000,24106=>1000,24107=>1000,24108=>1000,24109=>1000,24110=>1000,24111=>1000,24112=>1000,24113=>1000,24114=>1000,24115=>1000,24116=>1000, - 24117=>1000,24118=>1000,24119=>1000,24120=>1000,24121=>1000,24122=>1000,24123=>1000,24124=>1000,24125=>1000,24126=>1000,24127=>1000,24128=>1000,24129=>1000,24130=>1000,24131=>1000,24132=>1000, - 24133=>1000,24134=>1000,24135=>1000,24136=>1000,24137=>1000,24138=>1000,24139=>1000,24140=>1000,24141=>1000,24142=>1000,24143=>1000,24144=>1000,24145=>1000,24146=>1000,24147=>1000,24148=>1000, - 24149=>1000,24150=>1000,24151=>1000,24152=>1000,24153=>1000,24154=>1000,24155=>1000,24156=>1000,24157=>1000,24158=>1000,24159=>1000,24160=>1000,24161=>1000,24162=>1000,24163=>1000,24164=>1000, - 24165=>1000,24166=>1000,24167=>1000,24168=>1000,24169=>1000,24170=>1000,24171=>1000,24172=>1000,24173=>1000,24174=>1000,24175=>1000,24176=>1000,24177=>1000,24178=>1000,24179=>1000,24180=>1000, - 24181=>1000,24182=>1000,24183=>1000,24184=>1000,24185=>1000,24186=>1000,24187=>1000,24188=>1000,24189=>1000,24190=>1000,24191=>1000,24192=>1000,24193=>1000,24194=>1000,24195=>1000,24196=>1000, - 24197=>1000,24198=>1000,24199=>1000,24200=>1000,24201=>1000,24202=>1000,24203=>1000,24204=>1000,24205=>1000,24206=>1000,24207=>1000,24208=>1000,24209=>1000,24210=>1000,24211=>1000,24212=>1000, - 24213=>1000,24214=>1000,24215=>1000,24216=>1000,24217=>1000,24218=>1000,24219=>1000,24220=>1000,24221=>1000,24222=>1000,24223=>1000,24224=>1000,24225=>1000,24226=>1000,24227=>1000,24228=>1000, - 24229=>1000,24230=>1000,24231=>1000,24232=>1000,24233=>1000,24234=>1000,24235=>1000,24236=>1000,24237=>1000,24238=>1000,24239=>1000,24240=>1000,24241=>1000,24242=>1000,24243=>1000,24244=>1000, - 24245=>1000,24246=>1000,24247=>1000,24248=>1000,24249=>1000,24250=>1000,24251=>1000,24252=>1000,24253=>1000,24254=>1000,24255=>1000,24256=>1000,24257=>1000,24258=>1000,24259=>1000,24260=>1000, - 24261=>1000,24262=>1000,24263=>1000,24264=>1000,24265=>1000,24266=>1000,24267=>1000,24268=>1000,24269=>1000,24270=>1000,24271=>1000,24272=>1000,24273=>1000,24274=>1000,24275=>1000,24276=>1000, - 24277=>1000,24278=>1000,24279=>1000,24280=>1000,24281=>1000,24282=>1000,24283=>1000,24284=>1000,24285=>1000,24286=>1000,24287=>1000,24288=>1000,24289=>1000,24290=>1000,24291=>1000,24292=>1000, - 24293=>1000,24294=>1000,24295=>1000,24296=>1000,24297=>1000,24298=>1000,24299=>1000,24300=>1000,24301=>1000,24302=>1000,24303=>1000,24304=>1000,24305=>1000,24306=>1000,24307=>1000,24308=>1000, - 24309=>1000,24310=>1000,24311=>1000,24312=>1000,24313=>1000,24314=>1000,24315=>1000,24316=>1000,24317=>1000,24318=>1000,24319=>1000,24320=>1000,24321=>1000,24322=>1000,24323=>1000,24324=>1000, - 24325=>1000,24326=>1000,24327=>1000,24328=>1000,24329=>1000,24330=>1000,24331=>1000,24332=>1000,24333=>1000,24334=>1000,24335=>1000,24336=>1000,24337=>1000,24338=>1000,24339=>1000,24340=>1000, - 24341=>1000,24342=>1000,24343=>1000,24344=>1000,24345=>1000,24346=>1000,24347=>1000,24348=>1000,24349=>1000,24350=>1000,24351=>1000,24352=>1000,24353=>1000,24354=>1000,24355=>1000,24356=>1000, - 24357=>1000,24358=>1000,24359=>1000,24360=>1000,24361=>1000,24362=>1000,24363=>1000,24364=>1000,24365=>1000,24366=>1000,24367=>1000,24368=>1000,24369=>1000,24370=>1000,24371=>1000,24372=>1000, - 24373=>1000,24374=>1000,24375=>1000,24376=>1000,24377=>1000,24378=>1000,24379=>1000,24380=>1000,24381=>1000,24382=>1000,24383=>1000,24384=>1000,24385=>1000,24386=>1000,24387=>1000,24388=>1000, - 24389=>1000,24390=>1000,24391=>1000,24392=>1000,24393=>1000,24394=>1000,24395=>1000,24396=>1000,24397=>1000,24398=>1000,24399=>1000,24400=>1000,24401=>1000,24402=>1000,24403=>1000,24404=>1000, - 24405=>1000,24406=>1000,24407=>1000,24408=>1000,24409=>1000,24410=>1000,24411=>1000,24412=>1000,24413=>1000,24414=>1000,24415=>1000,24416=>1000,24417=>1000,24418=>1000,24419=>1000,24420=>1000, - 24421=>1000,24422=>1000,24423=>1000,24424=>1000,24425=>1000,24426=>1000,24427=>1000,24428=>1000,24429=>1000,24430=>1000,24431=>1000,24432=>1000,24433=>1000,24434=>1000,24435=>1000,24436=>1000, - 24437=>1000,24438=>1000,24439=>1000,24440=>1000,24441=>1000,24442=>1000,24443=>1000,24444=>1000,24445=>1000,24446=>1000,24447=>1000,24448=>1000,24449=>1000,24450=>1000,24451=>1000,24452=>1000, - 24453=>1000,24454=>1000,24455=>1000,24456=>1000,24457=>1000,24458=>1000,24459=>1000,24460=>1000,24461=>1000,24462=>1000,24463=>1000,24464=>1000,24465=>1000,24466=>1000,24467=>1000,24468=>1000, - 24469=>1000,24470=>1000,24471=>1000,24472=>1000,24473=>1000,24474=>1000,24475=>1000,24476=>1000,24477=>1000,24478=>1000,24479=>1000,24480=>1000,24481=>1000,24482=>1000,24483=>1000,24484=>1000, - 24485=>1000,24486=>1000,24487=>1000,24488=>1000,24489=>1000,24490=>1000,24491=>1000,24492=>1000,24493=>1000,24494=>1000,24495=>1000,24496=>1000,24497=>1000,24498=>1000,24499=>1000,24500=>1000, - 24501=>1000,24502=>1000,24503=>1000,24504=>1000,24505=>1000,24506=>1000,24507=>1000,24508=>1000,24509=>1000,24510=>1000,24511=>1000,24512=>1000,24513=>1000,24514=>1000,24515=>1000,24516=>1000, - 24517=>1000,24518=>1000,24519=>1000,24520=>1000,24521=>1000,24522=>1000,24523=>1000,24524=>1000,24525=>1000,24526=>1000,24527=>1000,24528=>1000,24529=>1000,24530=>1000,24531=>1000,24532=>1000, - 24533=>1000,24534=>1000,24535=>1000,24536=>1000,24537=>1000,24538=>1000,24539=>1000,24540=>1000,24541=>1000,24542=>1000,24543=>1000,24544=>1000,24545=>1000,24546=>1000,24547=>1000,24548=>1000, - 24549=>1000,24550=>1000,24551=>1000,24552=>1000,24553=>1000,24554=>1000,24555=>1000,24556=>1000,24557=>1000,24558=>1000,24559=>1000,24560=>1000,24561=>1000,24562=>1000,24563=>1000,24564=>1000, - 24565=>1000,24566=>1000,24567=>1000,24568=>1000,24569=>1000,24570=>1000,24571=>1000,24572=>1000,24573=>1000,24574=>1000,24575=>1000,24576=>1000,24577=>1000,24578=>1000,24579=>1000,24580=>1000, - 24581=>1000,24582=>1000,24583=>1000,24584=>1000,24585=>1000,24586=>1000,24587=>1000,24588=>1000,24589=>1000,24590=>1000,24591=>1000,24592=>1000,24593=>1000,24594=>1000,24595=>1000,24596=>1000, - 24597=>1000,24598=>1000,24599=>1000,24600=>1000,24601=>1000,24602=>1000,24603=>1000,24604=>1000,24605=>1000,24606=>1000,24607=>1000,24608=>1000,24609=>1000,24610=>1000,24611=>1000,24612=>1000, - 24613=>1000,24614=>1000,24615=>1000,24616=>1000,24617=>1000,24618=>1000,24619=>1000,24620=>1000,24621=>1000,24622=>1000,24623=>1000,24624=>1000,24625=>1000,24626=>1000,24627=>1000,24628=>1000, - 24629=>1000,24630=>1000,24631=>1000,24632=>1000,24633=>1000,24634=>1000,24635=>1000,24636=>1000,24637=>1000,24638=>1000,24639=>1000,24640=>1000,24641=>1000,24642=>1000,24643=>1000,24644=>1000, - 24645=>1000,24646=>1000,24647=>1000,24648=>1000,24649=>1000,24650=>1000,24651=>1000,24652=>1000,24653=>1000,24654=>1000,24655=>1000,24656=>1000,24657=>1000,24658=>1000,24659=>1000,24660=>1000, - 24661=>1000,24662=>1000,24663=>1000,24664=>1000,24665=>1000,24666=>1000,24667=>1000,24668=>1000,24669=>1000,24670=>1000,24671=>1000,24672=>1000,24673=>1000,24674=>1000,24675=>1000,24676=>1000, - 24677=>1000,24678=>1000,24679=>1000,24680=>1000,24681=>1000,24682=>1000,24683=>1000,24684=>1000,24685=>1000,24686=>1000,24687=>1000,24688=>1000,24689=>1000,24690=>1000,24691=>1000,24692=>1000, - 24693=>1000,24694=>1000,24695=>1000,24696=>1000,24697=>1000,24698=>1000,24699=>1000,24700=>1000,24701=>1000,24702=>1000,24703=>1000,24704=>1000,24705=>1000,24706=>1000,24707=>1000,24708=>1000, - 24709=>1000,24710=>1000,24711=>1000,24712=>1000,24713=>1000,24714=>1000,24715=>1000,24716=>1000,24717=>1000,24718=>1000,24719=>1000,24720=>1000,24721=>1000,24722=>1000,24723=>1000,24724=>1000, - 24725=>1000,24726=>1000,24727=>1000,24728=>1000,24729=>1000,24730=>1000,24731=>1000,24732=>1000,24733=>1000,24734=>1000,24735=>1000,24736=>1000,24737=>1000,24738=>1000,24739=>1000,24740=>1000, - 24741=>1000,24742=>1000,24743=>1000,24744=>1000,24745=>1000,24746=>1000,24747=>1000,24748=>1000,24749=>1000,24750=>1000,24751=>1000,24752=>1000,24753=>1000,24754=>1000,24755=>1000,24756=>1000, - 24757=>1000,24758=>1000,24759=>1000,24760=>1000,24761=>1000,24762=>1000,24763=>1000,24764=>1000,24765=>1000,24766=>1000,24767=>1000,24768=>1000,24769=>1000,24770=>1000,24771=>1000,24772=>1000, - 24773=>1000,24774=>1000,24775=>1000,24776=>1000,24777=>1000,24778=>1000,24779=>1000,24780=>1000,24781=>1000,24782=>1000,24783=>1000,24784=>1000,24785=>1000,24786=>1000,24787=>1000,24788=>1000, - 24789=>1000,24790=>1000,24791=>1000,24792=>1000,24793=>1000,24794=>1000,24795=>1000,24796=>1000,24797=>1000,24798=>1000,24799=>1000,24800=>1000,24801=>1000,24802=>1000,24803=>1000,24804=>1000, - 24805=>1000,24806=>1000,24807=>1000,24808=>1000,24809=>1000,24810=>1000,24811=>1000,24812=>1000,24813=>1000,24814=>1000,24815=>1000,24816=>1000,24817=>1000,24818=>1000,24819=>1000,24820=>1000, - 24821=>1000,24822=>1000,24823=>1000,24824=>1000,24825=>1000,24826=>1000,24827=>1000,24828=>1000,24829=>1000,24830=>1000,24831=>1000,24832=>1000,24833=>1000,24834=>1000,24835=>1000,24836=>1000, - 24837=>1000,24838=>1000,24839=>1000,24840=>1000,24841=>1000,24842=>1000,24843=>1000,24844=>1000,24845=>1000,24846=>1000,24847=>1000,24848=>1000,24849=>1000,24850=>1000,24851=>1000,24852=>1000, - 24853=>1000,24854=>1000,24855=>1000,24856=>1000,24857=>1000,24858=>1000,24859=>1000,24860=>1000,24861=>1000,24862=>1000,24863=>1000,24864=>1000,24865=>1000,24866=>1000,24867=>1000,24868=>1000, - 24869=>1000,24870=>1000,24871=>1000,24872=>1000,24873=>1000,24874=>1000,24875=>1000,24876=>1000,24877=>1000,24878=>1000,24879=>1000,24880=>1000,24881=>1000,24882=>1000,24883=>1000,24884=>1000, - 24885=>1000,24886=>1000,24887=>1000,24888=>1000,24889=>1000,24890=>1000,24891=>1000,24892=>1000,24893=>1000,24894=>1000,24895=>1000,24896=>1000,24897=>1000,24898=>1000,24899=>1000,24900=>1000, - 24901=>1000,24902=>1000,24903=>1000,24904=>1000,24905=>1000,24906=>1000,24907=>1000,24908=>1000,24909=>1000,24910=>1000,24911=>1000,24912=>1000,24913=>1000,24914=>1000,24915=>1000,24916=>1000, - 24917=>1000,24918=>1000,24919=>1000,24920=>1000,24921=>1000,24922=>1000,24923=>1000,24924=>1000,24925=>1000,24926=>1000,24927=>1000,24928=>1000,24929=>1000,24930=>1000,24931=>1000,24932=>1000, - 24933=>1000,24934=>1000,24935=>1000,24936=>1000,24937=>1000,24938=>1000,24939=>1000,24940=>1000,24941=>1000,24942=>1000,24943=>1000,24944=>1000,24945=>1000,24946=>1000,24947=>1000,24948=>1000, - 24949=>1000,24950=>1000,24951=>1000,24952=>1000,24953=>1000,24954=>1000,24955=>1000,24956=>1000,24957=>1000,24958=>1000,24959=>1000,24960=>1000,24961=>1001,24962=>1000,24963=>1000,24964=>1000, - 24965=>1000,24966=>1000,24967=>1000,24968=>1000,24969=>1000,24970=>1000,24971=>1000,24972=>1000,24973=>1000,24974=>1000,24975=>1000,24976=>1000,24977=>1000,24978=>1000,24979=>1000,24980=>1000, - 24981=>1000,24982=>1000,24983=>1000,24984=>1000,24985=>1000,24986=>1000,24987=>1000,24988=>1000,24989=>1000,24990=>1000,24991=>1000,24992=>1000,24993=>1000,24994=>1000,24995=>1000,24996=>1000, - 24997=>1000,24998=>1000,24999=>1000,25000=>1000,25001=>1000,25002=>1000,25003=>1000,25004=>1000,25005=>1000,25006=>1000,25007=>1000,25008=>1000,25009=>1000,25010=>1000,25011=>1000,25012=>1000, - 25013=>1000,25014=>1000,25015=>1000,25016=>1000,25017=>1000,25018=>1000,25019=>1000,25020=>1000,25021=>1000,25022=>1000,25023=>1000,25024=>1000,25025=>1000,25026=>1000,25027=>1000,25028=>1000, - 25029=>1000,25030=>1000,25031=>1000,25032=>1000,25033=>1000,25034=>1000,25035=>1000,25036=>1000,25037=>1000,25038=>1000,25039=>1000,25040=>1000,25041=>1000,25042=>1000,25043=>1000,25044=>1000, - 25045=>1000,25046=>1000,25047=>1000,25048=>1000,25049=>1000,25050=>1000,25051=>1000,25052=>1000,25053=>1000,25054=>1000,25055=>1000,25056=>1000,25057=>1000,25058=>1000,25059=>1000,25060=>1000, - 25061=>1000,25062=>1000,25063=>1000,25064=>1000,25065=>1000,25066=>1000,25067=>1000,25068=>1000,25069=>1000,25070=>1000,25071=>1000,25072=>1000,25073=>1000,25074=>1000,25075=>1000,25076=>1000, - 25077=>1000,25078=>1000,25079=>1000,25080=>1000,25081=>1000,25082=>1000,25083=>1000,25084=>1000,25085=>1000,25086=>1000,25087=>1000,25088=>1000,25089=>1000,25090=>1000,25091=>1000,25092=>1000, - 25093=>1000,25094=>1000,25095=>1000,25096=>1000,25097=>1000,25098=>1000,25099=>1000,25100=>1000,25101=>1000,25102=>1000,25103=>1000,25104=>1000,25105=>1000,25106=>1000,25107=>1000,25108=>1000, - 25109=>1000,25110=>1000,25111=>1000,25112=>1000,25113=>1000,25114=>1000,25115=>1000,25116=>1000,25117=>1000,25118=>1000,25119=>1000,25120=>1000,25121=>1000,25122=>1000,25123=>1000,25124=>1000, - 25125=>1000,25126=>1000,25127=>1000,25128=>1000,25129=>1000,25130=>1000,25131=>1000,25132=>1000,25133=>1000,25134=>1000,25135=>1000,25136=>1000,25137=>1000,25138=>1000,25139=>1000,25140=>1000, - 25141=>1000,25142=>1000,25143=>1000,25144=>1000,25145=>1000,25146=>1000,25147=>1000,25148=>1000,25149=>1000,25150=>1000,25151=>1000,25152=>1000,25153=>1000,25154=>1000,25155=>1000,25156=>1000, - 25157=>1000,25158=>1000,25159=>1000,25160=>1000,25161=>1000,25162=>1000,25163=>1000,25164=>1000,25165=>1000,25166=>1000,25167=>1000,25168=>1000,25169=>1000,25170=>1000,25171=>1000,25172=>1000, - 25173=>1000,25174=>1000,25175=>1000,25176=>1000,25177=>1000,25178=>1000,25179=>1000,25180=>1000,25181=>1000,25182=>1000,25183=>1000,25184=>1000,25185=>1000,25186=>1000,25187=>1000,25188=>1000, - 25189=>1000,25190=>1000,25191=>1000,25192=>1000,25193=>1000,25194=>1000,25195=>1000,25196=>1000,25197=>1000,25198=>1000,25199=>1000,25200=>1000,25201=>1000,25202=>1000,25203=>1000,25204=>1000, - 25205=>1000,25206=>1000,25207=>1000,25208=>1000,25209=>1000,25210=>1000,25211=>1000,25212=>1000,25213=>1000,25214=>1000,25215=>1000,25216=>1000,25217=>1000,25218=>1000,25219=>1000,25220=>1000, - 25221=>1000,25222=>1000,25223=>1000,25224=>1000,25225=>1000,25226=>1000,25227=>1000,25228=>1000,25229=>1000,25230=>1000,25231=>1000,25232=>1000,25233=>1000,25234=>1000,25235=>1000,25236=>1000, - 25237=>1000,25238=>1000,25239=>1000,25240=>1000,25241=>1000,25242=>1000,25243=>1000,25244=>1000,25245=>1000,25246=>1000,25247=>1000,25248=>1000,25249=>1000,25250=>1000,25251=>1000,25252=>1000, - 25253=>1000,25254=>1000,25255=>1000,25256=>1000,25257=>1000,25258=>1000,25259=>1000,25260=>1000,25261=>1000,25262=>1000,25263=>1000,25264=>1000,25265=>1000,25266=>1000,25267=>1000,25268=>1000, - 25269=>1000,25270=>1000,25271=>1000,25272=>1000,25273=>1000,25274=>1000,25275=>1000,25276=>1000,25277=>1000,25278=>1000,25279=>1000,25280=>1000,25281=>1000,25282=>1000,25283=>1000,25284=>1000, - 25285=>1000,25286=>1000,25287=>1000,25288=>1000,25289=>1000,25290=>1000,25291=>1000,25292=>1000,25293=>1000,25294=>1000,25295=>1000,25296=>1000,25297=>1000,25298=>1000,25299=>1000,25300=>1000, - 25301=>1000,25302=>1000,25303=>1000,25304=>1000,25305=>1000,25306=>1000,25307=>1000,25308=>1000,25309=>1000,25310=>1000,25311=>1000,25312=>1000,25313=>1000,25314=>1000,25315=>1000,25316=>1000, - 25317=>1000,25318=>1000,25319=>1000,25320=>1000,25321=>1000,25322=>1000,25323=>1000,25324=>1000,25325=>1000,25326=>1000,25327=>1000,25328=>1000,25329=>1000,25330=>1000,25331=>1000,25332=>1000, - 25333=>1000,25334=>1000,25335=>1000,25336=>1000,25337=>1000,25338=>1000,25339=>1000,25340=>1000,25341=>1000,25342=>1000,25343=>1000,25344=>1000,25345=>1000,25346=>1000,25347=>1000,25348=>1000, - 25349=>1000,25350=>1000,25351=>1000,25352=>1000,25353=>1000,25354=>1000,25355=>1000,25356=>1000,25357=>1000,25358=>1000,25359=>1000,25360=>1000,25361=>1000,25362=>1000,25363=>1000,25364=>1000, - 25365=>1000,25366=>1000,25367=>1000,25368=>1000,25369=>1000,25370=>1000,25371=>1000,25372=>1000,25373=>1000,25374=>1000,25375=>1000,25376=>1000,25377=>1000,25378=>1000,25379=>1000,25380=>1000, - 25381=>1000,25382=>1000,25383=>1000,25384=>1000,25385=>1000,25386=>1000,25387=>1000,25388=>1000,25389=>1000,25390=>1000,25391=>1000,25392=>1000,25393=>1000,25394=>1000,25395=>1000,25396=>1000, - 25397=>1000,25398=>1000,25399=>1000,25400=>1000,25401=>1000,25402=>1000,25403=>1000,25404=>1000,25405=>1000,25406=>1000,25407=>1000,25408=>1000,25409=>1000,25410=>1000,25411=>1000,25412=>1000, - 25413=>1000,25414=>1000,25415=>1000,25416=>1000,25417=>1000,25418=>1000,25419=>1000,25420=>1000,25421=>1000,25422=>1000,25423=>1000,25424=>1000,25425=>1000,25426=>1000,25427=>1000,25428=>1000, - 25429=>1000,25430=>1000,25431=>1000,25432=>1000,25433=>1000,25434=>1000,25435=>1000,25436=>1000,25437=>1000,25438=>1000,25439=>1000,25440=>1000,25441=>1000,25442=>1000,25443=>1000,25444=>1000, - 25445=>1000,25446=>1000,25447=>1000,25448=>1000,25449=>1000,25450=>1000,25451=>1000,25452=>1000,25453=>1000,25454=>1000,25455=>1000,25456=>1000,25457=>1000,25458=>1000,25459=>1000,25460=>1000, - 25461=>1000,25462=>1000,25463=>1000,25464=>1000,25465=>1000,25466=>1000,25467=>1000,25468=>1000,25469=>1000,25470=>1000,25471=>1000,25472=>1000,25473=>1000,25474=>1000,25475=>1000,25476=>1000, - 25477=>1000,25478=>1000,25479=>1000,25480=>1000,25481=>1000,25482=>1000,25483=>1000,25484=>1000,25485=>1000,25486=>1000,25487=>1000,25488=>1000,25489=>1000,25490=>1000,25491=>1000,25492=>1000, - 25493=>1000,25494=>1000,25495=>1000,25496=>1000,25497=>1000,25498=>1000,25499=>1000,25500=>1000,25501=>1000,25502=>1000,25503=>1000,25504=>1000,25505=>1000,25506=>1000,25507=>1000,25508=>1000, - 25509=>1000,25510=>1000,25511=>1000,25512=>1000,25513=>1000,25514=>1000,25515=>1000,25516=>1000,25517=>1000,25518=>1000,25519=>1000,25520=>1000,25521=>1000,25522=>1000,25523=>1000,25524=>1000, - 25525=>1000,25526=>1000,25527=>1000,25528=>1000,25529=>1000,25530=>1000,25531=>1000,25532=>1000,25533=>1000,25534=>1000,25535=>1000,25536=>1000,25537=>1000,25538=>1000,25539=>1000,25540=>1000, - 25541=>1000,25542=>1000,25543=>1000,25544=>1000,25545=>1000,25546=>1000,25547=>1000,25548=>1000,25549=>1000,25550=>1000,25551=>1000,25552=>1000,25553=>1000,25554=>1000,25555=>1000,25556=>1000, - 25557=>1000,25558=>1000,25559=>1000,25560=>1000,25561=>1000,25562=>1000,25563=>1000,25564=>1000,25565=>1000,25566=>1000,25567=>1000,25568=>1000,25569=>1000,25570=>1000,25571=>1000,25572=>1000, - 25573=>1000,25574=>1000,25575=>1000,25576=>1000,25577=>1000,25578=>1000,25579=>1000,25580=>1000,25581=>1000,25582=>1000,25583=>1000,25584=>1000,25585=>1000,25586=>1000,25587=>1000,25588=>1000, - 25589=>1000,25590=>1000,25591=>1000,25592=>1000,25593=>1000,25594=>1000,25595=>1000,25596=>1000,25597=>1000,25598=>1000,25599=>1000,25600=>1000,25601=>1000,25602=>1000,25603=>1000,25604=>1000, - 25605=>1000,25606=>1000,25607=>1000,25608=>1000,25609=>1000,25610=>1000,25611=>1000,25612=>1000,25613=>1000,25614=>1000,25615=>1000,25616=>1000,25617=>1000,25618=>1000,25619=>1000,25620=>1000, - 25621=>1000,25622=>1000,25623=>1000,25624=>1000,25625=>1000,25626=>1000,25627=>1000,25628=>1000,25629=>1000,25630=>1000,25631=>1000,25632=>1000,25633=>1000,25634=>1000,25635=>1000,25636=>1000, - 25637=>1000,25638=>1000,25639=>1000,25640=>1000,25641=>1000,25642=>1000,25643=>1000,25644=>1000,25645=>1000,25646=>1000,25647=>1000,25648=>1000,25649=>1000,25650=>1000,25651=>1000,25652=>1000, - 25653=>1000,25654=>1000,25655=>1000,25656=>1000,25657=>1000,25658=>1000,25659=>1000,25660=>1000,25661=>1000,25662=>1000,25663=>1000,25664=>1000,25665=>1000,25666=>1000,25667=>1000,25668=>1000, - 25669=>1000,25670=>1000,25671=>1000,25672=>1000,25673=>1000,25674=>1000,25675=>1000,25676=>1000,25677=>1000,25678=>1000,25679=>1000,25680=>1000,25681=>1000,25682=>1000,25683=>1000,25684=>1000, - 25685=>1000,25686=>1000,25687=>1000,25688=>1000,25689=>1000,25690=>1000,25691=>1000,25692=>1000,25693=>1000,25694=>1000,25695=>1000,25696=>1000,25697=>1000,25698=>1000,25699=>1000,25700=>1000, - 25701=>1000,25702=>1000,25703=>1000,25704=>1000,25705=>1000,25706=>1000,25707=>1000,25708=>1000,25709=>1000,25710=>1000,25711=>1000,25712=>1000,25713=>1000,25714=>1000,25715=>1000,25716=>1000, - 25717=>1000,25718=>1000,25719=>1000,25720=>1000,25721=>1000,25722=>1000,25723=>1000,25724=>1000,25725=>1000,25726=>1000,25727=>1000,25728=>1000,25729=>1000,25730=>1000,25731=>1000,25732=>1000, - 25733=>1000,25734=>1000,25735=>1000,25736=>1000,25737=>1000,25738=>1000,25739=>1000,25740=>1000,25741=>1000,25742=>1000,25743=>1000,25744=>1000,25745=>1000,25746=>1000,25747=>1000,25748=>1000, - 25749=>1000,25750=>1000,25751=>1000,25752=>1000,25753=>1000,25754=>1000,25755=>1000,25756=>1000,25757=>1000,25758=>1000,25759=>1000,25760=>1000,25761=>1000,25762=>1000,25763=>1000,25764=>1000, - 25765=>1000,25766=>1000,25767=>1000,25768=>1000,25769=>1000,25770=>1000,25771=>1000,25772=>1000,25773=>1000,25774=>1000,25775=>1000,25776=>1000,25777=>1000,25778=>1000,25779=>1000,25780=>1000, - 25781=>1000,25782=>1000,25783=>1000,25784=>1000,25785=>1000,25786=>1000,25787=>1000,25788=>1000,25789=>1000,25790=>1000,25791=>1000,25792=>1000,25793=>1000,25794=>1000,25795=>1000,25796=>1000, - 25797=>1000,25798=>1000,25799=>1000,25800=>1000,25801=>1000,25802=>1000,25803=>1000,25804=>1000,25805=>1000,25806=>1000,25807=>1000,25808=>1000,25809=>1000,25810=>1000,25811=>1000,25812=>1000, - 25813=>1000,25814=>1000,25815=>1000,25816=>1000,25817=>1000,25818=>1000,25819=>1000,25820=>1000,25821=>1000,25822=>1000,25823=>1000,25824=>1000,25825=>1000,25826=>1000,25827=>1000,25828=>1000, - 25829=>1000,25830=>1000,25831=>1000,25832=>1000,25833=>1000,25834=>1000,25835=>1000,25836=>1000,25837=>1000,25838=>1000,25839=>1000,25840=>1000,25841=>1000,25842=>1000,25843=>1000,25844=>1000, - 25845=>1000,25846=>1000,25847=>1000,25848=>1000,25849=>1000,25850=>1000,25851=>1000,25852=>1000,25853=>1000,25854=>1000,25855=>1000,25856=>1000,25857=>1000,25858=>1000,25859=>1000,25860=>1000, - 25861=>1000,25862=>1000,25863=>1000,25864=>1000,25865=>1000,25866=>1000,25867=>1000,25868=>1000,25869=>1000,25870=>1000,25871=>1000,25872=>1000,25873=>1000,25874=>1000,25875=>1000,25876=>1000, - 25877=>1000,25878=>1000,25879=>1000,25880=>1000,25881=>1000,25882=>1000,25883=>1000,25884=>1000,25885=>1000,25886=>1000,25887=>1000,25888=>1000,25889=>1000,25890=>1000,25891=>1000,25892=>1000, - 25893=>1000,25894=>1000,25895=>1000,25896=>1000,25897=>1000,25898=>1000,25899=>1000,25900=>1000,25901=>1000,25902=>1000,25903=>1000,25904=>1000,25905=>1000,25906=>1000,25907=>1000,25908=>1000, - 25909=>1000,25910=>1000,25911=>1000,25912=>1000,25913=>1000,25914=>1000,25915=>1000,25916=>1000,25917=>1000,25918=>1000,25919=>1000,25920=>1000,25921=>1000,25922=>1000,25923=>1000,25924=>1000, - 25925=>1000,25926=>1000,25927=>1000,25928=>1000,25929=>1000,25930=>1000,25931=>1000,25932=>1000,25933=>1000,25934=>1000,25935=>1000,25936=>1000,25937=>1000,25938=>1000,25939=>1000,25940=>1000, - 25941=>1000,25942=>1000,25943=>1000,25944=>1000,25945=>1000,25946=>1000,25947=>1000,25948=>1000,25949=>1000,25950=>1000,25951=>1000,25952=>1000,25953=>1000,25954=>1000,25955=>1000,25956=>1000, - 25957=>1000,25958=>1000,25959=>1000,25960=>1000,25961=>1000,25962=>1000,25963=>1000,25964=>1000,25965=>1000,25966=>1000,25967=>1000,25968=>1000,25969=>1000,25970=>1000,25971=>1000,25972=>1000, - 25973=>1000,25974=>1000,25975=>1000,25976=>1000,25977=>1000,25978=>1000,25979=>1000,25980=>1000,25981=>1000,25982=>1000,25983=>1000,25984=>1000,25985=>1000,25986=>1000,25987=>1000,25988=>1000, - 25989=>1000,25990=>1000,25991=>1000,25992=>1000,25993=>1000,25994=>1000,25995=>1000,25996=>1000,25997=>1000,25998=>1000,25999=>1000,26000=>1000,26001=>1000,26002=>1000,26003=>1000,26004=>1000, - 26005=>1000,26006=>1000,26007=>1000,26008=>1000,26009=>1000,26010=>1000,26011=>1000,26012=>1000,26013=>1000,26014=>1000,26015=>1000,26016=>1000,26017=>1000,26018=>1000,26019=>1000,26020=>1000, - 26021=>1000,26022=>1000,26023=>1000,26024=>1000,26025=>1000,26026=>1000,26027=>1000,26028=>1000,26029=>1000,26030=>1000,26031=>1000,26032=>1000,26033=>1000,26034=>1000,26035=>1000,26036=>1000, - 26037=>1000,26038=>1000,26039=>1000,26040=>1000,26041=>1000,26042=>1000,26043=>1000,26044=>1000,26045=>1000,26046=>1000,26047=>1000,26048=>1000,26049=>1000,26050=>1000,26051=>1000,26052=>1000, - 26053=>1000,26054=>1000,26055=>1000,26056=>1000,26057=>1000,26058=>1000,26059=>1000,26060=>1000,26061=>1000,26062=>1000,26063=>1000,26064=>1000,26065=>1000,26066=>1000,26067=>1000,26068=>1000, - 26069=>1000,26070=>1000,26071=>1000,26072=>1000,26073=>1000,26074=>1000,26075=>1000,26076=>1000,26077=>1000,26078=>1000,26079=>1000,26080=>1000,26081=>1000,26082=>1000,26083=>1000,26084=>1000, - 26085=>1000,26086=>1000,26087=>1000,26088=>1000,26089=>1000,26090=>1000,26091=>1000,26092=>1000,26093=>1000,26094=>1000,26095=>1000,26096=>1000,26097=>1000,26098=>1000,26099=>1000,26100=>1000, - 26101=>1000,26102=>1000,26103=>1000,26104=>1000,26105=>1000,26106=>1000,26107=>1000,26108=>1000,26109=>1000,26110=>1000,26111=>1000,26112=>1000,26113=>1000,26114=>1000,26115=>1000,26116=>1000, - 26117=>1000,26118=>1000,26119=>1000,26120=>1000,26121=>1000,26122=>1000,26123=>1000,26124=>1000,26125=>1000,26126=>1000,26127=>1000,26128=>1000,26129=>1000,26130=>1000,26131=>1000,26132=>1000, - 26133=>1000,26134=>1000,26135=>1000,26136=>1000,26137=>1000,26138=>1000,26139=>1000,26140=>1000,26141=>1000,26142=>1000,26143=>1000,26144=>1000,26145=>1000,26146=>1000,26147=>1000,26148=>1000, - 26149=>1000,26150=>1000,26151=>1000,26152=>1000,26153=>1000,26154=>1000,26155=>1000,26156=>1000,26157=>1000,26158=>1000,26159=>1000,26160=>1000,26161=>1000,26162=>1000,26163=>1000,26164=>1000, - 26165=>1000,26166=>1000,26167=>1000,26168=>1000,26169=>1000,26170=>1000,26171=>1000,26172=>1000,26173=>1000,26174=>1000,26175=>1000,26176=>1000,26177=>1000,26178=>1000,26179=>1000,26180=>1000, - 26181=>1000,26182=>1000,26183=>1000,26184=>1000,26185=>1000,26186=>1000,26187=>1000,26188=>1000,26189=>1000,26190=>1000,26191=>1000,26192=>1000,26193=>1000,26194=>1000,26195=>1000,26196=>1000, - 26197=>1000,26198=>1000,26199=>1000,26200=>1000,26201=>1000,26202=>1000,26203=>1000,26204=>1000,26205=>1000,26206=>1000,26207=>1000,26208=>1000,26209=>1000,26210=>1000,26211=>1000,26212=>1000, - 26213=>1000,26214=>1000,26215=>1000,26216=>1000,26217=>1000,26218=>1000,26219=>1000,26220=>1000,26221=>1000,26222=>1000,26223=>1000,26224=>1000,26225=>1000,26226=>1000,26227=>1000,26228=>1000, - 26229=>1000,26230=>1000,26231=>1000,26232=>1000,26233=>1000,26234=>1000,26235=>1000,26236=>1000,26237=>1000,26238=>1000,26239=>1000,26240=>1000,26241=>1000,26242=>1000,26243=>1000,26244=>1000, - 26245=>1000,26246=>1000,26247=>1000,26248=>1000,26249=>1000,26250=>1000,26251=>1000,26252=>1000,26253=>1000,26254=>1000,26255=>1000,26256=>1000,26257=>1000,26258=>1000,26259=>1000,26260=>1000, - 26261=>1000,26262=>1000,26263=>1000,26264=>1000,26265=>1000,26266=>1000,26267=>1000,26268=>1000,26269=>1000,26270=>1000,26271=>1000,26272=>1000,26273=>1000,26274=>1000,26275=>1000,26276=>1000, - 26277=>1000,26278=>1000,26279=>1000,26280=>1000,26281=>1000,26282=>1000,26283=>1000,26284=>1000,26285=>1000,26286=>1000,26287=>1000,26288=>1000,26289=>1000,26290=>1000,26291=>1000,26292=>1000, - 26293=>1000,26294=>1000,26295=>1000,26296=>1000,26297=>1000,26298=>1000,26299=>1000,26300=>1000,26301=>1000,26302=>1000,26303=>1000,26304=>1000,26305=>1000,26306=>1000,26307=>1000,26308=>1000, - 26309=>1000,26310=>1000,26311=>1000,26312=>1000,26313=>1000,26314=>1000,26315=>1000,26316=>1000,26317=>1000,26318=>1000,26319=>1000,26320=>1000,26321=>1000,26322=>1000,26323=>1000,26324=>1000, - 26325=>1000,26326=>1000,26327=>1000,26328=>1000,26329=>1000,26330=>1000,26331=>1000,26332=>1000,26333=>1000,26334=>1000,26335=>1000,26336=>1000,26337=>1000,26338=>1000,26339=>1000,26340=>1000, - 26341=>1000,26342=>1000,26343=>1000,26344=>1000,26345=>1000,26346=>1000,26347=>1000,26348=>1000,26349=>1000,26350=>1000,26351=>1000,26352=>1000,26353=>1000,26354=>1000,26355=>1000,26356=>1000, - 26357=>1000,26358=>1000,26359=>1000,26360=>1000,26361=>1000,26362=>1000,26363=>1000,26364=>1000,26365=>1000,26366=>1000,26367=>1000,26368=>1000,26369=>1000,26370=>1000,26371=>1000,26372=>1000, - 26373=>1000,26374=>1000,26375=>1000,26376=>1000,26377=>1000,26378=>1000,26379=>1000,26380=>1000,26381=>1000,26382=>1000,26383=>1000,26384=>1000,26385=>1000,26386=>1000,26387=>1000,26388=>1000, - 26389=>1000,26390=>1000,26391=>1000,26392=>1000,26393=>1000,26394=>1000,26395=>1000,26396=>1000,26397=>1000,26398=>1000,26399=>1000,26400=>1000,26401=>1000,26402=>1000,26403=>1000,26404=>1000, - 26405=>1000,26406=>1000,26407=>1000,26408=>1000,26409=>1000,26410=>1000,26411=>1000,26412=>1000,26413=>1000,26414=>1000,26415=>1000,26416=>1000,26417=>1000,26418=>1000,26419=>1000,26420=>1000, - 26421=>1000,26422=>1000,26423=>1000,26424=>1000,26425=>1000,26426=>1000,26427=>1000,26428=>1000,26429=>1000,26430=>1000,26431=>1000,26432=>1000,26433=>1000,26434=>1000,26435=>1000,26436=>1000, - 26437=>1000,26438=>1000,26439=>1000,26440=>1000,26441=>1000,26442=>1000,26443=>1000,26444=>1000,26445=>1000,26446=>1000,26447=>1000,26448=>1000,26449=>1000,26450=>1000,26451=>1000,26452=>1000, - 26453=>1000,26454=>1000,26455=>1000,26456=>1000,26457=>1000,26458=>1000,26459=>1000,26460=>1000,26461=>1000,26462=>1000,26463=>1000,26464=>1000,26465=>1000,26466=>1000,26467=>1000,26468=>1000, - 26469=>1000,26470=>1000,26471=>1000,26472=>1000,26473=>1000,26474=>1000,26475=>1000,26476=>1000,26477=>1000,26478=>1000,26479=>1000,26480=>1000,26481=>1000,26482=>1000,26483=>1000,26484=>1000, - 26485=>1000,26486=>1000,26487=>1000,26488=>1000,26489=>1000,26490=>1000,26491=>1000,26492=>1000,26493=>1000,26494=>1000,26495=>1000,26496=>1000,26497=>1000,26498=>1000,26499=>1000,26500=>1000, - 26501=>1000,26502=>1000,26503=>1000,26504=>1000,26505=>1000,26506=>1000,26507=>1000,26508=>1000,26509=>1000,26510=>1000,26511=>1000,26512=>1000,26513=>1000,26514=>1000,26515=>1000,26516=>1000, - 26517=>1000,26518=>1000,26519=>1000,26520=>1000,26521=>1000,26522=>1000,26523=>1000,26524=>1000,26525=>1000,26526=>1000,26527=>1000,26528=>1000,26529=>1000,26530=>1000,26531=>1000,26532=>1000, - 26533=>1000,26534=>1000,26535=>1000,26536=>1000,26537=>1000,26538=>1000,26539=>1000,26540=>1000,26541=>1000,26542=>1000,26543=>1000,26544=>1000,26545=>1000,26546=>1000,26547=>1000,26548=>1000, - 26549=>1000,26550=>1000,26551=>1000,26552=>1000,26553=>1000,26554=>1000,26555=>1000,26556=>1000,26557=>1000,26558=>1000,26559=>1000,26560=>1000,26561=>1000,26562=>1000,26563=>1000,26564=>1000, - 26565=>1000,26566=>1000,26567=>1000,26568=>1000,26569=>1000,26570=>1000,26571=>1000,26572=>1000,26573=>1000,26574=>1000,26575=>1000,26576=>1000,26577=>1000,26578=>1000,26579=>1000,26580=>1000, - 26581=>1000,26582=>1000,26583=>1000,26584=>1000,26585=>1000,26586=>1000,26587=>1000,26588=>1000,26589=>1000,26590=>1000,26591=>1000,26592=>1000,26593=>1000,26594=>1000,26595=>1000,26596=>1000, - 26597=>1000,26598=>1000,26599=>1000,26600=>1000,26601=>1000,26602=>1000,26603=>1000,26604=>1000,26605=>1000,26606=>1000,26607=>1000,26608=>1000,26609=>1000,26610=>1000,26611=>1000,26612=>1000, - 26613=>1000,26614=>1000,26615=>1000,26616=>1000,26617=>1000,26618=>1000,26619=>1000,26620=>1000,26621=>1000,26622=>1000,26623=>1000,26624=>1000,26625=>1000,26626=>1000,26627=>1000,26628=>1000, - 26629=>1000,26630=>1000,26631=>1000,26632=>1000,26633=>1000,26634=>1000,26635=>1000,26636=>1000,26637=>1000,26638=>1000,26639=>1000,26640=>1000,26641=>1000,26642=>1000,26643=>1000,26644=>1000, - 26645=>1000,26646=>1000,26647=>1000,26648=>1000,26649=>1000,26650=>1000,26651=>1000,26652=>1000,26653=>1000,26654=>1000,26655=>1000,26656=>1000,26657=>1000,26658=>1000,26659=>1000,26660=>1000, - 26661=>1000,26662=>1000,26663=>1000,26664=>1000,26665=>1000,26666=>1000,26667=>1000,26668=>1000,26669=>1000,26670=>1000,26671=>1000,26672=>1000,26673=>1000,26674=>1000,26675=>1000,26676=>1000, - 26677=>1000,26678=>1000,26679=>1000,26680=>1000,26681=>1000,26682=>1000,26683=>1000,26684=>1000,26685=>1000,26686=>1000,26687=>1000,26688=>1000,26689=>1000,26690=>1000,26691=>1000,26692=>1000, - 26693=>1000,26694=>1000,26695=>1000,26696=>1000,26697=>1000,26698=>1000,26699=>1000,26700=>1000,26701=>1000,26702=>1000,26703=>1000,26704=>1000,26705=>1000,26706=>1000,26707=>1000,26708=>1000, - 26709=>1000,26710=>1000,26711=>1000,26712=>1000,26713=>1000,26714=>1000,26715=>1000,26716=>1000,26717=>1000,26718=>1000,26719=>1000,26720=>1000,26721=>1000,26722=>1000,26723=>1000,26724=>1000, - 26725=>1000,26726=>1000,26727=>1000,26728=>1000,26729=>1000,26730=>1000,26731=>1000,26732=>1000,26733=>1000,26734=>1000,26735=>1000,26736=>1000,26737=>1000,26738=>1000,26739=>1000,26740=>1000, - 26741=>1000,26742=>1000,26743=>1000,26744=>1000,26745=>1000,26746=>1000,26747=>1000,26748=>1000,26749=>1000,26750=>1000,26751=>1000,26752=>1000,26753=>1000,26754=>1000,26755=>1000,26756=>1000, - 26757=>1000,26758=>1000,26759=>1000,26760=>1000,26761=>1000,26762=>1000,26763=>1000,26764=>1000,26765=>1000,26766=>1000,26767=>1000,26768=>1000,26769=>1000,26770=>1000,26771=>1000,26772=>1000, - 26773=>1000,26774=>1000,26775=>1000,26776=>1000,26777=>1000,26778=>1000,26779=>1000,26780=>1000,26781=>1000,26782=>1000,26783=>1000,26784=>1000,26785=>1000,26786=>1000,26787=>1000,26788=>1000, - 26789=>1000,26790=>1000,26791=>1000,26792=>1000,26793=>1000,26794=>1000,26795=>1000,26796=>1000,26797=>1000,26798=>1000,26799=>1000,26800=>1000,26801=>1000,26802=>1000,26803=>1000,26804=>1000, - 26805=>1000,26806=>1000,26807=>1000,26808=>1000,26809=>1000,26810=>1000,26811=>1000,26812=>1000,26813=>1000,26814=>1000,26815=>1000,26816=>1000,26817=>1000,26818=>1000,26819=>1000,26820=>1000, - 26821=>1000,26822=>1000,26823=>1000,26824=>1000,26825=>1000,26826=>1000,26827=>1000,26828=>1000,26829=>1000,26830=>1000,26831=>1000,26832=>1000,26833=>1000,26834=>1000,26835=>1000,26836=>1000, - 26837=>1000,26838=>1000,26839=>1000,26840=>1000,26841=>1000,26842=>1000,26843=>1000,26844=>1000,26845=>1000,26846=>1000,26847=>1000,26848=>1000,26849=>1000,26850=>1000,26851=>1000,26852=>1000, - 26853=>1000,26854=>1000,26855=>1000,26856=>1000,26857=>1000,26858=>1000,26859=>1000,26860=>1000,26861=>1000,26862=>1000,26863=>1000,26864=>1000,26865=>1000,26866=>1000,26867=>1000,26868=>1000, - 26869=>1000,26870=>1000,26871=>1000,26872=>1000,26873=>1000,26874=>1000,26875=>1000,26876=>1000,26877=>1000,26878=>1000,26879=>1000,26880=>1000,26881=>1000,26882=>1000,26883=>1000,26884=>1000, - 26885=>1000,26886=>1000,26887=>1000,26888=>1000,26889=>1000,26890=>1000,26891=>1000,26892=>1000,26893=>1000,26894=>1000,26895=>1000,26896=>1000,26897=>1000,26898=>1000,26899=>1000,26900=>1000, - 26901=>1000,26902=>1000,26903=>1000,26904=>1000,26905=>1000,26906=>1000,26907=>1000,26908=>1000,26909=>1000,26910=>1000,26911=>1000,26912=>1000,26913=>1000,26914=>1000,26915=>1000,26916=>1000, - 26917=>1000,26918=>1000,26919=>1000,26920=>1000,26921=>1000,26922=>1000,26923=>1000,26924=>1000,26925=>1000,26926=>1000,26927=>1000,26928=>1000,26929=>1000,26930=>1000,26931=>1000,26932=>1000, - 26933=>1000,26934=>1000,26935=>1000,26936=>1000,26937=>1000,26938=>1000,26939=>1000,26940=>1000,26941=>1000,26942=>1000,26943=>1000,26944=>1000,26945=>1000,26946=>1000,26947=>1000,26948=>1000, - 26949=>1000,26950=>1000,26951=>1000,26952=>1000,26953=>1000,26954=>1000,26955=>1000,26956=>1000,26957=>1000,26958=>1000,26959=>1000,26960=>1000,26961=>1000,26962=>1000,26963=>1000,26964=>1000, - 26965=>1000,26966=>1000,26967=>1000,26968=>1000,26969=>1000,26970=>1000,26971=>1000,26972=>1000,26973=>1000,26974=>1000,26975=>1000,26976=>1000,26977=>1000,26978=>1000,26979=>1000,26980=>1000, - 26981=>1000,26982=>1000,26983=>1000,26984=>1000,26985=>1000,26986=>1000,26987=>1000,26988=>1000,26989=>1000,26990=>1000,26991=>1000,26992=>1000,26993=>1000,26994=>1000,26995=>1000,26996=>1000, - 26997=>1000,26998=>1000,26999=>1000,27000=>1000,27001=>1000,27002=>1000,27003=>1000,27004=>1000,27005=>1000,27006=>1000,27007=>1000,27008=>1000,27009=>1000,27010=>1000,27011=>1000,27012=>1000, - 27013=>1000,27014=>1000,27015=>1000,27016=>1000,27017=>1000,27018=>1000,27019=>1000,27020=>1000,27021=>1000,27022=>1000,27023=>1000,27024=>1000,27025=>1000,27026=>1000,27027=>1000,27028=>1000, - 27029=>1000,27030=>1000,27031=>1000,27032=>1000,27033=>1000,27034=>1000,27035=>1000,27036=>1000,27037=>1000,27038=>1000,27039=>1000,27040=>1000,27041=>1000,27042=>1000,27043=>1000,27044=>1000, - 27045=>1000,27046=>1000,27047=>1000,27048=>1000,27049=>1000,27050=>1000,27051=>1000,27052=>1000,27053=>1000,27054=>1000,27055=>1000,27056=>1000,27057=>1000,27058=>1000,27059=>1000,27060=>1000, - 27061=>1000,27062=>1000,27063=>1000,27064=>1000,27065=>1000,27066=>1000,27067=>1000,27068=>1000,27069=>1000,27070=>1000,27071=>1000,27072=>1000,27073=>1000,27074=>1000,27075=>1000,27076=>1000, - 27077=>1000,27078=>1000,27079=>1000,27080=>1000,27081=>1000,27082=>1000,27083=>1000,27084=>1000,27085=>1000,27086=>1000,27087=>1000,27088=>1000,27089=>1000,27090=>1000,27091=>1000,27092=>1000, - 27093=>1000,27094=>1000,27095=>1000,27096=>1000,27097=>1000,27098=>1000,27099=>1000,27100=>1000,27101=>1000,27102=>1000,27103=>1000,27104=>1000,27105=>1000,27106=>1000,27107=>1000,27108=>1000, - 27109=>1000,27110=>1000,27111=>1000,27112=>1000,27113=>1000,27114=>1000,27115=>1000,27116=>1000,27117=>1000,27118=>1000,27119=>1000,27120=>1000,27121=>1000,27122=>1000,27123=>1000,27124=>1000, - 27125=>1000,27126=>1000,27127=>1000,27128=>1000,27129=>1000,27130=>1000,27131=>1000,27132=>1000,27133=>1000,27134=>1000,27135=>1000,27136=>1000,27137=>1000,27138=>1000,27139=>1000,27140=>1000, - 27141=>1000,27142=>1000,27143=>1000,27144=>1000,27145=>1000,27146=>1000,27147=>1000,27148=>1000,27149=>1000,27150=>1000,27151=>1000,27152=>1000,27153=>1000,27154=>1000,27155=>1000,27156=>1000, - 27157=>1000,27158=>1000,27159=>1000,27160=>1000,27161=>1000,27162=>1000,27163=>1000,27164=>1000,27165=>1000,27166=>1000,27167=>1000,27168=>1000,27169=>1000,27170=>1000,27171=>1000,27172=>1000, - 27173=>1000,27174=>1000,27175=>1000,27176=>1000,27177=>1000,27178=>1000,27179=>1000,27180=>1000,27181=>1000,27182=>1000,27183=>1000,27184=>1000,27185=>1000,27186=>1000,27187=>1000,27188=>1000, - 27189=>1000,27190=>1000,27191=>1000,27192=>1000,27193=>1000,27194=>1000,27195=>1000,27196=>1000,27197=>1000,27198=>1000,27199=>1000,27200=>1000,27201=>1000,27202=>1000,27203=>1000,27204=>1000, - 27205=>1000,27206=>1000,27207=>1000,27208=>1000,27209=>1000,27210=>1000,27211=>1000,27212=>1000,27213=>1000,27214=>1000,27215=>1000,27216=>1000,27217=>1000,27218=>1000,27219=>1000,27220=>1000, - 27221=>1000,27222=>1000,27223=>1000,27224=>1000,27225=>1000,27226=>1000,27227=>1000,27228=>1000,27229=>1000,27230=>1000,27231=>1000,27232=>1000,27233=>1000,27234=>1000,27235=>1000,27236=>1000, - 27237=>1000,27238=>1000,27239=>1000,27240=>1000,27241=>1000,27242=>1000,27243=>1000,27244=>1000,27245=>1000,27246=>1000,27247=>1000,27248=>1000,27249=>1000,27250=>1000,27251=>1000,27252=>1000, - 27253=>1000,27254=>1000,27255=>1000,27256=>1000,27257=>1000,27258=>1000,27259=>1000,27260=>1000,27261=>1000,27262=>1000,27263=>1000,27264=>1000,27265=>1000,27266=>1000,27267=>1000,27268=>1000, - 27269=>1000,27270=>1000,27271=>1000,27272=>1000,27273=>1000,27274=>1000,27275=>1000,27276=>1000,27277=>1000,27278=>1000,27279=>1000,27280=>1000,27281=>1000,27282=>1000,27283=>1000,27284=>1000, - 27285=>1000,27286=>1000,27287=>1000,27288=>1000,27289=>1000,27290=>1000,27291=>1000,27292=>1000,27293=>1000,27294=>1000,27295=>1000,27296=>1000,27297=>1000,27298=>1000,27299=>1000,27300=>1000, - 27301=>1000,27302=>1000,27303=>1000,27304=>1000,27305=>1000,27306=>1000,27307=>1000,27308=>1000,27309=>1000,27310=>1000,27311=>1000,27312=>1000,27313=>1000,27314=>1000,27315=>1000,27316=>1000, - 27317=>1000,27318=>1000,27319=>1000,27320=>1000,27321=>1000,27322=>1000,27323=>1000,27324=>1000,27325=>1000,27326=>1000,27327=>1000,27328=>1000,27329=>1000,27330=>1000,27331=>1000,27332=>1000, - 27333=>1000,27334=>1000,27335=>1000,27336=>1000,27337=>1000,27338=>1000,27339=>1000,27340=>1000,27341=>1000,27342=>1000,27343=>1000,27344=>1000,27345=>1000,27346=>1000,27347=>1000,27348=>1000, - 27349=>1000,27350=>1000,27351=>1000,27352=>1000,27353=>1000,27354=>1000,27355=>1000,27356=>1000,27357=>1000,27358=>1000,27359=>1000,27360=>1000,27361=>1000,27362=>1000,27363=>1000,27364=>1000, - 27365=>1000,27366=>1000,27367=>1000,27368=>1000,27369=>1000,27370=>1000,27371=>1000,27372=>1000,27373=>1000,27374=>1000,27375=>1000,27376=>1000,27377=>1000,27378=>1000,27379=>1000,27380=>1000, - 27381=>1000,27382=>1000,27383=>1000,27384=>1000,27385=>1000,27386=>1000,27387=>1000,27388=>1000,27389=>1000,27390=>1000,27391=>1000,27392=>1000,27393=>1000,27394=>1000,27395=>1000,27396=>1000, - 27397=>1000,27398=>1000,27399=>1000,27400=>1000,27401=>1000,27402=>1000,27403=>1000,27404=>1000,27405=>1000,27406=>1000,27407=>1000,27408=>1000,27409=>1000,27410=>1000,27411=>1000,27412=>1000, - 27413=>1000,27414=>1000,27415=>1000,27416=>1000,27417=>1000,27418=>1000,27419=>1000,27420=>1000,27421=>1000,27422=>1000,27423=>1000,27424=>1000,27425=>1000,27426=>1000,27427=>1000,27428=>1000, - 27429=>1000,27430=>1000,27431=>1000,27432=>1000,27433=>1000,27434=>1000,27435=>1000,27436=>1000,27437=>1000,27438=>1000,27439=>1000,27440=>1000,27441=>1000,27442=>1000,27443=>1000,27444=>1000, - 27445=>1000,27446=>1000,27447=>1000,27448=>1000,27449=>1000,27450=>1000,27451=>1000,27452=>1000,27453=>1000,27454=>1000,27455=>1000,27456=>1000,27457=>1000,27458=>1000,27459=>1000,27460=>1000, - 27461=>1000,27462=>1000,27463=>1000,27464=>1000,27465=>1000,27466=>1000,27467=>1000,27468=>1000,27469=>1000,27470=>1000,27471=>1000,27472=>1000,27473=>1000,27474=>1000,27475=>1000,27476=>1000, - 27477=>1000,27478=>1000,27479=>1000,27480=>1000,27481=>1000,27482=>1000,27483=>1000,27484=>1000,27485=>1000,27486=>1000,27487=>1000,27488=>1000,27489=>1000,27490=>1000,27491=>1000,27492=>1000, - 27493=>1000,27494=>1000,27495=>1000,27496=>1000,27497=>1000,27498=>1000,27499=>1000,27500=>1000,27501=>1000,27502=>1000,27503=>1000,27504=>1000,27505=>1000,27506=>1000,27507=>1000,27508=>1000, - 27509=>1000,27510=>1000,27511=>1000,27512=>1000,27513=>1000,27514=>1000,27515=>1000,27516=>1000,27517=>1000,27518=>1000,27519=>1000,27520=>1000,27521=>1000,27522=>1000,27523=>1000,27524=>1000, - 27525=>1000,27526=>1000,27527=>1000,27528=>1000,27529=>1000,27530=>1000,27531=>1000,27532=>1000,27533=>1000,27534=>1000,27535=>1000,27536=>1000,27537=>1000,27538=>1000,27539=>1000,27540=>1000, - 27541=>1000,27542=>1000,27543=>1000,27544=>1000,27545=>1000,27546=>1000,27547=>1000,27548=>1000,27549=>1000,27550=>1000,27551=>1000,27552=>1000,27553=>1000,27554=>1000,27555=>1000,27556=>1000, - 27557=>1000,27558=>1000,27559=>1000,27560=>1000,27561=>1000,27562=>1000,27563=>1000,27564=>1000,27565=>1000,27566=>1000,27567=>1000,27568=>1000,27569=>1000,27570=>1000,27571=>1000,27572=>1000, - 27573=>1000,27574=>1000,27575=>1000,27576=>1000,27577=>1000,27578=>1000,27579=>1000,27580=>1000,27581=>1000,27582=>1000,27583=>1000,27584=>1000,27585=>1000,27586=>1000,27587=>1000,27588=>1000, - 27589=>1000,27590=>1000,27591=>1000,27592=>1000,27593=>1000,27594=>1000,27595=>1000,27596=>1000,27597=>1000,27598=>1000,27599=>1000,27600=>1000,27601=>1000,27602=>1000,27603=>1000,27604=>1000, - 27605=>1000,27606=>1000,27607=>1000,27608=>1000,27609=>1000,27610=>1000,27611=>1000,27612=>1000,27613=>1000,27614=>1000,27615=>1000,27616=>1000,27617=>1000,27618=>1000,27619=>1000,27620=>1000, - 27621=>1000,27622=>1000,27623=>1000,27624=>1000,27625=>1000,27626=>1000,27627=>1000,27628=>1000,27629=>1000,27630=>1000,27631=>1000,27632=>1000,27633=>1000,27634=>1000,27635=>1000,27636=>1000, - 27637=>1000,27638=>1000,27639=>1000,27640=>1000,27641=>1000,27642=>1000,27643=>1000,27644=>1000,27645=>1000,27646=>1000,27647=>1000,27648=>1000,27649=>1000,27650=>1000,27651=>1000,27652=>1000, - 27653=>1000,27654=>1000,27655=>1000,27656=>1000,27657=>1000,27658=>1000,27659=>1000,27660=>1000,27661=>1000,27662=>1000,27663=>1000,27664=>1000,27665=>1000,27666=>1000,27667=>1000,27668=>1000, - 27669=>1000,27670=>1000,27671=>1000,27672=>1000,27673=>1000,27674=>1000,27675=>1000,27676=>1000,27677=>1000,27678=>1000,27679=>1000,27680=>1000,27681=>1000,27682=>1000,27683=>1000,27684=>1000, - 27685=>1000,27686=>1000,27687=>1000,27688=>1000,27689=>1000,27690=>1000,27691=>1000,27692=>1000,27693=>1000,27694=>1000,27695=>1000,27696=>1000,27697=>1000,27698=>1000,27699=>1000,27700=>1000, - 27701=>1000,27702=>1000,27703=>1000,27704=>1000,27705=>1000,27706=>1000,27707=>1000,27708=>1000,27709=>1000,27710=>1000,27711=>1000,27712=>1000,27713=>1000,27714=>1000,27715=>1000,27716=>1000, - 27717=>1000,27718=>1000,27719=>1000,27720=>1000,27721=>1000,27722=>1000,27723=>1000,27724=>1000,27725=>1000,27726=>1000,27727=>1000,27728=>1000,27729=>1000,27730=>1000,27731=>1000,27732=>1000, - 27733=>1000,27734=>1000,27735=>1000,27736=>1000,27737=>1000,27738=>1000,27739=>1000,27740=>1000,27741=>1000,27742=>1000,27743=>1000,27744=>1000,27745=>1000,27746=>1000,27747=>1000,27748=>1000, - 27749=>1000,27750=>1000,27751=>1000,27752=>1000,27753=>1000,27754=>1000,27755=>1000,27756=>1000,27757=>1000,27758=>1000,27759=>1000,27760=>1000,27761=>1000,27762=>1000,27763=>1000,27764=>1000, - 27765=>1000,27766=>1000,27767=>1000,27768=>1000,27769=>1000,27770=>1000,27771=>1000,27772=>1000,27773=>1000,27774=>1000,27775=>1000,27776=>1000,27777=>1000,27778=>1000,27779=>1000,27780=>1000, - 27781=>1000,27782=>1000,27783=>1000,27784=>1000,27785=>1000,27786=>1000,27787=>1000,27788=>1000,27789=>1000,27790=>1000,27791=>1000,27792=>1000,27793=>1000,27794=>1000,27795=>1000,27796=>1000, - 27797=>1000,27798=>1000,27799=>1000,27800=>1000,27801=>1000,27802=>1000,27803=>1000,27804=>1000,27805=>1000,27806=>1000,27807=>1000,27808=>1000,27809=>1000,27810=>1000,27811=>1000,27812=>1000, - 27813=>1000,27814=>1000,27815=>1000,27816=>1000,27817=>1000,27818=>1000,27819=>1000,27820=>1000,27821=>1000,27822=>1000,27823=>1000,27824=>1000,27825=>1000,27826=>1000,27827=>1000,27828=>1000, - 27829=>1000,27830=>1000,27831=>1000,27832=>1000,27833=>1000,27834=>1000,27835=>1000,27836=>1000,27837=>1000,27838=>1000,27839=>1000,27840=>1000,27841=>1000,27842=>1000,27843=>1000,27844=>1000, - 27845=>1000,27846=>1000,27847=>1000,27848=>1000,27849=>1000,27850=>1000,27851=>1000,27852=>1000,27853=>1000,27854=>1000,27855=>1000,27856=>1000,27857=>1000,27858=>1000,27859=>1000,27860=>1000, - 27861=>1000,27862=>1000,27863=>1000,27864=>1000,27865=>1000,27866=>1000,27867=>1000,27868=>1000,27869=>1000,27870=>1000,27871=>1000,27872=>1000,27873=>1000,27874=>1000,27875=>1000,27876=>1000, - 27877=>1000,27878=>1000,27879=>1000,27880=>1000,27881=>1000,27882=>1000,27883=>1000,27884=>1000,27885=>1000,27886=>1000,27887=>1000,27888=>1000,27889=>1000,27890=>1000,27891=>1000,27892=>1000, - 27893=>1000,27894=>1000,27895=>1000,27896=>1000,27897=>1000,27898=>1000,27899=>1000,27900=>1000,27901=>1000,27902=>1000,27903=>1000,27904=>1000,27905=>1000,27906=>1000,27907=>1000,27908=>1000, - 27909=>1000,27910=>1000,27911=>1000,27912=>1000,27913=>1000,27914=>1000,27915=>1000,27916=>1000,27917=>1000,27918=>1000,27919=>1000,27920=>1000,27921=>1000,27922=>1000,27923=>1000,27924=>1000, - 27925=>1000,27926=>1000,27927=>1000,27928=>1000,27929=>1000,27930=>1000,27931=>1000,27932=>1000,27933=>1000,27934=>1000,27935=>1000,27936=>1000,27937=>1000,27938=>1000,27939=>1000,27940=>1000, - 27941=>1000,27942=>1000,27943=>1000,27944=>1000,27945=>1000,27946=>1000,27947=>1000,27948=>1000,27949=>1000,27950=>1000,27951=>1000,27952=>1000,27953=>1000,27954=>1000,27955=>1000,27956=>1000, - 27957=>1000,27958=>1000,27959=>1000,27960=>1000,27961=>1000,27962=>1000,27963=>1000,27964=>1000,27965=>1000,27966=>1000,27967=>1000,27968=>1000,27969=>1000,27970=>1000,27971=>1000,27972=>1000, - 27973=>1000,27974=>1000,27975=>1000,27976=>1000,27977=>1000,27978=>1000,27979=>1000,27980=>1000,27981=>1000,27982=>1000,27983=>1000,27984=>1000,27985=>1000,27986=>1000,27987=>1000,27988=>1000, - 27989=>1000,27990=>1000,27991=>1000,27992=>1000,27993=>1000,27994=>1000,27995=>1000,27996=>1000,27997=>1000,27998=>1000,27999=>1000,28000=>1000,28001=>1000,28002=>1000,28003=>1000,28004=>1000, - 28005=>1000,28006=>1000,28007=>1000,28008=>1000,28009=>1000,28010=>1000,28011=>1000,28012=>1000,28013=>1000,28014=>1000,28015=>1000,28016=>1000,28017=>1000,28018=>1000,28019=>1000,28020=>1000, - 28021=>1000,28022=>1000,28023=>1000,28024=>1000,28025=>1000,28026=>1000,28027=>1000,28028=>1000,28029=>1000,28030=>1000,28031=>1000,28032=>1000,28033=>1000,28034=>1000,28035=>1000,28036=>1000, - 28037=>1000,28038=>1000,28039=>1000,28040=>1000,28041=>1000,28042=>1000,28043=>1000,28044=>1000,28045=>1000,28046=>1000,28047=>1000,28048=>1000,28049=>1000,28050=>1000,28051=>1000,28052=>1000, - 28053=>1000,28054=>1000,28055=>1000,28056=>1000,28057=>1000,28058=>1000,28059=>1000,28060=>1000,28061=>1000,28062=>1000,28063=>1000,28064=>1000,28065=>1000,28066=>1000,28067=>1000,28068=>1000, - 28069=>1000,28070=>1000,28071=>1000,28072=>1000,28073=>1000,28074=>1000,28075=>1000,28076=>1000,28077=>1000,28078=>1000,28079=>1000,28080=>1000,28081=>1000,28082=>1000,28083=>1000,28084=>1000, - 28085=>1000,28086=>1000,28087=>1000,28088=>1000,28089=>1000,28090=>1000,28091=>1000,28092=>1000,28093=>1000,28094=>1000,28095=>1000,28096=>1000,28097=>1000,28098=>1000,28099=>1000,28100=>1000, - 28101=>1000,28102=>1000,28103=>1000,28104=>1000,28105=>1000,28106=>1000,28107=>1000,28108=>1000,28109=>1000,28110=>1000,28111=>1000,28112=>1000,28113=>1000,28114=>1000,28115=>1000,28116=>1000, - 28117=>1000,28118=>1000,28119=>1000,28120=>1000,28121=>1000,28122=>1000,28123=>1000,28124=>1000,28125=>1000,28126=>1000,28127=>1000,28128=>1000,28129=>1000,28130=>1000,28131=>1000,28132=>1000, - 28133=>1000,28134=>1000,28135=>1000,28136=>1000,28137=>1000,28138=>1000,28139=>1000,28140=>1000,28141=>1000,28142=>1000,28143=>1000,28144=>1000,28145=>1000,28146=>1000,28147=>1000,28148=>1000, - 28149=>1000,28150=>1000,28151=>1000,28152=>1000,28153=>1000,28154=>1000,28155=>1000,28156=>1000,28157=>1000,28158=>1000,28159=>1000,28160=>1000,28161=>1000,28162=>1000,28163=>1000,28164=>1000, - 28165=>1000,28166=>1000,28167=>1000,28168=>1000,28169=>1000,28170=>1000,28171=>1000,28172=>1000,28173=>1000,28174=>1000,28175=>1000,28176=>1000,28177=>1000,28178=>1000,28179=>1000,28180=>1000, - 28181=>1000,28182=>1000,28183=>1000,28184=>1000,28185=>1000,28186=>1000,28187=>1000,28188=>1000,28189=>1000,28190=>1000,28191=>1000,28192=>1000,28193=>1000,28194=>1000,28195=>1000,28196=>1000, - 28197=>1000,28198=>1000,28199=>1000,28200=>1000,28201=>1000,28202=>1000,28203=>1000,28204=>1000,28205=>1000,28206=>1000,28207=>1000,28208=>1000,28209=>1000,28210=>1000,28211=>1000,28212=>1000, - 28213=>1000,28214=>1000,28215=>1000,28216=>1000,28217=>1000,28218=>1000,28219=>1000,28220=>1000,28221=>1000,28222=>1000,28223=>1000,28224=>1000,28225=>1000,28226=>1000,28227=>1000,28228=>1000, - 28229=>1000,28230=>1000,28231=>1000,28232=>1000,28233=>1000,28234=>1000,28235=>1000,28236=>1000,28237=>1000,28238=>1000,28239=>1000,28240=>1000,28241=>1000,28242=>1000,28243=>1000,28244=>1000, - 28245=>1000,28246=>1000,28247=>1000,28248=>1000,28249=>1000,28250=>1000,28251=>1000,28252=>1000,28253=>1000,28254=>1000,28255=>1000,28256=>1000,28257=>1000,28258=>1000,28259=>1000,28260=>1000, - 28261=>1000,28262=>1000,28263=>1000,28264=>1000,28265=>1000,28266=>1000,28267=>1000,28268=>1000,28269=>1000,28270=>1000,28271=>1000,28272=>1000,28273=>1000,28274=>1000,28275=>1000,28276=>1000, - 28277=>1000,28278=>1000,28279=>1000,28280=>1000,28281=>1000,28282=>1000,28283=>1000,28284=>1000,28285=>1000,28286=>1000,28287=>1000,28288=>1000,28289=>1000,28290=>1000,28291=>1000,28292=>1000, - 28293=>1000,28294=>1000,28295=>1000,28296=>1000,28297=>1000,28298=>1000,28299=>1000,28300=>1000,28301=>1000,28302=>1000,28303=>1000,28304=>1000,28305=>1000,28306=>1000,28307=>1000,28308=>1000, - 28309=>1000,28310=>1000,28311=>1000,28312=>1000,28313=>1000,28314=>1000,28315=>1000,28316=>1000,28317=>1000,28318=>1000,28319=>1000,28320=>1000,28321=>1000,28322=>1000,28323=>1000,28324=>1000, - 28325=>1000,28326=>1000,28327=>1000,28328=>1000,28329=>1000,28330=>1000,28331=>1000,28332=>1000,28333=>1000,28334=>1000,28335=>1000,28336=>1000,28337=>1000,28338=>1000,28339=>1000,28340=>1000, - 28341=>1000,28342=>1000,28343=>1000,28344=>1000,28345=>1000,28346=>1000,28347=>1000,28348=>1000,28349=>1000,28350=>1000,28351=>1000,28352=>1000,28353=>1000,28354=>1000,28355=>1000,28356=>1000, - 28357=>1000,28358=>1000,28359=>1000,28360=>1000,28361=>1000,28362=>1000,28363=>1000,28364=>1000,28365=>1000,28366=>1000,28367=>1000,28368=>1000,28369=>1000,28370=>1000,28371=>1000,28372=>1000, - 28373=>1000,28374=>1000,28375=>1000,28376=>1000,28377=>1000,28378=>1000,28379=>1000,28380=>1000,28381=>1000,28382=>1000,28383=>1000,28384=>1000,28385=>1000,28386=>1000,28387=>1000,28388=>1000, - 28389=>1000,28390=>1000,28391=>1000,28392=>1000,28393=>1000,28394=>1000,28395=>1000,28396=>1000,28397=>1000,28398=>1000,28399=>1000,28400=>1000,28401=>1000,28402=>1000,28403=>1000,28404=>1000, - 28405=>1000,28406=>1000,28407=>1000,28408=>1000,28409=>1000,28410=>1000,28411=>1000,28412=>1000,28413=>1000,28414=>1000,28415=>1000,28416=>1000,28417=>1000,28418=>1000,28419=>1000,28420=>1000, - 28421=>1000,28422=>1000,28423=>1000,28424=>1000,28425=>1000,28426=>1000,28427=>1000,28428=>1000,28429=>1000,28430=>1000,28431=>1000,28432=>1000,28433=>1000,28434=>1000,28435=>1000,28436=>1000, - 28437=>1000,28438=>1000,28439=>1000,28440=>1000,28441=>1000,28442=>1000,28443=>1000,28444=>1000,28445=>1000,28446=>1000,28447=>1000,28448=>1000,28449=>1000,28450=>1000,28451=>1000,28452=>1000, - 28453=>1000,28454=>1000,28455=>1000,28456=>1000,28457=>1000,28458=>1000,28459=>1000,28460=>1000,28461=>1000,28462=>1000,28463=>1000,28464=>1000,28465=>1000,28466=>1000,28467=>1000,28468=>1000, - 28469=>1000,28470=>1000,28471=>1000,28472=>1000,28473=>1000,28474=>1000,28475=>1000,28476=>1000,28477=>1000,28478=>1000,28479=>1000,28480=>1000,28481=>1000,28482=>1000,28483=>1000,28484=>1000, - 28485=>1000,28486=>1000,28487=>1000,28488=>1000,28489=>1000,28490=>1000,28491=>1000,28492=>1000,28493=>1000,28494=>1000,28495=>1000,28496=>1000,28497=>1000,28498=>1000,28499=>1000,28500=>1000, - 28501=>1000,28502=>1000,28503=>1000,28504=>1000,28505=>1000,28506=>1000,28507=>1000,28508=>1000,28509=>1000,28510=>1000,28511=>1000,28512=>1000,28513=>1000,28514=>1000,28515=>1000,28516=>1000, - 28517=>1000,28518=>1000,28519=>1000,28520=>1000,28521=>1000,28522=>1000,28523=>1000,28524=>1000,28525=>1000,28526=>1000,28527=>1000,28528=>1000,28529=>1000,28530=>1000,28531=>1000,28532=>1000, - 28533=>1000,28534=>1000,28535=>1000,28536=>1000,28537=>1000,28538=>1000,28539=>1000,28540=>1000,28541=>1000,28542=>1000,28543=>1000,28544=>1000,28545=>1000,28546=>1000,28547=>1000,28548=>1000, - 28549=>1000,28550=>1000,28551=>1000,28552=>1000,28553=>1000,28554=>1000,28555=>1000,28556=>1000,28557=>1000,28558=>1000,28559=>1000,28560=>1000,28561=>1000,28562=>1000,28563=>1000,28564=>1000, - 28565=>1000,28566=>1000,28567=>1000,28568=>1000,28569=>1000,28570=>1000,28571=>1000,28572=>1000,28573=>1000,28574=>1000,28575=>1000,28576=>1000,28577=>1000,28578=>1000,28579=>1000,28580=>1000, - 28581=>1000,28582=>1000,28583=>1000,28584=>1000,28585=>1000,28586=>1000,28587=>1000,28588=>1000,28589=>1000,28590=>1000,28591=>1000,28592=>1000,28593=>1000,28594=>1000,28595=>1000,28596=>1000, - 28597=>1000,28598=>1000,28599=>1000,28600=>1000,28601=>1000,28602=>1000,28603=>1000,28604=>1000,28605=>1000,28606=>1000,28607=>1000,28608=>1000,28609=>1000,28610=>1000,28611=>1000,28612=>1000, - 28613=>1000,28614=>1000,28615=>1000,28616=>1000,28617=>1000,28618=>1000,28619=>1000,28620=>1000,28621=>1000,28622=>1000,28623=>1000,28624=>1000,28625=>1000,28626=>1000,28627=>1000,28628=>1000, - 28629=>1000,28630=>1000,28631=>1000,28632=>1000,28633=>1000,28634=>1000,28635=>1000,28636=>1000,28637=>1000,28638=>1000,28639=>1000,28640=>1000,28641=>1000,28642=>1000,28643=>1000,28644=>1000, - 28645=>1000,28646=>1000,28647=>1000,28648=>1000,28649=>1000,28650=>1000,28651=>1000,28652=>1000,28653=>1000,28654=>1000,28655=>1000,28656=>1000,28657=>1000,28658=>1000,28659=>1000,28660=>1000, - 28661=>1000,28662=>1000,28663=>1000,28664=>1000,28665=>1000,28666=>1000,28667=>1000,28668=>1000,28669=>1000,28670=>1000,28671=>1000,28672=>1000,28673=>1000,28674=>1000,28675=>1000,28676=>1000, - 28677=>1000,28678=>1000,28679=>1000,28680=>1000,28681=>1000,28682=>1000,28683=>1000,28684=>1000,28685=>1000,28686=>1000,28687=>1000,28688=>1000,28689=>1000,28690=>1000,28691=>1000,28692=>1000, - 28693=>1000,28694=>1000,28695=>1000,28696=>1000,28697=>1000,28698=>1000,28699=>1000,28700=>1000,28701=>1000,28702=>1000,28703=>1000,28704=>1000,28705=>1000,28706=>1000,28707=>1000,28708=>1000, - 28709=>1000,28710=>1000,28711=>1000,28712=>1000,28713=>1000,28714=>1000,28715=>1000,28716=>1000,28717=>1000,28718=>1000,28719=>1000,28720=>1000,28721=>1000,28722=>1000,28723=>1000,28724=>1000, - 28725=>1000,28726=>1000,28727=>1000,28728=>1000,28729=>1000,28730=>1000,28731=>1000,28732=>1000,28733=>1000,28734=>1000,28735=>1000,28736=>1000,28737=>1000,28738=>1000,28739=>1000,28740=>1000, - 28741=>1000,28742=>1000,28743=>1000,28744=>1000,28745=>1000,28746=>1000,28747=>1000,28748=>1000,28749=>1000,28750=>1000,28751=>1000,28752=>1000,28753=>1000,28754=>1000,28755=>1000,28756=>1000, - 28757=>1000,28758=>1000,28759=>1000,28760=>1000,28761=>1000,28762=>1000,28763=>1000,28764=>1000,28765=>1000,28766=>1000,28767=>1000,28768=>1000,28769=>1000,28770=>1000,28771=>1000,28772=>1000, - 28773=>1000,28774=>1000,28775=>1000,28776=>1000,28777=>1000,28778=>1000,28779=>1000,28780=>1000,28781=>1000,28782=>1000,28783=>1000,28784=>1000,28785=>1000,28786=>1000,28787=>1000,28788=>1000, - 28789=>1000,28790=>1000,28791=>1000,28792=>1000,28793=>1000,28794=>1000,28795=>1000,28796=>1000,28797=>1000,28798=>1000,28799=>1000,28800=>1000,28801=>1000,28802=>1000,28803=>1000,28804=>1000, - 28805=>1000,28806=>1000,28807=>1000,28808=>1000,28809=>1000,28810=>1000,28811=>1000,28812=>1000,28813=>1000,28814=>1000,28815=>1000,28816=>1000,28817=>1000,28818=>1000,28819=>1000,28820=>1000, - 28821=>1000,28822=>1000,28823=>1000,28824=>1000,28825=>1000,28826=>1000,28827=>1000,28828=>1000,28829=>1000,28830=>1000,28831=>1000,28832=>1000,28833=>1000,28834=>1000,28835=>1000,28836=>1000, - 28837=>1000,28838=>1000,28839=>1000,28840=>1000,28841=>1000,28842=>1000,28843=>1000,28844=>1000,28845=>1000,28846=>1000,28847=>1000,28848=>1000,28849=>1000,28850=>1000,28851=>1000,28852=>1000, - 28853=>1000,28854=>1000,28855=>1000,28856=>1000,28857=>1000,28858=>1000,28859=>1000,28860=>1000,28861=>1000,28862=>1000,28863=>1000,28864=>1000,28865=>1000,28866=>1000,28867=>1000,28868=>1000, - 28869=>1000,28870=>1000,28871=>1000,28872=>1000,28873=>1000,28874=>1000,28875=>1000,28876=>1000,28877=>1000,28878=>1000,28879=>1000,28880=>1000,28881=>1000,28882=>1000,28883=>1000,28884=>1000, - 28885=>1000,28886=>1000,28887=>1000,28888=>1000,28889=>1000,28890=>1000,28891=>1000,28892=>1000,28893=>1000,28894=>1000,28895=>1000,28896=>1000,28897=>1000,28898=>1000,28899=>1000,28900=>1000, - 28901=>1000,28902=>1000,28903=>1000,28904=>1000,28905=>1000,28906=>1000,28907=>1000,28908=>1000,28909=>1000,28910=>1000,28911=>1000,28912=>1000,28913=>1000,28914=>1000,28915=>1000,28916=>1000, - 28917=>1000,28918=>1000,28919=>1000,28920=>1000,28921=>1000,28922=>1000,28923=>1000,28924=>1000,28925=>1000,28926=>1000,28927=>1000,28928=>1000,28929=>1000,28930=>1000,28931=>1000,28932=>1000, - 28933=>1000,28934=>1000,28935=>1000,28936=>1000,28937=>1000,28938=>1000,28939=>1000,28940=>1000,28941=>1000,28942=>1000,28943=>1000,28944=>1000,28945=>1000,28946=>1000,28947=>1000,28948=>1000, - 28949=>1000,28950=>1000,28951=>1000,28952=>1000,28953=>1000,28954=>1000,28955=>1000,28956=>1000,28957=>1000,28958=>1000,28959=>1000,28960=>1000,28961=>1000,28962=>1000,28963=>1000,28964=>1000, - 28965=>1000,28966=>1000,28967=>1000,28968=>1000,28969=>1000,28970=>1000,28971=>1000,28972=>1000,28973=>1000,28974=>1000,28975=>1000,28976=>1000,28977=>1000,28978=>1000,28979=>1000,28980=>1000, - 28981=>1000,28982=>1000,28983=>1000,28984=>1000,28985=>1000,28986=>1000,28987=>1000,28988=>1000,28989=>1000,28990=>1000,28991=>1000,28992=>1000,28993=>1000,28994=>1000,28995=>1000,28996=>1000, - 28997=>1000,28998=>1000,28999=>1000,29000=>1000,29001=>1000,29002=>1000,29003=>1000,29004=>1000,29005=>1000,29006=>1000,29007=>1000,29008=>1000,29009=>1000,29010=>1000,29011=>1000,29012=>1000, - 29013=>1000,29014=>1000,29015=>1000,29016=>1000,29017=>1000,29018=>1000,29019=>1000,29020=>1000,29021=>1000,29022=>1000,29023=>1000,29024=>1000,29025=>1000,29026=>1000,29027=>1000,29028=>1000, - 29029=>1000,29030=>1000,29031=>1000,29032=>1000,29033=>1000,29034=>1000,29035=>1000,29036=>1000,29037=>1000,29038=>1000,29039=>1000,29040=>1000,29041=>1000,29042=>1000,29043=>1000,29044=>1000, - 29045=>1000,29046=>1000,29047=>1000,29048=>1000,29049=>1000,29050=>1000,29051=>1000,29052=>1000,29053=>1000,29054=>1000,29055=>1000,29056=>1000,29057=>1000,29058=>1000,29059=>1000,29060=>1000, - 29061=>1000,29062=>1000,29063=>1000,29064=>1000,29065=>1000,29066=>1000,29067=>1000,29068=>1000,29069=>1000,29070=>1000,29071=>1000,29072=>1000,29073=>1000,29074=>1000,29075=>1000,29076=>1000, - 29077=>1000,29078=>1000,29079=>1000,29080=>1000,29081=>1000,29082=>1000,29083=>1000,29084=>1000,29085=>1000,29086=>1000,29087=>1000,29088=>1000,29089=>1000,29090=>1000,29091=>1000,29092=>1000, - 29093=>1000,29094=>1000,29095=>1000,29096=>1000,29097=>1000,29098=>1000,29099=>1000,29100=>1000,29101=>1000,29102=>1000,29103=>1000,29104=>1000,29105=>1000,29106=>1000,29107=>1000,29108=>1000, - 29109=>1000,29110=>1000,29111=>1000,29112=>1000,29113=>1000,29114=>1000,29115=>1000,29116=>1000,29117=>1000,29118=>1000,29119=>1000,29120=>1000,29121=>1000,29122=>1000,29123=>1000,29124=>1000, - 29125=>1000,29126=>1000,29127=>1000,29128=>1000,29129=>1000,29130=>1000,29131=>1000,29132=>1000,29133=>1000,29134=>1000,29135=>1000,29136=>1000,29137=>1000,29138=>1000,29139=>1000,29140=>1000, - 29141=>1000,29142=>1000,29143=>1000,29144=>1000,29145=>1000,29146=>1000,29147=>1000,29148=>1000,29149=>1000,29150=>1000,29151=>1000,29152=>1000,29153=>1000,29154=>1000,29155=>1000,29156=>1000, - 29157=>1000,29158=>1000,29159=>1000,29160=>1000,29161=>1000,29162=>1000,29163=>1000,29164=>1000,29165=>1000,29166=>1000,29167=>1000,29168=>1000,29169=>1000,29170=>1000,29171=>1000,29172=>1000, - 29173=>1000,29174=>1000,29175=>1000,29176=>1000,29177=>1000,29178=>1000,29179=>1000,29180=>1000,29181=>1000,29182=>1000,29183=>1000,29184=>1000,29185=>1000,29186=>1000,29187=>1000,29188=>1000, - 29189=>1000,29190=>1000,29191=>1000,29192=>1000,29193=>1000,29194=>1000,29195=>1000,29196=>1000,29197=>1000,29198=>1000,29199=>1000,29200=>1000,29201=>1000,29202=>1000,29203=>1000,29204=>1000, - 29205=>1000,29206=>1000,29207=>1000,29208=>1000,29209=>1000,29210=>1000,29211=>1000,29212=>1000,29213=>1000,29214=>1000,29215=>1000,29216=>1000,29217=>1000,29218=>1000,29219=>1000,29220=>1000, - 29221=>1000,29222=>1000,29223=>1000,29224=>1000,29225=>1000,29226=>1000,29227=>1000,29228=>1000,29229=>1000,29230=>1000,29231=>1000,29232=>1000,29233=>1000,29234=>1000,29235=>1000,29236=>1000, - 29237=>1000,29238=>1000,29239=>1000,29240=>1000,29241=>1000,29242=>1000,29243=>1000,29244=>1000,29245=>1000,29246=>1000,29247=>1000,29248=>1000,29249=>1000,29250=>1000,29251=>1000,29252=>1000, - 29253=>1000,29254=>1000,29255=>1000,29256=>1000,29257=>1000,29258=>1000,29259=>1000,29260=>1000,29261=>1000,29262=>1000,29263=>1000,29264=>1000,29265=>1000,29266=>1000,29267=>1000,29268=>1000, - 29269=>1000,29270=>1000,29271=>1000,29272=>1000,29273=>1000,29274=>1000,29275=>1000,29276=>1000,29277=>1000,29278=>1000,29279=>1000,29280=>1000,29281=>1000,29282=>1000,29283=>1000,29284=>1000, - 29285=>1000,29286=>1000,29287=>1000,29288=>1000,29289=>1000,29290=>1000,29291=>1000,29292=>1000,29293=>1000,29294=>1000,29295=>1000,29296=>1000,29297=>1000,29298=>1000,29299=>1000,29300=>1000, - 29301=>1000,29302=>1000,29303=>1000,29304=>1000,29305=>1000,29306=>1000,29307=>1000,29308=>1000,29309=>1000,29310=>1000,29311=>1000,29312=>1000,29313=>1000,29314=>1000,29315=>1000,29316=>1000, - 29317=>1000,29318=>1000,29319=>1000,29320=>1000,29321=>1000,29322=>1000,29323=>1000,29324=>1000,29325=>1000,29326=>1000,29327=>1000,29328=>1000,29329=>1000,29330=>1000,29331=>1000,29332=>1000, - 29333=>1000,29334=>1000,29335=>1000,29336=>1000,29337=>1000,29338=>1000,29339=>1000,29340=>1000,29341=>1000,29342=>1000,29343=>1000,29344=>1000,29345=>1000,29346=>1000,29347=>1000,29348=>1000, - 29349=>1000,29350=>1000,29351=>1000,29352=>1000,29353=>1000,29354=>1000,29355=>1000,29356=>1000,29357=>1000,29358=>1000,29359=>1000,29360=>1000,29361=>1000,29362=>1000,29363=>1000,29364=>1000, - 29365=>1000,29366=>1000,29367=>1000,29368=>1000,29369=>1000,29370=>1000,29371=>1000,29372=>1000,29373=>1000,29374=>1000,29375=>1000,29376=>1000,29377=>1000,29378=>1000,29379=>1000,29380=>1000, - 29381=>1000,29382=>1000,29383=>1000,29384=>1000,29385=>1000,29386=>1000,29387=>1000,29388=>1000,29389=>1000,29390=>1000,29391=>1000,29392=>1000,29393=>1000,29394=>1000,29395=>1000,29396=>1000, - 29397=>1000,29398=>1000,29399=>1000,29400=>1000,29401=>1000,29402=>1000,29403=>1000,29404=>1000,29405=>1000,29406=>1000,29407=>1000,29408=>1000,29409=>1000,29410=>1000,29411=>1000,29412=>1000, - 29413=>1000,29414=>1000,29415=>1000,29416=>1000,29417=>1000,29418=>1000,29419=>1000,29420=>1000,29421=>1000,29422=>1000,29423=>1000,29424=>1000,29425=>1000,29426=>1000,29427=>1000,29428=>1000, - 29429=>1000,29430=>1000,29431=>1000,29432=>1000,29433=>1000,29434=>1000,29435=>1000,29436=>1000,29437=>1000,29438=>1000,29439=>1000,29440=>1000,29441=>1000,29442=>1000,29443=>1000,29444=>1000, - 29445=>1000,29446=>1000,29447=>1000,29448=>1000,29449=>1000,29450=>1000,29451=>1000,29452=>1000,29453=>1000,29454=>1000,29455=>1000,29456=>1000,29457=>1000,29458=>1000,29459=>1000,29460=>1000, - 29461=>1000,29462=>1000,29463=>1000,29464=>1000,29465=>1000,29466=>1000,29467=>1000,29468=>1000,29469=>1000,29470=>1000,29471=>1000,29472=>1000,29473=>1000,29474=>1000,29475=>1000,29476=>1000, - 29477=>1000,29478=>1000,29479=>1000,29480=>1000,29481=>1000,29482=>1000,29483=>1000,29484=>1000,29485=>1000,29486=>1000,29487=>1000,29488=>1000,29489=>1000,29490=>1000,29491=>1000,29492=>1000, - 29493=>1000,29494=>1000,29495=>1000,29496=>1000,29497=>1000,29498=>1000,29499=>1000,29500=>1000,29501=>1000,29502=>1000,29503=>1000,29504=>1000,29505=>1000,29506=>1000,29507=>1000,29508=>1000, - 29509=>1000,29510=>1000,29511=>1000,29512=>1000,29513=>1000,29514=>1000,29515=>1000,29516=>1000,29517=>1000,29518=>1000,29519=>1000,29520=>1000,29521=>1000,29522=>1000,29523=>1000,29524=>1000, - 29525=>1000,29526=>1000,29527=>1000,29528=>1000,29529=>1000,29530=>1000,29531=>1000,29532=>1000,29533=>1000,29534=>1000,29535=>1000,29536=>1000,29537=>1000,29538=>1000,29539=>1000,29540=>1000, - 29541=>1000,29542=>1000,29543=>1000,29544=>1000,29545=>1000,29546=>1000,29547=>1000,29548=>1000,29549=>1000,29550=>1000,29551=>1000,29552=>1000,29553=>1000,29554=>1000,29555=>1000,29556=>1000, - 29557=>1000,29558=>1000,29559=>1000,29560=>1000,29561=>1000,29562=>1000,29563=>1000,29564=>1000,29565=>1000,29566=>1000,29567=>1000,29568=>1000,29569=>1000,29570=>1000,29571=>1000,29572=>1000, - 29573=>1000,29574=>1000,29575=>1000,29576=>1000,29577=>1000,29578=>1000,29579=>1000,29580=>1000,29581=>1000,29582=>1000,29583=>1000,29584=>1000,29585=>1000,29586=>1000,29587=>1000,29588=>1000, - 29589=>1000,29590=>1000,29591=>1000,29592=>1000,29593=>1000,29594=>1000,29595=>1000,29596=>1000,29597=>1000,29598=>1000,29599=>1000,29600=>1000,29601=>1000,29602=>1000,29603=>1000,29604=>1000, - 29605=>1000,29606=>1000,29607=>1000,29608=>1000,29609=>1000,29610=>1000,29611=>1000,29612=>1000,29613=>1000,29614=>1000,29615=>1000,29616=>1000,29617=>1000,29618=>1000,29619=>1000,29620=>1000, - 29621=>1000,29622=>1000,29623=>1000,29624=>1000,29625=>1000,29626=>1000,29627=>1000,29628=>1000,29629=>1000,29630=>1000,29631=>1000,29632=>1000,29633=>1000,29634=>1000,29635=>1000,29636=>1000, - 29637=>1000,29638=>1000,29639=>1000,29640=>1000,29641=>1000,29642=>1000,29643=>1000,29644=>1000,29645=>1000,29646=>1000,29647=>1000,29648=>1000,29649=>1000,29650=>1000,29651=>1000,29652=>1000, - 29653=>1000,29654=>1000,29655=>1000,29656=>1000,29657=>1000,29658=>1000,29659=>1000,29660=>1000,29661=>1000,29662=>1000,29663=>1000,29664=>1000,29665=>1000,29666=>1000,29667=>1000,29668=>1000, - 29669=>1000,29670=>1000,29671=>1000,29672=>1000,29673=>1000,29674=>1000,29675=>1000,29676=>1000,29677=>1000,29678=>1000,29679=>1000,29680=>1000,29681=>1000,29682=>1000,29683=>1000,29684=>1000, - 29685=>1000,29686=>1000,29687=>1000,29688=>1000,29689=>1000,29690=>1000,29691=>1000,29692=>1000,29693=>1000,29694=>1000,29695=>1000,29696=>1000,29697=>1000,29698=>1000,29699=>1000,29700=>1000, - 29701=>1000,29702=>1000,29703=>1000,29704=>1000,29705=>1000,29706=>1000,29707=>1000,29708=>1000,29709=>1000,29710=>1000,29711=>1000,29712=>1000,29713=>1000,29714=>1000,29715=>1000,29716=>1000, - 29717=>1000,29718=>1000,29719=>1000,29720=>1000,29721=>1000,29722=>1000,29723=>1000,29724=>1000,29725=>1000,29726=>1000,29727=>1000,29728=>1000,29729=>1000,29730=>1000,29731=>1000,29732=>1000, - 29733=>1000,29734=>1000,29735=>1000,29736=>1000,29737=>1000,29738=>1000,29739=>1000,29740=>1000,29741=>1000,29742=>1000,29743=>1000,29744=>1000,29745=>1000,29746=>1000,29747=>1000,29748=>1000, - 29749=>1000,29750=>1000,29751=>1000,29752=>1000,29753=>1000,29754=>1000,29755=>1000,29756=>1000,29757=>1000,29758=>1000,29759=>1000,29760=>1000,29761=>1000,29762=>1000,29763=>1000,29764=>1000, - 29765=>1000,29766=>1000,29767=>1000,29768=>1000,29769=>1000,29770=>1000,29771=>1000,29772=>1000,29773=>1000,29774=>1000,29775=>1000,29776=>1000,29777=>1000,29778=>1000,29779=>1000,29780=>1000, - 29781=>1000,29782=>1000,29783=>1000,29784=>1000,29785=>1000,29786=>1000,29787=>1000,29788=>1000,29789=>1000,29790=>1000,29791=>1000,29792=>1000,29793=>1000,29794=>1000,29795=>1000,29796=>1000, - 29797=>1000,29798=>1000,29799=>1000,29800=>1000,29801=>1000,29802=>1000,29803=>1000,29804=>1000,29805=>1000,29806=>1000,29807=>1000,29808=>1000,29809=>1000,29810=>1000,29811=>1000,29812=>1000, - 29813=>1000,29814=>1000,29815=>1000,29816=>1000,29817=>1000,29818=>1000,29819=>1000,29820=>1000,29821=>1000,29822=>1000,29823=>1000,29824=>1000,29825=>1000,29826=>1000,29827=>1000,29828=>1000, - 29829=>1000,29830=>1000,29831=>1000,29832=>1000,29833=>1000,29834=>1000,29835=>1000,29836=>1000,29837=>1000,29838=>1000,29839=>1000,29840=>1000,29841=>1000,29842=>1000,29843=>1000,29844=>1000, - 29845=>1000,29846=>1000,29847=>1000,29848=>1000,29849=>1000,29850=>1000,29851=>1000,29852=>1000,29853=>1000,29854=>1000,29855=>1000,29856=>1000,29857=>1000,29858=>1000,29859=>1000,29860=>1000, - 29861=>1000,29862=>1000,29863=>1000,29864=>1000,29865=>1000,29866=>1000,29867=>1000,29868=>1000,29869=>1000,29870=>1000,29871=>1000,29872=>1000,29873=>1000,29874=>1000,29875=>1000,29876=>1000, - 29877=>1000,29878=>1000,29879=>1000,29880=>1000,29881=>1000,29882=>1000,29883=>1000,29884=>1000,29885=>1000,29886=>1000,29887=>1000,29888=>1000,29889=>1000,29890=>1000,29891=>1000,29892=>1000, - 29893=>1000,29894=>1000,29895=>1000,29896=>1000,29897=>1000,29898=>1000,29899=>1000,29900=>1000,29901=>1000,29902=>1000,29903=>1000,29904=>1000,29905=>1000,29906=>1000,29907=>1000,29908=>1000, - 29909=>1000,29910=>1000,29911=>1000,29912=>1000,29913=>1000,29914=>1000,29915=>1000,29916=>1000,29917=>1000,29918=>1000,29919=>1000,29920=>1000,29921=>1000,29922=>1000,29923=>1000,29924=>1000, - 29925=>1000,29926=>1000,29927=>1000,29928=>1000,29929=>1000,29930=>1000,29931=>1000,29932=>1000,29933=>1000,29934=>1000,29935=>1000,29936=>1000,29937=>1000,29938=>1000,29939=>1000,29940=>1000, - 29941=>1000,29942=>1000,29943=>1000,29944=>1000,29945=>1000,29946=>1000,29947=>1000,29948=>1000,29949=>1000,29950=>1000,29951=>1000,29952=>1000,29953=>1000,29954=>1000,29955=>1000,29956=>1000, - 29957=>1000,29958=>1000,29959=>1000,29960=>1000,29961=>1000,29962=>1000,29963=>1000,29964=>1000,29965=>1000,29966=>1000,29967=>1000,29968=>1000,29969=>1000,29970=>1000,29971=>1000,29972=>1000, - 29973=>1000,29974=>1000,29975=>1000,29976=>1000,29977=>1000,29978=>1000,29979=>1000,29980=>1000,29981=>1000,29982=>1000,29983=>1000,29984=>1000,29985=>1000,29986=>1000,29987=>1000,29988=>1000, - 29989=>1000,29990=>1000,29991=>1000,29992=>1000,29993=>1000,29994=>1000,29995=>1000,29996=>1000,29997=>1000,29998=>1000,29999=>1000,30000=>1000,30001=>1000,30002=>1000,30003=>1000,30004=>1000, - 30005=>1000,30006=>1000,30007=>1000,30008=>1000,30009=>1000,30010=>1000,30011=>1000,30012=>1000,30013=>1000,30014=>1000,30015=>1000,30016=>1000,30017=>1000,30018=>1000,30019=>1000,30020=>1000, - 30021=>1000,30022=>1000,30023=>1000,30024=>1000,30025=>1000,30026=>1000,30027=>1000,30028=>1000,30029=>1000,30030=>1000,30031=>1000,30032=>1000,30033=>1000,30034=>1000,30035=>1000,30036=>1000, - 30037=>1000,30038=>1000,30039=>1000,30040=>1000,30041=>1000,30042=>1000,30043=>1000,30044=>1000,30045=>1000,30046=>1000,30047=>1000,30048=>1000,30049=>1000,30050=>1000,30051=>1000,30052=>1000, - 30053=>1000,30054=>1000,30055=>1000,30056=>1000,30057=>1000,30058=>1000,30059=>1000,30060=>1000,30061=>1000,30062=>1000,30063=>1000,30064=>1000,30065=>1000,30066=>1000,30067=>1000,30068=>1000, - 30069=>1000,30070=>1000,30071=>1000,30072=>1000,30073=>1000,30074=>1000,30075=>1000,30076=>1000,30077=>1000,30078=>1000,30079=>1000,30080=>1000,30081=>1000,30082=>1000,30083=>1000,30084=>1000, - 30085=>1000,30086=>1000,30087=>1000,30088=>1000,30089=>1000,30090=>1000,30091=>1000,30092=>1000,30093=>1000,30094=>1000,30095=>1000,30096=>1000,30097=>1000,30098=>1000,30099=>1000,30100=>1000, - 30101=>1000,30102=>1000,30103=>1000,30104=>1000,30105=>1000,30106=>1000,30107=>1000,30108=>1000,30109=>1000,30110=>1000,30111=>1000,30112=>1000,30113=>1000,30114=>1000,30115=>1000,30116=>1000, - 30117=>1000,30118=>1000,30119=>1000,30120=>1000,30121=>1000,30122=>1000,30123=>1000,30124=>1000,30125=>1000,30126=>1000,30127=>1000,30128=>1000,30129=>1000,30130=>1000,30131=>1000,30132=>1000, - 30133=>1000,30134=>1000,30135=>1000,30136=>1000,30137=>1000,30138=>1000,30139=>1000,30140=>1000,30141=>1000,30142=>1000,30143=>1000,30144=>1000,30145=>1000,30146=>1000,30147=>1000,30148=>1000, - 30149=>1000,30150=>1000,30151=>1000,30152=>1000,30153=>1000,30154=>1000,30155=>1000,30156=>1000,30157=>1000,30158=>1000,30159=>1000,30160=>1000,30161=>1000,30162=>1000,30163=>1000,30164=>1000, - 30165=>1000,30166=>1000,30167=>1000,30168=>1000,30169=>1000,30170=>1000,30171=>1000,30172=>1000,30173=>1000,30174=>1000,30175=>1000,30176=>1000,30177=>1000,30178=>1000,30179=>1000,30180=>1000, - 30181=>1000,30182=>1000,30183=>1000,30184=>1000,30185=>1000,30186=>1000,30187=>1000,30188=>1000,30189=>1000,30190=>1000,30191=>1000,30192=>1000,30193=>1000,30194=>1000,30195=>1000,30196=>1000, - 30197=>1000,30198=>1000,30199=>1000,30200=>1000,30201=>1000,30202=>1000,30203=>1000,30204=>1000,30205=>1000,30206=>1000,30207=>1000,30208=>1000,30209=>1000,30210=>1000,30211=>1000,30212=>1000, - 30213=>1000,30214=>1000,30215=>1000,30216=>1000,30217=>1000,30218=>1000,30219=>1000,30220=>1000,30221=>1000,30222=>1000,30223=>1000,30224=>1000,30225=>1000,30226=>1000,30227=>1000,30228=>1000, - 30229=>1000,30230=>1000,30231=>1000,30232=>1000,30233=>1000,30234=>1000,30235=>1000,30236=>1000,30237=>1000,30238=>1000,30239=>1000,30240=>1000,30241=>1000,30242=>1000,30243=>1000,30244=>1000, - 30245=>1000,30246=>1000,30247=>1000,30248=>1000,30249=>1000,30250=>1000,30251=>1000,30252=>1000,30253=>1000,30254=>1000,30255=>1000,30256=>1000,30257=>1000,30258=>1000,30259=>1000,30260=>1000, - 30261=>1000,30262=>1000,30263=>1000,30264=>1000,30265=>1000,30266=>1000,30267=>1000,30268=>1000,30269=>1000,30270=>1000,30271=>1000,30272=>1000,30273=>1000,30274=>1000,30275=>1000,30276=>1000, - 30277=>1000,30278=>1000,30279=>1000,30280=>1000,30281=>1000,30282=>1000,30283=>1000,30284=>1000,30285=>1000,30286=>1000,30287=>1000,30288=>1000,30289=>1000,30290=>1000,30291=>1000,30292=>1000, - 30293=>1000,30294=>1000,30295=>1000,30296=>1000,30297=>1000,30298=>1000,30299=>1000,30300=>1000,30301=>1000,30302=>1000,30303=>1000,30304=>1000,30305=>1000,30306=>1000,30307=>1000,30308=>1000, - 30309=>1000,30310=>1000,30311=>1000,30312=>1000,30313=>1000,30314=>1000,30315=>1000,30316=>1000,30317=>1000,30318=>1000,30319=>1000,30320=>1000,30321=>1000,30322=>1000,30323=>1000,30324=>1000, - 30325=>1000,30326=>1000,30327=>1000,30328=>1000,30329=>1000,30330=>1000,30331=>1000,30332=>1000,30333=>1000,30334=>1000,30335=>1000,30336=>1000,30337=>1000,30338=>1000,30339=>1000,30340=>1000, - 30341=>1000,30342=>1000,30343=>1000,30344=>1000,30345=>1000,30346=>1000,30347=>1000,30348=>1000,30349=>1000,30350=>1000,30351=>1000,30352=>1000,30353=>1000,30354=>1000,30355=>1000,30356=>1000, - 30357=>1000,30358=>1000,30359=>1000,30360=>1000,30361=>1000,30362=>1000,30363=>1000,30364=>1000,30365=>1000,30366=>1000,30367=>1000,30368=>1000,30369=>1000,30370=>1000,30371=>1000,30372=>1000, - 30373=>1000,30374=>1000,30375=>1000,30376=>1000,30377=>1000,30378=>1000,30379=>1000,30380=>1000,30381=>1000,30382=>1000,30383=>1000,30384=>1000,30385=>1000,30386=>1000,30387=>1000,30388=>1000, - 30389=>1000,30390=>1000,30391=>1000,30392=>1000,30393=>1000,30394=>1000,30395=>1000,30396=>1000,30397=>1000,30398=>1000,30399=>1000,30400=>1000,30401=>1000,30402=>1000,30403=>1000,30404=>1000, - 30405=>1000,30406=>1000,30407=>1000,30408=>1000,30409=>1000,30410=>1000,30411=>1000,30412=>1000,30413=>1000,30414=>1000,30415=>1000,30416=>1000,30417=>1000,30418=>1000,30419=>1000,30420=>1000, - 30421=>1000,30422=>1000,30423=>1000,30424=>1000,30425=>1000,30426=>1000,30427=>1000,30428=>1000,30429=>1000,30430=>1000,30431=>1000,30432=>1000,30433=>1000,30434=>1000,30435=>1000,30436=>1000, - 30437=>1000,30438=>1000,30439=>1000,30440=>1000,30441=>1000,30442=>1000,30443=>1000,30444=>1000,30445=>1000,30446=>1000,30447=>1000,30448=>1000,30449=>1000,30450=>1000,30451=>1000,30452=>1000, - 30453=>1000,30454=>1000,30455=>1000,30456=>1000,30457=>1000,30458=>1000,30459=>1000,30460=>1000,30461=>1000,30462=>1000,30463=>1000,30464=>1000,30465=>1000,30466=>1000,30467=>1000,30468=>1000, - 30469=>1000,30470=>1000,30471=>1000,30472=>1000,30473=>1000,30474=>1000,30475=>1000,30476=>1000,30477=>1000,30478=>1000,30479=>1000,30480=>1000,30481=>1000,30482=>1000,30483=>1000,30484=>1000, - 30485=>1000,30486=>1000,30487=>1000,30488=>1000,30489=>1000,30490=>1000,30491=>1000,30492=>1000,30493=>1000,30494=>1000,30495=>1000,30496=>1000,30497=>1000,30498=>1000,30499=>1000,30500=>1000, - 30501=>1000,30502=>1000,30503=>1000,30504=>1000,30505=>1000,30506=>1000,30507=>1000,30508=>1000,30509=>1000,30510=>1000,30511=>1000,30512=>1000,30513=>1000,30514=>1000,30515=>1000,30516=>1000, - 30517=>1000,30518=>1000,30519=>1000,30520=>1000,30521=>1000,30522=>1000,30523=>1000,30524=>1000,30525=>1000,30526=>1000,30527=>1000,30528=>1000,30529=>1000,30530=>1000,30531=>1000,30532=>1000, - 30533=>1000,30534=>1000,30535=>1000,30536=>1000,30537=>1000,30538=>1000,30539=>1000,30540=>1000,30541=>1000,30542=>1000,30543=>1000,30544=>1000,30545=>1000,30546=>1000,30547=>1000,30548=>1000, - 30549=>1000,30550=>1000,30551=>1000,30552=>1000,30553=>1000,30554=>1000,30555=>1000,30556=>1000,30557=>1000,30558=>1000,30559=>1000,30560=>1000,30561=>1000,30562=>1000,30563=>1000,30564=>1000, - 30565=>1000,30566=>1000,30567=>1000,30568=>1000,30569=>1000,30570=>1000,30571=>1000,30572=>1000,30573=>1000,30574=>1000,30575=>1000,30576=>1000,30577=>1000,30578=>1000,30579=>1000,30580=>1000, - 30581=>1000,30582=>1000,30583=>1000,30584=>1000,30585=>1000,30586=>1000,30587=>1000,30588=>1000,30589=>1000,30590=>1000,30591=>1000,30592=>1000,30593=>1000,30594=>1000,30595=>1000,30596=>1000, - 30597=>1000,30598=>1000,30599=>1000,30600=>1000,30601=>1000,30602=>1000,30603=>1000,30604=>1000,30605=>1000,30606=>1000,30607=>1000,30608=>1000,30609=>1000,30610=>1000,30611=>1000,30612=>1000, - 30613=>1000,30614=>1000,30615=>1000,30616=>1000,30617=>1000,30618=>1000,30619=>1000,30620=>1000,30621=>1000,30622=>1000,30623=>1000,30624=>1000,30625=>1000,30626=>1000,30627=>1000,30628=>1000, - 30629=>1000,30630=>1000,30631=>1000,30632=>1000,30633=>1000,30634=>1000,30635=>1000,30636=>1000,30637=>1000,30638=>1000,30639=>1000,30640=>1000,30641=>1000,30642=>1000,30643=>1000,30644=>1000, - 30645=>1000,30646=>1000,30647=>1000,30648=>1000,30649=>1000,30650=>1000,30651=>1000,30652=>1000,30653=>1000,30654=>1000,30655=>1000,30656=>1000,30657=>1000,30658=>1000,30659=>1000,30660=>1000, - 30661=>1000,30662=>1000,30663=>1000,30664=>1000,30665=>1000,30666=>1000,30667=>1000,30668=>1000,30669=>1000,30670=>1000,30671=>1000,30672=>1000,30673=>1000,30674=>1000,30675=>1000,30676=>1000, - 30677=>1000,30678=>1000,30679=>1000,30680=>1000,30681=>1000,30682=>1000,30683=>1000,30684=>1000,30685=>1000,30686=>1000,30687=>1000,30688=>1000,30689=>1000,30690=>1000,30691=>1000,30692=>1000, - 30693=>1000,30694=>1000,30695=>1000,30696=>1000,30697=>1000,30698=>1000,30699=>1000,30700=>1000,30701=>1000,30702=>1000,30703=>1000,30704=>1000,30705=>1000,30706=>1000,30707=>1000,30708=>1000, - 30709=>1000,30710=>1000,30711=>1000,30712=>1000,30713=>1000,30714=>1000,30715=>1000,30716=>1000,30717=>1000,30718=>1000,30719=>1000,30720=>1000,30721=>1000,30722=>1000,30723=>1000,30724=>1000, - 30725=>1000,30726=>1000,30727=>1000,30728=>1000,30729=>1000,30730=>1000,30731=>1000,30732=>1000,30733=>1000,30734=>1000,30735=>1000,30736=>1000,30737=>1000,30738=>1000,30739=>1000,30740=>1000, - 30741=>1000,30742=>1000,30743=>1000,30744=>1000,30745=>1000,30746=>1000,30747=>1000,30748=>1000,30749=>1000,30750=>1000,30751=>1000,30752=>1000,30753=>1000,30754=>1000,30755=>1000,30756=>1000, - 30757=>1000,30758=>1000,30759=>1000,30760=>1000,30761=>1000,30762=>1000,30763=>1000,30764=>1000,30765=>1000,30766=>1000,30767=>1000,30768=>1000,30769=>1000,30770=>1000,30771=>1000,30772=>1000, - 30773=>1000,30774=>1000,30775=>1000,30776=>1000,30777=>1000,30778=>1000,30779=>1000,30780=>1000,30781=>1000,30782=>1000,30783=>1000,30784=>1000,30785=>1000,30786=>1000,30787=>1000,30788=>1000, - 30789=>1000,30790=>1000,30791=>1000,30792=>1000,30793=>1000,30794=>1000,30795=>1000,30796=>1000,30797=>1000,30798=>1000,30799=>1000,30800=>1000,30801=>1000,30802=>1000,30803=>1000,30804=>1000, - 30805=>1000,30806=>1000,30807=>1000,30808=>1000,30809=>1000,30810=>1000,30811=>1000,30812=>1000,30813=>1000,30814=>1000,30815=>1000,30816=>1000,30817=>1000,30818=>1000,30819=>1000,30820=>1000, - 30821=>1000,30822=>1000,30823=>1000,30824=>1000,30825=>1000,30826=>1000,30827=>1000,30828=>1000,30829=>1000,30830=>1000,30831=>1000,30832=>1000,30833=>1000,30834=>1000,30835=>1000,30836=>1000, - 30837=>1000,30838=>1000,30839=>1000,30840=>1000,30841=>1000,30842=>1000,30843=>1000,30844=>1000,30845=>1000,30846=>1000,30847=>1000,30848=>1000,30849=>1000,30850=>1000,30851=>1000,30852=>1000, - 30853=>1000,30854=>1000,30855=>1000,30856=>1000,30857=>1000,30858=>1000,30859=>1000,30860=>1000,30861=>1000,30862=>1000,30863=>1000,30864=>1000,30865=>1000,30866=>1000,30867=>1000,30868=>1000, - 30869=>1000,30870=>1000,30871=>1000,30872=>1000,30873=>1000,30874=>1000,30875=>1000,30876=>1000,30877=>1000,30878=>1000,30879=>1000,30880=>1000,30881=>1000,30882=>1000,30883=>1000,30884=>1000, - 30885=>1000,30886=>1000,30887=>1000,30888=>1000,30889=>1000,30890=>1000,30891=>1000,30892=>1000,30893=>1000,30894=>1000,30895=>1000,30896=>1000,30897=>1000,30898=>1000,30899=>1000,30900=>1000, - 30901=>1000,30902=>1000,30903=>1000,30904=>1000,30905=>1000,30906=>1000,30907=>1000,30908=>1000,30909=>1000,30910=>1000,30911=>1000,30912=>1000,30913=>1000,30914=>1000,30915=>1000,30916=>1000, - 30917=>1000,30918=>1000,30919=>1000,30920=>1000,30921=>1000,30922=>1000,30923=>1000,30924=>1000,30925=>1000,30926=>1000,30927=>1000,30928=>1000,30929=>1000,30930=>1000,30931=>1000,30932=>1000, - 30933=>1000,30934=>1000,30935=>1000,30936=>1000,30937=>1000,30938=>1000,30939=>1000,30940=>1000,30941=>1000,30942=>1000,30943=>1000,30944=>1000,30945=>1000,30946=>1000,30947=>1000,30948=>1000, - 30949=>1000,30950=>1000,30951=>1000,30952=>1000,30953=>1000,30954=>1000,30955=>1000,30956=>1000,30957=>1000,30958=>1000,30959=>1000,30960=>1000,30961=>1000,30962=>1000,30963=>1000,30964=>1000, - 30965=>1000,30966=>1000,30967=>1000,30968=>1000,30969=>1000,30970=>1000,30971=>1000,30972=>1000,30973=>1000,30974=>1000,30975=>1000,30976=>1000,30977=>1000,30978=>1000,30979=>1000,30980=>1000, - 30981=>1000,30982=>1000,30983=>1000,30984=>1000,30985=>1000,30986=>1000,30987=>1000,30988=>1000,30989=>1000,30990=>1000,30991=>1000,30992=>1000,30993=>1000,30994=>1000,30995=>1000,30996=>1000, - 30997=>1000,30998=>1000,30999=>1000,31000=>1000,31001=>1000,31002=>1000,31003=>1000,31004=>1000,31005=>1000,31006=>1000,31007=>1000,31008=>1000,31009=>1000,31010=>1000,31011=>1000,31012=>1000, - 31013=>1000,31014=>1000,31015=>1000,31016=>1000,31017=>1000,31018=>1000,31019=>1000,31020=>1000,31021=>1000,31022=>1000,31023=>1000,31024=>1000,31025=>1000,31026=>1000,31027=>1000,31028=>1000, - 31029=>1000,31030=>1000,31031=>1000,31032=>1000,31033=>1000,31034=>1000,31035=>1000,31036=>1000,31037=>1000,31038=>1000,31039=>1000,31040=>1000,31041=>1000,31042=>1000,31043=>1000,31044=>1000, - 31045=>1000,31046=>1000,31047=>1000,31048=>1000,31049=>1000,31050=>1000,31051=>1000,31052=>1000,31053=>1000,31054=>1000,31055=>1000,31056=>1000,31057=>1000,31058=>1000,31059=>1000,31060=>1000, - 31061=>1000,31062=>1000,31063=>1000,31064=>1000,31065=>1000,31066=>1000,31067=>1000,31068=>1000,31069=>1000,31070=>1000,31071=>1000,31072=>1000,31073=>1000,31074=>1000,31075=>1000,31076=>1000, - 31077=>1000,31078=>1000,31079=>1000,31080=>1000,31081=>1000,31082=>1000,31083=>1000,31084=>1000,31085=>1000,31086=>1000,31087=>1000,31088=>1000,31089=>1000,31090=>1000,31091=>1000,31092=>1000, - 31093=>1000,31094=>1000,31095=>1000,31096=>1000,31097=>1000,31098=>1000,31099=>1000,31100=>1000,31101=>1000,31102=>1000,31103=>1000,31104=>1000,31105=>1000,31106=>1000,31107=>1000,31108=>1000, - 31109=>1000,31110=>1000,31111=>1000,31112=>1000,31113=>1000,31114=>1000,31115=>1000,31116=>1000,31117=>1000,31118=>1000,31119=>1000,31120=>1000,31121=>1000,31122=>1000,31123=>1000,31124=>1000, - 31125=>1000,31126=>1000,31127=>1000,31128=>1000,31129=>1000,31130=>1000,31131=>1000,31132=>1000,31133=>1000,31134=>1000,31135=>1000,31136=>1000,31137=>1000,31138=>1000,31139=>1000,31140=>1000, - 31141=>1000,31142=>1000,31143=>1000,31144=>1000,31145=>1000,31146=>1000,31147=>1000,31148=>1000,31149=>1000,31150=>1000,31151=>1000,31152=>1000,31153=>1000,31154=>1000,31155=>1000,31156=>1000, - 31157=>1000,31158=>1000,31159=>1000,31160=>1000,31161=>1000,31162=>1000,31163=>1000,31164=>1000,31165=>1000,31166=>1000,31167=>1000,31168=>1000,31169=>1000,31170=>1000,31171=>1000,31172=>1000, - 31173=>1000,31174=>1000,31175=>1000,31176=>1000,31177=>1000,31178=>1000,31179=>1000,31180=>1000,31181=>1000,31182=>1000,31183=>1000,31184=>1000,31185=>1000,31186=>1000,31187=>1000,31188=>1000, - 31189=>1000,31190=>1000,31191=>1000,31192=>1000,31193=>1000,31194=>1000,31195=>1000,31196=>1000,31197=>1000,31198=>1000,31199=>1000,31200=>1000,31201=>1000,31202=>1000,31203=>1000,31204=>1000, - 31205=>1000,31206=>1000,31207=>1000,31208=>1000,31209=>1000,31210=>1000,31211=>1000,31212=>1000,31213=>1000,31214=>1000,31215=>1000,31216=>1000,31217=>1000,31218=>1000,31219=>1000,31220=>1000, - 31221=>1000,31222=>1000,31223=>1000,31224=>1000,31225=>1000,31226=>1000,31227=>1000,31228=>1000,31229=>1000,31230=>1000,31231=>1000,31232=>1000,31233=>1000,31234=>1000,31235=>1000,31236=>1000, - 31237=>1000,31238=>1000,31239=>1000,31240=>1000,31241=>1000,31242=>1000,31243=>1000,31244=>1000,31245=>1000,31246=>1000,31247=>1000,31248=>1000,31249=>1000,31250=>1000,31251=>1000,31252=>1000, - 31253=>1000,31254=>1000,31255=>1000,31256=>1000,31257=>1000,31258=>1000,31259=>1000,31260=>1000,31261=>1000,31262=>1000,31263=>1000,31264=>1000,31265=>1000,31266=>1000,31267=>1000,31268=>1000, - 31269=>1000,31270=>1000,31271=>1000,31272=>1000,31273=>1000,31274=>1000,31275=>1000,31276=>1000,31277=>1000,31278=>1000,31279=>1000,31280=>1000,31281=>1000,31282=>1000,31283=>1000,31284=>1000, - 31285=>1000,31286=>1000,31287=>1000,31288=>1000,31289=>1000,31290=>1000,31291=>1000,31292=>1000,31293=>1000,31294=>1000,31295=>1000,31296=>1000,31297=>1000,31298=>1000,31299=>1000,31300=>1000, - 31301=>1000,31302=>1000,31303=>1000,31304=>1000,31305=>1000,31306=>1000,31307=>1000,31308=>1000,31309=>1000,31310=>1000,31311=>1000,31312=>1000,31313=>1000,31314=>1000,31315=>1000,31316=>1000, - 31317=>1000,31318=>1000,31319=>1000,31320=>1000,31321=>1000,31322=>1000,31323=>1000,31324=>1000,31325=>1000,31326=>1000,31327=>1000,31328=>1000,31329=>1000,31330=>1000,31331=>1000,31332=>1000, - 31333=>1000,31334=>1000,31335=>1000,31336=>1000,31337=>1000,31338=>1000,31339=>1000,31340=>1000,31341=>1000,31342=>1000,31343=>1000,31344=>1000,31345=>1000,31346=>1000,31347=>1000,31348=>1000, - 31349=>1000,31350=>1000,31351=>1000,31352=>1000,31353=>1000,31354=>1000,31355=>1000,31356=>1000,31357=>1000,31358=>1000,31359=>1000,31360=>1000,31361=>1000,31362=>1000,31363=>1000,31364=>1000, - 31365=>1000,31366=>1000,31367=>1000,31368=>1000,31369=>1000,31370=>1000,31371=>1000,31372=>1000,31373=>1000,31374=>1000,31375=>1000,31376=>1000,31377=>1000,31378=>1000,31379=>1000,31380=>1000, - 31381=>1000,31382=>1000,31383=>1000,31384=>1000,31385=>1000,31386=>1000,31387=>1000,31388=>1000,31389=>1000,31390=>1000,31391=>1000,31392=>1000,31393=>1000,31394=>1000,31395=>1000,31396=>1000, - 31397=>1000,31398=>1000,31399=>1000,31400=>1000,31401=>1000,31402=>1000,31403=>1000,31404=>1000,31405=>1000,31406=>1000,31407=>1000,31408=>1000,31409=>1000,31410=>1000,31411=>1000,31412=>1000, - 31413=>1000,31414=>1000,31415=>1000,31416=>1000,31417=>1000,31418=>1000,31419=>1000,31420=>1000,31421=>1000,31422=>1000,31423=>1000,31424=>1000,31425=>1000,31426=>1000,31427=>1000,31428=>1000, - 31429=>1000,31430=>1000,31431=>1000,31432=>1000,31433=>1000,31434=>1000,31435=>1000,31436=>1000,31437=>1000,31438=>1000,31439=>1000,31440=>1000,31441=>1000,31442=>1000,31443=>1000,31444=>1000, - 31445=>1000,31446=>1000,31447=>1000,31448=>1000,31449=>1000,31450=>1000,31451=>1000,31452=>1000,31453=>1000,31454=>1000,31455=>1000,31456=>1000,31457=>1000,31458=>1000,31459=>1000,31460=>1000, - 31461=>1000,31462=>1000,31463=>1000,31464=>1000,31465=>1000,31466=>1000,31467=>1000,31468=>1000,31469=>1000,31470=>1000,31471=>1000,31472=>1000,31473=>1000,31474=>1000,31475=>1000,31476=>1000, - 31477=>1000,31478=>1000,31479=>1000,31480=>1000,31481=>1000,31482=>1000,31483=>1000,31484=>1000,31485=>1000,31486=>1000,31487=>1000,31488=>1000,31489=>1000,31490=>1000,31491=>1000,31492=>1000, - 31493=>1000,31494=>1000,31495=>1000,31496=>1000,31497=>1000,31498=>1000,31499=>1000,31500=>1000,31501=>1000,31502=>1000,31503=>1000,31504=>1000,31505=>1000,31506=>1000,31507=>1000,31508=>1000, - 31509=>1000,31510=>1000,31511=>1000,31512=>1000,31513=>1000,31514=>1000,31515=>1000,31516=>1000,31517=>1000,31518=>1000,31519=>1000,31520=>1000,31521=>1000,31522=>1000,31523=>1000,31524=>1000, - 31525=>1000,31526=>1000,31527=>1000,31528=>1000,31529=>1000,31530=>1000,31531=>1000,31532=>1000,31533=>1000,31534=>1000,31535=>1000,31536=>1000,31537=>1000,31538=>1000,31539=>1000,31540=>1000, - 31541=>1000,31542=>1000,31543=>1000,31544=>1000,31545=>1000,31546=>1000,31547=>1000,31548=>1000,31549=>1000,31550=>1000,31551=>1000,31552=>1000,31553=>1000,31554=>1000,31555=>1000,31556=>1000, - 31557=>1000,31558=>1000,31559=>1000,31560=>1000,31561=>1000,31562=>1000,31563=>1000,31564=>1000,31565=>1000,31566=>1000,31567=>1000,31568=>1000,31569=>1000,31570=>1000,31571=>1000,31572=>1000, - 31573=>1000,31574=>1000,31575=>1000,31576=>1000,31577=>1000,31578=>1000,31579=>1000,31580=>1000,31581=>1000,31582=>1000,31583=>1000,31584=>1000,31585=>1000,31586=>1000,31587=>1000,31588=>1000, - 31589=>1000,31590=>1000,31591=>1000,31592=>1000,31593=>1000,31594=>1000,31595=>1000,31596=>1000,31597=>1000,31598=>1000,31599=>1000,31600=>1000,31601=>1000,31602=>1000,31603=>1000,31604=>1000, - 31605=>1000,31606=>1000,31607=>1000,31608=>1000,31609=>1000,31610=>1000,31611=>1000,31612=>1000,31613=>1000,31614=>1000,31615=>1000,31616=>1000,31617=>1000,31618=>1000,31619=>1000,31620=>1000, - 31621=>1000,31622=>1000,31623=>1000,31624=>1000,31625=>1000,31626=>1000,31627=>1000,31628=>1000,31629=>1000,31630=>1000,31631=>1000,31632=>1000,31633=>1000,31634=>1000,31635=>1000,31636=>1000, - 31637=>1000,31638=>1000,31639=>1000,31640=>1000,31641=>1000,31642=>1000,31643=>1000,31644=>1000,31645=>1000,31646=>1000,31647=>1000,31648=>1000,31649=>1000,31650=>1000,31651=>1000,31652=>1000, - 31653=>1000,31654=>1000,31655=>1000,31656=>1000,31657=>1000,31658=>1000,31659=>1000,31660=>1000,31661=>1000,31662=>1000,31663=>1000,31664=>1000,31665=>1000,31666=>1000,31667=>1000,31668=>1000, - 31669=>1000,31670=>1000,31671=>1000,31672=>1000,31673=>1000,31674=>1000,31675=>1000,31676=>1000,31677=>1000,31678=>1000,31679=>1000,31680=>1000,31681=>1000,31682=>1000,31683=>1000,31684=>1000, - 31685=>1000,31686=>1000,31687=>1000,31688=>1000,31689=>1000,31690=>1000,31691=>1000,31692=>1000,31693=>1000,31694=>1000,31695=>1000,31696=>1000,31697=>1000,31698=>1000,31699=>1000,31700=>1000, - 31701=>1000,31702=>1000,31703=>1000,31704=>1000,31705=>1000,31706=>1000,31707=>1000,31708=>1000,31709=>1000,31710=>1000,31711=>1000,31712=>1000,31713=>1000,31714=>1000,31715=>1000,31716=>1000, - 31717=>1000,31718=>1000,31719=>1000,31720=>1000,31721=>1000,31722=>1000,31723=>1000,31724=>1000,31725=>1000,31726=>1000,31727=>1000,31728=>1000,31729=>1000,31730=>1000,31731=>1000,31732=>1000, - 31733=>1000,31734=>1000,31735=>1000,31736=>1000,31737=>1000,31738=>1000,31739=>1000,31740=>1000,31741=>1000,31742=>1000,31743=>1000,31744=>1000,31745=>1000,31746=>1000,31747=>1000,31748=>1000, - 31749=>1000,31750=>1000,31751=>1000,31752=>1000,31753=>1000,31754=>1000,31755=>1000,31756=>1000,31757=>1000,31758=>1000,31759=>1000,31760=>1000,31761=>1000,31762=>1000,31763=>1000,31764=>1000, - 31765=>1000,31766=>1000,31767=>1000,31768=>1000,31769=>1000,31770=>1000,31771=>1000,31772=>1000,31773=>1000,31774=>1000,31775=>1000,31776=>1000,31777=>1000,31778=>1000,31779=>1000,31780=>1000, - 31781=>1000,31782=>1000,31783=>1000,31784=>1000,31785=>1000,31786=>1000,31787=>1000,31788=>1000,31789=>1000,31790=>1000,31791=>1000,31792=>1000,31793=>1000,31794=>1000,31795=>1000,31796=>1000, - 31797=>1000,31798=>1000,31799=>1000,31800=>1000,31801=>1000,31802=>1000,31803=>1000,31804=>1000,31805=>1000,31806=>1000,31807=>1000,31808=>1000,31809=>1000,31810=>1000,31811=>1000,31812=>1000, - 31813=>1000,31814=>1000,31815=>1000,31816=>1000,31817=>1000,31818=>1000,31819=>1000,31820=>1000,31821=>1000,31822=>1000,31823=>1000,31824=>1000,31825=>1000,31826=>1000,31827=>1000,31828=>1000, - 31829=>1000,31830=>1000,31831=>1000,31832=>1000,31833=>1000,31834=>1000,31835=>1000,31836=>1000,31837=>1000,31838=>1000,31839=>1000,31840=>1000,31841=>1000,31842=>1000,31843=>1000,31844=>1000, - 31845=>1000,31846=>1000,31847=>1000,31848=>1000,31849=>1000,31850=>1000,31851=>1000,31852=>1000,31853=>1000,31854=>1000,31855=>1000,31856=>1000,31857=>1000,31858=>1000,31859=>1000,31860=>1000, - 31861=>1000,31862=>1000,31863=>1000,31864=>1000,31865=>1000,31866=>1000,31867=>1000,31868=>1000,31869=>1000,31870=>1000,31871=>1000,31872=>1000,31873=>1000,31874=>1000,31875=>1000,31876=>1000, - 31877=>1000,31878=>1000,31879=>1000,31880=>1000,31881=>1000,31882=>1000,31883=>1000,31884=>1000,31885=>1000,31886=>1000,31887=>1000,31888=>1000,31889=>1000,31890=>1000,31891=>1000,31892=>1000, - 31893=>1000,31894=>1000,31895=>1000,31896=>1000,31897=>1000,31898=>1000,31899=>1000,31900=>1000,31901=>1000,31902=>1000,31903=>1000,31904=>1000,31905=>1000,31906=>1000,31907=>1000,31908=>1000, - 31909=>1000,31910=>1000,31911=>1000,31912=>1000,31913=>1000,31914=>1000,31915=>1000,31916=>1000,31917=>1000,31918=>1000,31919=>1000,31920=>1000,31921=>1000,31922=>1000,31923=>1000,31924=>1000, - 31925=>1000,31926=>1000,31927=>1000,31928=>1000,31929=>1000,31930=>1000,31931=>1000,31932=>1000,31933=>1000,31934=>1000,31935=>1000,31936=>1000,31937=>1000,31938=>1000,31939=>1000,31940=>1000, - 31941=>1000,31942=>1000,31943=>1000,31944=>1000,31945=>1000,31946=>1000,31947=>1000,31948=>1000,31949=>1000,31950=>1000,31951=>1000,31952=>1000,31953=>1000,31954=>1000,31955=>1000,31956=>1000, - 31957=>1000,31958=>1000,31959=>1000,31960=>1000,31961=>1000,31962=>1000,31963=>1000,31964=>1000,31965=>1000,31966=>1000,31967=>1000,31968=>1000,31969=>1000,31970=>1000,31971=>1000,31972=>1000, - 31973=>1000,31974=>1000,31975=>1000,31976=>1000,31977=>1000,31978=>1000,31979=>1000,31980=>1000,31981=>1000,31982=>1000,31983=>1000,31984=>1000,31985=>1000,31986=>1000,31987=>1000,31988=>1000, - 31989=>1000,31990=>1000,31991=>1000,31992=>1000,31993=>1000,31994=>1000,31995=>1000,31996=>1000,31997=>1000,31998=>1000,31999=>1000,32000=>1000,32001=>1000,32002=>1000,32003=>1000,32004=>1000, - 32005=>1000,32006=>1000,32007=>1000,32008=>1000,32009=>1000,32010=>1000,32011=>1000,32012=>1000,32013=>1000,32014=>1000,32015=>1000,32016=>1000,32017=>1000,32018=>1000,32019=>1000,32020=>1000, - 32021=>1000,32022=>1000,32023=>1000,32024=>1000,32025=>1000,32026=>1000,32027=>1000,32028=>1000,32029=>1000,32030=>1000,32031=>1000,32032=>1000,32033=>1000,32034=>1000,32035=>1000,32036=>1000, - 32037=>1000,32038=>1000,32039=>1000,32040=>1000,32041=>1000,32042=>1000,32043=>1000,32044=>1000,32045=>1000,32046=>1000,32047=>1000,32048=>1000,32049=>1000,32050=>1000,32051=>1000,32052=>1000, - 32053=>1000,32054=>1000,32055=>1000,32056=>1000,32057=>1000,32058=>1000,32059=>1000,32060=>1000,32061=>1000,32062=>1000,32063=>1000,32064=>1000,32065=>1000,32066=>1000,32067=>1000,32068=>1000, - 32069=>1000,32070=>1000,32071=>1000,32072=>1000,32073=>1000,32074=>1000,32075=>1000,32076=>1000,32077=>1000,32078=>1000,32079=>1000,32080=>1000,32081=>1000,32082=>1000,32083=>1000,32084=>1000, - 32085=>1000,32086=>1000,32087=>1000,32088=>1000,32089=>1000,32090=>1000,32091=>1000,32092=>1000,32093=>1000,32094=>1000,32095=>1000,32096=>1000,32097=>1000,32098=>1000,32099=>1000,32100=>1000, - 32101=>1000,32102=>1000,32103=>1000,32104=>1000,32105=>1000,32106=>1000,32107=>1000,32108=>1000,32109=>1000,32110=>1000,32111=>1000,32112=>1000,32113=>1000,32114=>1000,32115=>1000,32116=>1000, - 32117=>1000,32118=>1000,32119=>1000,32120=>1000,32121=>1000,32122=>1000,32123=>1000,32124=>1000,32125=>1000,32126=>1000,32127=>1000,32128=>1000,32129=>1000,32130=>1000,32131=>1000,32132=>1000, - 32133=>1000,32134=>1000,32135=>1000,32136=>1000,32137=>1000,32138=>1000,32139=>1000,32140=>1000,32141=>1000,32142=>1000,32143=>1000,32144=>1000,32145=>1000,32146=>1000,32147=>1000,32148=>1000, - 32149=>1000,32150=>1000,32151=>1000,32152=>1000,32153=>1000,32154=>1000,32155=>1000,32156=>1000,32157=>1000,32158=>1000,32159=>1000,32160=>1000,32161=>1000,32162=>1000,32163=>1000,32164=>1000, - 32165=>1000,32166=>1000,32167=>1000,32168=>1000,32169=>1000,32170=>1000,32171=>1000,32172=>1000,32173=>1000,32174=>1000,32175=>1000,32176=>1000,32177=>1000,32178=>1000,32179=>1000,32180=>1000, - 32181=>1000,32182=>1000,32183=>1000,32184=>1000,32185=>1000,32186=>1000,32187=>1000,32188=>1000,32189=>1000,32190=>1000,32191=>1000,32192=>1000,32193=>1000,32194=>1000,32195=>1000,32196=>1000, - 32197=>1000,32198=>1000,32199=>1000,32200=>1000,32201=>1000,32202=>1000,32203=>1000,32204=>1000,32205=>1000,32206=>1000,32207=>1000,32208=>1000,32209=>1000,32210=>1000,32211=>1000,32212=>1000, - 32213=>1000,32214=>1000,32215=>1000,32216=>1000,32217=>1000,32218=>1000,32219=>1000,32220=>1000,32221=>1000,32222=>1000,32223=>1000,32224=>1000,32225=>1000,32226=>1000,32227=>1000,32228=>1000, - 32229=>1000,32230=>1000,32231=>1000,32232=>1000,32233=>1000,32234=>1000,32235=>1000,32236=>1000,32237=>1000,32238=>1000,32239=>1000,32240=>1000,32241=>1000,32242=>1000,32243=>1000,32244=>1000, - 32245=>1000,32246=>1000,32247=>1000,32248=>1000,32249=>1000,32250=>1000,32251=>1000,32252=>1000,32253=>1000,32254=>1000,32255=>1000,32256=>1000,32257=>1000,32258=>1000,32259=>1000,32260=>1000, - 32261=>1000,32262=>1000,32263=>1000,32264=>1000,32265=>1000,32266=>1000,32267=>1000,32268=>1000,32269=>1000,32270=>1000,32271=>1000,32272=>1000,32273=>1000,32274=>1000,32275=>1000,32276=>1000, - 32277=>1000,32278=>1000,32279=>1000,32280=>1000,32281=>1000,32282=>1000,32283=>1000,32284=>1000,32285=>1000,32286=>1000,32287=>1000,32288=>1000,32289=>1000,32290=>1000,32291=>1000,32292=>1000, - 32293=>1000,32294=>1000,32295=>1000,32296=>1000,32297=>1000,32298=>1000,32299=>1000,32300=>1000,32301=>1000,32302=>1000,32303=>1000,32304=>1000,32305=>1000,32306=>1000,32307=>1000,32308=>1000, - 32309=>1000,32310=>1000,32311=>1000,32312=>1000,32313=>1000,32314=>1000,32315=>1000,32316=>1000,32317=>1000,32318=>1000,32319=>1000,32320=>1000,32321=>1000,32322=>1000,32323=>1000,32324=>1000, - 32325=>1000,32326=>1000,32327=>1000,32328=>1000,32329=>1000,32330=>1000,32331=>1000,32332=>1000,32333=>1000,32334=>1000,32335=>1000,32336=>1000,32337=>1000,32338=>1000,32339=>1000,32340=>1000, - 32341=>1000,32342=>1000,32343=>1000,32344=>1000,32345=>1000,32346=>1000,32347=>1000,32348=>1000,32349=>1000,32350=>1000,32351=>1000,32352=>1000,32353=>1000,32354=>1000,32355=>1000,32356=>1000, - 32357=>1000,32358=>1000,32359=>1000,32360=>1000,32361=>1000,32362=>1000,32363=>1000,32364=>1000,32365=>1000,32366=>1000,32367=>1000,32368=>1000,32369=>1000,32370=>1000,32371=>1000,32372=>1000, - 32373=>1000,32374=>1000,32375=>1000,32376=>1000,32377=>1000,32378=>1000,32379=>1000,32380=>1000,32381=>1000,32382=>1000,32383=>1000,32384=>1000,32385=>1000,32386=>1000,32387=>1000,32388=>1000, - 32389=>1000,32390=>1000,32391=>1000,32392=>1000,32393=>1000,32394=>1000,32395=>1000,32396=>1000,32397=>1000,32398=>1000,32399=>1000,32400=>1000,32401=>1000,32402=>1000,32403=>1000,32404=>1000, - 32405=>1000,32406=>1000,32407=>1000,32408=>1000,32409=>1000,32410=>1000,32411=>1000,32412=>1000,32413=>1000,32414=>1000,32415=>1000,32416=>1000,32417=>1000,32418=>1000,32419=>1000,32420=>1000, - 32421=>1000,32422=>1000,32423=>1000,32424=>1000,32425=>1000,32426=>1000,32427=>1000,32428=>1000,32429=>1000,32430=>1000,32431=>1000,32432=>1000,32433=>1000,32434=>1000,32435=>1000,32436=>1000, - 32437=>1000,32438=>1000,32439=>1000,32440=>1000,32441=>1000,32442=>1000,32443=>1000,32444=>1000,32445=>1000,32446=>1000,32447=>1000,32448=>1000,32449=>1000,32450=>1000,32451=>1000,32452=>1000, - 32453=>1000,32454=>1000,32455=>1000,32456=>1000,32457=>1000,32458=>1000,32459=>1000,32460=>1000,32461=>1000,32462=>1000,32463=>1000,32464=>1000,32465=>1000,32466=>1000,32467=>1000,32468=>1000, - 32469=>1000,32470=>1000,32471=>1000,32472=>1000,32473=>1000,32474=>1000,32475=>1000,32476=>1000,32477=>1000,32478=>1000,32479=>1000,32480=>1000,32481=>1000,32482=>1000,32483=>1000,32484=>1000, - 32485=>1000,32486=>1000,32487=>1000,32488=>1000,32489=>1000,32490=>1000,32491=>1000,32492=>1000,32493=>1000,32494=>1000,32495=>1000,32496=>1000,32497=>1000,32498=>1000,32499=>1000,32500=>1000, - 32501=>1000,32502=>1000,32503=>1000,32504=>1000,32505=>1000,32506=>1000,32507=>1000,32508=>1000,32509=>1000,32510=>1000,32511=>1000,32512=>1000,32513=>1000,32514=>1000,32515=>1000,32516=>1000, - 32517=>1000,32518=>1000,32519=>1000,32520=>1000,32521=>1000,32522=>1000,32523=>1000,32524=>1000,32525=>1000,32526=>1000,32527=>1000,32528=>1000,32529=>1000,32530=>1000,32531=>1000,32532=>1000, - 32533=>1000,32534=>1000,32535=>1000,32536=>1000,32537=>1000,32538=>1000,32539=>1000,32540=>1000,32541=>1000,32542=>1000,32543=>1000,32544=>1000,32545=>1000,32546=>1000,32547=>1000,32548=>1000, - 32549=>1000,32550=>1000,32551=>1000,32552=>1000,32553=>1000,32554=>1000,32555=>1000,32556=>1000,32557=>1000,32558=>1000,32559=>1000,32560=>1000,32561=>1000,32562=>1000,32563=>1000,32564=>1000, - 32565=>1000,32566=>1000,32567=>1000,32568=>1000,32569=>1000,32570=>1000,32571=>1000,32572=>1000,32573=>1000,32574=>1000,32575=>1000,32576=>1000,32577=>1000,32578=>1000,32579=>1000,32580=>1000, - 32581=>1000,32582=>1000,32583=>1000,32584=>1000,32585=>1000,32586=>1000,32587=>1000,32588=>1000,32589=>1000,32590=>1000,32591=>1000,32592=>1000,32593=>1000,32594=>1000,32595=>1000,32596=>1000, - 32597=>1000,32598=>1000,32599=>1000,32600=>1000,32601=>1000,32602=>1000,32603=>1000,32604=>1000,32605=>1000,32606=>1000,32607=>1000,32608=>1000,32609=>1000,32610=>1000,32611=>1000,32612=>1000, - 32613=>1000,32614=>1000,32615=>1000,32616=>1000,32617=>1000,32618=>1000,32619=>1000,32620=>1000,32621=>1000,32622=>1000,32623=>1000,32624=>1000,32625=>1000,32626=>1000,32627=>1000,32628=>1000, - 32629=>1000,32630=>1000,32631=>1000,32632=>1000,32633=>1000,32634=>1000,32635=>1000,32636=>1000,32637=>1000,32638=>1000,32639=>1000,32640=>1000,32641=>1000,32642=>1000,32643=>1000,32644=>1000, - 32645=>1000,32646=>1000,32647=>1000,32648=>1000,32649=>1000,32650=>1000,32651=>1000,32652=>1000,32653=>1000,32654=>1000,32655=>1000,32656=>1000,32657=>1000,32658=>1000,32659=>1000,32660=>1000, - 32661=>1000,32662=>1000,32663=>1000,32664=>1000,32665=>1000,32666=>1000,32667=>1000,32668=>1000,32669=>1000,32670=>1000,32671=>1000,32672=>1000,32673=>1000,32674=>1000,32675=>1000,32676=>1000, - 32677=>1000,32678=>1000,32679=>1000,32680=>1000,32681=>1000,32682=>1000,32683=>1000,32684=>1000,32685=>1000,32686=>1000,32687=>1000,32688=>1000,32689=>1000,32690=>1000,32691=>1000,32692=>1000, - 32693=>1000,32694=>1000,32695=>1000,32696=>1000,32697=>1000,32698=>1000,32699=>1000,32700=>1000,32701=>1000,32702=>1000,32703=>1000,32704=>1000,32705=>1000,32706=>1000,32707=>1000,32708=>1000, - 32709=>1000,32710=>1000,32711=>1000,32712=>1000,32713=>1000,32714=>1000,32715=>1000,32716=>1000,32717=>1000,32718=>1000,32719=>1000,32720=>1000,32721=>1000,32722=>1000,32723=>1000,32724=>1000, - 32725=>1000,32726=>1000,32727=>1000,32728=>1000,32729=>1000,32730=>1000,32731=>1000,32732=>1000,32733=>1000,32734=>1000,32735=>1000,32736=>1000,32737=>1000,32738=>1000,32739=>1000,32740=>1000, - 32741=>1000,32742=>1000,32743=>1000,32744=>1000,32745=>1000,32746=>1000,32747=>1000,32748=>1000,32749=>1000,32750=>1000,32751=>1000,32752=>1000,32753=>1000,32754=>1000,32755=>1000,32756=>1000, - 32757=>1000,32758=>1000,32759=>1000,32760=>1000,32761=>1000,32762=>1000,32763=>1000,32764=>1000,32765=>1000,32766=>1000,32767=>1000,32768=>1000,32769=>1000,32770=>1000,32771=>1000,32772=>1000, - 32773=>1000,32774=>1000,32775=>1000,32776=>1000,32777=>1000,32778=>1000,32779=>1000,32780=>1000,32781=>1000,32782=>1000,32783=>1000,32784=>1000,32785=>1000,32786=>1000,32787=>1000,32788=>1000, - 32789=>1000,32790=>1000,32791=>1000,32792=>1000,32793=>1000,32794=>1000,32795=>1000,32796=>1000,32797=>1000,32798=>1000,32799=>1000,32800=>1000,32801=>1000,32802=>1000,32803=>1000,32804=>1000, - 32805=>1000,32806=>1000,32807=>1000,32808=>1000,32809=>1000,32810=>1000,32811=>1000,32812=>1000,32813=>1000,32814=>1000,32815=>1000,32816=>1000,32817=>1000,32818=>1000,32819=>1000,32820=>1000, - 32821=>1000,32822=>1000,32823=>1000,32824=>1000,32825=>1000,32826=>1000,32827=>1000,32828=>1000,32829=>1000,32830=>1000,32831=>1000,32832=>1000,32833=>1000,32834=>1000,32835=>1000,32836=>1000, - 32837=>1000,32838=>1000,32839=>1000,32840=>1000,32841=>1000,32842=>1000,32843=>1000,32844=>1000,32845=>1000,32846=>1000,32847=>1000,32848=>1000,32849=>1000,32850=>1000,32851=>1000,32852=>1000, - 32853=>1000,32854=>1000,32855=>1000,32856=>1000,32857=>1000,32858=>1000,32859=>1000,32860=>1000,32861=>1000,32862=>1000,32863=>1000,32864=>1000,32865=>1000,32866=>1000,32867=>1000,32868=>1000, - 32869=>1000,32870=>1000,32871=>1000,32872=>1000,32873=>1000,32874=>1000,32875=>1000,32876=>1000,32877=>1000,32878=>1000,32879=>1000,32880=>1000,32881=>1000,32882=>1000,32883=>1000,32884=>1000, - 32885=>1000,32886=>1000,32887=>1000,32888=>1000,32889=>1000,32890=>1000,32891=>1000,32892=>1000,32893=>1000,32894=>1000,32895=>1000,32896=>1000,32897=>1000,32898=>1000,32899=>1000,32900=>1000, - 32901=>1000,32902=>1000,32903=>1000,32904=>1000,32905=>1000,32906=>1000,32907=>1000,32908=>1000,32909=>1000,32910=>1000,32911=>1000,32912=>1000,32913=>1000,32914=>1000,32915=>1000,32916=>1000, - 32917=>1000,32918=>1000,32919=>1000,32920=>1000,32921=>1000,32922=>1000,32923=>1000,32924=>1000,32925=>1000,32926=>1000,32927=>1000,32928=>1000,32929=>1000,32930=>1000,32931=>1000,32932=>1000, - 32933=>1000,32934=>1000,32935=>1000,32936=>1000,32937=>1000,32938=>1000,32939=>1000,32940=>1000,32941=>1000,32942=>1000,32943=>1000,32944=>1000,32945=>1000,32946=>1000,32947=>1000,32948=>1000, - 32949=>1000,32950=>1000,32951=>1000,32952=>1000,32953=>1000,32954=>1000,32955=>1000,32956=>1000,32957=>1000,32958=>1000,32959=>1000,32960=>1000,32961=>1000,32962=>1000,32963=>1000,32964=>1000, - 32965=>1000,32966=>1000,32967=>1000,32968=>1000,32969=>1000,32970=>1000,32971=>1000,32972=>1000,32973=>1000,32974=>1000,32975=>1000,32976=>1000,32977=>1000,32978=>1000,32979=>1000,32980=>1000, - 32981=>1000,32982=>1000,32983=>1000,32984=>1000,32985=>1000,32986=>1000,32987=>1000,32988=>1000,32989=>1000,32990=>1000,32991=>1000,32992=>1000,32993=>1000,32994=>1000,32995=>1000,32996=>1000, - 32997=>1000,32998=>1000,32999=>1000,33000=>1000,33001=>1000,33002=>1000,33003=>1000,33004=>1000,33005=>1000,33006=>1000,33007=>1000,33008=>1000,33009=>1000,33010=>1000,33011=>1000,33012=>1000, - 33013=>1000,33014=>1000,33015=>1000,33016=>1000,33017=>1000,33018=>1000,33019=>1000,33020=>1000,33021=>1000,33022=>1000,33023=>1000,33024=>1000,33025=>1000,33026=>1000,33027=>1000,33028=>1000, - 33029=>1000,33030=>1000,33031=>1000,33032=>1000,33033=>1000,33034=>1000,33035=>1000,33036=>1000,33037=>1000,33038=>1000,33039=>1000,33040=>1000,33041=>1000,33042=>1000,33043=>1000,33044=>1000, - 33045=>1000,33046=>1000,33047=>1000,33048=>1000,33049=>1000,33050=>1000,33051=>1000,33052=>1000,33053=>1000,33054=>1000,33055=>1000,33056=>1000,33057=>1000,33058=>1000,33059=>1000,33060=>1000, - 33061=>1000,33062=>1000,33063=>1000,33064=>1000,33065=>1000,33066=>1000,33067=>1000,33068=>1000,33069=>1000,33070=>1000,33071=>1000,33072=>1000,33073=>1000,33074=>1000,33075=>1000,33076=>1000, - 33077=>1000,33078=>1000,33079=>1000,33080=>1000,33081=>1000,33082=>1000,33083=>1000,33084=>1000,33085=>1000,33086=>1000,33087=>1000,33088=>1000,33089=>1000,33090=>1000,33091=>1000,33092=>1000, - 33093=>1000,33094=>1000,33095=>1000,33096=>1000,33097=>1000,33098=>1000,33099=>1000,33100=>1000,33101=>1000,33102=>1000,33103=>1000,33104=>1000,33105=>1000,33106=>1000,33107=>1000,33108=>1000, - 33109=>1000,33110=>1000,33111=>1000,33112=>1000,33113=>1000,33114=>1000,33115=>1000,33116=>1000,33117=>1000,33118=>1000,33119=>1000,33120=>1000,33121=>1000,33122=>1000,33123=>1000,33124=>1000, - 33125=>1000,33126=>1000,33127=>1000,33128=>1000,33129=>1000,33130=>1000,33131=>1000,33132=>1000,33133=>1000,33134=>1000,33135=>1000,33136=>1000,33137=>1000,33138=>1000,33139=>1000,33140=>1000, - 33141=>1000,33142=>1000,33143=>1000,33144=>1000,33145=>1000,33146=>1000,33147=>1000,33148=>1000,33149=>1000,33150=>1000,33151=>1000,33152=>1000,33153=>1000,33154=>1000,33155=>1000,33156=>1000, - 33157=>1000,33158=>1000,33159=>1000,33160=>1000,33161=>1000,33162=>1000,33163=>1000,33164=>1000,33165=>1000,33166=>1000,33167=>1000,33168=>1000,33169=>1000,33170=>1000,33171=>1000,33172=>1000, - 33173=>1000,33174=>1000,33175=>1000,33176=>1000,33177=>1000,33178=>1000,33179=>1000,33180=>1000,33181=>1000,33182=>1000,33183=>1000,33184=>1000,33185=>1000,33186=>1000,33187=>1000,33188=>1000, - 33189=>1000,33190=>1000,33191=>1000,33192=>1000,33193=>1000,33194=>1000,33195=>1000,33196=>1000,33197=>1000,33198=>1000,33199=>1000,33200=>1000,33201=>1000,33202=>1000,33203=>1000,33204=>1000, - 33205=>1000,33206=>1000,33207=>1000,33208=>1000,33209=>1000,33210=>1000,33211=>1000,33212=>1000,33213=>1000,33214=>1000,33215=>1000,33216=>1000,33217=>1000,33218=>1000,33219=>1000,33220=>1000, - 33221=>1000,33222=>1000,33223=>1000,33224=>1000,33225=>1000,33226=>1000,33227=>1000,33228=>1000,33229=>1000,33230=>1000,33231=>1000,33232=>1000,33233=>1000,33234=>1000,33235=>1000,33236=>1000, - 33237=>1000,33238=>1000,33239=>1000,33240=>1000,33241=>1000,33242=>1000,33243=>1000,33244=>1000,33245=>1000,33246=>1000,33247=>1000,33248=>1000,33249=>1000,33250=>1000,33251=>1000,33252=>1000, - 33253=>1000,33254=>1000,33255=>1000,33256=>1000,33257=>1000,33258=>1000,33259=>1000,33260=>1000,33261=>1000,33262=>1000,33263=>1000,33264=>1000,33265=>1000,33266=>1000,33267=>1000,33268=>1000, - 33269=>1000,33270=>1000,33271=>1000,33272=>1000,33273=>1000,33274=>1000,33275=>1000,33276=>1000,33277=>1000,33278=>1000,33279=>1000,33280=>1000,33281=>1000,33282=>1000,33283=>1000,33284=>1000, - 33285=>1000,33286=>1000,33287=>1000,33288=>1000,33289=>1000,33290=>1000,33291=>1000,33292=>1000,33293=>1000,33294=>1000,33295=>1000,33296=>1000,33297=>1000,33298=>1000,33299=>1000,33300=>1000, - 33301=>1000,33302=>1000,33303=>1000,33304=>1000,33305=>1000,33306=>1000,33307=>1000,33308=>1000,33309=>1000,33310=>1000,33311=>1000,33312=>1000,33313=>1000,33314=>1000,33315=>1000,33316=>1000, - 33317=>1000,33318=>1000,33319=>1000,33320=>1000,33321=>1000,33322=>1000,33323=>1000,33324=>1000,33325=>1000,33326=>1000,33327=>1000,33328=>1000,33329=>1000,33330=>1000,33331=>1000,33332=>1000, - 33333=>1000,33334=>1000,33335=>1000,33336=>1000,33337=>1000,33338=>1000,33339=>1000,33340=>1000,33341=>1000,33342=>1000,33343=>1000,33344=>1000,33345=>1000,33346=>1000,33347=>1000,33348=>1000, - 33349=>1000,33350=>1000,33351=>1000,33352=>1000,33353=>1000,33354=>1000,33355=>1000,33356=>1000,33357=>1000,33358=>1000,33359=>1000,33360=>1000,33361=>1000,33362=>1000,33363=>1000,33364=>1000, - 33365=>1000,33366=>1000,33367=>1000,33368=>1000,33369=>1000,33370=>1000,33371=>1000,33372=>1000,33373=>1000,33374=>1000,33375=>1000,33376=>1000,33377=>1000,33378=>1000,33379=>1000,33380=>1000, - 33381=>1000,33382=>1000,33383=>1000,33384=>1000,33385=>1000,33386=>1000,33387=>1000,33388=>1000,33389=>1000,33390=>1000,33391=>1000,33392=>1000,33393=>1000,33394=>1000,33395=>1000,33396=>1000, - 33397=>1000,33398=>1000,33399=>1000,33400=>1000,33401=>1000,33402=>1000,33403=>1000,33404=>1000,33405=>1000,33406=>1000,33407=>1000,33408=>1000,33409=>1000,33410=>1000,33411=>1000,33412=>1000, - 33413=>1000,33414=>1000,33415=>1000,33416=>1000,33417=>1000,33418=>1000,33419=>1000,33420=>1000,33421=>1000,33422=>1000,33423=>1000,33424=>1000,33425=>1000,33426=>1000,33427=>1000,33428=>1000, - 33429=>1000,33430=>1000,33431=>1000,33432=>1000,33433=>1000,33434=>1000,33435=>1000,33436=>1000,33437=>1000,33438=>1000,33439=>1000,33440=>1000,33441=>1000,33442=>1000,33443=>1000,33444=>1000, - 33445=>1000,33446=>1000,33447=>1000,33448=>1000,33449=>1000,33450=>1000,33451=>1000,33452=>1000,33453=>1000,33454=>1000,33455=>1000,33456=>1000,33457=>1000,33458=>1000,33459=>1000,33460=>1000, - 33461=>1000,33462=>1000,33463=>1000,33464=>1000,33465=>1000,33466=>1000,33467=>1000,33468=>1000,33469=>1000,33470=>1000,33471=>1000,33472=>1000,33473=>1000,33474=>1000,33475=>1000,33476=>1000, - 33477=>1000,33478=>1000,33479=>1000,33480=>1000,33481=>1000,33482=>1000,33483=>1000,33484=>1000,33485=>1000,33486=>1000,33487=>1000,33488=>1000,33489=>1000,33490=>1000,33491=>1000,33492=>1000, - 33493=>1000,33494=>1000,33495=>1000,33496=>1000,33497=>1000,33498=>1000,33499=>1000,33500=>1000,33501=>1000,33502=>1000,33503=>1000,33504=>1000,33505=>1000,33506=>1000,33507=>1000,33508=>1000, - 33509=>1000,33510=>1000,33511=>1000,33512=>1000,33513=>1000,33514=>1000,33515=>1000,33516=>1000,33517=>1000,33518=>1000,33519=>1000,33520=>1000,33521=>1000,33522=>1000,33523=>1000,33524=>1000, - 33525=>1000,33526=>1000,33527=>1000,33528=>1000,33529=>1000,33530=>1000,33531=>1000,33532=>1000,33533=>1000,33534=>1000,33535=>1000,33536=>1000,33537=>1000,33538=>1000,33539=>1000,33540=>1000, - 33541=>1000,33542=>1000,33543=>1000,33544=>1000,33545=>1000,33546=>1000,33547=>1000,33548=>1000,33549=>1000,33550=>1000,33551=>1000,33552=>1000,33553=>1000,33554=>1000,33555=>1000,33556=>1000, - 33557=>1000,33558=>1000,33559=>1000,33560=>1000,33561=>1000,33562=>1000,33563=>1000,33564=>1000,33565=>1000,33566=>1000,33567=>1000,33568=>1000,33569=>1000,33570=>1000,33571=>1000,33572=>1000, - 33573=>1000,33574=>1000,33575=>1000,33576=>1000,33577=>1000,33578=>1000,33579=>1000,33580=>1000,33581=>1000,33582=>1000,33583=>1000,33584=>1000,33585=>1000,33586=>1000,33587=>1000,33588=>1000, - 33589=>1000,33590=>1000,33591=>1000,33592=>1000,33593=>1000,33594=>1000,33595=>1000,33596=>1000,33597=>1000,33598=>1000,33599=>1000,33600=>1000,33601=>1000,33602=>1000,33603=>1000,33604=>1000, - 33605=>1000,33606=>1000,33607=>1000,33608=>1000,33609=>1000,33610=>1000,33611=>1000,33612=>1000,33613=>1000,33614=>1000,33615=>1000,33616=>1000,33617=>1000,33618=>1000,33619=>1000,33620=>1000, - 33621=>1000,33622=>1000,33623=>1000,33624=>1000,33625=>1000,33626=>1000,33627=>1000,33628=>1000,33629=>1000,33630=>1000,33631=>1000,33632=>1000,33633=>1000,33634=>1000,33635=>1000,33636=>1000, - 33637=>1000,33638=>1000,33639=>1000,33640=>1000,33641=>1000,33642=>1000,33643=>1000,33644=>1000,33645=>1000,33646=>1000,33647=>1000,33648=>1000,33649=>1000,33650=>1000,33651=>1000,33652=>1000, - 33653=>1000,33654=>1000,33655=>1000,33656=>1000,33657=>1000,33658=>1000,33659=>1000,33660=>1000,33661=>1000,33662=>1000,33663=>1000,33664=>1000,33665=>1000,33666=>1000,33667=>1000,33668=>1000, - 33669=>1000,33670=>1000,33671=>1000,33672=>1000,33673=>1000,33674=>1000,33675=>1000,33676=>1000,33677=>1000,33678=>1000,33679=>1000,33680=>1000,33681=>1000,33682=>1000,33683=>1000,33684=>1000, - 33685=>1000,33686=>1000,33687=>1000,33688=>1000,33689=>1000,33690=>1000,33691=>1000,33692=>1000,33693=>1000,33694=>1000,33695=>1000,33696=>1000,33697=>1000,33698=>1000,33699=>1000,33700=>1000, - 33701=>1000,33702=>1000,33703=>1000,33704=>1000,33705=>1000,33706=>1000,33707=>1000,33708=>1000,33709=>1000,33710=>1000,33711=>1000,33712=>1000,33713=>1000,33714=>1000,33715=>1000,33716=>1000, - 33717=>1000,33718=>1000,33719=>1000,33720=>1000,33721=>1000,33722=>1000,33723=>1000,33724=>1000,33725=>1000,33726=>1000,33727=>1000,33728=>1000,33729=>1000,33730=>1000,33731=>1000,33732=>1000, - 33733=>1000,33734=>1000,33735=>1000,33736=>1000,33737=>1000,33738=>1000,33739=>1000,33740=>1000,33741=>1000,33742=>1000,33743=>1000,33744=>1000,33745=>1000,33746=>1000,33747=>1000,33748=>1000, - 33749=>1000,33750=>1000,33751=>1000,33752=>1000,33753=>1000,33754=>1000,33755=>1000,33756=>1000,33757=>1000,33758=>1000,33759=>1000,33760=>1000,33761=>1000,33762=>1000,33763=>1000,33764=>1000, - 33765=>1000,33766=>1000,33767=>1000,33768=>1000,33769=>1000,33770=>1000,33771=>1000,33772=>1000,33773=>1000,33774=>1000,33775=>1000,33776=>1000,33777=>1000,33778=>1000,33779=>1000,33780=>1000, - 33781=>1000,33782=>1000,33783=>1000,33784=>1000,33785=>1000,33786=>1000,33787=>1000,33788=>1000,33789=>1000,33790=>1000,33791=>1000,33792=>1000,33793=>1000,33794=>1000,33795=>1000,33796=>1000, - 33797=>1000,33798=>1000,33799=>1000,33800=>1000,33801=>1000,33802=>1000,33803=>1000,33804=>1000,33805=>1000,33806=>1000,33807=>1000,33808=>1000,33809=>1000,33810=>1000,33811=>1000,33812=>1000, - 33813=>1000,33814=>1000,33815=>1000,33816=>1000,33817=>1000,33818=>1000,33819=>1000,33820=>1000,33821=>1000,33822=>1000,33823=>1000,33824=>1000,33825=>1000,33826=>1000,33827=>1000,33828=>1000, - 33829=>1000,33830=>1000,33831=>1000,33832=>1000,33833=>1000,33834=>1000,33835=>1000,33836=>1000,33837=>1000,33838=>1000,33839=>1000,33840=>1000,33841=>1000,33842=>1000,33843=>1000,33844=>1000, - 33845=>1000,33846=>1000,33847=>1000,33848=>1000,33849=>1000,33850=>1000,33851=>1000,33852=>1000,33853=>1000,33854=>1000,33855=>1000,33856=>1000,33857=>1000,33858=>1000,33859=>1000,33860=>1000, - 33861=>1000,33862=>1000,33863=>1000,33864=>1000,33865=>1000,33866=>1000,33867=>1000,33868=>1000,33869=>1000,33870=>1000,33871=>1000,33872=>1000,33873=>1000,33874=>1000,33875=>1000,33876=>1000, - 33877=>1000,33878=>1000,33879=>1000,33880=>1000,33881=>1000,33882=>1000,33883=>1000,33884=>1000,33885=>1000,33886=>1000,33887=>1000,33888=>1000,33889=>1000,33890=>1000,33891=>1000,33892=>1000, - 33893=>1000,33894=>1000,33895=>1000,33896=>1000,33897=>1000,33898=>1000,33899=>1000,33900=>1000,33901=>1000,33902=>1000,33903=>1000,33904=>1000,33905=>1000,33906=>1000,33907=>1000,33908=>1000, - 33909=>1000,33910=>1000,33911=>1000,33912=>1000,33913=>1000,33914=>1000,33915=>1000,33916=>1000,33917=>1000,33918=>1000,33919=>1000,33920=>1000,33921=>1000,33922=>1000,33923=>1000,33924=>1000, - 33925=>1000,33926=>1000,33927=>1000,33928=>1000,33929=>1000,33930=>1000,33931=>1000,33932=>1000,33933=>1000,33934=>1000,33935=>1000,33936=>1000,33937=>1000,33938=>1000,33939=>1000,33940=>1000, - 33941=>1000,33942=>1000,33943=>1000,33944=>1000,33945=>1000,33946=>1000,33947=>1000,33948=>1000,33949=>1000,33950=>1000,33951=>1000,33952=>1000,33953=>1000,33954=>1000,33955=>1000,33956=>1000, - 33957=>1000,33958=>1000,33959=>1000,33960=>1000,33961=>1000,33962=>1000,33963=>1000,33964=>1000,33965=>1000,33966=>1000,33967=>1000,33968=>1000,33969=>1000,33970=>1000,33971=>1000,33972=>1000, - 33973=>1000,33974=>1000,33975=>1000,33976=>1000,33977=>1000,33978=>1000,33979=>1000,33980=>1000,33981=>1000,33982=>1000,33983=>1000,33984=>1000,33985=>1000,33986=>1000,33987=>1000,33988=>1000, - 33989=>1000,33990=>1000,33991=>1000,33992=>1000,33993=>1000,33994=>1000,33995=>1000,33996=>1000,33997=>1000,33998=>1000,33999=>1000,34000=>1000,34001=>1000,34002=>1000,34003=>1000,34004=>1000, - 34005=>1000,34006=>1000,34007=>1000,34008=>1000,34009=>1000,34010=>1000,34011=>1000,34012=>1000,34013=>1000,34014=>1000,34015=>1000,34016=>1000,34017=>1000,34018=>1000,34019=>1000,34020=>1000, - 34021=>1000,34022=>1000,34023=>1000,34024=>1000,34025=>1000,34026=>1000,34027=>1000,34028=>1000,34029=>1000,34030=>1000,34031=>1000,34032=>1000,34033=>1000,34034=>1000,34035=>1000,34036=>1000, - 34037=>1000,34038=>1000,34039=>1000,34040=>1000,34041=>1000,34042=>1000,34043=>1000,34044=>1000,34045=>1000,34046=>1000,34047=>1000,34048=>1000,34049=>1000,34050=>1000,34051=>1000,34052=>1000, - 34053=>1000,34054=>1000,34055=>1000,34056=>1000,34057=>1000,34058=>1000,34059=>1000,34060=>1000,34061=>1000,34062=>1000,34063=>1000,34064=>1000,34065=>1000,34066=>1000,34067=>1000,34068=>1000, - 34069=>1000,34070=>1000,34071=>1000,34072=>1000,34073=>1000,34074=>1000,34075=>1000,34076=>1000,34077=>1000,34078=>1000,34079=>1000,34080=>1000,34081=>1000,34082=>1000,34083=>1000,34084=>1000, - 34085=>1000,34086=>1000,34087=>1000,34088=>1000,34089=>1000,34090=>1000,34091=>1000,34092=>1000,34093=>1000,34094=>1000,34095=>1000,34096=>1000,34097=>1000,34098=>1000,34099=>1000,34100=>1000, - 34101=>1000,34102=>1000,34103=>1000,34104=>1000,34105=>1000,34106=>1000,34107=>1000,34108=>1000,34109=>1000,34110=>1000,34111=>1000,34112=>1000,34113=>1000,34114=>1000,34115=>1000,34116=>1000, - 34117=>1000,34118=>1000,34119=>1000,34120=>1000,34121=>1000,34122=>1000,34123=>1000,34124=>1000,34125=>1000,34126=>1000,34127=>1000,34128=>1000,34129=>1000,34130=>1000,34131=>1000,34132=>1000, - 34133=>1000,34134=>1000,34135=>1000,34136=>1000,34137=>1000,34138=>1000,34139=>1000,34140=>1000,34141=>1000,34142=>1000,34143=>1000,34144=>1000,34145=>1000,34146=>1000,34147=>1000,34148=>1000, - 34149=>1000,34150=>1000,34151=>1000,34152=>1000,34153=>1000,34154=>1000,34155=>1000,34156=>1000,34157=>1000,34158=>1000,34159=>1000,34160=>1000,34161=>1000,34162=>1000,34163=>1000,34164=>1000, - 34165=>1000,34166=>1000,34167=>1000,34168=>1000,34169=>1000,34170=>1000,34171=>1000,34172=>1000,34173=>1000,34174=>1000,34175=>1000,34176=>1000,34177=>1000,34178=>1000,34179=>1000,34180=>1000, - 34181=>1000,34182=>1000,34183=>1000,34184=>1000,34185=>1000,34186=>1000,34187=>1000,34188=>1000,34189=>1000,34190=>1000,34191=>1000,34192=>1000,34193=>1000,34194=>1000,34195=>1000,34196=>1000, - 34197=>1000,34198=>1000,34199=>1000,34200=>1000,34201=>1000,34202=>1000,34203=>1000,34204=>1000,34205=>1000,34206=>1000,34207=>1000,34208=>1000,34209=>1000,34210=>1000,34211=>1000,34212=>1000, - 34213=>1000,34214=>1000,34215=>1000,34216=>1000,34217=>1000,34218=>1000,34219=>1000,34220=>1000,34221=>1000,34222=>1000,34223=>1000,34224=>1000,34225=>1000,34226=>1000,34227=>1000,34228=>1000, - 34229=>1000,34230=>1000,34231=>1000,34232=>1000,34233=>1000,34234=>1000,34235=>1000,34236=>1000,34237=>1000,34238=>1000,34239=>1000,34240=>1000,34241=>1000,34242=>1000,34243=>1000,34244=>1000, - 34245=>1000,34246=>1000,34247=>1000,34248=>1000,34249=>1000,34250=>1000,34251=>1000,34252=>1000,34253=>1000,34254=>1000,34255=>1000,34256=>1000,34257=>1000,34258=>1000,34259=>1000,34260=>1000, - 34261=>1000,34262=>1000,34263=>1000,34264=>1000,34265=>1000,34266=>1000,34267=>1000,34268=>1000,34269=>1000,34270=>1000,34271=>1000,34272=>1000,34273=>1000,34274=>1000,34275=>1000,34276=>1000, - 34277=>1000,34278=>1000,34279=>1000,34280=>1000,34281=>1000,34282=>1000,34283=>1000,34284=>1000,34285=>1000,34286=>1000,34287=>1000,34288=>1000,34289=>1000,34290=>1000,34291=>1000,34292=>1000, - 34293=>1000,34294=>1000,34295=>1000,34296=>1000,34297=>1000,34298=>1000,34299=>1000,34300=>1000,34301=>1000,34302=>1000,34303=>1000,34304=>1000,34305=>1000,34306=>1000,34307=>1000,34308=>1000, - 34309=>1000,34310=>1000,34311=>1000,34312=>1000,34313=>1000,34314=>1000,34315=>1000,34316=>1000,34317=>1000,34318=>1000,34319=>1000,34320=>1000,34321=>1000,34322=>1000,34323=>1000,34324=>1000, - 34325=>1000,34326=>1000,34327=>1000,34328=>1000,34329=>1000,34330=>1000,34331=>1000,34332=>1000,34333=>1000,34334=>1000,34335=>1000,34336=>1000,34337=>1000,34338=>1000,34339=>1000,34340=>1000, - 34341=>1000,34342=>1000,34343=>1000,34344=>1000,34345=>1000,34346=>1000,34347=>1000,34348=>1000,34349=>1000,34350=>1000,34351=>1000,34352=>1000,34353=>1000,34354=>1000,34355=>1000,34356=>1000, - 34357=>1000,34358=>1000,34359=>1000,34360=>1000,34361=>1000,34362=>1000,34363=>1000,34364=>1000,34365=>1000,34366=>1000,34367=>1000,34368=>1000,34369=>1000,34370=>1000,34371=>1000,34372=>1000, - 34373=>1000,34374=>1000,34375=>1000,34376=>1000,34377=>1000,34378=>1000,34379=>1000,34380=>1000,34381=>1000,34382=>1000,34383=>1000,34384=>1000,34385=>1000,34386=>1000,34387=>1000,34388=>1000, - 34389=>1000,34390=>1000,34391=>1000,34392=>1000,34393=>1000,34394=>1000,34395=>1000,34396=>1000,34397=>1000,34398=>1000,34399=>1000,34400=>1000,34401=>1000,34402=>1000,34403=>1000,34404=>1000, - 34405=>1000,34406=>1000,34407=>1000,34408=>1000,34409=>1000,34410=>1000,34411=>1000,34412=>1000,34413=>1000,34414=>1000,34415=>1000,34416=>1000,34417=>1000,34418=>1000,34419=>1000,34420=>1000, - 34421=>1000,34422=>1000,34423=>1000,34424=>1000,34425=>1000,34426=>1000,34427=>1000,34428=>1000,34429=>1000,34430=>1000,34431=>1000,34432=>1000,34433=>1000,34434=>1000,34435=>1000,34436=>1000, - 34437=>1000,34438=>1000,34439=>1000,34440=>1000,34441=>1000,34442=>1000,34443=>1000,34444=>1000,34445=>1000,34446=>1000,34447=>1000,34448=>1000,34449=>1000,34450=>1000,34451=>1000,34452=>1000, - 34453=>1000,34454=>1000,34455=>1000,34456=>1000,34457=>1000,34458=>1000,34459=>1000,34460=>1000,34461=>1000,34462=>1000,34463=>1000,34464=>1000,34465=>1000,34466=>1000,34467=>1000,34468=>1000, - 34469=>1000,34470=>1000,34471=>1000,34472=>1000,34473=>1000,34474=>1000,34475=>1000,34476=>1000,34477=>1000,34478=>1000,34479=>1000,34480=>1000,34481=>1000,34482=>1000,34483=>1000,34484=>1000, - 34485=>1000,34486=>1000,34487=>1000,34488=>1000,34489=>1000,34490=>1000,34491=>1000,34492=>1000,34493=>1000,34494=>1000,34495=>1000,34496=>1000,34497=>1000,34498=>1000,34499=>1000,34500=>1000, - 34501=>1000,34502=>1000,34503=>1000,34504=>1000,34505=>1000,34506=>1000,34507=>1000,34508=>1000,34509=>1000,34510=>1000,34511=>1000,34512=>1000,34513=>1000,34514=>1000,34515=>1000,34516=>1000, - 34517=>1000,34518=>1000,34519=>1000,34520=>1000,34521=>1000,34522=>1000,34523=>1000,34524=>1000,34525=>1000,34526=>1000,34527=>1000,34528=>1000,34529=>1000,34530=>1000,34531=>1000,34532=>1000, - 34533=>1000,34534=>1000,34535=>1000,34536=>1000,34537=>1000,34538=>1000,34539=>1000,34540=>1000,34541=>1000,34542=>1000,34543=>1000,34544=>1000,34545=>1000,34546=>1000,34547=>1000,34548=>1000, - 34549=>1000,34550=>1000,34551=>1000,34552=>1000,34553=>1000,34554=>1000,34555=>1000,34556=>1000,34557=>1000,34558=>1000,34559=>1000,34560=>1000,34561=>1000,34562=>1000,34563=>1000,34564=>1000, - 34565=>1000,34566=>1000,34567=>1000,34568=>1000,34569=>1000,34570=>1000,34571=>1000,34572=>1000,34573=>1000,34574=>1000,34575=>1000,34576=>1000,34577=>1000,34578=>1000,34579=>1000,34580=>1000, - 34581=>1000,34582=>1000,34583=>1000,34584=>1000,34585=>1000,34586=>1000,34587=>1000,34588=>1000,34589=>1000,34590=>1000,34591=>1000,34592=>1000,34593=>1000,34594=>1000,34595=>1000,34596=>1000, - 34597=>1000,34598=>1000,34599=>1000,34600=>1000,34601=>1000,34602=>1000,34603=>1000,34604=>1000,34605=>1000,34606=>1000,34607=>1000,34608=>1000,34609=>1000,34610=>1000,34611=>1000,34612=>1000, - 34613=>1000,34614=>1000,34615=>1000,34616=>1000,34617=>1000,34618=>1000,34619=>1000,34620=>1000,34621=>1000,34622=>1000,34623=>1000,34624=>1000,34625=>1000,34626=>1000,34627=>1000,34628=>1000, - 34629=>1000,34630=>1000,34631=>1000,34632=>1000,34633=>1000,34634=>1000,34635=>1000,34636=>1000,34637=>1000,34638=>1000,34639=>1000,34640=>1000,34641=>1000,34642=>1000,34643=>1000,34644=>1000, - 34645=>1000,34646=>1000,34647=>1000,34648=>1000,34649=>1000,34650=>1000,34651=>1000,34652=>1000,34653=>1000,34654=>1000,34655=>1000,34656=>1000,34657=>1000,34658=>1000,34659=>1000,34660=>1000, - 34661=>1000,34662=>1000,34663=>1000,34664=>1000,34665=>1000,34666=>1000,34667=>1000,34668=>1000,34669=>1000,34670=>1000,34671=>1000,34672=>1000,34673=>1000,34674=>1000,34675=>1000,34676=>1000, - 34677=>1000,34678=>1000,34679=>1000,34680=>1000,34681=>1000,34682=>1000,34683=>1000,34684=>1000,34685=>1000,34686=>1000,34687=>1000,34688=>1000,34689=>1000,34690=>1000,34691=>1000,34692=>1000, - 34693=>1000,34694=>1000,34695=>1000,34696=>1000,34697=>1000,34698=>1000,34699=>1000,34700=>1000,34701=>1000,34702=>1000,34703=>1000,34704=>1000,34705=>1000,34706=>1000,34707=>1000,34708=>1000, - 34709=>1000,34710=>1000,34711=>1000,34712=>1000,34713=>1000,34714=>1000,34715=>1000,34716=>1000,34717=>1000,34718=>1000,34719=>1000,34720=>1000,34721=>1000,34722=>1000,34723=>1000,34724=>1000, - 34725=>1000,34726=>1000,34727=>1000,34728=>1000,34729=>1000,34730=>1000,34731=>1000,34732=>1000,34733=>1000,34734=>1000,34735=>1000,34736=>1000,34737=>1000,34738=>1000,34739=>1000,34740=>1000, - 34741=>1000,34742=>1000,34743=>1000,34744=>1000,34745=>1000,34746=>1000,34747=>1000,34748=>1000,34749=>1000,34750=>1000,34751=>1000,34752=>1000,34753=>1000,34754=>1000,34755=>1000,34756=>1000, - 34757=>1000,34758=>1000,34759=>1000,34760=>1000,34761=>1000,34762=>1000,34763=>1000,34764=>1000,34765=>1000,34766=>1000,34767=>1000,34768=>1000,34769=>1000,34770=>1000,34771=>1000,34772=>1000, - 34773=>1000,34774=>1000,34775=>1000,34776=>1000,34777=>1000,34778=>1000,34779=>1000,34780=>1000,34781=>1000,34782=>1000,34783=>1000,34784=>1000,34785=>1000,34786=>1000,34787=>1000,34788=>1000, - 34789=>1000,34790=>1000,34791=>1000,34792=>1000,34793=>1000,34794=>1000,34795=>1000,34796=>1000,34797=>1000,34798=>1000,34799=>1000,34800=>1000,34801=>1000,34802=>1000,34803=>1000,34804=>1000, - 34805=>1000,34806=>1000,34807=>1000,34808=>1000,34809=>1000,34810=>1000,34811=>1000,34812=>1000,34813=>1000,34814=>1000,34815=>1000,34816=>1000,34817=>1000,34818=>1000,34819=>1000,34820=>1000, - 34821=>1000,34822=>1000,34823=>1000,34824=>1000,34825=>1000,34826=>1000,34827=>1000,34828=>1000,34829=>1000,34830=>1000,34831=>1000,34832=>1000,34833=>1000,34834=>1000,34835=>1000,34836=>1000, - 34837=>1000,34838=>1000,34839=>1000,34840=>1000,34841=>1000,34842=>1000,34843=>1000,34844=>1000,34845=>1000,34846=>1000,34847=>1000,34848=>1000,34849=>1000,34850=>1000,34851=>1000,34852=>1000, - 34853=>1000,34854=>1000,34855=>1000,34856=>1000,34857=>1000,34858=>1000,34859=>1000,34860=>1000,34861=>1000,34862=>1000,34863=>1000,34864=>1000,34865=>1000,34866=>1000,34867=>1000,34868=>1000, - 34869=>1000,34870=>1000,34871=>1000,34872=>1000,34873=>1000,34874=>1000,34875=>1000,34876=>1000,34877=>1000,34878=>1000,34879=>1000,34880=>1000,34881=>1000,34882=>1000,34883=>1000,34884=>1000, - 34885=>1000,34886=>1000,34887=>1000,34888=>1000,34889=>1000,34890=>1000,34891=>1000,34892=>1000,34893=>1000,34894=>1000,34895=>1000,34896=>1000,34897=>1000,34898=>1000,34899=>1000,34900=>1000, - 34901=>1000,34902=>1000,34903=>1000,34904=>1000,34905=>1000,34906=>1000,34907=>1000,34908=>1000,34909=>1000,34910=>1000,34911=>1000,34912=>1000,34913=>1000,34914=>1000,34915=>1000,34916=>1000, - 34917=>1000,34918=>1000,34919=>1000,34920=>1000,34921=>1000,34922=>1000,34923=>1000,34924=>1000,34925=>1000,34926=>1000,34927=>1000,34928=>1000,34929=>1000,34930=>1000,34931=>1000,34932=>1000, - 34933=>1000,34934=>1000,34935=>1000,34936=>1000,34937=>1000,34938=>1000,34939=>1000,34940=>1000,34941=>1000,34942=>1000,34943=>1000,34944=>1000,34945=>1000,34946=>1000,34947=>1000,34948=>1000, - 34949=>1000,34950=>1000,34951=>1000,34952=>1000,34953=>1000,34954=>1000,34955=>1000,34956=>1000,34957=>1000,34958=>1000,34959=>1000,34960=>1000,34961=>1000,34962=>1000,34963=>1000,34964=>1000, - 34965=>1000,34966=>1000,34967=>1000,34968=>1000,34969=>1000,34970=>1000,34971=>1000,34972=>1000,34973=>1000,34974=>1000,34975=>1000,34976=>1000,34977=>1000,34978=>1000,34979=>1000,34980=>1000, - 34981=>1000,34982=>1000,34983=>1000,34984=>1000,34985=>1000,34986=>1000,34987=>1000,34988=>1000,34989=>1000,34990=>1000,34991=>1000,34992=>1000,34993=>1000,34994=>1000,34995=>1000,34996=>1000, - 34997=>1000,34998=>1000,34999=>1000,35000=>1000,35001=>1000,35002=>1000,35003=>1000,35004=>1000,35005=>1000,35006=>1000,35007=>1000,35008=>1000,35009=>1000,35010=>1000,35011=>1000,35012=>1000, - 35013=>1000,35014=>1000,35015=>1000,35016=>1000,35017=>1000,35018=>1000,35019=>1000,35020=>1000,35021=>1000,35022=>1000,35023=>1000,35024=>1000,35025=>1000,35026=>1000,35027=>1000,35028=>1000, - 35029=>1000,35030=>1000,35031=>1000,35032=>1000,35033=>1000,35034=>1000,35035=>1000,35036=>1000,35037=>1000,35038=>1000,35039=>1000,35040=>1000,35041=>1000,35042=>1000,35043=>1000,35044=>1000, - 35045=>1000,35046=>1000,35047=>1000,35048=>1000,35049=>1000,35050=>1000,35051=>1000,35052=>1000,35053=>1000,35054=>1000,35055=>1000,35056=>1000,35057=>1000,35058=>1000,35059=>1000,35060=>1000, - 35061=>1000,35062=>1000,35063=>1000,35064=>1000,35065=>1000,35066=>1000,35067=>1000,35068=>1000,35069=>1000,35070=>1000,35071=>1000,35072=>1000,35073=>1000,35074=>1000,35075=>1000,35076=>1000, - 35077=>1000,35078=>1000,35079=>1000,35080=>1000,35081=>1000,35082=>1000,35083=>1000,35084=>1000,35085=>1000,35086=>1000,35087=>1000,35088=>1000,35089=>1000,35090=>1000,35091=>1000,35092=>1000, - 35093=>1000,35094=>1000,35095=>1000,35096=>1000,35097=>1000,35098=>1000,35099=>1000,35100=>1000,35101=>1000,35102=>1000,35103=>1000,35104=>1000,35105=>1000,35106=>1000,35107=>1000,35108=>1000, - 35109=>1000,35110=>1000,35111=>1000,35112=>1000,35113=>1000,35114=>1000,35115=>1000,35116=>1000,35117=>1000,35118=>1000,35119=>1000,35120=>1000,35121=>1000,35122=>1000,35123=>1000,35124=>1000, - 35125=>1000,35126=>1000,35127=>1000,35128=>1000,35129=>1000,35130=>1000,35131=>1000,35132=>1000,35133=>1000,35134=>1000,35135=>1000,35136=>1000,35137=>1000,35138=>1000,35139=>1000,35140=>1000, - 35141=>1000,35142=>1000,35143=>1000,35144=>1000,35145=>1000,35146=>1000,35147=>1000,35148=>1000,35149=>1000,35150=>1000,35151=>1000,35152=>1000,35153=>1000,35154=>1000,35155=>1000,35156=>1000, - 35157=>1000,35158=>1000,35159=>1000,35160=>1000,35161=>1000,35162=>1000,35163=>1000,35164=>1000,35165=>1000,35166=>1000,35167=>1000,35168=>1000,35169=>1000,35170=>1000,35171=>1000,35172=>1000, - 35173=>1000,35174=>1000,35175=>1000,35176=>1000,35177=>1000,35178=>1000,35179=>1000,35180=>1000,35181=>1000,35182=>1000,35183=>1000,35184=>1000,35185=>1000,35186=>1000,35187=>1000,35188=>1000, - 35189=>1000,35190=>1000,35191=>1000,35192=>1000,35193=>1000,35194=>1000,35195=>1000,35196=>1000,35197=>1000,35198=>1000,35199=>1000,35200=>1000,35201=>1000,35202=>1000,35203=>1000,35204=>1000, - 35205=>1000,35206=>1000,35207=>1000,35208=>1000,35209=>1000,35210=>1000,35211=>1000,35212=>1000,35213=>1000,35214=>1000,35215=>1000,35216=>1000,35217=>1000,35218=>1000,35219=>1000,35220=>1000, - 35221=>1000,35222=>1000,35223=>1000,35224=>1000,35225=>1000,35226=>1000,35227=>1000,35228=>1000,35229=>1000,35230=>1000,35231=>1000,35232=>1000,35233=>1000,35234=>1000,35235=>1000,35236=>1000, - 35237=>1000,35238=>1000,35239=>1000,35240=>1000,35241=>1000,35242=>1000,35243=>1000,35244=>1000,35245=>1000,35246=>1000,35247=>1000,35248=>1000,35249=>1000,35250=>1000,35251=>1000,35252=>1000, - 35253=>1000,35254=>1000,35255=>1000,35256=>1000,35257=>1000,35258=>1000,35259=>1000,35260=>1000,35261=>1000,35262=>1000,35263=>1000,35264=>1000,35265=>1000,35266=>1000,35267=>1000,35268=>1000, - 35269=>1000,35270=>1000,35271=>1000,35272=>1000,35273=>1000,35274=>1000,35275=>1000,35276=>1000,35277=>1000,35278=>1000,35279=>1000,35280=>1000,35281=>1000,35282=>1000,35283=>1000,35284=>1000, - 35285=>1000,35286=>1000,35287=>1000,35288=>1000,35289=>1000,35290=>1000,35291=>1000,35292=>1000,35293=>1000,35294=>1000,35295=>1000,35296=>1000,35297=>1000,35298=>1000,35299=>1000,35300=>1000, - 35301=>1000,35302=>1000,35303=>1000,35304=>1000,35305=>1000,35306=>1000,35307=>1000,35308=>1000,35309=>1000,35310=>1000,35311=>1000,35312=>1000,35313=>1000,35314=>1000,35315=>1000,35316=>1000, - 35317=>1000,35318=>1000,35319=>1000,35320=>1000,35321=>1000,35322=>1000,35323=>1000,35324=>1000,35325=>1000,35326=>1000,35327=>1000,35328=>1000,35329=>1000,35330=>1000,35331=>1000,35332=>1000, - 35333=>1000,35334=>1000,35335=>1000,35336=>1000,35337=>1000,35338=>1000,35339=>1000,35340=>1000,35341=>1000,35342=>1000,35343=>1000,35344=>1000,35345=>1000,35346=>1000,35347=>1000,35348=>1000, - 35349=>1000,35350=>1000,35351=>1000,35352=>1000,35353=>1000,35354=>1000,35355=>1000,35356=>1000,35357=>1000,35358=>1000,35359=>1000,35360=>1000,35361=>1000,35362=>1000,35363=>1000,35364=>1000, - 35365=>1000,35366=>1000,35367=>1000,35368=>1000,35369=>1000,35370=>1000,35371=>1000,35372=>1000,35373=>1000,35374=>1000,35375=>1000,35376=>1000,35377=>1000,35378=>1000,35379=>1000,35380=>1000, - 35381=>1000,35382=>1000,35383=>1000,35384=>1000,35385=>1000,35386=>1000,35387=>1000,35388=>1000,35389=>1000,35390=>1000,35391=>1000,35392=>1000,35393=>1000,35394=>1000,35395=>1000,35396=>1000, - 35397=>1000,35398=>1000,35399=>1000,35400=>1000,35401=>1000,35402=>1000,35403=>1000,35404=>1000,35405=>1000,35406=>1000,35407=>1000,35408=>1000,35409=>1000,35410=>1000,35411=>1000,35412=>1000, - 35413=>1000,35414=>1000,35415=>1000,35416=>1000,35417=>1000,35418=>1000,35419=>1000,35420=>1000,35421=>1000,35422=>1000,35423=>1000,35424=>1000,35425=>1000,35426=>1000,35427=>1000,35428=>1000, - 35429=>1000,35430=>1000,35431=>1000,35432=>1000,35433=>1000,35434=>1000,35435=>1000,35436=>1000,35437=>1000,35438=>1000,35439=>1000,35440=>1000,35441=>1000,35442=>1000,35443=>1000,35444=>1000, - 35445=>1000,35446=>1000,35447=>1000,35448=>1000,35449=>1000,35450=>1000,35451=>1000,35452=>1000,35453=>1000,35454=>1000,35455=>1000,35456=>1000,35457=>1000,35458=>1000,35459=>1000,35460=>1000, - 35461=>1000,35462=>1000,35463=>1000,35464=>1000,35465=>1000,35466=>1000,35467=>1000,35468=>1000,35469=>1000,35470=>1000,35471=>1000,35472=>1000,35473=>1000,35474=>1000,35475=>1000,35476=>1000, - 35477=>1000,35478=>1000,35479=>1000,35480=>1000,35481=>1000,35482=>1000,35483=>1000,35484=>1000,35485=>1000,35486=>1000,35487=>1000,35488=>1000,35489=>1000,35490=>1000,35491=>1000,35492=>1000, - 35493=>1000,35494=>1000,35495=>1000,35496=>1000,35497=>1000,35498=>1000,35499=>1000,35500=>1000,35501=>1000,35502=>1000,35503=>1000,35504=>1000,35505=>1000,35506=>1000,35507=>1000,35508=>1000, - 35509=>1000,35510=>1000,35511=>1000,35512=>1000,35513=>1000,35514=>1000,35515=>1000,35516=>1000,35517=>1000,35518=>1000,35519=>1000,35520=>1000,35521=>1000,35522=>1000,35523=>1000,35524=>1000, - 35525=>1000,35526=>1000,35527=>1000,35528=>1000,35529=>1000,35530=>1000,35531=>1000,35532=>1000,35533=>1000,35534=>1000,35535=>1000,35536=>1000,35537=>1000,35538=>1000,35539=>1000,35540=>1000, - 35541=>1000,35542=>1000,35543=>1000,35544=>1000,35545=>1000,35546=>1000,35547=>1000,35548=>1000,35549=>1000,35550=>1000,35551=>1000,35552=>1000,35553=>1000,35554=>1000,35555=>1000,35556=>1000, - 35557=>1000,35558=>1000,35559=>1000,35560=>1000,35561=>1000,35562=>1000,35563=>1000,35564=>1000,35565=>1000,35566=>1000,35567=>1000,35568=>1000,35569=>1000,35570=>1000,35571=>1000,35572=>1000, - 35573=>1000,35574=>1000,35575=>1000,35576=>1000,35577=>1000,35578=>1000,35579=>1000,35580=>1000,35581=>1000,35582=>1000,35583=>1000,35584=>1000,35585=>1000,35586=>1000,35587=>1000,35588=>1000, - 35589=>1000,35590=>1000,35591=>1000,35592=>1000,35593=>1000,35594=>1000,35595=>1000,35596=>1000,35597=>1000,35598=>1000,35599=>1000,35600=>1000,35601=>1000,35602=>1000,35603=>1000,35604=>1000, - 35605=>1000,35606=>1000,35607=>1000,35608=>1000,35609=>1000,35610=>1000,35611=>1000,35612=>1000,35613=>1000,35614=>1000,35615=>1000,35616=>1000,35617=>1000,35618=>1000,35619=>1000,35620=>1000, - 35621=>1000,35622=>1000,35623=>1000,35624=>1000,35625=>1000,35626=>1000,35627=>1000,35628=>1000,35629=>1000,35630=>1000,35631=>1000,35632=>1000,35633=>1000,35634=>1000,35635=>1000,35636=>1000, - 35637=>1000,35638=>1000,35639=>1000,35640=>1000,35641=>1000,35642=>1000,35643=>1000,35644=>1000,35645=>1000,35646=>1000,35647=>1000,35648=>1000,35649=>1000,35650=>1000,35651=>1000,35652=>1000, - 35653=>1000,35654=>1000,35655=>1000,35656=>1000,35657=>1000,35658=>1000,35659=>1000,35660=>1000,35661=>1000,35662=>1000,35663=>1000,35664=>1000,35665=>1000,35666=>1000,35667=>1000,35668=>1000, - 35669=>1000,35670=>1000,35671=>1000,35672=>1000,35673=>1000,35674=>1000,35675=>1000,35676=>1000,35677=>1000,35678=>1000,35679=>1000,35680=>1000,35681=>1000,35682=>1000,35683=>1000,35684=>1000, - 35685=>1000,35686=>1000,35687=>1000,35688=>1000,35689=>1000,35690=>1000,35691=>1000,35692=>1000,35693=>1000,35694=>1000,35695=>1000,35696=>1000,35697=>1000,35698=>1000,35699=>1000,35700=>1000, - 35701=>1000,35702=>1000,35703=>1000,35704=>1000,35705=>1000,35706=>1000,35707=>1000,35708=>1000,35709=>1000,35710=>1000,35711=>1000,35712=>1000,35713=>1000,35714=>1000,35715=>1000,35716=>1000, - 35717=>1000,35718=>1000,35719=>1000,35720=>1000,35721=>1000,35722=>1000,35723=>1000,35724=>1000,35725=>1000,35726=>1000,35727=>1000,35728=>1000,35729=>1000,35730=>1000,35731=>1000,35732=>1000, - 35733=>1000,35734=>1000,35735=>1000,35736=>1000,35737=>1000,35738=>1000,35739=>1000,35740=>1000,35741=>1000,35742=>1000,35743=>1000,35744=>1000,35745=>1000,35746=>1000,35747=>1000,35748=>1000, - 35749=>1000,35750=>1000,35751=>1000,35752=>1000,35753=>1000,35754=>1000,35755=>1000,35756=>1000,35757=>1000,35758=>1000,35759=>1000,35760=>1000,35761=>1000,35762=>1000,35763=>1000,35764=>1000, - 35765=>1000,35766=>1000,35767=>1000,35768=>1000,35769=>1000,35770=>1000,35771=>1000,35772=>1000,35773=>1000,35774=>1000,35775=>1000,35776=>1000,35777=>1000,35778=>1000,35779=>1000,35780=>1000, - 35781=>1000,35782=>1000,35783=>1000,35784=>1000,35785=>1000,35786=>1000,35787=>1000,35788=>1000,35789=>1000,35790=>1000,35791=>1000,35792=>1000,35793=>1000,35794=>1000,35795=>1000,35796=>1000, - 35797=>1000,35798=>1000,35799=>1000,35800=>1000,35801=>1000,35802=>1000,35803=>1000,35804=>1000,35805=>1000,35806=>1000,35807=>1000,35808=>1000,35809=>1000,35810=>1000,35811=>1000,35812=>1000, - 35813=>1000,35814=>1000,35815=>1000,35816=>1000,35817=>1000,35818=>1000,35819=>1000,35820=>1000,35821=>1000,35822=>1000,35823=>1000,35824=>1000,35825=>1000,35826=>1000,35827=>1000,35828=>1000, - 35829=>1000,35830=>1000,35831=>1000,35832=>1000,35833=>1000,35834=>1000,35835=>1000,35836=>1000,35837=>1000,35838=>1000,35839=>1000,35840=>1000,35841=>1000,35842=>1000,35843=>1000,35844=>1000, - 35845=>1000,35846=>1000,35847=>1000,35848=>1000,35849=>1000,35850=>1000,35851=>1000,35852=>1000,35853=>1000,35854=>1000,35855=>1000,35856=>1000,35857=>1000,35858=>1000,35859=>1000,35860=>1000, - 35861=>1000,35862=>1000,35863=>1000,35864=>1000,35865=>1000,35866=>1000,35867=>1000,35868=>1000,35869=>1000,35870=>1000,35871=>1000,35872=>1000,35873=>1000,35874=>1000,35875=>1000,35876=>1000, - 35877=>1000,35878=>1000,35879=>1000,35880=>1000,35881=>1000,35882=>1000,35883=>1000,35884=>1000,35885=>1000,35886=>1000,35887=>1000,35888=>1000,35889=>1000,35890=>1000,35891=>1000,35892=>1000, - 35893=>1000,35894=>1000,35895=>1000,35896=>1000,35897=>1000,35898=>1000,35899=>1000,35900=>1000,35901=>1000,35902=>1000,35903=>1000,35904=>1000,35905=>1000,35906=>1000,35907=>1000,35908=>1000, - 35909=>1000,35910=>1000,35911=>1000,35912=>1000,35913=>1000,35914=>1000,35915=>1000,35916=>1000,35917=>1000,35918=>1000,35919=>1000,35920=>1000,35921=>1000,35922=>1000,35923=>1000,35924=>1000, - 35925=>1000,35926=>1000,35927=>1000,35928=>1000,35929=>1000,35930=>1000,35931=>1000,35932=>1000,35933=>1000,35934=>1000,35935=>1000,35936=>1000,35937=>1000,35938=>1000,35939=>1000,35940=>1000, - 35941=>1000,35942=>1000,35943=>1000,35944=>1000,35945=>1000,35946=>1000,35947=>1000,35948=>1000,35949=>1000,35950=>1000,35951=>1000,35952=>1000,35953=>1000,35954=>1000,35955=>1000,35956=>1000, - 35957=>1000,35958=>1000,35959=>1000,35960=>1000,35961=>1000,35962=>1000,35963=>1000,35964=>1000,35965=>1000,35966=>1000,35967=>1000,35968=>1000,35969=>1000,35970=>1000,35971=>1000,35972=>1000, - 35973=>1000,35974=>1000,35975=>1000,35976=>1000,35977=>1000,35978=>1000,35979=>1000,35980=>1000,35981=>1000,35982=>1000,35983=>1000,35984=>1000,35985=>1000,35986=>1000,35987=>1000,35988=>1000, - 35989=>1000,35990=>1000,35991=>1000,35992=>1000,35993=>1000,35994=>1000,35995=>1000,35996=>1000,35997=>1000,35998=>1000,35999=>1000,36000=>1000,36001=>1000,36002=>1000,36003=>1000,36004=>1000, - 36005=>1000,36006=>1000,36007=>1000,36008=>1000,36009=>1000,36010=>1000,36011=>1000,36012=>1000,36013=>1000,36014=>1000,36015=>1000,36016=>1000,36017=>1000,36018=>1000,36019=>1000,36020=>1000, - 36021=>1000,36022=>1000,36023=>1000,36024=>1000,36025=>1000,36026=>1000,36027=>1000,36028=>1000,36029=>1000,36030=>1000,36031=>1000,36032=>1000,36033=>1000,36034=>1000,36035=>1000,36036=>1000, - 36037=>1000,36038=>1000,36039=>1000,36040=>1000,36041=>1000,36042=>1000,36043=>1000,36044=>1000,36045=>1000,36046=>1000,36047=>1000,36048=>1000,36049=>1000,36050=>1000,36051=>1000,36052=>1000, - 36053=>1000,36054=>1000,36055=>1000,36056=>1000,36057=>1000,36058=>1000,36059=>1000,36060=>1000,36061=>1000,36062=>1000,36063=>1000,36064=>1000,36065=>1000,36066=>1000,36067=>1000,36068=>1000, - 36069=>1000,36070=>1000,36071=>1000,36072=>1000,36073=>1000,36074=>1000,36075=>1000,36076=>1000,36077=>1000,36078=>1000,36079=>1000,36080=>1000,36081=>1000,36082=>1000,36083=>1000,36084=>1000, - 36085=>1000,36086=>1000,36087=>1000,36088=>1000,36089=>1000,36090=>1000,36091=>1000,36092=>1000,36093=>1000,36094=>1000,36095=>1000,36096=>1000,36097=>1000,36098=>1000,36099=>1000,36100=>1000, - 36101=>1000,36102=>1000,36103=>1000,36104=>1000,36105=>1000,36106=>1000,36107=>1000,36108=>1000,36109=>1000,36110=>1000,36111=>1000,36112=>1000,36113=>1000,36114=>1000,36115=>1000,36116=>1000, - 36117=>1000,36118=>1000,36119=>1000,36120=>1000,36121=>1000,36122=>1000,36123=>1000,36124=>1000,36125=>1000,36126=>1000,36127=>1000,36128=>1000,36129=>1000,36130=>1000,36131=>1000,36132=>1000, - 36133=>1000,36134=>1000,36135=>1000,36136=>1000,36137=>1000,36138=>1000,36139=>1000,36140=>1000,36141=>1000,36142=>1000,36143=>1000,36144=>1000,36145=>1000,36146=>1000,36147=>1000,36148=>1000, - 36149=>1000,36150=>1000,36151=>1000,36152=>1000,36153=>1000,36154=>1000,36155=>1000,36156=>1000,36157=>1000,36158=>1000,36159=>1000,36160=>1000,36161=>1000,36162=>1000,36163=>1000,36164=>1000, - 36165=>1000,36166=>1000,36167=>1000,36168=>1000,36169=>1000,36170=>1000,36171=>1000,36172=>1000,36173=>1000,36174=>1000,36175=>1000,36176=>1000,36177=>1000,36178=>1000,36179=>1000,36180=>1000, - 36181=>1000,36182=>1000,36183=>1000,36184=>1000,36185=>1000,36186=>1000,36187=>1000,36188=>1000,36189=>1000,36190=>1000,36191=>1000,36192=>1000,36193=>1000,36194=>1000,36195=>1000,36196=>1000, - 36197=>1000,36198=>1000,36199=>1000,36200=>1000,36201=>1000,36202=>1000,36203=>1000,36204=>1000,36205=>1000,36206=>1000,36207=>1000,36208=>1000,36209=>1000,36210=>1000,36211=>1000,36212=>1000, - 36213=>1000,36214=>1000,36215=>1000,36216=>1000,36217=>1000,36218=>1000,36219=>1000,36220=>1000,36221=>1000,36222=>1000,36223=>1000,36224=>1000,36225=>1000,36226=>1000,36227=>1000,36228=>1000, - 36229=>1000,36230=>1000,36231=>1000,36232=>1000,36233=>1000,36234=>1000,36235=>1000,36236=>1000,36237=>1000,36238=>1000,36239=>1000,36240=>1000,36241=>1000,36242=>1000,36243=>1000,36244=>1000, - 36245=>1000,36246=>1000,36247=>1000,36248=>1000,36249=>1000,36250=>1000,36251=>1000,36252=>1000,36253=>1000,36254=>1000,36255=>1000,36256=>1000,36257=>1000,36258=>1000,36259=>1000,36260=>1000, - 36261=>1000,36262=>1000,36263=>1000,36264=>1000,36265=>1000,36266=>1000,36267=>1000,36268=>1000,36269=>1000,36270=>1000,36271=>1000,36272=>1000,36273=>1000,36274=>1000,36275=>1000,36276=>1000, - 36277=>1000,36278=>1000,36279=>1000,36280=>1000,36281=>1000,36282=>1000,36283=>1000,36284=>1000,36285=>1000,36286=>1000,36287=>1000,36288=>1000,36289=>1000,36290=>1000,36291=>1000,36292=>1000, - 36293=>1000,36294=>1000,36295=>1000,36296=>1000,36297=>1000,36298=>1000,36299=>1000,36300=>1000,36301=>1000,36302=>1000,36303=>1000,36304=>1000,36305=>1000,36306=>1000,36307=>1000,36308=>1000, - 36309=>1000,36310=>1000,36311=>1000,36312=>1000,36313=>1000,36314=>1000,36315=>1000,36316=>1000,36317=>1000,36318=>1000,36319=>1000,36320=>1000,36321=>1000,36322=>1000,36323=>1000,36324=>1000, - 36325=>1000,36326=>1000,36327=>1000,36328=>1000,36329=>1000,36330=>1000,36331=>1000,36332=>1000,36333=>1000,36334=>1000,36335=>1000,36336=>1000,36337=>1000,36338=>1000,36339=>1000,36340=>1000, - 36341=>1000,36342=>1000,36343=>1000,36344=>1000,36345=>1000,36346=>1000,36347=>1000,36348=>1000,36349=>1000,36350=>1000,36351=>1000,36352=>1000,36353=>1000,36354=>1000,36355=>1000,36356=>1000, - 36357=>1000,36358=>1000,36359=>1000,36360=>1000,36361=>1000,36362=>1000,36363=>1000,36364=>1000,36365=>1000,36366=>1000,36367=>1000,36368=>1000,36369=>1000,36370=>1000,36371=>1000,36372=>1000, - 36373=>1000,36374=>1000,36375=>1000,36376=>1000,36377=>1000,36378=>1000,36379=>1000,36380=>1000,36381=>1000,36382=>1000,36383=>1000,36384=>1000,36385=>1000,36386=>1000,36387=>1000,36388=>1000, - 36389=>1000,36390=>1000,36391=>1000,36392=>1000,36393=>1000,36394=>1000,36395=>1000,36396=>1000,36397=>1000,36398=>1000,36399=>1000,36400=>1000,36401=>1000,36402=>1000,36403=>1000,36404=>1000, - 36405=>1000,36406=>1000,36407=>1000,36408=>1000,36409=>1000,36410=>1000,36411=>1000,36412=>1000,36413=>1000,36414=>1000,36415=>1000,36416=>1000,36417=>1000,36418=>1000,36419=>1000,36420=>1000, - 36421=>1000,36422=>1000,36423=>1000,36424=>1000,36425=>1000,36426=>1000,36427=>1000,36428=>1000,36429=>1000,36430=>1000,36431=>1000,36432=>1000,36433=>1000,36434=>1000,36435=>1000,36436=>1000, - 36437=>1000,36438=>1000,36439=>1000,36440=>1000,36441=>1000,36442=>1000,36443=>1000,36444=>1000,36445=>1000,36446=>1000,36447=>1000,36448=>1000,36449=>1000,36450=>1000,36451=>1000,36452=>1000, - 36453=>1000,36454=>1000,36455=>1000,36456=>1000,36457=>1000,36458=>1000,36459=>1000,36460=>1000,36461=>1000,36462=>1000,36463=>1000,36464=>1000,36465=>1000,36466=>1000,36467=>1000,36468=>1000, - 36469=>1000,36470=>1000,36471=>1000,36472=>1000,36473=>1000,36474=>1000,36475=>1000,36476=>1000,36477=>1000,36478=>1000,36479=>1000,36480=>1000,36481=>1000,36482=>1000,36483=>1000,36484=>1000, - 36485=>1000,36486=>1000,36487=>1000,36488=>1000,36489=>1000,36490=>1000,36491=>1000,36492=>1000,36493=>1000,36494=>1000,36495=>1000,36496=>1000,36497=>1000,36498=>1000,36499=>1000,36500=>1000, - 36501=>1000,36502=>1000,36503=>1000,36504=>1000,36505=>1000,36506=>1000,36507=>1000,36508=>1000,36509=>1000,36510=>1000,36511=>1000,36512=>1000,36513=>1000,36514=>1000,36515=>1000,36516=>1000, - 36517=>1000,36518=>1000,36519=>1000,36520=>1000,36521=>1000,36522=>1000,36523=>1000,36524=>1000,36525=>1000,36526=>1000,36527=>1000,36528=>1000,36529=>1000,36530=>1000,36531=>1000,36532=>1000, - 36533=>1000,36534=>1000,36535=>1000,36536=>1000,36537=>1000,36538=>1000,36539=>1000,36540=>1000,36541=>1000,36542=>1000,36543=>1000,36544=>1000,36545=>1000,36546=>1000,36547=>1000,36548=>1000, - 36549=>1000,36550=>1000,36551=>1000,36552=>1000,36553=>1000,36554=>1000,36555=>1000,36556=>1000,36557=>1000,36558=>1000,36559=>1000,36560=>1000,36561=>1000,36562=>1000,36563=>1000,36564=>1000, - 36565=>1000,36566=>1000,36567=>1000,36568=>1000,36569=>1000,36570=>1000,36571=>1000,36572=>1000,36573=>1000,36574=>1000,36575=>1000,36576=>1000,36577=>1000,36578=>1000,36579=>1000,36580=>1000, - 36581=>1000,36582=>1000,36583=>1000,36584=>1000,36585=>1000,36586=>1000,36587=>1000,36588=>1000,36589=>1000,36590=>1000,36591=>1000,36592=>1000,36593=>1000,36594=>1000,36595=>1000,36596=>1000, - 36597=>1000,36598=>1000,36599=>1000,36600=>1000,36601=>1000,36602=>1000,36603=>1000,36604=>1000,36605=>1000,36606=>1000,36607=>1000,36608=>1000,36609=>1000,36610=>1000,36611=>1000,36612=>1000, - 36613=>1000,36614=>1000,36615=>1000,36616=>1000,36617=>1000,36618=>1000,36619=>1000,36620=>1000,36621=>1000,36622=>1000,36623=>1000,36624=>1000,36625=>1000,36626=>1000,36627=>1000,36628=>1000, - 36629=>1000,36630=>1000,36631=>1000,36632=>1000,36633=>1000,36634=>1000,36635=>1000,36636=>1000,36637=>1000,36638=>1000,36639=>1000,36640=>1000,36641=>1000,36642=>1000,36643=>1000,36644=>1000, - 36645=>1000,36646=>1000,36647=>1000,36648=>1000,36649=>1000,36650=>1000,36651=>1000,36652=>1000,36653=>1000,36654=>1000,36655=>1000,36656=>1000,36657=>1000,36658=>1000,36659=>1000,36660=>1000, - 36661=>1000,36662=>1000,36663=>1000,36664=>1000,36665=>1000,36666=>1000,36667=>1000,36668=>1000,36669=>1000,36670=>1000,36671=>1000,36672=>1000,36673=>1000,36674=>1000,36675=>1000,36676=>1000, - 36677=>1000,36678=>1000,36679=>1000,36680=>1000,36681=>1000,36682=>1000,36683=>1000,36684=>1000,36685=>1000,36686=>1000,36687=>1000,36688=>1000,36689=>1000,36690=>1000,36691=>1000,36692=>1000, - 36693=>1000,36694=>1000,36695=>1000,36696=>1000,36697=>1000,36698=>1000,36699=>1000,36700=>1000,36701=>1000,36702=>1000,36703=>1000,36704=>1000,36705=>1000,36706=>1000,36707=>1000,36708=>1000, - 36709=>1000,36710=>1000,36711=>1000,36712=>1000,36713=>1000,36714=>1000,36715=>1000,36716=>1000,36717=>1000,36718=>1000,36719=>1000,36720=>1000,36721=>1000,36722=>1000,36723=>1000,36724=>1000, - 36725=>1000,36726=>1000,36727=>1000,36728=>1000,36729=>1000,36730=>1000,36731=>1000,36732=>1000,36733=>1000,36734=>1000,36735=>1000,36736=>1000,36737=>1000,36738=>1000,36739=>1000,36740=>1000, - 36741=>1000,36742=>1000,36743=>1000,36744=>1000,36745=>1000,36746=>1000,36747=>1000,36748=>1000,36749=>1000,36750=>1000,36751=>1000,36752=>1000,36753=>1000,36754=>1000,36755=>1000,36756=>1000, - 36757=>1000,36758=>1000,36759=>1000,36760=>1000,36761=>1000,36762=>1000,36763=>1000,36764=>1000,36765=>1000,36766=>1000,36767=>1000,36768=>1000,36769=>1000,36770=>1000,36771=>1000,36772=>1000, - 36773=>1000,36774=>1000,36775=>1000,36776=>1000,36777=>1000,36778=>1000,36779=>1000,36780=>1000,36781=>1000,36782=>1000,36783=>1000,36784=>1000,36785=>1000,36786=>1000,36787=>1000,36788=>1000, - 36789=>1000,36790=>1000,36791=>1000,36792=>1000,36793=>1000,36794=>1000,36795=>1000,36796=>1000,36797=>1000,36798=>1000,36799=>1000,36800=>1000,36801=>1000,36802=>1000,36803=>1000,36804=>1000, - 36805=>1000,36806=>1000,36807=>1000,36808=>1000,36809=>1000,36810=>1000,36811=>1000,36812=>1000,36813=>1000,36814=>1000,36815=>1000,36816=>1000,36817=>1000,36818=>1000,36819=>1000,36820=>1000, - 36821=>1000,36822=>1000,36823=>1000,36824=>1000,36825=>1000,36826=>1000,36827=>1000,36828=>1000,36829=>1000,36830=>1000,36831=>1000,36832=>1000,36833=>1000,36834=>1000,36835=>1000,36836=>1000, - 36837=>1000,36838=>1000,36839=>1000,36840=>1000,36841=>1000,36842=>1000,36843=>1000,36844=>1000,36845=>1000,36846=>1000,36847=>1000,36848=>1000,36849=>1000,36850=>1000,36851=>1000,36852=>1000, - 36853=>1000,36854=>1000,36855=>1000,36856=>1000,36857=>1000,36858=>1000,36859=>1000,36860=>1000,36861=>1000,36862=>1000,36863=>1000,36864=>1000,36865=>1000,36866=>1000,36867=>1000,36868=>1000, - 36869=>1000,36870=>1000,36871=>1000,36872=>1000,36873=>1000,36874=>1000,36875=>1000,36876=>1000,36877=>1000,36878=>1000,36879=>1000,36880=>1000,36881=>1000,36882=>1000,36883=>1000,36884=>1000, - 36885=>1000,36886=>1000,36887=>1000,36888=>1000,36889=>1000,36890=>1000,36891=>1000,36892=>1000,36893=>1000,36894=>1000,36895=>1000,36896=>1000,36897=>1000,36898=>1000,36899=>1000,36900=>1000, - 36901=>1000,36902=>1000,36903=>1000,36904=>1000,36905=>1000,36906=>1000,36907=>1000,36908=>1000,36909=>1000,36910=>1000,36911=>1000,36912=>1000,36913=>1000,36914=>1000,36915=>1000,36916=>1000, - 36917=>1000,36918=>1000,36919=>1000,36920=>1000,36921=>1000,36922=>1000,36923=>1000,36924=>1000,36925=>1000,36926=>1000,36927=>1000,36928=>1000,36929=>1000,36930=>1000,36931=>1000,36932=>1000, - 36933=>1000,36934=>1000,36935=>1000,36936=>1000,36937=>1000,36938=>1000,36939=>1000,36940=>1000,36941=>1000,36942=>1000,36943=>1000,36944=>1000,36945=>1000,36946=>1000,36947=>1000,36948=>1000, - 36949=>1000,36950=>1000,36951=>1000,36952=>1000,36953=>1000,36954=>1000,36955=>1000,36956=>1000,36957=>1000,36958=>1000,36959=>1000,36960=>1000,36961=>1000,36962=>1000,36963=>1000,36964=>1000, - 36965=>1000,36966=>1000,36967=>1000,36968=>1000,36969=>1000,36970=>1000,36971=>1000,36972=>1000,36973=>1000,36974=>1000,36975=>1000,36976=>1000,36977=>1000,36978=>1000,36979=>1000,36980=>1000, - 36981=>1000,36982=>1000,36983=>1000,36984=>1000,36985=>1000,36986=>1000,36987=>1000,36988=>1000,36989=>1000,36990=>1000,36991=>1000,36992=>1000,36993=>1000,36994=>1000,36995=>1000,36996=>1000, - 36997=>1000,36998=>1000,36999=>1000,37000=>1000,37001=>1000,37002=>1000,37003=>1000,37004=>1000,37005=>1000,37006=>1000,37007=>1000,37008=>1000,37009=>1000,37010=>1000,37011=>1000,37012=>1000, - 37013=>1000,37014=>1000,37015=>1000,37016=>1000,37017=>1000,37018=>1000,37019=>1000,37020=>1000,37021=>1000,37022=>1000,37023=>1000,37024=>1000,37025=>1000,37026=>1000,37027=>1000,37028=>1000, - 37029=>1000,37030=>1000,37031=>1000,37032=>1000,37033=>1000,37034=>1000,37035=>1000,37036=>1000,37037=>1000,37038=>1000,37039=>1000,37040=>1000,37041=>1000,37042=>1000,37043=>1000,37044=>1000, - 37045=>1000,37046=>1000,37047=>1000,37048=>1000,37049=>1000,37050=>1000,37051=>1000,37052=>1000,37053=>1000,37054=>1000,37055=>1000,37056=>1000,37057=>1000,37058=>1000,37059=>1000,37060=>1000, - 37061=>1000,37062=>1000,37063=>1000,37064=>1000,37065=>1000,37066=>1000,37067=>1000,37068=>1000,37069=>1000,37070=>1000,37071=>1000,37072=>1000,37073=>1000,37074=>1000,37075=>1000,37076=>1000, - 37077=>1000,37078=>1000,37079=>1000,37080=>1000,37081=>1000,37082=>1000,37083=>1000,37084=>1000,37085=>1000,37086=>1000,37087=>1000,37088=>1000,37089=>1000,37090=>1000,37091=>1000,37092=>1000, - 37093=>1000,37094=>1000,37095=>1000,37096=>1000,37097=>1000,37098=>1000,37099=>1000,37100=>1000,37101=>1000,37102=>1000,37103=>1000,37104=>1000,37105=>1000,37106=>1000,37107=>1000,37108=>1000, - 37109=>1000,37110=>1000,37111=>1000,37112=>1000,37113=>1000,37114=>1000,37115=>1000,37116=>1000,37117=>1000,37118=>1000,37119=>1000,37120=>1000,37121=>1000,37122=>1000,37123=>1000,37124=>1000, - 37125=>1000,37126=>1000,37127=>1000,37128=>1000,37129=>1000,37130=>1000,37131=>1000,37132=>1000,37133=>1000,37134=>1000,37135=>1000,37136=>1000,37137=>1000,37138=>1000,37139=>1000,37140=>1000, - 37141=>1000,37142=>1000,37143=>1000,37144=>1000,37145=>1000,37146=>1000,37147=>1000,37148=>1000,37149=>1000,37150=>1000,37151=>1000,37152=>1000,37153=>1000,37154=>1000,37155=>1000,37156=>1000, - 37157=>1000,37158=>1000,37159=>1000,37160=>1000,37161=>1000,37162=>1000,37163=>1000,37164=>1000,37165=>1000,37166=>1000,37167=>1000,37168=>1000,37169=>1000,37170=>1000,37171=>1000,37172=>1000, - 37173=>1000,37174=>1000,37175=>1000,37176=>1000,37177=>1000,37178=>1000,37179=>1000,37180=>1000,37181=>1000,37182=>1000,37183=>1000,37184=>1000,37185=>1000,37186=>1000,37187=>1000,37188=>1000, - 37189=>1000,37190=>1000,37191=>1000,37192=>1000,37193=>1000,37194=>1000,37195=>1000,37196=>1000,37197=>1000,37198=>1000,37199=>1000,37200=>1000,37201=>1000,37202=>1000,37203=>1000,37204=>1000, - 37205=>1000,37206=>1000,37207=>1000,37208=>1000,37209=>1000,37210=>1000,37211=>1000,37212=>1000,37213=>1000,37214=>1000,37215=>1000,37216=>1000,37217=>1000,37218=>1000,37219=>1000,37220=>1000, - 37221=>1000,37222=>1000,37223=>1000,37224=>1000,37225=>1000,37226=>1000,37227=>1000,37228=>1000,37229=>1000,37230=>1000,37231=>1000,37232=>1000,37233=>1000,37234=>1000,37235=>1000,37236=>1000, - 37237=>1000,37238=>1000,37239=>1000,37240=>1000,37241=>1000,37242=>1000,37243=>1000,37244=>1000,37245=>1000,37246=>1000,37247=>1000,37248=>1000,37249=>1000,37250=>1000,37251=>1000,37252=>1000, - 37253=>1000,37254=>1000,37255=>1000,37256=>1000,37257=>1000,37258=>1000,37259=>1000,37260=>1000,37261=>1000,37262=>1000,37263=>1000,37264=>1000,37265=>1000,37266=>1000,37267=>1000,37268=>1000, - 37269=>1000,37270=>1000,37271=>1000,37272=>1000,37273=>1000,37274=>1000,37275=>1000,37276=>1000,37277=>1000,37278=>1000,37279=>1000,37280=>1000,37281=>1000,37282=>1000,37283=>1000,37284=>1000, - 37285=>1000,37286=>1000,37287=>1000,37288=>1000,37289=>1000,37290=>1000,37291=>1000,37292=>1000,37293=>1000,37294=>1000,37295=>1000,37296=>1000,37297=>1000,37298=>1000,37299=>1000,37300=>1000, - 37301=>1000,37302=>1000,37303=>1000,37304=>1000,37305=>1000,37306=>1000,37307=>1000,37308=>1000,37309=>1000,37310=>1000,37311=>1000,37312=>1000,37313=>1000,37314=>1000,37315=>1000,37316=>1000, - 37317=>1000,37318=>1000,37319=>1000,37320=>1000,37321=>1000,37322=>1000,37323=>1000,37324=>1000,37325=>1000,37326=>1000,37327=>1000,37328=>1000,37329=>1000,37330=>1000,37331=>1000,37332=>1000, - 37333=>1000,37334=>1000,37335=>1000,37336=>1000,37337=>1000,37338=>1000,37339=>1000,37340=>1000,37341=>1000,37342=>1000,37343=>1000,37344=>1000,37345=>1000,37346=>1000,37347=>1000,37348=>1000, - 37349=>1000,37350=>1000,37351=>1000,37352=>1000,37353=>1000,37354=>1000,37355=>1000,37356=>1000,37357=>1000,37358=>1000,37359=>1000,37360=>1000,37361=>1000,37362=>1000,37363=>1000,37364=>1000, - 37365=>1000,37366=>1000,37367=>1000,37368=>1000,37369=>1000,37370=>1000,37371=>1000,37372=>1000,37373=>1000,37374=>1000,37375=>1000,37376=>1000,37377=>1000,37378=>1000,37379=>1000,37380=>1000, - 37381=>1000,37382=>1000,37383=>1000,37384=>1000,37385=>1000,37386=>1000,37387=>1000,37388=>1000,37389=>1000,37390=>1000,37391=>1000,37392=>1000,37393=>1000,37394=>1000,37395=>1000,37396=>1000, - 37397=>1000,37398=>1000,37399=>1000,37400=>1000,37401=>1000,37402=>1000,37403=>1000,37404=>1000,37405=>1000,37406=>1000,37407=>1000,37408=>1000,37409=>1000,37410=>1000,37411=>1000,37412=>1000, - 37413=>1000,37414=>1000,37415=>1000,37416=>1000,37417=>1000,37418=>1000,37419=>1000,37420=>1000,37421=>1000,37422=>1000,37423=>1000,37424=>1000,37425=>1000,37426=>1000,37427=>1000,37428=>1000, - 37429=>1000,37430=>1000,37431=>1000,37432=>1000,37433=>1000,37434=>1000,37435=>1000,37436=>1000,37437=>1000,37438=>1000,37439=>1000,37440=>1000,37441=>1000,37442=>1000,37443=>1000,37444=>1000, - 37445=>1000,37446=>1000,37447=>1000,37448=>1000,37449=>1000,37450=>1000,37451=>1000,37452=>1000,37453=>1000,37454=>1000,37455=>1000,37456=>1000,37457=>1000,37458=>1000,37459=>1000,37460=>1000, - 37461=>1000,37462=>1000,37463=>1000,37464=>1000,37465=>1000,37466=>1000,37467=>1000,37468=>1000,37469=>1000,37470=>1000,37471=>1000,37472=>1000,37473=>1000,37474=>1000,37475=>1000,37476=>1000, - 37477=>1000,37478=>1000,37479=>1000,37480=>1000,37481=>1000,37482=>1000,37483=>1000,37484=>1000,37485=>1000,37486=>1000,37487=>1000,37488=>1000,37489=>1000,37490=>1000,37491=>1000,37492=>1000, - 37493=>1000,37494=>1000,37495=>1000,37496=>1000,37497=>1000,37498=>1000,37499=>1000,37500=>1000,37501=>1000,37502=>1000,37503=>1000,37504=>1000,37505=>1000,37506=>1000,37507=>1000,37508=>1000, - 37509=>1000,37510=>1000,37511=>1000,37512=>1000,37513=>1000,37514=>1000,37515=>1000,37516=>1000,37517=>1000,37518=>1000,37519=>1000,37520=>1000,37521=>1000,37522=>1000,37523=>1000,37524=>1000, - 37525=>1000,37526=>1000,37527=>1000,37528=>1000,37529=>1000,37530=>1000,37531=>1000,37532=>1000,37533=>1000,37534=>1000,37535=>1000,37536=>1000,37537=>1000,37538=>1000,37539=>1000,37540=>1000, - 37541=>1000,37542=>1000,37543=>1000,37544=>1000,37545=>1000,37546=>1000,37547=>1000,37548=>1000,37549=>1000,37550=>1000,37551=>1000,37552=>1000,37553=>1000,37554=>1000,37555=>1000,37556=>1000, - 37557=>1000,37558=>1000,37559=>1000,37560=>1000,37561=>1000,37562=>1000,37563=>1000,37564=>1000,37565=>1000,37566=>1000,37567=>1000,37568=>1000,37569=>1000,37570=>1000,37571=>1000,37572=>1000, - 37573=>1000,37574=>1000,37575=>1000,37576=>1000,37577=>1000,37578=>1000,37579=>1000,37580=>1000,37581=>1000,37582=>1000,37583=>1000,37584=>1000,37585=>1000,37586=>1000,37587=>1000,37588=>1000, - 37589=>1000,37590=>1000,37591=>1000,37592=>1000,37593=>1000,37594=>1000,37595=>1000,37596=>1000,37597=>1000,37598=>1000,37599=>1000,37600=>1000,37601=>1000,37602=>1000,37603=>1000,37604=>1000, - 37605=>1000,37606=>1000,37607=>1000,37608=>1000,37609=>1000,37610=>1000,37611=>1000,37612=>1000,37613=>1000,37614=>1000,37615=>1000,37616=>1000,37617=>1000,37618=>1000,37619=>1000,37620=>1000, - 37621=>1000,37622=>1000,37623=>1000,37624=>1000,37625=>1000,37626=>1000,37627=>1000,37628=>1000,37629=>1000,37630=>1000,37631=>1000,37632=>1000,37633=>1000,37634=>1000,37635=>1000,37636=>1000, - 37637=>1000,37638=>1000,37639=>1000,37640=>1000,37641=>1000,37642=>1000,37643=>1000,37644=>1000,37645=>1000,37646=>1000,37647=>1000,37648=>1000,37649=>1000,37650=>1000,37651=>1000,37652=>1000, - 37653=>1000,37654=>1000,37655=>1000,37656=>1000,37657=>1000,37658=>1000,37659=>1000,37660=>1000,37661=>1000,37662=>1000,37663=>1000,37664=>1000,37665=>1000,37666=>1000,37667=>1000,37668=>1000, - 37669=>1000,37670=>1000,37671=>1000,37672=>1000,37673=>1000,37674=>1000,37675=>1000,37676=>1000,37677=>1000,37678=>1000,37679=>1000,37680=>1000,37681=>1000,37682=>1000,37683=>1000,37684=>1000, - 37685=>1000,37686=>1000,37687=>1000,37688=>1000,37689=>1000,37690=>1000,37691=>1000,37692=>1000,37693=>1000,37694=>1000,37695=>1000,37696=>1000,37697=>1000,37698=>1000,37699=>1000,37700=>1000, - 37701=>1000,37702=>1000,37703=>1000,37704=>1000,37705=>1000,37706=>1000,37707=>1000,37708=>1000,37709=>1000,37710=>1000,37711=>1000,37712=>1000,37713=>1000,37714=>1000,37715=>1000,37716=>1000, - 37717=>1000,37718=>1000,37719=>1000,37720=>1000,37721=>1000,37722=>1000,37723=>1000,37724=>1000,37725=>1000,37726=>1000,37727=>1000,37728=>1000,37729=>1000,37730=>1000,37731=>1000,37732=>1000, - 37733=>1000,37734=>1000,37735=>1000,37736=>1000,37737=>1000,37738=>1000,37739=>1000,37740=>1000,37741=>1000,37742=>1000,37743=>1000,37744=>1000,37745=>1000,37746=>1000,37747=>1000,37748=>1000, - 37749=>1000,37750=>1000,37751=>1000,37752=>1000,37753=>1000,37754=>1000,37755=>1000,37756=>1000,37757=>1000,37758=>1000,37759=>1000,37760=>1000,37761=>1000,37762=>1000,37763=>1000,37764=>1000, - 37765=>1000,37766=>1000,37767=>1000,37768=>1000,37769=>1000,37770=>1000,37771=>1000,37772=>1000,37773=>1000,37774=>1000,37775=>1000,37776=>1000,37777=>1000,37778=>1000,37779=>1000,37780=>1000, - 37781=>1000,37782=>1000,37783=>1000,37784=>1000,37785=>1000,37786=>1000,37787=>1000,37788=>1000,37789=>1000,37790=>1000,37791=>1000,37792=>1000,37793=>1000,37794=>1000,37795=>1000,37796=>1000, - 37797=>1000,37798=>1000,37799=>1000,37800=>1000,37801=>1000,37802=>1000,37803=>1000,37804=>1000,37805=>1000,37806=>1000,37807=>1000,37808=>1000,37809=>1000,37810=>1000,37811=>1000,37812=>1000, - 37813=>1000,37814=>1000,37815=>1000,37816=>1000,37817=>1000,37818=>1000,37819=>1000,37820=>1000,37821=>1000,37822=>1000,37823=>1000,37824=>1000,37825=>1000,37826=>1000,37827=>1000,37828=>1000, - 37829=>1000,37830=>1000,37831=>1000,37832=>1000,37833=>1000,37834=>1000,37835=>1000,37836=>1000,37837=>1000,37838=>1000,37839=>1000,37840=>1000,37841=>1000,37842=>1000,37843=>1000,37844=>1000, - 37845=>1000,37846=>1000,37847=>1000,37848=>1000,37849=>1000,37850=>1000,37851=>1000,37852=>1000,37853=>1000,37854=>1000,37855=>1000,37856=>1000,37857=>1000,37858=>1000,37859=>1000,37860=>1000, - 37861=>1000,37862=>1000,37863=>1000,37864=>1000,37865=>1000,37866=>1000,37867=>1000,37868=>1000,37869=>1000,37870=>1000,37871=>1000,37872=>1000,37873=>1000,37874=>1000,37875=>1000,37876=>1000, - 37877=>1000,37878=>1000,37879=>1000,37880=>1000,37881=>1000,37882=>1000,37883=>1000,37884=>1000,37885=>1000,37886=>1000,37887=>1000,37888=>1000,37889=>1000,37890=>1000,37891=>1000,37892=>1000, - 37893=>1000,37894=>1000,37895=>1000,37896=>1000,37897=>1000,37898=>1000,37899=>1000,37900=>1000,37901=>1000,37902=>1000,37903=>1000,37904=>1000,37905=>1000,37906=>1000,37907=>1000,37908=>1000, - 37909=>1000,37910=>1000,37911=>1000,37912=>1000,37913=>1000,37914=>1000,37915=>1000,37916=>1000,37917=>1000,37918=>1000,37919=>1000,37920=>1000,37921=>1000,37922=>1000,37923=>1000,37924=>1000, - 37925=>1000,37926=>1000,37927=>998,37928=>1000,37929=>1000,37930=>1000,37931=>1000,37932=>1000,37933=>1000,37934=>1000,37935=>1000,37936=>1000,37937=>1000,37938=>1000,37939=>1000,37940=>1000, - 37941=>1000,37942=>1000,37943=>1000,37944=>1000,37945=>1000,37946=>1000,37947=>1000,37948=>1000,37949=>1000,37950=>1000,37951=>1000,37952=>1000,37953=>1000,37954=>1000,37955=>1000,37956=>1000, - 37957=>1000,37958=>1000,37959=>1000,37960=>1000,37961=>1000,37962=>1000,37963=>1000,37964=>1000,37965=>1000,37966=>1000,37967=>1000,37968=>1000,37969=>1000,37970=>1000,37971=>1000,37972=>1000, - 37973=>1000,37974=>1000,37975=>1000,37976=>1000,37977=>1000,37978=>1000,37979=>1000,37980=>1000,37981=>1000,37982=>1000,37983=>1000,37984=>1000,37985=>1000,37986=>1000,37987=>1000,37988=>1000, - 37989=>1000,37990=>1000,37991=>1000,37992=>1000,37993=>1000,37994=>1000,37995=>1000,37996=>1000,37997=>1000,37998=>1000,37999=>1000,38000=>1000,38001=>1000,38002=>1000,38003=>1000,38004=>1000, - 38005=>1000,38006=>1000,38007=>1000,38008=>1000,38009=>1000,38010=>1000,38011=>1000,38012=>1000,38013=>1000,38014=>1000,38015=>1000,38016=>1000,38017=>1000,38018=>1000,38019=>1000,38020=>1000, - 38021=>1000,38022=>1000,38023=>1000,38024=>1000,38025=>1000,38026=>1000,38027=>1000,38028=>1000,38029=>1000,38030=>1000,38031=>1000,38032=>1000,38033=>1000,38034=>1000,38035=>1000,38036=>1000, - 38037=>1000,38038=>1000,38039=>1000,38040=>1000,38041=>1000,38042=>1000,38043=>1000,38044=>1000,38045=>1000,38046=>1000,38047=>1000,38048=>1000,38049=>1000,38050=>1000,38051=>1000,38052=>1000, - 38053=>1000,38054=>1000,38055=>1000,38056=>1000,38057=>1000,38058=>1000,38059=>1000,38060=>1000,38061=>1000,38062=>1000,38063=>1000,38064=>1000,38065=>1000,38066=>1000,38067=>1000,38068=>1000, - 38069=>1000,38070=>1000,38071=>1000,38072=>1000,38073=>1000,38074=>1000,38075=>1000,38076=>1000,38077=>1000,38078=>1000,38079=>1000,38080=>1000,38081=>1000,38082=>1000,38083=>1000,38084=>1000, - 38085=>1000,38086=>1000,38087=>1000,38088=>1000,38089=>1000,38090=>1000,38091=>1000,38092=>1000,38093=>1000,38094=>1000,38095=>1000,38096=>1000,38097=>1000,38098=>1000,38099=>1000,38100=>1000, - 38101=>1000,38102=>1000,38103=>1000,38104=>1000,38105=>1000,38106=>1000,38107=>1000,38108=>1000,38109=>1000,38110=>1000,38111=>1000,38112=>1000,38113=>1000,38114=>1000,38115=>1000,38116=>1000, - 38117=>1000,38118=>1000,38119=>1000,38120=>1000,38121=>1000,38122=>1000,38123=>1000,38124=>1000,38125=>1000,38126=>1000,38127=>1000,38128=>1000,38129=>1000,38130=>1000,38131=>1000,38132=>1000, - 38133=>1000,38134=>1000,38135=>1000,38136=>1000,38137=>1000,38138=>1000,38139=>1000,38140=>1000,38141=>1000,38142=>1000,38143=>1000,38144=>1000,38145=>1000,38146=>1000,38147=>1000,38148=>1000, - 38149=>1000,38150=>1000,38151=>1000,38152=>1000,38153=>1000,38154=>1000,38155=>1000,38156=>1000,38157=>1000,38158=>1000,38159=>1000,38160=>1000,38161=>1000,38162=>1000,38163=>1000,38164=>1000, - 38165=>1000,38166=>1000,38167=>1000,38168=>1000,38169=>1000,38170=>1000,38171=>1000,38172=>1000,38173=>1000,38174=>1000,38175=>1000,38176=>1000,38177=>1000,38178=>1000,38179=>1000,38180=>1000, - 38181=>1000,38182=>1000,38183=>1000,38184=>1000,38185=>1000,38186=>1000,38187=>1000,38188=>1000,38189=>1000,38190=>1000,38191=>1000,38192=>1000,38193=>1000,38194=>1000,38195=>1000,38196=>1000, - 38197=>1000,38198=>1000,38199=>1000,38200=>1000,38201=>1000,38202=>1000,38203=>1000,38204=>1000,38205=>1000,38206=>1000,38207=>1000,38208=>1000,38209=>1000,38210=>1000,38211=>1000,38212=>1000, - 38213=>1000,38214=>1000,38215=>1000,38216=>1000,38217=>1000,38218=>1000,38219=>1000,38220=>1000,38221=>1000,38222=>1000,38223=>1000,38224=>1000,38225=>1000,38226=>1000,38227=>1000,38228=>1000, - 38229=>1000,38230=>1000,38231=>1000,38232=>1000,38233=>1000,38234=>1000,38235=>1000,38236=>1000,38237=>1000,38238=>1000,38239=>1000,38240=>1000,38241=>1000,38242=>1000,38243=>1000,38244=>1000, - 38245=>1000,38246=>1000,38247=>1000,38248=>1000,38249=>1000,38250=>1000,38251=>1000,38252=>1000,38253=>1000,38254=>1000,38255=>1000,38256=>1000,38257=>1000,38258=>1000,38259=>1000,38260=>1000, - 38261=>1000,38262=>1000,38263=>1000,38264=>1000,38265=>1000,38266=>1000,38267=>1000,38268=>1000,38269=>1000,38270=>1000,38271=>1000,38272=>1000,38273=>1000,38274=>1000,38275=>1000,38276=>1000, - 38277=>1000,38278=>1000,38279=>1000,38280=>1000,38281=>1000,38282=>1000,38283=>1000,38284=>1000,38285=>1000,38286=>1000,38287=>1000,38288=>1000,38289=>1000,38290=>1000,38291=>1000,38292=>1000, - 38293=>1000,38294=>1000,38295=>1000,38296=>1000,38297=>1000,38298=>1000,38299=>1000,38300=>1000,38301=>1000,38302=>1000,38303=>1000,38304=>1000,38305=>1000,38306=>1000,38307=>1000,38308=>1000, - 38309=>1000,38310=>1000,38311=>1000,38312=>1000,38313=>1000,38314=>1000,38315=>1000,38316=>1000,38317=>1000,38318=>1000,38319=>1000,38320=>1000,38321=>1000,38322=>1000,38323=>1000,38324=>1000, - 38325=>1000,38326=>1000,38327=>1000,38328=>1000,38329=>1000,38330=>1000,38331=>1000,38332=>1000,38333=>1000,38334=>1000,38335=>1000,38336=>1000,38337=>1000,38338=>1000,38339=>1000,38340=>1000, - 38341=>1000,38342=>1000,38343=>1000,38344=>1000,38345=>1000,38346=>1000,38347=>1000,38348=>1000,38349=>1000,38350=>1000,38351=>1000,38352=>1000,38353=>1000,38354=>1000,38355=>1000,38356=>1000, - 38357=>1000,38358=>1000,38359=>1000,38360=>1000,38361=>1000,38362=>1000,38363=>1000,38364=>1000,38365=>1000,38366=>1000,38367=>1000,38368=>1000,38369=>1000,38370=>1000,38371=>1000,38372=>1000, - 38373=>1000,38374=>1000,38375=>1000,38376=>1000,38377=>1000,38378=>1000,38379=>1000,38380=>1000,38381=>1000,38382=>1000,38383=>1000,38384=>1000,38385=>1000,38386=>1000,38387=>1000,38388=>1000, - 38389=>1000,38390=>1000,38391=>1000,38392=>1000,38393=>1000,38394=>1000,38395=>1000,38396=>1000,38397=>1000,38398=>1000,38399=>1000,38400=>1000,38401=>1000,38402=>1000,38403=>1000,38404=>1000, - 38405=>1000,38406=>1000,38407=>1000,38408=>1000,38409=>1000,38410=>1000,38411=>1000,38412=>1000,38413=>1000,38414=>1000,38415=>1000,38416=>1000,38417=>1000,38418=>1000,38419=>1000,38420=>1000, - 38421=>1000,38422=>1000,38423=>1000,38424=>1000,38425=>1000,38426=>1000,38427=>1000,38428=>1000,38429=>1000,38430=>1000,38431=>1000,38432=>1000,38433=>1000,38434=>1000,38435=>1000,38436=>1000, - 38437=>1000,38438=>1000,38439=>1000,38440=>1000,38441=>1000,38442=>1000,38443=>1000,38444=>1000,38445=>1000,38446=>1000,38447=>1000,38448=>1000,38449=>1000,38450=>1000,38451=>1000,38452=>1000, - 38453=>1000,38454=>1000,38455=>1000,38456=>1000,38457=>1000,38458=>1000,38459=>1000,38460=>1000,38461=>1000,38462=>1000,38463=>1000,38464=>1000,38465=>1000,38466=>1000,38467=>1000,38468=>1000, - 38469=>1000,38470=>1000,38471=>1000,38472=>1000,38473=>1000,38474=>1000,38475=>1000,38476=>1000,38477=>1000,38478=>1000,38479=>1000,38480=>1000,38481=>1000,38482=>1000,38483=>1000,38484=>1000, - 38485=>1000,38486=>1000,38487=>1000,38488=>1000,38489=>1000,38490=>1000,38491=>1000,38492=>1000,38493=>1000,38494=>1000,38495=>1000,38496=>1000,38497=>1000,38498=>1000,38499=>1000,38500=>1000, - 38501=>1000,38502=>1000,38503=>1000,38504=>1000,38505=>1000,38506=>1000,38507=>1000,38508=>1000,38509=>1000,38510=>1000,38511=>1000,38512=>1000,38513=>1000,38514=>1000,38515=>1000,38516=>1000, - 38517=>1000,38518=>1000,38519=>1000,38520=>1000,38521=>1000,38522=>1000,38523=>1000,38524=>1000,38525=>1000,38526=>1000,38527=>1000,38528=>1000,38529=>1000,38530=>1000,38531=>1000,38532=>1000, - 38533=>1000,38534=>1000,38535=>1000,38536=>1000,38537=>1000,38538=>1000,38539=>1000,38540=>1000,38541=>1000,38542=>1000,38543=>1000,38544=>1000,38545=>1000,38546=>1000,38547=>1000,38548=>1000, - 38549=>1000,38550=>1000,38551=>1000,38552=>1000,38553=>1000,38554=>1000,38555=>1000,38556=>1000,38557=>1000,38558=>1000,38559=>1000,38560=>1000,38561=>1000,38562=>1000,38563=>1000,38564=>1000, - 38565=>1000,38566=>1000,38567=>1000,38568=>1000,38569=>1000,38570=>1000,38571=>1000,38572=>1000,38573=>1000,38574=>1000,38575=>1000,38576=>1000,38577=>1000,38578=>1000,38579=>1000,38580=>1000, - 38581=>1000,38582=>1000,38583=>1000,38584=>1000,38585=>1000,38586=>1000,38587=>1000,38588=>1000,38589=>1000,38590=>1000,38591=>1000,38592=>1000,38593=>1000,38594=>1000,38595=>1000,38596=>1000, - 38597=>1000,38598=>1000,38599=>1000,38600=>1000,38601=>1000,38602=>1000,38603=>1000,38604=>1000,38605=>1000,38606=>1000,38607=>1000,38608=>1000,38609=>1000,38610=>1000,38611=>1000,38612=>1000, - 38613=>1000,38614=>1000,38615=>1000,38616=>1000,38617=>1000,38618=>1000,38619=>1000,38620=>1000,38621=>1000,38622=>1000,38623=>1000,38624=>1000,38625=>1000,38626=>1000,38627=>1000,38628=>1000, - 38629=>1000,38630=>1000,38631=>1000,38632=>1000,38633=>1000,38634=>1000,38635=>1000,38636=>1000,38637=>1000,38638=>1000,38639=>1000,38640=>1000,38641=>1000,38642=>1000,38643=>1000,38644=>1000, - 38645=>1000,38646=>1000,38647=>1000,38648=>1000,38649=>1000,38650=>1000,38651=>1000,38652=>1000,38653=>1000,38654=>1000,38655=>1000,38656=>1000,38657=>1000,38658=>1000,38659=>1000,38660=>1000, - 38661=>1000,38662=>1000,38663=>1000,38664=>1000,38665=>1000,38666=>1000,38667=>1000,38668=>1000,38669=>1000,38670=>1000,38671=>1000,38672=>1000,38673=>1000,38674=>1000,38675=>1000,38676=>1000, - 38677=>1000,38678=>1000,38679=>1000,38680=>1000,38681=>1000,38682=>1000,38683=>1000,38684=>1000,38685=>1000,38686=>1000,38687=>1000,38688=>1000,38689=>1000,38690=>1000,38691=>1000,38692=>1000, - 38693=>1000,38694=>1000,38695=>1000,38696=>1000,38697=>1000,38698=>1000,38699=>1000,38700=>1000,38701=>1000,38702=>1000,38703=>1000,38704=>1000,38705=>1000,38706=>1000,38707=>1000,38708=>1000, - 38709=>1000,38710=>1000,38711=>1000,38712=>1000,38713=>1000,38714=>1000,38715=>1000,38716=>1000,38717=>1000,38718=>1000,38719=>1000,38720=>1000,38721=>1000,38722=>1000,38723=>1000,38724=>1000, - 38725=>1000,38726=>1000,38727=>1000,38728=>1000,38729=>1000,38730=>1000,38731=>1000,38732=>1000,38733=>1000,38734=>1000,38735=>1000,38736=>1000,38737=>1000,38738=>1000,38739=>1000,38740=>1000, - 38741=>1000,38742=>1000,38743=>1000,38744=>1000,38745=>1000,38746=>1000,38747=>1000,38748=>1000,38749=>1000,38750=>1000,38751=>1000,38752=>1000,38753=>1000,38754=>1000,38755=>1000,38756=>1000, - 38757=>1000,38758=>1000,38759=>1000,38760=>1000,38761=>1000,38762=>1000,38763=>1000,38764=>1000,38765=>1000,38766=>1000,38767=>1000,38768=>1000,38769=>1000,38770=>1000,38771=>1000,38772=>1000, - 38773=>1000,38774=>1000,38775=>1000,38776=>1000,38777=>1000,38778=>1000,38779=>1000,38780=>1000,38781=>1000,38782=>1000,38783=>1000,38784=>1000,38785=>1000,38786=>1000,38787=>1000,38788=>1000, - 38789=>1000,38790=>1000,38791=>1000,38792=>1000,38793=>1000,38794=>1000,38795=>1000,38796=>1000,38797=>1000,38798=>1000,38799=>1000,38800=>1000,38801=>1000,38802=>1000,38803=>1000,38804=>1000, - 38805=>1000,38806=>1000,38807=>1000,38808=>1000,38809=>1000,38810=>1000,38811=>1000,38812=>1000,38813=>1000,38814=>1000,38815=>1000,38816=>1000,38817=>1000,38818=>1000,38819=>1000,38820=>1000, - 38821=>1000,38822=>1000,38823=>1000,38824=>1000,38825=>1000,38826=>1000,38827=>1000,38828=>1000,38829=>1000,38830=>1000,38831=>1000,38832=>1000,38833=>1000,38834=>1000,38835=>1000,38836=>1000, - 38837=>1000,38838=>1000,38839=>1000,38840=>1000,38841=>1000,38842=>1000,38843=>1000,38844=>1000,38845=>1000,38846=>1000,38847=>1000,38848=>1000,38849=>1000,38850=>1000,38851=>1000,38852=>1000, - 38853=>1000,38854=>1000,38855=>1000,38856=>1000,38857=>1000,38858=>1000,38859=>1000,38860=>1000,38861=>1000,38862=>1000,38863=>1000,38864=>1000,38865=>1000,38866=>1000,38867=>1000,38868=>1000, - 38869=>1000,38870=>1000,38871=>1000,38872=>1000,38873=>1000,38874=>1000,38875=>1000,38876=>1000,38877=>1000,38878=>1000,38879=>1000,38880=>1000,38881=>1000,38882=>1000,38883=>1000,38884=>1000, - 38885=>1000,38886=>1000,38887=>1000,38888=>1000,38889=>1000,38890=>1000,38891=>1000,38892=>1000,38893=>1000,38894=>1000,38895=>1000,38896=>1000,38897=>1000,38898=>1000,38899=>1000,38900=>1000, - 38901=>1000,38902=>1000,38903=>1000,38904=>1000,38905=>1000,38906=>1000,38907=>1000,38908=>1000,38909=>1000,38910=>1000,38911=>1000,38912=>1000,38913=>1000,38914=>1000,38915=>1000,38916=>1000, - 38917=>1000,38918=>1000,38919=>1000,38920=>1000,38921=>1000,38922=>1000,38923=>1000,38924=>1000,38925=>1000,38926=>1000,38927=>1000,38928=>1000,38929=>1000,38930=>1000,38931=>1000,38932=>1000, - 38933=>1000,38934=>1000,38935=>1000,38936=>1000,38937=>1000,38938=>1000,38939=>1000,38940=>1000,38941=>1000,38942=>1000,38943=>1000,38944=>1000,38945=>1000,38946=>1000,38947=>1000,38948=>1000, - 38949=>1000,38950=>1000,38951=>1000,38952=>1000,38953=>1000,38954=>1000,38955=>1000,38956=>1000,38957=>1000,38958=>1000,38959=>1000,38960=>1000,38961=>1000,38962=>1000,38963=>1000,38964=>1000, - 38965=>1000,38966=>1000,38967=>1000,38968=>1000,38969=>1000,38970=>1000,38971=>1000,38972=>1000,38973=>1000,38974=>1000,38975=>1000,38976=>1000,38977=>1000,38978=>1000,38979=>1000,38980=>1000, - 38981=>1000,38982=>1000,38983=>1000,38984=>1000,38985=>1000,38986=>1000,38987=>1000,38988=>1000,38989=>1000,38990=>1000,38991=>1000,38992=>1000,38993=>1000,38994=>1000,38995=>1000,38996=>1000, - 38997=>1000,38998=>1000,38999=>1000,39000=>1000,39001=>1000,39002=>1000,39003=>1000,39004=>1000,39005=>1000,39006=>1000,39007=>1000,39008=>1000,39009=>1000,39010=>1000,39011=>1000,39012=>1000, - 39013=>1000,39014=>1000,39015=>1000,39016=>1000,39017=>1000,39018=>1000,39019=>1000,39020=>1000,39021=>1000,39022=>1000,39023=>1000,39024=>1000,39025=>1000,39026=>1000,39027=>1000,39028=>1000, - 39029=>1000,39030=>1000,39031=>1000,39032=>1000,39033=>1000,39034=>1000,39035=>1000,39036=>1000,39037=>1000,39038=>1000,39039=>1000,39040=>1000,39041=>1000,39042=>1000,39043=>1000,39044=>1000, - 39045=>1000,39046=>1000,39047=>1000,39048=>1000,39049=>1000,39050=>1000,39051=>1000,39052=>1000,39053=>1000,39054=>1000,39055=>1000,39056=>1000,39057=>1000,39058=>1000,39059=>1000,39060=>1000, - 39061=>1000,39062=>1000,39063=>1000,39064=>1000,39065=>1000,39066=>1000,39067=>1000,39068=>1000,39069=>1000,39070=>1000,39071=>1000,39072=>1000,39073=>1000,39074=>1000,39075=>1000,39076=>1000, - 39077=>1000,39078=>1000,39079=>1000,39080=>1000,39081=>1000,39082=>1000,39083=>1000,39084=>1000,39085=>1000,39086=>1000,39087=>1000,39088=>1000,39089=>1000,39090=>1000,39091=>1000,39092=>1000, - 39093=>1000,39094=>1000,39095=>1000,39096=>1000,39097=>1000,39098=>1000,39099=>1000,39100=>1000,39101=>1000,39102=>1000,39103=>1000,39104=>1000,39105=>1000,39106=>1000,39107=>1000,39108=>1000, - 39109=>1000,39110=>1000,39111=>1000,39112=>1000,39113=>1000,39114=>1000,39115=>1000,39116=>1000,39117=>1000,39118=>1000,39119=>1000,39120=>1000,39121=>1000,39122=>1000,39123=>1000,39124=>1000, - 39125=>1000,39126=>1000,39127=>1000,39128=>1000,39129=>1000,39130=>1000,39131=>1000,39132=>1000,39133=>1000,39134=>1000,39135=>1000,39136=>1000,39137=>1000,39138=>1000,39139=>1000,39140=>1000, - 39141=>1000,39142=>1000,39143=>1000,39144=>1000,39145=>1000,39146=>1000,39147=>1000,39148=>1000,39149=>1000,39150=>1000,39151=>1000,39152=>1000,39153=>1000,39154=>1000,39155=>1000,39156=>1000, - 39157=>1000,39158=>1000,39159=>1000,39160=>1000,39161=>1000,39162=>1000,39163=>1000,39164=>1000,39165=>1000,39166=>1000,39167=>1000,39168=>1000,39169=>1000,39170=>1000,39171=>1000,39172=>1000, - 39173=>1000,39174=>1000,39175=>1000,39176=>1000,39177=>1000,39178=>1000,39179=>1000,39180=>1000,39181=>1000,39182=>1000,39183=>1000,39184=>1000,39185=>1000,39186=>1000,39187=>1000,39188=>1000, - 39189=>1000,39190=>1000,39191=>1000,39192=>1000,39193=>1000,39194=>1000,39195=>1000,39196=>1000,39197=>1000,39198=>1000,39199=>1000,39200=>1000,39201=>1000,39202=>1000,39203=>1000,39204=>1000, - 39205=>1000,39206=>1000,39207=>1000,39208=>1000,39209=>1000,39210=>1000,39211=>1000,39212=>1000,39213=>1000,39214=>1000,39215=>1000,39216=>1000,39217=>1000,39218=>1000,39219=>1000,39220=>1000, - 39221=>1000,39222=>1000,39223=>1000,39224=>1000,39225=>1000,39226=>1000,39227=>1000,39228=>1000,39229=>1000,39230=>1000,39231=>1000,39232=>1000,39233=>1000,39234=>1000,39235=>1000,39236=>1000, - 39237=>1000,39238=>1000,39239=>1000,39240=>1000,39241=>1000,39242=>1000,39243=>1000,39244=>1000,39245=>1000,39246=>1000,39247=>1000,39248=>1000,39249=>1000,39250=>1000,39251=>1000,39252=>1000, - 39253=>1000,39254=>1000,39255=>1000,39256=>1000,39257=>1000,39258=>1000,39259=>1000,39260=>1000,39261=>1000,39262=>1000,39263=>1000,39264=>1000,39265=>1000,39266=>1000,39267=>1000,39268=>1000, - 39269=>1000,39270=>1000,39271=>1000,39272=>1000,39273=>1000,39274=>1000,39275=>1000,39276=>1000,39277=>1000,39278=>1000,39279=>1000,39280=>1000,39281=>1000,39282=>1000,39283=>1000,39284=>1000, - 39285=>1000,39286=>1000,39287=>1000,39288=>1000,39289=>1000,39290=>1000,39291=>1000,39292=>1000,39293=>1000,39294=>1000,39295=>1000,39296=>1000,39297=>1000,39298=>1000,39299=>1000,39300=>1000, - 39301=>1000,39302=>1000,39303=>1000,39304=>1000,39305=>1000,39306=>1000,39307=>1000,39308=>1000,39309=>1000,39310=>1000,39311=>1000,39312=>1000,39313=>1000,39314=>1000,39315=>1000,39316=>1000, - 39317=>1000,39318=>1000,39319=>1000,39320=>1000,39321=>1000,39322=>1000,39323=>1000,39324=>1000,39325=>1000,39326=>1000,39327=>1000,39328=>1000,39329=>1000,39330=>1000,39331=>1000,39332=>1000, - 39333=>1000,39334=>1000,39335=>1000,39336=>1000,39337=>1000,39338=>1000,39339=>1000,39340=>1000,39341=>1000,39342=>1000,39343=>1000,39344=>1000,39345=>1000,39346=>1000,39347=>1000,39348=>1000, - 39349=>1000,39350=>1000,39351=>1000,39352=>1000,39353=>1000,39354=>1000,39355=>1000,39356=>1000,39357=>1000,39358=>1000,39359=>1000,39360=>1000,39361=>1000,39362=>1000,39363=>1000,39364=>1000, - 39365=>1000,39366=>1000,39367=>1000,39368=>1000,39369=>1000,39370=>1000,39371=>1000,39372=>1000,39373=>1000,39374=>1000,39375=>1000,39376=>1000,39377=>1000,39378=>1000,39379=>1000,39380=>1000, - 39381=>1000,39382=>1000,39383=>1000,39384=>1000,39385=>1000,39386=>1000,39387=>1000,39388=>1000,39389=>1000,39390=>1000,39391=>1000,39392=>1000,39393=>1000,39394=>1000,39395=>1000,39396=>1000, - 39397=>1000,39398=>1000,39399=>1000,39400=>1000,39401=>1000,39402=>1000,39403=>1000,39404=>1000,39405=>1000,39406=>1000,39407=>1000,39408=>1000,39409=>1000,39410=>1000,39411=>1000,39412=>1000, - 39413=>1000,39414=>1000,39415=>1000,39416=>1000,39417=>1000,39418=>1000,39419=>1000,39420=>1000,39421=>1000,39422=>1000,39423=>1000,39424=>1000,39425=>1000,39426=>1000,39427=>1000,39428=>1000, - 39429=>1000,39430=>1000,39431=>1000,39432=>1000,39433=>1000,39434=>1000,39435=>1000,39436=>1000,39437=>1000,39438=>1000,39439=>1000,39440=>1000,39441=>1000,39442=>1000,39443=>1000,39444=>1000, - 39445=>1000,39446=>1000,39447=>1000,39448=>1000,39449=>1000,39450=>1000,39451=>1000,39452=>1000,39453=>1000,39454=>1000,39455=>1000,39456=>1000,39457=>1000,39458=>1000,39459=>1000,39460=>1000, - 39461=>1000,39462=>1000,39463=>1000,39464=>1000,39465=>1000,39466=>1000,39467=>1000,39468=>1000,39469=>1000,39470=>1000,39471=>1000,39472=>1000,39473=>1000,39474=>1000,39475=>1000,39476=>1000, - 39477=>1000,39478=>1000,39479=>1000,39480=>1000,39481=>1000,39482=>1000,39483=>1000,39484=>1000,39485=>1000,39486=>1000,39487=>1000,39488=>1000,39489=>1000,39490=>1000,39491=>1000,39492=>1000, - 39493=>1000,39494=>1000,39495=>1000,39496=>1000,39497=>1000,39498=>1000,39499=>1000,39500=>1000,39501=>1000,39502=>1000,39503=>1000,39504=>1000,39505=>1000,39506=>1000,39507=>1000,39508=>1000, - 39509=>1000,39510=>1000,39511=>1000,39512=>1000,39513=>1000,39514=>1000,39515=>1000,39516=>1000,39517=>1000,39518=>1000,39519=>1000,39520=>1000,39521=>1000,39522=>1000,39523=>1000,39524=>1000, - 39525=>1000,39526=>1000,39527=>1000,39528=>1000,39529=>1000,39530=>1000,39531=>1000,39532=>1000,39533=>1000,39534=>1000,39535=>1000,39536=>1000,39537=>1000,39538=>1000,39539=>1000,39540=>1000, - 39541=>1000,39542=>1000,39543=>1000,39544=>1000,39545=>1000,39546=>1000,39547=>1000,39548=>1000,39549=>1000,39550=>1000,39551=>1000,39552=>1000,39553=>1000,39554=>1000,39555=>1000,39556=>1000, - 39557=>1000,39558=>1000,39559=>1000,39560=>1000,39561=>1000,39562=>1000,39563=>1000,39564=>1000,39565=>1000,39566=>1000,39567=>1000,39568=>1000,39569=>1000,39570=>1000,39571=>1000,39572=>1000, - 39573=>1000,39574=>1000,39575=>1000,39576=>1000,39577=>1000,39578=>1000,39579=>1000,39580=>1000,39581=>1000,39582=>1000,39583=>1000,39584=>1000,39585=>1000,39586=>1000,39587=>1000,39588=>1000, - 39589=>1000,39590=>1000,39591=>1000,39592=>1000,39593=>1000,39594=>1000,39595=>1000,39596=>1000,39597=>1000,39598=>1000,39599=>1000,39600=>1000,39601=>1000,39602=>1000,39603=>1000,39604=>1000, - 39605=>1000,39606=>1000,39607=>1000,39608=>1000,39609=>1000,39610=>1000,39611=>1000,39612=>1000,39613=>1000,39614=>1000,39615=>1000,39616=>1000,39617=>1000,39618=>1000,39619=>1000,39620=>1000, - 39621=>1000,39622=>1000,39623=>1000,39624=>1000,39625=>1000,39626=>1000,39627=>1000,39628=>1000,39629=>1000,39630=>1000,39631=>1000,39632=>1000,39633=>1000,39634=>1000,39635=>1000,39636=>1000, - 39637=>1000,39638=>1000,39639=>1000,39640=>1000,39641=>1000,39642=>1000,39643=>1000,39644=>1000,39645=>1000,39646=>1000,39647=>1000,39648=>1000,39649=>1000,39650=>1000,39651=>1000,39652=>1000, - 39653=>1000,39654=>1000,39655=>1000,39656=>1000,39657=>1000,39658=>1000,39659=>1000,39660=>1000,39661=>1000,39662=>1000,39663=>1000,39664=>1000,39665=>1000,39666=>1000,39667=>1000,39668=>1000, - 39669=>1000,39670=>1000,39671=>1000,39672=>1000,39673=>1000,39674=>1000,39675=>1000,39676=>1000,39677=>1000,39678=>1000,39679=>1000,39680=>1000,39681=>1000,39682=>1000,39683=>1000,39684=>1000, - 39685=>1000,39686=>1000,39687=>1000,39688=>1000,39689=>1000,39690=>1000,39691=>1000,39692=>1000,39693=>1000,39694=>1000,39695=>1000,39696=>1000,39697=>1000,39698=>1000,39699=>1000,39700=>1000, - 39701=>1000,39702=>1000,39703=>1000,39704=>1000,39705=>1000,39706=>1000,39707=>1000,39708=>1000,39709=>1000,39710=>1000,39711=>1000,39712=>1000,39713=>1000,39714=>1000,39715=>1000,39716=>1000, - 39717=>1000,39718=>1000,39719=>1000,39720=>1000,39721=>1000,39722=>1000,39723=>1000,39724=>1000,39725=>1000,39726=>1000,39727=>1000,39728=>1000,39729=>1000,39730=>1000,39731=>1000,39732=>1000, - 39733=>1000,39734=>1000,39735=>1000,39736=>1000,39737=>1000,39738=>1000,39739=>1000,39740=>1000,39741=>1000,39742=>1000,39743=>1000,39744=>1000,39745=>1000,39746=>1000,39747=>1000,39748=>1000, - 39749=>1000,39750=>1000,39751=>1000,39752=>1000,39753=>1000,39754=>1000,39755=>1000,39756=>1000,39757=>1000,39758=>1000,39759=>1000,39760=>1000,39761=>1000,39762=>1000,39763=>1000,39764=>1000, - 39765=>1000,39766=>1000,39767=>1000,39768=>1000,39769=>1000,39770=>1000,39771=>1000,39772=>1000,39773=>1000,39774=>1000,39775=>1000,39776=>1000,39777=>1000,39778=>1000,39779=>1000,39780=>1000, - 39781=>1000,39782=>1000,39783=>1000,39784=>1000,39785=>1000,39786=>1000,39787=>1000,39788=>1000,39789=>1000,39790=>1000,39791=>1000,39792=>1000,39793=>1000,39794=>1000,39795=>1000,39796=>1000, - 39797=>1000,39798=>1000,39799=>1000,39800=>1000,39801=>1000,39802=>1000,39803=>1000,39804=>1000,39805=>1000,39806=>1000,39807=>1000,39808=>1000,39809=>1000,39810=>1000,39811=>1000,39812=>1000, - 39813=>1000,39814=>1000,39815=>1000,39816=>1000,39817=>1000,39818=>1000,39819=>1000,39820=>1000,39821=>1000,39822=>1000,39823=>1000,39824=>1000,39825=>1000,39826=>1000,39827=>1000,39828=>1000, - 39829=>1000,39830=>1000,39831=>1000,39832=>1000,39833=>1000,39834=>1000,39835=>1000,39836=>1000,39837=>1000,39838=>1000,39839=>1000,39840=>1000,39841=>1000,39842=>1000,39843=>1000,39844=>1000, - 39845=>1000,39846=>1000,39847=>1000,39848=>1000,39849=>1000,39850=>1000,39851=>1000,39852=>1000,39853=>1000,39854=>1000,39855=>1000,39856=>1000,39857=>1000,39858=>1000,39859=>1000,39860=>1000, - 39861=>1000,39862=>1000,39863=>1000,39864=>1000,39865=>1000,39866=>1000,39867=>1000,39868=>1000,39869=>1000,39870=>1000,39871=>1000,39872=>1000,39873=>1000,39874=>1000,39875=>1000,39876=>1000, - 39877=>1000,39878=>1000,39879=>1000,39880=>1000,39881=>1000,39882=>1000,39883=>1000,39884=>1000,39885=>1000,39886=>1000,39887=>1000,39888=>1000,39889=>1000,39890=>1000,39891=>1000,39892=>1000, - 39893=>1000,39894=>1000,39895=>1000,39896=>1000,39897=>1000,39898=>1000,39899=>1000,39900=>1000,39901=>1000,39902=>1000,39903=>1000,39904=>1000,39905=>1000,39906=>1000,39907=>1000,39908=>1000, - 39909=>1000,39910=>1000,39911=>1000,39912=>1000,39913=>1000,39914=>1000,39915=>1000,39916=>1000,39917=>1000,39918=>1000,39919=>1000,39920=>1000,39921=>1000,39922=>1000,39923=>1000,39924=>1000, - 39925=>1000,39926=>1000,39927=>1000,39928=>1000,39929=>1000,39930=>1000,39931=>1000,39932=>1000,39933=>1000,39934=>1000,39935=>1000,39936=>1000,39937=>1000,39938=>1000,39939=>1000,39940=>1000, - 39941=>1000,39942=>1000,39943=>1000,39944=>1000,39945=>1000,39946=>1000,39947=>1000,39948=>1000,39949=>1000,39950=>1000,39951=>1000,39952=>1000,39953=>1000,39954=>1000,39955=>1000,39956=>1000, - 39957=>1000,39958=>1000,39959=>1000,39960=>1000,39961=>1000,39962=>1000,39963=>1000,39964=>1000,39965=>1000,39966=>1000,39967=>1000,39968=>1000,39969=>1000,39970=>1000,39971=>1000,39972=>1000, - 39973=>1000,39974=>1000,39975=>1000,39976=>1000,39977=>1000,39978=>1000,39979=>1000,39980=>1000,39981=>1000,39982=>1000,39983=>1000,39984=>1000,39985=>1000,39986=>1000,39987=>1000,39988=>1000, - 39989=>1000,39990=>1000,39991=>1000,39992=>1000,39993=>1000,39994=>1000,39995=>1000,39996=>1000,39997=>1000,39998=>1000,39999=>1000,40000=>1000,40001=>1000,40002=>1000,40003=>1000,40004=>1000, - 40005=>1000,40006=>1000,40007=>1000,40008=>1000,40009=>1000,40010=>1000,40011=>1000,40012=>1000,40013=>1000,40014=>1000,40015=>1000,40016=>1000,40017=>1000,40018=>1000,40019=>1000,40020=>1000, - 40021=>1000,40022=>1000,40023=>1000,40024=>1000,40025=>1000,40026=>1000,40027=>1000,40028=>1000,40029=>1000,40030=>1000,40031=>1000,40032=>1000,40033=>1000,40034=>1000,40035=>1000,40036=>1000, - 40037=>1000,40038=>1000,40039=>1000,40040=>1000,40041=>1000,40042=>1000,40043=>1000,40044=>1000,40045=>1000,40046=>1000,40047=>1000,40048=>1000,40049=>1000,40050=>1000,40051=>1000,40052=>1000, - 40053=>1000,40054=>1000,40055=>1000,40056=>1000,40057=>1000,40058=>1000,40059=>1000,40060=>1000,40061=>1000,40062=>1000,40063=>1000,40064=>1000,40065=>1000,40066=>1000,40067=>1000,40068=>1000, - 40069=>1000,40070=>1000,40071=>1000,40072=>1000,40073=>1000,40074=>1000,40075=>1000,40076=>1000,40077=>1000,40078=>1000,40079=>1000,40080=>1000,40081=>1000,40082=>1000,40083=>1000,40084=>1000, - 40085=>1000,40086=>1000,40087=>1000,40088=>1000,40089=>1000,40090=>1000,40091=>1000,40092=>1000,40093=>1000,40094=>1000,40095=>1000,40096=>1000,40097=>1000,40098=>1000,40099=>1000,40100=>1000, - 40101=>1000,40102=>1000,40103=>1000,40104=>1000,40105=>1000,40106=>1000,40107=>1000,40108=>1000,40109=>1000,40110=>1000,40111=>1000,40112=>1000,40113=>1000,40114=>1000,40115=>1000,40116=>1000, - 40117=>1000,40118=>1000,40119=>1000,40120=>1000,40121=>1000,40122=>1000,40123=>1000,40124=>1000,40125=>1000,40126=>1000,40127=>1000,40128=>1000,40129=>1000,40130=>1000,40131=>1000,40132=>1000, - 40133=>1000,40134=>1000,40135=>1000,40136=>1000,40137=>1000,40138=>1000,40139=>1000,40140=>1000,40141=>1000,40142=>1000,40143=>1000,40144=>1000,40145=>1000,40146=>1000,40147=>1000,40148=>1000, - 40149=>1000,40150=>1000,40151=>1000,40152=>1000,40153=>1000,40154=>1000,40155=>1000,40156=>1000,40157=>1000,40158=>1000,40159=>1000,40160=>1000,40161=>1000,40162=>1000,40163=>1000,40164=>1000, - 40165=>1000,40166=>1000,40167=>1000,40168=>1000,40169=>1000,40170=>1000,40171=>1000,40172=>1000,40173=>1000,40174=>1000,40175=>1000,40176=>1000,40177=>1000,40178=>1000,40179=>1000,40180=>1000, - 40181=>1000,40182=>1000,40183=>1000,40184=>1000,40185=>1000,40186=>1000,40187=>1000,40188=>1000,40189=>1000,40190=>1000,40191=>1000,40192=>1000,40193=>1000,40194=>1000,40195=>1000,40196=>1000, - 40197=>1000,40198=>1000,40199=>1000,40200=>1000,40201=>1000,40202=>1000,40203=>1000,40204=>1000,40205=>1000,40206=>1000,40207=>1000,40208=>1000,40209=>1000,40210=>1000,40211=>1000,40212=>1000, - 40213=>1000,40214=>1000,40215=>1000,40216=>1000,40217=>1000,40218=>1000,40219=>1000,40220=>1000,40221=>1000,40222=>1000,40223=>1000,40224=>1000,40225=>1000,40226=>1000,40227=>1000,40228=>1000, - 40229=>1000,40230=>1000,40231=>1000,40232=>1000,40233=>1000,40234=>1000,40235=>1000,40236=>1000,40237=>1000,40238=>1000,40239=>1000,40240=>1000,40241=>1000,40242=>1000,40243=>1000,40244=>1000, - 40245=>1000,40246=>1000,40247=>1000,40248=>1000,40249=>1000,40250=>1000,40251=>1000,40252=>1000,40253=>1000,40254=>1000,40255=>1000,40256=>1000,40257=>1000,40258=>1000,40259=>1000,40260=>1000, - 40261=>1000,40262=>1000,40263=>1000,40264=>1000,40265=>1000,40266=>1000,40267=>1000,40268=>1000,40269=>1000,40270=>1000,40271=>1000,40272=>1000,40273=>1000,40274=>1000,40275=>1000,40276=>1000, - 40277=>1000,40278=>1000,40279=>1000,40280=>1000,40281=>1000,40282=>1000,40283=>1000,40284=>1000,40285=>1000,40286=>1000,40287=>1000,40288=>1000,40289=>1000,40290=>1000,40291=>1000,40292=>1000, - 40293=>1000,40294=>1000,40295=>1000,40296=>1000,40297=>1000,40298=>1000,40299=>1000,40300=>1000,40301=>1000,40302=>1000,40303=>1000,40304=>1000,40305=>1000,40306=>1000,40307=>1000,40308=>1000, - 40309=>1000,40310=>1000,40311=>1000,40312=>1000,40313=>1000,40314=>1000,40315=>1000,40316=>1000,40317=>1000,40318=>1000,40319=>1000,40320=>1000,40321=>1000,40322=>1000,40323=>1000,40324=>1000, - 40325=>1000,40326=>1000,40327=>1000,40328=>1000,40329=>1000,40330=>1000,40331=>1000,40332=>1000,40333=>1000,40334=>1000,40335=>1000,40336=>1000,40337=>1000,40338=>1000,40339=>1000,40340=>1000, - 40341=>1000,40342=>1000,40343=>1000,40344=>1000,40345=>1000,40346=>1000,40347=>1000,40348=>1000,40349=>1000,40350=>1000,40351=>1000,40352=>1000,40353=>1000,40354=>1000,40355=>1000,40356=>1000, - 40357=>1000,40358=>1000,40359=>1000,40360=>1000,40361=>1000,40362=>1000,40363=>1000,40364=>1000,40365=>1000,40366=>1000,40367=>1000,40368=>1000,40369=>1000,40370=>1000,40371=>1000,40372=>1000, - 40373=>1000,40374=>1000,40375=>1000,40376=>1000,40377=>1000,40378=>1000,40379=>1000,40380=>1000,40381=>1000,40382=>1000,40383=>1000,40384=>1000,40385=>1000,40386=>1000,40387=>1000,40388=>1000, - 40389=>1000,40390=>1000,40391=>1000,40392=>1000,40393=>1000,40394=>1000,40395=>1000,40396=>1000,40397=>1000,40398=>1000,40399=>1000,40400=>1000,40401=>1000,40402=>1000,40403=>1000,40404=>1000, - 40405=>1000,40406=>1000,40407=>1000,40408=>1000,40409=>1000,40410=>1000,40411=>1000,40412=>1000,40413=>1000,40414=>1000,40415=>1000,40416=>1000,40417=>1000,40418=>1000,40419=>1000,40420=>1000, - 40421=>1000,40422=>1000,40423=>1000,40424=>1000,40425=>1000,40426=>1000,40427=>1000,40428=>1000,40429=>1000,40430=>1000,40431=>1000,40432=>1000,40433=>1000,40434=>1000,40435=>1000,40436=>1000, - 40437=>1000,40438=>1000,40439=>1000,40440=>1000,40441=>1000,40442=>1000,40443=>1000,40444=>1000,40445=>1000,40446=>1000,40447=>1000,40448=>1000,40449=>1000,40450=>1000,40451=>1000,40452=>1000, - 40453=>1000,40454=>1000,40455=>1000,40456=>1000,40457=>1000,40458=>1000,40459=>1000,40460=>1000,40461=>1000,40462=>1000,40463=>1000,40464=>1000,40465=>1000,40466=>1000,40467=>1000,40468=>1000, - 40469=>1000,40470=>1000,40471=>1000,40472=>1000,40473=>1000,40474=>1000,40475=>1000,40476=>1000,40477=>1000,40478=>1000,40479=>1000,40480=>1000,40481=>1000,40482=>1000,40483=>1000,40484=>1000, - 40485=>1000,40486=>1000,40487=>1000,40488=>1000,40489=>1000,40490=>1000,40491=>1000,40492=>1000,40493=>1000,40494=>1000,40495=>1000,40496=>1000,40497=>1000,40498=>1000,40499=>1000,40500=>1000, - 40501=>1000,40502=>1000,40503=>1000,40504=>1000,40505=>1000,40506=>1000,40507=>1000,40508=>1000,40509=>1000,40510=>1000,40511=>1000,40512=>1000,40513=>1000,40514=>1000,40515=>1000,40516=>1000, - 40517=>1000,40518=>1000,40519=>1000,40520=>1000,40521=>1000,40522=>1000,40523=>1000,40524=>1000,40525=>1000,40526=>1000,40527=>1000,40528=>1000,40529=>1000,40530=>1000,40531=>1000,40532=>1000, - 40533=>1000,40534=>1000,40535=>1000,40536=>1000,40537=>1000,40538=>1000,40539=>1000,40540=>1000,40541=>1000,40542=>1000,40543=>1000,40544=>1000,40545=>1000,40546=>1000,40547=>1000,40548=>1000, - 40549=>1000,40550=>1000,40551=>1000,40552=>1000,40553=>1000,40554=>1000,40555=>1000,40556=>1000,40557=>1000,40558=>1000,40559=>1000,40560=>1000,40561=>1000,40562=>1000,40563=>1000,40564=>1000, - 40565=>1000,40566=>1000,40567=>1000,40568=>1000,40569=>1000,40570=>1000,40571=>1000,40572=>1000,40573=>1000,40574=>1000,40575=>1000,40576=>1000,40577=>1000,40578=>1000,40579=>1000,40580=>1000, - 40581=>1000,40582=>1000,40583=>1000,40584=>1000,40585=>1000,40586=>1000,40587=>1000,40588=>1000,40589=>1000,40590=>1000,40591=>1000,40592=>1000,40593=>1000,40594=>1000,40595=>1000,40596=>1000, - 40597=>1000,40598=>1000,40599=>1000,40600=>1000,40601=>1000,40602=>1000,40603=>1000,40604=>1000,40605=>1000,40606=>1000,40607=>1000,40608=>1000,40609=>1000,40610=>1000,40611=>1000,40612=>1000, - 40613=>1000,40614=>1000,40615=>1000,40616=>1000,40617=>1000,40618=>1000,40619=>1000,40620=>1000,40621=>1000,40622=>1000,40623=>1000,40624=>1000,40625=>1000,40626=>1000,40627=>1000,40628=>1000, - 40629=>1000,40630=>1000,40631=>1000,40632=>1000,40633=>1000,40634=>1000,40635=>1000,40636=>1000,40637=>1000,40638=>1000,40639=>1000,40640=>1000,40641=>1000,40642=>1000,40643=>1000,40644=>1000, - 40645=>1000,40646=>1000,40647=>1000,40648=>1000,40649=>1000,40650=>1000,40651=>1000,40652=>1000,40653=>1000,40654=>1000,40655=>1000,40656=>1000,40657=>1000,40658=>1000,40659=>1000,40660=>1000, - 40661=>1000,40662=>1000,40663=>1000,40664=>1000,40665=>1000,40666=>1000,40667=>1000,40668=>1000,40669=>1000,40670=>1000,40671=>1000,40672=>1000,40673=>1000,40674=>1000,40675=>1000,40676=>1000, - 40677=>1000,40678=>1000,40679=>1000,40680=>1000,40681=>1000,40682=>1000,40683=>1000,40684=>1000,40685=>1000,40686=>1000,40687=>1000,40688=>1000,40689=>1000,40690=>1000,40691=>1000,40692=>1000, - 40693=>1000,40694=>1000,40695=>1000,40696=>1000,40697=>1000,40698=>1000,40699=>1000,40700=>1000,40701=>1000,40702=>1000,40703=>1000,40704=>1000,40705=>1000,40706=>1000,40707=>1000,40708=>1000, - 40709=>1000,40710=>1000,40711=>1000,40712=>1000,40713=>1000,40714=>1000,40715=>1000,40716=>1000,40717=>1000,40718=>1000,40719=>1000,40720=>1000,40721=>1000,40722=>1000,40723=>1000,40724=>1000, - 40725=>1000,40726=>1000,40727=>1000,40728=>1000,40729=>1000,40730=>1000,40731=>1000,40732=>1000,40733=>1000,40734=>1000,40735=>1000,40736=>1000,40737=>1000,40738=>1000,40739=>1000,40740=>1000, - 40741=>1000,40742=>1000,40743=>1000,40744=>1000,40745=>1000,40746=>1000,40747=>1000,40748=>1000,40749=>1000,40750=>1000,40751=>1000,40752=>1000,40753=>1000,40754=>1000,40755=>1000,40756=>1000, - 40757=>1000,40758=>1000,40759=>1000,40760=>1000,40761=>1000,40762=>1000,40763=>1000,40764=>1000,40765=>1000,40766=>1000,40767=>1000,40768=>1000,40769=>1000,40770=>1000,40771=>1000,40772=>1000, - 40773=>1000,40774=>1000,40775=>1000,40776=>1000,40777=>1000,40778=>1000,40779=>1000,40780=>1000,40781=>1000,40782=>1000,40783=>1000,40784=>1000,40785=>1000,40786=>1000,40787=>1000,40788=>1000, - 40789=>1000,40790=>1000,40791=>1000,40792=>1000,40793=>1000,40794=>1000,40795=>1000,40796=>1000,40797=>1000,40798=>1000,40799=>1000,40800=>1000,40801=>1000,40802=>1000,40803=>1000,40804=>1000, - 40805=>1000,40806=>1000,40807=>1000,40808=>1000,40809=>1000,40810=>1000,40811=>1000,40812=>1000,40813=>1000,40814=>1000,40815=>1000,40816=>1000,40817=>1000,40818=>1000,40819=>1000,40820=>1000, - 40821=>1000,40822=>1000,40823=>1000,40824=>1000,40825=>1000,40826=>1000,40827=>1000,40828=>1000,40829=>1000,40830=>1000,40831=>1000,40832=>1000,40833=>1000,40834=>1000,40835=>1000,40836=>1000, - 40837=>1000,40838=>1000,40839=>1000,40840=>1000,40841=>1000,40842=>1000,40843=>1000,40844=>1000,40845=>1000,40846=>1000,40847=>1000,40848=>1000,40849=>1000,40850=>1000,40851=>1000,40852=>1000, - 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, - 40869=>1000); -$diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -//$enc='UniCNS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ac15.php'); - -//$enc='UniGB-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -//include(dirname(__FILE__).'/uni2cid_ag15.php'); - -$enc='UniKS-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -include(dirname(__FILE__).'/uni2cid_ak12.php'); - -//$enc='UniJIS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -//include(dirname(__FILE__).'/uni2cid_aj16.php'); -?> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0.php deleted file mode 100644 index ee1dbb2d9d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/arialunicid0.php +++ /dev/null @@ -1,1769 +0,0 @@ -<?php -$type='cidfont0'; -$name='ArialUnicodeMS'; -$desc=array('Ascent'=>1069,'Descent'=>-271,'CapHeight'=>1069,'Flags'=>32,'FontBBox'=>'[-1011 -330 2260 1078]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-100; -$ut=50; -$dw=1000; -$cw=array( - 32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278, - 48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556, - 64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, - 80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>500, - 96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, - 112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,8364=>556, - 1027=>567,8218=>222,402=>278,8222=>333,8230=>1000,8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,1036=>584,381=>611,1039=>723,8216=>222, - 8217=>222,8220=>333,8221=>333,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>500,8250=>333,339=>944,1116=>437,382=>500,376=>667,160=>278,161=>333, - 162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>500,176=>400,177=>584, - 178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667, - 194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722, - 210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, - 226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556, - 242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, - 258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500,268=>722,269=>500,270=>722,271=>627,272=>722,273=>556, - 274=>667,275=>556,276=>667,277=>556,278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556,288=>778,289=>556, - 290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>222,298=>278,299=>222,300=>278,301=>222,302=>278,303=>222,304=>278,305=>278, - 306=>751,307=>444,308=>500,309=>222,310=>667,311=>500,312=>437,313=>556,314=>222,315=>556,316=>222,317=>556,318=>222,319=>556,320=>318,321=>556, - 322=>222,323=>722,324=>556,325=>722,326=>556,327=>722,328=>556,329=>626,330=>723,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, - 340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500,350=>667,351=>500,354=>611,355=>278,356=>611,357=>406, - 358=>611,359=>278,360=>722,361=>556,362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556,372=>944,373=>722, - 374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>222,384=>556,385=>740,386=>655,387=>556,388=>556,389=>556,390=>722,391=>766,392=>579, - 393=>722,394=>789,395=>655,396=>556,397=>557,398=>667,399=>729,400=>604,401=>611,403=>791,404=>649,405=>806,406=>245,407=>322,408=>667,409=>500, - 410=>322,411=>500,412=>833,413=>722,414=>556,415=>778,416=>776,417=>556,418=>1019,419=>782,420=>735,421=>556,422=>722,423=>667,424=>500,425=>602, - 426=>366,427=>278,428=>571,429=>278,430=>611,431=>776,432=>620,433=>748,434=>667,435=>752,436=>615,437=>611,438=>500,439=>628,440=>628,441=>526, - 442=>480,443=>556,444=>556,445=>526,446=>556,447=>556,448=>278,449=>464,450=>474,451=>278,452=>1333,453=>1222,454=>1056,455=>1030,456=>778,457=>444, - 458=>1222,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722, - 474=>556,475=>722,476=>556,477=>556,478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556,488=>667,489=>500, - 490=>778,491=>556,492=>778,493=>556,494=>534,495=>534,496=>222,497=>1333,498=>1222,499=>1056,500=>778,501=>556,506=>667,507=>556,508=>1000,509=>889, - 510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667,519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556, - 526=>778,527=>556,528=>722,529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500, - 598=>556,599=>556,600=>556,601=>556,602=>777,603=>485,604=>485,605=>686,606=>519,607=>260,608=>556,609=>556,610=>557,611=>500,612=>500,613=>556, - 614=>556,615=>556,616=>242,617=>282,618=>356,619=>356,620=>425,621=>222,622=>635,623=>833,624=>833,625=>833,626=>556,627=>556,628=>558,629=>556, - 630=>715,631=>674,632=>558,633=>333,634=>333,635=>333,636=>333,637=>333,638=>312,639=>312,640=>530,641=>530,642=>500,643=>216,644=>276,645=>216, - 646=>222,647=>278,648=>278,649=>596,650=>558,651=>556,652=>500,653=>722,654=>500,655=>500,656=>500,657=>564,658=>530,659=>530,660=>464,661=>464, - 662=>464,663=>500,664=>614,665=>526,666=>519,667=>557,668=>558,669=>222,670=>500,671=>416,672=>556,673=>464,674=>464,675=>966,676=>966,677=>1030, - 678=>689,679=>484,680=>718,688=>326,689=>326,690=>153,691=>201,692=>201,693=>201,694=>304,695=>389,696=>278,697=>222,698=>372,699=>222,700=>222, - 701=>222,702=>222,703=>222,704=>250,705=>250,706=>320,707=>320,708=>320,709=>320,711=>333,712=>192,713=>333,714=>333,715=>333,716=>192,717=>333, - 718=>333,719=>333,720=>300,721=>300,722=>222,723=>222,724=>340,725=>340,726=>280,727=>362,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, - 736=>278,737=>153,738=>270,739=>274,740=>325,741=>360,742=>360,743=>360,744=>360,745=>360,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, - 774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0, - 790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0, - 806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, - 822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, - 864=>0,865=>0,884=>308,885=>308,890=>278,894=>278,900=>278,901=>278,902=>667,903=>278,904=>704,905=>759,906=>315,908=>778,910=>746,911=>758, - 912=>222,913=>667,914=>667,915=>550,916=>682,917=>667,918=>611,919=>722,920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>650,927=>778, - 928=>722,929=>667,931=>602,932=>611,933=>667,934=>808,935=>667,936=>804,937=>758,938=>278,939=>667,940=>576,941=>434,942=>556,943=>222,944=>551, - 945=>576,946=>563,947=>500,948=>557,949=>434,950=>440,951=>556,952=>556,953=>222,954=>498,955=>500,956=>553,957=>500,958=>432,959=>556,960=>678, - 961=>571,962=>472,963=>619,964=>382,965=>551,966=>649,967=>522,968=>729,969=>766,970=>222,971=>551,972=>556,973=>551,974=>766,976=>563,977=>616, - 978=>631,979=>726,980=>631,981=>644,982=>781,986=>722,988=>578,990=>570,992=>692,994=>880,995=>833,996=>684,997=>558,998=>680,999=>529,1000=>557, - 1001=>505,1002=>623,1003=>603,1004=>610,1005=>611,1006=>568,1007=>434,1008=>600,1009=>571,1010=>500,1011=>222,1025=>667,1026=>865,1028=>717,1029=>667,1030=>278, - 1031=>278,1032=>500,1033=>1105,1034=>1009,1035=>867,1038=>635,1040=>667,1041=>655,1042=>667,1043=>567,1044=>677,1045=>667,1046=>923,1047=>604,1048=>722,1049=>722, - 1050=>584,1051=>705,1052=>833,1053=>722,1054=>778,1055=>723,1056=>667,1057=>722,1058=>611,1059=>635,1060=>760,1061=>667,1062=>740,1063=>684,1064=>920,1065=>939, - 1066=>793,1067=>883,1068=>655,1069=>717,1070=>1006,1071=>722,1072=>556,1073=>573,1074=>531,1075=>383,1076=>583,1077=>556,1078=>669,1079=>458,1080=>559,1081=>559, - 1082=>437,1083=>571,1084=>683,1085=>552,1086=>556,1087=>542,1088=>556,1089=>500,1090=>458,1091=>500,1092=>823,1093=>500,1094=>562,1095=>533,1096=>802,1097=>823, - 1098=>620,1099=>717,1100=>523,1101=>510,1102=>744,1103=>542,1105=>556,1106=>556,1107=>383,1108=>510,1109=>500,1110=>222,1111=>278,1112=>222,1113=>873,1114=>811, - 1115=>556,1118=>500,1119=>542,1120=>976,1121=>766,1122=>656,1123=>521,1124=>950,1125=>694,1126=>667,1127=>597,1128=>952,1129=>817,1130=>654,1131=>600,1132=>932, - 1133=>817,1134=>604,1135=>458,1136=>804,1137=>729,1138=>778,1139=>556,1140=>667,1141=>500,1142=>667,1143=>500,1144=>1279,1145=>1060,1146=>778,1147=>556,1148=>976, - 1149=>766,1150=>976,1151=>766,1152=>722,1153=>514,1154=>686,1155=>334,1156=>382,1157=>334,1158=>334,1168=>435,1169=>339,1170=>567,1171=>383,1172=>656,1173=>556, - 1174=>923,1175=>669,1176=>604,1177=>458,1178=>584,1179=>437,1180=>584,1181=>437,1182=>584,1183=>437,1184=>764,1185=>537,1186=>741,1187=>573,1188=>900,1189=>670, - 1190=>736,1191=>560,1192=>778,1193=>560,1194=>722,1195=>500,1196=>611,1197=>458,1198=>667,1199=>500,1200=>667,1201=>500,1202=>667,1203=>500,1204=>916,1205=>661, - 1206=>684,1207=>533,1208=>684,1209=>533,1210=>684,1211=>556,1212=>829,1213=>667,1214=>829,1215=>667,1216=>278,1217=>923,1218=>669,1219=>584,1220=>437,1223=>735, - 1224=>570,1227=>684,1228=>533,1232=>667,1233=>556,1234=>667,1235=>556,1236=>1000,1237=>889,1238=>667,1239=>556,1240=>729,1241=>556,1242=>729,1243=>556,1244=>923, - 1245=>669,1246=>604,1247=>458,1248=>604,1249=>492,1250=>722,1251=>559,1252=>722,1253=>559,1254=>778,1255=>556,1256=>778,1257=>556,1258=>778,1259=>556,1262=>635, - 1263=>500,1264=>635,1265=>500,1266=>635,1267=>500,1268=>684,1269=>533,1272=>883,1273=>717,1329=>635,1330=>531,1331=>583,1332=>583,1333=>531,1334=>531,1335=>427, - 1336=>531,1337=>750,1338=>635,1339=>531,1340=>375,1341=>583,1342=>698,1343=>531,1344=>427,1345=>531,1346=>583,1347=>531,1348=>635,1349=>698,1350=>635,1351=>635, - 1352=>531,1353=>531,1354=>698,1355=>531,1356=>635,1357=>531,1358=>698,1359=>583,1360=>479,1361=>583,1362=>531,1363=>698,1364=>698,1365=>635,1366=>750,1369=>271, - 1370=>271,1371=>150,1372=>300,1373=>271,1374=>271,1375=>420,1377=>583,1378=>427,1379=>427,1380=>427,1381=>427,1382=>427,1383=>427,1384=>427,1385=>459,1386=>427, - 1387=>427,1388=>323,1389=>531,1390=>427,1391=>427,1392=>427,1393=>427,1394=>427,1395=>427,1396=>427,1397=>271,1398=>427,1399=>375,1400=>427,1401=>375,1402=>583, - 1403=>427,1404=>427,1405=>427,1406=>427,1407=>583,1408=>427,1409=>427,1410=>323,1411=>583,1412=>375,1413=>375,1414=>583,1415=>527,1417=>271,1425=>360,1426=>360, - 1427=>360,1428=>360,1429=>360,1430=>360,1431=>360,1432=>360,1433=>360,1434=>360,1435=>360,1436=>360,1437=>360,1438=>360,1439=>360,1440=>360,1441=>360,1443=>360, - 1444=>360,1445=>360,1446=>360,1447=>360,1448=>360,1449=>360,1450=>360,1451=>360,1452=>360,1453=>360,1454=>360,1455=>360,1456=>360,1457=>360,1458=>360,1459=>360, - 1460=>360,1461=>360,1462=>360,1463=>360,1464=>360,1465=>360,1467=>360,1468=>360,1469=>360,1470=>366,1471=>360,1472=>225,1473=>360,1474=>360,1475=>238,1476=>360, - 1488=>577,1489=>563,1490=>411,1491=>512,1492=>594,1493=>316,1494=>326,1495=>594,1496=>594,1497=>316,1498=>507,1499=>527,1500=>484,1501=>594,1502=>594,1503=>316, - 1504=>338,1505=>604,1506=>550,1507=>567,1508=>569,1509=>505,1510=>514,1511=>583,1512=>507,1513=>700,1514=>633,1520=>590,1521=>590,1522=>590,1523=>216,1524=>412, - 1548=>278,1563=>278,1567=>556,1569=>529,1570=>243,1571=>243,1572=>470,1573=>243,1574=>731,1575=>243,1576=>771,1577=>514,1578=>771,1579=>771,1580=>544,1581=>544, - 1582=>544,1583=>430,1584=>430,1585=>421,1586=>421,1587=>1194,1588=>1194,1589=>1291,1590=>1291,1591=>843,1592=>843,1593=>594,1594=>594,1600=>279,1601=>957,1602=>800, - 1603=>757,1604=>662,1605=>589,1606=>692,1607=>514,1608=>470,1609=>731,1610=>731,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0, - 1632=>480,1633=>480,1634=>480,1635=>480,1636=>480,1637=>480,1638=>480,1639=>480,1640=>480,1641=>480,1642=>547,1643=>278,1644=>278,1645=>438,1648=>0,1649=>243, - 1650=>243,1651=>243,1652=>0,1653=>380,1654=>470,1655=>548,1656=>772,1657=>771,1658=>771,1659=>771,1660=>771,1661=>771,1662=>771,1663=>771,1664=>771,1665=>544, - 1666=>544,1667=>544,1668=>544,1669=>544,1670=>544,1671=>544,1672=>430,1673=>430,1674=>430,1675=>430,1676=>430,1677=>430,1678=>430,1679=>430,1680=>430,1681=>421, - 1682=>421,1683=>421,1684=>421,1685=>421,1686=>419,1687=>421,1688=>421,1689=>421,1690=>1194,1691=>1194,1692=>1194,1693=>1291,1694=>1291,1695=>843,1696=>594,1697=>957, - 1698=>957,1699=>957,1700=>957,1701=>957,1702=>957,1703=>800,1704=>800,1705=>828,1706=>1058,1707=>828,1708=>757,1709=>757,1710=>757,1711=>828,1712=>828,1713=>828, - 1714=>828,1715=>828,1716=>828,1717=>662,1718=>662,1719=>662,1722=>692,1723=>692,1724=>692,1725=>692,1726=>706,1728=>514,1729=>509,1730=>509,1731=>509,1732=>470, - 1733=>470,1734=>470,1735=>470,1736=>470,1737=>470,1738=>470,1739=>470,1740=>731,1741=>841,1742=>731,1744=>731,1745=>731,1746=>550,1747=>550,1748=>279,1749=>514, - 1750=>726,1751=>558,1752=>321,1753=>318,1754=>342,1755=>373,1756=>716,1757=>688,1758=>852,1759=>288,1760=>288,1761=>388,1762=>350,1763=>716,1764=>146,1765=>282, - 1766=>339,1767=>339,1768=>415,1769=>514,1770=>220,1771=>220,1772=>220,1773=>350,1776=>480,1777=>480,1778=>480,1779=>480,1780=>480,1781=>480,1782=>480,1783=>480, - 1784=>480,1785=>480,2305=>0,2306=>0,2307=>294,2309=>693,2310=>910,2311=>533,2312=>533,2313=>590,2314=>713,2315=>920,2316=>677,2317=>611,2318=>611,2319=>611, - 2320=>611,2321=>910,2322=>910,2323=>910,2324=>910,2325=>667,2326=>732,2327=>593,2328=>639,2329=>624,2330=>688,2331=>713,2332=>688,2333=>712,2334=>697,2335=>502, - 2336=>533,2337=>583,2338=>523,2339=>693,2340=>585,2341=>638,2342=>533,2343=>640,2344=>585,2345=>585,2346=>565,2347=>699,2348=>592,2349=>689,2350=>633,2351=>600, - 2352=>486,2353=>486,2354=>680,2355=>730,2356=>730,2357=>592,2358=>684,2359=>608,2360=>646,2361=>546,2364=>0,2365=>373,2366=>319,2367=>319,2368=>319,2369=>0, - 2370=>0,2371=>0,2372=>0,2373=>0,2374=>0,2375=>0,2376=>0,2377=>319,2378=>319,2379=>319,2380=>319,2381=>0,2384=>884,2385=>0,2386=>0,2387=>0, - 2388=>0,2392=>667,2393=>732,2394=>593,2395=>688,2396=>583,2397=>523,2398=>699,2399=>600,2400=>920,2401=>677,2402=>0,2403=>0,2404=>331,2405=>513,2406=>639, - 2407=>639,2408=>639,2409=>639,2410=>639,2411=>639,2412=>639,2413=>639,2414=>639,2415=>639,2416=>362,2433=>0,2434=>430,2435=>430,2437=>786,2438=>1030,2439=>582, - 2440=>603,2441=>648,2442=>757,2443=>758,2444=>630,2447=>685,2448=>746,2451=>711,2452=>776,2453=>779,2454=>655,2455=>606,2456=>645,2457=>661,2458=>554,2459=>585, - 2460=>729,2461=>752,2462=>893,2463=>567,2464=>625,2465=>648,2466=>567,2467=>598,2468=>680,2469=>645,2470=>609,2471=>596,2472=>595,2474=>635,2475=>780,2476=>593, - 2477=>677,2478=>621,2479=>601,2480=>593,2482=>640,2486=>598,2487=>596,2488=>637,2489=>582,2492=>0,2494=>245,2495=>245,2496=>245,2497=>0,2498=>0,2499=>0, - 2500=>0,2503=>309,2504=>309,2507=>932,2508=>932,2509=>0,2519=>245,2524=>648,2525=>553,2527=>596,2528=>758,2529=>630,2530=>0,2531=>335,2534=>610,2535=>559, - 2536=>595,2537=>711,2538=>610,2539=>661,2540=>661,2541=>559,2542=>661,2543=>600,2544=>593,2545=>593,2546=>601,2547=>567,2548=>601,2549=>699,2550=>661,2551=>267, - 2552=>610,2553=>424,2554=>548,2562=>0,2565=>691,2566=>936,2567=>803,2568=>803,2569=>678,2570=>678,2575=>557,2576=>691,2579=>678,2580=>691,2581=>602,2582=>567, - 2583=>641,2584=>688,2585=>565,2586=>592,2587=>603,2588=>591,2589=>541,2590=>558,2591=>543,2592=>581,2593=>596,2594=>640,2595=>640,2596=>591,2597=>564,2598=>640, - 2599=>564,2600=>581,2602=>564,2603=>551,2604=>560,2605=>549,2606=>558,2607=>652,2608=>540,2610=>677,2611=>677,2613=>601,2614=>558,2616=>558,2617=>549,2620=>0, - 2622=>246,2623=>246,2624=>246,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>567,2650=>690,2651=>591,2652=>591,2654=>581,2662=>591, - 2663=>591,2664=>591,2665=>591,2666=>591,2667=>591,2668=>591,2669=>591,2670=>591,2671=>591,2672=>0,2673=>0,2674=>557,2675=>678,2676=>894,2689=>0,2690=>0, - 2691=>300,2693=>781,2694=>1044,2695=>589,2696=>589,2697=>560,2698=>758,2699=>806,2701=>781,2703=>781,2704=>781,2705=>1044,2707=>1044,2708=>1044,2709=>413,2710=>773, - 2711=>606,2712=>558,2713=>483,2714=>600,2715=>691,2716=>811,2717=>647,2718=>651,2719=>453,2720=>450,2721=>425,2722=>478,2723=>694,2724=>534,2725=>553,2726=>446, - 2727=>541,2728=>582,2730=>572,2731=>437,2732=>663,2733=>756,2734=>594,2735=>493,2736=>392,2738=>613,2739=>656,2741=>538,2742=>611,2743=>507,2744=>663,2745=>587, - 2748=>0,2749=>478,2750=>273,2751=>273,2752=>273,2753=>0,2754=>0,2755=>0,2756=>0,2757=>0,2759=>0,2760=>0,2761=>273,2763=>273,2764=>273,2765=>0, - 2768=>843,2784=>893,2790=>625,2791=>625,2792=>625,2793=>625,2794=>625,2795=>625,2796=>625,2797=>625,2798=>625,2799=>625,2817=>0,2818=>306,2819=>391,2821=>590, - 2822=>808,2823=>658,2824=>658,2825=>633,2826=>654,2827=>636,2828=>540,2831=>560,2832=>938,2835=>600,2836=>973,2837=>603,2838=>620,2839=>620,2840=>605,2841=>712, - 2842=>579,2843=>579,2844=>593,2845=>564,2846=>581,2847=>604,2848=>578,2849=>579,2850=>579,2851=>607,2852=>579,2853=>587,2854=>579,2855=>602,2856=>579,2858=>605, - 2859=>728,2860=>579,2861=>643,2862=>605,2863=>628,2864=>619,2866=>653,2867=>593,2870=>620,2871=>605,2872=>605,2873=>579,2876=>0,2877=>333,2878=>218,2879=>0, - 2880=>294,2881=>0,2882=>0,2883=>0,2887=>479,2888=>479,2891=>1026,2892=>1026,2893=>0,2902=>0,2903=>218,2908=>579,2909=>579,2911=>599,2912=>636,2913=>540, - 2918=>578,2919=>480,2920=>480,2921=>622,2922=>506,2923=>605,2924=>529,2925=>548,2926=>512,2927=>528,2928=>561,2946=>0,2947=>742,2949=>1002,2950=>1118,2951=>994, - 2952=>660,2953=>1012,2954=>1231,2958=>726,2959=>731,2960=>870,2962=>763,2963=>763,2964=>1636,2965=>667,2969=>830,2970=>584,2972=>876,2974=>986,2975=>802,2979=>1295, - 2980=>656,2984=>630,2985=>1012,2986=>694,2990=>727,2991=>790,2992=>545,2993=>718,2994=>821,2995=>871,2996=>724,2997=>873,2999=>1087,3000=>1098,3001=>1274,3006=>547, - 3007=>172,3008=>93,3009=>519,3010=>814,3014=>748,3015=>681,3016=>956,3018=>1666,3019=>1666,3020=>1994,3021=>0,3031=>871,3047=>667,3048=>1012,3049=>751,3050=>740, - 3051=>924,3052=>884,3053=>726,3054=>1002,3055=>825,3056=>717,3057=>719,3058=>774,3073=>365,3074=>601,3075=>346,3077=>720,3078=>786,3079=>567,3080=>1159,3081=>690, - 3082=>1047,3083=>1299,3084=>913,3086=>625,3087=>625,3088=>712,3090=>655,3091=>655,3092=>862,3093=>515,3094=>680,3095=>526,3096=>943,3097=>655,3098=>684,3099=>684, - 3100=>670,3101=>1205,3102=>732,3103=>888,3104=>597,3105=>709,3106=>709,3107=>809,3108=>715,3109=>702,3110=>702,3111=>702,3112=>607,3114=>623,3115=>623,3116=>681, - 3117=>681,3118=>932,3119=>1203,3120=>597,3121=>893,3122=>631,3123=>608,3125=>620,3126=>541,3127=>667,3128=>640,3129=>911,3134=>644,3135=>298,3136=>298,3137=>361, - 3138=>682,3139=>342,3140=>704,3142=>624,3143=>624,3144=>900,3146=>849,3147=>849,3148=>976,3149=>669,3157=>298,3158=>119,3168=>1620,3169=>1281,3174=>840,3175=>840, - 3176=>840,3177=>840,3178=>840,3179=>840,3180=>840,3181=>840,3182=>840,3183=>840,3202=>440,3203=>251,3205=>654,3206=>654,3207=>631,3208=>891,3209=>957,3210=>1293, - 3211=>1044,3212=>744,3214=>650,3215=>650,3216=>659,3218=>667,3219=>667,3220=>667,3221=>462,3222=>749,3223=>543,3224=>779,3225=>674,3226=>682,3227=>660,3228=>667, - 3229=>1171,3230=>926,3231=>671,3232=>557,3233=>669,3234=>669,3235=>728,3236=>544,3237=>672,3238=>672,3239=>672,3240=>560,3242=>668,3243=>668,3244=>681,3245=>687, - 3246=>972,3247=>1101,3248=>556,3249=>677,3250=>661,3251=>545,3253=>666,3254=>553,3255=>670,3256=>549,3257=>716,3262=>425,3263=>341,3264=>680,3265=>354,3266=>714, - 3267=>386,3268=>638,3270=>307,3271=>670,3272=>462,3274=>908,3275=>1251,3276=>434,3277=>336,3285=>344,3286=>404,3294=>673,3296=>1695,3297=>978,3302=>549,3303=>549, - 3304=>549,3305=>549,3306=>549,3307=>549,3308=>549,3309=>549,3310=>549,3311=>549,3330=>368,3331=>305,3333=>1201,3334=>1351,3335=>905,3336=>1459,3337=>635,3338=>1198, - 3339=>861,3340=>957,3342=>1211,3343=>1202,3344=>1839,3346=>642,3347=>1114,3348=>1195,3349=>861,3350=>982,3351=>874,3352=>1354,3353=>957,3354=>1016,3355=>1266,3356=>712, - 3357=>1454,3358=>1215,3359=>563,3360=>565,3361=>1192,3362=>1244,3363=>1268,3364=>878,3365=>966,3366=>545,3367=>879,3368=>879,3370=>1031,3371=>1175,3372=>1334,3373=>546, - 3374=>643,3375=>949,3376=>642,3377=>555,3378=>945,3379=>631,3380=>553,3381=>959,3382=>936,3383=>1122,3384=>1190,3385=>1112,3390=>475,3391=>418,3392=>442,3393=>340, - 3394=>340,3395=>473,3398=>640,3399=>530,3400=>1279,3402=>1368,3403=>1258,3404=>1447,3405=>0,3415=>553,3424=>861,3425=>1100,3430=>1095,3431=>929,3432=>854,3433=>1181, - 3434=>658,3435=>972,3436=>1210,3437=>650,3438=>959,3439=>896,3585=>595,3586=>648,3587=>665,3588=>608,3589=>608,3590=>665,3591=>471,3592=>556,3593=>652,3594=>664, - 3595=>681,3596=>816,3597=>849,3598=>620,3599=>620,3600=>541,3601=>785,3602=>826,3603=>887,3604=>598,3605=>605,3606=>595,3607=>650,3608=>541,3609=>652,3610=>608, - 3611=>608,3612=>630,3613=>630,3614=>695,3615=>695,3616=>620,3617=>581,3618=>588,3619=>501,3620=>595,3621=>569,3622=>620,3623=>519,3624=>592,3625=>659,3626=>574, - 3627=>654,3628=>695,3629=>566,3630=>574,3631=>517,3632=>452,3633=>0,3634=>496,3635=>496,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, - 3647=>687,3648=>302,3649=>571,3650=>478,3651=>515,3652=>515,3653=>496,3654=>506,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0, - 3663=>555,3664=>598,3665=>640,3666=>688,3667=>690,3668=>657,3669=>657,3670=>635,3671=>839,3672=>693,3673=>769,3674=>673,3675=>994,3713=>775,3714=>707,3716=>724, - 3719=>524,3720=>690,3722=>678,3725=>711,3732=>719,3733=>834,3734=>776,3735=>916,3737=>744,3738=>740,3739=>740,3740=>834,3741=>834,3742=>854,3743=>854,3745=>775, - 3746=>724,3747=>697,3749=>700,3751=>700,3754=>708,3755=>916,3757=>700,3758=>697,3759=>658,3760=>432,3761=>534,3762=>476,3763=>476,3764=>778,3765=>778,3766=>778, - 3767=>778,3768=>778,3769=>778,3771=>778,3772=>778,3773=>670,3776=>420,3777=>806,3778=>430,3779=>446,3780=>346,3782=>571,3784=>778,3785=>778,3786=>778,3787=>778, - 3788=>778,3789=>778,3792=>721,3793=>719,3794=>601,3795=>711,3796=>686,3797=>686,3798=>834,3799=>756,3800=>724,3801=>906,3804=>1272,3805=>1272,3840=>600,3841=>600, - 3842=>600,3843=>600,3844=>600,3845=>600,3846=>600,3847=>600,3848=>600,3849=>600,3850=>600,3851=>600,3852=>600,3853=>600,3854=>600,3855=>600,3856=>600,3857=>600, - 3858=>600,3859=>600,3860=>600,3861=>600,3862=>600,3863=>600,3864=>600,3865=>600,3866=>600,3867=>600,3868=>600,3869=>600,3870=>600,3871=>600,3872=>600,3873=>600, - 3874=>600,3875=>600,3876=>600,3877=>600,3878=>600,3879=>600,3880=>600,3881=>600,3882=>600,3883=>600,3884=>600,3885=>600,3886=>600,3887=>600,3888=>600,3889=>600, - 3890=>600,3891=>600,3892=>600,3893=>600,3894=>600,3895=>600,3896=>600,3897=>600,3898=>600,3899=>600,3900=>600,3901=>600,3902=>600,3903=>600,3904=>600,3905=>600, - 3906=>600,3907=>600,3908=>600,3909=>600,3910=>600,3911=>600,3913=>600,3914=>600,3915=>600,3916=>600,3917=>600,3918=>600,3919=>600,3920=>600,3921=>600,3922=>600, - 3923=>600,3924=>600,3925=>600,3926=>600,3927=>600,3928=>600,3929=>600,3930=>600,3931=>600,3932=>600,3933=>600,3934=>600,3935=>600,3936=>600,3937=>600,3938=>600, - 3939=>600,3940=>600,3941=>600,3942=>600,3943=>600,3944=>600,3945=>600,3953=>600,3954=>600,3955=>600,3956=>600,3957=>600,3958=>600,3959=>600,3960=>600,3961=>600, - 3962=>600,3963=>600,3964=>600,3965=>600,3966=>600,3967=>600,3968=>600,3969=>600,3970=>600,3971=>600,3972=>600,3973=>600,3974=>600,3975=>600,3976=>600,3977=>600, - 3978=>600,3979=>600,3984=>600,3985=>600,3986=>600,3987=>600,3988=>600,3989=>600,3991=>600,3993=>600,3994=>600,3995=>600,3996=>600,3997=>600,3998=>600,3999=>600, - 4000=>600,4001=>600,4002=>600,4003=>600,4004=>600,4005=>600,4006=>600,4007=>600,4008=>600,4009=>600,4010=>600,4011=>600,4012=>600,4013=>600,4017=>600,4018=>600, - 4019=>600,4020=>600,4021=>600,4022=>600,4023=>600,4025=>600,4256=>662,4257=>677,4258=>708,4259=>696,4260=>609,4261=>790,4262=>664,4263=>785,4264=>560,4265=>634, - 4266=>782,4267=>701,4268=>629,4269=>682,4270=>705,4271=>692,4272=>734,4273=>615,4274=>592,4275=>680,4276=>679,4277=>705,4278=>643,4279=>623,4280=>623,4281=>629, - 4282=>633,4283=>770,4284=>592,4285=>662,4286=>629,4287=>672,4288=>735,4289=>576,4290=>606,4291=>605,4292=>676,4293=>792,4304=>435,4305=>556,4306=>565,4307=>872, - 4308=>506,4309=>544,4310=>723,4311=>868,4312=>530,4313=>532,4314=>955,4315=>552,4316=>565,4317=>712,4318=>547,4319=>574,4320=>685,4321=>554,4322=>806,4323=>810, - 4324=>777,4325=>502,4326=>686,4327=>512,4328=>552,4329=>496,4330=>568,4331=>552,4332=>592,4333=>565,4334=>552,4335=>741,4336=>549,4337=>659,4338=>559,4339=>524, - 4340=>482,4341=>565,4342=>822,4347=>506,4352=>1000,4353=>1000,4354=>1000,4355=>1000,4356=>1000,4357=>1000,4358=>1000,4359=>1000,4360=>1000,4361=>1000,4362=>1000,4363=>1000, - 4364=>1000,4365=>1000,4366=>1000,4367=>1000,4368=>1000,4369=>1000,4370=>1000,4371=>1000,4372=>1000,4373=>1000,4374=>1000,4375=>1000,4376=>1000,4377=>1000,4378=>1000,4379=>1000, - 4380=>1000,4381=>1000,4382=>1000,4383=>1000,4384=>1000,4385=>1000,4386=>1000,4387=>1000,4388=>1000,4389=>1000,4390=>1000,4391=>1000,4392=>1000,4393=>1000,4394=>1000,4395=>1000, - 4396=>1000,4397=>1000,4398=>1000,4399=>1000,4400=>1000,4401=>1000,4402=>1000,4403=>1000,4404=>1000,4405=>1000,4406=>1000,4407=>1000,4408=>1000,4409=>1000,4410=>1000,4411=>1000, - 4412=>1000,4413=>1000,4414=>1000,4415=>1000,4416=>1000,4417=>1000,4418=>1000,4419=>1000,4420=>1000,4421=>1000,4422=>1000,4423=>1000,4424=>1000,4425=>1000,4426=>1000,4427=>1000, - 4428=>1000,4429=>1000,4430=>1000,4431=>1000,4432=>1000,4433=>1000,4434=>1000,4435=>1000,4436=>1000,4437=>1000,4438=>1000,4439=>1000,4440=>1000,4441=>1000,4447=>1000,4448=>1000, - 4449=>1000,4450=>1000,4451=>1000,4452=>1000,4453=>1000,4454=>1000,4455=>1000,4456=>1000,4457=>1000,4458=>1000,4459=>1000,4460=>1000,4461=>1000,4462=>1000,4463=>1000,4464=>1000, - 4465=>1000,4466=>1000,4467=>1000,4468=>1000,4469=>1000,4470=>1000,4471=>1000,4472=>1000,4473=>1000,4474=>1000,4475=>1000,4476=>1000,4477=>1000,4478=>1000,4479=>1000,4480=>1000, - 4481=>1000,4482=>1000,4483=>1000,4484=>1000,4485=>1000,4486=>1000,4487=>1000,4488=>1000,4489=>1000,4490=>1000,4491=>1000,4492=>1000,4493=>1000,4494=>1000,4495=>1000,4496=>1000, - 4497=>1000,4498=>1000,4499=>1000,4500=>1000,4501=>1000,4502=>1000,4503=>1000,4504=>1000,4505=>1000,4506=>1000,4507=>1000,4508=>1000,4509=>1000,4510=>1000,4511=>1000,4512=>1000, - 4513=>1000,4514=>1000,4520=>1000,4521=>1000,4522=>1000,4523=>1000,4524=>1000,4525=>1000,4526=>1000,4527=>1000,4528=>1000,4529=>1000,4530=>1000,4531=>1000,4532=>1000,4533=>1000, - 4534=>1000,4535=>1000,4536=>1000,4537=>1000,4538=>1000,4539=>1000,4540=>1000,4541=>1000,4542=>1000,4543=>1000,4544=>1000,4545=>1000,4546=>1000,4547=>1000,4548=>1000,4549=>1000, - 4550=>1000,4551=>1000,4552=>1000,4553=>1000,4554=>1000,4555=>1000,4556=>1000,4557=>1000,4558=>1000,4559=>1000,4560=>1000,4561=>1000,4562=>1000,4563=>1000,4564=>1000,4565=>1000, - 4566=>1000,4567=>1000,4568=>1000,4569=>1000,4570=>1000,4571=>1000,4572=>1000,4573=>1000,4574=>1000,4575=>1000,4576=>1000,4577=>1000,4578=>1000,4579=>1000,4580=>1000,4581=>1000, - 4582=>1000,4583=>1000,4584=>1000,4585=>1000,4586=>1000,4587=>1000,4588=>1000,4589=>1000,4590=>1000,4591=>1000,4592=>1000,4593=>1000,4594=>1000,4595=>1000,4596=>1000,4597=>1000, - 4598=>1000,4599=>1000,4600=>1000,4601=>1000,7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722,7691=>556, - 7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556, - 7708=>667,7709=>556,7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722,7721=>556,7722=>722,7723=>556, - 7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, - 7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556, - 7756=>778,7757=>556,7758=>778,7759=>556,7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722,7771=>333, - 7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278, - 7788=>611,7789=>278,7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556, - 7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, - 7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556,7831=>278,7832=>722,7833=>500,7834=>556,7835=>278, - 7840=>667,7841=>556,7842=>667,7843=>556,7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667,7855=>556, - 7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556, - 7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778,7885=>556,7886=>778,7887=>556, - 7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778,7895=>556,7896=>778,7897=>556,7898=>776,7899=>556,7900=>776,7901=>556,7902=>776,7903=>556, - 7904=>776,7905=>556,7906=>776,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>620,7914=>776,7915=>620,7916=>776,7917=>620,7918=>776,7919=>620, - 7920=>776,7921=>620,7922=>667,7923=>500,7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>576,7937=>576,7938=>576,7939=>576,7940=>576,7941=>576, - 7942=>576,7943=>576,7944=>667,7945=>667,7946=>680,7947=>680,7948=>680,7949=>680,7950=>718,7951=>718,7952=>434,7953=>434,7954=>434,7955=>434,7956=>434,7957=>434, - 7960=>692,7961=>692,7962=>823,7963=>823,7964=>823,7965=>823,7968=>556,7969=>556,7970=>556,7971=>556,7972=>556,7973=>556,7974=>556,7975=>556,7976=>747,7977=>747, - 7978=>878,7979=>878,7980=>878,7981=>878,7982=>923,7983=>923,7984=>222,7985=>222,7986=>222,7987=>222,7988=>222,7989=>222,7990=>222,7991=>222,7992=>303,7993=>303, - 7994=>434,7995=>434,7996=>434,7997=>434,7998=>479,7999=>479,8000=>556,8001=>556,8002=>556,8003=>556,8004=>556,8005=>556,8008=>778,8009=>778,8010=>894,8011=>894, - 8012=>894,8013=>894,8016=>551,8017=>551,8018=>551,8019=>551,8020=>551,8021=>551,8022=>551,8023=>551,8025=>777,8027=>893,8029=>885,8031=>940,8032=>766,8033=>766, - 8034=>766,8035=>766,8036=>766,8037=>766,8038=>766,8039=>766,8040=>758,8041=>758,8042=>874,8043=>874,8044=>868,8045=>867,8046=>911,8047=>911,8048=>576,8049=>576, - 8050=>434,8051=>434,8052=>556,8053=>556,8054=>222,8055=>222,8056=>556,8057=>556,8058=>551,8059=>551,8060=>766,8061=>766,8064=>576,8065=>576,8066=>576,8067=>576, - 8068=>576,8069=>576,8070=>576,8071=>576,8072=>667,8073=>667,8074=>680,8075=>680,8076=>680,8077=>680,8078=>718,8079=>718,8080=>556,8081=>556,8082=>556,8083=>556, - 8084=>556,8085=>556,8086=>556,8087=>556,8088=>747,8089=>747,8090=>878,8091=>878,8092=>878,8093=>878,8094=>923,8095=>923,8096=>766,8097=>766,8098=>766,8099=>766, - 8100=>766,8101=>766,8102=>766,8103=>766,8104=>758,8105=>758,8106=>874,8107=>874,8108=>868,8109=>867,8110=>911,8111=>911,8112=>576,8113=>576,8114=>576,8115=>576, - 8116=>576,8118=>576,8119=>576,8120=>667,8121=>667,8122=>667,8123=>667,8124=>667,8125=>278,8126=>278,8127=>278,8128=>278,8129=>278,8130=>556,8131=>556,8132=>556, - 8134=>556,8135=>556,8136=>693,8137=>704,8138=>748,8139=>759,8140=>722,8141=>278,8142=>278,8143=>278,8144=>222,8145=>222,8146=>222,8147=>222,8150=>222,8151=>222, - 8152=>278,8153=>278,8154=>304,8155=>304,8157=>278,8158=>278,8159=>278,8160=>551,8161=>551,8162=>551,8163=>551,8164=>571,8165=>571,8166=>551,8167=>551,8168=>667, - 8169=>667,8170=>742,8171=>746,8172=>693,8173=>278,8174=>278,8175=>278,8178=>766,8179=>766,8180=>766,8182=>766,8183=>766,8184=>778,8185=>778,8186=>758,8187=>758, - 8188=>758,8189=>278,8190=>278,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>100,8202=>50,8203=>0,8204=>0, - 8205=>0,8208=>333,8209=>333,8210=>556,8213=>564,8214=>428,8215=>500,8219=>222,8223=>333,8227=>350,8228=>278,8229=>556,8231=>278,8232=>0,8233=>0,8241=>1330, - 8242=>222,8243=>372,8244=>522,8245=>206,8246=>356,8247=>506,8248=>312,8251=>1000,8252=>471,8253=>556,8254=>500,8255=>945,8256=>945,8257=>312,8258=>820,8259=>333, - 8260=>167,8261=>278,8262=>278,8304=>333,8308=>333,8309=>333,8310=>333,8311=>333,8312=>333,8313=>333,8314=>333,8315=>333,8316=>333,8317=>210,8318=>210,8319=>333, - 8320=>333,8321=>333,8322=>333,8323=>333,8324=>333,8325=>333,8326=>333,8327=>333,8328=>333,8329=>333,8330=>333,8331=>333,8332=>333,8333=>210,8334=>210,8352=>556, - 8353=>556,8354=>556,8355=>556,8356=>556,8357=>833,8358=>556,8359=>556,8360=>1024,8361=>940,8362=>784,8363=>556,8400=>600,8401=>600,8402=>600,8403=>600,8404=>700, - 8405=>700,8406=>600,8407=>600,8408=>600,8409=>600,8410=>600,8411=>600,8412=>600,8413=>900,8414=>900,8415=>900,8416=>900,8417=>700,8448=>889,8449=>889,8450=>667, - 8451=>1022,8452=>611,8453=>889,8454=>889,8455=>501,8456=>667,8457=>921,8458=>510,8459=>906,8460=>988,8461=>722,8462=>500,8463=>500,8464=>688,8465=>553,8466=>708, - 8467=>291,8468=>778,8469=>722,8470=>1073,8471=>737,8472=>740,8473=>556,8474=>722,8475=>927,8476=>795,8477=>667,8478=>667,8479=>667,8480=>1000,8481=>1174,8483=>722, - 8484=>611,8485=>542,8486=>768,8487=>768,8488=>698,8489=>321,8490=>667,8491=>667,8492=>927,8493=>646,8494=>556,8495=>385,8496=>615,8497=>688,8498=>611,8499=>1115, - 8500=>406,8501=>688,8502=>688,8503=>344,8504=>688,8531=>834,8532=>834,8533=>834,8534=>834,8535=>834,8536=>834,8537=>834,8538=>834,8539=>834,8540=>834,8541=>834, - 8542=>834,8543=>834,8544=>278,8545=>555,8546=>832,8547=>933,8548=>667,8549=>934,8550=>1031,8551=>1268,8552=>944,8553=>667,8554=>944,8555=>1035,8556=>556,8557=>722, - 8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>700,8564=>500,8565=>700,8566=>922,8567=>1144,8568=>712,8569=>500,8570=>712,8571=>934,8572=>222,8573=>500, - 8574=>556,8575=>833,8576=>983,8577=>722,8578=>983,8592=>713,8593=>713,8594=>713,8595=>713,8596=>713,8597=>713,8598=>713,8599=>713,8600=>713,8601=>713,8602=>713, - 8603=>713,8604=>713,8605=>713,8606=>713,8607=>713,8608=>713,8609=>713,8610=>713,8611=>713,8612=>713,8613=>713,8614=>713,8615=>713,8616=>713,8617=>713,8618=>713, - 8619=>713,8620=>713,8621=>813,8622=>813,8623=>713,8624=>713,8625=>713,8626=>713,8627=>713,8628=>713,8629=>713,8630=>713,8631=>713,8632=>713,8633=>713,8634=>800, - 8635=>800,8636=>713,8637=>713,8638=>713,8639=>713,8640=>713,8641=>713,8642=>713,8643=>713,8644=>713,8645=>713,8646=>713,8647=>713,8648=>713,8649=>713,8650=>713, - 8651=>713,8652=>713,8653=>713,8654=>950,8655=>713,8656=>713,8657=>713,8658=>713,8659=>713,8660=>863,8661=>713,8662=>713,8663=>713,8664=>713,8665=>713,8666=>713, - 8667=>713,8668=>813,8669=>813,8670=>713,8671=>713,8672=>713,8673=>713,8674=>713,8675=>713,8676=>713,8677=>713,8678=>713,8679=>713,8680=>713,8681=>713,8682=>713, - 8704=>600,8705=>600,8706=>494,8707=>600,8708=>600,8709=>800,8710=>612,8711=>612,8712=>549,8713=>549,8714=>549,8715=>549,8716=>549,8717=>549,8718=>549,8719=>823, - 8720=>823,8721=>713,8722=>584,8723=>584,8724=>584,8725=>167,8726=>278,8727=>389,8728=>400,8729=>400,8730=>600,8731=>600,8732=>600,8733=>549,8734=>549,8735=>584, - 8736=>584,8737=>584,8738=>584,8739=>260,8740=>444,8741=>418,8742=>602,8743=>561,8744=>561,8745=>561,8746=>561,8747=>506,8748=>806,8749=>1106,8750=>506,8751=>806, - 8752=>1106,8753=>506,8754=>506,8755=>506,8756=>561,8757=>561,8758=>422,8759=>561,8760=>584,8761=>584,8762=>584,8763=>584,8764=>584,8765=>584,8766=>584,8767=>584, - 8768=>422,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584,8775=>584,8776=>584,8777=>584,8778=>584,8779=>584,8780=>584,8781=>584,8782=>584,8783=>584, - 8784=>584,8785=>584,8786=>584,8787=>584,8788=>737,8789=>737,8790=>584,8791=>584,8792=>584,8793=>584,8794=>584,8795=>584,8796=>584,8797=>584,8798=>584,8799=>584, - 8800=>584,8801=>584,8802=>584,8803=>584,8804=>584,8805=>584,8806=>584,8807=>584,8808=>584,8809=>584,8810=>969,8811=>969,8812=>584,8813=>584,8814=>584,8815=>584, - 8816=>584,8817=>584,8818=>584,8819=>584,8820=>584,8821=>584,8822=>584,8823=>584,8824=>584,8825=>584,8826=>584,8827=>584,8828=>584,8829=>584,8830=>584,8831=>584, - 8832=>584,8833=>584,8834=>678,8835=>678,8836=>678,8837=>678,8838=>678,8839=>678,8840=>678,8841=>678,8842=>678,8843=>678,8844=>561,8845=>561,8846=>561,8847=>678, - 8848=>678,8849=>673,8850=>673,8851=>561,8852=>561,8853=>800,8854=>800,8855=>800,8856=>800,8857=>800,8858=>800,8859=>800,8860=>800,8861=>800,8862=>800,8863=>800, - 8864=>800,8865=>800,8866=>549,8867=>549,8868=>549,8869=>549,8870=>399,8871=>399,8872=>549,8873=>549,8874=>549,8875=>672,8876=>549,8877=>549,8878=>549,8879=>672, - 8880=>549,8881=>549,8882=>549,8883=>549,8884=>549,8885=>549,8886=>713,8887=>713,8888=>713,8889=>549,8890=>549,8891=>584,8892=>584,8893=>584,8894=>584,8895=>584, - 8896=>561,8897=>561,8898=>561,8899=>561,8900=>549,8901=>250,8902=>549,8903=>649,8904=>630,8905=>630,8906=>630,8907=>630,8908=>630,8909=>584,8910=>561,8911=>561, - 8912=>668,8913=>668,8914=>668,8915=>668,8916=>561,8917=>602,8918=>584,8919=>584,8920=>1354,8921=>1354,8922=>584,8923=>584,8924=>584,8925=>584,8926=>584,8927=>584, - 8928=>584,8929=>584,8930=>673,8931=>673,8932=>673,8933=>673,8934=>584,8935=>584,8936=>584,8937=>584,8938=>584,8939=>584,8940=>584,8941=>584,8942=>278,8943=>1000, - 8944=>1000,8945=>1000,8960=>549,8962=>549,8963=>549,8964=>549,8965=>549,8966=>549,8967=>549,8968=>449,8969=>449,8970=>449,8971=>449,8972=>549,8973=>549,8974=>549, - 8975=>549,8976=>549,8977=>549,8978=>800,8979=>800,8980=>549,8981=>549,8982=>549,8983=>650,8984=>780,8985=>549,8986=>549,8987=>549,8988=>549,8989=>549,8990=>549, - 8991=>549,8992=>506,8993=>506,8994=>713,8995=>713,8996=>1000,8997=>1000,8998=>1000,8999=>1000,9000=>1000,9001=>329,9002=>329,9003=>1000,9004=>549,9005=>549,9006=>549, - 9007=>549,9008=>549,9009=>549,9010=>549,9011=>549,9012=>549,9013=>549,9014=>600,9015=>600,9016=>600,9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600, - 9023=>600,9024=>600,9025=>600,9026=>600,9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600,9037=>600,9038=>600, - 9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600,9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600, - 9055=>600,9056=>600,9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600,9067=>600,9068=>600,9069=>600,9070=>600, - 9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600,9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9109=>600,9216=>600,9217=>600,9218=>600, - 9219=>600,9220=>600,9221=>600,9222=>600,9223=>600,9224=>600,9225=>600,9226=>600,9227=>600,9228=>600,9229=>600,9230=>600,9231=>600,9232=>600,9233=>600,9234=>600, - 9235=>600,9236=>600,9237=>600,9238=>600,9239=>600,9240=>600,9241=>600,9242=>600,9243=>600,9244=>600,9245=>600,9246=>600,9247=>600,9248=>600,9249=>600,9250=>600, - 9251=>600,9252=>600,9280=>604,9281=>604,9282=>604,9283=>604,9284=>604,9285=>604,9286=>750,9287=>750,9288=>750,9289=>750,9290=>604,9312=>1000,9313=>1000,9314=>1000, - 9315=>1000,9316=>1000,9317=>1000,9318=>1000,9319=>1000,9320=>1000,9321=>1000,9322=>1000,9323=>1000,9324=>1000,9325=>1000,9326=>1000,9327=>1000,9328=>1000,9329=>1000,9330=>1000, - 9331=>1000,9332=>1000,9333=>1000,9334=>1000,9335=>1000,9336=>1000,9337=>1000,9338=>1000,9339=>1000,9340=>1000,9341=>1000,9342=>1000,9343=>1000,9344=>1000,9345=>1000,9346=>1000, - 9347=>1000,9348=>1000,9349=>1000,9350=>1000,9351=>1000,9352=>1000,9353=>1000,9354=>1000,9355=>1000,9356=>1000,9357=>1000,9358=>1000,9359=>1000,9360=>1000,9361=>1000,9362=>1000, - 9363=>1000,9364=>1000,9365=>1000,9366=>1000,9367=>1000,9368=>1000,9369=>1000,9370=>1000,9371=>1000,9372=>1000,9373=>1000,9374=>1000,9375=>1000,9376=>1000,9377=>1000,9378=>1000, - 9379=>1000,9380=>1000,9381=>1000,9382=>1000,9383=>1000,9384=>1000,9385=>1000,9386=>1000,9387=>1000,9388=>1000,9389=>1000,9390=>1000,9391=>1000,9392=>1000,9393=>1000,9394=>1000, - 9395=>1000,9396=>1000,9397=>1000,9398=>1000,9399=>1000,9400=>1000,9401=>1000,9402=>1000,9403=>1000,9404=>1000,9405=>1000,9406=>1000,9407=>1000,9408=>1000,9409=>1000,9410=>1000, - 9411=>1000,9412=>1000,9413=>1000,9414=>1000,9415=>1000,9416=>1000,9417=>1000,9418=>1000,9419=>1000,9420=>1000,9421=>1000,9422=>1000,9423=>1000,9424=>1000,9425=>1000,9426=>1000, - 9427=>1000,9428=>1000,9429=>1000,9430=>1000,9431=>1000,9432=>1000,9433=>1000,9434=>1000,9435=>1000,9436=>1000,9437=>1000,9438=>1000,9439=>1000,9440=>1000,9441=>1000,9442=>1000, - 9443=>1000,9444=>1000,9445=>1000,9446=>1000,9447=>1000,9448=>1000,9449=>1000,9450=>1000,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600, - 9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600, - 9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600, - 9512=>600,9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600,9527=>600, - 9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600, - 9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600, - 9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600, - 9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600, - 9592=>600,9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600,9607=>600, - 9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600, - 9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600, - 9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600, - 9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600,9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600, - 9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600,9693=>600,9694=>600,9695=>600,9696=>600,9697=>600, - 9698=>600,9699=>600,9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9728=>750,9729=>1000, - 9730=>750,9731=>750,9732=>1000,9733=>816,9734=>823,9735=>500,9736=>500,9737=>800,9738=>800,9739=>800,9740=>800,9741=>800,9742=>719,9743=>719,9744=>734,9745=>734, - 9746=>734,9747=>762,9754=>960,9755=>960,9756=>939,9757=>939,9758=>939,9759=>939,9760=>750,9761=>600,9762=>750,9763=>750,9764=>580,9765=>460,9766=>444,9767=>650, - 9768=>444,9769=>768,9770=>800,9771=>850,9772=>675,9773=>800,9774=>750,9775=>750,9776=>900,9777=>900,9778=>900,9779=>900,9780=>900,9781=>900,9782=>900,9783=>900, - 9784=>750,9785=>750,9786=>750,9787=>750,9788=>750,9789=>750,9790=>750,9791=>740,9792=>740,9793=>740,9794=>740,9795=>653,9796=>490,9797=>632,9798=>780,9799=>560, - 9800=>838,9801=>780,9802=>734,9803=>887,9804=>780,9805=>1080,9806=>896,9807=>1080,9808=>804,9809=>868,9810=>922,9811=>696,9812=>1000,9813=>1000,9814=>1000,9815=>1000, - 9816=>1000,9817=>1000,9818=>1000,9819=>1000,9820=>1000,9821=>1000,9822=>1000,9823=>1000,9824=>722,9825=>734,9826=>674,9827=>804,9828=>722,9829=>734,9830=>674,9831=>804, - 9832=>860,9833=>423,9834=>592,9835=>750,9836=>750,9837=>439,9838=>439,9839=>439,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791,9993=>690, - 9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846,10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759, - 10012=>754,10013=>494,10014=>552,10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823,10026=>789,10027=>841,10028=>823, - 10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749,10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708, - 10045=>682,10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786,10056=>787,10057=>713,10058=>791,10059=>785,10061=>873, - 10063=>762,10064=>762,10065=>759,10066=>759,10070=>784,10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544,10084=>910, - 10085=>667,10086=>760,10087=>760,10102=>788,10103=>788,10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788,10114=>788, - 10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788,10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788, - 10131=>788,10132=>894,10136=>748,10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924,10147=>924,10148=>917,10149=>930, - 10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867,10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771, - 10167=>888,10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,12288=>1000,12289=>1000,12290=>1000,12291=>1000,12292=>1000,12293=>1000,12294=>1000,12295=>1000, - 12296=>1000,12297=>1000,12298=>1000,12299=>1000,12300=>1000,12301=>1000,12302=>1000,12303=>1000,12304=>1000,12305=>1000,12306=>1000,12307=>1000,12308=>1000,12309=>1000,12310=>1000,12311=>1000, - 12312=>1000,12313=>1000,12314=>1000,12315=>1000,12316=>1000,12317=>1000,12318=>1000,12319=>1000,12320=>1000,12321=>1000,12322=>1000,12323=>1000,12324=>1000,12325=>1000,12326=>1000,12327=>1000, - 12328=>1000,12329=>1000,12330=>1000,12331=>1000,12332=>1000,12333=>1000,12334=>1000,12335=>1000,12336=>1000,12337=>1000,12338=>1000,12339=>1000,12340=>1000,12341=>1000,12342=>1000,12343=>1000, - 12351=>1000,12353=>1000,12354=>1000,12355=>1000,12356=>1000,12357=>1000,12358=>1000,12359=>1000,12360=>1000,12361=>1000,12362=>1000,12363=>1000,12364=>1000,12365=>1000,12366=>1000,12367=>1000, - 12368=>1000,12369=>1000,12370=>1000,12371=>1000,12372=>1000,12373=>1000,12374=>1000,12375=>1000,12376=>1000,12377=>1000,12378=>1000,12379=>1000,12380=>1000,12381=>1000,12382=>1000,12383=>1000, - 12384=>1000,12385=>1000,12386=>1000,12387=>1000,12388=>1000,12389=>1000,12390=>1000,12391=>1000,12392=>1000,12393=>1000,12394=>1000,12395=>1000,12396=>1000,12397=>1000,12398=>1000,12399=>1000, - 12400=>1000,12401=>1000,12402=>1000,12403=>1000,12404=>1000,12405=>1000,12406=>1000,12407=>1000,12408=>1000,12409=>1000,12410=>1000,12411=>1000,12412=>1000,12413=>1000,12414=>1000,12415=>1000, - 12416=>1000,12417=>1000,12418=>1000,12419=>1000,12420=>1000,12421=>1000,12422=>1000,12423=>1000,12424=>1000,12425=>1000,12426=>1000,12427=>1000,12428=>1000,12429=>1000,12430=>1000,12431=>1000, - 12432=>1000,12433=>1000,12434=>1000,12435=>1000,12436=>1000,12441=>1000,12442=>1000,12443=>1000,12444=>1000,12445=>1000,12446=>1000,12449=>1000,12450=>1000,12451=>1000,12452=>1000,12453=>1000, - 12454=>1000,12455=>1000,12456=>1000,12457=>1000,12458=>1000,12459=>1000,12460=>1000,12461=>1000,12462=>1000,12463=>1000,12464=>1000,12465=>1000,12466=>1000,12467=>1000,12468=>1000,12469=>1000, - 12470=>1000,12471=>1000,12472=>1000,12473=>1000,12474=>1000,12475=>1000,12476=>1000,12477=>1000,12478=>1000,12479=>1000,12480=>1000,12481=>1000,12482=>1000,12483=>1000,12484=>1000,12485=>1000, - 12486=>1000,12487=>1000,12488=>1000,12489=>1000,12490=>1000,12491=>1000,12492=>1000,12493=>1000,12494=>1000,12495=>1000,12496=>1000,12497=>1000,12498=>1000,12499=>1000,12500=>1000,12501=>1000, - 12502=>1000,12503=>1000,12504=>1000,12505=>1000,12506=>1000,12507=>1000,12508=>1000,12509=>1000,12510=>1000,12511=>1000,12512=>1000,12513=>1000,12514=>1000,12515=>1000,12516=>1000,12517=>1000, - 12518=>1000,12519=>1000,12520=>1000,12521=>1000,12522=>1000,12523=>1000,12524=>1000,12525=>1000,12526=>1000,12527=>1000,12528=>1000,12529=>1000,12530=>1000,12531=>1000,12532=>1000,12533=>1000, - 12534=>1000,12535=>1000,12536=>1000,12537=>1000,12538=>1000,12539=>1000,12540=>1000,12541=>1000,12542=>1000,12549=>1000,12550=>1000,12551=>1000,12552=>1000,12553=>1000,12554=>1000,12555=>1000, - 12556=>1000,12557=>1000,12558=>1000,12559=>1000,12560=>1000,12561=>1000,12562=>1000,12563=>1000,12564=>1000,12565=>1000,12566=>1000,12567=>1000,12568=>1000,12569=>1000,12570=>1000,12571=>1000, - 12572=>1000,12573=>1000,12574=>1000,12575=>1000,12576=>1000,12577=>1000,12578=>1000,12579=>1000,12580=>1000,12581=>1000,12582=>1000,12583=>1000,12584=>1000,12585=>1000,12586=>1000,12587=>1000, - 12588=>1000,12593=>1000,12594=>1000,12595=>1000,12596=>1000,12597=>1000,12598=>1000,12599=>1000,12600=>1000,12601=>1000,12602=>1000,12603=>1000,12604=>1000,12605=>1000,12606=>1000,12607=>1000, - 12608=>1000,12609=>1000,12610=>1000,12611=>1000,12612=>1000,12613=>1000,12614=>1000,12615=>1000,12616=>1000,12617=>1000,12618=>1000,12619=>1000,12620=>1000,12621=>1000,12622=>1000,12623=>1000, - 12624=>1000,12625=>1000,12626=>1000,12627=>1000,12628=>1000,12629=>1000,12630=>1000,12631=>1000,12632=>1000,12633=>1000,12634=>1000,12635=>1000,12636=>1000,12637=>1000,12638=>1000,12639=>1000, - 12640=>1000,12641=>1000,12642=>1000,12643=>1000,12644=>1000,12645=>1000,12646=>1000,12647=>1000,12648=>1000,12649=>1000,12650=>1000,12651=>1000,12652=>1000,12653=>1000,12654=>1000,12655=>1000, - 12656=>1000,12657=>1000,12658=>1000,12659=>1000,12660=>1000,12661=>1000,12662=>1000,12663=>1000,12664=>1000,12665=>1000,12666=>1000,12667=>1000,12668=>1000,12669=>1000,12670=>1000,12671=>1000, - 12672=>1000,12673=>1000,12674=>1000,12675=>1000,12676=>1000,12677=>1000,12678=>1000,12679=>1000,12680=>1000,12681=>1000,12682=>1000,12683=>1000,12684=>1000,12685=>1000,12686=>1000,12688=>1000, - 12689=>1000,12690=>1000,12691=>1000,12692=>1000,12693=>1000,12694=>1000,12695=>1000,12696=>1000,12697=>1000,12698=>1000,12699=>1000,12700=>1000,12701=>1000,12702=>1000,12703=>1000,12800=>1000, - 12801=>1000,12802=>1000,12803=>1000,12804=>1000,12805=>1000,12806=>1000,12807=>1000,12808=>1000,12809=>1000,12810=>1000,12811=>1000,12812=>1000,12813=>1000,12814=>1000,12815=>1000,12816=>1000, - 12817=>1000,12818=>1000,12819=>1000,12820=>1000,12821=>1000,12822=>1000,12823=>1000,12824=>1000,12825=>1000,12826=>1000,12827=>1000,12828=>1000,12832=>1000,12833=>1000,12834=>1000,12835=>1000, - 12836=>1000,12837=>1000,12838=>1000,12839=>1000,12840=>1000,12841=>1000,12842=>1000,12843=>1000,12844=>1000,12845=>1000,12846=>1000,12847=>1000,12848=>1000,12849=>1000,12850=>1000,12851=>1000, - 12852=>1000,12853=>1000,12854=>1000,12855=>1000,12856=>1000,12857=>1000,12858=>1000,12859=>1000,12860=>1000,12861=>1000,12862=>1000,12863=>1000,12864=>1000,12865=>1000,12866=>1000,12867=>1000, - 12896=>1000,12897=>1000,12898=>1000,12899=>1000,12900=>1000,12901=>1000,12902=>1000,12903=>1000,12904=>1000,12905=>1000,12906=>1000,12907=>1000,12908=>1000,12909=>1000,12910=>1000,12911=>1000, - 12912=>1000,12913=>1000,12914=>1000,12915=>1000,12916=>1000,12917=>1000,12918=>1000,12919=>1000,12920=>1000,12921=>1000,12922=>1000,12923=>1000,12927=>1000,12928=>1000,12929=>1000,12930=>1000, - 12931=>1000,12932=>1000,12933=>1000,12934=>1000,12935=>1000,12936=>1000,12937=>1000,12938=>1000,12939=>1000,12940=>1000,12941=>1000,12942=>1000,12943=>1000,12944=>1000,12945=>1000,12946=>1000, - 12947=>1000,12948=>1000,12949=>1000,12950=>1000,12951=>1000,12952=>1000,12953=>1000,12954=>1000,12955=>1000,12956=>1000,12957=>1000,12958=>1000,12959=>1000,12960=>1000,12961=>1000,12962=>1000, - 12963=>1000,12964=>1000,12965=>1000,12966=>1000,12967=>1000,12968=>1000,12969=>1000,12970=>1000,12971=>1000,12972=>1000,12973=>1000,12974=>1000,12975=>1000,12976=>1000,12992=>1000,12993=>1000, - 12994=>1000,12995=>1000,12996=>1000,12997=>1000,12998=>1000,12999=>1000,13000=>1000,13001=>1000,13002=>1000,13003=>1000,13008=>1000,13009=>1000,13010=>1000,13011=>1000,13012=>1000,13013=>1000, - 13014=>1000,13015=>1000,13016=>1000,13017=>1000,13018=>1000,13019=>1000,13020=>1000,13021=>1000,13022=>1000,13023=>1000,13024=>1000,13025=>1000,13026=>1000,13027=>1000,13028=>1000,13029=>1000, - 13030=>1000,13031=>1000,13032=>1000,13033=>1000,13034=>1000,13035=>1000,13036=>1000,13037=>1000,13038=>1000,13039=>1000,13040=>1000,13041=>1000,13042=>1000,13043=>1000,13044=>1000,13045=>1000, - 13046=>1000,13047=>1000,13048=>1000,13049=>1000,13050=>1000,13051=>1000,13052=>1000,13053=>1000,13054=>1000,13056=>1000,13057=>1000,13058=>1000,13059=>1000,13060=>1000,13061=>1000,13062=>1000, - 13063=>1000,13064=>1000,13065=>1000,13066=>1000,13067=>1000,13068=>1000,13069=>1000,13070=>1000,13071=>1000,13072=>1000,13073=>1000,13074=>1000,13075=>1000,13076=>1000,13077=>1000,13078=>1000, - 13079=>1000,13080=>1000,13081=>1000,13082=>1000,13083=>1000,13084=>1000,13085=>1000,13086=>1000,13087=>1000,13088=>1000,13089=>1000,13090=>1000,13091=>1000,13092=>1000,13093=>1000,13094=>1000, - 13095=>1000,13096=>1000,13097=>1000,13098=>1000,13099=>1000,13100=>1000,13101=>1000,13102=>1000,13103=>1000,13104=>1000,13105=>1000,13106=>1000,13107=>1000,13108=>1000,13109=>1000,13110=>1000, - 13111=>1000,13112=>1000,13113=>1000,13114=>1000,13115=>1000,13116=>1000,13117=>1000,13118=>1000,13119=>1000,13120=>1000,13121=>1000,13122=>1000,13123=>1000,13124=>1000,13125=>1000,13126=>1000, - 13127=>1000,13128=>1000,13129=>1000,13130=>1000,13131=>1000,13132=>1000,13133=>1000,13134=>1000,13135=>1000,13136=>1000,13137=>1000,13138=>1000,13139=>1000,13140=>1000,13141=>1000,13142=>1000, - 13143=>1000,13144=>1000,13145=>1000,13146=>1000,13147=>1000,13148=>1000,13149=>1000,13150=>1000,13151=>1000,13152=>1000,13153=>1000,13154=>1000,13155=>1000,13156=>1000,13157=>1000,13158=>1000, - 13159=>1000,13160=>1000,13161=>1000,13162=>1000,13163=>1000,13164=>1000,13165=>1000,13166=>1000,13167=>1000,13168=>1000,13169=>1000,13170=>1000,13171=>1000,13172=>1000,13173=>1000,13174=>1000, - 13179=>1000,13180=>1000,13181=>1000,13182=>1000,13183=>1000,13184=>1000,13185=>1000,13186=>1000,13187=>1000,13188=>1000,13189=>1000,13190=>1000,13191=>1000,13192=>1000,13193=>1000,13194=>1000, - 13195=>1000,13196=>1000,13197=>1000,13198=>1000,13199=>1000,13200=>1000,13201=>1000,13202=>1000,13203=>1000,13204=>1000,13205=>1000,13206=>1000,13207=>1000,13208=>1000,13209=>1000,13210=>1000, - 13211=>1000,13212=>1000,13213=>1000,13214=>1000,13215=>1000,13216=>1000,13217=>1000,13218=>1000,13219=>1000,13220=>1000,13221=>1000,13222=>1000,13223=>1000,13224=>1000,13225=>1000,13226=>1000, - 13227=>1000,13228=>1000,13229=>1000,13230=>1000,13231=>1000,13232=>1000,13233=>1000,13234=>1000,13235=>1000,13236=>1000,13237=>1000,13238=>1000,13239=>1000,13240=>1000,13241=>1000,13242=>1000, - 13243=>1000,13244=>1000,13245=>1000,13246=>1000,13247=>1000,13248=>1000,13249=>1000,13250=>1000,13251=>1000,13252=>1000,13253=>1000,13254=>1000,13255=>1000,13256=>1000,13257=>1000,13258=>1000, - 13259=>1000,13260=>1000,13261=>1000,13262=>1000,13263=>1000,13264=>1000,13265=>1000,13266=>1000,13267=>1000,13268=>1000,13269=>1000,13270=>1000,13271=>1000,13272=>1000,13273=>1000,13274=>1000, - 13275=>1000,13276=>1000,13277=>1000,13280=>1000,13281=>1000,13282=>1000,13283=>1000,13284=>1000,13285=>1000,13286=>1000,13287=>1000,13288=>1000,13289=>1000,13290=>1000,13291=>1000,13292=>1000, - 13293=>1000,13294=>1000,13295=>1000,13296=>1000,13297=>1000,13298=>1000,13299=>1000,13300=>1000,13301=>1000,13302=>1000,13303=>1000,13304=>1000,13305=>1000,13306=>1000,13307=>1000,13308=>1000, - 13309=>1000,13310=>1000,59393=>316,59394=>507,59395=>507,59396=>484,59397=>484,59416=>0,59492=>480,59495=>480,59536=>458,59557=>466,59558=>480,59559=>903,61441=>500,61442=>500, - 63232=>541,63233=>0,63234=>0,63235=>0,63236=>0,63237=>0,63238=>0,63239=>0,63240=>0,63241=>0,63242=>0,63243=>0,63244=>0,63245=>0,63246=>0,63247=>849, - 63248=>0,63249=>0,63250=>0,63251=>0,63252=>0,63253=>0,63254=>0,63255=>0,63256=>0,63257=>0,63258=>0,63260=>333,63261=>287,63744=>1000,63745=>1000,63746=>1000, - 63747=>1000,63748=>1000,63749=>1000,63750=>1000,63751=>1000,63752=>1000,63753=>1000,63754=>1000,63755=>1000,63756=>1000,63757=>1000,63758=>1000,63759=>1000,63760=>1000,63761=>1000,63762=>1000, - 63763=>1000,63764=>1000,63765=>1000,63766=>1000,63767=>1000,63768=>1000,63769=>1000,63770=>1000,63771=>1000,63772=>1000,63773=>1000,63774=>1000,63775=>1000,63776=>1000,63777=>1000,63778=>1000, - 63779=>1000,63780=>1000,63781=>1000,63782=>1000,63783=>1000,63784=>1000,63785=>1000,63786=>1000,63787=>1000,63788=>1000,63789=>1000,63790=>1000,63791=>1000,63792=>1000,63793=>1000,63794=>1000, - 63795=>1000,63796=>1000,63797=>1000,63798=>1000,63799=>1000,63800=>1000,63801=>1000,63802=>1000,63803=>1000,63804=>1000,63805=>1000,63806=>1000,63807=>1000,63808=>1000,63809=>1000,63810=>1000, - 63811=>1000,63812=>1000,63813=>1000,63814=>1000,63815=>1000,63816=>1000,63817=>1000,63818=>1000,63819=>1000,63820=>1000,63821=>1000,63822=>1000,63823=>1000,63824=>1000,63825=>1000,63826=>1000, - 63827=>1000,63828=>1000,63829=>1000,63830=>1000,63831=>1000,63832=>1000,63833=>1000,63834=>1000,63835=>1000,63836=>1000,63837=>1000,63838=>1000,63839=>1000,63840=>1000,63841=>1000,63842=>1000, - 63843=>1000,63844=>1000,63845=>1000,63846=>1000,63847=>1000,63848=>1000,63849=>1000,63850=>1000,63851=>1000,63852=>1000,63853=>1000,63854=>1000,63855=>1000,63856=>1000,63857=>1000,63858=>1000, - 63859=>1000,63860=>1000,63861=>1000,63862=>1000,63863=>1000,63864=>1000,63865=>1000,63866=>1000,63867=>1000,63868=>1000,63869=>1000,63870=>1000,63871=>1000,63872=>1000,63873=>1000,63874=>1000, - 63875=>1000,63876=>1000,63877=>1000,63878=>1000,63879=>1000,63880=>1000,63881=>1000,63882=>1000,63883=>1000,63884=>1000,63885=>1000,63886=>1000,63887=>1000,63888=>1000,63889=>1000,63890=>1000, - 63891=>1000,63892=>1000,63893=>1000,63894=>1000,63895=>1000,63896=>1000,63897=>1000,63898=>1000,63899=>1000,63900=>1000,63901=>1000,63902=>1000,63903=>1000,63904=>1000,63905=>1000,63906=>1000, - 63907=>1000,63908=>1000,63909=>1000,63910=>1000,63911=>1000,63912=>1000,63913=>1000,63914=>1000,63915=>1000,63916=>1000,63917=>1000,63918=>1000,63919=>1000,63920=>1000,63921=>1000,63922=>1000, - 63923=>1000,63924=>1000,63925=>1000,63926=>1000,63927=>1000,63928=>1000,63929=>1000,63930=>1000,63931=>1000,63932=>1000,63933=>1000,63934=>1000,63935=>1000,63936=>1000,63937=>1000,63938=>1000, - 63939=>1000,63940=>1000,63941=>1000,63942=>1000,63943=>1000,63944=>1000,63945=>1000,63946=>1000,63947=>1000,63948=>1000,63949=>1000,63950=>1000,63951=>1000,63952=>1000,63953=>1000,63954=>1000, - 63955=>1000,63956=>1000,63957=>1000,63958=>1000,63959=>1000,63960=>1000,63961=>1000,63962=>1000,63963=>1000,63964=>1000,63965=>1000,63966=>1000,63967=>1000,63968=>1000,63969=>1000,63970=>1000, - 63971=>1000,63972=>1000,63973=>1000,63974=>1000,63975=>1000,63976=>1000,63977=>1000,63978=>1000,63979=>1000,63980=>1000,63981=>1000,63982=>1000,63983=>1000,63984=>1000,63985=>1000,63986=>1000, - 63987=>1000,63988=>1000,63989=>1000,63990=>1000,63991=>1000,63992=>1000,63993=>1000,63994=>1000,63995=>1000,63996=>1000,63997=>1000,63998=>1000,63999=>1000,64000=>1000,64001=>1000,64002=>1000, - 64003=>1000,64004=>1000,64005=>1000,64006=>1000,64007=>1000,64008=>1000,64009=>1000,64010=>1000,64011=>1000,64012=>1000,64013=>1000,64014=>1000,64015=>1000,64016=>1000,64017=>1000,64018=>1000, - 64019=>1000,64020=>1000,64021=>1000,64022=>1000,64023=>1000,64024=>1000,64025=>1000,64026=>1000,64027=>1000,64028=>1000,64029=>1000,64030=>1000,64031=>1000,64032=>1000,64033=>1000,64034=>1000, - 64035=>1000,64036=>1000,64037=>1000,64038=>1000,64039=>1000,64040=>1000,64041=>1000,64042=>1000,64043=>1000,64044=>1000,64045=>1000,64256=>537,64257=>500,64258=>500,64259=>778,64260=>750, - 64261=>532,64262=>758,64275=>784,64276=>784,64277=>784,64278=>784,64279=>893,64286=>333,64287=>590,64288=>550,64289=>709,64290=>649,64291=>730,64292=>656,64293=>605,64294=>730, - 64295=>633,64296=>794,64297=>584,64298=>700,64299=>700,64300=>700,64301=>700,64302=>577,64303=>577,64304=>577,64305=>563,64306=>411,64307=>512,64308=>594,64309=>316,64310=>326, - 64312=>594,64313=>316,64314=>507,64315=>527,64316=>484,64318=>594,64320=>338,64321=>604,64323=>567,64324=>569,64326=>514,64327=>583,64328=>507,64329=>700,64330=>633,64331=>316, - 64332=>563,64333=>527,64334=>569,64335=>577,64336=>243,64337=>273,64338=>771,64339=>788,64340=>276,64341=>243,64342=>771,64343=>788,64344=>276,64345=>243,64346=>771,64347=>788, - 64348=>276,64349=>243,64350=>771,64351=>788,64352=>276,64353=>243,64354=>771,64355=>788,64356=>276,64357=>243,64358=>771,64359=>788,64360=>276,64361=>243,64362=>957,64363=>903, - 64364=>466,64365=>480,64366=>957,64367=>903,64368=>466,64369=>480,64370=>544,64371=>658,64372=>646,64373=>637,64374=>544,64375=>658,64376=>646,64377=>637,64378=>544,64379=>658, - 64380=>646,64381=>637,64382=>544,64383=>658,64384=>646,64385=>637,64386=>430,64387=>458,64388=>430,64389=>458,64390=>430,64391=>458,64392=>430,64393=>458,64394=>421,64395=>436, - 64396=>421,64397=>436,64398=>828,64399=>942,64400=>432,64401=>549,64402=>828,64403=>942,64404=>432,64405=>549,64406=>828,64407=>942,64408=>432,64409=>549,64410=>828,64411=>942, - 64412=>432,64413=>549,64414=>692,64415=>723,64416=>692,64417=>723,64418=>276,64419=>243,64420=>514,64421=>477,64422=>514,64423=>509,64424=>273,64425=>427,64426=>706,64427=>706, - 64428=>686,64429=>686,64430=>550,64431=>461,64432=>550,64433=>461,64467=>757,64468=>733,64469=>432,64470=>549,64471=>470,64472=>466,64473=>470,64474=>466,64475=>470,64476=>466, - 64477=>470,64478=>470,64479=>466,64480=>470,64481=>466,64482=>470,64483=>466,64484=>781,64485=>933,64486=>276,64487=>243,64488=>276,64489=>243,64490=>547,64491=>517,64492=>783, - 64493=>753,64494=>740,64495=>710,64496=>740,64497=>710,64498=>740,64499=>710,64500=>740,64501=>710,64502=>1207,64503=>1177,64504=>517,64505=>1067,64506=>1037,64507=>517,64508=>731, - 64509=>793,64510=>276,64511=>243,64512=>932,64513=>932,64514=>914,64515=>1067,64516=>1077,64517=>935,64518=>935,64519=>935,64520=>917,64521=>1070,64522=>1080,64523=>932,64524=>932, - 64525=>932,64526=>914,64527=>1067,64528=>1077,64529=>932,64530=>914,64531=>1067,64532=>1077,64533=>1305,64534=>1287,64535=>1305,64536=>1287,64537=>1305,64538=>1305,64539=>1287,64540=>1429, - 64541=>1429,64542=>1429,64543=>1411,64544=>1476,64545=>1458,64546=>1476,64547=>1476,64548=>1476,64549=>1458,64550=>1392,64551=>1374,64552=>1374,64553=>1245,64554=>1227,64555=>1245,64556=>1227, - 64557=>1125,64558=>1125,64559=>1125,64560=>1107,64561=>1260,64562=>1270,64563=>1125,64564=>1107,64565=>1260,64566=>1270,64567=>706,64568=>1091,64569=>1091,64570=>1091,64571=>1106,64572=>1073, - 64573=>1226,64574=>1236,64575=>932,64576=>932,64577=>932,64578=>914,64579=>1067,64580=>1077,64581=>1140,64582=>1140,64583=>1140,64584=>1122,64585=>1275,64586=>1285,64587=>932,64588=>932, - 64589=>932,64590=>914,64591=>1067,64592=>1077,64593=>1345,64594=>1327,64595=>1480,64596=>1490,64597=>932,64598=>932,64599=>932,64600=>914,64601=>1067,64602=>1077,64603=>430,64604=>421, - 64605=>731,64606=>296,64607=>300,64608=>300,64609=>300,64610=>300,64611=>300,64612=>680,64613=>680,64614=>884,64615=>967,64616=>1037,64617=>1047,64618=>680,64619=>680,64620=>884, - 64621=>967,64622=>1037,64623=>1047,64624=>680,64625=>680,64626=>884,64627=>967,64628=>1037,64629=>1047,64630=>680,64631=>680,64632=>884,64633=>967,64634=>1037,64635=>1047,64636=>1274, - 64637=>1284,64638=>1274,64639=>1284,64640=>821,64641=>1221,64642=>1188,64643=>1341,64644=>1351,64645=>884,64646=>1037,64647=>1047,64648=>806,64649=>1173,64650=>680,64651=>680,64652=>884, - 64653=>967,64654=>1037,64655=>1047,64656=>793,64657=>680,64658=>680,64659=>884,64660=>967,64661=>1037,64662=>1047,64663=>911,64664=>911,64665=>911,64666=>806,64667=>679,64668=>911, - 64669=>911,64670=>911,64671=>806,64672=>679,64673=>911,64674=>911,64675=>911,64676=>806,64677=>679,64678=>806,64679=>1284,64680=>1179,64681=>1284,64682=>1179,64683=>1284,64684=>1179, - 64685=>1408,64686=>1408,64687=>1408,64688=>1303,64689=>1455,64690=>1455,64691=>1350,64692=>1455,64693=>1455,64694=>1455,64695=>1350,64696=>1371,64697=>1266,64698=>1224,64699=>1119,64700=>1224, - 64701=>1119,64702=>1104,64703=>1104,64704=>1104,64705=>999,64706=>1104,64707=>999,64708=>1070,64709=>1070,64710=>1070,64711=>676,64712=>965,64713=>911,64714=>911,64715=>911,64716=>806, - 64717=>679,64718=>1119,64719=>1119,64720=>1119,64721=>1014,64722=>911,64723=>911,64724=>911,64725=>806,64726=>679,64727=>1324,64728=>1219,64729=>686,64730=>911,64731=>911,64732=>911, - 64733=>806,64734=>679,64735=>776,64736=>649,64737=>776,64738=>649,64739=>776,64740=>649,64741=>776,64742=>649,64743=>1303,64744=>1176,64745=>1303,64746=>1176,64747=>793,64748=>1082, - 64749=>776,64750=>776,64751=>649,64752=>776,64753=>649,64754=>306,64755=>302,64756=>298,64757=>1527,64758=>1537,64759=>1380,64760=>1390,64761=>1380,64762=>1390,64763=>1564,64764=>1574, - 64765=>1564,64766=>1574,64767=>1440,64768=>1450,64769=>1440,64770=>1450,64771=>1440,64772=>1450,64773=>1611,64774=>1621,64775=>1611,64776=>1621,64777=>1429,64778=>1429,64779=>1429,64780=>1411, - 64781=>1207,64782=>1207,64783=>1254,64784=>1254,64785=>1527,64786=>1537,64787=>1348,64788=>1358,64789=>1348,64790=>1358,64791=>1564,64792=>1574,64793=>1564,64794=>1574,64795=>1431,64796=>1441, - 64797=>1431,64798=>1441,64799=>1431,64800=>1441,64801=>1611,64802=>1621,64803=>1611,64804=>1621,64805=>1429,64806=>1429,64807=>1429,64808=>1411,64809=>1207,64810=>1207,64811=>1254,64812=>1254, - 64813=>1408,64814=>1408,64815=>1408,64816=>1303,64817=>1176,64818=>1176,64819=>1266,64820=>1408,64821=>1408,64822=>1408,64823=>1408,64824=>1408,64825=>1408,64826=>1266,64827=>1266,64828=>273, - 64829=>243,64830=>600,64831=>600,64848=>1444,64849=>1541,64850=>1549,64851=>1444,64852=>1444,64853=>1444,64854=>1444,64855=>1444,64856=>1830,64857=>1817,64858=>1975,64859=>1964,64860=>2046, - 64861=>2046,64862=>2202,64863=>1962,64864=>1941,64865=>1941,64866=>1944,64867=>1836,64868=>2114,64869=>2093,64870=>1991,64871=>2049,64872=>1941,64873=>2212,64874=>1962,64875=>1941,64876=>1944, - 64877=>1836,64878=>2249,64879=>2096,64880=>1988,64881=>1925,64882=>1904,64883=>1799,64884=>2070,64885=>1833,64886=>1729,64887=>1652,64888=>1881,64889=>1729,64890=>1892,64891=>1881,64892=>1759, - 64893=>1637,64894=>1670,64895=>1654,64896=>1522,64897=>1686,64898=>1675,64899=>1549,64900=>1541,64901=>1522,64902=>1444,64903=>1436,64904=>1444,64905=>1757,64906=>1652,64907=>1975,64908=>1757, - 64909=>1652,64910=>1757,64911=>1652,64914=>1757,64915=>1857,64916=>1752,64917=>1444,64918=>1675,64919=>1522,64920=>1444,64921=>1675,64922=>1581,64923=>1570,64924=>1417,64925=>1362,64926=>1686, - 64927=>1686,64928=>1675,64929=>1686,64930=>1675,64931=>1581,64932=>1570,64933=>1975,64934=>2069,64935=>1964,64936=>2202,64937=>2259,64938=>2212,64939=>2259,64940=>1686,64941=>1581,64942=>1686, - 64943=>1686,64944=>1581,64945=>1870,64946=>1817,64947=>1686,64948=>1637,64949=>1444,64950=>1892,64951=>1886,64952=>1549,64953=>1975,64954=>1444,64955=>1723,64956=>1522,64957=>1541,64958=>2080, - 64959=>2080,64960=>1975,64961=>1817,64962=>1686,64963=>1499,64964=>1757,64965=>1883,64966=>2212,64967=>1686,65008=>1523,65009=>1172,65010=>1159,65011=>1356,65012=>2111,65013=>2258,65014=>2130, - 65015=>1552,65016=>2046,65017=>1856,65018=>1930,65019=>1070,65056=>450,65057=>450,65058=>450,65059=>450,65072=>1000,65073=>1000,65074=>1000,65075=>1000,65076=>1000,65077=>1000,65078=>1000, - 65079=>1000,65080=>1000,65081=>1000,65082=>1000,65083=>1000,65084=>1000,65085=>1000,65086=>1000,65087=>1000,65088=>1000,65089=>1000,65090=>1000,65091=>1000,65092=>1000,65097=>1000,65098=>1000, - 65099=>1000,65100=>1000,65101=>1000,65102=>1000,65103=>1000,65104=>167,65105=>250,65106=>167,65108=>167,65109=>167,65110=>334,65111=>167,65112=>600,65113=>200,65114=>200,65115=>200, - 65116=>200,65117=>200,65118=>200,65119=>334,65120=>400,65121=>233,65122=>350,65123=>200,65124=>350,65125=>350,65126=>350,65128=>167,65129=>334,65130=>533,65131=>609,65136=>300, - 65137=>298,65138=>296,65140=>298,65142=>300,65143=>298,65144=>300,65145=>302,65146=>298,65147=>296,65148=>306,65149=>306,65150=>154,65151=>154,65152=>529,65153=>243,65154=>273, - 65155=>243,65156=>273,65157=>470,65158=>466,65159=>243,65160=>273,65161=>731,65162=>793,65163=>276,65164=>243,65165=>243,65166=>273,65167=>771,65168=>788,65169=>276,65170=>243, - 65171=>514,65172=>477,65173=>771,65174=>788,65175=>276,65176=>243,65177=>771,65178=>788,65179=>276,65180=>243,65181=>544,65182=>658,65183=>646,65184=>637,65185=>544,65186=>658, - 65187=>646,65188=>637,65189=>544,65190=>658,65191=>646,65192=>637,65193=>430,65194=>458,65195=>430,65196=>458,65197=>421,65198=>436,65199=>421,65200=>436,65201=>1194,65202=>1194, - 65203=>770,65204=>770,65205=>1194,65206=>1194,65207=>770,65208=>770,65209=>1291,65210=>1291,65211=>817,65212=>817,65213=>1291,65214=>1291,65215=>817,65216=>817,65217=>843,65218=>843, - 65219=>733,65220=>733,65221=>843,65222=>843,65223=>733,65224=>733,65225=>594,65226=>556,65227=>586,65228=>554,65229=>594,65230=>556,65231=>586,65232=>554,65233=>957,65234=>903, - 65235=>466,65236=>480,65237=>800,65238=>823,65239=>466,65240=>480,65241=>757,65242=>733,65243=>432,65244=>549,65245=>662,65246=>673,65247=>273,65248=>243,65249=>589,65250=>640, - 65251=>481,65252=>532,65253=>692,65254=>723,65255=>276,65256=>243,65257=>514,65258=>477,65259=>686,65260=>405,65261=>470,65262=>466,65263=>731,65264=>793,65265=>731,65266=>803, - 65267=>276,65268=>243,65269=>551,65270=>603,65271=>551,65272=>603,65273=>551,65274=>603,65275=>551,65276=>603,65281=>1000,65282=>1000,65283=>1000,65284=>1000,65285=>1000,65286=>1000, - 65287=>1000,65288=>1000,65289=>1000,65290=>1000,65291=>1000,65292=>1000,65293=>1000,65294=>1000,65295=>1000,65296=>1000,65297=>1000,65298=>1000,65299=>1000,65300=>1000,65301=>1000,65302=>1000, - 65303=>1000,65304=>1000,65305=>1000,65306=>1000,65307=>1000,65308=>1000,65309=>1000,65310=>1000,65311=>1000,65312=>1000,65313=>1000,65314=>1000,65315=>1000,65316=>1000,65317=>1000,65318=>1000, - 65319=>1000,65320=>1000,65321=>1000,65322=>1000,65323=>1000,65324=>1000,65325=>1000,65326=>1000,65327=>1000,65328=>1000,65329=>1000,65330=>1000,65331=>1000,65332=>1000,65333=>1000,65334=>1000, - 65335=>1000,65336=>1000,65337=>1000,65338=>1000,65339=>1000,65340=>1000,65341=>1000,65342=>1000,65343=>1000,65344=>1000,65345=>1000,65346=>1000,65347=>1000,65348=>1000,65349=>1000,65350=>1000, - 65351=>1000,65352=>1000,65353=>1000,65354=>1000,65355=>1000,65356=>1000,65357=>1000,65358=>1000,65359=>1000,65360=>1000,65361=>1000,65362=>1000,65363=>1000,65364=>1000,65365=>1000,65366=>1000, - 65367=>1000,65368=>1000,65369=>1000,65370=>1000,65371=>1000,65372=>1000,65373=>1000,65374=>1000,65377=>500,65378=>500,65379=>500,65380=>500,65381=>500,65382=>500,65383=>500,65384=>500, - 65385=>500,65386=>500,65387=>500,65388=>500,65389=>500,65390=>500,65391=>500,65392=>500,65393=>500,65394=>500,65395=>500,65396=>500,65397=>500,65398=>500,65399=>500,65400=>500, - 65401=>500,65402=>500,65403=>500,65404=>500,65405=>500,65406=>500,65407=>500,65408=>500,65409=>500,65410=>500,65411=>500,65412=>500,65413=>500,65414=>500,65415=>500,65416=>500, - 65417=>500,65418=>500,65419=>500,65420=>500,65421=>500,65422=>500,65423=>500,65424=>500,65425=>500,65426=>500,65427=>500,65428=>500,65429=>500,65430=>500,65431=>500,65432=>500, - 65433=>500,65434=>500,65435=>500,65436=>500,65437=>500,65438=>500,65439=>500,65440=>500,65441=>500,65442=>500,65443=>500,65444=>500,65445=>500,65446=>500,65447=>500,65448=>500, - 65449=>500,65450=>500,65451=>500,65452=>500,65453=>500,65454=>500,65455=>500,65456=>500,65457=>500,65458=>500,65459=>500,65460=>500,65461=>500,65462=>500,65463=>500,65464=>500, - 65465=>500,65466=>500,65467=>500,65468=>500,65469=>500,65470=>500,65474=>500,65475=>500,65476=>500,65477=>500,65478=>500,65479=>500,65482=>500,65483=>500,65484=>500,65485=>500, - 65486=>500,65487=>500,65490=>500,65491=>500,65492=>500,65493=>500,65494=>500,65495=>500,65498=>500,65499=>500,65500=>500,65504=>1000,65505=>1000,65506=>1000,65507=>1000,65508=>1000, - 65509=>1000,65510=>1000,65512=>500,65513=>500,65514=>500,65515=>500,65516=>500,65517=>500,65518=>500,65532=>1000,65533=>1000,19968=>1000,19969=>1000,19970=>1000,19971=>1000,19972=>1000, - 19973=>1000,19974=>1000,19975=>1000,19976=>1000,19977=>1000,19978=>1000,19979=>1000,19980=>1000,19981=>1000,19982=>1000,19983=>1000,19984=>1000,19985=>1000,19986=>1000,19987=>1000,19988=>1000, - 19989=>1000,19990=>1000,19991=>1000,19992=>1000,19993=>1000,19994=>1000,19995=>1000,19996=>1000,19997=>1000,19998=>1000,19999=>1000,20000=>1000,20001=>1000,20002=>1000,20003=>1000,20004=>1000, - 20005=>1000,20006=>1000,20007=>1000,20008=>1000,20009=>1000,20010=>1000,20011=>1000,20012=>1000,20013=>1000,20014=>1000,20015=>1000,20016=>1000,20017=>1000,20018=>1000,20019=>1000,20020=>1000, - 20021=>1000,20022=>1000,20023=>1000,20024=>1000,20025=>1000,20026=>1000,20027=>1000,20028=>1000,20029=>1000,20030=>1000,20031=>1000,20032=>1000,20033=>1000,20034=>1000,20035=>1000,20036=>1000, - 20037=>1000,20038=>1000,20039=>1000,20040=>1000,20041=>1000,20042=>1000,20043=>1000,20044=>1000,20045=>1000,20046=>1000,20047=>1000,20048=>1000,20049=>1000,20050=>1000,20051=>1000,20052=>1000, - 20053=>1000,20054=>1000,20055=>1000,20056=>1000,20057=>1000,20058=>1000,20059=>1000,20060=>1000,20061=>1000,20062=>1000,20063=>1000,20064=>1000,20065=>1000,20066=>1000,20067=>1000,20068=>1000, - 20069=>1000,20070=>1000,20071=>1000,20072=>1000,20073=>1000,20074=>1000,20075=>1000,20076=>1000,20077=>1000,20078=>1000,20079=>1000,20080=>1000,20081=>1000,20082=>1000,20083=>1000,20084=>1000, - 20085=>1000,20086=>1000,20087=>1000,20088=>1000,20089=>1000,20090=>1000,20091=>1000,20092=>1000,20093=>1000,20094=>1000,20095=>1000,20096=>1000,20097=>1000,20098=>1000,20099=>1000,20100=>1000, - 20101=>1000,20102=>1000,20103=>1000,20104=>1000,20105=>1000,20106=>1000,20107=>1000,20108=>1000,20109=>1000,20110=>1000,20111=>1000,20112=>1000,20113=>1000,20114=>1000,20115=>1000,20116=>1000, - 20117=>1000,20118=>1000,20119=>1000,20120=>1000,20121=>1000,20122=>1000,20123=>1000,20124=>1000,20125=>1000,20126=>1000,20127=>1000,20128=>1000,20129=>1000,20130=>1000,20131=>1000,20132=>1000, - 20133=>1000,20134=>1000,20135=>1000,20136=>1000,20137=>1000,20138=>1000,20139=>1000,20140=>1000,20141=>1000,20142=>1000,20143=>1000,20144=>1000,20145=>1000,20146=>1000,20147=>1000,20148=>1000, - 20149=>1000,20150=>1000,20151=>1000,20152=>1000,20153=>1000,20154=>1000,20155=>1000,20156=>1000,20157=>1000,20158=>1000,20159=>1000,20160=>1000,20161=>1000,20162=>1000,20163=>1000,20164=>1000, - 20165=>1000,20166=>1000,20167=>1000,20168=>1000,20169=>1000,20170=>1000,20171=>1000,20172=>1000,20173=>1000,20174=>1000,20175=>1000,20176=>1000,20177=>1000,20178=>1000,20179=>1000,20180=>1000, - 20181=>1000,20182=>1000,20183=>1000,20184=>1000,20185=>1000,20186=>1000,20187=>1000,20188=>1000,20189=>1000,20190=>1000,20191=>1000,20192=>1000,20193=>1000,20194=>1000,20195=>1000,20196=>1000, - 20197=>1000,20198=>1000,20199=>1000,20200=>1000,20201=>1000,20202=>1000,20203=>1000,20204=>1000,20205=>1000,20206=>1000,20207=>1000,20208=>1000,20209=>1000,20210=>1000,20211=>1000,20212=>1000, - 20213=>1000,20214=>1000,20215=>1000,20216=>1000,20217=>1000,20218=>1000,20219=>1000,20220=>1000,20221=>1000,20222=>1000,20223=>1000,20224=>1000,20225=>1000,20226=>1000,20227=>1000,20228=>1000, - 20229=>1000,20230=>1000,20231=>1000,20232=>1000,20233=>1000,20234=>1000,20235=>1000,20236=>1000,20237=>1000,20238=>1000,20239=>1000,20240=>1000,20241=>1000,20242=>1000,20243=>1000,20244=>1000, - 20245=>1000,20246=>1000,20247=>1000,20248=>1000,20249=>1000,20250=>1000,20251=>1000,20252=>1000,20253=>1000,20254=>1000,20255=>1000,20256=>1000,20257=>1000,20258=>1000,20259=>1000,20260=>1000, - 20261=>1000,20262=>1000,20263=>1000,20264=>1000,20265=>1000,20266=>1000,20267=>1000,20268=>1000,20269=>1000,20270=>1000,20271=>1000,20272=>1000,20273=>1000,20274=>1000,20275=>1000,20276=>1000, - 20277=>1000,20278=>1000,20279=>1000,20280=>1000,20281=>1000,20282=>1000,20283=>1000,20284=>1000,20285=>1000,20286=>1000,20287=>1000,20288=>1000,20289=>1000,20290=>1000,20291=>1000,20292=>1000, - 20293=>1000,20294=>1000,20295=>1000,20296=>1000,20297=>1000,20298=>1000,20299=>1000,20300=>1000,20301=>1000,20302=>1000,20303=>1000,20304=>1000,20305=>1000,20306=>1000,20307=>1000,20308=>1000, - 20309=>1000,20310=>1000,20311=>1000,20312=>1000,20313=>1000,20314=>1000,20315=>1000,20316=>1000,20317=>1000,20318=>1000,20319=>1000,20320=>1000,20321=>1000,20322=>1000,20323=>1000,20324=>1000, - 20325=>1000,20326=>1000,20327=>1000,20328=>1000,20329=>1000,20330=>1000,20331=>1000,20332=>1000,20333=>1000,20334=>1000,20335=>1000,20336=>1000,20337=>1000,20338=>1000,20339=>1000,20340=>1000, - 20341=>1000,20342=>1000,20343=>1000,20344=>1000,20345=>1000,20346=>1000,20347=>1000,20348=>1000,20349=>1000,20350=>1000,20351=>1000,20352=>1000,20353=>1000,20354=>1000,20355=>1000,20356=>1000, - 20357=>1000,20358=>1000,20359=>1000,20360=>1000,20361=>1000,20362=>1000,20363=>1000,20364=>1000,20365=>1000,20366=>1000,20367=>1000,20368=>1000,20369=>1000,20370=>1000,20371=>1000,20372=>1000, - 20373=>1000,20374=>1000,20375=>1000,20376=>1000,20377=>1000,20378=>1000,20379=>1000,20380=>1000,20381=>1000,20382=>1000,20383=>1000,20384=>1000,20385=>1000,20386=>1000,20387=>1000,20388=>1000, - 20389=>1000,20390=>1000,20391=>1000,20392=>1000,20393=>1000,20394=>1000,20395=>1000,20396=>1000,20397=>1000,20398=>1000,20399=>1000,20400=>1000,20401=>1000,20402=>1000,20403=>1000,20404=>1000, - 20405=>1000,20406=>1000,20407=>1000,20408=>1000,20409=>1000,20410=>1000,20411=>1000,20412=>1000,20413=>1000,20414=>1000,20415=>1000,20416=>1000,20417=>1000,20418=>1000,20419=>1000,20420=>1000, - 20421=>1000,20422=>1000,20423=>1000,20424=>1000,20425=>1000,20426=>1000,20427=>1000,20428=>1000,20429=>1000,20430=>1000,20431=>1000,20432=>1000,20433=>1000,20434=>1000,20435=>1000,20436=>1000, - 20437=>1000,20438=>1000,20439=>1000,20440=>1000,20441=>1000,20442=>1000,20443=>1000,20444=>1000,20445=>1000,20446=>1000,20447=>1000,20448=>1000,20449=>1000,20450=>1000,20451=>1000,20452=>1000, - 20453=>1000,20454=>1000,20455=>1000,20456=>1000,20457=>1000,20458=>1000,20459=>1000,20460=>1000,20461=>1000,20462=>1000,20463=>1000,20464=>1000,20465=>1000,20466=>1000,20467=>1000,20468=>1000, - 20469=>1000,20470=>1000,20471=>1000,20472=>1000,20473=>1000,20474=>1000,20475=>1000,20476=>1000,20477=>1000,20478=>1000,20479=>1000,20480=>1000,20481=>1000,20482=>1000,20483=>1000,20484=>1000, - 20485=>1000,20486=>1000,20487=>1000,20488=>1000,20489=>1000,20490=>1000,20491=>1000,20492=>1000,20493=>1000,20494=>1000,20495=>1000,20496=>1000,20497=>1000,20498=>1000,20499=>1000,20500=>1000, - 20501=>1000,20502=>1000,20503=>1000,20504=>1000,20505=>1000,20506=>1000,20507=>1000,20508=>1000,20509=>1000,20510=>1000,20511=>1000,20512=>1000,20513=>1000,20514=>1000,20515=>1000,20516=>1000, - 20517=>1000,20518=>1000,20519=>1000,20520=>1000,20521=>1000,20522=>1000,20523=>1000,20524=>1000,20525=>1000,20526=>1000,20527=>1000,20528=>1000,20529=>1000,20530=>1000,20531=>1000,20532=>1000, - 20533=>1000,20534=>1000,20535=>1000,20536=>1000,20537=>1000,20538=>1000,20539=>1000,20540=>1000,20541=>1000,20542=>1000,20543=>1000,20544=>1000,20545=>1000,20546=>1000,20547=>1000,20548=>1000, - 20549=>1000,20550=>1000,20551=>1000,20552=>1000,20553=>1000,20554=>1000,20555=>1000,20556=>1000,20557=>1000,20558=>1000,20559=>1000,20560=>1000,20561=>1000,20562=>1000,20563=>1000,20564=>1000, - 20565=>1000,20566=>1000,20567=>1000,20568=>1000,20569=>1000,20570=>1000,20571=>1000,20572=>1000,20573=>1000,20574=>1000,20575=>1000,20576=>1000,20577=>1000,20578=>1000,20579=>1000,20580=>1000, - 20581=>1000,20582=>1000,20583=>1000,20584=>1000,20585=>1000,20586=>1000,20587=>1000,20588=>1000,20589=>1000,20590=>1000,20591=>1000,20592=>1000,20593=>1000,20594=>1000,20595=>1000,20596=>1000, - 20597=>1000,20598=>1000,20599=>1000,20600=>1000,20601=>1000,20602=>1000,20603=>1000,20604=>1000,20605=>1000,20606=>1000,20607=>1000,20608=>1000,20609=>1000,20610=>1000,20611=>1000,20612=>1000, - 20613=>1000,20614=>1000,20615=>1000,20616=>1000,20617=>1000,20618=>1000,20619=>1000,20620=>1000,20621=>1000,20622=>1000,20623=>1000,20624=>1000,20625=>1000,20626=>1000,20627=>1000,20628=>1000, - 20629=>1000,20630=>1000,20631=>1000,20632=>1000,20633=>1000,20634=>1000,20635=>1000,20636=>1000,20637=>1000,20638=>1000,20639=>1000,20640=>1000,20641=>1000,20642=>1000,20643=>1000,20644=>1000, - 20645=>1000,20646=>1000,20647=>1000,20648=>1000,20649=>1000,20650=>1000,20651=>1000,20652=>1000,20653=>1000,20654=>1000,20655=>1000,20656=>1000,20657=>1000,20658=>1000,20659=>1000,20660=>1000, - 20661=>1000,20662=>1000,20663=>1000,20664=>1000,20665=>1000,20666=>1000,20667=>1000,20668=>1000,20669=>1000,20670=>1000,20671=>1000,20672=>1000,20673=>1000,20674=>1000,20675=>1000,20676=>1000, - 20677=>1000,20678=>1000,20679=>1000,20680=>1000,20681=>1000,20682=>1000,20683=>1000,20684=>1000,20685=>1000,20686=>1000,20687=>1000,20688=>1000,20689=>1000,20690=>1000,20691=>1000,20692=>1000, - 20693=>1000,20694=>1000,20695=>1000,20696=>1000,20697=>1000,20698=>1000,20699=>1000,20700=>1000,20701=>1000,20702=>1000,20703=>1000,20704=>1000,20705=>1000,20706=>1000,20707=>1000,20708=>1000, - 20709=>1000,20710=>1000,20711=>1000,20712=>1000,20713=>1000,20714=>1000,20715=>1000,20716=>1000,20717=>1000,20718=>1000,20719=>1000,20720=>1000,20721=>1000,20722=>1000,20723=>1000,20724=>1000, - 20725=>1000,20726=>1000,20727=>1000,20728=>1000,20729=>1000,20730=>1000,20731=>1000,20732=>1000,20733=>1000,20734=>1000,20735=>1000,20736=>1000,20737=>1000,20738=>1000,20739=>1000,20740=>1000, - 20741=>1000,20742=>1000,20743=>1000,20744=>1000,20745=>1000,20746=>1000,20747=>1000,20748=>1000,20749=>1000,20750=>1000,20751=>1000,20752=>1000,20753=>1000,20754=>1000,20755=>1000,20756=>1000, - 20757=>1000,20758=>1000,20759=>1000,20760=>1000,20761=>1000,20762=>1000,20763=>1000,20764=>1000,20765=>1000,20766=>1000,20767=>1000,20768=>1000,20769=>1000,20770=>1000,20771=>1000,20772=>1000, - 20773=>1000,20774=>1000,20775=>1000,20776=>1000,20777=>1000,20778=>1000,20779=>1000,20780=>1000,20781=>1000,20782=>1000,20783=>1000,20784=>1000,20785=>1000,20786=>1000,20787=>1000,20788=>1000, - 20789=>1000,20790=>1000,20791=>1000,20792=>1000,20793=>1000,20794=>1000,20795=>1000,20796=>1000,20797=>1000,20798=>1000,20799=>1000,20800=>1000,20801=>1000,20802=>1000,20803=>1000,20804=>1000, - 20805=>1000,20806=>1000,20807=>1000,20808=>1000,20809=>1000,20810=>1000,20811=>1000,20812=>1000,20813=>1000,20814=>1000,20815=>1000,20816=>1000,20817=>1000,20818=>1000,20819=>1000,20820=>1000, - 20821=>1000,20822=>1000,20823=>1000,20824=>1000,20825=>1000,20826=>1000,20827=>1000,20828=>1000,20829=>1000,20830=>1000,20831=>1000,20832=>1000,20833=>1000,20834=>1000,20835=>1000,20836=>1000, - 20837=>1000,20838=>1000,20839=>1000,20840=>1000,20841=>1000,20842=>1000,20843=>1000,20844=>1000,20845=>1000,20846=>1000,20847=>1000,20848=>1000,20849=>1000,20850=>1000,20851=>1000,20852=>1000, - 20853=>1000,20854=>1000,20855=>1000,20856=>1000,20857=>1000,20858=>1000,20859=>1000,20860=>1000,20861=>1000,20862=>1000,20863=>1000,20864=>1000,20865=>1000,20866=>1000,20867=>1000,20868=>1000, - 20869=>1000,20870=>1000,20871=>1000,20872=>1000,20873=>1000,20874=>1000,20875=>1000,20876=>1000,20877=>1000,20878=>1000,20879=>1000,20880=>1000,20881=>1000,20882=>1000,20883=>1000,20884=>1000, - 20885=>1000,20886=>1000,20887=>1000,20888=>1000,20889=>1000,20890=>1000,20891=>1000,20892=>1000,20893=>1000,20894=>1000,20895=>1000,20896=>1000,20897=>1000,20898=>1000,20899=>1000,20900=>1000, - 20901=>1000,20902=>1000,20903=>1000,20904=>1000,20905=>1000,20906=>1000,20907=>1000,20908=>1000,20909=>1000,20910=>1000,20911=>1000,20912=>1000,20913=>1000,20914=>1000,20915=>1000,20916=>1000, - 20917=>1000,20918=>1000,20919=>1000,20920=>1000,20921=>1000,20922=>1000,20923=>1000,20924=>1000,20925=>1000,20926=>1000,20927=>1000,20928=>1000,20929=>1000,20930=>1000,20931=>1000,20932=>1000, - 20933=>1000,20934=>1000,20935=>1000,20936=>1000,20937=>1000,20938=>1000,20939=>1000,20940=>1000,20941=>1000,20942=>1000,20943=>1000,20944=>1000,20945=>1000,20946=>1000,20947=>1000,20948=>1000, - 20949=>1000,20950=>1000,20951=>1000,20952=>1000,20953=>1000,20954=>1000,20955=>1000,20956=>1000,20957=>1000,20958=>1000,20959=>1000,20960=>1000,20961=>1000,20962=>1000,20963=>1000,20964=>1000, - 20965=>1000,20966=>1000,20967=>1000,20968=>1000,20969=>1000,20970=>1000,20971=>1000,20972=>1000,20973=>1000,20974=>1000,20975=>1000,20976=>1000,20977=>1000,20978=>1000,20979=>1000,20980=>1000, - 20981=>1000,20982=>1000,20983=>1000,20984=>1000,20985=>1000,20986=>1000,20987=>1000,20988=>1000,20989=>1000,20990=>1000,20991=>1000,20992=>1000,20993=>1000,20994=>1000,20995=>1000,20996=>1000, - 20997=>1000,20998=>1000,20999=>1000,21000=>1000,21001=>1000,21002=>1000,21003=>1000,21004=>1000,21005=>1000,21006=>1000,21007=>1000,21008=>1000,21009=>1000,21010=>1000,21011=>1000,21012=>1000, - 21013=>1000,21014=>1000,21015=>1000,21016=>1000,21017=>1000,21018=>1000,21019=>1000,21020=>1000,21021=>1000,21022=>1000,21023=>1000,21024=>1000,21025=>1000,21026=>1000,21027=>1000,21028=>1000, - 21029=>1000,21030=>1000,21031=>1000,21032=>1000,21033=>1000,21034=>1000,21035=>1000,21036=>1000,21037=>1000,21038=>1000,21039=>1000,21040=>1000,21041=>1000,21042=>1000,21043=>1000,21044=>1000, - 21045=>1000,21046=>1000,21047=>1000,21048=>1000,21049=>1000,21050=>1000,21051=>1000,21052=>1000,21053=>1000,21054=>1000,21055=>1000,21056=>1000,21057=>1000,21058=>1000,21059=>1000,21060=>1000, - 21061=>1000,21062=>1000,21063=>1000,21064=>1000,21065=>1000,21066=>1000,21067=>1000,21068=>1000,21069=>1000,21070=>1000,21071=>1000,21072=>1000,21073=>1000,21074=>1000,21075=>1000,21076=>1000, - 21077=>1000,21078=>1000,21079=>1000,21080=>1000,21081=>1000,21082=>1000,21083=>1000,21084=>1000,21085=>1000,21086=>1000,21087=>1000,21088=>1000,21089=>1000,21090=>1000,21091=>1000,21092=>1000, - 21093=>1000,21094=>1000,21095=>1000,21096=>1000,21097=>1000,21098=>1000,21099=>1000,21100=>1000,21101=>1000,21102=>1000,21103=>1000,21104=>1000,21105=>1000,21106=>1000,21107=>1000,21108=>1000, - 21109=>1000,21110=>1000,21111=>1000,21112=>1000,21113=>1000,21114=>1000,21115=>1000,21116=>1000,21117=>1000,21118=>1000,21119=>1000,21120=>1000,21121=>1000,21122=>1000,21123=>1000,21124=>1000, - 21125=>1000,21126=>1000,21127=>1000,21128=>1000,21129=>1000,21130=>1000,21131=>1000,21132=>1000,21133=>1000,21134=>1000,21135=>1000,21136=>1000,21137=>1000,21138=>1000,21139=>1000,21140=>1000, - 21141=>1000,21142=>1000,21143=>1000,21144=>1000,21145=>1000,21146=>1000,21147=>1000,21148=>1000,21149=>1000,21150=>1000,21151=>1000,21152=>1000,21153=>1000,21154=>1000,21155=>1000,21156=>1000, - 21157=>1000,21158=>1000,21159=>1000,21160=>1000,21161=>1000,21162=>1000,21163=>1000,21164=>1000,21165=>1000,21166=>1000,21167=>1000,21168=>1000,21169=>1000,21170=>1000,21171=>1000,21172=>1000, - 21173=>1000,21174=>1000,21175=>1000,21176=>1000,21177=>1000,21178=>1000,21179=>1000,21180=>1000,21181=>1000,21182=>1000,21183=>1000,21184=>1000,21185=>1000,21186=>1000,21187=>1000,21188=>1000, - 21189=>1000,21190=>1000,21191=>1000,21192=>1000,21193=>1000,21194=>1000,21195=>1000,21196=>1000,21197=>1000,21198=>1000,21199=>1000,21200=>1000,21201=>1000,21202=>1000,21203=>1000,21204=>1000, - 21205=>1000,21206=>1000,21207=>1000,21208=>1000,21209=>1000,21210=>1000,21211=>1000,21212=>1000,21213=>1000,21214=>1000,21215=>1000,21216=>1000,21217=>1000,21218=>1000,21219=>1000,21220=>1000, - 21221=>1000,21222=>1000,21223=>1000,21224=>1000,21225=>1000,21226=>1000,21227=>1000,21228=>1000,21229=>1000,21230=>1000,21231=>1000,21232=>1000,21233=>1000,21234=>1000,21235=>1000,21236=>1000, - 21237=>1000,21238=>1000,21239=>1000,21240=>1000,21241=>1000,21242=>1000,21243=>1000,21244=>1000,21245=>1000,21246=>1000,21247=>1000,21248=>1000,21249=>1000,21250=>1000,21251=>1000,21252=>1000, - 21253=>1000,21254=>1000,21255=>1000,21256=>1000,21257=>1000,21258=>1000,21259=>1000,21260=>1000,21261=>1000,21262=>1000,21263=>1000,21264=>1000,21265=>1000,21266=>1000,21267=>1000,21268=>1000, - 21269=>1000,21270=>1000,21271=>1000,21272=>1000,21273=>1000,21274=>1000,21275=>1000,21276=>1000,21277=>1000,21278=>1000,21279=>1000,21280=>1000,21281=>1000,21282=>1000,21283=>1000,21284=>1000, - 21285=>1000,21286=>1000,21287=>1000,21288=>1000,21289=>1000,21290=>1000,21291=>1000,21292=>1000,21293=>994,21294=>1000,21295=>1000,21296=>1000,21297=>1000,21298=>1000,21299=>1000,21300=>1000, - 21301=>1000,21302=>1000,21303=>1000,21304=>1000,21305=>1000,21306=>1000,21307=>1000,21308=>1000,21309=>1000,21310=>1000,21311=>1000,21312=>1000,21313=>1000,21314=>1000,21315=>1000,21316=>1000, - 21317=>1000,21318=>1000,21319=>1000,21320=>1000,21321=>1000,21322=>1000,21323=>1000,21324=>1000,21325=>1000,21326=>1000,21327=>1000,21328=>1000,21329=>1000,21330=>1000,21331=>1000,21332=>1000, - 21333=>1000,21334=>1000,21335=>1000,21336=>1000,21337=>1000,21338=>1000,21339=>1000,21340=>1000,21341=>1000,21342=>1000,21343=>1000,21344=>1000,21345=>1000,21346=>1000,21347=>1000,21348=>1000, - 21349=>1000,21350=>1000,21351=>1000,21352=>1000,21353=>1000,21354=>1000,21355=>1000,21356=>1000,21357=>1000,21358=>1000,21359=>1000,21360=>1000,21361=>1000,21362=>1000,21363=>1000,21364=>1000, - 21365=>1000,21366=>1000,21367=>1000,21368=>1000,21369=>1000,21370=>1000,21371=>1000,21372=>1000,21373=>1000,21374=>1000,21375=>1000,21376=>1000,21377=>1000,21378=>1000,21379=>1000,21380=>1000, - 21381=>1000,21382=>1000,21383=>1000,21384=>1000,21385=>1000,21386=>1000,21387=>1000,21388=>1000,21389=>1000,21390=>1000,21391=>1000,21392=>1000,21393=>1000,21394=>1000,21395=>1000,21396=>1000, - 21397=>1000,21398=>1000,21399=>1000,21400=>1000,21401=>1000,21402=>1000,21403=>1000,21404=>1000,21405=>1000,21406=>1000,21407=>1000,21408=>1000,21409=>1000,21410=>1000,21411=>1000,21412=>1000, - 21413=>1000,21414=>1000,21415=>1000,21416=>1000,21417=>1000,21418=>1000,21419=>1000,21420=>1000,21421=>1000,21422=>1000,21423=>1000,21424=>1000,21425=>1000,21426=>1000,21427=>1000,21428=>1000, - 21429=>1000,21430=>1000,21431=>1000,21432=>1000,21433=>1000,21434=>1000,21435=>1000,21436=>1000,21437=>1000,21438=>1000,21439=>1000,21440=>1000,21441=>1000,21442=>1000,21443=>1000,21444=>1000, - 21445=>1000,21446=>1000,21447=>1000,21448=>1000,21449=>1000,21450=>1000,21451=>1000,21452=>1000,21453=>1000,21454=>1000,21455=>1000,21456=>1000,21457=>1000,21458=>1000,21459=>1000,21460=>1000, - 21461=>1000,21462=>1000,21463=>1000,21464=>1000,21465=>1000,21466=>1000,21467=>1000,21468=>1000,21469=>1000,21470=>1000,21471=>1000,21472=>1000,21473=>1000,21474=>1000,21475=>1000,21476=>1000, - 21477=>1000,21478=>1000,21479=>1000,21480=>1000,21481=>1000,21482=>1000,21483=>1000,21484=>1000,21485=>1000,21486=>1000,21487=>1000,21488=>1000,21489=>1000,21490=>1000,21491=>1000,21492=>1000, - 21493=>1000,21494=>1000,21495=>1000,21496=>1000,21497=>1000,21498=>1000,21499=>1000,21500=>1000,21501=>1000,21502=>1000,21503=>1000,21504=>1000,21505=>1000,21506=>1000,21507=>1000,21508=>1000, - 21509=>1000,21510=>1000,21511=>1000,21512=>1000,21513=>1000,21514=>1000,21515=>1000,21516=>1000,21517=>1000,21518=>1000,21519=>1000,21520=>1000,21521=>1000,21522=>1000,21523=>1000,21524=>1000, - 21525=>1000,21526=>1000,21527=>1000,21528=>1000,21529=>1000,21530=>1000,21531=>1000,21532=>1000,21533=>1000,21534=>1000,21535=>1000,21536=>1000,21537=>1000,21538=>1000,21539=>1000,21540=>1000, - 21541=>1000,21542=>1000,21543=>1000,21544=>1000,21545=>1000,21546=>1000,21547=>1000,21548=>1000,21549=>1000,21550=>1000,21551=>1000,21552=>1000,21553=>1000,21554=>1000,21555=>1000,21556=>1000, - 21557=>1000,21558=>1000,21559=>1000,21560=>1000,21561=>1000,21562=>1000,21563=>1000,21564=>1000,21565=>1000,21566=>1000,21567=>1000,21568=>1000,21569=>1000,21570=>1000,21571=>1000,21572=>1000, - 21573=>1000,21574=>1000,21575=>1000,21576=>1000,21577=>1000,21578=>1000,21579=>1000,21580=>1000,21581=>1000,21582=>1000,21583=>1000,21584=>1000,21585=>1000,21586=>1000,21587=>1000,21588=>1000, - 21589=>1000,21590=>1000,21591=>1000,21592=>1000,21593=>1000,21594=>1000,21595=>1000,21596=>1000,21597=>1000,21598=>1000,21599=>1000,21600=>1000,21601=>1000,21602=>1000,21603=>1000,21604=>1000, - 21605=>1000,21606=>1000,21607=>1000,21608=>1000,21609=>1000,21610=>1000,21611=>1000,21612=>1000,21613=>1000,21614=>1000,21615=>1000,21616=>1000,21617=>1000,21618=>1000,21619=>1000,21620=>1000, - 21621=>1000,21622=>1000,21623=>1000,21624=>1000,21625=>1000,21626=>1000,21627=>1000,21628=>1000,21629=>1000,21630=>1000,21631=>1000,21632=>1000,21633=>1000,21634=>1000,21635=>1000,21636=>1000, - 21637=>1000,21638=>1000,21639=>1000,21640=>1000,21641=>1000,21642=>1000,21643=>1000,21644=>1000,21645=>1000,21646=>1000,21647=>1000,21648=>1000,21649=>1000,21650=>1000,21651=>1000,21652=>1000, - 21653=>1000,21654=>1000,21655=>1000,21656=>1000,21657=>1000,21658=>1000,21659=>1000,21660=>1000,21661=>1000,21662=>1000,21663=>1000,21664=>1000,21665=>1000,21666=>1000,21667=>1000,21668=>1000, - 21669=>1000,21670=>1000,21671=>1000,21672=>1000,21673=>1000,21674=>1000,21675=>1000,21676=>1000,21677=>1000,21678=>1000,21679=>1000,21680=>1000,21681=>1000,21682=>1000,21683=>1000,21684=>1000, - 21685=>1000,21686=>1000,21687=>1000,21688=>1000,21689=>1000,21690=>1000,21691=>1000,21692=>1000,21693=>1000,21694=>1000,21695=>1000,21696=>1000,21697=>1000,21698=>1000,21699=>1000,21700=>1000, - 21701=>1000,21702=>1000,21703=>1000,21704=>1000,21705=>1000,21706=>1000,21707=>1000,21708=>1000,21709=>1000,21710=>1000,21711=>1000,21712=>1000,21713=>1000,21714=>1000,21715=>1000,21716=>1000, - 21717=>1000,21718=>1000,21719=>1000,21720=>1000,21721=>1000,21722=>1000,21723=>1000,21724=>1000,21725=>1000,21726=>1000,21727=>1000,21728=>1000,21729=>1000,21730=>1000,21731=>1000,21732=>1000, - 21733=>1000,21734=>1000,21735=>1000,21736=>1000,21737=>1000,21738=>1000,21739=>1000,21740=>1000,21741=>1000,21742=>1000,21743=>1000,21744=>1000,21745=>1000,21746=>1000,21747=>1000,21748=>1000, - 21749=>1000,21750=>1000,21751=>1000,21752=>1000,21753=>1000,21754=>1000,21755=>1000,21756=>1000,21757=>1000,21758=>1000,21759=>1000,21760=>1000,21761=>1000,21762=>1000,21763=>1000,21764=>1000, - 21765=>1000,21766=>1000,21767=>1000,21768=>1000,21769=>1000,21770=>1000,21771=>1000,21772=>1000,21773=>1000,21774=>1000,21775=>1000,21776=>1000,21777=>1000,21778=>1000,21779=>1000,21780=>1000, - 21781=>1000,21782=>1000,21783=>1000,21784=>1000,21785=>1000,21786=>1000,21787=>1000,21788=>1000,21789=>1000,21790=>1000,21791=>1000,21792=>1000,21793=>1000,21794=>1000,21795=>1000,21796=>1000, - 21797=>1000,21798=>1000,21799=>1000,21800=>1000,21801=>1000,21802=>1000,21803=>1000,21804=>1000,21805=>1000,21806=>1000,21807=>1000,21808=>1000,21809=>1000,21810=>1000,21811=>1000,21812=>1000, - 21813=>1000,21814=>1000,21815=>1000,21816=>1000,21817=>1000,21818=>1000,21819=>1000,21820=>1000,21821=>1000,21822=>1000,21823=>1000,21824=>1000,21825=>1000,21826=>1000,21827=>1000,21828=>1000, - 21829=>1000,21830=>1000,21831=>1000,21832=>1000,21833=>1000,21834=>1000,21835=>1000,21836=>1000,21837=>1000,21838=>1000,21839=>1000,21840=>1000,21841=>1000,21842=>1000,21843=>1000,21844=>1000, - 21845=>1000,21846=>1000,21847=>1000,21848=>1000,21849=>1000,21850=>1000,21851=>1000,21852=>1000,21853=>1000,21854=>1000,21855=>1000,21856=>1000,21857=>1000,21858=>1000,21859=>1000,21860=>1000, - 21861=>1000,21862=>1000,21863=>1000,21864=>1000,21865=>1000,21866=>1000,21867=>1000,21868=>1000,21869=>1000,21870=>1000,21871=>1000,21872=>1000,21873=>1000,21874=>1000,21875=>1000,21876=>1000, - 21877=>1000,21878=>1000,21879=>1000,21880=>1000,21881=>1000,21882=>1000,21883=>1000,21884=>1000,21885=>1000,21886=>1000,21887=>1000,21888=>1000,21889=>1000,21890=>1000,21891=>1000,21892=>1000, - 21893=>1000,21894=>1000,21895=>1000,21896=>1000,21897=>1000,21898=>1000,21899=>1000,21900=>1000,21901=>1000,21902=>1000,21903=>1000,21904=>1000,21905=>1000,21906=>1000,21907=>1000,21908=>1000, - 21909=>1000,21910=>1000,21911=>1000,21912=>1000,21913=>1000,21914=>1000,21915=>1000,21916=>1000,21917=>1000,21918=>1000,21919=>1000,21920=>1000,21921=>1000,21922=>1000,21923=>1000,21924=>1000, - 21925=>1000,21926=>1000,21927=>1000,21928=>1000,21929=>1000,21930=>1000,21931=>1000,21932=>1000,21933=>1000,21934=>1000,21935=>1000,21936=>1000,21937=>1000,21938=>1000,21939=>1000,21940=>1000, - 21941=>1000,21942=>1000,21943=>1000,21944=>1000,21945=>1000,21946=>1000,21947=>1000,21948=>1000,21949=>1000,21950=>1000,21951=>1000,21952=>1000,21953=>1000,21954=>1000,21955=>1000,21956=>1000, - 21957=>1000,21958=>1000,21959=>1000,21960=>1000,21961=>1000,21962=>1000,21963=>1000,21964=>1000,21965=>1000,21966=>1000,21967=>1000,21968=>1000,21969=>1000,21970=>1000,21971=>1000,21972=>1000, - 21973=>1000,21974=>1000,21975=>1000,21976=>1000,21977=>1000,21978=>1000,21979=>1000,21980=>1000,21981=>1000,21982=>1000,21983=>1000,21984=>1000,21985=>1000,21986=>1000,21987=>1000,21988=>1000, - 21989=>1000,21990=>1000,21991=>1000,21992=>1000,21993=>1000,21994=>1000,21995=>1000,21996=>1000,21997=>1000,21998=>1000,21999=>1000,22000=>1000,22001=>1000,22002=>1000,22003=>1000,22004=>1000, - 22005=>1000,22006=>1000,22007=>1000,22008=>1000,22009=>1000,22010=>1000,22011=>1000,22012=>1000,22013=>1000,22014=>1000,22015=>1000,22016=>1000,22017=>1000,22018=>1000,22019=>1000,22020=>1000, - 22021=>1000,22022=>1000,22023=>1000,22024=>1000,22025=>1000,22026=>1000,22027=>1000,22028=>1000,22029=>1000,22030=>1000,22031=>1000,22032=>1000,22033=>1000,22034=>1000,22035=>1000,22036=>1000, - 22037=>1000,22038=>1000,22039=>1000,22040=>1000,22041=>1000,22042=>1000,22043=>1000,22044=>1000,22045=>1000,22046=>1000,22047=>1000,22048=>1000,22049=>1000,22050=>1000,22051=>1000,22052=>1000, - 22053=>1000,22054=>1000,22055=>1000,22056=>1000,22057=>1000,22058=>1000,22059=>1000,22060=>1000,22061=>1000,22062=>1000,22063=>1000,22064=>1000,22065=>1000,22066=>1000,22067=>1000,22068=>1000, - 22069=>1000,22070=>1000,22071=>1000,22072=>1000,22073=>1000,22074=>1000,22075=>1000,22076=>1000,22077=>1000,22078=>1000,22079=>1000,22080=>1000,22081=>1000,22082=>1000,22083=>1000,22084=>1000, - 22085=>1000,22086=>1000,22087=>1000,22088=>1000,22089=>1000,22090=>1000,22091=>1000,22092=>1000,22093=>1000,22094=>1000,22095=>1000,22096=>1000,22097=>1000,22098=>1000,22099=>1000,22100=>1000, - 22101=>1000,22102=>1000,22103=>1000,22104=>1000,22105=>1000,22106=>1000,22107=>1000,22108=>1000,22109=>1000,22110=>1000,22111=>1000,22112=>1000,22113=>1000,22114=>1000,22115=>1000,22116=>1000, - 22117=>1000,22118=>1000,22119=>1000,22120=>1000,22121=>1000,22122=>1000,22123=>1000,22124=>1000,22125=>1000,22126=>1000,22127=>1000,22128=>1000,22129=>1000,22130=>1000,22131=>1000,22132=>1000, - 22133=>1000,22134=>1000,22135=>1000,22136=>1000,22137=>1000,22138=>1000,22139=>1000,22140=>1000,22141=>1000,22142=>1000,22143=>1000,22144=>1000,22145=>1000,22146=>1000,22147=>1000,22148=>1000, - 22149=>1000,22150=>1000,22151=>1000,22152=>1000,22153=>1000,22154=>1000,22155=>1000,22156=>1000,22157=>1000,22158=>1000,22159=>1000,22160=>1000,22161=>1000,22162=>1000,22163=>1000,22164=>1000, - 22165=>1000,22166=>1000,22167=>1000,22168=>1000,22169=>1000,22170=>1000,22171=>1000,22172=>1000,22173=>1000,22174=>1000,22175=>1000,22176=>1000,22177=>1000,22178=>1000,22179=>1000,22180=>1000, - 22181=>1000,22182=>1000,22183=>1000,22184=>1000,22185=>1000,22186=>1000,22187=>1000,22188=>1000,22189=>1000,22190=>1000,22191=>1000,22192=>1000,22193=>1000,22194=>1000,22195=>1000,22196=>1000, - 22197=>1000,22198=>1000,22199=>1000,22200=>1000,22201=>1000,22202=>1000,22203=>1000,22204=>1000,22205=>1000,22206=>1000,22207=>1000,22208=>1000,22209=>1000,22210=>1000,22211=>1000,22212=>1000, - 22213=>1000,22214=>1000,22215=>1000,22216=>1000,22217=>1000,22218=>1000,22219=>1000,22220=>1000,22221=>1000,22222=>1000,22223=>1000,22224=>1000,22225=>1000,22226=>1000,22227=>1000,22228=>1000, - 22229=>1000,22230=>1000,22231=>1000,22232=>1000,22233=>1000,22234=>1000,22235=>1000,22236=>1000,22237=>1000,22238=>1000,22239=>1000,22240=>1000,22241=>1000,22242=>1000,22243=>1000,22244=>1000, - 22245=>1000,22246=>1000,22247=>1000,22248=>1000,22249=>1000,22250=>1000,22251=>1000,22252=>1000,22253=>1000,22254=>1000,22255=>1000,22256=>1000,22257=>1000,22258=>1000,22259=>1000,22260=>1000, - 22261=>1000,22262=>1000,22263=>1000,22264=>1000,22265=>1000,22266=>1000,22267=>1000,22268=>1000,22269=>1000,22270=>1000,22271=>1000,22272=>1000,22273=>1000,22274=>1000,22275=>1000,22276=>1000, - 22277=>1000,22278=>1000,22279=>1000,22280=>1000,22281=>1000,22282=>1000,22283=>1000,22284=>1000,22285=>1000,22286=>1000,22287=>1000,22288=>1000,22289=>1000,22290=>1000,22291=>1000,22292=>1000, - 22293=>1000,22294=>1000,22295=>1000,22296=>1000,22297=>1000,22298=>1000,22299=>1000,22300=>1000,22301=>1000,22302=>1000,22303=>1000,22304=>1000,22305=>1000,22306=>1000,22307=>1000,22308=>1000, - 22309=>1000,22310=>1000,22311=>1000,22312=>1000,22313=>1000,22314=>1000,22315=>1000,22316=>1000,22317=>1000,22318=>1000,22319=>1000,22320=>1000,22321=>1000,22322=>1000,22323=>1000,22324=>1000, - 22325=>1000,22326=>1000,22327=>1000,22328=>1000,22329=>1000,22330=>1000,22331=>1000,22332=>1000,22333=>1000,22334=>1000,22335=>1000,22336=>1000,22337=>1000,22338=>1000,22339=>1000,22340=>1000, - 22341=>1000,22342=>1000,22343=>1000,22344=>1000,22345=>1000,22346=>1000,22347=>1000,22348=>1000,22349=>1000,22350=>1000,22351=>1000,22352=>1000,22353=>1000,22354=>1000,22355=>1000,22356=>1000, - 22357=>1000,22358=>1000,22359=>1000,22360=>1000,22361=>1000,22362=>1000,22363=>1000,22364=>1000,22365=>1000,22366=>1000,22367=>1000,22368=>1000,22369=>1000,22370=>1000,22371=>1000,22372=>1000, - 22373=>1000,22374=>1000,22375=>1000,22376=>1000,22377=>1000,22378=>1000,22379=>1000,22380=>1000,22381=>1000,22382=>1000,22383=>1000,22384=>1000,22385=>1000,22386=>1000,22387=>1000,22388=>1000, - 22389=>1000,22390=>1000,22391=>1000,22392=>1000,22393=>1000,22394=>1000,22395=>1000,22396=>1000,22397=>1000,22398=>1000,22399=>1000,22400=>1000,22401=>1000,22402=>1000,22403=>1000,22404=>1000, - 22405=>1000,22406=>1000,22407=>1000,22408=>1000,22409=>1000,22410=>1000,22411=>1000,22412=>1000,22413=>1000,22414=>1000,22415=>1000,22416=>1000,22417=>1000,22418=>1000,22419=>1000,22420=>1000, - 22421=>1000,22422=>1000,22423=>1000,22424=>1000,22425=>1000,22426=>1000,22427=>1000,22428=>1000,22429=>1000,22430=>1000,22431=>1000,22432=>1000,22433=>1000,22434=>1000,22435=>1000,22436=>1000, - 22437=>1000,22438=>1000,22439=>1000,22440=>1000,22441=>1000,22442=>1000,22443=>1000,22444=>1000,22445=>1000,22446=>1000,22447=>1000,22448=>1000,22449=>1000,22450=>1000,22451=>1000,22452=>1000, - 22453=>1000,22454=>1000,22455=>1000,22456=>1000,22457=>1000,22458=>1000,22459=>1000,22460=>1000,22461=>1000,22462=>1000,22463=>1000,22464=>1000,22465=>1000,22466=>1000,22467=>1000,22468=>1000, - 22469=>1000,22470=>1000,22471=>1000,22472=>1000,22473=>1000,22474=>1000,22475=>1000,22476=>1000,22477=>1000,22478=>1000,22479=>1000,22480=>1000,22481=>1000,22482=>1000,22483=>1000,22484=>1000, - 22485=>1000,22486=>1000,22487=>1000,22488=>1000,22489=>1000,22490=>1000,22491=>1000,22492=>1000,22493=>1000,22494=>1000,22495=>1000,22496=>1000,22497=>1000,22498=>1000,22499=>1000,22500=>1000, - 22501=>1000,22502=>1000,22503=>1000,22504=>1000,22505=>1000,22506=>1000,22507=>1000,22508=>1000,22509=>1000,22510=>1000,22511=>1000,22512=>1000,22513=>1000,22514=>1000,22515=>1000,22516=>1000, - 22517=>1000,22518=>1000,22519=>1000,22520=>1000,22521=>1000,22522=>1000,22523=>1000,22524=>1000,22525=>1000,22526=>1000,22527=>1000,22528=>1000,22529=>1000,22530=>1000,22531=>1000,22532=>1000, - 22533=>1000,22534=>1000,22535=>1000,22536=>1000,22537=>1000,22538=>1000,22539=>1000,22540=>1000,22541=>1000,22542=>1000,22543=>1000,22544=>1000,22545=>1000,22546=>1000,22547=>1000,22548=>1000, - 22549=>1000,22550=>1000,22551=>1000,22552=>1000,22553=>1000,22554=>1000,22555=>1000,22556=>1000,22557=>1000,22558=>1000,22559=>1000,22560=>1000,22561=>1000,22562=>1000,22563=>1000,22564=>1000, - 22565=>1000,22566=>1000,22567=>1000,22568=>1000,22569=>1000,22570=>1000,22571=>1000,22572=>1000,22573=>1000,22574=>1000,22575=>1000,22576=>1000,22577=>1000,22578=>1000,22579=>1000,22580=>1000, - 22581=>1000,22582=>1000,22583=>1000,22584=>1000,22585=>1000,22586=>1000,22587=>1000,22588=>1000,22589=>1000,22590=>1000,22591=>1000,22592=>1000,22593=>1000,22594=>1000,22595=>1000,22596=>1000, - 22597=>1000,22598=>1000,22599=>1000,22600=>1000,22601=>1000,22602=>1000,22603=>1000,22604=>1000,22605=>1000,22606=>1000,22607=>1000,22608=>1000,22609=>1000,22610=>1000,22611=>1000,22612=>1000, - 22613=>1000,22614=>1000,22615=>1000,22616=>1000,22617=>1000,22618=>1000,22619=>1000,22620=>1000,22621=>1000,22622=>1000,22623=>1000,22624=>1000,22625=>1000,22626=>1000,22627=>1000,22628=>1000, - 22629=>1000,22630=>1000,22631=>1000,22632=>1000,22633=>1000,22634=>1000,22635=>1000,22636=>1000,22637=>1000,22638=>1000,22639=>1000,22640=>1000,22641=>1000,22642=>1000,22643=>1000,22644=>1000, - 22645=>1000,22646=>1000,22647=>1000,22648=>1000,22649=>1000,22650=>1000,22651=>1000,22652=>1000,22653=>1000,22654=>1000,22655=>1000,22656=>1000,22657=>1000,22658=>1000,22659=>1000,22660=>1000, - 22661=>1000,22662=>1000,22663=>1000,22664=>1000,22665=>1000,22666=>1000,22667=>1000,22668=>1000,22669=>1000,22670=>1000,22671=>1000,22672=>1000,22673=>1000,22674=>1000,22675=>1000,22676=>1000, - 22677=>1000,22678=>1000,22679=>1000,22680=>1000,22681=>1000,22682=>1000,22683=>1000,22684=>1000,22685=>1000,22686=>1000,22687=>1000,22688=>1000,22689=>1000,22690=>1000,22691=>1000,22692=>1000, - 22693=>1000,22694=>1000,22695=>1000,22696=>1000,22697=>1000,22698=>1000,22699=>1000,22700=>1000,22701=>1000,22702=>1000,22703=>1000,22704=>1000,22705=>1000,22706=>1000,22707=>1000,22708=>1000, - 22709=>1000,22710=>1000,22711=>1000,22712=>1000,22713=>1000,22714=>1000,22715=>1000,22716=>1000,22717=>1000,22718=>1000,22719=>1000,22720=>1000,22721=>1000,22722=>1000,22723=>1000,22724=>1000, - 22725=>1000,22726=>1000,22727=>1000,22728=>1000,22729=>1000,22730=>1000,22731=>1000,22732=>1000,22733=>1000,22734=>1000,22735=>1000,22736=>1000,22737=>1000,22738=>1000,22739=>1000,22740=>1000, - 22741=>1000,22742=>1000,22743=>1000,22744=>1000,22745=>1000,22746=>1000,22747=>1000,22748=>1000,22749=>1000,22750=>1000,22751=>1000,22752=>1000,22753=>1000,22754=>1000,22755=>1000,22756=>1000, - 22757=>1000,22758=>1000,22759=>1000,22760=>1000,22761=>1000,22762=>1000,22763=>1000,22764=>1000,22765=>1000,22766=>1000,22767=>1000,22768=>1000,22769=>1000,22770=>1000,22771=>1000,22772=>1000, - 22773=>1000,22774=>1000,22775=>1000,22776=>1000,22777=>1000,22778=>1000,22779=>1000,22780=>1000,22781=>1000,22782=>1000,22783=>1000,22784=>1000,22785=>1000,22786=>1000,22787=>1000,22788=>1000, - 22789=>1000,22790=>1000,22791=>1000,22792=>1000,22793=>1000,22794=>1000,22795=>1000,22796=>1000,22797=>1000,22798=>1000,22799=>1000,22800=>1000,22801=>1000,22802=>1000,22803=>1000,22804=>1000, - 22805=>1000,22806=>1000,22807=>1000,22808=>1000,22809=>1000,22810=>1000,22811=>1000,22812=>1000,22813=>1000,22814=>1000,22815=>1000,22816=>1000,22817=>1000,22818=>1000,22819=>1000,22820=>1000, - 22821=>1000,22822=>1000,22823=>1000,22824=>1000,22825=>1000,22826=>1000,22827=>1000,22828=>1000,22829=>1000,22830=>1000,22831=>1000,22832=>1000,22833=>1000,22834=>1000,22835=>1000,22836=>1000, - 22837=>1000,22838=>1000,22839=>1000,22840=>1000,22841=>1000,22842=>1000,22843=>1000,22844=>1000,22845=>1000,22846=>1000,22847=>1000,22848=>1000,22849=>1000,22850=>1000,22851=>1000,22852=>1000, - 22853=>1000,22854=>1000,22855=>1000,22856=>1000,22857=>1000,22858=>1000,22859=>1000,22860=>1000,22861=>1000,22862=>1000,22863=>1000,22864=>1000,22865=>1000,22866=>1000,22867=>1000,22868=>1000, - 22869=>1000,22870=>1000,22871=>1000,22872=>1000,22873=>1000,22874=>1000,22875=>1000,22876=>1000,22877=>1000,22878=>1000,22879=>1000,22880=>1000,22881=>1000,22882=>1000,22883=>1000,22884=>1000, - 22885=>1000,22886=>1000,22887=>1000,22888=>1000,22889=>1000,22890=>1000,22891=>1000,22892=>1000,22893=>1000,22894=>1000,22895=>1000,22896=>1000,22897=>1000,22898=>1000,22899=>1000,22900=>1000, - 22901=>1000,22902=>1000,22903=>1000,22904=>1000,22905=>1000,22906=>1000,22907=>1000,22908=>1000,22909=>1000,22910=>1000,22911=>1000,22912=>1000,22913=>1000,22914=>1000,22915=>1000,22916=>1000, - 22917=>1000,22918=>1000,22919=>1000,22920=>1000,22921=>1000,22922=>1000,22923=>1000,22924=>1000,22925=>1000,22926=>1000,22927=>1000,22928=>1000,22929=>1000,22930=>1000,22931=>1000,22932=>1000, - 22933=>1000,22934=>1000,22935=>1000,22936=>1000,22937=>1000,22938=>1000,22939=>1000,22940=>1000,22941=>1000,22942=>1000,22943=>1000,22944=>1000,22945=>1000,22946=>1000,22947=>1000,22948=>1000, - 22949=>1000,22950=>1000,22951=>1000,22952=>1000,22953=>1000,22954=>1000,22955=>1000,22956=>1000,22957=>1000,22958=>1000,22959=>1000,22960=>1000,22961=>1000,22962=>1000,22963=>1000,22964=>1000, - 22965=>1000,22966=>1000,22967=>1000,22968=>1000,22969=>1000,22970=>1000,22971=>1000,22972=>1000,22973=>1000,22974=>1000,22975=>1000,22976=>1000,22977=>1000,22978=>1000,22979=>1000,22980=>1000, - 22981=>1000,22982=>1000,22983=>1000,22984=>1000,22985=>1000,22986=>1000,22987=>1000,22988=>1000,22989=>1000,22990=>1000,22991=>1000,22992=>1000,22993=>1000,22994=>1000,22995=>1000,22996=>1000, - 22997=>1000,22998=>1000,22999=>1000,23000=>1000,23001=>1000,23002=>1000,23003=>1000,23004=>1000,23005=>1000,23006=>1000,23007=>1000,23008=>1000,23009=>1000,23010=>1000,23011=>1000,23012=>1000, - 23013=>1000,23014=>1000,23015=>1000,23016=>1000,23017=>1000,23018=>1000,23019=>1000,23020=>1000,23021=>1000,23022=>1000,23023=>1000,23024=>1000,23025=>1000,23026=>1000,23027=>1000,23028=>1000, - 23029=>1000,23030=>1000,23031=>1000,23032=>1000,23033=>1000,23034=>1000,23035=>1000,23036=>1000,23037=>1000,23038=>1000,23039=>1000,23040=>1000,23041=>1000,23042=>1000,23043=>1000,23044=>1000, - 23045=>1000,23046=>1000,23047=>1000,23048=>1000,23049=>1000,23050=>1000,23051=>1000,23052=>1000,23053=>1000,23054=>1000,23055=>1000,23056=>1000,23057=>1000,23058=>1000,23059=>1000,23060=>1000, - 23061=>1000,23062=>1000,23063=>1000,23064=>1000,23065=>1000,23066=>1000,23067=>1000,23068=>1000,23069=>1000,23070=>1000,23071=>1000,23072=>1000,23073=>1000,23074=>1000,23075=>1000,23076=>1000, - 23077=>1000,23078=>1000,23079=>1000,23080=>1000,23081=>1000,23082=>1000,23083=>1000,23084=>1000,23085=>1000,23086=>1000,23087=>1000,23088=>1000,23089=>1000,23090=>1000,23091=>1000,23092=>1000, - 23093=>1000,23094=>1000,23095=>1000,23096=>1000,23097=>1000,23098=>1000,23099=>1000,23100=>1000,23101=>1000,23102=>1000,23103=>1000,23104=>1000,23105=>1000,23106=>1000,23107=>1000,23108=>1000, - 23109=>1000,23110=>1000,23111=>1000,23112=>1000,23113=>1000,23114=>1000,23115=>1000,23116=>1000,23117=>1000,23118=>1000,23119=>1000,23120=>1000,23121=>1000,23122=>1000,23123=>1000,23124=>1000, - 23125=>1000,23126=>1000,23127=>1000,23128=>1000,23129=>1000,23130=>1000,23131=>1000,23132=>1000,23133=>1000,23134=>1000,23135=>1000,23136=>1000,23137=>1000,23138=>1000,23139=>1000,23140=>1000, - 23141=>1000,23142=>1000,23143=>1000,23144=>1000,23145=>1000,23146=>1000,23147=>1000,23148=>1000,23149=>1000,23150=>1000,23151=>1000,23152=>1000,23153=>1000,23154=>1000,23155=>1000,23156=>1000, - 23157=>1000,23158=>1000,23159=>1000,23160=>1000,23161=>1000,23162=>1000,23163=>1000,23164=>1000,23165=>1000,23166=>1000,23167=>1000,23168=>1000,23169=>1000,23170=>1000,23171=>1000,23172=>1000, - 23173=>1000,23174=>1000,23175=>1000,23176=>1000,23177=>1000,23178=>1000,23179=>1000,23180=>1000,23181=>1000,23182=>1000,23183=>1000,23184=>1000,23185=>1000,23186=>1000,23187=>1000,23188=>1000, - 23189=>1000,23190=>1000,23191=>1000,23192=>1000,23193=>1000,23194=>1000,23195=>1000,23196=>1000,23197=>1000,23198=>1000,23199=>1000,23200=>1000,23201=>1000,23202=>1000,23203=>1000,23204=>1000, - 23205=>1000,23206=>1000,23207=>1000,23208=>1000,23209=>1000,23210=>1000,23211=>1000,23212=>1000,23213=>1000,23214=>1000,23215=>1000,23216=>1000,23217=>1000,23218=>1000,23219=>1000,23220=>1000, - 23221=>1000,23222=>1000,23223=>1000,23224=>1000,23225=>1000,23226=>1000,23227=>1000,23228=>1000,23229=>1000,23230=>1000,23231=>1000,23232=>1000,23233=>1000,23234=>1000,23235=>1000,23236=>1000, - 23237=>1000,23238=>1000,23239=>1000,23240=>1000,23241=>1000,23242=>1000,23243=>1000,23244=>1000,23245=>1000,23246=>1000,23247=>1000,23248=>1000,23249=>1000,23250=>1000,23251=>1000,23252=>1000, - 23253=>1000,23254=>1000,23255=>1000,23256=>1000,23257=>1000,23258=>1000,23259=>1000,23260=>1000,23261=>1000,23262=>1000,23263=>1000,23264=>1000,23265=>1000,23266=>1000,23267=>1000,23268=>1000, - 23269=>1000,23270=>1000,23271=>1000,23272=>1000,23273=>1000,23274=>1000,23275=>1000,23276=>1000,23277=>1000,23278=>1000,23279=>1000,23280=>1000,23281=>1000,23282=>1000,23283=>1000,23284=>1000, - 23285=>1000,23286=>1000,23287=>1000,23288=>1000,23289=>1000,23290=>1000,23291=>1000,23292=>1000,23293=>1000,23294=>1000,23295=>1000,23296=>1000,23297=>1000,23298=>1000,23299=>1000,23300=>1000, - 23301=>1000,23302=>1000,23303=>1000,23304=>1000,23305=>1000,23306=>1000,23307=>1000,23308=>1000,23309=>1000,23310=>1000,23311=>1000,23312=>1000,23313=>1000,23314=>1000,23315=>1000,23316=>1000, - 23317=>1000,23318=>1000,23319=>1000,23320=>1000,23321=>1000,23322=>1000,23323=>1000,23324=>1000,23325=>1000,23326=>1000,23327=>1000,23328=>1000,23329=>1000,23330=>1000,23331=>1000,23332=>1000, - 23333=>1000,23334=>1000,23335=>1000,23336=>1000,23337=>1000,23338=>1000,23339=>1000,23340=>1000,23341=>1000,23342=>1000,23343=>1000,23344=>1000,23345=>1000,23346=>1000,23347=>1000,23348=>1000, - 23349=>1000,23350=>1000,23351=>1000,23352=>1000,23353=>1000,23354=>1000,23355=>1000,23356=>1000,23357=>1000,23358=>1000,23359=>1000,23360=>1000,23361=>1000,23362=>1000,23363=>1000,23364=>1000, - 23365=>1000,23366=>1000,23367=>1000,23368=>1000,23369=>1000,23370=>1000,23371=>1000,23372=>1000,23373=>1000,23374=>1000,23375=>1000,23376=>1000,23377=>1000,23378=>1000,23379=>1000,23380=>1000, - 23381=>1000,23382=>1000,23383=>1000,23384=>1000,23385=>1000,23386=>1000,23387=>1000,23388=>1000,23389=>1000,23390=>1000,23391=>1000,23392=>1000,23393=>1000,23394=>1000,23395=>1000,23396=>1000, - 23397=>1000,23398=>1000,23399=>1000,23400=>1000,23401=>1000,23402=>1000,23403=>1000,23404=>1000,23405=>1000,23406=>1000,23407=>1000,23408=>1000,23409=>1000,23410=>1000,23411=>1000,23412=>1000, - 23413=>1000,23414=>1000,23415=>1000,23416=>1000,23417=>1000,23418=>1000,23419=>1000,23420=>1000,23421=>1000,23422=>1000,23423=>1000,23424=>1000,23425=>1000,23426=>1000,23427=>1000,23428=>1000, - 23429=>1000,23430=>1000,23431=>1000,23432=>1000,23433=>1000,23434=>1000,23435=>1000,23436=>1000,23437=>1000,23438=>1000,23439=>1000,23440=>1000,23441=>1000,23442=>1000,23443=>1000,23444=>1000, - 23445=>1000,23446=>1000,23447=>1000,23448=>1000,23449=>1000,23450=>1000,23451=>1000,23452=>1000,23453=>1000,23454=>1000,23455=>1000,23456=>1000,23457=>1000,23458=>1000,23459=>1000,23460=>1000, - 23461=>1000,23462=>1000,23463=>1000,23464=>1000,23465=>1000,23466=>1000,23467=>1000,23468=>1000,23469=>1000,23470=>1000,23471=>1000,23472=>1000,23473=>1000,23474=>1000,23475=>1000,23476=>1000, - 23477=>1000,23478=>1000,23479=>1000,23480=>1000,23481=>1000,23482=>1000,23483=>1000,23484=>1000,23485=>1000,23486=>1000,23487=>1000,23488=>1000,23489=>1000,23490=>1000,23491=>1000,23492=>1000, - 23493=>1000,23494=>1000,23495=>1000,23496=>1000,23497=>1000,23498=>1000,23499=>1000,23500=>1000,23501=>1000,23502=>1000,23503=>1000,23504=>1000,23505=>1000,23506=>1000,23507=>1000,23508=>1000, - 23509=>1000,23510=>1000,23511=>1000,23512=>1000,23513=>1000,23514=>1000,23515=>1000,23516=>1000,23517=>1000,23518=>1000,23519=>1000,23520=>1000,23521=>1000,23522=>1000,23523=>1000,23524=>1000, - 23525=>1000,23526=>1000,23527=>1000,23528=>1000,23529=>1000,23530=>1000,23531=>1000,23532=>1000,23533=>1000,23534=>1000,23535=>1000,23536=>1000,23537=>1000,23538=>1000,23539=>1000,23540=>1000, - 23541=>1000,23542=>1000,23543=>1000,23544=>1000,23545=>1000,23546=>1000,23547=>1000,23548=>1000,23549=>1000,23550=>1000,23551=>1000,23552=>1000,23553=>1000,23554=>1000,23555=>1000,23556=>1000, - 23557=>1000,23558=>1000,23559=>1000,23560=>1000,23561=>1000,23562=>1000,23563=>1000,23564=>1000,23565=>1000,23566=>1000,23567=>1000,23568=>1000,23569=>1000,23570=>1000,23571=>1000,23572=>1000, - 23573=>1000,23574=>1000,23575=>1000,23576=>1000,23577=>1000,23578=>1000,23579=>1000,23580=>1000,23581=>1000,23582=>1000,23583=>1000,23584=>1000,23585=>1000,23586=>1000,23587=>1000,23588=>1000, - 23589=>1000,23590=>1000,23591=>1000,23592=>1000,23593=>1000,23594=>1000,23595=>1000,23596=>1000,23597=>1000,23598=>1000,23599=>1000,23600=>1000,23601=>1000,23602=>1000,23603=>1000,23604=>1000, - 23605=>1000,23606=>1000,23607=>1000,23608=>1000,23609=>1000,23610=>1000,23611=>1000,23612=>1000,23613=>1000,23614=>1000,23615=>1000,23616=>1000,23617=>1000,23618=>1000,23619=>1000,23620=>1000, - 23621=>1000,23622=>1000,23623=>1000,23624=>1000,23625=>1000,23626=>1000,23627=>1000,23628=>1000,23629=>1000,23630=>1000,23631=>1000,23632=>1000,23633=>1000,23634=>1000,23635=>1000,23636=>1000, - 23637=>1000,23638=>1000,23639=>1000,23640=>1000,23641=>1000,23642=>1000,23643=>1000,23644=>1000,23645=>1000,23646=>1000,23647=>1000,23648=>1000,23649=>1000,23650=>1000,23651=>1000,23652=>1000, - 23653=>1000,23654=>1000,23655=>1000,23656=>1000,23657=>1000,23658=>1000,23659=>1000,23660=>1000,23661=>1000,23662=>1000,23663=>1000,23664=>1000,23665=>1000,23666=>1000,23667=>1000,23668=>1000, - 23669=>1000,23670=>1000,23671=>1000,23672=>1000,23673=>1000,23674=>1000,23675=>1000,23676=>1000,23677=>1000,23678=>1000,23679=>1000,23680=>1000,23681=>1000,23682=>1000,23683=>1000,23684=>1000, - 23685=>1000,23686=>1000,23687=>1000,23688=>1000,23689=>1000,23690=>1000,23691=>1000,23692=>1000,23693=>1000,23694=>1000,23695=>1000,23696=>1000,23697=>1000,23698=>1000,23699=>1000,23700=>1000, - 23701=>1000,23702=>1000,23703=>1000,23704=>1000,23705=>1000,23706=>1000,23707=>1000,23708=>1000,23709=>1000,23710=>1000,23711=>1000,23712=>1000,23713=>1000,23714=>1000,23715=>1000,23716=>1000, - 23717=>1000,23718=>1000,23719=>1000,23720=>1000,23721=>1000,23722=>1000,23723=>1000,23724=>1000,23725=>1000,23726=>1000,23727=>1000,23728=>1000,23729=>1000,23730=>1000,23731=>1000,23732=>1000, - 23733=>1000,23734=>1000,23735=>1000,23736=>1000,23737=>1000,23738=>1000,23739=>1000,23740=>1000,23741=>1000,23742=>1000,23743=>1000,23744=>1000,23745=>1000,23746=>1000,23747=>1000,23748=>1000, - 23749=>1000,23750=>1000,23751=>1000,23752=>1000,23753=>1000,23754=>1000,23755=>1000,23756=>1000,23757=>1000,23758=>1000,23759=>1000,23760=>1000,23761=>1000,23762=>1000,23763=>1000,23764=>1000, - 23765=>1000,23766=>1000,23767=>1000,23768=>1000,23769=>1000,23770=>1000,23771=>1000,23772=>1000,23773=>1000,23774=>1000,23775=>1000,23776=>1000,23777=>1000,23778=>1000,23779=>1000,23780=>1000, - 23781=>1000,23782=>1000,23783=>1000,23784=>1000,23785=>1000,23786=>1000,23787=>1000,23788=>1000,23789=>1000,23790=>1000,23791=>1000,23792=>1000,23793=>1000,23794=>1000,23795=>1000,23796=>1000, - 23797=>1000,23798=>1000,23799=>1000,23800=>1000,23801=>1000,23802=>1000,23803=>1000,23804=>1000,23805=>1000,23806=>1000,23807=>1000,23808=>1000,23809=>1000,23810=>1000,23811=>1000,23812=>1000, - 23813=>1000,23814=>1000,23815=>1000,23816=>1000,23817=>1000,23818=>1000,23819=>1000,23820=>1000,23821=>1000,23822=>1000,23823=>1000,23824=>1000,23825=>1000,23826=>1000,23827=>1000,23828=>1000, - 23829=>1000,23830=>1000,23831=>1000,23832=>1000,23833=>1000,23834=>1000,23835=>1000,23836=>1000,23837=>1000,23838=>1000,23839=>1000,23840=>1000,23841=>1000,23842=>1000,23843=>1000,23844=>1000, - 23845=>1000,23846=>1000,23847=>1000,23848=>1000,23849=>1000,23850=>1000,23851=>1000,23852=>1000,23853=>1000,23854=>1000,23855=>1000,23856=>1000,23857=>1000,23858=>1000,23859=>1000,23860=>1000, - 23861=>1000,23862=>1000,23863=>1000,23864=>1000,23865=>1000,23866=>1000,23867=>1000,23868=>1000,23869=>1000,23870=>1000,23871=>1000,23872=>1000,23873=>1000,23874=>1000,23875=>1000,23876=>1000, - 23877=>1000,23878=>1000,23879=>1000,23880=>1000,23881=>1000,23882=>1000,23883=>1000,23884=>1000,23885=>1000,23886=>1000,23887=>1000,23888=>1000,23889=>1000,23890=>1000,23891=>1000,23892=>1000, - 23893=>1000,23894=>1000,23895=>1000,23896=>1000,23897=>1000,23898=>1000,23899=>1000,23900=>1000,23901=>1000,23902=>1000,23903=>1000,23904=>1000,23905=>1000,23906=>1000,23907=>1000,23908=>1000, - 23909=>1000,23910=>1000,23911=>1000,23912=>1000,23913=>1000,23914=>1000,23915=>1000,23916=>1000,23917=>1000,23918=>1000,23919=>1000,23920=>1000,23921=>1000,23922=>1000,23923=>1000,23924=>1000, - 23925=>1000,23926=>1000,23927=>1000,23928=>1000,23929=>1000,23930=>1000,23931=>1000,23932=>1000,23933=>1000,23934=>1000,23935=>1000,23936=>1000,23937=>1000,23938=>1000,23939=>1000,23940=>1000, - 23941=>1000,23942=>1000,23943=>1000,23944=>1000,23945=>1000,23946=>1000,23947=>1000,23948=>1000,23949=>1000,23950=>1000,23951=>1000,23952=>1000,23953=>1000,23954=>1000,23955=>1000,23956=>1000, - 23957=>1000,23958=>1000,23959=>1000,23960=>1000,23961=>1000,23962=>1000,23963=>1000,23964=>1000,23965=>1000,23966=>1000,23967=>1000,23968=>1000,23969=>1000,23970=>1000,23971=>1000,23972=>1000, - 23973=>1000,23974=>1000,23975=>1000,23976=>1000,23977=>1000,23978=>1000,23979=>1000,23980=>1000,23981=>1000,23982=>1000,23983=>1000,23984=>1000,23985=>1000,23986=>1000,23987=>1000,23988=>1000, - 23989=>1000,23990=>1000,23991=>1000,23992=>1000,23993=>1000,23994=>1000,23995=>1000,23996=>1000,23997=>1000,23998=>1000,23999=>1000,24000=>1000,24001=>1000,24002=>1000,24003=>1000,24004=>1000, - 24005=>1000,24006=>1000,24007=>1000,24008=>1000,24009=>1000,24010=>1000,24011=>1000,24012=>1000,24013=>1000,24014=>1000,24015=>1000,24016=>1000,24017=>1000,24018=>1000,24019=>1000,24020=>1000, - 24021=>1000,24022=>1000,24023=>1000,24024=>1000,24025=>1000,24026=>1000,24027=>1000,24028=>1000,24029=>1000,24030=>1000,24031=>1000,24032=>1000,24033=>1000,24034=>1000,24035=>1000,24036=>1000, - 24037=>1000,24038=>1000,24039=>1000,24040=>1000,24041=>1000,24042=>1000,24043=>1000,24044=>1000,24045=>1000,24046=>1000,24047=>1000,24048=>1000,24049=>1000,24050=>1000,24051=>1000,24052=>1000, - 24053=>1000,24054=>1000,24055=>1000,24056=>1000,24057=>1000,24058=>1000,24059=>1000,24060=>1000,24061=>1000,24062=>1000,24063=>1000,24064=>1000,24065=>1000,24066=>1000,24067=>1000,24068=>1000, - 24069=>1000,24070=>1000,24071=>1000,24072=>1000,24073=>1000,24074=>1000,24075=>1000,24076=>1000,24077=>1000,24078=>1000,24079=>1000,24080=>1000,24081=>1000,24082=>1000,24083=>1000,24084=>1000, - 24085=>1000,24086=>1000,24087=>1000,24088=>1000,24089=>1000,24090=>1000,24091=>1000,24092=>1000,24093=>1000,24094=>1000,24095=>1000,24096=>1000,24097=>1000,24098=>1000,24099=>1000,24100=>1000, - 24101=>1000,24102=>1000,24103=>1000,24104=>1000,24105=>1000,24106=>1000,24107=>1000,24108=>1000,24109=>1000,24110=>1000,24111=>1000,24112=>1000,24113=>1000,24114=>1000,24115=>1000,24116=>1000, - 24117=>1000,24118=>1000,24119=>1000,24120=>1000,24121=>1000,24122=>1000,24123=>1000,24124=>1000,24125=>1000,24126=>1000,24127=>1000,24128=>1000,24129=>1000,24130=>1000,24131=>1000,24132=>1000, - 24133=>1000,24134=>1000,24135=>1000,24136=>1000,24137=>1000,24138=>1000,24139=>1000,24140=>1000,24141=>1000,24142=>1000,24143=>1000,24144=>1000,24145=>1000,24146=>1000,24147=>1000,24148=>1000, - 24149=>1000,24150=>1000,24151=>1000,24152=>1000,24153=>1000,24154=>1000,24155=>1000,24156=>1000,24157=>1000,24158=>1000,24159=>1000,24160=>1000,24161=>1000,24162=>1000,24163=>1000,24164=>1000, - 24165=>1000,24166=>1000,24167=>1000,24168=>1000,24169=>1000,24170=>1000,24171=>1000,24172=>1000,24173=>1000,24174=>1000,24175=>1000,24176=>1000,24177=>1000,24178=>1000,24179=>1000,24180=>1000, - 24181=>1000,24182=>1000,24183=>1000,24184=>1000,24185=>1000,24186=>1000,24187=>1000,24188=>1000,24189=>1000,24190=>1000,24191=>1000,24192=>1000,24193=>1000,24194=>1000,24195=>1000,24196=>1000, - 24197=>1000,24198=>1000,24199=>1000,24200=>1000,24201=>1000,24202=>1000,24203=>1000,24204=>1000,24205=>1000,24206=>1000,24207=>1000,24208=>1000,24209=>1000,24210=>1000,24211=>1000,24212=>1000, - 24213=>1000,24214=>1000,24215=>1000,24216=>1000,24217=>1000,24218=>1000,24219=>1000,24220=>1000,24221=>1000,24222=>1000,24223=>1000,24224=>1000,24225=>1000,24226=>1000,24227=>1000,24228=>1000, - 24229=>1000,24230=>1000,24231=>1000,24232=>1000,24233=>1000,24234=>1000,24235=>1000,24236=>1000,24237=>1000,24238=>1000,24239=>1000,24240=>1000,24241=>1000,24242=>1000,24243=>1000,24244=>1000, - 24245=>1000,24246=>1000,24247=>1000,24248=>1000,24249=>1000,24250=>1000,24251=>1000,24252=>1000,24253=>1000,24254=>1000,24255=>1000,24256=>1000,24257=>1000,24258=>1000,24259=>1000,24260=>1000, - 24261=>1000,24262=>1000,24263=>1000,24264=>1000,24265=>1000,24266=>1000,24267=>1000,24268=>1000,24269=>1000,24270=>1000,24271=>1000,24272=>1000,24273=>1000,24274=>1000,24275=>1000,24276=>1000, - 24277=>1000,24278=>1000,24279=>1000,24280=>1000,24281=>1000,24282=>1000,24283=>1000,24284=>1000,24285=>1000,24286=>1000,24287=>1000,24288=>1000,24289=>1000,24290=>1000,24291=>1000,24292=>1000, - 24293=>1000,24294=>1000,24295=>1000,24296=>1000,24297=>1000,24298=>1000,24299=>1000,24300=>1000,24301=>1000,24302=>1000,24303=>1000,24304=>1000,24305=>1000,24306=>1000,24307=>1000,24308=>1000, - 24309=>1000,24310=>1000,24311=>1000,24312=>1000,24313=>1000,24314=>1000,24315=>1000,24316=>1000,24317=>1000,24318=>1000,24319=>1000,24320=>1000,24321=>1000,24322=>1000,24323=>1000,24324=>1000, - 24325=>1000,24326=>1000,24327=>1000,24328=>1000,24329=>1000,24330=>1000,24331=>1000,24332=>1000,24333=>1000,24334=>1000,24335=>1000,24336=>1000,24337=>1000,24338=>1000,24339=>1000,24340=>1000, - 24341=>1000,24342=>1000,24343=>1000,24344=>1000,24345=>1000,24346=>1000,24347=>1000,24348=>1000,24349=>1000,24350=>1000,24351=>1000,24352=>1000,24353=>1000,24354=>1000,24355=>1000,24356=>1000, - 24357=>1000,24358=>1000,24359=>1000,24360=>1000,24361=>1000,24362=>1000,24363=>1000,24364=>1000,24365=>1000,24366=>1000,24367=>1000,24368=>1000,24369=>1000,24370=>1000,24371=>1000,24372=>1000, - 24373=>1000,24374=>1000,24375=>1000,24376=>1000,24377=>1000,24378=>1000,24379=>1000,24380=>1000,24381=>1000,24382=>1000,24383=>1000,24384=>1000,24385=>1000,24386=>1000,24387=>1000,24388=>1000, - 24389=>1000,24390=>1000,24391=>1000,24392=>1000,24393=>1000,24394=>1000,24395=>1000,24396=>1000,24397=>1000,24398=>1000,24399=>1000,24400=>1000,24401=>1000,24402=>1000,24403=>1000,24404=>1000, - 24405=>1000,24406=>1000,24407=>1000,24408=>1000,24409=>1000,24410=>1000,24411=>1000,24412=>1000,24413=>1000,24414=>1000,24415=>1000,24416=>1000,24417=>1000,24418=>1000,24419=>1000,24420=>1000, - 24421=>1000,24422=>1000,24423=>1000,24424=>1000,24425=>1000,24426=>1000,24427=>1000,24428=>1000,24429=>1000,24430=>1000,24431=>1000,24432=>1000,24433=>1000,24434=>1000,24435=>1000,24436=>1000, - 24437=>1000,24438=>1000,24439=>1000,24440=>1000,24441=>1000,24442=>1000,24443=>1000,24444=>1000,24445=>1000,24446=>1000,24447=>1000,24448=>1000,24449=>1000,24450=>1000,24451=>1000,24452=>1000, - 24453=>1000,24454=>1000,24455=>1000,24456=>1000,24457=>1000,24458=>1000,24459=>1000,24460=>1000,24461=>1000,24462=>1000,24463=>1000,24464=>1000,24465=>1000,24466=>1000,24467=>1000,24468=>1000, - 24469=>1000,24470=>1000,24471=>1000,24472=>1000,24473=>1000,24474=>1000,24475=>1000,24476=>1000,24477=>1000,24478=>1000,24479=>1000,24480=>1000,24481=>1000,24482=>1000,24483=>1000,24484=>1000, - 24485=>1000,24486=>1000,24487=>1000,24488=>1000,24489=>1000,24490=>1000,24491=>1000,24492=>1000,24493=>1000,24494=>1000,24495=>1000,24496=>1000,24497=>1000,24498=>1000,24499=>1000,24500=>1000, - 24501=>1000,24502=>1000,24503=>1000,24504=>1000,24505=>1000,24506=>1000,24507=>1000,24508=>1000,24509=>1000,24510=>1000,24511=>1000,24512=>1000,24513=>1000,24514=>1000,24515=>1000,24516=>1000, - 24517=>1000,24518=>1000,24519=>1000,24520=>1000,24521=>1000,24522=>1000,24523=>1000,24524=>1000,24525=>1000,24526=>1000,24527=>1000,24528=>1000,24529=>1000,24530=>1000,24531=>1000,24532=>1000, - 24533=>1000,24534=>1000,24535=>1000,24536=>1000,24537=>1000,24538=>1000,24539=>1000,24540=>1000,24541=>1000,24542=>1000,24543=>1000,24544=>1000,24545=>1000,24546=>1000,24547=>1000,24548=>1000, - 24549=>1000,24550=>1000,24551=>1000,24552=>1000,24553=>1000,24554=>1000,24555=>1000,24556=>1000,24557=>1000,24558=>1000,24559=>1000,24560=>1000,24561=>1000,24562=>1000,24563=>1000,24564=>1000, - 24565=>1000,24566=>1000,24567=>1000,24568=>1000,24569=>1000,24570=>1000,24571=>1000,24572=>1000,24573=>1000,24574=>1000,24575=>1000,24576=>1000,24577=>1000,24578=>1000,24579=>1000,24580=>1000, - 24581=>1000,24582=>1000,24583=>1000,24584=>1000,24585=>1000,24586=>1000,24587=>1000,24588=>1000,24589=>1000,24590=>1000,24591=>1000,24592=>1000,24593=>1000,24594=>1000,24595=>1000,24596=>1000, - 24597=>1000,24598=>1000,24599=>1000,24600=>1000,24601=>1000,24602=>1000,24603=>1000,24604=>1000,24605=>1000,24606=>1000,24607=>1000,24608=>1000,24609=>1000,24610=>1000,24611=>1000,24612=>1000, - 24613=>1000,24614=>1000,24615=>1000,24616=>1000,24617=>1000,24618=>1000,24619=>1000,24620=>1000,24621=>1000,24622=>1000,24623=>1000,24624=>1000,24625=>1000,24626=>1000,24627=>1000,24628=>1000, - 24629=>1000,24630=>1000,24631=>1000,24632=>1000,24633=>1000,24634=>1000,24635=>1000,24636=>1000,24637=>1000,24638=>1000,24639=>1000,24640=>1000,24641=>1000,24642=>1000,24643=>1000,24644=>1000, - 24645=>1000,24646=>1000,24647=>1000,24648=>1000,24649=>1000,24650=>1000,24651=>1000,24652=>1000,24653=>1000,24654=>1000,24655=>1000,24656=>1000,24657=>1000,24658=>1000,24659=>1000,24660=>1000, - 24661=>1000,24662=>1000,24663=>1000,24664=>1000,24665=>1000,24666=>1000,24667=>1000,24668=>1000,24669=>1000,24670=>1000,24671=>1000,24672=>1000,24673=>1000,24674=>1000,24675=>1000,24676=>1000, - 24677=>1000,24678=>1000,24679=>1000,24680=>1000,24681=>1000,24682=>1000,24683=>1000,24684=>1000,24685=>1000,24686=>1000,24687=>1000,24688=>1000,24689=>1000,24690=>1000,24691=>1000,24692=>1000, - 24693=>1000,24694=>1000,24695=>1000,24696=>1000,24697=>1000,24698=>1000,24699=>1000,24700=>1000,24701=>1000,24702=>1000,24703=>1000,24704=>1000,24705=>1000,24706=>1000,24707=>1000,24708=>1000, - - 24709=>1000,24710=>1000,24711=>1000,24712=>1000,24713=>1000,24714=>1000,24715=>1000,24716=>1000,24717=>1000,24718=>1000,24719=>1000,24720=>1000,24721=>1000,24722=>1000,24723=>1000,24724=>1000, - 24725=>1000,24726=>1000,24727=>1000,24728=>1000,24729=>1000,24730=>1000,24731=>1000,24732=>1000,24733=>1000,24734=>1000,24735=>1000,24736=>1000,24737=>1000,24738=>1000,24739=>1000,24740=>1000, - 24741=>1000,24742=>1000,24743=>1000,24744=>1000,24745=>1000,24746=>1000,24747=>1000,24748=>1000,24749=>1000,24750=>1000,24751=>1000,24752=>1000,24753=>1000,24754=>1000,24755=>1000,24756=>1000, - 24757=>1000,24758=>1000,24759=>1000,24760=>1000,24761=>1000,24762=>1000,24763=>1000,24764=>1000,24765=>1000,24766=>1000,24767=>1000,24768=>1000,24769=>1000,24770=>1000,24771=>1000,24772=>1000, - 24773=>1000,24774=>1000,24775=>1000,24776=>1000,24777=>1000,24778=>1000,24779=>1000,24780=>1000,24781=>1000,24782=>1000,24783=>1000,24784=>1000,24785=>1000,24786=>1000,24787=>1000,24788=>1000, - 24789=>1000,24790=>1000,24791=>1000,24792=>1000,24793=>1000,24794=>1000,24795=>1000,24796=>1000,24797=>1000,24798=>1000,24799=>1000,24800=>1000,24801=>1000,24802=>1000,24803=>1000,24804=>1000, - 24805=>1000,24806=>1000,24807=>1000,24808=>1000,24809=>1000,24810=>1000,24811=>1000,24812=>1000,24813=>1000,24814=>1000,24815=>1000,24816=>1000,24817=>1000,24818=>1000,24819=>1000,24820=>1000, - 24821=>1000,24822=>1000,24823=>1000,24824=>1000,24825=>1000,24826=>1000,24827=>1000,24828=>1000,24829=>1000,24830=>1000,24831=>1000,24832=>1000,24833=>1000,24834=>1000,24835=>1000,24836=>1000, - 24837=>1000,24838=>1000,24839=>1000,24840=>1000,24841=>1000,24842=>1000,24843=>1000,24844=>1000,24845=>1000,24846=>1000,24847=>1000,24848=>1000,24849=>1000,24850=>1000,24851=>1000,24852=>1000, - 24853=>1000,24854=>1000,24855=>1000,24856=>1000,24857=>1000,24858=>1000,24859=>1000,24860=>1000,24861=>1000,24862=>1000,24863=>1000,24864=>1000,24865=>1000,24866=>1000,24867=>1000,24868=>1000, - 24869=>1000,24870=>1000,24871=>1000,24872=>1000,24873=>1000,24874=>1000,24875=>1000,24876=>1000,24877=>1000,24878=>1000,24879=>1000,24880=>1000,24881=>1000,24882=>1000,24883=>1000,24884=>1000, - 24885=>1000,24886=>1000,24887=>1000,24888=>1000,24889=>1000,24890=>1000,24891=>1000,24892=>1000,24893=>1000,24894=>1000,24895=>1000,24896=>1000,24897=>1000,24898=>1000,24899=>1000,24900=>1000, - 24901=>1000,24902=>1000,24903=>1000,24904=>1000,24905=>1000,24906=>1000,24907=>1000,24908=>1000,24909=>1000,24910=>1000,24911=>1000,24912=>1000,24913=>1000,24914=>1000,24915=>1000,24916=>1000, - 24917=>1000,24918=>1000,24919=>1000,24920=>1000,24921=>1000,24922=>1000,24923=>1000,24924=>1000,24925=>1000,24926=>1000,24927=>1000,24928=>1000,24929=>1000,24930=>1000,24931=>1000,24932=>1000, - 24933=>1000,24934=>1000,24935=>1000,24936=>1000,24937=>1000,24938=>1000,24939=>1000,24940=>1000,24941=>1000,24942=>1000,24943=>1000,24944=>1000,24945=>1000,24946=>1000,24947=>1000,24948=>1000, - 24949=>1000,24950=>1000,24951=>1000,24952=>1000,24953=>1000,24954=>1000,24955=>1000,24956=>1000,24957=>1000,24958=>1000,24959=>1000,24960=>1000,24961=>1001,24962=>1000,24963=>1000,24964=>1000, - 24965=>1000,24966=>1000,24967=>1000,24968=>1000,24969=>1000,24970=>1000,24971=>1000,24972=>1000,24973=>1000,24974=>1000,24975=>1000,24976=>1000,24977=>1000,24978=>1000,24979=>1000,24980=>1000, - 24981=>1000,24982=>1000,24983=>1000,24984=>1000,24985=>1000,24986=>1000,24987=>1000,24988=>1000,24989=>1000,24990=>1000,24991=>1000,24992=>1000,24993=>1000,24994=>1000,24995=>1000,24996=>1000, - 24997=>1000,24998=>1000,24999=>1000,25000=>1000,25001=>1000,25002=>1000,25003=>1000,25004=>1000,25005=>1000,25006=>1000,25007=>1000,25008=>1000,25009=>1000,25010=>1000,25011=>1000,25012=>1000, - 25013=>1000,25014=>1000,25015=>1000,25016=>1000,25017=>1000,25018=>1000,25019=>1000,25020=>1000,25021=>1000,25022=>1000,25023=>1000,25024=>1000,25025=>1000,25026=>1000,25027=>1000,25028=>1000, - 25029=>1000,25030=>1000,25031=>1000,25032=>1000,25033=>1000,25034=>1000,25035=>1000,25036=>1000,25037=>1000,25038=>1000,25039=>1000,25040=>1000,25041=>1000,25042=>1000,25043=>1000,25044=>1000, - 25045=>1000,25046=>1000,25047=>1000,25048=>1000,25049=>1000,25050=>1000,25051=>1000,25052=>1000,25053=>1000,25054=>1000,25055=>1000,25056=>1000,25057=>1000,25058=>1000,25059=>1000,25060=>1000, - 25061=>1000,25062=>1000,25063=>1000,25064=>1000,25065=>1000,25066=>1000,25067=>1000,25068=>1000,25069=>1000,25070=>1000,25071=>1000,25072=>1000,25073=>1000,25074=>1000,25075=>1000,25076=>1000, - 25077=>1000,25078=>1000,25079=>1000,25080=>1000,25081=>1000,25082=>1000,25083=>1000,25084=>1000,25085=>1000,25086=>1000,25087=>1000,25088=>1000,25089=>1000,25090=>1000,25091=>1000,25092=>1000, - 25093=>1000,25094=>1000,25095=>1000,25096=>1000,25097=>1000,25098=>1000,25099=>1000,25100=>1000,25101=>1000,25102=>1000,25103=>1000,25104=>1000,25105=>1000,25106=>1000,25107=>1000,25108=>1000, - 25109=>1000,25110=>1000,25111=>1000,25112=>1000,25113=>1000,25114=>1000,25115=>1000,25116=>1000,25117=>1000,25118=>1000,25119=>1000,25120=>1000,25121=>1000,25122=>1000,25123=>1000,25124=>1000, - 25125=>1000,25126=>1000,25127=>1000,25128=>1000,25129=>1000,25130=>1000,25131=>1000,25132=>1000,25133=>1000,25134=>1000,25135=>1000,25136=>1000,25137=>1000,25138=>1000,25139=>1000,25140=>1000, - 25141=>1000,25142=>1000,25143=>1000,25144=>1000,25145=>1000,25146=>1000,25147=>1000,25148=>1000,25149=>1000,25150=>1000,25151=>1000,25152=>1000,25153=>1000,25154=>1000,25155=>1000,25156=>1000, - 25157=>1000,25158=>1000,25159=>1000,25160=>1000,25161=>1000,25162=>1000,25163=>1000,25164=>1000,25165=>1000,25166=>1000,25167=>1000,25168=>1000,25169=>1000,25170=>1000,25171=>1000,25172=>1000, - 25173=>1000,25174=>1000,25175=>1000,25176=>1000,25177=>1000,25178=>1000,25179=>1000,25180=>1000,25181=>1000,25182=>1000,25183=>1000,25184=>1000,25185=>1000,25186=>1000,25187=>1000,25188=>1000, - 25189=>1000,25190=>1000,25191=>1000,25192=>1000,25193=>1000,25194=>1000,25195=>1000,25196=>1000,25197=>1000,25198=>1000,25199=>1000,25200=>1000,25201=>1000,25202=>1000,25203=>1000,25204=>1000, - 25205=>1000,25206=>1000,25207=>1000,25208=>1000,25209=>1000,25210=>1000,25211=>1000,25212=>1000,25213=>1000,25214=>1000,25215=>1000,25216=>1000,25217=>1000,25218=>1000,25219=>1000,25220=>1000, - 25221=>1000,25222=>1000,25223=>1000,25224=>1000,25225=>1000,25226=>1000,25227=>1000,25228=>1000,25229=>1000,25230=>1000,25231=>1000,25232=>1000,25233=>1000,25234=>1000,25235=>1000,25236=>1000, - 25237=>1000,25238=>1000,25239=>1000,25240=>1000,25241=>1000,25242=>1000,25243=>1000,25244=>1000,25245=>1000,25246=>1000,25247=>1000,25248=>1000,25249=>1000,25250=>1000,25251=>1000,25252=>1000, - 25253=>1000,25254=>1000,25255=>1000,25256=>1000,25257=>1000,25258=>1000,25259=>1000,25260=>1000,25261=>1000,25262=>1000,25263=>1000,25264=>1000,25265=>1000,25266=>1000,25267=>1000,25268=>1000, - 25269=>1000,25270=>1000,25271=>1000,25272=>1000,25273=>1000,25274=>1000,25275=>1000,25276=>1000,25277=>1000,25278=>1000,25279=>1000,25280=>1000,25281=>1000,25282=>1000,25283=>1000,25284=>1000, - 25285=>1000,25286=>1000,25287=>1000,25288=>1000,25289=>1000,25290=>1000,25291=>1000,25292=>1000,25293=>1000,25294=>1000,25295=>1000,25296=>1000,25297=>1000,25298=>1000,25299=>1000,25300=>1000, - 25301=>1000,25302=>1000,25303=>1000,25304=>1000,25305=>1000,25306=>1000,25307=>1000,25308=>1000,25309=>1000,25310=>1000,25311=>1000,25312=>1000,25313=>1000,25314=>1000,25315=>1000,25316=>1000, - 25317=>1000,25318=>1000,25319=>1000,25320=>1000,25321=>1000,25322=>1000,25323=>1000,25324=>1000,25325=>1000,25326=>1000,25327=>1000,25328=>1000,25329=>1000,25330=>1000,25331=>1000,25332=>1000, - 25333=>1000,25334=>1000,25335=>1000,25336=>1000,25337=>1000,25338=>1000,25339=>1000,25340=>1000,25341=>1000,25342=>1000,25343=>1000,25344=>1000,25345=>1000,25346=>1000,25347=>1000,25348=>1000, - 25349=>1000,25350=>1000,25351=>1000,25352=>1000,25353=>1000,25354=>1000,25355=>1000,25356=>1000,25357=>1000,25358=>1000,25359=>1000,25360=>1000,25361=>1000,25362=>1000,25363=>1000,25364=>1000, - 25365=>1000,25366=>1000,25367=>1000,25368=>1000,25369=>1000,25370=>1000,25371=>1000,25372=>1000,25373=>1000,25374=>1000,25375=>1000,25376=>1000,25377=>1000,25378=>1000,25379=>1000,25380=>1000, - 25381=>1000,25382=>1000,25383=>1000,25384=>1000,25385=>1000,25386=>1000,25387=>1000,25388=>1000,25389=>1000,25390=>1000,25391=>1000,25392=>1000,25393=>1000,25394=>1000,25395=>1000,25396=>1000, - 25397=>1000,25398=>1000,25399=>1000,25400=>1000,25401=>1000,25402=>1000,25403=>1000,25404=>1000,25405=>1000,25406=>1000,25407=>1000,25408=>1000,25409=>1000,25410=>1000,25411=>1000,25412=>1000, - 25413=>1000,25414=>1000,25415=>1000,25416=>1000,25417=>1000,25418=>1000,25419=>1000,25420=>1000,25421=>1000,25422=>1000,25423=>1000,25424=>1000,25425=>1000,25426=>1000,25427=>1000,25428=>1000, - 25429=>1000,25430=>1000,25431=>1000,25432=>1000,25433=>1000,25434=>1000,25435=>1000,25436=>1000,25437=>1000,25438=>1000,25439=>1000,25440=>1000,25441=>1000,25442=>1000,25443=>1000,25444=>1000, - 25445=>1000,25446=>1000,25447=>1000,25448=>1000,25449=>1000,25450=>1000,25451=>1000,25452=>1000,25453=>1000,25454=>1000,25455=>1000,25456=>1000,25457=>1000,25458=>1000,25459=>1000,25460=>1000, - 25461=>1000,25462=>1000,25463=>1000,25464=>1000,25465=>1000,25466=>1000,25467=>1000,25468=>1000,25469=>1000,25470=>1000,25471=>1000,25472=>1000,25473=>1000,25474=>1000,25475=>1000,25476=>1000, - 25477=>1000,25478=>1000,25479=>1000,25480=>1000,25481=>1000,25482=>1000,25483=>1000,25484=>1000,25485=>1000,25486=>1000,25487=>1000,25488=>1000,25489=>1000,25490=>1000,25491=>1000,25492=>1000, - 25493=>1000,25494=>1000,25495=>1000,25496=>1000,25497=>1000,25498=>1000,25499=>1000,25500=>1000,25501=>1000,25502=>1000,25503=>1000,25504=>1000,25505=>1000,25506=>1000,25507=>1000,25508=>1000, - 25509=>1000,25510=>1000,25511=>1000,25512=>1000,25513=>1000,25514=>1000,25515=>1000,25516=>1000,25517=>1000,25518=>1000,25519=>1000,25520=>1000,25521=>1000,25522=>1000,25523=>1000,25524=>1000, - 25525=>1000,25526=>1000,25527=>1000,25528=>1000,25529=>1000,25530=>1000,25531=>1000,25532=>1000,25533=>1000,25534=>1000,25535=>1000,25536=>1000,25537=>1000,25538=>1000,25539=>1000,25540=>1000, - 25541=>1000,25542=>1000,25543=>1000,25544=>1000,25545=>1000,25546=>1000,25547=>1000,25548=>1000,25549=>1000,25550=>1000,25551=>1000,25552=>1000,25553=>1000,25554=>1000,25555=>1000,25556=>1000, - 25557=>1000,25558=>1000,25559=>1000,25560=>1000,25561=>1000,25562=>1000,25563=>1000,25564=>1000,25565=>1000,25566=>1000,25567=>1000,25568=>1000,25569=>1000,25570=>1000,25571=>1000,25572=>1000, - 25573=>1000,25574=>1000,25575=>1000,25576=>1000,25577=>1000,25578=>1000,25579=>1000,25580=>1000,25581=>1000,25582=>1000,25583=>1000,25584=>1000,25585=>1000,25586=>1000,25587=>1000,25588=>1000, - 25589=>1000,25590=>1000,25591=>1000,25592=>1000,25593=>1000,25594=>1000,25595=>1000,25596=>1000,25597=>1000,25598=>1000,25599=>1000,25600=>1000,25601=>1000,25602=>1000,25603=>1000,25604=>1000, - 25605=>1000,25606=>1000,25607=>1000,25608=>1000,25609=>1000,25610=>1000,25611=>1000,25612=>1000,25613=>1000,25614=>1000,25615=>1000,25616=>1000,25617=>1000,25618=>1000,25619=>1000,25620=>1000, - 25621=>1000,25622=>1000,25623=>1000,25624=>1000,25625=>1000,25626=>1000,25627=>1000,25628=>1000,25629=>1000,25630=>1000,25631=>1000,25632=>1000,25633=>1000,25634=>1000,25635=>1000,25636=>1000, - 25637=>1000,25638=>1000,25639=>1000,25640=>1000,25641=>1000,25642=>1000,25643=>1000,25644=>1000,25645=>1000,25646=>1000,25647=>1000,25648=>1000,25649=>1000,25650=>1000,25651=>1000,25652=>1000, - 25653=>1000,25654=>1000,25655=>1000,25656=>1000,25657=>1000,25658=>1000,25659=>1000,25660=>1000,25661=>1000,25662=>1000,25663=>1000,25664=>1000,25665=>1000,25666=>1000,25667=>1000,25668=>1000, - 25669=>1000,25670=>1000,25671=>1000,25672=>1000,25673=>1000,25674=>1000,25675=>1000,25676=>1000,25677=>1000,25678=>1000,25679=>1000,25680=>1000,25681=>1000,25682=>1000,25683=>1000,25684=>1000, - 25685=>1000,25686=>1000,25687=>1000,25688=>1000,25689=>1000,25690=>1000,25691=>1000,25692=>1000,25693=>1000,25694=>1000,25695=>1000,25696=>1000,25697=>1000,25698=>1000,25699=>1000,25700=>1000, - 25701=>1000,25702=>1000,25703=>1000,25704=>1000,25705=>1000,25706=>1000,25707=>1000,25708=>1000,25709=>1000,25710=>1000,25711=>1000,25712=>1000,25713=>1000,25714=>1000,25715=>1000,25716=>1000, - 25717=>1000,25718=>1000,25719=>1000,25720=>1000,25721=>1000,25722=>1000,25723=>1000,25724=>1000,25725=>1000,25726=>1000,25727=>1000,25728=>1000,25729=>1000,25730=>1000,25731=>1000,25732=>1000, - 25733=>1000,25734=>1000,25735=>1000,25736=>1000,25737=>1000,25738=>1000,25739=>1000,25740=>1000,25741=>1000,25742=>1000,25743=>1000,25744=>1000,25745=>1000,25746=>1000,25747=>1000,25748=>1000, - 25749=>1000,25750=>1000,25751=>1000,25752=>1000,25753=>1000,25754=>1000,25755=>1000,25756=>1000,25757=>1000,25758=>1000,25759=>1000,25760=>1000,25761=>1000,25762=>1000,25763=>1000,25764=>1000, - 25765=>1000,25766=>1000,25767=>1000,25768=>1000,25769=>1000,25770=>1000,25771=>1000,25772=>1000,25773=>1000,25774=>1000,25775=>1000,25776=>1000,25777=>1000,25778=>1000,25779=>1000,25780=>1000, - 25781=>1000,25782=>1000,25783=>1000,25784=>1000,25785=>1000,25786=>1000,25787=>1000,25788=>1000,25789=>1000,25790=>1000,25791=>1000,25792=>1000,25793=>1000,25794=>1000,25795=>1000,25796=>1000, - 25797=>1000,25798=>1000,25799=>1000,25800=>1000,25801=>1000,25802=>1000,25803=>1000,25804=>1000,25805=>1000,25806=>1000,25807=>1000,25808=>1000,25809=>1000,25810=>1000,25811=>1000,25812=>1000, - 25813=>1000,25814=>1000,25815=>1000,25816=>1000,25817=>1000,25818=>1000,25819=>1000,25820=>1000,25821=>1000,25822=>1000,25823=>1000,25824=>1000,25825=>1000,25826=>1000,25827=>1000,25828=>1000, - 25829=>1000,25830=>1000,25831=>1000,25832=>1000,25833=>1000,25834=>1000,25835=>1000,25836=>1000,25837=>1000,25838=>1000,25839=>1000,25840=>1000,25841=>1000,25842=>1000,25843=>1000,25844=>1000, - 25845=>1000,25846=>1000,25847=>1000,25848=>1000,25849=>1000,25850=>1000,25851=>1000,25852=>1000,25853=>1000,25854=>1000,25855=>1000,25856=>1000,25857=>1000,25858=>1000,25859=>1000,25860=>1000, - 25861=>1000,25862=>1000,25863=>1000,25864=>1000,25865=>1000,25866=>1000,25867=>1000,25868=>1000,25869=>1000,25870=>1000,25871=>1000,25872=>1000,25873=>1000,25874=>1000,25875=>1000,25876=>1000, - 25877=>1000,25878=>1000,25879=>1000,25880=>1000,25881=>1000,25882=>1000,25883=>1000,25884=>1000,25885=>1000,25886=>1000,25887=>1000,25888=>1000,25889=>1000,25890=>1000,25891=>1000,25892=>1000, - 25893=>1000,25894=>1000,25895=>1000,25896=>1000,25897=>1000,25898=>1000,25899=>1000,25900=>1000,25901=>1000,25902=>1000,25903=>1000,25904=>1000,25905=>1000,25906=>1000,25907=>1000,25908=>1000, - 25909=>1000,25910=>1000,25911=>1000,25912=>1000,25913=>1000,25914=>1000,25915=>1000,25916=>1000,25917=>1000,25918=>1000,25919=>1000,25920=>1000,25921=>1000,25922=>1000,25923=>1000,25924=>1000, - 25925=>1000,25926=>1000,25927=>1000,25928=>1000,25929=>1000,25930=>1000,25931=>1000,25932=>1000,25933=>1000,25934=>1000,25935=>1000,25936=>1000,25937=>1000,25938=>1000,25939=>1000,25940=>1000, - 25941=>1000,25942=>1000,25943=>1000,25944=>1000,25945=>1000,25946=>1000,25947=>1000,25948=>1000,25949=>1000,25950=>1000,25951=>1000,25952=>1000,25953=>1000,25954=>1000,25955=>1000,25956=>1000, - 25957=>1000,25958=>1000,25959=>1000,25960=>1000,25961=>1000,25962=>1000,25963=>1000,25964=>1000,25965=>1000,25966=>1000,25967=>1000,25968=>1000,25969=>1000,25970=>1000,25971=>1000,25972=>1000, - 25973=>1000,25974=>1000,25975=>1000,25976=>1000,25977=>1000,25978=>1000,25979=>1000,25980=>1000,25981=>1000,25982=>1000,25983=>1000,25984=>1000,25985=>1000,25986=>1000,25987=>1000,25988=>1000, - 25989=>1000,25990=>1000,25991=>1000,25992=>1000,25993=>1000,25994=>1000,25995=>1000,25996=>1000,25997=>1000,25998=>1000,25999=>1000,26000=>1000,26001=>1000,26002=>1000,26003=>1000,26004=>1000, - 26005=>1000,26006=>1000,26007=>1000,26008=>1000,26009=>1000,26010=>1000,26011=>1000,26012=>1000,26013=>1000,26014=>1000,26015=>1000,26016=>1000,26017=>1000,26018=>1000,26019=>1000,26020=>1000, - 26021=>1000,26022=>1000,26023=>1000,26024=>1000,26025=>1000,26026=>1000,26027=>1000,26028=>1000,26029=>1000,26030=>1000,26031=>1000,26032=>1000,26033=>1000,26034=>1000,26035=>1000,26036=>1000, - 26037=>1000,26038=>1000,26039=>1000,26040=>1000,26041=>1000,26042=>1000,26043=>1000,26044=>1000,26045=>1000,26046=>1000,26047=>1000,26048=>1000,26049=>1000,26050=>1000,26051=>1000,26052=>1000, - 26053=>1000,26054=>1000,26055=>1000,26056=>1000,26057=>1000,26058=>1000,26059=>1000,26060=>1000,26061=>1000,26062=>1000,26063=>1000,26064=>1000,26065=>1000,26066=>1000,26067=>1000,26068=>1000, - 26069=>1000,26070=>1000,26071=>1000,26072=>1000,26073=>1000,26074=>1000,26075=>1000,26076=>1000,26077=>1000,26078=>1000,26079=>1000,26080=>1000,26081=>1000,26082=>1000,26083=>1000,26084=>1000, - 26085=>1000,26086=>1000,26087=>1000,26088=>1000,26089=>1000,26090=>1000,26091=>1000,26092=>1000,26093=>1000,26094=>1000,26095=>1000,26096=>1000,26097=>1000,26098=>1000,26099=>1000,26100=>1000, - 26101=>1000,26102=>1000,26103=>1000,26104=>1000,26105=>1000,26106=>1000,26107=>1000,26108=>1000,26109=>1000,26110=>1000,26111=>1000,26112=>1000,26113=>1000,26114=>1000,26115=>1000,26116=>1000, - 26117=>1000,26118=>1000,26119=>1000,26120=>1000,26121=>1000,26122=>1000,26123=>1000,26124=>1000,26125=>1000,26126=>1000,26127=>1000,26128=>1000,26129=>1000,26130=>1000,26131=>1000,26132=>1000, - 26133=>1000,26134=>1000,26135=>1000,26136=>1000,26137=>1000,26138=>1000,26139=>1000,26140=>1000,26141=>1000,26142=>1000,26143=>1000,26144=>1000,26145=>1000,26146=>1000,26147=>1000,26148=>1000, - 26149=>1000,26150=>1000,26151=>1000,26152=>1000,26153=>1000,26154=>1000,26155=>1000,26156=>1000,26157=>1000,26158=>1000,26159=>1000,26160=>1000,26161=>1000,26162=>1000,26163=>1000,26164=>1000, - 26165=>1000,26166=>1000,26167=>1000,26168=>1000,26169=>1000,26170=>1000,26171=>1000,26172=>1000,26173=>1000,26174=>1000,26175=>1000,26176=>1000,26177=>1000,26178=>1000,26179=>1000,26180=>1000, - 26181=>1000,26182=>1000,26183=>1000,26184=>1000,26185=>1000,26186=>1000,26187=>1000,26188=>1000,26189=>1000,26190=>1000,26191=>1000,26192=>1000,26193=>1000,26194=>1000,26195=>1000,26196=>1000, - 26197=>1000,26198=>1000,26199=>1000,26200=>1000,26201=>1000,26202=>1000,26203=>1000,26204=>1000,26205=>1000,26206=>1000,26207=>1000,26208=>1000,26209=>1000,26210=>1000,26211=>1000,26212=>1000, - 26213=>1000,26214=>1000,26215=>1000,26216=>1000,26217=>1000,26218=>1000,26219=>1000,26220=>1000,26221=>1000,26222=>1000,26223=>1000,26224=>1000,26225=>1000,26226=>1000,26227=>1000,26228=>1000, - 26229=>1000,26230=>1000,26231=>1000,26232=>1000,26233=>1000,26234=>1000,26235=>1000,26236=>1000,26237=>1000,26238=>1000,26239=>1000,26240=>1000,26241=>1000,26242=>1000,26243=>1000,26244=>1000, - 26245=>1000,26246=>1000,26247=>1000,26248=>1000,26249=>1000,26250=>1000,26251=>1000,26252=>1000,26253=>1000,26254=>1000,26255=>1000,26256=>1000,26257=>1000,26258=>1000,26259=>1000,26260=>1000, - 26261=>1000,26262=>1000,26263=>1000,26264=>1000,26265=>1000,26266=>1000,26267=>1000,26268=>1000,26269=>1000,26270=>1000,26271=>1000,26272=>1000,26273=>1000,26274=>1000,26275=>1000,26276=>1000, - 26277=>1000,26278=>1000,26279=>1000,26280=>1000,26281=>1000,26282=>1000,26283=>1000,26284=>1000,26285=>1000,26286=>1000,26287=>1000,26288=>1000,26289=>1000,26290=>1000,26291=>1000,26292=>1000, - 26293=>1000,26294=>1000,26295=>1000,26296=>1000,26297=>1000,26298=>1000,26299=>1000,26300=>1000,26301=>1000,26302=>1000,26303=>1000,26304=>1000,26305=>1000,26306=>1000,26307=>1000,26308=>1000, - 26309=>1000,26310=>1000,26311=>1000,26312=>1000,26313=>1000,26314=>1000,26315=>1000,26316=>1000,26317=>1000,26318=>1000,26319=>1000,26320=>1000,26321=>1000,26322=>1000,26323=>1000,26324=>1000, - 26325=>1000,26326=>1000,26327=>1000,26328=>1000,26329=>1000,26330=>1000,26331=>1000,26332=>1000,26333=>1000,26334=>1000,26335=>1000,26336=>1000,26337=>1000,26338=>1000,26339=>1000,26340=>1000, - 26341=>1000,26342=>1000,26343=>1000,26344=>1000,26345=>1000,26346=>1000,26347=>1000,26348=>1000,26349=>1000,26350=>1000,26351=>1000,26352=>1000,26353=>1000,26354=>1000,26355=>1000,26356=>1000, - 26357=>1000,26358=>1000,26359=>1000,26360=>1000,26361=>1000,26362=>1000,26363=>1000,26364=>1000,26365=>1000,26366=>1000,26367=>1000,26368=>1000,26369=>1000,26370=>1000,26371=>1000,26372=>1000, - 26373=>1000,26374=>1000,26375=>1000,26376=>1000,26377=>1000,26378=>1000,26379=>1000,26380=>1000,26381=>1000,26382=>1000,26383=>1000,26384=>1000,26385=>1000,26386=>1000,26387=>1000,26388=>1000, - 26389=>1000,26390=>1000,26391=>1000,26392=>1000,26393=>1000,26394=>1000,26395=>1000,26396=>1000,26397=>1000,26398=>1000,26399=>1000,26400=>1000,26401=>1000,26402=>1000,26403=>1000,26404=>1000, - 26405=>1000,26406=>1000,26407=>1000,26408=>1000,26409=>1000,26410=>1000,26411=>1000,26412=>1000,26413=>1000,26414=>1000,26415=>1000,26416=>1000,26417=>1000,26418=>1000,26419=>1000,26420=>1000, - 26421=>1000,26422=>1000,26423=>1000,26424=>1000,26425=>1000,26426=>1000,26427=>1000,26428=>1000,26429=>1000,26430=>1000,26431=>1000,26432=>1000,26433=>1000,26434=>1000,26435=>1000,26436=>1000, - 26437=>1000,26438=>1000,26439=>1000,26440=>1000,26441=>1000,26442=>1000,26443=>1000,26444=>1000,26445=>1000,26446=>1000,26447=>1000,26448=>1000,26449=>1000,26450=>1000,26451=>1000,26452=>1000, - 26453=>1000,26454=>1000,26455=>1000,26456=>1000,26457=>1000,26458=>1000,26459=>1000,26460=>1000,26461=>1000,26462=>1000,26463=>1000,26464=>1000,26465=>1000,26466=>1000,26467=>1000,26468=>1000, - 26469=>1000,26470=>1000,26471=>1000,26472=>1000,26473=>1000,26474=>1000,26475=>1000,26476=>1000,26477=>1000,26478=>1000,26479=>1000,26480=>1000,26481=>1000,26482=>1000,26483=>1000,26484=>1000, - 26485=>1000,26486=>1000,26487=>1000,26488=>1000,26489=>1000,26490=>1000,26491=>1000,26492=>1000,26493=>1000,26494=>1000,26495=>1000,26496=>1000,26497=>1000,26498=>1000,26499=>1000,26500=>1000, - 26501=>1000,26502=>1000,26503=>1000,26504=>1000,26505=>1000,26506=>1000,26507=>1000,26508=>1000,26509=>1000,26510=>1000,26511=>1000,26512=>1000,26513=>1000,26514=>1000,26515=>1000,26516=>1000, - 26517=>1000,26518=>1000,26519=>1000,26520=>1000,26521=>1000,26522=>1000,26523=>1000,26524=>1000,26525=>1000,26526=>1000,26527=>1000,26528=>1000,26529=>1000,26530=>1000,26531=>1000,26532=>1000, - 26533=>1000,26534=>1000,26535=>1000,26536=>1000,26537=>1000,26538=>1000,26539=>1000,26540=>1000,26541=>1000,26542=>1000,26543=>1000,26544=>1000,26545=>1000,26546=>1000,26547=>1000,26548=>1000, - 26549=>1000,26550=>1000,26551=>1000,26552=>1000,26553=>1000,26554=>1000,26555=>1000,26556=>1000,26557=>1000,26558=>1000,26559=>1000,26560=>1000,26561=>1000,26562=>1000,26563=>1000,26564=>1000, - 26565=>1000,26566=>1000,26567=>1000,26568=>1000,26569=>1000,26570=>1000,26571=>1000,26572=>1000,26573=>1000,26574=>1000,26575=>1000,26576=>1000,26577=>1000,26578=>1000,26579=>1000,26580=>1000, - 26581=>1000,26582=>1000,26583=>1000,26584=>1000,26585=>1000,26586=>1000,26587=>1000,26588=>1000,26589=>1000,26590=>1000,26591=>1000,26592=>1000,26593=>1000,26594=>1000,26595=>1000,26596=>1000, - 26597=>1000,26598=>1000,26599=>1000,26600=>1000,26601=>1000,26602=>1000,26603=>1000,26604=>1000,26605=>1000,26606=>1000,26607=>1000,26608=>1000,26609=>1000,26610=>1000,26611=>1000,26612=>1000, - 26613=>1000,26614=>1000,26615=>1000,26616=>1000,26617=>1000,26618=>1000,26619=>1000,26620=>1000,26621=>1000,26622=>1000,26623=>1000,26624=>1000,26625=>1000,26626=>1000,26627=>1000,26628=>1000, - 26629=>1000,26630=>1000,26631=>1000,26632=>1000,26633=>1000,26634=>1000,26635=>1000,26636=>1000,26637=>1000,26638=>1000,26639=>1000,26640=>1000,26641=>1000,26642=>1000,26643=>1000,26644=>1000, - 26645=>1000,26646=>1000,26647=>1000,26648=>1000,26649=>1000,26650=>1000,26651=>1000,26652=>1000,26653=>1000,26654=>1000,26655=>1000,26656=>1000,26657=>1000,26658=>1000,26659=>1000,26660=>1000, - 26661=>1000,26662=>1000,26663=>1000,26664=>1000,26665=>1000,26666=>1000,26667=>1000,26668=>1000,26669=>1000,26670=>1000,26671=>1000,26672=>1000,26673=>1000,26674=>1000,26675=>1000,26676=>1000, - 26677=>1000,26678=>1000,26679=>1000,26680=>1000,26681=>1000,26682=>1000,26683=>1000,26684=>1000,26685=>1000,26686=>1000,26687=>1000,26688=>1000,26689=>1000,26690=>1000,26691=>1000,26692=>1000, - 26693=>1000,26694=>1000,26695=>1000,26696=>1000,26697=>1000,26698=>1000,26699=>1000,26700=>1000,26701=>1000,26702=>1000,26703=>1000,26704=>1000,26705=>1000,26706=>1000,26707=>1000,26708=>1000, - 26709=>1000,26710=>1000,26711=>1000,26712=>1000,26713=>1000,26714=>1000,26715=>1000,26716=>1000,26717=>1000,26718=>1000,26719=>1000,26720=>1000,26721=>1000,26722=>1000,26723=>1000,26724=>1000, - 26725=>1000,26726=>1000,26727=>1000,26728=>1000,26729=>1000,26730=>1000,26731=>1000,26732=>1000,26733=>1000,26734=>1000,26735=>1000,26736=>1000,26737=>1000,26738=>1000,26739=>1000,26740=>1000, - 26741=>1000,26742=>1000,26743=>1000,26744=>1000,26745=>1000,26746=>1000,26747=>1000,26748=>1000,26749=>1000,26750=>1000,26751=>1000,26752=>1000,26753=>1000,26754=>1000,26755=>1000,26756=>1000, - 26757=>1000,26758=>1000,26759=>1000,26760=>1000,26761=>1000,26762=>1000,26763=>1000,26764=>1000,26765=>1000,26766=>1000,26767=>1000,26768=>1000,26769=>1000,26770=>1000,26771=>1000,26772=>1000, - 26773=>1000,26774=>1000,26775=>1000,26776=>1000,26777=>1000,26778=>1000,26779=>1000,26780=>1000,26781=>1000,26782=>1000,26783=>1000,26784=>1000,26785=>1000,26786=>1000,26787=>1000,26788=>1000, - 26789=>1000,26790=>1000,26791=>1000,26792=>1000,26793=>1000,26794=>1000,26795=>1000,26796=>1000,26797=>1000,26798=>1000,26799=>1000,26800=>1000,26801=>1000,26802=>1000,26803=>1000,26804=>1000, - 26805=>1000,26806=>1000,26807=>1000,26808=>1000,26809=>1000,26810=>1000,26811=>1000,26812=>1000,26813=>1000,26814=>1000,26815=>1000,26816=>1000,26817=>1000,26818=>1000,26819=>1000,26820=>1000, - 26821=>1000,26822=>1000,26823=>1000,26824=>1000,26825=>1000,26826=>1000,26827=>1000,26828=>1000,26829=>1000,26830=>1000,26831=>1000,26832=>1000,26833=>1000,26834=>1000,26835=>1000,26836=>1000, - 26837=>1000,26838=>1000,26839=>1000,26840=>1000,26841=>1000,26842=>1000,26843=>1000,26844=>1000,26845=>1000,26846=>1000,26847=>1000,26848=>1000,26849=>1000,26850=>1000,26851=>1000,26852=>1000, - 26853=>1000,26854=>1000,26855=>1000,26856=>1000,26857=>1000,26858=>1000,26859=>1000,26860=>1000,26861=>1000,26862=>1000,26863=>1000,26864=>1000,26865=>1000,26866=>1000,26867=>1000,26868=>1000, - 26869=>1000,26870=>1000,26871=>1000,26872=>1000,26873=>1000,26874=>1000,26875=>1000,26876=>1000,26877=>1000,26878=>1000,26879=>1000,26880=>1000,26881=>1000,26882=>1000,26883=>1000,26884=>1000, - 26885=>1000,26886=>1000,26887=>1000,26888=>1000,26889=>1000,26890=>1000,26891=>1000,26892=>1000,26893=>1000,26894=>1000,26895=>1000,26896=>1000,26897=>1000,26898=>1000,26899=>1000,26900=>1000, - 26901=>1000,26902=>1000,26903=>1000,26904=>1000,26905=>1000,26906=>1000,26907=>1000,26908=>1000,26909=>1000,26910=>1000,26911=>1000,26912=>1000,26913=>1000,26914=>1000,26915=>1000,26916=>1000, - 26917=>1000,26918=>1000,26919=>1000,26920=>1000,26921=>1000,26922=>1000,26923=>1000,26924=>1000,26925=>1000,26926=>1000,26927=>1000,26928=>1000,26929=>1000,26930=>1000,26931=>1000,26932=>1000, - 26933=>1000,26934=>1000,26935=>1000,26936=>1000,26937=>1000,26938=>1000,26939=>1000,26940=>1000,26941=>1000,26942=>1000,26943=>1000,26944=>1000,26945=>1000,26946=>1000,26947=>1000,26948=>1000, - 26949=>1000,26950=>1000,26951=>1000,26952=>1000,26953=>1000,26954=>1000,26955=>1000,26956=>1000,26957=>1000,26958=>1000,26959=>1000,26960=>1000,26961=>1000,26962=>1000,26963=>1000,26964=>1000, - 26965=>1000,26966=>1000,26967=>1000,26968=>1000,26969=>1000,26970=>1000,26971=>1000,26972=>1000,26973=>1000,26974=>1000,26975=>1000,26976=>1000,26977=>1000,26978=>1000,26979=>1000,26980=>1000, - 26981=>1000,26982=>1000,26983=>1000,26984=>1000,26985=>1000,26986=>1000,26987=>1000,26988=>1000,26989=>1000,26990=>1000,26991=>1000,26992=>1000,26993=>1000,26994=>1000,26995=>1000,26996=>1000, - 26997=>1000,26998=>1000,26999=>1000,27000=>1000,27001=>1000,27002=>1000,27003=>1000,27004=>1000,27005=>1000,27006=>1000,27007=>1000,27008=>1000,27009=>1000,27010=>1000,27011=>1000,27012=>1000, - 27013=>1000,27014=>1000,27015=>1000,27016=>1000,27017=>1000,27018=>1000,27019=>1000,27020=>1000,27021=>1000,27022=>1000,27023=>1000,27024=>1000,27025=>1000,27026=>1000,27027=>1000,27028=>1000, - 27029=>1000,27030=>1000,27031=>1000,27032=>1000,27033=>1000,27034=>1000,27035=>1000,27036=>1000,27037=>1000,27038=>1000,27039=>1000,27040=>1000,27041=>1000,27042=>1000,27043=>1000,27044=>1000, - 27045=>1000,27046=>1000,27047=>1000,27048=>1000,27049=>1000,27050=>1000,27051=>1000,27052=>1000,27053=>1000,27054=>1000,27055=>1000,27056=>1000,27057=>1000,27058=>1000,27059=>1000,27060=>1000, - 27061=>1000,27062=>1000,27063=>1000,27064=>1000,27065=>1000,27066=>1000,27067=>1000,27068=>1000,27069=>1000,27070=>1000,27071=>1000,27072=>1000,27073=>1000,27074=>1000,27075=>1000,27076=>1000, - 27077=>1000,27078=>1000,27079=>1000,27080=>1000,27081=>1000,27082=>1000,27083=>1000,27084=>1000,27085=>1000,27086=>1000,27087=>1000,27088=>1000,27089=>1000,27090=>1000,27091=>1000,27092=>1000, - 27093=>1000,27094=>1000,27095=>1000,27096=>1000,27097=>1000,27098=>1000,27099=>1000,27100=>1000,27101=>1000,27102=>1000,27103=>1000,27104=>1000,27105=>1000,27106=>1000,27107=>1000,27108=>1000, - 27109=>1000,27110=>1000,27111=>1000,27112=>1000,27113=>1000,27114=>1000,27115=>1000,27116=>1000,27117=>1000,27118=>1000,27119=>1000,27120=>1000,27121=>1000,27122=>1000,27123=>1000,27124=>1000, - 27125=>1000,27126=>1000,27127=>1000,27128=>1000,27129=>1000,27130=>1000,27131=>1000,27132=>1000,27133=>1000,27134=>1000,27135=>1000,27136=>1000,27137=>1000,27138=>1000,27139=>1000,27140=>1000, - 27141=>1000,27142=>1000,27143=>1000,27144=>1000,27145=>1000,27146=>1000,27147=>1000,27148=>1000,27149=>1000,27150=>1000,27151=>1000,27152=>1000,27153=>1000,27154=>1000,27155=>1000,27156=>1000, - 27157=>1000,27158=>1000,27159=>1000,27160=>1000,27161=>1000,27162=>1000,27163=>1000,27164=>1000,27165=>1000,27166=>1000,27167=>1000,27168=>1000,27169=>1000,27170=>1000,27171=>1000,27172=>1000, - 27173=>1000,27174=>1000,27175=>1000,27176=>1000,27177=>1000,27178=>1000,27179=>1000,27180=>1000,27181=>1000,27182=>1000,27183=>1000,27184=>1000,27185=>1000,27186=>1000,27187=>1000,27188=>1000, - 27189=>1000,27190=>1000,27191=>1000,27192=>1000,27193=>1000,27194=>1000,27195=>1000,27196=>1000,27197=>1000,27198=>1000,27199=>1000,27200=>1000,27201=>1000,27202=>1000,27203=>1000,27204=>1000, - 27205=>1000,27206=>1000,27207=>1000,27208=>1000,27209=>1000,27210=>1000,27211=>1000,27212=>1000,27213=>1000,27214=>1000,27215=>1000,27216=>1000,27217=>1000,27218=>1000,27219=>1000,27220=>1000, - 27221=>1000,27222=>1000,27223=>1000,27224=>1000,27225=>1000,27226=>1000,27227=>1000,27228=>1000,27229=>1000,27230=>1000,27231=>1000,27232=>1000,27233=>1000,27234=>1000,27235=>1000,27236=>1000, - 27237=>1000,27238=>1000,27239=>1000,27240=>1000,27241=>1000,27242=>1000,27243=>1000,27244=>1000,27245=>1000,27246=>1000,27247=>1000,27248=>1000,27249=>1000,27250=>1000,27251=>1000,27252=>1000, - 27253=>1000,27254=>1000,27255=>1000,27256=>1000,27257=>1000,27258=>1000,27259=>1000,27260=>1000,27261=>1000,27262=>1000,27263=>1000,27264=>1000,27265=>1000,27266=>1000,27267=>1000,27268=>1000, - 27269=>1000,27270=>1000,27271=>1000,27272=>1000,27273=>1000,27274=>1000,27275=>1000,27276=>1000,27277=>1000,27278=>1000,27279=>1000,27280=>1000,27281=>1000,27282=>1000,27283=>1000,27284=>1000, - 27285=>1000,27286=>1000,27287=>1000,27288=>1000,27289=>1000,27290=>1000,27291=>1000,27292=>1000,27293=>1000,27294=>1000,27295=>1000,27296=>1000,27297=>1000,27298=>1000,27299=>1000,27300=>1000, - 27301=>1000,27302=>1000,27303=>1000,27304=>1000,27305=>1000,27306=>1000,27307=>1000,27308=>1000,27309=>1000,27310=>1000,27311=>1000,27312=>1000,27313=>1000,27314=>1000,27315=>1000,27316=>1000, - 27317=>1000,27318=>1000,27319=>1000,27320=>1000,27321=>1000,27322=>1000,27323=>1000,27324=>1000,27325=>1000,27326=>1000,27327=>1000,27328=>1000,27329=>1000,27330=>1000,27331=>1000,27332=>1000, - 27333=>1000,27334=>1000,27335=>1000,27336=>1000,27337=>1000,27338=>1000,27339=>1000,27340=>1000,27341=>1000,27342=>1000,27343=>1000,27344=>1000,27345=>1000,27346=>1000,27347=>1000,27348=>1000, - 27349=>1000,27350=>1000,27351=>1000,27352=>1000,27353=>1000,27354=>1000,27355=>1000,27356=>1000,27357=>1000,27358=>1000,27359=>1000,27360=>1000,27361=>1000,27362=>1000,27363=>1000,27364=>1000, - 27365=>1000,27366=>1000,27367=>1000,27368=>1000,27369=>1000,27370=>1000,27371=>1000,27372=>1000,27373=>1000,27374=>1000,27375=>1000,27376=>1000,27377=>1000,27378=>1000,27379=>1000,27380=>1000, - 27381=>1000,27382=>1000,27383=>1000,27384=>1000,27385=>1000,27386=>1000,27387=>1000,27388=>1000,27389=>1000,27390=>1000,27391=>1000,27392=>1000,27393=>1000,27394=>1000,27395=>1000,27396=>1000, - 27397=>1000,27398=>1000,27399=>1000,27400=>1000,27401=>1000,27402=>1000,27403=>1000,27404=>1000,27405=>1000,27406=>1000,27407=>1000,27408=>1000,27409=>1000,27410=>1000,27411=>1000,27412=>1000, - 27413=>1000,27414=>1000,27415=>1000,27416=>1000,27417=>1000,27418=>1000,27419=>1000,27420=>1000,27421=>1000,27422=>1000,27423=>1000,27424=>1000,27425=>1000,27426=>1000,27427=>1000,27428=>1000, - 27429=>1000,27430=>1000,27431=>1000,27432=>1000,27433=>1000,27434=>1000,27435=>1000,27436=>1000,27437=>1000,27438=>1000,27439=>1000,27440=>1000,27441=>1000,27442=>1000,27443=>1000,27444=>1000, - 27445=>1000,27446=>1000,27447=>1000,27448=>1000,27449=>1000,27450=>1000,27451=>1000,27452=>1000,27453=>1000,27454=>1000,27455=>1000,27456=>1000,27457=>1000,27458=>1000,27459=>1000,27460=>1000, - 27461=>1000,27462=>1000,27463=>1000,27464=>1000,27465=>1000,27466=>1000,27467=>1000,27468=>1000,27469=>1000,27470=>1000,27471=>1000,27472=>1000,27473=>1000,27474=>1000,27475=>1000,27476=>1000, - 27477=>1000,27478=>1000,27479=>1000,27480=>1000,27481=>1000,27482=>1000,27483=>1000,27484=>1000,27485=>1000,27486=>1000,27487=>1000,27488=>1000,27489=>1000,27490=>1000,27491=>1000,27492=>1000, - 27493=>1000,27494=>1000,27495=>1000,27496=>1000,27497=>1000,27498=>1000,27499=>1000,27500=>1000,27501=>1000,27502=>1000,27503=>1000,27504=>1000,27505=>1000,27506=>1000,27507=>1000,27508=>1000, - 27509=>1000,27510=>1000,27511=>1000,27512=>1000,27513=>1000,27514=>1000,27515=>1000,27516=>1000,27517=>1000,27518=>1000,27519=>1000,27520=>1000,27521=>1000,27522=>1000,27523=>1000,27524=>1000, - 27525=>1000,27526=>1000,27527=>1000,27528=>1000,27529=>1000,27530=>1000,27531=>1000,27532=>1000,27533=>1000,27534=>1000,27535=>1000,27536=>1000,27537=>1000,27538=>1000,27539=>1000,27540=>1000, - 27541=>1000,27542=>1000,27543=>1000,27544=>1000,27545=>1000,27546=>1000,27547=>1000,27548=>1000,27549=>1000,27550=>1000,27551=>1000,27552=>1000,27553=>1000,27554=>1000,27555=>1000,27556=>1000, - 27557=>1000,27558=>1000,27559=>1000,27560=>1000,27561=>1000,27562=>1000,27563=>1000,27564=>1000,27565=>1000,27566=>1000,27567=>1000,27568=>1000,27569=>1000,27570=>1000,27571=>1000,27572=>1000, - 27573=>1000,27574=>1000,27575=>1000,27576=>1000,27577=>1000,27578=>1000,27579=>1000,27580=>1000,27581=>1000,27582=>1000,27583=>1000,27584=>1000,27585=>1000,27586=>1000,27587=>1000,27588=>1000, - 27589=>1000,27590=>1000,27591=>1000,27592=>1000,27593=>1000,27594=>1000,27595=>1000,27596=>1000,27597=>1000,27598=>1000,27599=>1000,27600=>1000,27601=>1000,27602=>1000,27603=>1000,27604=>1000, - 27605=>1000,27606=>1000,27607=>1000,27608=>1000,27609=>1000,27610=>1000,27611=>1000,27612=>1000,27613=>1000,27614=>1000,27615=>1000,27616=>1000,27617=>1000,27618=>1000,27619=>1000,27620=>1000, - 27621=>1000,27622=>1000,27623=>1000,27624=>1000,27625=>1000,27626=>1000,27627=>1000,27628=>1000,27629=>1000,27630=>1000,27631=>1000,27632=>1000,27633=>1000,27634=>1000,27635=>1000,27636=>1000, - 27637=>1000,27638=>1000,27639=>1000,27640=>1000,27641=>1000,27642=>1000,27643=>1000,27644=>1000,27645=>1000,27646=>1000,27647=>1000,27648=>1000,27649=>1000,27650=>1000,27651=>1000,27652=>1000, - 27653=>1000,27654=>1000,27655=>1000,27656=>1000,27657=>1000,27658=>1000,27659=>1000,27660=>1000,27661=>1000,27662=>1000,27663=>1000,27664=>1000,27665=>1000,27666=>1000,27667=>1000,27668=>1000, - 27669=>1000,27670=>1000,27671=>1000,27672=>1000,27673=>1000,27674=>1000,27675=>1000,27676=>1000,27677=>1000,27678=>1000,27679=>1000,27680=>1000,27681=>1000,27682=>1000,27683=>1000,27684=>1000, - 27685=>1000,27686=>1000,27687=>1000,27688=>1000,27689=>1000,27690=>1000,27691=>1000,27692=>1000,27693=>1000,27694=>1000,27695=>1000,27696=>1000,27697=>1000,27698=>1000,27699=>1000,27700=>1000, - 27701=>1000,27702=>1000,27703=>1000,27704=>1000,27705=>1000,27706=>1000,27707=>1000,27708=>1000,27709=>1000,27710=>1000,27711=>1000,27712=>1000,27713=>1000,27714=>1000,27715=>1000,27716=>1000, - 27717=>1000,27718=>1000,27719=>1000,27720=>1000,27721=>1000,27722=>1000,27723=>1000,27724=>1000,27725=>1000,27726=>1000,27727=>1000,27728=>1000,27729=>1000,27730=>1000,27731=>1000,27732=>1000, - 27733=>1000,27734=>1000,27735=>1000,27736=>1000,27737=>1000,27738=>1000,27739=>1000,27740=>1000,27741=>1000,27742=>1000,27743=>1000,27744=>1000,27745=>1000,27746=>1000,27747=>1000,27748=>1000, - 27749=>1000,27750=>1000,27751=>1000,27752=>1000,27753=>1000,27754=>1000,27755=>1000,27756=>1000,27757=>1000,27758=>1000,27759=>1000,27760=>1000,27761=>1000,27762=>1000,27763=>1000,27764=>1000, - 27765=>1000,27766=>1000,27767=>1000,27768=>1000,27769=>1000,27770=>1000,27771=>1000,27772=>1000,27773=>1000,27774=>1000,27775=>1000,27776=>1000,27777=>1000,27778=>1000,27779=>1000,27780=>1000, - 27781=>1000,27782=>1000,27783=>1000,27784=>1000,27785=>1000,27786=>1000,27787=>1000,27788=>1000,27789=>1000,27790=>1000,27791=>1000,27792=>1000,27793=>1000,27794=>1000,27795=>1000,27796=>1000, - 27797=>1000,27798=>1000,27799=>1000,27800=>1000,27801=>1000,27802=>1000,27803=>1000,27804=>1000,27805=>1000,27806=>1000,27807=>1000,27808=>1000,27809=>1000,27810=>1000,27811=>1000,27812=>1000, - 27813=>1000,27814=>1000,27815=>1000,27816=>1000,27817=>1000,27818=>1000,27819=>1000,27820=>1000,27821=>1000,27822=>1000,27823=>1000,27824=>1000,27825=>1000,27826=>1000,27827=>1000,27828=>1000, - 27829=>1000,27830=>1000,27831=>1000,27832=>1000,27833=>1000,27834=>1000,27835=>1000,27836=>1000,27837=>1000,27838=>1000,27839=>1000,27840=>1000,27841=>1000,27842=>1000,27843=>1000,27844=>1000, - 27845=>1000,27846=>1000,27847=>1000,27848=>1000,27849=>1000,27850=>1000,27851=>1000,27852=>1000,27853=>1000,27854=>1000,27855=>1000,27856=>1000,27857=>1000,27858=>1000,27859=>1000,27860=>1000, - 27861=>1000,27862=>1000,27863=>1000,27864=>1000,27865=>1000,27866=>1000,27867=>1000,27868=>1000,27869=>1000,27870=>1000,27871=>1000,27872=>1000,27873=>1000,27874=>1000,27875=>1000,27876=>1000, - 27877=>1000,27878=>1000,27879=>1000,27880=>1000,27881=>1000,27882=>1000,27883=>1000,27884=>1000,27885=>1000,27886=>1000,27887=>1000,27888=>1000,27889=>1000,27890=>1000,27891=>1000,27892=>1000, - 27893=>1000,27894=>1000,27895=>1000,27896=>1000,27897=>1000,27898=>1000,27899=>1000,27900=>1000,27901=>1000,27902=>1000,27903=>1000,27904=>1000,27905=>1000,27906=>1000,27907=>1000,27908=>1000, - 27909=>1000,27910=>1000,27911=>1000,27912=>1000,27913=>1000,27914=>1000,27915=>1000,27916=>1000,27917=>1000,27918=>1000,27919=>1000,27920=>1000,27921=>1000,27922=>1000,27923=>1000,27924=>1000, - 27925=>1000,27926=>1000,27927=>1000,27928=>1000,27929=>1000,27930=>1000,27931=>1000,27932=>1000,27933=>1000,27934=>1000,27935=>1000,27936=>1000,27937=>1000,27938=>1000,27939=>1000,27940=>1000, - 27941=>1000,27942=>1000,27943=>1000,27944=>1000,27945=>1000,27946=>1000,27947=>1000,27948=>1000,27949=>1000,27950=>1000,27951=>1000,27952=>1000,27953=>1000,27954=>1000,27955=>1000,27956=>1000, - 27957=>1000,27958=>1000,27959=>1000,27960=>1000,27961=>1000,27962=>1000,27963=>1000,27964=>1000,27965=>1000,27966=>1000,27967=>1000,27968=>1000,27969=>1000,27970=>1000,27971=>1000,27972=>1000, - 27973=>1000,27974=>1000,27975=>1000,27976=>1000,27977=>1000,27978=>1000,27979=>1000,27980=>1000,27981=>1000,27982=>1000,27983=>1000,27984=>1000,27985=>1000,27986=>1000,27987=>1000,27988=>1000, - 27989=>1000,27990=>1000,27991=>1000,27992=>1000,27993=>1000,27994=>1000,27995=>1000,27996=>1000,27997=>1000,27998=>1000,27999=>1000,28000=>1000,28001=>1000,28002=>1000,28003=>1000,28004=>1000, - 28005=>1000,28006=>1000,28007=>1000,28008=>1000,28009=>1000,28010=>1000,28011=>1000,28012=>1000,28013=>1000,28014=>1000,28015=>1000,28016=>1000,28017=>1000,28018=>1000,28019=>1000,28020=>1000, - 28021=>1000,28022=>1000,28023=>1000,28024=>1000,28025=>1000,28026=>1000,28027=>1000,28028=>1000,28029=>1000,28030=>1000,28031=>1000,28032=>1000,28033=>1000,28034=>1000,28035=>1000,28036=>1000, - 28037=>1000,28038=>1000,28039=>1000,28040=>1000,28041=>1000,28042=>1000,28043=>1000,28044=>1000,28045=>1000,28046=>1000,28047=>1000,28048=>1000,28049=>1000,28050=>1000,28051=>1000,28052=>1000, - 28053=>1000,28054=>1000,28055=>1000,28056=>1000,28057=>1000,28058=>1000,28059=>1000,28060=>1000,28061=>1000,28062=>1000,28063=>1000,28064=>1000,28065=>1000,28066=>1000,28067=>1000,28068=>1000, - 28069=>1000,28070=>1000,28071=>1000,28072=>1000,28073=>1000,28074=>1000,28075=>1000,28076=>1000,28077=>1000,28078=>1000,28079=>1000,28080=>1000,28081=>1000,28082=>1000,28083=>1000,28084=>1000, - 28085=>1000,28086=>1000,28087=>1000,28088=>1000,28089=>1000,28090=>1000,28091=>1000,28092=>1000,28093=>1000,28094=>1000,28095=>1000,28096=>1000,28097=>1000,28098=>1000,28099=>1000,28100=>1000, - 28101=>1000,28102=>1000,28103=>1000,28104=>1000,28105=>1000,28106=>1000,28107=>1000,28108=>1000,28109=>1000,28110=>1000,28111=>1000,28112=>1000,28113=>1000,28114=>1000,28115=>1000,28116=>1000, - 28117=>1000,28118=>1000,28119=>1000,28120=>1000,28121=>1000,28122=>1000,28123=>1000,28124=>1000,28125=>1000,28126=>1000,28127=>1000,28128=>1000,28129=>1000,28130=>1000,28131=>1000,28132=>1000, - 28133=>1000,28134=>1000,28135=>1000,28136=>1000,28137=>1000,28138=>1000,28139=>1000,28140=>1000,28141=>1000,28142=>1000,28143=>1000,28144=>1000,28145=>1000,28146=>1000,28147=>1000,28148=>1000, - 28149=>1000,28150=>1000,28151=>1000,28152=>1000,28153=>1000,28154=>1000,28155=>1000,28156=>1000,28157=>1000,28158=>1000,28159=>1000,28160=>1000,28161=>1000,28162=>1000,28163=>1000,28164=>1000, - 28165=>1000,28166=>1000,28167=>1000,28168=>1000,28169=>1000,28170=>1000,28171=>1000,28172=>1000,28173=>1000,28174=>1000,28175=>1000,28176=>1000,28177=>1000,28178=>1000,28179=>1000,28180=>1000, - 28181=>1000,28182=>1000,28183=>1000,28184=>1000,28185=>1000,28186=>1000,28187=>1000,28188=>1000,28189=>1000,28190=>1000,28191=>1000,28192=>1000,28193=>1000,28194=>1000,28195=>1000,28196=>1000, - 28197=>1000,28198=>1000,28199=>1000,28200=>1000,28201=>1000,28202=>1000,28203=>1000,28204=>1000,28205=>1000,28206=>1000,28207=>1000,28208=>1000,28209=>1000,28210=>1000,28211=>1000,28212=>1000, - 28213=>1000,28214=>1000,28215=>1000,28216=>1000,28217=>1000,28218=>1000,28219=>1000,28220=>1000,28221=>1000,28222=>1000,28223=>1000,28224=>1000,28225=>1000,28226=>1000,28227=>1000,28228=>1000, - 28229=>1000,28230=>1000,28231=>1000,28232=>1000,28233=>1000,28234=>1000,28235=>1000,28236=>1000,28237=>1000,28238=>1000,28239=>1000,28240=>1000,28241=>1000,28242=>1000,28243=>1000,28244=>1000, - 28245=>1000,28246=>1000,28247=>1000,28248=>1000,28249=>1000,28250=>1000,28251=>1000,28252=>1000,28253=>1000,28254=>1000,28255=>1000,28256=>1000,28257=>1000,28258=>1000,28259=>1000,28260=>1000, - 28261=>1000,28262=>1000,28263=>1000,28264=>1000,28265=>1000,28266=>1000,28267=>1000,28268=>1000,28269=>1000,28270=>1000,28271=>1000,28272=>1000,28273=>1000,28274=>1000,28275=>1000,28276=>1000, - 28277=>1000,28278=>1000,28279=>1000,28280=>1000,28281=>1000,28282=>1000,28283=>1000,28284=>1000,28285=>1000,28286=>1000,28287=>1000,28288=>1000,28289=>1000,28290=>1000,28291=>1000,28292=>1000, - 28293=>1000,28294=>1000,28295=>1000,28296=>1000,28297=>1000,28298=>1000,28299=>1000,28300=>1000,28301=>1000,28302=>1000,28303=>1000,28304=>1000,28305=>1000,28306=>1000,28307=>1000,28308=>1000, - 28309=>1000,28310=>1000,28311=>1000,28312=>1000,28313=>1000,28314=>1000,28315=>1000,28316=>1000,28317=>1000,28318=>1000,28319=>1000,28320=>1000,28321=>1000,28322=>1000,28323=>1000,28324=>1000, - 28325=>1000,28326=>1000,28327=>1000,28328=>1000,28329=>1000,28330=>1000,28331=>1000,28332=>1000,28333=>1000,28334=>1000,28335=>1000,28336=>1000,28337=>1000,28338=>1000,28339=>1000,28340=>1000, - 28341=>1000,28342=>1000,28343=>1000,28344=>1000,28345=>1000,28346=>1000,28347=>1000,28348=>1000,28349=>1000,28350=>1000,28351=>1000,28352=>1000,28353=>1000,28354=>1000,28355=>1000,28356=>1000, - 28357=>1000,28358=>1000,28359=>1000,28360=>1000,28361=>1000,28362=>1000,28363=>1000,28364=>1000,28365=>1000,28366=>1000,28367=>1000,28368=>1000,28369=>1000,28370=>1000,28371=>1000,28372=>1000, - 28373=>1000,28374=>1000,28375=>1000,28376=>1000,28377=>1000,28378=>1000,28379=>1000,28380=>1000,28381=>1000,28382=>1000,28383=>1000,28384=>1000,28385=>1000,28386=>1000,28387=>1000,28388=>1000, - 28389=>1000,28390=>1000,28391=>1000,28392=>1000,28393=>1000,28394=>1000,28395=>1000,28396=>1000,28397=>1000,28398=>1000,28399=>1000,28400=>1000,28401=>1000,28402=>1000,28403=>1000,28404=>1000, - 28405=>1000,28406=>1000,28407=>1000,28408=>1000,28409=>1000,28410=>1000,28411=>1000,28412=>1000,28413=>1000,28414=>1000,28415=>1000,28416=>1000,28417=>1000,28418=>1000,28419=>1000,28420=>1000, - 28421=>1000,28422=>1000,28423=>1000,28424=>1000,28425=>1000,28426=>1000,28427=>1000,28428=>1000,28429=>1000,28430=>1000,28431=>1000,28432=>1000,28433=>1000,28434=>1000,28435=>1000,28436=>1000, - 28437=>1000,28438=>1000,28439=>1000,28440=>1000,28441=>1000,28442=>1000,28443=>1000,28444=>1000,28445=>1000,28446=>1000,28447=>1000,28448=>1000,28449=>1000,28450=>1000,28451=>1000,28452=>1000, - 28453=>1000,28454=>1000,28455=>1000,28456=>1000,28457=>1000,28458=>1000,28459=>1000,28460=>1000,28461=>1000,28462=>1000,28463=>1000,28464=>1000,28465=>1000,28466=>1000,28467=>1000,28468=>1000, - 28469=>1000,28470=>1000,28471=>1000,28472=>1000,28473=>1000,28474=>1000,28475=>1000,28476=>1000,28477=>1000,28478=>1000,28479=>1000,28480=>1000,28481=>1000,28482=>1000,28483=>1000,28484=>1000, - 28485=>1000,28486=>1000,28487=>1000,28488=>1000,28489=>1000,28490=>1000,28491=>1000,28492=>1000,28493=>1000,28494=>1000,28495=>1000,28496=>1000,28497=>1000,28498=>1000,28499=>1000,28500=>1000, - 28501=>1000,28502=>1000,28503=>1000,28504=>1000,28505=>1000,28506=>1000,28507=>1000,28508=>1000,28509=>1000,28510=>1000,28511=>1000,28512=>1000,28513=>1000,28514=>1000,28515=>1000,28516=>1000, - 28517=>1000,28518=>1000,28519=>1000,28520=>1000,28521=>1000,28522=>1000,28523=>1000,28524=>1000,28525=>1000,28526=>1000,28527=>1000,28528=>1000,28529=>1000,28530=>1000,28531=>1000,28532=>1000, - 28533=>1000,28534=>1000,28535=>1000,28536=>1000,28537=>1000,28538=>1000,28539=>1000,28540=>1000,28541=>1000,28542=>1000,28543=>1000,28544=>1000,28545=>1000,28546=>1000,28547=>1000,28548=>1000, - 28549=>1000,28550=>1000,28551=>1000,28552=>1000,28553=>1000,28554=>1000,28555=>1000,28556=>1000,28557=>1000,28558=>1000,28559=>1000,28560=>1000,28561=>1000,28562=>1000,28563=>1000,28564=>1000, - 28565=>1000,28566=>1000,28567=>1000,28568=>1000,28569=>1000,28570=>1000,28571=>1000,28572=>1000,28573=>1000,28574=>1000,28575=>1000,28576=>1000,28577=>1000,28578=>1000,28579=>1000,28580=>1000, - 28581=>1000,28582=>1000,28583=>1000,28584=>1000,28585=>1000,28586=>1000,28587=>1000,28588=>1000,28589=>1000,28590=>1000,28591=>1000,28592=>1000,28593=>1000,28594=>1000,28595=>1000,28596=>1000, - 28597=>1000,28598=>1000,28599=>1000,28600=>1000,28601=>1000,28602=>1000,28603=>1000,28604=>1000,28605=>1000,28606=>1000,28607=>1000,28608=>1000,28609=>1000,28610=>1000,28611=>1000,28612=>1000, - 28613=>1000,28614=>1000,28615=>1000,28616=>1000,28617=>1000,28618=>1000,28619=>1000,28620=>1000,28621=>1000,28622=>1000,28623=>1000,28624=>1000,28625=>1000,28626=>1000,28627=>1000,28628=>1000, - 28629=>1000,28630=>1000,28631=>1000,28632=>1000,28633=>1000,28634=>1000,28635=>1000,28636=>1000,28637=>1000,28638=>1000,28639=>1000,28640=>1000,28641=>1000,28642=>1000,28643=>1000,28644=>1000, - 28645=>1000,28646=>1000,28647=>1000,28648=>1000,28649=>1000,28650=>1000,28651=>1000,28652=>1000,28653=>1000,28654=>1000,28655=>1000,28656=>1000,28657=>1000,28658=>1000,28659=>1000,28660=>1000, - 28661=>1000,28662=>1000,28663=>1000,28664=>1000,28665=>1000,28666=>1000,28667=>1000,28668=>1000,28669=>1000,28670=>1000,28671=>1000,28672=>1000,28673=>1000,28674=>1000,28675=>1000,28676=>1000, - 28677=>1000,28678=>1000,28679=>1000,28680=>1000,28681=>1000,28682=>1000,28683=>1000,28684=>1000,28685=>1000,28686=>1000,28687=>1000,28688=>1000,28689=>1000,28690=>1000,28691=>1000,28692=>1000, - 28693=>1000,28694=>1000,28695=>1000,28696=>1000,28697=>1000,28698=>1000,28699=>1000,28700=>1000,28701=>1000,28702=>1000,28703=>1000,28704=>1000,28705=>1000,28706=>1000,28707=>1000,28708=>1000, - 28709=>1000,28710=>1000,28711=>1000,28712=>1000,28713=>1000,28714=>1000,28715=>1000,28716=>1000,28717=>1000,28718=>1000,28719=>1000,28720=>1000,28721=>1000,28722=>1000,28723=>1000,28724=>1000, - 28725=>1000,28726=>1000,28727=>1000,28728=>1000,28729=>1000,28730=>1000,28731=>1000,28732=>1000,28733=>1000,28734=>1000,28735=>1000,28736=>1000,28737=>1000,28738=>1000,28739=>1000,28740=>1000, - 28741=>1000,28742=>1000,28743=>1000,28744=>1000,28745=>1000,28746=>1000,28747=>1000,28748=>1000,28749=>1000,28750=>1000,28751=>1000,28752=>1000,28753=>1000,28754=>1000,28755=>1000,28756=>1000, - 28757=>1000,28758=>1000,28759=>1000,28760=>1000,28761=>1000,28762=>1000,28763=>1000,28764=>1000,28765=>1000,28766=>1000,28767=>1000,28768=>1000,28769=>1000,28770=>1000,28771=>1000,28772=>1000, - 28773=>1000,28774=>1000,28775=>1000,28776=>1000,28777=>1000,28778=>1000,28779=>1000,28780=>1000,28781=>1000,28782=>1000,28783=>1000,28784=>1000,28785=>1000,28786=>1000,28787=>1000,28788=>1000, - 28789=>1000,28790=>1000,28791=>1000,28792=>1000,28793=>1000,28794=>1000,28795=>1000,28796=>1000,28797=>1000,28798=>1000,28799=>1000,28800=>1000,28801=>1000,28802=>1000,28803=>1000,28804=>1000, - 28805=>1000,28806=>1000,28807=>1000,28808=>1000,28809=>1000,28810=>1000,28811=>1000,28812=>1000,28813=>1000,28814=>1000,28815=>1000,28816=>1000,28817=>1000,28818=>1000,28819=>1000,28820=>1000, - 28821=>1000,28822=>1000,28823=>1000,28824=>1000,28825=>1000,28826=>1000,28827=>1000,28828=>1000,28829=>1000,28830=>1000,28831=>1000,28832=>1000,28833=>1000,28834=>1000,28835=>1000,28836=>1000, - 28837=>1000,28838=>1000,28839=>1000,28840=>1000,28841=>1000,28842=>1000,28843=>1000,28844=>1000,28845=>1000,28846=>1000,28847=>1000,28848=>1000,28849=>1000,28850=>1000,28851=>1000,28852=>1000, - 28853=>1000,28854=>1000,28855=>1000,28856=>1000,28857=>1000,28858=>1000,28859=>1000,28860=>1000,28861=>1000,28862=>1000,28863=>1000,28864=>1000,28865=>1000,28866=>1000,28867=>1000,28868=>1000, - 28869=>1000,28870=>1000,28871=>1000,28872=>1000,28873=>1000,28874=>1000,28875=>1000,28876=>1000,28877=>1000,28878=>1000,28879=>1000,28880=>1000,28881=>1000,28882=>1000,28883=>1000,28884=>1000, - 28885=>1000,28886=>1000,28887=>1000,28888=>1000,28889=>1000,28890=>1000,28891=>1000,28892=>1000,28893=>1000,28894=>1000,28895=>1000,28896=>1000,28897=>1000,28898=>1000,28899=>1000,28900=>1000, - 28901=>1000,28902=>1000,28903=>1000,28904=>1000,28905=>1000,28906=>1000,28907=>1000,28908=>1000,28909=>1000,28910=>1000,28911=>1000,28912=>1000,28913=>1000,28914=>1000,28915=>1000,28916=>1000, - 28917=>1000,28918=>1000,28919=>1000,28920=>1000,28921=>1000,28922=>1000,28923=>1000,28924=>1000,28925=>1000,28926=>1000,28927=>1000,28928=>1000,28929=>1000,28930=>1000,28931=>1000,28932=>1000, - 28933=>1000,28934=>1000,28935=>1000,28936=>1000,28937=>1000,28938=>1000,28939=>1000,28940=>1000,28941=>1000,28942=>1000,28943=>1000,28944=>1000,28945=>1000,28946=>1000,28947=>1000,28948=>1000, - 28949=>1000,28950=>1000,28951=>1000,28952=>1000,28953=>1000,28954=>1000,28955=>1000,28956=>1000,28957=>1000,28958=>1000,28959=>1000,28960=>1000,28961=>1000,28962=>1000,28963=>1000,28964=>1000, - 28965=>1000,28966=>1000,28967=>1000,28968=>1000,28969=>1000,28970=>1000,28971=>1000,28972=>1000,28973=>1000,28974=>1000,28975=>1000,28976=>1000,28977=>1000,28978=>1000,28979=>1000,28980=>1000, - 28981=>1000,28982=>1000,28983=>1000,28984=>1000,28985=>1000,28986=>1000,28987=>1000,28988=>1000,28989=>1000,28990=>1000,28991=>1000,28992=>1000,28993=>1000,28994=>1000,28995=>1000,28996=>1000, - 28997=>1000,28998=>1000,28999=>1000,29000=>1000,29001=>1000,29002=>1000,29003=>1000,29004=>1000,29005=>1000,29006=>1000,29007=>1000,29008=>1000,29009=>1000,29010=>1000,29011=>1000,29012=>1000, - 29013=>1000,29014=>1000,29015=>1000,29016=>1000,29017=>1000,29018=>1000,29019=>1000,29020=>1000,29021=>1000,29022=>1000,29023=>1000,29024=>1000,29025=>1000,29026=>1000,29027=>1000,29028=>1000, - 29029=>1000,29030=>1000,29031=>1000,29032=>1000,29033=>1000,29034=>1000,29035=>1000,29036=>1000,29037=>1000,29038=>1000,29039=>1000,29040=>1000,29041=>1000,29042=>1000,29043=>1000,29044=>1000, - 29045=>1000,29046=>1000,29047=>1000,29048=>1000,29049=>1000,29050=>1000,29051=>1000,29052=>1000,29053=>1000,29054=>1000,29055=>1000,29056=>1000,29057=>1000,29058=>1000,29059=>1000,29060=>1000, - 29061=>1000,29062=>1000,29063=>1000,29064=>1000,29065=>1000,29066=>1000,29067=>1000,29068=>1000,29069=>1000,29070=>1000,29071=>1000,29072=>1000,29073=>1000,29074=>1000,29075=>1000,29076=>1000, - 29077=>1000,29078=>1000,29079=>1000,29080=>1000,29081=>1000,29082=>1000,29083=>1000,29084=>1000,29085=>1000,29086=>1000,29087=>1000,29088=>1000,29089=>1000,29090=>1000,29091=>1000,29092=>1000, - 29093=>1000,29094=>1000,29095=>1000,29096=>1000,29097=>1000,29098=>1000,29099=>1000,29100=>1000,29101=>1000,29102=>1000,29103=>1000,29104=>1000,29105=>1000,29106=>1000,29107=>1000,29108=>1000, - 29109=>1000,29110=>1000,29111=>1000,29112=>1000,29113=>1000,29114=>1000,29115=>1000,29116=>1000,29117=>1000,29118=>1000,29119=>1000,29120=>1000,29121=>1000,29122=>1000,29123=>1000,29124=>1000, - 29125=>1000,29126=>1000,29127=>1000,29128=>1000,29129=>1000,29130=>1000,29131=>1000,29132=>1000,29133=>1000,29134=>1000,29135=>1000,29136=>1000,29137=>1000,29138=>1000,29139=>1000,29140=>1000, - 29141=>1000,29142=>1000,29143=>1000,29144=>1000,29145=>1000,29146=>1000,29147=>1000,29148=>1000,29149=>1000,29150=>1000,29151=>1000,29152=>1000,29153=>1000,29154=>1000,29155=>1000,29156=>1000, - 29157=>1000,29158=>1000,29159=>1000,29160=>1000,29161=>1000,29162=>1000,29163=>1000,29164=>1000,29165=>1000,29166=>1000,29167=>1000,29168=>1000,29169=>1000,29170=>1000,29171=>1000,29172=>1000, - 29173=>1000,29174=>1000,29175=>1000,29176=>1000,29177=>1000,29178=>1000,29179=>1000,29180=>1000,29181=>1000,29182=>1000,29183=>1000,29184=>1000,29185=>1000,29186=>1000,29187=>1000,29188=>1000, - 29189=>1000,29190=>1000,29191=>1000,29192=>1000,29193=>1000,29194=>1000,29195=>1000,29196=>1000,29197=>1000,29198=>1000,29199=>1000,29200=>1000,29201=>1000,29202=>1000,29203=>1000,29204=>1000, - 29205=>1000,29206=>1000,29207=>1000,29208=>1000,29209=>1000,29210=>1000,29211=>1000,29212=>1000,29213=>1000,29214=>1000,29215=>1000,29216=>1000,29217=>1000,29218=>1000,29219=>1000,29220=>1000, - 29221=>1000,29222=>1000,29223=>1000,29224=>1000,29225=>1000,29226=>1000,29227=>1000,29228=>1000,29229=>1000,29230=>1000,29231=>1000,29232=>1000,29233=>1000,29234=>1000,29235=>1000,29236=>1000, - 29237=>1000,29238=>1000,29239=>1000,29240=>1000,29241=>1000,29242=>1000,29243=>1000,29244=>1000,29245=>1000,29246=>1000,29247=>1000,29248=>1000,29249=>1000,29250=>1000,29251=>1000,29252=>1000, - 29253=>1000,29254=>1000,29255=>1000,29256=>1000,29257=>1000,29258=>1000,29259=>1000,29260=>1000,29261=>1000,29262=>1000,29263=>1000,29264=>1000,29265=>1000,29266=>1000,29267=>1000,29268=>1000, - 29269=>1000,29270=>1000,29271=>1000,29272=>1000,29273=>1000,29274=>1000,29275=>1000,29276=>1000,29277=>1000,29278=>1000,29279=>1000,29280=>1000,29281=>1000,29282=>1000,29283=>1000,29284=>1000, - 29285=>1000,29286=>1000,29287=>1000,29288=>1000,29289=>1000,29290=>1000,29291=>1000,29292=>1000,29293=>1000,29294=>1000,29295=>1000,29296=>1000,29297=>1000,29298=>1000,29299=>1000,29300=>1000, - 29301=>1000,29302=>1000,29303=>1000,29304=>1000,29305=>1000,29306=>1000,29307=>1000,29308=>1000,29309=>1000,29310=>1000,29311=>1000,29312=>1000,29313=>1000,29314=>1000,29315=>1000,29316=>1000, - 29317=>1000,29318=>1000,29319=>1000,29320=>1000,29321=>1000,29322=>1000,29323=>1000,29324=>1000,29325=>1000,29326=>1000,29327=>1000,29328=>1000,29329=>1000,29330=>1000,29331=>1000,29332=>1000, - 29333=>1000,29334=>1000,29335=>1000,29336=>1000,29337=>1000,29338=>1000,29339=>1000,29340=>1000,29341=>1000,29342=>1000,29343=>1000,29344=>1000,29345=>1000,29346=>1000,29347=>1000,29348=>1000, - 29349=>1000,29350=>1000,29351=>1000,29352=>1000,29353=>1000,29354=>1000,29355=>1000,29356=>1000,29357=>1000,29358=>1000,29359=>1000,29360=>1000,29361=>1000,29362=>1000,29363=>1000,29364=>1000, - 29365=>1000,29366=>1000,29367=>1000,29368=>1000,29369=>1000,29370=>1000,29371=>1000,29372=>1000,29373=>1000,29374=>1000,29375=>1000,29376=>1000,29377=>1000,29378=>1000,29379=>1000,29380=>1000, - 29381=>1000,29382=>1000,29383=>1000,29384=>1000,29385=>1000,29386=>1000,29387=>1000,29388=>1000,29389=>1000,29390=>1000,29391=>1000,29392=>1000,29393=>1000,29394=>1000,29395=>1000,29396=>1000, - 29397=>1000,29398=>1000,29399=>1000,29400=>1000,29401=>1000,29402=>1000,29403=>1000,29404=>1000,29405=>1000,29406=>1000,29407=>1000,29408=>1000,29409=>1000,29410=>1000,29411=>1000,29412=>1000, - 29413=>1000,29414=>1000,29415=>1000,29416=>1000,29417=>1000,29418=>1000,29419=>1000,29420=>1000,29421=>1000,29422=>1000,29423=>1000,29424=>1000,29425=>1000,29426=>1000,29427=>1000,29428=>1000, - 29429=>1000,29430=>1000,29431=>1000,29432=>1000,29433=>1000,29434=>1000,29435=>1000,29436=>1000,29437=>1000,29438=>1000,29439=>1000,29440=>1000,29441=>1000,29442=>1000,29443=>1000,29444=>1000, - 29445=>1000,29446=>1000,29447=>1000,29448=>1000,29449=>1000,29450=>1000,29451=>1000,29452=>1000,29453=>1000,29454=>1000,29455=>1000,29456=>1000,29457=>1000,29458=>1000,29459=>1000,29460=>1000, - 29461=>1000,29462=>1000,29463=>1000,29464=>1000,29465=>1000,29466=>1000,29467=>1000,29468=>1000,29469=>1000,29470=>1000,29471=>1000,29472=>1000,29473=>1000,29474=>1000,29475=>1000,29476=>1000, - 29477=>1000,29478=>1000,29479=>1000,29480=>1000,29481=>1000,29482=>1000,29483=>1000,29484=>1000,29485=>1000,29486=>1000,29487=>1000,29488=>1000,29489=>1000,29490=>1000,29491=>1000,29492=>1000, - 29493=>1000,29494=>1000,29495=>1000,29496=>1000,29497=>1000,29498=>1000,29499=>1000,29500=>1000,29501=>1000,29502=>1000,29503=>1000,29504=>1000,29505=>1000,29506=>1000,29507=>1000,29508=>1000, - 29509=>1000,29510=>1000,29511=>1000,29512=>1000,29513=>1000,29514=>1000,29515=>1000,29516=>1000,29517=>1000,29518=>1000,29519=>1000,29520=>1000,29521=>1000,29522=>1000,29523=>1000,29524=>1000, - 29525=>1000,29526=>1000,29527=>1000,29528=>1000,29529=>1000,29530=>1000,29531=>1000,29532=>1000,29533=>1000,29534=>1000,29535=>1000,29536=>1000,29537=>1000,29538=>1000,29539=>1000,29540=>1000, - 29541=>1000,29542=>1000,29543=>1000,29544=>1000,29545=>1000,29546=>1000,29547=>1000,29548=>1000,29549=>1000,29550=>1000,29551=>1000,29552=>1000,29553=>1000,29554=>1000,29555=>1000,29556=>1000, - 29557=>1000,29558=>1000,29559=>1000,29560=>1000,29561=>1000,29562=>1000,29563=>1000,29564=>1000,29565=>1000,29566=>1000,29567=>1000,29568=>1000,29569=>1000,29570=>1000,29571=>1000,29572=>1000, - 29573=>1000,29574=>1000,29575=>1000,29576=>1000,29577=>1000,29578=>1000,29579=>1000,29580=>1000,29581=>1000,29582=>1000,29583=>1000,29584=>1000,29585=>1000,29586=>1000,29587=>1000,29588=>1000, - 29589=>1000,29590=>1000,29591=>1000,29592=>1000,29593=>1000,29594=>1000,29595=>1000,29596=>1000,29597=>1000,29598=>1000,29599=>1000,29600=>1000,29601=>1000,29602=>1000,29603=>1000,29604=>1000, - 29605=>1000,29606=>1000,29607=>1000,29608=>1000,29609=>1000,29610=>1000,29611=>1000,29612=>1000,29613=>1000,29614=>1000,29615=>1000,29616=>1000,29617=>1000,29618=>1000,29619=>1000,29620=>1000, - 29621=>1000,29622=>1000,29623=>1000,29624=>1000,29625=>1000,29626=>1000,29627=>1000,29628=>1000,29629=>1000,29630=>1000,29631=>1000,29632=>1000,29633=>1000,29634=>1000,29635=>1000,29636=>1000, - 29637=>1000,29638=>1000,29639=>1000,29640=>1000,29641=>1000,29642=>1000,29643=>1000,29644=>1000,29645=>1000,29646=>1000,29647=>1000,29648=>1000,29649=>1000,29650=>1000,29651=>1000,29652=>1000, - 29653=>1000,29654=>1000,29655=>1000,29656=>1000,29657=>1000,29658=>1000,29659=>1000,29660=>1000,29661=>1000,29662=>1000,29663=>1000,29664=>1000,29665=>1000,29666=>1000,29667=>1000,29668=>1000, - 29669=>1000,29670=>1000,29671=>1000,29672=>1000,29673=>1000,29674=>1000,29675=>1000,29676=>1000,29677=>1000,29678=>1000,29679=>1000,29680=>1000,29681=>1000,29682=>1000,29683=>1000,29684=>1000, - 29685=>1000,29686=>1000,29687=>1000,29688=>1000,29689=>1000,29690=>1000,29691=>1000,29692=>1000,29693=>1000,29694=>1000,29695=>1000,29696=>1000,29697=>1000,29698=>1000,29699=>1000,29700=>1000, - 29701=>1000,29702=>1000,29703=>1000,29704=>1000,29705=>1000,29706=>1000,29707=>1000,29708=>1000,29709=>1000,29710=>1000,29711=>1000,29712=>1000,29713=>1000,29714=>1000,29715=>1000,29716=>1000, - 29717=>1000,29718=>1000,29719=>1000,29720=>1000,29721=>1000,29722=>1000,29723=>1000,29724=>1000,29725=>1000,29726=>1000,29727=>1000,29728=>1000,29729=>1000,29730=>1000,29731=>1000,29732=>1000, - 29733=>1000,29734=>1000,29735=>1000,29736=>1000,29737=>1000,29738=>1000,29739=>1000,29740=>1000,29741=>1000,29742=>1000,29743=>1000,29744=>1000,29745=>1000,29746=>1000,29747=>1000,29748=>1000, - 29749=>1000,29750=>1000,29751=>1000,29752=>1000,29753=>1000,29754=>1000,29755=>1000,29756=>1000,29757=>1000,29758=>1000,29759=>1000,29760=>1000,29761=>1000,29762=>1000,29763=>1000,29764=>1000, - 29765=>1000,29766=>1000,29767=>1000,29768=>1000,29769=>1000,29770=>1000,29771=>1000,29772=>1000,29773=>1000,29774=>1000,29775=>1000,29776=>1000,29777=>1000,29778=>1000,29779=>1000,29780=>1000, - 29781=>1000,29782=>1000,29783=>1000,29784=>1000,29785=>1000,29786=>1000,29787=>1000,29788=>1000,29789=>1000,29790=>1000,29791=>1000,29792=>1000,29793=>1000,29794=>1000,29795=>1000,29796=>1000, - 29797=>1000,29798=>1000,29799=>1000,29800=>1000,29801=>1000,29802=>1000,29803=>1000,29804=>1000,29805=>1000,29806=>1000,29807=>1000,29808=>1000,29809=>1000,29810=>1000,29811=>1000,29812=>1000, - 29813=>1000,29814=>1000,29815=>1000,29816=>1000,29817=>1000,29818=>1000,29819=>1000,29820=>1000,29821=>1000,29822=>1000,29823=>1000,29824=>1000,29825=>1000,29826=>1000,29827=>1000,29828=>1000, - 29829=>1000,29830=>1000,29831=>1000,29832=>1000,29833=>1000,29834=>1000,29835=>1000,29836=>1000,29837=>1000,29838=>1000,29839=>1000,29840=>1000,29841=>1000,29842=>1000,29843=>1000,29844=>1000, - 29845=>1000,29846=>1000,29847=>1000,29848=>1000,29849=>1000,29850=>1000,29851=>1000,29852=>1000,29853=>1000,29854=>1000,29855=>1000,29856=>1000,29857=>1000,29858=>1000,29859=>1000,29860=>1000, - 29861=>1000,29862=>1000,29863=>1000,29864=>1000,29865=>1000,29866=>1000,29867=>1000,29868=>1000,29869=>1000,29870=>1000,29871=>1000,29872=>1000,29873=>1000,29874=>1000,29875=>1000,29876=>1000, - 29877=>1000,29878=>1000,29879=>1000,29880=>1000,29881=>1000,29882=>1000,29883=>1000,29884=>1000,29885=>1000,29886=>1000,29887=>1000,29888=>1000,29889=>1000,29890=>1000,29891=>1000,29892=>1000, - 29893=>1000,29894=>1000,29895=>1000,29896=>1000,29897=>1000,29898=>1000,29899=>1000,29900=>1000,29901=>1000,29902=>1000,29903=>1000,29904=>1000,29905=>1000,29906=>1000,29907=>1000,29908=>1000, - 29909=>1000,29910=>1000,29911=>1000,29912=>1000,29913=>1000,29914=>1000,29915=>1000,29916=>1000,29917=>1000,29918=>1000,29919=>1000,29920=>1000,29921=>1000,29922=>1000,29923=>1000,29924=>1000, - 29925=>1000,29926=>1000,29927=>1000,29928=>1000,29929=>1000,29930=>1000,29931=>1000,29932=>1000,29933=>1000,29934=>1000,29935=>1000,29936=>1000,29937=>1000,29938=>1000,29939=>1000,29940=>1000, - 29941=>1000,29942=>1000,29943=>1000,29944=>1000,29945=>1000,29946=>1000,29947=>1000,29948=>1000,29949=>1000,29950=>1000,29951=>1000,29952=>1000,29953=>1000,29954=>1000,29955=>1000,29956=>1000, - 29957=>1000,29958=>1000,29959=>1000,29960=>1000,29961=>1000,29962=>1000,29963=>1000,29964=>1000,29965=>1000,29966=>1000,29967=>1000,29968=>1000,29969=>1000,29970=>1000,29971=>1000,29972=>1000, - 29973=>1000,29974=>1000,29975=>1000,29976=>1000,29977=>1000,29978=>1000,29979=>1000,29980=>1000,29981=>1000,29982=>1000,29983=>1000,29984=>1000,29985=>1000,29986=>1000,29987=>1000,29988=>1000, - 29989=>1000,29990=>1000,29991=>1000,29992=>1000,29993=>1000,29994=>1000,29995=>1000,29996=>1000,29997=>1000,29998=>1000,29999=>1000,30000=>1000,30001=>1000,30002=>1000,30003=>1000,30004=>1000, - 30005=>1000,30006=>1000,30007=>1000,30008=>1000,30009=>1000,30010=>1000,30011=>1000,30012=>1000,30013=>1000,30014=>1000,30015=>1000,30016=>1000,30017=>1000,30018=>1000,30019=>1000,30020=>1000, - 30021=>1000,30022=>1000,30023=>1000,30024=>1000,30025=>1000,30026=>1000,30027=>1000,30028=>1000,30029=>1000,30030=>1000,30031=>1000,30032=>1000,30033=>1000,30034=>1000,30035=>1000,30036=>1000, - 30037=>1000,30038=>1000,30039=>1000,30040=>1000,30041=>1000,30042=>1000,30043=>1000,30044=>1000,30045=>1000,30046=>1000,30047=>1000,30048=>1000,30049=>1000,30050=>1000,30051=>1000,30052=>1000, - 30053=>1000,30054=>1000,30055=>1000,30056=>1000,30057=>1000,30058=>1000,30059=>1000,30060=>1000,30061=>1000,30062=>1000,30063=>1000,30064=>1000,30065=>1000,30066=>1000,30067=>1000,30068=>1000, - 30069=>1000,30070=>1000,30071=>1000,30072=>1000,30073=>1000,30074=>1000,30075=>1000,30076=>1000,30077=>1000,30078=>1000,30079=>1000,30080=>1000,30081=>1000,30082=>1000,30083=>1000,30084=>1000, - 30085=>1000,30086=>1000,30087=>1000,30088=>1000,30089=>1000,30090=>1000,30091=>1000,30092=>1000,30093=>1000,30094=>1000,30095=>1000,30096=>1000,30097=>1000,30098=>1000,30099=>1000,30100=>1000, - 30101=>1000,30102=>1000,30103=>1000,30104=>1000,30105=>1000,30106=>1000,30107=>1000,30108=>1000,30109=>1000,30110=>1000,30111=>1000,30112=>1000,30113=>1000,30114=>1000,30115=>1000,30116=>1000, - 30117=>1000,30118=>1000,30119=>1000,30120=>1000,30121=>1000,30122=>1000,30123=>1000,30124=>1000,30125=>1000,30126=>1000,30127=>1000,30128=>1000,30129=>1000,30130=>1000,30131=>1000,30132=>1000, - 30133=>1000,30134=>1000,30135=>1000,30136=>1000,30137=>1000,30138=>1000,30139=>1000,30140=>1000,30141=>1000,30142=>1000,30143=>1000,30144=>1000,30145=>1000,30146=>1000,30147=>1000,30148=>1000, - 30149=>1000,30150=>1000,30151=>1000,30152=>1000,30153=>1000,30154=>1000,30155=>1000,30156=>1000,30157=>1000,30158=>1000,30159=>1000,30160=>1000,30161=>1000,30162=>1000,30163=>1000,30164=>1000, - 30165=>1000,30166=>1000,30167=>1000,30168=>1000,30169=>1000,30170=>1000,30171=>1000,30172=>1000,30173=>1000,30174=>1000,30175=>1000,30176=>1000,30177=>1000,30178=>1000,30179=>1000,30180=>1000, - 30181=>1000,30182=>1000,30183=>1000,30184=>1000,30185=>1000,30186=>1000,30187=>1000,30188=>1000,30189=>1000,30190=>1000,30191=>1000,30192=>1000,30193=>1000,30194=>1000,30195=>1000,30196=>1000, - 30197=>1000,30198=>1000,30199=>1000,30200=>1000,30201=>1000,30202=>1000,30203=>1000,30204=>1000,30205=>1000,30206=>1000,30207=>1000,30208=>1000,30209=>1000,30210=>1000,30211=>1000,30212=>1000, - 30213=>1000,30214=>1000,30215=>1000,30216=>1000,30217=>1000,30218=>1000,30219=>1000,30220=>1000,30221=>1000,30222=>1000,30223=>1000,30224=>1000,30225=>1000,30226=>1000,30227=>1000,30228=>1000, - 30229=>1000,30230=>1000,30231=>1000,30232=>1000,30233=>1000,30234=>1000,30235=>1000,30236=>1000,30237=>1000,30238=>1000,30239=>1000,30240=>1000,30241=>1000,30242=>1000,30243=>1000,30244=>1000, - 30245=>1000,30246=>1000,30247=>1000,30248=>1000,30249=>1000,30250=>1000,30251=>1000,30252=>1000,30253=>1000,30254=>1000,30255=>1000,30256=>1000,30257=>1000,30258=>1000,30259=>1000,30260=>1000, - 30261=>1000,30262=>1000,30263=>1000,30264=>1000,30265=>1000,30266=>1000,30267=>1000,30268=>1000,30269=>1000,30270=>1000,30271=>1000,30272=>1000,30273=>1000,30274=>1000,30275=>1000,30276=>1000, - 30277=>1000,30278=>1000,30279=>1000,30280=>1000,30281=>1000,30282=>1000,30283=>1000,30284=>1000,30285=>1000,30286=>1000,30287=>1000,30288=>1000,30289=>1000,30290=>1000,30291=>1000,30292=>1000, - 30293=>1000,30294=>1000,30295=>1000,30296=>1000,30297=>1000,30298=>1000,30299=>1000,30300=>1000,30301=>1000,30302=>1000,30303=>1000,30304=>1000,30305=>1000,30306=>1000,30307=>1000,30308=>1000, - 30309=>1000,30310=>1000,30311=>1000,30312=>1000,30313=>1000,30314=>1000,30315=>1000,30316=>1000,30317=>1000,30318=>1000,30319=>1000,30320=>1000,30321=>1000,30322=>1000,30323=>1000,30324=>1000, - 30325=>1000,30326=>1000,30327=>1000,30328=>1000,30329=>1000,30330=>1000,30331=>1000,30332=>1000,30333=>1000,30334=>1000,30335=>1000,30336=>1000,30337=>1000,30338=>1000,30339=>1000,30340=>1000, - 30341=>1000,30342=>1000,30343=>1000,30344=>1000,30345=>1000,30346=>1000,30347=>1000,30348=>1000,30349=>1000,30350=>1000,30351=>1000,30352=>1000,30353=>1000,30354=>1000,30355=>1000,30356=>1000, - 30357=>1000,30358=>1000,30359=>1000,30360=>1000,30361=>1000,30362=>1000,30363=>1000,30364=>1000,30365=>1000,30366=>1000,30367=>1000,30368=>1000,30369=>1000,30370=>1000,30371=>1000,30372=>1000, - 30373=>1000,30374=>1000,30375=>1000,30376=>1000,30377=>1000,30378=>1000,30379=>1000,30380=>1000,30381=>1000,30382=>1000,30383=>1000,30384=>1000,30385=>1000,30386=>1000,30387=>1000,30388=>1000, - 30389=>1000,30390=>1000,30391=>1000,30392=>1000,30393=>1000,30394=>1000,30395=>1000,30396=>1000,30397=>1000,30398=>1000,30399=>1000,30400=>1000,30401=>1000,30402=>1000,30403=>1000,30404=>1000, - 30405=>1000,30406=>1000,30407=>1000,30408=>1000,30409=>1000,30410=>1000,30411=>1000,30412=>1000,30413=>1000,30414=>1000,30415=>1000,30416=>1000,30417=>1000,30418=>1000,30419=>1000,30420=>1000, - 30421=>1000,30422=>1000,30423=>1000,30424=>1000,30425=>1000,30426=>1000,30427=>1000,30428=>1000,30429=>1000,30430=>1000,30431=>1000,30432=>1000,30433=>1000,30434=>1000,30435=>1000,30436=>1000, - 30437=>1000,30438=>1000,30439=>1000,30440=>1000,30441=>1000,30442=>1000,30443=>1000,30444=>1000,30445=>1000,30446=>1000,30447=>1000,30448=>1000,30449=>1000,30450=>1000,30451=>1000,30452=>1000, - 30453=>1000,30454=>1000,30455=>1000,30456=>1000,30457=>1000,30458=>1000,30459=>1000,30460=>1000,30461=>1000,30462=>1000,30463=>1000,30464=>1000,30465=>1000,30466=>1000,30467=>1000,30468=>1000, - 30469=>1000,30470=>1000,30471=>1000,30472=>1000,30473=>1000,30474=>1000,30475=>1000,30476=>1000,30477=>1000,30478=>1000,30479=>1000,30480=>1000,30481=>1000,30482=>1000,30483=>1000,30484=>1000, - 30485=>1000,30486=>1000,30487=>1000,30488=>1000,30489=>1000,30490=>1000,30491=>1000,30492=>1000,30493=>1000,30494=>1000,30495=>1000,30496=>1000,30497=>1000,30498=>1000,30499=>1000,30500=>1000, - 30501=>1000,30502=>1000,30503=>1000,30504=>1000,30505=>1000,30506=>1000,30507=>1000,30508=>1000,30509=>1000,30510=>1000,30511=>1000,30512=>1000,30513=>1000,30514=>1000,30515=>1000,30516=>1000, - 30517=>1000,30518=>1000,30519=>1000,30520=>1000,30521=>1000,30522=>1000,30523=>1000,30524=>1000,30525=>1000,30526=>1000,30527=>1000,30528=>1000,30529=>1000,30530=>1000,30531=>1000,30532=>1000, - 30533=>1000,30534=>1000,30535=>1000,30536=>1000,30537=>1000,30538=>1000,30539=>1000,30540=>1000,30541=>1000,30542=>1000,30543=>1000,30544=>1000,30545=>1000,30546=>1000,30547=>1000,30548=>1000, - 30549=>1000,30550=>1000,30551=>1000,30552=>1000,30553=>1000,30554=>1000,30555=>1000,30556=>1000,30557=>1000,30558=>1000,30559=>1000,30560=>1000,30561=>1000,30562=>1000,30563=>1000,30564=>1000, - 30565=>1000,30566=>1000,30567=>1000,30568=>1000,30569=>1000,30570=>1000,30571=>1000,30572=>1000,30573=>1000,30574=>1000,30575=>1000,30576=>1000,30577=>1000,30578=>1000,30579=>1000,30580=>1000, - 30581=>1000,30582=>1000,30583=>1000,30584=>1000,30585=>1000,30586=>1000,30587=>1000,30588=>1000,30589=>1000,30590=>1000,30591=>1000,30592=>1000,30593=>1000,30594=>1000,30595=>1000,30596=>1000, - 30597=>1000,30598=>1000,30599=>1000,30600=>1000,30601=>1000,30602=>1000,30603=>1000,30604=>1000,30605=>1000,30606=>1000,30607=>1000,30608=>1000,30609=>1000,30610=>1000,30611=>1000,30612=>1000, - 30613=>1000,30614=>1000,30615=>1000,30616=>1000,30617=>1000,30618=>1000,30619=>1000,30620=>1000,30621=>1000,30622=>1000,30623=>1000,30624=>1000,30625=>1000,30626=>1000,30627=>1000,30628=>1000, - 30629=>1000,30630=>1000,30631=>1000,30632=>1000,30633=>1000,30634=>1000,30635=>1000,30636=>1000,30637=>1000,30638=>1000,30639=>1000,30640=>1000,30641=>1000,30642=>1000,30643=>1000,30644=>1000, - 30645=>1000,30646=>1000,30647=>1000,30648=>1000,30649=>1000,30650=>1000,30651=>1000,30652=>1000,30653=>1000,30654=>1000,30655=>1000,30656=>1000,30657=>1000,30658=>1000,30659=>1000,30660=>1000, - 30661=>1000,30662=>1000,30663=>1000,30664=>1000,30665=>1000,30666=>1000,30667=>1000,30668=>1000,30669=>1000,30670=>1000,30671=>1000,30672=>1000,30673=>1000,30674=>1000,30675=>1000,30676=>1000, - 30677=>1000,30678=>1000,30679=>1000,30680=>1000,30681=>1000,30682=>1000,30683=>1000,30684=>1000,30685=>1000,30686=>1000,30687=>1000,30688=>1000,30689=>1000,30690=>1000,30691=>1000,30692=>1000, - 30693=>1000,30694=>1000,30695=>1000,30696=>1000,30697=>1000,30698=>1000,30699=>1000,30700=>1000,30701=>1000,30702=>1000,30703=>1000,30704=>1000,30705=>1000,30706=>1000,30707=>1000,30708=>1000, - 30709=>1000,30710=>1000,30711=>1000,30712=>1000,30713=>1000,30714=>1000,30715=>1000,30716=>1000,30717=>1000,30718=>1000,30719=>1000,30720=>1000,30721=>1000,30722=>1000,30723=>1000,30724=>1000, - 30725=>1000,30726=>1000,30727=>1000,30728=>1000,30729=>1000,30730=>1000,30731=>1000,30732=>1000,30733=>1000,30734=>1000,30735=>1000,30736=>1000,30737=>1000,30738=>1000,30739=>1000,30740=>1000, - 30741=>1000,30742=>1000,30743=>1000,30744=>1000,30745=>1000,30746=>1000,30747=>1000,30748=>1000,30749=>1000,30750=>1000,30751=>1000,30752=>1000,30753=>1000,30754=>1000,30755=>1000,30756=>1000, - 30757=>1000,30758=>1000,30759=>1000,30760=>1000,30761=>1000,30762=>1000,30763=>1000,30764=>1000,30765=>1000,30766=>1000,30767=>1000,30768=>1000,30769=>1000,30770=>1000,30771=>1000,30772=>1000, - 30773=>1000,30774=>1000,30775=>1000,30776=>1000,30777=>1000,30778=>1000,30779=>1000,30780=>1000,30781=>1000,30782=>1000,30783=>1000,30784=>1000,30785=>1000,30786=>1000,30787=>1000,30788=>1000, - 30789=>1000,30790=>1000,30791=>1000,30792=>1000,30793=>1000,30794=>1000,30795=>1000,30796=>1000,30797=>1000,30798=>1000,30799=>1000,30800=>1000,30801=>1000,30802=>1000,30803=>1000,30804=>1000, - 30805=>1000,30806=>1000,30807=>1000,30808=>1000,30809=>1000,30810=>1000,30811=>1000,30812=>1000,30813=>1000,30814=>1000,30815=>1000,30816=>1000,30817=>1000,30818=>1000,30819=>1000,30820=>1000, - 30821=>1000,30822=>1000,30823=>1000,30824=>1000,30825=>1000,30826=>1000,30827=>1000,30828=>1000,30829=>1000,30830=>1000,30831=>1000,30832=>1000,30833=>1000,30834=>1000,30835=>1000,30836=>1000, - 30837=>1000,30838=>1000,30839=>1000,30840=>1000,30841=>1000,30842=>1000,30843=>1000,30844=>1000,30845=>1000,30846=>1000,30847=>1000,30848=>1000,30849=>1000,30850=>1000,30851=>1000,30852=>1000, - 30853=>1000,30854=>1000,30855=>1000,30856=>1000,30857=>1000,30858=>1000,30859=>1000,30860=>1000,30861=>1000,30862=>1000,30863=>1000,30864=>1000,30865=>1000,30866=>1000,30867=>1000,30868=>1000, - 30869=>1000,30870=>1000,30871=>1000,30872=>1000,30873=>1000,30874=>1000,30875=>1000,30876=>1000,30877=>1000,30878=>1000,30879=>1000,30880=>1000,30881=>1000,30882=>1000,30883=>1000,30884=>1000, - 30885=>1000,30886=>1000,30887=>1000,30888=>1000,30889=>1000,30890=>1000,30891=>1000,30892=>1000,30893=>1000,30894=>1000,30895=>1000,30896=>1000,30897=>1000,30898=>1000,30899=>1000,30900=>1000, - 30901=>1000,30902=>1000,30903=>1000,30904=>1000,30905=>1000,30906=>1000,30907=>1000,30908=>1000,30909=>1000,30910=>1000,30911=>1000,30912=>1000,30913=>1000,30914=>1000,30915=>1000,30916=>1000, - 30917=>1000,30918=>1000,30919=>1000,30920=>1000,30921=>1000,30922=>1000,30923=>1000,30924=>1000,30925=>1000,30926=>1000,30927=>1000,30928=>1000,30929=>1000,30930=>1000,30931=>1000,30932=>1000, - 30933=>1000,30934=>1000,30935=>1000,30936=>1000,30937=>1000,30938=>1000,30939=>1000,30940=>1000,30941=>1000,30942=>1000,30943=>1000,30944=>1000,30945=>1000,30946=>1000,30947=>1000,30948=>1000, - 30949=>1000,30950=>1000,30951=>1000,30952=>1000,30953=>1000,30954=>1000,30955=>1000,30956=>1000,30957=>1000,30958=>1000,30959=>1000,30960=>1000,30961=>1000,30962=>1000,30963=>1000,30964=>1000, - 30965=>1000,30966=>1000,30967=>1000,30968=>1000,30969=>1000,30970=>1000,30971=>1000,30972=>1000,30973=>1000,30974=>1000,30975=>1000,30976=>1000,30977=>1000,30978=>1000,30979=>1000,30980=>1000, - 30981=>1000,30982=>1000,30983=>1000,30984=>1000,30985=>1000,30986=>1000,30987=>1000,30988=>1000,30989=>1000,30990=>1000,30991=>1000,30992=>1000,30993=>1000,30994=>1000,30995=>1000,30996=>1000, - 30997=>1000,30998=>1000,30999=>1000,31000=>1000,31001=>1000,31002=>1000,31003=>1000,31004=>1000,31005=>1000,31006=>1000,31007=>1000,31008=>1000,31009=>1000,31010=>1000,31011=>1000,31012=>1000, - 31013=>1000,31014=>1000,31015=>1000,31016=>1000,31017=>1000,31018=>1000,31019=>1000,31020=>1000,31021=>1000,31022=>1000,31023=>1000,31024=>1000,31025=>1000,31026=>1000,31027=>1000,31028=>1000, - 31029=>1000,31030=>1000,31031=>1000,31032=>1000,31033=>1000,31034=>1000,31035=>1000,31036=>1000,31037=>1000,31038=>1000,31039=>1000,31040=>1000,31041=>1000,31042=>1000,31043=>1000,31044=>1000, - 31045=>1000,31046=>1000,31047=>1000,31048=>1000,31049=>1000,31050=>1000,31051=>1000,31052=>1000,31053=>1000,31054=>1000,31055=>1000,31056=>1000,31057=>1000,31058=>1000,31059=>1000,31060=>1000, - 31061=>1000,31062=>1000,31063=>1000,31064=>1000,31065=>1000,31066=>1000,31067=>1000,31068=>1000,31069=>1000,31070=>1000,31071=>1000,31072=>1000,31073=>1000,31074=>1000,31075=>1000,31076=>1000, - 31077=>1000,31078=>1000,31079=>1000,31080=>1000,31081=>1000,31082=>1000,31083=>1000,31084=>1000,31085=>1000,31086=>1000,31087=>1000,31088=>1000,31089=>1000,31090=>1000,31091=>1000,31092=>1000, - 31093=>1000,31094=>1000,31095=>1000,31096=>1000,31097=>1000,31098=>1000,31099=>1000,31100=>1000,31101=>1000,31102=>1000,31103=>1000,31104=>1000,31105=>1000,31106=>1000,31107=>1000,31108=>1000, - 31109=>1000,31110=>1000,31111=>1000,31112=>1000,31113=>1000,31114=>1000,31115=>1000,31116=>1000,31117=>1000,31118=>1000,31119=>1000,31120=>1000,31121=>1000,31122=>1000,31123=>1000,31124=>1000, - 31125=>1000,31126=>1000,31127=>1000,31128=>1000,31129=>1000,31130=>1000,31131=>1000,31132=>1000,31133=>1000,31134=>1000,31135=>1000,31136=>1000,31137=>1000,31138=>1000,31139=>1000,31140=>1000, - 31141=>1000,31142=>1000,31143=>1000,31144=>1000,31145=>1000,31146=>1000,31147=>1000,31148=>1000,31149=>1000,31150=>1000,31151=>1000,31152=>1000,31153=>1000,31154=>1000,31155=>1000,31156=>1000, - 31157=>1000,31158=>1000,31159=>1000,31160=>1000,31161=>1000,31162=>1000,31163=>1000,31164=>1000,31165=>1000,31166=>1000,31167=>1000,31168=>1000,31169=>1000,31170=>1000,31171=>1000,31172=>1000, - 31173=>1000,31174=>1000,31175=>1000,31176=>1000,31177=>1000,31178=>1000,31179=>1000,31180=>1000,31181=>1000,31182=>1000,31183=>1000,31184=>1000,31185=>1000,31186=>1000,31187=>1000,31188=>1000, - 31189=>1000,31190=>1000,31191=>1000,31192=>1000,31193=>1000,31194=>1000,31195=>1000,31196=>1000,31197=>1000,31198=>1000,31199=>1000,31200=>1000,31201=>1000,31202=>1000,31203=>1000,31204=>1000, - 31205=>1000,31206=>1000,31207=>1000,31208=>1000,31209=>1000,31210=>1000,31211=>1000,31212=>1000,31213=>1000,31214=>1000,31215=>1000,31216=>1000,31217=>1000,31218=>1000,31219=>1000,31220=>1000, - 31221=>1000,31222=>1000,31223=>1000,31224=>1000,31225=>1000,31226=>1000,31227=>1000,31228=>1000,31229=>1000,31230=>1000,31231=>1000,31232=>1000,31233=>1000,31234=>1000,31235=>1000,31236=>1000, - 31237=>1000,31238=>1000,31239=>1000,31240=>1000,31241=>1000,31242=>1000,31243=>1000,31244=>1000,31245=>1000,31246=>1000,31247=>1000,31248=>1000,31249=>1000,31250=>1000,31251=>1000,31252=>1000, - 31253=>1000,31254=>1000,31255=>1000,31256=>1000,31257=>1000,31258=>1000,31259=>1000,31260=>1000,31261=>1000,31262=>1000,31263=>1000,31264=>1000,31265=>1000,31266=>1000,31267=>1000,31268=>1000, - 31269=>1000,31270=>1000,31271=>1000,31272=>1000,31273=>1000,31274=>1000,31275=>1000,31276=>1000,31277=>1000,31278=>1000,31279=>1000,31280=>1000,31281=>1000,31282=>1000,31283=>1000,31284=>1000, - 31285=>1000,31286=>1000,31287=>1000,31288=>1000,31289=>1000,31290=>1000,31291=>1000,31292=>1000,31293=>1000,31294=>1000,31295=>1000,31296=>1000,31297=>1000,31298=>1000,31299=>1000,31300=>1000, - 31301=>1000,31302=>1000,31303=>1000,31304=>1000,31305=>1000,31306=>1000,31307=>1000,31308=>1000,31309=>1000,31310=>1000,31311=>1000,31312=>1000,31313=>1000,31314=>1000,31315=>1000,31316=>1000, - 31317=>1000,31318=>1000,31319=>1000,31320=>1000,31321=>1000,31322=>1000,31323=>1000,31324=>1000,31325=>1000,31326=>1000,31327=>1000,31328=>1000,31329=>1000,31330=>1000,31331=>1000,31332=>1000, - 31333=>1000,31334=>1000,31335=>1000,31336=>1000,31337=>1000,31338=>1000,31339=>1000,31340=>1000,31341=>1000,31342=>1000,31343=>1000,31344=>1000,31345=>1000,31346=>1000,31347=>1000,31348=>1000, - 31349=>1000,31350=>1000,31351=>1000,31352=>1000,31353=>1000,31354=>1000,31355=>1000,31356=>1000,31357=>1000,31358=>1000,31359=>1000,31360=>1000,31361=>1000,31362=>1000,31363=>1000,31364=>1000, - 31365=>1000,31366=>1000,31367=>1000,31368=>1000,31369=>1000,31370=>1000,31371=>1000,31372=>1000,31373=>1000,31374=>1000,31375=>1000,31376=>1000,31377=>1000,31378=>1000,31379=>1000,31380=>1000, - 31381=>1000,31382=>1000,31383=>1000,31384=>1000,31385=>1000,31386=>1000,31387=>1000,31388=>1000,31389=>1000,31390=>1000,31391=>1000,31392=>1000,31393=>1000,31394=>1000,31395=>1000,31396=>1000, - 31397=>1000,31398=>1000,31399=>1000,31400=>1000,31401=>1000,31402=>1000,31403=>1000,31404=>1000,31405=>1000,31406=>1000,31407=>1000,31408=>1000,31409=>1000,31410=>1000,31411=>1000,31412=>1000, - 31413=>1000,31414=>1000,31415=>1000,31416=>1000,31417=>1000,31418=>1000,31419=>1000,31420=>1000,31421=>1000,31422=>1000,31423=>1000,31424=>1000,31425=>1000,31426=>1000,31427=>1000,31428=>1000, - 31429=>1000,31430=>1000,31431=>1000,31432=>1000,31433=>1000,31434=>1000,31435=>1000,31436=>1000,31437=>1000,31438=>1000,31439=>1000,31440=>1000,31441=>1000,31442=>1000,31443=>1000,31444=>1000, - 31445=>1000,31446=>1000,31447=>1000,31448=>1000,31449=>1000,31450=>1000,31451=>1000,31452=>1000,31453=>1000,31454=>1000,31455=>1000,31456=>1000,31457=>1000,31458=>1000,31459=>1000,31460=>1000, - 31461=>1000,31462=>1000,31463=>1000,31464=>1000,31465=>1000,31466=>1000,31467=>1000,31468=>1000,31469=>1000,31470=>1000,31471=>1000,31472=>1000,31473=>1000,31474=>1000,31475=>1000,31476=>1000, - 31477=>1000,31478=>1000,31479=>1000,31480=>1000,31481=>1000,31482=>1000,31483=>1000,31484=>1000,31485=>1000,31486=>1000,31487=>1000,31488=>1000,31489=>1000,31490=>1000,31491=>1000,31492=>1000, - 31493=>1000,31494=>1000,31495=>1000,31496=>1000,31497=>1000,31498=>1000,31499=>1000,31500=>1000,31501=>1000,31502=>1000,31503=>1000,31504=>1000,31505=>1000,31506=>1000,31507=>1000,31508=>1000, - 31509=>1000,31510=>1000,31511=>1000,31512=>1000,31513=>1000,31514=>1000,31515=>1000,31516=>1000,31517=>1000,31518=>1000,31519=>1000,31520=>1000,31521=>1000,31522=>1000,31523=>1000,31524=>1000, - 31525=>1000,31526=>1000,31527=>1000,31528=>1000,31529=>1000,31530=>1000,31531=>1000,31532=>1000,31533=>1000,31534=>1000,31535=>1000,31536=>1000,31537=>1000,31538=>1000,31539=>1000,31540=>1000, - 31541=>1000,31542=>1000,31543=>1000,31544=>1000,31545=>1000,31546=>1000,31547=>1000,31548=>1000,31549=>1000,31550=>1000,31551=>1000,31552=>1000,31553=>1000,31554=>1000,31555=>1000,31556=>1000, - 31557=>1000,31558=>1000,31559=>1000,31560=>1000,31561=>1000,31562=>1000,31563=>1000,31564=>1000,31565=>1000,31566=>1000,31567=>1000,31568=>1000,31569=>1000,31570=>1000,31571=>1000,31572=>1000, - 31573=>1000,31574=>1000,31575=>1000,31576=>1000,31577=>1000,31578=>1000,31579=>1000,31580=>1000,31581=>1000,31582=>1000,31583=>1000,31584=>1000,31585=>1000,31586=>1000,31587=>1000,31588=>1000, - 31589=>1000,31590=>1000,31591=>1000,31592=>1000,31593=>1000,31594=>1000,31595=>1000,31596=>1000,31597=>1000,31598=>1000,31599=>1000,31600=>1000,31601=>1000,31602=>1000,31603=>1000,31604=>1000, - 31605=>1000,31606=>1000,31607=>1000,31608=>1000,31609=>1000,31610=>1000,31611=>1000,31612=>1000,31613=>1000,31614=>1000,31615=>1000,31616=>1000,31617=>1000,31618=>1000,31619=>1000,31620=>1000, - 31621=>1000,31622=>1000,31623=>1000,31624=>1000,31625=>1000,31626=>1000,31627=>1000,31628=>1000,31629=>1000,31630=>1000,31631=>1000,31632=>1000,31633=>1000,31634=>1000,31635=>1000,31636=>1000, - 31637=>1000,31638=>1000,31639=>1000,31640=>1000,31641=>1000,31642=>1000,31643=>1000,31644=>1000,31645=>1000,31646=>1000,31647=>1000,31648=>1000,31649=>1000,31650=>1000,31651=>1000,31652=>1000, - 31653=>1000,31654=>1000,31655=>1000,31656=>1000,31657=>1000,31658=>1000,31659=>1000,31660=>1000,31661=>1000,31662=>1000,31663=>1000,31664=>1000,31665=>1000,31666=>1000,31667=>1000,31668=>1000, - 31669=>1000,31670=>1000,31671=>1000,31672=>1000,31673=>1000,31674=>1000,31675=>1000,31676=>1000,31677=>1000,31678=>1000,31679=>1000,31680=>1000,31681=>1000,31682=>1000,31683=>1000,31684=>1000, - 31685=>1000,31686=>1000,31687=>1000,31688=>1000,31689=>1000,31690=>1000,31691=>1000,31692=>1000,31693=>1000,31694=>1000,31695=>1000,31696=>1000,31697=>1000,31698=>1000,31699=>1000,31700=>1000, - 31701=>1000,31702=>1000,31703=>1000,31704=>1000,31705=>1000,31706=>1000,31707=>1000,31708=>1000,31709=>1000,31710=>1000,31711=>1000,31712=>1000,31713=>1000,31714=>1000,31715=>1000,31716=>1000, - 31717=>1000,31718=>1000,31719=>1000,31720=>1000,31721=>1000,31722=>1000,31723=>1000,31724=>1000,31725=>1000,31726=>1000,31727=>1000,31728=>1000,31729=>1000,31730=>1000,31731=>1000,31732=>1000, - 31733=>1000,31734=>1000,31735=>1000,31736=>1000,31737=>1000,31738=>1000,31739=>1000,31740=>1000,31741=>1000,31742=>1000,31743=>1000,31744=>1000,31745=>1000,31746=>1000,31747=>1000,31748=>1000, - 31749=>1000,31750=>1000,31751=>1000,31752=>1000,31753=>1000,31754=>1000,31755=>1000,31756=>1000,31757=>1000,31758=>1000,31759=>1000,31760=>1000,31761=>1000,31762=>1000,31763=>1000,31764=>1000, - 31765=>1000,31766=>1000,31767=>1000,31768=>1000,31769=>1000,31770=>1000,31771=>1000,31772=>1000,31773=>1000,31774=>1000,31775=>1000,31776=>1000,31777=>1000,31778=>1000,31779=>1000,31780=>1000, - 31781=>1000,31782=>1000,31783=>1000,31784=>1000,31785=>1000,31786=>1000,31787=>1000,31788=>1000,31789=>1000,31790=>1000,31791=>1000,31792=>1000,31793=>1000,31794=>1000,31795=>1000,31796=>1000, - 31797=>1000,31798=>1000,31799=>1000,31800=>1000,31801=>1000,31802=>1000,31803=>1000,31804=>1000,31805=>1000,31806=>1000,31807=>1000,31808=>1000,31809=>1000,31810=>1000,31811=>1000,31812=>1000, - 31813=>1000,31814=>1000,31815=>1000,31816=>1000,31817=>1000,31818=>1000,31819=>1000,31820=>1000,31821=>1000,31822=>1000,31823=>1000,31824=>1000,31825=>1000,31826=>1000,31827=>1000,31828=>1000, - 31829=>1000,31830=>1000,31831=>1000,31832=>1000,31833=>1000,31834=>1000,31835=>1000,31836=>1000,31837=>1000,31838=>1000,31839=>1000,31840=>1000,31841=>1000,31842=>1000,31843=>1000,31844=>1000, - 31845=>1000,31846=>1000,31847=>1000,31848=>1000,31849=>1000,31850=>1000,31851=>1000,31852=>1000,31853=>1000,31854=>1000,31855=>1000,31856=>1000,31857=>1000,31858=>1000,31859=>1000,31860=>1000, - 31861=>1000,31862=>1000,31863=>1000,31864=>1000,31865=>1000,31866=>1000,31867=>1000,31868=>1000,31869=>1000,31870=>1000,31871=>1000,31872=>1000,31873=>1000,31874=>1000,31875=>1000,31876=>1000, - 31877=>1000,31878=>1000,31879=>1000,31880=>1000,31881=>1000,31882=>1000,31883=>1000,31884=>1000,31885=>1000,31886=>1000,31887=>1000,31888=>1000,31889=>1000,31890=>1000,31891=>1000,31892=>1000, - 31893=>1000,31894=>1000,31895=>1000,31896=>1000,31897=>1000,31898=>1000,31899=>1000,31900=>1000,31901=>1000,31902=>1000,31903=>1000,31904=>1000,31905=>1000,31906=>1000,31907=>1000,31908=>1000, - 31909=>1000,31910=>1000,31911=>1000,31912=>1000,31913=>1000,31914=>1000,31915=>1000,31916=>1000,31917=>1000,31918=>1000,31919=>1000,31920=>1000,31921=>1000,31922=>1000,31923=>1000,31924=>1000, - 31925=>1000,31926=>1000,31927=>1000,31928=>1000,31929=>1000,31930=>1000,31931=>1000,31932=>1000,31933=>1000,31934=>1000,31935=>1000,31936=>1000,31937=>1000,31938=>1000,31939=>1000,31940=>1000, - 31941=>1000,31942=>1000,31943=>1000,31944=>1000,31945=>1000,31946=>1000,31947=>1000,31948=>1000,31949=>1000,31950=>1000,31951=>1000,31952=>1000,31953=>1000,31954=>1000,31955=>1000,31956=>1000, - 31957=>1000,31958=>1000,31959=>1000,31960=>1000,31961=>1000,31962=>1000,31963=>1000,31964=>1000,31965=>1000,31966=>1000,31967=>1000,31968=>1000,31969=>1000,31970=>1000,31971=>1000,31972=>1000, - 31973=>1000,31974=>1000,31975=>1000,31976=>1000,31977=>1000,31978=>1000,31979=>1000,31980=>1000,31981=>1000,31982=>1000,31983=>1000,31984=>1000,31985=>1000,31986=>1000,31987=>1000,31988=>1000, - 31989=>1000,31990=>1000,31991=>1000,31992=>1000,31993=>1000,31994=>1000,31995=>1000,31996=>1000,31997=>1000,31998=>1000,31999=>1000,32000=>1000,32001=>1000,32002=>1000,32003=>1000,32004=>1000, - 32005=>1000,32006=>1000,32007=>1000,32008=>1000,32009=>1000,32010=>1000,32011=>1000,32012=>1000,32013=>1000,32014=>1000,32015=>1000,32016=>1000,32017=>1000,32018=>1000,32019=>1000,32020=>1000, - 32021=>1000,32022=>1000,32023=>1000,32024=>1000,32025=>1000,32026=>1000,32027=>1000,32028=>1000,32029=>1000,32030=>1000,32031=>1000,32032=>1000,32033=>1000,32034=>1000,32035=>1000,32036=>1000, - 32037=>1000,32038=>1000,32039=>1000,32040=>1000,32041=>1000,32042=>1000,32043=>1000,32044=>1000,32045=>1000,32046=>1000,32047=>1000,32048=>1000,32049=>1000,32050=>1000,32051=>1000,32052=>1000, - 32053=>1000,32054=>1000,32055=>1000,32056=>1000,32057=>1000,32058=>1000,32059=>1000,32060=>1000,32061=>1000,32062=>1000,32063=>1000,32064=>1000,32065=>1000,32066=>1000,32067=>1000,32068=>1000, - 32069=>1000,32070=>1000,32071=>1000,32072=>1000,32073=>1000,32074=>1000,32075=>1000,32076=>1000,32077=>1000,32078=>1000,32079=>1000,32080=>1000,32081=>1000,32082=>1000,32083=>1000,32084=>1000, - 32085=>1000,32086=>1000,32087=>1000,32088=>1000,32089=>1000,32090=>1000,32091=>1000,32092=>1000,32093=>1000,32094=>1000,32095=>1000,32096=>1000,32097=>1000,32098=>1000,32099=>1000,32100=>1000, - 32101=>1000,32102=>1000,32103=>1000,32104=>1000,32105=>1000,32106=>1000,32107=>1000,32108=>1000,32109=>1000,32110=>1000,32111=>1000,32112=>1000,32113=>1000,32114=>1000,32115=>1000,32116=>1000, - 32117=>1000,32118=>1000,32119=>1000,32120=>1000,32121=>1000,32122=>1000,32123=>1000,32124=>1000,32125=>1000,32126=>1000,32127=>1000,32128=>1000,32129=>1000,32130=>1000,32131=>1000,32132=>1000, - 32133=>1000,32134=>1000,32135=>1000,32136=>1000,32137=>1000,32138=>1000,32139=>1000,32140=>1000,32141=>1000,32142=>1000,32143=>1000,32144=>1000,32145=>1000,32146=>1000,32147=>1000,32148=>1000, - 32149=>1000,32150=>1000,32151=>1000,32152=>1000,32153=>1000,32154=>1000,32155=>1000,32156=>1000,32157=>1000,32158=>1000,32159=>1000,32160=>1000,32161=>1000,32162=>1000,32163=>1000,32164=>1000, - 32165=>1000,32166=>1000,32167=>1000,32168=>1000,32169=>1000,32170=>1000,32171=>1000,32172=>1000,32173=>1000,32174=>1000,32175=>1000,32176=>1000,32177=>1000,32178=>1000,32179=>1000,32180=>1000, - 32181=>1000,32182=>1000,32183=>1000,32184=>1000,32185=>1000,32186=>1000,32187=>1000,32188=>1000,32189=>1000,32190=>1000,32191=>1000,32192=>1000,32193=>1000,32194=>1000,32195=>1000,32196=>1000, - 32197=>1000,32198=>1000,32199=>1000,32200=>1000,32201=>1000,32202=>1000,32203=>1000,32204=>1000,32205=>1000,32206=>1000,32207=>1000,32208=>1000,32209=>1000,32210=>1000,32211=>1000,32212=>1000, - 32213=>1000,32214=>1000,32215=>1000,32216=>1000,32217=>1000,32218=>1000,32219=>1000,32220=>1000,32221=>1000,32222=>1000,32223=>1000,32224=>1000,32225=>1000,32226=>1000,32227=>1000,32228=>1000, - 32229=>1000,32230=>1000,32231=>1000,32232=>1000,32233=>1000,32234=>1000,32235=>1000,32236=>1000,32237=>1000,32238=>1000,32239=>1000,32240=>1000,32241=>1000,32242=>1000,32243=>1000,32244=>1000, - 32245=>1000,32246=>1000,32247=>1000,32248=>1000,32249=>1000,32250=>1000,32251=>1000,32252=>1000,32253=>1000,32254=>1000,32255=>1000,32256=>1000,32257=>1000,32258=>1000,32259=>1000,32260=>1000, - 32261=>1000,32262=>1000,32263=>1000,32264=>1000,32265=>1000,32266=>1000,32267=>1000,32268=>1000,32269=>1000,32270=>1000,32271=>1000,32272=>1000,32273=>1000,32274=>1000,32275=>1000,32276=>1000, - 32277=>1000,32278=>1000,32279=>1000,32280=>1000,32281=>1000,32282=>1000,32283=>1000,32284=>1000,32285=>1000,32286=>1000,32287=>1000,32288=>1000,32289=>1000,32290=>1000,32291=>1000,32292=>1000, - 32293=>1000,32294=>1000,32295=>1000,32296=>1000,32297=>1000,32298=>1000,32299=>1000,32300=>1000,32301=>1000,32302=>1000,32303=>1000,32304=>1000,32305=>1000,32306=>1000,32307=>1000,32308=>1000, - 32309=>1000,32310=>1000,32311=>1000,32312=>1000,32313=>1000,32314=>1000,32315=>1000,32316=>1000,32317=>1000,32318=>1000,32319=>1000,32320=>1000,32321=>1000,32322=>1000,32323=>1000,32324=>1000, - 32325=>1000,32326=>1000,32327=>1000,32328=>1000,32329=>1000,32330=>1000,32331=>1000,32332=>1000,32333=>1000,32334=>1000,32335=>1000,32336=>1000,32337=>1000,32338=>1000,32339=>1000,32340=>1000, - 32341=>1000,32342=>1000,32343=>1000,32344=>1000,32345=>1000,32346=>1000,32347=>1000,32348=>1000,32349=>1000,32350=>1000,32351=>1000,32352=>1000,32353=>1000,32354=>1000,32355=>1000,32356=>1000, - 32357=>1000,32358=>1000,32359=>1000,32360=>1000,32361=>1000,32362=>1000,32363=>1000,32364=>1000,32365=>1000,32366=>1000,32367=>1000,32368=>1000,32369=>1000,32370=>1000,32371=>1000,32372=>1000, - 32373=>1000,32374=>1000,32375=>1000,32376=>1000,32377=>1000,32378=>1000,32379=>1000,32380=>1000,32381=>1000,32382=>1000,32383=>1000,32384=>1000,32385=>1000,32386=>1000,32387=>1000,32388=>1000, - 32389=>1000,32390=>1000,32391=>1000,32392=>1000,32393=>1000,32394=>1000,32395=>1000,32396=>1000,32397=>1000,32398=>1000,32399=>1000,32400=>1000,32401=>1000,32402=>1000,32403=>1000,32404=>1000, - 32405=>1000,32406=>1000,32407=>1000,32408=>1000,32409=>1000,32410=>1000,32411=>1000,32412=>1000,32413=>1000,32414=>1000,32415=>1000,32416=>1000,32417=>1000,32418=>1000,32419=>1000,32420=>1000, - 32421=>1000,32422=>1000,32423=>1000,32424=>1000,32425=>1000,32426=>1000,32427=>1000,32428=>1000,32429=>1000,32430=>1000,32431=>1000,32432=>1000,32433=>1000,32434=>1000,32435=>1000,32436=>1000, - 32437=>1000,32438=>1000,32439=>1000,32440=>1000,32441=>1000,32442=>1000,32443=>1000,32444=>1000,32445=>1000,32446=>1000,32447=>1000,32448=>1000,32449=>1000,32450=>1000,32451=>1000,32452=>1000, - 32453=>1000,32454=>1000,32455=>1000,32456=>1000,32457=>1000,32458=>1000,32459=>1000,32460=>1000,32461=>1000,32462=>1000,32463=>1000,32464=>1000,32465=>1000,32466=>1000,32467=>1000,32468=>1000, - 32469=>1000,32470=>1000,32471=>1000,32472=>1000,32473=>1000,32474=>1000,32475=>1000,32476=>1000,32477=>1000,32478=>1000,32479=>1000,32480=>1000,32481=>1000,32482=>1000,32483=>1000,32484=>1000, - 32485=>1000,32486=>1000,32487=>1000,32488=>1000,32489=>1000,32490=>1000,32491=>1000,32492=>1000,32493=>1000,32494=>1000,32495=>1000,32496=>1000,32497=>1000,32498=>1000,32499=>1000,32500=>1000, - 32501=>1000,32502=>1000,32503=>1000,32504=>1000,32505=>1000,32506=>1000,32507=>1000,32508=>1000,32509=>1000,32510=>1000,32511=>1000,32512=>1000,32513=>1000,32514=>1000,32515=>1000,32516=>1000, - 32517=>1000,32518=>1000,32519=>1000,32520=>1000,32521=>1000,32522=>1000,32523=>1000,32524=>1000,32525=>1000,32526=>1000,32527=>1000,32528=>1000,32529=>1000,32530=>1000,32531=>1000,32532=>1000, - 32533=>1000,32534=>1000,32535=>1000,32536=>1000,32537=>1000,32538=>1000,32539=>1000,32540=>1000,32541=>1000,32542=>1000,32543=>1000,32544=>1000,32545=>1000,32546=>1000,32547=>1000,32548=>1000, - 32549=>1000,32550=>1000,32551=>1000,32552=>1000,32553=>1000,32554=>1000,32555=>1000,32556=>1000,32557=>1000,32558=>1000,32559=>1000,32560=>1000,32561=>1000,32562=>1000,32563=>1000,32564=>1000, - 32565=>1000,32566=>1000,32567=>1000,32568=>1000,32569=>1000,32570=>1000,32571=>1000,32572=>1000,32573=>1000,32574=>1000,32575=>1000,32576=>1000,32577=>1000,32578=>1000,32579=>1000,32580=>1000, - 32581=>1000,32582=>1000,32583=>1000,32584=>1000,32585=>1000,32586=>1000,32587=>1000,32588=>1000,32589=>1000,32590=>1000,32591=>1000,32592=>1000,32593=>1000,32594=>1000,32595=>1000,32596=>1000, - 32597=>1000,32598=>1000,32599=>1000,32600=>1000,32601=>1000,32602=>1000,32603=>1000,32604=>1000,32605=>1000,32606=>1000,32607=>1000,32608=>1000,32609=>1000,32610=>1000,32611=>1000,32612=>1000, - 32613=>1000,32614=>1000,32615=>1000,32616=>1000,32617=>1000,32618=>1000,32619=>1000,32620=>1000,32621=>1000,32622=>1000,32623=>1000,32624=>1000,32625=>1000,32626=>1000,32627=>1000,32628=>1000, - 32629=>1000,32630=>1000,32631=>1000,32632=>1000,32633=>1000,32634=>1000,32635=>1000,32636=>1000,32637=>1000,32638=>1000,32639=>1000,32640=>1000,32641=>1000,32642=>1000,32643=>1000,32644=>1000, - 32645=>1000,32646=>1000,32647=>1000,32648=>1000,32649=>1000,32650=>1000,32651=>1000,32652=>1000,32653=>1000,32654=>1000,32655=>1000,32656=>1000,32657=>1000,32658=>1000,32659=>1000,32660=>1000, - 32661=>1000,32662=>1000,32663=>1000,32664=>1000,32665=>1000,32666=>1000,32667=>1000,32668=>1000,32669=>1000,32670=>1000,32671=>1000,32672=>1000,32673=>1000,32674=>1000,32675=>1000,32676=>1000, - 32677=>1000,32678=>1000,32679=>1000,32680=>1000,32681=>1000,32682=>1000,32683=>1000,32684=>1000,32685=>1000,32686=>1000,32687=>1000,32688=>1000,32689=>1000,32690=>1000,32691=>1000,32692=>1000, - 32693=>1000,32694=>1000,32695=>1000,32696=>1000,32697=>1000,32698=>1000,32699=>1000,32700=>1000,32701=>1000,32702=>1000,32703=>1000,32704=>1000,32705=>1000,32706=>1000,32707=>1000,32708=>1000, - 32709=>1000,32710=>1000,32711=>1000,32712=>1000,32713=>1000,32714=>1000,32715=>1000,32716=>1000,32717=>1000,32718=>1000,32719=>1000,32720=>1000,32721=>1000,32722=>1000,32723=>1000,32724=>1000, - 32725=>1000,32726=>1000,32727=>1000,32728=>1000,32729=>1000,32730=>1000,32731=>1000,32732=>1000,32733=>1000,32734=>1000,32735=>1000,32736=>1000,32737=>1000,32738=>1000,32739=>1000,32740=>1000, - 32741=>1000,32742=>1000,32743=>1000,32744=>1000,32745=>1000,32746=>1000,32747=>1000,32748=>1000,32749=>1000,32750=>1000,32751=>1000,32752=>1000,32753=>1000,32754=>1000,32755=>1000,32756=>1000, - 32757=>1000,32758=>1000,32759=>1000,32760=>1000,32761=>1000,32762=>1000,32763=>1000,32764=>1000,32765=>1000,32766=>1000,32767=>1000,32768=>1000,32769=>1000,32770=>1000,32771=>1000,32772=>1000, - 32773=>1000,32774=>1000,32775=>1000,32776=>1000,32777=>1000,32778=>1000,32779=>1000,32780=>1000,32781=>1000,32782=>1000,32783=>1000,32784=>1000,32785=>1000,32786=>1000,32787=>1000,32788=>1000, - 32789=>1000,32790=>1000,32791=>1000,32792=>1000,32793=>1000,32794=>1000,32795=>1000,32796=>1000,32797=>1000,32798=>1000,32799=>1000,32800=>1000,32801=>1000,32802=>1000,32803=>1000,32804=>1000, - 32805=>1000,32806=>1000,32807=>1000,32808=>1000,32809=>1000,32810=>1000,32811=>1000,32812=>1000,32813=>1000,32814=>1000,32815=>1000,32816=>1000,32817=>1000,32818=>1000,32819=>1000,32820=>1000, - 32821=>1000,32822=>1000,32823=>1000,32824=>1000,32825=>1000,32826=>1000,32827=>1000,32828=>1000,32829=>1000,32830=>1000,32831=>1000,32832=>1000,32833=>1000,32834=>1000,32835=>1000,32836=>1000, - 32837=>1000,32838=>1000,32839=>1000,32840=>1000,32841=>1000,32842=>1000,32843=>1000,32844=>1000,32845=>1000,32846=>1000,32847=>1000,32848=>1000,32849=>1000,32850=>1000,32851=>1000,32852=>1000, - 32853=>1000,32854=>1000,32855=>1000,32856=>1000,32857=>1000,32858=>1000,32859=>1000,32860=>1000,32861=>1000,32862=>1000,32863=>1000,32864=>1000,32865=>1000,32866=>1000,32867=>1000,32868=>1000, - 32869=>1000,32870=>1000,32871=>1000,32872=>1000,32873=>1000,32874=>1000,32875=>1000,32876=>1000,32877=>1000,32878=>1000,32879=>1000,32880=>1000,32881=>1000,32882=>1000,32883=>1000,32884=>1000, - 32885=>1000,32886=>1000,32887=>1000,32888=>1000,32889=>1000,32890=>1000,32891=>1000,32892=>1000,32893=>1000,32894=>1000,32895=>1000,32896=>1000,32897=>1000,32898=>1000,32899=>1000,32900=>1000, - 32901=>1000,32902=>1000,32903=>1000,32904=>1000,32905=>1000,32906=>1000,32907=>1000,32908=>1000,32909=>1000,32910=>1000,32911=>1000,32912=>1000,32913=>1000,32914=>1000,32915=>1000,32916=>1000, - 32917=>1000,32918=>1000,32919=>1000,32920=>1000,32921=>1000,32922=>1000,32923=>1000,32924=>1000,32925=>1000,32926=>1000,32927=>1000,32928=>1000,32929=>1000,32930=>1000,32931=>1000,32932=>1000, - 32933=>1000,32934=>1000,32935=>1000,32936=>1000,32937=>1000,32938=>1000,32939=>1000,32940=>1000,32941=>1000,32942=>1000,32943=>1000,32944=>1000,32945=>1000,32946=>1000,32947=>1000,32948=>1000, - 32949=>1000,32950=>1000,32951=>1000,32952=>1000,32953=>1000,32954=>1000,32955=>1000,32956=>1000,32957=>1000,32958=>1000,32959=>1000,32960=>1000,32961=>1000,32962=>1000,32963=>1000,32964=>1000, - 32965=>1000,32966=>1000,32967=>1000,32968=>1000,32969=>1000,32970=>1000,32971=>1000,32972=>1000,32973=>1000,32974=>1000,32975=>1000,32976=>1000,32977=>1000,32978=>1000,32979=>1000,32980=>1000, - 32981=>1000,32982=>1000,32983=>1000,32984=>1000,32985=>1000,32986=>1000,32987=>1000,32988=>1000,32989=>1000,32990=>1000,32991=>1000,32992=>1000,32993=>1000,32994=>1000,32995=>1000,32996=>1000, - 32997=>1000,32998=>1000,32999=>1000,33000=>1000,33001=>1000,33002=>1000,33003=>1000,33004=>1000,33005=>1000,33006=>1000,33007=>1000,33008=>1000,33009=>1000,33010=>1000,33011=>1000,33012=>1000, - 33013=>1000,33014=>1000,33015=>1000,33016=>1000,33017=>1000,33018=>1000,33019=>1000,33020=>1000,33021=>1000,33022=>1000,33023=>1000,33024=>1000,33025=>1000,33026=>1000,33027=>1000,33028=>1000, - 33029=>1000,33030=>1000,33031=>1000,33032=>1000,33033=>1000,33034=>1000,33035=>1000,33036=>1000,33037=>1000,33038=>1000,33039=>1000,33040=>1000,33041=>1000,33042=>1000,33043=>1000,33044=>1000, - 33045=>1000,33046=>1000,33047=>1000,33048=>1000,33049=>1000,33050=>1000,33051=>1000,33052=>1000,33053=>1000,33054=>1000,33055=>1000,33056=>1000,33057=>1000,33058=>1000,33059=>1000,33060=>1000, - 33061=>1000,33062=>1000,33063=>1000,33064=>1000,33065=>1000,33066=>1000,33067=>1000,33068=>1000,33069=>1000,33070=>1000,33071=>1000,33072=>1000,33073=>1000,33074=>1000,33075=>1000,33076=>1000, - 33077=>1000,33078=>1000,33079=>1000,33080=>1000,33081=>1000,33082=>1000,33083=>1000,33084=>1000,33085=>1000,33086=>1000,33087=>1000,33088=>1000,33089=>1000,33090=>1000,33091=>1000,33092=>1000, - 33093=>1000,33094=>1000,33095=>1000,33096=>1000,33097=>1000,33098=>1000,33099=>1000,33100=>1000,33101=>1000,33102=>1000,33103=>1000,33104=>1000,33105=>1000,33106=>1000,33107=>1000,33108=>1000, - 33109=>1000,33110=>1000,33111=>1000,33112=>1000,33113=>1000,33114=>1000,33115=>1000,33116=>1000,33117=>1000,33118=>1000,33119=>1000,33120=>1000,33121=>1000,33122=>1000,33123=>1000,33124=>1000, - 33125=>1000,33126=>1000,33127=>1000,33128=>1000,33129=>1000,33130=>1000,33131=>1000,33132=>1000,33133=>1000,33134=>1000,33135=>1000,33136=>1000,33137=>1000,33138=>1000,33139=>1000,33140=>1000, - 33141=>1000,33142=>1000,33143=>1000,33144=>1000,33145=>1000,33146=>1000,33147=>1000,33148=>1000,33149=>1000,33150=>1000,33151=>1000,33152=>1000,33153=>1000,33154=>1000,33155=>1000,33156=>1000, - 33157=>1000,33158=>1000,33159=>1000,33160=>1000,33161=>1000,33162=>1000,33163=>1000,33164=>1000,33165=>1000,33166=>1000,33167=>1000,33168=>1000,33169=>1000,33170=>1000,33171=>1000,33172=>1000, - 33173=>1000,33174=>1000,33175=>1000,33176=>1000,33177=>1000,33178=>1000,33179=>1000,33180=>1000,33181=>1000,33182=>1000,33183=>1000,33184=>1000,33185=>1000,33186=>1000,33187=>1000,33188=>1000, - 33189=>1000,33190=>1000,33191=>1000,33192=>1000,33193=>1000,33194=>1000,33195=>1000,33196=>1000,33197=>1000,33198=>1000,33199=>1000,33200=>1000,33201=>1000,33202=>1000,33203=>1000,33204=>1000, - 33205=>1000,33206=>1000,33207=>1000,33208=>1000,33209=>1000,33210=>1000,33211=>1000,33212=>1000,33213=>1000,33214=>1000,33215=>1000,33216=>1000,33217=>1000,33218=>1000,33219=>1000,33220=>1000, - 33221=>1000,33222=>1000,33223=>1000,33224=>1000,33225=>1000,33226=>1000,33227=>1000,33228=>1000,33229=>1000,33230=>1000,33231=>1000,33232=>1000,33233=>1000,33234=>1000,33235=>1000,33236=>1000, - 33237=>1000,33238=>1000,33239=>1000,33240=>1000,33241=>1000,33242=>1000,33243=>1000,33244=>1000,33245=>1000,33246=>1000,33247=>1000,33248=>1000,33249=>1000,33250=>1000,33251=>1000,33252=>1000, - 33253=>1000,33254=>1000,33255=>1000,33256=>1000,33257=>1000,33258=>1000,33259=>1000,33260=>1000,33261=>1000,33262=>1000,33263=>1000,33264=>1000,33265=>1000,33266=>1000,33267=>1000,33268=>1000, - 33269=>1000,33270=>1000,33271=>1000,33272=>1000,33273=>1000,33274=>1000,33275=>1000,33276=>1000,33277=>1000,33278=>1000,33279=>1000,33280=>1000,33281=>1000,33282=>1000,33283=>1000,33284=>1000, - 33285=>1000,33286=>1000,33287=>1000,33288=>1000,33289=>1000,33290=>1000,33291=>1000,33292=>1000,33293=>1000,33294=>1000,33295=>1000,33296=>1000,33297=>1000,33298=>1000,33299=>1000,33300=>1000, - 33301=>1000,33302=>1000,33303=>1000,33304=>1000,33305=>1000,33306=>1000,33307=>1000,33308=>1000,33309=>1000,33310=>1000,33311=>1000,33312=>1000,33313=>1000,33314=>1000,33315=>1000,33316=>1000, - 33317=>1000,33318=>1000,33319=>1000,33320=>1000,33321=>1000,33322=>1000,33323=>1000,33324=>1000,33325=>1000,33326=>1000,33327=>1000,33328=>1000,33329=>1000,33330=>1000,33331=>1000,33332=>1000, - 33333=>1000,33334=>1000,33335=>1000,33336=>1000,33337=>1000,33338=>1000,33339=>1000,33340=>1000,33341=>1000,33342=>1000,33343=>1000,33344=>1000,33345=>1000,33346=>1000,33347=>1000,33348=>1000, - 33349=>1000,33350=>1000,33351=>1000,33352=>1000,33353=>1000,33354=>1000,33355=>1000,33356=>1000,33357=>1000,33358=>1000,33359=>1000,33360=>1000,33361=>1000,33362=>1000,33363=>1000,33364=>1000, - 33365=>1000,33366=>1000,33367=>1000,33368=>1000,33369=>1000,33370=>1000,33371=>1000,33372=>1000,33373=>1000,33374=>1000,33375=>1000,33376=>1000,33377=>1000,33378=>1000,33379=>1000,33380=>1000, - 33381=>1000,33382=>1000,33383=>1000,33384=>1000,33385=>1000,33386=>1000,33387=>1000,33388=>1000,33389=>1000,33390=>1000,33391=>1000,33392=>1000,33393=>1000,33394=>1000,33395=>1000,33396=>1000, - 33397=>1000,33398=>1000,33399=>1000,33400=>1000,33401=>1000,33402=>1000,33403=>1000,33404=>1000,33405=>1000,33406=>1000,33407=>1000,33408=>1000,33409=>1000,33410=>1000,33411=>1000,33412=>1000, - 33413=>1000,33414=>1000,33415=>1000,33416=>1000,33417=>1000,33418=>1000,33419=>1000,33420=>1000,33421=>1000,33422=>1000,33423=>1000,33424=>1000,33425=>1000,33426=>1000,33427=>1000,33428=>1000, - 33429=>1000,33430=>1000,33431=>1000,33432=>1000,33433=>1000,33434=>1000,33435=>1000,33436=>1000,33437=>1000,33438=>1000,33439=>1000,33440=>1000,33441=>1000,33442=>1000,33443=>1000,33444=>1000, - 33445=>1000,33446=>1000,33447=>1000,33448=>1000,33449=>1000,33450=>1000,33451=>1000,33452=>1000,33453=>1000,33454=>1000,33455=>1000,33456=>1000,33457=>1000,33458=>1000,33459=>1000,33460=>1000, - 33461=>1000,33462=>1000,33463=>1000,33464=>1000,33465=>1000,33466=>1000,33467=>1000,33468=>1000,33469=>1000,33470=>1000,33471=>1000,33472=>1000,33473=>1000,33474=>1000,33475=>1000,33476=>1000, - 33477=>1000,33478=>1000,33479=>1000,33480=>1000,33481=>1000,33482=>1000,33483=>1000,33484=>1000,33485=>1000,33486=>1000,33487=>1000,33488=>1000,33489=>1000,33490=>1000,33491=>1000,33492=>1000, - 33493=>1000,33494=>1000,33495=>1000,33496=>1000,33497=>1000,33498=>1000,33499=>1000,33500=>1000,33501=>1000,33502=>1000,33503=>1000,33504=>1000,33505=>1000,33506=>1000,33507=>1000,33508=>1000, - 33509=>1000,33510=>1000,33511=>1000,33512=>1000,33513=>1000,33514=>1000,33515=>1000,33516=>1000,33517=>1000,33518=>1000,33519=>1000,33520=>1000,33521=>1000,33522=>1000,33523=>1000,33524=>1000, - 33525=>1000,33526=>1000,33527=>1000,33528=>1000,33529=>1000,33530=>1000,33531=>1000,33532=>1000,33533=>1000,33534=>1000,33535=>1000,33536=>1000,33537=>1000,33538=>1000,33539=>1000,33540=>1000, - 33541=>1000,33542=>1000,33543=>1000,33544=>1000,33545=>1000,33546=>1000,33547=>1000,33548=>1000,33549=>1000,33550=>1000,33551=>1000,33552=>1000,33553=>1000,33554=>1000,33555=>1000,33556=>1000, - 33557=>1000,33558=>1000,33559=>1000,33560=>1000,33561=>1000,33562=>1000,33563=>1000,33564=>1000,33565=>1000,33566=>1000,33567=>1000,33568=>1000,33569=>1000,33570=>1000,33571=>1000,33572=>1000, - 33573=>1000,33574=>1000,33575=>1000,33576=>1000,33577=>1000,33578=>1000,33579=>1000,33580=>1000,33581=>1000,33582=>1000,33583=>1000,33584=>1000,33585=>1000,33586=>1000,33587=>1000,33588=>1000, - 33589=>1000,33590=>1000,33591=>1000,33592=>1000,33593=>1000,33594=>1000,33595=>1000,33596=>1000,33597=>1000,33598=>1000,33599=>1000,33600=>1000,33601=>1000,33602=>1000,33603=>1000,33604=>1000, - 33605=>1000,33606=>1000,33607=>1000,33608=>1000,33609=>1000,33610=>1000,33611=>1000,33612=>1000,33613=>1000,33614=>1000,33615=>1000,33616=>1000,33617=>1000,33618=>1000,33619=>1000,33620=>1000, - 33621=>1000,33622=>1000,33623=>1000,33624=>1000,33625=>1000,33626=>1000,33627=>1000,33628=>1000,33629=>1000,33630=>1000,33631=>1000,33632=>1000,33633=>1000,33634=>1000,33635=>1000,33636=>1000, - 33637=>1000,33638=>1000,33639=>1000,33640=>1000,33641=>1000,33642=>1000,33643=>1000,33644=>1000,33645=>1000,33646=>1000,33647=>1000,33648=>1000,33649=>1000,33650=>1000,33651=>1000,33652=>1000, - 33653=>1000,33654=>1000,33655=>1000,33656=>1000,33657=>1000,33658=>1000,33659=>1000,33660=>1000,33661=>1000,33662=>1000,33663=>1000,33664=>1000,33665=>1000,33666=>1000,33667=>1000,33668=>1000, - 33669=>1000,33670=>1000,33671=>1000,33672=>1000,33673=>1000,33674=>1000,33675=>1000,33676=>1000,33677=>1000,33678=>1000,33679=>1000,33680=>1000,33681=>1000,33682=>1000,33683=>1000,33684=>1000, - 33685=>1000,33686=>1000,33687=>1000,33688=>1000,33689=>1000,33690=>1000,33691=>1000,33692=>1000,33693=>1000,33694=>1000,33695=>1000,33696=>1000,33697=>1000,33698=>1000,33699=>1000,33700=>1000, - 33701=>1000,33702=>1000,33703=>1000,33704=>1000,33705=>1000,33706=>1000,33707=>1000,33708=>1000,33709=>1000,33710=>1000,33711=>1000,33712=>1000,33713=>1000,33714=>1000,33715=>1000,33716=>1000, - 33717=>1000,33718=>1000,33719=>1000,33720=>1000,33721=>1000,33722=>1000,33723=>1000,33724=>1000,33725=>1000,33726=>1000,33727=>1000,33728=>1000,33729=>1000,33730=>1000,33731=>1000,33732=>1000, - 33733=>1000,33734=>1000,33735=>1000,33736=>1000,33737=>1000,33738=>1000,33739=>1000,33740=>1000,33741=>1000,33742=>1000,33743=>1000,33744=>1000,33745=>1000,33746=>1000,33747=>1000,33748=>1000, - 33749=>1000,33750=>1000,33751=>1000,33752=>1000,33753=>1000,33754=>1000,33755=>1000,33756=>1000,33757=>1000,33758=>1000,33759=>1000,33760=>1000,33761=>1000,33762=>1000,33763=>1000,33764=>1000, - 33765=>1000,33766=>1000,33767=>1000,33768=>1000,33769=>1000,33770=>1000,33771=>1000,33772=>1000,33773=>1000,33774=>1000,33775=>1000,33776=>1000,33777=>1000,33778=>1000,33779=>1000,33780=>1000, - 33781=>1000,33782=>1000,33783=>1000,33784=>1000,33785=>1000,33786=>1000,33787=>1000,33788=>1000,33789=>1000,33790=>1000,33791=>1000,33792=>1000,33793=>1000,33794=>1000,33795=>1000,33796=>1000, - 33797=>1000,33798=>1000,33799=>1000,33800=>1000,33801=>1000,33802=>1000,33803=>1000,33804=>1000,33805=>1000,33806=>1000,33807=>1000,33808=>1000,33809=>1000,33810=>1000,33811=>1000,33812=>1000, - 33813=>1000,33814=>1000,33815=>1000,33816=>1000,33817=>1000,33818=>1000,33819=>1000,33820=>1000,33821=>1000,33822=>1000,33823=>1000,33824=>1000,33825=>1000,33826=>1000,33827=>1000,33828=>1000, - 33829=>1000,33830=>1000,33831=>1000,33832=>1000,33833=>1000,33834=>1000,33835=>1000,33836=>1000,33837=>1000,33838=>1000,33839=>1000,33840=>1000,33841=>1000,33842=>1000,33843=>1000,33844=>1000, - 33845=>1000,33846=>1000,33847=>1000,33848=>1000,33849=>1000,33850=>1000,33851=>1000,33852=>1000,33853=>1000,33854=>1000,33855=>1000,33856=>1000,33857=>1000,33858=>1000,33859=>1000,33860=>1000, - 33861=>1000,33862=>1000,33863=>1000,33864=>1000,33865=>1000,33866=>1000,33867=>1000,33868=>1000,33869=>1000,33870=>1000,33871=>1000,33872=>1000,33873=>1000,33874=>1000,33875=>1000,33876=>1000, - 33877=>1000,33878=>1000,33879=>1000,33880=>1000,33881=>1000,33882=>1000,33883=>1000,33884=>1000,33885=>1000,33886=>1000,33887=>1000,33888=>1000,33889=>1000,33890=>1000,33891=>1000,33892=>1000, - 33893=>1000,33894=>1000,33895=>1000,33896=>1000,33897=>1000,33898=>1000,33899=>1000,33900=>1000,33901=>1000,33902=>1000,33903=>1000,33904=>1000,33905=>1000,33906=>1000,33907=>1000,33908=>1000, - 33909=>1000,33910=>1000,33911=>1000,33912=>1000,33913=>1000,33914=>1000,33915=>1000,33916=>1000,33917=>1000,33918=>1000,33919=>1000,33920=>1000,33921=>1000,33922=>1000,33923=>1000,33924=>1000, - 33925=>1000,33926=>1000,33927=>1000,33928=>1000,33929=>1000,33930=>1000,33931=>1000,33932=>1000,33933=>1000,33934=>1000,33935=>1000,33936=>1000,33937=>1000,33938=>1000,33939=>1000,33940=>1000, - 33941=>1000,33942=>1000,33943=>1000,33944=>1000,33945=>1000,33946=>1000,33947=>1000,33948=>1000,33949=>1000,33950=>1000,33951=>1000,33952=>1000,33953=>1000,33954=>1000,33955=>1000,33956=>1000, - 33957=>1000,33958=>1000,33959=>1000,33960=>1000,33961=>1000,33962=>1000,33963=>1000,33964=>1000,33965=>1000,33966=>1000,33967=>1000,33968=>1000,33969=>1000,33970=>1000,33971=>1000,33972=>1000, - 33973=>1000,33974=>1000,33975=>1000,33976=>1000,33977=>1000,33978=>1000,33979=>1000,33980=>1000,33981=>1000,33982=>1000,33983=>1000,33984=>1000,33985=>1000,33986=>1000,33987=>1000,33988=>1000, - 33989=>1000,33990=>1000,33991=>1000,33992=>1000,33993=>1000,33994=>1000,33995=>1000,33996=>1000,33997=>1000,33998=>1000,33999=>1000,34000=>1000,34001=>1000,34002=>1000,34003=>1000,34004=>1000, - 34005=>1000,34006=>1000,34007=>1000,34008=>1000,34009=>1000,34010=>1000,34011=>1000,34012=>1000,34013=>1000,34014=>1000,34015=>1000,34016=>1000,34017=>1000,34018=>1000,34019=>1000,34020=>1000, - 34021=>1000,34022=>1000,34023=>1000,34024=>1000,34025=>1000,34026=>1000,34027=>1000,34028=>1000,34029=>1000,34030=>1000,34031=>1000,34032=>1000,34033=>1000,34034=>1000,34035=>1000,34036=>1000, - 34037=>1000,34038=>1000,34039=>1000,34040=>1000,34041=>1000,34042=>1000,34043=>1000,34044=>1000,34045=>1000,34046=>1000,34047=>1000,34048=>1000,34049=>1000,34050=>1000,34051=>1000,34052=>1000, - 34053=>1000,34054=>1000,34055=>1000,34056=>1000,34057=>1000,34058=>1000,34059=>1000,34060=>1000,34061=>1000,34062=>1000,34063=>1000,34064=>1000,34065=>1000,34066=>1000,34067=>1000,34068=>1000, - 34069=>1000,34070=>1000,34071=>1000,34072=>1000,34073=>1000,34074=>1000,34075=>1000,34076=>1000,34077=>1000,34078=>1000,34079=>1000,34080=>1000,34081=>1000,34082=>1000,34083=>1000,34084=>1000, - 34085=>1000,34086=>1000,34087=>1000,34088=>1000,34089=>1000,34090=>1000,34091=>1000,34092=>1000,34093=>1000,34094=>1000,34095=>1000,34096=>1000,34097=>1000,34098=>1000,34099=>1000,34100=>1000, - 34101=>1000,34102=>1000,34103=>1000,34104=>1000,34105=>1000,34106=>1000,34107=>1000,34108=>1000,34109=>1000,34110=>1000,34111=>1000,34112=>1000,34113=>1000,34114=>1000,34115=>1000,34116=>1000, - 34117=>1000,34118=>1000,34119=>1000,34120=>1000,34121=>1000,34122=>1000,34123=>1000,34124=>1000,34125=>1000,34126=>1000,34127=>1000,34128=>1000,34129=>1000,34130=>1000,34131=>1000,34132=>1000, - 34133=>1000,34134=>1000,34135=>1000,34136=>1000,34137=>1000,34138=>1000,34139=>1000,34140=>1000,34141=>1000,34142=>1000,34143=>1000,34144=>1000,34145=>1000,34146=>1000,34147=>1000,34148=>1000, - 34149=>1000,34150=>1000,34151=>1000,34152=>1000,34153=>1000,34154=>1000,34155=>1000,34156=>1000,34157=>1000,34158=>1000,34159=>1000,34160=>1000,34161=>1000,34162=>1000,34163=>1000,34164=>1000, - 34165=>1000,34166=>1000,34167=>1000,34168=>1000,34169=>1000,34170=>1000,34171=>1000,34172=>1000,34173=>1000,34174=>1000,34175=>1000,34176=>1000,34177=>1000,34178=>1000,34179=>1000,34180=>1000, - 34181=>1000,34182=>1000,34183=>1000,34184=>1000,34185=>1000,34186=>1000,34187=>1000,34188=>1000,34189=>1000,34190=>1000,34191=>1000,34192=>1000,34193=>1000,34194=>1000,34195=>1000,34196=>1000, - 34197=>1000,34198=>1000,34199=>1000,34200=>1000,34201=>1000,34202=>1000,34203=>1000,34204=>1000,34205=>1000,34206=>1000,34207=>1000,34208=>1000,34209=>1000,34210=>1000,34211=>1000,34212=>1000, - 34213=>1000,34214=>1000,34215=>1000,34216=>1000,34217=>1000,34218=>1000,34219=>1000,34220=>1000,34221=>1000,34222=>1000,34223=>1000,34224=>1000,34225=>1000,34226=>1000,34227=>1000,34228=>1000, - 34229=>1000,34230=>1000,34231=>1000,34232=>1000,34233=>1000,34234=>1000,34235=>1000,34236=>1000,34237=>1000,34238=>1000,34239=>1000,34240=>1000,34241=>1000,34242=>1000,34243=>1000,34244=>1000, - 34245=>1000,34246=>1000,34247=>1000,34248=>1000,34249=>1000,34250=>1000,34251=>1000,34252=>1000,34253=>1000,34254=>1000,34255=>1000,34256=>1000,34257=>1000,34258=>1000,34259=>1000,34260=>1000, - 34261=>1000,34262=>1000,34263=>1000,34264=>1000,34265=>1000,34266=>1000,34267=>1000,34268=>1000,34269=>1000,34270=>1000,34271=>1000,34272=>1000,34273=>1000,34274=>1000,34275=>1000,34276=>1000, - 34277=>1000,34278=>1000,34279=>1000,34280=>1000,34281=>1000,34282=>1000,34283=>1000,34284=>1000,34285=>1000,34286=>1000,34287=>1000,34288=>1000,34289=>1000,34290=>1000,34291=>1000,34292=>1000, - 34293=>1000,34294=>1000,34295=>1000,34296=>1000,34297=>1000,34298=>1000,34299=>1000,34300=>1000,34301=>1000,34302=>1000,34303=>1000,34304=>1000,34305=>1000,34306=>1000,34307=>1000,34308=>1000, - 34309=>1000,34310=>1000,34311=>1000,34312=>1000,34313=>1000,34314=>1000,34315=>1000,34316=>1000,34317=>1000,34318=>1000,34319=>1000,34320=>1000,34321=>1000,34322=>1000,34323=>1000,34324=>1000, - 34325=>1000,34326=>1000,34327=>1000,34328=>1000,34329=>1000,34330=>1000,34331=>1000,34332=>1000,34333=>1000,34334=>1000,34335=>1000,34336=>1000,34337=>1000,34338=>1000,34339=>1000,34340=>1000, - 34341=>1000,34342=>1000,34343=>1000,34344=>1000,34345=>1000,34346=>1000,34347=>1000,34348=>1000,34349=>1000,34350=>1000,34351=>1000,34352=>1000,34353=>1000,34354=>1000,34355=>1000,34356=>1000, - 34357=>1000,34358=>1000,34359=>1000,34360=>1000,34361=>1000,34362=>1000,34363=>1000,34364=>1000,34365=>1000,34366=>1000,34367=>1000,34368=>1000,34369=>1000,34370=>1000,34371=>1000,34372=>1000, - 34373=>1000,34374=>1000,34375=>1000,34376=>1000,34377=>1000,34378=>1000,34379=>1000,34380=>1000,34381=>1000,34382=>1000,34383=>1000,34384=>1000,34385=>1000,34386=>1000,34387=>1000,34388=>1000, - 34389=>1000,34390=>1000,34391=>1000,34392=>1000,34393=>1000,34394=>1000,34395=>1000,34396=>1000,34397=>1000,34398=>1000,34399=>1000,34400=>1000,34401=>1000,34402=>1000,34403=>1000,34404=>1000, - 34405=>1000,34406=>1000,34407=>1000,34408=>1000,34409=>1000,34410=>1000,34411=>1000,34412=>1000,34413=>1000,34414=>1000,34415=>1000,34416=>1000,34417=>1000,34418=>1000,34419=>1000,34420=>1000, - 34421=>1000,34422=>1000,34423=>1000,34424=>1000,34425=>1000,34426=>1000,34427=>1000,34428=>1000,34429=>1000,34430=>1000,34431=>1000,34432=>1000,34433=>1000,34434=>1000,34435=>1000,34436=>1000, - 34437=>1000,34438=>1000,34439=>1000,34440=>1000,34441=>1000,34442=>1000,34443=>1000,34444=>1000,34445=>1000,34446=>1000,34447=>1000,34448=>1000,34449=>1000,34450=>1000,34451=>1000,34452=>1000, - 34453=>1000,34454=>1000,34455=>1000,34456=>1000,34457=>1000,34458=>1000,34459=>1000,34460=>1000,34461=>1000,34462=>1000,34463=>1000,34464=>1000,34465=>1000,34466=>1000,34467=>1000,34468=>1000, - 34469=>1000,34470=>1000,34471=>1000,34472=>1000,34473=>1000,34474=>1000,34475=>1000,34476=>1000,34477=>1000,34478=>1000,34479=>1000,34480=>1000,34481=>1000,34482=>1000,34483=>1000,34484=>1000, - 34485=>1000,34486=>1000,34487=>1000,34488=>1000,34489=>1000,34490=>1000,34491=>1000,34492=>1000,34493=>1000,34494=>1000,34495=>1000,34496=>1000,34497=>1000,34498=>1000,34499=>1000,34500=>1000, - 34501=>1000,34502=>1000,34503=>1000,34504=>1000,34505=>1000,34506=>1000,34507=>1000,34508=>1000,34509=>1000,34510=>1000,34511=>1000,34512=>1000,34513=>1000,34514=>1000,34515=>1000,34516=>1000, - 34517=>1000,34518=>1000,34519=>1000,34520=>1000,34521=>1000,34522=>1000,34523=>1000,34524=>1000,34525=>1000,34526=>1000,34527=>1000,34528=>1000,34529=>1000,34530=>1000,34531=>1000,34532=>1000, - 34533=>1000,34534=>1000,34535=>1000,34536=>1000,34537=>1000,34538=>1000,34539=>1000,34540=>1000,34541=>1000,34542=>1000,34543=>1000,34544=>1000,34545=>1000,34546=>1000,34547=>1000,34548=>1000, - 34549=>1000,34550=>1000,34551=>1000,34552=>1000,34553=>1000,34554=>1000,34555=>1000,34556=>1000,34557=>1000,34558=>1000,34559=>1000,34560=>1000,34561=>1000,34562=>1000,34563=>1000,34564=>1000, - 34565=>1000,34566=>1000,34567=>1000,34568=>1000,34569=>1000,34570=>1000,34571=>1000,34572=>1000,34573=>1000,34574=>1000,34575=>1000,34576=>1000,34577=>1000,34578=>1000,34579=>1000,34580=>1000, - 34581=>1000,34582=>1000,34583=>1000,34584=>1000,34585=>1000,34586=>1000,34587=>1000,34588=>1000,34589=>1000,34590=>1000,34591=>1000,34592=>1000,34593=>1000,34594=>1000,34595=>1000,34596=>1000, - 34597=>1000,34598=>1000,34599=>1000,34600=>1000,34601=>1000,34602=>1000,34603=>1000,34604=>1000,34605=>1000,34606=>1000,34607=>1000,34608=>1000,34609=>1000,34610=>1000,34611=>1000,34612=>1000, - 34613=>1000,34614=>1000,34615=>1000,34616=>1000,34617=>1000,34618=>1000,34619=>1000,34620=>1000,34621=>1000,34622=>1000,34623=>1000,34624=>1000,34625=>1000,34626=>1000,34627=>1000,34628=>1000, - 34629=>1000,34630=>1000,34631=>1000,34632=>1000,34633=>1000,34634=>1000,34635=>1000,34636=>1000,34637=>1000,34638=>1000,34639=>1000,34640=>1000,34641=>1000,34642=>1000,34643=>1000,34644=>1000, - 34645=>1000,34646=>1000,34647=>1000,34648=>1000,34649=>1000,34650=>1000,34651=>1000,34652=>1000,34653=>1000,34654=>1000,34655=>1000,34656=>1000,34657=>1000,34658=>1000,34659=>1000,34660=>1000, - 34661=>1000,34662=>1000,34663=>1000,34664=>1000,34665=>1000,34666=>1000,34667=>1000,34668=>1000,34669=>1000,34670=>1000,34671=>1000,34672=>1000,34673=>1000,34674=>1000,34675=>1000,34676=>1000, - 34677=>1000,34678=>1000,34679=>1000,34680=>1000,34681=>1000,34682=>1000,34683=>1000,34684=>1000,34685=>1000,34686=>1000,34687=>1000,34688=>1000,34689=>1000,34690=>1000,34691=>1000,34692=>1000, - 34693=>1000,34694=>1000,34695=>1000,34696=>1000,34697=>1000,34698=>1000,34699=>1000,34700=>1000,34701=>1000,34702=>1000,34703=>1000,34704=>1000,34705=>1000,34706=>1000,34707=>1000,34708=>1000, - 34709=>1000,34710=>1000,34711=>1000,34712=>1000,34713=>1000,34714=>1000,34715=>1000,34716=>1000,34717=>1000,34718=>1000,34719=>1000,34720=>1000,34721=>1000,34722=>1000,34723=>1000,34724=>1000, - 34725=>1000,34726=>1000,34727=>1000,34728=>1000,34729=>1000,34730=>1000,34731=>1000,34732=>1000,34733=>1000,34734=>1000,34735=>1000,34736=>1000,34737=>1000,34738=>1000,34739=>1000,34740=>1000, - 34741=>1000,34742=>1000,34743=>1000,34744=>1000,34745=>1000,34746=>1000,34747=>1000,34748=>1000,34749=>1000,34750=>1000,34751=>1000,34752=>1000,34753=>1000,34754=>1000,34755=>1000,34756=>1000, - 34757=>1000,34758=>1000,34759=>1000,34760=>1000,34761=>1000,34762=>1000,34763=>1000,34764=>1000,34765=>1000,34766=>1000,34767=>1000,34768=>1000,34769=>1000,34770=>1000,34771=>1000,34772=>1000, - 34773=>1000,34774=>1000,34775=>1000,34776=>1000,34777=>1000,34778=>1000,34779=>1000,34780=>1000,34781=>1000,34782=>1000,34783=>1000,34784=>1000,34785=>1000,34786=>1000,34787=>1000,34788=>1000, - 34789=>1000,34790=>1000,34791=>1000,34792=>1000,34793=>1000,34794=>1000,34795=>1000,34796=>1000,34797=>1000,34798=>1000,34799=>1000,34800=>1000,34801=>1000,34802=>1000,34803=>1000,34804=>1000, - 34805=>1000,34806=>1000,34807=>1000,34808=>1000,34809=>1000,34810=>1000,34811=>1000,34812=>1000,34813=>1000,34814=>1000,34815=>1000,34816=>1000,34817=>1000,34818=>1000,34819=>1000,34820=>1000, - 34821=>1000,34822=>1000,34823=>1000,34824=>1000,34825=>1000,34826=>1000,34827=>1000,34828=>1000,34829=>1000,34830=>1000,34831=>1000,34832=>1000,34833=>1000,34834=>1000,34835=>1000,34836=>1000, - 34837=>1000,34838=>1000,34839=>1000,34840=>1000,34841=>1000,34842=>1000,34843=>1000,34844=>1000,34845=>1000,34846=>1000,34847=>1000,34848=>1000,34849=>1000,34850=>1000,34851=>1000,34852=>1000, - 34853=>1000,34854=>1000,34855=>1000,34856=>1000,34857=>1000,34858=>1000,34859=>1000,34860=>1000,34861=>1000,34862=>1000,34863=>1000,34864=>1000,34865=>1000,34866=>1000,34867=>1000,34868=>1000, - 34869=>1000,34870=>1000,34871=>1000,34872=>1000,34873=>1000,34874=>1000,34875=>1000,34876=>1000,34877=>1000,34878=>1000,34879=>1000,34880=>1000,34881=>1000,34882=>1000,34883=>1000,34884=>1000, - 34885=>1000,34886=>1000,34887=>1000,34888=>1000,34889=>1000,34890=>1000,34891=>1000,34892=>1000,34893=>1000,34894=>1000,34895=>1000,34896=>1000,34897=>1000,34898=>1000,34899=>1000,34900=>1000, - 34901=>1000,34902=>1000,34903=>1000,34904=>1000,34905=>1000,34906=>1000,34907=>1000,34908=>1000,34909=>1000,34910=>1000,34911=>1000,34912=>1000,34913=>1000,34914=>1000,34915=>1000,34916=>1000, - 34917=>1000,34918=>1000,34919=>1000,34920=>1000,34921=>1000,34922=>1000,34923=>1000,34924=>1000,34925=>1000,34926=>1000,34927=>1000,34928=>1000,34929=>1000,34930=>1000,34931=>1000,34932=>1000, - 34933=>1000,34934=>1000,34935=>1000,34936=>1000,34937=>1000,34938=>1000,34939=>1000,34940=>1000,34941=>1000,34942=>1000,34943=>1000,34944=>1000,34945=>1000,34946=>1000,34947=>1000,34948=>1000, - 34949=>1000,34950=>1000,34951=>1000,34952=>1000,34953=>1000,34954=>1000,34955=>1000,34956=>1000,34957=>1000,34958=>1000,34959=>1000,34960=>1000,34961=>1000,34962=>1000,34963=>1000,34964=>1000, - 34965=>1000,34966=>1000,34967=>1000,34968=>1000,34969=>1000,34970=>1000,34971=>1000,34972=>1000,34973=>1000,34974=>1000,34975=>1000,34976=>1000,34977=>1000,34978=>1000,34979=>1000,34980=>1000, - 34981=>1000,34982=>1000,34983=>1000,34984=>1000,34985=>1000,34986=>1000,34987=>1000,34988=>1000,34989=>1000,34990=>1000,34991=>1000,34992=>1000,34993=>1000,34994=>1000,34995=>1000,34996=>1000, - 34997=>1000,34998=>1000,34999=>1000,35000=>1000,35001=>1000,35002=>1000,35003=>1000,35004=>1000,35005=>1000,35006=>1000,35007=>1000,35008=>1000,35009=>1000,35010=>1000,35011=>1000,35012=>1000, - 35013=>1000,35014=>1000,35015=>1000,35016=>1000,35017=>1000,35018=>1000,35019=>1000,35020=>1000,35021=>1000,35022=>1000,35023=>1000,35024=>1000,35025=>1000,35026=>1000,35027=>1000,35028=>1000, - 35029=>1000,35030=>1000,35031=>1000,35032=>1000,35033=>1000,35034=>1000,35035=>1000,35036=>1000,35037=>1000,35038=>1000,35039=>1000,35040=>1000,35041=>1000,35042=>1000,35043=>1000,35044=>1000, - 35045=>1000,35046=>1000,35047=>1000,35048=>1000,35049=>1000,35050=>1000,35051=>1000,35052=>1000,35053=>1000,35054=>1000,35055=>1000,35056=>1000,35057=>1000,35058=>1000,35059=>1000,35060=>1000, - 35061=>1000,35062=>1000,35063=>1000,35064=>1000,35065=>1000,35066=>1000,35067=>1000,35068=>1000,35069=>1000,35070=>1000,35071=>1000,35072=>1000,35073=>1000,35074=>1000,35075=>1000,35076=>1000, - 35077=>1000,35078=>1000,35079=>1000,35080=>1000,35081=>1000,35082=>1000,35083=>1000,35084=>1000,35085=>1000,35086=>1000,35087=>1000,35088=>1000,35089=>1000,35090=>1000,35091=>1000,35092=>1000, - 35093=>1000,35094=>1000,35095=>1000,35096=>1000,35097=>1000,35098=>1000,35099=>1000,35100=>1000,35101=>1000,35102=>1000,35103=>1000,35104=>1000,35105=>1000,35106=>1000,35107=>1000,35108=>1000, - 35109=>1000,35110=>1000,35111=>1000,35112=>1000,35113=>1000,35114=>1000,35115=>1000,35116=>1000,35117=>1000,35118=>1000,35119=>1000,35120=>1000,35121=>1000,35122=>1000,35123=>1000,35124=>1000, - 35125=>1000,35126=>1000,35127=>1000,35128=>1000,35129=>1000,35130=>1000,35131=>1000,35132=>1000,35133=>1000,35134=>1000,35135=>1000,35136=>1000,35137=>1000,35138=>1000,35139=>1000,35140=>1000, - 35141=>1000,35142=>1000,35143=>1000,35144=>1000,35145=>1000,35146=>1000,35147=>1000,35148=>1000,35149=>1000,35150=>1000,35151=>1000,35152=>1000,35153=>1000,35154=>1000,35155=>1000,35156=>1000, - 35157=>1000,35158=>1000,35159=>1000,35160=>1000,35161=>1000,35162=>1000,35163=>1000,35164=>1000,35165=>1000,35166=>1000,35167=>1000,35168=>1000,35169=>1000,35170=>1000,35171=>1000,35172=>1000, - 35173=>1000,35174=>1000,35175=>1000,35176=>1000,35177=>1000,35178=>1000,35179=>1000,35180=>1000,35181=>1000,35182=>1000,35183=>1000,35184=>1000,35185=>1000,35186=>1000,35187=>1000,35188=>1000, - 35189=>1000,35190=>1000,35191=>1000,35192=>1000,35193=>1000,35194=>1000,35195=>1000,35196=>1000,35197=>1000,35198=>1000,35199=>1000,35200=>1000,35201=>1000,35202=>1000,35203=>1000,35204=>1000, - 35205=>1000,35206=>1000,35207=>1000,35208=>1000,35209=>1000,35210=>1000,35211=>1000,35212=>1000,35213=>1000,35214=>1000,35215=>1000,35216=>1000,35217=>1000,35218=>1000,35219=>1000,35220=>1000, - 35221=>1000,35222=>1000,35223=>1000,35224=>1000,35225=>1000,35226=>1000,35227=>1000,35228=>1000,35229=>1000,35230=>1000,35231=>1000,35232=>1000,35233=>1000,35234=>1000,35235=>1000,35236=>1000, - 35237=>1000,35238=>1000,35239=>1000,35240=>1000,35241=>1000,35242=>1000,35243=>1000,35244=>1000,35245=>1000,35246=>1000,35247=>1000,35248=>1000,35249=>1000,35250=>1000,35251=>1000,35252=>1000, - 35253=>1000,35254=>1000,35255=>1000,35256=>1000,35257=>1000,35258=>1000,35259=>1000,35260=>1000,35261=>1000,35262=>1000,35263=>1000,35264=>1000,35265=>1000,35266=>1000,35267=>1000,35268=>1000, - 35269=>1000,35270=>1000,35271=>1000,35272=>1000,35273=>1000,35274=>1000,35275=>1000,35276=>1000,35277=>1000,35278=>1000,35279=>1000,35280=>1000,35281=>1000,35282=>1000,35283=>1000,35284=>1000, - 35285=>1000,35286=>1000,35287=>1000,35288=>1000,35289=>1000,35290=>1000,35291=>1000,35292=>1000,35293=>1000,35294=>1000,35295=>1000,35296=>1000,35297=>1000,35298=>1000,35299=>1000,35300=>1000, - 35301=>1000,35302=>1000,35303=>1000,35304=>1000,35305=>1000,35306=>1000,35307=>1000,35308=>1000,35309=>1000,35310=>1000,35311=>1000,35312=>1000,35313=>1000,35314=>1000,35315=>1000,35316=>1000, - 35317=>1000,35318=>1000,35319=>1000,35320=>1000,35321=>1000,35322=>1000,35323=>1000,35324=>1000,35325=>1000,35326=>1000,35327=>1000,35328=>1000,35329=>1000,35330=>1000,35331=>1000,35332=>1000, - 35333=>1000,35334=>1000,35335=>1000,35336=>1000,35337=>1000,35338=>1000,35339=>1000,35340=>1000,35341=>1000,35342=>1000,35343=>1000,35344=>1000,35345=>1000,35346=>1000,35347=>1000,35348=>1000, - 35349=>1000,35350=>1000,35351=>1000,35352=>1000,35353=>1000,35354=>1000,35355=>1000,35356=>1000,35357=>1000,35358=>1000,35359=>1000,35360=>1000,35361=>1000,35362=>1000,35363=>1000,35364=>1000, - 35365=>1000,35366=>1000,35367=>1000,35368=>1000,35369=>1000,35370=>1000,35371=>1000,35372=>1000,35373=>1000,35374=>1000,35375=>1000,35376=>1000,35377=>1000,35378=>1000,35379=>1000,35380=>1000, - 35381=>1000,35382=>1000,35383=>1000,35384=>1000,35385=>1000,35386=>1000,35387=>1000,35388=>1000,35389=>1000,35390=>1000,35391=>1000,35392=>1000,35393=>1000,35394=>1000,35395=>1000,35396=>1000, - 35397=>1000,35398=>1000,35399=>1000,35400=>1000,35401=>1000,35402=>1000,35403=>1000,35404=>1000,35405=>1000,35406=>1000,35407=>1000,35408=>1000,35409=>1000,35410=>1000,35411=>1000,35412=>1000, - 35413=>1000,35414=>1000,35415=>1000,35416=>1000,35417=>1000,35418=>1000,35419=>1000,35420=>1000,35421=>1000,35422=>1000,35423=>1000,35424=>1000,35425=>1000,35426=>1000,35427=>1000,35428=>1000, - 35429=>1000,35430=>1000,35431=>1000,35432=>1000,35433=>1000,35434=>1000,35435=>1000,35436=>1000,35437=>1000,35438=>1000,35439=>1000,35440=>1000,35441=>1000,35442=>1000,35443=>1000,35444=>1000, - 35445=>1000,35446=>1000,35447=>1000,35448=>1000,35449=>1000,35450=>1000,35451=>1000,35452=>1000,35453=>1000,35454=>1000,35455=>1000,35456=>1000,35457=>1000,35458=>1000,35459=>1000,35460=>1000, - 35461=>1000,35462=>1000,35463=>1000,35464=>1000,35465=>1000,35466=>1000,35467=>1000,35468=>1000,35469=>1000,35470=>1000,35471=>1000,35472=>1000,35473=>1000,35474=>1000,35475=>1000,35476=>1000, - 35477=>1000,35478=>1000,35479=>1000,35480=>1000,35481=>1000,35482=>1000,35483=>1000,35484=>1000,35485=>1000,35486=>1000,35487=>1000,35488=>1000,35489=>1000,35490=>1000,35491=>1000,35492=>1000, - 35493=>1000,35494=>1000,35495=>1000,35496=>1000,35497=>1000,35498=>1000,35499=>1000,35500=>1000,35501=>1000,35502=>1000,35503=>1000,35504=>1000,35505=>1000,35506=>1000,35507=>1000,35508=>1000, - 35509=>1000,35510=>1000,35511=>1000,35512=>1000,35513=>1000,35514=>1000,35515=>1000,35516=>1000,35517=>1000,35518=>1000,35519=>1000,35520=>1000,35521=>1000,35522=>1000,35523=>1000,35524=>1000, - 35525=>1000,35526=>1000,35527=>1000,35528=>1000,35529=>1000,35530=>1000,35531=>1000,35532=>1000,35533=>1000,35534=>1000,35535=>1000,35536=>1000,35537=>1000,35538=>1000,35539=>1000,35540=>1000, - 35541=>1000,35542=>1000,35543=>1000,35544=>1000,35545=>1000,35546=>1000,35547=>1000,35548=>1000,35549=>1000,35550=>1000,35551=>1000,35552=>1000,35553=>1000,35554=>1000,35555=>1000,35556=>1000, - 35557=>1000,35558=>1000,35559=>1000,35560=>1000,35561=>1000,35562=>1000,35563=>1000,35564=>1000,35565=>1000,35566=>1000,35567=>1000,35568=>1000,35569=>1000,35570=>1000,35571=>1000,35572=>1000, - 35573=>1000,35574=>1000,35575=>1000,35576=>1000,35577=>1000,35578=>1000,35579=>1000,35580=>1000,35581=>1000,35582=>1000,35583=>1000,35584=>1000,35585=>1000,35586=>1000,35587=>1000,35588=>1000, - 35589=>1000,35590=>1000,35591=>1000,35592=>1000,35593=>1000,35594=>1000,35595=>1000,35596=>1000,35597=>1000,35598=>1000,35599=>1000,35600=>1000,35601=>1000,35602=>1000,35603=>1000,35604=>1000, - 35605=>1000,35606=>1000,35607=>1000,35608=>1000,35609=>1000,35610=>1000,35611=>1000,35612=>1000,35613=>1000,35614=>1000,35615=>1000,35616=>1000,35617=>1000,35618=>1000,35619=>1000,35620=>1000, - 35621=>1000,35622=>1000,35623=>1000,35624=>1000,35625=>1000,35626=>1000,35627=>1000,35628=>1000,35629=>1000,35630=>1000,35631=>1000,35632=>1000,35633=>1000,35634=>1000,35635=>1000,35636=>1000, - 35637=>1000,35638=>1000,35639=>1000,35640=>1000,35641=>1000,35642=>1000,35643=>1000,35644=>1000,35645=>1000,35646=>1000,35647=>1000,35648=>1000,35649=>1000,35650=>1000,35651=>1000,35652=>1000, - 35653=>1000,35654=>1000,35655=>1000,35656=>1000,35657=>1000,35658=>1000,35659=>1000,35660=>1000,35661=>1000,35662=>1000,35663=>1000,35664=>1000,35665=>1000,35666=>1000,35667=>1000,35668=>1000, - 35669=>1000,35670=>1000,35671=>1000,35672=>1000,35673=>1000,35674=>1000,35675=>1000,35676=>1000,35677=>1000,35678=>1000,35679=>1000,35680=>1000,35681=>1000,35682=>1000,35683=>1000,35684=>1000, - 35685=>1000,35686=>1000,35687=>1000,35688=>1000,35689=>1000,35690=>1000,35691=>1000,35692=>1000,35693=>1000,35694=>1000,35695=>1000,35696=>1000,35697=>1000,35698=>1000,35699=>1000,35700=>1000, - 35701=>1000,35702=>1000,35703=>1000,35704=>1000,35705=>1000,35706=>1000,35707=>1000,35708=>1000,35709=>1000,35710=>1000,35711=>1000,35712=>1000,35713=>1000,35714=>1000,35715=>1000,35716=>1000, - 35717=>1000,35718=>1000,35719=>1000,35720=>1000,35721=>1000,35722=>1000,35723=>1000,35724=>1000,35725=>1000,35726=>1000,35727=>1000,35728=>1000,35729=>1000,35730=>1000,35731=>1000,35732=>1000, - 35733=>1000,35734=>1000,35735=>1000,35736=>1000,35737=>1000,35738=>1000,35739=>1000,35740=>1000,35741=>1000,35742=>1000,35743=>1000,35744=>1000,35745=>1000,35746=>1000,35747=>1000,35748=>1000, - 35749=>1000,35750=>1000,35751=>1000,35752=>1000,35753=>1000,35754=>1000,35755=>1000,35756=>1000,35757=>1000,35758=>1000,35759=>1000,35760=>1000,35761=>1000,35762=>1000,35763=>1000,35764=>1000, - 35765=>1000,35766=>1000,35767=>1000,35768=>1000,35769=>1000,35770=>1000,35771=>1000,35772=>1000,35773=>1000,35774=>1000,35775=>1000,35776=>1000,35777=>1000,35778=>1000,35779=>1000,35780=>1000, - 35781=>1000,35782=>1000,35783=>1000,35784=>1000,35785=>1000,35786=>1000,35787=>1000,35788=>1000,35789=>1000,35790=>1000,35791=>1000,35792=>1000,35793=>1000,35794=>1000,35795=>1000,35796=>1000, - 35797=>1000,35798=>1000,35799=>1000,35800=>1000,35801=>1000,35802=>1000,35803=>1000,35804=>1000,35805=>1000,35806=>1000,35807=>1000,35808=>1000,35809=>1000,35810=>1000,35811=>1000,35812=>1000, - 35813=>1000,35814=>1000,35815=>1000,35816=>1000,35817=>1000,35818=>1000,35819=>1000,35820=>1000,35821=>1000,35822=>1000,35823=>1000,35824=>1000,35825=>1000,35826=>1000,35827=>1000,35828=>1000, - 35829=>1000,35830=>1000,35831=>1000,35832=>1000,35833=>1000,35834=>1000,35835=>1000,35836=>1000,35837=>1000,35838=>1000,35839=>1000,35840=>1000,35841=>1000,35842=>1000,35843=>1000,35844=>1000, - 35845=>1000,35846=>1000,35847=>1000,35848=>1000,35849=>1000,35850=>1000,35851=>1000,35852=>1000,35853=>1000,35854=>1000,35855=>1000,35856=>1000,35857=>1000,35858=>1000,35859=>1000,35860=>1000, - 35861=>1000,35862=>1000,35863=>1000,35864=>1000,35865=>1000,35866=>1000,35867=>1000,35868=>1000,35869=>1000,35870=>1000,35871=>1000,35872=>1000,35873=>1000,35874=>1000,35875=>1000,35876=>1000, - 35877=>1000,35878=>1000,35879=>1000,35880=>1000,35881=>1000,35882=>1000,35883=>1000,35884=>1000,35885=>1000,35886=>1000,35887=>1000,35888=>1000,35889=>1000,35890=>1000,35891=>1000,35892=>1000, - 35893=>1000,35894=>1000,35895=>1000,35896=>1000,35897=>1000,35898=>1000,35899=>1000,35900=>1000,35901=>1000,35902=>1000,35903=>1000,35904=>1000,35905=>1000,35906=>1000,35907=>1000,35908=>1000, - 35909=>1000,35910=>1000,35911=>1000,35912=>1000,35913=>1000,35914=>1000,35915=>1000,35916=>1000,35917=>1000,35918=>1000,35919=>1000,35920=>1000,35921=>1000,35922=>1000,35923=>1000,35924=>1000, - 35925=>1000,35926=>1000,35927=>1000,35928=>1000,35929=>1000,35930=>1000,35931=>1000,35932=>1000,35933=>1000,35934=>1000,35935=>1000,35936=>1000,35937=>1000,35938=>1000,35939=>1000,35940=>1000, - 35941=>1000,35942=>1000,35943=>1000,35944=>1000,35945=>1000,35946=>1000,35947=>1000,35948=>1000,35949=>1000,35950=>1000,35951=>1000,35952=>1000,35953=>1000,35954=>1000,35955=>1000,35956=>1000, - 35957=>1000,35958=>1000,35959=>1000,35960=>1000,35961=>1000,35962=>1000,35963=>1000,35964=>1000,35965=>1000,35966=>1000,35967=>1000,35968=>1000,35969=>1000,35970=>1000,35971=>1000,35972=>1000, - 35973=>1000,35974=>1000,35975=>1000,35976=>1000,35977=>1000,35978=>1000,35979=>1000,35980=>1000,35981=>1000,35982=>1000,35983=>1000,35984=>1000,35985=>1000,35986=>1000,35987=>1000,35988=>1000, - 35989=>1000,35990=>1000,35991=>1000,35992=>1000,35993=>1000,35994=>1000,35995=>1000,35996=>1000,35997=>1000,35998=>1000,35999=>1000,36000=>1000,36001=>1000,36002=>1000,36003=>1000,36004=>1000, - 36005=>1000,36006=>1000,36007=>1000,36008=>1000,36009=>1000,36010=>1000,36011=>1000,36012=>1000,36013=>1000,36014=>1000,36015=>1000,36016=>1000,36017=>1000,36018=>1000,36019=>1000,36020=>1000, - 36021=>1000,36022=>1000,36023=>1000,36024=>1000,36025=>1000,36026=>1000,36027=>1000,36028=>1000,36029=>1000,36030=>1000,36031=>1000,36032=>1000,36033=>1000,36034=>1000,36035=>1000,36036=>1000, - 36037=>1000,36038=>1000,36039=>1000,36040=>1000,36041=>1000,36042=>1000,36043=>1000,36044=>1000,36045=>1000,36046=>1000,36047=>1000,36048=>1000,36049=>1000,36050=>1000,36051=>1000,36052=>1000, - 36053=>1000,36054=>1000,36055=>1000,36056=>1000,36057=>1000,36058=>1000,36059=>1000,36060=>1000,36061=>1000,36062=>1000,36063=>1000,36064=>1000,36065=>1000,36066=>1000,36067=>1000,36068=>1000, - 36069=>1000,36070=>1000,36071=>1000,36072=>1000,36073=>1000,36074=>1000,36075=>1000,36076=>1000,36077=>1000,36078=>1000,36079=>1000,36080=>1000,36081=>1000,36082=>1000,36083=>1000,36084=>1000, - 36085=>1000,36086=>1000,36087=>1000,36088=>1000,36089=>1000,36090=>1000,36091=>1000,36092=>1000,36093=>1000,36094=>1000,36095=>1000,36096=>1000,36097=>1000,36098=>1000,36099=>1000,36100=>1000, - 36101=>1000,36102=>1000,36103=>1000,36104=>1000,36105=>1000,36106=>1000,36107=>1000,36108=>1000,36109=>1000,36110=>1000,36111=>1000,36112=>1000,36113=>1000,36114=>1000,36115=>1000,36116=>1000, - 36117=>1000,36118=>1000,36119=>1000,36120=>1000,36121=>1000,36122=>1000,36123=>1000,36124=>1000,36125=>1000,36126=>1000,36127=>1000,36128=>1000,36129=>1000,36130=>1000,36131=>1000,36132=>1000, - 36133=>1000,36134=>1000,36135=>1000,36136=>1000,36137=>1000,36138=>1000,36139=>1000,36140=>1000,36141=>1000,36142=>1000,36143=>1000,36144=>1000,36145=>1000,36146=>1000,36147=>1000,36148=>1000, - 36149=>1000,36150=>1000,36151=>1000,36152=>1000,36153=>1000,36154=>1000,36155=>1000,36156=>1000,36157=>1000,36158=>1000,36159=>1000,36160=>1000,36161=>1000,36162=>1000,36163=>1000,36164=>1000, - 36165=>1000,36166=>1000,36167=>1000,36168=>1000,36169=>1000,36170=>1000,36171=>1000,36172=>1000,36173=>1000,36174=>1000,36175=>1000,36176=>1000,36177=>1000,36178=>1000,36179=>1000,36180=>1000, - 36181=>1000,36182=>1000,36183=>1000,36184=>1000,36185=>1000,36186=>1000,36187=>1000,36188=>1000,36189=>1000,36190=>1000,36191=>1000,36192=>1000,36193=>1000,36194=>1000,36195=>1000,36196=>1000, - 36197=>1000,36198=>1000,36199=>1000,36200=>1000,36201=>1000,36202=>1000,36203=>1000,36204=>1000,36205=>1000,36206=>1000,36207=>1000,36208=>1000,36209=>1000,36210=>1000,36211=>1000,36212=>1000, - 36213=>1000,36214=>1000,36215=>1000,36216=>1000,36217=>1000,36218=>1000,36219=>1000,36220=>1000,36221=>1000,36222=>1000,36223=>1000,36224=>1000,36225=>1000,36226=>1000,36227=>1000,36228=>1000, - 36229=>1000,36230=>1000,36231=>1000,36232=>1000,36233=>1000,36234=>1000,36235=>1000,36236=>1000,36237=>1000,36238=>1000,36239=>1000,36240=>1000,36241=>1000,36242=>1000,36243=>1000,36244=>1000, - 36245=>1000,36246=>1000,36247=>1000,36248=>1000,36249=>1000,36250=>1000,36251=>1000,36252=>1000,36253=>1000,36254=>1000,36255=>1000,36256=>1000,36257=>1000,36258=>1000,36259=>1000,36260=>1000, - 36261=>1000,36262=>1000,36263=>1000,36264=>1000,36265=>1000,36266=>1000,36267=>1000,36268=>1000,36269=>1000,36270=>1000,36271=>1000,36272=>1000,36273=>1000,36274=>1000,36275=>1000,36276=>1000, - 36277=>1000,36278=>1000,36279=>1000,36280=>1000,36281=>1000,36282=>1000,36283=>1000,36284=>1000,36285=>1000,36286=>1000,36287=>1000,36288=>1000,36289=>1000,36290=>1000,36291=>1000,36292=>1000, - 36293=>1000,36294=>1000,36295=>1000,36296=>1000,36297=>1000,36298=>1000,36299=>1000,36300=>1000,36301=>1000,36302=>1000,36303=>1000,36304=>1000,36305=>1000,36306=>1000,36307=>1000,36308=>1000, - 36309=>1000,36310=>1000,36311=>1000,36312=>1000,36313=>1000,36314=>1000,36315=>1000,36316=>1000,36317=>1000,36318=>1000,36319=>1000,36320=>1000,36321=>1000,36322=>1000,36323=>1000,36324=>1000, - 36325=>1000,36326=>1000,36327=>1000,36328=>1000,36329=>1000,36330=>1000,36331=>1000,36332=>1000,36333=>1000,36334=>1000,36335=>1000,36336=>1000,36337=>1000,36338=>1000,36339=>1000,36340=>1000, - 36341=>1000,36342=>1000,36343=>1000,36344=>1000,36345=>1000,36346=>1000,36347=>1000,36348=>1000,36349=>1000,36350=>1000,36351=>1000,36352=>1000,36353=>1000,36354=>1000,36355=>1000,36356=>1000, - 36357=>1000,36358=>1000,36359=>1000,36360=>1000,36361=>1000,36362=>1000,36363=>1000,36364=>1000,36365=>1000,36366=>1000,36367=>1000,36368=>1000,36369=>1000,36370=>1000,36371=>1000,36372=>1000, - 36373=>1000,36374=>1000,36375=>1000,36376=>1000,36377=>1000,36378=>1000,36379=>1000,36380=>1000,36381=>1000,36382=>1000,36383=>1000,36384=>1000,36385=>1000,36386=>1000,36387=>1000,36388=>1000, - 36389=>1000,36390=>1000,36391=>1000,36392=>1000,36393=>1000,36394=>1000,36395=>1000,36396=>1000,36397=>1000,36398=>1000,36399=>1000,36400=>1000,36401=>1000,36402=>1000,36403=>1000,36404=>1000, - 36405=>1000,36406=>1000,36407=>1000,36408=>1000,36409=>1000,36410=>1000,36411=>1000,36412=>1000,36413=>1000,36414=>1000,36415=>1000,36416=>1000,36417=>1000,36418=>1000,36419=>1000,36420=>1000, - 36421=>1000,36422=>1000,36423=>1000,36424=>1000,36425=>1000,36426=>1000,36427=>1000,36428=>1000,36429=>1000,36430=>1000,36431=>1000,36432=>1000,36433=>1000,36434=>1000,36435=>1000,36436=>1000, - 36437=>1000,36438=>1000,36439=>1000,36440=>1000,36441=>1000,36442=>1000,36443=>1000,36444=>1000,36445=>1000,36446=>1000,36447=>1000,36448=>1000,36449=>1000,36450=>1000,36451=>1000,36452=>1000, - 36453=>1000,36454=>1000,36455=>1000,36456=>1000,36457=>1000,36458=>1000,36459=>1000,36460=>1000,36461=>1000,36462=>1000,36463=>1000,36464=>1000,36465=>1000,36466=>1000,36467=>1000,36468=>1000, - 36469=>1000,36470=>1000,36471=>1000,36472=>1000,36473=>1000,36474=>1000,36475=>1000,36476=>1000,36477=>1000,36478=>1000,36479=>1000,36480=>1000,36481=>1000,36482=>1000,36483=>1000,36484=>1000, - 36485=>1000,36486=>1000,36487=>1000,36488=>1000,36489=>1000,36490=>1000,36491=>1000,36492=>1000,36493=>1000,36494=>1000,36495=>1000,36496=>1000,36497=>1000,36498=>1000,36499=>1000,36500=>1000, - 36501=>1000,36502=>1000,36503=>1000,36504=>1000,36505=>1000,36506=>1000,36507=>1000,36508=>1000,36509=>1000,36510=>1000,36511=>1000,36512=>1000,36513=>1000,36514=>1000,36515=>1000,36516=>1000, - 36517=>1000,36518=>1000,36519=>1000,36520=>1000,36521=>1000,36522=>1000,36523=>1000,36524=>1000,36525=>1000,36526=>1000,36527=>1000,36528=>1000,36529=>1000,36530=>1000,36531=>1000,36532=>1000, - 36533=>1000,36534=>1000,36535=>1000,36536=>1000,36537=>1000,36538=>1000,36539=>1000,36540=>1000,36541=>1000,36542=>1000,36543=>1000,36544=>1000,36545=>1000,36546=>1000,36547=>1000,36548=>1000, - 36549=>1000,36550=>1000,36551=>1000,36552=>1000,36553=>1000,36554=>1000,36555=>1000,36556=>1000,36557=>1000,36558=>1000,36559=>1000,36560=>1000,36561=>1000,36562=>1000,36563=>1000,36564=>1000, - 36565=>1000,36566=>1000,36567=>1000,36568=>1000,36569=>1000,36570=>1000,36571=>1000,36572=>1000,36573=>1000,36574=>1000,36575=>1000,36576=>1000,36577=>1000,36578=>1000,36579=>1000,36580=>1000, - 36581=>1000,36582=>1000,36583=>1000,36584=>1000,36585=>1000,36586=>1000,36587=>1000,36588=>1000,36589=>1000,36590=>1000,36591=>1000,36592=>1000,36593=>1000,36594=>1000,36595=>1000,36596=>1000, - 36597=>1000,36598=>1000,36599=>1000,36600=>1000,36601=>1000,36602=>1000,36603=>1000,36604=>1000,36605=>1000,36606=>1000,36607=>1000,36608=>1000,36609=>1000,36610=>1000,36611=>1000,36612=>1000, - 36613=>1000,36614=>1000,36615=>1000,36616=>1000,36617=>1000,36618=>1000,36619=>1000,36620=>1000,36621=>1000,36622=>1000,36623=>1000,36624=>1000,36625=>1000,36626=>1000,36627=>1000,36628=>1000, - 36629=>1000,36630=>1000,36631=>1000,36632=>1000,36633=>1000,36634=>1000,36635=>1000,36636=>1000,36637=>1000,36638=>1000,36639=>1000,36640=>1000,36641=>1000,36642=>1000,36643=>1000,36644=>1000, - 36645=>1000,36646=>1000,36647=>1000,36648=>1000,36649=>1000,36650=>1000,36651=>1000,36652=>1000,36653=>1000,36654=>1000,36655=>1000,36656=>1000,36657=>1000,36658=>1000,36659=>1000,36660=>1000, - 36661=>1000,36662=>1000,36663=>1000,36664=>1000,36665=>1000,36666=>1000,36667=>1000,36668=>1000,36669=>1000,36670=>1000,36671=>1000,36672=>1000,36673=>1000,36674=>1000,36675=>1000,36676=>1000, - 36677=>1000,36678=>1000,36679=>1000,36680=>1000,36681=>1000,36682=>1000,36683=>1000,36684=>1000,36685=>1000,36686=>1000,36687=>1000,36688=>1000,36689=>1000,36690=>1000,36691=>1000,36692=>1000, - 36693=>1000,36694=>1000,36695=>1000,36696=>1000,36697=>1000,36698=>1000,36699=>1000,36700=>1000,36701=>1000,36702=>1000,36703=>1000,36704=>1000,36705=>1000,36706=>1000,36707=>1000,36708=>1000, - 36709=>1000,36710=>1000,36711=>1000,36712=>1000,36713=>1000,36714=>1000,36715=>1000,36716=>1000,36717=>1000,36718=>1000,36719=>1000,36720=>1000,36721=>1000,36722=>1000,36723=>1000,36724=>1000, - 36725=>1000,36726=>1000,36727=>1000,36728=>1000,36729=>1000,36730=>1000,36731=>1000,36732=>1000,36733=>1000,36734=>1000,36735=>1000,36736=>1000,36737=>1000,36738=>1000,36739=>1000,36740=>1000, - 36741=>1000,36742=>1000,36743=>1000,36744=>1000,36745=>1000,36746=>1000,36747=>1000,36748=>1000,36749=>1000,36750=>1000,36751=>1000,36752=>1000,36753=>1000,36754=>1000,36755=>1000,36756=>1000, - 36757=>1000,36758=>1000,36759=>1000,36760=>1000,36761=>1000,36762=>1000,36763=>1000,36764=>1000,36765=>1000,36766=>1000,36767=>1000,36768=>1000,36769=>1000,36770=>1000,36771=>1000,36772=>1000, - 36773=>1000,36774=>1000,36775=>1000,36776=>1000,36777=>1000,36778=>1000,36779=>1000,36780=>1000,36781=>1000,36782=>1000,36783=>1000,36784=>1000,36785=>1000,36786=>1000,36787=>1000,36788=>1000, - 36789=>1000,36790=>1000,36791=>1000,36792=>1000,36793=>1000,36794=>1000,36795=>1000,36796=>1000,36797=>1000,36798=>1000,36799=>1000,36800=>1000,36801=>1000,36802=>1000,36803=>1000,36804=>1000, - 36805=>1000,36806=>1000,36807=>1000,36808=>1000,36809=>1000,36810=>1000,36811=>1000,36812=>1000,36813=>1000,36814=>1000,36815=>1000,36816=>1000,36817=>1000,36818=>1000,36819=>1000,36820=>1000, - 36821=>1000,36822=>1000,36823=>1000,36824=>1000,36825=>1000,36826=>1000,36827=>1000,36828=>1000,36829=>1000,36830=>1000,36831=>1000,36832=>1000,36833=>1000,36834=>1000,36835=>1000,36836=>1000, - 36837=>1000,36838=>1000,36839=>1000,36840=>1000,36841=>1000,36842=>1000,36843=>1000,36844=>1000,36845=>1000,36846=>1000,36847=>1000,36848=>1000,36849=>1000,36850=>1000,36851=>1000,36852=>1000, - 36853=>1000,36854=>1000,36855=>1000,36856=>1000,36857=>1000,36858=>1000,36859=>1000,36860=>1000,36861=>1000,36862=>1000,36863=>1000,36864=>1000,36865=>1000,36866=>1000,36867=>1000,36868=>1000, - 36869=>1000,36870=>1000,36871=>1000,36872=>1000,36873=>1000,36874=>1000,36875=>1000,36876=>1000,36877=>1000,36878=>1000,36879=>1000,36880=>1000,36881=>1000,36882=>1000,36883=>1000,36884=>1000, - 36885=>1000,36886=>1000,36887=>1000,36888=>1000,36889=>1000,36890=>1000,36891=>1000,36892=>1000,36893=>1000,36894=>1000,36895=>1000,36896=>1000,36897=>1000,36898=>1000,36899=>1000,36900=>1000, - 36901=>1000,36902=>1000,36903=>1000,36904=>1000,36905=>1000,36906=>1000,36907=>1000,36908=>1000,36909=>1000,36910=>1000,36911=>1000,36912=>1000,36913=>1000,36914=>1000,36915=>1000,36916=>1000, - 36917=>1000,36918=>1000,36919=>1000,36920=>1000,36921=>1000,36922=>1000,36923=>1000,36924=>1000,36925=>1000,36926=>1000,36927=>1000,36928=>1000,36929=>1000,36930=>1000,36931=>1000,36932=>1000, - 36933=>1000,36934=>1000,36935=>1000,36936=>1000,36937=>1000,36938=>1000,36939=>1000,36940=>1000,36941=>1000,36942=>1000,36943=>1000,36944=>1000,36945=>1000,36946=>1000,36947=>1000,36948=>1000, - 36949=>1000,36950=>1000,36951=>1000,36952=>1000,36953=>1000,36954=>1000,36955=>1000,36956=>1000,36957=>1000,36958=>1000,36959=>1000,36960=>1000,36961=>1000,36962=>1000,36963=>1000,36964=>1000, - 36965=>1000,36966=>1000,36967=>1000,36968=>1000,36969=>1000,36970=>1000,36971=>1000,36972=>1000,36973=>1000,36974=>1000,36975=>1000,36976=>1000,36977=>1000,36978=>1000,36979=>1000,36980=>1000, - 36981=>1000,36982=>1000,36983=>1000,36984=>1000,36985=>1000,36986=>1000,36987=>1000,36988=>1000,36989=>1000,36990=>1000,36991=>1000,36992=>1000,36993=>1000,36994=>1000,36995=>1000,36996=>1000, - 36997=>1000,36998=>1000,36999=>1000,37000=>1000,37001=>1000,37002=>1000,37003=>1000,37004=>1000,37005=>1000,37006=>1000,37007=>1000,37008=>1000,37009=>1000,37010=>1000,37011=>1000,37012=>1000, - 37013=>1000,37014=>1000,37015=>1000,37016=>1000,37017=>1000,37018=>1000,37019=>1000,37020=>1000,37021=>1000,37022=>1000,37023=>1000,37024=>1000,37025=>1000,37026=>1000,37027=>1000,37028=>1000, - 37029=>1000,37030=>1000,37031=>1000,37032=>1000,37033=>1000,37034=>1000,37035=>1000,37036=>1000,37037=>1000,37038=>1000,37039=>1000,37040=>1000,37041=>1000,37042=>1000,37043=>1000,37044=>1000, - 37045=>1000,37046=>1000,37047=>1000,37048=>1000,37049=>1000,37050=>1000,37051=>1000,37052=>1000,37053=>1000,37054=>1000,37055=>1000,37056=>1000,37057=>1000,37058=>1000,37059=>1000,37060=>1000, - 37061=>1000,37062=>1000,37063=>1000,37064=>1000,37065=>1000,37066=>1000,37067=>1000,37068=>1000,37069=>1000,37070=>1000,37071=>1000,37072=>1000,37073=>1000,37074=>1000,37075=>1000,37076=>1000, - 37077=>1000,37078=>1000,37079=>1000,37080=>1000,37081=>1000,37082=>1000,37083=>1000,37084=>1000,37085=>1000,37086=>1000,37087=>1000,37088=>1000,37089=>1000,37090=>1000,37091=>1000,37092=>1000, - 37093=>1000,37094=>1000,37095=>1000,37096=>1000,37097=>1000,37098=>1000,37099=>1000,37100=>1000,37101=>1000,37102=>1000,37103=>1000,37104=>1000,37105=>1000,37106=>1000,37107=>1000,37108=>1000, - 37109=>1000,37110=>1000,37111=>1000,37112=>1000,37113=>1000,37114=>1000,37115=>1000,37116=>1000,37117=>1000,37118=>1000,37119=>1000,37120=>1000,37121=>1000,37122=>1000,37123=>1000,37124=>1000, - 37125=>1000,37126=>1000,37127=>1000,37128=>1000,37129=>1000,37130=>1000,37131=>1000,37132=>1000,37133=>1000,37134=>1000,37135=>1000,37136=>1000,37137=>1000,37138=>1000,37139=>1000,37140=>1000, - 37141=>1000,37142=>1000,37143=>1000,37144=>1000,37145=>1000,37146=>1000,37147=>1000,37148=>1000,37149=>1000,37150=>1000,37151=>1000,37152=>1000,37153=>1000,37154=>1000,37155=>1000,37156=>1000, - 37157=>1000,37158=>1000,37159=>1000,37160=>1000,37161=>1000,37162=>1000,37163=>1000,37164=>1000,37165=>1000,37166=>1000,37167=>1000,37168=>1000,37169=>1000,37170=>1000,37171=>1000,37172=>1000, - 37173=>1000,37174=>1000,37175=>1000,37176=>1000,37177=>1000,37178=>1000,37179=>1000,37180=>1000,37181=>1000,37182=>1000,37183=>1000,37184=>1000,37185=>1000,37186=>1000,37187=>1000,37188=>1000, - 37189=>1000,37190=>1000,37191=>1000,37192=>1000,37193=>1000,37194=>1000,37195=>1000,37196=>1000,37197=>1000,37198=>1000,37199=>1000,37200=>1000,37201=>1000,37202=>1000,37203=>1000,37204=>1000, - 37205=>1000,37206=>1000,37207=>1000,37208=>1000,37209=>1000,37210=>1000,37211=>1000,37212=>1000,37213=>1000,37214=>1000,37215=>1000,37216=>1000,37217=>1000,37218=>1000,37219=>1000,37220=>1000, - 37221=>1000,37222=>1000,37223=>1000,37224=>1000,37225=>1000,37226=>1000,37227=>1000,37228=>1000,37229=>1000,37230=>1000,37231=>1000,37232=>1000,37233=>1000,37234=>1000,37235=>1000,37236=>1000, - 37237=>1000,37238=>1000,37239=>1000,37240=>1000,37241=>1000,37242=>1000,37243=>1000,37244=>1000,37245=>1000,37246=>1000,37247=>1000,37248=>1000,37249=>1000,37250=>1000,37251=>1000,37252=>1000, - 37253=>1000,37254=>1000,37255=>1000,37256=>1000,37257=>1000,37258=>1000,37259=>1000,37260=>1000,37261=>1000,37262=>1000,37263=>1000,37264=>1000,37265=>1000,37266=>1000,37267=>1000,37268=>1000, - 37269=>1000,37270=>1000,37271=>1000,37272=>1000,37273=>1000,37274=>1000,37275=>1000,37276=>1000,37277=>1000,37278=>1000,37279=>1000,37280=>1000,37281=>1000,37282=>1000,37283=>1000,37284=>1000, - 37285=>1000,37286=>1000,37287=>1000,37288=>1000,37289=>1000,37290=>1000,37291=>1000,37292=>1000,37293=>1000,37294=>1000,37295=>1000,37296=>1000,37297=>1000,37298=>1000,37299=>1000,37300=>1000, - 37301=>1000,37302=>1000,37303=>1000,37304=>1000,37305=>1000,37306=>1000,37307=>1000,37308=>1000,37309=>1000,37310=>1000,37311=>1000,37312=>1000,37313=>1000,37314=>1000,37315=>1000,37316=>1000, - 37317=>1000,37318=>1000,37319=>1000,37320=>1000,37321=>1000,37322=>1000,37323=>1000,37324=>1000,37325=>1000,37326=>1000,37327=>1000,37328=>1000,37329=>1000,37330=>1000,37331=>1000,37332=>1000, - 37333=>1000,37334=>1000,37335=>1000,37336=>1000,37337=>1000,37338=>1000,37339=>1000,37340=>1000,37341=>1000,37342=>1000,37343=>1000,37344=>1000,37345=>1000,37346=>1000,37347=>1000,37348=>1000, - 37349=>1000,37350=>1000,37351=>1000,37352=>1000,37353=>1000,37354=>1000,37355=>1000,37356=>1000,37357=>1000,37358=>1000,37359=>1000,37360=>1000,37361=>1000,37362=>1000,37363=>1000,37364=>1000, - 37365=>1000,37366=>1000,37367=>1000,37368=>1000,37369=>1000,37370=>1000,37371=>1000,37372=>1000,37373=>1000,37374=>1000,37375=>1000,37376=>1000,37377=>1000,37378=>1000,37379=>1000,37380=>1000, - 37381=>1000,37382=>1000,37383=>1000,37384=>1000,37385=>1000,37386=>1000,37387=>1000,37388=>1000,37389=>1000,37390=>1000,37391=>1000,37392=>1000,37393=>1000,37394=>1000,37395=>1000,37396=>1000, - 37397=>1000,37398=>1000,37399=>1000,37400=>1000,37401=>1000,37402=>1000,37403=>1000,37404=>1000,37405=>1000,37406=>1000,37407=>1000,37408=>1000,37409=>1000,37410=>1000,37411=>1000,37412=>1000, - 37413=>1000,37414=>1000,37415=>1000,37416=>1000,37417=>1000,37418=>1000,37419=>1000,37420=>1000,37421=>1000,37422=>1000,37423=>1000,37424=>1000,37425=>1000,37426=>1000,37427=>1000,37428=>1000, - 37429=>1000,37430=>1000,37431=>1000,37432=>1000,37433=>1000,37434=>1000,37435=>1000,37436=>1000,37437=>1000,37438=>1000,37439=>1000,37440=>1000,37441=>1000,37442=>1000,37443=>1000,37444=>1000, - 37445=>1000,37446=>1000,37447=>1000,37448=>1000,37449=>1000,37450=>1000,37451=>1000,37452=>1000,37453=>1000,37454=>1000,37455=>1000,37456=>1000,37457=>1000,37458=>1000,37459=>1000,37460=>1000, - 37461=>1000,37462=>1000,37463=>1000,37464=>1000,37465=>1000,37466=>1000,37467=>1000,37468=>1000,37469=>1000,37470=>1000,37471=>1000,37472=>1000,37473=>1000,37474=>1000,37475=>1000,37476=>1000, - 37477=>1000,37478=>1000,37479=>1000,37480=>1000,37481=>1000,37482=>1000,37483=>1000,37484=>1000,37485=>1000,37486=>1000,37487=>1000,37488=>1000,37489=>1000,37490=>1000,37491=>1000,37492=>1000, - 37493=>1000,37494=>1000,37495=>1000,37496=>1000,37497=>1000,37498=>1000,37499=>1000,37500=>1000,37501=>1000,37502=>1000,37503=>1000,37504=>1000,37505=>1000,37506=>1000,37507=>1000,37508=>1000, - 37509=>1000,37510=>1000,37511=>1000,37512=>1000,37513=>1000,37514=>1000,37515=>1000,37516=>1000,37517=>1000,37518=>1000,37519=>1000,37520=>1000,37521=>1000,37522=>1000,37523=>1000,37524=>1000, - 37525=>1000,37526=>1000,37527=>1000,37528=>1000,37529=>1000,37530=>1000,37531=>1000,37532=>1000,37533=>1000,37534=>1000,37535=>1000,37536=>1000,37537=>1000,37538=>1000,37539=>1000,37540=>1000, - 37541=>1000,37542=>1000,37543=>1000,37544=>1000,37545=>1000,37546=>1000,37547=>1000,37548=>1000,37549=>1000,37550=>1000,37551=>1000,37552=>1000,37553=>1000,37554=>1000,37555=>1000,37556=>1000, - 37557=>1000,37558=>1000,37559=>1000,37560=>1000,37561=>1000,37562=>1000,37563=>1000,37564=>1000,37565=>1000,37566=>1000,37567=>1000,37568=>1000,37569=>1000,37570=>1000,37571=>1000,37572=>1000, - 37573=>1000,37574=>1000,37575=>1000,37576=>1000,37577=>1000,37578=>1000,37579=>1000,37580=>1000,37581=>1000,37582=>1000,37583=>1000,37584=>1000,37585=>1000,37586=>1000,37587=>1000,37588=>1000, - 37589=>1000,37590=>1000,37591=>1000,37592=>1000,37593=>1000,37594=>1000,37595=>1000,37596=>1000,37597=>1000,37598=>1000,37599=>1000,37600=>1000,37601=>1000,37602=>1000,37603=>1000,37604=>1000, - 37605=>1000,37606=>1000,37607=>1000,37608=>1000,37609=>1000,37610=>1000,37611=>1000,37612=>1000,37613=>1000,37614=>1000,37615=>1000,37616=>1000,37617=>1000,37618=>1000,37619=>1000,37620=>1000, - 37621=>1000,37622=>1000,37623=>1000,37624=>1000,37625=>1000,37626=>1000,37627=>1000,37628=>1000,37629=>1000,37630=>1000,37631=>1000,37632=>1000,37633=>1000,37634=>1000,37635=>1000,37636=>1000, - 37637=>1000,37638=>1000,37639=>1000,37640=>1000,37641=>1000,37642=>1000,37643=>1000,37644=>1000,37645=>1000,37646=>1000,37647=>1000,37648=>1000,37649=>1000,37650=>1000,37651=>1000,37652=>1000, - 37653=>1000,37654=>1000,37655=>1000,37656=>1000,37657=>1000,37658=>1000,37659=>1000,37660=>1000,37661=>1000,37662=>1000,37663=>1000,37664=>1000,37665=>1000,37666=>1000,37667=>1000,37668=>1000, - 37669=>1000,37670=>1000,37671=>1000,37672=>1000,37673=>1000,37674=>1000,37675=>1000,37676=>1000,37677=>1000,37678=>1000,37679=>1000,37680=>1000,37681=>1000,37682=>1000,37683=>1000,37684=>1000, - 37685=>1000,37686=>1000,37687=>1000,37688=>1000,37689=>1000,37690=>1000,37691=>1000,37692=>1000,37693=>1000,37694=>1000,37695=>1000,37696=>1000,37697=>1000,37698=>1000,37699=>1000,37700=>1000, - 37701=>1000,37702=>1000,37703=>1000,37704=>1000,37705=>1000,37706=>1000,37707=>1000,37708=>1000,37709=>1000,37710=>1000,37711=>1000,37712=>1000,37713=>1000,37714=>1000,37715=>1000,37716=>1000, - 37717=>1000,37718=>1000,37719=>1000,37720=>1000,37721=>1000,37722=>1000,37723=>1000,37724=>1000,37725=>1000,37726=>1000,37727=>1000,37728=>1000,37729=>1000,37730=>1000,37731=>1000,37732=>1000, - 37733=>1000,37734=>1000,37735=>1000,37736=>1000,37737=>1000,37738=>1000,37739=>1000,37740=>1000,37741=>1000,37742=>1000,37743=>1000,37744=>1000,37745=>1000,37746=>1000,37747=>1000,37748=>1000, - 37749=>1000,37750=>1000,37751=>1000,37752=>1000,37753=>1000,37754=>1000,37755=>1000,37756=>1000,37757=>1000,37758=>1000,37759=>1000,37760=>1000,37761=>1000,37762=>1000,37763=>1000,37764=>1000, - 37765=>1000,37766=>1000,37767=>1000,37768=>1000,37769=>1000,37770=>1000,37771=>1000,37772=>1000,37773=>1000,37774=>1000,37775=>1000,37776=>1000,37777=>1000,37778=>1000,37779=>1000,37780=>1000, - 37781=>1000,37782=>1000,37783=>1000,37784=>1000,37785=>1000,37786=>1000,37787=>1000,37788=>1000,37789=>1000,37790=>1000,37791=>1000,37792=>1000,37793=>1000,37794=>1000,37795=>1000,37796=>1000, - 37797=>1000,37798=>1000,37799=>1000,37800=>1000,37801=>1000,37802=>1000,37803=>1000,37804=>1000,37805=>1000,37806=>1000,37807=>1000,37808=>1000,37809=>1000,37810=>1000,37811=>1000,37812=>1000, - 37813=>1000,37814=>1000,37815=>1000,37816=>1000,37817=>1000,37818=>1000,37819=>1000,37820=>1000,37821=>1000,37822=>1000,37823=>1000,37824=>1000,37825=>1000,37826=>1000,37827=>1000,37828=>1000, - 37829=>1000,37830=>1000,37831=>1000,37832=>1000,37833=>1000,37834=>1000,37835=>1000,37836=>1000,37837=>1000,37838=>1000,37839=>1000,37840=>1000,37841=>1000,37842=>1000,37843=>1000,37844=>1000, - 37845=>1000,37846=>1000,37847=>1000,37848=>1000,37849=>1000,37850=>1000,37851=>1000,37852=>1000,37853=>1000,37854=>1000,37855=>1000,37856=>1000,37857=>1000,37858=>1000,37859=>1000,37860=>1000, - 37861=>1000,37862=>1000,37863=>1000,37864=>1000,37865=>1000,37866=>1000,37867=>1000,37868=>1000,37869=>1000,37870=>1000,37871=>1000,37872=>1000,37873=>1000,37874=>1000,37875=>1000,37876=>1000, - 37877=>1000,37878=>1000,37879=>1000,37880=>1000,37881=>1000,37882=>1000,37883=>1000,37884=>1000,37885=>1000,37886=>1000,37887=>1000,37888=>1000,37889=>1000,37890=>1000,37891=>1000,37892=>1000, - 37893=>1000,37894=>1000,37895=>1000,37896=>1000,37897=>1000,37898=>1000,37899=>1000,37900=>1000,37901=>1000,37902=>1000,37903=>1000,37904=>1000,37905=>1000,37906=>1000,37907=>1000,37908=>1000, - 37909=>1000,37910=>1000,37911=>1000,37912=>1000,37913=>1000,37914=>1000,37915=>1000,37916=>1000,37917=>1000,37918=>1000,37919=>1000,37920=>1000,37921=>1000,37922=>1000,37923=>1000,37924=>1000, - 37925=>1000,37926=>1000,37927=>998,37928=>1000,37929=>1000,37930=>1000,37931=>1000,37932=>1000,37933=>1000,37934=>1000,37935=>1000,37936=>1000,37937=>1000,37938=>1000,37939=>1000,37940=>1000, - 37941=>1000,37942=>1000,37943=>1000,37944=>1000,37945=>1000,37946=>1000,37947=>1000,37948=>1000,37949=>1000,37950=>1000,37951=>1000,37952=>1000,37953=>1000,37954=>1000,37955=>1000,37956=>1000, - 37957=>1000,37958=>1000,37959=>1000,37960=>1000,37961=>1000,37962=>1000,37963=>1000,37964=>1000,37965=>1000,37966=>1000,37967=>1000,37968=>1000,37969=>1000,37970=>1000,37971=>1000,37972=>1000, - 37973=>1000,37974=>1000,37975=>1000,37976=>1000,37977=>1000,37978=>1000,37979=>1000,37980=>1000,37981=>1000,37982=>1000,37983=>1000,37984=>1000,37985=>1000,37986=>1000,37987=>1000,37988=>1000, - 37989=>1000,37990=>1000,37991=>1000,37992=>1000,37993=>1000,37994=>1000,37995=>1000,37996=>1000,37997=>1000,37998=>1000,37999=>1000,38000=>1000,38001=>1000,38002=>1000,38003=>1000,38004=>1000, - 38005=>1000,38006=>1000,38007=>1000,38008=>1000,38009=>1000,38010=>1000,38011=>1000,38012=>1000,38013=>1000,38014=>1000,38015=>1000,38016=>1000,38017=>1000,38018=>1000,38019=>1000,38020=>1000, - 38021=>1000,38022=>1000,38023=>1000,38024=>1000,38025=>1000,38026=>1000,38027=>1000,38028=>1000,38029=>1000,38030=>1000,38031=>1000,38032=>1000,38033=>1000,38034=>1000,38035=>1000,38036=>1000, - 38037=>1000,38038=>1000,38039=>1000,38040=>1000,38041=>1000,38042=>1000,38043=>1000,38044=>1000,38045=>1000,38046=>1000,38047=>1000,38048=>1000,38049=>1000,38050=>1000,38051=>1000,38052=>1000, - 38053=>1000,38054=>1000,38055=>1000,38056=>1000,38057=>1000,38058=>1000,38059=>1000,38060=>1000,38061=>1000,38062=>1000,38063=>1000,38064=>1000,38065=>1000,38066=>1000,38067=>1000,38068=>1000, - 38069=>1000,38070=>1000,38071=>1000,38072=>1000,38073=>1000,38074=>1000,38075=>1000,38076=>1000,38077=>1000,38078=>1000,38079=>1000,38080=>1000,38081=>1000,38082=>1000,38083=>1000,38084=>1000, - 38085=>1000,38086=>1000,38087=>1000,38088=>1000,38089=>1000,38090=>1000,38091=>1000,38092=>1000,38093=>1000,38094=>1000,38095=>1000,38096=>1000,38097=>1000,38098=>1000,38099=>1000,38100=>1000, - 38101=>1000,38102=>1000,38103=>1000,38104=>1000,38105=>1000,38106=>1000,38107=>1000,38108=>1000,38109=>1000,38110=>1000,38111=>1000,38112=>1000,38113=>1000,38114=>1000,38115=>1000,38116=>1000, - 38117=>1000,38118=>1000,38119=>1000,38120=>1000,38121=>1000,38122=>1000,38123=>1000,38124=>1000,38125=>1000,38126=>1000,38127=>1000,38128=>1000,38129=>1000,38130=>1000,38131=>1000,38132=>1000, - 38133=>1000,38134=>1000,38135=>1000,38136=>1000,38137=>1000,38138=>1000,38139=>1000,38140=>1000,38141=>1000,38142=>1000,38143=>1000,38144=>1000,38145=>1000,38146=>1000,38147=>1000,38148=>1000, - 38149=>1000,38150=>1000,38151=>1000,38152=>1000,38153=>1000,38154=>1000,38155=>1000,38156=>1000,38157=>1000,38158=>1000,38159=>1000,38160=>1000,38161=>1000,38162=>1000,38163=>1000,38164=>1000, - 38165=>1000,38166=>1000,38167=>1000,38168=>1000,38169=>1000,38170=>1000,38171=>1000,38172=>1000,38173=>1000,38174=>1000,38175=>1000,38176=>1000,38177=>1000,38178=>1000,38179=>1000,38180=>1000, - 38181=>1000,38182=>1000,38183=>1000,38184=>1000,38185=>1000,38186=>1000,38187=>1000,38188=>1000,38189=>1000,38190=>1000,38191=>1000,38192=>1000,38193=>1000,38194=>1000,38195=>1000,38196=>1000, - 38197=>1000,38198=>1000,38199=>1000,38200=>1000,38201=>1000,38202=>1000,38203=>1000,38204=>1000,38205=>1000,38206=>1000,38207=>1000,38208=>1000,38209=>1000,38210=>1000,38211=>1000,38212=>1000, - 38213=>1000,38214=>1000,38215=>1000,38216=>1000,38217=>1000,38218=>1000,38219=>1000,38220=>1000,38221=>1000,38222=>1000,38223=>1000,38224=>1000,38225=>1000,38226=>1000,38227=>1000,38228=>1000, - 38229=>1000,38230=>1000,38231=>1000,38232=>1000,38233=>1000,38234=>1000,38235=>1000,38236=>1000,38237=>1000,38238=>1000,38239=>1000,38240=>1000,38241=>1000,38242=>1000,38243=>1000,38244=>1000, - 38245=>1000,38246=>1000,38247=>1000,38248=>1000,38249=>1000,38250=>1000,38251=>1000,38252=>1000,38253=>1000,38254=>1000,38255=>1000,38256=>1000,38257=>1000,38258=>1000,38259=>1000,38260=>1000, - 38261=>1000,38262=>1000,38263=>1000,38264=>1000,38265=>1000,38266=>1000,38267=>1000,38268=>1000,38269=>1000,38270=>1000,38271=>1000,38272=>1000,38273=>1000,38274=>1000,38275=>1000,38276=>1000, - 38277=>1000,38278=>1000,38279=>1000,38280=>1000,38281=>1000,38282=>1000,38283=>1000,38284=>1000,38285=>1000,38286=>1000,38287=>1000,38288=>1000,38289=>1000,38290=>1000,38291=>1000,38292=>1000, - 38293=>1000,38294=>1000,38295=>1000,38296=>1000,38297=>1000,38298=>1000,38299=>1000,38300=>1000,38301=>1000,38302=>1000,38303=>1000,38304=>1000,38305=>1000,38306=>1000,38307=>1000,38308=>1000, - 38309=>1000,38310=>1000,38311=>1000,38312=>1000,38313=>1000,38314=>1000,38315=>1000,38316=>1000,38317=>1000,38318=>1000,38319=>1000,38320=>1000,38321=>1000,38322=>1000,38323=>1000,38324=>1000, - 38325=>1000,38326=>1000,38327=>1000,38328=>1000,38329=>1000,38330=>1000,38331=>1000,38332=>1000,38333=>1000,38334=>1000,38335=>1000,38336=>1000,38337=>1000,38338=>1000,38339=>1000,38340=>1000, - 38341=>1000,38342=>1000,38343=>1000,38344=>1000,38345=>1000,38346=>1000,38347=>1000,38348=>1000,38349=>1000,38350=>1000,38351=>1000,38352=>1000,38353=>1000,38354=>1000,38355=>1000,38356=>1000, - 38357=>1000,38358=>1000,38359=>1000,38360=>1000,38361=>1000,38362=>1000,38363=>1000,38364=>1000,38365=>1000,38366=>1000,38367=>1000,38368=>1000,38369=>1000,38370=>1000,38371=>1000,38372=>1000, - 38373=>1000,38374=>1000,38375=>1000,38376=>1000,38377=>1000,38378=>1000,38379=>1000,38380=>1000,38381=>1000,38382=>1000,38383=>1000,38384=>1000,38385=>1000,38386=>1000,38387=>1000,38388=>1000, - 38389=>1000,38390=>1000,38391=>1000,38392=>1000,38393=>1000,38394=>1000,38395=>1000,38396=>1000,38397=>1000,38398=>1000,38399=>1000,38400=>1000,38401=>1000,38402=>1000,38403=>1000,38404=>1000, - 38405=>1000,38406=>1000,38407=>1000,38408=>1000,38409=>1000,38410=>1000,38411=>1000,38412=>1000,38413=>1000,38414=>1000,38415=>1000,38416=>1000,38417=>1000,38418=>1000,38419=>1000,38420=>1000, - 38421=>1000,38422=>1000,38423=>1000,38424=>1000,38425=>1000,38426=>1000,38427=>1000,38428=>1000,38429=>1000,38430=>1000,38431=>1000,38432=>1000,38433=>1000,38434=>1000,38435=>1000,38436=>1000, - 38437=>1000,38438=>1000,38439=>1000,38440=>1000,38441=>1000,38442=>1000,38443=>1000,38444=>1000,38445=>1000,38446=>1000,38447=>1000,38448=>1000,38449=>1000,38450=>1000,38451=>1000,38452=>1000, - 38453=>1000,38454=>1000,38455=>1000,38456=>1000,38457=>1000,38458=>1000,38459=>1000,38460=>1000,38461=>1000,38462=>1000,38463=>1000,38464=>1000,38465=>1000,38466=>1000,38467=>1000,38468=>1000, - 38469=>1000,38470=>1000,38471=>1000,38472=>1000,38473=>1000,38474=>1000,38475=>1000,38476=>1000,38477=>1000,38478=>1000,38479=>1000,38480=>1000,38481=>1000,38482=>1000,38483=>1000,38484=>1000, - 38485=>1000,38486=>1000,38487=>1000,38488=>1000,38489=>1000,38490=>1000,38491=>1000,38492=>1000,38493=>1000,38494=>1000,38495=>1000,38496=>1000,38497=>1000,38498=>1000,38499=>1000,38500=>1000, - 38501=>1000,38502=>1000,38503=>1000,38504=>1000,38505=>1000,38506=>1000,38507=>1000,38508=>1000,38509=>1000,38510=>1000,38511=>1000,38512=>1000,38513=>1000,38514=>1000,38515=>1000,38516=>1000, - 38517=>1000,38518=>1000,38519=>1000,38520=>1000,38521=>1000,38522=>1000,38523=>1000,38524=>1000,38525=>1000,38526=>1000,38527=>1000,38528=>1000,38529=>1000,38530=>1000,38531=>1000,38532=>1000, - 38533=>1000,38534=>1000,38535=>1000,38536=>1000,38537=>1000,38538=>1000,38539=>1000,38540=>1000,38541=>1000,38542=>1000,38543=>1000,38544=>1000,38545=>1000,38546=>1000,38547=>1000,38548=>1000, - 38549=>1000,38550=>1000,38551=>1000,38552=>1000,38553=>1000,38554=>1000,38555=>1000,38556=>1000,38557=>1000,38558=>1000,38559=>1000,38560=>1000,38561=>1000,38562=>1000,38563=>1000,38564=>1000, - 38565=>1000,38566=>1000,38567=>1000,38568=>1000,38569=>1000,38570=>1000,38571=>1000,38572=>1000,38573=>1000,38574=>1000,38575=>1000,38576=>1000,38577=>1000,38578=>1000,38579=>1000,38580=>1000, - 38581=>1000,38582=>1000,38583=>1000,38584=>1000,38585=>1000,38586=>1000,38587=>1000,38588=>1000,38589=>1000,38590=>1000,38591=>1000,38592=>1000,38593=>1000,38594=>1000,38595=>1000,38596=>1000, - 38597=>1000,38598=>1000,38599=>1000,38600=>1000,38601=>1000,38602=>1000,38603=>1000,38604=>1000,38605=>1000,38606=>1000,38607=>1000,38608=>1000,38609=>1000,38610=>1000,38611=>1000,38612=>1000, - 38613=>1000,38614=>1000,38615=>1000,38616=>1000,38617=>1000,38618=>1000,38619=>1000,38620=>1000,38621=>1000,38622=>1000,38623=>1000,38624=>1000,38625=>1000,38626=>1000,38627=>1000,38628=>1000, - 38629=>1000,38630=>1000,38631=>1000,38632=>1000,38633=>1000,38634=>1000,38635=>1000,38636=>1000,38637=>1000,38638=>1000,38639=>1000,38640=>1000,38641=>1000,38642=>1000,38643=>1000,38644=>1000, - 38645=>1000,38646=>1000,38647=>1000,38648=>1000,38649=>1000,38650=>1000,38651=>1000,38652=>1000,38653=>1000,38654=>1000,38655=>1000,38656=>1000,38657=>1000,38658=>1000,38659=>1000,38660=>1000, - 38661=>1000,38662=>1000,38663=>1000,38664=>1000,38665=>1000,38666=>1000,38667=>1000,38668=>1000,38669=>1000,38670=>1000,38671=>1000,38672=>1000,38673=>1000,38674=>1000,38675=>1000,38676=>1000, - 38677=>1000,38678=>1000,38679=>1000,38680=>1000,38681=>1000,38682=>1000,38683=>1000,38684=>1000,38685=>1000,38686=>1000,38687=>1000,38688=>1000,38689=>1000,38690=>1000,38691=>1000,38692=>1000, - 38693=>1000,38694=>1000,38695=>1000,38696=>1000,38697=>1000,38698=>1000,38699=>1000,38700=>1000,38701=>1000,38702=>1000,38703=>1000,38704=>1000,38705=>1000,38706=>1000,38707=>1000,38708=>1000, - 38709=>1000,38710=>1000,38711=>1000,38712=>1000,38713=>1000,38714=>1000,38715=>1000,38716=>1000,38717=>1000,38718=>1000,38719=>1000,38720=>1000,38721=>1000,38722=>1000,38723=>1000,38724=>1000, - 38725=>1000,38726=>1000,38727=>1000,38728=>1000,38729=>1000,38730=>1000,38731=>1000,38732=>1000,38733=>1000,38734=>1000,38735=>1000,38736=>1000,38737=>1000,38738=>1000,38739=>1000,38740=>1000, - 38741=>1000,38742=>1000,38743=>1000,38744=>1000,38745=>1000,38746=>1000,38747=>1000,38748=>1000,38749=>1000,38750=>1000,38751=>1000,38752=>1000,38753=>1000,38754=>1000,38755=>1000,38756=>1000, - 38757=>1000,38758=>1000,38759=>1000,38760=>1000,38761=>1000,38762=>1000,38763=>1000,38764=>1000,38765=>1000,38766=>1000,38767=>1000,38768=>1000,38769=>1000,38770=>1000,38771=>1000,38772=>1000, - 38773=>1000,38774=>1000,38775=>1000,38776=>1000,38777=>1000,38778=>1000,38779=>1000,38780=>1000,38781=>1000,38782=>1000,38783=>1000,38784=>1000,38785=>1000,38786=>1000,38787=>1000,38788=>1000, - 38789=>1000,38790=>1000,38791=>1000,38792=>1000,38793=>1000,38794=>1000,38795=>1000,38796=>1000,38797=>1000,38798=>1000,38799=>1000,38800=>1000,38801=>1000,38802=>1000,38803=>1000,38804=>1000, - 38805=>1000,38806=>1000,38807=>1000,38808=>1000,38809=>1000,38810=>1000,38811=>1000,38812=>1000,38813=>1000,38814=>1000,38815=>1000,38816=>1000,38817=>1000,38818=>1000,38819=>1000,38820=>1000, - 38821=>1000,38822=>1000,38823=>1000,38824=>1000,38825=>1000,38826=>1000,38827=>1000,38828=>1000,38829=>1000,38830=>1000,38831=>1000,38832=>1000,38833=>1000,38834=>1000,38835=>1000,38836=>1000, - 38837=>1000,38838=>1000,38839=>1000,38840=>1000,38841=>1000,38842=>1000,38843=>1000,38844=>1000,38845=>1000,38846=>1000,38847=>1000,38848=>1000,38849=>1000,38850=>1000,38851=>1000,38852=>1000, - 38853=>1000,38854=>1000,38855=>1000,38856=>1000,38857=>1000,38858=>1000,38859=>1000,38860=>1000,38861=>1000,38862=>1000,38863=>1000,38864=>1000,38865=>1000,38866=>1000,38867=>1000,38868=>1000, - 38869=>1000,38870=>1000,38871=>1000,38872=>1000,38873=>1000,38874=>1000,38875=>1000,38876=>1000,38877=>1000,38878=>1000,38879=>1000,38880=>1000,38881=>1000,38882=>1000,38883=>1000,38884=>1000, - 38885=>1000,38886=>1000,38887=>1000,38888=>1000,38889=>1000,38890=>1000,38891=>1000,38892=>1000,38893=>1000,38894=>1000,38895=>1000,38896=>1000,38897=>1000,38898=>1000,38899=>1000,38900=>1000, - 38901=>1000,38902=>1000,38903=>1000,38904=>1000,38905=>1000,38906=>1000,38907=>1000,38908=>1000,38909=>1000,38910=>1000,38911=>1000,38912=>1000,38913=>1000,38914=>1000,38915=>1000,38916=>1000, - 38917=>1000,38918=>1000,38919=>1000,38920=>1000,38921=>1000,38922=>1000,38923=>1000,38924=>1000,38925=>1000,38926=>1000,38927=>1000,38928=>1000,38929=>1000,38930=>1000,38931=>1000,38932=>1000, - 38933=>1000,38934=>1000,38935=>1000,38936=>1000,38937=>1000,38938=>1000,38939=>1000,38940=>1000,38941=>1000,38942=>1000,38943=>1000,38944=>1000,38945=>1000,38946=>1000,38947=>1000,38948=>1000, - 38949=>1000,38950=>1000,38951=>1000,38952=>1000,38953=>1000,38954=>1000,38955=>1000,38956=>1000,38957=>1000,38958=>1000,38959=>1000,38960=>1000,38961=>1000,38962=>1000,38963=>1000,38964=>1000, - 38965=>1000,38966=>1000,38967=>1000,38968=>1000,38969=>1000,38970=>1000,38971=>1000,38972=>1000,38973=>1000,38974=>1000,38975=>1000,38976=>1000,38977=>1000,38978=>1000,38979=>1000,38980=>1000, - 38981=>1000,38982=>1000,38983=>1000,38984=>1000,38985=>1000,38986=>1000,38987=>1000,38988=>1000,38989=>1000,38990=>1000,38991=>1000,38992=>1000,38993=>1000,38994=>1000,38995=>1000,38996=>1000, - 38997=>1000,38998=>1000,38999=>1000,39000=>1000,39001=>1000,39002=>1000,39003=>1000,39004=>1000,39005=>1000,39006=>1000,39007=>1000,39008=>1000,39009=>1000,39010=>1000,39011=>1000,39012=>1000, - 39013=>1000,39014=>1000,39015=>1000,39016=>1000,39017=>1000,39018=>1000,39019=>1000,39020=>1000,39021=>1000,39022=>1000,39023=>1000,39024=>1000,39025=>1000,39026=>1000,39027=>1000,39028=>1000, - 39029=>1000,39030=>1000,39031=>1000,39032=>1000,39033=>1000,39034=>1000,39035=>1000,39036=>1000,39037=>1000,39038=>1000,39039=>1000,39040=>1000,39041=>1000,39042=>1000,39043=>1000,39044=>1000, - 39045=>1000,39046=>1000,39047=>1000,39048=>1000,39049=>1000,39050=>1000,39051=>1000,39052=>1000,39053=>1000,39054=>1000,39055=>1000,39056=>1000,39057=>1000,39058=>1000,39059=>1000,39060=>1000, - 39061=>1000,39062=>1000,39063=>1000,39064=>1000,39065=>1000,39066=>1000,39067=>1000,39068=>1000,39069=>1000,39070=>1000,39071=>1000,39072=>1000,39073=>1000,39074=>1000,39075=>1000,39076=>1000, - 39077=>1000,39078=>1000,39079=>1000,39080=>1000,39081=>1000,39082=>1000,39083=>1000,39084=>1000,39085=>1000,39086=>1000,39087=>1000,39088=>1000,39089=>1000,39090=>1000,39091=>1000,39092=>1000, - 39093=>1000,39094=>1000,39095=>1000,39096=>1000,39097=>1000,39098=>1000,39099=>1000,39100=>1000,39101=>1000,39102=>1000,39103=>1000,39104=>1000,39105=>1000,39106=>1000,39107=>1000,39108=>1000, - 39109=>1000,39110=>1000,39111=>1000,39112=>1000,39113=>1000,39114=>1000,39115=>1000,39116=>1000,39117=>1000,39118=>1000,39119=>1000,39120=>1000,39121=>1000,39122=>1000,39123=>1000,39124=>1000, - 39125=>1000,39126=>1000,39127=>1000,39128=>1000,39129=>1000,39130=>1000,39131=>1000,39132=>1000,39133=>1000,39134=>1000,39135=>1000,39136=>1000,39137=>1000,39138=>1000,39139=>1000,39140=>1000, - 39141=>1000,39142=>1000,39143=>1000,39144=>1000,39145=>1000,39146=>1000,39147=>1000,39148=>1000,39149=>1000,39150=>1000,39151=>1000,39152=>1000,39153=>1000,39154=>1000,39155=>1000,39156=>1000, - 39157=>1000,39158=>1000,39159=>1000,39160=>1000,39161=>1000,39162=>1000,39163=>1000,39164=>1000,39165=>1000,39166=>1000,39167=>1000,39168=>1000,39169=>1000,39170=>1000,39171=>1000,39172=>1000, - 39173=>1000,39174=>1000,39175=>1000,39176=>1000,39177=>1000,39178=>1000,39179=>1000,39180=>1000,39181=>1000,39182=>1000,39183=>1000,39184=>1000,39185=>1000,39186=>1000,39187=>1000,39188=>1000, - 39189=>1000,39190=>1000,39191=>1000,39192=>1000,39193=>1000,39194=>1000,39195=>1000,39196=>1000,39197=>1000,39198=>1000,39199=>1000,39200=>1000,39201=>1000,39202=>1000,39203=>1000,39204=>1000, - 39205=>1000,39206=>1000,39207=>1000,39208=>1000,39209=>1000,39210=>1000,39211=>1000,39212=>1000,39213=>1000,39214=>1000,39215=>1000,39216=>1000,39217=>1000,39218=>1000,39219=>1000,39220=>1000, - 39221=>1000,39222=>1000,39223=>1000,39224=>1000,39225=>1000,39226=>1000,39227=>1000,39228=>1000,39229=>1000,39230=>1000,39231=>1000,39232=>1000,39233=>1000,39234=>1000,39235=>1000,39236=>1000, - 39237=>1000,39238=>1000,39239=>1000,39240=>1000,39241=>1000,39242=>1000,39243=>1000,39244=>1000,39245=>1000,39246=>1000,39247=>1000,39248=>1000,39249=>1000,39250=>1000,39251=>1000,39252=>1000, - 39253=>1000,39254=>1000,39255=>1000,39256=>1000,39257=>1000,39258=>1000,39259=>1000,39260=>1000,39261=>1000,39262=>1000,39263=>1000,39264=>1000,39265=>1000,39266=>1000,39267=>1000,39268=>1000, - 39269=>1000,39270=>1000,39271=>1000,39272=>1000,39273=>1000,39274=>1000,39275=>1000,39276=>1000,39277=>1000,39278=>1000,39279=>1000,39280=>1000,39281=>1000,39282=>1000,39283=>1000,39284=>1000, - 39285=>1000,39286=>1000,39287=>1000,39288=>1000,39289=>1000,39290=>1000,39291=>1000,39292=>1000,39293=>1000,39294=>1000,39295=>1000,39296=>1000,39297=>1000,39298=>1000,39299=>1000,39300=>1000, - 39301=>1000,39302=>1000,39303=>1000,39304=>1000,39305=>1000,39306=>1000,39307=>1000,39308=>1000,39309=>1000,39310=>1000,39311=>1000,39312=>1000,39313=>1000,39314=>1000,39315=>1000,39316=>1000, - 39317=>1000,39318=>1000,39319=>1000,39320=>1000,39321=>1000,39322=>1000,39323=>1000,39324=>1000,39325=>1000,39326=>1000,39327=>1000,39328=>1000,39329=>1000,39330=>1000,39331=>1000,39332=>1000, - 39333=>1000,39334=>1000,39335=>1000,39336=>1000,39337=>1000,39338=>1000,39339=>1000,39340=>1000,39341=>1000,39342=>1000,39343=>1000,39344=>1000,39345=>1000,39346=>1000,39347=>1000,39348=>1000, - 39349=>1000,39350=>1000,39351=>1000,39352=>1000,39353=>1000,39354=>1000,39355=>1000,39356=>1000,39357=>1000,39358=>1000,39359=>1000,39360=>1000,39361=>1000,39362=>1000,39363=>1000,39364=>1000, - 39365=>1000,39366=>1000,39367=>1000,39368=>1000,39369=>1000,39370=>1000,39371=>1000,39372=>1000,39373=>1000,39374=>1000,39375=>1000,39376=>1000,39377=>1000,39378=>1000,39379=>1000,39380=>1000, - 39381=>1000,39382=>1000,39383=>1000,39384=>1000,39385=>1000,39386=>1000,39387=>1000,39388=>1000,39389=>1000,39390=>1000,39391=>1000,39392=>1000,39393=>1000,39394=>1000,39395=>1000,39396=>1000, - 39397=>1000,39398=>1000,39399=>1000,39400=>1000,39401=>1000,39402=>1000,39403=>1000,39404=>1000,39405=>1000,39406=>1000,39407=>1000,39408=>1000,39409=>1000,39410=>1000,39411=>1000,39412=>1000, - 39413=>1000,39414=>1000,39415=>1000,39416=>1000,39417=>1000,39418=>1000,39419=>1000,39420=>1000,39421=>1000,39422=>1000,39423=>1000,39424=>1000,39425=>1000,39426=>1000,39427=>1000,39428=>1000, - 39429=>1000,39430=>1000,39431=>1000,39432=>1000,39433=>1000,39434=>1000,39435=>1000,39436=>1000,39437=>1000,39438=>1000,39439=>1000,39440=>1000,39441=>1000,39442=>1000,39443=>1000,39444=>1000, - 39445=>1000,39446=>1000,39447=>1000,39448=>1000,39449=>1000,39450=>1000,39451=>1000,39452=>1000,39453=>1000,39454=>1000,39455=>1000,39456=>1000,39457=>1000,39458=>1000,39459=>1000,39460=>1000, - 39461=>1000,39462=>1000,39463=>1000,39464=>1000,39465=>1000,39466=>1000,39467=>1000,39468=>1000,39469=>1000,39470=>1000,39471=>1000,39472=>1000,39473=>1000,39474=>1000,39475=>1000,39476=>1000, - 39477=>1000,39478=>1000,39479=>1000,39480=>1000,39481=>1000,39482=>1000,39483=>1000,39484=>1000,39485=>1000,39486=>1000,39487=>1000,39488=>1000,39489=>1000,39490=>1000,39491=>1000,39492=>1000, - 39493=>1000,39494=>1000,39495=>1000,39496=>1000,39497=>1000,39498=>1000,39499=>1000,39500=>1000,39501=>1000,39502=>1000,39503=>1000,39504=>1000,39505=>1000,39506=>1000,39507=>1000,39508=>1000, - 39509=>1000,39510=>1000,39511=>1000,39512=>1000,39513=>1000,39514=>1000,39515=>1000,39516=>1000,39517=>1000,39518=>1000,39519=>1000,39520=>1000,39521=>1000,39522=>1000,39523=>1000,39524=>1000, - 39525=>1000,39526=>1000,39527=>1000,39528=>1000,39529=>1000,39530=>1000,39531=>1000,39532=>1000,39533=>1000,39534=>1000,39535=>1000,39536=>1000,39537=>1000,39538=>1000,39539=>1000,39540=>1000, - 39541=>1000,39542=>1000,39543=>1000,39544=>1000,39545=>1000,39546=>1000,39547=>1000,39548=>1000,39549=>1000,39550=>1000,39551=>1000,39552=>1000,39553=>1000,39554=>1000,39555=>1000,39556=>1000, - 39557=>1000,39558=>1000,39559=>1000,39560=>1000,39561=>1000,39562=>1000,39563=>1000,39564=>1000,39565=>1000,39566=>1000,39567=>1000,39568=>1000,39569=>1000,39570=>1000,39571=>1000,39572=>1000, - 39573=>1000,39574=>1000,39575=>1000,39576=>1000,39577=>1000,39578=>1000,39579=>1000,39580=>1000,39581=>1000,39582=>1000,39583=>1000,39584=>1000,39585=>1000,39586=>1000,39587=>1000,39588=>1000, - 39589=>1000,39590=>1000,39591=>1000,39592=>1000,39593=>1000,39594=>1000,39595=>1000,39596=>1000,39597=>1000,39598=>1000,39599=>1000,39600=>1000,39601=>1000,39602=>1000,39603=>1000,39604=>1000, - 39605=>1000,39606=>1000,39607=>1000,39608=>1000,39609=>1000,39610=>1000,39611=>1000,39612=>1000,39613=>1000,39614=>1000,39615=>1000,39616=>1000,39617=>1000,39618=>1000,39619=>1000,39620=>1000, - 39621=>1000,39622=>1000,39623=>1000,39624=>1000,39625=>1000,39626=>1000,39627=>1000,39628=>1000,39629=>1000,39630=>1000,39631=>1000,39632=>1000,39633=>1000,39634=>1000,39635=>1000,39636=>1000, - 39637=>1000,39638=>1000,39639=>1000,39640=>1000,39641=>1000,39642=>1000,39643=>1000,39644=>1000,39645=>1000,39646=>1000,39647=>1000,39648=>1000,39649=>1000,39650=>1000,39651=>1000,39652=>1000, - 39653=>1000,39654=>1000,39655=>1000,39656=>1000,39657=>1000,39658=>1000,39659=>1000,39660=>1000,39661=>1000,39662=>1000,39663=>1000,39664=>1000,39665=>1000,39666=>1000,39667=>1000,39668=>1000, - 39669=>1000,39670=>1000,39671=>1000,39672=>1000,39673=>1000,39674=>1000,39675=>1000,39676=>1000,39677=>1000,39678=>1000,39679=>1000,39680=>1000,39681=>1000,39682=>1000,39683=>1000,39684=>1000, - 39685=>1000,39686=>1000,39687=>1000,39688=>1000,39689=>1000,39690=>1000,39691=>1000,39692=>1000,39693=>1000,39694=>1000,39695=>1000,39696=>1000,39697=>1000,39698=>1000,39699=>1000,39700=>1000, - 39701=>1000,39702=>1000,39703=>1000,39704=>1000,39705=>1000,39706=>1000,39707=>1000,39708=>1000,39709=>1000,39710=>1000,39711=>1000,39712=>1000,39713=>1000,39714=>1000,39715=>1000,39716=>1000, - 39717=>1000,39718=>1000,39719=>1000,39720=>1000,39721=>1000,39722=>1000,39723=>1000,39724=>1000,39725=>1000,39726=>1000,39727=>1000,39728=>1000,39729=>1000,39730=>1000,39731=>1000,39732=>1000, - 39733=>1000,39734=>1000,39735=>1000,39736=>1000,39737=>1000,39738=>1000,39739=>1000,39740=>1000,39741=>1000,39742=>1000,39743=>1000,39744=>1000,39745=>1000,39746=>1000,39747=>1000,39748=>1000, - 39749=>1000,39750=>1000,39751=>1000,39752=>1000,39753=>1000,39754=>1000,39755=>1000,39756=>1000,39757=>1000,39758=>1000,39759=>1000,39760=>1000,39761=>1000,39762=>1000,39763=>1000,39764=>1000, - 39765=>1000,39766=>1000,39767=>1000,39768=>1000,39769=>1000,39770=>1000,39771=>1000,39772=>1000,39773=>1000,39774=>1000,39775=>1000,39776=>1000,39777=>1000,39778=>1000,39779=>1000,39780=>1000, - 39781=>1000,39782=>1000,39783=>1000,39784=>1000,39785=>1000,39786=>1000,39787=>1000,39788=>1000,39789=>1000,39790=>1000,39791=>1000,39792=>1000,39793=>1000,39794=>1000,39795=>1000,39796=>1000, - 39797=>1000,39798=>1000,39799=>1000,39800=>1000,39801=>1000,39802=>1000,39803=>1000,39804=>1000,39805=>1000,39806=>1000,39807=>1000,39808=>1000,39809=>1000,39810=>1000,39811=>1000,39812=>1000, - 39813=>1000,39814=>1000,39815=>1000,39816=>1000,39817=>1000,39818=>1000,39819=>1000,39820=>1000,39821=>1000,39822=>1000,39823=>1000,39824=>1000,39825=>1000,39826=>1000,39827=>1000,39828=>1000, - 39829=>1000,39830=>1000,39831=>1000,39832=>1000,39833=>1000,39834=>1000,39835=>1000,39836=>1000,39837=>1000,39838=>1000,39839=>1000,39840=>1000,39841=>1000,39842=>1000,39843=>1000,39844=>1000, - 39845=>1000,39846=>1000,39847=>1000,39848=>1000,39849=>1000,39850=>1000,39851=>1000,39852=>1000,39853=>1000,39854=>1000,39855=>1000,39856=>1000,39857=>1000,39858=>1000,39859=>1000,39860=>1000, - 39861=>1000,39862=>1000,39863=>1000,39864=>1000,39865=>1000,39866=>1000,39867=>1000,39868=>1000,39869=>1000,39870=>1000,39871=>1000,39872=>1000,39873=>1000,39874=>1000,39875=>1000,39876=>1000, - 39877=>1000,39878=>1000,39879=>1000,39880=>1000,39881=>1000,39882=>1000,39883=>1000,39884=>1000,39885=>1000,39886=>1000,39887=>1000,39888=>1000,39889=>1000,39890=>1000,39891=>1000,39892=>1000, - 39893=>1000,39894=>1000,39895=>1000,39896=>1000,39897=>1000,39898=>1000,39899=>1000,39900=>1000,39901=>1000,39902=>1000,39903=>1000,39904=>1000,39905=>1000,39906=>1000,39907=>1000,39908=>1000, - 39909=>1000,39910=>1000,39911=>1000,39912=>1000,39913=>1000,39914=>1000,39915=>1000,39916=>1000,39917=>1000,39918=>1000,39919=>1000,39920=>1000,39921=>1000,39922=>1000,39923=>1000,39924=>1000, - 39925=>1000,39926=>1000,39927=>1000,39928=>1000,39929=>1000,39930=>1000,39931=>1000,39932=>1000,39933=>1000,39934=>1000,39935=>1000,39936=>1000,39937=>1000,39938=>1000,39939=>1000,39940=>1000, - 39941=>1000,39942=>1000,39943=>1000,39944=>1000,39945=>1000,39946=>1000,39947=>1000,39948=>1000,39949=>1000,39950=>1000,39951=>1000,39952=>1000,39953=>1000,39954=>1000,39955=>1000,39956=>1000, - 39957=>1000,39958=>1000,39959=>1000,39960=>1000,39961=>1000,39962=>1000,39963=>1000,39964=>1000,39965=>1000,39966=>1000,39967=>1000,39968=>1000,39969=>1000,39970=>1000,39971=>1000,39972=>1000, - 39973=>1000,39974=>1000,39975=>1000,39976=>1000,39977=>1000,39978=>1000,39979=>1000,39980=>1000,39981=>1000,39982=>1000,39983=>1000,39984=>1000,39985=>1000,39986=>1000,39987=>1000,39988=>1000, - 39989=>1000,39990=>1000,39991=>1000,39992=>1000,39993=>1000,39994=>1000,39995=>1000,39996=>1000,39997=>1000,39998=>1000,39999=>1000,40000=>1000,40001=>1000,40002=>1000,40003=>1000,40004=>1000, - 40005=>1000,40006=>1000,40007=>1000,40008=>1000,40009=>1000,40010=>1000,40011=>1000,40012=>1000,40013=>1000,40014=>1000,40015=>1000,40016=>1000,40017=>1000,40018=>1000,40019=>1000,40020=>1000, - 40021=>1000,40022=>1000,40023=>1000,40024=>1000,40025=>1000,40026=>1000,40027=>1000,40028=>1000,40029=>1000,40030=>1000,40031=>1000,40032=>1000,40033=>1000,40034=>1000,40035=>1000,40036=>1000, - 40037=>1000,40038=>1000,40039=>1000,40040=>1000,40041=>1000,40042=>1000,40043=>1000,40044=>1000,40045=>1000,40046=>1000,40047=>1000,40048=>1000,40049=>1000,40050=>1000,40051=>1000,40052=>1000, - 40053=>1000,40054=>1000,40055=>1000,40056=>1000,40057=>1000,40058=>1000,40059=>1000,40060=>1000,40061=>1000,40062=>1000,40063=>1000,40064=>1000,40065=>1000,40066=>1000,40067=>1000,40068=>1000, - 40069=>1000,40070=>1000,40071=>1000,40072=>1000,40073=>1000,40074=>1000,40075=>1000,40076=>1000,40077=>1000,40078=>1000,40079=>1000,40080=>1000,40081=>1000,40082=>1000,40083=>1000,40084=>1000, - 40085=>1000,40086=>1000,40087=>1000,40088=>1000,40089=>1000,40090=>1000,40091=>1000,40092=>1000,40093=>1000,40094=>1000,40095=>1000,40096=>1000,40097=>1000,40098=>1000,40099=>1000,40100=>1000, - 40101=>1000,40102=>1000,40103=>1000,40104=>1000,40105=>1000,40106=>1000,40107=>1000,40108=>1000,40109=>1000,40110=>1000,40111=>1000,40112=>1000,40113=>1000,40114=>1000,40115=>1000,40116=>1000, - 40117=>1000,40118=>1000,40119=>1000,40120=>1000,40121=>1000,40122=>1000,40123=>1000,40124=>1000,40125=>1000,40126=>1000,40127=>1000,40128=>1000,40129=>1000,40130=>1000,40131=>1000,40132=>1000, - 40133=>1000,40134=>1000,40135=>1000,40136=>1000,40137=>1000,40138=>1000,40139=>1000,40140=>1000,40141=>1000,40142=>1000,40143=>1000,40144=>1000,40145=>1000,40146=>1000,40147=>1000,40148=>1000, - 40149=>1000,40150=>1000,40151=>1000,40152=>1000,40153=>1000,40154=>1000,40155=>1000,40156=>1000,40157=>1000,40158=>1000,40159=>1000,40160=>1000,40161=>1000,40162=>1000,40163=>1000,40164=>1000, - 40165=>1000,40166=>1000,40167=>1000,40168=>1000,40169=>1000,40170=>1000,40171=>1000,40172=>1000,40173=>1000,40174=>1000,40175=>1000,40176=>1000,40177=>1000,40178=>1000,40179=>1000,40180=>1000, - 40181=>1000,40182=>1000,40183=>1000,40184=>1000,40185=>1000,40186=>1000,40187=>1000,40188=>1000,40189=>1000,40190=>1000,40191=>1000,40192=>1000,40193=>1000,40194=>1000,40195=>1000,40196=>1000, - 40197=>1000,40198=>1000,40199=>1000,40200=>1000,40201=>1000,40202=>1000,40203=>1000,40204=>1000,40205=>1000,40206=>1000,40207=>1000,40208=>1000,40209=>1000,40210=>1000,40211=>1000,40212=>1000, - 40213=>1000,40214=>1000,40215=>1000,40216=>1000,40217=>1000,40218=>1000,40219=>1000,40220=>1000,40221=>1000,40222=>1000,40223=>1000,40224=>1000,40225=>1000,40226=>1000,40227=>1000,40228=>1000, - 40229=>1000,40230=>1000,40231=>1000,40232=>1000,40233=>1000,40234=>1000,40235=>1000,40236=>1000,40237=>1000,40238=>1000,40239=>1000,40240=>1000,40241=>1000,40242=>1000,40243=>1000,40244=>1000, - 40245=>1000,40246=>1000,40247=>1000,40248=>1000,40249=>1000,40250=>1000,40251=>1000,40252=>1000,40253=>1000,40254=>1000,40255=>1000,40256=>1000,40257=>1000,40258=>1000,40259=>1000,40260=>1000, - 40261=>1000,40262=>1000,40263=>1000,40264=>1000,40265=>1000,40266=>1000,40267=>1000,40268=>1000,40269=>1000,40270=>1000,40271=>1000,40272=>1000,40273=>1000,40274=>1000,40275=>1000,40276=>1000, - 40277=>1000,40278=>1000,40279=>1000,40280=>1000,40281=>1000,40282=>1000,40283=>1000,40284=>1000,40285=>1000,40286=>1000,40287=>1000,40288=>1000,40289=>1000,40290=>1000,40291=>1000,40292=>1000, - 40293=>1000,40294=>1000,40295=>1000,40296=>1000,40297=>1000,40298=>1000,40299=>1000,40300=>1000,40301=>1000,40302=>1000,40303=>1000,40304=>1000,40305=>1000,40306=>1000,40307=>1000,40308=>1000, - 40309=>1000,40310=>1000,40311=>1000,40312=>1000,40313=>1000,40314=>1000,40315=>1000,40316=>1000,40317=>1000,40318=>1000,40319=>1000,40320=>1000,40321=>1000,40322=>1000,40323=>1000,40324=>1000, - 40325=>1000,40326=>1000,40327=>1000,40328=>1000,40329=>1000,40330=>1000,40331=>1000,40332=>1000,40333=>1000,40334=>1000,40335=>1000,40336=>1000,40337=>1000,40338=>1000,40339=>1000,40340=>1000, - 40341=>1000,40342=>1000,40343=>1000,40344=>1000,40345=>1000,40346=>1000,40347=>1000,40348=>1000,40349=>1000,40350=>1000,40351=>1000,40352=>1000,40353=>1000,40354=>1000,40355=>1000,40356=>1000, - 40357=>1000,40358=>1000,40359=>1000,40360=>1000,40361=>1000,40362=>1000,40363=>1000,40364=>1000,40365=>1000,40366=>1000,40367=>1000,40368=>1000,40369=>1000,40370=>1000,40371=>1000,40372=>1000, - 40373=>1000,40374=>1000,40375=>1000,40376=>1000,40377=>1000,40378=>1000,40379=>1000,40380=>1000,40381=>1000,40382=>1000,40383=>1000,40384=>1000,40385=>1000,40386=>1000,40387=>1000,40388=>1000, - 40389=>1000,40390=>1000,40391=>1000,40392=>1000,40393=>1000,40394=>1000,40395=>1000,40396=>1000,40397=>1000,40398=>1000,40399=>1000,40400=>1000,40401=>1000,40402=>1000,40403=>1000,40404=>1000, - 40405=>1000,40406=>1000,40407=>1000,40408=>1000,40409=>1000,40410=>1000,40411=>1000,40412=>1000,40413=>1000,40414=>1000,40415=>1000,40416=>1000,40417=>1000,40418=>1000,40419=>1000,40420=>1000, - 40421=>1000,40422=>1000,40423=>1000,40424=>1000,40425=>1000,40426=>1000,40427=>1000,40428=>1000,40429=>1000,40430=>1000,40431=>1000,40432=>1000,40433=>1000,40434=>1000,40435=>1000,40436=>1000, - 40437=>1000,40438=>1000,40439=>1000,40440=>1000,40441=>1000,40442=>1000,40443=>1000,40444=>1000,40445=>1000,40446=>1000,40447=>1000,40448=>1000,40449=>1000,40450=>1000,40451=>1000,40452=>1000, - 40453=>1000,40454=>1000,40455=>1000,40456=>1000,40457=>1000,40458=>1000,40459=>1000,40460=>1000,40461=>1000,40462=>1000,40463=>1000,40464=>1000,40465=>1000,40466=>1000,40467=>1000,40468=>1000, - 40469=>1000,40470=>1000,40471=>1000,40472=>1000,40473=>1000,40474=>1000,40475=>1000,40476=>1000,40477=>1000,40478=>1000,40479=>1000,40480=>1000,40481=>1000,40482=>1000,40483=>1000,40484=>1000, - 40485=>1000,40486=>1000,40487=>1000,40488=>1000,40489=>1000,40490=>1000,40491=>1000,40492=>1000,40493=>1000,40494=>1000,40495=>1000,40496=>1000,40497=>1000,40498=>1000,40499=>1000,40500=>1000, - 40501=>1000,40502=>1000,40503=>1000,40504=>1000,40505=>1000,40506=>1000,40507=>1000,40508=>1000,40509=>1000,40510=>1000,40511=>1000,40512=>1000,40513=>1000,40514=>1000,40515=>1000,40516=>1000, - 40517=>1000,40518=>1000,40519=>1000,40520=>1000,40521=>1000,40522=>1000,40523=>1000,40524=>1000,40525=>1000,40526=>1000,40527=>1000,40528=>1000,40529=>1000,40530=>1000,40531=>1000,40532=>1000, - 40533=>1000,40534=>1000,40535=>1000,40536=>1000,40537=>1000,40538=>1000,40539=>1000,40540=>1000,40541=>1000,40542=>1000,40543=>1000,40544=>1000,40545=>1000,40546=>1000,40547=>1000,40548=>1000, - 40549=>1000,40550=>1000,40551=>1000,40552=>1000,40553=>1000,40554=>1000,40555=>1000,40556=>1000,40557=>1000,40558=>1000,40559=>1000,40560=>1000,40561=>1000,40562=>1000,40563=>1000,40564=>1000, - 40565=>1000,40566=>1000,40567=>1000,40568=>1000,40569=>1000,40570=>1000,40571=>1000,40572=>1000,40573=>1000,40574=>1000,40575=>1000,40576=>1000,40577=>1000,40578=>1000,40579=>1000,40580=>1000, - 40581=>1000,40582=>1000,40583=>1000,40584=>1000,40585=>1000,40586=>1000,40587=>1000,40588=>1000,40589=>1000,40590=>1000,40591=>1000,40592=>1000,40593=>1000,40594=>1000,40595=>1000,40596=>1000, - 40597=>1000,40598=>1000,40599=>1000,40600=>1000,40601=>1000,40602=>1000,40603=>1000,40604=>1000,40605=>1000,40606=>1000,40607=>1000,40608=>1000,40609=>1000,40610=>1000,40611=>1000,40612=>1000, - 40613=>1000,40614=>1000,40615=>1000,40616=>1000,40617=>1000,40618=>1000,40619=>1000,40620=>1000,40621=>1000,40622=>1000,40623=>1000,40624=>1000,40625=>1000,40626=>1000,40627=>1000,40628=>1000, - 40629=>1000,40630=>1000,40631=>1000,40632=>1000,40633=>1000,40634=>1000,40635=>1000,40636=>1000,40637=>1000,40638=>1000,40639=>1000,40640=>1000,40641=>1000,40642=>1000,40643=>1000,40644=>1000, - 40645=>1000,40646=>1000,40647=>1000,40648=>1000,40649=>1000,40650=>1000,40651=>1000,40652=>1000,40653=>1000,40654=>1000,40655=>1000,40656=>1000,40657=>1000,40658=>1000,40659=>1000,40660=>1000, - 40661=>1000,40662=>1000,40663=>1000,40664=>1000,40665=>1000,40666=>1000,40667=>1000,40668=>1000,40669=>1000,40670=>1000,40671=>1000,40672=>1000,40673=>1000,40674=>1000,40675=>1000,40676=>1000, - 40677=>1000,40678=>1000,40679=>1000,40680=>1000,40681=>1000,40682=>1000,40683=>1000,40684=>1000,40685=>1000,40686=>1000,40687=>1000,40688=>1000,40689=>1000,40690=>1000,40691=>1000,40692=>1000, - 40693=>1000,40694=>1000,40695=>1000,40696=>1000,40697=>1000,40698=>1000,40699=>1000,40700=>1000,40701=>1000,40702=>1000,40703=>1000,40704=>1000,40705=>1000,40706=>1000,40707=>1000,40708=>1000, - 40709=>1000,40710=>1000,40711=>1000,40712=>1000,40713=>1000,40714=>1000,40715=>1000,40716=>1000,40717=>1000,40718=>1000,40719=>1000,40720=>1000,40721=>1000,40722=>1000,40723=>1000,40724=>1000, - 40725=>1000,40726=>1000,40727=>1000,40728=>1000,40729=>1000,40730=>1000,40731=>1000,40732=>1000,40733=>1000,40734=>1000,40735=>1000,40736=>1000,40737=>1000,40738=>1000,40739=>1000,40740=>1000, - 40741=>1000,40742=>1000,40743=>1000,40744=>1000,40745=>1000,40746=>1000,40747=>1000,40748=>1000,40749=>1000,40750=>1000,40751=>1000,40752=>1000,40753=>1000,40754=>1000,40755=>1000,40756=>1000, - 40757=>1000,40758=>1000,40759=>1000,40760=>1000,40761=>1000,40762=>1000,40763=>1000,40764=>1000,40765=>1000,40766=>1000,40767=>1000,40768=>1000,40769=>1000,40770=>1000,40771=>1000,40772=>1000, - 40773=>1000,40774=>1000,40775=>1000,40776=>1000,40777=>1000,40778=>1000,40779=>1000,40780=>1000,40781=>1000,40782=>1000,40783=>1000,40784=>1000,40785=>1000,40786=>1000,40787=>1000,40788=>1000, - 40789=>1000,40790=>1000,40791=>1000,40792=>1000,40793=>1000,40794=>1000,40795=>1000,40796=>1000,40797=>1000,40798=>1000,40799=>1000,40800=>1000,40801=>1000,40802=>1000,40803=>1000,40804=>1000, - 40805=>1000,40806=>1000,40807=>1000,40808=>1000,40809=>1000,40810=>1000,40811=>1000,40812=>1000,40813=>1000,40814=>1000,40815=>1000,40816=>1000,40817=>1000,40818=>1000,40819=>1000,40820=>1000, - 40821=>1000,40822=>1000,40823=>1000,40824=>1000,40825=>1000,40826=>1000,40827=>1000,40828=>1000,40829=>1000,40830=>1000,40831=>1000,40832=>1000,40833=>1000,40834=>1000,40835=>1000,40836=>1000, - 40837=>1000,40838=>1000,40839=>1000,40840=>1000,40841=>1000,40842=>1000,40843=>1000,40844=>1000,40845=>1000,40846=>1000,40847=>1000,40848=>1000,40849=>1000,40850=>1000,40851=>1000,40852=>1000, - 40853=>1000,40854=>1000,40855=>1000,40856=>1000,40857=>1000,40858=>1000,40859=>1000,40860=>1000,40861=>1000,40862=>1000,40863=>1000,40864=>1000,40865=>1000,40866=>1000,40867=>1000,40868=>1000, - 40869=>1000); -$diff=''; -$originalsize=23275812; - -// CID Information -// Select your language -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ac16.tar.Z,ag15.tar.Z,ak12.tar.Z and aj16.tar.Z. - -//$enc='UniCNS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'CNS1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ac15.php'); - -//$enc='UniGB-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'GB1','Supplement'=>2); -//include(dirname(__FILE__).'/uni2cid_ag15.php'); - -//$enc='UniKS-UTF16-H'; -//$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Korea1','Supplement'=>0); -//include(dirname(__FILE__).'/uni2cid_ak12.php'); - -$enc='UniJIS-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe','Ordering'=>'Japan1','Supplement'=>5); -include(dirname(__FILE__).'/uni2cid_aj16.php'); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/chinese.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/chinese.php deleted file mode 100644 index d63e55851f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/chinese.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php -// CHINESE TRADITIONAL -$type='cidfont0'; -$dw=1000; -$name='DFKaiShu-SB-Estd-BF'; -$desc=array('Ascent'=>801,'Descent'=>-199,'CapHeight'=>27,'Flags'=>33,'FontBBox'=>'[0 -199 949 801]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-107; -$ut=49; -$cw=array(1=>500,2=>500,3=>500,4=>500,5=>500,6=>500,7=>500,8=>500,9=>500,10=>500,11=>500,12=>500,13=>500,14=>500,15=>500,16=>500,17=>500,18=>500,19=>500,20=>500,21=>500,22=>500,23=>500,24=>500,25=>500,26=>500,27=>500,28=>500,29=>500,30=>500,31=>500,32=>500,33=>500,34=>500,35=>500,36=>500,37=>500,38=>500,39=>500,40=>500,41=>500,42=>500,43=>500,44=>500,45=>500,46=>500,47=>500,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>500,59=>500,60=>500,61=>500,62=>500,63=>500,64=>500,65=>500,66=>500,67=>500,68=>500,69=>500,70=>500,71=>500,72=>500,73=>500,74=>500,75=>500,76=>500,77=>500,78=>500,79=>500,80=>500,81=>500,82=>500,83=>500,84=>500,85=>500,86=>500,87=>500,88=>500,89=>500,90=>500,91=>500,92=>500,93=>500,94=>500,95=>500,96=>500,97=>500,98=>500,99=>500,100=>500,101=>500,102=>500,103=>500,104=>500,105=>500,106=>500,107=>500,108=>500,109=>500,110=>500,111=>500,112=>500,113=>500,114=>500,115=>500,116=>500,117=>500,118=>500,119=>500,120=>500,121=>500,122=>500,123=>500,124=>500,125=>500,126=>500,127=>500,8364=>1000,129=>500,130=>500,131=>500,132=>500,8230=>1000,134=>500,135=>500,136=>500,137=>500,138=>500,139=>500,140=>500,141=>500,142=>500,143=>500,144=>500,8216=>1000,8217=>1000,8220=>1000,8221=>1000,8226=>1000,8211=>1000,8212=>1000,152=>500,153=>500,154=>500,155=>500,156=>500,157=>500,158=>500,159=>500,160=>500,161=>500,162=>500,163=>500,164=>500,165=>500,166=>500,167=>500,168=>500,169=>500,170=>500,171=>500,172=>500,173=>500,174=>500,175=>500,176=>500,177=>500,178=>500,179=>500,180=>500,181=>500,182=>500,183=>500,184=>500,185=>500,186=>500,187=>500,188=>500,189=>500,190=>500,191=>500,192=>500,193=>500,194=>500,195=>500,196=>500,197=>500,198=>500,199=>500,200=>500,201=>500,202=>500,203=>500,204=>500,205=>500,206=>500,207=>500,208=>500,209=>500,210=>500,211=>500,212=>500,213=>500,214=>500,215=>500,216=>500,217=>500,218=>500,219=>500,220=>500,221=>500,222=>500,223=>500,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>500,231=>500,232=>500,233=>500,234=>500,235=>500,236=>500,237=>500,238=>500,239=>500,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>500,248=>500,249=>500,250=>500,251=>500,252=>500,253=>500,254=>500,255=>500); -$diff=''; -$originalsize=5172084; -$enc='UniGB-UTF16-H'; -$cidinfo=array('Registry'=>'Adobe', 'Ordering'=>'GB1','Supplement'=>2); -include(dirname(__FILE__).'/uni2cid_ag15.php'); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/courier.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/courier.php deleted file mode 100644 index d6ab661c09..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/courier.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=600; -$cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600, -10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600, -20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600, -30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600, -40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600, -50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600, -60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600, -70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600, -80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600, -90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600, -100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600, -109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600, -118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600, -127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600, -136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600, -145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600, -154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600, -163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600, -172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600, -181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600, -190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600, -199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600, -208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600, -217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600, -226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600, -235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600, -244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600, -253=>600,254=>600,255=>600); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/AUTHORS b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/AUTHORS deleted file mode 100644 index 94d37c27aa..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/AUTHORS +++ /dev/null @@ -1,46 +0,0 @@ -abysta at yandex.ru -Adrian Schroeter -Andrey Valentinovich Panov -Ben Laenen -Besarion Gugushvili -Bhikkhu Pesala -Clayborne Arevalo -Dafydd Harries -Danilo Segan -Davide Viti -David Jez -David Lawrence Ramsey -Denis Jacquerye -Dwayne Bailey -Eugeniy Meshcheryakov -Gee Fung Sit -Heikki Lindroos -James Cloos -James Crippen -John Karp -Keenan Pepper -Lars Naesbye Christensen -Mashrab Kuvatov -Max Berger -Mederic Boquien -Michael Everson -Misu Moldovan -Nguyen Thai Ngoc Duy -Nicolas Mailhot -Ognyan Kulev -Ondrej Koala Vacha -Peter Cernak -Remy Oudompheng -Roozbeh Pournader -Sahak Petrosyan -Sander Vesik -Stepan Roh -Stephen Hartke -Steve Tinney -Tavmjong Bah -Tim May -Valentin Stoykov -Vasek Stodulka -Wesley Transue - -$Id: AUTHORS 2344 2009-03-08 13:02:37Z moyogo $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/BUGS b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/BUGS deleted file mode 100644 index 49b36de553..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/BUGS +++ /dev/null @@ -1,3 +0,0 @@ -See http://dejavu.sourceforge.net/wiki/index.php/Bugs - -$Id: BUGS 80 2004-11-13 13:12:02Z src $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/LICENSE b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/LICENSE deleted file mode 100644 index 254e2cc42a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/LICENSE +++ /dev/null @@ -1,99 +0,0 @@ -Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. -Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) - -Bitstream Vera Fonts Copyright ------------------------------- - -Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is -a trademark of Bitstream, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of the fonts accompanying this license ("Fonts") and associated -documentation files (the "Font Software"), to reproduce and distribute the -Font Software, including without limitation the rights to use, copy, merge, -publish, distribute, and/or sell copies of the Font Software, and to permit -persons to whom the Font Software is furnished to do so, subject to the -following conditions: - -The above copyright and trademark notices and this permission notice shall -be included in all copies of one or more of the Font Software typefaces. - -The Font Software may be modified, altered, or added to, and in particular -the designs of glyphs or characters in the Fonts may be modified and -additional glyphs or characters may be added to the Fonts, only if the fonts -are renamed to names not containing either the words "Bitstream" or the word -"Vera". - -This License becomes null and void to the extent applicable to Fonts or Font -Software that has been modified and is distributed under the "Bitstream -Vera" names. - -The Font Software may be sold as part of a larger software package but no -copy of one or more of the Font Software typefaces may be sold by itself. - -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, -TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME -FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING -ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE -FONT SOFTWARE. - -Except as contained in this notice, the names of Gnome, the Gnome -Foundation, and Bitstream Inc., shall not be used in advertising or -otherwise to promote the sale, use or other dealings in this Font Software -without prior written authorization from the Gnome Foundation or Bitstream -Inc., respectively. For further information, contact: fonts at gnome dot -org. - -Arev Fonts Copyright ------------------------------- - -Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the fonts accompanying this license ("Fonts") and -associated documentation files (the "Font Software"), to reproduce -and distribute the modifications to the Bitstream Vera Font Software, -including without limitation the rights to use, copy, merge, publish, -distribute, and/or sell copies of the Font Software, and to permit -persons to whom the Font Software is furnished to do so, subject to -the following conditions: - -The above copyright and trademark notices and this permission notice -shall be included in all copies of one or more of the Font Software -typefaces. - -The Font Software may be modified, altered, or added to, and in -particular the designs of glyphs or characters in the Fonts may be -modified and additional glyphs or characters may be added to the -Fonts, only if the fonts are renamed to names not containing either -the words "Tavmjong Bah" or the word "Arev". - -This License becomes null and void to the extent applicable to Fonts -or Font Software that has been modified and is distributed under the -"Tavmjong Bah Arev" names. - -The Font Software may be sold as part of a larger software package but -no copy of one or more of the Font Software typefaces may be sold by -itself. - -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL -TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - -Except as contained in this notice, the name of Tavmjong Bah shall not -be used in advertising or otherwise to promote the sale, use or other -dealings in this Font Software without prior written authorization -from Tavmjong Bah. For further information, contact: tavmjong @ free -. fr. - -$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/NEWS b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/NEWS deleted file mode 100644 index a05a30c277..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/NEWS +++ /dev/null @@ -1,1215 +0,0 @@ -Changes from 2.29 to 2.30 - -* added U+0462-U+0463 to Mono (by Denis Jacquerye) -* corrected U+1E53 in Serif (by Gee Fung Sit) -* added U+1E4C-U+1E4D to Mono and Serif (by Gee Fung Sit) -* added U+1E78-U+1E79 to Mono (by Gee Fung Sit) -* fixed missing diacritics in Latin Extended Additional in Sans ExtraLight - (moved stacked diacritics out of PUA in the process) (by Gee Fung Sit) -* fixed anchors on U+1E78 in Serif (by Gee Fung Sit) -* added U+1DC4-U+1DC9 to Serif (by Denis Jacquerye) -* renamed above-mark to above-mark in Serif-Italic (by Denis Jacquerye) -* added U+1DC4-U+1DC9 to context class for dotless substitution (by Denis - Jacquerye) -* changed Doubleacute to Doublegrave in Sans ExtraLight (by Gee Fung Sit) -* removed redundant reference in U+01FB in Sans Oblique (by Gee Fung Sit) -* added U+A726-U+A727 to Mono (Denis Jacquerye) -* changed U+04BE and U+04BF according to recommedations of Sasha Ankwab in Sans - (by Andrey V. Panov) -* remove "Symbol Charset" from set of codepages in Sans (by Eugeniy - Meshcheryakov) - -Changes from 2.28 to 2.29 - -* modified U+10FB in Sans to be a mirror image of U+2056, since U+10FB is not - Georgian-specific (by Roozbeh Pournader) -* added U+2B1F, U+2B24, U+2B53, U+2B54 in Sans (by Roozbeh Pournader) -* fixed TUR opentype language tag to TRK in Serif (bug 19825) (by Ben Laenen) -* early implementation of Abkhaz letter U+0524-U+0525 in Sans - (by Michael Everson and abysta) -* flipped U+1D538 in Sans (by Gee Fung Sit) -* added U+26B3-U+26B8, U+1D7D8-U+1D7E1 in Sans (by Gee Fung Sit) -* corrected U+1D7A9 in Sans Bold Oblique (by Gee Fung Sit) -* Fixed U+0649 to be dual-joining in Sans Mono (by Roozbeh Pournader) -* Remove unnecessary 'isol' feature from Sans Mono (by Roozbeh Pournader) -* Remove 'cmap' mappings for U+066E, U+066F, U+067C, U+067D, U+0681, U+0682, - U+0685, U+0692, U+06A1, U+06B5, U+06BA, U+06C6, U+06CE, and U+06D5 - in Sans Mono (bug 20323) (by Roozbeh Pournader) -* add half brackets (U+2E22 - U+2E25, by Steve Tinney) - -Changes from 2.27 to 2.28 - -* added U+A789, U+A78A in Sans and Sans Mono (by Denis Jacquerye) -* modified U+02D6, U+02D7, U+02EE in Sans and Sans Mono (by Denis Jacquerye) -* added U+1E9E (German capital ß) to Sans and Serif (by Denis Jacquerye) -* adjusted width of U+01B7-U+01B9 in Serif Italic (by Denis Jacquerye) -* modified U+021C, U+021D in Sans (by Denis Jacquerye) -* added U+021C, U+021D in Mono (by Denis Jacquerye) -* added U+F428 (Georgian Nuskhuri "f") in private use area (by Besarion - Gugushvili) -* updated Georgian mkhedruli (U+10D0-U+10FA) with new version (by Besarion - Gugushvili) -* updated Georgian asomtavruli (U+10A0-U+10C5) with new version (by Besarion - Gugushvili) -* added Georgian nuskhuri (U+2D00-U+2D25) (by Besarion Gugushvili) -* added Georgian mtavruli in private use area (U+F400-U+F426) (by Besarion - Gugushvili) -* added mark anchors above to Cyrillic U+0430-U+0438, U+043A-U+044F, - U+0454-U+0455 in Mono (by Ben Laenen) -* modified/moved up U+0318-U+0319, U+031C-U+031F, U+0329-U+032A, U+032C-U+032D, - U+0339-U+033B, U+0348 and U+0353 in Sans to prevent cut-off (by Gee Fung Sit) -* added U+035A to Sans (by Gee Fung Sit) -* updated fontconfig files (by Nicolas Mailhot) -* added U+2032-2037 to Mono (by Denis Jacquerye) -* added Ogham to Sans ExtraLight (by Gee Fung Sit) -* added U+2C6F, U+2C79, U+2C7C-2C7D to Mono (by Gee Fung Sit) -* added U+210F to Serif and Sans ExtraLight (by Gee Fung Sit) -* changed U+210F to a more common glyph in Sans and Mono (by Gee Fung Sit) - -Changes from 2.26 to 2.27 - -* added some of Michael Everson's new Cyrillic glyphs to Sans (by Wesley - Transue) -* removed blank glyph at U+05EF from Sans Bold Oblique (by Gee Fung Sit) -* small adjustments to existing tone bars in Sans and Mono (by Gee Fung Sit) -* added U+0372-U+0373, U+0376-U+0377, U+03CF, U+A668-U+A66E, U+A708-U+A711, - U+A71B-U+A71F to Sans (by Gee Fung Sit) -* copied U+02E5-U+02E9 over from Sans to fix inconsistencies in Serif (by Gee - Fung Sit) -* added U+021C-U+021D, U+0370-U+0371, U+037B-U+037D, U+0470-U+0471, - U+0510-U+0515, U+051A-U+051D, U+1E9F, U+2C64, U+2C6E-U+2C6F, U+2C79, - U+2C7C-U+2C7D, U+A644-U+A647, U+A650-U+A651, U+A654-U+A657, U+A708-U+A716, - U+A71B-U+A71F to Serif (by Gee Fung Sit) -* added U+A708-U+A716, U+A71B-U+A71F to Mono (by Gee Fung Sit) -* added anchors to U+017F (Å¿) and fixed U+1E9B (ẛ) in Serif (by Gee Fung Sit) -* made U+0325 smaller in Sans Bold and Serif to match Sans Book (by Gee Fung - Sit) -* fixes to U+02F3 (moved up), U+228F-U+2294 (more square-like) and - U+22CE-U+22CF (stroke width) in Sans (by Gee Fung Sit) -* replaced U+2202 ∂ (Sans and Mono) and U+221D âˆ, U+221E ∞ (Sans) with glyphs - from Arev (with small changes) (by Gee Fung Sit) -* added U+22B0-U+22B1, U+22C7, U+22D0-U+22D5 from Arev to Sans to complete the - block (by Gee Fung Sit) -* added U+0514-U+0515 to Sans ExtraLight (by Gee Fung Sit) -* skewed U+A78C in all Oblique/Italic fonts (by Gee Fung Sit) -* moved U+2215 to U+2044 in Sans and Serif and replaced U+2215 with reference - to U+002F in all fonts (by Gee Fung Sit) -* added U+2C6E to Mono (by Denis Jacquerye) -* added U+A782 and U+A783 in Sans (by Wesley Transue) -* added U+0244, U+024C-024D, U+2C64 in Sans Mono (by Denis Jacquerye) -* modified U+01AE in Sans Mono (by Denis Jacquerye) -* added U+2C7A to all fonts (by Gee Fung Sit) -* italicized/small changes to U+2C76 in Serif (Bold) Italic (by Gee Fung Sit) -* improved outlines of U+2C68, U+2C6A, U+2C6C in Serif (Bold) Italic (by Gee - Fung Sit) -* rounded U+2C77 at the bottom in Serif (by Gee Fung Sit) -* added joining behavior for tone letters (U+02E5-U+02E9) in Sans (bug #15669) - (by Gee Fung Sit) -* fixed outline of y.alt in Sans Regular (by Denis Jacquerye) -* changed references of U+1D5A8, U+1D5C5, U+1D5DC, U+1D5F9, U+1D610, U+1D62D, - U+1D644 and U+1D661 to stylistic alternates to have a better distinction (by - Gee Fung Sit) -* hinted I.alt in Sans Regular (by Gee Fung Sit) -* added U+0487, completing Cyrillic block (by Gee Fung Sit) -* extended the bar of U+0463 to the right and moved the anchor (by Gee Fung - Sit) -* added anchors to glyphs in Cyrillic block (by Gee Fung Sit) -* added (preliminary) hints to tone letter forms (U+02E5.5, U+02E9.1, stem) in - Sans Book (by Gee Fung Sit) - -Changes from 2.25 to 2.26 - -- added glyphs for Cyrillic-B to Sans (by Wesley Transue) -- added U+0370-U+0371 to Sans (by Wesley Transue) -- added U+019C, U+01A2-U+01A3, U+01A6, U+01E4-U+01E5, U+024C-U+024D, U+0285, - U+0290, U+02A0, U+0370-U+0371, U+03F1, U+03FC to Sans ExtraLight (by Wesley - Transue) -- added U+20A0-U+20A5, U+20A7-U+20B3, U+2105, U+210D, U+210F, U+2115, U+2117, - U+2119-U+211A, U+211D, U+2124, U+212E, U+2200-U+2204 to Mono (by Heikki - Lindroos) -- added U+01BA and U+01BF to Mono (by Heikki Lindroos) -- merged OpenType "aalt" feature in Latin in Sans (by Denis Jacquerye) -- added alternative shape for y in Sans (by Denis Jacquerye) -- added saltillo (U+A78B-U+A78C) to all faces (by James Cloos) -- changed U+047C-U+047D to references instead of outlines in Sans (by Wesley - Transue) -- added Latin letter tresillo U+A72A-U+A72B to Sans (by Wesley Transue) -- added U+A734-U+A737 to Sans (by Wesley Transue) -- added U+2053 to Serif and fixed it bug:9425 in Sans (by Gee Fung Sit) -- removed problematic hints for U+0423 bug:10025 (by Gee Fung Sit) -- added U+27C5-U+27C6 bug:10255 to all faces (by Gee Fung Sit) -- fixed width of U+2016 in Sans Oblique (by Gee Fung Sit) -- added U+2016, U+2032-U+2038, U+2042, U+2045-U+2046, U+204B-U+204F, - U+2051-U+2052, U+2057 to Serif (by Gee Fung Sit) -- made U+2140 bigger to match other n-ary operators (by Gee Fung Sit) -- added U+0606-U+0607, U+0609-U+060A to Sans (by Gee Fung Sit) -- added U+221B-U+221C to Mono (by Gee Fung Sit) -- small adjustments to U+221B-U+221C in Sans and Serif (by Gee Fung Sit) -- update U+04B4-U+04B5 in Serif (by Andrey V. Panov) -- increased max-storage value from maxp table to 153 (by Andrey V. Panov) -- added U+0472-U+0473, U+0510-U+0511, U+051A-U+051D, U+0606-U+0607, - U+0609-U+060A, U+1E26-U+1E27, U+1E54-U+1E55, U+1E7C-U+1E7D, U+1E8C-U+1E8D, - U+1E90-U+1E91, U+1E97-U+1E99, U+1E9F, U+1EAC-U+1EAD, U+1EB6-U+1EB7, - U+1EC6-U+1EC7, U+1ED8-U+1EDD, U+1EE0-U+1EE3, U+1EE8-U+1EEB, U+1EEE-U+1EF1 to - Mono (by Gee Fung Sit) -- added locl rules for S/T cedilla for Romanian and Moldavian so they get - rendered as S/T with comma accent (see Redhat bug #455981) (by Ben Laenen) -- removed ligature rule from Armenian U+0587 bug:16113 (by Gee Fung Sit) - -Changes from 2.24 to 2.25 - -- moved/added U+2E18 (by Gee Fung Sit) -- added empty glyph for U+2064 in Sans and Serif (by Gee Fung Sit) -- added U+22CE-U+22CF to Sans (by Gee Fung Sit) -- Sans Oblique and Bold Oblique, Serif: reverted digits hinting instructions back to before revision 1590, which fixed mistaken debian bug #471024. This fixes Debian bug #411308. The original bug was in freetype not in the fonts (by Denis Jacquerye) -- added U+A726-U+A729, U+A730-U+A733, U+A738-U+A73F, U+A746-U+A74B, U+A74E-U+A74F, U+A780-U+A781, U+A7FB-U+A7FF to Sans (by Gee Fung Sit) -- added Macedonian italic glyph shape for U+0453 in Serif (by Ben Laenen) -- changed descenders in U+0446, U+0449, U+0497, U+04A3, U+04AD (by Andrey V. Panov) -- updated main SFD files to SplineFontDB 3.0 (Denis Jacquerye and Gee Fung Sit) -- moved U+0561 2 up since it wasn't aligned with the baseline well (by Ben Laenen) -- added U+2E2E to Sans (by Gee Fung Sit) -- replaced U+2699 with simpler version in Sans (by Gee Fung Sit) -- added a lot of hinting instructions to Latin Extended B, Greek and Coptic glyphs Sans Book (by Wesley Transue) -- differentiated U+2219 from U+22C5 and adjusted affected references in Sans and Mono (by Gee Fung Sit) -- made Hebrew narrower in Sans Bold and Sans Bold Oblique (by Denis Jacquerye) -- added Kurdish and Chuvash letters from Unicode 5.1 Cyrillic Extended block (by Wesley Transue) -- added U+1E9F, U+A644-U+A647, U+A64C-U+A64D, U+A650-U+A651, U+A654-U+A655, U+A712U+A716 to Sans (by Gee Fung Sit) -- added several glyphs to Sans ExtraLight (by Gee Fung Sit) -- added hinting instructions to U+046A-U+046B, U+0508-U+0509, U+050B, U+0512-U+0513 in Sans Book (by Wesley Transue) -- corrected width of U+027E in Sans Book (by Gee Fung Sit) -- added U+2C79, U+2C7B-U+2C7D to Sans (by Gee Fung Sit) -- added a bunch of glyphs+small corrections to Sans Light (by Gee Fung Sit) -- added U+0496, U+0497, U+04B0, U+04B1 (by Andrey V. Panov) -- updated U+0493, U+049B, U+04B3, U+04B7, U+04F7 (by Andrey V. Panov) -- further improvements in extended Cyrillic (by Andrey V. Panov) - -Changes from 2.23 to 2.24 - -- instructions for U+05C0 ×€, U+05C3 ׃, U+05F3 ׳, and U+05F4 ×´ in DejaVu - Sans. (by Wesley Transue) -- instructions for U+2116 in Sans (by Andrey V. Panov) -- Unicode 5.1 update: moved U+F208 to U+2C6D, U+F25F to U+2C71, added - U+2C6E-U+2C6F, U+2C72-U+2C73, updated outline of U+2C71 in Sans. (by - Denis Jacquerye) -- updated and instructed U+0401 in Sans (by Andrey V. Panov) -- fixed the bug in Sans faces where U+02EC ˬ faced the wrong direction. - Also, added a few more glyph instructions. (by Wesley Transue) -- removed OS2Sub and OS2Strike that weren't intentional in Sans - ExtraLight. (by Denis Jacquerye) -- updated instructions for U+401, U+44F in Serif Book. (by Andrey V. - Panov) -- instructions for U+02C4 Ë„, U+02C5 Ë…, U+03D8 Ϙ, U+03D9 Ï™, U+0494 Ò”, and - U+0495 Ò• in Sans Book. (by Wesley Transue) -- instructions for U+01A6 Ʀ, U+0238 ȸ, U+0239 ȹ, U+02EC ˬ, and U+05C6 ׆ - in Sans Book. (by Wesley Transue) -- DejaVuSans.sfd DejaVuSerif.sfd: updated instructions for U+447 and - U+451 using code generated with xgridfit (by Andrey V. Panov) -- instructions for a few glyphs in the Latin Extended-B Block, Greek - Block, Cyrillic Block, and N'Ko block. (by Wesley Transue) -- updated sfdnormalize.pl, and SFD files to new SFD format with empty - lines. (by Denis Jacquerye) - -Changes from 2.22 to 2.23 - -- fixed bug which made Condensed fonts appear instead of normal width ones -- added U+20DB, U+20DC, and U+20E1 to Sans (by Roozbeh Pournader) -- added hinting instructions to U+01A7, U+01AA-U+01AC, U+01AE-U+01AF, - U+01BC-U+01BD, U+01BF, U+01F7, U+0277, U+027F, U+0285-U+0286, U+0297, U+02AF, - U+02B4-U+02B5, U+02BD, U+030D, U+0311, U+0329, U+04A0-U+04A1 in Sans Book (by - Wesley Transue) -- modified hinting instructions of U+04A2 in Sans Book (by Wesley Transue) -- added hinting instructions to U+237D, U+2423 in Mono Book and Mono Bold (by - Wesley Transue) -- added mathematical alphanumeric symbols to all styles (by Max Berger) -- added Unicode 5.1 U+2E18 as U+2E18.u51 (not yet usable) to Sans (by Roozbeh - Pournader) -- dereferenced all glyphs with mixed references and outlines (by Denis - Jacquerye) -- removed non-zero width from U+0344 in Sans (by Denis Jacquerye) - -Changes from 2.21 to 2.22 - -- directory structure has changed, we now use the Makefile -- modified Armenian U+0565 in Sans (by ÕÕ¡Õ°Õ¡Õ¯ ÕŠÕ¥Õ¿Ö€Õ¸Õ½ÕµÕ¡Õ¶) -- added double struck letters and numbers U+2102, U+210D, U+2115, - U+2119-U+211A, U+211D, U+2124, U+213C-U+2140, U+2145-U+2149, U+1D538-U+1D539, - U+1D53B-U+1D53E, U+1D540-U+1D544, U+1D546, U+1D54A-U+1D550, U+1D552-U+1D56B, - U+1D7D8-U+1D7E1 to Serif (by Stephen Hartke) -- added letterlike symbols U+2103, U+2109, U+2127, U+214B, U+2141-U+2144 to - Serif (by Ben Laenen) -- fixed outline direction of U+2143 in Sans Bold/Bold Oblique (by Ben Laenen) -- added arrow set in Serif: arrows: U+2194-U+21FF; dingbats: U+27A1; - supplemental arrows A: U+27F0-U+27FF; supplemental arrows B: U+2900-U+2975, - U+297A; miscellaneous symbols and arrows: U+2B00-U+2B11 (by Ben Laenen) -- added U+0180, U+01DE, U+01E0-01E1, U+022A, U+022C, U+0230, U+1E08-U+1E09, - U+1E10-U+1E11, U+1EB0-U+1EB1 to Mono (by Denis Jacquerye) -- adjusted U+01D5, U+01D7, U+01D9, U+1DB in Mono (by Denis Jacquerye) -- added Ogham in Sans (by Wesley Transue) -- added Yijing Hexagram Symbols in Sans (by Wesley Transue) -- hinting instructions added to Cyrillic U+0460, U+04A6-U+04A7, U+04AC-U+04AD, - U+04C7-U+04C8, U+04F6-U+04F7, U+04FA-U+04FB, U+050C-U+050D in Sans Book (by - Wesley Transue) -- adjusted Cyrillic letters U+042A, U+044A, U+044C, U+0459-U+045B, U+0462, - U+048C-U+048D in Serif (by Andrey V. Panov) -- hinting instructions added to Lao U+0EB7 in Sans (by Wesley Transue) -- added Roman numerals and Claudian letter U+2160-U+2184 in Serif (by Ben - Laenen) -- added U+FFF9-U+FFFD to Sans, Serif and Mono (by Lars Næsbye Christensen) -- added mathematical symbols to Serif: U+2200, U+2203-U+2204, U+2213-U+2214, - U+2217-U+2218, U+2223-U+2226, U+2250-U+2255, U+2295-U+22AF, U+22C5 (by Ben - Laenen) -- modified bullet symbol U+2219 in Serif (by Ben Laenen) - -Changes from 2.20 to 2.21 - -- added U+FE20-U+FE23 (half diacritics) to Sans (by Denis Jacquerye) -- added anchor "half" to position right half of double marks, U+FE21 or U+FE23 - to Sans (by Denis Jacquerye) -- shifted U+0360 up to avoid collision with some outlines in Sans (by Denis - Jacquerye) -- added anchor above-mark anchor to U+035D, U+035E, U+0360, U+0361 in Sans (by - Denis Jacquerye) -- added instructions for ff, ffi, ffl ligatures in Serif Bold (by Eugeniy - Meshcheryakov) -- added instructions to some N'Ko glyphs (by Wesley Transue) -- added instructions to some Lao glyphs (by Wesley Transue) -- cleaning up 'liga' Standard Ligature in Latin, in Sans and Sans Mono (by - Denis Jacquerye) -- added U+046A, U+046B (big yus) in Serif (by Andrey V. Panov) -- added box drawing symbols to Sans and Serif (by Lars Næsbye Christensen) -- added Makefile to improve font and packages generating (by Nicolas Mailhot) - -Changes from 2.19 to 2.20 - -- removed TeX and TeXData tags from all sfd files (by Eugeniy Meshcheryakov) -- removed all 'frac' lookups (by Eugeniy Meshcheryakov) -- fixed duplicate glyph names (by Eugeniy Meshcheryakov) -- removed standard ligatures with U+00B7 in Mono (by Eugeniy Meshcheryakov) -- use reference to U+002D in U+00AD in Sans Oblique, and adjust instructions - (by Eugeniy Meshcheryakov) -- updated Cyrillic in Sans Extra Light (by Andrey V. Panov) -- added instructions to N'Ko U+07C1-U+07C6, U+07CA, U+07CE-U+07CF, U+07D1, - U+07D3-U+07D4, U+07D8, U+07DB and U+07EB in Sans (by Wesley Transue) -- added instructions to Lao U+0E8A, U+0E95, U+0E97, U+EA5, U+0EB4 and U+0EB5 - (by Wesley Transue) -- adjusted instructions for Hebrew glyphs (by Denis Jacquerye) -- added instructions for U+0265 in Sans Bold (by Denis Jacquerye) -- fix U+1D68 in Sans: it had the shape of delta, where it should be a rho (by - Ben Laenen) -- remove U+1D5C glyph in Sans Oblique (it was empty) (by Ben Laenen) -- fix instructions of U+01AD in Sans Bold (by Ben Laenen) -- fix instructions of U+042D in Serif (by Ben Laenen) -- remove buggy instructions of U+2328 in Serif (by Ben Laenen) -- corrected width of U+2C75-U+2C76 in Sans Bold and Serif Bold (by Gee Fung Sit) -- added U+2C75-U+2C77 to Mono (by Gee Fung Sit) - -Changes from 2.18 to 2.19 - -- fixed misplaced symbols (U+2325,2326) in Sans Oblique (by John Karp) -- added Mark to Base anchors: 'cedilla' for combining cedilla and - 'above-legacy' for stacking above precomposed glyphs (just a,e,i,o,u with - macron for now) in Sans (by Denis Jacquerye). -- added contextual substitution for Case and Dotless forms in all Sans variants - (by Denis Jacquerye). -- renamed 'ccmp' lookups for RTL and Basic (LGC, etc.) (by Denis Jacquerye) -- added anchor 'cedilla' for vowels in Sans. (by Denis Jacquerye) -- extended contextual dotless and case substitutions to handle both below and - above diacritics (by Denis Jacquerye) -- renamed Dotless and Case Form GSUB lookups in Sans with meaningful names (by - Denis Jacquerye) - -Changes from 2.17 to 2.18 - -- Re-encoded the source files for Full Unicode (by Ben Laenen) -- Re-enabled the "ff", "fl", "fi", "ffl", "ffi" ligatures by default in Serif - (by Ben Laenen) -- Disabled the "fi", "ffi" ligatures for languages with dotless i in Serif (by - Ben Laenen) -- added Tifinagh to Sans Book and Bold, U+2D30-U+2D65, U+2D6F, partially hinted - in Sans Book. (by Denis Jacquerye) -- added Tai Xuan Jing Symbols (U+1D300-1D356) to Sans (by Remy Oudompheng) -- added double-struck letters (U+1D538-U+1D56B minus reserved code points) to - Sans (by Gee Fung Sit) -- added U+22EE-U+22F1 to Sans (by Gee Fung Sit) -- added U+2C67-U+2C6C, U+2C75-U+2C77 to Serif (by Gee Fung Sit) -- italicized various glyphs in Latin Extended-B, IPA Extensions, Spacing - Modifier Letters, Phonetic Extension (Supplement) and Super- and Subscripts - in Serif Oblique fonts (by Gee Fung Sit) -- modified outlines, bearings of Hebrew U+05D6, U+05D8, U+05DB, U+05DE, U+05E0, - U+05E1, U+05E2, U+05EA in Sans Book and Oblique, adjusted hinting in Book - based on Yotam Benshalom's comments. (by Denis Jacquerye) -- added Braille Patterns (U+2800-U+28FF) to Serif fonts (by Gee Fung Sit) -- added N'Ko to Sans Book and Bold: U+07C0-U+07E7, U+07EB-U+07F5, U+07F8-U+07FA - (by Eugeniy Meshcheryakov) -- added U+0ED8 (Lao digit 8) to Sans (by Remy Oudompheng) -- added Lao diacritics U+0EB0-0EB9, U+0EBB-0EBC, U+0EC8-0ECD to Mono (by Remy - Oudompheng) -- renamed Serif [Bold] Oblique, make it Italic (by Eugeniy Meshcheryakov) -- added U+29FA-U+29FB to Sans and Sans Mono (by Gee Fung Sit) -- swapped glyphs for Eng U+014A from Sami Eng to African Eng, the latter being - more common (by Denis Jacquerye) -- swapped ae U+00E6 and ae.alt in Serif Italics fonts, thus fixing #8213 (by - Denis Jacquerye) -- minor improvements to Misc. Symbols in Sans (by Gee Fung Sit) -- minor improvements and additions to Sans ExtraLight (by Gee Fung Sit) -- improved instructions for various Cyrillic letters (by Eugeniy Meshcheryakov) -- fixed hinting of theta and chi in Sans Book (by Ben Laenen) -- added Georgian Mkhedruli to Sans, Serif and Mono, ASumtavruli to Sans and - Serif (by Besarion Gugushvili) - -Changes from 2.16 to 2.17 - -- Sans fonts: fix position for certain combinations of Arabic fatha, kasra, - shadda, damma, kasratan, dammatan, fathatan and hamza (by Ben Laenen) -- added 'ae.alt' to Serif Oblique fonts, with design matching shape of italic - 'a' instead of slanted 'a', see bug #8213 (by Denis Jacquerye) -- added super- and subscripts to Serif and Mono: U+1D2C-U+1D2E, U+1D30-U+1D3C, - U+1D3E-U+1D42, U+1D62-U+1D65, U+1D78, U+2071, U+207A-U+207E, U+208A-U+208E, - U+2090-U+2094 (by Gee Fung Sit) - -Changes from 2.15 to 2.16 - -- fixed hinting instructions for digits in DejaVu Sans Oblique, Bold Oblique, - and Serif Book to not change glyph width (by Eugeniy Meshcheryakov) -- added instructions for U+0404, U+0411, U+0413, U+0414, U+0417-U+041B, U+041F, - U+0423, U+0424, U+0426-U+0429, U+042C, U+042E, U+042F, U+0490 in Serif Bold - (by Eugeniy Meshcheryakov) -- added U+0220 and Eng.alt to Serif fonts (by Denis Jacquerye) -- added U+232C, U+2394, U+23E3 to Sans fonts (by John Karp) -- added U+230C-U+230F, U+231C-U+231F to Sans fonts, fixing bug:9547 - (by John Karp) -- adjusted dot below, dot above, dieresis above, dieresis below in Sans fonts - (by Denis Jacquerye) -- added U+2300, U+2301, U+2303, U+2304, U+2305, U+2307, U+2326, U+2327, U+232B, - arrow.base to Sans fonts (by John Karp) -- adjusted dot and dieresis below and above in Serif fonts (by Denis Jacquerye) -- added U+1E1C-U+1E1D to Serif fonts (by Denis Jacquerye) -- added U+22BE, U+22BF (by Wesley Transue) -- added U+2324; modified U+2325: more standard proportions, and matches U+2324 - and U+2387; added U+2387 : flipped U+2325 with standard arrowhead - (by John Karp) -- added Lao digits U+0ED0-0ED7, U+0ED9 (by Remy Oudompheng) -- added to Mono in Arabic block : U+060C, U+0615, U+061B, U+061F, - U+0621-U+063A, U+0640-0655, U+065A, U+0660-066F, U+0674, U+0679-0687, U+0691, - U+0692, U+0698, U+06A1, U+06A4, U+06A9, U+06AF, U+06B5, U+06BA, U+06BE, - U+06C6, U+06CC, U+06CE, U+06D5, U+06F0-06F9 (by Remy Oudompheng) -- added to Mono in Arabic Presentations Forms-A : U+FB52-FB81, U+FB8A-FB95, - U+FB9E, U+FB9F, U+FBAA-FBAD, U+FBE8, U+FBE9, U+FBFC-FBFF (by Remy Oudompheng) -- added to Mono in Arabic Presentations Forms-B : U+FE70-FE74, U+FE76-FEFC, - U+FEFF (by Remy Oudompheng) -- added U+05BA, U+05BE, U+05F3, U+05F4, U+FB1E, U+FB21-U+FB28, U+FB4F to Sans - (by Eugeniy Meshcheryakov) -- added U+2102 to Mono (by Eugeniy Meshcheryakov) -- added U+2983-U+2984 to Sans (by Gee Fung Sit) -- added U+2A2F to Sans, Serif and Mono (by Gee Fung Sit) -- added U+2373-2375, U+237A to Sans (by John Karp) -- converted kern pairs to kern classes with Tavmjong Bah's scripts - (by Denis Jacquerye) -- set ScriptLang of kerning classes to just latn because of Pango bug - (by Denis Jacquerye) -- added DNK to ScriptLang latn otherwise it is excluded, and SRB and MDK to - cyrl (by Denis Jacquerye) -- removed flag 0x80 in generate.pe, otherwise it generates kerning tables some - systems don't like; thus loosing Apple tables (by Denis Jacquerye) -- removed ligature for precomposed legacy characters of Sans Oblique fonts - (by Denis Jacquerye) -- added bearings to en dash U+2013, em dash U+2014 and figure dash U+2012 - by making dashes shorter, preserving character width (by Denis Jacquerye) -- reduced U+031C, U+0325 (ring below), U+0339 to be entirely visible; - added instructions in Sans Book; changed U+1e00-U+1e01 to use new ring below - (by Denis Jacquerye) -- adjusted circumflex below on U+1E12-U+1E13, U+1E18-U+1E19, U+1E3C-U+1E3D, - U+1E4A-U+1E4B, U+1E70-U+1E71, U+1E76-U+1E77 in Sans fonts (by Denis Jacquerye) -- Added U+0ED4, U+0ED5 to DejaVu Sans (by Remy Oudompheng) -- Lao-specific anchors (by Remy Oudompheng) -- added alternate I to match the small capital in Sans (by Gee Fung Sit) - -Changes from 2.14 to 2.15 - -- improved hinting in Sans Oblique to deal with some spacing and inconsistency - issues (by Ben Laenen) -- added anchors to Mono Book, and added GPOS rules for combining diacritics to - show up as zero width glyphs (by Ben Laenen) -- removed U+F21C (PUA), it was copy of U+2C64 from Latin Extended C (by Eugeniy - Meshcheryakov) -- added U+27E6-U+27E7 to Sans (by Gee Fung Sit) -- added U+1407, U+1409, U+140C-U+141B, U+141D-U+1425, U+1427-U+142E, - U+1435-U+1438, U+143A-U+1449, U+1452, U+1454, U+1457-U+1465, U+1467-U+146A, - U+1471, U+1474-U+1482, U+1484-U+1488, U+148F, U+1492, U+14A0, U+14A2, U+14A9, - U+14AC-U+14BA, U+14BC, U+14BD, U+14C6, U+14C9-U+14CF, U+14D1, U+14D2, U+14D9, - U+14DC-U+14E9, U+14EC, U+14F3, U+14F6-U+1504, U+1506, U+1507, U+1510-U+1525, - U+152C, U+152F-U+153D, U+1540, U+1541, U+154E, U+154F, U+1552, U+155B, U+155C, - U+1568, U+1569, U+1574-U+157B, U+157D, U+15A7-U+15AE, U+1646, U+1647 (by - Eugeniy Meshcheryakov) -- fixed several contours to not intersect, use horizontal or vertical tangents, - use integer coordinates, etc in Sans Book (by Denis Jacquerye) -- added U+0496-U+0497 in Serif (by Andrey V. Panov) - -Changes from 2.13 to 2.14 - -- added Philippine peso glyph U+20B1 (by Clayborne Arevalo) -- made U+2012 have the same width as digits, according to Unicode 5.0, - page 206 (by Roozbeh Pournader) -- made all of the "above" combining characters remove the dot of "i", - "j", etc (Soft_Dotted characters), according to Unicode 5.0, - page 228 (by Roozbeh Pournader) -- made U+012F, U+03F3, U+0456, U+0458, U+1E2D, and U+1ECB (all fonts - except Mono), U+0249, U+2148, and U+2149 (Sans and Sans Condensed), - U+0268 (Sans ExtraLight, Serif and Serif Condensed), and U+029D (Serif - and Serif Condensed) respect the Soft_Dotted property (by Roozbeh - Pournader) -- added U+223E, U+223F, U+2240, U+22C2, U+22C3 to Sans (by Remy Oudompheng) -- added U+203D to Serif (by Gee Fung Sit) -- added zero-width glyphs for U+2061-U+2063 to Sans and Serif (by Gee - Fung Sit) -- changed isolated forms of Arabic waw (U+0648, U+0624 and U+06C6) (bug #9432) - (by Ben Laenen) -- added Lao consonants U+0E81, U+0E82, U+0E84, U+0E87, U+0E88, U+0E8A, - U+0E8D, U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA, - U+0EAB, U+0EAD-0EAF to Sans Mono (by Remy Oudompheng) -- added U+0200-U+0217, U+0226-U+0229, U+02F3, U+1E00-U+1E07, - U+1E0A-U+1E0B, U+1E18-U+1E1F, U+1E22-U+1E23, U+1E28-U+1E2D, - U+1E3A-U+1E3B, U+1E40, U+1E48-U+1E49, U+1E56, U+1E58-U+1E59, - U+1E5E-U+1E5F, U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, U+1E72-U+1E77, - U+1E86-U+1E8B, U+1E92-U+1E96, U+1EA0-U+1EA1, U+1EF4-U+1EF5 to Mono - (by Ben Laenen) -- renamed uppercase variants of diacritics (macron, breve, double grave, - double acute, inverted breve, dot above) to "uni03XX.case" in Mono - (by Ben Laenen) -- moved uppercase variants of diacritics up in Mono so they properly - vertically align on capitals (by Ben Laenen) -- precomposed glyphs with macron, breve, double grave, double acute, - inverted breve, dot above, macron below, breve below, inverted breve - below, dot below, cedilla, caron below, circumflex below, diaeresis - below, tilde below now reference to combining diacritics instead of - space modifiers in Mono (by Ben Laenen) -- made ring below (U+0325), and half rings below (U+031C and U+0339) - smaller in Mono (by Ben Laenen) -- added U+205F to all fonts (by Roozbeh Pournader) -- added U+035E-U+035F to Sans (by Roozbeh Pournader) -- added empty glyphs for U+034F, U+202A-U+202E, U+2060, U+206A-206F, - U+FE00-U+FE0F to non-Mono fonts (by Roozbeh Pournader) -- added U+2101, U+2107-U+2108, U+210B, U+210C, U+2110, U+2112, U+211B, - U+211F, U+2123, U+2125, U+2128-U+2129, U+212C-U+212D, U+212F, - U+2130-U+2131, U+2133, U+2136-U+213A, U+2141-U+2144, U+2B00-U+2B11, - U+2B20-U+2B23 to Sans (by John Karp) -- reshaped omega (U+03C9) in Mono (by Ben Laenen) -- added U+2205, U+22C6, U+2300-U+2301, U+2303-U+2306, U+230C-U+230F, - U+2312-U+2315, U+231C-U+231F, U+2335, U+2337-U+233E, U+2341-U+2344, - U+2347-U+2348, U+234B-U+234D, U+2349-U+2350, U+2352-U+2354, - U+2357-U+2359, U+235A-U+235C, U+235E-U+2360, U+2363-U+2365, - U+2368-U+2369, U+236B-U+2370, U+2373-U+237A, U+2380-U+2383, - U+2388-U+238B, U+2395 in Mono (by Ben Laenen) - -Changes from 2.12 to 2.13 - -- adjusted U+0198B, U+01B3-U+01B4 in Sans, hinted U+01B4 in Sans Book - (by Denis Jacquerye) -- added U+27F0-U+27FF, U+2906-U+2907, U+290A-U+290B, U+2940-U+2941 to Sans - (by Denis Jacquerye) -- added U+01E6-U+01E9, U+01EE-U+01EF, U+01F4-U+01F5, U+01FC-U+01FF, - U+021E-U+021F, U+0245, U+02BD, U+02C9, U+1E9B, U+2045-U+2046, U+2213, U+22C5, - U+22EF to Sans Mono (by Roozbeh Pournader) -- added U+04FA-U+04FD to Sans (by Michael Everson) -- removed U+2329 and U+232A because of their CJK properties, added U+27E8 - and U+27E9 in their stead, fixing part of bug #9038 (by Roozbeh Pournader) -- corrected and improvised U+0466-U+0469, U+046E-U+0471, U+047C-U+047D, U+0482, - U+0484-U+0486, U+0492-U+0493, U+04B0-U+04B1, U+050C-U+050D, and U+204A - in Sans (by Michael Everson) -- added instructions for U+0402, U+0409, U+040A, U+040B, U+044D, U+040F, - U+0452, U+0459-U+045B, U+045F to Sans Book (by Eugeniy Meshcheryakov) -- made italic shape for U+431, U+432, U+437, U+43B, U+43C, U+43D, U+444, U+447, - U+44D, U+44F, U+459, U+45A in SerifOblique and SerifBoldOblique - (by Andrey V. Panov) -- modified U+024C to match glyph in Unicode chart, fixing bug #9039 - (by Denis Jacquerye) -- made some canonically equivalent characters share the same glyph: - U+02B9 = U+0374, U+0343 = U+0313, and U+0387 = U+00B7 also adjusting U+02BA - to look like double U+02B9, fixing parts of bug #9038 (by Roozbeh Pournader) -- changed shapes for U+0478 and U+0479 in Sans to those in the Unicode charts, - based on a recent decision by Unicode Technical Committee to only use - the digraph form (by Michael Everson) -- adjusted width of NBSP U+00A0 and NNBSP U+202F, fixing bug #8401 - (by Denis Jacquerye) -- fixed several contours to not intersect, use horizontal or vertical tangents, - use integer coordinates, etc (by Roozbeh Pournader and Denis Jacquerye) -- added U+1402, U+1430, U+144D, U+146C, U+148A, U+14A4, U+14C1, U+14D4, U+14EE, - U+1527, U+1545, U+157E, U+158E, U+15AF to Sans (by Eugeniy Meshcheryakov) -- enlarged width of U+459 and U+45A in Serif (by Andrey V. Panov) -- made traditional shape for U+452, U+45B (by Andrey V. Panov) -- added euro sign U+20AC to Sans ExtraLight, making fontconfig recognize - the font as supporting English (by Denis Jacquerye) - -Changes from 2.11 to 2.12 - -- added U+0180 to Serif (by Denis Jacquerye) -- improved and/or hinted Armenian letters U+0542, U+0546, U+0562, - U+0563, U+0564, U+0577, U+0582 in Sans (by Ben Laenen) -- added U+4FE-U+4FF, U+512-U+513, U+2114, U+214E, U+26B2 to Sans - (by Gee Fung Sit) -- adjusted U+0496-U+0497, U+049A-U+04A1 in Sans to match U+0416, - U+041A, U+0436 and U+043A (by Gee Fung Sit) -- Mathematical Operators in Sans: changed U+22C0-U+22C1 to match - other n-ary operators, adjusted U+2203-U+2204, changed U+2220 in - Sans to match the style of U+2221 (by Gee Fung Sit) -- added U+1401, U+1403-U+1406, U+140A, U+140B, U+1426, U+142F, - U+1431-U+1434, U+1438, U+1439, U+1449, U+144A, U+144C, - U+144E-U+1451, U+1455, U+1456, U+1466, U+146B, U+146D-U+1470, - U+1472, U+1473, U+1483, U+1489, U+148B-U+148E, U+1490, U+1491, - U+14A1, U+14A3, U+14A5-U+14A8, U+14AA, U+14AB, U+14BB, U+14C0, - U+14C2-U+14C5, U+14C7, U+14C8, U+14D0, U+14D3, U+14D5-U+14D8, - U+14DA, U+14DB, U+14EA, U+14ED, U+14EF-U+14F2, U+14F4, U+14F5, - U+1405, U+1526, U+1528-U+152B, U+152D, U+152E, U+153E, - U+1542-U+1544, U+1546-U+154D, U+1550, U+1553, U+1555-U+155A, - U+1567, U+156A, U+157C, U+157F-U+1585, U+158A-U+158D, - U+158F-U+1596, U+15A0-U+15A6, U+15DE, U+15E1, U+166E-U+1676 to - Sans (by Eugeniy Meshcheryakov) -- re-enabled Latin ligatures fi, ffi, fl, ffl and ff in Sans - (by Ben Laenen) -- made italic shape for U+436, U+44A, U+44B, U+44C, U+44E, U+45F, - U+463 in SerifOblique and SerifBoldOblique (by Andrey V. Panov) -- fixed sub- and superscript metrics in Condensed Sans (bug #8848) - (by Ben Laenen) -- added U+474, U+475 in Serif (by Andrey V. Panov) -- hinted Greek glyphs U+03B7, U+30B8, U+03B9, U+03C1, U+03C3, - U+03C6 in Mono Book (by Ben Laenen) - -Changes from 2.10 to 2.11 - -- added instructions for Hebrew glyphs (Sans Book, by Eugeniy - Meshcheryakov) -- changed U+01A6 (Latin Yr) after bug #8212, in Sans, Serif and - Sans Mono fonts (by Denis Jacquerye). -- removed instruction for U+2600-U+26A1 (by Mederic Boquien) -- added U+202F and set width of U+00A0 (nobreakingspace) to the - same as U+0020, space (by Denis Jacquerye). -- added and improved instructions for various Cyrillic letters - (by Eugeniy Meshcheryakov) -- Changed U+416, U+42F, U+427 (non-Bold), U+436, U+447 (non-Bold), - U+44F, U+437 (Bold), corrected U+40F, U+414, U+424, U+426, U+429, - U+434, U+438 (Bold), U+446, U+449, U+44D (non-Bold), U+45F in - Sans Mono (by Andrey V. Panov) -- made small corrections to Cyrillic, most appreciable to U+409, - U+413, U+41B, U+427 and U+433, U+434, U+43B, U+447, U+459 - (upright fonts) to Serif (by Andrey V. Panov) -- adjusted bearings of U+410, U+416, U+41A, U+42F, U+436, U+43A, - U+443, U+44F in Serif (by Andrey V. Panov) -- enlarged width of U+44A, U+44B, U+44C, U+463 in Serif - (by Andrey V. Panov) -- added ligature "iacute" as "afii10103" (U+456) "acutecomb" in - Serif (by Andrey V. Panov) -- made italic shape to U+446, U+448, U+449 in Serif (by Andrey V. - Panov) -- added "afii10831" (U+F6C7), "afii10832" (U+F6C8) in Serif (by - Andrey V. Panov) -- new minimum version of fontforge is 20061014 (by Ben Laenen) - -Changes from 2.9 to 2.10: - -- added U+0242, U+024A-U+024B, U+024E-U+024F, U+037C-U+037D, U+0E3F, - U+1D2C-U+1D2E, U+1D30-U+1D42, U+1D5D-U+1D6A, U+1D78, U+1DB8, - U+2090-U+2094, U+20D0-U+20D1, U+2C60-U+2C66, U+2C6B-U+2C6C, U+2C74 and - U+FB29 to Sans (by Gee Fung Sit) -- added Lao glyphs : U+0E81-0E82, U+E084, U+0E87-0E88, U+0E8A, U+0E8D, - U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA-0EAB, - U+0EAD-0EB9, U+0EBB-0EBD, U+0EC0-0EC4, U+0EC6, U+0EC8-0ECD, U+0EDC-0EDD - (by Remy Oudompheng) -- fixed U+0193 not showing in Windows (bug #7897) (by Ben Laenen) -- changes to U+222B-222D in Sans Mono (by Remy Oudompheng) -- ported the three remaining currency symbols from Arev (U+20B0, - U+20B2-U+20B3), and replaced one (U+20AF) in Sans (by Lars Naesbye - Christensen) -- corrected U+20A5 in Sans (by Gee Fung Sit) -- merged Double-Struck Letters from Arev: U+2102, U+210D, U+2115, - U+2119-U+211A, U+2124, U+213C-U+2140 (by Gee Fung Sit) -- added U+2308-U+230B and U+2329-U+232A to Sans Mono and Serif faces, - fixed incorrect direction of U+2329 in Sans faces, and improved - U+2308-U+230B in Sans faces per Ben Laenen's suggestions (by David - Lawrence Ramsey) -- added U+06D5 and final form of it (needed for Kurdish) (by Ben Laenen) -- added two special glyphs U+F000 and U+F001 in Sans Book that show the - current ppem size (horizontal and vertical) (by Ben Laenen) -- added U+2318 and U+2325 to Sans Mono faces, based on the Sans versions - (by David Lawrence Ramsey) -- added U+2B14-U+2B1A to all faces except Sans ExtraLight (by David - Lawrence Ramsey) -- respaced all Geometric Shapes characters in Serif faces to match those - in Sans faces again, respaced U+23CF in Sans, Sans ExtraLight, and - Serif faces to match U+25A0 (or Sans in Sans ExtraLight's case) again, - and respaced U+2B12-U+2B13 in Sans and Serif faces to match U+25A1 - again (by David Lawrence Ramsey) -- corrected width of Modifier Small Letters U+1D43-1D5B in Sans Oblique - and U+1D9B-U+1DBF in Sans Oblique and Sans Bold Oblique (by Gee Fung Sit) -- added a bunch of glyphs to Sans ExtraLight (see SVN for details) (by - Gee Fung Sit) -- adjusted Cyrillic descenders in Sans ExtraLight to sync with Sans (by - Gee Fung Sit) -- added U+0242, U+0245 to Serif (by Gee Fung Sit) -- replaced the SHPIX routines which gave them bad spacing at certain - sizes in FreeType for A, V, Z, v and z in Sans Bold (by Ben Laenen) - -Changes from 2.8 to 2.9: - -- DejaVuSansExtraLight.sfd: changed family name from "DejaVu Sans" to - "DejaVu Sans Light" (in case we add a Light weight variant), so legacy - apps that understand only 4 styles are happy. (by Denis Jacquerye) -- added Name ID 16, aka preferred family name, and Name ID 17, aka - preferred style name, so contemporary apps that understand more that 4 - styles can use big fonts families "DejaVu Sans" and "DejaVu Serif". For - those, Extralight and Condensed are just styles not different families. - (by Denis Jacquerye) -- added U+22B6-22BD, U+22C0-22C1, U+22D6-22D7 to Sans. (by Remy Oudompheng) -- added U+037B, U+2184, U+2C67-U+2C6A and U+2C75-U+2C77 to Sans (by Gee - Fung Sit) -- adjusted asteriskmath (U+2217) for consistency with other mathematical - operators in Sans (by Ben Laenen) -- hinted some Armenian capitals in Sans Book (by Ben Laenen) -- added U+0246 - U+0249 (by Ben Laenen) -- BUGFIX : swapped U+224E and U+224F, in Sans, Sans Condensed and Sans Mono - (by Remy Oudompheng) -- adjusted U+20B5 (by Mederic Boquien) -- swapped U+21DA and U+21DB which were in wrong order (by Heikki Lindroos) -- added U+222E-2233, U+239B-23AD, U+2A00-2A02, U+2A0F-2A1C to Sans (by Remy - Oudompheng) -- added U+239B-23AD to Mono (by Remy Oudompheng) -- added U+2024-2025 to Serif (by Mederic Boquien) -- added U+222C-222D, U+2A0C-2A0E to Serif (by Remy Oudompheng) -- added U+2190-21FF to Mono (by Heikki Lindroos) -- added Hebrew glyphs - U+05B0-U+05BD, U+05BF-U+05C3, U+05C6, U+05C7, - U+05D0-U+05EA, U+05F0-U+05F2, U+FB1F, U+FB20, U+FB2A-U+FB36, - U+FB38-U+FB3C, U+FB3E, U+FB40, U+FB41, U+FB43, U+FB44, U+FB46-U+FB4E (by - Gee Fung Sit and Eugeniy Meshcheryakov) -- adjustments for Cyrillic in Sans (by Andrey V. Panov) -- made italic shape for U+0434, U+0456, U+0457 in SerifOblique and Serif - Bold Oblique (by Andrey V. Panov) - -Changes from 2.7 to 2.8: - -- fixed instructions for U+0423, U+0427, U+0447, U+0448 in Serif, so they - look good at large sizes too (by Eugeniy Meshcheryakov) -- added U+FB00 and U+FB03 to U+FB06 to Serif typefaces (by Heikki Lindroos) -- added U+26B0-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+2727, U+2729 - to U+274B, U+274D, U+274F to U+2752, U+2756, U+2758-U+275E, U+2761 to - U+2775 (by Heikki Lindroos) -- added and improved instructions for Cyrillic letters in Mono and Serif - (Book, by Eugeniy Meshcheryakov) -- rotated U+26B0 (was too small in mono) (by Gee Fung Sit) -- adjusted U+1EDA-U+1EDD, U+1EE8-U+1EEB, capitals using capital specific - accent and moved diacritics to match position on U+00F2 (ograve), etc. - (by Denis Jacquerye) -- added U+20D6, U+20D7 to Sans (by Gee Fung Sit) -- made Armenian ligatures discretionary since the Firefox ligature problem - still isn't fixed (by Ben Laenen) -- moved Armenian hyphen U+058A to a higher position (bug #7436) (by Ben - Laenen) -- hinted Greek glyphs in Sans Bold (by Ben Laenen) -- enabled Arabic lam-alif ligatures when diacritics are used (by Ben Laenen) - -Changes from 2.6 to 2.7: - -- added glyphs needed for Kurdish: U+0695, U+06B5, U+06C6, U+06CE and their - init/medi/fina forms in Sans (by Ben Laenen) -- added U+02CD, U+01F8 - U+01F9, U+1E3E - U+1E3F, U+1E30 - U+1E35, U+1EBC - - U+1EBD, U+1EF8 - U+1EF9 (includes glyphs needed for Yoruba, Maori, Guarani - and Twi) (by Ben Laenen) -- added U+22C8-22CC, U+29CE-29D5, U+2A7D-2AA0, U+2AAE-2ABA, U+2AF9-2AFA to - Sans (by Remy Oudompheng) -- adjusted diacritics on Vietnamese, Pinyin and other characters: - U+01A0-U+01A1, U+01AF-U+01B0, U+01D5-U+01DC, U+01DE-01E1, U+01FA-U+01FB - U+022A-U+022D, U+0230-U+0231, U+1E14-U+1E17, U+1E4C-U+1E53, U+1E78-U+1E7B, - U+1EA4-U+1EF1 in Sans (Book, Bold and Oblique) (by Denis Jacquerye) -- added basic arrows U+2190-U+2193 in Serif, which completes MES-1 compliance - for Serif (by Ben Laenen) -- added U+01E4, U+01E5, U+01FA, U+01FB, U+02BD, U+02C9 and U+02EE to Serif - (by Ben Laenen) -- fixed U+0209 in Serif Bold Oblique (by Ben Laenen) -- adjusted Box Drawing block characters U+2500-257F in Mono to fit character - cell, shifting them up by 416 (Denis Jacquerye) -- redid U+0194 in Sans (by Ben Laenen) -- added U+2217-2218, U+2295-22A1 to Mono (by Remy Oudompheng) -- added U+0462 to Serif (by Andrey V. Panov) -- added U+226C, U+228C-228E, U+2293-2294, U+22F2-22FF to Sans (by Remy - Oudompheng) -- adjusted U+2208-220D in Sans (by Remy Oudompheng) -- improved some Cyrillic glyphs in Mono (by Andrey V. Panov), rewritten - instructions for changed glyphs (by Eugeniy Meshcheryakov) -- added U+1E0E-1E0F, U+1E8E-1E8F to Mono fonts (by Denis Jacquerye). (bug - #7166) -- renamed 'Dotabove' to 'Dotaccent' in Mono Sans Oblique to match other fonts - (by Denis Jacquerye). -- added U+200B-U+200F in Sans faces and Serif faces, U+200B and U+200C were - in Sans already (by Lars Naesbye Christensen) -- added U+2601-U+262F, U+263D, U+263E, U+2648-U+265F, U+2668, U+2670-U+268B, - U+2690-U+269C, U+26A0, U+26A1, U+2794, U+2798-U+27AF, U+27B1-U+27BE to Mono - (by Heikki Lindroos) -- replaced the references with unshifted ones for both κ U+03BA and к U+043A - in Mono Book (by Denis Jacquerye) -- fixing glyph for U+04ED in Mono Book, consisted only of dieresis (by Andrey - V. Panov). - -Changes from 2.5 to 2.6: - -- redid U+2032 - U+2037, U+2057 based on Arev in Sans (by Gee Fung Sit) -- added U+0195, corrected U+039E, U+204B in Sans ExtraLight (by Gee Fung Sit) -- added instructions for some Cyrillic letters in Sans Bold (by Eugeniy - Meshcheryakov) -- added vulgar fractions U+2153-U+215F for Serif, made with references (by - Lars Naesbye Christensen) -- added U+228F-2292, U+2299-22AF, U+22B2-22B5, U+22CD, U+22D8-22ED to Sans - (by Remy Oudompheng) -- added U+2208-220D, U+2238-223D, U+2278-2281, U+228A-228B, U+228F-2292, - U+22CD, U+22DA-22E9 to Mono (by Remy Oudompheng) -- fixed misplaced dot in U+2250 in Mono (by Remy Oudompheng) -- added instructions for some Cyrillic letters in Mono Book and Bold(by - Eugeniy Meshcheryakov) -- minor changes to U+2241, U+2261-2263, U+22A4, U+22A5 in Sans (by Remy - Oudompheng) -- added hinting instructions to lowercase Armenian glyphs in Sans Book (by - Ben Laenen) -- changed U+2208, U+220B to match U+2209 and U+220C in Sans Bold (by Remy - Oudompheng) -- added Braille patterns U+2800-U+28FF to Sans (by Mederic Boquien) -- added instructions for some Cyrillic letters in Serif Book (by Eugeniy - Meshcheryakov) -- renamed BoldOblique fonts to Bold Oblique in TTF Name as originally in - Bitstream Vera fonts (by Denis Jacquerye) -- added hinting instructions to some Latin-B Extended and IPA characters in - Sans Book (by Denis Jacquerye and Ben Laenen) -- adjusted bearings, replaced diacritics, hinted hook and horn for - Vietnamese in Sans Book (by Denis Jacquerye) -- made FAX, TM, TEL, etc. discritionary ligatures in Sans and Serif fonts - (by Denis Jacquerye) -- removed ligatures of precomposed characters in Sans and Serif fonts (by - Denis Jacquerye) -- added U+F208, U+F20A, U+F215-F217, U+F21A-F21B, U+F25F in PUA (from SIL's - PUA, probably in Unicode 5.0): U+0243, U+0244, U+0245, U+024C, U+024D, - U+2C64, (U+2C6D), (U+2C71) -- modified some glyphs in Serif Oblique to make them more italic (by Denis - Jacquerye) - -Changes from 2.4 to 2.5: - -- fixed excessive kerning bug that occurs with Pango (by Denis Jacquerye) -- added U+20AF to Sans and Serif (by Lars Naesbye Christensen) -- regenerated Condensed faces (by Ben Laenen) -- added U+035C-U+035D to Sans, fixed U+0361 (by Denis Jacquerye) -- integrated 255 characters from Arev fonts: Latin Extended-B, Spacing - Modifiers, Combining Diacritical Marks, Cyrillic, Cyrillic supplement, - General Punctuation, Letterlike Symbols, Arrows, Mathematical Operators, - Miscellaneous Technical, Dingbats, Alphabetic Presentation Forms (by Denis - Jacquerye) -- added basic Cyrillic and basic Greek to Sans ExtraLight (by Denis Jacquerye) -- added U+0498, U+049A, U+04AA, U+04AB, U+04AF to Serif (by Eugeniy - Meshcheryakov) -- added U+0494, U+0495, U+0498, U+0499, U+04AA, U+04AB, U+04C3, U+04C4, - U+04C7, U+04C8 to Mono (by Eugeniy Meshcheryakov) -- adjusted weight of U+0256, U+0257, U+0260, U+0272, U+0273, U+0277, U+029B, - U+02A0 and modifed U+028B and U+027A in Mono (by Denis Jacquerye) -- added U+2000-200A to Mono (by Denis Jacquerye) -- added vulgar fractions U+2153 - U+215F to Mono (by Gee Fung Sit) -- adapted metrics of Arabic glyphs so they stay above cut-off height in Sans - (by Ben Laenen) -- fixed mkmk anchors for Arabic diacritics so they stack properly in Sans (by - Ben Laenen) -- fixed weight of lowercase upsilon in Sans Bold, make small adjustment to - lowercase omega in Sans (by Ben Laenen) -- added U+210E (by Mederic Boquien) -- unslanted U+2201, U+221B and U+221C in Sans Oblique (by Mederic Boquien) -- added several mathematical relation symbols to Sans and Mono (U+2241-224C, - U+2250-2255, U+2260-2269, U+226E-2277, U+2282-2287) modified U+223C to match - other tildes, and U+2282-2284 to have the same shape. (by Remy Oudompheng) -- made U+2234-U+2237 refer to U+2219 instead of U+00B7 in Sans (by Mederic - Boquien) -- added U+2238-223B, U+226A-226B, U+2278-2281, U+2288-228B to Sans (by Remy - Oudompheng) -- unslanted and changed reference of U+22C5 from U+00B7 to U+2219 in Sans (by - Mederic Boquien) -- added U+224D-225F, U+226D, U+22C6 to Sans and unslanted U+2219 in Sans - Oblique. (by Remy Oudompheng) -- added U+224D-225F, U+226D to Mono, shifted U+2266-2269 higher upwards and - unslanted U+2219 in Oblique. (by Remy Oudompheng) -- merged Coptic glyphs from Arev 0.2 (by Lars Naesbye Christensen) -- fixed and adjusted various Cyrillic glyphs in Serif (by Andrey V. Panov) -- made fi, fl... ligatures discretionary ligatures (by Ben Laenen) - -Changes from 2.3 to 2.4: - -- added U+04A2, U+04A3, U+04AC - U+04AF, U+04BA, U+04BB, U+04C0 - - U+04C2, U+04CB, U+04CD, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04E8 - U+04F5, - U+04F6 - U+04F9 to Mono (by Eugeniy Meshcheryakov) -- added U+048C, U+048D, U+0494, U+0495, U+049E - U+04A7, U+04AC - - U+04AE, U+04B4- U+04B7, U+04BA, U+04BB, U+04C0 - U+04C4, U+04C7, U+04C8, - U+04CB, U+04CC, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04EC - U+04F9 to Serif - (by Eugeniy Meshcheryakov) -- added U+2134 to Sans (by Gee Fung Sit) -- added U+2080 - U+2089 to all faces (by Gee Fung Sit) -- several minor corrections to Sans (by Gee Fung Sit) -- major corrections to Sans Condensed (by Gee Fung Sit) -- corrected Superscripts and Subscripts in Sans (by Gee Fung Sit) -- corrected anchors of U+0316-U+0319 (by Denis Jacquerye) -- Verajja integrated (by Stepan Roh) -- copied U+2328, U+2600, U+2639-U+263C, U+263F-U+2647, U+2660-U+2667, - and U+2669-U+266F from Sans to Serif, and copied scaled-down versions of - them to Sans Mono (by David Lawrence Ramsey) -- added U+20B4 to all faces (by Eugeniy Meshcheryakov) -- added more minor positional adjustments to U+2638 in all faces to - match the other miscellaneous symbols in Verajja, and rescale it in Sans - Mono so that it looks better (by David Lawrence Ramsey) -- added U+2242, U+2243 and U+22A4 (by Mederic Boquien) -- corrected U+2245 in Sans (by Mederic Boquien) -- added U+0221, U+0234-0236 (by Denis Jacquerye) -- added in Arabic block to Sans: U+060C, U+0615, U+061B, U+061F, U+0621 -- U+063A, U+0640 - U+0655, U+0660 - U+066F, U+0679 - U+0687, U+0698, U+06A1, - U+06A9, U+06AF, U+06BA, U+06BF, U+06CC, U+06F0 - U+06F9 (by Ben Laenen) -- added in Arabic Presentation Forms A to Sans: U+FB52 - U+FB81, U+FB8A -- U+FB95, U+FB9E - U+FB9F, U+FBE8 - U+FBE9, U+FBFC - U+FBFF (by Ben Laenen) -- added complete Arabic Presentation Forms B to Sans: U+FE70 - U+FE74, - U+FE76 - U+FEFC, U+FEFF (by Ben Laenen) -- added complete Greek Extended block to Mono (by Ben Laenen) -- modified Greek capitals with tonos in Mono (by Ben Laenen) -- added U+01C4-01CC, U+01D5, U+01DE, U+01E0-U+01E1, U+01E6-U+01E9, - U+01EE-U+01F5, U+01F8-U+0217, U+021E-U+021F, U+0226-U+022A, U+022C to Serif - (by Denis Jacquerye) -- adjusted U+043B and U+044F in Serif (by Denis Jacquerye) -- added U+2000-U+200A (by Denis Jacquerye) -- added U+1E00-U+1E0B, U+1E0E-U+1E11, U+1E14-U+1E1C, U+1E1E-U+1E23, - U+1E26-U+1E2D, U+1E30-U+1E35, U+1E3A-U+1E3B, U+1E3E-U+1E40, U+1E48-U+1E49, - U+1E50-U+1E56, U+1E58-U+1E59, U+1E5E-U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, - U+1E72-U+1E7D, U+1E86-U+1E9B, U+1EA0-U+1EA3, U+1EAC-U+1EB7, U+1EBA-U+1EBD, - U+1EC6-U+1ECF, U+1ED8-U+1ED9, U+1EE6-U+1EE7, U+1EF4-U+1EF9 to Serif (by - Denis Jacquerye) -- added U+048E, U+048F, U+049C-U+049F, U+04B8, U+04B9, U+04BC-U+04BF, - U+04C3, U+04C4 to Sans (by Eugeniy Meshcheryakov) -- added DejaVu Sans Extra Light (by Denis Jacquerye) -- Adjusted underline position for (hopefully) improved legibility in - Sans, Serif, Mono (Tim May) -- added auto-generated DejaVu LGC (by Stepan Roh) - -Changes from 2.2 to 2.3: - -- fixed bug U+042B and U+044B behave badly in Sans Bold or Oblique (by - Keenan Pepper) -- added and improved TrueType instructions and related settings (by - Keenan Pepper) -- added U+04D0-U+04D7, U+04E6, U+04E7 to Mono (by Eugeniy Meshcheryakov) -- added U+048A - U+048D, U+0498, U+0499, U+04AA, U+04AB, U+04B0, U+04B1, - U+04C0, U+04C9, U+04CA, U+04CE, U+04CD, U+04DA, U+04DB, U+04DE, U+04DF, - U+04E2 - U+04E5, U+04EC - U+04F8, U+04F9 to Sans (by Eugeniy Meshcheryakov) -- added U+04E0, U+04E1 to all faces (by Eugeniy Meshcheryakov) -- added Greek Extended to Sans and Serif: U+1F00-U+1F15, U+1F18-U+1F1D, - U+1F20-U+1F45, U+1F48-U+1F4D, U+1F50-U+1F57, U+1F59, U+1F5B, U+1F5D, - U+1F5F-U+1F7D, U+1F80-U+1FB4, U+1FB6-U+1FC4, U+1FC6-U+1FD3, U+1FD6-U+1FDB, - U+1FDD-U+1FEF, U+1FF2-U+1FF4, U+1FF6-U+1FFE (by Ben Laenen) -- added Greek variant letterforms, archaic letters and symbols to Mono: - U+03D0-U+03E1, U+03F0-U+03FF (by Ben Laenen) -- added Armenian block and Armenian ligatures to Sans (U+0531 - U+0556, - U+0559 - U+055F, U+0561 - U+0587, U+0589 - U+058A, U+FB13 - U+FB17) (by Ben - Laenen) -- redid some Greek characters in Sans and Mono to make them look better - and to correct some errors (by Ben Laenen) -- added U+27E0 to all faces (by David Lawrence Ramsey) -- added underscore (U+005F) consistency fixes: extended the Sans Mono - and Sans Mono Oblique underscores to touch both horizontal edges, and - reduced the height of the Sans Bold Oblique underscore to match the Sans - Bold underscore (by David Lawrence Ramsey) -- added underscore (U+005F) derivatives and consistency fixes for them: - made U+0332 a reference to underscore at Denis Jacquerye's suggestion; made - U+0333 two references to underscore; made U+033F two references to U+203E; - added U+2017 as two references to underscore, and made U+0333 a reference to - it; and added U+203E as a reference to underscore, and made U+0305 a - reference to it (by David Lawrence Ramsey) -- added U+201B, U+2220, U+2320-U+2321, U+23AE, U+23CF, all remaining - Geometric Shapes glyphs (U+25A0-U+25C9, U+25CB-U+25D7, U+25D9-U+25E5, - U+25E7-U+25FF), and U+2B12-U+2B13 to all faces (by David Lawrence Ramsey) -- added minor positional adjustments to U+2638 in all faces (by David - Lawrence Ramsey) -- added U+201F to Sans Mono and Serif faces (by David Lawrence Ramsey) -- added U+01B7, U+01F6, U+0464 - U+0465, U+2160 - U+2180, U+2183, - U+220A, U+220D, U+2329, U+232A, U+2422, U+27E8 - U+27EB, U+2680 - U+2685 to - Sans (by Gee Fung Sit ???) -- added U+2116 to Sans and Serif (by Gee Fung Sit) -- changed florin sign U+0192 in Sans (by Gee Fung Sit) -- added anchor points to some glyphs (by Denis Jacquerye) -- adjusted height of IPA superscripts U+02B0-02B8, U+02C0-02C1, - U+02E0-02E4, U+207F to match with height of U+00B2 (by Denis Jacquerye) -- added U+0184-U+0185, U+019C, U+019F, U+01A0-U+01A3, U+01A6, U+01AA, - U+01AF-U+01B0, U+01B2-U+01B4, U+01B7-U+01B8, U+01BC-U+01BC, U+0224-U+0225, - U+023A-U+0240, U+1D16-U+1D17, U+1D1D-U+1D1E, U+1D43-U+1D5B, U+1D7B, - U+1D85,U+1D9B-1DB7, U+1DB9-U+1DBF, U+20A6 to all fonts (by Denis Jacquerye) -- added added U+0182, U+018B, U+018E, U+01A0-U+01A1, U+01B1, U+01B9, - U+01C0-U+01C3, U+0238-U+0239, U+1D02, U+1D08-U+1D09, U+1D14, U+1D1F, U+1D77 - to Serif and Mono (by Denis Jacquerye) -- added U+0181, U+0183, U+0187-U+0188, U+018A-U+018F, U+0191, U+0193, - U+0195-U+019B, U+019D-U+019E, U+01A4-U+01A5, U+01AC-U+01AE, U+01B5-U+01B6, - U+01B9, U+01BB, U+01F6 to Serif (by Denis Jacquerye) -- added U+0181, U+0187-U+0188, U+018A, U+018D, U+018F, U+0191, U+0193, - U+0195-U+019F, U+01A4-01A5, U+01AC-01AD, U+01B5-U+01B6, U+1BB, U+01F6, - U+01D7-U+01DC, U+0238-U+0239, U+0241 to Mono (by Denis Jacquerye) -- added to Mono and Serif (by Denis Jacquerye) - -Changes from 2.1 to 2.2: - -- reworked the vertical orientation of the Blocks Elements characters - in all faces to remove their overly large descenders, in order to fix - problems with e.g. terminal emulators (by David Lawrence Ramsey) -- copied bullet in Sans faces to Serif faces for consistency (by David - Lawrence Ramsey) -- added U+2023, U+25D8, U+25E6, and U+29EB to all faces (by David - Lawrence Ramsey) -- added U+1EB8, U+1EB9, U+1ECA - U+1ECD, U+1EE4, U+1EE5 (by Tim May) -- added U+01DD, U+02BE, U+02BF, U+02D3 to all, changed U+02D2 in - non-Condensed and U+1EE5 in Serif (by Tim May) -- fixed U+01CE, replacing wrong circumflex by caron (by Denis Jacquerye) -- added anchor points to some glyphs (by Denis Jacquerye) -- added U+20B5 (by Denis Jacquerye) -- added U+0181 - U+0183, U+0187, U+0188, U+018A - U+018D, U+0191, - U+0193, U+0195 - U+019B, U+019D, U+019E, U+01A4, U+01A7 - U+01A9, U+01AB - - U+01AE, U+01B1, U+01B5, U+01B6, U+01BB, U+01C0 - U+01C3, U+01F1 - U+01F3, - U+0238, U+0239, U+1D02, U+1D08, U+1D09, U+1D14, U+1D1F, U+1D77, U+2103, - U+2126, U+2127, U+212A, U+212B, U+2132, U+214B, U+2210, U+2217, U+2218, - U+2A0C - U+2A0E, U+FB00, U+FB03 and U+FB04 to Sans (by Gee Fung Sit) -- added U+01A9, U+01C3 and U+2126 to Mono and Serif (by Gee Fung Sit) -- adjusted bearings of U+028B in Sans (by Gee Fung Sit) -- added U+018F, U+0494-U+0497, U+04A0-U+04A7, U+04AC-U+04AF, - U+04B4-U+04B7, U+04BA-U+04BB, U+04C1-U+04C2, U+04C5-U+04C8, U+04CB-U+04CC, - U+04D0-U+04D9, U+04DC-U+04DD, U+04E6-U+04EB to Sans (by Eugeniy - Meshcheryakov) -- replaced with references U+0391-U+0393, U+0395-U+0397, U+0399, U+039A, - U+039C, U+039D, U+039F-U+03A1, U+03A4, U+03A5, U+03A7, U+03BF, U+03DC, - U+0405, U+0406, U+0408, U+0410, U+0412, U+0415, U+0417, U+041A, - U+041C-U+041E, U+0420-U+0422, U+0425, U+0430, U+0435, U+043E, U+0440, - U+0441, U+0443, U+0445, U+0455-U+0458 in Serif and Mono (by Eugeniy - Meshcheryakov) -- added U+04D0-U+04D7, U+04E6-U+04EB to Serif (by Eugeniy Meshcheryakov) -- added U+212A and U+212B to the rest of the faces (by Lars Naesbye - Christensen) -- added U+2318 and U+2325 to Sans and Serif (by Lars Naesbye Christensen) -- added and improved TrueType instructions and related settings (by - Keenan Pepper) -- completed basic Greek alphabet: added U+0374-U+0375, U+037A, U+037E, - U+0384-U+038A, U+038C, U+038E-U+0390, U+03AC-U+03BF, U+03C1-U+03CE (by Ben - Laenen) -- added U+2070 and U+2074-U+2079 (by Mederic Boquien) - -Changes from 2.0 to 2.1: - -*** Be aware that names of some TTF files changed since version 2.0. *** - -- added U+0323, U+1E0C, U+1E0D, U+1E24, U+1E25, U+1E36 - U+1E39, U+1E42, - U+1E43, U+1E46, U+1E47, U+1E5A - U+1E5D, U+1E62, U+1E63, U+1E6C, U+1E6D, - U+1E7E, U+1E7F (by Tim May) -- fixed bug where GNOME applications used Mono Bold Oblique instead of - Mono Oblique (by Keenan Pepper) -- added and improved TrueType instructions and related settings (by - Keenan Pepper) -- added U+1E41, U+1E57, U+1E61 (by Sander Vesik) -- added U+0189, U+0309, U+0313, U+0314, U+031A, U+031B, U+0327, U+0328, - U+032B, U+0333, U+033C (by Denis Jacquerye) -- adjusted and fixed U+0186, U+0254, U+0291, U+0316 - U+0319, U+031C - - U+0320, U+0323 - U+0326, U+0329 - U+032A, U+032C - U+0332, U+0339 - U+033B, - U+033E, U+033F (by Denis Jacquerye) -- fixed U+1E12, U+1E3C, U+1E4A, U+1E70 to have normal below diacritics - (by Denis Jacquerye) -- fixed U+1E82, U+1E84 and U+1EF2 to have uppercase above diacritics (by - Denis Jacquerye) -- added anchor points to some glyphs (by Denis Jacquerye) -- dropped "-Roman" from font names - affects both internal TTF names and - names of generated files (by Stepan Roh) -- attempt to fix bug Vertical spacing too big for Mono by exchanging - LineGap and OS2TypoLinegap values (proofed by Stefan Rank) -- added Greek capitals U+0391 - U+03A1, U+03A3 - U+03A9, U+03AA, U+03AB - in Mono (by Ben Laenen) -- added the per ten thousand sign U+2031 (by Mederic Boquien) -- added U+2207, U+221D, U+221F, U+2227 - U+222A, and U+2261 (by David - Lawrence Ramsey) -- new logo (by Gee Fung Sit) -- added U+0180, U+018E, U+201F, U+2024, U+2025, U+203D, U+2200, U+2203, - U+2213, U+222C, U+222D, U+2263 to Sans (by Gee Fung Sit) - -Changes from 1.15 to 2.0: - -- "Italized" basic glyphs in all Serif Oblique and their Condensed faces - (by David Jez) -- added and improved TrueType instructions and related settings (by Keenan - Pepper) -- added anchor points to some glyphs (by Denis Jacquerye) -- many new spacing and combining accents (by Denis Jacquerye) -- smart substitutions for transforming i and j to dottless form and for - using uppercase diacritics (by Denis Jacquerye) -- fixed remaining erroneously slanted characters in Serif Oblique faces (by - David Lawrence Ramsey) -- copied bullet in Sans faces to Sans Oblique faces for consistency (by - David Lawrence Ramsey) -- added U+203C and U+2047-U+2049 (by David Lawrence Ramsey) -- added Greek glyphs to Serif (by Ben Laenen, Condensed merge by David Jez) -- fixed bug LTR glyphs behaving like RTL (by Ben Laenen) -- fixed wrong glyph directions (by David Jez) -- fixed repositioned accents in Condensed faces (by David Jez) - -Changes from 1.14 to 1.15: - -- added and improved TrueType instructions and related settings (by Keenan - Pepper) -- fixed U+2302, U+2319 (by David Lawrence Ramsey) -- fixed yet another monospace bug (by Stepan Roh) -- fixed potential "too big ascender/descender" bug (by Stepan Roh) -- fixed U+026E and U+028E (by Denis Jacquerye) -- added U+0186, U+0190, U+0300 - U+0304, U+0306 - U+0308, U+030A - U+030C, - U+0321, U+0322 (by Denis Jacquerye) -- added rest of Block Elements: U+2591 - U+2593 (by David Lawrence Ramsey) -- added U+2311, U+237D and U+2638 (by David Lawrence Ramsey) -- added U+01CD - U+01D4 (by Denis Jacquerye) -- fixed accents of U+00F2 - U+00F6 by replacing them with references in Mono - Bold (by David Jez) -- added U+0490, U+0491 (by Eugeniy Meshcheryakov) -- added hints to U+0404 and U+0454 in Sans (by Eugeniy Meshcheryakov) -- completed Greek glyphs from U+0370 to U+03CF in Serif (by Ben Laenen) -- fixed shape of U+0255 in Sans Bold and Sans Bold Oblique (by Denis - Jacquerye) - -Changes from 1.13 to 1.14: - -- fixed bug where Mono faces were not recognized as fixed pitch in Windows - by correcting Venda glyphs (by David Jez) -- added and improved TrueType instructions (by Keenan Pepper) -- added 6 Uzbekian glyphs (by Mashrab Kuvatov) -- added Greek glyphs to Sans and Serif, changed pi and omega to fit in (by - Ben Laenen) -- added IPA and related superscript glyphs (by Denis Jacquerye) -- fixed buggy Venda glyphs (by David Lawrence Ramsey and Stepan Roh) -- added U+2302, U+2310, U+2319 (by David Lawrence Ramsey) -- fixed slanted U+00AC in Serif Oblique faces (by David Lawrence Ramsey) -- added 29 glyphs from Block Elements (by David Lawrence Ramsey) - -Changes from 1.12 to 1.13: - -- removed all stems (PS hints) (requested by David Jez) -- added U+01D6, U+01DF, U+022B, U+022D and U+0231 (by Sander Vesik) -- added 10 Venda glyphs (by Dwayne Bailey) -- fixed bug when fonts had no name on Microsoft Windows (by Stepan Roh) -- updated 'missing' glyph U+FFFD (by David Jez) -- set TTF flag fsType to 'Installable Embedding' (= unrestricted usage) - (idea by C. Tiffany) - -Changes from 1.11 to 1.12: - -- added long s (by James Cloos) -- prettier comma accent in gcommaaccent (by David Jez) -- added Hbar, hbar, kgreenlandic, napostrophe, Eng, eng, Tbar, tbar, - afii57929 (by David Jez) -- changed Iogonek, iogonek, IJ, ij to look better (by David Jez) -- glyph uni0237 renamed to dotlessj (requested by David Jez) -- fixed accents for dcaron, lcaron, tcaron, Uogonek, uogonek in Serif (by - David Jez) -- added U+2500 - U+257F box drawing glyphs to Sans Mono (by David Jez) -- fixed accents in Wcircumflex, Ycircumflex and Zdotaccent (by David Jez) -- extra kerning for F (by Sander Vesik) -- added 'missing' glyph U+FFFD (by David Jez) - -Changes from 1.10 to 1.11: - -- kerning updates (by Sander Vesik) -- added Iogonek, iogonek, IJ, ij, Uogonek, uogonek (from SuSE standard fonts - by Adrian Schroeter, SuSE AG) -- added Gcommaaccent, gcommaaccent, Kcommaaccent, kcommaaccent, - Lcommaaccent, lcommaaccent, Ncommaaccent, ncommaaccent, Rcommaaccent, - rcommaaccent (by Stepan Roh) - -Changes from 1.9 to 1.10: - -- added U+022E, U+022F (by Sander Vesik) -- kerning updates for DejaVu Sans (by Sander Vesik) -- fixed too wide cyrillic glyphs in DejaVu Sans Mono (by Valentin Stoykov) -- fixed ligatures bug in Mono (by Stepan Roh) - -Changes from 1.8 to 1.9: - -- integrated Arev Cyrillics (by Danilo Segan) -- added U+01EA, U+01EB, U+01EC, U+01ED (by Sander Vesik) - -Changes from 1.7 to 1.8: - -- fixed accents in Serif Oblique and Serif Bold Oblique (by Stepan Roh) - -Changes from 1.6 to 1.7: - -- added automatically generated Condensed typefaces (by Stepan Roh) - -Changes from 1.5 to 1.6: - -- monospace bug fixed (by Stepan Roh) -- incorrect Bitstream foundry assigned by fontconfig and KDE Font Installer -fixed (by Stepan Roh) -- added automatically generated Oblique version of Serif typefaces (by -Stepan Roh) -- corrected cyrillic D and d (by Danilo Segan and David Jez) -- fixed accents position in Oblique version of Serif typefaces (by Danilo -Segan and Sander Vesik) -- fixed incorrect computation of OS2Win* fields (by Stepan Roh) -- added visiblespace U+2423 (by David Jez) -- fixed 'line height' bug by fixing ascender and descender values (by David -Jez and Stepan Roh) -- fixed part of 'worse than Vera' bug (by Peter Cernak) -- smaller comma accent U+0326 (by David Jez) - -Changes from 1.4 to 1.5: - -- added Cyrillics (96 characters) and Dcroat to the rest of typefaces (by -Danilo Segan) -- fixed bugs in some Cyrillic characters, some of them reported by Sander -Vesik (by Danilo Segan) -- added U+0100, U+0101, U+0112, U+0113, U+012A, U+012B, U+014C, U+014D, -U+016A, U+016B, U+01E2, U+01E3, U+0232 and U+0233 (by Sander Vesik) -- added Romanian characters (by Misu Moldovan) -- added U+0108, U+0109, U+010A, U+010B, U+0114, U+0115, U+0116, U+0117, -U+011C, U+011D, U+0120, U+0121, U+0124, U+0125, U+0128, U+0129, U+012C, -U+012D, U+0134, U+0135, U+014E, U+014F, U+0150, U+0151, U+015C, U+015D, -U+0168, U+0169, U+016C, U+016D, U+0170, U+0171 and U+0237 (by James -Crippen) -- added U+02BB, U+2010, U+2011, U+2012 and U+2015 (by Stepan Roh) - -Changes from 1.3 to 1.4: - -- added Polish characters (Aogonek, aogonek, Eogonek, eogonek, Nacute, -nacute, Sacute, sacute, Zacute, zacute, Zdotaccent, zdotaccent) (by Stepan -Roh) - -Changes from 1.2 to 1.3: - -- added Cyrillics (96 characters) and Dcroat to Sans typefaces (by Danilo -Segan from his BePa fonts) - -Changes from 1.1 to 1.2: - -- added Ldot, ldot, Wcircumflex, wcircumflex, Ycircumflex, ycircumflex, - Wgrave, wgrave, Wacute, wacute, Wdieresis, wdieresis, Ygrave and ygrave - (from The Olwen Font Family 0.2 by Dafydd Harries) - -Changes from 1.0 to 1.1: - -- added Lacute, lacute, Lcaron, lcaron, Racute and racute (by Peter Cernak) - -Changes from 0.9.4 to 1.0: - -- none, just changed version and updated README - -Changes from 0.9.3 to 0.9.4: - -- fixed TTF generation (kerning tables were missing) - -Changes from 0.9.2 to 0.9.3: - -- kerning of added characters -- proper caron shape for dcaron in Mono (by Ondrej Koala Vacha) -- minor visual changes - -Changes from 0.9.1 to 0.9.2: - -- internal bugged version - -Changes from 0.9 to 0.9.1: - -- proper caron shape for dcaron and tcaron -- minor visual changes - -$Id: NEWS 2359 2009-08-27 14:13:16Z ben_laenen $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/README b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/README deleted file mode 100644 index 0bcc3aa3b5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/README +++ /dev/null @@ -1,59 +0,0 @@ -DejaVu fonts 2.30 (c)2004-2009 DejaVu fonts team ------------------------------------------------- - -The DejaVu fonts are a font family based on the Bitstream Vera Fonts -(http://gnome.org/fonts/). Its purpose is to provide a wider range of -characters (see status.txt for more information) while maintaining the -original look and feel. - -DejaVu fonts are based on Bitstream Vera fonts version 1.10. - -Available fonts (Sans = sans serif, Mono = monospaced): - -DejaVu Sans Mono -DejaVu Sans Mono Bold -DejaVu Sans Mono Bold Oblique -DejaVu Sans Mono Oblique -DejaVu Sans -DejaVu Sans Bold -DejaVu Sans Bold Oblique -DejaVu Sans Oblique -DejaVu Sans ExtraLight (experimental) -DejaVu Serif -DejaVu Serif Bold -DejaVu Serif Bold Italic (experimental) -DejaVu Serif Italic (experimental) -DejaVu Sans Condensed (experimental) -DejaVu Sans Condensed Bold (experimental) -DejaVu Sans Condensed Bold Oblique (experimental) -DejaVu Sans Condensed Oblique (experimental) -DejaVu Serif Condensed (experimental) -DejaVu Serif Condensed Bold (experimental) -DejaVu Serif Condensed Bold Italic (experimental) -DejaVu Serif Condensed Italic (experimental) - -All fonts are also available as derivative called DejaVu LGC with support -only for Latin, Greek and Cyrillic scripts. - -For license information see LICENSE. What's new is described in NEWS. Known -bugs are in BUGS. All authors are mentioned in AUTHORS. - -Fonts are published in source form as SFD files (Spline Font Database from -FontForge - http://fontforge.sf.net/) and in compiled form as TTF files -(TrueType fonts). - -For more information go to http://dejavu.sourceforge.net/. - -Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: ---------------------------- -U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223, -U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5, -U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362, -U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9, -U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F, -U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135, -U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704, -U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794, -U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06 - -$Id: README 2359 2009-08-27 14:13:16Z ben_laenen $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/langcover.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/langcover.txt deleted file mode 100644 index 8289ef4857..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/langcover.txt +++ /dev/null @@ -1,242 +0,0 @@ -This is the language coverage file for DejaVu fonts -($Id$) - - Sans Serif Sans Mono -aa Afar 100% (62/62) 100% (62/62) 100% (62/62) -ab Abkhazia 100% (90/90) 93% (84/90) 84% (76/90) -af Afrikaans 100% (69/69) 100% (69/69) 100% (69/69) -ak Akan 100% (73/73) 100% (73/73) 100% (73/73) -am Amharic (0/264) (0/264) (0/264) -an Aragonese 100% (66/66) 100% (66/66) 100% (66/66) -ar Arabic 100% (125/125) (0/125) 100% (125/125) -as Assamese (0/64) (0/64) (0/64) -ast Asturian/Bable/Leonese/Asturleonese 100% (66/66) 100% (66/66) 100% (66/66) -av Avaric 100% (67/67) 100% (67/67) 100% (67/67) -ay Aymara 100% (60/60) 100% (60/60) 100% (60/60) -az-az Azerbaijani in Azerbaijan 100% (66/66) 100% (66/66) 100% (66/66) -az-ir Azerbaijani in Iran 100% (130/130) (0/130) 100% (130/130) -ba Bashkir 100% (82/82) 100% (82/82) 97% (80/82) -be Byelorussian 100% (68/68) 100% (68/68) 100% (68/68) -ber-dz Berber in Algeria 100% (70/70) 100% (70/70) 100% (70/70) -ber-ma Berber in Morocco 100% (32/32) (0/32) (0/32) -bg Bulgarian 100% (60/60) 100% (60/60) 100% (60/60) -bh Bihari (Devanagari script) (0/68) (0/68) (0/68) -bho Bhojpuri (Devanagari script) (0/68) (0/68) (0/68) -bi Bislama 100% (58/58) 100% (58/58) 100% (58/58) -bin Edo or Bini 100% (78/78) 100% (78/78) 100% (78/78) -bm Bambara 100% (60/60) 100% (60/60) 100% (60/60) -bn Bengali (0/63) (0/63) (0/63) -bo Tibetan (0/95) (0/95) (0/95) -br Breton 100% (64/64) 100% (64/64) 100% (64/64) -bs Bosnian 100% (62/62) 100% (62/62) 100% (62/62) -bua Buriat (Buryat) 100% (70/70) 100% (70/70) 100% (70/70) -byn Blin/Bilin (0/255) (0/255) (0/255) -ca Catalan 100% (74/74) 100% (74/74) 100% (74/74) -ce Chechen 100% (67/67) 100% (67/67) 100% (67/67) -ch Chamorro 100% (58/58) 100% (58/58) 100% (58/58) -chm Mari (Lower Cheremis / Upper Cheremis) 100% (76/76) 100% (76/76) 97% (74/76) -chr Cherokee (0/85) (0/85) (0/85) -co Corsican 100% (84/84) 100% (84/84) 100% (84/84) -crh Crimean Tatar/Crimean Turkish 100% (68/68) 100% (68/68) 100% (68/68) -cs Czech 100% (82/82) 100% (82/82) 100% (82/82) -csb Kashubian 100% (74/74) 100% (74/74) 100% (74/74) -cu Old Church Slavonic 100% (103/103) 86% (89/103) 78% (81/103) -cv Chuvash 100% (74/74) 100% (74/74) 100% (74/74) -cy Welsh 100% (78/78) 100% (78/78) 100% (78/78) -da Danish 100% (70/70) 100% (70/70) 100% (70/70) -de German 100% (59/59) 100% (59/59) 100% (59/59) -dv Divehi/Dhivehi/Maldivian (0/49) (0/49) (0/49) -dz Dzongkha (0/95) (0/95) (0/95) -ee Ewe 100% (99/99) 100% (99/99) 100% (99/99) -el Greek 100% (69/69) 100% (69/69) 100% (69/69) -en English 100% (72/72) 100% (72/72) 100% (72/72) -eo Esperanto 100% (64/64) 100% (64/64) 100% (64/64) -es Spanish 100% (66/66) 100% (66/66) 100% (66/66) -et Estonian 100% (64/64) 100% (64/64) 100% (64/64) -eu Basque 100% (56/56) 100% (56/56) 100% (56/56) -fa Persian 100% (129/129) (0/129) 100% (129/129) -fat Fanti 100% (73/73) 100% (73/73) 100% (73/73) -ff Fulah (Fula) 100% (62/62) 100% (62/62) 100% (62/62) -fi Finnish 100% (62/62) 100% (62/62) 100% (62/62) -fil Filipino 100% (84/84) 100% (84/84) 100% (84/84) -fj Fijian 100% (52/52) 100% (52/52) 100% (52/52) -fo Faroese 100% (68/68) 100% (68/68) 100% (68/68) -fr French 100% (84/84) 100% (84/84) 100% (84/84) -fur Friulian 100% (66/66) 100% (66/66) 100% (66/66) -fy Frisian 100% (75/75) 100% (75/75) 100% (75/75) -ga Irish 100% (80/80) 100% (80/80) 100% (80/80) -gd Scots Gaelic 100% (70/70) 100% (70/70) 100% (70/70) -gez Ethiopic (Geez) (0/218) (0/218) (0/218) -gl Galician 100% (66/66) 100% (66/66) 100% (66/66) -gn Guarani 100% (70/70) 100% (70/70) 100% (70/70) -gu Gujarati (0/68) (0/68) (0/68) -gv Manx Gaelic 100% (54/54) 100% (54/54) 100% (54/54) -ha Hausa 100% (60/60) 100% (60/60) 100% (60/60) -haw Hawaiian 100% (63/63) 100% (63/63) 100% (63/63) -he Hebrew 100% (27/27) (0/27) (0/27) -hi Hindi (Devanagari script) (0/68) (0/68) (0/68) -hne Chhattisgarhi (0/68) (0/68) (0/68) -ho Hiri Motu 100% (52/52) 100% (52/52) 100% (52/52) -hr Croatian 100% (62/62) 100% (62/62) 100% (62/62) -hsb Upper Sorbian 100% (72/72) 100% (72/72) 100% (72/72) -ht Haitian/Haitian Creole 100% (56/56) 100% (56/56) 100% (56/56) -hu Hungarian 100% (70/70) 100% (70/70) 100% (70/70) -hy Armenian 100% (77/77) (0/77) (0/77) -hz Herero 100% (57/57) 100% (57/57) 100% (57/57) -ia Interlingua 100% (52/52) 100% (52/52) 100% (52/52) -id Indonesian 100% (54/54) 100% (54/54) 100% (54/54) -ie Interlingue 100% (52/52) 100% (52/52) 100% (52/52) -ig Igbo 100% (58/58) 100% (58/58) 100% (58/58) -ii Sichuan Yi/Nuosu (0/1165) (0/1165) (0/1165) -ik Inupiaq (Inupiak, Eskimo) 100% (68/68) 100% (68/68) 100% (68/68) -io Ido 100% (52/52) 100% (52/52) 100% (52/52) -is Icelandic 100% (70/70) 100% (70/70) 100% (70/70) -it Italian 100% (72/72) 100% (72/72) 100% (72/72) -iu Inuktitut 100% (161/161) (0/161) (0/161) -ja Japanese (0/6537) (0/6537) (0/6537) -jv Javanese 100% (56/56) 100% (56/56) 100% (56/56) -ka Georgian 100% (33/33) 100% (33/33) 100% (33/33) -kaa Kara-Kalpak (Karakalpak) 100% (78/78) 100% (78/78) 100% (78/78) -kab Kabyle 100% (70/70) 100% (70/70) 100% (70/70) -ki Kikuyu 100% (56/56) 100% (56/56) 100% (56/56) -kj Kuanyama/Kwanyama 100% (52/52) 100% (52/52) 100% (52/52) -kk Kazakh 100% (77/77) 100% (77/77) 100% (77/77) -kl Greenlandic 100% (81/81) 100% (81/81) 100% (81/81) -km Central Khmer (0/63) (0/63) (0/63) -kn Kannada (0/70) (0/70) (0/70) -ko Korean (0/2443) (0/2443) (0/2443) -kok Kokani (Devanagari script) (0/68) (0/68) (0/68) -kr Kanuri 100% (56/56) 96% (54/56) 100% (56/56) -ks Kashmiri 94% (137/145) (0/145) 97% (141/145) -ku-am Kurdish in Armenia 100% (64/64) 100% (64/64) 100% (64/64) -ku-iq Kurdish in Iraq 100% (32/32) (0/32) 87% (28/32) -ku-ir Kurdish in Iran 100% (32/32) (0/32) 87% (28/32) -ku-tr Kurdish in Turkey 100% (62/62) 100% (62/62) 100% (62/62) -kum Kumyk 100% (66/66) 100% (66/66) 100% (66/66) -kv Komi (Komi-Permyak/Komi-Siryan) 100% (70/70) 100% (70/70) 100% (70/70) -kw Cornish 100% (64/64) 100% (64/64) 100% (64/64) -kwm Kwambi 100% (52/52) 100% (52/52) 100% (52/52) -ky Kirgiz 100% (70/70) 100% (70/70) 100% (70/70) -la Latin 100% (68/68) 100% (68/68) 100% (68/68) -lah Lahnda 94% (137/145) (0/145) 97% (141/145) -lb Luxembourgish (Letzeburgesch) 100% (75/75) 100% (75/75) 100% (75/75) -lez Lezghian (Lezgian) 100% (67/67) 100% (67/67) 100% (67/67) -lg Ganda 100% (54/54) 100% (54/54) 100% (54/54) -li Limburgan/Limburger/Limburgish 100% (62/62) 100% (62/62) 100% (62/62) -ln Lingala 100% (81/81) 100% (81/81) 100% (81/81) -lo Lao 100% (55/55) (0/55) 83% (46/55) -lt Lithuanian 100% (70/70) 100% (70/70) 100% (70/70) -lv Latvian 100% (78/78) 100% (78/78) 100% (78/78) -mai Maithili (Devanagari script) (0/68) (0/68) (0/68) -mg Malagasy 100% (56/56) 100% (56/56) 100% (56/56) -mh Marshallese 100% (62/62) 100% (62/62) 100% (62/62) -mi Maori 100% (64/64) 100% (64/64) 100% (64/64) -mk Macedonian 100% (42/42) 100% (42/42) 100% (42/42) -ml Malayalam (0/68) (0/68) (0/68) -mn-cn Mongolian in China (0/130) (0/130) (0/130) -mn-mn Mongolian in Mongolia 100% (70/70) 100% (70/70) 100% (70/70) -mo Moldavian 100% (128/128) 100% (128/128) 100% (128/128) -mr Marathi (Devanagari script) (0/68) (0/68) (0/68) -ms Malay 100% (52/52) 100% (52/52) 100% (52/52) -mt Maltese 100% (72/72) 100% (72/72) 100% (72/72) -my Burmese (Myanmar) (0/48) (0/48) (0/48) -na Nauru 100% (60/60) 100% (60/60) 100% (60/60) -nb Norwegian Bokmal 100% (70/70) 100% (70/70) 100% (70/70) -nds Low Saxon 100% (59/59) 100% (59/59) 100% (59/59) -ne Nepali (Devanagari script) (0/68) (0/68) (0/68) -ng Ndonga 100% (52/52) 100% (52/52) 100% (52/52) -nl Dutch 100% (82/82) 100% (82/82) 100% (82/82) -nn Norwegian Nynorsk 100% (76/76) 100% (76/76) 100% (76/76) -no Norwegian (Bokmal) 100% (70/70) 100% (70/70) 100% (70/70) -nr Ndebele, South 100% (52/52) 100% (52/52) 100% (52/52) -nso Northern Sotho 100% (58/58) 100% (58/58) 100% (58/58) -nv Navajo/Navaho 100% (72/72) 100% (72/72) 100% (72/72) -ny Chichewa 100% (54/54) 100% (54/54) 100% (54/54) -oc Occitan 100% (70/70) 100% (70/70) 100% (70/70) -om Oromo or Galla 100% (52/52) 100% (52/52) 100% (52/52) -or Oriya (0/68) (0/68) (0/68) -os Ossetic 100% (66/66) 100% (66/66) 100% (66/66) -ota Ottoman Turkish 97% (36/37) (0/37) 97% (36/37) -pa Panjabi/Punjabi (0/63) (0/63) (0/63) -pa-pk Panjabi/Punjabi in Pakistan 94% (137/145) (0/145) 97% (141/145) -pap-an Papiamento in Netherlands Antilles 100% (72/72) 100% (72/72) 100% (72/72) -pap-aw Papiamento in Aruba 100% (54/54) 100% (54/54) 100% (54/54) -pl Polish 100% (70/70) 100% (70/70) 100% (70/70) -ps-af Pashto in Afghanistan 83% (41/49) (0/49) 77% (38/49) -ps-pk Pashto in Pakistan 81% (40/49) (0/49) 75% (37/49) -pt Portuguese 100% (82/82) 100% (82/82) 100% (82/82) -qu Quechua 100% (55/55) 100% (55/55) 100% (55/55) -rm Rhaeto-Romance (Romansch) 100% (66/66) 100% (66/66) 100% (66/66) -rn Rundi 100% (52/52) 100% (52/52) 100% (52/52) -ro Romanian 100% (62/62) 100% (62/62) 100% (62/62) -ru Russian 100% (66/66) 100% (66/66) 100% (66/66) -rw Kinyarwanda 100% (52/52) 100% (52/52) 100% (52/52) -sa Sanskrit (Devanagari script) (0/68) (0/68) (0/68) -sah Yakut 100% (76/76) 100% (76/76) 97% (74/76) -sc Sardinian 100% (62/62) 100% (62/62) 100% (62/62) -sco Scots 100% (56/56) 100% (56/56) 100% (56/56) -sd Sindhi 81% (44/54) (0/54) 79% (43/54) -se North Sami 100% (66/66) 100% (66/66) 100% (66/66) -sel Selkup (Ostyak-Samoyed) 100% (66/66) 100% (66/66) 100% (66/66) -sg Sango 100% (72/72) 100% (72/72) 100% (72/72) -sh Serbo-Croatian 100% (156/156) 100% (156/156) 98% (154/156) -shs Secwepemctsin 100% (48/48) 100% (48/48) 100% (48/48) -si Sinhala/Sinhalese (0/73) (0/73) (0/73) -sid Sidamo (0/281) (0/281) (0/281) -sk Slovak 100% (86/86) 100% (86/86) 100% (86/86) -sl Slovenian 100% (62/62) 100% (62/62) 100% (62/62) -sm Samoan 100% (53/53) 100% (53/53) 100% (53/53) -sma South Sami 100% (60/60) 100% (60/60) 100% (60/60) -smj Lule Sami 100% (60/60) 100% (60/60) 100% (60/60) -smn Inari Sami 100% (68/68) 100% (68/68) 100% (68/68) -sms Skolt Sami 100% (80/80) 100% (80/80) 97% (78/80) -sn Shona 100% (52/52) 100% (52/52) 100% (52/52) -so Somali 100% (52/52) 100% (52/52) 100% (52/52) -sq Albanian 100% (56/56) 100% (56/56) 100% (56/56) -sr Serbian 100% (60/60) 100% (60/60) 100% (60/60) -ss Swati 100% (52/52) 100% (52/52) 100% (52/52) -st Sotho, Southern 100% (52/52) 100% (52/52) 100% (52/52) -su Sundanese 100% (54/54) 100% (54/54) 100% (54/54) -sv Swedish 100% (68/68) 100% (68/68) 100% (68/68) -sw Swahili 100% (52/52) 100% (52/52) 100% (52/52) -syr Syriac (0/45) (0/45) (0/45) -ta Tamil (0/48) (0/48) (0/48) -te Telugu (0/70) (0/70) (0/70) -tg Tajik 100% (78/78) 100% (78/78) 97% (76/78) -th Thai 1% (1/74) (0/74) (0/74) -ti-er Eritrean Tigrinya (0/255) (0/255) (0/255) -ti-et Ethiopian Tigrinya (0/281) (0/281) (0/281) -tig Tigre (0/221) (0/221) (0/221) -tk Turkmen 100% (68/68) 100% (68/68) 100% (68/68) -tl Tagalog 100% (84/84) 100% (84/84) 100% (84/84) -tn Tswana 100% (58/58) 100% (58/58) 100% (58/58) -to Tonga 100% (53/53) 100% (53/53) 100% (53/53) -tr Turkish 100% (70/70) 100% (70/70) 100% (70/70) -ts Tsonga 100% (52/52) 100% (52/52) 100% (52/52) -tt Tatar 100% (76/76) 100% (76/76) 100% (76/76) -tw Twi 100% (73/73) 100% (73/73) 100% (73/73) -ty Tahitian 100% (65/65) 100% (65/65) 100% (65/65) -tyv Tuvinian 100% (70/70) 100% (70/70) 100% (70/70) -ug Uighur 100% (125/125) (0/125) 100% (125/125) -uk Ukrainian 100% (72/72) 100% (72/72) 100% (72/72) -ur Urdu 94% (137/145) (0/145) 97% (141/145) -uz Uzbek 100% (52/52) 100% (52/52) 100% (52/52) -ve Venda 100% (62/62) 100% (62/62) 100% (62/62) -vi Vietnamese 100% (194/194) 77% (150/194) 76% (148/194) -vo Volapuk 100% (54/54) 100% (54/54) 100% (54/54) -vot Votic 100% (62/62) 100% (62/62) 100% (62/62) -wa Walloon 100% (70/70) 100% (70/70) 100% (70/70) -wal Wolaitta/Wolaytta (0/281) (0/281) (0/281) -wen Sorbian languages (lower and upper) 100% (76/76) 100% (76/76) 100% (76/76) -wo Wolof 100% (66/66) 100% (66/66) 100% (66/66) -xh Xhosa 100% (52/52) 100% (52/52) 100% (52/52) -yap Yapese 100% (58/58) 100% (58/58) 100% (58/58) -yi Yiddish 100% (27/27) (0/27) (0/27) -yo Yoruba 100% (119/119) 100% (119/119) 100% (119/119) -za Zhuang/Chuang 100% (52/52) 100% (52/52) 100% (52/52) -zh-cn Chinese (simplified) 0% (2/6765) 0% (2/6765) 0% (2/6765) -zh-hk Chinese Hong Kong Supplementary Character Set (0/2213) (0/2213) (0/2213) -zh-mo Chinese in Macau (0/2213) (0/2213) (0/2213) -zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) -zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) -zu Zulu 100% (52/52) 100% (52/52) 100% (52/52) diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/status.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/status.txt deleted file mode 100644 index ecc3055d0f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/status.txt +++ /dev/null @@ -1,6237 +0,0 @@ -This is the status file for DejaVu fonts -($Id: status.txt 2362 2009-08-27 14:43:39Z ben_laenen $) - -original = present in original Bitstream Vera 1.10 -<version> = added in DejaVu fonts <version> - -U+0020 space original -U+0021 exclam original -U+0022 quotedbl original -U+0023 numbersign original -U+0024 dollar original -U+0025 percent original -U+0026 ampersand original -U+0027 quotesingle original -U+0028 parenleft original -U+0029 parenright original -U+002a asterisk original -U+002b plus original -U+002c comma original -U+002d hyphen original -U+002e period original -U+002f slash original -U+0030 zero original -U+0031 one original -U+0032 two original -U+0033 three original -U+0034 four original -U+0035 five original -U+0036 six original -U+0037 seven original -U+0038 eight original -U+0039 nine original -U+003a colon original -U+003b semicolon original -U+003c less original -U+003d equal original -U+003e greater original -U+003f question original -U+0040 at original -U+0041 A original -U+0042 B original -U+0043 C original -U+0044 D original -U+0045 E original -U+0046 F original -U+0047 G original -U+0048 H original -U+0049 I original -U+004a J original -U+004b K original -U+004c L original -U+004d M original -U+004e N original -U+004f O original -U+0050 P original -U+0051 Q original -U+0052 R original -U+0053 S original -U+0054 T original -U+0055 U original -U+0056 V original -U+0057 W original -U+0058 X original -U+0059 Y original -U+005a Z original -U+005b bracketleft original -U+005c backslash original -U+005d bracketright original -U+005e asciicircum original -U+005f underscore original -U+0060 grave original -U+0061 a original -U+0062 b original -U+0063 c original -U+0064 d original -U+0065 e original -U+0066 f original -U+0067 g original -U+0068 h original -U+0069 i original -U+006a j original -U+006b k original -U+006c l original -U+006d m original -U+006e n original -U+006f o original -U+0070 p original -U+0071 q original -U+0072 r original -U+0073 s original -U+0074 t original -U+0075 u original -U+0076 v original -U+0077 w original -U+0078 x original -U+0079 y original -U+007a z original -U+007b braceleft original -U+007c bar original -U+007d braceright original -U+007e asciitilde original -U+00a0 nonbreakingspace original -U+00a1 exclamdown original -U+00a2 cent original -U+00a3 sterling original -U+00a4 currency original -U+00a5 yen original -U+00a6 brokenbar original -U+00a7 section original -U+00a8 dieresis original -U+00a9 copyright original -U+00aa ordfeminine original -U+00ab guillemotleft original -U+00ac logicalnot original -U+00ad sfthyphen original -U+00ae registered original -U+00af macron original -U+00b0 degree original -U+00b1 plusminus original -U+00b2 twosuperior original -U+00b3 threesuperior original -U+00b4 acute original -U+00b5 mu original -U+00b6 paragraph original -U+00b7 periodcentered original -U+00b8 cedilla original -U+00b9 onesuperior original -U+00ba ordmasculine original -U+00bb guillemotright original -U+00bc onequarter original -U+00bd onehalf original -U+00be threequarters original -U+00bf questiondown original -U+00c0 Agrave original -U+00c1 Aacute original -U+00c2 Acircumflex original -U+00c3 Atilde original -U+00c4 Adieresis original -U+00c5 Aring original -U+00c6 AE original -U+00c7 Ccedilla original -U+00c8 Egrave original -U+00c9 Eacute original -U+00ca Ecircumflex original -U+00cb Edieresis original -U+00cc Igrave original -U+00cd Iacute original -U+00ce Icircumflex original -U+00cf Idieresis original -U+00d0 Eth original -U+00d1 Ntilde original -U+00d2 Ograve original -U+00d3 Oacute original -U+00d4 Ocircumflex original -U+00d5 Otilde original -U+00d6 Odieresis original -U+00d7 multiply original -U+00d8 Oslash original -U+00d9 Ugrave original -U+00da Uacute original -U+00db Ucircumflex original -U+00dc Udieresis original -U+00dd Yacute original -U+00de Thorn original -U+00df germandbls original -U+00e0 agrave original -U+00e1 aacute original -U+00e2 acircumflex original -U+00e3 atilde original -U+00e4 adieresis original -U+00e5 aring original -U+00e6 ae original -U+00e7 ccedilla original -U+00e8 egrave original -U+00e9 eacute original -U+00ea ecircumflex original -U+00eb edieresis original -U+00ec igrave original -U+00ed iacute original -U+00ee icircumflex original -U+00ef idieresis original -U+00f0 eth original -U+00f1 ntilde original -U+00f2 ograve original -U+00f3 oacute original -U+00f4 ocircumflex original -U+00f5 otilde original -U+00f6 odieresis original -U+00f7 divide original -U+00f8 oslash original -U+00f9 ugrave original -U+00fa uacute original -U+00fb ucircumflex original -U+00fc udieresis original -U+00fd yacute original -U+00fe thorn original -U+00ff ydieresis original -U+0100 Amacron 1.5 -U+0101 amacron 1.5 -U+0102 Abreve 1.5 -U+0103 abreve 1.5 -U+0104 Aogonek 1.4 -U+0105 aogonek 1.4 -U+0106 Cacute original -U+0107 cacute original -U+0108 Ccircumflex 1.5 -U+0109 ccircumflex 1.5 -U+010a Cdotaccent 1.5 -U+010b cdotaccent 1.5 -U+010c Ccaron original -U+010d ccaron original -U+010e Dcaron 1.0 -U+010f dcaron 1.0 -U+0110 Dcroat 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0111 dcroat original -U+0112 Emacron 1.5 -U+0113 emacron 1.5 -U+0114 Ebreve 1.5 -U+0115 ebreve 1.5 -U+0116 Edotaccent 1.5 -U+0117 edotaccent 1.5 -U+0118 Eogonek 1.4 -U+0119 eogonek 1.4 -U+011a Ecaron 1.0 -U+011b ecaron 1.0 -U+011c Gcircumflex 1.5 -U+011d gcircumflex 1.5 -U+011e Gbreve original -U+011f gbreve original -U+0120 Gdotaccent 1.5 -U+0121 gdotaccent 1.5 -U+0122 Gcommaaccent 1.11 -U+0123 gcommaaccent 1.11 -U+0124 Hcircumflex 1.5 -U+0125 hcircumflex 1.5 -U+0126 Hbar 1.12 -U+0127 hbar 1.12 -U+0128 Itilde 1.5 -U+0129 itilde 1.5 -U+012a Imacron 1.5 -U+012b imacron 1.5 -U+012c Ibreve 1.5 -U+012d ibreve 1.5 -U+012e Iogonek 1.11 -U+012f iogonek 1.11 -U+0130 Idotaccent original -U+0131 dotlessi original -U+0132 IJ 1.11 -U+0133 ij 1.11 -U+0134 Jcircumflex 1.5 -U+0135 jcircumflex 1.5 -U+0136 Kcommaaccent 1.11 -U+0137 kcommaaccent 1.11 -U+0138 kgreenlandic 1.12 -U+0139 Lacute 1.1 -U+013a lacute 1.1 -U+013b Lcommaaccent 1.11 -U+013c lcommaaccent 1.11 -U+013d Lcaron 1.1 -U+013e lcaron 1.1 -U+013f Ldot 1.2 -U+0140 ldot 1.2 -U+0141 Lslash original -U+0142 lslash original -U+0143 Nacute 1.4 -U+0144 nacute 1.4 -U+0145 Ncommaaccent 1.11 -U+0146 ncommaaccent 1.11 -U+0147 Ncaron 1.0 -U+0148 ncaron 1.0 -U+0149 napostrophe 1.12 -U+014a Eng 1.12 -U+014b eng 1.12 -U+014c Omacron 1.5 -U+014d omacron 1.5 -U+014e Obreve 1.5 -U+014f obreve 1.5 -U+0150 Ohungarumlaut 1.5 -U+0151 ohungarumlaut 1.5 -U+0152 OE original -U+0153 oe original -U+0154 Racute 1.1 -U+0155 racute 1.1 -U+0156 Rcommaaccent 1.11 -U+0157 rcommaaccent 1.11 -U+0158 Rcaron 1.0 -U+0159 rcaron 1.0 -U+015a Sacute 1.4 -U+015b sacute 1.4 -U+015c Scircumflex 1.5 -U+015d scircumflex 1.5 -U+015e Scedilla original -U+015f scedilla original -U+0160 Scaron original -U+0161 scaron original -U+0162 Tcommaaccent 1.5 -U+0163 tcommaaccent 1.5 -U+0164 Tcaron 1.0 -U+0165 tcaron 1.0 -U+0166 Tbar 1.12 -U+0167 tbar 1.12 -U+0168 Utilde 1.5 -U+0169 utilde 1.5 -U+016a Umacron 1.5 -U+016b umacron 1.5 -U+016c Ubreve 1.5 -U+016d ubreve 1.5 -U+016e Uring 1.0 -U+016f uring 1.0 -U+0170 Uhungarumlaut 1.5 -U+0171 uhungarumlaut 1.5 -U+0172 Uogonek 1.11 -U+0173 uogonek 1.11 -U+0174 Wcircumflex 1.2 -U+0175 wcircumflex 1.2 -U+0176 Ycircumflex 1.2 -U+0177 ycircumflex 1.2 -U+0178 Ydieresis original -U+0179 Zacute 1.4 -U+017a zacute 1.4 -U+017b Zdotaccent 1.4 -U+017c zdotaccent 1.4 -U+017d Zcaron original -U+017e zcaron original -U+017f longs 1.12 -U+0180 uni0180 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.12 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0181 uni0181 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0182 uni0182 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0183 uni0183 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0184 uni0184 2.3 -U+0185 uni0185 2.3 -U+0186 uni0186 1.15 -U+0187 uni0187 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0188 uni0188 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0189 uni0189 2.1 -U+018a uni018A 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+018b uni018B 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+018c uni018C 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+018d uni018D 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+018e uni018E 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+018f uni018F 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0190 uni0190 1.15 -U+0191 uni0191 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0192 florin original -U+0193 uni0193 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0194 uni0194 1.14 -U+0195 uni0195 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.6 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0196 uni0196 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0197 uni0197 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0198 uni0198 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0199 uni0199 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+019a uni019A 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+019b uni019B 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+019c uni019C 2.3 -U+019d uni019D 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+019e uni019E 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+019f uni019F 2.3 -U+01a0 Ohorn 2.3 -U+01a1 ohorn 2.3 -U+01a2 uni01A2 2.3 -U+01a3 uni01A3 2.3 -U+01a4 uni01A4 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01a5 uni01A5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01a6 uni01A6 2.3 -U+01a7 uni01A7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01a8 uni01A8 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01a9 uni01A9 2.2 -U+01aa uni01AA 2.3 -U+01ab uni01AB 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01ac uni01AC 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01ad uni01AD 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01ae uni01AE 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01af Uhorn 2.3 -U+01b0 uhorn 2.3 -U+01b1 uni01B1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01b2 uni01B2 2.3 -U+01b3 uni01B3 2.3 -U+01b4 uni01B4 2.3 -U+01b5 uni01B5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01b6 uni01B6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01b7 uni01B7 2.3 -U+01b8 uni01B8 2.3 -U+01b9 uni01B9 2.3 -U+01ba uni01BA 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+01bb uni01BB 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01bc uni01BC 2.3 -U+01bd uni01BD 2.3 -U+01be uni01BE 2.3 -U+01bf uni01BF 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+01c0 uni01C0 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01c1 uni01C1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01c2 uni01C2 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+01c3 uni01C3 2.2 -U+01c4 uni01C4 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01c5 uni01C5 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01c6 uni01C6 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01c7 uni01C7 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01c8 uni01C8 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01c9 uni01C9 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01ca uni01CA 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01cb uni01CB 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01cc uni01CC 1.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01cd uni01CD 1.15 -U+01ce uni01CE 1.15 -U+01cf uni01CF 1.15 -U+01d0 uni01D0 1.15 -U+01d1 uni01D1 1.15 -U+01d2 uni01D2 1.15 -U+01d3 uni01D3 1.15 -U+01d4 uni01D4 1.15 -U+01d5 uni01D5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01d6 uni01D6 1.13 -U+01d7 uni01D7 2.3 -U+01d8 uni01D8 2.3 -U+01d9 uni01D9 2.3 -U+01da uni01DA 2.3 -U+01db uni01DB 2.3 -U+01dc uni01DC 2.3 -U+01dd uni01DD 2.2 -U+01de uni01DE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique) 2.23 (Serif Italic Condensed) -U+01df uni01DF 1.13 -U+01e0 uni01E0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01e1 uni01E1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01e2 uni01E2 1.5 -U+01e3 uni01E3 1.5 -U+01e4 uni01E4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+01e5 uni01E5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+01e6 Gcaron 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01e7 gcaron 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01e8 uni01E8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01e9 uni01E9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01ea uni01EA 1.9 -U+01eb uni01EB 1.9 -U+01ec uni01EC 1.9 -U+01ed uni01ED 1.9 -U+01ee uni01EE 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01ef uni01EF 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01f0 uni01F0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono) 2.22 (Sans Mono Bold) 2.23 (Serif Italic Condensed) -U+01f1 uni01F1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01f2 uni01F2 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01f3 uni01F3 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01f4 uni01F4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01f5 uni01F5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01f6 uni01F6 2.3 -U+01f7 uni01F7 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+01f8 uni01F8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01f9 uni01F9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01fa Aringacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01fb aringacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+01fc AEacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01fd aeacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01fe Oslashacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+01ff oslashacute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0200 uni0200 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0201 uni0201 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0202 uni0202 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0203 uni0203 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0204 uni0204 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0205 uni0205 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0206 uni0206 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0207 uni0207 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0208 uni0208 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0209 uni0209 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020a uni020A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020b uni020B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020c uni020C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020d uni020D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020e uni020E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+020f uni020F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0210 uni0210 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0211 uni0211 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0212 uni0212 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0213 uni0213 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0214 uni0214 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0215 uni0215 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0216 uni0216 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0217 uni0217 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0218 Scommaaccent 1.5 -U+0219 scommaaccent 1.5 -U+021a uni021A 1.5 -U+021b uni021B 1.5 -U+021c uni021C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+021d uni021D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+021e uni021E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+021f uni021F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0220 uni0220 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.16 (Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.17 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.18 (Sans Mono, Sans Mono Bold) 2.23 (Serif Italic Condensed) -U+0221 uni0221 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0222 uni0222 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0223 uni0223 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0224 uni0224 2.3 -U+0225 uni0225 2.3 -U+0226 uni0226 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0227 uni0227 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0228 uni0228 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0229 uni0229 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+022a uni022A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+022b uni022B 1.13 -U+022c uni022C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+022d uni022D 1.13 -U+022e uni022E 1.10 -U+022f uni022F 1.10 -U+0230 uni0230 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0231 uni0231 1.13 -U+0232 uni0232 1.5 -U+0233 uni0233 1.5 -U+0234 uni0234 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0235 uni0235 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0236 uni0236 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0237 dotlessj 1.5 -U+0238 uni0238 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0239 uni0239 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+023a uni023A 2.3 -U+023b uni023B 2.3 -U+023c uni023C 2.3 -U+023d uni023D 2.3 -U+023e uni023E 2.3 -U+023f uni023F 2.3 -U+0240 uni0240 2.3 -U+0241 uni0241 2.3 -U+0242 uni0242 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+0243 uni0243 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0244 uni0244 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0245 uni0245 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0246 uni0246 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0247 uni0247 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0248 uni0248 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0249 uni0249 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+024a uni024A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+024b uni024B 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.26 (Sans ExtraLight) -U+024c uni024C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+024d uni024D 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+024e uni024E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+024f uni024F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0250 uni0250 1.14 -U+0251 uni0251 1.14 -U+0252 uni0252 1.14 -U+0253 uni0253 1.14 -U+0254 uni0254 1.14 -U+0255 uni0255 1.14 -U+0256 uni0256 1.14 -U+0257 uni0257 1.14 -U+0258 uni0258 1.14 -U+0259 uni0259 1.14 -U+025a uni025A 1.14 -U+025b uni025B 1.14 -U+025c uni025C 1.14 -U+025d uni025D 1.14 -U+025e uni025E 1.14 -U+025f uni025F 1.14 -U+0260 uni0260 1.14 -U+0261 uni0261 1.14 -U+0262 uni0262 1.14 -U+0263 uni0263 1.14 -U+0264 uni0264 1.14 -U+0265 uni0265 1.14 -U+0266 uni0266 1.14 -U+0267 uni0267 1.14 -U+0268 uni0268 1.14 -U+0269 uni0269 1.14 -U+026a uni026A 1.14 -U+026b uni026B 1.14 -U+026c uni026C 1.14 -U+026d uni026D 1.14 -U+026e uni026E 1.14 -U+026f uni026F 1.14 -U+0270 uni0270 1.14 -U+0271 uni0271 1.14 -U+0272 uni0272 1.14 -U+0273 uni0273 1.14 -U+0274 uni0274 1.14 -U+0275 uni0275 1.14 -U+0276 uni0276 1.14 -U+0277 uni0277 1.14 -U+0278 uni0278 1.14 -U+0279 uni0279 1.14 -U+027a uni027A 1.14 -U+027b uni027B 1.14 -U+027c uni027C 1.14 -U+027d uni027D 1.14 -U+027e uni027E 1.14 -U+027f uni027F 1.14 -U+0280 uni0280 1.14 -U+0281 uni0281 1.14 -U+0282 uni0282 1.14 -U+0283 uni0283 1.14 -U+0284 uni0284 1.14 -U+0285 uni0285 1.14 -U+0286 uni0286 1.14 -U+0287 uni0287 1.14 -U+0288 uni0288 1.14 -U+0289 uni0289 1.14 -U+028a uni028A 1.14 -U+028b uni028B 1.14 -U+028c uni028C 1.14 -U+028d uni028D 1.14 -U+028e uni028E 1.14 -U+028f uni028F 1.14 -U+0290 uni0290 1.14 -U+0291 uni0291 1.14 -U+0292 uni0292 1.14 -U+0293 uni0293 1.14 -U+0294 uni0294 1.14 -U+0295 uni0295 1.14 -U+0296 uni0296 1.14 -U+0297 uni0297 1.14 -U+0298 uni0298 1.14 -U+0299 uni0299 1.14 -U+029a uni029A 1.14 -U+029b uni029B 1.14 -U+029c uni029C 1.14 -U+029d uni029D 1.14 -U+029e uni029E 1.14 -U+029f uni029F 1.14 -U+02a0 uni02A0 1.14 -U+02a1 uni02A1 1.14 -U+02a2 uni02A2 1.14 -U+02a3 uni02A3 1.14 -U+02a4 uni02A4 1.14 -U+02a5 uni02A5 1.14 -U+02a6 uni02A6 1.14 -U+02a7 uni02A7 1.14 -U+02a8 uni02A8 1.14 -U+02a9 uni02A9 1.14 -U+02aa uni02AA 1.14 -U+02ab uni02AB 1.14 -U+02ac uni02AC 1.14 -U+02ad uni02AD 1.14 -U+02ae uni02AE 1.14 -U+02af uni02AF 1.14 -U+02b0 uni02B0 1.14 -U+02b1 uni02B1 1.14 -U+02b2 uni02B2 1.14 -U+02b3 uni02B3 1.14 -U+02b4 uni02B4 1.14 -U+02b5 uni02B5 1.14 -U+02b6 uni02B6 1.14 -U+02b7 uni02B7 1.14 -U+02b8 uni02B8 1.14 -U+02b9 uni02B9 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+02ba uni02BA 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02bb uni02BB 1.5 -U+02bc uni02BC 1.12 -U+02bd uni02BD 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+02be uni02BE 2.2 -U+02bf uni02BF 2.2 -U+02c0 uni02C0 1.14 -U+02c1 uni02C1 1.14 -U+02c2 uni02C2 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02c3 uni02C3 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02c4 uni02C4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02c5 uni02C5 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02c6 circumflex original -U+02c7 caron original -U+02c8 uni02C8 2.0 -U+02c9 uni02C9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+02ca uni02CA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+02cb uni02CB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+02cc uni02CC 2.0 -U+02cd uni02CD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+02ce uni02CE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+02cf uni02CF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+02d0 uni02D0 1.14 -U+02d1 uni02D1 1.14 -U+02d2 uni02D2 2.0 -U+02d3 uni02D3 2.2 -U+02d4 uni02D4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02d5 uni02D5 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02d6 uni02D6 2.0 -U+02d7 uni02D7 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+02d8 breve original -U+02d9 dotaccent original -U+02da ring original -U+02db ogonek original -U+02dc tilde original -U+02dd hungarumlaut original -U+02de uni02DE 2.0 -U+02df uni02DF 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02e0 uni02E0 1.14 -U+02e1 uni02E1 1.14 -U+02e2 uni02E2 1.14 -U+02e3 uni02E3 1.14 -U+02e4 uni02E4 1.14 -U+02e5 uni02E5 2.0 -U+02e6 uni02E6 2.0 -U+02e7 uni02E7 2.0 -U+02e8 uni02E8 2.0 -U+02e9 uni02E9 2.0 -U+02ec uni02EC 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02ed uni02ED 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+02ee uni02EE 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+02f3 uni02F3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+02f7 uni02F7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+0300 gravecomb 1.15 -U+0301 acutecomb 1.15 -U+0302 uni0302 1.15 -U+0303 tildecomb 1.15 -U+0304 uni0304 1.15 -U+0305 uni0305 2.0 -U+0306 uni0306 1.15 -U+0307 uni0307 1.15 -U+0308 uni0308 1.15 -U+0309 hookabovecomb 2.1 -U+030a uni030A 1.15 -U+030b uni030B 1.15 -U+030c uni030C 1.15 -U+030d uni030D 2.0 -U+030e uni030E 2.0 -U+030f uni030F 2.0 -U+0310 uni0310 2.0 -U+0311 uni0311 2.0 -U+0312 uni0312 1.11 -U+0313 uni0313 2.1 -U+0314 uni0314 2.1 -U+0315 uni0315 2.0 -U+0316 uni0316 2.0 -U+0317 uni0317 2.0 -U+0318 uni0318 2.0 -U+0319 uni0319 2.0 -U+031a uni031A 2.1 -U+031b uni031B 2.1 -U+031c uni031C 2.0 -U+031d uni031D 2.0 -U+031e uni031E 2.0 -U+031f uni031F 2.0 -U+0320 uni0320 2.0 -U+0321 uni0321 1.15 -U+0322 uni0322 1.15 -U+0323 dotbelowcomb 2.1 -U+0324 uni0324 2.0 -U+0325 uni0325 2.0 -U+0326 uni0326 1.5 -U+0327 uni0327 2.1 -U+0328 uni0328 2.1 -U+0329 uni0329 2.0 -U+032a uni032A 2.0 -U+032b uni032B 2.1 -U+032c uni032C 2.0 -U+032d uni032D 2.0 -U+032e uni032E 2.0 -U+032f uni032F 2.0 -U+0330 uni0330 2.0 -U+0331 uni0331 2.0 -U+0332 uni0332 2.0 -U+0333 uni0333 2.1 -U+0334 uni0334 2.3 -U+0335 uni0335 2.3 -U+0336 uni0336 2.3 -U+0337 uni0337 2.3 -U+0338 uni0338 2.3 -U+0339 uni0339 2.0 -U+033a uni033A 2.0 -U+033b uni033B 2.0 -U+033c uni033C 2.1 -U+033d uni033D 2.0 -U+033e uni033E 2.1 -U+033f uni033F 2.1 -U+0340 uni0340 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0341 uni0341 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0342 uni0342 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0343 uni0343 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0344 uni0344 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0345 uni0345 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0346 uni0346 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0347 uni0347 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0348 uni0348 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0349 uni0349 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034a uni034A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034b uni034B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034c uni034C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034d uni034D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034e uni034E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+034f uni034F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0351 uni0351 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0352 uni0352 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique) 2.28 (Sans Condensed Oblique, Sans Oblique) -U+0353 uni0353 2.5 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0357 uni0357 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0358 uni0358 2.3 -U+035a uni035A 2.28 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+035c uni035C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+035d uni035D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+035e uni035E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+035f uni035F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0360 uni0360 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0361 uni0361 2.0 -U+0362 uni0362 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0370 uni0370 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0371 uni0371 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0372 uni0372 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+0373 uni0373 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+0374 uni0374 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0375 uni0375 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0376 uni0376 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+0377 uni0377 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+037a uni037A 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+037b uni037B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+037c uni037C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+037d uni037D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+037e uni037E 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0384 tonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0385 dieresistonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0386 Alphatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0387 anoteleia 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0388 Epsilontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0389 Etatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+038a Iotatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+038c Omicrontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+038e Upsilontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+038f Omegatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0390 iotadieresistonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0391 Alpha 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0392 Beta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0393 Gamma 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0394 uni0394 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0395 Epsilon 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0396 Zeta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0397 Eta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0398 Theta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0399 Iota 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039a Kappa 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039b Lambda 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039c Mu 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039d Nu 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039e Xi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+039f Omicron 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a0 Pi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a1 Rho 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a3 Sigma 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a4 Tau 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a5 Upsilon 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a6 Phi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a7 Chi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a8 Psi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03a9 Omega original -U+03aa Iotadieresis 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ab Upsilondieresis 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.1 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ac alphatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ad epsilontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ae etatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03af iotatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b0 upsilondieresistonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b1 alpha 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b2 beta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b3 gamma 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b4 delta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b5 epsilon 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b6 zeta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b7 eta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b8 theta 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03b9 iota 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ba kappa 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03bb lambda 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03bc uni03BC 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03bd nu 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03be xi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03bf omicron 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c0 pi original -U+03c1 rho 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c2 sigma1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c3 sigma 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c4 tau 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c5 upsilon 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c6 phi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c7 chi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c8 psi 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03c9 omega 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ca iotadieresis 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03cb upsilondieresis 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03cc omicrontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03cd upsilontonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ce omegatonos 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 1.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.2 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03cf uni03CF 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+03d0 uni03D0 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d1 theta1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d2 Upsilon1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d3 uni03D3 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d4 uni03D4 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d5 phi1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.18 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03d6 omega1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+03d7 uni03D7 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03d8 uni03D8 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+03d9 uni03D9 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+03da uni03DA 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03db uni03DB 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03dc uni03DC 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03dd uni03DD 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03de uni03DE 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03df uni03DF 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03e0 uni03E0 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03e1 uni03E1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03e2 uni03E2 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e3 uni03E3 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e4 uni03E4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e5 uni03E5 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e6 uni03E6 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e7 uni03E7 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e8 uni03E8 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03e9 uni03E9 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03ea uni03EA 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03eb uni03EB 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03ec uni03EC 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03ed uni03ED 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03ee uni03EE 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03ef uni03EF 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+03f0 uni03F0 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03f1 uni03F1 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+03f2 uni03F2 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f3 uni03F3 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f4 uni03F4 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f5 uni03F5 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f6 uni03F6 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f7 uni03F7 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f8 uni03F8 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03f9 uni03F9 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03fa uni03FA 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03fb uni03FB 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+03fc uni03FC 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+03fd uni03FD 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03fe uni03FE 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+03ff uni03FF 1.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.0 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0400 uni0400 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0401 uni0401 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0402 uni0402 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0403 uni0403 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0404 uni0404 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0405 uni0405 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0406 uni0406 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0407 uni0407 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0408 uni0408 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0409 uni0409 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040a uni040A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040b uni040B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040c uni040C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040d uni040D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040e uni040E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+040f uni040F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0410 uni0410 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0411 uni0411 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0412 uni0412 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0413 uni0413 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0414 uni0414 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0415 uni0415 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0416 uni0416 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0417 uni0417 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0418 uni0418 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0419 uni0419 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041a uni041A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041b uni041B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041c uni041C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041d uni041D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041e uni041E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+041f uni041F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0420 uni0420 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0421 uni0421 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0422 uni0422 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0423 uni0423 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0424 uni0424 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0425 uni0425 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0426 uni0426 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0427 uni0427 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0428 uni0428 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0429 uni0429 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042a uni042A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042b uni042B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042c uni042C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042d uni042D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042e uni042E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+042f uni042F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0430 uni0430 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0431 uni0431 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0432 uni0432 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0433 uni0433 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0434 uni0434 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0435 uni0435 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0436 uni0436 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0437 uni0437 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0438 uni0438 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0439 uni0439 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043a uni043A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043b uni043B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043c uni043C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043d uni043D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043e uni043E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+043f uni043F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0440 uni0440 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0441 uni0441 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0442 uni0442 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0443 uni0443 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0444 uni0444 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0445 uni0445 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0446 uni0446 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0447 uni0447 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0448 uni0448 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0449 uni0449 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044a uni044A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044b uni044B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044c uni044C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044d uni044D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044e uni044E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+044f uni044F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0450 uni0450 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0451 uni0451 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0452 uni0452 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0453 uni0453 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0454 uni0454 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0455 uni0455 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0456 uni0456 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0457 uni0457 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0458 uni0458 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0459 uni0459 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045a uni045A 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045b uni045B 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045c uni045C 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045d uni045D 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045e uni045E 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+045f uni045F 1.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 1.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold) 1.6 (Serif Bold Italic, Serif Italic) 1.7 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+0460 uni0460 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0461 uni0461 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+0462 uni0462 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.20 (Sans ExtraLight) 2.23 (Serif Italic Condensed) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0463 uni0463 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.20 (Sans ExtraLight) 2.23 (Serif Italic Condensed) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0464 uni0464 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0465 uni0465 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0466 uni0466 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0467 uni0467 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0468 uni0468 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0469 uni0469 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+046a uni046A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.21 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+046b uni046B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.21 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+046c uni046C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+046d uni046D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+046e uni046E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+046f uni046F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0470 uni0470 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0471 uni0471 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0472 uni0472 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0473 uni0473 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0474 uni0474 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.12 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0475 uni0475 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.12 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0476 uni0476 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0477 uni0477 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0478 uni0478 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0479 uni0479 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047a uni047A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047b uni047B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047c uni047C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047d uni047D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047e uni047E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+047f uni047F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0480 uni0480 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0481 uni0481 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0482 uni0482 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0483 uni0483 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0484 uni0484 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0485 uni0485 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0486 uni0486 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0487 uni0487 2.9 (Sans, Sans Condensed) 2.27 (Sans Bold, Sans Bold Oblique, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0488 uni0488 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0489 uni0489 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+048a uni048A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+048b uni048B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+048c uni048C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+048d uni048D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+048e uni048E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+048f uni048F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0490 uni0490 1.15 -U+0491 uni0491 1.15 -U+0492 uni0492 1.14 -U+0493 uni0493 1.14 -U+0494 uni0494 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0495 uni0495 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+0496 uni0496 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0497 uni0497 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.15 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0498 uni0498 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+0499 uni0499 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+049a uni049A 1.14 -U+049b uni049B 1.14 -U+049c uni049C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+049d uni049D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+049e uni049E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+049f uni049F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04a0 uni04A0 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+04a1 uni04A1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+04a2 uni04A2 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04a3 uni04A3 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04a4 uni04A4 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04a5 uni04A5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04a6 uni04A6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04a7 uni04A7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04a8 uni04A8 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04a9 uni04A9 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04aa uni04AA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04ab uni04AB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04ac uni04AC 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04ad uni04AD 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04ae uni04AE 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04af uni04AF 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04b0 uni04B0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+04b1 uni04B1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+04b2 uni04B2 1.14 -U+04b3 uni04B3 1.14 -U+04b4 uni04B4 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04b5 uni04B5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04b6 uni04B6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04b7 uni04B7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04b8 uni04B8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04b9 uni04B9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04ba uni04BA 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04bb uni04BB 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04bc uni04BC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04bd uni04BD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04be uni04BE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04bf uni04BF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04c0 uni04C0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04c1 uni04C1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04c2 uni04C2 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04c3 uni04C3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04c4 uni04C4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04c5 uni04C5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04c6 uni04C6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04c7 uni04C7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+04c8 uni04C8 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+04c9 uni04C9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04ca uni04CA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04cb uni04CB 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04cc uni04CC 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04cd uni04CD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04ce uni04CE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04cf uni04CF 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04d0 uni04D0 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d1 uni04D1 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d2 uni04D2 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d3 uni04D3 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d4 uni04D4 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d5 uni04D5 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d6 uni04D6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d7 uni04D7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04d8 uni04D8 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04d9 uni04D9 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04da uni04DA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04db uni04DB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04dc uni04DC 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04dd uni04DD 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04de uni04DE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04df uni04DF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04e0 uni04E0 2.3 -U+04e1 uni04E1 2.3 -U+04e2 uni04E2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04e3 uni04E3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04e4 uni04E4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04e5 uni04E5 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04e6 uni04E6 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04e7 uni04E7 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04e8 uni04E8 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04e9 uni04E9 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04ea uni04EA 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04eb uni04EB 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+04ec uni04EC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04ed uni04ED 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04ee uni04EE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04ef uni04EF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f0 uni04F0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04f1 uni04F1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f2 uni04F2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04f3 uni04F3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f4 uni04F4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04f5 uni04F5 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04f6 uni04F6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f7 uni04F7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f8 uni04F8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+04f9 uni04F9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+04fa uni04FA 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04fb uni04FB 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04fc uni04FC 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04fd uni04FD 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+04fe uni04FE 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+04ff uni04FF 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0500 uni0500 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0501 uni0501 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0502 uni0502 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0503 uni0503 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0504 uni0504 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0505 uni0505 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0506 uni0506 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0507 uni0507 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0508 uni0508 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0509 uni0509 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050a uni050A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050b uni050B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050c uni050C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050d uni050D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050e uni050E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+050f uni050F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0510 uni0510 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0511 uni0511 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0512 uni0512 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0513 uni0513 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0514 uni0514 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0515 uni0515 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0516 uni0516 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0517 uni0517 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0518 uni0518 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0519 uni0519 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+051a uni051A 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+051b uni051B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+051c uni051C 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+051d uni051D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+0520 uni0520 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0521 uni0521 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0522 uni0522 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0523 uni0523 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0524 uni0524 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0525 uni0525 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0531 uni0531 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0532 uni0532 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0533 uni0533 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0534 uni0534 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0535 uni0535 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0536 uni0536 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0537 uni0537 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0538 uni0538 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0539 uni0539 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053a uni053A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053b uni053B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053c uni053C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053d uni053D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053e uni053E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+053f uni053F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0540 uni0540 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0541 uni0541 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0542 uni0542 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0543 uni0543 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0544 uni0544 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0545 uni0545 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0546 uni0546 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0547 uni0547 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0548 uni0548 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+0549 uni0549 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+054a uni054A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+054b uni054B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+054c uni054C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+054d uni054D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+054e uni054E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+054f uni054F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0550 uni0550 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0551 uni0551 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0552 uni0552 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0553 uni0553 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+0554 uni0554 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0555 uni0555 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0556 uni0556 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0559 uni0559 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+055a uni055A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+055b uni055B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+055c uni055C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+055d uni055D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+055e uni055E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+055f uni055F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0561 uni0561 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+0562 uni0562 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0563 uni0563 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0564 uni0564 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0565 uni0565 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0566 uni0566 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0567 uni0567 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0568 uni0568 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0569 uni0569 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+056a uni056A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+056b uni056B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+056c uni056C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+056d uni056D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+056e uni056E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+056f uni056F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+0570 uni0570 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0571 uni0571 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0572 uni0572 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0573 uni0573 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0574 uni0574 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0575 uni0575 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0576 uni0576 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0577 uni0577 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0578 uni0578 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0579 uni0579 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+057a uni057A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+057b uni057B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+057c uni057C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+057d uni057D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+057e uni057E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+057f uni057F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+0580 uni0580 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0581 uni0581 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0582 uni0582 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0583 uni0583 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+0584 uni0584 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0585 uni0585 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+0586 uni0586 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0587 uni0587 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+0589 uni0589 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) -U+058a uni058A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b0 uni05B0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b1 uni05B1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b2 uni05B2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b3 uni05B3 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b4 uni05B4 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b5 uni05B5 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b6 uni05B6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b7 uni05B7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b8 uni05B8 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05b9 uni05B9 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05ba uni05BA 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+05bb uni05BB 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05bc uni05BC 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05bd uni05BD 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05be uni05BE 2.9 (Sans Condensed Oblique, Sans Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique) -U+05bf uni05BF 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c0 uni05C0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c1 uni05C1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c2 uni05C2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c3 uni05C3 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c6 uni05C6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05c7 uni05C7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d0 uni05D0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d1 uni05D1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d2 uni05D2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d3 uni05D3 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d4 uni05D4 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d5 uni05D5 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d6 uni05D6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d7 uni05D7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d8 uni05D8 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05d9 uni05D9 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05da uni05DA 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05db uni05DB 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05dc uni05DC 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05dd uni05DD 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05de uni05DE 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05df uni05DF 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e0 uni05E0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e1 uni05E1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e2 uni05E2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e3 uni05E3 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e4 uni05E4 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e5 uni05E5 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e6 uni05E6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e7 uni05E7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e8 uni05E8 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05e9 uni05E9 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05ea uni05EA 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05f0 uni05F0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05f1 uni05F1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05f2 uni05F2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+05f3 uni05F3 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+05f4 uni05F4 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0606 uni0606 2.26 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold) -U+0607 uni0607 2.26 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold) -U+0609 uni0609 2.26 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold) -U+060a uni060A 2.26 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold) -U+060c uni060C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0615 uni0615 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+061b uni061B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+061f uni061F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0621 uni0621 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0622 uni0622 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0623 uni0623 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0624 uni0624 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0625 uni0625 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0626 uni0626 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0627 uni0627 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0628 uni0628 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0629 uni0629 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062a uni062A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062b uni062B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062c uni062C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062d uni062D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062e uni062E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+062f uni062F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0630 uni0630 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0631 uni0631 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0632 uni0632 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0633 uni0633 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0634 uni0634 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0635 uni0635 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0636 uni0636 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0637 uni0637 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0638 uni0638 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0639 uni0639 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+063a uni063A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0640 uni0640 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0641 uni0641 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0642 uni0642 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0643 uni0643 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0644 uni0644 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0645 uni0645 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0646 uni0646 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0647 uni0647 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0648 uni0648 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0649 uni0649 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064a uni064A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064b uni064B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064c uni064C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064d uni064D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064e uni064E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+064f uni064F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0650 uni0650 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0651 uni0651 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0652 uni0652 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0653 uni0653 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0654 uni0654 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0655 uni0655 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+065a uni065A 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0660 uni0660 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0661 uni0661 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0662 uni0662 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0663 uni0663 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0664 uni0664 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0665 uni0665 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0666 uni0666 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0667 uni0667 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0668 uni0668 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0669 uni0669 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066a uni066A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066b uni066B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066c uni066C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066d uni066D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066e uni066E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+066f uni066F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0674 uni0674 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans ExtraLight) 2.16 (Sans Mono, Sans Mono Bold) -U+0679 uni0679 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067a uni067A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067b uni067B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067c uni067C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067d uni067D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067e uni067E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+067f uni067F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0680 uni0680 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0681 uni0681 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0682 uni0682 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0683 uni0683 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0684 uni0684 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0685 uni0685 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0686 uni0686 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0687 uni0687 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0691 uni0691 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0692 uni0692 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+0695 uni0695 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+0698 uni0698 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06a1 uni06A1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06a4 uni06A4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06a6 uni06A6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+06a9 uni06A9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06af uni06AF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06b5 uni06B5 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06ba uni06BA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06be uni06BE 2.16 (Sans Mono, Sans Mono Bold) -U+06bf uni06BF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+06c6 uni06C6 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06cc uni06CC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06ce uni06CE 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06d5 uni06D5 2.10 (Sans, Sans Bold) 2.11 (Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f0 uni06F0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f1 uni06F1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f2 uni06F2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f3 uni06F3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f4 uni06F4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f5 uni06F5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f6 uni06F6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f7 uni06F7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f8 uni06F8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+06f9 uni06F9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+07c0 uni07C0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c1 uni07C1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c2 uni07C2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c3 uni07C3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c4 uni07C4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c5 uni07C5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c6 uni07C6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c7 uni07C7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c8 uni07C8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07c9 uni07C9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ca uni07CA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07cb uni07CB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07cc uni07CC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07cd uni07CD 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ce uni07CE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07cf uni07CF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d0 uni07D0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d1 uni07D1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d2 uni07D2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d3 uni07D3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d4 uni07D4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d5 uni07D5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d6 uni07D6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d7 uni07D7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d8 uni07D8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07d9 uni07D9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07da uni07DA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07db uni07DB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07dc uni07DC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07dd uni07DD 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07de uni07DE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07df uni07DF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e0 uni07E0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e1 uni07E1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e2 uni07E2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e3 uni07E3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e4 uni07E4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e5 uni07E5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e6 uni07E6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07e7 uni07E7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07eb uni07EB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ec uni07EC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ed uni07ED 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ee uni07EE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07ef uni07EF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f0 uni07F0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f1 uni07F1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f2 uni07F2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f3 uni07F3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f4 uni07F4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f5 uni07F5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f8 uni07F8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07f9 uni07F9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+07fa uni07FA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+0e3f uni0E3F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0e81 uni0E81 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e82 uni0E82 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e84 uni0E84 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e87 uni0E87 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e88 uni0E88 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e8a uni0E8A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e8d uni0E8D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e94 uni0E94 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e95 uni0E95 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e96 uni0E96 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e97 uni0E97 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e99 uni0E99 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9a uni0E9A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9b uni0E9B 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9c uni0E9C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9d uni0E9D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9e uni0E9E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0e9f uni0E9F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ea1 uni0EA1 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ea2 uni0EA2 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ea3 uni0EA3 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ea5 uni0EA5 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ea7 uni0EA7 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eaa uni0EAA 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eab uni0EAB 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ead uni0EAD 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eae uni0EAE 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eaf uni0EAF 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb0 uni0EB0 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb1 uni0EB1 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb2 uni0EB2 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb3 uni0EB3 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb4 uni0EB4 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb5 uni0EB5 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb6 uni0EB6 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb7 uni0EB7 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb8 uni0EB8 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eb9 uni0EB9 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ebb uni0EBB 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ebc uni0EBC 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ebd uni0EBD 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec0 uni0EC0 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec1 uni0EC1 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec2 uni0EC2 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec3 uni0EC3 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec4 uni0EC4 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec6 uni0EC6 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ec8 uni0EC8 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ec9 uni0EC9 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0eca uni0ECA 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ecb uni0ECB 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ecc uni0ECC 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ecd uni0ECD 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+0ed0 uni0ED0 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed1 uni0ED1 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed2 uni0ED2 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed3 uni0ED3 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed4 uni0ED4 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed5 uni0ED5 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed6 uni0ED6 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed7 uni0ED7 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0ed8 uni0ED8 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+0ed9 uni0ED9 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0edc uni0EDC 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+0edd uni0EDD 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+10a0 uni10A0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a1 uni10A1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a2 uni10A2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a3 uni10A3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a4 uni10A4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a5 uni10A5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a6 uni10A6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a7 uni10A7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a8 uni10A8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10a9 uni10A9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10aa uni10AA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ab uni10AB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ac uni10AC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ad uni10AD 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ae uni10AE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10af uni10AF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b0 uni10B0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b1 uni10B1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b2 uni10B2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b3 uni10B3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b4 uni10B4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b5 uni10B5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b6 uni10B6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b7 uni10B7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b8 uni10B8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10b9 uni10B9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ba uni10BA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10bb uni10BB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10bc uni10BC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10bd uni10BD 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10be uni10BE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10bf uni10BF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c0 uni10C0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c1 uni10C1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c2 uni10C2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c3 uni10C3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c4 uni10C4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10c5 uni10C5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d0 uni10D0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d1 uni10D1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d2 uni10D2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d3 uni10D3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d4 uni10D4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d5 uni10D5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d6 uni10D6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d7 uni10D7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d8 uni10D8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10d9 uni10D9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10da uni10DA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10db uni10DB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10dc uni10DC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10dd uni10DD 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10de uni10DE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10df uni10DF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e0 uni10E0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e1 uni10E1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e2 uni10E2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e3 uni10E3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e4 uni10E4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e5 uni10E5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e6 uni10E6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e7 uni10E7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e8 uni10E8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10e9 uni10E9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ea uni10EA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10eb uni10EB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ec uni10EC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ed uni10ED 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ee uni10EE 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10ef uni10EF 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f0 uni10F0 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f1 uni10F1 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f2 uni10F2 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f3 uni10F3 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f4 uni10F4 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f5 uni10F5 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f6 uni10F6 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f7 uni10F7 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f8 uni10F8 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10f9 uni10F9 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10fa uni10FA 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10fb uni10FB 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+10fc uni10FC 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Mono, Sans Mono Bold, Serif, Serif Bold, Serif Condensed, Serif Condensed Bold) 2.20 (Sans Bold Oblique, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+1401 uni1401 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1402 uni1402 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1403 uni1403 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1404 uni1404 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1405 uni1405 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1406 uni1406 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1407 uni1407 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1409 uni1409 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140a uni140A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140b uni140B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140c uni140C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140d uni140D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140e uni140E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+140f uni140F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1410 uni1410 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1411 uni1411 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1412 uni1412 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1413 uni1413 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1414 uni1414 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1415 uni1415 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1416 uni1416 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1417 uni1417 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1418 uni1418 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1419 uni1419 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+141a uni141A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+141b uni141B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+141d uni141D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+141e uni141E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+141f uni141F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1420 uni1420 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1421 uni1421 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1422 uni1422 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1423 uni1423 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1424 uni1424 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1425 uni1425 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1426 uni1426 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1427 uni1427 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1428 uni1428 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1429 uni1429 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142a uni142A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142b uni142B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142c uni142C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142d uni142D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142e uni142E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+142f uni142F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1430 uni1430 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1431 uni1431 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1432 uni1432 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1433 uni1433 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1434 uni1434 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1435 uni1435 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1437 uni1437 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1438 uni1438 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1439 uni1439 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143a uni143A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143b uni143B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143c uni143C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143d uni143D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143e uni143E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+143f uni143F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1440 uni1440 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1441 uni1441 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1442 uni1442 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1443 uni1443 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1444 uni1444 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1445 uni1445 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1446 uni1446 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1447 uni1447 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1448 uni1448 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1449 uni1449 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+144a uni144A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+144c uni144C 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+144d uni144D 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+144e uni144E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+144f uni144F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1450 uni1450 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1451 uni1451 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1452 uni1452 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1454 uni1454 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1455 uni1455 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1456 uni1456 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1457 uni1457 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1458 uni1458 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1459 uni1459 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145a uni145A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145b uni145B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145c uni145C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145d uni145D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145e uni145E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+145f uni145F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1460 uni1460 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1461 uni1461 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1462 uni1462 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1463 uni1463 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1464 uni1464 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1465 uni1465 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1466 uni1466 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1467 uni1467 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1468 uni1468 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1469 uni1469 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146a uni146A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146b uni146B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146c uni146C 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146d uni146D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146e uni146E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+146f uni146F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1470 uni1470 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1471 uni1471 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1472 uni1472 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1473 uni1473 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1474 uni1474 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1475 uni1475 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1476 uni1476 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1477 uni1477 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1478 uni1478 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1479 uni1479 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147a uni147A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147b uni147B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147c uni147C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147d uni147D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147e uni147E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+147f uni147F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1480 uni1480 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1481 uni1481 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1482 uni1482 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1483 uni1483 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1484 uni1484 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1485 uni1485 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1486 uni1486 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1487 uni1487 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1488 uni1488 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1489 uni1489 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148a uni148A 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148b uni148B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148c uni148C 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148d uni148D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148e uni148E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+148f uni148F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1490 uni1490 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1491 uni1491 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1492 uni1492 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1493 uni1493 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1494 uni1494 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1495 uni1495 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1496 uni1496 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1497 uni1497 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1498 uni1498 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1499 uni1499 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149a uni149A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149b uni149B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149c uni149C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149d uni149D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149e uni149E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+149f uni149F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a0 uni14A0 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a1 uni14A1 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a2 uni14A2 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a3 uni14A3 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a4 uni14A4 2.13 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Oblique) 2.15 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+14a5 uni14A5 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a6 uni14A6 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a7 uni14A7 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a8 uni14A8 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14a9 uni14A9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14aa uni14AA 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ab uni14AB 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ac uni14AC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ad uni14AD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ae uni14AE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14af uni14AF 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b0 uni14B0 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b1 uni14B1 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b2 uni14B2 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b3 uni14B3 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b4 uni14B4 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b5 uni14B5 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b6 uni14B6 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b7 uni14B7 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b8 uni14B8 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14b9 uni14B9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ba uni14BA 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14bb uni14BB 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14bc uni14BC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14bd uni14BD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c0 uni14C0 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c1 uni14C1 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c2 uni14C2 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c3 uni14C3 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c4 uni14C4 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c5 uni14C5 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c6 uni14C6 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c7 uni14C7 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c8 uni14C8 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14c9 uni14C9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ca uni14CA 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14cb uni14CB 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14cc uni14CC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14cd uni14CD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ce uni14CE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14cf uni14CF 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d0 uni14D0 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d1 uni14D1 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d2 uni14D2 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d3 uni14D3 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d4 uni14D4 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d5 uni14D5 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d6 uni14D6 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d7 uni14D7 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d8 uni14D8 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14d9 uni14D9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14da uni14DA 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14db uni14DB 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14dc uni14DC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14dd uni14DD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14de uni14DE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14df uni14DF 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e0 uni14E0 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e1 uni14E1 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e2 uni14E2 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e3 uni14E3 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e4 uni14E4 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e5 uni14E5 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e6 uni14E6 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e7 uni14E7 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e8 uni14E8 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14e9 uni14E9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ea uni14EA 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ec uni14EC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ed uni14ED 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ee uni14EE 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ef uni14EF 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f0 uni14F0 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f1 uni14F1 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f2 uni14F2 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f3 uni14F3 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f4 uni14F4 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f5 uni14F5 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f6 uni14F6 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f7 uni14F7 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f8 uni14F8 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14f9 uni14F9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14fa uni14FA 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14fb uni14FB 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14fc uni14FC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14fd uni14FD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14fe uni14FE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+14ff uni14FF 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1500 uni1500 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1501 uni1501 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1502 uni1502 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1503 uni1503 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1504 uni1504 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1505 uni1505 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1506 uni1506 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1507 uni1507 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1510 uni1510 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1511 uni1511 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1512 uni1512 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1513 uni1513 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1514 uni1514 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1515 uni1515 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1516 uni1516 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1517 uni1517 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1518 uni1518 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1519 uni1519 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151a uni151A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151b uni151B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151c uni151C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151d uni151D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151e uni151E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+151f uni151F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1520 uni1520 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1521 uni1521 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1522 uni1522 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1523 uni1523 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1524 uni1524 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1525 uni1525 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1526 uni1526 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1527 uni1527 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1528 uni1528 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1529 uni1529 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152a uni152A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152b uni152B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152c uni152C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152d uni152D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152e uni152E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+152f uni152F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1530 uni1530 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1531 uni1531 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1532 uni1532 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1533 uni1533 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1534 uni1534 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1535 uni1535 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1536 uni1536 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1537 uni1537 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1538 uni1538 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1539 uni1539 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+153a uni153A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+153b uni153B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+153c uni153C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+153d uni153D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+153e uni153E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1540 uni1540 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1541 uni1541 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1542 uni1542 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1543 uni1543 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1544 uni1544 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1545 uni1545 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1546 uni1546 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1547 uni1547 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1548 uni1548 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1549 uni1549 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154a uni154A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154b uni154B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154c uni154C 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154d uni154D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154e uni154E 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+154f uni154F 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1550 uni1550 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1552 uni1552 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1553 uni1553 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1554 uni1554 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1555 uni1555 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1556 uni1556 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1557 uni1557 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1558 uni1558 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1559 uni1559 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155a uni155A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155b uni155B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155c uni155C 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155d uni155D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155e uni155E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+155f uni155F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1560 uni1560 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1561 uni1561 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1562 uni1562 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1563 uni1563 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1564 uni1564 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1565 uni1565 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1566 uni1566 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1567 uni1567 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1568 uni1568 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1569 uni1569 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+156a uni156A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1574 uni1574 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1575 uni1575 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1576 uni1576 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1577 uni1577 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1578 uni1578 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1579 uni1579 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157a uni157A 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157b uni157B 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157c uni157C 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157d uni157D 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157e uni157E 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+157f uni157F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1580 uni1580 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1581 uni1581 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1582 uni1582 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1583 uni1583 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1584 uni1584 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1585 uni1585 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158a uni158A 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158b uni158B 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158c uni158C 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158d uni158D 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158e uni158E 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+158f uni158F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1590 uni1590 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1591 uni1591 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1592 uni1592 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1593 uni1593 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1594 uni1594 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1595 uni1595 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1596 uni1596 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a0 uni15A0 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a1 uni15A1 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a2 uni15A2 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a3 uni15A3 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a4 uni15A4 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a5 uni15A5 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a6 uni15A6 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a7 uni15A7 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a8 uni15A8 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15a9 uni15A9 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15aa uni15AA 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15ab uni15AB 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15ac uni15AC 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15ad uni15AD 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15ae uni15AE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15af uni15AF 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15de uni15DE 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+15e1 uni15E1 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1646 uni1646 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1647 uni1647 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+166e uni166E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+166f uni166F 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1670 uni1670 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1671 uni1671 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1672 uni1672 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1673 uni1673 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1674 uni1674 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1675 uni1675 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1676 uni1676 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1680 uni1680 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1681 uni1681 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1682 uni1682 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1683 uni1683 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1684 uni1684 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1685 uni1685 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1686 uni1686 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1687 uni1687 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1688 uni1688 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1689 uni1689 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168a uni168A 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168b uni168B 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168c uni168C 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168d uni168D 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168e uni168E 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+168f uni168F 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1690 uni1690 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1691 uni1691 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1692 uni1692 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1693 uni1693 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1694 uni1694 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1695 uni1695 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1696 uni1696 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1697 uni1697 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1698 uni1698 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1699 uni1699 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+169a uni169A 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+169b uni169B 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+169c uni169C 2.22 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.28 (Sans ExtraLight) -U+1d00 uni1D00 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d01 uni1D01 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d02 uni1D02 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1d03 uni1D03 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d04 uni1D04 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d05 uni1D05 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d06 uni1D06 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d07 uni1D07 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d08 uni1D08 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+1d09 uni1D09 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1d0a uni1D0A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d0b uni1D0B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d0c uni1D0C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d0d uni1D0D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d0e uni1D0E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d0f uni1D0F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d10 uni1D10 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d11 uni1D11 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d12 uni1D12 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d13 uni1D13 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d14 uni1D14 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1d16 uni1D16 2.3 -U+1d17 uni1D17 2.3 -U+1d18 uni1D18 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d19 uni1D19 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+1d1a uni1D1A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+1d1b uni1D1B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d1c uni1D1C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d1d uni1D1D 2.3 -U+1d1e uni1D1E 2.3 -U+1d1f uni1D1F 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+1d20 uni1D20 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d21 uni1D21 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d22 uni1D22 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d23 uni1D23 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d26 uni1D26 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d27 uni1D27 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d28 uni1D28 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+1d29 uni1D29 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d2a uni1D2A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d2b uni1D2B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans ExtraLight) -U+1d2c uni1D2C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d2d uni1D2D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d2e uni1D2E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d30 uni1D30 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d31 uni1D31 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d32 uni1D32 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d33 uni1D33 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d34 uni1D34 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d35 uni1D35 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d36 uni1D36 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d37 uni1D37 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d38 uni1D38 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d39 uni1D39 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d3a uni1D3A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d3b uni1D3B 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d3c uni1D3C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d3d uni1D3D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono Oblique) -U+1d3e uni1D3E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d3f uni1D3F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d40 uni1D40 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d41 uni1D41 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d42 uni1D42 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d43 uni1D43 2.3 -U+1d44 uni1D44 2.3 -U+1d45 uni1D45 2.3 -U+1d46 uni1D46 2.3 -U+1d47 uni1D47 2.3 -U+1d48 uni1D48 2.3 -U+1d49 uni1D49 2.3 -U+1d4a uni1D4A 2.3 -U+1d4b uni1D4B 2.3 -U+1d4c uni1D4C 2.3 -U+1d4d uni1D4D 2.3 -U+1d4e uni1D4E 2.3 -U+1d4f uni1D4F 2.3 -U+1d50 uni1D50 2.3 -U+1d51 uni1D51 2.3 -U+1d52 uni1D52 2.3 -U+1d53 uni1D53 2.3 -U+1d54 uni1D54 2.3 -U+1d55 uni1D55 2.3 -U+1d56 uni1D56 2.3 -U+1d57 uni1D57 2.3 -U+1d58 uni1D58 2.3 -U+1d59 uni1D59 2.3 -U+1d5a uni1D5A 2.3 -U+1d5b uni1D5B 2.3 -U+1d5d uni1D5D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d5e uni1D5E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d5f uni1D5F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d60 uni1D60 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d61 uni1D61 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d62 uni1D62 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d63 uni1D63 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d64 uni1D64 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d65 uni1D65 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d66 uni1D66 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d67 uni1D67 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d68 uni1D68 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d69 uni1D69 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d6a uni1D6A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1d77 uni1D77 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1d78 uni1D78 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1d7b uni1D7B 2.3 -U+1d85 uni1D85 2.3 -U+1d9b uni1D9B 2.3 -U+1d9c uni1D9C 2.3 -U+1d9d uni1D9D 2.3 -U+1d9e uni1D9E 2.3 -U+1d9f uni1D9F 2.3 -U+1da0 uni1DA0 2.3 -U+1da1 uni1DA1 2.3 -U+1da2 uni1DA2 2.3 -U+1da3 uni1DA3 2.3 -U+1da4 uni1DA4 2.3 -U+1da5 uni1DA5 2.3 -U+1da6 uni1DA6 2.3 -U+1da7 uni1DA7 2.3 -U+1da8 uni1DA8 2.3 -U+1da9 uni1DA9 2.3 -U+1daa uni1DAA 2.3 -U+1dab uni1DAB 2.3 -U+1dac uni1DAC 2.3 -U+1dad uni1DAD 2.3 -U+1dae uni1DAE 2.3 -U+1daf uni1DAF 2.3 -U+1db0 uni1DB0 2.3 -U+1db1 uni1DB1 2.3 -U+1db2 uni1DB2 2.3 -U+1db3 uni1DB3 2.3 -U+1db4 uni1DB4 2.3 -U+1db5 uni1DB5 2.3 -U+1db6 uni1DB6 2.3 -U+1db7 uni1DB7 2.3 -U+1db8 uni1DB8 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+1db9 uni1DB9 2.3 -U+1dba uni1DBA 2.3 -U+1dbb uni1DBB 2.3 -U+1dbc uni1DBC 2.3 -U+1dbd uni1DBD 2.3 -U+1dbe uni1DBE 2.3 -U+1dbf uni1DBF 2.3 -U+1dc4 uni1DC4 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1dc5 uni1DC5 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1dc6 uni1DC6 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1dc7 uni1DC7 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1dc8 uni1DC8 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1dc9 uni1DC9 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1e00 uni1E00 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e01 uni1E01 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e02 uni1E02 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e03 uni1E03 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e04 uni1E04 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e05 uni1E05 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e06 uni1E06 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e07 uni1E07 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e08 uni1E08 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e09 uni1E09 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e0a uni1E0A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e0b uni1E0B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e0c uni1E0C 2.1 -U+1e0d uni1E0D 2.1 -U+1e0e uni1E0E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e0f uni1E0F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e10 uni1E10 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e11 uni1E11 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e12 uni1E12 1.13 -U+1e13 uni1E13 1.13 -U+1e14 uni1E14 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e15 uni1E15 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e16 uni1E16 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e17 uni1E17 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e18 uni1E18 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e19 uni1E19 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e1a uni1E1A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e1b uni1E1B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e1c uni1E1C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.17 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1e1d uni1E1D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.17 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+1e1e uni1E1E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e1f uni1E1F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e20 uni1E20 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e21 uni1E21 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e22 uni1E22 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e23 uni1E23 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e24 uni1E24 2.1 -U+1e25 uni1E25 2.1 -U+1e26 uni1E26 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e27 uni1E27 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e28 uni1E28 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e29 uni1E29 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e2a uni1E2A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e2b uni1E2B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e2c uni1E2C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e2d uni1E2D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e2e uni1E2E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e2f uni1E2F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e30 uni1E30 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e31 uni1E31 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e32 uni1E32 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e33 uni1E33 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e34 uni1E34 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e35 uni1E35 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e36 uni1E36 2.1 -U+1e37 uni1E37 2.1 -U+1e38 uni1E38 2.1 -U+1e39 uni1E39 2.1 -U+1e3a uni1E3A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e3b uni1E3B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e3c uni1E3C 1.13 -U+1e3d uni1E3D 1.13 -U+1e3e uni1E3E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e3f uni1E3F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e40 uni1E40 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e41 uni1E41 2.1 -U+1e42 uni1E42 2.1 -U+1e43 uni1E43 2.1 -U+1e44 uni1E44 1.13 -U+1e45 uni1E45 1.13 -U+1e46 uni1E46 2.1 -U+1e47 uni1E47 2.1 -U+1e48 uni1E48 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e49 uni1E49 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e4a uni1E4A 1.13 -U+1e4b uni1E4B 1.13 -U+1e4c uni1E4C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1e4d uni1E4D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1e4e uni1E4E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e4f uni1E4F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e50 uni1E50 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e51 uni1E51 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e52 uni1E52 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e53 uni1E53 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e54 uni1E54 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e55 uni1E55 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e56 uni1E56 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e57 uni1E57 2.1 -U+1e58 uni1E58 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e59 uni1E59 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e5a uni1E5A 2.1 -U+1e5b uni1E5B 2.1 -U+1e5c uni1E5C 2.1 -U+1e5d uni1E5D 2.1 -U+1e5e uni1E5E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e5f uni1E5F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e60 uni1E60 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e61 uni1E61 2.1 -U+1e62 uni1E62 2.1 -U+1e63 uni1E63 2.1 -U+1e64 uni1E64 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+1e65 uni1E65 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+1e66 uni1E66 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e67 uni1E67 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1e68 uni1E68 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e69 uni1E69 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e6a uni1E6A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e6b uni1E6B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e6c uni1E6C 2.1 -U+1e6d uni1E6D 2.1 -U+1e6e uni1E6E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e6f uni1E6F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e70 uni1E70 1.13 -U+1e71 uni1E71 1.13 -U+1e72 uni1E72 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e73 uni1E73 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e74 uni1E74 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e75 uni1E75 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e76 uni1E76 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e77 uni1E77 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e78 uni1E78 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e79 uni1E79 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e7a uni1E7A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e7b uni1E7B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e7c uni1E7C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e7d uni1E7D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e7e uni1E7E 2.1 -U+1e7f uni1E7F 2.1 -U+1e80 Wgrave 1.2 -U+1e81 wgrave 1.2 -U+1e82 Wacute 1.2 -U+1e83 wacute 1.2 -U+1e84 Wdieresis 1.2 -U+1e85 wdieresis 1.2 -U+1e86 uni1E86 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e87 uni1E87 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e88 uni1E88 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e89 uni1E89 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e8a uni1E8A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e8b uni1E8B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e8c uni1E8C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e8d uni1E8D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e8e uni1E8E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e8f uni1E8F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e90 uni1E90 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e91 uni1E91 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e92 uni1E92 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e93 uni1E93 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e94 uni1E94 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e95 uni1E95 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e96 uni1E96 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e97 uni1E97 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e98 uni1E98 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e99 uni1E99 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1e9a uni1E9A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1e9b uni1E9B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1e9e uni1E9E 2.28 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1e9f uni1E9F 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+1ea0 uni1EA0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ea1 uni1EA1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ea2 uni1EA2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ea3 uni1EA3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ea4 uni1EA4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ea5 uni1EA5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ea6 uni1EA6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ea7 uni1EA7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ea8 uni1EA8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ea9 uni1EA9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1eaa uni1EAA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1eab uni1EAB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1eac uni1EAC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ead uni1EAD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eae uni1EAE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eaf uni1EAF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eb0 uni1EB0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1eb1 uni1EB1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.22 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1eb2 uni1EB2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eb3 uni1EB3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eb4 uni1EB4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eb5 uni1EB5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eb6 uni1EB6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eb7 uni1EB7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eb8 uni1EB8 2.2 -U+1eb9 uni1EB9 2.2 -U+1eba uni1EBA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ebb uni1EBB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ebc uni1EBC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ebd uni1EBD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ebe uni1EBE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ebf uni1EBF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec0 uni1EC0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec1 uni1EC1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec2 uni1EC2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec3 uni1EC3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec4 uni1EC4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec5 uni1EC5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ec6 uni1EC6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ec7 uni1EC7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ec8 uni1EC8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ec9 uni1EC9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1eca uni1ECA 2.2 -U+1ecb uni1ECB 2.2 -U+1ecc uni1ECC 2.2 -U+1ecd uni1ECD 2.2 -U+1ece uni1ECE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ecf uni1ECF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ed0 uni1ED0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed1 uni1ED1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed2 uni1ED2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed3 uni1ED3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed4 uni1ED4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed5 uni1ED5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed6 uni1ED6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed7 uni1ED7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ed8 uni1ED8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ed9 uni1ED9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eda uni1EDA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1edb uni1EDB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1edc uni1EDC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1edd uni1EDD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ede uni1EDE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1edf uni1EDF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1ee0 uni1EE0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ee1 uni1EE1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ee2 uni1EE2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ee3 uni1EE3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ee4 uni1EE4 2.2 -U+1ee5 uni1EE5 2.2 -U+1ee6 uni1EE6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ee7 uni1EE7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ee8 uni1EE8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ee9 uni1EE9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eea uni1EEA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eeb uni1EEB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eec uni1EEC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1eed uni1EED 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+1eee uni1EEE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1eef uni1EEF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ef0 uni1EF0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ef1 uni1EF1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+1ef2 Ygrave 1.2 -U+1ef3 ygrave 1.2 -U+1ef4 uni1EF4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ef5 uni1EF5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ef6 uni1EF6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ef7 uni1EF7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ef8 uni1EF8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ef9 uni1EF9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f00 uni1F00 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f01 uni1F01 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f02 uni1F02 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f03 uni1F03 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f04 uni1F04 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f05 uni1F05 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f06 uni1F06 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f07 uni1F07 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f08 uni1F08 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f09 uni1F09 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0a uni1F0A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0b uni1F0B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0c uni1F0C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0d uni1F0D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0e uni1F0E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f0f uni1F0F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f10 uni1F10 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f11 uni1F11 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f12 uni1F12 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f13 uni1F13 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f14 uni1F14 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f15 uni1F15 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f18 uni1F18 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f19 uni1F19 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f1a uni1F1A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f1b uni1F1B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f1c uni1F1C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f1d uni1F1D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f20 uni1F20 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f21 uni1F21 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f22 uni1F22 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f23 uni1F23 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f24 uni1F24 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f25 uni1F25 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f26 uni1F26 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f27 uni1F27 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f28 uni1F28 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f29 uni1F29 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2a uni1F2A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2b uni1F2B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2c uni1F2C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2d uni1F2D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2e uni1F2E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f2f uni1F2F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f30 uni1F30 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f31 uni1F31 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f32 uni1F32 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f33 uni1F33 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f34 uni1F34 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f35 uni1F35 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f36 uni1F36 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f37 uni1F37 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f38 uni1F38 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f39 uni1F39 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3a uni1F3A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3b uni1F3B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3c uni1F3C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3d uni1F3D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3e uni1F3E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f3f uni1F3F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f40 uni1F40 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f41 uni1F41 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f42 uni1F42 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f43 uni1F43 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f44 uni1F44 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f45 uni1F45 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f48 uni1F48 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f49 uni1F49 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f4a uni1F4A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f4b uni1F4B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f4c uni1F4C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f4d uni1F4D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f50 uni1F50 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f51 uni1F51 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f52 uni1F52 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f53 uni1F53 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f54 uni1F54 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f55 uni1F55 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f56 uni1F56 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f57 uni1F57 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f59 uni1F59 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f5b uni1F5B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f5d uni1F5D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f5f uni1F5F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f60 uni1F60 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f61 uni1F61 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f62 uni1F62 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f63 uni1F63 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f64 uni1F64 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f65 uni1F65 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f66 uni1F66 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f67 uni1F67 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f68 uni1F68 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f69 uni1F69 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6a uni1F6A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6b uni1F6B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6c uni1F6C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6d uni1F6D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6e uni1F6E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f6f uni1F6F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f70 uni1F70 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f71 uni1F71 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f72 uni1F72 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f73 uni1F73 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f74 uni1F74 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f75 uni1F75 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f76 uni1F76 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f77 uni1F77 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f78 uni1F78 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f79 uni1F79 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1f7a uni1F7A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f7b uni1F7B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f7c uni1F7C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f7d uni1F7D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f80 uni1F80 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f81 uni1F81 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f82 uni1F82 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f83 uni1F83 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f84 uni1F84 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f85 uni1F85 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f86 uni1F86 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f87 uni1F87 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f88 uni1F88 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f89 uni1F89 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8a uni1F8A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8b uni1F8B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8c uni1F8C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8d uni1F8D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8e uni1F8E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f8f uni1F8F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f90 uni1F90 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f91 uni1F91 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f92 uni1F92 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f93 uni1F93 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f94 uni1F94 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f95 uni1F95 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f96 uni1F96 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f97 uni1F97 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f98 uni1F98 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f99 uni1F99 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9a uni1F9A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9b uni1F9B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9c uni1F9C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9d uni1F9D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9e uni1F9E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1f9f uni1F9F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa0 uni1FA0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa1 uni1FA1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa2 uni1FA2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa3 uni1FA3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa4 uni1FA4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa5 uni1FA5 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa6 uni1FA6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa7 uni1FA7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa8 uni1FA8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fa9 uni1FA9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1faa uni1FAA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fab uni1FAB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fac uni1FAC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fad uni1FAD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fae uni1FAE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1faf uni1FAF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb0 uni1FB0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb1 uni1FB1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb2 uni1FB2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb3 uni1FB3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb4 uni1FB4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb6 uni1FB6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb7 uni1FB7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fb8 uni1FB8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fb9 uni1FB9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fba uni1FBA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fbb uni1FBB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fbc uni1FBC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fbd uni1FBD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fbe uni1FBE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fbf uni1FBF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fc0 uni1FC0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fc1 uni1FC1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fc2 uni1FC2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fc3 uni1FC3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fc4 uni1FC4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fc6 uni1FC6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fc7 uni1FC7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fc8 uni1FC8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fc9 uni1FC9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fca uni1FCA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fcb uni1FCB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fcc uni1FCC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fcd uni1FCD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fce uni1FCE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fcf uni1FCF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd0 uni1FD0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd1 uni1FD1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd2 uni1FD2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd3 uni1FD3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd6 uni1FD6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd7 uni1FD7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fd8 uni1FD8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fd9 uni1FD9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fda uni1FDA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fdb uni1FDB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fdd uni1FDD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fde uni1FDE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fdf uni1FDF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe0 uni1FE0 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe1 uni1FE1 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe2 uni1FE2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe3 uni1FE3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe4 uni1FE4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe5 uni1FE5 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe6 uni1FE6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe7 uni1FE7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fe8 uni1FE8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fe9 uni1FE9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fea uni1FEA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1feb uni1FEB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fec uni1FEC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1fed uni1FED 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fee uni1FEE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1fef uni1FEF 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ff2 uni1FF2 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ff3 uni1FF3 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ff4 uni1FF4 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ff6 uni1FF6 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ff7 uni1FF7 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ff8 uni1FF8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ff9 uni1FF9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ffa uni1FFA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ffb uni1FFB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.10 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ffc uni1FFC 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+1ffd uni1FFD 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+1ffe uni1FFE 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.5 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+2000 uni2000 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2001 uni2001 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2002 uni2002 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2003 uni2003 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2004 uni2004 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2005 uni2005 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2006 uni2006 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2007 uni2007 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2008 uni2008 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2009 uni2009 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+200a uni200A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+200b uni200B 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.8 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+200c uni200C 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.8 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+200d uni200D 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.8 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+200e uni200E 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.8 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+200f uni200F 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.8 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2010 uni2010 1.5 -U+2011 uni2011 1.5 -U+2012 figuredash 1.5 -U+2013 endash original -U+2014 emdash original -U+2015 uni2015 1.5 -U+2016 uni2016 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2017 underscoredbl 2.3 -U+2018 quoteleft original -U+2019 quoteright original -U+201a quotesinglbase original -U+201b quotereversed 2.3 -U+201c quotedblleft original -U+201d quotedblright original -U+201e quotedblbase original -U+201f uni201F 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.3 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+2020 dagger original -U+2021 daggerdbl original -U+2022 bullet original -U+2023 uni2023 2.2 -U+2024 onedotenleader 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2025 twodotenleader 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2026 ellipsis original -U+2027 uni2027 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+202a uni202A 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+202b uni202B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+202c uni202C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+202d uni202D 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+202e uni202E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+202f uni202F 2.11 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.23 (Serif Italic Condensed) -U+2030 perthousand original -U+2031 uni2031 2.1 -U+2032 minute 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2033 second 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2034 uni2034 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2035 uni2035 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2036 uni2036 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2037 uni2037 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2038 uni2038 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2039 guilsinglleft original -U+203a guilsinglright original -U+203b uni203B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+203c exclamdbl 2.0 -U+203d uni203D 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.11 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.14 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+203e uni203E 2.3 -U+203f uni203F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2040 uni2040 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2041 uni2041 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2042 uni2042 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2043 uni2043 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2044 fraction 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2045 uni2045 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2046 uni2046 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2047 uni2047 2.0 -U+2048 uni2048 2.0 -U+2049 uni2049 2.0 -U+204a uni204A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+204b uni204B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+204c uni204C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+204d uni204D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+204e uni204E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+204f uni204F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2050 uni2050 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2051 uni2051 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2052 uni2052 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2053 uni2053 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2054 uni2054 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2055 uni2055 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2056 uni2056 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2057 uni2057 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2058 uni2058 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2059 uni2059 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205a uni205A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205b uni205B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205c uni205C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205d uni205D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205e uni205E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+205f uni205F 2.14 -U+2060 uni2060 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2061 uni2061 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2062 uni2062 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2063 uni2063 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2064 uni2064 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+206a uni206A 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+206b uni206B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+206c uni206C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+206d uni206D 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+206e uni206E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+206f uni206F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2070 uni2070 2.2 -U+2071 uni2071 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2074 uni2074 2.2 -U+2075 uni2075 2.2 -U+2076 uni2076 2.2 -U+2077 uni2077 2.2 -U+2078 uni2078 2.2 -U+2079 uni2079 2.2 -U+207a uni207A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+207b uni207B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+207c uni207C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+207d uni207D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+207e uni207E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+207f uni207F 1.14 -U+2080 uni2080 2.4 -U+2081 uni2081 2.4 -U+2082 uni2082 2.4 -U+2083 uni2083 2.4 -U+2084 uni2084 2.4 -U+2085 uni2085 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2086 uni2086 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2087 uni2087 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2088 uni2088 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2089 uni2089 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+208a uni208A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+208b uni208B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+208c uni208C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+208d uni208D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+208e uni208E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2090 uni2090 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2091 uni2091 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2092 uni2092 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2093 uni2093 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2094 uni2094 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.17 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.18 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+20a0 uni20A0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a1 colonmonetary 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a2 uni20A2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a3 franc 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a4 lira 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a5 uni20A5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a6 uni20A6 2.3 -U+20a7 peseta 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a8 uni20A8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20a9 uni20A9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20aa uni20AA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20ab dong 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20ac Euro original -U+20ad uni20AD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20ae uni20AE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20af uni20AF 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20b0 uni20B0 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20b1 uni20B1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.14 (Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+20b2 uni20B2 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20b3 uni20B3 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+20b4 uni20B4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+20b5 uni20B5 2.2 -U+20d0 uni20D0 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+20d1 uni20D1 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+20d6 uni20D6 2.8 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+20d7 uni20D7 2.8 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+20db uni20DB 2.23 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+20dc uni20DC 2.23 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+20e1 uni20E1 2.23 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2100 uni2100 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2101 uni2101 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2102 uni2102 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.16 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Condensed) -U+2103 uni2103 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2104 uni2104 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2105 uni2105 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2106 uni2106 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2107 uni2107 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2108 uni2108 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2109 uni2109 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+210b uni210B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+210c uni210C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+210d uni210D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+210e uni210E 2.5 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.23 (Serif Italic Condensed) 2.26 (Sans ExtraLight) -U+210f uni210F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.28 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2110 uni2110 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2111 Ifraktur 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2112 uni2112 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2113 uni2113 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2114 uni2114 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2115 uni2115 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2116 uni2116 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2117 uni2117 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2118 weierstrass 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2119 uni2119 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+211a uni211A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+211b uni211B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+211c Rfraktur 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+211d uni211D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+211e prescription 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+211f uni211F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2120 uni2120 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2121 uni2121 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2122 trademark original -U+2123 uni2123 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2124 uni2124 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2125 uni2125 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2126 uni2126 2.2 -U+2127 uni2127 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2128 uni2128 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2129 uni2129 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+212a uni212A 2.2 -U+212b uni212B 2.2 -U+212c uni212C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+212d uni212D 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+212e estimated 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+212f uni212F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2130 uni2130 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2131 uni2131 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2132 uni2132 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) -U+2133 uni2133 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2134 uni2134 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2135 aleph 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2136 uni2136 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2137 uni2137 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2138 uni2138 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2139 uni2139 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+213a uni213A 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+213b uni213B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+213c uni213C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+213d uni213D 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+213e uni213E 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+213f uni213F 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2140 uni2140 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2141 uni2141 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2142 uni2142 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2143 uni2143 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2144 uni2144 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2145 uni2145 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2146 uni2146 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2147 uni2147 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2148 uni2148 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+2149 uni2149 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.22 (Serif, Serif Condensed) -U+214b uni214B 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+214e uni214E 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2153 onethird 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2154 twothirds 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2155 uni2155 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2156 uni2156 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2157 uni2157 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2158 uni2158 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2159 uni2159 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215a uni215A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215b oneeighth 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215c threeeighths 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215d fiveeighths 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215e seveneighths 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+215f uni215F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.6 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2160 uni2160 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2161 uni2161 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2162 uni2162 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2163 uni2163 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2164 uni2164 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2165 uni2165 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2166 uni2166 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2167 uni2167 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2168 uni2168 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2169 uni2169 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216a uni216A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216b uni216B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216c uni216C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216d uni216D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216e uni216E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+216f uni216F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2170 uni2170 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2171 uni2171 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2172 uni2172 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2173 uni2173 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2174 uni2174 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2175 uni2175 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2176 uni2176 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2177 uni2177 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2178 uni2178 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2179 uni2179 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217a uni217A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217b uni217B 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217c uni217C 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217d uni217D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217e uni217E 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+217f uni217F 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2180 uni2180 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2181 uni2181 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2182 uni2182 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2183 uni2183 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2184 uni2184 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2190 arrowleft 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2191 arrowup 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2192 arrowright 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2193 arrowdown 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2194 arrowboth 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2195 arrowupdn 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2196 uni2196 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2197 uni2197 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2198 uni2198 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2199 uni2199 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219a uni219A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219b uni219B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219c uni219C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219d uni219D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219e uni219E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+219f uni219F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a0 uni21A0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a1 uni21A1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a2 uni21A2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a3 uni21A3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a4 uni21A4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a5 uni21A5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a6 uni21A6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a7 uni21A7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a8 arrowupdnbse 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21a9 uni21A9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21aa uni21AA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ab uni21AB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ac uni21AC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ad uni21AD 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ae uni21AE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21af uni21AF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b0 uni21B0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b1 uni21B1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b2 uni21B2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b3 uni21B3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b4 uni21B4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b5 carriagereturn 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b6 uni21B6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b7 uni21B7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b8 uni21B8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21b9 uni21B9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ba uni21BA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21bb uni21BB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21bc uni21BC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21bd uni21BD 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21be uni21BE 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21bf uni21BF 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c0 uni21C0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c1 uni21C1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c2 uni21C2 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c3 uni21C3 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c4 uni21C4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c5 uni21C5 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c6 uni21C6 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c7 uni21C7 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c8 uni21C8 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21c9 uni21C9 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ca uni21CA 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21cb uni21CB 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21cc uni21CC 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21cd uni21CD 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ce uni21CE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21cf uni21CF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d0 arrowdblleft 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d1 arrowdblup 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d2 arrowdblright 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d3 arrowdbldown 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d4 arrowdblboth 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d5 uni21D5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d6 uni21D6 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d7 uni21D7 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d8 uni21D8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21d9 uni21D9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21da uni21DA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21db uni21DB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21dc uni21DC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21dd uni21DD 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21de uni21DE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21df uni21DF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e0 uni21E0 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e1 uni21E1 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e2 uni21E2 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e3 uni21E3 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e4 uni21E4 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e5 uni21E5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e6 uni21E6 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e7 uni21E7 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e8 uni21E8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21e9 uni21E9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ea uni21EA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21eb uni21EB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ec uni21EC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ed uni21ED 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ee uni21EE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ef uni21EF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f0 uni21F0 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f1 uni21F1 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f2 uni21F2 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f3 uni21F3 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f4 uni21F4 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f5 uni21F5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f6 uni21F6 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f7 uni21F7 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f8 uni21F8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21f9 uni21F9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21fa uni21FA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21fb uni21FB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21fc uni21FC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21fd uni21FD 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21fe uni21FE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+21ff uni21FF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2200 universal 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2201 uni2201 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2202 partialdiff original -U+2203 existential 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans ExtraLight) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2204 uni2204 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2205 emptyset 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2206 Delta original -U+2207 gradient 2.1 -U+2208 element 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2209 notelement 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+220a uni220A 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+220b suchthat 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+220c uni220C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+220d uni220D 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+220e uni220E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+220f product original -U+2210 uni2210 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2211 summation original -U+2212 minus original -U+2213 uni2213 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2214 uni2214 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2215 uni2215 original -U+2216 uni2216 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2217 asteriskmath 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2218 uni2218 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2219 uni2219 original -U+221a radical original -U+221b uni221B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+221c uni221C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) 2.26 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+221d proportional 2.1 -U+221e infinity original -U+221f orthogonal 2.1 -U+2220 angle 2.3 -U+2221 uni2221 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2222 uni2222 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2223 uni2223 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2224 uni2224 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2225 uni2225 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2226 uni2226 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2227 logicaland 2.1 -U+2228 logicalor 2.1 -U+2229 intersection 2.1 -U+222a union 2.1 -U+222b integral original -U+222c uni222C 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+222d uni222D 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+222e uni222E 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+222f uni222F 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2230 uni2230 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2231 uni2231 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2232 uni2232 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2233 uni2233 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2234 therefore 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2235 uni2235 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2236 uni2236 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2237 uni2237 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2238 uni2238 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2239 uni2239 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+223a uni223A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+223b uni223B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+223c similar 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+223d uni223D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+223e uni223E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+223f uni223F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2240 uni2240 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2241 uni2241 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2242 uni2242 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2243 uni2243 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2244 uni2244 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2245 congruent 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2246 uni2246 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2247 uni2247 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2248 approxequal original -U+2249 uni2249 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224a uni224A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224b uni224B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224c uni224C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224d uni224D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224e uni224E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+224f uni224F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2250 uni2250 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2251 uni2251 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2252 uni2252 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2253 uni2253 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2254 uni2254 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2255 uni2255 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2256 uni2256 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2257 uni2257 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2258 uni2258 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2259 uni2259 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225a uni225A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225b uni225B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225c uni225C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225d uni225D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225e uni225E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+225f uni225F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2260 notequal original -U+2261 equivalence 2.1 -U+2262 uni2262 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2263 uni2263 2.1 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2264 lessequal original -U+2265 greaterequal original -U+2266 uni2266 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2267 uni2267 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2268 uni2268 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2269 uni2269 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+226a uni226A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+226b uni226B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+226c uni226C 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+226d uni226D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+226e uni226E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+226f uni226F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2270 uni2270 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2271 uni2271 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2272 uni2272 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2273 uni2273 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2274 uni2274 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2275 uni2275 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2276 uni2276 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2277 uni2277 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2278 uni2278 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2279 uni2279 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227a uni227A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227b uni227B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227c uni227C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227d uni227D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227e uni227E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+227f uni227F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2280 uni2280 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2281 uni2281 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2282 propersubset 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2283 propersuperset 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2284 notsubset 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2285 uni2285 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2286 reflexsubset 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2287 reflexsuperset 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2288 uni2288 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2289 uni2289 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+228a uni228A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+228b uni228B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.6 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+228c uni228C 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+228d uni228D 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+228e uni228E 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+228f uni228F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2290 uni2290 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2291 uni2291 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2292 uni2292 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2293 uni2293 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2294 uni2294 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2295 circleplus 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2296 uni2296 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2297 circlemultiply 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2298 uni2298 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2299 uni2299 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229a uni229A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229b uni229B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229c uni229C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229d uni229D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229e uni229E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+229f uni229F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a0 uni22A0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a1 uni22A1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a2 uni22A2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a3 uni22A3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a4 uni22A4 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a5 perpendicular 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a6 uni22A6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a7 uni22A7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a8 uni22A8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22a9 uni22A9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22aa uni22AA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22ab uni22AB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22ac uni22AC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22ad uni22AD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22ae uni22AE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22af uni22AF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22b0 uni22B0 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b1 uni22B1 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b2 uni22B2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b3 uni22B3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b4 uni22B4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b5 uni22B5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b6 uni22B6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b7 uni22B7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b8 uni22B8 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22b9 uni22B9 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ba uni22BA 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22bb uni22BB 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22bc uni22BC 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22bd uni22BD 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22be uni22BE 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+22bf uni22BF 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+22c0 uni22C0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c1 uni22C1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c2 uni22C2 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c3 uni22C3 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c4 uni22C4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c5 dotmath 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+22c6 uni22C6 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+22c7 uni22C7 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c8 uni22C8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22c9 uni22C9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ca uni22CA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22cb uni22CB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22cc uni22CC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22cd uni22CD 2.6 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.7 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+22ce uni22CE 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22cf uni22CF 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d0 uni22D0 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d1 uni22D1 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d2 uni22D2 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d3 uni22D3 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d4 uni22D4 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d5 uni22D5 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d6 uni22D6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d7 uni22D7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22d8 uni22D8 2.6 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+22d9 uni22D9 2.6 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+22da uni22DA 2.6 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.7 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+22db uni22DB 2.6 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) 2.7 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+22dc uni22DC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22dd uni22DD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22de uni22DE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22df uni22DF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e0 uni22E0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e1 uni22E1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e2 uni22E2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e3 uni22E3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e4 uni22E4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e5 uni22E5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e6 uni22E6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e7 uni22E7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e8 uni22E8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22e9 uni22E9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+22ea uni22EA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22eb uni22EB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ec uni22EC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ed uni22ED 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ee uni22EE 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ef uni22EF 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f0 uni22F0 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f1 uni22F1 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f2 uni22F2 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f3 uni22F3 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f4 uni22F4 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f5 uni22F5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f6 uni22F6 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f7 uni22F7 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f8 uni22F8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22f9 uni22F9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22fa uni22FA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22fb uni22FB 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22fc uni22FC 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22fd uni22FD 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22fe uni22FE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+22ff uni22FF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2300 uni2300 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2301 uni2301 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2302 house 1.14 -U+2303 uni2303 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2304 uni2304 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2305 uni2305 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2306 uni2306 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2307 uni2307 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2308 uni2308 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2309 uni2309 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+230a uni230A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+230b uni230B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+230c uni230C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+230d uni230D 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+230e uni230E 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+230f uni230F 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2310 revlogicalnot 1.14 -U+2311 uni2311 1.15 -U+2312 uni2312 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2313 uni2313 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2314 uni2314 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2315 uni2315 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2318 uni2318 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2319 uni2319 1.14 -U+231c uni231C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+231d uni231D 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+231e uni231E 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+231f uni231F 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2320 integraltp 2.3 -U+2321 integralbt 2.3 -U+2324 uni2324 2.16 (Sans, Sans Bold, Sans Bold Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique) 2.19 (Sans Condensed Oblique, Sans Oblique) -U+2325 uni2325 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2326 uni2326 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2327 uni2327 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2328 uni2328 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2329 angleleft 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) -U+232a angleright 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.10 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) -U+232b uni232B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+232c uni232C 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2335 uni2335 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2337 uni2337 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2338 uni2338 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2339 uni2339 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+233a uni233A 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+233b uni233B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+233c uni233C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+233d uni233D 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+233e uni233E 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2341 uni2341 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2342 uni2342 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2343 uni2343 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2344 uni2344 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2347 uni2347 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2348 uni2348 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2349 uni2349 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+234b uni234B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+234c uni234C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+234d uni234D 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2350 uni2350 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2352 uni2352 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2353 uni2353 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2354 uni2354 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2357 uni2357 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2358 uni2358 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2359 uni2359 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+235a uni235A 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+235b uni235B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+235c uni235C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+235e uni235E 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+235f uni235F 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2360 uni2360 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2363 uni2363 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2364 uni2364 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2365 uni2365 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2368 uni2368 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2369 uni2369 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+236b uni236B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+236c uni236C 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+236d uni236D 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+236e uni236E 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+236f uni236F 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2370 uni2370 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2373 uni2373 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2374 uni2374 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2375 uni2375 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2376 uni2376 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2377 uni2377 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2378 uni2378 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2379 uni2379 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+237a uni237A 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+237d uni237D 1.15 -U+2380 uni2380 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2381 uni2381 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2382 uni2382 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2383 uni2383 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2387 uni2387 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2388 uni2388 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2389 uni2389 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+238a uni238A 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+238b uni238B 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2394 uni2394 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2395 uni2395 2.14 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+239b uni239B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+239c uni239C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+239d uni239D 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+239e uni239E 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+239f uni239F 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a0 uni23A0 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a1 uni23A1 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a2 uni23A2 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a3 uni23A3 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a4 uni23A4 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a5 uni23A5 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a6 uni23A6 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a7 uni23A7 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a8 uni23A8 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23a9 uni23A9 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23aa uni23AA 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23ab uni23AB 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23ac uni23AC 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23ad uni23AD 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23ae uni23AE 2.3 -U+23ce uni23CE 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+23cf uni23CF 2.3 -U+23e3 uni23E3 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+23e5 uni23E5 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2422 uni2422 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2423 uni2423 1.6 -U+2460 uni2460 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2461 uni2461 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2462 uni2462 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2463 uni2463 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2464 uni2464 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2465 uni2465 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2466 uni2466 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2467 uni2467 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2468 uni2468 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2469 uni2469 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2500 SF100000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2501 uni2501 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2502 SF110000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2503 uni2503 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2504 uni2504 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2505 uni2505 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2506 uni2506 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2507 uni2507 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2508 uni2508 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2509 uni2509 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250a uni250A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250b uni250B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250c SF010000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250d uni250D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250e uni250E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+250f uni250F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2510 SF030000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2511 uni2511 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2512 uni2512 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2513 uni2513 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2514 SF020000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2515 uni2515 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2516 uni2516 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2517 uni2517 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2518 SF040000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2519 uni2519 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251a uni251A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251b uni251B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251c SF080000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251d uni251D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251e uni251E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+251f uni251F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2520 uni2520 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2521 uni2521 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2522 uni2522 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2523 uni2523 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2524 SF090000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2525 uni2525 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2526 uni2526 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2527 uni2527 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2528 uni2528 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2529 uni2529 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252a uni252A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252b uni252B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252c SF060000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252d uni252D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252e uni252E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+252f uni252F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2530 uni2530 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2531 uni2531 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2532 uni2532 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2533 uni2533 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2534 SF070000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2535 uni2535 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2536 uni2536 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2537 uni2537 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2538 uni2538 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2539 uni2539 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253a uni253A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253b uni253B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253c SF050000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253d uni253D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253e uni253E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+253f uni253F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2540 uni2540 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2541 uni2541 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2542 uni2542 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2543 uni2543 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2544 uni2544 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2545 uni2545 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2546 uni2546 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2547 uni2547 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2548 uni2548 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2549 uni2549 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254a uni254A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254b uni254B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254c uni254C 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254d uni254D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254e uni254E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+254f uni254F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2550 SF430000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2551 SF240000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2552 SF510000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2553 SF520000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2554 SF390000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2555 SF220000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2556 SF210000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2557 SF250000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2558 SF500000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2559 SF490000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255a SF380000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255b SF280000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255c SF270000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255d SF260000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255e SF360000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+255f SF370000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2560 SF420000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2561 SF190000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2562 SF200000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2563 SF230000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2564 SF470000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2565 SF480000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2566 SF410000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2567 SF450000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2568 SF460000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2569 SF400000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256a SF540000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256b SF530000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256c SF440000 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256d uni256D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256e uni256E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+256f uni256F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2570 uni2570 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2571 uni2571 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2572 uni2572 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2573 uni2573 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2574 uni2574 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2575 uni2575 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2576 uni2576 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2577 uni2577 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2578 uni2578 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2579 uni2579 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257a uni257A 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257b uni257B 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257c uni257C 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257d uni257D 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257e uni257E 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+257f uni257F 1.12 (Sans Mono, Sans Mono Oblique) 2.21 (Sans, Sans Condensed, Sans Condensed Oblique, Sans Oblique, Serif, Serif Condensed, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2580 upblock 1.14 -U+2581 uni2581 1.14 -U+2582 uni2582 1.14 -U+2583 uni2583 1.14 -U+2584 dnblock 1.14 -U+2585 uni2585 1.14 -U+2586 uni2586 1.14 -U+2587 uni2587 1.14 -U+2588 block 1.14 -U+2589 uni2589 1.14 -U+258a uni258A 1.14 -U+258b uni258B 1.14 -U+258c lfblock 1.14 -U+258d uni258D 1.14 -U+258e uni258E 1.14 -U+258f uni258F 1.14 -U+2590 rtblock 1.14 -U+2591 ltshade 1.15 -U+2592 shade 1.15 -U+2593 dkshade 1.15 -U+2594 uni2594 1.14 -U+2595 uni2595 1.14 -U+2596 uni2596 1.14 -U+2597 uni2597 1.14 -U+2598 uni2598 1.14 -U+2599 uni2599 1.14 -U+259a uni259A 1.14 -U+259b uni259B 1.14 -U+259c uni259C 1.14 -U+259d uni259D 1.14 -U+259e uni259E 1.14 -U+259f uni259F 1.14 -U+25a0 filledbox 2.3 -U+25a1 H22073 2.3 -U+25a2 uni25A2 2.3 -U+25a3 uni25A3 2.3 -U+25a4 uni25A4 2.3 -U+25a5 uni25A5 2.3 -U+25a6 uni25A6 2.3 -U+25a7 uni25A7 2.3 -U+25a8 uni25A8 2.3 -U+25a9 uni25A9 2.3 -U+25aa H18543 2.3 -U+25ab H18551 2.3 -U+25ac filledrect 2.3 -U+25ad uni25AD 2.3 -U+25ae uni25AE 2.3 -U+25af uni25AF 2.3 -U+25b0 uni25B0 2.3 -U+25b1 uni25B1 2.3 -U+25b2 triagup 2.3 -U+25b3 uni25B3 2.3 -U+25b4 uni25B4 2.3 -U+25b5 uni25B5 2.3 -U+25b6 uni25B6 2.3 -U+25b7 uni25B7 2.3 -U+25b8 uni25B8 2.3 -U+25b9 uni25B9 2.3 -U+25ba triagrt 2.3 -U+25bb uni25BB 2.3 -U+25bc triagdn 2.3 -U+25bd uni25BD 2.3 -U+25be uni25BE 2.3 -U+25bf uni25BF 2.3 -U+25c0 uni25C0 2.3 -U+25c1 uni25C1 2.3 -U+25c2 uni25C2 2.3 -U+25c3 uni25C3 2.3 -U+25c4 triaglf 2.3 -U+25c5 uni25C5 2.3 -U+25c6 uni25C6 2.3 -U+25c7 uni25C7 2.3 -U+25c8 uni25C8 2.3 -U+25c9 uni25C9 2.3 -U+25ca lozenge original -U+25cb circle 2.3 -U+25cc uni25CC 2.3 -U+25cd uni25CD 2.3 -U+25ce uni25CE 2.3 -U+25cf H18533 2.3 -U+25d0 uni25D0 2.3 -U+25d1 uni25D1 2.3 -U+25d2 uni25D2 2.3 -U+25d3 uni25D3 2.3 -U+25d4 uni25D4 2.3 -U+25d5 uni25D5 2.3 -U+25d6 uni25D6 2.3 -U+25d7 uni25D7 2.3 -U+25d8 invbullet 2.2 -U+25d9 invcircle 2.3 -U+25da uni25DA 2.3 -U+25db uni25DB 2.3 -U+25dc uni25DC 2.3 -U+25dd uni25DD 2.3 -U+25de uni25DE 2.3 -U+25df uni25DF 2.3 -U+25e0 uni25E0 2.3 -U+25e1 uni25E1 2.3 -U+25e2 uni25E2 2.3 -U+25e3 uni25E3 2.3 -U+25e4 uni25E4 2.3 -U+25e5 uni25E5 2.3 -U+25e6 openbullet 2.2 -U+25e7 uni25E7 2.3 -U+25e8 uni25E8 2.3 -U+25e9 uni25E9 2.3 -U+25ea uni25EA 2.3 -U+25eb uni25EB 2.3 -U+25ec uni25EC 2.3 -U+25ed uni25ED 2.3 -U+25ee uni25EE 2.3 -U+25ef uni25EF 2.3 -U+25f0 uni25F0 2.3 -U+25f1 uni25F1 2.3 -U+25f2 uni25F2 2.3 -U+25f3 uni25F3 2.3 -U+25f4 uni25F4 2.3 -U+25f5 uni25F5 2.3 -U+25f6 uni25F6 2.3 -U+25f7 uni25F7 2.3 -U+25f8 uni25F8 2.3 -U+25f9 uni25F9 2.3 -U+25fa uni25FA 2.3 -U+25fb uni25FB 2.3 -U+25fc uni25FC 2.3 -U+25fd uni25FD 2.3 -U+25fe uni25FE 2.3 -U+25ff uni25FF 2.3 -U+2600 uni2600 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2601 uni2601 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2602 uni2602 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2603 uni2603 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2604 uni2604 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2605 uni2605 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2606 uni2606 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2607 uni2607 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2608 uni2608 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2609 uni2609 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260a uni260A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260b uni260B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260c uni260C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260d uni260D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260e uni260E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+260f uni260F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2610 uni2610 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2611 uni2611 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2612 uni2612 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2613 uni2613 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2614 uni2614 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2615 uni2615 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2616 uni2616 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2617 uni2617 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2618 uni2618 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2619 uni2619 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261a uni261A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261b uni261B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261c uni261C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261d uni261D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261e uni261E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+261f uni261F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2620 uni2620 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2621 uni2621 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2622 uni2622 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2623 uni2623 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2624 uni2624 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2625 uni2625 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2626 uni2626 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2627 uni2627 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2628 uni2628 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2629 uni2629 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262a uni262A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262b uni262B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262c uni262C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262d uni262D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262e uni262E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+262f uni262F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2630 uni2630 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2631 uni2631 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2632 uni2632 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2633 uni2633 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2634 uni2634 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2635 uni2635 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2636 uni2636 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2637 uni2637 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2638 uni2638 1.15 -U+2639 uni2639 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+263a smileface 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+263b invsmileface 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+263c sun 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+263d uni263D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+263e uni263E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+263f uni263F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2640 female 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2641 uni2641 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2642 male 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2643 uni2643 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2644 uni2644 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2645 uni2645 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2646 uni2646 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2647 uni2647 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2648 uni2648 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2649 uni2649 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264a uni264A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264b uni264B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264c uni264C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264d uni264D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264e uni264E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+264f uni264F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2650 uni2650 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2651 uni2651 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2652 uni2652 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2653 uni2653 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2654 uni2654 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2655 uni2655 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2656 uni2656 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2657 uni2657 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2658 uni2658 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2659 uni2659 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265a uni265A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265b uni265B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265c uni265C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265d uni265D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265e uni265E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+265f uni265F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2660 spade 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2661 uni2661 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2662 uni2662 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2663 club 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2664 uni2664 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2665 heart 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2666 diamond 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2667 uni2667 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2668 uni2668 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2669 uni2669 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266a musicalnote 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266b musicalnotedbl 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266c uni266C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266d uni266D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266e uni266E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+266f uni266F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2670 uni2670 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2671 uni2671 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2672 uni2672 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2673 uni2673 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2674 uni2674 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2675 uni2675 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2676 uni2676 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2677 uni2677 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2678 uni2678 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2679 uni2679 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267a uni267A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267b uni267B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267c uni267C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267d uni267D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267e uni267E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+267f uni267F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2680 uni2680 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2681 uni2681 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2682 uni2682 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2683 uni2683 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2684 uni2684 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2685 uni2685 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.4 (Sans ExtraLight) 2.7 (Sans Mono, Sans Mono Bold) -U+2686 uni2686 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2687 uni2687 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2688 uni2688 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2689 uni2689 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+268a uni268A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+268b uni268B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+268c uni268C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+268d uni268D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+268e uni268E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+268f uni268F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+2690 uni2690 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2691 uni2691 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2692 uni2692 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2693 uni2693 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2694 uni2694 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2695 uni2695 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2696 uni2696 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2697 uni2697 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2698 uni2698 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2699 uni2699 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+269a uni269A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+269b uni269B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+269c uni269C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+26a0 uni26A0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+26a1 uni26A1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+26a2 uni26A2 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a3 uni26A3 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a4 uni26A4 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a5 uni26A5 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a6 uni26A6 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a7 uni26A7 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a8 uni26A8 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26a9 uni26A9 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26aa uni26AA 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26ab uni26AB 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26ac uni26AC 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26ad uni26AD 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26ae uni26AE 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26af uni26AF 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+26b0 uni26B0 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+26b1 uni26B1 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+26b2 uni26B2 2.12 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b3 uni26B3 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b4 uni26B4 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b5 uni26B5 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b6 uni26B6 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b7 uni26B7 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+26b8 uni26B8 2.29 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2701 uni2701 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2702 uni2702 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2703 uni2703 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2704 uni2704 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2706 uni2706 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2707 uni2707 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2708 uni2708 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2709 uni2709 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+270c uni270C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+270d uni270D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+270e uni270E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+270f uni270F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2710 uni2710 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2711 uni2711 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2712 uni2712 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2713 uni2713 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2714 uni2714 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2715 uni2715 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2716 uni2716 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2717 uni2717 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2718 uni2718 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2719 uni2719 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271a uni271A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271b uni271B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271c uni271C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271d uni271D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271e uni271E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+271f uni271F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2720 uni2720 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2721 uni2721 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2722 uni2722 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2723 uni2723 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2724 uni2724 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2725 uni2725 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2726 uni2726 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2727 uni2727 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2729 uni2729 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272a uni272A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272b uni272B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272c uni272C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272d uni272D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272e uni272E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+272f uni272F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2730 uni2730 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2731 uni2731 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2732 uni2732 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2733 uni2733 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2734 uni2734 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2735 uni2735 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2736 uni2736 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2737 uni2737 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2738 uni2738 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2739 uni2739 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273a uni273A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273b uni273B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273c uni273C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273d uni273D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273e uni273E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+273f uni273F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2740 uni2740 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2741 uni2741 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2742 uni2742 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2743 uni2743 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2744 uni2744 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2745 uni2745 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2746 uni2746 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2747 uni2747 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2748 uni2748 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2749 uni2749 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+274a uni274A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+274b uni274B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+274d uni274D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+274f uni274F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2750 uni2750 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2751 uni2751 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2752 uni2752 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2756 uni2756 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2758 uni2758 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2759 uni2759 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+275a uni275A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+275b uni275B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+275c uni275C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+275d uni275D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+275e uni275E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2761 uni2761 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2762 uni2762 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2763 uni2763 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2764 uni2764 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2765 uni2765 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2766 uni2766 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2767 uni2767 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2768 uni2768 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2769 uni2769 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276a uni276A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276b uni276B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276c uni276C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276d uni276D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276e uni276E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+276f uni276F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2770 uni2770 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2771 uni2771 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2772 uni2772 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2773 uni2773 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2774 uni2774 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2775 uni2775 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Sans Mono, Sans Mono Bold) -U+2776 uni2776 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2777 uni2777 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2778 uni2778 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2779 uni2779 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277a uni277A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277b uni277B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277c uni277C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277d uni277D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277e uni277E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+277f uni277F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2780 uni2780 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2781 uni2781 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2782 uni2782 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2783 uni2783 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2784 uni2784 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2785 uni2785 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2786 uni2786 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2787 uni2787 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2788 uni2788 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2789 uni2789 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278a uni278A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278b uni278B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278c uni278C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278d uni278D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278e uni278E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+278f uni278F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2790 uni2790 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2791 uni2791 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2792 uni2792 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2793 uni2793 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2794 uni2794 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2798 uni2798 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+2799 uni2799 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279a uni279A 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279b uni279B 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279c uni279C 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279d uni279D 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279e uni279E 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+279f uni279F 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a0 uni27A0 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a1 uni27A1 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27a2 uni27A2 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a3 uni27A3 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a4 uni27A4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a5 uni27A5 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a6 uni27A6 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a7 uni27A7 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a8 uni27A8 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27a9 uni27A9 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27aa uni27AA 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27ab uni27AB 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27ac uni27AC 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27ad uni27AD 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27ae uni27AE 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27af uni27AF 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b1 uni27B1 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b2 uni27B2 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b3 uni27B3 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b4 uni27B4 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b5 uni27B5 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b6 uni27B6 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b7 uni27B7 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b8 uni27B8 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27b9 uni27B9 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27ba uni27BA 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27bb uni27BB 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27bc uni27BC 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27bd uni27BD 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27be uni27BE 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.7 (Sans Mono, Sans Mono Bold) -U+27bf uni27BF 2.7 (Sans Mono Bold) -U+27c5 uni27C5 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+27c6 uni27C6 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+27e0 uni27E0 2.3 -U+27e6 uni27E6 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+27e7 uni27E7 2.15 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+27e8 uni27E8 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27e9 uni27E9 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.13 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27ea uni27EA 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+27eb uni27EB 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+27f0 uni27F0 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f1 uni27F1 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f2 uni27F2 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f3 uni27F3 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f4 uni27F4 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f5 uni27F5 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f6 uni27F6 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f7 uni27F7 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f8 uni27F8 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27f9 uni27F9 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27fa uni27FA 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27fb uni27FB 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27fc uni27FC 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27fd uni27FD 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27fe uni27FE 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+27ff uni27FF 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2800 uni2800 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2801 uni2801 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2802 uni2802 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2803 uni2803 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2804 uni2804 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2805 uni2805 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2806 uni2806 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2807 uni2807 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2808 uni2808 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2809 uni2809 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280a uni280A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280b uni280B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280c uni280C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280d uni280D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280e uni280E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+280f uni280F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2810 uni2810 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2811 uni2811 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2812 uni2812 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2813 uni2813 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2814 uni2814 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2815 uni2815 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2816 uni2816 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2817 uni2817 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2818 uni2818 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2819 uni2819 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281a uni281A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281b uni281B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281c uni281C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281d uni281D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281e uni281E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+281f uni281F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2820 uni2820 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2821 uni2821 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2822 uni2822 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2823 uni2823 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2824 uni2824 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2825 uni2825 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2826 uni2826 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2827 uni2827 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2828 uni2828 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2829 uni2829 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282a uni282A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282b uni282B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282c uni282C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282d uni282D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282e uni282E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+282f uni282F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2830 uni2830 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2831 uni2831 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2832 uni2832 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2833 uni2833 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2834 uni2834 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2835 uni2835 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2836 uni2836 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2837 uni2837 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2838 uni2838 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2839 uni2839 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283a uni283A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283b uni283B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283c uni283C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283d uni283D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283e uni283E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+283f uni283F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2840 uni2840 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2841 uni2841 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2842 uni2842 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2843 uni2843 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2844 uni2844 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2845 uni2845 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2846 uni2846 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2847 uni2847 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2848 uni2848 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2849 uni2849 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284a uni284A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284b uni284B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284c uni284C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284d uni284D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284e uni284E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+284f uni284F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2850 uni2850 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2851 uni2851 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2852 uni2852 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2853 uni2853 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2854 uni2854 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2855 uni2855 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2856 uni2856 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2857 uni2857 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2858 uni2858 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2859 uni2859 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285a uni285A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285b uni285B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285c uni285C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285d uni285D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285e uni285E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+285f uni285F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2860 uni2860 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2861 uni2861 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2862 uni2862 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2863 uni2863 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2864 uni2864 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2865 uni2865 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2866 uni2866 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2867 uni2867 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2868 uni2868 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2869 uni2869 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286a uni286A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286b uni286B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286c uni286C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286d uni286D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286e uni286E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+286f uni286F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2870 uni2870 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2871 uni2871 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2872 uni2872 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2873 uni2873 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2874 uni2874 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2875 uni2875 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2876 uni2876 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2877 uni2877 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2878 uni2878 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2879 uni2879 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287a uni287A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287b uni287B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287c uni287C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287d uni287D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287e uni287E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+287f uni287F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2880 uni2880 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2881 uni2881 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2882 uni2882 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2883 uni2883 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2884 uni2884 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2885 uni2885 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2886 uni2886 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2887 uni2887 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2888 uni2888 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2889 uni2889 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288a uni288A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288b uni288B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288c uni288C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288d uni288D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288e uni288E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+288f uni288F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2890 uni2890 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2891 uni2891 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2892 uni2892 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2893 uni2893 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2894 uni2894 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2895 uni2895 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2896 uni2896 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2897 uni2897 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2898 uni2898 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2899 uni2899 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289a uni289A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289b uni289B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289c uni289C 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289d uni289D 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289e uni289E 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+289f uni289F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a0 uni28A0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a1 uni28A1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a2 uni28A2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a3 uni28A3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a4 uni28A4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a5 uni28A5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a6 uni28A6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a7 uni28A7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a8 uni28A8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28a9 uni28A9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28aa uni28AA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ab uni28AB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ac uni28AC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ad uni28AD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ae uni28AE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28af uni28AF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b0 uni28B0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b1 uni28B1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b2 uni28B2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b3 uni28B3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b4 uni28B4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b5 uni28B5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b6 uni28B6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b7 uni28B7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b8 uni28B8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28b9 uni28B9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ba uni28BA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28bb uni28BB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28bc uni28BC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28bd uni28BD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28be uni28BE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28bf uni28BF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c0 uni28C0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c1 uni28C1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c2 uni28C2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c3 uni28C3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c4 uni28C4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c5 uni28C5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c6 uni28C6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c7 uni28C7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c8 uni28C8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28c9 uni28C9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ca uni28CA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28cb uni28CB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28cc uni28CC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28cd uni28CD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ce uni28CE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28cf uni28CF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d0 uni28D0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d1 uni28D1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d2 uni28D2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d3 uni28D3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d4 uni28D4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d5 uni28D5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d6 uni28D6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d7 uni28D7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d8 uni28D8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28d9 uni28D9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28da uni28DA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28db uni28DB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28dc uni28DC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28dd uni28DD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28de uni28DE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28df uni28DF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e0 uni28E0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e1 uni28E1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e2 uni28E2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e3 uni28E3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e4 uni28E4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e5 uni28E5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e6 uni28E6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e7 uni28E7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e8 uni28E8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28e9 uni28E9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ea uni28EA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28eb uni28EB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ec uni28EC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ed uni28ED 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ee uni28EE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ef uni28EF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f0 uni28F0 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f1 uni28F1 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f2 uni28F2 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f3 uni28F3 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f4 uni28F4 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f5 uni28F5 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f6 uni28F6 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f7 uni28F7 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f8 uni28F8 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28f9 uni28F9 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28fa uni28FA 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28fb uni28FB 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28fc uni28FC 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28fd uni28FD 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28fe uni28FE 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+28ff uni28FF 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2900 uni2900 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2901 uni2901 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2902 uni2902 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2903 uni2903 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2904 uni2904 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2905 uni2905 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2906 uni2906 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2907 uni2907 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2908 uni2908 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2909 uni2909 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290a uni290A 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290b uni290B 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290c uni290C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290d uni290D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290e uni290E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+290f uni290F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2910 uni2910 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2911 uni2911 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2912 uni2912 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2913 uni2913 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2914 uni2914 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2915 uni2915 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2916 uni2916 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2917 uni2917 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2918 uni2918 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2919 uni2919 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291a uni291A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291b uni291B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291c uni291C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291d uni291D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291e uni291E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+291f uni291F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2920 uni2920 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2921 uni2921 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2922 uni2922 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2923 uni2923 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2924 uni2924 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2925 uni2925 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2926 uni2926 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2927 uni2927 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2928 uni2928 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2929 uni2929 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292a uni292A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292b uni292B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292c uni292C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292d uni292D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292e uni292E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+292f uni292F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2930 uni2930 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2931 uni2931 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2932 uni2932 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2933 uni2933 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2934 uni2934 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2935 uni2935 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2936 uni2936 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2937 uni2937 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2938 uni2938 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2939 uni2939 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293a uni293A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293b uni293B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293c uni293C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293d uni293D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293e uni293E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+293f uni293F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2940 uni2940 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2941 uni2941 2.13 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2942 uni2942 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2943 uni2943 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2944 uni2944 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2945 uni2945 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2946 uni2946 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2947 uni2947 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2948 uni2948 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2949 uni2949 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294a uni294A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294b uni294B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294c uni294C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294d uni294D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294e uni294E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+294f uni294F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2950 uni2950 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2951 uni2951 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2952 uni2952 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2953 uni2953 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2954 uni2954 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2955 uni2955 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2956 uni2956 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2957 uni2957 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2958 uni2958 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2959 uni2959 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295a uni295A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295b uni295B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295c uni295C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295d uni295D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295e uni295E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+295f uni295F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2960 uni2960 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2961 uni2961 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2962 uni2962 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2963 uni2963 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2964 uni2964 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2965 uni2965 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2966 uni2966 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2967 uni2967 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2968 uni2968 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2969 uni2969 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296a uni296A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296b uni296B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296c uni296C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296d uni296D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296e uni296E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+296f uni296F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2970 uni2970 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2971 uni2971 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2972 uni2972 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2973 uni2973 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2974 uni2974 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2975 uni2975 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2976 uni2976 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2977 uni2977 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2978 uni2978 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2979 uni2979 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297a uni297A 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297b uni297B 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297c uni297C 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297d uni297D 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297e uni297E 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+297f uni297F 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2983 uni2983 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2984 uni2984 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+29ce uni29CE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29cf uni29CF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d0 uni29D0 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d1 uni29D1 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d2 uni29D2 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d3 uni29D3 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d4 uni29D4 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29d5 uni29D5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+29eb uni29EB 2.2 -U+29fa uni29FA 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+29fb uni29FB 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+2a00 uni2A00 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a01 uni2A01 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a02 uni2A02 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a0c uni2A0C 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2a0d uni2A0D 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2a0e uni2A0E 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.9 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2a0f uni2A0F 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a10 uni2A10 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a11 uni2A11 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a12 uni2A12 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a13 uni2A13 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a14 uni2A14 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a15 uni2A15 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a16 uni2A16 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a17 uni2A17 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a18 uni2A18 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a19 uni2A19 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a1a uni2A1A 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a1b uni2A1B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a1c uni2A1C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a2f uni2A2F 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2a7d uni2A7D 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a7e uni2A7E 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a7f uni2A7F 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a80 uni2A80 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a81 uni2A81 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a82 uni2A82 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a83 uni2A83 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a84 uni2A84 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a85 uni2A85 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a86 uni2A86 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a87 uni2A87 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a88 uni2A88 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a89 uni2A89 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8a uni2A8A 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8b uni2A8B 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8c uni2A8C 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8d uni2A8D 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8e uni2A8E 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a8f uni2A8F 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a90 uni2A90 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a91 uni2A91 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a92 uni2A92 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a93 uni2A93 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a94 uni2A94 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a95 uni2A95 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a96 uni2A96 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a97 uni2A97 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a98 uni2A98 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a99 uni2A99 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9a uni2A9A 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9b uni2A9B 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9c uni2A9C 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9d uni2A9D 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9e uni2A9E 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2a9f uni2A9F 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2aa0 uni2AA0 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2aae uni2AAE 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2aaf uni2AAF 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab0 uni2AB0 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab1 uni2AB1 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab2 uni2AB2 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab3 uni2AB3 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab4 uni2AB4 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab5 uni2AB5 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab6 uni2AB6 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab7 uni2AB7 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab8 uni2AB8 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2ab9 uni2AB9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2aba uni2ABA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2af9 uni2AF9 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2afa uni2AFA 2.7 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2b00 uni2B00 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b01 uni2B01 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b02 uni2B02 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b03 uni2B03 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b04 uni2B04 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b05 uni2B05 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b06 uni2B06 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b07 uni2B07 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b08 uni2B08 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b09 uni2B09 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0a uni2B0A 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0b uni2B0B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0c uni2B0C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0d uni2B0D 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0e uni2B0E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b0f uni2B0F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b10 uni2B10 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b11 uni2B11 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2b12 uni2B12 2.3 -U+2b13 uni2B13 2.3 -U+2b14 uni2B14 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b15 uni2B15 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b16 uni2B16 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b17 uni2B17 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b18 uni2B18 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b19 uni2B19 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b1a uni2B1A 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Italic) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+2b1f uni2B1F 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+2b20 uni2B20 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2b21 uni2B21 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2b22 uni2B22 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2b23 uni2B23 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2b24 uni2B24 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+2b53 uni2B53 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+2b54 uni2B54 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+2c60 uni2C60 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c61 uni2C61 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c62 uni2C62 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c63 uni2C63 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c64 uni2C64 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2c65 uni2C65 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c66 uni2C66 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c67 uni2C67 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c68 uni2C68 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c69 uni2C69 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c6a uni2C6A 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c6b uni2C6B 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c6c uni2C6C 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) 2.18 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+2c6d uni2C6D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2c6e uni2C6E 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2c6f uni2C6F 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2c71 uni2C71 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2c72 uni2C72 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2c73 uni2C73 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2c74 uni2C74 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+2c75 uni2C75 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.20 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2c76 uni2C76 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.20 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2c77 uni2C77 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.18 (Sans ExtraLight, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.20 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.23 (Serif Italic Condensed) -U+2c79 uni2C79 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2c7a uni2C7A 2.27 -U+2c7b uni2C7B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+2c7c uni2C7C 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2c7d uni2C7D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.28 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+2d00 uni2D00 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d01 uni2D01 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d02 uni2D02 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d03 uni2D03 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d04 uni2D04 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d05 uni2D05 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d06 uni2D06 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d07 uni2D07 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d08 uni2D08 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d09 uni2D09 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0a uni2D0A 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0b uni2D0B 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0c uni2D0C 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0d uni2D0D 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0e uni2D0E 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d0f uni2D0F 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d10 uni2D10 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d11 uni2D11 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d12 uni2D12 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d13 uni2D13 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d14 uni2D14 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d15 uni2D15 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d16 uni2D16 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d17 uni2D17 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d18 uni2D18 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d19 uni2D19 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1a uni2D1A 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1b uni2D1B 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1c uni2D1C 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1d uni2D1D 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1e uni2D1E 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d1f uni2D1F 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d20 uni2D20 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d21 uni2D21 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d22 uni2D22 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d23 uni2D23 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d24 uni2D24 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d25 uni2D25 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+2d30 uni2D30 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d31 uni2D31 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d32 uni2D32 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d33 uni2D33 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d34 uni2D34 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d35 uni2D35 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d36 uni2D36 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d37 uni2D37 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d38 uni2D38 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d39 uni2D39 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3a uni2D3A 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3b uni2D3B 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3c uni2D3C 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3d uni2D3D 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3e uni2D3E 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d3f uni2D3F 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d40 uni2D40 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d41 uni2D41 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d42 uni2D42 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d43 uni2D43 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d44 uni2D44 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d45 uni2D45 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d46 uni2D46 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d47 uni2D47 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d48 uni2D48 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d49 uni2D49 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4a uni2D4A 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4b uni2D4B 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4c uni2D4C 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4d uni2D4D 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4e uni2D4E 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d4f uni2D4F 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d50 uni2D50 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d51 uni2D51 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d52 uni2D52 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d53 uni2D53 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d54 uni2D54 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d55 uni2D55 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d56 uni2D56 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d57 uni2D57 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d58 uni2D58 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d59 uni2D59 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5a uni2D5A 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5b uni2D5B 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5c uni2D5C 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5d uni2D5D 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5e uni2D5E 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d5f uni2D5F 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d60 uni2D60 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d61 uni2D61 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d62 uni2D62 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d63 uni2D63 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d64 uni2D64 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d65 uni2D65 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2d6f uni2D6F 2.18 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+2e18 uni2E18 2.26 -U+2e22 uni2E22 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.30 (Sans Bold) -U+2e23 uni2E23 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.30 (Sans Bold) -U+2e24 uni2E24 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.30 (Sans Bold) -U+2e25 uni2E25 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) 2.30 (Sans Bold) -U+2e2e uni2E2E 2.26 -U+4dc0 uni4DC0 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc1 uni4DC1 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc2 uni4DC2 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc3 uni4DC3 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc4 uni4DC4 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc5 uni4DC5 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc6 uni4DC6 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc7 uni4DC7 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc8 uni4DC8 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dc9 uni4DC9 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dca uni4DCA 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dcb uni4DCB 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dcc uni4DCC 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dcd uni4DCD 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dce uni4DCE 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dcf uni4DCF 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd0 uni4DD0 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd1 uni4DD1 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd2 uni4DD2 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd3 uni4DD3 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd4 uni4DD4 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd5 uni4DD5 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd6 uni4DD6 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd7 uni4DD7 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd8 uni4DD8 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dd9 uni4DD9 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dda uni4DDA 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4ddb uni4DDB 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4ddc uni4DDC 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4ddd uni4DDD 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dde uni4DDE 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4ddf uni4DDF 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de0 uni4DE0 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de1 uni4DE1 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de2 uni4DE2 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de3 uni4DE3 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de4 uni4DE4 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de5 uni4DE5 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de6 uni4DE6 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de7 uni4DE7 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de8 uni4DE8 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4de9 uni4DE9 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dea uni4DEA 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4deb uni4DEB 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dec uni4DEC 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4ded uni4DED 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dee uni4DEE 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4def uni4DEF 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df0 uni4DF0 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df1 uni4DF1 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df2 uni4DF2 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df3 uni4DF3 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df4 uni4DF4 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df5 uni4DF5 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df6 uni4DF6 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df7 uni4DF7 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df8 uni4DF8 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4df9 uni4DF9 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dfa uni4DFA 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dfb uni4DFB 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dfc uni4DFC 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dfd uni4DFD 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dfe uni4DFE 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+4dff uni4DFF 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a644 uniA644 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a645 uniA645 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a646 uniA646 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a647 uniA647 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a64c uniA64C 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a64d uniA64D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a650 uniA650 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a651 uniA651 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a654 uniA654 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a655 uniA655 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a656 uniA656 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a657 uniA657 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a662 uniA662 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a663 uniA663 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a664 uniA664 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a665 uniA665 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a666 uniA666 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a667 uniA667 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a668 uniA668 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a669 uniA669 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a66a uniA66A 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a66b uniA66B 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a66c uniA66C 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a66d uniA66D 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a66e uniA66E 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a68a uniA68A 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a68b uniA68B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a68c uniA68C 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a68d uniA68D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a694 uniA694 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a695 uniA695 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a708 uniA708 2.27 -U+a709 uniA709 2.27 -U+a70a uniA70A 2.27 -U+a70b uniA70B 2.27 -U+a70c uniA70C 2.27 -U+a70d uniA70D 2.27 -U+a70e uniA70E 2.27 -U+a70f uniA70F 2.27 -U+a710 uniA710 2.27 -U+a711 uniA711 2.27 -U+a712 uniA712 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a713 uniA713 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a714 uniA714 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a715 uniA715 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a716 uniA716 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.27 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+a71b uniA71B 2.27 -U+a71c uniA71C 2.27 -U+a71d uniA71D 2.27 -U+a71e uniA71E 2.27 -U+a71f uniA71F 2.27 -U+a726 uniA726 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+a727 uniA727 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) 2.30 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) -U+a728 uniA728 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a729 uniA729 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a72a uniA72A 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a72b uniA72B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a730 uniA730 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a731 uniA731 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a732 uniA732 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a733 uniA733 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a734 uniA734 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a735 uniA735 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a736 uniA736 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a737 uniA737 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a738 uniA738 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a739 uniA739 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a73a uniA73A 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a73b uniA73B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a73c uniA73C 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a73d uniA73D 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a73e uniA73E 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a73f uniA73F 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a746 uniA746 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a747 uniA747 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a748 uniA748 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a749 uniA749 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a74a uniA74A 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a74b uniA74B 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a74e uniA74E 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a74f uniA74F 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a780 uniA780 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a781 uniA781 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a782 uniA782 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a783 uniA783 2.27 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+a789 uniA789 2.28 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+a78a uniA78A 2.28 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique) -U+a78b uniA78B 2.26 -U+a78c uniA78C 2.26 -U+a7fb uniA7FB 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a7fc uniA7FC 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a7fd uniA7FD 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a7fe uniA7FE 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+a7ff uniA7FF 2.26 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e000 uniE000 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e001 uniE001 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e002 uniE002 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e003 uniE003 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e004 uniE004 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e005 uniE005 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e006 uniE006 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e007 uniE007 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e008 uniE008 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique) -U+e009 uniE009 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00a uniE00A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00b uniE00B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00c uniE00C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00d uniE00D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00e uniE00E 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e00f uniE00F 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e010 uniE010 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e011 uniE011 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e012 uniE012 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e013 uniE013 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e014 uniE014 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) -U+e015 uniE015 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e016 uniE016 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e017 uniE017 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e018 uniE018 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e019 uniE019 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e01a uniE01A 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e01b uniE01B 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e01c uniE01C 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+e01d uniE01D 2.4 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f000 uniF000 2.10 (Sans) 2.11 (Sans Condensed) -U+f001 uniF001 2.10 (Sans) 2.11 (Sans Condensed) -U+f208 uniF208 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f20a uniF20A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f215 uniF215 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f216 uniF216 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f217 uniF217 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f21a uniF21A 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f21b uniF21B 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f25f uniF25F 2.6 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+f400 uniF400 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f401 uniF401 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f402 uniF402 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f403 uniF403 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f404 uniF404 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f405 uniF405 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f406 uniF406 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f407 uniF407 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f408 uniF408 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f409 uniF409 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40a uniF40A 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40b uniF40B 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40c uniF40C 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40d uniF40D 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40e uniF40E 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f40f uniF40F 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f410 uniF410 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f411 uniF411 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f412 uniF412 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f413 uniF413 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f414 uniF414 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f415 uniF415 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f416 uniF416 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f417 uniF417 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f418 uniF418 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f419 uniF419 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41a uniF41A 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41b uniF41B 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41c uniF41C 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41d uniF41D 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41e uniF41E 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f41f uniF41F 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f420 uniF420 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f421 uniF421 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f422 uniF422 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f423 uniF423 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f424 uniF424 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f425 uniF425 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f426 uniF426 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f428 uniF428 2.28 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Italic, Serif Italic Condensed) -U+f5c5 uniF5C5 2.9 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+f6c4 uniF6C4 2.10 (Serif Bold Italic, Serif Italic) 2.11 (Serif Condensed Bold Italic, Serif Condensed Italic) 2.23 (Serif Italic Condensed) -U+f6c5 uniF6C5 2.5 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.7 (Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique) 2.9 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold, Sans Condensed Oblique, Sans Oblique) 2.18 (Sans ExtraLight) 2.23 (Serif Italic Condensed) -U+f6c6 uniF6C6 2.5 (Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+f6c7 uniF6C7 2.11 (Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+f6c8 uniF6C8 2.11 (Serif Bold Italic, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+f6d1 cyrBreve 2.5 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+f6d4 cyrbreve 2.5 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb00 uniFB00 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.8 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb01 fi original -U+fb02 fl original -U+fb03 uniFB03 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.8 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb04 uniFB04 2.2 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.5 (Sans ExtraLight) 2.8 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb05 uniFB05 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb06 uniFB06 2.5 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.8 (Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fb13 uniFB13 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb14 uniFB14 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb15 uniFB15 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb16 uniFB16 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb17 uniFB17 2.3 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb1d uniFB1D 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb1e uniFB1E 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb1f uniFB1F 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb20 uniFB20 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb21 uniFB21 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb22 uniFB22 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb23 uniFB23 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb24 uniFB24 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb25 uniFB25 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb26 uniFB26 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb27 uniFB27 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb28 uniFB28 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb29 uniFB29 2.10 (Sans, Sans Bold, Sans Bold Oblique, Sans ExtraLight, Sans Oblique) 2.11 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb2a uniFB2A 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb2b uniFB2B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb2c uniFB2C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb2d uniFB2D 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb2e uniFB2E 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb2f uniFB2F 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb30 uniFB30 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb31 uniFB31 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb32 uniFB32 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb33 uniFB33 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb34 uniFB34 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb35 uniFB35 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb36 uniFB36 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb37 uniFB37 2.11 (Sans Condensed Oblique, Sans Oblique) -U+fb38 uniFB38 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb39 uniFB39 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb3a uniFB3A 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb3b uniFB3B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb3c uniFB3C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb3e uniFB3E 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb40 uniFB40 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb41 uniFB41 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb43 uniFB43 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb44 uniFB44 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb46 uniFB46 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb47 uniFB47 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb48 uniFB48 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb49 uniFB49 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4a uniFB4A 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4b uniFB4B 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4c uniFB4C 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4d uniFB4D 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4e uniFB4E 2.9 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fb4f uniFB4F 2.16 (Sans, Sans Bold, Sans Bold Oblique, Sans Oblique) 2.17 (Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique) -U+fb52 uniFB52 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb53 uniFB53 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb54 uniFB54 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb55 uniFB55 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb56 uniFB56 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb57 uniFB57 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb58 uniFB58 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb59 uniFB59 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5a uniFB5A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5b uniFB5B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5c uniFB5C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5d uniFB5D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5e uniFB5E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb5f uniFB5F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb60 uniFB60 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb61 uniFB61 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb62 uniFB62 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb63 uniFB63 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb64 uniFB64 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb65 uniFB65 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb66 uniFB66 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb67 uniFB67 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb68 uniFB68 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb69 uniFB69 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6a uniFB6A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6b uniFB6B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6c uniFB6C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6d uniFB6D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6e uniFB6E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb6f uniFB6F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb70 uniFB70 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb71 uniFB71 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb72 uniFB72 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb73 uniFB73 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb74 uniFB74 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb75 uniFB75 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb76 uniFB76 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb77 uniFB77 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb78 uniFB78 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb79 uniFB79 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7a uniFB7A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7b uniFB7B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7c uniFB7C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7d uniFB7D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7e uniFB7E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb7f uniFB7F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb80 uniFB80 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb81 uniFB81 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8a uniFB8A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8b uniFB8B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8c uniFB8C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8d uniFB8D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8e uniFB8E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb8f uniFB8F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb90 uniFB90 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb91 uniFB91 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb92 uniFB92 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb93 uniFB93 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb94 uniFB94 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb95 uniFB95 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb9e uniFB9E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fb9f uniFB9F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbaa uniFBAA 2.16 (Sans Mono, Sans Mono Bold) -U+fbab uniFBAB 2.16 (Sans Mono, Sans Mono Bold) -U+fbac uniFBAC 2.16 (Sans Mono, Sans Mono Bold) -U+fbad uniFBAD 2.16 (Sans Mono, Sans Mono Bold) -U+fbd9 uniFBD9 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+fbda uniFBDA 2.7 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) -U+fbe8 uniFBE8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbe9 uniFBE9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbfc uniFBFC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbfd uniFBFD 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbfe uniFBFE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fbff uniFBFF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe00 uniFE00 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe01 uniFE01 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe02 uniFE02 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe03 uniFE03 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe04 uniFE04 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe05 uniFE05 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe06 uniFE06 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe07 uniFE07 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe08 uniFE08 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe09 uniFE09 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0a uniFE0A 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0b uniFE0B 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0c uniFE0C 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0d uniFE0D 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0e uniFE0E 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe0f uniFE0F 2.14 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans ExtraLight, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fe20 uniFE20 2.21 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fe21 uniFE21 2.21 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fe22 uniFE22 2.21 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fe23 uniFE23 2.21 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+fe70 uniFE70 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe71 uniFE71 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe72 uniFE72 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe73 uniFE73 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe74 uniFE74 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe76 uniFE76 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe77 uniFE77 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe78 uniFE78 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe79 uniFE79 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7a uniFE7A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7b uniFE7B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7c uniFE7C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7d uniFE7D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7e uniFE7E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe7f uniFE7F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe80 uniFE80 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe81 uniFE81 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe82 uniFE82 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe83 uniFE83 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe84 uniFE84 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe85 uniFE85 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe86 uniFE86 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe87 uniFE87 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe88 uniFE88 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe89 uniFE89 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8a uniFE8A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8b uniFE8B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8c uniFE8C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8d uniFE8D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8e uniFE8E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe8f uniFE8F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe90 uniFE90 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe91 uniFE91 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe92 uniFE92 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe93 uniFE93 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe94 uniFE94 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe95 uniFE95 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe96 uniFE96 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe97 uniFE97 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe98 uniFE98 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe99 uniFE99 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9a uniFE9A 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9b uniFE9B 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9c uniFE9C 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9d uniFE9D 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9e uniFE9E 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fe9f uniFE9F 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea0 uniFEA0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea1 uniFEA1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea2 uniFEA2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea3 uniFEA3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea4 uniFEA4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea5 uniFEA5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea6 uniFEA6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea7 uniFEA7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea8 uniFEA8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fea9 uniFEA9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feaa uniFEAA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feab uniFEAB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feac uniFEAC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fead uniFEAD 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feae uniFEAE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feaf uniFEAF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb0 uniFEB0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb1 uniFEB1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb2 uniFEB2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb3 uniFEB3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb4 uniFEB4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb5 uniFEB5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb6 uniFEB6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb7 uniFEB7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb8 uniFEB8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feb9 uniFEB9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feba uniFEBA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+febb uniFEBB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+febc uniFEBC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+febd uniFEBD 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+febe uniFEBE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+febf uniFEBF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec0 uniFEC0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec1 uniFEC1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec2 uniFEC2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec3 uniFEC3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec4 uniFEC4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec5 uniFEC5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec6 uniFEC6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec7 uniFEC7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec8 uniFEC8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fec9 uniFEC9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feca uniFECA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fecb uniFECB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fecc uniFECC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fecd uniFECD 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fece uniFECE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fecf uniFECF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed0 uniFED0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed1 uniFED1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed2 uniFED2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed3 uniFED3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed4 uniFED4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed5 uniFED5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed6 uniFED6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed7 uniFED7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed8 uniFED8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fed9 uniFED9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feda uniFEDA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fedb uniFEDB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fedc uniFEDC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fedd uniFEDD 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fede uniFEDE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fedf uniFEDF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee0 uniFEE0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee1 uniFEE1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee2 uniFEE2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee3 uniFEE3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee4 uniFEE4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee5 uniFEE5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee6 uniFEE6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee7 uniFEE7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee8 uniFEE8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fee9 uniFEE9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feea uniFEEA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feeb uniFEEB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feec uniFEEC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feed uniFEED 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feee uniFEEE 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feef uniFEEF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef0 uniFEF0 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef1 uniFEF1 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef2 uniFEF2 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef3 uniFEF3 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef4 uniFEF4 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef5 uniFEF5 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef6 uniFEF6 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef7 uniFEF7 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef8 uniFEF8 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fef9 uniFEF9 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fefa uniFEFA 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fefb uniFEFB 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fefc uniFEFC 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+feff uniFEFF 2.4 (Sans, Sans Bold, Sans Condensed, Sans Condensed Bold) 2.16 (Sans Mono, Sans Mono Bold) -U+fff9 uniFFF9 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fffa uniFFFA 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fffb uniFFFB 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fffc uniFFFC 2.22 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Mono, Sans Mono Bold, Sans Mono Bold Oblique, Sans Mono Oblique, Sans Oblique, Serif, Serif Bold, Serif Bold Italic, Serif Condensed, Serif Condensed Bold, Serif Condensed Bold Italic, Serif Condensed Italic, Serif Italic) 2.23 (Serif Italic Condensed) -U+fffd uniFFFD 1.12 -U+1d300 u1D300 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d301 u1D301 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d302 u1D302 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d303 u1D303 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d304 u1D304 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d305 u1D305 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d306 u1D306 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d307 u1D307 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d308 u1D308 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d309 u1D309 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30a u1D30A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30b u1D30B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30c u1D30C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30d u1D30D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30e u1D30E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d30f u1D30F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d310 u1D310 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d311 u1D311 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d312 u1D312 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d313 u1D313 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d314 u1D314 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d315 u1D315 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d316 u1D316 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d317 u1D317 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d318 u1D318 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d319 u1D319 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31a u1D31A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31b u1D31B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31c u1D31C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31d u1D31D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31e u1D31E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d31f u1D31F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d320 u1D320 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d321 u1D321 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d322 u1D322 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d323 u1D323 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d324 u1D324 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d325 u1D325 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d326 u1D326 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d327 u1D327 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d328 u1D328 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d329 u1D329 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32a u1D32A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32b u1D32B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32c u1D32C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32d u1D32D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32e u1D32E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d32f u1D32F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d330 u1D330 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d331 u1D331 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d332 u1D332 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d333 u1D333 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d334 u1D334 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d335 u1D335 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d336 u1D336 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d337 u1D337 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d338 u1D338 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d339 u1D339 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33a u1D33A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33b u1D33B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33c u1D33C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33d u1D33D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33e u1D33E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d33f u1D33F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d340 u1D340 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d341 u1D341 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d342 u1D342 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d343 u1D343 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d344 u1D344 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d345 u1D345 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d346 u1D346 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d347 u1D347 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d348 u1D348 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d349 u1D349 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34a u1D34A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34b u1D34B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34c u1D34C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34d u1D34D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34e u1D34E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d34f u1D34F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d350 u1D350 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d351 u1D351 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d352 u1D352 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d353 u1D353 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d354 u1D354 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d355 u1D355 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d356 u1D356 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) -U+1d400 u1D400 2.23 (Serif Bold, Serif Condensed Bold) -U+1d401 u1D401 2.23 (Serif Bold, Serif Condensed Bold) -U+1d402 u1D402 2.23 (Serif Bold, Serif Condensed Bold) -U+1d403 u1D403 2.23 (Serif Bold, Serif Condensed Bold) -U+1d404 u1D404 2.23 (Serif Bold, Serif Condensed Bold) -U+1d405 u1D405 2.23 (Serif Bold, Serif Condensed Bold) -U+1d406 u1D406 2.23 (Serif Bold, Serif Condensed Bold) -U+1d407 u1D407 2.23 (Serif Bold, Serif Condensed Bold) -U+1d408 u1D408 2.23 (Serif Bold, Serif Condensed Bold) -U+1d409 u1D409 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40a u1D40A 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40b u1D40B 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40c u1D40C 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40d u1D40D 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40e u1D40E 2.23 (Serif Bold, Serif Condensed Bold) -U+1d40f u1D40F 2.23 (Serif Bold, Serif Condensed Bold) -U+1d410 u1D410 2.23 (Serif Bold, Serif Condensed Bold) -U+1d411 u1D411 2.23 (Serif Bold, Serif Condensed Bold) -U+1d412 u1D412 2.23 (Serif Bold, Serif Condensed Bold) -U+1d413 u1D413 2.23 (Serif Bold, Serif Condensed Bold) -U+1d414 u1D414 2.23 (Serif Bold, Serif Condensed Bold) -U+1d415 u1D415 2.23 (Serif Bold, Serif Condensed Bold) -U+1d416 u1D416 2.23 (Serif Bold, Serif Condensed Bold) -U+1d417 u1D417 2.23 (Serif Bold, Serif Condensed Bold) -U+1d418 u1D418 2.23 (Serif Bold, Serif Condensed Bold) -U+1d419 u1D419 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41a u1D41A 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41b u1D41B 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41c u1D41C 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41d u1D41D 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41e u1D41E 2.23 (Serif Bold, Serif Condensed Bold) -U+1d41f u1D41F 2.23 (Serif Bold, Serif Condensed Bold) -U+1d420 u1D420 2.23 (Serif Bold, Serif Condensed Bold) -U+1d421 u1D421 2.23 (Serif Bold, Serif Condensed Bold) -U+1d422 u1D422 2.23 (Serif Bold, Serif Condensed Bold) -U+1d423 u1D423 2.23 (Serif Bold, Serif Condensed Bold) -U+1d424 u1D424 2.23 (Serif Bold, Serif Condensed Bold) -U+1d425 u1D425 2.23 (Serif Bold, Serif Condensed Bold) -U+1d426 u1D426 2.23 (Serif Bold, Serif Condensed Bold) -U+1d427 u1D427 2.23 (Serif Bold, Serif Condensed Bold) -U+1d428 u1D428 2.23 (Serif Bold, Serif Condensed Bold) -U+1d429 u1D429 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42a u1D42A 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42b u1D42B 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42c u1D42C 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42d u1D42D 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42e u1D42E 2.23 (Serif Bold, Serif Condensed Bold) -U+1d42f u1D42F 2.23 (Serif Bold, Serif Condensed Bold) -U+1d430 u1D430 2.23 (Serif Bold, Serif Condensed Bold) -U+1d431 u1D431 2.23 (Serif Bold, Serif Condensed Bold) -U+1d432 u1D432 2.23 (Serif Bold, Serif Condensed Bold) -U+1d433 u1D433 2.23 (Serif Bold, Serif Condensed Bold) -U+1d434 u1D434 2.23 (Serif Italic, Serif Italic Condensed) -U+1d435 u1D435 2.23 (Serif Italic, Serif Italic Condensed) -U+1d436 u1D436 2.23 (Serif Italic, Serif Italic Condensed) -U+1d437 u1D437 2.23 (Serif Italic, Serif Italic Condensed) -U+1d438 u1D438 2.23 (Serif Italic, Serif Italic Condensed) -U+1d439 u1D439 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43a u1D43A 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43b u1D43B 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43c u1D43C 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43d u1D43D 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43e u1D43E 2.23 (Serif Italic, Serif Italic Condensed) -U+1d43f u1D43F 2.23 (Serif Italic, Serif Italic Condensed) -U+1d440 u1D440 2.23 (Serif Italic, Serif Italic Condensed) -U+1d441 u1D441 2.23 (Serif Italic, Serif Italic Condensed) -U+1d442 u1D442 2.23 (Serif Italic, Serif Italic Condensed) -U+1d443 u1D443 2.23 (Serif Italic, Serif Italic Condensed) -U+1d444 u1D444 2.23 (Serif Italic, Serif Italic Condensed) -U+1d445 u1D445 2.23 (Serif Italic, Serif Italic Condensed) -U+1d446 u1D446 2.23 (Serif Italic, Serif Italic Condensed) -U+1d447 u1D447 2.23 (Serif Italic, Serif Italic Condensed) -U+1d448 u1D448 2.23 (Serif Italic, Serif Italic Condensed) -U+1d449 u1D449 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44a u1D44A 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44b u1D44B 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44c u1D44C 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44d u1D44D 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44e u1D44E 2.23 (Serif Italic, Serif Italic Condensed) -U+1d44f u1D44F 2.23 (Serif Italic, Serif Italic Condensed) -U+1d450 u1D450 2.23 (Serif Italic, Serif Italic Condensed) -U+1d451 u1D451 2.23 (Serif Italic, Serif Italic Condensed) -U+1d452 u1D452 2.23 (Serif Italic, Serif Italic Condensed) -U+1d453 u1D453 2.23 (Serif Italic, Serif Italic Condensed) -U+1d454 u1D454 2.23 (Serif Italic, Serif Italic Condensed) -U+1d456 u1D456 2.23 (Serif Italic, Serif Italic Condensed) -U+1d457 u1D457 2.23 (Serif Italic, Serif Italic Condensed) -U+1d458 u1D458 2.23 (Serif Italic, Serif Italic Condensed) -U+1d459 u1D459 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45a u1D45A 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45b u1D45B 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45c u1D45C 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45d u1D45D 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45e u1D45E 2.23 (Serif Italic, Serif Italic Condensed) -U+1d45f u1D45F 2.23 (Serif Italic, Serif Italic Condensed) -U+1d460 u1D460 2.23 (Serif Italic, Serif Italic Condensed) -U+1d461 u1D461 2.23 (Serif Italic, Serif Italic Condensed) -U+1d462 u1D462 2.23 (Serif Italic, Serif Italic Condensed) -U+1d463 u1D463 2.23 (Serif Italic, Serif Italic Condensed) -U+1d464 u1D464 2.23 (Serif Italic, Serif Italic Condensed) -U+1d465 u1D465 2.23 (Serif Italic, Serif Italic Condensed) -U+1d466 u1D466 2.23 (Serif Italic, Serif Italic Condensed) -U+1d467 u1D467 2.23 (Serif Italic, Serif Italic Condensed) -U+1d468 u1D468 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d469 u1D469 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46a u1D46A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46b u1D46B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46c u1D46C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46d u1D46D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46e u1D46E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d46f u1D46F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d470 u1D470 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d471 u1D471 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d472 u1D472 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d473 u1D473 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d474 u1D474 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d475 u1D475 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d476 u1D476 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d477 u1D477 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d478 u1D478 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d479 u1D479 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47a u1D47A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47b u1D47B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47c u1D47C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47d u1D47D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47e u1D47E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d47f u1D47F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d480 u1D480 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d481 u1D481 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d482 u1D482 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d483 u1D483 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d484 u1D484 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d485 u1D485 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d486 u1D486 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d487 u1D487 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d488 u1D488 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d489 u1D489 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48a u1D48A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48b u1D48B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48c u1D48C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48d u1D48D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48e u1D48E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d48f u1D48F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d490 u1D490 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d491 u1D491 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d492 u1D492 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d493 u1D493 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d494 u1D494 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d495 u1D495 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d496 u1D496 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d497 u1D497 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d498 u1D498 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d499 u1D499 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d49a u1D49A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d49b u1D49B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d538 u1D538 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d539 u1D539 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d53b u1D53B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d53c u1D53C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d53d u1D53D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d53e u1D53E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d540 u1D540 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d541 u1D541 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d542 u1D542 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d543 u1D543 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d544 u1D544 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d546 u1D546 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54a u1D54A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54b u1D54B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54c u1D54C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54d u1D54D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54e u1D54E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d54f u1D54F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d550 u1D550 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d552 u1D552 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d553 u1D553 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d554 u1D554 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d555 u1D555 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d556 u1D556 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d557 u1D557 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d558 u1D558 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d559 u1D559 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55a u1D55A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55b u1D55B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55c u1D55C 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55d u1D55D 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55e u1D55E 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d55f u1D55F 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d560 u1D560 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d561 u1D561 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d562 u1D562 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d563 u1D563 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d564 u1D564 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d565 u1D565 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d566 u1D566 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d567 u1D567 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d568 u1D568 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d569 u1D569 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d56a u1D56A 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d56b u1D56B 2.18 (Sans, Sans Bold, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.22 (Serif, Serif Condensed) -U+1d5a0 u1D5A0 2.23 (Sans, Sans Condensed) -U+1d5a1 u1D5A1 2.23 (Sans, Sans Condensed) -U+1d5a2 u1D5A2 2.23 (Sans, Sans Condensed) -U+1d5a3 u1D5A3 2.23 (Sans, Sans Condensed) -U+1d5a4 u1D5A4 2.23 (Sans, Sans Condensed) -U+1d5a5 u1D5A5 2.23 (Sans, Sans Condensed) -U+1d5a6 u1D5A6 2.23 (Sans, Sans Condensed) -U+1d5a7 u1D5A7 2.23 (Sans, Sans Condensed) -U+1d5a8 u1D5A8 2.23 (Sans, Sans Condensed) -U+1d5a9 u1D5A9 2.23 (Sans, Sans Condensed) -U+1d5aa u1D5AA 2.23 (Sans, Sans Condensed) -U+1d5ab u1D5AB 2.23 (Sans, Sans Condensed) -U+1d5ac u1D5AC 2.23 (Sans, Sans Condensed) -U+1d5ad u1D5AD 2.23 (Sans, Sans Condensed) -U+1d5ae u1D5AE 2.23 (Sans, Sans Condensed) -U+1d5af u1D5AF 2.23 (Sans, Sans Condensed) -U+1d5b0 u1D5B0 2.23 (Sans, Sans Condensed) -U+1d5b1 u1D5B1 2.23 (Sans, Sans Condensed) -U+1d5b2 u1D5B2 2.23 (Sans, Sans Condensed) -U+1d5b3 u1D5B3 2.23 (Sans, Sans Condensed) -U+1d5b4 u1D5B4 2.23 (Sans, Sans Condensed) -U+1d5b5 u1D5B5 2.23 (Sans, Sans Condensed) -U+1d5b6 u1D5B6 2.23 (Sans, Sans Condensed) -U+1d5b7 u1D5B7 2.23 (Sans, Sans Condensed) -U+1d5b8 u1D5B8 2.23 (Sans, Sans Condensed) -U+1d5b9 u1D5B9 2.23 (Sans, Sans Condensed) -U+1d5ba u1D5BA 2.23 (Sans, Sans Condensed) -U+1d5bb u1D5BB 2.23 (Sans, Sans Condensed) -U+1d5bc u1D5BC 2.23 (Sans, Sans Condensed) -U+1d5bd u1D5BD 2.23 (Sans, Sans Condensed) -U+1d5be u1D5BE 2.23 (Sans, Sans Condensed) -U+1d5bf u1D5BF 2.23 (Sans, Sans Condensed) -U+1d5c0 u1D5C0 2.23 (Sans, Sans Condensed) -U+1d5c1 u1D5C1 2.23 (Sans, Sans Condensed) -U+1d5c2 u1D5C2 2.23 (Sans, Sans Condensed) -U+1d5c3 u1D5C3 2.23 (Sans, Sans Condensed) -U+1d5c4 u1D5C4 2.23 (Sans, Sans Condensed) -U+1d5c5 u1D5C5 2.23 (Sans, Sans Condensed) -U+1d5c6 u1D5C6 2.23 (Sans, Sans Condensed) -U+1d5c7 u1D5C7 2.23 (Sans, Sans Condensed) -U+1d5c8 u1D5C8 2.23 (Sans, Sans Condensed) -U+1d5c9 u1D5C9 2.23 (Sans, Sans Condensed) -U+1d5ca u1D5CA 2.23 (Sans, Sans Condensed) -U+1d5cb u1D5CB 2.23 (Sans, Sans Condensed) -U+1d5cc u1D5CC 2.23 (Sans, Sans Condensed) -U+1d5cd u1D5CD 2.23 (Sans, Sans Condensed) -U+1d5ce u1D5CE 2.23 (Sans, Sans Condensed) -U+1d5cf u1D5CF 2.23 (Sans, Sans Condensed) -U+1d5d0 u1D5D0 2.23 (Sans, Sans Condensed) -U+1d5d1 u1D5D1 2.23 (Sans, Sans Condensed) -U+1d5d2 u1D5D2 2.23 (Sans, Sans Condensed) -U+1d5d3 u1D5D3 2.23 (Sans, Sans Condensed) -U+1d5d4 u1D5D4 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5d5 u1D5D5 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5d6 u1D5D6 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5d7 u1D5D7 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5d8 u1D5D8 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5d9 u1D5D9 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5da u1D5DA 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5db u1D5DB 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5dc u1D5DC 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5dd u1D5DD 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5de u1D5DE 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5df u1D5DF 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e0 u1D5E0 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e1 u1D5E1 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e2 u1D5E2 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e3 u1D5E3 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e4 u1D5E4 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e5 u1D5E5 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e6 u1D5E6 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e7 u1D5E7 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e8 u1D5E8 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5e9 u1D5E9 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ea u1D5EA 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5eb u1D5EB 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ec u1D5EC 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ed u1D5ED 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ee u1D5EE 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ef u1D5EF 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f0 u1D5F0 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f1 u1D5F1 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f2 u1D5F2 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f3 u1D5F3 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f4 u1D5F4 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f5 u1D5F5 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f6 u1D5F6 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f7 u1D5F7 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f8 u1D5F8 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5f9 u1D5F9 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5fa u1D5FA 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5fb u1D5FB 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5fc u1D5FC 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5fd u1D5FD 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5fe u1D5FE 2.23 (Sans Bold, Sans Condensed Bold) -U+1d5ff u1D5FF 2.23 (Sans Bold, Sans Condensed Bold) -U+1d600 u1D600 2.23 (Sans Bold, Sans Condensed Bold) -U+1d601 u1D601 2.23 (Sans Bold, Sans Condensed Bold) -U+1d602 u1D602 2.23 (Sans Bold, Sans Condensed Bold) -U+1d603 u1D603 2.23 (Sans Bold, Sans Condensed Bold) -U+1d604 u1D604 2.23 (Sans Bold, Sans Condensed Bold) -U+1d605 u1D605 2.23 (Sans Bold, Sans Condensed Bold) -U+1d606 u1D606 2.23 (Sans Bold, Sans Condensed Bold) -U+1d607 u1D607 2.23 (Sans Bold, Sans Condensed Bold) -U+1d608 u1D608 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d609 u1D609 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60a u1D60A 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60b u1D60B 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60c u1D60C 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60d u1D60D 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60e u1D60E 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d60f u1D60F 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d610 u1D610 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d611 u1D611 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d612 u1D612 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d613 u1D613 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d614 u1D614 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d615 u1D615 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d616 u1D616 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d617 u1D617 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d618 u1D618 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d619 u1D619 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61a u1D61A 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61b u1D61B 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61c u1D61C 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61d u1D61D 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61e u1D61E 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d61f u1D61F 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d620 u1D620 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d621 u1D621 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d622 u1D622 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d623 u1D623 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d624 u1D624 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d625 u1D625 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d626 u1D626 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d627 u1D627 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d628 u1D628 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d629 u1D629 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62a u1D62A 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62b u1D62B 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62c u1D62C 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62d u1D62D 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62e u1D62E 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d62f u1D62F 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d630 u1D630 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d631 u1D631 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d632 u1D632 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d633 u1D633 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d634 u1D634 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d635 u1D635 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d636 u1D636 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d637 u1D637 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d638 u1D638 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d639 u1D639 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d63a u1D63A 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d63b u1D63B 2.23 (Sans Condensed Oblique, Sans Oblique) -U+1d63c u1D63C 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d63d u1D63D 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d63e u1D63E 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d63f u1D63F 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d640 u1D640 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d641 u1D641 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d642 u1D642 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d643 u1D643 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d644 u1D644 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d645 u1D645 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d646 u1D646 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d647 u1D647 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d648 u1D648 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d649 u1D649 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64a u1D64A 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64b u1D64B 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64c u1D64C 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64d u1D64D 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64e u1D64E 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d64f u1D64F 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d650 u1D650 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d651 u1D651 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d652 u1D652 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d653 u1D653 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d654 u1D654 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d655 u1D655 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d656 u1D656 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d657 u1D657 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d658 u1D658 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d659 u1D659 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65a u1D65A 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65b u1D65B 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65c u1D65C 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65d u1D65D 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65e u1D65E 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d65f u1D65F 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d660 u1D660 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d661 u1D661 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d662 u1D662 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d663 u1D663 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d664 u1D664 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d665 u1D665 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d666 u1D666 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d667 u1D667 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d668 u1D668 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d669 u1D669 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66a u1D66A 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66b u1D66B 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66c u1D66C 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66d u1D66D 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66e u1D66E 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d66f u1D66F 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d670 u1D670 2.23 (Sans Mono) -U+1d671 u1D671 2.23 (Sans Mono) -U+1d672 u1D672 2.23 (Sans Mono) -U+1d673 u1D673 2.23 (Sans Mono) -U+1d674 u1D674 2.23 (Sans Mono) -U+1d675 u1D675 2.23 (Sans Mono) -U+1d676 u1D676 2.23 (Sans Mono) -U+1d677 u1D677 2.23 (Sans Mono) -U+1d678 u1D678 2.23 (Sans Mono) -U+1d679 u1D679 2.23 (Sans Mono) -U+1d67a u1D67A 2.23 (Sans Mono) -U+1d67b u1D67B 2.23 (Sans Mono) -U+1d67c u1D67C 2.23 (Sans Mono) -U+1d67d u1D67D 2.23 (Sans Mono) -U+1d67e u1D67E 2.23 (Sans Mono) -U+1d67f u1D67F 2.23 (Sans Mono) -U+1d680 u1D680 2.23 (Sans Mono) -U+1d681 u1D681 2.23 (Sans Mono) -U+1d682 u1D682 2.23 (Sans Mono) -U+1d683 u1D683 2.23 (Sans Mono) -U+1d684 u1D684 2.23 (Sans Mono) -U+1d685 u1D685 2.23 (Sans Mono) -U+1d686 u1D686 2.23 (Sans Mono) -U+1d687 u1D687 2.23 (Sans Mono) -U+1d688 u1D688 2.23 (Sans Mono) -U+1d689 u1D689 2.23 (Sans Mono) -U+1d68a u1D68A 2.23 (Sans Mono) -U+1d68b u1D68B 2.23 (Sans Mono) -U+1d68c u1D68C 2.23 (Sans Mono) -U+1d68d u1D68D 2.23 (Sans Mono) -U+1d68e u1D68E 2.23 (Sans Mono) -U+1d68f u1D68F 2.23 (Sans Mono) -U+1d690 u1D690 2.23 (Sans Mono) -U+1d691 u1D691 2.23 (Sans Mono) -U+1d692 u1D692 2.23 (Sans Mono) -U+1d693 u1D693 2.23 (Sans Mono) -U+1d694 u1D694 2.23 (Sans Mono) -U+1d695 u1D695 2.23 (Sans Mono) -U+1d696 u1D696 2.23 (Sans Mono) -U+1d697 u1D697 2.23 (Sans Mono) -U+1d698 u1D698 2.23 (Sans Mono) -U+1d699 u1D699 2.23 (Sans Mono) -U+1d69a u1D69A 2.23 (Sans Mono) -U+1d69b u1D69B 2.23 (Sans Mono) -U+1d69c u1D69C 2.23 (Sans Mono) -U+1d69d u1D69D 2.23 (Sans Mono) -U+1d69e u1D69E 2.23 (Sans Mono) -U+1d69f u1D69F 2.23 (Sans Mono) -U+1d6a0 u1D6A0 2.23 (Sans Mono) -U+1d6a1 u1D6A1 2.23 (Sans Mono) -U+1d6a2 u1D6A2 2.23 (Sans Mono) -U+1d6a3 u1D6A3 2.23 (Sans Mono) -U+1d6a4 u1D6A4 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6a5 u1D6A5 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6a8 u1D6A8 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6a9 u1D6A9 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6aa u1D6AA 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ab u1D6AB 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ac u1D6AC 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ad u1D6AD 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ae u1D6AE 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6af u1D6AF 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b0 u1D6B0 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b1 u1D6B1 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b2 u1D6B2 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b3 u1D6B3 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b4 u1D6B4 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b5 u1D6B5 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b6 u1D6B6 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b7 u1D6B7 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b8 u1D6B8 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6b9 u1D6B9 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ba u1D6BA 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6bb u1D6BB 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6bc u1D6BC 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6bd u1D6BD 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6be u1D6BE 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6bf u1D6BF 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c0 u1D6C0 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c1 u1D6C1 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c2 u1D6C2 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c3 u1D6C3 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c4 u1D6C4 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c5 u1D6C5 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c6 u1D6C6 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c7 u1D6C7 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c8 u1D6C8 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6c9 u1D6C9 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ca u1D6CA 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6cb u1D6CB 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6cc u1D6CC 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6cd u1D6CD 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6ce u1D6CE 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6cf u1D6CF 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d0 u1D6D0 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d1 u1D6D1 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d2 u1D6D2 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d3 u1D6D3 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d4 u1D6D4 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d5 u1D6D5 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d6 u1D6D6 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d7 u1D6D7 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d8 u1D6D8 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6d9 u1D6D9 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6da u1D6DA 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6db u1D6DB 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6dc u1D6DC 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6dd u1D6DD 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6de u1D6DE 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6df u1D6DF 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6e0 u1D6E0 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6e1 u1D6E1 2.23 (Serif Bold, Serif Condensed Bold) -U+1d6e2 u1D6E2 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e3 u1D6E3 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e4 u1D6E4 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e5 u1D6E5 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e6 u1D6E6 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e7 u1D6E7 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e8 u1D6E8 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6e9 u1D6E9 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ea u1D6EA 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6eb u1D6EB 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ec u1D6EC 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ed u1D6ED 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ee u1D6EE 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ef u1D6EF 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f0 u1D6F0 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f1 u1D6F1 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f2 u1D6F2 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f3 u1D6F3 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f4 u1D6F4 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f5 u1D6F5 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f6 u1D6F6 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f7 u1D6F7 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f8 u1D6F8 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6f9 u1D6F9 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6fa u1D6FA 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6fb u1D6FB 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6fc u1D6FC 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6fd u1D6FD 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6fe u1D6FE 2.23 (Serif Italic, Serif Italic Condensed) -U+1d6ff u1D6FF 2.23 (Serif Italic, Serif Italic Condensed) -U+1d700 u1D700 2.23 (Serif Italic, Serif Italic Condensed) -U+1d701 u1D701 2.23 (Serif Italic, Serif Italic Condensed) -U+1d702 u1D702 2.23 (Serif Italic, Serif Italic Condensed) -U+1d703 u1D703 2.23 (Serif Italic, Serif Italic Condensed) -U+1d704 u1D704 2.23 (Serif Italic, Serif Italic Condensed) -U+1d705 u1D705 2.23 (Serif Italic, Serif Italic Condensed) -U+1d706 u1D706 2.23 (Serif Italic, Serif Italic Condensed) -U+1d707 u1D707 2.23 (Serif Italic, Serif Italic Condensed) -U+1d708 u1D708 2.23 (Serif Italic, Serif Italic Condensed) -U+1d709 u1D709 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70a u1D70A 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70b u1D70B 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70c u1D70C 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70d u1D70D 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70e u1D70E 2.23 (Serif Italic, Serif Italic Condensed) -U+1d70f u1D70F 2.23 (Serif Italic, Serif Italic Condensed) -U+1d710 u1D710 2.23 (Serif Italic, Serif Italic Condensed) -U+1d711 u1D711 2.23 (Serif Italic, Serif Italic Condensed) -U+1d712 u1D712 2.23 (Serif Italic, Serif Italic Condensed) -U+1d713 u1D713 2.23 (Serif Italic, Serif Italic Condensed) -U+1d714 u1D714 2.23 (Serif Italic, Serif Italic Condensed) -U+1d715 u1D715 2.23 (Serif Italic, Serif Italic Condensed) -U+1d716 u1D716 2.23 (Serif Italic, Serif Italic Condensed) -U+1d717 u1D717 2.23 (Serif Italic, Serif Italic Condensed) -U+1d718 u1D718 2.23 (Serif Italic, Serif Italic Condensed) -U+1d719 u1D719 2.23 (Serif Italic, Serif Italic Condensed) -U+1d71a u1D71A 2.23 (Serif Italic, Serif Italic Condensed) -U+1d71b u1D71B 2.23 (Serif Italic, Serif Italic Condensed) -U+1d71c u1D71C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d71d u1D71D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d71e u1D71E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d71f u1D71F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d720 u1D720 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d721 u1D721 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d722 u1D722 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d723 u1D723 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d724 u1D724 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d725 u1D725 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d726 u1D726 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d727 u1D727 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d728 u1D728 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d729 u1D729 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72a u1D72A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72b u1D72B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72c u1D72C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72d u1D72D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72e u1D72E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d72f u1D72F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d730 u1D730 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d731 u1D731 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d732 u1D732 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d733 u1D733 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d734 u1D734 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d735 u1D735 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d736 u1D736 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d737 u1D737 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d738 u1D738 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d739 u1D739 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73a u1D73A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73b u1D73B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73c u1D73C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73d u1D73D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73e u1D73E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d73f u1D73F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d740 u1D740 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d741 u1D741 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d742 u1D742 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d743 u1D743 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d744 u1D744 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d745 u1D745 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d746 u1D746 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d747 u1D747 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d748 u1D748 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d749 u1D749 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74a u1D74A 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74b u1D74B 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74c u1D74C 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74d u1D74D 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74e u1D74E 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d74f u1D74F 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d750 u1D750 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d751 u1D751 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d752 u1D752 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d753 u1D753 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d754 u1D754 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d755 u1D755 2.23 (Serif Bold Italic, Serif Condensed Bold Italic) -U+1d756 u1D756 2.23 (Sans Bold, Sans Condensed Bold) -U+1d757 u1D757 2.23 (Sans Bold, Sans Condensed Bold) -U+1d758 u1D758 2.23 (Sans Bold, Sans Condensed Bold) -U+1d759 u1D759 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75a u1D75A 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75b u1D75B 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75c u1D75C 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75d u1D75D 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75e u1D75E 2.23 (Sans Bold, Sans Condensed Bold) -U+1d75f u1D75F 2.23 (Sans Bold, Sans Condensed Bold) -U+1d760 u1D760 2.23 (Sans Bold, Sans Condensed Bold) -U+1d761 u1D761 2.23 (Sans Bold, Sans Condensed Bold) -U+1d762 u1D762 2.23 (Sans Bold, Sans Condensed Bold) -U+1d763 u1D763 2.23 (Sans Bold, Sans Condensed Bold) -U+1d764 u1D764 2.23 (Sans Bold, Sans Condensed Bold) -U+1d765 u1D765 2.23 (Sans Bold, Sans Condensed Bold) -U+1d766 u1D766 2.23 (Sans Bold, Sans Condensed Bold) -U+1d767 u1D767 2.23 (Sans Bold, Sans Condensed Bold) -U+1d768 u1D768 2.23 (Sans Bold, Sans Condensed Bold) -U+1d769 u1D769 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76a u1D76A 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76b u1D76B 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76c u1D76C 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76d u1D76D 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76e u1D76E 2.23 (Sans Bold, Sans Condensed Bold) -U+1d76f u1D76F 2.23 (Sans Bold, Sans Condensed Bold) -U+1d770 u1D770 2.23 (Sans Bold, Sans Condensed Bold) -U+1d771 u1D771 2.23 (Sans Bold, Sans Condensed Bold) -U+1d772 u1D772 2.23 (Sans Bold, Sans Condensed Bold) -U+1d773 u1D773 2.23 (Sans Bold, Sans Condensed Bold) -U+1d774 u1D774 2.23 (Sans Bold, Sans Condensed Bold) -U+1d775 u1D775 2.23 (Sans Bold, Sans Condensed Bold) -U+1d776 u1D776 2.23 (Sans Bold, Sans Condensed Bold) -U+1d777 u1D777 2.23 (Sans Bold, Sans Condensed Bold) -U+1d778 u1D778 2.23 (Sans Bold, Sans Condensed Bold) -U+1d779 u1D779 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77a u1D77A 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77b u1D77B 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77c u1D77C 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77d u1D77D 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77e u1D77E 2.23 (Sans Bold, Sans Condensed Bold) -U+1d77f u1D77F 2.23 (Sans Bold, Sans Condensed Bold) -U+1d780 u1D780 2.23 (Sans Bold, Sans Condensed Bold) -U+1d781 u1D781 2.23 (Sans Bold, Sans Condensed Bold) -U+1d782 u1D782 2.23 (Sans Bold, Sans Condensed Bold) -U+1d783 u1D783 2.23 (Sans Bold, Sans Condensed Bold) -U+1d784 u1D784 2.23 (Sans Bold, Sans Condensed Bold) -U+1d785 u1D785 2.23 (Sans Bold, Sans Condensed Bold) -U+1d786 u1D786 2.23 (Sans Bold, Sans Condensed Bold) -U+1d787 u1D787 2.23 (Sans Bold, Sans Condensed Bold) -U+1d788 u1D788 2.23 (Sans Bold, Sans Condensed Bold) -U+1d789 u1D789 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78a u1D78A 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78b u1D78B 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78c u1D78C 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78d u1D78D 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78e u1D78E 2.23 (Sans Bold, Sans Condensed Bold) -U+1d78f u1D78F 2.23 (Sans Bold, Sans Condensed Bold) -U+1d790 u1D790 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d791 u1D791 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d792 u1D792 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d793 u1D793 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d794 u1D794 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d795 u1D795 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d796 u1D796 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d797 u1D797 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d798 u1D798 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d799 u1D799 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79a u1D79A 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79b u1D79B 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79c u1D79C 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79d u1D79D 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79e u1D79E 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d79f u1D79F 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a0 u1D7A0 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a1 u1D7A1 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a2 u1D7A2 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a3 u1D7A3 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a4 u1D7A4 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a5 u1D7A5 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a6 u1D7A6 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a7 u1D7A7 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a8 u1D7A8 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7a9 u1D7A9 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7aa u1D7AA 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ab u1D7AB 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ac u1D7AC 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ad u1D7AD 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ae u1D7AE 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7af u1D7AF 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b0 u1D7B0 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b1 u1D7B1 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b2 u1D7B2 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b3 u1D7B3 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b4 u1D7B4 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b5 u1D7B5 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b6 u1D7B6 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b7 u1D7B7 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b8 u1D7B8 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7b9 u1D7B9 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ba u1D7BA 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7bb u1D7BB 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7bc u1D7BC 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7bd u1D7BD 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7be u1D7BE 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7bf u1D7BF 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c0 u1D7C0 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c1 u1D7C1 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c2 u1D7C2 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c3 u1D7C3 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c4 u1D7C4 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c5 u1D7C5 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c6 u1D7C6 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c7 u1D7C7 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c8 u1D7C8 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7c9 u1D7C9 2.23 (Sans Bold Oblique, Sans Condensed Bold Oblique) -U+1d7ca u1D7CA 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7cb u1D7CB 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7ce u1D7CE 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7cf u1D7CF 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d0 u1D7D0 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d1 u1D7D1 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d2 u1D7D2 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d3 u1D7D3 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d4 u1D7D4 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d5 u1D7D5 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d6 u1D7D6 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d7 u1D7D7 2.23 (Serif Bold, Serif Condensed Bold) -U+1d7d8 u1D7D8 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7d9 u1D7D9 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7da u1D7DA 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7db u1D7DB 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7dc u1D7DC 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7dd u1D7DD 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7de u1D7DE 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7df u1D7DF 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7e0 u1D7E0 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7e1 u1D7E1 2.22 (Serif, Serif Condensed) 2.29 (Sans, Sans Bold Oblique, Sans Condensed, Sans Condensed Bold, Sans Condensed Bold Oblique, Sans Condensed Oblique, Sans Oblique) 2.30 (Sans Bold) -U+1d7e2 u1D7E2 2.23 (Sans, Sans Condensed) -U+1d7e3 u1D7E3 2.23 (Sans, Sans Condensed) -U+1d7e4 u1D7E4 2.23 (Sans, Sans Condensed) -U+1d7e5 u1D7E5 2.23 (Sans, Sans Condensed) -U+1d7e6 u1D7E6 2.23 (Sans, Sans Condensed) -U+1d7e7 u1D7E7 2.23 (Sans, Sans Condensed) -U+1d7e8 u1D7E8 2.23 (Sans, Sans Condensed) -U+1d7e9 u1D7E9 2.23 (Sans, Sans Condensed) -U+1d7ea u1D7EA 2.23 (Sans, Sans Condensed) -U+1d7eb u1D7EB 2.23 (Sans, Sans Condensed) -U+1d7ec u1D7EC 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7ed u1D7ED 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7ee u1D7EE 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7ef u1D7EF 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f0 u1D7F0 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f1 u1D7F1 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f2 u1D7F2 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f3 u1D7F3 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f4 u1D7F4 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f5 u1D7F5 2.23 (Sans Bold, Sans Condensed Bold) -U+1d7f6 u1D7F6 2.23 (Sans Mono) -U+1d7f7 u1D7F7 2.23 (Sans Mono) -U+1d7f8 u1D7F8 2.23 (Sans Mono) -U+1d7f9 u1D7F9 2.23 (Sans Mono) -U+1d7fa u1D7FA 2.23 (Sans Mono) -U+1d7fb u1D7FB 2.23 (Sans Mono) -U+1d7fc u1D7FC 2.23 (Sans Mono) -U+1d7fd u1D7FD 2.23 (Sans Mono) -U+1d7fe u1D7FE 2.23 (Sans Mono) -U+1d7ff u1D7FF 2.23 (Sans Mono) diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/unicover.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/unicover.txt deleted file mode 100644 index bd467ab24a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavu-fonts-ttf-2.30/unicover.txt +++ /dev/null @@ -1,177 +0,0 @@ -This is the Unicode coverage file for DejaVu fonts -($Id$) - -Control and similar characters are discounted from totals. - - Sans Serif Sans Mono -U+0000 Basic Latin 100% (95/95) 100% (95/95) 100% (95/95) -U+0080 Latin-1 Supplement 100% (96/96) 100% (96/96) 100% (96/96) -U+0100 Latin Extended-A 100% (128/128) 100% (128/128) 100% (128/128) -U+0180 Latin Extended-B 100% (208/208) 91% (191/208) 86% (179/208) -U+0250 IPA Extensions 100% (96/96) 100% (96/96) 100% (96/96) -U+02b0 Spacing Modifier Letters 78% (63/80) 56% (45/80) 60% (48/80) -U+0300 Combining Diacritical Marks 83% (93/112) 60% (68/112) 59% (67/112) -U+0370 Greek and Coptic 100% (134/134) 85% (115/134) 82% (110/134) -U+0400 Cyrillic 100% (256/256) 78% (200/256) 69% (178/256) -U+0500 Cyrillic Supplement 94% (34/36) 27% (10/36) 16% (6/36) -U+0530 Armenian 100% (86/86) (0/86) (0/86) -U+0590 Hebrew 62% (54/87) (0/87) (0/87) -U+0600 Arabic 46% (115/250) (0/250) 39% (99/250) -U+0700 Syriac (0/77) (0/77) (0/77) -U+0750 Arabic Supplement (0/48) (0/48) (0/48) -U+0780 Thaana (0/50) (0/50) (0/50) -U+07c0 NKo 91% (54/59) (0/59) (0/59) -U+0900 Devanagari (0/113) (0/113) (0/113) -U+0980 Bengali (0/91) (0/91) (0/91) -U+0a00 Gurmukhi (0/79) (0/79) (0/79) -U+0a80 Gujarati (0/83) (0/83) (0/83) -U+0b00 Oriya (0/84) (0/84) (0/84) -U+0b80 Tamil (0/72) (0/72) (0/72) -U+0c00 Telugu (0/93) (0/93) (0/93) -U+0c80 Kannada (0/86) (0/86) (0/86) -U+0d00 Malayalam (0/95) (0/95) (0/95) -U+0d80 Sinhala (0/80) (0/80) (0/80) -U+0e00 Thai 1% (1/87) (0/87) (0/87) -U+0e80 Lao 100% (65/65) (0/65) 70% (46/65) -U+0f00 Tibetan (0/201) (0/201) (0/201) -U+1000 Myanmar (0/156) (0/156) (0/156) -U+10a0 Georgian 100% (83/83) 100% (83/83) 54% (45/83) -U+1100 Hangul Jamo (0/240) (0/240) (0/240) -U+1200 Ethiopic (0/356) (0/356) (0/356) -U+1380 Ethiopic Supplement (0/26) (0/26) (0/26) -U+13a0 Cherokee (0/85) (0/85) (0/85) -U+1400 Unified Canadian Aboriginal Syllabics 64% (404/630) (0/630) (0/630) -U+1680 Ogham 100% (29/29) (0/29) (0/29) -U+16a0 Runic (0/81) (0/81) (0/81) -U+1700 Tagalog (0/20) (0/20) (0/20) -U+1720 Hanunoo (0/23) (0/23) (0/23) -U+1740 Buhid (0/20) (0/20) (0/20) -U+1760 Tagbanwa (0/18) (0/18) (0/18) -U+1780 Khmer (0/114) (0/114) (0/114) -U+1800 Mongolian (0/156) (0/156) (0/156) -U+1900 Limbu (0/66) (0/66) (0/66) -U+1950 Tai Le (0/35) (0/35) (0/35) -U+1980 New Tai Lue (0/80) (0/80) (0/80) -U+19e0 Khmer Symbols (0/32) (0/32) (0/32) -U+1a00 Buginese (0/30) (0/30) (0/30) -U+1b00 Balinese (0/121) (0/121) (0/121) -U+1b80 Sundanese (0/55) (0/55) (0/55) -U+1c00 Lepcha (0/74) (0/74) (0/74) -U+1c50 Ol Chiki (0/48) (0/48) (0/48) -U+1d00 Phonetic Extensions 82% (105/128) 48% (62/128) 48% (62/128) -U+1d80 Phonetic Extensions Supplement 59% (38/64) 57% (37/64) 57% (37/64) -U+1dc0 Combining Diacritical Marks Supplement 14% (6/41) 14% (6/41) (0/41) -U+1e00 Latin Extended Additional 96% (248/256) 76% (196/256) 71% (182/256) -U+1f00 Greek Extended 100% (233/233) 100% (233/233) 100% (233/233) -U+2000 General Punctuation 98% (105/107) 81% (87/107) 47% (51/107) -U+2070 Superscripts and Subscripts 100% (34/34) 100% (34/34) 100% (34/34) -U+20a0 Currency Symbols 100% (22/22) 27% (6/22) 100% (22/22) -U+20d0 Combining Diacritical Marks for Symbols 21% (7/33) (0/33) (0/33) -U+2100 Letterlike Symbols 93% (75/80) 40% (32/80) 21% (17/80) -U+2150 Number Forms 92% (50/54) 92% (50/54) 24% (13/54) -U+2190 Arrows 100% (112/112) 100% (112/112) 100% (112/112) -U+2200 Mathematical Operators 100% (256/256) 39% (100/256) 58% (151/256) -U+2300 Miscellaneous Technical 27% (64/232) 6% (16/232) 50% (117/232) -U+2400 Control Pictures 5% (2/39) 2% (1/39) 2% (1/39) -U+2440 Optical Character Recognition (0/11) (0/11) (0/11) -U+2460 Enclosed Alphanumerics 6% (10/160) (0/160) (0/160) -U+2500 Box Drawing 100% (128/128) 100% (128/128) 100% (128/128) -U+2580 Block Elements 100% (32/32) 100% (32/32) 100% (32/32) -U+25a0 Geometric Shapes 100% (96/96) 100% (96/96) 100% (96/96) -U+2600 Miscellaneous Symbols 95% (182/191) 15% (30/191) 78% (149/191) -U+2700 Dingbats 100% (174/174) 0% (1/174) 82% (144/174) -U+27c0 Miscellaneous Mathematical Symbols-A 20% (9/44) 11% (5/44) 11% (5/44) -U+27f0 Supplemental Arrows-A 100% (16/16) 100% (16/16) (0/16) -U+2800 Braille Patterns 100% (256/256) 100% (256/256) (0/256) -U+2900 Supplemental Arrows-B 4% (6/128) 100% (128/128) (0/128) -U+2980 Miscellaneous Mathematical Symbols-B 10% (13/128) 0% (1/128) 2% (3/128) -U+2a00 Supplemental Mathematical Operators 28% (72/256) 1% (4/256) 0% (1/256) -U+2b00 Miscellaneous Symbols and Arrows 42% (35/82) 32% (27/82) 10% (9/82) -U+2c00 Glagolitic (0/94) (0/94) (0/94) -U+2c60 Latin Extended-C 96% (28/29) 55% (16/29) 34% (10/29) -U+2c80 Coptic (0/114) (0/114) (0/114) -U+2d00 Georgian Supplement (0/38) 100% (38/38) (0/38) -U+2d30 Tifinagh 100% (55/55) (0/55) (0/55) -U+2d80 Ethiopic Extended (0/79) (0/79) (0/79) -U+2de0 Cyrillic Extended-A (0/32) (0/32) (0/32) -U+2e00 Supplemental Punctuation 12% (6/49) 12% (6/49) 12% (6/49) -U+2e80 CJK Radicals Supplement (0/115) (0/115) (0/115) -U+2f00 Kangxi Radicals (0/214) (0/214) (0/214) -U+2ff0 Ideographic Description Characters (0/12) (0/12) (0/12) -U+3000 CJK Symbols and Punctuation (0/64) (0/64) (0/64) -U+3040 Hiragana (0/93) (0/93) (0/93) -U+30a0 Katakana (0/96) (0/96) (0/96) -U+3100 Bopomofo (0/41) (0/41) (0/41) -U+3130 Hangul Compatibility Jamo (0/94) (0/94) (0/94) -U+3190 Kanbun (0/16) (0/16) (0/16) -U+31a0 Bopomofo Extended (0/24) (0/24) (0/24) -U+31c0 CJK Strokes (0/36) (0/36) (0/36) -U+31f0 Katakana Phonetic Extensions (0/16) (0/16) (0/16) -U+3200 Enclosed CJK Letters and Months (0/242) (0/242) (0/242) -U+3300 CJK Compatibility (0/256) (0/256) (0/256) -U+3400 CJK Unified Ideographs Extension A (0/0) (0/0) (0/0) -U+4dc0 Yijing Hexagram Symbols 100% (64/64) (0/64) (0/64) -U+4e00 CJK Unified Ideographs (0/0) (0/0) (0/0) -U+a000 Yi Syllables (0/1165) (0/1165) (0/1165) -U+a490 Yi Radicals (0/55) (0/55) (0/55) -U+a500 Vai (0/300) (0/300) (0/300) -U+a640 Cyrillic Extended-B 39% (31/78) 12% (10/78) (0/78) -U+a700 Modifier Tone Letters 62% (20/32) 62% (20/32) 62% (20/32) -U+a720 Latin Extended-D 37% (43/114) 1% (2/114) 5% (6/114) -U+a800 Syloti Nagri (0/44) (0/44) (0/44) -U+a840 Phags-pa (0/56) (0/56) (0/56) -U+a880 Saurashtra (0/81) (0/81) (0/81) -U+a900 Kayah Li (0/48) (0/48) (0/48) -U+a930 Rejang (0/37) (0/37) (0/37) -U+aa00 Cham (0/83) (0/83) (0/83) -U+ac00 Hangul Syllables (0/0) (0/0) (0/0) -U+d800 High Surrogates (0/0) (0/0) (0/0) -U+db80 High Private Use Surrogates (0/0) (0/0) (0/0) -U+dc00 Low Surrogates (0/0) (0/0) (0/0) -U+e000 Private Use Area (0/0) (0/0) (0/0) -U+f900 CJK Compatibility Ideographs (0/467) (0/467) (0/467) -U+fb00 Alphabetic Presentation Forms 100% (58/58) 12% (7/58) 3% (2/58) -U+fb50 Arabic Presentation Forms-A 11% (70/595) (0/595) 12% (72/595) -U+fe00 Variation Selectors 100% (16/16) 100% (16/16) (0/16) -U+fe10 Vertical Forms (0/10) (0/10) (0/10) -U+fe20 Combining Half Marks 57% (4/7) (0/7) (0/7) -U+fe30 CJK Compatibility Forms (0/32) (0/32) (0/32) -U+fe50 Small Form Variants (0/26) (0/26) (0/26) -U+fe70 Arabic Presentation Forms-B 100% (141/141) (0/141) 100% (141/141) -U+ff00 Halfwidth and Fullwidth Forms (0/225) (0/225) (0/225) -U+fff0 Specials 100% (5/5) 100% (5/5) 100% (5/5) -U+10000 Linear B Syllabary (0/88) (0/88) (0/88) -U+10080 Linear B Ideograms (0/123) (0/123) (0/123) -U+10100 Aegean Numbers (0/57) (0/57) (0/57) -U+10140 Ancient Greek Numbers (0/75) (0/75) (0/75) -U+10190 Ancient Symbols (0/12) (0/12) (0/12) -U+101d0 Phaistos Disc (0/46) (0/46) (0/46) -U+10280 Lycian (0/29) (0/29) (0/29) -U+102a0 Carian (0/49) (0/49) (0/49) -U+10300 Old Italic (0/35) (0/35) (0/35) -U+10330 Gothic (0/27) (0/27) (0/27) -U+10380 Ugaritic (0/31) (0/31) (0/31) -U+103a0 Old Persian (0/50) (0/50) (0/50) -U+10400 Deseret (0/80) (0/80) (0/80) -U+10450 Shavian (0/48) (0/48) (0/48) -U+10480 Osmanya (0/40) (0/40) (0/40) -U+10800 Cypriot Syllabary (0/55) (0/55) (0/55) -U+10900 Phoenician (0/27) (0/27) (0/27) -U+10920 Lydian (0/27) (0/27) (0/27) -U+10a00 Kharoshthi (0/65) (0/65) (0/65) -U+12000 Cuneiform (0/879) (0/879) (0/879) -U+12400 Cuneiform Numbers and Punctuation (0/103) (0/103) (0/103) -U+1d000 Byzantine Musical Symbols (0/246) (0/246) (0/246) -U+1d100 Musical Symbols (0/220) (0/220) (0/220) -U+1d200 Ancient Greek Musical Notation (0/70) (0/70) (0/70) -U+1d300 Tai Xuan Jing Symbols 100% (87/87) (0/87) (0/87) -U+1d360 Counting Rod Numerals (0/18) (0/18) (0/18) -U+1d400 Mathematical Alphanumeric Symbols 11% (117/996) 5% (55/996) 6% (62/996) -U+1f000 Mahjong Tiles (0/44) (0/44) (0/44) -U+1f030 Domino Tiles (0/100) (0/100) (0/100) -U+20000 CJK Unified Ideographs Extension B (0/0) (0/0) (0/0) -U+2f800 CJK Compatibility Ideographs Supplement (0/542) (0/542) (0/542) -U+e0000 Tags (0/98) (0/98) (0/98) -U+e0100 Variation Selectors Supplement (0/240) (0/240) (0/240) -U+f0000 Supplementary Private Use Area-A (0/0) (0/0) (0/0) -U+100000 Supplementary Private Use Area-B (0/0) (0/0) (0/0) diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.ctg.z deleted file mode 100644 index 3170ea6f2e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.php deleted file mode 100644 index 872dd9428e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.php +++ /dev/null @@ -1,517 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSans'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>30,'Flags'=>96,'FontBBox'=>'[-1021 -350 1681 1167]','ItalicAngle'=>20.8,'StemV'=>70,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>318,33=>401,34=>460,35=>838,36=>636,37=>950,38=>780,39=>275,40=>390, -41=>390,42=>500,43=>838,44=>318,45=>361,46=>318,47=>337,48=>636,49=>636,50=>636, -51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838, -61=>838,62=>838,63=>531,64=>1000,65=>684,66=>686,67=>698,68=>770,69=>632,70=>575, -71=>775,72=>752,73=>295,74=>295,75=>656,76=>557,77=>863,78=>748,79=>787,80=>603, -81=>787,82=>695,83=>635,84=>611,85=>732,86=>684,87=>989,88=>685,89=>611,90=>685, -91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>613,98=>635,99=>550,100=>635, -101=>615,102=>352,103=>635,104=>634,105=>278,106=>278,107=>579,108=>278,109=>974,110=>634, -111=>612,112=>635,113=>635,114=>411,115=>521,116=>392,117=>634,118=>592,119=>818,120=>592, -121=>592,122=>525,123=>636,124=>337,125=>636,126=>838,8364=>636,8218=>318,402=>352,8222=>518, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1342,352=>635,8249=>400,338=>1070,381=>685,8216=>318, -8217=>318,8220=>518,8221=>518,8226=>590,8211=>500,8212=>1000,732=>500,8482=>1000,353=>521,8250=>400, -339=>1023,382=>525,376=>611,160=>318,161=>401,162=>636,163=>636,164=>636,165=>636,166=>337, -167=>500,168=>500,169=>1000,170=>471,171=>612,172=>838,173=>361,174=>1000,175=>500,176=>500, -177=>838,178=>401,179=>401,180=>500,181=>636,182=>636,183=>318,184=>500,185=>401,186=>471, -187=>612,188=>969,189=>969,190=>969,191=>531,192=>684,193=>684,194=>684,195=>684,196=>684, -197=>684,198=>974,199=>698,200=>632,201=>632,202=>632,203=>632,204=>295,205=>295,206=>295, -207=>295,208=>775,209=>748,210=>787,211=>787,212=>787,213=>787,214=>787,215=>838,216=>787, -217=>732,218=>732,219=>732,220=>732,221=>611,222=>605,223=>630,224=>613,225=>613,226=>613, -227=>613,228=>613,229=>613,230=>982,231=>550,232=>615,233=>615,234=>615,235=>615,236=>278, -237=>278,238=>278,239=>278,240=>612,241=>634,242=>612,243=>612,244=>612,245=>612,246=>612, -247=>838,248=>612,249=>634,250=>634,251=>634,252=>634,253=>592,254=>635,255=>592,256=>684, -257=>613,258=>684,259=>613,260=>684,261=>613,262=>698,263=>550,264=>698,265=>550,266=>698, -267=>550,268=>698,269=>550,270=>770,271=>635,272=>775,273=>635,274=>632,275=>615,276=>632, -277=>615,278=>632,279=>615,280=>632,281=>615,282=>632,283=>615,284=>775,285=>635,286=>775, -287=>635,288=>775,289=>635,290=>775,291=>635,292=>752,293=>634,294=>916,295=>695,296=>295, -297=>278,298=>295,299=>278,300=>295,301=>278,302=>295,303=>278,304=>295,305=>278,306=>590, -307=>556,308=>295,309=>278,310=>656,311=>579,312=>579,313=>557,314=>278,315=>557,316=>278, -317=>557,318=>375,319=>557,320=>342,321=>562,322=>284,323=>748,324=>634,325=>748,326=>634, -327=>748,328=>634,329=>813,330=>748,331=>634,332=>787,333=>612,334=>787,335=>612,336=>787, -337=>612,340=>695,341=>411,342=>695,343=>411,344=>695,345=>411,346=>635,347=>521,348=>635, -349=>521,350=>635,351=>521,354=>611,355=>392,356=>611,357=>392,358=>611,359=>392,360=>732, -361=>634,362=>732,363=>634,364=>732,365=>634,366=>732,367=>634,368=>732,369=>634,370=>732, -371=>634,372=>989,373=>818,374=>611,375=>592,377=>685,378=>525,379=>685,380=>525,383=>352, -384=>635,385=>735,386=>686,387=>635,388=>686,389=>635,390=>703,391=>698,392=>550,393=>775, -394=>819,395=>686,396=>635,397=>612,398=>632,399=>787,400=>614,401=>575,403=>775,404=>687, -405=>984,406=>354,407=>295,408=>746,409=>579,410=>278,411=>592,412=>974,413=>748,414=>634, -415=>787,416=>913,417=>612,418=>949,419=>759,420=>652,421=>635,422=>695,423=>635,424=>521, -425=>632,426=>336,427=>392,428=>611,429=>392,430=>611,431=>858,432=>634,433=>764,434=>721, -435=>744,436=>730,437=>685,438=>525,439=>666,440=>666,441=>578,442=>525,443=>636,444=>666, -445=>578,446=>510,447=>635,448=>295,449=>492,450=>459,451=>295,452=>1422,453=>1299,454=>1154, -455=>835,456=>787,457=>457,458=>931,459=>924,460=>797,461=>684,462=>613,463=>295,464=>278, -465=>787,466=>612,467=>732,468=>634,469=>732,470=>634,471=>732,472=>634,473=>732,474=>634, -475=>732,476=>634,477=>615,478=>684,479=>613,480=>684,481=>613,482=>974,483=>982,484=>775, -485=>635,486=>775,487=>635,488=>656,489=>579,490=>787,491=>612,492=>787,493=>612,494=>666, -495=>578,496=>278,497=>1422,498=>1299,499=>1154,500=>775,501=>635,502=>1113,503=>682,504=>748, -505=>634,506=>684,507=>613,508=>974,509=>982,510=>787,511=>612,512=>684,513=>613,514=>684, -515=>613,516=>632,517=>615,518=>632,519=>615,520=>295,521=>278,522=>295,523=>278,524=>787, -525=>612,526=>787,527=>612,528=>695,529=>411,530=>695,531=>411,532=>732,533=>634,534=>732, -535=>634,536=>635,537=>521,538=>611,539=>392,540=>627,541=>521,542=>752,543=>634,544=>735, -545=>838,546=>698,547=>610,548=>685,549=>525,550=>684,551=>613,552=>632,553=>615,554=>787, -555=>612,556=>787,557=>612,558=>787,559=>612,560=>787,561=>612,562=>611,563=>592,564=>475, -565=>843,566=>477,567=>278,568=>998,569=>998,570=>684,571=>698,572=>550,573=>557,574=>611, -575=>521,576=>525,577=>603,578=>479,579=>686,580=>732,581=>684,582=>632,583=>615,584=>295, -585=>278,586=>781,587=>635,588=>695,589=>411,590=>611,591=>592,592=>600,593=>635,594=>635, -595=>635,596=>549,597=>550,598=>635,599=>696,600=>615,601=>615,602=>819,603=>541,604=>532, -605=>775,606=>664,607=>278,608=>696,609=>635,610=>629,611=>596,612=>596,613=>634,614=>634, -615=>634,616=>278,617=>338,618=>372,619=>396,620=>487,621=>278,622=>706,623=>974,624=>974, -625=>974,626=>646,627=>642,628=>634,629=>612,630=>858,631=>728,632=>660,633=>414,634=>414, -635=>414,636=>411,637=>411,638=>530,639=>530,640=>604,641=>604,642=>521,643=>336,644=>336, -645=>461,646=>336,647=>392,648=>392,649=>634,650=>618,651=>598,652=>592,653=>818,654=>592, -655=>611,656=>525,657=>525,658=>578,659=>578,660=>510,661=>510,662=>510,663=>510,664=>787, -665=>580,666=>664,667=>708,668=>654,669=>292,670=>667,671=>507,672=>727,673=>510,674=>510, -675=>1014,676=>1058,677=>1013,678=>824,679=>610,680=>778,681=>848,682=>641,683=>654,684=>515, -685=>515,686=>661,687=>664,688=>404,689=>399,690=>175,691=>259,692=>295,693=>296,694=>379, -695=>515,696=>373,697=>278,698=>460,699=>318,700=>318,701=>318,702=>307,703=>307,704=>370, -705=>370,706=>500,707=>500,708=>500,709=>500,711=>500,712=>275,713=>500,714=>500,715=>500, -716=>275,717=>500,718=>500,719=>500,720=>337,721=>337,722=>307,723=>307,724=>500,725=>500, -726=>390,727=>317,728=>500,729=>500,730=>500,731=>500,733=>500,734=>315,735=>500,736=>426, -737=>166,738=>373,739=>444,740=>370,741=>493,742=>493,743=>493,744=>493,745=>493,748=>500, -749=>500,750=>518,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>654,881=>568,882=>862, -883=>647,884=>278,885=>278,886=>748,887=>650,890=>500,891=>549,892=>550,893=>549,894=>337, -900=>500,901=>500,902=>692,903=>318,904=>746,905=>871,906=>408,908=>813,910=>825,911=>826, -912=>338,913=>684,914=>686,915=>557,916=>684,917=>632,918=>685,919=>752,920=>787,921=>295, -922=>656,923=>684,924=>863,925=>748,926=>632,927=>787,928=>752,929=>603,931=>632,932=>611, -933=>611,934=>787,935=>685,936=>787,937=>764,938=>295,939=>611,940=>659,941=>541,942=>634, -943=>338,944=>579,945=>659,946=>638,947=>592,948=>612,949=>541,950=>544,951=>634,952=>612, -953=>338,954=>589,955=>592,956=>636,957=>559,958=>558,959=>612,960=>602,961=>635,962=>587, -963=>634,964=>602,965=>579,966=>660,967=>578,968=>660,969=>837,970=>338,971=>579,972=>612, -973=>579,974=>837,975=>656,976=>614,977=>619,978=>699,979=>842,980=>699,981=>660,982=>837, -983=>664,984=>787,985=>612,986=>648,987=>587,988=>575,989=>458,990=>660,991=>660,992=>865, -993=>627,994=>934,995=>837,996=>758,997=>659,998=>792,999=>615,1000=>687,1001=>607,1002=>768, -1003=>625,1004=>699,1005=>612,1006=>611,1007=>536,1008=>664,1009=>635,1010=>550,1011=>278,1012=>787, -1013=>615,1014=>615,1015=>605,1016=>635,1017=>698,1018=>863,1019=>651,1020=>635,1021=>703,1022=>698, -1023=>703,1024=>632,1025=>632,1026=>786,1027=>610,1028=>698,1029=>635,1030=>295,1031=>295,1032=>295, -1033=>1094,1034=>1045,1035=>786,1036=>710,1037=>748,1038=>609,1039=>752,1040=>684,1041=>686,1042=>686, -1043=>610,1044=>781,1045=>632,1046=>1077,1047=>641,1048=>748,1049=>748,1050=>710,1051=>752,1052=>863, -1053=>752,1054=>787,1055=>752,1056=>603,1057=>698,1058=>611,1059=>609,1060=>861,1061=>685,1062=>776, -1063=>686,1064=>1069,1065=>1094,1066=>833,1067=>882,1068=>686,1069=>698,1070=>1080,1071=>695,1072=>613, -1073=>617,1074=>589,1075=>525,1076=>691,1077=>615,1078=>901,1079=>532,1080=>650,1081=>650,1082=>604, -1083=>639,1084=>754,1085=>654,1086=>612,1087=>654,1088=>635,1089=>550,1090=>583,1091=>592,1092=>855, -1093=>592,1094=>681,1095=>591,1096=>915,1097=>942,1098=>707,1099=>790,1100=>589,1101=>549,1102=>842, -1103=>602,1104=>615,1105=>615,1106=>625,1107=>525,1108=>549,1109=>521,1110=>278,1111=>278,1112=>278, -1113=>902,1114=>898,1115=>652,1116=>604,1117=>650,1118=>592,1119=>654,1120=>934,1121=>837,1122=>771, -1123=>672,1124=>942,1125=>749,1126=>879,1127=>783,1128=>1160,1129=>1001,1130=>787,1131=>612,1132=>1027, -1133=>824,1134=>636,1135=>541,1136=>856,1137=>876,1138=>787,1139=>612,1140=>781,1141=>665,1142=>781, -1143=>665,1144=>992,1145=>904,1146=>953,1147=>758,1148=>1180,1149=>1028,1150=>934,1151=>837,1152=>698, -1153=>550,1154=>502,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>772, -1163=>677,1164=>686,1165=>589,1166=>603,1167=>635,1168=>610,1169=>525,1170=>675,1171=>590,1172=>624, -1173=>530,1174=>1077,1175=>901,1176=>641,1177=>532,1178=>710,1179=>604,1180=>710,1181=>604,1182=>710, -1183=>604,1184=>856,1185=>832,1186=>752,1187=>661,1188=>1014,1189=>877,1190=>1081,1191=>916,1192=>878, -1193=>693,1194=>698,1195=>550,1196=>611,1197=>583,1198=>611,1199=>592,1200=>611,1201=>592,1202=>685, -1203=>592,1204=>934,1205=>807,1206=>686,1207=>591,1208=>686,1209=>591,1210=>686,1211=>634,1212=>941, -1213=>728,1214=>941,1215=>728,1216=>295,1217=>1077,1218=>901,1219=>656,1220=>604,1221=>776,1222=>670, -1223=>752,1224=>661,1225=>776,1226=>681,1227=>686,1228=>591,1229=>888,1230=>774,1231=>278,1232=>684, -1233=>613,1234=>684,1235=>613,1236=>974,1237=>982,1238=>632,1239=>615,1240=>787,1241=>615,1242=>787, -1243=>615,1244=>1077,1245=>901,1246=>641,1247=>532,1248=>666,1249=>578,1250=>748,1251=>650,1252=>748, -1253=>650,1254=>787,1255=>612,1256=>787,1257=>612,1258=>787,1259=>612,1260=>698,1261=>549,1262=>609, -1263=>592,1264=>609,1265=>592,1266=>609,1267=>592,1268=>686,1269=>591,1270=>610,1271=>525,1272=>882, -1273=>790,1274=>675,1275=>590,1276=>685,1277=>592,1278=>685,1279=>592,1280=>686,1281=>589,1282=>1006, -1283=>897,1284=>975,1285=>869,1286=>679,1287=>588,1288=>1072,1289=>957,1290=>1113,1291=>967,1292=>775, -1293=>660,1294=>773,1295=>711,1296=>614,1297=>541,1298=>752,1299=>639,1300=>1169,1301=>994,1302=>894, -1303=>864,1304=>1032,1305=>986,1306=>787,1307=>635,1308=>989,1309=>818,1312=>1081,1313=>905,1314=>1081, -1315=>912,1316=>793,1317=>683,1329=>867,1330=>732,1331=>882,1332=>882,1333=>732,1334=>644,1335=>682, -1336=>732,1337=>851,1338=>882,1339=>732,1340=>557,1341=>824,1342=>986,1343=>732,1344=>707,1345=>644, -1346=>882,1347=>777,1348=>882,1349=>732,1350=>840,1351=>732,1352=>732,1353=>732,1354=>791,1355=>644, -1356=>882,1357=>732,1358=>882,1359=>635,1360=>732,1361=>732,1362=>799,1363=>787,1364=>790,1365=>787, -1366=>635,1369=>307,1370=>318,1371=>500,1372=>500,1373=>392,1374=>526,1375=>500,1377=>974,1378=>634, -1379=>762,1380=>767,1381=>634,1382=>697,1383=>533,1384=>634,1385=>700,1386=>697,1387=>634,1388=>404, -1389=>894,1390=>641,1391=>634,1392=>634,1393=>635,1394=>702,1395=>634,1396=>659,1397=>278,1398=>760, -1399=>516,1400=>634,1401=>453,1402=>974,1403=>516,1404=>769,1405=>634,1406=>696,1407=>974,1408=>634, -1409=>635,1410=>501,1411=>974,1412=>648,1413=>612,1414=>629,1415=>763,1417=>337,1418=>433,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>361,1471=>0,1472=>295,1473=>0,1474=>0,1475=>295,1478=>441, -1479=>0,1488=>629,1489=>608,1490=>448,1491=>594,1492=>640,1493=>272,1494=>374,1495=>640,1496=>648, -1497=>272,1498=>592,1499=>556,1500=>599,1501=>640,1502=>659,1503=>272,1504=>441,1505=>700,1506=>563, -1507=>640,1508=>604,1509=>521,1510=>581,1511=>663,1512=>592,1513=>808,1514=>657,1520=>471,1521=>454, -1522=>471,1523=>416,1524=>645,1542=>637,1543=>637,1545=>757,1546=>977,1548=>323,1557=>0,1563=>318, -1567=>531,1569=>470,1570=>278,1571=>278,1572=>483,1573=>278,1574=>783,1575=>278,1576=>941,1577=>524, -1578=>941,1579=>941,1580=>646,1581=>646,1582=>646,1583=>445,1584=>445,1585=>483,1586=>483,1587=>1221, -1588=>1221,1589=>1209,1590=>1209,1591=>925,1592=>925,1593=>597,1594=>597,1600=>293,1601=>1037,1602=>776, -1603=>824,1604=>727,1605=>619,1606=>734,1607=>524,1608=>483,1609=>783,1610=>783,1611=>0,1612=>0, -1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1626=>500, -1632=>537,1633=>537,1634=>537,1635=>537,1636=>537,1637=>537,1638=>537,1639=>537,1640=>537,1641=>537, -1642=>537,1643=>325,1644=>318,1645=>545,1646=>941,1647=>776,1652=>292,1657=>941,1658=>941,1659=>941, -1660=>941,1661=>941,1662=>941,1663=>941,1664=>941,1665=>646,1666=>646,1667=>646,1668=>646,1669=>646, -1670=>646,1671=>646,1681=>483,1682=>483,1685=>610,1688=>483,1697=>1037,1700=>1037,1702=>1037,1705=>895, -1711=>895,1717=>727,1722=>734,1727=>646,1734=>483,1740=>783,1742=>783,1749=>524,1776=>537,1777=>537, -1778=>537,1779=>537,1780=>537,1781=>537,1782=>537,1783=>537,1784=>537,1785=>537,1984=>636,1985=>636, -1986=>636,1987=>636,1988=>636,1989=>636,1990=>636,1991=>636,1992=>636,1993=>636,1994=>278,1995=>571, -1996=>424,1997=>592,1998=>654,1999=>654,2000=>594,2001=>654,2002=>829,2003=>438,2004=>438,2005=>559, -2006=>612,2007=>350,2008=>959,2009=>473,2010=>783,2011=>654,2012=>625,2013=>734,2014=>530,2015=>724, -2016=>473,2017=>625,2018=>594,2019=>530,2020=>530,2021=>522,2022=>594,2023=>594,2027=>0,2028=>0, -2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>313,2037=>313,2040=>560, -2041=>560,2042=>361,3647=>652,3713=>670,3714=>684,3716=>688,3719=>482,3720=>628,3722=>684,3725=>688, -3732=>669,3733=>642,3734=>645,3735=>655,3737=>659,3738=>625,3739=>625,3740=>745,3741=>767,3742=>687, -3743=>687,3745=>702,3746=>688,3747=>684,3749=>649,3751=>632,3754=>703,3755=>819,3757=>633,3758=>684, -3759=>788,3760=>632,3761=>0,3762=>539,3763=>539,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0, -3769=>0,3771=>0,3772=>0,3773=>663,3776=>375,3777=>657,3778=>460,3779=>547,3780=>491,3782=>674, -3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>636,3793=>641,3794=>641,3795=>670, -3796=>625,3797=>625,3798=>703,3799=>670,3800=>674,3801=>677,3804=>1028,3805=>1028,4256=>840,4257=>690, -4258=>642,4259=>759,4260=>591,4261=>686,4262=>789,4263=>811,4264=>467,4265=>565,4266=>789,4267=>793, -4268=>584,4269=>837,4270=>750,4271=>688,4272=>811,4273=>584,4274=>584,4275=>837,4276=>837,4277=>646, -4278=>604,4279=>584,4280=>596,4281=>584,4282=>721,4283=>795,4284=>584,4285=>566,4286=>584,4287=>669, -4288=>799,4289=>542,4290=>664,4291=>542,4292=>565,4293=>674,4304=>508,4305=>508,4306=>533,4307=>785, -4308=>522,4309=>517,4310=>508,4311=>797,4312=>507,4313=>518,4314=>1058,4315=>522,4316=>523,4317=>783, -4318=>518,4319=>523,4320=>792,4321=>523,4322=>656,4323=>524,4324=>788,4325=>523,4326=>782,4327=>523, -4328=>522,4329=>522,4330=>566,4331=>523,4332=>523,4333=>489,4334=>522,4335=>498,4336=>517,4337=>560, -4338=>508,4339=>508,4340=>508,4341=>563,4342=>824,4343=>595,4344=>522,4345=>554,4346=>553,4347=>586, -4348=>304,5121=>684,5122=>684,5123=>684,5124=>684,5125=>769,5126=>769,5127=>769,5129=>769,5130=>769, -5131=>769,5132=>835,5133=>834,5134=>835,5135=>834,5136=>835,5137=>834,5138=>967,5139=>1007,5140=>967, -5141=>1007,5142=>769,5143=>967,5144=>1007,5145=>967,5146=>1007,5147=>769,5149=>256,5150=>543,5151=>423, -5152=>423,5153=>389,5154=>389,5155=>393,5156=>389,5157=>466,5158=>385,5159=>256,5160=>389,5161=>389, -5162=>389,5163=>1090,5164=>909,5165=>953,5166=>1117,5167=>684,5168=>684,5169=>684,5170=>684,5171=>729, -5172=>729,5173=>729,5175=>729,5176=>729,5177=>729,5178=>835,5179=>684,5180=>835,5181=>834,5182=>835, -5183=>834,5184=>967,5185=>1007,5186=>967,5187=>1007,5188=>967,5189=>1007,5190=>967,5191=>1007,5192=>729, -5193=>508,5194=>192,5196=>732,5197=>732,5198=>732,5199=>732,5200=>730,5201=>730,5202=>730,5204=>730, -5205=>730,5206=>730,5207=>921,5208=>889,5209=>921,5210=>889,5211=>921,5212=>889,5213=>928,5214=>900, -5215=>928,5216=>900,5217=>947,5218=>900,5219=>947,5220=>900,5221=>947,5222=>434,5223=>877,5224=>877, -5225=>866,5226=>890,5227=>628,5228=>628,5229=>628,5230=>628,5231=>628,5232=>628,5233=>628,5234=>628, -5235=>628,5236=>860,5237=>771,5238=>815,5239=>816,5240=>815,5241=>816,5242=>860,5243=>771,5244=>860, -5245=>771,5246=>815,5247=>816,5248=>815,5249=>816,5250=>815,5251=>407,5252=>407,5253=>750,5254=>775, -5255=>750,5256=>775,5257=>628,5258=>628,5259=>628,5260=>628,5261=>628,5262=>628,5263=>628,5264=>628, -5265=>628,5266=>860,5267=>771,5268=>815,5269=>816,5270=>815,5271=>816,5272=>860,5273=>771,5274=>860, -5275=>771,5276=>815,5277=>816,5278=>815,5279=>816,5280=>815,5281=>435,5282=>435,5283=>610,5284=>557, -5285=>557,5286=>557,5287=>610,5288=>610,5289=>610,5290=>557,5291=>557,5292=>749,5293=>769,5294=>746, -5295=>764,5296=>746,5297=>764,5298=>749,5299=>769,5300=>749,5301=>769,5302=>746,5303=>764,5304=>746, -5305=>764,5306=>746,5307=>386,5308=>508,5309=>386,5312=>852,5313=>852,5314=>852,5315=>852,5316=>852, -5317=>852,5318=>852,5319=>852,5320=>852,5321=>1069,5322=>1035,5323=>1059,5324=>852,5325=>1059,5326=>852, -5327=>852,5328=>600,5329=>453,5330=>600,5331=>852,5332=>852,5333=>852,5334=>852,5335=>852,5336=>852, -5337=>852,5338=>852,5339=>852,5340=>1069,5341=>1035,5342=>1059,5343=>1030,5344=>1059,5345=>1030,5346=>1069, -5347=>1035,5348=>1069,5349=>1035,5350=>1083,5351=>1030,5352=>1083,5353=>1030,5354=>600,5356=>729,5357=>603, -5358=>603,5359=>603,5360=>603,5361=>603,5362=>603,5363=>603,5364=>603,5365=>603,5366=>834,5367=>754, -5368=>792,5369=>771,5370=>792,5371=>771,5372=>834,5373=>754,5374=>834,5375=>754,5376=>792,5377=>771, -5378=>792,5379=>771,5380=>792,5381=>418,5382=>420,5383=>418,5392=>712,5393=>712,5394=>712,5395=>892, -5396=>892,5397=>892,5398=>892,5399=>910,5400=>872,5401=>910,5402=>872,5403=>910,5404=>872,5405=>1140, -5406=>1100,5407=>1140,5408=>1100,5409=>1140,5410=>1100,5411=>1140,5412=>1100,5413=>641,5414=>627,5415=>627, -5416=>627,5417=>627,5418=>627,5419=>627,5420=>627,5421=>627,5422=>627,5423=>844,5424=>781,5425=>816, -5426=>818,5427=>816,5428=>818,5429=>844,5430=>781,5431=>844,5432=>781,5433=>816,5434=>818,5435=>816, -5436=>818,5437=>816,5438=>418,5440=>389,5441=>484,5442=>916,5443=>916,5444=>916,5445=>916,5446=>916, -5447=>916,5448=>603,5449=>603,5450=>603,5451=>603,5452=>603,5453=>603,5454=>834,5455=>754,5456=>418, -5458=>729,5459=>684,5460=>684,5461=>684,5462=>684,5463=>726,5464=>726,5465=>726,5466=>726,5467=>924, -5468=>1007,5469=>508,5470=>732,5471=>732,5472=>732,5473=>732,5474=>732,5475=>732,5476=>730,5477=>730, -5478=>730,5479=>730,5480=>947,5481=>900,5482=>508,5492=>831,5493=>831,5494=>831,5495=>831,5496=>831, -5497=>831,5498=>831,5499=>563,5500=>752,5501=>484,5502=>1047,5503=>1047,5504=>1047,5505=>1047,5506=>1047, -5507=>1047,5508=>1047,5509=>825,5514=>831,5515=>831,5516=>831,5517=>831,5518=>1259,5519=>1259,5520=>1259, -5521=>1002,5522=>1002,5523=>1259,5524=>1259,5525=>700,5526=>1073,5536=>852,5537=>852,5538=>852,5539=>852, -5540=>852,5541=>852,5542=>600,5543=>643,5544=>643,5545=>643,5546=>643,5547=>643,5548=>643,5549=>643, -5550=>418,5551=>628,5598=>770,5601=>767,5702=>468,5703=>468,5742=>444,5743=>1047,5744=>1310,5745=>1632, -5746=>1632,5747=>1375,5748=>1375,5749=>1632,5750=>1632,5760=>477,5761=>493,5762=>712,5763=>931,5764=>1150, -5765=>1370,5766=>493,5767=>712,5768=>931,5769=>1150,5770=>1370,5771=>498,5772=>718,5773=>938,5774=>1159, -5775=>1379,5776=>493,5777=>712,5778=>930,5779=>1149,5780=>1370,5781=>498,5782=>752,5783=>789,5784=>1205, -5785=>1150,5786=>683,5787=>507,5788=>507,7424=>592,7425=>717,7426=>982,7427=>586,7428=>550,7429=>605, -7430=>605,7431=>491,7432=>541,7433=>278,7434=>395,7435=>579,7436=>583,7437=>754,7438=>650,7439=>612, -7440=>550,7441=>684,7442=>684,7443=>684,7444=>1023,7446=>612,7447=>612,7448=>524,7449=>602,7450=>602, -7451=>583,7452=>574,7453=>737,7454=>948,7455=>638,7456=>592,7457=>818,7458=>525,7459=>526,7462=>583, -7463=>592,7464=>564,7465=>524,7466=>590,7467=>639,7468=>431,7469=>613,7470=>432,7472=>485,7473=>398, -7474=>398,7475=>488,7476=>474,7477=>186,7478=>186,7479=>413,7480=>351,7481=>543,7482=>471,7483=>471, -7484=>496,7485=>439,7486=>380,7487=>438,7488=>385,7489=>461,7490=>623,7491=>392,7492=>392,7493=>405, -7494=>648,7495=>428,7496=>405,7497=>417,7498=>417,7499=>360,7500=>359,7501=>405,7502=>179,7503=>426, -7504=>623,7505=>409,7506=>414,7507=>370,7508=>414,7509=>414,7510=>428,7511=>295,7512=>405,7513=>470, -7514=>623,7515=>417,7517=>402,7518=>373,7519=>385,7520=>416,7521=>364,7522=>179,7523=>259,7524=>405, -7525=>417,7526=>402,7527=>373,7528=>412,7529=>416,7530=>364,7543=>635,7544=>474,7547=>372,7557=>278, -7579=>405,7580=>370,7581=>370,7582=>414,7583=>360,7584=>296,7585=>233,7586=>405,7587=>405,7588=>261, -7589=>250,7590=>261,7591=>261,7592=>234,7593=>250,7594=>235,7595=>376,7596=>623,7597=>623,7598=>411, -7599=>479,7600=>409,7601=>414,7602=>414,7603=>360,7604=>287,7605=>295,7606=>508,7607=>418,7608=>361, -7609=>406,7610=>417,7611=>366,7612=>437,7613=>366,7614=>392,7615=>414,7620=>0,7621=>0,7622=>0, -7623=>0,7624=>0,7625=>0,7680=>684,7681=>613,7682=>686,7683=>635,7684=>686,7685=>635,7686=>686, -7687=>635,7688=>698,7689=>550,7690=>770,7691=>635,7692=>770,7693=>635,7694=>770,7695=>635,7696=>770, -7697=>635,7698=>770,7699=>635,7700=>632,7701=>615,7702=>632,7703=>615,7704=>632,7705=>615,7706=>632, -7707=>615,7708=>632,7709=>615,7710=>575,7711=>352,7712=>775,7713=>635,7714=>752,7715=>634,7716=>752, -7717=>634,7718=>752,7719=>634,7720=>752,7721=>634,7722=>752,7723=>634,7724=>295,7725=>278,7726=>295, -7727=>278,7728=>656,7729=>579,7730=>656,7731=>579,7732=>656,7733=>579,7734=>557,7735=>288,7736=>557, -7737=>288,7738=>557,7739=>278,7740=>557,7741=>278,7742=>863,7743=>974,7744=>863,7745=>974,7746=>863, -7747=>974,7748=>748,7749=>634,7750=>748,7751=>634,7752=>748,7753=>634,7754=>748,7755=>634,7756=>787, -7757=>612,7758=>787,7759=>612,7760=>787,7761=>612,7762=>787,7763=>612,7764=>603,7765=>635,7766=>603, -7767=>635,7768=>695,7769=>411,7770=>695,7771=>411,7772=>695,7773=>411,7774=>695,7775=>411,7776=>635, -7777=>521,7778=>635,7779=>521,7780=>635,7781=>521,7782=>635,7783=>521,7784=>635,7785=>521,7786=>611, -7787=>392,7788=>611,7789=>392,7790=>611,7791=>392,7792=>611,7793=>392,7794=>732,7795=>634,7796=>732, -7797=>634,7798=>732,7799=>634,7800=>732,7801=>634,7802=>732,7803=>634,7804=>684,7805=>592,7806=>684, -7807=>592,7808=>989,7809=>818,7810=>989,7811=>818,7812=>989,7813=>818,7814=>989,7815=>818,7816=>989, -7817=>818,7818=>685,7819=>592,7820=>685,7821=>592,7822=>611,7823=>592,7824=>685,7825=>525,7826=>685, -7827=>525,7828=>685,7829=>525,7830=>634,7831=>392,7832=>818,7833=>592,7834=>613,7835=>352,7838=>769, -7839=>612,7840=>684,7841=>613,7842=>684,7843=>613,7844=>684,7845=>613,7846=>684,7847=>613,7848=>684, -7849=>613,7850=>684,7851=>613,7852=>684,7853=>613,7854=>684,7855=>613,7856=>684,7857=>613,7858=>684, -7859=>613,7860=>684,7861=>613,7862=>684,7863=>613,7864=>632,7865=>615,7866=>632,7867=>615,7868=>632, -7869=>615,7870=>632,7871=>615,7872=>632,7873=>615,7874=>632,7875=>615,7876=>632,7877=>615,7878=>632, -7879=>615,7880=>295,7881=>278,7882=>295,7883=>278,7884=>787,7885=>612,7886=>787,7887=>612,7888=>787, -7889=>612,7890=>787,7891=>612,7892=>787,7893=>612,7894=>787,7895=>612,7896=>787,7897=>612,7898=>913, -7899=>612,7900=>913,7901=>612,7902=>913,7903=>612,7904=>913,7905=>612,7906=>913,7907=>612,7908=>732, -7909=>634,7910=>732,7911=>634,7912=>858,7913=>634,7914=>858,7915=>634,7916=>858,7917=>634,7918=>858, -7919=>634,7920=>858,7921=>634,7922=>611,7923=>592,7924=>611,7925=>592,7926=>611,7927=>592,7928=>611, -7929=>592,7936=>659,7937=>659,7938=>659,7939=>659,7940=>659,7941=>659,7942=>659,7943=>659,7944=>684, -7945=>684,7946=>877,7947=>877,7948=>769,7949=>801,7950=>708,7951=>743,7952=>541,7953=>541,7954=>541, -7955=>541,7956=>541,7957=>541,7960=>711,7961=>711,7962=>966,7963=>975,7964=>898,7965=>928,7968=>634, -7969=>634,7970=>634,7971=>634,7972=>634,7973=>634,7974=>634,7975=>634,7976=>837,7977=>835,7978=>1086, -7979=>1089,7980=>1027,7981=>1051,7982=>934,7983=>947,7984=>338,7985=>338,7986=>338,7987=>338,7988=>338, -7989=>338,7990=>338,7991=>338,7992=>380,7993=>374,7994=>635,7995=>635,7996=>570,7997=>600,7998=>489, -7999=>493,8000=>612,8001=>612,8002=>612,8003=>612,8004=>612,8005=>612,8008=>804,8009=>848,8010=>1095, -8011=>1100,8012=>938,8013=>970,8016=>579,8017=>579,8018=>579,8019=>579,8020=>579,8021=>579,8022=>579, -8023=>579,8025=>784,8027=>998,8029=>1012,8031=>897,8032=>837,8033=>837,8034=>837,8035=>837,8036=>837, -8037=>837,8038=>837,8039=>837,8040=>802,8041=>843,8042=>1089,8043=>1095,8044=>946,8045=>972,8046=>921, -8047=>952,8048=>659,8049=>659,8050=>541,8051=>548,8052=>634,8053=>654,8054=>338,8055=>338,8056=>612, -8057=>612,8058=>579,8059=>579,8060=>837,8061=>837,8064=>659,8065=>659,8066=>659,8067=>659,8068=>659, -8069=>659,8070=>659,8071=>659,8072=>684,8073=>684,8074=>877,8075=>877,8076=>769,8077=>801,8078=>708, -8079=>743,8080=>634,8081=>634,8082=>634,8083=>634,8084=>634,8085=>634,8086=>634,8087=>634,8088=>837, -8089=>835,8090=>1086,8091=>1089,8092=>1027,8093=>1051,8094=>934,8095=>947,8096=>837,8097=>837,8098=>837, -8099=>837,8100=>837,8101=>837,8102=>837,8103=>837,8104=>802,8105=>843,8106=>1089,8107=>1095,8108=>946, -8109=>972,8110=>921,8111=>952,8112=>659,8113=>659,8114=>659,8115=>659,8116=>659,8118=>659,8119=>659, -8120=>684,8121=>684,8122=>716,8123=>692,8124=>684,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500, -8130=>634,8131=>634,8132=>654,8134=>634,8135=>634,8136=>805,8137=>746,8138=>931,8139=>871,8140=>752, -8141=>500,8142=>500,8143=>500,8144=>338,8145=>338,8146=>338,8147=>338,8150=>338,8151=>338,8152=>295, -8153=>295,8154=>475,8155=>408,8157=>500,8158=>500,8159=>500,8160=>579,8161=>579,8162=>579,8163=>579, -8164=>635,8165=>635,8166=>579,8167=>579,8168=>611,8169=>611,8170=>845,8171=>825,8172=>685,8173=>500, -8174=>500,8175=>500,8178=>837,8179=>837,8180=>837,8182=>837,8183=>837,8184=>941,8185=>813,8186=>922, -8187=>826,8188=>764,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250, -8198=>167,8199=>636,8200=>318,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0, -8208=>361,8209=>361,8210=>636,8213=>1000,8214=>500,8215=>500,8219=>318,8223=>518,8227=>590,8228=>334, -8229=>667,8231=>318,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8241=>1735,8242=>227, -8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339,8251=>838,8252=>485,8253=>531,8254=>500, -8255=>804,8256=>804,8257=>250,8258=>1000,8259=>500,8260=>167,8261=>390,8262=>390,8263=>922,8264=>733, -8265=>733,8266=>497,8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8272=>804,8273=>500,8274=>450, -8275=>1000,8276=>804,8277=>838,8278=>586,8279=>663,8280=>838,8281=>838,8282=>318,8283=>797,8284=>838, -8285=>318,8286=>318,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0, -8300=>0,8301=>0,8302=>0,8303=>0,8304=>401,8305=>179,8308=>401,8309=>401,8310=>401,8311=>401, -8312=>401,8313=>401,8314=>528,8315=>528,8316=>528,8317=>246,8318=>246,8319=>398,8320=>401,8321=>401, -8322=>401,8323=>401,8324=>401,8325=>401,8326=>401,8327=>401,8328=>401,8329=>401,8330=>528,8331=>528, -8332=>528,8333=>246,8334=>246,8336=>392,8337=>417,8338=>414,8339=>444,8340=>417,8352=>877,8353=>636, -8354=>636,8355=>636,8356=>636,8357=>974,8358=>748,8359=>1272,8360=>1074,8361=>989,8362=>784,8363=>635, -8365=>636,8366=>636,8367=>1272,8368=>636,8369=>636,8370=>636,8371=>636,8372=>774,8373=>641,8400=>0, -8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1019,8449=>1019,8450=>698,8451=>1123, -8452=>642,8453=>1019,8454=>1067,8455=>614,8456=>698,8457=>952,8459=>988,8460=>754,8461=>850,8462=>634, -8463=>634,8464=>470,8465=>697,8466=>720,8467=>413,8468=>818,8469=>801,8470=>1040,8471=>1000,8472=>697, -8473=>701,8474=>787,8475=>798,8476=>814,8477=>792,8478=>896,8479=>684,8480=>1020,8481=>1074,8483=>684, -8484=>745,8485=>578,8486=>764,8487=>764,8488=>616,8489=>338,8490=>656,8491=>684,8492=>786,8493=>703, -8494=>854,8495=>592,8496=>605,8497=>786,8498=>575,8499=>1069,8500=>462,8501=>745,8502=>674,8503=>466, -8504=>645,8505=>380,8506=>926,8507=>1194,8508=>702,8509=>728,8510=>654,8511=>849,8512=>811,8513=>775, -8514=>557,8515=>557,8516=>611,8517=>819,8518=>708,8519=>615,8520=>351,8521=>351,8523=>780,8526=>526, -8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969,8537=>969,8538=>969,8539=>969,8540=>969, -8541=>969,8542=>969,8543=>568,8544=>295,8545=>492,8546=>689,8547=>923,8548=>684,8549=>922,8550=>1120, -8551=>1317,8552=>917,8553=>685,8554=>933,8555=>1131,8556=>557,8557=>698,8558=>770,8559=>863,8560=>278, -8561=>458,8562=>637,8563=>812,8564=>592,8565=>811,8566=>991,8567=>1170,8568=>819,8569=>592,8570=>822, -8571=>1002,8572=>278,8573=>550,8574=>635,8575=>974,8576=>1245,8577=>770,8578=>1245,8579=>703,8580=>549, -8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838, -8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838, -8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838, -8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838, -8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838, -8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838, -8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838, -8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838, -8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838, -8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838, -8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838, -8702=>838,8703=>838,8704=>684,8705=>636,8706=>517,8707=>632,8708=>632,8709=>871,8710=>669,8711=>669, -8712=>871,8713=>871,8714=>718,8715=>871,8716=>871,8717=>718,8718=>636,8719=>757,8720=>757,8721=>674, -8722=>838,8723=>838,8724=>838,8725=>337,8726=>637,8727=>838,8728=>626,8729=>626,8730=>637,8731=>637, -8732=>637,8733=>714,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500, -8742=>500,8743=>732,8744=>732,8745=>732,8746=>732,8747=>521,8748=>789,8749=>1057,8750=>521,8751=>789, -8752=>1057,8753=>521,8754=>521,8755=>521,8756=>636,8757=>636,8758=>260,8759=>636,8760=>838,8761=>838, -8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838, -8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838, -8782=>838,8783=>838,8784=>838,8785=>838,8786=>839,8787=>839,8788=>1000,8789=>1000,8790=>838,8791=>838, -8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838, -8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>838,8809=>838,8810=>1047,8811=>1047, -8812=>464,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838, -8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838, -8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838, -8842=>838,8843=>838,8844=>732,8845=>732,8846=>732,8847=>838,8848=>838,8849=>838,8850=>838,8851=>780, -8852=>780,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838, -8862=>838,8863=>838,8864=>838,8865=>838,8866=>871,8867=>871,8868=>871,8869=>871,8870=>521,8871=>521, -8872=>871,8873=>871,8874=>871,8875=>871,8876=>871,8877=>871,8878=>871,8879=>871,8880=>838,8881=>838, -8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>521,8891=>732, -8892=>732,8893=>732,8894=>838,8895=>838,8896=>820,8897=>820,8898=>820,8899=>820,8900=>494,8901=>318, -8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>732,8911=>732, -8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422, -8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838, -8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838, -8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1000,8947=>871,8948=>718,8949=>871,8950=>871,8951=>718, -8952=>871,8953=>871,8954=>1000,8955=>871,8956=>718,8957=>871,8958=>718,8959=>871,8960=>602,8961=>602, -8962=>635,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>390,8969=>390,8970=>390,8971=>390, -8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>513,8984=>1000,8985=>838,8988=>469,8989=>469, -8990=>469,8991=>469,8992=>521,8993=>521,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414, -9004=>873,9075=>338,9076=>635,9077=>837,9082=>659,9085=>757,9095=>1152,9108=>873,9115=>500,9116=>500, -9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500, -9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>521,9166=>838,9167=>945, -9187=>873,9189=>769,9250=>635,9251=>635,9312=>896,9313=>896,9314=>896,9315=>896,9316=>896,9317=>896, -9318=>896,9319=>896,9320=>896,9321=>896,9472=>602,9473=>602,9474=>602,9475=>602,9476=>602,9477=>602, -9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602,9486=>602,9487=>602, -9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602,9496=>602,9497=>602, -9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602,9506=>602,9507=>602, -9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602,9516=>602,9517=>602, -9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602,9526=>602,9527=>602, -9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602,9536=>602,9537=>602, -9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602,9546=>602,9547=>602, -9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602,9556=>602,9557=>602, -9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602,9566=>602,9567=>602, -9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602,9576=>602,9577=>602, -9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602,9586=>602,9587=>602, -9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602,9596=>602,9597=>602, -9598=>602,9599=>602,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769, -9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769, -9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769, -9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945, -9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550, -9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502, -9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502, -9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873, -9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527, -9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873,9697=>873, -9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945, -9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873, -9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769, -9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573,9736=>896,9737=>896, -9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896,9746=>896,9747=>532, -9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896,9756=>896,9757=>609, -9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746,9766=>649,9767=>784, -9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896,9776=>896,9777=>896, -9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>896,9786=>896,9787=>896, -9788=>896,9789=>896,9790=>896,9791=>614,9792=>731,9793=>731,9794=>896,9795=>896,9796=>896,9797=>896, -9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896,9806=>896,9807=>896, -9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896,9816=>896,9817=>896, -9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896,9826=>896,9827=>896, -9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472, -9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896,9846=>896,9847=>896, -9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896,9856=>869,9857=>869, -9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896,9866=>896,9867=>896, -9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896,9876=>896,9877=>541, -9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896,9889=>702,9890=>1003, -9891=>1085,9892=>1143,9893=>901,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838,9899=>838,9900=>838, -9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>731,9907=>732,9908=>732,9909=>732,9910=>850, -9911=>732,9912=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838,9992=>838,9993=>838, -9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838,10004=>838,10005=>838, -10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838,10014=>838,10015=>838, -10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838,10025=>838,10026=>838, -10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838,10035=>838,10036=>838, -10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838,10045=>838,10046=>838, -10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838,10055=>838,10056=>838, -10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896,10070=>896,10072=>838, -10073=>838,10074=>838,10075=>322,10076=>322,10077=>538,10078=>538,10081=>838,10082=>838,10083=>838,10084=>838, -10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838,10093=>838,10094=>838, -10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>896,10103=>896,10104=>896, -10105=>896,10106=>896,10107=>896,10108=>896,10109=>896,10110=>896,10111=>896,10112=>838,10113=>838,10114=>838, -10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838,10123=>838,10124=>838, -10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838,10136=>838,10137=>838, -10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838,10146=>838,10147=>838, -10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838,10156=>838,10157=>838, -10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838,10167=>838,10168=>838, -10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>390,10182=>390,10208=>494,10214=>495, -10215=>495,10216=>390,10217=>390,10218=>556,10219=>556,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1157, -10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434, -10239=>1434,10240=>732,10241=>732,10242=>732,10243=>732,10244=>732,10245=>732,10246=>732,10247=>732,10248=>732, -10249=>732,10250=>732,10251=>732,10252=>732,10253=>732,10254=>732,10255=>732,10256=>732,10257=>732,10258=>732, -10259=>732,10260=>732,10261=>732,10262=>732,10263=>732,10264=>732,10265=>732,10266=>732,10267=>732,10268=>732, -10269=>732,10270=>732,10271=>732,10272=>732,10273=>732,10274=>732,10275=>732,10276=>732,10277=>732,10278=>732, -10279=>732,10280=>732,10281=>732,10282=>732,10283=>732,10284=>732,10285=>732,10286=>732,10287=>732,10288=>732, -10289=>732,10290=>732,10291=>732,10292=>732,10293=>732,10294=>732,10295=>732,10296=>732,10297=>732,10298=>732, -10299=>732,10300=>732,10301=>732,10302=>732,10303=>732,10304=>732,10305=>732,10306=>732,10307=>732,10308=>732, -10309=>732,10310=>732,10311=>732,10312=>732,10313=>732,10314=>732,10315=>732,10316=>732,10317=>732,10318=>732, -10319=>732,10320=>732,10321=>732,10322=>732,10323=>732,10324=>732,10325=>732,10326=>732,10327=>732,10328=>732, -10329=>732,10330=>732,10331=>732,10332=>732,10333=>732,10334=>732,10335=>732,10336=>732,10337=>732,10338=>732, -10339=>732,10340=>732,10341=>732,10342=>732,10343=>732,10344=>732,10345=>732,10346=>732,10347=>732,10348=>732, -10349=>732,10350=>732,10351=>732,10352=>732,10353=>732,10354=>732,10355=>732,10356=>732,10357=>732,10358=>732, -10359=>732,10360=>732,10361=>732,10362=>732,10363=>732,10364=>732,10365=>732,10366=>732,10367=>732,10368=>732, -10369=>732,10370=>732,10371=>732,10372=>732,10373=>732,10374=>732,10375=>732,10376=>732,10377=>732,10378=>732, -10379=>732,10380=>732,10381=>732,10382=>732,10383=>732,10384=>732,10385=>732,10386=>732,10387=>732,10388=>732, -10389=>732,10390=>732,10391=>732,10392=>732,10393=>732,10394=>732,10395=>732,10396=>732,10397=>732,10398=>732, -10399=>732,10400=>732,10401=>732,10402=>732,10403=>732,10404=>732,10405=>732,10406=>732,10407=>732,10408=>732, -10409=>732,10410=>732,10411=>732,10412=>732,10413=>732,10414=>732,10415=>732,10416=>732,10417=>732,10418=>732, -10419=>732,10420=>732,10421=>732,10422=>732,10423=>732,10424=>732,10425=>732,10426=>732,10427=>732,10428=>732, -10429=>732,10430=>732,10431=>732,10432=>732,10433=>732,10434=>732,10435=>732,10436=>732,10437=>732,10438=>732, -10439=>732,10440=>732,10441=>732,10442=>732,10443=>732,10444=>732,10445=>732,10446=>732,10447=>732,10448=>732, -10449=>732,10450=>732,10451=>732,10452=>732,10453=>732,10454=>732,10455=>732,10456=>732,10457=>732,10458=>732, -10459=>732,10460=>732,10461=>732,10462=>732,10463=>732,10464=>732,10465=>732,10466=>732,10467=>732,10468=>732, -10469=>732,10470=>732,10471=>732,10472=>732,10473=>732,10474=>732,10475=>732,10476=>732,10477=>732,10478=>732, -10479=>732,10480=>732,10481=>732,10482=>732,10483=>732,10484=>732,10485=>732,10486=>732,10487=>732,10488=>732, -10489=>732,10490=>732,10491=>732,10492=>732,10493=>732,10494=>732,10495=>732,10502=>838,10503=>838,10506=>838, -10507=>838,10560=>683,10561=>683,10627=>734,10628=>734,10702=>838,10703=>1000,10704=>1000,10705=>1000,10706=>1000, -10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000,10754=>1000,10764=>1325, -10765=>521,10766=>521,10767=>521,10768=>521,10769=>521,10770=>521,10771=>521,10772=>521,10773=>521,10774=>521, -10775=>521,10776=>521,10777=>521,10778=>521,10779=>521,10780=>521,10799=>838,10877=>838,10878=>838,10879=>838, -10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838,10888=>838,10889=>838, -10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838,10898=>838,10899=>838, -10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838,10908=>838,10909=>838, -10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838,10931=>838,10932=>838, -10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838,11008=>838,11009=>838, -11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838, -11020=>838,11021=>838,11022=>836,11023=>836,11024=>836,11025=>836,11026=>945,11027=>945,11028=>945,11029=>945, -11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873,11042=>873,11043=>873, -11044=>1119,11091=>869,11092=>869,11360=>557,11361=>278,11362=>557,11363=>603,11364=>695,11365=>613,11366=>392, -11367=>752,11368=>634,11369=>656,11370=>579,11371=>685,11372=>525,11373=>781,11374=>863,11375=>684,11377=>734, -11378=>1128,11379=>961,11380=>592,11381=>654,11382=>568,11383=>660,11385=>414,11386=>612,11387=>491,11388=>175, -11389=>431,11568=>646,11569=>888,11570=>888,11571=>682,11572=>684,11573=>635,11574=>562,11575=>684,11576=>684, -11577=>632,11578=>632,11579=>683,11580=>875,11581=>685,11582=>491,11583=>685,11584=>888,11585=>888,11586=>300, -11587=>627,11588=>752,11589=>656,11590=>527,11591=>685,11592=>645,11593=>632,11594=>502,11595=>953,11596=>778, -11597=>748,11598=>621,11599=>295,11600=>778,11601=>295,11602=>752,11603=>633,11604=>888,11605=>888,11606=>752, -11607=>320,11608=>749,11609=>888,11610=>888,11611=>698,11612=>768,11613=>685,11614=>698,11615=>622,11616=>684, -11617=>752,11618=>632,11619=>788,11620=>567,11621=>788,11631=>515,11800=>531,11810=>390,11811=>390,11812=>390, -11813=>390,11822=>531,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896, -19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896, -19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896, -19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896, -19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896, -19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896, -19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42564=>635,42565=>521,42566=>354,42567=>338, -42572=>1180,42573=>1028,42576=>1029,42577=>906,42580=>1080,42581=>842,42582=>977,42583=>843,42594=>1062,42595=>912, -42596=>1066,42597=>901,42598=>1178,42599=>1008,42600=>787,42601=>612,42602=>855,42603=>712,42604=>1358,42605=>1019, -42606=>879,42634=>782,42635=>685,42636=>611,42637=>583,42644=>686,42645=>634,42760=>493,42761=>493,42762=>493, -42763=>493,42764=>493,42765=>493,42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493, -42773=>493,42774=>493,42779=>369,42780=>369,42781=>252,42782=>252,42783=>252,42790=>752,42791=>634,42792=>878, -42793=>709,42794=>614,42795=>541,42800=>491,42801=>521,42802=>1250,42803=>985,42804=>1203,42805=>990,42806=>1142, -42807=>981,42808=>971,42809=>818,42810=>971,42811=>818,42812=>959,42813=>818,42814=>703,42815=>549,42822=>680, -42823=>392,42824=>582,42825=>427,42826=>807,42827=>704,42830=>1358,42831=>1019,42880=>557,42881=>278,42882=>735, -42883=>634,42889=>337,42890=>376,42891=>401,42892=>275,43003=>575,43004=>603,43005=>863,43006=>295,43007=>1199, -61440=>977,61441=>977,63173=>612,64256=>689,64257=>630,64258=>630,64259=>967,64260=>967,64261=>686,64262=>861, -64275=>1202,64276=>1202,64277=>1196,64278=>1186,64279=>1529,64285=>272,64286=>0,64287=>471,64288=>636,64289=>856, -64290=>774,64291=>906,64292=>771,64293=>843,64294=>855,64295=>807,64296=>875,64297=>838,64298=>808,64299=>808, -64300=>808,64301=>808,64302=>629,64303=>629,64304=>629,64305=>608,64306=>448,64307=>594,64308=>640,64309=>272, -64310=>374,64312=>648,64313=>336,64314=>592,64315=>556,64316=>599,64318=>659,64320=>441,64321=>700,64323=>640, -64324=>604,64326=>581,64327=>663,64328=>592,64329=>808,64330=>657,64331=>272,64332=>608,64333=>556,64334=>604, -64335=>629,64338=>941,64339=>982,64340=>278,64341=>302,64342=>941,64343=>982,64344=>278,64345=>302,64346=>941, -64347=>982,64348=>278,64349=>302,64350=>941,64351=>982,64352=>278,64353=>302,64354=>941,64355=>982,64356=>278, -64357=>302,64358=>941,64359=>982,64360=>278,64361=>302,64362=>1037,64363=>1035,64364=>478,64365=>506,64366=>1037, -64367=>1035,64368=>478,64369=>506,64370=>646,64371=>646,64372=>618,64373=>646,64374=>646,64375=>646,64376=>618, -64377=>646,64378=>646,64379=>646,64380=>618,64381=>646,64382=>646,64383=>646,64384=>618,64385=>646,64394=>483, -64395=>552,64396=>483,64397=>552,64398=>895,64399=>895,64400=>476,64401=>552,64402=>895,64403=>895,64404=>476, -64405=>552,64414=>734,64415=>761,64473=>483,64474=>517,64488=>278,64489=>302,64508=>783,64509=>833,64510=>278, -64511=>302,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0, -65059=>0,65136=>293,65137=>293,65138=>293,65139=>262,65140=>293,65142=>293,65143=>293,65144=>293,65145=>293, -65146=>293,65147=>293,65148=>293,65149=>293,65150=>293,65151=>293,65152=>470,65153=>278,65154=>305,65155=>278, -65156=>305,65157=>483,65158=>517,65159=>278,65160=>305,65161=>783,65162=>833,65163=>278,65164=>302,65165=>278, -65166=>305,65167=>941,65168=>982,65169=>278,65170=>302,65171=>524,65172=>536,65173=>941,65174=>982,65175=>278, -65176=>302,65177=>941,65178=>982,65179=>278,65180=>302,65181=>646,65182=>646,65183=>618,65184=>646,65185=>646, -65186=>646,65187=>618,65188=>646,65189=>646,65190=>646,65191=>618,65192=>646,65193=>445,65194=>525,65195=>445, -65196=>525,65197=>483,65198=>552,65199=>483,65200=>552,65201=>1221,65202=>1275,65203=>838,65204=>892,65205=>1221, -65206=>1275,65207=>838,65208=>892,65209=>1209,65210=>1225,65211=>849,65212=>867,65213=>1209,65214=>1225,65215=>849, -65216=>867,65217=>925,65218=>949,65219=>796,65220=>820,65221=>925,65222=>949,65223=>796,65224=>820,65225=>597, -65226=>532,65227=>597,65228=>482,65229=>597,65230=>532,65231=>523,65232=>482,65233=>1037,65234=>1035,65235=>478, -65236=>506,65237=>776,65238=>834,65239=>478,65240=>506,65241=>824,65242=>843,65243=>476,65244=>552,65245=>727, -65246=>757,65247=>305,65248=>331,65249=>619,65250=>666,65251=>536,65252=>578,65253=>734,65254=>761,65255=>278, -65256=>302,65257=>524,65258=>536,65259=>527,65260=>461,65261=>483,65262=>517,65263=>783,65264=>833,65265=>783, -65266=>833,65267=>278,65268=>302,65269=>570,65270=>597,65271=>570,65272=>597,65273=>570,65274=>597,65275=>570, -65276=>597,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1025); -$enc=''; -$diff=''; -$file='dejavusans.z'; -$ctg='dejavusans.ctg.z'; -$originalsize=622280; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.z deleted file mode 100644 index e7a78d2476..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusans.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.ctg.z deleted file mode 100644 index 514062cca2..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.php deleted file mode 100644 index 188881c13b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.php +++ /dev/null @@ -1,504 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSans-Bold'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>19,'Flags'=>32,'FontBBox'=>'[-1069 -385 1975 1174]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>348,33=>456,34=>521,35=>838,36=>696,37=>1002,38=>872,39=>306,40=>457, -41=>457,42=>523,43=>838,44=>380,45=>415,46=>380,47=>365,48=>696,49=>696,50=>696, -51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>400,59=>400,60=>838, -61=>838,62=>838,63=>580,64=>1000,65=>774,66=>762,67=>734,68=>830,69=>683,70=>683, -71=>821,72=>837,73=>372,74=>372,75=>775,76=>637,77=>995,78=>837,79=>850,80=>733, -81=>850,82=>770,83=>720,84=>682,85=>812,86=>774,87=>1103,88=>771,89=>724,90=>725, -91=>457,92=>365,93=>457,94=>838,95=>500,96=>500,97=>675,98=>716,99=>593,100=>716, -101=>678,102=>435,103=>716,104=>712,105=>343,106=>343,107=>665,108=>343,109=>1042,110=>712, -111=>687,112=>716,113=>716,114=>493,115=>595,116=>478,117=>712,118=>652,119=>924,120=>645, -121=>652,122=>582,123=>712,124=>365,125=>712,126=>838,8364=>696,8218=>380,402=>435,8222=>657, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1440,352=>720,8249=>412,338=>1167,381=>725,8216=>380, -8217=>380,8220=>657,8221=>657,8226=>639,8211=>500,8212=>1000,732=>500,8482=>1000,353=>595,8250=>412, -339=>1094,382=>582,376=>724,160=>348,161=>456,162=>696,163=>696,164=>636,165=>696,166=>365, -167=>500,168=>500,169=>1000,170=>564,171=>646,172=>838,173=>415,174=>1000,175=>500,176=>500, -177=>838,178=>438,179=>438,180=>500,181=>736,182=>636,183=>380,184=>500,185=>438,186=>564, -187=>646,188=>1035,189=>1035,190=>1035,191=>580,192=>774,193=>774,194=>774,195=>774,196=>774, -197=>774,198=>1085,199=>734,200=>683,201=>683,202=>683,203=>683,204=>372,205=>372,206=>372, -207=>372,208=>838,209=>837,210=>850,211=>850,212=>850,213=>850,214=>850,215=>838,216=>850, -217=>812,218=>812,219=>812,220=>812,221=>724,222=>738,223=>719,224=>675,225=>675,226=>675, -227=>675,228=>675,229=>675,230=>1048,231=>593,232=>678,233=>678,234=>678,235=>678,236=>343, -237=>343,238=>343,239=>343,240=>687,241=>712,242=>687,243=>687,244=>687,245=>687,246=>687, -247=>838,248=>687,249=>712,250=>712,251=>712,252=>712,253=>652,254=>716,255=>652,256=>774, -257=>675,258=>774,259=>675,260=>774,261=>675,262=>734,263=>593,264=>734,265=>593,266=>734, -267=>593,268=>734,269=>593,270=>830,271=>716,272=>838,273=>716,274=>683,275=>678,276=>683, -277=>678,278=>683,279=>678,280=>683,281=>678,282=>683,283=>678,284=>821,285=>716,286=>821, -287=>716,288=>821,289=>716,290=>821,291=>716,292=>837,293=>712,294=>974,295=>790,296=>372, -297=>343,298=>372,299=>343,300=>372,301=>343,302=>372,303=>343,304=>372,305=>343,306=>744, -307=>686,308=>372,309=>343,310=>775,311=>665,312=>665,313=>637,314=>343,315=>637,316=>343, -317=>637,318=>479,319=>637,320=>557,321=>642,322=>371,323=>837,324=>712,325=>837,326=>712, -327=>837,328=>712,329=>983,330=>837,331=>712,332=>850,333=>687,334=>850,335=>687,336=>850, -337=>687,340=>770,341=>493,342=>770,343=>493,344=>770,345=>493,346=>720,347=>595,348=>720, -349=>595,350=>720,351=>595,354=>682,355=>478,356=>682,357=>478,358=>682,359=>478,360=>812, -361=>712,362=>812,363=>712,364=>812,365=>712,366=>812,367=>712,368=>812,369=>712,370=>812, -371=>712,372=>1103,373=>924,374=>724,375=>652,377=>725,378=>582,379=>725,380=>582,383=>435, -384=>716,385=>811,386=>762,387=>716,388=>762,389=>716,390=>734,391=>734,392=>593,393=>838, -394=>879,395=>757,396=>716,397=>688,398=>683,399=>849,400=>696,401=>683,403=>821,404=>793, -405=>1045,406=>436,407=>389,408=>775,409=>665,410=>360,411=>592,412=>1042,413=>837,414=>712, -415=>850,416=>874,417=>687,418=>1083,419=>912,420=>782,421=>716,422=>770,423=>720,424=>595, -425=>683,426=>552,427=>478,428=>707,429=>478,430=>682,431=>835,432=>712,433=>850,434=>813, -435=>797,436=>778,437=>725,438=>582,439=>772,440=>772,441=>641,442=>582,443=>696,444=>772, -445=>641,446=>573,447=>716,448=>372,449=>659,450=>544,451=>372,452=>1555,453=>1412,454=>1298, -455=>1009,456=>980,457=>686,458=>1209,459=>1180,460=>1055,461=>774,462=>675,463=>372,464=>343, -465=>850,466=>687,467=>812,468=>712,469=>812,470=>712,471=>812,472=>712,473=>812,474=>712, -475=>812,476=>712,477=>678,478=>774,479=>675,480=>774,481=>675,482=>1085,483=>1048,484=>821, -485=>716,486=>821,487=>716,488=>775,489=>665,490=>850,491=>687,492=>850,493=>687,494=>772, -495=>582,496=>343,497=>1555,498=>1412,499=>1298,500=>821,501=>716,502=>1289,503=>787,504=>837, -505=>712,506=>774,507=>675,508=>1085,509=>1048,510=>850,511=>687,512=>774,513=>675,514=>774, -515=>675,516=>683,517=>678,518=>683,519=>678,520=>372,521=>343,522=>372,523=>343,524=>850, -525=>687,526=>850,527=>687,528=>770,529=>493,530=>770,531=>493,532=>812,533=>712,534=>812, -535=>712,536=>720,537=>595,538=>682,539=>478,540=>690,541=>607,542=>837,543=>712,544=>837, -545=>865,546=>809,547=>659,548=>725,549=>582,550=>774,551=>675,552=>683,553=>678,554=>850, -555=>687,556=>850,557=>687,558=>850,559=>687,560=>850,561=>687,562=>724,563=>652,564=>492, -565=>867,566=>512,567=>343,568=>1088,569=>1088,570=>774,571=>734,572=>593,573=>637,574=>682, -575=>595,576=>582,577=>782,578=>614,579=>762,580=>812,581=>774,582=>683,583=>678,584=>372, -585=>343,586=>860,587=>791,588=>770,589=>493,590=>724,591=>652,592=>675,593=>716,594=>716, -595=>716,596=>593,597=>593,598=>717,599=>792,600=>678,601=>678,602=>876,603=>557,604=>545, -605=>815,606=>731,607=>343,608=>792,609=>716,610=>627,611=>644,612=>635,613=>712,614=>712, -615=>712,616=>545,617=>440,618=>545,619=>559,620=>693,621=>343,622=>841,623=>1042,624=>1042, -625=>1042,626=>712,627=>793,628=>707,629=>687,630=>909,631=>681,632=>796,633=>538,634=>538, -635=>650,636=>493,637=>493,638=>596,639=>596,640=>642,641=>642,642=>595,643=>415,644=>435, -645=>605,646=>552,647=>478,648=>478,649=>920,650=>772,651=>670,652=>652,653=>924,654=>652, -655=>724,656=>694,657=>684,658=>641,659=>641,660=>573,661=>573,662=>573,663=>573,664=>850, -665=>633,666=>731,667=>685,668=>691,669=>343,670=>732,671=>539,672=>792,673=>573,674=>573, -675=>1156,676=>1214,677=>1155,678=>974,679=>769,680=>929,681=>1026,682=>792,683=>780,684=>591, -685=>415,686=>677,687=>789,688=>456,689=>456,690=>219,691=>315,692=>315,693=>315,694=>411, -695=>591,696=>417,697=>302,698=>521,699=>380,700=>380,701=>380,702=>366,703=>366,704=>326, -705=>326,706=>500,707=>500,708=>500,709=>500,711=>500,712=>306,713=>500,714=>500,715=>500, -716=>306,717=>500,718=>500,719=>500,720=>337,721=>337,722=>366,723=>366,724=>500,725=>500, -726=>416,727=>328,728=>500,729=>500,730=>500,731=>500,733=>500,734=>351,735=>500,736=>412, -737=>219,738=>381,739=>413,740=>326,741=>500,742=>500,743=>500,744=>500,745=>500,748=>500, -749=>500,750=>657,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>698,881=>565,882=>1022, -883=>836,884=>302,885=>302,886=>837,887=>701,890=>500,891=>593,892=>550,893=>549,894=>400, -900=>441,901=>500,902=>797,903=>380,904=>846,905=>1009,906=>563,908=>891,910=>980,911=>894, -912=>390,913=>774,914=>762,915=>637,916=>774,917=>683,918=>725,919=>837,920=>850,921=>372, -922=>775,923=>774,924=>995,925=>837,926=>632,927=>850,928=>837,929=>733,931=>683,932=>682, -933=>724,934=>850,935=>771,936=>850,937=>850,938=>372,939=>724,940=>687,941=>557,942=>712, -943=>390,944=>675,945=>687,946=>716,947=>681,948=>687,949=>557,950=>591,951=>712,952=>687, -953=>390,954=>710,955=>633,956=>736,957=>681,958=>591,959=>687,960=>791,961=>716,962=>593, -963=>779,964=>638,965=>675,966=>782,967=>645,968=>794,969=>869,970=>390,971=>675,972=>687, -973=>675,974=>869,975=>775,976=>651,977=>661,978=>746,979=>981,980=>746,981=>796,982=>869, -983=>744,984=>850,985=>687,986=>734,987=>593,988=>683,989=>494,990=>702,991=>660,992=>919, -993=>627,994=>1093,995=>837,996=>832,997=>716,998=>928,999=>744,1000=>733,1001=>650,1002=>789, -1003=>671,1004=>752,1005=>716,1006=>682,1007=>590,1008=>744,1009=>716,1010=>593,1011=>343,1012=>850, -1013=>645,1014=>644,1015=>738,1016=>716,1017=>734,1018=>995,1019=>732,1020=>716,1021=>698,1022=>734, -1023=>698,1024=>683,1025=>683,1026=>878,1027=>637,1028=>734,1029=>720,1030=>372,1031=>372,1032=>372, -1033=>1154,1034=>1130,1035=>878,1036=>817,1037=>837,1038=>771,1039=>837,1040=>774,1041=>762,1042=>762, -1043=>637,1044=>891,1045=>683,1046=>1224,1047=>710,1048=>837,1049=>837,1050=>817,1051=>831,1052=>995, -1053=>837,1054=>850,1055=>837,1056=>733,1057=>734,1058=>682,1059=>771,1060=>992,1061=>771,1062=>928, -1063=>808,1064=>1235,1065=>1326,1066=>939,1067=>1036,1068=>762,1069=>734,1070=>1174,1071=>770,1072=>675, -1073=>698,1074=>633,1075=>522,1076=>808,1077=>678,1078=>995,1079=>581,1080=>701,1081=>701,1082=>679, -1083=>732,1084=>817,1085=>691,1086=>687,1087=>691,1088=>716,1089=>593,1090=>580,1091=>652,1092=>992, -1093=>645,1094=>741,1095=>687,1096=>1062,1097=>1105,1098=>751,1099=>904,1100=>632,1101=>593,1102=>972, -1103=>642,1104=>678,1105=>678,1106=>714,1107=>522,1108=>593,1109=>595,1110=>343,1111=>343,1112=>343, -1113=>991,1114=>956,1115=>734,1116=>679,1117=>701,1118=>652,1119=>691,1120=>1093,1121=>869,1122=>840, -1123=>736,1124=>1012,1125=>839,1126=>992,1127=>832,1128=>1358,1129=>1121,1130=>850,1131=>687,1132=>1236, -1133=>1007,1134=>696,1135=>557,1136=>1075,1137=>1061,1138=>850,1139=>687,1140=>850,1141=>695,1142=>850, -1143=>695,1144=>1148,1145=>1043,1146=>1074,1147=>863,1148=>1405,1149=>1173,1150=>1093,1151=>869,1152=>734, -1153=>593,1154=>652,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>957, -1163=>807,1164=>762,1165=>611,1166=>733,1167=>716,1168=>637,1169=>522,1170=>666,1171=>543,1172=>808, -1173=>669,1174=>1224,1175=>995,1176=>710,1177=>581,1178=>775,1179=>679,1180=>817,1181=>679,1182=>817, -1183=>679,1184=>1015,1185=>826,1186=>956,1187=>808,1188=>1103,1189=>874,1190=>1273,1191=>1017,1192=>952, -1193=>858,1194=>734,1195=>593,1196=>682,1197=>580,1198=>724,1199=>652,1200=>724,1201=>652,1202=>771, -1203=>645,1204=>1112,1205=>1000,1206=>808,1207=>687,1208=>808,1209=>687,1210=>808,1211=>712,1212=>1026, -1213=>810,1214=>1026,1215=>810,1216=>372,1217=>1224,1218=>995,1219=>775,1220=>630,1221=>951,1222=>805, -1223=>837,1224=>691,1225=>957,1226=>807,1227=>808,1228=>687,1229=>1115,1230=>933,1231=>343,1232=>774, -1233=>675,1234=>774,1235=>675,1236=>1085,1237=>1048,1238=>683,1239=>678,1240=>849,1241=>678,1242=>849, -1243=>678,1244=>1224,1245=>995,1246=>710,1247=>581,1248=>772,1249=>641,1250=>837,1251=>701,1252=>837, -1253=>701,1254=>850,1255=>687,1256=>850,1257=>687,1258=>850,1259=>687,1260=>734,1261=>593,1262=>771, -1263=>652,1264=>771,1265=>652,1266=>771,1267=>652,1268=>808,1269=>687,1270=>637,1271=>522,1272=>1036, -1273=>904,1274=>666,1275=>543,1276=>771,1277=>645,1278=>771,1279=>645,1280=>762,1281=>608,1282=>1159, -1283=>893,1284=>1119,1285=>920,1286=>828,1287=>693,1288=>1242,1289=>1017,1290=>1289,1291=>1013,1292=>839, -1293=>638,1294=>938,1295=>803,1296=>696,1297=>557,1298=>831,1299=>732,1300=>1286,1301=>1068,1302=>1065, -1303=>979,1304=>1082,1305=>1013,1306=>850,1307=>716,1308=>1103,1309=>924,1312=>1267,1313=>1059,1314=>1273, -1315=>1017,1316=>957,1317=>807,1329=>984,1330=>812,1331=>984,1332=>984,1333=>812,1334=>777,1335=>812, -1336=>812,1337=>975,1338=>984,1339=>812,1340=>710,1341=>1078,1342=>1136,1343=>812,1344=>710,1345=>757, -1346=>984,1347=>876,1348=>984,1349=>793,1350=>984,1351=>812,1352=>812,1353=>812,1354=>958,1355=>777, -1356=>984,1357=>812,1358=>984,1359=>720,1360=>812,1361=>793,1362=>895,1363=>850,1364=>936,1365=>850, -1366=>720,1369=>366,1370=>380,1371=>550,1372=>550,1373=>380,1374=>546,1375=>521,1377=>1042,1378=>712, -1379=>866,1380=>868,1381=>712,1382=>817,1383=>653,1384=>712,1385=>811,1386=>817,1387=>712,1388=>498, -1389=>1018,1390=>716,1391=>712,1392=>712,1393=>716,1394=>819,1395=>712,1396=>751,1397=>343,1398=>882, -1399=>559,1400=>712,1401=>559,1402=>1042,1403=>559,1404=>863,1405=>712,1406=>813,1407=>1042,1408=>712, -1409=>716,1410=>571,1411=>1042,1412=>778,1413=>687,1414=>720,1415=>862,1417=>400,1418=>487,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>415,1471=>0,1472=>372,1473=>0,1474=>0,1475=>372,1478=>497, -1479=>0,1488=>751,1489=>673,1490=>537,1491=>654,1492=>712,1493=>343,1494=>491,1495=>712,1496=>724, -1497=>343,1498=>649,1499=>650,1500=>679,1501=>712,1502=>775,1503=>343,1504=>497,1505=>773,1506=>678, -1507=>718,1508=>687,1509=>628,1510=>751,1511=>729,1512=>649,1513=>949,1514=>751,1520=>664,1521=>664, -1522=>663,1523=>444,1524=>710,1542=>667,1543=>667,1545=>884,1546=>1157,1548=>380,1557=>0,1563=>400, -1567=>580,1569=>511,1570=>343,1571=>343,1572=>622,1573=>343,1574=>917,1575=>343,1576=>1005,1577=>590, -1578=>1005,1579=>1005,1580=>721,1581=>721,1582=>721,1583=>513,1584=>513,1585=>576,1586=>576,1587=>1380, -1588=>1380,1589=>1345,1590=>1345,1591=>1039,1592=>1039,1593=>683,1594=>683,1600=>342,1601=>1162,1602=>894, -1603=>917,1604=>868,1605=>733,1606=>854,1607=>590,1608=>622,1609=>917,1610=>917,1611=>0,1612=>0, -1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1626=>500, -1632=>610,1633=>610,1634=>610,1635=>610,1636=>610,1637=>610,1638=>610,1639=>610,1640=>610,1641=>610, -1642=>610,1643=>374,1644=>380,1645=>545,1646=>1005,1647=>894,1652=>292,1657=>1005,1658=>1005,1659=>1005, -1660=>1005,1661=>1005,1662=>1005,1663=>1005,1664=>1005,1665=>721,1666=>721,1667=>721,1668=>721,1669=>721, -1670=>721,1671=>721,1681=>576,1682=>576,1685=>681,1688=>576,1697=>1162,1700=>1162,1702=>1162,1705=>1024, -1711=>1024,1717=>868,1722=>854,1727=>721,1734=>622,1740=>917,1742=>917,1749=>590,1776=>610,1777=>610, -1778=>610,1779=>610,1780=>610,1781=>610,1782=>610,1783=>610,1784=>610,1785=>610,1984=>696,1985=>696, -1986=>696,1987=>696,1988=>696,1989=>696,1990=>696,1991=>696,1992=>696,1993=>696,1994=>343,1995=>547, -1996=>543,1997=>652,1998=>691,1999=>691,2000=>594,2001=>691,2002=>904,2003=>551,2004=>551,2005=>627, -2006=>688,2007=>444,2008=>1022,2009=>506,2010=>826,2011=>691,2012=>652,2013=>912,2014=>627,2015=>707, -2016=>506,2017=>652,2018=>574,2019=>627,2020=>627,2021=>627,2022=>574,2023=>574,2027=>0,2028=>0, -2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>380,2037=>380,2040=>691, -2041=>691,2042=>415,3647=>743,3713=>790,3714=>748,3716=>749,3719=>569,3720=>742,3722=>744,3725=>761, -3732=>706,3733=>704,3734=>747,3735=>819,3737=>730,3738=>727,3739=>727,3740=>922,3741=>827,3742=>866, -3743=>866,3745=>836,3746=>761,3747=>770,3749=>769,3751=>713,3754=>827,3755=>1031,3757=>724,3758=>784, -3759=>934,3760=>688,3761=>0,3762=>610,3763=>610,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0, -3769=>0,3771=>0,3772=>0,3773=>670,3776=>516,3777=>860,3778=>516,3779=>650,3780=>632,3782=>759, -3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>771,3793=>771,3794=>693,3795=>836, -3796=>729,3797=>729,3798=>849,3799=>790,3800=>759,3801=>910,3804=>1363,3805=>1363,4256=>918,4257=>744, -4258=>739,4259=>837,4260=>649,4261=>773,4262=>857,4263=>889,4264=>530,4265=>633,4266=>857,4267=>900, -4268=>643,4269=>903,4270=>814,4271=>752,4272=>869,4273=>643,4274=>643,4275=>886,4276=>886,4277=>733, -4278=>653,4279=>643,4280=>646,4281=>643,4282=>790,4283=>902,4284=>633,4285=>619,4286=>643,4287=>778, -4288=>892,4289=>601,4290=>742,4291=>616,4292=>633,4293=>742,4304=>553,4305=>552,4306=>596,4307=>815, -4308=>562,4309=>563,4310=>553,4311=>827,4312=>553,4313=>543,4314=>1074,4315=>563,4316=>563,4317=>812, -4318=>552,4319=>591,4320=>822,4321=>563,4322=>690,4323=>583,4324=>813,4325=>562,4326=>813,4327=>563, -4328=>563,4329=>563,4330=>632,4331=>563,4332=>563,4333=>552,4334=>563,4335=>563,4336=>558,4337=>604, -4338=>552,4339=>552,4340=>553,4341=>605,4342=>852,4343=>635,4344=>563,4345=>596,4346=>542,4347=>684, -4348=>368,5121=>774,5122=>774,5123=>774,5124=>774,5125=>905,5126=>905,5127=>905,5129=>905,5130=>905, -5131=>905,5132=>1018,5133=>1009,5134=>1018,5135=>1009,5136=>1018,5137=>1009,5138=>1149,5139=>1140,5140=>1149, -5141=>1140,5142=>905,5143=>1149,5144=>1142,5145=>1149,5146=>1142,5147=>905,5149=>310,5150=>529,5151=>425, -5152=>425,5153=>395,5154=>395,5155=>395,5156=>395,5157=>564,5158=>470,5159=>310,5160=>395,5161=>395, -5162=>395,5163=>1213,5164=>986,5165=>1216,5166=>1297,5167=>774,5168=>774,5169=>774,5170=>774,5171=>886, -5172=>886,5173=>886,5175=>886,5176=>886,5177=>886,5178=>1018,5179=>1009,5180=>1018,5181=>1009,5182=>1018, -5183=>1009,5184=>1149,5185=>1140,5186=>1149,5187=>1140,5188=>1149,5189=>1142,5190=>1149,5191=>1142,5192=>886, -5193=>576,5194=>229,5196=>812,5197=>812,5198=>812,5199=>812,5200=>815,5201=>815,5202=>815,5204=>815, -5205=>815,5206=>815,5207=>1056,5208=>1048,5209=>1056,5210=>1048,5211=>1056,5212=>1048,5213=>1060,5214=>1054, -5215=>1060,5216=>1054,5217=>1060,5218=>1052,5219=>1060,5220=>1052,5221=>1060,5222=>483,5223=>1005,5224=>1005, -5225=>1023,5226=>1017,5227=>743,5228=>743,5229=>743,5230=>743,5231=>743,5232=>743,5233=>743,5234=>743, -5235=>743,5236=>1029,5237=>975,5238=>980,5239=>975,5240=>980,5241=>975,5242=>1029,5243=>975,5244=>1029, -5245=>975,5246=>980,5247=>975,5248=>980,5249=>975,5250=>980,5251=>501,5252=>501,5253=>938,5254=>938, -5255=>938,5256=>938,5257=>743,5258=>743,5259=>743,5260=>743,5261=>743,5262=>743,5263=>743,5264=>743, -5265=>743,5266=>1029,5267=>975,5268=>1029,5269=>975,5270=>1029,5271=>975,5272=>1029,5273=>975,5274=>1029, -5275=>975,5276=>1029,5277=>975,5278=>1029,5279=>975,5280=>1029,5281=>501,5282=>501,5283=>626,5284=>626, -5285=>626,5286=>626,5287=>626,5288=>626,5289=>626,5290=>626,5291=>626,5292=>881,5293=>854,5294=>863, -5295=>874,5296=>863,5297=>874,5298=>881,5299=>874,5300=>881,5301=>874,5302=>863,5303=>874,5304=>863, -5305=>874,5306=>863,5307=>436,5308=>548,5309=>436,5312=>988,5313=>988,5314=>988,5315=>988,5316=>931, -5317=>931,5318=>931,5319=>931,5320=>931,5321=>1238,5322=>1247,5323=>1200,5324=>1228,5325=>1200,5326=>1228, -5327=>931,5328=>660,5329=>497,5330=>660,5331=>988,5332=>988,5333=>988,5334=>988,5335=>931,5336=>931, -5337=>931,5338=>931,5339=>931,5340=>1231,5341=>1247,5342=>1283,5343=>1228,5344=>1283,5345=>1228,5346=>1228, -5347=>1214,5348=>1228,5349=>1214,5350=>1283,5351=>1228,5352=>1283,5353=>1228,5354=>660,5356=>886,5357=>730, -5358=>730,5359=>730,5360=>730,5361=>730,5362=>730,5363=>730,5364=>730,5365=>730,5366=>998,5367=>958, -5368=>967,5369=>989,5370=>967,5371=>989,5372=>998,5373=>958,5374=>998,5375=>958,5376=>967,5377=>989, -5378=>967,5379=>989,5380=>967,5381=>493,5382=>460,5383=>493,5392=>923,5393=>923,5394=>923,5395=>1136, -5396=>1136,5397=>1136,5398=>1136,5399=>1209,5400=>1202,5401=>1209,5402=>1202,5403=>1209,5404=>1202,5405=>1431, -5406=>1420,5407=>1431,5408=>1420,5409=>1431,5410=>1420,5411=>1431,5412=>1420,5413=>746,5414=>776,5415=>776, -5416=>776,5417=>776,5418=>776,5419=>776,5420=>776,5421=>776,5422=>776,5423=>1003,5424=>1003,5425=>1013, -5426=>996,5427=>1013,5428=>996,5429=>1003,5430=>1003,5431=>1003,5432=>1003,5433=>1013,5434=>996,5435=>1013, -5436=>996,5437=>1013,5438=>495,5440=>395,5441=>510,5442=>1033,5443=>1033,5444=>976,5445=>976,5446=>976, -5447=>976,5448=>733,5449=>733,5450=>733,5451=>733,5452=>733,5453=>733,5454=>1003,5455=>959,5456=>495, -5458=>886,5459=>774,5460=>774,5461=>774,5462=>774,5463=>928,5464=>928,5465=>928,5466=>928,5467=>1172, -5468=>1142,5469=>602,5470=>812,5471=>812,5472=>812,5473=>812,5474=>812,5475=>812,5476=>815,5477=>815, -5478=>815,5479=>815,5480=>1060,5481=>1052,5482=>548,5492=>977,5493=>977,5494=>977,5495=>977,5496=>977, -5497=>977,5498=>977,5499=>618,5500=>837,5501=>510,5502=>1238,5503=>1238,5504=>1238,5505=>1238,5506=>1238, -5507=>1238,5508=>1238,5509=>989,5514=>977,5515=>977,5516=>977,5517=>977,5518=>1591,5519=>1591,5520=>1591, -5521=>1295,5522=>1295,5523=>1591,5524=>1591,5525=>848,5526=>1273,5536=>988,5537=>988,5538=>931,5539=>931, -5540=>931,5541=>931,5542=>660,5543=>776,5544=>776,5545=>776,5546=>776,5547=>776,5548=>776,5549=>776, -5550=>495,5551=>743,5598=>830,5601=>830,5702=>496,5703=>496,5742=>413,5743=>1238,5744=>1591,5745=>2016, -5746=>2016,5747=>1720,5748=>1678,5749=>2016,5750=>2016,5760=>543,5761=>637,5762=>945,5763=>1254,5764=>1563, -5765=>1871,5766=>627,5767=>936,5768=>1254,5769=>1559,5770=>1871,5771=>569,5772=>877,5773=>1187,5774=>1497, -5775=>1807,5776=>637,5777=>945,5778=>1240,5779=>1555,5780=>1871,5781=>569,5782=>569,5783=>789,5784=>1234, -5785=>1559,5786=>740,5787=>638,5788=>638,7424=>652,7425=>833,7426=>1048,7427=>608,7428=>593,7429=>676, -7430=>676,7431=>559,7432=>557,7433=>343,7434=>494,7435=>665,7436=>539,7437=>817,7438=>701,7439=>687, -7440=>593,7441=>660,7442=>660,7443=>660,7444=>1094,7446=>687,7447=>687,7448=>556,7449=>642,7450=>642, -7451=>580,7452=>634,7453=>737,7454=>948,7455=>695,7456=>652,7457=>924,7458=>582,7459=>646,7462=>539, -7463=>652,7464=>691,7465=>556,7466=>781,7467=>732,7468=>487,7469=>683,7470=>480,7472=>523,7473=>430, -7474=>430,7475=>517,7476=>527,7477=>234,7478=>234,7479=>488,7480=>401,7481=>626,7482=>527,7483=>527, -7484=>535,7485=>509,7486=>461,7487=>485,7488=>430,7489=>511,7490=>695,7491=>458,7492=>458,7493=>479, -7494=>712,7495=>479,7496=>479,7497=>479,7498=>479,7499=>386,7500=>386,7501=>479,7502=>219,7503=>487, -7504=>664,7505=>456,7506=>488,7507=>414,7508=>488,7509=>488,7510=>479,7511=>388,7512=>456,7513=>462, -7514=>664,7515=>501,7517=>451,7518=>429,7519=>433,7520=>493,7521=>406,7522=>219,7523=>315,7524=>456, -7525=>501,7526=>451,7527=>429,7528=>451,7529=>493,7530=>406,7543=>716,7544=>527,7547=>545,7557=>514, -7579=>479,7580=>414,7581=>414,7582=>488,7583=>386,7584=>377,7585=>348,7586=>479,7587=>456,7588=>347, -7589=>281,7590=>347,7591=>347,7592=>431,7593=>326,7594=>330,7595=>370,7596=>664,7597=>664,7598=>562, -7599=>562,7600=>448,7601=>488,7602=>542,7603=>422,7604=>396,7605=>388,7606=>583,7607=>494,7608=>399, -7609=>451,7610=>501,7611=>417,7612=>523,7613=>470,7614=>455,7615=>425,7620=>0,7621=>0,7622=>0, -7623=>0,7624=>0,7625=>0,7680=>774,7681=>675,7682=>762,7683=>716,7684=>762,7685=>716,7686=>762, -7687=>716,7688=>734,7689=>593,7690=>830,7691=>716,7692=>830,7693=>716,7694=>830,7695=>716,7696=>830, -7697=>716,7698=>830,7699=>716,7700=>683,7701=>678,7702=>683,7703=>678,7704=>683,7705=>678,7706=>683, -7707=>678,7708=>683,7709=>678,7710=>683,7711=>435,7712=>821,7713=>716,7714=>837,7715=>712,7716=>837, -7717=>712,7718=>837,7719=>712,7720=>837,7721=>712,7722=>837,7723=>712,7724=>372,7725=>343,7726=>372, -7727=>343,7728=>775,7729=>665,7730=>775,7731=>665,7732=>775,7733=>665,7734=>637,7735=>343,7736=>637, -7737=>343,7738=>637,7739=>343,7740=>637,7741=>343,7742=>995,7743=>1042,7744=>995,7745=>1042,7746=>995, -7747=>1042,7748=>837,7749=>712,7750=>837,7751=>712,7752=>837,7753=>712,7754=>837,7755=>712,7756=>850, -7757=>687,7758=>850,7759=>687,7760=>850,7761=>687,7762=>850,7763=>687,7764=>733,7765=>716,7766=>733, -7767=>716,7768=>770,7769=>493,7770=>770,7771=>493,7772=>770,7773=>493,7774=>770,7775=>493,7776=>720, -7777=>595,7778=>720,7779=>595,7780=>720,7781=>595,7782=>720,7783=>595,7784=>720,7785=>595,7786=>682, -7787=>478,7788=>682,7789=>478,7790=>682,7791=>478,7792=>682,7793=>478,7794=>812,7795=>712,7796=>812, -7797=>712,7798=>812,7799=>712,7800=>812,7801=>712,7802=>812,7803=>712,7804=>774,7805=>652,7806=>774, -7807=>652,7808=>1103,7809=>924,7810=>1103,7811=>924,7812=>1103,7813=>924,7814=>1103,7815=>924,7816=>1103, -7817=>924,7818=>771,7819=>645,7820=>771,7821=>645,7822=>724,7823=>652,7824=>725,7825=>582,7826=>725, -7827=>582,7828=>725,7829=>582,7830=>712,7831=>478,7832=>924,7833=>652,7834=>675,7835=>435,7838=>896, -7839=>687,7840=>774,7841=>675,7842=>774,7843=>675,7844=>774,7845=>675,7846=>774,7847=>675,7848=>774, -7849=>675,7850=>774,7851=>675,7852=>774,7853=>675,7854=>774,7855=>675,7856=>774,7857=>675,7858=>774, -7859=>675,7860=>774,7861=>675,7862=>774,7863=>675,7864=>683,7865=>678,7866=>683,7867=>678,7868=>683, -7869=>678,7870=>683,7871=>678,7872=>683,7873=>678,7874=>683,7875=>678,7876=>683,7877=>678,7878=>683, -7879=>678,7880=>372,7881=>343,7882=>372,7883=>343,7884=>850,7885=>687,7886=>850,7887=>687,7888=>850, -7889=>687,7890=>850,7891=>687,7892=>850,7893=>687,7894=>850,7895=>687,7896=>850,7897=>687,7898=>874, -7899=>687,7900=>874,7901=>687,7902=>874,7903=>687,7904=>874,7905=>687,7906=>874,7907=>687,7908=>812, -7909=>712,7910=>812,7911=>712,7912=>835,7913=>712,7914=>835,7915=>712,7916=>835,7917=>712,7918=>835, -7919=>712,7920=>835,7921=>712,7922=>724,7923=>652,7924=>724,7925=>652,7926=>724,7927=>652,7928=>724, -7929=>652,7936=>687,7937=>687,7938=>687,7939=>687,7940=>687,7941=>687,7942=>687,7943=>687,7944=>774, -7945=>774,7946=>1041,7947=>1043,7948=>935,7949=>963,7950=>835,7951=>859,7952=>557,7953=>557,7954=>557, -7955=>557,7956=>557,7957=>557,7960=>792,7961=>794,7962=>1100,7963=>1096,7964=>1023,7965=>1052,7968=>712, -7969=>712,7970=>712,7971=>712,7972=>712,7973=>712,7974=>712,7975=>712,7976=>945,7977=>951,7978=>1250, -7979=>1250,7980=>1180,7981=>1206,7982=>1054,7983=>1063,7984=>390,7985=>390,7986=>390,7987=>390,7988=>390, -7989=>390,7990=>390,7991=>390,7992=>483,7993=>489,7994=>777,7995=>785,7996=>712,7997=>738,7998=>604, -7999=>604,8000=>687,8001=>687,8002=>687,8003=>687,8004=>687,8005=>687,8008=>892,8009=>933,8010=>1221, -8011=>1224,8012=>1053,8013=>1082,8016=>675,8017=>675,8018=>675,8019=>675,8020=>675,8021=>675,8022=>675, -8023=>675,8025=>930,8027=>1184,8029=>1199,8031=>1049,8032=>869,8033=>869,8034=>869,8035=>869,8036=>869, -8037=>869,8038=>869,8039=>869,8040=>909,8041=>958,8042=>1246,8043=>1251,8044=>1076,8045=>1105,8046=>1028, -8047=>1076,8048=>687,8049=>687,8050=>557,8051=>557,8052=>712,8053=>712,8054=>390,8055=>390,8056=>687, -8057=>687,8058=>675,8059=>675,8060=>869,8061=>869,8064=>687,8065=>687,8066=>687,8067=>687,8068=>687, -8069=>687,8070=>687,8071=>687,8072=>774,8073=>774,8074=>1041,8075=>1043,8076=>935,8077=>963,8078=>835, -8079=>859,8080=>712,8081=>712,8082=>712,8083=>712,8084=>712,8085=>712,8086=>712,8087=>712,8088=>945, -8089=>951,8090=>1250,8091=>1250,8092=>1180,8093=>1206,8094=>1054,8095=>1063,8096=>869,8097=>869,8098=>869, -8099=>869,8100=>869,8101=>869,8102=>869,8103=>869,8104=>909,8105=>958,8106=>1246,8107=>1251,8108=>1076, -8109=>1105,8110=>1028,8111=>1076,8112=>687,8113=>687,8114=>687,8115=>687,8116=>687,8118=>687,8119=>687, -8120=>774,8121=>774,8122=>876,8123=>797,8124=>774,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500, -8130=>712,8131=>712,8132=>712,8134=>712,8135=>712,8136=>929,8137=>846,8138=>1080,8139=>1009,8140=>837, -8141=>500,8142=>500,8143=>500,8144=>390,8145=>390,8146=>390,8147=>390,8150=>390,8151=>390,8152=>372, -8153=>372,8154=>621,8155=>563,8157=>500,8158=>500,8159=>500,8160=>675,8161=>675,8162=>675,8163=>675, -8164=>716,8165=>716,8166=>675,8167=>675,8168=>724,8169=>724,8170=>1020,8171=>980,8172=>838,8173=>500, -8174=>500,8175=>500,8178=>869,8179=>869,8180=>869,8182=>869,8183=>869,8184=>1065,8185=>891,8186=>1084, -8187=>894,8188=>850,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250, -8198=>167,8199=>696,8200=>380,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0, -8208=>415,8209=>415,8210=>696,8213=>1000,8214=>500,8215=>500,8219=>380,8223=>657,8227=>639,8228=>333, -8229=>667,8231=>348,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8241=>1887,8242=>264, -8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733,8251=>972,8252=>627,8253=>580,8254=>500, -8255=>828,8256=>828,8257=>329,8258=>1023,8259=>500,8260=>167,8261=>457,8262=>457,8263=>1030,8264=>829, -8265=>829,8266=>513,8267=>636,8268=>500,8269=>500,8270=>523,8271=>400,8272=>828,8273=>523,8274=>556, -8275=>1000,8276=>828,8277=>838,8278=>684,8279=>813,8280=>838,8281=>838,8282=>380,8283=>872,8284=>838, -8285=>380,8286=>380,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0, -8300=>0,8301=>0,8302=>0,8303=>0,8304=>438,8305=>219,8308=>438,8309=>438,8310=>438,8311=>438, -8312=>438,8313=>438,8314=>528,8315=>528,8316=>528,8317=>288,8318=>288,8319=>456,8320=>438,8321=>438, -8322=>438,8323=>438,8324=>438,8325=>438,8326=>438,8327=>438,8328=>438,8329=>438,8330=>528,8331=>528, -8332=>528,8333=>288,8334=>288,8336=>458,8337=>479,8338=>488,8339=>413,8340=>479,8352=>929,8353=>696, -8354=>696,8355=>696,8356=>696,8357=>1042,8358=>837,8359=>1518,8360=>1205,8361=>1103,8362=>904,8363=>696, -8365=>696,8366=>682,8367=>1392,8368=>696,8369=>696,8370=>696,8371=>696,8372=>859,8373=>696,8400=>0, -8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1120,8449=>1170,8450=>734,8451=>1211, -8452=>896,8453=>1091,8454=>1144,8455=>614,8456=>698,8457=>1086,8459=>1073,8460=>913,8461=>888,8462=>712, -8463=>712,8464=>597,8465=>697,8466=>856,8467=>472,8468=>974,8469=>837,8470=>1203,8471=>1000,8472=>697, -8473=>750,8474=>850,8475=>938,8476=>814,8477=>801,8478=>896,8479=>710,8480=>1020,8481=>1281,8483=>755, -8484=>754,8485=>578,8486=>850,8487=>850,8488=>763,8489=>338,8490=>775,8491=>774,8492=>928,8493=>818, -8494=>854,8495=>636,8496=>729,8497=>808,8498=>683,8499=>1184,8500=>465,8501=>794,8502=>731,8503=>494, -8504=>684,8505=>380,8506=>945,8507=>1348,8508=>790,8509=>737,8510=>654,8511=>863,8512=>840,8513=>775, -8514=>557,8515=>637,8516=>760,8517=>830,8518=>716,8519=>678,8520=>343,8521=>343,8523=>872,8526=>547, -8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035,8537=>1035,8538=>1035,8539=>1035,8540=>1035, -8541=>1035,8542=>1035,8543=>615,8544=>372,8545=>659,8546=>945,8547=>1099,8548=>774,8549=>1099,8550=>1386, -8551=>1672,8552=>1121,8553=>771,8554=>1120,8555=>1407,8556=>637,8557=>734,8558=>830,8559=>995,8560=>343, -8561=>607,8562=>872,8563=>984,8564=>652,8565=>962,8566=>1227,8567=>1491,8568=>969,8569=>645,8570=>969, -8571=>1233,8572=>343,8573=>593,8574=>716,8575=>1042,8576=>1289,8577=>830,8578=>1289,8579=>734,8580=>593, -8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838, -8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838, -8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838, -8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838, -8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838, -8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838, -8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838, -8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838, -8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838, -8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838, -8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838, -8702=>838,8703=>838,8704=>774,8705=>696,8706=>544,8707=>683,8708=>683,8709=>856,8710=>697,8711=>697, -8712=>896,8713=>896,8714=>750,8715=>896,8716=>896,8717=>750,8718=>636,8719=>787,8720=>787,8721=>718, -8722=>838,8723=>838,8724=>696,8725=>365,8726=>696,8727=>838,8728=>626,8729=>380,8730=>667,8731=>667, -8732=>667,8733=>712,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500, -8742=>500,8743=>812,8744=>812,8745=>812,8746=>812,8747=>610,8748=>929,8749=>1295,8750=>563,8751=>977, -8752=>1313,8753=>563,8754=>563,8755=>563,8756=>696,8757=>696,8758=>294,8759=>696,8760=>838,8761=>838, -8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838, -8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838, -8782=>838,8783=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1063,8789=>1063,8790=>838,8791=>838, -8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838, -8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>841,8809=>841,8810=>1047,8811=>1047, -8812=>500,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838, -8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838, -8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838, -8842=>838,8843=>838,8844=>812,8845=>812,8846=>812,8847=>838,8848=>838,8849=>838,8850=>838,8851=>796, -8852=>796,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838, -8862=>838,8863=>838,8864=>838,8865=>838,8866=>914,8867=>914,8868=>914,8869=>914,8870=>542,8871=>542, -8872=>914,8873=>914,8874=>914,8875=>914,8876=>914,8877=>914,8878=>914,8879=>914,8880=>838,8881=>838, -8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>542,8891=>812, -8892=>812,8893=>812,8894=>838,8895=>838,8896=>843,8897=>843,8898=>843,8899=>843,8900=>494,8901=>380, -8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>812,8911=>812, -8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422, -8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838, -8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838, -8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1158,8947=>896,8948=>750,8949=>896,8950=>896,8951=>750, -8952=>896,8953=>896,8954=>1158,8955=>896,8956=>750,8957=>896,8958=>750,8959=>896,8960=>602,8961=>602, -8962=>716,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>457,8969=>457,8970=>457,8971=>457, -8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>539,8984=>928,8985=>838,8988=>469,8989=>469, -8990=>469,8991=>469,8992=>610,8993=>610,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414, -9004=>873,9075=>390,9076=>716,9077=>869,9082=>687,9085=>863,9095=>1152,9108=>873,9115=>500,9116=>500, -9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500, -9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>610,9166=>838,9167=>945, -9187=>873,9189=>769,9250=>716,9251=>716,9312=>847,9313=>847,9314=>847,9315=>847,9316=>847,9317=>847, -9318=>847,9319=>847,9320=>847,9321=>847,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769, -9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769, -9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769, -9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945, -9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945, -9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769, -9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769, -9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873, -9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873, -9686=>527,9687=>527,9688=>840,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387, -9696=>769,9697=>769,9698=>769,9699=>769,9700=>769,9701=>769,9702=>639,9703=>945,9704=>945,9705=>945, -9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945, -9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732, -9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573, -9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896, -9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896, -9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746, -9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896, -9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>896, -9786=>896,9787=>896,9788=>896,9789=>896,9790=>896,9791=>614,9792=>731,9793=>731,9794=>896,9795=>896, -9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896, -9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896, -9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896, -9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896, -9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896, -9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896, -9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896, -9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896, -9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896, -9889=>702,9890=>1003,9891=>1085,9892=>1143,9893=>901,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838, -9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>731,9907=>732,9908=>732, -9909=>732,9910=>850,9911=>732,9912=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838, -9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838, -10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838, -10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838, -10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838, -10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838, -10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838, -10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896, -10070=>896,10072=>838,10073=>838,10074=>838,10075=>347,10076=>347,10077=>587,10078=>587,10081=>838,10082=>838, -10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838, -10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>847, -10103=>847,10104=>847,10105=>847,10106=>847,10107=>847,10108=>847,10109=>847,10110=>847,10111=>847,10112=>838, -10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838, -10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838, -10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838, -10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838, -10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838, -10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>457,10182=>457, -10208=>494,10214=>487,10215=>487,10216=>457,10217=>457,10218=>721,10219=>721,10224=>838,10225=>838,10226=>838, -10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434, -10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781,10245=>781,10246=>781, -10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781,10255=>781,10256=>781, -10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781,10265=>781,10266=>781, -10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781,10275=>781,10276=>781, -10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781,10285=>781,10286=>781, -10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781,10295=>781,10296=>781, -10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781,10305=>781,10306=>781, -10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781,10315=>781,10316=>781, -10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781,10325=>781,10326=>781, -10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781,10335=>781,10336=>781, -10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781,10345=>781,10346=>781, -10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781,10355=>781,10356=>781, -10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781,10365=>781,10366=>781, -10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781,10375=>781,10376=>781, -10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781,10385=>781,10386=>781, -10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781,10395=>781,10396=>781, -10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781,10405=>781,10406=>781, -10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781,10415=>781,10416=>781, -10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781,10425=>781,10426=>781, -10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781,10435=>781,10436=>781, -10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781,10445=>781,10446=>781, -10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781,10455=>781,10456=>781, -10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781,10465=>781,10466=>781, -10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781,10475=>781,10476=>781, -10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781,10485=>781,10486=>781, -10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781,10495=>781,10502=>838, -10503=>838,10506=>838,10507=>838,10560=>838,10561=>838,10627=>753,10628=>753,10702=>838,10703=>1046,10704=>1046, -10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000, -10754=>1000,10764=>1661,10765=>563,10766=>563,10767=>563,10768=>563,10769=>563,10770=>563,10771=>563,10772=>563, -10773=>563,10774=>563,10775=>563,10776=>563,10777=>563,10778=>563,10779=>563,10780=>563,10799=>838,10877=>838, -10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838, -10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838, -10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838, -10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838, -10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838, -11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838, -11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838,11026=>945,11027=>945, -11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873, -11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>637,11361=>360,11362=>637,11363=>733,11364=>770, -11365=>675,11366=>478,11367=>956,11368=>712,11369=>775,11370=>665,11371=>725,11372=>582,11373=>860,11374=>995, -11375=>774,11377=>778,11378=>1221,11379=>1056,11380=>652,11381=>698,11382=>565,11383=>782,11385=>538,11386=>687, -11387=>559,11388=>219,11389=>487,11568=>691,11569=>941,11570=>941,11571=>725,11572=>725,11573=>725,11574=>676, -11575=>774,11576=>774,11577=>683,11578=>683,11579=>802,11580=>989,11581=>761,11582=>623,11583=>761,11584=>941, -11585=>941,11586=>373,11587=>740,11588=>837,11589=>914,11590=>672,11591=>737,11592=>680,11593=>683,11594=>602, -11595=>1039,11596=>778,11597=>837,11598=>683,11599=>372,11600=>778,11601=>373,11602=>725,11603=>691,11604=>941, -11605=>941,11606=>837,11607=>373,11608=>836,11609=>941,11610=>941,11611=>734,11612=>876,11613=>771,11614=>734, -11615=>683,11616=>774,11617=>837,11618=>683,11619=>850,11620=>697,11621=>850,11631=>716,11800=>580,11810=>457, -11811=>457,11812=>457,11813=>457,11822=>580,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896, -19910=>896,19911=>896,19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896, -19920=>896,19921=>896,19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896, -19930=>896,19931=>896,19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896, -19940=>896,19941=>896,19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896, -19950=>896,19951=>896,19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896, -19960=>896,19961=>896,19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42564=>720,42565=>595, -42566=>436,42567=>440,42572=>1405,42573=>1173,42576=>1234,42577=>1027,42580=>1174,42581=>972,42582=>1093,42583=>958, -42594=>1085,42595=>924,42596=>1096,42597=>912,42598=>1260,42599=>997,42600=>850,42601=>687,42602=>1037,42603=>868, -42604=>1406,42605=>1106,42606=>961,42634=>963,42635=>787,42636=>682,42637=>580,42644=>808,42645=>712,42760=>500, -42761=>500,42762=>500,42763=>500,42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500, -42771=>500,42772=>500,42773=>500,42774=>500,42779=>400,42780=>400,42781=>287,42782=>287,42783=>287,42790=>837, -42791=>712,42792=>1031,42793=>857,42794=>696,42795=>557,42800=>559,42801=>595,42802=>1349,42803=>1052,42804=>1284, -42805=>1064,42806=>1216,42807=>1054,42808=>1079,42809=>922,42810=>1079,42811=>922,42812=>1035,42813=>922,42814=>698, -42815=>549,42822=>850,42823=>542,42824=>683,42825=>531,42826=>918,42827=>814,42830=>1406,42831=>1106,42880=>637, -42881=>343,42882=>837,42883=>712,42889=>400,42890=>386,42891=>456,42892=>306,43003=>683,43004=>733,43005=>995, -43006=>372,43007=>1325,63173=>687,64256=>810,64257=>741,64258=>741,64259=>1115,64260=>1116,64261=>808,64262=>1020, -64275=>1388,64276=>1384,64277=>1378,64278=>1384,64279=>1713,64285=>343,64286=>0,64287=>663,64288=>720,64289=>963, -64290=>890,64291=>988,64292=>963,64293=>938,64294=>988,64295=>988,64296=>976,64297=>838,64298=>949,64299=>949, -64300=>949,64301=>949,64302=>751,64303=>751,64304=>751,64305=>673,64306=>537,64307=>654,64308=>712,64309=>438, -64310=>491,64312=>724,64313=>438,64314=>649,64315=>650,64316=>679,64318=>775,64320=>497,64321=>773,64323=>718, -64324=>687,64326=>751,64327=>729,64328=>649,64329=>949,64330=>751,64331=>343,64332=>673,64333=>650,64334=>687, -64335=>751,64338=>1005,64339=>1059,64340=>375,64341=>408,64342=>1005,64343=>1059,64344=>375,64345=>408,64346=>1005, -64347=>1059,64348=>375,64349=>408,64350=>1005,64351=>1059,64352=>375,64353=>408,64354=>1005,64355=>1059,64356=>375, -64357=>408,64358=>1005,64359=>1059,64360=>375,64361=>408,64362=>1162,64363=>1191,64364=>655,64365=>720,64366=>1162, -64367=>1191,64368=>655,64369=>720,64370=>721,64371=>721,64372=>721,64373=>721,64374=>721,64375=>721,64376=>721, -64377=>721,64378=>721,64379=>721,64380=>721,64381=>721,64382=>721,64383=>721,64384=>721,64385=>721,64394=>576, -64395=>622,64396=>576,64397=>622,64398=>1024,64399=>1024,64400=>582,64401=>582,64402=>1024,64403=>1024,64404=>582, -64405=>582,64414=>854,64415=>900,64473=>622,64474=>627,64488=>375,64489=>408,64508=>917,64509=>1012,64510=>375, -64511=>408,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0, -65059=>0,65136=>342,65137=>342,65138=>342,65139=>346,65140=>342,65142=>342,65143=>342,65144=>342,65145=>342, -65146=>342,65147=>342,65148=>342,65149=>342,65150=>342,65151=>342,65152=>511,65153=>343,65154=>375,65155=>343, -65156=>375,65157=>622,65158=>627,65159=>343,65160=>375,65161=>917,65162=>917,65163=>375,65164=>408,65165=>343, -65166=>375,65167=>1005,65168=>1059,65169=>375,65170=>408,65171=>590,65172=>606,65173=>1005,65174=>1059,65175=>375, -65176=>408,65177=>1005,65178=>1059,65179=>375,65180=>408,65181=>721,65182=>721,65183=>721,65184=>721,65185=>721, -65186=>721,65187=>721,65188=>721,65189=>721,65190=>721,65191=>721,65192=>721,65193=>513,65194=>578,65195=>513, -65196=>578,65197=>576,65198=>622,65199=>576,65200=>622,65201=>1380,65202=>1414,65203=>983,65204=>1018,65205=>1380, -65206=>1414,65207=>983,65208=>1018,65209=>1345,65210=>1364,65211=>966,65212=>985,65213=>1345,65214=>1364,65215=>966, -65216=>985,65217=>1039,65218=>1071,65219=>942,65220=>974,65221=>1039,65222=>1071,65223=>942,65224=>974,65225=>683, -65226=>683,65227=>683,65228=>564,65229=>683,65230=>683,65231=>683,65232=>564,65233=>1162,65234=>1191,65235=>655, -65236=>720,65237=>894,65238=>901,65239=>655,65240=>720,65241=>917,65242=>931,65243=>582,65244=>582,65245=>868, -65246=>893,65247=>375,65248=>408,65249=>733,65250=>784,65251=>619,65252=>670,65253=>854,65254=>900,65255=>375, -65256=>408,65257=>590,65258=>606,65259=>693,65260=>660,65261=>622,65262=>627,65263=>917,65264=>1012,65265=>917, -65266=>1012,65267=>375,65268=>408,65269=>745,65270=>759,65271=>745,65272=>759,65273=>745,65274=>759,65275=>745, -65276=>759,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1113); -$enc=''; -$diff=''; -$file='dejavusansb.z'; -$ctg='dejavusansb.ctg.z'; -$originalsize=573136; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.z deleted file mode 100644 index 9d465a6ec8..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.ctg.z deleted file mode 100644 index 9d1fcd61c8..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.php deleted file mode 100644 index 0c68378d44..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.php +++ /dev/null @@ -1,458 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSans-BoldOblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-51,'Flags'=>96,'FontBBox'=>'[-1067 -385 2005 1121]','ItalicAngle'=>-11,'StemV'=>120,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>348,33=>456,34=>521,35=>696,36=>696,37=>1002,38=>872,39=>306,40=>457, -41=>457,42=>523,43=>838,44=>380,45=>415,46=>380,47=>365,48=>696,49=>696,50=>696, -51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>400,59=>400,60=>838, -61=>838,62=>838,63=>580,64=>1000,65=>774,66=>762,67=>734,68=>830,69=>683,70=>683, -71=>821,72=>837,73=>372,74=>372,75=>775,76=>637,77=>995,78=>837,79=>850,80=>733, -81=>850,82=>770,83=>720,84=>682,85=>812,86=>774,87=>1103,88=>771,89=>724,90=>725, -91=>457,92=>365,93=>457,94=>838,95=>500,96=>500,97=>675,98=>716,99=>593,100=>716, -101=>678,102=>435,103=>716,104=>712,105=>343,106=>343,107=>665,108=>343,109=>1042,110=>712, -111=>687,112=>716,113=>716,114=>493,115=>595,116=>478,117=>712,118=>652,119=>924,120=>645, -121=>652,122=>582,123=>712,124=>365,125=>712,126=>838,8364=>696,8218=>380,402=>435,8222=>644, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1454,352=>720,8249=>412,338=>1167,381=>725,8216=>380, -8217=>380,8220=>644,8221=>644,8226=>639,8211=>500,8212=>1000,732=>500,8482=>1000,353=>595,8250=>412, -339=>1094,382=>582,376=>724,160=>348,161=>456,162=>696,163=>696,164=>636,165=>696,166=>365, -167=>500,168=>500,169=>1000,170=>564,171=>650,172=>838,173=>415,174=>1000,175=>500,176=>500, -177=>838,178=>438,179=>438,180=>500,181=>736,182=>636,183=>380,184=>500,185=>438,186=>564, -187=>650,188=>1035,189=>1035,190=>1035,191=>580,192=>774,193=>774,194=>774,195=>774,196=>774, -197=>774,198=>1085,199=>734,200=>683,201=>683,202=>683,203=>683,204=>372,205=>372,206=>372, -207=>372,208=>845,209=>837,210=>850,211=>850,212=>850,213=>850,214=>850,215=>838,216=>850, -217=>812,218=>812,219=>812,220=>812,221=>724,222=>742,223=>719,224=>675,225=>675,226=>675, -227=>675,228=>675,229=>675,230=>1048,231=>593,232=>678,233=>678,234=>678,235=>678,236=>343, -237=>343,238=>343,239=>343,240=>687,241=>712,242=>687,243=>687,244=>687,245=>687,246=>687, -247=>838,248=>687,249=>712,250=>712,251=>712,252=>712,253=>652,254=>716,255=>652,256=>774, -257=>675,258=>774,259=>675,260=>774,261=>675,262=>734,263=>593,264=>734,265=>593,266=>734, -267=>593,268=>734,269=>593,270=>830,271=>716,272=>845,273=>716,274=>683,275=>678,276=>683, -277=>678,278=>683,279=>678,280=>683,281=>678,282=>683,283=>678,284=>821,285=>716,286=>821, -287=>716,288=>821,289=>716,290=>821,291=>716,292=>837,293=>712,294=>974,295=>790,296=>372, -297=>343,298=>372,299=>343,300=>372,301=>343,302=>372,303=>343,304=>372,305=>343,306=>744, -307=>686,308=>372,309=>343,310=>775,311=>665,312=>665,313=>637,314=>343,315=>637,316=>343, -317=>637,318=>343,319=>637,320=>343,321=>660,322=>375,323=>837,324=>712,325=>837,326=>712, -327=>837,328=>712,329=>983,330=>837,331=>712,332=>850,333=>687,334=>850,335=>687,336=>850, -337=>687,340=>770,341=>493,342=>770,343=>493,344=>770,345=>493,346=>720,347=>595,348=>720, -349=>595,350=>720,351=>595,354=>682,355=>478,356=>682,357=>478,358=>682,359=>478,360=>812, -361=>712,362=>812,363=>712,364=>812,365=>712,366=>812,367=>712,368=>812,369=>712,370=>812, -371=>712,372=>1103,373=>924,374=>724,375=>652,377=>725,378=>582,379=>725,380=>582,383=>435, -384=>716,385=>811,386=>762,387=>716,388=>762,389=>716,390=>734,391=>734,392=>593,393=>845, -394=>879,395=>762,396=>716,397=>687,398=>683,399=>850,400=>696,401=>683,403=>821,404=>793, -405=>1045,406=>436,407=>389,408=>775,409=>665,410=>360,411=>592,412=>1042,413=>837,414=>712, -415=>850,416=>850,417=>687,418=>1114,419=>962,420=>782,421=>716,422=>770,423=>720,424=>595, -425=>683,426=>552,427=>478,428=>707,429=>478,430=>682,431=>812,432=>712,433=>769,434=>813, -435=>797,436=>778,437=>725,438=>582,439=>772,440=>772,441=>641,442=>582,443=>696,444=>772, -445=>641,446=>573,447=>716,448=>372,449=>659,450=>544,451=>372,452=>1548,453=>1450,454=>1307, -455=>977,456=>979,457=>670,458=>1193,459=>1213,460=>1063,461=>774,462=>675,463=>372,464=>343, -465=>850,466=>687,467=>812,468=>712,469=>812,470=>712,471=>812,472=>712,473=>812,474=>712, -475=>812,476=>712,477=>678,478=>774,479=>675,480=>774,481=>675,482=>1085,483=>1048,484=>821, -485=>716,486=>821,487=>716,488=>775,489=>665,490=>850,491=>687,492=>850,493=>687,494=>772, -495=>582,496=>343,497=>1548,498=>1450,499=>1307,500=>821,501=>716,502=>1289,503=>787,504=>837, -505=>712,506=>774,507=>675,508=>1085,509=>1048,510=>850,511=>687,512=>774,513=>675,514=>774, -515=>675,516=>683,517=>678,518=>683,519=>678,520=>372,521=>343,522=>372,523=>343,524=>850, -525=>687,526=>850,527=>687,528=>770,529=>493,530=>770,531=>493,532=>812,533=>712,534=>812, -535=>712,536=>720,537=>595,538=>682,539=>478,540=>690,541=>607,542=>837,543=>712,544=>837, -545=>865,546=>809,547=>659,548=>725,549=>582,550=>774,551=>675,552=>683,553=>678,554=>850, -555=>687,556=>850,557=>687,558=>850,559=>687,560=>850,561=>687,562=>724,563=>652,564=>492, -565=>867,566=>512,567=>343,568=>1088,569=>1088,570=>774,571=>734,572=>593,573=>637,574=>682, -575=>595,576=>582,577=>782,578=>614,579=>762,580=>812,581=>774,582=>683,583=>678,584=>372, -585=>343,586=>860,587=>791,588=>770,589=>493,590=>724,591=>652,592=>675,593=>716,594=>716, -595=>716,596=>593,597=>593,598=>791,599=>792,600=>678,601=>678,602=>876,603=>557,604=>545, -605=>774,606=>731,607=>343,608=>792,609=>716,610=>627,611=>735,612=>635,613=>712,614=>712, -615=>712,616=>545,617=>440,618=>545,619=>559,620=>693,621=>343,622=>841,623=>1042,624=>1042, -625=>1042,626=>712,627=>793,628=>642,629=>687,630=>909,631=>682,632=>796,633=>538,634=>538, -635=>650,636=>493,637=>493,638=>596,639=>596,640=>642,641=>642,642=>595,643=>415,644=>435, -645=>605,646=>552,647=>478,648=>478,649=>920,650=>769,651=>670,652=>652,653=>924,654=>652, -655=>724,656=>694,657=>684,658=>641,659=>641,660=>573,661=>573,662=>573,663=>573,664=>850, -665=>633,666=>731,667=>685,668=>691,669=>343,670=>732,671=>539,672=>792,673=>573,674=>573, -675=>1156,676=>1214,677=>1155,678=>974,679=>769,680=>929,681=>1026,682=>792,683=>780,684=>591, -685=>415,686=>677,687=>789,688=>456,689=>456,690=>219,691=>315,692=>315,693=>315,694=>411, -695=>591,696=>417,697=>302,698=>521,699=>380,700=>380,701=>380,702=>366,703=>366,704=>326, -705=>326,706=>500,707=>500,708=>500,709=>500,711=>500,712=>306,713=>500,714=>500,715=>500, -716=>306,717=>500,718=>500,719=>500,720=>337,721=>337,722=>366,723=>366,724=>500,725=>500, -726=>416,727=>328,728=>500,729=>500,730=>500,731=>500,733=>500,734=>351,735=>500,736=>412, -737=>219,738=>381,739=>413,740=>326,741=>500,742=>500,743=>500,744=>500,745=>500,748=>500, -749=>500,750=>644,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>698,881=>565,882=>1022, -883=>836,884=>302,885=>302,886=>837,887=>701,890=>500,891=>593,892=>550,893=>549,894=>400, -900=>441,901=>500,902=>797,903=>380,904=>846,905=>1009,906=>563,908=>891,910=>980,911=>894, -912=>390,913=>774,914=>762,915=>637,916=>774,917=>683,918=>725,919=>837,920=>850,921=>372, -922=>775,923=>774,924=>995,925=>837,926=>632,927=>850,928=>837,929=>733,931=>683,932=>682, -933=>724,934=>850,935=>771,936=>850,937=>850,938=>372,939=>724,940=>687,941=>557,942=>712, -943=>390,944=>675,945=>687,946=>716,947=>681,948=>687,949=>557,950=>591,951=>712,952=>687, -953=>390,954=>710,955=>633,956=>736,957=>681,958=>591,959=>687,960=>791,961=>716,962=>593, -963=>779,964=>638,965=>675,966=>782,967=>645,968=>794,969=>869,970=>390,971=>675,972=>687, -973=>675,974=>869,975=>775,976=>651,977=>661,978=>746,979=>981,980=>746,981=>796,982=>869, -983=>744,984=>850,985=>687,986=>734,987=>593,988=>683,989=>494,990=>702,991=>660,992=>919, -993=>627,994=>1093,995=>837,996=>832,997=>716,998=>928,999=>744,1000=>733,1001=>650,1002=>789, -1003=>671,1004=>752,1005=>716,1006=>682,1007=>590,1008=>744,1009=>716,1010=>593,1011=>343,1012=>850, -1013=>645,1014=>645,1015=>742,1016=>716,1017=>734,1018=>995,1019=>732,1020=>716,1021=>734,1022=>734, -1023=>698,1024=>683,1025=>683,1026=>878,1027=>637,1028=>734,1029=>720,1030=>372,1031=>372,1032=>372, -1033=>1154,1034=>1130,1035=>878,1036=>817,1037=>837,1038=>771,1039=>837,1040=>774,1041=>762,1042=>762, -1043=>637,1044=>891,1045=>683,1046=>1224,1047=>710,1048=>837,1049=>837,1050=>817,1051=>831,1052=>995, -1053=>837,1054=>850,1055=>837,1056=>733,1057=>734,1058=>682,1059=>771,1060=>992,1061=>771,1062=>928, -1063=>808,1064=>1235,1065=>1326,1066=>939,1067=>1036,1068=>762,1069=>734,1070=>1174,1071=>770,1072=>675, -1073=>698,1074=>633,1075=>522,1076=>808,1077=>678,1078=>995,1079=>581,1080=>701,1081=>701,1082=>679, -1083=>732,1084=>817,1085=>691,1086=>687,1087=>691,1088=>716,1089=>593,1090=>580,1091=>652,1092=>992, -1093=>645,1094=>741,1095=>687,1096=>1062,1097=>1105,1098=>751,1099=>904,1100=>632,1101=>593,1102=>972, -1103=>642,1104=>678,1105=>678,1106=>714,1107=>522,1108=>593,1109=>595,1110=>343,1111=>343,1112=>343, -1113=>991,1114=>956,1115=>734,1116=>679,1117=>701,1118=>652,1119=>691,1120=>1093,1121=>869,1122=>840, -1123=>736,1124=>1012,1125=>839,1126=>992,1127=>832,1128=>1358,1129=>1121,1130=>850,1131=>687,1132=>1236, -1133=>1007,1134=>696,1135=>557,1136=>1075,1137=>1061,1138=>850,1139=>687,1140=>850,1141=>695,1142=>850, -1143=>695,1144=>1148,1145=>1043,1146=>1074,1147=>863,1148=>1405,1149=>1173,1150=>1093,1151=>869,1152=>734, -1153=>593,1154=>652,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>938, -1163=>806,1164=>762,1165=>611,1166=>736,1167=>718,1168=>637,1169=>522,1170=>666,1171=>543,1172=>789, -1173=>522,1174=>1224,1175=>995,1176=>710,1177=>581,1178=>775,1179=>679,1180=>817,1181=>679,1182=>817, -1183=>679,1184=>1015,1185=>826,1186=>837,1187=>691,1188=>1103,1189=>871,1190=>1254,1191=>979,1192=>946, -1193=>859,1194=>734,1195=>593,1196=>682,1197=>580,1198=>724,1199=>652,1200=>724,1201=>652,1202=>771, -1203=>645,1204=>1104,1205=>1001,1206=>808,1207=>687,1208=>808,1209=>687,1210=>808,1211=>712,1212=>1026, -1213=>810,1214=>1026,1215=>810,1216=>372,1217=>1224,1218=>995,1219=>778,1220=>629,1221=>933,1222=>804, -1223=>837,1224=>691,1225=>938,1226=>806,1227=>808,1228=>687,1229=>1096,1230=>932,1231=>343,1232=>774, -1233=>675,1234=>774,1235=>675,1236=>1085,1237=>1048,1238=>683,1239=>678,1240=>850,1241=>678,1242=>850, -1243=>678,1244=>1224,1245=>995,1246=>710,1247=>581,1248=>772,1249=>641,1250=>837,1251=>701,1252=>837, -1253=>701,1254=>850,1255=>687,1256=>850,1257=>687,1258=>850,1259=>687,1260=>734,1261=>593,1262=>771, -1263=>652,1264=>771,1265=>652,1266=>771,1267=>652,1268=>808,1269=>687,1270=>637,1271=>522,1272=>1036, -1273=>904,1274=>666,1275=>543,1276=>771,1277=>645,1278=>771,1279=>645,1280=>762,1281=>608,1282=>1159, -1283=>893,1284=>1119,1285=>920,1286=>828,1287=>693,1288=>1242,1289=>1017,1290=>1289,1291=>1013,1292=>839, -1293=>638,1294=>938,1295=>803,1296=>696,1297=>557,1298=>831,1299=>732,1300=>1286,1301=>1070,1302=>1065, -1303=>982,1304=>1082,1305=>960,1306=>850,1307=>716,1308=>1103,1309=>924,1312=>1248,1313=>1022,1314=>1254, -1315=>979,1316=>957,1317=>807,1329=>984,1330=>812,1331=>984,1332=>984,1333=>812,1334=>777,1335=>812, -1336=>812,1337=>975,1338=>984,1339=>812,1340=>710,1341=>1078,1342=>1136,1343=>812,1344=>710,1345=>757, -1346=>984,1347=>876,1348=>984,1349=>793,1350=>984,1351=>812,1352=>812,1353=>812,1354=>958,1355=>777, -1356=>984,1357=>812,1358=>984,1359=>720,1360=>812,1361=>793,1362=>895,1363=>850,1364=>936,1365=>850, -1366=>720,1369=>366,1370=>380,1371=>550,1372=>550,1373=>380,1374=>546,1375=>521,1377=>1042,1378=>712, -1379=>866,1380=>868,1381=>712,1382=>817,1383=>653,1384=>712,1385=>811,1386=>817,1387=>712,1388=>498, -1389=>1018,1390=>716,1391=>712,1392=>712,1393=>716,1394=>819,1395=>712,1396=>751,1397=>343,1398=>882, -1399=>559,1400=>712,1401=>559,1402=>1042,1403=>559,1404=>863,1405=>712,1406=>813,1407=>1042,1408=>712, -1409=>716,1410=>571,1411=>1042,1412=>778,1413=>687,1414=>720,1415=>862,1417=>400,1418=>487,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>415,1471=>0,1472=>372,1473=>0,1474=>0,1475=>372,1478=>497, -1479=>0,1488=>751,1489=>673,1490=>537,1491=>654,1492=>712,1493=>343,1494=>491,1495=>712,1496=>724, -1497=>343,1498=>649,1499=>650,1500=>679,1501=>712,1502=>775,1503=>343,1504=>497,1505=>773,1506=>678, -1507=>718,1508=>687,1509=>628,1510=>751,1511=>729,1512=>649,1513=>949,1514=>751,1520=>664,1521=>664, -1522=>663,1523=>444,1524=>710,3647=>743,3713=>815,3714=>748,3716=>749,3719=>569,3720=>742,3722=>744, -3725=>761,3732=>706,3733=>704,3734=>747,3735=>819,3737=>730,3738=>727,3739=>727,3740=>922,3741=>827, -3742=>866,3743=>866,3745=>836,3746=>761,3747=>770,3749=>769,3751=>713,3754=>827,3755=>1031,3757=>724, -3758=>784,3759=>934,3760=>688,3761=>0,3762=>610,3763=>610,3764=>0,3765=>0,3766=>0,3767=>0, -3768=>0,3769=>0,3771=>0,3772=>0,3773=>670,3776=>516,3777=>860,3778=>516,3779=>650,3780=>632, -3782=>759,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>771,3793=>771,3794=>693, -3795=>836,3796=>729,3797=>729,3798=>849,3799=>790,3800=>759,3801=>910,3804=>1363,3805=>1363,4256=>918, -4257=>744,4258=>739,4259=>837,4260=>649,4261=>773,4262=>857,4263=>889,4264=>530,4265=>633,4266=>857, -4267=>900,4268=>643,4269=>903,4270=>814,4271=>752,4272=>869,4273=>643,4274=>643,4275=>886,4276=>886, -4277=>733,4278=>653,4279=>643,4280=>646,4281=>643,4282=>790,4283=>902,4284=>633,4285=>619,4286=>643, -4287=>778,4288=>892,4289=>601,4290=>742,4291=>616,4292=>633,4293=>742,4304=>553,4305=>552,4306=>596, -4307=>815,4308=>562,4309=>563,4310=>553,4311=>827,4312=>553,4313=>543,4314=>1074,4315=>563,4316=>563, -4317=>812,4318=>552,4319=>591,4320=>822,4321=>563,4322=>690,4323=>583,4324=>813,4325=>562,4326=>813, -4327=>563,4328=>563,4329=>563,4330=>632,4331=>563,4332=>563,4333=>552,4334=>563,4335=>563,4336=>558, -4337=>604,4338=>552,4339=>552,4340=>553,4341=>605,4342=>852,4343=>635,4344=>563,4345=>596,4346=>542, -4347=>684,4348=>368,5121=>774,5122=>774,5123=>774,5124=>774,5125=>905,5126=>905,5127=>905,5129=>905, -5130=>905,5131=>905,5132=>1018,5133=>1009,5134=>1018,5135=>1009,5136=>1018,5137=>1009,5138=>1149,5139=>1140, -5140=>1149,5141=>1140,5142=>905,5143=>1149,5144=>1142,5145=>1149,5146=>1142,5147=>905,5149=>310,5150=>529, -5151=>425,5152=>425,5153=>395,5154=>395,5155=>395,5156=>395,5157=>564,5158=>470,5159=>310,5160=>395, -5161=>395,5162=>395,5163=>1213,5164=>986,5165=>1216,5166=>1297,5167=>774,5168=>774,5169=>774,5170=>774, -5171=>886,5172=>886,5173=>886,5175=>886,5176=>886,5177=>886,5178=>1018,5179=>1009,5180=>1018,5181=>1009, -5182=>1018,5183=>1009,5184=>1149,5185=>1140,5186=>1149,5187=>1140,5188=>1149,5189=>1142,5190=>1149,5191=>1142, -5192=>886,5193=>576,5194=>229,5196=>812,5197=>812,5198=>812,5199=>812,5200=>815,5201=>815,5202=>815, -5204=>815,5205=>815,5206=>815,5207=>1056,5208=>1048,5209=>1056,5210=>1048,5211=>1056,5212=>1048,5213=>1060, -5214=>1054,5215=>1060,5216=>1054,5217=>1060,5218=>1052,5219=>1060,5220=>1052,5221=>1060,5222=>483,5223=>1005, -5224=>1005,5225=>1023,5226=>1017,5227=>743,5228=>743,5229=>743,5230=>743,5231=>743,5232=>743,5233=>743, -5234=>743,5235=>743,5236=>1029,5237=>975,5238=>980,5239=>975,5240=>980,5241=>975,5242=>1029,5243=>975, -5244=>1029,5245=>975,5246=>980,5247=>975,5248=>980,5249=>975,5250=>980,5251=>501,5252=>501,5253=>938, -5254=>938,5255=>938,5256=>938,5257=>743,5258=>743,5259=>743,5260=>743,5261=>743,5262=>743,5263=>743, -5264=>743,5265=>743,5266=>1029,5267=>975,5268=>1029,5269=>975,5270=>1029,5271=>975,5272=>1029,5273=>975, -5274=>1029,5275=>975,5276=>1029,5277=>975,5278=>1029,5279=>975,5280=>1029,5281=>501,5282=>501,5283=>626, -5284=>626,5285=>626,5286=>626,5287=>626,5288=>626,5289=>626,5290=>626,5291=>626,5292=>881,5293=>854, -5294=>863,5295=>874,5296=>863,5297=>874,5298=>881,5299=>874,5300=>881,5301=>874,5302=>863,5303=>874, -5304=>863,5305=>874,5306=>863,5307=>436,5308=>548,5309=>436,5312=>988,5313=>988,5314=>988,5315=>988, -5316=>931,5317=>931,5318=>931,5319=>931,5320=>931,5321=>1238,5322=>1247,5323=>1200,5324=>1228,5325=>1200, -5326=>1228,5327=>931,5328=>660,5329=>497,5330=>660,5331=>988,5332=>988,5333=>988,5334=>988,5335=>931, -5336=>931,5337=>931,5338=>931,5339=>931,5340=>1231,5341=>1247,5342=>1283,5343=>1228,5344=>1283,5345=>1228, -5346=>1228,5347=>1214,5348=>1228,5349=>1214,5350=>1283,5351=>1228,5352=>1283,5353=>1228,5354=>660,5356=>886, -5357=>730,5358=>730,5359=>730,5360=>730,5361=>730,5362=>730,5363=>730,5364=>730,5365=>730,5366=>998, -5367=>958,5368=>967,5369=>989,5370=>967,5371=>989,5372=>998,5373=>958,5374=>998,5375=>958,5376=>967, -5377=>989,5378=>967,5379=>989,5380=>967,5381=>493,5382=>460,5383=>493,5392=>923,5393=>923,5394=>923, -5395=>1136,5396=>1136,5397=>1136,5398=>1136,5399=>1209,5400=>1202,5401=>1209,5402=>1202,5403=>1209,5404=>1202, -5405=>1431,5406=>1420,5407=>1431,5408=>1420,5409=>1431,5410=>1420,5411=>1431,5412=>1420,5413=>746,5414=>776, -5415=>776,5416=>776,5417=>776,5418=>776,5419=>776,5420=>776,5421=>776,5422=>776,5423=>1003,5424=>1003, -5425=>1013,5426=>996,5427=>1013,5428=>996,5429=>1003,5430=>1003,5431=>1003,5432=>1003,5433=>1013,5434=>996, -5435=>1013,5436=>996,5437=>1013,5438=>495,5440=>395,5441=>510,5442=>1033,5443=>1033,5444=>976,5445=>976, -5446=>976,5447=>976,5448=>733,5449=>733,5450=>733,5451=>733,5452=>733,5453=>733,5454=>1003,5455=>959, -5456=>495,5458=>886,5459=>774,5460=>774,5461=>774,5462=>774,5463=>928,5464=>928,5465=>928,5466=>928, -5467=>1172,5468=>1142,5469=>602,5470=>812,5471=>812,5472=>812,5473=>812,5474=>812,5475=>812,5476=>815, -5477=>815,5478=>815,5479=>815,5480=>1060,5481=>1052,5482=>548,5492=>977,5493=>977,5494=>977,5495=>977, -5496=>977,5497=>977,5498=>977,5499=>618,5500=>837,5501=>510,5502=>1238,5503=>1238,5504=>1238,5505=>1238, -5506=>1238,5507=>1238,5508=>1238,5509=>989,5514=>977,5515=>977,5516=>977,5517=>977,5518=>1591,5519=>1591, -5520=>1591,5521=>1295,5522=>1295,5523=>1591,5524=>1591,5525=>848,5526=>1273,5536=>988,5537=>988,5538=>931, -5539=>931,5540=>931,5541=>931,5542=>660,5543=>776,5544=>776,5545=>776,5546=>776,5547=>776,5548=>776, -5549=>776,5550=>495,5551=>743,5598=>830,5601=>830,5702=>496,5703=>496,5742=>413,5743=>1238,5744=>1591, -5745=>2016,5746=>2016,5747=>1720,5748=>1678,5749=>2016,5750=>2016,7424=>652,7425=>833,7426=>1048,7427=>608, -7428=>593,7429=>676,7430=>676,7431=>559,7432=>557,7433=>343,7434=>494,7435=>665,7436=>539,7437=>817, -7438=>701,7439=>687,7440=>593,7441=>660,7442=>660,7443=>660,7444=>1094,7446=>687,7447=>687,7448=>556, -7449=>642,7450=>642,7451=>580,7452=>634,7453=>737,7454=>948,7455=>695,7456=>652,7457=>924,7458=>582, -7459=>646,7462=>539,7463=>652,7464=>691,7465=>556,7466=>781,7467=>732,7468=>487,7469=>683,7470=>480, -7472=>523,7473=>430,7474=>430,7475=>517,7476=>527,7477=>234,7478=>234,7479=>488,7480=>401,7481=>626, -7482=>527,7483=>527,7484=>535,7485=>509,7486=>461,7487=>485,7488=>430,7489=>511,7490=>695,7491=>458, -7492=>458,7493=>479,7494=>712,7495=>479,7496=>479,7497=>479,7498=>479,7499=>386,7500=>386,7501=>479, -7502=>219,7503=>487,7504=>664,7505=>456,7506=>488,7507=>414,7508=>488,7509=>488,7510=>479,7511=>388, -7512=>456,7513=>462,7514=>664,7515=>501,7517=>451,7518=>429,7519=>433,7520=>493,7521=>406,7522=>219, -7523=>315,7524=>456,7525=>501,7526=>451,7527=>429,7528=>451,7529=>493,7530=>406,7543=>716,7544=>527, -7547=>545,7557=>514,7579=>479,7580=>414,7581=>414,7582=>488,7583=>386,7584=>377,7585=>348,7586=>479, -7587=>456,7588=>347,7589=>281,7590=>347,7591=>347,7592=>431,7593=>326,7594=>330,7595=>370,7596=>664, -7597=>664,7598=>562,7599=>562,7600=>448,7601=>488,7602=>542,7603=>422,7604=>396,7605=>388,7606=>583, -7607=>494,7608=>399,7609=>451,7610=>501,7611=>417,7612=>523,7613=>470,7614=>455,7615=>425,7620=>0, -7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>774,7681=>675,7682=>762,7683=>716,7684=>762, -7685=>716,7686=>762,7687=>716,7688=>734,7689=>593,7690=>830,7691=>716,7692=>830,7693=>716,7694=>830, -7695=>716,7696=>830,7697=>716,7698=>830,7699=>716,7700=>683,7701=>678,7702=>683,7703=>678,7704=>683, -7705=>678,7706=>683,7707=>678,7708=>683,7709=>678,7710=>683,7711=>435,7712=>821,7713=>716,7714=>837, -7715=>712,7716=>837,7717=>712,7718=>837,7719=>712,7720=>837,7721=>712,7722=>837,7723=>712,7724=>372, -7725=>343,7726=>372,7727=>343,7728=>775,7729=>665,7730=>775,7731=>665,7732=>775,7733=>665,7734=>637, -7735=>343,7736=>637,7737=>343,7738=>637,7739=>343,7740=>637,7741=>343,7742=>995,7743=>1042,7744=>995, -7745=>1042,7746=>995,7747=>1042,7748=>837,7749=>712,7750=>837,7751=>712,7752=>837,7753=>712,7754=>837, -7755=>712,7756=>850,7757=>687,7758=>850,7759=>687,7760=>850,7761=>687,7762=>850,7763=>687,7764=>733, -7765=>716,7766=>733,7767=>716,7768=>770,7769=>493,7770=>770,7771=>493,7772=>770,7773=>493,7774=>770, -7775=>493,7776=>720,7777=>595,7778=>720,7779=>595,7780=>720,7781=>595,7782=>720,7783=>595,7784=>720, -7785=>595,7786=>682,7787=>478,7788=>682,7789=>478,7790=>682,7791=>478,7792=>682,7793=>478,7794=>812, -7795=>712,7796=>812,7797=>712,7798=>812,7799=>712,7800=>812,7801=>712,7802=>812,7803=>712,7804=>774, -7805=>652,7806=>774,7807=>652,7808=>1103,7809=>924,7810=>1103,7811=>924,7812=>1103,7813=>924,7814=>1103, -7815=>924,7816=>1103,7817=>924,7818=>771,7819=>645,7820=>771,7821=>645,7822=>724,7823=>652,7824=>725, -7825=>582,7826=>725,7827=>582,7828=>725,7829=>582,7830=>712,7831=>478,7832=>924,7833=>652,7834=>675, -7835=>435,7838=>896,7839=>687,7840=>774,7841=>675,7842=>774,7843=>675,7844=>774,7845=>675,7846=>774, -7847=>675,7848=>774,7849=>675,7850=>774,7851=>675,7852=>774,7853=>675,7854=>774,7855=>675,7856=>774, -7857=>675,7858=>774,7859=>675,7860=>774,7861=>675,7862=>774,7863=>675,7864=>683,7865=>678,7866=>683, -7867=>678,7868=>683,7869=>678,7870=>683,7871=>678,7872=>683,7873=>678,7874=>683,7875=>678,7876=>683, -7877=>678,7878=>683,7879=>678,7880=>372,7881=>343,7882=>372,7883=>343,7884=>850,7885=>687,7886=>850, -7887=>687,7888=>850,7889=>687,7890=>850,7891=>687,7892=>850,7893=>687,7894=>850,7895=>687,7896=>850, -7897=>687,7898=>850,7899=>687,7900=>850,7901=>687,7902=>850,7903=>687,7904=>850,7905=>687,7906=>850, -7907=>687,7908=>812,7909=>712,7910=>812,7911=>712,7912=>812,7913=>712,7914=>812,7915=>712,7916=>812, -7917=>712,7918=>812,7919=>712,7920=>812,7921=>712,7922=>724,7923=>652,7924=>724,7925=>652,7926=>724, -7927=>652,7928=>724,7929=>652,7936=>687,7937=>687,7938=>687,7939=>687,7940=>687,7941=>687,7942=>687, -7943=>687,7944=>774,7945=>774,7946=>1041,7947=>1043,7948=>935,7949=>963,7950=>835,7951=>859,7952=>557, -7953=>557,7954=>557,7955=>557,7956=>557,7957=>557,7960=>792,7961=>794,7962=>1100,7963=>1096,7964=>1023, -7965=>1052,7968=>712,7969=>712,7970=>712,7971=>712,7972=>712,7973=>712,7974=>712,7975=>712,7976=>945, -7977=>951,7978=>1250,7979=>1250,7980=>1180,7981=>1206,7982=>1054,7983=>1063,7984=>390,7985=>390,7986=>390, -7987=>390,7988=>390,7989=>390,7990=>390,7991=>390,7992=>483,7993=>489,7994=>777,7995=>785,7996=>712, -7997=>738,7998=>604,7999=>604,8000=>687,8001=>687,8002=>687,8003=>687,8004=>687,8005=>687,8008=>892, -8009=>933,8010=>1221,8011=>1224,8012=>1053,8013=>1082,8016=>675,8017=>675,8018=>675,8019=>675,8020=>675, -8021=>675,8022=>675,8023=>675,8025=>930,8027=>1184,8029=>1199,8031=>1049,8032=>869,8033=>869,8034=>869, -8035=>869,8036=>869,8037=>869,8038=>869,8039=>869,8040=>909,8041=>958,8042=>1246,8043=>1251,8044=>1076, -8045=>1105,8046=>1028,8047=>1076,8048=>687,8049=>687,8050=>557,8051=>557,8052=>712,8053=>712,8054=>390, -8055=>390,8056=>687,8057=>687,8058=>675,8059=>675,8060=>869,8061=>869,8064=>687,8065=>687,8066=>687, -8067=>687,8068=>687,8069=>687,8070=>687,8071=>687,8072=>774,8073=>774,8074=>1041,8075=>1043,8076=>935, -8077=>963,8078=>835,8079=>859,8080=>712,8081=>712,8082=>712,8083=>712,8084=>712,8085=>712,8086=>712, -8087=>712,8088=>945,8089=>951,8090=>1250,8091=>1250,8092=>1180,8093=>1206,8094=>1054,8095=>1063,8096=>869, -8097=>869,8098=>869,8099=>869,8100=>869,8101=>869,8102=>869,8103=>869,8104=>909,8105=>958,8106=>1246, -8107=>1251,8108=>1076,8109=>1105,8110=>1028,8111=>1076,8112=>687,8113=>687,8114=>687,8115=>687,8116=>687, -8118=>687,8119=>687,8120=>774,8121=>774,8122=>876,8123=>797,8124=>774,8125=>500,8126=>500,8127=>500, -8128=>500,8129=>500,8130=>712,8131=>712,8132=>712,8134=>712,8135=>712,8136=>929,8137=>846,8138=>1080, -8139=>1009,8140=>837,8141=>500,8142=>500,8143=>500,8144=>390,8145=>390,8146=>390,8147=>390,8150=>390, -8151=>390,8152=>372,8153=>372,8154=>621,8155=>563,8157=>500,8158=>500,8159=>500,8160=>675,8161=>675, -8162=>675,8163=>675,8164=>716,8165=>716,8166=>675,8167=>675,8168=>724,8169=>724,8170=>1020,8171=>980, -8172=>838,8173=>500,8174=>500,8175=>500,8178=>869,8179=>869,8180=>869,8182=>869,8183=>869,8184=>1065, -8185=>891,8186=>1084,8187=>894,8188=>850,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000, -8196=>330,8197=>250,8198=>167,8199=>696,8200=>380,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0, -8206=>0,8207=>0,8208=>415,8209=>415,8210=>696,8213=>1000,8214=>500,8215=>500,8219=>380,8223=>657, -8227=>639,8228=>380,8229=>685,8231=>348,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200, -8241=>1908,8242=>264,8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733,8251=>972,8252=>627, -8253=>580,8254=>500,8255=>828,8256=>828,8257=>329,8258=>1023,8259=>500,8260=>167,8261=>457,8262=>457, -8263=>1030,8264=>829,8265=>829,8266=>513,8267=>687,8268=>500,8269=>500,8270=>523,8271=>400,8272=>828, -8273=>523,8274=>556,8275=>838,8276=>828,8277=>838,8278=>684,8279=>813,8280=>838,8281=>838,8282=>380, -8283=>872,8284=>838,8285=>380,8286=>380,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0, -8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>438,8305=>219,8308=>438,8309=>438, -8310=>438,8311=>438,8312=>438,8313=>438,8314=>528,8315=>528,8316=>528,8317=>288,8318=>288,8319=>456, -8320=>438,8321=>438,8322=>438,8323=>438,8324=>438,8325=>438,8326=>438,8327=>438,8328=>438,8329=>438, -8330=>528,8331=>528,8332=>528,8333=>288,8334=>288,8336=>458,8337=>479,8338=>488,8339=>413,8340=>479, -8352=>929,8353=>696,8354=>696,8355=>696,8356=>696,8357=>1042,8358=>837,8359=>1488,8360=>1205,8361=>1103, -8362=>854,8363=>714,8365=>696,8366=>682,8367=>1392,8368=>696,8369=>696,8370=>696,8371=>696,8372=>859, -8373=>696,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1106,8449=>1106, -8450=>734,8451=>1211,8452=>896,8453=>1114,8454=>1148,8455=>696,8456=>698,8457=>952,8459=>1073,8460=>913, -8461=>888,8462=>712,8463=>712,8464=>597,8465=>697,8466=>856,8467=>472,8468=>974,8469=>837,8470=>1203, -8471=>1000,8472=>697,8473=>750,8474=>850,8475=>938,8476=>814,8477=>801,8478=>896,8479=>710,8480=>1020, -8481=>1239,8483=>834,8484=>754,8485=>622,8486=>850,8487=>769,8488=>763,8489=>303,8490=>775,8491=>774, -8492=>928,8493=>818,8494=>854,8495=>636,8496=>729,8497=>808,8498=>683,8499=>1184,8500=>465,8501=>794, -8502=>731,8503=>494,8504=>684,8505=>380,8506=>945,8507=>1370,8508=>790,8509=>737,8510=>654,8511=>863, -8512=>840,8513=>786,8514=>576,8515=>637,8516=>760,8517=>830,8518=>716,8519=>678,8520=>343,8521=>343, -8523=>872,8526=>547,8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035,8537=>1035,8538=>1035, -8539=>1035,8540=>1035,8541=>1035,8542=>1035,8543=>615,8544=>372,8545=>659,8546=>945,8547=>1099,8548=>774, -8549=>1099,8550=>1386,8551=>1672,8552=>1121,8553=>771,8554=>1120,8555=>1407,8556=>637,8557=>734,8558=>830, -8559=>995,8560=>343,8561=>607,8562=>872,8563=>984,8564=>652,8565=>962,8566=>1227,8567=>1491,8568=>969, -8569=>645,8570=>969,8571=>1233,8572=>343,8573=>593,8574=>716,8575=>1042,8576=>1289,8577=>830,8578=>1289, -8579=>734,8580=>593,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838, -8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838, -8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838, -8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838, -8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838, -8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838, -8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838, -8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838, -8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838, -8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838, -8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838, -8700=>838,8701=>838,8702=>838,8703=>838,8704=>774,8705=>696,8706=>544,8707=>683,8708=>683,8709=>856, -8710=>697,8711=>697,8712=>896,8713=>896,8714=>750,8715=>896,8716=>896,8717=>750,8718=>636,8719=>787, -8720=>787,8721=>718,8722=>838,8723=>838,8724=>696,8725=>365,8726=>696,8727=>838,8728=>626,8729=>380, -8730=>667,8731=>667,8732=>667,8733=>712,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500, -8740=>500,8741=>500,8742=>500,8743=>812,8744=>812,8745=>812,8746=>812,8747=>610,8748=>929,8749=>1295, -8750=>563,8751=>977,8752=>1313,8753=>563,8754=>563,8755=>563,8756=>696,8757=>696,8758=>294,8759=>696, -8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838, -8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838, -8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1063,8789=>1063, -8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838, -8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>841,8809=>841, -8810=>1047,8811=>1047,8812=>500,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838, -8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838, -8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838, -8840=>838,8841=>838,8842=>838,8843=>838,8844=>812,8845=>812,8846=>812,8847=>838,8848=>838,8849=>838, -8850=>838,8851=>796,8852=>796,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838, -8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>914,8867=>914,8868=>914,8869=>914, -8870=>542,8871=>542,8872=>914,8873=>914,8874=>914,8875=>914,8876=>914,8877=>914,8878=>914,8879=>914, -8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838, -8890=>542,8891=>812,8892=>812,8893=>812,8894=>838,8895=>838,8896=>843,8897=>843,8898=>843,8899=>843, -8900=>494,8901=>380,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838, -8910=>812,8911=>812,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838, -8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838, -8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838, -8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1158,8947=>896,8948=>750,8949=>896, -8950=>896,8951=>750,8952=>896,8953=>896,8954=>1158,8955=>896,8956=>750,8957=>896,8958=>750,8959=>896, -8960=>602,8961=>602,8962=>716,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>457,8969=>457, -8970=>457,8971=>457,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>539,8984=>928,8985=>838, -8988=>469,8989=>469,8990=>469,8991=>469,8992=>610,8993=>610,8996=>1152,8997=>1152,8998=>1414,8999=>1152, -9000=>1443,9003=>1414,9004=>873,9075=>390,9076=>716,9077=>869,9082=>687,9085=>863,9095=>1152,9108=>873, -9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500, -9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>610, -9166=>838,9167=>945,9187=>873,9189=>769,9250=>716,9251=>716,9312=>847,9313=>847,9314=>847,9315=>847, -9316=>847,9317=>847,9318=>847,9319=>847,9320=>847,9321=>847,9600=>769,9601=>769,9602=>769,9603=>769, -9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769, -9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769, -9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945, -9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678, -9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502, -9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502, -9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873, -9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873, -9684=>873,9685=>873,9686=>527,9687=>527,9688=>840,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387, -9694=>387,9695=>387,9696=>769,9697=>769,9698=>769,9699=>769,9700=>769,9701=>769,9702=>639,9703=>945, -9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945, -9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830, -9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896, -9734=>896,9735=>573,9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250, -9744=>896,9745=>896,9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896, -9754=>896,9755=>896,9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896, -9764=>669,9765=>746,9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896, -9774=>896,9775=>896,9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896, -9784=>896,9785=>896,9786=>896,9787=>896,9788=>896,9789=>896,9790=>896,9791=>614,9792=>731,9793=>731, -9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896, -9804=>896,9805=>896,9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896, -9814=>896,9815=>896,9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896, -9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472, -9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896, -9844=>896,9845=>896,9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896, -9854=>896,9855=>896,9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896, -9864=>896,9865=>896,9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896, -9874=>896,9875=>896,9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896, -9884=>896,9888=>896,9889=>702,9890=>1003,9891=>1085,9892=>1143,9893=>901,9894=>838,9895=>838,9896=>838, -9897=>838,9898=>838,9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>731, -9907=>732,9908=>732,9909=>732,9910=>850,9911=>732,9912=>732,9985=>838,9986=>838,9987=>838,9988=>838, -9990=>838,9991=>838,9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838, -10002=>838,10003=>838,10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838, -10012=>838,10013=>838,10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838, -10022=>838,10023=>838,10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838, -10033=>838,10034=>838,10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838, -10043=>838,10044=>838,10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838, -10053=>838,10054=>838,10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896, -10065=>896,10066=>896,10070=>896,10072=>838,10073=>838,10074=>838,10075=>322,10076=>322,10077=>538,10078=>538, -10081=>838,10082=>838,10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838, -10091=>838,10092=>838,10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838, -10101=>838,10102=>847,10103=>847,10104=>847,10105=>847,10106=>847,10107=>847,10108=>847,10109=>847,10110=>847, -10111=>847,10112=>838,10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838, -10121=>838,10122=>838,10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838, -10131=>838,10132=>838,10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838, -10144=>838,10145=>838,10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838, -10154=>838,10155=>838,10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838, -10165=>838,10166=>838,10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838, -10181=>457,10182=>457,10208=>494,10214=>487,10215=>487,10216=>457,10217=>457,10218=>721,10219=>721,10224=>838, -10225=>838,10226=>838,10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434, -10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781, -10245=>781,10246=>781,10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781, -10255=>781,10256=>781,10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781, -10265=>781,10266=>781,10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781, -10275=>781,10276=>781,10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781, -10285=>781,10286=>781,10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781, -10295=>781,10296=>781,10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781, -10305=>781,10306=>781,10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781, -10315=>781,10316=>781,10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781, -10325=>781,10326=>781,10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781, -10335=>781,10336=>781,10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781, -10345=>781,10346=>781,10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781, -10355=>781,10356=>781,10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781, -10365=>781,10366=>781,10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781, -10375=>781,10376=>781,10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781, -10385=>781,10386=>781,10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781, -10395=>781,10396=>781,10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781, -10405=>781,10406=>781,10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781, -10415=>781,10416=>781,10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781, -10425=>781,10426=>781,10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781, -10435=>781,10436=>781,10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781, -10445=>781,10446=>781,10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781, -10455=>781,10456=>781,10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781, -10465=>781,10466=>781,10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781, -10475=>781,10476=>781,10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781, -10485=>781,10486=>781,10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781, -10495=>781,10502=>838,10503=>838,10506=>838,10507=>838,10560=>838,10561=>838,10627=>753,10628=>753,10702=>838, -10703=>1046,10704=>1046,10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838, -10752=>1000,10753=>1000,10754=>1000,10764=>1661,10765=>563,10766=>563,10767=>563,10768=>563,10769=>563,10770=>563, -10771=>563,10772=>563,10773=>563,10774=>563,10775=>563,10776=>563,10777=>563,10778=>563,10779=>563,10780=>563, -10799=>838,10877=>838,10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838, -10886=>838,10887=>838,10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838, -10896=>838,10897=>838,10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838, -10906=>838,10907=>838,10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838, -10929=>838,10930=>838,10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838, -11001=>838,11002=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838, -11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838, -11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869, -11040=>869,11041=>873,11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>637,11361=>360,11362=>637, -11363=>733,11364=>770,11365=>675,11366=>478,11367=>956,11368=>712,11369=>775,11370=>665,11371=>725,11372=>582, -11373=>860,11374=>995,11375=>774,11377=>778,11378=>1221,11379=>1056,11380=>652,11381=>698,11382=>565,11383=>782, -11385=>538,11386=>687,11387=>559,11388=>219,11389=>487,11800=>586,11810=>457,11811=>457,11812=>457,11813=>457, -11822=>580,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896, -19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896, -19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896, -19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896, -19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896, -19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896, -19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42564=>720,42565=>595,42566=>436,42567=>440,42572=>1405, -42573=>1173,42576=>1234,42577=>1027,42580=>1174,42581=>972,42582=>1100,42583=>969,42594=>1100,42595=>940,42596=>1096, -42597=>915,42598=>1260,42599=>997,42600=>850,42601=>687,42602=>1037,42603=>868,42604=>1406,42605=>1106,42606=>961, -42634=>944,42635=>749,42636=>682,42637=>580,42644=>808,42645=>712,42760=>500,42761=>500,42762=>500,42763=>500, -42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500,42771=>500,42772=>500,42773=>500, -42774=>500,42779=>400,42780=>400,42781=>287,42782=>287,42783=>287,42790=>837,42791=>712,42792=>1031,42793=>857, -42794=>696,42795=>557,42800=>559,42801=>595,42802=>1349,42803=>1052,42804=>1285,42805=>1065,42806=>1245,42807=>1052, -42808=>1079,42809=>922,42810=>1079,42811=>922,42812=>1035,42813=>922,42814=>698,42815=>549,42822=>850,42823=>542, -42824=>683,42825=>531,42826=>918,42827=>814,42830=>1406,42831=>1106,42880=>637,42881=>343,42882=>837,42883=>712, -42889=>400,42890=>396,42891=>456,42892=>306,43003=>683,43004=>733,43005=>995,43006=>372,43007=>1325,62917=>687, -64256=>833,64257=>787,64258=>787,64259=>1138,64260=>1139,64261=>808,64262=>1020,64275=>1388,64276=>1384,64277=>1378, -64278=>1384,64279=>1713,64285=>343,64286=>0,64287=>663,64288=>720,64289=>963,64290=>890,64291=>988,64292=>963, -64293=>938,64294=>988,64295=>988,64296=>976,64297=>838,64298=>949,64299=>949,64300=>949,64301=>949,64302=>751, -64303=>751,64304=>751,64305=>673,64306=>537,64307=>654,64308=>712,64309=>343,64310=>491,64312=>724,64313=>467, -64314=>649,64315=>650,64316=>679,64318=>775,64320=>497,64321=>773,64323=>718,64324=>687,64326=>751,64327=>729, -64328=>649,64329=>949,64330=>751,64331=>343,64332=>673,64333=>650,64334=>687,64335=>751,65024=>0,65025=>0, -65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0, -65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65529=>0,65530=>0, -65531=>0,65532=>0,65533=>1113); -$enc=''; -$diff=''; -$file='dejavusansbi.z'; -$ctg='dejavusansbi.ctg.z'; -$originalsize=524056; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.z deleted file mode 100644 index 03c4078e94..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.ctg.z deleted file mode 100644 index 3170ea6f2e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.php deleted file mode 100644 index 2dd9c238e1..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.php +++ /dev/null @@ -1,517 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansCondensed'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>26,'Flags'=>96,'FontBBox'=>'[-918 -350 1513 1167]','ItalicAngle'=>-18.9,'StemV'=>70,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>286,33=>360,34=>414,35=>754,36=>572,37=>855,38=>702,39=>247,40=>351, -41=>351,42=>450,43=>754,44=>286,45=>325,46=>286,47=>303,48=>572,49=>572,50=>572, -51=>572,52=>572,53=>572,54=>572,55=>572,56=>572,57=>572,58=>303,59=>303,60=>754, -61=>754,62=>754,63=>478,64=>900,65=>615,66=>617,67=>628,68=>693,69=>568,70=>518, -71=>697,72=>677,73=>265,74=>265,75=>590,76=>501,77=>776,78=>673,79=>708,80=>542, -81=>708,82=>625,83=>571,84=>549,85=>659,86=>615,87=>890,88=>616,89=>549,90=>616, -91=>351,92=>303,93=>351,94=>754,95=>450,96=>450,97=>551,98=>571,99=>495,100=>571, -101=>554,102=>316,103=>571,104=>570,105=>250,106=>250,107=>521,108=>250,109=>876,110=>570, -111=>550,112=>571,113=>571,114=>370,115=>469,116=>353,117=>570,118=>532,119=>736,120=>532, -121=>532,122=>472,123=>572,124=>303,125=>572,126=>754,8364=>572,8218=>286,402=>316,8222=>466, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1208,352=>571,8249=>360,338=>962,381=>616,8216=>286, -8217=>286,8220=>466,8221=>466,8226=>531,8211=>450,8212=>900,732=>450,8482=>900,353=>469,8250=>360, -339=>920,382=>472,376=>549,160=>286,161=>360,162=>572,163=>572,164=>572,165=>572,166=>303, -167=>450,168=>450,169=>900,170=>424,171=>550,172=>754,173=>325,174=>900,175=>450,176=>450, -177=>754,178=>360,179=>360,180=>450,181=>572,182=>572,183=>286,184=>450,185=>360,186=>424, -187=>550,188=>872,189=>872,190=>872,191=>478,192=>615,193=>615,194=>615,195=>615,196=>615, -197=>615,198=>876,199=>628,200=>568,201=>568,202=>568,203=>568,204=>265,205=>265,206=>265, -207=>265,208=>697,209=>673,210=>708,211=>708,212=>708,213=>708,214=>708,215=>754,216=>708, -217=>659,218=>659,219=>659,220=>659,221=>549,222=>544,223=>567,224=>551,225=>551,226=>551, -227=>551,228=>551,229=>551,230=>883,231=>495,232=>554,233=>554,234=>554,235=>554,236=>250, -237=>250,238=>250,239=>250,240=>550,241=>570,242=>550,243=>550,244=>550,245=>550,246=>550, -247=>754,248=>550,249=>570,250=>570,251=>570,252=>570,253=>532,254=>571,255=>532,256=>615, -257=>551,258=>615,259=>551,260=>615,261=>551,262=>628,263=>495,264=>628,265=>495,266=>628, -267=>495,268=>628,269=>495,270=>693,271=>571,272=>697,273=>571,274=>568,275=>554,276=>568, -277=>554,278=>568,279=>554,280=>568,281=>554,282=>568,283=>554,284=>697,285=>571,286=>697, -287=>571,288=>697,289=>571,290=>697,291=>571,292=>677,293=>570,294=>824,295=>625,296=>265, -297=>250,298=>265,299=>250,300=>265,301=>250,302=>265,303=>250,304=>265,305=>250,306=>531, -307=>500,308=>265,309=>250,310=>590,311=>521,312=>521,313=>501,314=>250,315=>501,316=>250, -317=>501,318=>337,319=>501,320=>308,321=>505,322=>255,323=>673,324=>570,325=>673,326=>570, -327=>673,328=>570,329=>732,330=>673,331=>570,332=>708,333=>550,334=>708,335=>550,336=>708, -337=>550,340=>625,341=>370,342=>625,343=>370,344=>625,345=>370,346=>571,347=>469,348=>571, -349=>469,350=>571,351=>469,354=>549,355=>353,356=>549,357=>353,358=>549,359=>353,360=>659, -361=>570,362=>659,363=>570,364=>659,365=>570,366=>659,367=>570,368=>659,369=>570,370=>659, -371=>570,372=>890,373=>736,374=>549,375=>532,377=>616,378=>472,379=>616,380=>472,383=>316, -384=>571,385=>661,386=>617,387=>571,388=>617,389=>571,390=>633,391=>628,392=>495,393=>697, -394=>737,395=>617,396=>571,397=>550,398=>568,399=>708,400=>553,401=>518,403=>697,404=>618, -405=>885,406=>318,407=>265,408=>671,409=>521,410=>250,411=>532,412=>876,413=>673,414=>570, -415=>708,416=>822,417=>550,418=>854,419=>683,420=>586,421=>571,422=>625,423=>571,424=>469, -425=>568,426=>302,427=>353,428=>549,429=>353,430=>549,431=>772,432=>570,433=>688,434=>648, -435=>669,436=>657,437=>616,438=>472,439=>599,440=>599,441=>520,442=>472,443=>572,444=>599, -445=>520,446=>459,447=>571,448=>265,449=>443,450=>413,451=>266,452=>1279,453=>1169,454=>1039, -455=>751,456=>708,457=>411,458=>838,459=>831,460=>717,461=>615,462=>551,463=>265,464=>250, -465=>708,466=>550,467=>659,468=>570,469=>659,470=>570,471=>659,472=>570,473=>659,474=>570, -475=>659,476=>570,477=>554,478=>615,479=>551,480=>615,481=>551,482=>876,483=>883,484=>697, -485=>571,486=>697,487=>571,488=>590,489=>521,490=>708,491=>550,492=>708,493=>550,494=>599, -495=>520,496=>250,497=>1279,498=>1169,499=>1039,500=>697,501=>571,502=>1001,503=>614,504=>673, -505=>570,506=>615,507=>551,508=>876,509=>883,510=>708,511=>550,512=>615,513=>551,514=>615, -515=>551,516=>568,517=>554,518=>568,519=>554,520=>265,521=>250,522=>265,523=>250,524=>708, -525=>550,526=>708,527=>550,528=>625,529=>370,530=>625,531=>370,532=>659,533=>570,534=>659, -535=>570,536=>571,537=>469,538=>549,539=>353,540=>564,541=>469,542=>677,543=>570,544=>662, -545=>754,546=>628,547=>549,548=>616,549=>472,550=>615,551=>551,552=>568,553=>554,554=>708, -555=>550,556=>708,557=>550,558=>708,559=>550,560=>708,561=>550,562=>549,563=>532,564=>427, -565=>758,566=>429,567=>250,568=>898,569=>898,570=>615,571=>628,572=>495,573=>501,574=>549, -575=>469,576=>472,577=>542,578=>431,579=>617,580=>659,581=>615,582=>568,583=>554,584=>265, -585=>250,586=>703,587=>571,588=>625,589=>370,590=>549,591=>532,592=>540,593=>571,594=>571, -595=>571,596=>494,597=>495,598=>571,599=>626,600=>554,601=>554,602=>737,603=>486,604=>479, -605=>698,606=>598,607=>250,608=>626,609=>571,610=>566,611=>536,612=>536,613=>570,614=>570, -615=>570,616=>250,617=>304,618=>334,619=>356,620=>438,621=>250,622=>635,623=>876,624=>876, -625=>876,626=>581,627=>578,628=>570,629=>550,630=>772,631=>655,632=>593,633=>373,634=>373, -635=>372,636=>370,637=>369,638=>477,639=>477,640=>543,641=>543,642=>469,643=>302,644=>302, -645=>415,646=>302,647=>353,648=>353,649=>570,650=>556,651=>538,652=>532,653=>736,654=>532, -655=>549,656=>472,657=>472,658=>520,659=>520,660=>459,661=>459,662=>459,663=>459,664=>708, -665=>521,666=>598,667=>637,668=>588,669=>263,670=>600,671=>456,672=>654,673=>459,674=>459, -675=>913,676=>952,677=>911,678=>742,679=>549,680=>700,681=>763,682=>576,683=>589,684=>463, -685=>463,686=>595,687=>597,688=>364,689=>359,690=>157,691=>233,692=>266,693=>266,694=>341, -695=>463,696=>335,697=>250,698=>414,699=>286,700=>286,701=>286,702=>276,703=>276,704=>333, -705=>333,706=>450,707=>450,708=>450,709=>450,711=>450,712=>247,713=>450,714=>450,715=>450, -716=>247,717=>450,718=>450,719=>450,720=>303,721=>303,722=>276,723=>276,724=>450,725=>450, -726=>351,727=>286,728=>450,729=>450,730=>450,731=>450,733=>450,734=>284,735=>450,736=>383, -737=>149,738=>335,739=>399,740=>333,741=>444,742=>444,743=>444,744=>444,745=>444,748=>450, -749=>450,750=>466,755=>450,759=>450,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>589,881=>511,882=>775, -883=>583,884=>250,885=>250,886=>673,887=>584,890=>450,891=>494,892=>495,893=>494,894=>303, -900=>450,901=>450,902=>623,903=>286,904=>671,905=>784,906=>367,908=>731,910=>742,911=>743, -912=>304,913=>615,914=>617,915=>501,916=>615,917=>568,918=>616,919=>677,920=>708,921=>265, -922=>590,923=>615,924=>776,925=>673,926=>568,927=>708,928=>677,929=>542,931=>568,932=>549, -933=>549,934=>708,935=>616,936=>708,937=>688,938=>265,939=>549,940=>593,941=>486,942=>570, -943=>304,944=>521,945=>593,946=>574,947=>532,948=>550,949=>486,950=>489,951=>570,952=>550, -953=>304,954=>530,955=>532,956=>572,957=>502,958=>501,959=>550,960=>542,961=>571,962=>528, -963=>570,964=>542,965=>521,966=>593,967=>520,968=>593,969=>753,970=>304,971=>521,972=>550, -973=>521,974=>753,975=>590,976=>553,977=>557,978=>628,979=>758,980=>628,981=>593,982=>753, -983=>597,984=>708,985=>550,986=>583,987=>528,988=>518,989=>413,990=>593,991=>593,992=>778, -993=>564,994=>840,995=>753,996=>682,997=>593,998=>712,999=>553,1000=>618,1001=>546,1002=>690, -1003=>563,1004=>629,1005=>550,1006=>549,1007=>482,1008=>597,1009=>571,1010=>495,1011=>250,1012=>708, -1013=>554,1014=>554,1015=>544,1016=>571,1017=>628,1018=>776,1019=>585,1020=>571,1021=>633,1022=>628, -1023=>633,1024=>568,1025=>568,1026=>708,1027=>549,1028=>628,1029=>571,1030=>265,1031=>265,1032=>265, -1033=>984,1034=>940,1035=>708,1036=>639,1037=>673,1038=>548,1039=>677,1040=>615,1041=>617,1042=>617, -1043=>549,1044=>703,1045=>568,1046=>969,1047=>577,1048=>673,1049=>673,1050=>639,1051=>677,1052=>776, -1053=>677,1054=>708,1055=>677,1056=>542,1057=>628,1058=>549,1059=>548,1060=>774,1061=>616,1062=>699, -1063=>617,1064=>962,1065=>984,1066=>749,1067=>794,1068=>617,1069=>628,1070=>971,1071=>625,1072=>551, -1073=>555,1074=>530,1075=>473,1076=>622,1077=>554,1078=>811,1079=>479,1080=>584,1081=>584,1082=>543, -1083=>575,1084=>679,1085=>588,1086=>550,1087=>588,1088=>571,1089=>495,1090=>524,1091=>532,1092=>769, -1093=>532,1094=>612,1095=>532,1096=>823,1097=>848,1098=>636,1099=>710,1100=>530,1101=>494,1102=>757, -1103=>541,1104=>554,1105=>554,1106=>563,1107=>473,1108=>494,1109=>469,1110=>250,1111=>250,1112=>250, -1113=>812,1114=>809,1115=>586,1116=>543,1117=>584,1118=>532,1119=>588,1120=>840,1121=>753,1122=>693, -1123=>604,1124=>848,1125=>674,1126=>791,1127=>705,1128=>1043,1129=>901,1130=>708,1131=>550,1132=>924, -1133=>742,1134=>572,1135=>486,1136=>771,1137=>789,1138=>708,1139=>550,1140=>703,1141=>598,1142=>703, -1143=>598,1144=>893,1145=>813,1146=>857,1147=>682,1148=>1062,1149=>925,1150=>840,1151=>753,1152=>628, -1153=>495,1154=>452,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>376,1161=>376,1162=>695, -1163=>609,1164=>617,1165=>530,1166=>542,1167=>571,1168=>549,1169=>473,1170=>607,1171=>531,1172=>562, -1173=>477,1174=>969,1175=>811,1176=>577,1177=>479,1178=>639,1179=>543,1180=>639,1181=>543,1182=>639, -1183=>543,1184=>771,1185=>748,1186=>677,1187=>594,1188=>913,1189=>789,1190=>973,1191=>824,1192=>790, -1193=>624,1194=>628,1195=>495,1196=>549,1197=>524,1198=>549,1199=>532,1200=>549,1201=>532,1202=>616, -1203=>532,1204=>840,1205=>726,1206=>617,1207=>532,1208=>617,1209=>532,1210=>617,1211=>570,1212=>847, -1213=>655,1214=>847,1215=>655,1216=>265,1217=>969,1218=>811,1219=>590,1220=>543,1221=>698,1222=>603, -1223=>677,1224=>594,1225=>699,1226=>612,1227=>617,1228=>532,1229=>799,1230=>697,1231=>250,1232=>615, -1233=>551,1234=>615,1235=>551,1236=>876,1237=>883,1238=>568,1239=>554,1240=>708,1241=>554,1242=>708, -1243=>554,1244=>969,1245=>811,1246=>577,1247=>479,1248=>599,1249=>520,1250=>673,1251=>584,1252=>673, -1253=>584,1254=>708,1255=>550,1256=>708,1257=>550,1258=>708,1259=>550,1260=>628,1261=>494,1262=>548, -1263=>532,1264=>548,1265=>532,1266=>548,1267=>532,1268=>617,1269=>532,1270=>549,1271=>473,1272=>794, -1273=>710,1274=>607,1275=>531,1276=>616,1277=>532,1278=>616,1279=>532,1280=>617,1281=>530,1282=>905, -1283=>807,1284=>877,1285=>782,1286=>611,1287=>529,1288=>964,1289=>861,1290=>1001,1291=>870,1292=>697, -1293=>593,1294=>695,1295=>640,1296=>553,1297=>486,1298=>677,1299=>575,1300=>1052,1301=>894,1302=>804, -1303=>778,1304=>928,1305=>887,1306=>708,1307=>571,1308=>890,1309=>736,1312=>972,1313=>814,1314=>973, -1315=>821,1316=>713,1317=>614,1329=>780,1330=>659,1331=>794,1332=>794,1333=>659,1334=>579,1335=>613, -1336=>659,1337=>765,1338=>794,1339=>659,1340=>501,1341=>741,1342=>888,1343=>659,1344=>636,1345=>579, -1346=>794,1347=>699,1348=>794,1349=>659,1350=>756,1351=>659,1352=>659,1353=>659,1354=>711,1355=>579, -1356=>794,1357=>659,1358=>794,1359=>571,1360=>659,1361=>659,1362=>719,1363=>708,1364=>711,1365=>708, -1366=>571,1369=>276,1370=>286,1371=>450,1372=>450,1373=>352,1374=>474,1375=>450,1377=>876,1378=>570, -1379=>686,1380=>690,1381=>570,1382=>627,1383=>479,1384=>570,1385=>630,1386=>627,1387=>570,1388=>363, -1389=>804,1390=>576,1391=>570,1392=>570,1393=>571,1394=>631,1395=>570,1396=>593,1397=>250,1398=>684, -1399=>464,1400=>570,1401=>407,1402=>876,1403=>464,1404=>691,1405=>570,1406=>626,1407=>876,1408=>570, -1409=>571,1410=>451,1411=>876,1412=>583,1413=>550,1414=>566,1415=>686,1417=>303,1418=>390,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>325,1471=>0,1472=>265,1473=>0,1474=>0,1475=>265,1478=>397, -1479=>0,1488=>566,1489=>547,1490=>403,1491=>534,1492=>576,1493=>245,1494=>336,1495=>576,1496=>583, -1497=>245,1498=>532,1499=>500,1500=>539,1501=>576,1502=>593,1503=>245,1504=>397,1505=>629,1506=>506, -1507=>576,1508=>543,1509=>468,1510=>523,1511=>596,1512=>532,1513=>727,1514=>591,1520=>423,1521=>409, -1522=>423,1523=>374,1524=>580,1542=>573,1543=>573,1545=>681,1546=>879,1548=>290,1557=>0,1563=>286, -1567=>478,1569=>423,1570=>250,1571=>250,1572=>435,1573=>250,1574=>704,1575=>250,1576=>847,1577=>471, -1578=>847,1579=>847,1580=>581,1581=>581,1582=>581,1583=>400,1584=>400,1585=>435,1586=>435,1587=>1099, -1588=>1099,1589=>1088,1590=>1088,1591=>832,1592=>832,1593=>537,1594=>537,1600=>264,1601=>933,1602=>698, -1603=>742,1604=>654,1605=>557,1606=>661,1607=>471,1608=>435,1609=>704,1610=>704,1611=>0,1612=>0, -1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1626=>450, -1632=>483,1633=>483,1634=>483,1635=>483,1636=>483,1637=>483,1638=>483,1639=>483,1640=>483,1641=>483, -1642=>483,1643=>292,1644=>286,1645=>490,1646=>847,1647=>698,1652=>263,1657=>847,1658=>847,1659=>847, -1660=>847,1661=>847,1662=>847,1663=>847,1664=>847,1665=>581,1666=>581,1667=>581,1668=>581,1669=>581, -1670=>581,1671=>581,1681=>435,1682=>435,1685=>549,1688=>435,1697=>933,1700=>933,1702=>933,1705=>805, -1711=>805,1717=>654,1722=>661,1727=>581,1734=>435,1740=>704,1742=>704,1749=>471,1776=>483,1777=>483, -1778=>483,1779=>483,1780=>483,1781=>483,1782=>483,1783=>483,1784=>483,1785=>483,1984=>572,1985=>572, -1986=>572,1987=>572,1988=>572,1989=>572,1990=>572,1991=>572,1992=>572,1993=>572,1994=>250,1995=>514, -1996=>381,1997=>532,1998=>588,1999=>588,2000=>534,2001=>588,2002=>746,2003=>394,2004=>394,2005=>502, -2006=>550,2007=>315,2008=>863,2009=>425,2010=>705,2011=>588,2012=>563,2013=>660,2014=>477,2015=>651, -2016=>425,2017=>563,2018=>534,2019=>477,2020=>477,2021=>470,2022=>534,2023=>534,2027=>0,2028=>0, -2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>282,2037=>282,2040=>504, -2041=>504,2042=>325,3647=>586,3713=>603,3714=>615,3716=>619,3719=>434,3720=>565,3722=>615,3725=>619, -3732=>602,3733=>577,3734=>580,3735=>589,3737=>593,3738=>563,3739=>563,3740=>670,3741=>690,3742=>618, -3743=>618,3745=>631,3746=>619,3747=>615,3749=>584,3751=>569,3754=>633,3755=>737,3757=>569,3758=>615, -3759=>708,3760=>569,3761=>0,3762=>485,3763=>485,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0, -3769=>0,3771=>0,3772=>0,3773=>597,3776=>337,3777=>591,3778=>414,3779=>492,3780=>442,3782=>606, -3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>572,3793=>576,3794=>576,3795=>603, -3796=>563,3797=>563,3798=>633,3799=>603,3800=>606,3801=>609,3804=>925,3805=>925,4256=>756,4257=>621, -4258=>577,4259=>683,4260=>532,4261=>617,4262=>710,4263=>729,4264=>420,4265=>508,4266=>710,4267=>713, -4268=>526,4269=>753,4270=>675,4271=>620,4272=>729,4273=>526,4274=>526,4275=>753,4276=>753,4277=>581, -4278=>543,4279=>526,4280=>536,4281=>526,4282=>649,4283=>715,4284=>526,4285=>510,4286=>526,4287=>602, -4288=>719,4289=>488,4290=>598,4291=>488,4292=>508,4293=>606,4304=>457,4305=>457,4306=>479,4307=>706, -4308=>470,4309=>465,4310=>457,4311=>717,4312=>457,4313=>466,4314=>952,4315=>470,4316=>470,4317=>704, -4318=>466,4319=>470,4320=>713,4321=>470,4322=>590,4323=>471,4324=>709,4325=>470,4326=>704,4327=>470, -4328=>470,4329=>470,4330=>510,4331=>470,4332=>470,4333=>439,4334=>470,4335=>448,4336=>465,4337=>504, -4338=>457,4339=>457,4340=>457,4341=>507,4342=>741,4343=>536,4344=>470,4345=>498,4346=>498,4347=>527, -4348=>273,5121=>615,5122=>615,5123=>615,5124=>615,5125=>692,5126=>692,5127=>692,5129=>692,5130=>692, -5131=>692,5132=>751,5133=>751,5134=>751,5135=>751,5136=>751,5137=>751,5138=>870,5139=>906,5140=>870, -5141=>906,5142=>692,5143=>870,5144=>906,5145=>870,5146=>906,5147=>692,5149=>230,5150=>488,5151=>381, -5152=>381,5153=>350,5154=>350,5155=>354,5156=>350,5157=>419,5158=>347,5159=>230,5160=>350,5161=>350, -5162=>350,5163=>980,5164=>817,5165=>857,5166=>1005,5167=>615,5168=>615,5169=>615,5170=>615,5171=>656, -5172=>656,5173=>656,5175=>656,5176=>656,5177=>656,5178=>751,5179=>615,5180=>751,5181=>751,5182=>751, -5183=>751,5184=>870,5185=>906,5186=>870,5187=>906,5188=>870,5189=>906,5190=>870,5191=>906,5192=>656, -5193=>457,5194=>172,5196=>659,5197=>659,5198=>659,5199=>659,5200=>657,5201=>657,5202=>657,5204=>657, -5205=>657,5206=>657,5207=>829,5208=>800,5209=>829,5210=>800,5211=>829,5212=>800,5213=>835,5214=>810, -5215=>835,5216=>810,5217=>853,5218=>810,5219=>853,5220=>810,5221=>853,5222=>391,5223=>790,5224=>790, -5225=>779,5226=>801,5227=>565,5228=>565,5229=>565,5230=>565,5231=>565,5232=>565,5233=>565,5234=>565, -5235=>565,5236=>773,5237=>693,5238=>733,5239=>734,5240=>733,5241=>734,5242=>773,5243=>693,5244=>773, -5245=>693,5246=>733,5247=>734,5248=>733,5249=>734,5250=>733,5251=>366,5252=>366,5253=>675,5254=>697, -5255=>675,5256=>697,5257=>565,5258=>565,5259=>565,5260=>565,5261=>565,5262=>565,5263=>565,5264=>565, -5265=>565,5266=>773,5267=>693,5268=>733,5269=>734,5270=>733,5271=>734,5272=>773,5273=>693,5274=>773, -5275=>693,5276=>733,5277=>734,5278=>733,5279=>734,5280=>733,5281=>391,5282=>391,5283=>549,5284=>501, -5285=>501,5286=>501,5287=>549,5288=>549,5289=>549,5290=>501,5291=>501,5292=>674,5293=>691,5294=>671, -5295=>687,5296=>671,5297=>687,5298=>674,5299=>691,5300=>674,5301=>691,5302=>671,5303=>687,5304=>671, -5305=>687,5306=>671,5307=>347,5308=>457,5309=>347,5312=>766,5313=>766,5314=>766,5315=>766,5316=>766, -5317=>766,5318=>766,5319=>766,5320=>766,5321=>962,5322=>931,5323=>953,5324=>766,5325=>953,5326=>766, -5327=>766,5328=>540,5329=>407,5330=>540,5331=>766,5332=>766,5333=>766,5334=>766,5335=>766,5336=>766, -5337=>766,5338=>766,5339=>766,5340=>962,5341=>931,5342=>953,5343=>927,5344=>953,5345=>927,5346=>962, -5347=>931,5348=>962,5349=>931,5350=>975,5351=>927,5352=>975,5353=>927,5354=>540,5356=>656,5357=>542, -5358=>542,5359=>542,5360=>542,5361=>542,5362=>542,5363=>542,5364=>542,5365=>542,5366=>751,5367=>678, -5368=>712,5369=>694,5370=>712,5371=>694,5372=>751,5373=>678,5374=>751,5375=>678,5376=>712,5377=>694, -5378=>712,5379=>694,5380=>712,5381=>376,5382=>378,5383=>376,5392=>641,5393=>641,5394=>641,5395=>802, -5396=>802,5397=>802,5398=>802,5399=>818,5400=>785,5401=>818,5402=>785,5403=>818,5404=>785,5405=>1026, -5406=>989,5407=>1026,5408=>989,5409=>1026,5410=>989,5411=>1026,5412=>989,5413=>576,5414=>564,5415=>564, -5416=>564,5417=>564,5418=>564,5419=>564,5420=>564,5421=>564,5422=>564,5423=>760,5424=>703,5425=>734, -5426=>736,5427=>734,5428=>736,5429=>760,5430=>703,5431=>760,5432=>703,5433=>734,5434=>736,5435=>734, -5436=>736,5437=>734,5438=>376,5440=>350,5441=>436,5442=>824,5443=>824,5444=>824,5445=>824,5446=>824, -5447=>824,5448=>542,5449=>542,5450=>542,5451=>542,5452=>542,5453=>542,5454=>751,5455=>678,5456=>376, -5458=>656,5459=>615,5460=>615,5461=>615,5462=>615,5463=>653,5464=>653,5465=>653,5466=>653,5467=>831, -5468=>906,5469=>457,5470=>659,5471=>659,5472=>659,5473=>659,5474=>659,5475=>659,5476=>657,5477=>657, -5478=>657,5479=>657,5480=>853,5481=>810,5482=>457,5492=>747,5493=>747,5494=>747,5495=>747,5496=>747, -5497=>747,5498=>747,5499=>507,5500=>677,5501=>436,5502=>942,5503=>942,5504=>942,5505=>942,5506=>942, -5507=>942,5508=>942,5509=>743,5514=>747,5515=>747,5516=>747,5517=>747,5518=>1133,5519=>1133,5520=>1133, -5521=>901,5522=>901,5523=>1133,5524=>1133,5525=>629,5526=>965,5536=>766,5537=>766,5538=>766,5539=>766, -5540=>766,5541=>766,5542=>540,5543=>579,5544=>579,5545=>579,5546=>579,5547=>579,5548=>579,5549=>579, -5550=>376,5551=>565,5598=>693,5601=>690,5702=>421,5703=>421,5742=>399,5743=>942,5744=>1178,5745=>1469, -5746=>1469,5747=>1237,5748=>1237,5749=>1469,5750=>1469,5760=>429,5761=>443,5762=>641,5763=>838,5764=>1035, -5765=>1232,5766=>443,5767=>641,5768=>838,5769=>1035,5770=>1232,5771=>448,5772=>646,5773=>844,5774=>1042, -5775=>1241,5776=>443,5777=>641,5778=>836,5779=>1034,5780=>1232,5781=>448,5782=>677,5783=>709,5784=>1084, -5785=>1035,5786=>615,5787=>457,5788=>456,7424=>532,7425=>646,7426=>883,7427=>527,7428=>495,7429=>544, -7430=>544,7431=>441,7432=>486,7433=>250,7434=>355,7435=>521,7436=>524,7437=>679,7438=>584,7439=>550, -7440=>495,7441=>615,7442=>615,7443=>615,7444=>920,7446=>550,7447=>550,7448=>472,7449=>541,7450=>541, -7451=>524,7452=>517,7453=>663,7454=>853,7455=>574,7456=>532,7457=>736,7458=>472,7459=>473,7462=>524, -7463=>532,7464=>507,7465=>472,7466=>531,7467=>575,7468=>387,7469=>552,7470=>389,7472=>436,7473=>358, -7474=>358,7475=>439,7476=>426,7477=>167,7478=>167,7479=>372,7480=>315,7481=>489,7482=>424,7483=>424, -7484=>446,7485=>396,7486=>342,7487=>394,7488=>346,7489=>415,7490=>560,7491=>352,7492=>352,7493=>365, -7494=>583,7495=>385,7496=>365,7497=>375,7498=>375,7499=>324,7500=>323,7501=>365,7502=>161,7503=>383, -7504=>561,7505=>368,7506=>372,7507=>333,7508=>372,7509=>372,7510=>385,7511=>265,7512=>364,7513=>422, -7514=>561,7515=>375,7517=>361,7518=>335,7519=>347,7520=>374,7521=>327,7522=>161,7523=>233,7524=>364, -7525=>375,7526=>361,7527=>335,7528=>370,7529=>374,7530=>327,7543=>571,7544=>426,7547=>334,7557=>250, -7579=>365,7580=>333,7581=>333,7582=>372,7583=>324,7584=>267,7585=>209,7586=>365,7587=>364,7588=>235, -7589=>224,7590=>234,7591=>235,7592=>211,7593=>224,7594=>211,7595=>338,7596=>561,7597=>561,7598=>369, -7599=>431,7600=>368,7601=>372,7602=>372,7603=>324,7604=>258,7605=>265,7606=>457,7607=>376,7608=>325, -7609=>365,7610=>375,7611=>330,7612=>393,7613=>330,7614=>353,7615=>372,7620=>0,7621=>0,7622=>0, -7623=>0,7624=>0,7625=>0,7680=>615,7681=>551,7682=>617,7683=>571,7684=>617,7685=>571,7686=>617, -7687=>571,7688=>628,7689=>495,7690=>693,7691=>571,7692=>693,7693=>571,7694=>693,7695=>571,7696=>693, -7697=>571,7698=>693,7699=>571,7700=>568,7701=>554,7702=>568,7703=>554,7704=>568,7705=>554,7706=>568, -7707=>554,7708=>568,7709=>554,7710=>518,7711=>316,7712=>697,7713=>571,7714=>677,7715=>570,7716=>677, -7717=>570,7718=>677,7719=>570,7720=>677,7721=>570,7722=>677,7723=>570,7724=>265,7725=>250,7726=>265, -7727=>250,7728=>590,7729=>521,7730=>590,7731=>521,7732=>590,7733=>521,7734=>501,7735=>259,7736=>501, -7737=>259,7738=>501,7739=>250,7740=>501,7741=>250,7742=>776,7743=>876,7744=>776,7745=>876,7746=>776, -7747=>876,7748=>673,7749=>570,7750=>673,7751=>570,7752=>673,7753=>570,7754=>673,7755=>570,7756=>708, -7757=>550,7758=>708,7759=>550,7760=>708,7761=>550,7762=>708,7763=>550,7764=>542,7765=>571,7766=>542, -7767=>571,7768=>625,7769=>370,7770=>625,7771=>370,7772=>625,7773=>370,7774=>625,7775=>370,7776=>571, -7777=>469,7778=>571,7779=>469,7780=>571,7781=>469,7782=>571,7783=>469,7784=>571,7785=>469,7786=>549, -7787=>353,7788=>549,7789=>353,7790=>549,7791=>353,7792=>549,7793=>353,7794=>659,7795=>570,7796=>659, -7797=>570,7798=>659,7799=>570,7800=>659,7801=>570,7802=>659,7803=>570,7804=>615,7805=>532,7806=>615, -7807=>532,7808=>890,7809=>736,7810=>890,7811=>736,7812=>890,7813=>736,7814=>890,7815=>736,7816=>890, -7817=>736,7818=>616,7819=>532,7820=>616,7821=>532,7822=>549,7823=>532,7824=>616,7825=>472,7826=>616, -7827=>472,7828=>616,7829=>472,7830=>570,7831=>353,7832=>736,7833=>532,7834=>551,7835=>316,7838=>691, -7839=>550,7840=>615,7841=>551,7842=>615,7843=>551,7844=>615,7845=>551,7846=>615,7847=>551,7848=>615, -7849=>551,7850=>615,7851=>551,7852=>615,7853=>551,7854=>615,7855=>551,7856=>615,7857=>551,7858=>615, -7859=>551,7860=>615,7861=>551,7862=>615,7863=>551,7864=>568,7865=>554,7866=>568,7867=>554,7868=>568, -7869=>554,7870=>568,7871=>554,7872=>568,7873=>554,7874=>568,7875=>554,7876=>568,7877=>554,7878=>568, -7879=>554,7880=>265,7881=>250,7882=>265,7883=>250,7884=>708,7885=>550,7886=>708,7887=>550,7888=>708, -7889=>550,7890=>708,7891=>550,7892=>708,7893=>550,7894=>708,7895=>550,7896=>708,7897=>550,7898=>822, -7899=>550,7900=>822,7901=>550,7902=>822,7903=>550,7904=>822,7905=>550,7906=>822,7907=>550,7908=>659, -7909=>570,7910=>659,7911=>570,7912=>772,7913=>570,7914=>772,7915=>570,7916=>772,7917=>570,7918=>772, -7919=>570,7920=>772,7921=>570,7922=>549,7923=>532,7924=>549,7925=>532,7926=>549,7927=>532,7928=>549, -7929=>532,7936=>593,7937=>593,7938=>593,7939=>593,7940=>593,7941=>593,7942=>593,7943=>593,7944=>615, -7945=>615,7946=>790,7947=>790,7948=>692,7949=>721,7950=>637,7951=>668,7952=>486,7953=>486,7954=>486, -7955=>486,7956=>486,7957=>486,7960=>640,7961=>640,7962=>869,7963=>877,7964=>809,7965=>835,7968=>570, -7969=>570,7970=>570,7971=>570,7972=>570,7973=>570,7974=>570,7975=>570,7976=>753,7977=>751,7978=>977, -7979=>980,7980=>924,7981=>945,7982=>840,7983=>852,7984=>304,7985=>304,7986=>304,7987=>304,7988=>304, -7989=>304,7990=>304,7991=>304,7992=>342,7993=>336,7994=>571,7995=>571,7996=>513,7997=>540,7998=>440, -7999=>443,8000=>550,8001=>550,8002=>550,8003=>550,8004=>550,8005=>550,8008=>724,8009=>763,8010=>985, -8011=>989,8012=>844,8013=>873,8016=>521,8017=>521,8018=>521,8019=>521,8020=>521,8021=>521,8022=>521, -8023=>521,8025=>705,8027=>897,8029=>911,8031=>808,8032=>753,8033=>753,8034=>753,8035=>753,8036=>753, -8037=>753,8038=>753,8039=>753,8040=>722,8041=>759,8042=>980,8043=>985,8044=>851,8045=>875,8046=>829, -8047=>857,8048=>593,8049=>593,8050=>486,8051=>493,8052=>570,8053=>589,8054=>304,8055=>304,8056=>550, -8057=>550,8058=>521,8059=>521,8060=>753,8061=>753,8064=>593,8065=>593,8066=>593,8067=>593,8068=>593, -8069=>593,8070=>593,8071=>593,8072=>615,8073=>615,8074=>790,8075=>790,8076=>692,8077=>721,8078=>637, -8079=>668,8080=>570,8081=>570,8082=>570,8083=>570,8084=>570,8085=>570,8086=>570,8087=>570,8088=>753, -8089=>751,8090=>977,8091=>980,8092=>924,8093=>945,8094=>840,8095=>852,8096=>753,8097=>753,8098=>753, -8099=>753,8100=>753,8101=>753,8102=>753,8103=>753,8104=>722,8105=>759,8106=>980,8107=>985,8108=>851, -8109=>875,8110=>829,8111=>857,8112=>593,8113=>593,8114=>593,8115=>593,8116=>593,8118=>593,8119=>593, -8120=>615,8121=>615,8122=>645,8123=>623,8124=>615,8125=>450,8126=>450,8127=>450,8128=>450,8129=>450, -8130=>570,8131=>570,8132=>589,8134=>570,8135=>570,8136=>724,8137=>671,8138=>837,8139=>784,8140=>677, -8141=>450,8142=>450,8143=>450,8144=>304,8145=>304,8146=>304,8147=>304,8150=>304,8151=>304,8152=>265, -8153=>265,8154=>427,8155=>367,8157=>450,8158=>450,8159=>450,8160=>521,8161=>521,8162=>521,8163=>521, -8164=>571,8165=>571,8166=>521,8167=>521,8168=>549,8169=>549,8170=>760,8171=>742,8172=>616,8173=>450, -8174=>450,8175=>450,8178=>753,8179=>753,8180=>753,8182=>753,8183=>753,8184=>847,8185=>731,8186=>830, -8187=>743,8188=>688,8189=>450,8190=>450,8192=>450,8193=>900,8194=>450,8195=>900,8196=>296,8197=>225, -8198=>150,8199=>572,8200=>286,8201=>180,8202=>89,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0, -8208=>325,8209=>325,8210=>572,8213=>900,8214=>450,8215=>450,8219=>286,8223=>466,8227=>531,8228=>301, -8229=>601,8231=>286,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>180,8241=>1562,8242=>204, -8243=>336,8244=>468,8245=>204,8246=>336,8247=>468,8248=>305,8251=>754,8252=>437,8253=>478,8254=>450, -8255=>723,8256=>723,8257=>225,8258=>900,8259=>450,8260=>150,8261=>351,8262=>351,8263=>830,8264=>659, -8265=>659,8266=>447,8267=>572,8268=>450,8269=>450,8270=>450,8271=>303,8272=>723,8273=>450,8274=>404, -8275=>900,8276=>723,8277=>754,8278=>527,8279=>597,8280=>754,8281=>754,8282=>286,8283=>717,8284=>754, -8285=>286,8286=>286,8287=>200,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0, -8300=>0,8301=>0,8302=>0,8303=>0,8304=>360,8305=>161,8308=>360,8309=>360,8310=>360,8311=>360, -8312=>360,8313=>360,8314=>475,8315=>475,8316=>475,8317=>221,8318=>221,8319=>358,8320=>360,8321=>360, -8322=>360,8323=>360,8324=>360,8325=>360,8326=>360,8327=>360,8328=>360,8329=>360,8330=>475,8331=>475, -8332=>475,8333=>221,8334=>221,8336=>352,8337=>375,8338=>372,8339=>399,8340=>375,8352=>789,8353=>572, -8354=>572,8355=>572,8356=>572,8357=>876,8358=>673,8359=>1145,8360=>966,8361=>890,8362=>706,8363=>571, -8365=>572,8366=>572,8367=>1145,8368=>572,8369=>572,8370=>572,8371=>572,8372=>696,8373=>577,8400=>0, -8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>917,8449=>917,8450=>628,8451=>1011, -8452=>578,8453=>917,8454=>960,8455=>553,8456=>628,8457=>856,8459=>889,8460=>679,8461=>765,8462=>570, -8463=>570,8464=>422,8465=>627,8466=>648,8467=>372,8468=>736,8469=>721,8470=>936,8471=>900,8472=>627, -8473=>631,8474=>708,8475=>718,8476=>732,8477=>712,8478=>807,8479=>615,8480=>917,8481=>967,8483=>615, -8484=>670,8485=>520,8486=>688,8487=>688,8488=>554,8489=>304,8490=>590,8491=>615,8492=>708,8493=>633, -8494=>769,8495=>532,8496=>545,8497=>708,8498=>518,8499=>962,8500=>416,8501=>670,8502=>606,8503=>419, -8504=>580,8505=>342,8506=>833,8507=>1074,8508=>632,8509=>655,8510=>589,8511=>764,8512=>729,8513=>697, -8514=>501,8515=>501,8516=>549,8517=>737,8518=>637,8519=>554,8520=>316,8521=>316,8523=>702,8526=>474, -8531=>872,8532=>872,8533=>872,8534=>872,8535=>872,8536=>872,8537=>872,8538=>872,8539=>872,8540=>872, -8541=>872,8542=>872,8543=>511,8544=>265,8545=>443,8546=>620,8547=>831,8548=>615,8549=>830,8550=>1007, -8551=>1185,8552=>826,8553=>616,8554=>839,8555=>1018,8556=>501,8557=>628,8558=>693,8559=>776,8560=>250, -8561=>412,8562=>573,8563=>730,8564=>532,8565=>729,8566=>892,8567=>1053,8568=>737,8569=>532,8570=>740, -8571=>901,8572=>250,8573=>495,8574=>571,8575=>876,8576=>1121,8577=>693,8578=>1121,8579=>633,8580=>494, -8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754,8600=>754,8601=>754, -8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754,8610=>754,8611=>754, -8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754,8620=>754,8621=>754, -8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754,8630=>754,8631=>754, -8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754,8640=>754,8641=>754, -8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754,8650=>754,8651=>754, -8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754,8660=>754,8661=>754, -8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754,8670=>754,8671=>754, -8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754,8680=>754,8681=>754, -8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754,8690=>754,8691=>754, -8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754,8700=>754,8701=>754, -8702=>754,8703=>754,8704=>615,8705=>572,8706=>465,8707=>568,8708=>568,8709=>784,8710=>602,8711=>602, -8712=>784,8713=>784,8714=>646,8715=>784,8716=>784,8717=>646,8718=>572,8719=>681,8720=>681,8721=>606, -8722=>754,8723=>754,8724=>754,8725=>303,8726=>573,8727=>754,8728=>563,8729=>563,8730=>573,8731=>573, -8732=>573,8733=>643,8734=>750,8735=>754,8736=>807,8737=>807,8738=>754,8739=>450,8740=>450,8741=>450, -8742=>450,8743=>659,8744=>659,8745=>659,8746=>659,8747=>469,8748=>710,8749=>951,8750=>469,8751=>710, -8752=>951,8753=>469,8754=>469,8755=>469,8756=>572,8757=>572,8758=>234,8759=>572,8760=>754,8761=>754, -8762=>754,8763=>754,8764=>754,8765=>754,8766=>754,8767=>754,8768=>337,8769=>754,8770=>754,8771=>754, -8772=>754,8773=>754,8774=>754,8775=>754,8776=>754,8777=>754,8778=>754,8779=>754,8780=>754,8781=>754, -8782=>754,8783=>754,8784=>754,8785=>754,8786=>755,8787=>755,8788=>900,8789=>900,8790=>754,8791=>754, -8792=>754,8793=>754,8794=>754,8795=>754,8796=>754,8797=>754,8798=>754,8799=>754,8800=>754,8801=>754, -8802=>754,8803=>754,8804=>754,8805=>754,8806=>754,8807=>754,8808=>754,8809=>754,8810=>942,8811=>942, -8812=>417,8813=>754,8814=>754,8815=>754,8816=>754,8817=>754,8818=>754,8819=>754,8820=>754,8821=>754, -8822=>754,8823=>754,8824=>754,8825=>754,8826=>754,8827=>754,8828=>754,8829=>754,8830=>754,8831=>754, -8832=>754,8833=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8840=>754,8841=>754, -8842=>754,8843=>754,8844=>659,8845=>659,8846=>659,8847=>754,8848=>754,8849=>754,8850=>754,8851=>702, -8852=>702,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754, -8862=>754,8863=>754,8864=>754,8865=>754,8866=>784,8867=>784,8868=>784,8869=>784,8870=>468,8871=>468, -8872=>784,8873=>784,8874=>784,8875=>784,8876=>784,8877=>784,8878=>784,8879=>784,8880=>754,8881=>754, -8882=>754,8883=>754,8884=>754,8885=>754,8886=>900,8887=>900,8888=>754,8889=>754,8890=>468,8891=>659, -8892=>659,8893=>659,8894=>754,8895=>754,8896=>738,8897=>738,8898=>738,8899=>738,8900=>444,8901=>286, -8902=>563,8903=>754,8904=>900,8905=>900,8906=>900,8907=>900,8908=>900,8909=>754,8910=>659,8911=>659, -8912=>754,8913=>754,8914=>754,8915=>754,8916=>754,8917=>754,8918=>754,8919=>754,8920=>1280,8921=>1280, -8922=>754,8923=>754,8924=>754,8925=>754,8926=>754,8927=>754,8928=>754,8929=>754,8930=>754,8931=>754, -8932=>754,8933=>754,8934=>754,8935=>754,8936=>754,8937=>754,8938=>754,8939=>754,8940=>754,8941=>754, -8942=>900,8943=>900,8944=>900,8945=>900,8946=>900,8947=>784,8948=>646,8949=>784,8950=>784,8951=>646, -8952=>784,8953=>784,8954=>900,8955=>784,8956=>646,8957=>784,8958=>646,8959=>784,8960=>542,8961=>542, -8962=>571,8963=>754,8964=>754,8965=>754,8966=>754,8967=>439,8968=>351,8969=>351,8970=>351,8971=>351, -8972=>728,8973=>728,8974=>728,8975=>728,8976=>754,8977=>461,8984=>900,8985=>754,8988=>422,8989=>422, -8990=>422,8991=>422,8992=>469,8993=>469,8996=>1037,8997=>1037,8998=>1272,8999=>1037,9000=>1299,9003=>1272, -9004=>786,9075=>304,9076=>571,9077=>753,9082=>593,9085=>681,9095=>1037,9108=>786,9115=>450,9116=>450, -9117=>450,9118=>450,9119=>450,9120=>450,9121=>450,9122=>450,9123=>450,9124=>450,9125=>450,9126=>450, -9127=>675,9128=>675,9129=>675,9130=>675,9131=>675,9132=>675,9133=>675,9134=>469,9166=>754,9167=>850, -9187=>786,9189=>692,9250=>571,9251=>571,9312=>807,9313=>807,9314=>807,9315=>807,9316=>807,9317=>807, -9318=>807,9319=>807,9320=>807,9321=>807,9472=>542,9473=>542,9474=>542,9475=>542,9476=>542,9477=>542, -9478=>542,9479=>542,9480=>542,9481=>542,9482=>542,9483=>542,9484=>542,9485=>542,9486=>542,9487=>542, -9488=>542,9489=>542,9490=>542,9491=>542,9492=>542,9493=>542,9494=>542,9495=>542,9496=>542,9497=>542, -9498=>542,9499=>542,9500=>542,9501=>542,9502=>542,9503=>542,9504=>542,9505=>542,9506=>542,9507=>542, -9508=>542,9509=>542,9510=>542,9511=>542,9512=>542,9513=>542,9514=>542,9515=>542,9516=>542,9517=>542, -9518=>542,9519=>542,9520=>542,9521=>542,9522=>542,9523=>542,9524=>542,9525=>542,9526=>542,9527=>542, -9528=>542,9529=>542,9530=>542,9531=>542,9532=>542,9533=>542,9534=>542,9535=>542,9536=>542,9537=>542, -9538=>542,9539=>542,9540=>542,9541=>542,9542=>542,9543=>542,9544=>542,9545=>542,9546=>542,9547=>542, -9548=>542,9549=>542,9550=>542,9551=>542,9552=>542,9553=>542,9554=>542,9555=>542,9556=>542,9557=>542, -9558=>542,9559=>542,9560=>542,9561=>542,9562=>542,9563=>542,9564=>542,9565=>542,9566=>542,9567=>542, -9568=>542,9569=>542,9570=>542,9571=>542,9572=>542,9573=>542,9574=>542,9575=>542,9576=>542,9577=>542, -9578=>542,9579=>542,9580=>542,9581=>542,9582=>542,9583=>542,9584=>542,9585=>542,9586=>542,9587=>542, -9588=>542,9589=>542,9590=>542,9591=>542,9592=>542,9593=>542,9594=>542,9595=>542,9596=>542,9597=>542, -9598=>542,9599=>542,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692,9606=>692,9607=>692, -9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692,9616=>692,9617=>692, -9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692,9626=>692,9627=>692, -9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850,9636=>850,9637=>850, -9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850,9646=>495,9647=>495, -9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692,9656=>452,9657=>452, -9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692,9666=>452,9667=>452, -9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785,9676=>785,9677=>785, -9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785,9686=>474,9687=>474, -9688=>712,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348,9696=>785,9697=>785, -9698=>692,9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850,9706=>850,9707=>850, -9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850,9716=>785,9717=>785, -9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659,9726=>659,9727=>692, -9728=>807,9729=>900,9730=>807,9731=>807,9732=>807,9733=>807,9734=>807,9735=>515,9736=>806,9737=>807, -9738=>799,9739=>799,9740=>604,9741=>911,9742=>1121,9743=>1125,9744=>807,9745=>807,9746=>807,9747=>479, -9748=>807,9749=>807,9750=>807,9751=>807,9752=>807,9753=>807,9754=>807,9755=>807,9756=>807,9757=>548, -9758=>807,9759=>548,9760=>807,9761=>807,9762=>807,9763=>807,9764=>602,9765=>671,9766=>584,9767=>705, -9768=>490,9769=>807,9770=>807,9771=>807,9772=>639,9773=>807,9774=>807,9775=>807,9776=>807,9777=>807, -9778=>807,9779=>807,9780=>807,9781=>807,9782=>807,9783=>807,9784=>807,9785=>807,9786=>807,9787=>807, -9788=>807,9789=>807,9790=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807,9796=>807,9797=>807, -9798=>807,9799=>807,9800=>807,9801=>807,9802=>807,9803=>807,9804=>807,9805=>807,9806=>807,9807=>807, -9808=>807,9809=>807,9810=>807,9811=>807,9812=>807,9813=>807,9814=>807,9815=>807,9816=>807,9817=>807, -9818=>807,9819=>807,9820=>807,9821=>807,9822=>807,9823=>807,9824=>807,9825=>807,9826=>807,9827=>807, -9828=>807,9829=>807,9830=>807,9831=>807,9832=>807,9833=>424,9834=>574,9835=>807,9836=>807,9837=>424, -9838=>321,9839=>435,9840=>673,9841=>689,9842=>807,9843=>807,9844=>807,9845=>807,9846=>807,9847=>807, -9848=>807,9849=>807,9850=>807,9851=>807,9852=>807,9853=>807,9854=>807,9855=>807,9856=>782,9857=>782, -9858=>782,9859=>782,9860=>782,9861=>782,9862=>807,9863=>807,9864=>807,9865=>807,9866=>807,9867=>807, -9868=>807,9869=>807,9870=>807,9871=>807,9872=>807,9873=>807,9874=>807,9875=>807,9876=>807,9877=>487, -9878=>807,9879=>807,9880=>807,9881=>807,9882=>807,9883=>807,9884=>807,9888=>807,9889=>632,9890=>903, -9891=>977,9892=>1028,9893=>811,9894=>754,9895=>754,9896=>754,9897=>754,9898=>754,9899=>754,9900=>754, -9901=>754,9902=>754,9903=>754,9904=>759,9905=>754,9906=>658,9907=>659,9908=>659,9909=>659,9910=>765, -9911=>659,9912=>659,9985=>754,9986=>754,9987=>754,9988=>754,9990=>754,9991=>754,9992=>754,9993=>754, -9996=>754,9997=>754,9998=>754,9999=>754,10000=>754,10001=>754,10002=>754,10003=>754,10004=>754,10005=>754, -10006=>754,10007=>754,10008=>754,10009=>754,10010=>754,10011=>754,10012=>754,10013=>754,10014=>754,10015=>754, -10016=>754,10017=>754,10018=>754,10019=>754,10020=>754,10021=>754,10022=>754,10023=>754,10025=>754,10026=>754, -10027=>754,10028=>754,10029=>754,10030=>754,10031=>754,10032=>754,10033=>754,10034=>754,10035=>754,10036=>754, -10037=>754,10038=>754,10039=>754,10040=>754,10041=>754,10042=>754,10043=>754,10044=>754,10045=>754,10046=>754, -10047=>754,10048=>754,10049=>754,10050=>754,10051=>754,10052=>754,10053=>754,10054=>754,10055=>754,10056=>754, -10057=>754,10058=>754,10059=>754,10061=>807,10063=>807,10064=>807,10065=>807,10066=>807,10070=>807,10072=>754, -10073=>754,10074=>754,10075=>290,10076=>290,10077=>484,10078=>484,10081=>754,10082=>754,10083=>754,10084=>754, -10085=>754,10086=>754,10087=>754,10088=>754,10089=>754,10090=>754,10091=>754,10092=>754,10093=>754,10094=>754, -10095=>754,10096=>754,10097=>754,10098=>754,10099=>754,10100=>754,10101=>754,10102=>807,10103=>807,10104=>807, -10105=>807,10106=>807,10107=>807,10108=>807,10109=>807,10110=>807,10111=>807,10112=>754,10113=>754,10114=>754, -10115=>754,10116=>754,10117=>754,10118=>754,10119=>754,10120=>754,10121=>754,10122=>754,10123=>754,10124=>754, -10125=>754,10126=>754,10127=>754,10128=>754,10129=>754,10130=>754,10131=>754,10132=>754,10136=>754,10137=>754, -10138=>754,10139=>754,10140=>754,10141=>754,10142=>754,10143=>754,10144=>754,10145=>754,10146=>754,10147=>754, -10148=>754,10149=>754,10150=>754,10151=>754,10152=>754,10153=>754,10154=>754,10155=>754,10156=>754,10157=>754, -10158=>754,10159=>754,10161=>754,10162=>754,10163=>754,10164=>754,10165=>754,10166=>754,10167=>754,10168=>754, -10169=>754,10170=>754,10171=>754,10172=>754,10173=>754,10174=>754,10181=>351,10182=>351,10208=>444,10214=>445, -10215=>445,10216=>351,10217=>351,10218=>500,10219=>500,10224=>754,10225=>754,10226=>754,10227=>754,10228=>1042, -10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290,10237=>1290,10238=>1290, -10239=>1290,10240=>659,10241=>659,10242=>659,10243=>659,10244=>659,10245=>659,10246=>659,10247=>659,10248=>659, -10249=>659,10250=>659,10251=>659,10252=>659,10253=>659,10254=>659,10255=>659,10256=>659,10257=>659,10258=>659, -10259=>659,10260=>659,10261=>659,10262=>659,10263=>659,10264=>659,10265=>659,10266=>659,10267=>659,10268=>659, -10269=>659,10270=>659,10271=>659,10272=>659,10273=>659,10274=>659,10275=>659,10276=>659,10277=>659,10278=>659, -10279=>659,10280=>659,10281=>659,10282=>659,10283=>659,10284=>659,10285=>659,10286=>659,10287=>659,10288=>659, -10289=>659,10290=>659,10291=>659,10292=>659,10293=>659,10294=>659,10295=>659,10296=>659,10297=>659,10298=>659, -10299=>659,10300=>659,10301=>659,10302=>659,10303=>659,10304=>659,10305=>659,10306=>659,10307=>659,10308=>659, -10309=>659,10310=>659,10311=>659,10312=>659,10313=>659,10314=>659,10315=>659,10316=>659,10317=>659,10318=>659, -10319=>659,10320=>659,10321=>659,10322=>659,10323=>659,10324=>659,10325=>659,10326=>659,10327=>659,10328=>659, -10329=>659,10330=>659,10331=>659,10332=>659,10333=>659,10334=>659,10335=>659,10336=>659,10337=>659,10338=>659, -10339=>659,10340=>659,10341=>659,10342=>659,10343=>659,10344=>659,10345=>659,10346=>659,10347=>659,10348=>659, -10349=>659,10350=>659,10351=>659,10352=>659,10353=>659,10354=>659,10355=>659,10356=>659,10357=>659,10358=>659, -10359=>659,10360=>659,10361=>659,10362=>659,10363=>659,10364=>659,10365=>659,10366=>659,10367=>659,10368=>659, -10369=>659,10370=>659,10371=>659,10372=>659,10373=>659,10374=>659,10375=>659,10376=>659,10377=>659,10378=>659, -10379=>659,10380=>659,10381=>659,10382=>659,10383=>659,10384=>659,10385=>659,10386=>659,10387=>659,10388=>659, -10389=>659,10390=>659,10391=>659,10392=>659,10393=>659,10394=>659,10395=>659,10396=>659,10397=>659,10398=>659, -10399=>659,10400=>659,10401=>659,10402=>659,10403=>659,10404=>659,10405=>659,10406=>659,10407=>659,10408=>659, -10409=>659,10410=>659,10411=>659,10412=>659,10413=>659,10414=>659,10415=>659,10416=>659,10417=>659,10418=>659, -10419=>659,10420=>659,10421=>659,10422=>659,10423=>659,10424=>659,10425=>659,10426=>659,10427=>659,10428=>659, -10429=>659,10430=>659,10431=>659,10432=>659,10433=>659,10434=>659,10435=>659,10436=>659,10437=>659,10438=>659, -10439=>659,10440=>659,10441=>659,10442=>659,10443=>659,10444=>659,10445=>659,10446=>659,10447=>659,10448=>659, -10449=>659,10450=>659,10451=>659,10452=>659,10453=>659,10454=>659,10455=>659,10456=>659,10457=>659,10458=>659, -10459=>659,10460=>659,10461=>659,10462=>659,10463=>659,10464=>659,10465=>659,10466=>659,10467=>659,10468=>659, -10469=>659,10470=>659,10471=>659,10472=>659,10473=>659,10474=>659,10475=>659,10476=>659,10477=>659,10478=>659, -10479=>659,10480=>659,10481=>659,10482=>659,10483=>659,10484=>659,10485=>659,10486=>659,10487=>659,10488=>659, -10489=>659,10490=>659,10491=>659,10492=>659,10493=>659,10494=>659,10495=>659,10502=>754,10503=>754,10506=>754, -10507=>754,10560=>615,10561=>615,10627=>660,10628=>660,10702=>754,10703=>900,10704=>900,10705=>900,10706=>900, -10707=>900,10708=>900,10709=>900,10731=>444,10746=>754,10747=>754,10752=>900,10753=>900,10754=>900,10764=>1192, -10765=>469,10766=>469,10767=>469,10768=>469,10769=>469,10770=>469,10771=>469,10772=>469,10773=>469,10774=>469, -10775=>469,10776=>469,10777=>469,10778=>469,10779=>469,10780=>469,10799=>754,10877=>754,10878=>754,10879=>754, -10880=>754,10881=>754,10882=>754,10883=>754,10884=>754,10885=>754,10886=>754,10887=>754,10888=>754,10889=>754, -10890=>754,10891=>754,10892=>754,10893=>754,10894=>754,10895=>754,10896=>754,10897=>754,10898=>754,10899=>754, -10900=>754,10901=>754,10902=>754,10903=>754,10904=>754,10905=>754,10906=>754,10907=>754,10908=>754,10909=>754, -10910=>754,10911=>754,10912=>754,10926=>754,10927=>754,10928=>754,10929=>754,10930=>754,10931=>754,10932=>754, -10933=>754,10934=>754,10935=>754,10936=>754,10937=>754,10938=>754,11001=>754,11002=>754,11008=>754,11009=>754, -11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754,11018=>754,11019=>754, -11020=>754,11021=>754,11022=>752,11023=>752,11024=>752,11025=>752,11026=>850,11027=>850,11028=>850,11029=>850, -11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11039=>782,11040=>782,11041=>786,11042=>786,11043=>786, -11044=>1007,11091=>782,11092=>782,11360=>501,11361=>250,11362=>501,11363=>542,11364=>625,11365=>551,11366=>353, -11367=>677,11368=>570,11369=>590,11370=>521,11371=>616,11372=>472,11373=>703,11374=>776,11375=>615,11377=>661, -11378=>1015,11379=>865,11380=>532,11381=>589,11382=>511,11383=>593,11385=>373,11386=>550,11387=>441,11388=>157, -11389=>387,11568=>582,11569=>799,11570=>799,11571=>614,11572=>615,11573=>571,11574=>505,11575=>615,11576=>615, -11577=>568,11578=>568,11579=>614,11580=>787,11581=>616,11582=>441,11583=>616,11584=>799,11585=>799,11586=>270, -11587=>564,11588=>677,11589=>590,11590=>475,11591=>616,11592=>580,11593=>568,11594=>452,11595=>857,11596=>700, -11597=>673,11598=>558,11599=>265,11600=>700,11601=>265,11602=>677,11603=>569,11604=>799,11605=>799,11606=>677, -11607=>288,11608=>674,11609=>799,11610=>799,11611=>628,11612=>690,11613=>616,11614=>628,11615=>560,11616=>615, -11617=>677,11618=>568,11619=>709,11620=>510,11621=>709,11631=>463,11800=>478,11810=>351,11811=>351,11812=>351, -11813=>351,11822=>478,19904=>807,19905=>807,19906=>807,19907=>807,19908=>807,19909=>807,19910=>807,19911=>807, -19912=>807,19913=>807,19914=>807,19915=>807,19916=>807,19917=>807,19918=>807,19919=>807,19920=>807,19921=>807, -19922=>807,19923=>807,19924=>807,19925=>807,19926=>807,19927=>807,19928=>807,19929=>807,19930=>807,19931=>807, -19932=>807,19933=>807,19934=>807,19935=>807,19936=>807,19937=>807,19938=>807,19939=>807,19940=>807,19941=>807, -19942=>807,19943=>807,19944=>807,19945=>807,19946=>807,19947=>807,19948=>807,19949=>807,19950=>807,19951=>807, -19952=>807,19953=>807,19954=>807,19955=>807,19956=>807,19957=>807,19958=>807,19959=>807,19960=>807,19961=>807, -19962=>807,19963=>807,19964=>807,19965=>807,19966=>807,19967=>807,42564=>571,42565=>469,42566=>318,42567=>304, -42572=>1062,42573=>925,42576=>926,42577=>815,42580=>971,42581=>757,42582=>879,42583=>758,42594=>956,42595=>820, -42596=>959,42597=>811,42598=>1060,42599=>907,42600=>708,42601=>550,42602=>770,42603=>641,42604=>1222,42605=>917, -42606=>791,42634=>704,42635=>616,42636=>549,42637=>524,42644=>617,42645=>570,42760=>444,42761=>444,42762=>444, -42763=>444,42764=>444,42765=>444,42766=>444,42767=>444,42768=>444,42769=>444,42770=>444,42771=>444,42772=>444, -42773=>444,42774=>444,42779=>332,42780=>332,42781=>227,42782=>227,42783=>227,42790=>677,42791=>570,42792=>790, -42793=>638,42794=>553,42795=>486,42800=>441,42801=>469,42802=>1125,42803=>886,42804=>1083,42805=>891,42806=>1028, -42807=>883,42808=>874,42809=>736,42810=>874,42811=>736,42812=>863,42813=>736,42814=>633,42815=>494,42822=>612, -42823=>353,42824=>523,42825=>384,42826=>726,42827=>633,42830=>1222,42831=>917,42880=>501,42881=>250,42882=>662, -42883=>570,42889=>303,42890=>338,42891=>360,42892=>247,43003=>518,43004=>542,43005=>776,43006=>265,43007=>1079, -61440=>879,61441=>879,63173=>550,64256=>620,64257=>567,64258=>567,64259=>870,64260=>870,64261=>617,64262=>774, -64275=>1081,64276=>1081,64277=>1076,64278=>1067,64279=>1376,64285=>245,64286=>0,64287=>423,64288=>572,64289=>770, -64290=>696,64291=>815,64292=>694,64293=>759,64294=>769,64295=>726,64296=>788,64297=>754,64298=>727,64299=>727, -64300=>727,64301=>727,64302=>566,64303=>566,64304=>566,64305=>547,64306=>403,64307=>534,64308=>576,64309=>245, -64310=>336,64312=>583,64313=>302,64314=>532,64315=>500,64316=>539,64318=>593,64320=>397,64321=>629,64323=>576, -64324=>543,64326=>523,64327=>596,64328=>532,64329=>727,64330=>591,64331=>245,64332=>547,64333=>500,64334=>543, -64335=>566,64338=>847,64339=>883,64340=>250,64341=>271,64342=>847,64343=>883,64344=>250,64345=>271,64346=>847, -64347=>883,64348=>250,64349=>271,64350=>847,64351=>883,64352=>250,64353=>271,64354=>847,64355=>883,64356=>250, -64357=>271,64358=>847,64359=>883,64360=>250,64361=>271,64362=>933,64363=>932,64364=>430,64365=>455,64366=>933, -64367=>932,64368=>430,64369=>455,64370=>581,64371=>581,64372=>556,64373=>581,64374=>581,64375=>581,64376=>556, -64377=>581,64378=>581,64379=>581,64380=>556,64381=>581,64382=>581,64383=>581,64384=>556,64385=>581,64394=>435, -64395=>497,64396=>435,64397=>497,64398=>805,64399=>805,64400=>428,64401=>497,64402=>805,64403=>805,64404=>428, -64405=>497,64414=>661,64415=>685,64473=>435,64474=>465,64488=>250,64489=>271,64508=>704,64509=>750,64510=>250, -64511=>271,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0, -65059=>0,65136=>264,65137=>264,65138=>264,65139=>235,65140=>264,65142=>264,65143=>264,65144=>264,65145=>264, -65146=>264,65147=>264,65148=>264,65149=>264,65150=>264,65151=>264,65152=>423,65153=>250,65154=>274,65155=>250, -65156=>274,65157=>435,65158=>465,65159=>250,65160=>274,65161=>704,65162=>750,65163=>250,65164=>271,65165=>250, -65166=>274,65167=>847,65168=>883,65169=>250,65170=>271,65171=>471,65172=>482,65173=>847,65174=>883,65175=>250, -65176=>271,65177=>847,65178=>883,65179=>250,65180=>271,65181=>581,65182=>581,65183=>556,65184=>581,65185=>581, -65186=>581,65187=>556,65188=>581,65189=>581,65190=>581,65191=>556,65192=>581,65193=>400,65194=>472,65195=>400, -65196=>472,65197=>435,65198=>497,65199=>435,65200=>497,65201=>1099,65202=>1147,65203=>754,65204=>803,65205=>1099, -65206=>1147,65207=>754,65208=>803,65209=>1088,65210=>1103,65211=>764,65212=>780,65213=>1088,65214=>1103,65215=>764, -65216=>780,65217=>832,65218=>854,65219=>716,65220=>738,65221=>832,65222=>854,65223=>716,65224=>738,65225=>537, -65226=>479,65227=>537,65228=>434,65229=>537,65230=>479,65231=>470,65232=>434,65233=>933,65234=>932,65235=>430, -65236=>455,65237=>698,65238=>750,65239=>430,65240=>455,65241=>742,65242=>758,65243=>428,65244=>497,65245=>654, -65246=>681,65247=>274,65248=>298,65249=>557,65250=>599,65251=>482,65252=>520,65253=>661,65254=>685,65255=>250, -65256=>271,65257=>471,65258=>482,65259=>475,65260=>415,65261=>435,65262=>465,65263=>704,65264=>750,65265=>704, -65266=>750,65267=>250,65268=>271,65269=>513,65270=>537,65271=>513,65272=>537,65273=>513,65274=>537,65275=>513, -65276=>537,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>923); -$enc=''; -$diff=''; -$file='dejavusanscondensed.z'; -$ctg='dejavusanscondensed.ctg.z'; -$originalsize=544636; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.z deleted file mode 100644 index 8198081c7b..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensed.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.ctg.z deleted file mode 100644 index 514062cca2..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.php deleted file mode 100644 index f53d0a6b62..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.php +++ /dev/null @@ -1,504 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansCondensed-Bold'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>17,'Flags'=>32,'FontBBox'=>'[-962 -385 1777 1174]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>313,33=>410,34=>469,35=>754,36=>626,37=>901,38=>785,39=>275,40=>411, -41=>411,42=>470,43=>754,44=>342,45=>374,46=>342,47=>329,48=>626,49=>626,50=>626, -51=>626,52=>626,53=>626,54=>626,55=>626,56=>626,57=>626,58=>360,59=>360,60=>754, -61=>754,62=>754,63=>522,64=>900,65=>696,66=>686,67=>660,68=>747,69=>615,70=>615, -71=>738,72=>753,73=>334,74=>334,75=>697,76=>573,77=>896,78=>753,79=>765,80=>659, -81=>765,82=>693,83=>648,84=>614,85=>730,86=>696,87=>993,88=>694,89=>651,90=>652, -91=>411,92=>329,93=>411,94=>754,95=>450,96=>450,97=>607,98=>644,99=>533,100=>644, -101=>610,102=>391,103=>644,104=>641,105=>308,106=>308,107=>598,108=>308,109=>938,110=>641, -111=>618,112=>644,113=>644,114=>444,115=>536,116=>430,117=>641,118=>586,119=>831,120=>580, -121=>586,122=>523,123=>641,124=>329,125=>641,126=>754,8364=>626,8218=>342,402=>391,8222=>591, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1296,352=>648,8249=>371,338=>1050,381=>652,8216=>342, -8217=>342,8220=>591,8221=>591,8226=>575,8211=>450,8212=>900,732=>450,8482=>900,353=>536,8250=>371, -339=>984,382=>523,376=>651,160=>313,161=>410,162=>626,163=>626,164=>572,165=>626,166=>329, -167=>450,168=>450,169=>900,170=>507,171=>581,172=>754,173=>374,174=>900,175=>450,176=>450, -177=>754,178=>394,179=>394,180=>450,181=>662,182=>572,183=>342,184=>450,185=>394,186=>507, -187=>581,188=>932,189=>932,190=>932,191=>522,192=>696,193=>696,194=>696,195=>696,196=>696, -197=>696,198=>976,199=>660,200=>615,201=>615,202=>615,203=>615,204=>334,205=>334,206=>334, -207=>334,208=>754,209=>753,210=>765,211=>765,212=>765,213=>765,214=>765,215=>754,216=>765, -217=>730,218=>730,219=>730,220=>730,221=>651,222=>664,223=>647,224=>607,225=>607,226=>607, -227=>607,228=>607,229=>607,230=>943,231=>533,232=>610,233=>610,234=>610,235=>610,236=>308, -237=>308,238=>308,239=>308,240=>618,241=>641,242=>618,243=>618,244=>618,245=>618,246=>618, -247=>754,248=>618,249=>641,250=>641,251=>641,252=>641,253=>586,254=>644,255=>586,256=>696, -257=>607,258=>696,259=>607,260=>696,261=>607,262=>660,263=>533,264=>660,265=>533,266=>660, -267=>533,268=>660,269=>533,270=>747,271=>644,272=>754,273=>644,274=>615,275=>610,276=>615, -277=>610,278=>615,279=>610,280=>615,281=>610,282=>615,283=>610,284=>738,285=>644,286=>738, -287=>644,288=>738,289=>644,290=>738,291=>644,292=>753,293=>641,294=>876,295=>711,296=>334, -297=>308,298=>334,299=>308,300=>334,301=>308,302=>334,303=>308,304=>334,305=>308,306=>669, -307=>617,308=>334,309=>308,310=>697,311=>598,312=>598,313=>573,314=>308,315=>573,316=>308, -317=>573,318=>431,319=>573,320=>501,321=>578,322=>334,323=>753,324=>641,325=>753,326=>641, -327=>753,328=>641,329=>884,330=>753,331=>641,332=>765,333=>618,334=>765,335=>618,336=>765, -337=>618,340=>693,341=>444,342=>693,343=>444,344=>693,345=>444,346=>648,347=>536,348=>648, -349=>536,350=>648,351=>536,354=>614,355=>430,356=>614,357=>430,358=>614,359=>430,360=>730, -361=>641,362=>730,363=>641,364=>730,365=>641,366=>730,367=>641,368=>730,369=>641,370=>730, -371=>641,372=>993,373=>831,374=>651,375=>586,377=>652,378=>523,379=>652,380=>523,383=>391, -384=>644,385=>729,386=>686,387=>644,388=>686,389=>644,390=>660,391=>660,392=>533,393=>754, -394=>791,395=>681,396=>644,397=>619,398=>615,399=>764,400=>626,401=>615,403=>738,404=>713, -405=>940,406=>392,407=>350,408=>697,409=>598,410=>324,411=>532,412=>938,413=>753,414=>641, -415=>765,416=>786,417=>618,418=>974,419=>821,420=>703,421=>644,422=>693,423=>648,424=>536, -425=>615,426=>497,427=>430,428=>636,429=>430,430=>614,431=>751,432=>641,433=>765,434=>732, -435=>717,436=>700,437=>652,438=>523,439=>695,440=>695,441=>576,442=>523,443=>626,444=>695, -445=>576,446=>515,447=>644,448=>334,449=>593,450=>489,451=>334,452=>1399,453=>1271,454=>1168, -455=>908,456=>882,457=>617,458=>1088,459=>1062,460=>949,461=>696,462=>607,463=>334,464=>308, -465=>765,466=>618,467=>730,468=>641,469=>730,470=>641,471=>730,472=>641,473=>730,474=>641, -475=>730,476=>641,477=>610,478=>696,479=>607,480=>696,481=>607,482=>976,483=>943,484=>738, -485=>644,486=>738,487=>644,488=>697,489=>598,490=>765,491=>618,492=>765,493=>618,494=>695, -495=>523,496=>308,497=>1399,498=>1271,499=>1168,500=>738,501=>644,502=>1160,503=>708,504=>753, -505=>641,506=>696,507=>607,508=>976,509=>943,510=>765,511=>618,512=>696,513=>607,514=>696, -515=>607,516=>615,517=>610,518=>615,519=>610,520=>334,521=>308,522=>334,523=>308,524=>765, -525=>618,526=>765,527=>618,528=>693,529=>444,530=>693,531=>444,532=>730,533=>641,534=>730, -535=>641,536=>648,537=>536,538=>614,539=>430,540=>621,541=>546,542=>753,543=>641,544=>753, -545=>778,546=>728,547=>593,548=>652,549=>523,550=>696,551=>607,552=>615,553=>610,554=>765, -555=>618,556=>765,557=>618,558=>765,559=>618,560=>765,561=>618,562=>651,563=>586,564=>442, -565=>780,566=>460,567=>308,568=>979,569=>979,570=>696,571=>660,572=>533,573=>573,574=>614, -575=>536,576=>523,577=>703,578=>553,579=>686,580=>730,581=>696,582=>615,583=>610,584=>334, -585=>308,586=>774,587=>712,588=>693,589=>444,590=>651,591=>586,592=>607,593=>644,594=>644, -595=>644,596=>533,597=>533,598=>645,599=>712,600=>610,601=>610,602=>788,603=>501,604=>490, -605=>733,606=>658,607=>308,608=>712,609=>644,610=>564,611=>579,612=>571,613=>641,614=>641, -615=>641,616=>491,617=>396,618=>491,619=>502,620=>624,621=>308,622=>757,623=>938,624=>938, -625=>938,626=>641,627=>713,628=>636,629=>618,630=>817,631=>613,632=>716,633=>484,634=>484, -635=>584,636=>444,637=>444,638=>536,639=>536,640=>578,641=>578,642=>536,643=>374,644=>391, -645=>544,646=>497,647=>430,648=>430,649=>828,650=>695,651=>603,652=>586,653=>831,654=>586, -655=>651,656=>624,657=>615,658=>576,659=>576,660=>515,661=>515,662=>515,663=>515,664=>765, -665=>569,666=>658,667=>616,668=>622,669=>308,670=>659,671=>485,672=>712,673=>515,674=>515, -675=>1040,676=>1093,677=>1039,678=>876,679=>691,680=>836,681=>923,682=>712,683=>702,684=>532, -685=>374,686=>609,687=>710,688=>410,689=>410,690=>197,691=>284,692=>284,693=>284,694=>369, -695=>532,696=>375,697=>271,698=>469,699=>342,700=>342,701=>342,702=>330,703=>330,704=>293, -705=>293,706=>450,707=>450,708=>450,709=>450,711=>450,712=>275,713=>450,714=>450,715=>450, -716=>275,717=>450,718=>450,719=>450,720=>303,721=>303,722=>330,723=>330,724=>450,725=>450, -726=>374,727=>295,728=>450,729=>450,730=>450,731=>450,733=>450,734=>315,735=>450,736=>370, -737=>197,738=>343,739=>371,740=>293,741=>450,742=>450,743=>450,744=>450,745=>450,748=>450, -749=>450,750=>591,755=>450,759=>450,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>628,881=>508,882=>919, -883=>752,884=>271,885=>271,886=>753,887=>630,890=>450,891=>533,892=>495,893=>494,894=>360, -900=>397,901=>450,902=>717,903=>342,904=>761,905=>908,906=>507,908=>801,910=>882,911=>804, -912=>351,913=>696,914=>686,915=>573,916=>696,917=>615,918=>652,919=>753,920=>765,921=>334, -922=>697,923=>696,924=>896,925=>753,926=>568,927=>765,928=>753,929=>659,931=>615,932=>614, -933=>651,934=>765,935=>694,936=>765,937=>765,938=>334,939=>651,940=>618,941=>501,942=>641, -943=>351,944=>607,945=>618,946=>644,947=>613,948=>618,949=>501,950=>532,951=>641,952=>618, -953=>351,954=>639,955=>569,956=>662,957=>613,958=>532,959=>618,960=>712,961=>644,962=>533, -963=>701,964=>574,965=>607,966=>704,967=>580,968=>714,969=>782,970=>351,971=>607,972=>618, -973=>607,974=>782,975=>697,976=>585,977=>594,978=>671,979=>883,980=>671,981=>716,982=>782, -983=>669,984=>765,985=>618,986=>660,987=>533,988=>615,989=>444,990=>632,991=>593,992=>827, -993=>564,994=>983,995=>753,996=>749,997=>644,998=>835,999=>669,1000=>660,1001=>585,1002=>709, -1003=>604,1004=>677,1005=>644,1006=>614,1007=>531,1008=>669,1009=>644,1010=>533,1011=>308,1012=>765, -1013=>580,1014=>580,1015=>664,1016=>644,1017=>660,1018=>896,1019=>659,1020=>644,1021=>628,1022=>660, -1023=>628,1024=>615,1025=>615,1026=>791,1027=>573,1028=>660,1029=>648,1030=>334,1031=>334,1032=>334, -1033=>1039,1034=>1017,1035=>791,1036=>735,1037=>753,1038=>694,1039=>753,1040=>696,1041=>686,1042=>686, -1043=>573,1044=>801,1045=>615,1046=>1102,1047=>639,1048=>753,1049=>753,1050=>735,1051=>747,1052=>896, -1053=>753,1054=>765,1055=>753,1056=>659,1057=>660,1058=>614,1059=>694,1060=>892,1061=>694,1062=>835, -1063=>727,1064=>1112,1065=>1193,1066=>845,1067=>932,1068=>686,1069=>660,1070=>1056,1071=>693,1072=>607, -1073=>628,1074=>569,1075=>470,1076=>727,1077=>610,1078=>896,1079=>523,1080=>630,1081=>630,1082=>611, -1083=>659,1084=>735,1085=>622,1086=>618,1087=>622,1088=>644,1089=>533,1090=>521,1091=>586,1092=>893, -1093=>580,1094=>667,1095=>618,1096=>956,1097=>995,1098=>676,1099=>813,1100=>569,1101=>533,1102=>875, -1103=>578,1104=>610,1105=>610,1106=>642,1107=>470,1108=>533,1109=>536,1110=>308,1111=>308,1112=>308, -1113=>892,1114=>860,1115=>661,1116=>611,1117=>630,1118=>586,1119=>622,1120=>983,1121=>782,1122=>756, -1123=>662,1124=>911,1125=>755,1126=>893,1127=>749,1128=>1222,1129=>1009,1130=>765,1131=>618,1132=>1112, -1133=>906,1134=>626,1135=>501,1136=>967,1137=>955,1138=>765,1139=>618,1140=>765,1141=>625,1142=>765, -1143=>625,1144=>1033,1145=>939,1146=>967,1147=>776,1148=>1265,1149=>1055,1150=>983,1151=>782,1152=>660, -1153=>533,1154=>587,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>376,1161=>376,1162=>861, -1163=>726,1164=>686,1165=>550,1166=>659,1167=>644,1168=>573,1169=>470,1170=>599,1171=>488,1172=>727, -1173=>602,1174=>1102,1175=>896,1176=>639,1177=>523,1178=>697,1179=>611,1180=>735,1181=>611,1182=>735, -1183=>611,1184=>914,1185=>743,1186=>860,1187=>727,1188=>992,1189=>787,1190=>1146,1191=>915,1192=>856, -1193=>772,1194=>660,1195=>533,1196=>614,1197=>521,1198=>651,1199=>586,1200=>651,1201=>586,1202=>694, -1203=>580,1204=>1001,1205=>900,1206=>727,1207=>618,1208=>727,1209=>618,1210=>727,1211=>641,1212=>923, -1213=>729,1214=>923,1215=>729,1216=>334,1217=>1102,1218=>896,1219=>697,1220=>567,1221=>855,1222=>725, -1223=>753,1224=>622,1225=>861,1226=>726,1227=>727,1228=>618,1229=>1003,1230=>839,1231=>308,1232=>696, -1233=>607,1234=>696,1235=>607,1236=>976,1237=>943,1238=>615,1239=>610,1240=>764,1241=>610,1242=>764, -1243=>610,1244=>1102,1245=>896,1246=>639,1247=>523,1248=>695,1249=>576,1250=>753,1251=>630,1252=>753, -1253=>630,1254=>765,1255=>618,1256=>765,1257=>618,1258=>765,1259=>618,1260=>660,1261=>533,1262=>694, -1263=>586,1264=>694,1265=>586,1266=>694,1267=>586,1268=>727,1269=>618,1270=>573,1271=>470,1272=>932, -1273=>813,1274=>599,1275=>488,1276=>694,1277=>580,1278=>694,1279=>580,1280=>686,1281=>547,1282=>1043, -1283=>804,1284=>1007,1285=>828,1286=>745,1287=>624,1288=>1117,1289=>915,1290=>1160,1291=>912,1292=>755, -1293=>574,1294=>844,1295=>722,1296=>626,1297=>501,1298=>747,1299=>659,1300=>1157,1301=>961,1302=>958, -1303=>881,1304=>973,1305=>912,1306=>765,1307=>644,1308=>993,1309=>831,1312=>1140,1313=>953,1314=>1146, -1315=>915,1316=>861,1317=>726,1329=>886,1330=>730,1331=>886,1332=>886,1333=>730,1334=>699,1335=>730, -1336=>730,1337=>877,1338=>886,1339=>730,1340=>639,1341=>970,1342=>1022,1343=>730,1344=>639,1345=>681, -1346=>886,1347=>789,1348=>886,1349=>714,1350=>886,1351=>730,1352=>730,1353=>730,1354=>862,1355=>699, -1356=>886,1357=>730,1358=>886,1359=>648,1360=>730,1361=>714,1362=>805,1363=>765,1364=>842,1365=>765, -1366=>648,1369=>330,1370=>342,1371=>495,1372=>495,1373=>342,1374=>491,1375=>468,1377=>938,1378=>641, -1379=>779,1380=>781,1381=>641,1382=>735,1383=>588,1384=>641,1385=>729,1386=>735,1387=>641,1388=>448, -1389=>916,1390=>644,1391=>641,1392=>641,1393=>644,1394=>737,1395=>641,1396=>676,1397=>308,1398=>794, -1399=>502,1400=>641,1401=>502,1402=>938,1403=>502,1404=>777,1405=>641,1406=>732,1407=>938,1408=>641, -1409=>644,1410=>514,1411=>938,1412=>700,1413=>618,1414=>648,1415=>776,1417=>360,1418=>438,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>374,1471=>0,1472=>334,1473=>0,1474=>0,1475=>334,1478=>447, -1479=>0,1488=>676,1489=>605,1490=>483,1491=>589,1492=>641,1493=>308,1494=>442,1495=>641,1496=>651, -1497=>308,1498=>584,1499=>584,1500=>611,1501=>641,1502=>698,1503=>308,1504=>447,1505=>696,1506=>610, -1507=>646,1508=>618,1509=>565,1510=>676,1511=>656,1512=>584,1513=>854,1514=>676,1520=>598,1521=>598, -1522=>597,1523=>399,1524=>639,1542=>600,1543=>600,1545=>795,1546=>1042,1548=>342,1557=>0,1563=>360, -1567=>522,1569=>460,1570=>308,1571=>308,1572=>559,1573=>308,1574=>825,1575=>308,1576=>904,1577=>531, -1578=>904,1579=>904,1580=>648,1581=>648,1582=>648,1583=>461,1584=>461,1585=>518,1586=>518,1587=>1242, -1588=>1242,1589=>1210,1590=>1210,1591=>935,1592=>935,1593=>615,1594=>615,1600=>308,1601=>1045,1602=>804, -1603=>825,1604=>781,1605=>659,1606=>768,1607=>531,1608=>559,1609=>825,1610=>825,1611=>0,1612=>0, -1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1626=>450, -1632=>549,1633=>549,1634=>549,1635=>549,1636=>549,1637=>549,1638=>549,1639=>549,1640=>549,1641=>549, -1642=>549,1643=>336,1644=>342,1645=>490,1646=>904,1647=>804,1652=>263,1657=>904,1658=>904,1659=>904, -1660=>904,1661=>904,1662=>904,1663=>904,1664=>904,1665=>648,1666=>648,1667=>648,1668=>648,1669=>648, -1670=>648,1671=>648,1681=>518,1682=>518,1685=>613,1688=>518,1697=>1045,1700=>1045,1702=>1045,1705=>921, -1711=>921,1717=>781,1722=>768,1727=>648,1734=>559,1740=>825,1742=>825,1749=>531,1776=>549,1777=>549, -1778=>549,1779=>549,1780=>549,1781=>549,1782=>549,1783=>549,1784=>549,1785=>549,1984=>626,1985=>626, -1986=>626,1987=>626,1988=>626,1989=>626,1990=>626,1991=>626,1992=>626,1993=>626,1994=>308,1995=>492, -1996=>489,1997=>586,1998=>622,1999=>622,2000=>534,2001=>622,2002=>813,2003=>496,2004=>496,2005=>564, -2006=>619,2007=>399,2008=>920,2009=>456,2010=>743,2011=>622,2012=>586,2013=>821,2014=>564,2015=>636, -2016=>456,2017=>586,2018=>517,2019=>564,2020=>564,2021=>564,2022=>517,2023=>517,2027=>0,2028=>0, -2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>342,2037=>342,2040=>622, -2041=>622,2042=>374,3647=>668,3713=>710,3714=>673,3716=>674,3719=>512,3720=>668,3722=>669,3725=>685, -3732=>635,3733=>633,3734=>672,3735=>737,3737=>657,3738=>654,3739=>654,3740=>830,3741=>744,3742=>779, -3743=>779,3745=>752,3746=>685,3747=>692,3749=>691,3751=>642,3754=>744,3755=>928,3757=>651,3758=>705, -3759=>840,3760=>620,3761=>0,3762=>549,3763=>549,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0, -3769=>0,3771=>0,3772=>0,3773=>603,3776=>464,3777=>774,3778=>464,3779=>584,3780=>569,3782=>683, -3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>694,3793=>694,3794=>624,3795=>752, -3796=>655,3797=>655,3798=>764,3799=>710,3800=>683,3801=>818,3804=>1227,3805=>1227,4256=>826,4257=>669, -4258=>665,4259=>753,4260=>584,4261=>696,4262=>771,4263=>800,4264=>477,4265=>570,4266=>771,4267=>810, -4268=>579,4269=>813,4270=>732,4271=>677,4272=>782,4273=>579,4274=>579,4275=>797,4276=>797,4277=>660, -4278=>587,4279=>579,4280=>582,4281=>579,4282=>710,4283=>812,4284=>570,4285=>557,4286=>579,4287=>700, -4288=>802,4289=>541,4290=>668,4291=>554,4292=>570,4293=>668,4304=>497,4305=>497,4306=>536,4307=>734, -4308=>505,4309=>506,4310=>497,4311=>744,4312=>497,4313=>488,4314=>967,4315=>506,4316=>507,4317=>730, -4318=>497,4319=>532,4320=>740,4321=>506,4322=>621,4323=>525,4324=>732,4325=>505,4326=>731,4327=>506, -4328=>506,4329=>507,4330=>568,4331=>506,4332=>506,4333=>497,4334=>506,4335=>506,4336=>501,4337=>543, -4338=>497,4339=>497,4340=>497,4341=>544,4342=>767,4343=>571,4344=>506,4345=>536,4346=>487,4347=>615, -4348=>331,5121=>696,5122=>696,5123=>696,5124=>696,5125=>814,5126=>814,5127=>814,5129=>814,5130=>814, -5131=>814,5132=>916,5133=>908,5134=>916,5135=>908,5136=>916,5137=>908,5138=>1034,5139=>1025,5140=>1034, -5141=>1025,5142=>814,5143=>1034,5144=>1028,5145=>1034,5146=>1028,5147=>814,5149=>278,5150=>476,5151=>382, -5152=>382,5153=>355,5154=>355,5155=>355,5156=>355,5157=>507,5158=>423,5159=>278,5160=>355,5161=>355, -5162=>355,5163=>1092,5164=>888,5165=>1094,5166=>1167,5167=>696,5168=>696,5169=>696,5170=>696,5171=>797, -5172=>797,5173=>797,5175=>797,5176=>797,5177=>797,5178=>916,5179=>908,5180=>916,5181=>908,5182=>916, -5183=>908,5184=>1034,5185=>1025,5186=>1034,5187=>1025,5188=>1034,5189=>1028,5190=>1034,5191=>1028,5192=>797, -5193=>518,5194=>206,5196=>730,5197=>730,5198=>730,5199=>730,5200=>734,5201=>734,5202=>734,5204=>734, -5205=>734,5206=>734,5207=>950,5208=>943,5209=>950,5210=>943,5211=>950,5212=>943,5213=>954,5214=>949, -5215=>954,5216=>949,5217=>954,5218=>946,5219=>954,5220=>946,5221=>954,5222=>435,5223=>904,5224=>904, -5225=>921,5226=>915,5227=>668,5228=>668,5229=>668,5230=>668,5231=>668,5232=>668,5233=>668,5234=>668, -5235=>668,5236=>926,5237=>877,5238=>882,5239=>877,5240=>882,5241=>877,5242=>926,5243=>877,5244=>926, -5245=>877,5246=>882,5247=>877,5248=>882,5249=>877,5250=>882,5251=>451,5252=>451,5253=>844,5254=>844, -5255=>844,5256=>844,5257=>668,5258=>668,5259=>668,5260=>668,5261=>668,5262=>668,5263=>668,5264=>668, -5265=>668,5266=>926,5267=>877,5268=>926,5269=>877,5270=>926,5271=>877,5272=>926,5273=>877,5274=>926, -5275=>877,5276=>926,5277=>877,5278=>926,5279=>877,5280=>926,5281=>451,5282=>451,5283=>563,5284=>563, -5285=>563,5286=>563,5287=>563,5288=>563,5289=>563,5290=>563,5291=>563,5292=>793,5293=>769,5294=>777, -5295=>786,5296=>777,5297=>786,5298=>793,5299=>786,5300=>793,5301=>786,5302=>777,5303=>786,5304=>777, -5305=>786,5306=>777,5307=>392,5308=>493,5309=>392,5312=>889,5313=>889,5314=>889,5315=>889,5316=>838, -5317=>838,5318=>838,5319=>838,5320=>838,5321=>1114,5322=>1122,5323=>1080,5324=>1105,5325=>1080,5326=>1105, -5327=>838,5328=>593,5329=>447,5330=>593,5331=>889,5332=>889,5333=>889,5334=>889,5335=>838,5336=>838, -5337=>838,5338=>838,5339=>838,5340=>1107,5341=>1122,5342=>1155,5343=>1105,5344=>1155,5345=>1105,5346=>1105, -5347=>1093,5348=>1105,5349=>1093,5350=>1155,5351=>1105,5352=>1155,5353=>1105,5354=>593,5356=>797,5357=>657, -5358=>657,5359=>657,5360=>657,5361=>657,5362=>657,5363=>657,5364=>657,5365=>657,5366=>897,5367=>862, -5368=>870,5369=>890,5370=>870,5371=>890,5372=>897,5373=>862,5374=>897,5375=>862,5376=>870,5377=>890, -5378=>870,5379=>890,5380=>870,5381=>443,5382=>414,5383=>443,5392=>831,5393=>831,5394=>831,5395=>1022, -5396=>1022,5397=>1022,5398=>1022,5399=>1088,5400=>1081,5401=>1088,5402=>1081,5403=>1088,5404=>1081,5405=>1288, -5406=>1278,5407=>1288,5408=>1278,5409=>1288,5410=>1278,5411=>1288,5412=>1278,5413=>671,5414=>698,5415=>698, -5416=>698,5417=>698,5418=>698,5419=>698,5420=>698,5421=>698,5422=>698,5423=>902,5424=>903,5425=>911, -5426=>896,5427=>911,5428=>896,5429=>902,5430=>903,5431=>902,5432=>903,5433=>911,5434=>896,5435=>911, -5436=>896,5437=>911,5438=>445,5440=>355,5441=>458,5442=>929,5443=>929,5444=>878,5445=>878,5446=>878, -5447=>878,5448=>659,5449=>659,5450=>659,5451=>659,5452=>659,5453=>659,5454=>902,5455=>863,5456=>445, -5458=>797,5459=>696,5460=>696,5461=>696,5462=>696,5463=>835,5464=>835,5465=>835,5466=>835,5467=>1055, -5468=>1028,5469=>542,5470=>730,5471=>730,5472=>730,5473=>730,5474=>730,5475=>730,5476=>734,5477=>734, -5478=>734,5479=>734,5480=>954,5481=>946,5482=>493,5492=>879,5493=>879,5494=>879,5495=>879,5496=>879, -5497=>879,5498=>879,5499=>556,5500=>753,5501=>458,5502=>1114,5503=>1114,5504=>1114,5505=>1114,5506=>1114, -5507=>1114,5508=>1114,5509=>890,5514=>879,5515=>879,5516=>879,5517=>879,5518=>1432,5519=>1432,5520=>1432, -5521=>1165,5522=>1165,5523=>1432,5524=>1432,5525=>763,5526=>1146,5536=>889,5537=>889,5538=>838,5539=>838, -5540=>838,5541=>838,5542=>593,5543=>698,5544=>698,5545=>698,5546=>698,5547=>698,5548=>698,5549=>698, -5550=>445,5551=>668,5598=>747,5601=>747,5702=>446,5703=>446,5742=>371,5743=>1114,5744=>1432,5745=>1814, -5746=>1814,5747=>1548,5748=>1510,5749=>1814,5750=>1814,5760=>489,5761=>573,5762=>851,5763=>1128,5764=>1406, -5765=>1684,5766=>564,5767=>842,5768=>1128,5769=>1403,5770=>1684,5771=>512,5772=>789,5773=>1068,5774=>1347, -5775=>1626,5776=>573,5777=>851,5778=>1116,5779=>1399,5780=>1684,5781=>512,5782=>512,5783=>709,5784=>1110, -5785=>1403,5786=>666,5787=>574,5788=>574,7424=>586,7425=>750,7426=>943,7427=>547,7428=>533,7429=>608, -7430=>608,7431=>502,7432=>501,7433=>308,7434=>444,7435=>598,7436=>485,7437=>735,7438=>630,7439=>618, -7440=>533,7441=>594,7442=>594,7443=>594,7444=>984,7446=>618,7447=>618,7448=>500,7449=>578,7450=>578, -7451=>521,7452=>571,7453=>663,7454=>853,7455=>625,7456=>586,7457=>831,7458=>523,7459=>581,7462=>485, -7463=>586,7464=>622,7465=>500,7466=>703,7467=>659,7468=>438,7469=>615,7470=>432,7472=>470,7473=>387, -7474=>387,7475=>465,7476=>474,7477=>211,7478=>211,7479=>439,7480=>361,7481=>563,7482=>474,7483=>474, -7484=>481,7485=>458,7486=>415,7487=>436,7488=>387,7489=>460,7490=>625,7491=>412,7492=>412,7493=>431, -7494=>641,7495=>431,7496=>431,7497=>431,7498=>431,7499=>347,7500=>347,7501=>431,7502=>197,7503=>438, -7504=>597,7505=>410,7506=>439,7507=>372,7508=>439,7509=>439,7510=>431,7511=>349,7512=>410,7513=>416, -7514=>597,7515=>451,7517=>405,7518=>386,7519=>389,7520=>443,7521=>365,7522=>197,7523=>284,7524=>410, -7525=>451,7526=>405,7527=>386,7528=>405,7529=>443,7530=>365,7543=>644,7544=>474,7547=>491,7557=>462, -7579=>431,7580=>372,7581=>372,7582=>439,7583=>347,7584=>339,7585=>313,7586=>431,7587=>410,7588=>312, -7589=>253,7590=>312,7591=>312,7592=>388,7593=>293,7594=>296,7595=>333,7596=>598,7597=>597,7598=>505, -7599=>505,7600=>403,7601=>439,7602=>488,7603=>379,7604=>356,7605=>349,7606=>524,7607=>444,7608=>359, -7609=>405,7610=>451,7611=>375,7612=>471,7613=>422,7614=>409,7615=>382,7620=>0,7621=>0,7622=>0, -7623=>0,7624=>0,7625=>0,7680=>696,7681=>607,7682=>686,7683=>644,7684=>686,7685=>644,7686=>686, -7687=>644,7688=>660,7689=>533,7690=>747,7691=>644,7692=>747,7693=>644,7694=>747,7695=>644,7696=>747, -7697=>644,7698=>747,7699=>644,7700=>615,7701=>610,7702=>615,7703=>610,7704=>615,7705=>610,7706=>615, -7707=>610,7708=>615,7709=>610,7710=>615,7711=>391,7712=>738,7713=>644,7714=>753,7715=>641,7716=>753, -7717=>641,7718=>753,7719=>641,7720=>753,7721=>641,7722=>753,7723=>641,7724=>334,7725=>308,7726=>334, -7727=>308,7728=>697,7729=>598,7730=>697,7731=>598,7732=>697,7733=>598,7734=>573,7735=>308,7736=>573, -7737=>308,7738=>573,7739=>308,7740=>573,7741=>308,7742=>896,7743=>938,7744=>896,7745=>938,7746=>896, -7747=>938,7748=>753,7749=>641,7750=>753,7751=>641,7752=>753,7753=>641,7754=>753,7755=>641,7756=>765, -7757=>618,7758=>765,7759=>618,7760=>765,7761=>618,7762=>765,7763=>618,7764=>659,7765=>644,7766=>659, -7767=>644,7768=>693,7769=>444,7770=>693,7771=>444,7772=>693,7773=>444,7774=>693,7775=>444,7776=>648, -7777=>536,7778=>648,7779=>536,7780=>648,7781=>536,7782=>648,7783=>536,7784=>648,7785=>536,7786=>614, -7787=>430,7788=>614,7789=>430,7790=>614,7791=>430,7792=>614,7793=>430,7794=>730,7795=>641,7796=>730, -7797=>641,7798=>730,7799=>641,7800=>730,7801=>641,7802=>730,7803=>641,7804=>696,7805=>586,7806=>696, -7807=>586,7808=>993,7809=>831,7810=>993,7811=>831,7812=>993,7813=>831,7814=>993,7815=>831,7816=>993, -7817=>831,7818=>694,7819=>580,7820=>694,7821=>580,7822=>651,7823=>586,7824=>652,7825=>523,7826=>652, -7827=>523,7828=>652,7829=>523,7830=>641,7831=>430,7832=>831,7833=>586,7834=>607,7835=>391,7838=>806, -7839=>618,7840=>696,7841=>607,7842=>696,7843=>607,7844=>696,7845=>607,7846=>696,7847=>607,7848=>696, -7849=>607,7850=>696,7851=>607,7852=>696,7853=>607,7854=>696,7855=>607,7856=>696,7857=>607,7858=>696, -7859=>607,7860=>696,7861=>607,7862=>696,7863=>607,7864=>615,7865=>610,7866=>615,7867=>610,7868=>615, -7869=>610,7870=>615,7871=>610,7872=>615,7873=>610,7874=>615,7875=>610,7876=>615,7877=>610,7878=>615, -7879=>610,7880=>334,7881=>308,7882=>334,7883=>308,7884=>765,7885=>618,7886=>765,7887=>618,7888=>765, -7889=>618,7890=>765,7891=>618,7892=>765,7893=>618,7894=>765,7895=>618,7896=>765,7897=>618,7898=>786, -7899=>618,7900=>786,7901=>618,7902=>786,7903=>618,7904=>786,7905=>618,7906=>786,7907=>618,7908=>730, -7909=>641,7910=>730,7911=>641,7912=>751,7913=>641,7914=>751,7915=>641,7916=>751,7917=>641,7918=>751, -7919=>641,7920=>751,7921=>641,7922=>651,7923=>586,7924=>651,7925=>586,7926=>651,7927=>586,7928=>651, -7929=>586,7936=>618,7937=>618,7938=>618,7939=>618,7940=>618,7941=>618,7942=>618,7943=>618,7944=>696, -7945=>696,7946=>937,7947=>939,7948=>841,7949=>866,7950=>751,7951=>773,7952=>501,7953=>501,7954=>501, -7955=>501,7956=>501,7957=>501,7960=>712,7961=>715,7962=>989,7963=>986,7964=>920,7965=>947,7968=>641, -7969=>641,7970=>641,7971=>641,7972=>641,7973=>641,7974=>641,7975=>641,7976=>851,7977=>856,7978=>1125, -7979=>1125,7980=>1062,7981=>1085,7982=>948,7983=>956,7984=>351,7985=>351,7986=>351,7987=>351,7988=>351, -7989=>351,7990=>351,7991=>351,7992=>435,7993=>440,7994=>699,7995=>707,7996=>641,7997=>664,7998=>544, -7999=>544,8000=>618,8001=>618,8002=>618,8003=>618,8004=>618,8005=>618,8008=>802,8009=>839,8010=>1099, -8011=>1101,8012=>947,8013=>974,8016=>607,8017=>607,8018=>607,8019=>607,8020=>607,8021=>607,8022=>607, -8023=>607,8025=>837,8027=>1065,8029=>1079,8031=>944,8032=>782,8033=>782,8034=>782,8035=>782,8036=>782, -8037=>782,8038=>782,8039=>782,8040=>817,8041=>862,8042=>1121,8043=>1126,8044=>968,8045=>994,8046=>925, -8047=>968,8048=>618,8049=>618,8050=>501,8051=>501,8052=>641,8053=>641,8054=>351,8055=>351,8056=>618, -8057=>618,8058=>607,8059=>607,8060=>782,8061=>782,8064=>618,8065=>618,8066=>618,8067=>618,8068=>618, -8069=>618,8070=>618,8071=>618,8072=>696,8073=>696,8074=>937,8075=>939,8076=>841,8077=>866,8078=>751, -8079=>773,8080=>641,8081=>641,8082=>641,8083=>641,8084=>641,8085=>641,8086=>641,8087=>641,8088=>851, -8089=>856,8090=>1125,8091=>1125,8092=>1062,8093=>1085,8094=>948,8095=>956,8096=>782,8097=>782,8098=>782, -8099=>782,8100=>782,8101=>782,8102=>782,8103=>782,8104=>817,8105=>862,8106=>1121,8107=>1126,8108=>968, -8109=>994,8110=>925,8111=>968,8112=>618,8113=>618,8114=>618,8115=>618,8116=>618,8118=>618,8119=>618, -8120=>696,8121=>696,8122=>789,8123=>717,8124=>696,8125=>450,8126=>450,8127=>450,8128=>450,8129=>450, -8130=>641,8131=>641,8132=>641,8134=>641,8135=>641,8136=>836,8137=>761,8138=>972,8139=>908,8140=>753, -8141=>450,8142=>450,8143=>450,8144=>351,8145=>351,8146=>351,8147=>351,8150=>351,8151=>351,8152=>334, -8153=>334,8154=>559,8155=>507,8157=>450,8158=>450,8159=>450,8160=>607,8161=>607,8162=>607,8163=>607, -8164=>644,8165=>644,8166=>607,8167=>607,8168=>651,8169=>651,8170=>918,8171=>882,8172=>754,8173=>450, -8174=>450,8175=>450,8178=>782,8179=>782,8180=>782,8182=>782,8183=>782,8184=>958,8185=>801,8186=>976, -8187=>804,8188=>765,8189=>450,8190=>450,8192=>450,8193=>900,8194=>450,8195=>900,8196=>296,8197=>225, -8198=>150,8199=>626,8200=>342,8201=>180,8202=>89,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0, -8208=>374,8209=>374,8210=>626,8213=>900,8214=>450,8215=>450,8219=>342,8223=>591,8227=>575,8228=>299, -8229=>600,8231=>313,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>180,8241=>1698,8242=>237, -8243=>402,8244=>567,8245=>237,8246=>402,8247=>567,8248=>659,8251=>875,8252=>564,8253=>522,8254=>450, -8255=>745,8256=>745,8257=>296,8258=>920,8259=>450,8260=>150,8261=>411,8262=>411,8263=>927,8264=>746, -8265=>746,8266=>461,8267=>572,8268=>450,8269=>450,8270=>470,8271=>360,8272=>745,8273=>470,8274=>500, -8275=>900,8276=>745,8277=>754,8278=>615,8279=>731,8280=>754,8281=>754,8282=>342,8283=>784,8284=>754, -8285=>342,8286=>342,8287=>200,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0, -8300=>0,8301=>0,8302=>0,8303=>0,8304=>394,8305=>197,8308=>394,8309=>394,8310=>394,8311=>394, -8312=>394,8313=>394,8314=>475,8315=>475,8316=>475,8317=>259,8318=>259,8319=>410,8320=>394,8321=>394, -8322=>394,8323=>394,8324=>394,8325=>394,8326=>394,8327=>394,8328=>394,8329=>394,8330=>475,8331=>475, -8332=>475,8333=>259,8334=>259,8336=>412,8337=>431,8338=>439,8339=>371,8340=>431,8352=>836,8353=>626, -8354=>626,8355=>626,8356=>626,8357=>938,8358=>753,8359=>1366,8360=>1084,8361=>993,8362=>813,8363=>626, -8365=>626,8366=>614,8367=>1252,8368=>626,8369=>626,8370=>626,8371=>626,8372=>773,8373=>626,8400=>0, -8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1007,8449=>1053,8450=>660,8451=>1090, -8452=>806,8453=>982,8454=>1029,8455=>553,8456=>628,8457=>978,8459=>965,8460=>822,8461=>799,8462=>641, -8463=>641,8464=>537,8465=>627,8466=>771,8467=>424,8468=>876,8469=>753,8470=>1083,8471=>900,8472=>627, -8473=>675,8474=>765,8475=>844,8476=>732,8477=>721,8478=>807,8479=>639,8480=>917,8481=>1152,8483=>679, -8484=>679,8485=>520,8486=>765,8487=>765,8488=>686,8489=>304,8490=>697,8491=>696,8492=>835,8493=>736, -8494=>769,8495=>572,8496=>656,8497=>727,8498=>615,8499=>1065,8500=>418,8501=>714,8502=>658,8503=>444, -8504=>615,8505=>342,8506=>851,8507=>1213,8508=>710,8509=>663,8510=>589,8511=>776,8512=>756,8513=>697, -8514=>501,8515=>573,8516=>684,8517=>747,8518=>644,8519=>610,8520=>308,8521=>308,8523=>785,8526=>492, -8531=>932,8532=>932,8533=>932,8534=>932,8535=>932,8536=>932,8537=>932,8538=>932,8539=>932,8540=>932, -8541=>932,8542=>932,8543=>554,8544=>334,8545=>593,8546=>851,8547=>989,8548=>696,8549=>989,8550=>1247, -8551=>1505,8552=>1008,8553=>694,8554=>1008,8555=>1266,8556=>573,8557=>660,8558=>747,8559=>896,8560=>308, -8561=>546,8562=>785,8563=>885,8564=>586,8565=>866,8566=>1104,8567=>1342,8568=>872,8569=>580,8570=>872, -8571=>1110,8572=>308,8573=>533,8574=>644,8575=>938,8576=>1160,8577=>747,8578=>1160,8579=>660,8580=>533, -8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754,8600=>754,8601=>754, -8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754,8610=>754,8611=>754, -8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754,8620=>754,8621=>754, -8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754,8630=>754,8631=>754, -8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754,8640=>754,8641=>754, -8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754,8650=>754,8651=>754, -8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754,8660=>754,8661=>754, -8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754,8670=>754,8671=>754, -8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754,8680=>754,8681=>754, -8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754,8690=>754,8691=>754, -8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754,8700=>754,8701=>754, -8702=>754,8703=>754,8704=>696,8705=>626,8706=>489,8707=>615,8708=>615,8709=>771,8710=>627,8711=>627, -8712=>807,8713=>807,8714=>675,8715=>807,8716=>807,8717=>675,8718=>572,8719=>708,8720=>708,8721=>646, -8722=>754,8723=>754,8724=>626,8725=>329,8726=>626,8727=>754,8728=>563,8729=>342,8730=>600,8731=>600, -8732=>600,8733=>641,8734=>750,8735=>754,8736=>807,8737=>807,8738=>754,8739=>450,8740=>450,8741=>450, -8742=>450,8743=>730,8744=>730,8745=>730,8746=>730,8747=>549,8748=>835,8749=>1165,8750=>506,8751=>879, -8752=>1181,8753=>506,8754=>506,8755=>506,8756=>626,8757=>626,8758=>264,8759=>626,8760=>754,8761=>754, -8762=>754,8763=>754,8764=>754,8765=>754,8766=>754,8767=>754,8768=>337,8769=>754,8770=>754,8771=>754, -8772=>754,8773=>754,8774=>754,8775=>754,8776=>754,8777=>754,8778=>754,8779=>754,8780=>754,8781=>754, -8782=>754,8783=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>956,8789=>956,8790=>754,8791=>754, -8792=>754,8793=>754,8794=>754,8795=>754,8796=>754,8797=>754,8798=>754,8799=>754,8800=>754,8801=>754, -8802=>754,8803=>754,8804=>754,8805=>754,8806=>754,8807=>754,8808=>756,8809=>756,8810=>942,8811=>942, -8812=>450,8813=>754,8814=>754,8815=>754,8816=>754,8817=>754,8818=>754,8819=>754,8820=>754,8821=>754, -8822=>754,8823=>754,8824=>754,8825=>754,8826=>754,8827=>754,8828=>754,8829=>754,8830=>754,8831=>754, -8832=>754,8833=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8840=>754,8841=>754, -8842=>754,8843=>754,8844=>730,8845=>730,8846=>730,8847=>754,8848=>754,8849=>754,8850=>754,8851=>716, -8852=>716,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754, -8862=>754,8863=>754,8864=>754,8865=>754,8866=>822,8867=>822,8868=>822,8869=>822,8870=>488,8871=>488, -8872=>822,8873=>822,8874=>822,8875=>822,8876=>822,8877=>822,8878=>822,8879=>822,8880=>754,8881=>754, -8882=>754,8883=>754,8884=>754,8885=>754,8886=>900,8887=>900,8888=>754,8889=>754,8890=>488,8891=>730, -8892=>730,8893=>730,8894=>754,8895=>754,8896=>758,8897=>758,8898=>758,8899=>758,8900=>444,8901=>342, -8902=>563,8903=>754,8904=>900,8905=>900,8906=>900,8907=>900,8908=>900,8909=>754,8910=>730,8911=>730, -8912=>754,8913=>754,8914=>754,8915=>754,8916=>754,8917=>754,8918=>754,8919=>754,8920=>1280,8921=>1280, -8922=>754,8923=>754,8924=>754,8925=>754,8926=>754,8927=>754,8928=>754,8929=>754,8930=>754,8931=>754, -8932=>754,8933=>754,8934=>754,8935=>754,8936=>754,8937=>754,8938=>754,8939=>754,8940=>754,8941=>754, -8942=>900,8943=>900,8944=>900,8945=>900,8946=>1042,8947=>807,8948=>675,8949=>807,8950=>807,8951=>675, -8952=>807,8953=>807,8954=>1042,8955=>807,8956=>675,8957=>807,8958=>675,8959=>807,8960=>542,8961=>542, -8962=>644,8963=>754,8964=>754,8965=>754,8966=>754,8967=>439,8968=>411,8969=>411,8970=>411,8971=>411, -8972=>728,8973=>728,8974=>728,8975=>728,8976=>754,8977=>484,8984=>835,8985=>754,8988=>422,8989=>422, -8990=>422,8991=>422,8992=>549,8993=>549,8996=>1037,8997=>1037,8998=>1272,8999=>1037,9000=>1299,9003=>1272, -9004=>786,9075=>351,9076=>644,9077=>782,9082=>618,9085=>776,9095=>1037,9108=>786,9115=>450,9116=>450, -9117=>450,9118=>450,9119=>450,9120=>450,9121=>450,9122=>450,9123=>450,9124=>450,9125=>450,9126=>450, -9127=>675,9128=>675,9129=>675,9130=>675,9131=>675,9132=>675,9133=>675,9134=>549,9166=>754,9167=>850, -9187=>786,9189=>692,9250=>644,9251=>644,9312=>762,9313=>762,9314=>762,9315=>762,9316=>762,9317=>762, -9318=>762,9319=>762,9320=>762,9321=>762,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692, -9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692, -9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692, -9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850, -9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850, -9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692, -9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692, -9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785, -9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785, -9686=>474,9687=>474,9688=>756,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348, -9696=>692,9697=>692,9698=>692,9699=>692,9700=>692,9701=>692,9702=>575,9703=>850,9704=>850,9705=>850, -9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850, -9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659, -9726=>659,9727=>692,9728=>807,9729=>900,9730=>807,9731=>807,9732=>807,9733=>807,9734=>807,9735=>515, -9736=>806,9737=>807,9738=>799,9739=>799,9740=>604,9741=>911,9742=>1121,9743=>1125,9744=>807,9745=>807, -9746=>807,9747=>479,9748=>807,9749=>807,9750=>807,9751=>807,9752=>807,9753=>807,9754=>807,9755=>807, -9756=>807,9757=>548,9758=>807,9759=>548,9760=>807,9761=>807,9762=>807,9763=>807,9764=>602,9765=>671, -9766=>584,9767=>705,9768=>490,9769=>807,9770=>807,9771=>807,9772=>639,9773=>807,9774=>807,9775=>807, -9776=>807,9777=>807,9778=>807,9779=>807,9780=>807,9781=>807,9782=>807,9783=>807,9784=>807,9785=>807, -9786=>807,9787=>807,9788=>807,9789=>807,9790=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807, -9796=>807,9797=>807,9798=>807,9799=>807,9800=>807,9801=>807,9802=>807,9803=>807,9804=>807,9805=>807, -9806=>807,9807=>807,9808=>807,9809=>807,9810=>807,9811=>807,9812=>807,9813=>807,9814=>807,9815=>807, -9816=>807,9817=>807,9818=>807,9819=>807,9820=>807,9821=>807,9822=>807,9823=>807,9824=>807,9825=>807, -9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9832=>807,9833=>424,9834=>574,9835=>807, -9836=>807,9837=>424,9838=>321,9839=>435,9840=>673,9841=>689,9842=>807,9843=>807,9844=>807,9845=>807, -9846=>807,9847=>807,9848=>807,9849=>807,9850=>807,9851=>807,9852=>807,9853=>807,9854=>807,9855=>807, -9856=>782,9857=>782,9858=>782,9859=>782,9860=>782,9861=>782,9862=>807,9863=>807,9864=>807,9865=>807, -9866=>807,9867=>807,9868=>807,9869=>807,9870=>807,9871=>807,9872=>807,9873=>807,9874=>807,9875=>807, -9876=>807,9877=>487,9878=>807,9879=>807,9880=>807,9881=>807,9882=>807,9883=>807,9884=>807,9888=>807, -9889=>632,9890=>903,9891=>977,9892=>1028,9893=>811,9894=>754,9895=>754,9896=>754,9897=>754,9898=>754, -9899=>754,9900=>754,9901=>754,9902=>754,9903=>754,9904=>759,9905=>754,9906=>658,9907=>659,9908=>659, -9909=>659,9910=>765,9911=>659,9912=>659,9985=>754,9986=>754,9987=>754,9988=>754,9990=>754,9991=>754, -9992=>754,9993=>754,9996=>754,9997=>754,9998=>754,9999=>754,10000=>754,10001=>754,10002=>754,10003=>754, -10004=>754,10005=>754,10006=>754,10007=>754,10008=>754,10009=>754,10010=>754,10011=>754,10012=>754,10013=>754, -10014=>754,10015=>754,10016=>754,10017=>754,10018=>754,10019=>754,10020=>754,10021=>754,10022=>754,10023=>754, -10025=>754,10026=>754,10027=>754,10028=>754,10029=>754,10030=>754,10031=>754,10032=>754,10033=>754,10034=>754, -10035=>754,10036=>754,10037=>754,10038=>754,10039=>754,10040=>754,10041=>754,10042=>754,10043=>754,10044=>754, -10045=>754,10046=>754,10047=>754,10048=>754,10049=>754,10050=>754,10051=>754,10052=>754,10053=>754,10054=>754, -10055=>754,10056=>754,10057=>754,10058=>754,10059=>754,10061=>807,10063=>807,10064=>807,10065=>807,10066=>807, -10070=>807,10072=>754,10073=>754,10074=>754,10075=>312,10076=>312,10077=>528,10078=>528,10081=>754,10082=>754, -10083=>754,10084=>754,10085=>754,10086=>754,10087=>754,10088=>754,10089=>754,10090=>754,10091=>754,10092=>754, -10093=>754,10094=>754,10095=>754,10096=>754,10097=>754,10098=>754,10099=>754,10100=>754,10101=>754,10102=>762, -10103=>762,10104=>762,10105=>762,10106=>762,10107=>762,10108=>762,10109=>762,10110=>762,10111=>762,10112=>754, -10113=>754,10114=>754,10115=>754,10116=>754,10117=>754,10118=>754,10119=>754,10120=>754,10121=>754,10122=>754, -10123=>754,10124=>754,10125=>754,10126=>754,10127=>754,10128=>754,10129=>754,10130=>754,10131=>754,10132=>754, -10136=>754,10137=>754,10138=>754,10139=>754,10140=>754,10141=>754,10142=>754,10143=>754,10144=>754,10145=>754, -10146=>754,10147=>754,10148=>754,10149=>754,10150=>754,10151=>754,10152=>754,10153=>754,10154=>754,10155=>754, -10156=>754,10157=>754,10158=>754,10159=>754,10161=>754,10162=>754,10163=>754,10164=>754,10165=>754,10166=>754, -10167=>754,10168=>754,10169=>754,10170=>754,10171=>754,10172=>754,10173=>754,10174=>754,10181=>411,10182=>411, -10208=>444,10214=>438,10215=>438,10216=>411,10217=>411,10218=>648,10219=>648,10224=>754,10225=>754,10226=>754, -10227=>754,10228=>1042,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290, -10237=>1290,10238=>1290,10239=>1290,10240=>703,10241=>703,10242=>703,10243=>703,10244=>703,10245=>703,10246=>703, -10247=>703,10248=>703,10249=>703,10250=>703,10251=>703,10252=>703,10253=>703,10254=>703,10255=>703,10256=>703, -10257=>703,10258=>703,10259=>703,10260=>703,10261=>703,10262=>703,10263=>703,10264=>703,10265=>703,10266=>703, -10267=>703,10268=>703,10269=>703,10270=>703,10271=>703,10272=>703,10273=>703,10274=>703,10275=>703,10276=>703, -10277=>703,10278=>703,10279=>703,10280=>703,10281=>703,10282=>703,10283=>703,10284=>703,10285=>703,10286=>703, -10287=>703,10288=>703,10289=>703,10290=>703,10291=>703,10292=>703,10293=>703,10294=>703,10295=>703,10296=>703, -10297=>703,10298=>703,10299=>703,10300=>703,10301=>703,10302=>703,10303=>703,10304=>703,10305=>703,10306=>703, -10307=>703,10308=>703,10309=>703,10310=>703,10311=>703,10312=>703,10313=>703,10314=>703,10315=>703,10316=>703, -10317=>703,10318=>703,10319=>703,10320=>703,10321=>703,10322=>703,10323=>703,10324=>703,10325=>703,10326=>703, -10327=>703,10328=>703,10329=>703,10330=>703,10331=>703,10332=>703,10333=>703,10334=>703,10335=>703,10336=>703, -10337=>703,10338=>703,10339=>703,10340=>703,10341=>703,10342=>703,10343=>703,10344=>703,10345=>703,10346=>703, -10347=>703,10348=>703,10349=>703,10350=>703,10351=>703,10352=>703,10353=>703,10354=>703,10355=>703,10356=>703, -10357=>703,10358=>703,10359=>703,10360=>703,10361=>703,10362=>703,10363=>703,10364=>703,10365=>703,10366=>703, -10367=>703,10368=>703,10369=>703,10370=>703,10371=>703,10372=>703,10373=>703,10374=>703,10375=>703,10376=>703, -10377=>703,10378=>703,10379=>703,10380=>703,10381=>703,10382=>703,10383=>703,10384=>703,10385=>703,10386=>703, -10387=>703,10388=>703,10389=>703,10390=>703,10391=>703,10392=>703,10393=>703,10394=>703,10395=>703,10396=>703, -10397=>703,10398=>703,10399=>703,10400=>703,10401=>703,10402=>703,10403=>703,10404=>703,10405=>703,10406=>703, -10407=>703,10408=>703,10409=>703,10410=>703,10411=>703,10412=>703,10413=>703,10414=>703,10415=>703,10416=>703, -10417=>703,10418=>703,10419=>703,10420=>703,10421=>703,10422=>703,10423=>703,10424=>703,10425=>703,10426=>703, -10427=>703,10428=>703,10429=>703,10430=>703,10431=>703,10432=>703,10433=>703,10434=>703,10435=>703,10436=>703, -10437=>703,10438=>703,10439=>703,10440=>703,10441=>703,10442=>703,10443=>703,10444=>703,10445=>703,10446=>703, -10447=>703,10448=>703,10449=>703,10450=>703,10451=>703,10452=>703,10453=>703,10454=>703,10455=>703,10456=>703, -10457=>703,10458=>703,10459=>703,10460=>703,10461=>703,10462=>703,10463=>703,10464=>703,10465=>703,10466=>703, -10467=>703,10468=>703,10469=>703,10470=>703,10471=>703,10472=>703,10473=>703,10474=>703,10475=>703,10476=>703, -10477=>703,10478=>703,10479=>703,10480=>703,10481=>703,10482=>703,10483=>703,10484=>703,10485=>703,10486=>703, -10487=>703,10488=>703,10489=>703,10490=>703,10491=>703,10492=>703,10493=>703,10494=>703,10495=>703,10502=>754, -10503=>754,10506=>754,10507=>754,10560=>754,10561=>754,10627=>678,10628=>678,10702=>754,10703=>941,10704=>941, -10705=>900,10706=>900,10707=>900,10708=>900,10709=>900,10731=>444,10746=>754,10747=>754,10752=>900,10753=>900, -10754=>900,10764=>1495,10765=>506,10766=>506,10767=>506,10768=>506,10769=>506,10770=>506,10771=>506,10772=>506, -10773=>506,10774=>506,10775=>506,10776=>506,10777=>506,10778=>506,10779=>506,10780=>506,10799=>754,10877=>754, -10878=>754,10879=>754,10880=>754,10881=>754,10882=>754,10883=>754,10884=>754,10885=>754,10886=>754,10887=>754, -10888=>754,10889=>754,10890=>754,10891=>754,10892=>754,10893=>754,10894=>754,10895=>754,10896=>754,10897=>754, -10898=>754,10899=>754,10900=>754,10901=>754,10902=>754,10903=>754,10904=>754,10905=>754,10906=>754,10907=>754, -10908=>754,10909=>754,10910=>754,10911=>754,10912=>754,10926=>754,10927=>754,10928=>754,10929=>754,10930=>754, -10931=>754,10932=>754,10933=>754,10934=>754,10935=>754,10936=>754,10937=>754,10938=>754,11001=>754,11002=>754, -11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754, -11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754,11026=>850,11027=>850, -11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11039=>782,11040=>782,11041=>786, -11042=>786,11043=>786,11044=>1007,11091=>782,11092=>782,11360=>573,11361=>324,11362=>573,11363=>659,11364=>693, -11365=>607,11366=>430,11367=>860,11368=>641,11369=>697,11370=>598,11371=>652,11372=>523,11373=>774,11374=>896, -11375=>696,11377=>700,11378=>1099,11379=>950,11380=>586,11381=>628,11382=>508,11383=>704,11385=>484,11386=>618, -11387=>502,11388=>197,11389=>438,11568=>622,11569=>847,11570=>847,11571=>652,11572=>652,11573=>652,11574=>608, -11575=>696,11576=>696,11577=>615,11578=>615,11579=>721,11580=>890,11581=>685,11582=>561,11583=>685,11584=>847, -11585=>847,11586=>335,11587=>666,11588=>753,11589=>822,11590=>604,11591=>663,11592=>612,11593=>615,11594=>542, -11595=>935,11596=>700,11597=>753,11598=>615,11599=>334,11600=>700,11601=>335,11602=>652,11603=>622,11604=>847, -11605=>847,11606=>753,11607=>335,11608=>752,11609=>847,11610=>847,11611=>660,11612=>789,11613=>694,11614=>660, -11615=>615,11616=>696,11617=>753,11618=>615,11619=>765,11620=>627,11621=>765,11631=>644,11800=>522,11810=>411, -11811=>411,11812=>411,11813=>411,11822=>522,19904=>807,19905=>807,19906=>807,19907=>807,19908=>807,19909=>807, -19910=>807,19911=>807,19912=>807,19913=>807,19914=>807,19915=>807,19916=>807,19917=>807,19918=>807,19919=>807, -19920=>807,19921=>807,19922=>807,19923=>807,19924=>807,19925=>807,19926=>807,19927=>807,19928=>807,19929=>807, -19930=>807,19931=>807,19932=>807,19933=>807,19934=>807,19935=>807,19936=>807,19937=>807,19938=>807,19939=>807, -19940=>807,19941=>807,19942=>807,19943=>807,19944=>807,19945=>807,19946=>807,19947=>807,19948=>807,19949=>807, -19950=>807,19951=>807,19952=>807,19953=>807,19954=>807,19955=>807,19956=>807,19957=>807,19958=>807,19959=>807, -19960=>807,19961=>807,19962=>807,19963=>807,19964=>807,19965=>807,19966=>807,19967=>807,42564=>648,42565=>536, -42566=>392,42567=>396,42572=>1265,42573=>1055,42576=>1110,42577=>924,42580=>1056,42581=>875,42582=>983,42583=>862, -42594=>976,42595=>832,42596=>986,42597=>821,42598=>1134,42599=>897,42600=>765,42601=>618,42602=>933,42603=>781, -42604=>1266,42605=>995,42606=>865,42634=>867,42635=>708,42636=>614,42637=>521,42644=>727,42645=>641,42760=>450, -42761=>450,42762=>450,42763=>450,42764=>450,42765=>450,42766=>450,42767=>450,42768=>450,42769=>450,42770=>450, -42771=>450,42772=>450,42773=>450,42774=>450,42779=>360,42780=>360,42781=>258,42782=>258,42783=>258,42790=>753, -42791=>641,42792=>928,42793=>771,42794=>626,42795=>501,42800=>502,42801=>536,42802=>1214,42803=>946,42804=>1156, -42805=>958,42806=>1094,42807=>949,42808=>971,42809=>830,42810=>971,42811=>830,42812=>932,42813=>830,42814=>628, -42815=>494,42822=>765,42823=>488,42824=>614,42825=>478,42826=>826,42827=>732,42830=>1266,42831=>995,42880=>573, -42881=>308,42882=>753,42883=>641,42889=>360,42890=>347,42891=>410,42892=>275,43003=>615,43004=>659,43005=>896, -43006=>334,43007=>1192,63173=>618,64256=>729,64257=>667,64258=>667,64259=>1003,64260=>1004,64261=>727,64262=>917, -64275=>1249,64276=>1245,64277=>1240,64278=>1245,64279=>1542,64285=>308,64286=>0,64287=>597,64288=>647,64289=>867, -64290=>801,64291=>889,64292=>867,64293=>844,64294=>889,64295=>889,64296=>878,64297=>754,64298=>854,64299=>854, -64300=>854,64301=>854,64302=>676,64303=>676,64304=>676,64305=>605,64306=>483,64307=>589,64308=>641,64309=>394, -64310=>442,64312=>651,64313=>394,64314=>584,64315=>584,64316=>611,64318=>698,64320=>447,64321=>696,64323=>646, -64324=>618,64326=>676,64327=>656,64328=>584,64329=>854,64330=>676,64331=>308,64332=>605,64333=>584,64334=>618, -64335=>676,64338=>904,64339=>953,64340=>338,64341=>367,64342=>904,64343=>953,64344=>338,64345=>367,64346=>904, -64347=>953,64348=>338,64349=>367,64350=>904,64351=>953,64352=>338,64353=>367,64354=>904,64355=>953,64356=>338, -64357=>367,64358=>904,64359=>953,64360=>338,64361=>367,64362=>1045,64363=>1072,64364=>589,64365=>647,64366=>1045, -64367=>1072,64368=>589,64369=>647,64370=>648,64371=>648,64372=>648,64373=>648,64374=>648,64375=>648,64376=>648, -64377=>648,64378=>648,64379=>648,64380=>648,64381=>648,64382=>648,64383=>648,64384=>648,64385=>648,64394=>518, -64395=>560,64396=>518,64397=>560,64398=>921,64399=>921,64400=>523,64401=>523,64402=>921,64403=>921,64404=>523, -64405=>523,64414=>768,64415=>810,64473=>559,64474=>564,64488=>338,64489=>367,64508=>825,64509=>910,64510=>338, -64511=>367,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0, -65059=>0,65136=>308,65137=>308,65138=>308,65139=>311,65140=>308,65142=>308,65143=>308,65144=>308,65145=>308, -65146=>308,65147=>308,65148=>308,65149=>308,65150=>308,65151=>308,65152=>460,65153=>308,65154=>338,65155=>308, -65156=>338,65157=>559,65158=>564,65159=>308,65160=>338,65161=>825,65162=>825,65163=>338,65164=>367,65165=>308, -65166=>338,65167=>904,65168=>953,65169=>338,65170=>367,65171=>531,65172=>545,65173=>904,65174=>953,65175=>338, -65176=>367,65177=>904,65178=>953,65179=>338,65180=>367,65181=>648,65182=>648,65183=>648,65184=>648,65185=>648, -65186=>648,65187=>648,65188=>648,65189=>648,65190=>648,65191=>648,65192=>648,65193=>461,65194=>520,65195=>461, -65196=>520,65197=>518,65198=>560,65199=>518,65200=>560,65201=>1242,65202=>1272,65203=>885,65204=>916,65205=>1242, -65206=>1272,65207=>885,65208=>916,65209=>1210,65210=>1228,65211=>870,65212=>887,65213=>1210,65214=>1228,65215=>870, -65216=>887,65217=>935,65218=>963,65219=>848,65220=>876,65221=>935,65222=>963,65223=>848,65224=>876,65225=>615, -65226=>615,65227=>615,65228=>508,65229=>615,65230=>615,65231=>615,65232=>508,65233=>1045,65234=>1072,65235=>589, -65236=>647,65237=>804,65238=>811,65239=>589,65240=>647,65241=>825,65242=>838,65243=>523,65244=>523,65245=>781, -65246=>803,65247=>338,65248=>367,65249=>659,65250=>706,65251=>557,65252=>603,65253=>768,65254=>810,65255=>338, -65256=>367,65257=>531,65258=>545,65259=>624,65260=>594,65261=>559,65262=>564,65263=>825,65264=>910,65265=>825, -65266=>910,65267=>338,65268=>367,65269=>670,65270=>683,65271=>670,65272=>683,65273=>670,65274=>683,65275=>670, -65276=>683,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1002); -$enc=''; -$diff=''; -$file='dejavusanscondensedb.z'; -$ctg='dejavusanscondensedb.ctg.z'; -$originalsize=534464; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.z deleted file mode 100644 index 5d59661c29..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.ctg.z deleted file mode 100644 index 9d1fcd61c8..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.php deleted file mode 100644 index 6a86288e18..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.php +++ /dev/null @@ -1,458 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansCondensed-BoldOblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-46,'Flags'=>96,'FontBBox'=>'[-960 -385 1804 1121]','ItalicAngle'=>-11,'StemV'=>120,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>313,33=>410,34=>469,35=>626,36=>626,37=>901,38=>785,39=>275,40=>411, -41=>411,42=>470,43=>754,44=>342,45=>374,46=>342,47=>329,48=>626,49=>626,50=>626, -51=>626,52=>626,53=>626,54=>626,55=>626,56=>626,57=>626,58=>360,59=>360,60=>754, -61=>754,62=>754,63=>522,64=>900,65=>696,66=>686,67=>660,68=>747,69=>615,70=>615, -71=>738,72=>753,73=>334,74=>334,75=>697,76=>573,77=>896,78=>753,79=>765,80=>659, -81=>765,82=>693,83=>648,84=>614,85=>730,86=>696,87=>993,88=>694,89=>651,90=>652, -91=>411,92=>329,93=>411,94=>754,95=>450,96=>450,97=>607,98=>644,99=>533,100=>644, -101=>610,102=>391,103=>644,104=>641,105=>308,106=>308,107=>598,108=>308,109=>938,110=>641, -111=>618,112=>644,113=>644,114=>444,115=>536,116=>430,117=>641,118=>586,119=>831,120=>580, -121=>586,122=>523,123=>641,124=>329,125=>641,126=>754,8364=>626,8218=>342,402=>391,8222=>580, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1309,352=>648,8249=>371,338=>1050,381=>652,8216=>342, -8217=>342,8220=>580,8221=>580,8226=>575,8211=>450,8212=>900,732=>450,8482=>900,353=>536,8250=>371, -339=>984,382=>523,376=>651,160=>313,161=>410,162=>626,163=>626,164=>572,165=>626,166=>329, -167=>450,168=>450,169=>900,170=>507,171=>584,172=>754,173=>374,174=>900,175=>450,176=>450, -177=>754,178=>394,179=>394,180=>450,181=>662,182=>572,183=>342,184=>450,185=>394,186=>507, -187=>584,188=>932,189=>932,190=>932,191=>522,192=>696,193=>696,194=>696,195=>696,196=>696, -197=>696,198=>976,199=>660,200=>615,201=>615,202=>615,203=>615,204=>334,205=>334,206=>334, -207=>334,208=>760,209=>753,210=>765,211=>765,212=>765,213=>765,214=>765,215=>754,216=>765, -217=>730,218=>730,219=>730,220=>730,221=>651,222=>668,223=>647,224=>607,225=>607,226=>607, -227=>607,228=>607,229=>607,230=>943,231=>533,232=>610,233=>610,234=>610,235=>610,236=>308, -237=>308,238=>308,239=>308,240=>618,241=>641,242=>618,243=>618,244=>618,245=>618,246=>618, -247=>754,248=>618,249=>641,250=>641,251=>641,252=>641,253=>586,254=>644,255=>586,256=>696, -257=>607,258=>696,259=>607,260=>696,261=>607,262=>660,263=>533,264=>660,265=>533,266=>660, -267=>533,268=>660,269=>533,270=>747,271=>644,272=>760,273=>644,274=>615,275=>610,276=>615, -277=>610,278=>615,279=>610,280=>615,281=>610,282=>615,283=>610,284=>738,285=>644,286=>738, -287=>644,288=>738,289=>644,290=>738,291=>644,292=>753,293=>641,294=>876,295=>711,296=>334, -297=>308,298=>334,299=>308,300=>334,301=>308,302=>334,303=>308,304=>334,305=>308,306=>669, -307=>617,308=>334,309=>308,310=>697,311=>598,312=>598,313=>573,314=>308,315=>573,316=>308, -317=>573,318=>308,319=>573,320=>308,321=>594,322=>337,323=>753,324=>641,325=>753,326=>641, -327=>753,328=>641,329=>884,330=>753,331=>641,332=>765,333=>618,334=>765,335=>618,336=>765, -337=>618,340=>693,341=>444,342=>693,343=>444,344=>693,345=>444,346=>648,347=>536,348=>648, -349=>536,350=>648,351=>536,354=>614,355=>430,356=>614,357=>430,358=>614,359=>430,360=>730, -361=>641,362=>730,363=>641,364=>730,365=>641,366=>730,367=>641,368=>730,369=>641,370=>730, -371=>641,372=>993,373=>831,374=>651,375=>586,377=>652,378=>523,379=>652,380=>523,383=>391, -384=>644,385=>729,386=>686,387=>644,388=>686,389=>644,390=>660,391=>660,392=>533,393=>760, -394=>791,395=>686,396=>644,397=>618,398=>615,399=>765,400=>626,401=>615,403=>738,404=>713, -405=>940,406=>392,407=>350,408=>697,409=>598,410=>324,411=>532,412=>938,413=>753,414=>641, -415=>765,416=>765,417=>618,418=>1002,419=>866,420=>703,421=>644,422=>693,423=>648,424=>536, -425=>615,426=>497,427=>430,428=>636,429=>430,430=>614,431=>730,432=>641,433=>692,434=>732, -435=>717,436=>700,437=>652,438=>523,439=>695,440=>695,441=>576,442=>523,443=>626,444=>695, -445=>576,446=>515,447=>644,448=>334,449=>593,450=>489,451=>334,452=>1393,453=>1305,454=>1176, -455=>879,456=>881,457=>603,458=>1074,459=>1091,460=>957,461=>696,462=>607,463=>334,464=>308, -465=>765,466=>618,467=>730,468=>641,469=>730,470=>641,471=>730,472=>641,473=>730,474=>641, -475=>730,476=>641,477=>610,478=>696,479=>607,480=>696,481=>607,482=>976,483=>943,484=>738, -485=>644,486=>738,487=>644,488=>697,489=>598,490=>765,491=>618,492=>765,493=>618,494=>695, -495=>523,496=>308,497=>1393,498=>1305,499=>1176,500=>738,501=>644,502=>1160,503=>708,504=>753, -505=>641,506=>696,507=>607,508=>976,509=>943,510=>765,511=>618,512=>696,513=>607,514=>696, -515=>607,516=>615,517=>610,518=>615,519=>610,520=>334,521=>308,522=>334,523=>308,524=>765, -525=>618,526=>765,527=>618,528=>693,529=>444,530=>693,531=>444,532=>730,533=>641,534=>730, -535=>641,536=>648,537=>536,538=>614,539=>430,540=>621,541=>546,542=>753,543=>641,544=>753, -545=>778,546=>728,547=>593,548=>652,549=>523,550=>696,551=>607,552=>615,553=>610,554=>765, -555=>618,556=>765,557=>618,558=>765,559=>618,560=>765,561=>618,562=>651,563=>586,564=>442, -565=>780,566=>460,567=>308,568=>979,569=>979,570=>696,571=>660,572=>533,573=>573,574=>614, -575=>536,576=>523,577=>703,578=>553,579=>686,580=>730,581=>696,582=>615,583=>610,584=>334, -585=>308,586=>774,587=>712,588=>693,589=>444,590=>651,591=>586,592=>607,593=>644,594=>644, -595=>644,596=>533,597=>533,598=>712,599=>712,600=>610,601=>610,602=>788,603=>501,604=>490, -605=>696,606=>658,607=>308,608=>712,609=>644,610=>564,611=>661,612=>571,613=>641,614=>641, -615=>641,616=>491,617=>396,618=>491,619=>502,620=>624,621=>308,622=>757,623=>938,624=>938, -625=>938,626=>641,627=>713,628=>578,629=>618,630=>817,631=>613,632=>716,633=>484,634=>484, -635=>584,636=>444,637=>444,638=>536,639=>536,640=>578,641=>578,642=>536,643=>374,644=>391, -645=>544,646=>497,647=>430,648=>430,649=>828,650=>692,651=>603,652=>586,653=>831,654=>586, -655=>651,656=>624,657=>615,658=>576,659=>576,660=>515,661=>515,662=>515,663=>515,664=>765, -665=>569,666=>658,667=>616,668=>622,669=>308,670=>659,671=>485,672=>712,673=>515,674=>515, -675=>1040,676=>1093,677=>1039,678=>876,679=>691,680=>836,681=>923,682=>712,683=>702,684=>532, -685=>374,686=>609,687=>710,688=>410,689=>410,690=>197,691=>284,692=>284,693=>284,694=>369, -695=>532,696=>375,697=>271,698=>469,699=>342,700=>342,701=>342,702=>330,703=>330,704=>293, -705=>293,706=>450,707=>450,708=>450,709=>450,711=>450,712=>275,713=>450,714=>450,715=>450, -716=>275,717=>450,718=>450,719=>450,720=>303,721=>303,722=>330,723=>330,724=>450,725=>450, -726=>374,727=>295,728=>450,729=>450,730=>450,731=>450,733=>450,734=>315,735=>450,736=>370, -737=>197,738=>343,739=>371,740=>293,741=>450,742=>450,743=>450,744=>450,745=>450,748=>450, -749=>450,750=>580,755=>450,759=>450,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>628,881=>508,882=>919, -883=>752,884=>271,885=>271,886=>753,887=>630,890=>450,891=>533,892=>495,893=>494,894=>360, -900=>397,901=>450,902=>717,903=>342,904=>761,905=>908,906=>507,908=>801,910=>882,911=>804, -912=>351,913=>696,914=>686,915=>573,916=>696,917=>615,918=>652,919=>753,920=>765,921=>334, -922=>697,923=>696,924=>896,925=>753,926=>568,927=>765,928=>753,929=>659,931=>615,932=>614, -933=>651,934=>765,935=>694,936=>765,937=>765,938=>334,939=>651,940=>618,941=>501,942=>641, -943=>351,944=>607,945=>618,946=>644,947=>613,948=>618,949=>501,950=>532,951=>641,952=>618, -953=>351,954=>639,955=>569,956=>662,957=>613,958=>532,959=>618,960=>712,961=>644,962=>533, -963=>701,964=>574,965=>607,966=>704,967=>580,968=>714,969=>782,970=>351,971=>607,972=>618, -973=>607,974=>782,975=>697,976=>585,977=>594,978=>671,979=>883,980=>671,981=>716,982=>782, -983=>669,984=>765,985=>618,986=>660,987=>533,988=>615,989=>444,990=>632,991=>593,992=>827, -993=>564,994=>983,995=>753,996=>749,997=>644,998=>835,999=>669,1000=>660,1001=>585,1002=>709, -1003=>604,1004=>677,1005=>644,1006=>614,1007=>531,1008=>669,1009=>644,1010=>533,1011=>308,1012=>765, -1013=>580,1014=>580,1015=>668,1016=>644,1017=>660,1018=>896,1019=>659,1020=>644,1021=>660,1022=>660, -1023=>628,1024=>615,1025=>615,1026=>791,1027=>573,1028=>660,1029=>648,1030=>334,1031=>334,1032=>334, -1033=>1039,1034=>1017,1035=>791,1036=>735,1037=>753,1038=>694,1039=>753,1040=>696,1041=>686,1042=>686, -1043=>573,1044=>801,1045=>615,1046=>1102,1047=>639,1048=>753,1049=>753,1050=>735,1051=>747,1052=>896, -1053=>753,1054=>765,1055=>753,1056=>659,1057=>660,1058=>614,1059=>694,1060=>892,1061=>694,1062=>835, -1063=>727,1064=>1112,1065=>1193,1066=>845,1067=>932,1068=>686,1069=>660,1070=>1056,1071=>693,1072=>607, -1073=>628,1074=>569,1075=>470,1076=>727,1077=>610,1078=>896,1079=>523,1080=>630,1081=>630,1082=>611, -1083=>659,1084=>735,1085=>622,1086=>618,1087=>622,1088=>644,1089=>533,1090=>521,1091=>586,1092=>893, -1093=>580,1094=>667,1095=>618,1096=>956,1097=>995,1098=>676,1099=>813,1100=>569,1101=>533,1102=>875, -1103=>578,1104=>610,1105=>610,1106=>642,1107=>470,1108=>533,1109=>536,1110=>308,1111=>308,1112=>308, -1113=>892,1114=>860,1115=>661,1116=>611,1117=>630,1118=>586,1119=>622,1120=>983,1121=>782,1122=>756, -1123=>662,1124=>911,1125=>755,1126=>893,1127=>749,1128=>1222,1129=>1009,1130=>765,1131=>618,1132=>1112, -1133=>906,1134=>626,1135=>501,1136=>967,1137=>955,1138=>765,1139=>618,1140=>765,1141=>625,1142=>765, -1143=>625,1144=>1033,1145=>939,1146=>967,1147=>776,1148=>1265,1149=>1055,1150=>983,1151=>782,1152=>660, -1153=>533,1154=>587,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>376,1161=>376,1162=>844, -1163=>725,1164=>686,1165=>550,1166=>662,1167=>646,1168=>573,1169=>470,1170=>599,1171=>488,1172=>709, -1173=>470,1174=>1102,1175=>896,1176=>639,1177=>523,1178=>697,1179=>611,1180=>735,1181=>611,1182=>735, -1183=>611,1184=>914,1185=>743,1186=>753,1187=>622,1188=>992,1189=>783,1190=>1129,1191=>880,1192=>851, -1193=>773,1194=>660,1195=>533,1196=>614,1197=>521,1198=>651,1199=>586,1200=>651,1201=>586,1202=>694, -1203=>580,1204=>993,1205=>901,1206=>727,1207=>618,1208=>727,1209=>618,1210=>727,1211=>641,1212=>923, -1213=>729,1214=>923,1215=>729,1216=>334,1217=>1102,1218=>896,1219=>700,1220=>566,1221=>839,1222=>724, -1223=>753,1224=>622,1225=>844,1226=>725,1227=>727,1228=>618,1229=>986,1230=>838,1231=>308,1232=>696, -1233=>607,1234=>696,1235=>607,1236=>976,1237=>943,1238=>615,1239=>610,1240=>765,1241=>610,1242=>765, -1243=>610,1244=>1102,1245=>896,1246=>639,1247=>523,1248=>695,1249=>576,1250=>753,1251=>630,1252=>753, -1253=>630,1254=>765,1255=>618,1256=>765,1257=>618,1258=>765,1259=>618,1260=>660,1261=>533,1262=>694, -1263=>586,1264=>694,1265=>586,1266=>694,1267=>586,1268=>727,1269=>618,1270=>573,1271=>470,1272=>932, -1273=>813,1274=>599,1275=>488,1276=>694,1277=>580,1278=>694,1279=>580,1280=>686,1281=>547,1282=>1043, -1283=>804,1284=>1007,1285=>828,1286=>745,1287=>624,1288=>1117,1289=>915,1290=>1160,1291=>912,1292=>755, -1293=>574,1294=>844,1295=>722,1296=>626,1297=>501,1298=>747,1299=>659,1300=>1157,1301=>963,1302=>958, -1303=>883,1304=>973,1305=>864,1306=>765,1307=>644,1308=>993,1309=>831,1312=>1123,1313=>920,1314=>1128, -1315=>880,1316=>861,1317=>726,1329=>886,1330=>730,1331=>886,1332=>886,1333=>730,1334=>699,1335=>730, -1336=>730,1337=>877,1338=>886,1339=>730,1340=>639,1341=>970,1342=>1022,1343=>730,1344=>639,1345=>681, -1346=>886,1347=>789,1348=>886,1349=>714,1350=>886,1351=>730,1352=>730,1353=>730,1354=>862,1355=>699, -1356=>886,1357=>730,1358=>886,1359=>648,1360=>730,1361=>714,1362=>805,1363=>765,1364=>842,1365=>765, -1366=>648,1369=>330,1370=>342,1371=>495,1372=>495,1373=>342,1374=>491,1375=>468,1377=>938,1378=>641, -1379=>779,1380=>781,1381=>641,1382=>735,1383=>588,1384=>641,1385=>729,1386=>735,1387=>641,1388=>448, -1389=>916,1390=>644,1391=>641,1392=>641,1393=>644,1394=>737,1395=>641,1396=>676,1397=>308,1398=>794, -1399=>502,1400=>641,1401=>502,1402=>938,1403=>502,1404=>777,1405=>641,1406=>732,1407=>938,1408=>641, -1409=>644,1410=>514,1411=>938,1412=>700,1413=>618,1414=>648,1415=>776,1417=>360,1418=>438,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>374,1471=>0,1472=>334,1473=>0,1474=>0,1475=>334,1478=>447, -1479=>0,1488=>676,1489=>605,1490=>483,1491=>589,1492=>641,1493=>308,1494=>442,1495=>641,1496=>651, -1497=>308,1498=>584,1499=>584,1500=>611,1501=>641,1502=>698,1503=>308,1504=>447,1505=>696,1506=>610, -1507=>646,1508=>618,1509=>565,1510=>676,1511=>656,1512=>584,1513=>854,1514=>676,1520=>598,1521=>598, -1522=>597,1523=>399,1524=>639,3647=>668,3713=>734,3714=>673,3716=>674,3719=>512,3720=>668,3722=>669, -3725=>685,3732=>635,3733=>633,3734=>672,3735=>737,3737=>657,3738=>654,3739=>654,3740=>830,3741=>744, -3742=>779,3743=>779,3745=>752,3746=>685,3747=>692,3749=>691,3751=>642,3754=>744,3755=>928,3757=>651, -3758=>705,3759=>840,3760=>620,3761=>0,3762=>549,3763=>549,3764=>0,3765=>0,3766=>0,3767=>0, -3768=>0,3769=>0,3771=>0,3772=>0,3773=>603,3776=>464,3777=>774,3778=>464,3779=>584,3780=>569, -3782=>683,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>694,3793=>694,3794=>624, -3795=>752,3796=>655,3797=>655,3798=>764,3799=>710,3800=>683,3801=>818,3804=>1227,3805=>1227,4256=>826, -4257=>669,4258=>665,4259=>753,4260=>584,4261=>696,4262=>771,4263=>800,4264=>477,4265=>570,4266=>771, -4267=>810,4268=>579,4269=>813,4270=>732,4271=>677,4272=>782,4273=>579,4274=>579,4275=>797,4276=>797, -4277=>660,4278=>587,4279=>579,4280=>582,4281=>579,4282=>710,4283=>812,4284=>570,4285=>557,4286=>579, -4287=>700,4288=>802,4289=>541,4290=>668,4291=>554,4292=>570,4293=>668,4304=>497,4305=>497,4306=>536, -4307=>734,4308=>505,4309=>506,4310=>497,4311=>744,4312=>497,4313=>488,4314=>967,4315=>506,4316=>507, -4317=>730,4318=>497,4319=>532,4320=>740,4321=>506,4322=>621,4323=>525,4324=>732,4325=>505,4326=>731, -4327=>506,4328=>506,4329=>507,4330=>568,4331=>506,4332=>506,4333=>497,4334=>506,4335=>506,4336=>501, -4337=>543,4338=>497,4339=>497,4340=>497,4341=>544,4342=>767,4343=>571,4344=>506,4345=>536,4346=>487, -4347=>615,4348=>331,5121=>696,5122=>696,5123=>696,5124=>696,5125=>814,5126=>814,5127=>814,5129=>814, -5130=>814,5131=>814,5132=>916,5133=>908,5134=>916,5135=>908,5136=>916,5137=>908,5138=>1034,5139=>1025, -5140=>1034,5141=>1025,5142=>814,5143=>1034,5144=>1028,5145=>1034,5146=>1028,5147=>814,5149=>278,5150=>476, -5151=>382,5152=>382,5153=>355,5154=>355,5155=>355,5156=>355,5157=>507,5158=>423,5159=>278,5160=>355, -5161=>355,5162=>355,5163=>1092,5164=>888,5165=>1094,5166=>1167,5167=>696,5168=>696,5169=>696,5170=>696, -5171=>797,5172=>797,5173=>797,5175=>797,5176=>797,5177=>797,5178=>916,5179=>908,5180=>916,5181=>908, -5182=>916,5183=>908,5184=>1034,5185=>1025,5186=>1034,5187=>1025,5188=>1034,5189=>1028,5190=>1034,5191=>1028, -5192=>797,5193=>518,5194=>206,5196=>730,5197=>730,5198=>730,5199=>730,5200=>734,5201=>734,5202=>734, -5204=>734,5205=>734,5206=>734,5207=>950,5208=>943,5209=>950,5210=>943,5211=>950,5212=>943,5213=>954, -5214=>949,5215=>954,5216=>949,5217=>954,5218=>946,5219=>954,5220=>946,5221=>954,5222=>435,5223=>904, -5224=>904,5225=>921,5226=>915,5227=>668,5228=>668,5229=>668,5230=>668,5231=>668,5232=>668,5233=>668, -5234=>668,5235=>668,5236=>926,5237=>877,5238=>882,5239=>877,5240=>882,5241=>877,5242=>926,5243=>877, -5244=>926,5245=>877,5246=>882,5247=>877,5248=>882,5249=>877,5250=>882,5251=>451,5252=>451,5253=>844, -5254=>844,5255=>844,5256=>844,5257=>668,5258=>668,5259=>668,5260=>668,5261=>668,5262=>668,5263=>668, -5264=>668,5265=>668,5266=>926,5267=>877,5268=>926,5269=>877,5270=>926,5271=>877,5272=>926,5273=>877, -5274=>926,5275=>877,5276=>926,5277=>877,5278=>926,5279=>877,5280=>926,5281=>451,5282=>451,5283=>563, -5284=>563,5285=>563,5286=>563,5287=>563,5288=>563,5289=>563,5290=>563,5291=>563,5292=>793,5293=>769, -5294=>777,5295=>786,5296=>777,5297=>786,5298=>793,5299=>786,5300=>793,5301=>786,5302=>777,5303=>786, -5304=>777,5305=>786,5306=>777,5307=>392,5308=>493,5309=>392,5312=>889,5313=>889,5314=>889,5315=>889, -5316=>838,5317=>838,5318=>838,5319=>838,5320=>838,5321=>1114,5322=>1122,5323=>1080,5324=>1105,5325=>1080, -5326=>1105,5327=>838,5328=>593,5329=>447,5330=>593,5331=>889,5332=>889,5333=>889,5334=>889,5335=>838, -5336=>838,5337=>838,5338=>838,5339=>838,5340=>1107,5341=>1122,5342=>1155,5343=>1105,5344=>1155,5345=>1105, -5346=>1105,5347=>1093,5348=>1105,5349=>1093,5350=>1155,5351=>1105,5352=>1155,5353=>1105,5354=>593,5356=>797, -5357=>657,5358=>657,5359=>657,5360=>657,5361=>657,5362=>657,5363=>657,5364=>657,5365=>657,5366=>897, -5367=>862,5368=>870,5369=>890,5370=>870,5371=>890,5372=>897,5373=>862,5374=>897,5375=>862,5376=>870, -5377=>890,5378=>870,5379=>890,5380=>870,5381=>443,5382=>414,5383=>443,5392=>831,5393=>831,5394=>831, -5395=>1022,5396=>1022,5397=>1022,5398=>1022,5399=>1088,5400=>1081,5401=>1088,5402=>1081,5403=>1088,5404=>1081, -5405=>1288,5406=>1278,5407=>1288,5408=>1278,5409=>1288,5410=>1278,5411=>1288,5412=>1278,5413=>671,5414=>698, -5415=>698,5416=>698,5417=>698,5418=>698,5419=>698,5420=>698,5421=>698,5422=>698,5423=>902,5424=>903, -5425=>911,5426=>896,5427=>911,5428=>896,5429=>902,5430=>903,5431=>902,5432=>903,5433=>911,5434=>896, -5435=>911,5436=>896,5437=>911,5438=>445,5440=>355,5441=>458,5442=>929,5443=>929,5444=>878,5445=>878, -5446=>878,5447=>878,5448=>659,5449=>659,5450=>659,5451=>659,5452=>659,5453=>659,5454=>902,5455=>863, -5456=>445,5458=>797,5459=>696,5460=>696,5461=>696,5462=>696,5463=>835,5464=>835,5465=>835,5466=>835, -5467=>1055,5468=>1028,5469=>542,5470=>730,5471=>730,5472=>730,5473=>730,5474=>730,5475=>730,5476=>734, -5477=>734,5478=>734,5479=>734,5480=>954,5481=>946,5482=>493,5492=>879,5493=>879,5494=>879,5495=>879, -5496=>879,5497=>879,5498=>879,5499=>556,5500=>753,5501=>458,5502=>1114,5503=>1114,5504=>1114,5505=>1114, -5506=>1114,5507=>1114,5508=>1114,5509=>890,5514=>879,5515=>879,5516=>879,5517=>879,5518=>1432,5519=>1432, -5520=>1432,5521=>1165,5522=>1165,5523=>1432,5524=>1432,5525=>763,5526=>1146,5536=>889,5537=>889,5538=>838, -5539=>838,5540=>838,5541=>838,5542=>593,5543=>698,5544=>698,5545=>698,5546=>698,5547=>698,5548=>698, -5549=>698,5550=>445,5551=>668,5598=>747,5601=>747,5702=>446,5703=>446,5742=>371,5743=>1114,5744=>1432, -5745=>1814,5746=>1814,5747=>1548,5748=>1510,5749=>1814,5750=>1814,7424=>586,7425=>750,7426=>943,7427=>547, -7428=>533,7429=>608,7430=>608,7431=>502,7432=>501,7433=>308,7434=>444,7435=>598,7436=>485,7437=>735, -7438=>630,7439=>618,7440=>533,7441=>594,7442=>594,7443=>594,7444=>984,7446=>618,7447=>618,7448=>500, -7449=>578,7450=>578,7451=>521,7452=>571,7453=>663,7454=>853,7455=>625,7456=>586,7457=>831,7458=>523, -7459=>581,7462=>485,7463=>586,7464=>622,7465=>500,7466=>703,7467=>659,7468=>438,7469=>615,7470=>432, -7472=>470,7473=>387,7474=>387,7475=>465,7476=>474,7477=>211,7478=>211,7479=>439,7480=>361,7481=>563, -7482=>474,7483=>474,7484=>481,7485=>458,7486=>415,7487=>436,7488=>387,7489=>460,7490=>625,7491=>412, -7492=>412,7493=>431,7494=>641,7495=>431,7496=>431,7497=>431,7498=>431,7499=>347,7500=>347,7501=>431, -7502=>197,7503=>438,7504=>597,7505=>410,7506=>439,7507=>372,7508=>439,7509=>439,7510=>431,7511=>349, -7512=>410,7513=>416,7514=>597,7515=>451,7517=>405,7518=>386,7519=>389,7520=>443,7521=>365,7522=>197, -7523=>284,7524=>410,7525=>451,7526=>405,7527=>386,7528=>405,7529=>443,7530=>365,7543=>644,7544=>474, -7547=>491,7557=>462,7579=>431,7580=>372,7581=>372,7582=>439,7583=>347,7584=>339,7585=>313,7586=>431, -7587=>410,7588=>312,7589=>253,7590=>312,7591=>312,7592=>388,7593=>293,7594=>296,7595=>333,7596=>598, -7597=>597,7598=>505,7599=>505,7600=>403,7601=>439,7602=>488,7603=>379,7604=>356,7605=>349,7606=>524, -7607=>444,7608=>359,7609=>405,7610=>451,7611=>375,7612=>471,7613=>422,7614=>409,7615=>382,7620=>0, -7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>696,7681=>607,7682=>686,7683=>644,7684=>686, -7685=>644,7686=>686,7687=>644,7688=>660,7689=>533,7690=>747,7691=>644,7692=>747,7693=>644,7694=>747, -7695=>644,7696=>747,7697=>644,7698=>747,7699=>644,7700=>615,7701=>610,7702=>615,7703=>610,7704=>615, -7705=>610,7706=>615,7707=>610,7708=>615,7709=>610,7710=>615,7711=>391,7712=>738,7713=>644,7714=>753, -7715=>641,7716=>753,7717=>641,7718=>753,7719=>641,7720=>753,7721=>641,7722=>753,7723=>641,7724=>334, -7725=>308,7726=>334,7727=>308,7728=>697,7729=>598,7730=>697,7731=>598,7732=>697,7733=>598,7734=>573, -7735=>308,7736=>573,7737=>308,7738=>573,7739=>308,7740=>573,7741=>308,7742=>896,7743=>938,7744=>896, -7745=>938,7746=>896,7747=>938,7748=>753,7749=>641,7750=>753,7751=>641,7752=>753,7753=>641,7754=>753, -7755=>641,7756=>765,7757=>618,7758=>765,7759=>618,7760=>765,7761=>618,7762=>765,7763=>618,7764=>659, -7765=>644,7766=>659,7767=>644,7768=>693,7769=>444,7770=>693,7771=>444,7772=>693,7773=>444,7774=>693, -7775=>444,7776=>648,7777=>536,7778=>648,7779=>536,7780=>648,7781=>536,7782=>648,7783=>536,7784=>648, -7785=>536,7786=>614,7787=>430,7788=>614,7789=>430,7790=>614,7791=>430,7792=>614,7793=>430,7794=>730, -7795=>641,7796=>730,7797=>641,7798=>730,7799=>641,7800=>730,7801=>641,7802=>730,7803=>641,7804=>696, -7805=>586,7806=>696,7807=>586,7808=>993,7809=>831,7810=>993,7811=>831,7812=>993,7813=>831,7814=>993, -7815=>831,7816=>993,7817=>831,7818=>694,7819=>580,7820=>694,7821=>580,7822=>651,7823=>586,7824=>652, -7825=>523,7826=>652,7827=>523,7828=>652,7829=>523,7830=>641,7831=>430,7832=>831,7833=>586,7834=>607, -7835=>391,7838=>806,7839=>618,7840=>696,7841=>607,7842=>696,7843=>607,7844=>696,7845=>607,7846=>696, -7847=>607,7848=>696,7849=>607,7850=>696,7851=>607,7852=>696,7853=>607,7854=>696,7855=>607,7856=>696, -7857=>607,7858=>696,7859=>607,7860=>696,7861=>607,7862=>696,7863=>607,7864=>615,7865=>610,7866=>615, -7867=>610,7868=>615,7869=>610,7870=>615,7871=>610,7872=>615,7873=>610,7874=>615,7875=>610,7876=>615, -7877=>610,7878=>615,7879=>610,7880=>334,7881=>308,7882=>334,7883=>308,7884=>765,7885=>618,7886=>765, -7887=>618,7888=>765,7889=>618,7890=>765,7891=>618,7892=>765,7893=>618,7894=>765,7895=>618,7896=>765, -7897=>618,7898=>765,7899=>618,7900=>765,7901=>618,7902=>765,7903=>618,7904=>765,7905=>618,7906=>765, -7907=>618,7908=>730,7909=>641,7910=>730,7911=>641,7912=>730,7913=>641,7914=>730,7915=>641,7916=>730, -7917=>641,7918=>730,7919=>641,7920=>730,7921=>641,7922=>651,7923=>586,7924=>651,7925=>586,7926=>651, -7927=>586,7928=>651,7929=>586,7936=>618,7937=>618,7938=>618,7939=>618,7940=>618,7941=>618,7942=>618, -7943=>618,7944=>696,7945=>696,7946=>937,7947=>939,7948=>841,7949=>866,7950=>751,7951=>773,7952=>501, -7953=>501,7954=>501,7955=>501,7956=>501,7957=>501,7960=>712,7961=>715,7962=>989,7963=>986,7964=>920, -7965=>947,7968=>641,7969=>641,7970=>641,7971=>641,7972=>641,7973=>641,7974=>641,7975=>641,7976=>851, -7977=>856,7978=>1125,7979=>1125,7980=>1062,7981=>1085,7982=>948,7983=>956,7984=>351,7985=>351,7986=>351, -7987=>351,7988=>351,7989=>351,7990=>351,7991=>351,7992=>435,7993=>440,7994=>699,7995=>707,7996=>641, -7997=>664,7998=>544,7999=>544,8000=>618,8001=>618,8002=>618,8003=>618,8004=>618,8005=>618,8008=>802, -8009=>839,8010=>1099,8011=>1101,8012=>947,8013=>974,8016=>607,8017=>607,8018=>607,8019=>607,8020=>607, -8021=>607,8022=>607,8023=>607,8025=>837,8027=>1065,8029=>1079,8031=>944,8032=>782,8033=>782,8034=>782, -8035=>782,8036=>782,8037=>782,8038=>782,8039=>782,8040=>817,8041=>862,8042=>1121,8043=>1126,8044=>968, -8045=>994,8046=>925,8047=>968,8048=>618,8049=>618,8050=>501,8051=>501,8052=>641,8053=>641,8054=>351, -8055=>351,8056=>618,8057=>618,8058=>607,8059=>607,8060=>782,8061=>782,8064=>618,8065=>618,8066=>618, -8067=>618,8068=>618,8069=>618,8070=>618,8071=>618,8072=>696,8073=>696,8074=>937,8075=>939,8076=>841, -8077=>866,8078=>751,8079=>773,8080=>641,8081=>641,8082=>641,8083=>641,8084=>641,8085=>641,8086=>641, -8087=>641,8088=>851,8089=>856,8090=>1125,8091=>1125,8092=>1062,8093=>1085,8094=>948,8095=>956,8096=>782, -8097=>782,8098=>782,8099=>782,8100=>782,8101=>782,8102=>782,8103=>782,8104=>817,8105=>862,8106=>1121, -8107=>1126,8108=>968,8109=>994,8110=>925,8111=>968,8112=>618,8113=>618,8114=>618,8115=>618,8116=>618, -8118=>618,8119=>618,8120=>696,8121=>696,8122=>789,8123=>717,8124=>696,8125=>450,8126=>450,8127=>450, -8128=>450,8129=>450,8130=>641,8131=>641,8132=>641,8134=>641,8135=>641,8136=>836,8137=>761,8138=>972, -8139=>908,8140=>753,8141=>450,8142=>450,8143=>450,8144=>351,8145=>351,8146=>351,8147=>351,8150=>351, -8151=>351,8152=>334,8153=>334,8154=>559,8155=>507,8157=>450,8158=>450,8159=>450,8160=>607,8161=>607, -8162=>607,8163=>607,8164=>644,8165=>644,8166=>607,8167=>607,8168=>651,8169=>651,8170=>918,8171=>882, -8172=>754,8173=>450,8174=>450,8175=>450,8178=>782,8179=>782,8180=>782,8182=>782,8183=>782,8184=>958, -8185=>801,8186=>976,8187=>804,8188=>765,8189=>450,8190=>450,8192=>450,8193=>900,8194=>450,8195=>900, -8196=>296,8197=>225,8198=>150,8199=>626,8200=>342,8201=>180,8202=>89,8203=>0,8204=>0,8205=>0, -8206=>0,8207=>0,8208=>374,8209=>374,8210=>626,8213=>900,8214=>450,8215=>450,8219=>342,8223=>591, -8227=>575,8228=>342,8229=>616,8231=>313,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>180, -8241=>1717,8242=>237,8243=>402,8244=>567,8245=>237,8246=>402,8247=>567,8248=>659,8251=>875,8252=>564, -8253=>522,8254=>450,8255=>745,8256=>745,8257=>296,8258=>920,8259=>450,8260=>150,8261=>411,8262=>411, -8263=>927,8264=>746,8265=>746,8266=>461,8267=>618,8268=>450,8269=>450,8270=>470,8271=>360,8272=>745, -8273=>470,8274=>500,8275=>754,8276=>745,8277=>754,8278=>615,8279=>731,8280=>754,8281=>754,8282=>342, -8283=>784,8284=>754,8285=>342,8286=>342,8287=>200,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0, -8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>394,8305=>197,8308=>394,8309=>394, -8310=>394,8311=>394,8312=>394,8313=>394,8314=>475,8315=>475,8316=>475,8317=>259,8318=>259,8319=>410, -8320=>394,8321=>394,8322=>394,8323=>394,8324=>394,8325=>394,8326=>394,8327=>394,8328=>394,8329=>394, -8330=>475,8331=>475,8332=>475,8333=>259,8334=>259,8336=>412,8337=>431,8338=>439,8339=>371,8340=>431, -8352=>836,8353=>626,8354=>626,8355=>626,8356=>626,8357=>938,8358=>753,8359=>1339,8360=>1084,8361=>993, -8362=>768,8363=>642,8365=>626,8366=>614,8367=>1252,8368=>626,8369=>626,8370=>626,8371=>626,8372=>773, -8373=>626,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>995,8449=>995, -8450=>660,8451=>1090,8452=>807,8453=>1002,8454=>1033,8455=>626,8456=>628,8457=>856,8459=>965,8460=>822, -8461=>799,8462=>641,8463=>641,8464=>537,8465=>627,8466=>771,8467=>424,8468=>876,8469=>753,8470=>1083, -8471=>900,8472=>627,8473=>675,8474=>765,8475=>844,8476=>732,8477=>721,8478=>807,8479=>639,8480=>917, -8481=>1115,8483=>751,8484=>679,8485=>560,8486=>765,8487=>692,8488=>686,8489=>272,8490=>697,8491=>696, -8492=>835,8493=>736,8494=>769,8495=>572,8496=>656,8497=>727,8498=>615,8499=>1065,8500=>418,8501=>714, -8502=>658,8503=>444,8504=>615,8505=>342,8506=>851,8507=>1232,8508=>710,8509=>663,8510=>589,8511=>776, -8512=>756,8513=>707,8514=>518,8515=>573,8516=>684,8517=>747,8518=>644,8519=>610,8520=>308,8521=>308, -8523=>785,8526=>492,8531=>932,8532=>932,8533=>932,8534=>932,8535=>932,8536=>932,8537=>932,8538=>932, -8539=>932,8540=>932,8541=>932,8542=>932,8543=>554,8544=>334,8545=>593,8546=>851,8547=>989,8548=>696, -8549=>989,8550=>1247,8551=>1505,8552=>1008,8553=>694,8554=>1008,8555=>1266,8556=>573,8557=>660,8558=>747, -8559=>896,8560=>308,8561=>546,8562=>785,8563=>885,8564=>586,8565=>866,8566=>1104,8567=>1342,8568=>872, -8569=>580,8570=>872,8571=>1110,8572=>308,8573=>533,8574=>644,8575=>938,8576=>1160,8577=>747,8578=>1160, -8579=>660,8580=>533,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754, -8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754, -8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754, -8620=>754,8621=>754,8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754, -8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754, -8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754, -8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754, -8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754, -8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754, -8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754, -8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754, -8700=>754,8701=>754,8702=>754,8703=>754,8704=>696,8705=>626,8706=>489,8707=>615,8708=>615,8709=>771, -8710=>627,8711=>627,8712=>807,8713=>807,8714=>675,8715=>807,8716=>807,8717=>675,8718=>572,8719=>708, -8720=>708,8721=>646,8722=>754,8723=>754,8724=>626,8725=>329,8726=>626,8727=>754,8728=>563,8729=>342, -8730=>600,8731=>600,8732=>600,8733=>641,8734=>750,8735=>754,8736=>807,8737=>807,8738=>754,8739=>450, -8740=>450,8741=>450,8742=>450,8743=>730,8744=>730,8745=>730,8746=>730,8747=>549,8748=>835,8749=>1165, -8750=>506,8751=>879,8752=>1181,8753=>506,8754=>506,8755=>506,8756=>626,8757=>626,8758=>264,8759=>626, -8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754,8766=>754,8767=>754,8768=>337,8769=>754, -8770=>754,8771=>754,8772=>754,8773=>754,8774=>754,8775=>754,8776=>754,8777=>754,8778=>754,8779=>754, -8780=>754,8781=>754,8782=>754,8783=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>956,8789=>956, -8790=>754,8791=>754,8792=>754,8793=>754,8794=>754,8795=>754,8796=>754,8797=>754,8798=>754,8799=>754, -8800=>754,8801=>754,8802=>754,8803=>754,8804=>754,8805=>754,8806=>754,8807=>754,8808=>756,8809=>756, -8810=>942,8811=>942,8812=>450,8813=>754,8814=>754,8815=>754,8816=>754,8817=>754,8818=>754,8819=>754, -8820=>754,8821=>754,8822=>754,8823=>754,8824=>754,8825=>754,8826=>754,8827=>754,8828=>754,8829=>754, -8830=>754,8831=>754,8832=>754,8833=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754, -8840=>754,8841=>754,8842=>754,8843=>754,8844=>730,8845=>730,8846=>730,8847=>754,8848=>754,8849=>754, -8850=>754,8851=>716,8852=>716,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754,8858=>754,8859=>754, -8860=>754,8861=>754,8862=>754,8863=>754,8864=>754,8865=>754,8866=>822,8867=>822,8868=>822,8869=>822, -8870=>488,8871=>488,8872=>822,8873=>822,8874=>822,8875=>822,8876=>822,8877=>822,8878=>822,8879=>822, -8880=>754,8881=>754,8882=>754,8883=>754,8884=>754,8885=>754,8886=>900,8887=>900,8888=>754,8889=>754, -8890=>488,8891=>730,8892=>730,8893=>730,8894=>754,8895=>754,8896=>758,8897=>758,8898=>758,8899=>758, -8900=>444,8901=>342,8902=>563,8903=>754,8904=>900,8905=>900,8906=>900,8907=>900,8908=>900,8909=>754, -8910=>730,8911=>730,8912=>754,8913=>754,8914=>754,8915=>754,8916=>754,8917=>754,8918=>754,8919=>754, -8920=>1280,8921=>1280,8922=>754,8923=>754,8924=>754,8925=>754,8926=>754,8927=>754,8928=>754,8929=>754, -8930=>754,8931=>754,8932=>754,8933=>754,8934=>754,8935=>754,8936=>754,8937=>754,8938=>754,8939=>754, -8940=>754,8941=>754,8942=>900,8943=>900,8944=>900,8945=>900,8946=>1042,8947=>807,8948=>675,8949=>807, -8950=>807,8951=>675,8952=>807,8953=>807,8954=>1042,8955=>807,8956=>675,8957=>807,8958=>675,8959=>807, -8960=>542,8961=>542,8962=>644,8963=>754,8964=>754,8965=>754,8966=>754,8967=>439,8968=>411,8969=>411, -8970=>411,8971=>411,8972=>728,8973=>728,8974=>728,8975=>728,8976=>754,8977=>484,8984=>835,8985=>754, -8988=>422,8989=>422,8990=>422,8991=>422,8992=>549,8993=>549,8996=>1037,8997=>1037,8998=>1272,8999=>1037, -9000=>1299,9003=>1272,9004=>786,9075=>351,9076=>644,9077=>782,9082=>618,9085=>776,9095=>1037,9108=>786, -9115=>450,9116=>450,9117=>450,9118=>450,9119=>450,9120=>450,9121=>450,9122=>450,9123=>450,9124=>450, -9125=>450,9126=>450,9127=>675,9128=>675,9129=>675,9130=>675,9131=>675,9132=>675,9133=>675,9134=>549, -9166=>754,9167=>850,9187=>786,9189=>692,9250=>644,9251=>644,9312=>762,9313=>762,9314=>762,9315=>762, -9316=>762,9317=>762,9318=>762,9319=>762,9320=>762,9321=>762,9600=>692,9601=>692,9602=>692,9603=>692, -9604=>692,9605=>692,9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692, -9614=>692,9615=>692,9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692, -9624=>692,9625=>692,9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850, -9634=>850,9635=>850,9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610, -9644=>850,9645=>850,9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452, -9654=>692,9655=>692,9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452, -9664=>692,9665=>692,9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785, -9674=>444,9675=>785,9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785, -9684=>785,9685=>785,9686=>474,9687=>474,9688=>756,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348, -9694=>348,9695=>348,9696=>692,9697=>692,9698=>692,9699=>692,9700=>692,9701=>692,9702=>575,9703=>850, -9704=>850,9705=>850,9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850, -9714=>850,9715=>850,9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747, -9724=>747,9725=>659,9726=>659,9727=>692,9728=>807,9729=>900,9730=>807,9731=>807,9732=>807,9733=>807, -9734=>807,9735=>515,9736=>806,9737=>807,9738=>799,9739=>799,9740=>604,9741=>911,9742=>1121,9743=>1125, -9744=>807,9745=>807,9746=>807,9747=>479,9748=>807,9749=>807,9750=>807,9751=>807,9752=>807,9753=>807, -9754=>807,9755=>807,9756=>807,9757=>548,9758=>807,9759=>548,9760=>807,9761=>807,9762=>807,9763=>807, -9764=>602,9765=>671,9766=>584,9767=>705,9768=>490,9769=>807,9770=>807,9771=>807,9772=>639,9773=>807, -9774=>807,9775=>807,9776=>807,9777=>807,9778=>807,9779=>807,9780=>807,9781=>807,9782=>807,9783=>807, -9784=>807,9785=>807,9786=>807,9787=>807,9788=>807,9789=>807,9790=>807,9791=>552,9792=>658,9793=>658, -9794=>807,9795=>807,9796=>807,9797=>807,9798=>807,9799=>807,9800=>807,9801=>807,9802=>807,9803=>807, -9804=>807,9805=>807,9806=>807,9807=>807,9808=>807,9809=>807,9810=>807,9811=>807,9812=>807,9813=>807, -9814=>807,9815=>807,9816=>807,9817=>807,9818=>807,9819=>807,9820=>807,9821=>807,9822=>807,9823=>807, -9824=>807,9825=>807,9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9832=>807,9833=>424, -9834=>574,9835=>807,9836=>807,9837=>424,9838=>321,9839=>435,9840=>673,9841=>689,9842=>807,9843=>807, -9844=>807,9845=>807,9846=>807,9847=>807,9848=>807,9849=>807,9850=>807,9851=>807,9852=>807,9853=>807, -9854=>807,9855=>807,9856=>782,9857=>782,9858=>782,9859=>782,9860=>782,9861=>782,9862=>807,9863=>807, -9864=>807,9865=>807,9866=>807,9867=>807,9868=>807,9869=>807,9870=>807,9871=>807,9872=>807,9873=>807, -9874=>807,9875=>807,9876=>807,9877=>487,9878=>807,9879=>807,9880=>807,9881=>807,9882=>807,9883=>807, -9884=>807,9888=>807,9889=>632,9890=>903,9891=>977,9892=>1028,9893=>811,9894=>754,9895=>754,9896=>754, -9897=>754,9898=>754,9899=>754,9900=>754,9901=>754,9902=>754,9903=>754,9904=>759,9905=>754,9906=>658, -9907=>659,9908=>659,9909=>659,9910=>765,9911=>659,9912=>659,9985=>754,9986=>754,9987=>754,9988=>754, -9990=>754,9991=>754,9992=>754,9993=>754,9996=>754,9997=>754,9998=>754,9999=>754,10000=>754,10001=>754, -10002=>754,10003=>754,10004=>754,10005=>754,10006=>754,10007=>754,10008=>754,10009=>754,10010=>754,10011=>754, -10012=>754,10013=>754,10014=>754,10015=>754,10016=>754,10017=>754,10018=>754,10019=>754,10020=>754,10021=>754, -10022=>754,10023=>754,10025=>754,10026=>754,10027=>754,10028=>754,10029=>754,10030=>754,10031=>754,10032=>754, -10033=>754,10034=>754,10035=>754,10036=>754,10037=>754,10038=>754,10039=>754,10040=>754,10041=>754,10042=>754, -10043=>754,10044=>754,10045=>754,10046=>754,10047=>754,10048=>754,10049=>754,10050=>754,10051=>754,10052=>754, -10053=>754,10054=>754,10055=>754,10056=>754,10057=>754,10058=>754,10059=>754,10061=>807,10063=>807,10064=>807, -10065=>807,10066=>807,10070=>807,10072=>754,10073=>754,10074=>754,10075=>290,10076=>290,10077=>484,10078=>484, -10081=>754,10082=>754,10083=>754,10084=>754,10085=>754,10086=>754,10087=>754,10088=>754,10089=>754,10090=>754, -10091=>754,10092=>754,10093=>754,10094=>754,10095=>754,10096=>754,10097=>754,10098=>754,10099=>754,10100=>754, -10101=>754,10102=>762,10103=>762,10104=>762,10105=>762,10106=>762,10107=>762,10108=>762,10109=>762,10110=>762, -10111=>762,10112=>754,10113=>754,10114=>754,10115=>754,10116=>754,10117=>754,10118=>754,10119=>754,10120=>754, -10121=>754,10122=>754,10123=>754,10124=>754,10125=>754,10126=>754,10127=>754,10128=>754,10129=>754,10130=>754, -10131=>754,10132=>754,10136=>754,10137=>754,10138=>754,10139=>754,10140=>754,10141=>754,10142=>754,10143=>754, -10144=>754,10145=>754,10146=>754,10147=>754,10148=>754,10149=>754,10150=>754,10151=>754,10152=>754,10153=>754, -10154=>754,10155=>754,10156=>754,10157=>754,10158=>754,10159=>754,10161=>754,10162=>754,10163=>754,10164=>754, -10165=>754,10166=>754,10167=>754,10168=>754,10169=>754,10170=>754,10171=>754,10172=>754,10173=>754,10174=>754, -10181=>411,10182=>411,10208=>444,10214=>438,10215=>438,10216=>411,10217=>411,10218=>648,10219=>648,10224=>754, -10225=>754,10226=>754,10227=>754,10228=>1042,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290, -10235=>1290,10236=>1290,10237=>1290,10238=>1290,10239=>1290,10240=>703,10241=>703,10242=>703,10243=>703,10244=>703, -10245=>703,10246=>703,10247=>703,10248=>703,10249=>703,10250=>703,10251=>703,10252=>703,10253=>703,10254=>703, -10255=>703,10256=>703,10257=>703,10258=>703,10259=>703,10260=>703,10261=>703,10262=>703,10263=>703,10264=>703, -10265=>703,10266=>703,10267=>703,10268=>703,10269=>703,10270=>703,10271=>703,10272=>703,10273=>703,10274=>703, -10275=>703,10276=>703,10277=>703,10278=>703,10279=>703,10280=>703,10281=>703,10282=>703,10283=>703,10284=>703, -10285=>703,10286=>703,10287=>703,10288=>703,10289=>703,10290=>703,10291=>703,10292=>703,10293=>703,10294=>703, -10295=>703,10296=>703,10297=>703,10298=>703,10299=>703,10300=>703,10301=>703,10302=>703,10303=>703,10304=>703, -10305=>703,10306=>703,10307=>703,10308=>703,10309=>703,10310=>703,10311=>703,10312=>703,10313=>703,10314=>703, -10315=>703,10316=>703,10317=>703,10318=>703,10319=>703,10320=>703,10321=>703,10322=>703,10323=>703,10324=>703, -10325=>703,10326=>703,10327=>703,10328=>703,10329=>703,10330=>703,10331=>703,10332=>703,10333=>703,10334=>703, -10335=>703,10336=>703,10337=>703,10338=>703,10339=>703,10340=>703,10341=>703,10342=>703,10343=>703,10344=>703, -10345=>703,10346=>703,10347=>703,10348=>703,10349=>703,10350=>703,10351=>703,10352=>703,10353=>703,10354=>703, -10355=>703,10356=>703,10357=>703,10358=>703,10359=>703,10360=>703,10361=>703,10362=>703,10363=>703,10364=>703, -10365=>703,10366=>703,10367=>703,10368=>703,10369=>703,10370=>703,10371=>703,10372=>703,10373=>703,10374=>703, -10375=>703,10376=>703,10377=>703,10378=>703,10379=>703,10380=>703,10381=>703,10382=>703,10383=>703,10384=>703, -10385=>703,10386=>703,10387=>703,10388=>703,10389=>703,10390=>703,10391=>703,10392=>703,10393=>703,10394=>703, -10395=>703,10396=>703,10397=>703,10398=>703,10399=>703,10400=>703,10401=>703,10402=>703,10403=>703,10404=>703, -10405=>703,10406=>703,10407=>703,10408=>703,10409=>703,10410=>703,10411=>703,10412=>703,10413=>703,10414=>703, -10415=>703,10416=>703,10417=>703,10418=>703,10419=>703,10420=>703,10421=>703,10422=>703,10423=>703,10424=>703, -10425=>703,10426=>703,10427=>703,10428=>703,10429=>703,10430=>703,10431=>703,10432=>703,10433=>703,10434=>703, -10435=>703,10436=>703,10437=>703,10438=>703,10439=>703,10440=>703,10441=>703,10442=>703,10443=>703,10444=>703, -10445=>703,10446=>703,10447=>703,10448=>703,10449=>703,10450=>703,10451=>703,10452=>703,10453=>703,10454=>703, -10455=>703,10456=>703,10457=>703,10458=>703,10459=>703,10460=>703,10461=>703,10462=>703,10463=>703,10464=>703, -10465=>703,10466=>703,10467=>703,10468=>703,10469=>703,10470=>703,10471=>703,10472=>703,10473=>703,10474=>703, -10475=>703,10476=>703,10477=>703,10478=>703,10479=>703,10480=>703,10481=>703,10482=>703,10483=>703,10484=>703, -10485=>703,10486=>703,10487=>703,10488=>703,10489=>703,10490=>703,10491=>703,10492=>703,10493=>703,10494=>703, -10495=>703,10502=>754,10503=>754,10506=>754,10507=>754,10560=>754,10561=>754,10627=>678,10628=>678,10702=>754, -10703=>941,10704=>941,10705=>900,10706=>900,10707=>900,10708=>900,10709=>900,10731=>444,10746=>754,10747=>754, -10752=>900,10753=>900,10754=>900,10764=>1495,10765=>506,10766=>506,10767=>506,10768=>506,10769=>506,10770=>506, -10771=>506,10772=>506,10773=>506,10774=>506,10775=>506,10776=>506,10777=>506,10778=>506,10779=>506,10780=>506, -10799=>754,10877=>754,10878=>754,10879=>754,10880=>754,10881=>754,10882=>754,10883=>754,10884=>754,10885=>754, -10886=>754,10887=>754,10888=>754,10889=>754,10890=>754,10891=>754,10892=>754,10893=>754,10894=>754,10895=>754, -10896=>754,10897=>754,10898=>754,10899=>754,10900=>754,10901=>754,10902=>754,10903=>754,10904=>754,10905=>754, -10906=>754,10907=>754,10908=>754,10909=>754,10910=>754,10911=>754,10912=>754,10926=>754,10927=>754,10928=>754, -10929=>754,10930=>754,10931=>754,10932=>754,10933=>754,10934=>754,10935=>754,10936=>754,10937=>754,10938=>754, -11001=>754,11002=>754,11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754, -11016=>754,11017=>754,11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754, -11026=>850,11027=>850,11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11039=>782, -11040=>782,11041=>786,11042=>786,11043=>786,11044=>1007,11091=>782,11092=>782,11360=>573,11361=>324,11362=>573, -11363=>659,11364=>693,11365=>607,11366=>430,11367=>860,11368=>641,11369=>697,11370=>598,11371=>652,11372=>523, -11373=>774,11374=>896,11375=>696,11377=>700,11378=>1099,11379=>950,11380=>586,11381=>628,11382=>508,11383=>704, -11385=>484,11386=>618,11387=>502,11388=>197,11389=>438,11800=>527,11810=>411,11811=>411,11812=>411,11813=>411, -11822=>522,19904=>807,19905=>807,19906=>807,19907=>807,19908=>807,19909=>807,19910=>807,19911=>807,19912=>807, -19913=>807,19914=>807,19915=>807,19916=>807,19917=>807,19918=>807,19919=>807,19920=>807,19921=>807,19922=>807, -19923=>807,19924=>807,19925=>807,19926=>807,19927=>807,19928=>807,19929=>807,19930=>807,19931=>807,19932=>807, -19933=>807,19934=>807,19935=>807,19936=>807,19937=>807,19938=>807,19939=>807,19940=>807,19941=>807,19942=>807, -19943=>807,19944=>807,19945=>807,19946=>807,19947=>807,19948=>807,19949=>807,19950=>807,19951=>807,19952=>807, -19953=>807,19954=>807,19955=>807,19956=>807,19957=>807,19958=>807,19959=>807,19960=>807,19961=>807,19962=>807, -19963=>807,19964=>807,19965=>807,19966=>807,19967=>807,42564=>648,42565=>536,42566=>392,42567=>396,42572=>1265, -42573=>1055,42576=>1110,42577=>924,42580=>1056,42581=>875,42582=>990,42583=>872,42594=>990,42595=>846,42596=>986, -42597=>823,42598=>1134,42599=>896,42600=>765,42601=>618,42602=>933,42603=>781,42604=>1266,42605=>995,42606=>865, -42634=>849,42635=>673,42636=>614,42637=>521,42644=>727,42645=>641,42760=>450,42761=>450,42762=>450,42763=>450, -42764=>450,42765=>450,42766=>450,42767=>450,42768=>450,42769=>450,42770=>450,42771=>450,42772=>450,42773=>450, -42774=>450,42779=>360,42780=>360,42781=>258,42782=>258,42783=>258,42790=>753,42791=>641,42792=>928,42793=>771, -42794=>626,42795=>501,42800=>502,42801=>536,42802=>1214,42803=>946,42804=>1156,42805=>958,42806=>1120,42807=>947, -42808=>971,42809=>830,42810=>971,42811=>830,42812=>932,42813=>830,42814=>628,42815=>494,42822=>765,42823=>488, -42824=>614,42825=>478,42826=>826,42827=>732,42830=>1266,42831=>995,42880=>573,42881=>308,42882=>753,42883=>641, -42889=>360,42890=>356,42891=>410,42892=>275,43003=>615,43004=>659,43005=>896,43006=>334,43007=>1192,62917=>618, -64256=>749,64257=>708,64258=>708,64259=>1024,64260=>1024,64261=>727,64262=>917,64275=>1249,64276=>1245,64277=>1240, -64278=>1245,64279=>1542,64285=>308,64286=>0,64287=>597,64288=>647,64289=>867,64290=>801,64291=>889,64292=>867, -64293=>844,64294=>889,64295=>889,64296=>878,64297=>754,64298=>854,64299=>854,64300=>854,64301=>854,64302=>676, -64303=>676,64304=>676,64305=>605,64306=>483,64307=>589,64308=>641,64309=>308,64310=>442,64312=>651,64313=>420, -64314=>584,64315=>584,64316=>611,64318=>698,64320=>447,64321=>696,64323=>646,64324=>618,64326=>676,64327=>656, -64328=>584,64329=>854,64330=>676,64331=>308,64332=>605,64333=>584,64334=>618,64335=>676,65024=>0,65025=>0, -65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0, -65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65529=>0,65530=>0, -65531=>0,65532=>0,65533=>1002); -$enc=''; -$diff=''; -$file='dejavusanscondensedbi.z'; -$ctg='dejavusanscondensedbi.ctg.z'; -$originalsize=493196; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.z deleted file mode 100644 index 7d5707071b..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.ctg.z deleted file mode 100644 index ac628b3e0d..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.php deleted file mode 100644 index b2a62c041b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.php +++ /dev/null @@ -1,471 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansCondensed-Oblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-39,'Flags'=>96,'FontBBox'=>'[-914 -350 1493 1068]','ItalicAngle'=>-11,'StemV'=>70,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>286,33=>360,34=>414,35=>754,36=>572,37=>855,38=>702,39=>247,40=>351, -41=>351,42=>450,43=>754,44=>286,45=>325,46=>286,47=>303,48=>572,49=>572,50=>572, -51=>572,52=>572,53=>572,54=>572,55=>572,56=>572,57=>572,58=>303,59=>303,60=>754, -61=>754,62=>754,63=>478,64=>900,65=>615,66=>617,67=>628,68=>693,69=>568,70=>518, -71=>697,72=>677,73=>265,74=>265,75=>590,76=>501,77=>776,78=>673,79=>708,80=>542, -81=>708,82=>625,83=>571,84=>549,85=>659,86=>615,87=>890,88=>616,89=>549,90=>616, -91=>351,92=>303,93=>351,94=>754,95=>450,96=>450,97=>551,98=>571,99=>495,100=>571, -101=>554,102=>316,103=>571,104=>570,105=>250,106=>250,107=>521,108=>250,109=>876,110=>570, -111=>550,112=>571,113=>571,114=>370,115=>469,116=>353,117=>570,118=>532,119=>736,120=>532, -121=>532,122=>472,123=>572,124=>303,125=>572,126=>754,8364=>572,8218=>286,402=>316,8222=>466, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1215,352=>571,8249=>360,338=>962,381=>616,8216=>286, -8217=>286,8220=>466,8221=>466,8226=>531,8211=>450,8212=>900,732=>450,8482=>900,353=>469,8250=>360, -339=>925,382=>472,376=>549,160=>286,161=>360,162=>572,163=>572,164=>572,165=>572,166=>303, -167=>450,168=>450,169=>900,170=>424,171=>555,172=>754,173=>325,174=>900,175=>450,176=>450, -177=>754,178=>360,179=>360,180=>450,181=>572,182=>572,183=>286,184=>450,185=>360,186=>424, -187=>555,188=>872,189=>872,190=>872,191=>478,192=>615,193=>615,194=>615,195=>615,196=>615, -197=>615,198=>876,199=>628,200=>568,201=>568,202=>568,203=>568,204=>265,205=>265,206=>265, -207=>265,208=>697,209=>673,210=>708,211=>708,212=>708,213=>708,214=>708,215=>754,216=>708, -217=>659,218=>659,219=>659,220=>659,221=>549,222=>547,223=>567,224=>551,225=>551,226=>551, -227=>551,228=>551,229=>551,230=>896,231=>495,232=>554,233=>554,234=>554,235=>554,236=>250, -237=>250,238=>250,239=>250,240=>550,241=>570,242=>550,243=>550,244=>550,245=>550,246=>550, -247=>754,248=>550,249=>570,250=>570,251=>570,252=>570,253=>532,254=>571,255=>532,256=>615, -257=>551,258=>615,259=>551,260=>615,261=>551,262=>628,263=>495,264=>628,265=>495,266=>628, -267=>495,268=>628,269=>495,270=>693,271=>571,272=>697,273=>571,274=>568,275=>554,276=>568, -277=>554,278=>568,279=>554,280=>568,281=>554,282=>568,283=>554,284=>697,285=>571,286=>697, -287=>571,288=>697,289=>571,290=>697,291=>571,292=>677,293=>570,294=>824,295=>625,296=>265, -297=>250,298=>265,299=>250,300=>265,301=>250,302=>265,303=>250,304=>265,305=>250,306=>531, -307=>500,308=>265,309=>250,310=>590,311=>521,312=>521,313=>501,314=>250,315=>501,316=>250, -317=>501,318=>250,319=>501,320=>250,321=>505,322=>258,323=>673,324=>570,325=>673,326=>570, -327=>673,328=>570,329=>732,330=>673,331=>570,332=>708,333=>550,334=>708,335=>550,336=>708, -337=>550,340=>625,341=>370,342=>625,343=>370,344=>625,345=>370,346=>571,347=>469,348=>571, -349=>469,350=>571,351=>469,354=>549,355=>353,356=>549,357=>353,358=>549,359=>353,360=>659, -361=>570,362=>659,363=>570,364=>659,365=>570,366=>659,367=>570,368=>659,369=>570,370=>659, -371=>570,372=>890,373=>736,374=>549,375=>532,377=>616,378=>472,379=>616,380=>472,383=>316, -384=>571,385=>661,386=>617,387=>571,388=>617,389=>571,390=>633,391=>628,392=>495,393=>697, -394=>737,395=>617,396=>571,397=>550,398=>568,399=>708,400=>553,401=>518,403=>697,404=>618, -405=>885,406=>318,407=>265,408=>671,409=>521,410=>250,411=>532,412=>876,413=>673,414=>570, -415=>708,416=>822,417=>550,418=>844,419=>663,420=>586,421=>571,422=>625,423=>571,424=>469, -425=>568,426=>302,427=>353,428=>549,429=>353,430=>549,431=>754,432=>570,433=>688,434=>648, -435=>669,436=>657,437=>616,438=>472,439=>599,440=>599,441=>520,442=>472,443=>572,444=>599, -445=>520,446=>459,447=>571,448=>265,449=>443,450=>413,451=>266,452=>1310,453=>1165,454=>1043, -455=>767,456=>751,457=>500,458=>938,459=>923,460=>820,461=>615,462=>551,463=>265,464=>250, -465=>708,466=>550,467=>659,468=>570,469=>659,470=>570,471=>659,472=>570,473=>659,474=>570, -475=>659,476=>570,477=>554,478=>615,479=>551,480=>615,481=>551,482=>876,483=>896,484=>697, -485=>571,486=>697,487=>571,488=>590,489=>521,490=>708,491=>550,492=>708,493=>550,494=>599, -495=>472,496=>250,497=>1310,498=>1165,499=>1043,500=>697,501=>571,502=>1001,503=>614,504=>673, -505=>570,506=>615,507=>551,508=>876,509=>896,510=>708,511=>550,512=>615,513=>551,514=>615, -515=>551,516=>568,517=>554,518=>568,519=>554,520=>265,521=>250,522=>265,523=>250,524=>708, -525=>550,526=>708,527=>550,528=>625,529=>370,530=>625,531=>370,532=>659,533=>570,534=>659, -535=>570,536=>571,537=>469,538=>549,539=>353,540=>564,541=>469,542=>677,543=>570,544=>662, -545=>754,546=>628,547=>549,548=>616,549=>472,550=>615,551=>551,552=>568,553=>554,554=>708, -555=>550,556=>708,557=>550,558=>708,559=>550,560=>708,561=>550,562=>549,563=>532,564=>427, -565=>758,566=>429,567=>250,568=>898,569=>898,570=>615,571=>628,572=>495,573=>501,574=>549, -575=>469,576=>472,577=>542,578=>431,579=>617,580=>659,581=>615,582=>568,583=>554,584=>265, -585=>250,586=>703,587=>571,588=>625,589=>370,590=>549,591=>532,592=>551,593=>571,594=>571, -595=>571,596=>495,597=>495,598=>571,599=>654,600=>554,601=>554,602=>759,603=>490,604=>490, -605=>698,606=>598,607=>293,608=>626,609=>571,610=>566,611=>536,612=>536,613=>570,614=>570, -615=>570,616=>334,617=>348,618=>334,619=>356,620=>438,621=>250,622=>635,623=>876,624=>876, -625=>876,626=>581,627=>578,628=>570,629=>550,630=>772,631=>655,632=>593,633=>422,634=>422, -635=>422,636=>422,637=>422,638=>477,639=>477,640=>541,641=>541,642=>469,643=>302,644=>302, -645=>415,646=>302,647=>353,648=>353,649=>570,650=>556,651=>538,652=>532,653=>736,654=>532, -655=>549,656=>472,657=>472,658=>520,659=>520,660=>459,661=>459,662=>459,663=>459,664=>708, -665=>521,666=>598,667=>637,668=>588,669=>263,670=>600,671=>456,672=>654,673=>459,674=>459, -675=>913,676=>952,677=>911,678=>742,679=>549,680=>700,681=>763,682=>576,683=>589,684=>463, -685=>463,686=>513,687=>597,688=>359,689=>359,690=>157,691=>233,692=>266,693=>266,694=>341, -695=>463,696=>335,697=>250,698=>414,699=>286,700=>286,701=>286,702=>276,703=>276,704=>333, -705=>333,706=>450,707=>450,708=>450,709=>450,711=>450,712=>247,713=>450,714=>450,715=>450, -716=>247,717=>450,718=>450,719=>450,720=>303,721=>303,722=>276,723=>276,724=>450,725=>450, -726=>351,727=>286,728=>450,729=>450,730=>450,731=>450,733=>450,734=>284,735=>450,736=>383, -737=>149,738=>335,739=>399,740=>333,741=>444,742=>444,743=>444,744=>444,745=>444,748=>450, -749=>450,750=>466,755=>450,759=>450,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>589,881=>511,882=>775, -883=>583,884=>250,885=>250,886=>673,887=>584,890=>450,891=>494,892=>495,893=>494,894=>303, -900=>450,901=>450,902=>615,903=>286,904=>690,905=>813,906=>391,908=>755,910=>773,911=>814, -912=>304,913=>615,914=>617,915=>501,916=>615,917=>568,918=>616,919=>677,920=>708,921=>265, -922=>590,923=>615,924=>776,925=>673,926=>568,927=>708,928=>677,929=>542,931=>568,932=>549, -933=>549,934=>708,935=>616,936=>708,937=>688,938=>265,939=>549,940=>593,941=>486,942=>570, -943=>304,944=>521,945=>593,946=>574,947=>532,948=>550,949=>486,950=>489,951=>570,952=>550, -953=>304,954=>530,955=>532,956=>572,957=>502,958=>501,959=>550,960=>542,961=>571,962=>528, -963=>570,964=>542,965=>521,966=>593,967=>532,968=>593,969=>753,970=>304,971=>521,972=>550, -973=>521,974=>753,975=>590,976=>553,977=>557,978=>628,979=>758,980=>628,981=>593,982=>753, -983=>597,984=>708,985=>550,986=>583,987=>528,988=>518,989=>413,990=>593,991=>593,992=>778, -993=>564,994=>840,995=>753,996=>682,997=>593,998=>712,999=>553,1000=>618,1001=>546,1002=>690, -1003=>563,1004=>629,1005=>550,1006=>549,1007=>482,1008=>597,1009=>571,1010=>495,1011=>250,1012=>708, -1013=>554,1014=>554,1015=>547,1016=>571,1017=>628,1018=>776,1019=>585,1020=>571,1021=>633,1022=>628, -1023=>633,1024=>568,1025=>568,1026=>708,1027=>501,1028=>628,1029=>571,1030=>265,1031=>265,1032=>265, -1033=>984,1034=>940,1035=>708,1036=>639,1037=>673,1038=>548,1039=>677,1040=>615,1041=>617,1042=>617, -1043=>501,1044=>703,1045=>568,1046=>969,1047=>577,1048=>673,1049=>673,1050=>639,1051=>677,1052=>776, -1053=>677,1054=>708,1055=>677,1056=>542,1057=>628,1058=>549,1059=>548,1060=>774,1061=>616,1062=>699, -1063=>617,1064=>962,1065=>984,1066=>749,1067=>736,1068=>617,1069=>628,1070=>971,1071=>625,1072=>551, -1073=>555,1074=>530,1075=>473,1076=>622,1077=>554,1078=>811,1079=>479,1080=>584,1081=>584,1082=>543, -1083=>575,1084=>679,1085=>588,1086=>550,1087=>588,1088=>571,1089=>495,1090=>524,1091=>532,1092=>769, -1093=>532,1094=>612,1095=>532,1096=>823,1097=>848,1098=>636,1099=>710,1100=>530,1101=>494,1102=>757, -1103=>541,1104=>554,1105=>554,1106=>563,1107=>473,1108=>494,1109=>469,1110=>250,1111=>250,1112=>250, -1113=>812,1114=>809,1115=>586,1116=>543,1117=>584,1118=>532,1119=>588,1120=>840,1121=>753,1122=>693, -1123=>604,1124=>848,1125=>674,1126=>791,1127=>705,1128=>1043,1129=>901,1130=>708,1131=>550,1132=>924, -1133=>742,1134=>572,1135=>486,1136=>771,1137=>789,1138=>708,1139=>550,1140=>703,1141=>598,1142=>703, -1143=>598,1144=>893,1145=>813,1146=>857,1147=>682,1148=>1062,1149=>925,1150=>840,1151=>753,1152=>628, -1153=>495,1154=>452,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>376,1161=>376,1162=>673, -1163=>591,1164=>617,1165=>530,1166=>542,1167=>571,1168=>549,1169=>473,1170=>607,1171=>500,1172=>501, -1173=>441,1174=>969,1175=>811,1176=>577,1177=>479,1178=>639,1179=>543,1180=>639,1181=>543,1182=>639, -1183=>543,1184=>771,1185=>748,1186=>677,1187=>594,1188=>913,1189=>789,1190=>1002,1191=>855,1192=>801, -1193=>636,1194=>628,1195=>495,1196=>549,1197=>476,1198=>549,1199=>532,1200=>549,1201=>532,1202=>616, -1203=>532,1204=>840,1205=>726,1206=>617,1207=>532,1208=>617,1209=>532,1210=>617,1211=>570,1212=>836, -1213=>658,1214=>836,1215=>658,1216=>265,1217=>969,1218=>811,1219=>589,1220=>543,1221=>677,1222=>575, -1223=>677,1224=>594,1225=>677,1226=>594,1227=>617,1228=>532,1229=>776,1230=>679,1231=>250,1232=>615, -1233=>551,1234=>615,1235=>551,1236=>876,1237=>896,1238=>568,1239=>554,1240=>708,1241=>554,1242=>708, -1243=>554,1244=>969,1245=>811,1246=>577,1247=>479,1248=>599,1249=>520,1250=>673,1251=>584,1252=>673, -1253=>584,1254=>708,1255=>550,1256=>708,1257=>550,1258=>708,1259=>550,1260=>628,1261=>494,1262=>548, -1263=>532,1264=>548,1265=>532,1266=>548,1267=>532,1268=>617,1269=>532,1270=>501,1271=>442,1272=>736, -1273=>710,1274=>607,1275=>500,1276=>616,1277=>532,1278=>616,1279=>532,1280=>617,1281=>530,1282=>905, -1283=>807,1284=>877,1285=>782,1286=>611,1287=>529,1288=>964,1289=>861,1290=>1001,1291=>870,1292=>697, -1293=>593,1294=>695,1295=>640,1296=>553,1297=>486,1298=>677,1299=>575,1300=>1076,1301=>896,1302=>810, -1303=>780,1304=>927,1305=>890,1306=>708,1307=>571,1308=>890,1309=>736,1312=>1002,1313=>848,1314=>1002, -1315=>854,1316=>713,1317=>614,1329=>780,1330=>659,1331=>794,1332=>794,1333=>659,1334=>579,1335=>613, -1336=>659,1337=>765,1338=>794,1339=>659,1340=>501,1341=>741,1342=>888,1343=>659,1344=>636,1345=>579, -1346=>794,1347=>699,1348=>794,1349=>659,1350=>756,1351=>659,1352=>659,1353=>659,1354=>711,1355=>579, -1356=>794,1357=>659,1358=>794,1359=>571,1360=>659,1361=>659,1362=>719,1363=>774,1364=>711,1365=>708, -1366=>571,1369=>276,1370=>286,1371=>450,1372=>450,1373=>352,1374=>474,1375=>450,1377=>876,1378=>570, -1379=>686,1380=>690,1381=>570,1382=>627,1383=>479,1384=>570,1385=>630,1386=>627,1387=>570,1388=>363, -1389=>804,1390=>576,1391=>570,1392=>570,1393=>571,1394=>631,1395=>570,1396=>593,1397=>250,1398=>684, -1399=>464,1400=>570,1401=>407,1402=>876,1403=>464,1404=>691,1405=>570,1406=>626,1407=>876,1408=>570, -1409=>571,1410=>451,1411=>876,1412=>583,1413=>550,1414=>566,1415=>686,1417=>303,1418=>390,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>325,1471=>0,1472=>265,1473=>0,1474=>0,1475=>265,1478=>410, -1479=>0,1488=>566,1489=>547,1490=>403,1491=>534,1492=>576,1493=>245,1494=>336,1495=>576,1496=>583, -1497=>245,1498=>532,1499=>500,1500=>539,1501=>576,1502=>593,1503=>245,1504=>397,1505=>629,1506=>506, -1507=>576,1508=>543,1509=>468,1510=>523,1511=>596,1512=>532,1513=>727,1514=>591,1520=>423,1521=>409, -1522=>423,1523=>374,1524=>580,3647=>586,3713=>603,3714=>615,3716=>619,3719=>434,3720=>565,3722=>615, -3725=>619,3732=>577,3733=>577,3734=>605,3735=>589,3737=>576,3738=>533,3739=>533,3740=>670,3741=>690, -3742=>618,3743=>618,3745=>631,3746=>619,3747=>615,3749=>584,3751=>569,3754=>633,3755=>737,3757=>569, -3758=>615,3759=>708,3760=>569,3761=>0,3762=>485,3763=>485,3764=>0,3765=>0,3766=>0,3767=>0, -3768=>0,3769=>0,3771=>0,3772=>0,3773=>597,3776=>324,3777=>611,3778=>414,3779=>492,3780=>442, -3782=>606,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>572,3793=>576,3794=>576, -3795=>603,3796=>563,3797=>563,3798=>633,3799=>603,3800=>606,3801=>609,3804=>925,3805=>925,4256=>756, -4257=>621,4258=>577,4259=>683,4260=>532,4261=>617,4262=>710,4263=>729,4264=>420,4265=>508,4266=>710, -4267=>713,4268=>526,4269=>753,4270=>675,4271=>620,4272=>729,4273=>526,4274=>526,4275=>753,4276=>753, -4277=>581,4278=>543,4279=>526,4280=>536,4281=>526,4282=>649,4283=>715,4284=>526,4285=>510,4286=>526, -4287=>602,4288=>719,4289=>488,4290=>598,4291=>488,4292=>508,4293=>606,4304=>457,4305=>457,4306=>479, -4307=>706,4308=>470,4309=>465,4310=>457,4311=>717,4312=>457,4313=>466,4314=>952,4315=>470,4316=>470, -4317=>704,4318=>466,4319=>470,4320=>713,4321=>470,4322=>590,4323=>471,4324=>709,4325=>470,4326=>704, -4327=>470,4328=>470,4329=>470,4330=>510,4331=>470,4332=>470,4333=>439,4334=>470,4335=>448,4336=>465, -4337=>504,4338=>457,4339=>457,4340=>457,4341=>507,4342=>741,4343=>536,4344=>470,4345=>498,4346=>498, -4347=>527,4348=>273,5121=>615,5122=>615,5123=>615,5124=>615,5125=>692,5126=>692,5127=>692,5129=>692, -5130=>692,5131=>692,5132=>751,5133=>751,5134=>751,5135=>751,5136=>751,5137=>751,5138=>870,5139=>906, -5140=>870,5141=>906,5142=>692,5143=>870,5144=>906,5145=>870,5146=>906,5147=>692,5149=>230,5150=>488, -5151=>381,5152=>381,5153=>350,5154=>350,5155=>354,5156=>350,5157=>419,5158=>347,5159=>230,5160=>350, -5161=>350,5162=>350,5163=>980,5164=>817,5165=>857,5166=>1005,5167=>615,5168=>615,5169=>615,5170=>615, -5171=>656,5172=>656,5173=>656,5175=>656,5176=>656,5177=>656,5178=>751,5179=>615,5180=>751,5181=>751, -5182=>751,5183=>751,5184=>870,5185=>906,5186=>870,5187=>906,5188=>870,5189=>906,5190=>870,5191=>906, -5192=>656,5193=>457,5194=>172,5196=>659,5197=>659,5198=>659,5199=>659,5200=>657,5201=>657,5202=>657, -5204=>657,5205=>657,5206=>657,5207=>829,5208=>800,5209=>829,5210=>800,5211=>829,5212=>800,5213=>835, -5214=>810,5215=>835,5216=>810,5217=>853,5218=>810,5219=>853,5220=>810,5221=>853,5222=>391,5223=>790, -5224=>790,5225=>779,5226=>801,5227=>565,5228=>565,5229=>565,5230=>565,5231=>565,5232=>565,5233=>565, -5234=>565,5235=>565,5236=>773,5237=>693,5238=>733,5239=>734,5240=>733,5241=>734,5242=>773,5243=>693, -5244=>773,5245=>693,5246=>733,5247=>734,5248=>733,5249=>734,5250=>733,5251=>366,5252=>366,5253=>675, -5254=>697,5255=>675,5256=>697,5257=>565,5258=>565,5259=>565,5260=>565,5261=>565,5262=>565,5263=>565, -5264=>565,5265=>565,5266=>773,5267=>693,5268=>733,5269=>734,5270=>733,5271=>734,5272=>773,5273=>693, -5274=>773,5275=>693,5276=>733,5277=>734,5278=>733,5279=>734,5280=>733,5281=>391,5282=>391,5283=>549, -5284=>501,5285=>501,5286=>501,5287=>549,5288=>549,5289=>549,5290=>501,5291=>501,5292=>674,5293=>691, -5294=>671,5295=>687,5296=>671,5297=>687,5298=>674,5299=>691,5300=>674,5301=>691,5302=>671,5303=>687, -5304=>671,5305=>687,5306=>671,5307=>347,5308=>457,5309=>347,5312=>766,5313=>766,5314=>766,5315=>766, -5316=>766,5317=>766,5318=>766,5319=>766,5320=>766,5321=>962,5322=>931,5323=>953,5324=>766,5325=>953, -5326=>766,5327=>766,5328=>540,5329=>407,5330=>540,5331=>766,5332=>766,5333=>766,5334=>766,5335=>766, -5336=>766,5337=>766,5338=>766,5339=>766,5340=>962,5341=>931,5342=>953,5343=>927,5344=>953,5345=>927, -5346=>962,5347=>931,5348=>962,5349=>931,5350=>975,5351=>927,5352=>975,5353=>927,5354=>540,5356=>656, -5357=>542,5358=>542,5359=>542,5360=>542,5361=>542,5362=>542,5363=>542,5364=>542,5365=>542,5366=>751, -5367=>678,5368=>712,5369=>694,5370=>712,5371=>694,5372=>751,5373=>678,5374=>751,5375=>678,5376=>712, -5377=>694,5378=>712,5379=>694,5380=>712,5381=>376,5382=>378,5383=>376,5392=>641,5393=>641,5394=>641, -5395=>802,5396=>802,5397=>802,5398=>802,5399=>818,5400=>785,5401=>818,5402=>785,5403=>818,5404=>785, -5405=>1026,5406=>989,5407=>1026,5408=>989,5409=>1026,5410=>989,5411=>1026,5412=>989,5413=>576,5414=>564, -5415=>564,5416=>564,5417=>564,5418=>564,5419=>564,5420=>564,5421=>564,5422=>564,5423=>760,5424=>703, -5425=>734,5426=>736,5427=>734,5428=>736,5429=>760,5430=>703,5431=>760,5432=>703,5433=>734,5434=>736, -5435=>734,5436=>736,5437=>734,5438=>376,5440=>350,5441=>436,5442=>824,5443=>824,5444=>776,5445=>824, -5446=>776,5447=>776,5448=>542,5449=>542,5450=>542,5451=>542,5452=>542,5453=>542,5454=>751,5455=>678, -5456=>376,5458=>656,5459=>615,5460=>615,5461=>615,5462=>615,5463=>653,5464=>653,5465=>653,5466=>653, -5467=>831,5468=>906,5469=>457,5470=>659,5471=>659,5472=>659,5473=>659,5474=>659,5475=>659,5476=>657, -5477=>657,5478=>657,5479=>657,5480=>853,5481=>810,5482=>457,5492=>747,5493=>747,5494=>747,5495=>747, -5496=>747,5497=>747,5498=>747,5499=>507,5500=>677,5501=>436,5502=>942,5503=>942,5504=>942,5505=>942, -5506=>942,5507=>942,5508=>942,5509=>743,5514=>747,5515=>747,5516=>747,5517=>747,5518=>1133,5519=>1133, -5520=>1133,5521=>901,5522=>901,5523=>1133,5524=>1133,5525=>629,5526=>965,5536=>766,5537=>766,5538=>719, -5539=>719,5540=>719,5541=>719,5542=>540,5543=>579,5544=>579,5545=>579,5546=>579,5547=>579,5548=>579, -5549=>579,5550=>376,5551=>565,5598=>693,5601=>693,5702=>421,5703=>421,5742=>399,5743=>942,5744=>1178, -5745=>1469,5746=>1469,5747=>1237,5748=>1237,5749=>1469,5750=>1469,7424=>532,7425=>646,7426=>883,7427=>527, -7428=>495,7429=>544,7430=>544,7431=>441,7432=>486,7433=>250,7434=>355,7435=>521,7436=>524,7437=>679, -7438=>584,7439=>550,7440=>495,7441=>615,7442=>615,7443=>615,7444=>920,7446=>550,7447=>550,7448=>472, -7449=>541,7450=>541,7451=>524,7452=>517,7453=>663,7454=>853,7455=>574,7456=>532,7457=>736,7458=>472, -7459=>473,7462=>524,7463=>532,7464=>507,7465=>472,7466=>531,7467=>575,7468=>387,7469=>552,7470=>389, -7472=>436,7473=>358,7474=>358,7475=>439,7476=>426,7477=>167,7478=>167,7479=>372,7480=>315,7481=>489, -7482=>424,7483=>424,7484=>446,7485=>396,7486=>342,7487=>394,7488=>346,7489=>415,7490=>560,7491=>352, -7492=>352,7493=>365,7494=>583,7495=>385,7496=>365,7497=>375,7498=>375,7499=>324,7500=>323,7501=>365, -7502=>161,7503=>383,7504=>561,7505=>368,7506=>372,7507=>333,7508=>372,7509=>372,7510=>385,7511=>265, -7512=>364,7513=>422,7514=>561,7515=>375,7517=>361,7518=>335,7519=>347,7520=>374,7521=>327,7522=>161, -7523=>233,7524=>364,7525=>375,7526=>361,7527=>335,7528=>370,7529=>374,7530=>327,7543=>571,7544=>426, -7547=>334,7557=>250,7579=>365,7580=>333,7581=>333,7582=>372,7583=>324,7584=>267,7585=>209,7586=>365, -7587=>364,7588=>235,7589=>224,7590=>234,7591=>235,7592=>211,7593=>224,7594=>211,7595=>338,7596=>561, -7597=>561,7598=>369,7599=>431,7600=>368,7601=>372,7602=>372,7603=>324,7604=>258,7605=>265,7606=>457, -7607=>376,7608=>325,7609=>365,7610=>375,7611=>330,7612=>393,7613=>330,7614=>353,7615=>372,7620=>0, -7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>615,7681=>551,7682=>617,7683=>571,7684=>617, -7685=>571,7686=>617,7687=>571,7688=>628,7689=>495,7690=>693,7691=>571,7692=>693,7693=>571,7694=>693, -7695=>571,7696=>693,7697=>571,7698=>693,7699=>571,7700=>568,7701=>554,7702=>568,7703=>554,7704=>568, -7705=>554,7706=>568,7707=>554,7708=>568,7709=>554,7710=>518,7711=>316,7712=>697,7713=>571,7714=>677, -7715=>570,7716=>677,7717=>570,7718=>677,7719=>570,7720=>677,7721=>570,7722=>677,7723=>570,7724=>265, -7725=>250,7726=>265,7727=>250,7728=>590,7729=>521,7730=>590,7731=>521,7732=>590,7733=>521,7734=>501, -7735=>250,7736=>501,7737=>250,7738=>501,7739=>250,7740=>501,7741=>250,7742=>776,7743=>876,7744=>776, -7745=>876,7746=>776,7747=>876,7748=>673,7749=>570,7750=>673,7751=>570,7752=>673,7753=>570,7754=>673, -7755=>570,7756=>708,7757=>550,7758=>708,7759=>550,7760=>708,7761=>550,7762=>708,7763=>550,7764=>542, -7765=>571,7766=>542,7767=>571,7768=>625,7769=>370,7770=>625,7771=>370,7772=>625,7773=>370,7774=>625, -7775=>370,7776=>571,7777=>469,7778=>571,7779=>469,7780=>571,7781=>469,7782=>571,7783=>469,7784=>571, -7785=>469,7786=>549,7787=>353,7788=>549,7789=>353,7790=>549,7791=>353,7792=>549,7793=>353,7794=>659, -7795=>570,7796=>659,7797=>570,7798=>659,7799=>570,7800=>659,7801=>570,7802=>659,7803=>570,7804=>615, -7805=>532,7806=>615,7807=>532,7808=>890,7809=>736,7810=>890,7811=>736,7812=>890,7813=>736,7814=>890, -7815=>736,7816=>890,7817=>736,7818=>616,7819=>532,7820=>616,7821=>532,7822=>549,7823=>532,7824=>616, -7825=>472,7826=>616,7827=>472,7828=>616,7829=>472,7830=>570,7831=>353,7832=>736,7833=>532,7834=>551, -7835=>316,7838=>691,7839=>550,7840=>615,7841=>551,7842=>615,7843=>551,7844=>615,7845=>551,7846=>615, -7847=>551,7848=>615,7849=>551,7850=>615,7851=>551,7852=>615,7853=>551,7854=>615,7855=>551,7856=>615, -7857=>551,7858=>615,7859=>551,7860=>615,7861=>551,7862=>615,7863=>551,7864=>568,7865=>554,7866=>568, -7867=>554,7868=>568,7869=>554,7870=>568,7871=>554,7872=>568,7873=>554,7874=>568,7875=>554,7876=>568, -7877=>554,7878=>568,7879=>554,7880=>265,7881=>250,7882=>265,7883=>250,7884=>708,7885=>550,7886=>708, -7887=>550,7888=>708,7889=>550,7890=>708,7891=>550,7892=>708,7893=>550,7894=>708,7895=>550,7896=>708, -7897=>550,7898=>822,7899=>550,7900=>822,7901=>550,7902=>822,7903=>550,7904=>822,7905=>550,7906=>822, -7907=>550,7908=>659,7909=>570,7910=>659,7911=>570,7912=>754,7913=>570,7914=>754,7915=>570,7916=>754, -7917=>570,7918=>754,7919=>570,7920=>754,7921=>570,7922=>549,7923=>532,7924=>549,7925=>532,7926=>549, -7927=>532,7928=>549,7929=>532,7936=>593,7937=>593,7938=>593,7939=>593,7940=>593,7941=>593,7942=>593, -7943=>593,7944=>615,7945=>615,7946=>790,7947=>790,7948=>692,7949=>721,7950=>637,7951=>668,7952=>486, -7953=>486,7954=>486,7955=>486,7956=>486,7957=>486,7960=>640,7961=>640,7962=>869,7963=>877,7964=>809, -7965=>835,7968=>570,7969=>570,7970=>570,7971=>570,7972=>570,7973=>570,7974=>570,7975=>570,7976=>753, -7977=>751,7978=>977,7979=>980,7980=>924,7981=>945,7982=>840,7983=>852,7984=>304,7985=>304,7986=>304, -7987=>304,7988=>304,7989=>304,7990=>304,7991=>304,7992=>342,7993=>336,7994=>571,7995=>571,7996=>513, -7997=>540,7998=>440,7999=>443,8000=>550,8001=>550,8002=>550,8003=>550,8004=>550,8005=>550,8008=>724, -8009=>763,8010=>985,8011=>989,8012=>844,8013=>873,8016=>521,8017=>521,8018=>521,8019=>521,8020=>521, -8021=>521,8022=>521,8023=>521,8025=>705,8027=>897,8029=>911,8031=>808,8032=>753,8033=>753,8034=>753, -8035=>753,8036=>753,8037=>753,8038=>753,8039=>753,8040=>722,8041=>759,8042=>980,8043=>985,8044=>851, -8045=>875,8046=>829,8047=>857,8048=>593,8049=>593,8050=>486,8051=>493,8052=>570,8053=>589,8054=>304, -8055=>304,8056=>550,8057=>550,8058=>521,8059=>521,8060=>753,8061=>753,8064=>593,8065=>593,8066=>593, -8067=>593,8068=>593,8069=>593,8070=>593,8071=>593,8072=>615,8073=>615,8074=>790,8075=>790,8076=>692, -8077=>721,8078=>637,8079=>668,8080=>570,8081=>570,8082=>570,8083=>570,8084=>570,8085=>570,8086=>570, -8087=>570,8088=>753,8089=>751,8090=>977,8091=>980,8092=>924,8093=>945,8094=>840,8095=>852,8096=>753, -8097=>753,8098=>753,8099=>753,8100=>753,8101=>753,8102=>753,8103=>753,8104=>722,8105=>759,8106=>980, -8107=>985,8108=>851,8109=>875,8110=>829,8111=>857,8112=>593,8113=>593,8114=>593,8115=>593,8116=>593, -8118=>593,8119=>593,8120=>615,8121=>615,8122=>645,8123=>623,8124=>615,8125=>450,8126=>450,8127=>450, -8128=>450,8129=>450,8130=>570,8131=>570,8132=>589,8134=>570,8135=>570,8136=>724,8137=>671,8138=>837, -8139=>784,8140=>677,8141=>450,8142=>450,8143=>450,8144=>304,8145=>304,8146=>304,8147=>304,8150=>304, -8151=>304,8152=>265,8153=>265,8154=>427,8155=>367,8157=>450,8158=>450,8159=>450,8160=>521,8161=>521, -8162=>521,8163=>521,8164=>571,8165=>571,8166=>521,8167=>521,8168=>549,8169=>549,8170=>760,8171=>742, -8172=>616,8173=>450,8174=>450,8175=>450,8178=>753,8179=>753,8180=>753,8182=>753,8183=>753,8184=>847, -8185=>731,8186=>830,8187=>743,8188=>688,8189=>450,8190=>450,8192=>450,8193=>900,8194=>450,8195=>900, -8196=>296,8197=>225,8198=>150,8199=>572,8200=>286,8201=>180,8202=>89,8203=>0,8204=>0,8205=>0, -8206=>0,8207=>0,8208=>325,8209=>325,8210=>572,8213=>900,8214=>450,8215=>450,8219=>286,8223=>466, -8227=>531,8228=>299,8229=>600,8231=>286,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>180, -8241=>1521,8242=>204,8243=>336,8244=>468,8245=>204,8246=>336,8247=>468,8248=>305,8251=>754,8252=>437, -8253=>478,8254=>450,8255=>723,8256=>723,8257=>225,8258=>900,8259=>450,8260=>150,8261=>351,8262=>351, -8263=>830,8264=>659,8265=>659,8266=>447,8267=>572,8268=>450,8269=>450,8270=>450,8271=>303,8272=>723, -8273=>450,8274=>404,8275=>900,8276=>723,8277=>754,8278=>527,8279=>597,8280=>754,8281=>754,8282=>286, -8283=>717,8284=>754,8285=>286,8286=>286,8287=>200,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0, -8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>360,8305=>161,8308=>360,8309=>360, -8310=>360,8311=>360,8312=>360,8313=>360,8314=>475,8315=>475,8316=>475,8317=>221,8318=>221,8319=>359, -8320=>360,8321=>360,8322=>360,8323=>360,8324=>360,8325=>360,8326=>360,8327=>360,8328=>360,8329=>360, -8330=>475,8331=>475,8332=>475,8333=>221,8334=>221,8336=>352,8337=>375,8338=>372,8339=>399,8340=>375, -8352=>789,8353=>572,8354=>572,8355=>572,8356=>572,8357=>876,8358=>673,8359=>1143,8360=>966,8361=>890, -8362=>754,8363=>572,8365=>590,8366=>549,8367=>1145,8368=>572,8369=>572,8370=>572,8371=>572,8372=>696, -8373=>577,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>873,8449=>873, -8450=>628,8451=>1011,8452=>807,8453=>872,8454=>929,8455=>553,8456=>628,8457=>856,8459=>889,8460=>679, -8461=>765,8462=>570,8463=>570,8464=>422,8465=>627,8466=>648,8467=>372,8468=>736,8469=>721,8470=>936, -8471=>900,8472=>627,8473=>631,8474=>708,8475=>718,8476=>732,8477=>712,8478=>807,8479=>615,8480=>917, -8481=>912,8483=>615,8484=>670,8485=>520,8486=>688,8487=>688,8488=>554,8489=>304,8490=>590,8491=>615, -8492=>708,8493=>633,8494=>769,8495=>532,8496=>545,8497=>708,8498=>518,8499=>962,8500=>416,8501=>670, -8502=>606,8503=>419,8504=>580,8505=>342,8506=>833,8507=>1041,8508=>632,8509=>655,8510=>589,8511=>764, -8512=>729,8513=>697,8514=>501,8515=>501,8516=>549,8517=>737,8518=>637,8519=>554,8520=>316,8521=>316, -8523=>702,8526=>474,8531=>872,8532=>872,8533=>872,8534=>872,8535=>872,8536=>872,8537=>872,8538=>872, -8539=>872,8540=>872,8541=>872,8542=>872,8543=>511,8544=>265,8545=>443,8546=>620,8547=>831,8548=>615, -8549=>830,8550=>1007,8551=>1185,8552=>826,8553=>616,8554=>839,8555=>1018,8556=>501,8557=>628,8558=>693, -8559=>776,8560=>250,8561=>412,8562=>573,8563=>730,8564=>532,8565=>729,8566=>892,8567=>1053,8568=>737, -8569=>532,8570=>740,8571=>901,8572=>250,8573=>495,8574=>571,8575=>876,8576=>1121,8577=>693,8578=>1121, -8579=>633,8580=>494,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754, -8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754, -8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754, -8620=>754,8621=>754,8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754, -8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754, -8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754, -8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754, -8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754, -8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754, -8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754, -8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754, -8700=>754,8701=>754,8702=>754,8703=>754,8704=>615,8705=>572,8706=>465,8707=>568,8708=>568,8709=>784, -8710=>602,8711=>602,8712=>784,8713=>784,8714=>646,8715=>784,8716=>784,8717=>646,8718=>572,8719=>681, -8720=>681,8721=>606,8722=>754,8723=>754,8724=>754,8725=>303,8726=>573,8727=>754,8728=>563,8729=>563, -8730=>573,8731=>573,8732=>573,8733=>643,8734=>750,8735=>754,8736=>807,8737=>807,8738=>754,8739=>450, -8740=>450,8741=>450,8742=>450,8743=>659,8744=>659,8745=>659,8746=>659,8747=>469,8748=>710,8749=>951, -8750=>469,8751=>710,8752=>951,8753=>469,8754=>469,8755=>469,8756=>572,8757=>572,8758=>234,8759=>572, -8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754,8766=>754,8767=>754,8768=>337,8769=>754, -8770=>754,8771=>754,8772=>754,8773=>754,8774=>754,8775=>754,8776=>754,8777=>754,8778=>754,8779=>754, -8780=>754,8781=>754,8782=>754,8783=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>900,8789=>900, -8790=>754,8791=>754,8792=>754,8793=>754,8794=>754,8795=>754,8796=>754,8797=>754,8798=>754,8799=>754, -8800=>754,8801=>754,8802=>754,8803=>754,8804=>754,8805=>754,8806=>754,8807=>754,8808=>754,8809=>754, -8810=>942,8811=>942,8812=>417,8813=>754,8814=>754,8815=>754,8816=>754,8817=>754,8818=>754,8819=>754, -8820=>754,8821=>754,8822=>754,8823=>754,8824=>754,8825=>754,8826=>754,8827=>754,8828=>754,8829=>754, -8830=>754,8831=>754,8832=>754,8833=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754, -8840=>754,8841=>754,8842=>754,8843=>754,8844=>659,8845=>659,8846=>659,8847=>754,8848=>754,8849=>754, -8850=>754,8851=>702,8852=>702,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754,8858=>754,8859=>754, -8860=>754,8861=>754,8862=>754,8863=>754,8864=>754,8865=>754,8866=>784,8867=>784,8868=>784,8869=>784, -8870=>468,8871=>468,8872=>784,8873=>784,8874=>784,8875=>784,8876=>784,8877=>784,8878=>784,8879=>784, -8880=>754,8881=>754,8882=>754,8883=>754,8884=>754,8885=>754,8886=>900,8887=>900,8888=>754,8889=>754, -8890=>468,8891=>659,8892=>659,8893=>659,8894=>754,8895=>754,8896=>738,8897=>738,8898=>738,8899=>738, -8900=>444,8901=>286,8902=>563,8903=>754,8904=>900,8905=>900,8906=>900,8907=>900,8908=>900,8909=>754, -8910=>659,8911=>659,8912=>754,8913=>754,8914=>754,8915=>754,8916=>754,8917=>754,8918=>754,8919=>754, -8920=>1280,8921=>1280,8922=>754,8923=>754,8924=>754,8925=>754,8926=>754,8927=>754,8928=>754,8929=>754, -8930=>754,8931=>754,8932=>754,8933=>754,8934=>754,8935=>754,8936=>754,8937=>754,8938=>754,8939=>754, -8940=>754,8941=>754,8942=>900,8943=>900,8944=>900,8945=>900,8946=>900,8947=>784,8948=>646,8949=>784, -8950=>784,8951=>646,8952=>784,8953=>784,8954=>900,8955=>784,8956=>646,8957=>784,8958=>646,8959=>784, -8960=>542,8961=>542,8962=>571,8963=>754,8964=>754,8965=>754,8966=>754,8967=>439,8968=>351,8969=>351, -8970=>351,8971=>351,8972=>728,8973=>728,8974=>728,8975=>728,8976=>754,8977=>461,8984=>900,8985=>754, -8988=>422,8989=>422,8990=>422,8991=>422,8992=>469,8993=>469,8996=>1037,8997=>1037,8998=>1272,8999=>1037, -9000=>1299,9003=>1272,9004=>786,9075=>304,9076=>571,9077=>753,9082=>593,9085=>681,9095=>1037,9108=>786, -9115=>450,9116=>450,9117=>450,9118=>450,9119=>450,9120=>450,9121=>450,9122=>450,9123=>450,9124=>450, -9125=>450,9126=>450,9127=>675,9128=>675,9129=>675,9130=>675,9131=>675,9132=>675,9133=>675,9134=>469, -9166=>754,9167=>850,9187=>786,9189=>692,9250=>571,9251=>571,9312=>807,9313=>807,9314=>807,9315=>807, -9316=>807,9317=>807,9318=>807,9319=>807,9320=>807,9321=>807,9472=>542,9473=>542,9474=>542,9475=>542, -9476=>542,9477=>542,9478=>542,9479=>542,9480=>542,9481=>542,9482=>542,9483=>542,9484=>542,9485=>542, -9486=>542,9487=>542,9488=>542,9489=>542,9490=>542,9491=>542,9492=>542,9493=>542,9494=>542,9495=>542, -9496=>542,9497=>542,9498=>542,9499=>542,9500=>542,9501=>542,9502=>542,9503=>542,9504=>542,9505=>542, -9506=>542,9507=>542,9508=>542,9509=>542,9510=>542,9511=>542,9512=>542,9513=>542,9514=>542,9515=>542, -9516=>542,9517=>542,9518=>542,9519=>542,9520=>542,9521=>542,9522=>542,9523=>542,9524=>542,9525=>542, -9526=>542,9527=>542,9528=>542,9529=>542,9530=>542,9531=>542,9532=>542,9533=>542,9534=>542,9535=>542, -9536=>542,9537=>542,9538=>542,9539=>542,9540=>542,9541=>542,9542=>542,9543=>542,9544=>542,9545=>542, -9546=>542,9547=>542,9548=>542,9549=>542,9550=>542,9551=>542,9552=>542,9553=>542,9554=>542,9555=>542, -9556=>542,9557=>542,9558=>542,9559=>542,9560=>542,9561=>542,9562=>542,9563=>542,9564=>542,9565=>542, -9566=>542,9567=>542,9568=>542,9569=>542,9570=>542,9571=>542,9572=>542,9573=>542,9574=>542,9575=>542, -9576=>542,9577=>542,9578=>542,9579=>542,9580=>542,9581=>542,9582=>542,9583=>542,9584=>542,9585=>542, -9586=>542,9587=>542,9588=>542,9589=>542,9590=>542,9591=>542,9592=>542,9593=>542,9594=>542,9595=>542, -9596=>542,9597=>542,9598=>542,9599=>542,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692, -9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692, -9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692, -9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850, -9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850, -9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692, -9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692, -9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785, -9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785, -9686=>474,9687=>474,9688=>712,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348, -9696=>692,9697=>692,9698=>692,9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850, -9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850, -9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659, -9726=>659,9727=>692,9728=>807,9729=>900,9730=>807,9731=>807,9732=>807,9733=>807,9734=>807,9735=>515, -9736=>806,9737=>807,9738=>799,9739=>799,9740=>604,9741=>911,9742=>1121,9743=>1125,9744=>807,9745=>807, -9746=>807,9747=>479,9748=>807,9749=>807,9750=>807,9751=>807,9752=>807,9753=>807,9754=>807,9755=>807, -9756=>807,9757=>548,9758=>807,9759=>548,9760=>807,9761=>807,9762=>807,9763=>807,9764=>602,9765=>671, -9766=>584,9767=>705,9768=>490,9769=>807,9770=>807,9771=>807,9772=>639,9773=>807,9774=>807,9775=>807, -9776=>800,9777=>800,9778=>800,9779=>800,9780=>800,9781=>800,9782=>800,9783=>800,9784=>807,9785=>807, -9786=>807,9787=>807,9788=>807,9789=>807,9790=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807, -9796=>807,9797=>807,9798=>807,9799=>807,9800=>807,9801=>807,9802=>807,9803=>807,9804=>807,9805=>807, -9806=>807,9807=>807,9808=>807,9809=>807,9810=>807,9811=>807,9812=>807,9813=>807,9814=>807,9815=>807, -9816=>807,9817=>807,9818=>807,9819=>807,9820=>807,9821=>807,9822=>807,9823=>807,9824=>807,9825=>807, -9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9832=>807,9833=>424,9834=>574,9835=>807, -9836=>807,9837=>424,9838=>321,9839=>435,9840=>673,9841=>689,9842=>807,9843=>807,9844=>807,9845=>807, -9846=>807,9847=>807,9848=>807,9849=>807,9850=>807,9851=>807,9852=>807,9853=>807,9854=>807,9855=>807, -9856=>782,9857=>782,9858=>782,9859=>782,9860=>782,9861=>782,9862=>800,9863=>800,9864=>800,9865=>800, -9866=>800,9867=>800,9868=>800,9869=>800,9870=>800,9871=>800,9872=>675,9873=>675,9874=>800,9875=>734, -9876=>644,9877=>483,9878=>766,9879=>800,9880=>615,9881=>800,9882=>637,9883=>800,9884=>800,9888=>800, -9889=>632,9890=>903,9891=>977,9892=>1028,9893=>811,9894=>754,9895=>754,9896=>754,9897=>754,9898=>754, -9899=>754,9900=>754,9901=>754,9902=>754,9903=>754,9904=>759,9905=>754,9906=>658,9907=>659,9908=>659, -9909=>659,9910=>765,9911=>659,9912=>659,9985=>754,9986=>754,9987=>754,9988=>754,9990=>754,9991=>754, -9992=>754,9993=>754,9996=>754,9997=>754,9998=>754,9999=>754,10000=>754,10001=>754,10002=>754,10003=>754, -10004=>754,10005=>754,10006=>754,10007=>754,10008=>754,10009=>754,10010=>754,10011=>754,10012=>754,10013=>754, -10014=>754,10015=>754,10016=>754,10017=>754,10018=>754,10019=>754,10020=>754,10021=>754,10022=>754,10023=>754, -10025=>754,10026=>754,10027=>754,10028=>754,10029=>754,10030=>754,10031=>754,10032=>754,10033=>754,10034=>754, -10035=>754,10036=>754,10037=>754,10038=>754,10039=>754,10040=>754,10041=>754,10042=>754,10043=>754,10044=>754, -10045=>754,10046=>754,10047=>754,10048=>754,10049=>754,10050=>754,10051=>754,10052=>754,10053=>754,10054=>754, -10055=>754,10056=>754,10057=>754,10058=>754,10059=>754,10061=>807,10063=>807,10064=>807,10065=>807,10066=>807, -10070=>807,10072=>754,10073=>754,10074=>754,10075=>290,10076=>290,10077=>484,10078=>484,10081=>754,10082=>754, -10083=>754,10084=>754,10085=>754,10086=>754,10087=>754,10088=>754,10089=>754,10090=>754,10091=>754,10092=>754, -10093=>754,10094=>754,10095=>754,10096=>754,10097=>754,10098=>754,10099=>754,10100=>754,10101=>754,10102=>807, -10103=>807,10104=>807,10105=>807,10106=>807,10107=>807,10108=>807,10109=>807,10110=>807,10111=>807,10112=>754, -10113=>754,10114=>754,10115=>754,10116=>754,10117=>754,10118=>754,10119=>754,10120=>754,10121=>754,10122=>754, -10123=>754,10124=>754,10125=>754,10126=>754,10127=>754,10128=>754,10129=>754,10130=>754,10131=>754,10132=>754, -10136=>754,10137=>754,10138=>754,10139=>754,10140=>754,10141=>754,10142=>754,10143=>754,10144=>754,10145=>754, -10146=>754,10147=>754,10148=>754,10149=>754,10150=>754,10151=>754,10152=>754,10153=>754,10154=>754,10155=>754, -10156=>754,10157=>754,10158=>754,10159=>754,10161=>754,10162=>754,10163=>754,10164=>754,10165=>754,10166=>754, -10167=>754,10168=>754,10169=>754,10170=>754,10171=>754,10172=>754,10173=>754,10174=>754,10181=>351,10182=>351, -10208=>444,10214=>445,10215=>445,10216=>351,10217=>351,10218=>500,10219=>500,10224=>754,10225=>754,10226=>754, -10227=>754,10228=>1042,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290, -10237=>1290,10238=>1290,10239=>1290,10240=>659,10241=>659,10242=>659,10243=>659,10244=>659,10245=>659,10246=>659, -10247=>659,10248=>659,10249=>659,10250=>659,10251=>659,10252=>659,10253=>659,10254=>659,10255=>659,10256=>659, -10257=>659,10258=>659,10259=>659,10260=>659,10261=>659,10262=>659,10263=>659,10264=>659,10265=>659,10266=>659, -10267=>659,10268=>659,10269=>659,10270=>659,10271=>659,10272=>659,10273=>659,10274=>659,10275=>659,10276=>659, -10277=>659,10278=>659,10279=>659,10280=>659,10281=>659,10282=>659,10283=>659,10284=>659,10285=>659,10286=>659, -10287=>659,10288=>659,10289=>659,10290=>659,10291=>659,10292=>659,10293=>659,10294=>659,10295=>659,10296=>659, -10297=>659,10298=>659,10299=>659,10300=>659,10301=>659,10302=>659,10303=>659,10304=>659,10305=>659,10306=>659, -10307=>659,10308=>659,10309=>659,10310=>659,10311=>659,10312=>659,10313=>659,10314=>659,10315=>659,10316=>659, -10317=>659,10318=>659,10319=>659,10320=>659,10321=>659,10322=>659,10323=>659,10324=>659,10325=>659,10326=>659, -10327=>659,10328=>659,10329=>659,10330=>659,10331=>659,10332=>659,10333=>659,10334=>659,10335=>659,10336=>659, -10337=>659,10338=>659,10339=>659,10340=>659,10341=>659,10342=>659,10343=>659,10344=>659,10345=>659,10346=>659, -10347=>659,10348=>659,10349=>659,10350=>659,10351=>659,10352=>659,10353=>659,10354=>659,10355=>659,10356=>659, -10357=>659,10358=>659,10359=>659,10360=>659,10361=>659,10362=>659,10363=>659,10364=>659,10365=>659,10366=>659, -10367=>659,10368=>659,10369=>659,10370=>659,10371=>659,10372=>659,10373=>659,10374=>659,10375=>659,10376=>659, -10377=>659,10378=>659,10379=>659,10380=>659,10381=>659,10382=>659,10383=>659,10384=>659,10385=>659,10386=>659, -10387=>659,10388=>659,10389=>659,10390=>659,10391=>659,10392=>659,10393=>659,10394=>659,10395=>659,10396=>659, -10397=>659,10398=>659,10399=>659,10400=>659,10401=>659,10402=>659,10403=>659,10404=>659,10405=>659,10406=>659, -10407=>659,10408=>659,10409=>659,10410=>659,10411=>659,10412=>659,10413=>659,10414=>659,10415=>659,10416=>659, -10417=>659,10418=>659,10419=>659,10420=>659,10421=>659,10422=>659,10423=>659,10424=>659,10425=>659,10426=>659, -10427=>659,10428=>659,10429=>659,10430=>659,10431=>659,10432=>659,10433=>659,10434=>659,10435=>659,10436=>659, -10437=>659,10438=>659,10439=>659,10440=>659,10441=>659,10442=>659,10443=>659,10444=>659,10445=>659,10446=>659, -10447=>659,10448=>659,10449=>659,10450=>659,10451=>659,10452=>659,10453=>659,10454=>659,10455=>659,10456=>659, -10457=>659,10458=>659,10459=>659,10460=>659,10461=>659,10462=>659,10463=>659,10464=>659,10465=>659,10466=>659, -10467=>659,10468=>659,10469=>659,10470=>659,10471=>659,10472=>659,10473=>659,10474=>659,10475=>659,10476=>659, -10477=>659,10478=>659,10479=>659,10480=>659,10481=>659,10482=>659,10483=>659,10484=>659,10485=>659,10486=>659, -10487=>659,10488=>659,10489=>659,10490=>659,10491=>659,10492=>659,10493=>659,10494=>659,10495=>659,10502=>754, -10503=>754,10506=>754,10507=>754,10560=>615,10561=>615,10627=>660,10628=>660,10702=>754,10703=>900,10704=>900, -10705=>900,10706=>900,10707=>900,10708=>900,10709=>900,10731=>444,10746=>754,10747=>754,10752=>900,10753=>900, -10754=>900,10764=>1192,10765=>469,10766=>469,10767=>469,10768=>469,10769=>469,10770=>469,10771=>469,10772=>469, -10773=>469,10774=>469,10775=>469,10776=>469,10777=>469,10778=>469,10779=>469,10780=>469,10799=>754,10877=>754, -10878=>754,10879=>754,10880=>754,10881=>754,10882=>754,10883=>754,10884=>754,10885=>754,10886=>754,10887=>754, -10888=>754,10889=>754,10890=>754,10891=>754,10892=>754,10893=>754,10894=>754,10895=>754,10896=>754,10897=>754, -10898=>754,10899=>754,10900=>754,10901=>754,10902=>754,10903=>754,10904=>754,10905=>754,10906=>754,10907=>754, -10908=>754,10909=>754,10910=>754,10911=>754,10912=>754,10926=>754,10927=>754,10928=>754,10929=>754,10930=>754, -10931=>754,10932=>754,10933=>754,10934=>754,10935=>754,10936=>754,10937=>754,10938=>754,11001=>754,11002=>754, -11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754, -11018=>754,11019=>754,11020=>754,11021=>754,11022=>752,11023=>752,11024=>752,11025=>752,11026=>850,11027=>850, -11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11039=>782,11040=>782,11041=>786, -11042=>786,11043=>786,11044=>1007,11091=>782,11092=>782,11360=>501,11361=>250,11362=>501,11363=>542,11364=>625, -11365=>551,11366=>353,11367=>677,11368=>570,11369=>590,11370=>521,11371=>616,11372=>472,11373=>703,11374=>776, -11375=>615,11377=>661,11378=>1015,11379=>865,11380=>532,11381=>589,11382=>511,11383=>593,11385=>373,11386=>550, -11387=>441,11388=>157,11389=>387,11800=>478,11810=>351,11811=>351,11812=>351,11813=>351,11822=>478,19904=>807, -19905=>807,19906=>807,19907=>807,19908=>807,19909=>807,19910=>807,19911=>807,19912=>807,19913=>807,19914=>807, -19915=>807,19916=>807,19917=>807,19918=>807,19919=>807,19920=>807,19921=>807,19922=>807,19923=>807,19924=>807, -19925=>807,19926=>807,19927=>807,19928=>807,19929=>807,19930=>807,19931=>807,19932=>807,19933=>807,19934=>807, -19935=>807,19936=>807,19937=>807,19938=>807,19939=>807,19940=>807,19941=>807,19942=>807,19943=>807,19944=>807, -19945=>807,19946=>807,19947=>807,19948=>807,19949=>807,19950=>807,19951=>807,19952=>807,19953=>807,19954=>807, -19955=>807,19956=>807,19957=>807,19958=>807,19959=>807,19960=>807,19961=>807,19962=>807,19963=>807,19964=>807, -19965=>807,19966=>807,19967=>807,42564=>571,42565=>469,42566=>318,42567=>304,42572=>1062,42573=>925,42576=>926, -42577=>815,42580=>971,42581=>757,42582=>886,42583=>762,42594=>922,42595=>833,42596=>912,42597=>810,42598=>776, -42599=>907,42600=>708,42601=>550,42602=>770,42603=>641,42604=>1222,42605=>917,42606=>791,42634=>725,42635=>649, -42636=>549,42637=>524,42644=>617,42645=>570,42760=>444,42761=>444,42762=>444,42763=>444,42764=>444,42765=>444, -42766=>444,42767=>444,42768=>444,42769=>444,42770=>444,42771=>444,42772=>444,42773=>444,42774=>444,42779=>332, -42780=>332,42781=>227,42782=>227,42783=>227,42790=>677,42791=>570,42792=>790,42793=>638,42794=>553,42795=>486, -42800=>441,42801=>469,42802=>1125,42803=>886,42804=>1097,42805=>900,42806=>1039,42807=>896,42808=>874,42809=>736, -42810=>874,42811=>736,42812=>863,42813=>736,42814=>628,42815=>494,42822=>612,42823=>353,42824=>523,42825=>384, -42826=>726,42827=>633,42830=>1222,42831=>917,42880=>501,42881=>250,42882=>662,42883=>570,42889=>303,42890=>338, -42891=>360,42892=>247,43003=>518,43004=>542,43005=>776,43006=>265,43007=>1079,63173=>550,64256=>649,64257=>581, -64258=>581,64259=>899,64260=>899,64261=>617,64262=>774,64275=>1081,64276=>1081,64277=>1076,64278=>1067,64279=>1376, -64285=>245,64286=>0,64287=>423,64288=>572,64289=>770,64290=>696,64291=>815,64292=>694,64293=>759,64294=>769, -64295=>726,64296=>788,64297=>754,64298=>727,64299=>727,64300=>727,64301=>727,64302=>566,64303=>566,64304=>566, -64305=>547,64306=>403,64307=>534,64308=>576,64309=>245,64310=>336,64311=>900,64312=>583,64313=>302,64314=>532, -64315=>500,64316=>539,64318=>593,64320=>397,64321=>629,64323=>576,64324=>543,64326=>523,64327=>596,64328=>532, -64329=>727,64330=>591,64331=>245,64332=>547,64333=>500,64334=>543,64335=>566,65024=>0,65025=>0,65026=>0, -65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0, -65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65529=>0,65530=>0,65531=>0, -65532=>0,65533=>923); -$enc=''; -$diff=''; -$file='dejavusanscondensedi.z'; -$ctg='dejavusanscondensedi.ctg.z'; -$originalsize=488440; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.z deleted file mode 100644 index cf9052bff3..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusanscondensedi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.ctg.z deleted file mode 100644 index ac628b3e0d..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.php deleted file mode 100644 index 721eab7b0e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.php +++ /dev/null @@ -1,471 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSans-Oblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-43,'Flags'=>96,'FontBBox'=>'[-1016 -350 1659 1068]','ItalicAngle'=>-11,'StemV'=>70,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>318,33=>401,34=>460,35=>838,36=>636,37=>950,38=>780,39=>275,40=>390, -41=>390,42=>500,43=>838,44=>318,45=>361,46=>318,47=>337,48=>636,49=>636,50=>636, -51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838, -61=>838,62=>838,63=>531,64=>1000,65=>684,66=>686,67=>698,68=>770,69=>632,70=>575, -71=>775,72=>752,73=>295,74=>295,75=>656,76=>557,77=>863,78=>748,79=>787,80=>603, -81=>787,82=>695,83=>635,84=>611,85=>732,86=>684,87=>989,88=>685,89=>611,90=>685, -91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>613,98=>635,99=>550,100=>635, -101=>615,102=>352,103=>635,104=>634,105=>278,106=>278,107=>579,108=>278,109=>974,110=>634, -111=>612,112=>635,113=>635,114=>411,115=>521,116=>392,117=>634,118=>592,119=>818,120=>592, -121=>592,122=>525,123=>636,124=>337,125=>636,126=>838,8364=>636,8218=>318,402=>352,8222=>518, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1350,352=>635,8249=>400,338=>1070,381=>685,8216=>318, -8217=>318,8220=>518,8221=>518,8226=>590,8211=>500,8212=>1000,732=>500,8482=>1000,353=>521,8250=>400, -339=>1028,382=>525,376=>611,160=>318,161=>401,162=>636,163=>636,164=>636,165=>636,166=>337, -167=>500,168=>500,169=>1000,170=>471,171=>617,172=>838,173=>361,174=>1000,175=>500,176=>500, -177=>838,178=>401,179=>401,180=>500,181=>636,182=>636,183=>318,184=>500,185=>401,186=>471, -187=>617,188=>969,189=>969,190=>969,191=>531,192=>684,193=>684,194=>684,195=>684,196=>684, -197=>684,198=>974,199=>698,200=>632,201=>632,202=>632,203=>632,204=>295,205=>295,206=>295, -207=>295,208=>775,209=>748,210=>787,211=>787,212=>787,213=>787,214=>787,215=>838,216=>787, -217=>732,218=>732,219=>732,220=>732,221=>611,222=>608,223=>630,224=>613,225=>613,226=>613, -227=>613,228=>613,229=>613,230=>995,231=>550,232=>615,233=>615,234=>615,235=>615,236=>278, -237=>278,238=>278,239=>278,240=>612,241=>634,242=>612,243=>612,244=>612,245=>612,246=>612, -247=>838,248=>612,249=>634,250=>634,251=>634,252=>634,253=>592,254=>635,255=>592,256=>684, -257=>613,258=>684,259=>613,260=>684,261=>613,262=>698,263=>550,264=>698,265=>550,266=>698, -267=>550,268=>698,269=>550,270=>770,271=>635,272=>775,273=>635,274=>632,275=>615,276=>632, -277=>615,278=>632,279=>615,280=>632,281=>615,282=>632,283=>615,284=>775,285=>635,286=>775, -287=>635,288=>775,289=>635,290=>775,291=>635,292=>752,293=>634,294=>916,295=>695,296=>295, -297=>278,298=>295,299=>278,300=>295,301=>278,302=>295,303=>278,304=>295,305=>278,306=>590, -307=>556,308=>295,309=>278,310=>656,311=>579,312=>579,313=>557,314=>278,315=>557,316=>278, -317=>557,318=>278,319=>557,320=>278,321=>562,322=>287,323=>748,324=>634,325=>748,326=>634, -327=>748,328=>634,329=>813,330=>748,331=>634,332=>787,333=>612,334=>787,335=>612,336=>787, -337=>612,340=>695,341=>411,342=>695,343=>411,344=>695,345=>411,346=>635,347=>521,348=>635, -349=>521,350=>635,351=>521,354=>611,355=>392,356=>611,357=>392,358=>611,359=>392,360=>732, -361=>634,362=>732,363=>634,364=>732,365=>634,366=>732,367=>634,368=>732,369=>634,370=>732, -371=>634,372=>989,373=>818,374=>611,375=>592,377=>685,378=>525,379=>685,380=>525,383=>352, -384=>635,385=>735,386=>686,387=>635,388=>686,389=>635,390=>703,391=>698,392=>550,393=>775, -394=>819,395=>686,396=>635,397=>612,398=>632,399=>787,400=>614,401=>575,403=>775,404=>687, -405=>984,406=>354,407=>295,408=>746,409=>579,410=>278,411=>592,412=>974,413=>748,414=>634, -415=>787,416=>913,417=>612,418=>938,419=>737,420=>652,421=>635,422=>695,423=>635,424=>521, -425=>632,426=>336,427=>392,428=>611,429=>392,430=>611,431=>838,432=>634,433=>764,434=>721, -435=>744,436=>730,437=>685,438=>525,439=>666,440=>666,441=>578,442=>525,443=>636,444=>666, -445=>578,446=>510,447=>635,448=>295,449=>492,450=>459,451=>295,452=>1455,453=>1295,454=>1160, -455=>852,456=>835,457=>556,458=>1043,459=>1026,460=>912,461=>684,462=>613,463=>295,464=>278, -465=>787,466=>612,467=>732,468=>634,469=>732,470=>634,471=>732,472=>634,473=>732,474=>634, -475=>732,476=>634,477=>615,478=>684,479=>613,480=>684,481=>613,482=>974,483=>995,484=>775, -485=>635,486=>775,487=>635,488=>656,489=>579,490=>787,491=>612,492=>787,493=>612,494=>666, -495=>525,496=>278,497=>1455,498=>1295,499=>1160,500=>775,501=>635,502=>1113,503=>682,504=>748, -505=>634,506=>684,507=>613,508=>974,509=>995,510=>787,511=>612,512=>684,513=>613,514=>684, -515=>613,516=>632,517=>615,518=>632,519=>615,520=>295,521=>278,522=>295,523=>278,524=>787, -525=>612,526=>787,527=>612,528=>695,529=>411,530=>695,531=>411,532=>732,533=>634,534=>732, -535=>634,536=>635,537=>521,538=>611,539=>392,540=>627,541=>521,542=>752,543=>634,544=>735, -545=>838,546=>698,547=>610,548=>685,549=>525,550=>684,551=>613,552=>632,553=>615,554=>787, -555=>612,556=>787,557=>612,558=>787,559=>612,560=>787,561=>612,562=>611,563=>592,564=>475, -565=>843,566=>477,567=>278,568=>998,569=>998,570=>684,571=>698,572=>550,573=>557,574=>611, -575=>521,576=>525,577=>603,578=>479,579=>686,580=>732,581=>684,582=>632,583=>615,584=>295, -585=>278,586=>781,587=>635,588=>695,589=>411,590=>611,591=>592,592=>613,593=>635,594=>635, -595=>635,596=>550,597=>550,598=>635,599=>727,600=>615,601=>615,602=>844,603=>545,604=>545, -605=>775,606=>664,607=>326,608=>696,609=>635,610=>629,611=>596,612=>596,613=>634,614=>634, -615=>634,616=>372,617=>387,618=>372,619=>396,620=>487,621=>278,622=>706,623=>974,624=>974, -625=>974,626=>646,627=>642,628=>634,629=>612,630=>858,631=>728,632=>660,633=>469,634=>469, -635=>469,636=>469,637=>469,638=>530,639=>530,640=>602,641=>602,642=>521,643=>336,644=>336, -645=>461,646=>336,647=>392,648=>392,649=>634,650=>618,651=>598,652=>592,653=>818,654=>592, -655=>611,656=>525,657=>525,658=>578,659=>578,660=>510,661=>510,662=>510,663=>510,664=>787, -665=>580,666=>664,667=>708,668=>654,669=>292,670=>667,671=>507,672=>727,673=>510,674=>510, -675=>1014,676=>1058,677=>1013,678=>824,679=>610,680=>778,681=>848,682=>641,683=>654,684=>515, -685=>515,686=>570,687=>664,688=>399,689=>399,690=>175,691=>259,692=>295,693=>296,694=>379, -695=>515,696=>373,697=>278,698=>460,699=>318,700=>318,701=>318,702=>307,703=>307,704=>370, -705=>370,706=>500,707=>500,708=>500,709=>500,711=>500,712=>275,713=>500,714=>500,715=>500, -716=>275,717=>500,718=>500,719=>500,720=>337,721=>337,722=>307,723=>307,724=>500,725=>500, -726=>390,727=>317,728=>500,729=>500,730=>500,731=>500,733=>500,734=>315,735=>500,736=>426, -737=>166,738=>373,739=>444,740=>370,741=>493,742=>493,743=>493,744=>493,745=>493,748=>500, -749=>500,750=>518,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0, -774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0, -784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0, -794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0, -844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0, -860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>654,881=>568,882=>862, -883=>647,884=>278,885=>278,886=>748,887=>650,890=>500,891=>549,892=>550,893=>549,894=>337, -900=>500,901=>500,902=>684,903=>318,904=>767,905=>903,906=>435,908=>839,910=>860,911=>905, -912=>338,913=>684,914=>686,915=>557,916=>684,917=>632,918=>685,919=>752,920=>787,921=>295, -922=>656,923=>684,924=>863,925=>748,926=>632,927=>787,928=>752,929=>603,931=>632,932=>611, -933=>611,934=>787,935=>685,936=>787,937=>764,938=>295,939=>611,940=>659,941=>541,942=>634, -943=>338,944=>579,945=>659,946=>638,947=>592,948=>612,949=>541,950=>544,951=>634,952=>612, -953=>338,954=>589,955=>592,956=>636,957=>559,958=>558,959=>612,960=>602,961=>635,962=>587, -963=>634,964=>602,965=>579,966=>660,967=>592,968=>660,969=>837,970=>338,971=>579,972=>612, -973=>579,974=>837,975=>656,976=>614,977=>619,978=>699,979=>842,980=>699,981=>660,982=>837, -983=>664,984=>787,985=>612,986=>648,987=>587,988=>575,989=>458,990=>660,991=>660,992=>865, -993=>627,994=>934,995=>837,996=>758,997=>659,998=>792,999=>615,1000=>687,1001=>607,1002=>768, -1003=>625,1004=>699,1005=>612,1006=>611,1007=>536,1008=>664,1009=>635,1010=>550,1011=>278,1012=>787, -1013=>615,1014=>615,1015=>608,1016=>635,1017=>698,1018=>863,1019=>651,1020=>635,1021=>703,1022=>698, -1023=>703,1024=>632,1025=>632,1026=>786,1027=>557,1028=>698,1029=>635,1030=>295,1031=>295,1032=>295, -1033=>1094,1034=>1045,1035=>786,1036=>710,1037=>748,1038=>609,1039=>752,1040=>684,1041=>686,1042=>686, -1043=>557,1044=>781,1045=>632,1046=>1077,1047=>641,1048=>748,1049=>748,1050=>710,1051=>752,1052=>863, -1053=>752,1054=>787,1055=>752,1056=>603,1057=>698,1058=>611,1059=>609,1060=>861,1061=>685,1062=>776, -1063=>686,1064=>1069,1065=>1094,1066=>833,1067=>818,1068=>686,1069=>698,1070=>1080,1071=>695,1072=>613, -1073=>617,1074=>589,1075=>525,1076=>691,1077=>615,1078=>901,1079=>532,1080=>650,1081=>650,1082=>604, -1083=>639,1084=>754,1085=>654,1086=>612,1087=>654,1088=>635,1089=>550,1090=>583,1091=>592,1092=>855, -1093=>592,1094=>681,1095=>591,1096=>915,1097=>942,1098=>707,1099=>790,1100=>589,1101=>549,1102=>842, -1103=>602,1104=>615,1105=>615,1106=>625,1107=>525,1108=>549,1109=>521,1110=>278,1111=>278,1112=>278, -1113=>902,1114=>898,1115=>652,1116=>604,1117=>650,1118=>592,1119=>654,1120=>934,1121=>837,1122=>771, -1123=>672,1124=>942,1125=>749,1126=>879,1127=>783,1128=>1160,1129=>1001,1130=>787,1131=>612,1132=>1027, -1133=>824,1134=>636,1135=>541,1136=>856,1137=>876,1138=>787,1139=>612,1140=>781,1141=>665,1142=>781, -1143=>665,1144=>992,1145=>904,1146=>953,1147=>758,1148=>1180,1149=>1028,1150=>934,1151=>837,1152=>698, -1153=>550,1154=>502,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>748, -1163=>657,1164=>686,1165=>589,1166=>603,1167=>635,1168=>610,1169=>525,1170=>675,1171=>556,1172=>557, -1173=>491,1174=>1077,1175=>901,1176=>641,1177=>532,1178=>710,1179=>604,1180=>710,1181=>604,1182=>710, -1183=>604,1184=>856,1185=>832,1186=>752,1187=>661,1188=>1014,1189=>877,1190=>1113,1191=>950,1192=>890, -1193=>707,1194=>698,1195=>550,1196=>611,1197=>529,1198=>611,1199=>592,1200=>611,1201=>592,1202=>685, -1203=>592,1204=>934,1205=>807,1206=>686,1207=>591,1208=>686,1209=>591,1210=>686,1211=>634,1212=>929, -1213=>731,1214=>929,1215=>731,1216=>295,1217=>1077,1218=>901,1219=>655,1220=>604,1221=>752,1222=>639, -1223=>752,1224=>661,1225=>752,1226=>661,1227=>686,1228=>591,1229=>863,1230=>754,1231=>278,1232=>684, -1233=>613,1234=>684,1235=>613,1236=>974,1237=>995,1238=>632,1239=>615,1240=>787,1241=>615,1242=>787, -1243=>615,1244=>1077,1245=>901,1246=>641,1247=>532,1248=>666,1249=>578,1250=>748,1251=>650,1252=>748, -1253=>650,1254=>787,1255=>612,1256=>787,1257=>612,1258=>787,1259=>612,1260=>698,1261=>549,1262=>609, -1263=>592,1264=>609,1265=>592,1266=>609,1267=>592,1268=>686,1269=>591,1270=>557,1271=>491,1272=>818, -1273=>790,1274=>675,1275=>556,1276=>685,1277=>592,1278=>685,1279=>592,1280=>686,1281=>589,1282=>1006, -1283=>897,1284=>975,1285=>869,1286=>679,1287=>588,1288=>1072,1289=>957,1290=>1113,1291=>967,1292=>775, -1293=>660,1294=>773,1295=>711,1296=>614,1297=>541,1298=>752,1299=>639,1300=>1195,1301=>997,1302=>900, -1303=>867,1304=>1031,1305=>989,1306=>787,1307=>635,1308=>989,1309=>818,1312=>1113,1313=>942,1314=>1113, -1315=>949,1316=>793,1317=>683,1329=>867,1330=>732,1331=>882,1332=>882,1333=>732,1334=>644,1335=>682, -1336=>732,1337=>851,1338=>882,1339=>732,1340=>557,1341=>824,1342=>986,1343=>732,1344=>707,1345=>644, -1346=>882,1347=>777,1348=>882,1349=>732,1350=>840,1351=>732,1352=>732,1353=>732,1354=>791,1355=>644, -1356=>882,1357=>732,1358=>882,1359=>635,1360=>732,1361=>732,1362=>799,1363=>861,1364=>790,1365=>787, -1366=>635,1369=>307,1370=>318,1371=>500,1372=>500,1373=>392,1374=>526,1375=>500,1377=>974,1378=>634, -1379=>762,1380=>767,1381=>634,1382=>697,1383=>533,1384=>634,1385=>700,1386=>697,1387=>634,1388=>404, -1389=>894,1390=>641,1391=>634,1392=>634,1393=>635,1394=>702,1395=>634,1396=>659,1397=>278,1398=>760, -1399=>516,1400=>634,1401=>453,1402=>974,1403=>516,1404=>769,1405=>634,1406=>696,1407=>974,1408=>634, -1409=>635,1410=>501,1411=>974,1412=>648,1413=>612,1414=>629,1415=>763,1417=>337,1418=>433,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>361,1471=>0,1472=>295,1473=>0,1474=>0,1475=>295,1478=>456, -1479=>0,1488=>629,1489=>608,1490=>448,1491=>594,1492=>640,1493=>272,1494=>374,1495=>640,1496=>648, -1497=>272,1498=>592,1499=>556,1500=>599,1501=>640,1502=>659,1503=>272,1504=>441,1505=>700,1506=>563, -1507=>640,1508=>604,1509=>521,1510=>581,1511=>663,1512=>592,1513=>808,1514=>657,1520=>471,1521=>454, -1522=>471,1523=>416,1524=>645,3647=>652,3713=>670,3714=>684,3716=>688,3719=>482,3720=>628,3722=>684, -3725=>688,3732=>642,3733=>642,3734=>672,3735=>655,3737=>641,3738=>592,3739=>592,3740=>745,3741=>767, -3742=>687,3743=>687,3745=>702,3746=>688,3747=>684,3749=>649,3751=>632,3754=>703,3755=>819,3757=>633, -3758=>684,3759=>788,3760=>632,3761=>0,3762=>539,3763=>539,3764=>0,3765=>0,3766=>0,3767=>0, -3768=>0,3769=>0,3771=>0,3772=>0,3773=>663,3776=>360,3777=>679,3778=>460,3779=>547,3780=>491, -3782=>674,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>636,3793=>641,3794=>641, -3795=>670,3796=>625,3797=>625,3798=>703,3799=>670,3800=>674,3801=>677,3804=>1028,3805=>1028,4256=>840, -4257=>690,4258=>642,4259=>759,4260=>591,4261=>686,4262=>789,4263=>811,4264=>467,4265=>565,4266=>789, -4267=>793,4268=>584,4269=>837,4270=>750,4271=>688,4272=>811,4273=>584,4274=>584,4275=>837,4276=>837, -4277=>646,4278=>604,4279=>584,4280=>596,4281=>584,4282=>721,4283=>795,4284=>584,4285=>566,4286=>584, -4287=>669,4288=>799,4289=>542,4290=>664,4291=>542,4292=>565,4293=>674,4304=>508,4305=>508,4306=>533, -4307=>785,4308=>522,4309=>517,4310=>508,4311=>797,4312=>507,4313=>518,4314=>1058,4315=>522,4316=>523, -4317=>783,4318=>518,4319=>523,4320=>792,4321=>523,4322=>656,4323=>524,4324=>788,4325=>523,4326=>782, -4327=>523,4328=>522,4329=>522,4330=>566,4331=>523,4332=>523,4333=>489,4334=>522,4335=>498,4336=>517, -4337=>560,4338=>508,4339=>508,4340=>508,4341=>563,4342=>824,4343=>595,4344=>522,4345=>554,4346=>553, -4347=>586,4348=>304,5121=>684,5122=>684,5123=>684,5124=>684,5125=>769,5126=>769,5127=>769,5129=>769, -5130=>769,5131=>769,5132=>835,5133=>834,5134=>835,5135=>834,5136=>835,5137=>834,5138=>967,5139=>1007, -5140=>967,5141=>1007,5142=>769,5143=>967,5144=>1007,5145=>967,5146=>1007,5147=>769,5149=>256,5150=>543, -5151=>423,5152=>423,5153=>389,5154=>389,5155=>393,5156=>389,5157=>466,5158=>385,5159=>256,5160=>389, -5161=>389,5162=>389,5163=>1090,5164=>909,5165=>953,5166=>1117,5167=>684,5168=>684,5169=>684,5170=>684, -5171=>729,5172=>729,5173=>729,5175=>729,5176=>729,5177=>729,5178=>835,5179=>684,5180=>835,5181=>834, -5182=>835,5183=>834,5184=>967,5185=>1007,5186=>967,5187=>1007,5188=>967,5189=>1007,5190=>967,5191=>1007, -5192=>729,5193=>508,5194=>192,5196=>732,5197=>732,5198=>732,5199=>732,5200=>730,5201=>730,5202=>730, -5204=>730,5205=>730,5206=>730,5207=>921,5208=>889,5209=>921,5210=>889,5211=>921,5212=>889,5213=>928, -5214=>900,5215=>928,5216=>900,5217=>947,5218=>900,5219=>947,5220=>900,5221=>947,5222=>434,5223=>877, -5224=>877,5225=>866,5226=>890,5227=>628,5228=>628,5229=>628,5230=>628,5231=>628,5232=>628,5233=>628, -5234=>628,5235=>628,5236=>860,5237=>771,5238=>815,5239=>816,5240=>815,5241=>816,5242=>860,5243=>771, -5244=>860,5245=>771,5246=>815,5247=>816,5248=>815,5249=>816,5250=>815,5251=>407,5252=>407,5253=>750, -5254=>775,5255=>750,5256=>775,5257=>628,5258=>628,5259=>628,5260=>628,5261=>628,5262=>628,5263=>628, -5264=>628,5265=>628,5266=>860,5267=>771,5268=>815,5269=>816,5270=>815,5271=>816,5272=>860,5273=>771, -5274=>860,5275=>771,5276=>815,5277=>816,5278=>815,5279=>816,5280=>815,5281=>435,5282=>435,5283=>610, -5284=>557,5285=>557,5286=>557,5287=>610,5288=>610,5289=>610,5290=>557,5291=>557,5292=>749,5293=>769, -5294=>746,5295=>764,5296=>746,5297=>764,5298=>749,5299=>769,5300=>749,5301=>769,5302=>746,5303=>764, -5304=>746,5305=>764,5306=>746,5307=>386,5308=>508,5309=>386,5312=>852,5313=>852,5314=>852,5315=>852, -5316=>852,5317=>852,5318=>852,5319=>852,5320=>852,5321=>1069,5322=>1035,5323=>1059,5324=>852,5325=>1059, -5326=>852,5327=>852,5328=>600,5329=>453,5330=>600,5331=>852,5332=>852,5333=>852,5334=>852,5335=>852, -5336=>852,5337=>852,5338=>852,5339=>852,5340=>1069,5341=>1035,5342=>1059,5343=>1030,5344=>1059,5345=>1030, -5346=>1069,5347=>1035,5348=>1069,5349=>1035,5350=>1083,5351=>1030,5352=>1083,5353=>1030,5354=>600,5356=>729, -5357=>603,5358=>603,5359=>603,5360=>603,5361=>603,5362=>603,5363=>603,5364=>603,5365=>603,5366=>834, -5367=>754,5368=>792,5369=>771,5370=>792,5371=>771,5372=>834,5373=>754,5374=>834,5375=>754,5376=>792, -5377=>771,5378=>792,5379=>771,5380=>792,5381=>418,5382=>420,5383=>418,5392=>712,5393=>712,5394=>712, -5395=>892,5396=>892,5397=>892,5398=>892,5399=>910,5400=>872,5401=>910,5402=>872,5403=>910,5404=>872, -5405=>1140,5406=>1100,5407=>1140,5408=>1100,5409=>1140,5410=>1100,5411=>1140,5412=>1100,5413=>641,5414=>627, -5415=>627,5416=>627,5417=>627,5418=>627,5419=>627,5420=>627,5421=>627,5422=>627,5423=>844,5424=>781, -5425=>816,5426=>818,5427=>816,5428=>818,5429=>844,5430=>781,5431=>844,5432=>781,5433=>816,5434=>818, -5435=>816,5436=>818,5437=>816,5438=>418,5440=>389,5441=>484,5442=>916,5443=>916,5444=>863,5445=>916, -5446=>863,5447=>863,5448=>603,5449=>603,5450=>603,5451=>603,5452=>603,5453=>603,5454=>834,5455=>754, -5456=>418,5458=>729,5459=>684,5460=>684,5461=>684,5462=>684,5463=>726,5464=>726,5465=>726,5466=>726, -5467=>924,5468=>1007,5469=>508,5470=>732,5471=>732,5472=>732,5473=>732,5474=>732,5475=>732,5476=>730, -5477=>730,5478=>730,5479=>730,5480=>947,5481=>900,5482=>508,5492=>831,5493=>831,5494=>831,5495=>831, -5496=>831,5497=>831,5498=>831,5499=>563,5500=>752,5501=>484,5502=>1047,5503=>1047,5504=>1047,5505=>1047, -5506=>1047,5507=>1047,5508=>1047,5509=>825,5514=>831,5515=>831,5516=>831,5517=>831,5518=>1259,5519=>1259, -5520=>1259,5521=>1002,5522=>1002,5523=>1259,5524=>1259,5525=>700,5526=>1073,5536=>852,5537=>852,5538=>799, -5539=>799,5540=>799,5541=>799,5542=>600,5543=>643,5544=>643,5545=>643,5546=>643,5547=>643,5548=>643, -5549=>643,5550=>418,5551=>628,5598=>770,5601=>770,5702=>468,5703=>468,5742=>444,5743=>1047,5744=>1310, -5745=>1632,5746=>1632,5747=>1375,5748=>1375,5749=>1632,5750=>1632,7424=>592,7425=>717,7426=>982,7427=>586, -7428=>550,7429=>605,7430=>605,7431=>491,7432=>541,7433=>278,7434=>395,7435=>579,7436=>583,7437=>754, -7438=>650,7439=>612,7440=>550,7441=>684,7442=>684,7443=>684,7444=>1023,7446=>612,7447=>612,7448=>524, -7449=>602,7450=>602,7451=>583,7452=>574,7453=>737,7454=>948,7455=>638,7456=>592,7457=>818,7458=>525, -7459=>526,7462=>583,7463=>592,7464=>564,7465=>524,7466=>590,7467=>639,7468=>431,7469=>613,7470=>432, -7472=>485,7473=>398,7474=>398,7475=>488,7476=>474,7477=>186,7478=>186,7479=>413,7480=>351,7481=>543, -7482=>471,7483=>471,7484=>496,7485=>439,7486=>380,7487=>438,7488=>385,7489=>461,7490=>623,7491=>392, -7492=>392,7493=>405,7494=>648,7495=>428,7496=>405,7497=>417,7498=>417,7499=>360,7500=>359,7501=>405, -7502=>179,7503=>426,7504=>623,7505=>409,7506=>414,7507=>370,7508=>414,7509=>414,7510=>428,7511=>295, -7512=>405,7513=>470,7514=>623,7515=>417,7517=>402,7518=>373,7519=>385,7520=>416,7521=>364,7522=>179, -7523=>259,7524=>405,7525=>417,7526=>402,7527=>373,7528=>412,7529=>416,7530=>364,7543=>635,7544=>474, -7547=>372,7557=>278,7579=>405,7580=>370,7581=>370,7582=>414,7583=>360,7584=>296,7585=>233,7586=>405, -7587=>405,7588=>261,7589=>250,7590=>261,7591=>261,7592=>234,7593=>250,7594=>235,7595=>376,7596=>623, -7597=>623,7598=>411,7599=>479,7600=>409,7601=>414,7602=>414,7603=>360,7604=>287,7605=>295,7606=>508, -7607=>418,7608=>361,7609=>406,7610=>417,7611=>366,7612=>437,7613=>366,7614=>392,7615=>414,7620=>0, -7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>684,7681=>613,7682=>686,7683=>635,7684=>686, -7685=>635,7686=>686,7687=>635,7688=>698,7689=>550,7690=>770,7691=>635,7692=>770,7693=>635,7694=>770, -7695=>635,7696=>770,7697=>635,7698=>770,7699=>635,7700=>632,7701=>615,7702=>632,7703=>615,7704=>632, -7705=>615,7706=>632,7707=>615,7708=>632,7709=>615,7710=>575,7711=>352,7712=>775,7713=>635,7714=>752, -7715=>634,7716=>752,7717=>634,7718=>752,7719=>634,7720=>752,7721=>634,7722=>752,7723=>634,7724=>295, -7725=>278,7726=>295,7727=>278,7728=>656,7729=>579,7730=>656,7731=>579,7732=>656,7733=>579,7734=>557, -7735=>278,7736=>557,7737=>278,7738=>557,7739=>278,7740=>557,7741=>278,7742=>863,7743=>974,7744=>863, -7745=>974,7746=>863,7747=>974,7748=>748,7749=>634,7750=>748,7751=>634,7752=>748,7753=>634,7754=>748, -7755=>634,7756=>787,7757=>612,7758=>787,7759=>612,7760=>787,7761=>612,7762=>787,7763=>612,7764=>603, -7765=>635,7766=>603,7767=>635,7768=>695,7769=>411,7770=>695,7771=>411,7772=>695,7773=>411,7774=>695, -7775=>411,7776=>635,7777=>521,7778=>635,7779=>521,7780=>635,7781=>521,7782=>635,7783=>521,7784=>635, -7785=>521,7786=>611,7787=>392,7788=>611,7789=>392,7790=>611,7791=>392,7792=>611,7793=>392,7794=>732, -7795=>634,7796=>732,7797=>634,7798=>732,7799=>634,7800=>732,7801=>634,7802=>732,7803=>634,7804=>684, -7805=>592,7806=>684,7807=>592,7808=>989,7809=>818,7810=>989,7811=>818,7812=>989,7813=>818,7814=>989, -7815=>818,7816=>989,7817=>818,7818=>685,7819=>592,7820=>685,7821=>592,7822=>611,7823=>592,7824=>685, -7825=>525,7826=>685,7827=>525,7828=>685,7829=>525,7830=>634,7831=>392,7832=>818,7833=>592,7834=>613, -7835=>352,7838=>769,7839=>612,7840=>684,7841=>613,7842=>684,7843=>613,7844=>684,7845=>613,7846=>684, -7847=>613,7848=>684,7849=>613,7850=>684,7851=>613,7852=>684,7853=>613,7854=>684,7855=>613,7856=>684, -7857=>613,7858=>684,7859=>613,7860=>684,7861=>613,7862=>684,7863=>613,7864=>632,7865=>615,7866=>632, -7867=>615,7868=>632,7869=>615,7870=>632,7871=>615,7872=>632,7873=>615,7874=>632,7875=>615,7876=>632, -7877=>615,7878=>632,7879=>615,7880=>295,7881=>278,7882=>295,7883=>278,7884=>787,7885=>612,7886=>787, -7887=>612,7888=>787,7889=>612,7890=>787,7891=>612,7892=>787,7893=>612,7894=>787,7895=>612,7896=>787, -7897=>612,7898=>913,7899=>612,7900=>913,7901=>612,7902=>913,7903=>612,7904=>913,7905=>612,7906=>913, -7907=>612,7908=>732,7909=>634,7910=>732,7911=>634,7912=>838,7913=>634,7914=>838,7915=>634,7916=>838, -7917=>634,7918=>838,7919=>634,7920=>838,7921=>634,7922=>611,7923=>592,7924=>611,7925=>592,7926=>611, -7927=>592,7928=>611,7929=>592,7936=>659,7937=>659,7938=>659,7939=>659,7940=>659,7941=>659,7942=>659, -7943=>659,7944=>684,7945=>684,7946=>877,7947=>877,7948=>769,7949=>801,7950=>708,7951=>743,7952=>541, -7953=>541,7954=>541,7955=>541,7956=>541,7957=>541,7960=>711,7961=>711,7962=>966,7963=>975,7964=>898, -7965=>928,7968=>634,7969=>634,7970=>634,7971=>634,7972=>634,7973=>634,7974=>634,7975=>634,7976=>837, -7977=>835,7978=>1086,7979=>1089,7980=>1027,7981=>1051,7982=>934,7983=>947,7984=>338,7985=>338,7986=>338, -7987=>338,7988=>338,7989=>338,7990=>338,7991=>338,7992=>380,7993=>374,7994=>635,7995=>635,7996=>570, -7997=>600,7998=>489,7999=>493,8000=>612,8001=>612,8002=>612,8003=>612,8004=>612,8005=>612,8008=>804, -8009=>848,8010=>1095,8011=>1100,8012=>938,8013=>970,8016=>579,8017=>579,8018=>579,8019=>579,8020=>579, -8021=>579,8022=>579,8023=>579,8025=>784,8027=>998,8029=>1012,8031=>897,8032=>837,8033=>837,8034=>837, -8035=>837,8036=>837,8037=>837,8038=>837,8039=>837,8040=>802,8041=>843,8042=>1089,8043=>1095,8044=>946, -8045=>972,8046=>921,8047=>952,8048=>659,8049=>659,8050=>541,8051=>548,8052=>634,8053=>654,8054=>338, -8055=>338,8056=>612,8057=>612,8058=>579,8059=>579,8060=>837,8061=>837,8064=>659,8065=>659,8066=>659, -8067=>659,8068=>659,8069=>659,8070=>659,8071=>659,8072=>684,8073=>684,8074=>877,8075=>877,8076=>769, -8077=>801,8078=>708,8079=>743,8080=>634,8081=>634,8082=>634,8083=>634,8084=>634,8085=>634,8086=>634, -8087=>634,8088=>837,8089=>835,8090=>1086,8091=>1089,8092=>1027,8093=>1051,8094=>934,8095=>947,8096=>837, -8097=>837,8098=>837,8099=>837,8100=>837,8101=>837,8102=>837,8103=>837,8104=>802,8105=>843,8106=>1089, -8107=>1095,8108=>946,8109=>972,8110=>921,8111=>952,8112=>659,8113=>659,8114=>659,8115=>659,8116=>659, -8118=>659,8119=>659,8120=>684,8121=>684,8122=>716,8123=>692,8124=>684,8125=>500,8126=>500,8127=>500, -8128=>500,8129=>500,8130=>634,8131=>634,8132=>654,8134=>634,8135=>634,8136=>805,8137=>746,8138=>931, -8139=>871,8140=>752,8141=>500,8142=>500,8143=>500,8144=>338,8145=>338,8146=>338,8147=>338,8150=>338, -8151=>338,8152=>295,8153=>295,8154=>475,8155=>408,8157=>500,8158=>500,8159=>500,8160=>579,8161=>579, -8162=>579,8163=>579,8164=>635,8165=>635,8166=>579,8167=>579,8168=>611,8169=>611,8170=>845,8171=>825, -8172=>685,8173=>500,8174=>500,8175=>500,8178=>837,8179=>837,8180=>837,8182=>837,8183=>837,8184=>941, -8185=>813,8186=>922,8187=>826,8188=>764,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000, -8196=>330,8197=>250,8198=>167,8199=>636,8200=>318,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0, -8206=>0,8207=>0,8208=>361,8209=>361,8210=>636,8213=>1000,8214=>500,8215=>500,8219=>318,8223=>518, -8227=>590,8228=>333,8229=>667,8231=>318,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200, -8241=>1690,8242=>227,8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339,8251=>838,8252=>485, -8253=>531,8254=>500,8255=>804,8256=>804,8257=>250,8258=>1000,8259=>500,8260=>167,8261=>390,8262=>390, -8263=>922,8264=>733,8265=>733,8266=>497,8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8272=>804, -8273=>500,8274=>450,8275=>1000,8276=>804,8277=>838,8278=>586,8279=>663,8280=>838,8281=>838,8282=>318, -8283=>797,8284=>838,8285=>318,8286=>318,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0, -8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>401,8305=>179,8308=>401,8309=>401, -8310=>401,8311=>401,8312=>401,8313=>401,8314=>528,8315=>528,8316=>528,8317=>246,8318=>246,8319=>399, -8320=>401,8321=>401,8322=>401,8323=>401,8324=>401,8325=>401,8326=>401,8327=>401,8328=>401,8329=>401, -8330=>528,8331=>528,8332=>528,8333=>246,8334=>246,8336=>392,8337=>417,8338=>414,8339=>444,8340=>417, -8352=>877,8353=>636,8354=>636,8355=>636,8356=>636,8357=>974,8358=>748,8359=>1271,8360=>1074,8361=>989, -8362=>838,8363=>636,8365=>656,8366=>611,8367=>1272,8368=>636,8369=>636,8370=>636,8371=>636,8372=>774, -8373=>641,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>970,8449=>970, -8450=>698,8451=>1123,8452=>896,8453=>969,8454=>1032,8455=>614,8456=>698,8457=>952,8459=>988,8460=>754, -8461=>850,8462=>634,8463=>634,8464=>470,8465=>697,8466=>720,8467=>413,8468=>818,8469=>801,8470=>1040, -8471=>1000,8472=>697,8473=>701,8474=>787,8475=>798,8476=>814,8477=>792,8478=>896,8479=>684,8480=>1020, -8481=>1014,8483=>684,8484=>745,8485=>578,8486=>764,8487=>764,8488=>616,8489=>338,8490=>656,8491=>684, -8492=>786,8493=>703,8494=>854,8495=>592,8496=>605,8497=>786,8498=>575,8499=>1069,8500=>462,8501=>745, -8502=>674,8503=>466,8504=>645,8505=>380,8506=>926,8507=>1157,8508=>702,8509=>728,8510=>654,8511=>849, -8512=>811,8513=>775,8514=>557,8515=>557,8516=>611,8517=>819,8518=>708,8519=>615,8520=>351,8521=>351, -8523=>780,8526=>526,8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969,8537=>969,8538=>969, -8539=>969,8540=>969,8541=>969,8542=>969,8543=>568,8544=>295,8545=>492,8546=>689,8547=>923,8548=>684, -8549=>922,8550=>1120,8551=>1317,8552=>917,8553=>685,8554=>933,8555=>1131,8556=>557,8557=>698,8558=>770, -8559=>863,8560=>278,8561=>458,8562=>637,8563=>812,8564=>592,8565=>811,8566=>991,8567=>1170,8568=>819, -8569=>592,8570=>822,8571=>1002,8572=>278,8573=>550,8574=>635,8575=>974,8576=>1245,8577=>770,8578=>1245, -8579=>703,8580=>549,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838, -8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838, -8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838, -8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838, -8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838, -8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838, -8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838, -8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838, -8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838, -8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838, -8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838, -8700=>838,8701=>838,8702=>838,8703=>838,8704=>684,8705=>636,8706=>517,8707=>632,8708=>632,8709=>871, -8710=>669,8711=>669,8712=>871,8713=>871,8714=>718,8715=>871,8716=>871,8717=>718,8718=>636,8719=>757, -8720=>757,8721=>674,8722=>838,8723=>838,8724=>838,8725=>337,8726=>637,8727=>838,8728=>626,8729=>626, -8730=>637,8731=>637,8732=>637,8733=>714,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500, -8740=>500,8741=>500,8742=>500,8743=>732,8744=>732,8745=>732,8746=>732,8747=>521,8748=>789,8749=>1057, -8750=>521,8751=>789,8752=>1057,8753=>521,8754=>521,8755=>521,8756=>636,8757=>636,8758=>260,8759=>636, -8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838, -8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838, -8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1000,8789=>1000, -8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838, -8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>838,8809=>838, -8810=>1047,8811=>1047,8812=>464,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838, -8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838, -8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838, -8840=>838,8841=>838,8842=>838,8843=>838,8844=>732,8845=>732,8846=>732,8847=>838,8848=>838,8849=>838, -8850=>838,8851=>780,8852=>780,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838, -8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>871,8867=>871,8868=>871,8869=>871, -8870=>521,8871=>521,8872=>871,8873=>871,8874=>871,8875=>871,8876=>871,8877=>871,8878=>871,8879=>871, -8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838, -8890=>521,8891=>732,8892=>732,8893=>732,8894=>838,8895=>838,8896=>820,8897=>820,8898=>820,8899=>820, -8900=>494,8901=>318,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838, -8910=>732,8911=>732,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838, -8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838, -8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838, -8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1000,8947=>871,8948=>718,8949=>871, -8950=>871,8951=>718,8952=>871,8953=>871,8954=>1000,8955=>871,8956=>718,8957=>871,8958=>718,8959=>871, -8960=>602,8961=>602,8962=>635,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>390,8969=>390, -8970=>390,8971=>390,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>513,8984=>1000,8985=>838, -8988=>469,8989=>469,8990=>469,8991=>469,8992=>521,8993=>521,8996=>1152,8997=>1152,8998=>1414,8999=>1152, -9000=>1443,9003=>1414,9004=>873,9075=>338,9076=>635,9077=>837,9082=>659,9085=>757,9095=>1152,9108=>873, -9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500, -9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>521, -9166=>838,9167=>945,9187=>873,9189=>769,9250=>635,9251=>635,9312=>896,9313=>896,9314=>896,9315=>896, -9316=>896,9317=>896,9318=>896,9319=>896,9320=>896,9321=>896,9472=>602,9473=>602,9474=>602,9475=>602, -9476=>602,9477=>602,9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602, -9486=>602,9487=>602,9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602, -9496=>602,9497=>602,9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602, -9506=>602,9507=>602,9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602, -9516=>602,9517=>602,9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602, -9526=>602,9527=>602,9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602, -9536=>602,9537=>602,9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602, -9546=>602,9547=>602,9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602, -9556=>602,9557=>602,9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602, -9566=>602,9567=>602,9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602, -9576=>602,9577=>602,9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602, -9586=>602,9587=>602,9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602, -9596=>602,9597=>602,9598=>602,9599=>602,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769, -9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769, -9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769, -9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945, -9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945, -9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769, -9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769, -9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873, -9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873, -9686=>527,9687=>527,9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387, -9696=>769,9697=>769,9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945, -9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945, -9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732, -9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573, -9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896, -9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896, -9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746, -9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896, -9776=>890,9777=>890,9778=>890,9779=>890,9780=>890,9781=>890,9782=>890,9783=>890,9784=>896,9785=>896, -9786=>896,9787=>896,9788=>896,9789=>896,9790=>896,9791=>614,9792=>731,9793=>731,9794=>896,9795=>896, -9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896, -9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896, -9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896, -9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896, -9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896, -9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896, -9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>890,9863=>890,9864=>890,9865=>890, -9866=>890,9867=>890,9868=>890,9869=>890,9870=>890,9871=>890,9872=>750,9873=>750,9874=>890,9875=>816, -9876=>716,9877=>537,9878=>852,9879=>890,9880=>684,9881=>890,9882=>708,9883=>890,9884=>890,9888=>890, -9889=>702,9890=>1003,9891=>1085,9892=>1143,9893=>901,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838, -9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>731,9907=>732,9908=>732, -9909=>732,9910=>850,9911=>732,9912=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838, -9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838, -10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838, -10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838, -10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838, -10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838, -10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838, -10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896, -10070=>896,10072=>838,10073=>838,10074=>838,10075=>322,10076=>322,10077=>538,10078=>538,10081=>838,10082=>838, -10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838, -10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>896, -10103=>896,10104=>896,10105=>896,10106=>896,10107=>896,10108=>896,10109=>896,10110=>896,10111=>896,10112=>838, -10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838, -10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838, -10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838, -10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838, -10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838, -10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>390,10182=>390, -10208=>494,10214=>495,10215=>495,10216=>390,10217=>390,10218=>556,10219=>556,10224=>838,10225=>838,10226=>838, -10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434, -10237=>1434,10238=>1434,10239=>1434,10240=>732,10241=>732,10242=>732,10243=>732,10244=>732,10245=>732,10246=>732, -10247=>732,10248=>732,10249=>732,10250=>732,10251=>732,10252=>732,10253=>732,10254=>732,10255=>732,10256=>732, -10257=>732,10258=>732,10259=>732,10260=>732,10261=>732,10262=>732,10263=>732,10264=>732,10265=>732,10266=>732, -10267=>732,10268=>732,10269=>732,10270=>732,10271=>732,10272=>732,10273=>732,10274=>732,10275=>732,10276=>732, -10277=>732,10278=>732,10279=>732,10280=>732,10281=>732,10282=>732,10283=>732,10284=>732,10285=>732,10286=>732, -10287=>732,10288=>732,10289=>732,10290=>732,10291=>732,10292=>732,10293=>732,10294=>732,10295=>732,10296=>732, -10297=>732,10298=>732,10299=>732,10300=>732,10301=>732,10302=>732,10303=>732,10304=>732,10305=>732,10306=>732, -10307=>732,10308=>732,10309=>732,10310=>732,10311=>732,10312=>732,10313=>732,10314=>732,10315=>732,10316=>732, -10317=>732,10318=>732,10319=>732,10320=>732,10321=>732,10322=>732,10323=>732,10324=>732,10325=>732,10326=>732, -10327=>732,10328=>732,10329=>732,10330=>732,10331=>732,10332=>732,10333=>732,10334=>732,10335=>732,10336=>732, -10337=>732,10338=>732,10339=>732,10340=>732,10341=>732,10342=>732,10343=>732,10344=>732,10345=>732,10346=>732, -10347=>732,10348=>732,10349=>732,10350=>732,10351=>732,10352=>732,10353=>732,10354=>732,10355=>732,10356=>732, -10357=>732,10358=>732,10359=>732,10360=>732,10361=>732,10362=>732,10363=>732,10364=>732,10365=>732,10366=>732, -10367=>732,10368=>732,10369=>732,10370=>732,10371=>732,10372=>732,10373=>732,10374=>732,10375=>732,10376=>732, -10377=>732,10378=>732,10379=>732,10380=>732,10381=>732,10382=>732,10383=>732,10384=>732,10385=>732,10386=>732, -10387=>732,10388=>732,10389=>732,10390=>732,10391=>732,10392=>732,10393=>732,10394=>732,10395=>732,10396=>732, -10397=>732,10398=>732,10399=>732,10400=>732,10401=>732,10402=>732,10403=>732,10404=>732,10405=>732,10406=>732, -10407=>732,10408=>732,10409=>732,10410=>732,10411=>732,10412=>732,10413=>732,10414=>732,10415=>732,10416=>732, -10417=>732,10418=>732,10419=>732,10420=>732,10421=>732,10422=>732,10423=>732,10424=>732,10425=>732,10426=>732, -10427=>732,10428=>732,10429=>732,10430=>732,10431=>732,10432=>732,10433=>732,10434=>732,10435=>732,10436=>732, -10437=>732,10438=>732,10439=>732,10440=>732,10441=>732,10442=>732,10443=>732,10444=>732,10445=>732,10446=>732, -10447=>732,10448=>732,10449=>732,10450=>732,10451=>732,10452=>732,10453=>732,10454=>732,10455=>732,10456=>732, -10457=>732,10458=>732,10459=>732,10460=>732,10461=>732,10462=>732,10463=>732,10464=>732,10465=>732,10466=>732, -10467=>732,10468=>732,10469=>732,10470=>732,10471=>732,10472=>732,10473=>732,10474=>732,10475=>732,10476=>732, -10477=>732,10478=>732,10479=>732,10480=>732,10481=>732,10482=>732,10483=>732,10484=>732,10485=>732,10486=>732, -10487=>732,10488=>732,10489=>732,10490=>732,10491=>732,10492=>732,10493=>732,10494=>732,10495=>732,10502=>838, -10503=>838,10506=>838,10507=>838,10560=>683,10561=>683,10627=>734,10628=>734,10702=>838,10703=>1000,10704=>1000, -10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000, -10754=>1000,10764=>1325,10765=>521,10766=>521,10767=>521,10768=>521,10769=>521,10770=>521,10771=>521,10772=>521, -10773=>521,10774=>521,10775=>521,10776=>521,10777=>521,10778=>521,10779=>521,10780=>521,10799=>838,10877=>838, -10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838, -10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838, -10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838, -10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838, -10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838, -11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838, -11018=>838,11019=>838,11020=>838,11021=>838,11022=>836,11023=>836,11024=>836,11025=>836,11026=>945,11027=>945, -11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873, -11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>557,11361=>278,11362=>557,11363=>603,11364=>695, -11365=>613,11366=>392,11367=>752,11368=>634,11369=>656,11370=>579,11371=>685,11372=>525,11373=>781,11374=>863, -11375=>684,11377=>734,11378=>1128,11379=>961,11380=>592,11381=>654,11382=>568,11383=>660,11385=>414,11386=>612, -11387=>491,11388=>175,11389=>431,11800=>531,11810=>390,11811=>390,11812=>390,11813=>390,11822=>531,19904=>896, -19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896,19913=>896,19914=>896, -19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896,19923=>896,19924=>896, -19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896,19933=>896,19934=>896, -19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896,19943=>896,19944=>896, -19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896,19953=>896,19954=>896, -19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896,19963=>896,19964=>896, -19965=>896,19966=>896,19967=>896,42564=>635,42565=>521,42566=>354,42567=>338,42572=>1180,42573=>1028,42576=>1029, -42577=>906,42580=>1080,42581=>842,42582=>985,42583=>847,42594=>1024,42595=>925,42596=>1014,42597=>900,42598=>863, -42599=>1008,42600=>787,42601=>612,42602=>855,42603=>712,42604=>1358,42605=>1019,42606=>879,42634=>805,42635=>722, -42636=>611,42637=>583,42644=>686,42645=>634,42760=>493,42761=>493,42762=>493,42763=>493,42764=>493,42765=>493, -42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493,42773=>493,42774=>493,42779=>369, -42780=>369,42781=>252,42782=>252,42783=>252,42790=>752,42791=>634,42792=>878,42793=>709,42794=>614,42795=>541, -42800=>491,42801=>521,42802=>1250,42803=>985,42804=>1219,42805=>1000,42806=>1155,42807=>996,42808=>971,42809=>818, -42810=>971,42811=>818,42812=>959,42813=>818,42814=>698,42815=>549,42822=>680,42823=>392,42824=>582,42825=>427, -42826=>807,42827=>704,42830=>1358,42831=>1019,42880=>557,42881=>278,42882=>735,42883=>634,42889=>337,42890=>376, -42891=>401,42892=>275,43003=>575,43004=>603,43005=>863,43006=>295,43007=>1199,63173=>612,64256=>722,64257=>646, -64258=>646,64259=>1000,64260=>1000,64261=>686,64262=>861,64275=>1202,64276=>1202,64277=>1196,64278=>1186,64279=>1529, -64285=>272,64286=>0,64287=>471,64288=>636,64289=>856,64290=>774,64291=>906,64292=>771,64293=>843,64294=>855, -64295=>807,64296=>875,64297=>838,64298=>808,64299=>808,64300=>808,64301=>808,64302=>629,64303=>629,64304=>629, -64305=>608,64306=>448,64307=>594,64308=>640,64309=>272,64310=>374,64311=>1000,64312=>648,64313=>336,64314=>592, -64315=>556,64316=>599,64318=>659,64320=>441,64321=>700,64323=>640,64324=>604,64326=>581,64327=>663,64328=>592, -64329=>808,64330=>657,64331=>272,64332=>608,64333=>556,64334=>604,64335=>629,65024=>0,65025=>0,65026=>0, -65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0, -65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65529=>0,65530=>0,65531=>0, -65532=>0,65533=>1025); -$enc=''; -$diff=''; -$file='dejavusansi.z'; -$ctg='dejavusansi.ctg.z'; -$originalsize=523804; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.z deleted file mode 100644 index bb3d034bac..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.ctg.z deleted file mode 100644 index bc94032929..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.php deleted file mode 100644 index ce70b1e67d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.php +++ /dev/null @@ -1,320 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansMono'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>9,'Flags'=>33,'FontBBox'=>'[-558 -375 718 1042]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>602); -$up=-63; -$ut=44; -$dw=602; -$cw=array( -0=>602,32=>602,33=>602,34=>602,35=>602,36=>602,37=>602,38=>602,39=>602,40=>602, -41=>602,42=>602,43=>602,44=>602,45=>602,46=>602,47=>602,48=>602,49=>602,50=>602, -51=>602,52=>602,53=>602,54=>602,55=>602,56=>602,57=>602,58=>602,59=>602,60=>602, -61=>602,62=>602,63=>602,64=>602,65=>602,66=>602,67=>602,68=>602,69=>602,70=>602, -71=>602,72=>602,73=>602,74=>602,75=>602,76=>602,77=>602,78=>602,79=>602,80=>602, -81=>602,82=>602,83=>602,84=>602,85=>602,86=>602,87=>602,88=>602,89=>602,90=>602, -91=>602,92=>602,93=>602,94=>602,95=>602,96=>602,97=>602,98=>602,99=>602,100=>602, -101=>602,102=>602,103=>602,104=>602,105=>602,106=>602,107=>602,108=>602,109=>602,110=>602, -111=>602,112=>602,113=>602,114=>602,115=>602,116=>602,117=>602,118=>602,119=>602,120=>602, -121=>602,122=>602,123=>602,124=>602,125=>602,126=>602,8364=>602,8218=>602,402=>602,8222=>602, -8230=>602,8224=>602,8225=>602,710=>602,8240=>602,352=>602,8249=>602,338=>602,381=>602,8216=>602, -8217=>602,8220=>602,8221=>602,8226=>602,8211=>602,8212=>602,732=>602,8482=>602,353=>602,8250=>602, -339=>602,382=>602,376=>602,160=>602,161=>602,162=>602,163=>602,164=>602,165=>602,166=>602, -167=>602,168=>602,169=>602,170=>602,171=>602,172=>602,173=>602,174=>602,175=>602,176=>602, -177=>602,178=>602,179=>602,180=>602,181=>602,182=>602,183=>602,184=>602,185=>602,186=>602, -187=>602,188=>602,189=>602,190=>602,191=>602,192=>602,193=>602,194=>602,195=>602,196=>602, -197=>602,198=>602,199=>602,200=>602,201=>602,202=>602,203=>602,204=>602,205=>602,206=>602, -207=>602,208=>602,209=>602,210=>602,211=>602,212=>602,213=>602,214=>602,215=>602,216=>602, -217=>602,218=>602,219=>602,220=>602,221=>602,222=>602,223=>602,224=>602,225=>602,226=>602, -227=>602,228=>602,229=>602,230=>602,231=>602,232=>602,233=>602,234=>602,235=>602,236=>602, -237=>602,238=>602,239=>602,240=>602,241=>602,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>602,248=>602,249=>602,250=>602,251=>602,252=>602,253=>602,254=>602,255=>602,256=>602, -257=>602,258=>602,259=>602,260=>602,261=>602,262=>602,263=>602,264=>602,265=>602,266=>602, -267=>602,268=>602,269=>602,270=>602,271=>602,272=>602,273=>602,274=>602,275=>602,276=>602, -277=>602,278=>602,279=>602,280=>602,281=>602,282=>602,283=>602,284=>602,285=>602,286=>602, -287=>602,288=>602,289=>602,290=>602,291=>602,292=>602,293=>602,294=>602,295=>602,296=>602, -297=>602,298=>602,299=>602,300=>602,301=>602,302=>602,303=>602,304=>602,305=>602,306=>602, -307=>602,308=>602,309=>602,310=>602,311=>602,312=>602,313=>602,314=>602,315=>602,316=>602, -317=>602,318=>602,319=>602,320=>602,321=>602,322=>602,323=>602,324=>602,325=>602,326=>602, -327=>602,328=>602,329=>602,330=>602,331=>602,332=>602,333=>602,334=>602,335=>602,336=>602, -337=>602,340=>602,341=>602,342=>602,343=>602,344=>602,345=>602,346=>602,347=>602,348=>602, -349=>602,350=>602,351=>602,354=>602,355=>602,356=>602,357=>602,358=>602,359=>602,360=>602, -361=>602,362=>602,363=>602,364=>602,365=>602,366=>602,367=>602,368=>602,369=>602,370=>602, -371=>602,372=>602,373=>602,374=>602,375=>602,377=>602,378=>602,379=>602,380=>602,383=>602, -384=>602,385=>602,386=>602,387=>602,388=>602,389=>602,390=>602,391=>602,392=>602,393=>602, -394=>602,395=>602,396=>602,397=>602,398=>602,399=>602,400=>602,401=>602,403=>602,404=>602, -405=>602,406=>602,407=>602,408=>602,409=>602,410=>602,411=>602,412=>602,413=>602,414=>602, -415=>602,416=>602,417=>602,418=>602,419=>602,420=>602,421=>602,422=>602,423=>602,424=>602, -425=>602,426=>602,427=>602,428=>602,429=>602,430=>602,431=>602,432=>602,433=>602,434=>602, -435=>602,436=>602,437=>602,438=>602,439=>602,440=>602,441=>602,442=>602,443=>602,444=>602, -445=>602,446=>602,447=>602,448=>602,449=>602,450=>602,451=>602,461=>602,462=>602,463=>602, -464=>602,465=>602,466=>602,467=>602,468=>602,469=>602,470=>602,471=>602,472=>602,473=>602, -474=>602,475=>602,476=>602,477=>602,478=>602,479=>602,480=>602,481=>602,482=>602,483=>602, -486=>602,487=>602,488=>602,489=>602,490=>602,491=>602,492=>602,493=>602,494=>602,495=>602, -496=>602,500=>602,501=>602,502=>602,504=>602,505=>602,508=>602,509=>602,510=>602,511=>602, -512=>602,513=>602,514=>602,515=>602,516=>602,517=>602,518=>602,519=>602,520=>602,521=>602, -522=>602,523=>602,524=>602,525=>602,526=>602,527=>602,528=>602,529=>602,530=>602,531=>602, -532=>602,533=>602,534=>602,535=>602,536=>602,537=>602,538=>602,539=>602,540=>602,541=>602, -542=>602,543=>602,544=>602,545=>602,548=>602,549=>602,550=>602,551=>602,552=>602,553=>602, -554=>602,555=>602,556=>602,557=>602,558=>602,559=>602,560=>602,561=>602,562=>602,563=>602, -564=>602,565=>602,566=>602,567=>602,568=>602,569=>602,570=>602,571=>602,572=>602,573=>602, -574=>602,575=>602,576=>602,577=>602,580=>602,581=>602,588=>602,589=>602,592=>602,593=>602, -594=>602,595=>602,596=>602,597=>602,598=>602,599=>602,600=>602,601=>602,602=>602,603=>602, -604=>602,605=>602,606=>602,607=>602,608=>602,609=>602,610=>602,611=>602,612=>602,613=>602, -614=>602,615=>602,616=>602,617=>602,618=>602,619=>602,620=>602,621=>602,622=>602,623=>602, -624=>602,625=>602,626=>602,627=>602,628=>602,629=>602,630=>602,631=>602,632=>602,633=>602, -634=>602,635=>602,636=>602,637=>602,638=>602,639=>602,640=>602,641=>602,642=>602,643=>602, -644=>602,645=>602,646=>602,647=>602,648=>602,649=>602,650=>602,651=>602,652=>602,653=>602, -654=>602,655=>602,656=>602,657=>602,658=>602,659=>602,660=>602,661=>602,662=>602,663=>602, -664=>602,665=>602,666=>602,667=>602,668=>602,669=>602,670=>602,671=>602,672=>602,673=>602, -674=>602,675=>602,676=>602,677=>602,678=>602,679=>602,680=>602,681=>602,682=>602,683=>602, -684=>602,685=>602,686=>602,687=>602,688=>602,689=>602,690=>602,691=>602,692=>602,693=>602, -694=>602,695=>602,696=>602,697=>602,699=>602,700=>602,701=>602,702=>602,703=>602,704=>602, -705=>602,711=>602,712=>602,713=>602,716=>602,717=>602,720=>602,721=>602,722=>602,723=>602, -726=>602,727=>602,728=>602,729=>602,730=>602,731=>602,733=>602,734=>602,736=>602,737=>602, -738=>602,739=>602,740=>602,741=>602,742=>602,743=>602,744=>602,745=>602,750=>602,755=>602, -768=>602,769=>602,770=>602,771=>602,772=>602,773=>602,774=>602,775=>602,776=>602,777=>602, -778=>602,779=>602,780=>602,781=>602,782=>602,783=>602,784=>602,785=>602,786=>602,787=>602, -788=>602,789=>602,790=>602,791=>602,792=>602,793=>602,794=>602,795=>602,796=>602,797=>602, -798=>602,799=>602,800=>602,801=>602,802=>602,803=>602,804=>602,805=>602,806=>602,807=>602, -808=>602,809=>602,810=>602,811=>602,812=>602,813=>602,814=>602,815=>602,816=>602,817=>602, -818=>602,819=>602,820=>602,821=>602,822=>602,823=>602,824=>602,825=>602,826=>602,827=>602, -828=>602,829=>602,830=>602,831=>602,835=>602,856=>602,865=>602,884=>602,885=>602,890=>602, -894=>602,900=>602,901=>602,902=>602,903=>602,904=>602,905=>602,906=>602,908=>602,910=>602, -911=>602,912=>602,913=>602,914=>602,915=>602,916=>602,917=>602,918=>602,919=>602,920=>602, -921=>602,922=>602,923=>602,924=>602,925=>602,926=>602,927=>602,928=>602,929=>602,931=>602, -932=>602,933=>602,934=>602,935=>602,936=>602,937=>602,938=>602,939=>602,940=>602,941=>602, -942=>602,943=>602,944=>602,945=>602,946=>602,947=>602,948=>602,949=>602,950=>602,951=>602, -952=>602,953=>602,954=>602,955=>602,956=>602,957=>602,958=>602,959=>602,960=>602,961=>602, -962=>602,963=>602,964=>602,965=>602,966=>602,967=>602,968=>602,969=>602,970=>602,971=>602, -972=>602,973=>602,974=>602,976=>602,977=>602,978=>602,979=>602,980=>602,981=>602,982=>602, -983=>602,984=>602,985=>602,986=>602,987=>602,988=>602,989=>602,990=>602,991=>602,992=>602, -993=>602,1008=>602,1009=>602,1010=>602,1011=>602,1012=>602,1013=>602,1014=>602,1015=>602,1016=>602, -1017=>602,1018=>602,1019=>602,1020=>602,1021=>602,1022=>602,1023=>602,1024=>602,1025=>602,1026=>602, -1027=>602,1028=>602,1029=>602,1030=>602,1031=>602,1032=>602,1033=>602,1034=>602,1035=>602,1036=>602, -1037=>602,1038=>602,1039=>602,1040=>602,1041=>602,1042=>602,1043=>602,1044=>602,1045=>602,1046=>602, -1047=>602,1048=>602,1049=>602,1050=>602,1051=>602,1052=>602,1053=>602,1054=>602,1055=>602,1056=>602, -1057=>602,1058=>602,1059=>602,1060=>602,1061=>602,1062=>602,1063=>602,1064=>602,1065=>602,1066=>602, -1067=>602,1068=>602,1069=>602,1070=>602,1071=>602,1072=>602,1073=>602,1074=>602,1075=>602,1076=>602, -1077=>602,1078=>602,1079=>602,1080=>602,1081=>602,1082=>602,1083=>602,1084=>602,1085=>602,1086=>602, -1087=>602,1088=>602,1089=>602,1090=>602,1091=>602,1092=>602,1093=>602,1094=>602,1095=>602,1096=>602, -1097=>602,1098=>602,1099=>602,1100=>602,1101=>602,1102=>602,1103=>602,1104=>602,1105=>602,1106=>602, -1107=>602,1108=>602,1109=>602,1110=>602,1111=>602,1112=>602,1113=>602,1114=>602,1115=>602,1116=>602, -1117=>602,1118=>602,1119=>602,1122=>602,1123=>602,1138=>602,1139=>602,1168=>602,1169=>602,1170=>602, -1171=>602,1172=>602,1173=>602,1174=>602,1175=>602,1176=>602,1177=>602,1178=>602,1179=>602,1186=>602, -1187=>602,1194=>602,1195=>602,1196=>602,1197=>602,1198=>602,1199=>602,1200=>602,1201=>602,1202=>602, -1203=>602,1210=>602,1211=>602,1216=>602,1217=>602,1218=>602,1219=>602,1220=>602,1223=>602,1224=>602, -1227=>602,1228=>602,1231=>602,1232=>602,1233=>602,1234=>602,1235=>602,1236=>602,1237=>602,1238=>602, -1239=>602,1240=>602,1241=>602,1242=>602,1243=>602,1244=>602,1245=>602,1246=>602,1247=>602,1248=>602, -1249=>602,1250=>602,1251=>602,1252=>602,1253=>602,1254=>602,1255=>602,1256=>602,1257=>602,1258=>602, -1259=>602,1260=>602,1261=>602,1262=>602,1263=>602,1264=>602,1265=>602,1266=>602,1267=>602,1268=>602, -1269=>602,1270=>602,1271=>602,1272=>602,1273=>602,1296=>602,1297=>602,1306=>602,1307=>602,1308=>602, -1309=>602,1542=>602,1543=>602,1545=>602,1546=>602,1548=>602,1557=>602,1563=>602,1567=>602,1569=>602, -1570=>602,1571=>602,1572=>602,1573=>602,1574=>602,1575=>602,1576=>602,1577=>602,1578=>602,1579=>602, -1580=>602,1581=>602,1582=>602,1583=>602,1584=>602,1585=>602,1586=>602,1587=>602,1588=>602,1589=>602, -1590=>602,1591=>602,1592=>602,1593=>602,1594=>602,1600=>602,1601=>602,1602=>602,1603=>602,1604=>602, -1605=>602,1606=>602,1607=>602,1608=>602,1609=>602,1610=>602,1611=>602,1612=>602,1613=>602,1614=>602, -1615=>602,1616=>602,1617=>602,1618=>602,1619=>602,1620=>602,1621=>602,1626=>602,1632=>602,1633=>602, -1634=>602,1635=>602,1636=>602,1637=>602,1638=>602,1639=>602,1640=>602,1641=>602,1642=>602,1643=>602, -1644=>602,1645=>602,1652=>602,1657=>602,1658=>602,1659=>602,1662=>602,1663=>602,1664=>602,1667=>602, -1668=>602,1670=>602,1671=>602,1681=>602,1688=>602,1700=>602,1705=>602,1711=>602,1726=>602,1740=>602, -1776=>602,1777=>602,1778=>602,1779=>602,1780=>602,1781=>602,1782=>602,1783=>602,1784=>602,1785=>602, -3713=>602,3714=>602,3716=>602,3719=>602,3720=>602,3722=>602,3725=>602,3732=>602,3733=>602,3734=>602, -3735=>602,3737=>602,3738=>602,3739=>602,3740=>602,3741=>602,3742=>602,3743=>602,3745=>602,3746=>602, -3747=>602,3749=>602,3751=>602,3754=>602,3755=>602,3757=>602,3758=>602,3759=>602,3760=>602,3761=>602, -3762=>602,3763=>602,3764=>602,3765=>602,3766=>602,3767=>602,3768=>602,3769=>602,3771=>602,3772=>602, -3784=>602,3785=>602,3786=>602,3787=>602,3788=>602,3789=>602,4304=>602,4305=>602,4306=>602,4307=>602, -4308=>602,4309=>602,4310=>602,4311=>602,4312=>602,4313=>602,4314=>602,4315=>602,4316=>602,4317=>602, -4318=>602,4319=>602,4320=>602,4321=>602,4322=>602,4323=>602,4324=>602,4325=>602,4326=>602,4327=>602, -4328=>602,4329=>602,4330=>602,4331=>602,4332=>602,4333=>602,4334=>602,4335=>602,4336=>602,4337=>602, -4338=>602,4339=>602,4340=>602,4341=>602,4342=>602,4343=>602,4344=>602,4345=>602,4346=>602,4347=>602, -4348=>602,7426=>602,7432=>602,7433=>602,7444=>602,7446=>602,7447=>602,7453=>602,7454=>602,7455=>602, -7468=>602,7469=>602,7470=>602,7472=>602,7473=>602,7474=>602,7475=>602,7476=>602,7477=>602,7478=>602, -7479=>602,7480=>602,7481=>602,7482=>602,7483=>602,7484=>602,7486=>602,7487=>602,7488=>602,7489=>602, -7490=>602,7491=>602,7492=>602,7493=>602,7494=>602,7495=>602,7496=>602,7497=>602,7498=>602,7499=>602, -7500=>602,7501=>602,7502=>602,7503=>602,7504=>602,7505=>602,7506=>602,7507=>602,7508=>602,7509=>602, -7510=>602,7511=>602,7512=>602,7513=>602,7514=>602,7515=>602,7522=>602,7523=>602,7524=>602,7525=>602, -7543=>602,7544=>602,7547=>602,7557=>602,7579=>602,7580=>602,7581=>602,7582=>602,7583=>602,7584=>602, -7585=>602,7586=>602,7587=>602,7588=>602,7589=>602,7590=>602,7591=>602,7592=>602,7593=>602,7594=>602, -7595=>602,7596=>602,7597=>602,7598=>602,7599=>602,7600=>602,7601=>602,7602=>602,7603=>602,7604=>602, -7605=>602,7606=>602,7607=>602,7609=>602,7610=>602,7611=>602,7612=>602,7613=>602,7614=>602,7615=>602, -7680=>602,7681=>602,7682=>602,7683=>602,7684=>602,7685=>602,7686=>602,7687=>602,7688=>602,7689=>602, -7690=>602,7691=>602,7692=>602,7693=>602,7694=>602,7695=>602,7696=>602,7697=>602,7698=>602,7699=>602, -7704=>602,7705=>602,7706=>602,7707=>602,7708=>602,7709=>602,7710=>602,7711=>602,7712=>602,7713=>602, -7714=>602,7715=>602,7716=>602,7717=>602,7718=>602,7719=>602,7720=>602,7721=>602,7722=>602,7723=>602, -7724=>602,7725=>602,7728=>602,7729=>602,7730=>602,7731=>602,7732=>602,7733=>602,7734=>602,7735=>602, -7736=>602,7737=>602,7738=>602,7739=>602,7740=>602,7741=>602,7742=>602,7743=>602,7744=>602,7745=>602, -7746=>602,7747=>602,7748=>602,7749=>602,7750=>602,7751=>602,7752=>602,7753=>602,7754=>602,7755=>602, -7756=>602,7757=>602,7764=>602,7765=>602,7766=>602,7767=>602,7768=>602,7769=>602,7770=>602,7771=>602, -7772=>602,7773=>602,7774=>602,7775=>602,7776=>602,7777=>602,7778=>602,7779=>602,7784=>602,7785=>602, -7786=>602,7787=>602,7788=>602,7789=>602,7790=>602,7791=>602,7792=>602,7793=>602,7794=>602,7795=>602, -7796=>602,7797=>602,7798=>602,7799=>602,7800=>602,7801=>602,7804=>602,7805=>602,7806=>602,7807=>602, -7808=>602,7809=>602,7810=>602,7811=>602,7812=>602,7813=>602,7814=>602,7815=>602,7816=>602,7817=>602, -7818=>602,7819=>602,7820=>602,7821=>602,7822=>602,7823=>602,7824=>602,7825=>602,7826=>602,7827=>602, -7828=>602,7829=>602,7830=>602,7831=>602,7832=>602,7833=>602,7835=>602,7839=>602,7840=>602,7841=>602, -7852=>602,7853=>602,7856=>602,7857=>602,7862=>602,7863=>602,7864=>602,7865=>602,7868=>602,7869=>602, -7878=>602,7879=>602,7882=>602,7883=>602,7884=>602,7885=>602,7896=>602,7897=>602,7898=>602,7899=>602, -7900=>602,7901=>602,7904=>602,7905=>602,7906=>602,7907=>602,7908=>602,7909=>602,7912=>602,7913=>602, -7914=>602,7915=>602,7918=>602,7919=>602,7920=>602,7921=>602,7922=>602,7923=>602,7924=>602,7925=>602, -7928=>602,7929=>602,7936=>602,7937=>602,7938=>602,7939=>602,7940=>602,7941=>602,7942=>602,7943=>602, -7944=>602,7945=>602,7946=>602,7947=>602,7948=>602,7949=>602,7950=>602,7951=>602,7952=>602,7953=>602, -7954=>602,7955=>602,7956=>602,7957=>602,7960=>602,7961=>602,7962=>602,7963=>602,7964=>602,7965=>602, -7968=>602,7969=>602,7970=>602,7971=>602,7972=>602,7973=>602,7974=>602,7975=>602,7976=>602,7977=>602, -7978=>602,7979=>602,7980=>602,7981=>602,7982=>602,7983=>602,7984=>602,7985=>602,7986=>602,7987=>602, -7988=>602,7989=>602,7990=>602,7991=>602,7992=>602,7993=>602,7994=>602,7995=>602,7996=>602,7997=>602, -7998=>602,7999=>602,8000=>602,8001=>602,8002=>602,8003=>602,8004=>602,8005=>602,8008=>602,8009=>602, -8010=>602,8011=>602,8012=>602,8013=>602,8016=>602,8017=>602,8018=>602,8019=>602,8020=>602,8021=>602, -8022=>602,8023=>602,8025=>602,8027=>602,8029=>602,8031=>602,8032=>602,8033=>602,8034=>602,8035=>602, -8036=>602,8037=>602,8038=>602,8039=>602,8040=>602,8041=>602,8042=>602,8043=>602,8044=>602,8045=>602, -8046=>602,8047=>602,8048=>602,8049=>602,8050=>602,8051=>602,8052=>602,8053=>602,8054=>602,8055=>602, -8056=>602,8057=>602,8058=>602,8059=>602,8060=>602,8061=>602,8064=>602,8065=>602,8066=>602,8067=>602, -8068=>602,8069=>602,8070=>602,8071=>602,8072=>602,8073=>602,8074=>602,8075=>602,8076=>602,8077=>602, -8078=>602,8079=>602,8080=>602,8081=>602,8082=>602,8083=>602,8084=>602,8085=>602,8086=>602,8087=>602, -8088=>602,8089=>602,8090=>602,8091=>602,8092=>602,8093=>602,8094=>602,8095=>602,8096=>602,8097=>602, -8098=>602,8099=>602,8100=>602,8101=>602,8102=>602,8103=>602,8104=>602,8105=>602,8106=>602,8107=>602, -8108=>602,8109=>602,8110=>602,8111=>602,8112=>602,8113=>602,8114=>602,8115=>602,8116=>602,8118=>602, -8119=>602,8120=>602,8121=>602,8122=>602,8123=>602,8124=>602,8125=>602,8126=>602,8127=>602,8128=>602, -8129=>602,8130=>602,8131=>602,8132=>602,8134=>602,8135=>602,8136=>602,8137=>602,8138=>602,8139=>602, -8140=>602,8141=>602,8142=>602,8143=>602,8144=>602,8145=>602,8146=>602,8147=>602,8150=>602,8151=>602, -8152=>602,8153=>602,8154=>602,8155=>602,8157=>602,8158=>602,8159=>602,8160=>602,8161=>602,8162=>602, -8163=>602,8164=>602,8165=>602,8166=>602,8167=>602,8168=>602,8169=>602,8170=>602,8171=>602,8172=>602, -8173=>602,8174=>602,8175=>602,8178=>602,8179=>602,8180=>602,8182=>602,8183=>602,8184=>602,8185=>602, -8186=>602,8187=>602,8188=>602,8189=>602,8190=>602,8192=>602,8193=>602,8194=>602,8195=>602,8196=>602, -8197=>602,8198=>602,8199=>602,8200=>602,8201=>602,8202=>602,8208=>602,8209=>602,8210=>602,8213=>602, -8215=>602,8219=>602,8223=>602,8227=>602,8239=>602,8241=>602,8242=>602,8243=>602,8244=>602,8245=>602, -8246=>602,8247=>602,8252=>602,8253=>602,8254=>602,8261=>602,8262=>602,8263=>602,8264=>602,8265=>602, -8287=>602,8304=>602,8305=>602,8308=>602,8309=>602,8310=>602,8311=>602,8312=>602,8313=>602,8314=>602, -8315=>602,8316=>602,8317=>602,8318=>602,8319=>602,8320=>602,8321=>602,8322=>602,8323=>602,8324=>602, -8325=>602,8326=>602,8327=>602,8328=>602,8329=>602,8330=>602,8331=>602,8332=>602,8333=>602,8334=>602, -8336=>602,8337=>602,8338=>602,8339=>602,8340=>602,8352=>602,8353=>602,8354=>602,8355=>602,8356=>602, -8357=>602,8358=>602,8359=>602,8360=>602,8361=>602,8362=>602,8363=>602,8365=>602,8366=>602,8367=>602, -8368=>602,8369=>602,8370=>602,8371=>602,8372=>602,8373=>602,8450=>602,8453=>602,8461=>602,8462=>602, -8463=>602,8469=>602,8470=>602,8471=>602,8473=>602,8474=>602,8477=>602,8484=>602,8486=>602,8490=>602, -8491=>602,8494=>602,8531=>602,8532=>602,8533=>602,8534=>602,8535=>602,8536=>602,8537=>602,8538=>602, -8539=>602,8540=>602,8541=>602,8542=>602,8543=>602,8592=>602,8593=>602,8594=>602,8595=>602,8596=>602, -8597=>602,8598=>602,8599=>602,8600=>602,8601=>602,8602=>602,8603=>602,8604=>602,8605=>602,8606=>602, -8607=>602,8608=>602,8609=>602,8610=>602,8611=>602,8612=>602,8613=>602,8614=>602,8615=>602,8616=>602, -8617=>602,8618=>602,8619=>602,8620=>602,8621=>602,8622=>602,8623=>602,8624=>602,8625=>602,8626=>602, -8627=>602,8628=>602,8629=>602,8630=>602,8631=>602,8632=>602,8633=>602,8634=>602,8635=>602,8636=>602, -8637=>602,8638=>602,8639=>602,8640=>602,8641=>602,8642=>602,8643=>602,8644=>602,8645=>602,8646=>602, -8647=>602,8648=>602,8649=>602,8650=>602,8651=>602,8652=>602,8653=>602,8654=>602,8655=>602,8656=>602, -8657=>602,8658=>602,8659=>602,8660=>602,8661=>602,8662=>602,8663=>602,8664=>602,8665=>602,8666=>602, -8667=>602,8668=>602,8669=>602,8670=>602,8671=>602,8672=>602,8673=>602,8674=>602,8675=>602,8676=>602, -8677=>602,8678=>602,8679=>602,8680=>602,8681=>602,8682=>602,8683=>602,8684=>602,8685=>602,8686=>602, -8687=>602,8688=>602,8689=>602,8690=>602,8691=>602,8692=>602,8693=>602,8694=>602,8695=>602,8696=>602, -8697=>602,8698=>602,8699=>602,8700=>602,8701=>602,8702=>602,8703=>602,8704=>602,8705=>602,8706=>602, -8707=>602,8708=>602,8709=>602,8710=>602,8711=>602,8712=>602,8713=>602,8714=>602,8715=>602,8716=>602, -8717=>602,8719=>602,8721=>602,8722=>602,8723=>602,8725=>602,8727=>602,8728=>602,8729=>602,8730=>602, -8731=>602,8732=>602,8733=>602,8734=>602,8735=>602,8736=>602,8743=>602,8744=>602,8745=>602,8746=>602, -8747=>602,8748=>602,8749=>602,8760=>602,8761=>602,8762=>602,8763=>602,8764=>602,8765=>602,8769=>602, -8770=>602,8771=>602,8772=>602,8773=>602,8774=>602,8775=>602,8776=>602,8777=>602,8778=>602,8779=>602, -8780=>602,8781=>602,8782=>602,8783=>602,8784=>602,8785=>602,8786=>602,8787=>602,8788=>602,8789=>602, -8790=>602,8791=>602,8792=>602,8793=>602,8794=>602,8795=>602,8796=>602,8797=>602,8798=>602,8799=>602, -8800=>602,8801=>602,8802=>602,8803=>602,8804=>602,8805=>602,8806=>602,8807=>602,8808=>602,8809=>602, -8813=>602,8814=>602,8815=>602,8816=>602,8817=>602,8818=>602,8819=>602,8820=>602,8821=>602,8822=>602, -8823=>602,8824=>602,8825=>602,8826=>602,8827=>602,8828=>602,8829=>602,8830=>602,8831=>602,8832=>602, -8833=>602,8834=>602,8835=>602,8836=>602,8837=>602,8838=>602,8839=>602,8840=>602,8841=>602,8842=>602, -8843=>602,8847=>602,8848=>602,8849=>602,8850=>602,8853=>602,8854=>602,8855=>602,8856=>602,8857=>602, -8858=>602,8859=>602,8860=>602,8861=>602,8862=>602,8863=>602,8864=>602,8865=>602,8901=>602,8902=>602, -8909=>602,8922=>602,8923=>602,8924=>602,8925=>602,8926=>602,8927=>602,8928=>602,8929=>602,8930=>602, -8931=>602,8932=>602,8933=>602,8934=>602,8935=>602,8936=>602,8937=>602,8943=>602,8960=>602,8961=>602, -8962=>602,8963=>602,8964=>602,8965=>602,8966=>602,8968=>602,8969=>602,8970=>602,8971=>602,8972=>602, -8973=>602,8974=>602,8975=>602,8976=>602,8977=>602,8978=>602,8979=>602,8980=>602,8981=>602,8984=>602, -8985=>602,8988=>602,8989=>602,8990=>602,8991=>602,8992=>602,8993=>602,8997=>602,8998=>602,8999=>602, -9000=>602,9003=>602,9013=>602,9015=>602,9016=>602,9017=>602,9018=>602,9019=>602,9020=>602,9021=>602, -9022=>602,9025=>602,9026=>602,9027=>602,9028=>602,9031=>602,9032=>602,9033=>602,9035=>602,9036=>602, -9037=>602,9040=>602,9042=>602,9043=>602,9044=>602,9047=>602,9048=>602,9049=>602,9050=>602,9051=>602, -9052=>602,9054=>602,9055=>602,9056=>602,9059=>602,9060=>602,9061=>602,9064=>602,9065=>602,9067=>602, -9068=>602,9069=>602,9070=>602,9071=>602,9072=>602,9075=>602,9076=>602,9077=>602,9078=>602,9079=>602, -9080=>602,9081=>602,9082=>602,9085=>602,9088=>602,9089=>602,9090=>602,9091=>602,9096=>602,9097=>602, -9098=>602,9099=>602,9109=>602,9115=>602,9116=>602,9117=>602,9118=>602,9119=>602,9120=>602,9121=>602, -9122=>602,9123=>602,9124=>602,9125=>602,9126=>602,9127=>602,9128=>602,9129=>602,9130=>602,9131=>602, -9132=>602,9133=>602,9134=>602,9166=>602,9167=>602,9251=>602,9472=>602,9473=>602,9474=>602,9475=>602, -9476=>602,9477=>602,9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602, -9486=>602,9487=>602,9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602, -9496=>602,9497=>602,9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602, -9506=>602,9507=>602,9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602, -9516=>602,9517=>602,9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602, -9526=>602,9527=>602,9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602, -9536=>602,9537=>602,9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602, -9546=>602,9547=>602,9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602, -9556=>602,9557=>602,9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602, -9566=>602,9567=>602,9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602, -9576=>602,9577=>602,9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602, -9586=>602,9587=>602,9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602, -9596=>602,9597=>602,9598=>602,9599=>602,9600=>602,9601=>602,9602=>602,9603=>602,9604=>602,9605=>602, -9606=>602,9607=>602,9608=>602,9609=>602,9610=>602,9611=>602,9612=>602,9613=>602,9614=>602,9615=>602, -9616=>602,9617=>602,9618=>602,9619=>602,9620=>602,9621=>602,9622=>602,9623=>602,9624=>602,9625=>602, -9626=>602,9627=>602,9628=>602,9629=>602,9630=>602,9631=>602,9632=>602,9633=>602,9634=>602,9635=>602, -9636=>602,9637=>602,9638=>602,9639=>602,9640=>602,9641=>602,9642=>602,9643=>602,9644=>602,9645=>602, -9646=>602,9647=>602,9648=>602,9649=>602,9650=>602,9651=>602,9652=>602,9653=>602,9654=>602,9655=>602, -9656=>602,9657=>602,9658=>602,9659=>602,9660=>602,9661=>602,9662=>602,9663=>602,9664=>602,9665=>602, -9666=>602,9667=>602,9668=>602,9669=>602,9670=>602,9671=>602,9672=>602,9673=>602,9674=>602,9675=>602, -9676=>602,9677=>602,9678=>602,9679=>602,9680=>602,9681=>602,9682=>602,9683=>602,9684=>602,9685=>602, -9686=>602,9687=>602,9688=>602,9689=>602,9690=>602,9691=>602,9692=>602,9693=>602,9694=>602,9695=>602, -9696=>602,9697=>602,9698=>602,9699=>602,9700=>602,9701=>602,9702=>602,9703=>602,9704=>602,9705=>602, -9706=>602,9707=>602,9708=>602,9709=>602,9710=>602,9711=>602,9712=>602,9713=>602,9714=>602,9715=>602, -9716=>602,9717=>602,9718=>602,9719=>602,9720=>602,9721=>602,9722=>602,9723=>602,9724=>602,9725=>602, -9726=>602,9727=>602,9728=>602,9729=>602,9730=>602,9731=>602,9732=>602,9733=>602,9734=>602,9735=>602, -9736=>602,9737=>602,9738=>602,9739=>602,9740=>602,9741=>602,9742=>602,9743=>602,9744=>602,9745=>602, -9746=>602,9747=>602,9748=>602,9749=>602,9750=>602,9751=>602,9752=>602,9753=>602,9754=>602,9755=>602, -9756=>602,9757=>602,9758=>602,9759=>602,9760=>602,9761=>602,9762=>602,9763=>602,9764=>602,9765=>602, -9766=>602,9767=>602,9768=>602,9769=>602,9770=>602,9771=>602,9772=>602,9773=>602,9774=>602,9775=>602, -9784=>602,9785=>602,9786=>602,9787=>602,9788=>602,9789=>602,9790=>602,9791=>602,9792=>602,9793=>602, -9794=>602,9795=>602,9796=>602,9797=>602,9798=>602,9799=>602,9800=>602,9801=>602,9802=>602,9803=>602, -9804=>602,9805=>602,9806=>602,9807=>602,9808=>602,9809=>602,9810=>602,9811=>602,9812=>602,9813=>602, -9814=>602,9815=>602,9816=>602,9817=>602,9818=>602,9819=>602,9820=>602,9821=>602,9822=>602,9823=>602, -9824=>602,9825=>602,9826=>602,9827=>602,9828=>602,9829=>602,9830=>602,9831=>602,9832=>602,9833=>602, -9834=>602,9835=>602,9836=>602,9837=>602,9838=>602,9839=>602,9840=>602,9841=>602,9842=>602,9843=>602, -9844=>602,9845=>602,9846=>602,9847=>602,9848=>602,9849=>602,9850=>602,9851=>602,9852=>602,9853=>602, -9854=>602,9855=>602,9856=>602,9857=>602,9858=>602,9859=>602,9860=>602,9861=>602,9862=>602,9863=>602, -9864=>602,9865=>602,9866=>602,9867=>602,9872=>602,9873=>602,9874=>602,9875=>602,9876=>602,9877=>602, -9878=>602,9879=>602,9880=>602,9881=>602,9882=>602,9883=>602,9884=>602,9888=>602,9889=>602,9904=>602, -9905=>602,9985=>602,9986=>602,9987=>602,9988=>602,9990=>602,9991=>602,9992=>602,9993=>602,9996=>602, -9997=>602,9998=>602,9999=>602,10000=>602,10001=>602,10002=>602,10003=>602,10004=>602,10005=>602,10006=>602, -10007=>602,10008=>602,10009=>602,10010=>602,10011=>602,10012=>602,10013=>602,10014=>602,10015=>602,10016=>602, -10017=>602,10018=>602,10019=>602,10020=>602,10021=>602,10022=>602,10023=>602,10025=>602,10026=>602,10027=>602, -10028=>602,10029=>602,10030=>602,10031=>602,10032=>602,10033=>602,10034=>602,10035=>602,10036=>602,10037=>602, -10038=>602,10039=>602,10040=>602,10041=>602,10042=>602,10043=>602,10044=>602,10045=>602,10046=>602,10047=>602, -10048=>602,10049=>602,10050=>602,10051=>602,10052=>602,10053=>602,10054=>602,10055=>602,10056=>602,10057=>602, -10058=>602,10059=>602,10061=>602,10063=>602,10064=>602,10065=>602,10066=>602,10070=>602,10072=>602,10073=>602, -10074=>602,10075=>602,10076=>602,10077=>602,10078=>602,10081=>602,10082=>602,10083=>602,10084=>602,10085=>602, -10086=>602,10087=>602,10088=>602,10089=>602,10090=>602,10091=>602,10092=>602,10093=>602,10094=>602,10095=>602, -10096=>602,10097=>602,10098=>602,10099=>602,10100=>602,10101=>602,10132=>602,10136=>602,10137=>602,10138=>602, -10139=>602,10140=>602,10141=>602,10142=>602,10143=>602,10144=>602,10145=>602,10146=>602,10147=>602,10148=>602, -10149=>602,10150=>602,10151=>602,10152=>602,10153=>602,10154=>602,10155=>602,10156=>602,10157=>602,10158=>602, -10159=>602,10161=>602,10162=>602,10163=>602,10164=>602,10165=>602,10166=>602,10167=>602,10168=>602,10169=>602, -10170=>602,10171=>602,10172=>602,10173=>602,10174=>602,10181=>602,10182=>602,10208=>602,10216=>602,10217=>602, -10731=>602,10746=>602,10747=>602,10799=>602,11026=>602,11027=>602,11028=>602,11029=>602,11030=>602,11031=>602, -11032=>602,11033=>602,11034=>602,11364=>602,11374=>602,11375=>602,11381=>602,11382=>602,11383=>602,11385=>602, -11386=>602,11388=>602,11389=>602,11800=>602,11810=>602,11811=>602,11812=>602,11813=>602,11822=>602,42760=>602, -42761=>602,42762=>602,42763=>602,42764=>602,42765=>602,42766=>602,42767=>602,42768=>602,42769=>602,42770=>602, -42771=>602,42772=>602,42773=>602,42774=>602,42779=>602,42780=>602,42781=>602,42782=>602,42783=>602,42790=>602, -42791=>602,42889=>602,42890=>602,42891=>602,42892=>602,63173=>602,64257=>602,64258=>602,64338=>602,64339=>602, -64340=>602,64341=>602,64342=>602,64343=>602,64344=>602,64345=>602,64346=>602,64347=>602,64348=>602,64349=>602, -64350=>602,64351=>602,64352=>602,64353=>602,64354=>602,64355=>602,64356=>602,64357=>602,64358=>602,64359=>602, -64360=>602,64361=>602,64362=>602,64363=>602,64364=>602,64365=>602,64366=>602,64367=>602,64368=>602,64369=>602, -64370=>602,64371=>602,64372=>602,64373=>602,64374=>602,64375=>602,64376=>602,64377=>602,64378=>602,64379=>602, -64380=>602,64381=>602,64382=>602,64383=>602,64384=>602,64385=>602,64394=>602,64395=>602,64396=>602,64397=>602, -64398=>602,64399=>602,64400=>602,64401=>602,64402=>602,64403=>602,64404=>602,64405=>602,64414=>602,64415=>602, -64426=>602,64427=>602,64428=>602,64429=>602,64488=>602,64489=>602,64508=>602,64509=>602,64510=>602,64511=>602, -65136=>602,65137=>602,65138=>602,65139=>602,65140=>602,65142=>602,65143=>602,65144=>602,65145=>602,65146=>602, -65147=>602,65148=>602,65149=>602,65150=>602,65151=>602,65152=>602,65153=>602,65154=>602,65155=>602,65156=>602, -65157=>602,65158=>602,65159=>602,65160=>602,65161=>602,65162=>602,65163=>602,65164=>602,65165=>602,65166=>602, -65167=>602,65168=>602,65169=>602,65170=>602,65171=>602,65172=>602,65173=>602,65174=>602,65175=>602,65176=>602, -65177=>602,65178=>602,65179=>602,65180=>602,65181=>602,65182=>602,65183=>602,65184=>602,65185=>602,65186=>602, -65187=>602,65188=>602,65189=>602,65190=>602,65191=>602,65192=>602,65193=>602,65194=>602,65195=>602,65196=>602, -65197=>602,65198=>602,65199=>602,65200=>602,65201=>602,65202=>602,65203=>602,65204=>602,65205=>602,65206=>602, -65207=>602,65208=>602,65209=>602,65210=>602,65211=>602,65212=>602,65213=>602,65214=>602,65215=>602,65216=>602, -65217=>602,65218=>602,65219=>602,65220=>602,65221=>602,65222=>602,65223=>602,65224=>602,65225=>602,65226=>602, -65227=>602,65228=>602,65229=>602,65230=>602,65231=>602,65232=>602,65233=>602,65234=>602,65235=>602,65236=>602, -65237=>602,65238=>602,65239=>602,65240=>602,65241=>602,65242=>602,65243=>602,65244=>602,65245=>602,65246=>602, -65247=>602,65248=>602,65249=>602,65250=>602,65251=>602,65252=>602,65253=>602,65254=>602,65255=>602,65256=>602, -65257=>602,65258=>602,65259=>602,65260=>602,65261=>602,65262=>602,65263=>602,65264=>602,65265=>602,65266=>602, -65267=>602,65268=>602,65269=>602,65270=>602,65271=>602,65272=>602,65273=>602,65274=>602,65275=>602,65276=>602, -65279=>602,65529=>602,65530=>602,65531=>602,65532=>602,65533=>602); -$enc=''; -$diff=''; -$file='dejavusansmono.z'; -$ctg='dejavusansmono.ctg.z'; -$originalsize=321524; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.z deleted file mode 100644 index 3b9ede1fc5..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmono.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.ctg.z deleted file mode 100644 index 0ce0dba4ca..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.php deleted file mode 100644 index a13bc838d4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.php +++ /dev/null @@ -1,307 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansMono-Bold'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>13,'Flags'=>33,'FontBBox'=>'[-446 -394 731 1052]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>602); -$up=-63; -$ut=44; -$dw=602; -$cw=array( -0=>602,32=>602,33=>602,34=>602,35=>602,36=>602,37=>602,38=>602,39=>602,40=>602, -41=>602,42=>602,43=>602,44=>602,45=>602,46=>602,47=>602,48=>602,49=>602,50=>602, -51=>602,52=>602,53=>602,54=>602,55=>602,56=>602,57=>602,58=>602,59=>602,60=>602, -61=>602,62=>602,63=>602,64=>602,65=>602,66=>602,67=>602,68=>602,69=>602,70=>602, -71=>602,72=>602,73=>602,74=>602,75=>602,76=>602,77=>602,78=>602,79=>602,80=>602, -81=>602,82=>602,83=>602,84=>602,85=>602,86=>602,87=>602,88=>602,89=>602,90=>602, -91=>602,92=>602,93=>602,94=>602,95=>602,96=>602,97=>602,98=>602,99=>602,100=>602, -101=>602,102=>602,103=>602,104=>602,105=>602,106=>602,107=>602,108=>602,109=>602,110=>602, -111=>602,112=>602,113=>602,114=>602,115=>602,116=>602,117=>602,118=>602,119=>602,120=>602, -121=>602,122=>602,123=>602,124=>602,125=>602,126=>602,8364=>602,8218=>602,402=>602,8222=>602, -8230=>602,8224=>602,8225=>602,710=>602,8240=>602,352=>602,8249=>602,338=>602,381=>602,8216=>602, -8217=>602,8220=>602,8221=>602,8226=>602,8211=>602,8212=>602,732=>602,8482=>602,353=>602,8250=>602, -339=>602,382=>602,376=>602,160=>602,161=>602,162=>602,163=>602,164=>602,165=>602,166=>602, -167=>602,168=>602,169=>602,170=>602,171=>602,172=>602,173=>602,174=>602,175=>602,176=>602, -177=>602,178=>602,179=>602,180=>602,181=>602,182=>602,183=>602,184=>602,185=>602,186=>602, -187=>602,188=>602,189=>602,190=>602,191=>602,192=>602,193=>602,194=>602,195=>602,196=>602, -197=>602,198=>602,199=>602,200=>602,201=>602,202=>602,203=>602,204=>602,205=>602,206=>602, -207=>602,208=>602,209=>602,210=>602,211=>602,212=>602,213=>602,214=>602,215=>602,216=>602, -217=>602,218=>602,219=>602,220=>602,221=>602,222=>602,223=>602,224=>602,225=>602,226=>602, -227=>602,228=>602,229=>602,230=>602,231=>602,232=>602,233=>602,234=>602,235=>602,236=>602, -237=>602,238=>602,239=>602,240=>602,241=>602,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>602,248=>602,249=>602,250=>602,251=>602,252=>602,253=>602,254=>602,255=>602,256=>602, -257=>602,258=>602,259=>602,260=>602,261=>602,262=>602,263=>602,264=>602,265=>602,266=>602, -267=>602,268=>602,269=>602,270=>602,271=>602,272=>602,273=>602,274=>602,275=>602,276=>602, -277=>602,278=>602,279=>602,280=>602,281=>602,282=>602,283=>602,284=>602,285=>602,286=>602, -287=>602,288=>602,289=>602,290=>602,291=>602,292=>602,293=>602,294=>602,295=>602,296=>602, -297=>602,298=>602,299=>602,300=>602,301=>602,302=>602,303=>602,304=>602,305=>602,306=>602, -307=>602,308=>602,309=>602,310=>602,311=>602,312=>602,313=>602,314=>602,315=>602,316=>602, -317=>602,318=>602,319=>602,320=>602,321=>602,322=>602,323=>602,324=>602,325=>602,326=>602, -327=>602,328=>602,329=>602,330=>602,331=>602,332=>602,333=>602,334=>602,335=>602,336=>602, -337=>602,340=>602,341=>602,342=>602,343=>602,344=>602,345=>602,346=>602,347=>602,348=>602, -349=>602,350=>602,351=>602,354=>602,355=>602,356=>602,357=>602,358=>602,359=>602,360=>602, -361=>602,362=>602,363=>602,364=>602,365=>602,366=>602,367=>602,368=>602,369=>602,370=>602, -371=>602,372=>602,373=>602,374=>602,375=>602,377=>602,378=>602,379=>602,380=>602,383=>602, -384=>602,385=>602,386=>602,387=>602,388=>602,389=>602,390=>602,391=>602,392=>602,393=>602, -394=>602,395=>602,396=>602,397=>602,398=>602,399=>602,400=>602,401=>602,403=>602,404=>602, -405=>602,406=>602,407=>602,408=>602,409=>602,410=>602,411=>602,412=>602,413=>602,414=>602, -415=>602,416=>602,417=>602,418=>602,419=>602,420=>602,421=>602,422=>602,423=>602,424=>602, -425=>602,426=>602,427=>602,428=>602,429=>602,430=>602,431=>602,432=>602,433=>602,434=>602, -435=>602,436=>602,437=>602,438=>602,439=>602,440=>602,441=>602,442=>602,443=>602,444=>602, -445=>602,446=>602,447=>602,448=>602,449=>602,450=>602,451=>602,461=>602,462=>602,463=>602, -464=>602,465=>602,466=>602,467=>602,468=>602,469=>602,470=>602,471=>602,472=>602,473=>602, -474=>602,475=>602,476=>602,477=>602,478=>602,479=>602,480=>602,481=>602,482=>602,483=>602, -486=>602,487=>602,488=>602,489=>602,490=>602,491=>602,492=>602,493=>602,494=>602,495=>602, -496=>602,500=>602,501=>602,502=>602,504=>602,505=>602,508=>602,509=>602,510=>602,511=>602, -512=>602,513=>602,514=>602,515=>602,516=>602,517=>602,518=>602,519=>602,520=>602,521=>602, -522=>602,523=>602,524=>602,525=>602,526=>602,527=>602,528=>602,529=>602,530=>602,531=>602, -532=>602,533=>602,534=>602,535=>602,536=>602,537=>602,538=>602,539=>602,540=>602,541=>602, -542=>602,543=>602,544=>602,545=>602,548=>602,549=>602,550=>602,551=>602,552=>602,553=>602, -554=>602,555=>602,556=>602,557=>602,558=>602,559=>602,560=>602,561=>602,562=>602,563=>602, -564=>602,565=>602,566=>602,567=>602,568=>602,569=>602,570=>602,571=>602,572=>602,573=>602, -574=>602,575=>602,576=>602,577=>602,580=>602,581=>602,588=>602,589=>602,592=>602,593=>602, -594=>602,595=>602,596=>602,597=>602,598=>602,599=>602,600=>602,601=>602,602=>602,603=>602, -604=>602,605=>602,606=>602,607=>602,608=>602,609=>602,610=>602,611=>602,612=>602,613=>602, -614=>602,615=>602,616=>602,617=>602,618=>602,619=>602,620=>602,621=>602,622=>602,623=>602, -624=>602,625=>602,626=>602,627=>602,628=>602,629=>602,630=>602,631=>602,632=>602,633=>602, -634=>602,635=>602,636=>602,637=>602,638=>602,639=>602,640=>602,641=>602,642=>602,643=>602, -644=>602,645=>602,646=>602,647=>602,648=>602,649=>602,650=>602,651=>602,652=>602,653=>602, -654=>602,655=>602,656=>602,657=>602,658=>602,659=>602,660=>602,661=>602,662=>602,663=>602, -664=>602,665=>602,666=>602,667=>602,668=>602,669=>602,670=>602,671=>602,672=>602,673=>602, -674=>602,675=>602,676=>602,677=>602,678=>602,679=>602,680=>602,681=>602,682=>602,683=>602, -684=>602,685=>602,686=>602,687=>602,688=>602,689=>602,690=>602,691=>602,692=>602,693=>602, -694=>602,695=>602,696=>602,697=>602,699=>602,700=>602,701=>602,702=>602,703=>602,704=>602, -705=>602,711=>602,712=>602,713=>602,716=>602,717=>602,720=>602,721=>602,722=>602,723=>602, -726=>602,727=>602,728=>602,729=>602,730=>602,731=>602,733=>602,734=>602,736=>602,737=>602, -738=>602,739=>602,740=>602,741=>602,742=>602,743=>602,744=>602,745=>602,750=>602,755=>602, -768=>602,769=>602,770=>602,771=>602,772=>602,773=>602,774=>602,775=>602,776=>602,777=>602, -778=>602,779=>602,780=>602,781=>602,782=>602,783=>602,784=>602,785=>602,786=>602,787=>602, -788=>602,789=>602,790=>602,791=>602,792=>602,793=>602,794=>602,795=>602,796=>602,797=>602, -798=>602,799=>602,800=>602,801=>602,802=>602,803=>602,804=>602,805=>602,806=>602,807=>602, -808=>602,809=>602,810=>602,811=>602,812=>602,813=>602,814=>602,815=>602,816=>602,817=>602, -818=>602,819=>602,820=>602,821=>602,822=>602,823=>602,824=>602,825=>602,826=>602,827=>602, -828=>602,829=>602,830=>602,831=>602,835=>602,856=>602,865=>602,884=>602,885=>602,890=>602, -894=>602,900=>602,901=>602,902=>602,903=>602,904=>602,905=>602,906=>602,908=>602,910=>602, -911=>602,912=>602,913=>602,914=>602,915=>602,916=>602,917=>602,918=>602,919=>602,920=>602, -921=>602,922=>602,923=>602,924=>602,925=>602,926=>602,927=>602,928=>602,929=>602,931=>602, -932=>602,933=>602,934=>602,935=>602,936=>602,937=>602,938=>602,939=>602,940=>602,941=>602, -942=>602,943=>602,944=>602,945=>602,946=>602,947=>602,948=>602,949=>602,950=>602,951=>602, -952=>602,953=>602,954=>602,955=>602,956=>602,957=>602,958=>602,959=>602,960=>602,961=>602, -962=>602,963=>602,964=>602,965=>602,966=>602,967=>602,968=>602,969=>602,970=>602,971=>602, -972=>602,973=>602,974=>602,976=>602,977=>602,978=>602,979=>602,980=>602,981=>602,982=>602, -983=>602,984=>602,985=>602,986=>602,987=>602,988=>602,989=>602,990=>602,991=>602,992=>602, -993=>602,1008=>602,1009=>602,1010=>602,1011=>602,1012=>602,1013=>602,1014=>602,1015=>602,1016=>602, -1017=>602,1018=>602,1019=>602,1020=>602,1021=>602,1022=>602,1023=>602,1024=>602,1025=>602,1026=>602, -1027=>602,1028=>602,1029=>602,1030=>602,1031=>602,1032=>602,1033=>602,1034=>602,1035=>602,1036=>602, -1037=>602,1038=>602,1039=>602,1040=>602,1041=>602,1042=>602,1043=>602,1044=>602,1045=>602,1046=>602, -1047=>602,1048=>602,1049=>602,1050=>602,1051=>602,1052=>602,1053=>602,1054=>602,1055=>602,1056=>602, -1057=>602,1058=>602,1059=>602,1060=>602,1061=>602,1062=>602,1063=>602,1064=>602,1065=>602,1066=>602, -1067=>602,1068=>602,1069=>602,1070=>602,1071=>602,1072=>602,1073=>602,1074=>602,1075=>602,1076=>602, -1077=>602,1078=>602,1079=>602,1080=>602,1081=>602,1082=>602,1083=>602,1084=>602,1085=>602,1086=>602, -1087=>602,1088=>602,1089=>602,1090=>602,1091=>602,1092=>602,1093=>602,1094=>602,1095=>602,1096=>602, -1097=>602,1098=>602,1099=>602,1100=>602,1101=>602,1102=>602,1103=>602,1104=>602,1105=>602,1106=>602, -1107=>602,1108=>602,1109=>602,1110=>602,1111=>602,1112=>602,1113=>602,1114=>602,1115=>602,1116=>602, -1117=>602,1118=>602,1119=>602,1122=>602,1123=>602,1138=>602,1139=>602,1168=>602,1169=>602,1170=>602, -1171=>602,1172=>602,1173=>602,1174=>602,1175=>602,1176=>602,1177=>602,1178=>602,1179=>602,1186=>602, -1187=>602,1194=>602,1195=>602,1196=>602,1197=>602,1198=>602,1199=>602,1200=>602,1201=>602,1202=>602, -1203=>602,1210=>602,1211=>602,1216=>602,1217=>602,1218=>602,1219=>602,1220=>602,1223=>602,1224=>602, -1227=>602,1228=>602,1231=>602,1232=>602,1233=>602,1234=>602,1235=>602,1236=>602,1237=>602,1238=>602, -1239=>602,1240=>602,1241=>602,1242=>602,1243=>602,1244=>602,1245=>602,1246=>602,1247=>602,1248=>602, -1249=>602,1250=>602,1251=>602,1252=>602,1253=>602,1254=>602,1255=>602,1256=>602,1257=>602,1258=>602, -1259=>602,1260=>602,1261=>602,1262=>602,1263=>602,1264=>602,1265=>602,1266=>602,1267=>602,1268=>602, -1269=>602,1270=>602,1271=>602,1272=>602,1273=>602,1296=>602,1297=>602,1306=>602,1307=>602,1308=>602, -1309=>602,1542=>602,1543=>602,1545=>602,1546=>602,1548=>602,1557=>602,1563=>602,1567=>602,1569=>602, -1570=>602,1571=>602,1572=>602,1573=>602,1574=>602,1575=>602,1576=>602,1577=>602,1578=>602,1579=>602, -1580=>602,1581=>602,1582=>602,1583=>602,1584=>602,1585=>602,1586=>602,1587=>602,1588=>602,1589=>602, -1590=>602,1591=>602,1592=>602,1593=>602,1594=>602,1600=>602,1601=>602,1602=>602,1603=>602,1604=>602, -1605=>602,1606=>602,1607=>602,1608=>602,1609=>602,1610=>602,1611=>602,1612=>602,1613=>602,1614=>602, -1615=>602,1616=>602,1617=>602,1618=>602,1619=>602,1620=>602,1621=>602,1626=>602,1632=>602,1633=>602, -1634=>602,1635=>602,1636=>602,1637=>602,1638=>602,1639=>602,1640=>602,1641=>602,1642=>602,1643=>602, -1644=>602,1645=>602,1652=>602,1657=>602,1658=>602,1659=>602,1662=>602,1663=>602,1664=>602,1667=>602, -1668=>602,1670=>602,1671=>602,1681=>602,1688=>602,1700=>602,1705=>602,1711=>602,1726=>602,1740=>602, -1776=>602,1777=>602,1778=>602,1779=>602,1780=>602,1781=>602,1782=>602,1783=>602,1784=>602,1785=>602, -3713=>602,3714=>602,3716=>602,3719=>602,3720=>602,3722=>602,3725=>602,3732=>602,3733=>602,3734=>602, -3735=>602,3737=>602,3738=>602,3739=>602,3740=>602,3741=>602,3742=>602,3743=>602,3745=>602,3746=>602, -3747=>602,3749=>602,3751=>602,3754=>602,3755=>602,3757=>602,3758=>602,3759=>602,3760=>602,3761=>602, -3762=>602,3763=>602,3764=>602,3765=>602,3766=>602,3767=>602,3768=>602,3769=>602,3771=>602,3772=>602, -3784=>602,3785=>602,3786=>602,3787=>602,3788=>602,3789=>602,4304=>602,4305=>602,4306=>602,4307=>602, -4308=>602,4309=>602,4310=>602,4311=>602,4312=>602,4313=>602,4314=>602,4315=>602,4316=>602,4317=>602, -4318=>602,4319=>602,4320=>602,4321=>602,4322=>602,4323=>602,4324=>602,4325=>602,4326=>602,4327=>602, -4328=>602,4329=>602,4330=>602,4331=>602,4332=>602,4333=>602,4334=>602,4335=>602,4336=>602,4337=>602, -4338=>602,4339=>602,4340=>602,4341=>602,4342=>602,4343=>602,4344=>602,4345=>602,4346=>602,4347=>602, -4348=>602,7426=>602,7432=>602,7433=>602,7444=>602,7446=>602,7447=>602,7453=>602,7454=>602,7455=>602, -7468=>602,7469=>602,7470=>602,7472=>602,7473=>602,7474=>602,7475=>602,7476=>602,7477=>602,7478=>602, -7479=>602,7480=>602,7481=>602,7482=>602,7483=>602,7484=>602,7486=>602,7487=>602,7488=>602,7489=>602, -7490=>602,7491=>602,7492=>602,7493=>602,7494=>602,7495=>602,7496=>602,7497=>602,7498=>602,7499=>602, -7500=>602,7501=>602,7502=>602,7503=>602,7504=>602,7505=>602,7506=>602,7507=>602,7508=>602,7509=>602, -7510=>602,7511=>602,7512=>602,7513=>602,7514=>602,7515=>602,7522=>602,7523=>602,7524=>602,7525=>602, -7543=>602,7544=>602,7547=>602,7557=>602,7579=>602,7580=>602,7581=>602,7582=>602,7583=>602,7584=>602, -7585=>602,7586=>602,7587=>602,7588=>602,7589=>602,7590=>602,7591=>602,7592=>602,7593=>602,7594=>602, -7595=>602,7596=>602,7597=>602,7598=>602,7599=>602,7600=>602,7601=>602,7602=>602,7603=>602,7604=>602, -7605=>602,7606=>602,7607=>602,7609=>602,7610=>602,7611=>602,7612=>602,7613=>602,7614=>602,7615=>602, -7680=>602,7681=>602,7682=>602,7683=>602,7684=>602,7685=>602,7686=>602,7687=>602,7688=>602,7689=>602, -7690=>602,7691=>602,7692=>602,7693=>602,7694=>602,7695=>602,7696=>602,7697=>602,7698=>602,7699=>602, -7704=>602,7705=>602,7706=>602,7707=>602,7708=>602,7709=>602,7710=>602,7711=>602,7712=>602,7713=>602, -7714=>602,7715=>602,7716=>602,7717=>602,7718=>602,7719=>602,7720=>602,7721=>602,7722=>602,7723=>602, -7724=>602,7725=>602,7728=>602,7729=>602,7730=>602,7731=>602,7732=>602,7733=>602,7734=>602,7735=>602, -7736=>602,7737=>602,7738=>602,7739=>602,7740=>602,7741=>602,7742=>602,7743=>602,7744=>602,7745=>602, -7746=>602,7747=>602,7748=>602,7749=>602,7750=>602,7751=>602,7752=>602,7753=>602,7754=>602,7755=>602, -7756=>602,7757=>602,7764=>602,7765=>602,7766=>602,7767=>602,7768=>602,7769=>602,7770=>602,7771=>602, -7772=>602,7773=>602,7774=>602,7775=>602,7776=>602,7777=>602,7778=>602,7779=>602,7784=>602,7785=>602, -7786=>602,7787=>602,7788=>602,7789=>602,7790=>602,7791=>602,7792=>602,7793=>602,7794=>602,7795=>602, -7796=>602,7797=>602,7798=>602,7799=>602,7800=>602,7801=>602,7804=>602,7805=>602,7806=>602,7807=>602, -7808=>602,7809=>602,7810=>602,7811=>602,7812=>602,7813=>602,7814=>602,7815=>602,7816=>602,7817=>602, -7818=>602,7819=>602,7820=>602,7821=>602,7822=>602,7823=>602,7824=>602,7825=>602,7826=>602,7827=>602, -7828=>602,7829=>602,7830=>602,7831=>602,7832=>602,7833=>602,7835=>602,7839=>602,7840=>602,7841=>602, -7852=>602,7853=>602,7856=>602,7857=>602,7862=>602,7863=>602,7864=>602,7865=>602,7868=>602,7869=>602, -7878=>602,7879=>602,7882=>602,7883=>602,7884=>602,7885=>602,7896=>602,7897=>602,7898=>602,7899=>602, -7900=>602,7901=>602,7904=>602,7905=>602,7906=>602,7907=>602,7908=>602,7909=>602,7912=>602,7913=>602, -7914=>602,7915=>602,7918=>602,7919=>602,7920=>602,7921=>602,7922=>602,7923=>602,7924=>602,7925=>602, -7928=>602,7929=>602,7936=>602,7937=>602,7938=>602,7939=>602,7940=>602,7941=>602,7942=>602,7943=>602, -7944=>602,7945=>602,7946=>602,7947=>602,7948=>602,7949=>602,7950=>602,7951=>602,7952=>602,7953=>602, -7954=>602,7955=>602,7956=>602,7957=>602,7960=>602,7961=>602,7962=>602,7963=>602,7964=>602,7965=>602, -7968=>602,7969=>602,7970=>602,7971=>602,7972=>602,7973=>602,7974=>602,7975=>602,7976=>602,7977=>602, -7978=>602,7979=>602,7980=>602,7981=>602,7982=>602,7983=>602,7984=>602,7985=>602,7986=>602,7987=>602, -7988=>602,7989=>602,7990=>602,7991=>602,7992=>602,7993=>602,7994=>602,7995=>602,7996=>602,7997=>602, -7998=>602,7999=>602,8000=>602,8001=>602,8002=>602,8003=>602,8004=>602,8005=>602,8008=>602,8009=>602, -8010=>602,8011=>602,8012=>602,8013=>602,8016=>602,8017=>602,8018=>602,8019=>602,8020=>602,8021=>602, -8022=>602,8023=>602,8025=>602,8027=>602,8029=>602,8031=>602,8032=>602,8033=>602,8034=>602,8035=>602, -8036=>602,8037=>602,8038=>602,8039=>602,8040=>602,8041=>602,8042=>602,8043=>602,8044=>602,8045=>602, -8046=>602,8047=>602,8048=>602,8049=>602,8050=>602,8051=>602,8052=>602,8053=>602,8054=>602,8055=>602, -8056=>602,8057=>602,8058=>602,8059=>602,8060=>602,8061=>602,8064=>602,8065=>602,8066=>602,8067=>602, -8068=>602,8069=>602,8070=>602,8071=>602,8072=>602,8073=>602,8074=>602,8075=>602,8076=>602,8077=>602, -8078=>602,8079=>602,8080=>602,8081=>602,8082=>602,8083=>602,8084=>602,8085=>602,8086=>602,8087=>602, -8088=>602,8089=>602,8090=>602,8091=>602,8092=>602,8093=>602,8094=>602,8095=>602,8096=>602,8097=>602, -8098=>602,8099=>602,8100=>602,8101=>602,8102=>602,8103=>602,8104=>602,8105=>602,8106=>602,8107=>602, -8108=>602,8109=>602,8110=>602,8111=>602,8112=>602,8113=>602,8114=>602,8115=>602,8116=>602,8118=>602, -8119=>602,8120=>602,8121=>602,8122=>602,8123=>602,8124=>602,8125=>602,8126=>602,8127=>602,8128=>602, -8129=>602,8130=>602,8131=>602,8132=>602,8134=>602,8135=>602,8136=>602,8137=>602,8138=>602,8139=>602, -8140=>602,8141=>602,8142=>602,8143=>602,8144=>602,8145=>602,8146=>602,8147=>602,8150=>602,8151=>602, -8152=>602,8153=>602,8154=>602,8155=>602,8157=>602,8158=>602,8159=>602,8160=>602,8161=>602,8162=>602, -8163=>602,8164=>602,8165=>602,8166=>602,8167=>602,8168=>602,8169=>602,8170=>602,8171=>602,8172=>602, -8173=>602,8174=>602,8175=>602,8178=>602,8179=>602,8180=>602,8182=>602,8183=>602,8184=>602,8185=>602, -8186=>602,8187=>602,8188=>602,8189=>602,8190=>602,8192=>602,8193=>602,8194=>602,8195=>602,8196=>602, -8197=>602,8198=>602,8199=>602,8200=>602,8201=>602,8202=>602,8208=>602,8209=>602,8210=>602,8213=>602, -8215=>602,8219=>602,8223=>602,8227=>602,8239=>602,8241=>602,8242=>602,8243=>602,8244=>602,8245=>602, -8246=>602,8247=>602,8252=>602,8253=>602,8254=>602,8261=>602,8262=>602,8263=>602,8264=>602,8265=>602, -8287=>602,8304=>602,8305=>602,8308=>602,8309=>602,8310=>602,8311=>602,8312=>602,8313=>602,8314=>602, -8315=>602,8316=>602,8317=>602,8318=>602,8319=>602,8320=>602,8321=>602,8322=>602,8323=>602,8324=>602, -8325=>602,8326=>602,8327=>602,8328=>602,8329=>602,8330=>602,8331=>602,8332=>602,8333=>602,8334=>602, -8336=>602,8337=>602,8338=>602,8339=>602,8340=>602,8352=>602,8353=>602,8354=>602,8355=>602,8356=>602, -8357=>602,8358=>602,8359=>602,8360=>602,8361=>602,8362=>602,8363=>602,8365=>602,8366=>602,8367=>602, -8368=>602,8369=>602,8370=>602,8371=>602,8372=>602,8373=>602,8450=>602,8453=>602,8461=>602,8462=>602, -8463=>602,8469=>602,8470=>602,8471=>602,8473=>602,8474=>602,8477=>602,8484=>602,8486=>602,8490=>602, -8491=>602,8494=>602,8531=>602,8532=>602,8533=>602,8534=>602,8535=>602,8536=>602,8537=>602,8538=>602, -8539=>602,8540=>602,8541=>602,8542=>602,8543=>602,8592=>602,8593=>602,8594=>602,8595=>602,8596=>602, -8597=>602,8598=>602,8599=>602,8600=>602,8601=>602,8602=>602,8603=>602,8604=>602,8605=>602,8606=>602, -8607=>602,8608=>602,8609=>602,8610=>602,8611=>602,8612=>602,8613=>602,8614=>602,8615=>602,8616=>602, -8617=>602,8618=>602,8619=>602,8620=>602,8621=>602,8622=>602,8623=>602,8624=>602,8625=>602,8626=>602, -8627=>602,8628=>602,8629=>602,8630=>602,8631=>602,8632=>602,8633=>602,8634=>602,8635=>602,8636=>602, -8637=>602,8638=>602,8639=>602,8640=>602,8641=>602,8642=>602,8643=>602,8644=>602,8645=>602,8646=>602, -8647=>602,8648=>602,8649=>602,8650=>602,8651=>602,8652=>602,8653=>602,8654=>602,8655=>602,8656=>602, -8657=>602,8658=>602,8659=>602,8660=>602,8661=>602,8662=>602,8663=>602,8664=>602,8665=>602,8666=>602, -8667=>602,8668=>602,8669=>602,8670=>602,8671=>602,8672=>602,8673=>602,8674=>602,8675=>602,8676=>602, -8677=>602,8678=>602,8679=>602,8680=>602,8681=>602,8682=>602,8683=>602,8684=>602,8685=>602,8686=>602, -8687=>602,8688=>602,8689=>602,8690=>602,8691=>602,8692=>602,8693=>602,8694=>602,8695=>602,8696=>602, -8697=>602,8698=>602,8699=>602,8700=>602,8701=>602,8702=>602,8703=>602,8704=>602,8705=>602,8706=>602, -8707=>602,8708=>602,8709=>602,8710=>602,8711=>602,8712=>602,8713=>602,8714=>602,8715=>602,8716=>602, -8717=>602,8719=>602,8721=>602,8722=>602,8723=>602,8725=>602,8727=>602,8728=>602,8729=>602,8730=>602, -8731=>602,8732=>602,8733=>602,8734=>602,8735=>602,8736=>602,8743=>602,8744=>602,8745=>602,8746=>602, -8747=>602,8748=>602,8749=>602,8760=>602,8761=>602,8762=>602,8763=>602,8764=>602,8765=>602,8769=>602, -8770=>602,8771=>602,8772=>602,8773=>602,8774=>602,8775=>602,8776=>602,8777=>602,8778=>602,8779=>602, -8780=>602,8781=>602,8782=>602,8783=>602,8784=>602,8785=>602,8786=>602,8787=>602,8788=>602,8789=>602, -8790=>602,8791=>602,8792=>602,8793=>602,8794=>602,8795=>602,8796=>602,8797=>602,8798=>602,8799=>602, -8800=>602,8801=>602,8802=>602,8803=>602,8804=>602,8805=>602,8806=>602,8807=>602,8808=>602,8809=>602, -8813=>602,8814=>602,8815=>602,8816=>602,8817=>602,8818=>602,8819=>602,8820=>602,8821=>602,8822=>602, -8823=>602,8824=>602,8825=>602,8826=>602,8827=>602,8828=>602,8829=>602,8830=>602,8831=>602,8832=>602, -8833=>602,8834=>602,8835=>602,8836=>602,8837=>602,8838=>602,8839=>602,8840=>602,8841=>602,8842=>602, -8843=>602,8847=>602,8848=>602,8849=>602,8850=>602,8853=>602,8854=>602,8855=>602,8856=>602,8857=>602, -8858=>602,8859=>602,8860=>602,8861=>602,8862=>602,8863=>602,8864=>602,8865=>602,8901=>602,8902=>602, -8909=>602,8922=>602,8923=>602,8924=>602,8925=>602,8926=>602,8927=>602,8928=>602,8929=>602,8930=>602, -8931=>602,8932=>602,8933=>602,8934=>602,8935=>602,8936=>602,8937=>602,8943=>602,8960=>602,8961=>602, -8962=>602,8963=>602,8964=>602,8965=>602,8966=>602,8968=>602,8969=>602,8970=>602,8971=>602,8972=>602, -8973=>602,8974=>602,8975=>602,8976=>602,8977=>602,8978=>602,8979=>602,8980=>602,8981=>602,8984=>602, -8985=>602,8988=>602,8989=>602,8990=>602,8991=>602,8992=>602,8993=>602,8997=>602,8998=>602,8999=>602, -9000=>602,9003=>602,9013=>602,9015=>602,9016=>602,9017=>602,9018=>602,9019=>602,9020=>602,9021=>602, -9022=>602,9025=>602,9026=>602,9027=>602,9028=>602,9031=>602,9032=>602,9033=>602,9035=>602,9036=>602, -9037=>602,9040=>602,9042=>602,9043=>602,9044=>602,9047=>602,9048=>602,9049=>602,9050=>602,9051=>602, -9052=>602,9054=>602,9055=>602,9056=>602,9059=>602,9060=>602,9061=>602,9064=>602,9065=>602,9067=>602, -9068=>602,9069=>602,9070=>602,9071=>602,9072=>602,9075=>602,9076=>602,9077=>602,9078=>602,9079=>602, -9080=>602,9081=>602,9082=>602,9085=>602,9088=>602,9089=>602,9090=>602,9091=>602,9096=>602,9097=>602, -9098=>602,9099=>602,9109=>602,9115=>602,9116=>602,9117=>602,9118=>602,9119=>602,9120=>602,9121=>602, -9122=>602,9123=>602,9124=>602,9125=>602,9126=>602,9127=>602,9128=>602,9129=>602,9130=>602,9131=>602, -9132=>602,9133=>602,9134=>602,9166=>602,9167=>602,9251=>602,9600=>602,9601=>602,9602=>602,9603=>602, -9604=>602,9605=>602,9606=>602,9607=>602,9608=>602,9609=>602,9610=>602,9611=>602,9612=>602,9613=>602, -9614=>602,9615=>602,9616=>602,9617=>602,9618=>602,9619=>602,9620=>602,9621=>602,9622=>602,9623=>602, -9624=>602,9625=>602,9626=>602,9627=>602,9628=>602,9629=>602,9630=>602,9631=>602,9632=>602,9633=>602, -9634=>602,9635=>602,9636=>602,9637=>602,9638=>602,9639=>602,9640=>602,9641=>602,9642=>602,9643=>602, -9644=>602,9645=>602,9646=>602,9647=>602,9648=>602,9649=>602,9650=>602,9651=>602,9652=>602,9653=>602, -9654=>602,9655=>602,9656=>602,9657=>602,9658=>602,9659=>602,9660=>602,9661=>602,9662=>602,9663=>602, -9664=>602,9665=>602,9666=>602,9667=>602,9668=>602,9669=>602,9670=>602,9671=>602,9672=>602,9673=>602, -9674=>602,9675=>602,9676=>602,9677=>602,9678=>602,9679=>602,9680=>602,9681=>602,9682=>602,9683=>602, -9684=>602,9685=>602,9686=>602,9687=>602,9688=>602,9689=>602,9690=>602,9691=>602,9692=>602,9693=>602, -9694=>602,9695=>602,9696=>602,9697=>602,9698=>602,9699=>602,9700=>602,9701=>602,9702=>602,9703=>602, -9704=>602,9705=>602,9706=>602,9707=>602,9708=>602,9709=>602,9710=>602,9711=>602,9712=>602,9713=>602, -9714=>602,9715=>602,9716=>602,9717=>602,9718=>602,9719=>602,9720=>602,9721=>602,9722=>602,9723=>602, -9724=>602,9725=>602,9726=>602,9727=>602,9728=>602,9729=>602,9730=>602,9731=>602,9732=>602,9733=>602, -9734=>602,9735=>602,9736=>602,9737=>602,9738=>602,9739=>602,9740=>602,9741=>602,9742=>602,9743=>602, -9744=>602,9745=>602,9746=>602,9747=>602,9748=>602,9749=>602,9750=>602,9751=>602,9752=>602,9753=>602, -9754=>602,9755=>602,9756=>602,9757=>602,9758=>602,9759=>602,9760=>602,9761=>602,9762=>602,9763=>602, -9764=>602,9765=>602,9766=>602,9767=>602,9768=>602,9769=>602,9770=>602,9771=>602,9772=>602,9773=>602, -9774=>602,9775=>602,9784=>602,9785=>602,9786=>602,9787=>602,9788=>602,9789=>602,9790=>602,9791=>602, -9792=>602,9793=>602,9794=>602,9795=>602,9796=>602,9797=>602,9798=>602,9799=>602,9800=>602,9801=>602, -9802=>602,9803=>602,9804=>602,9805=>602,9806=>602,9807=>602,9808=>602,9809=>602,9810=>602,9811=>602, -9812=>602,9813=>602,9814=>602,9815=>602,9816=>602,9817=>602,9818=>602,9819=>602,9820=>602,9821=>602, -9822=>602,9823=>602,9824=>602,9825=>602,9826=>602,9827=>602,9828=>602,9829=>602,9830=>602,9831=>602, -9832=>602,9833=>602,9834=>602,9835=>602,9836=>602,9837=>602,9838=>602,9839=>602,9840=>602,9841=>602, -9842=>602,9843=>602,9844=>602,9845=>602,9846=>602,9847=>602,9848=>602,9849=>602,9850=>602,9851=>602, -9852=>602,9853=>602,9854=>602,9855=>602,9856=>602,9857=>602,9858=>602,9859=>602,9860=>602,9861=>602, -9862=>602,9863=>602,9864=>602,9865=>602,9866=>602,9867=>602,9872=>602,9873=>602,9874=>602,9875=>602, -9876=>602,9877=>602,9878=>602,9879=>602,9880=>602,9881=>602,9882=>602,9883=>602,9884=>602,9888=>602, -9889=>602,9904=>602,9905=>602,9985=>602,9986=>602,9987=>602,9988=>602,9990=>602,9991=>602,9992=>602, -9993=>602,9996=>602,9997=>602,9998=>602,9999=>602,10000=>602,10001=>602,10002=>602,10003=>602,10004=>602, -10005=>602,10006=>602,10007=>602,10008=>602,10009=>602,10010=>602,10011=>602,10012=>602,10013=>602,10014=>602, -10015=>602,10016=>602,10017=>602,10018=>602,10019=>602,10020=>602,10021=>602,10022=>602,10023=>602,10025=>602, -10026=>602,10027=>602,10028=>602,10029=>602,10030=>602,10031=>602,10032=>602,10033=>602,10034=>602,10035=>602, -10036=>602,10037=>602,10038=>602,10039=>602,10040=>602,10041=>602,10042=>602,10043=>602,10044=>602,10045=>602, -10046=>602,10047=>602,10048=>602,10049=>602,10050=>602,10051=>602,10052=>602,10053=>602,10054=>602,10055=>602, -10056=>602,10057=>602,10058=>602,10059=>602,10061=>602,10063=>602,10064=>602,10065=>602,10066=>602,10070=>602, -10072=>602,10073=>602,10074=>602,10075=>602,10076=>602,10077=>602,10078=>602,10081=>602,10082=>602,10083=>602, -10084=>602,10085=>602,10086=>602,10087=>602,10088=>602,10089=>602,10090=>602,10091=>602,10092=>602,10093=>602, -10094=>602,10095=>602,10096=>602,10097=>602,10098=>602,10099=>602,10100=>602,10101=>602,10132=>602,10136=>602, -10137=>602,10138=>602,10139=>602,10140=>602,10141=>602,10142=>602,10143=>602,10144=>602,10145=>602,10146=>602, -10147=>602,10148=>602,10149=>602,10150=>602,10151=>602,10152=>602,10153=>602,10154=>602,10155=>602,10156=>602, -10157=>602,10158=>602,10159=>602,10161=>602,10162=>602,10163=>602,10164=>602,10165=>602,10166=>602,10167=>602, -10168=>602,10169=>602,10170=>602,10171=>602,10172=>602,10173=>602,10174=>602,10175=>602,10181=>602,10182=>602, -10208=>602,10216=>602,10217=>602,10731=>602,10746=>602,10747=>602,10799=>602,11026=>602,11027=>602,11028=>602, -11029=>602,11030=>602,11031=>602,11032=>602,11033=>602,11034=>602,11364=>602,11374=>602,11375=>602,11381=>602, -11382=>602,11383=>602,11385=>602,11386=>602,11388=>602,11389=>602,11800=>602,11810=>602,11811=>602,11812=>602, -11813=>602,11822=>602,42760=>602,42761=>602,42762=>602,42763=>602,42764=>602,42765=>602,42766=>602,42767=>602, -42768=>602,42769=>602,42770=>602,42771=>602,42772=>602,42773=>602,42774=>602,42779=>602,42780=>602,42781=>602, -42782=>602,42783=>602,42790=>602,42791=>602,42889=>602,42890=>602,42891=>602,42892=>602,63173=>602,64257=>602, -64258=>602,64338=>602,64339=>602,64340=>602,64341=>602,64342=>602,64343=>602,64344=>602,64345=>602,64346=>602, -64347=>602,64348=>602,64349=>602,64350=>602,64351=>602,64352=>602,64353=>602,64354=>602,64355=>602,64356=>602, -64357=>602,64358=>602,64359=>602,64360=>602,64361=>602,64362=>602,64363=>602,64364=>602,64365=>602,64366=>602, -64367=>602,64368=>602,64369=>602,64370=>602,64371=>602,64372=>602,64373=>602,64374=>602,64375=>602,64376=>602, -64377=>602,64378=>602,64379=>602,64380=>602,64381=>602,64382=>602,64383=>602,64384=>602,64385=>602,64394=>602, -64395=>602,64396=>602,64397=>602,64398=>602,64399=>602,64400=>602,64401=>602,64402=>602,64403=>602,64404=>602, -64405=>602,64414=>602,64415=>602,64426=>602,64427=>602,64428=>602,64429=>602,64488=>602,64489=>602,64508=>602, -64509=>602,64510=>602,64511=>602,65136=>602,65137=>602,65138=>602,65139=>602,65140=>602,65142=>602,65143=>602, -65144=>602,65145=>602,65146=>602,65147=>602,65148=>602,65149=>602,65150=>602,65151=>602,65152=>602,65153=>602, -65154=>602,65155=>602,65156=>602,65157=>602,65158=>602,65159=>602,65160=>602,65161=>602,65162=>602,65163=>602, -65164=>602,65165=>602,65166=>602,65167=>602,65168=>602,65169=>602,65170=>602,65171=>602,65172=>602,65173=>602, -65174=>602,65175=>602,65176=>602,65177=>602,65178=>602,65179=>602,65180=>602,65181=>602,65182=>602,65183=>602, -65184=>602,65185=>602,65186=>602,65187=>602,65188=>602,65189=>602,65190=>602,65191=>602,65192=>602,65193=>602, -65194=>602,65195=>602,65196=>602,65197=>602,65198=>602,65199=>602,65200=>602,65201=>602,65202=>602,65203=>602, -65204=>602,65205=>602,65206=>602,65207=>602,65208=>602,65209=>602,65210=>602,65211=>602,65212=>602,65213=>602, -65214=>602,65215=>602,65216=>602,65217=>602,65218=>602,65219=>602,65220=>602,65221=>602,65222=>602,65223=>602, -65224=>602,65225=>602,65226=>602,65227=>602,65228=>602,65229=>602,65230=>602,65231=>602,65232=>602,65233=>602, -65234=>602,65235=>602,65236=>602,65237=>602,65238=>602,65239=>602,65240=>602,65241=>602,65242=>602,65243=>602, -65244=>602,65245=>602,65246=>602,65247=>602,65248=>602,65249=>602,65250=>602,65251=>602,65252=>602,65253=>602, -65254=>602,65255=>602,65256=>602,65257=>602,65258=>602,65259=>602,65260=>602,65261=>602,65262=>602,65263=>602, -65264=>602,65265=>602,65266=>602,65267=>602,65268=>602,65269=>602,65270=>602,65271=>602,65272=>602,65273=>602, -65274=>602,65275=>602,65276=>602,65279=>602,65529=>602,65530=>602,65531=>602,65532=>602,65533=>602); -$enc=''; -$diff=''; -$file='dejavusansmonob.z'; -$ctg='dejavusansmonob.ctg.z'; -$originalsize=301928; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.z deleted file mode 100644 index e98cacb2ed..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonob.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.ctg.z deleted file mode 100644 index 42e7503edb..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.php deleted file mode 100644 index b1b57b3791..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.php +++ /dev/null @@ -1,250 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansMono-BoldOblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-70,'Flags'=>97,'FontBBox'=>'[-428 -394 808 1053]','ItalicAngle'=>-11,'StemV'=>120,'MissingWidth'=>602); -$up=-63; -$ut=44; -$dw=602; -$cw=array( -0=>602,32=>602,33=>602,34=>602,35=>602,36=>602,37=>602,38=>602,39=>602,40=>602, -41=>602,42=>602,43=>602,44=>602,45=>602,46=>602,47=>602,48=>602,49=>602,50=>602, -51=>602,52=>602,53=>602,54=>602,55=>602,56=>602,57=>602,58=>602,59=>602,60=>602, -61=>602,62=>602,63=>602,64=>602,65=>602,66=>602,67=>602,68=>602,69=>602,70=>602, -71=>602,72=>602,73=>602,74=>602,75=>602,76=>602,77=>602,78=>602,79=>602,80=>602, -81=>602,82=>602,83=>602,84=>602,85=>602,86=>602,87=>602,88=>602,89=>602,90=>602, -91=>602,92=>602,93=>602,94=>602,95=>602,96=>602,97=>602,98=>602,99=>602,100=>602, -101=>602,102=>602,103=>602,104=>602,105=>602,106=>602,107=>602,108=>602,109=>602,110=>602, -111=>602,112=>602,113=>602,114=>602,115=>602,116=>602,117=>602,118=>602,119=>602,120=>602, -121=>602,122=>602,123=>602,124=>602,125=>602,126=>602,8364=>602,8218=>602,402=>602,8222=>602, -8230=>602,8224=>602,8225=>602,710=>602,8240=>602,352=>602,8249=>602,338=>602,381=>602,8216=>602, -8217=>602,8220=>602,8221=>602,8226=>602,8211=>602,8212=>602,732=>602,8482=>602,353=>602,8250=>602, -339=>602,382=>602,376=>602,160=>602,161=>602,162=>602,163=>602,164=>602,165=>602,166=>602, -167=>602,168=>602,169=>602,170=>602,171=>602,172=>602,173=>602,174=>602,175=>602,176=>602, -177=>602,178=>602,179=>602,180=>602,181=>602,182=>602,183=>602,184=>602,185=>602,186=>602, -187=>602,188=>602,189=>602,190=>602,191=>602,192=>602,193=>602,194=>602,195=>602,196=>602, -197=>602,198=>602,199=>602,200=>602,201=>602,202=>602,203=>602,204=>602,205=>602,206=>602, -207=>602,208=>602,209=>602,210=>602,211=>602,212=>602,213=>602,214=>602,215=>602,216=>602, -217=>602,218=>602,219=>602,220=>602,221=>602,222=>602,223=>602,224=>602,225=>602,226=>602, -227=>602,228=>602,229=>602,230=>602,231=>602,232=>602,233=>602,234=>602,235=>602,236=>602, -237=>602,238=>602,239=>602,240=>602,241=>602,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>602,248=>602,249=>602,250=>602,251=>602,252=>602,253=>602,254=>602,255=>602,256=>602, -257=>602,258=>602,259=>602,260=>602,261=>602,262=>602,263=>602,264=>602,265=>602,266=>602, -267=>602,268=>602,269=>602,270=>602,271=>602,272=>602,273=>602,274=>602,275=>602,276=>602, -277=>602,278=>602,279=>602,280=>602,281=>602,282=>602,283=>602,284=>602,285=>602,286=>602, -287=>602,288=>602,289=>602,290=>602,291=>602,292=>602,293=>602,294=>602,295=>602,296=>602, -297=>602,298=>602,299=>602,300=>602,301=>602,302=>602,303=>602,304=>602,305=>602,306=>602, -307=>602,308=>602,309=>602,310=>602,311=>602,312=>602,313=>602,314=>602,315=>602,316=>602, -317=>602,318=>602,319=>602,320=>602,321=>602,322=>602,323=>602,324=>602,325=>602,326=>602, -327=>602,328=>602,329=>602,330=>602,331=>602,332=>602,333=>602,334=>602,335=>602,336=>602, -337=>602,340=>602,341=>602,342=>602,343=>602,344=>602,345=>602,346=>602,347=>602,348=>602, -349=>602,350=>602,351=>602,354=>602,355=>602,356=>602,357=>602,358=>602,359=>602,360=>602, -361=>602,362=>602,363=>602,364=>602,365=>602,366=>602,367=>602,368=>602,369=>602,370=>602, -371=>602,372=>602,373=>602,374=>602,375=>602,377=>602,378=>602,379=>602,380=>602,383=>602, -384=>602,385=>602,386=>602,387=>602,388=>602,389=>602,390=>602,391=>602,392=>602,393=>602, -394=>602,395=>602,396=>602,397=>602,398=>602,399=>602,400=>602,401=>602,403=>602,404=>602, -405=>602,406=>602,407=>602,408=>602,409=>602,410=>602,411=>602,412=>602,413=>602,414=>602, -415=>602,416=>602,417=>602,418=>602,419=>602,420=>602,421=>602,422=>602,423=>602,424=>602, -425=>602,426=>602,427=>602,428=>602,429=>602,430=>602,431=>602,432=>602,433=>602,434=>602, -435=>602,436=>602,437=>602,438=>602,439=>602,440=>602,441=>602,442=>602,443=>602,444=>602, -445=>602,446=>602,447=>602,448=>602,449=>602,450=>602,451=>602,461=>602,462=>602,463=>602, -464=>602,465=>602,466=>602,467=>602,468=>602,469=>602,470=>602,471=>602,472=>602,473=>602, -474=>602,475=>602,476=>602,477=>602,478=>602,479=>602,480=>602,481=>602,482=>602,483=>602, -486=>602,487=>602,488=>602,489=>602,490=>602,491=>602,492=>602,493=>602,494=>602,495=>602, -500=>602,501=>602,502=>602,504=>602,505=>602,508=>602,509=>602,510=>602,511=>602,512=>602, -513=>602,514=>602,515=>602,516=>602,517=>602,518=>602,519=>602,520=>602,521=>602,522=>602, -523=>602,524=>602,525=>602,526=>602,527=>602,528=>602,529=>602,530=>602,531=>602,532=>602, -533=>602,534=>602,535=>602,536=>602,537=>602,538=>602,539=>602,540=>602,541=>602,542=>602, -543=>602,545=>602,548=>602,549=>602,550=>602,551=>602,552=>602,553=>602,554=>602,555=>602, -556=>602,557=>602,558=>602,559=>602,560=>602,561=>602,562=>602,563=>602,564=>602,565=>602, -566=>602,567=>602,568=>602,569=>602,570=>602,571=>602,572=>602,573=>602,574=>602,575=>602, -576=>602,577=>602,580=>602,581=>602,588=>602,589=>602,592=>602,593=>602,594=>602,595=>602, -596=>602,597=>602,598=>602,599=>602,600=>602,601=>602,602=>602,603=>602,604=>602,605=>602, -606=>602,607=>602,608=>602,609=>602,610=>602,611=>602,612=>602,613=>602,614=>602,615=>602, -616=>602,617=>602,618=>602,619=>602,620=>602,621=>602,622=>602,623=>602,624=>602,625=>602, -626=>602,627=>602,628=>602,629=>602,630=>602,631=>602,632=>602,633=>602,634=>602,635=>602, -636=>602,637=>602,638=>602,639=>602,640=>602,641=>602,642=>602,643=>602,644=>602,645=>602, -646=>602,647=>602,648=>602,649=>602,650=>602,651=>602,652=>602,653=>602,654=>602,655=>602, -656=>602,657=>602,658=>602,659=>602,660=>602,661=>602,662=>602,663=>602,664=>602,665=>602, -666=>602,667=>602,668=>602,669=>602,670=>602,671=>602,672=>602,673=>602,674=>602,675=>602, -676=>602,677=>602,678=>602,679=>602,680=>602,681=>602,682=>602,683=>602,684=>602,685=>602, -686=>602,687=>602,688=>602,689=>602,690=>602,691=>602,692=>602,693=>602,694=>602,695=>602, -696=>602,697=>602,699=>602,700=>602,701=>602,702=>602,703=>602,704=>602,705=>602,711=>602, -712=>602,713=>602,716=>602,717=>602,720=>602,721=>602,722=>602,723=>602,726=>602,727=>602, -728=>602,729=>602,730=>602,731=>602,733=>602,734=>602,736=>602,737=>602,738=>602,739=>602, -740=>602,741=>602,742=>602,743=>602,744=>602,745=>602,750=>602,755=>602,768=>602,769=>602, -770=>602,771=>602,772=>602,773=>602,774=>602,775=>602,776=>602,777=>602,778=>602,779=>602, -780=>602,781=>602,782=>602,783=>602,784=>602,785=>602,786=>602,787=>602,788=>602,789=>602, -790=>602,791=>602,792=>602,793=>602,794=>602,795=>602,796=>602,797=>602,798=>602,799=>602, -800=>602,801=>602,802=>602,803=>602,804=>602,805=>602,806=>602,807=>602,808=>602,809=>602, -810=>602,811=>602,812=>602,813=>602,814=>602,815=>602,816=>602,817=>602,818=>602,819=>602, -820=>602,821=>602,822=>602,823=>602,824=>602,825=>602,826=>602,827=>602,828=>602,829=>602, -830=>602,831=>602,835=>602,856=>602,865=>602,884=>602,885=>602,890=>602,894=>602,900=>602, -901=>602,902=>602,903=>602,904=>602,905=>602,906=>602,908=>602,910=>602,911=>602,912=>602, -913=>602,914=>602,915=>602,916=>602,917=>602,918=>602,919=>602,920=>602,921=>602,922=>602, -923=>602,924=>602,925=>602,926=>602,927=>602,928=>602,929=>602,931=>602,932=>602,933=>602, -934=>602,935=>602,936=>602,937=>602,938=>602,939=>602,940=>602,941=>602,942=>602,943=>602, -944=>602,945=>602,946=>602,947=>602,948=>602,949=>602,950=>602,951=>602,952=>602,953=>602, -954=>602,955=>602,956=>602,957=>602,958=>602,959=>602,960=>602,961=>602,962=>602,963=>602, -964=>602,965=>602,966=>602,967=>602,968=>602,969=>602,970=>602,971=>602,972=>602,973=>602, -974=>602,976=>602,977=>602,978=>602,979=>602,980=>602,981=>602,982=>602,983=>602,984=>602, -985=>602,986=>602,987=>602,988=>602,989=>602,990=>602,991=>602,992=>602,993=>602,1008=>602, -1009=>602,1010=>602,1011=>602,1012=>602,1013=>602,1014=>602,1015=>602,1016=>602,1017=>602,1018=>602, -1019=>602,1020=>602,1021=>602,1022=>602,1023=>602,1024=>602,1025=>602,1026=>602,1027=>602,1028=>602, -1029=>602,1030=>602,1031=>602,1032=>602,1033=>602,1034=>602,1035=>602,1036=>602,1037=>602,1038=>602, -1039=>602,1040=>602,1041=>602,1042=>602,1043=>602,1044=>602,1045=>602,1046=>602,1047=>602,1048=>602, -1049=>602,1050=>602,1051=>602,1052=>602,1053=>602,1054=>602,1055=>602,1056=>602,1057=>602,1058=>602, -1059=>602,1060=>602,1061=>602,1062=>602,1063=>602,1064=>602,1065=>602,1066=>602,1067=>602,1068=>602, -1069=>602,1070=>602,1071=>602,1072=>602,1073=>602,1074=>602,1075=>602,1076=>602,1077=>602,1078=>602, -1079=>602,1080=>602,1081=>602,1082=>602,1083=>602,1084=>602,1085=>602,1086=>602,1087=>602,1088=>602, -1089=>602,1090=>602,1091=>602,1092=>602,1093=>602,1094=>602,1095=>602,1096=>602,1097=>602,1098=>602, -1099=>602,1100=>602,1101=>602,1102=>602,1103=>602,1104=>602,1105=>602,1106=>602,1107=>602,1108=>602, -1109=>602,1110=>602,1111=>602,1112=>602,1113=>602,1114=>602,1115=>602,1116=>602,1117=>602,1118=>602, -1119=>602,1122=>602,1123=>602,1138=>602,1139=>602,1168=>602,1169=>602,1170=>602,1171=>602,1172=>602, -1173=>602,1174=>602,1175=>602,1176=>602,1177=>602,1178=>602,1179=>602,1186=>602,1187=>602,1194=>602, -1195=>602,1196=>602,1197=>602,1198=>602,1199=>602,1200=>602,1201=>602,1202=>602,1203=>602,1210=>602, -1211=>602,1216=>602,1217=>602,1218=>602,1219=>602,1220=>602,1223=>602,1224=>602,1227=>602,1228=>602, -1231=>602,1232=>602,1233=>602,1234=>602,1235=>602,1236=>602,1237=>602,1238=>602,1239=>602,1240=>602, -1241=>602,1242=>602,1243=>602,1244=>602,1245=>602,1246=>602,1247=>602,1248=>602,1249=>602,1250=>602, -1251=>602,1252=>602,1253=>602,1254=>602,1255=>602,1256=>602,1257=>602,1258=>602,1259=>602,1260=>602, -1261=>602,1262=>602,1263=>602,1264=>602,1265=>602,1266=>602,1267=>602,1268=>602,1269=>602,1270=>602, -1271=>602,1272=>602,1273=>602,1296=>602,1297=>602,1306=>602,1307=>602,1308=>602,1309=>602,3713=>602, -3714=>602,3716=>602,3719=>602,3720=>602,3722=>602,3725=>602,3732=>602,3733=>602,3734=>602,3735=>602, -3737=>602,3738=>602,3739=>602,3740=>602,3741=>602,3742=>602,3743=>602,3745=>602,3746=>602,3747=>602, -3749=>602,3751=>602,3754=>602,3755=>602,3757=>602,3758=>602,3759=>602,3760=>602,3761=>602,3762=>602, -3763=>602,3764=>602,3765=>602,3766=>602,3767=>602,3768=>602,3769=>602,3771=>602,3772=>602,3784=>602, -3785=>602,3786=>602,3787=>602,3788=>602,3789=>602,4304=>602,4305=>602,4306=>602,4307=>602,4308=>602, -4309=>602,4310=>602,4311=>602,4312=>602,4313=>602,4314=>602,4315=>602,4316=>602,4317=>602,4318=>602, -4319=>602,4320=>602,4321=>602,4322=>602,4323=>602,4324=>602,4325=>602,4326=>602,4327=>602,4328=>602, -4329=>602,4330=>602,4331=>602,4332=>602,4333=>602,4334=>602,4335=>602,4336=>602,4337=>602,4338=>602, -4339=>602,4340=>602,4341=>602,4342=>602,4343=>602,4344=>602,4345=>602,4346=>602,4347=>602,4348=>602, -7426=>602,7432=>602,7433=>602,7444=>602,7446=>602,7447=>602,7453=>602,7454=>602,7455=>602,7468=>602, -7469=>602,7470=>602,7472=>602,7473=>602,7474=>602,7475=>602,7476=>602,7477=>602,7478=>602,7479=>602, -7480=>602,7481=>602,7482=>602,7483=>602,7484=>602,7486=>602,7487=>602,7488=>602,7489=>602,7490=>602, -7491=>602,7492=>602,7493=>602,7494=>602,7495=>602,7496=>602,7497=>602,7498=>602,7499=>602,7500=>602, -7501=>602,7502=>602,7503=>602,7504=>602,7505=>602,7506=>602,7507=>602,7508=>602,7509=>602,7510=>602, -7511=>602,7512=>602,7513=>602,7514=>602,7515=>602,7522=>602,7523=>602,7524=>602,7525=>602,7543=>602, -7544=>602,7547=>602,7557=>602,7579=>602,7580=>602,7581=>602,7582=>602,7583=>602,7584=>602,7585=>602, -7586=>602,7587=>602,7588=>602,7589=>602,7590=>602,7591=>602,7592=>602,7593=>602,7594=>602,7595=>602, -7596=>602,7597=>602,7598=>602,7599=>602,7600=>602,7601=>602,7602=>602,7603=>602,7604=>602,7605=>602, -7606=>602,7607=>602,7609=>602,7610=>602,7611=>602,7612=>602,7613=>602,7614=>602,7615=>602,7680=>602, -7681=>602,7682=>602,7683=>602,7684=>602,7685=>602,7686=>602,7687=>602,7688=>602,7689=>602,7690=>602, -7691=>602,7692=>602,7693=>602,7694=>602,7695=>602,7696=>602,7697=>602,7698=>602,7699=>602,7704=>602, -7705=>602,7706=>602,7707=>602,7708=>602,7709=>602,7710=>602,7711=>602,7712=>602,7713=>602,7714=>602, -7715=>602,7716=>602,7717=>602,7718=>602,7719=>602,7720=>602,7721=>602,7722=>602,7723=>602,7724=>602, -7725=>602,7728=>602,7729=>602,7730=>602,7731=>602,7732=>602,7733=>602,7734=>602,7735=>602,7736=>602, -7737=>602,7738=>602,7739=>602,7740=>602,7741=>602,7742=>602,7743=>602,7744=>602,7745=>602,7746=>602, -7747=>602,7748=>602,7749=>602,7750=>602,7751=>602,7752=>602,7753=>602,7754=>602,7755=>602,7756=>602, -7757=>602,7764=>602,7765=>602,7766=>602,7767=>602,7768=>602,7769=>602,7770=>602,7771=>602,7772=>602, -7773=>602,7774=>602,7775=>602,7776=>602,7777=>602,7778=>602,7779=>602,7784=>602,7785=>602,7786=>602, -7787=>602,7788=>602,7789=>602,7790=>602,7791=>602,7792=>602,7793=>602,7794=>602,7795=>602,7796=>602, -7797=>602,7798=>602,7799=>602,7800=>602,7801=>602,7804=>602,7805=>602,7806=>602,7807=>602,7808=>602, -7809=>602,7810=>602,7811=>602,7812=>602,7813=>602,7814=>602,7815=>602,7816=>602,7817=>602,7818=>602, -7819=>602,7820=>602,7821=>602,7822=>602,7823=>602,7824=>602,7825=>602,7826=>602,7827=>602,7828=>602, -7829=>602,7830=>602,7831=>602,7832=>602,7833=>602,7835=>602,7839=>602,7840=>602,7841=>602,7852=>602, -7853=>602,7856=>602,7857=>602,7862=>602,7863=>602,7864=>602,7865=>602,7868=>602,7869=>602,7878=>602, -7879=>602,7882=>602,7883=>602,7884=>602,7885=>602,7896=>602,7897=>602,7898=>602,7899=>602,7900=>602, -7901=>602,7904=>602,7905=>602,7906=>602,7907=>602,7908=>602,7909=>602,7912=>602,7913=>602,7914=>602, -7915=>602,7918=>602,7919=>602,7920=>602,7921=>602,7922=>602,7923=>602,7924=>602,7925=>602,7928=>602, -7929=>602,7936=>602,7937=>602,7938=>602,7939=>602,7940=>602,7941=>602,7942=>602,7943=>602,7944=>602, -7945=>602,7946=>602,7947=>602,7948=>602,7949=>602,7950=>602,7951=>602,7952=>602,7953=>602,7954=>602, -7955=>602,7956=>602,7957=>602,7960=>602,7961=>602,7962=>602,7963=>602,7964=>602,7965=>602,7968=>602, -7969=>602,7970=>602,7971=>602,7972=>602,7973=>602,7974=>602,7975=>602,7976=>602,7977=>602,7978=>602, -7979=>602,7980=>602,7981=>602,7982=>602,7983=>602,7984=>602,7985=>602,7986=>602,7987=>602,7988=>602, -7989=>602,7990=>602,7991=>602,7992=>602,7993=>602,7994=>602,7995=>602,7996=>602,7997=>602,7998=>602, -7999=>602,8000=>602,8001=>602,8002=>602,8003=>602,8004=>602,8005=>602,8008=>602,8009=>602,8010=>602, -8011=>602,8012=>602,8013=>602,8016=>602,8017=>602,8018=>602,8019=>602,8020=>602,8021=>602,8022=>602, -8023=>602,8025=>602,8027=>602,8029=>602,8031=>602,8032=>602,8033=>602,8034=>602,8035=>602,8036=>602, -8037=>602,8038=>602,8039=>602,8040=>602,8041=>602,8042=>602,8043=>602,8044=>602,8045=>602,8046=>602, -8047=>602,8048=>602,8049=>602,8050=>602,8051=>602,8052=>602,8053=>602,8054=>602,8055=>602,8056=>602, -8057=>602,8058=>602,8059=>602,8060=>602,8061=>602,8064=>602,8065=>602,8066=>602,8067=>602,8068=>602, -8069=>602,8070=>602,8071=>602,8072=>602,8073=>602,8074=>602,8075=>602,8076=>602,8077=>602,8078=>602, -8079=>602,8080=>602,8081=>602,8082=>602,8083=>602,8084=>602,8085=>602,8086=>602,8087=>602,8088=>602, -8089=>602,8090=>602,8091=>602,8092=>602,8093=>602,8094=>602,8095=>602,8096=>602,8097=>602,8098=>602, -8099=>602,8100=>602,8101=>602,8102=>602,8103=>602,8104=>602,8105=>602,8106=>602,8107=>602,8108=>602, -8109=>602,8110=>602,8111=>602,8112=>602,8113=>602,8114=>602,8115=>602,8116=>602,8118=>602,8119=>602, -8120=>602,8121=>602,8122=>602,8123=>602,8124=>602,8125=>602,8126=>602,8127=>602,8128=>602,8129=>602, -8130=>602,8131=>602,8132=>602,8134=>602,8135=>602,8136=>602,8137=>602,8138=>602,8139=>602,8140=>602, -8141=>602,8142=>602,8143=>602,8144=>602,8145=>602,8146=>602,8147=>602,8150=>602,8151=>602,8152=>602, -8153=>602,8154=>602,8155=>602,8157=>602,8158=>602,8159=>602,8160=>602,8161=>602,8162=>602,8163=>602, -8164=>602,8165=>602,8166=>602,8167=>602,8168=>602,8169=>602,8170=>602,8171=>602,8172=>602,8173=>602, -8174=>602,8175=>602,8178=>602,8179=>602,8180=>602,8182=>602,8183=>602,8184=>602,8185=>602,8186=>602, -8187=>602,8188=>602,8189=>602,8190=>602,8192=>602,8193=>602,8194=>602,8195=>602,8196=>602,8197=>602, -8198=>602,8199=>602,8200=>602,8201=>602,8202=>602,8208=>602,8209=>602,8210=>602,8213=>602,8215=>602, -8219=>602,8223=>602,8227=>602,8239=>602,8241=>602,8242=>602,8243=>602,8244=>602,8245=>602,8246=>602, -8247=>602,8252=>602,8253=>602,8254=>602,8261=>602,8262=>602,8263=>602,8264=>602,8265=>602,8287=>602, -8304=>602,8305=>602,8308=>602,8309=>602,8310=>602,8311=>602,8312=>602,8313=>602,8314=>602,8315=>602, -8316=>602,8317=>602,8318=>602,8319=>602,8320=>602,8321=>602,8322=>602,8323=>602,8324=>602,8325=>602, -8326=>602,8327=>602,8328=>602,8329=>602,8330=>602,8331=>602,8332=>602,8333=>602,8334=>602,8336=>602, -8337=>602,8338=>602,8339=>602,8340=>602,8352=>602,8353=>602,8354=>602,8355=>602,8356=>602,8357=>602, -8358=>602,8359=>602,8360=>602,8361=>602,8362=>602,8363=>602,8365=>602,8366=>602,8367=>602,8368=>602, -8369=>602,8370=>602,8371=>602,8372=>602,8373=>602,8450=>602,8453=>602,8461=>602,8462=>602,8463=>602, -8469=>602,8470=>602,8471=>602,8473=>602,8474=>602,8477=>602,8484=>602,8486=>602,8490=>602,8491=>602, -8494=>602,8531=>602,8532=>602,8533=>602,8534=>602,8535=>602,8536=>602,8537=>602,8538=>602,8539=>602, -8540=>602,8541=>602,8542=>602,8543=>602,8592=>602,8593=>602,8594=>602,8595=>602,8596=>602,8597=>602, -8598=>602,8599=>602,8600=>602,8601=>602,8602=>602,8603=>602,8604=>602,8605=>602,8606=>602,8607=>602, -8608=>602,8609=>602,8610=>602,8611=>602,8612=>602,8613=>602,8614=>602,8615=>602,8616=>602,8617=>602, -8618=>602,8619=>602,8620=>602,8621=>602,8622=>602,8623=>602,8624=>602,8625=>602,8626=>602,8627=>602, -8628=>602,8629=>602,8630=>602,8631=>602,8632=>602,8633=>602,8634=>602,8635=>602,8636=>602,8637=>602, -8638=>602,8639=>602,8640=>602,8641=>602,8642=>602,8643=>602,8644=>602,8645=>602,8646=>602,8647=>602, -8648=>602,8649=>602,8650=>602,8651=>602,8652=>602,8653=>602,8654=>602,8655=>602,8656=>602,8657=>602, -8658=>602,8659=>602,8660=>602,8661=>602,8662=>602,8663=>602,8664=>602,8665=>602,8666=>602,8667=>602, -8668=>602,8669=>602,8670=>602,8671=>602,8672=>602,8673=>602,8674=>602,8675=>602,8676=>602,8677=>602, -8678=>602,8679=>602,8680=>602,8681=>602,8682=>602,8683=>602,8684=>602,8685=>602,8686=>602,8687=>602, -8688=>602,8689=>602,8690=>602,8691=>602,8692=>602,8693=>602,8694=>602,8695=>602,8696=>602,8697=>602, -8698=>602,8699=>602,8700=>602,8701=>602,8702=>602,8703=>602,8704=>602,8705=>602,8706=>602,8707=>602, -8708=>602,8709=>602,8710=>602,8711=>602,8712=>602,8713=>602,8714=>602,8715=>602,8716=>602,8717=>602, -8719=>602,8721=>602,8722=>602,8723=>602,8725=>602,8727=>602,8728=>602,8729=>602,8730=>602,8731=>602, -8732=>602,8733=>602,8734=>602,8735=>602,8736=>602,8743=>602,8744=>602,8745=>602,8746=>602,8747=>602, -8748=>602,8749=>602,8760=>602,8761=>602,8762=>602,8763=>602,8764=>602,8765=>602,8769=>602,8770=>602, -8771=>602,8772=>602,8773=>602,8774=>602,8775=>602,8776=>602,8777=>602,8778=>602,8779=>602,8780=>602, -8781=>602,8782=>602,8783=>602,8784=>602,8785=>602,8786=>602,8787=>602,8788=>602,8789=>602,8790=>602, -8791=>602,8792=>602,8793=>602,8794=>602,8795=>602,8796=>602,8797=>602,8798=>602,8799=>602,8800=>602, -8801=>602,8802=>602,8803=>602,8804=>602,8805=>602,8806=>602,8807=>602,8808=>602,8809=>602,8813=>602, -8814=>602,8815=>602,8816=>602,8817=>602,8818=>602,8819=>602,8820=>602,8821=>602,8822=>602,8823=>602, -8824=>602,8825=>602,8826=>602,8827=>602,8828=>602,8829=>602,8830=>602,8831=>602,8832=>602,8833=>602, -8834=>602,8835=>602,8836=>602,8837=>602,8838=>602,8839=>602,8840=>602,8841=>602,8842=>602,8843=>602, -8847=>602,8848=>602,8849=>602,8850=>602,8853=>602,8854=>602,8855=>602,8856=>602,8857=>602,8858=>602, -8859=>602,8860=>602,8861=>602,8862=>602,8863=>602,8864=>602,8865=>602,8901=>602,8902=>602,8909=>602, -8922=>602,8923=>602,8924=>602,8925=>602,8926=>602,8927=>602,8928=>602,8929=>602,8930=>602,8931=>602, -8932=>602,8933=>602,8934=>602,8935=>602,8936=>602,8937=>602,8943=>602,8960=>602,8961=>602,8962=>602, -8963=>602,8964=>602,8965=>602,8966=>602,8968=>602,8969=>602,8970=>602,8971=>602,8972=>602,8973=>602, -8974=>602,8975=>602,8976=>602,8977=>602,8978=>602,8979=>602,8980=>602,8981=>602,8984=>602,8985=>602, -8988=>602,8989=>602,8990=>602,8991=>602,8992=>602,8993=>602,8997=>602,8998=>602,8999=>602,9000=>602, -9003=>602,9013=>602,9015=>602,9016=>602,9017=>602,9018=>602,9019=>602,9020=>602,9021=>602,9022=>602, -9025=>602,9026=>602,9027=>602,9028=>602,9031=>602,9032=>602,9033=>602,9035=>602,9036=>602,9037=>602, -9040=>602,9042=>602,9043=>602,9044=>602,9047=>602,9048=>602,9049=>602,9050=>602,9051=>602,9052=>602, -9054=>602,9055=>602,9056=>602,9059=>602,9060=>602,9061=>602,9064=>602,9065=>602,9067=>602,9068=>602, -9069=>602,9070=>602,9071=>602,9072=>602,9075=>602,9076=>602,9077=>602,9078=>602,9079=>602,9080=>602, -9081=>602,9082=>602,9085=>602,9088=>602,9089=>602,9090=>602,9091=>602,9096=>602,9097=>602,9098=>602, -9099=>602,9109=>602,9115=>602,9116=>602,9117=>602,9118=>602,9119=>602,9120=>602,9121=>602,9122=>602, -9123=>602,9124=>602,9125=>602,9126=>602,9127=>602,9128=>602,9129=>602,9130=>602,9131=>602,9132=>602, -9133=>602,9134=>602,9166=>602,9167=>602,9251=>602,9600=>602,9601=>602,9602=>602,9603=>602,9604=>602, -9605=>602,9606=>602,9607=>602,9608=>602,9609=>602,9610=>602,9611=>602,9612=>602,9613=>602,9614=>602, -9615=>602,9616=>602,9617=>602,9618=>602,9619=>602,9620=>602,9621=>602,9622=>602,9623=>602,9624=>602, -9625=>602,9626=>602,9627=>602,9628=>602,9629=>602,9630=>602,9631=>602,9632=>602,9633=>602,9634=>602, -9635=>602,9636=>602,9637=>602,9638=>602,9639=>602,9640=>602,9641=>602,9642=>602,9643=>602,9644=>602, -9645=>602,9646=>602,9647=>602,9648=>602,9649=>602,9650=>602,9651=>602,9652=>602,9653=>602,9654=>602, -9655=>602,9656=>602,9657=>602,9658=>602,9659=>602,9660=>602,9661=>602,9662=>602,9663=>602,9664=>602, -9665=>602,9666=>602,9667=>602,9668=>602,9669=>602,9670=>602,9671=>602,9672=>602,9673=>602,9674=>602, -9675=>602,9676=>602,9677=>602,9678=>602,9679=>602,9680=>602,9681=>602,9682=>602,9683=>602,9684=>602, -9685=>602,9686=>602,9687=>602,9688=>602,9689=>602,9690=>602,9691=>602,9692=>602,9693=>602,9694=>602, -9695=>602,9696=>602,9697=>602,9698=>602,9699=>602,9700=>602,9701=>602,9702=>602,9703=>602,9704=>602, -9705=>602,9706=>602,9707=>602,9708=>602,9709=>602,9710=>602,9711=>602,9712=>602,9713=>602,9714=>602, -9715=>602,9716=>602,9717=>602,9718=>602,9719=>602,9720=>602,9721=>602,9722=>602,9723=>602,9724=>602, -9725=>602,9726=>602,9727=>602,9728=>602,9784=>602,9785=>602,9786=>602,9787=>602,9788=>602,9791=>602, -9792=>602,9793=>602,9794=>602,9795=>602,9796=>602,9797=>602,9798=>602,9799=>602,9824=>602,9825=>602, -9826=>602,9827=>602,9828=>602,9829=>602,9830=>602,9831=>602,9833=>602,9834=>602,9835=>602,9836=>602, -9837=>602,9838=>602,9839=>602,10181=>602,10182=>602,10208=>602,10216=>602,10217=>602,10731=>602,10746=>602, -10747=>602,10799=>602,11026=>602,11027=>602,11028=>602,11029=>602,11030=>602,11031=>602,11032=>602,11033=>602, -11034=>602,11364=>602,11374=>602,11375=>602,11381=>602,11382=>602,11383=>602,11385=>602,11386=>602,11388=>602, -11389=>602,11800=>602,11810=>602,11811=>602,11812=>602,11813=>602,11822=>602,42760=>602,42761=>602,42762=>602, -42763=>602,42764=>602,42765=>602,42766=>602,42767=>602,42768=>602,42769=>602,42770=>602,42771=>602,42772=>602, -42773=>602,42774=>602,42779=>602,42780=>602,42781=>602,42782=>602,42783=>602,42790=>602,42791=>602,42889=>602, -42890=>602,42891=>602,42892=>602,63173=>602,64257=>602,64258=>602,65529=>602,65530=>602,65531=>602,65532=>602, -65533=>602); -$enc=''; -$diff=''; -$file='dejavusansmonobi.z'; -$ctg='dejavusansmonobi.ctg.z'; -$originalsize=223408; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.z deleted file mode 100644 index 08c6170b95..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonobi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.ctg.z deleted file mode 100644 index 7b8bc17ddd..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.php deleted file mode 100644 index 68cf923416..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.php +++ /dev/null @@ -1,262 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSansMono-Oblique'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-62,'Flags'=>97,'FontBBox'=>'[-406 -375 746 1028]','ItalicAngle'=>-11,'StemV'=>70,'MissingWidth'=>602); -$up=-63; -$ut=44; -$dw=602; -$cw=array( -0=>602,32=>602,33=>602,34=>602,35=>602,36=>602,37=>602,38=>602,39=>602,40=>602, -41=>602,42=>602,43=>602,44=>602,45=>602,46=>602,47=>602,48=>602,49=>602,50=>602, -51=>602,52=>602,53=>602,54=>602,55=>602,56=>602,57=>602,58=>602,59=>602,60=>602, -61=>602,62=>602,63=>602,64=>602,65=>602,66=>602,67=>602,68=>602,69=>602,70=>602, -71=>602,72=>602,73=>602,74=>602,75=>602,76=>602,77=>602,78=>602,79=>602,80=>602, -81=>602,82=>602,83=>602,84=>602,85=>602,86=>602,87=>602,88=>602,89=>602,90=>602, -91=>602,92=>602,93=>602,94=>602,95=>602,96=>602,97=>602,98=>602,99=>602,100=>602, -101=>602,102=>602,103=>602,104=>602,105=>602,106=>602,107=>602,108=>602,109=>602,110=>602, -111=>602,112=>602,113=>602,114=>602,115=>602,116=>602,117=>602,118=>602,119=>602,120=>602, -121=>602,122=>602,123=>602,124=>602,125=>602,126=>602,8364=>602,8218=>602,402=>602,8222=>602, -8230=>602,8224=>602,8225=>602,710=>602,8240=>602,352=>602,8249=>602,338=>602,381=>602,8216=>602, -8217=>602,8220=>602,8221=>602,8226=>602,8211=>602,8212=>602,732=>602,8482=>602,353=>602,8250=>602, -339=>602,382=>602,376=>602,160=>602,161=>602,162=>602,163=>602,164=>602,165=>602,166=>602, -167=>602,168=>602,169=>602,170=>602,171=>602,172=>602,173=>602,174=>602,175=>602,176=>602, -177=>602,178=>602,179=>602,180=>602,181=>602,182=>602,183=>602,184=>602,185=>602,186=>602, -187=>602,188=>602,189=>602,190=>602,191=>602,192=>602,193=>602,194=>602,195=>602,196=>602, -197=>602,198=>602,199=>602,200=>602,201=>602,202=>602,203=>602,204=>602,205=>602,206=>602, -207=>602,208=>602,209=>602,210=>602,211=>602,212=>602,213=>602,214=>602,215=>602,216=>602, -217=>602,218=>602,219=>602,220=>602,221=>602,222=>602,223=>602,224=>602,225=>602,226=>602, -227=>602,228=>602,229=>602,230=>602,231=>602,232=>602,233=>602,234=>602,235=>602,236=>602, -237=>602,238=>602,239=>602,240=>602,241=>602,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>602,248=>602,249=>602,250=>602,251=>602,252=>602,253=>602,254=>602,255=>602,256=>602, -257=>602,258=>602,259=>602,260=>602,261=>602,262=>602,263=>602,264=>602,265=>602,266=>602, -267=>602,268=>602,269=>602,270=>602,271=>602,272=>602,273=>602,274=>602,275=>602,276=>602, -277=>602,278=>602,279=>602,280=>602,281=>602,282=>602,283=>602,284=>602,285=>602,286=>602, -287=>602,288=>602,289=>602,290=>602,291=>602,292=>602,293=>602,294=>602,295=>602,296=>602, -297=>602,298=>602,299=>602,300=>602,301=>602,302=>602,303=>602,304=>602,305=>602,306=>602, -307=>602,308=>602,309=>602,310=>602,311=>602,312=>602,313=>602,314=>602,315=>602,316=>602, -317=>602,318=>602,319=>602,320=>602,321=>602,322=>602,323=>602,324=>602,325=>602,326=>602, -327=>602,328=>602,329=>602,330=>602,331=>602,332=>602,333=>602,334=>602,335=>602,336=>602, -337=>602,340=>602,341=>602,342=>602,343=>602,344=>602,345=>602,346=>602,347=>602,348=>602, -349=>602,350=>602,351=>602,354=>602,355=>602,356=>602,357=>602,358=>602,359=>602,360=>602, -361=>602,362=>602,363=>602,364=>602,365=>602,366=>602,367=>602,368=>602,369=>602,370=>602, -371=>602,372=>602,373=>602,374=>602,375=>602,377=>602,378=>602,379=>602,380=>602,383=>602, -384=>602,385=>602,386=>602,387=>602,388=>602,389=>602,390=>602,391=>602,392=>602,393=>602, -394=>602,395=>602,396=>602,397=>602,398=>602,399=>602,400=>602,401=>602,403=>602,404=>602, -405=>602,406=>602,407=>602,408=>602,409=>602,410=>602,411=>602,412=>602,413=>602,414=>602, -415=>602,416=>602,417=>602,418=>602,419=>602,420=>602,421=>602,422=>602,423=>602,424=>602, -425=>602,426=>602,427=>602,428=>602,429=>602,430=>602,431=>602,432=>602,433=>602,434=>602, -435=>602,436=>602,437=>602,438=>602,439=>602,440=>602,441=>602,442=>602,443=>602,444=>602, -445=>602,446=>602,447=>602,448=>602,449=>602,450=>602,451=>602,461=>602,462=>602,463=>602, -464=>602,465=>602,466=>602,467=>602,468=>602,469=>602,470=>602,471=>602,472=>602,473=>602, -474=>602,475=>602,476=>602,477=>602,479=>602,480=>602,481=>602,482=>602,483=>602,486=>602, -487=>602,488=>602,489=>602,490=>602,491=>602,492=>602,493=>602,494=>602,495=>602,500=>602, -501=>602,502=>602,504=>602,505=>602,508=>602,509=>602,510=>602,511=>602,512=>602,513=>602, -514=>602,515=>602,516=>602,517=>602,518=>602,519=>602,520=>602,521=>602,522=>602,523=>602, -524=>602,525=>602,526=>602,527=>602,528=>602,529=>602,530=>602,531=>602,532=>602,533=>602, -534=>602,535=>602,536=>602,537=>602,538=>602,539=>602,540=>602,541=>602,542=>602,543=>602, -545=>602,548=>602,549=>602,550=>602,551=>602,552=>602,553=>602,554=>602,555=>602,556=>602, -557=>602,558=>602,559=>602,560=>602,561=>602,562=>602,563=>602,564=>602,565=>602,566=>602, -567=>602,568=>602,569=>602,570=>602,571=>602,572=>602,573=>602,574=>602,575=>602,576=>602, -577=>602,580=>602,581=>602,588=>602,589=>602,592=>602,593=>602,594=>602,595=>602,596=>602, -597=>602,598=>602,599=>602,600=>602,601=>602,602=>602,603=>602,604=>602,605=>602,606=>602, -607=>602,608=>602,609=>602,610=>602,611=>602,612=>602,613=>602,614=>602,615=>602,616=>602, -617=>602,618=>602,619=>602,620=>602,621=>602,622=>602,623=>602,624=>602,625=>602,626=>602, -627=>602,628=>602,629=>602,630=>602,631=>602,632=>602,633=>602,634=>602,635=>602,636=>602, -637=>602,638=>602,639=>602,640=>602,641=>602,642=>602,643=>602,644=>602,645=>602,646=>602, -647=>602,648=>602,649=>602,650=>602,651=>602,652=>602,653=>602,654=>602,655=>602,656=>602, -657=>602,658=>602,659=>602,660=>602,661=>602,662=>602,663=>602,664=>602,665=>602,666=>602, -667=>602,668=>602,669=>602,670=>602,671=>602,672=>602,673=>602,674=>602,675=>602,676=>602, -677=>602,678=>602,679=>602,680=>602,681=>602,682=>602,683=>602,684=>602,685=>602,686=>602, -687=>602,688=>602,689=>602,690=>602,691=>602,692=>602,693=>602,694=>602,695=>602,696=>602, -697=>602,699=>602,700=>602,701=>602,702=>602,703=>602,704=>602,705=>602,711=>602,712=>602, -713=>602,716=>602,717=>602,720=>602,721=>602,722=>602,723=>602,726=>602,727=>602,728=>602, -729=>602,730=>602,731=>602,733=>602,734=>602,736=>602,737=>602,738=>602,739=>602,740=>602, -741=>602,742=>602,743=>602,744=>602,745=>602,750=>602,755=>602,768=>602,769=>602,770=>602, -771=>602,772=>602,773=>602,774=>602,775=>602,776=>602,777=>602,778=>602,779=>602,780=>602, -781=>602,782=>602,783=>602,784=>602,785=>602,786=>602,787=>602,788=>602,789=>602,790=>602, -791=>602,792=>602,793=>602,794=>602,795=>602,796=>602,797=>602,798=>602,799=>602,800=>602, -801=>602,802=>602,803=>602,804=>602,805=>602,806=>602,807=>602,808=>602,809=>602,810=>602, -811=>602,812=>602,813=>602,814=>602,815=>602,816=>602,817=>602,818=>602,819=>602,820=>602, -821=>602,822=>602,823=>602,824=>602,825=>602,826=>602,827=>602,828=>602,829=>602,830=>602, -831=>602,835=>602,856=>602,865=>602,884=>602,885=>602,890=>602,894=>602,900=>602,901=>602, -902=>602,903=>602,904=>602,905=>602,906=>602,908=>602,910=>602,911=>602,912=>602,913=>602, -914=>602,915=>602,916=>602,917=>602,918=>602,919=>602,920=>602,921=>602,922=>602,923=>602, -924=>602,925=>602,926=>602,927=>602,928=>602,929=>602,931=>602,932=>602,933=>602,934=>602, -935=>602,936=>602,937=>602,938=>602,939=>602,940=>602,941=>602,942=>602,943=>602,944=>602, -945=>602,946=>602,947=>602,948=>602,949=>602,950=>602,951=>602,952=>602,953=>602,954=>602, -955=>602,956=>602,957=>602,958=>602,959=>602,960=>602,961=>602,962=>602,963=>602,964=>602, -965=>602,966=>602,967=>602,968=>602,969=>602,970=>602,971=>602,972=>602,973=>602,974=>602, -976=>602,977=>602,978=>602,979=>602,980=>602,981=>602,982=>602,983=>602,984=>602,985=>602, -986=>602,987=>602,988=>602,989=>602,990=>602,991=>602,992=>602,993=>602,1008=>602,1009=>602, -1010=>602,1011=>602,1012=>602,1013=>602,1014=>602,1015=>602,1016=>602,1017=>602,1018=>602,1019=>602, -1020=>602,1021=>602,1022=>602,1023=>602,1024=>602,1025=>602,1026=>602,1027=>602,1028=>602,1029=>602, -1030=>602,1031=>602,1032=>602,1033=>602,1034=>602,1035=>602,1036=>602,1037=>602,1038=>602,1039=>602, -1040=>602,1041=>602,1042=>602,1043=>602,1044=>602,1045=>602,1046=>602,1047=>602,1048=>602,1049=>602, -1050=>602,1051=>602,1052=>602,1053=>602,1054=>602,1055=>602,1056=>602,1057=>602,1058=>602,1059=>602, -1060=>602,1061=>602,1062=>602,1063=>602,1064=>602,1065=>602,1066=>602,1067=>602,1068=>602,1069=>602, -1070=>602,1071=>602,1072=>602,1073=>602,1074=>602,1075=>602,1076=>602,1077=>602,1078=>602,1079=>602, -1080=>602,1081=>602,1082=>602,1083=>602,1084=>602,1085=>602,1086=>602,1087=>602,1088=>602,1089=>602, -1090=>602,1091=>602,1092=>602,1093=>602,1094=>602,1095=>602,1096=>602,1097=>602,1098=>602,1099=>602, -1100=>602,1101=>602,1102=>602,1103=>602,1104=>602,1105=>602,1106=>602,1107=>602,1108=>602,1109=>602, -1110=>602,1111=>602,1112=>602,1113=>602,1114=>602,1115=>602,1116=>602,1117=>602,1118=>602,1119=>602, -1122=>602,1123=>602,1138=>602,1139=>602,1168=>602,1169=>602,1170=>602,1171=>602,1172=>602,1173=>602, -1174=>602,1175=>602,1176=>602,1177=>602,1178=>602,1179=>602,1186=>602,1187=>602,1194=>602,1195=>602, -1196=>602,1197=>602,1198=>602,1199=>602,1200=>602,1201=>602,1202=>602,1203=>602,1210=>602,1211=>602, -1216=>602,1217=>602,1218=>602,1219=>602,1220=>602,1223=>602,1224=>602,1227=>602,1228=>602,1231=>602, -1232=>602,1233=>602,1234=>602,1235=>602,1236=>602,1237=>602,1238=>602,1239=>602,1240=>602,1241=>602, -1242=>602,1243=>602,1244=>602,1245=>602,1246=>602,1247=>602,1248=>602,1249=>602,1250=>602,1251=>602, -1252=>602,1253=>602,1254=>602,1255=>602,1256=>602,1257=>602,1258=>602,1259=>602,1260=>602,1261=>602, -1262=>602,1263=>602,1264=>602,1265=>602,1266=>602,1267=>602,1268=>602,1269=>602,1270=>602,1271=>602, -1272=>602,1273=>602,1296=>602,1297=>602,1306=>602,1307=>602,1308=>602,1309=>602,3713=>602,3714=>602, -3716=>602,3719=>602,3720=>602,3722=>602,3725=>602,3732=>602,3733=>602,3734=>602,3735=>602,3737=>602, -3738=>602,3739=>602,3740=>602,3741=>602,3742=>602,3743=>602,3745=>602,3746=>602,3747=>602,3749=>602, -3751=>602,3754=>602,3755=>602,3757=>602,3758=>602,3759=>602,3760=>602,3761=>602,3762=>602,3763=>602, -3764=>602,3765=>602,3766=>602,3767=>602,3768=>602,3769=>602,3771=>602,3772=>602,3784=>602,3785=>602, -3786=>602,3787=>602,3788=>602,3789=>602,4304=>602,4305=>602,4306=>602,4307=>602,4308=>602,4309=>602, -4310=>602,4311=>602,4312=>602,4313=>602,4314=>602,4315=>602,4316=>602,4317=>602,4318=>602,4319=>602, -4320=>602,4321=>602,4322=>602,4323=>602,4324=>602,4325=>602,4326=>602,4327=>602,4328=>602,4329=>602, -4330=>602,4331=>602,4332=>602,4333=>602,4334=>602,4335=>602,4336=>602,4337=>602,4338=>602,4339=>602, -4340=>602,4341=>602,4342=>602,4343=>602,4344=>602,4345=>602,4346=>602,4347=>602,4348=>602,7426=>602, -7432=>602,7433=>602,7444=>602,7446=>602,7447=>602,7453=>602,7454=>602,7455=>602,7468=>602,7469=>602, -7470=>602,7472=>602,7473=>602,7474=>602,7475=>602,7476=>602,7477=>602,7478=>602,7479=>602,7480=>602, -7481=>602,7482=>602,7483=>602,7484=>602,7485=>602,7486=>602,7487=>602,7488=>602,7489=>602,7490=>602, -7491=>602,7492=>602,7493=>602,7494=>602,7495=>602,7496=>602,7497=>602,7498=>602,7499=>602,7500=>602, -7501=>602,7502=>602,7503=>602,7504=>602,7505=>602,7506=>602,7507=>602,7508=>602,7509=>602,7510=>602, -7511=>602,7512=>602,7513=>602,7514=>602,7515=>602,7522=>602,7523=>602,7524=>602,7525=>602,7543=>602, -7544=>602,7547=>602,7557=>602,7579=>602,7580=>602,7581=>602,7582=>602,7583=>602,7584=>602,7585=>602, -7586=>602,7587=>602,7588=>602,7589=>602,7590=>602,7591=>602,7592=>602,7593=>602,7594=>602,7595=>602, -7596=>602,7597=>602,7598=>602,7599=>602,7600=>602,7601=>602,7602=>602,7603=>602,7604=>602,7605=>602, -7606=>602,7607=>602,7609=>602,7610=>602,7611=>602,7612=>602,7613=>602,7614=>602,7615=>602,7680=>602, -7681=>602,7682=>602,7683=>602,7684=>602,7685=>602,7686=>602,7687=>602,7688=>602,7689=>602,7690=>602, -7691=>602,7692=>602,7693=>602,7694=>602,7695=>602,7696=>602,7697=>602,7698=>602,7699=>602,7704=>602, -7705=>602,7706=>602,7707=>602,7708=>602,7709=>602,7710=>602,7711=>602,7712=>602,7713=>602,7714=>602, -7715=>602,7716=>602,7717=>602,7718=>602,7719=>602,7720=>602,7721=>602,7722=>602,7723=>602,7724=>602, -7725=>602,7728=>602,7729=>602,7730=>602,7731=>602,7732=>602,7733=>602,7734=>602,7735=>602,7736=>602, -7737=>602,7738=>602,7739=>602,7740=>602,7741=>602,7742=>602,7743=>602,7744=>602,7745=>602,7746=>602, -7747=>602,7748=>602,7749=>602,7750=>602,7751=>602,7752=>602,7753=>602,7754=>602,7755=>602,7756=>602, -7757=>602,7764=>602,7765=>602,7766=>602,7767=>602,7768=>602,7769=>602,7770=>602,7771=>602,7772=>602, -7773=>602,7774=>602,7775=>602,7776=>602,7777=>602,7778=>602,7779=>602,7784=>602,7785=>602,7786=>602, -7787=>602,7788=>602,7789=>602,7790=>602,7791=>602,7792=>602,7793=>602,7794=>602,7795=>602,7796=>602, -7797=>602,7798=>602,7799=>602,7800=>602,7801=>602,7804=>602,7805=>602,7806=>602,7807=>602,7808=>602, -7809=>602,7810=>602,7811=>602,7812=>602,7813=>602,7814=>602,7815=>602,7816=>602,7817=>602,7818=>602, -7819=>602,7820=>602,7821=>602,7822=>602,7823=>602,7824=>602,7825=>602,7826=>602,7827=>602,7828=>602, -7829=>602,7830=>602,7831=>602,7832=>602,7833=>602,7835=>602,7839=>602,7840=>602,7841=>602,7852=>602, -7853=>602,7856=>602,7857=>602,7862=>602,7863=>602,7864=>602,7865=>602,7868=>602,7869=>602,7878=>602, -7879=>602,7882=>602,7883=>602,7884=>602,7885=>602,7896=>602,7897=>602,7898=>602,7899=>602,7900=>602, -7901=>602,7904=>602,7905=>602,7906=>602,7907=>602,7908=>602,7909=>602,7912=>602,7913=>602,7914=>602, -7915=>602,7918=>602,7919=>602,7920=>602,7921=>602,7922=>602,7923=>602,7924=>602,7925=>602,7928=>602, -7929=>602,7936=>602,7937=>602,7938=>602,7939=>602,7940=>602,7941=>602,7942=>602,7943=>602,7944=>602, -7945=>602,7946=>602,7947=>602,7948=>602,7949=>602,7950=>602,7951=>602,7952=>602,7953=>602,7954=>602, -7955=>602,7956=>602,7957=>602,7960=>602,7961=>602,7962=>602,7963=>602,7964=>602,7965=>602,7968=>602, -7969=>602,7970=>602,7971=>602,7972=>602,7973=>602,7974=>602,7975=>602,7976=>602,7977=>602,7978=>602, -7979=>602,7980=>602,7981=>602,7982=>602,7983=>602,7984=>602,7985=>602,7986=>602,7987=>602,7988=>602, -7989=>602,7990=>602,7991=>602,7992=>602,7993=>602,7994=>602,7995=>602,7996=>602,7997=>602,7998=>602, -7999=>602,8000=>602,8001=>602,8002=>602,8003=>602,8004=>602,8005=>602,8008=>602,8009=>602,8010=>602, -8011=>602,8012=>602,8013=>602,8016=>602,8017=>602,8018=>602,8019=>602,8020=>602,8021=>602,8022=>602, -8023=>602,8025=>602,8027=>602,8029=>602,8031=>602,8032=>602,8033=>602,8034=>602,8035=>602,8036=>602, -8037=>602,8038=>602,8039=>602,8040=>602,8041=>602,8042=>602,8043=>602,8044=>602,8045=>602,8046=>602, -8047=>602,8048=>602,8049=>602,8050=>602,8051=>602,8052=>602,8053=>602,8054=>602,8055=>602,8056=>602, -8057=>602,8058=>602,8059=>602,8060=>602,8061=>602,8064=>602,8065=>602,8066=>602,8067=>602,8068=>602, -8069=>602,8070=>602,8071=>602,8072=>602,8073=>602,8074=>602,8075=>602,8076=>602,8077=>602,8078=>602, -8079=>602,8080=>602,8081=>602,8082=>602,8083=>602,8084=>602,8085=>602,8086=>602,8087=>602,8088=>602, -8089=>602,8090=>602,8091=>602,8092=>602,8093=>602,8094=>602,8095=>602,8096=>602,8097=>602,8098=>602, -8099=>602,8100=>602,8101=>602,8102=>602,8103=>602,8104=>602,8105=>602,8106=>602,8107=>602,8108=>602, -8109=>602,8110=>602,8111=>602,8112=>602,8113=>602,8114=>602,8115=>602,8116=>602,8118=>602,8119=>602, -8120=>602,8121=>602,8122=>602,8123=>602,8124=>602,8125=>602,8126=>602,8127=>602,8128=>602,8129=>602, -8130=>602,8131=>602,8132=>602,8134=>602,8135=>602,8136=>602,8137=>602,8138=>602,8139=>602,8140=>602, -8141=>602,8142=>602,8143=>602,8144=>602,8145=>602,8146=>602,8147=>602,8150=>602,8151=>602,8152=>602, -8153=>602,8154=>602,8155=>602,8157=>602,8158=>602,8159=>602,8160=>602,8161=>602,8162=>602,8163=>602, -8164=>602,8165=>602,8166=>602,8167=>602,8168=>602,8169=>602,8170=>602,8171=>602,8172=>602,8173=>602, -8174=>602,8175=>602,8178=>602,8179=>602,8180=>602,8182=>602,8183=>602,8184=>602,8185=>602,8186=>602, -8187=>602,8188=>602,8189=>602,8190=>602,8192=>602,8193=>602,8194=>602,8195=>602,8196=>602,8197=>602, -8198=>602,8199=>602,8200=>602,8201=>602,8202=>602,8208=>602,8209=>602,8210=>602,8213=>602,8215=>602, -8219=>602,8223=>602,8227=>602,8239=>602,8241=>602,8242=>602,8243=>602,8244=>602,8245=>602,8246=>602, -8247=>602,8252=>602,8253=>602,8254=>602,8261=>602,8262=>602,8263=>602,8264=>602,8265=>602,8287=>602, -8304=>602,8305=>602,8308=>602,8309=>602,8310=>602,8311=>602,8312=>602,8313=>602,8314=>602,8315=>602, -8316=>602,8317=>602,8318=>602,8319=>602,8320=>602,8321=>602,8322=>602,8323=>602,8324=>602,8325=>602, -8326=>602,8327=>602,8328=>602,8329=>602,8330=>602,8331=>602,8332=>602,8333=>602,8334=>602,8336=>602, -8337=>602,8338=>602,8339=>602,8340=>602,8352=>602,8353=>602,8354=>602,8355=>602,8356=>602,8357=>602, -8358=>602,8359=>602,8360=>602,8361=>602,8362=>602,8363=>602,8365=>602,8366=>602,8367=>602,8368=>602, -8369=>602,8370=>602,8371=>602,8372=>602,8373=>602,8450=>602,8453=>602,8461=>602,8462=>602,8463=>602, -8469=>602,8470=>602,8471=>602,8473=>602,8474=>602,8477=>602,8484=>602,8486=>602,8490=>602,8491=>602, -8494=>602,8531=>602,8532=>602,8533=>602,8534=>602,8535=>602,8536=>602,8537=>602,8538=>602,8539=>602, -8540=>602,8541=>602,8542=>602,8543=>602,8592=>602,8593=>602,8594=>602,8595=>602,8596=>602,8597=>602, -8598=>602,8599=>602,8600=>602,8601=>602,8602=>602,8603=>602,8604=>602,8605=>602,8606=>602,8607=>602, -8608=>602,8609=>602,8610=>602,8611=>602,8612=>602,8613=>602,8614=>602,8615=>602,8616=>602,8617=>602, -8618=>602,8619=>602,8620=>602,8621=>602,8622=>602,8623=>602,8624=>602,8625=>602,8626=>602,8627=>602, -8628=>602,8629=>602,8630=>602,8631=>602,8632=>602,8633=>602,8634=>602,8635=>602,8636=>602,8637=>602, -8638=>602,8639=>602,8640=>602,8641=>602,8642=>602,8643=>602,8644=>602,8645=>602,8646=>602,8647=>602, -8648=>602,8649=>602,8650=>602,8651=>602,8652=>602,8653=>602,8654=>602,8655=>602,8656=>602,8657=>602, -8658=>602,8659=>602,8660=>602,8661=>602,8662=>602,8663=>602,8664=>602,8665=>602,8666=>602,8667=>602, -8668=>602,8669=>602,8670=>602,8671=>602,8672=>602,8673=>602,8674=>602,8675=>602,8676=>602,8677=>602, -8678=>602,8679=>602,8680=>602,8681=>602,8682=>602,8683=>602,8684=>602,8685=>602,8686=>602,8687=>602, -8688=>602,8689=>602,8690=>602,8691=>602,8692=>602,8693=>602,8694=>602,8695=>602,8696=>602,8697=>602, -8698=>602,8699=>602,8700=>602,8701=>602,8702=>602,8703=>602,8704=>602,8705=>602,8706=>602,8707=>602, -8708=>602,8709=>602,8710=>602,8711=>602,8712=>602,8713=>602,8714=>602,8715=>602,8716=>602,8717=>602, -8719=>602,8721=>602,8722=>602,8723=>602,8725=>602,8727=>602,8728=>602,8729=>602,8730=>602,8731=>602, -8732=>602,8733=>602,8734=>602,8735=>602,8736=>602,8743=>602,8744=>602,8745=>602,8746=>602,8747=>602, -8748=>602,8749=>602,8760=>602,8761=>602,8762=>602,8763=>602,8764=>602,8765=>602,8769=>602,8770=>602, -8771=>602,8772=>602,8773=>602,8774=>602,8775=>602,8776=>602,8777=>602,8778=>602,8779=>602,8780=>602, -8781=>602,8782=>602,8783=>602,8784=>602,8785=>602,8786=>602,8787=>602,8788=>602,8789=>602,8790=>602, -8791=>602,8792=>602,8793=>602,8794=>602,8795=>602,8796=>602,8797=>602,8798=>602,8799=>602,8800=>602, -8801=>602,8802=>602,8803=>602,8804=>602,8805=>602,8806=>602,8807=>602,8808=>602,8809=>602,8813=>602, -8814=>602,8815=>602,8816=>602,8817=>602,8818=>602,8819=>602,8820=>602,8821=>602,8822=>602,8823=>602, -8824=>602,8825=>602,8826=>602,8827=>602,8828=>602,8829=>602,8830=>602,8831=>602,8832=>602,8833=>602, -8834=>602,8835=>602,8836=>602,8837=>602,8838=>602,8839=>602,8840=>602,8841=>602,8842=>602,8843=>602, -8847=>602,8848=>602,8849=>602,8850=>602,8853=>602,8854=>602,8855=>602,8856=>602,8857=>602,8858=>602, -8859=>602,8860=>602,8861=>602,8862=>602,8863=>602,8864=>602,8865=>602,8901=>602,8902=>602,8909=>602, -8922=>602,8923=>602,8924=>602,8925=>602,8926=>602,8927=>602,8928=>602,8929=>602,8930=>602,8931=>602, -8932=>602,8933=>602,8934=>602,8935=>602,8936=>602,8937=>602,8943=>602,8960=>602,8961=>602,8962=>602, -8963=>602,8964=>602,8965=>602,8966=>602,8968=>602,8969=>602,8970=>602,8971=>602,8972=>602,8973=>602, -8974=>602,8975=>602,8976=>602,8977=>602,8978=>602,8979=>602,8980=>602,8981=>602,8984=>602,8985=>602, -8988=>602,8989=>602,8990=>602,8991=>602,8992=>602,8993=>602,8997=>602,8998=>602,8999=>602,9000=>602, -9003=>602,9013=>602,9015=>602,9016=>602,9017=>602,9018=>602,9019=>602,9020=>602,9021=>602,9022=>602, -9025=>602,9026=>602,9027=>602,9028=>602,9031=>602,9032=>602,9033=>602,9035=>602,9036=>602,9037=>602, -9040=>602,9042=>602,9043=>602,9044=>602,9047=>602,9048=>602,9049=>602,9050=>602,9051=>602,9052=>602, -9054=>602,9055=>602,9056=>602,9059=>602,9060=>602,9061=>602,9064=>602,9065=>602,9067=>602,9068=>602, -9069=>602,9070=>602,9071=>602,9072=>602,9075=>602,9076=>602,9077=>602,9078=>602,9079=>602,9080=>602, -9081=>602,9082=>602,9085=>602,9088=>602,9089=>602,9090=>602,9091=>602,9096=>602,9097=>602,9098=>602, -9099=>602,9109=>602,9115=>602,9116=>602,9117=>602,9118=>602,9119=>602,9120=>602,9121=>602,9122=>602, -9123=>602,9124=>602,9125=>602,9126=>602,9127=>602,9128=>602,9129=>602,9130=>602,9131=>602,9132=>602, -9133=>602,9134=>602,9166=>602,9167=>602,9251=>602,9472=>602,9473=>602,9474=>602,9475=>602,9476=>602, -9477=>602,9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602,9486=>602, -9487=>602,9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602,9496=>602, -9497=>602,9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602,9506=>602, -9507=>602,9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602,9516=>602, -9517=>602,9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602,9526=>602, -9527=>602,9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602,9536=>602, -9537=>602,9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602,9546=>602, -9547=>602,9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602,9556=>602, -9557=>602,9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602,9566=>602, -9567=>602,9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602,9576=>602, -9577=>602,9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602,9586=>602, -9587=>602,9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602,9596=>602, -9597=>602,9598=>602,9599=>602,9600=>602,9601=>602,9602=>602,9603=>602,9604=>602,9605=>602,9606=>602, -9607=>602,9608=>602,9609=>602,9610=>602,9611=>602,9612=>602,9613=>602,9614=>602,9615=>602,9616=>602, -9617=>602,9618=>602,9619=>602,9620=>602,9621=>602,9622=>602,9623=>602,9624=>602,9625=>602,9626=>602, -9627=>602,9628=>602,9629=>602,9630=>602,9631=>602,9632=>602,9633=>602,9634=>602,9635=>602,9636=>602, -9637=>602,9638=>602,9639=>602,9640=>602,9641=>602,9642=>602,9643=>602,9644=>602,9645=>602,9646=>602, -9647=>602,9648=>602,9649=>602,9650=>602,9651=>602,9652=>602,9653=>602,9654=>602,9655=>602,9656=>602, -9657=>602,9658=>602,9659=>602,9660=>602,9661=>602,9662=>602,9663=>602,9664=>602,9665=>602,9666=>602, -9667=>602,9668=>602,9669=>602,9670=>602,9671=>602,9672=>602,9673=>602,9674=>602,9675=>602,9676=>602, -9677=>602,9678=>602,9679=>602,9680=>602,9681=>602,9682=>602,9683=>602,9684=>602,9685=>602,9686=>602, -9687=>602,9688=>602,9689=>602,9690=>602,9691=>602,9692=>602,9693=>602,9694=>602,9695=>602,9696=>602, -9697=>602,9698=>602,9699=>602,9700=>602,9701=>602,9702=>602,9703=>602,9704=>602,9705=>602,9706=>602, -9707=>602,9708=>602,9709=>602,9710=>602,9711=>602,9712=>602,9713=>602,9714=>602,9715=>602,9716=>602, -9717=>602,9718=>602,9719=>602,9720=>602,9721=>602,9722=>602,9723=>602,9724=>602,9725=>602,9726=>602, -9727=>602,9728=>602,9784=>602,9785=>602,9786=>602,9787=>602,9788=>602,9791=>602,9792=>602,9793=>602, -9794=>602,9795=>602,9796=>602,9797=>602,9798=>602,9799=>602,9824=>602,9825=>602,9826=>602,9827=>602, -9828=>602,9829=>602,9830=>602,9831=>602,9833=>602,9834=>602,9835=>602,9836=>602,9837=>602,9838=>602, -9839=>602,10181=>602,10182=>602,10208=>602,10216=>602,10217=>602,10731=>602,10746=>602,10747=>602,10799=>602, -11026=>602,11027=>602,11028=>602,11029=>602,11030=>602,11031=>602,11032=>602,11033=>602,11034=>602,11364=>602, -11374=>602,11375=>602,11381=>602,11382=>602,11383=>602,11385=>602,11386=>602,11388=>602,11389=>602,11800=>602, -11810=>602,11811=>602,11812=>602,11813=>602,11822=>602,42760=>602,42761=>602,42762=>602,42763=>602,42764=>602, -42765=>602,42766=>602,42767=>602,42768=>602,42769=>602,42770=>602,42771=>602,42772=>602,42773=>602,42774=>602, -42779=>602,42780=>602,42781=>602,42782=>602,42783=>602,42790=>602,42791=>602,42889=>602,42890=>602,42891=>602, -42892=>602,63173=>602,64257=>602,64258=>602,65529=>602,65530=>602,65531=>602,65532=>602,65533=>602); -$enc=''; -$diff=''; -$file='dejavusansmonoi.z'; -$ctg='dejavusansmonoi.ctg.z'; -$originalsize=229284; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.z deleted file mode 100644 index fab337c9a4..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavusansmonoi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.ctg.z deleted file mode 100644 index 6e01b83783..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.php deleted file mode 100644 index 058684d0f5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.php +++ /dev/null @@ -1,313 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerif'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>6,'Flags'=>32,'FontBBox'=>'[-770 -347 1679 1242]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>318,33=>402,34=>460,35=>838,36=>636,37=>950,38=>890,39=>275,40=>390, -41=>390,42=>500,43=>838,44=>318,45=>338,46=>318,47=>337,48=>636,49=>636,50=>636, -51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838, -61=>838,62=>838,63=>536,64=>1000,65=>722,66=>735,67=>765,68=>802,69=>730,70=>694, -71=>799,72=>872,73=>395,74=>401,75=>747,76=>664,77=>1024,78=>875,79=>820,80=>673, -81=>820,82=>753,83=>685,84=>667,85=>843,86=>722,87=>1028,88=>712,89=>660,90=>695, -91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>596,98=>640,99=>560,100=>640, -101=>592,102=>370,103=>640,104=>644,105=>320,106=>310,107=>606,108=>320,109=>948,110=>644, -111=>602,112=>640,113=>640,114=>478,115=>513,116=>402,117=>644,118=>565,119=>856,120=>564, -121=>565,122=>527,123=>636,124=>337,125=>636,126=>838,8364=>636,8218=>318,402=>370,8222=>518, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1342,352=>685,8249=>400,338=>1137,381=>695,8216=>318, -8217=>318,8220=>511,8221=>511,8226=>590,8211=>500,8212=>1000,732=>500,8482=>1000,353=>513,8250=>400, -339=>989,382=>527,376=>660,160=>318,161=>402,162=>636,163=>636,164=>636,165=>636,166=>337, -167=>500,168=>500,169=>1000,170=>475,171=>612,172=>838,173=>338,174=>1000,175=>500,176=>500, -177=>838,178=>401,179=>401,180=>500,181=>650,182=>636,183=>318,184=>500,185=>401,186=>470, -187=>612,188=>969,189=>969,190=>969,191=>536,192=>722,193=>722,194=>722,195=>722,196=>722, -197=>722,198=>1001,199=>765,200=>730,201=>730,202=>730,203=>730,204=>395,205=>395,206=>395, -207=>395,208=>807,209=>875,210=>820,211=>820,212=>820,213=>820,214=>820,215=>838,216=>820, -217=>843,218=>843,219=>843,220=>843,221=>660,222=>676,223=>668,224=>596,225=>596,226=>596, -227=>596,228=>596,229=>596,230=>940,231=>560,232=>592,233=>592,234=>592,235=>592,236=>320, -237=>320,238=>320,239=>320,240=>602,241=>644,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>838,248=>602,249=>644,250=>644,251=>644,252=>644,253=>565,254=>640,255=>565,256=>722, -257=>596,258=>722,259=>596,260=>722,261=>596,262=>765,263=>560,264=>765,265=>560,266=>765, -267=>560,268=>765,269=>560,270=>802,271=>640,272=>807,273=>640,274=>730,275=>592,276=>730, -277=>592,278=>730,279=>592,280=>730,281=>592,282=>730,283=>592,284=>799,285=>640,286=>799, -287=>640,288=>799,289=>640,290=>799,291=>640,292=>872,293=>644,294=>872,295=>644,296=>395, -297=>320,298=>395,299=>320,300=>395,301=>320,302=>395,303=>320,304=>395,305=>320,306=>801, -307=>533,308=>401,309=>310,310=>747,311=>606,312=>606,313=>664,314=>320,315=>664,316=>320, -317=>664,318=>320,319=>664,320=>320,321=>669,322=>324,323=>875,324=>644,325=>875,326=>644, -327=>875,328=>644,329=>866,330=>843,331=>644,332=>820,333=>602,334=>820,335=>602,336=>820, -337=>602,340=>753,341=>478,342=>753,343=>478,344=>753,345=>478,346=>685,347=>513,348=>685, -349=>513,350=>685,351=>513,354=>667,355=>402,356=>667,357=>402,358=>667,359=>402,360=>843, -361=>644,362=>843,363=>644,364=>843,365=>644,366=>843,367=>644,368=>843,369=>644,370=>843, -371=>644,372=>1028,373=>856,374=>660,375=>565,377=>695,378=>527,379=>695,380=>527,383=>370, -384=>640,385=>735,386=>735,387=>640,388=>735,389=>640,390=>765,391=>765,392=>560,393=>807, -394=>802,395=>735,396=>640,397=>602,398=>730,399=>820,400=>623,401=>694,403=>799,404=>712, -405=>932,406=>395,407=>395,408=>747,409=>606,410=>320,411=>634,412=>948,413=>875,414=>644, -415=>820,416=>820,417=>602,418=>1040,419=>807,420=>673,421=>640,422=>753,423=>685,424=>513, -425=>707,426=>324,427=>402,428=>667,429=>402,430=>667,431=>843,432=>644,433=>829,434=>760, -435=>738,436=>663,437=>695,438=>527,439=>564,440=>564,441=>564,443=>636,444=>687,445=>564, -446=>536,448=>295,449=>492,450=>459,451=>295,452=>1497,453=>1329,454=>1167,455=>1065,456=>974, -457=>630,458=>1276,459=>1185,460=>954,461=>722,462=>596,463=>395,464=>320,465=>820,466=>602, -467=>843,468=>644,469=>843,470=>644,471=>843,472=>644,473=>843,474=>644,475=>843,476=>644, -477=>592,478=>722,479=>596,480=>722,481=>596,482=>1001,483=>940,484=>848,485=>640,486=>799, -487=>640,488=>747,489=>606,490=>820,491=>602,492=>820,493=>602,494=>564,495=>564,496=>320, -497=>1497,498=>1329,499=>1167,500=>799,501=>640,502=>1154,504=>875,505=>644,506=>722,507=>596, -508=>1001,509=>940,510=>820,511=>602,512=>722,513=>596,514=>722,515=>596,516=>730,517=>592, -518=>730,519=>592,520=>395,521=>320,522=>395,523=>320,524=>820,525=>602,526=>820,527=>602, -528=>753,529=>478,530=>753,531=>478,532=>843,533=>644,534=>843,535=>644,536=>685,537=>513, -538=>667,539=>402,540=>627,541=>521,542=>872,543=>644,544=>843,545=>814,548=>695,549=>527, -550=>722,551=>596,552=>730,553=>592,554=>820,555=>602,556=>820,557=>602,558=>820,559=>602, -560=>820,561=>602,562=>660,563=>565,564=>500,565=>832,566=>494,567=>310,568=>960,569=>960, -570=>722,571=>765,572=>560,573=>664,574=>667,575=>513,576=>527,577=>583,578=>464,581=>722, -592=>596,593=>640,594=>640,595=>640,596=>560,597=>560,598=>647,599=>683,600=>592,601=>592, -602=>843,603=>518,604=>509,605=>773,606=>613,607=>315,608=>683,609=>640,610=>544,611=>712, -612=>564,613=>644,614=>644,615=>644,616=>320,617=>392,618=>320,619=>380,620=>454,621=>363, -622=>704,623=>948,624=>948,625=>948,626=>644,627=>694,628=>646,629=>602,630=>790,631=>647, -632=>602,633=>501,634=>501,635=>551,636=>478,637=>478,638=>453,639=>453,640=>594,641=>594, -642=>513,643=>271,644=>370,645=>487,646=>324,647=>402,648=>402,649=>644,650=>620,651=>608, -652=>565,653=>856,654=>565,655=>655,656=>597,657=>560,658=>564,659=>560,660=>536,661=>536, -662=>536,663=>513,664=>820,665=>563,666=>613,667=>654,668=>667,669=>366,670=>606,671=>646, -672=>683,673=>536,674=>536,675=>996,676=>1033,677=>998,678=>809,679=>598,680=>782,681=>894, -682=>646,683=>676,684=>598,685=>443,686=>781,687=>767,688=>433,689=>430,690=>264,691=>347, -692=>347,693=>430,694=>392,695=>585,696=>423,697=>278,699=>318,700=>318,701=>318,702=>307, -703=>307,704=>280,705=>281,711=>500,712=>275,713=>500,716=>275,720=>337,721=>337,722=>307, -723=>307,726=>329,728=>500,729=>500,730=>500,731=>500,733=>500,734=>417,736=>447,737=>243, -738=>337,739=>424,740=>281,741=>493,742=>493,743=>493,744=>493,745=>493,750=>484,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>740,881=>531,884=>278, -885=>278,890=>500,891=>560,892=>560,893=>560,894=>337,900=>500,901=>500,902=>722,903=>318, -904=>900,905=>1039,906=>562,908=>835,910=>897,911=>853,912=>392,913=>722,914=>735,915=>694, -916=>722,917=>730,918=>695,919=>872,920=>820,921=>395,922=>747,923=>722,924=>1024,925=>875, -926=>704,927=>820,928=>872,929=>673,931=>707,932=>667,933=>660,934=>820,935=>712,936=>877, -937=>829,938=>395,939=>660,940=>675,941=>518,942=>599,943=>392,944=>608,945=>675,946=>578, -947=>598,948=>602,949=>518,950=>542,951=>599,952=>602,953=>392,954=>625,955=>634,956=>650, -957=>608,958=>551,959=>602,960=>657,961=>588,962=>560,963=>683,964=>553,965=>608,966=>700, -967=>606,968=>784,969=>815,970=>392,971=>608,972=>602,973=>608,974=>815,976=>583,977=>715, -978=>687,979=>874,980=>687,981=>682,982=>815,983=>624,984=>820,985=>602,986=>765,987=>560, -988=>694,989=>463,990=>590,991=>660,992=>782,993=>577,1008=>624,1009=>588,1010=>560,1011=>310, -1012=>820,1013=>560,1014=>560,1015=>676,1016=>640,1017=>765,1018=>1024,1019=>708,1020=>588,1021=>765, -1022=>765,1023=>765,1024=>730,1025=>730,1026=>799,1027=>662,1028=>765,1029=>685,1030=>395,1031=>395, -1032=>401,1033=>1084,1034=>1118,1035=>872,1036=>774,1037=>872,1038=>723,1039=>872,1040=>757,1041=>735, -1042=>735,1043=>662,1044=>813,1045=>730,1046=>1124,1047=>623,1048=>872,1049=>872,1050=>774,1051=>834, -1052=>1024,1053=>872,1054=>820,1055=>872,1056=>673,1057=>765,1058=>667,1059=>723,1060=>830,1061=>712, -1062=>872,1063=>773,1064=>1141,1065=>1141,1066=>794,1067=>984,1068=>674,1069=>765,1070=>1193,1071=>808, -1072=>596,1073=>602,1074=>563,1075=>524,1076=>616,1077=>592,1078=>920,1079=>545,1080=>667,1081=>667, -1082=>625,1083=>635,1084=>778,1085=>667,1086=>602,1087=>667,1088=>640,1089=>560,1090=>553,1091=>588, -1092=>783,1093=>564,1094=>643,1095=>661,1096=>930,1097=>930,1098=>636,1099=>796,1100=>544,1101=>560, -1102=>871,1103=>631,1104=>592,1105=>592,1106=>624,1107=>524,1108=>560,1109=>513,1110=>320,1111=>320, -1112=>310,1113=>843,1114=>860,1115=>644,1116=>625,1117=>667,1118=>588,1119=>656,1122=>762,1123=>603, -1124=>1129,1125=>834,1130=>1124,1131=>920,1136=>944,1137=>902,1138=>820,1139=>552,1140=>859,1141=>678, -1164=>707,1165=>544,1168=>672,1169=>529,1170=>662,1171=>523,1172=>728,1173=>614,1174=>1124,1175=>920, -1176=>636,1177=>537,1178=>774,1179=>606,1182=>774,1183=>625,1184=>891,1185=>717,1186=>872,1187=>641, -1188=>1139,1189=>852,1190=>1205,1191=>941,1194=>765,1195=>560,1196=>667,1197=>553,1198=>660,1199=>565, -1200=>660,1201=>565,1202=>712,1203=>564,1204=>952,1205=>732,1206=>749,1207=>690,1210=>749,1211=>644, -1216=>395,1217=>1124,1218=>920,1219=>747,1220=>606,1223=>872,1224=>667,1227=>749,1228=>667,1231=>320, -1232=>757,1233=>596,1234=>757,1235=>596,1236=>1001,1237=>940,1238=>730,1239=>592,1240=>820,1241=>592, -1242=>820,1243=>592,1244=>1124,1245=>920,1246=>623,1247=>545,1248=>564,1249=>564,1250=>872,1251=>667, -1252=>872,1253=>667,1254=>820,1255=>602,1256=>820,1257=>602,1258=>820,1259=>602,1260=>765,1261=>560, -1262=>723,1263=>588,1264=>723,1265=>588,1266=>723,1267=>588,1268=>773,1269=>661,1270=>662,1271=>524, -1272=>984,1273=>796,1296=>623,1297=>545,1298=>834,1299=>635,1300=>1198,1301=>919,1306=>820,1307=>640, -1308=>1028,1309=>856,4256=>723,4257=>850,4258=>828,4259=>859,4260=>733,4261=>981,4262=>916,4263=>1101, -4264=>566,4265=>750,4266=>962,4267=>941,4268=>743,4269=>1075,4270=>896,4271=>829,4272=>1040,4273=>733, -4274=>669,4275=>1015,4276=>937,4277=>1020,4278=>731,4279=>733,4280=>732,4281=>733,4282=>879,4283=>937, -4284=>714,4285=>755,4286=>733,4287=>958,4288=>1000,4289=>702,4290=>864,4291=>734,4292=>837,4293=>951, -4304=>541,4305=>571,4306=>589,4307=>833,4308=>561,4309=>557,4310=>618,4311=>861,4312=>560,4313=>546, -4314=>1066,4315=>586,4316=>586,4317=>825,4318=>570,4319=>581,4320=>824,4321=>607,4322=>748,4323=>698, -4324=>815,4325=>585,4326=>858,4327=>568,4328=>594,4329=>586,4330=>675,4331=>587,4332=>582,4333=>576, -4334=>612,4335=>683,4336=>572,4337=>603,4338=>571,4339=>572,4340=>570,4341=>649,4342=>886,4343=>626, -4344=>582,4345=>619,4346=>571,4347=>437,4348=>354,7426=>940,7432=>509,7433=>320,7444=>989,7446=>602, -7447=>602,7453=>737,7454=>948,7455=>948,7468=>455,7469=>630,7470=>463,7472=>505,7473=>459,7474=>459, -7475=>503,7476=>549,7477=>249,7478=>252,7479=>470,7480=>418,7481=>645,7482=>551,7483=>551,7484=>516, -7486=>424,7487=>474,7488=>420,7489=>531,7490=>647,7491=>386,7492=>386,7493=>400,7494=>618,7495=>400, -7496=>400,7497=>387,7498=>387,7499=>340,7500=>340,7501=>400,7502=>175,7503=>365,7504=>613,7505=>399, -7506=>385,7507=>346,7508=>385,7509=>385,7510=>400,7511=>247,7512=>399,7513=>464,7514=>613,7515=>373, -7522=>201,7523=>347,7524=>399,7525=>373,7543=>640,7544=>549,7547=>372,7557=>320,7579=>400,7580=>346, -7581=>346,7582=>385,7583=>340,7584=>222,7585=>229,7586=>400,7587=>399,7588=>234,7589=>244,7590=>234, -7591=>234,7592=>230,7593=>175,7594=>175,7595=>367,7596=>613,7597=>613,7598=>407,7599=>404,7600=>399, -7601=>385,7602=>385,7603=>328,7604=>211,7605=>247,7606=>399,7607=>389,7609=>376,7610=>373,7611=>331, -7612=>331,7613=>331,7614=>364,7615=>385,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>722,7681=>596,7682=>735,7683=>640,7684=>735,7685=>640,7686=>735,7687=>640,7688=>765,7689=>560, -7690=>802,7691=>640,7692=>802,7693=>640,7694=>802,7695=>640,7696=>802,7697=>640,7698=>802,7699=>640, -7700=>730,7701=>592,7702=>730,7703=>592,7704=>730,7705=>592,7706=>730,7707=>592,7708=>730,7709=>592, -7710=>694,7711=>370,7712=>799,7713=>640,7714=>872,7715=>644,7716=>872,7717=>644,7718=>872,7719=>644, -7720=>872,7721=>644,7722=>872,7723=>644,7724=>395,7725=>320,7728=>747,7729=>606,7730=>747,7731=>606, -7732=>747,7733=>606,7734=>664,7735=>320,7736=>664,7737=>320,7738=>664,7739=>320,7740=>664,7741=>320, -7742=>1024,7743=>948,7744=>1024,7745=>948,7746=>1024,7747=>948,7748=>875,7749=>644,7750=>875,7751=>644, -7752=>875,7753=>644,7754=>875,7755=>644,7756=>820,7757=>602,7760=>820,7761=>602,7762=>820,7763=>602, -7764=>673,7765=>640,7766=>673,7767=>640,7768=>753,7769=>478,7770=>753,7771=>478,7772=>753,7773=>478, -7774=>753,7775=>478,7776=>685,7777=>513,7778=>685,7779=>513,7784=>685,7785=>513,7786=>667,7787=>402, -7788=>667,7789=>402,7790=>667,7791=>402,7792=>667,7793=>402,7794=>843,7795=>644,7796=>843,7797=>644, -7798=>843,7799=>644,7800=>843,7801=>644,7802=>843,7803=>644,7804=>722,7805=>565,7806=>722,7807=>565, -7808=>1028,7809=>856,7810=>1028,7811=>856,7812=>1028,7813=>856,7814=>1028,7815=>856,7816=>1028,7817=>856, -7818=>712,7819=>564,7820=>712,7821=>564,7822=>660,7823=>565,7824=>695,7825=>527,7826=>695,7827=>527, -7828=>695,7829=>527,7830=>644,7831=>402,7832=>856,7833=>565,7834=>903,7835=>370,7838=>829,7839=>602, -7840=>722,7841=>596,7842=>722,7843=>596,7852=>722,7853=>596,7854=>722,7855=>596,7856=>722,7857=>596, -7858=>722,7859=>596,7860=>722,7861=>596,7862=>722,7863=>596,7864=>730,7865=>592,7866=>730,7867=>592, -7868=>730,7869=>592,7878=>730,7879=>592,7880=>395,7881=>320,7882=>395,7883=>320,7884=>820,7885=>602, -7886=>820,7887=>602,7896=>820,7897=>602,7908=>843,7909=>644,7910=>843,7911=>644,7922=>660,7923=>565, -7924=>660,7925=>565,7926=>660,7927=>565,7928=>660,7929=>565,7936=>675,7937=>675,7938=>675,7939=>675, -7940=>675,7941=>675,7942=>675,7943=>675,7944=>722,7945=>722,7946=>869,7947=>869,7948=>734,7949=>763, -7950=>722,7951=>722,7952=>537,7953=>537,7954=>537,7955=>537,7956=>537,7957=>537,7960=>853,7961=>841, -7962=>1067,7963=>1077,7964=>1008,7965=>1035,7968=>599,7969=>599,7970=>599,7971=>599,7972=>599,7973=>599, -7974=>599,7975=>599,7976=>998,7977=>992,7978=>1212,7979=>1224,7980=>1159,7981=>1183,7982=>1098,7983=>1095, -7984=>392,7985=>392,7986=>392,7987=>392,7988=>392,7989=>392,7990=>392,7991=>392,7992=>521,7993=>512, -7994=>735,7995=>738,7996=>679,7997=>706,7998=>624,7999=>615,8000=>602,8001=>602,8002=>602,8003=>602, -8004=>602,8005=>602,8008=>820,8009=>859,8010=>1120,8011=>1127,8012=>937,8013=>964,8016=>608,8017=>608, -8018=>608,8019=>608,8020=>608,8021=>608,8022=>608,8023=>608,8025=>851,8027=>1079,8029=>1044,8031=>953, -8032=>815,8033=>815,8034=>815,8035=>815,8036=>815,8037=>815,8038=>815,8039=>815,8040=>829,8041=>870, -8042=>1131,8043=>1137,8044=>946,8045=>976,8046=>938,8047=>970,8048=>675,8049=>675,8050=>537,8051=>537, -8052=>599,8053=>599,8054=>392,8055=>392,8056=>602,8057=>602,8058=>608,8059=>608,8060=>815,8061=>815, -8064=>675,8065=>675,8066=>675,8067=>675,8068=>675,8069=>675,8070=>675,8071=>675,8072=>722,8073=>722, -8074=>869,8075=>869,8076=>734,8077=>763,8078=>722,8079=>722,8080=>599,8081=>599,8082=>599,8083=>599, -8084=>599,8085=>599,8086=>599,8087=>599,8088=>998,8089=>992,8090=>1212,8091=>1224,8092=>1159,8093=>1183, -8094=>1098,8095=>1095,8096=>815,8097=>815,8098=>815,8099=>815,8100=>815,8101=>815,8102=>815,8103=>815, -8104=>829,8105=>870,8106=>1131,8107=>1137,8108=>946,8109=>976,8110=>938,8111=>970,8112=>675,8113=>675, -8114=>675,8115=>675,8116=>675,8118=>675,8119=>675,8120=>722,8121=>722,8122=>722,8123=>722,8124=>722, -8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>599,8131=>599,8132=>599,8134=>599,8135=>599, -8136=>912,8137=>900,8138=>1063,8139=>1039,8140=>872,8141=>500,8142=>500,8143=>500,8144=>392,8145=>392, -8146=>392,8147=>392,8150=>392,8151=>392,8152=>395,8153=>395,8154=>588,8155=>562,8157=>500,8158=>500, -8159=>500,8160=>608,8161=>608,8162=>608,8163=>608,8164=>588,8165=>588,8166=>608,8167=>608,8168=>660, -8169=>660,8170=>921,8171=>897,8172=>790,8173=>500,8174=>500,8175=>500,8178=>815,8179=>815,8180=>815, -8182=>815,8183=>815,8184=>961,8185=>835,8186=>984,8187=>853,8188=>829,8189=>500,8190=>500,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>636,8200=>318,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>338,8209=>338,8210=>636,8213=>1000,8214=>500, -8215=>500,8219=>318,8223=>511,8227=>590,8228=>334,8229=>667,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>200,8241=>1734,8242=>227,8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339, -8252=>527,8253=>536,8254=>500,8258=>1000,8260=>167,8261=>390,8262=>390,8263=>976,8264=>753,8265=>753, -8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8273=>500,8274=>450,8275=>1000,8279=>663,8287=>222, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>401,8305=>201,8308=>401,8309=>401,8310=>401,8311=>401,8312=>401,8313=>401,8314=>528, -8315=>528,8316=>528,8317=>246,8318=>246,8319=>433,8320=>401,8321=>401,8322=>401,8323=>401,8324=>401, -8325=>401,8326=>401,8327=>401,8328=>401,8329=>401,8330=>528,8331=>528,8332=>528,8333=>246,8334=>246, -8336=>386,8337=>387,8338=>385,8339=>424,8340=>387,8358=>660,8367=>1057,8369=>706,8372=>780,8373=>636, -8450=>796,8451=>1119,8457=>1047,8461=>945,8462=>644,8463=>644,8469=>914,8470=>946,8473=>752,8474=>871, -8477=>831,8484=>730,8486=>829,8487=>829,8490=>747,8491=>722,8508=>732,8509=>660,8510=>710,8511=>944, -8512=>714,8513=>775,8514=>557,8515=>557,8516=>611,8517=>867,8518=>699,8519=>636,8520=>380,8521=>362, -8523=>890,8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969,8537=>969,8538=>969,8539=>969, -8540=>969,8541=>969,8542=>969,8543=>568,8544=>395,8545=>590,8546=>786,8547=>966,8548=>722,8549=>981, -8550=>1176,8551=>1372,8552=>932,8553=>712,8554=>932,8555=>1127,8556=>664,8557=>765,8558=>802,8559=>1024, -8560=>320,8561=>640,8562=>959,8563=>885,8564=>565,8565=>885,8566=>1205,8567=>1524,8568=>884,8569=>564, -8570=>884,8571=>1204,8572=>320,8573=>560,8574=>640,8575=>948,8576=>1206,8577=>802,8578=>1206,8579=>765, -8580=>560,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838, -8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838, -8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838, -8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838, -8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838, -8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838, -8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838, -8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838, -8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838, -8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838, -8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838, -8701=>838,8702=>838,8703=>838,8704=>604,8706=>517,8707=>542,8708=>542,8710=>698,8711=>698,8712=>740, -8713=>740,8715=>740,8716=>740,8719=>796,8720=>796,8721=>714,8722=>838,8723=>838,8724=>838,8725=>337, -8727=>680,8728=>490,8729=>490,8730=>637,8731=>637,8732=>637,8733=>677,8734=>833,8735=>838,8736=>838, -8739=>291,8740=>479,8741=>462,8742=>634,8743=>732,8744=>732,8745=>838,8746=>838,8747=>521,8748=>852, -8749=>1182,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8770=>838,8771=>838,8776=>838, -8784=>838,8785=>838,8786=>838,8787=>838,8788=>1033,8789=>1033,8800=>838,8801=>838,8804=>838,8805=>838, -8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8844=>838,8845=>838,8846=>838,8847=>846, -8848=>846,8849=>846,8850=>846,8851=>838,8852=>838,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838, -8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>860,8867=>860, -8868=>940,8869=>940,8870=>567,8871=>567,8872=>860,8873=>860,8874=>860,8875=>1031,8876=>860,8877=>860, -8878=>860,8879=>1031,8901=>342,8962=>764,8968=>390,8969=>390,8970=>390,8971=>390,8976=>838,8977=>513, -8984=>1000,8985=>838,8992=>521,8993=>521,8997=>1000,9000=>1443,9085=>919,9134=>521,9167=>945,9251=>764, -9472=>602,9473=>602,9474=>602,9475=>602,9476=>602,9477=>602,9478=>602,9479=>602,9480=>602,9481=>602, -9482=>602,9483=>602,9484=>602,9485=>602,9486=>602,9487=>602,9488=>602,9489=>602,9490=>602,9491=>602, -9492=>602,9493=>602,9494=>602,9495=>602,9496=>602,9497=>602,9498=>602,9499=>602,9500=>602,9501=>602, -9502=>602,9503=>602,9504=>602,9505=>602,9506=>602,9507=>602,9508=>602,9509=>602,9510=>602,9511=>602, -9512=>602,9513=>602,9514=>602,9515=>602,9516=>602,9517=>602,9518=>602,9519=>602,9520=>602,9521=>602, -9522=>602,9523=>602,9524=>602,9525=>602,9526=>602,9527=>602,9528=>602,9529=>602,9530=>602,9531=>602, -9532=>602,9533=>602,9534=>602,9535=>602,9536=>602,9537=>602,9538=>602,9539=>602,9540=>602,9541=>602, -9542=>602,9543=>602,9544=>602,9545=>602,9546=>602,9547=>602,9548=>602,9549=>602,9550=>602,9551=>602, -9552=>602,9553=>602,9554=>602,9555=>602,9556=>602,9557=>602,9558=>602,9559=>602,9560=>602,9561=>602, -9562=>602,9563=>602,9564=>602,9565=>602,9566=>602,9567=>602,9568=>602,9569=>602,9570=>602,9571=>602, -9572=>602,9573=>602,9574=>602,9575=>602,9576=>602,9577=>602,9578=>602,9579=>602,9580=>602,9581=>602, -9582=>602,9583=>602,9584=>602,9585=>602,9586=>602,9587=>602,9588=>602,9589=>602,9590=>602,9591=>602, -9592=>602,9593=>602,9594=>602,9595=>602,9596=>602,9597=>602,9598=>602,9599=>602,9600=>769,9601=>769, -9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769, -9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769, -9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769, -9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945, -9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769, -9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769, -9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769, -9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873, -9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>791,9689=>970,9690=>970,9691=>970, -9692=>387,9693=>387,9694=>387,9695=>387,9696=>873,9697=>873,9698=>769,9699=>769,9700=>769,9701=>769, -9702=>590,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119, -9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769, -9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9784=>896,9785=>896,9786=>896, -9787=>896,9788=>896,9791=>614,9792=>731,9793=>731,9794=>896,9795=>896,9796=>896,9797=>896,9798=>896, -9799=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9833=>472, -9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,10145=>838,10181=>390,10182=>390,10208=>494, -10216=>390,10217=>390,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1033,10229=>1434,10230=>1434,10231=>1434, -10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>732,10241=>732, -10242=>732,10243=>732,10244=>732,10245=>732,10246=>732,10247=>732,10248=>732,10249=>732,10250=>732,10251=>732, -10252=>732,10253=>732,10254=>732,10255=>732,10256=>732,10257=>732,10258=>732,10259=>732,10260=>732,10261=>732, -10262=>732,10263=>732,10264=>732,10265=>732,10266=>732,10267=>732,10268=>732,10269=>732,10270=>732,10271=>732, -10272=>732,10273=>732,10274=>732,10275=>732,10276=>732,10277=>732,10278=>732,10279=>732,10280=>732,10281=>732, -10282=>732,10283=>732,10284=>732,10285=>732,10286=>732,10287=>732,10288=>732,10289=>732,10290=>732,10291=>732, -10292=>732,10293=>732,10294=>732,10295=>732,10296=>732,10297=>732,10298=>732,10299=>732,10300=>732,10301=>732, -10302=>732,10303=>732,10304=>732,10305=>732,10306=>732,10307=>732,10308=>732,10309=>732,10310=>732,10311=>732, -10312=>732,10313=>732,10314=>732,10315=>732,10316=>732,10317=>732,10318=>732,10319=>732,10320=>732,10321=>732, -10322=>732,10323=>732,10324=>732,10325=>732,10326=>732,10327=>732,10328=>732,10329=>732,10330=>732,10331=>732, -10332=>732,10333=>732,10334=>732,10335=>732,10336=>732,10337=>732,10338=>732,10339=>732,10340=>732,10341=>732, -10342=>732,10343=>732,10344=>732,10345=>732,10346=>732,10347=>732,10348=>732,10349=>732,10350=>732,10351=>732, -10352=>732,10353=>732,10354=>732,10355=>732,10356=>732,10357=>732,10358=>732,10359=>732,10360=>732,10361=>732, -10362=>732,10363=>732,10364=>732,10365=>732,10366=>732,10367=>732,10368=>732,10369=>732,10370=>732,10371=>732, -10372=>732,10373=>732,10374=>732,10375=>732,10376=>732,10377=>732,10378=>732,10379=>732,10380=>732,10381=>732, -10382=>732,10383=>732,10384=>732,10385=>732,10386=>732,10387=>732,10388=>732,10389=>732,10390=>732,10391=>732, -10392=>732,10393=>732,10394=>732,10395=>732,10396=>732,10397=>732,10398=>732,10399=>732,10400=>732,10401=>732, -10402=>732,10403=>732,10404=>732,10405=>732,10406=>732,10407=>732,10408=>732,10409=>732,10410=>732,10411=>732, -10412=>732,10413=>732,10414=>732,10415=>732,10416=>732,10417=>732,10418=>732,10419=>732,10420=>732,10421=>732, -10422=>732,10423=>732,10424=>732,10425=>732,10426=>732,10427=>732,10428=>732,10429=>732,10430=>732,10431=>732, -10432=>732,10433=>732,10434=>732,10435=>732,10436=>732,10437=>732,10438=>732,10439=>732,10440=>732,10441=>732, -10442=>732,10443=>732,10444=>732,10445=>732,10446=>732,10447=>732,10448=>732,10449=>732,10450=>732,10451=>732, -10452=>732,10453=>732,10454=>732,10455=>732,10456=>732,10457=>732,10458=>732,10459=>732,10460=>732,10461=>732, -10462=>732,10463=>732,10464=>732,10465=>732,10466=>732,10467=>732,10468=>732,10469=>732,10470=>732,10471=>732, -10472=>732,10473=>732,10474=>732,10475=>732,10476=>732,10477=>732,10478=>732,10479=>732,10480=>732,10481=>732, -10482=>732,10483=>732,10484=>732,10485=>732,10486=>732,10487=>732,10488=>732,10489=>732,10490=>732,10491=>732, -10492=>732,10493=>732,10494=>732,10495=>732,10496=>838,10497=>838,10498=>838,10499=>838,10500=>838,10501=>838, -10502=>838,10503=>838,10504=>838,10505=>838,10506=>838,10507=>838,10508=>838,10509=>838,10510=>838,10511=>838, -10512=>838,10513=>838,10514=>838,10515=>838,10516=>838,10517=>838,10518=>838,10519=>838,10520=>838,10521=>838, -10522=>838,10523=>838,10524=>838,10525=>838,10526=>838,10527=>838,10528=>838,10529=>838,10530=>838,10531=>838, -10532=>838,10533=>838,10534=>838,10535=>838,10536=>838,10537=>838,10538=>838,10539=>838,10540=>838,10541=>838, -10542=>838,10543=>838,10544=>838,10545=>838,10546=>838,10547=>838,10548=>838,10549=>838,10550=>838,10551=>838, -10552=>838,10553=>838,10554=>838,10555=>838,10556=>838,10557=>838,10558=>838,10559=>838,10560=>838,10561=>838, -10562=>838,10563=>838,10564=>838,10565=>838,10566=>838,10567=>838,10568=>838,10569=>838,10570=>838,10571=>838, -10572=>838,10573=>838,10574=>838,10575=>838,10576=>838,10577=>838,10578=>838,10579=>838,10580=>838,10581=>838, -10582=>838,10583=>838,10584=>838,10585=>838,10586=>838,10587=>838,10588=>838,10589=>838,10590=>838,10591=>838, -10592=>838,10593=>838,10594=>838,10595=>838,10596=>838,10597=>838,10598=>838,10599=>838,10600=>838,10601=>838, -10602=>838,10603=>838,10604=>838,10605=>838,10606=>838,10607=>838,10608=>838,10609=>838,10610=>838,10611=>838, -10612=>838,10613=>838,10614=>838,10615=>981,10616=>838,10617=>838,10618=>984,10619=>838,10620=>838,10621=>838, -10622=>838,10623=>838,10731=>494,10764=>1513,10765=>521,10766=>521,10799=>838,11008=>838,11009=>838,11010=>838, -11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838,11020=>838, -11021=>838,11022=>838,11023=>838,11024=>838,11025=>838,11026=>945,11027=>945,11028=>945,11029=>945,11030=>769, -11031=>769,11032=>769,11033=>769,11034=>945,11364=>753,11367=>872,11368=>644,11369=>747,11370=>606,11371=>695, -11372=>527,11374=>1024,11375=>722,11381=>740,11382=>556,11383=>700,11385=>501,11386=>602,11388=>264,11389=>455, -11520=>773,11521=>635,11522=>633,11523=>658,11524=>631,11525=>962,11526=>756,11527=>960,11528=>617,11529=>646, -11530=>962,11531=>632,11532=>646,11533=>962,11534=>645,11535=>866,11536=>961,11537=>645,11538=>645,11539=>959, -11540=>945,11541=>863,11542=>644,11543=>646,11544=>645,11545=>649,11546=>688,11547=>634,11548=>982,11549=>681, -11550=>676,11551=>852,11552=>957,11553=>632,11554=>645,11555=>646,11556=>749,11557=>914,11800=>536,11810=>390, -11811=>390,11812=>390,11813=>390,11822=>536,42564=>685,42565=>513,42566=>395,42567=>392,42576=>1104,42577=>888, -42580=>1193,42581=>871,42582=>1140,42583=>899,42760=>493,42761=>493,42762=>493,42763=>493,42764=>493,42765=>493, -42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493,42773=>493,42774=>493,42779=>369, -42780=>369,42781=>253,42782=>253,42783=>253,42891=>402,42892=>275,62464=>654,62465=>665,62466=>714,62467=>947, -62468=>665,62469=>659,62470=>725,62471=>986,62472=>665,62473=>665,62474=>1257,62475=>683,62476=>682,62477=>953, -62478=>665,62479=>682,62480=>999,62481=>746,62482=>798,62483=>748,62484=>944,62485=>681,62486=>936,62487=>680, -62488=>688,62489=>682,62490=>729,62491=>682,62492=>688,62493=>666,62494=>729,62495=>884,62496=>665,62497=>706, -62498=>666,62499=>665,62500=>665,62501=>722,62502=>961,62504=>904,63173=>602,63185=>500,63188=>500,64256=>710, -64257=>667,64258=>667,64259=>1028,64260=>1030,64261=>771,64262=>933,65024=>0,65025=>0,65026=>0,65027=>0, -65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0, -65038=>0,65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1025); -$enc=''; -$diff=''; -$file='dejavuserif.z'; -$ctg='dejavuserif.ctg.z'; -$originalsize=328908; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.z deleted file mode 100644 index 00235fa6ba..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserif.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.ctg.z deleted file mode 100644 index c1a3ccbf9e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.php deleted file mode 100644 index c91ee28c30..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.php +++ /dev/null @@ -1,299 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerif-Bold'; -$desc=array('Ascent'=>939,'Descent'=>-236,'CapHeight'=>5,'Flags'=>32,'FontBBox'=>'[-836 -389 1796 1235]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>348,33=>439,34=>521,35=>838,36=>696,37=>950,38=>903,39=>306,40=>473, -41=>473,42=>523,43=>838,44=>348,45=>415,46=>348,47=>365,48=>696,49=>696,50=>696, -51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>369,59=>369,60=>838, -61=>838,62=>838,63=>586,64=>1000,65=>776,66=>845,67=>796,68=>867,69=>762,70=>710, -71=>854,72=>945,73=>468,74=>473,75=>869,76=>703,77=>1107,78=>914,79=>871,80=>752, -81=>871,82=>831,83=>722,84=>744,85=>872,86=>776,87=>1123,88=>776,89=>714,90=>730, -91=>473,92=>365,93=>473,94=>838,95=>500,96=>500,97=>648,98=>699,99=>609,100=>699, -101=>636,102=>430,103=>699,104=>727,105=>380,106=>362,107=>693,108=>380,109=>1058,110=>727, -111=>667,112=>699,113=>699,114=>527,115=>563,116=>462,117=>727,118=>581,119=>861,120=>596, -121=>581,122=>568,123=>643,124=>364,125=>643,126=>838,8364=>696,8218=>348,402=>430,8222=>575, -8230=>1000,8224=>523,8225=>523,710=>500,8240=>1385,352=>722,8249=>400,338=>1180,381=>730,8216=>348, -8217=>348,8220=>575,8221=>575,8226=>639,8211=>500,8212=>1000,732=>500,8482=>1000,353=>563,8250=>400, -339=>1028,382=>568,376=>714,160=>348,161=>439,162=>696,163=>696,164=>636,165=>696,166=>364, -167=>523,168=>500,169=>1000,170=>487,171=>625,172=>838,173=>415,174=>1000,175=>500,176=>500, -177=>838,178=>438,179=>438,180=>500,181=>732,182=>636,183=>348,184=>500,185=>438,186=>500, -187=>625,188=>1043,189=>1043,190=>1043,191=>586,192=>776,193=>776,194=>776,195=>776,196=>776, -197=>776,198=>1034,199=>796,200=>762,201=>762,202=>762,203=>762,204=>468,205=>468,206=>468, -207=>468,208=>874,209=>914,210=>871,211=>871,212=>871,213=>871,214=>871,215=>838,216=>871, -217=>872,218=>872,219=>872,220=>872,221=>714,222=>757,223=>760,224=>648,225=>648,226=>648, -227=>648,228=>648,229=>648,230=>975,231=>609,232=>636,233=>636,234=>636,235=>636,236=>380, -237=>380,238=>380,239=>380,240=>667,241=>727,242=>667,243=>667,244=>667,245=>667,246=>667, -247=>838,248=>667,249=>727,250=>727,251=>727,252=>727,253=>581,254=>699,255=>581,256=>776, -257=>648,258=>776,259=>648,260=>776,261=>648,262=>796,263=>609,264=>796,265=>609,266=>796, -267=>609,268=>796,269=>609,270=>867,271=>699,272=>874,273=>699,274=>762,275=>636,276=>762, -277=>636,278=>762,279=>636,280=>762,281=>636,282=>762,283=>636,284=>854,285=>699,286=>854, -287=>699,288=>854,289=>699,290=>854,291=>699,292=>945,293=>727,294=>945,295=>727,296=>468, -297=>380,298=>468,299=>380,300=>468,301=>380,302=>468,303=>380,304=>468,305=>380,306=>942, -307=>751,308=>473,309=>362,310=>869,311=>693,312=>693,313=>703,314=>380,315=>703,316=>380, -317=>703,318=>380,319=>703,320=>380,321=>710,322=>385,323=>914,324=>727,325=>914,326=>727, -327=>914,328=>727,329=>1008,330=>872,331=>727,332=>871,333=>667,334=>871,335=>667,336=>871, -337=>667,340=>831,341=>527,342=>831,343=>527,344=>831,345=>527,346=>722,347=>563,348=>722, -349=>563,350=>722,351=>563,354=>744,355=>462,356=>744,357=>462,358=>744,359=>462,360=>872, -361=>727,362=>872,363=>727,364=>872,365=>727,366=>872,367=>727,368=>872,369=>727,370=>872, -371=>727,372=>1123,373=>861,374=>714,375=>581,377=>730,378=>568,379=>730,380=>568,383=>430, -384=>699,385=>845,386=>854,387=>699,388=>854,389=>699,390=>796,391=>796,392=>609,393=>874, -394=>867,395=>854,396=>699,397=>667,398=>762,399=>871,400=>721,401=>710,403=>854,404=>771, -405=>1043,406=>468,407=>468,408=>869,409=>693,410=>380,411=>701,412=>1058,413=>914,414=>727, -415=>871,416=>871,417=>667,418=>1200,419=>943,420=>752,421=>699,422=>831,423=>722,424=>563, -425=>707,426=>331,427=>462,428=>744,429=>462,430=>744,431=>872,432=>727,433=>890,434=>890, -435=>714,436=>708,437=>730,438=>568,439=>657,440=>657,441=>657,443=>696,444=>754,445=>568, -446=>536,448=>295,449=>492,450=>459,451=>295,452=>1597,453=>1435,454=>1267,455=>1176,456=>1065, -457=>742,458=>1387,459=>1276,460=>1089,461=>776,462=>648,463=>468,464=>380,465=>871,466=>667, -467=>872,468=>727,469=>872,470=>727,471=>872,472=>727,473=>872,474=>727,475=>872,476=>727, -477=>636,478=>776,479=>648,480=>776,481=>648,482=>1034,483=>975,484=>896,485=>699,486=>854, -487=>699,488=>869,489=>693,490=>871,491=>667,492=>871,493=>667,494=>657,495=>568,496=>380, -497=>1597,498=>1435,499=>1267,500=>854,501=>699,502=>1221,504=>914,505=>727,506=>776,507=>648, -508=>1034,509=>975,510=>871,511=>667,512=>776,513=>648,514=>776,515=>648,516=>762,517=>636, -518=>762,519=>636,520=>468,521=>380,522=>468,523=>380,524=>871,525=>667,526=>871,527=>667, -528=>831,529=>527,530=>831,531=>527,532=>872,533=>727,534=>872,535=>727,536=>722,537=>563, -538=>744,539=>462,540=>690,541=>607,542=>945,543=>727,544=>872,545=>791,548=>730,549=>568, -550=>776,551=>648,552=>762,553=>636,554=>871,555=>667,556=>871,557=>667,558=>871,559=>667, -560=>871,561=>667,562=>714,563=>581,564=>573,565=>922,566=>564,567=>362,568=>1031,569=>1031, -570=>776,571=>796,572=>609,573=>703,574=>744,575=>563,576=>568,577=>660,578=>547,581=>776, -592=>648,593=>699,594=>699,595=>699,596=>609,597=>609,598=>699,599=>730,600=>636,601=>636, -602=>907,603=>608,604=>562,605=>907,606=>720,607=>387,608=>699,609=>699,610=>626,611=>712, -612=>627,613=>727,614=>727,615=>727,616=>380,617=>380,618=>380,619=>409,620=>514,621=>380, -622=>795,623=>1058,624=>1058,625=>1058,626=>727,627=>727,628=>712,629=>667,630=>1061,631=>749, -632=>667,633=>571,634=>571,635=>571,636=>527,637=>527,638=>452,639=>487,640=>801,641=>801, -642=>563,643=>331,644=>430,645=>540,646=>331,647=>492,648=>462,649=>727,650=>679,651=>694, -652=>641,653=>907,654=>635,655=>727,656=>568,657=>568,658=>568,659=>568,660=>536,661=>536, -662=>536,663=>545,664=>871,665=>695,666=>720,667=>626,668=>732,669=>384,670=>740,671=>646, -672=>699,673=>536,674=>536,675=>1117,676=>1179,677=>1117,678=>911,679=>715,680=>909,681=>1039, -682=>790,683=>795,684=>662,685=>443,686=>613,687=>717,688=>521,689=>519,690=>313,691=>414, -692=>414,693=>480,694=>527,695=>662,696=>485,697=>302,699=>348,700=>348,701=>348,702=>366, -703=>366,704=>313,705=>313,711=>500,712=>282,713=>500,716=>282,720=>369,721=>369,722=>366, -723=>366,726=>392,728=>500,729=>500,730=>500,731=>500,733=>500,734=>417,736=>458,737=>292, -738=>395,739=>475,740=>313,741=>500,742=>500,743=>500,744=>500,745=>500,750=>553,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>779,881=>576,884=>302, -885=>302,890=>500,891=>609,892=>609,893=>609,894=>369,900=>500,901=>500,902=>776,903=>348, -904=>947,905=>1118,906=>662,908=>887,910=>953,911=>911,912=>484,913=>776,914=>845,915=>710, -916=>776,917=>762,918=>730,919=>945,920=>871,921=>468,922=>869,923=>776,924=>1107,925=>914, -926=>704,927=>871,928=>944,929=>752,931=>707,932=>744,933=>714,934=>871,935=>776,936=>913, -937=>890,938=>468,939=>714,940=>770,941=>608,942=>727,943=>484,944=>694,945=>770,946=>664, -947=>660,948=>667,949=>608,950=>592,951=>727,952=>667,953=>484,954=>750,955=>701,956=>732, -957=>694,958=>592,959=>667,960=>732,961=>665,962=>609,963=>737,964=>673,965=>694,966=>905, -967=>658,968=>941,969=>952,970=>484,971=>694,972=>667,973=>694,974=>952,976=>667,977=>849, -978=>764,979=>969,980=>764,981=>941,982=>952,983=>655,984=>871,985=>667,986=>796,987=>609, -988=>710,989=>527,990=>590,991=>660,992=>796,993=>667,1008=>655,1009=>665,1010=>609,1011=>362, -1012=>871,1013=>609,1014=>609,1015=>757,1016=>699,1017=>796,1018=>1107,1019=>860,1020=>692,1021=>796, -1022=>796,1023=>796,1024=>762,1025=>762,1026=>901,1027=>690,1028=>795,1029=>722,1030=>468,1031=>468, -1032=>473,1033=>1202,1034=>1262,1035=>963,1036=>910,1037=>945,1038=>812,1039=>945,1040=>814,1041=>854, -1042=>845,1043=>690,1044=>889,1045=>762,1046=>1312,1047=>721,1048=>945,1049=>945,1050=>910,1051=>884, -1052=>1107,1053=>945,1054=>871,1055=>944,1056=>752,1057=>796,1058=>744,1059=>812,1060=>949,1061=>776, -1062=>966,1063=>913,1064=>1268,1065=>1293,1066=>957,1067=>1202,1068=>825,1069=>795,1070=>1287,1071=>882, -1072=>648,1073=>667,1074=>695,1075=>613,1076=>667,1077=>636,1078=>1010,1079=>638,1080=>742,1081=>742, -1082=>722,1083=>705,1084=>869,1085=>732,1086=>667,1087=>732,1088=>699,1089=>609,1090=>620,1091=>640, -1092=>902,1093=>596,1094=>739,1095=>732,1096=>1075,1097=>1082,1098=>767,1099=>1002,1100=>679,1101=>609, -1102=>1025,1103=>739,1104=>636,1105=>636,1106=>719,1107=>613,1108=>609,1109=>563,1110=>380,1111=>380, -1112=>362,1113=>988,1114=>1015,1115=>727,1116=>722,1117=>742,1118=>640,1119=>732,1122=>880,1123=>703, -1124=>1195,1125=>963,1130=>1312,1131=>1010,1136=>1096,1137=>1105,1138=>871,1139=>652,1140=>916,1141=>749, -1164=>846,1165=>673,1168=>700,1169=>618,1170=>690,1171=>613,1172=>868,1173=>716,1174=>1312,1175=>1010, -1176=>721,1177=>638,1178=>947,1179=>744,1182=>910,1183=>722,1184=>1041,1185=>827,1186=>966,1187=>739, -1188=>1167,1189=>956,1190=>1345,1191=>1059,1194=>796,1195=>609,1196=>744,1197=>620,1198=>714,1199=>581, -1200=>714,1201=>581,1202=>866,1203=>649,1204=>1022,1205=>807,1206=>928,1207=>739,1210=>910,1211=>727, -1216=>468,1217=>1312,1218=>1010,1219=>869,1220=>693,1223=>945,1224=>732,1227=>913,1228=>732,1231=>380, -1232=>814,1233=>648,1234=>814,1235=>648,1236=>1034,1237=>975,1238=>762,1239=>636,1240=>871,1241=>636, -1242=>871,1243=>636,1244=>1312,1245=>1010,1246=>721,1247=>638,1248=>657,1249=>568,1250=>945,1251=>742, -1252=>945,1253=>742,1254=>871,1255=>667,1256=>871,1257=>667,1258=>871,1259=>667,1260=>795,1261=>609, -1262=>812,1263=>640,1264=>812,1265=>640,1266=>812,1267=>640,1268=>913,1269=>732,1270=>690,1271=>613, -1272=>1202,1273=>1002,1296=>721,1297=>638,1298=>884,1299=>705,1300=>1248,1301=>945,1306=>820,1307=>640, -1308=>1028,1309=>856,4256=>755,4257=>936,4258=>866,4259=>874,4260=>781,4261=>1078,4262=>1014,4263=>1213, -4264=>643,4265=>818,4266=>1051,4267=>1051,4268=>796,4269=>1135,4270=>969,4271=>902,4272=>1109,4273=>792, -4274=>756,4275=>1076,4276=>976,4277=>1066,4278=>811,4279=>833,4280=>821,4281=>833,4282=>908,4283=>1077, -4284=>769,4285=>822,4286=>813,4287=>1111,4288=>1123,4289=>802,4290=>892,4291=>802,4292=>880,4293=>1063, -4304=>594,4305=>625,4306=>643,4307=>887,4308=>615,4309=>611,4310=>667,4311=>915,4312=>613,4313=>600, -4314=>1120,4315=>640,4316=>640,4317=>879,4318=>624,4319=>634,4320=>877,4321=>666,4322=>780,4323=>751, -4324=>869,4325=>639,4326=>912,4327=>622,4328=>647,4329=>640,4330=>729,4331=>641,4332=>630,4333=>629, -4334=>670,4335=>753,4336=>625,4337=>657,4338=>625,4339=>625,4340=>624,4341=>670,4342=>940,4343=>680, -4344=>636,4345=>672,4346=>625,4347=>588,4348=>354,7426=>940,7432=>509,7433=>320,7444=>989,7446=>667, -7447=>667,7453=>737,7454=>948,7455=>948,7468=>489,7469=>651,7470=>532,7472=>546,7473=>480,7474=>480, -7475=>538,7476=>595,7477=>294,7478=>298,7479=>547,7480=>443,7481=>697,7482=>576,7483=>576,7484=>548, -7486=>474,7487=>523,7488=>455,7489=>469,7490=>549,7491=>466,7492=>466,7493=>498,7494=>657,7495=>499, -7496=>498,7497=>444,7498=>444,7499=>412,7500=>412,7501=>498,7502=>300,7503=>523,7504=>729,7505=>473, -7506=>467,7507=>427,7508=>467,7509=>467,7510=>499,7511=>371,7512=>520,7513=>434,7514=>729,7515=>491, -7522=>239,7523=>414,7524=>520,7525=>491,7543=>640,7544=>595,7547=>380,7557=>380,7579=>498,7580=>427, -7581=>427,7582=>467,7583=>412,7584=>383,7585=>373,7586=>498,7587=>522,7588=>300,7589=>307,7590=>300, -7591=>300,7592=>370,7593=>368,7594=>321,7595=>430,7596=>682,7597=>729,7598=>588,7599=>587,7600=>472, -7601=>467,7602=>522,7603=>400,7604=>387,7605=>371,7606=>520,7607=>475,7609=>489,7610=>491,7611=>412, -7612=>527,7613=>412,7614=>452,7615=>467,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>776,7681=>648,7682=>845,7683=>699,7684=>845,7685=>699,7686=>845,7687=>699,7688=>796,7689=>609, -7690=>867,7691=>699,7692=>867,7693=>699,7694=>867,7695=>699,7696=>867,7697=>699,7698=>867,7699=>699, -7700=>762,7701=>636,7702=>762,7703=>636,7704=>762,7705=>636,7706=>762,7707=>636,7708=>762,7709=>636, -7710=>710,7711=>430,7712=>854,7713=>699,7714=>945,7715=>727,7716=>945,7717=>727,7718=>945,7719=>727, -7720=>945,7721=>727,7722=>945,7723=>727,7724=>468,7725=>380,7728=>869,7729=>693,7730=>869,7731=>693, -7732=>869,7733=>693,7734=>703,7735=>380,7736=>703,7737=>380,7738=>703,7739=>380,7740=>703,7741=>380, -7742=>1107,7743=>1058,7744=>1107,7745=>1058,7746=>1107,7747=>1058,7748=>914,7749=>727,7750=>914,7751=>727, -7752=>914,7753=>727,7754=>914,7755=>727,7756=>871,7757=>667,7760=>871,7761=>667,7762=>871,7763=>667, -7764=>752,7765=>699,7766=>752,7767=>699,7768=>831,7769=>527,7770=>831,7771=>527,7772=>831,7773=>527, -7774=>831,7775=>527,7776=>722,7777=>563,7778=>722,7779=>563,7784=>722,7785=>563,7786=>744,7787=>462, -7788=>744,7789=>462,7790=>744,7791=>462,7792=>744,7793=>462,7794=>872,7795=>727,7796=>872,7797=>727, -7798=>872,7799=>727,7800=>872,7801=>727,7802=>872,7803=>727,7804=>776,7805=>581,7806=>776,7807=>581, -7808=>1123,7809=>861,7810=>1123,7811=>861,7812=>1123,7813=>861,7814=>1123,7815=>861,7816=>1123,7817=>861, -7818=>776,7819=>596,7820=>776,7821=>596,7822=>714,7823=>581,7824=>730,7825=>568,7826=>730,7827=>568, -7828=>730,7829=>568,7830=>727,7831=>462,7832=>861,7833=>581,7834=>1014,7835=>430,7838=>947,7839=>667, -7840=>776,7841=>648,7842=>776,7843=>648,7852=>776,7853=>648,7854=>776,7855=>648,7856=>776,7857=>648, -7858=>776,7859=>648,7860=>776,7861=>648,7862=>776,7863=>648,7864=>762,7865=>636,7866=>762,7867=>636, -7868=>762,7869=>636,7878=>762,7879=>636,7880=>468,7881=>380,7882=>468,7883=>380,7884=>871,7885=>667, -7886=>871,7887=>667,7896=>871,7897=>667,7908=>872,7909=>727,7910=>872,7911=>727,7922=>714,7923=>581, -7924=>714,7925=>581,7926=>714,7927=>581,7928=>714,7929=>581,7936=>770,7937=>770,7938=>770,7939=>770, -7940=>770,7941=>770,7942=>770,7943=>770,7944=>776,7945=>776,7946=>978,7947=>978,7948=>832,7949=>849, -7950=>776,7951=>776,7952=>608,7953=>608,7954=>608,7955=>608,7956=>608,7957=>608,7960=>917,7961=>909, -7962=>1169,7963=>1169,7964=>1093,7965=>1120,7968=>727,7969=>727,7970=>727,7971=>727,7972=>727,7973=>727, -7974=>727,7975=>727,7976=>1100,7977=>1094,7978=>1358,7979=>1361,7980=>1279,7981=>1308,7982=>1197,7983=>1194, -7984=>484,7985=>484,7986=>484,7987=>484,7988=>484,7989=>484,7990=>484,7991=>484,7992=>629,7993=>617, -7994=>878,7995=>881,7996=>799,7997=>831,7998=>723,7999=>714,8000=>667,8001=>667,8002=>667,8003=>667, -8004=>667,8005=>667,8008=>900,8009=>935,8010=>1240,8011=>1237,8012=>1035,8013=>1066,8016=>694,8017=>694, -8018=>694,8019=>694,8020=>694,8021=>694,8022=>694,8023=>694,8025=>922,8027=>1186,8029=>1133,8031=>1019, -8032=>952,8033=>952,8034=>952,8035=>952,8036=>952,8037=>952,8038=>952,8039=>952,8040=>931,8041=>963, -8042=>1268,8043=>1274,8044=>1054,8045=>1088,8046=>1023,8047=>1060,8048=>770,8049=>770,8050=>608,8051=>608, -8052=>727,8053=>727,8054=>484,8055=>484,8056=>667,8057=>667,8058=>694,8059=>694,8060=>952,8061=>952, -8064=>770,8065=>770,8066=>770,8067=>770,8068=>770,8069=>770,8070=>770,8071=>770,8072=>776,8073=>776, -8074=>978,8075=>978,8076=>832,8077=>849,8078=>776,8079=>776,8080=>727,8081=>727,8082=>727,8083=>727, -8084=>727,8085=>727,8086=>727,8087=>727,8088=>1100,8089=>1094,8090=>1358,8091=>1361,8092=>1279,8093=>1308, -8094=>1197,8095=>1194,8096=>952,8097=>952,8098=>952,8099=>952,8100=>952,8101=>952,8102=>952,8103=>952, -8104=>931,8105=>963,8106=>1268,8107=>1274,8108=>1054,8109=>1088,8110=>1023,8111=>1060,8112=>770,8113=>770, -8114=>770,8115=>770,8116=>770,8118=>770,8119=>770,8120=>776,8121=>776,8122=>811,8123=>776,8124=>776, -8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>727,8131=>727,8132=>727,8134=>727,8135=>727, -8136=>1000,8137=>947,8138=>1191,8139=>1118,8140=>945,8141=>500,8142=>500,8143=>500,8144=>484,8145=>484, -8146=>484,8147=>484,8150=>484,8151=>484,8152=>468,8153=>468,8154=>714,8155=>662,8157=>500,8158=>500, -8159=>500,8160=>694,8161=>694,8162=>694,8163=>694,8164=>665,8165=>665,8166=>694,8167=>694,8168=>714, -8169=>714,8170=>1019,8171=>953,8172=>910,8173=>500,8174=>500,8175=>500,8178=>952,8179=>952,8180=>952, -8182=>952,8183=>952,8184=>1069,8185=>887,8186=>1101,8187=>911,8188=>890,8189=>500,8190=>500,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>696,8200=>348,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>415,8209=>415,8210=>696,8213=>1000,8214=>500, -8215=>500,8219=>348,8223=>575,8227=>639,8228=>348,8229=>674,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>200,8241=>1820,8242=>264,8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733, -8252=>629,8253=>586,8254=>500,8258=>1023,8260=>167,8261=>473,8262=>473,8263=>1082,8264=>856,8265=>856, -8267=>636,8268=>500,8269=>500,8270=>523,8271=>369,8273=>523,8274=>556,8275=>1000,8279=>813,8287=>222, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>438,8305=>239,8308=>438,8309=>438,8310=>438,8311=>438,8312=>438,8313=>438,8314=>528, -8315=>528,8316=>528,8317=>298,8318=>298,8319=>519,8320=>438,8321=>438,8322=>438,8323=>438,8324=>438, -8325=>438,8326=>438,8327=>438,8328=>438,8329=>438,8330=>528,8331=>528,8332=>528,8333=>298,8334=>298, -8336=>466,8337=>444,8338=>467,8339=>475,8340=>444,8358=>696,8367=>1155,8369=>790,8372=>876,8373=>696, -8451=>1198,8457=>1112,8462=>727,8463=>727,8470=>1087,8486=>890,8487=>890,8490=>869,8491=>776,8513=>775, -8514=>557,8515=>637,8516=>760,8523=>903,8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035, -8537=>1035,8538=>1035,8539=>1035,8540=>1035,8541=>1035,8542=>1035,8543=>615,8544=>468,8545=>736,8546=>1005, -8547=>1093,8548=>776,8549=>1127,8550=>1396,8551=>1664,8552=>1069,8553=>776,8554=>1078,8555=>1347,8556=>703, -8557=>796,8558=>867,8559=>1107,8560=>380,8561=>760,8562=>1140,8563=>961,8564=>581,8565=>961,8566=>1341, -8567=>1721,8568=>976,8569=>596,8570=>976,8571=>1356,8572=>380,8573=>609,8574=>699,8575=>1058,8576=>1255, -8577=>867,8578=>1268,8579=>796,8580=>609,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838, -8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838, -8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838, -8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>850,8624=>838,8625=>838,8626=>838,8627=>838, -8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838, -8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838, -8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838, -8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838, -8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838, -8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838, -8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838, -8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>641,8706=>534,8707=>620,8708=>620, -8710=>753,8711=>753,8712=>740,8713=>740,8715=>740,8716=>740,8719=>842,8720=>842,8721=>753,8722=>838, -8723=>838,8724=>838,8725=>365,8727=>691,8728=>519,8729=>519,8730=>657,8731=>657,8732=>657,8733=>672, -8734=>833,8735=>838,8736=>838,8739=>324,8740=>607,8741=>529,8742=>773,8743=>812,8744=>812,8745=>838, -8746=>838,8747=>579,8748=>1000,8749=>1391,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838, -8770=>838,8771=>838,8776=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1082,8789=>1082,8800=>838, -8801=>838,8804=>838,8805=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8844=>838, -8845=>838,8846=>838,8847=>838,8848=>838,8849=>838,8850=>838,8851=>838,8852=>838,8853=>838,8854=>838, -8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838, -8865=>838,8866=>884,8867=>884,8868=>960,8869=>960,8870=>616,8871=>616,8872=>884,8873=>884,8874=>884, -8875=>1080,8876=>884,8877=>884,8878=>884,8879=>1080,8901=>398,8962=>834,8968=>473,8969=>473,8970=>473, -8971=>473,8976=>838,8977=>539,8984=>928,8985=>838,8992=>579,8993=>579,8997=>1000,9000=>1443,9085=>1008, -9134=>579,9167=>945,9251=>834,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769, -9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769, -9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769, -9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945, -9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550, -9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502, -9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502, -9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873, -9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527, -9687=>527,9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873, -9697=>873,9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945, -9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873, -9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732, -9727=>769,9728=>896,9784=>896,9785=>896,9786=>896,9787=>896,9788=>896,9791=>614,9792=>731,9793=>731, -9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9824=>896,9825=>896,9826=>896,9827=>896, -9828=>896,9829=>896,9830=>896,9831=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357, -9839=>484,10145=>838,10181=>457,10182=>457,10208=>494,10216=>457,10217=>457,10224=>838,10225=>838,10226=>838, -10227=>838,10228=>1033,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434, -10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781,10245=>781,10246=>781, -10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781,10255=>781,10256=>781, -10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781,10265=>781,10266=>781, -10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781,10275=>781,10276=>781, -10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781,10285=>781,10286=>781, -10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781,10295=>781,10296=>781, -10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781,10305=>781,10306=>781, -10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781,10315=>781,10316=>781, -10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781,10325=>781,10326=>781, -10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781,10335=>781,10336=>781, -10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781,10345=>781,10346=>781, -10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781,10355=>781,10356=>781, -10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781,10365=>781,10366=>781, -10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781,10375=>781,10376=>781, -10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781,10385=>781,10386=>781, -10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781,10395=>781,10396=>781, -10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781,10405=>781,10406=>781, -10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781,10415=>781,10416=>781, -10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781,10425=>781,10426=>781, -10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781,10435=>781,10436=>781, -10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781,10445=>781,10446=>781, -10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781,10455=>781,10456=>781, -10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781,10465=>781,10466=>781, -10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781,10475=>781,10476=>781, -10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781,10485=>781,10486=>781, -10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781,10495=>781,10496=>838, -10497=>838,10498=>838,10499=>838,10500=>838,10501=>838,10502=>838,10503=>838,10504=>838,10505=>838,10506=>838, -10507=>838,10508=>838,10509=>838,10510=>838,10511=>838,10512=>838,10513=>838,10514=>838,10515=>838,10516=>838, -10517=>838,10518=>838,10519=>838,10520=>838,10521=>838,10522=>838,10523=>838,10524=>838,10525=>838,10526=>838, -10527=>838,10528=>838,10529=>838,10530=>838,10531=>838,10532=>838,10533=>838,10534=>838,10535=>838,10536=>838, -10537=>838,10538=>838,10539=>838,10540=>838,10541=>838,10542=>838,10543=>838,10544=>838,10545=>838,10546=>838, -10547=>838,10548=>838,10549=>838,10550=>838,10551=>838,10552=>838,10553=>838,10554=>838,10555=>838,10556=>838, -10557=>838,10558=>838,10559=>838,10560=>838,10561=>838,10562=>838,10563=>838,10564=>838,10565=>838,10566=>838, -10567=>838,10568=>838,10569=>838,10570=>838,10571=>838,10572=>838,10573=>838,10574=>838,10575=>838,10576=>838, -10577=>838,10578=>838,10579=>838,10580=>838,10581=>838,10582=>838,10583=>838,10584=>838,10585=>838,10586=>838, -10587=>838,10588=>838,10589=>838,10590=>838,10591=>838,10592=>838,10593=>838,10594=>838,10595=>838,10596=>838, -10597=>838,10598=>838,10599=>838,10600=>838,10601=>838,10602=>838,10603=>838,10604=>838,10605=>838,10606=>838, -10607=>838,10608=>838,10609=>838,10610=>838,10611=>838,10612=>838,10613=>838,10614=>838,10615=>1032,10616=>838, -10617=>838,10618=>960,10619=>838,10620=>838,10621=>838,10622=>838,10623=>838,10731=>494,10764=>1782,10765=>610, -10766=>610,10799=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838, -11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838, -11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11364=>831, -11367=>945,11368=>727,11369=>869,11370=>693,11371=>730,11372=>568,11374=>1107,11375=>776,11381=>779,11382=>601, -11383=>905,11385=>571,11386=>667,11388=>313,11389=>489,11520=>773,11521=>635,11522=>804,11523=>658,11524=>788, -11525=>962,11526=>756,11527=>960,11528=>617,11529=>646,11530=>962,11531=>631,11532=>646,11533=>962,11534=>846, -11535=>866,11536=>961,11537=>645,11538=>645,11539=>959,11540=>945,11541=>863,11542=>644,11543=>646,11544=>645, -11545=>649,11546=>688,11547=>936,11548=>982,11549=>681,11550=>676,11551=>852,11552=>1113,11553=>632,11554=>645, -11555=>646,11556=>749,11557=>914,11800=>586,11810=>473,11811=>473,11812=>473,11813=>473,11822=>586,42564=>722, -42565=>563,42566=>468,42567=>380,42576=>1333,42577=>1092,42580=>1287,42581=>1025,42582=>1287,42583=>1039,42760=>500, -42761=>500,42762=>500,42763=>500,42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500, -42771=>500,42772=>500,42773=>500,42774=>500,42779=>384,42780=>384,42781=>276,42782=>276,42783=>276,42891=>439, -42892=>306,62464=>705,62465=>716,62466=>765,62467=>999,62468=>716,62469=>710,62470=>776,62471=>1038,62472=>716, -62473=>716,62474=>1309,62475=>734,62476=>733,62477=>1004,62478=>716,62479=>733,62480=>1050,62481=>797,62482=>850, -62483=>799,62484=>996,62485=>732,62486=>987,62487=>731,62488=>739,62489=>733,62490=>780,62491=>733,62492=>739, -62493=>717,62494=>780,62495=>936,62496=>716,62497=>826,62498=>717,62499=>716,62500=>716,62501=>773,62502=>1013, -62504=>904,63173=>667,63185=>500,63188=>500,64256=>821,64257=>727,64258=>727,64259=>1120,64260=>1117,64261=>871, -64262=>971,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65529=>0,65530=>0,65531=>0, -65532=>0,65533=>1113); -$enc=''; -$diff=''; -$file='dejavuserifb.z'; -$ctg='dejavuserifb.ctg.z'; -$originalsize=306532; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.z deleted file mode 100644 index f73e4f3eba..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.ctg.z deleted file mode 100644 index d237ae7e0e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.php deleted file mode 100644 index 89c46f4e20..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.php +++ /dev/null @@ -1,299 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerif-BoldItalic'; -$desc=array('Ascent'=>939,'Descent'=>-236,'CapHeight'=>-53,'Flags'=>96,'FontBBox'=>'[-906 -389 1760 1235]','ItalicAngle'=>-11,'StemV'=>120,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>348,33=>439,34=>521,35=>838,36=>696,37=>950,38=>903,39=>306,40=>473, -41=>473,42=>523,43=>838,44=>348,45=>415,46=>348,47=>365,48=>696,49=>696,50=>696, -51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>369,59=>369,60=>838, -61=>838,62=>838,63=>586,64=>1000,65=>776,66=>845,67=>796,68=>867,69=>762,70=>710, -71=>854,72=>945,73=>468,74=>473,75=>869,76=>703,77=>1107,78=>914,79=>871,80=>752, -81=>871,82=>831,83=>722,84=>744,85=>872,86=>776,87=>1123,88=>776,89=>714,90=>730, -91=>473,92=>365,93=>473,94=>838,95=>500,96=>500,97=>648,98=>699,99=>609,100=>699, -101=>636,102=>430,103=>699,104=>727,105=>380,106=>362,107=>693,108=>380,109=>1058,110=>727, -111=>667,112=>699,113=>699,114=>527,115=>563,116=>462,117=>727,118=>581,119=>861,120=>596, -121=>581,122=>568,123=>643,124=>364,125=>643,126=>838,8364=>696,8218=>348,402=>430,8222=>575, -8230=>1000,8224=>523,8225=>523,710=>500,8240=>1385,352=>722,8249=>400,338=>1180,381=>730,8216=>348, -8217=>348,8220=>575,8221=>575,8226=>639,8211=>500,8212=>1000,732=>500,8482=>1000,353=>563,8250=>400, -339=>1028,382=>568,376=>714,160=>348,161=>439,162=>696,163=>696,164=>636,165=>696,166=>364, -167=>523,168=>500,169=>1000,170=>487,171=>625,172=>838,173=>415,174=>1000,175=>500,176=>500, -177=>838,178=>438,179=>438,180=>500,181=>732,182=>636,183=>348,184=>500,185=>438,186=>500, -187=>625,188=>1043,189=>1043,190=>1043,191=>586,192=>776,193=>776,194=>776,195=>776,196=>776, -197=>776,198=>1034,199=>796,200=>762,201=>762,202=>762,203=>762,204=>468,205=>468,206=>468, -207=>468,208=>874,209=>914,210=>871,211=>871,212=>871,213=>871,214=>871,215=>838,216=>871, -217=>872,218=>872,219=>872,220=>872,221=>714,222=>757,223=>760,224=>648,225=>648,226=>648, -227=>648,228=>648,229=>648,230=>932,231=>609,232=>636,233=>636,234=>636,235=>636,236=>380, -237=>380,238=>380,239=>380,240=>667,241=>727,242=>667,243=>667,244=>667,245=>667,246=>667, -247=>838,248=>667,249=>727,250=>727,251=>727,252=>727,253=>581,254=>699,255=>581,256=>776, -257=>648,258=>776,259=>648,260=>776,261=>648,262=>796,263=>609,264=>796,265=>609,266=>796, -267=>609,268=>796,269=>609,270=>867,271=>699,272=>874,273=>699,274=>762,275=>636,276=>762, -277=>636,278=>762,279=>636,280=>762,281=>636,282=>762,283=>636,284=>854,285=>699,286=>854, -287=>699,288=>854,289=>699,290=>854,291=>699,292=>945,293=>727,294=>945,295=>727,296=>468, -297=>380,298=>468,299=>380,300=>468,301=>380,302=>468,303=>380,304=>468,305=>380,306=>942, -307=>751,308=>473,309=>362,310=>869,311=>693,312=>693,313=>703,314=>380,315=>703,316=>380, -317=>703,318=>508,319=>703,320=>557,321=>710,322=>385,323=>914,324=>727,325=>914,326=>727, -327=>914,328=>727,329=>1008,330=>872,331=>727,332=>871,333=>667,334=>871,335=>667,336=>871, -337=>667,340=>831,341=>527,342=>831,343=>527,344=>831,345=>527,346=>722,347=>563,348=>722, -349=>563,350=>722,351=>563,354=>744,355=>462,356=>744,357=>462,358=>744,359=>462,360=>872, -361=>727,362=>872,363=>727,364=>872,365=>727,366=>872,367=>727,368=>872,369=>727,370=>872, -371=>727,372=>1123,373=>861,374=>714,375=>581,377=>730,378=>568,379=>730,380=>568,383=>430, -384=>699,385=>845,386=>854,387=>699,388=>854,389=>699,390=>796,391=>796,392=>609,393=>874, -394=>867,395=>854,396=>699,397=>667,398=>762,399=>871,400=>721,401=>710,403=>854,404=>771, -405=>1043,406=>468,407=>468,408=>869,409=>693,410=>380,411=>701,412=>1058,413=>914,414=>727, -415=>871,416=>871,417=>667,418=>1200,419=>943,420=>752,421=>699,422=>831,423=>722,424=>563, -425=>707,426=>331,427=>462,428=>744,429=>462,430=>744,431=>872,432=>727,433=>890,434=>890, -435=>714,436=>699,437=>730,438=>568,439=>657,440=>657,441=>657,443=>696,444=>754,445=>568, -446=>536,448=>295,449=>492,450=>459,451=>295,452=>1597,453=>1435,454=>1267,455=>1176,456=>1065, -457=>742,458=>1387,459=>1276,460=>1089,461=>776,462=>648,463=>468,464=>380,465=>871,466=>667, -467=>872,468=>727,469=>872,470=>727,471=>872,472=>727,473=>872,474=>727,475=>872,476=>727, -477=>636,478=>776,479=>648,480=>776,481=>648,482=>1034,483=>975,484=>896,485=>699,486=>854, -487=>699,488=>869,489=>693,490=>871,491=>667,492=>871,493=>667,494=>657,495=>568,496=>362, -497=>1597,498=>1435,499=>1267,500=>854,501=>699,502=>1221,504=>914,505=>727,506=>776,507=>648, -508=>1034,509=>932,510=>871,511=>667,512=>776,513=>648,514=>776,515=>648,516=>762,517=>636, -518=>762,519=>636,520=>468,521=>380,522=>468,523=>380,524=>871,525=>667,526=>871,527=>667, -528=>831,529=>527,530=>831,531=>527,532=>872,533=>727,534=>872,535=>727,536=>722,537=>563, -538=>744,539=>462,540=>690,541=>607,542=>945,543=>727,544=>872,545=>791,548=>730,549=>568, -550=>776,551=>648,552=>762,553=>636,554=>871,555=>667,556=>871,557=>667,558=>871,559=>667, -560=>871,561=>667,562=>714,563=>581,564=>573,565=>922,566=>564,567=>362,568=>1031,569=>1031, -570=>776,571=>796,572=>609,573=>703,574=>744,575=>563,576=>568,577=>660,578=>547,581=>776, -592=>648,593=>699,594=>699,595=>699,596=>609,597=>609,598=>699,599=>730,600=>636,601=>636, -602=>907,603=>608,604=>562,605=>907,606=>720,607=>387,608=>699,609=>699,610=>626,611=>712, -612=>627,613=>727,614=>727,615=>727,616=>380,617=>380,618=>380,619=>409,620=>514,621=>380, -622=>795,623=>1058,624=>1058,625=>1058,626=>727,627=>727,628=>712,629=>667,630=>1061,631=>749, -632=>667,633=>571,634=>571,635=>571,636=>527,637=>527,638=>452,639=>487,640=>801,641=>801, -642=>563,643=>331,644=>430,645=>540,646=>331,647=>492,648=>462,649=>727,650=>679,651=>694, -652=>581,653=>861,654=>635,655=>727,656=>568,657=>568,658=>568,659=>568,660=>536,661=>536, -662=>536,663=>545,664=>871,665=>695,666=>720,667=>626,668=>732,669=>384,670=>740,671=>646, -672=>699,673=>536,674=>536,675=>1117,676=>1179,677=>1117,678=>911,679=>715,680=>909,681=>1039, -682=>790,683=>795,684=>662,685=>443,686=>613,687=>717,688=>521,689=>519,690=>313,691=>414, -692=>414,693=>480,694=>527,695=>542,696=>366,697=>302,699=>348,700=>348,701=>348,702=>366, -703=>366,704=>313,705=>313,711=>500,712=>282,713=>500,716=>282,720=>369,721=>369,722=>366, -723=>366,726=>392,728=>500,729=>500,730=>500,731=>500,733=>500,734=>417,736=>448,737=>292, -738=>395,739=>375,740=>313,741=>500,742=>500,743=>500,744=>500,745=>500,750=>553,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>779,881=>576,884=>302, -885=>302,890=>500,891=>609,892=>609,893=>609,894=>369,900=>500,901=>500,902=>776,903=>348, -904=>947,905=>1136,906=>662,908=>887,910=>953,911=>911,912=>484,913=>776,914=>845,915=>710, -916=>776,917=>762,918=>730,919=>945,920=>871,921=>468,922=>869,923=>776,924=>1107,925=>914, -926=>704,927=>871,928=>945,929=>752,931=>707,932=>744,933=>714,934=>871,935=>776,936=>913, -937=>890,938=>468,939=>714,940=>770,941=>608,942=>727,943=>484,944=>694,945=>770,946=>664, -947=>660,948=>667,949=>608,950=>592,951=>727,952=>667,953=>484,954=>750,955=>701,956=>732, -957=>694,958=>592,959=>667,960=>732,961=>665,962=>609,963=>737,964=>673,965=>694,966=>905, -967=>658,968=>941,969=>952,970=>484,971=>694,972=>667,973=>694,974=>952,976=>667,977=>849, -978=>764,979=>969,980=>764,981=>941,982=>952,983=>655,984=>871,985=>667,986=>796,987=>609, -988=>710,989=>527,990=>590,991=>660,992=>796,993=>667,1008=>655,1009=>665,1010=>609,1011=>362, -1012=>871,1013=>609,1014=>609,1015=>757,1016=>699,1017=>796,1018=>1107,1019=>860,1020=>692,1021=>796, -1022=>796,1023=>796,1024=>762,1025=>762,1026=>901,1027=>690,1028=>795,1029=>722,1030=>468,1031=>468, -1032=>473,1033=>1202,1034=>1262,1035=>963,1036=>910,1037=>945,1038=>812,1039=>945,1040=>814,1041=>854, -1042=>845,1043=>690,1044=>889,1045=>762,1046=>1312,1047=>721,1048=>945,1049=>945,1050=>910,1051=>884, -1052=>1107,1053=>945,1054=>871,1055=>945,1056=>752,1057=>796,1058=>744,1059=>812,1060=>949,1061=>776, -1062=>966,1063=>913,1064=>1268,1065=>1293,1066=>957,1067=>1202,1068=>825,1069=>795,1070=>1287,1071=>882, -1072=>648,1073=>722,1074=>657,1075=>563,1076=>695,1077=>636,1078=>1306,1079=>638,1080=>727,1081=>727, -1082=>677,1083=>732,1084=>951,1085=>729,1086=>667,1087=>727,1088=>699,1089=>609,1090=>1058,1091=>598, -1092=>902,1093=>596,1094=>803,1095=>715,1096=>1058,1097=>1134,1098=>727,1099=>1018,1100=>660,1101=>645, -1102=>1001,1103=>796,1104=>636,1105=>636,1106=>719,1107=>563,1108=>609,1109=>563,1110=>380,1111=>380, -1112=>362,1113=>1014,1114=>1011,1115=>727,1116=>677,1117=>727,1118=>598,1119=>727,1122=>880,1123=>1050, -1124=>1195,1125=>963,1130=>1312,1131=>1010,1136=>1096,1137=>1105,1138=>871,1139=>652,1140=>916,1141=>749, -1164=>846,1165=>673,1168=>700,1169=>618,1170=>690,1171=>563,1172=>854,1173=>705,1174=>1312,1175=>1306, -1176=>721,1177=>638,1178=>902,1179=>703,1182=>910,1183=>677,1184=>1041,1185=>760,1186=>952,1187=>805, -1188=>1167,1189=>955,1190=>1324,1191=>1013,1194=>796,1195=>609,1196=>744,1197=>1142,1198=>714,1199=>572, -1200=>713,1201=>572,1202=>789,1203=>596,1204=>1010,1205=>833,1206=>913,1207=>792,1210=>910,1211=>727, -1216=>468,1217=>1312,1218=>1306,1219=>869,1220=>693,1223=>945,1224=>732,1227=>984,1228=>732,1231=>380, -1232=>814,1233=>648,1234=>814,1235=>648,1236=>1034,1237=>975,1238=>762,1239=>636,1240=>871,1241=>636, -1242=>871,1243=>636,1244=>1312,1245=>1306,1246=>721,1247=>638,1248=>657,1249=>568,1250=>945,1251=>727, -1252=>945,1253=>727,1254=>871,1255=>667,1256=>871,1257=>667,1258=>871,1259=>667,1260=>795,1261=>645, -1262=>812,1263=>598,1264=>812,1265=>598,1266=>812,1267=>598,1268=>913,1269=>715,1270=>690,1271=>563, -1272=>1202,1273=>1018,1296=>721,1297=>638,1298=>884,1299=>732,1300=>1248,1301=>1005,1306=>820,1307=>640, -1308=>1028,1309=>856,4256=>765,4257=>945,4258=>876,4259=>884,4260=>791,4261=>1087,4262=>1024,4263=>1223, -4264=>653,4265=>828,4266=>1061,4267=>1061,4268=>806,4269=>1145,4270=>979,4271=>912,4272=>1119,4273=>802, -4274=>766,4275=>1085,4276=>986,4277=>1076,4278=>820,4279=>843,4280=>831,4281=>843,4282=>918,4283=>1086, -4284=>779,4285=>832,4286=>822,4287=>1121,4288=>1132,4289=>812,4290=>902,4291=>812,4292=>890,4293=>1073, -4304=>594,4305=>625,4306=>643,4307=>887,4308=>615,4309=>611,4310=>666,4311=>915,4312=>613,4313=>600, -4314=>1120,4315=>654,4316=>640,4317=>879,4318=>624,4319=>634,4320=>877,4321=>657,4322=>802,4323=>751, -4324=>869,4325=>639,4326=>912,4327=>622,4328=>647,4329=>640,4330=>729,4331=>641,4332=>639,4333=>629, -4334=>674,4335=>737,4336=>625,4337=>657,4338=>625,4339=>625,4340=>624,4341=>670,4342=>940,4343=>680, -4344=>636,4345=>672,4346=>625,4347=>446,4348=>363,7426=>940,7432=>509,7433=>320,7444=>989,7446=>667, -7447=>667,7453=>737,7454=>948,7455=>948,7468=>489,7469=>651,7470=>532,7472=>546,7473=>480,7474=>480, -7475=>538,7476=>595,7477=>294,7478=>298,7479=>547,7480=>443,7481=>697,7482=>576,7483=>576,7484=>548, -7486=>474,7487=>523,7488=>469,7489=>549,7490=>708,7491=>466,7492=>466,7493=>498,7494=>657,7495=>499, -7496=>498,7497=>444,7498=>444,7499=>412,7500=>412,7501=>498,7502=>300,7503=>523,7504=>729,7505=>473, -7506=>467,7507=>427,7508=>467,7509=>467,7510=>499,7511=>371,7512=>520,7513=>434,7514=>729,7515=>491, -7522=>239,7523=>414,7524=>520,7525=>491,7543=>640,7544=>595,7547=>380,7557=>380,7579=>498,7580=>427, -7581=>427,7582=>467,7583=>412,7584=>271,7585=>373,7586=>498,7587=>522,7588=>300,7589=>307,7590=>300, -7591=>300,7592=>370,7593=>368,7594=>321,7595=>430,7596=>682,7597=>729,7598=>588,7599=>587,7600=>472, -7601=>467,7602=>522,7603=>400,7604=>387,7605=>371,7606=>520,7607=>475,7609=>489,7610=>366,7611=>357, -7612=>527,7613=>412,7614=>452,7615=>467,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>776,7681=>648,7682=>845,7683=>699,7684=>845,7685=>699,7686=>845,7687=>699,7688=>796,7689=>609, -7690=>867,7691=>699,7692=>867,7693=>699,7694=>867,7695=>699,7696=>867,7697=>699,7698=>867,7699=>699, -7700=>762,7701=>636,7702=>762,7703=>636,7704=>762,7705=>636,7706=>762,7707=>636,7708=>762,7709=>636, -7710=>710,7711=>430,7712=>854,7713=>699,7714=>945,7715=>727,7716=>945,7717=>727,7718=>945,7719=>727, -7720=>945,7721=>727,7722=>945,7723=>727,7724=>468,7725=>380,7728=>869,7729=>693,7730=>869,7731=>693, -7732=>869,7733=>693,7734=>703,7735=>380,7736=>703,7737=>380,7738=>703,7739=>380,7740=>703,7741=>380, -7742=>1107,7743=>1058,7744=>1107,7745=>1058,7746=>1107,7747=>1058,7748=>914,7749=>727,7750=>914,7751=>727, -7752=>914,7753=>727,7754=>914,7755=>727,7756=>871,7757=>667,7760=>871,7761=>667,7762=>871,7763=>667, -7764=>752,7765=>699,7766=>752,7767=>699,7768=>831,7769=>527,7770=>831,7771=>527,7772=>831,7773=>527, -7774=>831,7775=>527,7776=>722,7777=>563,7778=>722,7779=>563,7784=>722,7785=>563,7786=>744,7787=>462, -7788=>744,7789=>462,7790=>744,7791=>462,7792=>744,7793=>462,7794=>872,7795=>727,7796=>872,7797=>727, -7798=>872,7799=>727,7800=>872,7801=>727,7802=>872,7803=>727,7804=>776,7805=>581,7806=>776,7807=>581, -7808=>1123,7809=>861,7810=>1123,7811=>861,7812=>1123,7813=>861,7814=>1123,7815=>861,7816=>1123,7817=>861, -7818=>776,7819=>596,7820=>776,7821=>596,7822=>714,7823=>581,7824=>730,7825=>568,7826=>730,7827=>568, -7828=>730,7829=>568,7830=>727,7831=>462,7832=>861,7833=>581,7834=>1014,7835=>430,7838=>947,7839=>667, -7840=>776,7841=>648,7842=>776,7843=>648,7852=>776,7853=>648,7854=>776,7855=>648,7856=>776,7857=>648, -7858=>776,7859=>648,7860=>776,7861=>648,7862=>776,7863=>648,7864=>762,7865=>636,7866=>762,7867=>636, -7868=>762,7869=>636,7878=>762,7879=>636,7880=>468,7881=>380,7882=>468,7883=>380,7884=>871,7885=>667, -7886=>871,7887=>667,7896=>871,7897=>667,7908=>872,7909=>727,7910=>872,7911=>727,7922=>714,7923=>581, -7924=>714,7925=>581,7926=>714,7927=>581,7928=>714,7929=>581,7936=>770,7937=>770,7938=>770,7939=>770, -7940=>770,7941=>770,7942=>770,7943=>770,7944=>776,7945=>776,7946=>978,7947=>978,7948=>832,7949=>849, -7950=>776,7951=>776,7952=>608,7953=>608,7954=>608,7955=>608,7956=>608,7957=>608,7960=>917,7961=>909, -7962=>1169,7963=>1169,7964=>1093,7965=>1120,7968=>727,7969=>727,7970=>727,7971=>727,7972=>727,7973=>727, -7974=>727,7975=>727,7976=>1100,7977=>1094,7978=>1358,7979=>1361,7980=>1279,7981=>1308,7982=>1197,7983=>1194, -7984=>484,7985=>484,7986=>484,7987=>484,7988=>484,7989=>484,7990=>484,7991=>484,7992=>629,7993=>617, -7994=>878,7995=>881,7996=>799,7997=>831,7998=>723,7999=>714,8000=>667,8001=>667,8002=>667,8003=>667, -8004=>667,8005=>667,8008=>900,8009=>935,8010=>1240,8011=>1237,8012=>1035,8013=>1066,8016=>694,8017=>694, -8018=>694,8019=>694,8020=>694,8021=>694,8022=>694,8023=>694,8025=>922,8027=>1186,8029=>1133,8031=>1019, -8032=>952,8033=>952,8034=>952,8035=>952,8036=>952,8037=>952,8038=>952,8039=>952,8040=>931,8041=>963, -8042=>1268,8043=>1274,8044=>1054,8045=>1088,8046=>1023,8047=>1060,8048=>770,8049=>770,8050=>608,8051=>608, -8052=>727,8053=>727,8054=>484,8055=>484,8056=>667,8057=>667,8058=>694,8059=>694,8060=>952,8061=>952, -8064=>770,8065=>770,8066=>770,8067=>770,8068=>770,8069=>770,8070=>770,8071=>770,8072=>776,8073=>776, -8074=>978,8075=>978,8076=>832,8077=>849,8078=>776,8079=>776,8080=>727,8081=>727,8082=>727,8083=>727, -8084=>727,8085=>727,8086=>727,8087=>727,8088=>1100,8089=>1094,8090=>1358,8091=>1361,8092=>1279,8093=>1308, -8094=>1197,8095=>1194,8096=>952,8097=>952,8098=>952,8099=>952,8100=>952,8101=>952,8102=>952,8103=>952, -8104=>931,8105=>963,8106=>1268,8107=>1274,8108=>1054,8109=>1088,8110=>1023,8111=>1060,8112=>770,8113=>770, -8114=>770,8115=>770,8116=>770,8118=>770,8119=>770,8120=>776,8121=>776,8122=>811,8123=>776,8124=>776, -8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>727,8131=>727,8132=>727,8134=>727,8135=>727, -8136=>1000,8137=>947,8138=>1191,8139=>1118,8140=>945,8141=>500,8142=>500,8143=>500,8144=>484,8145=>484, -8146=>484,8147=>484,8150=>484,8151=>484,8152=>468,8153=>468,8154=>714,8155=>662,8157=>500,8158=>500, -8159=>500,8160=>694,8161=>694,8162=>694,8163=>694,8164=>665,8165=>665,8166=>694,8167=>694,8168=>714, -8169=>714,8170=>1019,8171=>953,8172=>910,8173=>500,8174=>500,8175=>500,8178=>952,8179=>952,8180=>952, -8182=>952,8183=>952,8184=>1069,8185=>887,8186=>1101,8187=>911,8188=>890,8189=>500,8190=>500,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>696,8200=>348,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>415,8209=>415,8210=>696,8213=>1000,8214=>500, -8215=>500,8219=>348,8223=>575,8227=>639,8228=>348,8229=>674,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>200,8241=>1813,8242=>264,8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733, -8252=>629,8253=>586,8254=>500,8258=>1023,8260=>167,8261=>473,8262=>473,8263=>1082,8264=>856,8265=>856, -8267=>636,8268=>500,8269=>500,8270=>523,8271=>369,8273=>523,8274=>556,8275=>1000,8279=>813,8287=>222, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>438,8305=>239,8308=>438,8309=>438,8310=>438,8311=>438,8312=>438,8313=>438,8314=>528, -8315=>528,8316=>528,8317=>298,8318=>298,8319=>458,8320=>438,8321=>438,8322=>438,8323=>438,8324=>438, -8325=>438,8326=>438,8327=>438,8328=>438,8329=>438,8330=>528,8331=>528,8332=>528,8333=>298,8334=>298, -8336=>466,8337=>444,8338=>467,8339=>375,8340=>444,8358=>696,8367=>1155,8369=>790,8372=>876,8373=>696, -8451=>1198,8457=>1112,8462=>727,8463=>727,8470=>1087,8486=>890,8487=>890,8490=>869,8491=>776,8513=>786, -8514=>576,8515=>637,8516=>760,8523=>903,8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035, -8537=>1035,8538=>1035,8539=>1035,8540=>1035,8541=>1035,8542=>1035,8543=>615,8544=>468,8545=>736,8546=>1005, -8547=>1093,8548=>776,8549=>1127,8550=>1396,8551=>1664,8552=>1069,8553=>776,8554=>1078,8555=>1347,8556=>703, -8557=>796,8558=>867,8559=>1107,8560=>380,8561=>760,8562=>1140,8563=>961,8564=>581,8565=>961,8566=>1341, -8567=>1721,8568=>976,8569=>596,8570=>976,8571=>1356,8572=>380,8573=>609,8574=>699,8575=>1058,8576=>1255, -8577=>867,8578=>1268,8579=>796,8580=>609,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838, -8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838, -8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838, -8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>850,8624=>838,8625=>838,8626=>838,8627=>838, -8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838, -8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838, -8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838, -8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838, -8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838, -8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838, -8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838, -8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>641,8706=>534,8707=>620,8708=>620, -8710=>753,8711=>753,8712=>740,8713=>740,8715=>740,8716=>740,8719=>842,8720=>842,8721=>753,8722=>838, -8723=>838,8724=>838,8725=>365,8727=>691,8728=>519,8729=>519,8730=>657,8731=>657,8732=>657,8733=>672, -8734=>833,8735=>838,8736=>838,8739=>324,8740=>607,8741=>529,8742=>773,8743=>812,8744=>812,8745=>838, -8746=>838,8747=>579,8748=>1000,8749=>1391,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838, -8770=>838,8771=>838,8776=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1082,8789=>1082,8800=>838, -8801=>838,8804=>838,8805=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8844=>838, -8845=>838,8846=>838,8847=>838,8848=>838,8849=>838,8850=>838,8851=>838,8852=>838,8853=>838,8854=>838, -8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838, -8865=>838,8866=>884,8867=>884,8868=>960,8869=>960,8870=>616,8871=>616,8872=>884,8873=>884,8874=>884, -8875=>1080,8876=>884,8877=>884,8878=>884,8879=>1080,8901=>398,8962=>834,8968=>473,8969=>473,8970=>473, -8971=>473,8976=>838,8977=>539,8984=>928,8985=>838,8992=>579,8993=>579,8997=>1000,9000=>1443,9085=>1008, -9134=>579,9167=>945,9251=>834,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769, -9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769, -9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769, -9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945, -9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550, -9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502, -9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502, -9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873, -9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527, -9687=>527,9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873, -9697=>873,9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945, -9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873, -9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732, -9727=>769,9728=>896,9784=>896,9785=>896,9786=>896,9787=>896,9788=>896,9791=>614,9792=>731,9793=>731, -9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9824=>896,9825=>896,9826=>896,9827=>896, -9828=>896,9829=>896,9830=>896,9831=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357, -9839=>484,10145=>838,10181=>457,10182=>457,10208=>494,10216=>457,10217=>457,10224=>838,10225=>838,10226=>838, -10227=>838,10228=>1033,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434, -10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781,10245=>781,10246=>781, -10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781,10255=>781,10256=>781, -10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781,10265=>781,10266=>781, -10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781,10275=>781,10276=>781, -10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781,10285=>781,10286=>781, -10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781,10295=>781,10296=>781, -10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781,10305=>781,10306=>781, -10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781,10315=>781,10316=>781, -10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781,10325=>781,10326=>781, -10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781,10335=>781,10336=>781, -10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781,10345=>781,10346=>781, -10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781,10355=>781,10356=>781, -10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781,10365=>781,10366=>781, -10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781,10375=>781,10376=>781, -10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781,10385=>781,10386=>781, -10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781,10395=>781,10396=>781, -10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781,10405=>781,10406=>781, -10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781,10415=>781,10416=>781, -10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781,10425=>781,10426=>781, -10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781,10435=>781,10436=>781, -10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781,10445=>781,10446=>781, -10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781,10455=>781,10456=>781, -10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781,10465=>781,10466=>781, -10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781,10475=>781,10476=>781, -10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781,10485=>781,10486=>781, -10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781,10495=>781,10496=>838, -10497=>838,10498=>838,10499=>838,10500=>838,10501=>838,10502=>838,10503=>838,10504=>838,10505=>838,10506=>838, -10507=>838,10508=>838,10509=>838,10510=>838,10511=>838,10512=>838,10513=>838,10514=>838,10515=>838,10516=>838, -10517=>838,10518=>838,10519=>838,10520=>838,10521=>838,10522=>838,10523=>838,10524=>838,10525=>838,10526=>838, -10527=>838,10528=>838,10529=>838,10530=>838,10531=>838,10532=>838,10533=>838,10534=>838,10535=>838,10536=>838, -10537=>838,10538=>838,10539=>838,10540=>838,10541=>838,10542=>838,10543=>838,10544=>838,10545=>838,10546=>838, -10547=>838,10548=>838,10549=>838,10550=>838,10551=>838,10552=>838,10553=>838,10554=>838,10555=>838,10556=>838, -10557=>838,10558=>838,10559=>838,10560=>838,10561=>838,10562=>838,10563=>838,10564=>838,10565=>838,10566=>838, -10567=>838,10568=>838,10569=>838,10570=>838,10571=>838,10572=>838,10573=>838,10574=>838,10575=>838,10576=>838, -10577=>838,10578=>838,10579=>838,10580=>838,10581=>838,10582=>838,10583=>838,10584=>838,10585=>838,10586=>838, -10587=>838,10588=>838,10589=>838,10590=>838,10591=>838,10592=>838,10593=>838,10594=>838,10595=>838,10596=>838, -10597=>838,10598=>838,10599=>838,10600=>838,10601=>838,10602=>838,10603=>838,10604=>838,10605=>838,10606=>838, -10607=>838,10608=>838,10609=>838,10610=>838,10611=>838,10612=>838,10613=>838,10614=>838,10615=>1032,10616=>838, -10617=>838,10618=>960,10619=>838,10620=>838,10621=>838,10622=>838,10623=>838,10731=>494,10764=>1782,10765=>610, -10766=>610,10799=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838, -11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838, -11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11364=>831, -11367=>945,11368=>727,11369=>869,11370=>693,11371=>730,11372=>568,11374=>1107,11375=>776,11381=>779,11382=>576, -11383=>905,11385=>571,11386=>667,11388=>313,11389=>489,11520=>773,11521=>635,11522=>804,11523=>658,11524=>788, -11525=>962,11526=>756,11527=>960,11528=>617,11529=>646,11530=>962,11531=>631,11532=>646,11533=>962,11534=>846, -11535=>866,11536=>961,11537=>645,11538=>645,11539=>959,11540=>945,11541=>863,11542=>644,11543=>646,11544=>645, -11545=>649,11546=>688,11547=>936,11548=>982,11549=>681,11550=>676,11551=>852,11552=>1113,11553=>632,11554=>645, -11555=>646,11556=>749,11557=>914,11800=>586,11810=>473,11811=>473,11812=>473,11813=>473,11822=>586,42564=>722, -42565=>563,42566=>468,42567=>380,42576=>1333,42577=>1085,42580=>1287,42581=>1025,42582=>1287,42583=>1029,42760=>500, -42761=>500,42762=>500,42763=>500,42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500, -42771=>500,42772=>500,42773=>500,42774=>500,42779=>384,42780=>384,42781=>276,42782=>276,42783=>276,42891=>439, -42892=>306,62464=>726,62465=>737,62466=>786,62467=>1019,62468=>737,62469=>731,62470=>796,62471=>1058,62472=>737, -62473=>737,62474=>1329,62475=>754,62476=>753,62477=>1024,62478=>737,62479=>753,62480=>1070,62481=>818,62482=>870, -62483=>819,62484=>1016,62485=>753,62486=>1008,62487=>752,62488=>760,62489=>753,62490=>800,62491=>753,62492=>760, -62493=>738,62494=>801,62495=>956,62496=>736,62497=>847,62498=>737,62499=>737,62500=>737,62501=>793,62502=>1033, -62504=>904,63172=>563,63173=>667,63174=>699,63175=>727,63176=>1058,63185=>500,63188=>500,64256=>827,64257=>727, -64258=>727,64259=>1108,64260=>1146,64261=>879,64262=>971,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0, -65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0, -65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1113); -$enc=''; -$diff=''; -$file='dejavuserifbi.z'; -$ctg='dejavuserifbi.ctg.z'; -$originalsize=294244; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.z deleted file mode 100644 index ab7e8b2f61..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.ctg.z deleted file mode 100644 index 6e01b83783..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.php deleted file mode 100644 index 669b0bd348..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.php +++ /dev/null @@ -1,313 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerifCondensed'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>5,'Flags'=>32,'FontBBox'=>'[-692 -347 1511 1242]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>286,33=>361,34=>414,35=>754,36=>572,37=>855,38=>801,39=>247,40=>351, -41=>351,42=>450,43=>754,44=>286,45=>304,46=>286,47=>303,48=>572,49=>572,50=>572, -51=>572,52=>572,53=>572,54=>572,55=>572,56=>572,57=>572,58=>303,59=>303,60=>754, -61=>754,62=>754,63=>482,64=>900,65=>650,66=>661,67=>688,68=>721,69=>657,70=>624, -71=>719,72=>785,73=>355,74=>360,75=>672,76=>598,77=>921,78=>787,79=>738,80=>605, -81=>738,82=>677,83=>616,84=>600,85=>758,86=>650,87=>925,88=>641,89=>594,90=>625, -91=>351,92=>303,93=>351,94=>754,95=>450,96=>450,97=>536,98=>576,99=>504,100=>576, -101=>532,102=>333,103=>576,104=>580,105=>288,106=>279,107=>545,108=>288,109=>853,110=>580, -111=>542,112=>576,113=>576,114=>430,115=>461,116=>361,117=>580,118=>508,119=>770,120=>507, -121=>508,122=>474,123=>572,124=>303,125=>572,126=>754,8364=>572,8218=>286,402=>333,8222=>466, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1208,352=>616,8249=>360,338=>1023,381=>625,8216=>286, -8217=>286,8220=>460,8221=>460,8226=>531,8211=>450,8212=>900,732=>450,8482=>900,353=>461,8250=>360, -339=>890,382=>474,376=>594,160=>286,161=>361,162=>572,163=>572,164=>572,165=>572,166=>303, -167=>450,168=>450,169=>900,170=>427,171=>550,172=>754,173=>304,174=>900,175=>450,176=>450, -177=>754,178=>360,179=>360,180=>450,181=>584,182=>572,183=>286,184=>450,185=>360,186=>423, -187=>550,188=>872,189=>872,190=>872,191=>482,192=>650,193=>650,194=>650,195=>650,196=>650, -197=>650,198=>901,199=>688,200=>657,201=>657,202=>657,203=>657,204=>355,205=>355,206=>355, -207=>355,208=>726,209=>787,210=>738,211=>738,212=>738,213=>738,214=>738,215=>754,216=>738, -217=>758,218=>758,219=>758,220=>758,221=>594,222=>608,223=>601,224=>536,225=>536,226=>536, -227=>536,228=>536,229=>536,230=>846,231=>504,232=>532,233=>532,234=>532,235=>532,236=>288, -237=>288,238=>288,239=>288,240=>542,241=>580,242=>542,243=>542,244=>542,245=>542,246=>542, -247=>754,248=>542,249=>580,250=>580,251=>580,252=>580,253=>508,254=>576,255=>508,256=>650, -257=>536,258=>650,259=>536,260=>650,261=>536,262=>688,263=>504,264=>688,265=>504,266=>688, -267=>504,268=>688,269=>504,270=>721,271=>576,272=>726,273=>576,274=>657,275=>532,276=>657, -277=>532,278=>657,279=>532,280=>657,281=>532,282=>657,283=>532,284=>719,285=>576,286=>719, -287=>576,288=>719,289=>576,290=>719,291=>576,292=>785,293=>580,294=>785,295=>580,296=>355, -297=>288,298=>355,299=>288,300=>355,301=>288,302=>355,303=>288,304=>355,305=>288,306=>721, -307=>479,308=>360,309=>279,310=>672,311=>545,312=>545,313=>598,314=>288,315=>598,316=>288, -317=>598,318=>288,319=>598,320=>288,321=>602,322=>292,323=>787,324=>580,325=>787,326=>580, -327=>787,328=>580,329=>779,330=>758,331=>580,332=>738,333=>542,334=>738,335=>542,336=>738, -337=>542,340=>677,341=>430,342=>677,343=>430,344=>677,345=>430,346=>616,347=>461,348=>616, -349=>461,350=>616,351=>461,354=>600,355=>361,356=>600,357=>361,358=>600,359=>361,360=>758, -361=>580,362=>758,363=>580,364=>758,365=>580,366=>758,367=>580,368=>758,369=>580,370=>758, -371=>580,372=>925,373=>770,374=>594,375=>508,377=>625,378=>474,379=>625,380=>474,383=>333, -384=>576,385=>661,386=>661,387=>576,388=>661,389=>576,390=>688,391=>688,392=>504,393=>726, -394=>721,395=>661,396=>576,397=>542,398=>657,399=>738,400=>561,401=>624,403=>719,404=>641, -405=>839,406=>355,407=>355,408=>672,409=>545,410=>288,411=>570,412=>853,413=>787,414=>580, -415=>738,416=>738,417=>542,418=>936,419=>726,420=>605,421=>576,422=>677,423=>616,424=>461, -425=>636,426=>292,427=>361,428=>600,429=>361,430=>600,431=>758,432=>580,433=>746,434=>684, -435=>664,436=>596,437=>625,438=>474,439=>508,440=>508,441=>508,443=>572,444=>618,445=>508, -446=>482,448=>265,449=>443,450=>413,451=>265,452=>1347,453=>1195,454=>1050,455=>958,456=>876, -457=>567,458=>1148,459=>1066,460=>858,461=>650,462=>536,463=>355,464=>288,465=>738,466=>542, -467=>758,468=>580,469=>758,470=>580,471=>758,472=>580,473=>758,474=>580,475=>758,476=>580, -477=>532,478=>650,479=>536,480=>650,481=>536,482=>901,483=>846,484=>763,485=>576,486=>719, -487=>576,488=>672,489=>545,490=>738,491=>542,492=>738,493=>542,494=>508,495=>508,496=>288, -497=>1347,498=>1195,499=>1050,500=>719,501=>576,502=>1038,504=>787,505=>580,506=>650,507=>536, -508=>901,509=>846,510=>738,511=>542,512=>650,513=>536,514=>650,515=>536,516=>657,517=>532, -518=>657,519=>532,520=>355,521=>288,522=>355,523=>288,524=>738,525=>542,526=>738,527=>542, -528=>677,529=>430,530=>677,531=>430,532=>758,533=>580,534=>758,535=>580,536=>616,537=>461, -538=>600,539=>361,540=>564,541=>469,542=>785,543=>580,544=>758,545=>732,548=>625,549=>474, -550=>650,551=>536,552=>657,553=>532,554=>738,555=>542,556=>738,557=>542,558=>738,559=>542, -560=>738,561=>542,562=>594,563=>508,564=>450,565=>748,566=>444,567=>279,568=>864,569=>864, -570=>650,571=>688,572=>504,573=>598,574=>600,575=>461,576=>474,577=>525,578=>417,581=>650, -592=>536,593=>576,594=>576,595=>576,596=>504,597=>504,598=>582,599=>614,600=>532,601=>532, -602=>759,603=>466,604=>458,605=>695,606=>552,607=>283,608=>615,609=>576,610=>489,611=>641, -612=>507,613=>580,614=>580,615=>580,616=>288,617=>353,618=>288,619=>342,620=>409,621=>326, -622=>633,623=>853,624=>853,625=>853,626=>579,627=>624,628=>581,629=>542,630=>711,631=>583, -632=>542,633=>451,634=>451,635=>496,636=>430,637=>430,638=>407,639=>407,640=>534,641=>534, -642=>461,643=>244,644=>333,645=>438,646=>292,647=>361,648=>361,649=>580,650=>558,651=>547, -652=>508,653=>770,654=>508,655=>589,656=>537,657=>504,658=>508,659=>504,660=>482,661=>482, -662=>482,663=>461,664=>738,665=>506,666=>552,667=>588,668=>600,669=>329,670=>545,671=>581, -672=>615,673=>482,674=>482,675=>896,676=>930,677=>898,678=>728,679=>538,680=>704,681=>804, -682=>582,683=>608,684=>538,685=>398,686=>703,687=>690,688=>389,689=>387,690=>237,691=>312, -692=>312,693=>387,694=>352,695=>527,696=>381,697=>250,699=>286,700=>286,701=>286,702=>276, -703=>276,704=>252,705=>252,711=>450,712=>247,713=>450,716=>247,720=>303,721=>303,722=>276, -723=>276,726=>295,728=>450,729=>450,730=>450,731=>450,733=>450,734=>375,736=>402,737=>218, -738=>303,739=>381,740=>252,741=>444,742=>444,743=>444,744=>444,745=>444,750=>435,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>666,881=>478,884=>250, -885=>250,890=>450,891=>504,892=>504,893=>504,894=>303,900=>450,901=>450,902=>650,903=>286, -904=>810,905=>935,906=>505,908=>751,910=>808,911=>767,912=>353,913=>650,914=>661,915=>624, -916=>650,917=>657,918=>625,919=>785,920=>738,921=>355,922=>672,923=>650,924=>921,925=>787, -926=>633,927=>738,928=>785,929=>605,931=>636,932=>600,933=>594,934=>738,935=>641,936=>789, -937=>746,938=>355,939=>594,940=>607,941=>466,942=>539,943=>353,944=>547,945=>607,946=>520, -947=>538,948=>542,949=>466,950=>488,951=>539,952=>542,953=>353,954=>563,955=>570,956=>584, -957=>547,958=>496,959=>542,960=>591,961=>529,962=>504,963=>614,964=>498,965=>547,966=>630, -967=>545,968=>706,969=>734,970=>353,971=>547,972=>542,973=>547,974=>734,976=>524,977=>643, -978=>618,979=>787,980=>618,981=>613,982=>734,983=>561,984=>738,985=>542,986=>688,987=>504, -988=>624,989=>417,990=>531,991=>593,992=>704,993=>519,1008=>561,1009=>529,1010=>504,1011=>279, -1012=>738,1013=>504,1014=>504,1015=>608,1016=>576,1017=>688,1018=>921,1019=>637,1020=>529,1021=>688, -1022=>688,1023=>688,1024=>657,1025=>657,1026=>719,1027=>596,1028=>688,1029=>616,1030=>355,1031=>355, -1032=>360,1033=>976,1034=>1006,1035=>785,1036=>696,1037=>785,1038=>650,1039=>785,1040=>681,1041=>661, -1042=>661,1043=>596,1044=>731,1045=>657,1046=>1011,1047=>561,1048=>785,1049=>785,1050=>696,1051=>751, -1052=>921,1053=>785,1054=>738,1055=>785,1056=>605,1057=>688,1058=>600,1059=>650,1060=>747,1061=>641, -1062=>785,1063=>695,1064=>1027,1065=>1027,1066=>715,1067=>885,1068=>606,1069=>688,1070=>1074,1071=>727, -1072=>536,1073=>542,1074=>506,1075=>471,1076=>554,1077=>532,1078=>828,1079=>491,1080=>600,1081=>600, -1082=>563,1083=>571,1084=>700,1085=>600,1086=>542,1087=>600,1088=>576,1089=>504,1090=>498,1091=>529, -1092=>704,1093=>507,1094=>579,1095=>595,1096=>836,1097=>836,1098=>572,1099=>716,1100=>490,1101=>504, -1102=>783,1103=>567,1104=>532,1105=>532,1106=>561,1107=>471,1108=>504,1109=>461,1110=>288,1111=>288, -1112=>279,1113=>759,1114=>774,1115=>580,1116=>563,1117=>600,1118=>529,1119=>590,1122=>686,1123=>542, -1124=>1016,1125=>750,1130=>1011,1131=>828,1136=>849,1137=>812,1138=>738,1139=>497,1140=>773,1141=>610, -1164=>636,1165=>490,1168=>604,1169=>476,1170=>596,1171=>471,1172=>655,1173=>552,1174=>1011,1175=>828, -1176=>572,1177=>483,1178=>696,1179=>545,1182=>696,1183=>563,1184=>801,1185=>645,1186=>785,1187=>577, -1188=>1025,1189=>767,1190=>1084,1191=>847,1194=>688,1195=>504,1196=>600,1197=>498,1198=>594,1199=>508, -1200=>594,1201=>508,1202=>641,1203=>507,1204=>856,1205=>659,1206=>674,1207=>621,1210=>674,1211=>580, -1216=>355,1217=>1011,1218=>828,1219=>672,1220=>545,1223=>785,1224=>600,1227=>674,1228=>600,1231=>288, -1232=>681,1233=>536,1234=>681,1235=>536,1236=>901,1237=>846,1238=>657,1239=>532,1240=>738,1241=>532, -1242=>738,1243=>532,1244=>1011,1245=>828,1246=>561,1247=>491,1248=>508,1249=>508,1250=>785,1251=>600, -1252=>785,1253=>600,1254=>738,1255=>542,1256=>738,1257=>542,1258=>738,1259=>542,1260=>688,1261=>504, -1262=>650,1263=>529,1264=>650,1265=>529,1266=>650,1267=>529,1268=>695,1269=>595,1270=>596,1271=>471, -1272=>885,1273=>716,1296=>561,1297=>491,1298=>751,1299=>571,1300=>1078,1301=>827,1306=>738,1307=>576, -1308=>925,1309=>770,4256=>650,4257=>765,4258=>745,4259=>773,4260=>659,4261=>883,4262=>824,4263=>991, -4264=>510,4265=>675,4266=>866,4267=>847,4268=>668,4269=>967,4270=>807,4271=>746,4272=>936,4273=>660, -4274=>602,4275=>914,4276=>843,4277=>917,4278=>658,4279=>659,4280=>659,4281=>660,4282=>791,4283=>843, -4284=>642,4285=>679,4286=>660,4287=>862,4288=>900,4289=>632,4290=>777,4291=>660,4292=>753,4293=>855, -4304=>486,4305=>514,4306=>530,4307=>750,4308=>505,4309=>501,4310=>556,4311=>774,4312=>503,4313=>491, -4314=>959,4315=>527,4316=>527,4317=>743,4318=>513,4319=>522,4320=>741,4321=>546,4322=>673,4323=>628, -4324=>733,4325=>526,4326=>772,4327=>511,4328=>534,4329=>527,4330=>607,4331=>528,4332=>523,4333=>518, -4334=>550,4335=>615,4336=>514,4337=>542,4338=>514,4339=>514,4340=>513,4341=>584,4342=>797,4343=>563, -4344=>523,4345=>557,4346=>514,4347=>393,4348=>318,7426=>846,7432=>458,7433=>288,7444=>890,7446=>542, -7447=>542,7453=>663,7454=>853,7455=>853,7468=>409,7469=>567,7470=>417,7472=>454,7473=>413,7474=>413, -7475=>453,7476=>494,7477=>224,7478=>227,7479=>423,7480=>376,7481=>580,7482=>496,7483=>496,7484=>464, -7486=>381,7487=>426,7488=>378,7489=>478,7490=>583,7491=>347,7492=>347,7493=>360,7494=>556,7495=>360, -7496=>360,7497=>348,7498=>348,7499=>306,7500=>306,7501=>360,7502=>157,7503=>328,7504=>552,7505=>359, -7506=>347,7507=>312,7508=>347,7509=>347,7510=>360,7511=>222,7512=>359,7513=>417,7514=>552,7515=>335, -7522=>181,7523=>312,7524=>359,7525=>335,7543=>576,7544=>494,7547=>334,7557=>288,7579=>360,7580=>312, -7581=>312,7582=>347,7583=>306,7584=>199,7585=>206,7586=>360,7587=>359,7588=>210,7589=>219,7590=>210, -7591=>210,7592=>207,7593=>158,7594=>157,7595=>330,7596=>552,7597=>552,7598=>366,7599=>364,7600=>359, -7601=>347,7602=>347,7603=>295,7604=>190,7605=>222,7606=>359,7607=>350,7609=>338,7610=>335,7611=>297, -7612=>297,7613=>297,7614=>327,7615=>347,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>650,7681=>536,7682=>661,7683=>576,7684=>661,7685=>576,7686=>661,7687=>576,7688=>688,7689=>504, -7690=>721,7691=>576,7692=>721,7693=>576,7694=>721,7695=>576,7696=>721,7697=>576,7698=>721,7699=>576, -7700=>657,7701=>532,7702=>657,7703=>532,7704=>657,7705=>532,7706=>657,7707=>532,7708=>657,7709=>532, -7710=>624,7711=>333,7712=>719,7713=>576,7714=>785,7715=>580,7716=>785,7717=>580,7718=>785,7719=>580, -7720=>785,7721=>580,7722=>785,7723=>580,7724=>355,7725=>288,7728=>672,7729=>545,7730=>672,7731=>545, -7732=>672,7733=>545,7734=>598,7735=>288,7736=>598,7737=>288,7738=>598,7739=>288,7740=>598,7741=>288, -7742=>921,7743=>853,7744=>921,7745=>853,7746=>921,7747=>853,7748=>787,7749=>580,7750=>787,7751=>580, -7752=>787,7753=>580,7754=>787,7755=>580,7756=>738,7757=>542,7760=>738,7761=>542,7762=>738,7763=>542, -7764=>605,7765=>576,7766=>605,7767=>576,7768=>677,7769=>430,7770=>677,7771=>430,7772=>677,7773=>430, -7774=>677,7775=>430,7776=>616,7777=>461,7778=>616,7779=>461,7784=>616,7785=>461,7786=>600,7787=>361, -7788=>600,7789=>361,7790=>600,7791=>361,7792=>600,7793=>361,7794=>758,7795=>580,7796=>758,7797=>580, -7798=>758,7799=>580,7800=>758,7801=>580,7802=>758,7803=>580,7804=>650,7805=>508,7806=>650,7807=>508, -7808=>925,7809=>770,7810=>925,7811=>770,7812=>925,7813=>770,7814=>925,7815=>770,7816=>925,7817=>770, -7818=>641,7819=>507,7820=>641,7821=>507,7822=>594,7823=>508,7824=>625,7825=>474,7826=>625,7827=>474, -7828=>625,7829=>474,7830=>580,7831=>361,7832=>770,7833=>508,7834=>813,7835=>333,7838=>746,7839=>542, -7840=>650,7841=>536,7842=>650,7843=>536,7852=>650,7853=>536,7854=>650,7855=>536,7856=>650,7857=>536, -7858=>650,7859=>536,7860=>650,7861=>536,7862=>650,7863=>536,7864=>657,7865=>532,7866=>657,7867=>532, -7868=>657,7869=>532,7878=>657,7879=>532,7880=>355,7881=>288,7882=>355,7883=>288,7884=>738,7885=>542, -7886=>738,7887=>542,7896=>738,7897=>542,7908=>758,7909=>580,7910=>758,7911=>580,7922=>594,7923=>508, -7924=>594,7925=>508,7926=>594,7927=>508,7928=>594,7929=>508,7936=>607,7937=>607,7938=>607,7939=>607, -7940=>607,7941=>607,7942=>607,7943=>607,7944=>650,7945=>650,7946=>782,7947=>782,7948=>660,7949=>687, -7950=>650,7951=>650,7952=>483,7953=>483,7954=>483,7955=>483,7956=>483,7957=>483,7960=>768,7961=>757, -7962=>960,7963=>969,7964=>907,7965=>931,7968=>539,7969=>539,7970=>539,7971=>539,7972=>539,7973=>539, -7974=>539,7975=>539,7976=>898,7977=>893,7978=>1090,7979=>1101,7980=>1043,7981=>1064,7982=>988,7983=>985, -7984=>353,7985=>353,7986=>353,7987=>353,7988=>353,7989=>353,7990=>353,7991=>353,7992=>469,7993=>461, -7994=>661,7995=>664,7996=>611,7997=>635,7998=>561,7999=>553,8000=>542,8001=>542,8002=>542,8003=>542, -8004=>542,8005=>542,8008=>738,8009=>773,8010=>1008,8011=>1015,8012=>843,8013=>867,8016=>547,8017=>547, -8018=>547,8019=>547,8020=>547,8021=>547,8022=>547,8023=>547,8025=>765,8027=>971,8029=>939,8031=>857, -8032=>734,8033=>734,8034=>734,8035=>734,8036=>734,8037=>734,8038=>734,8039=>734,8040=>746,8041=>783, -8042=>1018,8043=>1023,8044=>852,8045=>878,8046=>844,8047=>873,8048=>607,8049=>607,8050=>483,8051=>483, -8052=>539,8053=>539,8054=>353,8055=>353,8056=>542,8057=>542,8058=>547,8059=>547,8060=>734,8061=>734, -8064=>607,8065=>607,8066=>607,8067=>607,8068=>607,8069=>607,8070=>607,8071=>607,8072=>650,8073=>650, -8074=>782,8075=>782,8076=>660,8077=>687,8078=>650,8079=>650,8080=>539,8081=>539,8082=>539,8083=>539, -8084=>539,8085=>539,8086=>539,8087=>539,8088=>898,8089=>893,8090=>1090,8091=>1101,8092=>1043,8093=>1064, -8094=>988,8095=>985,8096=>734,8097=>734,8098=>734,8099=>734,8100=>734,8101=>734,8102=>734,8103=>734, -8104=>746,8105=>783,8106=>1018,8107=>1023,8108=>852,8109=>878,8110=>844,8111=>873,8112=>607,8113=>607, -8114=>607,8115=>607,8116=>607,8118=>607,8119=>607,8120=>650,8121=>650,8122=>650,8123=>650,8124=>650, -8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>539,8131=>539,8132=>539,8134=>539,8135=>539, -8136=>820,8137=>810,8138=>956,8139=>935,8140=>785,8141=>450,8142=>450,8143=>450,8144=>353,8145=>353, -8146=>353,8147=>353,8150=>353,8151=>353,8152=>355,8153=>355,8154=>529,8155=>505,8157=>450,8158=>450, -8159=>450,8160=>547,8161=>547,8162=>547,8163=>547,8164=>529,8165=>529,8166=>547,8167=>547,8168=>594, -8169=>594,8170=>829,8171=>808,8172=>711,8173=>450,8174=>450,8175=>450,8178=>734,8179=>734,8180=>734, -8182=>734,8183=>734,8184=>865,8185=>751,8186=>886,8187=>767,8188=>746,8189=>450,8190=>450,8192=>450, -8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>572,8200=>286,8201=>180,8202=>89, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>304,8209=>304,8210=>572,8213=>900,8214=>450, -8215=>450,8219=>286,8223=>460,8227=>531,8228=>300,8229=>600,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>180,8241=>1560,8242=>204,8243=>336,8244=>468,8245=>204,8246=>336,8247=>468,8248=>305, -8252=>475,8253=>482,8254=>450,8258=>900,8260=>150,8261=>351,8262=>351,8263=>878,8264=>678,8265=>678, -8267=>572,8268=>450,8269=>450,8270=>450,8271=>303,8273=>450,8274=>404,8275=>900,8279=>597,8287=>200, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>360,8305=>181,8308=>360,8309=>360,8310=>360,8311=>360,8312=>360,8313=>360,8314=>475, -8315=>475,8316=>475,8317=>221,8318=>221,8319=>389,8320=>360,8321=>360,8322=>360,8323=>360,8324=>360, -8325=>360,8326=>360,8327=>360,8328=>360,8329=>360,8330=>475,8331=>475,8332=>475,8333=>221,8334=>221, -8336=>347,8337=>348,8338=>347,8339=>381,8340=>348,8358=>594,8367=>951,8369=>635,8372=>702,8373=>572, -8450=>716,8451=>1006,8457=>942,8461=>850,8462=>580,8463=>580,8469=>822,8470=>852,8473=>677,8474=>784, -8477=>748,8484=>657,8486=>746,8487=>746,8490=>672,8491=>650,8508=>659,8509=>594,8510=>639,8511=>850, -8512=>642,8513=>697,8514=>501,8515=>501,8516=>549,8517=>780,8518=>629,8519=>572,8520=>342,8521=>325, -8523=>801,8531=>872,8532=>872,8533=>872,8534=>872,8535=>872,8536=>872,8537=>872,8538=>872,8539=>872, -8540=>872,8541=>872,8542=>872,8543=>511,8544=>355,8545=>531,8546=>707,8547=>870,8548=>650,8549=>883, -8550=>1059,8551=>1234,8552=>838,8553=>641,8554=>839,8555=>1015,8556=>598,8557=>688,8558=>721,8559=>921, -8560=>288,8561=>576,8562=>863,8563=>796,8564=>508,8565=>796,8566=>1084,8567=>1372,8568=>795,8569=>507, -8570=>795,8571=>1083,8572=>288,8573=>504,8574=>576,8575=>853,8576=>1085,8577=>721,8578=>1085,8579=>688, -8580=>504,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754,8598=>754,8599=>754,8600=>754, -8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754,8608=>754,8609=>754,8610=>754, -8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754,8618=>754,8619=>754,8620=>754, -8621=>754,8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754,8628=>754,8629=>754,8630=>754, -8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754,8638=>754,8639=>754,8640=>754, -8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754,8648=>754,8649=>754,8650=>754, -8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754,8658=>754,8659=>754,8660=>754, -8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754,8668=>754,8669=>754,8670=>754, -8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754,8678=>754,8679=>754,8680=>754, -8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754,8688=>754,8689=>754,8690=>754, -8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754,8698=>754,8699=>754,8700=>754, -8701=>754,8702=>754,8703=>754,8704=>543,8706=>465,8707=>488,8708=>488,8710=>628,8711=>628,8712=>666, -8713=>666,8715=>666,8716=>666,8719=>716,8720=>716,8721=>642,8722=>754,8723=>754,8724=>754,8725=>303, -8727=>611,8728=>441,8729=>441,8730=>573,8731=>573,8732=>573,8733=>609,8734=>750,8735=>754,8736=>754, -8739=>262,8740=>431,8741=>416,8742=>570,8743=>659,8744=>659,8745=>754,8746=>754,8747=>469,8748=>766, -8749=>1063,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754,8770=>754,8771=>754,8776=>754, -8784=>754,8785=>754,8786=>754,8787=>754,8788=>930,8789=>930,8800=>754,8801=>754,8804=>754,8805=>754, -8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754,8845=>754,8846=>754,8847=>761, -8848=>761,8849=>761,8850=>761,8851=>754,8852=>754,8853=>754,8854=>754,8855=>754,8856=>754,8857=>754, -8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754,8865=>754,8866=>773,8867=>773, -8868=>846,8869=>846,8870=>510,8871=>510,8872=>773,8873=>773,8874=>773,8875=>927,8876=>773,8877=>773, -8878=>773,8879=>927,8901=>308,8962=>687,8968=>351,8969=>351,8970=>351,8971=>351,8976=>754,8977=>461, -8984=>900,8985=>754,8992=>469,8993=>469,8997=>900,9000=>1299,9085=>827,9134=>469,9167=>850,9251=>687, -9472=>542,9473=>542,9474=>542,9475=>542,9476=>542,9477=>542,9478=>542,9479=>542,9480=>542,9481=>542, -9482=>542,9483=>542,9484=>542,9485=>542,9486=>542,9487=>542,9488=>542,9489=>542,9490=>542,9491=>542, -9492=>542,9493=>542,9494=>542,9495=>542,9496=>542,9497=>542,9498=>542,9499=>542,9500=>542,9501=>542, -9502=>542,9503=>542,9504=>542,9505=>542,9506=>542,9507=>542,9508=>542,9509=>542,9510=>542,9511=>542, -9512=>542,9513=>542,9514=>542,9515=>542,9516=>542,9517=>542,9518=>542,9519=>542,9520=>542,9521=>542, -9522=>542,9523=>542,9524=>542,9525=>542,9526=>542,9527=>542,9528=>542,9529=>542,9530=>542,9531=>542, -9532=>542,9533=>542,9534=>542,9535=>542,9536=>542,9537=>542,9538=>542,9539=>542,9540=>542,9541=>542, -9542=>542,9543=>542,9544=>542,9545=>542,9546=>542,9547=>542,9548=>542,9549=>542,9550=>542,9551=>542, -9552=>542,9553=>542,9554=>542,9555=>542,9556=>542,9557=>542,9558=>542,9559=>542,9560=>542,9561=>542, -9562=>542,9563=>542,9564=>542,9565=>542,9566=>542,9567=>542,9568=>542,9569=>542,9570=>542,9571=>542, -9572=>542,9573=>542,9574=>542,9575=>542,9576=>542,9577=>542,9578=>542,9579=>542,9580=>542,9581=>542, -9582=>542,9583=>542,9584=>542,9585=>542,9586=>542,9587=>542,9588=>542,9589=>542,9590=>542,9591=>542, -9592=>542,9593=>542,9594=>542,9595=>542,9596=>542,9597=>542,9598=>542,9599=>542,9600=>692,9601=>692, -9602=>692,9603=>692,9604=>692,9605=>692,9606=>692,9607=>692,9608=>692,9609=>692,9610=>692,9611=>692, -9612=>692,9613=>692,9614=>692,9615=>692,9616=>692,9617=>692,9618=>692,9619=>692,9620=>692,9621=>692, -9622=>692,9623=>692,9624=>692,9625=>692,9626=>692,9627=>692,9628=>692,9629=>692,9630=>692,9631=>692, -9632=>850,9633=>850,9634=>850,9635=>850,9636=>850,9637=>850,9638=>850,9639=>850,9640=>850,9641=>850, -9642=>610,9643=>610,9644=>850,9645=>850,9646=>495,9647=>495,9648=>692,9649=>692,9650=>692,9651=>692, -9652=>452,9653=>452,9654=>692,9655=>692,9656=>452,9657=>452,9658=>692,9659=>692,9660=>692,9661=>692, -9662=>452,9663=>452,9664=>692,9665=>692,9666=>452,9667=>452,9668=>692,9669=>692,9670=>692,9671=>692, -9672=>692,9673=>785,9674=>444,9675=>785,9676=>785,9677=>785,9678=>785,9679=>785,9680=>785,9681=>785, -9682=>785,9683=>785,9684=>785,9685=>785,9686=>474,9687=>474,9688=>712,9689=>873,9690=>873,9691=>873, -9692=>348,9693=>348,9694=>348,9695=>348,9696=>785,9697=>785,9698=>692,9699=>692,9700=>692,9701=>692, -9702=>531,9703=>850,9704=>850,9705=>850,9706=>850,9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007, -9712=>850,9713=>850,9714=>850,9715=>850,9716=>785,9717=>785,9718=>785,9719=>785,9720=>692,9721=>692, -9722=>692,9723=>747,9724=>747,9725=>659,9726=>659,9727=>692,9728=>807,9784=>807,9785=>807,9786=>807, -9787=>807,9788=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807,9796=>807,9797=>807,9798=>807, -9799=>807,9824=>807,9825=>807,9826=>807,9827=>807,9828=>807,9829=>807,9830=>807,9831=>807,9833=>424, -9834=>574,9835=>807,9836=>807,9837=>424,9838=>321,9839=>435,10145=>754,10181=>351,10182=>351,10208=>444, -10216=>351,10217=>351,10224=>754,10225=>754,10226=>754,10227=>754,10228=>930,10229=>1290,10230=>1290,10231=>1290, -10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290,10237=>1290,10238=>1290,10239=>1290,10240=>659,10241=>659, -10242=>659,10243=>659,10244=>659,10245=>659,10246=>659,10247=>659,10248=>659,10249=>659,10250=>659,10251=>659, -10252=>659,10253=>659,10254=>659,10255=>659,10256=>659,10257=>659,10258=>659,10259=>659,10260=>659,10261=>659, -10262=>659,10263=>659,10264=>659,10265=>659,10266=>659,10267=>659,10268=>659,10269=>659,10270=>659,10271=>659, -10272=>659,10273=>659,10274=>659,10275=>659,10276=>659,10277=>659,10278=>659,10279=>659,10280=>659,10281=>659, -10282=>659,10283=>659,10284=>659,10285=>659,10286=>659,10287=>659,10288=>659,10289=>659,10290=>659,10291=>659, -10292=>659,10293=>659,10294=>659,10295=>659,10296=>659,10297=>659,10298=>659,10299=>659,10300=>659,10301=>659, -10302=>659,10303=>659,10304=>659,10305=>659,10306=>659,10307=>659,10308=>659,10309=>659,10310=>659,10311=>659, -10312=>659,10313=>659,10314=>659,10315=>659,10316=>659,10317=>659,10318=>659,10319=>659,10320=>659,10321=>659, -10322=>659,10323=>659,10324=>659,10325=>659,10326=>659,10327=>659,10328=>659,10329=>659,10330=>659,10331=>659, -10332=>659,10333=>659,10334=>659,10335=>659,10336=>659,10337=>659,10338=>659,10339=>659,10340=>659,10341=>659, -10342=>659,10343=>659,10344=>659,10345=>659,10346=>659,10347=>659,10348=>659,10349=>659,10350=>659,10351=>659, -10352=>659,10353=>659,10354=>659,10355=>659,10356=>659,10357=>659,10358=>659,10359=>659,10360=>659,10361=>659, -10362=>659,10363=>659,10364=>659,10365=>659,10366=>659,10367=>659,10368=>659,10369=>659,10370=>659,10371=>659, -10372=>659,10373=>659,10374=>659,10375=>659,10376=>659,10377=>659,10378=>659,10379=>659,10380=>659,10381=>659, -10382=>659,10383=>659,10384=>659,10385=>659,10386=>659,10387=>659,10388=>659,10389=>659,10390=>659,10391=>659, -10392=>659,10393=>659,10394=>659,10395=>659,10396=>659,10397=>659,10398=>659,10399=>659,10400=>659,10401=>659, -10402=>659,10403=>659,10404=>659,10405=>659,10406=>659,10407=>659,10408=>659,10409=>659,10410=>659,10411=>659, -10412=>659,10413=>659,10414=>659,10415=>659,10416=>659,10417=>659,10418=>659,10419=>659,10420=>659,10421=>659, -10422=>659,10423=>659,10424=>659,10425=>659,10426=>659,10427=>659,10428=>659,10429=>659,10430=>659,10431=>659, -10432=>659,10433=>659,10434=>659,10435=>659,10436=>659,10437=>659,10438=>659,10439=>659,10440=>659,10441=>659, -10442=>659,10443=>659,10444=>659,10445=>659,10446=>659,10447=>659,10448=>659,10449=>659,10450=>659,10451=>659, -10452=>659,10453=>659,10454=>659,10455=>659,10456=>659,10457=>659,10458=>659,10459=>659,10460=>659,10461=>659, -10462=>659,10463=>659,10464=>659,10465=>659,10466=>659,10467=>659,10468=>659,10469=>659,10470=>659,10471=>659, -10472=>659,10473=>659,10474=>659,10475=>659,10476=>659,10477=>659,10478=>659,10479=>659,10480=>659,10481=>659, -10482=>659,10483=>659,10484=>659,10485=>659,10486=>659,10487=>659,10488=>659,10489=>659,10490=>659,10491=>659, -10492=>659,10493=>659,10494=>659,10495=>659,10496=>754,10497=>754,10498=>754,10499=>754,10500=>754,10501=>754, -10502=>754,10503=>754,10504=>754,10505=>754,10506=>754,10507=>754,10508=>754,10509=>754,10510=>754,10511=>754, -10512=>754,10513=>754,10514=>754,10515=>754,10516=>754,10517=>754,10518=>754,10519=>754,10520=>754,10521=>754, -10522=>754,10523=>754,10524=>754,10525=>754,10526=>754,10527=>754,10528=>754,10529=>754,10530=>754,10531=>754, -10532=>754,10533=>754,10534=>754,10535=>754,10536=>754,10537=>754,10538=>754,10539=>754,10540=>754,10541=>754, -10542=>754,10543=>754,10544=>754,10545=>754,10546=>754,10547=>754,10548=>754,10549=>754,10550=>754,10551=>754, -10552=>754,10553=>754,10554=>754,10555=>754,10556=>754,10557=>754,10558=>754,10559=>754,10560=>754,10561=>754, -10562=>754,10563=>754,10564=>754,10565=>754,10566=>754,10567=>754,10568=>754,10569=>754,10570=>754,10571=>754, -10572=>754,10573=>754,10574=>754,10575=>754,10576=>754,10577=>754,10578=>754,10579=>754,10580=>754,10581=>754, -10582=>754,10583=>754,10584=>754,10585=>754,10586=>754,10587=>754,10588=>754,10589=>754,10590=>754,10591=>754, -10592=>754,10593=>754,10594=>754,10595=>754,10596=>754,10597=>754,10598=>754,10599=>754,10600=>754,10601=>754, -10602=>754,10603=>754,10604=>754,10605=>754,10606=>754,10607=>754,10608=>754,10609=>754,10610=>754,10611=>754, -10612=>754,10613=>754,10614=>754,10615=>883,10616=>754,10617=>754,10618=>886,10619=>754,10620=>754,10621=>754, -10622=>754,10623=>754,10731=>444,10764=>1361,10765=>469,10766=>469,10799=>754,11008=>754,11009=>754,11010=>754, -11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754,11018=>754,11019=>754,11020=>754, -11021=>754,11022=>754,11023=>754,11024=>754,11025=>754,11026=>850,11027=>850,11028=>850,11029=>850,11030=>692, -11031=>692,11032=>692,11033=>692,11034=>850,11364=>677,11367=>785,11368=>580,11369=>672,11370=>545,11371=>625, -11372=>474,11374=>921,11375=>650,11381=>666,11382=>500,11383=>630,11385=>451,11386=>542,11388=>237,11389=>409, -11520=>695,11521=>571,11522=>569,11523=>592,11524=>568,11525=>866,11526=>680,11527=>864,11528=>555,11529=>581, -11530=>866,11531=>568,11532=>581,11533=>866,11534=>580,11535=>779,11536=>865,11537=>580,11538=>580,11539=>863, -11540=>851,11541=>777,11542=>580,11543=>581,11544=>580,11545=>584,11546=>619,11547=>571,11548=>883,11549=>613, -11550=>608,11551=>766,11552=>861,11553=>569,11554=>580,11555=>582,11556=>674,11557=>822,11800=>482,11810=>351, -11811=>351,11812=>351,11813=>351,11822=>482,42564=>616,42565=>461,42566=>355,42567=>353,42576=>994,42577=>799, -42580=>1074,42581=>783,42582=>1025,42583=>809,42760=>444,42761=>444,42762=>444,42763=>444,42764=>444,42765=>444, -42766=>444,42767=>444,42768=>444,42769=>444,42770=>444,42771=>444,42772=>444,42773=>444,42774=>444,42779=>332, -42780=>332,42781=>228,42782=>228,42783=>228,42891=>361,42892=>247,62464=>588,62465=>598,62466=>642,62467=>853, -62468=>598,62469=>593,62470=>652,62471=>888,62472=>598,62473=>598,62474=>1131,62475=>614,62476=>613,62477=>857, -62478=>598,62479=>613,62480=>898,62481=>671,62482=>718,62483=>672,62484=>850,62485=>613,62486=>842,62487=>612, -62488=>619,62489=>613,62490=>655,62491=>613,62492=>619,62493=>599,62494=>656,62495=>795,62496=>598,62497=>635, -62498=>599,62499=>598,62500=>598,62501=>649,62502=>865,62504=>813,63173=>542,63185=>450,63188=>450,64256=>639, -64257=>600,64258=>600,64259=>925,64260=>927,64261=>694,64262=>839,65024=>0,65025=>0,65026=>0,65027=>0, -65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0, -65038=>0,65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>923); -$enc=''; -$diff=''; -$file='dejavuserifcondensed.z'; -$ctg='dejavuserifcondensed.ctg.z'; -$originalsize=295840; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.z deleted file mode 100644 index 8af7772493..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensed.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.ctg.z deleted file mode 100644 index c1a3ccbf9e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.php deleted file mode 100644 index a7db677a5d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.php +++ /dev/null @@ -1,299 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerifCondensed-Bold'; -$desc=array('Ascent'=>939,'Descent'=>-236,'CapHeight'=>4,'Flags'=>32,'FontBBox'=>'[-752 -389 1616 1235]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>313,33=>395,34=>469,35=>754,36=>626,37=>855,38=>813,39=>275,40=>426, -41=>426,42=>470,43=>754,44=>313,45=>374,46=>313,47=>329,48=>626,49=>626,50=>626, -51=>626,52=>626,53=>626,54=>626,55=>626,56=>626,57=>626,58=>332,59=>332,60=>754, -61=>754,62=>754,63=>527,64=>900,65=>698,66=>760,67=>716,68=>780,69=>686,70=>639, -71=>769,72=>850,73=>421,74=>426,75=>782,76=>633,77=>996,78=>822,79=>784,80=>677, -81=>784,82=>748,83=>650,84=>669,85=>785,86=>698,87=>1011,88=>698,89=>642,90=>657, -91=>426,92=>329,93=>426,94=>754,95=>450,96=>450,97=>583,98=>629,99=>548,100=>629, -101=>572,102=>387,103=>629,104=>654,105=>342,106=>325,107=>624,108=>342,109=>952,110=>654, -111=>600,112=>629,113=>629,114=>474,115=>506,116=>416,117=>654,118=>523,119=>774,120=>536, -121=>523,122=>511,123=>579,124=>327,125=>579,126=>754,8364=>626,8218=>313,402=>387,8222=>518, -8230=>900,8224=>470,8225=>470,710=>450,8240=>1246,352=>650,8249=>360,338=>1062,381=>657,8216=>313, -8217=>313,8220=>518,8221=>518,8226=>575,8211=>450,8212=>900,732=>450,8482=>900,353=>506,8250=>360, -339=>925,382=>511,376=>642,160=>313,161=>395,162=>626,163=>626,164=>572,165=>626,166=>327, -167=>470,168=>450,169=>900,170=>438,171=>563,172=>754,173=>374,174=>900,175=>450,176=>450, -177=>754,178=>394,179=>394,180=>450,181=>659,182=>572,183=>313,184=>450,185=>394,186=>450, -187=>563,188=>938,189=>938,190=>938,191=>527,192=>698,193=>698,194=>698,195=>698,196=>698, -197=>698,198=>931,199=>716,200=>686,201=>686,202=>686,203=>686,204=>421,205=>421,206=>421, -207=>421,208=>787,209=>822,210=>784,211=>784,212=>784,213=>784,214=>784,215=>754,216=>784, -217=>785,218=>785,219=>785,220=>785,221=>642,222=>681,223=>684,224=>583,225=>583,226=>583, -227=>583,228=>583,229=>583,230=>877,231=>548,232=>572,233=>572,234=>572,235=>572,236=>342, -237=>342,238=>342,239=>342,240=>600,241=>654,242=>600,243=>600,244=>600,245=>600,246=>600, -247=>754,248=>600,249=>654,250=>654,251=>654,252=>654,253=>523,254=>629,255=>523,256=>698, -257=>583,258=>698,259=>583,260=>698,261=>583,262=>716,263=>548,264=>716,265=>548,266=>716, -267=>548,268=>716,269=>548,270=>780,271=>629,272=>787,273=>629,274=>686,275=>572,276=>686, -277=>572,278=>686,279=>572,280=>686,281=>572,282=>686,283=>572,284=>769,285=>629,286=>769, -287=>629,288=>769,289=>629,290=>769,291=>629,292=>850,293=>654,294=>850,295=>654,296=>421, -297=>342,298=>421,299=>342,300=>421,301=>342,302=>421,303=>342,304=>421,305=>342,306=>848, -307=>676,308=>426,309=>325,310=>782,311=>624,312=>624,313=>633,314=>342,315=>633,316=>342, -317=>633,318=>342,319=>633,320=>342,321=>639,322=>346,323=>822,324=>654,325=>822,326=>654, -327=>822,328=>654,329=>907,330=>785,331=>654,332=>784,333=>600,334=>784,335=>600,336=>784, -337=>600,340=>748,341=>474,342=>748,343=>474,344=>748,345=>474,346=>650,347=>506,348=>650, -349=>506,350=>650,351=>506,354=>669,355=>416,356=>669,357=>416,358=>669,359=>416,360=>785, -361=>654,362=>785,363=>654,364=>785,365=>654,366=>785,367=>654,368=>785,369=>654,370=>785, -371=>654,372=>1011,373=>774,374=>642,375=>523,377=>657,378=>511,379=>657,380=>511,383=>387, -384=>629,385=>760,386=>769,387=>629,388=>769,389=>629,390=>716,391=>716,392=>548,393=>787, -394=>780,395=>769,396=>629,397=>600,398=>686,399=>784,400=>649,401=>639,403=>769,404=>693, -405=>938,406=>421,407=>421,408=>782,409=>624,410=>342,411=>631,412=>952,413=>822,414=>654, -415=>784,416=>784,417=>600,418=>1080,419=>849,420=>677,421=>629,422=>748,423=>650,424=>506, -425=>636,426=>298,427=>416,428=>669,429=>416,430=>669,431=>785,432=>654,433=>801,434=>801, -435=>642,436=>637,437=>657,438=>511,439=>591,440=>591,441=>591,443=>626,444=>678,445=>511, -446=>482,448=>265,449=>443,450=>413,451=>265,452=>1437,453=>1292,454=>1140,455=>1059,456=>958, -457=>667,458=>1248,459=>1148,460=>980,461=>698,462=>583,463=>421,464=>342,465=>784,466=>600, -467=>785,468=>654,469=>785,470=>654,471=>785,472=>654,473=>785,474=>654,475=>785,476=>654, -477=>572,478=>698,479=>583,480=>698,481=>583,482=>931,483=>877,484=>806,485=>629,486=>769, -487=>629,488=>782,489=>624,490=>784,491=>600,492=>784,493=>600,494=>591,495=>511,496=>342, -497=>1437,498=>1292,499=>1140,500=>769,501=>629,502=>1099,504=>822,505=>654,506=>698,507=>583, -508=>931,509=>877,510=>784,511=>600,512=>698,513=>583,514=>698,515=>583,516=>686,517=>572, -518=>686,519=>572,520=>421,521=>342,522=>421,523=>342,524=>784,525=>600,526=>784,527=>600, -528=>748,529=>474,530=>748,531=>474,532=>785,533=>654,534=>785,535=>654,536=>650,537=>506, -538=>669,539=>416,540=>621,541=>546,542=>850,543=>654,544=>785,545=>711,548=>657,549=>511, -550=>698,551=>583,552=>686,553=>572,554=>784,555=>600,556=>784,557=>600,558=>784,559=>600, -560=>784,561=>600,562=>642,563=>523,564=>516,565=>830,566=>508,567=>325,568=>928,569=>928, -570=>698,571=>716,572=>548,573=>633,574=>669,575=>506,576=>511,577=>594,578=>492,581=>698, -592=>583,593=>629,594=>629,595=>629,596=>548,597=>548,598=>629,599=>657,600=>572,601=>572, -602=>816,603=>547,604=>505,605=>816,606=>647,607=>348,608=>629,609=>629,610=>563,611=>641, -612=>564,613=>654,614=>654,615=>654,616=>342,617=>342,618=>342,619=>368,620=>462,621=>342, -622=>716,623=>952,624=>952,625=>952,626=>654,627=>654,628=>641,629=>600,630=>955,631=>674, -632=>600,633=>514,634=>514,635=>514,636=>474,637=>474,638=>406,639=>438,640=>721,641=>721, -642=>506,643=>298,644=>387,645=>486,646=>298,647=>443,648=>416,649=>654,650=>611,651=>624, -652=>577,653=>816,654=>571,655=>654,656=>511,657=>511,658=>511,659=>511,660=>482,661=>482, -662=>482,663=>490,664=>784,665=>625,666=>647,667=>563,668=>659,669=>345,670=>666,671=>581, -672=>629,673=>482,674=>482,675=>1005,676=>1061,677=>1005,678=>819,679=>643,680=>817,681=>935, -682=>711,683=>716,684=>596,685=>398,686=>552,687=>646,688=>469,689=>466,690=>282,691=>372, -692=>372,693=>432,694=>474,695=>595,696=>436,697=>271,699=>313,700=>313,701=>313,702=>330, -703=>330,704=>282,705=>282,711=>450,712=>254,713=>450,716=>254,720=>332,721=>332,722=>330, -723=>330,726=>353,728=>450,729=>450,730=>450,731=>450,733=>450,734=>375,736=>412,737=>263, -738=>355,739=>427,740=>282,741=>450,742=>450,743=>450,744=>450,745=>450,750=>498,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>701,881=>519,884=>271, -885=>271,890=>450,891=>548,892=>548,893=>548,894=>332,900=>450,901=>450,902=>698,903=>313, -904=>852,905=>1006,906=>595,908=>798,910=>857,911=>820,912=>435,913=>698,914=>760,915=>639, -916=>698,917=>686,918=>657,919=>850,920=>784,921=>421,922=>782,923=>698,924=>996,925=>822, -926=>633,927=>784,928=>850,929=>677,931=>636,932=>669,933=>642,934=>784,935=>698,936=>822, -937=>801,938=>421,939=>642,940=>692,941=>547,942=>654,943=>435,944=>624,945=>692,946=>598, -947=>594,948=>600,949=>547,950=>533,951=>654,952=>600,953=>435,954=>674,955=>631,956=>659, -957=>624,958=>533,959=>600,960=>659,961=>598,962=>548,963=>664,964=>605,965=>624,966=>814, -967=>592,968=>847,969=>857,970=>435,971=>624,972=>600,973=>624,974=>857,976=>600,977=>764, -978=>687,979=>872,980=>687,981=>847,982=>857,983=>589,984=>784,985=>600,986=>716,987=>548, -988=>639,989=>475,990=>531,991=>593,992=>716,993=>600,1008=>589,1009=>598,1010=>548,1011=>325, -1012=>784,1013=>548,1014=>548,1015=>681,1016=>629,1017=>716,1018=>996,1019=>774,1020=>623,1021=>716, -1022=>716,1023=>716,1024=>686,1025=>686,1026=>811,1027=>621,1028=>716,1029=>650,1030=>421,1031=>421, -1032=>426,1033=>1081,1034=>1135,1035=>866,1036=>818,1037=>850,1038=>730,1039=>850,1040=>733,1041=>769, -1042=>760,1043=>621,1044=>800,1045=>686,1046=>1181,1047=>649,1048=>850,1049=>850,1050=>818,1051=>795, -1052=>996,1053=>850,1054=>784,1055=>850,1056=>677,1057=>716,1058=>669,1059=>730,1060=>854,1061=>698, -1062=>870,1063=>822,1064=>1141,1065=>1164,1066=>861,1067=>1081,1068=>743,1069=>716,1070=>1158,1071=>793, -1072=>583,1073=>600,1074=>625,1075=>551,1076=>600,1077=>572,1078=>909,1079=>574,1080=>667,1081=>667, -1082=>650,1083=>634,1084=>782,1085=>659,1086=>600,1087=>659,1088=>629,1089=>548,1090=>558,1091=>576, -1092=>812,1093=>536,1094=>665,1095=>659,1096=>967,1097=>974,1098=>690,1099=>902,1100=>611,1101=>548, -1102=>923,1103=>665,1104=>572,1105=>572,1106=>646,1107=>551,1108=>548,1109=>506,1110=>342,1111=>342, -1112=>325,1113=>889,1114=>913,1115=>654,1116=>650,1117=>667,1118=>576,1119=>659,1122=>792,1123=>633, -1124=>1076,1125=>867,1130=>1181,1131=>909,1136=>986,1137=>995,1138=>784,1139=>587,1140=>824,1141=>673, -1164=>761,1165=>606,1168=>630,1169=>556,1170=>621,1171=>551,1172=>781,1173=>645,1174=>1181,1175=>909, -1176=>649,1177=>574,1178=>852,1179=>669,1182=>818,1183=>650,1184=>937,1185=>744,1186=>870,1187=>665, -1188=>1050,1189=>860,1190=>1210,1191=>953,1194=>716,1195=>548,1196=>669,1197=>558,1198=>642,1199=>523, -1200=>642,1201=>523,1202=>779,1203=>584,1204=>919,1205=>726,1206=>835,1207=>665,1210=>819,1211=>654, -1216=>421,1217=>1181,1218=>909,1219=>782,1220=>624,1223=>850,1224=>659,1227=>822,1228=>659,1231=>342, -1232=>733,1233=>583,1234=>733,1235=>583,1236=>931,1237=>877,1238=>686,1239=>572,1240=>784,1241=>572, -1242=>784,1243=>572,1244=>1181,1245=>909,1246=>649,1247=>574,1248=>591,1249=>511,1250=>850,1251=>667, -1252=>850,1253=>667,1254=>784,1255=>600,1256=>784,1257=>600,1258=>784,1259=>600,1260=>716,1261=>548, -1262=>730,1263=>576,1264=>730,1265=>576,1266=>730,1267=>576,1268=>822,1269=>659,1270=>621,1271=>551, -1272=>1081,1273=>902,1296=>649,1297=>574,1298=>795,1299=>634,1300=>1123,1301=>851,1306=>738,1307=>576, -1308=>925,1309=>770,4256=>680,4257=>842,4258=>779,4259=>787,4260=>703,4261=>970,4262=>913,4263=>1091, -4264=>579,4265=>736,4266=>946,4267=>945,4268=>716,4269=>1021,4270=>872,4271=>812,4272=>998,4273=>712, -4274=>680,4275=>968,4276=>878,4277=>959,4278=>729,4279=>750,4280=>739,4281=>750,4282=>817,4283=>969, -4284=>692,4285=>739,4286=>731,4287=>1000,4288=>1010,4289=>721,4290=>803,4291=>722,4292=>792,4293=>957, -4304=>535,4305=>563,4306=>579,4307=>798,4308=>553,4309=>549,4310=>600,4311=>823,4312=>552,4313=>540, -4314=>1008,4315=>576,4316=>576,4317=>791,4318=>561,4319=>571,4320=>790,4321=>599,4322=>702,4323=>676, -4324=>782,4325=>575,4326=>820,4327=>559,4328=>583,4329=>576,4330=>656,4331=>577,4332=>567,4333=>566, -4334=>603,4335=>678,4336=>563,4337=>591,4338=>563,4339=>563,4340=>562,4341=>603,4342=>846,4343=>612, -4344=>572,4345=>605,4346=>562,4347=>529,4348=>318,7426=>846,7432=>458,7433=>288,7444=>890,7446=>600, -7447=>600,7453=>663,7454=>853,7455=>853,7468=>439,7469=>586,7470=>479,7472=>491,7473=>432,7474=>432, -7475=>483,7476=>536,7477=>265,7478=>268,7479=>492,7480=>398,7481=>627,7482=>518,7483=>518,7484=>493, -7486=>426,7487=>471,7488=>409,7489=>422,7490=>494,7491=>419,7492=>419,7493=>448,7494=>591,7495=>448, -7496=>448,7497=>400,7498=>400,7499=>370,7500=>370,7501=>448,7502=>270,7503=>471,7504=>655,7505=>426, -7506=>420,7507=>384,7508=>420,7509=>420,7510=>448,7511=>333,7512=>468,7513=>390,7514=>655,7515=>442, -7522=>215,7523=>372,7524=>468,7525=>442,7543=>576,7544=>536,7547=>342,7557=>342,7579=>448,7580=>384, -7581=>384,7582=>420,7583=>370,7584=>345,7585=>335,7586=>448,7587=>470,7588=>270,7589=>276,7590=>270, -7591=>270,7592=>333,7593=>331,7594=>289,7595=>387,7596=>613,7597=>655,7598=>529,7599=>528,7600=>425, -7601=>420,7602=>470,7603=>360,7604=>348,7605=>333,7606=>468,7607=>427,7609=>439,7610=>442,7611=>371, -7612=>474,7613=>371,7614=>407,7615=>420,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>698,7681=>583,7682=>760,7683=>629,7684=>760,7685=>629,7686=>760,7687=>629,7688=>716,7689=>548, -7690=>780,7691=>629,7692=>780,7693=>629,7694=>780,7695=>629,7696=>780,7697=>629,7698=>780,7699=>629, -7700=>686,7701=>572,7702=>686,7703=>572,7704=>686,7705=>572,7706=>686,7707=>572,7708=>686,7709=>572, -7710=>639,7711=>387,7712=>769,7713=>629,7714=>850,7715=>654,7716=>850,7717=>654,7718=>850,7719=>654, -7720=>850,7721=>654,7722=>850,7723=>654,7724=>421,7725=>342,7728=>782,7729=>624,7730=>782,7731=>624, -7732=>782,7733=>624,7734=>633,7735=>342,7736=>633,7737=>342,7738=>633,7739=>342,7740=>633,7741=>342, -7742=>996,7743=>952,7744=>996,7745=>952,7746=>996,7747=>952,7748=>822,7749=>654,7750=>822,7751=>654, -7752=>822,7753=>654,7754=>822,7755=>654,7756=>784,7757=>600,7760=>784,7761=>600,7762=>784,7763=>600, -7764=>677,7765=>629,7766=>677,7767=>629,7768=>748,7769=>474,7770=>748,7771=>474,7772=>748,7773=>474, -7774=>748,7775=>474,7776=>650,7777=>506,7778=>650,7779=>506,7784=>650,7785=>506,7786=>669,7787=>416, -7788=>669,7789=>416,7790=>669,7791=>416,7792=>669,7793=>416,7794=>785,7795=>654,7796=>785,7797=>654, -7798=>785,7799=>654,7800=>785,7801=>654,7802=>785,7803=>654,7804=>698,7805=>523,7806=>698,7807=>523, -7808=>1011,7809=>774,7810=>1011,7811=>774,7812=>1011,7813=>774,7814=>1011,7815=>774,7816=>1011,7817=>774, -7818=>698,7819=>536,7820=>698,7821=>536,7822=>642,7823=>523,7824=>657,7825=>511,7826=>657,7827=>511, -7828=>657,7829=>511,7830=>654,7831=>416,7832=>774,7833=>523,7834=>913,7835=>387,7838=>852,7839=>600, -7840=>698,7841=>583,7842=>698,7843=>583,7852=>698,7853=>583,7854=>698,7855=>583,7856=>698,7857=>583, -7858=>698,7859=>583,7860=>698,7861=>583,7862=>698,7863=>583,7864=>686,7865=>572,7866=>686,7867=>572, -7868=>686,7869=>572,7878=>686,7879=>572,7880=>421,7881=>342,7882=>421,7883=>342,7884=>784,7885=>600, -7886=>784,7887=>600,7896=>784,7897=>600,7908=>785,7909=>654,7910=>785,7911=>654,7922=>642,7923=>523, -7924=>642,7925=>523,7926=>642,7927=>523,7928=>642,7929=>523,7936=>692,7937=>692,7938=>692,7939=>692, -7940=>692,7941=>692,7942=>692,7943=>692,7944=>698,7945=>698,7946=>880,7947=>880,7948=>748,7949=>764, -7950=>698,7951=>698,7952=>547,7953=>547,7954=>547,7955=>547,7956=>547,7957=>547,7960=>826,7961=>817, -7962=>1052,7963=>1052,7964=>984,7965=>1007,7968=>654,7969=>654,7970=>654,7971=>654,7972=>654,7973=>654, -7974=>654,7975=>654,7976=>990,7977=>984,7978=>1222,7979=>1225,7980=>1151,7981=>1177,7982=>1077,7983=>1074, -7984=>435,7985=>435,7986=>435,7987=>435,7988=>435,7989=>435,7990=>435,7991=>435,7992=>566,7993=>555, -7994=>790,7995=>792,7996=>719,7997=>748,7998=>650,7999=>642,8000=>600,8001=>600,8002=>600,8003=>600, -8004=>600,8005=>600,8008=>810,8009=>841,8010=>1116,8011=>1113,8012=>931,8013=>959,8016=>624,8017=>624, -8018=>624,8019=>624,8020=>624,8021=>624,8022=>624,8023=>624,8025=>830,8027=>1067,8029=>1020,8031=>917, -8032=>857,8033=>857,8034=>857,8035=>857,8036=>857,8037=>857,8038=>857,8039=>857,8040=>838,8041=>867, -8042=>1141,8043=>1146,8044=>949,8045=>979,8046=>920,8047=>954,8048=>692,8049=>692,8050=>547,8051=>547, -8052=>654,8053=>654,8054=>435,8055=>435,8056=>600,8057=>600,8058=>624,8059=>624,8060=>857,8061=>857, -8064=>692,8065=>692,8066=>692,8067=>692,8068=>692,8069=>692,8070=>692,8071=>692,8072=>698,8073=>698, -8074=>880,8075=>880,8076=>748,8077=>764,8078=>698,8079=>698,8080=>654,8081=>654,8082=>654,8083=>654, -8084=>654,8085=>654,8086=>654,8087=>654,8088=>990,8089=>984,8090=>1222,8091=>1225,8092=>1151,8093=>1177, -8094=>1077,8095=>1074,8096=>857,8097=>857,8098=>857,8099=>857,8100=>857,8101=>857,8102=>857,8103=>857, -8104=>838,8105=>867,8106=>1141,8107=>1146,8108=>949,8109=>979,8110=>920,8111=>954,8112=>692,8113=>692, -8114=>692,8115=>692,8116=>692,8118=>692,8119=>692,8120=>698,8121=>698,8122=>729,8123=>698,8124=>698, -8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>654,8131=>654,8132=>654,8134=>654,8135=>654, -8136=>899,8137=>852,8138=>1072,8139=>1006,8140=>850,8141=>450,8142=>450,8143=>450,8144=>435,8145=>435, -8146=>435,8147=>435,8150=>435,8151=>435,8152=>421,8153=>421,8154=>642,8155=>595,8157=>450,8158=>450, -8159=>450,8160=>624,8161=>624,8162=>624,8163=>624,8164=>598,8165=>598,8166=>624,8167=>624,8168=>642, -8169=>642,8170=>917,8171=>857,8172=>819,8173=>450,8174=>450,8175=>450,8178=>857,8179=>857,8180=>857, -8182=>857,8183=>857,8184=>962,8185=>798,8186=>991,8187=>820,8188=>801,8189=>450,8190=>450,8192=>450, -8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>626,8200=>313,8201=>180,8202=>89, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>374,8209=>374,8210=>626,8213=>900,8214=>450, -8215=>450,8219=>313,8223=>518,8227=>575,8228=>313,8229=>606,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>180,8241=>1638,8242=>237,8243=>402,8244=>567,8245=>237,8246=>402,8247=>567,8248=>659, -8252=>566,8253=>527,8254=>450,8258=>920,8260=>150,8261=>426,8262=>426,8263=>974,8264=>770,8265=>770, -8267=>572,8268=>450,8269=>450,8270=>470,8271=>332,8273=>470,8274=>500,8275=>900,8279=>731,8287=>200, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>394,8305=>215,8308=>394,8309=>394,8310=>394,8311=>394,8312=>394,8313=>394,8314=>475, -8315=>475,8316=>475,8317=>268,8318=>268,8319=>467,8320=>394,8321=>394,8322=>394,8323=>394,8324=>394, -8325=>394,8326=>394,8327=>394,8328=>394,8329=>394,8330=>475,8331=>475,8332=>475,8333=>268,8334=>268, -8336=>419,8337=>400,8338=>420,8339=>427,8340=>400,8358=>626,8367=>1039,8369=>710,8372=>788,8373=>626, -8451=>1078,8457=>1001,8462=>654,8463=>654,8470=>978,8486=>801,8487=>801,8490=>782,8491=>698,8513=>697, -8514=>501,8515=>573,8516=>684,8523=>813,8531=>932,8532=>932,8533=>932,8534=>932,8535=>932,8536=>932, -8537=>932,8538=>932,8539=>932,8540=>932,8541=>932,8542=>932,8543=>554,8544=>421,8545=>663,8546=>904, -8547=>984,8548=>698,8549=>1014,8550=>1256,8551=>1498,8552=>962,8553=>698,8554=>970,8555=>1212,8556=>633, -8557=>716,8558=>780,8559=>996,8560=>342,8561=>684,8562=>1025,8563=>865,8564=>523,8565=>865,8566=>1207, -8567=>1548,8568=>878,8569=>536,8570=>878,8571=>1220,8572=>342,8573=>548,8574=>629,8575=>952,8576=>1129, -8577=>780,8578=>1141,8579=>716,8580=>548,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754, -8598=>754,8599=>754,8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754, -8608=>754,8609=>754,8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754, -8618=>754,8619=>754,8620=>754,8621=>754,8622=>754,8623=>765,8624=>754,8625=>754,8626=>754,8627=>754, -8628=>754,8629=>754,8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754, -8638=>754,8639=>754,8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754, -8648=>754,8649=>754,8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754, -8658=>754,8659=>754,8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754, -8668=>754,8669=>754,8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754, -8678=>754,8679=>754,8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754, -8688=>754,8689=>754,8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754, -8698=>754,8699=>754,8700=>754,8701=>754,8702=>754,8703=>754,8704=>577,8706=>480,8707=>558,8708=>558, -8710=>677,8711=>677,8712=>666,8713=>666,8715=>666,8716=>666,8719=>757,8720=>757,8721=>677,8722=>754, -8723=>754,8724=>754,8725=>329,8727=>622,8728=>466,8729=>466,8730=>591,8731=>591,8732=>591,8733=>604, -8734=>750,8735=>754,8736=>754,8739=>292,8740=>546,8741=>476,8742=>696,8743=>730,8744=>730,8745=>754, -8746=>754,8747=>521,8748=>900,8749=>1252,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754, -8770=>754,8771=>754,8776=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>974,8789=>974,8800=>754, -8801=>754,8804=>754,8805=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754, -8845=>754,8846=>754,8847=>754,8848=>754,8849=>754,8850=>754,8851=>754,8852=>754,8853=>754,8854=>754, -8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754, -8865=>754,8866=>795,8867=>795,8868=>864,8869=>864,8870=>554,8871=>554,8872=>795,8873=>795,8874=>795, -8875=>971,8876=>795,8877=>795,8878=>795,8879=>971,8901=>358,8962=>751,8968=>426,8969=>426,8970=>426, -8971=>426,8976=>754,8977=>484,8984=>835,8985=>754,8992=>521,8993=>521,8997=>900,9000=>1299,9085=>907, -9134=>521,9167=>850,9251=>751,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692,9606=>692, -9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692,9616=>692, -9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692,9626=>692, -9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850,9636=>850, -9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850,9646=>495, -9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692,9656=>452, -9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692,9666=>452, -9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785,9676=>785, -9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785,9686=>474, -9687=>474,9688=>712,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348,9696=>785, -9697=>785,9698=>692,9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850,9706=>850, -9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850,9716=>785, -9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659,9726=>659, -9727=>692,9728=>807,9784=>807,9785=>807,9786=>807,9787=>807,9788=>807,9791=>552,9792=>658,9793=>658, -9794=>807,9795=>807,9796=>807,9797=>807,9798=>807,9799=>807,9824=>807,9825=>807,9826=>807,9827=>807, -9828=>807,9829=>807,9830=>807,9831=>807,9833=>424,9834=>574,9835=>807,9836=>807,9837=>424,9838=>321, -9839=>435,10145=>754,10181=>411,10182=>411,10208=>444,10216=>411,10217=>411,10224=>754,10225=>754,10226=>754, -10227=>754,10228=>930,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290, -10237=>1290,10238=>1290,10239=>1290,10240=>703,10241=>703,10242=>703,10243=>703,10244=>703,10245=>703,10246=>703, -10247=>703,10248=>703,10249=>703,10250=>703,10251=>703,10252=>703,10253=>703,10254=>703,10255=>703,10256=>703, -10257=>703,10258=>703,10259=>703,10260=>703,10261=>703,10262=>703,10263=>703,10264=>703,10265=>703,10266=>703, -10267=>703,10268=>703,10269=>703,10270=>703,10271=>703,10272=>703,10273=>703,10274=>703,10275=>703,10276=>703, -10277=>703,10278=>703,10279=>703,10280=>703,10281=>703,10282=>703,10283=>703,10284=>703,10285=>703,10286=>703, -10287=>703,10288=>703,10289=>703,10290=>703,10291=>703,10292=>703,10293=>703,10294=>703,10295=>703,10296=>703, -10297=>703,10298=>703,10299=>703,10300=>703,10301=>703,10302=>703,10303=>703,10304=>703,10305=>703,10306=>703, -10307=>703,10308=>703,10309=>703,10310=>703,10311=>703,10312=>703,10313=>703,10314=>703,10315=>703,10316=>703, -10317=>703,10318=>703,10319=>703,10320=>703,10321=>703,10322=>703,10323=>703,10324=>703,10325=>703,10326=>703, -10327=>703,10328=>703,10329=>703,10330=>703,10331=>703,10332=>703,10333=>703,10334=>703,10335=>703,10336=>703, -10337=>703,10338=>703,10339=>703,10340=>703,10341=>703,10342=>703,10343=>703,10344=>703,10345=>703,10346=>703, -10347=>703,10348=>703,10349=>703,10350=>703,10351=>703,10352=>703,10353=>703,10354=>703,10355=>703,10356=>703, -10357=>703,10358=>703,10359=>703,10360=>703,10361=>703,10362=>703,10363=>703,10364=>703,10365=>703,10366=>703, -10367=>703,10368=>703,10369=>703,10370=>703,10371=>703,10372=>703,10373=>703,10374=>703,10375=>703,10376=>703, -10377=>703,10378=>703,10379=>703,10380=>703,10381=>703,10382=>703,10383=>703,10384=>703,10385=>703,10386=>703, -10387=>703,10388=>703,10389=>703,10390=>703,10391=>703,10392=>703,10393=>703,10394=>703,10395=>703,10396=>703, -10397=>703,10398=>703,10399=>703,10400=>703,10401=>703,10402=>703,10403=>703,10404=>703,10405=>703,10406=>703, -10407=>703,10408=>703,10409=>703,10410=>703,10411=>703,10412=>703,10413=>703,10414=>703,10415=>703,10416=>703, -10417=>703,10418=>703,10419=>703,10420=>703,10421=>703,10422=>703,10423=>703,10424=>703,10425=>703,10426=>703, -10427=>703,10428=>703,10429=>703,10430=>703,10431=>703,10432=>703,10433=>703,10434=>703,10435=>703,10436=>703, -10437=>703,10438=>703,10439=>703,10440=>703,10441=>703,10442=>703,10443=>703,10444=>703,10445=>703,10446=>703, -10447=>703,10448=>703,10449=>703,10450=>703,10451=>703,10452=>703,10453=>703,10454=>703,10455=>703,10456=>703, -10457=>703,10458=>703,10459=>703,10460=>703,10461=>703,10462=>703,10463=>703,10464=>703,10465=>703,10466=>703, -10467=>703,10468=>703,10469=>703,10470=>703,10471=>703,10472=>703,10473=>703,10474=>703,10475=>703,10476=>703, -10477=>703,10478=>703,10479=>703,10480=>703,10481=>703,10482=>703,10483=>703,10484=>703,10485=>703,10486=>703, -10487=>703,10488=>703,10489=>703,10490=>703,10491=>703,10492=>703,10493=>703,10494=>703,10495=>703,10496=>754, -10497=>754,10498=>754,10499=>754,10500=>754,10501=>754,10502=>754,10503=>754,10504=>754,10505=>754,10506=>754, -10507=>754,10508=>754,10509=>754,10510=>754,10511=>754,10512=>754,10513=>754,10514=>754,10515=>754,10516=>754, -10517=>754,10518=>754,10519=>754,10520=>754,10521=>754,10522=>754,10523=>754,10524=>754,10525=>754,10526=>754, -10527=>754,10528=>754,10529=>754,10530=>754,10531=>754,10532=>754,10533=>754,10534=>754,10535=>754,10536=>754, -10537=>754,10538=>754,10539=>754,10540=>754,10541=>754,10542=>754,10543=>754,10544=>754,10545=>754,10546=>754, -10547=>754,10548=>754,10549=>754,10550=>754,10551=>754,10552=>754,10553=>754,10554=>754,10555=>754,10556=>754, -10557=>754,10558=>754,10559=>754,10560=>754,10561=>754,10562=>754,10563=>754,10564=>754,10565=>754,10566=>754, -10567=>754,10568=>754,10569=>754,10570=>754,10571=>754,10572=>754,10573=>754,10574=>754,10575=>754,10576=>754, -10577=>754,10578=>754,10579=>754,10580=>754,10581=>754,10582=>754,10583=>754,10584=>754,10585=>754,10586=>754, -10587=>754,10588=>754,10589=>754,10590=>754,10591=>754,10592=>754,10593=>754,10594=>754,10595=>754,10596=>754, -10597=>754,10598=>754,10599=>754,10600=>754,10601=>754,10602=>754,10603=>754,10604=>754,10605=>754,10606=>754, -10607=>754,10608=>754,10609=>754,10610=>754,10611=>754,10612=>754,10613=>754,10614=>754,10615=>929,10616=>754, -10617=>754,10618=>864,10619=>754,10620=>754,10621=>754,10622=>754,10623=>754,10731=>444,10764=>1604,10765=>549, -10766=>549,10799=>754,11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754, -11016=>754,11017=>754,11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754, -11026=>850,11027=>850,11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11364=>748, -11367=>850,11368=>654,11369=>782,11370=>624,11371=>657,11372=>511,11374=>996,11375=>698,11381=>701,11382=>541, -11383=>814,11385=>514,11386=>600,11388=>282,11389=>439,11520=>695,11521=>571,11522=>723,11523=>592,11524=>708, -11525=>866,11526=>680,11527=>864,11528=>555,11529=>581,11530=>866,11531=>567,11532=>581,11533=>866,11534=>761, -11535=>779,11536=>865,11537=>580,11538=>580,11539=>863,11540=>851,11541=>777,11542=>580,11543=>581,11544=>580, -11545=>584,11546=>619,11547=>842,11548=>883,11549=>613,11550=>608,11551=>766,11552=>1002,11553=>569,11554=>580, -11555=>582,11556=>674,11557=>822,11800=>527,11810=>426,11811=>426,11812=>426,11813=>426,11822=>527,42564=>650, -42565=>506,42566=>421,42567=>342,42576=>1200,42577=>982,42580=>1158,42581=>923,42582=>1158,42583=>935,42760=>450, -42761=>450,42762=>450,42763=>450,42764=>450,42765=>450,42766=>450,42767=>450,42768=>450,42769=>450,42770=>450, -42771=>450,42772=>450,42773=>450,42774=>450,42779=>346,42780=>346,42781=>249,42782=>249,42783=>249,42891=>395, -42892=>275,62464=>634,62465=>645,62466=>688,62467=>898,62468=>645,62469=>639,62470=>698,62471=>934,62472=>645, -62473=>645,62474=>1178,62475=>660,62476=>659,62477=>903,62478=>645,62479=>659,62480=>945,62481=>717,62482=>765, -62483=>719,62484=>896,62485=>659,62486=>888,62487=>658,62488=>665,62489=>659,62490=>702,62491=>659,62492=>665, -62493=>646,62494=>702,62495=>842,62496=>644,62497=>743,62498=>645,62499=>645,62500=>645,62501=>695,62502=>911, -62504=>813,63173=>600,63185=>450,63188=>450,64256=>738,64257=>654,64258=>654,64259=>1007,64260=>1005,64261=>784, -64262=>874,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0, -65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65529=>0,65530=>0,65531=>0, -65532=>0,65533=>1002); -$enc=''; -$diff=''; -$file='dejavuserifcondensedb.z'; -$ctg='dejavuserifcondensedb.ctg.z'; -$originalsize=282092; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.z deleted file mode 100644 index b84198dc24..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.ctg.z deleted file mode 100644 index d237ae7e0e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.php deleted file mode 100644 index 88cb607beb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.php +++ /dev/null @@ -1,299 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerifCondensed-BoldItalic'; -$desc=array('Ascent'=>939,'Descent'=>-236,'CapHeight'=>-48,'Flags'=>96,'FontBBox'=>'[-815 -389 1584 1235]','ItalicAngle'=>-11,'StemV'=>120,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>313,33=>395,34=>469,35=>754,36=>626,37=>855,38=>813,39=>275,40=>426, -41=>426,42=>470,43=>754,44=>313,45=>374,46=>313,47=>329,48=>626,49=>626,50=>626, -51=>626,52=>626,53=>626,54=>626,55=>626,56=>626,57=>626,58=>332,59=>332,60=>754, -61=>754,62=>754,63=>527,64=>900,65=>698,66=>760,67=>716,68=>780,69=>686,70=>639, -71=>769,72=>850,73=>421,74=>426,75=>782,76=>633,77=>996,78=>822,79=>784,80=>677, -81=>784,82=>748,83=>650,84=>669,85=>785,86=>698,87=>1011,88=>698,89=>642,90=>657, -91=>426,92=>329,93=>426,94=>754,95=>450,96=>450,97=>583,98=>629,99=>548,100=>629, -101=>572,102=>387,103=>629,104=>654,105=>342,106=>325,107=>624,108=>342,109=>952,110=>654, -111=>600,112=>629,113=>629,114=>474,115=>506,116=>416,117=>654,118=>523,119=>774,120=>536, -121=>523,122=>511,123=>579,124=>327,125=>579,126=>754,8364=>626,8218=>313,402=>387,8222=>518, -8230=>900,8224=>470,8225=>470,710=>450,8240=>1246,352=>650,8249=>360,338=>1062,381=>657,8216=>313, -8217=>313,8220=>518,8221=>518,8226=>575,8211=>450,8212=>900,732=>450,8482=>900,353=>506,8250=>360, -339=>925,382=>511,376=>642,160=>313,161=>395,162=>626,163=>626,164=>572,165=>626,166=>327, -167=>470,168=>450,169=>900,170=>438,171=>563,172=>754,173=>374,174=>900,175=>450,176=>450, -177=>754,178=>394,179=>394,180=>450,181=>659,182=>572,183=>313,184=>450,185=>394,186=>450, -187=>563,188=>938,189=>938,190=>938,191=>527,192=>698,193=>698,194=>698,195=>698,196=>698, -197=>698,198=>931,199=>716,200=>686,201=>686,202=>686,203=>686,204=>421,205=>421,206=>421, -207=>421,208=>787,209=>822,210=>784,211=>784,212=>784,213=>784,214=>784,215=>754,216=>784, -217=>785,218=>785,219=>785,220=>785,221=>642,222=>681,223=>684,224=>583,225=>583,226=>583, -227=>583,228=>583,229=>583,230=>838,231=>548,232=>572,233=>572,234=>572,235=>572,236=>342, -237=>342,238=>342,239=>342,240=>600,241=>654,242=>600,243=>600,244=>600,245=>600,246=>600, -247=>754,248=>600,249=>654,250=>654,251=>654,252=>654,253=>523,254=>629,255=>523,256=>698, -257=>583,258=>698,259=>583,260=>698,261=>583,262=>716,263=>548,264=>716,265=>548,266=>716, -267=>548,268=>716,269=>548,270=>780,271=>629,272=>787,273=>629,274=>686,275=>572,276=>686, -277=>572,278=>686,279=>572,280=>686,281=>572,282=>686,283=>572,284=>769,285=>629,286=>769, -287=>629,288=>769,289=>629,290=>769,291=>629,292=>850,293=>654,294=>850,295=>654,296=>421, -297=>342,298=>421,299=>342,300=>421,301=>342,302=>421,303=>342,304=>421,305=>342,306=>848, -307=>676,308=>426,309=>325,310=>782,311=>624,312=>624,313=>633,314=>342,315=>633,316=>342, -317=>633,318=>457,319=>633,320=>501,321=>639,322=>346,323=>822,324=>654,325=>822,326=>654, -327=>822,328=>654,329=>907,330=>785,331=>654,332=>784,333=>600,334=>784,335=>600,336=>784, -337=>600,340=>748,341=>474,342=>748,343=>474,344=>748,345=>474,346=>650,347=>506,348=>650, -349=>506,350=>650,351=>506,354=>669,355=>416,356=>669,357=>416,358=>669,359=>416,360=>785, -361=>654,362=>785,363=>654,364=>785,365=>654,366=>785,367=>654,368=>785,369=>654,370=>785, -371=>654,372=>1011,373=>774,374=>642,375=>523,377=>657,378=>511,379=>657,380=>511,383=>387, -384=>629,385=>760,386=>769,387=>629,388=>769,389=>629,390=>716,391=>716,392=>548,393=>787, -394=>780,395=>769,396=>629,397=>600,398=>686,399=>784,400=>649,401=>639,403=>769,404=>693, -405=>938,406=>421,407=>421,408=>782,409=>624,410=>342,411=>631,412=>952,413=>822,414=>654, -415=>784,416=>784,417=>600,418=>1080,419=>849,420=>677,421=>629,422=>748,423=>650,424=>506, -425=>636,426=>298,427=>416,428=>669,429=>416,430=>669,431=>785,432=>654,433=>801,434=>801, -435=>642,436=>628,437=>657,438=>511,439=>591,440=>591,441=>591,443=>626,444=>678,445=>511, -446=>482,448=>265,449=>443,450=>413,451=>265,452=>1437,453=>1292,454=>1140,455=>1059,456=>958, -457=>667,458=>1248,459=>1148,460=>980,461=>698,462=>583,463=>421,464=>342,465=>784,466=>600, -467=>785,468=>654,469=>785,470=>654,471=>785,472=>654,473=>785,474=>654,475=>785,476=>654, -477=>572,478=>698,479=>583,480=>698,481=>583,482=>931,483=>877,484=>806,485=>629,486=>769, -487=>629,488=>782,489=>624,490=>784,491=>600,492=>784,493=>600,494=>591,495=>511,496=>325, -497=>1437,498=>1292,499=>1140,500=>769,501=>629,502=>1099,504=>822,505=>654,506=>698,507=>583, -508=>931,509=>838,510=>784,511=>600,512=>698,513=>583,514=>698,515=>583,516=>686,517=>572, -518=>686,519=>572,520=>421,521=>342,522=>421,523=>342,524=>784,525=>600,526=>784,527=>600, -528=>748,529=>474,530=>748,531=>474,532=>785,533=>654,534=>785,535=>654,536=>650,537=>506, -538=>669,539=>416,540=>621,541=>546,542=>850,543=>654,544=>785,545=>711,548=>657,549=>511, -550=>698,551=>583,552=>686,553=>572,554=>784,555=>600,556=>784,557=>600,558=>784,559=>600, -560=>784,561=>600,562=>642,563=>523,564=>516,565=>830,566=>508,567=>325,568=>928,569=>928, -570=>698,571=>716,572=>548,573=>633,574=>669,575=>506,576=>511,577=>594,578=>492,581=>698, -592=>583,593=>629,594=>629,595=>629,596=>548,597=>548,598=>629,599=>657,600=>572,601=>572, -602=>816,603=>547,604=>505,605=>816,606=>647,607=>348,608=>629,609=>629,610=>563,611=>641, -612=>564,613=>654,614=>654,615=>654,616=>342,617=>342,618=>342,619=>368,620=>462,621=>342, -622=>716,623=>952,624=>952,625=>952,626=>654,627=>654,628=>641,629=>600,630=>955,631=>674, -632=>600,633=>514,634=>514,635=>514,636=>474,637=>474,638=>406,639=>438,640=>721,641=>721, -642=>506,643=>298,644=>387,645=>486,646=>298,647=>443,648=>416,649=>654,650=>611,651=>624, -652=>523,653=>774,654=>571,655=>654,656=>511,657=>511,658=>511,659=>511,660=>482,661=>482, -662=>482,663=>490,664=>784,665=>625,666=>647,667=>563,668=>659,669=>345,670=>666,671=>581, -672=>629,673=>482,674=>482,675=>1005,676=>1061,677=>1005,678=>819,679=>643,680=>817,681=>935, -682=>711,683=>716,684=>596,685=>398,686=>552,687=>646,688=>469,689=>466,690=>282,691=>372, -692=>372,693=>432,694=>474,695=>488,696=>329,697=>271,699=>313,700=>313,701=>313,702=>330, -703=>330,704=>282,705=>282,711=>450,712=>254,713=>450,716=>254,720=>332,721=>332,722=>330, -723=>330,726=>353,728=>450,729=>450,730=>450,731=>450,733=>450,734=>375,736=>403,737=>263, -738=>355,739=>338,740=>282,741=>450,742=>450,743=>450,744=>450,745=>450,750=>498,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>701,881=>519,884=>271, -885=>271,890=>450,891=>548,892=>548,893=>548,894=>332,900=>450,901=>450,902=>698,903=>313, -904=>852,905=>1022,906=>595,908=>798,910=>857,911=>820,912=>435,913=>698,914=>760,915=>639, -916=>698,917=>686,918=>657,919=>850,920=>784,921=>421,922=>782,923=>698,924=>996,925=>822, -926=>633,927=>784,928=>850,929=>677,931=>636,932=>669,933=>642,934=>784,935=>698,936=>822, -937=>801,938=>421,939=>642,940=>692,941=>547,942=>654,943=>435,944=>624,945=>692,946=>598, -947=>594,948=>600,949=>547,950=>533,951=>654,952=>600,953=>435,954=>674,955=>631,956=>659, -957=>624,958=>533,959=>600,960=>659,961=>598,962=>548,963=>664,964=>605,965=>624,966=>814, -967=>592,968=>847,969=>857,970=>435,971=>624,972=>600,973=>624,974=>857,976=>600,977=>764, -978=>687,979=>872,980=>687,981=>847,982=>857,983=>589,984=>784,985=>600,986=>716,987=>548, -988=>639,989=>475,990=>531,991=>593,992=>716,993=>600,1008=>589,1009=>598,1010=>548,1011=>325, -1012=>784,1013=>548,1014=>548,1015=>681,1016=>629,1017=>716,1018=>996,1019=>774,1020=>623,1021=>716, -1022=>716,1023=>716,1024=>686,1025=>686,1026=>811,1027=>621,1028=>716,1029=>650,1030=>421,1031=>421, -1032=>426,1033=>1081,1034=>1135,1035=>866,1036=>818,1037=>850,1038=>730,1039=>850,1040=>733,1041=>769, -1042=>760,1043=>621,1044=>800,1045=>686,1046=>1181,1047=>649,1048=>850,1049=>850,1050=>818,1051=>795, -1052=>996,1053=>850,1054=>784,1055=>850,1056=>677,1057=>716,1058=>669,1059=>730,1060=>854,1061=>698, -1062=>870,1063=>822,1064=>1141,1065=>1164,1066=>861,1067=>1081,1068=>743,1069=>716,1070=>1158,1071=>793, -1072=>583,1073=>650,1074=>591,1075=>506,1076=>625,1077=>572,1078=>1175,1079=>574,1080=>654,1081=>654, -1082=>609,1083=>659,1084=>855,1085=>656,1086=>600,1087=>654,1088=>629,1089=>548,1090=>952,1091=>538, -1092=>812,1093=>536,1094=>723,1095=>643,1096=>952,1097=>1021,1098=>654,1099=>916,1100=>593,1101=>580, -1102=>901,1103=>716,1104=>572,1105=>572,1106=>646,1107=>506,1108=>548,1109=>506,1110=>342,1111=>342, -1112=>325,1113=>913,1114=>910,1115=>654,1116=>609,1117=>654,1118=>538,1119=>654,1122=>792,1123=>945, -1124=>1076,1125=>867,1130=>1181,1131=>909,1136=>986,1137=>995,1138=>784,1139=>587,1140=>824,1141=>673, -1164=>761,1165=>606,1168=>630,1169=>556,1170=>621,1171=>506,1172=>768,1173=>634,1174=>1181,1175=>1175, -1176=>649,1177=>574,1178=>812,1179=>633,1182=>818,1183=>609,1184=>937,1185=>684,1186=>856,1187=>725, -1188=>1050,1189=>859,1190=>1191,1191=>911,1194=>716,1195=>548,1196=>669,1197=>1028,1198=>642,1199=>515, -1200=>642,1201=>515,1202=>709,1203=>536,1204=>909,1205=>749,1206=>822,1207=>712,1210=>819,1211=>654, -1216=>421,1217=>1181,1218=>1175,1219=>782,1220=>624,1223=>850,1224=>659,1227=>885,1228=>659,1231=>342, -1232=>733,1233=>583,1234=>733,1235=>583,1236=>931,1237=>877,1238=>686,1239=>572,1240=>784,1241=>572, -1242=>784,1243=>572,1244=>1181,1245=>1175,1246=>649,1247=>574,1248=>591,1249=>511,1250=>850,1251=>654, -1252=>850,1253=>654,1254=>784,1255=>600,1256=>784,1257=>600,1258=>784,1259=>600,1260=>716,1261=>580, -1262=>730,1263=>538,1264=>730,1265=>538,1266=>730,1267=>538,1268=>822,1269=>643,1270=>621,1271=>506, -1272=>1081,1273=>916,1296=>649,1297=>574,1298=>795,1299=>659,1300=>1123,1301=>904,1306=>738,1307=>576, -1308=>925,1309=>770,4256=>688,4257=>851,4258=>788,4259=>795,4260=>712,4261=>979,4262=>921,4263=>1100, -4264=>587,4265=>745,4266=>955,4267=>954,4268=>725,4269=>1030,4270=>880,4271=>820,4272=>1007,4273=>721, -4274=>689,4275=>977,4276=>887,4277=>968,4278=>738,4279=>758,4280=>748,4281=>759,4282=>826,4283=>978, -4284=>701,4285=>748,4286=>740,4287=>1008,4288=>1019,4289=>730,4290=>812,4291=>730,4292=>801,4293=>965, -4304=>535,4305=>563,4306=>579,4307=>798,4308=>553,4309=>549,4310=>599,4311=>823,4312=>552,4313=>540, -4314=>1008,4315=>589,4316=>576,4317=>791,4318=>561,4319=>571,4320=>790,4321=>591,4322=>721,4323=>676, -4324=>782,4325=>575,4326=>820,4327=>559,4328=>583,4329=>576,4330=>656,4331=>577,4332=>575,4333=>566, -4334=>606,4335=>663,4336=>563,4337=>591,4338=>563,4339=>563,4340=>562,4341=>603,4342=>846,4343=>612, -4344=>572,4345=>605,4346=>562,4347=>401,4348=>327,7426=>846,7432=>458,7433=>288,7444=>890,7446=>600, -7447=>600,7453=>663,7454=>853,7455=>853,7468=>439,7469=>586,7470=>479,7472=>491,7473=>432,7474=>432, -7475=>483,7476=>536,7477=>265,7478=>268,7479=>492,7480=>398,7481=>627,7482=>518,7483=>518,7484=>493, -7486=>426,7487=>471,7488=>422,7489=>494,7490=>637,7491=>419,7492=>419,7493=>448,7494=>591,7495=>448, -7496=>448,7497=>400,7498=>400,7499=>370,7500=>370,7501=>448,7502=>270,7503=>471,7504=>655,7505=>426, -7506=>420,7507=>384,7508=>420,7509=>420,7510=>448,7511=>333,7512=>468,7513=>390,7514=>655,7515=>442, -7522=>215,7523=>372,7524=>468,7525=>442,7543=>576,7544=>536,7547=>342,7557=>342,7579=>448,7580=>384, -7581=>384,7582=>420,7583=>370,7584=>244,7585=>335,7586=>448,7587=>470,7588=>270,7589=>276,7590=>270, -7591=>270,7592=>333,7593=>331,7594=>289,7595=>387,7596=>613,7597=>655,7598=>529,7599=>528,7600=>425, -7601=>420,7602=>470,7603=>360,7604=>348,7605=>333,7606=>468,7607=>427,7609=>439,7610=>329,7611=>321, -7612=>474,7613=>371,7614=>407,7615=>420,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>698,7681=>583,7682=>760,7683=>629,7684=>760,7685=>629,7686=>760,7687=>629,7688=>716,7689=>548, -7690=>780,7691=>629,7692=>780,7693=>629,7694=>780,7695=>629,7696=>780,7697=>629,7698=>780,7699=>629, -7700=>686,7701=>572,7702=>686,7703=>572,7704=>686,7705=>572,7706=>686,7707=>572,7708=>686,7709=>572, -7710=>639,7711=>387,7712=>769,7713=>629,7714=>850,7715=>654,7716=>850,7717=>654,7718=>850,7719=>654, -7720=>850,7721=>654,7722=>850,7723=>654,7724=>421,7725=>342,7728=>782,7729=>624,7730=>782,7731=>624, -7732=>782,7733=>624,7734=>633,7735=>342,7736=>633,7737=>342,7738=>633,7739=>342,7740=>633,7741=>342, -7742=>996,7743=>952,7744=>996,7745=>952,7746=>996,7747=>952,7748=>822,7749=>654,7750=>822,7751=>654, -7752=>822,7753=>654,7754=>822,7755=>654,7756=>784,7757=>600,7760=>784,7761=>600,7762=>784,7763=>600, -7764=>677,7765=>629,7766=>677,7767=>629,7768=>748,7769=>474,7770=>748,7771=>474,7772=>748,7773=>474, -7774=>748,7775=>474,7776=>650,7777=>506,7778=>650,7779=>506,7784=>650,7785=>506,7786=>669,7787=>416, -7788=>669,7789=>416,7790=>669,7791=>416,7792=>669,7793=>416,7794=>785,7795=>654,7796=>785,7797=>654, -7798=>785,7799=>654,7800=>785,7801=>654,7802=>785,7803=>654,7804=>698,7805=>523,7806=>698,7807=>523, -7808=>1011,7809=>774,7810=>1011,7811=>774,7812=>1011,7813=>774,7814=>1011,7815=>774,7816=>1011,7817=>774, -7818=>698,7819=>536,7820=>698,7821=>536,7822=>642,7823=>523,7824=>657,7825=>511,7826=>657,7827=>511, -7828=>657,7829=>511,7830=>654,7831=>416,7832=>774,7833=>523,7834=>913,7835=>387,7838=>852,7839=>600, -7840=>698,7841=>583,7842=>698,7843=>583,7852=>698,7853=>583,7854=>698,7855=>583,7856=>698,7857=>583, -7858=>698,7859=>583,7860=>698,7861=>583,7862=>698,7863=>583,7864=>686,7865=>572,7866=>686,7867=>572, -7868=>686,7869=>572,7878=>686,7879=>572,7880=>421,7881=>342,7882=>421,7883=>342,7884=>784,7885=>600, -7886=>784,7887=>600,7896=>784,7897=>600,7908=>785,7909=>654,7910=>785,7911=>654,7922=>642,7923=>523, -7924=>642,7925=>523,7926=>642,7927=>523,7928=>642,7929=>523,7936=>692,7937=>692,7938=>692,7939=>692, -7940=>692,7941=>692,7942=>692,7943=>692,7944=>698,7945=>698,7946=>880,7947=>880,7948=>748,7949=>764, -7950=>698,7951=>698,7952=>547,7953=>547,7954=>547,7955=>547,7956=>547,7957=>547,7960=>826,7961=>817, -7962=>1052,7963=>1052,7964=>984,7965=>1007,7968=>654,7969=>654,7970=>654,7971=>654,7972=>654,7973=>654, -7974=>654,7975=>654,7976=>990,7977=>984,7978=>1222,7979=>1225,7980=>1151,7981=>1177,7982=>1077,7983=>1074, -7984=>435,7985=>435,7986=>435,7987=>435,7988=>435,7989=>435,7990=>435,7991=>435,7992=>566,7993=>555, -7994=>790,7995=>792,7996=>719,7997=>748,7998=>650,7999=>642,8000=>600,8001=>600,8002=>600,8003=>600, -8004=>600,8005=>600,8008=>810,8009=>841,8010=>1116,8011=>1113,8012=>931,8013=>959,8016=>624,8017=>624, -8018=>624,8019=>624,8020=>624,8021=>624,8022=>624,8023=>624,8025=>830,8027=>1067,8029=>1020,8031=>917, -8032=>857,8033=>857,8034=>857,8035=>857,8036=>857,8037=>857,8038=>857,8039=>857,8040=>838,8041=>867, -8042=>1141,8043=>1146,8044=>949,8045=>979,8046=>920,8047=>954,8048=>692,8049=>692,8050=>547,8051=>547, -8052=>654,8053=>654,8054=>435,8055=>435,8056=>600,8057=>600,8058=>624,8059=>624,8060=>857,8061=>857, -8064=>692,8065=>692,8066=>692,8067=>692,8068=>692,8069=>692,8070=>692,8071=>692,8072=>698,8073=>698, -8074=>880,8075=>880,8076=>748,8077=>764,8078=>698,8079=>698,8080=>654,8081=>654,8082=>654,8083=>654, -8084=>654,8085=>654,8086=>654,8087=>654,8088=>990,8089=>984,8090=>1222,8091=>1225,8092=>1151,8093=>1177, -8094=>1077,8095=>1074,8096=>857,8097=>857,8098=>857,8099=>857,8100=>857,8101=>857,8102=>857,8103=>857, -8104=>838,8105=>867,8106=>1141,8107=>1146,8108=>949,8109=>979,8110=>920,8111=>954,8112=>692,8113=>692, -8114=>692,8115=>692,8116=>692,8118=>692,8119=>692,8120=>698,8121=>698,8122=>729,8123=>698,8124=>698, -8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>654,8131=>654,8132=>654,8134=>654,8135=>654, -8136=>899,8137=>852,8138=>1072,8139=>1006,8140=>850,8141=>450,8142=>450,8143=>450,8144=>435,8145=>435, -8146=>435,8147=>435,8150=>435,8151=>435,8152=>421,8153=>421,8154=>642,8155=>595,8157=>450,8158=>450, -8159=>450,8160=>624,8161=>624,8162=>624,8163=>624,8164=>598,8165=>598,8166=>624,8167=>624,8168=>642, -8169=>642,8170=>917,8171=>857,8172=>819,8173=>450,8174=>450,8175=>450,8178=>857,8179=>857,8180=>857, -8182=>857,8183=>857,8184=>962,8185=>798,8186=>991,8187=>820,8188=>801,8189=>450,8190=>450,8192=>450, -8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>626,8200=>313,8201=>180,8202=>89, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>374,8209=>374,8210=>626,8213=>900,8214=>450, -8215=>450,8219=>313,8223=>518,8227=>575,8228=>313,8229=>606,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>180,8241=>1631,8242=>237,8243=>402,8244=>567,8245=>237,8246=>402,8247=>567,8248=>659, -8252=>566,8253=>527,8254=>450,8258=>920,8260=>150,8261=>426,8262=>426,8263=>974,8264=>770,8265=>770, -8267=>572,8268=>450,8269=>450,8270=>470,8271=>332,8273=>470,8274=>500,8275=>900,8279=>731,8287=>200, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>394,8305=>215,8308=>394,8309=>394,8310=>394,8311=>394,8312=>394,8313=>394,8314=>475, -8315=>475,8316=>475,8317=>268,8318=>268,8319=>412,8320=>394,8321=>394,8322=>394,8323=>394,8324=>394, -8325=>394,8326=>394,8327=>394,8328=>394,8329=>394,8330=>475,8331=>475,8332=>475,8333=>268,8334=>268, -8336=>419,8337=>400,8338=>420,8339=>338,8340=>400,8358=>626,8367=>1039,8369=>710,8372=>788,8373=>626, -8451=>1078,8457=>1001,8462=>654,8463=>654,8470=>978,8486=>801,8487=>801,8490=>782,8491=>698,8513=>707, -8514=>518,8515=>573,8516=>684,8523=>813,8531=>932,8532=>932,8533=>932,8534=>932,8535=>932,8536=>932, -8537=>932,8538=>932,8539=>932,8540=>932,8541=>932,8542=>932,8543=>554,8544=>421,8545=>663,8546=>904, -8547=>984,8548=>698,8549=>1014,8550=>1256,8551=>1498,8552=>962,8553=>698,8554=>970,8555=>1212,8556=>633, -8557=>716,8558=>780,8559=>996,8560=>342,8561=>684,8562=>1025,8563=>865,8564=>523,8565=>865,8566=>1207, -8567=>1548,8568=>878,8569=>536,8570=>878,8571=>1220,8572=>342,8573=>548,8574=>629,8575=>952,8576=>1129, -8577=>780,8578=>1141,8579=>716,8580=>548,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754, -8598=>754,8599=>754,8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754, -8608=>754,8609=>754,8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754, -8618=>754,8619=>754,8620=>754,8621=>754,8622=>754,8623=>765,8624=>754,8625=>754,8626=>754,8627=>754, -8628=>754,8629=>754,8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754, -8638=>754,8639=>754,8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754, -8648=>754,8649=>754,8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754, -8658=>754,8659=>754,8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754, -8668=>754,8669=>754,8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754, -8678=>754,8679=>754,8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754, -8688=>754,8689=>754,8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754, -8698=>754,8699=>754,8700=>754,8701=>754,8702=>754,8703=>754,8704=>577,8706=>480,8707=>558,8708=>558, -8710=>677,8711=>677,8712=>666,8713=>666,8715=>666,8716=>666,8719=>757,8720=>757,8721=>677,8722=>754, -8723=>754,8724=>754,8725=>329,8727=>622,8728=>466,8729=>466,8730=>591,8731=>591,8732=>591,8733=>604, -8734=>750,8735=>754,8736=>754,8739=>292,8740=>546,8741=>476,8742=>696,8743=>730,8744=>730,8745=>754, -8746=>754,8747=>521,8748=>900,8749=>1252,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754, -8770=>754,8771=>754,8776=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>974,8789=>974,8800=>754, -8801=>754,8804=>754,8805=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754, -8845=>754,8846=>754,8847=>754,8848=>754,8849=>754,8850=>754,8851=>754,8852=>754,8853=>754,8854=>754, -8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754, -8865=>754,8866=>795,8867=>795,8868=>864,8869=>864,8870=>554,8871=>554,8872=>795,8873=>795,8874=>795, -8875=>971,8876=>795,8877=>795,8878=>795,8879=>971,8901=>358,8962=>751,8968=>426,8969=>426,8970=>426, -8971=>426,8976=>754,8977=>484,8984=>835,8985=>754,8992=>521,8993=>521,8997=>900,9000=>1299,9085=>907, -9134=>521,9167=>850,9251=>751,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692,9606=>692, -9607=>692,9608=>692,9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692,9616=>692, -9617=>692,9618=>692,9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692,9626=>692, -9627=>692,9628=>692,9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850,9636=>850, -9637=>850,9638=>850,9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850,9646=>495, -9647=>495,9648=>692,9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692,9656=>452, -9657=>452,9658=>692,9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692,9666=>452, -9667=>452,9668=>692,9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785,9676=>785, -9677=>785,9678=>785,9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785,9686=>474, -9687=>474,9688=>712,9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348,9696=>785, -9697=>785,9698=>692,9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850,9706=>850, -9707=>850,9708=>692,9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850,9716=>785, -9717=>785,9718=>785,9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659,9726=>659, -9727=>692,9728=>807,9784=>807,9785=>807,9786=>807,9787=>807,9788=>807,9791=>552,9792=>658,9793=>658, -9794=>807,9795=>807,9796=>807,9797=>807,9798=>807,9799=>807,9824=>807,9825=>807,9826=>807,9827=>807, -9828=>807,9829=>807,9830=>807,9831=>807,9833=>424,9834=>574,9835=>807,9836=>807,9837=>424,9838=>321, -9839=>435,10145=>754,10181=>411,10182=>411,10208=>444,10216=>411,10217=>411,10224=>754,10225=>754,10226=>754, -10227=>754,10228=>930,10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290, -10237=>1290,10238=>1290,10239=>1290,10240=>703,10241=>703,10242=>703,10243=>703,10244=>703,10245=>703,10246=>703, -10247=>703,10248=>703,10249=>703,10250=>703,10251=>703,10252=>703,10253=>703,10254=>703,10255=>703,10256=>703, -10257=>703,10258=>703,10259=>703,10260=>703,10261=>703,10262=>703,10263=>703,10264=>703,10265=>703,10266=>703, -10267=>703,10268=>703,10269=>703,10270=>703,10271=>703,10272=>703,10273=>703,10274=>703,10275=>703,10276=>703, -10277=>703,10278=>703,10279=>703,10280=>703,10281=>703,10282=>703,10283=>703,10284=>703,10285=>703,10286=>703, -10287=>703,10288=>703,10289=>703,10290=>703,10291=>703,10292=>703,10293=>703,10294=>703,10295=>703,10296=>703, -10297=>703,10298=>703,10299=>703,10300=>703,10301=>703,10302=>703,10303=>703,10304=>703,10305=>703,10306=>703, -10307=>703,10308=>703,10309=>703,10310=>703,10311=>703,10312=>703,10313=>703,10314=>703,10315=>703,10316=>703, -10317=>703,10318=>703,10319=>703,10320=>703,10321=>703,10322=>703,10323=>703,10324=>703,10325=>703,10326=>703, -10327=>703,10328=>703,10329=>703,10330=>703,10331=>703,10332=>703,10333=>703,10334=>703,10335=>703,10336=>703, -10337=>703,10338=>703,10339=>703,10340=>703,10341=>703,10342=>703,10343=>703,10344=>703,10345=>703,10346=>703, -10347=>703,10348=>703,10349=>703,10350=>703,10351=>703,10352=>703,10353=>703,10354=>703,10355=>703,10356=>703, -10357=>703,10358=>703,10359=>703,10360=>703,10361=>703,10362=>703,10363=>703,10364=>703,10365=>703,10366=>703, -10367=>703,10368=>703,10369=>703,10370=>703,10371=>703,10372=>703,10373=>703,10374=>703,10375=>703,10376=>703, -10377=>703,10378=>703,10379=>703,10380=>703,10381=>703,10382=>703,10383=>703,10384=>703,10385=>703,10386=>703, -10387=>703,10388=>703,10389=>703,10390=>703,10391=>703,10392=>703,10393=>703,10394=>703,10395=>703,10396=>703, -10397=>703,10398=>703,10399=>703,10400=>703,10401=>703,10402=>703,10403=>703,10404=>703,10405=>703,10406=>703, -10407=>703,10408=>703,10409=>703,10410=>703,10411=>703,10412=>703,10413=>703,10414=>703,10415=>703,10416=>703, -10417=>703,10418=>703,10419=>703,10420=>703,10421=>703,10422=>703,10423=>703,10424=>703,10425=>703,10426=>703, -10427=>703,10428=>703,10429=>703,10430=>703,10431=>703,10432=>703,10433=>703,10434=>703,10435=>703,10436=>703, -10437=>703,10438=>703,10439=>703,10440=>703,10441=>703,10442=>703,10443=>703,10444=>703,10445=>703,10446=>703, -10447=>703,10448=>703,10449=>703,10450=>703,10451=>703,10452=>703,10453=>703,10454=>703,10455=>703,10456=>703, -10457=>703,10458=>703,10459=>703,10460=>703,10461=>703,10462=>703,10463=>703,10464=>703,10465=>703,10466=>703, -10467=>703,10468=>703,10469=>703,10470=>703,10471=>703,10472=>703,10473=>703,10474=>703,10475=>703,10476=>703, -10477=>703,10478=>703,10479=>703,10480=>703,10481=>703,10482=>703,10483=>703,10484=>703,10485=>703,10486=>703, -10487=>703,10488=>703,10489=>703,10490=>703,10491=>703,10492=>703,10493=>703,10494=>703,10495=>703,10496=>754, -10497=>754,10498=>754,10499=>754,10500=>754,10501=>754,10502=>754,10503=>754,10504=>754,10505=>754,10506=>754, -10507=>754,10508=>754,10509=>754,10510=>754,10511=>754,10512=>754,10513=>754,10514=>754,10515=>754,10516=>754, -10517=>754,10518=>754,10519=>754,10520=>754,10521=>754,10522=>754,10523=>754,10524=>754,10525=>754,10526=>754, -10527=>754,10528=>754,10529=>754,10530=>754,10531=>754,10532=>754,10533=>754,10534=>754,10535=>754,10536=>754, -10537=>754,10538=>754,10539=>754,10540=>754,10541=>754,10542=>754,10543=>754,10544=>754,10545=>754,10546=>754, -10547=>754,10548=>754,10549=>754,10550=>754,10551=>754,10552=>754,10553=>754,10554=>754,10555=>754,10556=>754, -10557=>754,10558=>754,10559=>754,10560=>754,10561=>754,10562=>754,10563=>754,10564=>754,10565=>754,10566=>754, -10567=>754,10568=>754,10569=>754,10570=>754,10571=>754,10572=>754,10573=>754,10574=>754,10575=>754,10576=>754, -10577=>754,10578=>754,10579=>754,10580=>754,10581=>754,10582=>754,10583=>754,10584=>754,10585=>754,10586=>754, -10587=>754,10588=>754,10589=>754,10590=>754,10591=>754,10592=>754,10593=>754,10594=>754,10595=>754,10596=>754, -10597=>754,10598=>754,10599=>754,10600=>754,10601=>754,10602=>754,10603=>754,10604=>754,10605=>754,10606=>754, -10607=>754,10608=>754,10609=>754,10610=>754,10611=>754,10612=>754,10613=>754,10614=>754,10615=>929,10616=>754, -10617=>754,10618=>864,10619=>754,10620=>754,10621=>754,10622=>754,10623=>754,10731=>444,10764=>1604,10765=>549, -10766=>549,10799=>754,11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754, -11016=>754,11017=>754,11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754, -11026=>850,11027=>850,11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11364=>748, -11367=>850,11368=>654,11369=>782,11370=>624,11371=>657,11372=>511,11374=>996,11375=>698,11381=>701,11382=>519, -11383=>814,11385=>514,11386=>600,11388=>282,11389=>439,11520=>695,11521=>571,11522=>723,11523=>592,11524=>708, -11525=>866,11526=>680,11527=>864,11528=>555,11529=>581,11530=>866,11531=>567,11532=>581,11533=>866,11534=>761, -11535=>779,11536=>865,11537=>580,11538=>580,11539=>863,11540=>851,11541=>777,11542=>580,11543=>581,11544=>580, -11545=>584,11546=>619,11547=>842,11548=>883,11549=>613,11550=>608,11551=>766,11552=>1002,11553=>569,11554=>580, -11555=>582,11556=>674,11557=>822,11800=>527,11810=>426,11811=>426,11812=>426,11813=>426,11822=>527,42564=>650, -42565=>506,42566=>421,42567=>342,42576=>1200,42577=>976,42580=>1158,42581=>923,42582=>1158,42583=>926,42760=>450, -42761=>450,42762=>450,42763=>450,42764=>450,42765=>450,42766=>450,42767=>450,42768=>450,42769=>450,42770=>450, -42771=>450,42772=>450,42773=>450,42774=>450,42779=>346,42780=>346,42781=>249,42782=>249,42783=>249,42891=>395, -42892=>275,62464=>653,62465=>663,62466=>707,62467=>917,62468=>663,62469=>658,62470=>716,62471=>952,62472=>663, -62473=>663,62474=>1196,62475=>679,62476=>678,62477=>922,62478=>663,62479=>678,62480=>963,62481=>736,62482=>783, -62483=>737,62484=>914,62485=>677,62486=>907,62487=>677,62488=>684,62489=>678,62490=>720,62491=>678,62492=>684, -62493=>664,62494=>721,62495=>860,62496=>663,62497=>762,62498=>664,62499=>663,62500=>663,62501=>714,62502=>930, -62504=>813,63172=>506,63173=>600,63174=>629,63175=>654,63176=>952,63185=>450,63188=>450,64256=>744,64257=>654, -64258=>654,64259=>998,64260=>1031,64261=>791,64262=>874,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0, -65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0, -65039=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1002); -$enc=''; -$diff=''; -$file='dejavuserifcondensedbi.z'; -$ctg='dejavuserifcondensedbi.ctg.z'; -$originalsize=293472; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.z deleted file mode 100644 index 9b6be85d67..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.ctg.z deleted file mode 100644 index aa732f80a8..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.php deleted file mode 100644 index 024d59d13a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.php +++ /dev/null @@ -1,312 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerifCondensed-Italic'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-59,'Flags'=>96,'FontBBox'=>'[-755 -347 1485 1227]','ItalicAngle'=>-11,'StemV'=>70,'MissingWidth'=>540); -$up=-63; -$ut=44; -$dw=540; -$cw=array( -0=>540,32=>286,33=>361,34=>414,35=>754,36=>572,37=>855,38=>801,39=>247,40=>351, -41=>351,42=>450,43=>754,44=>286,45=>304,46=>286,47=>303,48=>572,49=>572,50=>572, -51=>572,52=>572,53=>572,54=>572,55=>572,56=>572,57=>572,58=>303,59=>303,60=>754, -61=>754,62=>754,63=>482,64=>900,65=>650,66=>661,67=>688,68=>721,69=>657,70=>624, -71=>719,72=>785,73=>355,74=>360,75=>672,76=>598,77=>921,78=>787,79=>738,80=>605, -81=>738,82=>677,83=>616,84=>600,85=>758,86=>650,87=>925,88=>641,89=>594,90=>625, -91=>351,92=>303,93=>351,94=>754,95=>450,96=>450,97=>536,98=>576,99=>504,100=>576, -101=>532,102=>333,103=>576,104=>580,105=>288,106=>279,107=>545,108=>288,109=>853,110=>580, -111=>542,112=>576,113=>576,114=>430,115=>461,116=>361,117=>580,118=>508,119=>770,120=>507, -121=>508,122=>474,123=>572,124=>303,125=>572,126=>754,8364=>572,8218=>286,402=>333,8222=>466, -8230=>900,8224=>450,8225=>450,710=>450,8240=>1208,352=>616,8249=>360,338=>1023,381=>625,8216=>286, -8217=>286,8220=>460,8221=>460,8226=>531,8211=>450,8212=>900,732=>450,8482=>900,353=>461,8250=>360, -339=>890,382=>474,376=>594,160=>286,161=>361,162=>572,163=>572,164=>572,165=>572,166=>303, -167=>450,168=>450,169=>900,170=>427,171=>550,172=>754,173=>304,174=>900,175=>450,176=>450, -177=>754,178=>360,179=>360,180=>450,181=>584,182=>572,183=>286,184=>450,185=>360,186=>423, -187=>550,188=>872,189=>872,190=>872,191=>482,192=>650,193=>650,194=>650,195=>650,196=>650, -197=>650,198=>901,199=>688,200=>657,201=>657,202=>657,203=>657,204=>355,205=>355,206=>355, -207=>355,208=>726,209=>787,210=>738,211=>738,212=>738,213=>738,214=>738,215=>754,216=>738, -217=>758,218=>758,219=>758,220=>758,221=>594,222=>608,223=>601,224=>536,225=>536,226=>536, -227=>536,228=>536,229=>536,230=>846,231=>504,232=>532,233=>532,234=>532,235=>532,236=>288, -237=>288,238=>288,239=>288,240=>542,241=>580,242=>542,243=>542,244=>542,245=>542,246=>542, -247=>754,248=>542,249=>580,250=>580,251=>580,252=>580,253=>508,254=>576,255=>508,256=>650, -257=>536,258=>650,259=>536,260=>650,261=>536,262=>688,263=>504,264=>688,265=>504,266=>688, -267=>504,268=>688,269=>504,270=>721,271=>576,272=>726,273=>576,274=>657,275=>532,276=>657, -277=>532,278=>657,279=>532,280=>657,281=>532,282=>657,283=>532,284=>719,285=>576,286=>719, -287=>576,288=>719,289=>576,290=>719,291=>576,292=>785,293=>580,294=>785,295=>580,296=>355, -297=>288,298=>355,299=>288,300=>355,301=>288,302=>355,303=>288,304=>355,305=>288,306=>721, -307=>479,308=>360,309=>279,310=>672,311=>545,312=>545,313=>598,314=>288,315=>598,316=>288, -317=>598,318=>360,319=>604,320=>418,321=>602,322=>292,323=>787,324=>580,325=>787,326=>580, -327=>787,328=>580,329=>779,330=>758,331=>580,332=>738,333=>542,334=>738,335=>542,336=>738, -337=>542,340=>677,341=>430,342=>677,343=>430,344=>677,345=>430,346=>616,347=>461,348=>616, -349=>461,350=>616,351=>461,354=>600,355=>361,356=>600,357=>361,358=>600,359=>361,360=>758, -361=>580,362=>758,363=>580,364=>758,365=>580,366=>758,367=>580,368=>758,369=>580,370=>758, -371=>580,372=>925,373=>770,374=>594,375=>508,377=>625,378=>474,379=>625,380=>474,383=>333, -384=>576,385=>661,386=>661,387=>576,388=>661,389=>576,390=>688,391=>688,392=>504,393=>726, -394=>721,395=>661,396=>576,397=>542,398=>657,399=>738,400=>561,401=>624,403=>719,404=>641, -405=>839,406=>355,407=>355,408=>672,409=>545,410=>288,411=>570,412=>853,413=>787,414=>580, -415=>738,416=>738,417=>542,418=>936,419=>726,420=>605,421=>576,422=>677,423=>616,424=>461, -425=>636,426=>292,427=>361,428=>600,429=>361,430=>600,431=>758,432=>580,433=>746,434=>684, -435=>664,436=>670,437=>625,438=>474,439=>508,440=>508,441=>508,443=>572,444=>618,445=>508, -446=>482,448=>265,449=>443,450=>413,451=>265,452=>1347,453=>1195,454=>1050,455=>958,456=>876, -457=>567,458=>1148,459=>1066,460=>858,461=>650,462=>536,463=>355,464=>288,465=>738,466=>542, -467=>758,468=>580,469=>758,470=>580,471=>758,472=>580,473=>758,474=>580,475=>758,476=>580, -477=>532,478=>650,479=>536,480=>650,481=>536,482=>901,483=>846,484=>763,485=>576,486=>719, -487=>576,488=>672,489=>545,490=>738,491=>542,492=>738,493=>542,494=>508,495=>508,496=>288, -497=>1347,498=>1195,499=>1050,500=>719,501=>576,502=>1038,504=>787,505=>580,506=>650,507=>536, -508=>901,509=>846,510=>738,511=>542,512=>650,513=>536,514=>650,515=>536,516=>657,517=>532, -518=>657,519=>532,520=>355,521=>288,522=>355,523=>288,524=>738,525=>542,526=>738,527=>542, -528=>677,529=>430,530=>677,531=>430,532=>758,533=>580,534=>758,535=>580,536=>616,537=>461, -538=>600,539=>361,540=>564,541=>469,542=>785,543=>580,544=>758,545=>732,548=>625,549=>474, -550=>650,551=>536,552=>657,553=>532,554=>738,555=>542,556=>738,557=>542,558=>738,559=>542, -560=>738,561=>542,562=>594,563=>508,564=>450,565=>748,566=>444,567=>279,568=>864,569=>864, -570=>650,571=>688,572=>504,573=>598,574=>600,575=>461,576=>474,577=>525,578=>417,581=>650, -592=>536,593=>576,594=>607,595=>576,596=>504,597=>504,598=>582,599=>614,600=>532,601=>532, -602=>759,603=>483,604=>458,605=>695,606=>552,607=>283,608=>615,609=>576,610=>489,611=>641, -612=>507,613=>580,614=>580,615=>580,616=>288,617=>353,618=>288,619=>342,620=>409,621=>326, -622=>633,623=>853,624=>853,625=>853,626=>579,627=>624,628=>581,629=>542,630=>711,631=>583, -632=>542,633=>451,634=>451,635=>496,636=>430,637=>430,638=>407,639=>407,640=>534,641=>534, -642=>461,643=>244,644=>333,645=>438,646=>292,647=>361,648=>361,649=>580,650=>558,651=>547, -652=>508,653=>770,654=>508,655=>589,656=>537,657=>504,658=>508,659=>504,660=>482,661=>482, -662=>482,663=>461,664=>738,665=>506,666=>552,667=>588,668=>600,669=>329,670=>545,671=>581, -672=>615,673=>482,674=>482,675=>896,676=>930,677=>898,678=>728,679=>538,680=>704,681=>804, -682=>582,683=>608,684=>538,685=>398,686=>703,687=>690,688=>389,689=>387,690=>237,691=>312, -692=>312,693=>387,694=>352,695=>485,696=>320,697=>250,699=>286,700=>286,701=>286,702=>276, -703=>276,704=>252,705=>252,711=>450,712=>254,713=>450,716=>254,720=>303,721=>303,722=>276, -723=>276,726=>353,728=>450,729=>450,730=>450,731=>450,733=>450,734=>375,736=>403,737=>218, -738=>303,739=>319,740=>252,741=>444,742=>444,743=>444,744=>444,745=>444,750=>435,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>666,881=>478,884=>250, -885=>250,890=>450,891=>504,892=>504,893=>504,894=>303,900=>450,901=>450,902=>650,903=>286, -904=>810,905=>935,906=>505,908=>751,910=>808,911=>767,912=>353,913=>650,914=>661,915=>624, -916=>650,917=>657,918=>625,919=>785,920=>738,921=>355,922=>672,923=>650,924=>921,925=>787, -926=>633,927=>738,928=>785,929=>605,931=>636,932=>600,933=>594,934=>738,935=>641,936=>789, -937=>746,938=>355,939=>594,940=>607,941=>483,942=>539,943=>353,944=>547,945=>607,946=>520, -947=>538,948=>542,949=>483,950=>488,951=>539,952=>542,953=>353,954=>590,955=>570,956=>584, -957=>547,958=>496,959=>542,960=>591,961=>529,962=>504,963=>614,964=>498,965=>547,966=>630, -967=>545,968=>706,969=>734,970=>353,971=>547,972=>542,973=>547,974=>734,976=>524,977=>643, -978=>618,979=>787,980=>618,981=>613,982=>734,983=>561,984=>738,985=>542,986=>688,987=>504, -988=>624,989=>417,990=>531,991=>593,992=>704,993=>519,1008=>561,1009=>529,1010=>504,1011=>279, -1012=>738,1013=>504,1014=>504,1015=>608,1016=>576,1017=>688,1018=>921,1019=>637,1020=>529,1021=>688, -1022=>688,1023=>688,1024=>657,1025=>657,1026=>719,1027=>596,1028=>688,1029=>616,1030=>355,1031=>355, -1032=>360,1033=>976,1034=>1006,1035=>785,1036=>696,1037=>785,1038=>650,1039=>785,1040=>681,1041=>661, -1042=>661,1043=>596,1044=>731,1045=>657,1046=>1011,1047=>561,1048=>785,1049=>785,1050=>696,1051=>751, -1052=>921,1053=>785,1054=>738,1055=>785,1056=>605,1057=>688,1058=>600,1059=>650,1060=>747,1061=>641, -1062=>785,1063=>695,1064=>1027,1065=>1027,1066=>715,1067=>885,1068=>606,1069=>688,1070=>1074,1071=>727, -1072=>536,1073=>549,1074=>523,1075=>455,1076=>570,1077=>532,1078=>1023,1079=>491,1080=>580,1081=>580, -1082=>537,1083=>573,1084=>746,1085=>593,1086=>542,1087=>580,1088=>576,1089=>504,1090=>853,1091=>522, -1092=>704,1093=>507,1094=>628,1095=>560,1096=>853,1097=>901,1098=>600,1099=>733,1100=>490,1101=>504, -1102=>792,1103=>596,1104=>532,1105=>532,1106=>561,1107=>455,1108=>504,1109=>461,1110=>288,1111=>288, -1112=>279,1113=>773,1114=>790,1115=>580,1116=>537,1117=>580,1118=>522,1119=>580,1122=>686,1123=>794, -1124=>1016,1125=>750,1130=>1011,1131=>828,1136=>849,1137=>812,1138=>738,1139=>497,1140=>773,1141=>610, -1164=>636,1165=>490,1168=>604,1169=>476,1170=>596,1171=>455,1172=>657,1173=>552,1174=>1011,1175=>1023, -1176=>561,1177=>491,1178=>696,1179=>544,1182=>696,1183=>537,1184=>803,1185=>602,1186=>785,1187=>641, -1188=>1025,1189=>771,1190=>1085,1191=>848,1194=>688,1195=>504,1196=>600,1197=>911,1198=>594,1199=>514, -1200=>594,1201=>514,1202=>641,1203=>566,1204=>842,1205=>659,1206=>674,1207=>609,1210=>674,1211=>580, -1216=>355,1217=>1011,1218=>1023,1219=>672,1220=>545,1223=>785,1224=>600,1227=>674,1228=>600,1231=>288, -1232=>681,1233=>536,1234=>681,1235=>536,1236=>901,1237=>846,1238=>657,1239=>532,1240=>738,1241=>532, -1242=>738,1243=>532,1244=>1011,1245=>1023,1246=>561,1247=>491,1248=>508,1249=>508,1250=>785,1251=>580, -1252=>785,1253=>580,1254=>738,1255=>542,1256=>738,1257=>542,1258=>738,1259=>542,1260=>688,1261=>504, -1262=>650,1263=>522,1264=>650,1265=>522,1266=>650,1267=>522,1268=>695,1269=>560,1270=>596,1271=>455, -1272=>885,1273=>733,1296=>561,1297=>491,1298=>751,1299=>573,1300=>1079,1301=>845,1306=>738,1307=>576, -1308=>925,1309=>770,4256=>659,4257=>773,4258=>753,4259=>782,4260=>668,4261=>892,4262=>833,4263=>1000, -4264=>519,4265=>684,4266=>875,4267=>856,4268=>677,4269=>976,4270=>815,4271=>754,4272=>944,4273=>668, -4274=>611,4275=>922,4276=>852,4277=>926,4278=>667,4279=>668,4280=>668,4281=>668,4282=>800,4283=>852, -4284=>651,4285=>688,4286=>668,4287=>871,4288=>909,4289=>641,4290=>786,4291=>669,4292=>762,4293=>864, -4304=>495,4305=>523,4306=>539,4307=>759,4308=>514,4309=>510,4310=>558,4311=>783,4312=>512,4313=>500, -4314=>968,4315=>536,4316=>536,4317=>751,4318=>521,4319=>531,4320=>750,4321=>546,4322=>682,4323=>631, -4324=>742,4325=>535,4326=>781,4327=>520,4328=>543,4329=>536,4330=>616,4331=>537,4332=>501,4333=>527, -4334=>562,4335=>624,4336=>523,4337=>551,4338=>523,4339=>523,4340=>522,4341=>593,4342=>806,4343=>572, -4344=>532,4345=>565,4346=>522,4347=>410,4348=>335,7426=>846,7432=>458,7433=>288,7444=>890,7446=>542, -7447=>542,7453=>663,7454=>853,7455=>853,7468=>409,7469=>567,7470=>417,7472=>454,7473=>413,7474=>413, -7475=>453,7476=>494,7477=>224,7478=>227,7479=>423,7480=>376,7481=>580,7482=>496,7483=>496,7484=>464, -7486=>381,7487=>426,7488=>378,7489=>478,7490=>583,7491=>347,7492=>347,7493=>360,7494=>556,7495=>360, -7496=>360,7497=>348,7498=>348,7499=>385,7500=>306,7501=>360,7502=>157,7503=>328,7504=>552,7505=>359, -7506=>347,7507=>312,7508=>347,7509=>347,7510=>360,7511=>222,7512=>359,7513=>417,7514=>552,7515=>335, -7522=>181,7523=>312,7524=>359,7525=>335,7543=>576,7544=>494,7547=>334,7557=>288,7579=>439,7580=>317, -7581=>317,7582=>426,7583=>385,7584=>209,7585=>285,7586=>439,7587=>359,7588=>181,7589=>181,7590=>181, -7591=>181,7592=>286,7593=>237,7594=>236,7595=>409,7596=>552,7597=>552,7598=>445,7599=>443,7600=>438, -7601=>347,7602=>426,7603=>374,7604=>269,7605=>301,7606=>359,7607=>429,7609=>417,7610=>320,7611=>298, -7612=>376,7613=>376,7614=>406,7615=>426,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>650,7681=>536,7682=>661,7683=>576,7684=>661,7685=>576,7686=>661,7687=>576,7688=>688,7689=>504, -7690=>721,7691=>576,7692=>721,7693=>576,7694=>721,7695=>576,7696=>721,7697=>576,7698=>721,7699=>576, -7700=>657,7701=>532,7702=>657,7703=>532,7704=>657,7705=>532,7706=>657,7707=>532,7708=>657,7709=>532, -7710=>624,7711=>333,7712=>719,7713=>576,7714=>785,7715=>580,7716=>785,7717=>580,7718=>785,7719=>580, -7720=>785,7721=>580,7722=>785,7723=>580,7724=>355,7725=>288,7728=>672,7729=>545,7730=>672,7731=>545, -7732=>672,7733=>545,7734=>598,7735=>288,7736=>598,7737=>288,7738=>598,7739=>288,7740=>598,7741=>288, -7742=>921,7743=>853,7744=>921,7745=>853,7746=>921,7747=>857,7748=>787,7749=>580,7750=>787,7751=>580, -7752=>787,7753=>580,7754=>787,7755=>580,7756=>738,7757=>542,7760=>738,7761=>542,7762=>738,7763=>542, -7764=>605,7765=>576,7766=>605,7767=>576,7768=>677,7769=>430,7770=>677,7771=>430,7772=>677,7773=>430, -7774=>677,7775=>430,7776=>616,7777=>461,7778=>616,7779=>461,7784=>616,7785=>461,7786=>600,7787=>361, -7788=>600,7789=>361,7790=>600,7791=>361,7792=>600,7793=>361,7794=>758,7795=>580,7796=>758,7797=>580, -7798=>758,7799=>580,7800=>758,7801=>580,7802=>758,7803=>580,7804=>650,7805=>508,7806=>650,7807=>508, -7808=>925,7809=>770,7810=>925,7811=>770,7812=>925,7813=>770,7814=>925,7815=>770,7816=>925,7817=>770, -7818=>641,7819=>507,7820=>641,7821=>507,7822=>594,7823=>508,7824=>625,7825=>474,7826=>625,7827=>474, -7828=>625,7829=>474,7830=>580,7831=>361,7832=>770,7833=>508,7834=>813,7835=>333,7838=>746,7839=>542, -7840=>650,7841=>536,7842=>650,7843=>536,7852=>650,7853=>536,7854=>650,7855=>536,7856=>650,7857=>536, -7858=>650,7859=>536,7860=>650,7861=>536,7862=>650,7863=>536,7864=>657,7865=>532,7866=>657,7867=>532, -7868=>657,7869=>532,7878=>657,7879=>532,7880=>355,7881=>288,7882=>355,7883=>288,7884=>738,7885=>542, -7886=>738,7887=>542,7896=>738,7897=>542,7908=>758,7909=>580,7910=>758,7911=>580,7922=>594,7923=>508, -7924=>594,7925=>508,7926=>594,7927=>508,7928=>594,7929=>508,7936=>607,7937=>607,7938=>607,7939=>607, -7940=>607,7941=>607,7942=>607,7943=>607,7944=>650,7945=>650,7946=>782,7947=>782,7948=>660,7949=>687, -7950=>650,7951=>650,7952=>483,7953=>483,7954=>483,7955=>483,7956=>483,7957=>483,7960=>768,7961=>757, -7962=>960,7963=>969,7964=>907,7965=>931,7968=>539,7969=>539,7970=>539,7971=>539,7972=>539,7973=>539, -7974=>539,7975=>539,7976=>898,7977=>893,7978=>1090,7979=>1101,7980=>1043,7981=>1064,7982=>988,7983=>985, -7984=>353,7985=>353,7986=>353,7987=>353,7988=>353,7989=>353,7990=>353,7991=>353,7992=>469,7993=>461, -7994=>661,7995=>664,7996=>611,7997=>635,7998=>561,7999=>553,8000=>542,8001=>542,8002=>542,8003=>542, -8004=>542,8005=>542,8008=>738,8009=>773,8010=>1008,8011=>1015,8012=>843,8013=>867,8016=>547,8017=>547, -8018=>547,8019=>547,8020=>547,8021=>547,8022=>547,8023=>547,8025=>765,8027=>971,8029=>939,8031=>857, -8032=>734,8033=>734,8034=>734,8035=>734,8036=>734,8037=>734,8038=>734,8039=>734,8040=>746,8041=>783, -8042=>1018,8043=>1023,8044=>852,8045=>878,8046=>844,8047=>873,8048=>607,8049=>607,8050=>483,8051=>483, -8052=>539,8053=>539,8054=>353,8055=>353,8056=>542,8057=>542,8058=>547,8059=>547,8060=>734,8061=>734, -8064=>607,8065=>607,8066=>607,8067=>607,8068=>607,8069=>607,8070=>607,8071=>607,8072=>650,8073=>650, -8074=>782,8075=>782,8076=>660,8077=>687,8078=>650,8079=>650,8080=>539,8081=>539,8082=>539,8083=>539, -8084=>539,8085=>539,8086=>539,8087=>539,8088=>898,8089=>893,8090=>1090,8091=>1101,8092=>1043,8093=>1064, -8094=>988,8095=>985,8096=>734,8097=>734,8098=>734,8099=>734,8100=>734,8101=>734,8102=>734,8103=>734, -8104=>746,8105=>783,8106=>1018,8107=>1023,8108=>852,8109=>878,8110=>844,8111=>873,8112=>607,8113=>607, -8114=>607,8115=>607,8116=>607,8118=>607,8119=>607,8120=>650,8121=>650,8122=>650,8123=>650,8124=>650, -8125=>450,8126=>450,8127=>450,8128=>450,8129=>450,8130=>539,8131=>539,8132=>539,8134=>539,8135=>539, -8136=>820,8137=>810,8138=>956,8139=>935,8140=>785,8141=>450,8142=>450,8143=>450,8144=>353,8145=>353, -8146=>353,8147=>353,8150=>353,8151=>353,8152=>355,8153=>355,8154=>529,8155=>505,8157=>450,8158=>450, -8159=>450,8160=>547,8161=>547,8162=>547,8163=>547,8164=>529,8165=>529,8166=>547,8167=>547,8168=>594, -8169=>594,8170=>829,8171=>808,8172=>711,8173=>450,8174=>450,8175=>450,8178=>734,8179=>734,8180=>734, -8182=>734,8183=>734,8184=>865,8185=>751,8186=>886,8187=>767,8188=>746,8189=>450,8190=>450,8192=>450, -8193=>900,8194=>450,8195=>900,8196=>296,8197=>225,8198=>150,8199=>572,8200=>286,8201=>180,8202=>89, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>304,8209=>304,8210=>572,8213=>900,8214=>450, -8215=>450,8219=>286,8223=>460,8227=>531,8228=>301,8229=>600,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>180,8241=>1560,8242=>204,8243=>336,8244=>468,8245=>204,8246=>336,8247=>468,8248=>305, -8252=>475,8253=>482,8254=>450,8258=>900,8260=>150,8261=>351,8262=>351,8263=>878,8264=>678,8265=>678, -8267=>572,8268=>450,8269=>450,8270=>450,8271=>303,8273=>450,8274=>404,8275=>900,8279=>597,8287=>200, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>360,8305=>181,8308=>360,8309=>360,8310=>360,8311=>360,8312=>360,8313=>360,8314=>475, -8315=>475,8316=>475,8317=>221,8318=>221,8319=>365,8320=>360,8321=>360,8322=>360,8323=>360,8324=>360, -8325=>360,8326=>360,8327=>360,8328=>360,8329=>360,8330=>475,8331=>475,8332=>475,8333=>221,8334=>221, -8336=>347,8337=>348,8338=>347,8339=>319,8340=>348,8358=>594,8367=>951,8369=>635,8372=>702,8373=>572, -8451=>1006,8457=>942,8462=>580,8463=>580,8470=>852,8486=>746,8487=>746,8490=>672,8491=>650,8513=>697, -8514=>501,8515=>501,8516=>549,8523=>801,8531=>872,8532=>872,8533=>872,8534=>872,8535=>872,8536=>872, -8537=>872,8538=>872,8539=>872,8540=>872,8541=>872,8542=>872,8543=>511,8544=>355,8545=>531,8546=>707, -8547=>870,8548=>650,8549=>883,8550=>1059,8551=>1234,8552=>838,8553=>641,8554=>839,8555=>1015,8556=>598, -8557=>688,8558=>721,8559=>921,8560=>288,8561=>576,8562=>863,8563=>796,8564=>508,8565=>796,8566=>1084, -8567=>1372,8568=>795,8569=>507,8570=>795,8571=>1083,8572=>288,8573=>504,8574=>576,8575=>853,8576=>1085, -8577=>721,8578=>1085,8579=>688,8580=>504,8592=>754,8593=>754,8594=>754,8595=>754,8596=>754,8597=>754, -8598=>754,8599=>754,8600=>754,8601=>754,8602=>754,8603=>754,8604=>754,8605=>754,8606=>754,8607=>754, -8608=>754,8609=>754,8610=>754,8611=>754,8612=>754,8613=>754,8614=>754,8615=>754,8616=>754,8617=>754, -8618=>754,8619=>754,8620=>754,8621=>754,8622=>754,8623=>754,8624=>754,8625=>754,8626=>754,8627=>754, -8628=>754,8629=>754,8630=>754,8631=>754,8632=>754,8633=>754,8634=>754,8635=>754,8636=>754,8637=>754, -8638=>754,8639=>754,8640=>754,8641=>754,8642=>754,8643=>754,8644=>754,8645=>754,8646=>754,8647=>754, -8648=>754,8649=>754,8650=>754,8651=>754,8652=>754,8653=>754,8654=>754,8655=>754,8656=>754,8657=>754, -8658=>754,8659=>754,8660=>754,8661=>754,8662=>754,8663=>754,8664=>754,8665=>754,8666=>754,8667=>754, -8668=>754,8669=>754,8670=>754,8671=>754,8672=>754,8673=>754,8674=>754,8675=>754,8676=>754,8677=>754, -8678=>754,8679=>754,8680=>754,8681=>754,8682=>754,8683=>754,8684=>754,8685=>754,8686=>754,8687=>754, -8688=>754,8689=>754,8690=>754,8691=>754,8692=>754,8693=>754,8694=>754,8695=>754,8696=>754,8697=>754, -8698=>754,8699=>754,8700=>754,8701=>754,8702=>754,8703=>754,8704=>543,8706=>465,8707=>488,8708=>488, -8710=>628,8711=>628,8712=>666,8713=>666,8715=>666,8716=>666,8719=>716,8720=>716,8721=>642,8722=>754, -8723=>754,8724=>754,8725=>303,8727=>611,8728=>441,8729=>441,8730=>573,8731=>573,8732=>573,8733=>609, -8734=>750,8735=>754,8736=>754,8739=>262,8740=>431,8741=>416,8742=>570,8743=>659,8744=>659,8745=>754, -8746=>754,8747=>469,8748=>766,8749=>1063,8760=>754,8761=>754,8762=>754,8763=>754,8764=>754,8765=>754, -8770=>754,8771=>754,8776=>754,8784=>754,8785=>754,8786=>754,8787=>754,8788=>930,8789=>930,8800=>754, -8801=>754,8804=>754,8805=>754,8834=>754,8835=>754,8836=>754,8837=>754,8838=>754,8839=>754,8844=>754, -8845=>754,8846=>754,8847=>761,8848=>761,8849=>761,8850=>761,8851=>754,8852=>754,8853=>754,8854=>754, -8855=>754,8856=>754,8857=>754,8858=>754,8859=>754,8860=>754,8861=>754,8862=>754,8863=>754,8864=>754, -8865=>754,8866=>773,8867=>773,8868=>846,8869=>846,8870=>510,8871=>510,8872=>773,8873=>773,8874=>773, -8875=>927,8876=>773,8877=>773,8878=>773,8879=>927,8901=>308,8962=>687,8968=>351,8969=>351,8970=>351, -8971=>351,8976=>754,8977=>461,8984=>900,8985=>754,8992=>469,8993=>469,8997=>900,9000=>1299,9085=>827, -9134=>469,9167=>850,9251=>687,9472=>542,9473=>542,9474=>542,9475=>542,9476=>542,9477=>542,9478=>542, -9479=>542,9480=>542,9481=>542,9482=>542,9483=>542,9484=>542,9485=>542,9486=>542,9487=>542,9488=>542, -9489=>542,9490=>542,9491=>542,9492=>542,9493=>542,9494=>542,9495=>542,9496=>542,9497=>542,9498=>542, -9499=>542,9500=>542,9501=>542,9502=>542,9503=>542,9504=>542,9505=>542,9506=>542,9507=>542,9508=>542, -9509=>542,9510=>542,9511=>542,9512=>542,9513=>542,9514=>542,9515=>542,9516=>542,9517=>542,9518=>542, -9519=>542,9520=>542,9521=>542,9522=>542,9523=>542,9524=>542,9525=>542,9526=>542,9527=>542,9528=>542, -9529=>542,9530=>542,9531=>542,9532=>542,9533=>542,9534=>542,9535=>542,9536=>542,9537=>542,9538=>542, -9539=>542,9540=>542,9541=>542,9542=>542,9543=>542,9544=>542,9545=>542,9546=>542,9547=>542,9548=>542, -9549=>542,9550=>542,9551=>542,9552=>542,9553=>542,9554=>542,9555=>542,9556=>542,9557=>542,9558=>542, -9559=>542,9560=>542,9561=>542,9562=>542,9563=>542,9564=>542,9565=>542,9566=>542,9567=>542,9568=>542, -9569=>542,9570=>542,9571=>542,9572=>542,9573=>542,9574=>542,9575=>542,9576=>542,9577=>542,9578=>542, -9579=>542,9580=>542,9581=>542,9582=>542,9583=>542,9584=>542,9585=>542,9586=>542,9587=>542,9588=>542, -9589=>542,9590=>542,9591=>542,9592=>542,9593=>542,9594=>542,9595=>542,9596=>542,9597=>542,9598=>542, -9599=>542,9600=>692,9601=>692,9602=>692,9603=>692,9604=>692,9605=>692,9606=>692,9607=>692,9608=>692, -9609=>692,9610=>692,9611=>692,9612=>692,9613=>692,9614=>692,9615=>692,9616=>692,9617=>692,9618=>692, -9619=>692,9620=>692,9621=>692,9622=>692,9623=>692,9624=>692,9625=>692,9626=>692,9627=>692,9628=>692, -9629=>692,9630=>692,9631=>692,9632=>850,9633=>850,9634=>850,9635=>850,9636=>850,9637=>850,9638=>850, -9639=>850,9640=>850,9641=>850,9642=>610,9643=>610,9644=>850,9645=>850,9646=>495,9647=>495,9648=>692, -9649=>692,9650=>692,9651=>692,9652=>452,9653=>452,9654=>692,9655=>692,9656=>452,9657=>452,9658=>692, -9659=>692,9660=>692,9661=>692,9662=>452,9663=>452,9664=>692,9665=>692,9666=>452,9667=>452,9668=>692, -9669=>692,9670=>692,9671=>692,9672=>692,9673=>785,9674=>444,9675=>785,9676=>785,9677=>785,9678=>785, -9679=>785,9680=>785,9681=>785,9682=>785,9683=>785,9684=>785,9685=>785,9686=>474,9687=>474,9688=>712, -9689=>873,9690=>873,9691=>873,9692=>348,9693=>348,9694=>348,9695=>348,9696=>785,9697=>785,9698=>692, -9699=>692,9700=>692,9701=>692,9702=>531,9703=>850,9704=>850,9705=>850,9706=>850,9707=>850,9708=>692, -9709=>692,9710=>692,9711=>1007,9712=>850,9713=>850,9714=>850,9715=>850,9716=>785,9717=>785,9718=>785, -9719=>785,9720=>692,9721=>692,9722=>692,9723=>747,9724=>747,9725=>659,9726=>659,9727=>692,9728=>807, -9784=>807,9785=>807,9786=>807,9787=>807,9788=>807,9791=>552,9792=>658,9793=>658,9794=>807,9795=>807, -9796=>807,9797=>807,9798=>807,9799=>807,9824=>807,9825=>807,9826=>807,9827=>807,9828=>807,9829=>807, -9830=>807,9831=>807,9833=>424,9834=>574,9835=>807,9836=>807,9837=>424,9838=>321,9839=>435,10145=>754, -10181=>351,10182=>351,10208=>444,10216=>351,10217=>351,10224=>754,10225=>754,10226=>754,10227=>754,10228=>930, -10229=>1290,10230=>1290,10231=>1290,10232=>1290,10233=>1290,10234=>1290,10235=>1290,10236=>1290,10237=>1290,10238=>1290, -10239=>1290,10240=>659,10241=>659,10242=>659,10243=>659,10244=>659,10245=>659,10246=>659,10247=>659,10248=>659, -10249=>659,10250=>659,10251=>659,10252=>659,10253=>659,10254=>659,10255=>659,10256=>659,10257=>659,10258=>659, -10259=>659,10260=>659,10261=>659,10262=>659,10263=>659,10264=>659,10265=>659,10266=>659,10267=>659,10268=>659, -10269=>659,10270=>659,10271=>659,10272=>659,10273=>659,10274=>659,10275=>659,10276=>659,10277=>659,10278=>659, -10279=>659,10280=>659,10281=>659,10282=>659,10283=>659,10284=>659,10285=>659,10286=>659,10287=>659,10288=>659, -10289=>659,10290=>659,10291=>659,10292=>659,10293=>659,10294=>659,10295=>659,10296=>659,10297=>659,10298=>659, -10299=>659,10300=>659,10301=>659,10302=>659,10303=>659,10304=>659,10305=>659,10306=>659,10307=>659,10308=>659, -10309=>659,10310=>659,10311=>659,10312=>659,10313=>659,10314=>659,10315=>659,10316=>659,10317=>659,10318=>659, -10319=>659,10320=>659,10321=>659,10322=>659,10323=>659,10324=>659,10325=>659,10326=>659,10327=>659,10328=>659, -10329=>659,10330=>659,10331=>659,10332=>659,10333=>659,10334=>659,10335=>659,10336=>659,10337=>659,10338=>659, -10339=>659,10340=>659,10341=>659,10342=>659,10343=>659,10344=>659,10345=>659,10346=>659,10347=>659,10348=>659, -10349=>659,10350=>659,10351=>659,10352=>659,10353=>659,10354=>659,10355=>659,10356=>659,10357=>659,10358=>659, -10359=>659,10360=>659,10361=>659,10362=>659,10363=>659,10364=>659,10365=>659,10366=>659,10367=>659,10368=>659, -10369=>659,10370=>659,10371=>659,10372=>659,10373=>659,10374=>659,10375=>659,10376=>659,10377=>659,10378=>659, -10379=>659,10380=>659,10381=>659,10382=>659,10383=>659,10384=>659,10385=>659,10386=>659,10387=>659,10388=>659, -10389=>659,10390=>659,10391=>659,10392=>659,10393=>659,10394=>659,10395=>659,10396=>659,10397=>659,10398=>659, -10399=>659,10400=>659,10401=>659,10402=>659,10403=>659,10404=>659,10405=>659,10406=>659,10407=>659,10408=>659, -10409=>659,10410=>659,10411=>659,10412=>659,10413=>659,10414=>659,10415=>659,10416=>659,10417=>659,10418=>659, -10419=>659,10420=>659,10421=>659,10422=>659,10423=>659,10424=>659,10425=>659,10426=>659,10427=>659,10428=>659, -10429=>659,10430=>659,10431=>659,10432=>659,10433=>659,10434=>659,10435=>659,10436=>659,10437=>659,10438=>659, -10439=>659,10440=>659,10441=>659,10442=>659,10443=>659,10444=>659,10445=>659,10446=>659,10447=>659,10448=>659, -10449=>659,10450=>659,10451=>659,10452=>659,10453=>659,10454=>659,10455=>659,10456=>659,10457=>659,10458=>659, -10459=>659,10460=>659,10461=>659,10462=>659,10463=>659,10464=>659,10465=>659,10466=>659,10467=>659,10468=>659, -10469=>659,10470=>659,10471=>659,10472=>659,10473=>659,10474=>659,10475=>659,10476=>659,10477=>659,10478=>659, -10479=>659,10480=>659,10481=>659,10482=>659,10483=>659,10484=>659,10485=>659,10486=>659,10487=>659,10488=>659, -10489=>659,10490=>659,10491=>659,10492=>659,10493=>659,10494=>659,10495=>659,10496=>754,10497=>754,10498=>754, -10499=>754,10500=>754,10501=>754,10502=>754,10503=>754,10504=>754,10505=>754,10506=>754,10507=>754,10508=>754, -10509=>754,10510=>754,10511=>754,10512=>754,10513=>754,10514=>754,10515=>754,10516=>754,10517=>754,10518=>754, -10519=>754,10520=>754,10521=>754,10522=>754,10523=>754,10524=>754,10525=>754,10526=>754,10527=>754,10528=>754, -10529=>754,10530=>754,10531=>754,10532=>754,10533=>754,10534=>754,10535=>754,10536=>754,10537=>754,10538=>754, -10539=>754,10540=>754,10541=>754,10542=>754,10543=>754,10544=>754,10545=>754,10546=>754,10547=>754,10548=>754, -10549=>754,10550=>754,10551=>754,10552=>754,10553=>754,10554=>754,10555=>754,10556=>754,10557=>754,10558=>754, -10559=>754,10560=>754,10561=>754,10562=>754,10563=>754,10564=>754,10565=>754,10566=>754,10567=>754,10568=>754, -10569=>754,10570=>754,10571=>754,10572=>754,10573=>754,10574=>754,10575=>754,10576=>754,10577=>754,10578=>754, -10579=>754,10580=>754,10581=>754,10582=>754,10583=>754,10584=>754,10585=>754,10586=>754,10587=>754,10588=>754, -10589=>754,10590=>754,10591=>754,10592=>754,10593=>754,10594=>754,10595=>754,10596=>754,10597=>754,10598=>754, -10599=>754,10600=>754,10601=>754,10602=>754,10603=>754,10604=>754,10605=>754,10606=>754,10607=>754,10608=>754, -10609=>754,10610=>754,10611=>754,10612=>754,10613=>754,10614=>754,10615=>883,10616=>754,10617=>754,10618=>886, -10619=>754,10620=>754,10621=>754,10622=>754,10623=>754,10731=>444,10764=>1361,10765=>469,10766=>469,10799=>754, -11008=>754,11009=>754,11010=>754,11011=>754,11012=>754,11013=>754,11014=>754,11015=>754,11016=>754,11017=>754, -11018=>754,11019=>754,11020=>754,11021=>754,11022=>754,11023=>754,11024=>754,11025=>754,11026=>850,11027=>850, -11028=>850,11029=>850,11030=>692,11031=>692,11032=>692,11033=>692,11034=>850,11364=>677,11367=>785,11368=>580, -11369=>672,11370=>545,11371=>625,11372=>474,11374=>921,11375=>650,11381=>666,11382=>478,11383=>630,11385=>451, -11386=>542,11388=>237,11389=>409,11520=>695,11521=>571,11522=>569,11523=>592,11524=>568,11525=>866,11526=>680, -11527=>864,11528=>555,11529=>581,11530=>866,11531=>568,11532=>581,11533=>866,11534=>580,11535=>779,11536=>865, -11537=>580,11538=>580,11539=>863,11540=>851,11541=>777,11542=>580,11543=>581,11544=>580,11545=>584,11546=>619, -11547=>571,11548=>883,11549=>613,11550=>608,11551=>766,11552=>861,11553=>569,11554=>580,11555=>582,11556=>674, -11557=>822,11800=>482,11810=>351,11811=>351,11812=>351,11813=>351,11822=>482,42564=>616,42565=>461,42566=>355, -42567=>353,42576=>994,42577=>845,42580=>1074,42581=>783,42582=>1025,42583=>787,42760=>444,42761=>444,42762=>444, -42763=>444,42764=>444,42765=>444,42766=>444,42767=>444,42768=>444,42769=>444,42770=>444,42771=>444,42772=>444, -42773=>444,42774=>444,42779=>332,42780=>332,42781=>228,42782=>228,42783=>228,42891=>361,42892=>247,62464=>598, -62465=>607,62466=>651,62467=>861,62468=>607,62469=>602,62470=>661,62471=>896,62472=>607,62473=>607,62474=>1141, -62475=>624,62476=>623,62477=>866,62478=>607,62479=>623,62480=>908,62481=>681,62482=>728,62483=>682,62484=>859, -62485=>622,62486=>852,62487=>621,62488=>628,62489=>623,62490=>665,62491=>623,62492=>628,62493=>608,62494=>665, -62495=>805,62496=>607,62497=>707,62498=>608,62499=>607,62500=>607,62501=>659,62502=>875,62504=>813,63172=>455, -63173=>542,63174=>576,63175=>580,63176=>853,63185=>450,63188=>450,64256=>637,64257=>600,64258=>600,64259=>847, -64260=>887,64261=>669,64262=>824,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0, -65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65529=>0, -65530=>0,65531=>0,65532=>0,65533=>923); -$enc=''; -$diff=''; -$file='dejavuserifcondensedi.z'; -$ctg='dejavuserifcondensedi.ctg.z'; -$originalsize=301244; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.z deleted file mode 100644 index eec24c6689..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifcondensedi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.ctg.z deleted file mode 100644 index aa732f80a8..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.php deleted file mode 100644 index c1d452c129..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.php +++ /dev/null @@ -1,312 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='DejaVuSerif-Italic'; -$desc=array('Ascent'=>928,'Descent'=>-236,'CapHeight'=>-65,'Flags'=>96,'FontBBox'=>'[-839 -347 1650 1227]','ItalicAngle'=>-11,'StemV'=>70,'MissingWidth'=>600); -$up=-63; -$ut=44; -$dw=600; -$cw=array( -0=>600,32=>318,33=>402,34=>460,35=>838,36=>636,37=>950,38=>890,39=>275,40=>390, -41=>390,42=>500,43=>838,44=>318,45=>338,46=>318,47=>337,48=>636,49=>636,50=>636, -51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838, -61=>838,62=>838,63=>536,64=>1000,65=>722,66=>735,67=>765,68=>802,69=>730,70=>694, -71=>799,72=>872,73=>395,74=>401,75=>747,76=>664,77=>1024,78=>875,79=>820,80=>673, -81=>820,82=>753,83=>685,84=>667,85=>843,86=>722,87=>1028,88=>712,89=>660,90=>695, -91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>596,98=>640,99=>560,100=>640, -101=>592,102=>370,103=>640,104=>644,105=>320,106=>310,107=>606,108=>320,109=>948,110=>644, -111=>602,112=>640,113=>640,114=>478,115=>513,116=>402,117=>644,118=>565,119=>856,120=>564, -121=>565,122=>527,123=>636,124=>337,125=>636,126=>838,8364=>636,8218=>318,402=>370,8222=>518, -8230=>1000,8224=>500,8225=>500,710=>500,8240=>1342,352=>685,8249=>400,338=>1137,381=>695,8216=>318, -8217=>318,8220=>511,8221=>511,8226=>590,8211=>500,8212=>1000,732=>500,8482=>1000,353=>513,8250=>400, -339=>989,382=>527,376=>660,160=>318,161=>402,162=>636,163=>636,164=>636,165=>636,166=>337, -167=>500,168=>500,169=>1000,170=>475,171=>612,172=>838,173=>338,174=>1000,175=>500,176=>500, -177=>838,178=>401,179=>401,180=>500,181=>650,182=>636,183=>318,184=>500,185=>401,186=>470, -187=>612,188=>969,189=>969,190=>969,191=>536,192=>722,193=>722,194=>722,195=>722,196=>722, -197=>722,198=>1001,199=>765,200=>730,201=>730,202=>730,203=>730,204=>395,205=>395,206=>395, -207=>395,208=>807,209=>875,210=>820,211=>820,212=>820,213=>820,214=>820,215=>838,216=>820, -217=>843,218=>843,219=>843,220=>843,221=>660,222=>676,223=>668,224=>596,225=>596,226=>596, -227=>596,228=>596,229=>596,230=>940,231=>560,232=>592,233=>592,234=>592,235=>592,236=>320, -237=>320,238=>320,239=>320,240=>602,241=>644,242=>602,243=>602,244=>602,245=>602,246=>602, -247=>838,248=>602,249=>644,250=>644,251=>644,252=>644,253=>565,254=>640,255=>565,256=>722, -257=>596,258=>722,259=>596,260=>722,261=>596,262=>765,263=>560,264=>765,265=>560,266=>765, -267=>560,268=>765,269=>560,270=>802,271=>640,272=>807,273=>640,274=>730,275=>592,276=>730, -277=>592,278=>730,279=>592,280=>730,281=>592,282=>730,283=>592,284=>799,285=>640,286=>799, -287=>640,288=>799,289=>640,290=>799,291=>640,292=>872,293=>644,294=>872,295=>644,296=>395, -297=>320,298=>395,299=>320,300=>395,301=>320,302=>395,303=>320,304=>395,305=>320,306=>801, -307=>533,308=>401,309=>310,310=>747,311=>606,312=>606,313=>664,314=>320,315=>664,316=>320, -317=>664,318=>400,319=>671,320=>465,321=>669,322=>324,323=>875,324=>644,325=>875,326=>644, -327=>875,328=>644,329=>866,330=>843,331=>644,332=>820,333=>602,334=>820,335=>602,336=>820, -337=>602,340=>753,341=>478,342=>753,343=>478,344=>753,345=>478,346=>685,347=>513,348=>685, -349=>513,350=>685,351=>513,354=>667,355=>402,356=>667,357=>402,358=>667,359=>402,360=>843, -361=>644,362=>843,363=>644,364=>843,365=>644,366=>843,367=>644,368=>843,369=>644,370=>843, -371=>644,372=>1028,373=>856,374=>660,375=>565,377=>695,378=>527,379=>695,380=>527,383=>370, -384=>640,385=>735,386=>735,387=>640,388=>735,389=>640,390=>765,391=>765,392=>560,393=>807, -394=>802,395=>735,396=>640,397=>602,398=>730,399=>820,400=>623,401=>694,403=>799,404=>712, -405=>932,406=>395,407=>395,408=>747,409=>606,410=>320,411=>634,412=>948,413=>875,414=>644, -415=>820,416=>820,417=>602,418=>1040,419=>807,420=>673,421=>640,422=>753,423=>685,424=>513, -425=>707,426=>324,427=>402,428=>667,429=>402,430=>667,431=>843,432=>644,433=>829,434=>760, -435=>738,436=>745,437=>695,438=>527,439=>564,440=>564,441=>564,443=>636,444=>687,445=>564, -446=>536,448=>295,449=>492,450=>459,451=>295,452=>1497,453=>1329,454=>1167,455=>1065,456=>974, -457=>630,458=>1276,459=>1185,460=>954,461=>722,462=>596,463=>395,464=>320,465=>820,466=>602, -467=>843,468=>644,469=>843,470=>644,471=>843,472=>644,473=>843,474=>644,475=>843,476=>644, -477=>592,478=>722,479=>596,480=>722,481=>596,482=>1001,483=>940,484=>848,485=>640,486=>799, -487=>640,488=>747,489=>606,490=>820,491=>602,492=>820,493=>602,494=>564,495=>564,496=>320, -497=>1497,498=>1329,499=>1167,500=>799,501=>640,502=>1154,504=>875,505=>644,506=>722,507=>596, -508=>1001,509=>940,510=>820,511=>602,512=>722,513=>596,514=>722,515=>596,516=>730,517=>592, -518=>730,519=>592,520=>395,521=>320,522=>395,523=>320,524=>820,525=>602,526=>820,527=>602, -528=>753,529=>478,530=>753,531=>478,532=>843,533=>644,534=>843,535=>644,536=>685,537=>513, -538=>667,539=>402,540=>627,541=>521,542=>872,543=>644,544=>843,545=>814,548=>695,549=>527, -550=>722,551=>596,552=>730,553=>592,554=>820,555=>602,556=>820,557=>602,558=>820,559=>602, -560=>820,561=>602,562=>660,563=>565,564=>500,565=>832,566=>494,567=>310,568=>960,569=>960, -570=>722,571=>765,572=>560,573=>664,574=>667,575=>513,576=>527,577=>583,578=>464,581=>722, -592=>596,593=>640,594=>675,595=>640,596=>560,597=>560,598=>647,599=>683,600=>592,601=>592, -602=>843,603=>537,604=>509,605=>773,606=>613,607=>315,608=>683,609=>640,610=>544,611=>712, -612=>564,613=>644,614=>644,615=>644,616=>320,617=>392,618=>320,619=>380,620=>454,621=>363, -622=>704,623=>948,624=>948,625=>948,626=>644,627=>694,628=>646,629=>602,630=>790,631=>647, -632=>602,633=>501,634=>501,635=>551,636=>478,637=>478,638=>453,639=>453,640=>594,641=>594, -642=>513,643=>271,644=>370,645=>487,646=>324,647=>402,648=>402,649=>644,650=>620,651=>608, -652=>565,653=>856,654=>565,655=>655,656=>597,657=>560,658=>564,659=>560,660=>536,661=>536, -662=>536,663=>513,664=>820,665=>563,666=>613,667=>654,668=>667,669=>366,670=>606,671=>646, -672=>683,673=>536,674=>536,675=>996,676=>1033,677=>998,678=>809,679=>598,680=>782,681=>894, -682=>646,683=>676,684=>598,685=>443,686=>781,687=>767,688=>433,689=>430,690=>264,691=>347, -692=>347,693=>430,694=>392,695=>539,696=>355,697=>278,699=>318,700=>318,701=>318,702=>307, -703=>307,704=>280,705=>281,711=>500,712=>282,713=>500,716=>282,720=>337,721=>337,722=>307, -723=>307,726=>392,728=>500,729=>500,730=>500,731=>500,733=>500,734=>417,736=>448,737=>243, -738=>337,739=>355,740=>281,741=>493,742=>493,743=>493,744=>493,745=>493,750=>484,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,835=>0,847=>0,856=>0,865=>0,880=>740,881=>531,884=>278, -885=>278,890=>500,891=>560,892=>560,893=>560,894=>337,900=>500,901=>500,902=>722,903=>318, -904=>900,905=>1039,906=>562,908=>835,910=>897,911=>853,912=>392,913=>722,914=>735,915=>694, -916=>722,917=>730,918=>695,919=>872,920=>820,921=>395,922=>747,923=>722,924=>1024,925=>875, -926=>704,927=>820,928=>872,929=>673,931=>707,932=>667,933=>660,934=>820,935=>712,936=>877, -937=>829,938=>395,939=>660,940=>675,941=>537,942=>599,943=>392,944=>608,945=>675,946=>578, -947=>598,948=>602,949=>537,950=>542,951=>599,952=>602,953=>392,954=>656,955=>634,956=>650, -957=>608,958=>551,959=>602,960=>657,961=>588,962=>560,963=>683,964=>553,965=>608,966=>700, -967=>606,968=>784,969=>815,970=>392,971=>608,972=>602,973=>608,974=>815,976=>583,977=>715, -978=>687,979=>874,980=>687,981=>682,982=>815,983=>624,984=>820,985=>602,986=>765,987=>560, -988=>694,989=>463,990=>590,991=>660,992=>782,993=>577,1008=>624,1009=>588,1010=>560,1011=>310, -1012=>820,1013=>560,1014=>560,1015=>676,1016=>640,1017=>765,1018=>1024,1019=>708,1020=>588,1021=>765, -1022=>765,1023=>765,1024=>730,1025=>730,1026=>799,1027=>662,1028=>765,1029=>685,1030=>395,1031=>395, -1032=>401,1033=>1084,1034=>1118,1035=>872,1036=>774,1037=>872,1038=>723,1039=>872,1040=>757,1041=>735, -1042=>735,1043=>662,1044=>813,1045=>730,1046=>1124,1047=>623,1048=>872,1049=>872,1050=>774,1051=>834, -1052=>1024,1053=>872,1054=>820,1055=>872,1056=>673,1057=>765,1058=>667,1059=>723,1060=>830,1061=>712, -1062=>872,1063=>773,1064=>1141,1065=>1141,1066=>794,1067=>984,1068=>674,1069=>765,1070=>1193,1071=>808, -1072=>596,1073=>610,1074=>582,1075=>505,1076=>634,1077=>592,1078=>1137,1079=>545,1080=>644,1081=>644, -1082=>597,1083=>637,1084=>829,1085=>659,1086=>602,1087=>644,1088=>640,1089=>560,1090=>948,1091=>580, -1092=>783,1093=>564,1094=>698,1095=>622,1096=>947,1097=>1001,1098=>667,1099=>814,1100=>544,1101=>560, -1102=>880,1103=>662,1104=>592,1105=>592,1106=>624,1107=>505,1108=>560,1109=>513,1110=>320,1111=>320, -1112=>310,1113=>859,1114=>878,1115=>644,1116=>597,1117=>644,1118=>580,1119=>644,1122=>762,1123=>882, -1124=>1129,1125=>834,1130=>1124,1131=>920,1136=>944,1137=>902,1138=>820,1139=>552,1140=>859,1141=>678, -1164=>707,1165=>544,1168=>672,1169=>529,1170=>662,1171=>505,1172=>730,1173=>614,1174=>1124,1175=>1137, -1176=>623,1177=>545,1178=>774,1179=>604,1182=>774,1183=>597,1184=>892,1185=>669,1186=>872,1187=>712, -1188=>1139,1189=>857,1190=>1206,1191=>943,1194=>765,1195=>560,1196=>667,1197=>1013,1198=>660,1199=>571, -1200=>660,1201=>571,1202=>712,1203=>629,1204=>936,1205=>732,1206=>749,1207=>677,1210=>749,1211=>644, -1216=>395,1217=>1124,1218=>1137,1219=>747,1220=>606,1223=>872,1224=>667,1227=>749,1228=>667,1231=>320, -1232=>757,1233=>596,1234=>757,1235=>596,1236=>1001,1237=>940,1238=>730,1239=>592,1240=>820,1241=>592, -1242=>820,1243=>592,1244=>1124,1245=>1137,1246=>623,1247=>545,1248=>564,1249=>564,1250=>872,1251=>644, -1252=>872,1253=>644,1254=>820,1255=>602,1256=>820,1257=>602,1258=>820,1259=>602,1260=>765,1261=>560, -1262=>723,1263=>580,1264=>723,1265=>580,1266=>723,1267=>580,1268=>773,1269=>622,1270=>662,1271=>505, -1272=>984,1273=>814,1296=>623,1297=>545,1298=>834,1299=>637,1300=>1199,1301=>939,1306=>820,1307=>640, -1308=>1028,1309=>856,4256=>732,4257=>860,4258=>837,4259=>869,4260=>743,4261=>991,4262=>925,4263=>1111, -4264=>576,4265=>760,4266=>972,4267=>951,4268=>753,4269=>1084,4270=>906,4271=>838,4272=>1049,4273=>743, -4274=>679,4275=>1025,4276=>946,4277=>1029,4278=>741,4279=>743,4280=>742,4281=>743,4282=>889,4283=>946, -4284=>724,4285=>765,4286=>743,4287=>968,4288=>1010,4289=>712,4290=>874,4291=>744,4292=>847,4293=>960, -4304=>550,4305=>581,4306=>599,4307=>843,4308=>571,4309=>567,4310=>620,4311=>871,4312=>569,4313=>556, -4314=>1076,4315=>596,4316=>596,4317=>835,4318=>580,4319=>590,4320=>833,4321=>607,4322=>758,4323=>701, -4324=>825,4325=>595,4326=>868,4327=>578,4328=>604,4329=>596,4330=>685,4331=>597,4332=>557,4333=>585, -4334=>625,4335=>693,4336=>582,4337=>613,4338=>581,4339=>582,4340=>580,4341=>659,4342=>896,4343=>636, -4344=>592,4345=>628,4346=>581,4347=>456,4348=>373,7426=>940,7432=>509,7433=>320,7444=>989,7446=>602, -7447=>602,7453=>737,7454=>948,7455=>948,7468=>455,7469=>630,7470=>463,7472=>505,7473=>459,7474=>459, -7475=>503,7476=>549,7477=>249,7478=>252,7479=>470,7480=>418,7481=>645,7482=>551,7483=>551,7484=>516, -7486=>424,7487=>474,7488=>420,7489=>531,7490=>647,7491=>386,7492=>386,7493=>400,7494=>618,7495=>400, -7496=>400,7497=>387,7498=>387,7499=>428,7500=>340,7501=>400,7502=>175,7503=>365,7504=>613,7505=>399, -7506=>385,7507=>346,7508=>385,7509=>385,7510=>400,7511=>247,7512=>399,7513=>464,7514=>613,7515=>373, -7522=>201,7523=>347,7524=>399,7525=>373,7543=>640,7544=>549,7547=>372,7557=>320,7579=>488,7580=>353, -7581=>353,7582=>473,7583=>428,7584=>233,7585=>316,7586=>488,7587=>399,7588=>201,7589=>201,7590=>201, -7591=>201,7592=>318,7593=>263,7594=>263,7595=>455,7596=>613,7597=>613,7598=>495,7599=>492,7600=>487, -7601=>385,7602=>473,7603=>416,7604=>299,7605=>334,7606=>399,7607=>477,7609=>464,7610=>355,7611=>332, -7612=>418,7613=>418,7614=>452,7615=>473,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0, -7680=>722,7681=>596,7682=>735,7683=>640,7684=>735,7685=>640,7686=>735,7687=>640,7688=>765,7689=>560, -7690=>802,7691=>640,7692=>802,7693=>640,7694=>802,7695=>640,7696=>802,7697=>640,7698=>802,7699=>640, -7700=>730,7701=>592,7702=>730,7703=>592,7704=>730,7705=>592,7706=>730,7707=>592,7708=>730,7709=>592, -7710=>694,7711=>370,7712=>799,7713=>640,7714=>872,7715=>644,7716=>872,7717=>644,7718=>872,7719=>644, -7720=>872,7721=>644,7722=>872,7723=>644,7724=>395,7725=>320,7728=>747,7729=>606,7730=>747,7731=>606, -7732=>747,7733=>606,7734=>664,7735=>320,7736=>664,7737=>320,7738=>664,7739=>320,7740=>664,7741=>320, -7742=>1024,7743=>948,7744=>1024,7745=>948,7746=>1024,7747=>953,7748=>875,7749=>644,7750=>875,7751=>644, -7752=>875,7753=>644,7754=>875,7755=>644,7756=>820,7757=>602,7760=>820,7761=>602,7762=>820,7763=>602, -7764=>673,7765=>640,7766=>673,7767=>640,7768=>753,7769=>478,7770=>753,7771=>478,7772=>753,7773=>478, -7774=>753,7775=>478,7776=>685,7777=>513,7778=>685,7779=>513,7784=>685,7785=>513,7786=>667,7787=>402, -7788=>667,7789=>402,7790=>667,7791=>402,7792=>667,7793=>402,7794=>843,7795=>644,7796=>843,7797=>644, -7798=>843,7799=>644,7800=>843,7801=>644,7802=>843,7803=>644,7804=>722,7805=>565,7806=>722,7807=>565, -7808=>1028,7809=>856,7810=>1028,7811=>856,7812=>1028,7813=>856,7814=>1028,7815=>856,7816=>1028,7817=>856, -7818=>712,7819=>564,7820=>712,7821=>564,7822=>660,7823=>565,7824=>695,7825=>527,7826=>695,7827=>527, -7828=>695,7829=>527,7830=>644,7831=>402,7832=>856,7833=>565,7834=>903,7835=>370,7838=>829,7839=>602, -7840=>722,7841=>596,7842=>722,7843=>596,7852=>722,7853=>596,7854=>722,7855=>596,7856=>722,7857=>596, -7858=>722,7859=>596,7860=>722,7861=>596,7862=>722,7863=>596,7864=>730,7865=>592,7866=>730,7867=>592, -7868=>730,7869=>592,7878=>730,7879=>592,7880=>395,7881=>320,7882=>395,7883=>320,7884=>820,7885=>602, -7886=>820,7887=>602,7896=>820,7897=>602,7908=>843,7909=>644,7910=>843,7911=>644,7922=>660,7923=>565, -7924=>660,7925=>565,7926=>660,7927=>565,7928=>660,7929=>565,7936=>675,7937=>675,7938=>675,7939=>675, -7940=>675,7941=>675,7942=>675,7943=>675,7944=>722,7945=>722,7946=>869,7947=>869,7948=>734,7949=>763, -7950=>722,7951=>722,7952=>537,7953=>537,7954=>537,7955=>537,7956=>537,7957=>537,7960=>853,7961=>841, -7962=>1067,7963=>1077,7964=>1008,7965=>1035,7968=>599,7969=>599,7970=>599,7971=>599,7972=>599,7973=>599, -7974=>599,7975=>599,7976=>998,7977=>992,7978=>1212,7979=>1224,7980=>1159,7981=>1183,7982=>1098,7983=>1095, -7984=>392,7985=>392,7986=>392,7987=>392,7988=>392,7989=>392,7990=>392,7991=>392,7992=>521,7993=>512, -7994=>735,7995=>738,7996=>679,7997=>706,7998=>624,7999=>615,8000=>602,8001=>602,8002=>602,8003=>602, -8004=>602,8005=>602,8008=>820,8009=>859,8010=>1120,8011=>1127,8012=>937,8013=>964,8016=>608,8017=>608, -8018=>608,8019=>608,8020=>608,8021=>608,8022=>608,8023=>608,8025=>851,8027=>1079,8029=>1044,8031=>953, -8032=>815,8033=>815,8034=>815,8035=>815,8036=>815,8037=>815,8038=>815,8039=>815,8040=>829,8041=>870, -8042=>1131,8043=>1137,8044=>946,8045=>976,8046=>938,8047=>970,8048=>675,8049=>675,8050=>537,8051=>537, -8052=>599,8053=>599,8054=>392,8055=>392,8056=>602,8057=>602,8058=>608,8059=>608,8060=>815,8061=>815, -8064=>675,8065=>675,8066=>675,8067=>675,8068=>675,8069=>675,8070=>675,8071=>675,8072=>722,8073=>722, -8074=>869,8075=>869,8076=>734,8077=>763,8078=>722,8079=>722,8080=>599,8081=>599,8082=>599,8083=>599, -8084=>599,8085=>599,8086=>599,8087=>599,8088=>998,8089=>992,8090=>1212,8091=>1224,8092=>1159,8093=>1183, -8094=>1098,8095=>1095,8096=>815,8097=>815,8098=>815,8099=>815,8100=>815,8101=>815,8102=>815,8103=>815, -8104=>829,8105=>870,8106=>1131,8107=>1137,8108=>946,8109=>976,8110=>938,8111=>970,8112=>675,8113=>675, -8114=>675,8115=>675,8116=>675,8118=>675,8119=>675,8120=>722,8121=>722,8122=>722,8123=>722,8124=>722, -8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>599,8131=>599,8132=>599,8134=>599,8135=>599, -8136=>912,8137=>900,8138=>1063,8139=>1039,8140=>872,8141=>500,8142=>500,8143=>500,8144=>392,8145=>392, -8146=>392,8147=>392,8150=>392,8151=>392,8152=>395,8153=>395,8154=>588,8155=>562,8157=>500,8158=>500, -8159=>500,8160=>608,8161=>608,8162=>608,8163=>608,8164=>588,8165=>588,8166=>608,8167=>608,8168=>660, -8169=>660,8170=>921,8171=>897,8172=>790,8173=>500,8174=>500,8175=>500,8178=>815,8179=>815,8180=>815, -8182=>815,8183=>815,8184=>961,8185=>835,8186=>984,8187=>853,8188=>829,8189=>500,8190=>500,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>636,8200=>318,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>338,8209=>338,8210=>636,8213=>1000,8214=>500, -8215=>500,8219=>318,8223=>511,8227=>590,8228=>334,8229=>667,8234=>0,8235=>0,8236=>0,8237=>0, -8238=>0,8239=>200,8241=>1734,8242=>227,8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339, -8252=>527,8253=>536,8254=>500,8258=>1000,8260=>167,8261=>390,8262=>390,8263=>976,8264=>753,8265=>753, -8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8273=>500,8274=>450,8275=>1000,8279=>663,8287=>222, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0, -8303=>0,8304=>401,8305=>201,8308=>401,8309=>401,8310=>401,8311=>401,8312=>401,8313=>401,8314=>528, -8315=>528,8316=>528,8317=>246,8318=>246,8319=>405,8320=>401,8321=>401,8322=>401,8323=>401,8324=>401, -8325=>401,8326=>401,8327=>401,8328=>401,8329=>401,8330=>528,8331=>528,8332=>528,8333=>246,8334=>246, -8336=>386,8337=>387,8338=>385,8339=>355,8340=>387,8358=>660,8367=>1057,8369=>706,8372=>780,8373=>636, -8451=>1119,8457=>1047,8462=>644,8463=>644,8470=>946,8486=>829,8487=>829,8490=>747,8491=>722,8513=>775, -8514=>557,8515=>557,8516=>611,8523=>890,8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969, -8537=>969,8538=>969,8539=>969,8540=>969,8541=>969,8542=>969,8543=>568,8544=>395,8545=>590,8546=>786, -8547=>966,8548=>722,8549=>981,8550=>1176,8551=>1372,8552=>932,8553=>712,8554=>932,8555=>1127,8556=>664, -8557=>765,8558=>802,8559=>1024,8560=>320,8561=>640,8562=>959,8563=>885,8564=>565,8565=>885,8566=>1205, -8567=>1524,8568=>884,8569=>564,8570=>884,8571=>1204,8572=>320,8573=>560,8574=>640,8575=>948,8576=>1206, -8577=>802,8578=>1206,8579=>765,8580=>560,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838, -8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838, -8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838, -8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838, -8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838, -8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838, -8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838, -8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838, -8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838, -8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838, -8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838, -8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>604,8706=>517,8707=>542,8708=>542, -8710=>698,8711=>698,8712=>740,8713=>740,8715=>740,8716=>740,8719=>796,8720=>796,8721=>714,8722=>838, -8723=>838,8724=>838,8725=>337,8727=>680,8728=>490,8729=>490,8730=>637,8731=>637,8732=>637,8733=>677, -8734=>833,8735=>838,8736=>838,8739=>291,8740=>479,8741=>462,8742=>634,8743=>732,8744=>732,8745=>838, -8746=>838,8747=>521,8748=>852,8749=>1182,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838, -8770=>838,8771=>838,8776=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1033,8789=>1033,8800=>838, -8801=>838,8804=>838,8805=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8844=>838, -8845=>838,8846=>838,8847=>846,8848=>846,8849=>846,8850=>846,8851=>838,8852=>838,8853=>838,8854=>838, -8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838, -8865=>838,8866=>860,8867=>860,8868=>940,8869=>940,8870=>567,8871=>567,8872=>860,8873=>860,8874=>860, -8875=>1031,8876=>860,8877=>860,8878=>860,8879=>1031,8901=>342,8962=>764,8968=>390,8969=>390,8970=>390, -8971=>390,8976=>838,8977=>513,8984=>1000,8985=>838,8992=>521,8993=>521,8997=>1000,9000=>1443,9085=>919, -9134=>521,9167=>945,9251=>764,9472=>602,9473=>602,9474=>602,9475=>602,9476=>602,9477=>602,9478=>602, -9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602,9486=>602,9487=>602,9488=>602, -9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602,9496=>602,9497=>602,9498=>602, -9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602,9506=>602,9507=>602,9508=>602, -9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602,9516=>602,9517=>602,9518=>602, -9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602,9526=>602,9527=>602,9528=>602, -9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602,9536=>602,9537=>602,9538=>602, -9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602,9546=>602,9547=>602,9548=>602, -9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602,9556=>602,9557=>602,9558=>602, -9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602,9566=>602,9567=>602,9568=>602, -9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602,9576=>602,9577=>602,9578=>602, -9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602,9586=>602,9587=>602,9588=>602, -9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602,9596=>602,9597=>602,9598=>602, -9599=>602,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769, -9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769, -9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769, -9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945, -9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769, -9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769, -9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769, -9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873, -9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>791, -9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873,9697=>873,9698=>769, -9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769, -9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873, -9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896, -9784=>896,9785=>896,9786=>896,9787=>896,9788=>896,9791=>614,9792=>731,9793=>731,9794=>896,9795=>896, -9796=>896,9797=>896,9798=>896,9799=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896, -9830=>896,9831=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,10145=>838, -10181=>390,10182=>390,10208=>494,10216=>390,10217=>390,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1033, -10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434, -10239=>1434,10240=>732,10241=>732,10242=>732,10243=>732,10244=>732,10245=>732,10246=>732,10247=>732,10248=>732, -10249=>732,10250=>732,10251=>732,10252=>732,10253=>732,10254=>732,10255=>732,10256=>732,10257=>732,10258=>732, -10259=>732,10260=>732,10261=>732,10262=>732,10263=>732,10264=>732,10265=>732,10266=>732,10267=>732,10268=>732, -10269=>732,10270=>732,10271=>732,10272=>732,10273=>732,10274=>732,10275=>732,10276=>732,10277=>732,10278=>732, -10279=>732,10280=>732,10281=>732,10282=>732,10283=>732,10284=>732,10285=>732,10286=>732,10287=>732,10288=>732, -10289=>732,10290=>732,10291=>732,10292=>732,10293=>732,10294=>732,10295=>732,10296=>732,10297=>732,10298=>732, -10299=>732,10300=>732,10301=>732,10302=>732,10303=>732,10304=>732,10305=>732,10306=>732,10307=>732,10308=>732, -10309=>732,10310=>732,10311=>732,10312=>732,10313=>732,10314=>732,10315=>732,10316=>732,10317=>732,10318=>732, -10319=>732,10320=>732,10321=>732,10322=>732,10323=>732,10324=>732,10325=>732,10326=>732,10327=>732,10328=>732, -10329=>732,10330=>732,10331=>732,10332=>732,10333=>732,10334=>732,10335=>732,10336=>732,10337=>732,10338=>732, -10339=>732,10340=>732,10341=>732,10342=>732,10343=>732,10344=>732,10345=>732,10346=>732,10347=>732,10348=>732, -10349=>732,10350=>732,10351=>732,10352=>732,10353=>732,10354=>732,10355=>732,10356=>732,10357=>732,10358=>732, -10359=>732,10360=>732,10361=>732,10362=>732,10363=>732,10364=>732,10365=>732,10366=>732,10367=>732,10368=>732, -10369=>732,10370=>732,10371=>732,10372=>732,10373=>732,10374=>732,10375=>732,10376=>732,10377=>732,10378=>732, -10379=>732,10380=>732,10381=>732,10382=>732,10383=>732,10384=>732,10385=>732,10386=>732,10387=>732,10388=>732, -10389=>732,10390=>732,10391=>732,10392=>732,10393=>732,10394=>732,10395=>732,10396=>732,10397=>732,10398=>732, -10399=>732,10400=>732,10401=>732,10402=>732,10403=>732,10404=>732,10405=>732,10406=>732,10407=>732,10408=>732, -10409=>732,10410=>732,10411=>732,10412=>732,10413=>732,10414=>732,10415=>732,10416=>732,10417=>732,10418=>732, -10419=>732,10420=>732,10421=>732,10422=>732,10423=>732,10424=>732,10425=>732,10426=>732,10427=>732,10428=>732, -10429=>732,10430=>732,10431=>732,10432=>732,10433=>732,10434=>732,10435=>732,10436=>732,10437=>732,10438=>732, -10439=>732,10440=>732,10441=>732,10442=>732,10443=>732,10444=>732,10445=>732,10446=>732,10447=>732,10448=>732, -10449=>732,10450=>732,10451=>732,10452=>732,10453=>732,10454=>732,10455=>732,10456=>732,10457=>732,10458=>732, -10459=>732,10460=>732,10461=>732,10462=>732,10463=>732,10464=>732,10465=>732,10466=>732,10467=>732,10468=>732, -10469=>732,10470=>732,10471=>732,10472=>732,10473=>732,10474=>732,10475=>732,10476=>732,10477=>732,10478=>732, -10479=>732,10480=>732,10481=>732,10482=>732,10483=>732,10484=>732,10485=>732,10486=>732,10487=>732,10488=>732, -10489=>732,10490=>732,10491=>732,10492=>732,10493=>732,10494=>732,10495=>732,10496=>838,10497=>838,10498=>838, -10499=>838,10500=>838,10501=>838,10502=>838,10503=>838,10504=>838,10505=>838,10506=>838,10507=>838,10508=>838, -10509=>838,10510=>838,10511=>838,10512=>838,10513=>838,10514=>838,10515=>838,10516=>838,10517=>838,10518=>838, -10519=>838,10520=>838,10521=>838,10522=>838,10523=>838,10524=>838,10525=>838,10526=>838,10527=>838,10528=>838, -10529=>838,10530=>838,10531=>838,10532=>838,10533=>838,10534=>838,10535=>838,10536=>838,10537=>838,10538=>838, -10539=>838,10540=>838,10541=>838,10542=>838,10543=>838,10544=>838,10545=>838,10546=>838,10547=>838,10548=>838, -10549=>838,10550=>838,10551=>838,10552=>838,10553=>838,10554=>838,10555=>838,10556=>838,10557=>838,10558=>838, -10559=>838,10560=>838,10561=>838,10562=>838,10563=>838,10564=>838,10565=>838,10566=>838,10567=>838,10568=>838, -10569=>838,10570=>838,10571=>838,10572=>838,10573=>838,10574=>838,10575=>838,10576=>838,10577=>838,10578=>838, -10579=>838,10580=>838,10581=>838,10582=>838,10583=>838,10584=>838,10585=>838,10586=>838,10587=>838,10588=>838, -10589=>838,10590=>838,10591=>838,10592=>838,10593=>838,10594=>838,10595=>838,10596=>838,10597=>838,10598=>838, -10599=>838,10600=>838,10601=>838,10602=>838,10603=>838,10604=>838,10605=>838,10606=>838,10607=>838,10608=>838, -10609=>838,10610=>838,10611=>838,10612=>838,10613=>838,10614=>838,10615=>981,10616=>838,10617=>838,10618=>984, -10619=>838,10620=>838,10621=>838,10622=>838,10623=>838,10731=>494,10764=>1513,10765=>521,10766=>521,10799=>838, -11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838, -11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838,11026=>945,11027=>945, -11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11364=>753,11367=>872,11368=>644, -11369=>747,11370=>606,11371=>695,11372=>527,11374=>1024,11375=>722,11381=>740,11382=>531,11383=>700,11385=>501, -11386=>602,11388=>264,11389=>455,11520=>773,11521=>635,11522=>633,11523=>658,11524=>631,11525=>962,11526=>756, -11527=>960,11528=>617,11529=>646,11530=>962,11531=>632,11532=>646,11533=>962,11534=>645,11535=>866,11536=>961, -11537=>645,11538=>645,11539=>959,11540=>945,11541=>863,11542=>644,11543=>646,11544=>645,11545=>649,11546=>688, -11547=>634,11548=>982,11549=>681,11550=>676,11551=>852,11552=>957,11553=>632,11554=>645,11555=>646,11556=>749, -11557=>914,11800=>536,11810=>390,11811=>390,11812=>390,11813=>390,11822=>536,42564=>685,42565=>513,42566=>395, -42567=>392,42576=>1104,42577=>939,42580=>1193,42581=>871,42582=>1140,42583=>875,42760=>493,42761=>493,42762=>493, -42763=>493,42764=>493,42765=>493,42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493, -42773=>493,42774=>493,42779=>369,42780=>369,42781=>253,42782=>253,42783=>253,42891=>402,42892=>275,62464=>664, -62465=>675,62466=>724,62467=>958,62468=>675,62469=>669,62470=>735,62471=>997,62472=>675,62473=>675,62474=>1268, -62475=>693,62476=>692,62477=>963,62478=>675,62479=>692,62480=>1009,62481=>756,62482=>809,62483=>758,62484=>955, -62485=>691,62486=>946,62487=>690,62488=>698,62489=>692,62490=>739,62491=>692,62492=>698,62493=>676,62494=>739, -62495=>895,62496=>675,62497=>785,62498=>676,62499=>675,62500=>675,62501=>732,62502=>972,62504=>904,63172=>505, -63173=>602,63174=>640,63175=>644,63176=>947,63185=>500,63188=>500,64256=>708,64257=>667,64258=>667,64259=>941, -64260=>986,64261=>744,64262=>916,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0, -65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65529=>0, -65530=>0,65531=>0,65532=>0,65533=>1025); -$enc=''; -$diff=''; -$file='dejavuserifi.z'; -$ctg='dejavuserifi.ctg.z'; -$originalsize=301828; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.z deleted file mode 100644 index 3b751b08a6..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/dejavuserifi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/AUTHORS b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/AUTHORS deleted file mode 100644 index 4148c93584..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/AUTHORS +++ /dev/null @@ -1,208 +0,0 @@ --*- mode:text; coding:utf-8; -*- - GNU FreeFont Authors - ==================== - -The FreeFont collection is being maintained by - Steve White <stevan.white AT googlemail.com> -The folowing list cites the other contributors that contributed to -particular ISO 10646 blocks. - -* URW++ Design & Development GmbH <http://www.urwpp.de/> - - Basic Latin (U+0041-U+007A) - Latin-1 Supplement (U+00C0-U+00FF) (most) - Latin Extended-A (U+0100-U+017F) - Spacing Modifier Letters (U+02B0-U+02FF) - Mathematical Operators (U+2200-U+22FF) (parts) - Block Elements (U+2580-U+259F) - Dingbats (U+2700-U+27BF) - -* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John - Plaice <plaice AT omega.cse.unsw.edu.au> - - Latin Extended-B (U+0180-U+024F) - IPA Extensions (U+0250-U+02AF) - Greek (U+0370-U+03FF) - Armenian (U+0530-U+058F) - Hebrew (U+0590-U+05FF) - Arabic (U+0600-U+06FF) - Currency Symbols (U+20A0-U+20CF) - Arabic Presentation Forms-A (U+FB50-U+FDFF) - Arabic Presentation Forms-B (U+FE70-U+FEFF) - -* Young U. Ryu <ryoung AT utdallas.edu> - - Arrows (U+2190-U+21FF) - Mathematical Symbols (U+2200-U+22FF) - Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF) - -* Valek Filippov <frob AT df.ru> - - Cyrillic (U+0400-U+04FF) - -* Wadalab Kanji Comittee - - Hiragana (U+3040-U+309F) - Katakana (U+30A0-U+30FF) - -* Angelo Haritsis <ah AT computer.org> - - Greek (U+0370-U+03FF) - -* Yannis Haralambous and Virach Sornlertlamvanich - - Thai (U+0E00-U+0E7F) - -* Shaheed R. Haque <srhaque AT iee.org> - - Bengali (U+0980-U+09FF) - -* Sam Stepanyan <sam AT arminco.com> - - Armenian (U+0530-U+058F) - -* Mohamed Ishan <ishan AT mitf.f2s.com> - - Thaana (U+0780-U+07BF) - -* Sushant Kumar Dash <sushant AT writeme.com> - - Oriya (U+0B00-U+0B7F) - -* Harsh Kumar <harshkumar AT vsnl.com> - - Devanagari (U+0900-U+097F) - Bengali (U+0980-U+09FF) - Gurmukhi (U+0A00-U+0A7F) - Gujarati (U+0A80-U+0AFF) - -* Prasad A. Chodavarapu <chprasad AT hotmail.com> - - Telugu (U+0C00-U+0C7F) - -* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey - <apandey AT u.washington.edu> - - Devanagari (U+0900-U+097F) - -* Hardip Singh Pannu <HSPannu AT aol.com> - - Gurmukhi (U+0A00-U+0A7F) - -* Jeroen Hellingman <jehe AT kabelfoon.nl> - - Oriya (U+0B00-U+0B7F) - Malayalam (U+0D00-U+0D7F) - -* Thomas Ridgeway <email needed> - - Tamil (U+0B80-U+0BFF) - -* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>, - Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf - Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?> - - Ethiopic (U+1200-U+137F) - -* Maxim Iorsh <iorsh AT users.sourceforge.net> - - Hebrew (U+0590-U+05FF) - -* Vyacheslav Dikonov <sdiconov AT mail.ru> - - Syriac (U+0700-U+074A) - Braille (U+2800-U+28FF) - -* Panayotis Katsaloulis <panayotis AT panayotis.com> - - Greek Extended (U+1F00-U+1FFF) - -* M.S. Sridhar <mssridhar AT vsnl.com> - - Devanagari (U+0900-U+097F) - Bengali (U+0980-U+09FF) - Gurmukhi (U+0A00-U+0A7F) - Gujarati (U+0A80-U+0AFF) - Oriya (U+0B00-U+0B7F) - Tamil (U+0B80-U+0BFF) - Telugu (U+0C00-U+0C7F) - Kannada (U+0C80-U+0CFF) - Malayalam (U+0D00-U+0D7F) - -* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt - <nlevitt AT columbia.edu> - - Sinhala (U+0D80-U+0DFF) - -* Dan Shurovich Chirkov <dansh AT chirkov.com> - - Cyrillic (U+0400-U+04FF) - -* Abbas Izad <abbasizad AT hotmail.com> - - Arabic (U+0600-U+06FF) - Arabic Presentation Forms-A (U+FB50-U+FDFF) - Arabic Presentation Forms-B (U+FE70-U+FEFF) - -* Denis Jacquerye <moyogo AT gmail.com> - - Latin Extended-B (U+0180-U+024F) - IPA Extensions (U+0250-U+02AF) - -* K.H. Hussain <hussain AT kfri.org> and R. Chitrajan - - Malayalam (U+0D00-U+0D7F) - -* Solaiman Karim <solaiman AT ekushey.org> and Omi Azad <omi AT ekushey.org> - - Bengali (U+0980-U+09FF) - -* Sonali Sonania <sonalisonania AT gmail.com> and Monika Shah - <monikapatira AT gmail.com> - - Devanagari (U+0900-U+097F) - Gujarati (U+0A80-U+0AFF) - -* Pravin Satpute <pravin_ind21 AT hotmail.com>, Bageshri Salvi - <sbagrshri AT yahoo.co.in>, Rahul Bhalerao <rahul_pb_india AT - yahoo.com> and Sandeep Shedmake <surgs2k47 AT yahoo.co.in> - - Devanagari (U+0900-U+097F) - Gujarati (U+0A80-U+0AFF) - Oriya (U+0B00-U+0B7F) - Malayalam (U+0D00-U+0D7F) - Tamil (U+0B80-U+0BFF) - -* Kulbir Singh Thind - - Gurmukhi (U+0A00-U+0A7F) - -* Gia Shervashidze <giasher AT telenet.ge> - - Georgian (U+10A0-U+10FF) - -* Daniel Johnson - - Cherokee (U+13A0-U+13FF) - -* George Douros - - Gothic (U+10330-U+1034F) - Phoenecian (U+10900-U+1091F) - Byzantine Musical Symbols (U+1D000-U+1D0FF) - Western Musical Symbols (U+1D100-U+1D1DF) - Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF) - Mah Jong Tiles (U+1F000-U+1F02B) - Dominoes (U+1F030-U+1F093) - -* Steve White <stevan_white AT gmail.com> - Coptic (U+2C80-U+2CFF) - -* Primož Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si> - maintained FreeFont for several years, and is thanked for all his work. - -Please see the CREDITS file for details on who contributed particular -subsets of the glyphs in font files. - --------------------------------------------------------------------------- -$Id: AUTHORS,v 1.18 2009/01/04 15:57:54 Stevan_White Exp $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/COPYING b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/COPYING deleted file mode 100644 index 94a9ed024d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/CREDITS b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/CREDITS deleted file mode 100644 index 0f47440d9d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/CREDITS +++ /dev/null @@ -1,528 +0,0 @@ --*- mode:text; coding:utf-8; -*- - GNU FreeFont Credits - ==================== - -This file lists contributors and contributions to the GNU FreeFont project. - - -* URW++ Design & Development GmbH <http://www.urwpp.de/> - -URW++ donated a set of 35 core PostScript Type 1 fonts to the -Ghostscript project <http://www.cs.wisc.edu/~ghost/>, to be available -under the terms of GNU General Public License (GPL). - - Basic Latin (U+0041-U+007A) - Latin-1 Supplement (U+00C0-U+00FF) - Latin Extended-A (U+0100-U+017F) - Spacing Modifier Letters (U+02B0-U+02FF) - Mathematical Operators (U+2200-U+22FF) - Block Elements (U+2580-U+259F) - Dingbats (U+2700-U+27BF) - - -* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John - Plaice <plaice AT omega.cse.unsw.edu.au> - -Yannis Haralambous and John Plaice are the authors of Omega typesetting -system, <http://omega.enstb.org/>. Omega is an extension of TeX. -Its first release, aims primarily at improving TeX's multilingual abilities. -In Omega all characters and pointers into data-structures are 16-bit wide, -instead of 8-bit, thereby eliminating many of the trivial limitations of TeX. -Omega also allows multiple input and output character sets, and uses -programmable filters to translate from one encoding to another, to perform -contextual analysis, etc. Internally, Omega uses the universal 16-bit Unicode -standard character set, based on ISO-10646. These improvements not only make -it a lot easier for TeX users to cope with multiple or complex languages, -like Arabic, Indic, Khmer, Chinese, Japanese or Korean, in one document, but -will also form the basis for future developments in other areas, such as -native color support and hypertext features. ... Fonts for UT1 (omlgc family) -and UT2 (omah family) are under development: these fonts are in PostScript -format and visually close to Times and Helvetica font families. -Omega fonts are available subject to GPL - - Latin Extended-B (U+0180-U+024F) - IPA Extensions (U+0250-U+02AF) - Greek (U+0370-U+03FF) - Armenian (U+0530-U+058F) - Hebrew (U+0590-U+05FF) - Arabic (U+0600-U+06FF) - Currency Symbols (U+20A0-U+20CF) - Arabic Presentation Forms-A (U+FB50-U+FDFF) - Arabic Presentation Forms-B (U+FE70-U+FEFF) - -Current info: <http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=omega> - -* Valek Filippov <frob AT df.ru> - -Valek Filippov added Cyrillic glyphs and composite Latin Extended A to -the whole set of the abovementioned URW set of 35 PostScript core fonts, -<ftp://ftp.gnome.ru/fonts/urw/>. The fonts are available under GPL. - - Latin Extended-A (U+0100-U+017F) - Cyrillic (U+0400-U+04FF) - - -* Wadalab Kanji Comittee - -Between April 1990 and March 1992, Wadalab Kanji Comittee put together -a series of scalable font files with Japanese scripts, in four forms: -Sai Micho, Chu Mincho, Cho Kaku and Saimaru. The font files are -written in custom file format, while tools for conversion into -Metafont and PostScript Type 1 are also supplied. The Wadalab Kanji -Comittee has later been dismissed, and the resulting files can be now -found on the FTP server of the Depertment of Mathematical Engineering -and Information Physics, Faculty of Engineering, University of Tokyo -<ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/>. - - Hiragana (U+3040-U+309F) - Katakana (U+30A0-U+30FF) - - -* Young U. Ryu <ryoung AT utdallas.edu> - -Young Ryu is the author of Txfonts, a set of mathematical symbols -designed to accompany text typeset in Times or its variants. In the -documentation, Young adresses the design of mathematical symbols: "The -Adobe Times fonts are thicker than the CM fonts. Designing math fonts -for Times based on the rule thickness of Times = , , + , / , < , -etc. would result in too thick math symbols, in my opinion. In the TX -fonts, these glyphs are thinner than those of original Times -fonts. That is, the rule thickness of these glyphs is around 85% of -that of the Times fonts, but still thicker than that of the CM fonts." -TX fonts are are distributed under the GNU public license (GPL). -<http://www.ctan.org/tex-archive/fonts/txfonts/>. - - Arrows (U+2190-U+21FF) - Mathematical Symbols (U+2200-U+22FF) - - -* Angelo Haritsis <ah AT computer.org> - -Angelo Haritsis has compiled a set of Greek Type 1 fonts, available on -<ftp://ftp.hellug.gr/pub/unix/linux/GREEK/fonts/greekXfonts-Type1-1.1.tgz>. -The glyphs from this source has been used to compose Greek glyphs in -FreeSans and FreeMono. - -Angelo's licence says: "You can enjoy free use of these fonts for -educational or commercial purposes. All derived works should include -this paragraph. If you want to change something please let me have -your changes (via email) so that they can go into the next -version. You can also send comments etc to the above address." - - Greek (U+0370-U+03FF) - - -* Yannis Haralambous and Virach Sornlertlamvanich - -In 1999, Yannis Haralambous and Virach Sornlertlamvanich made a set of -glyphs covering the Thai national standard Nf3, in both upright and -slanted shape. The collection of glyphs have been made part of GNU -intlfonts 1.2 package and is available under the GPL at -<ftp://ftp.gnu.org/pub/gnu/intlfonts/>. - - Thai (U+0E00-U+0E7F) - - -* Shaheed R. Haque <srhaque AT iee.org> - -Shaheed Haque has developed a basic set of basic Bengali glyphs -(without ligatures), using ISO10646 encoding. They are available under -the XFree86 license at <http://www.btinternet.com/~shaheedhaque/>. - -Copyright (C) 2001 S.R.Haque <srhaque AT iee.org>. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL S.R.HAQUE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of S.R.Haque shall not be -used in advertising or otherwise to promote the sale, use or other -dealings in this Software without prior written authorization from -S.R.Haque. - - Bengali (U+0980-U+09FF) - - -* Sam Stepanyan <sam AT arminco.com> - -Sam Stepanyan created a set of Armenian sans serif glyphs visually -compatible with Helvetica or Arial. Available on -<http://www.editum.com.ar/mashtots/html/fonts/ara.tar.gz>. On -2002-01-24, Sam writes: "Arial Armenian font is free for -non-commercial use, so it is OK to use under GPL license." - - Armenian (U+0530-U+058F) - - -* Mohamed Ishan <ishan AT mitf.f2s.com> - -Mohamed Ishan has started a Thaana Unicode Project -<http://thaana.sourceforge.net/> and among other things created a -couple of Thaana fonts, available under FDL or BDF license. - - Thaana (U+0780-U+07BF) - - -* Sushant Kumar Dash <sushant AT writeme.com> (*) - -Sushant Dash has created a font in his mother tongue, Oriya. As he -states on his web page <http://members.tripod.com/~sushantdash/>: -"Please feel free to foreword this mail to your Oriya friends. No -copyright law is applied for this font. It is totally free!!! Feel -free to modify this using any font editing tools. This is designed for -people like me, who are away from Orissa and want to write letters -home using Computers, but suffer due to unavailability of Oriya -fonts.(Or the cost of the available packages are too much)." - - Oriya (U+0B00-U+0B7F) - - -* Harsh Kumar <harshkumar AT vsnl.com> - -Harsh Kumar has started BharatBhasha <http://www.bharatbhasha.net/> - -an effort to provide "FREE software, Tutorial, Source Codes -etc. available for working in Hindi, Marathi, Gujarati, Gurmukhi and -Bangla. You can type text, write Web pages or develop Indian Languages -Applications on Windows and on Linux. We also offer FREE help to -users, enthusiasts and software developers for their work in Indian -languages." - - Devanagari (U+0900-U+097F) - Bengali (U+0980-U+09FF) - Gurmukhi (U+0A00-U+0A7F) - Gujarati (U+0A80-U+0AFF) - - -* Prasad A. Chodavarapu <chprasad AT hotmail.com> - -Prasad A. Chodavarapu created Tikkana, a Telugu font available in Type -1 and TrueType format on <http://chaitanya.bhaavana.net/fonts/>. -Tikkana exceeds the Unicode Telugu range with some composite glyphs. -Available under the GNU General Public License. - - Telugu (U+0C00-U+0C7F) - - -* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey - <apandey AT u.washington.edu> - -In 1991, Frans Velthuis from the Groningen University, The -Netherlands, released a Devanagari font as Metafont source, available -under the terms of GNU GPL. Later, Anshuman Pandey from the Washington -University, Seattle, USA, took over the maintenance of font. Fonts can -be found on CTAN, <ftp://ftp.dante.de/tex-archive/language/devanagari/>. I -converted the font to Type 1 format using Péter Szabó's TeXtrace -program <http://www.inf.bme.hu/~pts/textrace/> and removed some -redundant control points with PfaEdit. - - Devanagari (U+0900-U+097F) - - -* Hardip Singh Pannu <HSPannu AT aol.com> - -In 1991, Hardip Singh Pannu has created a free Gurmukhi TrueType font, -available as regular, bold, oblique and bold oblique form. Its license -says "Please remember that these fonts are copyrighted (by me) and are -for non-profit use only." - - Gurmukhi (U+0A00-U+0A7F) - - -* Jeroen Hellingman <jehe AT kabelfoon.nl> - -Jeroen Hellingman created a set of Malayalam metafonts in 1994, and a -set of Oriya metafonts in 1996. Malayalam fonts were created as -uniform stroke only, while Oriya metafonts exist in both uniform and -modulated stroke. From private communication: "It is my intention to -release the fonts under GPL, but not all copies around have this -notice on them." Metafonts can be found on CTAN, -<ftp://ftp.dante.de/tex-archive/language/oriya/> and -<ftp://ftp.dante.de/tex-archive/language/malayalam/>. - - Oriya (U+0B00-U+0B7F) - Malayalam (U+0D00-U+0D7F) - - -* Thomas Ridgeway <> (*) - -Thomas Ridgeway, then at the Humanities And Arts Computing Center, -Washington University, Seattle, USA, (now defunct), created a Tamil -metafont in 1990. Anshuman Pandey from the same university took over -the maintenance of font. Fonts can be found at CTAN, -<ftp://ftp.dante.de/tex-archive/language/tamil/wntamil/>. - - Tamil (U+0B80-U+0BFF) - - -* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>, - Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf - Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?> - -Beyene, Kudlek, Kummer and Metzinger from the Theoretical Foundations -of Computer Science, University of Hamburg, prepared a set of Ethiopic -metafonts, found on -<ftp://ftp.dante.de/tex-archive/language/ethiopia/ethiop/>. They also -maintain home page on the Ethiopic font project, -<http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer/ethiop_eng.html>, -and can be reached at <ethiop AT informatik.uni-hamburg.de>. The current -version of fonts is 0.7 (1998), and they are released under GNU GPL. I -converted the fonts to Type 1 format using Péter Szabó's TeXtrace-A -program <http://www.inf.bme.hu/~pts/textrace/> and removed some -redundant control points with PfaEdit. - - Ethiopic (U+1200-U+137F) - - -* Maxim Iorsh <iorsh AT users.sourceforge.net> - -In 2002, Maxim Iorsh started the Culmus project, aiming at providing -Hebrew-speaking Linux and Unix community with a basic collection of -Hebrew fonts for X Windows. The fonts are visually compatible with -URW++ Century Schoolbook L, URW++ Nimbus Sans L and URW++ Nimbus Mono -L families, respectively, and are released under GNU GPL license. See -also <http://culmus.sourceforge.net/>. - - Hebrew (U+0590-U+05FF) - - -* Panayotis Katsaloulis <panayotis AT panayotis.com> - -Panayotis Katsaloulis helped fixing Greek accents in the Greek -Extended area. - - Greek Extended (U+1F00-U+1FFF) - - -* Vyacheslav Dikonov <sdiconov AT mail.ru> - -Vyacheslav Dikonov made a Braille unicode font that could be merged -with the UCS fonts to fill the 2800-28FF range completely. (uniform -scaling is possible to adapt it to any cell size). He also contributed -a free syriac font, whose glyphs (about half of them) are borrowed -from the "Carlo Ator" font freely downloadable from -<http://www.aacf.asso.fr/>. Vyacheslav also filled in a few missing -spots in the U+2000-U+27FF area, e.g. the box drawing section, sets of -subscript and superscript digits and capital Roman numbers. - - Syriac (U+0700-U+074A) - Box Drawing (U+2500-U+257F) - Braille (U+2800-U+28FF) - - -* M.S. Sridhar <mssridhar AT vsnl.com> - -M/S Cyberscape Multimedia Limited, Mumbai, developers of Akruti -Software for Indian Languages (http://www.akruti.com/), have released -a set of TTF fonts for nine Indian scripts (Devanagari, Gujarati, -Telugu, Tamil, Malayalam, Kannada, Bengali, Oriya, and Gurumukhi) -under the GNU General Public License (GPL). You can download the fonts -from the Free Software Foundation of India WWW site -(http://www.gnu.org.in/akruti-fonts/) or from the Akruti website. - -For any further information or assistance regarding these fonts, -please contact mssridhar AT vsnl.com. - - Devanagari (U+0900-U+097F) - Bengali (U+0980-U+09FF) - Gurmukhi (U+0A00-U+0A7F) - Gujarati (U+0A80-U+0AFF) - Oriya (U+0B00-U+0B7F) - Tamil (U+0B80-U+0BFF) - Telugu (U+0C00-U+0C7F) - Kannada (U+0C80-U+0CFF) - Malayalam (U+0D00-U+0D7F) - - -* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt - <nlevitt AT columbia.edu> - -Noah Levitt found out that the Sinhalese fonts available on the site -<http://www.metta.lk/fonts/> are released under GNU GPL, or, -precisely, "Public Domain under GNU Licence Produced by DMS -Electronics for The Sri Lanka Tipitaka Project" (taken from the font -comment), and took the effort of recoding the font to Unicode. - - Sinhala (U+0D80-U+0DFF) - - -* Daniel Shurovich Chirkov <dansh AT chirkov.com> - -Dan Chirkov updated the FreeSerif font with the missing Cyrillic -glyphs needed for conformance to Unicode 3.2. The effort is part of -the Slavjanskij package for Mac OS X, -<http://www.versiontracker.com/dyn/moreinfo/macosx/18680>. - - Cyrillic (U+0400-U+04FF) - - -* Denis Jacquerye <moyogo AT gmail.com> - -Denis Jacquerye added new glyphs and corrected existing ones in the -Latin Extended-B and IPA Extensions ranges. - - Latin Extended-B (U+0180-U+024F) - IPA Extensions (U+0250-U+02AF) - - -* K.H. Hussain <hussain AT kfri.org> and R. Chitrajan - -`Rachana' in Malayalam means `to write', `to create'. Rachana Akshara Vedi, -a team of socially committed information technology professionals and -philologists, has applied developments in computer technology and desktop -publishing to resurrect the Malayalam language from the disorder, -fragmentation and degeneration it had suffered since the attempt to adapt -the Malayalam script for using with a regular mechanical typewriter, which -took place in 1967-69. K.H. Hussein at the Kerala Forest Research Institute -has released "Rachana Normal" fonts with approximately 900 glyphs required -to typeset traditional Malayalam. R. Chitrajan apparently encoded the -glyphs in the OpenType table. - -In 2008, the Malayalam ranges in FreeSerif were updated under the advise -and supervision of Hiran Venugopalan of Swathanthra Malayalam Computing, -to reflect the revised edition Rachana_04. - - Malayalam (U+0D00-U+0D7F) - - -* Solaiman Karim <solaiman AT ekushey.org> - - Bengali (U+0980-U+09FF) - -Solaiman Karim has developed several OpenType Bangla fonts and -released them under GNU GPL on <http://www.ekushey.org>. - - -* Sonali Sonania <sonalisonania AT gmail.com> and Monika Shah - <monikapatira AT gmail.com> - - Devanagari (U+0900-U+097F) - Gujarati (U+0A80-U+0AFF) - -Glyphs were drawn by Cyberscape Multimedia Ltd., #101,Mahalakshmi -Mansion 21st Main 22nd "A" Cross Banashankari 2nd stage Banglore -560070, India. Converted to OTF by IndicTrans Team, Powai, Mumbai, -lead by Prof. Jitendra Shah. Maintained by Monika Shah and Sonali -Sonania of janabhaaratii Team, C-DAC, Mumbai. This font is released -under GPL by Dr. Alka Irani and Prof Jitendra Shah, janabhaaratii -Team, C-DAC, Mumabi. janabhaaratii is localisation project at C-DAC -Mumbai (formerly National Centre for Software Technology); funded by -TDIL, Govt. of India. Contact:monika_shah AT lycos.com, -sonalisonania AT yahoo.com, jitendras AT vsnl.com, alka AT ncst.ernet.in. -website: www.janabhaaratii.org.in. - - -* Pravin Satpute <pravin_ind21 AT hotmail.com>, Bageshri Salvi - <sbagrshri AT yahoo.co.in>, Rahul Bhalerao <rahul_pb_india AT - yahoo.com> and Sandeep Shedmake <surgs2k47 AT yahoo.co.in> - - Devanagari (U+0900-U+097F) - Gujarati (U+0A80-U+0AFF) - Oriya (U+0B00-U+0B7F) - Malayalam (U+0D00-U+0D7F) - Tamil (U+0B80-U+0BFF) - -In December 2005 the team at www.gnowledge.org released a set of two -Unicode pan-Indic fonts: "Samyak" and "Samyak Sans". "Samyak" font -belongs to serif style and is an original work of the team; "Samyak -Sans" font belongs to sans serif style and is actually a compilation -of already released Indic fonts (Gargi, Padma, Mukti, Utkal, Akruti -and ThendralUni). Both fonts are based on Unicode standard. You can -download the font files (released under GNU/GPL License) from -http://www.gnowledge.org/Gnoware/localization/font.htm - - -* Kulbir Singh Thind - - Gurmukhi (U+0A00-U+0A7F) - -Dr. Kulbir Singh Thind designed a set of Gurmukhi Unicode fonts, -AnmolUni and AnmolUni-Bold, which are available under the terms of GNU -Generel Public Licens from the Punjabu Computing Resource Center, -http://guca.sourceforge.net/typography/fonts/anmoluni/. - - -* Gia Shervashidze <giasher AT telenet.ge> - - Georgian (U+10A0-U+10FF) - -Starting in mid-1990s, Gia Shervashidze designed many -Unicode-compliant Georgian fonts: Times New Roman Georgian, Arial -Georgian, Courier New Georgian. His work on Georgian localization can -be reached at http://www.gia.ge/. - - -* Primož Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si> - -Primož Peterlin filled in missing glyphs here and there (e.g. Latin -Extended-B and IPA Extensions ranges in the FreeMono familiy), and -created the following UCS blocks: - - Latin Extended-B (U+0180-U+024F) - IPA Extensions (U+0250-U+02AF) - Arrows (U+2190-U+21FF) - Box Drawing (U+2500-U+257F) - Block Elements (U+2580-U+259F) - Geometrical Shapes (U+25A0-U+25FF) - -* Mark Williamson - -Made the MPH 2 Damase font, from which - Hanunóo (U+1720-U+173F) - Buginese (U+1A00-U+1A1F) - Tai Le (U+1950-U+197F) - Ugaritic (U+10380-U+1039F) - Old Persian (U+103A0-U+103DF) - -* Jacob Poon - -Submitted a very thorough survey of glyph problems and other suggestions. - -* Alexey Kryukov - -Made the TemporaLCGUni fonts, based on the URW++ fonts, from which at one -point FreeSerif Cyrillic, and some of the Greek, was drawn. He also provided -valuable direction about Cyrillic and Greek typesetting. - -* George Douros - -The creator of several fonts focusing on ancient scripts and symbols. -Many of the glyphs are created by making outlines from scanned images -of ancient sources. - - Aegean: Phoenecian - Analecta: Gothic (U+10330-U+1034F) - Musical: Byzantine & Western - Unicode: many Miscellaneous Symbols, Miscellaneous Technical, - supplemental Symbols, and Mathematical Alphanumeric symbols, - Mah Jong, and the outline of the Domino. - -* Daniel Johnson - -Created by hand a Cherokee range specially for FreeFont to be "in line with -the classic Cherokee typefaces used in 19th century printing", but also to -fit well with ranges previously in FreeFont. - Cherokee (U+13A0-U+13FF) - -Notes: - -*: The glyph collection looks license-compatible, but its author has - not yet replied and agreed on their work being used in part of - this glyph collection. - --------------------------------------------------------------------------- -$Id: CREDITS,v 1.23 2009/01/04 15:57:54 Stevan_White Exp $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/ChangeLog b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/ChangeLog deleted file mode 100644 index d5345d0232..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/ChangeLog +++ /dev/null @@ -1,4525 +0,0 @@ -$Id: ChangeLog,v 1.254 2009/01/04 16:12:59 Stevan_White Exp $ -2009-01-04 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added 2009 to copyright dates - - * AUTHORS, CREDITS: - - Removed Glagolitic range author - - * FreeSans.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added some TrueType names - -2009-01-01 Stevan_White - * FreeSerif.sfd: - - Removde Glagolitic range, since have not (yet) received OK from author. - - Added some TrueType Names - -2008-12-31 Stevan_White - * COPYING: - - Updated license to GPL v3 - -2008-12-30 Stevan_White - * FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Oblique versions of Daniel Johnson's Cherokee. - - * FreeSerifBold.sfd: - - Cherokee Bold range from Daniel Johnson. - -2008-12-27 Stevan_White - * isMonoMono.py: - - 900 EM -> 800 - - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd: - - Made glyphs to lie between -200 and 800 EM - - * isMonoMono.py: - - check that glyphs lie in vertical bounding boxes - - * FreeMono.sfd, FreeSerif.sfd: - - Extensible bracket characters didn't exactly line up. Fixed. - Mono: a couple of glyphs had gotten out of their bounding boxes again. - -2008-12-26 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Final pre-release cleanup - - * FreeSerif.sfd: - - Buginese vowel u was misnamed - - * FreeMono.sfd: - - Yatcyrillic somehow was a mark character ... fixed - - * FreeSans.sfd, FreeSansOblique.sfd: - - Had to un-link references in - Sans: uni02B2, uni02B5 - SansOblique: uni0363 - because validation of the TTF file said the glyph - "is drawn in wrong direction" - I would have preferred to have understand this... - - * Makefile: - - Added quick test for FontForge version. - - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd: - - Removed kerning tables (?? what were they doing here anyway??) - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Kerning tables for Thai. - Handles one common case: short letter followed by a tall one with - an overhang to the left. - -2008-12-25 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - More putzing with kerning tables - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Copied kerning classes - Serif -> SerifBold - SerifItalic -> SerifBoldItalic - Sans -> SansOblique SansBold SansBoldOblique - Some associated naming of characters, etc - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Additions and correction in Spacing Modifier letters and IPA Extensions - -2008-12-23 Stevan_White - * FreeSerif.sfd: - - Applied patch to Cherokee range - -2008-12-20 Stevan_White - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Fixed kern classes that end in space (crashes FontForge) - - * FreeSerifItalic.sfd, FreeSerif.sfd: - - kerning - -2008-12-19 Stevan_White - * FreeSerifItalic.sfd: - - kerning - - * FreeSerif.sfd: - - kerning - Some adjustments to Glagolitc spacing, mark positioning - -2008-12-18 Stevan_White - * FreeSerif.sfd, FreeSerifItalic.sfd: - - kerning - -2008-12-17 Stevan_White - * FreeSerif.sfd, FreeSerifItalic.sfd: - - kerning - -2008-12-11 Stevan_White - * FreeSans.sfd, FreeSerif.sfd: - - kerning - -2008-12-10 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd: - - kerning - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd: - - kerning - -2008-12-09 Stevan_White - * FreeSerif.sfd, FreeSerifItalic.sfd: - - kerning - -2008-12-08 Stevan_White - * FreeSansOblique.sfd: - - Slanted small final sigma. Remedies - bug #24993: U+03C2 "Greek small letter final sigma" not slanted in - Free Sans Oblique - https://savannah.gnu.org/bugs/index.php?24993 - -2008-12-07 Stevan_White - * FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - kerning, etc - -2008-12-06 Stevan_White - * FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifItalic.sfd: - - kerning - Tweek in Sans having to do with addition of Latin Extended - -2008-12-05 Stevan_White - * FreeSansBold.sfd, FreeSansBoldOblique.sfd: - - Tweeks to Latin Extended Additional - - * FreeSansBoldOblique.sfd: - - Added Latin Extended Additional range - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Extra space at end of kern class names has bad effect on FornForge - script that try to run through kern classes. Some FontForge call - corrupts memory. - Got rid of extra space. - -2008-12-02 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Replaced U+0387 GREEK ANO TELEIA with top dot of colon. - See bug #24987: U+0387 GREEK ANO TELEIA too low - https://savannah.gnu.org/bugs/index.php?24987 - - * FreeSerif.sfd: - - more kerning in Cyrillic (broke into two tables of classes) - -2008-12-01 Stevan_White - * FreeSerif.sfd: - - tweeks to kernin - - * FreeSerifBoldItalic.sfd: - - kerning - -2008-11-30 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Kerning for Latin and Cyrillic fairly complete in Serif faces. - Complete in sense that it looks pretty good under Pango for - English French German Spanish Polish Czech Latvian - But have not done Vietnamese (will require many more entries). - I adjust roman and italic, then copy tables by hand to bold and - bolditalic. - Misgiving: bolditalic is much too crammed - Overall, I may have over-kerned. (A difficult temptation to master.) - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - kerning - - * FreeSans.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - kerning - In Serif, modified widths of some extended latin glyphs - -2008-11-29 Stevan_White - * FreeSerif.sfd: - - Broke Latin kerning subtable into four, hoping it will be easier to - understand and maintain. - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSerif.sfd, - FreeSerifItalic.sfd, FreeSerifBold.sfd, FreeSansOblique.sfd, - FreeSans.sfd: - - kerninig - -2008-11-28 Stevan_White - * FreeSans.sfd, FreeSerif.sfd: - - more kerning; - made guillemot narrower - - * FreeSansOblique.sfd, FreeSerif.sfd: - - previous commit was incomplete - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Adjusted width of single quotes (and apostrophe) to be "punctuation width" - More fiddling with kerning. - -2008-11-27 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifItalic.sfd: - - much fiddling with kerning - -2008-11-26 Stevan_White - * FreeSerifBold.sfd: - - Basic kerning, named main Cyrillic letters - - * FreeSerifItalic.sfd: - - Basic Cyrillic kerning - - * FreeSerif.sfd: - - Tweeks to Cyrillic kerning - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifItalic.sfd, Makefile: - - Much fiddling with kerning, tables, and generating fonts whose kerning - tables work with OpenOffice. - -2008-11-24 Stevan_White - * FreeSerif.sfd: - - regularized padding in Miscellaneous symbols. - At least within related ranges tried to make similar. - Made to validate - -2008-11-23 Stevan_White - * FreeSerif.sfd: - - Filled out Miscellaneous Symbols. Used George Douros' Unicode font. - Completed Miscellaneous Symbols, with some drawings from George Douros' - Unicode Symbols, and some of mine. - - * FreeMono.sfd, FreeMonoOblique.sfd: - - Replaced Greek Exteded psili and dasia with scaled versions of the - "bent quote" mark. I think it's distinctive enough, but not so silly. - - Remedies bug #22997: Mono: Greek Extended psili is ugly - https://savannah.gnu.org/bugs/?22997 - - * FreeSerif.sfd: - - Made some recycling symbols - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Finished with Hebrew Pointed letters in all faces. - -2008-11-22 Stevan_White - * FreeSans.sfd: - - Fiddled with Hebrew Pointed letters - - * FreeSerifItalic.sfd: - - Marks for Vietnamese - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Letter pe had strange thick middle ear that looked awful. lamed had ben - bumped at some point. Fixed. Adjusted some of the points. - -2008-11-21 Stevan_White - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - repairs to Pointed Hebrew - - * FreeSerif.sfd: - - Numeral line positioning marks for Gothic - - * FreeSerifItalic.sfd: - - Added Combining Marks for Symbols (some question about obliqueness of - some symbols) - Cleaned up some empty glyphs in Pointed Hebrew. - -2008-11-20 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Provided Hebrew pointed letters, with lookups, for all Serif faces. - -2008-11-19 Stevan_White - * FreeSerifBoldItalic.sfd: - - renamed Hebrew lookups - - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Completed Hebrew in Bold faces. - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - More tweeks to Hebrew points - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - Adjustments corrections and additions to Hebrew points - -2008-11-18 Stevan_White - * FreeSansBold.sfd: - - Cleaned out a lot of ridiculous kernings - -2008-11-17 Stevan_White - * FreeSansBoldOblique.sfd: - - fiddled with Armenian ligatures - - * FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Added Armenian (with ligatures) to BoldOblique - Fiddled with character spacing - -2008-11-16 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added U+01f9 and paragraph end marker to Georgian - Fiddled with Armenian ligatures - -2008-11-15 Stevan_White - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Another pass at letter spacing in Cyrillic. - Also went through ancient letters. - - Added Georgian paragraph separator 10FB - Added Georgian turned gan 10F9 (because it was easy) - - Re-worked letter spacing through modern Cyrillic range. - - * FreeSans.sfd, FreeSansBold.sfd, FreeSerif.sfd: - - Letter spacing - -2008-11-14 Stevan_White - * FreeSerif.sfd: - - Added several characters to Cyrillic Extended-B - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd: - - Made Cyrillic hooked e U+04BC-F to look less goofy. - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Based on assertion on Pechatnyj Dvor's web site, Cyrillic Fita - U+0472-3 and "Barred O" U+04E8-9 are different styles the same letter, - and the fact that the tilde in the O never looked good in Sans, I - made them all barred O's. - - * FreeSerif.sfd: - - Added Cyrillic Yn, yn (U+a65e-f) - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Synced up Cyrillic and Combining Diacritics ranges, - Couple of tweeks in Gujarati to make TT validate - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Changes to older Cyrillic letters, in response to further information. - Made omegas, omegas with titlo, and OT to all be of the same size and - shape in Serif. - Un-linked Cyrillic Psi and psi from Greek, made squarer versions. - - Some more Cyrillic diacritical marks in Sans. Re-worked U+04bc-f . - Experimenting with mark positioning for Cyrillic - -2008-11-12 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Strove to make Euro look more like the EC logo design, while making - glyph fit better with the design of its face. Bug #3576: Euro design - https://savannah.gnu.org/bugs/?23576 - - * FreeSans.sfd, FreeSerif.sfd: - - Adjustments mostly to GPOS tables having to do with Vietnamese marks. - The WAZU Vietnamese test page looks pretty good in Sans now. - Still not thrilled with below-dot when it appears with a mark over - e.g. U+0102. Pango positions one or the other but not both. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Extensive modification of GPOS lookup tables for mark positioning. - I think they're now all functional (except styled Mono faces have none). - Also added lots of marks to faces that didn't have them, and also - fiddled with Combining Diacritical Marks. - -2008-11-10 Stevan_White - * FreeSerif.sfd: - - Made one combining mark really combining - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made a few combining characters to be zero-width in Mono, - Added them to other styles. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Figured out why below marks in Thai weren't working in the lowest - letters. I think Pango and other font renderers ignore 'blwm'. - However, 'mark' works. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Tweeks to Thai marks - -2008-11-09 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Several bugfixes in Thai, mostly having to do with mark placement and - ligatures. Implemented ru-saraaa and lu-saraaa with ligatures. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - added and named dottedcircle (used by Pango to render - combining mark base) - - * FreeSerif.sfd: - - Tweeks to Coptic, after viewing more papyrus samples and web pages. - - * FreeSerif.sfd: - - Weight of Coptic small letters made to match that of Latin and Greek ones. - -2008-11-08 Stevan_White - * FreeSerif.sfd: - - Made Coptic to comply better with - http://www.wazu.jp/gallery/Test_Coptic.html - Made a flourish at foot of letters with long diagonal. - - More tweeks to Coptic; put in a mark lookup table. - - Note: for small letters I made scaled references to captials. - Results in those letters looking quite light next to the capitals and - next to small Latin letters. Also, there are a few variant forms for - capitals (Unicode samples don't show this). It would be good to - re-work - - Added Coptic alphabet in u+2C80-2CB1 and u+03E2-u+03EF, drawn/built by - me, based on Unicode samples, TeX font copte, and scans at WikiPedia. - -2008-11-07 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Further tweeks to dieresis in Greek and Cyrillic - - * FreeSerif.sfd: - - replaced Greek I dieresis with references, tweeked height of dieresis. - -2008-11-04 Stevan_White - * FreeSerif.sfd: - - Added a few Cyrillic Extended-B letters seen in web pages while looking - for Glagolitic text. - - * FreeMono.sfd, FreeMonoOblique.sfd: - - Added a few old Cyrillic characters. - - * FreeSerif.sfd: - - Several corrections and tweeks to Glagolitic. - Still missing six slots from Unicode, but don't see them in the TeX - fonts. - On the other hand, several on-line Glagolitic pages (bibles etc) don't - seem to use these. Maybe it's OK as-is. - -2008-11-03 Stevan_White - * FreeSerif.sfd: - - Added lowercase range to Glagolitic, as a facile scaling of the - uppercase. - - Added letter to Glagolitic, scaled range. - -2008-11-02 Stevan_White - * FreeSerif.sfd: - - Replaced fraktur bold from Mathematical Alphanumeric Symbols with that - from TX Fonts by Young Ryu. - One concern: letter k is damaged (in both medium and bold). I just - hacked something up. - - Added Glagolitic "round type" font (Croation capitols only) from the - collection of Croatian fonts for LaTeX by Darko Zubrinić - ftp://ftp.dante.de/tex-archive/languages/croatian/ - http://www.tug.org/TUGboat/Articles/tb17-1/tb50zubr.pdf - - Several letters are missing besides the small letters. - - * FreeSerifBoldItalic.sfd: - - A couple of Thai references got obliqued twice. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - By popular demand, removed 'ears' from Greek Upsilon and Psi. - Copied resulting glyphs to Serif Mathematical Alphanumeric Symbols. - - * FreeSerif.sfd: - - Some pointwise cleanup of main Tamil range - - Tried some things with lookups. Didn't make much headway. - -2008-11-01 Stevan_White - * FreeMono.sfd: - - somehow made a letter with wrong width - - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added similar lookups and ligatures to Thai ranges. - - * FreeSerif.sfd: - - Lookups now work no worse than those for other Thai fonts, at least - in Pango. Still perplexed by behaviour of "Required" lookups. - - For Thai, made ligatures and lookups for yoying and thothan combined - with a lower vowel. These work well. - Attempted looksups for saraaa with ru and lu, and for saraam. - Not working. - - Cleaned up a few of the Bengali ligatures - - * FreeSerifBold.sfd: - - Tweek Thai - -2008-10-31 Stevan_White - * FreeSerif.sfd: - - Fixed ligatures and mark positioning for Hanunóo. - Problem with ligatures: Gnome pango doesn't do 'rlig', only 'liga' - - * FreeSerifItalic.sfd: - - Changed lookup table scripts for Devanagari and Bengali. - Find Problems -> ATT found several problems showing lookups acting on - glyphs that weren't listed in the script ranges, including dev2, bng2 - (why not deva and beng, I don't know). - - danda and doubledanda of Devanagari I understand are to be shared among - Indic scripts. So included bng2 and dev2 in the 'aalt' table for those. - - The 'init' and 'half' tables for Bengali made active for bng2. - - The 'locl' table for Bengali didn't do anything I could see: It mapped - the Devanagari danda to itself, and the doubledanda to itself. Deleted. - - Cleaned up some kern tables. - adjustments of under 5 EM are invisible. Some others I just didn't like. - Some were putting a letter beneath another, with is wrong. - - * FreeSerifBoldItalic.sfd: - - Added Thai - - * FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Changes to mark positioning lookups, esp. in Italic. - Widened numerals in Bold - -2008-10-27 Stevan_White - * FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Tweeks regarding Armenian and lookups - - * FreeSansBold.sfd: - - Added Armenian ligatures FB13-FB17 with lookups - Also made a historical ligature ('hlig') table for u+0587. - - Toward bug #15183: missing characters from Armenian range - https://savannah.gnu.org/bugs/index.php?15183 - - * FreeSansOblique.sfd: - - Added Armenian ligatures, lookups. Cleaned up contours. - - * FreeSans.sfd: - - Added 5 Armenian ligatures to U+FB13 – FB17, and made corresponding - 'liga' lookup. Found there one ligature u+0587 that according to - http://en.wikipedia.org/wiki/Armenian_alphabet - - "in new orthography the և character is not a typographical ligature anymore, and must never be treated as such. It is a distinct letter and has its place in the new alphabetic sequence." - So moved this out of the 'liga' lookup and into a new 'hlig' lookup. - -2008-10-26 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Lots of improvements to Thai. - Completely revised letter spacing in Italic, and fiddled with combining - marks in all. - Still aren't working quite right, especially in Italic. - Still need to work over digits (in Bold they aren't even bold yet) - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Bold Thai : added (painstakingly) constructed glyphs, lookups - roman Thai: tweeks - Italic Thai: tweeks (Note this still has multiple problems) - -2008-10-25 Stevan_White - * FreeSerif.sfd: - - WAZU says - http://www.wazu.jp/gallery/Fonts_Hanunoo.html - - MPH 2B Damase doesn't support the consonant-vowel ligatures necessary - to render Buhid writing. - - OK, so I made 'mark' lookups for combining marks and a bunch of - ligatures in an 'rlig' lookup. The latter still not working: - don't know why. - - Made page to match the example of the combining forms at - http://www.omniglot.com/writing/hanunoo.htm - -2008-10-24 Stevan_White - * FreeSerif.sfd: - - Removed some marks from Mathematical Alphanumeric Symbols - - * FreeSerif.sfd: - - Tweeked combining marks for Vietnamese. Made to satisfy - WAZU JAPAN Comprehensive Unicode Test Page for Vietnamese - http://www.wazu.jp/gallery/Test_Vietnamese.html - Could still use some tweeking... - - * FreeSerif.sfd: - - Added marks for composition of Vietnamese - - * FreeMono.sfd, FreeSerif.sfd: - - Put "below" combining mark on lots of vowels and derivatives, - for Vietnamese. - Named a bunch of composit Latin, expecting to make substitutions. - -2008-10-23 Stevan_White - * FreeSerif.sfd: - - Thai spacing alterations based on advice of a native speaker. - -2008-10-22 Stevan_White - * FreeSerif.sfd: - - re-named Thai lookups according to order - -2008-10-21 Stevan_White - * FreeSans.sfd: - - Cleanup of glyphs in Gujarati, Devanagari. - - Note: Serious problem with Sans GPOS abvm in Devanagari - "'abvm' Above Base Mark in Devanagari subtable" "gujr-0" - But all the characters that list gujr-0 are in Gujarati. - Not sure how this got broken or how to fix it. - - * FreeSerif.sfd: - - Fiddled with Thai mark positioning: passes my tests now OK. - Made a few more references in Math Symbols; more regularization of - stroke. - - * FreeSerif.sfd: - - Added mark class for Vietnamese "horn" - Several references made in General Punctuation, Arrows - - * FreeMono.sfd: - - added some Combining Diacritical Marks - -2008-10-20 Stevan_White - * FreeSerif.sfd: - - Made some references from serifed Latin capitals to Greek counterparts. - - * FreeSerif.sfd: - - Made a few repeated glyphs into references in Musical Symbols - -2008-10-19 Stevan_White - * FreeSerif.sfd: - - Moved several glypns from Mathematical Alphanumeric Symbols to - Letterlike Symbols. - Couple tweeks in Mathematical Symbols. - - * FreeMono.sfd, FreeSerif.sfd: - - Fiddling with Mathematical Symbols. - In Serif, trying to make stroke width more consistent. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd: - - Added some Greek symbols in Mono and Sans to make a little more regular - and correspond better with TeX. - Tweek of serif. - - * FreeSansBold.sfd: - - a few more improvements. - - One problem with the Mathematical Alphanumeric area is, one must - remember to change it any time another face is altered... - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSerifBold.sfd: - - Several improvements and additions to Sans faces (mostly in Greek) from - experience of pasting into FreeSerif Mathematical Alphanumeric Symbols. - - * FreeSerif.sfd: - - Replaced most of Mathematical Alphanumeric Symbols - roman italic bold (latin and greek) - gothic italic bold (latin and greek) - typewriter - and numerals - with glyphs from FreeFont. These were scaled to uniform height. - - Remains: Blackboard Bold, Fraktur, Calligraphic, Script - - * FreeSerif.sfd: - - Tidied lookup table names for Malayalam - - * FreeSerif.sfd: - - Applied Malayalam patch from Hiran Venugopalan - - * FreeMono.sfd: - - Added/corrected many Mathematical Symbols - - * FreeSansOblique.sfd: - - more IPA - -2008-10-18 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Made lots more IPA and Phonetic Extensions - Note: fontforge is reporting an error in a few glyphs made by scaling - another, that the glyphs are drawn in the wrong direction--only in - TrueType though. Suspect a FontForge bug. - - Added several Combining Diacritical Marks - -2008-10-17 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Made several Spacing Modifier Letters, Combining Diacritical Marks, - and IPA and Phonetic Extensions - -2008-10-16 Stevan_White - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added some Superscripts and Subscripts - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Finished off Superscripts and subscripts - - Completed General Punctuation for Mono faces - - Added some General Punctuation - -2008-10-15 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - more Letterlike Symbols, Currency Symbols - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Made some Combining Diacritical Marks for Symbols, Letterlike Symbols - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Added some General Punctuation - -2008-10-14 Stevan_White - * FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Added double slanted hyphen, made General Punctuaton Supplement like - Serif's - - * FreeSansBoldOblique.sfd: - - Filled out Greek Extended - - * FreeMono.sfd, FreeSerifItalic.sfd: - - fixes to last 2 commits - - * FreeSerifItalic.sfd: - - Last character to General Punctuation - - * FreeMono.sfd: - - Built some Enclosed Alphanumerics (1-10) - - * FreeSerif.sfd: - - Copied in Daniel Johnson's changes to Cherokee. - -2008-10-12 Stevan_White - * FreeSerif.sfd: - - Included Daniel Johnson's Cherokee glyphs. - -2008-10-05 Stevan_White - * FreeMono.sfd: - - Further corrections to diaresis in Cyrillic -- legibility in small sizes - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoOblique.sfd, FreeSerif.sfd: - - Regularized placement of diaresis in Cyrillic - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added same set of glyphs to Cyrillic Supplement - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Added some of the easier letters from Cyrillic Supplement - -2008-10-04 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeSerifItalic.sfd: - - Finished high Cyrillic range for MonoBold and MonoBoldOblique. - (Remaining: historic ranges, Cyrillic extensions) - Tweeked others. - - * FreeMonoBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Serif*Italic: Added last Abkhazian letters to Cyrillic - MonoBold: tweek - -2008-10-03 Stevan_White - * FreeMono.sfd, FreeMonoOblique.sfd, FreeSerif.sfd, FreeSerifBoldItalic.sfd: - - Mono: Some additions to historic letters - - * FreeSerif.sfd: - - Added some punctuation and combining numeric marks from - Cyrillic Extended B - - * FreeMono.sfd, FreeMonoBold.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Various technical tweeks, mostly concerning recent additions. - Also did a bit more "Points too close" and "irrelevant control points". - Cyrillic millions redesign meant could not maintain use of refrences - for it. - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More high Cyrillic - Included old Cyrillic millions combining mark in Sans, changed design - in Serif - -2008-10-02 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - More high Cyrillic - - * FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifBoldItalic.sfd: - - More high Cyrillic glyphs - - * FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More glyphs in high Cyrillic. Remains only some whose form I'm unsure - of in italic. - - * FreeSerifBoldItalic.sfd: - - More glyphs in higher Cyrillic range - - * FreeSerifItalic.sfd: - - Same process of tightening el, em, ge (but a P.S. to previous commit: - also did ya, ze for SerifBold.) - - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - BoldItalic: Tightened up spacing on left of el, em, ge (could go - farther, but it is partly a problem with glyph design... - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More additions to Cyrillic. Finished SerifBold except for Nivkh - additions. - Used references on number combining forms. - -2008-09-30 Stevan_White - * FreeSerif.sfd: - - Added four (obsolete) Chuvash letters to Cyrillic Supplement - - completing it. - -2008-09-29 Stevan_White - * FreeSerif.sfd: - - Greek adjustments - Adjusted spacing of kappa slightly - Got rid of ears on Psi, following similar request for Upsilon. - -2008-09-28 Stevan_White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Adding and fiddling with Spacing Modifiers and Combining Diacriticals - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Revisions of several Combining Diacritical marks - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - A few Combining Diacriticals and Spacing Modifiers - - MonoBoldOblique: Primarily filling out Spacing Modifier Letters - others: little fixes found along the way - -2008-09-27 Stevan_White - * FreeSerif.sfd: - - Replaced Malayalam range with that from Rachana_04 found on - Swathanthra Malayalam Computing project page - http://savannah.nongnu.org/projects/smc/ - Besides scaling and converting to cubic, performed much clean-up of - glyphs, added an r2 character, and re-named a bunch of characters. - -2008-09-22 Stevan_White - * FreeSerif.sfd: - - Filled in as much of Phonetic Extensions as I could without artistic - abilities. - Note 1D48-9 are not references due to apparent FontForge bug, that says - scaled references go in wrong direction. - - * FreeSerif.sfd: - - Cleaup of some Bengali glyphs. - Note many of the ligatures remain very very messy. - - * Makefile: - - added more validations - made to work with GenerateOpenType - - * FreeSerif.sfd: - - Built two more easy Phonetic Extensions - - * FreeSerif.sfd: - - Built some Phonetic Extensions letters, those with middle tilde - -2008-09-21 Stevan_White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Added lots of Spacing Modifier Letters and Combining Diacritical Marks. - - * FreeMono.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSerif.sfd: - - Wrote script to check if glyph encodings were in stated ranges, fixed - most discrepancies. - - There were a bunch of incompletely deleted characters in several faces. - - Sans: found several other problems in the process - # Tamil - Four slots labelled 0BDA-D have glyphs, not in Unicode. also 0BE1 - I think they are misplaced; added 0010 to each of them - - # Devanagari - Slot labelled U+093B is not in Unicode--can't find glyph: deleted - likewise 094F (may have been meant to be 0954) - 0955, 0973-0976 - - 0954 should be a combining mark, but it appears on the wrong side of 0. - 0971 was just wrong--made into simple dot. - 0972 is also wrong--made my own Candra A. - - # Gujarati - Slots labelled 0AE4-5 are not in Unicode; seem not to belong at all. - Deleted. 2800 is a dup of 2790. Deleted - - Serif: phillipine_double u1736 was misplaced - - A bunch of the Math Alphanumeric symbols are empty in the standard, - because they're represented elsewhere. These should be deleted - First need to make style consistent with existing symbols. - - * FreeSerif.sfd: - - Applied patch from Daniel J - Remedies bug - FreeSerif: Missing glyphs with palatal hook - https://savannah.gnu.org/bugs/index.php?24298 - Adding several letters to Phoenetic Extensions range U+1D80-BF - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made four characters U+200C-F to be zero-width - Remedy to bug #23593: Mono 0-width chars: zero-width or space? - https://savannah.gnu.org/bugs/index.php?23593 - - * FreeSerif.sfd: - - Made Mahjong tiles to take up less space using references - Cleaned up several validation problems - -2008-09-19 Stevan_White - * FreeSerif.sfd: - - Added several Hebrew Alphabetic Presentation Forms (some easy ones), to - make its coverage the same as Serif Bold. - - * FreeSerifBold.sfd: - - Re-encoded. - Deleted several glyphs in Hebrew Alphabetic Presentation Forms that - didn't correspond valid Unicode - - * FreeMonoBold.sfd, FreeSans.sfd, FreeSerifItalic.sfd: - - Ran script to find mis-numbered glyphs. Several were simply typos, - some offset by one. - - * FreeSansOblique.sfd: - - Numerous cases of glyphs in Private Use area incorrectly assigned - Unicode numbers and names. Gave all -1 for Unicode and named like - "slot.XXXX". - - * FreeSerif.sfd: - - Adapted Mahjong Tiles from George Douros' Unicode Symbols font. - - * FreeSerif.sfd: - - Added Domino Tiles. Domino outline is copied from George Douros' - Unicode Symbols, but the rest I preferred to do with references. - -2008-09-18 Stevan_White - * FreeSerif.sfd: - - Adapted Mathematical Alphanumeric Symbols from George Douros' Unicode - Symbols font. - - * FreeMonoBoldOblique.sfd: - - This one got away from me--I don't know what I did. - Looks like some small contour edits. - - * FreeSansBoldOblique.sfd: - - Fixed one mis-numberd character in Latin Extended-B - - * FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Fixed several mis-numbered characters. - - * FreeSansBold.sfd: - - SansBold: one Georgian letter with no name, one Zapf Dingbat was - unnumbered - ATT test shows a bunch of problems with Gurmukhi and 'blwf' table - indeed shows those letters at 0x10000+ - Sans names them like uni0A30_uni0A4D.blwf: they are in range - ECC6 to ED06 - - I meant to move this range into Private Use in last release, and - missed it. So now it is moved, into same range as Sans. - - Both Sans and SansBold in nukt table for Gurmukhi have duplicate - entries for uni0A15 uni0A3C. Deleted dups. - - * FreeMonoOblique.sfd: - - fixed a number of Unassigned Code Points in Greek Extended - - * FreeSansOblique.sfd: - - mis-numbered Combining Diacritics - - * FreeSansOblique.sfd: - - Several chars in Latin Extended hadn't been named. - One spurious letter in Letterlike Symbols - -2008-09-16 Stevan_White - * FreeMono.sfd, FreeSans.sfd, FreeSerif.sfd: - - Lots of additions: unless otherwise noted, they are from George Duros' - fonts Analecta, Music, and Unicode (haven't got final confirmation of - the eligibility of these glyphs, so this is just for testing.) - - Added some combining marks, fiddled a bit. In both Serif & Mono, tried - to get a key symbol characters to fit inside the key combining mark - - Serif - Got rid of ears on Upsilon - Added: - # Gothic - # Western & Byzantine Musical Symbols - - # Misc Symbols, Misc Technical Symbols (drew many myself) - # Supplemental Symbols and Arrows - - Mono - Added: - # lotsa Misc Technical Symbols - # OCR Symbols - # drew many Supplemental Symbols and Arrows, Misc Technical - - Sans - Added # Phoenecian - Made a few Letterlike Symbols; Made Re and Im to be sans-serif. - -2008-09-11 Stevan_White - * FreeSerif.sfd: - - Removed pointless entries from Latin kern table - - Tidied points in Sinhala - -2008-09-07 Stevan_White - * FreeSerif.sfd: - - Tidied up Tamil ligatures EEA8-EEAB to fix TT build warning - "MonotonicFindAlong: Never found our spline." - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, Makefile: - - - Added APL characters to FreeMono (why?...) - - Fixed several last-minute problems, including - - Serif: Tweeked GPOS mark table for Cyrillic - Sans: Added a GPOS table for Cyrillic (but several diacritics missing) - - Serif, Mono: tweeked some bugs in extensible brackets & integrals - - Serif: Vietnamese o circumflex: accent was a bit high. fixed. - - MonoBoldOblique OTF build - uni213b intersects self - - Generation of TT fonts complains about several things to stderr, - including: - - SerifBold: "There exists a 'fpgm' code that seems incompatible with FontForge's. Instructions generated will be of lower quality. If legacy hinting is to be scrapped, it is suggested to clear the `fpgm` and repeat autoinstructing. It will be then possible to append user's code to FontForge's 'fpgm', but due to possible future updates, it is extremely advised to use high numbers for user's functions." - Probably has been there since I first copied the TT instructions in. - Just repeated the copying process carefully, and the warning went away. - - Serif: "FindMatchingHVEdge fell into an impossible position" - fixed a bunch of point too close - - REMAINING PROBLEM in Serif TT build - "MonotonicFindAlong: Never found our spline." - fixed several bad TT matrices-- there are several more - fixed many "control points too close" no luck - -2008-09-03 Stevan_White - * FreeSans.sfd, FreeSansOblique.sfd: - - Added/corrected some Misc. Symbols by copying from Serif. - Note this is only a stopgap solution. Want real sans-serif symbols. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added minimal Miscellaneous Symbols: card suites and some musical notes. - Note not happy with shapes...some I just drew. Sans isn't really sans. - - Fixed one APL symbol in Mono so it verified in OTF version - -2008-08-31 Stevan_White - * FreeMono.sfd: - - Built set of APL symbols. - -2008-08-30 Stevan_White - * FreeSans.sfd: - - Un-linked references in uni02B2 and uni02B5, because when validating the - TrueType version, FontForge gave an error "is drawn in wrong direction". - I suspect a bug in FontForge. Other similar glyphs make no errors. - - Fixed missing extrema in TrueType. - These were the last cases being reported by validate in all the faces. - - * FreeSerifItalic.sfd: - - fixed last missing extrema in TrueType - - * Makefile: - - restructured validation to look in a directory - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd: - - Fixed missing extrema in TrueType versions - -2008-08-15 Stevan_White - * FreeSans.sfd: - - Same problem with uni0A83 as with bn_llikaar. Just made zero-width. - -2008-08-14 Stevan_White - * FreeSans.sfd, FreeSansOblique.sfd: - - Glyph bn_llikaar, U+09E3 BENGALI VOWEL SIGN VOCALIC LL, - has right bound positioned far into the negative. Causes a warning in - FontForge when opening OTF version. - Comparing with other fonts supporting Bengali, found no others that - do this. - Serif makes glyph width 0 (which sounds right according to Unicode) - and puts glyph wholly to left of 0. But, I haven't found this letter - in text anywhere. I wonder if it is really used in writing. - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - Further TrueType validation fixes. - Sans still has two glyps in wrong direction. - - * FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Fixed more TrueType problems...all missing extrema in TTF validation - -2008-08-13 Stevan_White - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - fixed all the TrueType validation problems of type "intersects itself" - and all but two of the "wrong directions", as well as a lot of - "missing extrema". But there remain hundreds of missing extrema in the - TrueType version. - Also, bn_llikaar in Sans and Oblique still has a problem in OTF version. - - * FreeMono.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd: - - Made .ttf files to validate. Other faces have many more problems still. - -2008-08-12 Stevan_White - * FreeMonoOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - Continuing to make OTF versions validate. - - * FreeMonoOblique.sfd: - lots of missing points at extrema - * FreeSerif.sfd: - 12 wrong directions, 1 missing extrema - * FreeSerifItalic.sfd: - many missing points at extrema, 1 self-intersecting - - What was wrong: in several oblique cases, an already-italic glyph was - made more italic, thereby fouling up extrema (although why it passed - validation in the SFD I don't know). Some glyphs were - overly-complicated with many near points. Cleaned up, rounded to int. - - Remaining problem: OTF FreeSansOblique FreeSans. one Bengali glyph in - each whose advance width and htmx don't match. - - Moral of story: validate the OTF and TTF versions too before a release. - - * FreeSansOblique.sfd: - - Reverse a mistake from last commit: somehow this file was converted to - quadratic, or something. - -2008-08-11 Stevan_White - * FreeMonoBoldOblique.sfd, FreeSans.sfd, FreeSansOblique.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Found that SFD files that validated produced OpenType files that don't. - These represent the easy fixes. Some were result of conversion to - quadratic; some shouldn't have validated in the SFD... - - * MonoBoldOblique: uni0250 missing pts at extrema [reference glyph rotated...] - * Sans: uni0AC4 wrong direction [simplified, rounded to int] - * SansOblique: uni01EA wrong direction [rounded to int] - * SerifBold: uni023f wrong direction [round to int] - * SerifBoldItalic: uni0245 missing pts at extrema [ungrouped ref, added extrema] - -2008-08-06 Stevan_White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoOblique.sfd: - - Re-set font metrics, which were somehow making uneven vertical spacing. - -2008-06-22 Steve White - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Made to validate - - * ranges.py: - - Brought more into line with OpenType - Added some ranges - Fixed bug with ranges outside of font - - * CREDITS: - - 3 new ranges - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Cyrillic: tweeked accents for consistency, and for readability in small - sizes. - - * FreeSerif.sfd: - - Thanna range: tweeking - - Thaana range: Scaled up by about 15%, raised by 100EM, tightened - some of the diacritics to get inside 900 to -300 EM limits. - - * FreeSans.sfd: - - Added Old Persian and Ugaritic from MPH2BDamase font. - -2008-06-21 Steve White - * FreeSerif.sfd: - - Added Tai Le range adapted from MPH2BDamase font. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Added some ancient Greek numerals from Tempora to high Unicode area, - (partly just to show it can now be done.) - - * FreeSerifItalic.sfd: - - Couple of tweeks putting glyphs above -300EM. - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Surgery to Thai letter 'tho than', u+0e10, to push it above -300 EM. - This makes Thai range completely between 900 and -300 EM. - - * FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - Many auxilary characters (esp. for Malayalam, Bengla, and Tamil) - representing ligatures and alternative forms without their own Unicode, - were moved from - ranges above 0xFFFF (which ought to have been slots for other defined - Unicode ranges) into the Private Use area. - - In Serif, I segregated the scripts, in Sans it was hard to see where one - began and another ended, so I moved them en masse. - - Note several problems with wrongly-named characters: - I already re-named glyph570 and glyph582. - But there are others with names starting with A... - - * FreeSansBold.sfd, FreeSansOblique.sfd: - - Fixed (I hope the last) problem with scripts in lookups - Find Problems -> ATT (all selected) finds multiple issues, - - * FreeSansBold.sfd: - In addition to script 'guru', added 'gur2' to the scripts for these - lookups - 'nukt' Nukta forms in Gurmukhi - 'blwf' Below Base Forms in Gurmukhi - 'pstf' Post Base Forms in Gurmukhi - 'blws' Below Base Substitutions in Gurmukhi - 'abvs' Above Base Substitutions in Gurmukhi - 'psts' Post Base Substitutions in Gurmukhi - - * FreeSansOblique.sfd: - In addition to script 'beng', added 'bng2' to the scripts for the lookup - 'half' Half Forms in Bengali - - Moreover, the lookup - 'aalt' Access All Alternates in Latin - contains only Bengali letters. - Re-named as Bengali, made to work on beng, bng2 scripts - -2008-06-20 Steve White - * FreeSerif.sfd: - - Scaled Sinhala range. - Remedies bug #23656: Sinhala letters over-sized - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Mostly messing with Greek Extended accents again. - re-positioned ypogegrammani on advice of Alexey Kryukov - Put prosgegrammani beneath main letters in Mono, to make narrower glyphs - Implemented more distinction between tonos and acute. - -2008-06-19 Steve White - * FreeMonoBoldOblique.sfd: - - Completed fit of Mono to 800 to -200 EM. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoOblique.sfd: - - Set Metrics to recommended values - - * FreeMonoOblique.sfd: - - Now Mono Oblique, as well as roman and Bold, are within 800 to -200 EM. - Just BoldOblique to go. - - * FreeMono.sfd, FreeMonoBold.sfd: - - More toward fitting to 800 to -200 EM. - Basically, reduced Georgian by 92%. - Also made an over-all offset, so Georgian is somehow centered (Bold...I - guess I already did this in roman). - Want to also do an emboldening to make stroke like rest of font, but - current FontForge has a nasty crash that loses data on this function. - - * FreeMono.sfd: - - In effort to make fit in 800 to -200 EM, - Scaled Georgian by 92%, centered on 600 wide box. - Next: Embolden a bit. - -2008-06-18 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Toward making all glyphs lie between -200 and 800 EM. - Numerous small changes, especially raising descenders of some Hebrew - letters. - Georgian remains a problem - -2008-06-13 Steve White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Moved prosgegrammeni up to baseline, - (and then moved all references down to baseline) - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added Control Picture "blank" to all faces. - Switched U+0222-3 from TemporaLGCUni - -2008-06-11 Steve White - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More fiddling with Greek Extended accents - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Tweeks to accents etc in Greek Extended and Cyrillic - -2008-06-10 Steve White - * FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Fixed a few big horizontal spacing problems - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Implemented TemporaLCGUni glyphs in Cyrillic ranges. - Added a breve_cyrillic for the moustache breve mark. - -2008-06-08 Steve White - * FreeSerif.sfd: - - Replaced most of Cyrillic range with TemporaLGCUni. - Remodelled many of the derived Cyrillic characters after these. - Fiddled globally with spacing of small letters. - Unclear on diacritics 485-6, unhappy with breve. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Started implementing TemporaLCGUni in Greek ranges. - - Replaced 3DC-3E1 from Tempora, because I thought they looked nicer and - more like the other existing FreeFont glyphs. - Replaced 3DA-B from Tempora, because they look more like Unicode - samples, and nicer. - Added 03f3-4, 03F7-F. - Prefer my own lunate epsilon. - Replaced Phi and Omega from Tempora. - These plainly fit the other FreeFont glyphs better than the origninals. - (How did this happen?) - - In bold, replaced U+03D7 - - Copied lbbar u+2114 - - Small italic greek--replaced most except phi, psi, omega - - Based on new information, broke the identification of oxia with Latin - acute. - -2008-06-07 Steve White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Efforts to control heights of characters - -2008-06-06 Steve White - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made to validate - -2008-06-05 Steve White - * FreeSans.sfd: - - Fixed undefined character in kerning classes - -2008-06-04 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - tweeks and additions to General Punctuation - -2008-06-03 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSansOblique.sfd: - - Completed/tweeked Number Forms - - * FreeMono.sfd, FreeSerif.sfd: - - Added some Miscellaneous Technical symbols - -2008-06-02 Steve White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Tweeks...mostly Letterlike - -2008-06-01 Steve White - * FreeMono.sfd, FreeSerif.sfd: - - Added Box Drawing characters to Serif. - Tweeked a glyph in Mono - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Added several glyphs to Letterlike Characters - -2008-05-31 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Validation pass - - SansOblique and SansBoldOblique had validation problem with BlueValues - Private Dictionary - Elements in BlueValues/OtherBlues array are disordered - Elements in BlueValues/OtherBlues array are too close - (Change BlueFuzz) - StemSnapV does not contain StdVW value. - So I ordered the array, and based on other slanted fonts, - removed StemSnapV. - - Note however, I still think the two top Blues lines are too close - But I don't even know what the second-to-top line is meant to do. - - * FreeSerif.sfd: - - Added to Block Elements, Geometric Shapes - Made to validate - -2008-05-29 Steve White - * FreeMono.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Looking at special symbols. - Drew several Miscellaneous Symbols in Mono and Serif - > Completed/corrected planetary symbols, added Dice, - some other easy ones - > Completed Dingbats in Serif (using URW Dingbats) - Added some Block Elements to Serif - -2008-05-26 Steve White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More changes stemming from J. Poon's report. - -2008-05-25 Steve White - * FreeSerif.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Height surgery on SerifBoldItalic. - More fiddling with accents in others. - - * FreeSerifItalic.sfd: - - More height surgery. Only a few left in Benglai and Thai - - * FreeSerifBold.sfd: - - Re-applied surgery to make glyphs between 900 and -300EM - - *** Regression - Inadvertently un-linked all references in SerifBold in r1.83. - This reverses that error (but also un-does the surgery mentioned there) - - * FreeSerifBold.sfd, FreeSerifItalic.sfd: - - Applied surgery to make Latin letters go under 900EM. - One exception yet... - -2008-05-24 Steve White - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Serif: much fiddling with accents in Latin ranges. - Re-thought some glyphs (there are still a few messy ones, especially - in bold) - Checked horizontal spacing...fixed a number of problems. - -2008-05-23 Steve White - * FreeSansBold.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Made Latin Extended-B coverage consistent across Serif; cleaned up some - glyphs - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Filled more of General Punctuation in Sans and Serif - Made all agree on coverage of Latin Extended Additional - -2008-05-22 Steve White - * FreeSans.sfd, FreeSansBold.sfd, FreeSansOblique.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Added Latin Extended Additional to SansOblique. - Made Latin Extended Additional coverage consistent across Sans, B, I - Made Latin Extended-B coverage same in SerifBold. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeSansBold.sfd: - - Mono* made Latin-B coverage consistent across faces - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Made set of Latin Extended-B consistent across Sans faces - - * FreeSans.sfd, FreeSansBold.sfd: - - More filling in General Punctuation - - * FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Another bunch of J. Poon's reports - also, filling in some Combining Diacriticals, Spacing Modifiers, and - General Punctuation in bold faces - -2008-05-21 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Mucking about with mark tables in Thai (Serif) - Other faces: Making changes from J. Poon's report - -2008-05-20 Steve White - * CREDITS: - - Mark Williamson - Jacob Poon - - * Makefile: - - added tests target - -2008-05-18 Steve White - * ranges.py: - - Put table explanation back in - - Improved behaviour for high Unicode - - * FreeSans.sfd: - - Revision of kerning - - * FreeSerif.sfd: - - Made Latin kerning a little more reasonable: - reduced many excessive kerns (some had letters apparently - overlapping, which shouldn't happen) - made kerns increment by 5EM for ease of reading - got rid of kerns too small to be seen - - * FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSerifBold.sfd: - - Made to verify - -2008-05-13 Steve White - * FreeSerif.sfd: - - Made to validate - - * FreeSerif.sfd: - - Gurmukhi: filled range in Serif, taking glyphs from the original - Punjabi font by Hardip Singh Pannu - http://members.aol.com/hspannu/punjabi.html (file pb_win95.exe) - -2008-05-12 Steve White - * FreeSans.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Hebrew, basic. Some faces missing punctuation marks, added. - - * FreeMono.sfd, FreeSans.sfd: - - Armenian: Sans tried to make verticals and horizontals of more uniform - width both, finddled with punctuation - - * FreeMonoOblique.sfd: - - made to validate - - * FreeMonoBold.sfd: - - made to validate - - * FreeSans.sfd, FreeSansBold.sfd: - - Armenian in Sans: regularized letter spacing - - * FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd: - - Armenian: fill out ranges and clean up - SansBold especially had a lot of incorrect references. - Now all the ranges with Armenian at least share the same set of - characters. - - * FreeMono.sfd: - - Fixed glyph with wrong width. - -2008-05-11 Steve White - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerifItalic.sfd: - - 1) made to validate - 2) Mono: copied in Spacing Modifier Letters (glyphs not yet named) - 3) SerifItalic: Filled in General Punctuation - - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made to validate, and pass all other FontForge tests. - Expedient: rounded everything to int - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Made to have the same Greek Symbols, - Made to validate - - * FreeSans.sfd, FreeSansBold.sfd: - - Made Greek Symbols as full as rest of Sans. Changed a name in Sans. - - * FreeMonoOblique.sfd: - - Made Greek as full as other faces - Made to validate - - * FreeSansBold.sfd: - - Deleted seven orphaned Arabic characters; looks like somebody started, - didn't get very far, putting Arabic in bold. - - Deleted orphaned Arabic glyph from Arabic Presentation forms-B - - * FreeSerifBold.sfd: - - Deleted the single Arabic character: it was clearly there by mistake. - - * FreeSansOblique.sfd: - - Made Greek Symbols as full as rest of Sans - - Tweeks to Armenian - - Comment from previous commit of FreeSans was meant for FreeSansOblique. - In FreeSans, only tweeked a few letters during putting more characters - in this face. - - Filled in Spacing Modifier Letters, increased General Punctuation. - - * FreeSans.sfd: - - Filled in Spacing Modifier Letters, increased General Punctuation - - * FreeMono.sfd: - - Made Armenian as full as other roman faces. - - Completed Spacing Modifier Letters - Added a couple of Greek Punctuation - - added more Spacing Modifier Letters - -2008-05-10 Steve White - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Did same process of scaling and sizing for Thai in Sans as in Serif. - Added mark tables to Sans. Improvement, but there are questions... - - * FreeSans.sfd: - - Tidied some Gurmukhi glyphs, validated. - - Deleted ranges for Oriya, Kannada, on account of - 1) they only contained a subset of the consonant glyphs of the scripts, - few if any vowels, and had no ligature lookups as required - 2) Kannada was based on the Akurti fonts, which have copyright issues. - - See - bug #23225: Oriya range only partial - bug #23224: Kannada range only partial - - * FreeMonoBoldOblique.sfd: - - Made metrics like rest of Mono - -2008-05-09 Steve White - * ranges.py: - - More info on range intervals - - * FreeSerif.sfd: - - Deleted Telugu range. - It didn't represent a complete writing system for the language. - - See notes at https://savannah.gnu.org/bugs/index.php?23202 - Serif: Telugu range missing many characters; many wrong - - Got a copy of the original Tikkana font, - Copied in remaining consonants and vowels that I could find there. - I think one vowel 0C55 is missing according to unicode). - Strangely, the Telugu digits are alo missing. - In Tikkana, the default "checkmark" structural mark is missing from many - consonants, according to Unicode, but is a separate glyph. I put - the checkmark on. - This, and scaled up by 150% and cleaned up intersecting glyphs and - many unnecessary points. - -2008-05-08 Steve White - * FreeSerif.sfd: - - Filled out Telugu consonants. - Vowels still need to be done - -2008-05-07 Steve White - * FreeSerif.sfd: - - Operated on Latin glyphs with stacked accents to make them fit under - 900EM. - Scaled Telugu bu 150%. - -2008-05-06 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeSansBold.sfd, FreeSerif.sfd: - - Corrected further fontforge "find problems" - Added some math characters to FreeSerif - -2008-05-05 Steve White - * FreeSansBold.sfd: - - Made to validate, and fixed bad TT transformations - -2008-05-04 Steve White - * FreeMono.sfd, FreeSerif.sfd: - - Mainly TeX additions trying to satisfy Markus Kuhn's TeX-as-Unicode page - - * FreeMono.sfd: - - Adjusted heights of extensible brackets - - Fixed problems with extensible brackets, thanks to Markus Kuhn's page - http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt - - * ranges.py: - - fiddled with ranges, doc - - made some ranges more correct? - - fixed some bugs in ranges - better error reporting - - Got rid of Unicode 1.1 references - - made to use OpenType table - - * FreeMono.sfd, FreeSans.sfd, FreeSerif.sfd: - - made to validate - -2008-05-03 Steve White - * FreeMono.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Removed digits from Private Use Area. - See bug 23050. - - * FreeMono.sfd, FreeSans.sfd: - - Completed General Punctuation - - * FreeSans.sfd: - - Completed IPA Extensions - - * FreeMono.sfd, FreeSans.sfd, FreeSerif.sfd: - - More work on Superscripts and Subscripts, Spacing Modifiers. - Sans is now complete in both. - Added Pfennig to Sans and Mono. - - * ranges.py: - - Restructure text output - Rearrangement and cosmetic ...except I had broken it. now fixed - Seems to be in a useful form at this point. - More docs, date - - * FreeSerif.sfd: - - Added a hand-drawn old German Pfennig to Currency Symbols - - * FreeMono.sfd, FreeSans.sfd, FreeSerif.sfd, FreeSerifItalic.sfd: - - Further additions to General Punctuation, Super and Sub Scripts, - Spacing Modifiers, etc. - -2008-05-02 Steve White - * FreeSans.sfd: - - additions to Spacing Modifiers, IPA - - * FreeSerifItalic.sfd: - - Shortening stacked accents to maintain readability when clipped - -2008-05-01 Steve White - * FreeSans.sfd: - - Additions to Spacing Modifiers and changes to Combining Diacritics - - * FreeSerif.sfd: - - Made sure all the half rings in Combining Diacriticals and Spacing - Modifiers were really half rings (J. Poon had complained about this) - - Filled out General Punctuation - Some work on Spacing Modifiers - - Filled out Mathematical Operators - still needs lots of work - Made to validate - - Filled out Latin Extended B - Added some letters with curls to Latin Extended B - More fiddling with Latin Extended B accents - -2008-04-30 Steve White - * FreeSerif.sfd: - - Added Hanunóo script, with characters based on those in - font MPH2BDamase, on request from the maintainer of that font, - http://packages.debian.org/sid/ttf-mph-2b-damase - - Glyphs are simple vector strokes. Could be a little more uniform. - - Added Buginese script "Lontara", with characters based on those in - font MPH2BDamase, on request from the maintainer of that font, - http://packages.debian.org/sid/ttf-mph-2b-damase - - Note the glyphs are pretty rough, clearly a digitization of handwriting. - I just cleaned them up, and corrected discrepancies with Unicode, - and compared with some pictorial samples of the script I could find. - -2008-04-29 Steve White - * ranges.py: - - Improved look a lot--still unhappy with some ranges - OS/2 seems sometimes bang-on, sometimes unrelated to anything (including - fontforge's OS/2 listing) - - * FreeSerif.sfd: - - Much fiddling with Tamil range. - First scaled to 78% (avoiding the references) - This gets it in the ballpark height-wise. [A bit taller than the Latin - letters, but the stroke is narrower, but then the glyphs are busier.] - Then had to re-align combined references, the trickiest being the - halants. - Checked with other fonts with Tamil text. - -2008-04-28 Steve White - * FreeSans.sfd, FreeSerif.sfd: - - Cleanup of control points in Arabic and Thaana - - * FreeSerif.sfd: - - Cleanup of missing extrema in Arabic and Thaana - - Many changes to Thai, trying to make the script fit between some lines, - so accents won't get clipped, etc. - Also, stroke weight was heavier than that of Latin. - - Scaled whole thing by 93%. - Shrank the tallest letters 0E42-4 to get them under 900EM. - Shaved off top of maiek. - Fiddled with positioning of all accents. - Made positioning tables for accents. - Note: unclear these are working correctly - - Fixed a bug having to do with character replacements for characters - named 'ng' and 'nj'; these names had been taken on by other characters. - - Made to validate - - Unicode positions of two Cyrillic Extended characters were switched. - Fiddled with a couple of Cyrillic combining diacritics - -2008-04-27 Steve White - * FreeSans.sfd: - - bugfix: a left harpoon mysteriously appeared to the left of letter p! - -2008-04-26 Steve White - * FreeMono.sfd: - - Made to validate - - * FreeSans.sfd: - - Made to validate - - Toward J. Poons report - Made 032B more like proper double-arches (and distinct fro 033C seagull) - Made 032b more like a seagull - - * FreeSans.sfd, FreeSansBold.sfd: - - Sans: fiddling with widths and terminators of math symbols, - toward J. Poon's report - R & B: removed u+2741 because it didn't match the Unicode description - - * FreeMono.sfd: - - Extensible parenthesis symbols weight/terminators - Toward bug # 23064: https://savannah.gnu.org/bugs/index.php?23064 - Rounded a bunch of terminators - -2008-04-22 Steve White - * FreeSerif.sfd: - - Small alignment problem in Greek Extended - - One more tweek to spacing in Cyrillic Extended - - Corrected spacing in Cyrillic Supplement - - Added Cyrillic Supplement letters for - Enets, Khanty, Chukchi, Itelmen, Mordvin, Kurdish, Aleut - - Added Cyrillic letters for Nivkh (completing Cyrillic range) - More tightening of accents in Latin Extended. - - * FreeSans.sfd: - - Fiddled with math--consequences of changing the "similar" operator - - More tightening of accents - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Adjustments to h and k with caron and cedilla in Latin A and B - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd: - - FreeSerifBold: deleted 3 dotted Hebrew letters in Private/Corporate use - (E801-3). They weren't ligatures or in any other lookup, and they - weren't present in FreeSerif. - - * FreeSansBold: - Unlinked and deleted F6C3, which called itself commaaccent. - Made some new spacing and non-spacing accents to make up for it. - - * FreeSansBoldOblique: - Made references of many Latin Extended. - Also corrected several wrong ones. - - * Freeserif: - Re-named commaaccent - -2008-04-21 Steve White - * FreeMono.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSerif.sfd, FreeSerifBold.sfd: - - Deleted Hiragana and Katakana ranges, as discussed on bugs list. - Cleaned up some encoding issues, unnamed glyphs - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Roman: added 'sine' -- not beautiful, but I liked drawing it - All: Made special lookup for Dutch ligatures 'IJ' and 'ij' - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Roman: ffi etc Latin ligatures from 'liga' to 'dlig' (these weren't - really ligatures anyway, and only looked very bad when used. - Retain for condensed type. - Others: deleted Latin 'liga' table altogether - BoldOblique : added j to ij ligature - - Toward J. Poon's Report: - Except for issues of terminators not always vertical or horizontal, - and a few things that were too hard or I was unsure of. - -2008-04-20 Steve White - * FreeSerif.sfd: - - Futzing with accents in Latin Extended Additional and Latin Extended-B - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Added primemod character, referenced by Greek number sign - - * FreeMono.sfd, FreeMonoOblique.sfd: - - Following J. Poon's report, disconnected NJ (01CA) - -2008-04-19 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - First pass throught J. Poon's bug list. - See bug reports for details. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made underscore slanted in Oblique faces, made all to be width of - space character. - Towards J. Poon's report. - Disturbed that xterm and some other apps put small space between - characters when none was called for. - - * FreeMono.sfd, FreeMonoBold.sfd, FreeSans.sfd, FreeSansOblique.sfd: - - Corrections on Currency Symbols - - * FreeMono.sfd, FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More corrections, additions to Currency Symbols - - * FreeSans.sfd, FreeSerif.sfd: - - Filled out and corrected Currency Symbols - -2008-04-18 Steve White - * FreeSans.sfd, FreeSerif.sfd: - - Adjustments to Combining Marks for Symbols - Additions to range in Sans, and re-structured its marks table so that - "middle" can apply to any range - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Made reference between combining koronis and lenis of Greek Extended. - In Serif, re-worked combining marks lookup tables, added anchors in - Latin, moved so without marks they work in kedit (but now I'm doubting - kedit does a reasonable thing...what is a better application for - testing this?) - -2008-04-16 Steve White - * FreeSerifItalic.sfd: - - Adjusting of spacing and accents in Greek - - * FreeMono.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansOblique.sfd, FreeSerif.sfd: - - Much futzing with Greek letter spacing and accents. - Added lenis to FreeMono. - - * FreeMono.sfd, FreeSerif.sfd: - - Adjusted spacing of dots of Greek dieresistonons in Serif - Whipped up something for Greek kappascript in Mono (could use revision) - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Raised dots on double-dotted Cyrillic i, to match that of i and j. - -2008-04-14 Steve White - * FreeMono.sfd: - - Corrected 27e6-7 "white bracket" - Note it is probably a FontForge bug these symbols aren't showing up. - FontForge thinks they are in Supplemental Arrows, but they should be - in Supplemental Math-A - - Named some Greek characters - - * FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd: - - Spacing of some Cyrillic characters - -2008-04-13 Steve White - * FreeSerif.sfd: - - Some fiddling with accents - 'yogh' was too wide - - * FreeSansBold.sfd, FreeSansOblique.sfd: - - Character spacing was chaos--tried to improve. BoldOblique also needs - it. - - * FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd: - - Completed the fix of bug #12798, Greek glyphs with accents to side - Much mucking with accents here, and fixed a few things that were just - wrong. - -2008-04-12 Steve White - * FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Made Mono curly quotes "bent" - - * FreeMono.sfd: - - More fiddling with Greek accents - Made quotes "bent" - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Adjustments on Greek diaresistonos etc. - Adjustments in Serif on combining marks for symbols - - * FreeSerif.sfd: - - More additions to Combining marks for Symbols - - Additions to Combining marks for Symbols -- now mostly full. - Lots of adjustments to middle anchor point in Latin to make big circle - (nearly) encircle preceding latter - -2008-04-11 Steve White - * FreeMono.sfd: - - Bugfix: - Had indroduce a glyph of width other than 600, making kterminal not - recognize it as a monospace font. - -2008-04-10 Steve White - * FreeSans.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More messing with accents. - Further to bug #12798, Greek glyphs with accents to side - Much messing with glyphs in Greek Extended range - -2008-04-09 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSerif.sfd: - - Revisited Latin-1 and Latin-A accents. - Glyph B7 was called "periodcentered", but Unicode callse it Mid Dot, - and the description doesn't refer to the period. I made it like the - dot accent. throughout, and referred L-dot to it. - - Also double-checked "commaaccent" characters (some in Unicode called - cedilla, but the Unicode example shows a comma...mystery) - - Also the funny IPA upside-down f often had two bars, incorrectly. - - To do: go through rest of Serif, and Sans - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Completed re-structuring of stacked Latin accents in Mono. - Also: lots of associated adjustments of Greek Extended accents. - (Trying to at least center extremely wide characters on their box) - Repaired some victems of "find overlaps" sweeps - Worked on glyphs with apostrope/comma parts - Corrected a few wrong glyphs. - - Trying out a "bent quotes" solution to making primes distinct from - quotes. - -2008-04-08 Steve White - * FreeMonoOblique.sfd: - - Toward reducing overall height - Did similar process as for Mono, fixing a few errors along the way. - Also the Greek Extended range was very messed up vertical and - horizontally. - Horizonal spacing of the heavily accented Greek is a real problem in - Mono... - To do: - revisit "commaaccent" characters in all faces: do some have - edillas? - some Hebrew glyphs are a little low - Georgian generally is way out of bounds - -2008-04-07 Steve White - * INSTALL: - - Various updates and corrections, tweeked formatting - - * FreeMonoBold.sfd: - - Tweeking of accents - -2008-04-06 Steve White - * FreeMono.sfd, FreeMonoBold.sfd: - - Re-worked accents in FreeMonoBold.sfd to make Latin ranges lie between - 800 and -200 EM, as with FreeMono. - - * FreeMono.sfd: - - Latin Extended ranges: Implemented new policy of shortening the letters - of the characters with the highest-stacked accents. - - At this point all the Latin glyphs lie betweeen 800 and -200 EM. - - Also checked for readability of all the Latin extended letters in xterm. - (Issue: it chops letters outside their bounding boxes; many accents had - been a bit outside. Made sure that if they were chopped, they were at - least still recognizable.) - -2008-04-05 Steve White - * FreeMono.sfd: - - Following exchange about Mono on freefont-bugs with Joe Wells, who - > doesn't like the curly quote marks - > wants combining diacritics to work - > wants tight line spacing - - Trying to reduce font height: - > exclamdown was below -200 - > Throughout Extended Greek, ypogegrammeni were too low. Shortened - glyph, and raised all references. - > Lots of messing with Latin Extended ranges to make glyphs mostly - fit into 800 height. Mostly succeeded. A couple will get chopped. - > Messed with "commaaccent" glyphs, which were very low - > Cyrillic 04B1 had a tail that was incorrectly low - > Much mucking with Georgian range. Moved up by 95 (read that Georgian - is written as though centered between two horizontal lines, rather than - as sitting on a baseline) There are still a few very high glyphs. - - FontForge U+0122 called Gcommaaccent, glyph looks like that, but - Unicode says it's Gcedilla. Made the ones called cedilla by Unicode - to be cedillas - - Note bug in Unicode: standard for 0122, 0123, 0136, 0137, 013B, 013C, - 0145, 0146, 0156, 0157 all talk about cedilla, say to make it with - cedilla, but example shows comma. - - By the way: - > Got rid of commaaccent and dotlessj in Corporate Use - > Replaced shadedark, with little squares now not overlapping. - > Corrected IPA symbol 'ts' 02A6, added 02a8, 02a9, 02aa, 02ab, 02ac, - 02ad, 02ae, 02af - - (so many changes...the CVS server was down...) - - * FreeSerif.sfd: - - Re-named arabic and hebrew characters - Big adjustment to comma-accents. Mostly effects Greek Extended. - Made such accents to be like comma, rather than like Russian apostrophe - (and de-referenced that symbol) - -2008-04-04 Steve White - * FreeMono.sfd, FreeSerif.sfd: - - Raised dot on superscript i (2071) -- more distinct at small sizes - - * FreeMono.sfd: - - added two IPA symbols - -2008-04-02 Steve White - * FreeSerif.sfd: - - fixed a few more control points too close - - Fixed names of languages in ligature table for latn "w/i". - This fixes a crash when FontForge opened the ttf table - - Motivated by bug crashing FontForge when opening ttf file, - started cleanup of useless control points. Not finished. - Got partway through Sinhala - -2008-03-31 Steve White - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoOblique.sfd, FreeSans.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Fixed various "Find Problems", including glyphs with mixed-up names, - and bad TT matrices. (lots more bad TT matrices remain) - - * FreeSerif.sfd: - - Re-named a bunch of Cyrillic letters - - * FreeSerif.sfd: - - Put above mark on Cyrillic i and double-dot i for Slavonic number forms - -2008-03-30 Steve White - * FreeSans.sfd: - - Tightened spacing on glyphs of last commit - - * FreeSans.sfd, FreeSerif.sfd: - - Concerning bug #16120, Include upper case Wynn and upper case Yogh - Adapted Herman Miller's Thyromanes letters 01F7 021C 021D for Serif - Drew my own versions for Sans. - - * FreeSerif.sfd: - - Added 04F6,7 - - * FreeSerif.sfd, FreeSerifItalic.sfd: - - Made more Cyrillic diacritics really combine. - Made a mark lookup just for Cyrillic diacritics, - Marked most of the unadorned Cyrillic alphabet. - - Still not clear on correct shapes for some of the marks. - - * FreeMono.sfd, FreeMonoOblique.sfd: - - Tweeks to accents - -2008-03-29 Steve White - * FreeSans.sfd, FreeSerifItalic.sfd: - - Small adjustments in Cyrillic - - * FreeSerif.sfd: - - Corrected small palochka - Made Cyrillic combining hundred-thousands and millions really combine - Named some combining diacriticals - - * FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd: - - Mostly adjusted horizontal spacing of mono oblique faces - - * FreeMono.sfd, FreeMonoBold.sfd, FreeMonoBoldOblique.sfd, FreeMonoOblique.sfd, FreeSansBold.sfd, FreeSansBoldOblique.sfd, FreeSansOblique.sfd, FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - More cleanup of Cyrillic ranges - - Completely re-did horizontal spacing of SerifItalic and SerifBoldItalic. - See bug #17912, poor kerning in Cyrillic oblique... - https://savannah.gnu.org/bugs/index.php?17912 - It looked like chaos to me. - Only so much can be done: the font is flawed. - But I think the changes make text readable in these faces. - - There were dozens of incorrect glyphs in higher-numbered characters. - I deleted all those I found. No glyph is better than a wrong glyph. - - Futzt with accents, shooting for consistency and readability. - - A maintenance thing: making correct references (acyrillic vs a, - although they may be the same glyph) I made a lot of headway, but - it isn't finished. - - Likewise, a large fraction of these are compound characters, which can - be made with references, resulting in easier maintenance, reduced - likelihood of errors, and smaller files. I replaced many. - - * FreeSerif.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Cyrillic italic - Added italic, bolditalic - 0493, 04a7, 04AD - because their form clearly varies in italic. But was just guessing... - - * FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Cyrillic italic - - Added italic, bolditalic - 0493, 04AD - because their form clearly varies in italic. - But was just guessing as to exact form. - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Overhaul of Cyrillic - - Italic, BoldItalic - added small yat for bug #22588 (note Times New Roman doesn't use - alternate form in Italic) - - All forms of Serif have big problems in Cyrillic. - - The ugliest is in roman. The letters, even of the Russian alphabet, are - of inconsistent height (awfully, small 0438 (ii) 0446 (tse)) - and they vary from the height of Latin - and they vary from the height of italic and bold. - They are a mish-mash of letters from several fonts, of similar (but not - quite identical) weight, and similar, (but not quite identical) size. - - I think the best solution would be to identify the face that best - matches Latin, and fill the range with that. I think this is possible - because the rarer letters seem to be better: the common letters are the - ones that are wrong. - - For now, I just increased the sized of 0438 and 0446, and 048a, 048b, - also 0459 (lje) 045A (nje) 0464 (dje) - - Other issues - -2008-03-27 Steve White - * FreeSerifBoldItalic.sfd: - - Moving all Greek capitals with accent so they don't cover previous - letter. Remedies bug #12798 - - * FreeSerif.sfd, FreeSerifBold.sfd, FreeSerifBoldItalic.sfd, FreeSerifItalic.sfd: - - Various tweeks to accented Latin letters. - Connected O-ogonek correctly - - * FreeSerifItalic.sfd: - - Accents of numerous accented Latin letters got shifted in a previous - commit. This fixes it. - - * FreeSerif.sfd: - - Adjusted combining tack left and right (0318-0319) to be above -300 EM. - - * FreeSans.sfd, FreeSerif.sfd: - - Added some "middle" marks for positioning of diacritics - - * FreeSans.sfd: - - Copied 4 enclosing combining diacriticals from Serif 20DD - 20E0 - - * FreeSerif.sfd: - - Adjusted and added some enclosing diacritics 20DD - 20E0 - In response to Debian bug #472566 - ttf-freefont: U+20DD COMBINING ENCOLSING CIRCLE doesn't combine - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=472566 - -2008-03-26 Steve White - * FreeSerif.sfd: - - Lowered a few over-high Latin accents - - * FreeSansBold: - - Devangari--only digits 1 and 2, and nothing else. Deleted - - * FreeMonoBold, FreeMonoOblique, - FreeSerifBold, FreeSeriftalic, FreeSerifBoldItalic, - FreeSansOblique, FreeSansBold, FreeSansBoldOblique: - - Got rid of dotlessj, comma in Corporate Use - Single Substitution lookup, ccmp table - Made proper dotlessj, re-linked j-circumflex - - Note: - FreeSansBold has a commaaccent in Corporate Use, used by several other - characers. Haven't done anything about this. - -2008-03-25 Steve White - * FreeSerif.sfd: - - Added/corrected glyphs for yeh hamza in Arabic, - Added init and medi lookups for yeh hamza. - -2008-03-24 Steve White - * FreeSerif.sfd: - - Added isolated and final forms for - 0629 teh marbuta - 0624 waw hamza - 0626 yeh hamza - 0649 alef maksura - A previous commit had added lookups that referred to these, - - More fiddling with super/subscripts - - * Makefile, Makefile, GenerateTrueType: - - Scripts and Make targets to generate OpenType fonts and zip file - - * maintenance.txt: - - Added gnupload and info about tagging - -2008-03-23 Steve White - * FreeSerif.sfd: - - Last of Find Problems -> ATT - 'mark' Latin lookup: afii10026 is in 'cyrl', also afii10074 - Upper and lower Cyrillic i. Just removed mark from both letters. - - 'half' Bengali lookup Khanda_Ta is in 'bng2'. Added bng2 to lookup - Added TtTable etc - - Clean-up of Points too Close through to end of font. - This episode completes the paths/points clean-up of Serif. - But note: many ranges, esp. Ethiopic, Japanese, and Indic, have way - too many points, resulting in lumpiness. - - At this point, FontForge can convert splines to quadratic, auto-hint, - and auto-instrument without segfault. - - * Makefile, sfd/Makefile, tools/GenerateTrueType: - - Alterations to build process: added a Makefile, and made to work - on my system. Now auto-hints before generating TrueType. - -2008-03-22 Steve White - * sfd/FreeSans.sfd: - Lots of additions of math characters. Should complete for - LaTeX 2e, except for extensible brackets. - -2008-03-21 Steve White - * *.sfd: - - Regularized stacking of accents in Latin Extended Additional - Changed name of 00B5 from 'mu' to 'micro', - 2206 from 'Delta' to 'Delta.math', - 0308 from 'diaerisis' to 'diaerisiscomb' - - * FreeMono.sfd: - - additions to IPA - - * FreeMonoBoldOblique.sfd: - - Moved dotlessj from Corporate Use, - Deleted commaaccent there - Fixed mis-named glyphs tcommaaccent, Tcommaaccent - Changed name of 030A from 'dieresis' to 'ringcomb' - - * FreeSans.sfd: - - Added some arrows, and a couple of blackboard bold characters - - Several characters in U+F600 Corporate Use range - dotlessj, onefitted, commaaccent - - dotlessj referred to by: jcircumflex, uni01F0: - renamed it to uFFFF, re-linked others by hand - - commaaccent - http://diacritics.typo.cz/index.php?id=9 - should be u+0326 but wasn't linked to anything - - * FreeSansBold.sfd: - - U+0617 etc: read glyphs "4GWglm". It should be Arabic. Deleted - - * FreeSansBold.sfd, FreeSansOblique.sfd, FreeSansBoldOblique.sfd: - - Removed bogus glyphs for 200C 200D, ZWJ and ZWNJ - - * FreeSerif.sfd: - - Split lookup for ligatures in latin into two classes; - ff, ffl, fl which are appropriate for all languages, - and fi, ffi, which are not appropriate in Turkish (due to distinction - between short and long i) - Needs to be done for other faces. - - Filled set of extensible brackets in Miscellaneous Technical - - Think IPA is now complete. - -2008-03-18 Steve White - * FreeSans.sfd: - - clean-up of all path issues and points too close - -2008-03-18 Steve White - * FreeSans.sfd: - - Something was causing crashing effects in Windows. Cleanup of - problems eventually made it go away. Now works well. - - Cleaned up many "points too close" - - Cleaned up all ATT problems, of which there were many and various. - - # Incorrectly labelled zero-width joiner used in a ligature - - # Incorrect substitution of dotlessi and dotlessj with i and j was - somehow connected with FontForge crash. Attemts to remove the - substitution would damage a 'ccmp' table; subsequent changes would - result in FontForge crashing on save, and truncating the sfd file. - Surgically removed with vi. - - # A couple of Indic lookups had incorrect script DFLT; one had 'latn'. - - # Don't understand why there are scripts named - dev2 bng2 grj2 gur2 when there are already deva beng gurj guru - But anyway, lots of 'vatu' 'pres' 'haln' and 'liga' lookups contained - characters in the '2' scripts but were lablled only for the 'non-2' - ones. Added the '2' scripts to all these lookups. Suspect a mistake. - - Note: several of these problems are repeated in other Sans faces. - -2008-03-16 Steve White - * FreeMono.sfd: - - Cleanup of many path problems "points too close" - - Strove to make accents Latin Extended range legible at small sizes - - Named some unnamed characters; removed a duplicate - - At this point, all fonts are passing FontForge Validate. - -2008-03-15 Steve White - * FreeSerif.sfd: - - CJK punctuation: made some of the very high glyphs smaller (under 900EM) - The brackets in Sans were very ugly, and not even Sans-serif. - Serif: added extensible square brackets, diddled with integral - corrected direction of some added glyphs - - Several bugs having to do with missing glyphs in Tamil range. - Also a buggy ligature in Devangari. - - Shortened names of many lookup tables - - Futzt with some combining diacriticals - - Added extensible square brackets. - - * FreeSans.sfd: - - Changed names of a bunch of glyphs with invalid - TrueType names, in range 0x1025f+ (not real Unicode). - Took pains to retain information contained in the names. - Wonder if these glyphs have ever been of any use. - - CJK Punctuation: brackets were hand-drawn and very ugly. Improved. - - * *.sfd: - - Set OS/2 Metrics back to absolute 900/300. Offsets are not - interpreted uniformly. - - Cleanup of many path problems up to extrema and self-intersecting - - Ordered PS Blue values. - -2008-03-14 Steve White - * FreeSerif.sfd: - - Got rid of mixed references and contours - Cleanup of many path problems "points too close" - - Started clean-up to satisfy FontForge Validate - - Changed names of three glyphs in the - Tamil ligatures range...all clearly bugs. - - * FreeSans.sfd: - - Added slanted-hyphen - - * *.sfd: - - Unified OS/2 Metrics - Added Grid Fit - -2008-03-13 Steve White - * FreeSans.sfd: - - Rearranged PS BluesValues so they were in increasing order, - Made all 20 in width. - -2008-03-12 Steve White - * FreeSans.sfd, FreeMono.sfd: - - Added TrueType hinting tables. - Fixed glyphs that didn't convert well to quadratics - Got rid of mixed contours and refs - - * FreeSerifBold.sfd: - - Cleanup of path problems - -2008-03-11 Steve White - * FreeMonoOblique.sfd: - - Cleanup of path problems - -2008-03-09 Steve White - * FreeSerif.sfd: - - Corrected L-dot - Further cleanup of path/ref problems - - Found several ligatures that referred to a missing glyph "ZWJ". - Took this to mean the "zero width joiner" u+200D - - * *.sfd: - - Changed OS/2 metrics to be absolute 900/300 - - * FreeSerifItalic.sfd: - - Added Greek lunate epsilon - - * FreeMono.sfd: - - Many additions in math range - Reduced size of binary union, intersection, vee, wedge - Corrected empty set - Corrected logical 'assert' relations, etc. 22a2-22af - Efforts to make Math glyphs legible at small point sizes - - * FreeSans.sfd: - - Added Greek lunate epsilon and rho symbol - Unstacked more stacked diacriticals - - Further cleanup of path/reference problems - -2008-03-08 Steve White - * FreeSans.sfd, FreeSerif.sfd: - - Added some "n-ary" Math operators - - * FreeSerif.sfd: - - Further clean-up of path problems...up to Ethiopic - > Started adding and correcting Math operators for LaTeX 2e - > Corrected n-ary union, intersection, and spikes to be larger - than the binary operators - > Made (many of) the operators based on + - = to use those - symbols directly (by reference or copying). - > Added lunate epsilon - > Corrected empty set - > Tightened up spacing of some other technical characters - > Worked on some more math operators involving = - > triangle - > Several arrows - > Supplemental Arrows-A - - * FreeSans.sfd: - - Clean-up of font paths - Open self-intersecting outermost-clockwise missing-extrema - also flipped references (unlinked) - - Added Greek lunate epsilon and rho symbol - -2008-03-06 Steve White - * sfd/FreeSerif.sfd: Shortened and thickened the combining hook mark, - U+0309, to make more like Unicode samples. - Also see (bug #22499) un-stacked incorrectly stacked accents - -2008-03-05 Steve White - * sfd/FreeSerif.sfd: vertical lines: combining diacritical marks - corrected 0300 030D 0329 0348 (were rendered as straight apostrophes) - Spacing Modifier letters added 02C8 02CC - 02B9 02Ba prime and double-prime - Fixed positioning U+1EC8, 9, I with hook above - -2008-03-03 Steve White - * sfd/FreeSerif.sfd: TT strings updates. - updated Copyright to 2008 - Added Vendor URL as the Savannah freefont site - * sfd/FreeMono.sfd: A standard pangram as the Sample Text for Russian - It reads: In the thickets of the South once there was a citrus - ...--yes, but a fake specimen! - * sfd/*.sfd: Set the OS/2 Sup/Sub settings, which by default looked - like random trash. - -2008-03-02 Steve White - * sfd/FreeSerif.sfd: began cleanup of problems given by FontForge - "Find Problems" feature. (bug #22454) - -2008-03-01 Steve White - * sfd/FreeSerif.sfd: made Arabic work for text display (bug #22329) - Added required contextual replacement tables, - Made a few missing characters, - * sfd/*.sfd: Removde all back layers from glyphs that had them. - -2008-02-27 Steve White - * sfd/FreeSans.sfd: filled in Combining Diacriticals - * sfd/FreeSerif.sfd: shifted whole Arabic range down by 200EM. - -2008-02-26 Steve White - * sfd/FreeSerif.sfd: enabled DPOS table. - -2008-02-24 Steve White - * sfd/*.sfd: Much fiddling with the "combining diacriticals" - range 0300-036F. Made to align with medium-size lowercase - preceding character if not using DPOS table. - -2008-02-23 Steve White - * sfd/FreeSerif.sfd, FreeSans.sfd, FreeMono.sfd: (bug #21784) Filled - in set of HTML 4 Character Entities. - - * sfd/FreeSerif.sfd, FreeSans.sfd, FreeMono.sfd: (bug #18413) - undertie too low -- went on to tidy other similar characters in - Combining Diacriticals range. - -2008-02-21 Steve White - * sfd/*.sfd: Moved capital Greek letters with tonos so tonos doesn't - cover preceding letter (bug #12798) - - * sfd/FreeSerif.sfd, FreeSans.sfd: (bug #13370) made extended - integrals to line up. - -2008-02-20 Steve White - * sfd/*.sfd: started removing glyphs with back layers (printing bug) - * sfd/*.sfd: adjusted vulgar fractions (bug #17756) - * sfd/*.sfd: adjusted numerical superscripts (bug #20278) - -2008-02-18 Steve White - * sfd/FreeSerif.sfd: Offset Hiragana and Katakana ranges (bug #22326) - * sfd/FreeSerif.sfd: U+30FB, KATAKANA MIDDLE DOT to be full width - (bug #18326) - - * sfd/FreeSerif.sfd: Re-promoted - ff ffi ffl fi fl - as standard ligatures in Latin. - -2008-02-17 Steve White - * sfd/*.sfd: committed to FontForge Spline Font Database (SFD) 2 - format. - -2008-02-10 Steve White - * sfd/*.sfd: brought into line with Debian ttf-freefont - Deleted a couple of patches, and applied those applied to Debian. - -2006-09-20 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * INSTALL: added installation procedure for MacOS X, courtesy - Philipp Kempgen. - -2006-05-04 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd: deleted Russian sample text, which did not - conform to UTF-7. - -2006-04-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: corrected U+10D3. - - * sfd/FreeSans.sfd: ligature U+FB06 (LATIN SMALL LIGATURE S T) - changed from mandatory ("liga") to discretionary ("dlig") (bug - #16253). - - * sfd/FreeMono.sfd: deleted incomplete glyph U+FB06 (LATIN SMALL - LIGATURE S T); deleted U+FB00, U+FB01, U+FB02, U+FB05 as - ligatures (bug #16253). - - * sfd/FreeMonoOblique.sfd, sfd/FreeMonoBoldOblique.sfd: added - U+FB00; deleted U+FB01, U+FB02 as ligatures (bug #16253). - - * sfd/FreeMonoBold.sfd: deleted U+FB00, U+FB01, U+FB02 as - ligatures (bug #16253). - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd: added Georgian letters, donated by - Gia Shervashidze - -2006-02-22 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd: ligature U+FB4F - changed from mandatory ("liga") to discretionary ("dlig"). This is - respons to Bug#349657: [bug #15792] Freefont Alef and Lamed - combine - -2006-02-21 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBoldOblique.sfd, - sfd/FreeSansBold.sfd: ligature U+FB4F changed from mandatory - ("liga") to discretionary ("dlig"). This is respons to Bug#349657: - [bug #15792] Freefont Alef and Lamed combine - - * sfd/FreeSerif.sfd: corrected bug#275759: [bug #15790] FreeSerif - glyphs for U+2198/U+2199 were reversed. - -2006-02-15 Denis Jacquerye <moyogo@gmail.com> - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeMonoBold.sfd: removed ij - and IJ ligatures. - -2006-02-10 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: added small Georgian letters (mkhedruli), - donated by Gia Shervashidze - - * AUTHORS: Added Gia Shervashidze - - * CREDITS: Added Gia Shervashidze - -2006-01-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * notes/maintenance.txt: Added information on the Makefile now - used; username for FTP login is anonymous. - - * sfd/FreeSansBold.sfd: added U+0569, U+0571, U+0579, U+057B, - U+0586. Armenian small letters completed. - - * sfd/FreeSerif.sfd: added U+0297, U+02AD-02AF. IPA Extensions - section is now complete. Copied a dozen of glyphs from Omega IPA - to Phonetic Extension section. - -2006-01-25 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+01A, U+01A3, U+01A6, U+01B2, U+01BA, - U+01BB, U+01BE, U+01BF. - - * sfd/FreeSans.sfd: aligned small Armenian letters to x-height in - response to bug #15480. Armenian in Free Sans needs a major - cleanup. - -2006-01-24 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: changed U+0452, U+045B. Cleanup: U+0460, - U+0461, U+04Bc, U+04BD, U+0508. - - * sfd/FreeSansOblique.sfd: replaced accented chars in Latin-1 and - Latin Extended-B sections with references, where possible. - - * sfd/FreeSerif.sfd: changed U+0285. - -2006-01-23 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+0195, U+01AA, U+0297, U+03D7, - U+03F0. Several flipped references replaced by outlines. - - * sfd/FreeSansOblique.sfd: Latin Extended-B section more or less - brought in sync with FreeSans. - - * sfd/FreeMonoBoldOblique.sfd: added glyphs from FreeMonoBold in - the Latin Extended-B and IPA Extensions sections. - - * sfd/FreeSerifBold.sfd: Added U+0224, U+0225. Changed U+01B7, - U+01B8, U+04E0, U+0452, U+045B. Replaced accented characters in - the Cyrillic region with references. - -2006-01-21 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+0255, U+0264, U+0277, U+0286, - U+029D. Changed U+0261. Deleted spurious glyphs in the control - code area. - -2006-01-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: replaced Hardip Pannu Singh's Gurmukhi with - AnmolUni by Kulbir Singh Thind. - -2006-01-17 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd: Added U+018D, U+0194, U+01B5, U+01B6, - U+01BE, U+0262, U+02A2. - - * sfd/FreeSansBold.sfd: Changed U+0261 in order to distinguish it - from U+0067. Changed U+0251, U+0252. - - * sfd/FreeSerifBold.sfd: Small changes in the Cyrillic - section. Added U+0183, U+018C. - - * sfd/FreeSans.sfd: Added U+2045, U+2046. - - * sfd/FreeSansBold.sfd: Filled in the Gurkmukhi part with the - AnmolUni-Bold by Kulbir Singh Thind. Also some minor corrections - in the Cyrillic part. - - * CREDITS: Added Kulbir Singh Thind. - - * AUTHORS: Added Kulbir Singh Thind. - -2006-01-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: Thomas Ridgeway's Tamil characters replaced - by the ones released by the Samyak font project. - - * CREDITS: Added Pravin Satpute, Bageshri Salvi, Rahul Bhalerao - and Sandeep Shedmake - - * AUTHORS: Added Pravin Satpute, Bageshri Salvi, Rahul Bhalerao - and Sandeep Shedmake - -2006-01-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd, sfd/FreeMonoBoldOblique.sfd: minor changes. - -2006-01-05 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd: added cedi sign U+20B5, Ghanaian - currency - -2005-12-29 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: minor cleanup in the Gujarati part. - -2005-12-22 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: Devanagari and Gujarati parts cleared; once - again merged with Gargi 1.9 and Padmaa 0.6, this time correctly so - that the anchor points survived the merger. - -2005-12-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+0577. - -2005-12-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+0559, U+055F, U+2024. - - * sfd/FreeSansBold.sfd: added U+056E, U+0573. - -2005-12-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: Merged with Gargi 1.9 and Padmaa 0.6, - courtesy Monika Shah and Sonali Sonania from C-DAC, Mumbai. - - * CREDITS: Added Monika Shah and Sonali Sonania. - - * AUTHORS: Added Monika Shah and Sonali Sonania. - -2005-12-13 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Removed Sinhala glyphs. - - * sfd/FreeSerif.sfd - Added Sinhala glyphs, formerly in FreeSans. - -2005-12-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: added U+20AF, U+211E. Changed U+20AC (EURO - SIGN). - - * tools/freefont-ttf.spec: Added specification file for building - RPM package, courtesy Rok Papez. - - * sfd/FreeSerifBold.sfd: added more glyphs from Txfonts to the - Arrows and Mathematical Symbols ranges. - - * sfd/FreeSerifBoldItalic.sfd: added U+03F5 from Txfonts. - -2005-12-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: added U+0567, U+056A, U+056C, U+0582. - - * sfd/FreeSerifBold.sfd: copied Box Drawing range from FreeSans. - - * sfd/FreeSerifBold.sfd: added glyphs from Txfonts to the Arrows - and Mathematical Symbols ranges. - - * sfd/FreeSerif.sfd: added U+2259-225A, U+22BA, U+2308-230B, - U+2322-2323. Cyrillic composite characters replaced with - references. - -2005-12-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd: added U+025A, U+025D, U+026B, U+029B, - U+02AE, U+02AF, U+02DE. - - * sfd/FreeSerifBold.sfd: updated Hebrew part with Drugulin font - from the Culmus project. - - * sfd/FreeSerif.sfd: added U+207A-207C, U+208A-208C, U+2215-2216. - - * sfd/FreeSans.sfd: added U+2320 TOP HALF INTEGRAL, U+23AE - INTEGRAL EXTENSION, U+2321 BOTTOM HALF INTEGRAL (bug #13370). - -2005-12-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd: added U+0294-0296, U+02A1-02A2. Started - adding "below" anchors. Performed hinting on characters that were - not hinted "en masse". - -2005-12-06 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: fixed some more metrics problems in the - Extended Greek area; performed hinting on characters that were not - hinted "en masse". - - * Makefile: clean also signature files. - - * sfd/FreeMonoBoldOblique.sfd, sfd/FreeMonoBold.sfd: cosmetic - changes; cleaning background of referenced composed characters. - -2005-12-05 Panayotis Katsaloulis <panayotis@panayotis.com> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd: Some changes to the greek glyphs, - mostly having to do with "tonos" (accent) - -2005-12-05 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: minor cosmetic changes. - - * sfd/FreeSans.sfd: adjusted widths of characters in the Extended - Greek range; accents are not any more considerably overhanging on - the left side. Added U+1EDA-1EE3, U+1EE8-1EF1. - - * sfd/FreeSans.sfd: continued working on Extended Greek range; - metrics still not finished. - -2005-12-03 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd: fixed combined Greek accents (bug - #12800). Width of characters still need to be adjusted as in - FreeSerif. - - * sfd/FreeSerif.sfd: fixed positions of Greek accents (bug #12798). - - * CREDITS: Added Panayotis Katsaloulis. - - * AUTHORS: Added Panayotis Katsaloulis. - - * Makefile: minor changes; now creating also a tarfile with sfds. - -2005-12-01 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifItalic.sfd: added U+0183, U+018C, U+01C0, U+01C1, - U+01C3, U+01E0, U+01E1, U+01F8, U+01F9. - - * Makefile: created a Makefile to assist building. - - * README: an update. - - * COPYING: added GNU General Public License, version 2. - - * tools/GenerateTrueType: wrote a FontForge script for conversion - to TrueType. - - * sfd/FreeSerif.sfd: merged with SolaimanLipi Bangla OpenType font - from www.ekushey.org, courtesy Solaiman Karim. - - * sfd/FreeSerifItalic.sfd: merged with SolaimanLipi Bangla - OpenType font from www.ekushey.org, slanted by 15.5 degrees. - - * sfd/FreeSans.sfd: merged with Rupali Bangla OpenType font from - www.ekushey.org - - * sfd/FreeSansOblique.sfd: merged with Rupali Bangla OpenType font from - www.ekushey.org, slanted by 12 degrees. - - * CREDITS: added Solaiman Karim - - * AUTHORS: added Solaiman Karim - -2005-11-30 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd: merged with the Rachana Normal. - - * AUTHORS: added K.H. Hussain and R. Chitrajan - - * CREDITS: added K.H. Hussain and R. Chitrajan - -2005-11-23 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - cleaned some background images. - - * sfd/FreeSans.sfd - added U+01A0-01A1, U+01AF-01B0, U+026E, - U+028F, U+0291, U+02A3-02A5, U+031B. Modified U+0198. - -2005-11-22 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added U+2504-250B. - - * sfd/FreeSans.sfd - added U+2591-25A1, U+25A3-25A5, U+25AA, U+25AC. - - * sfd/FreeSans.sfd, sfd/FreeSansBold.sfd - added U+0263. - -2005-11-21 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - corrected positions of some Greek diacritics - on page 0x1F. - - * sfd/FreeMonoOblique.sfd - working on bringing it in sync with - FreeMono.sfd. - - * sfd/FreeSerifBoldItalic.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. Added a couple of - glyphs in the IPA Extensions region. - - * sfd/FreeSansBold.sfd - added U+0574, U+0576. Removed overlaps. - -2005-11-20 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - added U+02AA-02AC, U+02B0-02B2. - -2005-11-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added U+01B7-01B9, U+0196, U+019A, U+01C3, - U+0224-0225, U+025E, U+029A, U+2422. Changed U+0184-0185, U+0192, - U+01B4, U+0282, U+0284. - -2005-11-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - added U+02EE, U+207F. - - * sfd/FreeSans.sfd - started Box Drawing area. - -2005-11-17 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd - added glyphs from the Omega project to - Latin Extended-B, IPA Extensions and Greek ranges. - - * sfd/FreeSerifBoldItalic.sfd - added glyphs from the Omega - project to Latin Extended-B, IPA Extensions and Greek ranges. - - * sfd/FreeSerifItalic.sfd - added glyphs from the Omega - project to Latin Extended-B, IPA Extensions and Greek ranges. - - * sfd/FreeSerifItalic.sfd - added U+018B, U+025C, U+0265, U+026F, - U+0279, U+0287, U+028C-028E, U+029E. - - * sfd/FreeSerifBoldItalic.sfd - added U+1EDA-1EE3, U+1EE8-1EF1, - U+2190-219B, U+219E-21A8, U+21B9-21BA, U+21C4-21CA, U+21E4-21E5, - U+2669-266F. MES-1 compliant. - - * sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSansOblique.sfd, - sfd/FreeSansBold.sfd, sfd/FreeSansBoldOblique.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - added U+FFFD. - - * sfd/FreeSerif.sfd - removed overlaps in Latin Extended-B and IPA - Extensions ranges. - -2005-11-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifItalic.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. - - * sfd/papers/eurotex2003/freefont.tex, - sfd/papers/eurotex2003/freefont.bib - Revised version, sent back - by Karl Berry on 20050110, that should match the one published in - TUGboat. - - * sfd/FreeSerifItalic.sfd - started added accent anchors. Added a - handful of Greek letters from Omega font collection. - - * sfd/FreeSerif.sfd - added a handful of letters in the Latin - Extended-B and IPA Extension ranges from the Omega font collection. - -2005-11-16 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSerif.sfd - moved U+0263 to U+0264; added U+0263 - - * sfd/FreeSerifItalic.sfd - fixe U+01EE; added U+01B7-U+01B9 - -2005-11-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Made small Greek letters the same height as - Latin and Cyrillic ones and replaced them with references, where - applicable. - - * sfd/FreeSerif.sfd - replaced Greek letters with references, - where applicable. Added U+03D7, U+03F0-03F2. - - * sfd/FreeSerif.sfd - added U+0255, U+025A, U+025D, U+025F, - U+0262-0263, U+026B-026C, U+0274, U+0276-0277, U+028F, U+0291, - U+029D. - - * sfd/FreeMonoOblique.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. Added U+F6BE. - - * sfd/FreeSansOblique.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. - - * sfd/FreeSans.sfd - changed U+01A5. - -2005-11-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - applied the sequence suggested by Werner - Lemberg for reducing redundant points. Replaced accented glyphs in - the Latin-1 and Latin Extended-A areas with references. Made - capital Greek letters the same height as Latin and Cyrillic ones - and replaced them with references, where applicable. - -2005-11-15 Denis Jacquerye <moyog@gmail.com> - - * sfd/FreeSans.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSansOblique.sfd - fixed - U+026A, it was a dotlessi and therefore like U+0069 when - accented. - -2005-11-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoBold.sfd - corrected Greek tonos (slanted instead of - a vertical line). - - * sfd/FreeMonoBoldOblique.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. Replaced accented - glyphs in the Latin-1 and Latin Extended-A areas with references. - -2005-11-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - Added 2005 in copyright info. - - * sfd/FreeSansBoldOblique.sfd - applied the sequence suggested by - Werner Lemberg for reducing redundant points. Replaced accented - glyphs in the Latin-1 area with references. - - * sfd/FreeSansBoldOblique.sfd - added U+0180, U+0184, U+0185, - U+0195, U+01A0-01A2, U+01AF-01B0, U+025E, U+026E, U+0292, - U+0294-0296, U+029A, U+02A1, U+2126-2127, U+2190-219B, - U+219E-21A8, U+21C4-21CA, U+2669-266F. MES-1 compliant. - - * sfd/FreeMono.sfd - Replaced accented glyphs in the Greek and - Cyrillic areas with references. - - * sfd/FreeMonoBold.sfd - applied the sequence suggested by Werner - Lemberg for reducing redundant points. Replaced accented glyphs in - the Latin-1 and Latin Extended-A areas with references. - -2005-11-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - applied the sequence suggested by Werner - Lemberg for reducing redundant points. - - * sfd/FreeSansBold.sfd - added U+219A, U+219B, U+2669-266F. - - * sfd/FreeSerifBold.sfd - added U+2669-266F. - -2005-11-12 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - added U+0180, U+0181, U+0183, U+0187, - U+0188, U+018A, U+018C, U+018D, U+0193, U+019C, U+01A0, U+01A1, - U+01AC, U+01AF, U+01B0, U+025C, U+0260, U+026E, U+0277, U+0281, - U+0284. - -2005-11-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - added U+195, U+1A6, U+025E, U+026E, - U+029A, U+0313, U+0314, U+0342, U+0344, U+0345. Started adding - accent anchors. - - * sfd/FreeMono.sfd - applied the sequence for reducing redundant - points, suggested by Werner Lemberg. - - * sfd/FreeMono.sfd - corrected Greek letters (using tonos instead - of a vertical line). Added U+026E, U+F6BE. Accented characters in - Latin 1, Latin Extended A and partly Latin Extended B replaced by - references. - - * sfd/FreeSerifBold.sfd - applied the sequence for reducing - redundant points, suggested by Werner Lemberg. Added U+01A5, - U+02A0, U+2190-219B, U+219E-21A8, U+21B8, U+21B9, U+21C4-21CA, - U+21E4, U+21E5. - -2005-11-10 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansOblique - changed U+0192, U+01A5; added U+01C0-01C3. - - * sfd/FreeSansBold.sfd - replaced glyphs with references in the - Cyrillic area. Removed U+04A8, U+04A9. Added U+04C5, U+04C6, - U+04C9, U+04CA, U+04CD, U+04CE, U+0535, U+053F, U+0546, U+0565, - U+0584, U+0587, U+0589. - -2005-11-10 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSans.sfd - added U+028A-U+028B - - * sfd/FreeSansOblique - added U+028A-U+028B, U+0276, - U+0292, U+0294-U+0296, U+0298-U+0299 and U+029B; fixed some - other glyphs - -2005-11-10 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - added U+01A6. Simplified outlines in the - ASCII range. - - * sfd/FreeSansBold.sfd - added U+00A0, U+00AD, U+0531, U+2126, - U+2190-2199, U+219E-21A8, U+21C4-21CA. - - * sfd/FreeSansBold.sfd - applied the sequence for reducing - redundant points, suggested by Werner Lemberg. Added automatically - constructed accented characters in page 0x1E. - -2005-11-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - added U+0183, U+018C. - - * sfd/FreeSans.sfd - added U+1EA2, U+1EA3, U+1EA8, U+1EA9, U+1EB2, - U+1EB3, U+1EBA, U+1EBB, U+1EC2, U+1EC3, U+1EC8, U+1EC9, U+1ECE, - U+1ECF, U+1ED4, U+1ED5, U+1EE6, U+1EE7, U+1EF6, U+1EF7, U+220A, - U+220B, U+220D, U+2272, U+2273, U+2282, U+2283. - - * sfd/FreeSerifItalic.sfd - changed U+03D5. - - * sfd/FreeSerifBoldItalic.sfd - changed U+03C6; added U+2070, - U+2075-2079, U+207F, U+2080, U+2085-2089, U+2155-217F. - - * sfd/FreeSerif.sfd - added U+0184, U+0185, U+018D, U+0195, - U+0197, U+019A, U+019B, U+01A0, U+01A1, U+01AC, U+01B5, U+01B6, - U+01C0, U+01C1, U+01C3, U+01F6, U+0294-0296, U+1E9A, U+1EDA-1EE3, - U+1EE8-1EF1. - -2005-11-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - added U+0562, U+056D. U+0575. - - * sfd/FreeMono.sfd - added U+0589. - -2005-11-06 Primoz Peterlin <peterlin@localhost.localdomain> - - * sfd/FreeSans.sfd - added U+0278, U+03D5, U+2248. Corrected - U+2071, U+222E, U+2242, U+2243 in response to bug reports - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276118 - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276120 - - * sfd/FreeMono.sfd - added U+2227, U+2228, U+2262. Corrected - U+2299-229D in response to bug report - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=276121 - - * sfd/FreeMonoBold.sfd - added U+2010, U+2012 in response to bug - report http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=289032 - Swapped U+03C6 (Greek small letter phi) and U+03D5 (Greek phi - symbol) in order to conform to Unicode standard. Simplified glyph - shapes in ASCII range. Started adding "above" and "below" anchors. - -2005-11-05 Primoz Peterlin <peterlin@localhost.localdomain> - - * sfd/FreeSerif.sfd - accented letters in Latin Extended-A - replaced by references wherever possible. - - * sfd/FreeSerif.sfd - added U+0180, U+0181, U+0187, U+0188, - U+018A, U+0193, U+019C, U+01A4, U+01A5, U+01A7, U+01A8, U+01AF, - U+01B0, U+026E, U+0270, U+0278, U+0280, U+0281, U+028B, U+0299, - U+029C, U+029F. - -2005-11-03 Primoz Peterlin <peterlin@localhost.localdomain> - - * sfd/FreeSansBold.sfd - added U+0180, U+0184, U+0185, U+0192, - U+019B, U+01A0-01A2, U+01AF, U+01B0, U+01EE, U+01EF, U+0292, - U+0294-0296, U+02A1, U+0532, U+054C, U+057C, U+222B. Changed - U+014B, U+01A5, U+01B4, U+03BB. - - * sfd/FreeSans.sfd - added U+04C5, U+04C6, U+04C9, U+04CA, U+04D, - U+04CE. - - * sfd/FreeSansBold.sfd - cleaner Arabic outlines. Added U+01E4, - U+01E5. - -2005-11-02 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - started Armenian; added U+0538, U+0542, - U+0544, U+0548, U+054D, U+054F, U+0550, U+0553, U+0555, U+0561, - U+0563, U+0564, U+0566, U+0568 U+056B, U+056F, U+0570, U+0572, - U+0578, U+057A, U+057D-057F, U+0580, U+0581, U+0583, U+0585. - - * sfd/FreeMono.sfd - swapped U+03C6 (Greek small letter phi) and - U+03D5 (Greek phi symbol) in order to conform to Unicode standard. - Added U+04C5, U+04C6, U+04C9, U+04CA, U+04D, U+04CE. - -2005-11-01 Primoz Peterlin <peterlin@localhost.localdomain> - - * sfd/FreeSansBold.sfd - modified U+019C. - - * sfd/FreeSansBoldOblique.sfd - added U+00A0, U+00AD, U+019C, - U+01B7, U+01B8, U+0275, U+0278, U+0298, U+2012, U+2015, - U+2070-207F, U+2080-208E, U+2153-217F, U+2213, U+2215. - -2005-10-31 Primoz Peterlin <peterlin@localhost.localdomain> - - * sfd/FreeSerif.sfd - added U+0199, U+01AB, U+0265, U+0282, - U+0288, U+028C-028E, U+0290, U+029E, U+02A0. - -2005-10-28 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd - added U+019E, U+01AB, U+01AD, U+01B1, - U+0256, U+025F, U+0265, U+0269, U+026F, U+0270, U+0279-027F, - U+0282, U+0287, U+0288, U+028C-028E, U+0290. - - * sfd/FreeSerifBold.sfd - added U+2070, U+2075-2079, U+2080, - U+2085-2089, U+2153-215E, U+2113-2115, U+2119. - - * sfd/FreeSerifBold.sfd - added U+0199, U+019B, U+01B8, U+01B9, - U+01BE, U+01C0, U+0262, U+0274, U+0278, U+0280, U+028F, U+0298, - U+0299, U+029C, U+029E, U+029F, U+2012, U+2015, U+2016, U+2129, - U+2217. - -2005-10-27 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added U+018D, U+0194, U+019B, U+019C, U+01B5, - U+01B6, U+0295, U+0296, U+029B, U+02A2, U+0472, U+0473, U+2114, - U+2119. - - * sfd/FreeSerifItalic.sfd - minor cleanup in the superscript range - (U+2070-2079). - - * sfd/FreeSansBold.sfd - added subscripts and superscripts - (U+2070-208F), completed fractions (U+2152-215F) and Roman - numerals (U+2160-217F). - - * sfd/FreeSerifBold.sfd - added U+018B, U+018E, U+018F, U+0191, - U+019D, U+01A7, U+01A8, U+01AE, U+0253, U+0266, U+0267, U+026A, - U+0271-0273, U+0283, U+0285. - -2005-10-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added "above" anchors to selected Cyrillic - characters. Added U+0294, U+02A1. - - * sfd/FreeMono.sfd - added U+2011, U+2012, U+203B, U+204A, U+2071, - U+2129, U+2232, U+2233. Changed and/or corrected U+2106, U+211E, - U+2126, U+2127, U+2153-215F, U+2202. - - * sfd/FreeMono.sfd - a try to imitate Denis' work on adding - anchors by adding "above" anchor to a couple of basic Latin - characters. - - * sfd/FreeSansBold.sfd - added U+0278, U+0298. Cleaned up outlines - of most Greek letters. - - * sfd/FreeSansBold.sfd - Added U+2010-2012, U+2015, U+2032, - U+203C, U+2047-2049. - - * sfd/FreeSans.sfd - Added U+01C0-01C2, U+0276, U+0292, - U+0298. Changed U+0251, U+0294, U+02A1. - -2005-10-25 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifItalic.sfd - added U+00A0, U+00AD, U+2010-2012, - U+2015, U+2126, U+2127, U+2153-215E, U+2160-217F, U+2190-2193, - U+2669-266F. FreeSerifItalic is now MES-1 compliant. - - * sfd/FreeSerif.sfd - added U+0191, U+019D, U+01AE, U+027E, - U+027F, U+0283, U+0285. - - * sfd/FreeSerif.sfd - added U+019E, U+01AD, U+01B8, U+01B9, - U+0253, U+0256, U+0257, U+025C, U+0260, U+0266, U+0267, U+0269, - U+026D, U+0271-0273, U+0279-027D. - - * sfd/FreeSerifBoldItalic.sfd - added U+00A0, U+00AD, U+2010-2012, - U+2015, U+2032-2034, U+203C, U+2047-204A, U+2074, U+2081-2084, - U+2126, U+2153, U+2154, U+215F, U+2215. Corrected positions of - diacritics on U+0200-0217. - - * sfd/FreeSansOblique.sfd, sfd/FreeSans.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeMonoBoldOblique.sfd, - sfd/FreeMonoBold.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBold.sfd sfd/FreeSerifBoldItalic.sfd - brought in - sync with Valek Filipov's urw-fonts-1.0.7pre41. - - * sfd/FreeSansOblique.sfd - added U+00A0, U+2011-2012, U+2015, - U+2070, U+2071, U+2074-2079, U+2080-2089, U+2126, U+2153-215F, - U+2190-2195, U+2215, U+266A. FreeSansOblique is now MES-1 - compliant. - -2005-10-24 Denis Jacquerye <moyogo@altern.org> - - * sfd/FreeSans.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBoldOblique.sfd - added - ccmp for i and j to be substituted with dotless i or j when - followed by above diacritic - -2005-10-24 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added U+2011, U+2012, U+2015. FreeSans is now - MES-1 conformant. - -2005-10-23 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSans.sfd - added above, below, abovemk and belowmk - anchors for diacritics placement to many Basic Latin characters, - some Latin Extented A and B, and some IPA characters; fixed a - couple of precomposed characters to have diacritics at the same - height as similar characters. - -2005-10-21 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - added U+02B9, U+02BA, U+02CD, U+2017, - U+2036, U+2037, U+203C, U+203E, U+2047-204A. - -2005-10-20 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd - added U+0182, U+0189, U+0192, U+019F, - U+01A9, U+01B7, U+01C4-01CC, U+01E0-1E2, U+01F0-01F3, U+F6BE. - Corrected position of diacritics on U+0200-0217. - - * sfd/FreeSerif.sfd - added U+00A0, U+00AD, U+0182, U+0189, - U+018B, U+018E, U+018F, U+0192, U+019F, U+01A9, U+01B1, U+01B7, - U+01DD, U+2010-2013, U+2015. FreeSerif is now MES-1 conformant. - -2005-10-19 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSerif.sfd - added U+0268, U+026A, U+0289, U+0292; and - anchor "above" to more base glyphs. - - * sfd/FreeSerifBold.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBoldItalic.sfd - added U+0250-0252, U+0258-0259, - U+0261, U+0268, U+026A, U+0279, U+0289 - - * sfd/FreeSerifBold.sfd - added anchor "above" to marks - U+0300-0314, and to base glyphs (vowels). - -2005-10-18 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSerif.sfd - added anchor "above" to marks U+0300-0314, - and bases vowel of the U+0041-007A range, U+00E6, U+0186, U+0190, - U+0254 and U+025B; fixed Latin-1 Supplement block accented glyphs - to use references. - -2005-10-17 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - added U+01B7, U+01B8, U+0275. - -2005-10-16 Denis Jacquerye <moyogo@gmail.com> - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd - added some Latin - Extended-B African letters: U+0181, U+018A, U+0197-0198, U+01A4, - U+01AC, U+01B1, U+01B3-01B4; - - * sfd/FreeSansBold.sfd, sfd/FreeSansBoldOblique.sfd - added Latin - Extended-B U+0187, 018E-018F, U+0191, U+0193, U+0197-0199, - U+019D-019F, U+01AB-01AE; correcting width of non-space - Combining Diacrtical Marks; added more glyphs to IPA Extensions - to match non Bold - - * sfd/FreeSansBoldOblique.sfd - added many accented glyphs to - Latin Extended-B - -2005-10-15 Denis Jacquerye <moyogo@gmail.com> - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd - added IPA Extensions - U+0262,U+0274,U+0280-0281, U+0299, U+029F, and Spacing Modifier - Letters U+02C9-02CB; fixed U+0287,029E height to baseline; added - stroke to U+0268 - - * sfd/FreeSansOblique.sfd - fixed skew on U+027F - - * sfd/FreeSansBold.sfd, sfd/FreeSansBoldOblique.sfd - added to Latin - Extended-B U+01A7-01A8, IPA Extensions U+0251-0253, U+0256-0257, - U+0261, U+0265-026A, U+026F-0273, U+0289, U+028C-028E - - * sfd/FreeSansBoldOblique.sfd - added to Latin extended-B U+0189, - U+01A8, U+01B1, U+0283, U+02C9 and Spacing Modifiers U+02C9-02CB - -2005-10-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - Added a couple of composite glyphs, - mostly in the IPA and Latin Extended B ranges. - -2005-10-13 Denis Jacquerye <moyogo@gmail.com> - - * FreeSans.sfd - removed overlap and simplified U+0187, 0191, - 0193, 01A5, 01AE, 0260, 0271, 0272, 0273, 027B; fixed diacritics - placement on U+0200-0217; fixed glyph for U+0283 to correct esh - without stroke; added U+025F and fixed U+025F from it; fixed - height of glyph at U+0285; arranged U+027E,027F to make more - distinguishable from U+0072. - - * FreeSansOblique.sfd - added the corrected or new glyphs from - FreeSans; diacritics on U+200-0217 will need height readjustements. - - * FreeSansBold.sfd, FreeSansBoldOblique.sfd - added U+0186, 0190, - 0250, 0254, 0258, 0259, 025B, 025C - -2005-10-13 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Minor changes: U+22A2, U+22A3, U+22A6, U+23AE. - Added U+0250, U+0251, U+0258, U+0259, U+0275. - - * sfd/FreeSerifItalic.sfd - Added glyphs U+222B-U+222F, U+2320, - U+2321. Fixed diacritics on U+0200-U+0217. - -2005-10-12 Denis Jacquerye <moyogo@gmail.com> - - * sfd/FreeSerif.sfd - Corrected diacritics position on - U+01D5-01D9,01DB,01EA-01ED,0200-0217 and U+022A. - - * sfd/FreeSerif.sfd, sfd/FreeSerifBold.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBoldItalic.sfd - added U+0186,0190,0254 and U+025B. - -2005-10-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Fixed bug #13399 (glyphs for U+0360 and - U+0361 were swapped). - - * sfd/FreeSerif.sfd - Attempt to correct bug #13370: INTEGRAL - EXTENSION does not align with TOP/BOTTOM HALF INTEGRAL; added - glyph U+23AE. - -2005-05-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Corrected shapes for Cross of Lorraine and - Cross of Jerusalem. - -2005-04-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSansBold.sfd - Added some combining accents, just to - test the a version of FontForge. - -2003-12-05 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Some composite Latin characters rebuilt, as - they had accents 600 points to the left due to changes on October - 2. Some other minor changes in the mathematics area. - -2003-10-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoOblique.sfd, sfd/FreeSerifBoldItalic.sfd, - FreeSerifItalic.sfd - applied Josef Segur's corrections from - Oct. 5. - -2003-10-02 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Abbas Izad's contributed Arabic/Farsi - characters added. - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - Combining characters (U+0300 - - U+036F) moved left, so that they have negative horizontal values - and zero advance width. - -2003-09-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBold.sfd, sfd/FreeSerifItalic.sfd - Started working - on super- and subscripts. - -2003-09-12 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd, sfd/FreeSerif.sfd - Added some missing - Hiragana and Katakana characters. - - * sfd/FreeSansBold.sfd - Cleared background characters in Latin - Extended-A. Added some automatically constructed characters in - Latin Extended-B. Started with superscripts and subscripts. - - * sfd/FreeSans.sfd - Subscript numerals (U+2080-U+2089) completed. - -2003-05-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Thai characters po pla and bo baimai - swapped; Thai character fongman corrected; all courtesy Theppitak - Karoonboonyanan. - -2003-05-17 Panayotis Katsaloulis <panayotis@panayotis.com> - - * sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - Full support - of all ancient greek glyphs - -2003-05-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * tools/KerningNumerals.pl - A Perl script for moving kerning - information from ASCII numerals (U+0030...) to characters in the - Adobe corporate use area (U+F6xx). - - * sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd, - sfd/FreeSansBoldOblique.sfd - Created kerned numerals in the Adobe - corporate use area (U+F6xx) and moved kerning information from - ASCII numerals to the kerned numerals. - -2003-05-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - First approximation of super- and subscript - numerals and vulgar fractions. - - * sfd/FreeSerif.sfd - Super- and subscript numerals complete, - vulgar fractions completed and redone as references rather than - outlines. - -2003-05-12 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Clean-up of the Cyrillic letters added on - March 27; super- and subscripts, vulgar fractions. - -2003-05-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoBold.sfd - Added a couple of characters to - the Latin Extended-B area and the IPA extensions area. - -2003-05-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifBoldItalic.sfd - Added a couple of characters to - the Latin Extended-B area. - - * sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - ASCII - numerals now monospaced; kerned numerals moved to Adobe corporate - use area - (U+F6xx). - -2003-05-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Roman numerals now more complete. - - * sfd/FreeSansOblique.sfd, sfd/FreeSansBoldOblique.sfd - Accented - characters added in the Latin Extended-B area. - - * sfd/FreeSans.sfd - Greek accents added in the Greek Extended - area, characters added in the Latin Extended-B area, Roman - numerals added. - - * sfd/FreeMonoOblique.sfd - Kerning pairs removed (what were they - doing in a monospaced font, anyway?). - - * sfd/FreeMonoBoldOblique.sfd - Additions in Latin Extended-B and - Basic Greek. - - * sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd, sfd/FreeMonoOblique.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd, - sfd/FreeSansBoldOblique.sfd - Major cleanup (fixed widths, open - paths, path directions (clockwise/counter-clockwise), points - rounded to integer values; outlines simplified etc.) - -2003-05-06 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * tools/OS2UnicodeRange - A simple script to display OS/2 Unicode - range table in TrueType fonts. - - * sfd/FreeSans.sfd, sfd/FreeSansBold.sfd - ASCII numerals now - monospaced; kerned numerals moved to Adobe corporate use area - (U+F6xx). FreeSans is done, FreeSansBold half-way. - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - Added 2003 in copyright info. - -2003-03-27 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Cyrillic and Cyrillic Supplement blocks - brought to conformance with Unicode 3.2, courtesy Daniel Shurovich - Chirkov. - -2003-03-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd - somewhat wider - germandbls (U+00DF), due to complaints by Walter Schmidt. - -2003-03-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Added Sinhala glyphs from the Tipitaka - project <http://www.metta.lk>, recoded to Unicode by Noah Levitt. - -2003-02-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Minor changes on mathematical operators. - -2003-02-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - minor cleanup of glyph backgrounds; changed - integral signs (U+222B - U+2230) - -2003-02-05 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - added a couple of glyphs in the IPA and - African Latin ranges. - -2003-01-30 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd - Corrected Maltese Hbar (U+0126) - and/or hbar (U+0127). - -2003-01-28 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerifItalic.sfd - Corrected Maltese hbar (U+0127). - -2002-12-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * tools/ConvertFont - PfaEdit script for converting SFD files to - TrueType fonts. - - * sfd/FreeSans.sfd - Added Tamil and Kannada glyphs from the - Akruti Indic fonts. - -2002-12-17 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Added Devanagari and Gujarati glyphs from the - Akruti Indic fonts. - - * www/index.html - Added information on Rogier van Dalen's tools. - - * AUTHORS - Added M.S. Sridhar. - - * CREDITS - Correct spelling of Culmus project. Added M.S. Sridhar. - -2002-12-06 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added Braille glyphs, courtesy Vyacheslav - Dikonov. - - * sfd/FreeSans.sfd - Added Unicode Syriac glyphs, courtesy - Vyacheslav Dikonov. - -2002-10-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * www/index.html - Added information on the availability of the - Debian GNU/Linux package. - - * sfd/FreeSerif.sfd, sfd/FreeSans.sfd - added some kern pairs - beyond Latin-1 area. - - * sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - re-introduced - all the emtpy glyph slots (changes from Sep 23 made PfaEdit - crash). - -2002-09-23 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd, sfd/FreeSerifItalic.sfd, - sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd - imported - kerning information from the URW++ AFM files - -2002-09-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoOblique.sfd - updated Hebrew parts to comply with - Culmus v0.6. - - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansOblique.sfd - Added Danilo Segan's Serbian Cyrillic - glyphs; updated Hebrew parts to comply with Culmus v0.6. - -2002-09-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansOblique.sfd - Updated Cyrillic part to match - Filippov's 1.0.7pre14 - - * sfd/FreeSansOblique.sfd - added Sam Stepanyan's Armenian glyphs - from FreeSans (skewed for 12 degrees). - -2002-09-06 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd, sfd/FreeSansOblique.sfd, - sfd/FreeSansBold.sfd, sfd/FreeSansOblique.sfd - Added Maxim - Iorsh's Hebrew characters. - -2002-08-29 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, - sfd/FreeMonoBold.sfd, sfd/FreeMonoOblique.sfd - Added Maxim - Iorsh's Hebrew characters. - - * AUTHORS, CREDITS - Added Maxim Iorsh as author. - -2002-08-28 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * www/index.html - Added information of Microsoft's withdrawal of - freely available Unicode TrueType fonts - - * www/resources.html - Added link to Maxim Iorsh's Culmus project. - -2002-07-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added a couple of characters (Arrows area). - -2002-06-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Applied Michalis Kabrianis's patch concerning - perispomeni in Greek politoniko. - -2002-05-23 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Applied Michalis Kabrianis's patch concerning - psili in Greek politoniko. Also added two working variants of - chars in the IPA range. - -2002-05-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd, sfd/FreeSansBold.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifBold.sfd - Deleted explicit ".notdef" character with - no contours. - -2002-05-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - The new version of PfaEdit saves - correctly formed Panose and LineGap lines. - - * sfd/FreeSansBoldOblique.sfd - Filled-in the missing TTFWidth and - TTFWeight values. - -2002-05-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Added diacritics to the Spacing Modifier - Letters and Combining Diacritical Marks areas. Added composed - glyphs to the Latin Extended-B area. - -2002-05-07 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - Updated Panose information with data - provided by Josef W. Segur. Updated TTF headers with English and - Slovenian text. - -2002-04-30 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoBold.sfd - Working on Greek small letters. Several - minor changes (lower carons etc.) - -2002-04-29 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * FreeMonoBoldOblique.sfd - Started adding Greek. - - * sfd/FreeMonoBold.sfd - Added glyphs in the Geometrical Shapes - and Miscellaneous Symbols area. Harmonizing Greek with Latin. Done - with capitals. - - * sfd/FreeMono.sfd - Deleted the explicit .notdef character. Added - one glyph to the Geometrical Shapes area, which is now completed; - added three glyphs to the Miscellaneous Symbols area. Harmonizing - Greek with Latin. Done with the capitals. - -2002-04-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - Adjusted accent positions on several glyphs - in the Latin Extended-A area. - -2002-04-25 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoBold.sfd - Box Drawing area completed. Added a - couple of glyphs in the Geometrical Shapes area. - - * sfd/FreeMono.sfd - Small corrections in the Box Drawing area. - -2002-04-24 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Box Drawing area completed. - -2002-04-23 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * tools/WGL4.lst - corrected. - - * sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd - Working on Box Drawing - area. - -2002-04-22 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoBold.sfd - Working on Latin - Extended-B and Greek. - -2002-04-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Somewhat cleaner chess figures. - - * tools/MES-2.txt, tools/MES-2.lst - Corrected list (it is not - 203C-203E, it is 203C and 203E). - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd, sfd/FreeSans.sfd, - sfd/FreeSansOblique.sfd, sfd/FreeSansBold.sfd, - sfd/FreeSansBoldOblique.sfd, sfd/FreeSerif.sfd, - sfd/FreeSerifItalic.sfd, sfd/FreeSerifBold.sfd, - sfd/FreeSerifBoldItalic.sfd - Changed "Family Name" from Free to - FreeSerif, FreeSans and FreeMono, as appropriate. Changed Font - Modifiers from MonoBold etc. to Bold, Italic, Oblique, BoldOblique - and BoldItalic. - -2002-04-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd, sfd/FreeMonoBold.sfd, - sfd/FreeMonoBoldOblique.sfd - Corrected metrics; now all character - widths are set to 600. - -2002-04-17 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Corrected glyphs in the Box Drawing area and - Block Elements area, which should extend through the ascender *and - descender* height. - - * sfd/FreeMonoBold.sfd - Continued working on harmonizing Greek - letters with Latin and Cyrillic. - - * sfd/FreeMonoBold.sfd - Added some box drawing characters. - -2002-04-16 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * www/design-notes.html - Updated notes on stroke width for - symbols in Free Mono Bold. - - * sfd/FreeMono.sfd - Added a handful of characters in the - Miscellaneous Symbols area. - - * sfd/FreeMonoBoldOblique.sfd - Added subscripts, superscripts and - vulgar fractions. - - * sfd/FreeMonoBold.sfd - Started harmonizing Greek letters with - Latin and Cyrillic. - - * sfd/FreeMonoBold.sfd - Added subscripts, superscripts and vulgar - fractions. - -2002-04-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * www/design-notes.html - Updated notes on super-/subscripts in - Free Mono Bold. Separate subsections for Free Mono regular and - Free Mono Bold. - -2002-04-12 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Added Ethiopian glyphs, converted from the - Metafont sources from TGI, Universität Hamburg (authors Berhanu - Beyene, Prof. Dr. Manfred Kudlek, Olaf Kummer, and Jochen - Metzinger) using Szabo's TeXtrace and retouched using - PfaEdit. Ethiopian metafonts are released under GNU GPL, - <http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer/ethiop_eng.html>. - - * sfd/FreeMonoBold.sfd - Added 40 characters, mostly in the Latin - Extended-B and IPA Extensions areas. - -2002-04-11 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added a handful of characters in the Latin - Extended-B, IPA Extensions, Currency Symbols and Miscellaneous - Symbols areas. - -2002-04-09 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Correcting accent positioning in the Extended - Greek area; adding a couple of characters here and there. Still 20 - characters short of MES-2 conformance. - -2002-04-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added some characters in the Arrows area; - more or less completed Extended Greek area (accents still need to - be fine-tuned). - -2002-04-05 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Modern non-Russian Cyrilic mostly completed. - - * sfd/FreeMonoOblique.sfd - Synchronized with FreeMono. - - * sfd/FreeSerif.sfd - Added Thomas Ridgeway's Tamil characters - (converted from Metafont and edited somehwat). - -2002-04-04 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoOblique.sfd - Armenian letters added. - - * sfd/FreeMonoBold.sfd - Serbian Cyrillic letters dje, tshe, lje - and nje corrected. - - * sfd/FreeMono.sfd - Serbian Cyrillic letters dje and tshe - corrected. Some other non-Russian Cyrillic letters modified and - "welded together". - -2002-04-03 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added more or less complete Armenian - area. The glyphs are a tidied-up version based on the Armenian - Courier on the <http://www.cilicia.com/armo8.html>. Now we have - 1673 characters. - -2002-03-28 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Added some mathematical symbols. - -2002-03-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSans.sfd - took H.S. Pannu's Gurmukhi from FreeSerif. It - actually fits to FreeSans much better. It seems I'll have to look - for another Gurmukhi font with modulated stroke for FreeSerif. - - * sfd/FreeSerifItalic.sfd - replaced existing Hebrew glyphs by - those from FreeSerif (slanted for 15.5 degrees). - - * sfd/FreeSerif.sfd - Added dotted Hebrew letters. Changed barred H. - - * sfd/FreeMono.sfd - Completed vulgar fractions; minor changes in - Greek; added some mathematical operators. - - * sfd/FreeMonoBold.sfd - added 12 characters to Latin Extended-B - and IPA Extensions areas (total 984). - -2002-03-25 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMonoBold.sfd - started adding Latin Extended-B and IPA - Extensions. - - * sfd/FreeMono.sfd - Minor cosmetic changes; cleaning up Greek - (removing redundant control points), added some non-European - Cyrillic glyphs as a test. - -2002-03-22 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - Some minor modifications; letters in Latin - Extended-B area "welded" together. - -2002-03-20 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * www/index.html - finally linked the resources and design notes - pages. - - * www/design-notes.html - added scaling information for super- and - subscript numerals in FreeMono. - -2002-03-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - the Latin Extended-B and IPA Extension area - characters moved from FreeMono and skewed for 12 degrees. - -2002-03-18 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - added a dozen or two of new characters, in - particular in the Latin Extended-B and IPA Extension area. - -2002-03-15 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - added a dozen of two of new characters, in - particular in the IPA Extension area. - - * www/design-notes.html - Corrected data for x-height in FreeMono; - information on constructing small caps. - -2002-03-14 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeMono.sfd - added three smiley characters to the - Miscallaneous Symbols area. - -2002-03-10 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Anshuman Pandey has only converted Gurmukhi - from TrueType to Metafont; the original author of Gurkmukhi font - is Hardip Singh Pannu <http://members.aol.com/hspannu/punjabi.html>. - Got the permission from him to include the Gurmukhi glyph set. - -2002-03-08 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Added some more glyphs in the Mathematical - Symbols area to a total number of 3374. - -2002-03-06 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Added a basic Gurmukhi set. - - * www/design-notes.html - started a page on design notes - - * sfd/FreeMono.sfd - realized that glyphs in the Box Drawing area - and Block Elements area should extend through the ascender *and - descender* height, and corrected it. - - * sfd/FreeMono.sfd, sfd/FreeMonoOblique.sfd - added some musical - glyphs, linking "no-break space" to space, "soft hyphen" to - hyphen-minus etc. - -2002-03-05 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * tools/WGL4.lst - Added Windows Glyph List 4.0 - - * tools/LigatureList.pl - Wrote a Perl script, which lists the - GSUB list (ligature list) of a OpenType font. - - * sfd/FreeSerifBold.sfd, sfd/FreeSerifBoldItalic.sfd, - sfd/FreeSerifItalic.sfd - auxilliary Hebrew glyphs added. They are - too light compared with Latin and will be substituted with better - ones. - -2002-03-04 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Added some more glyphs to the Mathematical - Operators area (page 0x22). - - * sfd/FreeSerif.sfd - Incomplete and fragmentary support for - Devanagari, originating from Harsh Kumar's Shusha fonts was - replaced by Frans Velthuis' Devanagari metafont, now maintained by - Anshuman Pandey <apandey@u.washington.edu> and available under - GPL. Until I figure out how to provide glyph substitution table in - OpenType, only the Unicode part is there. - -2002-02-28 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * ChangeLog file created - - * sfd/FreeSerif.sfd - Added some Telugu glyphs to page 0x0C, - courtesy Prasad A. Chodavarapu <http://chaitanya.bhaavana.net/fonts/> - - * sfd/FreeSerif.sfd - Added some glyphs to the Miscellaneous - Symbols page (0x26). - -2002-02-26 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * mailing lists freefont-announce and freefont-bugs created - -2002-02-25 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/FreeSerif.sfd - Added a couple of glyphs in Mathematics - Operators area. - - * sfd/FreeMono.sfd - - Added some more glyphs, in particular in the Mathematical - Operators section. - - Changed FamilyName to Free, FontName to FreeMono, and Full name - to "Free Monospaced". - -2002-02-20 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * sfd/ directory added containing FreeSerif, FreeSans and FreeMono - families. - - * tools/ directory added containing lists with characters required - for MES (Multilinguag European Subset) compliance. - - * tools/mes-list-expand.pl created - a Perl script for expanding MES - ranges into simple one-char-per-line format - - * tools/CheckConformance.pl created - a Perl script for checking - conformance of a font file with a given coded character set - - * homepage <http://www.freesoftware.fsf.org/freefont/> created - -2002-02-19 Primoz Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si> - - * freefont (Free UCS Scalable Fonts) project approved on - savannah.gnu.org: <http://savannah.gnu.org/projects/freefont/> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/INSTALL b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/INSTALL deleted file mode 100644 index fbbbe804b5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/INSTALL +++ /dev/null @@ -1,86 +0,0 @@ - Installing GNU FreeFont - ======================= - -GNU FreeFont can be used in any modern operating system. - -This document explains how to install FreeFont on some common systems. - -UNIX/GNU/Linux/BSD Systems --------------------------- - -FreeFont works with any system using the free font rasterizer FreeType -<http://www.freetype.org/>. - -* Debian GNU/Linux - -Users of Debian GNU/Linux system will probably want to use the Debian package, -available from the Debian site, - - <http://packages.debian.org/unstable/x11/ttf-freefont.html>, - -or any of its mirrors. - -Install them by issuing the command - apt-get install ttf-freefont - - -* KDE local installation - -Users of KDE can install .ttf files on a per-user basis using the KDE -Control Center module "kcmfontinst", which may appear in the menu as - - Settings -> System Administration -> Font Installer - -This is especially helpful for developers and testers. - - -* Generic X-windows - - 1) Fetch the freefont-ttf.tar.gz package with Free UCS outline fonts - in the TrueType format. - - 2) Unpack TrueType fonts into a suitable directory, - e.g. /usr/local/share/fonts/default/TrueType/ - - 3) If you have chosen any other directory, make sure the directory you - used to install the fonts is listed in the path searched by the X - Font Server by editing the config file in /etc/X11/. - - In some systems, you list the directory in the item "catalogue=" - in the file /etc/X11/fs/config. - - 4) Run ttmkfdir in the directory where you unpacked the fonts. - - -Windows 95/98/NT/2000/XP; Vista -------------------------------- - -Note that in at least Vista, XP and 2000, the OpenType versions perform much -better than, and are recommended over, the TrueType ones. - -* Vista: - 1) From the Start menu, open Control Panels - 2) Drag-n-drop font files onto Fonts control panel - You may get a dialog saying - "Windows needs your permission to continue" - a) Click Continue - -* 95/98/NT: - The font installation is similar to Vista. - - In order to use OpenType, users of Windows 95, 98 and NT 4.0 can - install Adobe's 'Type Manager Light'. It is available for download - without cost from Adobe's web site. - - Otherwise, use the TrueType versions. - -Mac OS X --------- - -Installing on Mac OS X consists of moving the .ttf files to either - /Library/Fonts/ or ~/Library/Fonts/ -depending on whether they should be available to all users on your system -or just to yourself. - --------------------------------------------------------------------------- -$Id: INSTALL,v 1.7 2008/12/26 12:33:31 Stevan_White Exp $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/README b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/README deleted file mode 100644 index 60e67f203d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freefont-20090104/README +++ /dev/null @@ -1,108 +0,0 @@ --*-text-*- - GNU FreeFont - -The GNU FreeFont project aims to provide a useful set of free scalable -(i.e., OpenType) fonts covering as much as possible of the ISO 10646/Unicode -UCS (Universal Character Set). - -Statement of Purpose --------------------- - -The practical reason for putting glyphs together in a single font face is -to conveniently mix symbols and characters from different writing systems, -without having to switch fonts. - -Coverage --------- - -FreeFont covers the following character sets - -* ISO 8859 parts 1-15 -* CEN MES-3 European Unicode Subset - http://www.evertype.com/standards/iso10646/pdf/cwa13873.pdf -* IBM/Microsoft code pages 437, 850, 852, 1250, 1252 and more -* Microsoft/Adobe Windows Glyph List 4 (WGL4) - http://www.microsoft.com/typography/otspec/WGL4.htm -* KOI8-R and KOI8-RU -* DEC VT100 graphics symbols -* International Phonetic Alphabet -* Arabic, Hebrew, Armenian, Georgian, Ethiopian and Thai alphabets, - including Arabic presentation forms A/B -* mathematical symbols, including the whole TeX repertoire of symbols -* APL symbols - etc. - -Editing -------- - -The free outline font editor, George Williams's FontForge -<http://fontforge.sourceforge.net/> is used for editing the fonts. - -Design Issues -------------- - -Which font shapes should be made? Historical style terms like Renaissance -or Baroque letterforms cannot be applied beyond Latin/Cyrillic/Greek -scripts to any greater extent than Kufi or Nashki can be applied beyond -Arabic script; "italic" is really only meaningful for Latin letters. - -However, most modern writing systems have typographic formulations for -contrasting uniform and modulated character stroke widths, and have some -history with "oblique", faces. Since the advent of the typewriter, most -have developed a typographic style with uniform-width characters. - -Accordingly, the FreeFont family has one monospaced - FreeMono - and two -proportional faces (one with uniform stroke - FreeSans - and one with -modulated stroke - FreeSerif). - -To make text from different writing systems look good side-by-side, each -FreeFont face is meant to contain characters of similar style and weight. - -Licensing ---------- - -Free UCS scalable fonts is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License as published -by the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -The fonts are distributed in the hope that they will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -As a special exception, if you create a document which uses this font, and -embed this font or unaltered portions of this font into the document, this -font does not by itself cause the resulting document to be covered by the -GNU General Public License. This exception does not however invalidate any -other reasons why the document might be covered by the GNU General Public -License. If you modify this font, you may extend this exception to your -version of the font, but you are not obligated to do so. If you do not -wish to do so, delete this exception statement from your version. - - -Files and their suffixes ------------------------- - -The files with .sfd (Spline Font Database) are in FontForge's native format. -Please use these if you plan to modify the font files. - -TrueType fonts for immediate consumption are the files with the .ttf -(TrueType Font) suffix. These are ready to use in Xwindows based -systems using FreeType, on Mac OS, and on older Windows systems. - -OpenType fonts (with suffix .otf) are for use in Windows Vista. -Note that although they can be installed on Linux, but many applications -in Linux still don't support them. - - --------------------------------------------------------------------------- -Primoz Peterlin, <primoz.peterlin@biofiz.mf.uni-lj.si> -Steve White <stevan.white@googlemail.com> - -Free UCS scalable fonts: http://savannah.gnu.org/projects/freefont/ -$Id: README,v 1.6 2008/12/25 12:51:41 Stevan_White Exp $ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.ctg.z deleted file mode 100644 index 93b7b3cf4c..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.php deleted file mode 100644 index 5d45caebf5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.php +++ /dev/null @@ -1,348 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeMono'; -$desc=array('Ascent'=>800,'Descent'=>-200,'CapHeight'=>40,'Flags'=>32,'FontBBox'=>'[-793 -200 699 800]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600, -42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600, -52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600, -62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600, -72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600, -82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600, -92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600, -102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600, -112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600, -122=>600,123=>600,124=>600,125=>600,126=>600,8364=>600,8218=>600,402=>600,8222=>600,8230=>600, -8224=>600,8225=>600,710=>600,8240=>600,352=>600,8249=>600,338=>600,381=>600,8216=>600,8217=>600, -8220=>600,8221=>600,8226=>600,8211=>600,8212=>600,732=>600,8482=>600,353=>600,8250=>600,339=>600, -382=>600,376=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600, -168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600, -178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600, -188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600, -198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600, -208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600, -218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600, -228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600, -238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600, -248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600,256=>600,257=>600, -258=>600,259=>600,260=>600,261=>600,262=>600,263=>600,264=>600,265=>600,266=>600,267=>600, -268=>600,269=>600,270=>600,271=>600,272=>600,273=>600,274=>600,275=>600,276=>600,277=>600, -278=>600,279=>600,280=>600,281=>600,282=>600,283=>600,284=>600,285=>600,286=>600,287=>600, -288=>600,289=>600,290=>600,291=>600,292=>600,293=>600,294=>600,295=>600,296=>600,297=>600, -298=>600,299=>600,300=>600,301=>600,302=>600,303=>600,304=>600,305=>600,306=>600,307=>600, -308=>600,309=>600,310=>600,311=>600,312=>600,313=>600,314=>600,315=>600,316=>600,317=>600, -318=>600,319=>600,320=>600,321=>600,322=>600,323=>600,324=>600,325=>600,326=>600,327=>600, -328=>600,329=>600,330=>600,331=>600,332=>600,333=>600,334=>600,335=>600,336=>600,337=>600, -340=>600,341=>600,342=>600,343=>600,344=>600,345=>600,346=>600,347=>600,348=>600,349=>600, -350=>600,351=>600,354=>600,355=>600,356=>600,357=>600,358=>600,359=>600,360=>600,361=>600, -362=>600,363=>600,364=>600,365=>600,366=>600,367=>600,368=>600,369=>600,370=>600,371=>600, -372=>600,373=>600,374=>600,375=>600,377=>600,378=>600,379=>600,380=>600,383=>600,384=>600, -385=>600,386=>600,387=>600,388=>600,389=>600,390=>600,391=>600,392=>600,393=>600,394=>600, -395=>600,396=>600,397=>600,398=>600,399=>600,400=>600,401=>600,403=>600,404=>600,405=>600, -406=>600,407=>600,408=>600,409=>600,410=>600,411=>600,412=>600,413=>600,414=>600,415=>600, -416=>600,417=>600,418=>600,419=>600,420=>600,421=>600,422=>600,423=>600,424=>600,425=>600, -426=>600,427=>600,428=>600,429=>600,430=>600,431=>600,432=>600,433=>600,434=>600,435=>600, -436=>600,437=>600,438=>600,439=>600,440=>600,441=>600,442=>600,443=>600,444=>600,445=>600, -446=>600,447=>600,448=>600,449=>600,450=>600,451=>600,452=>600,453=>600,454=>600,455=>600, -456=>600,457=>600,458=>600,459=>600,460=>600,461=>600,462=>600,463=>600,464=>600,465=>600, -466=>600,467=>600,468=>600,469=>600,470=>600,471=>600,472=>600,473=>600,474=>600,475=>600, -476=>600,477=>600,478=>600,479=>600,480=>600,481=>600,482=>600,483=>600,484=>600,485=>600, -486=>600,487=>600,488=>600,489=>600,490=>600,491=>600,492=>600,493=>600,494=>600,495=>600, -496=>600,497=>600,498=>600,499=>600,500=>600,501=>600,502=>600,503=>600,504=>600,505=>600, -506=>600,507=>600,508=>600,509=>600,510=>600,511=>600,512=>600,513=>600,514=>600,515=>600, -516=>600,517=>600,518=>600,519=>600,520=>600,521=>600,522=>600,523=>600,524=>600,525=>600, -526=>600,527=>600,528=>600,529=>600,530=>600,531=>600,532=>600,533=>600,534=>600,535=>600, -536=>600,537=>600,538=>600,539=>600,540=>600,541=>600,542=>600,543=>600,548=>600,549=>600, -550=>600,551=>600,552=>600,553=>600,554=>600,555=>600,556=>600,557=>600,558=>600,559=>600, -560=>600,561=>600,562=>600,563=>600,567=>600,592=>600,593=>600,594=>600,595=>600,596=>600, -597=>600,598=>600,599=>600,600=>600,601=>600,602=>600,603=>600,604=>600,605=>600,606=>600, -607=>600,608=>600,609=>600,610=>600,611=>600,612=>600,613=>600,614=>600,615=>600,616=>600, -617=>600,618=>600,619=>600,620=>600,621=>600,622=>600,623=>600,624=>600,625=>600,626=>600, -627=>600,628=>600,629=>600,630=>600,631=>600,632=>600,633=>600,634=>600,635=>600,636=>600, -637=>600,638=>600,639=>600,640=>600,641=>600,642=>600,643=>600,644=>600,645=>600,646=>600, -647=>600,648=>600,649=>600,650=>600,651=>600,652=>600,653=>600,654=>600,655=>600,656=>600, -657=>600,658=>600,659=>600,660=>600,661=>600,662=>600,663=>600,664=>600,665=>600,666=>600, -667=>600,668=>600,669=>600,670=>600,671=>600,672=>600,673=>600,674=>600,675=>600,676=>600, -677=>600,678=>600,679=>600,680=>600,681=>600,682=>600,683=>600,684=>600,685=>600,686=>600, -687=>600,688=>600,689=>600,690=>600,691=>600,692=>600,693=>600,694=>600,695=>600,696=>600, -697=>600,698=>600,699=>600,700=>600,701=>600,702=>600,703=>600,704=>600,705=>600,706=>600, -707=>600,708=>600,709=>600,711=>600,712=>600,713=>600,714=>600,715=>600,716=>600,717=>600, -718=>600,719=>600,720=>600,721=>600,722=>600,723=>600,724=>600,725=>600,726=>600,727=>600, -728=>600,729=>600,730=>600,731=>600,733=>600,734=>600,735=>600,736=>600,737=>600,738=>600, -739=>600,740=>600,741=>600,742=>600,743=>600,744=>600,745=>600,746=>600,747=>600,748=>600, -749=>600,750=>600,751=>600,752=>600,753=>600,754=>600,755=>600,756=>600,757=>600,758=>600, -759=>600,760=>600,761=>600,762=>600,763=>600,764=>600,765=>600,766=>600,767=>600,768=>0, -769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0, -779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0, -789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0, -799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0, -809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0, -829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0, -839=>0,840=>0,841=>0,843=>0,844=>0,845=>0,848=>0,849=>0,850=>0,851=>0, -852=>0,853=>0,854=>0,855=>0,856=>0,857=>0,858=>0,884=>600,885=>600,890=>600, -894=>600,900=>600,901=>600,902=>600,903=>600,904=>600,905=>600,906=>600,908=>600,910=>600, -911=>600,912=>600,913=>600,914=>600,915=>600,916=>600,917=>600,918=>600,919=>600,920=>600, -921=>600,922=>600,923=>600,924=>600,925=>600,926=>600,927=>600,928=>600,929=>600,931=>600, -932=>600,933=>600,934=>600,935=>600,936=>600,937=>600,938=>600,939=>600,940=>600,941=>600, -942=>600,943=>600,944=>600,945=>600,946=>600,947=>600,948=>600,949=>600,950=>600,951=>600, -952=>600,953=>600,954=>600,955=>600,956=>600,957=>600,958=>600,959=>600,960=>600,961=>600, -962=>600,963=>600,964=>600,965=>600,966=>600,967=>600,968=>600,969=>600,970=>600,971=>600, -972=>600,973=>600,974=>600,976=>600,977=>600,978=>600,979=>600,980=>600,981=>600,982=>600, -986=>600,987=>600,988=>600,1008=>600,1009=>600,1012=>600,1013=>600,1024=>600,1025=>600,1026=>600, -1027=>600,1028=>600,1029=>600,1030=>600,1031=>600,1032=>600,1033=>600,1034=>600,1035=>600,1036=>600, -1037=>600,1038=>600,1039=>600,1040=>600,1041=>600,1042=>600,1043=>600,1044=>600,1045=>600,1046=>600, -1047=>600,1048=>600,1049=>600,1050=>600,1051=>600,1052=>600,1053=>600,1054=>600,1055=>600,1056=>600, -1057=>600,1058=>600,1059=>600,1060=>600,1061=>600,1062=>600,1063=>600,1064=>600,1065=>600,1066=>600, -1067=>600,1068=>600,1069=>600,1070=>600,1071=>600,1072=>600,1073=>600,1074=>600,1075=>600,1076=>600, -1077=>600,1078=>600,1079=>600,1080=>600,1081=>600,1082=>600,1083=>600,1084=>600,1085=>600,1086=>600, -1087=>600,1088=>600,1089=>600,1090=>600,1091=>600,1092=>600,1093=>600,1094=>600,1095=>600,1096=>600, -1097=>600,1098=>600,1099=>600,1100=>600,1101=>600,1102=>600,1103=>600,1104=>600,1105=>600,1106=>600, -1107=>600,1108=>600,1109=>600,1110=>600,1111=>600,1112=>600,1113=>600,1114=>600,1115=>600,1116=>600, -1117=>600,1118=>600,1119=>600,1120=>600,1121=>600,1122=>600,1123=>600,1124=>600,1126=>600,1127=>600, -1128=>600,1130=>600,1131=>600,1132=>600,1133=>600,1136=>600,1137=>600,1138=>600,1140=>600,1141=>600, -1142=>600,1143=>600,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1162=>600,1163=>600,1164=>600, -1165=>600,1166=>600,1167=>600,1168=>600,1169=>600,1170=>600,1171=>600,1172=>600,1173=>600,1174=>600, -1175=>600,1176=>600,1177=>600,1178=>600,1179=>600,1180=>600,1181=>600,1182=>600,1183=>600,1184=>600, -1185=>600,1186=>600,1187=>600,1188=>600,1189=>600,1190=>600,1191=>600,1192=>600,1193=>600,1194=>600, -1195=>600,1196=>600,1197=>600,1198=>600,1199=>600,1200=>600,1201=>600,1202=>600,1203=>600,1204=>600, -1205=>600,1206=>600,1207=>600,1208=>600,1209=>600,1210=>600,1211=>600,1212=>600,1213=>600,1214=>600, -1215=>600,1216=>600,1217=>600,1218=>600,1219=>600,1220=>600,1221=>600,1222=>600,1223=>600,1224=>600, -1225=>600,1226=>600,1227=>600,1228=>600,1229=>600,1230=>600,1231=>600,1232=>600,1233=>600,1234=>600, -1235=>600,1236=>600,1237=>600,1238=>600,1239=>600,1240=>600,1241=>600,1242=>600,1243=>600,1244=>600, -1245=>600,1246=>600,1247=>600,1248=>600,1249=>600,1250=>600,1251=>600,1252=>600,1253=>600,1254=>600, -1255=>600,1256=>600,1257=>600,1258=>600,1259=>600,1260=>600,1261=>600,1262=>600,1263=>600,1264=>600, -1265=>600,1266=>600,1267=>600,1268=>600,1269=>600,1270=>600,1271=>600,1272=>600,1273=>600,1296=>600, -1297=>600,1298=>600,1299=>600,1306=>600,1307=>600,1308=>600,1309=>600,1310=>600,1311=>600,1329=>600, -1330=>600,1331=>600,1332=>600,1333=>600,1334=>600,1335=>600,1336=>600,1337=>600,1338=>600,1339=>600, -1340=>600,1341=>600,1342=>600,1343=>600,1344=>600,1345=>600,1346=>600,1347=>600,1348=>600,1349=>600, -1350=>600,1351=>600,1352=>600,1353=>600,1354=>600,1355=>600,1356=>600,1357=>600,1358=>600,1359=>600, -1360=>600,1361=>600,1362=>600,1363=>600,1364=>600,1365=>600,1366=>600,1369=>600,1370=>600,1371=>600, -1372=>600,1373=>600,1374=>600,1375=>600,1377=>600,1378=>600,1379=>600,1380=>600,1381=>600,1382=>600, -1383=>600,1384=>600,1385=>600,1386=>600,1387=>600,1388=>600,1389=>600,1390=>600,1391=>600,1392=>600, -1393=>600,1394=>600,1395=>600,1396=>600,1397=>600,1398=>600,1399=>600,1400=>600,1401=>600,1402=>600, -1403=>600,1404=>600,1405=>600,1406=>600,1407=>600,1408=>600,1409=>600,1410=>600,1411=>600,1412=>600, -1413=>600,1414=>600,1415=>600,1417=>600,1418=>600,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0, -1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0,1468=>0,1469=>0,1470=>600,1471=>0, -1472=>600,1473=>0,1474=>0,1475=>600,1476=>0,1488=>600,1489=>600,1490=>600,1491=>600,1492=>600, -1493=>600,1494=>600,1495=>600,1496=>600,1497=>600,1498=>600,1499=>600,1500=>600,1501=>600,1502=>600, -1503=>600,1504=>600,1505=>600,1506=>600,1507=>600,1508=>600,1509=>600,1510=>600,1511=>600,1512=>600, -1513=>600,1514=>600,1520=>600,1521=>600,1522=>600,1523=>600,1524=>600,4304=>600,4305=>600,4306=>600, -4307=>600,4308=>600,4309=>600,4310=>600,4311=>600,4312=>600,4313=>600,4314=>600,4315=>600,4316=>600, -4317=>600,4318=>600,4319=>600,4320=>600,4321=>600,4322=>600,4323=>600,4324=>600,4325=>600,4326=>600, -4327=>600,4328=>600,4329=>600,4330=>600,4331=>600,4332=>600,4333=>600,4334=>600,4335=>600,4336=>600, -4337=>600,4338=>600,4339=>600,4340=>600,4341=>600,4345=>600,4347=>600,5792=>600,5793=>600,5794=>600, -5795=>600,5796=>600,5797=>600,5798=>600,5799=>600,5800=>600,5801=>600,5802=>600,5803=>600,5804=>600, -5805=>600,5806=>600,5807=>600,5808=>600,5809=>600,5810=>600,5811=>600,5812=>600,5813=>600,5814=>600, -5815=>600,5816=>600,5817=>600,5818=>600,5819=>600,5820=>600,5821=>600,5822=>600,5823=>600,5824=>600, -5825=>600,5826=>600,5827=>600,5828=>600,5829=>600,5830=>600,5831=>600,5832=>600,5833=>600,5834=>600, -5835=>600,5836=>600,5837=>600,5838=>600,5839=>600,5840=>600,5841=>600,5842=>600,5843=>600,5844=>600, -5845=>600,5846=>600,5847=>600,5848=>600,5849=>600,5850=>600,5851=>600,5852=>600,5853=>600,5854=>600, -5855=>600,5856=>600,5857=>600,5858=>600,5859=>600,5860=>600,5861=>600,5862=>600,5863=>600,5864=>600, -5865=>600,5866=>600,5867=>600,5868=>600,5869=>600,5870=>600,5871=>600,5872=>600,7680=>600,7681=>600, -7682=>600,7683=>600,7684=>600,7685=>600,7686=>600,7687=>600,7688=>600,7689=>600,7690=>600,7691=>600, -7692=>600,7693=>600,7694=>600,7695=>600,7696=>600,7697=>600,7698=>600,7699=>600,7700=>600,7701=>600, -7702=>600,7703=>600,7704=>600,7705=>600,7706=>600,7707=>600,7708=>600,7709=>600,7710=>600,7711=>600, -7712=>600,7713=>600,7714=>600,7715=>600,7716=>600,7717=>600,7718=>600,7719=>600,7720=>600,7721=>600, -7722=>600,7723=>600,7724=>600,7725=>600,7726=>600,7727=>600,7728=>600,7729=>600,7730=>600,7731=>600, -7732=>600,7733=>600,7734=>600,7735=>600,7736=>600,7737=>600,7738=>600,7739=>600,7740=>600,7741=>600, -7742=>600,7743=>600,7744=>600,7745=>600,7746=>600,7747=>600,7748=>600,7749=>600,7750=>600,7751=>600, -7752=>600,7753=>600,7754=>600,7755=>600,7756=>600,7757=>600,7758=>600,7759=>600,7760=>600,7761=>600, -7762=>600,7763=>600,7764=>600,7765=>600,7766=>600,7767=>600,7768=>600,7769=>600,7770=>600,7771=>600, -7772=>600,7773=>600,7774=>600,7775=>600,7776=>600,7777=>600,7778=>600,7779=>600,7780=>600,7781=>600, -7782=>600,7783=>600,7784=>600,7785=>600,7786=>600,7787=>600,7788=>600,7789=>600,7790=>600,7791=>600, -7792=>600,7793=>600,7794=>600,7795=>600,7796=>600,7797=>600,7798=>600,7799=>600,7800=>600,7801=>600, -7802=>600,7803=>600,7804=>600,7805=>600,7806=>600,7807=>600,7808=>600,7809=>600,7810=>600,7811=>600, -7812=>600,7813=>600,7814=>600,7815=>600,7816=>600,7817=>600,7818=>600,7819=>600,7820=>600,7821=>600, -7822=>600,7823=>600,7824=>600,7825=>600,7826=>600,7827=>600,7828=>600,7829=>600,7830=>600,7831=>600, -7832=>600,7833=>600,7834=>600,7835=>600,7840=>600,7841=>600,7842=>600,7843=>600,7844=>600,7845=>600, -7846=>600,7847=>600,7848=>600,7849=>600,7850=>600,7851=>600,7852=>600,7853=>600,7854=>600,7855=>600, -7856=>600,7857=>600,7858=>600,7859=>600,7860=>600,7861=>600,7862=>600,7863=>600,7864=>600,7865=>600, -7866=>600,7867=>600,7868=>600,7869=>600,7870=>600,7871=>600,7872=>600,7873=>600,7874=>600,7875=>600, -7876=>600,7877=>600,7878=>600,7879=>600,7880=>600,7881=>600,7882=>600,7883=>600,7884=>600,7885=>600, -7886=>600,7887=>600,7888=>600,7889=>600,7890=>600,7891=>600,7892=>600,7893=>600,7894=>600,7895=>600, -7896=>600,7897=>600,7898=>600,7899=>600,7900=>600,7901=>600,7902=>600,7903=>600,7904=>600,7905=>600, -7906=>600,7907=>600,7908=>600,7909=>600,7910=>600,7911=>600,7912=>600,7913=>600,7914=>600,7915=>600, -7916=>600,7917=>600,7918=>600,7919=>600,7920=>600,7921=>600,7922=>600,7923=>600,7924=>600,7925=>600, -7926=>600,7927=>600,7928=>600,7929=>600,7936=>600,7937=>600,7938=>600,7939=>600,7940=>600,7941=>600, -7942=>600,7943=>600,7944=>600,7945=>600,7946=>600,7947=>600,7948=>600,7949=>600,7950=>600,7951=>600, -7952=>600,7953=>600,7954=>600,7955=>600,7956=>600,7957=>600,7960=>600,7961=>600,7962=>600,7963=>600, -7964=>600,7965=>600,7968=>600,7969=>600,7970=>600,7971=>600,7972=>600,7973=>600,7974=>600,7975=>600, -7976=>600,7977=>600,7978=>600,7979=>600,7980=>600,7981=>600,7982=>600,7983=>600,7984=>600,7985=>600, -7986=>600,7987=>600,7988=>600,7989=>600,7990=>600,7991=>600,7992=>600,7993=>600,7994=>600,7995=>600, -7996=>600,7997=>600,7998=>600,7999=>600,8000=>600,8001=>600,8002=>600,8003=>600,8004=>600,8005=>600, -8008=>600,8009=>600,8010=>600,8011=>600,8012=>600,8013=>600,8016=>600,8017=>600,8018=>600,8019=>600, -8020=>600,8021=>600,8022=>600,8023=>600,8025=>600,8027=>600,8029=>600,8031=>600,8032=>600,8033=>600, -8034=>600,8035=>600,8036=>600,8037=>600,8038=>600,8039=>600,8040=>600,8041=>600,8042=>600,8043=>600, -8044=>600,8045=>600,8046=>600,8047=>600,8048=>600,8049=>600,8050=>600,8051=>600,8052=>600,8053=>600, -8054=>600,8055=>600,8056=>600,8057=>600,8058=>600,8059=>600,8060=>600,8061=>600,8064=>600,8065=>600, -8066=>600,8067=>600,8068=>600,8069=>600,8070=>600,8071=>600,8072=>600,8073=>600,8074=>600,8075=>600, -8076=>600,8077=>600,8078=>600,8079=>600,8080=>600,8081=>600,8082=>600,8083=>600,8084=>600,8085=>600, -8086=>600,8087=>600,8088=>600,8089=>600,8090=>600,8091=>600,8092=>600,8093=>600,8094=>600,8095=>600, -8096=>600,8097=>600,8098=>600,8099=>600,8100=>600,8101=>600,8102=>600,8103=>600,8104=>600,8105=>600, -8106=>600,8107=>600,8108=>600,8109=>600,8110=>600,8111=>600,8112=>600,8113=>600,8114=>600,8115=>600, -8116=>600,8118=>600,8119=>600,8120=>600,8121=>600,8122=>600,8123=>600,8124=>600,8125=>600,8126=>600, -8127=>600,8128=>600,8129=>600,8130=>600,8131=>600,8132=>600,8134=>600,8135=>600,8136=>600,8137=>600, -8138=>600,8139=>600,8140=>600,8141=>600,8142=>600,8143=>600,8144=>600,8145=>600,8146=>600,8147=>600, -8150=>600,8151=>600,8152=>600,8153=>600,8154=>600,8155=>600,8157=>600,8158=>600,8159=>600,8160=>600, -8161=>600,8162=>600,8163=>600,8164=>600,8165=>600,8166=>600,8167=>600,8168=>600,8169=>600,8170=>600, -8171=>600,8172=>600,8173=>600,8174=>600,8175=>600,8178=>600,8179=>600,8180=>600,8182=>600,8183=>600, -8184=>600,8185=>600,8186=>600,8187=>600,8188=>600,8189=>600,8190=>600,8192=>600,8193=>600,8194=>600, -8195=>600,8196=>600,8197=>600,8198=>600,8199=>600,8200=>600,8201=>600,8202=>600,8203=>600,8204=>0, -8205=>0,8206=>0,8207=>0,8208=>600,8209=>600,8210=>600,8213=>600,8214=>600,8215=>600,8219=>600, -8223=>600,8227=>600,8228=>600,8229=>600,8231=>600,8232=>600,8233=>600,8234=>600,8235=>600,8236=>600, -8237=>600,8238=>600,8239=>600,8241=>600,8242=>600,8243=>600,8244=>600,8245=>600,8246=>600,8247=>600, -8248=>600,8251=>600,8252=>600,8253=>600,8254=>600,8255=>600,8256=>600,8257=>600,8258=>600,8259=>600, -8260=>600,8261=>600,8262=>600,8263=>600,8264=>600,8265=>600,8266=>600,8267=>600,8268=>600,8269=>600, -8270=>600,8271=>600,8272=>600,8273=>600,8274=>600,8275=>600,8276=>600,8277=>600,8278=>600,8279=>600, -8280=>600,8281=>600,8282=>600,8283=>600,8284=>600,8285=>600,8286=>600,8287=>600,8288=>600,8289=>600, -8290=>600,8291=>600,8292=>600,8298=>600,8299=>600,8300=>600,8301=>600,8302=>600,8303=>600,8304=>600, -8305=>600,8308=>600,8309=>600,8310=>600,8311=>600,8312=>600,8313=>600,8314=>600,8315=>600,8316=>600, -8317=>600,8318=>600,8319=>600,8320=>600,8321=>600,8322=>600,8323=>600,8324=>600,8325=>600,8326=>600, -8327=>600,8328=>600,8329=>600,8330=>600,8331=>600,8332=>600,8333=>600,8334=>600,8336=>600,8337=>600, -8338=>600,8339=>600,8340=>600,8353=>600,8354=>600,8355=>600,8356=>600,8357=>600,8358=>600,8359=>600, -8360=>600,8361=>600,8362=>600,8363=>600,8365=>600,8366=>600,8368=>600,8369=>600,8370=>600,8371=>600, -8372=>600,8373=>600,8400=>0,8401=>0,8402=>0,8406=>0,8407=>0,8411=>0,8412=>0,8413=>0, -8414=>0,8415=>0,8416=>0,8417=>0,8418=>0,8419=>0,8428=>0,8429=>0,8430=>0,8431=>0, -8448=>600,8449=>600,8450=>600,8451=>600,8453=>600,8454=>600,8455=>600,8457=>600,8461=>600,8463=>600, -8464=>600,8465=>600,8466=>600,8467=>600,8468=>600,8469=>600,8470=>600,8471=>600,8472=>600,8473=>600, -8474=>600,8476=>600,8477=>600,8478=>600,8481=>600,8484=>600,8486=>600,8487=>600,8489=>600,8490=>600, -8491=>600,8498=>600,8501=>600,8502=>600,8503=>600,8504=>600,8505=>600,8506=>600,8507=>600,8523=>600, -8526=>600,8531=>600,8532=>600,8533=>600,8534=>600,8535=>600,8536=>600,8537=>600,8538=>600,8539=>600, -8540=>600,8541=>600,8542=>600,8543=>600,8544=>600,8545=>600,8546=>600,8547=>600,8548=>600,8549=>600, -8550=>600,8551=>600,8552=>600,8553=>600,8554=>600,8555=>600,8556=>600,8557=>600,8558=>600,8559=>600, -8560=>600,8561=>600,8562=>600,8563=>600,8564=>600,8565=>600,8566=>600,8567=>600,8568=>600,8569=>600, -8570=>600,8571=>600,8572=>600,8573=>600,8574=>600,8575=>600,8592=>600,8593=>600,8594=>600,8595=>600, -8596=>600,8597=>600,8598=>600,8599=>600,8600=>600,8601=>600,8602=>600,8603=>600,8604=>600,8605=>600, -8606=>600,8607=>600,8608=>600,8609=>600,8610=>600,8611=>600,8612=>600,8613=>600,8614=>600,8615=>600, -8616=>600,8617=>600,8618=>600,8619=>600,8620=>600,8621=>600,8622=>600,8623=>600,8624=>600,8625=>600, -8626=>600,8627=>600,8628=>600,8629=>600,8630=>600,8631=>600,8632=>600,8633=>600,8634=>600,8635=>600, -8636=>600,8637=>600,8638=>600,8639=>600,8640=>600,8641=>600,8642=>600,8643=>600,8644=>600,8645=>600, -8646=>600,8647=>600,8648=>600,8649=>600,8650=>600,8651=>600,8652=>600,8653=>600,8654=>600,8655=>600, -8656=>600,8657=>600,8658=>600,8659=>600,8660=>600,8661=>600,8669=>600,8678=>600,8679=>600,8680=>600, -8681=>600,8691=>600,8704=>600,8705=>600,8706=>600,8707=>600,8708=>600,8709=>600,8710=>600,8711=>600, -8712=>600,8713=>600,8714=>600,8715=>600,8716=>600,8717=>600,8718=>600,8719=>600,8720=>600,8721=>600, -8722=>600,8723=>600,8724=>600,8725=>600,8726=>600,8727=>600,8728=>600,8729=>600,8730=>600,8731=>600, -8732=>600,8733=>600,8734=>600,8735=>600,8736=>600,8737=>600,8738=>600,8739=>600,8740=>600,8741=>600, -8742=>600,8743=>600,8744=>600,8745=>600,8746=>600,8747=>600,8748=>600,8749=>600,8750=>600,8751=>600, -8752=>600,8754=>600,8755=>600,8756=>600,8757=>600,8758=>600,8759=>600,8760=>600,8761=>600,8762=>600, -8763=>600,8764=>600,8765=>600,8768=>600,8769=>600,8770=>600,8771=>600,8772=>600,8773=>600,8774=>600, -8775=>600,8776=>600,8777=>600,8778=>600,8779=>600,8780=>600,8781=>600,8784=>600,8785=>600,8786=>600, -8787=>600,8788=>600,8789=>600,8790=>600,8791=>600,8792=>600,8793=>600,8794=>600,8795=>600,8796=>600, -8797=>600,8798=>600,8799=>600,8800=>600,8801=>600,8802=>600,8803=>600,8804=>600,8805=>600,8806=>600, -8807=>600,8808=>600,8809=>600,8810=>600,8811=>600,8812=>600,8813=>600,8814=>600,8815=>600,8816=>600, -8817=>600,8818=>600,8819=>600,8820=>600,8821=>600,8822=>600,8823=>600,8824=>600,8825=>600,8826=>600, -8827=>600,8828=>600,8829=>600,8830=>600,8831=>600,8832=>600,8833=>600,8834=>600,8835=>600,8836=>600, -8837=>600,8838=>600,8839=>600,8840=>600,8841=>600,8842=>600,8843=>600,8844=>600,8845=>600,8846=>600, -8847=>600,8848=>600,8849=>600,8850=>600,8851=>600,8852=>600,8853=>600,8854=>600,8855=>600,8856=>600, -8857=>600,8858=>600,8859=>600,8860=>600,8861=>600,8862=>600,8863=>600,8866=>600,8867=>600,8868=>600, -8869=>600,8870=>600,8871=>600,8872=>600,8873=>600,8874=>600,8875=>600,8876=>600,8877=>600,8878=>600, -8879=>600,8882=>600,8883=>600,8884=>600,8885=>600,8891=>600,8892=>600,8893=>600,8894=>600,8896=>600, -8897=>600,8898=>600,8899=>600,8900=>600,8901=>600,8902=>600,8903=>600,8904=>600,8909=>600,8910=>600, -8911=>600,8912=>600,8913=>600,8914=>600,8915=>600,8924=>600,8925=>600,8926=>600,8927=>600,8928=>600, -8929=>600,8930=>600,8931=>600,8938=>600,8939=>600,8940=>600,8941=>600,8942=>600,8943=>600,8944=>600, -8945=>600,8960=>600,8962=>600,8963=>600,8964=>600,8965=>600,8966=>600,8968=>600,8969=>600,8970=>600, -8971=>600,8972=>600,8973=>600,8974=>600,8975=>600,8976=>600,8978=>600,8980=>600,8981=>600,8984=>600, -8985=>600,8988=>600,8989=>600,8990=>600,8991=>600,8992=>600,8993=>600,8994=>600,8995=>600,8996=>600, -8997=>600,8998=>600,8999=>600,9001=>600,9002=>600,9003=>600,9004=>600,9014=>600,9015=>600,9016=>600, -9017=>600,9018=>600,9019=>600,9020=>600,9021=>600,9022=>600,9023=>600,9024=>600,9025=>600,9026=>600, -9027=>600,9028=>600,9029=>600,9030=>600,9031=>600,9032=>600,9033=>600,9034=>600,9035=>600,9036=>600, -9037=>600,9038=>600,9039=>600,9040=>600,9041=>600,9042=>600,9043=>600,9044=>600,9045=>600,9046=>600, -9047=>600,9048=>600,9049=>600,9050=>600,9051=>600,9052=>600,9053=>600,9054=>600,9055=>600,9056=>600, -9057=>600,9058=>600,9059=>600,9060=>600,9061=>600,9062=>600,9063=>600,9064=>600,9065=>600,9066=>600, -9067=>600,9068=>600,9069=>600,9070=>600,9071=>600,9072=>600,9073=>600,9074=>600,9075=>600,9076=>600, -9077=>600,9078=>600,9079=>600,9080=>600,9081=>600,9082=>600,9084=>600,9085=>600,9086=>600,9087=>600, -9088=>600,9089=>600,9090=>600,9091=>600,9092=>600,9093=>600,9094=>600,9095=>600,9096=>600,9097=>600, -9098=>600,9099=>600,9100=>600,9101=>600,9102=>600,9103=>600,9104=>600,9105=>600,9106=>600,9107=>600, -9108=>600,9109=>600,9110=>600,9111=>600,9112=>600,9113=>600,9114=>600,9115=>600,9116=>600,9117=>600, -9118=>600,9119=>600,9120=>600,9121=>600,9122=>600,9123=>600,9124=>600,9125=>600,9126=>600,9127=>600, -9128=>600,9129=>600,9130=>600,9131=>600,9132=>600,9133=>600,9134=>600,9135=>600,9136=>600,9137=>600, -9138=>600,9139=>600,9140=>600,9141=>600,9142=>600,9143=>600,9146=>600,9147=>600,9148=>600,9149=>600, -9150=>600,9151=>600,9152=>600,9153=>600,9154=>600,9155=>600,9156=>600,9157=>600,9158=>600,9159=>600, -9160=>600,9161=>600,9162=>600,9163=>600,9164=>600,9165=>600,9166=>600,9167=>600,9178=>600,9179=>600, -9182=>600,9183=>600,9186=>600,9187=>600,9188=>600,9189=>600,9190=>600,9251=>600,9280=>600,9281=>600, -9282=>600,9283=>600,9284=>600,9285=>600,9286=>600,9287=>600,9288=>600,9289=>600,9290=>600,9312=>600, -9313=>600,9314=>600,9315=>600,9316=>600,9317=>600,9318=>600,9319=>600,9320=>600,9321=>600,9472=>600, -9473=>600,9474=>600,9475=>600,9476=>600,9477=>600,9478=>600,9479=>600,9480=>600,9481=>600,9482=>600, -9483=>600,9484=>600,9485=>600,9486=>600,9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600, -9493=>600,9494=>600,9495=>600,9496=>600,9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600, -9503=>600,9504=>600,9505=>600,9506=>600,9507=>600,9508=>600,9509=>600,9510=>600,9511=>600,9512=>600, -9513=>600,9514=>600,9515=>600,9516=>600,9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600, -9523=>600,9524=>600,9525=>600,9526=>600,9527=>600,9528=>600,9529=>600,9530=>600,9531=>600,9532=>600, -9533=>600,9534=>600,9535=>600,9536=>600,9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600, -9543=>600,9544=>600,9545=>600,9546=>600,9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600, -9553=>600,9554=>600,9555=>600,9556=>600,9557=>600,9558=>600,9559=>600,9560=>600,9561=>600,9562=>600, -9563=>600,9564=>600,9565=>600,9566=>600,9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600, -9573=>600,9574=>600,9575=>600,9576=>600,9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600, -9583=>600,9584=>600,9585=>600,9586=>600,9587=>600,9588=>600,9589=>600,9590=>600,9591=>600,9592=>600, -9593=>600,9594=>600,9595=>600,9596=>600,9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600, -9603=>600,9604=>600,9605=>600,9606=>600,9607=>600,9608=>600,9609=>600,9610=>600,9611=>600,9612=>600, -9613=>600,9614=>600,9615=>600,9616=>600,9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9622=>600, -9623=>600,9624=>600,9625=>600,9626=>600,9627=>600,9628=>600,9629=>600,9630=>600,9631=>600,9632=>600, -9633=>600,9634=>600,9635=>600,9636=>600,9637=>600,9638=>600,9639=>600,9640=>600,9641=>600,9642=>600, -9643=>600,9644=>600,9645=>600,9646=>600,9647=>600,9648=>600,9649=>600,9650=>600,9651=>600,9652=>600, -9653=>600,9654=>600,9655=>600,9656=>600,9657=>600,9658=>600,9659=>600,9660=>600,9661=>600,9662=>600, -9663=>600,9664=>600,9665=>600,9666=>600,9667=>600,9668=>600,9669=>600,9670=>600,9671=>600,9672=>600, -9673=>600,9674=>600,9675=>600,9676=>600,9677=>600,9678=>600,9679=>600,9680=>600,9681=>600,9682=>600, -9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9690=>600,9691=>600,9692=>600, -9693=>600,9694=>600,9695=>600,9696=>600,9697=>600,9698=>600,9699=>600,9700=>600,9701=>600,9702=>600, -9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600,9710=>600,9711=>600,9712=>600, -9713=>600,9714=>600,9715=>600,9716=>600,9717=>600,9718=>600,9719=>600,9720=>600,9721=>600,9722=>600, -9723=>600,9724=>600,9725=>600,9726=>600,9727=>600,9728=>600,9729=>600,9730=>600,9731=>600,9733=>600, -9734=>600,9735=>600,9736=>600,9737=>600,9744=>600,9745=>600,9746=>600,9754=>600,9755=>600,9756=>600, -9757=>600,9758=>600,9759=>600,9766=>600,9768=>600,9769=>600,9774=>600,9775=>600,9776=>600,9777=>600, -9778=>600,9779=>600,9780=>600,9781=>600,9782=>600,9783=>600,9785=>600,9786=>600,9787=>600,9788=>600, -9789=>600,9790=>600,9791=>600,9792=>600,9793=>600,9794=>600,9795=>600,9796=>600,9797=>600,9798=>600, -9799=>600,9800=>600,9801=>600,9802=>600,9803=>600,9804=>600,9805=>600,9806=>600,9807=>600,9808=>600, -9809=>600,9810=>600,9811=>600,9824=>600,9825=>600,9826=>600,9827=>600,9828=>600,9829=>600,9830=>600, -9831=>600,9833=>600,9834=>600,9835=>600,9836=>600,9837=>600,9838=>600,9839=>600,9856=>600,9857=>600, -9858=>600,9859=>600,9860=>600,9861=>600,10176=>600,10177=>600,10178=>600,10179=>600,10180=>600,10181=>600, -10182=>600,10183=>600,10184=>600,10185=>600,10186=>600,10188=>600,10192=>600,10193=>600,10194=>600,10195=>600, -10196=>600,10197=>600,10198=>600,10199=>600,10212=>600,10213=>600,10214=>600,10215=>600,10216=>600,10217=>600, -10218=>600,10219=>600,10226=>600,10227=>600,10229=>600,10230=>600,10231=>600,10232=>600,10233=>600,10234=>600, -10235=>600,10236=>600,10240=>600,10241=>600,10242=>600,10243=>600,10244=>600,10245=>600,10246=>600,10247=>600, -10248=>600,10249=>600,10250=>600,10251=>600,10252=>600,10253=>600,10254=>600,10255=>600,10256=>600,10257=>600, -10258=>600,10259=>600,10260=>600,10261=>600,10262=>600,10263=>600,10264=>600,10265=>600,10266=>600,10267=>600, -10268=>600,10269=>600,10270=>600,10271=>600,10272=>600,10273=>600,10274=>600,10275=>600,10276=>600,10277=>600, -10278=>600,10279=>600,10280=>600,10281=>600,10282=>600,10283=>600,10284=>600,10285=>600,10286=>600,10287=>600, -10288=>600,10289=>600,10290=>600,10291=>600,10292=>600,10293=>600,10294=>600,10295=>600,10296=>600,10297=>600, -10298=>600,10299=>600,10300=>600,10301=>600,10302=>600,10303=>600,10304=>600,10305=>600,10306=>600,10307=>600, -10308=>600,10309=>600,10310=>600,10311=>600,10312=>600,10313=>600,10314=>600,10315=>600,10316=>600,10317=>600, -10318=>600,10319=>600,10320=>600,10321=>600,10322=>600,10323=>600,10324=>600,10325=>600,10326=>600,10327=>600, -10328=>600,10329=>600,10330=>600,10331=>600,10332=>600,10333=>600,10334=>600,10335=>600,10336=>600,10337=>600, -10338=>600,10339=>600,10340=>600,10341=>600,10342=>600,10343=>600,10344=>600,10345=>600,10346=>600,10347=>600, -10348=>600,10349=>600,10350=>600,10351=>600,10352=>600,10353=>600,10354=>600,10355=>600,10356=>600,10357=>600, -10358=>600,10359=>600,10360=>600,10361=>600,10362=>600,10363=>600,10364=>600,10365=>600,10366=>600,10367=>600, -10368=>600,10369=>600,10370=>600,10371=>600,10372=>600,10373=>600,10374=>600,10375=>600,10376=>600,10377=>600, -10378=>600,10379=>600,10380=>600,10381=>600,10382=>600,10383=>600,10384=>600,10385=>600,10386=>600,10387=>600, -10388=>600,10389=>600,10390=>600,10391=>600,10392=>600,10393=>600,10394=>600,10395=>600,10396=>600,10397=>600, -10398=>600,10399=>600,10400=>600,10401=>600,10402=>600,10403=>600,10404=>600,10405=>600,10406=>600,10407=>600, -10408=>600,10409=>600,10410=>600,10411=>600,10412=>600,10413=>600,10414=>600,10415=>600,10416=>600,10417=>600, -10418=>600,10419=>600,10420=>600,10421=>600,10422=>600,10423=>600,10424=>600,10425=>600,10426=>600,10427=>600, -10428=>600,10429=>600,10430=>600,10431=>600,10432=>600,10433=>600,10434=>600,10435=>600,10436=>600,10437=>600, -10438=>600,10439=>600,10440=>600,10441=>600,10442=>600,10443=>600,10444=>600,10445=>600,10446=>600,10447=>600, -10448=>600,10449=>600,10450=>600,10451=>600,10452=>600,10453=>600,10454=>600,10455=>600,10456=>600,10457=>600, -10458=>600,10459=>600,10460=>600,10461=>600,10462=>600,10463=>600,10464=>600,10465=>600,10466=>600,10467=>600, -10468=>600,10469=>600,10470=>600,10471=>600,10472=>600,10473=>600,10474=>600,10475=>600,10476=>600,10477=>600, -10478=>600,10479=>600,10480=>600,10481=>600,10482=>600,10483=>600,10484=>600,10485=>600,10486=>600,10487=>600, -10488=>600,10489=>600,10490=>600,10491=>600,10492=>600,10493=>600,10494=>600,10495=>600,10752=>600,10753=>600, -10754=>600,10755=>600,10756=>600,10757=>600,10758=>600,10781=>600,10815=>600,11008=>600,11009=>600,11010=>600, -11011=>600,11012=>600,11013=>600,11014=>600,11015=>600,11016=>600,11017=>600,11018=>600,11019=>600,11020=>600, -11021=>600,11026=>600,11027=>600,11028=>600,11029=>600,11030=>600,11031=>600,11032=>600,11033=>600,11035=>600, -11036=>600,11037=>600,11038=>600,11039=>600,11040=>600,11041=>600,11042=>600,11043=>600,11044=>600,11045=>600, -11046=>600,11047=>600,11048=>600,11049=>600,11050=>600,11051=>600,11091=>600,11092=>600,64256=>600,64257=>600, -64258=>600,64259=>600,64260=>600,64261=>600,64285=>600,64286=>600,64287=>600,64288=>600,64289=>600,64290=>600, -64291=>600,64292=>600,64293=>600,64294=>600,64295=>600,64296=>600,64297=>600,64298=>600,64299=>600,64300=>600, -64301=>600,64302=>600,64303=>600,64304=>600,64305=>600,64306=>600,64307=>600,64308=>600,64309=>600,64310=>600, -64312=>600,64313=>600,64314=>600,64315=>600,64316=>600,64318=>600,64320=>600,64321=>600,64323=>600,64324=>600, -64326=>600,64327=>600,64328=>600,64329=>600,64330=>600,64331=>600,64332=>600,64333=>600,64334=>600,64335=>600, -65533=>600); -$enc=''; -$diff=''; -$file='freemono.z'; -$ctg='freemono.ctg.z'; -$originalsize=314348; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.z deleted file mode 100644 index 0353139dce..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemono.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.ctg.z deleted file mode 100644 index 40443bbefa..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.php deleted file mode 100644 index 83f454ec21..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.php +++ /dev/null @@ -1,204 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeMonoBold'; -$desc=array('Ascent'=>800,'Descent'=>-200,'CapHeight'=>10,'Flags'=>32,'FontBBox'=>'[-604 -200 754 800]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600, -42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600, -52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600, -62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600, -72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600, -82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600, -92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600, -102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600, -112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600, -122=>600,123=>600,124=>600,125=>600,126=>600,8364=>600,8218=>600,402=>600,8222=>600,8230=>600, -8224=>600,8225=>600,710=>600,8240=>600,352=>600,8249=>600,338=>600,381=>600,8216=>600,8217=>600, -8220=>600,8221=>600,8226=>600,8211=>600,8212=>600,732=>600,8482=>600,353=>600,8250=>600,339=>600, -382=>600,376=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600, -168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600, -178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600, -188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600, -198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600, -208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600, -218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600, -228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600, -238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600, -248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600,256=>600,257=>600, -258=>600,259=>600,260=>600,261=>600,262=>600,263=>600,264=>600,265=>600,266=>600,267=>600, -268=>600,269=>600,270=>600,271=>600,272=>600,273=>600,274=>600,275=>600,276=>600,277=>600, -278=>600,279=>600,280=>600,281=>600,282=>600,283=>600,284=>600,285=>600,286=>600,287=>600, -288=>600,289=>600,290=>600,291=>600,292=>600,293=>600,294=>600,295=>600,296=>600,297=>600, -298=>600,299=>600,300=>600,301=>600,302=>600,303=>600,304=>600,305=>600,306=>600,307=>600, -308=>600,309=>600,310=>600,311=>600,312=>600,313=>600,314=>600,315=>600,316=>600,317=>600, -318=>600,319=>600,320=>600,321=>600,322=>600,323=>600,324=>600,325=>600,326=>600,327=>600, -328=>600,329=>600,330=>600,331=>600,332=>600,333=>600,334=>600,335=>600,336=>600,337=>600, -340=>600,341=>600,342=>600,343=>600,344=>600,345=>600,346=>600,347=>600,348=>600,349=>600, -350=>600,351=>600,354=>600,355=>600,356=>600,357=>600,358=>600,359=>600,360=>600,361=>600, -362=>600,363=>600,364=>600,365=>600,366=>600,367=>600,368=>600,369=>600,370=>600,371=>600, -372=>600,373=>600,374=>600,375=>600,377=>600,378=>600,379=>600,380=>600,383=>600,384=>600, -385=>600,386=>600,387=>600,388=>600,389=>600,390=>600,391=>600,392=>600,393=>600,394=>600, -395=>600,396=>600,397=>600,398=>600,399=>600,400=>600,401=>600,403=>600,404=>600,405=>600, -406=>600,407=>600,408=>600,409=>600,410=>600,411=>600,412=>600,413=>600,414=>600,415=>600, -416=>600,417=>600,418=>600,419=>600,420=>600,421=>600,422=>600,423=>600,424=>600,425=>600, -426=>600,427=>600,428=>600,429=>600,430=>600,431=>600,432=>600,433=>600,434=>600,435=>600, -436=>600,437=>600,438=>600,439=>600,440=>600,441=>600,442=>600,443=>600,444=>600,445=>600, -446=>600,447=>600,448=>600,449=>600,450=>600,451=>600,452=>600,453=>600,454=>600,455=>600, -456=>600,457=>600,458=>600,459=>600,460=>600,461=>600,462=>600,463=>600,464=>600,465=>600, -466=>600,467=>600,468=>600,469=>600,470=>600,471=>600,472=>600,473=>600,474=>600,475=>600, -476=>600,477=>600,478=>600,479=>600,480=>600,481=>600,482=>600,483=>600,484=>600,485=>600, -486=>600,487=>600,488=>600,489=>600,490=>600,491=>600,492=>600,493=>600,494=>600,495=>600, -496=>600,497=>600,498=>600,499=>600,500=>600,501=>600,502=>600,503=>600,504=>600,505=>600, -506=>600,507=>600,508=>600,509=>600,510=>600,511=>600,512=>600,513=>600,514=>600,515=>600, -516=>600,517=>600,518=>600,519=>600,520=>600,521=>600,522=>600,523=>600,524=>600,525=>600, -526=>600,527=>600,528=>600,529=>600,530=>600,531=>600,532=>600,533=>600,534=>600,535=>600, -536=>600,537=>600,538=>600,539=>600,540=>600,541=>600,542=>600,543=>600,548=>600,549=>600, -550=>600,551=>600,552=>600,553=>600,554=>600,555=>600,556=>600,557=>600,558=>600,559=>600, -560=>600,561=>600,562=>600,563=>600,567=>600,592=>600,593=>600,594=>600,595=>600,596=>600, -598=>600,599=>600,600=>600,601=>600,603=>600,604=>600,607=>600,608=>600,609=>600,613=>600, -614=>600,615=>600,616=>600,617=>600,618=>600,619=>600,621=>600,623=>600,624=>600,625=>600, -626=>600,627=>600,628=>600,629=>600,633=>600,634=>600,635=>600,636=>600,637=>600,638=>600, -639=>600,640=>600,641=>600,642=>600,643=>600,644=>600,645=>600,647=>600,648=>600,649=>600, -652=>600,653=>600,654=>600,656=>600,657=>600,658=>600,659=>600,660=>600,661=>600,662=>600, -663=>600,664=>600,665=>600,666=>600,667=>600,668=>600,669=>600,670=>600,671=>600,672=>600, -673=>600,674=>600,688=>600,689=>600,690=>600,691=>600,692=>600,693=>600,694=>600,695=>600, -696=>600,697=>600,698=>600,699=>600,700=>600,701=>600,702=>600,703=>600,704=>600,705=>600, -706=>600,707=>600,708=>600,709=>600,711=>600,712=>600,713=>600,714=>600,715=>600,716=>600, -717=>600,718=>600,719=>600,720=>600,721=>600,722=>600,723=>600,724=>600,725=>600,726=>600, -727=>600,728=>600,729=>600,730=>600,731=>600,733=>600,734=>600,735=>600,736=>600,737=>600, -738=>600,739=>600,740=>600,741=>600,742=>600,743=>600,744=>600,745=>600,746=>600,747=>600, -748=>600,749=>600,750=>600,751=>600,752=>600,753=>600,754=>600,755=>600,756=>600,757=>600, -758=>600,759=>600,760=>600,761=>600,762=>600,763=>600,764=>600,765=>600,766=>600,767=>600, -768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0, -778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0, -788=>0,789=>0,790=>0,791=>0,795=>0,796=>0,800=>0,801=>0,802=>0,803=>0, -804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,812=>0,813=>0,814=>0, -815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,826=>0, -827=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,838=>0,839=>0,840=>0, -844=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0,855=>0,884=>600,885=>600, -890=>600,894=>600,900=>600,901=>600,902=>600,903=>600,904=>600,905=>600,906=>600,908=>600, -910=>600,911=>600,912=>600,913=>600,914=>600,915=>600,916=>600,917=>600,918=>600,919=>600, -920=>600,921=>600,922=>600,923=>600,924=>600,925=>600,926=>600,927=>600,928=>600,929=>600, -931=>600,932=>600,933=>600,934=>600,935=>600,936=>600,937=>600,938=>600,939=>600,940=>600, -941=>600,942=>600,943=>600,944=>600,945=>600,946=>600,947=>600,948=>600,949=>600,950=>600, -951=>600,952=>600,953=>600,954=>600,955=>600,956=>600,957=>600,958=>600,959=>600,960=>600, -961=>600,962=>600,963=>600,964=>600,965=>600,966=>600,967=>600,968=>600,969=>600,970=>600, -971=>600,972=>600,973=>600,974=>600,976=>600,977=>600,978=>600,979=>600,980=>600,981=>600, -982=>600,986=>600,987=>600,988=>600,1008=>600,1009=>600,1012=>600,1013=>600,1024=>600,1025=>600, -1026=>600,1027=>600,1028=>600,1029=>600,1030=>600,1031=>600,1032=>600,1033=>600,1034=>600,1035=>600, -1036=>600,1037=>600,1038=>600,1039=>600,1040=>600,1041=>600,1042=>600,1043=>600,1044=>600,1045=>600, -1046=>600,1047=>600,1048=>600,1049=>600,1050=>600,1051=>600,1052=>600,1053=>600,1054=>600,1055=>600, -1056=>600,1057=>600,1058=>600,1059=>600,1060=>600,1061=>600,1062=>600,1063=>600,1064=>600,1065=>600, -1066=>600,1067=>600,1068=>600,1069=>600,1070=>600,1071=>600,1072=>600,1073=>600,1074=>600,1075=>600, -1076=>600,1077=>600,1078=>600,1079=>600,1080=>600,1081=>600,1082=>600,1083=>600,1084=>600,1085=>600, -1086=>600,1087=>600,1088=>600,1089=>600,1090=>600,1091=>600,1092=>600,1093=>600,1094=>600,1095=>600, -1096=>600,1097=>600,1098=>600,1099=>600,1100=>600,1101=>600,1102=>600,1103=>600,1104=>600,1105=>600, -1106=>600,1107=>600,1108=>600,1109=>600,1110=>600,1111=>600,1112=>600,1113=>600,1114=>600,1115=>600, -1116=>600,1117=>600,1118=>600,1119=>600,1136=>600,1137=>600,1138=>600,1156=>0,1157=>0,1158=>0, -1162=>600,1163=>600,1164=>600,1165=>600,1166=>600,1167=>600,1168=>600,1169=>600,1170=>600,1171=>600, -1172=>600,1173=>600,1174=>600,1175=>600,1176=>600,1177=>600,1178=>600,1179=>600,1180=>600,1181=>600, -1182=>600,1183=>600,1184=>600,1185=>600,1186=>600,1187=>600,1188=>600,1189=>600,1190=>600,1191=>600, -1192=>600,1193=>600,1194=>600,1195=>600,1196=>600,1197=>600,1198=>600,1199=>600,1200=>600,1201=>600, -1202=>600,1203=>600,1204=>600,1205=>600,1206=>600,1207=>600,1208=>600,1209=>600,1210=>600,1211=>600, -1212=>600,1213=>600,1214=>600,1215=>600,1216=>600,1217=>600,1218=>600,1219=>600,1220=>600,1221=>600, -1222=>600,1223=>600,1224=>600,1225=>600,1226=>600,1227=>600,1228=>600,1229=>600,1230=>600,1231=>600, -1232=>600,1233=>600,1234=>600,1235=>600,1236=>600,1237=>600,1238=>600,1239=>600,1240=>600,1241=>600, -1242=>600,1243=>600,1244=>600,1245=>600,1246=>600,1247=>600,1248=>600,1249=>600,1250=>600,1251=>600, -1252=>600,1253=>600,1254=>600,1255=>600,1256=>600,1257=>600,1258=>600,1259=>600,1260=>600,1261=>600, -1262=>600,1263=>600,1264=>600,1265=>600,1266=>600,1267=>600,1268=>600,1269=>600,1270=>600,1271=>600, -1272=>600,1273=>600,1296=>600,1297=>600,1298=>600,1299=>600,1306=>600,1307=>600,1308=>600,1309=>600, -1310=>600,1311=>600,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0, -1464=>0,1465=>0,1467=>0,1468=>0,1469=>0,1470=>600,1471=>0,1472=>600,1473=>0,1474=>0, -1475=>600,1476=>0,1488=>600,1489=>600,1490=>600,1491=>600,1492=>600,1493=>600,1494=>600,1495=>600, -1496=>600,1497=>600,1498=>600,1499=>600,1500=>600,1501=>600,1502=>600,1503=>600,1504=>600,1505=>600, -1506=>600,1507=>600,1508=>600,1509=>600,1510=>600,1511=>600,1512=>600,1513=>600,1514=>600,1520=>600, -1521=>600,1522=>600,1523=>600,1524=>600,4304=>600,4305=>600,4306=>600,4307=>600,4308=>600,4309=>600, -4310=>600,4311=>600,4312=>600,4313=>600,4314=>600,4315=>600,4316=>600,4317=>600,4318=>600,4319=>600, -4320=>600,4321=>600,4322=>600,4323=>600,4324=>600,4325=>600,4326=>600,4327=>600,4328=>600,4329=>600, -4330=>600,4331=>600,4332=>600,4333=>600,4334=>600,4335=>600,4336=>600,4337=>600,4338=>600,4339=>600, -4340=>600,4341=>600,4345=>600,4347=>600,7680=>600,7681=>600,7682=>600,7683=>600,7684=>600,7685=>600, -7686=>600,7687=>600,7688=>600,7689=>600,7690=>600,7691=>600,7692=>600,7693=>600,7694=>600,7695=>600, -7696=>600,7697=>600,7698=>600,7699=>600,7700=>600,7701=>600,7702=>600,7703=>600,7704=>600,7705=>600, -7706=>600,7707=>600,7708=>600,7709=>600,7710=>600,7711=>600,7712=>600,7713=>600,7714=>600,7715=>600, -7716=>600,7717=>600,7718=>600,7719=>600,7720=>600,7721=>600,7722=>600,7723=>600,7724=>600,7725=>600, -7726=>600,7727=>600,7728=>600,7729=>600,7730=>600,7731=>600,7732=>600,7733=>600,7734=>600,7735=>600, -7736=>600,7737=>600,7738=>600,7739=>600,7740=>600,7741=>600,7742=>600,7743=>600,7744=>600,7745=>600, -7746=>600,7747=>600,7748=>600,7749=>600,7750=>600,7751=>600,7752=>600,7753=>600,7754=>600,7755=>600, -7756=>600,7757=>600,7758=>600,7759=>600,7760=>600,7761=>600,7762=>600,7763=>600,7764=>600,7765=>600, -7766=>600,7767=>600,7768=>600,7769=>600,7770=>600,7771=>600,7772=>600,7773=>600,7774=>600,7775=>600, -7776=>600,7777=>600,7778=>600,7779=>600,7780=>600,7781=>600,7782=>600,7783=>600,7784=>600,7785=>600, -7786=>600,7787=>600,7788=>600,7789=>600,7790=>600,7791=>600,7792=>600,7793=>600,7794=>600,7795=>600, -7796=>600,7797=>600,7798=>600,7799=>600,7800=>600,7801=>600,7802=>600,7803=>600,7804=>600,7805=>600, -7806=>600,7807=>600,7808=>600,7809=>600,7810=>600,7811=>600,7812=>600,7813=>600,7814=>600,7815=>600, -7816=>600,7817=>600,7818=>600,7819=>600,7820=>600,7821=>600,7822=>600,7823=>600,7824=>600,7825=>600, -7826=>600,7827=>600,7828=>600,7829=>600,7830=>600,7831=>600,7832=>600,7833=>600,7834=>600,7835=>600, -7840=>600,7841=>600,7842=>600,7843=>600,7844=>600,7845=>600,7846=>600,7847=>600,7848=>600,7849=>600, -7850=>600,7851=>600,7852=>600,7853=>600,7854=>600,7855=>600,7856=>600,7857=>600,7858=>600,7859=>600, -7860=>600,7861=>600,7862=>600,7863=>600,7864=>600,7865=>600,7866=>600,7867=>600,7868=>600,7869=>600, -7870=>600,7871=>600,7872=>600,7873=>600,7874=>600,7875=>600,7876=>600,7877=>600,7878=>600,7879=>600, -7880=>600,7881=>600,7882=>600,7883=>600,7884=>600,7885=>600,7886=>600,7887=>600,7888=>600,7889=>600, -7890=>600,7891=>600,7892=>600,7893=>600,7894=>600,7895=>600,7896=>600,7897=>600,7898=>600,7899=>600, -7900=>600,7901=>600,7902=>600,7903=>600,7904=>600,7905=>600,7906=>600,7907=>600,7908=>600,7909=>600, -7910=>600,7911=>600,7912=>600,7913=>600,7914=>600,7915=>600,7916=>600,7917=>600,7918=>600,7919=>600, -7920=>600,7921=>600,7922=>600,7923=>600,7924=>600,7925=>600,7926=>600,7927=>600,7928=>600,7929=>600, -8192=>600,8193=>600,8194=>600,8195=>600,8196=>600,8197=>600,8198=>600,8199=>600,8200=>600,8201=>600, -8202=>600,8203=>600,8204=>0,8205=>0,8206=>0,8207=>0,8208=>600,8209=>600,8210=>600,8213=>600, -8214=>600,8215=>600,8219=>600,8223=>600,8227=>600,8228=>600,8229=>600,8231=>600,8232=>600,8233=>600, -8234=>600,8235=>600,8236=>600,8237=>600,8238=>600,8239=>600,8241=>600,8242=>600,8243=>600,8244=>600, -8245=>600,8246=>600,8247=>600,8248=>600,8251=>600,8252=>600,8253=>600,8254=>600,8255=>600,8256=>600, -8257=>600,8258=>600,8259=>600,8260=>600,8261=>600,8262=>600,8263=>600,8264=>600,8265=>600,8266=>600, -8267=>600,8268=>600,8269=>600,8270=>600,8271=>600,8272=>600,8273=>600,8274=>600,8275=>600,8276=>600, -8277=>600,8278=>600,8279=>600,8280=>600,8281=>600,8282=>600,8283=>600,8284=>600,8285=>600,8286=>600, -8287=>600,8288=>600,8289=>600,8290=>600,8291=>600,8292=>600,8298=>600,8299=>600,8300=>600,8301=>600, -8302=>600,8303=>600,8304=>600,8305=>600,8308=>600,8309=>600,8310=>600,8311=>600,8312=>600,8313=>600, -8314=>600,8315=>600,8316=>600,8317=>600,8318=>600,8319=>600,8320=>600,8321=>600,8322=>600,8323=>600, -8324=>600,8325=>600,8326=>600,8327=>600,8328=>600,8329=>600,8330=>600,8331=>600,8332=>600,8333=>600, -8334=>600,8336=>600,8337=>600,8338=>600,8339=>600,8340=>600,8355=>600,8356=>600,8362=>600,8373=>600, -8448=>600,8449=>600,8451=>600,8453=>600,8454=>600,8457=>600,8465=>600,8466=>600,8470=>600,8472=>600, -8476=>600,8481=>600,8486=>600,8487=>600,8489=>600,8490=>600,8491=>600,8498=>600,8501=>600,8502=>600, -8503=>600,8504=>600,8506=>600,8507=>600,8523=>600,8531=>600,8532=>600,8533=>600,8534=>600,8535=>600, -8536=>600,8537=>600,8538=>600,8539=>600,8540=>600,8541=>600,8542=>600,8543=>600,8544=>600,8545=>600, -8546=>600,8547=>600,8548=>600,8549=>600,8550=>600,8553=>600,8556=>600,8557=>600,8558=>600,8559=>600, -8560=>600,8564=>600,8569=>600,8572=>600,8573=>600,8574=>600,8575=>600,8592=>600,8593=>600,8594=>600, -8595=>600,8704=>600,8706=>600,8707=>600,8709=>600,8710=>600,8711=>600,8712=>600,8713=>600,8715=>600, -8716=>600,8721=>600,8722=>600,8723=>600,8725=>600,8730=>600,8733=>600,8734=>600,8735=>600,8756=>600, -8800=>600,8801=>600,8804=>600,8805=>600,8834=>600,8835=>600,8836=>600,8837=>600,8838=>600,8839=>600, -8869=>600,8976=>600,9001=>600,9002=>600,9251=>600,9472=>600,9473=>600,9474=>600,9475=>600,9476=>600, -9477=>600,9478=>600,9479=>600,9480=>600,9481=>600,9482=>600,9483=>600,9484=>600,9485=>600,9486=>600, -9487=>600,9488=>600,9489=>600,9490=>600,9491=>600,9492=>600,9493=>600,9494=>600,9495=>600,9496=>600, -9497=>600,9498=>600,9499=>600,9500=>600,9501=>600,9502=>600,9503=>600,9504=>600,9505=>600,9506=>600, -9507=>600,9508=>600,9509=>600,9510=>600,9511=>600,9512=>600,9513=>600,9514=>600,9515=>600,9516=>600, -9517=>600,9518=>600,9519=>600,9520=>600,9521=>600,9522=>600,9523=>600,9524=>600,9525=>600,9526=>600, -9527=>600,9528=>600,9529=>600,9530=>600,9531=>600,9532=>600,9533=>600,9534=>600,9535=>600,9536=>600, -9537=>600,9538=>600,9539=>600,9540=>600,9541=>600,9542=>600,9543=>600,9544=>600,9545=>600,9546=>600, -9547=>600,9548=>600,9549=>600,9550=>600,9551=>600,9552=>600,9553=>600,9554=>600,9555=>600,9556=>600, -9557=>600,9558=>600,9559=>600,9560=>600,9561=>600,9562=>600,9563=>600,9564=>600,9565=>600,9566=>600, -9567=>600,9568=>600,9569=>600,9570=>600,9571=>600,9572=>600,9573=>600,9574=>600,9575=>600,9576=>600, -9577=>600,9578=>600,9579=>600,9580=>600,9581=>600,9582=>600,9583=>600,9584=>600,9585=>600,9586=>600, -9587=>600,9588=>600,9589=>600,9590=>600,9591=>600,9592=>600,9593=>600,9594=>600,9595=>600,9596=>600, -9597=>600,9598=>600,9599=>600,9600=>600,9601=>600,9602=>600,9603=>600,9604=>600,9605=>600,9606=>600, -9607=>600,9608=>600,9609=>600,9610=>600,9611=>600,9612=>600,9613=>600,9614=>600,9615=>600,9616=>600, -9617=>600,9618=>600,9619=>600,9620=>600,9621=>600,9632=>600,9633=>600,9635=>600,9636=>600,9637=>600, -9638=>600,9639=>600,9640=>600,9641=>600,9642=>600,9643=>600,9644=>600,9645=>600,9646=>600,9647=>600, -9648=>600,9649=>600,9650=>600,9651=>600,9652=>600,9653=>600,9654=>600,9655=>600,9656=>600,9657=>600, -9658=>600,9660=>600,9661=>600,9662=>600,9663=>600,9664=>600,9665=>600,9666=>600,9667=>600,9668=>600, -9669=>600,9670=>600,9671=>600,9673=>600,9674=>600,9675=>600,9677=>600,9679=>600,9680=>600,9681=>600, -9682=>600,9683=>600,9684=>600,9685=>600,9686=>600,9687=>600,9688=>600,9689=>600,9698=>600,9699=>600, -9700=>600,9701=>600,9702=>600,9703=>600,9704=>600,9705=>600,9706=>600,9707=>600,9708=>600,9709=>600, -9710=>600,9712=>600,9713=>600,9714=>600,9715=>600,9716=>600,9717=>600,9718=>600,9719=>600,9735=>600, -9736=>600,9737=>600,9776=>600,9777=>600,9778=>600,9779=>600,9780=>600,9781=>600,9782=>600,9783=>600, -9785=>600,9786=>600,9787=>600,9824=>600,9825=>600,9826=>600,9827=>600,9828=>600,9829=>600,9830=>600, -9831=>600,9833=>600,9834=>600,9835=>600,9836=>600,9837=>600,9838=>600,9839=>600,64256=>600,64257=>600, -64258=>600,64285=>600,64287=>600,64288=>600,64298=>600,64299=>600,64300=>600,64301=>600,64302=>600,64303=>600, -64304=>600,64305=>600,64306=>600,64307=>600,64308=>600,64309=>600,64310=>600,64312=>600,64313=>600,64314=>600, -64315=>600,64316=>600,64318=>600,64320=>600,64321=>600,64323=>600,64324=>600,64326=>600,64327=>600,64328=>600, -64329=>600,64330=>600,64331=>600,64332=>600,64333=>600,64334=>600,64335=>600,65533=>600); -$enc=''; -$diff=''; -$file='freemonob.z'; -$ctg='freemonob.ctg.z'; -$originalsize=164212; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.z deleted file mode 100644 index 84b1dec7c4..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonob.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.ctg.z deleted file mode 100644 index efaebb08fe..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.php deleted file mode 100644 index d24713f4c8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeMonoBoldOblique'; -$desc=array('Ascent'=>800,'Descent'=>-200,'CapHeight'=>19,'Flags'=>96,'FontBBox'=>'[-644 -200 833 800]','ItalicAngle'=>-12,'StemV'=>120,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600, -42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600, -52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600, -62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600, -72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600, -82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600, -92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600, -102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600, -112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600, -122=>600,123=>600,124=>600,125=>600,126=>600,8364=>600,8218=>600,402=>600,8222=>600,8230=>600, -8224=>600,8225=>600,710=>600,8240=>600,352=>600,8249=>600,338=>600,381=>600,8216=>600,8217=>600, -8220=>600,8221=>600,8226=>600,8211=>600,8212=>600,732=>600,8482=>600,353=>600,8250=>600,339=>600, -382=>600,376=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600, -168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600, -178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600, -188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600, -198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600, -208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600, -218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600, -228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600, -238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600, -248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600,256=>600,257=>600, -258=>600,259=>600,260=>600,261=>600,262=>600,263=>600,264=>600,265=>600,266=>600,267=>600, -268=>600,269=>600,270=>600,271=>600,272=>600,273=>600,274=>600,275=>600,276=>600,277=>600, -278=>600,279=>600,280=>600,281=>600,282=>600,283=>600,284=>600,285=>600,286=>600,287=>600, -288=>600,289=>600,290=>600,291=>600,292=>600,293=>600,294=>600,295=>600,296=>600,297=>600, -298=>600,299=>600,300=>600,301=>600,302=>600,303=>600,304=>600,305=>600,306=>600,307=>600, -308=>600,309=>600,310=>600,311=>600,312=>600,313=>600,314=>600,315=>600,316=>600,317=>600, -318=>600,319=>600,320=>600,321=>600,322=>600,323=>600,324=>600,325=>600,326=>600,327=>600, -328=>600,329=>600,330=>600,331=>600,332=>600,333=>600,334=>600,335=>600,336=>600,337=>600, -340=>600,341=>600,342=>600,343=>600,344=>600,345=>600,346=>600,347=>600,348=>600,349=>600, -350=>600,351=>600,354=>600,355=>600,356=>600,357=>600,358=>600,359=>600,360=>600,361=>600, -362=>600,363=>600,364=>600,365=>600,366=>600,367=>600,368=>600,369=>600,370=>600,371=>600, -372=>600,373=>600,374=>600,375=>600,377=>600,378=>600,379=>600,380=>600,383=>600,384=>600, -385=>600,386=>600,387=>600,388=>600,389=>600,390=>600,391=>600,392=>600,393=>600,394=>600, -395=>600,396=>600,397=>600,398=>600,399=>600,400=>600,401=>600,403=>600,404=>600,405=>600, -406=>600,407=>600,408=>600,409=>600,410=>600,411=>600,412=>600,413=>600,414=>600,415=>600, -416=>600,417=>600,418=>600,419=>600,420=>600,421=>600,422=>600,423=>600,424=>600,425=>600, -426=>600,427=>600,428=>600,429=>600,430=>600,431=>600,432=>600,433=>600,434=>600,435=>600, -436=>600,437=>600,438=>600,439=>600,440=>600,441=>600,442=>600,443=>600,444=>600,445=>600, -446=>600,447=>600,448=>600,449=>600,450=>600,451=>600,452=>600,453=>600,454=>600,455=>600, -456=>600,457=>600,458=>600,459=>600,460=>600,461=>600,462=>600,463=>600,464=>600,465=>600, -466=>600,467=>600,468=>600,469=>600,470=>600,471=>600,472=>600,473=>600,474=>600,475=>600, -476=>600,477=>600,478=>600,479=>600,480=>600,481=>600,482=>600,483=>600,484=>600,485=>600, -486=>600,487=>600,488=>600,489=>600,490=>600,491=>600,492=>600,493=>600,494=>600,495=>600, -496=>600,497=>600,498=>600,499=>600,500=>600,501=>600,502=>600,503=>600,504=>600,505=>600, -506=>600,507=>600,508=>600,509=>600,510=>600,511=>600,512=>600,513=>600,514=>600,515=>600, -516=>600,517=>600,518=>600,519=>600,520=>600,521=>600,522=>600,523=>600,524=>600,525=>600, -526=>600,527=>600,528=>600,529=>600,530=>600,531=>600,532=>600,533=>600,534=>600,535=>600, -536=>600,537=>600,538=>600,539=>600,540=>600,541=>600,542=>600,543=>600,548=>600,549=>600, -550=>600,551=>600,552=>600,553=>600,554=>600,555=>600,556=>600,557=>600,558=>600,559=>600, -560=>600,561=>600,562=>600,563=>600,567=>600,592=>600,593=>600,594=>600,595=>600,596=>600, -598=>600,599=>600,600=>600,601=>600,603=>600,604=>600,607=>600,608=>600,609=>600,613=>600, -614=>600,615=>600,616=>600,617=>600,618=>600,619=>600,621=>600,623=>600,624=>600,625=>600, -626=>600,627=>600,628=>600,629=>600,633=>600,634=>600,635=>600,636=>600,637=>600,638=>600, -639=>600,640=>600,641=>600,642=>600,643=>600,644=>600,645=>600,647=>600,648=>600,649=>600, -652=>600,653=>600,654=>600,656=>600,657=>600,658=>600,659=>600,660=>600,661=>600,662=>600, -663=>600,664=>600,665=>600,666=>600,667=>600,668=>600,669=>600,670=>600,671=>600,672=>600, -673=>600,674=>600,697=>600,698=>600,699=>600,700=>600,701=>600,702=>600,703=>600,704=>600, -705=>600,706=>600,707=>600,708=>600,709=>600,711=>600,712=>600,713=>600,714=>600,715=>600, -716=>600,717=>600,718=>600,719=>600,720=>600,721=>600,722=>600,723=>600,724=>600,725=>600, -726=>600,727=>600,728=>600,729=>600,730=>600,731=>600,733=>600,734=>600,735=>600,741=>600, -742=>600,743=>600,744=>600,745=>600,746=>600,747=>600,748=>600,749=>600,750=>600,751=>600, -752=>600,753=>600,754=>600,755=>600,756=>600,757=>600,758=>600,759=>600,760=>600,761=>600, -762=>600,763=>600,764=>600,765=>600,766=>600,767=>600,768=>0,769=>0,770=>0,771=>0, -772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0, -782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0, -795=>0,796=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0, -808=>0,809=>0,810=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0, -819=>0,820=>0,821=>0,822=>0,825=>0,826=>0,827=>0,831=>0,832=>0,833=>0, -834=>0,835=>0,836=>0,838=>0,839=>0,840=>0,844=>0,849=>0,850=>0,851=>0, -852=>0,853=>0,854=>0,855=>0,884=>600,885=>600,890=>600,894=>600,900=>600,901=>600, -902=>600,903=>600,904=>600,905=>600,906=>600,908=>600,910=>600,911=>600,912=>600,913=>600, -914=>600,915=>600,916=>600,917=>600,918=>600,919=>600,920=>600,921=>600,922=>600,923=>600, -924=>600,925=>600,926=>600,927=>600,928=>600,929=>600,931=>600,932=>600,933=>600,934=>600, -935=>600,936=>600,937=>600,938=>600,939=>600,940=>600,941=>600,942=>600,943=>600,944=>600, -945=>600,946=>600,947=>600,948=>600,949=>600,950=>600,951=>600,952=>600,953=>600,954=>600, -955=>600,956=>600,957=>600,958=>600,959=>600,960=>600,961=>600,962=>600,963=>600,964=>600, -965=>600,966=>600,967=>600,968=>600,969=>600,970=>600,971=>600,972=>600,973=>600,974=>600, -976=>600,977=>600,978=>600,979=>600,980=>600,981=>600,982=>600,986=>600,987=>600,988=>600, -1008=>600,1009=>600,1012=>600,1013=>600,1024=>600,1025=>600,1026=>600,1027=>600,1028=>600,1029=>600, -1030=>600,1031=>600,1032=>600,1033=>600,1034=>600,1035=>600,1036=>600,1037=>600,1038=>600,1039=>600, -1040=>600,1041=>600,1042=>600,1043=>600,1044=>600,1045=>600,1046=>600,1047=>600,1048=>600,1049=>600, -1050=>600,1051=>600,1052=>600,1053=>600,1054=>600,1055=>600,1056=>600,1057=>600,1058=>600,1059=>600, -1060=>600,1061=>600,1062=>600,1063=>600,1064=>600,1065=>600,1066=>600,1067=>600,1068=>600,1069=>600, -1070=>600,1071=>600,1072=>600,1073=>600,1074=>600,1075=>600,1076=>600,1077=>600,1078=>600,1079=>600, -1080=>600,1081=>600,1082=>600,1083=>600,1084=>600,1085=>600,1086=>600,1087=>600,1088=>600,1089=>600, -1090=>600,1091=>600,1092=>600,1093=>600,1094=>600,1095=>600,1096=>600,1097=>600,1098=>600,1099=>600, -1100=>600,1101=>600,1102=>600,1103=>600,1104=>600,1105=>600,1106=>600,1107=>600,1108=>600,1109=>600, -1110=>600,1111=>600,1112=>600,1113=>600,1114=>600,1115=>600,1116=>600,1117=>600,1118=>600,1119=>600, -1136=>600,1137=>600,1138=>600,1156=>0,1157=>0,1158=>0,1162=>600,1163=>600,1164=>600,1165=>600, -1166=>600,1167=>600,1168=>600,1169=>600,1170=>600,1171=>600,1172=>600,1173=>600,1174=>600,1175=>600, -1176=>600,1177=>600,1178=>600,1179=>600,1180=>600,1181=>600,1182=>600,1183=>600,1184=>600,1185=>600, -1186=>600,1187=>600,1188=>600,1189=>600,1190=>600,1191=>600,1192=>600,1193=>600,1194=>600,1195=>600, -1196=>600,1197=>600,1198=>600,1199=>600,1200=>600,1201=>600,1202=>600,1203=>600,1204=>600,1205=>600, -1206=>600,1207=>600,1208=>600,1209=>600,1210=>600,1211=>600,1212=>600,1213=>600,1214=>600,1215=>600, -1216=>600,1217=>600,1218=>600,1219=>600,1220=>600,1221=>600,1222=>600,1223=>600,1224=>600,1225=>600, -1226=>600,1227=>600,1228=>600,1229=>600,1230=>600,1231=>600,1232=>600,1233=>600,1234=>600,1235=>600, -1236=>600,1237=>600,1238=>600,1239=>600,1240=>600,1241=>600,1242=>600,1243=>600,1244=>600,1245=>600, -1246=>600,1247=>600,1248=>600,1249=>600,1250=>600,1251=>600,1252=>600,1253=>600,1254=>600,1255=>600, -1256=>600,1257=>600,1258=>600,1259=>600,1260=>600,1261=>600,1262=>600,1263=>600,1264=>600,1265=>600, -1266=>600,1267=>600,1268=>600,1269=>600,1270=>600,1271=>600,1272=>600,1273=>600,1296=>600,1297=>600, -1298=>600,1299=>600,1306=>600,1307=>600,1308=>600,1309=>600,1310=>600,1311=>600,1456=>0,1457=>0, -1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0,1468=>0, -1469=>0,1470=>0,1471=>0,1472=>600,1473=>0,1474=>0,1475=>600,1476=>0,1488=>600,1489=>600, -1490=>600,1491=>600,1492=>600,1493=>600,1494=>600,1495=>600,1496=>600,1497=>600,1498=>600,1499=>600, -1500=>600,1501=>600,1502=>600,1503=>600,1504=>600,1505=>600,1506=>600,1507=>600,1508=>600,1509=>600, -1510=>600,1511=>600,1512=>600,1513=>600,1514=>600,1520=>600,1521=>600,1522=>600,1523=>600,1524=>600, -4304=>600,4305=>600,4306=>600,4307=>600,4308=>600,4309=>600,4310=>600,4311=>600,4312=>600,4313=>600, -4314=>600,4315=>600,4316=>600,4317=>600,4318=>600,4319=>600,4320=>600,4321=>600,4322=>600,4323=>600, -4324=>600,4325=>600,4326=>600,4327=>600,4328=>600,4329=>600,4330=>600,4331=>600,4332=>600,4333=>600, -4334=>600,4335=>600,4336=>600,4337=>600,4338=>600,4339=>600,4340=>600,4341=>600,4345=>600,4347=>600, -8192=>600,8193=>600,8194=>600,8195=>600,8196=>600,8197=>600,8198=>600,8199=>600,8200=>600,8201=>600, -8202=>600,8203=>600,8204=>0,8205=>0,8206=>0,8207=>0,8208=>600,8209=>600,8210=>600,8213=>600, -8214=>600,8215=>600,8219=>600,8223=>600,8227=>600,8228=>600,8229=>600,8231=>600,8232=>600,8233=>600, -8234=>600,8235=>600,8236=>600,8237=>600,8238=>600,8239=>600,8241=>600,8242=>600,8243=>600,8244=>600, -8245=>600,8246=>600,8247=>600,8248=>600,8251=>600,8252=>600,8253=>600,8254=>600,8255=>600,8256=>600, -8257=>600,8258=>600,8259=>600,8260=>600,8261=>600,8262=>600,8263=>600,8264=>600,8265=>600,8266=>600, -8267=>600,8268=>600,8269=>600,8270=>600,8271=>600,8272=>600,8273=>600,8274=>600,8275=>600,8276=>600, -8277=>600,8278=>600,8279=>600,8280=>600,8281=>600,8282=>600,8283=>600,8284=>600,8285=>600,8286=>600, -8287=>600,8288=>600,8289=>600,8290=>600,8291=>600,8292=>600,8298=>600,8299=>600,8300=>600,8301=>600, -8302=>600,8303=>600,8304=>600,8305=>600,8308=>600,8309=>600,8310=>600,8311=>600,8312=>600,8313=>600, -8314=>600,8315=>600,8316=>600,8317=>600,8318=>600,8319=>600,8320=>600,8321=>600,8322=>600,8323=>600, -8324=>600,8325=>600,8326=>600,8327=>600,8328=>600,8329=>600,8330=>600,8331=>600,8332=>600,8333=>600, -8334=>600,8336=>600,8337=>600,8338=>600,8339=>600,8340=>600,8362=>600,8373=>600,8448=>600,8449=>600, -8451=>600,8453=>600,8454=>600,8457=>600,8465=>600,8466=>600,8470=>600,8472=>600,8476=>600,8481=>600, -8486=>600,8487=>600,8489=>600,8490=>600,8491=>600,8498=>600,8501=>600,8502=>600,8503=>600,8504=>600, -8506=>600,8507=>600,8523=>600,8531=>600,8532=>600,8533=>600,8534=>600,8535=>600,8536=>600,8537=>600, -8538=>600,8539=>600,8540=>600,8541=>600,8542=>600,8543=>600,8544=>600,8545=>600,8546=>600,8547=>600, -8548=>600,8549=>600,8550=>600,8553=>600,8556=>600,8557=>600,8558=>600,8559=>600,8560=>600,8564=>600, -8569=>600,8572=>600,8573=>600,8574=>600,8575=>600,8592=>600,8593=>600,8594=>600,8595=>600,8704=>600, -8706=>600,8707=>600,8710=>600,8711=>600,8712=>600,8713=>600,8715=>600,8716=>600,8721=>600,8722=>600, -8723=>600,8725=>600,8730=>600,8733=>600,8734=>600,8756=>600,8800=>600,8801=>600,8804=>600,8805=>600, -9251=>600,9674=>600,9824=>600,9825=>600,9826=>600,9827=>600,9828=>600,9829=>600,9830=>600,9831=>600, -9833=>600,9834=>600,9835=>600,9836=>600,9837=>600,9838=>600,9839=>600,64256=>600,64257=>600,64258=>600, -64285=>600,64287=>600,64288=>600,64298=>600,64299=>600,64300=>600,64301=>600,64302=>600,64303=>600,64304=>600, -64305=>600,64306=>600,64307=>600,64308=>600,64309=>600,64310=>600,64312=>600,64313=>600,64314=>600,64315=>600, -64316=>600,64318=>600,64320=>600,64321=>600,64323=>600,64324=>600,64326=>600,64327=>600,64328=>600,64329=>600, -64330=>600,64331=>600,64332=>600,64333=>600,64334=>600,64335=>600,65533=>600); -$enc=''; -$diff=''; -$file='freemonobi.z'; -$ctg='freemonobi.ctg.z'; -$originalsize=145080; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.z deleted file mode 100644 index b31acfb16f..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonobi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.ctg.z deleted file mode 100644 index 36e92ec0da..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.php deleted file mode 100644 index 5d71754c06..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.php +++ /dev/null @@ -1,221 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeMonoOblique'; -$desc=array('Ascent'=>800,'Descent'=>-200,'CapHeight'=>44,'Flags'=>96,'FontBBox'=>'[-644 -200 816 800]','ItalicAngle'=>-12,'StemV'=>70,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600, -42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600, -52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600, -62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600, -72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600, -82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600, -92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600, -102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600, -112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600, -122=>600,123=>600,124=>600,125=>600,126=>600,8364=>600,8218=>600,402=>600,8222=>600,8230=>600, -8224=>600,8225=>600,710=>600,8240=>600,352=>600,8249=>600,338=>600,381=>600,8216=>600,8217=>600, -8220=>600,8221=>600,8226=>600,8211=>600,8212=>600,732=>600,8482=>600,353=>600,8250=>600,339=>600, -382=>600,376=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600, -168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600, -178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600, -188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600, -198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600, -208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600, -218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600, -228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600, -238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600, -248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600,256=>600,257=>600, -258=>600,259=>600,260=>600,261=>600,262=>600,263=>600,264=>600,265=>600,266=>600,267=>600, -268=>600,269=>600,270=>600,271=>600,272=>600,273=>600,274=>600,275=>600,276=>600,277=>600, -278=>600,279=>600,280=>600,281=>600,282=>600,283=>600,284=>600,285=>600,286=>600,287=>600, -288=>600,289=>600,290=>600,291=>600,292=>600,293=>600,294=>600,295=>600,296=>600,297=>600, -298=>600,299=>600,300=>600,301=>600,302=>600,303=>600,304=>600,305=>600,306=>600,307=>600, -308=>600,309=>600,310=>600,311=>600,312=>600,313=>600,314=>600,315=>600,316=>600,317=>600, -318=>600,319=>600,320=>600,321=>600,322=>600,323=>600,324=>600,325=>600,326=>600,327=>600, -328=>600,329=>600,330=>600,331=>600,332=>600,333=>600,334=>600,335=>600,336=>600,337=>600, -340=>600,341=>600,342=>600,343=>600,344=>600,345=>600,346=>600,347=>600,348=>600,349=>600, -350=>600,351=>600,354=>600,355=>600,356=>600,357=>600,358=>600,359=>600,360=>600,361=>600, -362=>600,363=>600,364=>600,365=>600,366=>600,367=>600,368=>600,369=>600,370=>600,371=>600, -372=>600,373=>600,374=>600,375=>600,377=>600,378=>600,379=>600,380=>600,383=>600,384=>600, -385=>600,386=>600,387=>600,388=>600,389=>600,390=>600,391=>600,392=>600,393=>600,394=>600, -395=>600,396=>600,397=>600,398=>600,399=>600,400=>600,401=>600,403=>600,404=>600,405=>600, -406=>600,407=>600,408=>600,409=>600,410=>600,411=>600,412=>600,413=>600,414=>600,415=>600, -416=>600,417=>600,418=>600,419=>600,420=>600,421=>600,422=>600,423=>600,424=>600,425=>600, -426=>600,427=>600,428=>600,429=>600,430=>600,431=>600,432=>600,433=>600,434=>600,435=>600, -436=>600,437=>600,438=>600,439=>600,440=>600,441=>600,442=>600,443=>600,444=>600,445=>600, -446=>600,447=>600,448=>600,449=>600,450=>600,451=>600,452=>600,453=>600,454=>600,455=>600, -456=>600,457=>600,458=>600,459=>600,460=>600,461=>600,462=>600,463=>600,464=>600,465=>600, -466=>600,467=>600,468=>600,469=>600,470=>600,471=>600,472=>600,473=>600,474=>600,475=>600, -476=>600,477=>600,478=>600,479=>600,480=>600,481=>600,482=>600,483=>600,484=>600,485=>600, -486=>600,487=>600,488=>600,489=>600,490=>600,491=>600,492=>600,493=>600,494=>600,495=>600, -496=>600,497=>600,498=>600,499=>600,500=>600,501=>600,502=>600,503=>600,504=>600,505=>600, -506=>600,507=>600,508=>600,509=>600,510=>600,511=>600,512=>600,513=>600,514=>600,515=>600, -516=>600,517=>600,518=>600,519=>600,520=>600,521=>600,522=>600,523=>600,524=>600,525=>600, -526=>600,527=>600,528=>600,529=>600,530=>600,531=>600,532=>600,533=>600,534=>600,535=>600, -536=>600,537=>600,538=>600,539=>600,540=>600,541=>600,542=>600,543=>600,548=>600,549=>600, -550=>600,551=>600,552=>600,553=>600,554=>600,555=>600,556=>600,557=>600,558=>600,559=>600, -560=>600,561=>600,562=>600,563=>600,567=>600,592=>600,593=>600,594=>600,595=>600,596=>600, -597=>600,598=>600,599=>600,600=>600,601=>600,602=>600,603=>600,604=>600,607=>600,608=>600, -609=>600,610=>600,611=>600,612=>600,613=>600,614=>600,615=>600,616=>600,617=>600,618=>600, -619=>600,620=>600,621=>600,622=>600,623=>600,624=>600,625=>600,626=>600,627=>600,628=>600, -629=>600,630=>600,632=>600,633=>600,634=>600,635=>600,636=>600,637=>600,638=>600,639=>600, -640=>600,641=>600,642=>600,643=>600,644=>600,645=>600,646=>600,647=>600,648=>600,649=>600, -651=>600,652=>600,653=>600,654=>600,655=>600,656=>600,657=>600,658=>600,660=>600,661=>600, -662=>600,663=>600,664=>600,665=>600,667=>600,668=>600,669=>600,670=>600,671=>600,672=>600, -673=>600,674=>600,679=>600,688=>600,689=>600,690=>600,691=>600,692=>600,693=>600,694=>600, -695=>600,696=>600,697=>600,698=>600,699=>600,700=>600,701=>600,702=>600,703=>600,704=>600, -705=>600,706=>600,707=>600,708=>600,709=>600,711=>600,712=>600,713=>600,714=>600,715=>600, -716=>600,717=>600,718=>600,719=>600,720=>600,721=>600,722=>600,723=>600,724=>600,725=>600, -726=>600,727=>600,728=>600,729=>600,730=>600,731=>600,733=>600,734=>600,735=>600,736=>600, -737=>600,738=>600,739=>600,740=>600,741=>600,742=>600,743=>600,744=>600,745=>600,746=>600, -747=>600,748=>600,749=>600,750=>600,751=>600,752=>600,753=>600,754=>600,755=>600,756=>600, -757=>600,758=>600,759=>600,760=>600,761=>600,762=>600,763=>600,764=>600,765=>600,766=>600, -767=>600,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0, -777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0, -787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,795=>0,796=>0,800=>0, -803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,812=>0,813=>0, -814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0, -824=>0,825=>0,826=>0,827=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0, -838=>0,839=>0,840=>0,844=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0, -855=>0,884=>600,885=>600,890=>600,894=>600,900=>600,901=>600,902=>600,903=>600,904=>600, -905=>600,906=>600,908=>600,910=>600,911=>600,912=>600,913=>600,914=>600,915=>600,916=>600, -917=>600,918=>600,919=>600,920=>600,921=>600,922=>600,923=>600,924=>600,925=>600,926=>600, -927=>600,928=>600,929=>600,931=>600,932=>600,933=>600,934=>600,935=>600,936=>600,937=>600, -938=>600,939=>600,940=>600,941=>600,942=>600,943=>600,944=>600,945=>600,946=>600,947=>600, -948=>600,949=>600,950=>600,951=>600,952=>600,953=>600,954=>600,955=>600,956=>600,957=>600, -958=>600,959=>600,960=>600,961=>600,962=>600,963=>600,964=>600,965=>600,966=>600,967=>600, -968=>600,969=>600,970=>600,971=>600,972=>600,973=>600,974=>600,976=>600,977=>600,978=>600, -979=>600,980=>600,981=>600,982=>600,986=>600,987=>600,988=>600,1008=>600,1009=>600,1012=>600, -1013=>600,1024=>600,1025=>600,1026=>600,1027=>600,1028=>600,1029=>600,1030=>600,1031=>600,1032=>600, -1033=>600,1034=>600,1035=>600,1036=>600,1037=>600,1038=>600,1039=>600,1040=>600,1041=>600,1042=>600, -1043=>600,1044=>600,1045=>600,1046=>600,1047=>600,1048=>600,1049=>600,1050=>600,1051=>600,1052=>600, -1053=>600,1054=>600,1055=>600,1056=>600,1057=>600,1058=>600,1059=>600,1060=>600,1061=>600,1062=>600, -1063=>600,1064=>600,1065=>600,1066=>600,1067=>600,1068=>600,1069=>600,1070=>600,1071=>600,1072=>600, -1073=>600,1074=>600,1075=>600,1076=>600,1077=>600,1078=>600,1079=>600,1080=>600,1081=>600,1082=>600, -1083=>600,1084=>600,1085=>600,1086=>600,1087=>600,1088=>600,1089=>600,1090=>600,1091=>600,1092=>600, -1093=>600,1094=>600,1095=>600,1096=>600,1097=>600,1098=>600,1099=>600,1100=>600,1101=>600,1102=>600, -1103=>600,1104=>600,1105=>600,1106=>600,1107=>600,1108=>600,1109=>600,1110=>600,1111=>600,1112=>600, -1113=>600,1114=>600,1115=>600,1116=>600,1117=>600,1118=>600,1119=>600,1120=>600,1121=>600,1122=>600, -1123=>600,1124=>600,1126=>600,1127=>600,1128=>600,1130=>600,1131=>600,1132=>600,1133=>600,1136=>600, -1137=>600,1138=>600,1140=>600,1141=>600,1142=>600,1143=>600,1155=>0,1156=>0,1157=>0,1158=>0, -1159=>0,1162=>600,1163=>600,1164=>600,1165=>600,1166=>600,1167=>600,1168=>600,1169=>600,1170=>600, -1171=>600,1172=>600,1173=>600,1174=>600,1175=>600,1176=>600,1177=>600,1178=>600,1179=>600,1180=>600, -1181=>600,1182=>600,1183=>600,1184=>600,1185=>600,1186=>600,1187=>600,1188=>600,1189=>600,1190=>600, -1191=>600,1192=>600,1193=>600,1194=>600,1195=>600,1196=>600,1197=>600,1198=>600,1199=>600,1200=>600, -1201=>600,1202=>600,1203=>600,1204=>600,1205=>600,1206=>600,1207=>600,1208=>600,1209=>600,1210=>600, -1211=>600,1212=>600,1213=>600,1214=>600,1215=>600,1216=>600,1217=>600,1218=>600,1219=>600,1220=>600, -1221=>600,1222=>600,1223=>600,1224=>600,1225=>600,1226=>600,1227=>600,1228=>600,1229=>600,1230=>600, -1231=>600,1232=>600,1233=>600,1234=>600,1235=>600,1236=>600,1237=>600,1238=>600,1239=>600,1240=>600, -1241=>600,1242=>600,1243=>600,1244=>600,1245=>600,1246=>600,1247=>600,1248=>600,1249=>600,1250=>600, -1251=>600,1252=>600,1253=>600,1254=>600,1255=>600,1256=>600,1257=>600,1258=>600,1259=>600,1260=>600, -1261=>600,1262=>600,1263=>600,1264=>600,1265=>600,1266=>600,1267=>600,1268=>600,1269=>600,1270=>600, -1271=>600,1272=>600,1273=>600,1296=>600,1297=>600,1298=>600,1299=>600,1306=>600,1307=>600,1308=>600, -1309=>600,1310=>600,1311=>600,1329=>600,1330=>600,1331=>600,1332=>600,1333=>600,1334=>600,1335=>600, -1336=>600,1337=>600,1338=>600,1339=>600,1340=>600,1341=>600,1342=>600,1343=>600,1344=>600,1345=>600, -1346=>600,1347=>600,1348=>600,1349=>600,1350=>600,1351=>600,1352=>600,1353=>600,1354=>600,1355=>600, -1356=>600,1357=>600,1358=>600,1359=>600,1360=>600,1361=>600,1362=>600,1363=>600,1364=>600,1365=>600, -1366=>600,1369=>600,1370=>600,1371=>600,1372=>600,1373=>600,1374=>600,1375=>600,1377=>600,1378=>600, -1379=>600,1380=>600,1381=>600,1382=>600,1383=>600,1384=>600,1385=>600,1386=>600,1387=>600,1388=>600, -1389=>600,1390=>600,1391=>600,1392=>600,1393=>600,1394=>600,1395=>600,1396=>600,1397=>600,1398=>600, -1399=>600,1400=>600,1401=>600,1402=>600,1403=>600,1404=>600,1405=>600,1406=>600,1407=>600,1408=>600, -1409=>600,1410=>600,1411=>600,1412=>600,1413=>600,1414=>600,1415=>600,1417=>600,1418=>600,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0, -1468=>0,1469=>0,1470=>600,1471=>0,1472=>600,1473=>0,1474=>0,1475=>600,1476=>0,1488=>600, -1489=>600,1490=>600,1491=>600,1492=>600,1493=>600,1494=>600,1495=>600,1496=>600,1497=>600,1498=>600, -1499=>600,1500=>600,1501=>600,1502=>600,1503=>600,1504=>600,1505=>600,1506=>600,1507=>600,1508=>600, -1509=>600,1510=>600,1511=>600,1512=>600,1513=>600,1514=>600,1520=>600,1521=>600,1522=>600,1523=>600, -1524=>600,4304=>600,4305=>600,4306=>600,4307=>600,4308=>600,4309=>600,4310=>600,4311=>600,4312=>600, -4313=>600,4314=>600,4315=>600,4316=>600,4317=>600,4318=>600,4319=>600,4320=>600,4321=>600,4322=>600, -4323=>600,4324=>600,4325=>600,4326=>600,4327=>600,4328=>600,4329=>600,4330=>600,4331=>600,4332=>600, -4333=>600,4334=>600,4335=>600,4336=>600,4337=>600,4338=>600,4339=>600,4340=>600,4341=>600,4345=>600, -4347=>600,7680=>600,7681=>600,7682=>600,7683=>600,7684=>600,7685=>600,7686=>600,7687=>600,7688=>600, -7689=>600,7690=>600,7691=>600,7692=>600,7693=>600,7694=>600,7695=>600,7696=>600,7697=>600,7698=>600, -7699=>600,7700=>600,7701=>600,7702=>600,7703=>600,7704=>600,7705=>600,7706=>600,7707=>600,7708=>600, -7709=>600,7710=>600,7711=>600,7712=>600,7713=>600,7714=>600,7715=>600,7716=>600,7717=>600,7718=>600, -7719=>600,7720=>600,7721=>600,7722=>600,7723=>600,7724=>600,7725=>600,7726=>600,7727=>600,7728=>600, -7729=>600,7730=>600,7731=>600,7732=>600,7733=>600,7734=>600,7735=>600,7736=>600,7737=>600,7738=>600, -7739=>600,7740=>600,7741=>600,7742=>600,7743=>600,7744=>600,7745=>600,7746=>600,7747=>600,7748=>600, -7749=>600,7750=>600,7751=>600,7752=>600,7753=>600,7754=>600,7755=>600,7756=>600,7757=>600,7758=>600, -7759=>600,7760=>600,7761=>600,7762=>600,7763=>600,7764=>600,7765=>600,7766=>600,7767=>600,7768=>600, -7769=>600,7770=>600,7771=>600,7772=>600,7773=>600,7774=>600,7775=>600,7776=>600,7777=>600,7778=>600, -7779=>600,7780=>600,7781=>600,7782=>600,7783=>600,7784=>600,7785=>600,7786=>600,7787=>600,7788=>600, -7789=>600,7790=>600,7791=>600,7792=>600,7793=>600,7794=>600,7795=>600,7796=>600,7797=>600,7798=>600, -7799=>600,7800=>600,7801=>600,7802=>600,7803=>600,7804=>600,7805=>600,7806=>600,7807=>600,7808=>600, -7809=>600,7810=>600,7811=>600,7812=>600,7813=>600,7814=>600,7815=>600,7816=>600,7817=>600,7818=>600, -7819=>600,7820=>600,7821=>600,7822=>600,7823=>600,7824=>600,7825=>600,7826=>600,7827=>600,7828=>600, -7829=>600,7830=>600,7831=>600,7832=>600,7833=>600,7834=>600,7835=>600,7840=>600,7841=>600,7842=>600, -7843=>600,7844=>600,7845=>600,7846=>600,7847=>600,7848=>600,7849=>600,7850=>600,7851=>600,7852=>600, -7853=>600,7854=>600,7855=>600,7856=>600,7857=>600,7858=>600,7859=>600,7860=>600,7861=>600,7862=>600, -7863=>600,7864=>600,7865=>600,7866=>600,7867=>600,7868=>600,7869=>600,7870=>600,7871=>600,7872=>600, -7873=>600,7874=>600,7875=>600,7876=>600,7877=>600,7878=>600,7879=>600,7880=>600,7881=>600,7882=>600, -7883=>600,7884=>600,7885=>600,7886=>600,7887=>600,7888=>600,7889=>600,7890=>600,7891=>600,7892=>600, -7893=>600,7894=>600,7895=>600,7896=>600,7897=>600,7898=>600,7899=>600,7900=>600,7901=>600,7902=>600, -7903=>600,7904=>600,7905=>600,7906=>600,7907=>600,7908=>600,7909=>600,7910=>600,7911=>600,7912=>600, -7913=>600,7914=>600,7915=>600,7916=>600,7917=>600,7918=>600,7919=>600,7920=>600,7921=>600,7922=>600, -7923=>600,7924=>600,7925=>600,7926=>600,7927=>600,7928=>600,7929=>600,7936=>600,7937=>600,7938=>600, -7939=>600,7940=>600,7941=>600,7942=>600,7943=>600,7944=>600,7945=>600,7946=>600,7947=>600,7948=>600, -7949=>600,7950=>600,7951=>600,7952=>600,7953=>600,7954=>600,7955=>600,7956=>600,7957=>600,7960=>600, -7961=>600,7962=>600,7963=>600,7964=>600,7965=>600,7968=>600,7969=>600,7970=>600,7971=>600,7972=>600, -7973=>600,7974=>600,7975=>600,7976=>600,7977=>600,7978=>600,7979=>600,7980=>600,7981=>600,7982=>600, -7983=>600,7984=>600,7985=>600,7986=>600,7987=>600,7988=>600,7989=>600,7990=>600,7991=>600,7992=>600, -7993=>600,7994=>600,7995=>600,7996=>600,7997=>600,7998=>600,7999=>600,8000=>600,8001=>600,8002=>600, -8003=>600,8004=>600,8005=>600,8008=>600,8009=>600,8010=>600,8011=>600,8012=>600,8013=>600,8016=>600, -8017=>600,8018=>600,8019=>600,8020=>600,8021=>600,8022=>600,8023=>600,8025=>600,8027=>600,8029=>600, -8031=>600,8032=>600,8033=>600,8034=>600,8035=>600,8036=>600,8037=>600,8038=>600,8039=>600,8040=>600, -8041=>600,8042=>600,8043=>600,8044=>600,8045=>600,8046=>600,8047=>600,8048=>600,8049=>600,8050=>600, -8051=>600,8052=>600,8053=>600,8054=>600,8055=>600,8056=>600,8057=>600,8058=>600,8059=>600,8060=>600, -8061=>600,8064=>600,8065=>600,8066=>600,8067=>600,8068=>600,8069=>600,8070=>600,8071=>600,8072=>600, -8073=>600,8074=>600,8075=>600,8076=>600,8077=>600,8078=>600,8079=>600,8080=>600,8081=>600,8082=>600, -8083=>600,8084=>600,8085=>600,8086=>600,8087=>600,8088=>600,8089=>600,8090=>600,8091=>600,8092=>600, -8093=>600,8094=>600,8095=>600,8096=>600,8097=>600,8098=>600,8099=>600,8100=>600,8101=>600,8102=>600, -8103=>600,8104=>600,8105=>600,8106=>600,8107=>600,8108=>600,8109=>600,8110=>600,8111=>600,8112=>600, -8113=>600,8114=>600,8115=>600,8116=>600,8118=>600,8119=>600,8120=>600,8121=>600,8122=>600,8123=>600, -8124=>600,8125=>600,8126=>600,8127=>600,8128=>600,8129=>600,8130=>600,8131=>600,8132=>600,8134=>600, -8135=>600,8136=>600,8137=>600,8138=>600,8139=>600,8140=>600,8141=>600,8142=>600,8143=>600,8144=>600, -8145=>600,8146=>600,8147=>600,8150=>600,8151=>600,8152=>600,8153=>600,8154=>600,8155=>600,8157=>600, -8158=>600,8159=>600,8160=>600,8161=>600,8162=>600,8163=>600,8164=>600,8165=>600,8166=>600,8167=>600, -8168=>600,8169=>600,8170=>600,8171=>600,8172=>600,8173=>600,8174=>600,8175=>600,8178=>600,8179=>600, -8180=>600,8182=>600,8183=>600,8184=>600,8185=>600,8186=>600,8187=>600,8188=>600,8189=>600,8190=>600, -8192=>600,8193=>600,8194=>600,8195=>600,8196=>600,8197=>600,8198=>600,8199=>600,8200=>600,8201=>600, -8202=>600,8203=>600,8204=>0,8205=>0,8206=>0,8207=>0,8208=>600,8209=>600,8210=>600,8213=>600, -8214=>600,8215=>600,8219=>600,8223=>600,8227=>600,8228=>600,8229=>600,8231=>600,8232=>600,8233=>600, -8234=>600,8235=>600,8236=>600,8237=>600,8238=>600,8239=>600,8241=>600,8242=>600,8243=>600,8244=>600, -8245=>600,8246=>600,8247=>600,8248=>600,8251=>600,8252=>600,8253=>600,8254=>600,8255=>600,8256=>600, -8257=>600,8258=>600,8259=>600,8260=>600,8261=>600,8262=>600,8263=>600,8264=>600,8265=>600,8266=>600, -8267=>600,8268=>600,8269=>600,8270=>600,8271=>600,8272=>600,8273=>600,8274=>600,8275=>600,8276=>600, -8277=>600,8278=>600,8279=>600,8280=>600,8281=>600,8282=>600,8283=>600,8284=>600,8285=>600,8286=>600, -8287=>600,8288=>600,8289=>600,8290=>600,8291=>600,8292=>600,8298=>600,8299=>600,8300=>600,8301=>600, -8302=>600,8303=>600,8304=>600,8305=>600,8308=>600,8309=>600,8310=>600,8311=>600,8312=>600,8313=>600, -8314=>600,8315=>600,8316=>600,8317=>600,8318=>600,8319=>600,8320=>600,8321=>600,8322=>600,8323=>600, -8324=>600,8325=>600,8326=>600,8327=>600,8328=>600,8329=>600,8330=>600,8331=>600,8332=>600,8333=>600, -8334=>600,8336=>600,8337=>600,8338=>600,8339=>600,8340=>600,8355=>600,8356=>600,8359=>600,8362=>600, -8373=>600,8448=>600,8449=>600,8450=>600,8451=>600,8453=>600,8454=>600,8455=>600,8457=>600,8461=>600, -8464=>600,8465=>600,8466=>600,8467=>600,8468=>600,8469=>600,8470=>600,8471=>600,8472=>600,8473=>600, -8474=>600,8476=>600,8477=>600,8478=>600,8481=>600,8484=>600,8486=>600,8487=>600,8489=>600,8490=>600, -8491=>600,8498=>600,8501=>600,8502=>600,8503=>600,8504=>600,8506=>600,8507=>600,8523=>600,8525=>600, -8526=>600,8531=>600,8532=>600,8533=>600,8534=>600,8535=>600,8536=>600,8537=>600,8538=>600,8539=>600, -8540=>600,8541=>600,8542=>600,8543=>600,8544=>600,8545=>600,8546=>600,8547=>600,8548=>600,8549=>600, -8550=>600,8551=>600,8552=>600,8553=>600,8554=>600,8555=>600,8556=>600,8557=>600,8558=>600,8559=>600, -8560=>600,8561=>600,8562=>600,8563=>600,8564=>600,8565=>600,8566=>600,8567=>600,8568=>600,8569=>600, -8570=>600,8571=>600,8572=>600,8573=>600,8574=>600,8575=>600,8592=>600,8593=>600,8594=>600,8595=>600, -8596=>600,8597=>600,8598=>600,8599=>600,8600=>600,8601=>600,8616=>600,8704=>600,8706=>600,8707=>600, -8709=>600,8710=>600,8711=>600,8712=>600,8713=>600,8715=>600,8716=>600,8721=>600,8722=>600,8723=>600, -8725=>600,8729=>600,8730=>600,8733=>600,8734=>600,8745=>600,8746=>600,8747=>600,8756=>600,8764=>600, -8769=>600,8770=>600,8773=>600,8776=>600,8800=>600,8801=>600,8804=>600,8805=>600,8834=>600,8835=>600, -8836=>600,8837=>600,8838=>600,8839=>600,9001=>600,9002=>600,9251=>600,9674=>600,9824=>600,9825=>600, -9826=>600,9827=>600,9828=>600,9829=>600,9830=>600,9831=>600,9833=>600,9834=>600,9835=>600,9836=>600, -9837=>600,9838=>600,9839=>600,64256=>600,64257=>600,64258=>600,64285=>600,64286=>600,64287=>600,64288=>600, -64289=>600,64290=>600,64291=>600,64292=>600,64293=>600,64294=>600,64295=>600,64296=>600,64297=>600,64298=>600, -64299=>600,64300=>600,64301=>600,64302=>600,64303=>600,64304=>600,64305=>600,64306=>600,64307=>600,64308=>600, -64309=>600,64310=>600,64312=>600,64313=>600,64314=>600,64315=>600,64316=>600,64318=>600,64320=>600,64321=>600, -64323=>600,64324=>600,64326=>600,64327=>600,64328=>600,64329=>600,64330=>600,64331=>600,64332=>600,64333=>600, -64334=>600,64335=>600,65533=>600); -$enc=''; -$diff=''; -$file='freemonoi.z'; -$ctg='freemonoi.ctg.z'; -$originalsize=196732; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.z deleted file mode 100644 index 93bf7d35e9..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freemonoi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.ctg.z deleted file mode 100644 index b3bf68c3d3..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.php deleted file mode 100644 index 7d258b86c5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.php +++ /dev/null @@ -1,311 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSans'; -$desc=array('Ascent'=>1000,'Descent'=>-300,'CapHeight'=>22,'Flags'=>32,'FontBBox'=>'[-958 -550 1632 1050]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>600); -$up=-176; -$ut=50; -$dw=600; -$cw=array( -32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333, -42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556, -52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584, -62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778, -72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778, -82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278, -92=>278,93=>277,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556, -102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, -112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500, -122=>500,123=>334,124=>260,125=>334,126=>584,8364=>655,8218=>222,402=>278,8222=>333,8230=>1000, -8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>250,338=>1000,381=>611,8216=>222,8217=>221, -8220=>333,8221=>333,8226=>350,8211=>556,8212=>1000,732=>333,8482=>1000,353=>500,8250=>250,339=>944, -382=>500,376=>667,160=>278,161=>278,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556, -168=>333,169=>737,170=>370,171=>448,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584, -178=>350,179=>350,180=>333,181=>556,182=>537,183=>278,184=>333,185=>350,186=>365,187=>448, -188=>869,189=>869,190=>869,191=>556,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667, -198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722, -218=>722,219=>722,220=>722,221=>667,222=>666,223=>611,224=>556,225=>556,226=>556,227=>556, -228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278, -238=>278,239=>278,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584, -248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>555,255=>500,256=>667,257=>556, -258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500, -268=>722,269=>500,270=>722,271=>722,272=>722,273=>556,274=>667,275=>556,276=>667,277=>556, -278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556, -288=>778,289=>556,290=>778,291=>556,292=>722,293=>556,294=>722,295=>556,296=>278,297=>278, -298=>278,299=>278,300=>278,301=>278,302=>278,303=>222,304=>278,305=>278,306=>700,307=>374, -308=>500,309=>222,310=>667,311=>500,312=>500,313=>556,314=>222,315=>556,316=>222,317=>556, -318=>387,319=>556,320=>500,321=>556,322=>222,323=>722,324=>556,325=>722,326=>556,327=>722, -328=>556,329=>722,330=>722,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, -340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500, -350=>667,351=>500,354=>611,355=>278,356=>611,357=>443,358=>611,359=>278,360=>722,361=>556, -362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556, -372=>944,373=>722,374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>278,384=>556, -385=>854,386=>668,387=>556,388=>667,389=>556,390=>722,391=>722,392=>500,393=>722,394=>899, -395=>667,396=>556,397=>564,398=>667,399=>722,400=>667,401=>611,403=>778,404=>667,405=>889, -406=>278,407=>333,408=>667,409=>500,410=>333,411=>560,412=>833,413=>722,414=>556,415=>778, -416=>788,417=>565,418=>944,419=>722,420=>842,421=>556,422=>666,423=>667,424=>500,425=>611, -426=>333,427=>278,428=>611,429=>278,430=>611,431=>776,432=>624,433=>778,434=>722,435=>722, -436=>556,437=>611,438=>500,439=>611,440=>611,441=>500,442=>500,443=>556,446=>556,447=>556, -448=>260,449=>370,450=>584,451=>278,452=>1311,453=>1208,454=>1056,455=>1056,456=>778,457=>444, -458=>1158,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722, -468=>556,469=>722,470=>556,471=>722,472=>556,473=>722,474=>556,475=>722,476=>556,477=>556, -478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556, -488=>667,489=>500,490=>778,491=>556,492=>778,493=>556,494=>611,495=>500,496=>222,497=>1333, -498=>1222,499=>1056,500=>778,501=>556,503=>630,504=>722,505=>556,506=>667,507=>556,508=>1000, -509=>889,510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667, -519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556,526=>778,527=>556,528=>722, -529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,536=>667,537=>500,538=>611, -539=>278,540=>521,541=>393,542=>722,543=>556,548=>611,549=>500,550=>667,551=>556,552=>667, -553=>556,554=>778,555=>556,556=>778,557=>556,558=>778,559=>556,560=>778,561=>556,562=>667, -563=>500,567=>222,592=>556,593=>556,594=>556,595=>556,596=>500,597=>500,598=>556,599=>556, -600=>556,601=>556,602=>804,603=>500,604=>499,605=>742,606=>500,607=>222,608=>556,609=>556, -610=>546,611=>500,612=>556,613=>556,614=>556,615=>556,616=>222,617=>222,618=>278,619=>473, -620=>427,621=>222,622=>611,623=>833,624=>833,625=>833,626=>556,627=>556,628=>567,629=>556, -630=>778,631=>722,632=>741,633=>333,634=>333,635=>333,636=>333,637=>333,638=>384,639=>369, -640=>546,641=>546,642=>500,643=>278,644=>278,645=>278,646=>444,647=>278,648=>278,649=>556, -650=>626,651=>539,652=>500,653=>722,654=>500,655=>556,656=>500,657=>500,658=>500,659=>552, -660=>556,661=>556,662=>556,663=>722,664=>778,665=>506,666=>500,667=>546,668=>558,669=>444, -670=>500,671=>430,672=>556,673=>556,674=>556,675=>944,676=>944,677=>944,678=>689,679=>506, -680=>764,681=>766,682=>660,683=>577,684=>530,685=>486,686=>565,687=>621,688=>333,689=>333, -690=>167,691=>236,692=>236,693=>276,694=>359,695=>500,696=>330,697=>278,698=>454,699=>278, -700=>278,701=>278,702=>333,703=>333,704=>333,705=>333,706=>333,707=>333,708=>333,709=>333, -711=>333,712=>333,713=>333,714=>333,715=>333,716=>272,717=>333,718=>333,719=>333,720=>333, -721=>333,722=>333,723=>333,724=>333,725=>333,726=>333,727=>333,728=>333,729=>333,730=>333, -731=>333,733=>333,734=>333,735=>510,736=>333,737=>186,738=>333,739=>333,740=>334,741=>526, -742=>526,743=>526,744=>526,745=>526,746=>519,747=>519,748=>333,749=>333,750=>333,751=>333, -752=>333,753=>333,754=>333,755=>327,756=>261,757=>437,758=>437,759=>333,760=>278,761=>200, -762=>200,763=>200,764=>200,765=>333,766=>333,767=>333,768=>0,769=>0,770=>0,771=>0, -772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0, -782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0, -792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0, -802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0, -812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, -822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0, -832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0, -842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,848=>0,849=>0,850=>0,851=>0, -852=>0,853=>0,854=>0,855=>0,856=>0,857=>0,858=>0,859=>0,860=>0,861=>0, -862=>0,863=>0,864=>0,865=>0,866=>0,867=>0,868=>0,869=>0,870=>0,871=>0, -872=>0,873=>0,874=>0,875=>0,876=>0,877=>0,878=>0,879=>0,884=>278,885=>199, -890=>332,894=>278,900=>333,901=>333,902=>667,903=>275,904=>786,905=>828,906=>369,908=>833, -910=>845,911=>778,912=>286,913=>667,914=>667,915=>582,916=>778,917=>667,918=>628,919=>722, -920=>778,921=>278,922=>667,923=>667,924=>833,925=>722,926=>630,927=>778,928=>722,929=>667, -931=>628,932=>611,933=>667,934=>717,935=>667,936=>745,937=>778,938=>278,939=>667,940=>608, -941=>528,942=>548,943=>307,944=>538,945=>596,946=>542,947=>531,948=>564,949=>512,950=>455, -951=>548,952=>525,953=>286,954=>510,955=>551,956=>540,957=>500,958=>470,959=>546,960=>619, -961=>569,962=>547,963=>620,964=>492,965=>538,966=>741,967=>571,968=>662,969=>740,970=>286, -971=>538,972=>546,973=>538,974=>740,977=>580,978=>742,979=>845,980=>620,981=>741,982=>740, -983=>556,1008=>556,1009=>566,1012=>778,1013=>328,1024=>667,1025=>657,1026=>766,1027=>582,1028=>722, -1029=>667,1030=>278,1031=>278,1032=>500,1033=>1080,1034=>1014,1035=>766,1036=>628,1037=>730,1038=>613, -1039=>722,1040=>666,1041=>668,1042=>668,1043=>582,1044=>812,1045=>657,1046=>905,1047=>667,1048=>730, -1049=>730,1050=>632,1051=>674,1052=>846,1053=>721,1054=>796,1055=>721,1056=>654,1057=>722,1058=>611, -1059=>613,1060=>861,1061=>657,1062=>742,1063=>626,1064=>830,1065=>851,1066=>841,1067=>874,1068=>670, -1069=>717,1070=>1001,1071=>686,1072=>552,1073=>550,1074=>506,1075=>404,1076=>602,1077=>547,1078=>755, -1079=>499,1080=>567,1081=>567,1082=>489,1083=>517,1084=>618,1085=>558,1086=>550,1087=>557,1088=>577, -1089=>520,1090=>444,1091=>468,1092=>865,1093=>466,1094=>578,1095=>498,1096=>692,1097=>712,1098=>664, -1099=>690,1100=>521,1101=>520,1102=>759,1103=>543,1104=>549,1105=>549,1106=>577,1107=>404,1108=>519, -1109=>502,1110=>224,1111=>278,1112=>223,1113=>813,1114=>853,1115=>577,1116=>489,1117=>567,1118=>468, -1119=>558,1120=>942,1121=>693,1136=>762,1137=>662,1138=>800,1139=>550,1148=>942,1149=>693,1150=>942, -1151=>693,1154=>468,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>0,1161=>0,1162=>763, -1163=>583,1164=>689,1165=>526,1166=>652,1167=>572,1168=>601,1169=>397,1170=>589,1171=>392,1172=>591, -1173=>475,1174=>927,1175=>830,1176=>661,1177=>493,1178=>658,1179=>510,1180=>675,1181=>519,1182=>684, -1183=>514,1184=>839,1185=>653,1186=>740,1187=>570,1188=>987,1189=>714,1190=>1058,1191=>808,1192=>722, -1193=>510,1194=>722,1195=>516,1196=>611,1197=>402,1198=>668,1199=>578,1200=>668,1201=>588,1202=>664, -1203=>488,1204=>936,1205=>679,1206=>638,1207=>521,1208=>630,1209=>498,1210=>630,1211=>498,1212=>927, -1213=>699,1214=>919,1215=>703,1216=>254,1217=>905,1218=>755,1219=>668,1220=>512,1221=>696,1222=>524, -1223=>721,1224=>558,1225=>744,1226=>571,1227=>630,1228=>498,1229=>869,1230=>631,1231=>254,1232=>666, -1233=>552,1234=>666,1235=>552,1236=>1000,1237=>879,1238=>657,1239=>547,1240=>722,1241=>543,1242=>722, -1243=>543,1244=>905,1245=>755,1246=>667,1247=>499,1248=>611,1249=>540,1250=>730,1251=>567,1252=>730, -1253=>567,1254=>796,1255=>550,1256=>800,1257=>550,1258=>800,1259=>550,1260=>717,1261=>520,1262=>613, -1263=>468,1264=>613,1265=>468,1266=>613,1267=>468,1268=>626,1269=>498,1270=>582,1271=>395,1272=>874, -1273=>690,1296=>667,1297=>491,1298=>665,1299=>509,1306=>778,1307=>575,1308=>934,1309=>712,1310=>627, -1311=>489,1329=>720,1330=>696,1331=>750,1332=>725,1333=>699,1334=>751,1335=>446,1336=>703,1337=>790, -1338=>656,1339=>697,1340=>390,1341=>852,1342=>791,1343=>698,1344=>585,1345=>656,1346=>651,1347=>658, -1348=>759,1349=>595,1350=>772,1351=>603,1352=>703,1353=>648,1354=>698,1355=>744,1356=>738,1357=>703, -1358=>739,1359=>660,1360=>693,1361=>623,1362=>385,1363=>788,1364=>632,1365=>775,1366=>714,1369=>333, -1370=>222,1371=>200,1372=>333,1373=>333,1374=>333,1375=>333,1377=>833,1378=>551,1379=>572,1380=>569, -1381=>546,1382=>581,1383=>353,1384=>551,1385=>568,1386=>569,1387=>552,1388=>276,1389=>795,1390=>535, -1391=>553,1392=>537,1393=>512,1394=>568,1395=>552,1396=>531,1397=>249,1398=>527,1399=>405,1400=>551, -1401=>390,1402=>833,1403=>509,1404=>523,1405=>545,1406=>584,1407=>879,1408=>552,1409=>552,1410=>301, -1411=>884,1412=>578,1413=>556,1414=>668,1415=>544,1417=>278,1418=>333,1456=>0,1457=>0,1458=>0, -1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0,1468=>0,1469=>0, -1470=>488,1471=>0,1472=>212,1473=>0,1474=>0,1475=>278,1476=>0,1488=>640,1489=>591,1490=>466, -1491=>598,1492=>622,1493=>212,1494=>351,1495=>623,1496=>608,1497=>200,1498=>526,1499=>550,1500=>600, -1501=>623,1502=>621,1503=>212,1504=>378,1505=>607,1506=>587,1507=>575,1508=>568,1509=>540,1510=>590, -1511=>606,1512=>547,1513=>776,1514=>687,1520=>424,1521=>412,1522=>400,1523=>184,1524=>344,1792=>600, -1793=>201,1794=>201,1795=>201,1796=>201,1797=>500,1798=>500,1799=>500,1800=>370,1801=>370,1802=>574, -1803=>574,1804=>645,1805=>574,1807=>0,1808=>452,1809=>452,1810=>574,1811=>645,1812=>645,1813=>509, -1814=>509,1815=>682,1816=>585,1817=>404,1818=>627,1819=>718,1820=>718,1821=>484,1822=>682,1823=>600, -1824=>660,1825=>682,1826=>538,1827=>718,1828=>718,1829=>718,1830=>574,1831=>574,1832=>638,1833=>585, -1834=>509,1835=>682,1836=>682,1840=>0,1841=>0,1842=>0,1843=>0,1844=>0,1845=>0,1846=>0, -1847=>0,1848=>0,1849=>0,1850=>0,1851=>0,1852=>0,1853=>0,1854=>0,1855=>0,1856=>0, -1857=>0,1858=>0,1859=>0,1860=>0,1861=>0,1862=>0,1863=>0,1864=>0,1865=>0,1866=>0, -2305=>6,2306=>0,2307=>305,2308=>717,2309=>717,2310=>829,2311=>463,2312=>463,2313=>581,2314=>803, -2315=>920,2316=>639,2317=>430,2318=>430,2319=>430,2320=>430,2321=>856,2322=>828,2323=>837,2324=>856, -2325=>749,2326=>779,2327=>522,2328=>587,2329=>650,2330=>619,2331=>641,2332=>703,2333=>691,2334=>677, -2335=>568,2336=>529,2337=>611,2338=>536,2339=>607,2340=>564,2341=>659,2342=>500,2343=>591,2344=>521, -2345=>568,2346=>477,2347=>728,2348=>490,2349=>577,2350=>517,2351=>554,2352=>433,2353=>433,2354=>656, -2355=>660,2356=>660,2357=>490,2358=>645,2359=>477,2360=>666,2361=>484,2364=>6,2365=>442,2366=>211, -2367=>211,2368=>211,2369=>6,2370=>3,2371=>6,2372=>0,2373=>6,2374=>84,2375=>6,2376=>6, -2377=>224,2378=>234,2379=>211,2380=>211,2381=>6,2384=>839,2385=>15,2386=>0,2387=>9,2388=>9, -2392=>750,2393=>779,2394=>522,2395=>703,2396=>613,2397=>536,2398=>728,2399=>554,2400=>899,2401=>625, -2402=>625,2403=>625,2404=>674,2405=>674,2406=>575,2407=>575,2408=>575,2409=>575,2410=>575,2411=>575, -2412=>575,2413=>575,2414=>575,2415=>575,2416=>365,2417=>387,2418=>717,2433=>0,2434=>300,2435=>264, -2437=>594,2438=>790,2439=>469,2440=>513,2441=>520,2442=>549,2443=>594,2444=>481,2447=>580,2448=>627, -2451=>540,2452=>613,2453=>570,2454=>467,2455=>471,2456=>428,2457=>483,2458=>408,2459=>509,2460=>591, -2461=>563,2462=>771,2463=>381,2464=>404,2465=>522,2466=>408,2467=>450,2468=>543,2469=>477,2470=>418, -2471=>433,2472=>445,2474=>499,2475=>584,2476=>377,2477=>555,2478=>448,2479=>423,2480=>390,2482=>498, -2486=>498,2487=>425,2488=>495,2489=>440,2492=>22,2493=>440,2494=>193,2495=>189,2496=>180,2497=>0, -2498=>0,2499=>0,2500=>0,2503=>252,2504=>243,2507=>889,2508=>865,2509=>0,2510=>356,2519=>219, -2524=>523,2525=>408,2527=>428,2528=>594,2529=>481,2530=>0,2531=>0,2534=>500,2535=>437,2536=>479, -2537=>530,2538=>497,2539=>500,2540=>482,2541=>503,2542=>517,2543=>481,2544=>377,2545=>377,2546=>429, -2547=>383,2548=>429,2549=>478,2550=>545,2551=>158,2552=>365,2553=>280,2554=>357,2561=>0,2562=>0, -2563=>351,2565=>860,2566=>1088,2567=>869,2568=>928,2569=>723,2570=>723,2575=>665,2576=>857,2579=>716, -2580=>858,2581=>682,2582=>634,2583=>696,2584=>744,2585=>649,2586=>674,2587=>656,2588=>653,2589=>629, -2590=>639,2591=>641,2592=>657,2593=>650,2594=>653,2595=>651,2596=>640,2597=>634,2598=>662,2599=>630, -2600=>625,2602=>645,2603=>653,2604=>624,2605=>613,2606=>658,2607=>734,2608=>620,2610=>676,2611=>719, -2613=>626,2614=>666,2616=>666,2617=>614,2620=>0,2622=>286,2623=>322,2624=>301,2625=>0,2626=>0, -2631=>0,2632=>0,2635=>0,2636=>0,2637=>0,2649=>636,2650=>762,2651=>652,2652=>653,2654=>656, -2662=>672,2663=>543,2664=>622,2665=>622,2666=>576,2667=>589,2668=>509,2669=>645,2670=>661,2671=>655, -2672=>0,2673=>0,2674=>666,2675=>726,2676=>1217,2689=>22,2690=>23,2691=>0,2693=>775,2694=>979, -2695=>588,2696=>563,2697=>525,2698=>724,2699=>942,2701=>775,2703=>775,2704=>775,2705=>979,2707=>979, -2708=>979,2709=>610,2710=>706,2711=>623,2712=>610,2713=>601,2714=>614,2715=>642,2716=>684,2717=>634, -2718=>644,2719=>509,2720=>541,2721=>539,2722=>524,2723=>657,2724=>547,2725=>616,2726=>494,2727=>601, -2728=>627,2730=>524,2731=>620,2732=>691,2733=>687,2734=>468,2735=>590,2736=>509,2738=>571,2739=>687, -2741=>526,2742=>620,2743=>575,2744=>620,2745=>549,2748=>53,2749=>415,2750=>241,2751=>186,2752=>217, -2753=>32,2754=>21,2755=>38,2756=>27,2757=>45,2759=>41,2760=>46,2761=>207,2763=>190,2764=>182, -2765=>16,2768=>962,2784=>949,2790=>479,2791=>502,2792=>484,2793=>471,2794=>501,2795=>527,2796=>462, -2797=>524,2798=>454,2799=>495,2801=>752,2946=>479,2947=>893,2949=>1018,2950=>1170,2951=>916,2952=>676, -2953=>836,2954=>1225,2958=>744,2959=>744,2960=>848,2962=>813,2963=>813,2964=>813,2965=>688,2969=>744, -2970=>676,2972=>848,2974=>984,2975=>777,2979=>1338,2980=>664,2984=>561,2985=>1029,2986=>607,2990=>697, -2991=>697,2992=>434,2993=>617,2994=>869,2995=>859,2996=>697,2997=>869,2999=>1145,3000=>1064,3001=>1316, -3006=>424,3007=>125,3008=>596,3009=>539,3014=>596,3015=>650,3016=>973,3018=>1286,3019=>1286,3020=>1706, -3021=>333,3031=>859,3050=>778,3051=>881,3052=>876,3053=>648,3057=>744,4256=>587,4257=>620,4258=>642, -4259=>815,4260=>600,4261=>595,4262=>799,4263=>893,4264=>622,4265=>597,4266=>939,4267=>602,4268=>603, -4269=>790,4270=>587,4271=>623,4272=>799,4273=>601,4274=>792,4275=>724,4276=>847,4277=>599,4278=>812, -4279=>603,4280=>653,4281=>590,4282=>754,4283=>596,4284=>653,4285=>651,4286=>596,4287=>888,4288=>593, -4304=>436,4305=>491,4306=>528,4307=>692,4308=>447,4309=>447,4310=>628,4311=>734,4312=>449,4313=>445, -4314=>843,4315=>449,4316=>449,4317=>682,4318=>449,4319=>480,4320=>682,4321=>468,4322=>710,4323=>623, -4324=>697,4325=>447,4326=>702,4327=>447,4328=>470,4329=>440,4330=>632,4331=>449,4332=>470,4333=>536, -4334=>449,4335=>656,4336=>474,4337=>630,4338=>394,4339=>419,4340=>422,4341=>436,4345=>528,4347=>515, -7680=>667,7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500, -7690=>722,7691=>556,7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556, -7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556,7708=>667,7709=>556, -7710=>611,7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556, -7720=>722,7721=>556,7722=>722,7723=>556,7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500, -7730=>667,7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222, -7740=>556,7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556, -7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556,7756=>778,7757=>556,7758=>778,7759=>556, -7760=>778,7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333, -7770=>722,7771=>333,7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500, -7780=>667,7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278,7788=>611,7789=>278, -7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556, -7800=>722,7801=>556,7802=>722,7803=>556,7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722, -7810=>944,7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500, -7820=>667,7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500, -7830=>556,7831=>278,7832=>722,7833=>500,7834=>555,7835=>278,7840=>667,7841=>556,7842=>667,7843=>556, -7844=>667,7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556, -7854=>667,7855=>556,7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556, -7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556,7872=>667,7873=>556, -7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222, -7884=>778,7885=>556,7886=>778,7887=>556,7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556, -7894=>778,7895=>556,7896=>778,7897=>556,7898=>788,7899=>565,7900=>788,7901=>565,7902=>788,7903=>565, -7904=>788,7905=>565,7906=>788,7907=>565,7908=>722,7909=>556,7910=>722,7911=>556,7912=>776,7913=>624, -7914=>776,7915=>624,7916=>776,7917=>624,7918=>776,7919=>624,7920=>776,7921=>624,7922=>667,7923=>500, -7924=>667,7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>596,7937=>596,7938=>596,7939=>596, -7940=>596,7941=>596,7942=>596,7943=>596,7944=>667,7945=>667,7946=>742,7947=>756,7948=>692,7949=>699, -7950=>673,7951=>667,7952=>512,7953=>512,7954=>512,7955=>512,7956=>512,7957=>512,7960=>730,7961=>714, -7962=>900,7963=>882,7964=>867,7965=>879,7968=>548,7969=>548,7970=>548,7971=>548,7972=>548,7973=>548, -7974=>548,7975=>548,7976=>772,7977=>778,7978=>945,7979=>947,7980=>943,7981=>946,7982=>853,7983=>853, -7984=>286,7985=>286,7986=>286,7987=>286,7988=>286,7989=>286,7990=>286,7991=>286,7992=>322,7993=>321, -7994=>482,7995=>485,7996=>477,7997=>484,7998=>394,7999=>390,8000=>546,8001=>546,8002=>546,8003=>546, -8004=>546,8005=>546,8008=>775,8009=>784,8010=>990,8011=>987,8012=>887,8013=>897,8016=>538,8017=>538, -8018=>538,8019=>538,8020=>538,8021=>538,8022=>538,8023=>538,8025=>747,8027=>915,8029=>971,8031=>863, -8032=>740,8033=>740,8034=>740,8035=>740,8036=>740,8037=>740,8038=>740,8039=>740,8040=>769,8041=>774, -8042=>972,8043=>970,8044=>879,8045=>918,8046=>901,8047=>901,8048=>596,8049=>596,8050=>512,8051=>512, -8052=>548,8053=>548,8054=>286,8055=>286,8056=>546,8057=>546,8058=>538,8059=>538,8060=>740,8061=>740, -8064=>596,8065=>596,8066=>596,8067=>596,8068=>596,8069=>596,8070=>596,8071=>596,8072=>830,8073=>828, -8074=>916,8075=>916,8076=>853,8077=>860,8078=>835,8079=>827,8080=>548,8081=>548,8082=>548,8083=>548, -8084=>548,8085=>548,8086=>548,8087=>548,8088=>928,8089=>931,8090=>1104,8091=>1109,8092=>1099,8093=>1102, -8094=>1009,8095=>1012,8096=>740,8097=>740,8098=>740,8099=>740,8100=>740,8101=>740,8102=>740,8103=>740, -8104=>934,8105=>934,8106=>1130,8107=>1128,8108=>1045,8109=>1077,8110=>1062,8111=>1065,8112=>596,8113=>596, -8114=>596,8115=>596,8116=>596,8118=>596,8119=>596,8120=>667,8121=>667,8122=>667,8123=>667,8124=>832, -8125=>333,8126=>200,8127=>333,8128=>333,8129=>333,8130=>548,8131=>548,8132=>548,8134=>548,8135=>548, -8136=>833,8137=>776,8138=>944,8139=>896,8140=>875,8141=>400,8142=>400,8143=>333,8144=>286,8145=>286, -8146=>286,8147=>286,8150=>286,8151=>286,8152=>278,8153=>278,8154=>385,8155=>376,8157=>400,8158=>400, -8159=>333,8160=>538,8161=>538,8162=>538,8163=>538,8164=>569,8165=>569,8166=>538,8167=>514,8168=>667, -8169=>667,8170=>817,8171=>827,8172=>741,8173=>393,8174=>393,8175=>333,8178=>740,8179=>740,8180=>740, -8182=>740,8183=>740,8184=>833,8185=>833,8186=>848,8187=>814,8188=>939,8189=>333,8190=>333,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>556,8213=>1000,8214=>312, -8215=>566,8219=>221,8223=>333,8227=>350,8228=>278,8229=>666,8231=>278,8232=>0,8233=>0,8234=>0, -8235=>0,8236=>0,8237=>0,8238=>0,8239=>500,8241=>1360,8242=>278,8243=>469,8244=>680,8245=>278, -8246=>469,8247=>680,8248=>376,8251=>622,8252=>556,8253=>556,8254=>556,8255=>658,8256=>658,8257=>438, -8258=>840,8259=>400,8260=>167,8261=>334,8262=>334,8263=>1112,8264=>834,8265=>834,8266=>556,8267=>537, -8268=>537,8269=>537,8270=>389,8271=>278,8272=>658,8273=>389,8274=>634,8275=>500,8276=>658,8277=>787, -8278=>515,8279=>855,8280=>722,8281=>725,8282=>224,8283=>722,8284=>604,8285=>224,8286=>224,8287=>0, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8304=>350,8305=>350,8308=>350,8309=>350,8310=>350, -8311=>350,8312=>350,8313=>350,8314=>350,8315=>350,8316=>350,8317=>350,8318=>350,8319=>350,8320=>350, -8321=>350,8322=>350,8323=>350,8324=>350,8325=>350,8326=>350,8327=>350,8328=>350,8329=>350,8330=>350, -8331=>350,8332=>350,8333=>350,8334=>350,8336=>350,8337=>349,8338=>350,8339=>350,8340=>350,8353=>615, -8354=>601,8355=>611,8356=>556,8357=>833,8358=>682,8359=>1317,8360=>1202,8361=>879,8362=>869,8363=>538, -8365=>667,8366=>611,8368=>570,8369=>684,8370=>717,8371=>667,8372=>667,8373=>640,8400=>0,8401=>0, -8402=>0,8403=>0,8406=>0,8407=>0,8411=>0,8412=>0,8413=>0,8414=>0,8415=>0,8416=>0, -8417=>0,8421=>0,8422=>0,8423=>0,8424=>0,8425=>0,8426=>0,8427=>0,8428=>0,8429=>0, -8430=>0,8431=>0,8432=>0,8448=>970,8449=>979,8451=>1017,8452=>556,8453=>876,8454=>922,8455=>667, -8457=>919,8459=>969,8460=>615,8462=>556,8463=>572,8464=>809,8465=>606,8466=>874,8467=>417,8468=>747, -8470=>934,8471=>737,8472=>600,8475=>850,8476=>699,8480=>1000,8481=>1230,8486=>778,8487=>778,8488=>512, -8489=>286,8490=>667,8491=>667,8492=>908,8493=>623,8494=>556,8495=>444,8496=>562,8497=>895,8498=>588, -8499=>1080,8501=>640,8502=>592,8503=>466,8504=>598,8505=>278,8506=>871,8507=>1230,8513=>778,8514=>556, -8515=>556,8516=>667,8522=>516,8523=>655,8525=>936,8526=>482,8531=>869,8532=>869,8533=>869,8534=>869, -8535=>869,8536=>869,8537=>869,8538=>869,8539=>869,8540=>869,8541=>869,8542=>869,8543=>869,8544=>278, -8545=>556,8546=>834,8547=>945,8548=>667,8549=>945,8550=>1223,8551=>1501,8552=>945,8553=>667,8554=>945, -8555=>1223,8556=>556,8557=>722,8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>722,8564=>500, -8565=>722,8566=>944,8567=>1166,8568=>722,8569=>500,8570=>722,8571=>944,8572=>222,8573=>500,8574=>556, -8575=>833,8592=>987,8593=>603,8594=>987,8595=>603,8596=>1042,8597=>1042,8598=>800,8599=>800,8600=>800, -8601=>800,8614=>987,8617=>987,8618=>987,8629=>658,8636=>987,8637=>987,8638=>380,8639=>393,8640=>987, -8641=>987,8642=>380,8643=>379,8652=>987,8656=>987,8657=>603,8658=>987,8659=>603,8660=>1042,8661=>603, -8669=>1092,8704=>667,8706=>556,8707=>667,8709=>823,8710=>711,8711=>711,8712=>584,8713=>584,8714=>584, -8715=>584,8716=>584,8717=>713,8719=>823,8720=>823,8721=>804,8722=>584,8723=>584,8724=>584,8725=>510, -8726=>392,8727=>584,8729=>584,8730=>542,8733=>713,8734=>713,8736=>768,8739=>200,8740=>288,8741=>312, -8742=>340,8743=>603,8744=>603,8745=>768,8746=>768,8747=>556,8748=>796,8749=>956,8750=>556,8756=>863, -8764=>584,8765=>584,8766=>573,8768=>244,8769=>584,8770=>584,8771=>584,8772=>584,8773=>584,8774=>584, -8775=>584,8776=>584,8777=>584,8781=>554,8784=>584,8800=>584,8801=>584,8802=>584,8804=>584,8805=>584, -8810=>955,8811=>955,8813=>554,8814=>584,8815=>584,8816=>584,8817=>584,8818=>584,8819=>584,8826=>584, -8827=>584,8828=>584,8829=>584,8832=>584,8833=>584,8834=>584,8835=>584,8836=>584,8837=>584,8838=>584, -8839=>584,8840=>584,8841=>584,8844=>768,8847=>636,8848=>636,8849=>636,8850=>636,8851=>636,8852=>636, -8853=>768,8854=>768,8855=>768,8856=>768,8857=>768,8866=>658,8867=>658,8868=>658,8869=>658,8870=>600, -8871=>608,8882=>636,8883=>636,8884=>636,8885=>636,8896=>744,8897=>744,8898=>764,8899=>764,8901=>278, -8902=>471,8904=>710,8928=>584,8929=>584,8930=>636,8931=>636,8960=>823,8968=>456,8969=>455,8970=>455, -8971=>456,8992=>556,8993=>556,8994=>658,8995=>658,9001=>329,9002=>329,9115=>384,9116=>384,9117=>384, -9118=>384,9119=>384,9120=>384,9121=>388,9122=>388,9123=>388,9124=>388,9125=>388,9126=>388,9134=>556, -9250=>556,9251=>500,9312=>788,9313=>788,9314=>788,9315=>788,9316=>788,9317=>788,9318=>788,9319=>788, -9320=>788,9321=>788,9472=>1000,9473=>1000,9474=>1000,9475=>1000,9476=>1000,9477=>1000,9478=>1000,9479=>1000, -9480=>1000,9481=>1000,9482=>1000,9483=>1000,9484=>1000,9485=>1000,9486=>1000,9487=>1000,9488=>1000,9489=>1000, -9490=>1000,9491=>1000,9492=>1000,9493=>1000,9494=>1000,9495=>1000,9496=>1000,9497=>1000,9498=>1000,9499=>1000, -9500=>1000,9501=>1000,9502=>1000,9503=>1000,9504=>1000,9505=>1000,9506=>1000,9507=>1000,9508=>1000,9509=>1000, -9510=>1000,9511=>1000,9512=>1000,9513=>1000,9514=>1000,9515=>1000,9516=>1000,9517=>1000,9518=>1000,9519=>1000, -9520=>1000,9521=>1000,9522=>1000,9523=>1000,9524=>1000,9525=>1000,9526=>1000,9527=>1000,9528=>1000,9529=>1000, -9530=>1000,9531=>1000,9532=>1000,9533=>1000,9534=>1000,9535=>1000,9536=>1000,9537=>1000,9538=>1000,9539=>1000, -9540=>1000,9541=>1000,9542=>1000,9543=>1000,9544=>1000,9545=>1000,9546=>1000,9547=>1000,9552=>1000,9553=>1000, -9554=>1000,9555=>1000,9556=>1000,9557=>1000,9558=>1000,9559=>1000,9560=>1000,9561=>1000,9562=>1000,9563=>1000, -9564=>1000,9565=>1000,9566=>1000,9567=>1000,9568=>1000,9569=>1000,9570=>1000,9571=>1000,9572=>1000,9573=>1000, -9574=>1000,9575=>1000,9576=>1000,9577=>1000,9578=>1000,9579=>1000,9580=>1000,9600=>1000,9601=>1000,9602=>1000, -9603=>1000,9604=>1000,9605=>1000,9606=>1000,9607=>1000,9608=>1000,9609=>1000,9610=>1000,9611=>1000,9612=>1000, -9613=>1000,9614=>1000,9615=>1000,9616=>1000,9617=>1000,9618=>1000,9619=>1000,9620=>1000,9621=>1000,9622=>1000, -9623=>1000,9624=>1000,9625=>1000,9626=>1000,9627=>1000,9628=>1000,9629=>1000,9630=>1000,9631=>1000,9632=>1000, -9633=>1000,9635=>1000,9636=>1000,9637=>1000,9642=>1000,9644=>1000,9651=>892,9661=>892,9671=>788,9674=>489, -9675=>791,9711=>882,9772=>929,9824=>626,9825=>694,9826=>595,9827=>776,9828=>626,9829=>694,9830=>595, -9831=>776,9833=>333,9834=>555,9835=>722,9836=>722,9837=>415,9838=>377,9839=>402,10048=>1161,10752=>791, -10753=>791,10754=>791,10755=>764,10756=>764,10761=>584,11799=>333,64256=>495,64257=>460,64258=>465,64259=>652, -64260=>645,64261=>520,64275=>1004,64276=>1044,64277=>1042,64278=>1037,64279=>1256,64285=>200,64286=>305,64287=>400, -64288=>587,64289=>890,64290=>848,64291=>872,64292=>800,64293=>850,64294=>873,64295=>797,64296=>937,64297=>584, -64298=>776,64299=>776,64300=>776,64301=>776,64302=>640,64303=>640,64304=>640,64305=>591,64306=>466,64307=>598, -64308=>622,64309=>262,64310=>351,64312=>608,64313=>270,64314=>526,64315=>550,64316=>600,64318=>621,64320=>378, -64321=>607,64323=>575,64324=>568,64326=>590,64327=>606,64328=>547,64329=>776,64330=>687,64331=>212,64332=>591, -64333=>550,64334=>568,64335=>640,65533=>788); -$enc=''; -$diff=''; -$file='freesans.z'; -$ctg='freesans.ctg.z'; -$originalsize=568896; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.z deleted file mode 100644 index 2bcdd56f2e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesans.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.ctg.z deleted file mode 100644 index 8c0510dc3a..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.php deleted file mode 100644 index 0f12960582..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.php +++ /dev/null @@ -1,236 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSansBold'; -$desc=array('Ascent'=>1000,'Descent'=>-300,'CapHeight'=>22,'Flags'=>32,'FontBBox'=>'[-967 -1175 1556 1639]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-189; -$ut=69; -$dw=600; -$cw=array( -32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333, -42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556, -52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584, -62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778, -72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778, -82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333, -92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556, -102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611, -112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556, -122=>500,123=>389,124=>280,125=>389,126=>584,8364=>640,8218=>278,402=>333,8222=>500,8230=>1000, -8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,381=>611,8216=>278,8217=>278, -8220=>500,8221=>500,8226=>350,8211=>556,8212=>1000,732=>333,8482=>1000,353=>556,8250=>333,339=>944, -382=>500,376=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556, -168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584, -178=>351,179=>351,180=>333,181=>611,182=>556,183=>278,184=>333,185=>300,186=>365,187=>556, -188=>869,189=>869,190=>869,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722, -198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722, -218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556, -228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278, -238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584, -248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556,256=>722,257=>556, -258=>722,259=>556,260=>722,261=>556,262=>722,263=>556,264=>722,265=>556,266=>722,267=>556, -268=>722,269=>556,270=>722,271=>723,272=>722,273=>611,274=>667,275=>556,276=>667,277=>556, -278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>611,286=>778,287=>611, -288=>778,289=>611,290=>778,291=>611,292=>722,293=>611,294=>722,295=>611,296=>278,297=>278, -298=>278,299=>278,300=>278,301=>278,302=>278,303=>278,304=>278,305=>278,306=>808,307=>492, -308=>556,309=>278,310=>722,311=>556,312=>559,313=>611,314=>278,315=>611,316=>278,317=>611, -318=>362,319=>611,320=>556,321=>611,322=>278,323=>722,324=>611,325=>722,326=>611,327=>722, -328=>611,329=>611,330=>722,331=>611,332=>778,333=>611,334=>778,335=>611,336=>778,337=>611, -340=>722,341=>389,342=>722,343=>389,344=>722,345=>389,346=>667,347=>556,348=>667,349=>556, -350=>667,351=>556,354=>611,355=>333,356=>611,357=>414,358=>611,359=>333,360=>722,361=>611, -362=>722,363=>611,364=>722,365=>611,366=>722,367=>611,368=>722,369=>611,370=>722,371=>611, -372=>944,373=>778,374=>667,375=>556,377=>611,378=>500,379=>611,380=>500,383=>333,384=>611, -385=>963,386=>704,387=>611,388=>687,389=>611,390=>722,391=>752,392=>562,393=>722,394=>968, -395=>722,396=>611,397=>609,398=>667,399=>778,400=>672,401=>611,403=>778,404=>667,405=>889, -406=>278,407=>395,408=>778,409=>556,410=>333,411=>620,412=>944,413=>722,414=>611,415=>778, -416=>791,417=>653,418=>1111,419=>722,420=>914,421=>611,422=>647,423=>667,424=>556,425=>673, -426=>441,427=>333,428=>742,429=>333,430=>611,431=>769,432=>656,433=>766,434=>722,435=>667, -436=>620,437=>611,438=>500,439=>556,440=>556,441=>645,442=>569,443=>579,446=>611,447=>608, -448=>260,449=>370,450=>584,451=>278,452=>1333,453=>1222,454=>1111,455=>1167,456=>889,457=>556, -458=>1278,459=>1000,460=>889,461=>722,462=>556,463=>278,464=>278,465=>778,466=>611,467=>722, -468=>611,469=>722,470=>611,471=>722,472=>611,473=>722,474=>611,475=>722,476=>611,477=>556, -478=>722,479=>556,480=>722,481=>556,482=>1000,483=>889,484=>778,485=>611,486=>778,487=>611, -488=>722,489=>556,490=>778,491=>611,492=>778,493=>611,494=>556,495=>556,496=>278,497=>1333, -498=>1222,499=>1111,500=>778,501=>611,503=>630,504=>722,505=>611,506=>722,507=>556,508=>1000, -509=>889,510=>778,511=>611,512=>722,513=>556,514=>722,515=>556,516=>667,517=>556,518=>667, -519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>611,526=>778,527=>611,528=>722, -529=>389,530=>722,531=>389,532=>722,533=>611,534=>722,535=>611,536=>667,537=>556,538=>611, -539=>333,540=>569,541=>486,542=>722,543=>611,548=>645,549=>500,550=>722,551=>556,552=>667, -553=>556,554=>778,555=>611,556=>778,557=>611,558=>778,559=>611,560=>778,561=>611,562=>667, -563=>556,567=>278,592=>556,593=>667,594=>667,595=>611,596=>556,597=>600,598=>611,599=>611, -600=>556,601=>556,602=>834,603=>541,604=>557,605=>820,606=>570,607=>278,608=>611,609=>611, -610=>556,611=>556,612=>656,613=>619,614=>611,615=>611,616=>278,617=>344,618=>278,619=>473, -620=>527,621=>298,622=>778,623=>889,624=>889,625=>889,626=>611,627=>611,628=>615,629=>606, -630=>878,631=>822,632=>778,633=>389,634=>389,635=>389,636=>389,637=>389,638=>455,639=>455, -640=>620,641=>620,642=>556,643=>333,644=>278,645=>333,646=>544,647=>328,648=>333,649=>623, -650=>726,651=>639,652=>556,653=>778,654=>556,655=>556,656=>500,657=>571,658=>556,659=>642, -660=>611,661=>611,662=>611,664=>611,665=>554,666=>570,667=>616,668=>603,669=>552,670=>556, -671=>454,672=>611,673=>611,674=>611,684=>522,688=>377,689=>377,690=>202,691=>272,692=>272, -693=>299,694=>395,695=>534,696=>364,697=>278,698=>454,699=>278,700=>278,701=>278,702=>333, -703=>333,704=>333,705=>333,706=>333,707=>333,708=>333,709=>333,711=>333,712=>333,713=>333, -714=>333,715=>333,716=>272,717=>333,718=>333,719=>333,720=>333,721=>333,722=>333,723=>333, -724=>333,725=>333,726=>333,727=>333,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, -735=>510,736=>372,737=>210,738=>363,739=>373,740=>334,741=>526,742=>526,743=>526,744=>526, -745=>526,746=>519,747=>519,748=>333,749=>333,750=>333,751=>333,752=>333,753=>333,754=>333, -755=>333,756=>333,757=>437,758=>437,759=>400,760=>333,761=>200,762=>200,763=>200,764=>200, -765=>333,766=>333,767=>333,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0, -775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0, -785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0, -795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0, -805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0, -815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0, -825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0, -835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0, -845=>0,846=>0,847=>0,848=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0, -855=>0,856=>0,857=>0,858=>0,859=>0,860=>0,861=>0,862=>0,863=>0,864=>0, -865=>0,866=>0,867=>0,868=>0,869=>0,870=>0,871=>0,872=>0,873=>0,874=>0, -875=>0,876=>0,877=>0,878=>0,879=>0,884=>379,885=>379,890=>333,894=>333,900=>363, -901=>333,902=>761,903=>333,904=>864,905=>903,906=>454,908=>796,910=>991,911=>867,912=>315, -913=>696,914=>640,915=>585,916=>726,917=>589,918=>581,919=>654,920=>783,921=>215,922=>648, -923=>710,924=>829,925=>683,926=>645,927=>738,928=>726,929=>645,931=>673,932=>674,933=>771, -934=>773,935=>780,936=>778,937=>766,938=>263,939=>771,940=>660,941=>541,942=>560,943=>356, -944=>568,945=>632,946=>560,947=>591,948=>609,949=>541,950=>488,951=>608,952=>562,953=>315, -954=>533,955=>603,956=>582,957=>586,958=>513,959=>611,960=>658,961=>595,962=>590,963=>657, -964=>557,965=>568,966=>768,967=>632,968=>708,969=>778,970=>315,971=>568,972=>599,973=>568, -974=>778,977=>580,978=>742,979=>857,980=>620,981=>706,982=>740,983=>556,1008=>556,1009=>566, -1012=>778,1013=>328,1024=>670,1025=>670,1026=>800,1027=>611,1028=>714,1029=>667,1030=>314,1031=>300, -1032=>576,1033=>1100,1034=>1114,1035=>806,1036=>740,1037=>757,1038=>711,1039=>754,1040=>707,1041=>704, -1042=>704,1043=>611,1044=>900,1045=>670,1046=>1076,1047=>667,1048=>757,1049=>757,1050=>740,1051=>729, -1052=>874,1053=>753,1054=>774,1055=>753,1056=>675,1057=>711,1058=>611,1059=>711,1060=>904,1061=>666, -1062=>816,1063=>698,1064=>1057,1065=>1157,1066=>837,1067=>980,1068=>675,1069=>711,1070=>1093,1071=>708, -1072=>552,1073=>593,1074=>554,1075=>423,1076=>685,1077=>573,1078=>782,1079=>557,1080=>615,1081=>615, -1082=>559,1083=>568,1084=>666,1085=>603,1086=>606,1087=>603,1088=>612,1089=>556,1090=>440,1091=>549, -1092=>964,1093=>539,1094=>652,1095=>554,1096=>886,1097=>968,1098=>699,1099=>778,1100=>568,1101=>556, -1102=>848,1103=>586,1104=>573,1105=>573,1106=>606,1107=>423,1108=>556,1109=>555,1110=>260,1111=>278, -1112=>270,1113=>898,1114=>898,1115=>626,1116=>559,1117=>615,1118=>549,1119=>604,1136=>832,1137=>748, -1138=>774,1139=>606,1154=>449,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>0,1161=>0, -1162=>832,1163=>675,1164=>678,1165=>611,1166=>675,1167=>612,1168=>636,1169=>440,1170=>622,1171=>449, -1172=>647,1173=>574,1174=>1096,1175=>803,1176=>683,1177=>555,1178=>759,1179=>573,1180=>730,1181=>554, -1182=>737,1183=>555,1184=>892,1185=>680,1186=>825,1187=>653,1188=>999,1189=>763,1190=>1105,1191=>925, -1192=>714,1193=>558,1194=>722,1195=>558,1196=>614,1197=>438,1198=>643,1199=>573,1200=>643,1201=>603, -1202=>670,1203=>548,1204=>952,1205=>738,1206=>781,1207=>615,1208=>698,1209=>588,1210=>687,1211=>588, -1212=>993,1213=>761,1214=>965,1215=>759,1216=>314,1217=>1076,1218=>809,1219=>700,1220=>543,1221=>793, -1222=>634,1223=>753,1224=>603,1225=>819,1226=>663,1227=>706,1228=>588,1229=>935,1230=>720,1231=>314, -1232=>707,1233=>564,1234=>707,1235=>566,1236=>1004,1237=>898,1238=>670,1239=>573,1240=>722,1241=>573, -1242=>722,1243=>573,1244=>1076,1245=>782,1246=>667,1247=>557,1248=>556,1249=>552,1250=>757,1251=>615, -1252=>757,1253=>615,1254=>778,1255=>611,1256=>774,1257=>606,1258=>774,1259=>606,1260=>711,1261=>556, -1262=>700,1263=>544,1264=>701,1265=>539,1266=>700,1267=>537,1268=>698,1269=>554,1270=>611,1271=>432, -1272=>980,1273=>778,1296=>672,1297=>546,1298=>729,1299=>577,1306=>778,1307=>612,1308=>944,1309=>776, -1310=>730,1311=>554,1329=>730,1330=>713,1331=>765,1332=>752,1333=>708,1334=>801,1335=>496,1336=>713, -1337=>855,1338=>686,1339=>727,1340=>420,1341=>897,1342=>841,1343=>708,1344=>660,1345=>666,1346=>747, -1347=>698,1348=>757,1349=>630,1350=>747,1351=>651,1352=>743,1353=>657,1354=>728,1355=>799,1356=>752, -1357=>743,1358=>768,1359=>691,1360=>713,1361=>640,1362=>425,1363=>818,1364=>672,1365=>805,1366=>754, -1369=>333,1370=>222,1371=>250,1372=>333,1373=>333,1374=>352,1375=>362,1377=>873,1378=>613,1379=>634, -1380=>636,1381=>593,1382=>639,1383=>417,1384=>613,1385=>658,1386=>711,1387=>609,1388=>318,1389=>836, -1390=>670,1391=>613,1392=>607,1393=>611,1394=>626,1395=>619,1396=>618,1397=>324,1398=>613,1399=>540, -1400=>591,1401=>392,1402=>873,1403=>577,1404=>603,1405=>600,1406=>626,1407=>951,1408=>613,1409=>612, -1410=>348,1411=>951,1412=>616,1413=>606,1414=>763,1415=>626,1417=>333,1418=>398,1456=>0,1457=>0, -1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0,1468=>0, -1469=>0,1470=>516,1471=>0,1472=>297,1473=>0,1474=>0,1475=>333,1476=>0,1488=>714,1489=>651, -1490=>557,1491=>638,1492=>682,1493=>297,1494=>443,1495=>682,1496=>670,1497=>284,1498=>590,1499=>595, -1500=>667,1501=>683,1502=>704,1503=>297,1504=>429,1505=>670,1506=>653,1507=>661,1508=>660,1509=>616, -1510=>671,1511=>672,1512=>600,1513=>840,1514=>756,1520=>554,1521=>550,1522=>542,1523=>238,1524=>474, -2561=>0,2562=>122,2563=>313,2565=>897,2566=>1157,2567=>930,2568=>966,2569=>762,2570=>762,2575=>729, -2576=>904,2579=>773,2580=>903,2581=>726,2582=>672,2583=>741,2584=>790,2585=>702,2586=>723,2587=>693, -2588=>688,2589=>673,2590=>683,2591=>686,2592=>711,2593=>680,2594=>693,2595=>729,2596=>691,2597=>694, -2598=>699,2599=>666,2600=>669,2602=>683,2603=>690,2604=>660,2605=>659,2606=>692,2607=>772,2608=>673, -2610=>731,2611=>814,2613=>663,2614=>704,2616=>702,2617=>650,2620=>0,2622=>307,2623=>304,2624=>306, -2625=>7,2626=>7,2631=>7,2632=>8,2635=>6,2636=>5,2637=>8,2649=>684,2650=>813,2651=>715, -2652=>695,2654=>709,2662=>697,2663=>630,2664=>696,2665=>690,2666=>646,2667=>636,2668=>571,2669=>682, -2670=>718,2671=>730,2672=>9,2673=>162,2674=>722,2675=>760,2676=>1110,4256=>616,4257=>645,4258=>664, -4259=>839,4260=>627,4261=>630,4262=>827,4263=>928,4264=>639,4265=>630,4266=>951,4267=>606,4268=>608, -4269=>835,4270=>630,4271=>610,4272=>804,4273=>615,4274=>823,4275=>747,4276=>870,4277=>627,4278=>840, -4279=>627,4280=>665,4281=>610,4282=>799,4283=>598,4284=>665,4285=>664,4286=>608,4287=>886,4288=>629, -4304=>463,4305=>516,4306=>564,4307=>706,4308=>459,4309=>476,4310=>623,4311=>711,4312=>494,4313=>476, -4314=>894,4315=>500,4316=>500,4317=>712,4318=>493,4319=>503,4320=>712,4321=>503,4322=>710,4323=>670, -4324=>707,4325=>459,4326=>691,4327=>465,4328=>492,4329=>480,4330=>656,4331=>500,4332=>492,4333=>524, -4334=>500,4335=>688,4336=>510,4337=>739,4338=>450,4339=>479,4340=>502,4341=>501,4345=>564,4347=>515, -7680=>722,7681=>556,7682=>722,7683=>611,7684=>722,7685=>611,7686=>722,7687=>611,7688=>722,7689=>556, -7690=>722,7691=>611,7692=>722,7693=>611,7694=>722,7695=>611,7696=>722,7697=>611,7698=>722,7699=>611, -7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556,7708=>667,7709=>556, -7710=>611,7711=>333,7712=>778,7713=>611,7714=>722,7715=>611,7716=>722,7717=>611,7718=>722,7719=>611, -7720=>722,7721=>611,7722=>722,7723=>611,7724=>278,7725=>278,7726=>278,7727=>278,7728=>722,7729=>556, -7730=>722,7731=>556,7732=>722,7733=>556,7734=>611,7735=>278,7736=>611,7737=>278,7738=>611,7739=>278, -7740=>611,7741=>278,7742=>833,7743=>889,7744=>833,7745=>889,7746=>833,7747=>889,7748=>722,7749=>611, -7750=>722,7751=>611,7752=>722,7753=>611,7754=>722,7755=>611,7756=>778,7757=>611,7758=>778,7759=>611, -7760=>778,7761=>611,7762=>778,7763=>611,7764=>667,7765=>611,7766=>667,7767=>611,7768=>722,7769=>389, -7770=>722,7771=>389,7772=>722,7773=>389,7774=>722,7775=>389,7776=>667,7777=>556,7778=>667,7779=>556, -7780=>667,7781=>556,7782=>667,7783=>556,7784=>667,7785=>556,7786=>611,7787=>333,7788=>611,7789=>333, -7790=>611,7791=>333,7792=>611,7793=>333,7794=>722,7795=>611,7796=>722,7797=>611,7798=>722,7799=>611, -7800=>722,7801=>611,7802=>722,7803=>611,7804=>667,7805=>556,7806=>667,7807=>556,7808=>944,7809=>778, -7810=>944,7811=>778,7812=>944,7813=>778,7814=>944,7815=>778,7816=>944,7817=>778,7818=>667,7819=>556, -7820=>667,7821=>556,7822=>667,7823=>556,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500, -7830=>611,7831=>333,7832=>778,7833=>556,7834=>555,7835=>333,7840=>722,7841=>556,7842=>722,7843=>556, -7844=>722,7845=>556,7846=>722,7847=>556,7848=>667,7849=>556,7850=>722,7851=>556,7852=>722,7853=>556, -7854=>722,7855=>556,7856=>722,7857=>556,7858=>722,7859=>556,7860=>722,7861=>556,7862=>722,7863=>556, -7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556,7872=>667,7873=>556, -7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>278, -7884=>778,7885=>611,7886=>778,7887=>611,7888=>778,7889=>611,7890=>778,7891=>611,7892=>778,7893=>611, -7894=>778,7895=>611,7896=>778,7897=>611,7898=>791,7899=>653,7900=>791,7901=>653,7902=>791,7903=>653, -7904=>791,7905=>653,7906=>791,7907=>653,7908=>722,7909=>611,7910=>722,7911=>611,7912=>769,7913=>656, -7914=>769,7915=>656,7916=>769,7917=>656,7918=>769,7919=>656,7920=>769,7921=>656,7922=>667,7923=>556, -7924=>667,7925=>556,7926=>667,7927=>556,7928=>667,7929=>556,7936=>632,7937=>632,7938=>632,7939=>632, -7940=>632,7941=>632,7942=>632,7943=>632,7944=>696,7945=>696,7946=>865,7947=>849,7948=>796,7949=>807, -7950=>730,7951=>750,7952=>541,7953=>541,7954=>541,7955=>541,7956=>541,7957=>541,7960=>758,7961=>760, -7962=>957,7963=>943,7964=>939,7965=>945,7968=>608,7969=>608,7970=>608,7971=>608,7972=>608,7973=>608, -7974=>608,7975=>608,7976=>823,7977=>831,7978=>1026,7979=>1017,7980=>1002,7981=>1024,7982=>908,7983=>909, -7984=>315,7985=>315,7986=>373,7987=>375,7988=>378,7989=>374,7990=>370,7991=>384,7992=>378,7993=>383, -7994=>596,7995=>579,7996=>572,7997=>576,7998=>474,7999=>459,8000=>610,8001=>610,8002=>610,8003=>610, -8004=>610,8005=>610,8008=>800,8009=>871,8010=>1084,8011=>1079,8012=>975,8013=>973,8016=>568,8017=>568, -8018=>568,8019=>568,8020=>568,8021=>568,8022=>568,8023=>568,8025=>906,8027=>1080,8029=>1115,8031=>977, -8032=>778,8033=>778,8034=>778,8035=>778,8036=>778,8037=>778,8038=>778,8039=>778,8040=>837,8041=>860, -8042=>1062,8043=>1072,8044=>962,8045=>985,8046=>922,8047=>959,8048=>632,8049=>632,8050=>541,8051=>541, -8052=>608,8053=>608,8054=>315,8055=>315,8056=>610,8057=>610,8058=>568,8059=>568,8060=>778,8061=>778, -8064=>632,8065=>632,8066=>632,8067=>632,8068=>632,8069=>632,8070=>632,8071=>632,8072=>909,8073=>906, -8074=>1061,8075=>1035,8076=>984,8077=>994,8078=>910,8079=>916,8080=>608,8081=>608,8082=>608,8083=>608, -8084=>608,8085=>608,8086=>608,8087=>608,8088=>1006,8089=>1015,8090=>1204,8091=>1207,8092=>1188,8093=>1209, -8094=>1096,8095=>1105,8096=>778,8097=>778,8098=>778,8099=>778,8100=>778,8101=>778,8102=>778,8103=>778, -8104=>1026,8105=>1048,8106=>1251,8107=>1260,8108=>1150,8109=>1177,8110=>1106,8111=>1142,8112=>632,8113=>632, -8114=>632,8115=>632,8116=>660,8118=>632,8119=>632,8120=>696,8121=>696,8122=>696,8123=>696,8124=>907, -8125=>278,8126=>346,8127=>278,8128=>278,8129=>333,8130=>608,8131=>608,8132=>560,8134=>608,8135=>608, -8136=>776,8137=>793,8138=>847,8139=>854,8140=>848,8141=>492,8142=>489,8143=>394,8144=>335,8145=>354, -8146=>367,8147=>368,8150=>353,8151=>366,8152=>240,8153=>259,8154=>418,8155=>416,8157=>481,8158=>589, -8159=>333,8160=>568,8161=>568,8162=>568,8163=>568,8164=>595,8165=>595,8166=>568,8167=>568,8168=>771, -8169=>771,8170=>951,8171=>982,8172=>806,8173=>333,8174=>333,8175=>333,8178=>778,8179=>778,8180=>778, -8182=>778,8183=>778,8184=>909,8185=>809,8186=>897,8187=>825,8188=>978,8189=>333,8190=>278,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>556,8213=>1000,8214=>437, -8215=>556,8219=>278,8223=>500,8227=>350,8228=>278,8229=>666,8231=>278,8232=>0,8233=>0,8234=>0, -8235=>0,8236=>0,8237=>0,8238=>0,8239=>500,8241=>1367,8242=>238,8243=>426,8244=>614,8245=>238, -8246=>379,8247=>571,8248=>450,8251=>622,8252=>666,8253=>614,8254=>556,8255=>658,8256=>658,8257=>438, -8258=>840,8259=>400,8260=>167,8261=>334,8262=>334,8263=>1222,8264=>944,8265=>944,8266=>556,8267=>537, -8268=>537,8269=>537,8270=>389,8271=>333,8272=>658,8273=>389,8274=>634,8275=>568,8276=>658,8277=>793, -8278=>515,8279=>855,8280=>722,8281=>725,8282=>224,8283=>722,8284=>604,8285=>224,8286=>224,8287=>0, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8304=>351,8305=>351,8308=>351,8309=>351,8310=>351, -8311=>351,8312=>351,8313=>351,8314=>351,8315=>351,8316=>351,8317=>351,8318=>351,8319=>351,8320=>351, -8321=>301,8322=>351,8323=>351,8324=>351,8325=>351,8326=>351,8327=>351,8328=>351,8329=>351,8330=>350, -8331=>350,8332=>350,8333=>350,8334=>350,8355=>611,8356=>591,8357=>889,8358=>727,8360=>1265,8362=>1049, -8363=>580,8368=>605,8373=>591,8400=>0,8401=>0,8402=>0,8403=>0,8406=>0,8407=>0,8411=>0, -8412=>0,8413=>0,8414=>0,8415=>0,8416=>0,8417=>0,8421=>0,8422=>0,8423=>0,8424=>0, -8425=>0,8426=>0,8427=>0,8428=>0,8429=>0,8430=>0,8431=>0,8432=>0,8448=>985,8449=>1007, -8451=>1034,8453=>981,8454=>1042,8455=>667,8457=>919,8465=>606,8468=>881,8470=>979,8471=>784,8476=>699, -8480=>1000,8481=>1230,8486=>766,8487=>778,8489=>315,8490=>741,8491=>729,8494=>556,8498=>588,8501=>714, -8502=>651,8503=>557,8504=>638,8506=>871,8507=>1230,8513=>778,8514=>611,8515=>611,8516=>667,8523=>669, -8525=>1072,8526=>482,8531=>869,8532=>869,8533=>869,8534=>869,8535=>869,8536=>869,8537=>869,8538=>869, -8539=>869,8540=>869,8541=>869,8542=>869,8543=>869,8544=>278,8545=>556,8546=>834,8547=>945,8548=>667, -8549=>945,8550=>1223,8551=>1501,8552=>945,8553=>667,8554=>945,8555=>1223,8556=>611,8557=>722,8558=>722, -8559=>833,8560=>278,8561=>556,8562=>834,8563=>834,8564=>556,8565=>834,8566=>1112,8567=>1390,8568=>834, -8569=>556,8570=>834,8571=>1112,8572=>278,8573=>556,8574=>611,8575=>889,8592=>964,8593=>964,8594=>964, -8595=>964,8596=>964,8597=>964,8598=>964,8599=>964,8600=>964,8601=>964,8602=>964,8603=>964,8606=>964, -8607=>964,8608=>964,8609=>964,8610=>964,8611=>964,8612=>964,8613=>964,8614=>964,8615=>964,8616=>964, -8644=>964,8645=>964,8646=>964,8647=>964,8648=>964,8649=>964,8650=>964,8704=>722,8706=>556,8707=>667, -8710=>729,8711=>729,8721=>856,8722=>584,8725=>869,8730=>594,8747=>608,8800=>548,8804=>584,8805=>584, -9251=>500,9674=>541,9772=>923,9824=>626,9825=>694,9826=>595,9827=>776,9828=>626,9829=>694,9830=>595, -9831=>776,9833=>333,9834=>556,9835=>778,9836=>778,9837=>556,9838=>556,9839=>556,10048=>1453,11799=>333, -64256=>607,64257=>576,64258=>603,64259=>849,64260=>849,64275=>1243,64276=>1226,64277=>1233,64278=>1238,64279=>1448, -64285=>284,64286=>305,64287=>542,64288=>653,64289=>964,64290=>888,64291=>932,64292=>845,64293=>917,64294=>933, -64295=>850,64296=>1006,64297=>584,64298=>840,64299=>840,64300=>840,64301=>840,64302=>714,64303=>714,64304=>714, -64305=>651,64306=>557,64307=>638,64308=>682,64309=>348,64310=>443,64312=>670,64313=>354,64314=>590,64315=>595, -64316=>667,64318=>704,64320=>429,64321=>670,64323=>661,64324=>660,64326=>671,64327=>672,64328=>600,64329=>840, -64330=>756,64331=>212,64332=>591,64333=>550,64334=>568,64335=>714,65533=>788); -$enc=''; -$diff=''; -$file='freesansb.z'; -$ctg='freesansb.ctg.z'; -$originalsize=283180; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.z deleted file mode 100644 index 800fed290e..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.ctg.z deleted file mode 100644 index 9e8a3c725a..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.php deleted file mode 100644 index dab2c9755a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSansBoldOblique'; -$desc=array('Ascent'=>1000,'Descent'=>-300,'CapHeight'=>22,'Flags'=>96,'FontBBox'=>'[-769 -1175 1591 1639]','ItalicAngle'=>-12,'StemV'=>120,'MissingWidth'=>600); -$up=-145; -$ut=69; -$dw=600; -$cw=array( -32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333, -42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556, -52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584, -62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778, -72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778, -82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333, -92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556, -102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611, -112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556, -122=>500,123=>389,124=>280,125=>389,126=>584,8364=>640,8218=>278,402=>556,8222=>500,8230=>1000, -8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>333,338=>1000,381=>611,8216=>278,8217=>278, -8220=>500,8221=>500,8226=>350,8211=>556,8212=>1000,732=>333,8482=>1000,353=>556,8250=>333,339=>944, -382=>500,376=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556, -168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584, -178=>350,179=>350,180=>333,181=>667,182=>556,183=>278,184=>333,185=>248,186=>365,187=>556, -188=>869,189=>869,190=>869,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722, -198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722, -218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556, -228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278, -238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584, -248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556,256=>722,257=>556, -258=>722,259=>556,260=>722,261=>556,262=>722,263=>556,264=>722,265=>556,266=>722,267=>556, -268=>722,269=>556,270=>722,271=>722,272=>722,273=>611,274=>667,275=>556,276=>667,277=>556, -278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>611,286=>778,287=>611, -288=>778,289=>611,290=>778,291=>611,292=>722,293=>611,294=>722,295=>611,296=>278,297=>278, -298=>278,299=>278,300=>278,301=>278,302=>278,303=>268,304=>278,305=>278,306=>796,307=>487, -308=>556,309=>278,310=>722,311=>556,312=>529,313=>611,314=>278,315=>611,316=>278,317=>611, -318=>384,319=>611,320=>556,321=>611,322=>278,323=>722,324=>611,325=>722,326=>611,327=>722, -328=>611,329=>611,330=>722,331=>611,332=>778,333=>611,334=>778,335=>611,336=>778,337=>611, -340=>722,341=>389,342=>722,343=>389,344=>722,345=>389,346=>667,347=>556,348=>667,349=>556, -350=>667,351=>556,354=>611,355=>333,356=>611,357=>404,358=>611,359=>404,360=>722,361=>611, -362=>722,363=>611,364=>722,365=>611,366=>722,367=>611,368=>722,369=>611,370=>722,371=>611, -372=>944,373=>778,374=>667,375=>556,377=>611,378=>500,379=>611,380=>500,383=>333,384=>611, -385=>963,386=>722,387=>611,388=>687,389=>611,390=>722,391=>752,392=>562,393=>722,394=>968, -395=>722,396=>611,397=>609,398=>667,399=>778,400=>672,401=>611,403=>778,404=>667,405=>889, -406=>278,407=>395,408=>778,409=>556,410=>333,411=>620,412=>889,413=>722,414=>611,415=>778, -416=>778,417=>611,418=>1111,419=>722,420=>914,421=>611,422=>647,423=>667,424=>556,425=>688, -426=>441,427=>333,428=>742,429=>333,430=>611,431=>722,432=>611,433=>780,434=>722,435=>667, -436=>706,437=>611,438=>500,439=>556,440=>556,441=>645,442=>569,443=>579,446=>611,447=>608, -448=>260,449=>370,450=>584,451=>278,452=>1333,453=>1222,454=>1111,455=>1167,456=>889,457=>556, -458=>1278,459=>1000,460=>889,461=>722,462=>556,463=>278,464=>278,465=>778,466=>611,467=>722, -468=>611,469=>722,470=>611,471=>722,472=>611,473=>722,474=>611,475=>722,476=>611,477=>556, -478=>722,479=>556,480=>722,481=>556,482=>1000,483=>889,484=>811,485=>641,486=>778,487=>611, -488=>722,489=>556,490=>778,491=>611,492=>778,493=>611,494=>556,495=>556,496=>278,497=>1333, -498=>1222,499=>1111,500=>778,501=>611,503=>630,504=>722,505=>611,506=>722,507=>556,508=>1000, -509=>889,510=>778,511=>611,512=>722,513=>556,514=>722,515=>556,516=>667,517=>556,518=>667, -519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>611,526=>778,527=>611,528=>722, -529=>389,530=>722,531=>389,532=>722,533=>611,534=>722,535=>611,536=>667,537=>556,538=>611, -539=>333,540=>569,541=>486,542=>722,543=>611,548=>645,549=>500,550=>722,551=>556,552=>667, -553=>556,554=>778,555=>611,556=>778,557=>611,558=>778,559=>611,560=>778,561=>611,562=>667, -563=>556,567=>278,592=>556,593=>611,594=>611,595=>611,596=>556,597=>600,598=>611,599=>611, -600=>556,601=>556,602=>834,603=>570,604=>546,605=>820,606=>570,607=>278,608=>611,609=>611, -610=>556,611=>556,612=>656,613=>619,614=>611,615=>611,616=>278,617=>344,618=>278,619=>473, -620=>527,621=>298,622=>778,623=>889,624=>889,625=>889,626=>611,627=>611,628=>615,629=>590, -630=>878,631=>822,632=>778,633=>389,634=>389,635=>389,636=>389,637=>389,638=>455,639=>455, -640=>620,641=>586,642=>556,643=>333,644=>278,645=>333,646=>544,647=>328,648=>333,649=>623, -650=>726,651=>639,652=>556,653=>778,654=>556,655=>556,656=>500,657=>571,658=>556,659=>642, -660=>611,661=>611,662=>611,664=>611,665=>572,666=>570,667=>616,668=>603,669=>552,670=>556, -671=>454,672=>611,673=>611,674=>611,684=>520,688=>500,689=>500,690=>167,691=>333,692=>333, -693=>333,694=>348,695=>500,696=>345,697=>278,698=>454,699=>278,700=>333,701=>278,702=>333, -703=>333,704=>333,705=>333,706=>333,707=>333,708=>333,709=>333,711=>333,712=>333,713=>333, -714=>333,715=>333,716=>272,717=>333,718=>333,719=>333,720=>333,721=>333,722=>333,723=>333, -724=>333,725=>333,726=>333,727=>333,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333, -735=>510,736=>333,737=>333,738=>333,739=>357,740=>334,741=>526,742=>526,743=>526,744=>526, -745=>526,746=>519,747=>519,748=>333,749=>333,750=>333,751=>333,752=>333,753=>333,754=>333, -755=>333,756=>333,757=>437,758=>437,759=>400,760=>333,761=>200,762=>200,763=>200,764=>200, -765=>332,766=>333,767=>333,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0, -775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0, -785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0, -795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0, -805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0, -815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0, -825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0, -835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0, -845=>0,846=>0,847=>0,848=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0, -855=>0,856=>0,857=>0,858=>0,859=>0,860=>0,861=>0,862=>0,863=>0,864=>0, -865=>0,866=>0,867=>0,868=>0,869=>0,870=>0,871=>0,872=>0,873=>0,874=>0, -875=>0,876=>0,877=>0,878=>0,879=>0,884=>208,885=>247,890=>364,894=>333,900=>239, -901=>446,902=>688,903=>333,904=>903,905=>962,906=>448,908=>904,910=>991,911=>932,912=>346, -913=>764,914=>688,915=>642,916=>744,917=>710,918=>688,919=>743,920=>810,921=>296,922=>744, -923=>744,924=>860,925=>714,926=>690,927=>822,928=>781,929=>698,931=>688,932=>688,933=>744, -934=>777,935=>783,936=>805,937=>780,938=>296,939=>744,940=>640,941=>530,942=>597,943=>339, -944=>575,945=>656,946=>576,947=>591,948=>620,949=>570,950=>522,951=>586,952=>586,953=>346, -954=>576,955=>620,956=>667,957=>564,958=>530,959=>610,960=>721,961=>626,962=>595,963=>676, -964=>592,965=>575,966=>801,967=>632,968=>722,969=>800,970=>346,971=>575,972=>609,973=>604, -974=>769,977=>580,978=>742,979=>857,980=>620,981=>778,982=>740,983=>601,1008=>556,1009=>566, -1012=>778,1013=>328,1024=>667,1025=>667,1026=>790,1027=>617,1028=>731,1029=>667,1030=>278,1031=>278, -1032=>556,1033=>1110,1034=>1088,1035=>790,1036=>722,1037=>757,1038=>698,1039=>722,1040=>722,1041=>722, -1042=>722,1043=>617,1044=>876,1045=>667,1046=>1100,1047=>670,1048=>757,1049=>757,1050=>722,1051=>715, -1052=>874,1053=>753,1054=>778,1055=>753,1056=>680,1057=>722,1058=>611,1059=>698,1060=>909,1061=>657, -1062=>845,1063=>688,1064=>1132,1065=>1217,1066=>835,1067=>980,1068=>678,1069=>735,1070=>1142,1071=>708, -1072=>553,1073=>591,1074=>574,1075=>429,1076=>745,1077=>572,1078=>792,1079=>554,1080=>603,1081=>603, -1082=>559,1083=>583,1084=>664,1085=>603,1086=>588,1087=>603,1088=>605,1089=>549,1090=>440,1091=>541, -1092=>948,1093=>539,1094=>690,1095=>564,1096=>901,1097=>987,1098=>692,1099=>806,1100=>572,1101=>546, -1102=>893,1103=>586,1104=>572,1105=>572,1106=>616,1107=>429,1108=>549,1109=>562,1110=>281,1111=>281, -1112=>282,1113=>888,1114=>897,1115=>606,1116=>559,1117=>603,1118=>541,1119=>603,1136=>830,1137=>761, -1138=>778,1139=>590,1154=>456,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>0,1161=>0, -1162=>791,1163=>662,1164=>639,1165=>581,1166=>670,1167=>649,1168=>623,1169=>450,1170=>623,1171=>472, -1172=>674,1173=>528,1174=>1091,1175=>803,1176=>659,1177=>548,1178=>739,1179=>569,1180=>742,1181=>560, -1182=>737,1183=>559,1184=>900,1185=>679,1186=>808,1187=>673,1188=>1004,1189=>761,1190=>1114,1191=>876, -1192=>721,1193=>548,1194=>724,1195=>554,1196=>611,1197=>454,1198=>667,1199=>584,1200=>652,1201=>632, -1202=>667,1203=>550,1204=>951,1205=>748,1206=>759,1207=>630,1208=>669,1209=>580,1210=>672,1211=>576, -1212=>977,1213=>752,1214=>957,1215=>752,1216=>318,1217=>1087,1218=>792,1219=>726,1220=>530,1221=>782, -1222=>674,1223=>749,1224=>603,1225=>823,1226=>682,1227=>675,1228=>573,1229=>941,1230=>754,1231=>310, -1232=>704,1233=>553,1234=>711,1235=>553,1236=>1000,1237=>889,1238=>667,1239=>569,1240=>738,1241=>561, -1242=>738,1243=>561,1244=>1086,1245=>792,1246=>670,1247=>554,1248=>558,1249=>546,1250=>753,1251=>603, -1252=>753,1253=>603,1254=>778,1255=>588,1256=>778,1257=>590,1258=>778,1259=>590,1260=>735,1261=>546, -1262=>698,1263=>541,1264=>698,1265=>541,1266=>698,1267=>541,1268=>686,1269=>564,1270=>617,1271=>475, -1272=>976,1273=>806,1296=>672,1297=>546,1298=>729,1299=>577,1306=>778,1307=>611,1308=>944,1309=>776, -1310=>750,1311=>573,1329=>730,1330=>713,1331=>765,1332=>752,1333=>708,1334=>801,1335=>496,1336=>713, -1337=>855,1338=>686,1339=>727,1340=>420,1341=>897,1342=>841,1343=>708,1344=>660,1345=>666,1346=>747, -1347=>698,1348=>757,1349=>630,1350=>747,1351=>651,1352=>743,1353=>657,1354=>728,1355=>799,1356=>752, -1357=>743,1358=>768,1359=>691,1360=>713,1361=>640,1362=>425,1363=>818,1364=>672,1365=>805,1366=>754, -1369=>333,1370=>222,1371=>250,1372=>333,1373=>333,1374=>352,1375=>362,1377=>873,1378=>613,1379=>634, -1380=>636,1381=>593,1382=>639,1383=>417,1384=>613,1385=>658,1386=>711,1387=>609,1388=>318,1389=>836, -1390=>670,1391=>613,1392=>607,1393=>611,1394=>626,1395=>619,1396=>618,1397=>324,1398=>613,1399=>540, -1400=>591,1401=>392,1402=>873,1403=>577,1404=>603,1405=>600,1406=>626,1407=>951,1408=>613,1409=>612, -1410=>348,1411=>951,1412=>616,1413=>606,1414=>763,1415=>626,1417=>333,1418=>398,1456=>0,1457=>0, -1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1467=>0,1468=>0, -1469=>0,1470=>516,1471=>0,1472=>297,1473=>0,1474=>0,1475=>333,1476=>0,1488=>714,1489=>651, -1490=>557,1491=>638,1492=>682,1493=>297,1494=>443,1495=>682,1496=>670,1497=>284,1498=>590,1499=>595, -1500=>667,1501=>683,1502=>704,1503=>297,1504=>429,1505=>670,1506=>653,1507=>661,1508=>660,1509=>616, -1510=>671,1511=>672,1512=>600,1513=>840,1514=>756,1520=>554,1521=>550,1522=>542,1523=>238,1524=>474, -4256=>616,4257=>645,4258=>664,4259=>839,4260=>627,4261=>630,4262=>827,4263=>928,4264=>639,4265=>630, -4266=>951,4267=>606,4268=>608,4269=>835,4270=>630,4271=>610,4272=>804,4273=>615,4274=>823,4275=>747, -4276=>870,4277=>627,4278=>840,4279=>627,4280=>665,4281=>610,4282=>799,4283=>598,4284=>665,4285=>664, -4286=>608,4287=>886,4288=>629,4304=>463,4305=>516,4306=>564,4307=>706,4308=>459,4309=>476,4310=>623, -4311=>711,4312=>494,4313=>476,4314=>894,4315=>500,4316=>500,4317=>712,4318=>493,4319=>503,4320=>712, -4321=>503,4322=>710,4323=>670,4324=>707,4325=>459,4326=>691,4327=>465,4328=>492,4329=>480,4330=>656, -4331=>500,4332=>492,4333=>524,4334=>500,4335=>688,4336=>510,4337=>739,4338=>450,4339=>479,4340=>502, -4341=>501,4345=>564,4347=>515,7680=>722,7681=>556,7682=>722,7683=>611,7684=>722,7685=>611,7686=>722, -7687=>611,7688=>722,7689=>556,7690=>722,7691=>611,7692=>722,7693=>611,7694=>722,7695=>611,7696=>722, -7697=>611,7698=>722,7699=>611,7700=>667,7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667, -7707=>556,7708=>667,7709=>556,7710=>611,7711=>333,7712=>778,7713=>611,7714=>722,7715=>611,7716=>722, -7717=>611,7718=>722,7719=>611,7720=>722,7721=>611,7722=>722,7723=>611,7724=>278,7725=>278,7726=>278, -7727=>278,7728=>722,7729=>556,7730=>722,7731=>556,7732=>722,7733=>556,7734=>611,7735=>278,7736=>611, -7737=>278,7738=>611,7739=>278,7740=>611,7741=>278,7742=>833,7743=>889,7744=>833,7745=>889,7746=>833, -7747=>889,7748=>722,7749=>611,7750=>722,7751=>611,7752=>722,7753=>611,7754=>722,7755=>611,7756=>778, -7757=>611,7758=>778,7759=>611,7760=>778,7761=>611,7762=>778,7763=>611,7764=>667,7765=>611,7766=>667, -7767=>611,7768=>722,7769=>389,7770=>722,7771=>389,7772=>722,7773=>389,7774=>722,7775=>389,7776=>667, -7777=>556,7778=>667,7779=>556,7780=>667,7781=>556,7782=>667,7783=>556,7784=>667,7785=>556,7786=>611, -7787=>333,7788=>611,7789=>333,7790=>611,7791=>333,7792=>611,7793=>333,7794=>722,7795=>611,7796=>722, -7797=>611,7798=>722,7799=>611,7800=>722,7801=>611,7802=>722,7803=>611,7804=>667,7805=>556,7806=>667, -7807=>556,7808=>944,7809=>778,7810=>944,7811=>778,7812=>944,7813=>778,7814=>944,7815=>778,7816=>944, -7817=>778,7818=>667,7819=>556,7820=>667,7821=>556,7822=>667,7823=>556,7824=>611,7825=>500,7826=>611, -7827=>500,7828=>611,7829=>500,7830=>611,7831=>333,7832=>778,7833=>556,7834=>555,7835=>333,7840=>722, -7841=>556,7842=>722,7843=>556,7844=>722,7845=>556,7846=>722,7847=>556,7848=>722,7849=>556,7850=>722, -7851=>556,7852=>722,7853=>556,7854=>722,7855=>556,7856=>722,7857=>556,7858=>722,7859=>556,7860=>722, -7861=>556,7862=>722,7863=>556,7864=>667,7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667, -7871=>556,7872=>667,7873=>556,7874=>667,7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278, -7881=>278,7882=>278,7883=>278,7884=>778,7885=>611,7886=>778,7887=>611,7888=>778,7889=>611,7890=>778, -7891=>611,7892=>778,7893=>611,7894=>778,7895=>611,7896=>778,7897=>611,7898=>778,7899=>611,7900=>778, -7901=>611,7902=>778,7903=>611,7904=>778,7905=>611,7906=>778,7907=>611,7908=>722,7909=>611,7910=>722, -7911=>611,7912=>722,7913=>611,7914=>722,7915=>611,7916=>722,7917=>611,7918=>722,7919=>611,7920=>722, -7921=>611,7922=>667,7923=>556,7924=>667,7925=>556,7926=>667,7927=>556,7928=>667,7929=>556,7936=>656, -7937=>656,7938=>656,7939=>656,7940=>656,7941=>656,7942=>656,7943=>656,7944=>764,7945=>764,7946=>916, -7947=>940,7948=>908,7949=>891,7950=>844,7951=>869,7952=>570,7953=>570,7954=>570,7955=>570,7956=>570, -7957=>570,7960=>842,7961=>836,7962=>1025,7963=>1051,7964=>1035,7965=>1049,7968=>586,7969=>586,7970=>586, -7971=>586,7972=>586,7973=>586,7974=>586,7975=>586,7976=>891,7977=>886,7978=>1081,7979=>1108,7980=>1085, -7981=>1096,7982=>1009,7983=>1023,7984=>346,7985=>346,7986=>346,7987=>346,7988=>346,7989=>346,7990=>346, -7991=>346,7992=>467,7993=>476,7994=>631,7995=>661,7996=>631,7997=>633,7998=>568,7999=>571,8000=>610, -8001=>610,8002=>610,8003=>610,8004=>610,8005=>610,8008=>945,8009=>905,8010=>1118,8011=>1121,8012=>1064, -8013=>1062,8016=>575,8017=>575,8018=>575,8019=>575,8020=>575,8021=>575,8022=>575,8023=>575,8025=>964, -8027=>1148,8029=>1162,8031=>1081,8032=>800,8033=>800,8034=>800,8035=>800,8036=>800,8037=>800,8038=>800, -8039=>800,8040=>904,8041=>875,8042=>1092,8043=>1087,8044=>1003,8045=>1002,8046=>1001,8047=>1025,8048=>656, -8049=>656,8050=>570,8051=>570,8052=>586,8053=>586,8054=>346,8055=>346,8056=>610,8057=>610,8058=>575, -8059=>575,8060=>800,8061=>800,8064=>656,8065=>656,8066=>656,8067=>656,8068=>656,8069=>656,8070=>656, -8071=>656,8072=>854,8073=>855,8074=>1006,8075=>1030,8076=>996,8077=>977,8078=>938,8079=>959,8080=>586, -8081=>586,8082=>586,8083=>586,8084=>586,8085=>586,8086=>586,8087=>586,8088=>960,8089=>960,8090=>1155, -8091=>1186,8092=>1161,8093=>1171,8094=>1087,8095=>1102,8096=>800,8097=>800,8098=>800,8099=>800,8100=>800, -8101=>800,8102=>800,8103=>800,8104=>1005,8105=>980,8106=>1201,8107=>1192,8108=>1109,8109=>1108,8110=>1106, -8111=>1130,8112=>656,8113=>656,8114=>656,8115=>656,8116=>640,8118=>656,8119=>656,8120=>764,8121=>764, -8122=>764,8123=>764,8124=>854,8125=>278,8126=>201,8127=>147,8128=>278,8129=>333,8130=>586,8131=>586, -8132=>597,8134=>586,8135=>586,8136=>911,8137=>925,8138=>941,8139=>948,8140=>826,8141=>402,8142=>403, -8143=>147,8144=>346,8145=>346,8146=>346,8147=>346,8150=>346,8151=>346,8152=>296,8153=>296,8154=>511, -8155=>521,8157=>434,8158=>433,8159=>333,8160=>575,8161=>575,8162=>575,8163=>575,8164=>626,8165=>626, -8166=>575,8167=>575,8168=>744,8169=>744,8170=>901,8171=>975,8172=>837,8173=>353,8174=>351,8175=>303, -8178=>800,8179=>800,8180=>800,8182=>800,8183=>800,8184=>979,8185=>918,8186=>936,8187=>877,8188=>895, -8189=>333,8190=>159,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556, -8200=>278,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333, -8210=>556,8213=>1000,8214=>437,8215=>556,8219=>278,8223=>503,8227=>350,8228=>278,8229=>666,8231=>278, -8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>500,8241=>1372,8242=>238, -8243=>426,8244=>614,8245=>238,8246=>379,8247=>571,8248=>450,8251=>622,8252=>666,8253=>617,8254=>556, -8255=>658,8256=>658,8257=>438,8258=>840,8259=>400,8260=>167,8261=>334,8262=>334,8263=>1222,8264=>944, -8265=>944,8266=>556,8267=>556,8268=>537,8269=>537,8270=>389,8271=>333,8272=>658,8273=>389,8274=>634, -8275=>568,8276=>658,8277=>793,8278=>515,8279=>855,8280=>722,8281=>725,8282=>224,8283=>722,8284=>604, -8285=>224,8286=>224,8287=>0,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8304=>351,8305=>351, -8308=>351,8309=>351,8310=>351,8311=>351,8312=>351,8313=>351,8314=>351,8315=>351,8316=>351,8317=>351, -8318=>351,8319=>351,8320=>351,8321=>251,8322=>351,8323=>351,8324=>351,8325=>351,8326=>351,8327=>351, -8328=>351,8329=>351,8330=>350,8331=>350,8332=>350,8333=>350,8334=>350,8355=>611,8356=>576,8357=>833, -8358=>724,8360=>1286,8362=>1049,8363=>571,8368=>594,8373=>591,8448=>985,8449=>1007,8451=>1020,8453=>981, -8454=>1042,8455=>667,8457=>930,8465=>606,8468=>883,8470=>1006,8471=>784,8476=>699,8480=>1000,8481=>1230, -8486=>780,8487=>780,8489=>286,8490=>722,8491=>722,8494=>556,8498=>626,8501=>714,8502=>651,8503=>557, -8504=>638,8506=>906,8507=>1155,8513=>778,8514=>611,8515=>611,8516=>667,8523=>710,8525=>1072,8526=>500, -8531=>869,8532=>869,8533=>869,8534=>869,8535=>869,8536=>869,8537=>869,8538=>869,8539=>869,8540=>869, -8541=>869,8542=>869,8543=>869,8544=>278,8545=>556,8546=>834,8547=>945,8548=>667,8549=>945,8550=>1223, -8551=>1501,8552=>945,8553=>667,8554=>945,8555=>1223,8556=>611,8557=>722,8558=>722,8559=>833,8560=>278, -8561=>556,8562=>834,8563=>834,8564=>556,8565=>834,8566=>1112,8567=>1390,8568=>834,8569=>556,8570=>834, -8571=>1112,8572=>278,8573=>556,8574=>611,8575=>889,8592=>964,8593=>964,8594=>964,8595=>964,8596=>964, -8597=>964,8598=>964,8599=>964,8600=>964,8601=>964,8602=>964,8603=>964,8606=>964,8607=>964,8608=>964, -8609=>964,8610=>964,8611=>964,8612=>964,8613=>964,8614=>964,8615=>964,8616=>964,8644=>964,8645=>964, -8646=>964,8647=>964,8648=>964,8649=>964,8650=>964,8706=>608,8710=>729,8721=>856,8722=>584,8723=>584, -8725=>1107,8730=>597,8800=>584,8804=>584,8805=>584,9251=>500,9674=>489,9824=>626,9825=>694,9826=>595, -9827=>776,9828=>626,9829=>694,9830=>595,9831=>776,9833=>333,9834=>556,9835=>778,9836=>778,9837=>556, -9838=>556,9839=>556,11799=>333,64256=>607,64257=>576,64258=>603,64259=>849,64260=>849,64275=>1243,64276=>1226, -64277=>1233,64278=>1238,64279=>1448,64285=>284,64286=>305,64287=>542,64288=>653,64289=>964,64290=>888,64291=>932, -64292=>845,64293=>917,64294=>933,64295=>850,64296=>1006,64297=>584,64298=>840,64299=>840,64300=>840,64301=>840, -64302=>714,64303=>714,64304=>714,64305=>651,64306=>557,64307=>638,64308=>682,64309=>348,64310=>443,64312=>670, -64313=>354,64314=>590,64315=>595,64316=>667,64318=>704,64320=>429,64321=>670,64323=>661,64324=>660,64326=>671, -64327=>672,64328=>600,64329=>840,64330=>756,64331=>212,64332=>591,64333=>550,64334=>568,64335=>714,65533=>788); -$enc=''; -$diff=''; -$file='freesansbi.z'; -$ctg='freesansbi.ctg.z'; -$originalsize=269952; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.z deleted file mode 100644 index 62a3322592..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.ctg.z deleted file mode 100644 index fe5d471764..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.php deleted file mode 100644 index 898bb41b17..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.php +++ /dev/null @@ -1,239 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSansOblique'; -$desc=array('Ascent'=>1000,'Descent'=>-300,'CapHeight'=>22,'Flags'=>96,'FontBBox'=>'[-898 -431 1572 1072]','ItalicAngle'=>-12,'StemV'=>70,'MissingWidth'=>600); -$up=-176; -$ut=50; -$dw=600; -$cw=array( -32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333, -42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556, -52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584, -62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778, -72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778, -82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278, -92=>278,93=>278,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556, -102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556, -112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500, -122=>500,123=>334,124=>260,125=>334,126=>584,8364=>655,8218=>222,402=>278,8222=>333,8230=>1000, -8224=>556,8225=>556,710=>333,8240=>1000,352=>667,8249=>250,338=>1000,381=>611,8216=>222,8217=>222, -8220=>333,8221=>333,8226=>350,8211=>556,8212=>1000,732=>333,8482=>1000,353=>500,8250=>250,339=>944, -382=>500,376=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556, -168=>333,169=>737,170=>370,171=>444,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584, -178=>352,179=>352,180=>333,181=>556,182=>537,183=>278,184=>333,185=>250,186=>365,187=>444, -188=>947,189=>947,190=>947,191=>611,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667, -198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722, -218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556, -228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278, -238=>278,239=>278,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584, -248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>667,257=>556, -258=>667,259=>556,260=>667,261=>556,262=>722,263=>500,264=>722,265=>500,266=>722,267=>500, -268=>722,269=>500,270=>722,271=>722,272=>722,273=>556,274=>667,275=>556,276=>667,277=>556, -278=>667,279=>556,280=>667,281=>556,282=>667,283=>556,284=>778,285=>556,286=>778,287=>556, -288=>778,289=>556,290=>778,291=>527,292=>722,293=>556,294=>722,295=>556,296=>278,297=>278, -298=>278,299=>278,300=>278,301=>278,302=>278,303=>222,304=>278,305=>278,306=>742,307=>362, -308=>500,309=>222,310=>667,311=>500,312=>510,313=>556,314=>222,315=>556,316=>222,317=>556, -318=>387,319=>556,320=>409,321=>556,322=>222,323=>722,324=>556,325=>722,326=>556,327=>722, -328=>556,329=>722,330=>722,331=>556,332=>778,333=>556,334=>778,335=>556,336=>778,337=>556, -340=>722,341=>333,342=>722,343=>333,344=>722,345=>333,346=>667,347=>500,348=>667,349=>500, -350=>667,351=>500,354=>611,355=>278,356=>611,357=>443,358=>611,359=>278,360=>722,361=>556, -362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556, -372=>944,373=>722,374=>667,375=>500,377=>611,378=>500,379=>611,380=>500,383=>278,384=>556, -385=>854,386=>667,387=>556,388=>667,389=>556,390=>722,391=>722,392=>500,393=>722,394=>899, -395=>667,396=>556,397=>566,398=>667,399=>778,400=>667,401=>611,403=>778,404=>667,405=>889, -406=>278,407=>333,408=>741,409=>500,410=>333,411=>560,412=>833,413=>722,414=>556,415=>778, -416=>778,417=>556,418=>944,419=>722,420=>842,421=>556,422=>666,423=>667,424=>500,425=>611, -426=>333,427=>278,428=>611,429=>278,430=>611,431=>722,432=>556,433=>768,434=>722,435=>788, -436=>616,437=>611,438=>500,439=>611,440=>611,441=>500,442=>500,443=>556,446=>556,447=>556, -448=>260,449=>520,450=>584,451=>278,452=>1311,453=>1208,454=>1056,455=>1056,456=>778,457=>444, -458=>1158,459=>944,460=>778,461=>667,462=>556,463=>278,464=>278,465=>778,466=>556,467=>722, -468=>556,469=>722,470=>556,471=>722,472=>556,473=>722,474=>556,475=>722,476=>556,477=>556, -478=>667,479=>556,480=>667,481=>556,482=>1000,483=>889,484=>778,485=>556,486=>778,487=>556, -488=>667,489=>500,490=>778,491=>556,492=>778,493=>556,494=>611,495=>500,496=>222,497=>1333, -498=>1222,499=>1056,500=>778,501=>556,503=>630,504=>722,505=>556,506=>667,507=>556,508=>1000, -509=>889,510=>778,511=>611,512=>667,513=>556,514=>667,515=>556,516=>667,517=>556,518=>667, -519=>556,520=>278,521=>278,522=>278,523=>278,524=>778,525=>556,526=>778,527=>556,528=>722, -529=>333,530=>722,531=>333,532=>722,533=>556,534=>722,535=>556,536=>667,537=>500,538=>611, -539=>278,540=>521,541=>393,542=>722,543=>556,548=>611,549=>500,550=>667,551=>556,552=>667, -553=>556,554=>778,555=>556,556=>778,557=>556,558=>778,559=>556,560=>778,561=>556,562=>667, -563=>500,567=>222,592=>556,593=>556,594=>659,595=>556,596=>500,597=>500,598=>556,599=>556, -600=>556,601=>556,602=>804,603=>500,604=>500,605=>742,606=>500,607=>222,608=>556,609=>556, -610=>546,611=>621,612=>556,613=>556,614=>556,615=>556,616=>222,617=>222,618=>278,619=>473, -620=>427,621=>222,622=>611,623=>833,624=>833,625=>833,626=>556,627=>556,628=>560,629=>556, -630=>778,631=>722,632=>728,633=>333,634=>333,635=>393,636=>333,637=>333,638=>384,639=>369, -640=>546,641=>546,642=>500,643=>278,644=>278,645=>278,646=>444,647=>278,648=>278,649=>556, -650=>626,651=>539,652=>500,653=>722,654=>500,655=>556,656=>500,657=>500,658=>500,659=>552, -660=>556,661=>556,662=>556,663=>1000,664=>556,665=>521,666=>500,667=>546,668=>500,669=>444, -670=>500,671=>430,672=>556,673=>556,674=>556,675=>944,676=>944,677=>944,678=>689,679=>506, -680=>764,681=>766,682=>660,683=>577,684=>476,685=>486,686=>565,687=>621,688=>500,689=>500, -690=>167,691=>333,692=>333,693=>393,694=>500,695=>500,696=>330,697=>278,698=>454,699=>278, -700=>278,701=>278,702=>333,703=>333,704=>333,705=>333,706=>333,707=>333,708=>333,709=>333, -711=>333,712=>333,713=>333,714=>333,715=>333,716=>333,717=>333,718=>333,719=>333,720=>333, -721=>333,722=>333,723=>333,724=>333,725=>333,726=>333,727=>333,728=>333,729=>333,730=>333, -731=>333,733=>333,734=>333,735=>510,736=>333,737=>333,738=>333,739=>333,740=>334,741=>526, -742=>526,743=>526,744=>526,745=>526,746=>519,747=>519,748=>333,749=>333,750=>333,751=>333, -752=>383,753=>294,754=>294,755=>327,756=>261,757=>437,758=>437,759=>333,760=>278,761=>200, -762=>200,763=>200,764=>200,765=>333,766=>333,767=>333,768=>0,769=>0,770=>0,771=>0, -772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0, -782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0, -792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0, -802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0, -812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, -822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0, -832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0, -842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,848=>0,849=>0,850=>0,851=>0, -852=>0,853=>0,854=>0,855=>0,856=>0,857=>0,858=>0,859=>0,860=>0,861=>0, -862=>0,863=>0,864=>0,865=>0,866=>0,867=>0,868=>0,869=>0,870=>0,871=>0, -872=>0,873=>0,874=>0,875=>0,876=>0,877=>0,878=>0,879=>0,884=>199,885=>199, -890=>332,894=>278,900=>291,901=>624,902=>659,903=>278,904=>870,905=>870,906=>315,908=>876, -910=>903,911=>882,912=>333,913=>765,914=>643,915=>589,916=>760,917=>659,918=>682,919=>707, -920=>769,921=>256,922=>689,923=>765,924=>825,925=>687,926=>649,927=>766,928=>730,929=>649, -931=>678,932=>655,933=>733,934=>753,935=>783,936=>773,937=>768,938=>285,939=>733,940=>593, -941=>523,942=>595,943=>271,944=>549,945=>596,946=>534,947=>531,948=>566,949=>523,950=>470, -951=>557,952=>547,953=>293,954=>516,955=>579,956=>571,957=>518,958=>499,959=>561,960=>636, -961=>551,962=>564,963=>627,964=>505,965=>549,966=>715,967=>579,968=>662,969=>746,970=>335, -971=>549,972=>535,973=>503,974=>725,977=>580,978=>742,979=>809,980=>620,981=>728,982=>740, -983=>556,1008=>556,1009=>566,1012=>778,1013=>328,1024=>657,1025=>657,1026=>781,1027=>590,1028=>709, -1029=>655,1030=>254,1031=>254,1032=>532,1033=>1002,1034=>1166,1035=>772,1036=>674,1037=>730,1038=>605, -1039=>721,1040=>667,1041=>665,1042=>665,1043=>590,1044=>807,1045=>657,1046=>914,1047=>653,1048=>730, -1049=>730,1050=>674,1051=>656,1052=>846,1053=>721,1054=>778,1055=>720,1056=>649,1057=>709,1058=>606, -1059=>605,1060=>875,1061=>660,1062=>754,1063=>612,1064=>830,1065=>872,1066=>839,1067=>885,1068=>668, -1069=>708,1070=>1099,1071=>676,1072=>556,1073=>545,1074=>521,1075=>375,1076=>572,1077=>538,1078=>815, -1079=>488,1080=>557,1081=>557,1082=>519,1083=>508,1084=>618,1085=>558,1086=>533,1087=>557,1088=>569, -1089=>511,1090=>392,1091=>469,1092=>922,1093=>475,1094=>588,1095=>482,1096=>693,1097=>722,1098=>644, -1099=>731,1100=>521,1101=>509,1102=>790,1103=>550,1104=>538,1105=>538,1106=>566,1107=>375,1108=>506, -1109=>488,1110=>224,1111=>272,1112=>226,1113=>793,1114=>849,1115=>576,1116=>519,1117=>557,1118=>469, -1119=>557,1120=>942,1121=>693,1136=>749,1137=>666,1138=>785,1139=>528,1154=>456,1155=>0,1156=>0, -1157=>0,1158=>0,1159=>0,1160=>0,1161=>0,1162=>751,1163=>588,1164=>685,1165=>554,1166=>656, -1167=>606,1168=>598,1169=>396,1170=>611,1171=>409,1172=>592,1173=>448,1174=>921,1175=>826,1176=>657, -1177=>493,1178=>680,1179=>529,1180=>678,1181=>524,1182=>695,1183=>528,1184=>846,1185=>650,1186=>741, -1187=>578,1188=>992,1189=>700,1190=>1047,1191=>778,1192=>687,1193=>507,1194=>709,1195=>509,1196=>611, -1197=>393,1198=>664,1199=>580,1200=>668,1201=>617,1202=>664,1203=>489,1204=>905,1205=>662,1206=>631, -1207=>498,1208=>597,1209=>472,1210=>597,1211=>471,1212=>927,1213=>716,1214=>927,1215=>716,1216=>254, -1217=>915,1218=>815,1219=>665,1220=>510,1221=>678,1222=>533,1223=>721,1224=>558,1225=>751,1226=>589, -1227=>599,1228=>472,1229=>876,1230=>649,1231=>254,1232=>667,1233=>552,1234=>667,1235=>552,1236=>1000, -1237=>889,1238=>657,1239=>538,1240=>722,1241=>511,1242=>722,1243=>511,1244=>914,1245=>815,1246=>653, -1247=>488,1248=>611,1249=>546,1250=>730,1251=>557,1252=>730,1253=>557,1254=>774,1255=>529,1256=>785, -1257=>528,1258=>785,1259=>528,1260=>708,1261=>509,1262=>605,1263=>469,1264=>605,1265=>469,1266=>605, -1267=>469,1268=>612,1269=>482,1270=>601,1271=>430,1272=>885,1273=>731,1296=>667,1297=>500,1298=>673, -1299=>557,1306=>778,1307=>556,1308=>944,1309=>722,1310=>667,1311=>510,1329=>722,1330=>705,1331=>774, -1332=>754,1333=>722,1334=>751,1335=>485,1336=>722,1337=>782,1338=>655,1339=>699,1340=>417,1341=>853, -1342=>791,1343=>711,1344=>588,1345=>663,1346=>665,1347=>665,1348=>756,1349=>623,1350=>773,1351=>603, -1352=>722,1353=>648,1354=>722,1355=>751,1356=>750,1357=>722,1358=>748,1359=>667,1360=>699,1361=>623, -1362=>417,1363=>785,1364=>638,1365=>778,1366=>716,1369=>333,1370=>222,1371=>133,1372=>325,1373=>333, -1374=>333,1375=>333,1377=>833,1378=>556,1379=>572,1380=>581,1381=>546,1382=>588,1383=>448,1384=>556, -1385=>568,1386=>582,1387=>552,1388=>301,1389=>799,1390=>556,1391=>554,1392=>533,1393=>548,1394=>552, -1395=>552,1396=>544,1397=>222,1398=>544,1399=>456,1400=>556,1401=>390,1402=>833,1403=>509,1404=>547, -1405=>533,1406=>610,1407=>887,1408=>556,1409=>545,1410=>301,1411=>853,1412=>632,1413=>579,1414=>690, -1415=>545,1417=>278,1418=>367,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0, -1463=>0,1464=>0,1465=>0,1467=>0,1468=>0,1469=>0,1470=>488,1471=>0,1472=>212,1473=>0, -1474=>0,1475=>278,1476=>0,1488=>640,1489=>591,1490=>466,1491=>598,1492=>622,1493=>212,1494=>351, -1495=>623,1496=>608,1497=>200,1498=>526,1499=>550,1500=>600,1501=>623,1502=>621,1503=>212,1504=>378, -1505=>607,1506=>587,1507=>575,1508=>568,1509=>540,1510=>590,1511=>606,1512=>547,1513=>776,1514=>687, -1520=>424,1521=>412,1522=>400,1523=>184,1524=>344,2433=>0,2434=>300,2435=>264,2437=>594,2438=>790, -2439=>469,2440=>513,2441=>520,2442=>549,2443=>594,2444=>481,2447=>580,2448=>627,2451=>540,2452=>613, -2453=>570,2454=>467,2455=>471,2456=>428,2457=>483,2458=>408,2459=>509,2460=>591,2461=>563,2462=>771, -2463=>381,2464=>404,2465=>522,2466=>408,2467=>450,2468=>543,2469=>477,2470=>418,2471=>433,2472=>445, -2474=>499,2475=>584,2476=>377,2477=>555,2478=>448,2479=>423,2480=>390,2482=>498,2486=>498,2487=>425, -2488=>495,2489=>440,2492=>22,2493=>440,2494=>193,2495=>189,2496=>180,2497=>0,2498=>0,2499=>0, -2500=>0,2503=>252,2504=>243,2507=>889,2508=>865,2509=>0,2510=>356,2519=>219,2524=>523,2525=>408, -2527=>428,2528=>594,2529=>481,2530=>0,2531=>0,2534=>500,2535=>437,2536=>479,2537=>530,2538=>497, -2539=>500,2540=>482,2541=>503,2542=>517,2543=>481,2544=>377,2545=>377,2546=>429,2547=>383,2548=>429, -2549=>478,2550=>545,2551=>158,2552=>365,2553=>280,2554=>357,4256=>587,4257=>620,4258=>642,4259=>815, -4260=>600,4261=>595,4262=>799,4263=>893,4264=>622,4265=>597,4266=>939,4267=>602,4268=>603,4269=>790, -4270=>587,4271=>623,4272=>799,4273=>601,4274=>792,4275=>724,4276=>847,4277=>599,4278=>812,4279=>603, -4280=>653,4281=>590,4282=>754,4283=>596,4284=>653,4285=>651,4286=>596,4287=>888,4288=>593,4304=>436, -4305=>491,4306=>528,4307=>692,4308=>447,4309=>447,4310=>628,4311=>734,4312=>449,4313=>445,4314=>843, -4315=>449,4316=>449,4317=>682,4318=>449,4319=>480,4320=>682,4321=>468,4322=>710,4323=>623,4324=>697, -4325=>447,4326=>702,4327=>447,4328=>470,4329=>440,4330=>632,4331=>449,4332=>470,4333=>536,4334=>449, -4335=>656,4336=>474,4337=>630,4338=>394,4339=>419,4340=>422,4341=>436,4345=>528,4347=>515,7680=>667, -7681=>556,7682=>667,7683=>556,7684=>667,7685=>556,7686=>667,7687=>556,7688=>722,7689=>500,7690=>722, -7691=>556,7692=>722,7693=>556,7694=>722,7695=>556,7696=>722,7697=>556,7698=>722,7699=>556,7700=>667, -7701=>556,7702=>667,7703=>556,7704=>667,7705=>556,7706=>667,7707=>556,7708=>667,7709=>556,7710=>611, -7711=>278,7712=>778,7713=>556,7714=>722,7715=>556,7716=>722,7717=>556,7718=>722,7719=>556,7720=>722, -7721=>556,7722=>722,7723=>556,7724=>278,7725=>222,7726=>278,7727=>278,7728=>667,7729=>500,7730=>667, -7731=>500,7732=>667,7733=>500,7734=>556,7735=>222,7736=>556,7737=>222,7738=>556,7739=>222,7740=>556, -7741=>222,7742=>833,7743=>833,7744=>833,7745=>833,7746=>833,7747=>833,7748=>722,7749=>556,7750=>722, -7751=>556,7752=>722,7753=>556,7754=>722,7755=>556,7756=>778,7757=>556,7758=>778,7759=>556,7760=>778, -7761=>556,7762=>778,7763=>556,7764=>667,7765=>556,7766=>667,7767=>556,7768=>722,7769=>333,7770=>722, -7771=>333,7772=>722,7773=>333,7774=>722,7775=>333,7776=>667,7777=>500,7778=>667,7779=>500,7780=>667, -7781=>500,7782=>667,7783=>500,7784=>667,7785=>500,7786=>611,7787=>278,7788=>611,7789=>278,7790=>611, -7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722, -7801=>556,7802=>722,7803=>556,7804=>667,7805=>500,7806=>667,7807=>500,7808=>944,7809=>722,7810=>944, -7811=>722,7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>667,7819=>500,7820=>667, -7821=>500,7822=>667,7823=>500,7824=>611,7825=>500,7826=>611,7827=>500,7828=>611,7829=>500,7830=>556, -7831=>278,7832=>722,7833=>500,7834=>555,7835=>278,7840=>667,7841=>556,7842=>667,7843=>556,7844=>667, -7845=>556,7846=>667,7847=>556,7848=>667,7849=>556,7850=>667,7851=>556,7852=>667,7853=>556,7854=>667, -7855=>556,7856=>667,7857=>556,7858=>667,7859=>556,7860=>667,7861=>556,7862=>667,7863=>556,7864=>667, -7865=>556,7866=>667,7867=>556,7868=>667,7869=>556,7870=>667,7871=>556,7872=>667,7873=>556,7874=>667, -7875=>556,7876=>667,7877=>556,7878=>667,7879=>556,7880=>278,7881=>278,7882=>278,7883=>222,7884=>778, -7885=>556,7886=>778,7887=>556,7888=>778,7889=>556,7890=>778,7891=>556,7892=>778,7893=>556,7894=>778, -7895=>556,7896=>778,7897=>556,7898=>778,7899=>556,7900=>778,7901=>556,7902=>778,7903=>556,7904=>778, -7905=>556,7906=>778,7907=>556,7908=>722,7909=>556,7910=>722,7911=>556,7912=>722,7913=>556,7914=>722, -7915=>556,7916=>722,7917=>556,7918=>722,7919=>556,7920=>722,7921=>556,7922=>667,7923=>500,7924=>667, -7925=>500,7926=>667,7927=>500,7928=>667,7929=>500,7936=>596,7937=>596,7938=>596,7939=>596,7940=>596, -7941=>596,7942=>596,7943=>596,7944=>718,7945=>718,7946=>796,7947=>780,7948=>746,7949=>744,7950=>718, -7951=>718,7952=>523,7953=>523,7954=>523,7955=>523,7956=>523,7957=>523,7960=>759,7961=>751,7962=>962, -7963=>957,7964=>958,7965=>947,7968=>557,7969=>557,7970=>557,7971=>557,7972=>557,7973=>557,7974=>557, -7975=>557,7976=>807,7977=>796,7978=>1013,7979=>1002,7980=>1009,7981=>1000,7982=>882,7983=>919,7984=>293, -7985=>293,7986=>361,7987=>382,7988=>347,7989=>329,7990=>352,7991=>347,7992=>353,7993=>348,7994=>555, -7995=>557,7996=>557,7997=>545,7998=>435,7999=>448,8000=>561,8001=>561,8002=>561,8003=>561,8004=>561, -8005=>561,8008=>792,8009=>801,8010=>1031,8011=>1029,8012=>931,8013=>931,8016=>549,8017=>549,8018=>549, -8019=>549,8020=>549,8021=>549,8022=>549,8023=>549,8025=>838,8027=>1004,8029=>1036,8031=>936,8032=>746, -8033=>746,8034=>746,8035=>746,8036=>746,8037=>746,8038=>746,8039=>746,8040=>768,8041=>794,8042=>1003, -8043=>1002,8044=>922,8045=>918,8046=>871,8047=>893,8048=>596,8049=>596,8050=>523,8051=>523,8052=>557, -8053=>557,8054=>293,8055=>293,8056=>561,8057=>561,8058=>549,8059=>549,8060=>746,8061=>746,8064=>596, -8065=>596,8066=>596,8067=>596,8068=>596,8069=>596,8070=>596,8071=>596,8072=>859,8073=>861,8074=>948, -8075=>928,8076=>886,8077=>895,8078=>865,8079=>864,8080=>557,8081=>557,8082=>557,8083=>557,8084=>557, -8085=>557,8086=>557,8087=>557,8088=>890,8089=>894,8090=>1092,8091=>1084,8092=>1095,8093=>1080,8094=>953, -8095=>986,8096=>746,8097=>746,8098=>746,8099=>746,8100=>746,8101=>746,8102=>746,8103=>746,8104=>892, -8105=>907,8106=>1113,8107=>1095,8108=>1034,8109=>1030,8110=>983,8111=>1002,8112=>596,8113=>596,8114=>596, -8115=>596,8116=>593,8118=>596,8119=>596,8120=>765,8121=>765,8122=>765,8123=>765,8124=>861,8125=>147, -8126=>201,8127=>147,8128=>278,8129=>333,8130=>557,8131=>557,8132=>595,8134=>557,8135=>557,8136=>835, -8137=>849,8138=>895,8139=>861,8140=>786,8141=>602,8142=>601,8143=>333,8144=>335,8145=>322,8146=>357, -8147=>336,8150=>340,8151=>320,8152=>300,8153=>298,8154=>439,8155=>408,8157=>434,8158=>433,8159=>333, -8160=>549,8161=>549,8162=>549,8163=>549,8164=>551,8165=>551,8166=>549,8167=>549,8168=>733,8169=>733, -8170=>794,8171=>832,8172=>739,8173=>333,8174=>624,8175=>303,8178=>746,8179=>746,8180=>725,8182=>746, -8183=>746,8184=>889,8185=>828,8186=>836,8187=>811,8188=>867,8189=>333,8190=>159,8192=>500,8193=>1000, -8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>556,8200=>278,8201=>200,8202=>100,8203=>0, -8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>556,8213=>1000,8214=>312,8215=>567, -8219=>221,8223=>333,8227=>350,8228=>278,8229=>666,8231=>278,8232=>0,8233=>0,8234=>0,8235=>0, -8236=>0,8237=>0,8238=>0,8239=>500,8241=>1360,8242=>278,8243=>469,8244=>680,8245=>278,8246=>469, -8247=>680,8248=>376,8251=>622,8252=>556,8253=>556,8254=>556,8255=>658,8256=>658,8257=>438,8258=>840, -8259=>400,8260=>167,8261=>334,8262=>334,8263=>1112,8264=>834,8265=>834,8266=>556,8267=>537,8268=>537, -8269=>537,8270=>389,8271=>278,8272=>658,8273=>389,8274=>634,8275=>500,8276=>658,8277=>1000,8278=>515, -8279=>855,8280=>722,8281=>725,8282=>224,8283=>722,8284=>604,8285=>224,8286=>224,8287=>0,8288=>0, -8289=>0,8290=>0,8291=>0,8292=>0,8304=>351,8305=>350,8308=>351,8309=>351,8310=>351,8311=>351, -8312=>351,8313=>351,8314=>350,8315=>350,8316=>350,8317=>350,8318=>350,8319=>350,8320=>351,8321=>251, -8322=>351,8323=>351,8324=>351,8325=>353,8326=>351,8327=>351,8328=>351,8329=>351,8330=>350,8331=>350, -8332=>350,8333=>350,8334=>350,8353=>615,8354=>601,8355=>611,8356=>556,8357=>833,8358=>682,8359=>1205, -8360=>1222,8361=>879,8362=>869,8363=>538,8365=>667,8366=>611,8368=>570,8369=>684,8370=>717,8371=>667, -8372=>667,8373=>640,8400=>0,8401=>0,8402=>0,8403=>0,8406=>0,8407=>0,8411=>0,8412=>0, -8413=>0,8414=>0,8415=>0,8416=>0,8417=>0,8421=>0,8422=>0,8423=>0,8424=>0,8425=>0, -8426=>0,8427=>0,8428=>0,8429=>0,8430=>0,8431=>0,8432=>0,8448=>970,8449=>979,8451=>1019, -8452=>556,8453=>876,8454=>922,8455=>667,8457=>867,8459=>969,8460=>615,8462=>556,8463=>572,8464=>809, -8465=>606,8466=>874,8468=>747,8470=>934,8471=>737,8472=>600,8475=>850,8476=>699,8480=>1000,8481=>1220, -8486=>768,8487=>744,8488=>512,8489=>286,8490=>722,8491=>722,8492=>908,8493=>623,8494=>556,8496=>562, -8498=>556,8499=>1080,8501=>520,8502=>591,8503=>456,8504=>598,8506=>843,8507=>1220,8513=>778,8514=>556, -8515=>556,8516=>667,8522=>516,8523=>640,8525=>936,8526=>477,8531=>869,8532=>869,8533=>869,8534=>869, -8535=>869,8536=>869,8537=>869,8538=>869,8539=>869,8540=>869,8541=>869,8542=>869,8543=>869,8544=>278, -8545=>556,8546=>834,8547=>945,8548=>667,8549=>945,8550=>1223,8551=>1501,8552=>945,8553=>667,8554=>945, -8555=>1223,8556=>556,8557=>722,8558=>722,8559=>833,8560=>222,8561=>444,8562=>666,8563=>722,8564=>500, -8565=>722,8566=>944,8567=>1166,8568=>722,8569=>500,8570=>722,8571=>944,8572=>222,8573=>500,8574=>556, -8575=>833,8592=>987,8593=>603,8594=>987,8595=>603,8596=>1042,8597=>1042,8706=>556,8710=>712,8721=>804, -8722=>584,8725=>947,8730=>542,8739=>200,8741=>312,8800=>584,8804=>584,8805=>584,9251=>500,9674=>489, -9824=>626,9825=>694,9826=>595,9827=>776,9828=>626,9829=>694,9830=>595,9831=>776,9833=>333,9834=>556, -9835=>722,9836=>722,9837=>415,9838=>377,9839=>402,11799=>333,64256=>494,64257=>471,64258=>474,64259=>659, -64260=>654,64261=>530,64275=>1027,64276=>1056,64277=>1058,64278=>1073,64279=>1301,64285=>200,64286=>305,64287=>400, -64288=>587,64289=>890,64290=>848,64291=>872,64292=>800,64293=>850,64294=>873,64295=>797,64296=>937,64297=>584, -64298=>776,64299=>776,64300=>776,64301=>776,64302=>640,64303=>640,64304=>640,64305=>591,64306=>466,64307=>598, -64308=>622,64309=>262,64310=>351,64312=>608,64313=>270,64314=>526,64315=>550,64316=>600,64318=>621,64320=>378, -64321=>607,64323=>575,64324=>568,64326=>590,64327=>606,64328=>547,64329=>776,64330=>687,64331=>212,64332=>591, -64333=>550,64334=>568,64335=>640,65533=>788); -$enc=''; -$diff=''; -$file='freesansi.z'; -$ctg='freesansi.ctg.z'; -$originalsize=410728; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.z deleted file mode 100644 index d675eb2666..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freesansi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.ctg.z deleted file mode 100644 index 06f25fc8ab..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.php deleted file mode 100644 index 0fbefe781f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.php +++ /dev/null @@ -1,504 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSerif'; -$desc=array('Ascent'=>900,'Descent'=>-300,'CapHeight'=>10,'Flags'=>96,'FontBBox'=>'[-879 -1201 1767 2606]','ItalicAngle'=>-33.2,'StemV'=>70,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>250,33=>333,34=>408,35=>500,36=>500,37=>833,38=>778,39=>180,40=>333,41=>333, -42=>500,43=>564,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500, -52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,60=>564,61=>564, -62=>564,63=>444,64=>921,65=>722,66=>667,67=>667,68=>722,69=>611,70=>556,71=>722, -72=>722,73=>333,74=>389,75=>722,76=>611,77=>889,78=>722,79=>722,80=>556,81=>722, -82=>667,83=>556,84=>611,85=>722,86=>722,87=>944,88=>722,89=>722,90=>611,91=>333, -92=>278,93=>333,94=>469,95=>500,96=>333,97=>444,98=>500,99=>444,100=>500,101=>444, -102=>333,103=>500,104=>500,105=>278,106=>278,107=>500,108=>278,109=>778,110=>500,111=>500, -112=>500,113=>500,114=>333,115=>389,116=>278,117=>500,118=>500,119=>722,120=>500,121=>500, -122=>444,123=>480,124=>200,125=>480,126=>541,8364=>741,8218=>250,402=>333,8222=>444,8230=>1000, -8224=>500,8225=>500,710=>333,8240=>1000,352=>556,8249=>250,338=>889,381=>611,8216=>250,8217=>250, -8220=>444,8221=>444,8226=>350,8211=>500,8212=>1000,732=>333,8482=>980,353=>389,8250=>250,339=>722, -382=>444,376=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>200,167=>500, -168=>333,169=>760,170=>276,171=>444,172=>564,173=>333,174=>760,175=>333,176=>400,177=>564, -178=>320,179=>320,180=>333,181=>500,182=>453,183=>250,184=>333,185=>320,186=>310,187=>441, -188=>750,189=>750,190=>750,191=>444,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722, -198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333, -208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>564,216=>722,217=>722, -218=>722,219=>722,220=>722,221=>722,222=>576,223=>500,224=>444,225=>444,226=>444,227=>444, -228=>444,229=>444,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278, -238=>278,239=>278,240=>501,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>564, -248=>500,249=>500,250=>500,251=>500,252=>500,253=>500,254=>496,255=>500,256=>722,257=>444, -258=>722,259=>444,260=>722,261=>444,262=>667,263=>444,264=>667,265=>444,266=>667,267=>444, -268=>667,269=>444,270=>722,271=>600,272=>722,273=>500,274=>611,275=>444,276=>611,277=>444, -278=>611,279=>444,280=>611,281=>444,282=>611,283=>444,284=>722,285=>500,286=>722,287=>500, -288=>722,289=>500,290=>722,291=>500,292=>722,293=>500,294=>722,295=>548,296=>333,297=>278, -298=>333,299=>278,300=>333,301=>278,302=>333,303=>278,304=>333,305=>278,306=>703,307=>529, -308=>389,309=>278,310=>722,311=>500,312=>500,313=>611,314=>278,315=>611,316=>278,317=>611, -318=>348,319=>611,320=>444,321=>611,322=>278,323=>722,324=>500,325=>722,326=>500,327=>722, -328=>500,329=>556,330=>722,331=>500,332=>722,333=>500,334=>722,335=>500,336=>722,337=>500, -340=>667,341=>333,342=>667,343=>333,344=>667,345=>333,346=>556,347=>389,348=>556,349=>389, -350=>556,351=>389,354=>611,355=>278,356=>611,357=>278,358=>611,359=>278,360=>722,361=>500, -362=>722,363=>500,364=>722,365=>500,366=>722,367=>500,368=>722,369=>500,370=>722,371=>500, -372=>944,373=>722,374=>722,375=>500,377=>611,378=>444,379=>611,380=>444,383=>333,384=>500, -385=>667,386=>576,387=>500,388=>646,389=>500,390=>667,391=>667,392=>444,393=>722,394=>722, -395=>646,396=>500,397=>534,398=>611,399=>722,400=>518,401=>556,403=>722,404=>665,405=>729, -406=>333,407=>333,408=>810,409=>500,410=>278,411=>480,412=>944,413=>722,414=>500,415=>726, -416=>722,417=>516,418=>1043,419=>778,420=>556,421=>500,422=>667,423=>556,424=>389,425=>627, -426=>592,427=>278,428=>611,429=>278,430=>611,431=>800,432=>518,433=>743,434=>722,435=>822, -436=>667,437=>611,438=>444,439=>530,440=>556,441=>389,442=>394,443=>500,444=>615,445=>439, -446=>421,447=>500,448=>200,449=>400,450=>600,451=>333,452=>1333,453=>1166,454=>944,455=>1000, -456=>889,457=>556,458=>1111,459=>1000,460=>778,461=>722,462=>444,463=>333,464=>278,465=>722, -466=>500,467=>722,468=>500,469=>722,470=>500,471=>722,472=>500,473=>722,474=>500,475=>722, -476=>500,477=>444,478=>722,479=>444,480=>722,481=>444,482=>889,483=>667,484=>722,485=>500, -486=>722,487=>500,488=>722,489=>500,490=>722,491=>500,492=>722,493=>500,494=>530,495=>389, -496=>278,497=>1333,498=>1166,499=>944,500=>722,501=>500,502=>944,503=>522,504=>722,505=>500, -506=>722,507=>444,508=>889,509=>667,510=>722,511=>500,512=>722,513=>444,514=>722,515=>444, -516=>611,517=>444,518=>611,519=>444,520=>333,521=>278,522=>333,523=>278,524=>722,525=>500, -526=>722,527=>500,528=>667,529=>333,530=>667,531=>333,532=>500,533=>500,534=>722,535=>500, -536=>556,537=>389,538=>611,539=>278,540=>424,541=>455,542=>722,543=>500,544=>715,545=>588, -546=>565,547=>468,548=>611,549=>444,550=>722,551=>444,552=>611,553=>444,554=>722,555=>500, -556=>722,557=>500,558=>722,559=>500,560=>722,561=>500,562=>722,563=>500,564=>407,565=>597, -566=>379,567=>278,568=>771,569=>760,570=>722,571=>667,572=>444,573=>611,574=>611,575=>389, -576=>444,577=>444,578=>444,579=>667,580=>722,581=>722,582=>611,583=>444,584=>389,585=>278, -586=>796,587=>590,588=>667,589=>333,590=>722,591=>500,592=>444,593=>500,594=>507,595=>500, -596=>444,597=>444,598=>500,599=>500,600=>444,601=>444,602=>722,603=>426,604=>426,605=>674, -606=>454,607=>278,608=>500,609=>500,610=>484,611=>500,612=>582,613=>500,614=>500,615=>500, -616=>278,617=>278,618=>278,619=>278,620=>278,621=>278,622=>556,623=>778,624=>778,625=>778, -626=>500,627=>500,628=>500,629=>491,630=>668,631=>693,632=>640,633=>333,634=>333,635=>333, -636=>333,637=>333,638=>333,639=>333,640=>446,641=>446,642=>389,643=>333,644=>500,645=>333, -646=>500,647=>278,648=>278,649=>500,650=>517,651=>514,652=>500,653=>722,654=>500,655=>510, -656=>524,657=>444,658=>389,659=>456,660=>444,661=>444,662=>444,663=>444,664=>722,665=>468, -666=>454,667=>665,668=>524,669=>347,670=>500,671=>443,672=>500,673=>444,674=>444,675=>798, -676=>795,677=>805,678=>554,679=>561,680=>678,681=>722,682=>554,683=>554,684=>500,685=>500, -686=>611,687=>611,688=>300,689=>300,690=>278,691=>278,692=>278,693=>309,694=>306,695=>432, -696=>310,697=>250,698=>408,699=>333,700=>333,701=>333,702=>333,703=>333,704=>258,705=>258, -706=>374,707=>374,708=>383,709=>383,711=>333,712=>250,713=>333,714=>333,715=>333,716=>250, -717=>333,718=>333,719=>333,720=>278,721=>278,722=>333,723=>333,724=>333,725=>333,726=>333, -727=>333,728=>333,729=>333,730=>333,731=>333,733=>382,734=>336,735=>352,736=>311,737=>200, -738=>243,739=>328,740=>300,741=>460,742=>460,743=>460,744=>460,745=>460,746=>477,747=>475, -748=>339,749=>333,750=>444,751=>383,752=>383,753=>294,754=>294,755=>327,756=>261,757=>437, -758=>437,759=>333,760=>278,761=>175,762=>175,763=>175,764=>175,765=>337,766=>337,767=>326, -768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0, -778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0, -788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0, -798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0, -808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0, -818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0, -828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, -838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0, -848=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0,855=>0,856=>0,857=>0, -858=>0,859=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,867=>0, -868=>0,869=>0,870=>0,871=>0,872=>0,873=>0,874=>0,875=>0,876=>0,877=>0, -878=>0,879=>0,884=>199,885=>199,890=>332,894=>278,900=>267,901=>333,902=>722,903=>250, -904=>800,905=>902,906=>507,908=>818,910=>861,911=>871,912=>286,913=>722,914=>667,915=>586, -916=>660,917=>611,918=>611,919=>722,920=>726,921=>333,922=>722,923=>722,924=>889,925=>722, -926=>628,927=>722,928=>722,929=>556,931=>627,932=>611,933=>696,934=>742,935=>722,936=>808, -937=>743,938=>333,939=>718,940=>583,941=>426,942=>536,943=>286,944=>514,945=>583,946=>527, -947=>480,948=>534,949=>426,950=>466,951=>536,952=>534,953=>286,954=>544,955=>476,956=>536, -957=>480,958=>514,959=>500,960=>587,961=>528,962=>452,963=>537,964=>420,965=>514,966=>643, -967=>480,968=>693,969=>693,970=>286,971=>514,972=>500,973=>514,974=>693,976=>534,977=>587, -978=>620,979=>809,980=>620,981=>640,982=>684,983=>534,984=>556,985=>500,986=>594,987=>426, -988=>556,989=>445,990=>656,991=>400,992=>722,993=>570,994=>960,995=>673,996=>581,997=>429, -998=>560,999=>407,1000=>450,1001=>321,1002=>842,1003=>593,1004=>564,1005=>413,1006=>618,1007=>438, -1008=>534,1009=>534,1010=>485,1011=>278,1012=>726,1013=>361,1014=>361,1015=>576,1016=>542,1017=>667, -1018=>889,1019=>709,1020=>534,1021=>667,1022=>1000,1023=>1000,1024=>615,1025=>613,1026=>748,1027=>570, -1028=>659,1029=>487,1030=>329,1031=>329,1032=>381,1033=>943,1034=>985,1035=>827,1036=>669,1037=>723, -1038=>709,1039=>723,1040=>711,1041=>576,1042=>626,1043=>570,1044=>639,1045=>613,1046=>937,1047=>580, -1048=>723,1049=>723,1050=>669,1051=>684,1052=>891,1053=>723,1054=>722,1055=>723,1056=>576,1057=>659, -1058=>608,1059=>709,1060=>750,1061=>714,1062=>728,1063=>682,1064=>984,1065=>988,1066=>725,1067=>863, -1068=>576,1069=>659,1070=>966,1071=>648,1072=>434,1073=>495,1074=>468,1075=>386,1076=>488,1077=>436, -1078=>662,1079=>404,1080=>524,1081=>524,1082=>498,1083=>490,1084=>632,1085=>524,1086=>491,1087=>524, -1088=>500,1089=>422,1090=>422,1091=>471,1092=>694,1093=>482,1094=>522,1095=>506,1096=>756,1097=>754, -1098=>503,1099=>626,1100=>431,1101=>430,1102=>664,1103=>492,1104=>434,1105=>434,1106=>479,1107=>386, -1108=>430,1109=>347,1110=>269,1111=>278,1112=>278,1113=>677,1114=>711,1115=>514,1116=>498,1117=>524, -1118=>471,1119=>524,1120=>978,1121=>664,1122=>718,1123=>506,1124=>939,1125=>647,1126=>912,1127=>643, -1128=>1248,1129=>894,1130=>948,1131=>662,1132=>1299,1133=>911,1134=>516,1135=>391,1136=>870,1137=>694, -1138=>726,1139=>491,1140=>780,1141=>550,1142=>780,1143=>550,1144=>1207,1145=>946,1146=>877,1147=>611, -1148=>978,1149=>664,1150=>978,1151=>664,1152=>594,1153=>428,1154=>232,1155=>0,1156=>0,1157=>0, -1158=>0,1159=>0,1160=>0,1161=>0,1162=>715,1163=>522,1164=>562,1165=>430,1166=>556,1167=>511, -1168=>564,1169=>398,1170=>586,1171=>402,1172=>573,1173=>463,1174=>1001,1175=>688,1176=>580,1177=>414, -1178=>698,1179=>517,1180=>734,1181=>537,1182=>671,1183=>498,1184=>842,1185=>573,1186=>732,1187=>524, -1188=>926,1189=>652,1190=>1014,1191=>721,1192=>671,1193=>531,1194=>667,1195=>437,1196=>611,1197=>454, -1198=>722,1199=>563,1200=>722,1201=>562,1202=>783,1203=>517,1204=>967,1205=>693,1206=>691,1207=>510, -1208=>718,1209=>538,1210=>674,1211=>508,1212=>866,1213=>566,1214=>866,1215=>566,1216=>333,1217=>937, -1218=>662,1219=>626,1220=>446,1221=>702,1222=>489,1223=>722,1224=>497,1225=>823,1226=>545,1227=>674, -1228=>504,1229=>889,1230=>630,1231=>333,1232=>711,1233=>434,1234=>711,1235=>434,1236=>889,1237=>644, -1238=>613,1239=>449,1240=>722,1241=>449,1242=>722,1243=>449,1244=>937,1245=>662,1246=>580,1247=>404, -1248=>530,1249=>366,1250=>723,1251=>524,1252=>723,1253=>524,1254=>722,1255=>491,1256=>722,1257=>491, -1258=>722,1259=>491,1260=>659,1261=>430,1262=>709,1263=>471,1264=>709,1265=>471,1266=>709,1267=>471, -1268=>682,1269=>506,1270=>564,1271=>388,1272=>863,1273=>626,1274=>556,1275=>388,1276=>720,1277=>445, -1278=>722,1279=>495,1280=>556,1281=>504,1282=>900,1283=>634,1284=>553,1285=>471,1286=>803,1287=>518, -1288=>964,1289=>637,1290=>968,1291=>682,1292=>722,1293=>433,1294=>710,1295=>504,1296=>532,1297=>409, -1298=>702,1299=>489,1300=>960,1301=>644,1302=>823,1303=>702,1304=>961,1305=>766,1306=>722,1307=>504, -1308=>944,1309=>693,1310=>690,1311=>502,1312=>994,1313=>695,1314=>1011,1315=>727,1425=>0,1426=>0, -1427=>0,1428=>0,1429=>0,1430=>0,1431=>418,1432=>0,1433=>0,1434=>0,1435=>0,1436=>0, -1437=>0,1438=>0,1439=>0,1440=>0,1441=>0,1442=>0,1443=>0,1444=>0,1445=>0,1446=>0, -1447=>0,1448=>0,1449=>0,1450=>0,1451=>0,1452=>0,1453=>0,1454=>0,1455=>0,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>440,1471=>0,1472=>126,1473=>0,1474=>0,1475=>418,1476=>0, -1477=>0,1478=>350,1479=>0,1488=>537,1489=>537,1490=>350,1491=>537,1492=>537,1493=>350,1494=>350, -1495=>537,1496=>537,1497=>350,1498=>537,1499=>537,1500=>537,1501=>537,1502=>537,1503=>350,1504=>350, -1505=>537,1506=>537,1507=>537,1508=>537,1509=>537,1510=>537,1511=>537,1512=>537,1513=>537,1514=>537, -1520=>537,1521=>537,1522=>537,1523=>396,1524=>396,1548=>226,1563=>250,1567=>473,1569=>350,1570=>321, -1571=>249,1572=>399,1573=>249,1574=>776,1575=>249,1576=>950,1577=>424,1578=>925,1579=>924,1580=>738, -1581=>748,1582=>701,1583=>397,1584=>399,1585=>328,1586=>331,1587=>951,1588=>949,1589=>949,1590=>949, -1591=>557,1592=>550,1593=>625,1594=>602,1601=>801,1602=>696,1603=>757,1604=>655,1605=>549,1606=>651, -1607=>424,1608=>399,1609=>776,1610=>776,1611=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0, -1618=>0,1619=>0,1620=>0,1621=>0,1632=>297,1633=>254,1634=>427,1635=>497,1636=>440,1637=>465, -1638=>466,1639=>421,1640=>459,1641=>424,1643=>212,1652=>300,1662=>926,1670=>750,1688=>338,1711=>874, -1740=>776,1748=>176,1920=>450,1921=>501,1922=>582,1923=>544,1924=>482,1925=>433,1926=>448,1927=>462, -1928=>474,1929=>471,1930=>469,1931=>537,1932=>499,1933=>514,1934=>471,1935=>572,1936=>880,1937=>440, -1938=>476,1939=>594,1940=>469,1941=>448,1942=>441,1943=>519,1944=>573,1945=>459,1946=>447,1947=>496, -1948=>541,1949=>887,1950=>883,1951=>964,1952=>558,1953=>505,1954=>471,1955=>554,1956=>459,1957=>486, -1958=>36,1959=>36,1960=>43,1961=>45,1962=>43,1963=>45,1964=>45,1965=>45,1966=>45,1967=>45, -1968=>0,2305=>415,2306=>398,2307=>398,2309=>862,2310=>1042,2311=>553,2312=>553,2313=>597,2314=>848, -2315=>967,2316=>828,2317=>654,2319=>654,2321=>1042,2323=>1042,2324=>1042,2325=>743,2326=>798,2327=>694, -2328=>694,2329=>730,2330=>734,2331=>888,2332=>814,2333=>834,2334=>734,2335=>629,2336=>629,2337=>653, -2338=>609,2339=>694,2340=>654,2341=>694,2342=>588,2343=>694,2344=>654,2345=>654,2346=>615,2347=>788, -2348=>621,2349=>694,2350=>694,2351=>694,2352=>575,2353=>575,2354=>787,2355=>848,2356=>848,2357=>621, -2359=>615,2360=>734,2361=>609,2364=>398,2365=>569,2366=>341,2367=>341,2368=>341,2369=>0,2370=>0, -2371=>0,2372=>0,2373=>415,2375=>615,2376=>615,2377=>341,2379=>341,2380=>341,2381=>0,2384=>1047, -2392=>743,2393=>798,2394=>694,2395=>814,2396=>653,2397=>609,2398=>788,2400=>967,2401=>828,2402=>0, -2403=>0,2404=>398,2405=>478,2406=>455,2407=>420,2408=>569,2409=>509,2410=>702,2411=>629,2412=>569, -2413=>702,2414=>609,2415=>609,2416=>626,2433=>0,2434=>300,2435=>312,2437=>594,2438=>776,2439=>469, -2440=>513,2441=>535,2442=>561,2443=>604,2444=>481,2447=>580,2448=>604,2451=>540,2452=>620,2453=>570, -2454=>485,2455=>484,2456=>471,2457=>457,2458=>408,2459=>452,2460=>591,2461=>551,2462=>771,2463=>414, -2464=>404,2465=>522,2466=>415,2467=>450,2468=>551,2469=>477,2470=>478,2471=>449,2472=>448,2474=>535, -2475=>611,2476=>443,2477=>534,2478=>492,2479=>474,2480=>442,2482=>542,2486=>507,2487=>467,2488=>523, -2489=>419,2492=>0,2493=>419,2494=>202,2495=>189,2496=>202,2497=>0,2498=>0,2499=>0,2500=>0, -2503=>294,2504=>289,2507=>774,2508=>825,2509=>0,2510=>356,2519=>219,2524=>523,2525=>420,2527=>469, -2528=>604,2529=>481,2530=>0,2531=>0,2534=>500,2535=>437,2536=>479,2537=>507,2538=>497,2539=>500, -2540=>482,2541=>503,2542=>517,2543=>481,2544=>443,2545=>443,2546=>429,2547=>383,2548=>432,2549=>478, -2550=>539,2551=>158,2552=>365,2553=>280,2554=>357,2561=>0,2562=>0,2563=>385,2565=>728,2566=>884, -2567=>656,2568=>656,2569=>580,2570=>580,2575=>482,2576=>728,2579=>580,2580=>728,2581=>534,2582=>518, -2583=>602,2584=>674,2585=>530,2586=>502,2587=>576,2588=>476,2589=>558,2590=>501,2591=>510,2592=>540, -2593=>508,2594=>512,2595=>558,2596=>468,2597=>518,2598=>488,2599=>518,2600=>522,2602=>518,2603=>490, -2604=>546,2605=>500,2606=>530,2607=>654,2608=>522,2610=>710,2611=>710,2613=>498,2614=>530,2616=>530, -2617=>501,2620=>286,2622=>156,2623=>174,2624=>174,2625=>0,2626=>0,2631=>0,2632=>0,2635=>0, -2636=>0,2637=>0,2641=>0,2649=>534,2650=>618,2651=>492,2652=>484,2654=>506,2662=>616,2663=>480, -2664=>560,2665=>480,2666=>468,2667=>492,2668=>514,2669=>538,2670=>572,2671=>560,2672=>0,2673=>0, -2674=>498,2675=>596,2676=>900,2677=>0,2946=>345,2947=>616,2949=>910,2950=>1072,2951=>848,2952=>591, -2953=>492,2954=>1123,2958=>602,2959=>602,2960=>691,2962=>753,2963=>753,2964=>1597,2965=>677,2969=>697, -2970=>607,2972=>691,2974=>871,2975=>589,2979=>1230,2980=>688,2984=>560,2985=>911,2986=>477,2990=>625, -2991=>672,2992=>452,2993=>553,2994=>651,2995=>804,2996=>645,2997=>740,2999=>865,3000=>870,3001=>1067, -3006=>452,3007=>176,3008=>293,3009=>404,3010=>601,3014=>690,3015=>503,3016=>839,3018=>1188,3019=>982, -3020=>1519,3021=>234,3031=>804,3330=>417,3331=>221,3333=>1055,3334=>1195,3335=>792,3336=>1467,3337=>569, -3338=>1243,3339=>676,3340=>897,3342=>1008,3343=>1004,3344=>1538,3346=>585,3347=>981,3348=>1254,3349=>775, -3350=>798,3351=>691,3352=>1095,3353=>809,3354=>726,3355=>963,3356=>703,3357=>1244,3358=>1103,3359=>462, -3360=>531,3361=>983,3362=>1027,3363=>1102,3364=>779,3365=>731,3366=>485,3367=>737,3368=>747,3370=>779, -3371=>961,3372=>1023,3373=>500,3374=>510,3375=>792,3376=>527,3377=>511,3378=>713,3379=>553,3380=>516, -3381=>715,3382=>785,3383=>920,3384=>977,3385=>977,3389=>375,3390=>403,3391=>283,3392=>323,3393=>275, -3394=>258,3395=>378,3396=>378,3398=>542,3399=>478,3400=>1069,3402=>1127,3403=>1038,3404=>676,3405=>89, -3415=>676,3424=>676,3425=>1006,3430=>559,3431=>659,3432=>674,3433=>933,3434=>671,3435=>699,3436=>703, -3437=>688,3438=>677,3439=>684,3440=>375,3458=>355,3459=>241,3461=>501,3465=>591,3466=>613,3467=>630, -3473=>636,3476=>653,3481=>760,3482=>739,3483=>653,3484=>757,3486=>562,3488=>636,3489=>673,3490=>673, -3492=>984,3493=>984,3495=>636,3496=>653,3497=>653,3498=>653,3499=>1066,3501=>739,3502=>636,3503=>501, -3504=>653,3505=>739,3507=>501,3508=>673,3509=>636,3510=>653,3511=>739,3512=>636,3513=>653,3514=>673, -3515=>613,3517=>630,3520=>636,3521=>739,3522=>673,3523=>673,3524=>739,3525=>630,3526=>739,3530=>0, -3535=>328,3536=>288,3537=>319,3538=>0,3539=>0,3540=>0,3542=>0,3544=>380,3545=>495,3551=>492, -3585=>532,3586=>472,3587=>534,3588=>532,3589=>544,3590=>583,3591=>417,3592=>488,3593=>604,3594=>472, -3595=>534,3596=>716,3597=>717,3598=>568,3599=>568,3600=>457,3601=>637,3602=>731,3603=>790,3604=>531, -3605=>542,3606=>522,3607=>577,3608=>468,3609=>603,3610=>554,3611=>554,3612=>556,3613=>556,3614=>604, -3615=>604,3616=>568,3617=>542,3618=>496,3619=>442,3620=>530,3621=>512,3622=>568,3623=>478,3624=>543, -3625=>614,3626=>525,3627=>578,3628=>659,3629=>514,3630=>514,3631=>450,3632=>402,3633=>0,3634=>378, -3635=>415,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>620,3648=>286, -3649=>521,3650=>447,3651=>426,3652=>424,3653=>333,3654=>453,3655=>0,3656=>0,3657=>0,3658=>0, -3659=>0,3660=>0,3661=>0,3662=>0,3663=>657,3664=>528,3665=>528,3666=>571,3667=>594,3668=>631, -3669=>632,3670=>478,3671=>713,3672=>597,3673=>565,3674=>615,3675=>1381,4256=>453,4257=>448,4258=>546, -4259=>619,4260=>478,4261=>481,4262=>459,4263=>707,4264=>467,4265=>471,4266=>842,4267=>464,4268=>443, -4269=>707,4270=>460,4271=>465,4272=>686,4273=>440,4274=>550,4275=>561,4276=>580,4277=>467,4278=>630, -4279=>466,4280=>517,4281=>456,4282=>502,4283=>464,4284=>534,4285=>440,4286=>443,4287=>522,4288=>460, -4289=>463,4290=>536,4291=>455,4292=>468,4293=>449,4304=>454,4305=>452,4306=>544,4307=>629,4308=>451, -4309=>452,4310=>452,4311=>702,4312=>451,4313=>452,4314=>820,4315=>451,4316=>453,4317=>695,4318=>449, -4319=>448,4320=>694,4321=>501,4322=>544,4323=>517,4324=>560,4325=>450,4326=>627,4327=>452,4328=>491, -4329=>452,4330=>485,4331=>452,4332=>485,4333=>443,4334=>500,4335=>582,4336=>455,4337=>451,4338=>480, -4339=>414,4340=>453,4341=>418,4345=>528,4347=>410,4608=>583,4609=>770,4610=>560,4611=>525,4612=>525, -4613=>583,4614=>758,4616=>598,4617=>787,4618=>817,4619=>583,4620=>758,4621=>612,4622=>875,4623=>817, -4624=>817,4625=>1050,4626=>1050,4627=>817,4628=>1050,4629=>817,4630=>787,4631=>1021,4632=>933,4633=>1137, -4634=>1067,4635=>980,4636=>1065,4637=>962,4638=>962,4639=>1097,4640=>831,4641=>1021,4642=>851,4643=>735, -4644=>875,4645=>968,4646=>817,4647=>881,4648=>583,4649=>642,4650=>583,4651=>758,4652=>700,4653=>583, -4654=>700,4655=>758,4656=>583,4657=>787,4658=>787,4659=>583,4660=>729,4661=>583,4662=>583,4663=>817, -4664=>642,4665=>817,4666=>846,4667=>642,4668=>758,4669=>744,4670=>642,4671=>817,4672=>700,4673=>700, -4674=>700,4675=>758,4676=>700,4677=>700,4678=>729,4680=>846,4682=>1079,4683=>700,4684=>700,4685=>1021, -4688=>700,4689=>700,4690=>700,4691=>758,4692=>700,4693=>758,4694=>729,4696=>846,4698=>1079,4699=>700, -4700=>700,4701=>1021,4704=>525,4705=>758,4706=>758,4707=>525,4708=>700,4709=>773,4710=>525,4711=>787, -4712=>525,4713=>758,4714=>758,4715=>525,4716=>700,4717=>773,4718=>525,4719=>525,4720=>729,4721=>729, -4722=>729,4723=>802,4724=>729,4725=>729,4726=>758,4727=>729,4728=>758,4729=>758,4730=>758,4731=>817, -4732=>758,4733=>817,4734=>758,4735=>758,4736=>612,4737=>817,4738=>817,4739=>612,4740=>787,4741=>583, -4742=>875,4744=>962,4746=>992,4747=>700,4748=>758,4749=>904,4752=>408,4753=>583,4754=>525,4755=>554, -4756=>481,4757=>554,4758=>642,4759=>671,4760=>700,4761=>758,4762=>729,4763=>700,4764=>671,4765=>700, -4766=>758,4767=>700,4768=>583,4769=>735,4770=>822,4771=>583,4772=>793,4773=>583,4774=>583,4775=>694, -4776=>554,4777=>729,4778=>773,4779=>554,4780=>700,4781=>554,4782=>554,4784=>992,4786=>1021,4787=>671, -4788=>787,4789=>904,4792=>729,4793=>904,4794=>948,4795=>729,4796=>875,4797=>729,4798=>729,4800=>1137, -4802=>1167,4803=>758,4804=>875,4805=>1108,4808=>758,4809=>875,4810=>700,4811=>700,4812=>700,4813=>992, -4814=>758,4816=>554,4817=>787,4818=>758,4819=>583,4820=>758,4821=>496,4822=>612,4824=>525,4825=>700, -4826=>700,4827=>525,4828=>685,4829=>729,4830=>510,4831=>729,4832=>962,4833=>962,4834=>962,4835=>962, -4836=>962,4837=>1021,4838=>962,4839=>962,4840=>467,4841=>525,4842=>671,4843=>612,4844=>612,4845=>671, -4846=>671,4848=>612,4849=>875,4850=>817,4851=>642,4852=>729,4853=>729,4854=>758,4855=>817,4856=>700, -4857=>758,4858=>715,4859=>700,4860=>700,4861=>787,4862=>758,4863=>700,4864=>700,4865=>758,4866=>715, -4867=>700,4868=>700,4869=>787,4870=>758,4871=>700,4872=>467,4873=>671,4874=>671,4875=>612,4876=>612, -4877=>583,4878=>525,4880=>846,4882=>904,4883=>554,4884=>700,4885=>817,4888=>525,4889=>729,4890=>729, -4891=>612,4892=>671,4893=>583,4894=>525,4896=>817,4897=>1021,4898=>1021,4899=>817,4900=>992,4901=>758, -4902=>817,4903=>1021,4904=>1079,4905=>1137,4906=>1137,4907=>1050,4908=>1312,4909=>1050,4910=>1050,4911=>1123, -4912=>647,4913=>793,4914=>822,4915=>647,4916=>793,4917=>764,4918=>583,4919=>647,4920=>583,4921=>793, -4922=>822,4923=>583,4924=>793,4925=>764,4926=>583,4927=>793,4928=>540,4929=>758,4930=>583,4931=>467, -4932=>583,4933=>481,4934=>612,4936=>758,4937=>700,4938=>758,4939=>700,4940=>831,4941=>671,4942=>758, -4943=>700,4944=>758,4945=>758,4946=>758,4947=>817,4948=>758,4949=>758,4950=>817,4951=>758,4952=>642, -4953=>980,4954=>758,4961=>233,4962=>583,4963=>408,4964=>408,4965=>525,4966=>525,4967=>233,4968=>700, -4969=>671,4970=>612,4971=>642,4972=>642,4973=>642,4974=>583,4975=>700,4976=>758,4977=>642,4978=>583, -4979=>700,4980=>729,4981=>720,4982=>583,4983=>758,4984=>700,4985=>904,4986=>612,4987=>583,4988=>875, -5024=>711,5025=>678,5026=>604,5027=>667,5028=>796,5029=>301,5030=>516,5031=>544,5032=>457,5033=>716, -5034=>703,5035=>383,5036=>628,5037=>709,5038=>455,5039=>601,5040=>472,5041=>574,5042=>730,5043=>939, -5044=>498,5045=>528,5046=>667,5047=>891,5048=>505,5049=>792,5050=>957,5051=>725,5052=>595,5053=>733, -5054=>698,5055=>638,5056=>720,5057=>732,5058=>624,5059=>638,5060=>565,5061=>903,5062=>655,5063=>681, -5064=>675,5065=>949,5066=>683,5067=>547,5068=>693,5069=>732,5070=>529,5071=>569,5072=>536,5073=>677, -5074=>631,5075=>382,5076=>973,5077=>543,5078=>607,5079=>652,5080=>652,5081=>693,5082=>514,5083=>803, -5084=>658,5085=>597,5086=>627,5087=>659,5088=>679,5089=>706,5090=>563,5091=>618,5092=>767,5093=>776, -5094=>731,5095=>492,5096=>808,5097=>823,5098=>796,5099=>689,5100=>716,5101=>518,5102=>521,5103=>719, -5104=>563,5105=>776,5106=>634,5107=>822,5108=>621,5920=>502,5921=>502,5922=>500,5923=>498,5924=>500, -5925=>502,5926=>502,5927=>502,5928=>500,5929=>503,5930=>502,5931=>502,5932=>500,5933=>500,5934=>500, -5935=>796,5936=>500,5937=>502,5938=>0,5939=>0,5940=>0,5941=>230,5942=>397,6480=>537,6481=>537, -6482=>531,6483=>678,6484=>682,6485=>628,6486=>732,6487=>721,6488=>598,6489=>583,6490=>702,6491=>554, -6492=>683,6493=>554,6494=>710,6495=>695,6496=>523,6497=>678,6498=>589,6499=>272,6500=>506,6501=>515, -6502=>515,6503=>210,6504=>210,6505=>515,6506=>515,6507=>515,6508=>229,6509=>705,6512=>649,6513=>538, -6514=>568,6515=>520,6516=>544,6656=>820,6657=>958,6658=>758,6659=>859,6660=>958,6661=>727,6662=>904, -6663=>940,6664=>850,6665=>905,6666=>838,6667=>961,6668=>1000,6669=>880,6670=>1189,6671=>1246,6672=>1177, -6673=>757,6674=>1246,6675=>1192,6676=>709,6677=>1192,6678=>1075,6679=>0,6680=>0,6681=>534,6682=>690, -6683=>0,6686=>697,6687=>500,7424=>484,7425=>595,7426=>667,7427=>446,7428=>446,7429=>483,7430=>483, -7431=>409,7432=>426,7433=>278,7434=>260,7435=>483,7436=>409,7437=>595,7438=>483,7439=>483,7440=>426, -7441=>500,7442=>489,7443=>668,7444=>722,7445=>378,7448=>372,7449=>446,7450=>446,7451=>409,7452=>483, -7453=>488,7454=>660,7455=>500,7456=>483,7457=>632,7458=>409,7459=>355,7462=>392,7463=>483,7464=>483, -7465=>372,7466=>541,7467=>470,7468=>484,7469=>595,7470=>446,7471=>446,7472=>483,7473=>409,7474=>409, -7475=>483,7476=>483,7477=>223,7478=>260,7479=>483,7480=>409,7481=>595,7482=>483,7483=>483,7484=>483, -7485=>378,7486=>372,7487=>446,7488=>409,7489=>483,7490=>632,7491=>297,7492=>297,7493=>335,7494=>446, -7495=>335,7496=>335,7497=>297,7498=>297,7499=>285,7500=>285,7501=>335,7502=>186,7503=>335,7504=>521, -7505=>335,7506=>335,7507=>297,7510=>335,7511=>186,7512=>335,7513=>326,7514=>521,7515=>335,7517=>353, -7518=>321,7519=>357,7520=>430,7521=>321,7522=>186,7523=>223,7524=>335,7525=>335,7526=>353,7527=>321, -7528=>353,7529=>430,7530=>321,7531=>754,7532=>500,7533=>500,7534=>333,7535=>778,7536=>500,7537=>500, -7538=>333,7539=>333,7540=>389,7541=>278,7542=>444,7543=>500,7544=>483,7546=>774,7547=>217,7548=>278, -7549=>500,7550=>483,7551=>514,7552=>500,7553=>500,7554=>333,7555=>676,7556=>525,7557=>278,7558=>802, -7559=>507,7560=>500,7561=>333,7562=>389,7563=>384,7564=>500,7565=>500,7566=>444,7680=>722,7681=>444, -7682=>667,7683=>500,7684=>667,7685=>500,7686=>667,7687=>500,7688=>667,7689=>444,7690=>722,7691=>500, -7692=>722,7693=>500,7694=>722,7695=>500,7696=>720,7697=>500,7698=>722,7699=>500,7700=>611,7701=>444, -7702=>611,7703=>444,7704=>611,7705=>444,7706=>611,7707=>444,7708=>611,7709=>444,7710=>556,7711=>333, -7712=>722,7713=>500,7714=>722,7715=>500,7716=>722,7717=>500,7718=>722,7719=>500,7720=>722,7721=>500, -7722=>722,7723=>500,7724=>333,7725=>278,7726=>333,7727=>278,7728=>722,7729=>500,7730=>722,7731=>500, -7732=>722,7733=>500,7734=>611,7735=>278,7736=>611,7737=>278,7738=>611,7739=>278,7740=>611,7741=>278, -7742=>889,7743=>778,7744=>889,7745=>778,7746=>889,7747=>778,7748=>722,7749=>500,7750=>722,7751=>500, -7752=>722,7753=>500,7754=>722,7755=>500,7756=>722,7757=>500,7758=>722,7759=>500,7760=>722,7761=>500, -7762=>722,7763=>500,7764=>556,7765=>500,7766=>556,7767=>500,7768=>667,7769=>333,7770=>667,7771=>333, -7772=>667,7773=>333,7774=>667,7775=>333,7776=>556,7777=>389,7778=>556,7779=>389,7780=>556,7781=>389, -7782=>556,7783=>389,7784=>556,7785=>389,7786=>611,7787=>278,7788=>611,7789=>278,7790=>611,7791=>278, -7792=>611,7793=>278,7794=>722,7795=>500,7796=>722,7797=>500,7798=>722,7799=>500,7800=>722,7801=>500, -7802=>722,7803=>500,7804=>722,7805=>500,7806=>722,7807=>500,7808=>944,7809=>722,7810=>944,7811=>722, -7812=>944,7813=>722,7814=>944,7815=>722,7816=>944,7817=>722,7818=>722,7819=>500,7820=>722,7821=>500, -7822=>722,7823=>500,7824=>611,7825=>444,7826=>611,7827=>444,7828=>611,7829=>444,7830=>500,7831=>278, -7832=>722,7833=>500,7834=>444,7835=>333,7840=>722,7841=>444,7842=>807,7843=>529,7844=>722,7845=>444, -7846=>722,7847=>444,7848=>722,7849=>454,7850=>722,7851=>444,7852=>722,7853=>444,7854=>722,7855=>444, -7856=>722,7857=>444,7858=>722,7859=>454,7860=>722,7861=>444,7862=>722,7863=>444,7864=>611,7865=>444, -7866=>611,7867=>444,7868=>611,7869=>444,7870=>611,7871=>444,7872=>611,7873=>444,7874=>613,7875=>444, -7876=>611,7877=>444,7878=>611,7879=>444,7880=>333,7881=>278,7882=>333,7883=>278,7884=>722,7885=>500, -7886=>722,7887=>500,7888=>722,7889=>500,7890=>722,7891=>500,7892=>722,7893=>500,7894=>722,7895=>500, -7896=>722,7897=>500,7898=>722,7899=>516,7900=>722,7901=>516,7902=>720,7903=>516,7904=>722,7905=>516, -7906=>722,7907=>516,7908=>722,7909=>500,7910=>717,7911=>500,7912=>800,7913=>518,7914=>800,7915=>518, -7916=>800,7917=>518,7918=>800,7919=>518,7920=>800,7921=>518,7922=>722,7923=>500,7924=>722,7925=>500, -7926=>722,7927=>501,7928=>722,7929=>500,7936=>583,7937=>583,7938=>583,7939=>583,7940=>583,7941=>583, -7942=>583,7943=>583,7944=>722,7945=>722,7946=>813,7947=>817,7948=>763,7949=>765,7950=>720,7951=>722, -7952=>426,7953=>426,7954=>426,7955=>426,7956=>426,7957=>426,7960=>770,7961=>770,7962=>902,7963=>919, -7964=>940,7965=>936,7968=>536,7969=>536,7970=>536,7971=>536,7972=>536,7973=>536,7974=>536,7975=>536, -7976=>847,7977=>859,7978=>986,7979=>1010,7980=>1026,7981=>1029,7982=>918,7983=>921,7984=>286,7985=>286, -7986=>302,7987=>320,7988=>300,7989=>306,7990=>312,7991=>303,7992=>475,7993=>507,7994=>617,7995=>654, -7996=>655,7997=>660,7998=>551,7999=>566,8000=>500,8001=>500,8002=>500,8003=>500,8004=>500,8005=>500, -8008=>816,8009=>825,8010=>969,8011=>995,8012=>938,8013=>955,8016=>514,8017=>514,8018=>514,8019=>514, -8020=>514,8021=>514,8022=>514,8023=>514,8025=>818,8027=>988,8029=>989,8031=>893,8032=>693,8033=>693, -8034=>693,8035=>693,8036=>693,8037=>693,8038=>693,8039=>693,8040=>836,8041=>843,8042=>1006,8043=>1024, -8044=>974,8045=>986,8046=>905,8047=>896,8048=>583,8049=>583,8050=>426,8051=>426,8052=>536,8053=>536, -8054=>286,8055=>286,8056=>500,8057=>500,8058=>514,8059=>514,8060=>693,8061=>693,8064=>583,8065=>583, -8066=>583,8067=>583,8068=>583,8069=>583,8070=>583,8071=>583,8072=>888,8073=>889,8074=>984,8075=>991, -8076=>943,8077=>948,8078=>884,8079=>886,8080=>536,8081=>536,8082=>536,8083=>536,8084=>536,8085=>536, -8086=>536,8087=>536,8088=>1017,8089=>1026,8090=>1153,8091=>1179,8092=>1195,8093=>1199,8094=>1088,8095=>1088, -8096=>693,8097=>693,8098=>693,8099=>693,8100=>693,8101=>693,8102=>693,8103=>693,8104=>1034,8105=>1040, -8106=>1210,8107=>1229,8108=>1176,8109=>1186,8110=>1098,8111=>1090,8112=>583,8113=>583,8114=>583,8115=>583, -8116=>583,8118=>583,8119=>583,8120=>722,8121=>722,8122=>722,8123=>722,8124=>889,8125=>250,8126=>332, -8127=>500,8128=>500,8129=>534,8130=>536,8131=>536,8132=>536,8134=>536,8135=>536,8136=>761,8137=>800, -8138=>829,8139=>893,8140=>883,8141=>500,8142=>500,8143=>500,8144=>286,8145=>286,8146=>286,8147=>286, -8150=>286,8151=>286,8152=>333,8153=>333,8154=>447,8155=>537,8157=>500,8158=>500,8159=>500,8160=>514, -8161=>514,8162=>514,8163=>514,8164=>528,8165=>528,8166=>514,8167=>514,8168=>696,8169=>696,8170=>816, -8171=>828,8172=>721,8173=>333,8174=>333,8175=>500,8178=>693,8179=>693,8180=>693,8182=>693,8183=>693, -8184=>832,8185=>899,8186=>847,8187=>852,8188=>928,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500, -8195=>1000,8196=>333,8197=>250,8198=>167,8199=>500,8200=>250,8201=>200,8202=>100,8203=>0,8204=>0, -8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>500,8213=>1000,8214=>293,8215=>478,8219=>250, -8223=>444,8227=>350,8228=>620,8229=>620,8231=>250,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0, -8237=>0,8238=>0,8239=>250,8241=>1363,8242=>247,8243=>411,8244=>611,8245=>220,8246=>440,8247=>660, -8248=>469,8251=>629,8252=>666,8253=>444,8254=>500,8255=>953,8256=>953,8257=>314,8258=>931,8259=>333, -8260=>167,8261=>383,8262=>383,8263=>888,8264=>777,8265=>777,8266=>500,8267=>453,8268=>453,8269=>450, -8270=>500,8271=>278,8272=>882,8273=>500,8274=>497,8275=>500,8276=>953,8277=>512,8278=>410,8279=>855, -8280=>620,8281=>620,8282=>179,8283=>621,8284=>564,8285=>179,8286=>179,8287=>111,8288=>0,8289=>0, -8290=>0,8291=>0,8292=>0,8304=>320,8305=>300,8308=>320,8309=>320,8310=>320,8311=>320,8312=>320, -8313=>320,8314=>300,8315=>300,8316=>300,8317=>216,8318=>216,8319=>300,8320=>320,8321=>320,8322=>320, -8323=>320,8324=>320,8325=>320,8326=>320,8327=>320,8328=>320,8329=>320,8330=>300,8331=>300,8332=>300, -8333=>216,8334=>216,8336=>320,8337=>320,8338=>320,8339=>320,8340=>320,8352=>698,8353=>667,8354=>667, -8355=>556,8356=>500,8357=>778,8358=>722,8359=>940,8360=>1026,8361=>813,8362=>869,8363=>512,8365=>722, -8366=>611,8367=>1340,8368=>489,8369=>601,8370=>619,8371=>722,8372=>556,8373=>611,8400=>0,8401=>0, -8402=>0,8403=>0,8404=>0,8405=>0,8406=>0,8407=>0,8408=>0,8409=>0,8410=>0,8411=>0, -8412=>0,8413=>0,8414=>0,8415=>0,8416=>0,8417=>0,8418=>0,8419=>0,8420=>0,8421=>0, -8422=>0,8423=>0,8424=>0,8425=>0,8426=>0,8427=>0,8428=>0,8429=>0,8430=>0,8431=>0, -8432=>0,8448=>751,8449=>723,8450=>674,8451=>954,8452=>556,8453=>781,8454=>806,8455=>518,8456=>667, -8457=>822,8458=>490,8459=>824,8460=>663,8461=>818,8462=>500,8463=>500,8464=>578,8465=>613,8466=>715, -8467=>417,8468=>778,8469=>751,8470=>880,8471=>760,8472=>832,8473=>589,8474=>729,8475=>892,8476=>711, -8477=>755,8478=>667,8479=>667,8480=>879,8481=>1156,8483=>722,8484=>659,8485=>389,8486=>743,8487=>757, -8488=>663,8489=>286,8490=>722,8491=>722,8492=>846,8493=>613,8494=>533,8495=>363,8496=>587,8497=>690, -8498=>556,8499=>1021,8500=>387,8501=>537,8502=>537,8503=>350,8504=>537,8505=>417,8506=>906,8507=>1155, -8513=>663,8514=>485,8515=>485,8516=>637,8522=>516,8523=>778,8525=>899,8526=>500,8531=>750,8532=>750, -8533=>750,8534=>750,8535=>750,8536=>750,8537=>750,8538=>750,8539=>750,8540=>750,8541=>750,8542=>750, -8543=>750,8544=>333,8545=>630,8546=>927,8547=>1019,8548=>722,8549=>1019,8550=>1316,8551=>1629,8552=>1019, -8553=>722,8554=>1019,8555=>1316,8556=>611,8557=>667,8558=>722,8559=>889,8560=>278,8561=>556,8562=>834, -8563=>778,8564=>500,8565=>778,8566=>1056,8567=>1334,8568=>778,8569=>500,8570=>778,8571=>1056,8572=>278, -8573=>444,8574=>500,8575=>778,8592=>964,8593=>472,8594=>964,8595=>500,8596=>964,8597=>499,8598=>964, -8599=>964,8600=>964,8601=>964,8602=>964,8603=>964,8604=>1009,8605=>1009,8606=>964,8607=>500,8608=>964, -8609=>499,8610=>1093,8611=>1093,8612=>1093,8613=>500,8614=>1093,8615=>500,8616=>500,8617=>964,8618=>964, -8619=>964,8620=>964,8621=>1151,8622=>964,8624=>482,8625=>482,8626=>482,8627=>482,8628=>658,8629=>658, -8630=>1069,8631=>1069,8634=>939,8635=>939,8636=>964,8637=>964,8638=>499,8639=>499,8640=>964,8641=>964, -8642=>499,8643=>499,8644=>964,8645=>840,8646=>964,8647=>964,8648=>840,8649=>964,8650=>840,8651=>964, -8652=>964,8653=>964,8654=>964,8655=>964,8656=>964,8657=>550,8658=>964,8659=>550,8660=>964,8661=>550, -8662=>1047,8663=>1047,8664=>1047,8665=>1047,8666=>964,8667=>964,8668=>1092,8669=>1092,8672=>964,8674=>964, -8704=>587,8705=>716,8706=>494,8707=>587,8708=>587,8709=>746,8710=>612,8711=>612,8712=>536,8713=>536, -8714=>439,8715=>536,8716=>536,8717=>439,8718=>506,8719=>823,8720=>823,8721=>713,8722=>564,8723=>564, -8724=>564,8725=>636,8726=>636,8727=>471,8728=>497,8729=>497,8730=>549,8731=>549,8732=>549,8733=>636, -8734=>853,8735=>509,8736=>575,8737=>559,8738=>509,8739=>200,8740=>250,8741=>320,8742=>320,8743=>564, -8744=>564,8745=>654,8746=>654,8747=>416,8748=>750,8749=>1083,8750=>722,8751=>750,8752=>1083,8753=>697, -8754=>722,8755=>722,8756=>565,8757=>568,8758=>250,8759=>629,8760=>564,8761=>758,8762=>564,8763=>636, -8764=>636,8765=>636,8766=>503,8767=>614,8768=>636,8769=>636,8770=>636,8771=>636,8772=>636,8773=>636, -8774=>636,8775=>636,8776=>636,8777=>636,8778=>636,8779=>636,8780=>636,8781=>636,8782=>636,8783=>636, -8784=>564,8785=>564,8786=>564,8787=>564,8788=>735,8789=>755,8790=>564,8791=>564,8792=>564,8793=>564, -8794=>564,8795=>564,8796=>600,8797=>564,8798=>564,8799=>564,8800=>564,8801=>636,8802=>636,8803=>636, -8804=>636,8805=>636,8806=>636,8807=>636,8808=>636,8809=>636,8810=>900,8811=>899,8812=>410,8813=>636, -8814=>636,8815=>636,8816=>636,8817=>636,8818=>636,8819=>636,8820=>636,8821=>636,8822=>636,8823=>636, -8824=>636,8825=>636,8826=>636,8827=>636,8828=>636,8829=>636,8830=>636,8831=>636,8832=>636,8833=>636, -8834=>636,8835=>636,8836=>636,8837=>636,8838=>636,8839=>636,8840=>636,8841=>636,8842=>636,8843=>636, -8844=>654,8845=>654,8846=>654,8847=>636,8848=>636,8849=>636,8850=>636,8851=>636,8852=>636,8853=>636, -8854=>636,8855=>636,8856=>636,8857=>636,8858=>636,8859=>636,8860=>636,8861=>636,8862=>636,8863=>636, -8864=>636,8865=>636,8866=>600,8867=>600,8868=>712,8869=>712,8870=>466,8871=>466,8872=>595,8873=>588, -8874=>710,8875=>706,8876=>595,8877=>596,8878=>588,8879=>706,8880=>636,8881=>636,8882=>636,8883=>636, -8884=>636,8885=>636,8886=>1296,8887=>1296,8888=>966,8889=>564,8890=>626,8891=>564,8892=>564,8893=>566, -8894=>570,8895=>582,8896=>744,8897=>744,8898=>764,8899=>764,8900=>512,8901=>250,8902=>471,8903=>629, -8904=>636,8905=>636,8906=>636,8907=>816,8908=>816,8909=>636,8910=>636,8911=>636,8912=>636,8913=>636, -8914=>654,8915=>654,8916=>654,8917=>636,8918=>564,8919=>564,8920=>1215,8921=>1215,8922=>636,8923=>636, -8924=>636,8925=>636,8926=>636,8927=>636,8928=>636,8929=>636,8930=>636,8931=>636,8932=>636,8933=>636, -8934=>636,8935=>636,8936=>636,8937=>636,8938=>636,8939=>636,8940=>636,8941=>636,8942=>250,8943=>1000, -8944=>1000,8945=>1000,8946=>601,8947=>536,8948=>464,8949=>536,8950=>536,8951=>464,8952=>536,8953=>536, -8954=>601,8955=>536,8956=>464,8957=>536,8958=>464,8959=>600,8960=>780,8961=>442,8962=>794,8968=>474, -8969=>474,8970=>474,8971=>474,8976=>564,8977=>503,8978=>791,8979=>791,8980=>593,8981=>560,8982=>563, -8983=>563,8984=>800,8985=>564,8986=>805,8988=>474,8989=>474,8990=>474,8991=>474,8992=>686,8993=>686, -8994=>658,8995=>658,8996=>800,9000=>800,9001=>329,9002=>329,9031=>777,9032=>777,9040=>777,9047=>777, -9054=>777,9088=>800,9089=>800,9090=>800,9091=>800,9094=>800,9095=>800,9096=>800,9097=>800,9098=>800, -9100=>800,9103=>788,9104=>788,9105=>788,9106=>788,9108=>800,9109=>800,9110=>800,9111=>800,9112=>800, -9113=>800,9114=>800,9115=>384,9116=>384,9117=>384,9118=>384,9119=>384,9120=>384,9121=>388,9122=>388, -9123=>388,9124=>388,9125=>388,9126=>388,9127=>494,9128=>494,9129=>494,9130=>494,9131=>494,9132=>494, -9133=>494,9134=>686,9138=>1287,9139=>1287,9140=>860,9141=>861,9166=>800,9167=>800,9180=>896,9181=>896, -9182=>903,9183=>904,9184=>910,9185=>910,9186=>761,9187=>910,9189=>942,9190=>817,9251=>500,9312=>788, -9313=>788,9314=>788,9315=>788,9316=>788,9317=>788,9318=>788,9319=>788,9320=>788,9321=>788,9472=>889, -9473=>889,9474=>889,9475=>889,9484=>889,9485=>889,9486=>889,9487=>889,9488=>889,9489=>889,9490=>889, -9491=>889,9492=>889,9493=>889,9494=>889,9495=>889,9496=>889,9497=>889,9498=>889,9499=>889,9500=>889, -9501=>889,9502=>889,9503=>889,9504=>889,9505=>889,9506=>889,9507=>889,9508=>889,9509=>889,9510=>889, -9511=>889,9512=>889,9513=>889,9514=>889,9515=>889,9516=>889,9517=>889,9518=>889,9519=>889,9520=>889, -9521=>889,9522=>889,9523=>889,9524=>889,9525=>889,9526=>889,9527=>889,9528=>889,9529=>889,9530=>889, -9531=>889,9532=>889,9533=>889,9534=>889,9535=>889,9536=>889,9537=>889,9538=>889,9539=>889,9540=>889, -9541=>889,9542=>889,9543=>889,9544=>889,9545=>889,9546=>889,9547=>889,9552=>889,9553=>889,9554=>889, -9555=>889,9556=>889,9557=>889,9558=>889,9559=>889,9560=>889,9561=>889,9562=>889,9563=>889,9564=>889, -9565=>889,9566=>889,9567=>889,9568=>889,9569=>889,9570=>889,9571=>889,9572=>889,9573=>889,9574=>889, -9575=>889,9576=>889,9577=>889,9578=>889,9579=>889,9580=>889,9581=>889,9582=>889,9583=>889,9584=>889, -9585=>889,9586=>889,9587=>889,9588=>889,9589=>889,9590=>889,9591=>889,9592=>889,9593=>889,9594=>889, -9595=>889,9596=>600,9597=>889,9598=>600,9599=>889,9600=>761,9601=>761,9602=>761,9603=>761,9604=>761, -9605=>761,9606=>761,9607=>761,9608=>761,9609=>761,9610=>761,9611=>761,9612=>761,9613=>761,9614=>761, -9615=>761,9616=>761,9617=>1000,9619=>1000,9620=>761,9621=>761,9622=>761,9623=>761,9624=>761,9625=>761, -9626=>761,9627=>761,9628=>761,9629=>761,9630=>761,9631=>761,9632=>761,9633=>761,9634=>761,9635=>761, -9636=>761,9637=>761,9638=>761,9639=>761,9640=>761,9641=>761,9642=>532,9643=>532,9644=>761,9645=>761, -9646=>761,9647=>761,9648=>761,9649=>761,9650=>892,9651=>892,9652=>446,9653=>446,9654=>892,9655=>892, -9656=>446,9657=>446,9658=>892,9659=>892,9660=>892,9661=>892,9662=>446,9663=>446,9664=>892,9665=>892, -9666=>446,9667=>446,9668=>892,9669=>892,9670=>788,9671=>788,9672=>788,9673=>791,9674=>494,9675=>791, -9676=>791,9677=>785,9678=>791,9679=>791,9680=>791,9681=>791,9682=>791,9683=>791,9684=>791,9685=>791, -9686=>791,9687=>791,9688=>761,9689=>761,9690=>761,9691=>761,9692=>791,9693=>791,9694=>791,9695=>791, -9696=>791,9697=>791,9698=>761,9699=>761,9700=>761,9701=>761,9702=>791,9703=>761,9704=>761,9705=>761, -9706=>761,9707=>761,9708=>892,9709=>892,9710=>892,9711=>851,9712=>761,9713=>761,9714=>761,9715=>761, -9716=>791,9717=>791,9718=>791,9719=>791,9720=>761,9721=>761,9722=>761,9723=>761,9724=>761,9725=>570, -9726=>570,9727=>761,9728=>800,9729=>800,9730=>748,9731=>800,9732=>800,9733=>811,9734=>816,9735=>468, -9736=>677,9737=>724,9738=>944,9739=>944,9740=>686,9741=>944,9742=>715,9743=>715,9744=>757,9745=>755, -9746=>755,9747=>756,9748=>800,9749=>837,9750=>719,9751=>719,9752=>782,9753=>822,9754=>954,9755=>954, -9756=>933,9757=>489,9758=>933,9759=>489,9760=>517,9761=>660,9762=>724,9763=>732,9764=>886,9765=>577, -9766=>489,9767=>563,9768=>490,9769=>770,9770=>725,9771=>860,9772=>668,9773=>753,9774=>724,9775=>730, -9776=>600,9777=>600,9778=>600,9779=>600,9780=>600,9781=>600,9782=>600,9783=>600,9784=>730,9785=>724, -9786=>724,9787=>724,9788=>799,9789=>659,9790=>659,9791=>495,9792=>495,9793=>495,9794=>686,9795=>661, -9796=>544,9797=>608,9798=>605,9799=>545,9800=>804,9801=>583,9802=>796,9803=>1006,9804=>825,9805=>1189, -9806=>1144,9807=>1189,9808=>683,9809=>808,9810=>1146,9811=>797,9812=>758,9813=>757,9814=>758,9815=>758, -9816=>758,9817=>758,9818=>758,9819=>758,9820=>758,9821=>758,9822=>758,9823=>758,9824=>770,9825=>770, -9826=>770,9827=>770,9828=>770,9829=>770,9830=>770,9831=>770,9832=>895,9833=>333,9834=>555,9835=>722, -9836=>722,9837=>415,9838=>377,9839=>402,9840=>642,9841=>655,9842=>869,9843=>905,9844=>905,9845=>905, -9846=>905,9847=>905,9848=>905,9849=>905,9850=>905,9851=>1016,9852=>1064,9853=>1064,9854=>954,9855=>606, -9856=>522,9857=>522,9858=>522,9859=>522,9860=>522,9861=>522,9862=>845,9863=>844,9864=>844,9865=>844, -9866=>748,9867=>748,9868=>748,9869=>748,9870=>748,9871=>748,9872=>726,9873=>726,9874=>963,9875=>770, -9876=>1038,9877=>388,9878=>997,9879=>787,9880=>508,9881=>809,9882=>1014,9883=>859,9884=>818,9885=>972, -9888=>1000,9889=>546,9890=>784,9891=>786,9892=>738,9893=>542,9894=>601,9895=>700,9896=>511,9897=>861, -9898=>611,9899=>611,9900=>544,9901=>782,9902=>1025,9903=>1141,9904=>1000,9905=>513,9906=>510,9907=>642, -9908=>722,9909=>719,9910=>777,9911=>495,9912=>602,9913=>836,9914=>666,9915=>666,9916=>691,9920=>689, -9921=>689,9922=>689,9923=>689,9985=>974,9986=>961,9987=>974,9988=>980,9990=>789,9991=>790,9992=>791, -9993=>690,9996=>549,9997=>855,9998=>911,9999=>933,10000=>911,10001=>945,10002=>974,10003=>755,10004=>846, -10005=>762,10006=>761,10007=>571,10008=>677,10009=>763,10010=>760,10011=>759,10012=>754,10013=>494,10014=>552, -10015=>537,10016=>577,10017=>692,10018=>786,10019=>788,10020=>788,10021=>790,10022=>793,10023=>794,10025=>823, -10026=>789,10027=>841,10028=>823,10029=>833,10030=>816,10031=>831,10032=>923,10033=>744,10034=>723,10035=>749, -10036=>790,10037=>792,10038=>695,10039=>776,10040=>768,10041=>792,10042=>759,10043=>707,10044=>708,10045=>682, -10046=>701,10047=>826,10048=>815,10049=>789,10050=>789,10051=>707,10052=>687,10053=>696,10054=>689,10055=>786, -10056=>787,10057=>713,10058=>791,10059=>785,10061=>873,10063=>762,10064=>762,10065=>759,10066=>759,10070=>784, -10072=>138,10073=>277,10074=>415,10075=>392,10076=>392,10077=>668,10078=>668,10081=>732,10082=>544,10083=>544, -10084=>910,10085=>667,10086=>760,10087=>760,10088=>390,10089=>390,10090=>317,10091=>317,10092=>276,10093=>276, -10094=>509,10095=>509,10096=>410,10097=>410,10098=>234,10099=>234,10100=>334,10101=>334,10102=>788,10103=>788, -10104=>788,10105=>788,10106=>788,10107=>788,10108=>788,10109=>788,10110=>788,10111=>788,10112=>788,10113=>788, -10114=>788,10115=>788,10116=>788,10117=>788,10118=>788,10119=>788,10120=>788,10121=>788,10122=>788,10123=>788, -10124=>788,10125=>788,10126=>788,10127=>788,10128=>788,10129=>788,10130=>788,10131=>788,10132=>894,10136=>748, -10137=>924,10138=>748,10139=>918,10140=>927,10141=>928,10142=>928,10143=>834,10144=>873,10145=>828,10146=>924, -10147=>924,10148=>917,10149=>930,10150=>931,10151=>463,10152=>883,10153=>836,10154=>836,10155=>867,10156=>867, -10157=>696,10158=>696,10159=>874,10161=>874,10162=>760,10163=>946,10164=>771,10165=>865,10166=>771,10167=>888, -10168=>967,10169=>888,10170=>831,10171=>873,10172=>927,10173=>970,10174=>918,10214=>545,10215=>545,10216=>329, -10217=>329,10218=>496,10219=>496,10229=>1000,10230=>1000,10231=>1000,10232=>1000,10233=>1000,10234=>1000,10235=>1000, -10236=>1000,10752=>860,10753=>860,10754=>860,10755=>766,10756=>766,10757=>756,10758=>756,10761=>745,10781=>702, -10815=>722,11008=>1000,11009=>1000,11010=>1000,11011=>1000,11012=>1222,11013=>1000,11014=>1000,11015=>1000,11016=>1000, -11017=>1000,11018=>1000,11019=>1000,11020=>1244,11021=>1000,11026=>770,11027=>770,11028=>770,11029=>770,11030=>770, -11031=>770,11032=>770,11033=>770,11034=>770,11035=>1000,11036=>1000,11037=>283,11038=>283,11039=>846,11040=>846, -11041=>799,11042=>799,11043=>807,11044=>1000,11045=>461,11046=>461,11047=>461,11048=>461,11049=>360,11050=>360, -11051=>283,11052=>854,11053=>854,11054=>628,11055=>628,11088=>589,11089=>443,11090=>443,11091=>802,11092=>803, -11392=>677,11393=>463,11394=>532,11395=>381,11396=>615,11397=>438,11398=>969,11399=>660,11400=>647,11401=>440, -11402=>593,11403=>402,11404=>573,11405=>407,11406=>698,11407=>512,11408=>726,11409=>493,11410=>267,11411=>201, -11412=>610,11413=>433,11414=>654,11415=>468,11416=>735,11417=>536,11418=>698,11419=>511,11420=>555,11421=>378, -11422=>722,11423=>489,11424=>724,11425=>528,11426=>517,11427=>388,11428=>647,11429=>438,11430=>615,11431=>436, -11432=>651,11433=>462,11434=>762,11435=>538,11436=>654,11437=>461,11438=>635,11439=>461,11440=>964,11441=>677, -11456=>689,11457=>464,11493=>499,11494=>496,11495=>986,11496=>466,11497=>444,11498=>934,11517=>256,11518=>617, -11519=>287,11799=>333,42560=>611,42561=>444,42562=>611,42563=>444,42564=>556,42565=>389,42566=>368,42567=>286, -42572=>1145,42573=>775,42576=>1016,42577=>736,42578=>915,42579=>684,42580=>966,42581=>664,42582=>1042,42583=>648, -42584=>722,42585=>491,42588=>1042,42589=>648,42590=>780,42591=>550,42594=>911,42595=>633,42596=>957,42597=>635, -42598=>1139,42599=>777,42607=>0,42608=>0,42609=>0,42610=>0,42611=>519,42620=>0,42622=>510,64256=>589, -64257=>534,64258=>530,64259=>805,64260=>799,64262=>677,64285=>350,64286=>0,64287=>537,64288=>537,64297=>564, -64298=>537,64299=>537,64300=>537,64301=>537,64302=>537,64303=>537,64304=>537,64305=>537,64306=>350,64307=>537, -64308=>537,64309=>350,64310=>350,64312=>537,64313=>350,64314=>537,64315=>537,64316=>537,64318=>537,64320=>350, -64321=>537,64323=>537,64324=>537,64326=>537,64327=>537,64328=>537,64329=>537,64330=>537,64331=>350,64332=>537, -64333=>537,64334=>537,64335=>537,64342=>926,64343=>926,64344=>308,64345=>308,64378=>750,64379=>750,64380=>580, -64381=>580,64394=>338,64395=>338,64402=>874,64403=>874,64404=>329,64405=>329,64508=>776,64509=>700,64510=>304, -64511=>304,65010=>640,65020=>837,65136=>300,65140=>300,65142=>300,65144=>300,65146=>300,65148=>300,65152=>724, -65153=>321,65154=>275,65155=>249,65156=>275,65157=>399,65158=>399,65159=>249,65160=>275,65161=>776,65162=>776, -65163=>301,65164=>264,65165=>249,65166=>275,65167=>950,65168=>950,65169=>293,65170=>293,65171=>424,65172=>622, -65173=>925,65174=>925,65175=>308,65176=>308,65177=>924,65178=>924,65179=>298,65180=>298,65181=>738,65182=>738, -65183=>574,65184=>574,65185=>748,65186=>750,65187=>600,65188=>600,65189=>701,65190=>775,65191=>596,65192=>596, -65193=>397,65194=>397,65195=>399,65196=>399,65197=>328,65198=>328,65199=>331,65200=>331,65201=>951,65202=>951, -65203=>600,65204=>600,65205=>949,65206=>949,65207=>649,65208=>649,65209=>949,65210=>949,65211=>823,65212=>823, -65213=>949,65214=>949,65215=>805,65216=>805,65217=>557,65218=>557,65219=>460,65220=>460,65221=>550,65222=>550, -65223=>455,65224=>550,65225=>625,65226=>575,65227=>674,65228=>550,65229=>602,65230=>577,65231=>578,65232=>577, -65233=>801,65234=>801,65235=>300,65236=>300,65237=>696,65238=>696,65239=>650,65240=>650,65241=>757,65242=>757, -65243=>318,65244=>318,65245=>655,65246=>655,65247=>206,65248=>206,65249=>549,65250=>549,65251=>403,65252=>403, -65253=>651,65254=>651,65255=>323,65256=>323,65257=>424,65258=>622,65259=>525,65260=>476,65261=>399,65262=>399, -65263=>776,65264=>776,65265=>776,65266=>776,65267=>296,65268=>264,65269=>676,65270=>724,65271=>676,65272=>724, -65273=>676,65274=>724,65275=>676,65276=>724,65279=>0,65533=>788); -$enc=''; -$diff=''; -$file='freeserif.z'; -$ctg='freeserif.ctg.z'; -$originalsize=1483772; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.z deleted file mode 100644 index 67f609700b..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserif.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.ctg.z deleted file mode 100644 index 77bfed16b5..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.php deleted file mode 100644 index 37006e9d21..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.php +++ /dev/null @@ -1,282 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSerifBold'; -$desc=array('Ascent'=>900,'Descent'=>-300,'CapHeight'=>16,'Flags'=>32,'FontBBox'=>'[-796 -306 1860 932]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>250,33=>333,34=>555,35=>500,36=>500,37=>1000,38=>833,39=>278,40=>333,41=>333, -42=>507,43=>676,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500, -52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>676,61=>676, -62=>676,63=>500,64=>930,65=>722,66=>667,67=>722,68=>724,69=>667,70=>611,71=>778, -72=>774,73=>386,74=>500,75=>764,76=>664,77=>943,78=>722,79=>778,80=>611,81=>778, -82=>712,83=>556,84=>667,85=>722,86=>722,87=>1000,88=>722,89=>722,90=>667,91=>333, -92=>278,93=>333,94=>581,95=>500,96=>333,97=>500,98=>556,99=>444,100=>556,101=>444, -102=>333,103=>500,104=>556,105=>278,106=>333,107=>556,108=>278,109=>833,110=>556,111=>500, -112=>556,113=>556,114=>444,115=>389,116=>333,117=>556,118=>500,119=>722,120=>500,121=>500, -122=>444,123=>394,124=>220,125=>394,126=>520,8364=>761,8218=>250,402=>333,8222=>500,8230=>1000, -8224=>500,8225=>500,710=>333,8240=>1000,352=>556,8249=>333,338=>1000,381=>667,8216=>250,8217=>250, -8220=>500,8221=>500,8226=>524,8211=>500,8212=>1000,732=>333,8482=>1000,353=>389,8250=>333,339=>722, -382=>444,376=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500, -168=>333,169=>747,170=>300,171=>500,172=>680,173=>333,174=>747,175=>333,176=>400,177=>676, -178=>300,179=>300,180=>333,181=>556,182=>540,183=>250,184=>333,185=>270,186=>330,187=>500, -188=>750,189=>750,190=>750,191=>500,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722, -198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>676,216=>778,217=>722, -218=>722,219=>722,220=>722,221=>722,222=>632,223=>556,224=>500,225=>500,226=>500,227=>500, -228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278, -238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>676, -248=>500,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500,256=>722,257=>500, -258=>722,259=>500,260=>722,261=>500,262=>722,263=>444,264=>722,265=>444,266=>722,267=>444, -268=>722,269=>444,270=>722,271=>616,272=>722,273=>556,274=>667,275=>444,276=>667,277=>444, -278=>667,279=>444,280=>667,281=>444,282=>667,283=>444,284=>778,285=>500,286=>778,287=>500, -288=>778,289=>500,290=>778,291=>500,292=>778,293=>556,294=>778,295=>556,296=>389,297=>278, -298=>389,299=>278,300=>389,301=>278,302=>389,303=>278,304=>389,305=>278,306=>882,307=>486, -308=>500,309=>338,310=>778,311=>556,312=>534,313=>667,314=>278,315=>667,316=>278,317=>667, -318=>398,319=>667,320=>528,321=>667,322=>278,323=>722,324=>556,325=>722,326=>556,327=>722, -328=>556,329=>556,330=>722,331=>556,332=>778,333=>500,334=>778,335=>500,336=>778,337=>500, -340=>722,341=>444,342=>722,343=>444,344=>722,345=>444,346=>556,347=>389,348=>556,349=>389, -350=>556,351=>389,354=>667,355=>333,356=>667,357=>449,358=>667,359=>333,360=>722,361=>556, -362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556, -372=>1000,373=>722,374=>722,375=>500,377=>667,378=>444,379=>667,380=>444,383=>333,384=>556, -385=>805,386=>648,387=>556,388=>667,389=>556,390=>722,391=>915,392=>605,393=>722,394=>862, -395=>667,396=>556,397=>550,398=>667,399=>778,400=>631,401=>611,403=>903,404=>776,405=>807, -406=>327,407=>389,408=>887,409=>556,410=>278,411=>495,412=>1000,413=>864,414=>556,415=>778, -416=>778,417=>550,418=>1192,419=>795,420=>749,421=>556,422=>748,423=>556,424=>389,425=>650, -426=>465,427=>333,428=>667,429=>333,430=>667,431=>839,432=>629,433=>811,434=>685,435=>853, -436=>705,437=>667,438=>444,439=>593,440=>654,441=>508,442=>500,443=>500,444=>654,445=>520, -446=>444,447=>611,448=>220,449=>418,450=>570,451=>333,452=>1391,453=>1168,454=>1000,455=>1164, -456=>997,457=>611,458=>1222,459=>1055,460=>889,461=>722,462=>500,463=>386,464=>278,465=>778, -466=>500,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722,474=>556,475=>722, -476=>556,477=>444,478=>722,479=>500,480=>722,481=>500,482=>1000,483=>722,484=>778,485=>500, -486=>778,487=>500,488=>764,489=>556,490=>778,491=>500,492=>778,493=>500,494=>593,495=>502, -496=>338,497=>1391,498=>1168,499=>1000,500=>778,501=>500,502=>995,503=>603,504=>722,505=>556, -506=>722,507=>500,508=>1000,509=>722,510=>778,511=>500,512=>722,513=>500,514=>722,515=>500, -516=>667,517=>444,518=>667,519=>444,520=>386,521=>278,522=>386,523=>278,524=>778,525=>500, -526=>778,527=>500,528=>712,529=>444,530=>712,531=>444,532=>722,533=>556,534=>722,535=>556, -536=>556,537=>389,538=>667,539=>333,540=>464,541=>455,542=>774,543=>556,544=>731,545=>649, -546=>568,547=>494,548=>667,549=>444,550=>722,551=>500,552=>667,553=>444,554=>778,555=>500, -556=>778,557=>500,558=>778,559=>500,560=>778,561=>500,562=>722,563=>500,564=>437,565=>636, -566=>415,567=>338,568=>776,569=>760,570=>722,571=>722,572=>444,573=>664,574=>667,575=>389, -576=>451,577=>505,578=>479,579=>686,580=>750,581=>722,582=>667,583=>478,584=>500,585=>333, -586=>808,587=>608,588=>712,589=>444,590=>757,591=>500,592=>500,593=>523,594=>523,595=>556, -596=>444,598=>556,599=>556,600=>444,601=>444,602=>611,603=>440,604=>440,605=>611,607=>333, -608=>500,609=>500,610=>556,613=>556,614=>556,615=>556,616=>278,617=>333,618=>278,619=>278, -621=>278,622=>667,623=>833,624=>833,625=>833,626=>556,627=>556,628=>556,629=>500,631=>715, -632=>667,633=>444,634=>444,635=>444,636=>444,637=>444,638=>394,639=>394,640=>556,641=>556, -642=>389,643=>333,644=>333,645=>433,647=>333,648=>333,649=>500,650=>557,651=>529,652=>500, -653=>722,654=>500,655=>500,656=>444,658=>502,660=>500,661=>500,662=>500,664=>778,665=>510, -667=>722,668=>556,670=>556,671=>444,672=>556,673=>500,674=>500,686=>611,687=>722,697=>250, -698=>408,699=>250,700=>250,701=>250,702=>300,703=>300,706=>333,707=>333,708=>333,709=>333, -711=>333,712=>333,713=>333,714=>333,715=>333,716=>300,717=>333,718=>333,719=>333,720=>278, -721=>278,722=>300,723=>300,724=>333,725=>333,726=>333,727=>333,728=>333,729=>333,730=>333, -731=>333,733=>400,734=>333,735=>352,741=>526,742=>526,743=>526,744=>526,745=>526,746=>519, -747=>519,748=>333,749=>333,750=>480,751=>333,752=>333,753=>333,754=>333,755=>327,756=>261, -757=>437,758=>437,759=>400,760=>278,761=>175,762=>175,763=>175,764=>175,765=>333,766=>337, -767=>432,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0, -777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0, -787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0, -797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0, -807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0, -817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0, -827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0, -837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0, -847=>0,848=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0,855=>0,856=>0, -857=>0,858=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,884=>199,885=>199, -890=>0,894=>333,900=>330,901=>415,902=>722,903=>250,904=>811,905=>938,906=>556,908=>840, -910=>886,911=>879,912=>330,913=>722,914=>667,915=>611,916=>759,917=>667,918=>667,919=>774, -920=>778,921=>386,922=>777,923=>722,924=>943,925=>722,926=>650,927=>778,928=>812,929=>611, -931=>650,932=>667,933=>738,934=>868,935=>722,936=>924,937=>811,938=>386,939=>738,940=>605, -941=>440,942=>605,943=>330,944=>550,945=>605,946=>550,947=>550,948=>550,949=>440,950=>495, -951=>605,952=>550,953=>330,954=>608,955=>495,956=>605,957=>495,958=>495,959=>550,960=>605, -961=>550,962=>440,963=>550,964=>440,965=>550,966=>660,967=>495,968=>715,969=>715,970=>330, -971=>550,972=>550,973=>550,974=>715,976=>550,977=>605,978=>722,979=>871,980=>722,981=>660, -982=>715,983=>550,984=>611,985=>550,986=>650,987=>514,988=>611,989=>513,990=>715,991=>439, -992=>722,993=>605,1008=>550,1009=>550,1010=>477,1011=>333,1012=>778,1013=>424,1014=>424,1015=>632, -1016=>575,1017=>722,1018=>943,1019=>809,1020=>550,1021=>722,1022=>722,1023=>722,1024=>667,1025=>667, -1026=>848,1027=>611,1028=>722,1029=>556,1030=>386,1031=>386,1032=>500,1033=>1042,1034=>1032,1035=>912, -1036=>770,1037=>774,1038=>738,1039=>778,1040=>722,1041=>648,1042=>667,1043=>599,1044=>708,1045=>667, -1046=>1106,1047=>652,1048=>774,1049=>774,1050=>770,1051=>788,1052=>943,1053=>774,1054=>778,1055=>812, -1056=>611,1057=>722,1058=>667,1059=>738,1060=>868,1061=>722,1062=>774,1063=>754,1064=>1115,1065=>1115, -1066=>782,1067=>970,1068=>630,1069=>722,1070=>1114,1071=>729,1072=>500,1073=>500,1074=>510,1075=>430, -1076=>545,1077=>438,1078=>781,1079=>445,1080=>556,1081=>556,1082=>556,1083=>542,1084=>668,1085=>558, -1086=>500,1087=>558,1088=>549,1089=>444,1090=>494,1091=>486,1092=>809,1093=>500,1094=>560,1095=>556, -1096=>818,1097=>820,1098=>612,1099=>756,1100=>512,1101=>496,1102=>770,1103=>546,1104=>438,1105=>444, -1106=>549,1107=>430,1108=>488,1109=>386,1110=>272,1111=>278,1112=>333,1113=>784,1114=>786,1115=>552, -1116=>556,1117=>556,1118=>484,1119=>556,1120=>1018,1121=>699,1122=>781,1123=>612,1124=>1033,1125=>778, -1126=>993,1127=>692,1128=>1371,1129=>975,1130=>1106,1131=>781,1132=>1474,1133=>1066,1134=>650,1135=>424, -1136=>970,1137=>769,1138=>770,1139=>590,1140=>808,1141=>578,1142=>808,1143=>650,1144=>1284,1145=>973, -1146=>928,1147=>672,1148=>1018,1149=>693,1150=>1018,1151=>699,1152=>650,1153=>444,1154=>258,1155=>0, -1156=>0,1157=>0,1158=>0,1159=>0,1160=>0,1161=>0,1162=>774,1163=>558,1164=>630,1165=>512, -1166=>611,1167=>556,1168=>614,1169=>458,1170=>614,1171=>443,1172=>631,1173=>562,1174=>1155,1175=>828, -1176=>652,1177=>452,1178=>819,1179=>600,1180=>816,1181=>590,1182=>920,1183=>664,1184=>967,1185=>633, -1186=>774,1187=>562,1188=>984,1189=>698,1190=>1069,1191=>841,1192=>722,1193=>524,1194=>722,1195=>444, -1196=>667,1197=>494,1198=>722,1199=>606,1200=>722,1201=>606,1202=>722,1203=>560,1204=>1046,1205=>778, -1206=>754,1207=>560,1208=>810,1209=>590,1210=>754,1211=>556,1212=>945,1213=>606,1214=>945,1215=>606, -1216=>386,1217=>1106,1218=>781,1219=>770,1220=>534,1221=>788,1222=>550,1223=>774,1224=>556,1225=>774, -1226=>558,1227=>778,1228=>556,1229=>943,1230=>677,1231=>386,1232=>722,1233=>500,1234=>722,1235=>500, -1236=>1000,1237=>722,1238=>667,1239=>444,1240=>778,1241=>444,1242=>778,1243=>444,1244=>1106,1245=>781, -1246=>652,1247=>445,1248=>654,1249=>389,1250=>774,1251=>556,1252=>774,1253=>556,1254=>778,1255=>500, -1256=>778,1257=>500,1258=>778,1259=>500,1260=>722,1261=>496,1262=>738,1263=>500,1264=>738,1265=>500, -1266=>738,1267=>500,1268=>754,1269=>556,1270=>599,1271=>443,1272=>970,1273=>756,1296=>652,1297=>452, -1298=>788,1299=>550,1306=>778,1307=>556,1308=>1000,1309=>722,1310=>770,1311=>558,1425=>0,1426=>0, -1427=>0,1428=>0,1429=>0,1430=>0,1431=>0,1432=>0,1433=>0,1434=>0,1435=>0,1436=>0, -1437=>0,1438=>0,1439=>0,1440=>0,1441=>0,1442=>0,1443=>0,1444=>0,1445=>0,1446=>0, -1447=>0,1448=>0,1449=>0,1450=>0,1451=>0,1452=>0,1453=>0,1454=>0,1455=>0,1456=>0, -1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0, -1467=>0,1468=>0,1469=>0,1470=>433,1471=>0,1472=>155,1473=>0,1474=>0,1475=>400,1476=>0, -1477=>0,1478=>347,1479=>0,1488=>593,1489=>498,1490=>339,1491=>523,1492=>561,1493=>266,1494=>291, -1495=>559,1496=>576,1497=>266,1498=>496,1499=>501,1500=>510,1501=>542,1502=>581,1503=>273,1504=>347, -1505=>512,1506=>552,1507=>493,1508=>491,1509=>537,1510=>561,1511=>544,1512=>502,1513=>716,1514=>571, -1520=>532,1521=>532,1522=>532,1523=>396,1524=>432,3585=>590,3586=>578,3587=>661,3588=>592,3589=>592, -3590=>699,3591=>447,3592=>534,3593=>692,3594=>578,3595=>659,3596=>899,3597=>804,3598=>633,3599=>637, -3600=>484,3601=>730,3602=>876,3603=>915,3604=>592,3605=>592,3606=>578,3607=>670,3608=>542,3609=>671, -3610=>621,3611=>618,3612=>621,3613=>617,3614=>708,3615=>708,3616=>637,3617=>589,3618=>552,3619=>484, -3620=>590,3621=>569,3622=>637,3623=>526,3624=>599,3625=>802,3626=>579,3627=>668,3628=>778,3629=>560, -3630=>514,3631=>510,3632=>412,3633=>0,3634=>423,3635=>452,3636=>0,3637=>0,3638=>0,3639=>0, -3640=>0,3641=>0,3642=>0,3647=>665,3648=>357,3649=>624,3650=>529,3651=>486,3652=>475,3653=>423, -3654=>500,3655=>0,3656=>0,3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>657, -3664=>548,3665=>548,3666=>592,3667=>614,3668=>631,3669=>643,3670=>508,3671=>744,3672=>622,3673=>585, -3674=>721,3675=>1381,4256=>475,4257=>469,4258=>573,4259=>650,4260=>502,4261=>506,4262=>481,4263=>746, -4264=>491,4265=>495,4266=>888,4267=>488,4268=>464,4269=>745,4270=>483,4271=>489,4272=>721,4273=>464, -4274=>578,4275=>590,4276=>611,4277=>491,4278=>663,4279=>489,4280=>544,4281=>479,4282=>527,4283=>488, -4284=>560,4285=>461,4286=>467,4287=>546,4288=>483,4289=>487,4290=>562,4291=>477,4292=>491,4293=>471, -4304=>522,4305=>518,4306=>621,4307=>716,4308=>517,4309=>519,4310=>518,4311=>796,4312=>518,4313=>518, -4314=>934,4315=>517,4316=>519,4317=>787,4318=>515,4319=>514,4320=>788,4321=>573,4322=>620,4323=>593, -4324=>639,4325=>516,4326=>714,4327=>518,4328=>572,4329=>518,4330=>555,4331=>518,4332=>562,4333=>509, -4334=>572,4335=>677,4336=>523,4337=>517,4338=>595,4339=>480,4340=>519,4341=>484,4345=>621,4347=>450, -5024=>718,5025=>768,5026=>633,5027=>878,5028=>1001,5029=>371,5030=>576,5031=>754,5032=>531,5033=>774, -5034=>692,5035=>499,5036=>668,5037=>829,5038=>575,5039=>681,5040=>485,5041=>607,5042=>885,5043=>974, -5044=>588,5045=>583,5046=>726,5047=>947,5048=>558,5049=>832,5050=>1096,5051=>780,5052=>595,5053=>869, -5054=>752,5055=>710,5056=>761,5057=>802,5058=>760,5059=>656,5060=>655,5061=>982,5062=>684,5063=>801, -5064=>805,5065=>1042,5066=>755,5067=>612,5068=>707,5069=>889,5070=>584,5071=>623,5072=>536,5073=>763, -5074=>763,5075=>498,5076=>1052,5077=>600,5078=>730,5079=>714,5080=>714,5081=>697,5082=>543,5083=>943, -5084=>718,5085=>630,5086=>660,5087=>692,5088=>841,5089=>861,5090=>617,5091=>733,5092=>898,5093=>896, -5094=>781,5095=>612,5096=>830,5097=>948,5098=>886,5099=>757,5100=>796,5101=>578,5102=>601,5103=>797, -5104=>623,5105=>886,5106=>730,5107=>827,5108=>648,7680=>722,7681=>500,7682=>667,7683=>556,7684=>667, -7685=>556,7686=>667,7687=>556,7688=>722,7689=>444,7690=>724,7691=>556,7692=>724,7693=>556,7694=>724, -7695=>556,7696=>724,7697=>556,7698=>724,7699=>556,7700=>667,7701=>444,7702=>667,7703=>444,7704=>667, -7705=>444,7706=>667,7707=>444,7708=>667,7709=>444,7710=>611,7711=>333,7712=>778,7713=>500,7714=>774, -7715=>556,7716=>774,7717=>556,7718=>774,7719=>556,7720=>774,7721=>556,7722=>774,7723=>556,7724=>386, -7725=>278,7726=>389,7727=>278,7728=>764,7729=>556,7730=>764,7731=>556,7732=>764,7733=>556,7734=>664, -7735=>278,7736=>664,7737=>278,7738=>664,7739=>278,7740=>664,7741=>278,7742=>943,7743=>833,7744=>943, -7745=>833,7746=>943,7747=>833,7748=>722,7749=>556,7750=>722,7751=>556,7752=>722,7753=>556,7754=>722, -7755=>556,7756=>778,7757=>500,7758=>778,7759=>500,7760=>778,7761=>500,7762=>778,7763=>500,7764=>611, -7765=>556,7766=>611,7767=>556,7768=>712,7769=>444,7770=>712,7771=>444,7772=>712,7773=>444,7774=>712, -7775=>444,7776=>556,7777=>389,7778=>556,7779=>389,7780=>556,7781=>389,7782=>556,7783=>389,7784=>556, -7785=>389,7786=>667,7787=>333,7788=>667,7789=>333,7790=>667,7791=>333,7792=>667,7793=>333,7794=>722, -7795=>556,7796=>722,7797=>556,7798=>722,7799=>556,7800=>722,7801=>556,7802=>722,7803=>556,7804=>722, -7805=>500,7806=>722,7807=>500,7808=>1000,7809=>722,7810=>1000,7811=>722,7812=>1000,7813=>722,7814=>1000, -7815=>722,7816=>1000,7817=>722,7818=>722,7819=>500,7820=>722,7821=>500,7822=>722,7823=>500,7824=>667, -7825=>444,7826=>667,7827=>444,7828=>667,7829=>444,7830=>556,7831=>333,7832=>722,7833=>500,7834=>507, -7835=>333,7840=>722,7841=>500,7842=>722,7843=>500,7844=>722,7845=>500,7846=>722,7847=>500,7848=>722, -7849=>500,7850=>722,7851=>500,7852=>722,7853=>500,7854=>722,7855=>500,7856=>722,7857=>500,7858=>825, -7859=>603,7860=>722,7861=>500,7862=>722,7863=>500,7864=>667,7865=>444,7866=>667,7867=>444,7868=>667, -7869=>444,7870=>667,7871=>444,7872=>667,7873=>444,7874=>667,7875=>444,7876=>667,7877=>444,7878=>667, -7879=>444,7880=>386,7881=>278,7882=>386,7883=>278,7884=>778,7885=>500,7886=>778,7887=>500,7888=>778, -7889=>500,7890=>778,7891=>500,7892=>778,7893=>500,7894=>778,7895=>500,7896=>778,7897=>500,7898=>774, -7899=>550,7900=>774,7901=>550,7902=>774,7903=>549,7904=>778,7905=>550,7906=>778,7907=>550,7908=>722, -7909=>556,7910=>722,7911=>556,7912=>838,7913=>672,7914=>838,7915=>672,7916=>825,7917=>659,7918=>839, -7919=>629,7920=>839,7921=>629,7922=>722,7923=>500,7924=>722,7925=>500,7926=>722,7927=>500,7928=>722, -7929=>500,7936=>605,7937=>605,7938=>605,7939=>605,7940=>605,7941=>605,7942=>605,7943=>605,7944=>722, -7945=>722,7946=>830,7947=>833,7948=>761,7949=>798,7950=>721,7951=>722,7952=>440,7953=>440,7954=>440, -7955=>440,7956=>440,7957=>440,7960=>817,7961=>826,7962=>944,7963=>970,7964=>964,7965=>1009,7968=>605, -7969=>605,7970=>605,7971=>605,7972=>605,7973=>605,7974=>605,7975=>605,7976=>926,7977=>921,7978=>1038, -7979=>1064,7980=>1092,7981=>1102,7982=>1005,7983=>991,7984=>330,7985=>330,7986=>330,7987=>330,7988=>330, -7989=>330,7990=>330,7991=>330,7992=>534,7993=>541,7994=>653,7995=>659,7996=>705,7997=>714,7998=>612, -7999=>614,8000=>550,8001=>550,8002=>550,8003=>550,8004=>550,8005=>550,8008=>885,8009=>886,8010=>1038, -8011=>1052,8012=>997,8013=>1021,8016=>550,8017=>550,8018=>550,8019=>550,8020=>550,8021=>550,8022=>550, -8023=>550,8025=>870,8027=>1014,8029=>1043,8031=>944,8032=>715,8033=>715,8034=>715,8035=>715,8036=>715, -8037=>715,8038=>715,8039=>715,8040=>905,8041=>913,8042=>1066,8043=>1085,8044=>1034,8045=>1044,8046=>980, -8047=>961,8048=>605,8049=>605,8050=>440,8051=>440,8052=>605,8053=>605,8054=>330,8055=>330,8056=>550, -8057=>550,8058=>550,8059=>550,8060=>715,8061=>715,8064=>605,8065=>605,8066=>605,8067=>605,8068=>605, -8069=>605,8070=>605,8071=>605,8072=>886,8073=>887,8074=>985,8075=>993,8076=>937,8077=>956,8078=>874, -8079=>878,8080=>605,8081=>605,8082=>605,8083=>605,8084=>605,8085=>605,8086=>605,8087=>605,8088=>1096, -8089=>1092,8090=>1223,8091=>1250,8092=>1270,8093=>1283,8094=>1174,8095=>1162,8096=>715,8097=>715,8098=>715, -8099=>715,8100=>715,8101=>715,8102=>715,8103=>715,8104=>1057,8105=>1073,8106=>1228,8107=>1251,8108=>1202, -8109=>1210,8110=>1151,8111=>1131,8112=>605,8113=>605,8114=>605,8115=>605,8116=>605,8118=>605,8119=>605, -8120=>722,8121=>722,8122=>722,8123=>722,8124=>883,8125=>500,8126=>0,8127=>500,8128=>500,8129=>550, -8130=>605,8131=>605,8132=>605,8134=>605,8135=>605,8136=>790,8137=>830,8138=>909,8139=>931,8140=>950, -8141=>500,8142=>500,8143=>500,8144=>330,8145=>330,8146=>330,8147=>330,8150=>330,8151=>330,8152=>386, -8153=>386,8154=>506,8155=>550,8157=>500,8158=>500,8159=>500,8160=>550,8161=>550,8162=>550,8163=>550, -8164=>550,8165=>550,8166=>550,8167=>550,8168=>738,8169=>738,8170=>858,8171=>880,8172=>764,8173=>550, -8174=>550,8175=>500,8178=>715,8179=>715,8180=>715,8182=>715,8183=>715,8184=>884,8185=>857,8186=>927, -8187=>892,8188=>988,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250, -8198=>167,8199=>500,8200=>250,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0, -8208=>333,8209=>333,8210=>500,8213=>1000,8214=>333,8215=>478,8219=>250,8223=>500,8227=>560,8228=>250, -8229=>500,8231=>250,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>250, -8241=>1588,8242=>270,8243=>492,8244=>714,8245=>270,8246=>484,8247=>693,8248=>469,8251=>727,8252=>666, -8253=>695,8254=>500,8255=>953,8256=>953,8257=>338,8258=>931,8259=>333,8260=>167,8261=>332,8262=>332, -8263=>1000,8264=>833,8265=>833,8266=>500,8267=>540,8268=>528,8269=>523,8270=>500,8271=>333,8272=>953, -8273=>500,8274=>497,8275=>576,8276=>953,8277=>785,8278=>450,8279=>881,8280=>620,8281=>620,8282=>179, -8283=>621,8284=>569,8285=>179,8286=>179,8287=>111,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0, -8304=>300,8305=>278,8308=>300,8309=>300,8310=>300,8311=>300,8312=>300,8313=>300,8314=>300,8315=>300, -8316=>300,8317=>216,8318=>216,8319=>318,8320=>300,8321=>274,8322=>300,8323=>300,8324=>300,8325=>300, -8326=>300,8327=>300,8328=>300,8329=>300,8330=>300,8331=>300,8332=>300,8333=>216,8334=>216,8352=>710, -8353=>722,8354=>783,8355=>611,8356=>500,8357=>833,8358=>722,8359=>960,8360=>1101,8361=>1000,8362=>889, -8363=>532,8365=>742,8366=>631,8369=>609,8370=>639,8371=>660,8372=>556,8373=>500,8448=>752,8449=>746, -8451=>1009,8457=>923,8458=>500,8459=>1035,8462=>556,8463=>556,8464=>792,8465=>737,8466=>800,8467=>427, -8468=>835,8470=>879,8471=>1048,8472=>666,8475=>747,8476=>955,8478=>722,8479=>722,8480=>891,8481=>1156, -8483=>722,8486=>811,8487=>811,8489=>333,8490=>764,8491=>722,8492=>806,8494=>551,8497=>723,8498=>611, -8499=>1203,8501=>593,8502=>498,8503=>339,8504=>523,8506=>906,8507=>1156,8523=>778,8525=>866,8526=>500, -8531=>750,8532=>750,8533=>750,8534=>750,8535=>750,8536=>750,8537=>750,8538=>750,8539=>750,8540=>750, -8541=>750,8542=>750,8543=>750,8544=>386,8545=>772,8546=>1158,8547=>1108,8548=>722,8549=>1108,8550=>1494, -8551=>1880,8552=>1108,8553=>722,8554=>1108,8555=>1494,8556=>664,8557=>722,8558=>724,8559=>943,8560=>278, -8561=>556,8562=>834,8563=>778,8564=>500,8565=>778,8566=>1056,8567=>1334,8568=>778,8569=>500,8570=>778, -8571=>1056,8572=>278,8573=>444,8574=>556,8575=>833,8592=>964,8593=>523,8594=>964,8595=>523,8596=>964, -8597=>964,8598=>964,8599=>964,8600=>964,8601=>964,8602=>964,8603=>964,8604=>1152,8605=>1152,8606=>964, -8607=>964,8608=>964,8609=>964,8610=>1078,8611=>1078,8612=>964,8613=>964,8614=>964,8615=>964,8616=>964, -8617=>964,8618=>964,8619=>964,8620=>964,8621=>1168,8622=>964,8624=>622,8625=>622,8630=>1069,8631=>1069, -8632=>964,8633=>964,8634=>980,8635=>980,8636=>964,8637=>964,8638=>557,8639=>556,8640=>964,8641=>964, -8642=>557,8643=>556,8644=>964,8645=>964,8646=>964,8647=>964,8648=>964,8649=>964,8650=>964,8651=>964, -8652=>964,8653=>964,8654=>964,8655=>964,8656=>964,8657=>630,8658=>964,8659=>630,8660=>964,8661=>630, -8662=>1063,8663=>1063,8664=>1063,8665=>1063,8666=>964,8667=>964,8668=>1100,8669=>1100,8672=>964,8674=>964, -8676=>964,8677=>964,8704=>627,8705=>716,8706=>558,8707=>627,8708=>627,8709=>500,8710=>612,8711=>719, -8713=>576,8714=>576,8716=>576,8717=>576,8720=>733,8721=>713,8722=>676,8723=>676,8724=>676,8725=>750, -8727=>570,8729=>570,8730=>549,8733=>676,8734=>752,8736=>555,8737=>555,8738=>555,8739=>240,8740=>531, -8741=>478,8742=>705,8743=>694,8744=>694,8745=>694,8746=>694,8747=>323,8756=>629,8757=>629,8761=>947, -8764=>676,8765=>676,8766=>763,8768=>305,8769=>676,8770=>676,8771=>676,8773=>676,8776=>676,8777=>676, -8778=>676,8781=>676,8782=>676,8783=>676,8784=>676,8785=>676,8786=>676,8787=>676,8788=>947,8789=>947, -8790=>676,8791=>676,8796=>676,8800=>570,8801=>676,8802=>676,8804=>570,8805=>570,8806=>676,8807=>676, -8808=>676,8809=>676,8810=>1047,8811=>1047,8812=>450,8813=>676,8814=>676,8815=>676,8816=>676,8817=>676, -8818=>676,8819=>676,8820=>676,8821=>676,8822=>676,8823=>676,8824=>676,8825=>676,8826=>676,8827=>676, -8828=>676,8829=>676,8830=>676,8831=>676,8832=>676,8833=>676,8834=>676,8835=>676,8836=>676,8837=>676, -8838=>676,8839=>676,8840=>676,8841=>676,8842=>676,8843=>676,8846=>694,8847=>676,8848=>676,8849=>676, -8850=>676,8851=>694,8852=>694,8853=>738,8854=>738,8855=>738,8856=>738,8857=>738,8858=>738,8859=>738, -8861=>738,8862=>678,8863=>678,8864=>678,8865=>678,8866=>487,8867=>487,8868=>752,8869=>752,8871=>487, -8873=>659,8874=>831,8876=>487,8877=>487,8878=>659,8879=>659,8882=>676,8883=>676,8884=>676,8885=>676, -8886=>1380,8887=>1380,8888=>1027,8890=>626,8891=>694,8892=>694,8893=>694,8900=>512,8903=>676,8904=>759, -8905=>632,8906=>632,8907=>1000,8908=>1000,8909=>676,8910=>694,8911=>694,8912=>676,8913=>676,8914=>694, -8915=>694,8916=>694,8918=>676,8919=>676,8920=>1441,8921=>1441,8922=>676,8923=>676,8924=>676,8925=>676, -8926=>676,8927=>676,8928=>676,8929=>676,8930=>676,8931=>676,8934=>676,8935=>676,8936=>676,8937=>676, -8938=>676,8939=>676,8940=>676,8941=>676,8960=>737,8968=>411,8969=>411,8970=>411,8971=>411,8976=>680, -8994=>951,8995=>951,9001=>398,9002=>398,9251=>500,9472=>1000,9473=>1000,9474=>1000,9475=>1000,9476=>1000, -9477=>1000,9478=>1000,9479=>1000,9480=>1000,9481=>1000,9482=>1000,9483=>1000,9484=>1000,9485=>1000,9486=>1000, -9487=>1000,9488=>1000,9489=>1000,9490=>1000,9491=>1000,9492=>1000,9493=>1000,9494=>1000,9495=>1000,9496=>1000, -9497=>1000,9498=>1000,9499=>1000,9500=>1000,9501=>1000,9502=>1000,9503=>1000,9504=>1000,9505=>1000,9506=>1000, -9507=>1000,9508=>1000,9509=>1000,9510=>1000,9511=>1000,9512=>1000,9513=>1000,9514=>1000,9515=>1000,9516=>1000, -9517=>1000,9518=>1000,9519=>1000,9520=>1000,9521=>1000,9522=>1000,9523=>1000,9524=>1000,9525=>1000,9526=>1000, -9527=>1000,9528=>1000,9529=>1000,9530=>1000,9531=>1000,9532=>1000,9533=>1000,9534=>1000,9535=>1000,9536=>1000, -9537=>1000,9538=>1000,9539=>1000,9540=>1000,9541=>1000,9542=>1000,9543=>1000,9544=>1000,9545=>1000,9546=>1000, -9547=>1000,9552=>1000,9553=>1000,9554=>1000,9555=>1000,9556=>1000,9557=>1000,9558=>1000,9559=>1000,9560=>1000, -9561=>1000,9562=>1000,9563=>1000,9564=>1000,9565=>1000,9566=>1000,9567=>1000,9568=>1000,9569=>1000,9570=>1000, -9571=>1000,9572=>1000,9573=>1000,9574=>1000,9575=>1000,9576=>1000,9577=>1000,9578=>1000,9579=>1000,9580=>1000, -9600=>1000,9601=>1000,9602=>1000,9603=>1000,9604=>1000,9605=>1000,9606=>1000,9607=>1000,9608=>1000,9609=>1000, -9610=>1000,9611=>1000,9612=>1000,9613=>1000,9614=>1000,9615=>1000,9616=>1000,9617=>1000,9618=>1000,9620=>1000, -9621=>1000,9622=>1000,9623=>1000,9624=>1000,9625=>1000,9626=>1000,9627=>1000,9628=>1000,9629=>1000,9630=>1000, -9631=>1000,9632=>678,9633=>678,9642=>309,9650=>681,9651=>681,9654=>681,9655=>681,9660=>681,9661=>681, -9664=>681,9665=>681,9670=>580,9671=>580,9674=>494,9675=>738,9676=>732,9679=>738,9702=>524,9711=>851, -9733=>1003,9734=>1003,9824=>618,9825=>645,9826=>587,9827=>582,9828=>582,9829=>645,9830=>587,9831=>618, -9833=>333,9834=>556,9835=>778,9836=>778,9837=>556,9838=>556,9839=>556,10214=>561,10215=>561,11799=>333, -64256=>613,64257=>559,64258=>559,64259=>846,64260=>836,64262=>723,64285=>266,64286=>0,64287=>532,64288=>552, -64297=>570,64298=>716,64299=>716,64300=>716,64301=>716,64302=>593,64303=>593,64304=>593,64305=>498,64306=>339, -64307=>523,64308=>561,64309=>266,64310=>291,64312=>576,64313=>266,64314=>496,64315=>501,64316=>510,64318=>581, -64320=>347,64321=>512,64323=>493,64324=>491,64326=>561,64327=>544,64328=>502,64329=>716,64330=>571,64331=>266, -64332=>498,64333=>501,64334=>491,64335=>593,65533=>788); -$enc=''; -$diff=''; -$file='freeserifb.z'; -$ctg='freeserifb.ctg.z'; -$originalsize=467208; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.z deleted file mode 100644 index 95e31362ff..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifb.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.ctg.z deleted file mode 100644 index 86d46ef303..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.php deleted file mode 100644 index d45a4f5f61..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSerifBoldItalic'; -$desc=array('Ascent'=>900,'Descent'=>-300,'CapHeight'=>-24,'Flags'=>96,'FontBBox'=>'[-787 -1120 1867 1571]','ItalicAngle'=>-16.3,'StemV'=>120,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>250,33=>389,34=>555,35=>500,36=>500,37=>833,38=>778,39=>278,40=>333,41=>333, -42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500, -52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>570,61=>570, -62=>570,63=>500,64=>832,65=>667,66=>667,67=>667,68=>744,69=>670,70=>656,71=>722, -72=>778,73=>393,74=>500,75=>664,76=>609,77=>896,78=>722,79=>722,80=>614,81=>722, -82=>672,83=>556,84=>611,85=>722,86=>667,87=>889,88=>667,89=>611,90=>611,91=>333, -92=>278,93=>333,94=>570,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444, -102=>333,103=>500,104=>556,105=>278,106=>278,107=>500,108=>278,109=>778,110=>556,111=>500, -112=>500,113=>500,114=>389,115=>389,116=>278,117=>556,118=>444,119=>667,120=>500,121=>444, -122=>389,123=>348,124=>220,125=>348,126=>570,8364=>761,8218=>250,402=>333,8222=>500,8230=>1000, -8224=>500,8225=>500,710=>333,8240=>1000,352=>556,8249=>333,338=>944,381=>611,8216=>250,8217=>250, -8220=>500,8221=>500,8226=>350,8211=>500,8212=>1000,732=>333,8482=>1000,353=>389,8250=>333,339=>722, -382=>389,376=>611,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500, -168=>333,169=>747,170=>266,171=>500,172=>606,173=>333,174=>747,175=>333,176=>400,177=>570, -178=>300,179=>300,180=>333,181=>576,182=>500,183=>250,184=>333,185=>272,186=>300,187=>500, -188=>750,189=>750,190=>750,191=>500,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667, -198=>944,199=>667,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389, -208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>570,216=>722,217=>722, -218=>722,219=>722,220=>722,221=>611,222=>609,223=>500,224=>500,225=>500,226=>500,227=>500, -228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278, -238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>570, -248=>500,249=>556,250=>556,251=>556,252=>556,253=>444,254=>500,255=>444,256=>667,257=>500, -258=>667,259=>500,260=>667,261=>500,262=>667,263=>444,264=>667,265=>444,266=>667,267=>444, -268=>667,269=>444,270=>722,271=>616,272=>722,273=>500,274=>667,275=>444,276=>667,277=>444, -278=>667,279=>444,280=>667,281=>444,282=>667,283=>444,284=>722,285=>500,286=>722,287=>500, -288=>722,289=>500,290=>722,291=>500,292=>778,293=>556,294=>778,295=>556,296=>389,297=>278, -298=>389,299=>278,300=>389,301=>278,302=>389,303=>278,304=>389,305=>278,306=>826,307=>547, -308=>500,309=>278,310=>667,311=>500,312=>534,313=>611,314=>278,315=>611,316=>278,317=>638, -318=>424,319=>611,320=>424,321=>611,322=>278,323=>722,324=>556,325=>722,326=>556,327=>722, -328=>556,329=>556,330=>722,331=>547,332=>722,333=>500,334=>722,335=>500,336=>722,337=>500, -340=>667,341=>389,342=>667,343=>389,344=>667,345=>389,346=>556,347=>389,348=>556,349=>389, -350=>556,351=>389,354=>611,355=>278,356=>611,357=>308,358=>611,359=>278,360=>722,361=>556, -362=>722,363=>556,364=>722,365=>556,366=>722,367=>556,368=>722,369=>556,370=>722,371=>556, -372=>889,373=>667,374=>611,375=>444,377=>611,378=>389,379=>611,380=>389,383=>333,384=>500, -385=>850,386=>667,387=>575,388=>630,389=>500,390=>722,391=>929,392=>654,393=>722,394=>864, -395=>684,396=>500,397=>546,398=>670,399=>722,400=>631,401=>769,403=>929,404=>716,405=>745, -406=>278,407=>389,408=>829,409=>500,410=>278,411=>495,412=>853,413=>919,414=>556,415=>722, -416=>908,417=>640,418=>1014,419=>778,420=>757,421=>500,422=>611,423=>556,424=>389,425=>730, -426=>455,427=>349,428=>611,429=>298,430=>611,431=>902,432=>714,433=>811,434=>678,435=>611, -436=>581,437=>611,438=>389,439=>619,440=>614,441=>461,442=>445,443=>500,444=>614,445=>500, -446=>389,447=>504,448=>220,449=>418,450=>570,451=>333,452=>1355,453=>1133,454=>889,455=>1109, -456=>887,457=>556,458=>1222,459=>1000,460=>834,461=>667,462=>500,463=>393,464=>278,465=>722, -466=>500,467=>722,468=>556,469=>722,470=>556,471=>722,472=>556,473=>722,474=>556,475=>722, -476=>556,477=>444,478=>667,479=>500,480=>667,481=>500,482=>944,483=>722,484=>722,485=>500, -486=>722,487=>500,488=>664,489=>500,490=>722,491=>500,492=>722,493=>500,494=>619,495=>513, -496=>278,497=>1355,498=>1133,499=>889,500=>722,501=>500,502=>944,503=>660,504=>722,505=>556, -506=>667,507=>500,508=>944,509=>722,510=>722,511=>500,512=>667,513=>500,514=>667,515=>500, -516=>670,517=>444,518=>670,519=>444,520=>393,521=>278,522=>393,523=>278,524=>722,525=>500, -526=>722,527=>500,528=>672,529=>389,530=>672,531=>389,532=>722,533=>556,534=>722,535=>556, -536=>556,537=>389,538=>611,539=>278,540=>424,541=>455,542=>778,543=>556,544=>731,545=>618, -546=>568,547=>500,548=>667,549=>444,550=>667,551=>500,552=>670,553=>444,554=>722,555=>500, -556=>722,557=>500,558=>722,559=>500,560=>722,561=>500,562=>611,563=>444,564=>422,565=>621, -566=>413,567=>278,568=>800,569=>784,570=>644,571=>667,572=>444,573=>664,574=>611,575=>389, -576=>451,577=>444,578=>444,579=>667,580=>722,581=>722,582=>670,583=>444,584=>500,585=>278, -586=>808,587=>608,588=>672,589=>389,590=>611,591=>444,592=>500,593=>590,594=>590,595=>500, -596=>444,599=>668,600=>444,601=>444,603=>430,608=>569,609=>500,613=>556,616=>278,617=>320, -618=>278,623=>778,629=>500,633=>389,643=>333,648=>278,649=>500,650=>557,651=>492,652=>444, -653=>667,654=>444,658=>513,670=>500,697=>250,698=>408,699=>250,700=>250,701=>250,702=>300, -703=>300,706=>333,707=>333,708=>333,709=>333,711=>333,712=>333,713=>333,714=>333,715=>333, -716=>300,717=>333,718=>333,719=>333,720=>278,721=>278,722=>300,723=>300,724=>333,725=>333, -726=>333,727=>333,728=>333,729=>333,730=>333,731=>333,733=>333,734=>333,735=>352,741=>526, -742=>526,743=>526,744=>526,745=>526,746=>519,747=>519,748=>333,749=>333,750=>480,751=>333, -752=>333,753=>333,754=>333,755=>327,756=>261,757=>437,758=>437,759=>400,760=>278,761=>175, -762=>175,763=>175,764=>175,765=>0,766=>337,767=>432,768=>0,769=>0,770=>0,771=>0, -772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0, -782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0, -792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0, -802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0, -812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0, -822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0, -832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0, -842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,848=>0,849=>0,850=>0,851=>0, -852=>0,853=>0,854=>0,855=>0,856=>0,857=>0,858=>0,860=>0,861=>0,862=>0, -863=>0,864=>0,865=>0,884=>199,885=>199,890=>0,894=>333,900=>330,901=>333,902=>667, -903=>250,904=>819,905=>955,906=>539,908=>835,910=>961,911=>889,912=>320,913=>667,914=>667, -915=>637,916=>740,917=>667,918=>611,919=>778,920=>722,921=>389,922=>677,923=>667,924=>889, -925=>722,926=>650,927=>722,928=>778,929=>611,931=>730,932=>621,933=>722,934=>748,935=>667, -936=>858,937=>741,938=>389,939=>722,940=>590,941=>430,942=>548,943=>320,944=>536,945=>590, -946=>536,947=>548,948=>550,949=>430,950=>482,951=>548,952=>525,953=>320,954=>564,955=>510, -956=>589,957=>522,958=>482,959=>536,960=>629,961=>536,962=>470,963=>536,964=>464,965=>536, -966=>643,967=>482,968=>715,969=>715,970=>320,971=>536,972=>536,973=>536,974=>715,976=>508, -977=>589,978=>722,979=>931,980=>722,981=>660,982=>715,983=>536,984=>611,985=>536,986=>620, -987=>524,988=>667,989=>535,990=>708,991=>428,992=>671,993=>633,1008=>550,1009=>550,1010=>477, -1011=>278,1012=>722,1013=>411,1014=>411,1015=>609,1016=>500,1017=>667,1018=>896,1019=>769,1020=>536, -1021=>667,1022=>667,1023=>667,1024=>670,1025=>670,1026=>762,1027=>637,1028=>667,1029=>556,1030=>393, -1031=>393,1032=>500,1033=>1085,1034=>1049,1035=>747,1036=>736,1037=>778,1038=>746,1039=>778,1040=>667, -1041=>667,1042=>667,1043=>637,1044=>778,1045=>670,1046=>1044,1047=>650,1048=>778,1049=>778,1050=>736, -1051=>814,1052=>896,1053=>778,1054=>722,1055=>778,1056=>614,1057=>667,1058=>611,1059=>746,1060=>748, -1061=>667,1062=>778,1063=>742,1064=>1136,1065=>1135,1066=>779,1067=>984,1068=>664,1069=>732,1070=>1069, -1071=>779,1072=>500,1073=>508,1074=>486,1075=>414,1076=>486,1077=>444,1078=>982,1079=>476,1080=>556, -1081=>556,1082=>564,1083=>585,1084=>757,1085=>552,1086=>500,1087=>556,1088=>500,1089=>444,1090=>778, -1091=>532,1092=>764,1093=>500,1094=>556,1095=>556,1096=>806,1097=>806,1098=>644,1099=>744,1100=>470, -1101=>488,1102=>757,1103=>586,1104=>444,1105=>444,1106=>524,1107=>414,1108=>488,1109=>389,1110=>278, -1111=>278,1112=>278,1113=>772,1114=>745,1115=>556,1116=>564,1117=>556,1118=>532,1119=>556,1120=>990, -1121=>690,1122=>804,1123=>751,1124=>1017,1125=>752,1126=>900,1127=>728,1128=>1236,1129=>927,1130=>1044, -1131=>826,1132=>1401,1133=>1016,1134=>620,1135=>476,1136=>858,1137=>769,1138=>722,1139=>544,1140=>796, -1141=>584,1142=>796,1143=>584,1144=>1268,1145=>1023,1146=>895,1147=>612,1148=>990,1149=>690,1150=>990, -1151=>635,1152=>620,1153=>444,1154=>372,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>0, -1161=>0,1162=>778,1163=>556,1164=>664,1165=>470,1166=>614,1167=>473,1168=>624,1169=>448,1170=>624, -1171=>448,1172=>733,1173=>485,1174=>1080,1175=>982,1176=>650,1177=>476,1178=>772,1179=>564,1180=>772, -1181=>590,1182=>738,1183=>499,1184=>862,1185=>718,1186=>778,1187=>552,1188=>976,1189=>682,1190=>1085, -1191=>787,1192=>667,1193=>480,1194=>667,1195=>444,1196=>534,1197=>778,1198=>611,1199=>640,1200=>611, -1201=>640,1202=>694,1203=>500,1204=>1004,1205=>518,1206=>742,1207=>556,1208=>742,1209=>556,1210=>716, -1211=>556,1212=>844,1213=>530,1214=>844,1215=>530,1216=>393,1217=>1044,1218=>982,1219=>736,1220=>534, -1221=>814,1222=>585,1223=>778,1224=>552,1225=>778,1226=>552,1227=>742,1228=>556,1229=>896,1230=>757, -1231=>393,1232=>667,1233=>500,1234=>667,1235=>500,1236=>891,1237=>646,1238=>670,1239=>444,1240=>659, -1241=>372,1242=>619,1243=>372,1244=>1044,1245=>994,1246=>650,1247=>476,1248=>604,1249=>459,1250=>778, -1251=>539,1252=>778,1253=>539,1254=>722,1255=>500,1256=>722,1257=>500,1258=>722,1259=>500,1260=>732, -1261=>488,1262=>746,1263=>532,1264=>746,1265=>532,1266=>746,1267=>532,1268=>742,1269=>556,1270=>637, -1271=>448,1272=>984,1273=>744,1296=>652,1297=>452,1298=>814,1299=>585,1306=>722,1307=>500,1308=>889, -1309=>656,1310=>736,1311=>564,1425=>0,1426=>0,1427=>0,1428=>0,1429=>0,1430=>0,1431=>0, -1432=>0,1433=>0,1434=>0,1435=>0,1436=>0,1437=>0,1438=>0,1439=>0,1440=>0,1441=>0, -1442=>0,1443=>0,1444=>0,1445=>0,1446=>0,1447=>0,1448=>0,1449=>0,1450=>0,1451=>0, -1452=>0,1453=>0,1454=>0,1455=>0,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0, -1462=>0,1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>433,1471=>0, -1472=>155,1473=>0,1474=>0,1475=>400,1476=>0,1477=>0,1478=>347,1479=>0,1488=>593,1489=>498, -1490=>339,1491=>523,1492=>561,1493=>266,1494=>291,1495=>559,1496=>576,1497=>266,1498=>496,1499=>501, -1500=>510,1501=>542,1502=>581,1503=>273,1504=>347,1505=>512,1506=>552,1507=>493,1508=>491,1509=>537, -1510=>561,1511=>544,1512=>502,1513=>716,1514=>571,1520=>532,1521=>532,1522=>532,1523=>396,1524=>432, -3585=>590,3586=>578,3587=>661,3588=>592,3589=>592,3590=>699,3591=>447,3592=>534,3593=>692,3594=>578, -3595=>659,3596=>899,3597=>804,3598=>633,3599=>637,3600=>484,3601=>730,3602=>876,3603=>915,3604=>592, -3605=>592,3606=>578,3607=>670,3608=>542,3609=>671,3610=>621,3611=>618,3612=>621,3613=>617,3614=>708, -3615=>708,3616=>637,3617=>589,3618=>552,3619=>484,3620=>590,3621=>569,3622=>637,3623=>526,3624=>599, -3625=>802,3626=>579,3627=>668,3628=>778,3629=>560,3630=>514,3631=>510,3632=>442,3633=>0,3634=>423, -3635=>452,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0,3647=>665,3648=>357, -3649=>624,3650=>529,3651=>486,3652=>475,3653=>423,3654=>500,3655=>0,3656=>0,3657=>0,3658=>0, -3659=>0,3660=>0,3661=>0,3662=>0,3663=>657,3664=>548,3665=>548,3666=>592,3667=>614,3668=>631, -3669=>643,3670=>508,3671=>744,3672=>622,3673=>585,3674=>721,3675=>1381,4256=>475,4257=>469,4258=>573, -4259=>650,4260=>502,4261=>506,4262=>481,4263=>746,4264=>491,4265=>495,4266=>888,4267=>488,4268=>464, -4269=>745,4270=>483,4271=>489,4272=>721,4273=>464,4274=>578,4275=>590,4276=>611,4277=>491,4278=>663, -4279=>489,4280=>544,4281=>479,4282=>527,4283=>488,4284=>560,4285=>461,4286=>467,4287=>546,4288=>483, -4289=>487,4290=>562,4291=>477,4292=>491,4293=>471,4304=>522,4305=>518,4306=>621,4307=>716,4308=>517, -4309=>519,4310=>518,4311=>796,4312=>518,4313=>518,4314=>934,4315=>517,4316=>519,4317=>787,4318=>515, -4319=>514,4320=>788,4321=>573,4322=>620,4323=>593,4324=>639,4325=>516,4326=>714,4327=>518,4328=>572, -4329=>518,4330=>555,4331=>518,4332=>562,4333=>509,4334=>572,4335=>677,4336=>523,4337=>517,4338=>595, -4339=>480,4340=>519,4341=>484,4345=>621,4347=>410,5024=>718,5025=>768,5026=>633,5027=>878,5028=>1001, -5029=>371,5030=>576,5031=>754,5032=>531,5033=>774,5034=>692,5035=>499,5036=>668,5037=>829,5038=>575, -5039=>681,5040=>485,5041=>607,5042=>885,5043=>974,5044=>588,5045=>583,5046=>726,5047=>947,5048=>558, -5049=>832,5050=>1096,5051=>780,5052=>595,5053=>869,5054=>752,5055=>710,5056=>761,5057=>802,5058=>760, -5059=>656,5060=>655,5061=>982,5062=>684,5063=>801,5064=>805,5065=>1042,5066=>755,5067=>612,5068=>707, -5069=>889,5070=>584,5071=>623,5072=>536,5073=>763,5074=>763,5075=>498,5076=>1052,5077=>600,5078=>730, -5079=>714,5080=>714,5081=>697,5082=>543,5083=>943,5084=>718,5085=>630,5086=>660,5087=>692,5088=>841, -5089=>861,5090=>617,5091=>733,5092=>898,5093=>896,5094=>781,5095=>612,5096=>830,5097=>948,5098=>886, -5099=>757,5100=>796,5101=>578,5102=>601,5103=>797,5104=>623,5105=>886,5106=>730,5107=>827,5108=>648, -7680=>667,7681=>500,7682=>667,7683=>500,7684=>667,7685=>500,7686=>667,7687=>500,7688=>667,7689=>444, -7690=>744,7691=>500,7692=>744,7693=>500,7694=>744,7695=>500,7696=>744,7697=>500,7698=>744,7699=>500, -7700=>667,7701=>444,7702=>667,7703=>444,7704=>670,7705=>444,7706=>670,7707=>444,7708=>670,7709=>444, -7710=>656,7711=>333,7712=>722,7713=>500,7714=>778,7715=>556,7716=>778,7717=>556,7718=>778,7719=>556, -7720=>778,7721=>556,7722=>778,7723=>556,7724=>393,7725=>278,7726=>389,7727=>278,7728=>664,7729=>500, -7730=>664,7731=>500,7732=>664,7733=>500,7734=>609,7735=>278,7736=>609,7737=>278,7738=>609,7739=>278, -7740=>609,7741=>278,7742=>896,7743=>778,7744=>896,7745=>778,7746=>896,7747=>778,7748=>722,7749=>556, -7750=>722,7751=>556,7752=>722,7753=>556,7754=>722,7755=>556,7756=>722,7757=>500,7758=>722,7759=>500, -7760=>722,7761=>500,7762=>722,7763=>500,7764=>614,7765=>500,7766=>614,7767=>500,7768=>672,7769=>389, -7770=>672,7771=>389,7772=>672,7773=>389,7774=>672,7775=>389,7776=>556,7777=>389,7778=>556,7779=>389, -7780=>556,7781=>389,7782=>556,7783=>389,7784=>556,7785=>389,7786=>611,7787=>278,7788=>611,7789=>278, -7790=>611,7791=>278,7792=>611,7793=>278,7794=>722,7795=>556,7796=>722,7797=>556,7798=>722,7799=>556, -7800=>722,7801=>556,7802=>722,7803=>556,7804=>667,7805=>444,7806=>667,7807=>444,7808=>889,7809=>667, -7810=>889,7811=>667,7812=>889,7813=>667,7814=>889,7815=>667,7816=>889,7817=>667,7818=>667,7819=>500, -7820=>667,7821=>500,7822=>611,7823=>444,7824=>611,7825=>389,7826=>611,7827=>389,7828=>611,7829=>389, -7830=>556,7831=>278,7832=>667,7833=>444,7834=>507,7835=>333,7840=>667,7841=>500,7842=>667,7843=>500, -7844=>667,7845=>500,7846=>667,7847=>500,7848=>667,7849=>500,7850=>667,7851=>500,7852=>667,7853=>500, -7854=>667,7855=>500,7856=>667,7857=>500,7858=>667,7859=>500,7860=>667,7861=>500,7862=>667,7863=>500, -7864=>670,7865=>444,7866=>670,7867=>444,7868=>670,7869=>444,7870=>667,7871=>444,7872=>667,7873=>444, -7874=>667,7875=>444,7876=>667,7877=>444,7878=>670,7879=>444,7880=>393,7881=>278,7882=>393,7883=>278, -7884=>722,7885=>500,7886=>722,7887=>500,7888=>722,7889=>500,7890=>722,7891=>500,7892=>722,7893=>500, -7894=>722,7895=>500,7896=>722,7897=>500,7898=>908,7899=>640,7900=>908,7901=>640,7902=>908,7903=>640, -7904=>908,7905=>640,7906=>908,7907=>640,7908=>722,7909=>556,7910=>722,7911=>556,7912=>902,7913=>714, -7914=>902,7915=>714,7916=>902,7917=>714,7918=>902,7919=>714,7920=>902,7921=>714,7922=>611,7923=>444, -7924=>611,7925=>444,7926=>611,7927=>444,7928=>611,7929=>444,7936=>590,7937=>590,7938=>590,7939=>590, -7940=>590,7941=>590,7942=>590,7943=>590,7944=>724,7945=>753,7946=>891,7947=>912,7948=>822,7949=>853, -7950=>796,7951=>787,7952=>430,7953=>430,7954=>430,7955=>430,7956=>430,7957=>430,7960=>864,7961=>905, -7962=>1034,7963=>1038,7964=>1031,7965=>1045,7968=>548,7969=>548,7970=>548,7971=>548,7972=>548,7973=>548, -7974=>548,7975=>548,7976=>976,7977=>1009,7978=>1132,7979=>1141,7980=>1138,7981=>1154,7982=>1079,7983=>1071, -7984=>320,7985=>320,7986=>320,7987=>320,7988=>320,7989=>320,7990=>320,7991=>320,7992=>593,7993=>620, -7994=>746,7995=>762,7996=>742,7997=>773,7998=>691,7999=>683,8000=>536,8001=>536,8002=>536,8003=>536, -8004=>536,8005=>536,8008=>899,8009=>928,8010=>1086,8011=>1118,8012=>1020,8013=>1028,8016=>536,8017=>536, -8018=>536,8019=>536,8020=>536,8021=>536,8022=>536,8023=>536,8025=>959,8027=>1085,8029=>1108,8031=>1027, -8032=>715,8033=>715,8034=>715,8035=>715,8036=>715,8037=>715,8038=>715,8039=>715,8040=>946,8041=>960, -8042=>1133,8043=>1148,8044=>1059,8045=>1081,8046=>1020,8047=>1016,8048=>590,8049=>590,8050=>430,8051=>430, -8052=>548,8053=>548,8054=>320,8055=>320,8056=>536,8057=>536,8058=>536,8059=>536,8060=>715,8061=>715, -8064=>590,8065=>590,8066=>590,8067=>590,8068=>590,8069=>590,8070=>590,8071=>590,8072=>842,8073=>877, -8074=>1011,8075=>1031,8076=>947,8077=>975,8078=>907,8079=>893,8080=>548,8081=>548,8082=>548,8083=>548, -8084=>548,8085=>548,8086=>548,8087=>548,8088=>1030,8089=>1066,8090=>1188,8091=>1199,8092=>1196,8093=>1211, -8094=>1134,8095=>1129,8096=>715,8097=>715,8098=>715,8099=>715,8100=>715,8101=>715,8102=>715,8103=>715, -8104=>1060,8105=>1076,8106=>1264,8107=>1287,8108=>1179,8109=>1204,8110=>1137,8111=>1135,8112=>590,8113=>590, -8114=>590,8115=>590,8116=>590,8118=>590,8119=>590,8120=>667,8121=>667,8122=>752,8123=>728,8124=>775, -8125=>250,8126=>0,8127=>500,8128=>500,8129=>550,8130=>548,8131=>548,8132=>548,8134=>548,8135=>548, -8136=>884,8137=>859,8138=>982,8139=>968,8140=>839,8141=>500,8142=>500,8143=>500,8144=>320,8145=>320, -8146=>320,8147=>320,8150=>320,8151=>320,8152=>389,8153=>389,8154=>599,8155=>592,8157=>500,8158=>500, -8159=>500,8160=>536,8161=>536,8162=>536,8163=>536,8164=>536,8165=>536,8166=>536,8167=>536,8168=>722, -8169=>722,8170=>1007,8171=>932,8172=>842,8173=>550,8174=>550,8175=>500,8178=>715,8179=>715,8180=>715, -8182=>715,8183=>715,8184=>971,8185=>853,8186=>1004,8187=>875,8188=>862,8189=>500,8190=>500,8192=>500, -8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>500,8200=>250,8201=>200,8202=>100, -8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>500,8213=>1000,8214=>333, -8215=>478,8219=>250,8223=>500,8227=>560,8228=>250,8229=>478,8231=>0,8232=>0,8233=>0,8234=>0, -8235=>0,8236=>0,8237=>0,8238=>250,8239=>0,8241=>1618,8242=>278,8243=>556,8244=>834,8245=>270, -8246=>468,8247=>630,8248=>469,8251=>727,8252=>778,8253=>733,8254=>500,8255=>953,8256=>953,8257=>338, -8258=>931,8259=>333,8260=>167,8261=>332,8262=>332,8263=>1000,8264=>889,8265=>889,8266=>500,8267=>453, -8268=>479,8269=>492,8270=>500,8271=>333,8272=>953,8273=>500,8274=>521,8275=>576,8276=>953,8277=>785, -8278=>410,8279=>881,8280=>620,8281=>620,8282=>179,8283=>621,8284=>569,8285=>179,8286=>179,8287=>111, -8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8304=>300,8305=>219,8308=>300,8309=>300,8310=>300, -8311=>300,8312=>300,8313=>300,8314=>300,8315=>300,8316=>300,8317=>216,8318=>216,8319=>300,8320=>300, -8321=>274,8322=>300,8323=>300,8324=>300,8325=>300,8326=>300,8327=>300,8328=>300,8329=>300,8330=>300, -8331=>300,8332=>300,8333=>216,8334=>216,8352=>667,8353=>667,8354=>667,8355=>667,8356=>500,8357=>742, -8358=>722,8359=>1008,8360=>953,8361=>889,8362=>889,8363=>532,8365=>742,8366=>631,8369=>609,8370=>639, -8371=>742,8372=>576,8373=>500,8448=>664,8449=>665,8451=>925,8453=>693,8454=>787,8455=>631,8457=>867, -8462=>556,8463=>556,8468=>778,8470=>806,8471=>747,8480=>879,8481=>1050,8483=>667,8486=>741,8487=>741, -8489=>320,8490=>664,8491=>667,8494=>551,8495=>444,8498=>667,8500=>500,8501=>537,8502=>537,8503=>350, -8504=>537,8506=>942,8507=>1050,8523=>698,8525=>856,8526=>462,8531=>750,8532=>750,8533=>750,8534=>750, -8535=>750,8536=>750,8537=>750,8538=>750,8539=>750,8540=>750,8541=>750,8542=>750,8543=>750,8544=>393, -8545=>786,8546=>1179,8547=>1060,8548=>667,8549=>1060,8550=>1453,8551=>1846,8552=>1060,8553=>667,8554=>1060, -8555=>1453,8556=>609,8557=>667,8558=>744,8559=>896,8560=>278,8561=>556,8562=>834,8563=>722,8564=>444, -8565=>722,8566=>1000,8567=>1278,8568=>778,8569=>500,8570=>778,8571=>1056,8572=>278,8573=>444,8574=>500, -8575=>778,8592=>964,8593=>964,8594=>964,8595=>964,8596=>964,8597=>964,8598=>964,8599=>964,8600=>964, -8601=>964,8602=>964,8603=>964,8606=>964,8607=>964,8608=>964,8609=>964,8610=>964,8611=>964,8612=>964, -8613=>964,8614=>964,8615=>964,8616=>964,8633=>964,8634=>964,8644=>964,8645=>964,8646=>964,8647=>964, -8648=>964,8649=>964,8650=>964,8676=>964,8677=>964,8706=>494,8710=>612,8721=>713,8722=>606,8725=>750, -8730=>549,8734=>752,8800=>570,8804=>570,8805=>570,9251=>500,9674=>494,9676=>732,9824=>618,9825=>645, -9826=>587,9827=>582,9828=>582,9829=>645,9830=>587,9831=>618,9833=>333,9834=>556,9835=>778,9836=>778, -9837=>556,9838=>556,9839=>556,11799=>333,64256=>583,64257=>558,64258=>551,64259=>822,64260=>818,64262=>662, -64285=>266,64286=>0,64287=>532,64288=>552,64297=>570,64298=>716,64299=>716,64300=>716,64301=>716,64302=>593, -64303=>593,64304=>593,64305=>498,64306=>339,64307=>523,64308=>561,64309=>266,64310=>291,64312=>576,64313=>266, -64314=>496,64315=>501,64316=>510,64318=>581,64320=>347,64321=>512,64323=>493,64324=>491,64326=>561,64327=>544, -64328=>502,64329=>716,64330=>571,64331=>266,64332=>498,64333=>501,64334=>491,64335=>593,65533=>788); -$enc=''; -$diff=''; -$file='freeserifbi.z'; -$ctg='freeserifbi.ctg.z'; -$originalsize=452752; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.z deleted file mode 100644 index 63125cf543..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifbi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.ctg.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.ctg.z deleted file mode 100644 index 1a99cb55f5..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.ctg.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.php deleted file mode 100644 index 93853603a6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.php +++ /dev/null @@ -1,259 +0,0 @@ -<?php -$type='TrueTypeUnicode'; -$name='FreeSerifItalic'; -$desc=array('Ascent'=>900,'Descent'=>-300,'CapHeight'=>-29,'Flags'=>96,'FontBBox'=>'[-879 -434 1673 900]','ItalicAngle'=>-16.5,'StemV'=>70,'MissingWidth'=>600); -$up=-125; -$ut=50; -$dw=600; -$cw=array( -32=>250,33=>333,34=>420,35=>500,36=>500,37=>833,38=>778,39=>214,40=>333,41=>333, -42=>500,43=>675,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500, -52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>675,61=>675, -62=>675,63=>500,64=>920,65=>611,66=>611,67=>667,68=>722,69=>604,70=>611,71=>722, -72=>722,73=>339,74=>444,75=>652,76=>556,77=>828,78=>657,79=>722,80=>603,81=>722, -82=>616,83=>500,84=>556,85=>722,86=>611,87=>833,88=>611,89=>556,90=>556,91=>389, -92=>278,93=>389,94=>422,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444, -102=>278,103=>500,104=>500,105=>278,106=>278,107=>444,108=>278,109=>722,110=>500,111=>500, -112=>500,113=>500,114=>389,115=>389,116=>278,117=>500,118=>444,119=>667,120=>444,121=>444, -122=>389,123=>400,124=>275,125=>400,126=>541,8364=>741,8218=>250,402=>278,8222=>444,8230=>889, -8224=>500,8225=>500,710=>333,8240=>1000,352=>500,8249=>250,338=>944,381=>556,8216=>250,8217=>250, -8220=>444,8221=>444,8226=>350,8211=>500,8212=>1000,732=>333,8482=>980,353=>389,8250=>250,339=>667, -382=>389,376=>556,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>275,167=>500, -168=>333,169=>760,170=>276,171=>444,172=>675,173=>333,174=>760,175=>333,176=>400,177=>675, -178=>300,179=>300,180=>333,181=>500,182=>523,183=>250,184=>333,185=>250,186=>310,187=>444, -188=>750,189=>750,190=>750,191=>500,192=>611,193=>611,194=>611,195=>611,196=>611,197=>611, -198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333, -208=>722,209=>667,210=>722,211=>722,212=>722,213=>722,214=>722,215=>675,216=>722,217=>722, -218=>722,219=>722,220=>722,221=>556,222=>611,223=>500,224=>500,225=>500,226=>500,227=>500, -228=>500,229=>500,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278, -238=>278,239=>278,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>675, -248=>500,249=>500,250=>500,251=>500,252=>500,253=>444,254=>500,255=>444,256=>611,257=>500, -258=>611,259=>500,260=>611,261=>500,262=>667,263=>444,264=>667,265=>444,266=>667,267=>444, -268=>667,269=>444,270=>722,271=>500,272=>722,273=>500,274=>611,275=>444,276=>611,277=>444, -278=>611,279=>444,280=>611,281=>444,282=>611,283=>444,284=>722,285=>500,286=>722,287=>500, -288=>722,289=>500,290=>722,291=>500,292=>722,293=>500,294=>722,295=>500,296=>333,297=>278, -298=>333,299=>278,300=>333,301=>278,302=>333,303=>278,304=>333,305=>278,306=>707,307=>553, -308=>444,309=>278,310=>667,311=>444,312=>444,313=>556,314=>278,315=>556,316=>278,317=>556, -318=>278,319=>556,320=>278,321=>556,322=>278,323=>667,324=>500,325=>667,326=>500,327=>667, -328=>500,329=>500,330=>667,331=>500,332=>722,333=>500,334=>722,335=>500,336=>722,337=>500, -340=>611,341=>389,342=>611,343=>389,344=>611,345=>389,346=>500,347=>389,348=>500,349=>389, -350=>500,351=>389,354=>556,355=>278,356=>556,357=>278,358=>556,359=>278,360=>722,361=>500, -362=>722,363=>500,364=>722,365=>500,366=>722,367=>500,368=>722,369=>500,370=>722,371=>500, -372=>833,373=>667,374=>556,375=>444,377=>556,378=>389,379=>556,380=>389,383=>278,384=>500, -385=>781,386=>610,387=>551,388=>611,389=>549,390=>667,391=>866,392=>703,393=>722,394=>892, -395=>682,396=>500,397=>520,398=>611,399=>722,400=>518,401=>611,403=>863,404=>611,405=>728, -406=>278,407=>333,408=>792,409=>444,410=>278,411=>480,412=>900,413=>779,414=>500,415=>722, -416=>932,417=>608,418=>908,419=>722,420=>772,421=>500,422=>611,423=>500,424=>389,425=>657, -426=>461,427=>313,428=>556,429=>335,430=>556,431=>948,432=>721,433=>747,434=>755,435=>636, -436=>549,437=>556,438=>389,439=>525,440=>556,441=>424,442=>416,443=>500,444=>615,445=>439, -446=>389,447=>500,448=>275,449=>500,450=>600,451=>333,452=>1278,453=>1111,454=>889,455=>1000, -456=>834,457=>556,458=>1101,459=>935,460=>778,461=>611,462=>500,463=>339,464=>278,465=>722, -466=>500,467=>722,468=>500,469=>722,470=>500,471=>722,472=>500,473=>722,474=>500,475=>722, -476=>500,477=>444,478=>611,479=>500,480=>611,481=>500,482=>889,483=>667,484=>722,485=>500, -486=>722,487=>500,488=>652,489=>444,490=>730,491=>500,492=>730,493=>500,494=>525,495=>446, -496=>278,497=>1278,498=>1111,499=>889,500=>817,501=>595,502=>944,503=>607,504=>657,505=>500, -506=>611,507=>500,508=>889,509=>667,510=>722,511=>500,512=>611,513=>500,514=>611,515=>500, -516=>604,517=>444,518=>604,519=>444,520=>339,521=>278,522=>339,523=>278,524=>722,525=>500, -526=>722,527=>500,528=>616,529=>389,530=>616,531=>389,532=>722,533=>500,534=>722,535=>500, -536=>500,537=>389,538=>556,539=>278,540=>424,541=>455,542=>722,543=>500,544=>781,545=>588, -546=>568,547=>468,548=>611,549=>444,550=>611,551=>500,552=>604,553=>444,554=>722,555=>500, -556=>722,557=>500,558=>722,559=>500,560=>722,561=>500,562=>556,563=>444,564=>405,565=>597, -566=>377,567=>278,568=>775,569=>767,570=>722,571=>667,572=>444,573=>611,574=>611,575=>389, -576=>444,577=>444,578=>444,579=>667,580=>750,581=>697,582=>611,583=>444,584=>389,585=>278, -586=>796,587=>590,588=>667,589=>333,590=>722,591=>500,592=>500,593=>564,594=>564,595=>500, -596=>444,597=>444,598=>500,599=>697,600=>444,601=>444,602=>722,603=>416,604=>426,605=>674, -606=>454,607=>278,608=>640,609=>500,610=>484,611=>500,612=>582,613=>500,614=>500,615=>500, -616=>278,617=>278,618=>278,619=>278,620=>278,621=>278,622=>556,623=>722,624=>722,625=>716, -626=>500,627=>500,628=>500,629=>500,630=>668,631=>693,632=>640,633=>389,634=>389,635=>333, -636=>389,637=>333,638=>333,639=>333,640=>487,641=>487,642=>389,643=>278,644=>500,645=>333, -646=>500,647=>278,648=>278,649=>500,650=>517,651=>500,652=>444,653=>667,654=>444,655=>510, -656=>524,657=>444,658=>446,659=>456,660=>444,661=>444,662=>444,663=>444,664=>722,665=>442, -666=>454,667=>665,668=>585,669=>347,670=>444,671=>443,672=>500,673=>444,674=>444,675=>798, -676=>795,677=>805,678=>554,679=>561,680=>678,681=>614,682=>554,683=>554,684=>500,685=>500, -686=>611,687=>611,688=>300,689=>300,690=>278,691=>278,692=>278,693=>309,694=>306,695=>432, -696=>310,697=>250,698=>408,699=>333,700=>500,701=>500,702=>333,703=>333,704=>258,705=>258, -706=>374,707=>374,708=>383,709=>383,711=>333,712=>250,713=>333,714=>333,715=>333,716=>250, -717=>333,718=>333,719=>333,720=>278,721=>278,722=>333,723=>333,724=>333,725=>333,726=>333, -727=>333,728=>333,729=>333,730=>333,731=>333,733=>333,734=>336,735=>352,736=>311,737=>200, -738=>243,739=>328,740=>300,741=>460,742=>460,743=>460,744=>460,745=>460,746=>477,747=>475, -748=>339,749=>330,750=>444,751=>383,752=>383,753=>294,754=>294,755=>327,756=>261,757=>437, -758=>437,759=>333,760=>278,761=>175,762=>175,763=>175,764=>175,765=>337,766=>337,767=>326, -768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0, -778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0, -788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0, -798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0, -808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0, -818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0, -828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0, -838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0, -848=>0,849=>0,850=>0,851=>0,852=>0,853=>0,854=>0,855=>0,856=>0,857=>0, -858=>0,859=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,867=>0, -868=>0,869=>0,870=>0,871=>0,872=>0,873=>0,874=>0,875=>0,876=>0,877=>0, -878=>0,879=>0,884=>199,885=>199,890=>332,894=>333,900=>257,901=>333,902=>661,903=>250, -904=>841,905=>950,906=>559,908=>815,910=>877,911=>899,912=>270,913=>661,914=>581,915=>611, -916=>660,917=>611,918=>606,919=>742,920=>672,921=>333,922=>667,923=>641,924=>833,925=>657, -926=>678,927=>682,928=>749,929=>611,931=>657,932=>596,933=>676,934=>722,935=>611,936=>812, -937=>743,938=>333,939=>696,940=>564,941=>416,942=>506,943=>270,944=>504,945=>564,946=>509, -947=>496,948=>520,949=>416,950=>398,951=>506,952=>533,953=>270,954=>491,955=>488,956=>501, -957=>486,958=>430,959=>510,960=>608,961=>506,962=>423,963=>524,964=>425,965=>504,966=>618, -967=>459,968=>693,969=>693,970=>270,971=>504,972=>510,973=>504,974=>693,976=>534,977=>587, -978=>620,979=>820,980=>620,981=>640,982=>684,983=>504,984=>555,985=>534,986=>548,987=>496, -988=>610,989=>470,990=>633,991=>410,992=>687,993=>544,1008=>534,1009=>534,1010=>485,1011=>278, -1012=>722,1013=>280,1014=>280,1015=>610,1016=>500,1017=>704,1018=>832,1019=>703,1020=>533,1021=>704, -1022=>704,1023=>704,1024=>604,1025=>604,1026=>668,1027=>611,1028=>666,1029=>500,1030=>339,1031=>339, -1032=>444,1033=>972,1034=>977,1035=>703,1036=>664,1037=>720,1038=>728,1039=>728,1040=>611,1041=>610, -1042=>611,1043=>611,1044=>682,1045=>604,1046=>976,1047=>592,1048=>720,1049=>720,1050=>664,1051=>719, -1052=>828,1053=>722,1054=>722,1055=>749,1056=>603,1057=>667,1058=>556,1059=>728,1060=>722,1061=>611, -1062=>728,1063=>666,1064=>997,1065=>1005,1066=>710,1067=>891,1068=>594,1069=>632,1070=>1024,1071=>696, -1072=>500,1073=>500,1074=>442,1075=>344,1076=>503,1077=>440,1078=>932,1079=>402,1080=>500,1081=>500, -1082=>491,1083=>487,1084=>624,1085=>500,1086=>500,1087=>500,1088=>500,1089=>441,1090=>722,1091=>500, -1092=>741,1093=>444,1094=>500,1095=>500,1096=>750,1097=>750,1098=>545,1099=>683,1100=>433,1101=>432, -1102=>700,1103=>503,1104=>440,1105=>440,1106=>500,1107=>344,1108=>442,1109=>389,1110=>278,1111=>278, -1112=>278,1113=>686,1114=>696,1115=>500,1116=>491,1117=>500,1118=>500,1119=>500,1120=>964,1121=>684, -1122=>708,1123=>690,1124=>975,1125=>646,1126=>800,1127=>628,1128=>1096,1129=>795,1130=>952,1131=>730, -1132=>1260,1133=>892,1134=>574,1135=>400,1136=>812,1137=>694,1138=>721,1139=>500,1140=>745,1141=>533, -1142=>745,1143=>533,1144=>1193,1145=>967,1146=>868,1147=>602,1148=>964,1149=>684,1150=>964,1151=>684, -1152=>548,1153=>443,1154=>320,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>0,1161=>0, -1162=>720,1163=>500,1164=>602,1165=>433,1166=>611,1167=>500,1168=>552,1169=>424,1170=>593,1171=>424, -1172=>611,1173=>432,1174=>992,1175=>932,1176=>592,1177=>396,1178=>681,1179=>491,1180=>700,1181=>532, -1182=>664,1183=>491,1184=>776,1185=>690,1186=>729,1187=>500,1188=>908,1189=>660,1190=>1034,1191=>694, -1192=>667,1193=>531,1194=>666,1195=>443,1196=>556,1197=>775,1198=>556,1199=>574,1200=>555,1201=>574, -1202=>660,1203=>443,1204=>798,1205=>581,1206=>674,1207=>500,1208=>690,1209=>516,1210=>640,1211=>500, -1212=>785,1213=>558,1214=>787,1215=>559,1216=>339,1217=>976,1218=>932,1219=>664,1220=>491,1221=>719, -1222=>487,1223=>722,1224=>500,1225=>722,1226=>500,1227=>666,1228=>500,1229=>828,1230=>624,1231=>339, -1232=>611,1233=>500,1234=>611,1235=>500,1236=>889,1237=>667,1238=>604,1239=>444,1240=>722,1241=>444, -1242=>722,1243=>444,1244=>976,1245=>932,1246=>592,1247=>402,1248=>525,1249=>446,1250=>720,1251=>500, -1252=>720,1253=>500,1254=>722,1255=>500,1256=>722,1257=>500,1258=>722,1259=>500,1260=>632,1261=>432, -1262=>728,1263=>500,1264=>728,1265=>500,1266=>728,1267=>500,1268=>666,1269=>500,1270=>611,1271=>424, -1272=>891,1273=>683,1296=>532,1297=>409,1298=>719,1299=>487,1306=>722,1307=>500,1308=>833,1309=>656, -1310=>664,1311=>491,1425=>0,1426=>0,1427=>0,1428=>0,1429=>0,1430=>0,1431=>418,1432=>0, -1433=>0,1434=>0,1435=>0,1436=>0,1437=>0,1438=>0,1439=>0,1440=>0,1441=>0,1442=>0, -1443=>0,1444=>0,1445=>0,1446=>0,1447=>0,1448=>0,1449=>0,1450=>0,1451=>0,1452=>0, -1453=>0,1454=>0,1455=>0,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0, -1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>440,1471=>0,1472=>126, -1473=>0,1474=>0,1475=>418,1476=>0,1477=>0,1478=>350,1479=>0,1488=>537,1489=>537,1490=>350, -1491=>537,1492=>537,1493=>350,1494=>350,1495=>537,1496=>537,1497=>350,1498=>537,1499=>537,1500=>537, -1501=>537,1502=>537,1503=>350,1504=>350,1505=>537,1506=>537,1507=>537,1508=>537,1509=>537,1510=>537, -1511=>537,1512=>537,1513=>537,1514=>537,1520=>537,1521=>537,1522=>537,1523=>396,1524=>396,2404=>318, -2405=>446,2433=>0,2434=>300,2435=>312,2437=>594,2438=>776,2439=>469,2440=>513,2441=>535,2442=>561, -2443=>604,2444=>481,2447=>580,2448=>604,2451=>540,2452=>620,2453=>570,2454=>485,2455=>484,2456=>471, -2457=>457,2458=>408,2459=>452,2460=>591,2461=>551,2462=>771,2463=>414,2464=>404,2465=>522,2466=>415, -2467=>450,2468=>551,2469=>477,2470=>478,2471=>449,2472=>448,2474=>535,2475=>611,2476=>443,2477=>534, -2478=>492,2479=>474,2480=>442,2482=>542,2486=>507,2487=>467,2488=>523,2489=>419,2492=>0,2493=>419, -2494=>202,2495=>189,2496=>202,2497=>0,2498=>0,2499=>0,2500=>0,2503=>294,2504=>289,2507=>774, -2508=>825,2509=>0,2510=>356,2519=>219,2524=>523,2525=>420,2527=>469,2528=>604,2529=>481,2530=>0, -2531=>0,2534=>500,2535=>437,2536=>479,2537=>507,2538=>497,2539=>500,2540=>482,2541=>503,2542=>517, -2543=>481,2544=>443,2545=>443,2546=>429,2547=>383,2548=>432,2549=>478,2550=>539,2551=>158,2552=>365, -2553=>280,2554=>357,3585=>512,3586=>453,3587=>512,3588=>519,3589=>529,3590=>561,3591=>411,3592=>437, -3593=>552,3594=>452,3595=>509,3596=>707,3597=>707,3598=>574,3599=>570,3600=>406,3601=>607,3602=>686, -3603=>749,3604=>494,3605=>497,3606=>509,3607=>552,3608=>461,3609=>565,3610=>527,3611=>523,3612=>556, -3613=>551,3614=>570,3615=>570,3616=>571,3617=>531,3618=>493,3619=>433,3620=>513,3621=>491,3622=>571, -3623=>439,3624=>510,3625=>594,3626=>484,3627=>554,3628=>616,3629=>493,3630=>496,3631=>417,3632=>392, -3633=>0,3634=>366,3635=>366,3636=>0,3637=>0,3638=>0,3639=>0,3640=>0,3641=>0,3642=>0, -3647=>662,3648=>297,3649=>544,3650=>298,3651=>329,3652=>328,3653=>326,3654=>488,3655=>0,3656=>0, -3657=>0,3658=>0,3659=>0,3660=>0,3661=>0,3662=>0,3663=>725,3664=>624,3665=>624,3666=>624, -3667=>624,3668=>624,3669=>624,3670=>624,3671=>624,3672=>624,3673=>624,3674=>645,3675=>872,4256=>453, -4257=>448,4258=>546,4259=>619,4260=>478,4261=>481,4262=>459,4263=>707,4264=>467,4265=>471,4266=>842, -4267=>464,4268=>443,4269=>707,4270=>460,4271=>465,4272=>686,4273=>440,4274=>550,4275=>561,4276=>580, -4277=>467,4278=>630,4279=>466,4280=>517,4281=>456,4282=>502,4283=>464,4284=>534,4285=>440,4286=>443, -4287=>522,4288=>460,4289=>463,4290=>536,4291=>455,4292=>468,4293=>449,4304=>454,4305=>452,4306=>544, -4307=>629,4308=>451,4309=>452,4310=>452,4311=>702,4312=>451,4313=>452,4314=>820,4315=>451,4316=>453, -4317=>695,4318=>449,4319=>448,4320=>694,4321=>501,4322=>544,4323=>517,4324=>560,4325=>450,4326=>627, -4327=>452,4328=>491,4329=>452,4330=>485,4331=>452,4332=>485,4333=>443,4334=>500,4335=>582,4336=>455, -4337=>451,4338=>480,4339=>414,4340=>453,4341=>418,4345=>544,4347=>410,5024=>711,5025=>678,5026=>604, -5027=>667,5028=>796,5029=>301,5030=>516,5031=>544,5032=>457,5033=>716,5034=>703,5035=>383,5036=>628, -5037=>709,5038=>455,5039=>601,5040=>472,5041=>574,5042=>730,5043=>939,5044=>498,5045=>528,5046=>667, -5047=>891,5048=>505,5049=>792,5050=>957,5051=>725,5052=>595,5053=>733,5054=>698,5055=>638,5056=>720, -5057=>732,5058=>624,5059=>638,5060=>565,5061=>903,5062=>655,5063=>681,5064=>675,5065=>949,5066=>683, -5067=>547,5068=>693,5069=>732,5070=>529,5071=>569,5072=>536,5073=>677,5074=>631,5075=>382,5076=>973, -5077=>543,5078=>607,5079=>652,5080=>652,5081=>693,5082=>514,5083=>803,5084=>658,5085=>597,5086=>627, -5087=>659,5088=>679,5089=>706,5090=>563,5091=>618,5092=>767,5093=>776,5094=>731,5095=>492,5096=>808, -5097=>823,5098=>796,5099=>689,5100=>716,5101=>518,5102=>521,5103=>719,5104=>563,5105=>776,5106=>634, -5107=>822,5108=>621,7680=>611,7681=>500,7682=>611,7683=>500,7684=>611,7685=>500,7686=>611,7687=>500, -7688=>667,7689=>444,7690=>722,7691=>500,7692=>722,7693=>500,7694=>722,7695=>500,7696=>722,7697=>500, -7698=>722,7699=>500,7700=>611,7701=>444,7702=>611,7703=>444,7704=>604,7705=>444,7706=>604,7707=>444, -7708=>604,7709=>444,7710=>611,7711=>278,7712=>722,7713=>500,7714=>722,7715=>500,7716=>722,7717=>500, -7718=>722,7719=>500,7720=>722,7721=>500,7722=>722,7723=>500,7724=>339,7725=>278,7726=>333,7727=>278, -7728=>652,7729=>444,7730=>652,7731=>444,7732=>652,7733=>444,7734=>556,7735=>278,7736=>556,7737=>278, -7738=>556,7739=>278,7740=>556,7741=>278,7742=>828,7743=>722,7744=>828,7745=>722,7746=>828,7747=>722, -7748=>657,7749=>500,7750=>657,7751=>500,7752=>657,7753=>500,7754=>657,7755=>500,7756=>722,7757=>500, -7758=>722,7759=>500,7760=>722,7761=>500,7762=>722,7763=>500,7764=>603,7765=>500,7766=>603,7767=>500, -7768=>616,7769=>389,7770=>616,7771=>389,7772=>616,7773=>389,7774=>616,7775=>389,7776=>500,7777=>389, -7778=>500,7779=>389,7780=>500,7781=>389,7782=>500,7783=>389,7784=>500,7785=>389,7786=>556,7787=>278, -7788=>556,7789=>278,7790=>556,7791=>278,7792=>556,7793=>278,7794=>722,7795=>500,7796=>722,7797=>500, -7798=>722,7799=>500,7800=>722,7801=>500,7802=>722,7803=>500,7804=>611,7805=>444,7806=>611,7807=>444, -7808=>833,7809=>667,7810=>833,7811=>667,7812=>833,7813=>667,7814=>833,7815=>667,7816=>833,7817=>667, -7818=>611,7819=>444,7820=>611,7821=>444,7822=>556,7823=>444,7824=>556,7825=>389,7826=>556,7827=>389, -7828=>556,7829=>389,7830=>500,7831=>278,7832=>667,7833=>444,7834=>444,7835=>278,7840=>611,7841=>500, -7842=>611,7843=>500,7844=>611,7845=>500,7846=>611,7847=>500,7848=>611,7849=>500,7850=>611,7851=>500, -7852=>611,7853=>500,7854=>611,7855=>500,7856=>611,7857=>500,7858=>611,7859=>500,7860=>611,7861=>500, -7862=>611,7863=>500,7864=>604,7865=>444,7866=>604,7867=>444,7868=>604,7869=>444,7870=>611,7871=>444, -7872=>611,7873=>444,7874=>611,7875=>444,7876=>611,7877=>444,7878=>604,7879=>444,7880=>339,7881=>278, -7882=>339,7883=>278,7884=>722,7885=>500,7886=>722,7887=>500,7888=>722,7889=>500,7890=>722,7891=>500, -7892=>722,7893=>500,7894=>722,7895=>500,7896=>722,7897=>500,7898=>932,7899=>608,7900=>932,7901=>608, -7902=>807,7903=>585,7904=>932,7905=>608,7906=>932,7907=>608,7908=>722,7909=>500,7910=>722,7911=>500, -7912=>948,7913=>721,7914=>948,7915=>721,7916=>807,7917=>585,7918=>948,7919=>721,7920=>948,7921=>721, -7922=>556,7923=>444,7924=>556,7925=>444,7926=>556,7927=>444,7928=>556,7929=>444,7936=>564,7937=>564, -7938=>564,7939=>564,7940=>564,7941=>564,7942=>564,7943=>564,7944=>661,7945=>661,7946=>794,7947=>811, -7948=>792,7949=>803,7950=>661,7951=>648,7952=>416,7953=>416,7954=>416,7955=>416,7956=>416,7957=>416, -7960=>740,7961=>795,7962=>923,7963=>940,7964=>996,7965=>986,7968=>506,7969=>506,7970=>506,7971=>506, -7972=>506,7973=>506,7974=>506,7975=>506,7976=>879,7977=>901,7978=>1036,7979=>1035,7980=>1099,7981=>1100, -7982=>954,7983=>959,7984=>270,7985=>270,7986=>267,7987=>267,7988=>267,7989=>267,7990=>267,7991=>267, -7992=>490,7993=>529,7994=>655,7995=>654,7996=>705,7997=>713,7998=>570,7999=>573,8000=>558,8001=>510, -8002=>510,8003=>510,8004=>510,8005=>510,8008=>797,8009=>867,8010=>1026,8011=>1022,8012=>993,8013=>1017, -8016=>504,8017=>504,8018=>504,8019=>504,8020=>504,8021=>504,8022=>504,8023=>504,8025=>916,8027=>1062, -8029=>1100,8031=>933,8032=>693,8033=>693,8034=>693,8035=>693,8036=>693,8037=>693,8038=>693,8039=>693, -8040=>852,8041=>909,8042=>1072,8043=>1072,8044=>1032,8045=>1047,8046=>930,8047=>946,8048=>564,8049=>564, -8050=>416,8051=>416,8052=>506,8053=>506,8054=>270,8055=>270,8056=>510,8057=>510,8058=>504,8059=>504, -8060=>693,8061=>693,8064=>564,8065=>564,8066=>564,8067=>564,8068=>564,8069=>564,8070=>564,8071=>564, -8072=>821,8073=>854,8074=>998,8075=>1011,8076=>992,8077=>1001,8078=>866,8079=>858,8080=>506,8081=>506, -8082=>506,8083=>506,8084=>506,8085=>506,8086=>506,8087=>506,8088=>999,8089=>1044,8090=>1179,8091=>1165, -8092=>1227,8093=>1229,8094=>1080,8095=>1085,8096=>693,8097=>693,8098=>693,8099=>693,8100=>693,8101=>693, -8102=>693,8103=>693,8104=>1037,8105=>1113,8106=>1264,8107=>1264,8108=>1219,8109=>1241,8110=>1120,8111=>1132, -8112=>564,8113=>564,8114=>564,8115=>564,8116=>564,8118=>564,8119=>564,8120=>661,8121=>661,8122=>661, -8123=>661,8124=>831,8125=>192,8126=>332,8127=>500,8128=>500,8129=>534,8130=>506,8131=>506,8132=>506, -8134=>506,8135=>506,8136=>611,8137=>816,8138=>889,8139=>908,8140=>881,8141=>500,8142=>500,8143=>500, -8144=>270,8145=>270,8146=>270,8147=>270,8150=>270,8151=>270,8152=>333,8153=>333,8154=>497,8155=>521, -8157=>500,8158=>500,8159=>500,8160=>504,8161=>504,8162=>504,8163=>504,8164=>506,8165=>506,8166=>504, -8167=>504,8168=>676,8169=>676,8170=>905,8171=>901,8172=>783,8173=>333,8174=>333,8175=>500,8178=>693, -8179=>693,8180=>693,8182=>693,8183=>693,8184=>907,8185=>833,8186=>963,8187=>875,8188=>952,8189=>500, -8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>333,8197=>250,8198=>167,8199=>500,8200=>250, -8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>333,8209=>333,8210=>500, -8213=>1000,8214=>293,8215=>465,8219=>250,8223=>444,8227=>350,8228=>250,8229=>500,8231=>250,8232=>0, -8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>250,8241=>1601,8242=>247,8243=>411, -8244=>611,8245=>220,8246=>440,8247=>660,8248=>469,8251=>629,8252=>666,8253=>500,8254=>500,8255=>953, -8256=>1000,8257=>314,8258=>931,8259=>333,8260=>167,8261=>480,8262=>480,8263=>1000,8264=>833,8265=>833, -8266=>500,8267=>453,8268=>453,8269=>450,8270=>500,8271=>278,8272=>882,8273=>500,8274=>497,8275=>500, -8276=>953,8277=>512,8278=>410,8279=>855,8280=>620,8281=>620,8282=>179,8283=>621,8284=>564,8285=>179, -8286=>179,8287=>111,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8304=>300,8305=>235,8308=>300, -8309=>300,8310=>300,8311=>300,8312=>300,8313=>300,8314=>300,8315=>300,8316=>300,8317=>216,8318=>216, -8319=>318,8320=>300,8321=>250,8322=>300,8323=>300,8324=>300,8325=>300,8326=>300,8327=>300,8328=>300, -8329=>300,8330=>300,8331=>300,8332=>300,8333=>216,8334=>216,8352=>698,8353=>667,8354=>667,8355=>611, -8356=>500,8357=>722,8358=>667,8359=>988,8360=>953,8361=>833,8362=>869,8363=>512,8365=>722,8366=>611, -8369=>589,8370=>619,8371=>722,8372=>556,8373=>611,8400=>0,8401=>0,8402=>0,8403=>0,8404=>0, -8405=>0,8406=>0,8407=>0,8408=>0,8409=>0,8410=>0,8411=>0,8412=>0,8413=>0,8414=>0, -8415=>0,8416=>0,8417=>0,8418=>0,8419=>0,8420=>0,8421=>0,8422=>0,8423=>0,8424=>0, -8425=>0,8426=>0,8427=>0,8428=>0,8429=>0,8430=>0,8431=>0,8432=>0,8448=>664,8449=>665, -8451=>954,8453=>693,8454=>787,8457=>822,8462=>500,8463=>500,8468=>777,8470=>823,8471=>760,8478=>616, -8479=>610,8480=>879,8481=>1156,8483=>611,8486=>743,8487=>743,8489=>286,8490=>722,8491=>722,8494=>533, -8498=>556,8501=>537,8502=>537,8503=>350,8504=>537,8506=>906,8507=>1155,8523=>778,8525=>856,8526=>500, -8531=>750,8532=>750,8533=>750,8534=>750,8535=>750,8536=>750,8537=>750,8538=>750,8539=>750,8540=>750, -8541=>750,8542=>750,8543=>750,8544=>339,8545=>678,8546=>1017,8547=>950,8548=>611,8549=>950,8550=>1289, -8551=>1628,8552=>950,8553=>611,8554=>950,8555=>1289,8556=>556,8557=>667,8558=>722,8559=>828,8560=>278, -8561=>556,8562=>834,8563=>722,8564=>444,8565=>722,8566=>1000,8567=>1278,8568=>722,8569=>444,8570=>722, -8571=>1000,8572=>278,8573=>444,8574=>500,8575=>722,8592=>964,8593=>499,8594=>964,8595=>499,8706=>494, -8710=>612,8721=>713,8722=>675,8723=>675,8725=>750,8730=>549,8734=>677,8747=>416,8748=>750,8749=>1083, -8750=>722,8751=>750,8800=>564,8804=>675,8805=>675,8992=>686,8993=>686,9251=>500,9674=>494,9676=>791, -9824=>626,9825=>694,9826=>595,9827=>776,9828=>626,9829=>694,9830=>595,9831=>776,9833=>333,9834=>555, -9835=>722,9836=>722,9837=>415,9838=>377,9839=>402,11799=>333,64256=>526,64257=>500,64258=>500,64259=>747, -64260=>748,64262=>665,64285=>350,64286=>0,64287=>537,64288=>537,64297=>564,64298=>537,64299=>537,64300=>537, -64301=>537,64302=>537,64303=>537,64304=>537,64305=>537,64306=>350,64307=>537,64308=>537,64309=>350,64310=>350, -64312=>537,64313=>350,64314=>537,64315=>537,64316=>537,64318=>537,64320=>350,64321=>537,64323=>537,64324=>537, -64326=>537,64327=>537,64328=>537,64329=>537,64330=>537,64331=>350,64332=>537,64333=>537,64334=>537,64335=>537, -65533=>788); -$enc=''; -$diff=''; -$file='freeserifi.z'; -$ctg='freeserifi.ctg.z'; -$originalsize=629968; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.z b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.z deleted file mode 100644 index c191bde42a..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/freeserifi.z and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helvetica.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helvetica.php deleted file mode 100644 index c5eba6d68f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helvetica.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=556; -$cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278, -10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278, -20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278, -30=>278,31=>278,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191, -40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556, -50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278, -60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667, -70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, -80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667, -90=>611,91=>278,92=>278,93=>278,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500, -100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222, -109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556, -118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584, -127=>350,128=>556,129=>350,130=>222,131=>556,132=>333,133=>1000,134=>556,135=>556, -136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350, -145=>222,146=>222,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000, -154=>500,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556, -163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556, -172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333, -181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834, -190=>834,191=>611,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000, -199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778, -217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, -226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556, -235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556,242=>556,243=>556, -244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556, -253=>500,254=>556,255=>500); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticab.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticab.php deleted file mode 100644 index 8635a72746..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticab.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=556; -$cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278, -10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278, -20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278, -30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238, -40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556, -50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333, -60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667, -70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778, -80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667, -90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556, -100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278, -109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611, -118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584, -127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556, -136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350, -145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000, -154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556, -163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556, -172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333, -181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834, -190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000, -199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778, -217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, -226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556, -235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611, -244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611, -253=>556,254=>611,255=>556); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticabi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticabi.php deleted file mode 100644 index 8635a72746..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticabi.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=556; -$cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278, -10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278, -20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278, -30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238, -40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556, -50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333, -60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667, -70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778, -80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667, -90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556, -100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278, -109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611, -118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584, -127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556, -136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350, -145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000, -154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556, -163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556, -172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333, -181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834, -190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000, -199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778, -217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, -226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556, -235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611, -244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611, -253=>556,254=>611,255=>556); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticai.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticai.php deleted file mode 100644 index c5eba6d68f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/helveticai.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=556; -$cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278, -10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278, -20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278, -30=>278,31=>278,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191, -40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556, -50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278, -60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667, -70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778, -80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667, -90=>611,91=>278,92=>278,93=>278,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500, -100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222, -109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556, -118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584, -127=>350,128=>556,129=>350,130=>222,131=>556,132=>333,133=>1000,134=>556,135=>556, -136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350, -145=>222,146=>222,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000, -154=>500,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556, -163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556, -172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333, -181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834, -190=>834,191=>611,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000, -199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778, -217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556, -226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556, -235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556,242=>556,243=>556, -244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556, -253=>500,254=>556,255=>500); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/hysmyeongjostdmedium.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/hysmyeongjostdmedium.php deleted file mode 100644 index 9e8b23b426..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/hysmyeongjostdmedium.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -$type='cidfont0'; -$name='HYSMyeongJoStd-Medium-Acro'; // AdobeMyungjoStd-Medium-Acro in acrobat 6 -$displayname = 'MyungJo Medium (Korean)'; -$desc = array( - 'Ascent' => 880, - 'Descent' => -120, - 'CapHeight' => 720, - 'Flags' => 6, - 'FontBBox' => '[-28 -148 1001 880]', - 'ItalicAngle' => 0, - 'StemV' => 60, - 'Style' => '<< /Panose <000000000600000000000000> >>', -); -$cidinfo = array( - 'Registry' => 'Adobe', - 'Ordering' => 'Korea1', - 'Supplement' => '1', -); -$enc = 'UniKS-UCS2-H'; - -// underline position, needs checking: -$up = -130; -$ut = 40; - -$dw = 1000; -$cw = array( - 32 => 333, 33 => 416, 34 => 416, 35 => 833, 36 => 625, 37 => 916, 38 => 833, 39 => 250, 40 => 500, 41 => 500, - 42 => 500, 43 => 833, 44 => 291, 45 => 450, 46 => 291, 47 => 375, 48 => 625, 49 => 625, 50 => 625, 51 => 625, - 52 => 625, 53 => 625, 54 => 625, 55 => 625, 56 => 625, 57 => 625, 58 => 333, 59 => 333, 60 => 833, 61 => 833, - 62 => 916, 63 => 500, 64 => 1000, 65 => 791, 66 => 708, 67 => 708, 68 => 750, 69 => 708, 70 => 666, 71 => 750, - 72 => 791, 73 => 375, 74 => 500, 75 => 791, 76 => 666, 77 => 916, 78 => 791, 79 => 750, 80 => 666, 81 => 750, - 82 => 708, 83 => 666, 84 => 791, 85 => 791, 86 => 750, 87 => 1000, 88 => 708, 89 => 708, 90 => 666, 91 => 500, - 92 => 375, 93 => 500, 94 => 500, 95 => 500, 96 => 333, 97 => 541, 98 => 583, 99 => 541, 100 => 583, 101 => 583, - 102 => 375, 103 => 583, 104 => 583, 105 => 291, 106 => 333, 107 => 583, 108 => 291, 109 => 875, 110 => 583, 111 => 583, - 112 => 583, 113 => 583, 114 => 458, 115 => 541, 116 => 375, 117 => 583, 118 => 583, 119 => 833, 120 => 625, 121 => 625, - 122 => 500, 123 => 583, 124 => 583, 125 => 583, 126 => 750, -); -$_cr = array( - //array(97, 97, 500), - array(8094, 8190, 500) -); -foreach($_cr as $_r) { - for($i = $_r[0]; $i <= $_r[1]; $i++) { - $cw[$i+31] = $_r[2]; - } -} -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozgopromedium.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozgopromedium.php deleted file mode 100644 index 72783b7609..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozgopromedium.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -$type = 'cidfont0'; -$name = 'KozGoPro-Medium-Acro'; -$displayname = 'Kozuka Gothic Pro (Japanese Sans-Serif)'; -$desc = array( - 'Ascent' => 880, - 'Descent' => -120, - 'CapHeight' => 763, - 'Flags' => 4, - 'FontBBox' => '[-149 -374 1254 1008]', - 'ItalicAngle' => 0, - 'StemV' => 99, - 'Style' => '<< /Panose <0000020b0700000000000000> >>', - 'XHeight' => 549, -); -$cidinfo = array( - 'Registry' => 'Adobe', - 'Ordering' => 'Japan1', - 'Supplement' => '4', -); -$enc = 'UniJIS-UCS2-H'; - -// underline position, needs checking: -$up = -75; -$ut = 50; - -$dw = 1000; -$cw = array( - 32 => 224, 33 => 266, 34 => 392, 35 => 551, 36 => 562, 37 => 883, 38 => 677, 39 => 213, 40 => 322, 41 => 322, - 42 => 470, 43 => 677, 44 => 247, 45 => 343, 46 => 245, 47 => 370, 48 => 562, 49 => 562, 50 => 562, 51 => 562, - 52 => 562, 53 => 562, 54 => 562, 55 => 562, 56 => 562, 57 => 562, 58 => 245, 59 => 247, 60 => 677, 61 => 677, - 62 => 677, 63 => 447, 64 => 808, 65 => 661, 66 => 602, 67 => 610, 68 => 708, 69 => 535, 70 => 528, 71 => 689, - 72 => 703, 73 => 275, 74 => 404, 75 => 602, 76 => 514, 77 => 871, 78 => 708, 79 => 727, 80 => 585, 81 => 727, - 82 => 595, 83 => 539, 84 => 541, 85 => 696, 86 => 619, 87 => 922, 88 => 612, 89 => 591, 90 => 584, 91 => 322, - 92 => 562, 93 => 322, 94 => 677, 95 => 568, 96 => 340, 97 => 532, 98 => 612, 99 => 475, 100 => 608, 101 => 543, - 102 => 332, 103 => 603, 104 => 601, 105 => 265, 106 => 276, 107 => 524, 108 => 264, 109 => 901, 110 => 601, 111 => 590, - 112 => 612, 113 => 607, 114 => 367, 115 => 433, 116 => 369, 117 => 597, 118 => 527, 119 => 800, 120 => 511, 121 => 518, - 122 => 468, 123 => 321, 124 => 273, 125 => 321, 126 => 341, 127 => 241, 128 => 362, 129 => 241, 130 => 273, 131 => 677, - 132 => 266, 133 => 562, 134 => 562, 135 => 456, 136 => 562, 137 => 571, 138 => 562, 139 => 416, 140 => 472, 141 => 283, - 142 => 283, 143 => 587, 144 => 588, 145 => 568, 146 => 545, 147 => 545, 148 => 247, 149 => 561, 150 => 330, 151 => 239, - 152 => 418, 153 => 416, 154 => 472, 155 => 1136, 156 => 1288, 157 => 447, 158 => 340, 159 => 340, 160 => 340, 161 => 340, - 162 => 340, 163 => 340, 164 => 455, 165 => 340, 166 => 340, 167 => 340, 168 => 340, 169 => 1136, 170 => 857, 171 => 384, - 172 => 519, 173 => 727, 174 => 952, 175 => 398, 176 => 834, 177 => 264, 178 => 275, 179 => 590, 180 => 918, 181 => 605, - 182 => 677, 183 => 769, 184 => 677, 185 => 473, 186 => 361, 187 => 677, 188 => 347, 189 => 340, 190 => 599, 191 => 284, - 192 => 845, 193 => 845, 194 => 845, 195 => 661, 196 => 661, 197 => 661, 198 => 661, 199 => 661, 200 => 661, 201 => 610, - 202 => 535, 203 => 535, 204 => 535, 205 => 535, 206 => 275, 207 => 275, 208 => 275, 209 => 275, 210 => 715, 211 => 708, - 212 => 727, 213 => 727, 214 => 727, 215 => 727, 216 => 727, 217 => 677, 218 => 696, 219 => 696, 220 => 696, 221 => 696, - 222 => 591, 223 => 584, 224 => 532, 225 => 532, 226 => 532, 227 => 532, 228 => 532, 229 => 532, 230 => 475, 231 => 543, - 232 => 543, 233 => 543, 234 => 543, 235 => 264, 236 => 264, 237 => 264, 238 => 264, 239 => 584, 240 => 601, 241 => 590, - 242 => 590, 243 => 590, 244 => 590, 245 => 590, 246 => 677, 247 => 597, 248 => 597, 249 => 597, 250 => 597, 251 => 518, - 252 => 612, 253 => 518, 254 => 539, 255 => 591, 256 => 584, 257 => 446, 258 => 433, 259 => 683, 260 => 468, 261 => 562, -); -$_cr = array( - array(231, 632, 500), // half-width - array(8718, 8718, 500), - array(9738, 9757, 250), // quarter-width - array(9758, 9778, 333), // third-width - array(12063, 12087, 500) -); -foreach($_cr as $_r) { - for($i = $_r[0]; $i <= $_r[1]; $i++) { - $cw[$i+31] = $_r[2]; - } -} -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozminproregular.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozminproregular.php deleted file mode 100644 index c308d41db8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/kozminproregular.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -$type = 'cidfont0'; -$name = 'KozMinPro-Regular-Acro'; -$displayname = 'Kozuka Mincho Pro (Japanese Serif)'; -$desc = array( - 'Ascent' => 880, - 'Descent' => -120, - 'CapHeight' => 740, - 'Flags' => 6, - 'FontBBox' => '[-195 -272 1110 1075]', - 'ItalicAngle' => 0, - 'StemV' => 86, - 'XHeight' => 502, -); -$cidinfo = array( - 'Registry' => 'Adobe', - 'Ordering' => 'Japan1', - 'Supplement' => '4', -); -$enc = 'UniJIS-UCS2-H'; - -$up = -75; -$ut = 50; - -$dw = 1000; -$cw = array( - 32 => 278, 33 => 299, 34 => 353, 35 => 614, 36 => 614, 37 => 721, 38 => 735, 39 => 216, 40 => 323, 41 => 323, - 42 => 449, 43 => 529, 44 => 219, 45 => 306, 46 => 219, 47 => 453, 48 => 614, 49 => 614, 50 => 614, 51 => 614, - 52 => 614, 53 => 614, 54 => 614, 55 => 614, 56 => 614, 57 => 614, 58 => 219, 59 => 219, 60 => 529, 61 => 529, - 62 => 529, 63 => 486, 64 => 744, 65 => 646, 66 => 604, 67 => 617, 68 => 681, 69 => 567, 70 => 537, 71 => 647, - 72 => 738, 73 => 320, 74 => 433, 75 => 637, 76 => 566, 77 => 904, 78 => 710, 79 => 716, 80 => 605, 81 => 716, - 82 => 623, 83 => 517, 84 => 601, 85 => 690, 86 => 668, 87 => 990, 88 => 681, 89 => 634, 90 => 578, 91 => 316, - 92 => 614, 93 => 316, 94 => 529, 95 => 500, 96 => 387, 97 => 509, 98 => 566, 99 => 478, 100 => 565, 101 => 503, - 102 => 337, 103 => 549, 104 => 580, 105 => 275, 106 => 266, 107 => 544, 108 => 276, 109 => 854, 110 => 579, 111 => 550, - 112 => 578, 113 => 566, 114 => 410, 115 => 444, 116 => 340, 117 => 575, 118 => 512, 119 => 760, 120 => 503, 121 => 529, - 122 => 453, 123 => 326, 124 => 380, 125 => 326, 126 => 387, 127 => 216, 128 => 453, 129 => 216, 130 => 380, 131 => 529, - 132 => 299, 133 => 614, 134 => 614, 135 => 265, 136 => 614, 137 => 475, 138 => 614, 139 => 353, 140 => 451, 141 => 291, - 142 => 291, 143 => 588, 144 => 589, 145 => 500, 146 => 476, 147 => 476, 148 => 219, 149 => 494, 150 => 452, 151 => 216, - 152 => 353, 153 => 353, 154 => 451, 156 => 1075, 157 => 486, 158 => 387, 159 => 387, 160 => 387, 161 => 387, - 162 => 387, 163 => 387, 164 => 387, 165 => 387, 166 => 387, 167 => 387, 168 => 387, 170 => 880, 171 => 448, - 172 => 566, 173 => 716, 174 => 903, 175 => 460, 176 => 805, 177 => 275, 178 => 276, 179 => 550, 180 => 886, 181 => 582, - 182 => 529, 183 => 738, 184 => 529, 185 => 738, 186 => 357, 187 => 529, 188 => 406, 189 => 406, 190 => 575, 191 => 406, - 192 => 934, 193 => 934, 194 => 934, 195 => 646, 196 => 646, 197 => 646, 198 => 646, 199 => 646, 200 => 646, 201 => 617, - 202 => 567, 203 => 567, 204 => 567, 205 => 567, 206 => 320, 207 => 320, 208 => 320, 209 => 320, 210 => 681, 211 => 710, - 212 => 716, 213 => 716, 214 => 716, 215 => 716, 216 => 716, 217 => 529, 218 => 690, 219 => 690, 220 => 690, 221 => 690, - 222 => 634, 223 => 605, 224 => 509, 225 => 509, 226 => 509, 227 => 509, 228 => 509, 229 => 509, 230 => 478, 231 => 503, - 232 => 503, 233 => 503, 234 => 503, 235 => 275, 236 => 275, 237 => 275, 238 => 275, 239 => 550, 240 => 579, 241 => 550, - 242 => 550, 243 => 550, 244 => 550, 245 => 550, 246 => 529, 247 => 575, 248 => 575, 249 => 575, 250 => 575, 251 => 529, - 252 => 578, 253 => 529, 254 => 517, 255 => 634, 256 => 578, 257 => 445, 258 => 444, 259 => 842, 260 => 453, 261 => 614, -); -$_cr = array( - array(231, 632, 500), // half-width - array(8718, 8718, 500), - array(9738, 9757, 250), // quarter-width - array(9758, 9778, 333), // third-width - array(12063, 12087, 500), -); -foreach($_cr as $_r) { - for($i = $_r[0]; $i <= $_r[1]; $i++) { - $cw[$i+31] = $_r[2]; - } -} -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/msungstdlight.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/msungstdlight.php deleted file mode 100644 index a71ea29536..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/msungstdlight.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -$type = 'cidfont0'; -$name = 'MSungStd-Light-Acro'; -$displayname = 'MSung Light (Trad. Chinese)'; -$desc = array( - 'Ascent' => 880, - 'Descent' => -120, - 'CapHeight' => 880, - 'Flags' => 6, - 'FontBBox' => '[-160 -249 1015 1071]', - 'ItalicAngle' => 0, - 'StemV' => 93, -); -$cidinfo = array( - 'Registry' => 'Adobe', - 'Ordering' => 'CNS1', - 'Supplement' => '3', -); -$enc = 'UniCNS-UCS2-H'; - -$up = -130; -$ut = 40; - -$dw = 1000; -$cw = array( - 32 => 250, 33 => 250, 34 => 408, 35 => 668, 36 => 490, 37 => 875, 38 => 698, 39 => 250, 40 => 240, 41 => 240, - 42 => 417, 43 => 667, 44 => 250, 45 => 313, 46 => 250, 47 => 520, 48 => 500, 49 => 500, 50 => 500, 51 => 500, - 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500, 57 => 500, 58 => 250, 59 => 250, 60 => 667, 61 => 667, - 62 => 667, 63 => 396, 64 => 921, 65 => 677, 66 => 615, 67 => 719, 68 => 760, 69 => 625, 70 => 552, 71 => 771, - 72 => 802, 73 => 354, 74 => 354, 75 => 781, 76 => 604, 77 => 927, 78 => 750, 79 => 823, 80 => 563, 81 => 823, - 82 => 729, 83 => 542, 84 => 698, 85 => 771, 86 => 729, 87 => 948, 88 => 771, 89 => 677, 90 => 635, 91 => 344, - 92 => 520, 93 => 344, 94 => 469, 95 => 500, 96 => 250, 97 => 469, 98 => 521, 99 => 427, 100 => 521, 101 => 438, - 102 => 271, 103 => 469, 104 => 531, 105 => 250, 106 => 250, 107 => 458, 108 => 240, 109 => 802, 110 => 531, 111 => 500, - 112 => 521, 113 => 521, 114 => 365, 115 => 333, 116 => 292, 117 => 521, 118 => 458, 119 => 677, 120 => 479, 121 => 458, - 122 => 427, 123 => 480, 124 => 496, 125 => 480, 126 => 667, - 17601 => 500, -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/stsongstdlight.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/stsongstdlight.php deleted file mode 100644 index 1c74c62d66..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/stsongstdlight.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -$type = 'cidfont0'; -$name = 'STSongStd-Light-Acro'; -$displayname = 'STSong Light (Simp. Chinese)'; -$desc = array( - 'Ascent' => 752, - 'Descent' => -271, - 'CapHeight' => 737, - 'Flags' => 6, - 'FontBBox' => '[-25 -254 1000 880]', - 'ItalicAngle' => 0, - 'StemV' => 58, - 'Style' => '<< /Panose <000000000400000000000000> >>', -); -$cidinfo = array( - 'Registry' => 'Adobe', - 'Ordering' => 'GB1', - 'Supplement' => '2', -); -$enc = 'UniGB-UCS2-H'; - -// underline position, needs checking: -$up = -130; -$ut = 40; - -$dw = 1000; -$cw = array( - 32 => 207, 33 => 270, 34 => 342, 35 => 467, 36 => 462, 37 => 797, 38 => 710, 39 => 239, 40 => 374, 41 => 374, - 42 => 423, 43 => 605, 44 => 238, 45 => 375, 46 => 238, 47 => 334, 48 => 462, 49 => 462, 50 => 462, 51 => 462, - 52 => 462, 53 => 462, 54 => 462, 55 => 462, 56 => 462, 57 => 462, 58 => 238, 59 => 238, 60 => 605, 61 => 605, - 62 => 605, 63 => 344, 64 => 748, 65 => 684, 66 => 560, 67 => 695, 68 => 739, 69 => 563, 70 => 511, 71 => 729, - 72 => 793, 73 => 318, 74 => 312, 75 => 666, 76 => 526, 77 => 896, 78 => 758, 79 => 772, 80 => 544, 81 => 772, - 82 => 628, 83 => 465, 84 => 607, 85 => 753, 86 => 711, 87 => 972, 88 => 647, 89 => 620, 90 => 607, 91 => 374, - 92 => 333, 93 => 374, 94 => 606, 95 => 500, 96 => 239, 97 => 417, 98 => 503, 99 => 427, 100 => 529, 101 => 415, - 102 => 264, 103 => 444, 104 => 518, 105 => 241, 106 => 230, 107 => 495, 108 => 228, 109 => 793, 110 => 527, 111 => 524, - 112 => 524, 113 => 504, 114 => 338, 115 => 336, 116 => 277, 117 => 517, 118 => 450, 119 => 652, 120 => 466, 121 => 452, - 122 => 407, 123 => 370, 124 => 258, 125 => 370, 126 => 605 -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/symbol.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/symbol.php deleted file mode 100644 index c45f288359..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/symbol.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=500; -$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, -10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, -20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, -30=>250,31=>250,32=>250,33=>333,34=>713,35=>500,36=>549,37=>833,38=>778,39=>439, -40=>333,41=>333,42=>500,43=>549,44=>250,45=>549,46=>250,47=>278,48=>500,49=>500, -50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278, -60=>549,61=>549,62=>549,63=>444,64=>549,65=>722,66=>667,67=>722,68=>612,69=>611, -70=>763,71=>603,72=>722,73=>333,74=>631,75=>722,76=>686,77=>889,78=>722,79=>722, -80=>768,81=>741,82=>556,83=>592,84=>611,85=>690,86=>439,87=>768,88=>645,89=>795, -90=>611,91=>333,92=>863,93=>333,94=>658,95=>500,96=>500,97=>631,98=>549,99=>549, -100=>494,101=>439,102=>521,103=>411,104=>603,105=>329,106=>603,107=>549,108=>549, -109=>576,110=>521,111=>549,112=>549,113=>521,114=>549,115=>603,116=>439,117=>576, -118=>713,119=>686,120=>493,121=>686,122=>494,123=>480,124=>200,125=>480,126=>549, -127=>0,128=>0,129=>0,130=>0,131=>0,132=>0,133=>0,134=>0,135=>0,136=>0,137=>0, -138=>0,139=>0,140=>0,141=>0,142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0, -149=>0,150=>0,151=>0,152=>0,153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0, -160=>750,161=>620,162=>247,163=>549,164=>167,165=>713,166=>500,167=>753,168=>753, -169=>753,170=>753,171=>1042,172=>987,173=>603,174=>987,175=>603,176=>400,177=>549, -178=>411,179=>549,180=>549,181=>713,182=>494,183=>460,184=>549,185=>549,186=>549, -187=>549,188=>1000,189=>603,190=>1000,191=>658,192=>823,193=>686,194=>795,195=>987, -196=>768,197=>768,198=>823,199=>768,200=>768,201=>713,202=>713,203=>713,204=>713, -205=>713,206=>713,207=>713,208=>768,209=>713,210=>790,211=>790,212=>890,213=>823, -214=>549,215=>250,216=>713,217=>603,218=>603,219=>1042,220=>987,221=>603,222=>987, -223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384, -232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>0, -241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384, -250=>384,251=>384,252=>494,253=>494,254=>494,255=>0); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/times.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/times.php deleted file mode 100644 index 9914386167..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/times.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=500; -$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, -10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, -20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, -30=>250,31=>250,32=>250,33=>333,34=>408,35=>500,36=>500,37=>833,38=>778,39=>180, -40=>333,41=>333,42=>500,43=>564,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500, -50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278, -60=>564,61=>564,62=>564,63=>444,64=>921,65=>722,66=>667,67=>667,68=>722,69=>611, -70=>556,71=>722,72=>722,73=>333,74=>389,75=>722,76=>611,77=>889,78=>722,79=>722, -80=>556,81=>722,82=>667,83=>556,84=>611,85=>722,86=>722,87=>944,88=>722,89=>722, -90=>611,91=>333,92=>278,93=>333,94=>469,95=>500,96=>333,97=>444,98=>500,99=>444, -100=>500,101=>444,102=>333,103=>500,104=>500,105=>278,106=>278,107=>500,108=>278, -109=>778,110=>500,111=>500,112=>500,113=>500,114=>333,115=>389,116=>278,117=>500, -118=>500,119=>722,120=>500,121=>500,122=>444,123=>480,124=>200,125=>480,126=>541, -127=>350,128=>500,129=>350,130=>333,131=>500,132=>444,133=>1000,134=>500,135=>500, -136=>333,137=>1000,138=>556,139=>333,140=>889,141=>350,142=>611,143=>350,144=>350, -145=>333,146=>333,147=>444,148=>444,149=>350,150=>500,151=>1000,152=>333,153=>980, -154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500, -163=>500,164=>500,165=>500,166=>200,167=>500,168=>333,169=>760,170=>276,171=>500, -172=>564,173=>333,174=>760,175=>333,176=>400,177=>564,178=>300,179=>300,180=>333, -181=>500,182=>453,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750, -190=>750,191=>444,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>889, -199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333, -208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>564,216=>722, -217=>722,218=>722,219=>722,220=>722,221=>722,222=>556,223=>500,224=>444,225=>444, -226=>444,227=>444,228=>444,229=>444,230=>667,231=>444,232=>444,233=>444,234=>444, -235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500, -244=>500,245=>500,246=>500,247=>564,248=>500,249=>500,250=>500,251=>500,252=>500, -253=>500,254=>500,255=>500); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesb.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesb.php deleted file mode 100644 index b6625be575..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesb.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=500; -$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, -10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, -20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, -30=>250,31=>250,32=>250,33=>333,34=>555,35=>500,36=>500,37=>1000,38=>833,39=>278, -40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500, -50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333, -60=>570,61=>570,62=>570,63=>500,64=>930,65=>722,66=>667,67=>722,68=>722,69=>667, -70=>611,71=>778,72=>778,73=>389,74=>500,75=>778,76=>667,77=>944,78=>722,79=>778, -80=>611,81=>778,82=>722,83=>556,84=>667,85=>722,86=>722,87=>1000,88=>722,89=>722, -90=>667,91=>333,92=>278,93=>333,94=>581,95=>500,96=>333,97=>500,98=>556,99=>444, -100=>556,101=>444,102=>333,103=>500,104=>556,105=>278,106=>333,107=>556,108=>278, -109=>833,110=>556,111=>500,112=>556,113=>556,114=>444,115=>389,116=>333,117=>556, -118=>500,119=>722,120=>500,121=>500,122=>444,123=>394,124=>220,125=>394,126=>520, -127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500, -136=>333,137=>1000,138=>556,139=>333,140=>1000,141=>350,142=>667,143=>350,144=>350, -145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000, -154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500, -163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>300,171=>500, -172=>570,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333, -181=>556,182=>540,183=>250,184=>333,185=>300,186=>330,187=>500,188=>750,189=>750, -190=>750,191=>500,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000, -199=>722,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389, -208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>570,216=>778, -217=>722,218=>722,219=>722,220=>722,221=>722,222=>611,223=>556,224=>500,225=>500, -226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444, -235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500, -244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556, -253=>500,254=>556,255=>500); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesbi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesbi.php deleted file mode 100644 index ff18a4b8ff..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesbi.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=500; -$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, -10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, -20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, -30=>250,31=>250,32=>250,33=>389,34=>555,35=>500,36=>500,37=>833,38=>778,39=>278, -40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500, -50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333, -60=>570,61=>570,62=>570,63=>500,64=>832,65=>667,66=>667,67=>667,68=>722,69=>667, -70=>667,71=>722,72=>778,73=>389,74=>500,75=>667,76=>611,77=>889,78=>722,79=>722, -80=>611,81=>722,82=>667,83=>556,84=>611,85=>722,86=>667,87=>889,88=>667,89=>611, -90=>611,91=>333,92=>278,93=>333,94=>570,95=>500,96=>333,97=>500,98=>500,99=>444, -100=>500,101=>444,102=>333,103=>500,104=>556,105=>278,106=>278,107=>500,108=>278, -109=>778,110=>556,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>556, -118=>444,119=>667,120=>500,121=>444,122=>389,123=>348,124=>220,125=>348,126=>570, -127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500, -136=>333,137=>1000,138=>556,139=>333,140=>944,141=>350,142=>611,143=>350,144=>350, -145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000, -154=>389,155=>333,156=>722,157=>350,158=>389,159=>611,160=>250,161=>389,162=>500, -163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>266,171=>500, -172=>606,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333, -181=>576,182=>500,183=>250,184=>333,185=>300,186=>300,187=>500,188=>750,189=>750, -190=>750,191=>500,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>944, -199=>667,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389, -208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>570,216=>722, -217=>722,218=>722,219=>722,220=>722,221=>611,222=>611,223=>500,224=>500,225=>500, -226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444, -235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500, -244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556, -253=>444,254=>500,255=>444); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesi.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesi.php deleted file mode 100644 index c86d3ab6a0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/timesi.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=500; -$cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250, -10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250, -20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250, -30=>250,31=>250,32=>250,33=>333,34=>420,35=>500,36=>500,37=>833,38=>778,39=>214, -40=>333,41=>333,42=>500,43=>675,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500, -50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333, -60=>675,61=>675,62=>675,63=>500,64=>920,65=>611,66=>611,67=>667,68=>722,69=>611, -70=>611,71=>722,72=>722,73=>333,74=>444,75=>667,76=>556,77=>833,78=>667,79=>722, -80=>611,81=>722,82=>611,83=>500,84=>556,85=>722,86=>611,87=>833,88=>611,89=>556, -90=>556,91=>389,92=>278,93=>389,94=>422,95=>500,96=>333,97=>500,98=>500,99=>444, -100=>500,101=>444,102=>278,103=>500,104=>500,105=>278,106=>278,107=>444,108=>278, -109=>722,110=>500,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>500, -118=>444,119=>667,120=>444,121=>444,122=>389,123=>400,124=>275,125=>400,126=>541, -127=>350,128=>500,129=>350,130=>333,131=>500,132=>556,133=>889,134=>500,135=>500, -136=>333,137=>1000,138=>500,139=>333,140=>944,141=>350,142=>556,143=>350,144=>350, -145=>333,146=>333,147=>556,148=>556,149=>350,150=>500,151=>889,152=>333,153=>980, -154=>389,155=>333,156=>667,157=>350,158=>389,159=>556,160=>250,161=>389,162=>500, -163=>500,164=>500,165=>500,166=>275,167=>500,168=>333,169=>760,170=>276,171=>500, -172=>675,173=>333,174=>760,175=>333,176=>400,177=>675,178=>300,179=>300,180=>333, -181=>500,182=>523,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750, -190=>750,191=>500,192=>611,193=>611,194=>611,195=>611,196=>611,197=>611,198=>889, -199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333, -208=>722,209=>667,210=>722,211=>722,212=>722,213=>722,214=>722,215=>675,216=>722, -217=>722,218=>722,219=>722,220=>722,221=>556,222=>611,223=>500,224=>500,225=>500, -226=>500,227=>500,228=>500,229=>500,230=>667,231=>444,232=>444,233=>444,234=>444, -235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500, -244=>500,245=>500,246=>500,247=>675,248=>500,249=>500,250=>500,251=>500,252=>500, -253=>444,254=>500,255=>444); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ac15.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ac15.php deleted file mode 100644 index 503a071ffb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ac15.php +++ /dev/null @@ -1,23613 +0,0 @@ -<?php -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ag15.tar.Z -$cidinfo['uni2cid'] = array( -32=>1, -33=>2, -34=>3, -35=>4, -36=>5, -37=>6, -38=>7, -39=>8, -40=>9, -41=>10, -42=>11, -43=>12, -44=>13, -45=>14, -46=>15, -47=>16, -48=>17, -49=>18, -50=>19, -51=>20, -52=>21, -53=>22, -54=>23, -55=>24, -56=>25, -57=>26, -58=>27, -59=>28, -60=>29, -61=>30, -62=>31, -63=>32, -64=>33, -65=>34, -66=>35, -67=>36, -68=>37, -69=>38, -70=>39, -71=>40, -72=>41, -73=>42, -74=>43, -75=>44, -76=>45, -77=>46, -78=>47, -79=>48, -80=>49, -81=>50, -82=>51, -83=>52, -84=>53, -85=>54, -86=>55, -87=>56, -88=>57, -89=>58, -90=>59, -91=>60, -92=>61, -93=>62, -94=>63, -95=>64, -96=>65, -97=>66, -98=>67, -99=>68, -100=>69, -101=>70, -102=>71, -103=>72, -104=>73, -105=>74, -106=>75, -107=>76, -108=>77, -109=>78, -110=>79, -111=>80, -112=>81, -113=>82, -114=>83, -115=>84, -116=>85, -117=>86, -118=>87, -119=>88, -120=>89, -121=>90, -122=>91, -123=>92, -124=>93, -125=>94, -126=>95, -12288=>99, -65292=>100, -12289=>101, -12290=>102, -65294=>103, -8226=>104, -8231=>104, -65307=>105, -65306=>106, -65311=>107, -65281=>108, -65072=>109, -8230=>110, -8943=>110, -8229=>111, -65104=>112, -65380=>113, -65105=>113, -65106=>114, -183=>115, -65108=>116, -65109=>117, -65110=>118, -65111=>119, -65372=>120, -8211=>121, -65073=>122, -8212=>123, -65288=>128, -65289=>129, -65077=>130, -65078=>131, -65371=>132, -65373=>133, -65079=>134, -65080=>135, -12308=>136, -12309=>137, -65081=>138, -65082=>139, -12304=>140, -12305=>141, -65083=>142, -65084=>143, -12298=>144, -12299=>145, -65085=>146, -65086=>147, -12296=>148, -12297=>149, -65087=>150, -65088=>151, -12300=>152, -12301=>153, -65089=>154, -65090=>155, -12302=>156, -12303=>157, -65091=>158, -65092=>159, -65113=>160, -65114=>161, -65115=>162, -65116=>163, -65117=>164, -65118=>165, -8216=>166, -8217=>167, -8220=>168, -8221=>169, -12317=>170, -12318=>171, -8245=>172, -8242=>173, -65283=>174, -65286=>175, -65290=>176, -8251=>177, -167=>178, -12291=>179, -9675=>180, -9679=>181, -9651=>182, -9650=>183, -9678=>184, -9734=>185, -9733=>186, -9671=>187, -9670=>188, -9633=>189, -9632=>190, -9661=>191, -9660=>192, -12963=>193, -8453=>194, -175=>195, -772=>195, -8254=>195, -65507=>196, -65343=>197, -717=>198, -65097=>199, -65098=>200, -65101=>201, -65102=>202, -65099=>203, -65100=>204, -65119=>205, -65120=>206, -65121=>207, -65291=>208, -65293=>209, -215=>210, -247=>211, -177=>212, -8730=>213, -65308=>214, -65310=>215, -65309=>216, -8806=>217, -8807=>218, -8800=>219, -8734=>220, -8786=>221, -8801=>222, -65122=>223, -65123=>224, -65124=>225, -65125=>226, -65126=>227, -8764=>228, -65374=>228, -8745=>229, -8746=>230, -8869=>231, -8736=>232, -8735=>233, -8895=>234, -13266=>235, -13265=>236, -8747=>237, -8750=>238, -8757=>239, -8756=>240, -9792=>241, -9794=>242, -8853=>243, -9793=>243, -8857=>244, -9737=>244, -8593=>245, -8595=>246, -8594=>247, -8592=>248, -8598=>249, -8599=>250, -8601=>251, -8600=>252, -8741=>253, -8739=>254, -8725=>257, -65295=>257, -65128=>258, -65340=>258, -65284=>259, -165=>260, -65509=>260, -12306=>261, -162=>262, -65504=>262, -163=>263, -65505=>263, -65285=>264, -65312=>265, -8451=>266, -8457=>267, -65129=>268, -65130=>269, -65131=>270, -13269=>271, -13212=>272, -13213=>273, -13214=>274, -13262=>275, -13217=>276, -13198=>277, -13199=>278, -13252=>279, -176=>280, -20825=>281, -58834=>281, -20827=>282, -58835=>282, -20830=>283, -58837=>283, -20829=>284, -58836=>284, -20833=>285, -20835=>286, -21991=>287, -29929=>288, -58044=>288, -31950=>289, -58191=>289, -9601=>290, -9602=>291, -9603=>292, -9604=>293, -9605=>294, -9606=>295, -9607=>296, -9608=>297, -9615=>298, -9614=>299, -9613=>300, -9612=>301, -9611=>302, -9610=>303, -9609=>304, -9532=>305, -9524=>306, -9516=>307, -9508=>308, -9500=>309, -9620=>310, -9472=>311, -9474=>312, -9621=>313, -9484=>314, -9488=>315, -9492=>316, -9496=>317, -9581=>318, -9582=>319, -9584=>320, -9583=>321, -9552=>322, -9566=>323, -9578=>324, -9569=>325, -9698=>326, -9699=>327, -9701=>328, -9700=>329, -9585=>330, -9586=>331, -9587=>332, -65296=>333, -65297=>334, -65298=>335, -65299=>336, -65300=>337, -65301=>338, -65302=>339, -65303=>340, -65304=>341, -65305=>342, -8544=>343, -8545=>344, -8546=>345, -8547=>346, -8548=>347, -8549=>348, -8550=>349, -8551=>350, -8552=>351, -8553=>352, -12321=>353, -12322=>354, -12323=>355, -12324=>356, -12325=>357, -12326=>358, -12327=>359, -12328=>360, -12329=>361, -12344=>362, -21316=>363, -57443=>363, -12345=>363, -12346=>364, -65313=>365, -65314=>366, -65315=>367, -65316=>368, -65317=>369, -65318=>370, -65319=>371, -65320=>372, -65321=>373, -65322=>374, -65323=>375, -65324=>376, -65325=>377, -65326=>378, -65327=>379, -65328=>380, -65329=>381, -65330=>382, -65331=>383, -65332=>384, -65333=>385, -65334=>386, -65335=>387, -65336=>388, -65337=>389, -65338=>390, -65345=>391, -65346=>392, -65347=>393, -65348=>394, -65349=>395, -65350=>396, -65351=>397, -65352=>398, -65353=>399, -65354=>400, -65355=>401, -65356=>402, -65357=>403, -65358=>404, -65359=>405, -65360=>406, -65361=>407, -65362=>408, -65363=>409, -65364=>410, -65365=>411, -65366=>412, -65367=>413, -65368=>414, -65369=>415, -65370=>416, -913=>417, -914=>418, -915=>419, -916=>420, -917=>421, -918=>422, -919=>423, -920=>424, -921=>425, -922=>426, -923=>427, -924=>428, -925=>429, -926=>430, -927=>431, -928=>432, -929=>433, -931=>434, -932=>435, -933=>436, -934=>437, -935=>438, -936=>439, -937=>440, -945=>441, -946=>442, -947=>443, -948=>444, -949=>445, -950=>446, -951=>447, -952=>448, -953=>449, -954=>450, -955=>451, -956=>452, -957=>453, -958=>454, -959=>455, -960=>456, -961=>457, -963=>458, -964=>459, -965=>460, -966=>461, -967=>462, -968=>463, -969=>464, -12549=>465, -12550=>466, -12551=>467, -12552=>468, -12553=>469, -12554=>470, -12555=>471, -12556=>472, -12557=>473, -12558=>474, -12559=>475, -12560=>476, -12561=>477, -12562=>478, -12563=>479, -12564=>480, -12565=>481, -12566=>482, -12567=>483, -12568=>484, -12569=>485, -12570=>486, -12571=>487, -12572=>488, -12573=>489, -12574=>490, -12575=>491, -12576=>492, -12577=>493, -12578=>494, -12579=>495, -12580=>496, -12581=>497, -12582=>498, -12583=>499, -12584=>500, -12585=>501, -729=>502, -714=>503, -711=>504, -780=>504, -715=>505, -9312=>506, -63153=>506, -9313=>507, -63154=>507, -9314=>508, -63155=>508, -9315=>509, -63156=>509, -9316=>510, -63157=>510, -9317=>511, -63158=>511, -9318=>512, -63159=>512, -9319=>513, -63160=>513, -9320=>514, -63161=>514, -9321=>515, -63162=>515, -9332=>516, -63163=>516, -9333=>517, -63164=>517, -9334=>518, -63165=>518, -9335=>519, -63166=>519, -9336=>520, -63167=>520, -9337=>521, -63168=>521, -9338=>522, -63169=>522, -9339=>523, -63170=>523, -9340=>524, -63171=>524, -9341=>525, -63172=>525, -8560=>526, -63173=>526, -8561=>527, -63174=>527, -8562=>528, -63175=>528, -8563=>529, -63176=>529, -8564=>530, -63177=>530, -8565=>531, -63178=>531, -8566=>532, -63179=>532, -8567=>533, -63180=>533, -8568=>534, -63181=>534, -8569=>535, -63182=>535, -20008=>536, -12033=>536, -20022=>537, -12034=>537, -63183=>537, -20031=>538, -12035=>538, -63184=>538, -12037=>539, -20101=>539, -63185=>539, -12039=>540, -20128=>540, -63186=>540, -20866=>541, -12044=>541, -63187=>541, -20886=>542, -12045=>542, -63188=>542, -20907=>543, -12046=>543, -63189=>543, -12051=>544, -21241=>544, -63190=>544, -12054=>545, -21304=>545, -63191=>545, -12057=>546, -21353=>546, -63192=>546, -12059=>547, -21430=>547, -63193=>547, -12065=>548, -12066=>548, -22786=>548, -22794=>548, -63194=>548, -12071=>549, -23424=>549, -63195=>549, -12078=>550, -24027=>550, -63196=>550, -24186=>551, -12083=>551, -63197=>551, -24191=>552, -12084=>552, -63198=>552, -24308=>553, -12085=>553, -24400=>554, -12089=>554, -63200=>554, -24417=>555, -12090=>555, -63201=>555, -12097=>556, -25908=>556, -63202=>556, -12102=>557, -26080=>557, -30098=>558, -63204=>558, -12135=>558, -30326=>559, -12136=>559, -12193=>560, -36789=>560, -63206=>560, -12202=>561, -38582=>561, -9216=>562, -9217=>563, -9218=>564, -9219=>565, -9220=>566, -9221=>567, -9222=>568, -9223=>569, -9224=>570, -9225=>571, -9226=>572, -9227=>573, -9228=>574, -9229=>575, -9230=>576, -9231=>577, -9232=>578, -9233=>579, -9234=>580, -9235=>581, -9236=>582, -9237=>583, -9238=>584, -9239=>585, -9240=>586, -9241=>587, -9242=>588, -9243=>589, -9244=>590, -9245=>591, -9246=>592, -9247=>593, -9249=>594, -12032=>595, -19968=>595, -12036=>596, -20057=>596, -19969=>597, -19971=>598, -20035=>599, -20061=>600, -20102=>601, -12038=>602, -20108=>602, -20154=>603, -12040=>603, -20799=>604, -12041=>604, -20837=>605, -12042=>605, -20843=>606, -12043=>606, -12047=>607, -20960=>607, -12049=>608, -20992=>608, -20993=>609, -12050=>610, -21147=>610, -12052=>611, -21269=>611, -21313=>612, -12055=>612, -21340=>613, -12056=>613, -12060=>614, -21448=>614, -19977=>615, -19979=>616, -19976=>617, -19978=>618, -20011=>619, -20024=>620, -20961=>621, -20037=>622, -20040=>623, -20063=>624, -20062=>625, -20110=>626, -20129=>627, -20800=>628, -64012=>628, -20995=>629, -21242=>630, -21315=>631, -21449=>632, -12061=>633, -21475=>633, -22303=>634, -12063=>634, -22763=>635, -12064=>635, -22805=>636, -12067=>636, -22823=>637, -12068=>637, -22899=>638, -12069=>638, -12070=>639, -23376=>639, -23377=>640, -23379=>641, -23544=>642, -12072=>642, -23567=>643, -12073=>643, -23586=>644, -12074=>644, -23608=>645, -12075=>645, -12077=>646, -23665=>646, -24029=>647, -24037=>648, -12079=>648, -12080=>649, -24049=>649, -24050=>650, -24051=>651, -24062=>652, -12081=>652, -24178=>653, -12082=>653, -24318=>654, -12086=>654, -24331=>655, -12087=>655, -24339=>656, -12088=>656, -25165=>657, -19985=>658, -19984=>659, -19981=>660, -20013=>661, -20016=>662, -20025=>663, -20043=>664, -23609=>665, -20104=>666, -20113=>667, -20117=>668, -20114=>669, -20116=>670, -20130=>671, -20161=>672, -20160=>673, -20163=>674, -20166=>675, -20167=>676, -20173=>677, -20170=>678, -20171=>679, -20164=>680, -20803=>681, -20801=>682, -20839=>683, -20845=>684, -20846=>685, -20844=>686, -20887=>687, -20982=>688, -20998=>689, -20999=>690, -21000=>691, -21243=>692, -21246=>693, -21247=>694, -21270=>695, -21305=>696, -21320=>697, -21319=>698, -21317=>699, -21342=>700, -21380=>701, -21451=>702, -21450=>703, -21453=>704, -22764=>705, -22825=>706, -22827=>707, -22826=>708, -22829=>709, -23380=>710, -23569=>711, -23588=>712, -23610=>713, -23663=>714, -24052=>715, -24187=>716, -24319=>717, -24340=>718, -24341=>719, -24515=>720, -12092=>720, -25096=>721, -12093=>721, -25142=>722, -12094=>722, -25163=>723, -12095=>723, -25166=>724, -12096=>725, -25903=>725, -25991=>726, -12098=>726, -26007=>727, -12099=>727, -26020=>728, -12100=>728, -26041=>729, -12101=>729, -26085=>730, -12103=>730, -26352=>731, -12104=>731, -26376=>732, -12105=>732, -26408=>733, -12106=>733, -27424=>734, -12107=>734, -27490=>735, -12108=>735, -27513=>736, -12109=>736, -27595=>737, -12111=>737, -27604=>738, -12112=>738, -27611=>739, -12113=>739, -27663=>740, -12114=>740, -27700=>741, -12116=>741, -28779=>742, -12117=>742, -29226=>743, -12118=>743, -29238=>744, -12119=>744, -29243=>745, -12120=>745, -29255=>746, -12122=>746, -29273=>747, -12123=>747, -29275=>748, -12124=>748, -29356=>749, -12125=>749, -29579=>750, -19993=>751, -19990=>752, -19989=>753, -19988=>754, -19992=>755, -20027=>756, -20045=>757, -20047=>758, -20046=>759, -20197=>760, -20184=>761, -20180=>762, -20181=>763, -20182=>764, -20183=>765, -20195=>766, -20196=>767, -20185=>768, -20190=>769, -20805=>770, -20804=>771, -20873=>772, -20874=>773, -20908=>774, -20985=>775, -20986=>776, -20984=>777, -21002=>778, -21152=>779, -21151=>780, -57435=>781, -21253=>781, -21254=>782, -21271=>783, -21277=>784, -20191=>785, -21322=>786, -21321=>787, -21345=>788, -21344=>789, -21359=>790, -21358=>791, -21435=>792, -21487=>793, -21476=>794, -21491=>795, -21484=>796, -21486=>797, -21481=>798, -21480=>799, -21500=>800, -21496=>801, -21493=>802, -21483=>803, -21478=>804, -21482=>805, -21490=>806, -21489=>807, -21488=>808, -21477=>809, -21485=>810, -21499=>811, -22235=>812, -22234=>813, -22806=>814, -22830=>815, -22833=>816, -22900=>817, -22902=>818, -23381=>819, -23427=>820, -23612=>821, -24040=>822, -24039=>823, -24038=>824, -24066=>825, -24067=>826, -24179=>827, -24188=>828, -24321=>829, -24344=>830, -24343=>831, -24517=>832, -25098=>833, -25171=>834, -25172=>835, -25170=>836, -25169=>837, -26021=>838, -26086=>839, -26414=>840, -26412=>841, -26410=>842, -26411=>843, -26413=>844, -27491=>845, -27597=>846, -27665=>847, -27664=>848, -27704=>849, -27713=>850, -27712=>851, -27710=>852, -29359=>853, -29572=>854, -12126=>854, -29577=>855, -12127=>855, -29916=>856, -12128=>856, -29926=>857, -12129=>857, -29976=>858, -12130=>858, -29983=>859, -12131=>859, -12132=>860, -29992=>860, -29993=>861, -12133=>862, -30000=>862, -30001=>863, -30002=>864, -30003=>865, -12134=>866, -30091=>866, -30333=>867, -12137=>867, -30382=>868, -12138=>868, -30399=>869, -12139=>869, -30446=>870, -12140=>870, -30683=>871, -12141=>871, -30690=>872, -12142=>872, -30707=>873, -12143=>873, -31034=>874, -12144=>874, -31166=>875, -12146=>875, -31348=>876, -12147=>876, -31435=>877, -12148=>877, -19998=>878, -19999=>879, -20050=>880, -20051=>881, -20073=>882, -20121=>883, -20132=>884, -20134=>885, -20133=>886, -20223=>887, -20233=>888, -20249=>889, -20234=>890, -20245=>891, -20237=>892, -20240=>893, -20241=>894, -20239=>895, -20210=>896, -20214=>897, -20219=>898, -20208=>899, -20211=>900, -20221=>901, -20225=>902, -20235=>903, -20809=>904, -20807=>905, -20806=>906, -20808=>907, -20840=>908, -20849=>909, -20877=>910, -20912=>911, -21015=>912, -21009=>913, -21010=>914, -21006=>915, -21014=>916, -21155=>917, -21256=>918, -21281=>919, -21280=>920, -21360=>921, -21361=>922, -21513=>923, -21519=>924, -21516=>925, -21514=>926, -21520=>927, -21505=>928, -21515=>929, -21508=>930, -21521=>931, -21517=>932, -21512=>933, -21507=>934, -21518=>935, -21510=>936, -21522=>937, -22240=>938, -22238=>939, -22237=>940, -22323=>941, -22320=>942, -22312=>943, -22317=>944, -22316=>945, -22319=>946, -22313=>947, -22809=>948, -22810=>949, -22839=>950, -22840=>951, -22916=>952, -22904=>953, -22915=>954, -22909=>955, -22905=>956, -22914=>957, -22913=>958, -23383=>959, -23384=>960, -23431=>961, -23432=>962, -23429=>963, -23433=>964, -23546=>965, -23574=>966, -23673=>967, -24030=>968, -24070=>969, -24182=>970, -24180=>971, -24335=>972, -24347=>973, -24537=>974, -24534=>975, -25102=>976, -25100=>977, -25101=>978, -25104=>979, -25187=>980, -25179=>981, -25176=>982, -25910=>983, -26089=>984, -26088=>985, -26092=>986, -26093=>987, -26354=>988, -26355=>989, -26377=>990, -26429=>991, -26420=>992, -26417=>993, -26421=>994, -27425=>995, -27492=>996, -27515=>997, -27670=>998, -27741=>999, -27735=>1000, -27737=>1001, -27743=>1002, -27744=>1003, -27728=>1004, -27733=>1005, -27745=>1006, -27739=>1007, -27725=>1008, -27726=>1009, -28784=>1010, -29279=>1011, -29277=>1012, -30334=>1013, -31481=>1014, -12149=>1014, -31859=>1015, -12150=>1015, -31992=>1016, -12151=>1016, -32566=>1017, -12152=>1017, -32650=>1018, -12154=>1018, -32701=>1019, -12155=>1019, -32769=>1020, -12156=>1020, -32771=>1021, -32780=>1022, -12157=>1022, -32786=>1023, -12158=>1023, -32819=>1024, -12159=>1024, -32895=>1025, -12160=>1025, -32905=>1026, -12161=>1026, -32907=>1027, -32908=>1028, -33251=>1029, -12162=>1029, -33258=>1030, -12163=>1030, -33267=>1031, -12164=>1031, -33276=>1032, -12165=>1032, -33292=>1033, -12166=>1033, -33307=>1034, -12167=>1034, -33311=>1035, -12168=>1035, -33390=>1036, -12169=>1036, -33394=>1037, -12170=>1037, -33406=>1038, -34411=>1039, -12173=>1039, -34880=>1040, -12174=>1040, -34892=>1041, -12175=>1041, -34915=>1042, -12176=>1042, -35199=>1043, -38433=>1044, -20018=>1045, -20136=>1046, -20301=>1047, -20303=>1048, -20295=>1049, -20311=>1050, -20318=>1051, -20276=>1052, -20315=>1053, -20309=>1054, -20272=>1055, -20304=>1056, -20305=>1057, -20285=>1058, -20282=>1059, -20280=>1060, -20291=>1061, -20308=>1062, -20284=>1063, -20294=>1064, -20323=>1065, -20316=>1066, -20320=>1067, -20271=>1068, -20302=>1069, -20278=>1070, -20313=>1071, -20317=>1072, -20296=>1073, -20314=>1074, -20812=>1075, -20811=>1076, -20813=>1077, -20853=>1078, -20918=>1079, -20919=>1080, -21029=>1081, -21028=>1082, -21033=>1083, -21034=>1084, -21032=>1085, -21163=>1086, -21161=>1087, -21162=>1088, -21164=>1089, -21283=>1090, -21363=>1091, -21365=>1092, -21533=>1093, -21549=>1094, -21534=>1095, -21566=>1096, -21542=>1097, -21582=>1098, -21543=>1099, -21574=>1100, -21571=>1101, -21555=>1102, -21576=>1103, -21570=>1104, -21531=>1105, -21545=>1106, -21578=>1107, -21561=>1108, -21563=>1109, -21560=>1110, -21550=>1111, -21557=>1112, -21558=>1113, -21536=>1114, -21564=>1115, -21568=>1116, -21553=>1117, -21547=>1118, -21535=>1119, -21548=>1120, -22250=>1121, -22256=>1122, -22244=>1123, -22251=>1124, -22346=>1125, -22353=>1126, -22336=>1127, -22349=>1128, -22343=>1129, -22350=>1130, -22334=>1131, -22352=>1132, -22351=>1133, -22331=>1134, -22767=>1135, -22846=>1136, -22941=>1137, -22930=>1138, -22952=>1139, -22942=>1140, -22947=>1141, -22937=>1142, -22934=>1143, -22925=>1144, -22948=>1145, -22931=>1146, -22922=>1147, -22949=>1148, -23389=>1149, -23388=>1150, -23386=>1151, -23387=>1152, -23436=>1153, -23435=>1154, -23439=>1155, -23596=>1156, -23616=>1157, -23617=>1158, -23615=>1159, -23614=>1160, -23696=>1161, -23697=>1162, -23700=>1163, -23692=>1164, -24043=>1165, -24076=>1166, -24207=>1167, -24199=>1168, -24202=>1169, -24311=>1170, -24324=>1171, -24351=>1172, -24420=>1173, -24418=>1174, -24439=>1175, -24441=>1176, -24536=>1177, -24524=>1178, -24535=>1179, -24525=>1180, -24561=>1181, -24555=>1182, -24568=>1183, -24554=>1184, -25106=>1185, -25105=>1186, -25220=>1187, -25239=>1188, -25238=>1189, -25216=>1190, -25206=>1191, -25225=>1192, -25197=>1193, -25226=>1194, -25212=>1195, -25214=>1196, -25209=>1197, -25203=>1198, -25234=>1199, -25199=>1200, -25240=>1201, -25198=>1202, -25237=>1203, -25235=>1204, -25233=>1205, -25222=>1206, -25913=>1207, -25915=>1208, -25912=>1209, -26097=>1210, -26356=>1211, -26463=>1212, -26446=>1213, -26447=>1214, -26448=>1215, -26449=>1216, -26460=>1217, -26454=>1218, -26462=>1219, -57801=>1219, -26441=>1220, -26438=>1221, -26464=>1222, -26451=>1223, -26455=>1224, -27493=>1225, -27599=>1226, -27714=>1227, -27742=>1228, -27801=>1229, -27777=>1230, -27784=>1231, -27785=>1232, -27781=>1233, -27803=>1234, -27754=>1235, -27770=>1236, -27792=>1237, -27760=>1238, -27788=>1239, -27752=>1240, -27798=>1241, -27794=>1242, -27773=>1243, -27779=>1244, -27762=>1245, -27774=>1246, -27764=>1247, -27782=>1248, -27766=>1249, -27789=>1250, -27796=>1251, -27800=>1252, -27778=>1253, -28790=>1254, -28796=>1255, -28797=>1256, -28792=>1257, -29282=>1258, -29281=>1259, -29280=>1260, -29380=>1261, -29378=>1262, -29590=>1263, -29996=>1264, -29995=>1265, -30007=>1266, -30008=>1267, -30338=>1268, -30447=>1269, -30691=>1270, -31169=>1271, -31168=>1272, -31167=>1273, -31350=>1274, -31995=>1275, -32597=>1276, -32918=>1277, -32915=>1278, -32925=>1279, -32920=>1280, -32923=>1281, -32922=>1282, -32946=>1283, -33391=>1284, -33426=>1285, -33419=>1286, -33421=>1287, -35211=>1288, -12178=>1288, -35282=>1289, -12179=>1289, -35328=>1290, -12180=>1290, -35895=>1291, -12181=>1291, -35910=>1292, -12182=>1292, -35925=>1293, -12183=>1293, -35997=>1294, -12185=>1294, -36196=>1295, -12186=>1295, -36208=>1296, -12187=>1296, -36275=>1297, -12188=>1297, -36523=>1298, -12189=>1298, -36554=>1299, -12190=>1299, -36763=>1300, -12191=>1300, -36784=>1301, -12192=>1301, -36802=>1302, -36806=>1303, -36805=>1304, -36804=>1305, -24033=>1306, -12194=>1307, -37009=>1307, -37026=>1308, -37034=>1309, -37030=>1310, -37027=>1311, -37193=>1312, -12195=>1312, -37318=>1313, -12196=>1313, -37324=>1314, -12197=>1314, -38450=>1315, -38446=>1316, -38449=>1317, -38442=>1318, -38444=>1319, -20006=>1320, -20054=>1321, -20083=>1322, -20107=>1323, -20123=>1324, -20126=>1325, -20139=>1326, -20140=>1327, -20335=>1328, -20381=>1329, -20365=>1330, -20339=>1331, -20351=>1332, -20332=>1333, -20379=>1334, -20363=>1335, -20358=>1336, -20355=>1337, -20336=>1338, -20341=>1339, -20360=>1340, -20329=>1341, -20347=>1342, -20374=>1343, -20350=>1344, -20367=>1345, -20369=>1346, -20346=>1347, -20820=>1348, -20818=>1349, -20821=>1350, -20841=>1351, -20855=>1352, -20854=>1353, -20856=>1354, -20925=>1355, -20989=>1356, -21051=>1357, -21048=>1358, -21047=>1359, -21050=>1360, -21040=>1361, -21038=>1362, -21046=>1363, -21057=>1364, -21182=>1365, -21179=>1366, -21330=>1367, -21332=>1368, -21331=>1369, -21329=>1370, -21350=>1371, -21367=>1372, -21368=>1373, -21369=>1374, -21462=>1375, -21460=>1376, -21463=>1377, -21619=>1378, -21621=>1379, -21654=>1380, -21624=>1381, -21653=>1382, -21632=>1383, -21627=>1384, -21623=>1385, -21636=>1386, -21650=>1387, -21638=>1388, -21628=>1389, -21648=>1390, -21617=>1391, -21622=>1392, -21644=>1393, -21658=>1394, -21602=>1395, -21608=>1396, -21643=>1397, -21629=>1398, -21646=>1399, -22266=>1400, -22403=>1401, -22391=>1402, -22378=>1403, -22377=>1404, -22369=>1405, -22374=>1406, -22372=>1407, -22396=>1408, -22812=>1409, -22857=>1410, -22855=>1411, -22856=>1412, -22852=>1413, -22868=>1414, -22974=>1415, -22971=>1416, -22996=>1417, -22969=>1418, -22958=>1419, -22993=>1420, -22982=>1421, -22992=>1422, -22989=>1423, -22987=>1424, -22995=>1425, -22986=>1426, -22959=>1427, -22963=>1428, -22994=>1429, -22981=>1430, -23391=>1431, -23396=>1432, -23395=>1433, -23447=>1434, -23450=>1435, -23448=>1436, -23452=>1437, -23449=>1438, -23451=>1439, -23578=>1440, -23624=>1441, -23621=>1442, -23622=>1443, -23735=>1444, -23713=>1445, -23736=>1446, -23721=>1447, -23723=>1448, -23729=>1449, -23731=>1450, -24088=>1451, -24090=>1452, -24086=>1453, -24085=>1454, -24091=>1455, -24081=>1456, -24184=>1457, -24218=>1458, -24215=>1459, -24220=>1460, -24213=>1461, -24214=>1462, -24310=>1463, -24358=>1464, -24359=>1465, -24361=>1466, -24448=>1467, -24449=>1468, -24447=>1469, -24444=>1470, -24541=>1471, -24544=>1472, -24573=>1473, -24565=>1474, -24575=>1475, -24591=>1476, -24596=>1477, -24623=>1478, -24629=>1479, -24598=>1480, -24618=>1481, -24597=>1482, -24609=>1483, -24615=>1484, -24617=>1485, -24619=>1486, -24603=>1487, -25110=>1488, -25109=>1489, -25151=>1490, -25150=>1491, -25152=>1492, -25215=>1493, -25289=>1494, -25292=>1495, -25284=>1496, -25279=>1497, -25282=>1498, -25273=>1499, -25298=>1500, -25307=>1501, -25259=>1502, -25299=>1503, -25300=>1504, -25291=>1505, -25288=>1506, -25256=>1507, -25277=>1508, -25276=>1509, -25296=>1510, -60582=>1510, -25305=>1511, -25287=>1512, -25293=>1513, -25269=>1514, -25306=>1515, -25265=>1516, -25304=>1517, -25302=>1518, -25303=>1519, -25286=>1520, -25260=>1521, -25294=>1522, -61010=>1522, -25918=>1523, -26023=>1524, -26044=>1525, -26106=>1526, -26132=>1527, -26131=>1528, -26124=>1529, -26118=>1530, -26114=>1531, -26126=>1532, -26112=>1533, -26127=>1534, -26133=>1535, -26122=>1536, -26119=>1537, -26381=>1538, -26379=>1539, -26477=>1540, -26507=>1541, -26517=>1542, -26481=>1543, -26524=>1544, -26483=>1545, -26487=>1546, -26503=>1547, -26525=>1548, -26519=>1549, -26479=>1550, -26480=>1551, -26495=>1552, -26505=>1553, -26494=>1554, -26512=>1555, -26485=>1556, -26522=>1557, -26515=>1558, -26492=>1559, -26474=>1560, -26482=>1561, -27427=>1562, -27494=>1563, -27495=>1564, -27519=>1565, -27667=>1566, -27675=>1567, -27875=>1568, -27880=>1569, -27891=>1570, -27825=>1571, -27852=>1572, -27877=>1573, -27827=>1574, -27837=>1575, -27838=>1576, -27836=>1577, -27874=>1578, -27819=>1579, -27861=>1580, -27859=>1581, -27832=>1582, -27844=>1583, -27833=>1584, -27841=>1585, -27822=>1586, -27863=>1587, -27845=>1588, -27889=>1589, -27839=>1590, -27835=>1591, -27873=>1592, -27867=>1593, -27850=>1594, -27820=>1595, -27887=>1596, -27868=>1597, -27862=>1598, -27872=>1599, -28821=>1600, -28814=>1601, -28818=>1602, -28810=>1603, -28825=>1604, -29228=>1605, -29229=>1606, -29240=>1607, -29256=>1608, -29287=>1609, -29289=>1610, -29376=>1611, -29390=>1612, -29401=>1613, -29399=>1614, -29392=>1615, -29609=>1616, -29608=>1617, -29599=>1618, -29611=>1619, -29605=>1620, -30013=>1621, -30109=>1622, -30105=>1623, -30106=>1624, -30340=>1625, -30402=>1626, -30450=>1627, -30452=>1628, -30693=>1629, -30717=>1630, -31038=>1631, -31040=>1632, -31041=>1633, -31177=>1634, -31176=>1635, -31354=>1636, -31353=>1637, -31482=>1638, -31998=>1639, -32596=>1640, -32652=>1641, -32651=>1642, -32773=>1643, -58236=>1643, -32954=>1644, -32933=>1645, -32930=>1646, -32945=>1647, -32929=>1648, -32939=>1649, -32937=>1650, -32948=>1651, -32938=>1652, -32943=>1653, -33253=>1654, -33278=>1655, -33293=>1656, -33459=>1657, -33437=>1658, -33433=>1659, -33453=>1660, -33469=>1661, -33439=>1662, -33465=>1663, -33457=>1664, -33452=>1665, -33445=>1666, -33455=>1667, -33464=>1668, -33443=>1669, -33456=>1670, -33470=>1671, -33463=>1672, -34382=>1673, -34417=>1674, -21021=>1675, -34920=>1676, -36555=>1677, -36814=>1678, -36820=>1679, -36817=>1680, -37045=>1681, -37048=>1682, -37041=>1683, -37046=>1684, -37319=>1685, -37329=>1686, -12198=>1686, -38263=>1687, -12199=>1687, -38272=>1688, -12200=>1688, -38428=>1689, -12201=>1689, -38464=>1690, -38463=>1691, -38459=>1692, -38468=>1693, -38466=>1694, -38585=>1695, -12203=>1695, -38632=>1696, -12204=>1696, -38738=>1697, -12206=>1698, -38750=>1698, -20127=>1699, -20141=>1700, -20142=>1701, -20449=>1702, -20405=>1703, -20399=>1704, -20415=>1705, -20448=>1706, -20433=>1707, -20431=>1708, -20445=>1709, -20419=>1710, -20406=>1711, -20440=>1712, -20447=>1713, -20426=>1714, -20439=>1715, -20398=>1716, -20432=>1717, -20420=>1718, -20418=>1719, -20442=>1720, -20430=>1721, -20446=>1722, -20407=>1723, -20823=>1724, -20882=>1725, -20881=>1726, -20896=>1727, -21070=>1728, -21059=>1729, -21066=>1730, -21069=>1731, -21068=>1732, -21067=>1733, -21063=>1734, -21191=>1735, -21193=>1736, -21187=>1737, -21185=>1738, -21261=>1739, -21335=>1740, -21371=>1741, -21402=>1742, -21467=>1743, -21676=>1744, -21696=>1745, -21672=>1746, -21710=>1747, -21705=>1748, -21688=>1749, -21670=>1750, -21683=>1751, -21703=>1752, -21698=>1753, -21693=>1754, -21674=>1755, -21697=>1756, -21700=>1757, -21704=>1758, -21679=>1759, -21675=>1760, -21681=>1761, -21691=>1762, -21673=>1763, -21671=>1764, -21695=>1765, -22271=>1766, -22402=>1767, -22411=>1768, -22432=>1769, -22435=>1770, -22434=>1771, -22478=>1772, -22446=>1773, -22419=>1774, -22869=>1775, -22865=>1776, -22863=>1777, -22862=>1778, -22864=>1779, -23004=>1780, -23000=>1781, -23039=>1782, -23011=>1783, -23016=>1784, -23043=>1785, -23013=>1786, -23018=>1787, -23002=>1788, -23014=>1789, -23041=>1790, -23035=>1791, -23401=>1792, -23459=>1793, -23462=>1794, -23460=>1795, -23458=>1796, -23461=>1797, -23553=>1798, -23630=>1799, -23631=>1800, -23629=>1801, -23627=>1802, -23769=>1803, -23762=>1804, -24055=>1805, -24093=>1806, -24101=>1807, -24095=>1808, -24189=>1809, -24224=>1810, -24230=>1811, -24314=>1812, -24328=>1813, -24365=>1814, -24421=>1815, -24456=>1816, -24453=>1817, -24458=>1818, -24459=>1819, -24455=>1820, -24460=>1821, -24457=>1822, -24594=>1823, -24605=>1824, -24608=>1825, -24613=>1826, -24590=>1827, -24616=>1828, -24653=>1829, -24688=>1830, -24680=>1831, -24674=>1832, -60712=>1832, -24646=>1833, -24643=>1834, -24684=>1835, -24683=>1836, -24682=>1837, -24676=>1838, -25153=>1839, -25308=>1840, -25366=>1841, -25353=>1842, -25340=>1843, -25325=>1844, -25345=>1845, -25326=>1846, -25341=>1847, -25351=>1848, -25329=>1849, -25335=>1850, -25327=>1851, -25324=>1852, -25342=>1853, -25332=>1854, -25361=>1855, -25346=>1856, -25919=>1857, -25925=>1858, -26027=>1859, -26045=>1860, -26082=>1861, -26149=>1862, -26157=>1863, -26144=>1864, -26151=>1865, -26159=>1866, -26143=>1867, -26152=>1868, -26161=>1869, -26148=>1870, -26359=>1871, -26623=>1872, -26579=>1873, -26609=>1874, -26580=>1875, -26576=>1876, -26604=>1877, -26550=>1878, -26543=>1879, -26613=>1880, -26601=>1881, -26607=>1882, -26564=>1883, -26577=>1884, -26548=>1885, -26586=>1886, -26597=>1887, -26552=>1888, -26575=>1889, -26590=>1890, -26611=>1891, -26544=>1892, -26585=>1893, -26594=>1894, -26589=>1895, -26578=>1896, -27498=>1897, -27523=>1898, -27526=>1899, -27573=>1900, -27602=>1901, -27607=>1902, -27679=>1903, -27849=>1904, -27915=>1905, -27954=>1906, -27946=>1907, -27969=>1908, -27941=>1909, -27916=>1910, -27953=>1911, -27934=>1912, -27927=>1913, -27963=>1914, -27965=>1915, -27966=>1916, -27958=>1917, -27931=>1918, -27893=>1919, -27961=>1920, -27943=>1921, -27960=>1922, -27945=>1923, -27950=>1924, -27957=>1925, -27918=>1926, -27947=>1927, -28843=>1928, -28858=>1929, -28851=>1930, -28844=>1931, -28847=>1932, -28845=>1933, -28856=>1934, -28846=>1935, -28836=>1936, -29232=>1937, -29298=>1938, -29295=>1939, -29300=>1940, -29417=>1941, -29408=>1942, -29409=>1943, -29623=>1944, -29642=>1945, -29627=>1946, -29618=>1947, -29645=>1948, -29632=>1949, -29619=>1950, -29978=>1951, -29997=>1952, -30031=>1953, -30028=>1954, -30030=>1955, -30027=>1956, -30123=>1957, -30116=>1958, -30117=>1959, -30114=>1960, -30115=>1961, -30328=>1962, -30342=>1963, -30343=>1964, -30344=>1965, -30408=>1966, -30406=>1967, -30403=>1968, -30405=>1969, -30465=>1970, -30457=>1971, -30456=>1972, -30473=>1973, -30475=>1974, -30462=>1975, -30460=>1976, -30471=>1977, -30684=>1978, -30722=>1979, -30740=>1980, -30732=>1981, -30733=>1982, -31046=>1983, -31049=>1984, -31048=>1985, -31047=>1986, -31161=>1987, -31162=>1988, -31185=>1989, -31186=>1990, -31179=>1991, -31359=>1992, -31361=>1993, -31487=>1994, -31485=>1995, -31869=>1996, -32002=>1997, -32005=>1998, -32000=>1999, -32009=>2000, -32007=>2001, -32004=>2002, -32006=>2003, -32568=>2004, -32654=>2005, -32703=>2006, -32784=>2007, -32781=>2008, -32785=>2009, -32822=>2010, -32982=>2011, -32997=>2012, -32986=>2013, -32963=>2014, -32964=>2015, -32972=>2016, -32993=>2017, -32987=>2018, -32974=>2019, -32990=>2020, -32996=>2021, -32989=>2022, -33268=>2023, -33314=>2024, -33511=>2025, -33539=>2026, -33541=>2027, -33507=>2028, -33499=>2029, -33510=>2030, -33540=>2031, -33509=>2032, -33538=>2033, -33545=>2034, -33490=>2035, -33495=>2036, -33521=>2037, -33537=>2038, -33500=>2039, -33492=>2040, -33489=>2041, -33502=>2042, -33491=>2043, -33503=>2044, -33519=>2045, -33542=>2046, -34384=>2047, -34425=>2048, -34427=>2049, -34426=>2050, -34893=>2051, -34923=>2052, -35201=>2053, -35284=>2054, -35336=>2055, -35330=>2056, -35331=>2057, -35998=>2058, -36000=>2059, -36212=>2060, -36211=>2061, -36276=>2062, -36557=>2063, -36556=>2064, -36848=>2065, -36838=>2066, -36834=>2067, -36842=>2068, -36837=>2069, -36845=>2070, -36843=>2071, -36836=>2072, -36840=>2073, -37066=>2074, -37070=>2075, -37057=>2076, -37059=>2077, -37195=>2078, -37194=>2079, -37325=>2080, -38274=>2081, -38480=>2082, -38475=>2083, -38476=>2084, -38477=>2085, -38754=>2086, -12207=>2086, -38761=>2087, -12208=>2087, -38859=>2088, -12209=>2088, -38893=>2089, -12210=>2089, -38899=>2090, -12211=>2090, -38913=>2091, -12212=>2091, -39080=>2092, -12213=>2092, -39131=>2093, -12214=>2093, -39135=>2094, -12215=>2094, -39318=>2095, -12216=>2095, -39321=>2096, -12217=>2096, -20056=>2097, -20147=>2098, -20492=>2099, -20493=>2100, -20515=>2101, -20463=>2102, -20518=>2103, -20517=>2104, -20472=>2105, -20521=>2106, -57375=>2106, -20502=>2107, -20486=>2108, -20540=>2109, -20511=>2110, -20506=>2111, -20498=>2112, -20497=>2113, -20474=>2114, -20480=>2115, -20500=>2116, -20520=>2117, -20465=>2118, -20513=>2119, -20491=>2120, -20505=>2121, -20504=>2122, -20467=>2123, -20462=>2124, -20525=>2125, -20522=>2126, -20478=>2127, -20523=>2128, -20489=>2129, -20860=>2130, -20900=>2131, -20901=>2132, -20898=>2133, -20941=>2134, -20940=>2135, -20934=>2136, -20939=>2137, -21078=>2138, -21084=>2139, -21076=>2140, -21083=>2141, -21085=>2142, -21290=>2143, -21375=>2144, -57459=>2144, -21407=>2145, -21405=>2146, -21471=>2147, -21736=>2148, -21776=>2149, -21761=>2150, -21815=>2151, -21756=>2152, -21733=>2153, -21746=>2154, -21766=>2155, -21754=>2156, -21780=>2157, -21737=>2158, -21741=>2159, -21729=>2160, -21769=>2161, -21742=>2162, -21738=>2163, -21734=>2164, -21799=>2165, -21767=>2166, -21757=>2167, -21775=>2168, -22275=>2169, -22276=>2170, -22466=>2171, -22484=>2172, -22475=>2173, -22467=>2174, -22537=>2175, -22799=>2176, -22871=>2177, -22872=>2178, -22874=>2179, -23057=>2180, -23064=>2181, -23068=>2182, -23071=>2183, -23067=>2184, -23059=>2185, -23020=>2186, -23072=>2187, -23075=>2188, -23081=>2189, -23077=>2190, -23052=>2191, -23049=>2192, -23403=>2193, -23640=>2194, -23472=>2195, -23475=>2196, -23478=>2197, -23476=>2198, -23470=>2199, -23477=>2200, -23481=>2201, -23480=>2202, -23556=>2203, -23633=>2204, -23637=>2205, -23632=>2206, -23789=>2207, -23805=>2208, -23803=>2209, -23786=>2210, -23784=>2211, -23792=>2212, -23798=>2213, -23809=>2214, -23796=>2215, -24046=>2216, -24109=>2217, -24107=>2218, -24235=>2219, -24237=>2220, -24231=>2221, -24369=>2222, -24466=>2223, -24465=>2224, -24464=>2225, -24665=>2226, -24675=>2227, -24677=>2228, -24656=>2229, -24661=>2230, -24685=>2231, -24681=>2232, -24687=>2233, -24708=>2234, -24735=>2235, -24730=>2236, -24717=>2237, -24724=>2238, -24716=>2239, -24709=>2240, -24726=>2241, -25159=>2242, -25331=>2243, -25352=>2244, -25343=>2245, -25422=>2246, -25406=>2247, -25391=>2248, -25429=>2249, -25410=>2250, -25414=>2251, -25423=>2252, -25417=>2253, -25402=>2254, -25424=>2255, -25405=>2256, -25386=>2257, -25387=>2258, -25384=>2259, -25421=>2260, -25420=>2261, -25928=>2262, -25929=>2263, -26009=>2264, -26049=>2265, -26053=>2266, -26178=>2267, -26185=>2268, -26191=>2269, -26179=>2270, -26194=>2271, -26188=>2272, -26181=>2273, -26177=>2274, -26360=>2275, -26388=>2276, -26389=>2277, -26391=>2278, -26657=>2279, -26680=>2280, -26696=>2281, -26694=>2282, -26707=>2283, -26681=>2284, -26690=>2285, -26708=>2286, -26665=>2287, -26803=>2288, -26647=>2289, -26700=>2290, -26705=>2291, -26685=>2292, -26612=>2293, -26704=>2294, -26688=>2295, -26684=>2296, -26691=>2297, -26666=>2298, -26693=>2299, -26643=>2300, -26648=>2301, -26689=>2302, -27530=>2303, -27529=>2304, -27575=>2305, -27683=>2306, -27687=>2307, -27688=>2308, -27686=>2309, -27684=>2310, -27888=>2311, -28010=>2312, -28053=>2313, -28040=>2314, -28039=>2315, -28006=>2316, -28024=>2317, -28023=>2318, -27993=>2319, -28051=>2320, -28012=>2321, -28041=>2322, -28014=>2323, -27994=>2324, -28020=>2325, -28009=>2326, -28044=>2327, -28042=>2328, -28025=>2329, -28037=>2330, -28005=>2331, -28052=>2332, -28874=>2333, -28888=>2334, -28900=>2335, -28889=>2336, -28872=>2337, -28879=>2338, -29241=>2339, -29305=>2340, -29436=>2341, -29433=>2342, -29437=>2343, -29432=>2344, -29431=>2345, -29574=>2346, -29677=>2347, -29705=>2348, -29678=>2349, -29664=>2350, -29674=>2351, -29662=>2352, -30036=>2353, -30045=>2354, -30044=>2355, -30042=>2356, -30041=>2357, -30142=>2358, -30149=>2359, -30151=>2360, -30130=>2361, -30131=>2362, -30141=>2363, -30140=>2364, -30137=>2365, -30146=>2366, -30136=>2367, -30347=>2368, -30384=>2369, -30410=>2370, -30413=>2371, -30414=>2372, -30505=>2373, -30495=>2374, -30496=>2375, -30504=>2376, -30697=>2377, -30768=>2378, -30759=>2379, -30776=>2380, -30749=>2381, -30772=>2382, -30775=>2383, -30757=>2384, -30765=>2385, -30752=>2386, -30751=>2387, -30770=>2388, -31061=>2389, -31056=>2390, -31072=>2391, -31071=>2392, -31062=>2393, -31070=>2394, -31069=>2395, -31063=>2396, -31066=>2397, -31204=>2398, -31203=>2399, -60418=>2399, -31207=>2400, -31199=>2401, -31206=>2402, -31209=>2403, -31192=>2404, -31364=>2405, -31368=>2406, -31449=>2407, -31494=>2408, -31505=>2409, -31881=>2410, -32033=>2411, -32023=>2412, -32011=>2413, -32010=>2414, -32032=>2415, -32034=>2416, -32020=>2417, -32016=>2418, -32021=>2419, -32026=>2420, -32028=>2421, -32013=>2422, -32025=>2423, -32027=>2424, -32570=>2425, -32607=>2426, -32660=>2427, -32709=>2428, -32705=>2429, -32774=>2430, -32772=>2431, -32792=>2432, -32789=>2433, -32793=>2434, -32791=>2435, -32829=>2436, -32831=>2437, -33009=>2438, -33026=>2439, -33008=>2440, -33029=>2441, -33005=>2442, -33012=>2443, -33030=>2444, -33016=>2445, -33011=>2446, -33032=>2447, -33021=>2448, -33034=>2449, -33020=>2450, -33007=>2451, -33261=>2452, -33260=>2453, -33280=>2454, -33296=>2455, -33322=>2456, -33323=>2457, -33320=>2458, -33324=>2459, -33467=>2460, -33579=>2461, -33618=>2462, -33620=>2463, -33610=>2464, -33592=>2465, -33616=>2466, -33609=>2467, -33589=>2468, -33588=>2469, -33615=>2470, -33586=>2471, -33593=>2472, -33590=>2473, -33559=>2474, -33600=>2475, -33585=>2476, -33576=>2477, -33603=>2478, -34388=>2479, -34442=>2480, -34474=>2481, -34451=>2482, -34468=>2483, -34473=>2484, -34444=>2485, -34467=>2486, -34460=>2487, -34928=>2488, -34935=>2489, -34945=>2490, -34946=>2491, -34941=>2492, -34937=>2493, -35352=>2494, -35344=>2495, -35342=>2496, -35340=>2497, -35349=>2498, -35338=>2499, -35351=>2500, -35347=>2501, -35350=>2502, -35343=>2503, -35345=>2504, -35912=>2505, -35962=>2506, -35961=>2507, -36001=>2508, -36002=>2509, -36215=>2510, -58442=>2510, -36524=>2511, -36562=>2512, -36564=>2513, -36559=>2514, -36785=>2515, -36865=>2516, -36870=>2517, -36855=>2518, -36864=>2519, -36858=>2520, -36852=>2521, -36867=>2522, -36861=>2523, -36869=>2524, -36856=>2525, -37013=>2526, -37089=>2527, -37085=>2528, -37090=>2529, -37202=>2530, -37197=>2531, -37196=>2532, -37336=>2533, -37341=>2534, -37335=>2535, -37340=>2536, -37337=>2537, -38275=>2538, -38498=>2539, -38499=>2540, -38497=>2541, -38491=>2542, -38493=>2543, -38500=>2544, -38488=>2545, -38494=>2546, -38587=>2547, -39138=>2548, -39340=>2549, -12218=>2549, -39592=>2550, -12219=>2550, -39640=>2551, -12220=>2551, -12222=>2552, -39717=>2552, -39730=>2553, -12224=>2553, -39740=>2554, -12225=>2554, -20094=>2555, -20602=>2556, -20605=>2557, -57382=>2557, -20572=>2558, -20551=>2559, -20547=>2560, -20556=>2561, -20570=>2562, -20553=>2563, -20581=>2564, -20598=>2565, -20558=>2566, -20565=>2567, -20597=>2568, -20596=>2569, -20599=>2570, -20559=>2571, -20495=>2572, -20591=>2573, -20589=>2574, -20828=>2575, -20885=>2576, -20976=>2577, -21098=>2578, -21103=>2579, -21202=>2580, -21209=>2581, -21208=>2582, -21205=>2583, -21264=>2584, -21263=>2585, -21273=>2586, -21311=>2587, -21312=>2588, -21310=>2589, -21443=>2590, -26364=>2591, -21830=>2592, -21866=>2593, -21862=>2594, -21828=>2595, -21854=>2596, -21857=>2597, -21827=>2598, -21834=>2599, -21809=>2600, -21846=>2601, -21839=>2602, -21845=>2603, -21807=>2604, -21860=>2605, -21816=>2606, -21806=>2607, -21852=>2608, -21804=>2609, -21859=>2610, -21811=>2611, -21825=>2612, -21847=>2613, -22280=>2614, -22283=>2615, -22281=>2616, -22495=>2617, -22533=>2618, -22538=>2619, -22534=>2620, -22496=>2621, -22500=>2622, -22522=>2623, -22530=>2624, -22581=>2625, -22519=>2626, -22521=>2627, -22816=>2628, -22882=>2629, -23094=>2630, -23105=>2631, -23113=>2632, -23142=>2633, -23146=>2634, -23104=>2635, -23100=>2636, -23138=>2637, -23130=>2638, -23110=>2639, -23114=>2640, -23408=>2641, -23495=>2642, -23493=>2643, -23492=>2644, -23490=>2645, -23487=>2646, -23494=>2647, -23561=>2648, -23560=>2649, -23559=>2650, -23648=>2651, -23644=>2652, -23645=>2653, -23815=>2654, -23814=>2655, -23822=>2656, -23835=>2657, -23830=>2658, -23842=>2659, -23825=>2660, -23849=>2661, -23828=>2662, -23833=>2663, -23844=>2664, -23847=>2665, -23831=>2666, -24034=>2667, -24120=>2668, -24118=>2669, -24115=>2670, -24119=>2671, -24247=>2672, -24248=>2673, -24246=>2674, -24245=>2675, -24254=>2676, -24373=>2677, -24375=>2678, -24407=>2679, -24428=>2680, -24425=>2681, -24427=>2682, -24471=>2683, -24473=>2684, -24478=>2685, -24472=>2686, -24481=>2687, -24480=>2688, -24476=>2689, -24703=>2690, -24739=>2691, -24713=>2692, -24736=>2693, -24744=>2694, -24779=>2695, -24756=>2696, -24806=>2697, -24765=>2698, -24773=>2699, -24763=>2700, -24757=>2701, -24796=>2702, -24764=>2703, -24792=>2704, -24789=>2705, -24774=>2706, -24799=>2707, -24760=>2708, -24794=>2709, -24775=>2710, -25114=>2711, -25115=>2712, -25160=>2713, -25504=>2714, -25511=>2715, -25458=>2716, -25494=>2717, -25506=>2718, -25509=>2719, -25463=>2720, -25447=>2721, -25496=>2722, -25514=>2723, -25457=>2724, -25513=>2725, -25481=>2726, -25475=>2727, -25499=>2728, -25451=>2729, -25512=>2730, -25476=>2731, -25480=>2732, -25497=>2733, -25505=>2734, -25516=>2735, -25490=>2736, -25487=>2737, -25472=>2738, -25467=>2739, -25449=>2740, -25448=>2741, -25466=>2742, -25949=>2743, -25942=>2744, -25937=>2745, -25945=>2746, -25943=>2747, -21855=>2748, -25935=>2749, -25944=>2750, -25941=>2751, -25940=>2752, -26012=>2753, -26011=>2754, -26028=>2755, -26063=>2756, -26059=>2757, -26060=>2758, -26062=>2759, -26205=>2760, -26202=>2761, -26212=>2762, -26216=>2763, -26214=>2764, -26206=>2765, -26361=>2766, -21207=>2767, -26395=>2768, -26753=>2769, -26799=>2770, -26786=>2771, -26771=>2772, -26805=>2773, -26751=>2774, -26742=>2775, -26801=>2776, -26791=>2777, -26775=>2778, -26800=>2779, -26755=>2780, -26820=>2781, -26797=>2782, -26758=>2783, -26757=>2784, -26772=>2785, -26781=>2786, -26792=>2787, -26783=>2788, -26785=>2789, -26754=>2790, -27442=>2791, -27578=>2792, -27627=>2793, -27628=>2794, -27691=>2795, -28046=>2796, -28092=>2797, -28147=>2798, -28121=>2799, -28082=>2800, -28129=>2801, -28108=>2802, -28132=>2803, -28155=>2804, -28154=>2805, -28165=>2806, -28103=>2807, -28107=>2808, -28079=>2809, -28113=>2810, -28078=>2811, -28126=>2812, -28153=>2813, -28088=>2814, -28151=>2815, -28149=>2816, -28101=>2817, -28114=>2818, -28186=>2819, -28085=>2820, -28122=>2821, -28139=>2822, -28120=>2823, -28138=>2824, -28145=>2825, -28142=>2826, -28136=>2827, -28102=>2828, -28100=>2829, -28074=>2830, -28140=>2831, -28095=>2832, -28134=>2833, -28921=>2834, -28937=>2835, -28938=>2836, -28925=>2837, -28911=>2838, -29245=>2839, -29309=>2840, -29313=>2841, -29468=>2842, -29467=>2843, -29462=>2844, -29459=>2845, -29465=>2846, -29575=>2847, -29701=>2848, -29706=>2849, -29699=>2850, -29702=>2851, -29694=>2852, -29709=>2853, -29920=>2854, -29942=>2855, -29943=>2856, -29980=>2857, -29986=>2858, -30053=>2859, -30054=>2860, -30050=>2861, -30064=>2862, -30095=>2863, -30164=>2864, -30165=>2865, -30133=>2866, -30154=>2867, -30157=>2868, -30350=>2869, -30420=>2870, -30418=>2871, -30427=>2872, -30519=>2873, -30526=>2874, -30524=>2875, -30518=>2876, -30520=>2877, -30522=>2878, -30827=>2879, -30787=>2880, -30798=>2881, -31077=>2882, -31080=>2883, -31085=>2884, -31227=>2885, -31378=>2886, -31381=>2887, -31520=>2888, -31528=>2889, -31515=>2890, -31532=>2891, -31526=>2892, -31513=>2893, -31518=>2894, -31534=>2895, -31890=>2896, -31895=>2897, -31893=>2898, -32070=>2899, -32067=>2900, -32113=>2901, -32046=>2902, -32057=>2903, -32060=>2904, -32064=>2905, -32048=>2906, -32051=>2907, -32068=>2908, -32047=>2909, -32066=>2910, -32050=>2911, -32049=>2912, -32573=>2913, -32670=>2914, -32666=>2915, -32716=>2916, -32718=>2917, -32722=>2918, -32796=>2919, -32842=>2920, -32838=>2921, -33071=>2922, -33046=>2923, -33059=>2924, -33067=>2925, -33065=>2926, -33072=>2927, -33060=>2928, -33282=>2929, -33333=>2930, -33335=>2931, -33334=>2932, -33337=>2933, -33678=>2934, -33694=>2935, -33688=>2936, -33656=>2937, -33698=>2938, -33686=>2939, -33725=>2940, -33707=>2941, -33682=>2942, -33674=>2943, -33683=>2944, -33673=>2945, -33696=>2946, -33655=>2947, -33659=>2948, -33660=>2949, -33670=>2950, -33703=>2951, -34389=>2952, -24426=>2953, -34503=>2954, -34496=>2955, -34486=>2956, -34500=>2957, -34485=>2958, -34502=>2959, -34507=>2960, -34481=>2961, -34479=>2962, -34505=>2963, -34899=>2964, -34974=>2965, -34952=>2966, -34987=>2967, -34962=>2968, -34966=>2969, -34957=>2970, -34955=>2971, -35219=>2972, -35215=>2973, -35370=>2974, -35357=>2975, -35363=>2976, -35365=>2977, -35377=>2978, -35373=>2979, -35359=>2980, -35355=>2981, -35362=>2982, -35913=>2983, -35930=>2984, -36009=>2985, -36012=>2986, -36011=>2987, -36008=>2988, -36010=>2989, -36007=>2990, -36199=>2991, -36198=>2992, -36286=>2993, -36282=>2994, -36571=>2995, -36575=>2996, -36889=>2997, -36877=>2998, -36890=>2999, -36887=>3000, -36899=>3001, -36895=>3002, -36893=>3003, -36880=>3004, -36885=>3005, -36894=>3006, -36896=>3007, -36879=>3008, -36898=>3009, -36886=>3010, -36891=>3011, -36884=>3012, -37096=>3013, -37101=>3014, -37117=>3015, -58488=>3015, -37207=>3016, -37326=>3017, -37365=>3018, -37350=>3019, -37347=>3020, -37351=>3021, -37357=>3022, -37353=>3023, -38281=>3024, -38506=>3025, -38517=>3026, -38515=>3027, -38520=>3028, -38512=>3029, -38516=>3030, -38518=>3031, -38519=>3032, -38508=>3033, -38592=>3034, -38634=>3035, -38633=>3036, -31456=>3037, -31455=>3038, -38914=>3039, -38915=>3040, -39770=>3041, -12226=>3041, -40165=>3042, -12227=>3042, -40565=>3043, -12228=>3043, -40575=>3044, -12229=>3044, -40613=>3045, -12230=>3045, -40635=>3046, -12231=>3046, -20642=>3047, -20621=>3048, -20613=>3049, -20633=>3050, -20625=>3051, -20608=>3052, -20630=>3053, -20632=>3054, -20634=>3055, -26368=>3056, -20977=>3057, -21106=>3058, -21108=>3059, -21109=>3060, -21097=>3061, -21214=>3062, -21213=>3063, -21211=>3064, -21338=>3065, -21413=>3066, -21883=>3067, -21888=>3068, -21927=>3069, -21884=>3070, -21898=>3071, -21917=>3072, -21912=>3073, -21890=>3074, -21916=>3075, -21930=>3076, -21908=>3077, -21895=>3078, -21899=>3079, -21891=>3080, -21939=>3081, -21934=>3082, -21919=>3083, -21822=>3084, -21938=>3085, -21914=>3086, -21947=>3087, -21932=>3088, -21937=>3089, -21886=>3090, -21897=>3091, -21931=>3092, -21913=>3093, -22285=>3094, -22575=>3095, -22570=>3096, -22580=>3097, -22564=>3098, -22576=>3099, -22577=>3100, -22561=>3101, -22557=>3102, -22560=>3103, -22777=>3104, -22778=>3105, -22880=>3106, -23159=>3107, -57587=>3107, -23194=>3108, -23167=>3109, -23186=>3110, -23195=>3111, -23207=>3112, -23411=>3113, -23409=>3114, -23506=>3115, -23500=>3116, -23507=>3117, -23504=>3118, -23562=>3119, -23563=>3120, -23601=>3121, -23884=>3122, -23888=>3123, -23860=>3124, -23879=>3125, -24061=>3126, -24133=>3127, -24125=>3128, -24128=>3129, -24131=>3130, -24190=>3131, -24266=>3132, -24257=>3133, -24258=>3134, -24260=>3135, -24380=>3136, -24429=>3137, -24489=>3138, -24490=>3139, -24488=>3140, -24785=>3141, -24801=>3142, -24754=>3143, -24758=>3144, -24800=>3145, -24860=>3146, -24867=>3147, -24826=>3148, -24853=>3149, -24816=>3150, -24827=>3151, -24820=>3152, -24936=>3153, -24817=>3154, -24846=>3155, -24822=>3156, -24841=>3157, -24832=>3158, -24850=>3159, -25119=>3160, -25161=>3161, -25507=>3162, -25484=>3163, -25551=>3164, -25536=>3165, -25577=>3166, -25545=>3167, -25542=>3168, -25549=>3169, -25554=>3170, -25571=>3171, -25552=>3172, -25569=>3173, -25558=>3174, -25581=>3175, -25582=>3176, -25462=>3177, -25588=>3178, -25578=>3179, -25563=>3180, -25682=>3181, -25562=>3182, -25593=>3183, -25950=>3184, -25958=>3185, -25954=>3186, -25955=>3187, -26001=>3188, -26000=>3189, -26031=>3190, -26222=>3191, -26224=>3192, -26228=>3193, -57786=>3193, -26230=>3194, -26223=>3195, -26257=>3196, -26234=>3197, -26238=>3198, -26231=>3199, -26366=>3200, -26367=>3201, -26399=>3202, -26397=>3203, -26874=>3204, -26837=>3205, -26848=>3206, -26840=>3207, -26839=>3208, -26885=>3209, -26847=>3210, -26869=>3211, -26862=>3212, -26855=>3213, -26873=>3214, -26834=>3215, -26866=>3216, -26851=>3217, -26827=>3218, -26829=>3219, -26893=>3220, -26898=>3221, -26894=>3222, -26825=>3223, -26842=>3224, -26990=>3225, -26875=>3226, -27454=>3227, -27450=>3228, -27453=>3229, -27544=>3230, -27542=>3231, -27580=>3232, -27631=>3233, -27694=>3234, -27695=>3235, -27692=>3236, -28207=>3237, -57904=>3237, -28216=>3238, -28244=>3239, -28193=>3240, -28210=>3241, -28263=>3242, -28234=>3243, -28192=>3244, -28197=>3245, -28195=>3246, -28187=>3247, -28251=>3248, -28248=>3249, -28196=>3250, -28246=>3251, -28270=>3252, -28205=>3253, -28198=>3254, -28271=>3255, -28212=>3256, -28237=>3257, -28218=>3258, -28204=>3259, -28227=>3260, -28189=>3261, -57901=>3261, -28222=>3262, -28363=>3263, -28297=>3264, -28185=>3265, -28238=>3266, -28259=>3267, -28228=>3268, -28274=>3269, -28265=>3270, -28255=>3271, -28953=>3272, -28954=>3273, -28966=>3274, -28976=>3275, -28961=>3276, -28982=>3277, -29038=>3278, -57958=>3278, -28956=>3279, -29260=>3280, -29316=>3281, -29312=>3282, -29494=>3283, -29477=>3284, -29492=>3285, -29481=>3286, -29754=>3287, -29738=>3288, -29747=>3289, -29730=>3290, -29733=>3291, -29749=>3292, -29750=>3293, -29748=>3294, -29743=>3295, -29723=>3296, -29734=>3297, -29736=>3298, -29989=>3299, -29990=>3300, -30059=>3301, -30058=>3302, -30178=>3303, -30171=>3304, -30179=>3305, -30169=>3306, -30168=>3307, -30174=>3308, -30176=>3309, -30331=>3310, -30332=>3311, -30358=>3312, -30355=>3313, -30388=>3314, -30428=>3315, -30543=>3316, -30701=>3317, -30813=>3318, -30828=>3319, -30831=>3320, -31245=>3321, -31240=>3322, -31243=>3323, -31237=>3324, -31232=>3325, -31384=>3326, -31383=>3327, -31382=>3328, -31461=>3329, -31459=>3330, -31561=>3331, -31574=>3332, -31558=>3333, -31568=>3334, -31570=>3335, -31572=>3336, -31565=>3337, -31563=>3338, -31567=>3339, -31569=>3340, -60510=>3340, -31903=>3341, -31909=>3342, -32094=>3343, -32080=>3344, -32104=>3345, -32085=>3346, -32043=>3347, -32110=>3348, -32114=>3349, -32097=>3350, -32102=>3351, -32098=>3352, -32112=>3353, -32115=>3354, -21892=>3355, -32724=>3356, -32725=>3357, -32779=>3358, -32850=>3359, -32901=>3360, -33109=>3361, -33108=>3362, -33099=>3363, -33105=>3364, -33102=>3365, -33081=>3366, -33094=>3367, -33086=>3368, -33100=>3369, -33107=>3370, -33140=>3371, -33298=>3372, -33308=>3373, -33769=>3374, -33795=>3375, -33784=>3376, -33805=>3377, -33760=>3378, -33733=>3379, -33803=>3380, -33729=>3381, -58309=>3381, -33775=>3382, -33777=>3383, -33780=>3384, -33879=>3385, -33802=>3386, -33776=>3387, -33804=>3388, -33740=>3389, -33789=>3390, -33778=>3391, -33738=>3392, -33848=>3393, -33806=>3394, -33796=>3395, -33756=>3396, -33799=>3397, -33748=>3398, -33759=>3399, -34395=>3400, -34527=>3401, -34521=>3402, -34541=>3403, -34516=>3404, -34523=>3405, -34532=>3406, -34512=>3407, -34526=>3408, -34903=>3409, -35009=>3410, -35010=>3411, -34993=>3412, -35203=>3413, -35222=>3414, -35387=>3415, -35424=>3416, -35413=>3417, -35422=>3418, -35388=>3419, -35393=>3420, -35412=>3421, -35419=>3422, -35408=>3423, -35398=>3424, -35380=>3425, -35386=>3426, -35382=>3427, -35414=>3428, -35937=>3429, -35970=>3430, -36015=>3431, -36028=>3432, -36019=>3433, -36029=>3434, -36033=>3435, -36027=>3436, -36032=>3437, -36020=>3438, -36023=>3439, -36022=>3440, -36031=>3441, -36024=>3442, -36234=>3443, -36229=>3444, -36225=>3445, -36302=>3446, -36317=>3447, -36299=>3448, -36314=>3449, -36305=>3450, -36300=>3451, -36315=>3452, -36294=>3453, -36603=>3454, -36600=>3455, -36604=>3456, -36764=>3457, -36910=>3458, -36917=>3459, -36913=>3460, -36920=>3461, -36914=>3462, -36918=>3463, -37122=>3464, -37109=>3465, -37129=>3466, -37118=>3467, -37219=>3468, -37221=>3469, -37327=>3470, -37396=>3471, -37397=>3472, -37411=>3473, -37385=>3474, -37406=>3475, -37389=>3476, -37392=>3477, -37383=>3478, -37393=>3479, -38292=>3480, -38287=>3481, -38283=>3482, -38289=>3483, -38291=>3484, -38290=>3485, -38286=>3486, -38538=>3487, -38542=>3488, -38539=>3489, -38525=>3490, -38533=>3491, -38534=>3492, -38541=>3493, -38514=>3494, -38532=>3495, -38593=>3496, -38597=>3497, -38596=>3498, -38598=>3499, -38599=>3500, -38639=>3501, -38642=>3502, -38860=>3503, -38917=>3504, -38918=>3505, -38920=>3506, -39143=>3507, -39146=>3508, -39151=>3509, -39145=>3510, -39154=>3511, -39149=>3512, -39342=>3513, -39341=>3514, -40643=>3515, -12232=>3515, -40653=>3516, -12233=>3516, -40657=>3517, -12234=>3517, -20098=>3518, -20653=>3519, -20661=>3520, -20658=>3521, -20659=>3522, -20677=>3523, -20670=>3524, -20652=>3525, -20663=>3526, -20667=>3527, -20655=>3528, -20679=>3529, -21119=>3530, -21111=>3531, -21117=>3532, -21215=>3533, -21222=>3534, -21220=>3535, -21218=>3536, -21219=>3537, -21295=>3538, -21983=>3539, -21992=>3540, -21971=>3541, -21990=>3542, -21966=>3543, -21980=>3544, -21959=>3545, -21969=>3546, -21987=>3547, -21988=>3548, -21999=>3549, -21978=>3550, -21985=>3551, -21957=>3552, -21958=>3553, -21989=>3554, -21961=>3555, -22290=>3556, -22291=>3557, -22622=>3558, -22609=>3559, -22616=>3560, -22615=>3561, -22618=>3562, -22612=>3563, -22635=>3564, -22604=>3565, -22637=>3566, -22602=>3567, -22626=>3568, -22610=>3569, -22603=>3570, -22887=>3571, -23233=>3572, -23241=>3573, -23244=>3574, -23230=>3575, -23229=>3576, -23228=>3577, -23219=>3578, -23234=>3579, -23218=>3580, -23913=>3581, -23919=>3582, -24140=>3583, -24185=>3584, -24265=>3585, -24264=>3586, -24338=>3587, -24409=>3588, -24492=>3589, -24494=>3590, -24858=>3591, -24847=>3592, -24904=>3593, -24863=>3594, -24819=>3595, -24859=>3596, -24825=>3597, -24833=>3598, -24840=>3599, -24910=>3600, -24908=>3601, -24900=>3602, -24909=>3603, -24894=>3604, -24884=>3605, -24871=>3606, -24845=>3607, -24838=>3608, -24887=>3609, -25121=>3610, -25122=>3611, -25619=>3612, -25662=>3613, -25630=>3614, -25642=>3615, -25645=>3616, -25661=>3617, -25644=>3618, -25615=>3619, -25628=>3620, -25620=>3621, -25613=>3622, -25654=>3623, -25622=>3624, -25623=>3625, -25606=>3626, -25964=>3627, -26015=>3628, -26032=>3629, -26263=>3630, -26249=>3631, -26247=>3632, -26248=>3633, -26262=>3634, -26244=>3635, -26264=>3636, -26253=>3637, -26371=>3638, -27028=>3639, -26989=>3640, -26970=>3641, -26999=>3642, -26976=>3643, -26964=>3644, -26997=>3645, -26928=>3646, -27010=>3647, -26954=>3648, -26984=>3649, -26987=>3650, -26974=>3651, -26963=>3652, -27001=>3653, -27014=>3654, -26973=>3655, -26979=>3656, -26971=>3657, -27463=>3658, -27506=>3659, -27584=>3660, -27583=>3661, -27603=>3662, -27645=>3663, -28322=>3664, -28335=>3665, -28371=>3666, -28342=>3667, -28354=>3668, -28304=>3669, -28317=>3670, -28359=>3671, -28357=>3672, -28325=>3673, -28312=>3674, -28348=>3675, -28346=>3676, -28331=>3677, -28369=>3678, -28310=>3679, -28316=>3680, -28356=>3681, -28372=>3682, -28330=>3683, -28327=>3684, -28340=>3685, -29006=>3686, -29017=>3687, -29033=>3688, -29028=>3689, -29001=>3690, -29031=>3691, -29020=>3692, -29036=>3693, -29030=>3694, -29004=>3695, -29029=>3696, -29022=>3697, -28998=>3698, -29032=>3699, -29014=>3700, -29242=>3701, -29266=>3702, -29495=>3703, -29509=>3704, -29503=>3705, -29502=>3706, -29807=>3707, -29786=>3708, -29781=>3709, -29791=>3710, -29790=>3711, -29761=>3712, -29759=>3713, -29785=>3714, -29787=>3715, -58019=>3716, -29788=>3716, -30070=>3717, -30072=>3718, -30208=>3719, -30192=>3720, -30209=>3721, -30194=>3722, -30193=>3723, -30202=>3724, -30207=>3725, -30196=>3726, -30195=>3727, -30430=>3728, -30431=>3729, -30555=>3730, -30571=>3731, -30566=>3732, -30558=>3733, -30563=>3734, -30585=>3735, -30570=>3736, -30572=>3737, -30556=>3738, -30565=>3739, -30568=>3740, -30562=>3741, -30702=>3742, -30862=>3743, -30896=>3744, -30871=>3745, -30872=>3746, -30860=>3747, -30857=>3748, -30844=>3749, -30865=>3750, -30867=>3751, -30847=>3752, -31098=>3753, -31103=>3754, -31105=>3755, -33836=>3756, -31165=>3757, -31260=>3758, -31258=>3759, -31264=>3760, -31252=>3761, -31263=>3762, -31262=>3763, -31391=>3764, -31392=>3765, -31607=>3766, -31680=>3767, -31584=>3768, -31598=>3769, -31591=>3770, -31921=>3771, -31923=>3772, -31925=>3773, -32147=>3774, -32121=>3775, -32145=>3776, -32129=>3777, -32143=>3778, -32091=>3779, -32622=>3780, -32617=>3781, -32618=>3782, -32626=>3783, -32681=>3784, -32680=>3785, -32676=>3786, -32854=>3787, -32856=>3788, -32902=>3789, -32900=>3790, -33137=>3791, -33136=>3792, -33144=>3793, -33125=>3794, -33134=>3795, -33139=>3796, -33131=>3797, -33145=>3798, -33146=>3799, -33126=>3800, -33285=>3801, -33351=>3802, -33922=>3803, -33911=>3804, -33853=>3805, -33841=>3806, -33909=>3807, -33894=>3808, -33899=>3809, -33865=>3810, -33900=>3811, -33883=>3812, -33852=>3813, -33845=>3814, -33889=>3815, -33891=>3816, -33897=>3817, -33901=>3818, -33862=>3819, -34398=>3820, -34396=>3821, -34399=>3822, -34553=>3823, -34579=>3824, -34568=>3825, -34567=>3826, -34560=>3827, -34558=>3828, -34555=>3829, -34562=>3830, -34563=>3831, -34566=>3832, -34570=>3833, -34905=>3834, -35039=>3835, -35028=>3836, -35033=>3837, -35036=>3838, -35032=>3839, -35037=>3840, -35041=>3841, -35018=>3842, -35029=>3843, -35026=>3844, -35228=>3845, -35299=>3846, -35435=>3847, -35442=>3848, -35443=>3849, -35430=>3850, -35433=>3851, -35440=>3852, -35463=>3853, -35452=>3854, -35427=>3855, -35488=>3856, -35441=>3857, -35461=>3858, -35437=>3859, -35426=>3860, -35438=>3861, -35436=>3862, -35449=>3863, -35451=>3864, -35390=>3865, -35432=>3866, -35938=>3867, -35978=>3868, -35977=>3869, -36042=>3870, -36039=>3871, -36040=>3872, -36036=>3873, -36018=>3874, -36035=>3875, -36034=>3876, -36037=>3877, -36321=>3878, -36319=>3879, -36328=>3880, -36335=>3881, -36339=>3882, -36346=>3883, -36330=>3884, -36324=>3885, -36326=>3886, -36530=>3887, -36611=>3888, -36617=>3889, -36606=>3890, -36618=>3891, -36767=>3892, -36786=>3893, -36939=>3894, -36938=>3895, -36947=>3896, -36930=>3897, -36948=>3898, -36924=>3899, -36949=>3900, -36944=>3901, -36935=>3902, -36943=>3903, -36942=>3904, -36941=>3905, -36945=>3906, -36926=>3907, -36929=>3908, -37138=>3909, -37143=>3910, -37228=>3911, -37226=>3912, -37225=>3913, -37321=>3914, -37431=>3915, -37463=>3916, -37432=>3917, -37437=>3918, -37440=>3919, -37438=>3920, -37467=>3921, -37451=>3922, -37476=>3923, -37457=>3924, -37428=>3925, -37449=>3926, -37453=>3927, -37445=>3928, -37433=>3929, -37439=>3930, -37466=>3931, -38296=>3932, -38552=>3933, -38548=>3934, -38549=>3935, -38605=>3936, -38603=>3937, -38601=>3938, -38602=>3939, -38647=>3940, -38651=>3941, -38649=>3942, -38646=>3943, -38742=>3944, -38772=>3945, -38774=>3946, -38928=>3947, -38929=>3948, -38931=>3949, -38922=>3950, -38930=>3951, -38924=>3952, -39164=>3953, -39156=>3954, -39165=>3955, -39166=>3956, -39347=>3957, -39345=>3958, -39348=>3959, -39649=>3960, -40169=>3961, -40578=>3962, -40718=>3963, -12237=>3963, -40723=>3964, -12238=>3964, -40736=>3965, -12239=>3965, -20711=>3966, -20718=>3967, -20709=>3968, -20694=>3969, -20717=>3970, -60903=>3970, -20698=>3971, -20693=>3972, -20687=>3973, -20689=>3974, -20721=>3975, -20686=>3976, -20713=>3977, -20834=>3978, -20979=>3979, -21123=>3980, -21122=>3981, -21297=>3982, -21421=>3983, -22014=>3984, -22016=>3985, -22043=>3986, -22039=>3987, -22013=>3988, -22036=>3989, -22022=>3990, -22025=>3991, -22029=>3992, -22030=>3993, -22007=>3994, -22038=>3995, -22047=>3996, -22024=>3997, -22032=>3998, -22006=>3999, -22296=>4000, -22294=>4001, -22645=>4002, -22654=>4003, -22659=>4004, -22675=>4005, -22666=>4006, -22649=>4007, -22661=>4008, -22653=>4009, -22781=>4010, -22821=>4011, -22818=>4012, -22820=>4013, -22890=>4014, -22889=>4015, -23265=>4016, -23270=>4017, -23273=>4018, -23255=>4019, -23254=>4020, -23256=>4021, -23267=>4022, -23413=>4023, -23518=>4024, -23527=>4025, -23521=>4026, -23525=>4027, -23526=>4028, -23528=>4029, -23522=>4030, -23524=>4031, -23519=>4032, -23565=>4033, -23650=>4034, -23940=>4035, -23943=>4036, -24155=>4037, -24163=>4038, -24149=>4039, -24151=>4040, -24148=>4041, -24275=>4042, -24278=>4043, -24330=>4044, -24390=>4045, -24432=>4046, -24505=>4047, -24903=>4048, -24895=>4049, -24907=>4050, -24951=>4051, -24930=>4052, -24931=>4053, -24927=>4054, -24922=>4055, -24920=>4056, -24949=>4057, -25130=>4058, -25735=>4059, -25688=>4060, -25684=>4061, -25764=>4062, -25720=>4063, -25695=>4064, -25722=>4065, -25681=>4066, -25703=>4067, -25652=>4068, -25709=>4069, -25723=>4070, -25970=>4071, -26017=>4072, -26071=>4073, -26070=>4074, -26274=>4075, -26280=>4076, -26269=>4077, -27036=>4078, -27048=>4079, -27029=>4080, -27073=>4081, -27054=>4082, -27091=>4083, -27083=>4084, -27035=>4085, -27063=>4086, -27067=>4087, -27051=>4088, -27060=>4089, -27088=>4090, -27085=>4091, -27053=>4092, -27084=>4093, -27046=>4094, -27075=>4095, -27043=>4096, -27465=>4097, -27468=>4098, -27699=>4099, -28467=>4100, -28436=>4101, -28414=>4102, -28435=>4103, -28404=>4104, -28457=>4105, -28478=>4106, -28448=>4107, -28460=>4108, -28431=>4109, -28418=>4110, -28450=>4111, -28415=>4112, -28399=>4113, -28422=>4114, -28465=>4115, -28472=>4116, -28466=>4117, -28451=>4118, -28437=>4119, -28459=>4120, -28463=>4121, -28552=>4122, -28458=>4123, -28396=>4124, -28417=>4125, -28402=>4126, -28364=>4127, -28407=>4128, -29076=>4129, -29081=>4130, -29053=>4131, -29066=>4132, -29060=>4133, -29074=>4134, -29246=>4135, -29330=>4136, -29334=>4137, -29508=>4138, -29520=>4139, -29796=>4140, -29795=>4141, -29802=>4142, -29808=>4143, -29805=>4144, -29956=>4145, -30097=>4146, -30247=>4147, -30221=>4148, -30219=>4149, -30217=>4150, -30227=>4151, -30433=>4152, -30435=>4153, -30596=>4154, -30589=>4155, -30591=>4156, -30561=>4157, -30913=>4158, -30879=>4159, -30887=>4160, -30899=>4161, -30889=>4162, -30883=>4163, -31118=>4164, -31119=>4165, -31117=>4166, -31278=>4167, -31281=>4168, -31402=>4169, -31401=>4170, -31469=>4171, -31471=>4172, -31649=>4173, -31637=>4174, -31627=>4175, -31605=>4176, -31639=>4177, -31645=>4178, -31636=>4179, -31631=>4180, -31672=>4181, -58170=>4181, -31623=>4182, -31620=>4183, -31929=>4184, -31933=>4185, -31934=>4186, -32187=>4187, -32176=>4188, -32156=>4189, -32189=>4190, -32190=>4191, -32160=>4192, -32202=>4193, -32180=>4194, -32178=>4195, -32177=>4196, -32186=>4197, -32162=>4198, -32191=>4199, -32181=>4200, -32184=>4201, -32173=>4202, -32210=>4203, -58202=>4203, -32199=>4204, -32172=>4205, -32624=>4206, -32736=>4207, -32737=>4208, -32735=>4209, -32862=>4210, -32858=>4211, -32903=>4212, -33104=>4213, -33152=>4214, -33167=>4215, -33160=>4216, -33162=>4217, -33151=>4218, -33154=>4219, -33255=>4220, -33274=>4221, -33287=>4222, -33300=>4223, -33310=>4224, -33355=>4225, -33993=>4226, -33983=>4227, -33990=>4228, -33988=>4229, -33945=>4230, -33950=>4231, -33970=>4232, -33948=>4233, -33995=>4234, -33976=>4235, -33984=>4236, -34003=>4237, -33936=>4238, -33980=>4239, -34001=>4240, -33994=>4241, -34623=>4242, -34588=>4243, -34619=>4244, -34594=>4245, -34597=>4246, -34612=>4247, -34584=>4248, -34645=>4249, -34615=>4250, -34601=>4251, -35059=>4252, -35074=>4253, -35060=>4254, -35065=>4255, -35064=>4256, -35069=>4257, -35048=>4258, -35098=>4259, -35055=>4260, -35494=>4261, -35468=>4262, -35486=>4263, -35491=>4264, -35469=>4265, -35489=>4266, -35475=>4267, -35492=>4268, -35498=>4269, -35493=>4270, -35496=>4271, -35480=>4272, -35473=>4273, -35482=>4274, -35495=>4275, -35946=>4276, -35981=>4277, -35980=>4278, -36051=>4279, -36049=>4280, -36050=>4281, -36203=>4282, -36249=>4283, -36245=>4284, -36348=>4285, -36628=>4286, -36626=>4287, -36629=>4288, -36627=>4289, -36771=>4290, -36960=>4291, -36952=>4292, -36956=>4293, -36963=>4294, -36953=>4295, -36958=>4296, -36962=>4297, -36957=>4298, -36955=>4299, -37145=>4300, -37144=>4301, -37150=>4302, -37237=>4303, -37240=>4304, -37239=>4305, -37236=>4306, -37496=>4307, -37548=>4308, -37504=>4309, -37509=>4310, -37528=>4311, -37526=>4312, -37499=>4313, -37523=>4314, -37532=>4315, -37544=>4316, -37500=>4317, -37521=>4318, -38305=>4319, -38312=>4320, -38313=>4321, -38307=>4322, -38309=>4323, -38308=>4324, -38553=>4325, -38556=>4326, -38555=>4327, -38604=>4328, -38610=>4329, -38656=>4330, -38780=>4331, -38789=>4332, -38902=>4333, -38935=>4334, -38936=>4335, -39087=>4336, -39089=>4337, -39171=>4338, -39173=>4339, -39180=>4340, -39177=>4341, -39361=>4342, -39599=>4343, -39600=>4344, -39654=>4345, -39745=>4346, -39746=>4347, -40180=>4348, -40182=>4349, -40179=>4350, -40636=>4351, -40763=>4352, -12240=>4352, -40778=>4353, -12241=>4353, -20740=>4354, -20736=>4355, -20731=>4356, -20725=>4357, -20729=>4358, -20738=>4359, -20744=>4360, -20745=>4361, -20741=>4362, -20956=>4363, -21127=>4364, -21128=>4365, -21129=>4366, -21133=>4367, -21130=>4368, -21232=>4369, -21426=>4370, -22062=>4371, -22075=>4372, -22073=>4373, -22066=>4374, -22079=>4375, -22068=>4376, -22057=>4377, -22099=>4378, -22094=>4379, -22103=>4380, -22132=>4381, -22070=>4382, -22063=>4383, -22064=>4384, -22656=>4385, -22687=>4386, -22686=>4387, -22707=>4388, -22684=>4389, -22702=>4390, -22697=>4391, -22694=>4392, -22893=>4393, -23305=>4394, -23291=>4395, -23307=>4396, -23285=>4397, -23308=>4398, -23304=>4399, -23534=>4400, -23532=>4401, -23529=>4402, -23531=>4403, -23652=>4404, -23653=>4405, -23965=>4406, -23956=>4407, -24162=>4408, -24159=>4409, -24161=>4410, -24290=>4411, -24282=>4412, -24287=>4413, -24285=>4414, -24291=>4415, -24288=>4416, -24392=>4417, -24433=>4418, -24503=>4419, -24501=>4420, -24950=>4421, -24935=>4422, -24942=>4423, -24925=>4424, -24917=>4425, -24962=>4426, -24956=>4427, -24944=>4428, -24939=>4429, -24958=>4430, -24999=>4431, -24976=>4432, -25003=>4433, -24974=>4434, -25004=>4435, -24986=>4436, -24996=>4437, -24980=>4438, -25006=>4439, -25134=>4440, -25705=>4441, -25711=>4442, -25721=>4443, -25758=>4444, -25778=>4445, -25736=>4446, -25744=>4447, -57745=>4447, -25776=>4448, -25765=>4449, -25747=>4450, -25749=>4451, -25769=>4452, -25746=>4453, -25774=>4454, -25773=>4455, -25771=>4456, -25754=>4457, -25772=>4458, -25753=>4459, -25762=>4460, -25779=>4461, -25973=>4462, -25975=>4463, -25976=>4464, -26286=>4465, -26283=>4466, -26292=>4467, -26289=>4468, -27171=>4469, -27167=>4470, -27112=>4471, -27137=>4472, -27166=>4473, -27161=>4474, -27133=>4475, -27169=>4476, -27155=>4477, -27146=>4478, -27123=>4479, -27138=>4480, -27141=>4481, -27117=>4482, -27153=>4483, -27472=>4484, -27470=>4485, -27556=>4486, -27589=>4487, -27590=>4488, -28479=>4489, -28540=>4490, -28548=>4491, -28497=>4492, -28518=>4493, -28500=>4494, -28550=>4495, -28525=>4496, -28507=>4497, -28536=>4498, -28526=>4499, -28558=>4500, -28538=>4501, -28528=>4502, -28516=>4503, -28567=>4504, -28504=>4505, -28373=>4506, -28527=>4507, -28512=>4508, -28511=>4509, -29087=>4510, -29100=>4511, -29105=>4512, -29096=>4513, -29270=>4514, -29339=>4515, -29518=>4516, -29527=>4517, -29801=>4518, -29835=>4519, -29827=>4520, -29822=>4521, -29824=>4522, -30079=>4523, -30240=>4524, -30249=>4525, -30239=>4526, -30244=>4527, -30246=>4528, -30241=>4529, -30242=>4530, -30362=>4531, -30394=>4532, -30436=>4533, -30606=>4534, -30599=>4535, -30604=>4536, -30609=>4537, -30603=>4538, -30923=>4539, -30917=>4540, -30906=>4541, -30922=>4542, -30910=>4543, -30933=>4544, -30908=>4545, -30928=>4546, -31295=>4547, -31292=>4548, -31296=>4549, -31293=>4550, -31287=>4551, -31291=>4552, -31407=>4553, -31406=>4554, -31661=>4555, -31665=>4556, -31684=>4557, -31668=>4558, -31686=>4559, -31687=>4560, -31681=>4561, -31648=>4562, -31692=>4563, -31946=>4564, -32224=>4565, -32244=>4566, -32239=>4567, -32251=>4568, -32216=>4569, -32236=>4570, -32221=>4571, -32232=>4572, -32227=>4573, -32218=>4574, -32222=>4575, -32233=>4576, -32158=>4577, -32217=>4578, -32242=>4579, -32249=>4580, -32629=>4581, -32631=>4582, -32687=>4583, -32745=>4584, -32806=>4585, -33179=>4586, -33180=>4587, -33181=>4588, -33184=>4589, -33178=>4590, -33176=>4591, -34071=>4592, -34109=>4593, -34074=>4594, -34030=>4595, -34092=>4596, -34093=>4597, -34067=>4598, -34065=>4599, -34083=>4600, -34081=>4601, -34068=>4602, -34028=>4603, -34085=>4604, -34047=>4605, -34054=>4606, -34690=>4607, -34676=>4608, -34678=>4609, -34656=>4610, -34662=>4611, -34680=>4612, -34664=>4613, -34649=>4614, -34647=>4615, -34636=>4616, -34643=>4617, -34907=>4618, -34909=>4619, -35088=>4620, -35079=>4621, -35090=>4622, -35091=>4623, -35093=>4624, -35082=>4625, -35516=>4626, -35538=>4627, -35527=>4628, -35524=>4629, -35477=>4630, -35531=>4631, -35576=>4632, -35506=>4633, -35529=>4634, -35522=>4635, -35519=>4636, -35504=>4637, -35542=>4638, -35533=>4639, -35510=>4640, -35513=>4641, -35547=>4642, -35916=>4643, -35918=>4644, -35948=>4645, -36064=>4646, -36062=>4647, -36070=>4648, -36068=>4649, -36076=>4650, -36077=>4651, -36066=>4652, -36067=>4653, -36060=>4654, -36074=>4655, -36065=>4656, -36205=>4657, -36255=>4658, -36259=>4659, -36395=>4660, -36368=>4661, -36381=>4662, -36386=>4663, -36367=>4664, -36393=>4665, -36383=>4666, -36385=>4667, -36382=>4668, -36538=>4669, -36637=>4670, -36635=>4671, -36639=>4672, -36649=>4673, -36646=>4674, -36650=>4675, -36636=>4676, -36638=>4677, -36645=>4678, -36969=>4679, -36974=>4680, -36968=>4681, -36973=>4682, -36983=>4683, -37168=>4684, -37165=>4685, -37159=>4686, -37169=>4687, -37255=>4688, -37257=>4689, -37259=>4690, -37251=>4691, -37573=>4692, -37563=>4693, -37559=>4694, -37610=>4695, -37604=>4696, -37569=>4697, -37555=>4698, -37564=>4699, -37586=>4700, -37575=>4701, -37616=>4702, -37554=>4703, -38317=>4704, -38321=>4705, -38660=>4706, -38662=>4707, -38663=>4708, -38665=>4709, -38752=>4710, -38797=>4711, -38795=>4712, -38799=>4713, -38945=>4714, -38955=>4715, -38940=>4716, -39091=>4717, -39178=>4718, -39187=>4719, -39186=>4720, -39192=>4721, -39389=>4722, -39376=>4723, -39391=>4724, -39387=>4725, -39377=>4726, -39381=>4727, -39378=>4728, -39385=>4729, -39607=>4730, -39662=>4731, -39663=>4732, -39719=>4733, -39749=>4734, -39748=>4735, -39799=>4736, -39791=>4737, -40198=>4738, -40201=>4739, -40195=>4740, -40617=>4741, -40638=>4742, -40654=>4743, -22696=>4744, -12242=>4745, -40786=>4745, -20754=>4746, -20760=>4747, -20756=>4748, -20752=>4749, -20757=>4750, -20864=>4751, -20906=>4752, -20957=>4753, -21137=>4754, -21139=>4755, -21235=>4756, -22105=>4757, -22123=>4758, -22137=>4759, -22121=>4760, -22116=>4761, -22136=>4762, -22122=>4763, -22120=>4764, -22117=>4765, -22129=>4766, -22127=>4767, -22124=>4768, -22114=>4769, -22134=>4770, -22721=>4771, -22718=>4772, -22727=>4773, -22725=>4774, -22894=>4775, -23325=>4776, -23348=>4777, -23416=>4778, -23536=>4779, -23566=>4780, -24394=>4781, -25010=>4782, -24977=>4783, -25001=>4784, -24970=>4785, -25037=>4786, -25014=>4787, -25022=>4788, -25034=>4789, -25032=>4790, -25136=>4791, -25797=>4792, -25793=>4793, -25803=>4794, -25787=>4795, -25788=>4796, -25818=>4797, -25796=>4798, -25799=>4799, -25794=>4800, -25805=>4801, -25791=>4802, -25810=>4803, -25812=>4804, -25790=>4805, -25972=>4806, -26310=>4807, -26313=>4808, -26297=>4809, -26308=>4810, -26311=>4811, -26296=>4812, -27197=>4813, -27192=>4814, -27194=>4815, -27225=>4816, -27243=>4817, -27224=>4818, -27193=>4819, -27204=>4820, -27234=>4821, -27233=>4822, -27211=>4823, -27207=>4824, -27189=>4825, -27231=>4826, -27208=>4827, -27481=>4828, -27511=>4829, -27653=>4830, -28610=>4831, -28593=>4832, -28577=>4833, -28611=>4834, -28580=>4835, -28609=>4836, -28583=>4837, -28595=>4838, -28608=>4839, -28601=>4840, -28598=>4841, -60318=>4841, -28582=>4842, -28576=>4843, -28596=>4844, -29118=>4845, -29129=>4846, -29136=>4847, -29138=>4848, -29128=>4849, -29141=>4850, -29113=>4851, -29134=>4852, -29145=>4853, -29148=>4854, -29123=>4855, -29124=>4856, -29544=>4857, -29852=>4858, -29859=>4859, -29848=>4860, -29855=>4861, -29854=>4862, -29922=>4863, -29964=>4864, -29965=>4865, -30260=>4866, -30264=>4867, -30266=>4868, -30439=>4869, -30437=>4870, -30624=>4871, -30622=>4872, -30623=>4873, -30629=>4874, -30952=>4875, -30938=>4876, -30956=>4877, -30951=>4878, -31142=>4879, -31309=>4880, -31310=>4881, -31302=>4882, -31308=>4883, -31307=>4884, -31418=>4885, -31705=>4886, -31761=>4887, -31689=>4888, -31716=>4889, -31707=>4890, -31713=>4891, -31721=>4892, -31718=>4893, -31957=>4894, -31958=>4895, -32266=>4896, -32273=>4897, -32264=>4898, -32283=>4899, -32291=>4900, -32286=>4901, -32285=>4902, -58211=>4902, -32265=>4903, -32272=>4904, -32633=>4905, -32690=>4906, -32752=>4907, -32753=>4908, -32750=>4909, -32808=>4910, -58239=>4910, -33203=>4911, -33193=>4912, -33192=>4913, -33275=>4914, -33288=>4915, -33368=>4916, -33369=>4917, -34122=>4918, -34137=>4919, -34120=>4920, -34152=>4921, -34153=>4922, -34115=>4923, -34121=>4924, -34157=>4925, -34154=>4926, -34142=>4927, -34691=>4928, -34719=>4929, -34718=>4930, -34722=>4931, -34701=>4932, -34913=>4933, -35114=>4934, -35122=>4935, -35109=>4936, -35115=>4937, -35105=>4938, -35242=>4939, -35238=>4940, -58391=>4940, -35558=>4941, -35578=>4942, -35563=>4943, -35569=>4944, -35584=>4945, -35548=>4946, -35559=>4947, -35566=>4948, -35582=>4949, -35585=>4950, -35586=>4951, -35575=>4952, -35565=>4953, -35571=>4954, -35574=>4955, -35580=>4956, -35947=>4957, -35949=>4958, -35987=>4959, -36084=>4960, -36420=>4961, -36401=>4962, -36404=>4963, -36418=>4964, -36409=>4965, -36405=>4966, -36667=>4967, -36655=>4968, -36664=>4969, -36659=>4970, -36776=>4971, -36774=>4972, -36981=>4973, -36980=>4974, -36984=>4975, -36978=>4976, -36988=>4977, -36986=>4978, -37172=>4979, -37266=>4980, -37664=>4981, -37686=>4982, -37624=>4983, -37683=>4984, -37679=>4985, -37666=>4986, -37628=>4987, -37675=>4988, -37636=>4989, -37658=>4990, -37648=>4991, -37670=>4992, -37665=>4993, -37653=>4994, -37678=>4995, -37657=>4996, -38331=>4997, -38567=>4998, -38568=>4999, -38570=>5000, -38613=>5001, -38670=>5002, -38673=>5003, -38678=>5004, -38669=>5005, -38675=>5006, -38671=>5007, -38747=>5008, -58565=>5009, -38748=>5009, -38758=>5010, -38808=>5011, -38960=>5012, -38968=>5013, -38971=>5014, -38967=>5015, -38957=>5016, -38969=>5017, -38948=>5018, -39184=>5019, -39208=>5020, -39198=>5021, -39195=>5022, -39201=>5023, -39194=>5024, -39405=>5025, -39394=>5026, -39409=>5027, -39608=>5028, -39612=>5029, -39675=>5030, -39661=>5031, -39720=>5032, -39825=>5033, -40213=>5034, -40227=>5035, -40230=>5036, -40232=>5037, -40210=>5038, -40219=>5039, -40664=>5040, -40660=>5041, -40845=>5042, -12243=>5042, -40860=>5043, -12244=>5043, -20778=>5044, -20767=>5045, -20769=>5046, -20786=>5047, -21237=>5048, -22158=>5049, -22144=>5050, -22160=>5051, -22149=>5052, -22151=>5053, -22159=>5054, -22741=>5055, -22739=>5056, -22737=>5057, -22734=>5058, -23344=>5059, -23338=>5060, -23332=>5061, -23418=>5062, -23607=>5063, -23656=>5064, -23996=>5065, -23994=>5066, -23997=>5067, -23992=>5068, -24171=>5069, -24396=>5070, -24509=>5071, -25033=>5072, -25026=>5073, -25031=>5074, -25062=>5075, -25035=>5076, -25138=>5077, -25140=>5078, -25806=>5079, -25802=>5080, -25816=>5081, -25824=>5082, -25840=>5083, -25830=>5084, -25836=>5085, -25841=>5086, -25826=>5087, -25837=>5088, -25986=>5089, -25987=>5090, -26329=>5091, -26326=>5092, -27264=>5093, -27284=>5094, -27268=>5095, -27298=>5096, -27292=>5097, -27355=>5098, -27299=>5099, -27262=>5100, -27287=>5101, -27280=>5102, -27296=>5103, -27484=>5104, -27566=>5105, -27610=>5106, -27656=>5107, -28632=>5108, -28657=>5109, -28639=>5110, -28640=>5111, -28635=>5112, -28644=>5113, -28651=>5114, -28655=>5115, -28544=>5116, -28652=>5117, -28641=>5118, -28649=>5119, -28629=>5120, -28654=>5121, -28656=>5122, -29159=>5123, -29151=>5124, -60361=>5124, -29166=>5125, -29158=>5126, -29157=>5127, -29165=>5128, -29164=>5129, -29172=>5130, -29152=>5131, -29237=>5132, -29254=>5133, -29552=>5134, -29554=>5135, -29865=>5136, -29872=>5137, -29862=>5138, -29864=>5139, -30278=>5140, -30274=>5141, -30284=>5142, -30442=>5143, -30643=>5144, -30634=>5145, -30640=>5146, -30636=>5147, -30631=>5148, -30637=>5149, -30703=>5150, -30967=>5151, -30970=>5152, -30964=>5153, -30959=>5154, -30977=>5155, -31143=>5156, -31146=>5157, -31319=>5158, -31423=>5159, -31751=>5160, -31757=>5161, -31742=>5162, -31735=>5163, -31756=>5164, -31712=>5165, -31968=>5166, -31964=>5167, -31966=>5168, -31970=>5169, -31967=>5170, -31961=>5171, -31965=>5172, -32302=>5173, -32318=>5174, -32326=>5175, -32311=>5176, -32306=>5177, -32323=>5178, -32299=>5179, -32317=>5180, -32305=>5181, -32325=>5182, -32321=>5183, -32308=>5184, -32313=>5185, -32328=>5186, -32309=>5187, -32319=>5188, -32303=>5189, -32580=>5190, -32755=>5191, -32764=>5192, -32881=>5193, -32882=>5194, -32880=>5195, -32879=>5196, -32883=>5197, -33222=>5198, -33219=>5199, -33210=>5200, -33218=>5201, -33216=>5202, -33215=>5203, -33213=>5204, -33225=>5205, -33214=>5206, -33256=>5207, -33289=>5208, -33393=>5209, -34218=>5210, -34180=>5211, -34174=>5212, -34204=>5213, -34193=>5214, -34196=>5215, -34223=>5216, -34203=>5217, -34183=>5218, -34216=>5219, -34186=>5220, -34214=>5221, -34407=>5222, -34752=>5223, -34769=>5224, -34739=>5225, -34770=>5226, -34758=>5227, -34731=>5228, -34747=>5229, -34746=>5230, -34760=>5231, -34763=>5232, -35131=>5233, -35126=>5234, -35140=>5235, -35128=>5236, -35133=>5237, -35244=>5238, -35598=>5239, -35607=>5240, -35609=>5241, -35611=>5242, -35594=>5243, -35616=>5244, -35613=>5245, -35588=>5246, -35600=>5247, -35905=>5248, -35903=>5249, -35955=>5250, -36090=>5251, -36093=>5252, -36092=>5253, -36088=>5254, -36091=>5255, -36264=>5256, -36425=>5257, -36427=>5258, -36424=>5259, -36426=>5260, -36676=>5261, -36670=>5262, -36674=>5263, -36677=>5264, -36671=>5265, -36991=>5266, -36989=>5267, -36996=>5268, -36993=>5269, -36994=>5270, -36992=>5271, -37177=>5272, -37283=>5273, -37278=>5274, -37276=>5275, -37709=>5276, -37762=>5277, -37672=>5278, -37749=>5279, -37706=>5280, -37733=>5281, -37707=>5282, -37656=>5283, -37758=>5284, -37740=>5285, -37723=>5286, -37744=>5287, -37722=>5288, -37716=>5289, -38346=>5290, -38347=>5291, -38348=>5292, -38344=>5293, -38342=>5294, -38577=>5295, -38584=>5296, -38614=>5297, -38684=>5298, -38686=>5299, -38816=>5300, -38867=>5301, -38982=>5302, -39094=>5303, -39221=>5304, -39425=>5305, -39423=>5306, -39854=>5307, -39851=>5308, -39850=>5309, -39853=>5310, -40251=>5311, -40255=>5312, -40587=>5313, -40655=>5314, -40670=>5315, -40668=>5316, -40669=>5317, -40667=>5318, -40766=>5319, -40779=>5320, -21474=>5321, -22165=>5322, -22190=>5323, -22745=>5324, -22744=>5325, -23352=>5326, -24413=>5327, -25059=>5328, -25139=>5329, -25844=>5330, -25842=>5331, -25854=>5332, -25862=>5333, -25850=>5334, -25851=>5335, -25847=>5336, -26039=>5337, -26332=>5338, -26406=>5339, -27315=>5340, -27308=>5341, -27331=>5342, -27323=>5343, -27320=>5344, -27330=>5345, -27310=>5346, -27311=>5347, -27487=>5348, -27512=>5349, -27567=>5350, -28681=>5351, -28683=>5352, -28670=>5353, -28678=>5354, -28666=>5355, -28689=>5356, -28687=>5357, -29179=>5358, -29180=>5359, -29182=>5360, -29176=>5361, -29559=>5362, -29557=>5363, -29863=>5364, -29887=>5365, -29973=>5366, -30294=>5367, -30296=>5368, -30290=>5369, -30653=>5370, -30655=>5371, -30651=>5372, -30652=>5373, -30990=>5374, -31150=>5375, -31329=>5376, -31330=>5377, -31328=>5378, -31428=>5379, -31429=>5380, -31787=>5381, -31783=>5382, -31786=>5383, -31774=>5384, -31779=>5385, -31777=>5386, -31975=>5387, -32340=>5388, -32341=>5389, -32350=>5390, -32346=>5391, -32353=>5392, -32338=>5393, -32345=>5394, -32584=>5395, -32761=>5396, -32763=>5397, -32887=>5398, -32886=>5399, -33229=>5400, -33231=>5401, -33290=>5402, -34255=>5403, -34217=>5404, -34253=>5405, -34256=>5406, -34249=>5407, -34224=>5408, -34234=>5409, -34233=>5410, -34799=>5411, -34796=>5412, -34802=>5413, -34784=>5414, -35206=>5415, -35250=>5416, -35316=>5417, -35624=>5418, -35641=>5419, -35628=>5420, -35627=>5421, -35920=>5422, -36101=>5423, -36441=>5424, -36451=>5425, -36454=>5426, -36452=>5427, -36447=>5428, -36437=>5429, -36544=>5430, -36681=>5431, -36685=>5432, -36999=>5433, -36995=>5434, -37000=>5435, -37291=>5436, -37292=>5437, -37328=>5438, -37780=>5439, -37770=>5440, -37782=>5441, -37794=>5442, -37811=>5443, -37806=>5444, -37804=>5445, -37808=>5446, -37784=>5447, -37786=>5448, -37783=>5449, -38356=>5450, -38358=>5451, -38352=>5452, -38357=>5453, -38626=>5454, -38620=>5455, -38617=>5456, -38619=>5457, -38622=>5458, -38692=>5459, -38819=>5460, -38822=>5461, -38829=>5462, -38905=>5463, -38989=>5464, -38991=>5465, -38988=>5466, -38990=>5467, -38995=>5468, -39098=>5469, -39230=>5470, -39231=>5471, -39229=>5472, -39214=>5473, -39333=>5474, -39438=>5475, -39617=>5476, -39683=>5477, -39686=>5478, -39759=>5479, -39758=>5480, -39757=>5481, -39882=>5482, -39881=>5483, -39933=>5484, -39880=>5485, -39872=>5486, -40273=>5487, -40285=>5488, -40288=>5489, -40672=>5490, -40725=>5491, -40748=>5492, -20787=>5493, -22181=>5494, -22184=>5495, -22750=>5496, -22751=>5497, -22754=>5498, -23541=>5499, -40848=>5500, -24300=>5501, -25074=>5502, -25079=>5503, -25078=>5504, -25077=>5505, -25856=>5506, -25871=>5507, -26336=>5508, -26333=>5509, -27365=>5510, -27357=>5511, -27354=>5512, -27347=>5513, -28699=>5514, -28703=>5515, -28712=>5516, -28698=>5517, -28701=>5518, -28693=>5519, -28696=>5520, -29190=>5521, -29197=>5522, -29272=>5523, -29346=>5524, -29560=>5525, -29562=>5526, -29885=>5527, -29898=>5528, -29923=>5529, -30087=>5530, -30086=>5531, -30303=>5532, -30305=>5533, -30663=>5534, -31001=>5535, -31153=>5536, -31339=>5537, -31337=>5538, -31806=>5539, -31807=>5540, -31800=>5541, -31805=>5542, -31799=>5543, -31808=>5544, -32363=>5545, -32365=>5546, -32377=>5547, -32361=>5548, -32362=>5549, -32371=>5550, -32645=>5551, -32694=>5552, -32697=>5553, -32696=>5554, -33240=>5555, -34281=>5556, -34269=>5557, -34282=>5558, -34261=>5559, -34276=>5560, -34277=>5561, -34295=>5562, -34811=>5563, -34821=>5564, -34829=>5565, -34809=>5566, -34814=>5567, -35168=>5568, -35167=>5569, -35158=>5570, -35166=>5571, -35649=>5572, -35676=>5573, -35672=>5574, -35657=>5575, -35674=>5576, -35662=>5577, -35663=>5578, -35654=>5579, -35673=>5580, -36104=>5581, -36106=>5582, -36476=>5583, -36466=>5584, -36487=>5585, -36470=>5586, -36460=>5587, -36474=>5588, -36468=>5589, -36692=>5590, -36686=>5591, -36781=>5592, -37002=>5593, -37003=>5594, -37297=>5595, -37294=>5596, -37857=>5597, -37841=>5598, -37855=>5599, -37827=>5600, -37832=>5601, -37852=>5602, -37853=>5603, -37846=>5604, -37858=>5605, -37837=>5606, -37848=>5607, -37860=>5608, -37847=>5609, -37864=>5610, -38364=>5611, -38580=>5612, -38627=>5613, -38698=>5614, -38695=>5615, -38753=>5616, -38876=>5617, -38907=>5618, -39006=>5619, -39000=>5620, -39003=>5621, -39100=>5622, -39237=>5623, -39241=>5624, -39446=>5625, -39449=>5626, -39693=>5627, -39912=>5628, -39911=>5629, -39894=>5630, -39899=>5631, -40329=>5632, -40289=>5633, -40306=>5634, -40298=>5635, -40300=>5636, -40594=>5637, -40599=>5638, -40595=>5639, -40628=>5640, -21240=>5641, -22199=>5642, -22198=>5643, -22196=>5644, -22204=>5645, -22756=>5646, -23360=>5647, -23363=>5648, -23421=>5649, -23542=>5650, -24009=>5651, -25080=>5652, -25082=>5653, -25880=>5654, -25876=>5655, -25881=>5656, -26342=>5657, -26407=>5658, -27372=>5659, -28734=>5660, -28720=>5661, -28722=>5662, -29200=>5663, -29563=>5664, -29903=>5665, -30306=>5666, -30309=>5667, -31014=>5668, -31018=>5669, -31020=>5670, -31019=>5671, -31431=>5672, -31478=>5673, -31820=>5674, -31811=>5675, -31821=>5676, -31983=>5677, -31984=>5678, -36782=>5679, -32381=>5680, -32380=>5681, -32386=>5682, -32588=>5683, -32768=>5684, -33242=>5685, -33382=>5686, -34299=>5687, -34297=>5688, -34321=>5689, -34298=>5690, -34310=>5691, -34315=>5692, -34311=>5693, -34314=>5694, -34836=>5695, -34837=>5696, -35172=>5697, -35258=>5698, -35320=>5699, -35696=>5700, -35692=>5701, -35686=>5702, -35695=>5703, -35679=>5704, -35691=>5705, -36111=>5706, -36109=>5707, -36489=>5708, -36481=>5709, -36485=>5710, -36482=>5711, -37300=>5712, -37323=>5713, -37912=>5714, -37891=>5715, -37885=>5716, -38369=>5717, -38704=>5718, -39108=>5719, -39250=>5720, -39249=>5721, -39336=>5722, -39467=>5723, -39472=>5724, -39479=>5725, -39477=>5726, -39955=>5727, -39949=>5728, -40569=>5729, -40629=>5730, -40680=>5731, -40751=>5732, -40799=>5733, -40803=>5734, -40801=>5735, -20791=>5736, -20792=>5737, -22209=>5738, -22208=>5739, -22210=>5740, -22804=>5741, -23660=>5742, -24013=>5743, -25084=>5744, -25086=>5745, -25885=>5746, -25884=>5747, -26005=>5748, -26345=>5749, -27387=>5750, -27396=>5751, -27386=>5752, -27570=>5753, -28748=>5754, -29211=>5755, -29351=>5756, -29910=>5757, -29908=>5758, -30313=>5759, -30675=>5760, -31824=>5761, -32399=>5762, -32396=>5763, -32700=>5764, -34327=>5765, -34349=>5766, -34330=>5767, -34851=>5768, -34850=>5769, -34849=>5770, -34847=>5771, -35178=>5772, -35180=>5773, -35261=>5774, -35700=>5775, -35703=>5776, -35709=>5777, -36115=>5778, -36490=>5779, -36493=>5780, -36491=>5781, -36703=>5782, -36783=>5783, -37306=>5784, -37934=>5785, -37939=>5786, -37941=>5787, -37946=>5788, -37944=>5789, -37938=>5790, -37931=>5791, -38370=>5792, -38712=>5793, -38713=>5794, -38706=>5795, -38911=>5796, -58586=>5796, -39015=>5797, -39013=>5798, -39255=>5799, -39493=>5800, -39491=>5801, -39488=>5802, -39486=>5803, -39631=>5804, -39764=>5805, -39761=>5806, -39981=>5807, -39973=>5808, -40367=>5809, -40372=>5810, -40386=>5811, -40376=>5812, -40605=>5813, -40687=>5814, -40729=>5815, -40796=>5816, -40806=>5817, -40807=>5818, -20796=>5819, -20795=>5820, -22216=>5821, -22218=>5822, -22217=>5823, -23423=>5824, -24020=>5825, -24018=>5826, -24398=>5827, -25087=>5828, -25892=>5829, -27402=>5830, -27489=>5831, -28753=>5832, -28760=>5833, -29568=>5834, -29924=>5835, -30090=>5836, -30318=>5837, -30316=>5838, -31155=>5839, -31840=>5840, -31839=>5841, -32894=>5842, -32893=>5843, -33247=>5844, -35186=>5845, -35183=>5846, -35324=>5847, -35712=>5848, -36118=>5849, -36119=>5850, -36497=>5851, -36499=>5852, -36705=>5853, -37192=>5854, -37956=>5855, -37969=>5856, -37970=>5857, -38717=>5858, -38718=>5859, -38851=>5860, -38849=>5861, -39019=>5862, -39253=>5863, -39509=>5864, -39501=>5865, -39634=>5866, -39706=>5867, -40009=>5868, -39985=>5869, -39998=>5870, -39995=>5871, -40403=>5872, -40407=>5873, -40756=>5874, -40812=>5875, -40810=>5876, -40852=>5877, -22220=>5878, -24022=>5879, -25088=>5880, -25891=>5881, -25899=>5882, -25898=>5883, -26348=>5884, -27408=>5885, -29914=>5886, -31434=>5887, -31844=>5888, -31843=>5889, -31845=>5890, -32403=>5891, -32406=>5892, -32404=>5893, -33250=>5894, -34360=>5895, -34367=>5896, -34865=>5897, -35722=>5898, -37008=>5899, -37007=>5900, -37987=>5901, -37984=>5902, -37988=>5903, -38760=>5904, -39023=>5905, -39260=>5906, -39514=>5907, -39515=>5908, -39511=>5909, -39635=>5910, -39636=>5911, -39633=>5912, -40020=>5913, -40023=>5914, -40022=>5915, -40421=>5916, -40607=>5917, -40692=>5918, -22225=>5919, -22761=>5920, -25900=>5921, -28766=>5922, -30321=>5923, -30322=>5924, -30679=>5925, -60226=>5925, -32592=>5926, -32648=>5927, -34870=>5928, -34873=>5929, -34914=>5930, -35731=>5931, -35730=>5932, -35734=>5933, -33399=>5934, -36123=>5935, -37312=>5936, -37994=>5937, -38722=>5938, -38728=>5939, -38724=>5940, -38854=>5941, -39024=>5942, -39519=>5943, -39714=>5944, -39768=>5945, -40031=>5946, -40441=>5947, -40442=>5948, -40572=>5949, -40573=>5950, -40711=>5951, -40823=>5952, -40818=>5953, -24307=>5954, -27414=>5955, -28771=>5956, -31852=>5957, -31854=>5958, -34875=>5959, -35264=>5960, -36513=>5961, -37313=>5962, -38002=>5963, -38000=>5964, -39025=>5965, -39262=>5966, -39638=>5967, -39715=>5968, -40652=>5969, -28772=>5970, -30682=>5971, -35738=>5972, -38007=>5973, -38857=>5974, -39522=>5975, -39525=>5976, -32412=>5977, -35740=>5978, -36522=>5979, -37317=>5980, -38013=>5981, -38014=>5982, -38012=>5983, -40055=>5984, -40056=>5985, -40695=>5986, -35924=>5987, -38015=>5988, -40474=>5989, -29224=>5990, -39530=>5991, -39729=>5992, -40475=>5993, -40478=>5994, -31858=>5995, -20034=>5996, -20060=>5997, -12048=>5998, -20981=>5998, -12053=>5999, -21274=>5999, -12058=>6000, -21378=>6000, -19975=>6001, -19980=>6002, -20039=>6003, -20109=>6004, -12062=>6005, -22231=>6005, -12076=>6006, -23662=>6006, -12091=>6007, -24435=>6007, -19983=>6008, -20871=>6009, -19982=>6010, -20014=>6011, -20115=>6012, -20162=>6013, -20169=>6014, -20168=>6015, -20888=>6016, -21244=>6017, -21356=>6018, -21433=>6019, -22304=>6020, -22787=>6021, -22828=>6022, -23568=>6023, -60417=>6023, -24063=>6024, -26081=>6025, -12110=>6026, -27571=>6026, -27596=>6027, -12115=>6028, -27668=>6028, -12121=>6029, -29247=>6029, -20017=>6030, -20028=>6031, -20200=>6032, -20188=>6033, -20201=>6034, -20193=>6035, -20189=>6036, -20186=>6037, -21004=>6038, -21001=>6039, -21276=>6040, -21324=>6041, -22306=>6042, -22307=>6043, -22807=>6044, -22831=>6045, -23425=>6046, -23428=>6047, -23570=>6048, -23611=>6049, -23668=>6050, -23667=>6051, -24068=>6052, -24192=>6053, -24194=>6054, -24521=>6055, -25097=>6056, -25168=>6057, -27669=>6058, -27702=>6059, -27715=>6060, -27711=>6061, -27707=>6062, -29358=>6063, -29360=>6064, -29578=>6065, -12145=>6066, -31160=>6066, -32906=>6067, -38430=>6068, -20238=>6069, -20248=>6070, -20268=>6071, -20213=>6072, -20244=>6073, -20209=>6074, -20224=>6075, -20215=>6076, -20232=>6077, -20253=>6078, -20226=>6079, -20229=>6080, -20258=>6081, -20243=>6082, -20228=>6083, -20212=>6084, -20242=>6085, -20913=>6086, -21011=>6087, -21008=>6088, -21158=>6089, -21282=>6090, -21279=>6091, -21325=>6092, -21386=>6093, -21511=>6094, -22241=>6095, -22239=>6096, -22318=>6097, -22314=>6098, -22324=>6099, -22844=>6100, -22912=>6101, -22908=>6102, -22917=>6103, -22907=>6104, -22910=>6105, -22903=>6106, -22911=>6107, -23382=>6108, -23573=>6109, -23589=>6110, -23676=>6111, -23674=>6112, -23675=>6113, -23678=>6114, -24031=>6115, -24181=>6116, -57646=>6116, -24196=>6117, -24322=>6118, -24346=>6119, -24436=>6120, -24533=>6121, -24532=>6122, -24527=>6123, -25180=>6124, -25182=>6125, -25188=>6126, -25185=>6127, -25190=>6128, -25186=>6129, -25177=>6130, -25184=>6131, -25178=>6132, -25189=>6133, -25911=>6134, -26095=>6135, -26094=>6136, -26430=>6137, -26425=>6138, -26424=>6139, -26427=>6140, -26426=>6141, -26431=>6142, -26428=>6143, -26419=>6144, -27672=>6145, -27718=>6146, -27730=>6147, -27740=>6148, -27727=>6149, -27722=>6150, -60796=>6150, -27732=>6151, -27723=>6152, -27724=>6153, -28785=>6154, -29278=>6155, -29364=>6156, -29365=>6157, -29582=>6158, -29994=>6159, -30335=>6160, -31349=>6161, -12153=>6162, -32593=>6162, -12171=>6163, -33400=>6163, -33404=>6164, -33408=>6165, -33405=>6166, -33407=>6167, -12172=>6168, -34381=>6168, -12177=>6169, -35198=>6169, -37017=>6170, -59347=>6171, -37015=>6171, -37016=>6172, -37019=>6173, -37012=>6174, -38434=>6175, -38436=>6176, -38432=>6177, -38435=>6178, -20310=>6179, -20283=>6180, -20322=>6181, -20297=>6182, -20307=>6183, -20324=>6184, -20286=>6185, -20327=>6186, -20306=>6187, -20319=>6188, -20289=>6189, -20312=>6190, -20269=>6191, -20275=>6192, -20287=>6193, -20321=>6194, -20879=>6195, -20921=>6196, -21020=>6197, -21022=>6198, -21025=>6199, -21165=>6200, -21166=>6201, -21257=>6202, -21347=>6203, -21362=>6204, -21390=>6205, -21391=>6206, -21552=>6207, -21559=>6208, -21546=>6209, -21588=>6210, -21573=>6211, -21529=>6212, -21532=>6213, -21541=>6214, -21528=>6215, -21565=>6216, -21583=>6217, -21569=>6218, -21544=>6219, -21540=>6220, -21575=>6221, -22254=>6222, -22247=>6223, -22245=>6224, -22337=>6225, -22341=>6226, -22348=>6227, -22345=>6228, -22347=>6229, -22354=>6230, -22790=>6231, -22848=>6232, -22950=>6233, -22936=>6234, -22944=>6235, -22935=>6236, -22926=>6237, -22946=>6238, -22928=>6239, -22927=>6240, -22951=>6241, -22945=>6242, -23438=>6243, -23442=>6244, -23592=>6245, -23594=>6246, -23693=>6247, -23695=>6248, -23688=>6249, -23691=>6250, -23689=>6251, -23698=>6252, -23690=>6253, -23686=>6254, -23699=>6255, -23701=>6256, -24032=>6257, -24074=>6258, -24078=>6259, -24203=>6260, -24201=>6261, -24204=>6262, -24200=>6263, -24205=>6264, -24325=>6265, -24349=>6266, -24440=>6267, -24438=>6268, -24530=>6269, -24529=>6270, -24528=>6271, -24557=>6272, -24552=>6273, -24558=>6274, -24563=>6275, -24545=>6276, -24548=>6277, -24547=>6278, -24570=>6279, -24559=>6280, -24567=>6281, -24571=>6282, -24576=>6283, -24564=>6284, -25146=>6285, -25219=>6286, -25228=>6287, -25230=>6288, -25231=>6289, -25236=>6290, -25223=>6291, -25201=>6292, -25211=>6293, -25210=>6294, -25200=>6295, -25217=>6296, -25224=>6297, -25207=>6298, -25213=>6299, -25202=>6300, -25204=>6301, -26096=>6302, -26100=>6303, -26099=>6304, -26098=>6305, -26101=>6306, -26437=>6307, -26439=>6308, -26457=>6309, -26453=>6310, -26444=>6311, -26440=>6312, -26461=>6313, -26445=>6314, -26458=>6315, -26443=>6316, -27600=>6317, -27673=>6318, -27674=>6319, -27768=>6320, -27751=>6321, -27755=>6322, -27780=>6323, -27787=>6324, -27791=>6325, -27761=>6326, -27759=>6327, -27753=>6328, -27802=>6329, -27757=>6330, -27783=>6331, -27797=>6332, -27804=>6333, -57900=>6333, -27750=>6334, -27763=>6335, -27749=>6336, -27771=>6337, -27790=>6338, -28788=>6339, -28794=>6340, -29283=>6341, -29375=>6342, -29373=>6343, -29379=>6344, -29382=>6345, -29377=>6346, -29370=>6347, -29381=>6348, -29589=>6349, -29591=>6350, -29587=>6351, -29588=>6352, -29586=>6353, -30010=>6354, -30009=>6355, -30100=>6356, -30101=>6357, -30337=>6358, -31037=>6359, -32820=>6360, -32917=>6361, -32921=>6362, -32912=>6363, -32914=>6364, -32924=>6365, -33424=>6366, -33423=>6367, -33413=>6368, -33422=>6369, -33425=>6370, -33427=>6371, -33418=>6372, -33411=>6373, -33412=>6374, -12184=>6375, -35960=>6375, -36809=>6376, -36799=>6377, -37023=>6378, -37025=>6379, -37029=>6380, -37022=>6381, -37031=>6382, -37024=>6383, -38448=>6384, -38440=>6385, -38447=>6386, -38445=>6387, -20019=>6388, -20376=>6389, -20348=>6390, -20357=>6391, -20349=>6392, -20352=>6393, -20359=>6394, -20342=>6395, -20340=>6396, -20361=>6397, -20356=>6398, -20343=>6399, -20300=>6400, -20375=>6401, -20330=>6402, -20378=>6403, -20345=>6404, -20353=>6405, -20344=>6406, -20368=>6407, -20380=>6408, -20372=>6409, -20382=>6410, -20370=>6411, -20354=>6412, -20373=>6413, -20331=>6414, -20334=>6415, -20894=>6416, -20924=>6417, -20926=>6418, -21045=>6419, -21042=>6420, -21043=>6421, -21062=>6422, -21041=>6423, -21180=>6424, -21258=>6425, -21259=>6426, -21308=>6427, -21394=>6428, -21396=>6429, -21639=>6430, -21631=>6431, -21633=>6432, -21649=>6433, -21634=>6434, -21640=>6435, -21611=>6436, -21626=>6437, -21630=>6438, -21605=>6439, -21612=>6440, -21620=>6441, -21606=>6442, -21645=>6443, -21615=>6444, -21601=>6445, -21600=>6446, -21656=>6447, -21603=>6448, -21607=>6449, -21604=>6450, -22263=>6451, -22265=>6452, -22383=>6453, -22386=>6454, -22381=>6455, -22379=>6456, -22385=>6457, -22384=>6458, -22390=>6459, -22400=>6460, -22389=>6461, -22395=>6462, -22387=>6463, -22388=>6464, -22370=>6465, -22376=>6466, -22397=>6467, -22796=>6468, -22853=>6469, -22965=>6470, -22970=>6471, -22991=>6472, -22990=>6473, -22962=>6474, -22988=>6475, -22977=>6476, -22966=>6477, -22972=>6478, -22979=>6479, -22998=>6480, -22961=>6481, -22973=>6482, -22976=>6483, -22984=>6484, -22964=>6485, -22983=>6486, -23394=>6487, -23397=>6488, -23443=>6489, -23445=>6490, -23620=>6491, -23623=>6492, -23726=>6493, -23716=>6494, -23712=>6495, -23733=>6496, -23727=>6497, -23720=>6498, -23724=>6499, -23711=>6500, -23715=>6501, -23725=>6502, -23714=>6503, -23722=>6504, -23719=>6505, -23709=>6506, -23717=>6507, -23734=>6508, -23728=>6509, -23718=>6510, -24087=>6511, -24084=>6512, -24089=>6513, -24360=>6514, -24354=>6515, -24355=>6516, -24356=>6517, -24404=>6518, -24450=>6519, -24446=>6520, -24445=>6521, -24542=>6522, -24549=>6523, -24621=>6524, -24614=>6525, -24601=>6526, -24626=>6527, -24587=>6528, -24628=>6529, -24586=>6530, -24599=>6531, -24627=>6532, -24602=>6533, -24606=>6534, -24620=>6535, -24610=>6536, -24589=>6537, -24592=>6538, -24622=>6539, -24595=>6540, -24593=>6541, -24588=>6542, -24585=>6543, -24604=>6544, -25108=>6545, -25149=>6546, -25261=>6547, -25268=>6548, -25297=>6549, -25278=>6550, -25258=>6551, -25270=>6552, -25290=>6553, -25262=>6554, -25267=>6555, -25263=>6556, -25275=>6557, -25257=>6558, -25264=>6559, -25272=>6560, -25917=>6561, -26024=>6562, -26043=>6563, -26121=>6564, -26108=>6565, -26116=>6566, -26130=>6567, -26120=>6568, -26107=>6569, -26115=>6570, -26123=>6571, -26125=>6572, -26117=>6573, -26109=>6574, -26129=>6575, -26128=>6576, -26358=>6577, -26378=>6578, -26501=>6579, -26476=>6580, -26510=>6581, -26514=>6582, -26486=>6583, -26491=>6584, -26520=>6585, -26502=>6586, -26500=>6587, -26484=>6588, -26509=>6589, -26508=>6590, -26490=>6591, -26527=>6592, -26513=>6593, -26521=>6594, -26499=>6595, -26493=>6596, -26497=>6597, -26488=>6598, -26489=>6599, -26516=>6600, -27429=>6601, -27520=>6602, -27518=>6603, -27614=>6604, -27677=>6605, -27795=>6606, -27884=>6607, -27883=>6608, -27886=>6609, -27865=>6610, -27830=>6611, -27860=>6612, -27821=>6613, -27879=>6614, -27831=>6615, -27856=>6616, -27842=>6617, -27834=>6618, -27843=>6619, -27846=>6620, -27885=>6621, -27890=>6622, -27858=>6623, -27869=>6624, -27828=>6625, -27786=>6626, -27805=>6627, -27776=>6628, -27870=>6629, -27840=>6630, -27952=>6631, -27853=>6632, -27847=>6633, -27824=>6634, -27897=>6635, -27855=>6636, -27881=>6637, -27857=>6638, -28820=>6639, -28824=>6640, -28805=>6641, -28819=>6642, -28806=>6643, -28804=>6644, -28817=>6645, -28822=>6646, -28802=>6647, -28826=>6648, -28803=>6649, -29290=>6650, -29398=>6651, -29387=>6652, -29400=>6653, -29385=>6654, -29404=>6655, -29394=>6656, -29396=>6657, -29402=>6658, -29388=>6659, -29393=>6660, -29604=>6661, -29601=>6662, -29613=>6663, -29606=>6664, -29602=>6665, -29600=>6666, -29612=>6667, -29597=>6668, -29917=>6669, -29928=>6670, -30015=>6671, -30016=>6672, -30014=>6673, -30092=>6674, -30104=>6675, -30383=>6676, -30451=>6677, -30449=>6678, -30448=>6679, -30453=>6680, -30712=>6681, -30716=>6682, -30713=>6683, -30715=>6684, -30714=>6685, -30711=>6686, -31042=>6687, -31039=>6688, -31173=>6689, -31352=>6690, -31355=>6691, -31483=>6692, -31861=>6693, -31997=>6694, -32821=>6695, -32911=>6696, -32942=>6697, -32931=>6698, -32952=>6699, -32949=>6700, -32941=>6701, -33312=>6702, -33440=>6703, -33472=>6704, -33451=>6705, -33434=>6706, -33432=>6707, -33435=>6708, -33461=>6709, -33447=>6710, -33454=>6711, -33468=>6712, -33438=>6713, -33466=>6714, -33460=>6715, -33448=>6716, -33441=>6717, -33449=>6718, -33474=>6719, -33444=>6720, -33475=>6721, -33462=>6722, -33442=>6723, -34416=>6724, -34415=>6725, -34413=>6726, -34414=>6727, -35926=>6728, -36818=>6729, -36811=>6730, -36819=>6731, -36813=>6732, -36822=>6733, -36821=>6734, -36823=>6735, -37042=>6736, -37044=>6737, -37039=>6738, -37043=>6739, -37040=>6740, -38457=>6741, -38461=>6742, -38460=>6743, -38458=>6744, -38467=>6745, -20429=>6746, -20421=>6747, -20435=>6748, -20402=>6749, -20425=>6750, -20427=>6751, -20417=>6752, -20436=>6753, -20444=>6754, -20441=>6755, -20411=>6756, -60346=>6756, -20403=>6757, -20443=>6758, -20423=>6759, -20438=>6760, -20410=>6761, -20416=>6762, -20409=>6763, -20460=>6764, -21060=>6765, -21065=>6766, -21184=>6767, -21186=>6768, -21309=>6769, -21372=>6770, -21399=>6771, -21398=>6772, -21401=>6773, -21400=>6774, -21690=>6775, -21665=>6776, -21677=>6777, -21669=>6778, -21711=>6779, -21699=>6780, -33549=>6781, -21687=>6782, -21678=>6783, -21718=>6784, -21686=>6785, -21701=>6786, -21702=>6787, -21664=>6788, -21616=>6789, -21692=>6790, -21666=>6791, -21694=>6792, -21618=>6793, -21726=>6794, -21680=>6795, -22453=>6796, -22430=>6797, -22431=>6798, -22436=>6799, -22412=>6800, -22423=>6801, -22429=>6802, -22427=>6803, -22420=>6804, -22424=>6805, -22415=>6806, -22425=>6807, -22437=>6808, -22426=>6809, -22421=>6810, -22772=>6811, -22797=>6812, -22867=>6813, -23009=>6814, -23006=>6815, -23022=>6816, -23040=>6817, -23025=>6818, -23005=>6819, -23034=>6820, -23037=>6821, -23036=>6822, -23030=>6823, -23012=>6824, -23026=>6825, -23031=>6826, -23003=>6827, -23017=>6828, -23027=>6829, -23029=>6830, -23008=>6831, -23038=>6832, -23028=>6833, -23021=>6834, -23464=>6835, -23628=>6836, -23760=>6837, -23768=>6838, -23756=>6839, -23767=>6840, -23755=>6841, -23771=>6842, -23774=>6843, -23770=>6844, -23753=>6845, -23751=>6846, -23754=>6847, -23766=>6848, -23763=>6849, -23764=>6850, -23759=>6851, -23752=>6852, -23750=>6853, -23758=>6854, -23775=>6855, -23800=>6856, -24057=>6857, -24097=>6858, -24098=>6859, -24099=>6860, -24096=>6861, -24100=>6862, -24240=>6863, -24228=>6864, -24226=>6865, -24219=>6866, -24227=>6867, -24229=>6868, -24327=>6869, -24366=>6870, -24406=>6871, -24454=>6872, -24631=>6873, -24633=>6874, -24660=>6875, -24690=>6876, -24670=>6877, -24645=>6878, -24659=>6879, -24647=>6880, -24649=>6881, -24667=>6882, -24652=>6883, -24640=>6884, -24642=>6885, -24671=>6886, -24612=>6887, -24644=>6888, -24664=>6889, -24678=>6890, -24686=>6891, -25154=>6892, -25155=>6893, -25295=>6894, -25357=>6895, -25355=>6896, -25333=>6897, -25358=>6898, -25347=>6899, -25323=>6900, -25337=>6901, -25359=>6902, -25356=>6903, -25336=>6904, -25334=>6905, -25344=>6906, -25363=>6907, -25364=>6908, -25338=>6909, -25365=>6910, -25339=>6911, -25328=>6912, -25921=>6913, -25923=>6914, -26026=>6915, -26047=>6916, -26166=>6917, -26145=>6918, -26162=>6919, -26165=>6920, -26140=>6921, -26150=>6922, -26146=>6923, -26163=>6924, -26155=>6925, -26170=>6926, -26141=>6927, -26164=>6928, -26169=>6929, -26158=>6930, -26383=>6931, -26384=>6932, -26561=>6933, -26610=>6934, -26568=>6935, -26554=>6936, -26588=>6937, -26555=>6938, -26616=>6939, -26584=>6940, -26560=>6941, -26551=>6942, -26565=>6943, -26603=>6944, -26596=>6945, -26591=>6946, -26549=>6947, -26573=>6948, -26547=>6949, -26615=>6950, -26614=>6951, -26606=>6952, -26595=>6953, -26562=>6954, -26553=>6955, -26574=>6956, -26599=>6957, -26608=>6958, -26546=>6959, -26620=>6960, -26566=>6961, -26605=>6962, -26572=>6963, -26542=>6964, -26598=>6965, -26587=>6966, -26618=>6967, -26569=>6968, -26570=>6969, -26563=>6970, -26602=>6971, -26571=>6972, -27432=>6973, -27522=>6974, -27524=>6975, -27574=>6976, -27606=>6977, -27608=>6978, -27616=>6979, -27680=>6980, -27681=>6981, -27944=>6982, -27956=>6983, -27949=>6984, -27935=>6985, -27964=>6986, -27967=>6987, -27922=>6988, -27914=>6989, -27866=>6990, -27955=>6991, -27908=>6992, -27929=>6993, -27962=>6994, -27930=>6995, -27921=>6996, -27904=>6997, -27933=>6998, -27970=>6999, -27905=>7000, -27928=>7001, -27959=>7002, -27907=>7003, -27919=>7004, -27968=>7005, -27911=>7006, -27936=>7007, -27948=>7008, -27912=>7009, -27938=>7010, -27913=>7011, -27920=>7012, -28855=>7013, -28831=>7014, -28862=>7015, -28849=>7016, -28848=>7017, -28833=>7018, -28852=>7019, -28853=>7020, -28841=>7021, -29249=>7022, -29257=>7023, -29258=>7024, -29292=>7025, -29296=>7026, -29299=>7027, -29294=>7028, -29386=>7029, -29412=>7030, -29416=>7031, -29419=>7032, -29407=>7033, -29418=>7034, -29414=>7035, -29411=>7036, -29573=>7037, -29644=>7038, -29634=>7039, -29640=>7040, -29637=>7041, -29625=>7042, -29622=>7043, -29621=>7044, -29620=>7045, -29675=>7046, -29631=>7047, -29639=>7048, -29630=>7049, -29635=>7050, -29638=>7051, -29624=>7052, -29643=>7053, -29932=>7054, -29934=>7055, -29998=>7056, -30023=>7057, -30024=>7058, -30119=>7059, -30122=>7060, -30329=>7061, -30404=>7062, -30472=>7063, -30467=>7064, -30468=>7065, -30469=>7066, -30474=>7067, -30455=>7068, -30459=>7069, -30458=>7070, -30695=>7071, -30696=>7072, -30726=>7073, -30737=>7074, -30738=>7075, -30725=>7076, -30736=>7077, -30735=>7078, -30734=>7079, -30729=>7080, -58095=>7080, -30723=>7081, -30739=>7082, -31050=>7083, -31052=>7084, -31051=>7085, -31045=>7086, -31044=>7087, -31189=>7088, -31181=>7089, -31183=>7090, -31190=>7091, -31182=>7092, -31360=>7093, -31358=>7094, -31441=>7095, -31488=>7096, -31489=>7097, -31866=>7098, -31864=>7099, -31865=>7100, -31871=>7101, -31872=>7102, -31873=>7103, -32003=>7104, -32008=>7105, -32001=>7106, -32600=>7107, -32657=>7108, -32653=>7109, -32702=>7110, -32775=>7111, -32782=>7112, -32783=>7113, -32788=>7114, -32823=>7115, -32984=>7116, -32967=>7117, -32992=>7118, -32977=>7119, -32968=>7120, -32962=>7121, -32976=>7122, -32965=>7123, -32995=>7124, -32985=>7125, -32988=>7126, -32970=>7127, -32981=>7128, -32969=>7129, -32975=>7130, -32983=>7131, -32998=>7132, -32973=>7133, -33279=>7134, -33313=>7135, -33428=>7136, -33497=>7137, -33534=>7138, -33529=>7139, -33543=>7140, -33512=>7141, -33536=>7142, -33493=>7143, -33594=>7144, -33515=>7145, -33494=>7146, -33524=>7147, -33516=>7148, -33505=>7149, -33522=>7150, -33525=>7151, -33548=>7152, -33531=>7153, -33526=>7154, -33520=>7155, -33514=>7156, -33508=>7157, -33504=>7158, -33530=>7159, -33523=>7160, -33517=>7161, -34423=>7162, -34420=>7163, -34428=>7164, -34419=>7165, -34881=>7166, -34894=>7167, -34919=>7168, -34922=>7169, -34921=>7170, -35283=>7171, -35332=>7172, -35335=>7173, -36210=>7174, -36835=>7175, -36833=>7176, -36846=>7177, -36832=>7178, -37105=>7179, -37053=>7180, -37055=>7181, -37077=>7182, -37061=>7183, -37054=>7184, -37063=>7185, -37067=>7186, -37064=>7187, -37332=>7188, -60294=>7188, -37331=>7189, -38484=>7190, -38479=>7191, -38481=>7192, -38483=>7193, -38474=>7194, -38478=>7195, -20510=>7196, -20485=>7197, -20487=>7198, -20499=>7199, -20514=>7200, -20528=>7201, -20507=>7202, -20469=>7203, -20468=>7204, -20531=>7205, -20535=>7206, -20524=>7207, -20470=>7208, -20471=>7209, -20503=>7210, -20508=>7211, -20512=>7212, -20519=>7213, -20533=>7214, -20527=>7215, -20529=>7216, -20494=>7217, -20826=>7218, -20884=>7219, -20883=>7220, -20938=>7221, -20932=>7222, -20933=>7223, -20936=>7224, -20942=>7225, -21089=>7226, -21082=>7227, -21074=>7228, -21086=>7229, -21087=>7230, -21077=>7231, -21090=>7232, -21197=>7233, -21262=>7234, -21406=>7235, -21798=>7236, -21730=>7237, -21783=>7238, -21778=>7239, -21735=>7240, -21747=>7241, -21732=>7242, -21786=>7243, -21759=>7244, -21764=>7245, -21768=>7246, -21739=>7247, -21777=>7248, -21765=>7249, -21745=>7250, -21770=>7251, -21755=>7252, -21751=>7253, -21752=>7254, -21728=>7255, -21774=>7256, -21763=>7257, -21771=>7258, -22273=>7259, -22274=>7260, -22476=>7261, -22578=>7262, -22485=>7263, -22482=>7264, -22458=>7265, -22470=>7266, -22461=>7267, -22460=>7268, -22456=>7269, -22454=>7270, -22463=>7271, -22471=>7272, -22480=>7273, -22457=>7274, -22465=>7275, -22798=>7276, -22858=>7277, -23065=>7278, -23062=>7279, -23085=>7280, -23086=>7281, -23061=>7282, -23055=>7283, -23063=>7284, -23050=>7285, -23070=>7286, -23091=>7287, -23404=>7288, -23463=>7289, -23469=>7290, -23468=>7291, -23555=>7292, -23638=>7293, -23636=>7294, -23788=>7295, -23807=>7296, -23790=>7297, -23793=>7298, -23799=>7299, -23808=>7300, -23801=>7301, -24105=>7302, -24104=>7303, -24232=>7304, -24238=>7305, -24234=>7306, -24236=>7307, -24371=>7308, -24368=>7309, -24423=>7310, -24669=>7311, -24666=>7312, -24679=>7313, -24641=>7314, -24738=>7315, -24712=>7316, -24704=>7317, -24722=>7318, -24705=>7319, -24733=>7320, -24707=>7321, -24725=>7322, -24731=>7323, -24727=>7324, -24711=>7325, -24732=>7326, -24718=>7327, -25113=>7328, -25158=>7329, -25330=>7330, -25360=>7331, -25430=>7332, -25388=>7333, -25412=>7334, -25413=>7335, -25398=>7336, -25411=>7337, -25572=>7338, -25401=>7339, -25419=>7340, -25418=>7341, -25404=>7342, -25385=>7343, -25409=>7344, -25396=>7345, -25432=>7346, -25428=>7347, -25433=>7348, -25389=>7349, -25415=>7350, -25395=>7351, -25434=>7352, -25425=>7353, -25400=>7354, -25431=>7355, -25408=>7356, -25416=>7357, -25930=>7358, -25926=>7359, -26054=>7360, -26051=>7361, -26052=>7362, -26050=>7363, -26186=>7364, -26207=>7365, -26183=>7366, -26193=>7367, -26386=>7368, -26387=>7369, -26655=>7370, -26650=>7371, -26697=>7372, -26674=>7373, -26675=>7374, -26683=>7375, -26699=>7376, -26703=>7377, -26646=>7378, -26673=>7379, -26652=>7380, -26677=>7381, -26667=>7382, -26669=>7383, -26671=>7384, -26702=>7385, -26692=>7386, -26676=>7387, -26653=>7388, -26642=>7389, -26644=>7390, -26662=>7391, -26664=>7392, -26670=>7393, -26701=>7394, -26682=>7395, -26661=>7396, -26656=>7397, -27436=>7398, -27439=>7399, -27437=>7400, -27441=>7401, -27444=>7402, -27501=>7403, -32898=>7404, -27528=>7405, -27622=>7406, -27620=>7407, -27624=>7408, -27619=>7409, -27618=>7410, -27623=>7411, -27685=>7412, -28026=>7413, -28003=>7414, -28004=>7415, -28022=>7416, -27917=>7417, -28001=>7418, -28050=>7419, -27992=>7420, -28002=>7421, -28013=>7422, -28015=>7423, -28049=>7424, -28045=>7425, -28143=>7426, -28031=>7427, -28038=>7428, -27998=>7429, -28007=>7430, -59078=>7430, -28000=>7431, -28055=>7432, -28016=>7433, -28028=>7434, -27999=>7435, -28034=>7436, -28056=>7437, -27951=>7438, -28008=>7439, -28043=>7440, -28030=>7441, -28032=>7442, -28036=>7443, -27926=>7444, -28035=>7445, -28027=>7446, -28029=>7447, -28021=>7448, -28048=>7449, -28892=>7450, -28883=>7451, -28881=>7452, -28893=>7453, -28875=>7454, -32569=>7455, -28898=>7456, -28887=>7457, -28882=>7458, -28894=>7459, -28896=>7460, -28884=>7461, -28877=>7462, -28869=>7463, -28870=>7464, -28871=>7465, -28890=>7466, -28878=>7467, -28897=>7468, -29250=>7469, -29304=>7470, -29303=>7471, -29302=>7472, -29440=>7473, -29434=>7474, -29428=>7475, -29438=>7476, -29430=>7477, -29427=>7478, -29435=>7479, -29441=>7480, -29651=>7481, -29657=>7482, -29669=>7483, -29654=>7484, -29628=>7485, -29671=>7486, -29667=>7487, -29673=>7488, -29660=>7489, -29650=>7490, -29659=>7491, -29652=>7492, -29661=>7493, -29658=>7494, -29655=>7495, -29656=>7496, -29672=>7497, -29918=>7498, -29919=>7499, -29940=>7500, -29941=>7501, -29985=>7502, -30043=>7503, -30047=>7504, -30128=>7505, -30145=>7506, -30139=>7507, -30148=>7508, -30144=>7509, -30143=>7510, -30134=>7511, -30138=>7512, -30346=>7513, -30409=>7514, -30493=>7515, -30491=>7516, -30480=>7517, -30483=>7518, -30482=>7519, -30499=>7520, -30481=>7521, -30485=>7522, -30489=>7523, -30490=>7524, -30498=>7525, -30503=>7526, -30755=>7527, -30764=>7528, -30754=>7529, -30773=>7530, -30767=>7531, -30760=>7532, -30766=>7533, -30763=>7534, -30753=>7535, -30761=>7536, -30771=>7537, -30762=>7538, -30769=>7539, -31060=>7540, -31067=>7541, -31055=>7542, -31068=>7543, -31059=>7544, -31058=>7545, -31057=>7546, -31211=>7547, -31212=>7548, -31200=>7549, -31214=>7550, -31213=>7551, -31210=>7552, -31196=>7553, -31198=>7554, -31197=>7555, -31366=>7556, -31369=>7557, -31365=>7558, -31371=>7559, -31372=>7560, -31370=>7561, -31367=>7562, -31448=>7563, -31504=>7564, -31492=>7565, -31507=>7566, -31493=>7567, -31503=>7568, -31496=>7569, -31498=>7570, -31502=>7571, -31497=>7572, -31506=>7573, -31876=>7574, -31889=>7575, -31882=>7576, -31884=>7577, -31880=>7578, -31885=>7579, -31877=>7580, -32030=>7581, -32029=>7582, -32017=>7583, -32014=>7584, -32024=>7585, -32022=>7586, -32019=>7587, -32031=>7588, -32018=>7589, -32015=>7590, -32012=>7591, -32604=>7592, -32609=>7593, -32606=>7594, -32608=>7595, -32605=>7596, -32603=>7597, -32662=>7598, -32658=>7599, -32707=>7600, -32706=>7601, -32704=>7602, -32790=>7603, -32830=>7604, -32825=>7605, -33018=>7606, -33010=>7607, -33017=>7608, -33013=>7609, -33025=>7610, -33019=>7611, -33024=>7612, -33281=>7613, -33327=>7614, -33317=>7615, -33587=>7616, -33581=>7617, -33604=>7618, -33561=>7619, -33617=>7620, -33573=>7621, -33622=>7622, -33599=>7623, -33601=>7624, -33574=>7625, -33564=>7626, -33570=>7627, -33602=>7628, -33614=>7629, -33563=>7630, -33578=>7631, -33544=>7632, -33596=>7633, -33613=>7634, -33558=>7635, -33572=>7636, -33568=>7637, -33591=>7638, -33583=>7639, -33577=>7640, -33607=>7641, -33605=>7642, -33612=>7643, -33619=>7644, -33566=>7645, -33580=>7646, -33611=>7647, -33575=>7648, -33608=>7649, -34387=>7650, -34386=>7651, -34466=>7652, -34472=>7653, -34454=>7654, -34445=>7655, -34449=>7656, -34462=>7657, -34439=>7658, -34455=>7659, -34438=>7660, -34443=>7661, -34458=>7662, -34437=>7663, -34469=>7664, -34457=>7665, -34465=>7666, -34471=>7667, -34453=>7668, -34456=>7669, -34446=>7670, -34461=>7671, -34448=>7672, -34452=>7673, -34883=>7674, -34884=>7675, -34925=>7676, -34933=>7677, -34934=>7678, -34930=>7679, -34944=>7680, -34929=>7681, -34943=>7682, -34927=>7683, -34947=>7684, -34942=>7685, -34932=>7686, -34940=>7687, -35346=>7688, -35911=>7689, -35927=>7690, -35963=>7691, -36004=>7692, -36003=>7693, -36214=>7694, -36216=>7695, -36277=>7696, -36279=>7697, -36278=>7698, -36561=>7699, -36563=>7700, -36862=>7701, -36853=>7702, -36866=>7703, -36863=>7704, -36859=>7705, -36868=>7706, -36860=>7707, -36854=>7708, -37078=>7709, -37088=>7710, -37081=>7711, -37082=>7712, -37091=>7713, -37087=>7714, -37093=>7715, -37080=>7716, -37083=>7717, -37079=>7718, -37084=>7719, -37092=>7720, -37200=>7721, -37198=>7722, -37199=>7723, -37333=>7724, -37346=>7725, -37338=>7726, -38492=>7727, -38495=>7728, -38588=>7729, -39139=>7730, -12221=>7731, -39647=>7731, -12223=>7732, -39727=>7732, -20095=>7733, -20592=>7734, -20586=>7735, -20577=>7736, -20574=>7737, -20576=>7738, -20563=>7739, -20555=>7740, -20573=>7741, -20594=>7742, -20552=>7743, -20557=>7744, -20545=>7745, -20571=>7746, -20554=>7747, -20578=>7748, -20501=>7749, -20549=>7750, -20575=>7751, -20585=>7752, -20587=>7753, -20579=>7754, -20580=>7755, -20550=>7756, -20544=>7757, -20590=>7758, -20595=>7759, -20567=>7760, -20561=>7761, -20944=>7762, -21099=>7763, -21101=>7764, -21100=>7765, -21102=>7766, -21206=>7767, -21203=>7768, -21293=>7769, -21404=>7770, -21877=>7771, -21878=>7772, -21820=>7773, -21837=>7774, -21840=>7775, -21812=>7776, -21802=>7777, -21841=>7778, -21858=>7779, -21814=>7780, -21813=>7781, -21808=>7782, -21842=>7783, -21829=>7784, -21772=>7785, -21810=>7786, -21861=>7787, -21838=>7788, -21817=>7789, -21832=>7790, -21805=>7791, -21819=>7792, -21824=>7793, -21835=>7794, -22282=>7795, -22279=>7796, -22523=>7797, -22548=>7798, -22498=>7799, -22518=>7800, -22492=>7801, -22516=>7802, -22528=>7803, -22509=>7804, -22525=>7805, -22536=>7806, -22520=>7807, -22539=>7808, -22515=>7809, -22479=>7810, -22535=>7811, -22510=>7812, -22499=>7813, -22514=>7814, -22501=>7815, -22508=>7816, -22497=>7817, -22542=>7818, -22524=>7819, -22544=>7820, -22503=>7821, -22529=>7822, -22540=>7823, -22513=>7824, -22505=>7825, -22512=>7826, -22541=>7827, -22532=>7828, -22876=>7829, -23136=>7830, -23128=>7831, -23125=>7832, -23143=>7833, -60437=>7833, -23134=>7834, -23096=>7835, -23093=>7836, -23149=>7837, -23120=>7838, -23135=>7839, -23141=>7840, -23148=>7841, -23123=>7842, -23140=>7843, -23127=>7844, -23107=>7845, -23133=>7846, -23122=>7847, -23108=>7848, -23131=>7849, -23112=>7850, -23182=>7851, -23102=>7852, -23117=>7853, -23097=>7854, -23116=>7855, -23152=>7856, -23145=>7857, -23111=>7858, -23121=>7859, -23126=>7860, -23106=>7861, -23132=>7862, -23410=>7863, -23406=>7864, -23489=>7865, -23488=>7866, -23641=>7867, -23838=>7868, -23819=>7869, -23837=>7870, -23834=>7871, -23840=>7872, -23820=>7873, -23848=>7874, -23821=>7875, -23846=>7876, -23845=>7877, -23823=>7878, -23856=>7879, -23826=>7880, -23843=>7881, -23839=>7882, -23854=>7883, -24126=>7884, -24116=>7885, -24241=>7886, -24244=>7887, -24249=>7888, -24242=>7889, -24243=>7890, -24374=>7891, -24376=>7892, -24475=>7893, -24470=>7894, -24479=>7895, -24714=>7896, -24720=>7897, -24710=>7898, -24766=>7899, -24752=>7900, -24762=>7901, -24787=>7902, -24788=>7903, -24783=>7904, -24804=>7905, -24793=>7906, -24797=>7907, -24776=>7908, -24753=>7909, -24795=>7910, -24759=>7911, -24778=>7912, -24767=>7913, -24771=>7914, -24781=>7915, -24768=>7916, -25394=>7917, -25445=>7918, -25482=>7919, -25474=>7920, -25469=>7921, -25533=>7922, -25502=>7923, -25517=>7924, -25501=>7925, -25495=>7926, -25515=>7927, -25486=>7928, -25455=>7929, -25479=>7930, -25488=>7931, -25454=>7932, -25519=>7933, -25461=>7934, -25500=>7935, -25453=>7936, -25518=>7937, -25468=>7938, -25508=>7939, -25403=>7940, -25503=>7941, -25464=>7942, -25477=>7943, -25473=>7944, -25489=>7945, -25485=>7946, -25456=>7947, -25939=>7948, -26061=>7949, -26213=>7950, -26209=>7951, -26203=>7952, -26201=>7953, -26204=>7954, -26210=>7955, -26392=>7956, -26745=>7957, -26759=>7958, -26768=>7959, -26780=>7960, -26733=>7961, -26734=>7962, -26798=>7963, -26795=>7964, -26966=>7965, -26735=>7966, -26787=>7967, -26796=>7968, -26793=>7969, -26741=>7970, -26740=>7971, -26802=>7972, -26767=>7973, -26743=>7974, -26770=>7975, -26748=>7976, -26731=>7977, -26738=>7978, -26794=>7979, -26752=>7980, -26737=>7981, -26750=>7982, -26779=>7983, -26774=>7984, -26763=>7985, -26784=>7986, -26761=>7987, -26788=>7988, -26744=>7989, -26747=>7990, -26769=>7991, -26764=>7992, -26762=>7993, -26749=>7994, -27446=>7995, -27443=>7996, -27447=>7997, -27448=>7998, -27537=>7999, -27535=>8000, -27533=>8001, -27534=>8002, -27532=>8003, -27690=>8004, -28096=>8005, -28075=>8006, -28084=>8007, -28083=>8008, -28276=>8009, -28076=>8010, -28137=>8011, -28130=>8012, -28087=>8013, -28150=>8014, -28116=>8015, -28160=>8016, -28104=>8017, -28128=>8018, -28127=>8019, -28118=>8020, -28094=>8021, -28133=>8022, -28124=>8023, -28125=>8024, -28123=>8025, -28148=>8026, -28106=>8027, -28093=>8028, -28141=>8029, -28144=>8030, -28090=>8031, -28117=>8032, -28098=>8033, -28111=>8034, -28105=>8035, -28112=>8036, -28146=>8037, -28115=>8038, -28157=>8039, -28119=>8040, -28109=>8041, -28131=>8042, -28091=>8043, -28922=>8044, -28941=>8045, -28919=>8046, -28951=>8047, -28916=>8048, -28940=>8049, -28912=>8050, -28932=>8051, -28915=>8052, -28944=>8053, -28924=>8054, -28927=>8055, -28934=>8056, -28947=>8057, -28928=>8058, -28920=>8059, -28918=>8060, -28939=>8061, -28930=>8062, -28942=>8063, -29310=>8064, -29307=>8065, -29308=>8066, -29311=>8067, -29469=>8068, -29463=>8069, -29447=>8070, -29457=>8071, -29464=>8072, -29450=>8073, -29448=>8074, -29439=>8075, -29455=>8076, -29470=>8077, -29576=>8078, -29686=>8079, -29688=>8080, -29685=>8081, -29700=>8082, -29697=>8083, -29693=>8084, -29703=>8085, -29696=>8086, -29690=>8087, -29692=>8088, -29695=>8089, -29708=>8090, -29707=>8091, -29684=>8092, -29704=>8093, -30052=>8094, -30051=>8095, -30158=>8096, -30162=>8097, -30159=>8098, -30155=>8099, -30156=>8100, -30161=>8101, -30160=>8102, -30351=>8103, -30345=>8104, -30419=>8105, -30521=>8106, -30511=>8107, -30509=>8108, -30513=>8109, -30514=>8110, -30516=>8111, -30515=>8112, -30525=>8113, -30501=>8114, -30523=>8115, -30517=>8116, -30792=>8117, -30802=>8118, -30793=>8119, -30797=>8120, -30794=>8121, -30796=>8122, -30758=>8123, -30789=>8124, -30800=>8125, -31076=>8126, -31079=>8127, -31081=>8128, -31082=>8129, -31075=>8130, -31083=>8131, -31073=>8132, -31163=>8133, -31226=>8134, -31224=>8135, -31222=>8136, -31223=>8137, -31375=>8138, -31380=>8139, -31376=>8140, -31541=>8141, -31547=>8142, -31540=>8143, -31525=>8144, -31536=>8145, -31522=>8146, -31524=>8147, -31539=>8148, -31512=>8149, -31530=>8150, -31517=>8151, -31537=>8152, -31531=>8153, -31533=>8154, -31535=>8155, -31538=>8156, -31544=>8157, -31514=>8158, -31523=>8159, -31892=>8160, -31896=>8161, -31894=>8162, -31907=>8163, -32053=>8164, -32061=>8165, -32056=>8166, -32054=>8167, -32058=>8168, -32069=>8169, -32044=>8170, -32041=>8171, -32065=>8172, -32071=>8173, -32062=>8174, -32063=>8175, -32074=>8176, -32059=>8177, -32040=>8178, -32611=>8179, -32661=>8180, -32668=>8181, -32669=>8182, -32667=>8183, -32714=>8184, -32715=>8185, -32717=>8186, -32720=>8187, -32721=>8188, -32711=>8189, -32719=>8190, -32713=>8191, -32799=>8192, -32798=>8193, -32795=>8194, -32839=>8195, -32835=>8196, -32840=>8197, -33048=>8198, -33061=>8199, -33049=>8200, -33051=>8201, -33069=>8202, -33055=>8203, -33068=>8204, -33054=>8205, -33057=>8206, -33045=>8207, -33063=>8208, -33053=>8209, -33058=>8210, -33297=>8211, -33336=>8212, -33331=>8213, -33338=>8214, -33332=>8215, -33330=>8216, -33396=>8217, -33680=>8218, -33699=>8219, -33704=>8220, -33677=>8221, -33658=>8222, -33651=>8223, -33700=>8224, -33652=>8225, -33679=>8226, -33665=>8227, -33685=>8228, -33689=>8229, -33653=>8230, -33684=>8231, -33705=>8232, -33661=>8233, -33667=>8234, -33676=>8235, -33693=>8236, -33691=>8237, -33706=>8238, -33675=>8239, -33662=>8240, -33701=>8241, -33711=>8242, -33672=>8243, -33687=>8244, -33712=>8245, -33663=>8246, -33702=>8247, -33671=>8248, -33710=>8249, -33654=>8250, -34393=>8251, -34390=>8252, -34495=>8253, -34487=>8254, -34498=>8255, -34497=>8256, -34501=>8257, -34490=>8258, -34480=>8259, -34504=>8260, -34489=>8261, -34483=>8262, -34488=>8263, -34508=>8264, -34484=>8265, -34491=>8266, -34492=>8267, -34499=>8268, -34493=>8269, -34494=>8270, -34898=>8271, -34953=>8272, -34965=>8273, -34984=>8274, -34978=>8275, -34986=>8276, -34970=>8277, -34961=>8278, -34977=>8279, -34975=>8280, -34968=>8281, -34983=>8282, -34969=>8283, -34971=>8284, -34967=>8285, -34980=>8286, -34988=>8287, -34956=>8288, -34963=>8289, -34958=>8290, -35202=>8291, -35286=>8292, -35289=>8293, -35285=>8294, -35376=>8295, -35367=>8296, -35372=>8297, -35358=>8298, -35897=>8299, -35899=>8300, -35932=>8301, -35933=>8302, -35965=>8303, -36005=>8304, -36221=>8305, -36219=>8306, -36217=>8307, -36284=>8308, -36290=>8309, -36281=>8310, -36287=>8311, -36289=>8312, -36568=>8313, -36574=>8314, -36573=>8315, -36572=>8316, -36567=>8317, -36576=>8318, -36577=>8319, -36900=>8320, -36875=>8321, -36881=>8322, -36892=>8323, -36876=>8324, -36897=>8325, -37103=>8326, -37098=>8327, -37104=>8328, -37108=>8329, -37106=>8330, -37107=>8331, -37076=>8332, -37099=>8333, -37100=>8334, -37097=>8335, -37206=>8336, -37208=>8337, -37210=>8338, -37203=>8339, -37205=>8340, -37356=>8341, -37364=>8342, -37361=>8343, -37363=>8344, -37368=>8345, -37348=>8346, -37369=>8347, -37354=>8348, -37355=>8349, -37367=>8350, -37352=>8351, -37358=>8352, -38266=>8353, -38278=>8354, -38280=>8355, -38524=>8356, -38509=>8357, -38507=>8358, -38513=>8359, -38511=>8360, -38591=>8361, -38762=>8362, -38916=>8363, -39141=>8364, -39319=>8365, -20635=>8366, -20629=>8367, -20628=>8368, -20638=>8369, -20619=>8370, -20643=>8371, -20611=>8372, -20620=>8373, -20622=>8374, -20637=>8375, -20584=>8376, -20636=>8377, -20626=>8378, -20610=>8379, -20615=>8380, -20831=>8381, -20948=>8382, -21266=>8383, -21265=>8384, -21412=>8385, -21415=>8386, -21905=>8387, -21928=>8388, -21925=>8389, -21933=>8390, -21879=>8391, -22085=>8392, -21922=>8393, -21907=>8394, -21896=>8395, -21903=>8396, -21941=>8397, -21889=>8398, -21923=>8399, -21906=>8400, -21924=>8401, -21885=>8402, -21900=>8403, -21926=>8404, -21887=>8405, -21909=>8406, -21921=>8407, -21902=>8408, -22284=>8409, -22569=>8410, -22583=>8411, -22553=>8412, -22558=>8413, -22567=>8414, -22563=>8415, -22568=>8416, -22517=>8417, -22600=>8418, -22565=>8419, -22556=>8420, -22555=>8421, -22579=>8422, -22591=>8423, -22582=>8424, -22574=>8425, -22585=>8426, -22584=>8427, -22573=>8428, -22572=>8429, -22587=>8430, -22881=>8431, -23215=>8432, -23188=>8433, -23199=>8434, -23162=>8435, -23202=>8436, -23198=>8437, -23160=>8438, -23206=>8439, -23164=>8440, -23205=>8441, -23212=>8442, -23189=>8443, -23214=>8444, -23095=>8445, -23172=>8446, -23178=>8447, -23191=>8448, -23171=>8449, -23179=>8450, -23209=>8451, -23163=>8452, -23165=>8453, -23180=>8454, -23196=>8455, -23183=>8456, -23187=>8457, -23197=>8458, -23530=>8459, -23501=>8460, -23499=>8461, -23508=>8462, -23505=>8463, -23498=>8464, -23502=>8465, -23564=>8466, -23600=>8467, -23863=>8468, -23875=>8469, -23915=>8470, -23873=>8471, -23883=>8472, -23871=>8473, -23861=>8474, -23889=>8475, -23886=>8476, -23893=>8477, -23859=>8478, -23866=>8479, -23890=>8480, -23869=>8481, -23857=>8482, -23897=>8483, -23874=>8484, -23865=>8485, -23881=>8486, -23864=>8487, -23868=>8488, -23858=>8489, -23862=>8490, -23872=>8491, -23877=>8492, -24132=>8493, -24129=>8494, -24408=>8495, -57673=>8495, -24486=>8496, -24485=>8497, -24491=>8498, -24777=>8499, -24761=>8500, -24780=>8501, -24802=>8502, -24782=>8503, -24772=>8504, -24852=>8505, -24818=>8506, -24842=>8507, -24854=>8508, -24837=>8509, -24821=>8510, -24851=>8511, -24824=>8512, -24828=>8513, -24830=>8514, -24769=>8515, -24835=>8516, -24856=>8517, -24861=>8518, -24848=>8519, -24831=>8520, -24836=>8521, -24843=>8522, -25162=>8523, -25492=>8524, -25521=>8525, -25520=>8526, -25550=>8527, -25573=>8528, -25576=>8529, -25583=>8530, -25539=>8531, -25757=>8532, -25587=>8533, -25546=>8534, -25568=>8535, -25590=>8536, -25557=>8537, -25586=>8538, -25589=>8539, -25697=>8540, -25567=>8541, -25534=>8542, -25565=>8543, -25564=>8544, -25540=>8545, -25560=>8546, -25555=>8547, -25538=>8548, -25543=>8549, -25548=>8550, -25547=>8551, -25544=>8552, -25584=>8553, -25559=>8554, -25561=>8555, -25906=>8556, -25959=>8557, -25962=>8558, -25956=>8559, -25948=>8560, -25960=>8561, -25957=>8562, -25996=>8563, -26013=>8564, -26014=>8565, -26030=>8566, -26064=>8567, -26066=>8568, -26236=>8569, -26220=>8570, -26235=>8571, -26240=>8572, -26225=>8573, -26233=>8574, -26218=>8575, -26226=>8576, -26369=>8577, -26892=>8578, -26835=>8579, -26884=>8580, -26844=>8581, -26922=>8582, -26860=>8583, -26858=>8584, -26865=>8585, -26895=>8586, -26838=>8587, -26871=>8588, -26859=>8589, -26852=>8590, -26870=>8591, -26899=>8592, -26896=>8593, -26867=>8594, -26849=>8595, -26887=>8596, -26828=>8597, -26888=>8598, -26992=>8599, -26804=>8600, -26897=>8601, -26863=>8602, -26822=>8603, -26900=>8604, -26872=>8605, -26832=>8606, -26877=>8607, -26876=>8608, -26856=>8609, -26891=>8610, -26890=>8611, -26903=>8612, -26830=>8613, -26824=>8614, -26845=>8615, -26846=>8616, -26854=>8617, -26868=>8618, -26833=>8619, -26886=>8620, -26836=>8621, -26857=>8622, -26901=>8623, -26917=>8624, -26823=>8625, -27449=>8626, -27451=>8627, -27455=>8628, -27452=>8629, -27540=>8630, -27543=>8631, -27545=>8632, -27541=>8633, -27581=>8634, -27632=>8635, -27634=>8636, -27635=>8637, -27696=>8638, -28156=>8639, -28230=>8640, -28231=>8641, -28191=>8642, -28233=>8643, -28296=>8644, -28220=>8645, -28221=>8646, -28229=>8647, -28258=>8648, -28203=>8649, -28223=>8650, -28225=>8651, -28253=>8652, -28275=>8653, -28188=>8654, -28211=>8655, -28235=>8656, -28224=>8657, -28241=>8658, -28219=>8659, -28163=>8660, -28206=>8661, -28254=>8662, -28264=>8663, -28252=>8664, -28257=>8665, -28209=>8666, -28200=>8667, -28256=>8668, -28273=>8669, -28267=>8670, -28217=>8671, -28194=>8672, -28208=>8673, -28243=>8674, -28261=>8675, -28199=>8676, -28280=>8677, -28260=>8678, -28279=>8679, -28245=>8680, -28281=>8681, -28242=>8682, -28262=>8683, -28213=>8684, -28214=>8685, -28250=>8686, -28960=>8687, -28958=>8688, -28975=>8689, -28923=>8690, -28974=>8691, -28977=>8692, -28963=>8693, -28965=>8694, -28962=>8695, -28978=>8696, -28959=>8697, -28968=>8698, -28986=>8699, -28955=>8700, -29259=>8701, -29274=>8702, -29320=>8703, -29321=>8704, -29318=>8705, -29317=>8706, -29323=>8707, -29458=>8708, -29451=>8709, -29488=>8710, -29474=>8711, -29489=>8712, -29491=>8713, -29479=>8714, -29490=>8715, -29485=>8716, -29478=>8717, -29475=>8718, -29493=>8719, -29452=>8720, -29742=>8721, -29740=>8722, -29744=>8723, -29739=>8724, -29718=>8725, -29722=>8726, -29729=>8727, -29741=>8728, -29745=>8729, -29732=>8730, -29731=>8731, -29725=>8732, -29737=>8733, -29728=>8734, -29746=>8735, -29947=>8736, -29999=>8737, -30063=>8738, -30060=>8739, -30183=>8740, -30170=>8741, -30177=>8742, -30182=>8743, -30173=>8744, -30175=>8745, -30180=>8746, -30167=>8747, -30357=>8748, -30354=>8749, -30426=>8750, -30534=>8751, -30535=>8752, -30532=>8753, -30541=>8754, -30533=>8755, -30538=>8756, -30542=>8757, -30539=>8758, -30540=>8759, -30686=>8760, -30700=>8761, -30816=>8762, -30820=>8763, -30821=>8764, -30812=>8765, -30829=>8766, -30833=>8767, -30826=>8768, -30830=>8769, -30832=>8770, -30825=>8771, -30824=>8772, -30814=>8773, -30818=>8774, -31092=>8775, -31091=>8776, -31090=>8777, -31088=>8778, -31234=>8779, -31242=>8780, -31235=>8781, -31244=>8782, -31236=>8783, -31385=>8784, -31462=>8785, -31460=>8786, -31562=>8787, -31559=>8788, -31556=>8789, -31560=>8790, -31564=>8791, -31566=>8792, -31552=>8793, -31576=>8794, -31557=>8795, -31906=>8796, -31902=>8797, -31912=>8798, -31905=>8799, -32088=>8800, -32111=>8801, -32099=>8802, -32083=>8803, -32086=>8804, -32103=>8805, -32106=>8806, -32079=>8807, -32109=>8808, -32092=>8809, -32107=>8810, -32082=>8811, -32084=>8812, -32105=>8813, -32081=>8814, -32095=>8815, -32078=>8816, -32574=>8817, -32575=>8818, -32613=>8819, -32614=>8820, -32674=>8821, -32672=>8822, -32673=>8823, -32727=>8824, -32849=>8825, -32847=>8826, -32848=>8827, -33022=>8828, -32980=>8829, -33091=>8830, -33098=>8831, -33106=>8832, -33103=>8833, -33095=>8834, -33085=>8835, -33101=>8836, -33082=>8837, -33254=>8838, -33262=>8839, -33271=>8840, -33272=>8841, -33273=>8842, -33284=>8843, -33340=>8844, -33341=>8845, -33343=>8846, -33397=>8847, -33595=>8848, -33743=>8849, -60382=>8849, -33785=>8850, -33827=>8851, -33728=>8852, -33768=>8853, -33810=>8854, -33767=>8855, -33764=>8856, -33788=>8857, -33782=>8858, -33808=>8859, -33734=>8860, -33736=>8861, -33771=>8862, -33763=>8863, -33727=>8864, -33793=>8865, -33757=>8866, -33765=>8867, -33752=>8868, -33791=>8869, -33761=>8870, -33739=>8871, -33742=>8872, -33750=>8873, -33781=>8874, -33737=>8875, -33801=>8876, -33807=>8877, -58332=>8877, -33758=>8878, -33809=>8879, -33798=>8880, -33730=>8881, -33779=>8882, -33749=>8883, -33786=>8884, -33735=>8885, -33745=>8886, -33770=>8887, -33811=>8888, -33690=>8889, -33731=>8890, -33772=>8891, -33774=>8892, -33732=>8893, -33787=>8894, -33751=>8895, -33762=>8896, -33819=>8897, -33755=>8898, -33790=>8899, -34520=>8900, -34530=>8901, -34534=>8902, -34515=>8903, -34531=>8904, -34522=>8905, -34538=>8906, -34525=>8907, -34539=>8908, -34524=>8909, -34540=>8910, -34537=>8911, -34519=>8912, -34536=>8913, -34513=>8914, -34888=>8915, -34902=>8916, -34901=>8917, -35002=>8918, -35031=>8919, -35001=>8920, -35000=>8921, -35008=>8922, -35006=>8923, -34998=>8924, -35004=>8925, -34999=>8926, -35005=>8927, -34994=>8928, -35073=>8929, -35017=>8930, -35221=>8931, -35224=>8932, -35223=>8933, -35293=>8934, -35290=>8935, -35291=>8936, -35406=>8937, -35405=>8938, -35385=>8939, -35417=>8940, -35392=>8941, -35415=>8942, -35416=>8943, -35396=>8944, -35397=>8945, -35410=>8946, -35400=>8947, -35409=>8948, -35402=>8949, -35404=>8950, -35407=>8951, -35935=>8952, -35969=>8953, -35968=>8954, -36026=>8955, -36030=>8956, -36016=>8957, -36025=>8958, -36021=>8959, -36228=>8960, -36224=>8961, -36233=>8962, -36312=>8963, -36307=>8964, -36301=>8965, -36295=>8966, -36310=>8967, -36316=>8968, -36303=>8969, -36309=>8970, -36313=>8971, -36296=>8972, -36311=>8973, -36293=>8974, -36591=>8975, -36599=>8976, -36602=>8977, -36601=>8978, -36582=>8979, -36590=>8980, -36581=>8981, -36597=>8982, -36583=>8983, -36584=>8984, -36598=>8985, -36587=>8986, -36593=>8987, -36588=>8988, -36596=>8989, -36585=>8990, -36909=>8991, -36916=>8992, -36911=>8993, -37126=>8994, -37164=>8995, -37124=>8996, -60367=>8996, -37119=>8997, -37116=>8998, -37128=>8999, -37113=>9000, -37115=>9001, -37121=>9002, -37120=>9003, -37127=>9004, -37125=>9005, -37123=>9006, -37217=>9007, -37220=>9008, -37215=>9009, -37218=>9010, -37216=>9011, -37377=>9012, -37386=>9013, -37413=>9014, -37379=>9015, -37402=>9016, -37414=>9017, -37391=>9018, -37388=>9019, -37376=>9020, -37394=>9021, -37375=>9022, -37373=>9023, -37382=>9024, -37380=>9025, -37415=>9026, -37378=>9027, -37404=>9028, -37412=>9029, -37401=>9030, -37399=>9031, -37381=>9032, -37398=>9033, -38267=>9034, -38285=>9035, -38284=>9036, -38288=>9037, -38535=>9038, -38526=>9039, -38536=>9040, -38537=>9041, -38531=>9042, -38528=>9043, -38594=>9044, -38600=>9045, -38595=>9046, -38641=>9047, -38640=>9048, -38764=>9049, -38768=>9050, -38766=>9051, -38919=>9052, -39081=>9053, -39147=>9054, -40166=>9055, -12235=>9056, -40697=>9056, -20099=>9057, -20100=>9058, -20150=>9059, -20669=>9060, -20671=>9061, -20678=>9062, -20654=>9063, -20676=>9064, -20682=>9065, -20660=>9066, -20680=>9067, -20674=>9068, -20656=>9069, -20673=>9070, -20666=>9071, -20657=>9072, -20683=>9073, -20681=>9074, -20662=>9075, -20664=>9076, -20951=>9077, -21114=>9078, -21112=>9079, -21115=>9080, -21116=>9081, -21955=>9082, -21979=>9083, -21964=>9084, -21968=>9085, -21963=>9086, -21962=>9087, -21981=>9088, -21952=>9089, -64013=>9089, -21972=>9090, -21956=>9091, -21993=>9092, -21951=>9093, -21970=>9094, -21901=>9095, -21967=>9096, -21973=>9097, -21986=>9098, -21974=>9099, -21960=>9100, -22002=>9101, -21965=>9102, -21977=>9103, -21954=>9104, -22292=>9105, -22611=>9106, -22632=>9107, -22628=>9108, -22607=>9109, -22605=>9110, -22601=>9111, -22639=>9112, -22613=>9113, -22606=>9114, -22621=>9115, -22617=>9116, -22629=>9117, -22619=>9118, -22589=>9119, -22627=>9120, -22641=>9121, -22780=>9122, -23239=>9123, -23236=>9124, -23243=>9125, -23226=>9126, -23224=>9127, -23217=>9128, -23221=>9129, -23216=>9130, -23231=>9131, -23240=>9132, -23227=>9133, -23238=>9134, -23223=>9135, -23232=>9136, -23242=>9137, -23220=>9138, -23222=>9139, -23245=>9140, -23225=>9141, -23184=>9142, -23510=>9143, -23512=>9144, -23513=>9145, -23583=>9146, -23603=>9147, -23921=>9148, -23907=>9149, -23882=>9150, -23909=>9151, -23922=>9152, -23916=>9153, -23902=>9154, -23912=>9155, -23911=>9156, -23906=>9157, -24048=>9158, -24143=>9159, -24142=>9160, -24138=>9161, -24141=>9162, -24139=>9163, -24261=>9164, -24268=>9165, -24262=>9166, -24267=>9167, -24263=>9168, -24384=>9169, -24495=>9170, -24493=>9171, -24823=>9172, -24905=>9173, -24906=>9174, -24875=>9175, -24901=>9176, -24886=>9177, -24882=>9178, -24878=>9179, -24902=>9180, -24879=>9181, -24911=>9182, -24873=>9183, -24896=>9184, -25120=>9185, -37224=>9186, -25123=>9187, -25125=>9188, -25124=>9189, -25541=>9190, -25585=>9191, -25579=>9192, -25616=>9193, -25618=>9194, -25609=>9195, -25632=>9196, -25636=>9197, -25651=>9198, -25667=>9199, -25631=>9200, -25621=>9201, -25624=>9202, -25657=>9203, -25655=>9204, -25634=>9205, -25635=>9206, -25612=>9207, -25638=>9208, -25648=>9209, -25640=>9210, -25665=>9211, -25653=>9212, -25647=>9213, -25610=>9214, -25626=>9215, -25664=>9216, -25637=>9217, -25639=>9218, -25611=>9219, -25575=>9220, -25627=>9221, -25646=>9222, -25633=>9223, -25614=>9224, -25967=>9225, -26002=>9226, -26067=>9227, -26246=>9228, -26252=>9229, -26261=>9230, -26256=>9231, -26251=>9232, -26250=>9233, -26265=>9234, -26260=>9235, -26232=>9236, -26400=>9237, -26982=>9238, -26975=>9239, -26936=>9240, -26958=>9241, -26978=>9242, -26993=>9243, -26943=>9244, -26949=>9245, -26986=>9246, -26937=>9247, -26946=>9248, -26967=>9249, -26969=>9250, -27002=>9251, -26952=>9252, -26953=>9253, -26933=>9254, -26988=>9255, -26931=>9256, -26941=>9257, -26981=>9258, -26864=>9259, -27000=>9260, -26932=>9261, -26985=>9262, -26944=>9263, -26991=>9264, -26948=>9265, -26998=>9266, -26968=>9267, -26945=>9268, -26996=>9269, -26956=>9270, -26939=>9271, -26955=>9272, -26935=>9273, -26972=>9274, -26959=>9275, -26961=>9276, -26930=>9277, -26962=>9278, -26927=>9279, -27003=>9280, -26940=>9281, -27462=>9282, -27461=>9283, -27459=>9284, -27458=>9285, -27464=>9286, -27457=>9287, -27547=>9288, -27643=>9289, -27644=>9290, -27641=>9291, -27639=>9292, -27640=>9293, -28315=>9294, -28374=>9295, -28360=>9296, -28303=>9297, -28352=>9298, -28319=>9299, -28307=>9300, -28308=>9301, -28320=>9302, -28337=>9303, -28345=>9304, -28358=>9305, -28370=>9306, -28349=>9307, -28353=>9308, -28318=>9309, -28361=>9310, -28343=>9311, -28336=>9312, -28365=>9313, -28326=>9314, -28367=>9315, -28338=>9316, -28350=>9317, -28355=>9318, -28380=>9319, -28376=>9320, -28313=>9321, -28306=>9322, -28302=>9323, -28301=>9324, -28324=>9325, -28321=>9326, -28351=>9327, -28339=>9328, -28368=>9329, -28362=>9330, -28311=>9331, -28334=>9332, -28323=>9333, -28999=>9334, -29012=>9335, -29010=>9336, -29027=>9337, -29024=>9338, -28993=>9339, -29021=>9340, -29026=>9341, -61080=>9341, -29042=>9342, -29048=>9343, -29034=>9344, -29025=>9345, -28994=>9346, -29016=>9347, -28995=>9348, -29003=>9349, -29040=>9350, -29023=>9351, -29008=>9352, -29011=>9353, -28996=>9354, -29005=>9355, -29018=>9356, -29263=>9357, -29325=>9358, -29324=>9359, -29329=>9360, -29328=>9361, -29326=>9362, -29500=>9363, -29506=>9364, -29499=>9365, -29498=>9366, -29504=>9367, -29514=>9368, -29513=>9369, -29764=>9370, -29770=>9371, -29771=>9372, -29778=>9373, -29777=>9374, -29783=>9375, -29760=>9376, -29775=>9377, -29776=>9378, -29774=>9379, -29762=>9380, -29766=>9381, -29773=>9382, -29780=>9383, -29921=>9384, -29951=>9385, -29950=>9386, -29949=>9387, -29981=>9388, -30073=>9389, -30071=>9390, -27011=>9391, -30191=>9392, -30223=>9393, -30211=>9394, -30199=>9395, -30206=>9396, -30204=>9397, -30201=>9398, -60782=>9398, -30200=>9399, -30224=>9400, -30203=>9401, -30198=>9402, -30189=>9403, -30197=>9404, -30205=>9405, -30361=>9406, -30389=>9407, -30429=>9408, -30549=>9409, -30559=>9410, -30560=>9411, -30546=>9412, -30550=>9413, -30554=>9414, -30569=>9415, -30567=>9416, -30548=>9417, -30553=>9418, -30573=>9419, -30688=>9420, -30855=>9421, -30874=>9422, -30868=>9423, -30863=>9424, -30852=>9425, -30869=>9426, -30853=>9427, -30854=>9428, -30881=>9429, -30851=>9430, -30841=>9431, -30873=>9432, -30848=>9433, -30870=>9434, -30843=>9435, -31100=>9436, -31106=>9437, -31101=>9438, -31097=>9439, -31249=>9440, -31256=>9441, -31257=>9442, -31250=>9443, -31255=>9444, -31253=>9445, -31266=>9446, -31251=>9447, -31259=>9448, -31248=>9449, -31395=>9450, -31394=>9451, -31390=>9452, -31467=>9453, -31590=>9454, -31588=>9455, -31597=>9456, -31604=>9457, -31593=>9458, -31602=>9459, -31589=>9460, -31603=>9461, -31601=>9462, -31600=>9463, -31585=>9464, -31608=>9465, -31606=>9466, -31587=>9467, -31922=>9468, -31924=>9469, -31919=>9470, -32136=>9471, -32134=>9472, -32128=>9473, -32141=>9474, -32127=>9475, -32133=>9476, -32122=>9477, -32142=>9478, -32123=>9479, -32131=>9480, -32124=>9481, -32140=>9482, -32148=>9483, -32132=>9484, -32125=>9485, -32146=>9486, -32621=>9487, -32619=>9488, -32615=>9489, -32616=>9490, -32620=>9491, -32678=>9492, -32677=>9493, -32679=>9494, -32731=>9495, -32732=>9496, -32801=>9497, -33124=>9498, -33120=>9499, -33143=>9500, -33116=>9501, -33129=>9502, -33115=>9503, -33122=>9504, -33138=>9505, -26401=>9506, -33118=>9507, -33142=>9508, -33127=>9509, -33135=>9510, -33092=>9511, -33121=>9512, -33309=>9513, -33353=>9514, -33348=>9515, -33344=>9516, -33346=>9517, -33349=>9518, -34033=>9519, -33855=>9520, -33878=>9521, -33910=>9522, -33913=>9523, -33935=>9524, -33933=>9525, -33893=>9526, -33873=>9527, -33856=>9528, -33926=>9529, -33895=>9530, -33840=>9531, -33869=>9532, -33917=>9533, -33882=>9534, -33881=>9535, -33908=>9536, -33907=>9537, -33885=>9538, -34055=>9539, -33886=>9540, -33847=>9541, -33850=>9542, -33844=>9543, -33914=>9544, -33859=>9545, -33912=>9546, -33842=>9547, -33861=>9548, -33833=>9549, -33753=>9550, -33867=>9551, -33839=>9552, -33858=>9553, -33837=>9554, -33887=>9555, -33904=>9556, -33849=>9557, -33870=>9558, -33868=>9559, -33874=>9560, -33903=>9561, -33989=>9562, -33934=>9563, -33851=>9564, -33863=>9565, -33846=>9566, -33843=>9567, -33896=>9568, -33918=>9569, -33860=>9570, -33835=>9571, -33888=>9572, -33876=>9573, -33902=>9574, -33872=>9575, -34571=>9576, -34564=>9577, -34551=>9578, -34572=>9579, -34554=>9580, -34518=>9581, -34549=>9582, -34637=>9583, -34552=>9584, -34574=>9585, -34569=>9586, -34561=>9587, -34550=>9588, -34573=>9589, -34565=>9590, -35030=>9591, -35019=>9592, -35021=>9593, -35022=>9594, -35038=>9595, -35035=>9596, -35034=>9597, -35020=>9598, -35024=>9599, -35205=>9600, -35227=>9601, -35295=>9602, -35301=>9603, -35300=>9604, -35297=>9605, -35296=>9606, -35298=>9607, -35292=>9608, -35302=>9609, -35446=>9610, -35462=>9611, -35455=>9612, -35425=>9613, -35391=>9614, -35447=>9615, -35458=>9616, -35460=>9617, -35445=>9618, -35459=>9619, -35457=>9620, -35444=>9621, -35450=>9622, -35900=>9623, -35915=>9624, -35914=>9625, -35941=>9626, -35940=>9627, -35942=>9628, -35974=>9629, -35972=>9630, -35973=>9631, -36044=>9632, -36200=>9633, -36201=>9634, -36241=>9635, -36236=>9636, -36238=>9637, -36239=>9638, -36237=>9639, -36243=>9640, -36244=>9641, -36240=>9642, -36242=>9643, -36336=>9644, -36320=>9645, -36332=>9646, -36337=>9647, -36334=>9648, -36304=>9649, -36329=>9650, -36323=>9651, -36322=>9652, -36327=>9653, -36338=>9654, -36331=>9655, -36340=>9656, -36614=>9657, -36607=>9658, -36609=>9659, -36608=>9660, -36613=>9661, -36615=>9662, -36616=>9663, -36610=>9664, -36619=>9665, -60507=>9665, -36946=>9666, -36927=>9667, -36932=>9668, -36937=>9669, -36925=>9670, -37136=>9671, -37133=>9672, -37135=>9673, -37137=>9674, -37142=>9675, -37140=>9676, -37131=>9677, -37134=>9678, -37230=>9679, -37231=>9680, -37448=>9681, -37458=>9682, -37424=>9683, -37434=>9684, -37478=>9685, -37427=>9686, -37477=>9687, -37470=>9688, -37507=>9689, -37422=>9690, -37450=>9691, -37446=>9692, -37485=>9693, -37484=>9694, -37455=>9695, -37472=>9696, -37479=>9697, -37487=>9698, -37430=>9699, -37473=>9700, -37488=>9701, -37425=>9702, -37460=>9703, -37475=>9704, -37456=>9705, -37490=>9706, -37454=>9707, -37459=>9708, -37452=>9709, -37462=>9710, -37426=>9711, -38303=>9712, -38300=>9713, -38302=>9714, -38299=>9715, -38546=>9716, -38547=>9717, -38545=>9718, -38551=>9719, -38606=>9720, -38650=>9721, -38653=>9722, -38648=>9723, -38645=>9724, -38771=>9725, -38775=>9726, -38776=>9727, -38770=>9728, -38927=>9729, -38925=>9730, -38926=>9731, -39084=>9732, -39158=>9733, -39161=>9734, -39343=>9735, -39346=>9736, -39344=>9737, -39349=>9738, -39597=>9739, -39595=>9740, -39771=>9741, -40170=>9742, -40173=>9743, -40167=>9744, -40576=>9745, -12236=>9746, -40701=>9746, -20710=>9747, -20692=>9748, -20695=>9749, -20712=>9750, -20723=>9751, -20699=>9752, -20714=>9753, -20701=>9754, -20708=>9755, -20691=>9756, -20716=>9757, -20720=>9758, -20719=>9759, -20707=>9760, -20704=>9761, -20952=>9762, -21120=>9763, -21121=>9764, -21225=>9765, -21227=>9766, -21296=>9767, -21420=>9768, -22055=>9769, -22037=>9770, -22028=>9771, -22034=>9772, -22012=>9773, -22031=>9774, -22044=>9775, -22017=>9776, -22035=>9777, -22018=>9778, -22010=>9779, -22045=>9780, -22020=>9781, -22015=>9782, -22009=>9783, -22665=>9784, -22652=>9785, -22672=>9786, -22680=>9787, -22662=>9788, -22657=>9789, -22655=>9790, -22644=>9791, -22667=>9792, -22650=>9793, -22663=>9794, -22673=>9795, -22670=>9796, -22646=>9797, -22658=>9798, -22664=>9799, -22651=>9800, -22676=>9801, -22671=>9802, -22782=>9803, -22891=>9804, -23260=>9805, -23278=>9806, -23269=>9807, -23253=>9808, -23274=>9809, -23258=>9810, -23277=>9811, -23275=>9812, -23283=>9813, -23266=>9814, -23264=>9815, -23259=>9816, -23276=>9817, -23262=>9818, -23261=>9819, -23257=>9820, -23272=>9821, -23263=>9822, -23415=>9823, -23520=>9824, -23523=>9825, -23651=>9826, -23938=>9827, -23936=>9828, -23933=>9829, -23942=>9830, -23930=>9831, -23937=>9832, -23927=>9833, -23946=>9834, -23945=>9835, -23944=>9836, -23934=>9837, -23932=>9838, -23949=>9839, -23929=>9840, -23935=>9841, -24152=>9842, -24153=>9843, -24147=>9844, -24280=>9845, -24273=>9846, -24279=>9847, -24270=>9848, -24284=>9849, -24277=>9850, -24281=>9851, -24274=>9852, -24276=>9853, -24388=>9854, -24387=>9855, -24431=>9856, -24502=>9857, -24876=>9858, -24872=>9859, -24897=>9860, -24926=>9861, -24945=>9862, -24947=>9863, -24914=>9864, -24915=>9865, -24946=>9866, -24940=>9867, -24960=>9868, -24948=>9869, -24916=>9870, -24954=>9871, -24923=>9872, -24933=>9873, -24891=>9874, -24938=>9875, -24929=>9876, -24918=>9877, -25129=>9878, -25127=>9879, -25131=>9880, -25643=>9881, -25677=>9882, -25691=>9883, -25693=>9884, -25716=>9885, -25718=>9886, -25714=>9887, -25715=>9888, -25725=>9889, -25717=>9890, -25702=>9891, -25766=>9892, -25678=>9893, -25730=>9894, -25694=>9895, -25692=>9896, -25675=>9897, -25683=>9898, -25696=>9899, -25680=>9900, -25727=>9901, -25663=>9902, -25708=>9903, -25707=>9904, -25689=>9905, -25701=>9906, -25719=>9907, -25971=>9908, -26016=>9909, -26273=>9910, -26272=>9911, -26271=>9912, -26373=>9913, -26372=>9914, -26402=>9915, -27057=>9916, -27062=>9917, -27081=>9918, -27040=>9919, -27086=>9920, -27030=>9921, -27056=>9922, -27052=>9923, -27068=>9924, -27025=>9925, -27033=>9926, -27022=>9927, -27047=>9928, -27021=>9929, -27049=>9930, -27070=>9931, -27055=>9932, -27071=>9933, -27076=>9934, -27069=>9935, -27044=>9936, -27092=>9937, -27065=>9938, -27082=>9939, -27034=>9940, -27087=>9941, -27059=>9942, -27027=>9943, -27050=>9944, -27041=>9945, -27038=>9946, -27097=>9947, -27031=>9948, -27024=>9949, -27074=>9950, -27061=>9951, -27045=>9952, -27078=>9953, -27466=>9954, -27469=>9955, -27467=>9956, -27550=>9957, -27551=>9958, -27552=>9959, -27587=>9960, -27588=>9961, -27646=>9962, -28366=>9963, -28405=>9964, -28401=>9965, -28419=>9966, -28453=>9967, -28408=>9968, -28471=>9969, -28411=>9970, -28462=>9971, -28425=>9972, -28494=>9973, -28441=>9974, -28442=>9975, -28455=>9976, -28440=>9977, -28475=>9978, -28434=>9979, -28397=>9980, -28426=>9981, -28470=>9982, -28531=>9983, -28409=>9984, -28398=>9985, -28461=>9986, -28480=>9987, -28464=>9988, -28476=>9989, -28469=>9990, -28395=>9991, -28423=>9992, -28430=>9993, -28483=>9994, -28421=>9995, -28413=>9996, -28406=>9997, -28473=>9998, -28444=>9999, -28412=>10000, -28474=>10001, -28447=>10002, -28429=>10003, -28446=>10004, -28424=>10005, -28449=>10006, -29063=>10007, -29072=>10008, -29065=>10009, -29056=>10010, -29061=>10011, -29058=>10012, -29071=>10013, -29051=>10014, -29062=>10015, -29057=>10016, -29079=>10017, -29252=>10018, -29267=>10019, -29335=>10020, -29333=>10021, -29331=>10022, -29507=>10023, -29517=>10024, -29521=>10025, -29516=>10026, -29794=>10027, -29811=>10028, -29809=>10029, -29813=>10030, -29810=>10031, -29799=>10032, -29806=>10033, -29952=>10034, -29954=>10035, -29955=>10036, -30077=>10037, -30096=>10038, -30230=>10039, -30216=>10040, -30220=>10041, -30229=>10042, -30225=>10043, -30218=>10044, -30228=>10045, -30392=>10046, -30593=>10047, -30588=>10048, -30597=>10049, -30594=>10050, -30574=>10051, -30592=>10052, -30575=>10053, -30590=>10054, -30595=>10055, -30898=>10056, -30890=>10057, -30900=>10058, -30893=>10059, -30888=>10060, -30846=>10061, -30891=>10062, -30878=>10063, -30885=>10064, -30880=>10065, -30892=>10066, -30882=>10067, -30884=>10068, -31128=>10069, -31114=>10070, -31115=>10071, -31126=>10072, -31125=>10073, -31124=>10074, -31123=>10075, -31127=>10076, -31112=>10077, -31122=>10078, -31120=>10079, -31275=>10080, -31306=>10081, -31280=>10082, -31279=>10083, -31272=>10084, -31270=>10085, -31400=>10086, -31403=>10087, -31404=>10088, -31470=>10089, -31624=>10090, -31644=>10091, -31626=>10092, -31633=>10093, -31632=>10094, -31638=>10095, -31629=>10096, -31628=>10097, -31643=>10098, -31630=>10099, -31621=>10100, -31640=>10101, -21124=>10102, -31641=>10103, -31652=>10104, -31618=>10105, -31931=>10106, -31935=>10107, -31932=>10108, -31930=>10109, -32167=>10110, -32183=>10111, -32194=>10112, -32163=>10113, -32170=>10114, -32193=>10115, -32192=>10116, -32197=>10117, -32157=>10118, -32206=>10119, -32196=>10120, -32198=>10121, -32203=>10122, -32204=>10123, -32175=>10124, -32185=>10125, -32150=>10126, -32188=>10127, -32159=>10128, -32166=>10129, -32174=>10130, -32169=>10131, -32161=>10132, -32201=>10133, -32627=>10134, -32738=>10135, -32739=>10136, -32741=>10137, -32734=>10138, -32804=>10139, -32861=>10140, -32860=>10141, -33161=>10142, -33158=>10143, -33155=>10144, -33159=>10145, -33165=>10146, -33164=>10147, -33163=>10148, -33301=>10149, -33943=>10150, -33956=>10151, -33953=>10152, -33951=>10153, -33978=>10154, -33998=>10155, -33986=>10156, -33964=>10157, -33966=>10158, -33963=>10159, -33977=>10160, -33972=>10161, -33985=>10162, -33997=>10163, -33962=>10164, -33946=>10165, -33969=>10166, -34000=>10167, -33949=>10168, -33959=>10169, -33979=>10170, -33954=>10171, -33940=>10172, -33991=>10173, -33996=>10174, -33947=>10175, -33961=>10176, -33967=>10177, -33960=>10178, -58327=>10178, -34006=>10179, -33944=>10180, -33974=>10181, -33999=>10182, -33952=>10183, -34007=>10184, -34004=>10185, -34002=>10186, -34011=>10187, -33968=>10188, -33937=>10189, -34401=>10190, -34611=>10191, -34595=>10192, -34600=>10193, -34667=>10194, -34624=>10195, -34606=>10196, -34590=>10197, -34593=>10198, -34585=>10199, -34587=>10200, -34627=>10201, -34604=>10202, -34625=>10203, -34622=>10204, -34630=>10205, -34592=>10206, -34610=>10207, -34602=>10208, -34605=>10209, -34620=>10210, -34578=>10211, -34618=>10212, -34609=>10213, -34613=>10214, -34626=>10215, -34598=>10216, -34599=>10217, -34616=>10218, -34596=>10219, -34586=>10220, -34608=>10221, -34577=>10222, -35063=>10223, -35047=>10224, -35057=>10225, -35058=>10226, -35066=>10227, -35070=>10228, -35054=>10229, -35068=>10230, -35062=>10231, -35067=>10232, -35056=>10233, -35052=>10234, -35051=>10235, -35229=>10236, -35233=>10237, -35231=>10238, -35230=>10239, -35305=>10240, -35307=>10241, -35304=>10242, -35499=>10243, -35481=>10244, -35467=>10245, -35474=>10246, -35471=>10247, -35478=>10248, -35901=>10249, -35944=>10250, -35945=>10251, -36053=>10252, -36047=>10253, -36055=>10254, -36246=>10255, -36361=>10256, -36354=>10257, -36351=>10258, -36365=>10259, -36349=>10260, -36362=>10261, -36355=>10262, -36359=>10263, -36358=>10264, -36357=>10265, -36350=>10266, -36352=>10267, -36356=>10268, -36624=>10269, -36625=>10270, -36622=>10271, -36621=>10272, -37155=>10273, -37148=>10274, -37152=>10275, -37154=>10276, -37151=>10277, -37149=>10278, -37146=>10279, -37156=>10280, -37153=>10281, -37147=>10282, -37242=>10283, -37234=>10284, -37241=>10285, -37235=>10286, -37541=>10287, -37540=>10288, -37494=>10289, -37531=>10290, -37498=>10291, -37536=>10292, -37524=>10293, -37546=>10294, -37517=>10295, -37542=>10296, -37530=>10297, -37547=>10298, -37497=>10299, -37527=>10300, -37503=>10301, -37539=>10302, -37614=>10303, -37518=>10304, -37506=>10305, -37525=>10306, -37538=>10307, -37501=>10308, -37512=>10309, -37537=>10310, -37514=>10311, -37510=>10312, -37516=>10313, -37529=>10314, -37543=>10315, -37502=>10316, -37511=>10317, -37545=>10318, -37533=>10319, -37515=>10320, -37421=>10321, -38558=>10322, -38561=>10323, -38655=>10324, -38744=>10325, -38781=>10326, -38778=>10327, -38782=>10328, -38787=>10329, -38784=>10330, -38786=>10331, -38779=>10332, -38788=>10333, -38785=>10334, -38783=>10335, -38862=>10336, -38861=>10337, -38934=>10338, -39085=>10339, -39086=>10340, -39170=>10341, -39168=>10342, -39175=>10343, -39325=>10344, -39324=>10345, -39363=>10346, -39353=>10347, -39355=>10348, -39354=>10349, -39362=>10350, -39357=>10351, -39367=>10352, -39601=>10353, -39651=>10354, -39655=>10355, -39742=>10356, -39743=>10357, -39776=>10358, -39777=>10359, -39775=>10360, -40177=>10361, -40178=>10362, -40181=>10363, -40615=>10364, -20735=>10365, -20739=>10366, -20784=>10367, -20728=>10368, -20742=>10369, -20743=>10370, -20726=>10371, -20734=>10372, -20747=>10373, -20748=>10374, -20733=>10375, -20746=>10376, -21131=>10377, -21132=>10378, -21233=>10379, -21231=>10380, -22088=>10381, -22082=>10382, -22092=>10383, -22069=>10384, -22081=>10385, -22090=>10386, -22089=>10387, -22086=>10388, -22104=>10389, -22106=>10390, -22080=>10391, -22067=>10392, -22077=>10393, -22060=>10394, -22078=>10395, -22072=>10396, -22058=>10397, -22074=>10398, -22298=>10399, -22699=>10400, -22685=>10401, -22705=>10402, -22688=>10403, -22691=>10404, -22703=>10405, -22700=>10406, -22693=>10407, -22689=>10408, -22783=>10409, -23295=>10410, -23284=>10411, -23293=>10412, -23287=>10413, -23286=>10414, -23299=>10415, -23288=>10416, -23298=>10417, -23289=>10418, -23297=>10419, -23303=>10420, -23301=>10421, -23311=>10422, -23655=>10423, -23961=>10424, -23959=>10425, -23967=>10426, -23954=>10427, -23970=>10428, -23955=>10429, -23957=>10430, -23968=>10431, -23964=>10432, -23969=>10433, -23962=>10434, -23966=>10435, -24169=>10436, -24157=>10437, -24160=>10438, -24156=>10439, -32243=>10440, -24283=>10441, -24286=>10442, -24289=>10443, -24393=>10444, -24498=>10445, -24971=>10446, -24963=>10447, -24953=>10448, -25009=>10449, -25008=>10450, -24994=>10451, -24969=>10452, -24987=>10453, -24979=>10454, -25007=>10455, -25005=>10456, -24991=>10457, -24978=>10458, -25002=>10459, -24993=>10460, -24973=>10461, -24934=>10462, -25011=>10463, -25133=>10464, -25710=>10465, -25712=>10466, -25750=>10467, -25760=>10468, -25733=>10469, -25751=>10470, -25756=>10471, -25743=>10472, -25739=>10473, -25738=>10474, -25740=>10475, -25763=>10476, -25759=>10477, -25704=>10478, -25777=>10479, -25752=>10480, -25974=>10481, -25978=>10482, -25977=>10483, -25979=>10484, -26034=>10485, -26035=>10486, -26293=>10487, -26288=>10488, -26281=>10489, -26290=>10490, -26295=>10491, -26282=>10492, -26287=>10493, -27136=>10494, -27142=>10495, -27159=>10496, -27109=>10497, -27128=>10498, -27157=>10499, -27121=>10500, -27108=>10501, -27168=>10502, -27135=>10503, -27116=>10504, -27106=>10505, -27163=>10506, -27165=>10507, -27134=>10508, -27175=>10509, -27122=>10510, -27118=>10511, -27156=>10512, -27127=>10513, -27111=>10514, -27200=>10515, -27144=>10516, -27110=>10517, -27131=>10518, -27149=>10519, -27132=>10520, -27115=>10521, -27145=>10522, -27140=>10523, -27160=>10524, -27173=>10525, -27151=>10526, -27126=>10527, -27174=>10528, -27143=>10529, -27124=>10530, -27158=>10531, -27473=>10532, -27557=>10533, -27555=>10534, -27554=>10535, -27558=>10536, -27649=>10537, -27648=>10538, -27647=>10539, -27650=>10540, -28481=>10541, -28454=>10542, -28542=>10543, -28551=>10544, -28614=>10545, -28562=>10546, -28557=>10547, -28553=>10548, -28556=>10549, -28514=>10550, -28495=>10551, -28549=>10552, -28506=>10553, -28566=>10554, -28534=>10555, -28524=>10556, -28546=>10557, -28501=>10558, -28530=>10559, -28498=>10560, -28496=>10561, -28503=>10562, -28564=>10563, -28563=>10564, -28509=>10565, -28416=>10566, -28513=>10567, -28523=>10568, -28541=>10569, -28519=>10570, -28560=>10571, -28499=>10572, -28555=>10573, -28521=>10574, -28543=>10575, -28565=>10576, -28515=>10577, -28535=>10578, -28522=>10579, -28539=>10580, -29106=>10581, -29103=>10582, -29083=>10583, -29104=>10584, -29088=>10585, -29082=>10586, -29097=>10587, -29109=>10588, -29085=>10589, -29093=>10590, -29086=>10591, -29092=>10592, -29089=>10593, -29098=>10594, -29084=>10595, -29095=>10596, -29107=>10597, -29336=>10598, -29338=>10599, -29528=>10600, -29522=>10601, -29534=>10602, -29535=>10603, -29536=>10604, -29533=>10605, -29531=>10606, -29537=>10607, -29530=>10608, -29529=>10609, -29538=>10610, -29831=>10611, -29833=>10612, -29834=>10613, -29830=>10614, -29825=>10615, -29821=>10616, -29829=>10617, -29832=>10618, -29820=>10619, -29817=>10620, -58868=>10620, -29960=>10621, -29959=>10622, -30078=>10623, -30245=>10624, -30238=>10625, -30233=>10626, -30237=>10627, -30236=>10628, -30243=>10629, -30234=>10630, -30248=>10631, -30235=>10632, -30364=>10633, -30365=>10634, -30366=>10635, -30363=>10636, -30605=>10637, -30607=>10638, -30601=>10639, -30600=>10640, -30925=>10641, -30907=>10642, -30927=>10643, -30924=>10644, -30929=>10645, -30926=>10646, -30932=>10647, -30920=>10648, -30915=>10649, -30916=>10650, -30921=>10651, -31130=>10652, -31137=>10653, -31136=>10654, -31132=>10655, -31138=>10656, -31131=>10657, -59175=>10657, -27510=>10658, -31289=>10659, -31410=>10660, -31412=>10661, -31411=>10662, -31671=>10663, -31691=>10664, -31678=>10665, -31660=>10666, -31694=>10667, -31663=>10668, -31673=>10669, -31690=>10670, -31669=>10671, -31941=>10672, -31944=>10673, -31948=>10674, -31947=>10675, -32247=>10676, -32219=>10677, -32234=>10678, -32231=>10679, -32215=>10680, -32225=>10681, -32259=>10682, -32250=>10683, -32230=>10684, -32246=>10685, -32241=>10686, -32240=>10687, -32238=>10688, -32223=>10689, -32630=>10690, -32684=>10691, -32688=>10692, -32685=>10693, -32749=>10694, -32747=>10695, -32746=>10696, -32748=>10697, -32742=>10698, -32744=>10699, -32868=>10700, -32871=>10701, -33187=>10702, -33183=>10703, -33182=>10704, -33173=>10705, -33186=>10706, -33177=>10707, -33175=>10708, -33302=>10709, -33359=>10710, -33363=>10711, -33362=>10712, -33360=>10713, -33358=>10714, -33361=>10715, -34084=>10716, -34107=>10717, -34063=>10718, -34048=>10719, -34089=>10720, -34062=>10721, -34057=>10722, -34061=>10723, -34079=>10724, -34058=>10725, -34087=>10726, -34076=>10727, -34043=>10728, -34091=>10729, -34042=>10730, -34056=>10731, -34060=>10732, -34036=>10733, -34090=>10734, -34034=>10735, -34069=>10736, -34039=>10737, -34027=>10738, -34035=>10739, -34044=>10740, -34066=>10741, -34026=>10742, -34025=>10743, -34070=>10744, -34046=>10745, -34088=>10746, -34077=>10747, -34094=>10748, -34050=>10749, -34045=>10750, -34078=>10751, -34038=>10752, -34097=>10753, -34086=>10754, -34023=>10755, -34024=>10756, -34032=>10757, -34031=>10758, -34041=>10759, -34072=>10760, -34080=>10761, -34096=>10762, -34059=>10763, -34073=>10764, -34095=>10765, -34402=>10766, -34646=>10767, -34659=>10768, -34660=>10769, -34679=>10770, -34785=>10771, -34675=>10772, -34648=>10773, -34644=>10774, -34651=>10775, -34642=>10776, -34657=>10777, -34650=>10778, -34641=>10779, -34654=>10780, -34669=>10781, -34666=>10782, -34640=>10783, -34638=>10784, -34655=>10785, -34653=>10786, -34671=>10787, -34668=>10788, -34682=>10789, -34670=>10790, -34652=>10791, -34661=>10792, -34639=>10793, -34683=>10794, -34677=>10795, -34658=>10796, -34663=>10797, -34665=>10798, -34906=>10799, -35077=>10800, -35084=>10801, -35092=>10802, -35083=>10803, -35095=>10804, -35096=>10805, -35097=>10806, -35078=>10807, -35094=>10808, -35089=>10809, -35086=>10810, -35081=>10811, -35234=>10812, -35236=>10813, -35235=>10814, -35309=>10815, -35312=>10816, -35308=>10817, -35535=>10818, -35526=>10819, -35512=>10820, -35539=>10821, -35537=>10822, -35540=>10823, -35541=>10824, -35515=>10825, -35543=>10826, -35518=>10827, -35520=>10828, -35525=>10829, -35544=>10830, -35523=>10831, -35514=>10832, -35517=>10833, -35545=>10834, -35902=>10835, -35917=>10836, -35983=>10837, -36069=>10838, -36063=>10839, -36057=>10840, -36072=>10841, -36058=>10842, -36061=>10843, -36071=>10844, -36256=>10845, -36252=>10846, -36257=>10847, -36251=>10848, -36384=>10849, -36387=>10850, -36389=>10851, -36388=>10852, -36398=>10853, -36373=>10854, -36379=>10855, -36374=>10856, -36369=>10857, -36377=>10858, -36390=>10859, -36391=>10860, -36372=>10861, -36370=>10862, -36376=>10863, -36371=>10864, -36380=>10865, -36375=>10866, -36378=>10867, -36652=>10868, -36644=>10869, -36632=>10870, -36634=>10871, -36640=>10872, -36643=>10873, -36630=>10874, -36631=>10875, -36979=>10876, -36976=>10877, -36975=>10878, -36967=>10879, -36971=>10880, -37167=>10881, -37163=>10882, -37161=>10883, -37162=>10884, -37170=>10885, -37158=>10886, -37166=>10887, -37253=>10888, -37254=>10889, -37258=>10890, -37249=>10891, -37250=>10892, -37252=>10893, -37248=>10894, -37584=>10895, -37571=>10896, -37572=>10897, -37568=>10898, -37593=>10899, -37558=>10900, -37583=>10901, -37617=>10902, -37599=>10903, -37592=>10904, -37609=>10905, -37591=>10906, -37597=>10907, -37580=>10908, -37615=>10909, -37570=>10910, -37608=>10911, -37578=>10912, -37576=>10913, -37582=>10914, -37606=>10915, -37581=>10916, -37589=>10917, -37577=>10918, -37600=>10919, -37598=>10920, -37607=>10921, -37585=>10922, -37587=>10923, -37557=>10924, -37601=>10925, -37669=>10926, -37574=>10927, -37556=>10928, -38268=>10929, -38316=>10930, -38315=>10931, -38318=>10932, -38320=>10933, -38564=>10934, -38562=>10935, -38611=>10936, -38661=>10937, -38664=>10938, -38658=>10939, -38746=>10940, -38794=>10941, -38798=>10942, -38792=>10943, -38864=>10944, -38863=>10945, -38942=>10946, -38941=>10947, -38950=>10948, -38953=>10949, -38952=>10950, -38944=>10951, -38939=>10952, -38951=>10953, -39090=>10954, -39176=>10955, -39162=>10956, -39185=>10957, -39188=>10958, -39190=>10959, -39191=>10960, -39189=>10961, -39388=>10962, -39373=>10963, -39375=>10964, -39379=>10965, -39380=>10966, -39374=>10967, -39369=>10968, -39382=>10969, -60270=>10969, -39384=>10970, -39371=>10971, -39383=>10972, -39372=>10973, -39603=>10974, -39660=>10975, -39659=>10976, -39667=>10977, -39666=>10978, -39665=>10979, -39750=>10980, -39747=>10981, -39783=>10982, -39796=>10983, -39793=>10984, -39782=>10985, -39798=>10986, -39797=>10987, -39792=>10988, -39784=>10989, -39780=>10990, -39788=>10991, -40188=>10992, -40186=>10993, -40189=>10994, -40191=>10995, -40183=>10996, -40199=>10997, -40192=>10998, -40185=>10999, -40187=>11000, -40200=>11001, -40197=>11002, -40196=>11003, -40579=>11004, -40659=>11005, -40719=>11006, -40720=>11007, -20764=>11008, -20755=>11009, -20759=>11010, -20762=>11011, -20753=>11012, -20958=>11013, -21300=>11014, -21473=>11015, -22128=>11016, -22112=>11017, -22126=>11018, -22131=>11019, -22118=>11020, -22115=>11021, -22125=>11022, -22130=>11023, -22110=>11024, -22135=>11025, -22300=>11026, -22299=>11027, -22728=>11028, -22717=>11029, -22729=>11030, -22719=>11031, -22714=>11032, -22722=>11033, -22716=>11034, -22726=>11035, -23319=>11036, -23321=>11037, -23323=>11038, -23329=>11039, -23316=>11040, -23315=>11041, -23312=>11042, -23318=>11043, -23336=>11044, -59539=>11044, -23322=>11045, -23328=>11046, -23326=>11047, -23535=>11048, -23980=>11049, -23985=>11050, -23977=>11051, -23975=>11052, -23989=>11053, -23984=>11054, -23982=>11055, -23978=>11056, -23976=>11057, -23986=>11058, -23981=>11059, -23983=>11060, -23988=>11061, -24167=>11062, -24168=>11063, -24166=>11064, -24175=>11065, -24297=>11066, -24295=>11067, -24294=>11068, -24296=>11069, -24293=>11070, -24395=>11071, -24508=>11072, -24507=>11073, -24989=>11074, -25000=>11075, -24982=>11076, -25029=>11077, -25012=>11078, -25030=>11079, -25025=>11080, -25036=>11081, -25018=>11082, -25023=>11083, -25016=>11084, -24972=>11085, -25815=>11086, -25814=>11087, -25808=>11088, -25807=>11089, -25801=>11090, -25789=>11091, -25737=>11092, -25795=>11093, -25819=>11094, -25843=>11095, -25817=>11096, -25907=>11097, -25983=>11098, -25980=>11099, -26018=>11100, -26312=>11101, -26302=>11102, -26304=>11103, -26314=>11104, -26315=>11105, -26319=>11106, -26301=>11107, -26299=>11108, -26298=>11109, -26316=>11110, -26403=>11111, -27188=>11112, -27238=>11113, -27209=>11114, -27239=>11115, -27186=>11116, -27240=>11117, -27198=>11118, -27229=>11119, -27245=>11120, -27254=>11121, -27227=>11122, -27217=>11123, -27176=>11124, -27226=>11125, -27195=>11126, -27199=>11127, -27201=>11128, -27242=>11129, -27236=>11130, -27216=>11131, -27215=>11132, -27220=>11133, -27247=>11134, -27241=>11135, -27232=>11136, -27196=>11137, -27230=>11138, -27222=>11139, -27221=>11140, -27213=>11141, -27214=>11142, -27206=>11143, -27477=>11144, -27476=>11145, -27478=>11146, -27559=>11147, -27562=>11148, -27563=>11149, -27592=>11150, -27591=>11151, -27652=>11152, -27651=>11153, -27654=>11154, -28589=>11155, -28619=>11156, -28579=>11157, -28615=>11158, -28604=>11159, -28622=>11160, -28616=>11161, -28510=>11162, -28612=>11163, -28605=>11164, -28574=>11165, -28618=>11166, -28584=>11167, -28676=>11168, -28581=>11169, -28590=>11170, -28602=>11171, -28588=>11172, -28586=>11173, -28623=>11174, -28607=>11175, -28600=>11176, -28578=>11177, -28617=>11178, -28587=>11179, -28621=>11180, -28591=>11181, -28594=>11182, -28592=>11183, -29125=>11184, -29122=>11185, -29119=>11186, -29112=>11187, -29142=>11188, -29120=>11189, -29121=>11190, -29131=>11191, -29140=>11192, -29130=>11193, -29127=>11194, -29135=>11195, -29117=>11196, -29144=>11197, -29116=>11198, -29126=>11199, -29146=>11200, -29147=>11201, -29341=>11202, -29342=>11203, -29545=>11204, -29542=>11205, -29543=>11206, -29548=>11207, -29541=>11208, -29547=>11209, -29546=>11210, -29823=>11211, -29850=>11212, -29856=>11213, -29844=>11214, -29842=>11215, -29845=>11216, -29857=>11217, -29963=>11218, -30080=>11219, -30255=>11220, -30253=>11221, -30257=>11222, -30269=>11223, -30259=>11224, -30268=>11225, -30261=>11226, -30258=>11227, -30256=>11228, -30395=>11229, -30438=>11230, -30618=>11231, -30621=>11232, -30625=>11233, -30620=>11234, -30619=>11235, -30626=>11236, -30627=>11237, -30613=>11238, -30617=>11239, -30615=>11240, -30941=>11241, -30953=>11242, -30949=>11243, -30954=>11244, -30942=>11245, -30947=>11246, -30939=>11247, -30945=>11248, -30946=>11249, -30957=>11250, -30943=>11251, -30944=>11252, -31140=>11253, -31300=>11254, -31304=>11255, -31303=>11256, -31414=>11257, -31416=>11258, -31413=>11259, -31409=>11260, -31415=>11261, -31710=>11262, -31715=>11263, -31719=>11264, -31709=>11265, -31701=>11266, -31717=>11267, -31706=>11268, -31720=>11269, -31737=>11270, -31700=>11271, -31722=>11272, -31714=>11273, -31708=>11274, -31723=>11275, -31704=>11276, -31711=>11277, -31954=>11278, -31956=>11279, -31959=>11280, -31952=>11281, -31953=>11282, -32274=>11283, -32289=>11284, -32279=>11285, -32268=>11286, -32287=>11287, -32288=>11288, -32275=>11289, -32270=>11290, -32284=>11291, -32277=>11292, -32282=>11293, -32290=>11294, -32267=>11295, -32271=>11296, -32278=>11297, -32269=>11298, -32276=>11299, -32293=>11300, -32292=>11301, -32579=>11302, -32635=>11303, -32636=>11304, -32634=>11305, -32689=>11306, -32751=>11307, -32810=>11308, -32809=>11309, -32876=>11310, -33201=>11311, -33190=>11312, -33198=>11313, -33209=>11314, -33205=>11315, -33195=>11316, -33200=>11317, -33196=>11318, -33204=>11319, -33202=>11320, -33207=>11321, -33191=>11322, -33266=>11323, -33365=>11324, -33366=>11325, -33367=>11326, -34134=>11327, -34117=>11328, -34155=>11329, -34125=>11330, -34131=>11331, -34145=>11332, -34136=>11333, -34112=>11334, -34118=>11335, -34148=>11336, -34113=>11337, -34146=>11338, -34116=>11339, -34129=>11340, -34119=>11341, -34147=>11342, -34110=>11343, -34139=>11344, -34161=>11345, -34126=>11346, -34158=>11347, -34165=>11348, -34133=>11349, -34151=>11350, -34144=>11351, -34188=>11352, -34150=>11353, -34141=>11354, -34132=>11355, -34149=>11356, -34156=>11357, -34403=>11358, -34405=>11359, -34404=>11360, -34724=>11361, -34715=>11362, -34703=>11363, -34711=>11364, -34707=>11365, -34706=>11366, -34696=>11367, -34689=>11368, -34710=>11369, -34712=>11370, -34681=>11371, -34695=>11372, -34723=>11373, -34693=>11374, -34704=>11375, -34705=>11376, -34717=>11377, -34692=>11378, -34708=>11379, -34716=>11380, -34714=>11381, -34697=>11382, -35102=>11383, -35110=>11384, -35120=>11385, -35117=>11386, -35118=>11387, -35111=>11388, -35121=>11389, -35106=>11390, -35113=>11391, -35107=>11392, -35119=>11393, -35116=>11394, -35103=>11395, -35313=>11396, -35552=>11397, -35554=>11398, -35570=>11399, -35572=>11400, -35573=>11401, -35549=>11402, -35604=>11403, -35556=>11404, -35551=>11405, -35568=>11406, -35528=>11407, -35550=>11408, -35553=>11409, -35560=>11410, -35583=>11411, -35567=>11412, -35579=>11413, -35985=>11414, -35986=>11415, -35984=>11416, -36085=>11417, -36078=>11418, -36081=>11419, -36080=>11420, -36083=>11421, -36204=>11422, -36206=>11423, -36261=>11424, -36263=>11425, -36403=>11426, -36414=>11427, -36408=>11428, -36416=>11429, -36421=>11430, -36406=>11431, -36412=>11432, -36413=>11433, -36417=>11434, -36400=>11435, -36415=>11436, -36541=>11437, -36662=>11438, -60329=>11438, -36654=>11439, -36661=>11440, -36658=>11441, -36665=>11442, -36663=>11443, -36660=>11444, -36982=>11445, -36985=>11446, -36987=>11447, -36998=>11448, -37114=>11449, -37171=>11450, -37173=>11451, -37174=>11452, -37267=>11453, -37264=>11454, -37265=>11455, -37261=>11456, -37263=>11457, -37671=>11458, -37662=>11459, -37640=>11460, -37663=>11461, -37638=>11462, -37647=>11463, -37754=>11464, -37688=>11465, -37692=>11466, -37659=>11467, -37667=>11468, -37650=>11469, -37633=>11470, -37702=>11471, -37677=>11472, -37646=>11473, -37645=>11474, -37579=>11475, -37661=>11476, -37626=>11477, -37651=>11478, -37625=>11479, -37623=>11480, -37684=>11481, -37634=>11482, -37668=>11483, -37631=>11484, -37673=>11485, -37689=>11486, -37685=>11487, -37674=>11488, -37652=>11489, -37644=>11490, -37643=>11491, -37630=>11492, -37641=>11493, -37632=>11494, -37627=>11495, -37654=>11496, -38332=>11497, -38349=>11498, -38334=>11499, -38329=>11500, -38330=>11501, -38326=>11502, -38335=>11503, -38325=>11504, -38333=>11505, -38569=>11506, -38612=>11507, -38667=>11508, -38674=>11509, -38672=>11510, -38809=>11511, -38807=>11512, -38804=>11513, -38896=>11514, -38904=>11515, -38965=>11516, -38959=>11517, -38962=>11518, -39204=>11519, -39199=>11520, -39207=>11521, -39209=>11522, -39326=>11523, -39406=>11524, -39404=>11525, -39397=>11526, -39396=>11527, -39408=>11528, -39395=>11529, -39402=>11530, -39401=>11531, -39399=>11532, -39609=>11533, -39615=>11534, -39604=>11535, -39611=>11536, -39670=>11537, -39674=>11538, -39673=>11539, -39671=>11540, -39731=>11541, -39808=>11542, -39813=>11543, -39815=>11544, -39804=>11545, -39806=>11546, -39803=>11547, -39810=>11548, -39827=>11549, -39826=>11550, -39824=>11551, -39802=>11552, -39829=>11553, -39805=>11554, -39816=>11555, -40229=>11556, -40215=>11557, -40224=>11558, -40222=>11559, -40212=>11560, -40233=>11561, -40221=>11562, -40216=>11563, -40226=>11564, -40208=>11565, -40217=>11566, -40223=>11567, -40584=>11568, -40582=>11569, -40583=>11570, -40622=>11571, -40621=>11572, -40661=>11573, -40662=>11574, -40698=>11575, -40722=>11576, -40765=>11577, -20774=>11578, -20773=>11579, -20770=>11580, -20772=>11581, -20768=>11582, -20777=>11583, -21236=>11584, -22163=>11585, -22156=>11586, -22157=>11587, -22150=>11588, -22148=>11589, -22147=>11590, -22142=>11591, -22146=>11592, -22143=>11593, -22145=>11594, -22742=>11595, -22740=>11596, -22735=>11597, -22738=>11598, -23341=>11599, -23333=>11600, -23346=>11601, -23331=>11602, -23340=>11603, -23335=>11604, -23334=>11605, -23343=>11606, -23342=>11607, -23419=>11608, -23537=>11609, -23538=>11610, -23991=>11611, -24172=>11612, -24170=>11613, -24510=>11614, -25027=>11615, -25013=>11616, -25020=>11617, -25063=>11618, -25056=>11619, -25061=>11620, -25060=>11621, -25064=>11622, -25054=>11623, -25839=>11624, -25833=>11625, -25827=>11626, -25835=>11627, -25828=>11628, -25832=>11629, -25985=>11630, -25984=>11631, -26038=>11632, -26074=>11633, -26322=>11634, -27277=>11635, -27286=>11636, -27265=>11637, -27301=>11638, -27273=>11639, -27295=>11640, -27291=>11641, -27297=>11642, -27294=>11643, -27271=>11644, -27283=>11645, -27278=>11646, -27285=>11647, -27267=>11648, -27304=>11649, -27300=>11650, -27281=>11651, -27263=>11652, -27302=>11653, -27290=>11654, -27269=>11655, -27276=>11656, -27282=>11657, -27483=>11658, -27565=>11659, -27657=>11660, -28620=>11661, -28585=>11662, -28660=>11663, -28628=>11664, -28643=>11665, -28636=>11666, -28653=>11667, -28647=>11668, -28646=>11669, -28638=>11670, -28658=>11671, -28637=>11672, -28642=>11673, -28648=>11674, -29153=>11675, -29169=>11676, -29160=>11677, -29170=>11678, -29156=>11679, -29168=>11680, -29154=>11681, -29555=>11682, -29550=>11683, -29551=>11684, -29847=>11685, -29874=>11686, -29867=>11687, -29840=>11688, -29866=>11689, -29869=>11690, -29873=>11691, -29861=>11692, -29871=>11693, -29968=>11694, -29969=>11695, -29970=>11696, -29967=>11697, -30084=>11698, -30275=>11699, -30280=>11700, -30281=>11701, -30279=>11702, -30372=>11703, -30441=>11704, -30645=>11705, -30635=>11706, -30642=>11707, -30647=>11708, -30646=>11709, -30644=>11710, -30641=>11711, -30632=>11712, -30704=>11713, -30963=>11714, -30973=>11715, -30978=>11716, -30971=>11717, -30972=>11718, -30975=>11719, -30962=>11720, -30981=>11721, -30969=>11722, -30974=>11723, -30980=>11724, -31147=>11725, -31144=>11726, -31324=>11727, -31323=>11728, -31318=>11729, -31320=>11730, -31316=>11731, -31322=>11732, -31422=>11733, -31424=>11734, -31425=>11735, -31749=>11736, -31759=>11737, -31730=>11738, -31744=>11739, -31743=>11740, -31739=>11741, -31758=>11742, -31732=>11743, -31755=>11744, -31731=>11745, -31746=>11746, -31753=>11747, -31747=>11748, -31745=>11749, -31736=>11750, -31741=>11751, -31750=>11752, -58176=>11752, -31728=>11753, -31729=>11754, -31760=>11755, -31754=>11756, -31976=>11757, -32301=>11758, -32316=>11759, -32322=>11760, -32307=>11761, -38984=>11762, -32312=>11763, -32298=>11764, -32329=>11765, -32320=>11766, -32327=>11767, -32297=>11768, -32332=>11769, -32304=>11770, -32315=>11771, -32310=>11772, -32324=>11773, -32314=>11774, -32581=>11775, -32639=>11776, -32638=>11777, -32637=>11778, -32756=>11779, -32754=>11780, -32812=>11781, -33211=>11782, -33220=>11783, -33228=>11784, -33226=>11785, -33221=>11786, -33223=>11787, -33212=>11788, -33257=>11789, -33371=>11790, -33370=>11791, -33372=>11792, -34179=>11793, -34176=>11794, -34191=>11795, -34215=>11796, -34197=>11797, -34208=>11798, -34187=>11799, -34211=>11800, -34171=>11801, -34212=>11802, -34202=>11803, -34206=>11804, -34167=>11805, -34172=>11806, -34185=>11807, -34209=>11808, -34170=>11809, -34168=>11810, -34135=>11811, -34190=>11812, -34198=>11813, -34182=>11814, -34189=>11815, -34201=>11816, -34205=>11817, -34177=>11818, -34210=>11819, -34178=>11820, -34184=>11821, -34181=>11822, -34169=>11823, -34166=>11824, -34200=>11825, -34192=>11826, -34207=>11827, -34408=>11828, -34750=>11829, -34730=>11830, -34733=>11831, -34757=>11832, -34736=>11833, -34732=>11834, -34745=>11835, -34741=>11836, -34748=>11837, -34734=>11838, -34761=>11839, -34755=>11840, -34754=>11841, -34764=>11842, -34743=>11843, -34735=>11844, -34756=>11845, -34762=>11846, -34740=>11847, -34742=>11848, -34751=>11849, -34744=>11850, -34749=>11851, -34782=>11852, -34738=>11853, -35125=>11854, -35123=>11855, -35132=>11856, -35134=>11857, -35137=>11858, -35154=>11859, -35127=>11860, -35138=>11861, -35245=>11862, -35247=>11863, -35246=>11864, -35314=>11865, -35315=>11866, -35614=>11867, -35608=>11868, -35606=>11869, -35601=>11870, -35589=>11871, -35595=>11872, -35618=>11873, -35599=>11874, -35602=>11875, -35605=>11876, -35591=>11877, -35597=>11878, -35592=>11879, -35590=>11880, -35612=>11881, -35603=>11882, -35610=>11883, -35919=>11884, -35952=>11885, -35954=>11886, -35953=>11887, -35951=>11888, -35989=>11889, -35988=>11890, -36089=>11891, -36207=>11892, -36430=>11893, -36429=>11894, -36435=>11895, -36432=>11896, -36428=>11897, -36423=>11898, -36675=>11899, -36672=>11900, -36997=>11901, -36990=>11902, -37176=>11903, -37274=>11904, -37282=>11905, -37275=>11906, -37273=>11907, -37279=>11908, -37281=>11909, -37277=>11910, -37280=>11911, -37793=>11912, -37763=>11913, -37807=>11914, -37732=>11915, -37718=>11916, -37703=>11917, -37756=>11918, -37720=>11919, -37724=>11920, -37750=>11921, -37705=>11922, -37712=>11923, -37713=>11924, -37728=>11925, -37741=>11926, -37775=>11927, -37708=>11928, -37738=>11929, -37753=>11930, -37719=>11931, -37717=>11932, -37714=>11933, -37711=>11934, -37745=>11935, -37751=>11936, -37755=>11937, -37729=>11938, -37726=>11939, -37731=>11940, -37735=>11941, -37710=>11942, -37721=>11943, -38343=>11944, -38336=>11945, -38345=>11946, -38339=>11947, -38341=>11948, -38327=>11949, -38574=>11950, -38576=>11951, -38572=>11952, -38688=>11953, -38687=>11954, -38680=>11955, -38685=>11956, -38681=>11957, -38810=>11958, -38817=>11959, -38812=>11960, -38814=>11961, -38813=>11962, -38869=>11963, -38868=>11964, -38897=>11965, -38977=>11966, -38980=>11967, -38986=>11968, -38985=>11969, -38981=>11970, -38979=>11971, -39205=>11972, -39211=>11973, -39212=>11974, -39210=>11975, -39219=>11976, -39218=>11977, -39215=>11978, -39213=>11979, -39217=>11980, -39216=>11981, -39320=>11982, -39331=>11983, -39329=>11984, -39426=>11985, -39418=>11986, -39412=>11987, -39415=>11988, -39417=>11989, -39416=>11990, -39414=>11991, -39419=>11992, -39421=>11993, -39422=>11994, -39420=>11995, -39427=>11996, -39614=>11997, -39678=>11998, -39677=>11999, -39681=>12000, -39676=>12001, -39752=>12002, -39834=>12003, -39848=>12004, -39838=>12005, -39835=>12006, -39846=>12007, -39841=>12008, -39845=>12009, -39844=>12010, -39814=>12011, -39842=>12012, -39840=>12013, -39855=>12014, -40243=>12015, -40257=>12016, -40295=>12017, -40246=>12018, -40238=>12019, -40239=>12020, -40241=>12021, -40248=>12022, -40240=>12023, -40261=>12024, -40258=>12025, -40259=>12026, -40254=>12027, -40247=>12028, -40256=>12029, -40253=>12030, -32757=>12031, -40237=>12032, -40586=>12033, -40585=>12034, -40589=>12035, -40624=>12036, -40648=>12037, -40666=>12038, -40699=>12039, -40703=>12040, -40740=>12041, -40739=>12042, -40738=>12043, -40788=>12044, -12245=>12045, -40864=>12045, -20785=>12046, -20781=>12047, -20782=>12048, -22168=>12049, -22172=>12050, -22167=>12051, -22170=>12052, -22173=>12053, -22169=>12054, -22896=>12055, -23356=>12056, -23657=>12057, -23658=>12058, -24000=>12059, -24173=>12060, -24174=>12061, -25048=>12062, -25055=>12063, -25069=>12064, -25070=>12065, -25073=>12066, -25066=>12067, -25072=>12068, -25067=>12069, -25046=>12070, -25065=>12071, -25855=>12072, -25860=>12073, -25853=>12074, -25848=>12075, -25857=>12076, -25859=>12077, -25852=>12078, -26004=>12079, -26075=>12080, -26330=>12081, -26331=>12082, -26328=>12083, -27333=>12084, -27321=>12085, -27325=>12086, -27361=>12087, -27334=>12088, -27322=>12089, -27318=>12090, -27319=>12091, -27335=>12092, -27316=>12093, -27309=>12094, -27486=>12095, -27593=>12096, -27659=>12097, -28679=>12098, -28684=>12099, -28685=>12100, -28673=>12101, -28677=>12102, -28692=>12103, -28686=>12104, -28671=>12105, -28672=>12106, -28667=>12107, -28710=>12108, -28668=>12109, -28663=>12110, -28682=>12111, -29185=>12112, -60224=>12112, -29183=>12113, -29177=>12114, -29187=>12115, -29181=>12116, -29558=>12117, -29880=>12118, -29888=>12119, -29877=>12120, -29889=>12121, -29886=>12122, -29878=>12123, -29883=>12124, -29890=>12125, -29972=>12126, -29971=>12127, -30300=>12128, -30308=>12129, -30297=>12130, -30288=>12131, -30291=>12132, -30295=>12133, -30298=>12134, -30374=>12135, -30397=>12136, -30444=>12137, -30658=>12138, -30650=>12139, -30988=>12140, -30995=>12141, -30996=>12142, -30985=>12143, -30992=>12144, -30994=>12145, -30993=>12146, -31149=>12147, -31148=>12148, -31327=>12149, -31772=>12150, -31785=>12151, -31769=>12152, -31776=>12153, -31775=>12154, -31789=>12155, -31773=>12156, -31782=>12157, -31784=>12158, -31778=>12159, -31781=>12160, -31792=>12161, -32348=>12162, -32336=>12163, -32342=>12164, -32355=>12165, -32344=>12166, -32354=>12167, -32351=>12168, -32337=>12169, -32352=>12170, -32343=>12171, -32339=>12172, -32693=>12173, -32691=>12174, -32759=>12175, -32760=>12176, -32885=>12177, -33233=>12178, -33234=>12179, -33232=>12180, -33375=>12181, -33374=>12182, -34228=>12183, -34246=>12184, -34240=>12185, -34243=>12186, -34242=>12187, -34227=>12188, -34229=>12189, -34237=>12190, -34247=>12191, -34244=>12192, -34239=>12193, -34251=>12194, -34254=>12195, -34248=>12196, -34245=>12197, -34225=>12198, -34230=>12199, -34258=>12200, -34340=>12201, -34232=>12202, -34231=>12203, -34238=>12204, -34409=>12205, -34791=>12206, -34790=>12207, -34786=>12208, -34779=>12209, -34795=>12210, -34794=>12211, -34789=>12212, -34783=>12213, -34803=>12214, -34788=>12215, -34772=>12216, -34780=>12217, -34771=>12218, -34797=>12219, -34776=>12220, -34787=>12221, -34775=>12222, -34777=>12223, -34817=>12224, -34804=>12225, -34792=>12226, -34781=>12227, -35155=>12228, -35147=>12229, -35151=>12230, -35148=>12231, -35142=>12232, -35152=>12233, -35153=>12234, -35145=>12235, -35626=>12236, -35623=>12237, -35619=>12238, -35635=>12239, -35632=>12240, -35637=>12241, -35655=>12242, -35631=>12243, -35644=>12244, -35646=>12245, -35633=>12246, -35621=>12247, -35639=>12248, -35622=>12249, -35638=>12250, -35630=>12251, -35620=>12252, -35643=>12253, -35645=>12254, -35642=>12255, -35906=>12256, -35957=>12257, -35993=>12258, -35992=>12259, -35991=>12260, -36094=>12261, -36100=>12262, -36098=>12263, -36096=>12264, -36444=>12265, -36450=>12266, -36448=>12267, -36439=>12268, -36438=>12269, -36446=>12270, -36453=>12271, -36455=>12272, -36443=>12273, -36442=>12274, -36449=>12275, -36445=>12276, -36457=>12277, -36436=>12278, -36678=>12279, -36679=>12280, -36680=>12281, -36683=>12282, -37160=>12283, -37178=>12284, -37179=>12285, -37182=>12286, -37288=>12287, -37285=>12288, -37287=>12289, -37295=>12290, -37290=>12291, -37813=>12292, -37772=>12293, -37778=>12294, -37815=>12295, -37787=>12296, -37789=>12297, -37769=>12298, -37799=>12299, -37774=>12300, -37802=>12301, -37790=>12302, -37798=>12303, -37781=>12304, -37768=>12305, -37785=>12306, -37791=>12307, -37760=>12308, -37773=>12309, -37809=>12310, -37777=>12311, -37810=>12312, -37796=>12313, -37800=>12314, -37812=>12315, -37795=>12316, -38354=>12317, -38355=>12318, -38353=>12319, -38579=>12320, -38615=>12321, -38618=>12322, -24002=>12323, -38623=>12324, -38616=>12325, -38621=>12326, -38691=>12327, -38690=>12328, -38693=>12329, -38828=>12330, -38830=>12331, -38824=>12332, -38827=>12333, -38820=>12334, -38826=>12335, -38818=>12336, -38821=>12337, -38871=>12338, -38873=>12339, -38870=>12340, -38872=>12341, -38906=>12342, -38992=>12343, -38993=>12344, -38994=>12345, -39096=>12346, -39233=>12347, -39228=>12348, -39226=>12349, -39439=>12350, -39435=>12351, -39433=>12352, -39437=>12353, -39428=>12354, -39441=>12355, -39434=>12356, -39429=>12357, -39431=>12358, -39430=>12359, -39616=>12360, -39644=>12361, -39688=>12362, -39684=>12363, -39685=>12364, -39721=>12365, -39733=>12366, -39754=>12367, -39756=>12368, -39755=>12369, -39879=>12370, -39878=>12371, -39875=>12372, -39871=>12373, -39873=>12374, -39861=>12375, -39864=>12376, -39891=>12377, -39862=>12378, -39876=>12379, -39865=>12380, -39869=>12381, -40284=>12382, -40275=>12383, -40271=>12384, -40266=>12385, -40283=>12386, -40267=>12387, -40281=>12388, -40278=>12389, -40268=>12390, -40279=>12391, -40274=>12392, -40276=>12393, -40287=>12394, -40280=>12395, -40282=>12396, -40590=>12397, -40588=>12398, -40671=>12399, -40705=>12400, -40704=>12401, -40726=>12402, -58693=>12402, -40741=>12403, -40747=>12404, -40746=>12405, -40745=>12406, -40744=>12407, -40780=>12408, -40789=>12409, -20788=>12410, -20789=>12411, -21142=>12412, -21239=>12413, -21428=>12414, -22187=>12415, -22189=>12416, -22182=>12417, -22183=>12418, -22186=>12419, -22188=>12420, -22746=>12421, -22749=>12422, -22747=>12423, -22802=>12424, -23357=>12425, -23358=>12426, -23359=>12427, -24003=>12428, -24176=>12429, -24511=>12430, -25083=>12431, -25863=>12432, -25872=>12433, -25869=>12434, -25865=>12435, -25868=>12436, -25870=>12437, -25988=>12438, -26078=>12439, -26077=>12440, -26334=>12441, -27367=>12442, -27360=>12443, -27340=>12444, -27345=>12445, -27353=>12446, -27339=>12447, -27359=>12448, -27356=>12449, -27344=>12450, -27371=>12451, -27343=>12452, -27341=>12453, -27358=>12454, -27488=>12455, -27568=>12456, -27660=>12457, -28697=>12458, -28711=>12459, -28704=>12460, -28694=>12461, -28715=>12462, -28705=>12463, -28706=>12464, -28707=>12465, -28713=>12466, -28695=>12467, -28708=>12468, -28700=>12469, -29196=>12470, -29194=>12471, -29191=>12472, -29186=>12473, -29189=>12474, -29349=>12475, -29350=>12476, -29348=>12477, -29347=>12478, -29345=>12479, -29899=>12480, -29893=>12481, -29879=>12482, -29891=>12483, -29974=>12484, -30304=>12485, -30665=>12486, -30666=>12487, -30660=>12488, -30705=>12489, -31005=>12490, -31003=>12491, -31009=>12492, -31004=>12493, -30999=>12494, -31006=>12495, -31152=>12496, -31335=>12497, -31336=>12498, -31795=>12499, -31804=>12500, -31801=>12501, -31788=>12502, -31803=>12503, -31980=>12504, -31978=>12505, -32374=>12506, -32373=>12507, -32376=>12508, -32368=>12509, -32375=>12510, -32367=>12511, -32378=>12512, -32370=>12513, -32372=>12514, -32360=>12515, -32587=>12516, -32586=>12517, -32643=>12518, -32646=>12519, -32695=>12520, -32765=>12521, -32766=>12522, -32888=>12523, -33239=>12524, -33237=>12525, -33291=>12526, -33380=>12527, -33377=>12528, -33379=>12529, -34283=>12530, -34289=>12531, -34285=>12532, -34265=>12533, -34273=>12534, -34280=>12535, -34266=>12536, -34263=>12537, -34284=>12538, -34290=>12539, -34296=>12540, -34264=>12541, -34271=>12542, -34275=>12543, -34268=>12544, -34257=>12545, -34288=>12546, -34278=>12547, -34287=>12548, -34270=>12549, -34274=>12550, -34816=>12551, -34810=>12552, -34819=>12553, -34806=>12554, -34807=>12555, -34825=>12556, -34828=>12557, -34827=>12558, -34822=>12559, -34812=>12560, -34824=>12561, -34815=>12562, -34826=>12563, -34818=>12564, -35170=>12565, -35162=>12566, -35163=>12567, -35159=>12568, -35169=>12569, -35164=>12570, -35160=>12571, -35165=>12572, -35161=>12573, -35208=>12574, -35255=>12575, -35254=>12576, -35318=>12577, -35664=>12578, -35656=>12579, -35658=>12580, -35648=>12581, -35667=>12582, -35670=>12583, -35668=>12584, -35659=>12585, -35669=>12586, -35665=>12587, -35650=>12588, -35666=>12589, -35671=>12590, -35907=>12591, -35959=>12592, -35958=>12593, -35994=>12594, -36102=>12595, -36103=>12596, -36105=>12597, -36268=>12598, -36266=>12599, -36269=>12600, -36267=>12601, -36461=>12602, -36472=>12603, -36467=>12604, -36458=>12605, -36463=>12606, -36475=>12607, -36546=>12608, -36690=>12609, -36689=>12610, -36687=>12611, -36688=>12612, -36691=>12613, -36788=>12614, -37184=>12615, -37183=>12616, -37296=>12617, -37293=>12618, -37854=>12619, -37831=>12620, -37839=>12621, -37826=>12622, -37850=>12623, -37840=>12624, -37881=>12625, -37868=>12626, -37836=>12627, -37849=>12628, -37801=>12629, -37862=>12630, -37834=>12631, -37844=>12632, -37870=>12633, -37859=>12634, -37845=>12635, -37828=>12636, -37838=>12637, -37824=>12638, -37842=>12639, -37797=>12640, -37863=>12641, -38269=>12642, -38362=>12643, -38363=>12644, -38625=>12645, -38697=>12646, -38699=>12647, -38700=>12648, -38696=>12649, -38694=>12650, -38835=>12651, -38839=>12652, -38838=>12653, -38877=>12654, -38878=>12655, -38879=>12656, -39004=>12657, -39001=>12658, -39005=>12659, -38999=>12660, -39103=>12661, -39101=>12662, -39099=>12663, -39102=>12664, -39240=>12665, -39239=>12666, -39235=>12667, -39334=>12668, -39335=>12669, -39450=>12670, -39445=>12671, -39461=>12672, -39453=>12673, -39460=>12674, -39451=>12675, -39458=>12676, -39456=>12677, -39463=>12678, -39459=>12679, -39454=>12680, -39452=>12681, -39444=>12682, -39618=>12683, -39691=>12684, -39690=>12685, -39694=>12686, -39692=>12687, -39735=>12688, -39914=>12689, -39915=>12690, -39904=>12691, -39902=>12692, -39908=>12693, -39910=>12694, -39906=>12695, -39920=>12696, -39892=>12697, -39895=>12698, -39916=>12699, -39900=>12700, -39897=>12701, -39909=>12702, -39893=>12703, -39905=>12704, -39898=>12705, -40311=>12706, -40321=>12707, -40330=>12708, -40324=>12709, -40328=>12710, -40305=>12711, -40320=>12712, -40312=>12713, -40326=>12714, -40331=>12715, -40332=>12716, -40317=>12717, -40299=>12718, -40308=>12719, -40309=>12720, -40304=>12721, -40297=>12722, -40325=>12723, -40307=>12724, -40315=>12725, -40322=>12726, -40303=>12727, -40313=>12728, -40319=>12729, -40327=>12730, -40296=>12731, -40596=>12732, -40593=>12733, -40640=>12734, -40700=>12735, -40749=>12736, -40768=>12737, -40769=>12738, -40781=>12739, -40790=>12740, -40791=>12741, -40792=>12742, -21303=>12743, -22194=>12744, -22197=>12745, -22195=>12746, -22755=>12747, -23365=>12748, -24006=>12749, -24007=>12750, -24302=>12751, -24303=>12752, -24512=>12753, -24513=>12754, -25081=>12755, -25879=>12756, -25878=>12757, -25877=>12758, -25875=>12759, -26079=>12760, -26344=>12761, -26339=>12762, -26340=>12763, -27379=>12764, -27376=>12765, -27370=>12766, -27368=>12767, -27385=>12768, -27377=>12769, -27374=>12770, -27375=>12771, -28732=>12772, -28725=>12773, -28719=>12774, -28727=>12775, -28724=>12776, -28721=>12777, -28738=>12778, -28728=>12779, -28735=>12780, -28730=>12781, -28729=>12782, -28714=>12783, -28736=>12784, -28731=>12785, -28723=>12786, -28737=>12787, -29203=>12788, -29204=>12789, -29352=>12790, -29565=>12791, -29564=>12792, -29882=>12793, -30379=>12794, -30378=>12795, -30398=>12796, -30445=>12797, -30668=>12798, -30670=>12799, -30671=>12800, -30669=>12801, -30706=>12802, -31013=>12803, -31011=>12804, -31015=>12805, -31016=>12806, -31012=>12807, -31017=>12808, -31154=>12809, -31342=>12810, -31340=>12811, -31341=>12812, -31479=>12813, -31817=>12814, -31816=>12815, -31818=>12816, -31815=>12817, -31813=>12818, -31982=>12819, -32379=>12820, -32382=>12821, -32385=>12822, -32384=>12823, -32698=>12824, -32767=>12825, -32889=>12826, -33243=>12827, -33241=>12828, -33384=>12829, -33385=>12830, -34338=>12831, -34303=>12832, -34305=>12833, -34302=>12834, -34331=>12835, -34304=>12836, -34294=>12837, -34308=>12838, -34313=>12839, -34309=>12840, -34316=>12841, -34301=>12842, -34841=>12843, -34832=>12844, -34833=>12845, -34839=>12846, -34835=>12847, -34838=>12848, -35171=>12849, -35174=>12850, -35257=>12851, -35319=>12852, -35680=>12853, -35690=>12854, -35677=>12855, -35688=>12856, -35683=>12857, -35685=>12858, -35687=>12859, -35693=>12860, -36270=>12861, -36486=>12862, -36488=>12863, -36484=>12864, -36697=>12865, -36694=>12866, -36695=>12867, -36693=>12868, -36696=>12869, -36698=>12870, -37005=>12871, -37187=>12872, -37185=>12873, -37303=>12874, -37301=>12875, -37298=>12876, -37299=>12877, -37899=>12878, -37907=>12879, -37883=>12880, -37920=>12881, -37903=>12882, -37908=>12883, -37886=>12884, -37909=>12885, -37904=>12886, -37928=>12887, -37913=>12888, -37901=>12889, -37877=>12890, -37888=>12891, -37879=>12892, -37895=>12893, -37902=>12894, -37910=>12895, -37906=>12896, -37882=>12897, -37897=>12898, -37880=>12899, -37948=>12900, -37898=>12901, -37887=>12902, -37884=>12903, -37900=>12904, -37878=>12905, -37905=>12906, -37894=>12907, -38366=>12908, -38368=>12909, -38367=>12910, -38702=>12911, -38703=>12912, -38841=>12913, -38843=>12914, -38909=>12915, -38910=>12916, -39008=>12917, -39010=>12918, -39011=>12919, -39007=>12920, -39105=>12921, -39106=>12922, -39248=>12923, -39246=>12924, -39257=>12925, -39244=>12926, -39243=>12927, -39251=>12928, -39474=>12929, -39476=>12930, -39473=>12931, -39468=>12932, -39466=>12933, -39478=>12934, -39465=>12935, -39470=>12936, -39480=>12937, -39469=>12938, -39623=>12939, -39626=>12940, -39622=>12941, -39696=>12942, -39698=>12943, -39697=>12944, -39947=>12945, -39944=>12946, -39927=>12947, -39941=>12948, -39954=>12949, -39928=>12950, -40000=>12951, -39943=>12952, -39950=>12953, -39942=>12954, -39959=>12955, -39956=>12956, -39945=>12957, -40351=>12958, -40345=>12959, -40356=>12960, -40349=>12961, -40338=>12962, -40344=>12963, -40336=>12964, -40347=>12965, -40352=>12966, -40340=>12967, -40348=>12968, -40362=>12969, -40343=>12970, -40353=>12971, -40346=>12972, -40354=>12973, -40360=>12974, -40350=>12975, -40355=>12976, -40383=>12977, -40361=>12978, -40342=>12979, -40358=>12980, -40359=>12981, -40601=>12982, -40603=>12983, -40602=>12984, -40677=>12985, -40676=>12986, -40679=>12987, -40678=>12988, -40752=>12989, -40750=>12990, -40795=>12991, -40800=>12992, -40798=>12993, -40797=>12994, -40793=>12995, -40849=>12996, -20794=>12997, -20793=>12998, -21144=>12999, -21143=>13000, -22211=>13001, -22205=>13002, -22206=>13003, -23368=>13004, -23367=>13005, -24011=>13006, -24015=>13007, -24305=>13008, -25085=>13009, -25883=>13010, -27394=>13011, -27388=>13012, -27395=>13013, -27384=>13014, -27392=>13015, -28739=>13016, -28740=>13017, -28746=>13018, -28744=>13019, -28745=>13020, -28741=>13021, -28742=>13022, -29213=>13023, -29210=>13024, -29209=>13025, -29566=>13026, -29975=>13027, -30314=>13028, -30672=>13029, -31021=>13030, -31025=>13031, -31023=>13032, -31828=>13033, -31827=>13034, -31986=>13035, -32394=>13036, -60229=>13037, -32391=>13037, -32392=>13038, -32395=>13039, -32390=>13040, -32397=>13041, -32589=>13042, -32699=>13043, -32816=>13044, -33245=>13045, -34328=>13046, -34346=>13047, -34342=>13048, -34335=>13049, -34339=>13050, -34332=>13051, -34329=>13052, -34343=>13053, -34350=>13054, -34337=>13055, -34336=>13056, -34345=>13057, -34334=>13058, -34341=>13059, -34857=>13060, -34845=>13061, -34843=>13062, -34848=>13063, -34852=>13064, -34844=>13065, -34859=>13066, -34890=>13067, -35181=>13068, -35177=>13069, -35182=>13070, -35179=>13071, -35322=>13072, -35705=>13073, -35704=>13074, -35653=>13075, -35706=>13076, -35707=>13077, -36112=>13078, -36116=>13079, -36271=>13080, -36494=>13081, -36492=>13082, -36702=>13083, -36699=>13084, -36701=>13085, -37190=>13086, -37188=>13087, -37189=>13088, -37305=>13089, -37951=>13090, -37947=>13091, -37942=>13092, -37929=>13093, -37949=>13094, -37936=>13095, -37945=>13096, -37930=>13097, -37943=>13098, -37932=>13099, -37952=>13100, -37937=>13101, -38373=>13102, -38372=>13103, -38371=>13104, -38709=>13105, -38714=>13106, -38847=>13107, -38881=>13108, -39012=>13109, -39113=>13110, -39110=>13111, -39104=>13112, -39256=>13113, -39254=>13114, -39481=>13115, -39485=>13116, -39494=>13117, -39492=>13118, -39490=>13119, -39489=>13120, -39482=>13121, -39487=>13122, -39629=>13123, -39701=>13124, -39703=>13125, -39704=>13126, -39702=>13127, -39738=>13128, -39762=>13129, -39979=>13130, -39965=>13131, -39964=>13132, -39980=>13133, -39971=>13134, -39976=>13135, -39977=>13136, -39972=>13137, -39969=>13138, -40375=>13139, -40374=>13140, -40380=>13141, -40385=>13142, -40391=>13143, -40394=>13144, -40399=>13145, -40382=>13146, -40389=>13147, -40387=>13148, -40379=>13149, -40373=>13150, -40398=>13151, -40377=>13152, -40378=>13153, -40364=>13154, -40392=>13155, -40369=>13156, -40365=>13157, -40396=>13158, -40371=>13159, -40397=>13160, -40370=>13161, -40570=>13162, -40604=>13163, -40683=>13164, -40686=>13165, -40685=>13166, -40731=>13167, -40728=>13168, -40730=>13169, -40753=>13170, -40782=>13171, -40805=>13172, -40804=>13173, -40850=>13174, -20153=>13175, -22214=>13176, -22213=>13177, -22219=>13178, -22897=>13179, -23371=>13180, -23372=>13181, -24021=>13182, -24017=>13183, -24306=>13184, -25889=>13185, -25888=>13186, -25894=>13187, -25890=>13188, -27403=>13189, -27400=>13190, -27401=>13191, -27661=>13192, -28757=>13193, -28758=>13194, -28759=>13195, -28754=>13196, -29214=>13197, -29215=>13198, -29353=>13199, -29567=>13200, -29912=>13201, -29909=>13202, -29913=>13203, -29911=>13204, -30317=>13205, -30381=>13206, -31029=>13207, -31156=>13208, -31344=>13209, -31345=>13210, -31831=>13211, -31836=>13212, -31833=>13213, -31835=>13214, -31834=>13215, -31988=>13216, -31985=>13217, -32401=>13218, -32591=>13219, -32647=>13220, -33246=>13221, -33387=>13222, -34356=>13223, -34357=>13224, -34355=>13225, -34348=>13226, -34354=>13227, -34358=>13228, -34860=>13229, -34856=>13230, -34854=>13231, -34858=>13232, -34853=>13233, -35185=>13234, -35263=>13235, -35262=>13236, -35323=>13237, -35710=>13238, -35716=>13239, -35714=>13240, -35718=>13241, -35717=>13242, -35711=>13243, -36117=>13244, -36501=>13245, -36500=>13246, -36506=>13247, -36498=>13248, -36496=>13249, -36502=>13250, -36503=>13251, -36704=>13252, -36706=>13253, -37191=>13254, -37964=>13255, -37968=>13256, -37962=>13257, -37963=>13258, -37967=>13259, -37959=>13260, -37957=>13261, -37960=>13262, -37961=>13263, -37958=>13264, -38719=>13265, -38883=>13266, -39018=>13267, -39017=>13268, -39115=>13269, -39252=>13270, -39259=>13271, -39502=>13272, -39507=>13273, -39508=>13274, -39500=>13275, -39503=>13276, -39496=>13277, -39498=>13278, -39497=>13279, -39506=>13280, -39504=>13281, -39632=>13282, -39705=>13283, -39723=>13284, -39739=>13285, -39766=>13286, -39765=>13287, -40006=>13288, -40008=>13289, -39999=>13290, -40004=>13291, -39993=>13292, -39987=>13293, -40001=>13294, -39996=>13295, -39991=>13296, -39988=>13297, -39986=>13298, -39997=>13299, -39990=>13300, -40411=>13301, -40402=>13302, -40414=>13303, -40410=>13304, -40395=>13305, -40400=>13306, -40412=>13307, -40401=>13308, -40415=>13309, -40425=>13310, -40409=>13311, -40408=>13312, -40406=>13313, -40437=>13314, -40405=>13315, -40413=>13316, -40630=>13317, -40688=>13318, -40757=>13319, -40755=>13320, -40754=>13321, -40770=>13322, -40811=>13323, -40853=>13324, -40866=>13325, -20797=>13326, -21145=>13327, -22760=>13328, -22759=>13329, -22898=>13330, -23373=>13331, -24024=>13332, -34863=>13333, -24399=>13334, -25089=>13335, -25091=>13336, -25092=>13337, -25897=>13338, -25893=>13339, -26006=>13340, -26347=>13341, -27409=>13342, -27410=>13343, -27407=>13344, -27594=>13345, -28763=>13346, -28762=>13347, -29218=>13348, -29570=>13349, -29569=>13350, -29571=>13351, -30320=>13352, -30676=>13353, -31847=>13354, -31846=>13355, -32405=>13356, -33388=>13357, -34362=>13358, -34368=>13359, -34361=>13360, -34364=>13361, -34353=>13362, -34363=>13363, -34366=>13364, -34864=>13365, -34866=>13366, -34862=>13367, -34867=>13368, -35190=>13369, -35188=>13370, -35187=>13371, -35326=>13372, -35724=>13373, -35726=>13374, -35723=>13375, -35720=>13376, -35909=>13377, -36121=>13378, -36504=>13379, -36708=>13380, -36707=>13381, -37308=>13382, -37986=>13383, -37973=>13384, -37981=>13385, -37975=>13386, -37982=>13387, -38852=>13388, -38853=>13389, -38912=>13390, -39510=>13391, -39513=>13392, -39710=>13393, -39711=>13394, -39712=>13395, -40018=>13396, -40024=>13397, -40016=>13398, -40010=>13399, -40013=>13400, -40011=>13401, -40021=>13402, -40025=>13403, -40012=>13404, -40014=>13405, -40443=>13406, -40439=>13407, -40431=>13408, -40419=>13409, -40427=>13410, -40440=>13411, -40420=>13412, -40438=>13413, -40417=>13414, -40430=>13415, -40422=>13416, -40434=>13417, -40432=>13418, -60370=>13418, -40418=>13419, -40428=>13420, -40436=>13421, -40435=>13422, -40424=>13423, -40429=>13424, -40642=>13425, -40656=>13426, -40690=>13427, -40691=>13428, -40710=>13429, -40732=>13430, -40760=>13431, -40759=>13432, -40758=>13433, -40771=>13434, -40783=>13435, -40817=>13436, -40816=>13437, -40814=>13438, -40815=>13439, -22227=>13440, -22221=>13441, -23374=>13442, -23661=>13443, -25901=>13444, -26349=>13445, -26350=>13446, -27411=>13447, -28767=>13448, -28769=>13449, -28765=>13450, -28768=>13451, -29219=>13452, -29915=>13453, -29925=>13454, -30677=>13455, -31032=>13456, -31159=>13457, -31158=>13458, -31850=>13459, -32407=>13460, -32649=>13461, -33389=>13462, -34371=>13463, -34872=>13464, -34871=>13465, -34869=>13466, -34891=>13467, -35732=>13468, -35733=>13469, -36510=>13470, -36511=>13471, -36512=>13472, -36509=>13473, -37310=>13474, -37309=>13475, -37314=>13476, -37995=>13477, -37992=>13478, -37993=>13479, -38629=>13480, -38726=>13481, -38723=>13482, -38727=>13483, -38855=>13484, -38885=>13485, -39518=>13486, -39637=>13487, -39769=>13488, -40035=>13489, -40039=>13490, -40038=>13491, -40034=>13492, -40030=>13493, -40032=>13494, -40450=>13495, -40446=>13496, -40455=>13497, -40451=>13498, -40454=>13499, -40453=>13500, -40448=>13501, -40449=>13502, -40457=>13503, -40447=>13504, -40445=>13505, -40452=>13506, -40608=>13507, -40734=>13508, -40774=>13509, -40820=>13510, -40821=>13511, -40822=>13512, -22228=>13513, -25902=>13514, -26040=>13515, -27416=>13516, -27417=>13517, -27415=>13518, -27418=>13519, -28770=>13520, -29222=>13521, -29354=>13522, -30680=>13523, -30681=>13524, -31033=>13525, -31849=>13526, -31851=>13527, -31990=>13528, -32410=>13529, -32408=>13530, -32411=>13531, -32409=>13532, -33248=>13533, -33249=>13534, -34374=>13535, -34375=>13536, -34376=>13537, -35193=>13538, -35194=>13539, -35196=>13540, -35195=>13541, -35327=>13542, -35736=>13543, -35737=>13544, -36517=>13545, -36516=>13546, -36515=>13547, -37998=>13548, -37997=>13549, -37999=>13550, -38001=>13551, -38003=>13552, -38729=>13553, -39026=>13554, -39263=>13555, -40040=>13556, -40046=>13557, -40045=>13558, -40459=>13559, -40461=>13560, -40464=>13561, -40463=>13562, -40466=>13563, -40465=>13564, -40609=>13565, -40693=>13566, -40713=>13567, -40775=>13568, -40824=>13569, -40827=>13570, -40826=>13571, -40825=>13572, -22302=>13573, -28774=>13574, -31855=>13575, -34876=>13576, -36274=>13577, -36518=>13578, -37315=>13579, -38004=>13580, -38008=>13581, -38006=>13582, -38005=>13583, -39520=>13584, -39726=>13585, -60830=>13585, -40052=>13586, -40051=>13587, -40049=>13588, -40053=>13589, -40468=>13590, -40467=>13591, -40694=>13592, -40714=>13593, -40868=>13594, -28776=>13595, -28773=>13596, -31991=>13597, -34410=>13598, -34878=>13599, -34877=>13600, -34879=>13601, -35742=>13602, -35996=>13603, -36521=>13604, -36553=>13605, -38731=>13606, -39027=>13607, -39028=>13608, -39116=>13609, -39265=>13610, -39339=>13611, -39524=>13612, -39526=>13613, -39527=>13614, -39716=>13615, -40469=>13616, -40471=>13617, -40776=>13618, -25095=>13619, -27422=>13620, -29223=>13621, -34380=>13622, -36520=>13623, -38018=>13624, -38016=>13625, -38017=>13626, -39529=>13627, -39528=>13628, -40473=>13629, -34379=>13630, -35743=>13631, -38019=>13632, -40057=>13633, -40631=>13634, -30325=>13635, -39531=>13636, -40058=>13637, -40477=>13638, -28777=>13639, -28778=>13640, -29225=>13641, -40612=>13642, -40830=>13643, -40777=>13644, -40856=>13645, -65049=>13646, -65075=>13743, -9588=>13744, -65076=>13745, -65103=>13746, -168=>13747, -776=>13747, -63208=>13747, -710=>13748, -65342=>13748, -63209=>13748, -12541=>13749, -63210=>13749, -12542=>13750, -63211=>13750, -12445=>13751, -63212=>13751, -12446=>13752, -63213=>13752, -12293=>13754, -63216=>13754, -12294=>13755, -63217=>13755, -12295=>13756, -63218=>13756, -12540=>13757, -63219=>13757, -65339=>13758, -63220=>13758, -65341=>13759, -63221=>13759, -10045=>13760, -63222=>13760, -12353=>13761, -63223=>13761, -12354=>13762, -63224=>13762, -12355=>13763, -63225=>13763, -12356=>13764, -63226=>13764, -12357=>13765, -63227=>13765, -12358=>13766, -63228=>13766, -12359=>13767, -63229=>13767, -12360=>13768, -63230=>13768, -12361=>13769, -63231=>13769, -12362=>13770, -63232=>13770, -12363=>13771, -63233=>13771, -12364=>13772, -63234=>13772, -12365=>13773, -63235=>13773, -12366=>13774, -63236=>13774, -12367=>13775, -63237=>13775, -12368=>13776, -63238=>13776, -12369=>13777, -63239=>13777, -12370=>13778, -63240=>13778, -12371=>13779, -63241=>13779, -12372=>13780, -63242=>13780, -12373=>13781, -63243=>13781, -12374=>13782, -63244=>13782, -12375=>13783, -63245=>13783, -12376=>13784, -63246=>13784, -12377=>13785, -63247=>13785, -12378=>13786, -63248=>13786, -12379=>13787, -63249=>13787, -12380=>13788, -63250=>13788, -12381=>13789, -63251=>13789, -12382=>13790, -63252=>13790, -12383=>13791, -63253=>13791, -12384=>13792, -63254=>13792, -12385=>13793, -63255=>13793, -12386=>13794, -63256=>13794, -12387=>13795, -63257=>13795, -12388=>13796, -63258=>13796, -12389=>13797, -63259=>13797, -12390=>13798, -63260=>13798, -12391=>13799, -63261=>13799, -12392=>13800, -63262=>13800, -12393=>13801, -63263=>13801, -12394=>13802, -63264=>13802, -12395=>13803, -63265=>13803, -12396=>13804, -63266=>13804, -12397=>13805, -63267=>13805, -12398=>13806, -63268=>13806, -12399=>13807, -63269=>13807, -12400=>13808, -63270=>13808, -12401=>13809, -63271=>13809, -12402=>13810, -63272=>13810, -12403=>13811, -63273=>13811, -12404=>13812, -63274=>13812, -12405=>13813, -63275=>13813, -12406=>13814, -63276=>13814, -12407=>13815, -63277=>13815, -12408=>13816, -63278=>13816, -12409=>13817, -63279=>13817, -12410=>13818, -63280=>13818, -12411=>13819, -63281=>13819, -12412=>13820, -63282=>13820, -12413=>13821, -63283=>13821, -12414=>13822, -63284=>13822, -12415=>13823, -63285=>13823, -12416=>13824, -63286=>13824, -12417=>13825, -63287=>13825, -12418=>13826, -63288=>13826, -12419=>13827, -63289=>13827, -12420=>13828, -63290=>13828, -12421=>13829, -63291=>13829, -12422=>13830, -63292=>13830, -12423=>13831, -63293=>13831, -12424=>13832, -63294=>13832, -12425=>13833, -63295=>13833, -12426=>13834, -63296=>13834, -12427=>13835, -63297=>13835, -12428=>13836, -63298=>13836, -12429=>13837, -63299=>13837, -12430=>13838, -63300=>13838, -12431=>13839, -63301=>13839, -12432=>13840, -63302=>13840, -12433=>13841, -63303=>13841, -12434=>13842, -63304=>13842, -12435=>13843, -63305=>13843, -12449=>13844, -63306=>13844, -12450=>13845, -63307=>13845, -12451=>13846, -63308=>13846, -12452=>13847, -63309=>13847, -12453=>13848, -63310=>13848, -12454=>13849, -63311=>13849, -12455=>13850, -63312=>13850, -12456=>13851, -63313=>13851, -12457=>13852, -63314=>13852, -12458=>13853, -63315=>13853, -12459=>13854, -63316=>13854, -12460=>13855, -63317=>13855, -12461=>13856, -63318=>13856, -12462=>13857, -63319=>13857, -12463=>13858, -63320=>13858, -12464=>13859, -63321=>13859, -12465=>13860, -63322=>13860, -12466=>13861, -63323=>13861, -12467=>13862, -63324=>13862, -12468=>13863, -63325=>13863, -12469=>13864, -63326=>13864, -12470=>13865, -63327=>13865, -12471=>13866, -63328=>13866, -12472=>13867, -63329=>13867, -12473=>13868, -63330=>13868, -12474=>13869, -63331=>13869, -12475=>13870, -63332=>13870, -12476=>13871, -63333=>13871, -12477=>13872, -63334=>13872, -12478=>13873, -63335=>13873, -12479=>13874, -63336=>13874, -12480=>13875, -63337=>13875, -12481=>13876, -63338=>13876, -12482=>13877, -63339=>13877, -12483=>13878, -63340=>13878, -12484=>13879, -63341=>13879, -12485=>13880, -63342=>13880, -12486=>13881, -63343=>13881, -12487=>13882, -63344=>13882, -12488=>13883, -63345=>13883, -12489=>13884, -63346=>13884, -12490=>13885, -63347=>13885, -12491=>13886, -63348=>13886, -12492=>13887, -63349=>13887, -12493=>13888, -63350=>13888, -12494=>13889, -63351=>13889, -12495=>13890, -63352=>13890, -12496=>13891, -63353=>13891, -12497=>13892, -63354=>13892, -12498=>13893, -63355=>13893, -12499=>13894, -63356=>13894, -12500=>13895, -63357=>13895, -12501=>13896, -63358=>13896, -12502=>13897, -63359=>13897, -12503=>13898, -63360=>13898, -12504=>13899, -63361=>13899, -12505=>13900, -63362=>13900, -12506=>13901, -63363=>13901, -12507=>13902, -63364=>13902, -12508=>13903, -63365=>13903, -12509=>13904, -63366=>13904, -12510=>13905, -63367=>13905, -12511=>13906, -63368=>13906, -12512=>13907, -63369=>13907, -12513=>13908, -63370=>13908, -12514=>13909, -63371=>13909, -12515=>13910, -63372=>13910, -12516=>13911, -63373=>13911, -12517=>13912, -63374=>13912, -12518=>13913, -63375=>13913, -12519=>13914, -63376=>13914, -12520=>13915, -63377=>13915, -12521=>13916, -63378=>13916, -12522=>13917, -63379=>13917, -12523=>13918, -63380=>13918, -12524=>13919, -63381=>13919, -12525=>13920, -63382=>13920, -12526=>13921, -63383=>13921, -12527=>13922, -63384=>13922, -12528=>13923, -63385=>13923, -12529=>13924, -63386=>13924, -12530=>13925, -63387=>13925, -12531=>13926, -63388=>13926, -12532=>13927, -63389=>13927, -12533=>13928, -63390=>13928, -12534=>13929, -63391=>13929, -1040=>13930, -63392=>13930, -1041=>13931, -63393=>13931, -1042=>13932, -63394=>13932, -1043=>13933, -63395=>13933, -1044=>13934, -63396=>13934, -1045=>13935, -63397=>13935, -1025=>13936, -63398=>13936, -1046=>13937, -63399=>13937, -1047=>13938, -63400=>13938, -1048=>13939, -63401=>13939, -1049=>13940, -63402=>13940, -1050=>13941, -63403=>13941, -1051=>13942, -63404=>13942, -1052=>13943, -63405=>13943, -1053=>13944, -63406=>13944, -1054=>13945, -63407=>13945, -1055=>13946, -63408=>13946, -1056=>13947, -63409=>13947, -1057=>13948, -63410=>13948, -1058=>13949, -63411=>13949, -1059=>13950, -63412=>13950, -1060=>13951, -63413=>13951, -1061=>13952, -63414=>13952, -1062=>13953, -63415=>13953, -1063=>13954, -63416=>13954, -1064=>13955, -63417=>13955, -1065=>13956, -63418=>13956, -1066=>13957, -63419=>13957, -1067=>13958, -63420=>13958, -1068=>13959, -63421=>13959, -1069=>13960, -63422=>13960, -1070=>13961, -63423=>13961, -1071=>13962, -63424=>13962, -1072=>13963, -63425=>13963, -1073=>13964, -63426=>13964, -1074=>13965, -63427=>13965, -1075=>13966, -63428=>13966, -1076=>13967, -63429=>13967, -1077=>13968, -63430=>13968, -1105=>13969, -63431=>13969, -1078=>13970, -63432=>13970, -1079=>13971, -63433=>13971, -1080=>13972, -63434=>13972, -1081=>13973, -63435=>13973, -1082=>13974, -63436=>13974, -1083=>13975, -63437=>13975, -1084=>13976, -63438=>13976, -1085=>13977, -63439=>13977, -1086=>13978, -63440=>13978, -1087=>13979, -63441=>13979, -1088=>13980, -63442=>13980, -1089=>13981, -63443=>13981, -1090=>13982, -63444=>13982, -1091=>13983, -63445=>13983, -1092=>13984, -63446=>13984, -1093=>13985, -63447=>13985, -1094=>13986, -63448=>13986, -1095=>13987, -63449=>13987, -1096=>13988, -63450=>13988, -1097=>13989, -63451=>13989, -1098=>13990, -63452=>13990, -1099=>13991, -63453=>13991, -1100=>13992, -63454=>13992, -1101=>13993, -63455=>13993, -1102=>13994, -63456=>13994, -1103=>13995, -63457=>13995, -8679=>13996, -63458=>13996, -8632=>13997, -63459=>13997, -8633=>13998, -63460=>13998, -12751=>13999, -20033=>13999, -63461=>13999, -131276=>14000, -63462=>14000, -20058=>14001, -63463=>14001, -131210=>14002, -63464=>14002, -20994=>14003, -63465=>14003, -17553=>14004, -63466=>14004, -40880=>14005, -63467=>14005, -20872=>14006, -63468=>14006, -13853=>14007, -40881=>14007, -63469=>14007, -161287=>14008, -63470=>14008, -172=>14049, -65506=>14049, -63511=>14049, -65508=>14050, -63512=>14050, -65287=>14051, -63513=>14051, -65282=>14052, -63514=>14052, -12849=>14053, -63515=>14053, -8470=>14054, -63516=>14054, -8481=>14055, -63517=>14055, -30849=>14056, -37561=>14057, -58501=>14057, -35023=>14058, -22715=>14059, -24658=>14060, -31911=>14061, -23290=>14062, -9556=>14063, -9574=>14064, -9559=>14065, -9568=>14066, -9580=>14067, -9571=>14068, -9562=>14069, -9577=>14070, -9565=>14071, -9554=>14072, -9572=>14073, -9557=>14074, -9560=>14078, -9575=>14079, -9563=>14080, -9555=>14081, -9573=>14082, -9558=>14083, -9567=>14084, -9579=>14085, -9570=>14086, -9561=>14087, -9576=>14088, -9564=>14089, -9553=>14090, -9619=>14096, -65517=>14096, -65040=>14099, -65041=>14100, -65042=>14101, -65044=>14103, -65043=>14104, -65046=>14105, -65045=>14106, -147159=>14123, -58129=>14123, -22462=>14124, -58130=>14124, -159443=>14125, -58131=>14125, -28990=>14126, -58132=>14126, -153568=>14127, -58133=>14127, -27042=>14128, -58135=>14128, -166889=>14129, -58136=>14129, -23412=>14130, -58137=>14130, -31305=>14131, -58138=>14131, -153825=>14132, -58139=>14132, -169177=>14133, -58140=>14133, -31333=>14134, -58141=>14134, -31357=>14135, -58142=>14135, -154028=>14136, -58143=>14136, -31419=>14137, -58144=>14137, -31408=>14138, -58145=>14138, -31426=>14139, -58146=>14139, -31427=>14140, -58147=>14140, -29137=>14141, -58148=>14141, -156813=>14142, -58149=>14142, -16842=>14143, -58150=>14143, -31450=>14144, -58151=>14144, -31453=>14145, -58152=>14145, -31466=>14146, -58153=>14146, -16879=>14147, -58154=>14147, -21682=>14148, -58155=>14148, -154625=>14149, -58156=>14149, -31499=>14150, -58157=>14150, -31573=>14151, -58158=>14151, -31529=>14152, -58159=>14152, -152334=>14153, -58160=>14153, -154878=>14154, -58161=>14154, -31650=>14155, -58162=>14155, -31599=>14156, -58163=>14156, -33692=>14157, -58164=>14157, -154548=>14158, -58165=>14158, -158847=>14159, -58166=>14159, -31696=>14160, -58167=>14160, -33825=>14161, -58168=>14161, -31634=>14162, -58169=>14162, -58171=>14164, -154912=>14164, -33938=>14166, -58174=>14166, -31738=>14167, -58175=>14167, -31797=>14169, -58177=>14169, -154817=>14170, -58178=>14170, -31812=>14171, -58179=>14171, -31875=>14172, -58180=>14172, -149634=>14173, -58181=>14173, -31910=>14174, -58182=>14174, -148856=>14175, -58184=>14175, -31945=>14176, -58185=>14176, -31943=>14177, -58186=>14177, -31974=>14178, -58187=>14178, -31987=>14180, -58189=>14180, -31989=>14181, -58190=>14181, -32359=>14182, -58192=>14182, -17693=>14183, -58193=>14183, -159300=>14184, -58194=>14184, -32093=>14185, -58195=>14185, -159446=>14186, -58196=>14186, -32137=>14187, -58198=>14187, -32171=>14188, -58199=>14188, -28981=>14189, -58200=>14189, -32179=>14190, -58201=>14190, -32214=>14191, -147543=>14192, -58203=>14192, -155689=>14193, -58204=>14193, -32228=>14194, -58205=>14194, -15635=>14195, -58206=>14195, -32245=>14196, -58207=>14196, -137209=>14197, -58208=>14197, -32229=>14198, -58209=>14198, -164717=>14199, -58210=>14199, -155937=>14201, -58212=>14201, -155994=>14202, -58213=>14202, -32366=>14203, -58214=>14203, -17195=>14205, -58216=>14205, -37996=>14206, -58217=>14206, -32295=>14207, -58218=>14207, -32576=>14208, -58219=>14208, -32577=>14209, -58220=>14209, -32583=>14210, -58221=>14210, -31030=>14211, -58222=>14211, -156368=>14212, -58223=>14212, -39393=>14213, -58224=>14213, -32663=>14214, -58225=>14214, -156497=>14215, -58226=>14215, -32675=>14216, -58227=>14216, -136801=>14217, -58228=>14217, -131176=>14218, -58229=>14218, -17756=>14219, -58230=>14219, -145254=>14220, -58231=>14220, -164666=>14221, -58233=>14221, -32762=>14222, -58234=>14222, -156809=>14223, -58235=>14223, -64091=>14224, -32776=>14225, -58237=>14225, -32797=>14226, -58238=>14226, -32815=>14228, -58240=>14228, -172167=>14229, -58241=>14229, -158915=>14230, -58242=>14230, -32827=>14231, -58243=>14231, -32828=>14232, -58244=>14232, -32865=>14233, -58245=>14233, -141076=>14234, -58246=>14234, -18825=>14235, -58247=>14235, -157222=>14236, -58248=>14236, -146915=>14237, -58249=>14237, -157416=>14238, -58250=>14238, -26405=>14239, -58251=>14239, -32935=>14240, -58252=>14240, -166472=>14241, -58253=>14241, -33031=>14242, -58254=>14242, -33050=>14243, -58255=>14243, -22704=>14244, -58256=>14244, -141046=>14245, -58257=>14245, -27775=>14246, -58258=>14246, -156824=>14247, -58259=>14247, -25831=>14248, -58261=>14248, -136330=>14249, -58262=>14249, -33304=>14250, -58263=>14250, -137310=>14251, -58264=>14251, -27219=>14252, -58265=>14252, -150117=>14253, -58266=>14253, -150165=>14254, -58267=>14254, -17530=>14255, -58268=>14255, -33321=>14256, -58269=>14256, -158290=>14257, -58271=>14257, -146814=>14258, -58272=>14258, -20473=>14259, -58273=>14259, -136445=>14260, -58274=>14260, -34018=>14261, -58275=>14261, -33634=>14262, -58276=>14262, -194959=>14263, -149927=>14264, -58278=>14264, -144688=>14265, -58279=>14265, -137075=>14266, -58280=>14266, -146936=>14267, -58281=>14267, -33450=>14268, -58282=>14268, -26907=>14269, -58283=>14269, -194964=>14270, -58284=>14270, -16859=>14271, -58285=>14271, -34123=>14272, -58286=>14272, -33488=>14273, -58287=>14273, -33562=>14274, -58288=>14274, -134678=>14275, -58289=>14275, -137140=>14276, -58290=>14276, -14017=>14277, -58291=>14277, -143741=>14278, -58292=>14278, -144730=>14279, -58293=>14279, -33403=>14280, -58294=>14280, -33506=>14281, -58295=>14281, -33560=>14282, -58296=>14282, -147083=>14283, -58297=>14283, -159139=>14284, -58298=>14284, -158469=>14285, -58299=>14285, -158615=>14286, -58300=>14286, -144846=>14287, -58301=>14287, -15807=>14288, -58302=>14288, -33565=>14289, -58303=>14289, -21996=>14290, -58304=>14290, -33669=>14291, -58305=>14291, -17675=>14292, -58306=>14292, -159141=>14293, -58307=>14293, -33708=>14294, -58308=>14294, -33747=>14296, -58310=>14296, -159444=>14297, -58312=>14297, -27223=>14298, -58313=>14298, -34138=>14299, -58314=>14299, -13462=>14300, -58315=>14300, -159298=>14301, -58316=>14301, -33880=>14302, -58318=>14302, -154596=>14303, -58319=>14303, -33905=>14304, -58320=>14304, -15827=>14305, -58321=>14305, -17636=>14306, -58322=>14306, -27303=>14307, -58323=>14307, -33866=>14308, -58324=>14308, -31064=>14309, -58326=>14309, -158614=>14311, -58328=>14311, -159351=>14312, -58329=>14312, -159299=>14313, -58330=>14313, -34014=>14314, -58331=>14314, -33681=>14316, -58333=>14316, -17568=>14317, -58334=>14317, -33939=>14318, -58335=>14318, -34020=>14319, -58336=>14319, -154769=>14320, -58337=>14320, -16960=>14321, -58338=>14321, -154816=>14322, -58339=>14322, -17731=>14323, -58340=>14323, -34100=>14324, -58341=>14324, -23282=>14325, -58342=>14325, -17699=>14326, -17703=>14327, -58344=>14327, -34163=>14328, -58345=>14328, -17686=>14329, -58346=>14329, -26559=>14330, -58347=>14330, -34326=>14331, -58348=>14331, -165413=>14332, -58349=>14332, -165435=>14333, -58350=>14333, -34241=>14334, -58351=>14334, -159880=>14335, -58352=>14335, -34306=>14336, -58353=>14336, -136578=>14337, -58354=>14337, -159949=>14338, -58355=>14338, -194994=>14339, -58356=>14339, -17770=>14340, -58357=>14340, -34344=>14341, -58358=>14341, -13896=>14342, -58359=>14342, -137378=>14343, -58360=>14343, -21495=>14344, -58361=>14344, -160666=>14345, -58362=>14345, -34430=>14346, -58363=>14346, -172280=>14348, -58365=>14348, -34798=>14349, -58366=>14349, -142375=>14350, -58367=>14350, -34737=>14351, -58368=>14351, -34778=>14352, -58369=>14352, -34831=>14353, -60990=>14353, -58370=>14353, -22113=>14354, -58371=>14354, -34412=>14355, -58372=>14355, -26710=>14356, -58373=>14356, -17935=>14357, -58374=>14357, -34885=>14358, -58375=>14358, -34886=>14359, -58376=>14359, -161248=>14360, -58377=>14360, -146873=>14361, -58378=>14361, -161252=>14362, -58379=>14362, -34910=>14363, -58380=>14363, -34972=>14364, -58381=>14364, -18011=>14365, -58382=>14365, -34996=>14366, -58383=>14366, -34997=>14367, -58384=>14367, -35013=>14368, -58386=>14368, -161551=>14369, -58388=>14369, -35207=>14370, -58389=>14370, -35239=>14374, -58393=>14374, -35260=>14375, -58394=>14375, -166437=>14376, -58395=>14376, -35303=>14377, -58396=>14377, -162084=>14378, -58397=>14378, -162493=>14379, -58398=>14379, -35484=>14380, -58399=>14380, -30611=>14381, -58400=>14381, -37374=>14382, -58401=>14382, -35472=>14383, -58402=>14383, -162393=>14384, -58403=>14384, -31465=>14385, -58404=>14385, -162618=>14386, -58405=>14386, -18195=>14387, -58407=>14387, -162616=>14388, -58408=>14388, -29052=>14389, -58409=>14389, -35596=>14390, -58410=>14390, -35615=>14391, -58411=>14391, -152624=>14392, -58412=>14392, -152933=>14393, -58413=>14393, -35647=>14394, -58414=>14394, -35661=>14396, -58416=>14396, -35497=>14397, -58417=>14397, -150138=>14398, -58418=>14398, -35728=>14399, -58419=>14399, -35739=>14400, -58420=>14400, -35503=>14401, -58421=>14401, -136927=>14402, -58422=>14402, -17941=>14403, -58423=>14403, -34895=>14404, -58424=>14404, -35995=>14405, -58425=>14405, -163156=>14406, -58426=>14406, -163215=>14407, -58427=>14407, -195028=>14408, -58428=>14408, -14117=>14409, -58429=>14409, -163155=>14410, -58430=>14410, -36054=>14411, -58431=>14411, -163224=>14412, -58432=>14412, -163261=>14413, -58433=>14413, -36114=>14414, -58434=>14414, -36099=>14415, -58435=>14415, -137488=>14416, -58436=>14416, -36059=>14417, -58437=>14417, -28764=>14418, -58438=>14418, -36113=>14419, -58439=>14419, -16080=>14420, -58441=>14420, -195031=>14421, -36265=>14422, -58443=>14422, -163842=>14423, -58444=>14423, -135188=>14424, -58445=>14424, -149898=>14425, -58446=>14425, -15228=>14426, -58447=>14426, -164284=>14427, -58448=>14427, -160012=>14428, -58449=>14428, -31463=>14429, -58450=>14429, -36525=>14430, -58451=>14430, -36534=>14431, -58452=>14431, -36547=>14432, -58453=>14432, -37588=>14433, -58454=>14433, -36633=>14434, -58455=>14434, -36653=>14435, -58456=>14435, -164709=>14436, -58457=>14436, -164882=>14437, -58458=>14437, -36773=>14438, -58459=>14438, -37635=>14439, -58460=>14439, -172703=>14440, -58461=>14440, -133712=>14441, -58462=>14441, -36787=>14442, -58463=>14442, -166366=>14444, -58465=>14444, -165181=>14445, -58466=>14445, -146875=>14446, -58467=>14446, -24312=>14447, -58468=>14447, -143970=>14448, -58469=>14448, -36857=>14449, -58470=>14449, -140069=>14451, -58474=>14451, -14720=>14452, -58475=>14452, -159447=>14453, -58476=>14453, -36919=>14454, -58477=>14454, -165180=>14455, -58478=>14455, -162494=>14456, -58479=>14456, -36961=>14457, -58480=>14457, -165228=>14458, -58481=>14458, -165387=>14459, -58482=>14459, -37032=>14460, -58483=>14460, -165651=>14461, -58484=>14461, -37060=>14462, -58485=>14462, -165606=>14463, -58486=>14463, -37038=>14464, -58487=>14464, -64038=>14465, -37223=>14466, -58489=>14466, -37289=>14467, -58491=>14467, -37316=>14468, -58492=>14468, -31916=>14469, -58493=>14469, -166195=>14470, -58494=>14470, -138889=>14471, -58495=>14471, -37390=>14472, -58496=>14472, -27807=>14473, -58497=>14473, -37441=>14474, -58498=>14474, -37474=>14475, -58499=>14475, -153017=>14476, -58500=>14476, -166598=>14477, -58502=>14477, -146587=>14478, -58503=>14478, -166668=>14479, -58504=>14479, -153051=>14480, -58505=>14480, -134449=>14481, -58506=>14481, -37676=>14482, -58507=>14482, -37739=>14483, -58508=>14483, -166625=>14484, -58509=>14484, -166891=>14485, -58510=>14485, -23235=>14486, -58512=>14486, -166626=>14487, -58513=>14487, -166629=>14488, -58514=>14488, -18789=>14489, -58515=>14489, -37444=>14490, -58516=>14490, -166892=>14491, -58517=>14491, -166969=>14492, -58518=>14492, -166911=>14493, -58519=>14493, -37747=>14494, -58520=>14494, -37979=>14495, -58521=>14495, -36540=>14496, -58522=>14496, -38277=>14497, -58523=>14497, -38310=>14498, -58524=>14498, -37926=>14499, -58525=>14499, -38304=>14500, -58526=>14500, -28662=>14501, -58527=>14501, -17081=>14502, -58528=>14502, -165592=>14503, -58530=>14503, -135804=>14504, -58531=>14504, -146990=>14505, -58532=>14505, -18911=>14506, -58533=>14506, -27676=>14507, -58534=>14507, -38523=>14508, -58535=>14508, -38550=>14509, -58536=>14509, -16748=>14510, -58537=>14510, -38563=>14511, -58538=>14511, -159445=>14512, -58539=>14512, -25050=>14513, -58540=>14513, -58541=>14514, -30965=>14515, -58542=>14515, -166624=>14516, -58543=>14516, -38589=>14517, -58544=>14517, -21452=>14518, -58545=>14518, -18849=>14519, -58546=>14519, -158904=>14520, -58547=>14520, -131700=>14521, -58548=>14521, -156688=>14522, -58549=>14522, -168111=>14523, -58550=>14523, -168165=>14524, -58551=>14524, -150225=>14525, -58552=>14525, -137493=>14526, -58553=>14526, -144138=>14527, -58554=>14527, -38705=>14528, -58555=>14528, -34370=>14529, -58556=>14529, -38710=>14530, -58557=>14530, -18959=>14531, -58558=>14531, -17725=>14532, -58559=>14532, -17797=>14533, -58560=>14533, -150249=>14534, -58561=>14534, -28789=>14535, -58562=>14535, -23361=>14536, -58563=>14536, -38683=>14537, -58564=>14537, -168405=>14539, -58566=>14539, -38743=>14540, -58567=>14540, -23370=>14541, -58568=>14541, -168427=>14542, -58569=>14542, -38751=>14543, -58570=>14543, -37925=>14544, -58571=>14544, -20688=>14545, -58572=>14545, -143543=>14546, -58573=>14546, -143548=>14547, -58574=>14547, -38793=>14548, -58575=>14548, -38815=>14549, -58576=>14549, -38833=>14550, -58577=>14550, -38846=>14551, -58578=>14551, -38848=>14552, -58579=>14552, -38866=>14553, -58580=>14553, -38880=>14554, -58581=>14554, -152684=>14555, -58582=>14555, -38894=>14556, -58583=>14556, -29724=>14557, -58584=>14557, -169011=>14558, -58585=>14558, -38901=>14560, -58587=>14560, -168989=>14561, -58588=>14561, -162170=>14562, -58589=>14562, -19153=>14563, -58590=>14563, -38964=>14564, -58591=>14564, -38963=>14565, -58592=>14565, -38987=>14566, -58593=>14566, -39014=>14567, -58594=>14567, -15118=>14568, -58595=>14568, -160117=>14569, -58596=>14569, -15697=>14570, -58597=>14570, -132656=>14571, -58598=>14571, -147804=>14572, -58599=>14572, -153350=>14573, -58600=>14573, -39114=>14574, -58601=>14574, -39095=>14575, -58602=>14575, -39112=>14576, -58603=>14576, -39111=>14577, -58604=>14577, -19199=>14578, -58605=>14578, -159015=>14579, -58606=>14579, -136915=>14580, -58607=>14580, -21936=>14581, -58608=>14581, -39137=>14582, -58609=>14582, -39142=>14583, -58610=>14583, -39148=>14584, -58611=>14584, -37752=>14585, -58612=>14585, -39225=>14586, -58613=>14586, -150057=>14587, -58614=>14587, -19314=>14588, -58615=>14588, -170071=>14589, -58616=>14589, -170245=>14590, -58617=>14590, -39413=>14591, -58618=>14591, -39436=>14592, -58619=>14592, -39483=>14593, -58620=>14593, -39440=>14594, -58621=>14594, -39512=>14595, -58622=>14595, -153381=>14596, -58623=>14596, -14020=>14597, -58624=>14597, -168113=>14598, -58625=>14598, -170965=>14599, -58626=>14599, -39648=>14600, -58627=>14600, -39650=>14601, -58628=>14601, -170757=>14602, -58629=>14602, -39668=>14603, -58630=>14603, -19470=>14604, -58631=>14604, -39700=>14605, -58632=>14605, -39725=>14606, -58633=>14606, -165376=>14607, -58634=>14607, -20532=>14608, -58635=>14608, -39732=>14609, -58636=>14609, -14531=>14610, -58638=>14610, -143485=>14611, -58639=>14611, -39760=>14612, -58640=>14612, -39744=>14613, -58641=>14613, -171326=>14614, -58642=>14614, -23109=>14615, -58643=>14615, -137315=>14616, -58644=>14616, -39822=>14617, -58645=>14617, -39938=>14618, -58647=>14618, -39935=>14619, -58648=>14619, -39948=>14620, -58649=>14620, -171624=>14621, -58650=>14621, -40404=>14622, -58651=>14622, -171959=>14623, -58652=>14623, -172434=>14624, -58653=>14624, -172459=>14625, -58654=>14625, -172257=>14626, -58655=>14626, -172323=>14627, -58656=>14627, -172511=>14628, -58657=>14628, -40318=>14629, -58658=>14629, -40323=>14630, -58659=>14630, -172340=>14631, -58660=>14631, -40462=>14632, -58661=>14632, -40388=>14633, -58663=>14633, -172435=>14634, -58665=>14634, -172576=>14635, -58666=>14635, -137531=>14636, -58667=>14636, -172595=>14637, -58668=>14637, -40249=>14638, -58669=>14638, -172217=>14639, -58670=>14639, -172724=>14640, -58671=>14640, -40592=>14641, -58672=>14641, -40597=>14642, -58673=>14642, -40606=>14643, -58674=>14643, -40610=>14644, -58675=>14644, -19764=>14645, -58676=>14645, -40618=>14646, -58677=>14646, -40623=>14647, -58678=>14647, -148324=>14648, -58679=>14648, -40641=>14649, -58680=>14649, -15200=>14650, -58681=>14650, -14821=>14651, -58682=>14651, -15645=>14652, -58683=>14652, -20274=>14653, -58684=>14653, -14270=>14654, -58685=>14654, -166955=>14655, -58686=>14655, -40706=>14656, -58687=>14656, -40712=>14657, -58688=>14657, -19350=>14658, -58689=>14658, -37924=>14659, -58690=>14659, -159138=>14660, -58691=>14660, -40727=>14661, -60836=>14661, -58692=>14661, -195099=>14662, -40761=>14663, -58694=>14663, -22175=>14664, -58695=>14664, -22154=>14665, -58696=>14665, -40773=>14666, -58697=>14666, -39352=>14667, -58698=>14667, -168075=>14668, -58699=>14668, -38898=>14669, -58700=>14669, -33919=>14670, -58701=>14670, -40809=>14672, -58703=>14672, -31452=>14673, -58704=>14673, -40846=>14674, -58705=>14674, -29206=>14675, -58706=>14675, -19390=>14676, -58707=>14676, -149877=>14677, -58708=>14677, -149947=>14678, -58709=>14678, -29047=>14679, -58710=>14679, -150008=>14680, -58711=>14680, -148296=>14681, -58712=>14681, -150097=>14682, -58713=>14682, -29598=>14683, -58714=>14683, -166874=>14684, -58715=>14684, -137466=>14685, -58716=>14685, -31135=>14686, -58717=>14686, -166270=>14687, -58718=>14687, -167478=>14688, -58719=>14688, -37737=>14689, -58720=>14689, -37875=>14690, -58721=>14690, -166468=>14691, -58722=>14691, -37612=>14692, -58723=>14692, -37761=>14693, -58724=>14693, -37835=>14694, -58725=>14694, -166252=>14695, -58726=>14695, -148665=>14696, -58727=>14696, -29207=>14697, -58728=>14697, -16107=>14698, -58729=>14698, -30578=>14699, -58730=>14699, -31299=>14700, -58731=>14700, -28880=>14701, -58732=>14701, -148595=>14702, -58733=>14702, -148472=>14703, -58734=>14703, -29054=>14704, -58735=>14704, -137199=>14705, -58736=>14705, -28835=>14706, -58737=>14706, -137406=>14707, -58738=>14707, -144793=>14708, -58739=>14708, -16071=>14709, -58740=>14709, -137349=>14710, -58741=>14710, -152623=>14711, -58742=>14711, -137208=>14712, -58743=>14712, -14114=>14713, -58744=>14713, -136955=>14714, -58745=>14714, -137273=>14715, -58746=>14715, -14049=>14716, -58747=>14716, -137076=>14717, -58748=>14717, -137425=>14718, -58749=>14718, -155467=>14719, -58750=>14719, -14115=>14720, -58751=>14720, -136896=>14721, -58752=>14721, -22363=>14722, -58753=>14722, -150053=>14723, -58754=>14723, -136190=>14724, -58755=>14724, -135848=>14725, -58756=>14725, -136134=>14726, -58757=>14726, -136374=>14727, -58758=>14727, -34051=>14728, -58761=>14728, -58759=>14728, -145062=>14729, -58760=>14729, -33877=>14731, -58762=>14731, -149908=>14732, -58763=>14732, -160101=>14733, -58764=>14733, -146993=>14734, -58765=>14734, -152924=>14735, -58766=>14735, -147195=>14736, -58767=>14736, -159826=>14737, -58768=>14737, -17652=>14738, -58769=>14738, -145134=>14739, -58770=>14739, -170397=>14740, -58771=>14740, -159526=>14741, -58772=>14741, -26617=>14742, -58773=>14742, -14131=>14743, -58774=>14743, -15381=>14744, -58775=>14744, -15847=>14745, -58776=>14745, -22636=>14746, -58777=>14746, -137506=>14747, -58778=>14747, -26640=>14748, -58779=>14748, -16471=>14749, -58780=>14749, -145215=>14750, -58781=>14750, -147681=>14751, -58782=>14751, -147595=>14752, -58783=>14752, -147727=>14753, -58784=>14753, -158753=>14754, -58785=>14754, -21707=>14755, -58786=>14755, -22174=>14756, -58787=>14756, -157361=>14757, -58788=>14757, -22162=>14758, -58789=>14758, -135135=>14759, -58790=>14759, -134056=>14760, -58791=>14760, -134669=>14761, -58792=>14761, -166675=>14763, -58794=>14763, -37788=>14764, -58795=>14764, -20216=>14765, -58796=>14765, -20779=>14766, -58797=>14766, -14361=>14767, -58798=>14767, -148534=>14768, -58799=>14768, -20156=>14769, -58800=>14769, -132197=>14770, -58801=>14770, -20299=>14772, -58803=>14772, -20362=>14773, -58804=>14773, -153169=>14774, -58805=>14774, -23144=>14775, -58806=>14775, -131499=>14776, -58807=>14776, -132043=>14777, -58808=>14777, -14745=>14778, -58809=>14778, -131850=>14779, -58810=>14779, -132116=>14780, -58811=>14780, -13365=>14781, -58812=>14781, -20265=>14782, -58813=>14782, -131776=>14783, -58814=>14783, -167603=>14784, -58815=>14784, -131701=>14785, -58816=>14785, -35546=>14786, -58817=>14786, -131596=>14787, -58818=>14787, -20120=>14788, -58819=>14788, -20685=>14789, -58820=>14789, -20749=>14790, -58821=>14790, -20386=>14791, -58822=>14791, -20227=>14792, -58823=>14792, -150030=>14793, -58824=>14793, -147082=>14794, -58825=>14794, -20290=>14795, -58826=>14795, -20526=>14796, -58827=>14796, -20588=>14797, -58828=>14797, -20609=>14798, -58829=>14798, -20428=>14799, -58830=>14799, -20453=>14800, -58831=>14800, -20568=>14801, -58832=>14801, -20732=>14802, -58833=>14802, -28278=>14803, -58838=>14803, -144789=>14804, -58839=>14804, -147001=>14805, -58840=>14805, -147135=>14806, -58841=>14806, -28018=>14807, -58842=>14807, -137348=>14808, -58843=>14808, -147081=>14809, -58844=>14809, -20904=>14810, -58845=>14810, -20931=>14811, -58846=>14811, -132576=>14812, -58847=>14812, -17629=>14813, -58848=>14813, -132259=>14814, -58849=>14814, -132242=>14815, -58850=>14815, -132241=>14816, -58851=>14816, -36218=>14817, -58852=>14817, -166556=>14818, -58853=>14818, -132878=>14819, -58854=>14819, -21081=>14820, -58855=>14820, -21156=>14821, -58856=>14821, -133235=>14822, -58857=>14822, -21217=>14823, -58858=>14823, -18042=>14825, -58860=>14825, -29068=>14826, -58861=>14826, -148364=>14827, -58862=>14827, -134176=>14828, -58863=>14828, -149932=>14829, -58864=>14829, -135396=>14830, -58865=>14830, -27089=>14831, -58866=>14831, -134685=>14832, -58867=>14832, -16094=>14834, -58869=>14834, -29849=>14835, -58870=>14835, -29716=>14836, -58871=>14836, -29782=>14837, -58872=>14837, -29592=>14838, -58873=>14838, -19342=>14839, -58874=>14839, -150204=>14840, -58875=>14840, -147597=>14841, -58876=>14841, -21456=>14842, -58877=>14842, -13700=>14843, -58878=>14843, -29199=>14844, -58879=>14844, -147657=>14845, -58880=>14845, -21940=>14846, -58881=>14846, -131909=>14847, -58882=>14847, -21709=>14848, -58883=>14848, -134086=>14849, -58884=>14849, -22301=>14850, -58885=>14850, -37469=>14851, -58886=>14851, -38644=>14852, -58887=>14852, -22493=>14853, -58889=>14853, -22413=>14854, -58890=>14854, -22399=>14855, -58891=>14855, -13886=>14856, -58892=>14856, -22731=>14857, -58893=>14857, -23193=>14858, -58894=>14858, -166470=>14859, -58895=>14859, -136954=>14860, -58896=>14860, -137071=>14861, -58897=>14861, -136976=>14862, -58898=>14862, -23084=>14863, -58899=>14863, -22968=>14864, -58900=>14864, -23166=>14865, -58902=>14865, -23247=>14866, -58903=>14866, -23058=>14867, -58904=>14867, -153926=>14868, -58905=>14868, -137715=>14869, -58906=>14869, -137313=>14870, -58907=>14870, -148117=>14871, -58908=>14871, -14069=>14872, -58909=>14872, -27909=>14873, -58910=>14873, -29763=>14874, -58911=>14874, -23073=>14875, -58912=>14875, -155267=>14876, -58913=>14876, -23169=>14877, -58914=>14877, -166871=>14878, -58915=>14878, -132115=>14879, -58916=>14879, -37856=>14880, -58917=>14880, -29836=>14881, -58918=>14881, -135939=>14882, -58919=>14882, -28933=>14883, -58920=>14883, -18802=>14884, -58921=>14884, -37896=>14885, -58922=>14885, -166395=>14886, -58923=>14886, -37821=>14887, -58924=>14887, -14240=>14888, -58925=>14888, -23582=>14889, -58926=>14889, -23710=>14890, -58927=>14890, -24158=>14891, -58928=>14891, -24136=>14892, -58929=>14892, -137622=>14893, -58930=>14893, -137596=>14894, -58931=>14894, -146158=>14895, -58932=>14895, -24269=>14896, -58933=>14896, -23375=>14897, -58934=>14897, -58935=>14898, -137475=>14898, -58936=>14899, -137476=>14899, -14081=>14900, -58937=>14900, -137376=>14901, -58938=>14901, -14045=>14902, -58939=>14902, -136958=>14903, -58940=>14903, -14035=>14904, -58941=>14904, -33066=>14905, -58942=>14905, -166471=>14906, -58943=>14906, -138682=>14907, -58944=>14907, -144498=>14908, -58945=>14908, -166312=>14909, -58946=>14909, -24332=>14910, -60916=>14910, -58947=>14910, -24334=>14911, -58948=>14911, -137511=>14912, -58949=>14912, -137131=>14913, -58950=>14913, -23147=>14914, -58951=>14914, -137019=>14915, -58952=>14915, -23364=>14916, -58953=>14916, -161277=>14917, -58955=>14917, -34912=>14918, -58956=>14918, -24702=>14919, -58957=>14919, -141408=>14920, -58958=>14920, -140843=>14921, -58959=>14921, -24539=>14922, -58960=>14922, -16056=>14923, -58961=>14923, -140719=>14924, -58962=>14924, -140734=>14925, -58963=>14925, -168072=>14926, -58964=>14926, -159603=>14927, -58965=>14927, -25024=>14928, -58966=>14928, -131134=>14929, -58967=>14929, -131142=>14930, -58968=>14930, -140827=>14931, -58969=>14931, -24985=>14932, -58970=>14932, -24984=>14933, -58971=>14933, -24693=>14934, -58972=>14934, -142491=>14935, -58973=>14935, -142599=>14936, -58974=>14936, -149204=>14937, -58975=>14937, -168269=>14938, -58976=>14938, -25713=>14939, -58977=>14939, -149093=>14940, -58978=>14940, -142186=>14941, -58979=>14941, -14889=>14942, -58980=>14942, -142114=>14943, -58981=>14943, -144464=>14944, -58982=>14944, -170218=>14945, -58983=>14945, -142968=>14946, -58984=>14946, -25399=>14947, -58985=>14947, -25782=>14948, -58987=>14948, -25393=>14949, -58988=>14949, -25553=>14950, -58989=>14950, -149987=>14951, -58990=>14951, -142695=>14952, -58991=>14952, -25252=>14953, -58992=>14953, -142497=>14954, -58993=>14954, -25659=>14955, -58994=>14955, -25963=>14956, -58995=>14956, -26994=>14957, -58996=>14957, -15348=>14958, -58997=>14958, -143502=>14959, -58998=>14959, -144045=>14960, -58999=>14960, -149897=>14961, -59000=>14961, -144043=>14962, -59001=>14962, -21773=>14963, -59002=>14963, -144096=>14964, -59003=>14964, -137433=>14965, -59004=>14965, -169023=>14966, -59005=>14966, -26318=>14967, -59006=>14967, -144009=>14968, -59007=>14968, -143795=>14969, -59008=>14969, -15072=>14970, -59009=>14970, -152964=>14971, -59011=>14971, -166690=>14972, -59012=>14972, -152975=>14973, -59013=>14973, -136956=>14974, -59014=>14974, -152923=>14975, -59015=>14975, -152613=>14976, -59016=>14976, -30958=>14977, -59017=>14977, -143619=>14978, -59018=>14978, -137258=>14979, -59019=>14979, -143924=>14980, -59020=>14980, -13412=>14981, -59021=>14981, -143887=>14982, -59022=>14982, -143746=>14983, -59023=>14983, -148169=>14984, -59024=>14984, -26254=>14985, -59025=>14985, -159012=>14986, -59026=>14986, -26219=>14987, -59027=>14987, -19347=>14988, -59028=>14988, -26160=>14989, -59029=>14989, -161904=>14990, -59030=>14990, -138731=>14991, -59031=>14991, -26211=>14992, -59032=>14992, -144082=>14993, -59033=>14993, -144097=>14994, -59034=>14994, -26142=>14995, -59035=>14995, -153714=>14996, -59036=>14996, -14545=>14997, -59037=>14997, -145466=>14998, -59038=>14998, -145340=>14999, -59039=>14999, -15257=>15000, -59040=>15000, -145314=>15001, -59041=>15001, -144382=>15002, -59042=>15002, -29904=>15003, -59043=>15003, -15254=>15004, -59044=>15004, -149034=>15005, -59046=>15005, -26806=>15006, -59047=>15006, -15300=>15008, -59049=>15008, -27326=>15009, -59050=>15009, -145365=>15010, -59052=>15010, -148615=>15011, -59053=>15011, -27187=>15012, -59054=>15012, -27218=>15013, -59055=>15013, -27337=>15014, -59056=>15014, -27397=>15015, -59057=>15015, -137490=>15016, -59058=>15016, -25873=>15017, -59059=>15017, -26776=>15018, -59060=>15018, -27212=>15019, -59061=>15019, -15319=>15020, -59062=>15020, -27258=>15021, -59063=>15021, -27479=>15022, -59064=>15022, -147392=>15023, -59065=>15023, -146586=>15024, -59066=>15024, -37792=>15025, -59067=>15025, -37618=>15026, -59068=>15026, -166890=>15027, -59069=>15027, -166603=>15028, -59070=>15028, -37513=>15029, -59071=>15029, -163870=>15030, -59072=>15030, -166364=>15031, -59073=>15031, -37991=>15032, -59074=>15032, -28069=>15033, -59075=>15033, -28427=>15034, -59076=>15034, -147327=>15036, -59079=>15036, -15759=>15037, -59080=>15037, -28164=>15038, -59081=>15038, -147516=>15039, -59082=>15039, -23101=>15040, -59083=>15040, -28170=>15041, -59084=>15041, -22599=>15042, -59085=>15042, -27940=>15043, -59086=>15043, -30786=>15044, -59087=>15044, -28987=>15045, -59088=>15045, -148250=>15046, -59089=>15046, -148086=>15047, -59090=>15047, -28913=>15048, -59091=>15048, -29264=>15049, -61085=>15049, -59092=>15049, -29319=>15050, -59093=>15050, -29332=>15051, -59094=>15051, -149391=>15052, -59095=>15052, -149285=>15053, -59096=>15053, -20857=>15054, -59097=>15054, -150180=>15055, -59098=>15055, -132587=>15056, -59099=>15056, -29818=>15057, -59100=>15057, -147192=>15058, -59101=>15058, -144991=>15059, -59102=>15059, -150090=>15060, -59103=>15060, -149783=>15061, -59104=>15061, -155617=>15062, -59105=>15062, -16134=>15063, -59106=>15063, -16049=>15064, -59107=>15064, -150239=>15065, -59108=>15065, -166947=>15066, -59109=>15066, -147253=>15067, -59110=>15067, -24743=>15068, -59111=>15068, -16115=>15069, -59112=>15069, -29900=>15070, -59113=>15070, -29756=>15071, -59114=>15071, -37767=>15072, -59115=>15072, -29751=>15073, -59116=>15073, -17567=>15074, -59117=>15074, -159210=>15075, -59118=>15075, -17745=>15076, -59119=>15076, -30083=>15077, -59120=>15077, -16227=>15078, -59121=>15078, -150745=>15079, -59122=>15079, -150790=>15080, -59123=>15080, -16216=>15081, -59124=>15081, -30037=>15082, -59125=>15082, -30323=>15083, -59126=>15083, -173510=>15084, -59127=>15084, -29800=>15086, -61070=>15086, -59129=>15086, -166604=>15087, -59130=>15087, -149931=>15088, -59131=>15088, -149902=>15089, -59132=>15089, -15099=>15090, -59133=>15090, -15821=>15091, -59134=>15091, -150094=>15092, -59135=>15092, -16127=>15093, -59136=>15093, -149957=>15094, -59137=>15094, -149747=>15095, -59138=>15095, -37370=>15096, -59139=>15096, -22322=>15097, -59140=>15097, -37698=>15098, -59141=>15098, -166627=>15099, -59142=>15099, -137316=>15100, -59143=>15100, -20703=>15101, -59144=>15101, -152097=>15102, -59145=>15102, -152039=>15103, -59146=>15103, -30584=>15104, -59147=>15104, -143922=>15105, -59148=>15105, -30478=>15106, -59149=>15106, -30479=>15107, -59150=>15107, -30587=>15108, -59151=>15108, -149143=>15109, -59152=>15109, -145281=>15110, -59153=>15110, -14942=>15111, -59154=>15111, -149744=>15112, -59155=>15112, -29752=>15113, -59156=>15113, -29851=>15114, -59157=>15114, -16063=>15115, -59158=>15115, -150202=>15116, -59159=>15116, -150215=>15117, -59160=>15117, -16584=>15118, -59161=>15118, -150166=>15119, -59162=>15119, -156078=>15120, -59163=>15120, -37639=>15121, -59164=>15121, -152961=>15122, -59165=>15122, -30750=>15123, -59166=>15123, -30861=>15124, -59167=>15124, -30856=>15125, -59168=>15125, -30930=>15126, -59169=>15126, -29648=>15127, -59170=>15127, -31065=>15128, -59171=>15128, -161601=>15129, -59172=>15129, -153315=>15130, -59173=>15130, -16654=>15131, -59174=>15131, -31141=>15134, -59177=>15134, -27181=>15135, -59178=>15135, -147194=>15136, -59179=>15136, -31290=>15137, -59180=>15137, -31220=>15138, -59181=>15138, -16750=>15139, -59182=>15139, -136934=>15140, -59183=>15140, -16690=>15141, -59184=>15141, -37429=>15142, -59185=>15142, -31217=>15143, -59186=>15143, -134476=>15144, -59187=>15144, -149900=>15145, -59188=>15145, -131737=>15146, -59189=>15146, -146874=>15147, -59190=>15147, -137070=>15148, -59191=>15148, -13719=>15149, -59192=>15149, -21867=>15150, -59193=>15150, -13680=>15151, -59194=>15151, -13994=>15152, -59195=>15152, -131540=>15153, -59196=>15153, -134157=>15154, -59197=>15154, -31458=>15155, -59198=>15155, -23129=>15156, -59199=>15156, -141045=>15157, -59200=>15157, -154287=>15158, -59201=>15158, -154268=>15159, -59202=>15159, -23053=>15160, -59203=>15160, -131675=>15161, -59204=>15161, -30960=>15162, -59205=>15162, -23082=>15163, -59206=>15163, -154566=>15164, -59207=>15164, -31486=>15165, -59208=>15165, -16889=>15166, -59209=>15166, -31837=>15167, -59210=>15167, -31853=>15168, -59211=>15168, -16913=>15169, -59212=>15169, -154547=>15170, -59213=>15170, -155324=>15171, -59214=>15171, -155302=>15172, -59215=>15172, -31949=>15173, -59216=>15173, -150009=>15174, -59217=>15174, -137136=>15175, -59218=>15175, -31886=>15176, -59219=>15176, -31868=>15177, -59220=>15177, -31918=>15178, -59221=>15178, -27314=>15179, -59222=>15179, -32220=>15180, -59223=>15180, -32263=>15181, -59224=>15181, -32211=>15182, -59225=>15182, -32590=>15183, -59226=>15183, -156257=>15184, -59227=>15184, -155996=>15185, -59228=>15185, -162632=>15186, -59229=>15186, -32151=>15187, -59230=>15187, -155266=>15188, -59231=>15188, -17002=>15189, -59232=>15189, -158581=>15190, -59233=>15190, -133398=>15191, -59234=>15191, -26582=>15192, -59235=>15192, -131150=>15193, -59236=>15193, -144847=>15194, -59237=>15194, -22468=>15195, -59238=>15195, -156690=>15196, -59239=>15196, -156664=>15197, -59240=>15197, -32733=>15198, -59242=>15198, -31527=>15199, -59243=>15199, -133164=>15200, -59244=>15200, -154345=>15201, -59245=>15201, -154947=>15202, -59246=>15202, -31500=>15203, -59247=>15203, -155150=>15204, -59248=>15204, -39398=>15205, -59249=>15205, -34373=>15206, -59250=>15206, -39523=>15207, -59251=>15207, -27164=>15208, -59252=>15208, -144447=>15209, -59253=>15209, -150007=>15210, -59255=>15210, -157101=>15211, -59256=>15211, -39455=>15212, -59257=>15212, -157088=>15213, -59258=>15213, -33941=>15214, -160039=>15215, -59260=>15215, -158929=>15216, -59261=>15216, -17642=>15217, -59262=>15217, -33079=>15218, -59263=>15218, -17410=>15219, -59264=>15219, -32966=>15220, -59265=>15220, -33033=>15221, -59266=>15221, -33090=>15222, -59267=>15222, -157620=>15223, -59268=>15223, -39107=>15224, -59269=>15224, -158274=>15225, -59270=>15225, -33378=>15226, -59271=>15226, -33381=>15227, -59272=>15227, -158289=>15228, -59273=>15228, -33875=>15229, -59274=>15229, -159143=>15230, -59275=>15230, -34320=>15231, -59276=>15231, -160283=>15232, -59277=>15232, -23174=>15233, -59278=>15233, -16767=>15234, -59279=>15234, -137280=>15235, -59280=>15235, -23339=>15236, -59281=>15236, -137377=>15237, -59282=>15237, -23268=>15238, -59283=>15238, -137432=>15239, -59284=>15239, -34464=>15240, -59285=>15240, -195004=>15241, -59286=>15241, -146831=>15242, -59287=>15242, -34861=>15243, -59288=>15243, -160802=>15244, -59289=>15244, -23042=>15245, -59290=>15245, -34926=>15246, -59291=>15246, -20293=>15247, -59292=>15247, -34951=>15248, -59293=>15248, -35007=>15249, -59294=>15249, -35046=>15250, -59295=>15250, -35173=>15251, -59296=>15251, -35149=>15252, -59297=>15252, -153219=>15253, -59298=>15253, -35156=>15254, -59299=>15254, -161669=>15255, -59300=>15255, -161668=>15256, -59301=>15256, -166901=>15257, -59302=>15257, -166873=>15258, -59303=>15258, -166812=>15259, -59304=>15259, -166393=>15260, -59305=>15260, -16045=>15261, -59306=>15261, -33955=>15262, -59307=>15262, -18165=>15263, -59308=>15263, -18127=>15264, -59309=>15264, -14322=>15265, -59310=>15265, -35389=>15266, -59311=>15266, -35356=>15267, -59312=>15267, -169032=>15268, -59313=>15268, -24397=>15269, -59314=>15269, -37419=>15270, -59315=>15270, -148100=>15271, -59316=>15271, -26068=>15272, -59317=>15272, -28969=>15273, -59318=>15273, -28868=>15274, -59319=>15274, -137285=>15275, -59320=>15275, -40301=>15276, -59321=>15276, -35999=>15277, -59322=>15277, -36073=>15278, -59323=>15278, -163292=>15279, -59324=>15279, -22938=>15280, -59325=>15280, -30659=>15281, -59326=>15281, -23024=>15282, -59327=>15282, -14036=>15283, -59329=>15283, -36394=>15284, -59330=>15284, -36519=>15285, -59331=>15285, -150537=>15286, -59332=>15286, -36656=>15287, -59333=>15287, -36682=>15288, -59334=>15288, -17140=>15289, -59335=>15289, -27736=>15290, -59336=>15290, -28603=>15291, -59337=>15291, -140065=>15292, -59338=>15292, -18587=>15293, -59339=>15293, -28537=>15294, -59340=>15294, -28299=>15295, -59341=>15295, -137178=>15296, -59342=>15296, -39913=>15297, -59343=>15297, -14005=>15298, -59344=>15298, -149807=>15299, -59345=>15299, -37051=>15300, -59346=>15300, -18612=>15301, -21873=>15302, -59348=>15302, -18694=>15303, -59349=>15303, -37307=>15304, -59350=>15304, -37892=>15305, -59351=>15305, -166475=>15306, -59352=>15306, -16482=>15307, -59353=>15307, -166652=>15308, -59354=>15308, -37927=>15309, -59355=>15309, -166941=>15310, -59356=>15310, -166971=>15311, -59357=>15311, -34021=>15312, -59358=>15312, -35371=>15313, -59359=>15313, -38297=>15314, -59360=>15314, -38311=>15315, -59361=>15315, -38295=>15316, -59362=>15316, -38294=>15317, -59363=>15317, -167220=>15318, -59364=>15318, -29765=>15319, -59365=>15319, -16066=>15320, -59366=>15320, -149759=>15321, -59367=>15321, -150082=>15322, -59368=>15322, -148458=>15323, -59369=>15323, -16103=>15324, -59370=>15324, -143909=>15325, -59371=>15325, -38543=>15326, -59372=>15326, -167655=>15327, -59373=>15327, -167526=>15328, -59374=>15328, -167525=>15329, -59375=>15329, -16076=>15330, -59376=>15330, -149997=>15331, -59377=>15331, -150136=>15332, -59378=>15332, -147438=>15333, -59379=>15333, -29714=>15334, -59380=>15334, -29803=>15335, -59381=>15335, -16124=>15336, -59382=>15336, -38721=>15337, -59383=>15337, -168112=>15338, -59384=>15338, -26695=>15339, -59385=>15339, -18973=>15340, -59386=>15340, -168083=>15341, -59387=>15341, -153567=>15342, -59388=>15342, -37736=>15344, -59390=>15344, -166281=>15345, -59391=>15345, -166950=>15346, -59392=>15346, -166703=>15347, -59393=>15347, -156606=>15348, -59394=>15348, -37562=>15349, -59395=>15349, -23313=>15350, -59396=>15350, -35689=>15351, -59397=>15351, -18748=>15352, -59398=>15352, -29689=>15353, -59399=>15353, -147995=>15354, -59400=>15354, -38811=>15355, -59401=>15355, -39224=>15357, -59403=>15357, -134950=>15358, -59404=>15358, -24001=>15359, -59405=>15359, -166853=>15360, -59406=>15360, -150194=>15361, -59407=>15361, -38943=>15362, -59408=>15362, -169178=>15363, -59409=>15363, -37622=>15364, -59410=>15364, -169431=>15365, -59411=>15365, -37349=>15366, -59412=>15366, -17600=>15367, -59413=>15367, -166736=>15368, -59414=>15368, -150119=>15369, -59415=>15369, -166756=>15370, -59416=>15370, -39132=>15371, -59417=>15371, -166469=>15372, -59418=>15372, -16128=>15373, -59419=>15373, -37418=>15374, -59420=>15374, -18725=>15375, -59421=>15375, -33812=>15376, -59422=>15376, -39227=>15377, -59423=>15377, -39245=>15378, -59424=>15378, -162566=>15379, -59425=>15379, -15869=>15380, -59426=>15380, -19311=>15382, -59428=>15382, -39338=>15383, -59429=>15383, -39516=>15384, -59430=>15384, -166757=>15385, -59431=>15385, -153800=>15386, -59432=>15386, -27279=>15387, -59433=>15387, -39457=>15388, -59434=>15388, -23294=>15389, -59435=>15389, -39471=>15390, -59436=>15390, -170225=>15391, -59437=>15391, -19344=>15392, -59438=>15392, -170312=>15393, -59439=>15393, -39356=>15394, -59440=>15394, -19389=>15395, -59441=>15395, -19351=>15396, -59442=>15396, -37757=>15397, -59443=>15397, -22642=>15398, -59444=>15398, -135938=>15399, -59445=>15399, -22562=>15400, -59446=>15400, -149944=>15401, -59447=>15401, -136424=>15402, -59448=>15402, -30788=>15403, -59449=>15403, -141087=>15404, -59450=>15404, -146872=>15405, -59451=>15405, -26821=>15406, -59452=>15406, -15741=>15407, -59453=>15407, -37976=>15408, -59454=>15408, -14631=>15409, -59455=>15409, -24912=>15410, -59456=>15410, -141185=>15411, -59457=>15411, -141675=>15412, -59458=>15412, -24839=>15413, -59459=>15413, -40015=>15414, -59460=>15414, -40019=>15415, -59461=>15415, -40059=>15416, -59462=>15416, -39989=>15417, -59463=>15417, -39952=>15418, -59464=>15418, -39807=>15419, -59465=>15419, -39887=>15420, -59466=>15420, -171565=>15421, -59467=>15421, -39839=>15422, -59468=>15422, -172533=>15423, -59469=>15423, -172286=>15424, -59470=>15424, -40225=>15425, -59471=>15425, -19630=>15426, -59472=>15426, -147716=>15427, -59473=>15427, -40472=>15428, -59474=>15428, -19632=>15429, -59475=>15429, -40204=>15430, -59476=>15430, -172468=>15431, -59477=>15431, -172269=>15432, -59478=>15432, -172275=>15433, -59479=>15433, -170287=>15434, -59480=>15434, -40357=>15435, -59481=>15435, -33981=>15436, -59482=>15436, -159250=>15437, -59483=>15437, -159711=>15438, -59484=>15438, -158594=>15439, -59485=>15439, -34300=>15440, -59486=>15440, -17715=>15441, -59487=>15441, -159140=>15442, -59488=>15442, -159364=>15443, -59489=>15443, -159216=>15444, -59490=>15444, -33824=>15445, -59491=>15445, -34286=>15446, -59492=>15446, -159232=>15447, -59493=>15447, -145367=>15448, -59494=>15448, -155748=>15449, -59495=>15449, -31202=>15450, -59496=>15450, -144796=>15451, -59497=>15451, -144960=>15452, -59498=>15452, -149982=>15453, -59500=>15453, -15714=>15454, -59501=>15454, -37851=>15455, -59502=>15455, -37566=>15456, -59503=>15456, -37704=>15457, -59504=>15457, -131775=>15458, -59505=>15458, -30905=>15459, -59506=>15459, -37495=>15460, -59507=>15460, -37965=>15461, -59508=>15461, -20452=>15462, -59509=>15462, -13376=>15463, -59510=>15463, -36964=>15464, -59511=>15464, -152925=>15465, -59512=>15465, -30781=>15466, -59513=>15466, -30804=>15467, -59514=>15467, -30902=>15468, -59515=>15468, -30795=>15469, -59516=>15469, -137047=>15470, -59517=>15470, -143817=>15471, -59518=>15471, -149825=>15472, -59519=>15472, -13978=>15473, -59520=>15473, -20338=>15474, -59521=>15474, -28634=>15475, -59522=>15475, -28633=>15476, -59523=>15476, -28702=>15478, -59524=>15478, -59525=>15478, -21524=>15479, -59526=>15479, -147893=>15480, -59527=>15480, -22459=>15481, -59528=>15481, -22771=>15482, -59529=>15482, -22410=>15483, -59530=>15483, -40214=>15484, -59531=>15484, -22487=>15485, -59532=>15485, -28980=>15486, -59533=>15486, -13487=>15487, -59534=>15487, -147884=>15488, -59535=>15488, -29163=>15489, -59536=>15489, -158784=>15490, -59537=>15490, -151447=>15491, -59538=>15491, -137141=>15493, -59540=>15493, -166473=>15494, -59541=>15494, -24844=>15495, -59542=>15495, -23246=>15496, -59543=>15496, -23051=>15497, -59544=>15497, -17084=>15498, -59545=>15498, -148616=>15499, -59546=>15499, -14124=>15500, -59547=>15500, -19323=>15501, -59548=>15501, -166396=>15502, -59549=>15502, -37819=>15503, -59550=>15503, -37816=>15504, -59551=>15504, -137430=>15505, -59552=>15505, -134941=>15506, -59553=>15506, -33906=>15507, -59554=>15507, -158912=>15508, -59555=>15508, -136211=>15509, -59556=>15509, -148218=>15510, -59557=>15510, -142374=>15511, -59558=>15511, -148417=>15512, -59559=>15512, -22932=>15513, -59560=>15513, -146871=>15514, -59561=>15514, -157505=>15515, -59562=>15515, -32168=>15516, -59563=>15516, -155995=>15517, -59564=>15517, -155812=>15518, -59565=>15518, -149945=>15519, -59566=>15519, -149899=>15520, -59567=>15520, -166394=>15521, -59568=>15521, -37605=>15522, -59569=>15522, -29666=>15523, -59570=>15523, -16105=>15524, -59571=>15524, -29876=>15525, -59572=>15525, -166755=>15526, -59573=>15526, -137375=>15527, -59574=>15527, -16097=>15528, -59575=>15528, -150195=>15529, -59576=>15529, -27352=>15530, -59577=>15530, -29683=>15531, -59578=>15531, -29691=>15532, -59579=>15532, -16086=>15533, -59580=>15533, -150078=>15534, -59581=>15534, -150164=>15535, -59582=>15535, -137177=>15536, -59583=>15536, -150118=>15537, -59584=>15537, -132007=>15538, -59585=>15538, -136228=>15539, -59586=>15539, -149989=>15540, -59587=>15540, -29768=>15541, -59588=>15541, -149782=>15542, -59589=>15542, -28837=>15543, -59590=>15543, -149878=>15544, -59591=>15544, -37508=>15545, -59592=>15545, -29670=>15546, -59593=>15546, -37727=>15547, -59594=>15547, -132350=>15548, -59595=>15548, -37681=>15549, -59596=>15549, -166606=>15550, -59597=>15550, -166422=>15551, -59598=>15551, -37766=>15552, -59599=>15552, -166887=>15553, -59600=>15553, -153045=>15554, -59601=>15554, -18741=>15555, -59602=>15555, -166530=>15556, -59603=>15556, -29035=>15557, -59604=>15557, -149827=>15558, -59605=>15558, -134399=>15559, -59606=>15559, -22180=>15560, -59607=>15560, -132634=>15561, -59608=>15561, -134123=>15562, -59609=>15562, -134328=>15563, -59610=>15563, -21762=>15564, -59611=>15564, -31172=>15565, -59612=>15565, -137210=>15566, -59613=>15566, -32254=>15567, -59614=>15567, -136898=>15568, -59615=>15568, -150096=>15569, -59616=>15569, -137298=>15570, -59617=>15570, -17710=>15571, -59618=>15571, -37889=>15572, -59619=>15572, -14090=>15573, -59620=>15573, -166592=>15574, -59621=>15574, -149933=>15575, -59622=>15575, -22960=>15576, -59623=>15576, -137407=>15577, -59624=>15577, -137347=>15578, -59625=>15578, -160900=>15579, -59626=>15579, -23201=>15580, -59627=>15580, -14050=>15581, -59628=>15581, -146779=>15582, -59629=>15582, -14000=>15583, -59630=>15583, -37471=>15584, -59631=>15584, -23161=>15585, -59632=>15585, -166529=>15586, -59633=>15586, -137314=>15587, -59634=>15587, -37748=>15588, -59635=>15588, -15565=>15589, -59636=>15589, -133812=>15590, -59637=>15590, -19094=>15591, -59638=>15591, -14730=>15592, -59639=>15592, -20724=>15593, -59640=>15593, -15721=>15594, -59641=>15594, -15692=>15595, -59642=>15595, -136092=>15596, -59643=>15596, -29045=>15597, -59644=>15597, -17147=>15598, -59645=>15598, -164376=>15599, -59646=>15599, -28175=>15600, -59647=>15600, -168164=>15601, -59648=>15601, -17643=>15602, -59649=>15602, -27991=>15603, -59650=>15603, -163407=>15604, -59651=>15604, -28775=>15605, -59652=>15605, -27823=>15606, -59653=>15606, -15574=>15607, -59654=>15607, -147437=>15608, -59655=>15608, -146989=>15609, -59656=>15609, -28162=>15610, -59657=>15610, -28428=>15611, -59658=>15611, -15727=>15612, -59659=>15612, -132085=>15613, -59660=>15613, -30033=>15614, -59661=>15614, -14012=>15615, -59662=>15615, -13512=>15616, -59663=>15616, -18048=>15617, -59664=>15617, -16090=>15618, -59665=>15618, -18545=>15619, -59666=>15619, -22980=>15620, -59667=>15620, -37486=>15621, -59668=>15621, -18750=>15622, -59669=>15622, -36673=>15623, -59670=>15623, -166940=>15624, -59671=>15624, -158656=>15625, -59672=>15625, -22546=>15626, -59673=>15626, -22472=>15627, -59674=>15627, -14038=>15628, -59675=>15628, -136274=>15629, -59676=>15629, -28926=>15630, -59677=>15630, -148322=>15631, -59678=>15631, -150129=>15632, -59679=>15632, -143331=>15633, -59680=>15633, -135856=>15634, -59681=>15634, -140221=>15635, -59682=>15635, -26809=>15636, -59683=>15636, -26983=>15637, -59684=>15637, -136088=>15638, -59685=>15638, -144613=>15639, -59686=>15639, -162804=>15640, -59687=>15640, -145119=>15641, -59688=>15641, -166531=>15642, -59689=>15642, -145366=>15643, -59690=>15643, -144378=>15644, -59691=>15644, -150687=>15645, -59692=>15645, -27162=>15646, -59693=>15646, -145069=>15647, -59694=>15647, -158903=>15648, -59695=>15648, -33854=>15649, -59696=>15649, -17631=>15650, -59697=>15650, -17614=>15651, -59698=>15651, -159014=>15652, -59699=>15652, -159057=>15653, -59700=>15653, -158850=>15654, -59701=>15654, -159710=>15655, -59702=>15655, -33597=>15658, -59705=>15658, -137018=>15659, -59706=>15659, -33773=>15660, -59707=>15660, -158848=>15661, -59708=>15661, -159827=>15662, -59709=>15662, -137179=>15663, -59710=>15663, -22921=>15664, -59711=>15664, -23170=>15665, -59712=>15665, -137139=>15666, -59713=>15666, -23137=>15667, -59714=>15667, -23153=>15668, -59715=>15668, -137477=>15669, -59716=>15669, -147964=>15670, -59717=>15670, -14125=>15671, -59718=>15671, -23023=>15672, -59719=>15672, -137020=>15673, -59720=>15673, -14023=>15674, -59721=>15674, -29070=>15675, -59722=>15675, -37776=>15676, -59723=>15676, -26266=>15677, -59724=>15677, -148133=>15678, -59725=>15678, -23150=>15679, -59726=>15679, -23083=>15680, -59727=>15680, -148115=>15681, -59728=>15681, -27179=>15682, -59729=>15682, -147193=>15683, -59730=>15683, -161590=>15684, -59731=>15684, -148571=>15685, -59732=>15685, -148170=>15686, -59733=>15686, -28957=>15687, -59734=>15687, -148057=>15688, -59735=>15688, -166369=>15689, -59736=>15689, -20400=>15690, -59737=>15690, -159016=>15691, -59738=>15691, -23746=>15692, -59739=>15692, -148686=>15693, -59740=>15693, -163405=>15694, -59741=>15694, -148413=>15695, -59742=>15695, -27148=>15696, -59743=>15696, -148054=>15697, -59744=>15697, -135940=>15698, -59745=>15698, -28979=>15700, -59747=>15700, -148457=>15701, -59748=>15701, -15781=>15702, -59749=>15702, -27871=>15703, -59750=>15703, -194597=>15704, -59751=>15704, -23019=>15705, -59754=>15705, -24412=>15706, -59757=>15706, -59764=>15707, -144128=>15707, -31955=>15708, -59776=>15708, -59783=>15709, -162548=>15709, -59786=>15710, -153334=>15710, -162584=>15711, -59790=>15711, -36972=>15712, -59791=>15712, -33270=>15713, -59795=>15713, -30476=>15714, -59797=>15714, -27810=>15715, -59799=>15715, -22269=>15716, -59800=>15716, -22633=>15717, -59828=>15717, -26465=>15718, -59832=>15718, -23646=>15719, -59838=>15719, -22770=>15720, -59841=>15720, -28857=>15721, -59843=>15721, -26627=>15722, -59853=>15722, -59859=>15723, -36795=>15723, -59861=>15724, -36796=>15724, -20001=>15725, -59871=>15725, -31545=>15726, -59898=>15726, -15820=>15727, -59902=>15727, -29482=>15728, -57990=>15728, -59909=>15728, -30048=>15729, -59912=>15729, -22586=>15730, -59920=>15730, -33446=>15731, -59932=>15731, -27018=>15732, -59940=>15732, -24803=>15733, -59944=>15733, -20206=>15734, -59984=>15734, -39364=>15735, -60002=>15735, -40639=>15736, -60023=>15736, -21249=>15737, -60025=>15737, -26528=>15738, -60038=>15738, -24808=>15739, -60046=>15739, -20916=>15740, -60053=>15740, -31363=>15741, -60064=>15741, -39994=>15742, -60075=>15742, -31432=>15743, -60093=>15743, -26906=>15744, -60098=>15744, -22956=>15745, -60100=>15745, -22592=>15746, -60102=>15746, -21610=>15747, -60114=>15747, -24807=>15748, -60123=>15748, -22138=>15749, -60125=>15749, -26965=>15750, -60132=>15750, -39983=>15751, -60133=>15751, -34725=>15752, -60134=>15752, -23584=>15753, -60141=>15753, -24075=>15754, -60143=>15754, -26398=>15755, -60147=>15755, -33965=>15756, -60157=>15756, -35713=>15757, -60161=>15757, -20088=>15758, -60166=>15758, -25283=>15759, -60176=>15759, -26709=>15760, -60180=>15760, -33533=>15762, -60190=>15762, -35237=>15763, -60194=>15763, -36768=>15764, -60196=>15764, -38840=>15765, -60198=>15765, -38983=>15766, -60200=>15766, -39613=>15767, -60201=>15767, -24497=>15768, -60218=>15768, -26184=>15769, -60219=>15769, -26303=>15770, -60220=>15770, -162425=>15771, -60221=>15771, -60225=>15773, -149946=>15773, -60230=>15776, -131910=>15776, -26382=>15777, -60232=>15777, -26904=>15778, -60233=>15778, -161367=>15779, -60235=>15779, -155618=>15780, -60236=>15780, -161278=>15781, -60239=>15781, -139418=>15782, -60240=>15782, -18640=>15783, -60241=>15783, -19128=>15784, -60242=>15784, -60244=>15785, -166554=>15785, -60247=>15786, -147515=>15786, -150085=>15787, -60250=>15787, -132554=>15788, -60251=>15788, -20946=>15789, -60252=>15789, -132625=>15790, -60253=>15790, -22943=>15791, -60254=>15791, -138920=>15792, -60255=>15792, -15294=>15793, -60256=>15793, -146687=>15794, -60257=>15794, -14747=>15795, -60262=>15795, -165352=>15796, -60264=>15796, -170441=>15797, -60265=>15797, -14178=>15798, -60266=>15798, -139715=>15799, -60267=>15799, -35678=>15800, -60268=>15800, -166734=>15801, -60269=>15801, -29193=>15803, -60274=>15803, -60276=>15804, -134264=>15804, -132985=>15805, -60280=>15805, -36570=>15806, -60281=>15806, -21135=>15807, -60283=>15807, -29041=>15808, -60285=>15808, -147274=>15809, -60288=>15809, -150183=>15810, -60289=>15810, -21948=>15811, -60290=>15811, -60293=>15812, -158546=>15812, -13427=>15813, -60295=>15813, -60297=>15814, -161330=>15814, -18200=>15815, -60299=>15815, -60303=>15816, -149823=>15816, -20582=>15817, -60305=>15817, -13563=>15818, -60306=>15818, -144332=>15819, -60307=>15819, -18300=>15821, -60310=>15821, -166216=>15822, -60311=>15822, -60315=>15823, -138640=>15823, -162834=>15825, -60320=>15825, -36950=>15826, -60321=>15826, -151450=>15827, -60323=>15827, -35682=>15828, -60324=>15828, -23899=>15829, -60327=>15829, -158711=>15830, -60328=>15830, -137500=>15832, -60331=>15832, -35562=>15833, -60332=>15833, -150006=>15834, -60333=>15834, -60335=>15835, -147439=>15835, -19392=>15836, -60337=>15836, -141083=>15837, -60340=>15837, -37989=>15838, -60341=>15838, -153569=>15839, -60342=>15839, -24981=>15840, -60343=>15840, -23079=>15841, -60344=>15841, -194765=>15842, -60345=>15842, -194566=>15843, -60348=>15844, -148769=>15844, -20074=>15845, -60350=>15845, -149812=>15846, -60351=>15846, -38486=>15847, -60352=>15847, -28047=>15848, -60353=>15848, -158909=>15849, -60354=>15849, -35191=>15850, -60356=>15850, -60359=>15851, -156689=>15851, -31554=>15853, -60363=>15853, -168128=>15854, -60364=>15854, -133649=>15855, -60365=>15855, -31301=>15857, -60369=>15857, -39462=>15858, -60372=>15858, -13919=>15859, -60374=>15859, -156777=>15860, -60375=>15860, -131105=>15861, -60376=>15861, -31107=>15862, -60377=>15862, -23852=>15863, -60380=>15863, -144665=>15864, -60381=>15864, -18128=>15866, -60384=>15866, -30011=>15867, -60386=>15867, -34917=>15868, -60387=>15868, -22710=>15869, -60389=>15869, -14108=>15870, -60390=>15870, -140685=>15871, -60391=>15871, -15444=>15872, -60394=>15872, -37505=>15873, -60397=>15873, -139642=>15874, -60398=>15874, -37680=>15875, -60400=>15875, -149968=>15876, -60402=>15876, -27705=>15877, -60403=>15877, -134904=>15878, -60406=>15878, -34855=>15879, -60407=>15879, -35061=>15880, -60408=>15880, -141606=>15881, -60409=>15881, -164979=>15882, -60410=>15882, -137137=>15883, -60411=>15883, -28344=>15884, -60412=>15884, -150058=>15885, -60413=>15885, -137248=>15886, -60414=>15886, -14756=>15887, -60415=>15887, -17727=>15890, -60419=>15890, -26294=>15891, -60420=>15891, -171181=>15892, -60421=>15892, -170148=>15893, -60422=>15893, -35139=>15894, -60423=>15894, -16607=>15895, -60427=>15895, -136714=>15896, -60428=>15896, -14753=>15897, -60429=>15897, -145199=>15898, -60430=>15898, -164072=>15899, -60431=>15899, -136133=>15900, -60432=>15900, -29101=>15901, -60433=>15901, -33638=>15902, -60434=>15902, -60436=>15903, -168360=>15903, -19639=>15905, -60438=>15905, -159919=>15906, -60439=>15906, -166315=>15907, -60440=>15907, -147834=>15908, -60445=>15908, -31555=>15909, -60446=>15909, -31102=>15910, -60447=>15910, -28597=>15911, -60449=>15911, -172767=>15912, -60450=>15912, -27139=>15913, -60451=>15913, -164632=>15914, -60452=>15914, -21410=>15915, -60453=>15915, -159239=>15916, -60454=>15916, -37823=>15917, -60455=>15917, -26678=>15918, -60456=>15918, -38749=>15919, -59389=>15919, -60457=>15919, -164207=>15920, -60458=>15920, -158133=>15921, -60460=>15921, -136173=>15922, -60461=>15922, -143919=>15923, -60462=>15923, -23941=>15924, -60464=>15924, -166960=>15925, -60465=>15925, -22293=>15926, -60467=>15926, -38947=>15927, -60468=>15927, -166217=>15928, -60469=>15928, -23979=>15929, -60470=>15929, -149896=>15930, -60471=>15930, -26046=>15931, -60472=>15931, -27093=>15932, -60473=>15932, -21458=>15933, -60474=>15933, -150181=>15934, -60475=>15934, -147329=>15935, -60476=>15935, -15377=>15936, -60477=>15936, -26422=>15937, -60478=>15937, -60482=>15938, -139169=>15938, -13770=>15939, -60490=>15939, -18682=>15940, -60493=>15940, -30728=>15942, -60496=>15942, -37461=>15943, -60497=>15943, -17394=>15944, -60499=>15944, -17375=>15945, -60501=>15945, -23032=>15946, -60505=>15946, -22155=>15948, -60518=>15948, -60520=>15949, -169449=>15949, -36882=>15950, -60541=>15950, -21953=>15951, -60546=>15951, -17673=>15952, -60551=>15952, -32383=>15953, -60552=>15953, -28502=>15954, -60553=>15954, -27313=>15955, -60554=>15955, -13540=>15956, -60556=>15956, -161949=>15957, -60558=>15957, -14138=>15958, -60559=>15958, -60562=>15960, -163876=>15960, -60565=>15961, -162366=>15961, -15851=>15962, -60567=>15962, -60569=>15963, -146615=>15963, -156248=>15964, -60574=>15964, -22207=>15965, -60575=>15965, -36366=>15966, -60577=>15966, -23405=>15967, -60578=>15967, -25566=>15968, -60581=>15968, -25904=>15970, -60585=>15970, -22061=>15971, -60586=>15971, -21530=>15972, -60588=>15972, -171416=>15973, -60591=>15973, -19581=>15974, -60592=>15974, -22050=>15975, -60593=>15975, -22046=>15976, -60594=>15976, -32585=>15977, -60595=>15977, -22901=>15978, -60597=>15978, -146752=>15979, -60598=>15979, -34672=>15980, -60599=>15980, -33047=>15981, -60604=>15981, -40286=>15982, -60605=>15982, -36120=>15983, -60606=>15983, -30267=>15984, -60607=>15984, -40005=>15985, -60608=>15985, -30286=>15986, -60609=>15986, -30649=>15987, -60610=>15987, -37701=>15988, -60611=>15988, -21554=>15989, -60612=>15989, -33096=>15990, -60613=>15990, -33527=>15991, -60614=>15991, -22053=>15992, -60615=>15992, -33074=>15993, -60616=>15993, -33816=>15994, -60617=>15994, -32957=>15995, -60618=>15995, -21994=>15996, -60619=>15996, -31074=>15997, -60620=>15997, -22083=>15998, -60621=>15998, -21526=>15999, -60622=>15999, -134813=>16000, -60623=>16000, -13774=>16001, -60624=>16001, -22021=>16002, -57509=>16002, -60625=>16002, -22001=>16003, -60626=>16003, -26353=>16004, -60627=>16004, -164578=>16005, -60628=>16005, -13869=>16006, -60629=>16006, -30004=>16007, -60630=>16007, -22000=>16008, -60631=>16008, -21946=>16009, -60632=>16009, -21655=>16010, -60633=>16010, -21874=>16011, -60634=>16011, -134209=>16012, -60635=>16012, -134294=>16013, -60636=>16013, -24272=>16014, -57652=>16014, -60637=>16014, -134774=>16015, -60639=>16015, -142434=>16016, -60640=>16016, -134818=>16017, -60641=>16017, -40619=>16018, -60642=>16018, -32090=>16019, -60643=>16019, -135285=>16021, -60645=>16021, -25245=>16022, -60646=>16022, -38765=>16023, -60647=>16023, -21652=>16024, -60648=>16024, -36045=>16025, -60649=>16025, -29174=>16026, -60650=>16026, -37238=>16027, -60651=>16027, -25596=>16028, -60652=>16028, -25529=>16029, -60653=>16029, -25598=>16030, -60654=>16030, -21865=>16031, -60655=>16031, -142147=>16032, -60656=>16032, -40050=>16033, -60657=>16033, -143027=>16034, -60658=>16034, -20890=>16035, -60659=>16035, -13535=>16036, -60660=>16036, -134567=>16037, -60661=>16037, -20903=>16038, -60662=>16038, -21581=>16039, -60663=>16039, -21790=>16040, -60664=>16040, -21779=>16041, -60665=>16041, -30310=>16042, -60666=>16042, -36397=>16043, -60667=>16043, -157834=>16044, -60668=>16044, -30129=>16045, -60669=>16045, -32950=>16046, -60670=>16046, -34820=>16047, -60671=>16047, -35015=>16049, -60673=>16049, -33206=>16050, -60674=>16050, -33820=>16051, -60675=>16051, -17644=>16052, -60677=>16052, -29444=>16053, -60678=>16053, -33547=>16054, -60681=>16054, -22139=>16055, -60683=>16055, -37232=>16056, -60690=>16056, -37384=>16057, -60692=>16057, -134905=>16058, -60696=>16058, -29286=>16059, -60697=>16059, -18254=>16060, -60699=>16060, -60701=>16061, -163833=>16061, -16634=>16062, -60703=>16062, -40029=>16063, -60704=>16063, -25887=>16064, -60705=>16064, -18675=>16065, -60707=>16065, -149472=>16066, -60708=>16066, -171388=>16067, -60709=>16067, -60713=>16069, -161187=>16069, -60715=>16070, -155720=>16071, -60716=>16071, -29091=>16072, -60718=>16072, -32398=>16073, -60719=>16073, -40272=>16074, -60720=>16074, -13687=>16075, -60723=>16075, -27826=>16076, -60725=>16076, -21351=>16077, -60726=>16077, -14812=>16078, -60728=>16078, -60731=>16079, -149016=>16079, -33325=>16080, -60734=>16080, -21579=>16081, -60735=>16081, -60739=>16082, -14930=>16083, -60740=>16083, -29556=>16084, -60742=>16084, -171692=>16085, -60743=>16085, -19721=>16086, -60744=>16086, -39917=>16087, -60745=>16087, -19547=>16089, -60748=>16089, -171998=>16090, -60751=>16090, -33884=>16091, -60752=>16091, -60754=>16092, -160434=>16092, -25390=>16093, -60757=>16093, -32037=>16094, -60758=>16094, -14890=>16095, -60761=>16095, -36872=>16096, -60762=>16096, -21196=>16097, -60763=>16097, -15988=>16098, -60764=>16098, -13946=>16099, -60765=>16099, -17897=>16100, -60766=>16100, -132238=>16101, -60767=>16101, -30272=>16102, -60768=>16102, -23280=>16103, -60769=>16103, -134838=>16104, -60770=>16104, -30842=>16105, -60771=>16105, -18358=>16106, -163630=>16106, -60772=>16106, -22695=>16107, -60773=>16107, -16575=>16108, -60774=>16108, -22140=>16109, -60775=>16109, -39819=>16110, -60776=>16110, -23924=>16111, -60777=>16111, -30292=>16112, -60778=>16112, -173108=>16113, -60779=>16113, -40581=>16114, -60780=>16114, -19681=>16115, -60781=>16115, -14331=>16117, -60783=>16117, -24857=>16118, -60784=>16118, -148466=>16119, -60786=>16119, -60787=>16120, -22109=>16121, -60788=>16121, -171526=>16122, -60792=>16122, -21044=>16123, -60793=>16123, -13741=>16124, -60795=>16124, -40316=>16126, -60797=>16126, -31830=>16127, -60798=>16127, -39737=>16128, -60799=>16128, -22494=>16129, -60800=>16129, -23635=>16130, -60802=>16130, -25811=>16131, -60803=>16131, -169168=>16132, -60804=>16132, -156469=>16133, -60805=>16133, -34477=>16134, -60807=>16134, -134440=>16135, -60808=>16135, -134513=>16136, -60811=>16136, -60812=>16137, -20990=>16138, -60813=>16138, -139023=>16139, -60814=>16139, -23950=>16140, -60815=>16140, -38659=>16141, -60816=>16141, -138705=>16142, -60817=>16142, -40577=>16143, -60818=>16143, -36940=>16144, -60819=>16144, -31519=>16145, -60820=>16145, -39682=>16146, -60821=>16146, -23761=>16147, -60822=>16147, -31651=>16148, -60823=>16148, -25192=>16149, -60824=>16149, -25397=>16150, -60825=>16150, -39679=>16151, -60826=>16151, -31695=>16152, -60827=>16152, -39722=>16153, -60828=>16153, -31870=>16154, -60829=>16154, -31810=>16156, -60831=>16156, -31878=>16157, -60832=>16157, -39957=>16158, -60833=>16158, -31740=>16159, -60834=>16159, -39689=>16160, -60835=>16160, -39982=>16162, -40794=>16163, -60839=>16163, -21875=>16164, -60840=>16164, -23491=>16165, -60841=>16165, -20477=>16166, -60842=>16166, -40600=>16167, -60843=>16167, -20466=>16168, -60844=>16168, -21088=>16169, -60845=>16169, -21201=>16170, -60847=>16170, -22375=>16171, -60848=>16171, -20566=>16172, -60849=>16172, -22967=>16173, -60850=>16173, -24082=>16174, -60851=>16174, -38856=>16175, -60852=>16175, -40363=>16176, -60853=>16176, -36700=>16177, -60854=>16177, -21609=>16178, -60855=>16178, -38836=>16179, -60856=>16179, -39232=>16180, -60857=>16180, -38842=>16181, -60858=>16181, -21292=>16182, -60859=>16182, -24880=>16183, -60860=>16183, -26924=>16184, -60861=>16184, -21466=>16185, -60862=>16185, -39946=>16186, -60863=>16186, -40194=>16187, -60864=>16187, -19515=>16188, -60865=>16188, -38465=>16189, -60866=>16189, -27008=>16190, -60867=>16190, -20646=>16191, -60868=>16191, -30022=>16192, -60869=>16192, -137069=>16193, -60870=>16193, -39386=>16194, -60871=>16194, -21107=>16195, -60872=>16195, -60873=>16196, -37209=>16197, -60874=>16197, -38529=>16198, -60875=>16198, -37212=>16199, -60876=>16199, -60877=>16200, -37201=>16201, -60878=>16201, -167575=>16202, -60879=>16202, -25471=>16203, -60880=>16203, -27338=>16204, -60882=>16204, -22033=>16205, -60883=>16205, -37262=>16206, -60884=>16206, -30074=>16207, -60885=>16207, -25221=>16208, -60886=>16208, -29519=>16209, -60888=>16209, -31856=>16210, -60889=>16210, -154657=>16211, -60890=>16211, -60892=>16212, -30422=>16213, -60894=>16213, -39837=>16214, -60895=>16214, -20010=>16215, -60896=>16215, -134356=>16216, -60897=>16216, -33726=>16217, -60898=>16217, -34882=>16218, -60899=>16218, -60900=>16219, -23626=>16220, -60901=>16220, -27072=>16221, -60902=>16221, -21023=>16224, -60905=>16224, -24053=>16225, -60906=>16225, -20174=>16226, -60907=>16226, -27697=>16227, -60908=>16227, -131570=>16228, -60909=>16228, -20281=>16229, -60910=>16229, -21660=>16230, -60911=>16230, -21146=>16232, -60913=>16232, -36226=>16233, -60914=>16233, -13822=>16234, -60915=>16234, -13811=>16236, -60917=>16236, -60918=>16237, -27474=>16238, -60919=>16238, -37244=>16239, -60920=>16239, -40869=>16240, -60921=>16240, -39831=>16241, -60922=>16241, -38958=>16242, -60923=>16242, -39092=>16243, -60924=>16243, -39610=>16244, -60925=>16244, -40616=>16245, -60926=>16245, -40580=>16246, -60927=>16246, -31508=>16247, -60929=>16247, -60930=>16248, -27642=>16249, -60931=>16249, -34840=>16250, -60932=>16250, -32632=>16251, -60933=>16251, -60934=>16252, -22048=>16253, -60935=>16253, -173642=>16254, -60936=>16254, -36471=>16255, -60937=>16255, -40787=>16256, -60938=>16256, -60939=>16257, -36308=>16258, -60940=>16258, -36431=>16259, -60941=>16259, -40476=>16260, -60942=>16260, -36353=>16261, -60943=>16261, -25218=>16262, -60944=>16262, -164733=>16263, -60945=>16263, -36392=>16264, -60946=>16264, -36469=>16265, -60947=>16265, -31443=>16266, -60948=>16266, -31294=>16267, -60950=>16267, -30936=>16268, -60951=>16268, -27882=>16269, -60952=>16269, -35431=>16270, -60953=>16270, -30215=>16271, -60954=>16271, -40742=>16272, -60956=>16272, -27854=>16273, -60957=>16273, -34774=>16274, -60958=>16274, -30147=>16275, -60959=>16275, -172722=>16276, -60960=>16276, -30803=>16277, -60961=>16277, -36108=>16278, -60963=>16278, -29410=>16279, -60964=>16279, -29553=>16280, -60965=>16280, -35629=>16281, -60966=>16281, -29442=>16282, -60967=>16282, -29937=>16283, -60968=>16283, -36075=>16284, -60969=>16284, -150203=>16285, -60970=>16285, -34351=>16286, -60971=>16286, -24506=>16287, -60972=>16287, -34976=>16288, -60973=>16288, -17591=>16289, -60974=>16289, -60975=>16290, -159237=>16291, -60977=>16291, -60978=>16292, -35454=>16293, -60979=>16293, -140571=>16294, -60980=>16294, -60981=>16295, -24829=>16296, -60982=>16296, -30311=>16297, -60983=>16297, -39639=>16298, -60984=>16298, -40260=>16299, -60985=>16299, -37742=>16300, -58859=>16300, -60986=>16300, -39823=>16301, -60987=>16301, -34805=>16302, -60988=>16302, -60989=>16303, -36087=>16305, -60991=>16305, -29484=>16306, -60992=>16306, -38689=>16307, -60993=>16307, -39856=>16308, -60994=>16308, -13782=>16309, -60995=>16309, -29362=>16310, -60996=>16310, -19463=>16311, -60997=>16311, -31825=>16312, -60998=>16312, -39242=>16313, -60999=>16313, -24921=>16314, -61001=>16314, -19460=>16315, -61002=>16315, -40598=>16316, -61003=>16316, -24957=>16317, -61004=>16317, -61005=>16318, -22367=>16319, -61006=>16319, -24943=>16320, -61007=>16320, -25254=>16321, -61008=>16321, -25145=>16322, -61009=>16322, -14940=>16324, -61011=>16324, -25058=>16325, -61012=>16325, -21418=>16326, -61013=>16326, -25444=>16327, -61015=>16327, -26626=>16328, -61016=>16328, -13778=>16329, -61017=>16329, -23895=>16330, -61018=>16330, -36826=>16331, -61020=>16331, -167481=>16332, -61021=>16332, -61022=>16333, -20697=>16334, -61023=>16334, -30982=>16335, -61025=>16335, -21298=>16336, -61026=>16336, -38456=>16337, -61027=>16337, -134971=>16338, -61028=>16338, -16485=>16339, -61029=>16339, -61030=>16340, -30718=>16341, -61031=>16341, -61032=>16342, -31938=>16343, -61033=>16343, -155418=>16344, -61034=>16344, -31962=>16345, -61035=>16345, -31277=>16346, -61036=>16346, -32870=>16347, -61037=>16347, -32867=>16348, -61038=>16348, -32077=>16349, -61039=>16349, -29957=>16350, -61040=>16350, -29938=>16351, -61041=>16351, -35220=>16352, -61042=>16352, -33306=>16353, -61043=>16353, -26380=>16354, -61044=>16354, -32866=>16355, -61045=>16355, -160902=>16356, -61046=>16356, -32859=>16357, -61047=>16357, -29936=>16358, -61048=>16358, -33027=>16359, -61049=>16359, -30500=>16360, -61050=>16360, -35209=>16361, -61051=>16361, -157644=>16362, -61052=>16362, -30035=>16363, -61053=>16363, -34729=>16364, -61055=>16364, -34766=>16365, -61056=>16365, -33224=>16366, -61057=>16366, -34700=>16367, -61058=>16367, -35401=>16368, -61059=>16368, -36013=>16369, -61060=>16369, -35651=>16370, -61061=>16370, -30507=>16371, -61062=>16371, -29944=>16372, -61063=>16372, -34010=>16373, -61064=>16373, -27058=>16374, -61066=>16374, -36262=>16375, -61067=>16375, -61068=>16376, -35241=>16377, -58392=>16377, -61069=>16377, -28089=>16379, -61071=>16379, -34753=>16380, -61072=>16380, -147473=>16381, -61073=>16381, -29927=>16382, -61074=>16382, -15835=>16383, -61075=>16383, -29046=>16384, -61076=>16384, -24740=>16385, -57702=>16385, -61077=>16385, -24988=>16386, -61078=>16386, -15569=>16387, -61079=>16387, -24695=>16389, -61081=>16389, -61082=>16390, -32625=>16391, -61083=>16391, -194850=>16392, -24809=>16393, -61086=>16393, -19326=>16394, -61087=>16394, -132423=>16395, -57344=>16395, -37595=>16396, -57345=>16396, -132575=>16397, -57346=>16397, -147397=>16398, -57347=>16398, -34124=>16399, -57348=>16399, -17077=>16400, -57349=>16400, -29679=>16401, -57350=>16401, -20917=>16402, -57351=>16402, -13897=>16403, -57352=>16403, -149826=>16404, -57353=>16404, -166372=>16405, -57354=>16405, -37700=>16406, -57355=>16406, -137691=>16407, -57356=>16407, -33518=>16408, -57357=>16408, -146632=>16409, -57358=>16409, -30780=>16410, -57359=>16410, -26436=>16411, -57360=>16411, -25311=>16412, -57361=>16412, -149811=>16413, -57362=>16413, -166314=>16414, -57363=>16414, -131744=>16415, -57364=>16415, -158643=>16416, -57365=>16416, -135941=>16417, -57366=>16417, -20395=>16418, -57367=>16418, -140525=>16419, -57368=>16419, -20488=>16420, -57369=>16420, -159017=>16421, -57370=>16421, -162436=>16422, -57371=>16422, -144896=>16423, -57372=>16423, -150193=>16424, -57373=>16424, -140563=>16425, -57374=>16425, -131966=>16427, -57376=>16427, -24484=>16428, -57377=>16428, -131968=>16429, -57378=>16429, -131911=>16430, -57379=>16430, -28379=>16431, -57380=>16431, -132127=>16432, -57381=>16432, -20702=>16433, -20737=>16434, -57383=>16434, -13434=>16435, -57384=>16435, -20750=>16436, -57385=>16436, -39020=>16437, -57386=>16437, -14147=>16438, -57387=>16438, -33814=>16439, -57388=>16439, -149924=>16440, -57389=>16440, -132231=>16441, -57390=>16441, -20832=>16442, -57391=>16442, -144308=>16443, -57392=>16443, -20842=>16444, -57393=>16444, -134143=>16445, -57394=>16445, -139516=>16446, -57395=>16446, -131813=>16447, -57396=>16447, -140592=>16448, -57397=>16448, -132494=>16449, -57398=>16449, -143923=>16450, -57399=>16450, -137603=>16451, -57400=>16451, -23426=>16452, -57401=>16452, -34685=>16453, -57402=>16453, -132531=>16454, -57403=>16454, -146585=>16455, -57404=>16455, -20914=>16456, -57405=>16456, -20920=>16457, -57406=>16457, -40244=>16458, -57407=>16458, -20937=>16459, -57408=>16459, -20943=>16460, -57409=>16460, -20945=>16461, -57410=>16461, -15580=>16462, -57411=>16462, -20947=>16463, -57412=>16463, -150182=>16464, -57413=>16464, -20915=>16465, -57414=>16465, -20973=>16468, -57417=>16468, -33741=>16469, -57418=>16469, -26942=>16470, -57419=>16470, -145197=>16471, -57420=>16471, -24443=>16472, -57421=>16472, -21003=>16473, -57422=>16473, -21030=>16474, -57423=>16474, -21052=>16475, -57424=>16475, -21173=>16476, -57425=>16476, -21079=>16477, -57426=>16477, -21140=>16478, -57427=>16478, -21177=>16479, -57428=>16479, -21189=>16480, -57429=>16480, -31765=>16481, -57430=>16481, -34114=>16482, -57431=>16482, -21216=>16483, -57432=>16483, -34317=>16484, -57433=>16484, -158483=>16485, -57434=>16485, -194601=>16486, -166622=>16487, -57436=>16487, -21833=>16488, -57437=>16488, -28377=>16489, -57438=>16489, -147328=>16490, -57439=>16490, -133460=>16491, -57440=>16491, -147436=>16492, -57441=>16492, -21299=>16493, -57442=>16493, -134114=>16495, -57444=>16495, -27851=>16496, -57445=>16496, -136998=>16497, -57446=>16497, -26651=>16498, -57447=>16498, -29653=>16499, -57448=>16499, -24650=>16500, -57449=>16500, -16042=>16501, -57450=>16501, -14540=>16502, -57451=>16502, -136936=>16503, -57452=>16503, -29149=>16504, -57453=>16504, -17570=>16505, -57454=>16505, -21357=>16506, -57455=>16506, -21364=>16507, -57456=>16507, -165547=>16508, -57457=>16508, -21374=>16509, -57458=>16509, -194610=>16510, -136598=>16511, -57460=>16511, -136723=>16512, -57461=>16512, -30694=>16513, -57462=>16513, -21395=>16514, -57463=>16514, -166555=>16515, -57464=>16515, -21408=>16516, -57465=>16516, -21419=>16517, -57466=>16517, -21422=>16518, -57467=>16518, -29607=>16519, -57468=>16519, -153458=>16520, -57469=>16520, -16217=>16521, -57470=>16521, -29596=>16522, -57471=>16522, -21441=>16523, -57472=>16523, -21445=>16524, -57473=>16524, -27721=>16525, -57474=>16525, -20041=>16526, -57475=>16526, -22526=>16527, -57476=>16527, -21465=>16528, -57477=>16528, -15019=>16529, -57478=>16529, -134031=>16530, -57479=>16530, -21472=>16531, -57480=>16531, -147435=>16532, -57481=>16532, -142755=>16533, -57482=>16533, -21494=>16534, -57483=>16534, -134263=>16535, -57484=>16535, -21523=>16536, -57485=>16536, -28793=>16537, -57486=>16537, -21803=>16538, -57487=>16538, -26199=>16539, -57488=>16539, -27995=>16540, -57489=>16540, -21613=>16541, -57490=>16541, -158547=>16542, -57491=>16542, -134516=>16543, -57492=>16543, -21853=>16544, -57493=>16544, -21647=>16545, -57494=>16545, -21668=>16546, -57495=>16546, -18342=>16547, -57496=>16547, -136973=>16548, -57497=>16548, -134877=>16549, -57498=>16549, -15796=>16550, -57499=>16550, -134477=>16551, -57500=>16551, -166332=>16552, -57501=>16552, -140952=>16553, -57502=>16553, -21831=>16554, -57503=>16554, -19693=>16555, -57504=>16555, -21551=>16556, -57505=>16556, -29719=>16557, -57506=>16557, -21894=>16558, -57507=>16558, -21929=>16559, -57508=>16559, -137431=>16561, -57510=>16561, -147514=>16562, -57511=>16562, -17746=>16563, -57512=>16563, -148533=>16564, -57513=>16564, -26291=>16565, -57514=>16565, -135348=>16566, -57515=>16566, -22071=>16567, -57516=>16567, -26317=>16568, -57517=>16568, -144010=>16569, -57518=>16569, -26276=>16570, -57519=>16570, -22093=>16572, -57521=>16572, -22095=>16573, -57522=>16573, -30961=>16574, -57523=>16574, -22257=>16575, -57524=>16575, -38791=>16576, -57525=>16576, -21502=>16577, -57526=>16577, -22272=>16578, -57527=>16578, -22255=>16579, -57528=>16579, -22253=>16580, -57529=>16580, -166758=>16581, -57530=>16581, -13859=>16582, -57531=>16582, -135759=>16583, -57532=>16583, -22342=>16584, -57533=>16584, -147877=>16585, -57534=>16585, -27758=>16586, -57535=>16586, -28811=>16587, -57536=>16587, -22338=>16588, -57537=>16588, -14001=>16589, -57538=>16589, -158846=>16590, -57539=>16590, -22502=>16591, -57540=>16591, -136214=>16592, -57541=>16592, -22531=>16593, -57542=>16593, -136276=>16594, -57543=>16594, -148323=>16595, -57544=>16595, -22566=>16596, -57545=>16596, -150517=>16597, -57546=>16597, -22559=>16598, -22698=>16599, -57548=>16599, -13665=>16600, -57549=>16600, -22752=>16601, -57550=>16601, -22748=>16602, -57551=>16602, -135740=>16603, -57552=>16603, -22779=>16604, -57553=>16604, -23551=>16605, -57554=>16605, -22339=>16606, -57555=>16606, -172368=>16607, -57556=>16607, -148088=>16608, -57557=>16608, -37843=>16609, -57558=>16609, -13729=>16610, -57559=>16610, -22815=>16611, -57560=>16611, -26790=>16612, -57561=>16612, -14019=>16613, -57562=>16613, -28249=>16614, -57563=>16614, -136766=>16615, -57564=>16615, -23076=>16616, -57565=>16616, -136850=>16618, -57567=>16618, -34053=>16619, -57568=>16619, -22985=>16620, -57569=>16620, -134478=>16621, -57570=>16621, -158849=>16622, -57571=>16622, -159018=>16623, -57572=>16623, -137180=>16624, -57573=>16624, -23001=>16625, -57574=>16625, -137211=>16626, -57575=>16626, -137138=>16627, -57576=>16627, -159142=>16628, -57577=>16628, -28017=>16629, -57578=>16629, -137256=>16630, -57579=>16630, -136917=>16631, -57580=>16631, -23033=>16632, -57581=>16632, -159301=>16633, -57582=>16633, -23211=>16634, -57583=>16634, -23139=>16635, -57584=>16635, -14054=>16636, -57585=>16636, -149929=>16637, -57586=>16637, -14088=>16639, -57588=>16639, -23190=>16640, -57589=>16640, -29797=>16641, -57590=>16641, -23251=>16642, -57591=>16642, -159649=>16643, -57592=>16643, -140628=>16644, -57593=>16644, -137489=>16645, -57595=>16645, -14130=>16646, -57596=>16646, -136888=>16647, -57597=>16647, -24195=>16648, -57598=>16648, -21200=>16649, -57599=>16649, -23414=>16650, -57600=>16650, -25992=>16651, -57601=>16651, -23420=>16652, -57602=>16652, -162318=>16653, -57603=>16653, -16388=>16654, -57604=>16654, -18525=>16655, -57605=>16655, -131588=>16656, -57606=>16656, -23509=>16657, -57607=>16657, -137780=>16658, -57609=>16658, -154060=>16659, -57610=>16659, -132517=>16660, -57611=>16660, -23539=>16661, -57612=>16661, -23453=>16662, -57613=>16662, -19728=>16663, -57614=>16663, -23557=>16664, -57615=>16664, -138052=>16665, -57616=>16665, -23571=>16666, -57617=>16666, -29646=>16667, -57618=>16667, -23572=>16668, -57619=>16668, -138405=>16669, -57620=>16669, -158504=>16670, -57621=>16670, -23625=>16671, -57622=>16671, -18653=>16672, -57623=>16672, -23685=>16673, -57624=>16673, -23785=>16674, -57625=>16674, -23791=>16675, -57626=>16675, -23947=>16676, -57627=>16676, -138745=>16677, -57628=>16677, -138807=>16678, -57629=>16678, -23824=>16679, -57630=>16679, -23832=>16680, -57631=>16680, -23878=>16681, -57632=>16681, -138916=>16682, -57633=>16682, -23738=>16683, -57634=>16683, -24023=>16684, -57635=>16684, -33532=>16685, -57636=>16685, -14381=>16686, -57637=>16686, -149761=>16687, -57638=>16687, -139337=>16688, -57639=>16688, -139635=>16689, -57640=>16689, -33415=>16690, -57641=>16690, -14390=>16691, -57642=>16691, -15298=>16692, -57643=>16692, -24110=>16693, -57644=>16693, -27274=>16694, -57645=>16694, -57647=>16696, -148668=>16697, -57648=>16697, -134355=>16698, -57649=>16698, -21414=>16699, -57650=>16699, -20151=>16700, -57651=>16700, -21416=>16702, -57653=>16702, -137073=>16703, -57654=>16703, -24073=>16704, -57655=>16704, -57656=>16705, -164994=>16706, -57657=>16706, -24313=>16707, -57658=>16707, -24315=>16708, -57659=>16708, -14496=>16709, -57660=>16709, -24316=>16710, -57661=>16710, -26686=>16711, -57662=>16711, -37915=>16712, -57663=>16712, -24333=>16713, -57664=>16713, -131521=>16714, -57665=>16714, -194708=>16715, -57666=>16715, -15070=>16716, -57667=>16716, -135994=>16717, -57669=>16717, -24378=>16718, -57670=>16718, -157832=>16719, -57671=>16719, -140240=>16720, -57672=>16720, -140401=>16721, -57674=>16721, -24419=>16722, -57675=>16722, -159342=>16723, -57677=>16723, -24434=>16724, -57678=>16724, -37696=>16725, -57679=>16725, -166454=>16726, -57680=>16726, -24487=>16727, -57681=>16727, -23990=>16728, -57682=>16728, -15711=>16729, -57683=>16729, -152144=>16730, -57684=>16730, -139114=>16731, -57685=>16731, -159992=>16732, -57686=>16732, -140904=>16733, -57687=>16733, -37334=>16734, -57688=>16734, -131742=>16735, -57689=>16735, -166441=>16736, -57690=>16736, -24625=>16737, -57691=>16737, -26245=>16738, -57692=>16738, -14691=>16739, -57694=>16739, -15815=>16740, -57695=>16740, -13881=>16741, -57696=>16741, -22416=>16742, -57697=>16742, -141236=>16743, -57698=>16743, -31089=>16744, -57699=>16744, -15936=>16745, -57700=>16745, -24734=>16746, -57701=>16746, -24810=>16748, -149890=>16749, -57704=>16749, -149903=>16750, -57705=>16750, -162387=>16751, -57706=>16751, -29860=>16752, -57707=>16752, -20705=>16753, -57708=>16753, -23200=>16754, -57709=>16754, -24932=>16755, -57710=>16755, -24898=>16756, -57712=>16756, -194726=>16757, -57713=>16757, -159442=>16758, -57714=>16758, -24961=>16759, -57715=>16759, -20980=>16760, -57716=>16760, -132694=>16761, -57717=>16761, -24967=>16762, -57718=>16762, -23466=>16763, -57719=>16763, -147383=>16764, -57720=>16764, -141407=>16765, -57721=>16765, -25043=>16766, -57722=>16766, -166813=>16767, -57723=>16767, -170333=>16768, -57724=>16768, -25040=>16769, -57725=>16769, -14642=>16770, -57726=>16770, -141696=>16771, -57727=>16771, -141505=>16772, -57728=>16772, -24611=>16773, -57729=>16773, -24924=>16774, -57730=>16774, -25886=>16775, -57731=>16775, -25483=>16776, -57732=>16776, -131352=>16777, -57733=>16777, -25285=>16778, -57734=>16778, -137072=>16779, -57735=>16779, -25301=>16780, -57736=>16780, -142861=>16781, -57737=>16781, -25452=>16782, -57738=>16782, -149983=>16783, -57739=>16783, -14871=>16784, -57740=>16784, -25656=>16785, -57741=>16785, -25592=>16786, -57742=>16786, -136078=>16787, -57743=>16787, -137212=>16788, -57744=>16788, -28554=>16789, -57746=>16789, -142902=>16790, -57747=>16790, -153373=>16792, -57750=>16792, -25825=>16793, -57751=>16793, -25829=>16794, -57752=>16794, -38011=>16795, -57753=>16795, -14950=>16796, -57754=>16796, -25658=>16797, -57755=>16797, -14935=>16798, -57756=>16798, -25933=>16799, -57757=>16799, -28438=>16800, -57758=>16800, -150056=>16801, -57759=>16801, -150051=>16802, -57760=>16802, -25989=>16803, -57761=>16803, -25965=>16804, -57762=>16804, -25951=>16805, -57763=>16805, -26037=>16807, -57765=>16807, -149824=>16808, -57766=>16808, -19255=>16809, -57767=>16809, -26065=>16810, -57768=>16810, -16600=>16811, -57769=>16811, -137257=>16812, -57770=>16812, -57771=>16813, -26083=>16814, -57772=>16814, -24543=>16815, -57773=>16815, -144384=>16816, -57774=>16816, -26136=>16817, -57775=>16817, -57776=>16818, -143863=>16818, -57777=>16819, -143864=>16819, -26180=>16820, -57778=>16820, -57779=>16821, -143780=>16821, -57780=>16822, -143781=>16822, -26187=>16823, -57781=>16823, -134773=>16824, -57782=>16824, -26215=>16825, -57783=>16825, -152038=>16826, -57784=>16826, -26227=>16827, -57785=>16827, -64018=>16828, -143921=>16829, -57788=>16829, -165364=>16830, -57789=>16830, -143816=>16831, -57790=>16831, -152339=>16832, -57791=>16832, -30661=>16833, -57792=>16833, -141559=>16834, -57793=>16834, -39332=>16835, -57794=>16835, -26370=>16836, -57795=>16836, -148380=>16837, -57796=>16837, -150049=>16838, -57797=>16838, -27130=>16839, -57799=>16839, -145346=>16840, -57800=>16840, -194779=>16841, -26471=>16842, -57802=>16842, -26466=>16843, -57803=>16843, -147917=>16844, -57804=>16844, -168173=>16845, -57805=>16845, -26583=>16846, -57806=>16846, -17641=>16847, -57807=>16847, -26658=>16848, -57808=>16848, -28240=>16849, -57809=>16849, -37436=>16850, -57810=>16850, -26625=>16851, -57811=>16851, -144358=>16852, -57812=>16852, -159136=>16853, -57813=>16853, -26717=>16854, -57814=>16854, -144495=>16855, -57815=>16855, -27105=>16856, -57816=>16856, -27147=>16857, -57817=>16857, -166623=>16858, -57818=>16858, -26995=>16859, -57819=>16859, -26819=>16860, -57820=>16860, -144845=>16861, -57821=>16861, -26881=>16862, -57822=>16862, -26880=>16863, -57823=>16863, -14849=>16864, -57825=>16864, -144956=>16865, -57826=>16865, -15232=>16866, -57827=>16866, -26540=>16867, -57828=>16867, -26977=>16868, -57829=>16868, -166474=>16869, -57830=>16869, -17148=>16870, -57831=>16870, -26934=>16871, -57832=>16871, -27032=>16872, -57833=>16872, -15265=>16873, -57834=>16873, -132041=>16874, -57835=>16874, -33635=>16875, -57836=>16875, -20624=>16876, -57837=>16876, -27129=>16877, -57838=>16877, -144985=>16878, -57839=>16878, -139562=>16879, -57840=>16879, -27205=>16880, -57841=>16880, -145155=>16881, -57842=>16881, -27293=>16882, -57843=>16882, -15347=>16883, -57844=>16883, -26545=>16884, -57845=>16884, -27336=>16885, -57846=>16885, -168348=>16886, -57847=>16886, -15373=>16887, -57848=>16887, -27421=>16888, -57849=>16888, -133411=>16889, -57850=>16889, -24798=>16890, -60308=>16890, -57851=>16890, -27445=>16891, -57852=>16891, -27508=>16892, -57853=>16892, -141261=>16893, -57854=>16893, -28341=>16894, -57855=>16894, -57856=>16895, -146139=>16895, -137560=>16897, -57858=>16897, -14144=>16898, -57859=>16898, -21537=>16899, -57860=>16899, -146266=>16900, -57861=>16900, -27617=>16901, -57862=>16901, -147196=>16902, -57863=>16902, -27612=>16903, -57864=>16903, -27703=>16904, -57865=>16904, -140427=>16905, -57866=>16905, -149745=>16906, -57867=>16906, -158545=>16907, -57868=>16907, -27738=>16908, -57869=>16908, -33318=>16909, -57870=>16909, -27769=>16910, -57871=>16910, -146876=>16911, -57872=>16911, -17605=>16912, -57873=>16912, -146877=>16913, -57874=>16913, -147876=>16914, -57875=>16914, -149772=>16915, -57876=>16915, -149760=>16916, -57877=>16916, -146633=>16917, -57878=>16917, -14053=>16918, -57879=>16918, -15595=>16919, -57880=>16919, -134450=>16920, -57881=>16920, -39811=>16921, -57882=>16921, -143865=>16922, -57883=>16922, -140433=>16923, -57884=>16923, -32655=>16924, -57885=>16924, -26679=>16925, -57886=>16925, -159013=>16926, -57887=>16926, -159137=>16927, -57888=>16927, -159211=>16928, -57889=>16928, -28054=>16929, -57890=>16929, -27996=>16930, -57891=>16930, -28284=>16931, -57892=>16931, -28420=>16932, -57893=>16932, -149887=>16933, -57894=>16933, -147589=>16934, -57895=>16934, -159346=>16935, -57896=>16935, -34099=>16936, -57897=>16936, -159604=>16937, -57898=>16937, -20935=>16938, -57899=>16938, -33838=>16941, -57902=>16941, -166689=>16942, -57903=>16942, -194824=>16943, -146991=>16944, -57905=>16944, -29779=>16945, -57906=>16945, -147330=>16946, -57907=>16946, -31180=>16947, -57908=>16947, -28239=>16948, -57909=>16948, -23185=>16949, -57910=>16949, -143435=>16950, -57911=>16950, -28664=>16951, -57912=>16951, -14093=>16952, -57913=>16952, -28573=>16953, -57914=>16953, -146992=>16954, -57915=>16954, -28410=>16955, -57916=>16955, -136343=>16956, -57917=>16956, -147517=>16957, -57918=>16957, -17749=>16958, -57919=>16958, -37872=>16959, -57920=>16959, -28484=>16960, -57921=>16960, -28508=>16961, -57922=>16961, -15694=>16962, -57923=>16962, -28532=>16963, -57924=>16963, -168304=>16964, -57925=>16964, -15675=>16965, -57926=>16965, -28575=>16966, -57927=>16966, -147780=>16967, -57928=>16967, -28627=>16968, -57929=>16968, -147601=>16969, -57930=>16969, -147797=>16970, -57931=>16970, -147513=>16971, -57932=>16971, -147440=>16972, -57933=>16972, -147380=>16973, -57934=>16973, -147775=>16974, -57935=>16974, -20959=>16975, -57936=>16975, -57937=>16976, -147798=>16976, -57938=>16977, -147799=>16977, -147776=>16978, -57939=>16978, -156125=>16979, -57940=>16979, -28747=>16980, -57941=>16980, -28798=>16981, -57942=>16981, -28839=>16982, -57943=>16982, -28876=>16984, -57945=>16984, -28885=>16985, -57946=>16985, -28886=>16986, -57947=>16986, -28895=>16987, -57948=>16987, -16644=>16988, -57949=>16988, -15848=>16989, -57950=>16989, -29108=>16990, -57951=>16990, -29078=>16991, -57952=>16991, -148087=>16992, -57953=>16992, -28971=>16993, -57954=>16993, -28997=>16994, -57955=>16994, -23176=>16995, -57956=>16995, -29002=>16996, -57957=>16996, -64072=>16997, -148325=>16998, -57960=>16998, -29007=>16999, -57961=>16999, -37730=>17000, -57962=>17000, -148161=>17001, -57963=>17001, -28972=>17002, -57964=>17002, -148570=>17003, -57965=>17003, -150055=>17004, -57966=>17004, -150050=>17005, -57967=>17005, -29114=>17006, -57968=>17006, -166888=>17007, -57969=>17007, -28861=>17008, -57970=>17008, -29198=>17009, -57971=>17009, -37954=>17010, -57972=>17010, -29205=>17011, -57973=>17011, -22801=>17012, -57974=>17012, -37955=>17013, -57975=>17013, -29220=>17014, -57976=>17014, -37697=>17015, -57977=>17015, -153093=>17016, -57978=>17016, -29230=>17017, -57979=>17017, -29248=>17018, -57980=>17018, -149876=>17019, -57981=>17019, -26813=>17020, -57982=>17020, -29269=>17021, -57983=>17021, -29271=>17022, -57984=>17022, -15957=>17023, -57985=>17023, -143428=>17024, -57986=>17024, -26637=>17025, -57987=>17025, -28477=>17026, -57988=>17026, -29314=>17027, -57989=>17027, -29483=>17029, -57991=>17029, -149539=>17030, -57992=>17030, -165931=>17031, -57993=>17031, -18669=>17032, -57994=>17032, -165892=>17033, -57995=>17033, -29480=>17034, -57996=>17034, -29486=>17035, -57997=>17035, -29647=>17036, -57998=>17036, -29610=>17037, -57999=>17037, -134202=>17038, -58000=>17038, -158254=>17039, -58001=>17039, -29641=>17040, -58002=>17040, -29769=>17041, -58003=>17041, -147938=>17042, -58004=>17042, -136935=>17043, -58005=>17043, -150052=>17044, -58006=>17044, -26147=>17045, -58007=>17045, -14021=>17046, -58008=>17046, -149943=>17047, -58009=>17047, -149901=>17048, -58010=>17048, -150011=>17049, -58011=>17049, -29687=>17050, -58012=>17050, -29717=>17051, -58013=>17051, -26883=>17052, -58014=>17052, -150054=>17053, -58015=>17053, -29753=>17054, -58016=>17054, -16087=>17055, -58018=>17055, -194863=>17056, -141485=>17057, -58020=>17057, -29792=>17058, -58021=>17058, -167602=>17059, -58022=>17059, -29767=>17060, -58023=>17060, -29668=>17061, -58024=>17061, -29814=>17062, -58025=>17062, -33721=>17063, -58026=>17063, -29804=>17064, -58027=>17064, -29812=>17065, -58029=>17065, -37873=>17066, -58030=>17066, -27180=>17067, -58031=>17067, -29826=>17068, -58032=>17068, -18771=>17069, -58033=>17069, -150156=>17070, -58034=>17070, -147807=>17071, -58035=>17071, -150137=>17072, -58036=>17072, -166799=>17073, -58037=>17073, -23366=>17074, -58038=>17074, -166915=>17075, -58039=>17075, -137374=>17076, -58040=>17076, -29896=>17077, -58041=>17077, -137608=>17078, -58042=>17078, -29966=>17079, -58043=>17079, -29982=>17080, -58045=>17080, -167641=>17081, -58046=>17081, -137803=>17082, -58047=>17082, -23511=>17083, -58048=>17083, -167596=>17084, -58049=>17084, -37765=>17085, -58050=>17085, -30029=>17086, -58051=>17086, -30026=>17087, -58052=>17087, -30055=>17088, -58053=>17088, -30062=>17089, -58054=>17089, -151426=>17090, -58055=>17090, -16132=>17091, -58056=>17091, -150803=>17092, -58057=>17092, -30094=>17093, -58058=>17093, -29789=>17094, -58059=>17094, -30110=>17095, -58060=>17095, -30132=>17096, -58061=>17096, -30210=>17097, -58062=>17097, -30252=>17098, -58063=>17098, -30289=>17099, -58064=>17099, -30287=>17100, -58065=>17100, -30319=>17101, -58066=>17101, -58067=>17102, -156661=>17103, -58068=>17103, -30352=>17104, -58069=>17104, -33263=>17105, -58070=>17105, -14328=>17106, -58071=>17106, -157969=>17107, -58072=>17107, -157966=>17108, -58073=>17108, -30369=>17109, -58074=>17109, -30373=>17110, -58075=>17110, -30391=>17111, -58076=>17111, -30412=>17112, -58077=>17112, -159647=>17113, -58078=>17113, -33890=>17114, -58079=>17114, -151709=>17115, -58080=>17115, -151933=>17116, -58081=>17116, -138780=>17117, -58082=>17117, -30494=>17118, -58083=>17118, -30502=>17119, -58084=>17119, -30528=>17120, -58085=>17120, -25775=>17121, -58086=>17121, -152096=>17122, -58087=>17122, -30552=>17123, -58088=>17123, -144044=>17124, -58089=>17124, -30639=>17125, -58090=>17125, -166244=>17126, -58091=>17126, -166248=>17127, -58092=>17127, -136897=>17128, -58093=>17128, -30708=>17129, -58094=>17129, -26826=>17131, -58098=>17131, -30895=>17132, -58099=>17132, -30919=>17133, -58100=>17133, -30931=>17134, -58101=>17134, -38565=>17135, -58102=>17135, -31022=>17136, -58103=>17136, -153056=>17137, -58104=>17137, -30935=>17138, -58105=>17138, -31028=>17139, -58106=>17139, -30897=>17140, -58107=>17140, -161292=>17141, -58108=>17141, -36792=>17142, -58109=>17142, -34948=>17143, -58110=>17143, -140828=>17144, -58113=>17144, -31110=>17145, -58114=>17145, -35072=>17146, -58115=>17146, -26882=>17147, -58116=>17147, -31104=>17148, -58117=>17148, -153687=>17149, -58118=>17149, -31133=>17150, -58119=>17150, -162617=>17151, -58120=>17151, -31036=>17152, -58121=>17152, -31145=>17153, -58122=>17153, -28202=>17154, -58123=>17154, -160038=>17155, -58124=>17155, -16040=>17156, -58125=>17156, -31174=>17157, -58126=>17157, -168205=>17158, -58127=>17158, -31188=>17159, -58128=>17159, -21797=>17161, -62526=>17161, -134210=>17163, -62528=>17163, -134421=>17164, -62529=>17164, -151851=>17165, -62530=>17165, -21904=>17166, -62531=>17166, -142534=>17167, -62532=>17167, -14828=>17168, -62533=>17168, -131905=>17169, -62534=>17169, -36422=>17170, -62535=>17170, -150968=>17171, -62536=>17171, -169189=>17172, -62537=>17172, -164030=>17174, -62539=>17174, -30586=>17175, -62540=>17175, -142392=>17176, -62541=>17176, -14900=>17177, -62542=>17177, -18389=>17178, -62543=>17178, -164189=>17179, -62544=>17179, -158194=>17180, -62545=>17180, -151018=>17181, -62546=>17181, -25821=>17182, -62547=>17182, -134524=>17183, -62548=>17183, -135092=>17184, -62549=>17184, -134357=>17185, -62550=>17185, -25741=>17187, -62552=>17187, -36478=>17188, -62553=>17188, -134806=>17189, -62554=>17189, -135012=>17191, -62556=>17191, -142505=>17192, -62557=>17192, -164438=>17193, -62558=>17193, -148691=>17194, -62559=>17194, -134470=>17196, -62561=>17196, -170573=>17197, -62562=>17197, -164073=>17198, -62563=>17198, -18420=>17199, -62564=>17199, -151207=>17200, -62565=>17200, -142530=>17201, -62566=>17201, -39602=>17202, -62567=>17202, -14951=>17203, -62568=>17203, -169460=>17204, -62569=>17204, -16365=>17205, -62570=>17205, -13574=>17206, -62571=>17206, -152263=>17207, -62572=>17207, -169940=>17208, -62573=>17208, -142660=>17210, -62575=>17210, -40302=>17211, -62576=>17211, -38933=>17212, -62577=>17212, -17369=>17214, -62579=>17214, -25780=>17216, -62581=>17216, -21731=>17217, -62582=>17217, -62584=>17219, -142282=>17219, -14843=>17221, -62586=>17221, -157402=>17223, -62588=>17223, -157462=>17224, -62589=>17224, -162208=>17225, -62590=>17225, -25834=>17226, -62591=>17226, -151634=>17227, -62592=>17227, -134211=>17228, -62593=>17228, -36456=>17229, -62594=>17229, -166732=>17231, -62596=>17231, -132913=>17232, -62597=>17232, -18443=>17234, -62599=>17234, -131497=>17235, -62600=>17235, -16378=>17236, -62601=>17236, -22643=>17237, -62602=>17237, -142733=>17238, -62603=>17238, -148936=>17240, -62605=>17240, -132348=>17241, -62606=>17241, -155799=>17242, -62607=>17242, -134988=>17243, -62608=>17243, -21881=>17245, -62610=>17245, -17338=>17247, -62612=>17247, -19124=>17249, -62614=>17249, -141926=>17250, -62615=>17250, -135325=>17251, -62616=>17251, -33194=>17252, -62617=>17252, -39157=>17253, -62618=>17253, -134556=>17254, -62619=>17254, -25465=>17255, -62620=>17255, -14846=>17256, -62621=>17256, -141173=>17257, -62622=>17257, -36288=>17258, -62623=>17258, -22177=>17259, -62624=>17259, -25724=>17260, -62625=>17260, -15939=>17261, -62626=>17261, -173569=>17263, -62628=>17263, -134665=>17264, -62629=>17264, -142031=>17265, -62630=>17265, -135368=>17268, -62633=>17268, -145858=>17269, -62634=>17269, -14738=>17270, -62635=>17270, -14854=>17271, -62636=>17271, -164507=>17272, -62637=>17272, -13688=>17273, -62638=>17273, -155209=>17274, -62639=>17274, -139463=>17275, -62640=>17275, -142514=>17278, -62643=>17278, -169760=>17279, -62644=>17279, -13500=>17280, -62645=>17280, -27709=>17281, -62646=>17281, -151099=>17282, -62647=>17282, -161140=>17285, -62650=>17285, -142987=>17286, -62651=>17286, -139784=>17287, -62652=>17287, -173659=>17288, -62653=>17288, -167117=>17289, -62654=>17289, -134778=>17290, -62655=>17290, -134196=>17291, -62656=>17291, -161337=>17292, -62683=>17292, -142286=>17293, -62684=>17293, -62687=>17294, -142417=>17294, -14872=>17295, -62689=>17295, -62691=>17296, -135367=>17296, -62693=>17297, -173618=>17297, -167122=>17298, -62695=>17298, -167321=>17299, -62696=>17299, -167114=>17300, -62697=>17300, -38314=>17301, -62698=>17301, -62706=>17303, -161630=>17303, -28992=>17304, -62708=>17304, -20822=>17306, -62385=>17306, -20222=>17307, -20616=>17308, -62487=>17308, -13459=>17310, -62489=>17310, -20870=>17311, -62491=>17311, -24130=>17312, -63037=>17312, -20997=>17313, -62495=>17313, -21031=>17314, -62436=>17314, -21113=>17315, -62497=>17315, -194600=>17316, -13651=>17317, -62504=>17317, -21442=>17318, -62505=>17318, -21343=>17319, -62715=>17319, -21823=>17321, -62520=>17321, -21976=>17323, -59986=>17323, -13789=>17324, -62722=>17324, -22049=>17325, -63067=>17325, -22100=>17327, -60044=>17327, -60148=>17328, -135291=>17328, -60153=>17330, -135379=>17330, -61095=>17332, -135934=>17332, -14265=>17335, -60104=>17335, -23745=>17336, -61099=>17336, -23829=>17337, -63066=>17337, -23894=>17338, -63030=>17338, -14392=>17339, -63036=>17339, -20097=>17340, -62477=>17340, -24253=>17341, -63038=>17341, -14612=>17342, -63042=>17342, -25017=>17343, -63050=>17343, -25232=>17344, -63054=>17344, -25368=>17345, -63056=>17345, -25690=>17346, -63063=>17346, -25745=>17347, -62381=>17347, -33133=>17348, -62709=>17348, -33156=>17349, -59922=>17349, -33171=>17350, -59924=>17350, -26624=>17351, -63080=>17351, -15292=>17352, -63093=>17352, -29327=>17353, -60517=>17353, -29389=>17354, -59781=>17354, -149487=>17355, -29497=>17356, -59785=>17356, -30018=>17357, -59811=>17357, -30172=>17358, -59817=>17358, -16320=>17359, -59818=>17359, -60278=>17360, -151205=>17360, -16343=>17361, -59820=>17361, -30336=>17363, -30348=>17364, -59824=>17364, -151388=>17364, -16552=>17365, -59845=>17365, -30777=>17366, -59846=>17366, -16643=>17367, -59855=>17367, -31377=>17368, -59863=>17368, -31771=>17369, -59876=>17369, -31981=>17370, -59884=>17370, -32659=>17371, -62658=>17371, -32686=>17372, -59892=>17372, -33535=>17374, -59936=>17374, -22623=>17375, -59981=>17375, -34482=>17376, -59960=>17376, -17836=>17377, -34699=>17378, -59963=>17378, -35143=>17379, -59969=>17379, -35369=>17381, -59972=>17381, -36465=>17383, -59988=>17383, -60484=>17384, -164233=>17384, -36528=>17385, -59990=>17385, -37214=>17387, -62443=>17387, -37260=>17388, -62441=>17388, -39182=>17389, -60051=>17389, -39196=>17390, -60054=>17390, -39809=>17393, -60066=>17393, -40384=>17394, -60080=>17394, -40339=>17395, -60078=>17395, -40620=>17396, -60085=>17396, -19857=>17397, -60540=>17397, -37818=>17399, -40571=>17400, -60084=>17400, -28809=>17401, -63148=>17401, -29512=>17402, -59788=>17402, -31129=>17404, -59858=>17404, -36791=>17405, -59997=>17405, -39234=>17407, -60056=>17407, -8364=>17601, -12443=>17606, -63518=>17606, -12444=>17607, -63519=>17607, -11904=>17608, -63520=>17608, -12736=>17609, -62211=>17609, -12737=>17610, -62212=>17610, -12738=>17611, -62213=>17611, -12739=>17612, -62214=>17612, -12740=>17613, -62215=>17613, -131340=>17614, -62216=>17614, -12741=>17615, -62217=>17615, -131281=>17616, -62218=>17616, -131277=>17617, -62219=>17617, -12742=>17618, -62220=>17618, -12743=>17619, -62221=>17619, -131275=>17620, -62222=>17620, -139240=>17621, -62223=>17621, -12744=>17622, -62224=>17622, -131274=>17623, -62225=>17623, -12745=>17624, -62226=>17624, -12746=>17625, -62227=>17625, -12747=>17626, -62228=>17626, -12748=>17627, -62229=>17627, -131342=>17628, -62230=>17628, -12749=>17629, -62231=>17629, -12750=>17630, -62232=>17630, -62776=>17631, -62777=>17632, -138177=>17633, -62778=>17633, -194680=>17634, -62779=>17634, -12205=>17635, -38737=>17635, -62780=>17635, -131206=>17636, -62781=>17636, -20059=>17637, -62782=>17637, -20155=>17638, -62783=>17638, -13630=>17639, -62784=>17639, -23587=>17640, -62785=>17640, -24401=>17641, -62786=>17641, -24516=>17642, -62787=>17642, -14586=>17643, -62788=>17643, -25164=>17644, -62789=>17644, -25909=>17645, -62790=>17645, -27514=>17646, -62791=>17646, -27701=>17647, -62792=>17647, -27706=>17648, -62793=>17648, -28780=>17649, -62794=>17649, -29227=>17650, -62795=>17650, -20012=>17651, -62796=>17651, -29357=>17652, -62797=>17652, -149737=>17653, -62798=>17653, -32594=>17654, -62799=>17654, -31035=>17655, -62800=>17655, -31993=>17656, -62801=>17656, -32595=>17657, -62802=>17657, -156266=>17658, -62803=>17658, -13505=>17659, -62804=>17659, -156491=>17660, -62806=>17660, -32770=>17661, -62807=>17661, -32896=>17662, -62808=>17662, -157202=>17663, -62809=>17663, -158033=>17664, -62810=>17664, -21341=>17665, -62811=>17665, -34916=>17666, -62812=>17666, -35265=>17667, -62813=>17667, -161970=>17668, -62814=>17668, -35744=>17669, -62815=>17669, -36125=>17670, -62816=>17670, -38021=>17671, -62817=>17671, -38264=>17672, -62818=>17672, -38271=>17673, -62819=>17673, -38376=>17674, -62820=>17674, -167439=>17675, -62821=>17675, -38886=>17676, -62822=>17676, -39029=>17677, -62823=>17677, -39118=>17678, -62824=>17678, -39134=>17679, -62825=>17679, -39267=>17680, -62826=>17680, -170000=>17681, -62827=>17681, -40060=>17682, -62828=>17682, -40479=>17683, -62829=>17683, -40644=>17684, -62830=>17684, -27503=>17685, -62831=>17685, -63751=>17686, -62832=>17686, -20023=>17687, -62833=>17687, -131207=>17688, -62834=>17688, -38429=>17689, -62835=>17689, -25143=>17690, -62836=>17690, -38050=>17691, -62837=>17691, -11908=>17692, -63521=>17692, -11910=>17693, -63522=>17693, -11911=>17694, -63523=>17694, -11912=>17695, -63524=>17695, -11914=>17696, -63525=>17696, -11916=>17697, -63526=>17697, -11917=>17698, -63527=>17698, -11925=>17699, -63528=>17699, -11932=>17700, -63529=>17700, -11941=>17701, -63531=>17701, -11943=>17702, -63532=>17702, -11946=>17703, -63533=>17703, -11948=>17704, -63534=>17704, -11950=>17705, -63535=>17705, -11958=>17706, -63536=>17706, -11964=>17707, -63537=>17707, -11966=>17708, -63538=>17708, -11978=>17709, -63540=>17709, -11980=>17710, -63541=>17710, -11981=>17711, -63542=>17711, -11983=>17712, -63543=>17712, -11990=>17713, -63544=>17713, -11991=>17714, -63545=>17714, -11998=>17715, -63546=>17715, -172969=>17716, -62368=>17716, -135493=>17717, -62369=>17717, -25866=>17718, -62371=>17718, -20029=>17719, -62374=>17719, -28381=>17720, -62375=>17720, -40270=>17721, -62376=>17721, -37343=>17722, -62377=>17722, -62380=>17723, -161589=>17723, -20250=>17724, -62382=>17724, -20264=>17725, -62383=>17725, -20392=>17726, -62384=>17726, -20852=>17727, -62386=>17727, -20892=>17728, -62387=>17728, -20964=>17729, -62388=>17729, -21153=>17730, -62389=>17730, -21160=>17731, -62390=>17731, -21307=>17732, -62391=>17732, -21326=>17733, -62392=>17733, -21457=>17734, -62393=>17734, -21464=>17735, -62394=>17735, -22242=>17736, -62395=>17736, -22768=>17737, -62396=>17737, -22788=>17738, -62397=>17738, -22791=>17739, -62398=>17739, -22834=>17740, -62399=>17740, -22836=>17741, -62400=>17741, -23398=>17742, -62401=>17742, -23454=>17743, -62402=>17743, -23455=>17744, -62403=>17744, -23706=>17745, -62404=>17745, -24198=>17746, -62405=>17746, -24635=>17747, -62406=>17747, -25993=>17748, -62407=>17748, -26622=>17749, -62408=>17749, -26628=>17750, -62409=>17750, -26725=>17751, -62410=>17751, -27982=>17752, -62411=>17752, -28860=>17753, -62412=>17753, -30005=>17754, -62413=>17754, -32420=>17755, -62414=>17755, -32428=>17756, -62415=>17756, -32442=>17757, -62416=>17757, -32455=>17758, -62417=>17758, -32463=>17759, -62418=>17759, -32479=>17760, -62419=>17760, -32518=>17761, -62420=>17761, -32567=>17762, -62421=>17762, -33402=>17763, -62422=>17763, -33487=>17764, -62423=>17764, -33647=>17765, -62424=>17765, -35270=>17766, -62425=>17766, -35774=>17767, -62426=>17767, -35810=>17768, -62427=>17768, -36710=>17769, -62428=>17769, -36711=>17770, -62429=>17770, -36718=>17771, -62430=>17771, -29713=>17772, -62431=>17772, -31996=>17773, -62432=>17773, -32205=>17774, -62433=>17774, -26950=>17775, -62434=>17775, -31433=>17776, -62435=>17776, -30904=>17777, -62442=>17777, -32956=>17778, -62444=>17778, -36107=>17779, -62446=>17779, -33014=>17780, -62447=>17780, -133607=>17781, -62448=>17781, -32927=>17782, -62451=>17782, -40647=>17783, -62452=>17783, -19661=>17784, -62453=>17784, -40393=>17785, -62454=>17785, -40460=>17786, -62455=>17786, -19518=>17787, -62456=>17787, -171510=>17788, -62457=>17788, -159758=>17789, -62458=>17789, -40458=>17790, -62459=>17790, -172339=>17791, -62460=>17791, -13761=>17792, -62461=>17792, -28314=>17793, -62463=>17793, -33342=>17794, -62464=>17794, -29977=>17795, -62465=>17795, -18705=>17796, -62467=>17796, -39532=>17797, -62468=>17797, -39567=>17798, -62469=>17798, -40857=>17799, -62470=>17799, -31111=>17800, -62471=>17800, -164972=>17801, -62472=>17801, -138698=>17802, -62473=>17802, -132560=>17803, -62474=>17803, -142054=>17804, -62475=>17804, -20004=>17805, -62476=>17805, -20096=>17806, -62478=>17806, -20103=>17807, -62479=>17807, -20159=>17808, -62480=>17808, -20203=>17809, -62481=>17809, -20279=>17810, -62482=>17810, -13388=>17811, -62483=>17811, -20413=>17812, -62484=>17812, -15944=>17813, -62485=>17813, -20483=>17814, -62486=>17814, -13437=>17815, -62488=>17815, -13477=>17816, -62490=>17816, -22789=>17817, -62492=>17817, -20955=>17818, -62493=>17818, -20988=>17819, -62494=>17819, -20105=>17820, -62496=>17820, -21136=>17821, -62498=>17821, -21287=>17822, -62499=>17822, -13767=>17823, -62500=>17823, -21417=>17824, -62501=>17824, -13649=>17825, -62502=>17825, -21424=>17826, -62503=>17826, -21539=>17827, -62506=>17827, -13677=>17828, -62507=>17828, -13682=>17829, -62508=>17829, -13953=>17830, -62509=>17830, -21651=>17831, -62510=>17831, -21667=>17832, -62511=>17832, -21684=>17833, -62512=>17833, -21689=>17834, -62513=>17834, -21712=>17835, -62514=>17835, -21743=>17836, -62515=>17836, -21784=>17837, -62516=>17837, -21795=>17838, -62517=>17838, -21800=>17839, -62518=>17839, -13720=>17840, -62519=>17840, -13733=>17841, -62521=>17841, -13759=>17842, -62522=>17842, -21975=>17843, -62523=>17843, -13765=>17844, -62524=>17844, -163204=>17845, -62525=>17845, -16467=>17846, -62538=>17846, -62551=>17847, -135412=>17847, -62555=>17848, -134155=>17848, -62574=>17849, -161992=>17849, -62580=>17850, -155813=>17850, -62583=>17851, -142668=>17851, -62585=>17852, -135287=>17852, -62587=>17853, -135279=>17853, -62595=>17854, -139681=>17854, -62609=>17855, -134550=>17855, -16571=>17856, -62611=>17856, -62631=>17857, -142537=>17857, -22098=>17858, -62641=>17858, -134961=>17859, -62642=>17859, -62657=>17860, -157724=>17860, -135375=>17861, -62659=>17861, -141315=>17862, -62660=>17862, -141625=>17863, -62661=>17863, -13819=>17864, -62662=>17864, -152035=>17865, -62663=>17865, -134796=>17866, -62664=>17866, -135053=>17867, -62665=>17867, -134826=>17868, -62666=>17868, -16275=>17869, -62667=>17869, -134960=>17870, -62668=>17870, -134471=>17871, -62669=>17871, -135503=>17872, -62670=>17872, -134732=>17873, -62671=>17873, -134827=>17874, -62673=>17874, -134057=>17875, -62674=>17875, -134472=>17876, -62675=>17876, -135360=>17877, -62676=>17877, -135485=>17878, -62677=>17878, -16377=>17879, -62678=>17879, -140950=>17880, -62679=>17880, -25650=>17881, -62680=>17881, -135085=>17882, -62681=>17882, -144372=>17883, -62682=>17883, -62685=>17884, -134526=>17884, -62686=>17885, -134527=>17885, -62688=>17886, -142421=>17886, -62690=>17887, -134808=>17887, -62692=>17888, -134958=>17888, -62694=>17889, -158544=>17889, -21708=>17890, -62699=>17890, -33476=>17891, -62700=>17891, -21945=>17892, -62701=>17892, -171715=>17893, -62703=>17893, -39974=>17894, -62704=>17894, -39606=>17895, -62705=>17895, -62707=>17896, -142830=>17896, -33004=>17897, -62710=>17897, -23580=>17898, -62711=>17898, -157042=>17899, -62712=>17899, -33076=>17900, -62713=>17900, -14231=>17901, -62714=>17901, -164029=>17902, -62716=>17902, -37302=>17903, -62717=>17903, -134906=>17904, -62718=>17904, -134671=>17905, -62719=>17905, -134775=>17906, -62720=>17906, -134907=>17907, -62721=>17907, -151019=>17908, -62723=>17908, -13833=>17909, -62724=>17909, -134358=>17910, -62725=>17910, -22191=>17911, -62726=>17911, -141237=>17912, -62727=>17912, -135369=>17913, -62728=>17913, -134672=>17914, -62729=>17914, -134776=>17915, -62730=>17915, -135288=>17916, -62731=>17916, -135496=>17917, -62732=>17917, -164359=>17918, -62733=>17918, -136277=>17919, -62734=>17919, -134777=>17920, -62735=>17920, -151120=>17921, -62736=>17921, -142756=>17922, -62737=>17922, -23124=>17923, -62738=>17923, -62739=>17924, -135197=>17924, -62740=>17925, -135198=>17925, -62741=>17926, -135413=>17926, -62742=>17927, -135414=>17927, -22428=>17928, -62743=>17928, -134673=>17929, -62744=>17929, -161428=>17930, -62745=>17930, -164557=>17931, -62746=>17931, -135093=>17932, -62747=>17932, -134779=>17933, -62748=>17933, -151934=>17934, -62749=>17934, -14083=>17935, -62750=>17935, -135094=>17936, -62751=>17936, -135552=>17937, -62752=>17937, -152280=>17938, -62753=>17938, -172733=>17939, -62754=>17939, -149978=>17940, -62755=>17940, -137274=>17941, -62756=>17941, -147831=>17942, -62757=>17942, -164476=>17943, -62758=>17943, -22681=>17944, -62759=>17944, -21096=>17945, -62760=>17945, -13850=>17946, -62761=>17946, -153405=>17947, -62762=>17947, -31666=>17948, -62763=>17948, -23400=>17949, -62764=>17949, -18432=>17950, -62765=>17950, -19244=>17951, -62766=>17951, -40743=>17952, -62767=>17952, -18919=>17953, -62768=>17953, -39967=>17954, -62769=>17954, -39821=>17955, -62770=>17955, -154484=>17956, -62771=>17956, -143677=>17957, -62772=>17957, -22011=>17958, -62773=>17958, -13810=>17959, -62774=>17959, -22153=>17960, -62775=>17960, -23870=>17961, -63028=>17961, -23880=>17962, -63029=>17962, -15868=>17963, -63031=>17963, -14351=>17964, -63032=>17964, -23972=>17965, -63033=>17965, -23993=>17966, -63034=>17966, -14368=>17967, -63035=>17967, -24357=>17968, -63039=>17968, -24451=>17969, -63040=>17969, -14600=>17970, -63041=>17970, -14655=>17971, -63043=>17971, -14669=>17972, -63044=>17972, -24791=>17973, -63045=>17973, -24893=>17974, -63046=>17974, -23781=>17975, -63047=>17975, -14729=>17976, -63048=>17976, -25015=>17977, -63049=>17977, -25039=>17978, -63051=>17978, -14776=>17979, -63052=>17979, -25132=>17980, -63053=>17980, -25317=>17981, -63055=>17981, -14840=>17982, -63057=>17982, -22193=>17983, -63058=>17983, -14851=>17984, -63059=>17984, -25570=>17985, -63060=>17985, -25595=>17986, -63061=>17986, -25607=>17987, -63062=>17987, -14923=>17988, -63064=>17988, -25792=>17989, -63065=>17989, -40863=>17990, -63068=>17990, -14999=>17991, -63069=>17991, -25990=>17992, -63070=>17992, -15037=>17993, -63071=>17993, -26111=>17994, -63072=>17994, -26195=>17995, -63073=>17995, -15090=>17996, -63074=>17996, -26258=>17997, -63075=>17997, -15138=>17998, -63076=>17998, -26390=>17999, -63077=>17999, -15170=>18000, -63078=>18000, -26532=>18001, -63079=>18001, -15192=>18002, -63081=>18002, -26698=>18003, -63082=>18003, -26756=>18004, -63083=>18004, -15218=>18005, -63084=>18005, -15217=>18006, -63085=>18006, -15227=>18007, -63086=>18007, -26889=>18008, -63087=>18008, -26947=>18009, -63088=>18009, -29276=>18010, -63089=>18010, -26980=>18011, -63090=>18011, -27039=>18012, -63091=>18012, -27013=>18013, -63092=>18013, -27094=>18014, -63094=>18014, -15325=>18015, -63095=>18015, -27237=>18016, -63096=>18016, -27252=>18017, -63097=>18017, -27249=>18018, -63098=>18018, -27266=>18019, -63099=>18019, -15340=>18020, -63100=>18020, -27289=>18021, -63101=>18021, -15346=>18022, -63102=>18022, -27307=>18023, -63103=>18023, -27317=>18024, -63104=>18024, -27348=>18025, -63105=>18025, -27382=>18026, -63106=>18026, -27521=>18027, -63107=>18027, -27585=>18028, -63108=>18028, -27626=>18029, -63109=>18029, -27765=>18030, -63110=>18030, -27818=>18031, -63111=>18031, -15563=>18032, -63112=>18032, -27906=>18033, -63113=>18033, -27910=>18034, -63114=>18034, -27942=>18035, -63115=>18035, -28033=>18036, -63116=>18036, -15599=>18037, -63117=>18037, -28068=>18038, -63118=>18038, -28081=>18039, -63119=>18039, -28181=>18040, -63120=>18040, -28184=>18041, -63121=>18041, -28201=>18042, -63122=>18042, -28294=>18043, -63123=>18043, -166336=>18044, -63124=>18044, -28347=>18045, -63125=>18045, -28386=>18046, -63126=>18046, -28378=>18047, -63127=>18047, -40831=>18048, -63128=>18048, -28392=>18049, -63129=>18049, -28393=>18050, -63130=>18050, -28452=>18051, -63131=>18051, -28468=>18052, -63132=>18052, -15686=>18053, -63133=>18053, -147265=>18054, -63134=>18054, -28545=>18055, -63135=>18055, -28606=>18056, -63136=>18056, -15722=>18057, -63137=>18057, -15733=>18058, -63138=>18058, -29111=>18059, -63139=>18059, -23705=>18060, -63140=>18060, -15754=>18061, -63141=>18061, -28716=>18062, -63142=>18062, -15761=>18063, -63143=>18063, -28752=>18064, -63144=>18064, -28756=>18065, -63145=>18065, -28783=>18066, -63146=>18066, -28799=>18067, -63147=>18067, -131877=>18068, -63149=>18068, -17345=>18069, -63150=>18069, -13809=>18070, -63151=>18070, -134872=>18071, -63152=>18071, -13902=>18072, -58134=>18072, -15789=>18073, -58172=>18073, -154725=>18074, -58173=>18074, -26237=>18075, -58183=>18075, -31860=>18076, -58188=>18076, -29837=>18077, -58197=>18077, -32402=>18078, -58215=>18078, -17667=>18079, -58232=>18079, -58260=>18080, -151480=>18080, -58270=>18081, -133901=>18081, -58277=>18082, -158474=>18082, -13438=>18083, -58311=>18083, -58317=>18084, -143087=>18084, -58325=>18085, -146613=>18085, -58343=>18086, -159385=>18086, -34673=>18087, -58364=>18087, -25537=>18088, -58385=>18088, -30583=>18089, -58387=>18089, -35210=>18090, -58390=>18090, -58406=>18091, -147343=>18091, -35660=>18092, -58415=>18092, -58440=>18093, -150729=>18093, -18730=>18094, -58464=>18094, -172052=>18095, -58471=>18095, -165564=>18096, -58472=>18096, -165121=>18097, -58473=>18097, -15088=>18098, -58490=>18098, -28815=>18099, -58511=>18099, -58529=>18100, -140922=>18100, -58637=>18101, -158120=>18101, -58646=>18102, -148043=>18102, -26760=>18103, -58662=>18103, -58664=>18104, -139611=>18104, -40802=>18105, -58702=>18105, -37830=>18106, -58793=>18106, -58802=>18107, -131967=>18107, -37734=>18108, -58888=>18108, -37519=>18109, -58901=>18109, -34324=>18110, -58954=>18110, -58986=>18111, -173147=>18111, -16784=>18112, -59010=>18112, -26511=>18113, -59045=>18113, -26654=>18114, -59048=>18114, -14435=>18115, -59051=>18115, -59077=>18116, -149996=>18116, -15129=>18117, -59128=>18117, -33942=>18118, -59176=>18118, -59241=>18119, -149858=>18119, -14818=>18120, -59254=>18120, -33920=>18121, -59259=>18121, -17262=>18122, -59328=>18122, -38769=>18123, -59402=>18123, -39323=>18124, -59427=>18124, -18733=>18125, -59499=>18125, -28439=>18126, -59703=>18126, -160009=>18127, -59704=>18127, -28838=>18128, -59746=>18128, -150095=>18129, -59752=>18129, -32357=>18130, -59753=>18130, -23855=>18131, -59755=>18131, -15859=>18132, -59756=>18132, -150109=>18133, -59758=>18133, -137183=>18134, -59759=>18134, -32164=>18135, -59760=>18135, -33830=>18136, -59761=>18136, -21637=>18137, -59762=>18137, -146170=>18138, -59763=>18138, -131604=>18139, -59765=>18139, -22398=>18140, -59766=>18140, -133333=>18141, -59767=>18141, -132633=>18142, -59768=>18142, -16357=>18143, -59769=>18143, -139166=>18144, -59770=>18144, -172726=>18145, -59771=>18145, -28675=>18146, -59772=>18146, -168283=>18147, -59773=>18147, -23920=>18148, -59774=>18148, -29583=>18149, -59775=>18149, -166489=>18150, -59777=>18150, -168992=>18151, -59778=>18151, -20424=>18152, -59779=>18152, -32743=>18153, -59780=>18153, -29456=>18154, -59782=>18154, -29496=>18155, -59784=>18155, -29505=>18156, -59787=>18156, -16041=>18157, -59789=>18157, -29173=>18158, -59792=>18158, -149746=>18159, -59793=>18159, -29665=>18160, -59794=>18160, -16074=>18161, -59796=>18161, -16081=>18162, -59798=>18162, -29721=>18163, -59801=>18163, -29726=>18164, -59802=>18164, -29727=>18165, -59803=>18165, -16098=>18166, -59804=>18166, -16112=>18167, -59805=>18167, -16116=>18168, -59806=>18168, -16122=>18169, -59807=>18169, -29907=>18170, -59808=>18170, -16142=>18171, -59809=>18171, -16211=>18172, -59810=>18172, -30061=>18173, -59812=>18173, -30066=>18174, -59813=>18174, -30093=>18175, -59814=>18175, -16252=>18176, -59815=>18176, -30152=>18177, -59816=>18177, -30285=>18178, -59819=>18178, -30324=>18179, -59821=>18179, -16348=>18180, -59822=>18180, -30330=>18181, -59823=>18181, -29064=>18182, -59825=>18182, -22051=>18183, -59826=>18183, -35200=>18184, -59827=>18184, -16413=>18185, -59829=>18185, -30531=>18186, -59830=>18186, -16441=>18187, -59831=>18187, -16453=>18188, -59833=>18188, -13787=>18189, -59834=>18189, -30616=>18190, -59835=>18190, -16490=>18191, -59836=>18191, -16495=>18192, -59837=>18192, -30654=>18193, -59839=>18193, -30667=>18194, -59840=>18194, -30744=>18195, -59842=>18195, -30748=>18196, -59844=>18196, -30791=>18197, -59847=>18197, -30801=>18198, -59848=>18198, -30822=>18199, -59849=>18199, -33864=>18200, -59850=>18200, -152885=>18201, -59851=>18201, -31027=>18202, -59852=>18202, -31026=>18203, -59854=>18203, -16649=>18204, -59856=>18204, -31121=>18205, -59857=>18205, -31238=>18206, -59860=>18206, -16743=>18207, -59862=>18207, -16818=>18208, -59864=>18208, -31420=>18209, -59865=>18209, -33401=>18210, -59866=>18210, -16836=>18211, -59867=>18211, -31439=>18212, -59868=>18212, -31451=>18213, -59869=>18213, -16847=>18214, -59870=>18214, -31586=>18215, -59872=>18215, -31596=>18216, -59873=>18216, -31611=>18217, -59874=>18217, -31762=>18218, -59875=>18218, -16992=>18219, -59877=>18219, -17018=>18220, -59878=>18220, -31867=>18221, -59879=>18221, -31900=>18222, -59880=>18222, -17036=>18223, -59881=>18223, -31928=>18224, -59882=>18224, -17044=>18225, -59883=>18225, -36755=>18226, -59885=>18226, -28864=>18227, -59886=>18227, -134351=>18228, -59887=>18228, -32207=>18229, -59888=>18229, -32212=>18230, -59889=>18230, -32208=>18231, -59890=>18231, -32253=>18232, -59891=>18232, -32692=>18233, -59893=>18233, -29343=>18234, -59894=>18234, -17303=>18235, -59895=>18235, -32800=>18236, -59896=>18236, -32805=>18237, -59897=>18237, -32814=>18238, -59899=>18238, -32817=>18239, -59900=>18239, -32852=>18240, -59901=>18240, -22452=>18241, -59903=>18241, -28832=>18242, -59904=>18242, -32951=>18243, -59905=>18243, -33001=>18244, -59906=>18244, -17389=>18245, -59907=>18245, -33036=>18246, -59908=>18246, -33038=>18247, -59910=>18247, -33042=>18248, -59911=>18248, -33044=>18249, -59913=>18249, -17409=>18250, -59914=>18250, -15161=>18251, -59915=>18251, -33110=>18252, -59916=>18252, -33113=>18253, -59917=>18253, -33114=>18254, -59918=>18254, -17427=>18255, -59919=>18255, -33148=>18256, -59921=>18256, -17445=>18257, -59923=>18257, -17453=>18258, -59925=>18258, -33189=>18259, -59926=>18259, -22511=>18260, -59927=>18260, -33217=>18261, -59928=>18261, -33252=>18262, -59929=>18262, -33364=>18263, -59930=>18263, -17551=>18264, -59931=>18264, -33398=>18265, -59933=>18265, -33482=>18266, -59934=>18266, -33496=>18267, -59935=>18267, -17584=>18268, -59937=>18268, -33623=>18269, -59938=>18269, -38505=>18270, -59939=>18270, -33797=>18271, -59941=>18271, -28917=>18272, -59942=>18272, -33892=>18273, -59943=>18273, -33928=>18274, -59945=>18274, -17668=>18275, -59946=>18275, -33982=>18276, -59947=>18276, -34017=>18277, -59948=>18277, -34040=>18278, -59949=>18278, -34064=>18279, -59950=>18279, -34104=>18280, -59951=>18280, -34130=>18281, -59952=>18281, -17723=>18282, -59953=>18282, -34159=>18283, -59954=>18283, -34160=>18284, -59955=>18284, -34272=>18285, -59956=>18285, -17783=>18286, -59957=>18286, -34418=>18287, -59958=>18287, -34450=>18288, -59959=>18288, -34543=>18289, -59961=>18289, -38469=>18290, -59962=>18290, -17926=>18291, -59964=>18291, -17943=>18292, -59965=>18292, -34990=>18293, -59966=>18293, -35071=>18294, -59967=>18294, -35108=>18295, -59968=>18295, -35217=>18296, -59970=>18296, -162151=>18297, -59971=>18297, -35384=>18298, -59973=>18298, -35476=>18299, -59974=>18299, -35508=>18300, -59975=>18300, -35921=>18301, -59976=>18301, -36052=>18302, -59977=>18302, -36082=>18303, -59978=>18303, -36124=>18304, -59979=>18304, -18328=>18305, -59980=>18305, -36291=>18306, -59982=>18306, -18413=>18307, -59983=>18307, -36410=>18308, -59985=>18308, -22356=>18309, -59987=>18309, -22005=>18310, -59989=>18310, -18487=>18311, -59991=>18311, -36558=>18312, -59992=>18312, -36578=>18313, -59993=>18313, -36580=>18314, -59994=>18314, -36589=>18315, -59995=>18315, -36594=>18316, -59996=>18316, -36801=>18317, -59998=>18317, -36810=>18318, -59999=>18318, -36812=>18319, -60000=>18319, -36915=>18320, -60001=>18320, -18605=>18321, -60003=>18321, -39136=>18322, -60004=>18322, -37395=>18323, -60005=>18323, -18718=>18324, -60006=>18324, -37416=>18325, -60007=>18325, -37464=>18326, -60008=>18326, -37483=>18327, -60009=>18327, -37553=>18328, -60010=>18328, -37550=>18329, -60011=>18329, -37567=>18330, -60012=>18330, -37603=>18331, -60013=>18331, -37611=>18332, -60014=>18332, -37619=>18333, -60015=>18333, -37620=>18334, -60016=>18334, -37629=>18335, -60017=>18335, -37699=>18336, -60018=>18336, -37764=>18337, -60019=>18337, -37805=>18338, -60020=>18338, -18757=>18339, -60021=>18339, -18769=>18340, -60022=>18340, -37911=>18341, -60024=>18341, -37917=>18342, -60026=>18342, -37933=>18343, -60027=>18343, -37950=>18344, -60028=>18344, -18794=>18345, -60029=>18345, -37972=>18346, -60030=>18346, -38009=>18347, -60031=>18347, -38189=>18348, -60032=>18348, -38306=>18349, -60033=>18349, -18855=>18350, -60034=>18350, -38388=>18351, -60035=>18351, -38451=>18352, -60036=>18352, -18917=>18353, -60037=>18353, -18980=>18354, -60039=>18354, -38720=>18355, -60040=>18355, -18997=>18356, -60041=>18356, -38834=>18357, -60042=>18357, -38850=>18358, -60043=>18358, -19172=>18359, -60045=>18359, -39097=>18360, -60047=>18360, -19225=>18361, -60048=>18361, -39153=>18362, -60049=>18362, -22596=>18363, -60050=>18363, -39193=>18364, -60052=>18364, -39223=>18365, -60055=>18365, -39261=>18366, -60057=>18366, -39266=>18367, -60058=>18367, -19312=>18368, -60059=>18368, -39365=>18369, -60060=>18369, -19357=>18370, -60061=>18370, -39484=>18371, -60062=>18371, -39695=>18372, -60063=>18372, -39785=>18373, -60065=>18373, -39901=>18374, -60067=>18374, -39921=>18375, -60068=>18375, -39924=>18376, -60069=>18376, -19565=>18377, -60070=>18377, -39968=>18378, -60071=>18378, -14191=>18379, -60072=>18379, -138178=>18380, -60073=>18380, -40265=>18381, -60074=>18381, -40702=>18382, -60076=>18382, -22096=>18383, -60077=>18383, -40381=>18384, -60079=>18384, -40444=>18385, -60081=>18385, -38134=>18386, -60082=>18386, -36790=>18387, -60083=>18387, -40625=>18388, -60086=>18388, -40637=>18389, -60087=>18389, -40646=>18390, -60088=>18390, -38108=>18391, -60089=>18391, -40674=>18392, -60090=>18392, -40689=>18393, -60091=>18393, -40696=>18394, -60092=>18394, -40772=>18395, -60094=>18395, -131220=>18396, -60095=>18396, -131767=>18397, -60096=>18397, -132000=>18398, -60097=>18398, -38083=>18399, -60099=>18399, -60101=>18400, -132311=>18400, -38081=>18401, -60103=>18401, -132565=>18402, -60105=>18402, -132629=>18403, -60106=>18403, -132726=>18404, -60107=>18404, -136890=>18405, -60108=>18405, -22359=>18406, -60109=>18406, -29043=>18407, -60110=>18407, -133826=>18408, -60111=>18408, -133837=>18409, -60112=>18409, -134079=>18410, -60113=>18410, -194619=>18411, -60115=>18411, -134091=>18412, -60116=>18412, -21662=>18413, -60117=>18413, -134139=>18414, -60118=>18414, -134203=>18415, -60119=>18415, -134227=>18416, -60120=>18416, -134245=>18417, -60121=>18417, -134268=>18418, -60122=>18418, -60124=>18419, -134285=>18419, -134325=>18420, -60126=>18420, -134365=>18421, -60127=>18421, -134381=>18422, -60128=>18422, -134511=>18423, -60129=>18423, -134578=>18424, -60130=>18424, -134600=>18425, -60131=>18425, -134660=>18426, -60135=>18426, -134670=>18427, -60136=>18427, -134871=>18428, -60137=>18428, -135056=>18429, -60138=>18429, -134957=>18430, -60139=>18430, -134771=>18431, -60140=>18431, -60142=>18432, -135100=>18432, -135260=>18433, -60144=>18433, -135247=>18434, -60145=>18434, -135286=>18435, -60146=>18435, -135304=>18436, -60149=>18436, -135318=>18437, -60150=>18437, -13895=>18438, -60151=>18438, -135359=>18439, -60152=>18439, -135471=>18440, -60154=>18440, -135483=>18441, -60155=>18441, -21348=>18442, -60156=>18442, -135907=>18443, -60158=>18443, -136053=>18444, -60159=>18444, -60160=>18445, -135990=>18445, -136567=>18446, -60162=>18446, -136729=>18447, -60163=>18447, -137155=>18448, -60164=>18448, -137159=>18449, -60165=>18449, -28859=>18450, -60167=>18450, -137261=>18451, -60168=>18451, -137578=>18452, -60169=>18452, -137773=>18453, -60170=>18453, -137797=>18454, -60171=>18454, -138282=>18455, -60172=>18455, -138352=>18456, -60173=>18456, -138412=>18457, -60174=>18457, -138952=>18458, -60175=>18458, -138965=>18459, -60177=>18459, -139029=>18460, -60178=>18460, -29080=>18461, -60179=>18461, -139333=>18462, -60181=>18462, -27113=>18463, -60182=>18463, -14024=>18464, -60183=>18464, -139900=>18465, -60184=>18465, -140247=>18466, -60185=>18466, -140282=>18467, -60186=>18467, -141098=>18468, -60187=>18468, -141425=>18469, -60188=>18469, -141647=>18470, -60189=>18470, -141671=>18471, -60191=>18471, -141715=>18472, -60192=>18472, -142037=>18473, -60193=>18473, -60195=>18474, -142056=>18474, -60197=>18475, -142094=>18475, -60199=>18476, -142143=>18476, -60202=>18477, -142412=>18477, -142472=>18478, -60204=>18478, -142519=>18479, -60205=>18479, -154600=>18480, -60206=>18480, -142600=>18481, -60207=>18481, -142610=>18482, -60208=>18482, -142775=>18483, -60209=>18483, -142741=>18484, -60210=>18484, -142914=>18485, -60211=>18485, -143220=>18486, -60212=>18486, -143308=>18487, -60213=>18487, -143411=>18488, -60214=>18488, -143462=>18489, -60215=>18489, -144159=>18490, -60216=>18490, -144350=>18491, -60217=>18491, -144743=>18492, -60222=>18492, -144883=>18493, -60223=>18493, -144922=>18494, -60227=>18494, -145174=>18495, -60228=>18495, -22709=>18496, -60231=>18496, -60234=>18497, -146087=>18497, -146961=>18498, -60237=>18498, -147129=>18499, -60238=>18499, -60243=>18500, -147737=>18500, -148206=>18501, -60245=>18501, -148237=>18502, -60246=>18502, -148276=>18503, -60248=>18503, -148374=>18504, -60249=>18504, -148484=>18505, -60258=>18505, -148694=>18506, -60259=>18506, -22408=>18507, -60260=>18507, -149108=>18508, -60261=>18508, -60263=>18509, -149295=>18509, -149522=>18510, -60271=>18510, -149755=>18511, -60272=>18511, -150037=>18512, -60273=>18512, -60275=>18513, -150208=>18513, -22885=>18514, -60277=>18514, -60279=>18515, -151430=>18515, -60282=>18516, -151596=>18516, -22335=>18517, -60284=>18517, -152217=>18518, -60286=>18518, -152601=>18519, -60287=>18519, -152646=>18520, -60291=>18520, -152686=>18521, -60292=>18521, -60296=>18522, -152895=>18522, -60298=>18523, -152926=>18523, -152930=>18524, -60300=>18524, -152934=>18525, -60301=>18525, -153543=>18526, -60302=>18526, -60304=>18527, -153693=>18527, -60309=>18528, -153859=>18528, -154286=>18529, -60312=>18529, -154505=>18530, -60313=>18530, -154630=>18531, -60314=>18531, -22433=>18532, -60316=>18532, -29009=>18533, -60317=>18533, -60319=>18534, -155906=>18534, -60322=>18535, -156082=>18535, -156674=>18536, -60325=>18536, -156746=>18537, -60326=>18537, -60330=>18538, -156804=>18538, -60334=>18539, -156808=>18539, -60336=>18540, -156946=>18540, -157119=>18541, -60338=>18541, -157365=>18542, -60339=>18542, -22201=>18543, -60347=>18543, -60349=>18544, -157436=>18544, -13848=>18545, -60355=>18545, -157593=>18546, -60357=>18546, -157806=>18547, -60358=>18547, -60360=>18548, -157790=>18548, -60362=>18549, -157895=>18549, -60366=>18550, -157990=>18550, -60368=>18551, -158009=>18551, -60371=>18552, -158202=>18552, -60373=>18553, -158253=>18553, -158260=>18554, -60378=>18554, -158555=>18555, -60379=>18555, -60383=>18556, -158621=>18556, -60385=>18557, -158884=>18557, -60388=>18558, -159150=>18558, -159819=>18559, -60392=>18559, -160205=>18560, -60393=>18560, -160384=>18561, -60395=>18561, -160389=>18562, -60396=>18562, -60399=>18563, -160395=>18563, -60401=>18564, -160486=>18564, -38047=>18565, -60404=>18565, -160848=>18566, -60405=>18566, -14009=>18567, -60416=>18567, -161740=>18568, -60424=>18568, -161880=>18569, -60425=>18569, -22230=>18570, -60426=>18570, -60435=>18571, -162269=>18571, -162301=>18572, -60441=>18572, -162314=>18573, -60442=>18573, -162571=>18574, -60443=>18574, -163174=>18575, -60444=>18575, -60448=>18576, -163849=>18576, -60459=>18577, -163875=>18577, -60463=>18578, -163912=>18578, -60466=>18579, -163971=>18579, -163984=>18580, -60479=>18580, -164084=>18581, -60480=>18581, -164142=>18582, -60481=>18582, -60483=>18583, -164175=>18583, -164271=>18584, -60485=>18584, -164378=>18585, -60486=>18585, -164614=>18586, -60487=>18586, -164655=>18587, -60488=>18587, -164746=>18588, -60489=>18588, -164968=>18589, -60491=>18589, -165546=>18590, -60492=>18590, -25574=>18591, -60494=>18591, -166230=>18592, -60495=>18592, -60498=>18593, -166328=>18593, -60500=>18594, -166375=>18594, -60502=>18595, -166376=>18595, -166726=>18596, -60503=>18596, -166868=>18597, -60504=>18597, -60506=>18598, -166921=>18598, -167877=>18599, -60508=>18599, -168172=>18600, -60509=>18600, -168208=>18601, -60511=>18601, -168252=>18602, -60512=>18602, -15863=>18603, -60513=>18603, -168286=>18604, -60514=>18604, -150218=>18605, -60515=>18605, -36816=>18606, -60516=>18606, -60519=>18607, -169191=>18607, -169392=>18608, -60521=>18608, -169400=>18609, -60522=>18609, -169778=>18610, -60523=>18610, -170193=>18611, -60524=>18611, -170313=>18612, -60525=>18612, -170346=>18613, -60526=>18613, -170435=>18614, -60527=>18614, -170536=>18615, -60528=>18615, -170766=>18616, -60529=>18616, -171354=>18617, -60530=>18617, -171419=>18618, -60531=>18618, -32415=>18619, -60532=>18619, -171768=>18620, -60533=>18620, -171811=>18621, -60534=>18621, -19620=>18622, -60535=>18622, -38215=>18623, -60536=>18623, -172691=>18624, -60537=>18624, -29090=>18625, -60538=>18625, -172799=>18626, -60539=>18626, -173515=>18627, -60542=>18627, -19868=>18628, -60543=>18628, -134300=>18629, -60544=>18629, -36798=>18630, -60545=>18630, -36794=>18631, -60547=>18631, -140464=>18632, -60548=>18632, -36793=>18633, -60549=>18633, -150163=>18634, -60550=>18634, -20202=>18635, -60555=>18635, -60557=>18636, -166700=>18636, -36480=>18637, -60560=>18637, -137205=>18638, -60561=>18638, -166764=>18639, -60563=>18639, -166809=>18640, -60564=>18640, -60566=>18641, -157359=>18641, -60568=>18642, -161365=>18642, -153141=>18643, -60570=>18643, -153942=>18644, -60571=>18644, -20122=>18645, -60572=>18645, -155265=>18646, -60573=>18646, -60576=>18647, -134765=>18647, -147080=>18648, -60579=>18648, -150686=>18649, -60580=>18649, -137206=>18650, -60583=>18650, -137339=>18651, -60584=>18651, -60587=>18652, -154698=>18652, -152337=>18653, -60589=>18653, -15814=>18654, -60590=>18654, -60596=>18655, -155352=>18655, -19996=>18656, -60600=>18656, -135146=>18657, -60601=>18657, -134473=>18658, -60602=>18658, -145082=>18659, -60603=>18659, -60638=>18660, -151880=>18660, -21982=>18661, -60644=>18661, -34694=>18662, -60672=>18662, -60676=>18663, -135361=>18663, -149254=>18664, -60679=>18664, -23440=>18665, -60680=>18665, -60682=>18666, -157843=>18666, -141044=>18667, -60684=>18667, -163119=>18668, -60685=>18668, -147875=>18669, -60686=>18669, -163187=>18670, -60687=>18670, -159440=>18671, -60688=>18671, -160438=>18672, -60689=>18672, -60691=>18673, -135641=>18673, -146684=>18674, -60693=>18674, -173737=>18675, -60694=>18675, -134828=>18676, -60695=>18676, -60698=>18677, -138402=>18677, -60700=>18678, -151490=>18678, -60702=>18679, -135147=>18679, -60706=>18680, -142752=>18680, -135148=>18681, -60710=>18681, -134666=>18682, -60711=>18682, -60714=>18683, -135149=>18683, -60717=>18684, -135559=>18684, -19994=>18685, -60721=>18685, -19972=>18686, -60722=>18686, -23309=>18687, -60724=>18687, -13996=>18688, -60727=>18688, -21373=>18689, -60729=>18689, -13989=>18690, -60730=>18690, -22682=>18691, -60732=>18691, -150382=>18692, -60733=>18692, -22442=>18693, -60736=>18693, -154261=>18694, -60737=>18694, -133497=>18695, -60738=>18695, -60741=>18696, -140389=>18696, -146686=>18697, -60746=>18697, -171824=>18698, -60747=>18698, -151465=>18699, -60749=>18699, -169374=>18700, -60750=>18700, -60753=>18701, -146870=>18701, -157619=>18702, -60755=>18702, -145184=>18703, -60756=>18703, -147191=>18704, -60759=>18704, -146988=>18705, -60760=>18705, -60785=>18706, -143578=>18706, -135849=>18707, -60789=>18707, -22439=>18708, -60790=>18708, -149859=>18709, -60791=>18709, -60794=>18710, -159918=>18710, -60801=>18711, -137068=>18711, -60806=>18712, -160100=>18712, -159010=>18713, -60809=>18713, -150242=>18714, -60810=>18714, -39963=>18715, -60837=>18715, -149822=>18716, -60838=>18716, -15878=>18717, -60846=>18717, -60881=>18718, -159011=>18718, -60887=>18719, -132092=>18719, -60891=>18720, -146685=>18720, -60893=>18721, -149785=>18721, -22394=>18722, -60904=>18722, -21722=>18723, -60912=>18723, -29050=>18724, -60928=>18724, -60949=>18725, -150135=>18725, -60955=>18726, -166490=>18726, -60962=>18727, -194624=>18727, -60976=>18728, -137275=>18728, -61000=>18729, -155993=>18729, -61014=>18730, -144373=>18730, -61019=>18731, -166850=>18731, -61024=>18732, -138566=>18732, -61054=>18733, -159441=>18733, -13877=>18734, -61065=>18734, -61084=>18735, -166701=>18735, -21024=>18736, -61088=>18736, -15384=>18737, -61089=>18737, -146631=>18738, -61090=>18738, -155351=>18739, -61091=>18739, -161366=>18740, -61092=>18740, -152881=>18741, -61093=>18741, -137540=>18742, -61094=>18742, -170243=>18743, -61096=>18743, -159196=>18744, -61097=>18744, -159917=>18745, -61098=>18745, -156077=>18746, -61100=>18746, -166415=>18747, -61101=>18747, -145015=>18748, -61102=>18748, -131310=>18749, -61103=>18749, -157766=>18750, -61104=>18750, -151310=>18751, -61105=>18751, -17762=>18752, -61106=>18752, -23327=>18753, -61107=>18753, -156492=>18754, -61108=>18754, -40784=>18755, -61109=>18755, -40614=>18756, -61110=>18756, -156267=>18757, -61111=>18757, -20962=>18758, -57415=>18758, -21314=>18759, -57416=>18759, -26285=>18760, -57520=>18760, -22620=>18761, -57547=>18761, -21843=>18762, -57566=>18762, -15749=>18763, -57594=>18763, -24928=>18764, -57608=>18764, -18606=>18765, -57668=>18765, -38845=>18766, -57676=>18766, -57693=>18767, -137335=>18767, -24755=>18768, -57703=>18768, -33828=>18769, -57711=>18769, -38932=>18770, -57748=>18770, -147596=>18771, -57749=>18771, -57764=>18772, -143486=>18772, -57787=>18773, -138813=>18773, -15147=>18774, -57798=>18774, -15666=>18775, -57824=>18775, -57857=>18776, -132021=>18776, -28801=>18777, -57944=>18777, -23708=>18778, -57959=>18778, -58017=>18779, -132547=>18779, -14128=>18780, -58028=>18780, -136054=>18781, -58096=>18781, -150034=>18782, -58097=>18782, -58111=>18783, -166699=>18783, -58112=>18784, -155779=>18784, -256=>18785, -62233=>18785, -193=>18786, -62234=>18786, -461=>18787, -62235=>18787, -192=>18788, -62236=>18788, -274=>18789, -62237=>18789, -201=>18790, -62238=>18790, -282=>18791, -62239=>18791, -200=>18792, -62240=>18792, -332=>18793, -62241=>18793, -211=>18794, -62242=>18794, -465=>18795, -62243=>18795, -210=>18796, -62244=>18796, -62245=>18797, -7870=>18798, -62246=>18798, -62247=>18799, -7872=>18800, -62248=>18800, -202=>18801, -62249=>18801, -257=>18802, -62250=>18802, -225=>18803, -62251=>18803, -462=>18804, -62252=>18804, -224=>18805, -62253=>18805, -593=>18806, -62254=>18806, -275=>18807, -62255=>18807, -233=>18808, -62256=>18808, -283=>18809, -62257=>18809, -232=>18810, -62258=>18810, -299=>18811, -62259=>18811, -237=>18812, -62260=>18812, -464=>18813, -62261=>18813, -236=>18814, -62262=>18814, -333=>18815, -62263=>18815, -243=>18816, -62264=>18816, -466=>18817, -62265=>18817, -242=>18818, -62266=>18818, -363=>18819, -62267=>18819, -250=>18820, -62268=>18820, -468=>18821, -62269=>18821, -249=>18822, -62270=>18822, -470=>18823, -62271=>18823, -472=>18824, -62272=>18824, -474=>18825, -62273=>18825, -476=>18826, -62274=>18826, -252=>18827, -62275=>18827, -62276=>18828, -7871=>18829, -62277=>18829, -62278=>18830, -7873=>18831, -62279=>18831, -234=>18832, -62280=>18832, -609=>18833, -62281=>18833, -643=>18834, -63551=>18834, -592=>18835, -63552=>18835, -603=>18836, -63553=>18836, -596=>18837, -63554=>18837, -629=>18838, -63555=>18838, -339=>18839, -63556=>18839, -248=>18840, -63557=>18840, -331=>18841, -63558=>18841, -650=>18842, -63559=>18842, -618=>18843, -63560=>18843, -9178=>18844, -62282=>18844, -9179=>18845, -62283=>18845, -11933=>18846, -63530=>18846, -11974=>18847, -63539=>18847, -12003=>18848, -63547=>18848, -20539=>18849, -28158=>18850, -171123=>18851, -62841=>18851, -40870=>18852, -62842=>18852, -15817=>18853, -62843=>18853, -34959=>18854, -62845=>18855, -147790=>18855, -28791=>18856, -23797=>18857, -19232=>18858, -62848=>18858, -152013=>18859, -62849=>18859, -13657=>18860, -62850=>18860, -154928=>18861, -62851=>18861, -24866=>18862, -62853=>18863, -166450=>18863, -36775=>18864, -37366=>18865, -29073=>18866, -26393=>18867, -29626=>18868, -144001=>18869, -62859=>18869, -172295=>18870, -62860=>18870, -15499=>18871, -62861=>18871, -137600=>18872, -62862=>18872, -19216=>18873, -62863=>18873, -30948=>18874, -29698=>18875, -20910=>18876, -165647=>18877, -62867=>18877, -16393=>18878, -62868=>18878, -27235=>18879, -172730=>18880, -62870=>18880, -16931=>18881, -62871=>18881, -34319=>18882, -31274=>18883, -170311=>18884, -62875=>18884, -166634=>18885, -62876=>18885, -38741=>18886, -28749=>18887, -21284=>18888, -62880=>18889, -139390=>18889, -37876=>18890, -30425=>18891, -166371=>18892, -62883=>18892, -40871=>18893, -62884=>18893, -30685=>18894, -20131=>18895, -20464=>18896, -20668=>18897, -20015=>18898, -20247=>18899, -40872=>18900, -62891=>18900, -21556=>18901, -32139=>18902, -22674=>18903, -22736=>18904, -62896=>18905, -138678=>18905, -24210=>18906, -24217=>18907, -24514=>18908, -62900=>18909, -141074=>18909, -25995=>18910, -62902=>18911, -144377=>18911, -26905=>18912, -27203=>18913, -62905=>18914, -146531=>18914, -27903=>18915, -29184=>18916, -62909=>18917, -148741=>18917, -29580=>18918, -16091=>18919, -62911=>18919, -150035=>18920, -62912=>18920, -23317=>18921, -29881=>18922, -35715=>18923, -154788=>18924, -62916=>18924, -153237=>18925, -62917=>18925, -31379=>18926, -31724=>18927, -31939=>18928, -32364=>18929, -33528=>18930, -34199=>18931, -40873=>18932, -62924=>18932, -34960=>18933, -40874=>18934, -62926=>18934, -36537=>18935, -40875=>18936, -62928=>18936, -36815=>18937, -34143=>18938, -39392=>18939, -37409=>18940, -40876=>18941, -62933=>18941, -167353=>18942, -62934=>18942, -136255=>18943, -62935=>18943, -16497=>18944, -62936=>18944, -17058=>18945, -62937=>18945, -23066=>18946, -39016=>18947, -26475=>18948, -17014=>18949, -62944=>18949, -22333=>18950, -34262=>18951, -62948=>18952, -149883=>18952, -33471=>18953, -160013=>18954, -62950=>18954, -19585=>18955, -62951=>18955, -159092=>18956, -62952=>18956, -23931=>18957, -158485=>18958, -62954=>18958, -159678=>18959, -62955=>18959, -40877=>18960, -62956=>18960, -40878=>18961, -62957=>18961, -23446=>18962, -40879=>18963, -62959=>18963, -32347=>18964, -17392=>18965, -19506=>18966, -17923=>18967, -17830=>18968, -17784=>18969, -160359=>18970, -19831=>18971, -17843=>18972, -162993=>18973, -19682=>18974, -163013=>18975, -15253=>18976, -18230=>18977, -18244=>18978, -19527=>18979, -19520=>18980, -148159=>18981, -144919=>18982, -160594=>18983, -159371=>18984, -159954=>18985, -19543=>18986, -172881=>18987, -18255=>18988, -17882=>18989, -19589=>18990, -162924=>18991, -19719=>18992, -19108=>18993, -18081=>18994, -158499=>18995, -29221=>18996, -154196=>18997, -137827=>18998, -146950=>18999, -147297=>19000, -26189=>19001, -22267=>19002, -32149=>19003, -22813=>19004, -166841=>19005, -15860=>19006, -38708=>19007, -162799=>19008, -23515=>19009, -138590=>19010, -23204=>19011, -13861=>19012, -171696=>19013, -23249=>19014, -23479=>19015, -23804=>19016, -26478=>19017, -34195=>19018, -170309=>19019, -29793=>19020, -29853=>19021, -133743=>19022, -26343=>19023, -28247=>19024, -31178=>19025, -15752=>19026, -17603=>19027, -143958=>19028, -141206=>19029, -17306=>19030, -17718=>19031, -23765=>19032, -146202=>19033, -35577=>19034, -23672=>19035, -15634=>19036, -144721=>19037, -23928=>19038, -40882=>19039, -29015=>19040, -17752=>19041, -147692=>19042, -138787=>19043, -19575=>19044, -14712=>19045, -13386=>19046, -131492=>19047, -158785=>19048, -35532=>19049, -20404=>19050, -131641=>19051, -22975=>19052, -33132=>19053, -38998=>19054, -170234=>19055, -24379=>19056, -134047=>19057, -139713=>19058, -166253=>19059, -16642=>19060, -18107=>19061, -168057=>19062, -16135=>19063, -40883=>19064, -172469=>19065, -16632=>19066, -14294=>19067, -18167=>19068, -158790=>19069, -16764=>19070, -165554=>19071, -160767=>19072, -17773=>19073, -14548=>19074, -152730=>19075, -17761=>19076, -17691=>19077, -19849=>19078, -19579=>19079, -19830=>19080, -17898=>19081, -16328=>19082, -150287=>19083, -13921=>19084, -17630=>19085, -17597=>19086, -16877=>19087, -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ag15.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ag15.php deleted file mode 100644 index ae64905814..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ag15.php +++ /dev/null @@ -1,30222 +0,0 @@ -<?php -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ag15.tar.Z -$cidinfo['uni2cid'] = array( -32=>1, -33=>2, -34=>3, -35=>4, -36=>5, -37=>6, -38=>7, -39=>8, -40=>9, -41=>10, -42=>11, -43=>12, -44=>13, -45=>14, -46=>15, -47=>16, -48=>17, -49=>18, -50=>19, -51=>20, -52=>21, -53=>22, -54=>23, -55=>24, -56=>25, -57=>26, -58=>27, -59=>28, -60=>29, -61=>30, -62=>31, -63=>32, -64=>33, -65=>34, -66=>35, -67=>36, -68=>37, -69=>38, -70=>39, -71=>40, -72=>41, -73=>42, -74=>43, -75=>44, -76=>45, -77=>46, -78=>47, -79=>48, -80=>49, -81=>50, -82=>51, -83=>52, -84=>53, -85=>54, -86=>55, -87=>56, -88=>57, -89=>58, -90=>59, -91=>60, -92=>61, -93=>62, -94=>63, -95=>64, -96=>65, -97=>66, -98=>67, -99=>68, -100=>69, -101=>70, -102=>71, -103=>72, -104=>73, -105=>74, -106=>75, -107=>76, -108=>77, -109=>78, -110=>79, -111=>80, -112=>81, -113=>82, -114=>83, -115=>84, -116=>85, -117=>86, -118=>87, -119=>88, -120=>89, -121=>90, -122=>91, -123=>92, -124=>93, -125=>94, -126=>95, -12288=>96, -12289=>97, -12290=>98, -183=>99, -12539=>99, -713=>100, -711=>101, -168=>102, -12291=>103, -12293=>104, -8212=>105, -65374=>106, -8214=>107, -8230=>108, -8943=>108, -8216=>109, -8217=>110, -8220=>111, -8221=>112, -12308=>113, -12309=>114, -12296=>115, -12297=>116, -12298=>117, -12299=>118, -12300=>119, -12301=>120, -12302=>121, -12303=>122, -12310=>123, -12311=>124, -12304=>125, -12305=>126, -177=>127, -215=>128, -247=>129, -8758=>130, -8743=>131, -8744=>132, -8721=>133, -8719=>134, -8746=>135, -8745=>136, -8712=>137, -8759=>138, -8730=>139, -8869=>140, -8741=>141, -8736=>142, -8978=>143, -8857=>144, -8747=>145, -8750=>146, -8801=>147, -8780=>148, -8776=>149, -8765=>150, -8733=>151, -8800=>152, -8814=>153, -8815=>154, -8804=>155, -8805=>156, -8734=>157, -8757=>158, -8756=>159, -9794=>160, -9792=>161, -176=>162, -8242=>163, -8243=>164, -8451=>165, -65284=>166, -164=>167, -65504=>168, -65505=>169, -8240=>170, -167=>171, -8470=>172, -9734=>173, -9733=>174, -9675=>175, -9679=>176, -9678=>177, -9671=>178, -9670=>179, -9633=>180, -9632=>181, -9651=>182, -9650=>183, -8251=>184, -8594=>185, -8592=>186, -8593=>187, -8595=>188, -12307=>189, -9352=>190, -9353=>191, -9354=>192, -9355=>193, -9356=>194, -9357=>195, -9358=>196, -9359=>197, -9360=>198, -9361=>199, -9362=>200, -9363=>201, -9364=>202, -9365=>203, -9366=>204, -9367=>205, -9368=>206, -9369=>207, -9370=>208, -9371=>209, -9332=>210, -9333=>211, -9334=>212, -9335=>213, -9336=>214, -9337=>215, -9338=>216, -9339=>217, -9340=>218, -9341=>219, -9342=>220, -9343=>221, -9344=>222, -9345=>223, -9346=>224, -9347=>225, -9348=>226, -9349=>227, -9350=>228, -9351=>229, -9312=>230, -9313=>231, -9314=>232, -9315=>233, -9316=>234, -9317=>235, -9318=>236, -9319=>237, -9320=>238, -9321=>239, -12832=>240, -12833=>241, -12834=>242, -12835=>243, -12836=>244, -12837=>245, -12838=>246, -12839=>247, -12840=>248, -12841=>249, -8544=>250, -8545=>251, -8546=>252, -8547=>253, -8548=>254, -8549=>255, -8550=>256, -8551=>257, -8552=>258, -8553=>259, -8554=>260, -8555=>261, -65281=>262, -65282=>263, -65283=>264, -65509=>265, -65285=>266, -65286=>267, -65287=>268, -65288=>269, -65289=>270, -65290=>271, -65291=>272, -65292=>273, -65293=>274, -65294=>275, -65295=>276, -65296=>277, -65297=>278, -65298=>279, -65299=>280, -65300=>281, -65301=>282, -65302=>283, -65303=>284, -65304=>285, -65305=>286, -65306=>287, -65307=>288, -65308=>289, -65309=>290, -65310=>291, -65311=>292, -65312=>293, -65313=>294, -65314=>295, -65315=>296, -65316=>297, -65317=>298, -65318=>299, -65319=>300, -65320=>301, -65321=>302, -65322=>303, -65323=>304, -65324=>305, -65325=>306, -65326=>307, -65327=>308, -65328=>309, -65329=>310, -65330=>311, -65331=>312, -65332=>313, -65333=>314, -65334=>315, -65335=>316, -65336=>317, -65337=>318, -65338=>319, -65339=>320, -65340=>321, -65341=>322, -65342=>323, -65343=>324, -65344=>325, -65345=>326, -65346=>327, -65347=>328, -65348=>329, -65349=>330, -65350=>331, -65351=>332, -65352=>333, -65353=>334, -65354=>335, -65355=>336, -65356=>337, -65357=>338, -65358=>339, -65359=>340, -65360=>341, -65361=>342, -65362=>343, -65363=>344, -65364=>345, -65365=>346, -65366=>347, -65367=>348, -65368=>349, -65369=>350, -65370=>351, -65371=>352, -65372=>353, -65373=>354, -65507=>355, -12353=>356, -12354=>357, -12355=>358, -12356=>359, -12357=>360, -12358=>361, -12359=>362, -12360=>363, -12361=>364, -12362=>365, -12363=>366, -12364=>367, -12365=>368, -12366=>369, -12367=>370, -12368=>371, -12369=>372, -12370=>373, -12371=>374, -12372=>375, -12373=>376, -12374=>377, -12375=>378, -12376=>379, -12377=>380, -12378=>381, -12379=>382, -12380=>383, -12381=>384, -12382=>385, -12383=>386, -12384=>387, -12385=>388, -12386=>389, -12387=>390, -12388=>391, -12389=>392, -12390=>393, -12391=>394, -12392=>395, -12393=>396, -12394=>397, -12395=>398, -12396=>399, -12397=>400, -12398=>401, -12399=>402, -12400=>403, -12401=>404, -12402=>405, -12403=>406, -12404=>407, -12405=>408, -12406=>409, -12407=>410, -12408=>411, -12409=>412, -12410=>413, -12411=>414, -12412=>415, -12413=>416, -12414=>417, -12415=>418, -12416=>419, -12417=>420, -12418=>421, -12419=>422, -12420=>423, -12421=>424, -12422=>425, -12423=>426, -12424=>427, -12425=>428, -12426=>429, -12427=>430, -12428=>431, -12429=>432, -12430=>433, -12431=>434, -12432=>435, -12433=>436, -12434=>437, -12435=>438, -12449=>439, -12450=>440, -12451=>441, -12452=>442, -12453=>443, -12454=>444, -12455=>445, -12456=>446, -12457=>447, -12458=>448, -12459=>449, -12460=>450, -12461=>451, -12462=>452, -12463=>453, -12464=>454, -12465=>455, -12466=>456, -12467=>457, -12468=>458, -12469=>459, -12470=>460, -12471=>461, -12472=>462, -12473=>463, -12474=>464, -12475=>465, -12476=>466, -12477=>467, -12478=>468, -12479=>469, -12480=>470, -12481=>471, -12482=>472, -12483=>473, -12484=>474, -12485=>475, -12486=>476, -12487=>477, -12488=>478, -12489=>479, -12490=>480, -12491=>481, -12492=>482, -12493=>483, -12494=>484, -12495=>485, -12496=>486, -12497=>487, -12498=>488, -12499=>489, -12500=>490, -12501=>491, -12502=>492, -12503=>493, -12504=>494, -12505=>495, -12506=>496, -12507=>497, -12508=>498, -12509=>499, -12510=>500, -12511=>501, -12512=>502, -12513=>503, -12514=>504, -12515=>505, -12516=>506, -12517=>507, -12518=>508, -12519=>509, -12520=>510, -12521=>511, -12522=>512, -12523=>513, -12524=>514, -12525=>515, -12526=>516, -12527=>517, -12528=>518, -12529=>519, -12530=>520, -12531=>521, -12532=>522, -12533=>523, -12534=>524, -913=>525, -914=>526, -915=>527, -916=>528, -917=>529, -918=>530, -919=>531, -920=>532, -921=>533, -922=>534, -923=>535, -924=>536, -925=>537, -926=>538, -927=>539, -928=>540, -929=>541, -931=>542, -932=>543, -933=>544, -934=>545, -935=>546, -936=>547, -937=>548, -945=>549, -946=>550, -947=>551, -948=>552, -949=>553, -950=>554, -951=>555, -952=>556, -953=>557, -954=>558, -955=>559, -956=>560, -957=>561, -958=>562, -959=>563, -960=>564, -961=>565, -963=>566, -964=>567, -965=>568, -966=>569, -967=>570, -968=>571, -969=>572, -65040=>573, -59277=>573, -65042=>574, -59278=>574, -65041=>575, -59279=>575, -59280=>576, -65043=>576, -59281=>577, -65044=>577, -59282=>578, -65045=>578, -59283=>579, -65046=>579, -65077=>580, -65078=>581, -65081=>582, -65082=>583, -65087=>584, -65088=>585, -65085=>586, -65086=>587, -65089=>588, -65090=>589, -65091=>590, -65092=>591, -59284=>592, -65047=>592, -59285=>593, -65048=>593, -65083=>594, -65084=>595, -65079=>596, -65080=>597, -65073=>598, -8285=>599, -59286=>599, -65049=>599, -65075=>600, -65076=>601, -1040=>602, -1041=>603, -1042=>604, -1043=>605, -1044=>606, -1045=>607, -1025=>608, -1046=>609, -1047=>610, -1048=>611, -1049=>612, -1050=>613, -1051=>614, -1052=>615, -1053=>616, -1054=>617, -1055=>618, -1056=>619, -1057=>620, -1058=>621, -1059=>622, -1060=>623, -1061=>624, -1062=>625, -1063=>626, -1064=>627, -1065=>628, -1066=>629, -1067=>630, -1068=>631, -1069=>632, -1070=>633, -1071=>634, -1072=>635, -1073=>636, -1074=>637, -1075=>638, -1076=>639, -1077=>640, -1105=>641, -1078=>642, -1079=>643, -1080=>644, -1081=>645, -1082=>646, -1083=>647, -1084=>648, -1085=>649, -1086=>650, -1087=>651, -1088=>652, -1089=>653, -1090=>654, -1091=>655, -1092=>656, -1093=>657, -1094=>658, -1095=>659, -1096=>660, -1097=>661, -1098=>662, -1099=>663, -1100=>664, -1101=>665, -1102=>666, -1103=>667, -257=>668, -225=>669, -462=>670, -224=>671, -275=>672, -233=>673, -283=>674, -232=>675, -299=>676, -237=>677, -464=>678, -236=>679, -333=>680, -243=>681, -466=>682, -242=>683, -363=>684, -250=>685, -468=>686, -249=>687, -470=>688, -472=>689, -474=>690, -476=>691, -252=>692, -234=>693, -593=>694, -7743=>695, -59335=>695, -324=>696, -328=>697, -505=>698, -59336=>698, -609=>699, -12549=>700, -12550=>701, -12551=>702, -12552=>703, -12553=>704, -12554=>705, -12555=>706, -12556=>707, -12557=>708, -12558=>709, -12559=>710, -12560=>711, -12561=>712, -12562=>713, -12563=>714, -12564=>715, -12565=>716, -12566=>717, -12567=>718, -12568=>719, -12569=>720, -12570=>721, -12571=>722, -12572=>723, -12573=>724, -12574=>725, -12575=>726, -12576=>727, -12577=>728, -12578=>729, -12579=>730, -12580=>731, -12581=>732, -12582=>733, -12583=>734, -12584=>735, -12585=>736, -9472=>738, -9473=>739, -9474=>740, -9475=>741, -9476=>742, -9477=>743, -9478=>744, -9479=>745, -9480=>746, -9481=>747, -9482=>748, -9483=>749, -9484=>750, -9485=>751, -9486=>752, -9487=>753, -9488=>754, -9489=>755, -9490=>756, -9491=>757, -9492=>758, -9493=>759, -9494=>760, -9495=>761, -9496=>762, -9497=>763, -9498=>764, -9499=>765, -9500=>766, -9501=>767, -9502=>768, -9503=>769, -9504=>770, -9505=>771, -9506=>772, -9507=>773, -9508=>774, -9509=>775, -9510=>776, -9511=>777, -9512=>778, -9513=>779, -9514=>780, -9515=>781, -9516=>782, -9517=>783, -9518=>784, -9519=>785, -9520=>786, -9521=>787, -9522=>788, -9523=>789, -9524=>790, -9525=>791, -9526=>792, -9527=>793, -9528=>794, -9529=>795, -9530=>796, -9531=>797, -9532=>798, -9533=>799, -9534=>800, -9535=>801, -9536=>802, -9537=>803, -9538=>804, -9539=>805, -9540=>806, -9541=>807, -9542=>808, -9543=>809, -9544=>810, -9545=>811, -9546=>812, -9547=>813, -21834=>940, -38463=>941, -22467=>942, -25384=>943, -21710=>944, -21769=>945, -21696=>946, -30353=>947, -30284=>948, -34108=>949, -30702=>950, -33406=>951, -30861=>952, -29233=>953, -38552=>954, -38797=>955, -27688=>956, -23433=>957, -20474=>958, -25353=>959, -26263=>960, -23736=>961, -33018=>962, -26696=>963, -32942=>964, -26114=>965, -30414=>966, -20985=>967, -25942=>968, -29100=>969, -32753=>970, -34948=>971, -20658=>972, -22885=>973, -25034=>974, -28595=>975, -33453=>976, -25420=>977, -25170=>978, -21485=>979, -21543=>980, -31494=>981, -12043=>982, -20843=>982, -30116=>983, -24052=>984, -25300=>985, -36299=>986, -38774=>987, -25226=>988, -32793=>989, -22365=>990, -38712=>991, -32610=>992, -29240=>993, -12137=>994, -30333=>994, -26575=>995, -30334=>996, -25670=>997, -20336=>998, -36133=>999, -25308=>1000, -31255=>1001, -26001=>1002, -29677=>1003, -25644=>1004, -25203=>1005, -33324=>1006, -39041=>1007, -26495=>1008, -29256=>1009, -25198=>1010, -25292=>1011, -20276=>1012, -29923=>1013, -21322=>1014, -21150=>1015, -32458=>1016, -37030=>1017, -24110=>1018, -26758=>1019, -27036=>1020, -33152=>1021, -32465=>1022, -26834=>1023, -30917=>1024, -34444=>1025, -38225=>1026, -20621=>1027, -35876=>1028, -33502=>1029, -32990=>1030, -21253=>1031, -35090=>1032, -21093=>1033, -34180=>1034, -38649=>1035, -20445=>1036, -22561=>1037, -39281=>1038, -23453=>1039, -25265=>1040, -25253=>1041, -26292=>1042, -35961=>1043, -40077=>1044, -29190=>1045, -26479=>1046, -30865=>1047, -24754=>1048, -21329=>1049, -21271=>1050, -36744=>1051, -32972=>1052, -36125=>1053, -38049=>1054, -20493=>1055, -29384=>1056, -22791=>1057, -24811=>1058, -28953=>1059, -34987=>1060, -22868=>1061, -33519=>1062, -26412=>1063, -31528=>1064, -23849=>1065, -32503=>1066, -29997=>1067, -27893=>1068, -36454=>1069, -36856=>1070, -36924=>1071, -12240=>1072, -40763=>1072, -12112=>1073, -27604=>1073, -37145=>1074, -31508=>1075, -24444=>1076, -30887=>1077, -34006=>1078, -34109=>1079, -27605=>1080, -27609=>1081, -27606=>1082, -24065=>1083, -24199=>1084, -30201=>1085, -38381=>1086, -25949=>1087, -24330=>1088, -24517=>1089, -36767=>1090, -22721=>1091, -33218=>1092, -36991=>1093, -38491=>1094, -38829=>1095, -36793=>1096, -32534=>1097, -36140=>1098, -25153=>1099, -20415=>1100, -21464=>1101, -21342=>1102, -36776=>1103, -36777=>1104, -36779=>1105, -36941=>1106, -26631=>1107, -24426=>1108, -33176=>1109, -34920=>1110, -40150=>1111, -24971=>1112, -21035=>1113, -30250=>1114, -24428=>1115, -25996=>1116, -28626=>1117, -28392=>1118, -23486=>1119, -25672=>1120, -20853=>1121, -20912=>1122, -26564=>1123, -19993=>1124, -31177=>1125, -39292=>1126, -28851=>1127, -30149=>1128, -24182=>1129, -29627=>1130, -33760=>1131, -25773=>1132, -25320=>1133, -38069=>1134, -27874=>1135, -21338=>1136, -21187=>1137, -25615=>1138, -38082=>1139, -31636=>1140, -20271=>1141, -24091=>1142, -33334=>1143, -33046=>1144, -33162=>1145, -28196=>1146, -27850=>1147, -39539=>1148, -25429=>1149, -12056=>1150, -21340=>1150, -21754=>1151, -34917=>1152, -22496=>1153, -19981=>1154, -24067=>1155, -27493=>1156, -31807=>1157, -37096=>1158, -24598=>1159, -25830=>1160, -29468=>1161, -35009=>1162, -26448=>1163, -25165=>1164, -36130=>1165, -30572=>1166, -36393=>1167, -37319=>1168, -24425=>1169, -33756=>1170, -34081=>1171, -39184=>1172, -21442=>1173, -34453=>1174, -27531=>1175, -24813=>1176, -24808=>1177, -28799=>1178, -33485=>1179, -33329=>1180, -20179=>1181, -27815=>1182, -34255=>1183, -25805=>1184, -31961=>1185, -27133=>1186, -26361=>1187, -33609=>1188, -21397=>1189, -31574=>1190, -20391=>1191, -20876=>1192, -27979=>1193, -23618=>1194, -36461=>1195, -25554=>1196, -21449=>1197, -33580=>1198, -33590=>1199, -26597=>1200, -30900=>1201, -25661=>1202, -23519=>1203, -23700=>1204, -24046=>1205, -35815=>1206, -25286=>1207, -26612=>1208, -35962=>1209, -25600=>1210, -25530=>1211, -34633=>1212, -39307=>1213, -35863=>1214, -32544=>1215, -38130=>1216, -20135=>1217, -38416=>1218, -39076=>1219, -26124=>1220, -29462=>1221, -22330=>1222, -23581=>1223, -24120=>1224, -38271=>1225, -20607=>1226, -32928=>1227, -12058=>1228, -21378=>1228, -25950=>1229, -30021=>1230, -21809=>1231, -20513=>1232, -36229=>1233, -25220=>1234, -38046=>1235, -26397=>1236, -22066=>1237, -28526=>1238, -24034=>1239, -21557=>1240, -28818=>1241, -36710=>1242, -25199=>1243, -25764=>1244, -25507=>1245, -24443=>1246, -28552=>1247, -37108=>1248, -12162=>1249, -33251=>1249, -12192=>1250, -36784=>1250, -23576=>1251, -26216=>1252, -24561=>1253, -27785=>1254, -38472=>1255, -36225=>1256, -34924=>1257, -25745=>1258, -31216=>1259, -22478=>1260, -27225=>1261, -25104=>1262, -21576=>1263, -20056=>1264, -31243=>1265, -24809=>1266, -28548=>1267, -35802=>1268, -25215=>1269, -36894=>1270, -39563=>1271, -31204=>1272, -21507=>1273, -30196=>1274, -25345=>1275, -21273=>1276, -27744=>1277, -36831=>1278, -24347=>1279, -39536=>1280, -32827=>1281, -40831=>1282, -20360=>1283, -23610=>1284, -12186=>1285, -36196=>1285, -32709=>1286, -26021=>1287, -28861=>1288, -20805=>1289, -20914=>1290, -12173=>1291, -34411=>1291, -23815=>1292, -23456=>1293, -25277=>1294, -37228=>1295, -30068=>1296, -36364=>1297, -31264=>1298, -24833=>1299, -31609=>1300, -20167=>1301, -32504=>1302, -30597=>1303, -19985=>1304, -33261=>1305, -21021=>1306, -20986=>1307, -27249=>1308, -21416=>1309, -36487=>1310, -38148=>1311, -38607=>1312, -28353=>1313, -38500=>1314, -26970=>1315, -30784=>1316, -20648=>1317, -30679=>1318, -25616=>1319, -35302=>1320, -22788=>1321, -25571=>1322, -24029=>1323, -31359=>1324, -26941=>1325, -20256=>1326, -33337=>1327, -21912=>1328, -20018=>1329, -30126=>1330, -31383=>1331, -24162=>1332, -24202=>1333, -38383=>1334, -21019=>1335, -21561=>1336, -28810=>1337, -25462=>1338, -38180=>1339, -22402=>1340, -26149=>1341, -26943=>1342, -37255=>1343, -21767=>1344, -28147=>1345, -32431=>1346, -34850=>1347, -25139=>1348, -32496=>1349, -30133=>1350, -33576=>1351, -30913=>1352, -38604=>1353, -36766=>1354, -24904=>1355, -29943=>1356, -35789=>1357, -27492=>1358, -21050=>1359, -36176=>1360, -27425=>1361, -32874=>1362, -33905=>1363, -22257=>1364, -21254=>1365, -20174=>1366, -19995=>1367, -20945=>1368, -31895=>1369, -37259=>1370, -31751=>1371, -20419=>1372, -36479=>1373, -31713=>1374, -31388=>1375, -25703=>1376, -23828=>1377, -20652=>1378, -33030=>1379, -30209=>1380, -31929=>1381, -28140=>1382, -32736=>1383, -26449=>1384, -23384=>1385, -12072=>1386, -23544=>1386, -30923=>1387, -25774=>1388, -25619=>1389, -25514=>1390, -25387=>1391, -38169=>1392, -25645=>1393, -36798=>1394, -31572=>1395, -30249=>1396, -25171=>1397, -12068=>1398, -22823=>1398, -21574=>1399, -12109=>1400, -27513=>1400, -20643=>1401, -25140=>1402, -24102=>1403, -27526=>1404, -20195=>1405, -36151=>1406, -34955=>1407, -24453=>1408, -36910=>1409, -24608=>1410, -32829=>1411, -25285=>1412, -20025=>1413, -21333=>1414, -37112=>1415, -25528=>1416, -32966=>1417, -26086=>1418, -27694=>1419, -20294=>1420, -24814=>1421, -28129=>1422, -35806=>1423, -24377=>1424, -34507=>1425, -24403=>1426, -25377=>1427, -20826=>1428, -33633=>1429, -26723=>1430, -12049=>1431, -20992=>1431, -25443=>1432, -36424=>1433, -20498=>1434, -23707=>1435, -31095=>1436, -23548=>1437, -21040=>1438, -31291=>1439, -24764=>1440, -36947=>1441, -30423=>1442, -24503=>1443, -24471=>1444, -30340=>1445, -36460=>1446, -28783=>1447, -30331=>1448, -31561=>1449, -30634=>1450, -20979=>1451, -37011=>1452, -22564=>1453, -20302=>1454, -28404=>1455, -36842=>1456, -25932=>1457, -31515=>1458, -29380=>1459, -28068=>1460, -32735=>1461, -23265=>1462, -25269=>1463, -24213=>1464, -22320=>1465, -33922=>1466, -31532=>1467, -24093=>1468, -24351=>1469, -36882=>1470, -32532=>1471, -39072=>1472, -25474=>1473, -28359=>1474, -30872=>1475, -28857=>1476, -20856=>1477, -38747=>1478, -22443=>1479, -30005=>1480, -20291=>1481, -30008=>1482, -24215=>1483, -24806=>1484, -22880=>1485, -28096=>1486, -27583=>1487, -30857=>1488, -21500=>1489, -38613=>1490, -20939=>1491, -20993=>1492, -25481=>1493, -21514=>1494, -38035=>1495, -35843=>1496, -36300=>1497, -29241=>1498, -30879=>1499, -34678=>1500, -36845=>1501, -35853=>1502, -21472=>1503, -19969=>1504, -30447=>1505, -21486=>1506, -38025=>1507, -39030=>1508, -12237=>1509, -40718=>1509, -38189=>1510, -23450=>1511, -35746=>1512, -20002=>1513, -19996=>1514, -20908=>1515, -33891=>1516, -25026=>1517, -21160=>1518, -26635=>1519, -20375=>1520, -24683=>1521, -20923=>1522, -27934=>1523, -20828=>1524, -25238=>1525, -12099=>1526, -26007=>1526, -38497=>1527, -12182=>1528, -35910=>1528, -36887=>1529, -30168=>1530, -37117=>1531, -30563=>1532, -27602=>1533, -29322=>1534, -29420=>1535, -35835=>1536, -22581=>1537, -30585=>1538, -36172=>1539, -26460=>1540, -38208=>1541, -32922=>1542, -24230=>1543, -28193=>1544, -22930=>1545, -31471=>1546, -30701=>1547, -38203=>1548, -27573=>1549, -26029=>1550, -32526=>1551, -22534=>1552, -20817=>1553, -38431=>1554, -23545=>1555, -22697=>1556, -21544=>1557, -36466=>1558, -25958=>1559, -39039=>1560, -22244=>1561, -38045=>1562, -30462=>1563, -36929=>1564, -25479=>1565, -21702=>1566, -22810=>1567, -22842=>1568, -22427=>1569, -36530=>1570, -26421=>1571, -36346=>1572, -33333=>1573, -21057=>1574, -24816=>1575, -22549=>1576, -34558=>1577, -23784=>1578, -40517=>1579, -20420=>1580, -39069=>1581, -35769=>1582, -23077=>1583, -24694=>1584, -21380=>1585, -25212=>1586, -36943=>1587, -37122=>1588, -39295=>1589, -24681=>1590, -12157=>1591, -32780=>1591, -12041=>1592, -20799=>1592, -12159=>1593, -32819=>1593, -23572=>1594, -39285=>1595, -27953=>1596, -12038=>1597, -20108=>1597, -36144=>1598, -21457=>1599, -32602=>1600, -31567=>1601, -20240=>1602, -20047=>1603, -38400=>1604, -27861=>1605, -29648=>1606, -34281=>1607, -24070=>1608, -30058=>1609, -32763=>1610, -27146=>1611, -30718=>1612, -38034=>1613, -32321=>1614, -20961=>1615, -28902=>1616, -21453=>1617, -36820=>1618, -33539=>1619, -36137=>1620, -29359=>1621, -39277=>1622, -27867=>1623, -22346=>1624, -33459=>1625, -12101=>1626, -26041=>1626, -32938=>1627, -25151=>1628, -38450=>1629, -22952=>1630, -20223=>1631, -35775=>1632, -32442=>1633, -25918=>1634, -33778=>1635, -12206=>1636, -38750=>1636, -21857=>1637, -39134=>1638, -32933=>1639, -21290=>1640, -35837=>1641, -21536=>1642, -32954=>1643, -24223=>1644, -27832=>1645, -36153=>1646, -33452=>1647, -37210=>1648, -21545=>1649, -27675=>1650, -20998=>1651, -32439=>1652, -22367=>1653, -28954=>1654, -27774=>1655, -31881=>1656, -22859=>1657, -20221=>1658, -24575=>1659, -24868=>1660, -31914=>1661, -20016=>1662, -23553=>1663, -26539=>1664, -34562=>1665, -23792=>1666, -38155=>1667, -39118=>1668, -30127=>1669, -28925=>1670, -36898=>1671, -20911=>1672, -32541=>1673, -35773=>1674, -22857=>1675, -20964=>1676, -20315=>1677, -21542=>1678, -22827=>1679, -25975=>1680, -32932=>1681, -23413=>1682, -25206=>1683, -25282=>1684, -36752=>1685, -24133=>1686, -27679=>1687, -31526=>1688, -20239=>1689, -20440=>1690, -26381=>1691, -28014=>1692, -28074=>1693, -31119=>1694, -34993=>1695, -24343=>1696, -29995=>1697, -25242=>1698, -36741=>1699, -20463=>1700, -37340=>1701, -26023=>1702, -33071=>1703, -33105=>1704, -24220=>1705, -33104=>1706, -36212=>1707, -21103=>1708, -35206=>1709, -36171=>1710, -22797=>1711, -20613=>1712, -20184=>1713, -12201=>1714, -38428=>1714, -12119=>1715, -29238=>1715, -33145=>1716, -36127=>1717, -23500=>1718, -35747=>1719, -38468=>1720, -22919=>1721, -32538=>1722, -21648=>1723, -22134=>1724, -22030=>1725, -35813=>1726, -25913=>1727, -27010=>1728, -38041=>1729, -30422=>1730, -28297=>1731, -12082=>1732, -24178=>1732, -12130=>1733, -29976=>1733, -26438=>1734, -26577=>1735, -31487=>1736, -32925=>1737, -36214=>1738, -24863=>1739, -31174=>1740, -25954=>1741, -36195=>1742, -20872=>1743, -21018=>1744, -38050=>1745, -32568=>1746, -32923=>1747, -32434=>1748, -23703=>1749, -28207=>1750, -26464=>1751, -31705=>1752, -30347=>1753, -12220=>1754, -39640=>1754, -33167=>1755, -32660=>1756, -31957=>1757, -25630=>1758, -38224=>1759, -31295=>1760, -21578=>1761, -21733=>1762, -27468=>1763, -25601=>1764, -12093=>1765, -25096=>1765, -40509=>1766, -33011=>1767, -30105=>1768, -21106=>1769, -12208=>1770, -38761=>1770, -33883=>1771, -26684=>1772, -34532=>1773, -38401=>1774, -38548=>1775, -38124=>1776, -20010=>1777, -21508=>1778, -32473=>1779, -26681=>1780, -36319=>1781, -32789=>1782, -26356=>1783, -24218=>1784, -32697=>1785, -22466=>1786, -32831=>1787, -26775=>1788, -12079=>1789, -24037=>1789, -25915=>1790, -21151=>1791, -24685=>1792, -40858=>1793, -20379=>1794, -36524=>1795, -20844=>1796, -23467=>1797, -12088=>1798, -24339=>1798, -24041=>1799, -27742=>1800, -25329=>1801, -36129=>1802, -20849=>1803, -38057=>1804, -21246=>1805, -27807=>1806, -33503=>1807, -29399=>1808, -22434=>1809, -26500=>1810, -36141=>1811, -22815=>1812, -36764=>1813, -33735=>1814, -21653=>1815, -31629=>1816, -20272=>1817, -27837=>1818, -23396=>1819, -22993=>1820, -12238=>1821, -40723=>1821, -21476=>1822, -34506=>1823, -12219=>1824, -39592=>1824, -12181=>1825, -35895=>1825, -32929=>1826, -25925=>1827, -39038=>1828, -22266=>1829, -38599=>1830, -21038=>1831, -12128=>1832, -29916=>1832, -21072=>1833, -23521=>1834, -25346=>1835, -35074=>1836, -20054=>1837, -25296=>1838, -24618=>1839, -26874=>1840, -20851=>1841, -23448=>1842, -20896=>1843, -35266=>1844, -31649=>1845, -39302=>1846, -32592=>1847, -24815=>1848, -28748=>1849, -36143=>1850, -20809=>1851, -12084=>1852, -24191=>1852, -36891=>1853, -29808=>1854, -35268=>1855, -22317=>1856, -30789=>1857, -24402=>1858, -40863=>1859, -38394=>1860, -36712=>1861, -12225=>1862, -39740=>1862, -35809=>1863, -30328=>1864, -26690=>1865, -26588=>1866, -36330=>1867, -36149=>1868, -21053=>1869, -36746=>1870, -28378=>1871, -26829=>1872, -38149=>1873, -37101=>1874, -22269=>1875, -26524=>1876, -35065=>1877, -36807=>1878, -21704=>1879, -39608=>1880, -23401=>1881, -28023=>1882, -27686=>1883, -20133=>1884, -23475=>1885, -39559=>1886, -37219=>1887, -25000=>1888, -37039=>1889, -38889=>1890, -21547=>1891, -28085=>1892, -23506=>1893, -20989=>1894, -21898=>1895, -32597=>1896, -32752=>1897, -25788=>1898, -25421=>1899, -26097=>1900, -25022=>1901, -24717=>1902, -28938=>1903, -27735=>1904, -27721=>1905, -22831=>1906, -26477=>1907, -33322=>1908, -22741=>1909, -22158=>1910, -35946=>1911, -27627=>1912, -37085=>1913, -22909=>1914, -32791=>1915, -21495=>1916, -28009=>1917, -21621=>1918, -21917=>1919, -33655=>1920, -33743=>1921, -26680=>1922, -12146=>1923, -31166=>1923, -21644=>1924, -20309=>1925, -21512=>1926, -30418=>1927, -35977=>1928, -38402=>1929, -27827=>1930, -28088=>1931, -36203=>1932, -35088=>1933, -40548=>1934, -36154=>1935, -22079=>1936, -12234=>1937, -40657=>1937, -30165=>1938, -24456=>1939, -29408=>1940, -24680=>1941, -21756=>1942, -20136=>1943, -27178=>1944, -34913=>1945, -24658=>1946, -36720=>1947, -21700=>1948, -28888=>1949, -34425=>1950, -40511=>1951, -27946=>1952, -23439=>1953, -24344=>1954, -32418=>1955, -21897=>1956, -20399=>1957, -29492=>1958, -21564=>1959, -21402=>1960, -20505=>1961, -21518=>1962, -21628=>1963, -20046=>1964, -24573=>1965, -29786=>1966, -22774=>1967, -33899=>1968, -32993=>1969, -34676=>1970, -29392=>1971, -31946=>1972, -28246=>1973, -24359=>1974, -34382=>1975, -21804=>1976, -25252=>1977, -20114=>1978, -27818=>1979, -25143=>1980, -33457=>1981, -21719=>1982, -21326=>1983, -29502=>1984, -28369=>1985, -30011=>1986, -21010=>1987, -21270=>1988, -35805=>1989, -27088=>1990, -24458=>1991, -24576=>1992, -28142=>1993, -22351=>1994, -27426=>1995, -29615=>1996, -26707=>1997, -36824=>1998, -32531=>1999, -25442=>2000, -24739=>2001, -21796=>2002, -30186=>2003, -35938=>2004, -28949=>2005, -28067=>2006, -23462=>2007, -24187=>2008, -33618=>2009, -24908=>2010, -40644=>2011, -30970=>2012, -34647=>2013, -31783=>2014, -30343=>2015, -20976=>2016, -24822=>2017, -29004=>2018, -26179=>2019, -24140=>2020, -24653=>2021, -35854=>2022, -28784=>2023, -25381=>2024, -36745=>2025, -24509=>2026, -24674=>2027, -34516=>2028, -22238=>2029, -27585=>2030, -24724=>2031, -24935=>2032, -21321=>2033, -24800=>2034, -26214=>2035, -36159=>2036, -31229=>2037, -20250=>2038, -28905=>2039, -27719=>2040, -35763=>2041, -35826=>2042, -32472=>2043, -33636=>2044, -26127=>2045, -23130=>2046, -39746=>2047, -27985=>2048, -28151=>2049, -35905=>2050, -27963=>2051, -20249=>2052, -12117=>2053, -28779=>2053, -33719=>2054, -25110=>2055, -24785=>2056, -38669=>2057, -36135=>2058, -31096=>2059, -20987=>2060, -22334=>2061, -22522=>2062, -26426=>2063, -30072=>2064, -31293=>2065, -31215=>2066, -31637=>2067, -32908=>2068, -39269=>2069, -36857=>2070, -28608=>2071, -35749=>2072, -40481=>2073, -23020=>2074, -32489=>2075, -32521=>2076, -21513=>2077, -26497=>2078, -26840=>2079, -36753=>2080, -31821=>2081, -38598=>2082, -21450=>2083, -24613=>2084, -30142=>2085, -27762=>2086, -21363=>2087, -23241=>2088, -32423=>2089, -25380=>2090, -12047=>2091, -20960=>2091, -33034=>2092, -12080=>2093, -24049=>2093, -34015=>2094, -25216=>2095, -20864=>2096, -23395=>2097, -20238=>2098, -31085=>2099, -21058=>2100, -24760=>2101, -27982=>2102, -23492=>2103, -23490=>2104, -35745=>2105, -35760=>2106, -26082=>2107, -24524=>2108, -38469=>2109, -22931=>2110, -32487=>2111, -32426=>2112, -22025=>2113, -26551=>2114, -22841=>2115, -20339=>2116, -23478=>2117, -21152=>2118, -33626=>2119, -39050=>2120, -36158=>2121, -30002=>2122, -38078=>2123, -20551=>2124, -31292=>2125, -20215=>2126, -26550=>2127, -39550=>2128, -23233=>2129, -27516=>2130, -30417=>2131, -22362=>2132, -23574=>2133, -31546=>2134, -38388=>2135, -29006=>2136, -20860=>2137, -32937=>2138, -33392=>2139, -22904=>2140, -32516=>2141, -33575=>2142, -26816=>2143, -26604=>2144, -30897=>2145, -30839=>2146, -25315=>2147, -25441=>2148, -31616=>2149, -20461=>2150, -21098=>2151, -20943=>2152, -33616=>2153, -27099=>2154, -37492=>2155, -36341=>2156, -36145=>2157, -35265=>2158, -38190=>2159, -31661=>2160, -20214=>2161, -20581=>2162, -33328=>2163, -21073=>2164, -39279=>2165, -28176=>2166, -28293=>2167, -28071=>2168, -24314=>2169, -20725=>2170, -23004=>2171, -23558=>2172, -27974=>2173, -27743=>2174, -30086=>2175, -33931=>2176, -26728=>2177, -22870=>2178, -35762=>2179, -21280=>2180, -37233=>2181, -38477=>2182, -34121=>2183, -26898=>2184, -30977=>2185, -28966=>2186, -33014=>2187, -20132=>2188, -37066=>2189, -27975=>2190, -39556=>2191, -23047=>2192, -22204=>2193, -25605=>2194, -38128=>2195, -30699=>2196, -20389=>2197, -33050=>2198, -29409=>2199, -12179=>2200, -35282=>2200, -39290=>2201, -32564=>2202, -32478=>2203, -21119=>2204, -25945=>2205, -37237=>2206, -36735=>2207, -36739=>2208, -21483=>2209, -31382=>2210, -25581=>2211, -25509=>2212, -30342=>2213, -31224=>2214, -34903=>2215, -38454=>2216, -25130=>2217, -21163=>2218, -33410=>2219, -26708=>2220, -26480=>2221, -25463=>2222, -30571=>2223, -31469=>2224, -27905=>2225, -32467=>2226, -35299=>2227, -22992=>2228, -25106=>2229, -34249=>2230, -33445=>2231, -30028=>2232, -20511=>2233, -20171=>2234, -30117=>2235, -35819=>2236, -23626=>2237, -12081=>2238, -24062=>2238, -31563=>2239, -12100=>2240, -26020=>2240, -12198=>2241, -37329=>2241, -20170=>2242, -27941=>2243, -35167=>2244, -32039=>2245, -38182=>2246, -20165=>2247, -35880=>2248, -36827=>2249, -38771=>2250, -26187=>2251, -31105=>2252, -36817=>2253, -28908=>2254, -28024=>2255, -23613=>2256, -21170=>2257, -33606=>2258, -20834=>2259, -33550=>2260, -30555=>2261, -26230=>2262, -40120=>2263, -20140=>2264, -24778=>2265, -31934=>2266, -31923=>2267, -32463=>2268, -20117=>2269, -35686=>2270, -26223=>2271, -39048=>2272, -38745=>2273, -22659=>2274, -25964=>2275, -38236=>2276, -24452=>2277, -30153=>2278, -38742=>2279, -31455=>2280, -31454=>2281, -20928=>2282, -28847=>2283, -31384=>2284, -25578=>2285, -31350=>2286, -32416=>2287, -29590=>2288, -12210=>2289, -38893=>2289, -20037=>2290, -28792=>2291, -20061=>2292, -37202=>2293, -21417=>2294, -25937=>2295, -26087=>2296, -12165=>2297, -33276=>2297, -33285=>2298, -21646=>2299, -23601=>2300, -30106=>2301, -38816=>2302, -25304=>2303, -29401=>2304, -30141=>2305, -23621=>2306, -39545=>2307, -33738=>2308, -23616=>2309, -21632=>2310, -30697=>2311, -20030=>2312, -27822=>2313, -32858=>2314, -25298=>2315, -25454=>2316, -24040=>2317, -20855=>2318, -36317=>2319, -36382=>2320, -38191=>2321, -20465=>2322, -21477=>2323, -24807=>2324, -28844=>2325, -21095=>2326, -25424=>2327, -40515=>2328, -23071=>2329, -20518=>2330, -30519=>2331, -21367=>2332, -32482=>2333, -25733=>2334, -25899=>2335, -25225=>2336, -25496=>2337, -20500=>2338, -29237=>2339, -35273=>2340, -20915=>2341, -35776=>2342, -32477=>2343, -22343=>2344, -33740=>2345, -38055=>2346, -20891=>2347, -21531=>2348, -23803=>2349, -20426=>2350, -31459=>2351, -27994=>2352, -37089=>2353, -39567=>2354, -21888=>2355, -21654=>2356, -21345=>2357, -21679=>2358, -24320=>2359, -25577=>2360, -26999=>2361, -20975=>2362, -24936=>2363, -21002=>2364, -22570=>2365, -21208=>2366, -22350=>2367, -30733=>2368, -30475=>2369, -24247=>2370, -24951=>2371, -31968=>2372, -25179=>2373, -25239=>2374, -20130=>2375, -28821=>2376, -32771=>2377, -25335=>2378, -28900=>2379, -38752=>2380, -22391=>2381, -33499=>2382, -26607=>2383, -26869=>2384, -30933=>2385, -39063=>2386, -31185=>2387, -22771=>2388, -21683=>2389, -21487=>2390, -28212=>2391, -20811=>2392, -21051=>2393, -23458=>2394, -35838=>2395, -32943=>2396, -21827=>2397, -22438=>2398, -24691=>2399, -22353=>2400, -21549=>2401, -31354=>2402, -24656=>2403, -23380=>2404, -25511=>2405, -25248=>2406, -12061=>2407, -21475=>2407, -25187=>2408, -23495=>2409, -26543=>2410, -21741=>2411, -31391=>2412, -33510=>2413, -37239=>2414, -24211=>2415, -35044=>2416, -22840=>2417, -22446=>2418, -25358=>2419, -36328=>2420, -33007=>2421, -22359=>2422, -31607=>2423, -20393=>2424, -24555=>2425, -23485=>2426, -27454=>2427, -21281=>2428, -31568=>2429, -29378=>2430, -26694=>2431, -30719=>2432, -30518=>2433, -26103=>2434, -20917=>2435, -20111=>2436, -30420=>2437, -23743=>2438, -31397=>2439, -33909=>2440, -22862=>2441, -39745=>2442, -20608=>2443, -39304=>2444, -24871=>2445, -28291=>2446, -22372=>2447, -26118=>2448, -25414=>2449, -22256=>2450, -25324=>2451, -25193=>2452, -24275=>2453, -38420=>2454, -22403=>2455, -25289=>2456, -21895=>2457, -34593=>2458, -33098=>2459, -36771=>2460, -21862=>2461, -33713=>2462, -26469=>2463, -36182=>2464, -34013=>2465, -23146=>2466, -26639=>2467, -25318=>2468, -31726=>2469, -38417=>2470, -20848=>2471, -28572=>2472, -35888=>2473, -25597=>2474, -35272=>2475, -25042=>2476, -32518=>2477, -28866=>2478, -28389=>2479, -29701=>2480, -27028=>2481, -29436=>2482, -24266=>2483, -37070=>2484, -26391=>2485, -28010=>2486, -25438=>2487, -21171=>2488, -29282=>2489, -12156=>2490, -32769=>2490, -20332=>2491, -23013=>2492, -37226=>2493, -28889=>2494, -28061=>2495, -21202=>2496, -20048=>2497, -38647=>2498, -38253=>2499, -34174=>2500, -30922=>2501, -32047=>2502, -20769=>2503, -22418=>2504, -25794=>2505, -32907=>2506, -31867=>2507, -27882=>2508, -26865=>2509, -26974=>2510, -20919=>2511, -21400=>2512, -26792=>2513, -29313=>2514, -40654=>2515, -31729=>2516, -29432=>2517, -31163=>2518, -28435=>2519, -29702=>2520, -26446=>2521, -12197=>2522, -37324=>2522, -40100=>2523, -31036=>2524, -33673=>2525, -33620=>2526, -21519=>2527, -26647=>2528, -20029=>2529, -21385=>2530, -21169=>2531, -30782=>2532, -21382=>2533, -21033=>2534, -20616=>2535, -20363=>2536, -20432=>2537, -30178=>2538, -12148=>2539, -31435=>2539, -31890=>2540, -27813=>2541, -12202=>2542, -38582=>2542, -12050=>2543, -21147=>2543, -29827=>2544, -21737=>2545, -20457=>2546, -32852=>2547, -33714=>2548, -36830=>2549, -38256=>2550, -24265=>2551, -24604=>2552, -28063=>2553, -24088=>2554, -25947=>2555, -33080=>2556, -38142=>2557, -24651=>2558, -28860=>2559, -32451=>2560, -31918=>2561, -20937=>2562, -63865=>2562, -26753=>2563, -31921=>2564, -33391=>2565, -20004=>2566, -36742=>2567, -37327=>2568, -26238=>2569, -20142=>2570, -35845=>2571, -25769=>2572, -32842=>2573, -20698=>2574, -30103=>2575, -29134=>2576, -23525=>2577, -36797=>2578, -28518=>2579, -20102=>2580, -25730=>2581, -38243=>2582, -24278=>2583, -26009=>2584, -21015=>2585, -35010=>2586, -28872=>2587, -21155=>2588, -29454=>2589, -29747=>2590, -26519=>2591, -30967=>2592, -38678=>2593, -20020=>2594, -37051=>2595, -40158=>2596, -28107=>2597, -20955=>2598, -36161=>2599, -21533=>2600, -25294=>2601, -29618=>2602, -33777=>2603, -38646=>2604, -40836=>2605, -38083=>2606, -20278=>2607, -32666=>2608, -20940=>2609, -28789=>2610, -38517=>2611, -23725=>2612, -39046=>2613, -21478=>2614, -20196=>2615, -28316=>2616, -29705=>2617, -27060=>2618, -30827=>2619, -39311=>2620, -30041=>2621, -21016=>2622, -30244=>2623, -27969=>2624, -26611=>2625, -20845=>2626, -40857=>2627, -32843=>2628, -21657=>2629, -31548=>2630, -31423=>2631, -38534=>2632, -22404=>2633, -25314=>2634, -38471=>2635, -27004=>2636, -23044=>2637, -25602=>2638, -31699=>2639, -28431=>2640, -38475=>2641, -33446=>2642, -21346=>2643, -39045=>2644, -24208=>2645, -28809=>2646, -25523=>2647, -21348=>2648, -34383=>2649, -40065=>2650, -40595=>2651, -30860=>2652, -38706=>2653, -36335=>2654, -36162=>2655, -12229=>2656, -40575=>2656, -28510=>2657, -31108=>2658, -24405=>2659, -38470=>2660, -25134=>2661, -39540=>2662, -21525=>2663, -38109=>2664, -20387=>2665, -26053=>2666, -23653=>2667, -23649=>2668, -32533=>2669, -34385=>2670, -27695=>2671, -24459=>2672, -29575=>2673, -28388=>2674, -32511=>2675, -23782=>2676, -25371=>2677, -23402=>2678, -28390=>2679, -21365=>2680, -20081=>2681, -25504=>2682, -30053=>2683, -25249=>2684, -36718=>2685, -20262=>2686, -20177=>2687, -27814=>2688, -32438=>2689, -35770=>2690, -33821=>2691, -34746=>2692, -32599=>2693, -36923=>2694, -38179=>2695, -31657=>2696, -39585=>2697, -35064=>2698, -33853=>2699, -27931=>2700, -39558=>2701, -32476=>2702, -22920=>2703, -12231=>2704, -40635=>2704, -29595=>2705, -30721=>2706, -34434=>2707, -39532=>2708, -39554=>2709, -22043=>2710, -21527=>2711, -22475=>2712, -20080=>2713, -40614=>2714, -21334=>2715, -36808=>2716, -33033=>2717, -30610=>2718, -39314=>2719, -34542=>2720, -28385=>2721, -34067=>2722, -26364=>2723, -24930=>2724, -28459=>2725, -35881=>2726, -33426=>2727, -33579=>2728, -30450=>2729, -27667=>2730, -24537=>2731, -33725=>2732, -29483=>2733, -33541=>2734, -38170=>2735, -12113=>2736, -27611=>2736, -12141=>2737, -30683=>2737, -38086=>2738, -21359=>2739, -33538=>2740, -20882=>2741, -24125=>2742, -35980=>2743, -36152=>2744, -20040=>2745, -29611=>2746, -26522=>2747, -26757=>2748, -37238=>2749, -38665=>2750, -29028=>2751, -27809=>2752, -30473=>2753, -23186=>2754, -38209=>2755, -27599=>2756, -32654=>2757, -26151=>2758, -23504=>2759, -22969=>2760, -23194=>2761, -38376=>2762, -38391=>2763, -20204=>2764, -33804=>2765, -33945=>2766, -27308=>2767, -30431=>2768, -38192=>2769, -29467=>2770, -26790=>2771, -23391=>2772, -30511=>2773, -37274=>2774, -38753=>2775, -31964=>2776, -36855=>2777, -35868=>2778, -24357=>2779, -12150=>2780, -31859=>2780, -31192=>2781, -35269=>2782, -27852=>2783, -34588=>2784, -23494=>2785, -24130=>2786, -26825=>2787, -30496=>2788, -32501=>2789, -20885=>2790, -20813=>2791, -21193=>2792, -23081=>2793, -32517=>2794, -12207=>2795, -38754=>2795, -33495=>2796, -25551=>2797, -30596=>2798, -34256=>2799, -31186=>2800, -28218=>2801, -24217=>2802, -22937=>2803, -34065=>2804, -28781=>2805, -27665=>2806, -25279=>2807, -12139=>2808, -30399=>2808, -25935=>2809, -24751=>2810, -38397=>2811, -26126=>2812, -34719=>2813, -40483=>2814, -38125=>2815, -21517=>2816, -21629=>2817, -35884=>2818, -25720=>2819, -25721=>2820, -34321=>2821, -27169=>2822, -33180=>2823, -30952=>2824, -25705=>2825, -39764=>2826, -25273=>2827, -26411=>2828, -33707=>2829, -22696=>2830, -40664=>2831, -27819=>2832, -28448=>2833, -23518=>2834, -38476=>2835, -35851=>2836, -29279=>2837, -26576=>2838, -25287=>2839, -29281=>2840, -20137=>2841, -22982=>2842, -27597=>2843, -22675=>2844, -26286=>2845, -24149=>2846, -21215=>2847, -24917=>2848, -12106=>2849, -26408=>2849, -12140=>2850, -30446=>2850, -30566=>2851, -29287=>2852, -31302=>2853, -25343=>2854, -21738=>2855, -21584=>2856, -38048=>2857, -37027=>2858, -23068=>2859, -32435=>2860, -27670=>2861, -20035=>2862, -22902=>2863, -32784=>2864, -22856=>2865, -21335=>2866, -30007=>2867, -38590=>2868, -22218=>2869, -25376=>2870, -33041=>2871, -24700=>2872, -38393=>2873, -28118=>2874, -21602=>2875, -39297=>2876, -20869=>2877, -23273=>2878, -33021=>2879, -22958=>2880, -38675=>2881, -20522=>2882, -27877=>2883, -23612=>2884, -25311=>2885, -20320=>2886, -21311=>2887, -33147=>2888, -36870=>2889, -28346=>2890, -34091=>2891, -25288=>2892, -24180=>2893, -30910=>2894, -25781=>2895, -25467=>2896, -24565=>2897, -23064=>2898, -37247=>2899, -40479=>2900, -23615=>2901, -25423=>2902, -32834=>2903, -23421=>2904, -21870=>2905, -38218=>2906, -38221=>2907, -28037=>2908, -24744=>2909, -26592=>2910, -29406=>2911, -20957=>2912, -23425=>2913, -25319=>2914, -27870=>2915, -12124=>2916, -29275=>2916, -25197=>2917, -38062=>2918, -32445=>2919, -33043=>2920, -27987=>2921, -20892=>2922, -24324=>2923, -22900=>2924, -21162=>2925, -24594=>2926, -12069=>2927, -22899=>2927, -26262=>2928, -34384=>2929, -30111=>2930, -25386=>2931, -25062=>2932, -31983=>2933, -35834=>2934, -21734=>2935, -27431=>2936, -40485=>2937, -27572=>2938, -34261=>2939, -21589=>2940, -20598=>2941, -27812=>2942, -21866=>2943, -36276=>2944, -29228=>2945, -24085=>2946, -24597=>2947, -29750=>2948, -25293=>2949, -25490=>2950, -29260=>2951, -24472=>2952, -28227=>2953, -27966=>2954, -25856=>2955, -28504=>2956, -30424=>2957, -30928=>2958, -30460=>2959, -30036=>2960, -21028=>2961, -21467=>2962, -20051=>2963, -24222=>2964, -26049=>2965, -32810=>2966, -32982=>2967, -25243=>2968, -21638=>2969, -21032=>2970, -28846=>2971, -34957=>2972, -36305=>2973, -27873=>2974, -21624=>2975, -32986=>2976, -22521=>2977, -35060=>2978, -36180=>2979, -38506=>2980, -37197=>2981, -20329=>2982, -27803=>2983, -21943=>2984, -30406=>2985, -30768=>2986, -25256=>2987, -28921=>2988, -28558=>2989, -24429=>2990, -34028=>2991, -26842=>2992, -30844=>2993, -31735=>2994, -33192=>2995, -26379=>2996, -40527=>2997, -25447=>2998, -30896=>2999, -22383=>3000, -30738=>3001, -38713=>3002, -25209=>3003, -25259=>3004, -21128=>3005, -29749=>3006, -27607=>3007, -21860=>3008, -33086=>3009, -30130=>3010, -12138=>3011, -30382=>3011, -21305=>3012, -30174=>3013, -20731=>3014, -23617=>3015, -35692=>3016, -31687=>3017, -20559=>3018, -12122=>3019, -29255=>3019, -39575=>3020, -39128=>3021, -28418=>3022, -29922=>3023, -31080=>3024, -25735=>3025, -30629=>3026, -25340=>3027, -39057=>3028, -36139=>3029, -21697=>3030, -32856=>3031, -20050=>3032, -22378=>3033, -33529=>3034, -33805=>3035, -24179=>3036, -20973=>3037, -29942=>3038, -35780=>3039, -23631=>3040, -22369=>3041, -27900=>3042, -39047=>3043, -23110=>3044, -30772=>3045, -39748=>3046, -36843=>3047, -31893=>3048, -21078=>3049, -25169=>3050, -38138=>3051, -20166=>3052, -33670=>3053, -33889=>3054, -33769=>3055, -33970=>3056, -22484=>3057, -26420=>3058, -22275=>3059, -26222=>3060, -28006=>3061, -35889=>3062, -26333=>3063, -28689=>3064, -26399=>3065, -27450=>3066, -26646=>3067, -25114=>3068, -22971=>3069, -19971=>3070, -20932=>3071, -28422=>3072, -26578=>3073, -27791=>3074, -20854=>3075, -26827=>3076, -22855=>3077, -27495=>3078, -30054=>3079, -23822=>3080, -33040=>3081, -40784=>3082, -26071=>3083, -31048=>3084, -31041=>3085, -39569=>3086, -36215=>3087, -23682=>3088, -20062=>3089, -20225=>3090, -21551=>3091, -22865=>3092, -30732=>3093, -22120=>3094, -12115=>3095, -27668=>3095, -36804=>3096, -24323=>3097, -27773=>3098, -27875=>3099, -35755=>3100, -25488=>3101, -24688=>3102, -27965=>3103, -29301=>3104, -25190=>3105, -38030=>3106, -38085=>3107, -21315=>3108, -36801=>3109, -31614=>3110, -20191=>3111, -35878=>3112, -20094=>3113, -40660=>3114, -38065=>3115, -38067=>3116, -21069=>3117, -28508=>3118, -36963=>3119, -27973=>3120, -35892=>3121, -22545=>3122, -23884=>3123, -12107=>3124, -27424=>3124, -27465=>3125, -26538=>3126, -21595=>3127, -33108=>3128, -32652=>3129, -22681=>3130, -34103=>3131, -24378=>3132, -25250=>3133, -27207=>3134, -38201=>3135, -25970=>3136, -24708=>3137, -26725=>3138, -30631=>3139, -20052=>3140, -20392=>3141, -24039=>3142, -38808=>3143, -25772=>3144, -32728=>3145, -23789=>3146, -20431=>3147, -31373=>3148, -20999=>3149, -33540=>3150, -19988=>3151, -24623=>3152, -31363=>3153, -38054=>3154, -20405=>3155, -20146=>3156, -31206=>3157, -29748=>3158, -21220=>3159, -33465=>3160, -25810=>3161, -31165=>3162, -23517=>3163, -27777=>3164, -38738=>3165, -36731=>3166, -27682=>3167, -20542=>3168, -21375=>3169, -28165=>3170, -25806=>3171, -26228=>3172, -27696=>3173, -24773=>3174, -39031=>3175, -35831=>3176, -24198=>3177, -29756=>3178, -31351=>3179, -31179=>3180, -19992=>3181, -37041=>3182, -29699=>3183, -27714=>3184, -22234=>3185, -37195=>3186, -27845=>3187, -36235=>3188, -21306=>3189, -34502=>3190, -26354=>3191, -36527=>3192, -23624=>3193, -39537=>3194, -28192=>3195, -21462=>3196, -23094=>3197, -40843=>3198, -36259=>3199, -21435=>3200, -22280=>3201, -39079=>3202, -26435=>3203, -37275=>3204, -27849=>3205, -20840=>3206, -30154=>3207, -25331=>3208, -12125=>3209, -29356=>3209, -21048=>3210, -21149=>3211, -32570=>3212, -28820=>3213, -30264=>3214, -21364=>3215, -40522=>3216, -27063=>3217, -30830=>3218, -38592=>3219, -35033=>3220, -32676=>3221, -28982=>3222, -29123=>3223, -20873=>3224, -26579=>3225, -29924=>3226, -22756=>3227, -25880=>3228, -22199=>3229, -35753=>3230, -39286=>3231, -25200=>3232, -32469=>3233, -24825=>3234, -28909=>3235, -22764=>3236, -20161=>3237, -12040=>3238, -20154=>3238, -24525=>3239, -38887=>3240, -20219=>3241, -35748=>3242, -20995=>3243, -22922=>3244, -32427=>3245, -25172=>3246, -20173=>3247, -12103=>3248, -26085=>3248, -25102=>3249, -33592=>3250, -33993=>3251, -33635=>3252, -34701=>3253, -29076=>3254, -28342=>3255, -23481=>3256, -32466=>3257, -20887=>3258, -25545=>3259, -26580=>3260, -12161=>3261, -32905=>3261, -33593=>3262, -34837=>3263, -20754=>3264, -23418=>3265, -22914=>3266, -36785=>3267, -20083=>3268, -27741=>3269, -12042=>3270, -20837=>3270, -35109=>3271, -36719=>3272, -38446=>3273, -34122=>3274, -29790=>3275, -38160=>3276, -38384=>3277, -28070=>3278, -33509=>3279, -24369=>3280, -25746=>3281, -27922=>3282, -33832=>3283, -33134=>3284, -40131=>3285, -22622=>3286, -36187=>3287, -19977=>3288, -21441=>3289, -20254=>3290, -25955=>3291, -26705=>3292, -21971=>3293, -20007=>3294, -25620=>3295, -39578=>3296, -25195=>3297, -23234=>3298, -29791=>3299, -12170=>3300, -33394=>3300, -28073=>3301, -26862=>3302, -20711=>3303, -33678=>3304, -30722=>3305, -26432=>3306, -21049=>3307, -27801=>3308, -32433=>3309, -20667=>3310, -21861=>3311, -29022=>3312, -31579=>3313, -26194=>3314, -29642=>3315, -33515=>3316, -26441=>3317, -12077=>3318, -23665=>3318, -21024=>3319, -29053=>3320, -34923=>3321, -38378=>3322, -38485=>3323, -25797=>3324, -36193=>3325, -33203=>3326, -21892=>3327, -27733=>3328, -25159=>3329, -32558=>3330, -22674=>3331, -20260=>3332, -21830=>3333, -36175=>3334, -26188=>3335, -19978=>3336, -23578=>3337, -35059=>3338, -26786=>3339, -25422=>3340, -31245=>3341, -28903=>3342, -33421=>3343, -21242=>3344, -38902=>3345, -23569=>3346, -21736=>3347, -37045=>3348, -32461=>3349, -22882=>3350, -36170=>3351, -34503=>3352, -12166=>3353, -33292=>3353, -33293=>3354, -36198=>3355, -25668=>3356, -23556=>3357, -24913=>3358, -28041=>3359, -31038=>3360, -35774=>3361, -30775=>3362, -30003=>3363, -21627=>3364, -20280=>3365, -12189=>3366, -36523=>3366, -28145=>3367, -23072=>3368, -32453=>3369, -31070=>3370, -27784=>3371, -23457=>3372, -23158=>3373, -29978=>3374, -32958=>3375, -24910=>3376, -28183=>3377, -22768=>3378, -12131=>3379, -29983=>3379, -29989=>3380, -29298=>3381, -21319=>3382, -32499=>3383, -30465=>3384, -30427=>3385, -21097=>3386, -32988=>3387, -22307=>3388, -24072=>3389, -22833=>3390, -29422=>3391, -26045=>3392, -28287=>3393, -35799=>3394, -12075=>3395, -23608=>3395, -34417=>3396, -12055=>3397, -21313=>3397, -12143=>3398, -30707=>3398, -25342=>3399, -26102=>3400, -20160=>3401, -12215=>3402, -39135=>3402, -34432=>3403, -23454=>3404, -35782=>3405, -21490=>3406, -12142=>3407, -30690=>3407, -20351=>3408, -23630=>3409, -39542=>3410, -22987=>3411, -24335=>3412, -12144=>3413, -31034=>3413, -12064=>3414, -22763=>3414, -19990=>3415, -26623=>3416, -20107=>3417, -25325=>3418, -35475=>3419, -36893=>3420, -21183=>3421, -26159=>3422, -21980=>3423, -22124=>3424, -36866=>3425, -20181=>3426, -20365=>3427, -37322=>3428, -39280=>3429, -12114=>3430, -27663=>3430, -24066=>3431, -24643=>3432, -23460=>3433, -35270=>3434, -35797=>3435, -25910=>3436, -12095=>3437, -25163=>3437, -12216=>3438, -39318=>3438, -23432=>3439, -23551=>3440, -25480=>3441, -21806=>3442, -21463=>3443, -30246=>3444, -20861=>3445, -34092=>3446, -26530=>3447, -26803=>3448, -27530=>3449, -25234=>3450, -36755=>3451, -21460=>3452, -33298=>3453, -28113=>3454, -30095=>3455, -20070=>3456, -36174=>3457, -23408=>3458, -29087=>3459, -34223=>3460, -26257=>3461, -26329=>3462, -32626=>3463, -34560=>3464, -12233=>3465, -40653=>3465, -12239=>3466, -40736=>3466, -23646=>3467, -26415=>3468, -36848=>3469, -26641=>3470, -26463=>3471, -25101=>3472, -31446=>3473, -22661=>3474, -24246=>3475, -25968=>3476, -28465=>3477, -24661=>3478, -21047=>3479, -32781=>3480, -25684=>3481, -34928=>3482, -29993=>3483, -24069=>3484, -26643=>3485, -25332=>3486, -38684=>3487, -21452=>3488, -29245=>3489, -35841=>3490, -12116=>3491, -27700=>3491, -30561=>3492, -31246=>3493, -21550=>3494, -30636=>3495, -39034=>3496, -33308=>3497, -35828=>3498, -30805=>3499, -26388=>3500, -28865=>3501, -26031=>3502, -25749=>3503, -22070=>3504, -24605=>3505, -31169=>3506, -21496=>3507, -19997=>3508, -27515=>3509, -32902=>3510, -23546=>3511, -21987=>3512, -22235=>3513, -20282=>3514, -20284=>3515, -39282=>3516, -24051=>3517, -26494=>3518, -32824=>3519, -24578=>3520, -39042=>3521, -36865=>3522, -23435=>3523, -35772=>3524, -35829=>3525, -25628=>3526, -33368=>3527, -25822=>3528, -22013=>3529, -33487=>3530, -37221=>3531, -20439=>3532, -32032=>3533, -36895=>3534, -31903=>3535, -20723=>3536, -22609=>3537, -28335=>3538, -23487=>3539, -35785=>3540, -32899=>3541, -37240=>3542, -33948=>3543, -31639=>3544, -34429=>3545, -38539=>3546, -38543=>3547, -32485=>3548, -39635=>3549, -30862=>3550, -23681=>3551, -31319=>3552, -36930=>3553, -38567=>3554, -31071=>3555, -23385=>3556, -25439=>3557, -31499=>3558, -34001=>3559, -26797=>3560, -21766=>3561, -32553=>3562, -29712=>3563, -32034=>3564, -38145=>3565, -25152=>3566, -22604=>3567, -20182=>3568, -23427=>3569, -22905=>3570, -22612=>3571, -29549=>3572, -25374=>3573, -36427=>3574, -36367=>3575, -32974=>3576, -33492=>3577, -25260=>3578, -21488=>3579, -27888=>3580, -37214=>3581, -22826=>3582, -24577=>3583, -27760=>3584, -22349=>3585, -25674=>3586, -36138=>3587, -30251=>3588, -28393=>3589, -22363=>3590, -27264=>3591, -30192=>3592, -28525=>3593, -35885=>3594, -35848=>3595, -22374=>3596, -27631=>3597, -34962=>3598, -30899=>3599, -25506=>3600, -21497=>3601, -28845=>3602, -27748=>3603, -22616=>3604, -25642=>3605, -22530=>3606, -26848=>3607, -33179=>3608, -21776=>3609, -31958=>3610, -20504=>3611, -36538=>3612, -28108=>3613, -36255=>3614, -28907=>3615, -25487=>3616, -28059=>3617, -28372=>3618, -32486=>3619, -33796=>3620, -26691=>3621, -36867=>3622, -28120=>3623, -38518=>3624, -35752=>3625, -22871=>3626, -29305=>3627, -34276=>3628, -33150=>3629, -30140=>3630, -35466=>3631, -26799=>3632, -21076=>3633, -36386=>3634, -38161=>3635, -25552=>3636, -39064=>3637, -36420=>3638, -21884=>3639, -20307=>3640, -26367=>3641, -22159=>3642, -24789=>3643, -28053=>3644, -21059=>3645, -23625=>3646, -22825=>3647, -28155=>3648, -22635=>3649, -12133=>3650, -30000=>3650, -29980=>3651, -24684=>3652, -33300=>3653, -33094=>3654, -25361=>3655, -26465=>3656, -36834=>3657, -30522=>3658, -36339=>3659, -36148=>3660, -38081=>3661, -24086=>3662, -21381=>3663, -21548=>3664, -28867=>3665, -27712=>3666, -24311=>3667, -20572=>3668, -20141=>3669, -24237=>3670, -25402=>3671, -33351=>3672, -36890=>3673, -26704=>3674, -37230=>3675, -30643=>3676, -21516=>3677, -38108=>3678, -24420=>3679, -31461=>3680, -26742=>3681, -25413=>3682, -31570=>3683, -32479=>3684, -30171=>3685, -20599=>3686, -25237=>3687, -22836=>3688, -36879=>3689, -20984=>3690, -31171=>3691, -31361=>3692, -22270=>3693, -24466=>3694, -36884=>3695, -28034=>3696, -23648=>3697, -12063=>3698, -22303=>3698, -21520=>3699, -20820=>3700, -28237=>3701, -22242=>3702, -25512=>3703, -39059=>3704, -33151=>3705, -34581=>3706, -35114=>3707, -36864=>3708, -21534=>3709, -23663=>3710, -33216=>3711, -25302=>3712, -25176=>3713, -33073=>3714, -40501=>3715, -38464=>3716, -39534=>3717, -39548=>3718, -26925=>3719, -22949=>3720, -25299=>3721, -21822=>3722, -25366=>3723, -21703=>3724, -34521=>3725, -27964=>3726, -23043=>3727, -12129=>3728, -29926=>3728, -34972=>3729, -27498=>3730, -22806=>3731, -35916=>3732, -24367=>3733, -28286=>3734, -29609=>3735, -39037=>3736, -20024=>3737, -28919=>3738, -23436=>3739, -30871=>3740, -25405=>3741, -26202=>3742, -30358=>3743, -24779=>3744, -23451=>3745, -23113=>3746, -19975=>3747, -33109=>3748, -27754=>3749, -29579=>3750, -20129=>3751, -26505=>3752, -12153=>3753, -32593=>3753, -24448=>3754, -26106=>3755, -26395=>3756, -24536=>3757, -22916=>3758, -23041=>3759, -24013=>3760, -24494=>3761, -21361=>3762, -38886=>3763, -36829=>3764, -26693=>3765, -22260=>3766, -21807=>3767, -24799=>3768, -20026=>3769, -28493=>3770, -32500=>3771, -33479=>3772, -33806=>3773, -22996=>3774, -20255=>3775, -20266=>3776, -23614=>3777, -32428=>3778, -26410=>3779, -34074=>3780, -21619=>3781, -30031=>3782, -32963=>3783, -21890=>3784, -39759=>3785, -20301=>3786, -28205=>3787, -35859=>3788, -23561=>3789, -24944=>3790, -21355=>3791, -30239=>3792, -28201=>3793, -34442=>3794, -12098=>3795, -25991=>3795, -38395=>3796, -32441=>3797, -21563=>3798, -31283=>3799, -32010=>3800, -38382=>3801, -21985=>3802, -32705=>3803, -29934=>3804, -25373=>3805, -34583=>3806, -28065=>3807, -31389=>3808, -25105=>3809, -26017=>3810, -21351=>3811, -25569=>3812, -27779=>3813, -24043=>3814, -21596=>3815, -38056=>3816, -20044=>3817, -27745=>3818, -35820=>3819, -23627=>3820, -12102=>3821, -26080=>3821, -33436=>3822, -26791=>3823, -21566=>3824, -21556=>3825, -12111=>3826, -27595=>3826, -27494=>3827, -20116=>3828, -25410=>3829, -21320=>3830, -33310=>3831, -20237=>3832, -20398=>3833, -22366=>3834, -25098=>3835, -38654=>3836, -26212=>3837, -29289=>3838, -21247=>3839, -21153=>3840, -24735=>3841, -35823=>3842, -26132=>3843, -29081=>3844, -26512=>3845, -35199=>3846, -30802=>3847, -30717=>3848, -26224=>3849, -22075=>3850, -21560=>3851, -38177=>3852, -29306=>3853, -31232=>3854, -24687=>3855, -24076=>3856, -24713=>3857, -33181=>3858, -12067=>3859, -22805=>3859, -24796=>3860, -29060=>3861, -28911=>3862, -28330=>3863, -27728=>3864, -29312=>3865, -27268=>3866, -34989=>3867, -24109=>3868, -20064=>3869, -23219=>3870, -21916=>3871, -38115=>3872, -27927=>3873, -31995=>3874, -38553=>3875, -25103=>3876, -32454=>3877, -30606=>3878, -34430=>3879, -21283=>3880, -38686=>3881, -36758=>3882, -26247=>3883, -23777=>3884, -20384=>3885, -29421=>3886, -19979=>3887, -21414=>3888, -22799=>3889, -21523=>3890, -25472=>3891, -38184=>3892, -20808=>3893, -20185=>3894, -40092=>3895, -32420=>3896, -21688=>3897, -36132=>3898, -34900=>3899, -33335=>3900, -38386=>3901, -28046=>3902, -24358=>3903, -23244=>3904, -26174=>3905, -38505=>3906, -29616=>3907, -29486=>3908, -21439=>3909, -33146=>3910, -39301=>3911, -32673=>3912, -23466=>3913, -38519=>3914, -38480=>3915, -32447=>3916, -30456=>3917, -21410=>3918, -38262=>3919, -12217=>3920, -39321=>3920, -31665=>3921, -35140=>3922, -28248=>3923, -20065=>3924, -32724=>3925, -31077=>3926, -35814=>3927, -24819=>3928, -21709=>3929, -20139=>3930, -39033=>3931, -24055=>3932, -27233=>3933, -20687=>3934, -21521=>3935, -35937=>3936, -33831=>3937, -30813=>3938, -38660=>3939, -21066=>3940, -21742=>3941, -22179=>3942, -38144=>3943, -28040=>3944, -23477=>3945, -28102=>3946, -26195=>3947, -12073=>3948, -23567=>3948, -23389=>3949, -26657=>3950, -32918=>3951, -21880=>3952, -31505=>3953, -25928=>3954, -26964=>3955, -20123=>3956, -27463=>3957, -34638=>3958, -38795=>3959, -21327=>3960, -25375=>3961, -25658=>3962, -37034=>3963, -26012=>3964, -32961=>3965, -35856=>3966, -20889=>3967, -26800=>3968, -21368=>3969, -34809=>3970, -25032=>3971, -27844=>3972, -27899=>3973, -35874=>3974, -23633=>3975, -34218=>3976, -33455=>3977, -38156=>3978, -27427=>3979, -12191=>3980, -36763=>3980, -26032=>3981, -24571=>3982, -12092=>3983, -24515=>3983, -20449=>3984, -34885=>3985, -26143=>3986, -33125=>3987, -29481=>3988, -24826=>3989, -20852=>3990, -21009=>3991, -22411=>3992, -24418=>3993, -37026=>3994, -12175=>3995, -34892=>3995, -37266=>3996, -24184=>3997, -26447=>3998, -24615=>3999, -22995=>4000, -20804=>4001, -20982=>4002, -33016=>4003, -21256=>4004, -27769=>4005, -38596=>4006, -29066=>4007, -20241=>4008, -20462=>4009, -32670=>4010, -26429=>4011, -21957=>4012, -38152=>4013, -31168=>4014, -34966=>4015, -32483=>4016, -22687=>4017, -25100=>4018, -38656=>4019, -34394=>4020, -22040=>4021, -39035=>4022, -24464=>4023, -35768=>4024, -33988=>4025, -37207=>4026, -21465=>4027, -26093=>4028, -24207=>4029, -30044=>4030, -24676=>4031, -32110=>4032, -23167=>4033, -32490=>4034, -32493=>4035, -36713=>4036, -21927=>4037, -23459=>4038, -24748=>4039, -26059=>4040, -12126=>4041, -29572=>4041, -36873=>4042, -30307=>4043, -30505=>4044, -32474=>4045, -38772=>4046, -34203=>4047, -23398=>4048, -12147=>4049, -31348=>4049, -38634=>4050, -12174=>4051, -34880=>4051, -21195=>4052, -29071=>4053, -24490=>4054, -26092=>4055, -35810=>4056, -23547=>4057, -39535=>4058, -24033=>4059, -27529=>4060, -27739=>4061, -35757=>4062, -35759=>4063, -36874=>4064, -36805=>4065, -21387=>4066, -25276=>4067, -40486=>4068, -40493=>4069, -21568=>4070, -20011=>4071, -33469=>4072, -12123=>4073, -29273=>4073, -34460=>4074, -23830=>4075, -34905=>4076, -28079=>4077, -38597=>4078, -21713=>4079, -20122=>4080, -35766=>4081, -28937=>4082, -21693=>4083, -38409=>4084, -28895=>4085, -28153=>4086, -30416=>4087, -20005=>4088, -30740=>4089, -34578=>4090, -23721=>4091, -24310=>4092, -12180=>4093, -35328=>4093, -39068=>4094, -38414=>4095, -28814=>4096, -27839=>4097, -22852=>4098, -25513=>4099, -30524=>4100, -34893=>4101, -28436=>4102, -33395=>4103, -22576=>4104, -29141=>4105, -21388=>4106, -30746=>4107, -38593=>4108, -21761=>4109, -24422=>4110, -28976=>4111, -23476=>4112, -35866=>4113, -39564=>4114, -27523=>4115, -22830=>4116, -40495=>4117, -31207=>4118, -26472=>4119, -25196=>4120, -20335=>4121, -30113=>4122, -12154=>4123, -32650=>4123, -27915=>4124, -38451=>4125, -27687=>4126, -20208=>4127, -30162=>4128, -20859=>4129, -26679=>4130, -28478=>4131, -36992=>4132, -33136=>4133, -22934=>4134, -29814=>4135, -25671=>4136, -23591=>4137, -36965=>4138, -31377=>4139, -35875=>4140, -23002=>4141, -21676=>4142, -33280=>4143, -33647=>4144, -35201=>4145, -32768=>4146, -26928=>4147, -22094=>4148, -32822=>4149, -29239=>4150, -37326=>4151, -20918=>4152, -20063=>4153, -39029=>4154, -25494=>4155, -19994=>4156, -21494=>4157, -26355=>4158, -33099=>4159, -22812=>4160, -28082=>4161, -12032=>4162, -19968=>4162, -22777=>4163, -21307=>4164, -25558=>4165, -38129=>4166, -20381=>4167, -20234=>4168, -12176=>4169, -34915=>4169, -39056=>4170, -22839=>4171, -36951=>4172, -31227=>4173, -20202=>4174, -33008=>4175, -30097=>4176, -27778=>4177, -23452=>4178, -23016=>4179, -24413=>4180, -26885=>4181, -34433=>4182, -20506=>4183, -24050=>4184, -12036=>4185, -20057=>4185, -30691=>4186, -20197=>4187, -33402=>4188, -25233=>4189, -26131=>4190, -12194=>4191, -37009=>4191, -23673=>4192, -20159=>4193, -24441=>4194, -33222=>4195, -36920=>4196, -32900=>4197, -30123=>4198, -20134=>4199, -35028=>4200, -24847=>4201, -27589=>4202, -24518=>4203, -20041=>4204, -30410=>4205, -28322=>4206, -35811=>4207, -35758=>4208, -35850=>4209, -35793=>4210, -24322=>4211, -32764=>4212, -32716=>4213, -32462=>4214, -33589=>4215, -33643=>4216, -22240=>4217, -27575=>4218, -12211=>4219, -38899=>4219, -38452=>4220, -23035=>4221, -21535=>4222, -38134=>4223, -28139=>4224, -23493=>4225, -39278=>4226, -23609=>4227, -24341=>4228, -38544=>4229, -21360=>4230, -33521=>4231, -27185=>4232, -23156=>4233, -40560=>4234, -24212=>4235, -32552=>4236, -33721=>4237, -33828=>4238, -33829=>4239, -33639=>4240, -34631=>4241, -36814=>4242, -36194=>4243, -30408=>4244, -24433=>4245, -39062=>4246, -30828=>4247, -26144=>4248, -21727=>4249, -25317=>4250, -20323=>4251, -33219=>4252, -30152=>4253, -24248=>4254, -38605=>4255, -36362=>4256, -34553=>4257, -21647=>4258, -27891=>4259, -28044=>4260, -27704=>4261, -24703=>4262, -21191=>4263, -12132=>4264, -29992=>4264, -24189=>4265, -20248=>4266, -24736=>4267, -24551=>4268, -23588=>4269, -30001=>4270, -37038=>4271, -38080=>4272, -29369=>4273, -27833=>4274, -28216=>4275, -12195=>4276, -37193=>4276, -26377=>4277, -21451=>4278, -21491=>4279, -20305=>4280, -37321=>4281, -35825=>4282, -12060=>4283, -21448=>4283, -24188=>4284, -36802=>4285, -28132=>4286, -20110=>4287, -30402=>4288, -27014=>4289, -34398=>4290, -24858=>4291, -33286=>4292, -20313=>4293, -20446=>4294, -36926=>4295, -40060=>4296, -24841=>4297, -28189=>4298, -28180=>4299, -38533=>4300, -20104=>4301, -23089=>4302, -12204=>4303, -38632=>4303, -19982=>4304, -23679=>4305, -31161=>4306, -23431=>4307, -35821=>4308, -12155=>4309, -32701=>4309, -12127=>4310, -29577=>4310, -22495=>4311, -33419=>4312, -37057=>4313, -21505=>4314, -36935=>4315, -21947=>4316, -23786=>4317, -24481=>4318, -24840=>4319, -27442=>4320, -29425=>4321, -32946=>4322, -35465=>4323, -28020=>4324, -23507=>4325, -35029=>4326, -39044=>4327, -35947=>4328, -39533=>4329, -40499=>4330, -28170=>4331, -20900=>4332, -20803=>4333, -22435=>4334, -34945=>4335, -21407=>4336, -25588=>4337, -36757=>4338, -22253=>4339, -21592=>4340, -22278=>4341, -29503=>4342, -28304=>4343, -32536=>4344, -36828=>4345, -33489=>4346, -24895=>4347, -24616=>4348, -38498=>4349, -12104=>4350, -26352=>4350, -32422=>4351, -36234=>4352, -36291=>4353, -38053=>4354, -23731=>4355, -31908=>4356, -12105=>4357, -26376=>4357, -24742=>4358, -38405=>4359, -32792=>4360, -20113=>4361, -37095=>4362, -21248=>4363, -38504=>4364, -20801=>4365, -36816=>4366, -34164=>4367, -37213=>4368, -26197=>4369, -38901=>4370, -23381=>4371, -21277=>4372, -30776=>4373, -26434=>4374, -26685=>4375, -21705=>4376, -28798=>4377, -23472=>4378, -36733=>4379, -20877=>4380, -22312=>4381, -21681=>4382, -25874=>4383, -26242=>4384, -36190=>4385, -36163=>4386, -33039=>4387, -33900=>4388, -36973=>4389, -31967=>4390, -20991=>4391, -34299=>4392, -26531=>4393, -26089=>4394, -28577=>4395, -34468=>4396, -36481=>4397, -22122=>4398, -36896=>4399, -30338=>4400, -28790=>4401, -29157=>4402, -36131=>4403, -25321=>4404, -21017=>4405, -27901=>4406, -36156=>4407, -24590=>4408, -22686=>4409, -24974=>4410, -26366=>4411, -36192=>4412, -25166=>4413, -21939=>4414, -28195=>4415, -26413=>4416, -36711=>4417, -38113=>4418, -38392=>4419, -30504=>4420, -26629=>4421, -27048=>4422, -21643=>4423, -20045=>4424, -28856=>4425, -35784=>4426, -25688=>4427, -25995=>4428, -23429=>4429, -31364=>4430, -20538=>4431, -23528=>4432, -30651=>4433, -27617=>4434, -35449=>4435, -31896=>4436, -27838=>4437, -30415=>4438, -26025=>4439, -36759=>4440, -23853=>4441, -23637=>4442, -34360=>4443, -26632=>4444, -21344=>4445, -25112=>4446, -31449=>4447, -28251=>4448, -32509=>4449, -27167=>4450, -31456=>4451, -24432=>4452, -28467=>4453, -24352=>4454, -25484=>4455, -28072=>4456, -26454=>4457, -19976=>4458, -24080=>4459, -36134=>4460, -20183=>4461, -32960=>4462, -30260=>4463, -38556=>4464, -25307=>4465, -26157=>4466, -25214=>4467, -27836=>4468, -36213=>4469, -29031=>4470, -32617=>4471, -20806=>4472, -32903=>4473, -21484=>4474, -36974=>4475, -25240=>4476, -21746=>4477, -34544=>4478, -36761=>4479, -32773=>4480, -38167=>4481, -34071=>4482, -36825=>4483, -27993=>4484, -29645=>4485, -26015=>4486, -30495=>4487, -29956=>4488, -30759=>4489, -33275=>4490, -36126=>4491, -38024=>4492, -20390=>4493, -26517=>4494, -30137=>4495, -35786=>4496, -38663=>4497, -25391=>4498, -38215=>4499, -38453=>4500, -33976=>4501, -25379=>4502, -30529=>4503, -24449=>4504, -29424=>4505, -20105=>4506, -24596=>4507, -25972=>4508, -25327=>4509, -27491=>4510, -25919=>4511, -24103=>4512, -30151=>4513, -37073=>4514, -35777=>4515, -33437=>4516, -26525=>4517, -12096=>4518, -25903=>4518, -21553=>4519, -34584=>4520, -30693=>4521, -32930=>4522, -33026=>4523, -27713=>4524, -20043=>4525, -32455=>4526, -32844=>4527, -30452=>4528, -26893=>4529, -27542=>4530, -25191=>4531, -20540=>4532, -20356=>4533, -22336=>4534, -25351=>4535, -12108=>4536, -27490=>4536, -36286=>4537, -21482=>4538, -26088=>4539, -32440=>4540, -24535=>4541, -25370=>4542, -25527=>4543, -12164=>4544, -33267=>4544, -33268=>4545, -32622=>4546, -24092=>4547, -23769=>4548, -21046=>4549, -26234=>4550, -31209=>4551, -31258=>4552, -36136=>4553, -28825=>4554, -30164=>4555, -28382=>4556, -27835=>4557, -31378=>4558, -20013=>4559, -30405=>4560, -24544=>4561, -38047=>4562, -34935=>4563, -32456=>4564, -31181=>4565, -32959=>4566, -37325=>4567, -20210=>4568, -20247=>4569, -12168=>4570, -33311=>4570, -21608=>4571, -24030=>4572, -27954=>4573, -35788=>4574, -31909=>4575, -36724=>4576, -32920=>4577, -24090=>4578, -21650=>4579, -30385=>4580, -23449=>4581, -26172=>4582, -39588=>4583, -29664=>4584, -26666=>4585, -34523=>4586, -26417=>4587, -29482=>4588, -35832=>4589, -35803=>4590, -36880=>4591, -12149=>4592, -31481=>4592, -28891=>4593, -29038=>4594, -25284=>4595, -30633=>4596, -22065=>4597, -20027=>4598, -33879=>4599, -26609=>4600, -21161=>4601, -34496=>4602, -36142=>4603, -38136=>4604, -31569=>4605, -20303=>4606, -27880=>4607, -31069=>4608, -39547=>4609, -25235=>4610, -12118=>4611, -29226=>4611, -25341=>4612, -19987=>4613, -30742=>4614, -36716=>4615, -25776=>4616, -36186=>4617, -31686=>4618, -26729=>4619, -24196=>4620, -35013=>4621, -22918=>4622, -25758=>4623, -22766=>4624, -29366=>4625, -26894=>4626, -38181=>4627, -36861=>4628, -36184=>4629, -22368=>4630, -32512=>4631, -35846=>4632, -20934=>4633, -25417=>4634, -25305=>4635, -21331=>4636, -26700=>4637, -29730=>4638, -33537=>4639, -37196=>4640, -21828=>4641, -30528=>4642, -28796=>4643, -27978=>4644, -20857=>4645, -21672=>4646, -36164=>4647, -23039=>4648, -28363=>4649, -28100=>4650, -23388=>4651, -32043=>4652, -20180=>4653, -31869=>4654, -28371=>4655, -12070=>4656, -23376=>4656, -12163=>4657, -33258=>4657, -28173=>4658, -23383=>4659, -39683=>4660, -26837=>4661, -36394=>4662, -23447=>4663, -32508=>4664, -24635=>4665, -32437=>4666, -37049=>4667, -12187=>4668, -36208=>4668, -22863=>4669, -25549=>4670, -31199=>4671, -12188=>4672, -36275=>4672, -21330=>4673, -26063=>4674, -31062=>4675, -35781=>4676, -38459=>4677, -32452=>4678, -38075=>4679, -32386=>4680, -22068=>4681, -37257=>4682, -26368=>4683, -32618=>4684, -23562=>4685, -36981=>4686, -26152=>4687, -24038=>4688, -20304=>4689, -26590=>4690, -20570=>4691, -20316=>4692, -22352=>4693, -24231=>4694, -20109=>4695, -19980=>4696, -20800=>4697, -64012=>4697, -19984=>4698, -24319=>4699, -21317=>4700, -19989=>4701, -20120=>4702, -19998=>4703, -12224=>4704, -39730=>4704, -23404=>4705, -22121=>4706, -12033=>4707, -20008=>4707, -31162=>4708, -12035=>4709, -20031=>4709, -12052=>4710, -21269=>4710, -20039=>4711, -22829=>4712, -12120=>4713, -29243=>4713, -21358=>4714, -27664=>4715, -22239=>4716, -32996=>4717, -39319=>4718, -27603=>4719, -30590=>4720, -40727=>4721, -12034=>4722, -20022=>4722, -20127=>4723, -40720=>4724, -20060=>4725, -20073=>4726, -20115=>4727, -33416=>4728, -23387=>4729, -21868=>4730, -22031=>4731, -20164=>4732, -21389=>4733, -21405=>4734, -21411=>4735, -21413=>4736, -21422=>4737, -38757=>4738, -36189=>4739, -12053=>4740, -21274=>4740, -21493=>4741, -21286=>4742, -21294=>4743, -21310=>4744, -36188=>4745, -21350=>4746, -21347=>4747, -20994=>4748, -21000=>4749, -21006=>4750, -21037=>4751, -21043=>4752, -21055=>4753, -21056=>4754, -21068=>4755, -21086=>4756, -21089=>4757, -21084=>4758, -33967=>4759, -21117=>4760, -21122=>4761, -21121=>4762, -21136=>4763, -21139=>4764, -12044=>4765, -20866=>4765, -32596=>4766, -20155=>4767, -20163=>4768, -20169=>4769, -20162=>4770, -20200=>4771, -20193=>4772, -20203=>4773, -20190=>4774, -20251=>4775, -20211=>4776, -20258=>4777, -20324=>4778, -20213=>4779, -20261=>4780, -20263=>4781, -20233=>4782, -20267=>4783, -20318=>4784, -20327=>4785, -25912=>4786, -20314=>4787, -20317=>4788, -20319=>4789, -20311=>4790, -20274=>4791, -20285=>4792, -20342=>4793, -20340=>4794, -20369=>4795, -20361=>4796, -20355=>4797, -20367=>4798, -20350=>4799, -20347=>4800, -20394=>4801, -20348=>4802, -20396=>4803, -20372=>4804, -20454=>4805, -20456=>4806, -20458=>4807, -20421=>4808, -20442=>4809, -20451=>4810, -20444=>4811, -20433=>4812, -20447=>4813, -20472=>4814, -20521=>4815, -20556=>4816, -20467=>4817, -20524=>4818, -20495=>4819, -20526=>4820, -20525=>4821, -20478=>4822, -20508=>4823, -20492=>4824, -20517=>4825, -20520=>4826, -20606=>4827, -20547=>4828, -20565=>4829, -20552=>4830, -20558=>4831, -20588=>4832, -20603=>4833, -20645=>4834, -20647=>4835, -20649=>4836, -20666=>4837, -20694=>4838, -20742=>4839, -20717=>4840, -20716=>4841, -20710=>4842, -20718=>4843, -20743=>4844, -20747=>4845, -20189=>4846, -27709=>4847, -20312=>4848, -20325=>4849, -20430=>4850, -12245=>4851, -40864=>4851, -27718=>4852, -31860=>4853, -20846=>4854, -24061=>4855, -40649=>4856, -39320=>4857, -20865=>4858, -22804=>4859, -12051=>4860, -21241=>4860, -21261=>4861, -35335=>4862, -21264=>4863, -20971=>4864, -22809=>4865, -20821=>4866, -12039=>4867, -20128=>4867, -20822=>4868, -20147=>4869, -34926=>4870, -34980=>4871, -20149=>4872, -33044=>4873, -35026=>4874, -31104=>4875, -23348=>4876, -34819=>4877, -32696=>4878, -12046=>4879, -20907=>4879, -20913=>4880, -20925=>4881, -20924=>4882, -20935=>4883, -12045=>4884, -20886=>4884, -20898=>4885, -20901=>4886, -35744=>4887, -35750=>4888, -35751=>4889, -35754=>4890, -35764=>4891, -35765=>4892, -35767=>4893, -35778=>4894, -35779=>4895, -35787=>4896, -35791=>4897, -35790=>4898, -35794=>4899, -35795=>4900, -35796=>4901, -35798=>4902, -35800=>4903, -35801=>4904, -35804=>4905, -35807=>4906, -35808=>4907, -35812=>4908, -35816=>4909, -35817=>4910, -35822=>4911, -35824=>4912, -35827=>4913, -35830=>4914, -35833=>4915, -35836=>4916, -35839=>4917, -35840=>4918, -35842=>4919, -35844=>4920, -35847=>4921, -35852=>4922, -35855=>4923, -35857=>4924, -35858=>4925, -35860=>4926, -35861=>4927, -35862=>4928, -35865=>4929, -35867=>4930, -35864=>4931, -35869=>4932, -35871=>4933, -35872=>4934, -35873=>4935, -35877=>4936, -35879=>4937, -35882=>4938, -35883=>4939, -35886=>4940, -35887=>4941, -35890=>4942, -35891=>4943, -35893=>4944, -35894=>4945, -12057=>4946, -21353=>4946, -21370=>4947, -38429=>4948, -38434=>4949, -38433=>4950, -38449=>4951, -38442=>4952, -38461=>4953, -38460=>4954, -38466=>4955, -38473=>4956, -38484=>4957, -38495=>4958, -38503=>4959, -38508=>4960, -38514=>4961, -38516=>4962, -38536=>4963, -38541=>4964, -38551=>4965, -38576=>4966, -37015=>4967, -37019=>4968, -37021=>4969, -37017=>4970, -37036=>4971, -37025=>4972, -37044=>4973, -37043=>4974, -37046=>4975, -37050=>4976, -37048=>4977, -37040=>4978, -37071=>4979, -37061=>4980, -37054=>4981, -37072=>4982, -37060=>4983, -37063=>4984, -37075=>4985, -37094=>4986, -37090=>4987, -37084=>4988, -37079=>4989, -37083=>4990, -37099=>4991, -37103=>4992, -37118=>4993, -37124=>4994, -37154=>4995, -37150=>4996, -37155=>4997, -37169=>4998, -37167=>4999, -37177=>5000, -37187=>5001, -37190=>5002, -21005=>5003, -22850=>5004, -21154=>5005, -21164=>5006, -21165=>5007, -21182=>5008, -21759=>5009, -21200=>5010, -21206=>5011, -21232=>5012, -21471=>5013, -29166=>5014, -30669=>5015, -12085=>5016, -24308=>5016, -12048=>5017, -20981=>5017, -20988=>5018, -12223=>5019, -39727=>5019, -12059=>5020, -21430=>5020, -24321=>5021, -30042=>5022, -24047=>5023, -22348=>5024, -22441=>5025, -22433=>5026, -22654=>5027, -22716=>5028, -22725=>5029, -22737=>5030, -22313=>5031, -22316=>5032, -22314=>5033, -22323=>5034, -22329=>5035, -22318=>5036, -22319=>5037, -22364=>5038, -22331=>5039, -22338=>5040, -22377=>5041, -22405=>5042, -22379=>5043, -22406=>5044, -22396=>5045, -22395=>5046, -22376=>5047, -22381=>5048, -22390=>5049, -22387=>5050, -22445=>5051, -22436=>5052, -22412=>5053, -22450=>5054, -22479=>5055, -22439=>5056, -22452=>5057, -22419=>5058, -22432=>5059, -22485=>5060, -22488=>5061, -22490=>5062, -22489=>5063, -22482=>5064, -22456=>5065, -22516=>5066, -22511=>5067, -22520=>5068, -22500=>5069, -22493=>5070, -22539=>5071, -22541=>5072, -22525=>5073, -22509=>5074, -22528=>5075, -22558=>5076, -22553=>5077, -22596=>5078, -22560=>5079, -22629=>5080, -22636=>5081, -22657=>5082, -22665=>5083, -22682=>5084, -22656=>5085, -39336=>5086, -40729=>5087, -25087=>5088, -33401=>5089, -33405=>5090, -33407=>5091, -33423=>5092, -33418=>5093, -33448=>5094, -33412=>5095, -33422=>5096, -33425=>5097, -33431=>5098, -33433=>5099, -33451=>5100, -33464=>5101, -33470=>5102, -33456=>5103, -33480=>5104, -33482=>5105, -33507=>5106, -33432=>5107, -33463=>5108, -33454=>5109, -33483=>5110, -33484=>5111, -33473=>5112, -33449=>5113, -33460=>5114, -33441=>5115, -33450=>5116, -33439=>5117, -33476=>5118, -33486=>5119, -33444=>5120, -33505=>5121, -33545=>5122, -33527=>5123, -33508=>5124, -33551=>5125, -33543=>5126, -33500=>5127, -33524=>5128, -33490=>5129, -33496=>5130, -33548=>5131, -33531=>5132, -33491=>5133, -33553=>5134, -33562=>5135, -33542=>5136, -33556=>5137, -33557=>5138, -33504=>5139, -33493=>5140, -33564=>5141, -33617=>5142, -33627=>5143, -33628=>5144, -33544=>5145, -33682=>5146, -33596=>5147, -33588=>5148, -33585=>5149, -33691=>5150, -33630=>5151, -33583=>5152, -33615=>5153, -33607=>5154, -33603=>5155, -33631=>5156, -33600=>5157, -33559=>5158, -33632=>5159, -33581=>5160, -33594=>5161, -33587=>5162, -33638=>5163, -33637=>5164, -33640=>5165, -33563=>5166, -33641=>5167, -33644=>5168, -33642=>5169, -33645=>5170, -33646=>5171, -33712=>5172, -33656=>5173, -33715=>5174, -33716=>5175, -33696=>5176, -33706=>5177, -33683=>5178, -33692=>5179, -33669=>5180, -33660=>5181, -33718=>5182, -33705=>5183, -33661=>5184, -33720=>5185, -33659=>5186, -33688=>5187, -33694=>5188, -33704=>5189, -33722=>5190, -33724=>5191, -33729=>5192, -33793=>5193, -33765=>5194, -33752=>5195, -22535=>5196, -33816=>5197, -33803=>5198, -33757=>5199, -33789=>5200, -33750=>5201, -33820=>5202, -33848=>5203, -33809=>5204, -33798=>5205, -33748=>5206, -33759=>5207, -33807=>5208, -33795=>5209, -33784=>5210, -33785=>5211, -33770=>5212, -33733=>5213, -33728=>5214, -33830=>5215, -33776=>5216, -33761=>5217, -33884=>5218, -33873=>5219, -33882=>5220, -33881=>5221, -33907=>5222, -33927=>5223, -33928=>5224, -33914=>5225, -33929=>5226, -33912=>5227, -33852=>5228, -33862=>5229, -33897=>5230, -33910=>5231, -33932=>5232, -33934=>5233, -33841=>5234, -33901=>5235, -33985=>5236, -33997=>5237, -34000=>5238, -34022=>5239, -33981=>5240, -34003=>5241, -33994=>5242, -33983=>5243, -33978=>5244, -34016=>5245, -33953=>5246, -33977=>5247, -33972=>5248, -33943=>5249, -34021=>5250, -34019=>5251, -34060=>5252, -29965=>5253, -34104=>5254, -34032=>5255, -34105=>5256, -34079=>5257, -34106=>5258, -34134=>5259, -34107=>5260, -34047=>5261, -34044=>5262, -34137=>5263, -34120=>5264, -34152=>5265, -34148=>5266, -34142=>5267, -34170=>5268, -30626=>5269, -34115=>5270, -34162=>5271, -34171=>5272, -34212=>5273, -34216=>5274, -34183=>5275, -34191=>5276, -34169=>5277, -34222=>5278, -34204=>5279, -34181=>5280, -34233=>5281, -34231=>5282, -34224=>5283, -34259=>5284, -34241=>5285, -34268=>5286, -34303=>5287, -34343=>5288, -34309=>5289, -34345=>5290, -34326=>5291, -34364=>5292, -12086=>5293, -24318=>5293, -24328=>5294, -22844=>5295, -22849=>5296, -32823=>5297, -22869=>5298, -22874=>5299, -22872=>5300, -21263=>5301, -12074=>5302, -23586=>5302, -23589=>5303, -23596=>5304, -23604=>5305, -25164=>5306, -25194=>5307, -25247=>5308, -25275=>5309, -25290=>5310, -25306=>5311, -25303=>5312, -25326=>5313, -25378=>5314, -25334=>5315, -25401=>5316, -25419=>5317, -25411=>5318, -25517=>5319, -25590=>5320, -25457=>5321, -25466=>5322, -25486=>5323, -25524=>5324, -25453=>5325, -25516=>5326, -25482=>5327, -25449=>5328, -25518=>5329, -25532=>5330, -25586=>5331, -25592=>5332, -25568=>5333, -25599=>5334, -25540=>5335, -25566=>5336, -25550=>5337, -25682=>5338, -25542=>5339, -25534=>5340, -25669=>5341, -25665=>5342, -25611=>5343, -25627=>5344, -25632=>5345, -25612=>5346, -25638=>5347, -25633=>5348, -25694=>5349, -25732=>5350, -25709=>5351, -25750=>5352, -25722=>5353, -25783=>5354, -25784=>5355, -25753=>5356, -25786=>5357, -25792=>5358, -25808=>5359, -25815=>5360, -25828=>5361, -25826=>5362, -25865=>5363, -25893=>5364, -25902=>5365, -12087=>5366, -24331=>5366, -24530=>5367, -29977=>5368, -24337=>5369, -21343=>5370, -21489=>5371, -21501=>5372, -21481=>5373, -21480=>5374, -21499=>5375, -21522=>5376, -21526=>5377, -21510=>5378, -21579=>5379, -21586=>5380, -21587=>5381, -21588=>5382, -21590=>5383, -21571=>5384, -21537=>5385, -21591=>5386, -21593=>5387, -21539=>5388, -21554=>5389, -21634=>5390, -21652=>5391, -21623=>5392, -21617=>5393, -21604=>5394, -21658=>5395, -21659=>5396, -21636=>5397, -21622=>5398, -21606=>5399, -21661=>5400, -21712=>5401, -21677=>5402, -21698=>5403, -21684=>5404, -21714=>5405, -21671=>5406, -21670=>5407, -21715=>5408, -21716=>5409, -21618=>5410, -21667=>5411, -21717=>5412, -21691=>5413, -21695=>5414, -21708=>5415, -21721=>5416, -21722=>5417, -21724=>5418, -21673=>5419, -21674=>5420, -21668=>5421, -21725=>5422, -21711=>5423, -21726=>5424, -21787=>5425, -21735=>5426, -21792=>5427, -21757=>5428, -21780=>5429, -21747=>5430, -21794=>5431, -21795=>5432, -21775=>5433, -21777=>5434, -21799=>5435, -21802=>5436, -21863=>5437, -21903=>5438, -21941=>5439, -21833=>5440, -21869=>5441, -21825=>5442, -21845=>5443, -21823=>5444, -21840=>5445, -21820=>5446, -21815=>5447, -21846=>5448, -21877=>5449, -21878=>5450, -21879=>5451, -21811=>5452, -21808=>5453, -21852=>5454, -21899=>5455, -21970=>5456, -21891=>5457, -21937=>5458, -21945=>5459, -21896=>5460, -21889=>5461, -21919=>5462, -21886=>5463, -21974=>5464, -21905=>5465, -21883=>5466, -21983=>5467, -21949=>5468, -21950=>5469, -21908=>5470, -21913=>5471, -21994=>5472, -22007=>5473, -21961=>5474, -22047=>5475, -21969=>5476, -21995=>5477, -21996=>5478, -21972=>5479, -21990=>5480, -21981=>5481, -21956=>5482, -21999=>5483, -21989=>5484, -22002=>5485, -22003=>5486, -21964=>5487, -21965=>5488, -21992=>5489, -22005=>5490, -21988=>5491, -36756=>5492, -22046=>5493, -22024=>5494, -22028=>5495, -22017=>5496, -22052=>5497, -22051=>5498, -22014=>5499, -22016=>5500, -22055=>5501, -22061=>5502, -22104=>5503, -22073=>5504, -22103=>5505, -22060=>5506, -22093=>5507, -22114=>5508, -22105=>5509, -22108=>5510, -22092=>5511, -22100=>5512, -22150=>5513, -22116=>5514, -22129=>5515, -22123=>5516, -22139=>5517, -22140=>5518, -22149=>5519, -22163=>5520, -22191=>5521, -22228=>5522, -12062=>5523, -22231=>5523, -22237=>5524, -22241=>5525, -22261=>5526, -22251=>5527, -22265=>5528, -22271=>5529, -22276=>5530, -22282=>5531, -22281=>5532, -22300=>5533, -24079=>5534, -24089=>5535, -24084=>5536, -24081=>5537, -24113=>5538, -24123=>5539, -24124=>5540, -24119=>5541, -24132=>5542, -24148=>5543, -24155=>5544, -24158=>5545, -24161=>5546, -23692=>5547, -23674=>5548, -23693=>5549, -23696=>5550, -23702=>5551, -23688=>5552, -23704=>5553, -23705=>5554, -23697=>5555, -23706=>5556, -23708=>5557, -23733=>5558, -23714=>5559, -23741=>5560, -23724=>5561, -23723=>5562, -23729=>5563, -23715=>5564, -23745=>5565, -23735=>5566, -23748=>5567, -23762=>5568, -23780=>5569, -23755=>5570, -23781=>5571, -23810=>5572, -23811=>5573, -23847=>5574, -23846=>5575, -23854=>5576, -23844=>5577, -23838=>5578, -23814=>5579, -23835=>5580, -23896=>5581, -23870=>5582, -23860=>5583, -23869=>5584, -23916=>5585, -23899=>5586, -23919=>5587, -23901=>5588, -23915=>5589, -23883=>5590, -23882=>5591, -23913=>5592, -23924=>5593, -23938=>5594, -23961=>5595, -23965=>5596, -35955=>5597, -23991=>5598, -24005=>5599, -12091=>5600, -24435=>5600, -24439=>5601, -24450=>5602, -24455=>5603, -24457=>5604, -24460=>5605, -24469=>5606, -24473=>5607, -24476=>5608, -24488=>5609, -24493=>5610, -24501=>5611, -24508=>5612, -34914=>5613, -12090=>5614, -24417=>5614, -29357=>5615, -29360=>5616, -29364=>5617, -29367=>5618, -29368=>5619, -29379=>5620, -29377=>5621, -29390=>5622, -29389=>5623, -29394=>5624, -29416=>5625, -29423=>5626, -29417=>5627, -29426=>5628, -29428=>5629, -29431=>5630, -29441=>5631, -29427=>5632, -29443=>5633, -29434=>5634, -29435=>5635, -29463=>5636, -29459=>5637, -29473=>5638, -29450=>5639, -29470=>5640, -29469=>5641, -29461=>5642, -29474=>5643, -29497=>5644, -29477=>5645, -29484=>5646, -29496=>5647, -29489=>5648, -29520=>5649, -29517=>5650, -29527=>5651, -29536=>5652, -29548=>5653, -29551=>5654, -29566=>5655, -12167=>5656, -33307=>5656, -22821=>5657, -39143=>5658, -22820=>5659, -12065=>5660, -22786=>5660, -39267=>5661, -39271=>5662, -39272=>5663, -39273=>5664, -39274=>5665, -39275=>5666, -39276=>5667, -39284=>5668, -39287=>5669, -39293=>5670, -39296=>5671, -39300=>5672, -39303=>5673, -39306=>5674, -39309=>5675, -39312=>5676, -39313=>5677, -39315=>5678, -39316=>5679, -39317=>5680, -24192=>5681, -24209=>5682, -24203=>5683, -24214=>5684, -24229=>5685, -24224=>5686, -24249=>5687, -24245=>5688, -24254=>5689, -24243=>5690, -36179=>5691, -24274=>5692, -24273=>5693, -24283=>5694, -24296=>5695, -24298=>5696, -33210=>5697, -24516=>5698, -24521=>5699, -24534=>5700, -24527=>5701, -24579=>5702, -24558=>5703, -24580=>5704, -24545=>5705, -24548=>5706, -24574=>5707, -24581=>5708, -24582=>5709, -24554=>5710, -24557=>5711, -24568=>5712, -24601=>5713, -24629=>5714, -24614=>5715, -24603=>5716, -24591=>5717, -24589=>5718, -24617=>5719, -24619=>5720, -24586=>5721, -24639=>5722, -24609=>5723, -24696=>5724, -24697=>5725, -24699=>5726, -24698=>5727, -24642=>5728, -24682=>5729, -24701=>5730, -24726=>5731, -24730=>5732, -24749=>5733, -24733=>5734, -24707=>5735, -24722=>5736, -24716=>5737, -24731=>5738, -24812=>5739, -24763=>5740, -24753=>5741, -24797=>5742, -24792=>5743, -24774=>5744, -24794=>5745, -24756=>5746, -24864=>5747, -24870=>5748, -24853=>5749, -24867=>5750, -24820=>5751, -24832=>5752, -24846=>5753, -24875=>5754, -24906=>5755, -24949=>5756, -25004=>5757, -24980=>5758, -24999=>5759, -25015=>5760, -25044=>5761, -25077=>5762, -24541=>5763, -38579=>5764, -38377=>5765, -38379=>5766, -38385=>5767, -38387=>5768, -38389=>5769, -38390=>5770, -38396=>5771, -38398=>5772, -38403=>5773, -38404=>5774, -38406=>5775, -38408=>5776, -38410=>5777, -38411=>5778, -38412=>5779, -38413=>5780, -38415=>5781, -38418=>5782, -38421=>5783, -38422=>5784, -38423=>5785, -38425=>5786, -38426=>5787, -20012=>5788, -12121=>5789, -29247=>5789, -25109=>5790, -27701=>5791, -27732=>5792, -27740=>5793, -27722=>5794, -27811=>5795, -27781=>5796, -27792=>5797, -27796=>5798, -27788=>5799, -27752=>5800, -27753=>5801, -27764=>5802, -27766=>5803, -27782=>5804, -27817=>5805, -27856=>5806, -27860=>5807, -27821=>5808, -27895=>5809, -27896=>5810, -27889=>5811, -27863=>5812, -27826=>5813, -27872=>5814, -27862=>5815, -27898=>5816, -27883=>5817, -27886=>5818, -27825=>5819, -27859=>5820, -27887=>5821, -27902=>5822, -27961=>5823, -27943=>5824, -27916=>5825, -27971=>5826, -27976=>5827, -27911=>5828, -27908=>5829, -27929=>5830, -27918=>5831, -27947=>5832, -27981=>5833, -27950=>5834, -27957=>5835, -27930=>5836, -27983=>5837, -27986=>5838, -27988=>5839, -27955=>5840, -28049=>5841, -28015=>5842, -28062=>5843, -28064=>5844, -27998=>5845, -28051=>5846, -28052=>5847, -27996=>5848, -28000=>5849, -28028=>5850, -28003=>5851, -28186=>5852, -28103=>5853, -28101=>5854, -28126=>5855, -28174=>5856, -28095=>5857, -28128=>5858, -28177=>5859, -28134=>5860, -28125=>5861, -28121=>5862, -28182=>5863, -28075=>5864, -28172=>5865, -28078=>5866, -28203=>5867, -28270=>5868, -28238=>5869, -28267=>5870, -28338=>5871, -28255=>5872, -28294=>5873, -28243=>5874, -28244=>5875, -28210=>5876, -28197=>5877, -28228=>5878, -28383=>5879, -28337=>5880, -28312=>5881, -28384=>5882, -28461=>5883, -28386=>5884, -28325=>5885, -28327=>5886, -28349=>5887, -28347=>5888, -28343=>5889, -28375=>5890, -28340=>5891, -28367=>5892, -28303=>5893, -28354=>5894, -28319=>5895, -28514=>5896, -28486=>5897, -28487=>5898, -28452=>5899, -28437=>5900, -28409=>5901, -28463=>5902, -28470=>5903, -28491=>5904, -28532=>5905, -28458=>5906, -28425=>5907, -28457=>5908, -28553=>5909, -28557=>5910, -28556=>5911, -28536=>5912, -28530=>5913, -28540=>5914, -28538=>5915, -28625=>5916, -28617=>5917, -28583=>5918, -28601=>5919, -28598=>5920, -28610=>5921, -28641=>5922, -28654=>5923, -28638=>5924, -28640=>5925, -28655=>5926, -28698=>5927, -28707=>5928, -28699=>5929, -28729=>5930, -28725=>5931, -28751=>5932, -28766=>5933, -12071=>5934, -23424=>5934, -23428=>5935, -23445=>5936, -23443=>5937, -23461=>5938, -23480=>5939, -29999=>5940, -39582=>5941, -25652=>5942, -23524=>5943, -23534=>5944, -35120=>5945, -23536=>5946, -36423=>5947, -35591=>5948, -36790=>5949, -36819=>5950, -36821=>5951, -36837=>5952, -36846=>5953, -36836=>5954, -36841=>5955, -36838=>5956, -36851=>5957, -36840=>5958, -36869=>5959, -36868=>5960, -36875=>5961, -36902=>5962, -36881=>5963, -36877=>5964, -36886=>5965, -36897=>5966, -36917=>5967, -36918=>5968, -36909=>5969, -36911=>5970, -36932=>5971, -36945=>5972, -36946=>5973, -36944=>5974, -36968=>5975, -36952=>5976, -36962=>5977, -36955=>5978, -26297=>5979, -36980=>5980, -36989=>5981, -36994=>5982, -37000=>5983, -36995=>5984, -37003=>5985, -12089=>5986, -24400=>5986, -24407=>5987, -24406=>5988, -24408=>5989, -23611=>5990, -21675=>5991, -23632=>5992, -23641=>5993, -23409=>5994, -23651=>5995, -23654=>5996, -32700=>5997, -24362=>5998, -24361=>5999, -24365=>6000, -33396=>6001, -24380=>6002, -39739=>6003, -12076=>6004, -23662=>6004, -22913=>6005, -22915=>6006, -22925=>6007, -22953=>6008, -22954=>6009, -22947=>6010, -22935=>6011, -22986=>6012, -22955=>6013, -22942=>6014, -22948=>6015, -22994=>6016, -22962=>6017, -22959=>6018, -22999=>6019, -22974=>6020, -23045=>6021, -23046=>6022, -23005=>6023, -23048=>6024, -23011=>6025, -23000=>6026, -23033=>6027, -23052=>6028, -23049=>6029, -23090=>6030, -23092=>6031, -23057=>6032, -23075=>6033, -23059=>6034, -23104=>6035, -23143=>6036, -23114=>6037, -23125=>6038, -23100=>6039, -23138=>6040, -23157=>6041, -33004=>6042, -23210=>6043, -23195=>6044, -23159=>6045, -23162=>6046, -23230=>6047, -23275=>6048, -23218=>6049, -23250=>6050, -23252=>6051, -23224=>6052, -23264=>6053, -23267=>6054, -23281=>6055, -23254=>6056, -23270=>6057, -23256=>6058, -23260=>6059, -23305=>6060, -23319=>6061, -23318=>6062, -23346=>6063, -23351=>6064, -23360=>6065, -23573=>6066, -23580=>6067, -23386=>6068, -23397=>6069, -23411=>6070, -23377=>6071, -23379=>6072, -23394=>6073, -39541=>6074, -39543=>6075, -39544=>6076, -39546=>6077, -39551=>6078, -39549=>6079, -39552=>6080, -39553=>6081, -39557=>6082, -39560=>6083, -39562=>6084, -39568=>6085, -39570=>6086, -39571=>6087, -39574=>6088, -39576=>6089, -39579=>6090, -39580=>6091, -39581=>6092, -39583=>6093, -39584=>6094, -39586=>6095, -39587=>6096, -39589=>6097, -39591=>6098, -32415=>6099, -32417=>6100, -32419=>6101, -32421=>6102, -32424=>6103, -32425=>6104, -32429=>6105, -32432=>6106, -32446=>6107, -32448=>6108, -32449=>6109, -32450=>6110, -32457=>6111, -32459=>6112, -32460=>6113, -32464=>6114, -32468=>6115, -32471=>6116, -32475=>6117, -32480=>6118, -32481=>6119, -32488=>6120, -32491=>6121, -32494=>6122, -32495=>6123, -32497=>6124, -32498=>6125, -32525=>6126, -32502=>6127, -32506=>6128, -32507=>6129, -32510=>6130, -32513=>6131, -32514=>6132, -32515=>6133, -32519=>6134, -32520=>6135, -32523=>6136, -32524=>6137, -32527=>6138, -32529=>6139, -32530=>6140, -32535=>6141, -32537=>6142, -32540=>6143, -32539=>6144, -32543=>6145, -32545=>6146, -32546=>6147, -32547=>6148, -32548=>6149, -32549=>6150, -32550=>6151, -32551=>6152, -32554=>6153, -32555=>6154, -32556=>6155, -32557=>6156, -32559=>6157, -32560=>6158, -32561=>6159, -32562=>6160, -32563=>6161, -32565=>6162, -12083=>6163, -24186=>6163, -30079=>6164, -12078=>6165, -24027=>6165, -30014=>6166, -37013=>6167, -29582=>6168, -29585=>6169, -29614=>6170, -29602=>6171, -29599=>6172, -29647=>6173, -29634=>6174, -29649=>6175, -29623=>6176, -29619=>6177, -29632=>6178, -29641=>6179, -29640=>6180, -29669=>6181, -29657=>6182, -39036=>6183, -29706=>6184, -29673=>6185, -29671=>6186, -29662=>6187, -29626=>6188, -29682=>6189, -29711=>6190, -29738=>6191, -29787=>6192, -29734=>6193, -29733=>6194, -29736=>6195, -29744=>6196, -29742=>6197, -29740=>6198, -29723=>6199, -29722=>6200, -29761=>6201, -29788=>6202, -29783=>6203, -29781=>6204, -29785=>6205, -29815=>6206, -29805=>6207, -29822=>6208, -29852=>6209, -29838=>6210, -29824=>6211, -29825=>6212, -29831=>6213, -29835=>6214, -29854=>6215, -29864=>6216, -29865=>6217, -29840=>6218, -29863=>6219, -29906=>6220, -29882=>6221, -38890=>6222, -38891=>6223, -38892=>6224, -26444=>6225, -26451=>6226, -26462=>6227, -26440=>6228, -26473=>6229, -26533=>6230, -26503=>6231, -26474=>6232, -26483=>6233, -26520=>6234, -26535=>6235, -26485=>6236, -26536=>6237, -26526=>6238, -26541=>6239, -26507=>6240, -26487=>6241, -26492=>6242, -26608=>6243, -26633=>6244, -26584=>6245, -26634=>6246, -26601=>6247, -26544=>6248, -26636=>6249, -26585=>6250, -26549=>6251, -26586=>6252, -26547=>6253, -26589=>6254, -26624=>6255, -26563=>6256, -26552=>6257, -26594=>6258, -26638=>6259, -26561=>6260, -26621=>6261, -26674=>6262, -26675=>6263, -26720=>6264, -26721=>6265, -26702=>6266, -26722=>6267, -26692=>6268, -26724=>6269, -26755=>6270, -26653=>6271, -26709=>6272, -26726=>6273, -26689=>6274, -26727=>6275, -26688=>6276, -26686=>6277, -26698=>6278, -26697=>6279, -26665=>6280, -26805=>6281, -26767=>6282, -26740=>6283, -26743=>6284, -26771=>6285, -26731=>6286, -26818=>6287, -26990=>6288, -26876=>6289, -26911=>6290, -26912=>6291, -26873=>6292, -26916=>6293, -26864=>6294, -26891=>6295, -26881=>6296, -26967=>6297, -26851=>6298, -26896=>6299, -26993=>6300, -26937=>6301, -26976=>6302, -26946=>6303, -26973=>6304, -27012=>6305, -26987=>6306, -27008=>6307, -27032=>6308, -27000=>6309, -26932=>6310, -27084=>6311, -27015=>6312, -27016=>6313, -27086=>6314, -27017=>6315, -26982=>6316, -26979=>6317, -27001=>6318, -27035=>6319, -27047=>6320, -27067=>6321, -27051=>6322, -27053=>6323, -27092=>6324, -27057=>6325, -27073=>6326, -27082=>6327, -27103=>6328, -27029=>6329, -27104=>6330, -27021=>6331, -27135=>6332, -27183=>6333, -27117=>6334, -27159=>6335, -27160=>6336, -27237=>6337, -27122=>6338, -27204=>6339, -27198=>6340, -27296=>6341, -27216=>6342, -27227=>6343, -27189=>6344, -27278=>6345, -27257=>6346, -27197=>6347, -27176=>6348, -27224=>6349, -27260=>6350, -27281=>6351, -27280=>6352, -27305=>6353, -27287=>6354, -27307=>6355, -29495=>6356, -29522=>6357, -27521=>6358, -27522=>6359, -27527=>6360, -27524=>6361, -27538=>6362, -27539=>6363, -27533=>6364, -27546=>6365, -27547=>6366, -27553=>6367, -27562=>6368, -36715=>6369, -36717=>6370, -36721=>6371, -36722=>6372, -36723=>6373, -36725=>6374, -36726=>6375, -36728=>6376, -36727=>6377, -36729=>6378, -36730=>6379, -36732=>6380, -36734=>6381, -36737=>6382, -36738=>6383, -36740=>6384, -36743=>6385, -36747=>6386, -36749=>6387, -36750=>6388, -36751=>6389, -36760=>6390, -36762=>6391, -36558=>6392, -25099=>6393, -25111=>6394, -25115=>6395, -25119=>6396, -25122=>6397, -25121=>6398, -25125=>6399, -25124=>6400, -25132=>6401, -33255=>6402, -29935=>6403, -29940=>6404, -29951=>6405, -29967=>6406, -29969=>6407, -29971=>6408, -12097=>6409, -25908=>6409, -26094=>6410, -26095=>6411, -26096=>6412, -26122=>6413, -26137=>6414, -26482=>6415, -26115=>6416, -26133=>6417, -26112=>6418, -28805=>6419, -26359=>6420, -26141=>6421, -26164=>6422, -26161=>6423, -26166=>6424, -26165=>6425, -32774=>6426, -26207=>6427, -26196=>6428, -26177=>6429, -26191=>6430, -26198=>6431, -26209=>6432, -26199=>6433, -26231=>6434, -26244=>6435, -26252=>6436, -26279=>6437, -26269=>6438, -26302=>6439, -26331=>6440, -26332=>6441, -26342=>6442, -26345=>6443, -36146=>6444, -36147=>6445, -36150=>6446, -36155=>6447, -36157=>6448, -36160=>6449, -36165=>6450, -36166=>6451, -36168=>6452, -36169=>6453, -36167=>6454, -36173=>6455, -36181=>6456, -36185=>6457, -35271=>6458, -35274=>6459, -35275=>6460, -35276=>6461, -35278=>6462, -35279=>6463, -35280=>6464, -35281=>6465, -29294=>6466, -29343=>6467, -29277=>6468, -29286=>6469, -29295=>6470, -29310=>6471, -29311=>6472, -29316=>6473, -29323=>6474, -29325=>6475, -29327=>6476, -29330=>6477, -25352=>6478, -25394=>6479, -25520=>6480, -25663=>6481, -25816=>6482, -32772=>6483, -27626=>6484, -27635=>6485, -27645=>6486, -27637=>6487, -27641=>6488, -27653=>6489, -27655=>6490, -27654=>6491, -27661=>6492, -27669=>6493, -27672=>6494, -27673=>6495, -27674=>6496, -27681=>6497, -27689=>6498, -27684=>6499, -27690=>6500, -27698=>6501, -25909=>6502, -25941=>6503, -25963=>6504, -29261=>6505, -29266=>6506, -29270=>6507, -29232=>6508, -34402=>6509, -21014=>6510, -32927=>6511, -32924=>6512, -32915=>6513, -32956=>6514, -26378=>6515, -32957=>6516, -32945=>6517, -32939=>6518, -32941=>6519, -32948=>6520, -32951=>6521, -32999=>6522, -33000=>6523, -33001=>6524, -33002=>6525, -32987=>6526, -32962=>6527, -32964=>6528, -32985=>6529, -32973=>6530, -32983=>6531, -26384=>6532, -32989=>6533, -33003=>6534, -33009=>6535, -33012=>6536, -33005=>6537, -33037=>6538, -33038=>6539, -33010=>6540, -33020=>6541, -26389=>6542, -33042=>6543, -35930=>6544, -33078=>6545, -33054=>6546, -33068=>6547, -33048=>6548, -33074=>6549, -33096=>6550, -33100=>6551, -33107=>6552, -33140=>6553, -33113=>6554, -33114=>6555, -33137=>6556, -33120=>6557, -33129=>6558, -33148=>6559, -33149=>6560, -33133=>6561, -33127=>6562, -22605=>6563, -23221=>6564, -33160=>6565, -33154=>6566, -33169=>6567, -28373=>6568, -33187=>6569, -33194=>6570, -33228=>6571, -26406=>6572, -33226=>6573, -33211=>6574, -33217=>6575, -33190=>6576, -27428=>6577, -27447=>6578, -27449=>6579, -27459=>6580, -27462=>6581, -27481=>6582, -39121=>6583, -39122=>6584, -39123=>6585, -39125=>6586, -39129=>6587, -39130=>6588, -12110=>6589, -27571=>6589, -24384=>6590, -27586=>6591, -35315=>6592, -26000=>6593, -40785=>6594, -26003=>6595, -26044=>6596, -26054=>6597, -26052=>6598, -26051=>6599, -26060=>6600, -26062=>6601, -26066=>6602, -26070=>6603, -28800=>6604, -28828=>6605, -28822=>6606, -28829=>6607, -28859=>6608, -28864=>6609, -28855=>6610, -28843=>6611, -28849=>6612, -28904=>6613, -28874=>6614, -28944=>6615, -28947=>6616, -28950=>6617, -28975=>6618, -28977=>6619, -29043=>6620, -29020=>6621, -29032=>6622, -28997=>6623, -29042=>6624, -29002=>6625, -29048=>6626, -29050=>6627, -29080=>6628, -29107=>6629, -29109=>6630, -29096=>6631, -29088=>6632, -29152=>6633, -29140=>6634, -29159=>6635, -29177=>6636, -29213=>6637, -29224=>6638, -28780=>6639, -28952=>6640, -29030=>6641, -29113=>6642, -25150=>6643, -25149=>6644, -25155=>6645, -25160=>6646, -25161=>6647, -31035=>6648, -31040=>6649, -31046=>6650, -31049=>6651, -31067=>6652, -31068=>6653, -31059=>6654, -31066=>6655, -31074=>6656, -31063=>6657, -31072=>6658, -31087=>6659, -31079=>6660, -31098=>6661, -31109=>6662, -31114=>6663, -31130=>6664, -31143=>6665, -31155=>6666, -24529=>6667, -24528=>6668, -24636=>6669, -24669=>6670, -24666=>6671, -24679=>6672, -24641=>6673, -24665=>6674, -24675=>6675, -24747=>6676, -24838=>6677, -24845=>6678, -24925=>6679, -25001=>6680, -24989=>6681, -25035=>6682, -25041=>6683, -25094=>6684, -32896=>6685, -12160=>6686, -32895=>6686, -27795=>6687, -27894=>6688, -28156=>6689, -30710=>6690, -30712=>6691, -30720=>6692, -30729=>6693, -30743=>6694, -30744=>6695, -30737=>6696, -26027=>6697, -30765=>6698, -30748=>6699, -30749=>6700, -30777=>6701, -30778=>6702, -30779=>6703, -30751=>6704, -30780=>6705, -30757=>6706, -30764=>6707, -30755=>6708, -30761=>6709, -30798=>6710, -30829=>6711, -30806=>6712, -30807=>6713, -30758=>6714, -30800=>6715, -30791=>6716, -30796=>6717, -30826=>6718, -30875=>6719, -30867=>6720, -30874=>6721, -30855=>6722, -30876=>6723, -30881=>6724, -30883=>6725, -30898=>6726, -30905=>6727, -30885=>6728, -30932=>6729, -30937=>6730, -30921=>6731, -30956=>6732, -30962=>6733, -30981=>6734, -30964=>6735, -30995=>6736, -31012=>6737, -31006=>6738, -31028=>6739, -40859=>6740, -12235=>6741, -40697=>6741, -40699=>6742, -40700=>6743, -30449=>6744, -30468=>6745, -30477=>6746, -30457=>6747, -30471=>6748, -30472=>6749, -30490=>6750, -30498=>6751, -30489=>6752, -30509=>6753, -30502=>6754, -30517=>6755, -30520=>6756, -30544=>6757, -30545=>6758, -30535=>6759, -30531=>6760, -30554=>6761, -30568=>6762, -30562=>6763, -30565=>6764, -30591=>6765, -30605=>6766, -30589=>6767, -30592=>6768, -30604=>6769, -30609=>6770, -30623=>6771, -30624=>6772, -30640=>6773, -30645=>6774, -30653=>6775, -30010=>6776, -30016=>6777, -30030=>6778, -30027=>6779, -30024=>6780, -30043=>6781, -30066=>6782, -30073=>6783, -30083=>6784, -32600=>6785, -32609=>6786, -32607=>6787, -35400=>6788, -32616=>6789, -32628=>6790, -32625=>6791, -32633=>6792, -32641=>6793, -32638=>6794, -30413=>6795, -30437=>6796, -34866=>6797, -38021=>6798, -38022=>6799, -38023=>6800, -38027=>6801, -38026=>6802, -38028=>6803, -38029=>6804, -38031=>6805, -38032=>6806, -38036=>6807, -38039=>6808, -38037=>6809, -38042=>6810, -38043=>6811, -38044=>6812, -38051=>6813, -38052=>6814, -38059=>6815, -38058=>6816, -38061=>6817, -38060=>6818, -38063=>6819, -38064=>6820, -38066=>6821, -38068=>6822, -38070=>6823, -38071=>6824, -38072=>6825, -38073=>6826, -38074=>6827, -38076=>6828, -38077=>6829, -38079=>6830, -38084=>6831, -38088=>6832, -38089=>6833, -38090=>6834, -38091=>6835, -38092=>6836, -38093=>6837, -38094=>6838, -38096=>6839, -38097=>6840, -38098=>6841, -38101=>6842, -38102=>6843, -38103=>6844, -38105=>6845, -38104=>6846, -38107=>6847, -38110=>6848, -38111=>6849, -38112=>6850, -38114=>6851, -38116=>6852, -38117=>6853, -38119=>6854, -38120=>6855, -38122=>6856, -38121=>6857, -38123=>6858, -38126=>6859, -38127=>6860, -38131=>6861, -38132=>6862, -38133=>6863, -38135=>6864, -38137=>6865, -38140=>6866, -38141=>6867, -38143=>6868, -38147=>6869, -38146=>6870, -38150=>6871, -38151=>6872, -38153=>6873, -38154=>6874, -38157=>6875, -38158=>6876, -38159=>6877, -38162=>6878, -38163=>6879, -38164=>6880, -38165=>6881, -38166=>6882, -38168=>6883, -38171=>6884, -38173=>6885, -38174=>6886, -38175=>6887, -38178=>6888, -38186=>6889, -38187=>6890, -38185=>6891, -38188=>6892, -38193=>6893, -38194=>6894, -38196=>6895, -38198=>6896, -38199=>6897, -38200=>6898, -38204=>6899, -38206=>6900, -38207=>6901, -38210=>6902, -38197=>6903, -38212=>6904, -38213=>6905, -38214=>6906, -38217=>6907, -38220=>6908, -38222=>6909, -38223=>6910, -38226=>6911, -38227=>6912, -38228=>6913, -38230=>6914, -38231=>6915, -38232=>6916, -38233=>6917, -38235=>6918, -38238=>6919, -38239=>6920, -38237=>6921, -38241=>6922, -38242=>6923, -38244=>6924, -38245=>6925, -38246=>6926, -38247=>6927, -38248=>6928, -38249=>6929, -38250=>6930, -38251=>6931, -38252=>6932, -38255=>6933, -38257=>6934, -38258=>6935, -38259=>6936, -38202=>6937, -30695=>6938, -30700=>6939, -38601=>6940, -31189=>6941, -31213=>6942, -31203=>6943, -31211=>6944, -31238=>6945, -23879=>6946, -31235=>6947, -31234=>6948, -31262=>6949, -31252=>6950, -31289=>6951, -31287=>6952, -31313=>6953, -40655=>6954, -39333=>6955, -31344=>6956, -30344=>6957, -30350=>6958, -30355=>6959, -30361=>6960, -30372=>6961, -29918=>6962, -29920=>6963, -29996=>6964, -40480=>6965, -40482=>6966, -40488=>6967, -40489=>6968, -40490=>6969, -40491=>6970, -40492=>6971, -40498=>6972, -40497=>6973, -40502=>6974, -40504=>6975, -40503=>6976, -40505=>6977, -40506=>6978, -40510=>6979, -40513=>6980, -40514=>6981, -40516=>6982, -40518=>6983, -40519=>6984, -40520=>6985, -40521=>6986, -40523=>6987, -40524=>6988, -40526=>6989, -40529=>6990, -40533=>6991, -40535=>6992, -40538=>6993, -40539=>6994, -40540=>6995, -40542=>6996, -40547=>6997, -40550=>6998, -40551=>6999, -40552=>7000, -40553=>7001, -40554=>7002, -40555=>7003, -40556=>7004, -40561=>7005, -40557=>7006, -40563=>7007, -12135=>7008, -30098=>7008, -30100=>7009, -30102=>7010, -30112=>7011, -30109=>7012, -30124=>7013, -30115=>7014, -30131=>7015, -30132=>7016, -30136=>7017, -30148=>7018, -30129=>7019, -30128=>7020, -30147=>7021, -30146=>7022, -30166=>7023, -30157=>7024, -30179=>7025, -30184=>7026, -30182=>7027, -30180=>7028, -30187=>7029, -30183=>7030, -30211=>7031, -30193=>7032, -30204=>7033, -30207=>7034, -30224=>7035, -30208=>7036, -30213=>7037, -30220=>7038, -30231=>7039, -30218=>7040, -30245=>7041, -30232=>7042, -30229=>7043, -30233=>7044, -30235=>7045, -30268=>7046, -30242=>7047, -30240=>7048, -30272=>7049, -30253=>7050, -30256=>7051, -30271=>7052, -30261=>7053, -30275=>7054, -30270=>7055, -30259=>7056, -30285=>7057, -30302=>7058, -30292=>7059, -30300=>7060, -30294=>7061, -30315=>7062, -30319=>7063, -32714=>7064, -31462=>7065, -31352=>7066, -31353=>7067, -31360=>7068, -31366=>7069, -31368=>7070, -31381=>7071, -31398=>7072, -31392=>7073, -31404=>7074, -31400=>7075, -31405=>7076, -31411=>7077, -34916=>7078, -34921=>7079, -34930=>7080, -34941=>7081, -34943=>7082, -34946=>7083, -34978=>7084, -35014=>7085, -34999=>7086, -35004=>7087, -35017=>7088, -35042=>7089, -35022=>7090, -35043=>7091, -35045=>7092, -35057=>7093, -35098=>7094, -35068=>7095, -35048=>7096, -35070=>7097, -35056=>7098, -35105=>7099, -35097=>7100, -35091=>7101, -35099=>7102, -35082=>7103, -35124=>7104, -35115=>7105, -35126=>7106, -35137=>7107, -35174=>7108, -35195=>7109, -12134=>7110, -30091=>7110, -32997=>7111, -30386=>7112, -30388=>7113, -30684=>7114, -12158=>7115, -32786=>7115, -32788=>7116, -32790=>7117, -32796=>7118, -32800=>7119, -32802=>7120, -32805=>7121, -32806=>7122, -32807=>7123, -32809=>7124, -32808=>7125, -32817=>7126, -32779=>7127, -32821=>7128, -32835=>7129, -32838=>7130, -32845=>7131, -32850=>7132, -32873=>7133, -32881=>7134, -35203=>7135, -39032=>7136, -39040=>7137, -39043=>7138, -39049=>7139, -39052=>7140, -39053=>7141, -39055=>7142, -39060=>7143, -39066=>7144, -39067=>7145, -39070=>7146, -39071=>7147, -39073=>7148, -39074=>7149, -39077=>7150, -39078=>7151, -12172=>7152, -34381=>7152, -34388=>7153, -34412=>7154, -34414=>7155, -34431=>7156, -34426=>7157, -34428=>7158, -34427=>7159, -34472=>7160, -34445=>7161, -34443=>7162, -34476=>7163, -34461=>7164, -34471=>7165, -34467=>7166, -34474=>7167, -34451=>7168, -34473=>7169, -34486=>7170, -34500=>7171, -34485=>7172, -34510=>7173, -34480=>7174, -34490=>7175, -34481=>7176, -34479=>7177, -34505=>7178, -34511=>7179, -34484=>7180, -34537=>7181, -34545=>7182, -34546=>7183, -34541=>7184, -34547=>7185, -34512=>7186, -34579=>7187, -34526=>7188, -34548=>7189, -34527=>7190, -34520=>7191, -34513=>7192, -34563=>7193, -34567=>7194, -34552=>7195, -34568=>7196, -34570=>7197, -34573=>7198, -34569=>7199, -34595=>7200, -34619=>7201, -34590=>7202, -34597=>7203, -34606=>7204, -34586=>7205, -34622=>7206, -34632=>7207, -34612=>7208, -34609=>7209, -34601=>7210, -34615=>7211, -34623=>7212, -34690=>7213, -34594=>7214, -34685=>7215, -34686=>7216, -34683=>7217, -34656=>7218, -34672=>7219, -34636=>7220, -34670=>7221, -34699=>7222, -34643=>7223, -34659=>7224, -34684=>7225, -34660=>7226, -34649=>7227, -34661=>7228, -34707=>7229, -34735=>7230, -34728=>7231, -34770=>7232, -34758=>7233, -34696=>7234, -34693=>7235, -34733=>7236, -34711=>7237, -34691=>7238, -34731=>7239, -34789=>7240, -34732=>7241, -34741=>7242, -34739=>7243, -34763=>7244, -34771=>7245, -34749=>7246, -34769=>7247, -34752=>7248, -34762=>7249, -34779=>7250, -34794=>7251, -34784=>7252, -34798=>7253, -34838=>7254, -34835=>7255, -34814=>7256, -34826=>7257, -34843=>7258, -34849=>7259, -34873=>7260, -34876=>7261, -12152=>7262, -32566=>7262, -32578=>7263, -32580=>7264, -32581=>7265, -33296=>7266, -31482=>7267, -31485=>7268, -31496=>7269, -31491=>7270, -31492=>7271, -31509=>7272, -31498=>7273, -31531=>7274, -31503=>7275, -31559=>7276, -31544=>7277, -31530=>7278, -31513=>7279, -31534=>7280, -31537=>7281, -31520=>7282, -31525=>7283, -31524=>7284, -31539=>7285, -31550=>7286, -31518=>7287, -31576=>7288, -31578=>7289, -31557=>7290, -31605=>7291, -31564=>7292, -31581=>7293, -31584=>7294, -31598=>7295, -31611=>7296, -31586=>7297, -31602=>7298, -31601=>7299, -31632=>7300, -31654=>7301, -31655=>7302, -31672=>7303, -31660=>7304, -31645=>7305, -31656=>7306, -31621=>7307, -31658=>7308, -31644=>7309, -31650=>7310, -31659=>7311, -31668=>7312, -31697=>7313, -31681=>7314, -31692=>7315, -31709=>7316, -31706=>7317, -31717=>7318, -31718=>7319, -31722=>7320, -31756=>7321, -31742=>7322, -31740=>7323, -31759=>7324, -31766=>7325, -31755=>7326, -31775=>7327, -31786=>7328, -31782=>7329, -31800=>7330, -31809=>7331, -31808=>7332, -33278=>7333, -33281=>7334, -33282=>7335, -33284=>7336, -33260=>7337, -34884=>7338, -33313=>7339, -33314=>7340, -33315=>7341, -33325=>7342, -33327=>7343, -33320=>7344, -33323=>7345, -33336=>7346, -33339=>7347, -33331=>7348, -33332=>7349, -33342=>7350, -33348=>7351, -33353=>7352, -33355=>7353, -33359=>7354, -33370=>7355, -33375=>7356, -33384=>7357, -34942=>7358, -34949=>7359, -34952=>7360, -35032=>7361, -35039=>7362, -35166=>7363, -32669=>7364, -32671=>7365, -32679=>7366, -32687=>7367, -32688=>7368, -32690=>7369, -31868=>7370, -25929=>7371, -31889=>7372, -31901=>7373, -31900=>7374, -31902=>7375, -31906=>7376, -31922=>7377, -31932=>7378, -31933=>7379, -31937=>7380, -31943=>7381, -31948=>7382, -31949=>7383, -31944=>7384, -31941=>7385, -31959=>7386, -31976=>7387, -12169=>7388, -33390=>7388, -26280=>7389, -32703=>7390, -32718=>7391, -32725=>7392, -32741=>7393, -32737=>7394, -32742=>7395, -32745=>7396, -32750=>7397, -32755=>7398, -12151=>7399, -31992=>7399, -32119=>7400, -32166=>7401, -32174=>7402, -32327=>7403, -32411=>7404, -40632=>7405, -40628=>7406, -36211=>7407, -36228=>7408, -36244=>7409, -36241=>7410, -36273=>7411, -36199=>7412, -36205=>7413, -35911=>7414, -35913=>7415, -37194=>7416, -37200=>7417, -37198=>7418, -37199=>7419, -37220=>7420, -37218=>7421, -37217=>7422, -37232=>7423, -37225=>7424, -37231=>7425, -37245=>7426, -37246=>7427, -37234=>7428, -37236=>7429, -37241=>7430, -37260=>7431, -37253=>7432, -37264=>7433, -37261=>7434, -37265=>7435, -37282=>7436, -37283=>7437, -37290=>7438, -37293=>7439, -37294=>7440, -37295=>7441, -37301=>7442, -37300=>7443, -37306=>7444, -12183=>7445, -35925=>7445, -40574=>7446, -36280=>7447, -36331=>7448, -36357=>7449, -36441=>7450, -36457=>7451, -36277=>7452, -36287=>7453, -36284=>7454, -36282=>7455, -36292=>7456, -36310=>7457, -36311=>7458, -36314=>7459, -36318=>7460, -36302=>7461, -36303=>7462, -36315=>7463, -36294=>7464, -36332=>7465, -36343=>7466, -36344=>7467, -36323=>7468, -36345=>7469, -36347=>7470, -36324=>7471, -36361=>7472, -36349=>7473, -36372=>7474, -36381=>7475, -36383=>7476, -36396=>7477, -36398=>7478, -36387=>7479, -36399=>7480, -36410=>7481, -36416=>7482, -36409=>7483, -36405=>7484, -36413=>7485, -36401=>7486, -36425=>7487, -36417=>7488, -36418=>7489, -36433=>7490, -36434=>7491, -36426=>7492, -36464=>7493, -36470=>7494, -36476=>7495, -36463=>7496, -36468=>7497, -36485=>7498, -36495=>7499, -36500=>7500, -36496=>7501, -36508=>7502, -36510=>7503, -12184=>7504, -35960=>7504, -35970=>7505, -35978=>7506, -35973=>7507, -35992=>7508, -35988=>7509, -26011=>7510, -35286=>7511, -35294=>7512, -35290=>7513, -35292=>7514, -35301=>7515, -35307=>7516, -35311=>7517, -35390=>7518, -35622=>7519, -38739=>7520, -38633=>7521, -38643=>7522, -38639=>7523, -38662=>7524, -38657=>7525, -38664=>7526, -38671=>7527, -38670=>7528, -38698=>7529, -38701=>7530, -38704=>7531, -38718=>7532, -40832=>7533, -40835=>7534, -40837=>7535, -40838=>7536, -40839=>7537, -40840=>7538, -40841=>7539, -40842=>7540, -40844=>7541, -40702=>7542, -40715=>7543, -40717=>7544, -12203=>7545, -38585=>7545, -38588=>7546, -38589=>7547, -38606=>7548, -38610=>7549, -30655=>7550, -38624=>7551, -37518=>7552, -37550=>7553, -37576=>7554, -37694=>7555, -37738=>7556, -37834=>7557, -37775=>7558, -37950=>7559, -37995=>7560, -40063=>7561, -40066=>7562, -40069=>7563, -40070=>7564, -40071=>7565, -40072=>7566, -31267=>7567, -40075=>7568, -40078=>7569, -40080=>7570, -40081=>7571, -40082=>7572, -40084=>7573, -40085=>7574, -40090=>7575, -40091=>7576, -40094=>7577, -40095=>7578, -40096=>7579, -40097=>7580, -40098=>7581, -40099=>7582, -40101=>7583, -40102=>7584, -40103=>7585, -40104=>7586, -40105=>7587, -40107=>7588, -40109=>7589, -40110=>7590, -40112=>7591, -40113=>7592, -40114=>7593, -40115=>7594, -40116=>7595, -40117=>7596, -40118=>7597, -40119=>7598, -40122=>7599, -40123=>7600, -40124=>7601, -40125=>7602, -40132=>7603, -40133=>7604, -40134=>7605, -40135=>7606, -40138=>7607, -40139=>7608, -40140=>7609, -40141=>7610, -40142=>7611, -40143=>7612, -40144=>7613, -40147=>7614, -40148=>7615, -40149=>7616, -40151=>7617, -40152=>7618, -40153=>7619, -40156=>7620, -40157=>7621, -40159=>7622, -40162=>7623, -38780=>7624, -38789=>7625, -38801=>7626, -38802=>7627, -38804=>7628, -38831=>7629, -38827=>7630, -38819=>7631, -38834=>7632, -38836=>7633, -39601=>7634, -39600=>7635, -39607=>7636, -40536=>7637, -39606=>7638, -39610=>7639, -39612=>7640, -39617=>7641, -39616=>7642, -39621=>7643, -39618=>7644, -39627=>7645, -39628=>7646, -39633=>7647, -39749=>7648, -39747=>7649, -39751=>7650, -39753=>7651, -39752=>7652, -39757=>7653, -39761=>7654, -39144=>7655, -39181=>7656, -39214=>7657, -39253=>7658, -39252=>7659, -12221=>7660, -39647=>7660, -39649=>7661, -39654=>7662, -39663=>7663, -39659=>7664, -39675=>7665, -39661=>7666, -39673=>7667, -39688=>7668, -39695=>7669, -39699=>7670, -39711=>7671, -39715=>7672, -40637=>7673, -40638=>7674, -32315=>7675, -40578=>7676, -40583=>7677, -40584=>7678, -40587=>7679, -40594=>7680, -37846=>7681, -40605=>7682, -40607=>7683, -40667=>7684, -40668=>7685, -40669=>7686, -40672=>7687, -40671=>7688, -40674=>7689, -40681=>7690, -40679=>7691, -40677=>7692, -40682=>7693, -40687=>7694, -40738=>7695, -40748=>7696, -40751=>7697, -40761=>7698, -40759=>7699, -40765=>7700, -40766=>7701, -40772=>7702, -12295=>7703, - - - - - - - -30362=>7717, -34297=>7718, -31001=>7719, -24859=>7720, -39599=>7721, -35158=>7722, -22761=>7723, -32631=>7724, -25850=>7725, -25943=>7726, -38930=>7727, -36774=>7728, -32070=>7729, -24171=>7730, -32129=>7731, -37770=>7732, -35607=>7733, -39165=>7734, -23542=>7735, -22577=>7736, -39825=>7737, -36649=>7738, -12185=>7739, -35997=>7739, -37575=>7740, -29437=>7741, -20633=>7742, -24970=>7743, -32179=>7744, -31558=>7745, -30050=>7746, -25987=>7747, -24163=>7748, -38281=>7749, -37002=>7750, -32232=>7751, -36022=>7752, -35722=>7753, -36783=>7754, -36782=>7755, -27161=>7756, -40009=>7757, -30303=>7758, -28693=>7759, -28657=>7760, -36051=>7761, -25839=>7762, -39173=>7763, -25765=>7764, -37474=>7765, -37457=>7766, -39361=>7767, -35036=>7768, -36001=>7769, -21443=>7770, -34870=>7771, -27544=>7772, -24922=>7773, -24920=>7774, -29158=>7775, -33980=>7776, -33369=>7777, -20489=>7778, -28356=>7779, -21408=>7780, -20596=>7781, -28204=>7782, -23652=>7783, -35435=>7784, -25881=>7785, -25723=>7786, -34796=>7787, -39262=>7788, -35730=>7789, -32399=>7790, -37855=>7791, -29987=>7792, -38369=>7793, -39019=>7794, -22580=>7795, -22039=>7796, -12199=>7797, -38263=>7797, -20767=>7798, -33144=>7799, -24288=>7800, -26274=>7801, -37396=>7802, -12190=>7803, -36554=>7803, -24505=>7804, -22645=>7805, -38515=>7806, -35183=>7807, -31281=>7808, -25074=>7809, -35488=>7810, -39425=>7811, -36978=>7812, -39347=>7813, -12242=>7814, -40786=>7814, -29118=>7815, -34909=>7816, -34802=>7817, -23541=>7818, -30087=>7819, -36490=>7820, -31820=>7821, -32162=>7822, -37276=>7823, -37604=>7824, -38619=>7825, -30990=>7826, -20786=>7827, -35320=>7828, -34389=>7829, -20659=>7830, -30241=>7831, -38358=>7832, -21109=>7833, -37656=>7834, -32020=>7835, -32189=>7836, -36781=>7837, -35422=>7838, -36060=>7839, -32880=>7840, -24478=>7841, -21474=>7842, -36517=>7843, -31428=>7844, -37679=>7845, -36948=>7846, -24118=>7847, -36024=>7848, -25812=>7849, -21934=>7850, -37170=>7851, -25763=>7852, -33213=>7853, -24986=>7854, -35477=>7855, -24392=>7856, -30070=>7857, -25803=>7858, -40680=>7859, -34153=>7860, -27284=>7861, -25623=>7862, -23798=>7863, -31153=>7864, -23566=>7865, -29128=>7866, -37159=>7867, -25973=>7868, -28364=>7869, -36958=>7870, -32224=>7871, -39003=>7872, -40670=>7873, -22666=>7874, -38651=>7875, -28593=>7876, -37347=>7877, -35519=>7878, -35548=>7879, -37336=>7880, -38914=>7881, -37664=>7882, -35330=>7883, -26481=>7884, -21205=>7885, -26847=>7886, -20941=>7887, -12222=>7888, -39717=>7888, -29346=>7889, -29544=>7890, -35712=>7891, -36077=>7892, -37709=>7893, -37723=>7894, -26039=>7895, -32222=>7896, -38538=>7897, -23565=>7898, -22136=>7899, -38931=>7900, -37389=>7901, -22890=>7902, -22702=>7903, -40285=>7904, -38989=>7905, -35355=>7906, -24801=>7907, -39187=>7908, -20818=>7909, -29246=>7910, -39180=>7911, -36019=>7912, -30332=>7913, -32624=>7914, -38309=>7915, -31020=>7916, -37353=>7917, -29033=>7918, -31684=>7919, -36009=>7920, -39151=>7921, -35370=>7922, -32033=>7923, -12214=>7924, -39131=>7924, -35513=>7925, -24290=>7926, -36027=>7927, -32027=>7928, -22707=>7929, -22894=>7930, -24996=>7931, -31966=>7932, -35920=>7933, -26963=>7934, -37586=>7935, -12213=>7936, -39080=>7936, -30219=>7937, -39342=>7938, -32299=>7939, -35575=>7940, -40179=>7941, -33178=>7942, -36667=>7943, -25771=>7944, -36628=>7945, -36070=>7946, -24489=>7947, -36000=>7948, -35331=>7949, -23142=>7950, -32283=>7951, -35442=>7952, -37411=>7953, -33995=>7954, -24185=>7955, -36245=>7956, -36123=>7957, -23713=>7958, -21083=>7959, -37628=>7960, -32177=>7961, -23831=>7962, -37804=>7963, -25841=>7964, -40255=>7965, -38307=>7966, -37499=>7967, -20491=>7968, -32102=>7969, -40852=>7970, -38799=>7971, -36002=>7972, -37390=>7973, -28317=>7974, -27083=>7975, -36092=>7976, -34865=>7977, -39015=>7978, -21102=>7979, -38364=>7980, -35264=>7981, -39208=>7982, -24931=>7983, -36011=>7984, -24291=>7985, -35215=>7986, -27512=>7987, -12244=>7988, -40860=>7988, -38312=>7989, -36556=>7990, -35437=>7991, -27331=>7992, -36020=>7993, -21130=>7994, -36645=>7995, -37707=>7996, -22283=>7997, -36942=>7998, -39405=>7999, -38867=>8000, -28450=>8001, -34399=>8002, -38305=>8003, -40372=>8004, -36032=>8005, -36703=>8006, -40251=>8007, -32005=>8008, -22778=>8009, -35703=>8010, -28396=>8011, -22057=>8012, -33775=>8013, -30059=>8014, -21123=>8015, -35441=>8016, -25079=>8017, -22750=>8018, -27489=>8019, -29872=>8020, -36996=>8021, -32233=>8022, -35594=>8023, -25582=>8024, -36637=>8025, -36036=>8026, -31330=>8027, -26371=>8028, -29172=>8029, -21295=>8030, -35569=>8031, -35496=>8032, -32362=>8033, -33911=>8034, -28222=>8035, -29554=>8036, -36008=>8037, -31117=>8038, -25802=>8039, -27231=>8040, -31309=>8041, -39249=>8042, -35663=>8043, -40388=>8044, -32318=>8045, -32221=>8046, -26997=>8047, -36655=>8048, -32026=>8049, -25824=>8050, -24190=>8051, -34186=>8052, -21137=>8053, -28639=>8054, -35336=>8055, -35352=>8056, -38555=>8057, -32380=>8058, -32000=>8059, -22846=>8060, -33698=>8061, -38960=>8062, -36040=>8063, -37440=>8064, -20729=>8065, -39381=>8066, -27570=>8067, -30435=>8068, -22533=>8069, -31627=>8070, -38291=>8071, -33393=>8072, -32216=>8073, -32365=>8074, -27298=>8075, -40572=>8076, -25536=>8077, -25791=>8078, -31777=>8079, -20745=>8080, -34214=>8081, -27323=>8082, -37970=>8083, -36368=>8084, -36068=>8085, -12178=>8086, -35211=>8086, -37749=>8087, -33382=>8088, -21133=>8089, -39198=>8090, -28472=>8091, -28666=>8092, -28567=>8093, -23559=>8094, -28479=>8095, -34083=>8096, -27123=>8097, -22892=>8098, -35611=>8099, -37292=>8100, -33184=>8101, -28550=>8102, -39509=>8103, -23308=>8104, -25898=>8105, -37496=>8106, -30703=>8107, -20709=>8108, -39171=>8109, -32371=>8110, -32094=>8111, -36686=>8112, -36611=>8113, -38542=>8114, -31680=>8115, -28500=>8116, -32080=>8117, -35489=>8118, -32202=>8119, -37670=>8120, -20677=>8121, -35641=>8122, -36914=>8123, -29180=>8124, -30433=>8125, -21185=>8126, -33686=>8127, -39912=>8128, -39514=>8129, -32147=>8130, -38968=>8131, -37857=>8132, -24465=>8133, -30169=>8134, -31478=>8135, -31998=>8136, -33290=>8137, -39378=>8138, -33289=>8139, -25818=>8140, -37624=>8141, -25084=>8142, -21127=>8143, -40273=>8144, -32121=>8145, -35258=>8146, -35363=>8147, -32118=>8148, -37406=>8149, -36557=>8150, -39423=>8151, -38283=>8152, -20977=>8153, -38982=>8154, -27579=>8155, -35506=>8156, -22718=>8157, -25031=>8158, -25715=>8159, -24235=>8160, -35122=>8161, -35463=>8162, -22602=>8163, -20744=>8164, -23532=>8165, -31014=>8166, -26336=>8167, -34407=>8168, -24011=>8169, -31418=>8170, -39243=>8171, -28528=>8172, -25844=>8173, -38346=>8174, -34847=>8175, -33240=>8176, -33802=>8177, -20358=>8178, -36084=>8179, -34253=>8180, -27396=>8181, -25876=>8182, -31811=>8183, -38348=>8184, -34349=>8185, -28734=>8186, -35733=>8187, -25900=>8188, -35261=>8189, -25078=>8190, -32412=>8191, -29211=>8192, -28651=>8193, -25736=>8194, -21214=>8195, -28551=>8196, -27138=>8197, -37939=>8198, -22744=>8199, -39006=>8200, -31852=>8201, -38626=>8202, -28757=>8203, -35023=>8204, -63975=>8204, -39881=>8205, -31150=>8206, -40599=>8207, -21426=>8208, -21237=>8209, -31019=>8210, -27511=>8211, -28701=>8212, -38584=>8213, -20486=>8214, -32879=>8215, -34030=>8216, -36899=>8217, -37934=>8218, -24976=>8219, -28451=>8220, -31806=>8221, -25986=>8222, -33225=>8223, -37832=>8224, -25088=>8225, -29001=>8226, -32244=>8227, -31975=>8228, -20841=>8229, -36635=>8230, -35538=>8231, -30274=>8232, -36988=>8233, -37904=>8234, -29557=>8235, -33256=>8236, -37168=>8237, -40023=>8238, -36035=>8239, -40801=>8240, -37428=>8241, -38728=>8242, -23994=>8243, -38936=>8244, -39230=>8245, -21129=>8246, -12243=>8247, -40845=>8247, -32894=>8248, -22184=>8249, -31840=>8250, -22751=>8251, -25871=>8252, -38580=>8253, -27155=>8254, -23105=>8255, -25695=>8256, -31757=>8257, -34310=>8258, -30439=>8259, -39025=>8260, -24300=>8261, -29200=>8262, -25796=>8263, -28407=>8264, -34396=>8265, -39791=>8266, -36034=>8267, -37682=>8268, -38520=>8269, -39522=>8270, -37569=>8271, -23650=>8272, -32311=>8273, -24942=>8274, -28670=>8275, -32209=>8276, -24018=>8277, -25891=>8278, -23423=>8279, -28772=>8280, -20098=>8281, -25476=>8282, -36650=>8283, -20523=>8284, -20374=>8285, -28138=>8286, -32184=>8287, -35542=>8288, -34367=>8289, -32645=>8290, -37007=>8291, -38012=>8292, -31854=>8293, -39486=>8294, -39409=>8295, -32097=>8296, -23229=>8297, -29802=>8298, -30908=>8299, -34718=>8300, -12218=>8301, -39340=>8301, -39393=>8302, -21966=>8303, -36023=>8304, -12230=>8305, -40613=>8305, -36067=>8306, -36993=>8307, -30622=>8308, -39237=>8309, -34875=>8310, -28415=>8311, -35646=>8312, -37672=>8313, -37466=>8314, -36031=>8315, -37762=>8316, -12200=>8317, -38272=>8317, -24758=>8318, -20497=>8319, -37683=>8320, -22818=>8321, -35598=>8322, -24396=>8323, -35219=>8324, -32191=>8325, -32236=>8326, -24287=>8327, -28357=>8328, -25003=>8329, -38313=>8330, -40180=>8331, -37528=>8332, -35628=>8333, -35584=>8334, -30045=>8335, -37385=>8336, -32013=>8337, -38627=>8338, -25747=>8339, -33126=>8340, -24817=>8341, -39719=>8342, -39186=>8343, -25836=>8344, -33193=>8345, -25862=>8346, -37312=>8347, -12227=>8348, -40165=>8348, -32886=>8349, -22169=>8350, -38007=>8351, -37811=>8352, -27320=>8353, -29552=>8354, -23527=>8355, -25840=>8356, -28632=>8357, -37397=>8358, -32016=>8359, -33215=>8360, -28611=>8361, -36786=>8362, -30247=>8363, -35582=>8364, -27472=>8365, -40407=>8366, -27590=>8367, -22036=>8368, -28442=>8369, -30436=>8370, -40848=>8371, -36064=>8372, -22132=>8373, -40300=>8374, -39449=>8375, -39108=>8376, -38971=>8377, -36007=>8378, -34315=>8379, -24977=>8380, -35413=>8381, -28497=>8382, -38935=>8383, -25778=>8384, -37610=>8385, -20693=>8386, -27192=>8387, -35676=>8388, -33229=>8389, -12241=>8390, -40778=>8390, -39438=>8391, -35912=>8392, -21843=>8393, -27683=>8394, -35350=>8395, -29309=>8396, -37370=>8397, -37467=>8398, -36983=>8399, -31805=>8400, -35609=>8401, -37666=>8402, -37463=>8403, -28154=>8404, -35700=>8405, -22649=>8406, -27085=>8407, -21958=>8408, -22715=>8409, -34196=>8410, -25654=>8411, -37740=>8412, -27211=>8413, -21932=>8414, -20689=>8415, -32761=>8416, -31429=>8417, -31434=>8418, -27453=>8419, -35242=>8420, -23522=>8421, -36629=>8422, -27691=>8423, -20670=>8424, -38915=>8425, -35531=>8426, -24950=>8427, -29898=>8428, -31406=>8429, -36264=>8430, -21312=>8431, -36544=>8432, -39493=>8433, -40818=>8434, -39028=>8435, -27402=>8436, -21240=>8437, -40306=>8438, -30906=>8439, -35731=>8440, -39250=>8441, -25854=>8442, -32350=>8443, -29105=>8444, -38860=>8445, -35469=>8446, -32009=>8447, -27054=>8448, -32104=>8449, -36575=>8450, -37613=>8451, -38287=>8452, -28516=>8453, -28753=>8454, -34217=>8455, -39955=>8456, -36093=>8457, -20632=>8458, -21930=>8459, -39479=>8460, -25475=>8461, -28544=>8462, -27578=>8463, -32023=>8464, -31721=>8465, -26348=>8466, -38275=>8467, -38493=>8468, -36109=>8469, -32341=>8470, -20663=>8471, -36062=>8472, -29138=>8473, -32057=>8474, -36050=>8475, -25448=>8476, -25885=>8477, -25086=>8478, -35373=>8479, -32051=>8480, -23529=>8481, -23352=>8482, -33102=>8483, -28402=>8484, -32882=>8485, -32361=>8486, -21213=>8487, -32854=>8488, -24107=>8489, -29509=>8490, -28629=>8491, -35433=>8492, -26178=>8493, -34645=>8494, -23526=>8495, -35672=>8496, -39387=>8497, -21218=>8498, -36969=>8499, -37323=>8500, -39166=>8501, -35222=>8502, -35430=>8503, -22781=>8504, -29560=>8505, -27166=>8506, -36664=>8507, -26360=>8508, -36118=>8509, -23660=>8510, -34899=>8511, -27193=>8512, -31466=>8513, -25976=>8514, -24101=>8515, -38617=>8516, -35504=>8517, -38918=>8518, -35500=>8519, -30889=>8520, -29197=>8521, -32114=>8522, -39164=>8523, -39686=>8524, -32883=>8525, -24939=>8526, -38924=>8527, -35359=>8528, -35494=>8529, -25851=>8530, -34311=>8531, -35380=>8532, -32901=>8533, -38614=>8534, -38568=>8535, -32143=>8536, -27506=>8537, -23403=>8538, -25613=>8539, -32302=>8540, -29795=>8541, -37782=>8542, -29562=>8543, -25787=>8544, -33274=>8545, -24907=>8546, -25892=>8547, -36010=>8548, -30321=>8549, -28760=>8550, -22727=>8551, -35674=>8552, -35527=>8553, -22022=>8554, -28271=>8555, -29145=>8556, -28644=>8557, -32295=>8558, -35342=>8559, -39472=>8560, -35588=>8561, -37563=>8562, -38988=>8563, -39636=>8564, -26781=>8565, -36028=>8566, -37941=>8567, -24307=>8568, -32893=>8569, -28916=>8570, -37509=>8571, -32113=>8572, -38957=>8573, -22294=>8574, -22615=>8575, -22296=>8576, -38973=>8577, -40213=>8578, -39345=>8579, -39389=>8580, -27234=>8581, -31402=>8582, -35178=>8583, -24398=>8584, -28771=>8585, -38929=>8586, -33836=>8587, -32178=>8588, -12209=>8589, -38859=>8589, -36949=>8590, -22285=>8591, -29234=>8592, -28656=>8593, -32173=>8594, -33894=>8595, -20553=>8596, -20702=>8597, -32239=>8598, -35586=>8599, -34907=>8600, -32862=>8601, -32011=>8602, -31337=>8603, -21839=>8604, -25790=>8605, -34680=>8606, -28198=>8607, -31401=>8608, -21978=>8609, -37794=>8610, -28879=>8611, -35491=>8612, -28961=>8613, -34154=>8614, -22626=>8615, -38695=>8616, -21209=>8617, -35492=>8618, -37675=>8619, -29351=>8620, -35186=>8621, -32722=>8622, -37521=>8623, -25138=>8624, -32048=>8625, -34662=>8626, -36676=>8627, -23805=>8628, -20448=>8629, -29433=>8630, -22151=>8631, -37697=>8632, -39854=>8633, -32406=>8634, -36066=>8635, -37532=>8636, -38289=>8637, -39023=>8638, -38570=>8639, -29694=>8640, -29563=>8641, -32291=>8642, -39201=>8643, -25010=>8644, -32171=>8645, -38002=>8646, -37129=>8647, -35443=>8648, -38911=>8649, -38917=>8650, -34157=>8651, -22210=>8652, -37559=>8653, -26313=>8654, -22063=>8655, -21332=>8656, -25406=>8657, -33029=>8658, -35559=>8659, -23531=>8660, -28681=>8661, -35613=>8662, -37573=>8663, -37313=>8664, -33288=>8665, -37561=>8666, -32137=>8667, -38920=>8668, -35377=>8669, -32210=>8670, -32396=>8671, -36562=>8672, -25080=>8673, -36984=>8674, -30316=>8675, -32098=>8676, -23416=>8677, -21211=>8678, -35426=>8679, -23563=>8680, -39348=>8681, -35347=>8682, -35338=>8683, -36956=>8684, -22739=>8685, -40201=>8686, -40232=>8687, -21854=>8688, -20126=>8689, -35357=>8690, -38329=>8691, -40573=>8692, -22196=>8693, -38996=>8694, -38331=>8695, -33399=>8696, -21421=>8697, -30831=>8698, -35578=>8699, -39511=>8700, -40230=>8701, -26954=>8702, -25562=>8703, -30221=>8704, -38525=>8705, -30306=>8706, -39178=>8707, -27171=>8708, -22575=>8709, -35617=>8710, -34277=>8711, -29242=>8712, -12212=>8713, -38913=>8713, -26989=>8714, -33865=>8715, -37291=>8716, -37541=>8717, -38948=>8718, -36986=>8719, -20736=>8720, -34811=>8721, -34269=>8722, -20740=>8723, -25014=>8724, -32681=>8725, -35427=>8726, -35696=>8727, -35516=>8728, -35695=>8729, -32377=>8730, -34093=>8731, -38512=>8732, -37504=>8733, -39154=>8734, -38577=>8735, -27387=>8736, -23344=>8737, -40441=>8738, -25033=>8739, -32403=>8740, -29801=>8741, -34722=>8742, -29151=>8743, -29074=>8744, -34821=>8745, -36111=>8746, -31310=>8747, -21938=>8748, -25793=>8749, -20653=>8750, -30320=>8751, -36404=>8752, -20778=>8753, -24962=>8754, -37109=>8755, -37438=>8756, -29494=>8757, -35480=>8758, -36671=>8759, -39192=>8760, -12226=>8761, -39770=>8761, -28417=>8762, -33287=>8763, -23996=>8764, -35486=>8765, -39729=>8766, -29508=>8767, -35709=>8768, -38928=>8769, -39341=>8770, -40219=>8771, -28149=>8772, -36677=>8773, -22290=>8774, -21729=>8775, -22291=>8776, -32227=>8777, -36960=>8778, -39000=>8779, -32004=>8780, -36493=>8781, -38000=>8782, -38322=>8783, -38642=>8784, -37142=>8785, -38549=>8786, -36939=>8787, -34292=>8788, -37270=>8789, -26248=>8790, -38620=>8791, -36617=>8792, -25890=>8793, -26283=>8794, -36106=>8795, -36124=>8796, -33247=>8797, -38015=>8798, -26839=>8799, -31432=>8800, -36012=>8801, -25799=>8802, -21063=>8803, -28580=>8804, -36042=>8805, -36104=>8806, -36555=>8807, -37720=>8808, -38296=>8809, -35408=>8810, -40779=>8811, -20661=>8812, -27656=>8813, -30430=>8814, -26028=>8815, -36670=>8816, -23940=>8817, -26855=>8818, -25136=>8819, -32187=>8820, -24373=>8821, -28466=>8822, -24115=>8823, -36076=>8824, -33081=>8825, -36249=>8826, -34756=>8827, -36685=>8828, -37754=>8829, -36889=>8830, -35998=>8831, -37341=>8832, -20597=>8833, -35386=>8834, -37806=>8835, -38499=>8836, -24128=>8837, -30309=>8838, -37165=>8839, -35657=>8840, -32340=>8841, -32887=>8842, -22519=>8843, -34937=>8844, -32025=>8845, -25711=>8846, -25842=>8847, -24159=>8848, -36074=>8849, -28399=>8850, -37912=>8851, -32066=>8852, -31278=>8853, -33131=>8854, -34886=>8855, -35589=>8856, -36600=>8857, -30394=>8858, -26205=>8859, -39519=>8860, -35576=>8861, -35461=>8862, -29165=>8863, -30682=>8864, -22225=>8865, -36015=>8866, -37956=>8867, -31689=>8868, -39376=>8869, -23560=>8870, -30938=>8871, -36681=>8872, -36090=>8873, -27137=>8874, -33674=>8875, -35037=>8876, -22941=>8877, -22767=>8878, -29376=>8879, -37648=>8880, -36101=>8881, -22684=>8882, -32180=>8883, -35524=>8884, -28310=>8885, -28609=>8886, -36039=>8887, -28460=>8888, -32156=>8889, -32317=>8890, -32305=>8891, -37138=>8892, -35419=>8893, -32068=>8894, -38013=>8895, -21959=>8896, -21401=>8897, -21428=>8898, -38760=>8899, -36107=>8900, -21293=>8901, -21297=>8902, -36094=>8903, -21060=>8904, -21132=>8905, -21108=>8906, -20660=>8907, -20480=>8908, -20630=>8909, -20757=>8910, -20738=>8911, -20756=>8912, -20796=>8913, -20791=>8914, -20712=>8915, -20674=>8916, -20795=>8917, -20752=>8918, -20794=>8919, -20681=>8920, -31988=>8921, -40652=>8922, -22213=>8923, -40172=>8924, -35131=>8925, -33248=>8926, -35329=>8927, -35344=>8928, -35340=>8929, -35349=>8930, -35635=>8931, -35406=>8932, -35365=>8933, -35393=>8934, -35382=>8935, -35398=>8936, -35412=>8937, -35416=>8938, -35410=>8939, -35462=>8940, -35460=>8941, -35455=>8942, -35440=>8943, -35452=>8944, -35445=>8945, -35436=>8946, -35438=>8947, -35533=>8948, -35554=>8949, -35425=>8950, -35482=>8951, -35493=>8952, -35473=>8953, -35474=>8954, -35535=>8955, -35537=>8956, -35529=>8957, -35547=>8958, -35543=>8959, -35522=>8960, -35510=>8961, -35574=>8962, -35563=>8963, -35604=>8964, -35585=>8965, -35556=>8966, -35565=>8967, -35580=>8968, -35571=>8969, -35558=>8970, -35566=>8971, -35550=>8972, -35624=>8973, -35740=>8974, -35606=>8975, -35610=>8976, -35600=>8977, -35627=>8978, -35629=>8979, -35670=>8980, -35673=>8981, -35662=>8982, -35742=>8983, -35691=>8984, -35734=>8985, -38488=>8986, -37178=>8987, -37140=>8988, -37172=>8989, -37087=>8990, -37174=>8991, -37126=>8992, -37192=>8993, -33467=>8994, -21233=>8995, -24048=>8996, -22538=>8997, -22745=>8998, -22754=>8999, -22752=>9000, -22746=>9001, -22497=>9002, -22607=>9003, -22550=>9004, -22610=>9005, -22557=>9006, -22628=>9007, -34188=>9008, -34131=>9009, -34294=>9010, -33703=>9011, -33799=>9012, -34031=>9013, -33511=>9014, -34338=>9015, -34086=>9016, -22603=>9017, -29026=>9018, -34136=>9019, -34045=>9020, -34126=>9021, -34184=>9022, -34234=>9023, -29334=>9024, -28366=>9025, -34113=>9026, -34254=>9027, -34130=>9028, -33984=>9029, -33874=>9030, -33892=>9031, -33940=>9032, -33845=>9033, -34207=>9034, -34133=>9035, -40367=>9036, -33939=>9037, -32264=>9038, -34118=>9039, -34146=>9040, -34078=>9041, -39488=>9042, -34362=>9043, -37795=>9044, -34167=>9045, -34334=>9046, -34298=>9047, -34308=>9048, -34282=>9049, -34330=>9050, -22889=>9051, -23607=>9052, -25451=>9053, -25718=>9054, -25759=>9055, -25681=>9056, -25692=>9057, -25779=>9058, -25860=>9059, -25878=>9060, -25847=>9061, -25852=>9062, -25883=>9063, -22064=>9064, -22072=>9065, -22216=>9066, -22182=>9067, -21764=>9068, -21692=>9069, -22144=>9070, -22109=>9071, -22112=>9072, -22069=>9073, -22006=>9074, -22118=>9075, -22130=>9076, -22156=>9077, -22117=>9078, -22044=>9079, -22062=>9080, -21993=>9081, -22038=>9082, -22208=>9083, -22029=>9084, -22195=>9085, -22209=>9086, -22127=>9087, -36705=>9088, -22198=>9089, -22165=>9090, -22279=>9091, -24131=>9092, -24172=>9093, -24152=>9094, -24151=>9095, -23943=>9096, -23796=>9097, -23888=>9098, -23852=>9099, -23975=>9100, -23968=>9101, -23959=>9102, -23821=>9103, -23992=>9104, -23937=>9105, -24020=>9106, -24480=>9107, -29559=>9108, -29505=>9109, -29546=>9110, -29499=>9111, -29547=>9112, -29568=>9113, -29564=>9114, -39136=>9115, -39219=>9116, -39145=>9117, -39228=>9118, -39146=>9119, -39147=>9120, -39149=>9121, -39156=>9122, -39177=>9123, -39185=>9124, -39195=>9125, -39223=>9126, -39231=>9127, -39235=>9128, -39240=>9129, -39241=>9130, -39242=>9131, -39244=>9132, -39266=>9133, -24289=>9134, -36065=>9135, -25082=>9136, -25006=>9137, -24938=>9138, -24894=>9139, -24757=>9140, -24884=>9141, -25036=>9142, -24927=>9143, -25064=>9144, -24827=>9145, -24887=>9146, -24818=>9147, -24947=>9148, -24860=>9149, -24978=>9150, -38274=>9151, -38278=>9152, -38344=>9153, -38286=>9154, -38292=>9155, -38284=>9156, -38373=>9157, -38317=>9158, -38315=>9159, -39726=>9160, -38316=>9161, -38334=>9162, -38326=>9163, -39721=>9164, -38335=>9165, -38333=>9166, -38332=>9167, -38339=>9168, -38347=>9169, -38356=>9170, -38352=>9171, -38357=>9172, -38366=>9173, -28739=>9174, -28505=>9175, -28711=>9176, -28696=>9177, -28668=>9178, -28039=>9179, -28025=>9180, -28254=>9181, -28590=>9182, -28687=>9183, -28408=>9184, -28527=>9185, -28150=>9186, -28543=>9187, -28678=>9188, -28576=>9189, -28683=>9190, -28775=>9191, -28740=>9192, -28677=>9193, -28535=>9194, -28704=>9195, -28703=>9196, -28722=>9197, -28712=>9198, -28765=>9199, -39467=>9200, -36999=>9201, -36885=>9202, -37008=>9203, -23656=>9204, -24371=>9205, -23285=>9206, -23255=>9207, -23296=>9208, -23149=>9209, -23304=>9210, -23372=>9211, -23207=>9212, -23291=>9213, -23307=>9214, -23329=>9215, -23338=>9216, -23321=>9217, -39380=>9218, -39391=>9219, -39385=>9220, -39478=>9221, -39515=>9222, -39377=>9223, -39384=>9224, -39501=>9225, -39498=>9226, -39394=>9227, -39530=>9228, -39439=>9229, -39437=>9230, -39429=>9231, -39490=>9232, -39469=>9233, -39446=>9234, -39489=>9235, -39470=>9236, -39480=>9237, -39491=>9238, -39492=>9239, -39503=>9240, -39525=>9241, -39524=>9242, -31993=>9243, -32006=>9244, -32002=>9245, -32007=>9246, -32008=>9247, -32394=>9248, -32028=>9249, -32021=>9250, -32019=>9251, -32058=>9252, -32050=>9253, -32049=>9254, -32272=>9255, -32060=>9256, -32064=>9257, -32063=>9258, -32093=>9259, -32078=>9260, -32115=>9261, -32134=>9262, -32131=>9263, -32136=>9264, -32190=>9265, -32186=>9266, -32203=>9267, -32212=>9268, -32196=>9269, -32158=>9270, -32172=>9271, -32185=>9272, -32163=>9273, -32176=>9274, -32199=>9275, -32217=>9276, -32215=>9277, -32249=>9278, -32242=>9279, -32354=>9280, -32230=>9281, -32246=>9282, -32241=>9283, -32267=>9284, -32225=>9285, -32265=>9286, -32285=>9287, -32287=>9288, -32286=>9289, -32301=>9290, -32266=>9291, -32273=>9292, -32381=>9293, -32313=>9294, -32309=>9295, -32306=>9296, -32326=>9297, -32325=>9298, -32392=>9299, -32346=>9300, -32338=>9301, -32366=>9302, -32382=>9303, -32368=>9304, -32367=>9305, -32408=>9306, -29859=>9307, -29771=>9308, -29903=>9309, -38922=>9310, -29885=>9311, -29759=>9312, -29833=>9313, -29862=>9314, -29908=>9315, -29914=>9316, -38873=>9317, -38878=>9318, -38876=>9319, -27050=>9320, -27370=>9321, -26776=>9322, -26838=>9323, -27141=>9324, -26783=>9325, -27355=>9326, -27379=>9327, -27368=>9328, -27359=>9329, -27273=>9330, -26895=>9331, -27208=>9332, -26984=>9333, -27071=>9334, -27194=>9335, -27292=>9336, -27410=>9337, -27422=>9338, -27357=>9339, -27111=>9340, -27407=>9341, -27414=>9342, -27372=>9343, -27354=>9344, -27384=>9345, -27315=>9346, -27367=>9347, -27299=>9348, -27347=>9349, -27358=>9350, -27556=>9351, -27550=>9352, -27566=>9353, -27563=>9354, -27567=>9355, -36564=>9356, -36571=>9357, -36594=>9358, -36603=>9359, -36708=>9360, -36601=>9361, -36604=>9362, -36587=>9363, -36580=>9364, -36706=>9365, -36602=>9366, -36606=>9367, -36618=>9368, -36615=>9369, -36613=>9370, -36626=>9371, -36646=>9372, -36638=>9373, -36639=>9374, -36636=>9375, -36659=>9376, -36678=>9377, -36692=>9378, -25108=>9379, -25127=>9380, -29964=>9381, -26311=>9382, -26308=>9383, -26249=>9384, -26326=>9385, -36033=>9386, -36016=>9387, -36026=>9388, -36029=>9389, -36100=>9390, -36018=>9391, -36037=>9392, -36112=>9393, -36049=>9394, -36058=>9395, -36053=>9396, -36075=>9397, -36071=>9398, -36091=>9399, -35224=>9400, -35244=>9401, -35233=>9402, -35263=>9403, -35238=>9404, -35247=>9405, -35250=>9406, -35255=>9407, -27647=>9408, -27660=>9409, -27692=>9410, -29272=>9411, -26407=>9412, -33110=>9413, -33242=>9414, -33051=>9415, -33214=>9416, -33121=>9417, -33231=>9418, -27487=>9419, -39086=>9420, -39087=>9421, -39094=>9422, -39100=>9423, -39110=>9424, -39112=>9425, -36674=>9426, -40783=>9427, -26005=>9428, -29036=>9429, -29010=>9430, -29079=>9431, -29121=>9432, -29148=>9433, -29182=>9434, -31152=>9435, -31118=>9436, -31146=>9437, -25055=>9438, -24932=>9439, -25059=>9440, -25095=>9441, -28585=>9442, -30959=>9443, -30893=>9444, -30824=>9445, -30904=>9446, -31018=>9447, -31025=>9448, -30820=>9449, -30973=>9450, -30951=>9451, -30947=>9452, -40853=>9453, -30616=>9454, -30558=>9455, -30652=>9456, -32646=>9457, -32648=>9458, -37330=>9459, -37331=>9460, -37332=>9461, -37337=>9462, -37335=>9463, -37333=>9464, -37367=>9465, -37351=>9466, -37348=>9467, -37702=>9468, -37365=>9469, -37369=>9470, -37384=>9471, -37414=>9472, -37445=>9473, -37393=>9474, -37392=>9475, -37377=>9476, -37415=>9477, -37380=>9478, -37413=>9479, -37376=>9480, -37434=>9481, -37478=>9482, -37431=>9483, -37427=>9484, -37461=>9485, -37437=>9486, -37432=>9487, -37470=>9488, -37484=>9489, -37485=>9490, -37439=>9491, -37984=>9492, -37424=>9493, -37449=>9494, -37448=>9495, -37453=>9496, -37422=>9497, -37433=>9498, -37944=>9499, -37548=>9500, -37536=>9501, -37498=>9502, -37546=>9503, -37614=>9504, -37583=>9505, -37891=>9506, -37603=>9507, -37946=>9508, -37553=>9509, -37542=>9510, -37799=>9511, -37526=>9512, -37580=>9513, -37545=>9514, -37877=>9515, -37523=>9516, -37503=>9517, -37801=>9518, -37530=>9519, -37658=>9520, -37547=>9521, -37507=>9522, -37899=>9523, -37544=>9524, -37539=>9525, -37906=>9526, -37688=>9527, -37617=>9528, -37847=>9529, -37605=>9530, -37616=>9531, -37615=>9532, -37608=>9533, -37564=>9534, -37597=>9535, -37622=>9536, -37926=>9537, -37927=>9538, -37571=>9539, -37599=>9540, -37606=>9541, -37650=>9542, -37638=>9543, -37737=>9544, -37659=>9545, -37696=>9546, -37633=>9547, -37653=>9548, -37678=>9549, -37699=>9550, -37639=>9551, -37640=>9552, -37663=>9553, -37657=>9554, -37733=>9555, -37703=>9556, -37750=>9557, -37716=>9558, -37732=>9559, -37802=>9560, -37744=>9561, -37764=>9562, -37860=>9563, -37848=>9564, -37928=>9565, -37767=>9566, -37836=>9567, -37784=>9568, -37816=>9569, -37823=>9570, -37798=>9571, -37808=>9572, -37813=>9573, -37964=>9574, -37858=>9575, -37852=>9576, -37853=>9577, -37837=>9578, -37854=>9579, -37827=>9580, -37831=>9581, -37841=>9582, -37908=>9583, -37917=>9584, -37879=>9585, -37989=>9586, -37907=>9587, -37997=>9588, -37920=>9589, -38009=>9590, -37881=>9591, -37913=>9592, -37962=>9593, -37938=>9594, -37951=>9595, -37972=>9596, -37987=>9597, -37758=>9598, -31329=>9599, -40169=>9600, -40182=>9601, -40199=>9602, -40198=>9603, -40227=>9604, -40327=>9605, -40469=>9606, -40221=>9607, -40223=>9608, -40421=>9609, -40239=>9610, -40409=>9611, -40240=>9612, -40258=>9613, -40478=>9614, -40275=>9615, -40477=>9616, -40288=>9617, -40274=>9618, -40435=>9619, -40284=>9620, -40289=>9621, -40339=>9622, -40298=>9623, -40303=>9624, -40329=>9625, -40344=>9626, -40346=>9627, -40384=>9628, -40357=>9629, -40361=>9630, -40386=>9631, -40380=>9632, -40474=>9633, -40403=>9634, -40410=>9635, -40431=>9636, -40422=>9637, -40434=>9638, -40440=>9639, -40460=>9640, -40442=>9641, -40475=>9642, -30308=>9643, -30296=>9644, -30311=>9645, -30210=>9646, -30278=>9647, -30279=>9648, -30281=>9649, -30238=>9650, -30267=>9651, -30317=>9652, -30318=>9653, -30313=>9654, -30322=>9655, -31431=>9656, -31414=>9657, -35168=>9658, -35123=>9659, -35165=>9660, -35143=>9661, -35128=>9662, -35172=>9663, -30392=>9664, -32814=>9665, -32812=>9666, -32889=>9667, -32885=>9668, -38919=>9669, -38926=>9670, -38927=>9671, -38945=>9672, -38940=>9673, -28481=>9674, -38950=>9675, -38967=>9676, -38990=>9677, -38995=>9678, -39027=>9679, -39010=>9680, -39001=>9681, -39013=>9682, -39020=>9683, -39024=>9684, -34787=>9685, -34822=>9686, -34566=>9687, -34851=>9688, -34806=>9689, -34554=>9690, -34799=>9691, -34692=>9692, -34832=>9693, -34760=>9694, -34833=>9695, -34747=>9696, -34766=>9697, -32588=>9698, -31716=>9699, -31591=>9700, -31849=>9701, -31731=>9702, -31744=>9703, -31691=>9704, -31836=>9705, -31774=>9706, -31787=>9707, -31779=>9708, -31850=>9709, -31839=>9710, -33380=>9711, -33387=>9712, -35018=>9713, -32677=>9714, -31986=>9715, -31990=>9716, -31965=>9717, -32310=>9718, -40617=>9719, -36274=>9720, -37317=>9721, -37315=>9722, -40570=>9723, -36489=>9724, -36428=>9725, -36498=>9726, -36474=>9727, -36437=>9728, -36506=>9729, -36491=>9730, -36499=>9731, -36497=>9732, -36513=>9733, -36451=>9734, -36522=>9735, -36518=>9736, -35316=>9737, -35318=>9738, -38746=>9739, -38722=>9740, -38717=>9741, -38724=>9742, -40788=>9743, -40799=>9744, -40793=>9745, -40800=>9746, -40796=>9747, -40806=>9748, -40812=>9749, -40810=>9750, -40823=>9751, -12236=>9752, -40701=>9752, -40703=>9753, -40713=>9754, -35726=>9755, -38014=>9756, -37864=>9757, -39799=>9758, -39796=>9759, -39809=>9760, -39811=>9761, -39822=>9762, -40056=>9763, -31308=>9764, -39826=>9765, -40031=>9766, -39824=>9767, -39853=>9768, -39834=>9769, -39850=>9770, -39838=>9771, -40045=>9772, -39851=>9773, -39837=>9774, -40024=>9775, -39873=>9776, -40058=>9777, -39985=>9778, -39993=>9779, -39971=>9780, -39991=>9781, -39872=>9782, -39882=>9783, -39879=>9784, -39933=>9785, -39894=>9786, -39914=>9787, -39915=>9788, -39905=>9789, -39908=>9790, -39911=>9791, -39901=>9792, -39906=>9793, -39920=>9794, -39899=>9795, -39924=>9796, -39892=>9797, -40029=>9798, -39944=>9799, -39952=>9800, -39949=>9801, -39954=>9802, -39945=>9803, -39935=>9804, -39968=>9805, -39986=>9806, -39981=>9807, -39976=>9808, -39973=>9809, -39977=>9810, -39987=>9811, -39998=>9812, -40008=>9813, -39995=>9814, -39989=>9815, -40005=>9816, -40022=>9817, -40020=>9818, -40018=>9819, -40039=>9820, -38851=>9821, -38845=>9822, -38857=>9823, -40379=>9824, -39631=>9825, -39638=>9826, -39637=>9827, -39768=>9828, -39758=>9829, -39255=>9830, -39260=>9831, -39714=>9832, -40695=>9833, -40690=>9834, -35180=>9835, -38342=>9836, -37686=>9837, -24390=>9838, -34068=>9839, -32404=>9840, -40803=>9841, -22137=>9842, -40725=>9843, -22081=>9844, -39662=>9845, -35079=>9846, -31296=>9847, -39091=>9848, -38308=>9849, -39693=>9850, -36852=>9851, -24409=>9852, -31339=>9853, -39138=>9854, -20642=>9855, -34193=>9856, -20760=>9857, -25458=>9858, -21067=>9859, -30543=>9860, -32397=>9861, -26310=>9862, -30637=>9863, -12228=>9864, -40565=>9864, -22217=>9865, -40692=>9866, -28635=>9867, -25054=>9868, -30663=>9869, -28720=>9870, -40629=>9871, -34890=>9872, -38370=>9873, -38854=>9874, -31844=>9875, -32308=>9876, -38822=>9877, -40623=>9878, -22220=>9879, -39089=>9880, -27311=>9881, -32590=>9882, -31984=>9883, -20418=>9884, -32363=>9885, -40569=>9886, -22190=>9887, -39706=>9888, -33903=>9889, -31142=>9890, -31858=>9891, -39634=>9892, -38587=>9893, -32251=>9894, -35069=>9895, -30787=>9896, -8560=>9897, -8561=>9898, -8562=>9899, -8563=>9900, -8564=>9901, -8565=>9902, -8566=>9903, -8567=>9904, -8568=>9905, -8569=>9906, -714=>9907, -715=>9908, -729=>9909, -8211=>9910, -8213=>9911, -8229=>9912, -8245=>9913, -8453=>9914, -8457=>9915, -8598=>9916, -8599=>9917, -8600=>9918, -8601=>9919, -8725=>9920, -8735=>9921, -8739=>9922, -8786=>9923, -8806=>9924, -8807=>9925, -8895=>9926, -9552=>9927, -9553=>9928, -9554=>9929, -9555=>9930, -9556=>9931, -9557=>9932, -9558=>9933, -9559=>9934, -9560=>9935, -9561=>9936, -9562=>9937, -9563=>9938, -9564=>9939, -9565=>9940, -9566=>9941, -9567=>9942, -9568=>9943, -9569=>9944, -9570=>9945, -9571=>9946, -9572=>9947, -9573=>9948, -9574=>9949, -9575=>9950, -9576=>9951, -9577=>9952, -9578=>9953, -9579=>9954, -9580=>9955, -9581=>9956, -9582=>9957, -9583=>9958, -9584=>9959, -9585=>9960, -9586=>9961, -9587=>9962, -9601=>9963, -9602=>9964, -9603=>9965, -9604=>9966, -9605=>9967, -9606=>9968, -9607=>9969, -9608=>9970, -9609=>9971, -9610=>9972, -9611=>9973, -9612=>9974, -9613=>9975, -9614=>9976, -9615=>9977, -9619=>9978, -9620=>9979, -9621=>9980, -9660=>9981, -9661=>9982, -9698=>9983, -9699=>9984, -9700=>9985, -9701=>9986, -9737=>9987, -8853=>9988, -12306=>9989, -12317=>9990, -12318=>9991, -12321=>9992, -12322=>9993, -12323=>9994, -12324=>9995, -12325=>9996, -12326=>9997, -12327=>9998, -12328=>9999, -12329=>10000, -12963=>10001, -13198=>10002, -13199=>10003, -13212=>10004, -13213=>10005, -13214=>10006, -13217=>10007, -13252=>10008, -13262=>10009, -13265=>10010, -13266=>10011, -13269=>10012, -65072=>10013, -65506=>10014, -65508=>10015, -8481=>10016, -12849=>10017, -8208=>10018, -12540=>10019, -12443=>10020, -12444=>10021, -12541=>10022, -12542=>10023, -12294=>10024, -12445=>10025, -12446=>10026, -65097=>10027, -65098=>10028, -65099=>10029, -65100=>10030, -65101=>10031, -65102=>10032, -65103=>10033, -65104=>10034, -65105=>10035, -65106=>10036, -65108=>10037, -65109=>10038, -65110=>10039, -65111=>10040, -65113=>10041, -65114=>10042, -65115=>10043, -65116=>10044, -65117=>10045, -65118=>10046, -65119=>10047, -65120=>10048, -65121=>10049, -65122=>10050, -65123=>10051, -65124=>10052, -65125=>10053, -65126=>10054, -65128=>10055, -65129=>10056, -65130=>10057, -65131=>10058, -12350=>10059, -59367=>10059, -12272=>10060, -59368=>10060, -12273=>10061, -59369=>10061, -12274=>10062, -59370=>10062, -12275=>10063, -59371=>10063, -12276=>10064, -59372=>10064, -12277=>10065, -59373=>10065, -12278=>10066, -59374=>10066, -12279=>10067, -59375=>10067, -12280=>10068, -59376=>10068, -12281=>10069, -59377=>10069, -12282=>10070, -59378=>10070, -12283=>10071, -59379=>10071, -19970=>10072, -19972=>10073, -19973=>10074, -19974=>10075, -19983=>10076, -19986=>10077, -19991=>10078, -19999=>10079, -20000=>10080, -20001=>10081, -20003=>10082, -20006=>10083, -20009=>10084, -20014=>10085, -20015=>10086, -20017=>10087, -20019=>10088, -20021=>10089, -20023=>10090, -20028=>10091, -20032=>10092, -20033=>10093, -20034=>10094, -20036=>10095, -20038=>10096, -20042=>10097, -20049=>10098, -20053=>10099, -20055=>10100, -20058=>10101, -20059=>10102, -20066=>10103, -20067=>10104, -20068=>10105, -20069=>10106, -20071=>10107, -20072=>10108, -20074=>10109, -20075=>10110, -20076=>10111, -20077=>10112, -20078=>10113, -20079=>10114, -20082=>10115, -20084=>10116, -20085=>10117, -20086=>10118, -20087=>10119, -20088=>10120, -20089=>10121, -20090=>10122, -20091=>10123, -20092=>10124, -20093=>10125, -20095=>10126, -20096=>10127, -20097=>10128, -20099=>10129, -20100=>10130, -12037=>10131, -20101=>10131, -20103=>10132, -20106=>10133, -20112=>10134, -20118=>10135, -20119=>10136, -20121=>10137, -20124=>10138, -20125=>10139, -20131=>10140, -20138=>10141, -20143=>10142, -20144=>10143, -20145=>10144, -20148=>10145, -20150=>10146, -20151=>10147, -20152=>10148, -20153=>10149, -20156=>10150, -20157=>10151, -20158=>10152, -20168=>10153, -20172=>10154, -20175=>10155, -20176=>10156, -20178=>10157, -20186=>10158, -20187=>10159, -20188=>10160, -20192=>10161, -20194=>10162, -20198=>10163, -20199=>10164, -20201=>10165, -20205=>10166, -20206=>10167, -20207=>10168, -20209=>10169, -20212=>10170, -20216=>10171, -20217=>10172, -20218=>10173, -20220=>10174, -20222=>10175, -20224=>10176, -20226=>10177, -20227=>10178, -20228=>10179, -20229=>10180, -20230=>10181, -20231=>10182, -20232=>10183, -20235=>10184, -20236=>10185, -20242=>10186, -20243=>10187, -20244=>10188, -20245=>10189, -20246=>10190, -20252=>10191, -20253=>10192, -20257=>10193, -20259=>10194, -20264=>10195, -20265=>10196, -20268=>10197, -20269=>10198, -20270=>10199, -20273=>10200, -20275=>10201, -20277=>10202, -20279=>10203, -20281=>10204, -20283=>10205, -20286=>10206, -20287=>10207, -20288=>10208, -20289=>10209, -20290=>10210, -20292=>10211, -20293=>10212, -20295=>10213, -20296=>10214, -20297=>10215, -20298=>10216, -20299=>10217, -20300=>10218, -20306=>10219, -20308=>10220, -20310=>10221, -20321=>10222, -20322=>10223, -20326=>10224, -20328=>10225, -20330=>10226, -20331=>10227, -20333=>10228, -20334=>10229, -20337=>10230, -20338=>10231, -20341=>10232, -20343=>10233, -20344=>10234, -20345=>10235, -20346=>10236, -20349=>10237, -20352=>10238, -20353=>10239, -20354=>10240, -20357=>10241, -20359=>10242, -20362=>10243, -20364=>10244, -20366=>10245, -20368=>10246, -20370=>10247, -20371=>10248, -20373=>10249, -20376=>10250, -20377=>10251, -20378=>10252, -20380=>10253, -20382=>10254, -20383=>10255, -20385=>10256, -20386=>10257, -20388=>10258, -20395=>10259, -20397=>10260, -20400=>10261, -20401=>10262, -20402=>10263, -20403=>10264, -20404=>10265, -20406=>10266, -20407=>10267, -20408=>10268, -20409=>10269, -20410=>10270, -20411=>10271, -20412=>10272, -20413=>10273, -20414=>10274, -20416=>10275, -20417=>10276, -20422=>10277, -20423=>10278, -20424=>10279, -20425=>10280, -20427=>10281, -20428=>10282, -20429=>10283, -20434=>10284, -20435=>10285, -20436=>10286, -20437=>10287, -20438=>10288, -20441=>10289, -20443=>10290, -20450=>10291, -20452=>10292, -20453=>10293, -20455=>10294, -20459=>10295, -20460=>10296, -20464=>10297, -20466=>10298, -20468=>10299, -20469=>10300, -20470=>10301, -20471=>10302, -20473=>10303, -20475=>10304, -20476=>10305, -20477=>10306, -20479=>10307, -20481=>10308, -20482=>10309, -20483=>10310, -20484=>10311, -20485=>10312, -20487=>10313, -20488=>10314, -20490=>10315, -20494=>10316, -20496=>10317, -20499=>10318, -20501=>10319, -20502=>10320, -20503=>10321, -20507=>10322, -20509=>10323, -20510=>10324, -20512=>10325, -20514=>10326, -20515=>10327, -20516=>10328, -20519=>10329, -20527=>10330, -20528=>10331, -20529=>10332, -20530=>10333, -20531=>10334, -20532=>10335, -20533=>10336, -20534=>10337, -20535=>10338, -20536=>10339, -20537=>10340, -20539=>10341, -20541=>10342, -20543=>10343, -20544=>10344, -20545=>10345, -20546=>10346, -20548=>10347, -20549=>10348, -20550=>10349, -20554=>10350, -20555=>10351, -20557=>10352, -20560=>10353, -20561=>10354, -20562=>10355, -20563=>10356, -20564=>10357, -20566=>10358, -20567=>10359, -20568=>10360, -20569=>10361, -20571=>10362, -20573=>10363, -20574=>10364, -20575=>10365, -20576=>10366, -20577=>10367, -20578=>10368, -20579=>10369, -20580=>10370, -20582=>10371, -20583=>10372, -20584=>10373, -20585=>10374, -20586=>10375, -20587=>10376, -20589=>10377, -20590=>10378, -20591=>10379, -20592=>10380, -20593=>10381, -20594=>10382, -20595=>10383, -20600=>10384, -20601=>10385, -20602=>10386, -20604=>10387, -20605=>10388, -20609=>10389, -20610=>10390, -20611=>10391, -20612=>10392, -20614=>10393, -20615=>10394, -20617=>10395, -20618=>10396, -20619=>10397, -20620=>10398, -20622=>10399, -20623=>10400, -20624=>10401, -20625=>10402, -20626=>10403, -20627=>10404, -20628=>10405, -20629=>10406, -20631=>10407, -20634=>10408, -20635=>10409, -20636=>10410, -20637=>10411, -20638=>10412, -20639=>10413, -20640=>10414, -20641=>10415, -20644=>10416, -20646=>10417, -20650=>10418, -20651=>10419, -20654=>10420, -20655=>10421, -20656=>10422, -20657=>10423, -20662=>10424, -20664=>10425, -20665=>10426, -20668=>10427, -20669=>10428, -20671=>10429, -20672=>10430, -20673=>10431, -20675=>10432, -20676=>10433, -20678=>10434, -20679=>10435, -20680=>10436, -20682=>10437, -20683=>10438, -20684=>10439, -20685=>10440, -20686=>10441, -20688=>10442, -20690=>10443, -20691=>10444, -20692=>10445, -20695=>10446, -20696=>10447, -20697=>10448, -20699=>10449, -20700=>10450, -20701=>10451, -20703=>10452, -20704=>10453, -20705=>10454, -20706=>10455, -20707=>10456, -20708=>10457, -20713=>10458, -20714=>10459, -20715=>10460, -20719=>10461, -20720=>10462, -20721=>10463, -20722=>10464, -20724=>10465, -20726=>10466, -20727=>10467, -20728=>10468, -20730=>10469, -20732=>10470, -20733=>10471, -20734=>10472, -20735=>10473, -20737=>10474, -20739=>10475, -20741=>10476, -20746=>10477, -20748=>10478, -20749=>10479, -20750=>10480, -20751=>10481, -20753=>10482, -20755=>10483, -20758=>10484, -20759=>10485, -20761=>10486, -20762=>10487, -20763=>10488, -20764=>10489, -20765=>10490, -20766=>10491, -20768=>10492, -20770=>10493, -20771=>10494, -20772=>10495, -20773=>10496, -20774=>10497, -20775=>10498, -20776=>10499, -20777=>10500, -20779=>10501, -20780=>10502, -20781=>10503, -20782=>10504, -20783=>10505, -20784=>10506, -20785=>10507, -20787=>10508, -20788=>10509, -20789=>10510, -20790=>10511, -20792=>10512, -20793=>10513, -20797=>10514, -20798=>10515, -20802=>10516, -20807=>10517, -20810=>10518, -20812=>10519, -20814=>10520, -20815=>10521, -20816=>10522, -20819=>10523, -20823=>10524, -20824=>10525, -20825=>10526, -20827=>10527, -20829=>10528, -20830=>10529, -20831=>10530, -20832=>10531, -20833=>10532, -20835=>10533, -20836=>10534, -20838=>10535, -20839=>10536, -20842=>10537, -20847=>10538, -20850=>10539, -20858=>10540, -20862=>10541, -20863=>10542, -20867=>10543, -20868=>10544, -20870=>10545, -20871=>10546, -20874=>10547, -20875=>10548, -20878=>10549, -20879=>10550, -20880=>10551, -20881=>10552, -20883=>10553, -20884=>10554, -20888=>10555, -20890=>10556, -20893=>10557, -20894=>10558, -20895=>10559, -20897=>10560, -20899=>10561, -20902=>10562, -20903=>10563, -20904=>10564, -20905=>10565, -20906=>10566, -20909=>10567, -20910=>10568, -20916=>10569, -20920=>10570, -20921=>10571, -20922=>10572, -20926=>10573, -20927=>10574, -20929=>10575, -20930=>10576, -20931=>10577, -20933=>10578, -20936=>10579, -20938=>10580, -20942=>10581, -20944=>10582, -20946=>10583, -20947=>10584, -20948=>10585, -20949=>10586, -20950=>10587, -20951=>10588, -20952=>10589, -20953=>10590, -20954=>10591, -20956=>10592, -20958=>10593, -20959=>10594, -20962=>10595, -20963=>10596, -20965=>10597, -20966=>10598, -20967=>10599, -20968=>10600, -20969=>10601, -20970=>10602, -20972=>10603, -20974=>10604, -20978=>10605, -20980=>10606, -20983=>10607, -20990=>10608, -20996=>10609, -20997=>10610, -21001=>10611, -21003=>10612, -21004=>10613, -21007=>10614, -21008=>10615, -21011=>10616, -21012=>10617, -21013=>10618, -21020=>10619, -21022=>10620, -21023=>10621, -21025=>10622, -21026=>10623, -21027=>10624, -21029=>10625, -21030=>10626, -21031=>10627, -21034=>10628, -21036=>10629, -21039=>10630, -21041=>10631, -21042=>10632, -21044=>10633, -21045=>10634, -21052=>10635, -21054=>10636, -21061=>10637, -21062=>10638, -21064=>10639, -21065=>10640, -21070=>10641, -21071=>10642, -21074=>10643, -21075=>10644, -21077=>10645, -21079=>10646, -21080=>10647, -21081=>10648, -21082=>10649, -21085=>10650, -21087=>10651, -21088=>10652, -21090=>10653, -21091=>10654, -21092=>10655, -21094=>10656, -21096=>10657, -21099=>10658, -21100=>10659, -21101=>10660, -21104=>10661, -21105=>10662, -21107=>10663, -21110=>10664, -21111=>10665, -21112=>10666, -21113=>10667, -21114=>10668, -21115=>10669, -21116=>10670, -21118=>10671, -21120=>10672, -21124=>10673, -21125=>10674, -21126=>10675, -21131=>10676, -21134=>10677, -21135=>10678, -21138=>10679, -21140=>10680, -21141=>10681, -21142=>10682, -21143=>10683, -21144=>10684, -21145=>10685, -21146=>10686, -21148=>10687, -21156=>10688, -21157=>10689, -21158=>10690, -21159=>10691, -21166=>10692, -21167=>10693, -21168=>10694, -21172=>10695, -21173=>10696, -21174=>10697, -21175=>10698, -21176=>10699, -21177=>10700, -21178=>10701, -21179=>10702, -21180=>10703, -21181=>10704, -21184=>10705, -21186=>10706, -21188=>10707, -21189=>10708, -21190=>10709, -21192=>10710, -21194=>10711, -21196=>10712, -21197=>10713, -21198=>10714, -21199=>10715, -21201=>10716, -21203=>10717, -21204=>10718, -21207=>10719, -21210=>10720, -21212=>10721, -21216=>10722, -21217=>10723, -21219=>10724, -21221=>10725, -21222=>10726, -21223=>10727, -21224=>10728, -21225=>10729, -21226=>10730, -21227=>10731, -21228=>10732, -21229=>10733, -21230=>10734, -21231=>10735, -21234=>10736, -21235=>10737, -21236=>10738, -21238=>10739, -21239=>10740, -21243=>10741, -21244=>10742, -21245=>10743, -21249=>10744, -21250=>10745, -21251=>10746, -21252=>10747, -21255=>10748, -21257=>10749, -21258=>10750, -21259=>10751, -21260=>10752, -21262=>10753, -21265=>10754, -21266=>10755, -21267=>10756, -21268=>10757, -21272=>10758, -21275=>10759, -21276=>10760, -21278=>10761, -21279=>10762, -21282=>10763, -21284=>10764, -21285=>10765, -21287=>10766, -21288=>10767, -21289=>10768, -21291=>10769, -21292=>10770, -21296=>10771, -21298=>10772, -21299=>10773, -21300=>10774, -21301=>10775, -21302=>10776, -21303=>10777, -12054=>10778, -21304=>10778, -21308=>10779, -21309=>10780, -21314=>10781, -21316=>10782, -21318=>10783, -21323=>10784, -21324=>10785, -21325=>10786, -21328=>10787, -21336=>10788, -21337=>10789, -21339=>10790, -21341=>10791, -21349=>10792, -21352=>10793, -21354=>10794, -21356=>10795, -21357=>10796, -21362=>10797, -21366=>10798, -21369=>10799, -21371=>10800, -21372=>10801, -21373=>10802, -21374=>10803, -21376=>10804, -21377=>10805, -21379=>10806, -21383=>10807, -21384=>10808, -21386=>10809, -21390=>10810, -21391=>10811, -21392=>10812, -21393=>10813, -21394=>10814, -21395=>10815, -21396=>10816, -21398=>10817, -21399=>10818, -21403=>10819, -21404=>10820, -21406=>10821, -21409=>10822, -21412=>10823, -21415=>10824, -21418=>10825, -21419=>10826, -21420=>10827, -21423=>10828, -21424=>10829, -21425=>10830, -21427=>10831, -21429=>10832, -21431=>10833, -21432=>10834, -21433=>10835, -21434=>10836, -21436=>10837, -21437=>10838, -21438=>10839, -21440=>10840, -21444=>10841, -21445=>10842, -21446=>10843, -21447=>10844, -21454=>10845, -21455=>10846, -21456=>10847, -21458=>10848, -21459=>10849, -21461=>10850, -21466=>10851, -21468=>10852, -21469=>10853, -21470=>10854, -21473=>10855, -21479=>10856, -21492=>10857, -21498=>10858, -21502=>10859, -21503=>10860, -21504=>10861, -21506=>10862, -21509=>10863, -21511=>10864, -21515=>10865, -21524=>10866, -21528=>10867, -21529=>10868, -21530=>10869, -21532=>10870, -21538=>10871, -21540=>10872, -21541=>10873, -21546=>10874, -21552=>10875, -21555=>10876, -21558=>10877, -21559=>10878, -21562=>10879, -21565=>10880, -21567=>10881, -21569=>10882, -21570=>10883, -21572=>10884, -21573=>10885, -21575=>10886, -21577=>10887, -21580=>10888, -21581=>10889, -21582=>10890, -21583=>10891, -21585=>10892, -21594=>10893, -21597=>10894, -21598=>10895, -21599=>10896, -21600=>10897, -21601=>10898, -21603=>10899, -21605=>10900, -21607=>10901, -21609=>10902, -21610=>10903, -21611=>10904, -21612=>10905, -21613=>10906, -21614=>10907, -21615=>10908, -21616=>10909, -21620=>10910, -21625=>10911, -21626=>10912, -21630=>10913, -21631=>10914, -21633=>10915, -21635=>10916, -21637=>10917, -21639=>10918, -21640=>10919, -21641=>10920, -21642=>10921, -21645=>10922, -21649=>10923, -21651=>10924, -21655=>10925, -21656=>10926, -21660=>10927, -21662=>10928, -21663=>10929, -21664=>10930, -21665=>10931, -21666=>10932, -21669=>10933, -21678=>10934, -21680=>10935, -21682=>10936, -21685=>10937, -21686=>10938, -21687=>10939, -21689=>10940, -21690=>10941, -21694=>10942, -21699=>10943, -21701=>10944, -21706=>10945, -21707=>10946, -21718=>10947, -21720=>10948, -21723=>10949, -21728=>10950, -21730=>10951, -21731=>10952, -21732=>10953, -21739=>10954, -21740=>10955, -21743=>10956, -21744=>10957, -21745=>10958, -21748=>10959, -21749=>10960, -21750=>10961, -21751=>10962, -21752=>10963, -21753=>10964, -21755=>10965, -21758=>10966, -21760=>10967, -21762=>10968, -21763=>10969, -21765=>10970, -21768=>10971, -21770=>10972, -21771=>10973, -21772=>10974, -21773=>10975, -21774=>10976, -21778=>10977, -21779=>10978, -21781=>10979, -21782=>10980, -21783=>10981, -21784=>10982, -21785=>10983, -21786=>10984, -21788=>10985, -21789=>10986, -21790=>10987, -21791=>10988, -21793=>10989, -21797=>10990, -21798=>10991, -21800=>10992, -21801=>10993, -21803=>10994, -21805=>10995, -21810=>10996, -21812=>10997, -21813=>10998, -21814=>10999, -21816=>11000, -21817=>11001, -21818=>11002, -21819=>11003, -21821=>11004, -21824=>11005, -21826=>11006, -21829=>11007, -21831=>11008, -21832=>11009, -21835=>11010, -21836=>11011, -21837=>11012, -21838=>11013, -21841=>11014, -21842=>11015, -21844=>11016, -21847=>11017, -21848=>11018, -21849=>11019, -21850=>11020, -21851=>11021, -21853=>11022, -21855=>11023, -21856=>11024, -21858=>11025, -21859=>11026, -21864=>11027, -21865=>11028, -21867=>11029, -21871=>11030, -21872=>11031, -21873=>11032, -21874=>11033, -21875=>11034, -21876=>11035, -21881=>11036, -21882=>11037, -21885=>11038, -21887=>11039, -21893=>11040, -21894=>11041, -21900=>11042, -21901=>11043, -21902=>11044, -21904=>11045, -21906=>11046, -21907=>11047, -21909=>11048, -21910=>11049, -21911=>11050, -21914=>11051, -21915=>11052, -21918=>11053, -21920=>11054, -21921=>11055, -21922=>11056, -21923=>11057, -21924=>11058, -21925=>11059, -21926=>11060, -21928=>11061, -21929=>11062, -21931=>11063, -21933=>11064, -21935=>11065, -21936=>11066, -21940=>11067, -21942=>11068, -21944=>11069, -21946=>11070, -21948=>11071, -21951=>11072, -21952=>11073, -21953=>11074, -21954=>11075, -21955=>11076, -21960=>11077, -21962=>11078, -21963=>11079, -21967=>11080, -21968=>11081, -21973=>11082, -21975=>11083, -21976=>11084, -21977=>11085, -21979=>11086, -21982=>11087, -21984=>11088, -21986=>11089, -21991=>11090, -21997=>11091, -21998=>11092, -22000=>11093, -22001=>11094, -22004=>11095, -22008=>11096, -22009=>11097, -22010=>11098, -22011=>11099, -22012=>11100, -22015=>11101, -22018=>11102, -22019=>11103, -22020=>11104, -22021=>11105, -22023=>11106, -22026=>11107, -22027=>11108, -22032=>11109, -22033=>11110, -22034=>11111, -22035=>11112, -22037=>11113, -22041=>11114, -22042=>11115, -22045=>11116, -22048=>11117, -22049=>11118, -22050=>11119, -22053=>11120, -22054=>11121, -22056=>11122, -22058=>11123, -22059=>11124, -22067=>11125, -22071=>11126, -22074=>11127, -22076=>11128, -22077=>11129, -22078=>11130, -22080=>11131, -22082=>11132, -22083=>11133, -22084=>11134, -22085=>11135, -22086=>11136, -22087=>11137, -22088=>11138, -22089=>11139, -22090=>11140, -22091=>11141, -22095=>11142, -22096=>11143, -22097=>11144, -22098=>11145, -22099=>11146, -22101=>11147, -22102=>11148, -22106=>11149, -22107=>11150, -22110=>11151, -22111=>11152, -22113=>11153, -22115=>11154, -22119=>11155, -22125=>11156, -22126=>11157, -22128=>11158, -22131=>11159, -22133=>11160, -22135=>11161, -22138=>11162, -22141=>11163, -22142=>11164, -22143=>11165, -22145=>11166, -22146=>11167, -22147=>11168, -22148=>11169, -22152=>11170, -22153=>11171, -22154=>11172, -22155=>11173, -22157=>11174, -22160=>11175, -22161=>11176, -22162=>11177, -22164=>11178, -22166=>11179, -22167=>11180, -22168=>11181, -22170=>11182, -22171=>11183, -22172=>11184, -22173=>11185, -22174=>11186, -22175=>11187, -22176=>11188, -22177=>11189, -22178=>11190, -22180=>11191, -22181=>11192, -22183=>11193, -22185=>11194, -22186=>11195, -22187=>11196, -22188=>11197, -22189=>11198, -22192=>11199, -22193=>11200, -22194=>11201, -22197=>11202, -22200=>11203, -22201=>11204, -22202=>11205, -22203=>11206, -22205=>11207, -22206=>11208, -22207=>11209, -22211=>11210, -22212=>11211, -22214=>11212, -22215=>11213, -22219=>11214, -22221=>11215, -22222=>11216, -22223=>11217, -22224=>11218, -22226=>11219, -22227=>11220, -22229=>11221, -22230=>11222, -22232=>11223, -22233=>11224, -22236=>11225, -22243=>11226, -22245=>11227, -22246=>11228, -22247=>11229, -22248=>11230, -22249=>11231, -22250=>11232, -22252=>11233, -22254=>11234, -22255=>11235, -22258=>11236, -22259=>11237, -22262=>11238, -22263=>11239, -22264=>11240, -22267=>11241, -22268=>11242, -22272=>11243, -22273=>11244, -22274=>11245, -22277=>11246, -22284=>11247, -22286=>11248, -22287=>11249, -22288=>11250, -22289=>11251, -22292=>11252, -22293=>11253, -22295=>11254, -22297=>11255, -22298=>11256, -22299=>11257, -22301=>11258, -22302=>11259, -22304=>11260, -22305=>11261, -22306=>11262, -22308=>11263, -22309=>11264, -22310=>11265, -22311=>11266, -22315=>11267, -22321=>11268, -22322=>11269, -22324=>11270, -22325=>11271, -22326=>11272, -22327=>11273, -22328=>11274, -22332=>11275, -22333=>11276, -22335=>11277, -22337=>11278, -22339=>11279, -22340=>11280, -22341=>11281, -22342=>11282, -22344=>11283, -22345=>11284, -22347=>11285, -22354=>11286, -22355=>11287, -22356=>11288, -22357=>11289, -22358=>11290, -22360=>11291, -22361=>11292, -22370=>11293, -22371=>11294, -22373=>11295, -22375=>11296, -22380=>11297, -22382=>11298, -22384=>11299, -22385=>11300, -22386=>11301, -22388=>11302, -22389=>11303, -22392=>11304, -22393=>11305, -22394=>11306, -22397=>11307, -22398=>11308, -22399=>11309, -22400=>11310, -22401=>11311, -22407=>11312, -22408=>11313, -22409=>11314, -22410=>11315, -22413=>11316, -22414=>11317, -22415=>11318, -22416=>11319, -22417=>11320, -22420=>11321, -22421=>11322, -22422=>11323, -22423=>11324, -22424=>11325, -22425=>11326, -22426=>11327, -22428=>11328, -22429=>11329, -22430=>11330, -22431=>11331, -22437=>11332, -22440=>11333, -22442=>11334, -22444=>11335, -22447=>11336, -22448=>11337, -22449=>11338, -22451=>11339, -22453=>11340, -22454=>11341, -22455=>11342, -22457=>11343, -22458=>11344, -22459=>11345, -22460=>11346, -22461=>11347, -22462=>11348, -22463=>11349, -22464=>11350, -22465=>11351, -22468=>11352, -22469=>11353, -22470=>11354, -22471=>11355, -22472=>11356, -22473=>11357, -22474=>11358, -22476=>11359, -22477=>11360, -22480=>11361, -22481=>11362, -22483=>11363, -22486=>11364, -22487=>11365, -22491=>11366, -22492=>11367, -22494=>11368, -22498=>11369, -22499=>11370, -22501=>11371, -22502=>11372, -22503=>11373, -22504=>11374, -22505=>11375, -22506=>11376, -22507=>11377, -22508=>11378, -22510=>11379, -22512=>11380, -22513=>11381, -22514=>11382, -22515=>11383, -22517=>11384, -22518=>11385, -22523=>11386, -22524=>11387, -22526=>11388, -22527=>11389, -22529=>11390, -22531=>11391, -22532=>11392, -22536=>11393, -22537=>11394, -22540=>11395, -22542=>11396, -22543=>11397, -22544=>11398, -22546=>11399, -22547=>11400, -22548=>11401, -22551=>11402, -22552=>11403, -22554=>11404, -22555=>11405, -22556=>11406, -22559=>11407, -22562=>11408, -22563=>11409, -22565=>11410, -22566=>11411, -22567=>11412, -22568=>11413, -22569=>11414, -22571=>11415, -22572=>11416, -22573=>11417, -22574=>11418, -22578=>11419, -22579=>11420, -22582=>11421, -22583=>11422, -22584=>11423, -22585=>11424, -22586=>11425, -22587=>11426, -22588=>11427, -22589=>11428, -22590=>11429, -22591=>11430, -22592=>11431, -22593=>11432, -22594=>11433, -22595=>11434, -22597=>11435, -22598=>11436, -22599=>11437, -22600=>11438, -22601=>11439, -22606=>11440, -22608=>11441, -22611=>11442, -22613=>11443, -22614=>11444, -22617=>11445, -22618=>11446, -22619=>11447, -22620=>11448, -22621=>11449, -22623=>11450, -22624=>11451, -22625=>11452, -22627=>11453, -22630=>11454, -22631=>11455, -22632=>11456, -22633=>11457, -22634=>11458, -22637=>11459, -22638=>11460, -22639=>11461, -22640=>11462, -22641=>11463, -22642=>11464, -22643=>11465, -22644=>11466, -22646=>11467, -22647=>11468, -22648=>11469, -22650=>11470, -22651=>11471, -22652=>11472, -22653=>11473, -22655=>11474, -22658=>11475, -22660=>11476, -22662=>11477, -22663=>11478, -22664=>11479, -22667=>11480, -22668=>11481, -22669=>11482, -22670=>11483, -22671=>11484, -22672=>11485, -22673=>11486, -22676=>11487, -22677=>11488, -22678=>11489, -22679=>11490, -22680=>11491, -22683=>11492, -22685=>11493, -22688=>11494, -22689=>11495, -22690=>11496, -22691=>11497, -22692=>11498, -22693=>11499, -22694=>11500, -22695=>11501, -22698=>11502, -22699=>11503, -22700=>11504, -22701=>11505, -22703=>11506, -22704=>11507, -22705=>11508, -22706=>11509, -22708=>11510, -22709=>11511, -22710=>11512, -22711=>11513, -22712=>11514, -22713=>11515, -22714=>11516, -22717=>11517, -22719=>11518, -22720=>11519, -22722=>11520, -22723=>11521, -22724=>11522, -22726=>11523, -22728=>11524, -22729=>11525, -22730=>11526, -22731=>11527, -22732=>11528, -22733=>11529, -22734=>11530, -22735=>11531, -22736=>11532, -22738=>11533, -22740=>11534, -22742=>11535, -22743=>11536, -22747=>11537, -22748=>11538, -22749=>11539, -22753=>11540, -22755=>11541, -22757=>11542, -22758=>11543, -22759=>11544, -22760=>11545, -22762=>11546, -22765=>11547, -22769=>11548, -22770=>11549, -22772=>11550, -22773=>11551, -22775=>11552, -22776=>11553, -22779=>11554, -22780=>11555, -22782=>11556, -22783=>11557, -22784=>11558, -22785=>11559, -22787=>11560, -22789=>11561, -22790=>11562, -22792=>11563, -22793=>11564, -12066=>11565, -22794=>11565, -22795=>11566, -22796=>11567, -22798=>11568, -22800=>11569, -22801=>11570, -22802=>11571, -22803=>11572, -22807=>11573, -22808=>11574, -22811=>11575, -22813=>11576, -22814=>11577, -22816=>11578, -22817=>11579, -22819=>11580, -22822=>11581, -22824=>11582, -22828=>11583, -22832=>11584, -22834=>11585, -22835=>11586, -22837=>11587, -22838=>11588, -22843=>11589, -22845=>11590, -22847=>11591, -22848=>11592, -22851=>11593, -22853=>11594, -22854=>11595, -22858=>11596, -22860=>11597, -22861=>11598, -22864=>11599, -22866=>11600, -22867=>11601, -22873=>11602, -22875=>11603, -22876=>11604, -22877=>11605, -22878=>11606, -22879=>11607, -22881=>11608, -22883=>11609, -22884=>11610, -22886=>11611, -22887=>11612, -22888=>11613, -22891=>11614, -22893=>11615, -22895=>11616, -22896=>11617, -22897=>11618, -22898=>11619, -22901=>11620, -22903=>11621, -22906=>11622, -22907=>11623, -22908=>11624, -22910=>11625, -22911=>11626, -22912=>11627, -22917=>11628, -22921=>11629, -22923=>11630, -22924=>11631, -22926=>11632, -22927=>11633, -22928=>11634, -22929=>11635, -22932=>11636, -22933=>11637, -22936=>11638, -22938=>11639, -22939=>11640, -22940=>11641, -22943=>11642, -22944=>11643, -22945=>11644, -22946=>11645, -22950=>11646, -22951=>11647, -22956=>11648, -22957=>11649, -22960=>11650, -22961=>11651, -22963=>11652, -22964=>11653, -22965=>11654, -22966=>11655, -22967=>11656, -22968=>11657, -22970=>11658, -22972=>11659, -22973=>11660, -22975=>11661, -22976=>11662, -22977=>11663, -22978=>11664, -22979=>11665, -22980=>11666, -22981=>11667, -22983=>11668, -22984=>11669, -22985=>11670, -22988=>11671, -22989=>11672, -22990=>11673, -22991=>11674, -22997=>11675, -22998=>11676, -23001=>11677, -23003=>11678, -23006=>11679, -23007=>11680, -23008=>11681, -23009=>11682, -23010=>11683, -23012=>11684, -23014=>11685, -23015=>11686, -23017=>11687, -23018=>11688, -23019=>11689, -23021=>11690, -23022=>11691, -23023=>11692, -23024=>11693, -23025=>11694, -23026=>11695, -23027=>11696, -23028=>11697, -23029=>11698, -23030=>11699, -23031=>11700, -23032=>11701, -23034=>11702, -23036=>11703, -23037=>11704, -23038=>11705, -23040=>11706, -23042=>11707, -23050=>11708, -23051=>11709, -23053=>11710, -23054=>11711, -23055=>11712, -23056=>11713, -23058=>11714, -23060=>11715, -23061=>11716, -23062=>11717, -23063=>11718, -23065=>11719, -23066=>11720, -23067=>11721, -23069=>11722, -23070=>11723, -23073=>11724, -23074=>11725, -23076=>11726, -23078=>11727, -23079=>11728, -23080=>11729, -23082=>11730, -23083=>11731, -23084=>11732, -23085=>11733, -23086=>11734, -23087=>11735, -23088=>11736, -23091=>11737, -23093=>11738, -23095=>11739, -23096=>11740, -23097=>11741, -23098=>11742, -23099=>11743, -23101=>11744, -23102=>11745, -23103=>11746, -23106=>11747, -23107=>11748, -23108=>11749, -23109=>11750, -23111=>11751, -23112=>11752, -23115=>11753, -23116=>11754, -23117=>11755, -23118=>11756, -23119=>11757, -23120=>11758, -23121=>11759, -23122=>11760, -23123=>11761, -23124=>11762, -23126=>11763, -23127=>11764, -23128=>11765, -23129=>11766, -23131=>11767, -23132=>11768, -23133=>11769, -23134=>11770, -23135=>11771, -23136=>11772, -23137=>11773, -23139=>11774, -23140=>11775, -23141=>11776, -23144=>11777, -23145=>11778, -23147=>11779, -23148=>11780, -23150=>11781, -23151=>11782, -23152=>11783, -23153=>11784, -23154=>11785, -23155=>11786, -23160=>11787, -23161=>11788, -23163=>11789, -23164=>11790, -23165=>11791, -23166=>11792, -23168=>11793, -23169=>11794, -23170=>11795, -23171=>11796, -23172=>11797, -23173=>11798, -23174=>11799, -23175=>11800, -23176=>11801, -23177=>11802, -23178=>11803, -23179=>11804, -23180=>11805, -23181=>11806, -23182=>11807, -23183=>11808, -23184=>11809, -23185=>11810, -23187=>11811, -23188=>11812, -23189=>11813, -23190=>11814, -23191=>11815, -23192=>11816, -23193=>11817, -23196=>11818, -23197=>11819, -23198=>11820, -23199=>11821, -23200=>11822, -23201=>11823, -23202=>11824, -23203=>11825, -23204=>11826, -23205=>11827, -23206=>11828, -23208=>11829, -23209=>11830, -23211=>11831, -23212=>11832, -23213=>11833, -23214=>11834, -23215=>11835, -23216=>11836, -23217=>11837, -23220=>11838, -23222=>11839, -23223=>11840, -23225=>11841, -23226=>11842, -23227=>11843, -23228=>11844, -23231=>11845, -23232=>11846, -23235=>11847, -23236=>11848, -23237=>11849, -23238=>11850, -23239=>11851, -23240=>11852, -23242=>11853, -23243=>11854, -23245=>11855, -23246=>11856, -23247=>11857, -23248=>11858, -23249=>11859, -23251=>11860, -23253=>11861, -23257=>11862, -23258=>11863, -23259=>11864, -23261=>11865, -23262=>11866, -23263=>11867, -23266=>11868, -23268=>11869, -23269=>11870, -23271=>11871, -23272=>11872, -23274=>11873, -23276=>11874, -23277=>11875, -23278=>11876, -23279=>11877, -23280=>11878, -23282=>11879, -23283=>11880, -23284=>11881, -23286=>11882, -23287=>11883, -23288=>11884, -23289=>11885, -23290=>11886, -23292=>11887, -23293=>11888, -23294=>11889, -23295=>11890, -23297=>11891, -23298=>11892, -23299=>11893, -23300=>11894, -23301=>11895, -23302=>11896, -23303=>11897, -23306=>11898, -23309=>11899, -23310=>11900, -23311=>11901, -23312=>11902, -23313=>11903, -23314=>11904, -23315=>11905, -23316=>11906, -23317=>11907, -23320=>11908, -23322=>11909, -23323=>11910, -23324=>11911, -23325=>11912, -23326=>11913, -23327=>11914, -23328=>11915, -23330=>11916, -23331=>11917, -23332=>11918, -23333=>11919, -23334=>11920, -23335=>11921, -23336=>11922, -23337=>11923, -23339=>11924, -23340=>11925, -23341=>11926, -23342=>11927, -23343=>11928, -23345=>11929, -23347=>11930, -23349=>11931, -23350=>11932, -23353=>11933, -23354=>11934, -23355=>11935, -23356=>11936, -23357=>11937, -23358=>11938, -23359=>11939, -23361=>11940, -23362=>11941, -23363=>11942, -23364=>11943, -23365=>11944, -23366=>11945, -23367=>11946, -23368=>11947, -23369=>11948, -23370=>11949, -23371=>11950, -23373=>11951, -23374=>11952, -23375=>11953, -23378=>11954, -23382=>11955, -23390=>11956, -23392=>11957, -23393=>11958, -23399=>11959, -23400=>11960, -23405=>11961, -23406=>11962, -23407=>11963, -23410=>11964, -23412=>11965, -23414=>11966, -23415=>11967, -23417=>11968, -23419=>11969, -23420=>11970, -23422=>11971, -23426=>11972, -23430=>11973, -23434=>11974, -23437=>11975, -23438=>11976, -23440=>11977, -23441=>11978, -23442=>11979, -23444=>11980, -23446=>11981, -23455=>11982, -23463=>11983, -23464=>11984, -23465=>11985, -23468=>11986, -23469=>11987, -23470=>11988, -23471=>11989, -23473=>11990, -23474=>11991, -23479=>11992, -23482=>11993, -23483=>11994, -23484=>11995, -23488=>11996, -23489=>11997, -23491=>11998, -23496=>11999, -23497=>12000, -23498=>12001, -23499=>12002, -23501=>12003, -23502=>12004, -23503=>12005, -23505=>12006, -23508=>12007, -23509=>12008, -23510=>12009, -23511=>12010, -23512=>12011, -23513=>12012, -23514=>12013, -23515=>12014, -23516=>12015, -23520=>12016, -23523=>12017, -23530=>12018, -23533=>12019, -23535=>12020, -23537=>12021, -23538=>12022, -23539=>12023, -23540=>12024, -23543=>12025, -23549=>12026, -23550=>12027, -23552=>12028, -23554=>12029, -23555=>12030, -23557=>12031, -23564=>12032, -23568=>12033, -23570=>12034, -23571=>12035, -23575=>12036, -23577=>12037, -23579=>12038, -23582=>12039, -23583=>12040, -23584=>12041, -23585=>12042, -23587=>12043, -23590=>12044, -23592=>12045, -23593=>12046, -23594=>12047, -23595=>12048, -23597=>12049, -23598=>12050, -23599=>12051, -23600=>12052, -23602=>12053, -23603=>12054, -23605=>12055, -23606=>12056, -23619=>12057, -23620=>12058, -23622=>12059, -23623=>12060, -23628=>12061, -23629=>12062, -23634=>12063, -23635=>12064, -23636=>12065, -23638=>12066, -23639=>12067, -23640=>12068, -23642=>12069, -23643=>12070, -23644=>12071, -23645=>12072, -23647=>12073, -23655=>12074, -23657=>12075, -23658=>12076, -23659=>12077, -23661=>12078, -23664=>12079, -23666=>12080, -23667=>12081, -23668=>12082, -23669=>12083, -23670=>12084, -23671=>12085, -23672=>12086, -23675=>12087, -23676=>12088, -23677=>12089, -23678=>12090, -23680=>12091, -23683=>12092, -23684=>12093, -23685=>12094, -23686=>12095, -23687=>12096, -23689=>12097, -23690=>12098, -23691=>12099, -23694=>12100, -23695=>12101, -23698=>12102, -23699=>12103, -23701=>12104, -23709=>12105, -23710=>12106, -23711=>12107, -23712=>12108, -23716=>12109, -23717=>12110, -23718=>12111, -23719=>12112, -23720=>12113, -23722=>12114, -23726=>12115, -23727=>12116, -23728=>12117, -23730=>12118, -23732=>12119, -23734=>12120, -23737=>12121, -23738=>12122, -23739=>12123, -23740=>12124, -23742=>12125, -23744=>12126, -23746=>12127, -23747=>12128, -23749=>12129, -23750=>12130, -23751=>12131, -23752=>12132, -23753=>12133, -23754=>12134, -23756=>12135, -23757=>12136, -23758=>12137, -23759=>12138, -23760=>12139, -23761=>12140, -23763=>12141, -23764=>12142, -23765=>12143, -23766=>12144, -23767=>12145, -23768=>12146, -23770=>12147, -23771=>12148, -23772=>12149, -23773=>12150, -23774=>12151, -23775=>12152, -23776=>12153, -23778=>12154, -23779=>12155, -23783=>12156, -23785=>12157, -23787=>12158, -23788=>12159, -23790=>12160, -23791=>12161, -23793=>12162, -23794=>12163, -23795=>12164, -23797=>12165, -23799=>12166, -23800=>12167, -23801=>12168, -23802=>12169, -23804=>12170, -23806=>12171, -23807=>12172, -23808=>12173, -23809=>12174, -23812=>12175, -23813=>12176, -23816=>12177, -23817=>12178, -23818=>12179, -23819=>12180, -23820=>12181, -23823=>12182, -23824=>12183, -23825=>12184, -23826=>12185, -23827=>12186, -23829=>12187, -23832=>12188, -23833=>12189, -23834=>12190, -23836=>12191, -23837=>12192, -23839=>12193, -23840=>12194, -23841=>12195, -23842=>12196, -23843=>12197, -23845=>12198, -23848=>12199, -23850=>12200, -23851=>12201, -23855=>12202, -23856=>12203, -23857=>12204, -23858=>12205, -23859=>12206, -23861=>12207, -23862=>12208, -23863=>12209, -23864=>12210, -23865=>12211, -23866=>12212, -23867=>12213, -23868=>12214, -23871=>12215, -23872=>12216, -23873=>12217, -23874=>12218, -23875=>12219, -23876=>12220, -23877=>12221, -23878=>12222, -23880=>12223, -23881=>12224, -23885=>12225, -23886=>12226, -23887=>12227, -23889=>12228, -23890=>12229, -23891=>12230, -23892=>12231, -23893=>12232, -23894=>12233, -23895=>12234, -23897=>12235, -23898=>12236, -23900=>12237, -23902=>12238, -23903=>12239, -23904=>12240, -23905=>12241, -23906=>12242, -23907=>12243, -23908=>12244, -23909=>12245, -23910=>12246, -23911=>12247, -23912=>12248, -23914=>12249, -23917=>12250, -23918=>12251, -23920=>12252, -23921=>12253, -23922=>12254, -23923=>12255, -23925=>12256, -23926=>12257, -23927=>12258, -23928=>12259, -23929=>12260, -23930=>12261, -23931=>12262, -23932=>12263, -23933=>12264, -23934=>12265, -23935=>12266, -23936=>12267, -23939=>12268, -23941=>12269, -23942=>12270, -23944=>12271, -23945=>12272, -23946=>12273, -23947=>12274, -23948=>12275, -23949=>12276, -23950=>12277, -23951=>12278, -23952=>12279, -23953=>12280, -23954=>12281, -23955=>12282, -23956=>12283, -23957=>12284, -23958=>12285, -23960=>12286, -23962=>12287, -23963=>12288, -23964=>12289, -23966=>12290, -23967=>12291, -23969=>12292, -23970=>12293, -23971=>12294, -23972=>12295, -23973=>12296, -23974=>12297, -23976=>12298, -23977=>12299, -23978=>12300, -23979=>12301, -23980=>12302, -23981=>12303, -23982=>12304, -23983=>12305, -23984=>12306, -23985=>12307, -23986=>12308, -23987=>12309, -23988=>12310, -23989=>12311, -23990=>12312, -23993=>12313, -23995=>12314, -23997=>12315, -23998=>12316, -23999=>12317, -24000=>12318, -24001=>12319, -24002=>12320, -24003=>12321, -24004=>12322, -24006=>12323, -24007=>12324, -24008=>12325, -24009=>12326, -24010=>12327, -24012=>12328, -24014=>12329, -24015=>12330, -24016=>12331, -24017=>12332, -24019=>12333, -24021=>12334, -24022=>12335, -24023=>12336, -24024=>12337, -24025=>12338, -24026=>12339, -24028=>12340, -24031=>12341, -24032=>12342, -24035=>12343, -24036=>12344, -24042=>12345, -24044=>12346, -24045=>12347, -24053=>12348, -24054=>12349, -24056=>12350, -24057=>12351, -24058=>12352, -24059=>12353, -24060=>12354, -24063=>12355, -24064=>12356, -24068=>12357, -24071=>12358, -24073=>12359, -24074=>12360, -24075=>12361, -24077=>12362, -24078=>12363, -24082=>12364, -24083=>12365, -24087=>12366, -24094=>12367, -24095=>12368, -24096=>12369, -24097=>12370, -24098=>12371, -24099=>12372, -24100=>12373, -24104=>12374, -24105=>12375, -24106=>12376, -24108=>12377, -24111=>12378, -24112=>12379, -24114=>12380, -24116=>12381, -24117=>12382, -24121=>12383, -24122=>12384, -24126=>12385, -24127=>12386, -24129=>12387, -24134=>12388, -24135=>12389, -24136=>12390, -24137=>12391, -24138=>12392, -24139=>12393, -24141=>12394, -24142=>12395, -24143=>12396, -24144=>12397, -24145=>12398, -24146=>12399, -24147=>12400, -24150=>12401, -24153=>12402, -24154=>12403, -24156=>12404, -24157=>12405, -24160=>12406, -24164=>12407, -24165=>12408, -24166=>12409, -24167=>12410, -24168=>12411, -24169=>12412, -24170=>12413, -24173=>12414, -24174=>12415, -24175=>12416, -24176=>12417, -24177=>12418, -24181=>12419, -24183=>12420, -24193=>12421, -24194=>12422, -24195=>12423, -24197=>12424, -24200=>12425, -24201=>12426, -24204=>12427, -24205=>12428, -24206=>12429, -24210=>12430, -24216=>12431, -24219=>12432, -24221=>12433, -24225=>12434, -24226=>12435, -24227=>12436, -24228=>12437, -24232=>12438, -24233=>12439, -24234=>12440, -24236=>12441, -24238=>12442, -24239=>12443, -24240=>12444, -24241=>12445, -24242=>12446, -24244=>12447, -24250=>12448, -24251=>12449, -24252=>12450, -24253=>12451, -24255=>12452, -24256=>12453, -24257=>12454, -24258=>12455, -24259=>12456, -24260=>12457, -24261=>12458, -24262=>12459, -24263=>12460, -24264=>12461, -24267=>12462, -24268=>12463, -24269=>12464, -24270=>12465, -24271=>12466, -24272=>12467, -24276=>12468, -24277=>12469, -24279=>12470, -24280=>12471, -24281=>12472, -24282=>12473, -24284=>12474, -24285=>12475, -24286=>12476, -24292=>12477, -24293=>12478, -24294=>12479, -24295=>12480, -24297=>12481, -24299=>12482, -24301=>12483, -24302=>12484, -24303=>12485, -24304=>12486, -24305=>12487, -24306=>12488, -24309=>12489, -24312=>12490, -24313=>12491, -24315=>12492, -24316=>12493, -24317=>12494, -24325=>12495, -24326=>12496, -24327=>12497, -24329=>12498, -24332=>12499, -24333=>12500, -24334=>12501, -24336=>12502, -24338=>12503, -24340=>12504, -24342=>12505, -24345=>12506, -24346=>12507, -24348=>12508, -24349=>12509, -24350=>12510, -24353=>12511, -24354=>12512, -24355=>12513, -24356=>12514, -24360=>12515, -24363=>12516, -24364=>12517, -24366=>12518, -24368=>12519, -24370=>12520, -24372=>12521, -24374=>12522, -24375=>12523, -24376=>12524, -24379=>12525, -24381=>12526, -24382=>12527, -24383=>12528, -24385=>12529, -24386=>12530, -24387=>12531, -24388=>12532, -24389=>12533, -24391=>12534, -24393=>12535, -24394=>12536, -24395=>12537, -24397=>12538, -24399=>12539, -24401=>12540, -24404=>12541, -24410=>12542, -24411=>12543, -24412=>12544, -24414=>12545, -24415=>12546, -24416=>12547, -24419=>12548, -24421=>12549, -24423=>12550, -24424=>12551, -24427=>12552, -24430=>12553, -24431=>12554, -24434=>12555, -24436=>12556, -24437=>12557, -24438=>12558, -24440=>12559, -24442=>12560, -24445=>12561, -24446=>12562, -24447=>12563, -24451=>12564, -24454=>12565, -24461=>12566, -24462=>12567, -24463=>12568, -24467=>12569, -24468=>12570, -24470=>12571, -24474=>12572, -24475=>12573, -24477=>12574, -24479=>12575, -24482=>12576, -24483=>12577, -24484=>12578, -24485=>12579, -24486=>12580, -24487=>12581, -24491=>12582, -24492=>12583, -24495=>12584, -24496=>12585, -24497=>12586, -24498=>12587, -24499=>12588, -24500=>12589, -24502=>12590, -24504=>12591, -24506=>12592, -24507=>12593, -24510=>12594, -24511=>12595, -24512=>12596, -24513=>12597, -24514=>12598, -24519=>12599, -24520=>12600, -24522=>12601, -24523=>12602, -24526=>12603, -24531=>12604, -24532=>12605, -24533=>12606, -24538=>12607, -24539=>12608, -24540=>12609, -24542=>12610, -24543=>12611, -24546=>12612, -24547=>12613, -24549=>12614, -24550=>12615, -24552=>12616, -24553=>12617, -24556=>12618, -24559=>12619, -24560=>12620, -24562=>12621, -24563=>12622, -24564=>12623, -24566=>12624, -24567=>12625, -24569=>12626, -24570=>12627, -24572=>12628, -24583=>12629, -24584=>12630, -24585=>12631, -24587=>12632, -24588=>12633, -24592=>12634, -24593=>12635, -24595=>12636, -24599=>12637, -24600=>12638, -24602=>12639, -24606=>12640, -24607=>12641, -24610=>12642, -24611=>12643, -24612=>12644, -24620=>12645, -24621=>12646, -24622=>12647, -24624=>12648, -24625=>12649, -24626=>12650, -24627=>12651, -24628=>12652, -24630=>12653, -24631=>12654, -24632=>12655, -24633=>12656, -24634=>12657, -24637=>12658, -24638=>12659, -24640=>12660, -24644=>12661, -24645=>12662, -24646=>12663, -24647=>12664, -24648=>12665, -24649=>12666, -24650=>12667, -24652=>12668, -24654=>12669, -24655=>12670, -24657=>12671, -24659=>12672, -24660=>12673, -24662=>12674, -24663=>12675, -24664=>12676, -24667=>12677, -24668=>12678, -24670=>12679, -24671=>12680, -24672=>12681, -24673=>12682, -24677=>12683, -24678=>12684, -24686=>12685, -24689=>12686, -24690=>12687, -24692=>12688, -24693=>12689, -24695=>12690, -24702=>12691, -24704=>12692, -24705=>12693, -24706=>12694, -24709=>12695, -24710=>12696, -24711=>12697, -24712=>12698, -24714=>12699, -24715=>12700, -24718=>12701, -24719=>12702, -24720=>12703, -24721=>12704, -24723=>12705, -24725=>12706, -24727=>12707, -24728=>12708, -24729=>12709, -24732=>12710, -24734=>12711, -24737=>12712, -24738=>12713, -24740=>12714, -24741=>12715, -24743=>12716, -24745=>12717, -24746=>12718, -24750=>12719, -24752=>12720, -24755=>12721, -24759=>12722, -24761=>12723, -24762=>12724, -24765=>12725, -24766=>12726, -24767=>12727, -24768=>12728, -24769=>12729, -24770=>12730, -24771=>12731, -24772=>12732, -24775=>12733, -24776=>12734, -24777=>12735, -24780=>12736, -24781=>12737, -24782=>12738, -24783=>12739, -24784=>12740, -24786=>12741, -24787=>12742, -24788=>12743, -24790=>12744, -24791=>12745, -24793=>12746, -24795=>12747, -24798=>12748, -24802=>12749, -24803=>12750, -24804=>12751, -24805=>12752, -24810=>12753, -24821=>12754, -24823=>12755, -24824=>12756, -24828=>12757, -24829=>12758, -24830=>12759, -24831=>12760, -24834=>12761, -24835=>12762, -24836=>12763, -24837=>12764, -24839=>12765, -24842=>12766, -24843=>12767, -24844=>12768, -24848=>12769, -24849=>12770, -24850=>12771, -24851=>12772, -24852=>12773, -24854=>12774, -24855=>12775, -24856=>12776, -24857=>12777, -24861=>12778, -24862=>12779, -24865=>12780, -24866=>12781, -24869=>12782, -24872=>12783, -24873=>12784, -24874=>12785, -24876=>12786, -24877=>12787, -24878=>12788, -24879=>12789, -24880=>12790, -24881=>12791, -24882=>12792, -24883=>12793, -24885=>12794, -24886=>12795, -24888=>12796, -24889=>12797, -24890=>12798, -24891=>12799, -24892=>12800, -24893=>12801, -24896=>12802, -24897=>12803, -24898=>12804, -24899=>12805, -24900=>12806, -24901=>12807, -24902=>12808, -24903=>12809, -24905=>12810, -24909=>12811, -24911=>12812, -24912=>12813, -24914=>12814, -24915=>12815, -24916=>12816, -24918=>12817, -24919=>12818, -24921=>12819, -24923=>12820, -24924=>12821, -24926=>12822, -24928=>12823, -24929=>12824, -24933=>12825, -24934=>12826, -24937=>12827, -24940=>12828, -24941=>12829, -24943=>12830, -24945=>12831, -24946=>12832, -24948=>12833, -24952=>12834, -24953=>12835, -24954=>12836, -24955=>12837, -24956=>12838, -24957=>12839, -24958=>12840, -24959=>12841, -24960=>12842, -24961=>12843, -24963=>12844, -24964=>12845, -24965=>12846, -24966=>12847, -24967=>12848, -24968=>12849, -24969=>12850, -24972=>12851, -24973=>12852, -24975=>12853, -24979=>12854, -24981=>12855, -24982=>12856, -24983=>12857, -24984=>12858, -24985=>12859, -24987=>12860, -24988=>12861, -24990=>12862, -24991=>12863, -24992=>12864, -24993=>12865, -24994=>12866, -24995=>12867, -24997=>12868, -24998=>12869, -25002=>12870, -25005=>12871, -25007=>12872, -25008=>12873, -25009=>12874, -25011=>12875, -25012=>12876, -25013=>12877, -25016=>12878, -25017=>12879, -25018=>12880, -25019=>12881, -25020=>12882, -25021=>12883, -25023=>12884, -25024=>12885, -25025=>12886, -25027=>12887, -25028=>12888, -25029=>12889, -25030=>12890, -25037=>12891, -25038=>12892, -25039=>12893, -25040=>12894, -25043=>12895, -25045=>12896, -25046=>12897, -25047=>12898, -25048=>12899, -25049=>12900, -25050=>12901, -25051=>12902, -25052=>12903, -25053=>12904, -25056=>12905, -25057=>12906, -25058=>12907, -25060=>12908, -25061=>12909, -25063=>12910, -25065=>12911, -25066=>12912, -25067=>12913, -25068=>12914, -25069=>12915, -25070=>12916, -25071=>12917, -25072=>12918, -25073=>12919, -25075=>12920, -25076=>12921, -25081=>12922, -25083=>12923, -25085=>12924, -25089=>12925, -25090=>12926, -25091=>12927, -25092=>12928, -25093=>12929, -25097=>12930, -25107=>12931, -25113=>12932, -25116=>12933, -25117=>12934, -25118=>12935, -25120=>12936, -25123=>12937, -25126=>12938, -25128=>12939, -25129=>12940, -25131=>12941, -25133=>12942, -25135=>12943, -25137=>12944, -25141=>12945, -12094=>12946, -25142=>12946, -25144=>12947, -25145=>12948, -25146=>12949, -25147=>12950, -25148=>12951, -25154=>12952, -25156=>12953, -25157=>12954, -25158=>12955, -25162=>12956, -25167=>12957, -25168=>12958, -25173=>12959, -25174=>12960, -25175=>12961, -25177=>12962, -25178=>12963, -25180=>12964, -25181=>12965, -25182=>12966, -25183=>12967, -25184=>12968, -25185=>12969, -25186=>12970, -25188=>12971, -25189=>12972, -25192=>12973, -25201=>12974, -25202=>12975, -25204=>12976, -25205=>12977, -25207=>12978, -25208=>12979, -25210=>12980, -25211=>12981, -25213=>12982, -25217=>12983, -25218=>12984, -25219=>12985, -25221=>12986, -25222=>12987, -25223=>12988, -25224=>12989, -25227=>12990, -25228=>12991, -25229=>12992, -25230=>12993, -25231=>12994, -25232=>12995, -25236=>12996, -25241=>12997, -25244=>12998, -25245=>12999, -25246=>13000, -25251=>13001, -25254=>13002, -25255=>13003, -25257=>13004, -25258=>13005, -25261=>13006, -25262=>13007, -25263=>13008, -25264=>13009, -25266=>13010, -25267=>13011, -25268=>13012, -25270=>13013, -25271=>13014, -25272=>13015, -25274=>13016, -25278=>13017, -25280=>13018, -25281=>13019, -25283=>13020, -25291=>13021, -25295=>13022, -25297=>13023, -25301=>13024, -25309=>13025, -25310=>13026, -25312=>13027, -25313=>13028, -25316=>13029, -25322=>13030, -25323=>13031, -25328=>13032, -25330=>13033, -25333=>13034, -25336=>13035, -25337=>13036, -25338=>13037, -25339=>13038, -25344=>13039, -25347=>13040, -25348=>13041, -25349=>13042, -25350=>13043, -25354=>13044, -25355=>13045, -25356=>13046, -25357=>13047, -25359=>13048, -25360=>13049, -25362=>13050, -25363=>13051, -25364=>13052, -25365=>13053, -25367=>13054, -25368=>13055, -25369=>13056, -25372=>13057, -25382=>13058, -25383=>13059, -25385=>13060, -25388=>13061, -25389=>13062, -25390=>13063, -25392=>13064, -25393=>13065, -25395=>13066, -25396=>13067, -25397=>13068, -25398=>13069, -25399=>13070, -25400=>13071, -25403=>13072, -25404=>13073, -25407=>13074, -25408=>13075, -25409=>13076, -25412=>13077, -25415=>13078, -25416=>13079, -25418=>13080, -25425=>13081, -25426=>13082, -25427=>13083, -25428=>13084, -25430=>13085, -25431=>13086, -25432=>13087, -25433=>13088, -25434=>13089, -25435=>13090, -25436=>13091, -25437=>13092, -25440=>13093, -25444=>13094, -25445=>13095, -25446=>13096, -25450=>13097, -25452=>13098, -25455=>13099, -25456=>13100, -25459=>13101, -25460=>13102, -25461=>13103, -25464=>13104, -25465=>13105, -25468=>13106, -25469=>13107, -25470=>13108, -25471=>13109, -25473=>13110, -25477=>13111, -25478=>13112, -25483=>13113, -25485=>13114, -25489=>13115, -25491=>13116, -25492=>13117, -25493=>13118, -25495=>13119, -25497=>13120, -25498=>13121, -25499=>13122, -25500=>13123, -25501=>13124, -25502=>13125, -25503=>13126, -25505=>13127, -25508=>13128, -25510=>13129, -25515=>13130, -25519=>13131, -25521=>13132, -25522=>13133, -25525=>13134, -25526=>13135, -25529=>13136, -25531=>13137, -25533=>13138, -25535=>13139, -25537=>13140, -25538=>13141, -25539=>13142, -25541=>13143, -25543=>13144, -25544=>13145, -25546=>13146, -25547=>13147, -25548=>13148, -25553=>13149, -25555=>13150, -25556=>13151, -25557=>13152, -25559=>13153, -25560=>13154, -25561=>13155, -25563=>13156, -25564=>13157, -25565=>13158, -25567=>13159, -25570=>13160, -25572=>13161, -25573=>13162, -25574=>13163, -25575=>13164, -25576=>13165, -25579=>13166, -25580=>13167, -25583=>13168, -25584=>13169, -25585=>13170, -25587=>13171, -25589=>13172, -25591=>13173, -25593=>13174, -25594=>13175, -25595=>13176, -25596=>13177, -25598=>13178, -25603=>13179, -25604=>13180, -25606=>13181, -25607=>13182, -25608=>13183, -25609=>13184, -25610=>13185, -25614=>13186, -25617=>13187, -25618=>13188, -25621=>13189, -25622=>13190, -25624=>13191, -25625=>13192, -25626=>13193, -25629=>13194, -25631=>13195, -25634=>13196, -25635=>13197, -25636=>13198, -25637=>13199, -25639=>13200, -25640=>13201, -25641=>13202, -25643=>13203, -25646=>13204, -25647=>13205, -25648=>13206, -25649=>13207, -25650=>13208, -25651=>13209, -25653=>13210, -25655=>13211, -25656=>13212, -25657=>13213, -25659=>13214, -25660=>13215, -25662=>13216, -25664=>13217, -25666=>13218, -25667=>13219, -25673=>13220, -25675=>13221, -25676=>13222, -25677=>13223, -25678=>13224, -25679=>13225, -25680=>13226, -25683=>13227, -25685=>13228, -25686=>13229, -25687=>13230, -25689=>13231, -25690=>13232, -25691=>13233, -25693=>13234, -25696=>13235, -25697=>13236, -25698=>13237, -25699=>13238, -25700=>13239, -25701=>13240, -25702=>13241, -25704=>13242, -25706=>13243, -25707=>13244, -25708=>13245, -25710=>13246, -25712=>13247, -25713=>13248, -25714=>13249, -25716=>13250, -25717=>13251, -25719=>13252, -25724=>13253, -25725=>13254, -25726=>13255, -25727=>13256, -25728=>13257, -25729=>13258, -25731=>13259, -25734=>13260, -25737=>13261, -25738=>13262, -25739=>13263, -25740=>13264, -25741=>13265, -25742=>13266, -25743=>13267, -25744=>13268, -25748=>13269, -25751=>13270, -25752=>13271, -25754=>13272, -25755=>13273, -25756=>13274, -25757=>13275, -25760=>13276, -25761=>13277, -25762=>13278, -25766=>13279, -25767=>13280, -25768=>13281, -25770=>13282, -25775=>13283, -25777=>13284, -25780=>13285, -25782=>13286, -25785=>13287, -25789=>13288, -25795=>13289, -25798=>13290, -25800=>13291, -25801=>13292, -25804=>13293, -25807=>13294, -25809=>13295, -25811=>13296, -25813=>13297, -25814=>13298, -25817=>13299, -25819=>13300, -25820=>13301, -25821=>13302, -25823=>13303, -25825=>13304, -25827=>13305, -25829=>13306, -25831=>13307, -25832=>13308, -25833=>13309, -25834=>13310, -25835=>13311, -25837=>13312, -25838=>13313, -25843=>13314, -25845=>13315, -25846=>13316, -25848=>13317, -25849=>13318, -25853=>13319, -25855=>13320, -25857=>13321, -25858=>13322, -25859=>13323, -25861=>13324, -25863=>13325, -25864=>13326, -25866=>13327, -25867=>13328, -25868=>13329, -25869=>13330, -25870=>13331, -25872=>13332, -25873=>13333, -25875=>13334, -25877=>13335, -25879=>13336, -25882=>13337, -25884=>13338, -25886=>13339, -25887=>13340, -25888=>13341, -25889=>13342, -25894=>13343, -25895=>13344, -25896=>13345, -25897=>13346, -25901=>13347, -25904=>13348, -25905=>13349, -25906=>13350, -25907=>13351, -25911=>13352, -25914=>13353, -25916=>13354, -25917=>13355, -25920=>13356, -25921=>13357, -25922=>13358, -25923=>13359, -25924=>13360, -25926=>13361, -25927=>13362, -25930=>13363, -25931=>13364, -25933=>13365, -25934=>13366, -25936=>13367, -25938=>13368, -25939=>13369, -25940=>13370, -25944=>13371, -25946=>13372, -25948=>13373, -25951=>13374, -25952=>13375, -25953=>13376, -25956=>13377, -25957=>13378, -25959=>13379, -25960=>13380, -25961=>13381, -25962=>13382, -25965=>13383, -25966=>13384, -25967=>13385, -25969=>13386, -25971=>13387, -25974=>13388, -25977=>13389, -25978=>13390, -25979=>13391, -25980=>13392, -25981=>13393, -25982=>13394, -25983=>13395, -25984=>13396, -25985=>13397, -25988=>13398, -25989=>13399, -25990=>13400, -25992=>13401, -25993=>13402, -25994=>13403, -25997=>13404, -25998=>13405, -25999=>13406, -26002=>13407, -26004=>13408, -26006=>13409, -26008=>13410, -26010=>13411, -26013=>13412, -26014=>13413, -26016=>13414, -26018=>13415, -26019=>13416, -26022=>13417, -26024=>13418, -26026=>13419, -26030=>13420, -26033=>13421, -26034=>13422, -26035=>13423, -26036=>13424, -26037=>13425, -26038=>13426, -26040=>13427, -26042=>13428, -26043=>13429, -26046=>13430, -26047=>13431, -26048=>13432, -26050=>13433, -26055=>13434, -26056=>13435, -26057=>13436, -26058=>13437, -26061=>13438, -26064=>13439, -26065=>13440, -26067=>13441, -26068=>13442, -26069=>13443, -26072=>13444, -26073=>13445, -26074=>13446, -26075=>13447, -26076=>13448, -26077=>13449, -26078=>13450, -26079=>13451, -26081=>13452, -26083=>13453, -26084=>13454, -26090=>13455, -26091=>13456, -26098=>13457, -26099=>13458, -26100=>13459, -26101=>13460, -26104=>13461, -26105=>13462, -26107=>13463, -26108=>13464, -26109=>13465, -26110=>13466, -26111=>13467, -26113=>13468, -26116=>13469, -26117=>13470, -26119=>13471, -26120=>13472, -26121=>13473, -26123=>13474, -26125=>13475, -26128=>13476, -26129=>13477, -26130=>13478, -26134=>13479, -26135=>13480, -26136=>13481, -26138=>13482, -26139=>13483, -26140=>13484, -26142=>13485, -26145=>13486, -26146=>13487, -26147=>13488, -26148=>13489, -26150=>13490, -26153=>13491, -26154=>13492, -26155=>13493, -26156=>13494, -26158=>13495, -26160=>13496, -26162=>13497, -26163=>13498, -26167=>13499, -26168=>13500, -26169=>13501, -26170=>13502, -26171=>13503, -26173=>13504, -26175=>13505, -26176=>13506, -26180=>13507, -26181=>13508, -26182=>13509, -26183=>13510, -26184=>13511, -26185=>13512, -26186=>13513, -26189=>13514, -26190=>13515, -26192=>13516, -26193=>13517, -26200=>13518, -26201=>13519, -26203=>13520, -26204=>13521, -26206=>13522, -26208=>13523, -26210=>13524, -26211=>13525, -26213=>13526, -26215=>13527, -26217=>13528, -26218=>13529, -26219=>13530, -26220=>13531, -26221=>13532, -26225=>13533, -26226=>13534, -26227=>13535, -26229=>13536, -26232=>13537, -26233=>13538, -26235=>13539, -26236=>13540, -26237=>13541, -26239=>13542, -26240=>13543, -26241=>13544, -26243=>13545, -26245=>13546, -26246=>13547, -26250=>13548, -26251=>13549, -26253=>13550, -26254=>13551, -26255=>13552, -26256=>13553, -26258=>13554, -26259=>13555, -26260=>13556, -26261=>13557, -26264=>13558, -26265=>13559, -26266=>13560, -26267=>13561, -26268=>13562, -26270=>13563, -26271=>13564, -26272=>13565, -26273=>13566, -26275=>13567, -26276=>13568, -26277=>13569, -26278=>13570, -26281=>13571, -26282=>13572, -26284=>13573, -26285=>13574, -26287=>13575, -26288=>13576, -26289=>13577, -26290=>13578, -26291=>13579, -26293=>13580, -26294=>13581, -26295=>13582, -26296=>13583, -26298=>13584, -26299=>13585, -26300=>13586, -26301=>13587, -26303=>13588, -26304=>13589, -26305=>13590, -26306=>13591, -26307=>13592, -26309=>13593, -26312=>13594, -26314=>13595, -26315=>13596, -26316=>13597, -26317=>13598, -26318=>13599, -26319=>13600, -26320=>13601, -26321=>13602, -26322=>13603, -26323=>13604, -26324=>13605, -26325=>13606, -26327=>13607, -26328=>13608, -26330=>13609, -26334=>13610, -26335=>13611, -26337=>13612, -26338=>13613, -26339=>13614, -26340=>13615, -26341=>13616, -26343=>13617, -26344=>13618, -26346=>13619, -26347=>13620, -26349=>13621, -26350=>13622, -26351=>13623, -26353=>13624, -26357=>13625, -26358=>13626, -26362=>13627, -26363=>13628, -26365=>13629, -26369=>13630, -26370=>13631, -26372=>13632, -26373=>13633, -26374=>13634, -26375=>13635, -26380=>13636, -26382=>13637, -26383=>13638, -26385=>13639, -26386=>13640, -26387=>13641, -26390=>13642, -26392=>13643, -26393=>13644, -26394=>13645, -26396=>13646, -26398=>13647, -26400=>13648, -26401=>13649, -26402=>13650, -26403=>13651, -26404=>13652, -26405=>13653, -26409=>13654, -26414=>13655, -26416=>13656, -26418=>13657, -26419=>13658, -26422=>13659, -26423=>13660, -26424=>13661, -26425=>13662, -26427=>13663, -26428=>13664, -26430=>13665, -26431=>13666, -26433=>13667, -26436=>13668, -26437=>13669, -26439=>13670, -26442=>13671, -26443=>13672, -26445=>13673, -26450=>13674, -26452=>13675, -26453=>13676, -26455=>13677, -26456=>13678, -26457=>13679, -26458=>13680, -26459=>13681, -26461=>13682, -26466=>13683, -26467=>13684, -26468=>13685, -26470=>13686, -26471=>13687, -26475=>13688, -26476=>13689, -26478=>13690, -26484=>13691, -26486=>13692, -26488=>13693, -26489=>13694, -26490=>13695, -26491=>13696, -26493=>13697, -26496=>13698, -26498=>13699, -26499=>13700, -26501=>13701, -26502=>13702, -26504=>13703, -26506=>13704, -26508=>13705, -26509=>13706, -26510=>13707, -26511=>13708, -26513=>13709, -26514=>13710, -26515=>13711, -26516=>13712, -26518=>13713, -26521=>13714, -26523=>13715, -26527=>13716, -26528=>13717, -26529=>13718, -26532=>13719, -26534=>13720, -26537=>13721, -26540=>13722, -26542=>13723, -26545=>13724, -26546=>13725, -26548=>13726, -26553=>13727, -26554=>13728, -26555=>13729, -26556=>13730, -26557=>13731, -26558=>13732, -26559=>13733, -26560=>13734, -26562=>13735, -26565=>13736, -26566=>13737, -26567=>13738, -26568=>13739, -26569=>13740, -26570=>13741, -26571=>13742, -26572=>13743, -26573=>13744, -26574=>13745, -26581=>13746, -26582=>13747, -26583=>13748, -26587=>13749, -26591=>13750, -26593=>13751, -26595=>13752, -26596=>13753, -26598=>13754, -26599=>13755, -26600=>13756, -26602=>13757, -26603=>13758, -26605=>13759, -26606=>13760, -26610=>13761, -26613=>13762, -26614=>13763, -26615=>13764, -26616=>13765, -26617=>13766, -26618=>13767, -26619=>13768, -26620=>13769, -26622=>13770, -26625=>13771, -26626=>13772, -26627=>13773, -26628=>13774, -26630=>13775, -26637=>13776, -26640=>13777, -26642=>13778, -26644=>13779, -26645=>13780, -26648=>13781, -26649=>13782, -26650=>13783, -26651=>13784, -26652=>13785, -26654=>13786, -26655=>13787, -26656=>13788, -26658=>13789, -26659=>13790, -26660=>13791, -26661=>13792, -26662=>13793, -26663=>13794, -26664=>13795, -26667=>13796, -26668=>13797, -26669=>13798, -26670=>13799, -26671=>13800, -26672=>13801, -26673=>13802, -26676=>13803, -26677=>13804, -26678=>13805, -26682=>13806, -26683=>13807, -26687=>13808, -26695=>13809, -26699=>13810, -26701=>13811, -26703=>13812, -26706=>13813, -26710=>13814, -26711=>13815, -26712=>13816, -26713=>13817, -26714=>13818, -26715=>13819, -26716=>13820, -26717=>13821, -26718=>13822, -26719=>13823, -26730=>13824, -26732=>13825, -26733=>13826, -26734=>13827, -26735=>13828, -26736=>13829, -26737=>13830, -26738=>13831, -26739=>13832, -26741=>13833, -26744=>13834, -26745=>13835, -26746=>13836, -26747=>13837, -26748=>13838, -26749=>13839, -26750=>13840, -26751=>13841, -26752=>13842, -26754=>13843, -26756=>13844, -26759=>13845, -26760=>13846, -26761=>13847, -26762=>13848, -26763=>13849, -26764=>13850, -26765=>13851, -26766=>13852, -26768=>13853, -26769=>13854, -26770=>13855, -26772=>13856, -26773=>13857, -26774=>13858, -26777=>13859, -26778=>13860, -26779=>13861, -26780=>13862, -26782=>13863, -26784=>13864, -26785=>13865, -26787=>13866, -26788=>13867, -26789=>13868, -26793=>13869, -26794=>13870, -26795=>13871, -26796=>13872, -26798=>13873, -26801=>13874, -26802=>13875, -26804=>13876, -26806=>13877, -26807=>13878, -26808=>13879, -26809=>13880, -26810=>13881, -26811=>13882, -26812=>13883, -26813=>13884, -26814=>13885, -26815=>13886, -26817=>13887, -26819=>13888, -26820=>13889, -26821=>13890, -26822=>13891, -26823=>13892, -26824=>13893, -26826=>13894, -26828=>13895, -26830=>13896, -26831=>13897, -26832=>13898, -26833=>13899, -26835=>13900, -26836=>13901, -26841=>13902, -26843=>13903, -26844=>13904, -26845=>13905, -26846=>13906, -26849=>13907, -26850=>13908, -26852=>13909, -26853=>13910, -26854=>13911, -26856=>13912, -26857=>13913, -26858=>13914, -26859=>13915, -26860=>13916, -26861=>13917, -26863=>13918, -26866=>13919, -26867=>13920, -26868=>13921, -26870=>13922, -26871=>13923, -26872=>13924, -26875=>13925, -26877=>13926, -26878=>13927, -26879=>13928, -26880=>13929, -26882=>13930, -26883=>13931, -26884=>13932, -26886=>13933, -26887=>13934, -26888=>13935, -26889=>13936, -26890=>13937, -26892=>13938, -26897=>13939, -26899=>13940, -26900=>13941, -26901=>13942, -26902=>13943, -26903=>13944, -26904=>13945, -26905=>13946, -26906=>13947, -26907=>13948, -26908=>13949, -26909=>13950, -26910=>13951, -26913=>13952, -26914=>13953, -26915=>13954, -26917=>13955, -26918=>13956, -26919=>13957, -26920=>13958, -26921=>13959, -26922=>13960, -26923=>13961, -26924=>13962, -26926=>13963, -26927=>13964, -26929=>13965, -26930=>13966, -26931=>13967, -26933=>13968, -26934=>13969, -26935=>13970, -26936=>13971, -26938=>13972, -26939=>13973, -26940=>13974, -26942=>13975, -26944=>13976, -26945=>13977, -26947=>13978, -26948=>13979, -26949=>13980, -26950=>13981, -26951=>13982, -26952=>13983, -26953=>13984, -26955=>13985, -26956=>13986, -26957=>13987, -26958=>13988, -26959=>13989, -26960=>13990, -26961=>13991, -26962=>13992, -26965=>13993, -26966=>13994, -26968=>13995, -26969=>13996, -26971=>13997, -26972=>13998, -26975=>13999, -26977=>14000, -26978=>14001, -26980=>14002, -26981=>14003, -26983=>14004, -26985=>14005, -26986=>14006, -26988=>14007, -26991=>14008, -26992=>14009, -26994=>14010, -26995=>14011, -26996=>14012, -26998=>14013, -27002=>14014, -27003=>14015, -27005=>14016, -27006=>14017, -27007=>14018, -27009=>14019, -27011=>14020, -27013=>14021, -27018=>14022, -27019=>14023, -27020=>14024, -27022=>14025, -27023=>14026, -27024=>14027, -27025=>14028, -27026=>14029, -27027=>14030, -27030=>14031, -27031=>14032, -27033=>14033, -27034=>14034, -27037=>14035, -27038=>14036, -27039=>14037, -27040=>14038, -27041=>14039, -27042=>14040, -27043=>14041, -27044=>14042, -27045=>14043, -27046=>14044, -27049=>14045, -27052=>14046, -27055=>14047, -27056=>14048, -27058=>14049, -27059=>14050, -27061=>14051, -27062=>14052, -27064=>14053, -27065=>14054, -27066=>14055, -27068=>14056, -27069=>14057, -27070=>14058, -27072=>14059, -27074=>14060, -27075=>14061, -27076=>14062, -27077=>14063, -27078=>14064, -27079=>14065, -27080=>14066, -27081=>14067, -27087=>14068, -27089=>14069, -27090=>14070, -27091=>14071, -27093=>14072, -27094=>14073, -27095=>14074, -27096=>14075, -27097=>14076, -27098=>14077, -27100=>14078, -27101=>14079, -27102=>14080, -27105=>14081, -27106=>14082, -27107=>14083, -27108=>14084, -27109=>14085, -27110=>14086, -27112=>14087, -27113=>14088, -27114=>14089, -27115=>14090, -27116=>14091, -27118=>14092, -27119=>14093, -27120=>14094, -27121=>14095, -27124=>14096, -27125=>14097, -27126=>14098, -27127=>14099, -27128=>14100, -27129=>14101, -27130=>14102, -27131=>14103, -27132=>14104, -27134=>14105, -27136=>14106, -27139=>14107, -27140=>14108, -27142=>14109, -27143=>14110, -27144=>14111, -27145=>14112, -27147=>14113, -27148=>14114, -27149=>14115, -27150=>14116, -27151=>14117, -27152=>14118, -27153=>14119, -27154=>14120, -27156=>14121, -27157=>14122, -27158=>14123, -27162=>14124, -27163=>14125, -27164=>14126, -27165=>14127, -27168=>14128, -27170=>14129, -27172=>14130, -27173=>14131, -27174=>14132, -27175=>14133, -27177=>14134, -27179=>14135, -27180=>14136, -27181=>14137, -27182=>14138, -27184=>14139, -27186=>14140, -27187=>14141, -27188=>14142, -27190=>14143, -27191=>14144, -27195=>14145, -27196=>14146, -27199=>14147, -27200=>14148, -27201=>14149, -27202=>14150, -27203=>14151, -27205=>14152, -27206=>14153, -27209=>14154, -27210=>14155, -27212=>14156, -27213=>14157, -27214=>14158, -27215=>14159, -27217=>14160, -27218=>14161, -27219=>14162, -27220=>14163, -27221=>14164, -27222=>14165, -27223=>14166, -27226=>14167, -27228=>14168, -27229=>14169, -27230=>14170, -27232=>14171, -27235=>14172, -27236=>14173, -27238=>14174, -27239=>14175, -27240=>14176, -27241=>14177, -27242=>14178, -27243=>14179, -27244=>14180, -27245=>14181, -27246=>14182, -27247=>14183, -27248=>14184, -27250=>14185, -27251=>14186, -27252=>14187, -27253=>14188, -27254=>14189, -27255=>14190, -27256=>14191, -27258=>14192, -27259=>14193, -27261=>14194, -27262=>14195, -27263=>14196, -27265=>14197, -27266=>14198, -27267=>14199, -27269=>14200, -27270=>14201, -27271=>14202, -27272=>14203, -27274=>14204, -27275=>14205, -27276=>14206, -27277=>14207, -27279=>14208, -27282=>14209, -27283=>14210, -27285=>14211, -27286=>14212, -27288=>14213, -27289=>14214, -27290=>14215, -27291=>14216, -27293=>14217, -27294=>14218, -27295=>14219, -27297=>14220, -27300=>14221, -27301=>14222, -27302=>14223, -27303=>14224, -27304=>14225, -27306=>14226, -27309=>14227, -27310=>14228, -27312=>14229, -27313=>14230, -27314=>14231, -27316=>14232, -27317=>14233, -27318=>14234, -27319=>14235, -27321=>14236, -27322=>14237, -27324=>14238, -27325=>14239, -27326=>14240, -27327=>14241, -27328=>14242, -27329=>14243, -27330=>14244, -27332=>14245, -27333=>14246, -27334=>14247, -27335=>14248, -27336=>14249, -27337=>14250, -27338=>14251, -27339=>14252, -27340=>14253, -27341=>14254, -27342=>14255, -27343=>14256, -27344=>14257, -27345=>14258, -27346=>14259, -27348=>14260, -27349=>14261, -27350=>14262, -27351=>14263, -27352=>14264, -27353=>14265, -27356=>14266, -27360=>14267, -27361=>14268, -27362=>14269, -27363=>14270, -27364=>14271, -27365=>14272, -27366=>14273, -27369=>14274, -27371=>14275, -27373=>14276, -27374=>14277, -27375=>14278, -27376=>14279, -27377=>14280, -27378=>14281, -27380=>14282, -27381=>14283, -27382=>14284, -27383=>14285, -27385=>14286, -27386=>14287, -27388=>14288, -27389=>14289, -27390=>14290, -27391=>14291, -27392=>14292, -27393=>14293, -27394=>14294, -27395=>14295, -27397=>14296, -27398=>14297, -27399=>14298, -27400=>14299, -27401=>14300, -27403=>14301, -27404=>14302, -27405=>14303, -27406=>14304, -27408=>14305, -27409=>14306, -27411=>14307, -27412=>14308, -27413=>14309, -27415=>14310, -27416=>14311, -27417=>14312, -27418=>14313, -27419=>14314, -27420=>14315, -27421=>14316, -27423=>14317, -27429=>14318, -27430=>14319, -27432=>14320, -27433=>14321, -27434=>14322, -27435=>14323, -27436=>14324, -27437=>14325, -27438=>14326, -27439=>14327, -27440=>14328, -27441=>14329, -27443=>14330, -27444=>14331, -27445=>14332, -27446=>14333, -27448=>14334, -27451=>14335, -27452=>14336, -27455=>14337, -27456=>14338, -27457=>14339, -27458=>14340, -27460=>14341, -27461=>14342, -27464=>14343, -27466=>14344, -27467=>14345, -27469=>14346, -27470=>14347, -27471=>14348, -27473=>14349, -27474=>14350, -27475=>14351, -27476=>14352, -27477=>14353, -27478=>14354, -27479=>14355, -27480=>14356, -27482=>14357, -27483=>14358, -27484=>14359, -27485=>14360, -27486=>14361, -27488=>14362, -27496=>14363, -27497=>14364, -27499=>14365, -27500=>14366, -27501=>14367, -27502=>14368, -27503=>14369, -27504=>14370, -27505=>14371, -27507=>14372, -27508=>14373, -27509=>14374, -27510=>14375, -27514=>14376, -27517=>14377, -27518=>14378, -27519=>14379, -27520=>14380, -27525=>14381, -27528=>14382, -27532=>14383, -27534=>14384, -27535=>14385, -27536=>14386, -27537=>14387, -27540=>14388, -27541=>14389, -27543=>14390, -27545=>14391, -27548=>14392, -27549=>14393, -27551=>14394, -27552=>14395, -27554=>14396, -27555=>14397, -27557=>14398, -27558=>14399, -27559=>14400, -27560=>14401, -27561=>14402, -27564=>14403, -27565=>14404, -27568=>14405, -27569=>14406, -27574=>14407, -27576=>14408, -27577=>14409, -27580=>14410, -27581=>14411, -27582=>14412, -27584=>14413, -27587=>14414, -27588=>14415, -27591=>14416, -27592=>14417, -27593=>14418, -27594=>14419, -27596=>14420, -27598=>14421, -27600=>14422, -27601=>14423, -27608=>14424, -27610=>14425, -27612=>14426, -27613=>14427, -27614=>14428, -27615=>14429, -27616=>14430, -27618=>14431, -27619=>14432, -27620=>14433, -27621=>14434, -27622=>14435, -27623=>14436, -27624=>14437, -27625=>14438, -27628=>14439, -27629=>14440, -27630=>14441, -27632=>14442, -27633=>14443, -27634=>14444, -27636=>14445, -27638=>14446, -27639=>14447, -27640=>14448, -27642=>14449, -27643=>14450, -27644=>14451, -27646=>14452, -27648=>14453, -27649=>14454, -27650=>14455, -27651=>14456, -27652=>14457, -27657=>14458, -27658=>14459, -27659=>14460, -27662=>14461, -27666=>14462, -27671=>14463, -27676=>14464, -27677=>14465, -27678=>14466, -27680=>14467, -27685=>14468, -27693=>14469, -27697=>14470, -27699=>14471, -27702=>14472, -27703=>14473, -27705=>14474, -27706=>14475, -27707=>14476, -27708=>14477, -27710=>14478, -27711=>14479, -27715=>14480, -27716=>14481, -27717=>14482, -27720=>14483, -27723=>14484, -27724=>14485, -27725=>14486, -27726=>14487, -27727=>14488, -27729=>14489, -27730=>14490, -27731=>14491, -27734=>14492, -27736=>14493, -27737=>14494, -27738=>14495, -27746=>14496, -27747=>14497, -27749=>14498, -27750=>14499, -27751=>14500, -27755=>14501, -27756=>14502, -27757=>14503, -27758=>14504, -27759=>14505, -27761=>14506, -27763=>14507, -27765=>14508, -27767=>14509, -27768=>14510, -27770=>14511, -27771=>14512, -27772=>14513, -27775=>14514, -27776=>14515, -27780=>14516, -27783=>14517, -27786=>14518, -27787=>14519, -27789=>14520, -27790=>14521, -27793=>14522, -27794=>14523, -27797=>14524, -27798=>14525, -27799=>14526, -27800=>14527, -27802=>14528, -27804=>14529, -27805=>14530, -27806=>14531, -27808=>14532, -27810=>14533, -27816=>14534, -27820=>14535, -27823=>14536, -27824=>14537, -27828=>14538, -27829=>14539, -27830=>14540, -27831=>14541, -27834=>14542, -27840=>14543, -27841=>14544, -27842=>14545, -27843=>14546, -27846=>14547, -27847=>14548, -27848=>14549, -27851=>14550, -27853=>14551, -27854=>14552, -27855=>14553, -27857=>14554, -27858=>14555, -27864=>14556, -27865=>14557, -27866=>14558, -27868=>14559, -27869=>14560, -27871=>14561, -27876=>14562, -27878=>14563, -27879=>14564, -27881=>14565, -27884=>14566, -27885=>14567, -27890=>14568, -27892=>14569, -27897=>14570, -27903=>14571, -27904=>14572, -27906=>14573, -27907=>14574, -27909=>14575, -27910=>14576, -27912=>14577, -27913=>14578, -27914=>14579, -27917=>14580, -27919=>14581, -27920=>14582, -27921=>14583, -27923=>14584, -27924=>14585, -27925=>14586, -27926=>14587, -27928=>14588, -27932=>14589, -27933=>14590, -27935=>14591, -27936=>14592, -27937=>14593, -27938=>14594, -27939=>14595, -27940=>14596, -27942=>14597, -27944=>14598, -27945=>14599, -27948=>14600, -27949=>14601, -27951=>14602, -27952=>14603, -27956=>14604, -27958=>14605, -27959=>14606, -27960=>14607, -27962=>14608, -27967=>14609, -27968=>14610, -27970=>14611, -27972=>14612, -27977=>14613, -27980=>14614, -27984=>14615, -27989=>14616, -27990=>14617, -27991=>14618, -27992=>14619, -27995=>14620, -27997=>14621, -27999=>14622, -28001=>14623, -28002=>14624, -28004=>14625, -28005=>14626, -28007=>14627, -28008=>14628, -28011=>14629, -28012=>14630, -28013=>14631, -28016=>14632, -28017=>14633, -28018=>14634, -28019=>14635, -28021=>14636, -28022=>14637, -28026=>14638, -28027=>14639, -28029=>14640, -28030=>14641, -28031=>14642, -28032=>14643, -28033=>14644, -28035=>14645, -28036=>14646, -28038=>14647, -28042=>14648, -28043=>14649, -28045=>14650, -28047=>14651, -28048=>14652, -28050=>14653, -28054=>14654, -28055=>14655, -28056=>14656, -28057=>14657, -28058=>14658, -28060=>14659, -28066=>14660, -28069=>14661, -28076=>14662, -28077=>14663, -28080=>14664, -28081=>14665, -28083=>14666, -28084=>14667, -28086=>14668, -28087=>14669, -28089=>14670, -28090=>14671, -28091=>14672, -28092=>14673, -28093=>14674, -28094=>14675, -28097=>14676, -28098=>14677, -28099=>14678, -28104=>14679, -28105=>14680, -28106=>14681, -28109=>14682, -28110=>14683, -28111=>14684, -28112=>14685, -28114=>14686, -28115=>14687, -28116=>14688, -28117=>14689, -28119=>14690, -28122=>14691, -28123=>14692, -28124=>14693, -28127=>14694, -28130=>14695, -28131=>14696, -28133=>14697, -28135=>14698, -28136=>14699, -28137=>14700, -28141=>14701, -28143=>14702, -28144=>14703, -28146=>14704, -28148=>14705, -28152=>14706, -28157=>14707, -28158=>14708, -28159=>14709, -28160=>14710, -28161=>14711, -28162=>14712, -28163=>14713, -28164=>14714, -28166=>14715, -28167=>14716, -28168=>14717, -28169=>14718, -28171=>14719, -28175=>14720, -28178=>14721, -28179=>14722, -28181=>14723, -28184=>14724, -28185=>14725, -28187=>14726, -28188=>14727, -28190=>14728, -28191=>14729, -28194=>14730, -28199=>14731, -28200=>14732, -28202=>14733, -28206=>14734, -28208=>14735, -28209=>14736, -28211=>14737, -28213=>14738, -28214=>14739, -28215=>14740, -28217=>14741, -28219=>14742, -28220=>14743, -28221=>14744, -28223=>14745, -28224=>14746, -28225=>14747, -28226=>14748, -28229=>14749, -28230=>14750, -28231=>14751, -28232=>14752, -28233=>14753, -28234=>14754, -28235=>14755, -28236=>14756, -28239=>14757, -28240=>14758, -28241=>14759, -28242=>14760, -28245=>14761, -28247=>14762, -28249=>14763, -28250=>14764, -28252=>14765, -28253=>14766, -28256=>14767, -28257=>14768, -28258=>14769, -28259=>14770, -28260=>14771, -28261=>14772, -28262=>14773, -28263=>14774, -28264=>14775, -28265=>14776, -28266=>14777, -28268=>14778, -28269=>14779, -28272=>14780, -28273=>14781, -28274=>14782, -28275=>14783, -28276=>14784, -28277=>14785, -28278=>14786, -28279=>14787, -28280=>14788, -28281=>14789, -28282=>14790, -28283=>14791, -28284=>14792, -28285=>14793, -28288=>14794, -28289=>14795, -28290=>14796, -28292=>14797, -28295=>14798, -28296=>14799, -28298=>14800, -28299=>14801, -28300=>14802, -28301=>14803, -28302=>14804, -28305=>14805, -28306=>14806, -28307=>14807, -28308=>14808, -28309=>14809, -28311=>14810, -28313=>14811, -28314=>14812, -28315=>14813, -28318=>14814, -28320=>14815, -28321=>14816, -28323=>14817, -28324=>14818, -28326=>14819, -28328=>14820, -28329=>14821, -28331=>14822, -28332=>14823, -28333=>14824, -28334=>14825, -28336=>14826, -28339=>14827, -28341=>14828, -28344=>14829, -28345=>14830, -28348=>14831, -28350=>14832, -28351=>14833, -28352=>14834, -28355=>14835, -28358=>14836, -28360=>14837, -28361=>14838, -28362=>14839, -28365=>14840, -28368=>14841, -28370=>14842, -28374=>14843, -28376=>14844, -28377=>14845, -28379=>14846, -28380=>14847, -28381=>14848, -28387=>14849, -28391=>14850, -28394=>14851, -28395=>14852, -28397=>14853, -28398=>14854, -28400=>14855, -28401=>14856, -28403=>14857, -28405=>14858, -28406=>14859, -28410=>14860, -28411=>14861, -28412=>14862, -28413=>14863, -28414=>14864, -28416=>14865, -28419=>14866, -28420=>14867, -28421=>14868, -28423=>14869, -28424=>14870, -28426=>14871, -28427=>14872, -28428=>14873, -28429=>14874, -28430=>14875, -28432=>14876, -28433=>14877, -28434=>14878, -28438=>14879, -28439=>14880, -28440=>14881, -28441=>14882, -28443=>14883, -28444=>14884, -28445=>14885, -28446=>14886, -28447=>14887, -28449=>14888, -28453=>14889, -28454=>14890, -28455=>14891, -28456=>14892, -28462=>14893, -28464=>14894, -28468=>14895, -28469=>14896, -28471=>14897, -28473=>14898, -28474=>14899, -28475=>14900, -28476=>14901, -28477=>14902, -28480=>14903, -28482=>14904, -28483=>14905, -28484=>14906, -28485=>14907, -28488=>14908, -28489=>14909, -28490=>14910, -28492=>14911, -28494=>14912, -28495=>14913, -28496=>14914, -28498=>14915, -28499=>14916, -28501=>14917, -28502=>14918, -28503=>14919, -28506=>14920, -28507=>14921, -28509=>14922, -28511=>14923, -28512=>14924, -28513=>14925, -28515=>14926, -28517=>14927, -28519=>14928, -28520=>14929, -28521=>14930, -28522=>14931, -28523=>14932, -28524=>14933, -28529=>14934, -28531=>14935, -28533=>14936, -28534=>14937, -28537=>14938, -28539=>14939, -28541=>14940, -28542=>14941, -28545=>14942, -28546=>14943, -28547=>14944, -28549=>14945, -28554=>14946, -28555=>14947, -28559=>14948, -28560=>14949, -28561=>14950, -28562=>14951, -28563=>14952, -28564=>14953, -28565=>14954, -28566=>14955, -28568=>14956, -28569=>14957, -28570=>14958, -28571=>14959, -28573=>14960, -28574=>14961, -28575=>14962, -28578=>14963, -28579=>14964, -28581=>14965, -28582=>14966, -28584=>14967, -28586=>14968, -28587=>14969, -28588=>14970, -28589=>14971, -28591=>14972, -28592=>14973, -28594=>14974, -28596=>14975, -28597=>14976, -28599=>14977, -28600=>14978, -28602=>14979, -28603=>14980, -28604=>14981, -28605=>14982, -28606=>14983, -28607=>14984, -28612=>14985, -28613=>14986, -28614=>14987, -28615=>14988, -28616=>14989, -28618=>14990, -28619=>14991, -28620=>14992, -28621=>14993, -28622=>14994, -28623=>14995, -28624=>14996, -28627=>14997, -28628=>14998, -28630=>14999, -28631=>15000, -28633=>15001, -28634=>15002, -28636=>15003, -28637=>15004, -28642=>15005, -28643=>15006, -28645=>15007, -28646=>15008, -28647=>15009, -28648=>15010, -28649=>15011, -28650=>15012, -28652=>15013, -28653=>15014, -28658=>15015, -28659=>15016, -28660=>15017, -28661=>15018, -28662=>15019, -28663=>15020, -28664=>15021, -28665=>15022, -28667=>15023, -28669=>15024, -28671=>15025, -28672=>15026, -28673=>15027, -28674=>15028, -28675=>15029, -28676=>15030, -28679=>15031, -28680=>15032, -28682=>15033, -28684=>15034, -28685=>15035, -28686=>15036, -28688=>15037, -28690=>15038, -28691=>15039, -28692=>15040, -28694=>15041, -28695=>15042, -28697=>15043, -28700=>15044, -28702=>15045, -28705=>15046, -28706=>15047, -28708=>15048, -28709=>15049, -28710=>15050, -28713=>15051, -28714=>15052, -28715=>15053, -28716=>15054, -28717=>15055, -28718=>15056, -28719=>15057, -28721=>15058, -28723=>15059, -28724=>15060, -28726=>15061, -28727=>15062, -28728=>15063, -28730=>15064, -28731=>15065, -28732=>15066, -28733=>15067, -28735=>15068, -28736=>15069, -28737=>15070, -28738=>15071, -28741=>15072, -28742=>15073, -28743=>15074, -28744=>15075, -28745=>15076, -28746=>15077, -28747=>15078, -28749=>15079, -28750=>15080, -28752=>15081, -28754=>15082, -28755=>15083, -28756=>15084, -28758=>15085, -28759=>15086, -28761=>15087, -28762=>15088, -28763=>15089, -28764=>15090, -28767=>15091, -28768=>15092, -28769=>15093, -28770=>15094, -28773=>15095, -28774=>15096, -28776=>15097, -28777=>15098, -28778=>15099, -28782=>15100, -28785=>15101, -28786=>15102, -28787=>15103, -28788=>15104, -28791=>15105, -28793=>15106, -28794=>15107, -28795=>15108, -28797=>15109, -28801=>15110, -28802=>15111, -28803=>15112, -28804=>15113, -28806=>15114, -28807=>15115, -28808=>15116, -28811=>15117, -28812=>15118, -28813=>15119, -28815=>15120, -28816=>15121, -28817=>15122, -28819=>15123, -28823=>15124, -28824=>15125, -28826=>15126, -28827=>15127, -28830=>15128, -28831=>15129, -28832=>15130, -28833=>15131, -28834=>15132, -28835=>15133, -28836=>15134, -28837=>15135, -28838=>15136, -28839=>15137, -28840=>15138, -28841=>15139, -28842=>15140, -28848=>15141, -28850=>15142, -28852=>15143, -28853=>15144, -28854=>15145, -28858=>15146, -28862=>15147, -28863=>15148, -28868=>15149, -28869=>15150, -28870=>15151, -28871=>15152, -28873=>15153, -28875=>15154, -28876=>15155, -28877=>15156, -28878=>15157, -28880=>15158, -28881=>15159, -28882=>15160, -28883=>15161, -28884=>15162, -28885=>15163, -28886=>15164, -28887=>15165, -28890=>15166, -28892=>15167, -28893=>15168, -28894=>15169, -28896=>15170, -28897=>15171, -28898=>15172, -28899=>15173, -28901=>15174, -28906=>15175, -28910=>15176, -28912=>15177, -28913=>15178, -28914=>15179, -28915=>15180, -28917=>15181, -28918=>15182, -28920=>15183, -28922=>15184, -28923=>15185, -28924=>15186, -28926=>15187, -28927=>15188, -28928=>15189, -28929=>15190, -28930=>15191, -28931=>15192, -28932=>15193, -28933=>15194, -28934=>15195, -28935=>15196, -28936=>15197, -28939=>15198, -28940=>15199, -28941=>15200, -28942=>15201, -28943=>15202, -28945=>15203, -28946=>15204, -28948=>15205, -28951=>15206, -28955=>15207, -28956=>15208, -28957=>15209, -28958=>15210, -28959=>15211, -28960=>15212, -28962=>15213, -28963=>15214, -28964=>15215, -28965=>15216, -28967=>15217, -28968=>15218, -28969=>15219, -28970=>15220, -28971=>15221, -28972=>15222, -28973=>15223, -28974=>15224, -28978=>15225, -28979=>15226, -28980=>15227, -28981=>15228, -28983=>15229, -28984=>15230, -28985=>15231, -28986=>15232, -28987=>15233, -28988=>15234, -28989=>15235, -28990=>15236, -28991=>15237, -28992=>15238, -28993=>15239, -28994=>15240, -28995=>15241, -28996=>15242, -28998=>15243, -28999=>15244, -29000=>15245, -29003=>15246, -29005=>15247, -29007=>15248, -29008=>15249, -29009=>15250, -29011=>15251, -29012=>15252, -29013=>15253, -29014=>15254, -29015=>15255, -29016=>15256, -29017=>15257, -29018=>15258, -29019=>15259, -29021=>15260, -29023=>15261, -29024=>15262, -29025=>15263, -29027=>15264, -29029=>15265, -29034=>15266, -29035=>15267, -29037=>15268, -29039=>15269, -29040=>15270, -29041=>15271, -29044=>15272, -29045=>15273, -29046=>15274, -29047=>15275, -29049=>15276, -29051=>15277, -29052=>15278, -29054=>15279, -29055=>15280, -29056=>15281, -29057=>15282, -29058=>15283, -29059=>15284, -29061=>15285, -29062=>15286, -29063=>15287, -29064=>15288, -29065=>15289, -29067=>15290, -29068=>15291, -29069=>15292, -29070=>15293, -29072=>15294, -29073=>15295, -29075=>15296, -29077=>15297, -29078=>15298, -29082=>15299, -29083=>15300, -29084=>15301, -29085=>15302, -29086=>15303, -29089=>15304, -29090=>15305, -29091=>15306, -29092=>15307, -29093=>15308, -29094=>15309, -29095=>15310, -29097=>15311, -29098=>15312, -29099=>15313, -29101=>15314, -29102=>15315, -29103=>15316, -29104=>15317, -29106=>15318, -29108=>15319, -29110=>15320, -29111=>15321, -29112=>15322, -29114=>15323, -29115=>15324, -29116=>15325, -29117=>15326, -29119=>15327, -29120=>15328, -29122=>15329, -29124=>15330, -29125=>15331, -29126=>15332, -29127=>15333, -29129=>15334, -29130=>15335, -29131=>15336, -29132=>15337, -29133=>15338, -29135=>15339, -29136=>15340, -29137=>15341, -29139=>15342, -29142=>15343, -29143=>15344, -29144=>15345, -29146=>15346, -29147=>15347, -29149=>15348, -29150=>15349, -29153=>15350, -29154=>15351, -29155=>15352, -29156=>15353, -29160=>15354, -29161=>15355, -29162=>15356, -29163=>15357, -29164=>15358, -29167=>15359, -29168=>15360, -29169=>15361, -29170=>15362, -29171=>15363, -29173=>15364, -29174=>15365, -29175=>15366, -29176=>15367, -29178=>15368, -29179=>15369, -29181=>15370, -29183=>15371, -29184=>15372, -29185=>15373, -29186=>15374, -29187=>15375, -29188=>15376, -29189=>15377, -29191=>15378, -29192=>15379, -29193=>15380, -29194=>15381, -29195=>15382, -29196=>15383, -29198=>15384, -29199=>15385, -29201=>15386, -29202=>15387, -29203=>15388, -29204=>15389, -29205=>15390, -29206=>15391, -29207=>15392, -29208=>15393, -29209=>15394, -29210=>15395, -29212=>15396, -29214=>15397, -29215=>15398, -29216=>15399, -29217=>15400, -29218=>15401, -29219=>15402, -29220=>15403, -29221=>15404, -29222=>15405, -29223=>15406, -29225=>15407, -29227=>15408, -29229=>15409, -29230=>15410, -29231=>15411, -29235=>15412, -29236=>15413, -29244=>15414, -29248=>15415, -29249=>15416, -29250=>15417, -29251=>15418, -29252=>15419, -29253=>15420, -29254=>15421, -29257=>15422, -29258=>15423, -29259=>15424, -29262=>15425, -29263=>15426, -29264=>15427, -29265=>15428, -29267=>15429, -29268=>15430, -29269=>15431, -29271=>15432, -29274=>15433, -29276=>15434, -29278=>15435, -29280=>15436, -29283=>15437, -29284=>15438, -29285=>15439, -29288=>15440, -29290=>15441, -29291=>15442, -29292=>15443, -29293=>15444, -29296=>15445, -29297=>15446, -29299=>15447, -29300=>15448, -29302=>15449, -29303=>15450, -29304=>15451, -29307=>15452, -29308=>15453, -29314=>15454, -29315=>15455, -29317=>15456, -29318=>15457, -29319=>15458, -29320=>15459, -29321=>15460, -29324=>15461, -29326=>15462, -29328=>15463, -29329=>15464, -29331=>15465, -29332=>15466, -29333=>15467, -29335=>15468, -29336=>15469, -29337=>15470, -29338=>15471, -29339=>15472, -29340=>15473, -29341=>15474, -29342=>15475, -29344=>15476, -29345=>15477, -29347=>15478, -29348=>15479, -29349=>15480, -29350=>15481, -29352=>15482, -29353=>15483, -29354=>15484, -29355=>15485, -29358=>15486, -29361=>15487, -29362=>15488, -29363=>15489, -29365=>15490, -29370=>15491, -29371=>15492, -29372=>15493, -29373=>15494, -29374=>15495, -29375=>15496, -29381=>15497, -29382=>15498, -29383=>15499, -29385=>15500, -29386=>15501, -29387=>15502, -29388=>15503, -29391=>15504, -29393=>15505, -29395=>15506, -29396=>15507, -29397=>15508, -29398=>15509, -29400=>15510, -29402=>15511, -29403=>15512, -29404=>15513, -29405=>15514, -29407=>15515, -29410=>15516, -29411=>15517, -29412=>15518, -29413=>15519, -29414=>15520, -29415=>15521, -29418=>15522, -29419=>15523, -29429=>15524, -29430=>15525, -29438=>15526, -29439=>15527, -29440=>15528, -29442=>15529, -29444=>15530, -29445=>15531, -29446=>15532, -29447=>15533, -29448=>15534, -29449=>15535, -29451=>15536, -29452=>15537, -29453=>15538, -29455=>15539, -29456=>15540, -29457=>15541, -29458=>15542, -29460=>15543, -29464=>15544, -29465=>15545, -29466=>15546, -29471=>15547, -29472=>15548, -29475=>15549, -29476=>15550, -29478=>15551, -29479=>15552, -29480=>15553, -29485=>15554, -29487=>15555, -29488=>15556, -29490=>15557, -29491=>15558, -29493=>15559, -29498=>15560, -29500=>15561, -29501=>15562, -29504=>15563, -29506=>15564, -29507=>15565, -29510=>15566, -29511=>15567, -29512=>15568, -29513=>15569, -29514=>15570, -29515=>15571, -29516=>15572, -29518=>15573, -29519=>15574, -29521=>15575, -29523=>15576, -29524=>15577, -29525=>15578, -29526=>15579, -29528=>15580, -29529=>15581, -29530=>15582, -29531=>15583, -29532=>15584, -29533=>15585, -29534=>15586, -29535=>15587, -29537=>15588, -29538=>15589, -29539=>15590, -29540=>15591, -29541=>15592, -29542=>15593, -29543=>15594, -29545=>15595, -29550=>15596, -29553=>15597, -29555=>15598, -29556=>15599, -29558=>15600, -29561=>15601, -29565=>15602, -29567=>15603, -29569=>15604, -29570=>15605, -29571=>15606, -29573=>15607, -29574=>15608, -29576=>15609, -29578=>15610, -29580=>15611, -29581=>15612, -29583=>15613, -29584=>15614, -29586=>15615, -29587=>15616, -29588=>15617, -29589=>15618, -29591=>15619, -29592=>15620, -29593=>15621, -29594=>15622, -29596=>15623, -29597=>15624, -29598=>15625, -29600=>15626, -29601=>15627, -29603=>15628, -29604=>15629, -29605=>15630, -29606=>15631, -29607=>15632, -29608=>15633, -29610=>15634, -29612=>15635, -29613=>15636, -29617=>15637, -29620=>15638, -29621=>15639, -29622=>15640, -29624=>15641, -29625=>15642, -29628=>15643, -29629=>15644, -29630=>15645, -29631=>15646, -29633=>15647, -29635=>15648, -29636=>15649, -29637=>15650, -29638=>15651, -29639=>15652, -29643=>15653, -29644=>15654, -29646=>15655, -29650=>15656, -29651=>15657, -29652=>15658, -29653=>15659, -29654=>15660, -29655=>15661, -29656=>15662, -29658=>15663, -29659=>15664, -29660=>15665, -29661=>15666, -29663=>15667, -29665=>15668, -29666=>15669, -29667=>15670, -29668=>15671, -29670=>15672, -29672=>15673, -29674=>15674, -29675=>15675, -29676=>15676, -29678=>15677, -29679=>15678, -29680=>15679, -29681=>15680, -29683=>15681, -29684=>15682, -29685=>15683, -29686=>15684, -29687=>15685, -29688=>15686, -29689=>15687, -29690=>15688, -29691=>15689, -29692=>15690, -29693=>15691, -29695=>15692, -29696=>15693, -29697=>15694, -29698=>15695, -29700=>15696, -29703=>15697, -29704=>15698, -29707=>15699, -29708=>15700, -29709=>15701, -29710=>15702, -29713=>15703, -29714=>15704, -29715=>15705, -29716=>15706, -29717=>15707, -29718=>15708, -29719=>15709, -29720=>15710, -29721=>15711, -29724=>15712, -29725=>15713, -29726=>15714, -29727=>15715, -29728=>15716, -29729=>15717, -29731=>15718, -29732=>15719, -29735=>15720, -29737=>15721, -29739=>15722, -29741=>15723, -29743=>15724, -29745=>15725, -29746=>15726, -29751=>15727, -29752=>15728, -29753=>15729, -29754=>15730, -29755=>15731, -29757=>15732, -29758=>15733, -29760=>15734, -29762=>15735, -29763=>15736, -29764=>15737, -29765=>15738, -29766=>15739, -29767=>15740, -29768=>15741, -29769=>15742, -29770=>15743, -29772=>15744, -29773=>15745, -29774=>15746, -29775=>15747, -29776=>15748, -29777=>15749, -29778=>15750, -29779=>15751, -29780=>15752, -29782=>15753, -29784=>15754, -29789=>15755, -29792=>15756, -29793=>15757, -29794=>15758, -29796=>15759, -29797=>15760, -29798=>15761, -29799=>15762, -29800=>15763, -29803=>15764, -29804=>15765, -29806=>15766, -29807=>15767, -29809=>15768, -29810=>15769, -29811=>15770, -29812=>15771, -29813=>15772, -29816=>15773, -29817=>15774, -29818=>15775, -29819=>15776, -29820=>15777, -29821=>15778, -29823=>15779, -29826=>15780, -29828=>15781, -29829=>15782, -29830=>15783, -29832=>15784, -29834=>15785, -29836=>15786, -29837=>15787, -29839=>15788, -29841=>15789, -29842=>15790, -29843=>15791, -29844=>15792, -29845=>15793, -29846=>15794, -29847=>15795, -29848=>15796, -29849=>15797, -29850=>15798, -29851=>15799, -29853=>15800, -29855=>15801, -29856=>15802, -29857=>15803, -29858=>15804, -29860=>15805, -29861=>15806, -29866=>15807, -29867=>15808, -29868=>15809, -29869=>15810, -29870=>15811, -29871=>15812, -29873=>15813, -29874=>15814, -29875=>15815, -29876=>15816, -29877=>15817, -29878=>15818, -29879=>15819, -29880=>15820, -29881=>15821, -29883=>15822, -29884=>15823, -29886=>15824, -29887=>15825, -29888=>15826, -29889=>15827, -29890=>15828, -29891=>15829, -29892=>15830, -29893=>15831, -29894=>15832, -29895=>15833, -29896=>15834, -29897=>15835, -29899=>15836, -29900=>15837, -29901=>15838, -29902=>15839, -29904=>15840, -29905=>15841, -29907=>15842, -29909=>15843, -29910=>15844, -29911=>15845, -29912=>15846, -29913=>15847, -29915=>15848, -29917=>15849, -29919=>15850, -29921=>15851, -29925=>15852, -29927=>15853, -29928=>15854, -29929=>15855, -29930=>15856, -29931=>15857, -29932=>15858, -29933=>15859, -29936=>15860, -29937=>15861, -29938=>15862, -29939=>15863, -29941=>15864, -29944=>15865, -29945=>15866, -29946=>15867, -29947=>15868, -29948=>15869, -29949=>15870, -29950=>15871, -29952=>15872, -29953=>15873, -29954=>15874, -29955=>15875, -29957=>15876, -29958=>15877, -29959=>15878, -29960=>15879, -29961=>15880, -29962=>15881, -29963=>15882, -29966=>15883, -29968=>15884, -29970=>15885, -29972=>15886, -29973=>15887, -29974=>15888, -29975=>15889, -29979=>15890, -29981=>15891, -29982=>15892, -29984=>15893, -29985=>15894, -29986=>15895, -29988=>15896, -29990=>15897, -29991=>15898, -29994=>15899, -29998=>15900, -30004=>15901, -30006=>15902, -30009=>15903, -30012=>15904, -30013=>15905, -30015=>15906, -30017=>15907, -30018=>15908, -30019=>15909, -30020=>15910, -30022=>15911, -30023=>15912, -30025=>15913, -30026=>15914, -30029=>15915, -30032=>15916, -30033=>15917, -30034=>15918, -30035=>15919, -30037=>15920, -30038=>15921, -30039=>15922, -30040=>15923, -30046=>15924, -30047=>15925, -30048=>15926, -30049=>15927, -30051=>15928, -30052=>15929, -30055=>15930, -30056=>15931, -30057=>15932, -30060=>15933, -30061=>15934, -30062=>15935, -30063=>15936, -30064=>15937, -30065=>15938, -30067=>15939, -30069=>15940, -30071=>15941, -30074=>15942, -30075=>15943, -30076=>15944, -30077=>15945, -30078=>15946, -30080=>15947, -30081=>15948, -30082=>15949, -30084=>15950, -30085=>15951, -30088=>15952, -30089=>15953, -30090=>15954, -30092=>15955, -30093=>15956, -30094=>15957, -30096=>15958, -30099=>15959, -30101=>15960, -30104=>15961, -30107=>15962, -30108=>15963, -30110=>15964, -30114=>15965, -30118=>15966, -30119=>15967, -30120=>15968, -30121=>15969, -30122=>15970, -30125=>15971, -30134=>15972, -30135=>15973, -30138=>15974, -30139=>15975, -30143=>15976, -30144=>15977, -30145=>15978, -30150=>15979, -30155=>15980, -30156=>15981, -30158=>15982, -30159=>15983, -30160=>15984, -30161=>15985, -30163=>15986, -30167=>15987, -30170=>15988, -30172=>15989, -30173=>15990, -30175=>15991, -30176=>15992, -30177=>15993, -30181=>15994, -30185=>15995, -30188=>15996, -30189=>15997, -30190=>15998, -30191=>15999, -30194=>16000, -30195=>16001, -30197=>16002, -30198=>16003, -30199=>16004, -30200=>16005, -30202=>16006, -30203=>16007, -30205=>16008, -30206=>16009, -30212=>16010, -30214=>16011, -30215=>16012, -30216=>16013, -30217=>16014, -30222=>16015, -30223=>16016, -30225=>16017, -30226=>16018, -30227=>16019, -30228=>16020, -30230=>16021, -30234=>16022, -30236=>16023, -30237=>16024, -30243=>16025, -30248=>16026, -30252=>16027, -30254=>16028, -30255=>16029, -30257=>16030, -30258=>16031, -30262=>16032, -30263=>16033, -30265=>16034, -30266=>16035, -30269=>16036, -30273=>16037, -30276=>16038, -30277=>16039, -30280=>16040, -30282=>16041, -30283=>16042, -30286=>16043, -30287=>16044, -30288=>16045, -30289=>16046, -30290=>16047, -30291=>16048, -30293=>16049, -30295=>16050, -30297=>16051, -30298=>16052, -30299=>16053, -30301=>16054, -30304=>16055, -30305=>16056, -30310=>16057, -30312=>16058, -30314=>16059, -30323=>16060, -30324=>16061, -30325=>16062, -12136=>16063, -30326=>16063, -30327=>16064, -30329=>16065, -30330=>16066, -30335=>16067, -30336=>16068, -30337=>16069, -30339=>16070, -30341=>16071, -30345=>16072, -30346=>16073, -30348=>16074, -30349=>16075, -30351=>16076, -30352=>16077, -30354=>16078, -30356=>16079, -30357=>16080, -30359=>16081, -30360=>16082, -30363=>16083, -30364=>16084, -30365=>16085, -30366=>16086, -30367=>16087, -30368=>16088, -30369=>16089, -30370=>16090, -30371=>16091, -30373=>16092, -30374=>16093, -30375=>16094, -30376=>16095, -30377=>16096, -30378=>16097, -30379=>16098, -30380=>16099, -30381=>16100, -30383=>16101, -30384=>16102, -30387=>16103, -30389=>16104, -30390=>16105, -30391=>16106, -30393=>16107, -30395=>16108, -30396=>16109, -30397=>16110, -30398=>16111, -30400=>16112, -30401=>16113, -30403=>16114, -30404=>16115, -30407=>16116, -30409=>16117, -30411=>16118, -30412=>16119, -30419=>16120, -30421=>16121, -30425=>16122, -30426=>16123, -30428=>16124, -30429=>16125, -30432=>16126, -30434=>16127, -30438=>16128, -30440=>16129, -30441=>16130, -30442=>16131, -30443=>16132, -30444=>16133, -30445=>16134, -30448=>16135, -30451=>16136, -30453=>16137, -30454=>16138, -30455=>16139, -30458=>16140, -30459=>16141, -30461=>16142, -30463=>16143, -30464=>16144, -30466=>16145, -30467=>16146, -30469=>16147, -30470=>16148, -30474=>16149, -30476=>16150, -30478=>16151, -30479=>16152, -30480=>16153, -30481=>16154, -30482=>16155, -30483=>16156, -30484=>16157, -30485=>16158, -30486=>16159, -30487=>16160, -30488=>16161, -30491=>16162, -30492=>16163, -30493=>16164, -30494=>16165, -30497=>16166, -30499=>16167, -30500=>16168, -30501=>16169, -30503=>16170, -30506=>16171, -30507=>16172, -30508=>16173, -30510=>16174, -30512=>16175, -30513=>16176, -30514=>16177, -30515=>16178, -30516=>16179, -30521=>16180, -30523=>16181, -30525=>16182, -30526=>16183, -30527=>16184, -30530=>16185, -30532=>16186, -30533=>16187, -30534=>16188, -30536=>16189, -30537=>16190, -30538=>16191, -30539=>16192, -30540=>16193, -30541=>16194, -30542=>16195, -30546=>16196, -30547=>16197, -30548=>16198, -30549=>16199, -30550=>16200, -30551=>16201, -30552=>16202, -30553=>16203, -30556=>16204, -30557=>16205, -30559=>16206, -30560=>16207, -30564=>16208, -30567=>16209, -30569=>16210, -30570=>16211, -30573=>16212, -30574=>16213, -30575=>16214, -30576=>16215, -30577=>16216, -30578=>16217, -30579=>16218, -30580=>16219, -30581=>16220, -30582=>16221, -30583=>16222, -30584=>16223, -30586=>16224, -30587=>16225, -30588=>16226, -30593=>16227, -30594=>16228, -30595=>16229, -30598=>16230, -30599=>16231, -30600=>16232, -30601=>16233, -30602=>16234, -30603=>16235, -30607=>16236, -30608=>16237, -30611=>16238, -30612=>16239, -30613=>16240, -30614=>16241, -30615=>16242, -30617=>16243, -30618=>16244, -30619=>16245, -30620=>16246, -30621=>16247, -30625=>16248, -30627=>16249, -30628=>16250, -30630=>16251, -30632=>16252, -30635=>16253, -30638=>16254, -30639=>16255, -30641=>16256, -30642=>16257, -30644=>16258, -30646=>16259, -30647=>16260, -30648=>16261, -30649=>16262, -30650=>16263, -30654=>16264, -30656=>16265, -30657=>16266, -30658=>16267, -30659=>16268, -30660=>16269, -30661=>16270, -30662=>16271, -30664=>16272, -30665=>16273, -30666=>16274, -30667=>16275, -30668=>16276, -30670=>16277, -30671=>16278, -30672=>16279, -30673=>16280, -30674=>16281, -30675=>16282, -30676=>16283, -30677=>16284, -30678=>16285, -30680=>16286, -30681=>16287, -30685=>16288, -30686=>16289, -30687=>16290, -30688=>16291, -30689=>16292, -30692=>16293, -30694=>16294, -30696=>16295, -30698=>16296, -30704=>16297, -30705=>16298, -30706=>16299, -30708=>16300, -30709=>16301, -30711=>16302, -30713=>16303, -30714=>16304, -30715=>16305, -30716=>16306, -30723=>16307, -30724=>16308, -30725=>16309, -30726=>16310, -30727=>16311, -30728=>16312, -30730=>16313, -30731=>16314, -30734=>16315, -30735=>16316, -30736=>16317, -30739=>16318, -30741=>16319, -30745=>16320, -30747=>16321, -30750=>16322, -30752=>16323, -30753=>16324, -30754=>16325, -30756=>16326, -30760=>16327, -30762=>16328, -30763=>16329, -30766=>16330, -30767=>16331, -30769=>16332, -30770=>16333, -30771=>16334, -30773=>16335, -30774=>16336, -30781=>16337, -30783=>16338, -30785=>16339, -30786=>16340, -30788=>16341, -30790=>16342, -30792=>16343, -30793=>16344, -30794=>16345, -30795=>16346, -30797=>16347, -30799=>16348, -30801=>16349, -30803=>16350, -30804=>16351, -30808=>16352, -30809=>16353, -30810=>16354, -30811=>16355, -30812=>16356, -30814=>16357, -30815=>16358, -30816=>16359, -30817=>16360, -30818=>16361, -30819=>16362, -30821=>16363, -30822=>16364, -30823=>16365, -30825=>16366, -30832=>16367, -30833=>16368, -30834=>16369, -30835=>16370, -30836=>16371, -30837=>16372, -30838=>16373, -30840=>16374, -30841=>16375, -30842=>16376, -30843=>16377, -30845=>16378, -30846=>16379, -30847=>16380, -30848=>16381, -30849=>16382, -30850=>16383, -30851=>16384, -30852=>16385, -30853=>16386, -30854=>16387, -30856=>16388, -30858=>16389, -30859=>16390, -30863=>16391, -30864=>16392, -30866=>16393, -30868=>16394, -30869=>16395, -30870=>16396, -30873=>16397, -30877=>16398, -30878=>16399, -30880=>16400, -30882=>16401, -30884=>16402, -30886=>16403, -30888=>16404, -30890=>16405, -30891=>16406, -30892=>16407, -30894=>16408, -30895=>16409, -30901=>16410, -30902=>16411, -30903=>16412, -30907=>16413, -30909=>16414, -30911=>16415, -30912=>16416, -30914=>16417, -30915=>16418, -30916=>16419, -30918=>16420, -30919=>16421, -30920=>16422, -30924=>16423, -30925=>16424, -30926=>16425, -30927=>16426, -30929=>16427, -30930=>16428, -30931=>16429, -30934=>16430, -30935=>16431, -30936=>16432, -30939=>16433, -30940=>16434, -30941=>16435, -30942=>16436, -30943=>16437, -30944=>16438, -30945=>16439, -30946=>16440, -30948=>16441, -30949=>16442, -30950=>16443, -30953=>16444, -30954=>16445, -30955=>16446, -30957=>16447, -30958=>16448, -30960=>16449, -30961=>16450, -30963=>16451, -30965=>16452, -30966=>16453, -30968=>16454, -30969=>16455, -30971=>16456, -30972=>16457, -30974=>16458, -30975=>16459, -30976=>16460, -30978=>16461, -30979=>16462, -30980=>16463, -30982=>16464, -30983=>16465, -30984=>16466, -30985=>16467, -30986=>16468, -30987=>16469, -30988=>16470, -30989=>16471, -30991=>16472, -30992=>16473, -30993=>16474, -30994=>16475, -30996=>16476, -30997=>16477, -30998=>16478, -30999=>16479, -31000=>16480, -31002=>16481, -31003=>16482, -31004=>16483, -31005=>16484, -31007=>16485, -31008=>16486, -31009=>16487, -31010=>16488, -31011=>16489, -31013=>16490, -31015=>16491, -31016=>16492, -31017=>16493, -31021=>16494, -31022=>16495, -31023=>16496, -31024=>16497, -31026=>16498, -31027=>16499, -31029=>16500, -31030=>16501, -31031=>16502, -31032=>16503, -31033=>16504, -31037=>16505, -31039=>16506, -31042=>16507, -31043=>16508, -31044=>16509, -31045=>16510, -31047=>16511, -31050=>16512, -31051=>16513, -31052=>16514, -31053=>16515, -31054=>16516, -31055=>16517, -31056=>16518, -31057=>16519, -31058=>16520, -31060=>16521, -31061=>16522, -31064=>16523, -31065=>16524, -31073=>16525, -31075=>16526, -31076=>16527, -31078=>16528, -31081=>16529, -31082=>16530, -31083=>16531, -31084=>16532, -31086=>16533, -31088=>16534, -31089=>16535, -31090=>16536, -31091=>16537, -31092=>16538, -31093=>16539, -31094=>16540, -31097=>16541, -31099=>16542, -31100=>16543, -31101=>16544, -31102=>16545, -31103=>16546, -31106=>16547, -31107=>16548, -31110=>16549, -31111=>16550, -31112=>16551, -31113=>16552, -31115=>16553, -31116=>16554, -31120=>16555, -31121=>16556, -31122=>16557, -31123=>16558, -31124=>16559, -31125=>16560, -31126=>16561, -31127=>16562, -31128=>16563, -31129=>16564, -31131=>16565, -31132=>16566, -31133=>16567, -31134=>16568, -31135=>16569, -31136=>16570, -31137=>16571, -31138=>16572, -31139=>16573, -31140=>16574, -31141=>16575, -31144=>16576, -31145=>16577, -31147=>16578, -31148=>16579, -31149=>16580, -31151=>16581, -31154=>16582, -31156=>16583, -31157=>16584, -31158=>16585, -31159=>16586, -12145=>16587, -31160=>16587, -31164=>16588, -31167=>16589, -31170=>16590, -31172=>16591, -31173=>16592, -31175=>16593, -31176=>16594, -31178=>16595, -63893=>16595, -31180=>16596, -31182=>16597, -31183=>16598, -31184=>16599, -31187=>16600, -31188=>16601, -31190=>16602, -31191=>16603, -31193=>16604, -31194=>16605, -31195=>16606, -31196=>16607, -31197=>16608, -31198=>16609, -31200=>16610, -31201=>16611, -31202=>16612, -31205=>16613, -31208=>16614, -31210=>16615, -31212=>16616, -31214=>16617, -31217=>16618, -31218=>16619, -31219=>16620, -31220=>16621, -31221=>16622, -31222=>16623, -31223=>16624, -31225=>16625, -31226=>16626, -31228=>16627, -31230=>16628, -31231=>16629, -31233=>16630, -31236=>16631, -31237=>16632, -31239=>16633, -31240=>16634, -31241=>16635, -31242=>16636, -31244=>16637, -31247=>16638, -31248=>16639, -31249=>16640, -31250=>16641, -31251=>16642, -31253=>16643, -31254=>16644, -31256=>16645, -31257=>16646, -31259=>16647, -31260=>16648, -31261=>16649, -31263=>16650, -31265=>16651, -31266=>16652, -31268=>16653, -31269=>16654, -31270=>16655, -31271=>16656, -31272=>16657, -31273=>16658, -31274=>16659, -31275=>16660, -31276=>16661, -31277=>16662, -31279=>16663, -31280=>16664, -31282=>16665, -31284=>16666, -31285=>16667, -31286=>16668, -31288=>16669, -31290=>16670, -31294=>16671, -31297=>16672, -31298=>16673, -31299=>16674, -31300=>16675, -31301=>16676, -31303=>16677, -31304=>16678, -31305=>16679, -31306=>16680, -31307=>16681, -31311=>16682, -31312=>16683, -31314=>16684, -31315=>16685, -31316=>16686, -31317=>16687, -31318=>16688, -31320=>16689, -31321=>16690, -31322=>16691, -31323=>16692, -31324=>16693, -31325=>16694, -31326=>16695, -31327=>16696, -31328=>16697, -31331=>16698, -31332=>16699, -31333=>16700, -31334=>16701, -31335=>16702, -31336=>16703, -31338=>16704, -31340=>16705, -31341=>16706, -31342=>16707, -31343=>16708, -31345=>16709, -31346=>16710, -31347=>16711, -31349=>16712, -31355=>16713, -31356=>16714, -31357=>16715, -31358=>16716, -31362=>16717, -31365=>16718, -31367=>16719, -31369=>16720, -31370=>16721, -31371=>16722, -31372=>16723, -31374=>16724, -31375=>16725, -31376=>16726, -31379=>16727, -31380=>16728, -31385=>16729, -31386=>16730, -31387=>16731, -31390=>16732, -31393=>16733, -31394=>16734, -31395=>16735, -31396=>16736, -31399=>16737, -31403=>16738, -31407=>16739, -31408=>16740, -31409=>16741, -31410=>16742, -31412=>16743, -31413=>16744, -31415=>16745, -31416=>16746, -31417=>16747, -31419=>16748, -31420=>16749, -31421=>16750, -31422=>16751, -31424=>16752, -31425=>16753, -31426=>16754, -31427=>16755, -31430=>16756, -31433=>16757, -31436=>16758, -31437=>16759, -31438=>16760, -31439=>16761, -31440=>16762, -31441=>16763, -31442=>16764, -31443=>16765, -31444=>16766, -31445=>16767, -31447=>16768, -31448=>16769, -31450=>16770, -31451=>16771, -31452=>16772, -31453=>16773, -31457=>16774, -31458=>16775, -31460=>16776, -31463=>16777, -31464=>16778, -31465=>16779, -31467=>16780, -31468=>16781, -31470=>16782, -31472=>16783, -31473=>16784, -31474=>16785, -31475=>16786, -31476=>16787, -31477=>16788, -31479=>16789, -31480=>16790, -31483=>16791, -31484=>16792, -31486=>16793, -31488=>16794, -31489=>16795, -31490=>16796, -31493=>16797, -31495=>16798, -31497=>16799, -31500=>16800, -31501=>16801, -31502=>16802, -31504=>16803, -31506=>16804, -31507=>16805, -31510=>16806, -31511=>16807, -31512=>16808, -31514=>16809, -31516=>16810, -31517=>16811, -31519=>16812, -31521=>16813, -31522=>16814, -31523=>16815, -31527=>16816, -31529=>16817, -31533=>16818, -31535=>16819, -31536=>16820, -31538=>16821, -31540=>16822, -31541=>16823, -31542=>16824, -31543=>16825, -31545=>16826, -31547=>16827, -31549=>16828, -31551=>16829, -31552=>16830, -31553=>16831, -31554=>16832, -31555=>16833, -31556=>16834, -31560=>16835, -31562=>16836, -31565=>16837, -31566=>16838, -31571=>16839, -31573=>16840, -31575=>16841, -31577=>16842, -31580=>16843, -31582=>16844, -31583=>16845, -31585=>16846, -31587=>16847, -31588=>16848, -31589=>16849, -31590=>16850, -31592=>16851, -31593=>16852, -31594=>16853, -31595=>16854, -31596=>16855, -31597=>16856, -31599=>16857, -31600=>16858, -31603=>16859, -31604=>16860, -31606=>16861, -31608=>16862, -31610=>16863, -31612=>16864, -31613=>16865, -31615=>16866, -31617=>16867, -31618=>16868, -31619=>16869, -31620=>16870, -31622=>16871, -31623=>16872, -31624=>16873, -31625=>16874, -31626=>16875, -31628=>16876, -31630=>16877, -31631=>16878, -31633=>16879, -31634=>16880, -31635=>16881, -31638=>16882, -31640=>16883, -31641=>16884, -31642=>16885, -31643=>16886, -31646=>16887, -31647=>16888, -31648=>16889, -31651=>16890, -31652=>16891, -31653=>16892, -31662=>16893, -31663=>16894, -31664=>16895, -31666=>16896, -31667=>16897, -31669=>16898, -31670=>16899, -31671=>16900, -31673=>16901, -31674=>16902, -31675=>16903, -31676=>16904, -31677=>16905, -31678=>16906, -31679=>16907, -31682=>16908, -31683=>16909, -31685=>16910, -31688=>16911, -31690=>16912, -31693=>16913, -31694=>16914, -31695=>16915, -31696=>16916, -31698=>16917, -31700=>16918, -31701=>16919, -31702=>16920, -31703=>16921, -31704=>16922, -31707=>16923, -31708=>16924, -31710=>16925, -31711=>16926, -31712=>16927, -31714=>16928, -31715=>16929, -31719=>16930, -31720=>16931, -31723=>16932, -31724=>16933, -31725=>16934, -31727=>16935, -31728=>16936, -31730=>16937, -31732=>16938, -31733=>16939, -31734=>16940, -31736=>16941, -31737=>16942, -31738=>16943, -31739=>16944, -31741=>16945, -31743=>16946, -31745=>16947, -31746=>16948, -31747=>16949, -31748=>16950, -31749=>16951, -31750=>16952, -31752=>16953, -31753=>16954, -31754=>16955, -31758=>16956, -31760=>16957, -31761=>16958, -31762=>16959, -31763=>16960, -31764=>16961, -31765=>16962, -31767=>16963, -31768=>16964, -31769=>16965, -31770=>16966, -31771=>16967, -31772=>16968, -31773=>16969, -31776=>16970, -31778=>16971, -31780=>16972, -31781=>16973, -31784=>16974, -31785=>16975, -31788=>16976, -31789=>16977, -31790=>16978, -31791=>16979, -31792=>16980, -31793=>16981, -31794=>16982, -31795=>16983, -31796=>16984, -31797=>16985, -31798=>16986, -31799=>16987, -31801=>16988, -31802=>16989, -31803=>16990, -31804=>16991, -31810=>16992, -31812=>16993, -31813=>16994, -31814=>16995, -31815=>16996, -31816=>16997, -31817=>16998, -31818=>16999, -31819=>17000, -31822=>17001, -31823=>17002, -31824=>17003, -31825=>17004, -31826=>17005, -31827=>17006, -31828=>17007, -31829=>17008, -31830=>17009, -31831=>17010, -31832=>17011, -31833=>17012, -31834=>17013, -31835=>17014, -31837=>17015, -31838=>17016, -31841=>17017, -31842=>17018, -31843=>17019, -31845=>17020, -31846=>17021, -31847=>17022, -31848=>17023, -31851=>17024, -31853=>17025, -31855=>17026, -31856=>17027, -31857=>17028, -31861=>17029, -31862=>17030, -31863=>17031, -31864=>17032, -31865=>17033, -31866=>17034, -31870=>17035, -31871=>17036, -31872=>17037, -31873=>17038, -31874=>17039, -31875=>17040, -31876=>17041, -31877=>17042, -31878=>17043, -31879=>17044, -31880=>17045, -31882=>17046, -31883=>17047, -31884=>17048, -31885=>17049, -31886=>17050, -31887=>17051, -31888=>17052, -31891=>17053, -31892=>17054, -31894=>17055, -31897=>17056, -31898=>17057, -31899=>17058, -31904=>17059, -31905=>17060, -31907=>17061, -31910=>17062, -31911=>17063, -31912=>17064, -31913=>17065, -31915=>17066, -31916=>17067, -31917=>17068, -31919=>17069, -31920=>17070, -31924=>17071, -31925=>17072, -31926=>17073, -31927=>17074, -31928=>17075, -31930=>17076, -31931=>17077, -31935=>17078, -31936=>17079, -31938=>17080, -31939=>17081, -31940=>17082, -31942=>17083, -31945=>17084, -31947=>17085, -31950=>17086, -31951=>17087, -31952=>17088, -31953=>17089, -31954=>17090, -31955=>17091, -31956=>17092, -31960=>17093, -31962=>17094, -31963=>17095, -31969=>17096, -31970=>17097, -31971=>17098, -31972=>17099, -31973=>17100, -31974=>17101, -31977=>17102, -31978=>17103, -31979=>17104, -31980=>17105, -31981=>17106, -31982=>17107, -31985=>17108, -31987=>17109, -31989=>17110, -31991=>17111, -31994=>17112, -31996=>17113, -31997=>17114, -31999=>17115, -32001=>17116, -32003=>17117, -32012=>17118, -32014=>17119, -32015=>17120, -32017=>17121, -32018=>17122, -32022=>17123, -32024=>17124, -32029=>17125, -32030=>17126, -32031=>17127, -32035=>17128, -32036=>17129, -32037=>17130, -32038=>17131, -32040=>17132, -32041=>17133, -32042=>17134, -32044=>17135, -32045=>17136, -32046=>17137, -32052=>17138, -32053=>17139, -32054=>17140, -32055=>17141, -32056=>17142, -32059=>17143, -32061=>17144, -32062=>17145, -32065=>17146, -32067=>17147, -32069=>17148, -32071=>17149, -32072=>17150, -32073=>17151, -32074=>17152, -32075=>17153, -32076=>17154, -32077=>17155, -32079=>17156, -32081=>17157, -32082=>17158, -32083=>17159, -32084=>17160, -32085=>17161, -32086=>17162, -32087=>17163, -32088=>17164, -32089=>17165, -32090=>17166, -32091=>17167, -32092=>17168, -32095=>17169, -32096=>17170, -32099=>17171, -32100=>17172, -32101=>17173, -32103=>17174, -32105=>17175, -32106=>17176, -32107=>17177, -32108=>17178, -32109=>17179, -32111=>17180, -32112=>17181, -32116=>17182, -32117=>17183, -32120=>17184, -32122=>17185, -32123=>17186, -32124=>17187, -32125=>17188, -32126=>17189, -32127=>17190, -32128=>17191, -32130=>17192, -32132=>17193, -32133=>17194, -32135=>17195, -32138=>17196, -32139=>17197, -32140=>17198, -32141=>17199, -32142=>17200, -32144=>17201, -32145=>17202, -32146=>17203, -32148=>17204, -32149=>17205, -32150=>17206, -32151=>17207, -32152=>17208, -32153=>17209, -32154=>17210, -32155=>17211, -32157=>17212, -32159=>17213, -32160=>17214, -32161=>17215, -32164=>17216, -32165=>17217, -32167=>17218, -32168=>17219, -32169=>17220, -32170=>17221, -32175=>17222, -32181=>17223, -32182=>17224, -32183=>17225, -32188=>17226, -32192=>17227, -32193=>17228, -32194=>17229, -32195=>17230, -32197=>17231, -32198=>17232, -32200=>17233, -32201=>17234, -32204=>17235, -32205=>17236, -32206=>17237, -32207=>17238, -32208=>17239, -32211=>17240, -32213=>17241, -32214=>17242, -32218=>17243, -32219=>17244, -32220=>17245, -32223=>17246, -32226=>17247, -32228=>17248, -32229=>17249, -32231=>17250, -32234=>17251, -32235=>17252, -32237=>17253, -32238=>17254, -32240=>17255, -32243=>17256, -32245=>17257, -32247=>17258, -32248=>17259, -32250=>17260, -32252=>17261, -32253=>17262, -32254=>17263, -32255=>17264, -32256=>17265, -32257=>17266, -32258=>17267, -32259=>17268, -32260=>17269, -32261=>17270, -32262=>17271, -32263=>17272, -32268=>17273, -32269=>17274, -32270=>17275, -32271=>17276, -32274=>17277, -32275=>17278, -32276=>17279, -32277=>17280, -32278=>17281, -32279=>17282, -32280=>17283, -32281=>17284, -32282=>17285, -32284=>17286, -32288=>17287, -32289=>17288, -32290=>17289, -32292=>17290, -32293=>17291, -32294=>17292, -32296=>17293, -32297=>17294, -32298=>17295, -32300=>17296, -32303=>17297, -32304=>17298, -32307=>17299, -32312=>17300, -32314=>17301, -32316=>17302, -32319=>17303, -32320=>17304, -32322=>17305, -32323=>17306, -32324=>17307, -32328=>17308, -32329=>17309, -32330=>17310, -32331=>17311, -32332=>17312, -32333=>17313, -32334=>17314, -32335=>17315, -32336=>17316, -32337=>17317, -32339=>17318, -32342=>17319, -32343=>17320, -32344=>17321, -32345=>17322, -32347=>17323, -32348=>17324, -32349=>17325, -32351=>17326, -32352=>17327, -32353=>17328, -32355=>17329, -32356=>17330, -32357=>17331, -32358=>17332, -32359=>17333, -32360=>17334, -32364=>17335, -32369=>17336, -32370=>17337, -32372=>17338, -32373=>17339, -32374=>17340, -32375=>17341, -32376=>17342, -32378=>17343, -32379=>17344, -32383=>17345, -32384=>17346, -32385=>17347, -32387=>17348, -32388=>17349, -32389=>17350, -32390=>17351, -32391=>17352, -32393=>17353, -32395=>17354, -32398=>17355, -32400=>17356, -32401=>17357, -32402=>17358, -32405=>17359, -32407=>17360, -32409=>17361, -32410=>17362, -32413=>17363, -32414=>17364, -32430=>17365, -32436=>17366, -32443=>17367, -32444=>17368, -32470=>17369, -32484=>17370, -32492=>17371, -32505=>17372, -32522=>17373, -32528=>17374, -32542=>17375, -32567=>17376, -32569=>17377, -32571=>17378, -32572=>17379, -32573=>17380, -32574=>17381, -32575=>17382, -32576=>17383, -32577=>17384, -32579=>17385, -32582=>17386, -32583=>17387, -32584=>17388, -32585=>17389, -32586=>17390, -32587=>17391, -32589=>17392, -32591=>17393, -32594=>17394, -32595=>17395, -32598=>17396, -32601=>17397, -32603=>17398, -32604=>17399, -32605=>17400, -32606=>17401, -32608=>17402, -32611=>17403, -32612=>17404, -32613=>17405, -32614=>17406, -32615=>17407, -32619=>17408, -32620=>17409, -32621=>17410, -32623=>17411, -32627=>17412, -32629=>17413, -32630=>17414, -32632=>17415, -32634=>17416, -32635=>17417, -32636=>17418, -32637=>17419, -32639=>17420, -32640=>17421, -32642=>17422, -32643=>17423, -32644=>17424, -32647=>17425, -32649=>17426, -32651=>17427, -32653=>17428, -32655=>17429, -32656=>17430, -32657=>17431, -32658=>17432, -32659=>17433, -32661=>17434, -32662=>17435, -32663=>17436, -32664=>17437, -32665=>17438, -32667=>17439, -32668=>17440, -32672=>17441, -32674=>17442, -32675=>17443, -32678=>17444, -32680=>17445, -32682=>17446, -32683=>17447, -32684=>17448, -32685=>17449, -32686=>17450, -32689=>17451, -32691=>17452, -32692=>17453, -32693=>17454, -32694=>17455, -32695=>17456, -32698=>17457, -32699=>17458, -32702=>17459, -32704=>17460, -32706=>17461, -32707=>17462, -32708=>17463, -32710=>17464, -32711=>17465, -32712=>17466, -32713=>17467, -32715=>17468, -32717=>17469, -32719=>17470, -32720=>17471, -32721=>17472, -32723=>17473, -32726=>17474, -32727=>17475, -32729=>17476, -32730=>17477, -32731=>17478, -32732=>17479, -32733=>17480, -32734=>17481, -32738=>17482, -32739=>17483, -32740=>17484, -32743=>17485, -32744=>17486, -32746=>17487, -32747=>17488, -32748=>17489, -32749=>17490, -32751=>17491, -32754=>17492, -32756=>17493, -32757=>17494, -32758=>17495, -32759=>17496, -32760=>17497, -32762=>17498, -32765=>17499, -32766=>17500, -32767=>17501, -32770=>17502, -32775=>17503, -32776=>17504, -32777=>17505, -32778=>17506, -32782=>17507, -32783=>17508, -32785=>17509, -32787=>17510, -32794=>17511, -32795=>17512, -32797=>17513, -32798=>17514, -32799=>17515, -32801=>17516, -32803=>17517, -32804=>17518, -32811=>17519, -32813=>17520, -32815=>17521, -32816=>17522, -32818=>17523, -32820=>17524, -32825=>17525, -32826=>17526, -32828=>17527, -32830=>17528, -32832=>17529, -32833=>17530, -32836=>17531, -32837=>17532, -32839=>17533, -32840=>17534, -32841=>17535, -32846=>17536, -32847=>17537, -32848=>17538, -32849=>17539, -32851=>17540, -32853=>17541, -32855=>17542, -32857=>17543, -32859=>17544, -32860=>17545, -32861=>17546, -32863=>17547, -32864=>17548, -32865=>17549, -32866=>17550, -32867=>17551, -32868=>17552, -32869=>17553, -32870=>17554, -32871=>17555, -32872=>17556, -32875=>17557, -32876=>17558, -32877=>17559, -32878=>17560, -32884=>17561, -32888=>17562, -32890=>17563, -32891=>17564, -32892=>17565, -32897=>17566, -32898=>17567, -32904=>17568, -32906=>17569, -32909=>17570, -32910=>17571, -32911=>17572, -32912=>17573, -32913=>17574, -32914=>17575, -32916=>17576, -32917=>17577, -32919=>17578, -32921=>17579, -32926=>17580, -32931=>17581, -32934=>17582, -32935=>17583, -32936=>17584, -32940=>17585, -32944=>17586, -32947=>17587, -32949=>17588, -32950=>17589, -32952=>17590, -32953=>17591, -32955=>17592, -32965=>17593, -32967=>17594, -32968=>17595, -32969=>17596, -32970=>17597, -32971=>17598, -32975=>17599, -32976=>17600, -32977=>17601, -32978=>17602, -32979=>17603, -32980=>17604, -32981=>17605, -32984=>17606, -32991=>17607, -32992=>17608, -32994=>17609, -32995=>17610, -32998=>17611, -33006=>17612, -33013=>17613, -33015=>17614, -33017=>17615, -33019=>17616, -33022=>17617, -33023=>17618, -33024=>17619, -33025=>17620, -33027=>17621, -33028=>17622, -33031=>17623, -33032=>17624, -33035=>17625, -33036=>17626, -33045=>17627, -33047=>17628, -33049=>17629, -33052=>17630, -33053=>17631, -33055=>17632, -33056=>17633, -33057=>17634, -33058=>17635, -33059=>17636, -33060=>17637, -33061=>17638, -33062=>17639, -33063=>17640, -33064=>17641, -33065=>17642, -33066=>17643, -33067=>17644, -33069=>17645, -33070=>17646, -33072=>17647, -33075=>17648, -33076=>17649, -33077=>17650, -33079=>17651, -33082=>17652, -33083=>17653, -33084=>17654, -33085=>17655, -33087=>17656, -33088=>17657, -33089=>17658, -33090=>17659, -33091=>17660, -33092=>17661, -33093=>17662, -33095=>17663, -33097=>17664, -33101=>17665, -33103=>17666, -33106=>17667, -33111=>17668, -33112=>17669, -33115=>17670, -33116=>17671, -33117=>17672, -33118=>17673, -33119=>17674, -33122=>17675, -33123=>17676, -33124=>17677, -33128=>17678, -33130=>17679, -33132=>17680, -33135=>17681, -33138=>17682, -33139=>17683, -33141=>17684, -33142=>17685, -33143=>17686, -33153=>17687, -33155=>17688, -33156=>17689, -33157=>17690, -33158=>17691, -33159=>17692, -33161=>17693, -33163=>17694, -33164=>17695, -33165=>17696, -33166=>17697, -33168=>17698, -33170=>17699, -33171=>17700, -33172=>17701, -33173=>17702, -33174=>17703, -33175=>17704, -33177=>17705, -33182=>17706, -33183=>17707, -33185=>17708, -33186=>17709, -33188=>17710, -33189=>17711, -33191=>17712, -33195=>17713, -33196=>17714, -33197=>17715, -33198=>17716, -33199=>17717, -33200=>17718, -33201=>17719, -33202=>17720, -33204=>17721, -33205=>17722, -33206=>17723, -33207=>17724, -33208=>17725, -33209=>17726, -33212=>17727, -33220=>17728, -33221=>17729, -33223=>17730, -33224=>17731, -33227=>17732, -33230=>17733, -33232=>17734, -33233=>17735, -33234=>17736, -33235=>17737, -33236=>17738, -33237=>17739, -33238=>17740, -33239=>17741, -33241=>17742, -33243=>17743, -33244=>17744, -33245=>17745, -33246=>17746, -33249=>17747, -33250=>17748, -33252=>17749, -33253=>17750, -33254=>17751, -33257=>17752, -33259=>17753, -33262=>17754, -33263=>17755, -33264=>17756, -33265=>17757, -33266=>17758, -33269=>17759, -33270=>17760, -33271=>17761, -33272=>17762, -33273=>17763, -33277=>17764, -33279=>17765, -33283=>17766, -33291=>17767, -33294=>17768, -33295=>17769, -33297=>17770, -33299=>17771, -33301=>17772, -33302=>17773, -33303=>17774, -33304=>17775, -33305=>17776, -33306=>17777, -33309=>17778, -33312=>17779, -33316=>17780, -33317=>17781, -33318=>17782, -33319=>17783, -33321=>17784, -33326=>17785, -33330=>17786, -33338=>17787, -33340=>17788, -33341=>17789, -33343=>17790, -33344=>17791, -33345=>17792, -33346=>17793, -33347=>17794, -33349=>17795, -33350=>17796, -33352=>17797, -33354=>17798, -33356=>17799, -33357=>17800, -33358=>17801, -33360=>17802, -33361=>17803, -33362=>17804, -33363=>17805, -33364=>17806, -33365=>17807, -33366=>17808, -33367=>17809, -33371=>17810, -33372=>17811, -33373=>17812, -33374=>17813, -33376=>17814, -33377=>17815, -33378=>17816, -33379=>17817, -33381=>17818, -33383=>17819, -33385=>17820, -33386=>17821, -33388=>17822, -33389=>17823, -33397=>17824, -33398=>17825, -12171=>17826, -33400=>17826, -33403=>17827, -33404=>17828, -33408=>17829, -33409=>17830, -33411=>17831, -33413=>17832, -33414=>17833, -33415=>17834, -33417=>17835, -33420=>17836, -33424=>17837, -33427=>17838, -33428=>17839, -33429=>17840, -33430=>17841, -33434=>17842, -33435=>17843, -33438=>17844, -33440=>17845, -33442=>17846, -33443=>17847, -33447=>17848, -33458=>17849, -33461=>17850, -33462=>17851, -33466=>17852, -33468=>17853, -33471=>17854, -33472=>17855, -33474=>17856, -33475=>17857, -33477=>17858, -33478=>17859, -33481=>17860, -33488=>17861, -33494=>17862, -33497=>17863, -33498=>17864, -33501=>17865, -33506=>17866, -33512=>17867, -33513=>17868, -33514=>17869, -33516=>17870, -33517=>17871, -33518=>17872, -33520=>17873, -33522=>17874, -33523=>17875, -33525=>17876, -33526=>17877, -33528=>17878, -33530=>17879, -33532=>17880, -33533=>17881, -33534=>17882, -33535=>17883, -33536=>17884, -33546=>17885, -33547=>17886, -33549=>17887, -33552=>17888, -33554=>17889, -33555=>17890, -33558=>17891, -33560=>17892, -33561=>17893, -33565=>17894, -33566=>17895, -33567=>17896, -33568=>17897, -33569=>17898, -33570=>17899, -33571=>17900, -33572=>17901, -33573=>17902, -33574=>17903, -33577=>17904, -33578=>17905, -33582=>17906, -33584=>17907, -33586=>17908, -33591=>17909, -33595=>17910, -33597=>17911, -33598=>17912, -33599=>17913, -33601=>17914, -33602=>17915, -33604=>17916, -33605=>17917, -33608=>17918, -33610=>17919, -33611=>17920, -33612=>17921, -33613=>17922, -33614=>17923, -33619=>17924, -33621=>17925, -33622=>17926, -33623=>17927, -33624=>17928, -33625=>17929, -33629=>17930, -33634=>17931, -33648=>17932, -33649=>17933, -33650=>17934, -33651=>17935, -33652=>17936, -33653=>17937, -33654=>17938, -33657=>17939, -33658=>17940, -33662=>17941, -33663=>17942, -33664=>17943, -33665=>17944, -33666=>17945, -33667=>17946, -33668=>17947, -33671=>17948, -33672=>17949, -33675=>17950, -33676=>17951, -33677=>17952, -33679=>17953, -33680=>17954, -33681=>17955, -33684=>17956, -33685=>17957, -33687=>17958, -33689=>17959, -33690=>17960, -33693=>17961, -33695=>17962, -33697=>17963, -33699=>17964, -33700=>17965, -33701=>17966, -33702=>17967, -33708=>17968, -33709=>17969, -33710=>17970, -33711=>17971, -33717=>17972, -33723=>17973, -33726=>17974, -33727=>17975, -33730=>17976, -33731=>17977, -33732=>17978, -33734=>17979, -33736=>17980, -33737=>17981, -33739=>17982, -33741=>17983, -33742=>17984, -33744=>17985, -33745=>17986, -33746=>17987, -33747=>17988, -33749=>17989, -33751=>17990, -33753=>17991, -33754=>17992, -33755=>17993, -33758=>17994, -33762=>17995, -33763=>17996, -33764=>17997, -33766=>17998, -33767=>17999, -33768=>18000, -33771=>18001, -33772=>18002, -33773=>18003, -33774=>18004, -33779=>18005, -33780=>18006, -33781=>18007, -33782=>18008, -33783=>18009, -33786=>18010, -33787=>18011, -33788=>18012, -33790=>18013, -33791=>18014, -33792=>18015, -33794=>18016, -33797=>18017, -33800=>18018, -33801=>18019, -33808=>18020, -33810=>18021, -33811=>18022, -33812=>18023, -33813=>18024, -33814=>18025, -33815=>18026, -33817=>18027, -33818=>18028, -33819=>18029, -33822=>18030, -33823=>18031, -33824=>18032, -33825=>18033, -33826=>18034, -33827=>18035, -33833=>18036, -33834=>18037, -33835=>18038, -33837=>18039, -33838=>18040, -33839=>18041, -33840=>18042, -33842=>18043, -33843=>18044, -33844=>18045, -33846=>18046, -33847=>18047, -33849=>18048, -33850=>18049, -33851=>18050, -33854=>18051, -33855=>18052, -33856=>18053, -33857=>18054, -33858=>18055, -33859=>18056, -33860=>18057, -33861=>18058, -33863=>18059, -33864=>18060, -33866=>18061, -33867=>18062, -33868=>18063, -33869=>18064, -33870=>18065, -33871=>18066, -33872=>18067, -33875=>18068, -33876=>18069, -33877=>18070, -33878=>18071, -33880=>18072, -33885=>18073, -33886=>18074, -33887=>18075, -33888=>18076, -33890=>18077, -33893=>18078, -33895=>18079, -33896=>18080, -33898=>18081, -33902=>18082, -33904=>18083, -33906=>18084, -33908=>18085, -33913=>18086, -33915=>18087, -33916=>18088, -33917=>18089, -33918=>18090, -33919=>18091, -33920=>18092, -33921=>18093, -33923=>18094, -33924=>18095, -33925=>18096, -33926=>18097, -33930=>18098, -33933=>18099, -33935=>18100, -33936=>18101, -33937=>18102, -33938=>18103, -33941=>18104, -33942=>18105, -33944=>18106, -33946=>18107, -33947=>18108, -33949=>18109, -33950=>18110, -33951=>18111, -33952=>18112, -33954=>18113, -33955=>18114, -33956=>18115, -33957=>18116, -33958=>18117, -33959=>18118, -33960=>18119, -33961=>18120, -33962=>18121, -33963=>18122, -33964=>18123, -33965=>18124, -33966=>18125, -33968=>18126, -33969=>18127, -33971=>18128, -33973=>18129, -33974=>18130, -33975=>18131, -33979=>18132, -33982=>18133, -33986=>18134, -33987=>18135, -33989=>18136, -33990=>18137, -33991=>18138, -33992=>18139, -33996=>18140, -33998=>18141, -33999=>18142, -34002=>18143, -34004=>18144, -34005=>18145, -34007=>18146, -34008=>18147, -34009=>18148, -34010=>18149, -34011=>18150, -34012=>18151, -34014=>18152, -34017=>18153, -34018=>18154, -34020=>18155, -34023=>18156, -34024=>18157, -34025=>18158, -34026=>18159, -34027=>18160, -34029=>18161, -34033=>18162, -34034=>18163, -34035=>18164, -34036=>18165, -34037=>18166, -34038=>18167, -34039=>18168, -34040=>18169, -34041=>18170, -34042=>18171, -34043=>18172, -34046=>18173, -34048=>18174, -34049=>18175, -34050=>18176, -34051=>18177, -34052=>18178, -34053=>18179, -34054=>18180, -34055=>18181, -34056=>18182, -34057=>18183, -34058=>18184, -34059=>18185, -34061=>18186, -34062=>18187, -34063=>18188, -34064=>18189, -34066=>18190, -34069=>18191, -34070=>18192, -34072=>18193, -34073=>18194, -34075=>18195, -34076=>18196, -34077=>18197, -34080=>18198, -34082=>18199, -34084=>18200, -34085=>18201, -34087=>18202, -34088=>18203, -34089=>18204, -34090=>18205, -34094=>18206, -34095=>18207, -34096=>18208, -34097=>18209, -34098=>18210, -34099=>18211, -34100=>18212, -34101=>18213, -34102=>18214, -34110=>18215, -34111=>18216, -34112=>18217, -34114=>18218, -34116=>18219, -34117=>18220, -34119=>18221, -34123=>18222, -34124=>18223, -34125=>18224, -34127=>18225, -34128=>18226, -34129=>18227, -34132=>18228, -34135=>18229, -34138=>18230, -34139=>18231, -34140=>18232, -34141=>18233, -34143=>18234, -34144=>18235, -34145=>18236, -34147=>18237, -34149=>18238, -34150=>18239, -34151=>18240, -34155=>18241, -34156=>18242, -34158=>18243, -34159=>18244, -34160=>18245, -34161=>18246, -34163=>18247, -34165=>18248, -34166=>18249, -34168=>18250, -34172=>18251, -34173=>18252, -34175=>18253, -34176=>18254, -34177=>18255, -34178=>18256, -34179=>18257, -34182=>18258, -34185=>18259, -34187=>18260, -34189=>18261, -34190=>18262, -34192=>18263, -34194=>18264, -34195=>18265, -34197=>18266, -34198=>18267, -34199=>18268, -34200=>18269, -34201=>18270, -34202=>18271, -34205=>18272, -34206=>18273, -34208=>18274, -34209=>18275, -34210=>18276, -34211=>18277, -34213=>18278, -34215=>18279, -34219=>18280, -34220=>18281, -34221=>18282, -34225=>18283, -34226=>18284, -34227=>18285, -34228=>18286, -34229=>18287, -34230=>18288, -34232=>18289, -34235=>18290, -34236=>18291, -34237=>18292, -34238=>18293, -34239=>18294, -34240=>18295, -34242=>18296, -34243=>18297, -34244=>18298, -34245=>18299, -34246=>18300, -34247=>18301, -34248=>18302, -34250=>18303, -34251=>18304, -34252=>18305, -34257=>18306, -34258=>18307, -34260=>18308, -34262=>18309, -34263=>18310, -34264=>18311, -34265=>18312, -34266=>18313, -34267=>18314, -34270=>18315, -34271=>18316, -34272=>18317, -34273=>18318, -34274=>18319, -34275=>18320, -34278=>18321, -34279=>18322, -34280=>18323, -34283=>18324, -34284=>18325, -34285=>18326, -34286=>18327, -34287=>18328, -34288=>18329, -34289=>18330, -34290=>18331, -34291=>18332, -34293=>18333, -34295=>18334, -34296=>18335, -34300=>18336, -34301=>18337, -34302=>18338, -34304=>18339, -34305=>18340, -34306=>18341, -34307=>18342, -34312=>18343, -34313=>18344, -34314=>18345, -34316=>18346, -34317=>18347, -34318=>18348, -34319=>18349, -34320=>18350, -34322=>18351, -34323=>18352, -34324=>18353, -34325=>18354, -34327=>18355, -34328=>18356, -34329=>18357, -34331=>18358, -34332=>18359, -34333=>18360, -34335=>18361, -34336=>18362, -34337=>18363, -34339=>18364, -34340=>18365, -34341=>18366, -34342=>18367, -34344=>18368, -34346=>18369, -34347=>18370, -34348=>18371, -34350=>18372, -34351=>18373, -34352=>18374, -34353=>18375, -34354=>18376, -34355=>18377, -34356=>18378, -34357=>18379, -34358=>18380, -34359=>18381, -34361=>18382, -34363=>18383, -34365=>18384, -34366=>18385, -34368=>18386, -34369=>18387, -34370=>18388, -34371=>18389, -34372=>18390, -34373=>18391, -34374=>18392, -34375=>18393, -34376=>18394, -34377=>18395, -34378=>18396, -34379=>18397, -34380=>18398, -34386=>18399, -34387=>18400, -34390=>18401, -34391=>18402, -34392=>18403, -34393=>18404, -34395=>18405, -34397=>18406, -34400=>18407, -34401=>18408, -34403=>18409, -34404=>18410, -34405=>18411, -34406=>18412, -34408=>18413, -34409=>18414, -34410=>18415, -34413=>18416, -34415=>18417, -34416=>18418, -34418=>18419, -34419=>18420, -34420=>18421, -34421=>18422, -34422=>18423, -34423=>18424, -34424=>18425, -34435=>18426, -34436=>18427, -34437=>18428, -34438=>18429, -34439=>18430, -34440=>18431, -34441=>18432, -34446=>18433, -34447=>18434, -34448=>18435, -34449=>18436, -34450=>18437, -34452=>18438, -34454=>18439, -34455=>18440, -34456=>18441, -34457=>18442, -34458=>18443, -34459=>18444, -34462=>18445, -34463=>18446, -34464=>18447, -34465=>18448, -34466=>18449, -34469=>18450, -34470=>18451, -34475=>18452, -34477=>18453, -34478=>18454, -34482=>18455, -34483=>18456, -34487=>18457, -34488=>18458, -34489=>18459, -34491=>18460, -34492=>18461, -34493=>18462, -34494=>18463, -34495=>18464, -34497=>18465, -34498=>18466, -34499=>18467, -34501=>18468, -34504=>18469, -34508=>18470, -34509=>18471, -34514=>18472, -34515=>18473, -34517=>18474, -34518=>18475, -34519=>18476, -34522=>18477, -34524=>18478, -34525=>18479, -34528=>18480, -34529=>18481, -34530=>18482, -34531=>18483, -34533=>18484, -34534=>18485, -34535=>18486, -34536=>18487, -34538=>18488, -34539=>18489, -34540=>18490, -34543=>18491, -34549=>18492, -34550=>18493, -34551=>18494, -34555=>18495, -34556=>18496, -34557=>18497, -34559=>18498, -34561=>18499, -34564=>18500, -34565=>18501, -34571=>18502, -34572=>18503, -34574=>18504, -34575=>18505, -34576=>18506, -34577=>18507, -34580=>18508, -34582=>18509, -34585=>18510, -34587=>18511, -34589=>18512, -34591=>18513, -34592=>18514, -34596=>18515, -34598=>18516, -34599=>18517, -34600=>18518, -34602=>18519, -34603=>18520, -34604=>18521, -34605=>18522, -34607=>18523, -34608=>18524, -34610=>18525, -34611=>18526, -34613=>18527, -34614=>18528, -34616=>18529, -34617=>18530, -34618=>18531, -34620=>18532, -34621=>18533, -34624=>18534, -34625=>18535, -34626=>18536, -34627=>18537, -34628=>18538, -34629=>18539, -34630=>18540, -34634=>18541, -34635=>18542, -34637=>18543, -34639=>18544, -34640=>18545, -34641=>18546, -34642=>18547, -34644=>18548, -34646=>18549, -34648=>18550, -34650=>18551, -34651=>18552, -34652=>18553, -34653=>18554, -34654=>18555, -34655=>18556, -34657=>18557, -34658=>18558, -34663=>18559, -34664=>18560, -34665=>18561, -34666=>18562, -34667=>18563, -34668=>18564, -34669=>18565, -34671=>18566, -34673=>18567, -34674=>18568, -34675=>18569, -34677=>18570, -34679=>18571, -34681=>18572, -34682=>18573, -34687=>18574, -34688=>18575, -34689=>18576, -34694=>18577, -34695=>18578, -34697=>18579, -34698=>18580, -34700=>18581, -34702=>18582, -34703=>18583, -34704=>18584, -34705=>18585, -34706=>18586, -34708=>18587, -34709=>18588, -34710=>18589, -34712=>18590, -34713=>18591, -34714=>18592, -34715=>18593, -34716=>18594, -34717=>18595, -34720=>18596, -34721=>18597, -34723=>18598, -34724=>18599, -34725=>18600, -34726=>18601, -34727=>18602, -34729=>18603, -34730=>18604, -34734=>18605, -34736=>18606, -34737=>18607, -34738=>18608, -34740=>18609, -34742=>18610, -34743=>18611, -34744=>18612, -34745=>18613, -34748=>18614, -34750=>18615, -34751=>18616, -34753=>18617, -34754=>18618, -34755=>18619, -34757=>18620, -34759=>18621, -34761=>18622, -34764=>18623, -34765=>18624, -34767=>18625, -34768=>18626, -34772=>18627, -34773=>18628, -34774=>18629, -34775=>18630, -34776=>18631, -34777=>18632, -34778=>18633, -34780=>18634, -34781=>18635, -34782=>18636, -34783=>18637, -34785=>18638, -34786=>18639, -34788=>18640, -34790=>18641, -34791=>18642, -34792=>18643, -34793=>18644, -34795=>18645, -34797=>18646, -34800=>18647, -34801=>18648, -34803=>18649, -34804=>18650, -34805=>18651, -34807=>18652, -34808=>18653, -34810=>18654, -34812=>18655, -34813=>18656, -34815=>18657, -34816=>18658, -34817=>18659, -34818=>18660, -34820=>18661, -34823=>18662, -34824=>18663, -34825=>18664, -34827=>18665, -34828=>18666, -34829=>18667, -34830=>18668, -34831=>18669, -34834=>18670, -34836=>18671, -34839=>18672, -34840=>18673, -34841=>18674, -34842=>18675, -34844=>18676, -34845=>18677, -34846=>18678, -34848=>18679, -34852=>18680, -34853=>18681, -34854=>18682, -34855=>18683, -34856=>18684, -34857=>18685, -34858=>18686, -34859=>18687, -34860=>18688, -34861=>18689, -34862=>18690, -34863=>18691, -34864=>18692, -34867=>18693, -34868=>18694, -34869=>18695, -34871=>18696, -34872=>18697, -34874=>18698, -34877=>18699, -34878=>18700, -34879=>18701, -34881=>18702, -34882=>18703, -34883=>18704, -34887=>18705, -34888=>18706, -34889=>18707, -34891=>18708, -34894=>18709, -34895=>18710, -34896=>18711, -34897=>18712, -34898=>18713, -34901=>18714, -34902=>18715, -34904=>18716, -34906=>18717, -34908=>18718, -34910=>18719, -34911=>18720, -34912=>18721, -34918=>18722, -34919=>18723, -34922=>18724, -34925=>18725, -34927=>18726, -34929=>18727, -34931=>18728, -34932=>18729, -34933=>18730, -34934=>18731, -34936=>18732, -34938=>18733, -34939=>18734, -34940=>18735, -34944=>18736, -34947=>18737, -34950=>18738, -34951=>18739, -34953=>18740, -34954=>18741, -34956=>18742, -34958=>18743, -34959=>18744, -34960=>18745, -34961=>18746, -34963=>18747, -34964=>18748, -34965=>18749, -34967=>18750, -34968=>18751, -34969=>18752, -34970=>18753, -34971=>18754, -34973=>18755, -34974=>18756, -34975=>18757, -34976=>18758, -34977=>18759, -34979=>18760, -34981=>18761, -34982=>18762, -34983=>18763, -34984=>18764, -34985=>18765, -34986=>18766, -34988=>18767, -34990=>18768, -34991=>18769, -34992=>18770, -34994=>18771, -34995=>18772, -34996=>18773, -34997=>18774, -34998=>18775, -35000=>18776, -35001=>18777, -35002=>18778, -35003=>18779, -35005=>18780, -35006=>18781, -35007=>18782, -35008=>18783, -35011=>18784, -35012=>18785, -35015=>18786, -35016=>18787, -35019=>18788, -35020=>18789, -35021=>18790, -35024=>18791, -35025=>18792, -35027=>18793, -35030=>18794, -35031=>18795, -35034=>18796, -35035=>18797, -35038=>18798, -35040=>18799, -35041=>18800, -35046=>18801, -35047=>18802, -35049=>18803, -35050=>18804, -35051=>18805, -35052=>18806, -35053=>18807, -35054=>18808, -35055=>18809, -35058=>18810, -35061=>18811, -35062=>18812, -35063=>18813, -35066=>18814, -35067=>18815, -35071=>18816, -35072=>18817, -35073=>18818, -35075=>18819, -35076=>18820, -35077=>18821, -35078=>18822, -35080=>18823, -35081=>18824, -35083=>18825, -35084=>18826, -35085=>18827, -35086=>18828, -35087=>18829, -35089=>18830, -35092=>18831, -35093=>18832, -35094=>18833, -35095=>18834, -35096=>18835, -35100=>18836, -35101=>18837, -35102=>18838, -35103=>18839, -35104=>18840, -35106=>18841, -35107=>18842, -35108=>18843, -35110=>18844, -35111=>18845, -35112=>18846, -35113=>18847, -35116=>18848, -35117=>18849, -35118=>18850, -35119=>18851, -35121=>18852, -35125=>18853, -35127=>18854, -35129=>18855, -35130=>18856, -35132=>18857, -35133=>18858, -35134=>18859, -35135=>18860, -35136=>18861, -35138=>18862, -35139=>18863, -35141=>18864, -35142=>18865, -35144=>18866, -35145=>18867, -35146=>18868, -35147=>18869, -35148=>18870, -35149=>18871, -35150=>18872, -35151=>18873, -35152=>18874, -35153=>18875, -35154=>18876, -35155=>18877, -35156=>18878, -35157=>18879, -35159=>18880, -35160=>18881, -35161=>18882, -35162=>18883, -35163=>18884, -35164=>18885, -35169=>18886, -35170=>18887, -35171=>18888, -35173=>18889, -35175=>18890, -35176=>18891, -35177=>18892, -35179=>18893, -35181=>18894, -35182=>18895, -35184=>18896, -35185=>18897, -35187=>18898, -35188=>18899, -35189=>18900, -35190=>18901, -35191=>18902, -35192=>18903, -35193=>18904, -35194=>18905, -35196=>18906, -35197=>18907, -12177=>18908, -35198=>18908, -35200=>18909, -35202=>18910, -35204=>18911, -35205=>18912, -35207=>18913, -35208=>18914, -35209=>18915, -35210=>18916, -35212=>18917, -35213=>18918, -35214=>18919, -35216=>18920, -35217=>18921, -35218=>18922, -35220=>18923, -35221=>18924, -35223=>18925, -35225=>18926, -35226=>18927, -35227=>18928, -35228=>18929, -35229=>18930, -35230=>18931, -35231=>18932, -35232=>18933, -35234=>18934, -35235=>18935, -35236=>18936, -35237=>18937, -35239=>18938, -35240=>18939, -35241=>18940, -35243=>18941, -35245=>18942, -35246=>18943, -35248=>18944, -35249=>18945, -35251=>18946, -35252=>18947, -35253=>18948, -35254=>18949, -35256=>18950, -35257=>18951, -35259=>18952, -35260=>18953, -35262=>18954, -35267=>18955, -35277=>18956, -35283=>18957, -35284=>18958, -35285=>18959, -35287=>18960, -35288=>18961, -35289=>18962, -35291=>18963, -35293=>18964, -35295=>18965, -35296=>18966, -35297=>18967, -35298=>18968, -35300=>18969, -35303=>18970, -35304=>18971, -35305=>18972, -35306=>18973, -35308=>18974, -35309=>18975, -35310=>18976, -35312=>18977, -35313=>18978, -35314=>18979, -35317=>18980, -35319=>18981, -35321=>18982, -35322=>18983, -35323=>18984, -35324=>18985, -35325=>18986, -35326=>18987, -35327=>18988, -35332=>18989, -35333=>18990, -35334=>18991, -35337=>18992, -35339=>18993, -35341=>18994, -35343=>18995, -35345=>18996, -35346=>18997, -35348=>18998, -35351=>18999, -35353=>19000, -35354=>19001, -35356=>19002, -35358=>19003, -35360=>19004, -35361=>19005, -35362=>19006, -35364=>19007, -35366=>19008, -35367=>19009, -35368=>19010, -35369=>19011, -35371=>19012, -35372=>19013, -35374=>19014, -35375=>19015, -35376=>19016, -35378=>19017, -35379=>19018, -35381=>19019, -35383=>19020, -35384=>19021, -35385=>19022, -35387=>19023, -35388=>19024, -35389=>19025, -35391=>19026, -35392=>19027, -35394=>19028, -35395=>19029, -35396=>19030, -35397=>19031, -35399=>19032, -35401=>19033, -35402=>19034, -35403=>19035, -35404=>19036, -35405=>19037, -35407=>19038, -35409=>19039, -35411=>19040, -35414=>19041, -35415=>19042, -35417=>19043, -35418=>19044, -35420=>19045, -35421=>19046, -35423=>19047, -35424=>19048, -35428=>19049, -35429=>19050, -35431=>19051, -35432=>19052, -35434=>19053, -35439=>19054, -35444=>19055, -35446=>19056, -35447=>19057, -35448=>19058, -35450=>19059, -35451=>19060, -35453=>19061, -35454=>19062, -35456=>19063, -35457=>19064, -35458=>19065, -35459=>19066, -35464=>19067, -35467=>19068, -35468=>19069, -35470=>19070, -35471=>19071, -35472=>19072, -35476=>19073, -35478=>19074, -35479=>19075, -35481=>19076, -35483=>19077, -35484=>19078, -35485=>19079, -35487=>19080, -35490=>19081, -35495=>19082, -35497=>19083, -35498=>19084, -35499=>19085, -35501=>19086, -35502=>19087, -35503=>19088, -35505=>19089, -35507=>19090, -35508=>19091, -35509=>19092, -35511=>19093, -35512=>19094, -35514=>19095, -35515=>19096, -35517=>19097, -35518=>19098, -35520=>19099, -35521=>19100, -35523=>19101, -35525=>19102, -35526=>19103, -35528=>19104, -35530=>19105, -35532=>19106, -35534=>19107, -35536=>19108, -35539=>19109, -35540=>19110, -35541=>19111, -35544=>19112, -35545=>19113, -35546=>19114, -35549=>19115, -35551=>19116, -35552=>19117, -35553=>19118, -35555=>19119, -35557=>19120, -35560=>19121, -35561=>19122, -35562=>19123, -35564=>19124, -35567=>19125, -35568=>19126, -35570=>19127, -35572=>19128, -35573=>19129, -35577=>19130, -35579=>19131, -35581=>19132, -35583=>19133, -35587=>19134, -35590=>19135, -35592=>19136, -35593=>19137, -35595=>19138, -35596=>19139, -35597=>19140, -35599=>19141, -35601=>19142, -35602=>19143, -35603=>19144, -35605=>19145, -35608=>19146, -35612=>19147, -35614=>19148, -35615=>19149, -35616=>19150, -35618=>19151, -35619=>19152, -35620=>19153, -35621=>19154, -35623=>19155, -35625=>19156, -35626=>19157, -35630=>19158, -35631=>19159, -35632=>19160, -35633=>19161, -35634=>19162, -35636=>19163, -35637=>19164, -35638=>19165, -35639=>19166, -35640=>19167, -35642=>19168, -35643=>19169, -35644=>19170, -35645=>19171, -35647=>19172, -35648=>19173, -35649=>19174, -35650=>19175, -35651=>19176, -35652=>19177, -35653=>19178, -35654=>19179, -35655=>19180, -35656=>19181, -35658=>19182, -35659=>19183, -35660=>19184, -35661=>19185, -35664=>19186, -35665=>19187, -35666=>19188, -35667=>19189, -35668=>19190, -35669=>19191, -35671=>19192, -35675=>19193, -35677=>19194, -35678=>19195, -35679=>19196, -35680=>19197, -35681=>19198, -35682=>19199, -35683=>19200, -35684=>19201, -35685=>19202, -35687=>19203, -35688=>19204, -35689=>19205, -35690=>19206, -35693=>19207, -35694=>19208, -35697=>19209, -35698=>19210, -35699=>19211, -35701=>19212, -35702=>19213, -35704=>19214, -35705=>19215, -35706=>19216, -35707=>19217, -35708=>19218, -35710=>19219, -35711=>19220, -35713=>19221, -35714=>19222, -35715=>19223, -35716=>19224, -35717=>19225, -35718=>19226, -35719=>19227, -35720=>19228, -35721=>19229, -35723=>19230, -35724=>19231, -35725=>19232, -35727=>19233, -35728=>19234, -35729=>19235, -35732=>19236, -35735=>19237, -35736=>19238, -35737=>19239, -35738=>19240, -35739=>19241, -35741=>19242, -35743=>19243, -35756=>19244, -35761=>19245, -35771=>19246, -35783=>19247, -35792=>19248, -35818=>19249, -35849=>19250, -35870=>19251, -35896=>19252, -35897=>19253, -35898=>19254, -35899=>19255, -35900=>19256, -35901=>19257, -35902=>19258, -35903=>19259, -35904=>19260, -35906=>19261, -35907=>19262, -35908=>19263, -35909=>19264, -35914=>19265, -35915=>19266, -35917=>19267, -35918=>19268, -35919=>19269, -35921=>19270, -35922=>19271, -35923=>19272, -35924=>19273, -35926=>19274, -35927=>19275, -35928=>19276, -35929=>19277, -35931=>19278, -35932=>19279, -35933=>19280, -35934=>19281, -35935=>19282, -35936=>19283, -35939=>19284, -35940=>19285, -35941=>19286, -35942=>19287, -35943=>19288, -35944=>19289, -35945=>19290, -35948=>19291, -35949=>19292, -35950=>19293, -35951=>19294, -35952=>19295, -35953=>19296, -35954=>19297, -35956=>19298, -35957=>19299, -35958=>19300, -35959=>19301, -35963=>19302, -35964=>19303, -35965=>19304, -35966=>19305, -35967=>19306, -35968=>19307, -35969=>19308, -35971=>19309, -35972=>19310, -35974=>19311, -35975=>19312, -35976=>19313, -35979=>19314, -35981=>19315, -35982=>19316, -35983=>19317, -35984=>19318, -35985=>19319, -35986=>19320, -35987=>19321, -35989=>19322, -35990=>19323, -35991=>19324, -35993=>19325, -35994=>19326, -35995=>19327, -35996=>19328, -35999=>19329, -36003=>19330, -36004=>19331, -36005=>19332, -36006=>19333, -36013=>19334, -36014=>19335, -36017=>19336, -36021=>19337, -36025=>19338, -36030=>19339, -36038=>19340, -36041=>19341, -36043=>19342, -36044=>19343, -36045=>19344, -36046=>19345, -36047=>19346, -36048=>19347, -36052=>19348, -36054=>19349, -36055=>19350, -36056=>19351, -36057=>19352, -36059=>19353, -36061=>19354, -36063=>19355, -36069=>19356, -36072=>19357, -36073=>19358, -36078=>19359, -36079=>19360, -36080=>19361, -36081=>19362, -36082=>19363, -36083=>19364, -36085=>19365, -36086=>19366, -36087=>19367, -36088=>19368, -36089=>19369, -36095=>19370, -36096=>19371, -36097=>19372, -36098=>19373, -36099=>19374, -36102=>19375, -36103=>19376, -36105=>19377, -36108=>19378, -36110=>19379, -36113=>19380, -36114=>19381, -36115=>19382, -36116=>19383, -36117=>19384, -36119=>19385, -36120=>19386, -36121=>19387, -36122=>19388, -36128=>19389, -36177=>19390, -36178=>19391, -36183=>19392, -36191=>19393, -36197=>19394, -36200=>19395, -36201=>19396, -36202=>19397, -36204=>19398, -36206=>19399, -36207=>19400, -36209=>19401, -36210=>19402, -36216=>19403, -36217=>19404, -36218=>19405, -36219=>19406, -36220=>19407, -36221=>19408, -36222=>19409, -36223=>19410, -36224=>19411, -36226=>19412, -36227=>19413, -36230=>19414, -36231=>19415, -36232=>19416, -36233=>19417, -36236=>19418, -36237=>19419, -36238=>19420, -36239=>19421, -36240=>19422, -36242=>19423, -36243=>19424, -36246=>19425, -36247=>19426, -36248=>19427, -36250=>19428, -36251=>19429, -36252=>19430, -36253=>19431, -36254=>19432, -36256=>19433, -36257=>19434, -36258=>19435, -36260=>19436, -36261=>19437, -36262=>19438, -36263=>19439, -36265=>19440, -36266=>19441, -36267=>19442, -36268=>19443, -36269=>19444, -36270=>19445, -36271=>19446, -36272=>19447, -36278=>19448, -36279=>19449, -36281=>19450, -36283=>19451, -36285=>19452, -36288=>19453, -36289=>19454, -36290=>19455, -36293=>19456, -36295=>19457, -36296=>19458, -36297=>19459, -36298=>19460, -36301=>19461, -36304=>19462, -36306=>19463, -36307=>19464, -36308=>19465, -36309=>19466, -36312=>19467, -36313=>19468, -36316=>19469, -36320=>19470, -36321=>19471, -36322=>19472, -36325=>19473, -36326=>19474, -36327=>19475, -36329=>19476, -36333=>19477, -36334=>19478, -36336=>19479, -36337=>19480, -36338=>19481, -36340=>19482, -36342=>19483, -36348=>19484, -36350=>19485, -36351=>19486, -36352=>19487, -36353=>19488, -36354=>19489, -36355=>19490, -36356=>19491, -36358=>19492, -36359=>19493, -36360=>19494, -36363=>19495, -36365=>19496, -36366=>19497, -36369=>19498, -36370=>19499, -36371=>19500, -36373=>19501, -36374=>19502, -36375=>19503, -36376=>19504, -36377=>19505, -36378=>19506, -36379=>19507, -36380=>19508, -36384=>19509, -36385=>19510, -36388=>19511, -36389=>19512, -36390=>19513, -36391=>19514, -36392=>19515, -36395=>19516, -36397=>19517, -36400=>19518, -36402=>19519, -36403=>19520, -36406=>19521, -36407=>19522, -36408=>19523, -36411=>19524, -36412=>19525, -36414=>19526, -36415=>19527, -36419=>19528, -36421=>19529, -36422=>19530, -36429=>19531, -36430=>19532, -36431=>19533, -36432=>19534, -36435=>19535, -36436=>19536, -36438=>19537, -36439=>19538, -36440=>19539, -36442=>19540, -36443=>19541, -36444=>19542, -36445=>19543, -36446=>19544, -36447=>19545, -36448=>19546, -36449=>19547, -36450=>19548, -36452=>19549, -36453=>19550, -36455=>19551, -36456=>19552, -36458=>19553, -36459=>19554, -36462=>19555, -36465=>19556, -36467=>19557, -36469=>19558, -36471=>19559, -36472=>19560, -36473=>19561, -36475=>19562, -36477=>19563, -36478=>19564, -36480=>19565, -36482=>19566, -36483=>19567, -36484=>19568, -36486=>19569, -36488=>19570, -36492=>19571, -36494=>19572, -36501=>19573, -36502=>19574, -36503=>19575, -36504=>19576, -36505=>19577, -36507=>19578, -36509=>19579, -36511=>19580, -36512=>19581, -36514=>19582, -36515=>19583, -36516=>19584, -36519=>19585, -36520=>19586, -36521=>19587, -36525=>19588, -36526=>19589, -36528=>19590, -36529=>19591, -36531=>19592, -36532=>19593, -36533=>19594, -36534=>19595, -36535=>19596, -36536=>19597, -36537=>19598, -36539=>19599, -36540=>19600, -36541=>19601, -36542=>19602, -36543=>19603, -36545=>19604, -36546=>19605, -36547=>19606, -36548=>19607, -36549=>19608, -36550=>19609, -36551=>19610, -36552=>19611, -36553=>19612, -36559=>19613, -36560=>19614, -36561=>19615, -36563=>19616, -36565=>19617, -36566=>19618, -36567=>19619, -36568=>19620, -36569=>19621, -36570=>19622, -36572=>19623, -36573=>19624, -36574=>19625, -36576=>19626, -36577=>19627, -36578=>19628, -36579=>19629, -36581=>19630, -36582=>19631, -36583=>19632, -36584=>19633, -36585=>19634, -36586=>19635, -36588=>19636, -36589=>19637, -36590=>19638, -36591=>19639, -36592=>19640, -36593=>19641, -36595=>19642, -36596=>19643, -36597=>19644, -36598=>19645, -36599=>19646, -36605=>19647, -36607=>19648, -36608=>19649, -36609=>19650, -36610=>19651, -36612=>19652, -36614=>19653, -36616=>19654, -36619=>19655, -36620=>19656, -36621=>19657, -36622=>19658, -36623=>19659, -36624=>19660, -36625=>19661, -36627=>19662, -36630=>19663, -36631=>19664, -36632=>19665, -36633=>19666, -36634=>19667, -36640=>19668, -36641=>19669, -36642=>19670, -36643=>19671, -36644=>19672, -36647=>19673, -36648=>19674, -36651=>19675, -36652=>19676, -36653=>19677, -36654=>19678, -36656=>19679, -36657=>19680, -36658=>19681, -36660=>19682, -36661=>19683, -36662=>19684, -36663=>19685, -36665=>19686, -36666=>19687, -36668=>19688, -36669=>19689, -36672=>19690, -36673=>19691, -36675=>19692, -36679=>19693, -36680=>19694, -36682=>19695, -36683=>19696, -36684=>19697, -36687=>19698, -36688=>19699, -36689=>19700, -36690=>19701, -36691=>19702, -36693=>19703, -36694=>19704, -36695=>19705, -36696=>19706, -36697=>19707, -36698=>19708, -36699=>19709, -36700=>19710, -36701=>19711, -36702=>19712, -36704=>19713, -36707=>19714, -36709=>19715, -36714=>19716, -36736=>19717, -36748=>19718, -36754=>19719, -36765=>19720, -36768=>19721, -36769=>19722, -36770=>19723, -36772=>19724, -36773=>19725, -36775=>19726, -36778=>19727, -36780=>19728, -36787=>19729, -36788=>19730, -12193=>19731, -36789=>19731, -36791=>19732, -36792=>19733, -36794=>19734, -36795=>19735, -36796=>19736, -36799=>19737, -36800=>19738, -36803=>19739, -36806=>19740, -36809=>19741, -36810=>19742, -36811=>19743, -36812=>19744, -36813=>19745, -36815=>19746, -36818=>19747, -36822=>19748, -36823=>19749, -36826=>19750, -36832=>19751, -36833=>19752, -36835=>19753, -36839=>19754, -36844=>19755, -36847=>19756, -36849=>19757, -36850=>19758, -36853=>19759, -36854=>19760, -36858=>19761, -36859=>19762, -36860=>19763, -36862=>19764, -36863=>19765, -36871=>19766, -36872=>19767, -36876=>19768, -36878=>19769, -36883=>19770, -36888=>19771, -36892=>19772, -36900=>19773, -36901=>19774, -36903=>19775, -36904=>19776, -36905=>19777, -36906=>19778, -36907=>19779, -36908=>19780, -36912=>19781, -36913=>19782, -36915=>19783, -36916=>19784, -36919=>19785, -36921=>19786, -36922=>19787, -36925=>19788, -36927=>19789, -36928=>19790, -36931=>19791, -36933=>19792, -36934=>19793, -36936=>19794, -36937=>19795, -36938=>19796, -36940=>19797, -36950=>19798, -36953=>19799, -36954=>19800, -36957=>19801, -36959=>19802, -36961=>19803, -36964=>19804, -36966=>19805, -36967=>19806, -36970=>19807, -36971=>19808, -36972=>19809, -36975=>19810, -36976=>19811, -36977=>19812, -36979=>19813, -36982=>19814, -36985=>19815, -36987=>19816, -36990=>19817, -36997=>19818, -36998=>19819, -37001=>19820, -37004=>19821, -37005=>19822, -37006=>19823, -37010=>19824, -37012=>19825, -37014=>19826, -37016=>19827, -37018=>19828, -37020=>19829, -37022=>19830, -37023=>19831, -37024=>19832, -37028=>19833, -37029=>19834, -37031=>19835, -37032=>19836, -37033=>19837, -37035=>19838, -37037=>19839, -37042=>19840, -37047=>19841, -37052=>19842, -37053=>19843, -37055=>19844, -37056=>19845, -37058=>19846, -37059=>19847, -37062=>19848, -37064=>19849, -37065=>19850, -37067=>19851, -37068=>19852, -37069=>19853, -37074=>19854, -37076=>19855, -37077=>19856, -37078=>19857, -37080=>19858, -37081=>19859, -37082=>19860, -37086=>19861, -37088=>19862, -37091=>19863, -37092=>19864, -37093=>19865, -37097=>19866, -37098=>19867, -37100=>19868, -37102=>19869, -37104=>19870, -37105=>19871, -37106=>19872, -37107=>19873, -37110=>19874, -37111=>19875, -37113=>19876, -37114=>19877, -37115=>19878, -37116=>19879, -37119=>19880, -37120=>19881, -37121=>19882, -37123=>19883, -37125=>19884, -37127=>19885, -37128=>19886, -37130=>19887, -37131=>19888, -37132=>19889, -37133=>19890, -37134=>19891, -37135=>19892, -37136=>19893, -37137=>19894, -37139=>19895, -37141=>19896, -37143=>19897, -37144=>19898, -37146=>19899, -37147=>19900, -37148=>19901, -37149=>19902, -37151=>19903, -37152=>19904, -37153=>19905, -37156=>19906, -37157=>19907, -37158=>19908, -37160=>19909, -37161=>19910, -37162=>19911, -37163=>19912, -37164=>19913, -37166=>19914, -37171=>19915, -37173=>19916, -37175=>19917, -37176=>19918, -37179=>19919, -37180=>19920, -37181=>19921, -37182=>19922, -37183=>19923, -37184=>19924, -37185=>19925, -37186=>19926, -37188=>19927, -37189=>19928, -37191=>19929, -37201=>19930, -37203=>19931, -37204=>19932, -37205=>19933, -37206=>19934, -37208=>19935, -37209=>19936, -37211=>19937, -37212=>19938, -37215=>19939, -37216=>19940, -37222=>19941, -37223=>19942, -37224=>19943, -37227=>19944, -37229=>19945, -37235=>19946, -37242=>19947, -37243=>19948, -37244=>19949, -37248=>19950, -37249=>19951, -37250=>19952, -37251=>19953, -37252=>19954, -37254=>19955, -37256=>19956, -37258=>19957, -37262=>19958, -37263=>19959, -37267=>19960, -37268=>19961, -37269=>19962, -37271=>19963, -37272=>19964, -37273=>19965, -37277=>19966, -37278=>19967, -37279=>19968, -37280=>19969, -37281=>19970, -37284=>19971, -37285=>19972, -37286=>19973, -37287=>19974, -37288=>19975, -37289=>19976, -37296=>19977, -37297=>19978, -37298=>19979, -37299=>19980, -37302=>19981, -37303=>19982, -37304=>19983, -37305=>19984, -37307=>19985, -37308=>19986, -37309=>19987, -37310=>19988, -37311=>19989, -37314=>19990, -37316=>19991, -12196=>19992, -37318=>19992, -37320=>19993, -37328=>19994, -37334=>19995, -37338=>19996, -37339=>19997, -37342=>19998, -37343=>19999, -37344=>20000, -37345=>20001, -37346=>20002, -37349=>20003, -37350=>20004, -37352=>20005, -37354=>20006, -37355=>20007, -37356=>20008, -37357=>20009, -37358=>20010, -37359=>20011, -37360=>20012, -37361=>20013, -37362=>20014, -37363=>20015, -37364=>20016, -37366=>20017, -37368=>20018, -37371=>20019, -37372=>20020, -37373=>20021, -37374=>20022, -37375=>20023, -37378=>20024, -37379=>20025, -37381=>20026, -37382=>20027, -37383=>20028, -37386=>20029, -37387=>20030, -37388=>20031, -37391=>20032, -37394=>20033, -37395=>20034, -37398=>20035, -37399=>20036, -37400=>20037, -37401=>20038, -37402=>20039, -37403=>20040, -37404=>20041, -37405=>20042, -37407=>20043, -37408=>20044, -37409=>20045, -37410=>20046, -37412=>20047, -37416=>20048, -37417=>20049, -37418=>20050, -37419=>20051, -37420=>20052, -37421=>20053, -37423=>20054, -37425=>20055, -37426=>20056, -37429=>20057, -37430=>20058, -37435=>20059, -37436=>20060, -37441=>20061, -37442=>20062, -37443=>20063, -37444=>20064, -37446=>20065, -37447=>20066, -37450=>20067, -37451=>20068, -37452=>20069, -37454=>20070, -37455=>20071, -37456=>20072, -37458=>20073, -37459=>20074, -37460=>20075, -37462=>20076, -37464=>20077, -37465=>20078, -37468=>20079, -37469=>20080, -37471=>20081, -37472=>20082, -37473=>20083, -37475=>20084, -37476=>20085, -37477=>20086, -37479=>20087, -37480=>20088, -37481=>20089, -37482=>20090, -37483=>20091, -37486=>20092, -37487=>20093, -37488=>20094, -37489=>20095, -37490=>20096, -37491=>20097, -37493=>20098, -37494=>20099, -37495=>20100, -37497=>20101, -37500=>20102, -37501=>20103, -37502=>20104, -37505=>20105, -37506=>20106, -37508=>20107, -37510=>20108, -37511=>20109, -37512=>20110, -37513=>20111, -37514=>20112, -37515=>20113, -37516=>20114, -37517=>20115, -37519=>20116, -37520=>20117, -37522=>20118, -37524=>20119, -37525=>20120, -37527=>20121, -37529=>20122, -37531=>20123, -37533=>20124, -37534=>20125, -37535=>20126, -37537=>20127, -37538=>20128, -37540=>20129, -37543=>20130, -37549=>20131, -37551=>20132, -37552=>20133, -37554=>20134, -37555=>20135, -37556=>20136, -37557=>20137, -37558=>20138, -37560=>20139, -37562=>20140, -37565=>20141, -37566=>20142, -37567=>20143, -37568=>20144, -37570=>20145, -37572=>20146, -37574=>20147, -37577=>20148, -37578=>20149, -37579=>20150, -37581=>20151, -37582=>20152, -37584=>20153, -37585=>20154, -37587=>20155, -37588=>20156, -37589=>20157, -37590=>20158, -37591=>20159, -37592=>20160, -37593=>20161, -37594=>20162, -37595=>20163, -37596=>20164, -37598=>20165, -37600=>20166, -37601=>20167, -37602=>20168, -37607=>20169, -37609=>20170, -37611=>20171, -37612=>20172, -37618=>20173, -37619=>20174, -37620=>20175, -37621=>20176, -37623=>20177, -37625=>20178, -37626=>20179, -37627=>20180, -37629=>20181, -37630=>20182, -37631=>20183, -37632=>20184, -37634=>20185, -37635=>20186, -37636=>20187, -37637=>20188, -37641=>20189, -37642=>20190, -37643=>20191, -37644=>20192, -37645=>20193, -37646=>20194, -37647=>20195, -37649=>20196, -37651=>20197, -37652=>20198, -37654=>20199, -37655=>20200, -37660=>20201, -37661=>20202, -37662=>20203, -37665=>20204, -37667=>20205, -37668=>20206, -37669=>20207, -37671=>20208, -37673=>20209, -37674=>20210, -37676=>20211, -37677=>20212, -37680=>20213, -37681=>20214, -37684=>20215, -37685=>20216, -37687=>20217, -37689=>20218, -37690=>20219, -37691=>20220, -37692=>20221, -37693=>20222, -37695=>20223, -37698=>20224, -37700=>20225, -37701=>20226, -37704=>20227, -37705=>20228, -37706=>20229, -37708=>20230, -37710=>20231, -37711=>20232, -37712=>20233, -37713=>20234, -37714=>20235, -37715=>20236, -37717=>20237, -37718=>20238, -37719=>20239, -37721=>20240, -37722=>20241, -37724=>20242, -37725=>20243, -37726=>20244, -37727=>20245, -37728=>20246, -37729=>20247, -37730=>20248, -37731=>20249, -37734=>20250, -37735=>20251, -37736=>20252, -37739=>20253, -37741=>20254, -37742=>20255, -37743=>20256, -37745=>20257, -37746=>20258, -37747=>20259, -37748=>20260, -37751=>20261, -37752=>20262, -37753=>20263, -37755=>20264, -37756=>20265, -37757=>20266, -37759=>20267, -37760=>20268, -37761=>20269, -37763=>20270, -37765=>20271, -37766=>20272, -37768=>20273, -37769=>20274, -37771=>20275, -37772=>20276, -37773=>20277, -37774=>20278, -37776=>20279, -37777=>20280, -37778=>20281, -37779=>20282, -37780=>20283, -37781=>20284, -37783=>20285, -37785=>20286, -37786=>20287, -37787=>20288, -37788=>20289, -37789=>20290, -37790=>20291, -37791=>20292, -37792=>20293, -37793=>20294, -37796=>20295, -37797=>20296, -37800=>20297, -37803=>20298, -37805=>20299, -37807=>20300, -37809=>20301, -37810=>20302, -37812=>20303, -37814=>20304, -37815=>20305, -37817=>20306, -37818=>20307, -37819=>20308, -37820=>20309, -37821=>20310, -37822=>20311, -37824=>20312, -37825=>20313, -37826=>20314, -37828=>20315, -37829=>20316, -37830=>20317, -37833=>20318, -37835=>20319, -37838=>20320, -37839=>20321, -37840=>20322, -37842=>20323, -37843=>20324, -37844=>20325, -37845=>20326, -37849=>20327, -37850=>20328, -37851=>20329, -37856=>20330, -37859=>20331, -37861=>20332, -37862=>20333, -37863=>20334, -37865=>20335, -37866=>20336, -37867=>20337, -37868=>20338, -37869=>20339, -37870=>20340, -37871=>20341, -37872=>20342, -37873=>20343, -37874=>20344, -37875=>20345, -37876=>20346, -37878=>20347, -37880=>20348, -37882=>20349, -37883=>20350, -37884=>20351, -37885=>20352, -37886=>20353, -37887=>20354, -37888=>20355, -37889=>20356, -37890=>20357, -37892=>20358, -37893=>20359, -37894=>20360, -37895=>20361, -37896=>20362, -37897=>20363, -37898=>20364, -37900=>20365, -37901=>20366, -37902=>20367, -37903=>20368, -37905=>20369, -37909=>20370, -37910=>20371, -37911=>20372, -37914=>20373, -37915=>20374, -37916=>20375, -37918=>20376, -37919=>20377, -37921=>20378, -37922=>20379, -37923=>20380, -37924=>20381, -37925=>20382, -37929=>20383, -37930=>20384, -37931=>20385, -37932=>20386, -37933=>20387, -37935=>20388, -37936=>20389, -37937=>20390, -37940=>20391, -37942=>20392, -37943=>20393, -37945=>20394, -37947=>20395, -37948=>20396, -37949=>20397, -37952=>20398, -37953=>20399, -37954=>20400, -37955=>20401, -37957=>20402, -37958=>20403, -37959=>20404, -37960=>20405, -37961=>20406, -37963=>20407, -37965=>20408, -37966=>20409, -37967=>20410, -37968=>20411, -37969=>20412, -37971=>20413, -37973=>20414, -37974=>20415, -37975=>20416, -37976=>20417, -37977=>20418, -37978=>20419, -37979=>20420, -37980=>20421, -37981=>20422, -37982=>20423, -37983=>20424, -37985=>20425, -37986=>20426, -37988=>20427, -37990=>20428, -37991=>20429, -37992=>20430, -37993=>20431, -37994=>20432, -37996=>20433, -37998=>20434, -37999=>20435, -38001=>20436, -38003=>20437, -38004=>20438, -38005=>20439, -38006=>20440, -38008=>20441, -38010=>20442, -38011=>20443, -38016=>20444, -38017=>20445, -38018=>20446, -38019=>20447, -38020=>20448, -38033=>20449, -38038=>20450, -38040=>20451, -38087=>20452, -38095=>20453, -38099=>20454, -38100=>20455, -38106=>20456, -38118=>20457, -38139=>20458, -38172=>20459, -38176=>20460, -38183=>20461, -38195=>20462, -38205=>20463, -38211=>20464, -38216=>20465, -38219=>20466, -38229=>20467, -38234=>20468, -38240=>20469, -38254=>20470, -38260=>20471, -38261=>20472, -38264=>20473, -38265=>20474, -38266=>20475, -38267=>20476, -38268=>20477, -38269=>20478, -38270=>20479, -38273=>20480, -38276=>20481, -38277=>20482, -38279=>20483, -38280=>20484, -38282=>20485, -38285=>20486, -38288=>20487, -38290=>20488, -38293=>20489, -38294=>20490, -38295=>20491, -38297=>20492, -38298=>20493, -38299=>20494, -38300=>20495, -38301=>20496, -38302=>20497, -38303=>20498, -38304=>20499, -38306=>20500, -38310=>20501, -38311=>20502, -38314=>20503, -38318=>20504, -38319=>20505, -38320=>20506, -38321=>20507, -38323=>20508, -38324=>20509, -38325=>20510, -38327=>20511, -38328=>20512, -38330=>20513, -38336=>20514, -38337=>20515, -38338=>20516, -38340=>20517, -38341=>20518, -38343=>20519, -38345=>20520, -38349=>20521, -38350=>20522, -38351=>20523, -38353=>20524, -38354=>20525, -38355=>20526, -38359=>20527, -38360=>20528, -38361=>20529, -38362=>20530, -38363=>20531, -38365=>20532, -38367=>20533, -38368=>20534, -38371=>20535, -38372=>20536, -38374=>20537, -38375=>20538, -38380=>20539, -38399=>20540, -38407=>20541, -38419=>20542, -38424=>20543, -38427=>20544, -38430=>20545, -38432=>20546, -38435=>20547, -38436=>20548, -38437=>20549, -38438=>20550, -38439=>20551, -38440=>20552, -38441=>20553, -38443=>20554, -38444=>20555, -38445=>20556, -38447=>20557, -38448=>20558, -38455=>20559, -38456=>20560, -38457=>20561, -38458=>20562, -38462=>20563, -38465=>20564, -38467=>20565, -38474=>20566, -38478=>20567, -38479=>20568, -38481=>20569, -38482=>20570, -38483=>20571, -38486=>20572, -38487=>20573, -38489=>20574, -38490=>20575, -38492=>20576, -38494=>20577, -38496=>20578, -38501=>20579, -38502=>20580, -38507=>20581, -38509=>20582, -38510=>20583, -38511=>20584, -38513=>20585, -38521=>20586, -38522=>20587, -38523=>20588, -38524=>20589, -38526=>20590, -38527=>20591, -38528=>20592, -38529=>20593, -38530=>20594, -38531=>20595, -38532=>20596, -38535=>20597, -38537=>20598, -38540=>20599, -38545=>20600, -38546=>20601, -38547=>20602, -38550=>20603, -38554=>20604, -38557=>20605, -38558=>20606, -38559=>20607, -38560=>20608, -38561=>20609, -38562=>20610, -63985=>20611, -38563=>20611, -38564=>20612, -38565=>20613, -38566=>20614, -38569=>20615, -38571=>20616, -38572=>20617, -38573=>20618, -38574=>20619, -38575=>20620, -38578=>20621, -38581=>20622, -38583=>20623, -38586=>20624, -38591=>20625, -38594=>20626, -38595=>20627, -38600=>20628, -38602=>20629, -38603=>20630, -38608=>20631, -38609=>20632, -38611=>20633, -38612=>20634, -38615=>20635, -38616=>20636, -38618=>20637, -38621=>20638, -38622=>20639, -38623=>20640, -38625=>20641, -38628=>20642, -38629=>20643, -38630=>20644, -38631=>20645, -38635=>20646, -38636=>20647, -38637=>20648, -38638=>20649, -38640=>20650, -38641=>20651, -38644=>20652, -38645=>20653, -38648=>20654, -38650=>20655, -38652=>20656, -38653=>20657, -38655=>20658, -38658=>20659, -38659=>20660, -38661=>20661, -38666=>20662, -38667=>20663, -38668=>20664, -38672=>20665, -38673=>20666, -38674=>20667, -38676=>20668, -38677=>20669, -38679=>20670, -38680=>20671, -38681=>20672, -38682=>20673, -38683=>20674, -38685=>20675, -38687=>20676, -38688=>20677, -38689=>20678, -38690=>20679, -38691=>20680, -38692=>20681, -38693=>20682, -38694=>20683, -38696=>20684, -38697=>20685, -38699=>20686, -38700=>20687, -38702=>20688, -38703=>20689, -38705=>20690, -38707=>20691, -38708=>20692, -38709=>20693, -38710=>20694, -38711=>20695, -38714=>20696, -38715=>20697, -38716=>20698, -38719=>20699, -38720=>20700, -38721=>20701, -38723=>20702, -38725=>20703, -38726=>20704, -38727=>20705, -38729=>20706, -38730=>20707, -38731=>20708, -38732=>20709, -38733=>20710, -38734=>20711, -38735=>20712, -38736=>20713, -12205=>20714, -38737=>20714, -38740=>20715, -38741=>20716, -38743=>20717, -38744=>20718, -38748=>20719, -38749=>20720, -38751=>20721, -38755=>20722, -38756=>20723, -38758=>20724, -38759=>20725, -38762=>20726, -38763=>20727, -38764=>20728, -38765=>20729, -38766=>20730, -38767=>20731, -38768=>20732, -38769=>20733, -38770=>20734, -38773=>20735, -38775=>20736, -38776=>20737, -38777=>20738, -38778=>20739, -38779=>20740, -38781=>20741, -38782=>20742, -38783=>20743, -38784=>20744, -38785=>20745, -38786=>20746, -38787=>20747, -38788=>20748, -38790=>20749, -38791=>20750, -38792=>20751, -38793=>20752, -38794=>20753, -38796=>20754, -38798=>20755, -38800=>20756, -38803=>20757, -38805=>20758, -38806=>20759, -38807=>20760, -38809=>20761, -38810=>20762, -38811=>20763, -38812=>20764, -38813=>20765, -38814=>20766, -38815=>20767, -38817=>20768, -38818=>20769, -38820=>20770, -38821=>20771, -38823=>20772, -38824=>20773, -38825=>20774, -38826=>20775, -38828=>20776, -38830=>20777, -38832=>20778, -38833=>20779, -38835=>20780, -38837=>20781, -38838=>20782, -38839=>20783, -38840=>20784, -38841=>20785, -38842=>20786, -38843=>20787, -38844=>20788, -38846=>20789, -38847=>20790, -38848=>20791, -38849=>20792, -38850=>20793, -38852=>20794, -38853=>20795, -38855=>20796, -38856=>20797, -38858=>20798, -38861=>20799, -38862=>20800, -38863=>20801, -38864=>20802, -38865=>20803, -38866=>20804, -38868=>20805, -38869=>20806, -38870=>20807, -38871=>20808, -38872=>20809, -38874=>20810, -38875=>20811, -38877=>20812, -38879=>20813, -38880=>20814, -38881=>20815, -38882=>20816, -38883=>20817, -38884=>20818, -38885=>20819, -38888=>20820, -38894=>20821, -38895=>20822, -38896=>20823, -38897=>20824, -38898=>20825, -38900=>20826, -38903=>20827, -38904=>20828, -38905=>20829, -38906=>20830, -38907=>20831, -38908=>20832, -38909=>20833, -38910=>20834, -38912=>20835, -38916=>20836, -38921=>20837, -38923=>20838, -38925=>20839, -38932=>20840, -38933=>20841, -38934=>20842, -38937=>20843, -38938=>20844, -38939=>20845, -38941=>20846, -38942=>20847, -38943=>20848, -38944=>20849, -38946=>20850, -38947=>20851, -38949=>20852, -38951=>20853, -38952=>20854, -38953=>20855, -38954=>20856, -38955=>20857, -38956=>20858, -38958=>20859, -38959=>20860, -38961=>20861, -38962=>20862, -38963=>20863, -38964=>20864, -38965=>20865, -38966=>20866, -38969=>20867, -38970=>20868, -38972=>20869, -38974=>20870, -38975=>20871, -38976=>20872, -38977=>20873, -38978=>20874, -38979=>20875, -38980=>20876, -38981=>20877, -38983=>20878, -38984=>20879, -38985=>20880, -38986=>20881, -38987=>20882, -38991=>20883, -38992=>20884, -38993=>20885, -38994=>20886, -38997=>20887, -38998=>20888, -38999=>20889, -39002=>20890, -39004=>20891, -39005=>20892, -39007=>20893, -39008=>20894, -39009=>20895, -39011=>20896, -39012=>20897, -39014=>20898, -39016=>20899, -39017=>20900, -39018=>20901, -39021=>20902, -39022=>20903, -39026=>20904, -39051=>20905, -39054=>20906, -39058=>20907, -39061=>20908, -39065=>20909, -39075=>20910, -39081=>20911, -39082=>20912, -39083=>20913, -39084=>20914, -39085=>20915, -39088=>20916, -39090=>20917, -39092=>20918, -39093=>20919, -39095=>20920, -39096=>20921, -39097=>20922, -39098=>20923, -39099=>20924, -39101=>20925, -39102=>20926, -39103=>20927, -39104=>20928, -39105=>20929, -39106=>20930, -39107=>20931, -39109=>20932, -39111=>20933, -39113=>20934, -39114=>20935, -39115=>20936, -39116=>20937, -39117=>20938, -39119=>20939, -39120=>20940, -39124=>20941, -39126=>20942, -39127=>20943, -39132=>20944, -39133=>20945, -39137=>20946, -39139=>20947, -39140=>20948, -39141=>20949, -39142=>20950, -39148=>20951, -39150=>20952, -39152=>20953, -39153=>20954, -39155=>20955, -39157=>20956, -39158=>20957, -39159=>20958, -39160=>20959, -39161=>20960, -39162=>20961, -39163=>20962, -39167=>20963, -39168=>20964, -39169=>20965, -39170=>20966, -39172=>20967, -39174=>20968, -39175=>20969, -39176=>20970, -39179=>20971, -39182=>20972, -39183=>20973, -39188=>20974, -39189=>20975, -39190=>20976, -39191=>20977, -39193=>20978, -39194=>20979, -39196=>20980, -39197=>20981, -39199=>20982, -39200=>20983, -39202=>20984, -39203=>20985, -39204=>20986, -39205=>20987, -39206=>20988, -39207=>20989, -39209=>20990, -39210=>20991, -39211=>20992, -39212=>20993, -39213=>20994, -39215=>20995, -39216=>20996, -39217=>20997, -39218=>20998, -39220=>20999, -39221=>21000, -39222=>21001, -39224=>21002, -39225=>21003, -39226=>21004, -39227=>21005, -39229=>21006, -39232=>21007, -39233=>21008, -39234=>21009, -39236=>21010, -39238=>21011, -39239=>21012, -39245=>21013, -39246=>21014, -39247=>21015, -39248=>21016, -39251=>21017, -39254=>21018, -39256=>21019, -39257=>21020, -39258=>21021, -39259=>21022, -39261=>21023, -39263=>21024, -39264=>21025, -39265=>21026, -39268=>21027, -39270=>21028, -39283=>21029, -39288=>21030, -39289=>21031, -39291=>21032, -39294=>21033, -39298=>21034, -39299=>21035, -39305=>21036, -39308=>21037, -39310=>21038, -39322=>21039, -39323=>21040, -39324=>21041, -39325=>21042, -39326=>21043, -39327=>21044, -39328=>21045, -39329=>21046, -39330=>21047, -39331=>21048, -39332=>21049, -39334=>21050, -39335=>21051, -39337=>21052, -39338=>21053, -39339=>21054, -39343=>21055, -39344=>21056, -39346=>21057, -39349=>21058, -39350=>21059, -39351=>21060, -39352=>21061, -39353=>21062, -39354=>21063, -39355=>21064, -39356=>21065, -39357=>21066, -39358=>21067, -39359=>21068, -39360=>21069, -39362=>21070, -39363=>21071, -39364=>21072, -39365=>21073, -39366=>21074, -39367=>21075, -39368=>21076, -39369=>21077, -39370=>21078, -39371=>21079, -39372=>21080, -39373=>21081, -39374=>21082, -39375=>21083, -39379=>21084, -39382=>21085, -39383=>21086, -39386=>21087, -39388=>21088, -39390=>21089, -39392=>21090, -39395=>21091, -39396=>21092, -39397=>21093, -39398=>21094, -39399=>21095, -39400=>21096, -39401=>21097, -39402=>21098, -39403=>21099, -39404=>21100, -39406=>21101, -39407=>21102, -39408=>21103, -39410=>21104, -39411=>21105, -39412=>21106, -39413=>21107, -39414=>21108, -39415=>21109, -39416=>21110, -39417=>21111, -39418=>21112, -39419=>21113, -39420=>21114, -39421=>21115, -39422=>21116, -39424=>21117, -39426=>21118, -39427=>21119, -39428=>21120, -39430=>21121, -39431=>21122, -39432=>21123, -39433=>21124, -39434=>21125, -39435=>21126, -39436=>21127, -39440=>21128, -39441=>21129, -39442=>21130, -39443=>21131, -39444=>21132, -39445=>21133, -39447=>21134, -39448=>21135, -39450=>21136, -39451=>21137, -39452=>21138, -39453=>21139, -39454=>21140, -39455=>21141, -39456=>21142, -39457=>21143, -39458=>21144, -39459=>21145, -39460=>21146, -39461=>21147, -39462=>21148, -39463=>21149, -39464=>21150, -39465=>21151, -39466=>21152, -39468=>21153, -39471=>21154, -39473=>21155, -39474=>21156, -39475=>21157, -39476=>21158, -39477=>21159, -39481=>21160, -39482=>21161, -39483=>21162, -39484=>21163, -39485=>21164, -39487=>21165, -39494=>21166, -39495=>21167, -39496=>21168, -39497=>21169, -39499=>21170, -39500=>21171, -39502=>21172, -39504=>21173, -39505=>21174, -39506=>21175, -39507=>21176, -39508=>21177, -39510=>21178, -39512=>21179, -39513=>21180, -39516=>21181, -39517=>21182, -39518=>21183, -39520=>21184, -39521=>21185, -39523=>21186, -39526=>21187, -39527=>21188, -39528=>21189, -39529=>21190, -39531=>21191, -39538=>21192, -39555=>21193, -39561=>21194, -39565=>21195, -39566=>21196, -39572=>21197, -39573=>21198, -39577=>21199, -39590=>21200, -39593=>21201, -39594=>21202, -39595=>21203, -39596=>21204, -39597=>21205, -39598=>21206, -39602=>21207, -39603=>21208, -39604=>21209, -39605=>21210, -39609=>21211, -39611=>21212, -39613=>21213, -39614=>21214, -39615=>21215, -39619=>21216, -39620=>21217, -39622=>21218, -39623=>21219, -39624=>21220, -39625=>21221, -39626=>21222, -39629=>21223, -39630=>21224, -39632=>21225, -39639=>21226, -39641=>21227, -39642=>21228, -39643=>21229, -39644=>21230, -39645=>21231, -39646=>21232, -39648=>21233, -39650=>21234, -39651=>21235, -39652=>21236, -39653=>21237, -39655=>21238, -39656=>21239, -39657=>21240, -39658=>21241, -39660=>21242, -39664=>21243, -39665=>21244, -39666=>21245, -39667=>21246, -39668=>21247, -39669=>21248, -39670=>21249, -39671=>21250, -39672=>21251, -39674=>21252, -39676=>21253, -39677=>21254, -39678=>21255, -39679=>21256, -39680=>21257, -39681=>21258, -39682=>21259, -39684=>21260, -39685=>21261, -39687=>21262, -39689=>21263, -39690=>21264, -39691=>21265, -39692=>21266, -39694=>21267, -39696=>21268, -39697=>21269, -39698=>21270, -39700=>21271, -39701=>21272, -39702=>21273, -39703=>21274, -39704=>21275, -39705=>21276, -39707=>21277, -39708=>21278, -39709=>21279, -39710=>21280, -39712=>21281, -39713=>21282, -39716=>21283, -39718=>21284, -39720=>21285, -39722=>21286, -39723=>21287, -39724=>21288, -39725=>21289, -39728=>21290, -39731=>21291, -39732=>21292, -39733=>21293, -39734=>21294, -39735=>21295, -39736=>21296, -39737=>21297, -39738=>21298, -39741=>21299, -39742=>21300, -39743=>21301, -39744=>21302, -39750=>21303, -39754=>21304, -39755=>21305, -39756=>21306, -39760=>21307, -39762=>21308, -39763=>21309, -39765=>21310, -39766=>21311, -39767=>21312, -39769=>21313, -39771=>21314, -39772=>21315, -39773=>21316, -39774=>21317, -39775=>21318, -39776=>21319, -39777=>21320, -39778=>21321, -39779=>21322, -39780=>21323, -39781=>21324, -39782=>21325, -39783=>21326, -39784=>21327, -39785=>21328, -39786=>21329, -39787=>21330, -39788=>21331, -39789=>21332, -39790=>21333, -39792=>21334, -39793=>21335, -39794=>21336, -39795=>21337, -39797=>21338, -39798=>21339, -39800=>21340, -39801=>21341, -39802=>21342, -39803=>21343, -39804=>21344, -39805=>21345, -39806=>21346, -39807=>21347, -39808=>21348, -39810=>21349, -39812=>21350, -39813=>21351, -39814=>21352, -39815=>21353, -39816=>21354, -39817=>21355, -39818=>21356, -39819=>21357, -39820=>21358, -39821=>21359, -39823=>21360, -39827=>21361, -39828=>21362, -39829=>21363, -39830=>21364, -39831=>21365, -39832=>21366, -39833=>21367, -39835=>21368, -39836=>21369, -39839=>21370, -39840=>21371, -39841=>21372, -39842=>21373, -39843=>21374, -39844=>21375, -39845=>21376, -39846=>21377, -39847=>21378, -39848=>21379, -39849=>21380, -39852=>21381, -39855=>21382, -39856=>21383, -39857=>21384, -39858=>21385, -39859=>21386, -39860=>21387, -39861=>21388, -39862=>21389, -39863=>21390, -39864=>21391, -39865=>21392, -39866=>21393, -39867=>21394, -39868=>21395, -39869=>21396, -39870=>21397, -39871=>21398, -39874=>21399, -39875=>21400, -39876=>21401, -39877=>21402, -39878=>21403, -39880=>21404, -39883=>21405, -39884=>21406, -39885=>21407, -39886=>21408, -39887=>21409, -39888=>21410, -39889=>21411, -39890=>21412, -39891=>21413, -39893=>21414, -39895=>21415, -39896=>21416, -39897=>21417, -39898=>21418, -39900=>21419, -39902=>21420, -39903=>21421, -39904=>21422, -39907=>21423, -39909=>21424, -39910=>21425, -39913=>21426, -39916=>21427, -39917=>21428, -39918=>21429, -39919=>21430, -39921=>21431, -39922=>21432, -39923=>21433, -39925=>21434, -39926=>21435, -39927=>21436, -39928=>21437, -39929=>21438, -39930=>21439, -39931=>21440, -39932=>21441, -39934=>21442, -39936=>21443, -39937=>21444, -39938=>21445, -39939=>21446, -39940=>21447, -39941=>21448, -39942=>21449, -39943=>21450, -39946=>21451, -39947=>21452, -39948=>21453, -39950=>21454, -39951=>21455, -39953=>21456, -39956=>21457, -39957=>21458, -39958=>21459, -39959=>21460, -39960=>21461, -39961=>21462, -39962=>21463, -39963=>21464, -39964=>21465, -39965=>21466, -39966=>21467, -39967=>21468, -39969=>21469, -39970=>21470, -39972=>21471, -39974=>21472, -39975=>21473, -39978=>21474, -39979=>21475, -39980=>21476, -39982=>21477, -39983=>21478, -39984=>21479, -39988=>21480, -39990=>21481, -39992=>21482, -39994=>21483, -39996=>21484, -39997=>21485, -39999=>21486, -40000=>21487, -40001=>21488, -40002=>21489, -40003=>21490, -40004=>21491, -40006=>21492, -40007=>21493, -40010=>21494, -40011=>21495, -40012=>21496, -40013=>21497, -40014=>21498, -40015=>21499, -40016=>21500, -40017=>21501, -40019=>21502, -40021=>21503, -40025=>21504, -40026=>21505, -40027=>21506, -40028=>21507, -40030=>21508, -40032=>21509, -40033=>21510, -40034=>21511, -40035=>21512, -40036=>21513, -40037=>21514, -40038=>21515, -40040=>21516, -40041=>21517, -40042=>21518, -40043=>21519, -40044=>21520, -40046=>21521, -40047=>21522, -40048=>21523, -40049=>21524, -40050=>21525, -40051=>21526, -40052=>21527, -40053=>21528, -40054=>21529, -40055=>21530, -40057=>21531, -40059=>21532, -40061=>21533, -40062=>21534, -40064=>21535, -40067=>21536, -40068=>21537, -40073=>21538, -40074=>21539, -40076=>21540, -40079=>21541, -40083=>21542, -40086=>21543, -40087=>21544, -40088=>21545, -40089=>21546, -40093=>21547, -40106=>21548, -40108=>21549, -40111=>21550, -40121=>21551, -40126=>21552, -40127=>21553, -40128=>21554, -40129=>21555, -40130=>21556, -40136=>21557, -40137=>21558, -40145=>21559, -40146=>21560, -40154=>21561, -40155=>21562, -40160=>21563, -40161=>21564, -40163=>21565, -40164=>21566, -40166=>21567, -40167=>21568, -40168=>21569, -40170=>21570, -40171=>21571, -40173=>21572, -40174=>21573, -40175=>21574, -40176=>21575, -40177=>21576, -40178=>21577, -40181=>21578, -40183=>21579, -40184=>21580, -40185=>21581, -40186=>21582, -40187=>21583, -40188=>21584, -40189=>21585, -40190=>21586, -40191=>21587, -40192=>21588, -40193=>21589, -40194=>21590, -40195=>21591, -40196=>21592, -40197=>21593, -40200=>21594, -40202=>21595, -40203=>21596, -40204=>21597, -40205=>21598, -40206=>21599, -40207=>21600, -40208=>21601, -40209=>21602, -40210=>21603, -40211=>21604, -40212=>21605, -40214=>21606, -40215=>21607, -40216=>21608, -40217=>21609, -40218=>21610, -40220=>21611, -40222=>21612, -40224=>21613, -40225=>21614, -40226=>21615, -40228=>21616, -40229=>21617, -40231=>21618, -40233=>21619, -40234=>21620, -40235=>21621, -40236=>21622, -40237=>21623, -40238=>21624, -40241=>21625, -40242=>21626, -40243=>21627, -40244=>21628, -40245=>21629, -40246=>21630, -40247=>21631, -40248=>21632, -40249=>21633, -40250=>21634, -40252=>21635, -40253=>21636, -40254=>21637, -40256=>21638, -40257=>21639, -40259=>21640, -40260=>21641, -40261=>21642, -40262=>21643, -40263=>21644, -40264=>21645, -40265=>21646, -40266=>21647, -40267=>21648, -40268=>21649, -40269=>21650, -40270=>21651, -40271=>21652, -40272=>21653, -40276=>21654, -40277=>21655, -40278=>21656, -40279=>21657, -40280=>21658, -40281=>21659, -40282=>21660, -40283=>21661, -40286=>21662, -40287=>21663, -40290=>21664, -40291=>21665, -40292=>21666, -40293=>21667, -40294=>21668, -40295=>21669, -40296=>21670, -40297=>21671, -40299=>21672, -40301=>21673, -40302=>21674, -40304=>21675, -40305=>21676, -40307=>21677, -40308=>21678, -40309=>21679, -40310=>21680, -40311=>21681, -40312=>21682, -40313=>21683, -40314=>21684, -40315=>21685, -40316=>21686, -40317=>21687, -40318=>21688, -40319=>21689, -40320=>21690, -40321=>21691, -40322=>21692, -40323=>21693, -40324=>21694, -40325=>21695, -40326=>21696, -40328=>21697, -40330=>21698, -40331=>21699, -40332=>21700, -40333=>21701, -40334=>21702, -40335=>21703, -40336=>21704, -40337=>21705, -40338=>21706, -40340=>21707, -40341=>21708, -40342=>21709, -40343=>21710, -40345=>21711, -40347=>21712, -40348=>21713, -40349=>21714, -40350=>21715, -40351=>21716, -40352=>21717, -40353=>21718, -40354=>21719, -40355=>21720, -40356=>21721, -40358=>21722, -40359=>21723, -40360=>21724, -40362=>21725, -40363=>21726, -40364=>21727, -40365=>21728, -40366=>21729, -40368=>21730, -40369=>21731, -40370=>21732, -40371=>21733, -40373=>21734, -40374=>21735, -40375=>21736, -40376=>21737, -40377=>21738, -40378=>21739, -40381=>21740, -40382=>21741, -40383=>21742, -40385=>21743, -40387=>21744, -40389=>21745, -40390=>21746, -40391=>21747, -40392=>21748, -40393=>21749, -40394=>21750, -40395=>21751, -40396=>21752, -40397=>21753, -40398=>21754, -40399=>21755, -40400=>21756, -40401=>21757, -40402=>21758, -40404=>21759, -40405=>21760, -40406=>21761, -40408=>21762, -40411=>21763, -40412=>21764, -40413=>21765, -40414=>21766, -40415=>21767, -40416=>21768, -40417=>21769, -40418=>21770, -40419=>21771, -40420=>21772, -40423=>21773, -40424=>21774, -40425=>21775, -40426=>21776, -40427=>21777, -40428=>21778, -40429=>21779, -40430=>21780, -40432=>21781, -40433=>21782, -40436=>21783, -40437=>21784, -40438=>21785, -40439=>21786, -40443=>21787, -40444=>21788, -40445=>21789, -40446=>21790, -40447=>21791, -40448=>21792, -40449=>21793, -40450=>21794, -40451=>21795, -40452=>21796, -40453=>21797, -40454=>21798, -40455=>21799, -40456=>21800, -40457=>21801, -40458=>21802, -40459=>21803, -40461=>21804, -40462=>21805, -40463=>21806, -40464=>21807, -40465=>21808, -40466=>21809, -40467=>21810, -40468=>21811, -40470=>21812, -40471=>21813, -40472=>21814, -40473=>21815, -40476=>21816, -40484=>21817, -40487=>21818, -40494=>21819, -40496=>21820, -40500=>21821, -40507=>21822, -40508=>21823, -40512=>21824, -40525=>21825, -40528=>21826, -40530=>21827, -40531=>21828, -40532=>21829, -40534=>21830, -40537=>21831, -40541=>21832, -40543=>21833, -40544=>21834, -40545=>21835, -40546=>21836, -40549=>21837, -40558=>21838, -40559=>21839, -40562=>21840, -40564=>21841, -40566=>21842, -40567=>21843, -40568=>21844, -40571=>21845, -40576=>21846, -40577=>21847, -40579=>21848, -40580=>21849, -40581=>21850, -40582=>21851, -40585=>21852, -40586=>21853, -40588=>21854, -40589=>21855, -40590=>21856, -40591=>21857, -40592=>21858, -40593=>21859, -40596=>21860, -40597=>21861, -40598=>21862, -40600=>21863, -40601=>21864, -40602=>21865, -40603=>21866, -40604=>21867, -40606=>21868, -40608=>21869, -40609=>21870, -40610=>21871, -40611=>21872, -40612=>21873, -40615=>21874, -40616=>21875, -40618=>21876, -40619=>21877, -40620=>21878, -40621=>21879, -40622=>21880, -40624=>21881, -40625=>21882, -40626=>21883, -40627=>21884, -40630=>21885, -40631=>21886, -40633=>21887, -40634=>21888, -40636=>21889, -40639=>21890, -40640=>21891, -40641=>21892, -40642=>21893, -12232=>21894, -40643=>21894, -40645=>21895, -40646=>21896, -40647=>21897, -40648=>21898, -40650=>21899, -40651=>21900, -40656=>21901, -40658=>21902, -40659=>21903, -40661=>21904, -40662=>21905, -40663=>21906, -40665=>21907, -40666=>21908, -40673=>21909, -40675=>21910, -40676=>21911, -40678=>21912, -40683=>21913, -40684=>21914, -40685=>21915, -40686=>21916, -40688=>21917, -40689=>21918, -40691=>21919, -40693=>21920, -40694=>21921, -40696=>21922, -40698=>21923, -40704=>21924, -40705=>21925, -40706=>21926, -40707=>21927, -40708=>21928, -40709=>21929, -40710=>21930, -40711=>21931, -40712=>21932, -40714=>21933, -40716=>21934, -40719=>21935, -40721=>21936, -40722=>21937, -40724=>21938, -40726=>21939, -40728=>21940, -40730=>21941, -40731=>21942, -40732=>21943, -40733=>21944, -40734=>21945, -40735=>21946, -40737=>21947, -40739=>21948, -40740=>21949, -40741=>21950, -40742=>21951, -40743=>21952, -40744=>21953, -40745=>21954, -40746=>21955, -40747=>21956, -40749=>21957, -40750=>21958, -40752=>21959, -40753=>21960, -40754=>21961, -40755=>21962, -40756=>21963, -40757=>21964, -40758=>21965, -40760=>21966, -40762=>21967, -40764=>21968, -40767=>21969, -40768=>21970, -40769=>21971, -40770=>21972, -40771=>21973, -40773=>21974, -40774=>21975, -40775=>21976, -40776=>21977, -40777=>21978, -40780=>21979, -40781=>21980, -40782=>21981, -40787=>21982, -40789=>21983, -40790=>21984, -40791=>21985, -40792=>21986, -40794=>21987, -40795=>21988, -40797=>21989, -40798=>21990, -40802=>21991, -40804=>21992, -40805=>21993, -40807=>21994, -40808=>21995, -40809=>21996, -40811=>21997, -40813=>21998, -40814=>21999, -40815=>22000, -40816=>22001, -40817=>22002, -40819=>22003, -40820=>22004, -40821=>22005, -40822=>22006, -40824=>22007, -40825=>22008, -40826=>22009, -40827=>22010, -40828=>22011, -40829=>22012, -40830=>22013, -40833=>22014, -40834=>22015, -40846=>22016, -40847=>22017, -40849=>22018, -40850=>22019, -40851=>22020, -40854=>22021, -40855=>22022, -40856=>22023, -40861=>22024, -40862=>22025, -40865=>22026, -40866=>22027, -40867=>22028, -40868=>22029, -40869=>22030, -63788=>22031, -64013=>22032, -64014=>22033, -64015=>22034, -64017=>22035, -64019=>22036, -64020=>22037, -64024=>22038, -64031=>22039, -64032=>22040, -64033=>22041, -64035=>22042, -64036=>22043, -64039=>22044, -64040=>22045, -64041=>22046, -11905=>22047, -59413=>22047, -131207=>22048, -59414=>22048, -131209=>22049, -59415=>22049, -131276=>22050, -59416=>22050, -11908=>22051, -59417=>22051, -13427=>22052, -59418=>22052, -13383=>22053, -59419=>22053, -11912=>22054, -59420=>22054, -11915=>22055, -59421=>22055, -40884=>22056, -59422=>22056, -13726=>22057, -59423=>22057, -13850=>22058, -59424=>22058, -13838=>22059, -59425=>22059, -11916=>22060, -59426=>22060, -11927=>22061, -59427=>22061, -14702=>22062, -59428=>22062, -14616=>22063, -59429=>22063, -40885=>22064, -59430=>22064, -14799=>22065, -59431=>22065, -14815=>22066, -59432=>22066, -14963=>22067, -59433=>22067, -14800=>22068, -59434=>22068, -40886=>22069, -59435=>22069, -40887=>22070, -59436=>22070, -15182=>22071, -59437=>22071, -15470=>22072, -59438=>22072, -15584=>22073, -59439=>22073, -11943=>22074, -59440=>22074, -136663=>22075, -59441=>22075, -40888=>22076, -59442=>22076, -11946=>22077, -59443=>22077, -16470=>22078, -59444=>22078, -16735=>22079, -59445=>22079, -11950=>22080, -59446=>22080, -17207=>22081, -59447=>22081, -11955=>22082, -59448=>22082, -11958=>22083, -59449=>22083, -11959=>22084, -59450=>22084, -141711=>22085, -59451=>22085, -17329=>22086, -59452=>22086, -17324=>22087, -59453=>22087, -11963=>22088, -59454=>22088, -17373=>22089, -59455=>22089, -17622=>22090, -59456=>22090, -18017=>22091, -59457=>22091, -17996=>22092, -59458=>22092, -40889=>22093, -132361=>22093, -59459=>22093, -18211=>22094, -59460=>22094, -18217=>22095, -59461=>22095, -18300=>22096, -59462=>22096, -18317=>22097, -59463=>22097, -11978=>22098, -59464=>22098, -18759=>22099, -59465=>22099, -18810=>22100, -59466=>22100, -18813=>22101, -59467=>22101, -18818=>22102, -59468=>22102, -18819=>22103, -59469=>22103, -18821=>22104, -59470=>22104, -18822=>22105, -59471=>22105, -18847=>22106, -59472=>22106, -18843=>22107, -59473=>22107, -18871=>22108, -59474=>22108, -18870=>22109, -59475=>22109, -40890=>22110, -133533=>22110, -59476=>22110, -147966=>22111, -59477=>22111, -19619=>22112, -59478=>22112, -19615=>22113, -59479=>22113, -19616=>22114, -59480=>22114, -19617=>22115, -59481=>22115, -19575=>22116, -59482=>22116, -19618=>22117, -59483=>22117, -19731=>22118, -59484=>22118, -19732=>22119, -59485=>22119, -19733=>22120, -59486=>22120, -19734=>22121, -59487=>22121, -19735=>22122, -59488=>22122, -19736=>22123, -59489=>22123, -19737=>22124, -59490=>22124, -19886=>22125, -59491=>22125, -40891=>22126, -59492=>22126, -8364=>22353, -59244=>22353, -165=>22354, -12351=>22357, -12436=>22375, -12535=>22390, -12537=>22391, -12536=>22392, -12538=>22393, -12339=>22395, -12340=>22396, -12341=>22397, -12344=>22398, -12345=>22399, -12346=>22400, -12586=>22401, -12587=>22402, -12588=>22403, -12704=>22404, -12705=>22405, -12706=>22406, -12707=>22407, -12708=>22408, -12709=>22409, -12710=>22410, -12711=>22411, -12712=>22412, -12713=>22413, -12714=>22414, -12715=>22415, -12716=>22416, -12717=>22417, -12718=>22418, -12719=>22419, -12720=>22420, -12721=>22421, -12722=>22422, -12723=>22423, -12724=>22424, -12725=>22425, -12726=>22426, -12727=>22427, -11904=>22428, -11906=>22429, -11907=>22430, -11909=>22431, -11910=>22432, -11911=>22433, -11913=>22434, -11914=>22435, -11917=>22436, -11918=>22437, -11919=>22438, -11920=>22439, -11921=>22440, -11922=>22441, -11923=>22442, -11924=>22443, -11925=>22444, -11926=>22445, -11928=>22446, -11929=>22447, -11931=>22448, -11932=>22449, -11933=>22450, -11934=>22451, -11935=>22452, -11936=>22453, -11937=>22454, -11938=>22455, -11939=>22456, -11940=>22457, -11941=>22458, -11942=>22459, -11944=>22460, -11945=>22461, -11947=>22462, -11948=>22463, -11949=>22464, -11951=>22465, -11952=>22466, -11953=>22467, -11954=>22468, -11956=>22469, -11957=>22470, -11960=>22471, -11961=>22472, -11962=>22473, -11964=>22474, -11965=>22475, -11966=>22476, -11967=>22477, -11968=>22478, -11969=>22479, -11970=>22480, -11971=>22481, -11972=>22482, -11973=>22483, -11974=>22484, -11975=>22485, -11976=>22486, -11977=>22487, -11979=>22488, -11980=>22489, -11981=>22490, -11982=>22491, -11983=>22492, -11984=>22493, -11985=>22494, -11986=>22495, -11987=>22496, -11988=>22497, -11989=>22498, -11990=>22499, -11991=>22500, -11992=>22501, -11993=>22502, -11994=>22503, -11995=>22504, -11996=>22505, -11997=>22506, -11998=>22507, -11999=>22508, -12000=>22509, -12001=>22510, -12002=>22511, -12003=>22512, -12004=>22513, -12005=>22514, -12006=>22515, -12007=>22516, -12008=>22517, -12009=>22518, -12010=>22519, -12011=>22520, -12012=>22521, -12013=>22522, -12014=>22523, -12015=>22524, -12016=>22525, -12017=>22526, -12018=>22527, -12019=>22528, -13312=>22529, -13313=>22530, -13314=>22531, -13315=>22532, -13316=>22533, -13317=>22534, -13318=>22535, -13319=>22536, -13320=>22537, -13321=>22538, -13322=>22539, -13323=>22540, -13324=>22541, -13325=>22542, -13326=>22543, -13327=>22544, -13328=>22545, -13329=>22546, -13330=>22547, -13331=>22548, -13332=>22549, -13333=>22550, -13334=>22551, -13335=>22552, -13336=>22553, -13337=>22554, -13338=>22555, -13339=>22556, -13340=>22557, -13341=>22558, -13342=>22559, -13343=>22560, -13344=>22561, -13345=>22562, -13346=>22563, -13347=>22564, -13348=>22565, -13349=>22566, -13350=>22567, -13351=>22568, -13352=>22569, -13353=>22570, -13354=>22571, -13355=>22572, -13356=>22573, -13357=>22574, -13358=>22575, -13359=>22576, -13360=>22577, -13361=>22578, -13362=>22579, -13363=>22580, -13364=>22581, -13365=>22582, -13366=>22583, -13367=>22584, -13368=>22585, -13369=>22586, -13370=>22587, -13371=>22588, -13372=>22589, -13373=>22590, -13374=>22591, -13375=>22592, -13376=>22593, -13377=>22594, -13378=>22595, -13379=>22596, -13380=>22597, -13381=>22598, -13382=>22599, -13384=>22600, -13385=>22601, -13386=>22602, -13387=>22603, -13388=>22604, -13389=>22605, -13390=>22606, -13391=>22607, -13392=>22608, -13393=>22609, -13394=>22610, -13395=>22611, -13396=>22612, -13397=>22613, -13398=>22614, -13399=>22615, -13400=>22616, -13401=>22617, -13402=>22618, -13403=>22619, -13404=>22620, -13405=>22621, -13406=>22622, -13407=>22623, -13408=>22624, -13409=>22625, -13410=>22626, -13411=>22627, -13412=>22628, -13413=>22629, -13414=>22630, -13415=>22631, -13416=>22632, -13417=>22633, -13418=>22634, -13419=>22635, -13420=>22636, -13421=>22637, -13422=>22638, -13423=>22639, -13424=>22640, -13425=>22641, -13426=>22642, -13428=>22643, -13429=>22644, -13430=>22645, -13431=>22646, -13432=>22647, -13433=>22648, -13434=>22649, -13435=>22650, -13436=>22651, -13437=>22652, -13438=>22653, -13439=>22654, -13440=>22655, -13441=>22656, -13442=>22657, -13443=>22658, -13444=>22659, -13445=>22660, -13446=>22661, -13447=>22662, -13448=>22663, -13449=>22664, -13450=>22665, -13451=>22666, -13452=>22667, -13453=>22668, -13454=>22669, -13455=>22670, -13456=>22671, -13457=>22672, -13458=>22673, -13459=>22674, -13460=>22675, -13461=>22676, -13462=>22677, -13463=>22678, -13464=>22679, -13465=>22680, -13466=>22681, -13467=>22682, -13468=>22683, -13469=>22684, -13470=>22685, -13471=>22686, -13472=>22687, -13473=>22688, -13474=>22689, -13475=>22690, -13476=>22691, -13477=>22692, -13478=>22693, -13479=>22694, -13480=>22695, -13481=>22696, -13482=>22697, -13483=>22698, -13484=>22699, -13485=>22700, -13486=>22701, -13487=>22702, -13488=>22703, -13489=>22704, -13490=>22705, -13491=>22706, -13492=>22707, -13493=>22708, -13494=>22709, -13495=>22710, -13496=>22711, -13497=>22712, -13498=>22713, -13499=>22714, -13500=>22715, -13501=>22716, -13502=>22717, -13503=>22718, -13504=>22719, -13505=>22720, -13506=>22721, -13507=>22722, -13508=>22723, -13509=>22724, -13510=>22725, -13511=>22726, -13512=>22727, -13513=>22728, -13514=>22729, -13515=>22730, -13516=>22731, -13517=>22732, -13518=>22733, -13519=>22734, -13520=>22735, -13521=>22736, -13522=>22737, -13523=>22738, -13524=>22739, -13525=>22740, -13526=>22741, -13527=>22742, -13528=>22743, -13529=>22744, -13530=>22745, -13531=>22746, -13532=>22747, -13533=>22748, -13534=>22749, -13535=>22750, -13536=>22751, -13537=>22752, -13538=>22753, -13539=>22754, -13540=>22755, -13541=>22756, -13542=>22757, -13543=>22758, -13544=>22759, -13545=>22760, -13546=>22761, -13547=>22762, -13548=>22763, -13549=>22764, -13550=>22765, -13551=>22766, -13552=>22767, -13553=>22768, -13554=>22769, -13555=>22770, -13556=>22771, -13557=>22772, -13558=>22773, -13559=>22774, -13560=>22775, -13561=>22776, -13562=>22777, -13563=>22778, -13564=>22779, -13565=>22780, -13566=>22781, -13567=>22782, -13568=>22783, -13569=>22784, -13570=>22785, -13571=>22786, -13572=>22787, -13573=>22788, -13574=>22789, -13575=>22790, -13576=>22791, -13577=>22792, -13578=>22793, -13579=>22794, -13580=>22795, -13581=>22796, -13582=>22797, -13583=>22798, -13584=>22799, -13585=>22800, -13586=>22801, -13587=>22802, -13588=>22803, -13589=>22804, -13590=>22805, -13591=>22806, -13592=>22807, -13593=>22808, -13594=>22809, -13595=>22810, -13596=>22811, -13597=>22812, -13598=>22813, -13599=>22814, -13600=>22815, -13601=>22816, -13602=>22817, -13603=>22818, -13604=>22819, -13605=>22820, -13606=>22821, -13607=>22822, -13608=>22823, -13609=>22824, -13610=>22825, -13611=>22826, -13612=>22827, -13613=>22828, -13614=>22829, -13615=>22830, -13616=>22831, -13617=>22832, -13618=>22833, -13619=>22834, -13620=>22835, -13621=>22836, -13622=>22837, -13623=>22838, -13624=>22839, -13625=>22840, -13626=>22841, -13627=>22842, -13628=>22843, -13629=>22844, -13630=>22845, -13631=>22846, -13632=>22847, -13633=>22848, -13634=>22849, -13635=>22850, -13636=>22851, -13637=>22852, -13638=>22853, -13639=>22854, -13640=>22855, -13641=>22856, -13642=>22857, -13643=>22858, -13644=>22859, -13645=>22860, -13646=>22861, -13647=>22862, -13648=>22863, -13649=>22864, -13650=>22865, -13651=>22866, -13652=>22867, -13653=>22868, -13654=>22869, -13655=>22870, -13656=>22871, -13657=>22872, -13658=>22873, -13659=>22874, -13660=>22875, -13661=>22876, -13662=>22877, -13663=>22878, -13664=>22879, -13665=>22880, -13666=>22881, -13667=>22882, -13668=>22883, -13669=>22884, -13670=>22885, -13671=>22886, -13672=>22887, -13673=>22888, -13674=>22889, -13675=>22890, -13676=>22891, -13677=>22892, -13678=>22893, -13679=>22894, -13680=>22895, -13681=>22896, -13682=>22897, -13683=>22898, -13684=>22899, -13685=>22900, -13686=>22901, -13687=>22902, -13688=>22903, -13689=>22904, -13690=>22905, -13691=>22906, -13692=>22907, -13693=>22908, -13694=>22909, -13695=>22910, -13696=>22911, -13697=>22912, -13698=>22913, -13699=>22914, -13700=>22915, -13701=>22916, -13702=>22917, -13703=>22918, -13704=>22919, -13705=>22920, -13706=>22921, -13707=>22922, -13708=>22923, -13709=>22924, -13710=>22925, -13711=>22926, -13712=>22927, -13713=>22928, -13714=>22929, -13715=>22930, -13716=>22931, -13717=>22932, -13718=>22933, -13719=>22934, -13720=>22935, -13721=>22936, -13722=>22937, -13723=>22938, -13724=>22939, -13725=>22940, -13727=>22941, -13728=>22942, -13729=>22943, -13730=>22944, -13731=>22945, -13732=>22946, -13733=>22947, -13734=>22948, -13735=>22949, -13736=>22950, -13737=>22951, -13738=>22952, -13739=>22953, -13740=>22954, -13741=>22955, -13742=>22956, -13743=>22957, -13744=>22958, -13745=>22959, -13746=>22960, -13747=>22961, -13748=>22962, -13749=>22963, -13750=>22964, -13751=>22965, -13752=>22966, -13753=>22967, -13754=>22968, -13755=>22969, -13756=>22970, -13757=>22971, -13758=>22972, -13759=>22973, -13760=>22974, -13761=>22975, -13762=>22976, -13763=>22977, -13764=>22978, -13765=>22979, -13766=>22980, -13767=>22981, -13768=>22982, -13769=>22983, -13770=>22984, -13771=>22985, -13772=>22986, -13773=>22987, -13774=>22988, -13775=>22989, -13776=>22990, -13777=>22991, -13778=>22992, -13779=>22993, -13780=>22994, -13781=>22995, -13782=>22996, -13783=>22997, -13784=>22998, -13785=>22999, -13786=>23000, -13787=>23001, -13788=>23002, -13789=>23003, -13790=>23004, -13791=>23005, -13792=>23006, -13793=>23007, -13794=>23008, -13795=>23009, -13796=>23010, -13797=>23011, -13798=>23012, -13799=>23013, -13800=>23014, -13801=>23015, -13802=>23016, -13803=>23017, -13804=>23018, -13805=>23019, -13806=>23020, -13807=>23021, -13808=>23022, -13809=>23023, -13810=>23024, -13811=>23025, -13812=>23026, -13813=>23027, -13814=>23028, -13815=>23029, -13816=>23030, -13817=>23031, -13818=>23032, -13819=>23033, -13820=>23034, -13821=>23035, -13822=>23036, -13823=>23037, -13824=>23038, -13825=>23039, -13826=>23040, -13827=>23041, -13828=>23042, -13829=>23043, -13830=>23044, -13831=>23045, -13832=>23046, -13833=>23047, -13834=>23048, -13835=>23049, -13836=>23050, -13837=>23051, -13839=>23052, -13840=>23053, -13841=>23054, -13842=>23055, -13843=>23056, -13844=>23057, -13845=>23058, -13846=>23059, -13847=>23060, -13848=>23061, -13849=>23062, -13851=>23063, -13852=>23064, -13853=>23065, -13854=>23066, -13855=>23067, -13856=>23068, -13857=>23069, -13858=>23070, -13859=>23071, -13860=>23072, -13861=>23073, -13862=>23074, -13863=>23075, -13864=>23076, -13865=>23077, -13866=>23078, -13867=>23079, -13868=>23080, -13869=>23081, -13870=>23082, -13871=>23083, -13872=>23084, -13873=>23085, -13874=>23086, -13875=>23087, -13876=>23088, -13877=>23089, -13878=>23090, -13879=>23091, -13880=>23092, -13881=>23093, -13882=>23094, -13883=>23095, -13884=>23096, -13885=>23097, -13886=>23098, -13887=>23099, -13888=>23100, -13889=>23101, -13890=>23102, -13891=>23103, -13892=>23104, -13893=>23105, -13894=>23106, -13895=>23107, -13896=>23108, -13897=>23109, -13898=>23110, -13899=>23111, -13900=>23112, -13901=>23113, -13902=>23114, -13903=>23115, -13904=>23116, -13905=>23117, -13906=>23118, -13907=>23119, -13908=>23120, -13909=>23121, -13910=>23122, -13911=>23123, -13912=>23124, -13913=>23125, -13914=>23126, -13915=>23127, -13916=>23128, -13917=>23129, -13918=>23130, -13919=>23131, -13920=>23132, -13921=>23133, -13922=>23134, -13923=>23135, -13924=>23136, -13925=>23137, -13926=>23138, -13927=>23139, -13928=>23140, -13929=>23141, -13930=>23142, -13931=>23143, -13932=>23144, -13933=>23145, -13934=>23146, -13935=>23147, -13936=>23148, -13937=>23149, -13938=>23150, -13939=>23151, -13940=>23152, -13941=>23153, -13942=>23154, -13943=>23155, -13944=>23156, -13945=>23157, -13946=>23158, -13947=>23159, -13948=>23160, -13949=>23161, -13950=>23162, -13951=>23163, -13952=>23164, -13953=>23165, -13954=>23166, -13955=>23167, -13956=>23168, -13957=>23169, -13958=>23170, -13959=>23171, -13960=>23172, -13961=>23173, -13962=>23174, -13963=>23175, -13964=>23176, -13965=>23177, -13966=>23178, -13967=>23179, -13968=>23180, -13969=>23181, -13970=>23182, -13971=>23183, -13972=>23184, -13973=>23185, -13974=>23186, -13975=>23187, -13976=>23188, -13977=>23189, -13978=>23190, -13979=>23191, -13980=>23192, -13981=>23193, -13982=>23194, -13983=>23195, -13984=>23196, -13985=>23197, -13986=>23198, -13987=>23199, -13988=>23200, -13989=>23201, -13990=>23202, -13991=>23203, -13992=>23204, -13993=>23205, -13994=>23206, -13995=>23207, -13996=>23208, -13997=>23209, -13998=>23210, -13999=>23211, -14000=>23212, -14001=>23213, -14002=>23214, -14003=>23215, -14004=>23216, -14005=>23217, -14006=>23218, -14007=>23219, -14008=>23220, -14009=>23221, -14010=>23222, -14011=>23223, -14012=>23224, -14013=>23225, -14014=>23226, -14015=>23227, -14016=>23228, -14017=>23229, -14018=>23230, -14019=>23231, -14020=>23232, -14021=>23233, -14022=>23234, -14023=>23235, -14024=>23236, -14025=>23237, -14026=>23238, -14027=>23239, -14028=>23240, -14029=>23241, -14030=>23242, -14031=>23243, -14032=>23244, -14033=>23245, -14034=>23246, -14035=>23247, -14036=>23248, -14037=>23249, -14038=>23250, -14039=>23251, -14040=>23252, -14041=>23253, -14042=>23254, -14043=>23255, -14044=>23256, -14045=>23257, -14046=>23258, -14047=>23259, -14048=>23260, -14049=>23261, -14050=>23262, -14051=>23263, -14052=>23264, -14053=>23265, -14054=>23266, -14055=>23267, -14056=>23268, -14057=>23269, -14058=>23270, -14059=>23271, -14060=>23272, -14061=>23273, -14062=>23274, -14063=>23275, -14064=>23276, -14065=>23277, -14066=>23278, -14067=>23279, -14068=>23280, -14069=>23281, -14070=>23282, -14071=>23283, -14072=>23284, -14073=>23285, -14074=>23286, -14075=>23287, -14076=>23288, -14077=>23289, -14078=>23290, -14079=>23291, -14080=>23292, -14081=>23293, -14082=>23294, -14083=>23295, -14084=>23296, -14085=>23297, -14086=>23298, -14087=>23299, -14088=>23300, -14089=>23301, -14090=>23302, -14091=>23303, -14092=>23304, -14093=>23305, -14094=>23306, -14095=>23307, -14096=>23308, -14097=>23309, -14098=>23310, -14099=>23311, -14100=>23312, -14101=>23313, -14102=>23314, -14103=>23315, -14104=>23316, -14105=>23317, -14106=>23318, -14107=>23319, -14108=>23320, -14109=>23321, -14110=>23322, -14111=>23323, -14112=>23324, -14113=>23325, -14114=>23326, -14115=>23327, -14116=>23328, -14117=>23329, -14118=>23330, -14119=>23331, -14120=>23332, -14121=>23333, -14122=>23334, -14123=>23335, -14124=>23336, -14125=>23337, -14126=>23338, -14127=>23339, -14128=>23340, -14129=>23341, -14130=>23342, -14131=>23343, -14132=>23344, -14133=>23345, -14134=>23346, -14135=>23347, -14136=>23348, -14137=>23349, -14138=>23350, -14139=>23351, -14140=>23352, -14141=>23353, -14142=>23354, -14143=>23355, -14144=>23356, -14145=>23357, -14146=>23358, -14147=>23359, -14148=>23360, -14149=>23361, -14150=>23362, -14151=>23363, -14152=>23364, -14153=>23365, -14154=>23366, -14155=>23367, -14156=>23368, -14157=>23369, -14158=>23370, -14159=>23371, -14160=>23372, -14161=>23373, -14162=>23374, -14163=>23375, -14164=>23376, -14165=>23377, -14166=>23378, -14167=>23379, -14168=>23380, -14169=>23381, -14170=>23382, -14171=>23383, -14172=>23384, -14173=>23385, -14174=>23386, -14175=>23387, -14176=>23388, -14177=>23389, -14178=>23390, -14179=>23391, -14180=>23392, -14181=>23393, -14182=>23394, -14183=>23395, -14184=>23396, -14185=>23397, -14186=>23398, -14187=>23399, -14188=>23400, -14189=>23401, -14190=>23402, -14191=>23403, -14192=>23404, -14193=>23405, -14194=>23406, -14195=>23407, -14196=>23408, -14197=>23409, -14198=>23410, -14199=>23411, -14200=>23412, -14201=>23413, -14202=>23414, -14203=>23415, -14204=>23416, -14205=>23417, -14206=>23418, -14207=>23419, -14208=>23420, -14209=>23421, -14210=>23422, -14211=>23423, -14212=>23424, -14213=>23425, -14214=>23426, -14215=>23427, -14216=>23428, -14217=>23429, -14218=>23430, -14219=>23431, -14220=>23432, -14221=>23433, -14222=>23434, -14223=>23435, -14224=>23436, -14225=>23437, -14226=>23438, -14227=>23439, -14228=>23440, -14229=>23441, -14230=>23442, -14231=>23443, -14232=>23444, -14233=>23445, -14234=>23446, -14235=>23447, -14236=>23448, -14237=>23449, -14238=>23450, -14239=>23451, -14240=>23452, -14241=>23453, -14242=>23454, -14243=>23455, -14244=>23456, -14245=>23457, -14246=>23458, -14247=>23459, -14248=>23460, -14249=>23461, -14250=>23462, -14251=>23463, -14252=>23464, -14253=>23465, -14254=>23466, -14255=>23467, -14256=>23468, -14257=>23469, -14258=>23470, -14259=>23471, -14260=>23472, -14261=>23473, -14262=>23474, -14263=>23475, -14264=>23476, -14265=>23477, -14266=>23478, -14267=>23479, -14268=>23480, -14269=>23481, -14270=>23482, -14271=>23483, -14272=>23484, -14273=>23485, -14274=>23486, -14275=>23487, -14276=>23488, -14277=>23489, -14278=>23490, -14279=>23491, -14280=>23492, -14281=>23493, -14282=>23494, -14283=>23495, -14284=>23496, -14285=>23497, -14286=>23498, -14287=>23499, -14288=>23500, -14289=>23501, -14290=>23502, -14291=>23503, -14292=>23504, -14293=>23505, -14294=>23506, -14295=>23507, -14296=>23508, -14297=>23509, -14298=>23510, -14299=>23511, -14300=>23512, -14301=>23513, -14302=>23514, -14303=>23515, -14304=>23516, -14305=>23517, -14306=>23518, -14307=>23519, -14308=>23520, -14309=>23521, -14310=>23522, -14311=>23523, -14312=>23524, -14313=>23525, -14314=>23526, -14315=>23527, -14316=>23528, -14317=>23529, -14318=>23530, -14319=>23531, -14320=>23532, -14321=>23533, -14322=>23534, -14323=>23535, -14324=>23536, -14325=>23537, -14326=>23538, -14327=>23539, -14328=>23540, -14329=>23541, -14330=>23542, -14331=>23543, -14332=>23544, -14333=>23545, -14334=>23546, -14335=>23547, -14336=>23548, -14337=>23549, -14338=>23550, -14339=>23551, -14340=>23552, -14341=>23553, -14342=>23554, -14343=>23555, -14344=>23556, -14345=>23557, -14346=>23558, -14347=>23559, -14348=>23560, -14349=>23561, -14350=>23562, -14351=>23563, -14352=>23564, -14353=>23565, -14354=>23566, -14355=>23567, -14356=>23568, -14357=>23569, -14358=>23570, -14359=>23571, -14360=>23572, -14361=>23573, -14362=>23574, -14363=>23575, -14364=>23576, -14365=>23577, -14366=>23578, -14367=>23579, -14368=>23580, -14369=>23581, -14370=>23582, -14371=>23583, -14372=>23584, -14373=>23585, -14374=>23586, -14375=>23587, -14376=>23588, -14377=>23589, -14378=>23590, -14379=>23591, -14380=>23592, -14381=>23593, -14382=>23594, -14383=>23595, -14384=>23596, -14385=>23597, -14386=>23598, -14387=>23599, -14388=>23600, -14389=>23601, -14390=>23602, -14391=>23603, -14392=>23604, -14393=>23605, -14394=>23606, -14395=>23607, -14396=>23608, -14397=>23609, -14398=>23610, -14399=>23611, -14400=>23612, -14401=>23613, -14402=>23614, -14403=>23615, -14404=>23616, -14405=>23617, -14406=>23618, -14407=>23619, -14408=>23620, -14409=>23621, -14410=>23622, -14411=>23623, -14412=>23624, -14413=>23625, -14414=>23626, -14415=>23627, -14416=>23628, -14417=>23629, -14418=>23630, -14419=>23631, -14420=>23632, -14421=>23633, -14422=>23634, -14423=>23635, -14424=>23636, -14425=>23637, -14426=>23638, -14427=>23639, -14428=>23640, -14429=>23641, -14430=>23642, -14431=>23643, -14432=>23644, -14433=>23645, -14434=>23646, -14435=>23647, -14436=>23648, -14437=>23649, -14438=>23650, -14439=>23651, -14440=>23652, -14441=>23653, -14442=>23654, -14443=>23655, -14444=>23656, -14445=>23657, -14446=>23658, -14447=>23659, -14448=>23660, -14449=>23661, -14450=>23662, -14451=>23663, -14452=>23664, -14453=>23665, -14454=>23666, -14455=>23667, -14456=>23668, -14457=>23669, -14458=>23670, -14459=>23671, -14460=>23672, -14461=>23673, -14462=>23674, -14463=>23675, -14464=>23676, -14465=>23677, -14466=>23678, -14467=>23679, -14468=>23680, -14469=>23681, -14470=>23682, -14471=>23683, -14472=>23684, -14473=>23685, -14474=>23686, -14475=>23687, -14476=>23688, -14477=>23689, -14478=>23690, -14479=>23691, -14480=>23692, -14481=>23693, -14482=>23694, -14483=>23695, -14484=>23696, -14485=>23697, -14486=>23698, -14487=>23699, -14488=>23700, -14489=>23701, -14490=>23702, -14491=>23703, -14492=>23704, -14493=>23705, -14494=>23706, -14495=>23707, -14496=>23708, -14497=>23709, -14498=>23710, -14499=>23711, -14500=>23712, -14501=>23713, -14502=>23714, -14503=>23715, -14504=>23716, -14505=>23717, -14506=>23718, -14507=>23719, -14508=>23720, -14509=>23721, -14510=>23722, -14511=>23723, -14512=>23724, -14513=>23725, -14514=>23726, -14515=>23727, -14516=>23728, -14517=>23729, -14518=>23730, -14519=>23731, -14520=>23732, -14521=>23733, -14522=>23734, -14523=>23735, -14524=>23736, -14525=>23737, -14526=>23738, -14527=>23739, -14528=>23740, -14529=>23741, -14530=>23742, -14531=>23743, -14532=>23744, -14533=>23745, -14534=>23746, -14535=>23747, -14536=>23748, -14537=>23749, -14538=>23750, -14539=>23751, -14540=>23752, -14541=>23753, -14542=>23754, -14543=>23755, -14544=>23756, -14545=>23757, -14546=>23758, -14547=>23759, -14548=>23760, -14549=>23761, -14550=>23762, -14551=>23763, -14552=>23764, -14553=>23765, -14554=>23766, -14555=>23767, -14556=>23768, -14557=>23769, -14558=>23770, -14559=>23771, -14560=>23772, -14561=>23773, -14562=>23774, -14563=>23775, -14564=>23776, -14565=>23777, -14566=>23778, -14567=>23779, -14568=>23780, -14569=>23781, -14570=>23782, -14571=>23783, -14572=>23784, -14573=>23785, -14574=>23786, -14575=>23787, -14576=>23788, -14577=>23789, -14578=>23790, -14579=>23791, -14580=>23792, -14581=>23793, -14582=>23794, -14583=>23795, -14584=>23796, -14585=>23797, -14586=>23798, -14587=>23799, -14588=>23800, -14589=>23801, -14590=>23802, -14591=>23803, -14592=>23804, -14593=>23805, -14594=>23806, -14595=>23807, -14596=>23808, -14597=>23809, -14598=>23810, -14599=>23811, -14600=>23812, -14601=>23813, -14602=>23814, -14603=>23815, -14604=>23816, -14605=>23817, -14606=>23818, -14607=>23819, -14608=>23820, -14609=>23821, -14610=>23822, -14611=>23823, -14612=>23824, -14613=>23825, -14614=>23826, -14615=>23827, -14617=>23828, -14618=>23829, -14619=>23830, -14620=>23831, -14621=>23832, -14622=>23833, -14623=>23834, -14624=>23835, -14625=>23836, -14626=>23837, -14627=>23838, -14628=>23839, -14629=>23840, -14630=>23841, -14631=>23842, -14632=>23843, -14633=>23844, -14634=>23845, -14635=>23846, -14636=>23847, -14637=>23848, -14638=>23849, -14639=>23850, -14640=>23851, -14641=>23852, -14642=>23853, -14643=>23854, -14644=>23855, -14645=>23856, -14646=>23857, -14647=>23858, -14648=>23859, -14649=>23860, -14650=>23861, -14651=>23862, -14652=>23863, -14653=>23864, -14654=>23865, -14655=>23866, -14656=>23867, -14657=>23868, -14658=>23869, -14659=>23870, -14660=>23871, -14661=>23872, -14662=>23873, -14663=>23874, -14664=>23875, -14665=>23876, -14666=>23877, -14667=>23878, -14668=>23879, -14669=>23880, -14670=>23881, -14671=>23882, -14672=>23883, -14673=>23884, -14674=>23885, -14675=>23886, -14676=>23887, -14677=>23888, -14678=>23889, -14679=>23890, -14680=>23891, -14681=>23892, -14682=>23893, -14683=>23894, -14684=>23895, -14685=>23896, -14686=>23897, -14687=>23898, -14688=>23899, -14689=>23900, -14690=>23901, -14691=>23902, -14692=>23903, -14693=>23904, -14694=>23905, -14695=>23906, -14696=>23907, -14697=>23908, -14698=>23909, -14699=>23910, -14700=>23911, -14701=>23912, -14703=>23913, -14704=>23914, -14705=>23915, -14706=>23916, -14707=>23917, -14708=>23918, -14709=>23919, -14710=>23920, -14711=>23921, -14712=>23922, -14713=>23923, -14714=>23924, -14715=>23925, -14716=>23926, -14717=>23927, -14718=>23928, -14719=>23929, -14720=>23930, -14721=>23931, -14722=>23932, -14723=>23933, -14724=>23934, -14725=>23935, -14726=>23936, -14727=>23937, -14728=>23938, -14729=>23939, -14730=>23940, -14731=>23941, -14732=>23942, -14733=>23943, -14734=>23944, -14735=>23945, -14736=>23946, -14737=>23947, -14738=>23948, -14739=>23949, -14740=>23950, -14741=>23951, -14742=>23952, -14743=>23953, -14744=>23954, -14745=>23955, -14746=>23956, -14747=>23957, -14748=>23958, -14749=>23959, -14750=>23960, -14751=>23961, -14752=>23962, -14753=>23963, -14754=>23964, -14755=>23965, -14756=>23966, -14757=>23967, -14758=>23968, -14759=>23969, -14760=>23970, -14761=>23971, -14762=>23972, -14763=>23973, -14764=>23974, -14765=>23975, -14766=>23976, -14767=>23977, -14768=>23978, -14769=>23979, -14770=>23980, -14771=>23981, -14772=>23982, -14773=>23983, -14774=>23984, -14775=>23985, -14776=>23986, -14777=>23987, -14778=>23988, -14779=>23989, -14780=>23990, -14781=>23991, -14782=>23992, -14783=>23993, -14784=>23994, -14785=>23995, -14786=>23996, -14787=>23997, -14788=>23998, -14789=>23999, -14790=>24000, -14791=>24001, -14792=>24002, -14793=>24003, -14794=>24004, -14795=>24005, -14796=>24006, -14797=>24007, -14798=>24008, -14801=>24009, -14802=>24010, -14803=>24011, -14804=>24012, -14805=>24013, -14806=>24014, -14807=>24015, -14808=>24016, -14809=>24017, -14810=>24018, -14811=>24019, -14812=>24020, -14813=>24021, -14814=>24022, -14816=>24023, -14817=>24024, -14818=>24025, -14819=>24026, -14820=>24027, -14821=>24028, -14822=>24029, -14823=>24030, -14824=>24031, -14825=>24032, -14826=>24033, -14827=>24034, -14828=>24035, -14829=>24036, -14830=>24037, -14831=>24038, -14832=>24039, -14833=>24040, -14834=>24041, -14835=>24042, -14836=>24043, -14837=>24044, -14838=>24045, -14839=>24046, -14840=>24047, -14841=>24048, -14842=>24049, -14843=>24050, -14844=>24051, -14845=>24052, -14846=>24053, -14847=>24054, -14848=>24055, -14849=>24056, -14850=>24057, -14851=>24058, -14852=>24059, -14853=>24060, -14854=>24061, -14855=>24062, -14856=>24063, -14857=>24064, -14858=>24065, -14859=>24066, -14860=>24067, -14861=>24068, -14862=>24069, -14863=>24070, -14864=>24071, -14865=>24072, -14866=>24073, -14867=>24074, -14868=>24075, -14869=>24076, -14870=>24077, -14871=>24078, -14872=>24079, -14873=>24080, -14874=>24081, -14875=>24082, -14876=>24083, -14877=>24084, -14878=>24085, -14879=>24086, -14880=>24087, -14881=>24088, -14882=>24089, -14883=>24090, -14884=>24091, -14885=>24092, -14886=>24093, -14887=>24094, -14888=>24095, -14889=>24096, -14890=>24097, -14891=>24098, -14892=>24099, -14893=>24100, -14894=>24101, -14895=>24102, -14896=>24103, -14897=>24104, -14898=>24105, -14899=>24106, -14900=>24107, -14901=>24108, -14902=>24109, -14903=>24110, -14904=>24111, -14905=>24112, -14906=>24113, -14907=>24114, -14908=>24115, -14909=>24116, -14910=>24117, -14911=>24118, -14912=>24119, -14913=>24120, -14914=>24121, -14915=>24122, -14916=>24123, -14917=>24124, -14918=>24125, -14919=>24126, -14920=>24127, -14921=>24128, -14922=>24129, -14923=>24130, -14924=>24131, -14925=>24132, -14926=>24133, -14927=>24134, -14928=>24135, -14929=>24136, -14930=>24137, -14931=>24138, -14932=>24139, -14933=>24140, -14934=>24141, -14935=>24142, -14936=>24143, -14937=>24144, -14938=>24145, -14939=>24146, -14940=>24147, -14941=>24148, -14942=>24149, -14943=>24150, -14944=>24151, -14945=>24152, -14946=>24153, -14947=>24154, -14948=>24155, -14949=>24156, -14950=>24157, -14951=>24158, -14952=>24159, -14953=>24160, -14954=>24161, -14955=>24162, -14956=>24163, -14957=>24164, -14958=>24165, -14959=>24166, -14960=>24167, -14961=>24168, -14962=>24169, -14964=>24170, -14965=>24171, -14966=>24172, -14967=>24173, -14968=>24174, -14969=>24175, -14970=>24176, -14971=>24177, -14972=>24178, -14973=>24179, -14974=>24180, -14975=>24181, -14976=>24182, -14977=>24183, -14978=>24184, -14979=>24185, -14980=>24186, -14981=>24187, -14982=>24188, -14983=>24189, -14984=>24190, -14985=>24191, -14986=>24192, -14987=>24193, -14988=>24194, -14989=>24195, -14990=>24196, -14991=>24197, -14992=>24198, -14993=>24199, -14994=>24200, -14995=>24201, -14996=>24202, -14997=>24203, -14998=>24204, -14999=>24205, -15000=>24206, -15001=>24207, -15002=>24208, -15003=>24209, -15004=>24210, -15005=>24211, -15006=>24212, -15007=>24213, -15008=>24214, -15009=>24215, -15010=>24216, -15011=>24217, -15012=>24218, -15013=>24219, -15014=>24220, -15015=>24221, -15016=>24222, -15017=>24223, -15018=>24224, -15019=>24225, -15020=>24226, -15021=>24227, -15022=>24228, -15023=>24229, -15024=>24230, -15025=>24231, -15026=>24232, -15027=>24233, -15028=>24234, -15029=>24235, -15030=>24236, -15031=>24237, -15032=>24238, -15033=>24239, -15034=>24240, -15035=>24241, -15036=>24242, -15037=>24243, -15038=>24244, -15039=>24245, -15040=>24246, -15041=>24247, -15042=>24248, -15043=>24249, -15044=>24250, -15045=>24251, -15046=>24252, -15047=>24253, -15048=>24254, -15049=>24255, -15050=>24256, -15051=>24257, -15052=>24258, -15053=>24259, -15054=>24260, -15055=>24261, -15056=>24262, -15057=>24263, -15058=>24264, -15059=>24265, -15060=>24266, -15061=>24267, -15062=>24268, -15063=>24269, -15064=>24270, -15065=>24271, -15066=>24272, -15067=>24273, -15068=>24274, -15069=>24275, -15070=>24276, -15071=>24277, -15072=>24278, -15073=>24279, -15074=>24280, -15075=>24281, -15076=>24282, -15077=>24283, -15078=>24284, -15079=>24285, -15080=>24286, -15081=>24287, -15082=>24288, -15083=>24289, -15084=>24290, -15085=>24291, -15086=>24292, -15087=>24293, -15088=>24294, -15089=>24295, -15090=>24296, -15091=>24297, -15092=>24298, -15093=>24299, -15094=>24300, -15095=>24301, -15096=>24302, -15097=>24303, -15098=>24304, -15099=>24305, -15100=>24306, -15101=>24307, -15102=>24308, -15103=>24309, -15104=>24310, -15105=>24311, -15106=>24312, -15107=>24313, -15108=>24314, -15109=>24315, -15110=>24316, -15111=>24317, -15112=>24318, -15113=>24319, -15114=>24320, -15115=>24321, -15116=>24322, -15117=>24323, -15118=>24324, -15119=>24325, -15120=>24326, -15121=>24327, -15122=>24328, -15123=>24329, -15124=>24330, -15125=>24331, -15126=>24332, -15127=>24333, -15128=>24334, -15129=>24335, -15130=>24336, -15131=>24337, -15132=>24338, -15133=>24339, -15134=>24340, -15135=>24341, -15136=>24342, -15137=>24343, -15138=>24344, -15139=>24345, -15140=>24346, -15141=>24347, -15142=>24348, -15143=>24349, -15144=>24350, -15145=>24351, -15146=>24352, -15147=>24353, -15148=>24354, -15149=>24355, -15150=>24356, -15151=>24357, -15152=>24358, -15153=>24359, -15154=>24360, -15155=>24361, -15156=>24362, -15157=>24363, -15158=>24364, -15159=>24365, -15160=>24366, -15161=>24367, -15162=>24368, -15163=>24369, -15164=>24370, -15165=>24371, -15166=>24372, -15167=>24373, -15168=>24374, -15169=>24375, -15170=>24376, -15171=>24377, -15172=>24378, -15173=>24379, -15174=>24380, -15175=>24381, -15176=>24382, -15177=>24383, -15178=>24384, -15179=>24385, -15180=>24386, -15181=>24387, -15183=>24388, -15184=>24389, -15185=>24390, -15186=>24391, -15187=>24392, -15188=>24393, -15189=>24394, -15190=>24395, -15191=>24396, -15192=>24397, -15193=>24398, -15194=>24399, -15195=>24400, -15196=>24401, -15197=>24402, -15198=>24403, -15199=>24404, -15200=>24405, -15201=>24406, -15202=>24407, -15203=>24408, -15204=>24409, -15205=>24410, -15206=>24411, -15207=>24412, -15208=>24413, -15209=>24414, -15210=>24415, -15211=>24416, -15212=>24417, -15213=>24418, -15214=>24419, -15215=>24420, -15216=>24421, -15217=>24422, -15218=>24423, -15219=>24424, -15220=>24425, -15221=>24426, -15222=>24427, -15223=>24428, -15224=>24429, -15225=>24430, -15226=>24431, -15227=>24432, -15228=>24433, -15229=>24434, -15230=>24435, -15231=>24436, -15232=>24437, -15233=>24438, -15234=>24439, -15235=>24440, -15236=>24441, -15237=>24442, -15238=>24443, -15239=>24444, -15240=>24445, -15241=>24446, -15242=>24447, -15243=>24448, -15244=>24449, -15245=>24450, -15246=>24451, -15247=>24452, -15248=>24453, -15249=>24454, -15250=>24455, -15251=>24456, -15252=>24457, -15253=>24458, -15254=>24459, -15255=>24460, -15256=>24461, -15257=>24462, -15258=>24463, -15259=>24464, -15260=>24465, -15261=>24466, -15262=>24467, -15263=>24468, -15264=>24469, -15265=>24470, -15266=>24471, -15267=>24472, -15268=>24473, -15269=>24474, -15270=>24475, -15271=>24476, -15272=>24477, -15273=>24478, -15274=>24479, -15275=>24480, -15276=>24481, -15277=>24482, -15278=>24483, -15279=>24484, -15280=>24485, -15281=>24486, -15282=>24487, -15283=>24488, -15284=>24489, -15285=>24490, -15286=>24491, -15287=>24492, -15288=>24493, -15289=>24494, -15290=>24495, -15291=>24496, -15292=>24497, -15293=>24498, -15294=>24499, -15295=>24500, -15296=>24501, -15297=>24502, -15298=>24503, -15299=>24504, -15300=>24505, -15301=>24506, -15302=>24507, -15303=>24508, -15304=>24509, -15305=>24510, -15306=>24511, -15307=>24512, -15308=>24513, -15309=>24514, -15310=>24515, -15311=>24516, -15312=>24517, -15313=>24518, -15314=>24519, -15315=>24520, -15316=>24521, -15317=>24522, -15318=>24523, -15319=>24524, -15320=>24525, -15321=>24526, -15322=>24527, -15323=>24528, -15324=>24529, -15325=>24530, -15326=>24531, -15327=>24532, -15328=>24533, -15329=>24534, -15330=>24535, -15331=>24536, -15332=>24537, -15333=>24538, -15334=>24539, -15335=>24540, -15336=>24541, -15337=>24542, -15338=>24543, -15339=>24544, -15340=>24545, -15341=>24546, -15342=>24547, -15343=>24548, -15344=>24549, -15345=>24550, -15346=>24551, -15347=>24552, -15348=>24553, -15349=>24554, -15350=>24555, -15351=>24556, -15352=>24557, -15353=>24558, -15354=>24559, -15355=>24560, -15356=>24561, -15357=>24562, -15358=>24563, -15359=>24564, -15360=>24565, -15361=>24566, -15362=>24567, -15363=>24568, -15364=>24569, -15365=>24570, -15366=>24571, -15367=>24572, -15368=>24573, -15369=>24574, -15370=>24575, -15371=>24576, -15372=>24577, -15373=>24578, -15374=>24579, -15375=>24580, -15376=>24581, -15377=>24582, -15378=>24583, -15379=>24584, -15380=>24585, -15381=>24586, -15382=>24587, -15383=>24588, -15384=>24589, -15385=>24590, -15386=>24591, -15387=>24592, -15388=>24593, -15389=>24594, -15390=>24595, -15391=>24596, -15392=>24597, -15393=>24598, -15394=>24599, -15395=>24600, -15396=>24601, -15397=>24602, -15398=>24603, -15399=>24604, -15400=>24605, -15401=>24606, -15402=>24607, -15403=>24608, -15404=>24609, -15405=>24610, -15406=>24611, -15407=>24612, -15408=>24613, -15409=>24614, -15410=>24615, -15411=>24616, -15412=>24617, -15413=>24618, -15414=>24619, -15415=>24620, -15416=>24621, -15417=>24622, -15418=>24623, -15419=>24624, -15420=>24625, -15421=>24626, -15422=>24627, -15423=>24628, -15424=>24629, -15425=>24630, -15426=>24631, -15427=>24632, -15428=>24633, -15429=>24634, -15430=>24635, -15431=>24636, -15432=>24637, -15433=>24638, -15434=>24639, -15435=>24640, -15436=>24641, -15437=>24642, -15438=>24643, -15439=>24644, -15440=>24645, -15441=>24646, -15442=>24647, -15443=>24648, -15444=>24649, -15445=>24650, -15446=>24651, -15447=>24652, -15448=>24653, -15449=>24654, -15450=>24655, -15451=>24656, -15452=>24657, -15453=>24658, -15454=>24659, -15455=>24660, -15456=>24661, -15457=>24662, -15458=>24663, -15459=>24664, -15460=>24665, -15461=>24666, -15462=>24667, -15463=>24668, -15464=>24669, -15465=>24670, -15466=>24671, -15467=>24672, -15468=>24673, -15469=>24674, -15471=>24675, -15472=>24676, -15473=>24677, -15474=>24678, -15475=>24679, -15476=>24680, -15477=>24681, -15478=>24682, -15479=>24683, -15480=>24684, -15481=>24685, -15482=>24686, -15483=>24687, -15484=>24688, -15485=>24689, -15486=>24690, -15487=>24691, -15488=>24692, -15489=>24693, -15490=>24694, -15491=>24695, -15492=>24696, -15493=>24697, -15494=>24698, -15495=>24699, -15496=>24700, -15497=>24701, -15498=>24702, -15499=>24703, -15500=>24704, -15501=>24705, -15502=>24706, -15503=>24707, -15504=>24708, -15505=>24709, -15506=>24710, -15507=>24711, -15508=>24712, -15509=>24713, -15510=>24714, -15511=>24715, -15512=>24716, -15513=>24717, -15514=>24718, -15515=>24719, -15516=>24720, -15517=>24721, -15518=>24722, -15519=>24723, -15520=>24724, -15521=>24725, -15522=>24726, -15523=>24727, -15524=>24728, -15525=>24729, -15526=>24730, -15527=>24731, -15528=>24732, -15529=>24733, -15530=>24734, -15531=>24735, -15532=>24736, -15533=>24737, -15534=>24738, -15535=>24739, -15536=>24740, -15537=>24741, -15538=>24742, -15539=>24743, -15540=>24744, -15541=>24745, -15542=>24746, -15543=>24747, -15544=>24748, -15545=>24749, -15546=>24750, -15547=>24751, -15548=>24752, -15549=>24753, -15550=>24754, -15551=>24755, -15552=>24756, -15553=>24757, -15554=>24758, -15555=>24759, -15556=>24760, -15557=>24761, -15558=>24762, -15559=>24763, -15560=>24764, -15561=>24765, -15562=>24766, -15563=>24767, -15564=>24768, -15565=>24769, -15566=>24770, -15567=>24771, -15568=>24772, -15569=>24773, -15570=>24774, -15571=>24775, -15572=>24776, -15573=>24777, -15574=>24778, -15575=>24779, -15576=>24780, -15577=>24781, -15578=>24782, -15579=>24783, -15580=>24784, -15581=>24785, -15582=>24786, -15583=>24787, -15585=>24788, -15586=>24789, -15587=>24790, -15588=>24791, -15589=>24792, -15590=>24793, -15591=>24794, -15592=>24795, -15593=>24796, -15594=>24797, -15595=>24798, -15596=>24799, -15597=>24800, -15598=>24801, -15599=>24802, -15600=>24803, -15601=>24804, -15602=>24805, -15603=>24806, -15604=>24807, -15605=>24808, -15606=>24809, -15607=>24810, -15608=>24811, -15609=>24812, -15610=>24813, -15611=>24814, -15612=>24815, -15613=>24816, -15614=>24817, -15615=>24818, -15616=>24819, -15617=>24820, -15618=>24821, -15619=>24822, -15620=>24823, -15621=>24824, -15622=>24825, -15623=>24826, -15624=>24827, -15625=>24828, -15626=>24829, -15627=>24830, -15628=>24831, -15629=>24832, -15630=>24833, -15631=>24834, -15632=>24835, -15633=>24836, -15634=>24837, -15635=>24838, -15636=>24839, -15637=>24840, -15638=>24841, -15639=>24842, -15640=>24843, -15641=>24844, -15642=>24845, -15643=>24846, -15644=>24847, -15645=>24848, -15646=>24849, -15647=>24850, -15648=>24851, -15649=>24852, -15650=>24853, -15651=>24854, -15652=>24855, -15653=>24856, -15654=>24857, -15655=>24858, -15656=>24859, -15657=>24860, -15658=>24861, -15659=>24862, -15660=>24863, -15661=>24864, -15662=>24865, -15663=>24866, -15664=>24867, -15665=>24868, -15666=>24869, -15667=>24870, -15668=>24871, -15669=>24872, -15670=>24873, -15671=>24874, -15672=>24875, -15673=>24876, -15674=>24877, -15675=>24878, -15676=>24879, -15677=>24880, -15678=>24881, -15679=>24882, -15680=>24883, -15681=>24884, -15682=>24885, -15683=>24886, -15684=>24887, -15685=>24888, -15686=>24889, -15687=>24890, -15688=>24891, -15689=>24892, -15690=>24893, -15691=>24894, -15692=>24895, -15693=>24896, -15694=>24897, -15695=>24898, -15696=>24899, -15697=>24900, -15698=>24901, -15699=>24902, -15700=>24903, -15701=>24904, -15702=>24905, -15703=>24906, -15704=>24907, -15705=>24908, -15706=>24909, -15707=>24910, -15708=>24911, -15709=>24912, -15710=>24913, -15711=>24914, -15712=>24915, -15713=>24916, -15714=>24917, -15715=>24918, -15716=>24919, -15717=>24920, -15718=>24921, -15719=>24922, -15720=>24923, -15721=>24924, -15722=>24925, -15723=>24926, -15724=>24927, -15725=>24928, -15726=>24929, -15727=>24930, -15728=>24931, -15729=>24932, -15730=>24933, -15731=>24934, -15732=>24935, -15733=>24936, -15734=>24937, -15735=>24938, -15736=>24939, -15737=>24940, -15738=>24941, -15739=>24942, -15740=>24943, -15741=>24944, -15742=>24945, -15743=>24946, -15744=>24947, -15745=>24948, -15746=>24949, -15747=>24950, -15748=>24951, -15749=>24952, -15750=>24953, -15751=>24954, -15752=>24955, -15753=>24956, -15754=>24957, -15755=>24958, -15756=>24959, -15757=>24960, -15758=>24961, -15759=>24962, -15760=>24963, -15761=>24964, -15762=>24965, -15763=>24966, -15764=>24967, -15765=>24968, -15766=>24969, -15767=>24970, -15768=>24971, -15769=>24972, -15770=>24973, -15771=>24974, -15772=>24975, -15773=>24976, -15774=>24977, -15775=>24978, -15776=>24979, -15777=>24980, -15778=>24981, -15779=>24982, -15780=>24983, -15781=>24984, -15782=>24985, -15783=>24986, -15784=>24987, -15785=>24988, -15786=>24989, -15787=>24990, -15788=>24991, -15789=>24992, -15790=>24993, -15791=>24994, -15792=>24995, -15793=>24996, -15794=>24997, -15795=>24998, -15796=>24999, -15797=>25000, -15798=>25001, -15799=>25002, -15800=>25003, -15801=>25004, -15802=>25005, -15803=>25006, -15804=>25007, -15805=>25008, -15806=>25009, -15807=>25010, -15808=>25011, -15809=>25012, -15810=>25013, -15811=>25014, -15812=>25015, -15813=>25016, -15814=>25017, -15815=>25018, -15816=>25019, -15817=>25020, -15818=>25021, -15819=>25022, -15820=>25023, -15821=>25024, -15822=>25025, -15823=>25026, -15824=>25027, -15825=>25028, -15826=>25029, -15827=>25030, -15828=>25031, -15829=>25032, -15830=>25033, -15831=>25034, -15832=>25035, -15833=>25036, -15834=>25037, -15835=>25038, -15836=>25039, -15837=>25040, -15838=>25041, -15839=>25042, -15840=>25043, -15841=>25044, -15842=>25045, -15843=>25046, -15844=>25047, -15845=>25048, -15846=>25049, -15847=>25050, -15848=>25051, -15849=>25052, -15850=>25053, -15851=>25054, -15852=>25055, -15853=>25056, -15854=>25057, -15855=>25058, -15856=>25059, -15857=>25060, -15858=>25061, -15859=>25062, -15860=>25063, -15861=>25064, -15862=>25065, -15863=>25066, -15864=>25067, -15865=>25068, -15866=>25069, -15867=>25070, -15868=>25071, -15869=>25072, -15870=>25073, -15871=>25074, -15872=>25075, -15873=>25076, -15874=>25077, -15875=>25078, -15876=>25079, -15877=>25080, -15878=>25081, -15879=>25082, -15880=>25083, -15881=>25084, -15882=>25085, -15883=>25086, -15884=>25087, -15885=>25088, -15886=>25089, -15887=>25090, -15888=>25091, -15889=>25092, -15890=>25093, -15891=>25094, -15892=>25095, -15893=>25096, -15894=>25097, -15895=>25098, -15896=>25099, -15897=>25100, -15898=>25101, -15899=>25102, -15900=>25103, -15901=>25104, -15902=>25105, -15903=>25106, -15904=>25107, -15905=>25108, -15906=>25109, -15907=>25110, -15908=>25111, -15909=>25112, -15910=>25113, -15911=>25114, -15912=>25115, -15913=>25116, -15914=>25117, -15915=>25118, -15916=>25119, -15917=>25120, -15918=>25121, -15919=>25122, -15920=>25123, -15921=>25124, -15922=>25125, -15923=>25126, -15924=>25127, -15925=>25128, -15926=>25129, -15927=>25130, -15928=>25131, -15929=>25132, -15930=>25133, -15931=>25134, -15932=>25135, -15933=>25136, -15934=>25137, -15935=>25138, -15936=>25139, -15937=>25140, -15938=>25141, -15939=>25142, -15940=>25143, -15941=>25144, -15942=>25145, -15943=>25146, -15944=>25147, -15945=>25148, -15946=>25149, -15947=>25150, -15948=>25151, -15949=>25152, -15950=>25153, -15951=>25154, -15952=>25155, -15953=>25156, -15954=>25157, -15955=>25158, -15956=>25159, -15957=>25160, -15958=>25161, -15959=>25162, -15960=>25163, -15961=>25164, -15962=>25165, -15963=>25166, -15964=>25167, -15965=>25168, -15966=>25169, -15967=>25170, -15968=>25171, -15969=>25172, -15970=>25173, -15971=>25174, -15972=>25175, -15973=>25176, -15974=>25177, -15975=>25178, -15976=>25179, -15977=>25180, -15978=>25181, -15979=>25182, -15980=>25183, -15981=>25184, -15982=>25185, -15983=>25186, -15984=>25187, -15985=>25188, -15986=>25189, -15987=>25190, -15988=>25191, -15989=>25192, -15990=>25193, -15991=>25194, -15992=>25195, -15993=>25196, -15994=>25197, -15995=>25198, -15996=>25199, -15997=>25200, -15998=>25201, -15999=>25202, -16000=>25203, -16001=>25204, -16002=>25205, -16003=>25206, -16004=>25207, -16005=>25208, -16006=>25209, -16007=>25210, -16008=>25211, -16009=>25212, -16010=>25213, -16011=>25214, -16012=>25215, -16013=>25216, -16014=>25217, -16015=>25218, -16016=>25219, -16017=>25220, -16018=>25221, -16019=>25222, -16020=>25223, -16021=>25224, -16022=>25225, -16023=>25226, -16024=>25227, -16025=>25228, -16026=>25229, -16027=>25230, -16028=>25231, -16029=>25232, -16030=>25233, -16031=>25234, -16032=>25235, -16033=>25236, -16034=>25237, -16035=>25238, -16036=>25239, -16037=>25240, -16038=>25241, -16039=>25242, -16040=>25243, -16041=>25244, -16042=>25245, -16043=>25246, -16044=>25247, -16045=>25248, -16046=>25249, -16047=>25250, -16048=>25251, -16049=>25252, -16050=>25253, -16051=>25254, -16052=>25255, -16053=>25256, -16054=>25257, -16055=>25258, -16056=>25259, -16057=>25260, -16058=>25261, -16059=>25262, -16060=>25263, -16061=>25264, -16062=>25265, -16063=>25266, -16064=>25267, -16065=>25268, -16066=>25269, -16067=>25270, -16068=>25271, -16069=>25272, -16070=>25273, -16071=>25274, -16072=>25275, -16073=>25276, -16074=>25277, -16075=>25278, -16076=>25279, -16077=>25280, -16078=>25281, -16079=>25282, -16080=>25283, -16081=>25284, -16082=>25285, -16083=>25286, -16084=>25287, -16085=>25288, -16086=>25289, -16087=>25290, -16088=>25291, -16089=>25292, -16090=>25293, -16091=>25294, -16092=>25295, -16093=>25296, -16094=>25297, -16095=>25298, -16096=>25299, -16097=>25300, -16098=>25301, -16099=>25302, -16100=>25303, -16101=>25304, -16102=>25305, -16103=>25306, -16104=>25307, -16105=>25308, -16106=>25309, -16107=>25310, -16108=>25311, -16109=>25312, -16110=>25313, -16111=>25314, -16112=>25315, -16113=>25316, -16114=>25317, -16115=>25318, -16116=>25319, -16117=>25320, -16118=>25321, -16119=>25322, -16120=>25323, -16121=>25324, -16122=>25325, -16123=>25326, -16124=>25327, -16125=>25328, -16126=>25329, -16127=>25330, -16128=>25331, -16129=>25332, -16130=>25333, -16131=>25334, -16132=>25335, -16133=>25336, -16134=>25337, -16135=>25338, -16136=>25339, -16137=>25340, -16138=>25341, -16139=>25342, -16140=>25343, -16141=>25344, -16142=>25345, -16143=>25346, -16144=>25347, -16145=>25348, -16146=>25349, -16147=>25350, -16148=>25351, -16149=>25352, -16150=>25353, -16151=>25354, -16152=>25355, -16153=>25356, -16154=>25357, -16155=>25358, -16156=>25359, -16157=>25360, -16158=>25361, -16159=>25362, -16160=>25363, -16161=>25364, -16162=>25365, -16163=>25366, -16164=>25367, -16165=>25368, -16166=>25369, -16167=>25370, -16168=>25371, -16169=>25372, -16170=>25373, -16171=>25374, -16172=>25375, -16173=>25376, -16174=>25377, -16175=>25378, -16176=>25379, -16177=>25380, -16178=>25381, -16179=>25382, -16180=>25383, -16181=>25384, -16182=>25385, -16183=>25386, -16184=>25387, -16185=>25388, -16186=>25389, -16187=>25390, -16188=>25391, -16189=>25392, -16190=>25393, -16191=>25394, -16192=>25395, -16193=>25396, -16194=>25397, -16195=>25398, -16196=>25399, -16197=>25400, -16198=>25401, -16199=>25402, -16200=>25403, -16201=>25404, -16202=>25405, -16203=>25406, -16204=>25407, -16205=>25408, -16206=>25409, -16207=>25410, -16208=>25411, -16209=>25412, -16210=>25413, -16211=>25414, -16212=>25415, -16213=>25416, -16214=>25417, -16215=>25418, -16216=>25419, -16217=>25420, -16218=>25421, -16219=>25422, -16220=>25423, -16221=>25424, -16222=>25425, -16223=>25426, -16224=>25427, -16225=>25428, -16226=>25429, -16227=>25430, -16228=>25431, -16229=>25432, -16230=>25433, -16231=>25434, -16232=>25435, -16233=>25436, -16234=>25437, -16235=>25438, -16236=>25439, -16237=>25440, -16238=>25441, -16239=>25442, -16240=>25443, -16241=>25444, -16242=>25445, -16243=>25446, -16244=>25447, -16245=>25448, -16246=>25449, -16247=>25450, -16248=>25451, -16249=>25452, -16250=>25453, -16251=>25454, -16252=>25455, -16253=>25456, -16254=>25457, -16255=>25458, -16256=>25459, -16257=>25460, -16258=>25461, -16259=>25462, -16260=>25463, -16261=>25464, -16262=>25465, -16263=>25466, -16264=>25467, -16265=>25468, -16266=>25469, -16267=>25470, -16268=>25471, -16269=>25472, -16270=>25473, -16271=>25474, -16272=>25475, -16273=>25476, -16274=>25477, -16275=>25478, -16276=>25479, -16277=>25480, -16278=>25481, -16279=>25482, -16280=>25483, -16281=>25484, -16282=>25485, -16283=>25486, -16284=>25487, -16285=>25488, -16286=>25489, -16287=>25490, -16288=>25491, -16289=>25492, -16290=>25493, -16291=>25494, -16292=>25495, -16293=>25496, -16294=>25497, -16295=>25498, -16296=>25499, -16297=>25500, -16298=>25501, -16299=>25502, -16300=>25503, -16301=>25504, -16302=>25505, -16303=>25506, -16304=>25507, -16305=>25508, -16306=>25509, -16307=>25510, -16308=>25511, -16309=>25512, -16310=>25513, -16311=>25514, -16312=>25515, -16313=>25516, -16314=>25517, -16315=>25518, -16316=>25519, -16317=>25520, -16318=>25521, -16319=>25522, -16320=>25523, -16321=>25524, -16322=>25525, -16323=>25526, -16324=>25527, -16325=>25528, -16326=>25529, -16327=>25530, -16328=>25531, -16329=>25532, -16330=>25533, -16331=>25534, -16332=>25535, -16333=>25536, -16334=>25537, -16335=>25538, -16336=>25539, -16337=>25540, -16338=>25541, -16339=>25542, -16340=>25543, -16341=>25544, -16342=>25545, -16343=>25546, -16344=>25547, -16345=>25548, -16346=>25549, -16347=>25550, -16348=>25551, -16349=>25552, -16350=>25553, -16351=>25554, -16352=>25555, -16353=>25556, -16354=>25557, -16355=>25558, -16356=>25559, -16357=>25560, -16358=>25561, -16359=>25562, -16360=>25563, -16361=>25564, -16362=>25565, -16363=>25566, -16364=>25567, -16365=>25568, -16366=>25569, -16367=>25570, -16368=>25571, -16369=>25572, -16370=>25573, -16371=>25574, -16372=>25575, -16373=>25576, -16374=>25577, -16375=>25578, -16376=>25579, -16377=>25580, -16378=>25581, -16379=>25582, -16380=>25583, -16381=>25584, -16382=>25585, -16383=>25586, -16384=>25587, -16385=>25588, -16386=>25589, -16387=>25590, -16388=>25591, -16389=>25592, -16390=>25593, -16391=>25594, -16392=>25595, -16393=>25596, -16394=>25597, -16395=>25598, -16396=>25599, -16397=>25600, -16398=>25601, -16399=>25602, -16400=>25603, -16401=>25604, -16402=>25605, -16403=>25606, -16404=>25607, -16405=>25608, -16406=>25609, -16407=>25610, -16408=>25611, -16409=>25612, -16410=>25613, -16411=>25614, -16412=>25615, -16413=>25616, -16414=>25617, -16415=>25618, -16416=>25619, -16417=>25620, -16418=>25621, -16419=>25622, -16420=>25623, -16421=>25624, -16422=>25625, -16423=>25626, -16424=>25627, -16425=>25628, -16426=>25629, -16427=>25630, -16428=>25631, -16429=>25632, -16430=>25633, -16431=>25634, -16432=>25635, -16433=>25636, -16434=>25637, -16435=>25638, -16436=>25639, -16437=>25640, -16438=>25641, -16439=>25642, -16440=>25643, -16441=>25644, -16442=>25645, -16443=>25646, -16444=>25647, -16445=>25648, -16446=>25649, -16447=>25650, -16448=>25651, -16449=>25652, -16450=>25653, -16451=>25654, -16452=>25655, -16453=>25656, -16454=>25657, -16455=>25658, -16456=>25659, -16457=>25660, -16458=>25661, -16459=>25662, -16460=>25663, -16461=>25664, -16462=>25665, -16463=>25666, -16464=>25667, -16465=>25668, -16466=>25669, -16467=>25670, -16468=>25671, -16469=>25672, -16471=>25673, -16472=>25674, -16473=>25675, -16474=>25676, -16475=>25677, -16476=>25678, -16477=>25679, -16478=>25680, -16479=>25681, -16480=>25682, -16481=>25683, -16482=>25684, -16483=>25685, -16484=>25686, -16485=>25687, -16486=>25688, -16487=>25689, -16488=>25690, -16489=>25691, -16490=>25692, -16491=>25693, -16492=>25694, -16493=>25695, -16494=>25696, -16495=>25697, -16496=>25698, -16497=>25699, -16498=>25700, -16499=>25701, -16500=>25702, -16501=>25703, -16502=>25704, -16503=>25705, -16504=>25706, -16505=>25707, -16506=>25708, -16507=>25709, -16508=>25710, -16509=>25711, -16510=>25712, -16511=>25713, -16512=>25714, -16513=>25715, -16514=>25716, -16515=>25717, -16516=>25718, -16517=>25719, -16518=>25720, -16519=>25721, -16520=>25722, -16521=>25723, -16522=>25724, -16523=>25725, -16524=>25726, -16525=>25727, -16526=>25728, -16527=>25729, -16528=>25730, -16529=>25731, -16530=>25732, -16531=>25733, -16532=>25734, -16533=>25735, -16534=>25736, -16535=>25737, -16536=>25738, -16537=>25739, -16538=>25740, -16539=>25741, -16540=>25742, -16541=>25743, -16542=>25744, -16543=>25745, -16544=>25746, -16545=>25747, -16546=>25748, -16547=>25749, -16548=>25750, -16549=>25751, -16550=>25752, -16551=>25753, -16552=>25754, -16553=>25755, -16554=>25756, -16555=>25757, -16556=>25758, -16557=>25759, -16558=>25760, -16559=>25761, -16560=>25762, -16561=>25763, -16562=>25764, -16563=>25765, -16564=>25766, -16565=>25767, -16566=>25768, -16567=>25769, -16568=>25770, -16569=>25771, -16570=>25772, -16571=>25773, -16572=>25774, -16573=>25775, -16574=>25776, -16575=>25777, -16576=>25778, -16577=>25779, -16578=>25780, -16579=>25781, -16580=>25782, -16581=>25783, -16582=>25784, -16583=>25785, -16584=>25786, -16585=>25787, -16586=>25788, -16587=>25789, -16588=>25790, -16589=>25791, -16590=>25792, -16591=>25793, -16592=>25794, -16593=>25795, -16594=>25796, -16595=>25797, -16596=>25798, -16597=>25799, -16598=>25800, -16599=>25801, -16600=>25802, -16601=>25803, -16602=>25804, -16603=>25805, -16604=>25806, -16605=>25807, -16606=>25808, -16607=>25809, -16608=>25810, -16609=>25811, -16610=>25812, -16611=>25813, -16612=>25814, -16613=>25815, -16614=>25816, -16615=>25817, -16616=>25818, -16617=>25819, -16618=>25820, -16619=>25821, -16620=>25822, -16621=>25823, -16622=>25824, -16623=>25825, -16624=>25826, -16625=>25827, -16626=>25828, -16627=>25829, -16628=>25830, -16629=>25831, -16630=>25832, -16631=>25833, -16632=>25834, -16633=>25835, -16634=>25836, -16635=>25837, -16636=>25838, -16637=>25839, -16638=>25840, -16639=>25841, -16640=>25842, -16641=>25843, -16642=>25844, -16643=>25845, -16644=>25846, -16645=>25847, -16646=>25848, -16647=>25849, -16648=>25850, -16649=>25851, -16650=>25852, -16651=>25853, -16652=>25854, -16653=>25855, -16654=>25856, -16655=>25857, -16656=>25858, -16657=>25859, -16658=>25860, -16659=>25861, -16660=>25862, -16661=>25863, -16662=>25864, -16663=>25865, -16664=>25866, -16665=>25867, -16666=>25868, -16667=>25869, -16668=>25870, -16669=>25871, -16670=>25872, -16671=>25873, -16672=>25874, -16673=>25875, -16674=>25876, -16675=>25877, -16676=>25878, -16677=>25879, -16678=>25880, -16679=>25881, -16680=>25882, -16681=>25883, -16682=>25884, -16683=>25885, -16684=>25886, -16685=>25887, -16686=>25888, -16687=>25889, -16688=>25890, -16689=>25891, -16690=>25892, -16691=>25893, -16692=>25894, -16693=>25895, -16694=>25896, -16695=>25897, -16696=>25898, -16697=>25899, -16698=>25900, -16699=>25901, -16700=>25902, -16701=>25903, -16702=>25904, -16703=>25905, -16704=>25906, -16705=>25907, -16706=>25908, -16707=>25909, -16708=>25910, -16709=>25911, -16710=>25912, -16711=>25913, -16712=>25914, -16713=>25915, -16714=>25916, -16715=>25917, -16716=>25918, -16717=>25919, -16718=>25920, -16719=>25921, -16720=>25922, -16721=>25923, -16722=>25924, -16723=>25925, -16724=>25926, -16725=>25927, -16726=>25928, -16727=>25929, -16728=>25930, -16729=>25931, -16730=>25932, -16731=>25933, -16732=>25934, -16733=>25935, -16734=>25936, -16736=>25937, -16737=>25938, -16738=>25939, -16739=>25940, -16740=>25941, -16741=>25942, -16742=>25943, -16743=>25944, -16744=>25945, -16745=>25946, -16746=>25947, -16747=>25948, -16748=>25949, -16749=>25950, -16750=>25951, -16751=>25952, -16752=>25953, -16753=>25954, -16754=>25955, -16755=>25956, -16756=>25957, -16757=>25958, -16758=>25959, -16759=>25960, -16760=>25961, -16761=>25962, -16762=>25963, -16763=>25964, -16764=>25965, -16765=>25966, -16766=>25967, -16767=>25968, -16768=>25969, -16769=>25970, -16770=>25971, -16771=>25972, -16772=>25973, -16773=>25974, -16774=>25975, -16775=>25976, -16776=>25977, -16777=>25978, -16778=>25979, -16779=>25980, -16780=>25981, -16781=>25982, -16782=>25983, -16783=>25984, -16784=>25985, -16785=>25986, -16786=>25987, -16787=>25988, -16788=>25989, -16789=>25990, -16790=>25991, -16791=>25992, -16792=>25993, -16793=>25994, -16794=>25995, -16795=>25996, -16796=>25997, -16797=>25998, -16798=>25999, -16799=>26000, -16800=>26001, -16801=>26002, -16802=>26003, -16803=>26004, -16804=>26005, -16805=>26006, -16806=>26007, -16807=>26008, -16808=>26009, -16809=>26010, -16810=>26011, -16811=>26012, -16812=>26013, -16813=>26014, -16814=>26015, -16815=>26016, -16816=>26017, -16817=>26018, -16818=>26019, -16819=>26020, -16820=>26021, -16821=>26022, -16822=>26023, -16823=>26024, -16824=>26025, -16825=>26026, -16826=>26027, -16827=>26028, -16828=>26029, -16829=>26030, -16830=>26031, -16831=>26032, -16832=>26033, -16833=>26034, -16834=>26035, -16835=>26036, -16836=>26037, -16837=>26038, -16838=>26039, -16839=>26040, -16840=>26041, -16841=>26042, -16842=>26043, -16843=>26044, -16844=>26045, -16845=>26046, -16846=>26047, -16847=>26048, -16848=>26049, -16849=>26050, -16850=>26051, -16851=>26052, -16852=>26053, -16853=>26054, -16854=>26055, -16855=>26056, -16856=>26057, -16857=>26058, -16858=>26059, -16859=>26060, -16860=>26061, -16861=>26062, -16862=>26063, -16863=>26064, -16864=>26065, -16865=>26066, -16866=>26067, -16867=>26068, -16868=>26069, -16869=>26070, -16870=>26071, -16871=>26072, -16872=>26073, -16873=>26074, -16874=>26075, -16875=>26076, -16876=>26077, -16877=>26078, -16878=>26079, -16879=>26080, -16880=>26081, -16881=>26082, -16882=>26083, -16883=>26084, -16884=>26085, -16885=>26086, -16886=>26087, -16887=>26088, -16888=>26089, -16889=>26090, -16890=>26091, -16891=>26092, -16892=>26093, -16893=>26094, -16894=>26095, -16895=>26096, -16896=>26097, -16897=>26098, -16898=>26099, -16899=>26100, -16900=>26101, -16901=>26102, -16902=>26103, -16903=>26104, -16904=>26105, -16905=>26106, -16906=>26107, -16907=>26108, -16908=>26109, -16909=>26110, -16910=>26111, -16911=>26112, -16912=>26113, -16913=>26114, -16914=>26115, -16915=>26116, -16916=>26117, -16917=>26118, -16918=>26119, -16919=>26120, -16920=>26121, -16921=>26122, -16922=>26123, -16923=>26124, -16924=>26125, -16925=>26126, -16926=>26127, -16927=>26128, -16928=>26129, -16929=>26130, -16930=>26131, -16931=>26132, -16932=>26133, -16933=>26134, -16934=>26135, -16935=>26136, -16936=>26137, -16937=>26138, -16938=>26139, -16939=>26140, -16940=>26141, -16941=>26142, -16942=>26143, -16943=>26144, -16944=>26145, -16945=>26146, -16946=>26147, -16947=>26148, -16948=>26149, -16949=>26150, -16950=>26151, -16951=>26152, -16952=>26153, -16953=>26154, -16954=>26155, -16955=>26156, -16956=>26157, -16957=>26158, -16958=>26159, -16959=>26160, -16960=>26161, -16961=>26162, -16962=>26163, -16963=>26164, -16964=>26165, -16965=>26166, -16966=>26167, -16967=>26168, -16968=>26169, -16969=>26170, -16970=>26171, -16971=>26172, -16972=>26173, -16973=>26174, -16974=>26175, -16975=>26176, -16976=>26177, -16977=>26178, -16978=>26179, -16979=>26180, -16980=>26181, -16981=>26182, -16982=>26183, -16983=>26184, -16984=>26185, -16985=>26186, -16986=>26187, -16987=>26188, -16988=>26189, -16989=>26190, -16990=>26191, -16991=>26192, -16992=>26193, -16993=>26194, -16994=>26195, -16995=>26196, -16996=>26197, -16997=>26198, -16998=>26199, -16999=>26200, -17000=>26201, -17001=>26202, -17002=>26203, -17003=>26204, -17004=>26205, -17005=>26206, -17006=>26207, -17007=>26208, -17008=>26209, -17009=>26210, -17010=>26211, -17011=>26212, -17012=>26213, -17013=>26214, -17014=>26215, -17015=>26216, -17016=>26217, -17017=>26218, -17018=>26219, -17019=>26220, -17020=>26221, -17021=>26222, -17022=>26223, -17023=>26224, -17024=>26225, -17025=>26226, -17026=>26227, -17027=>26228, -17028=>26229, -17029=>26230, -17030=>26231, -17031=>26232, -17032=>26233, -17033=>26234, -17034=>26235, -17035=>26236, -17036=>26237, -17037=>26238, -17038=>26239, -17039=>26240, -17040=>26241, -17041=>26242, -17042=>26243, -17043=>26244, -17044=>26245, -17045=>26246, -17046=>26247, -17047=>26248, -17048=>26249, -17049=>26250, -17050=>26251, -17051=>26252, -17052=>26253, -17053=>26254, -17054=>26255, -17055=>26256, -17056=>26257, -17057=>26258, -17058=>26259, -17059=>26260, -17060=>26261, -17061=>26262, -17062=>26263, -17063=>26264, -17064=>26265, -17065=>26266, -17066=>26267, -17067=>26268, -17068=>26269, -17069=>26270, -17070=>26271, -17071=>26272, -17072=>26273, -17073=>26274, -17074=>26275, -17075=>26276, -17076=>26277, -17077=>26278, -17078=>26279, -17079=>26280, -17080=>26281, -17081=>26282, -17082=>26283, -17083=>26284, -17084=>26285, -17085=>26286, -17086=>26287, -17087=>26288, -17088=>26289, -17089=>26290, -17090=>26291, -17091=>26292, -17092=>26293, -17093=>26294, -17094=>26295, -17095=>26296, -17096=>26297, -17097=>26298, -17098=>26299, -17099=>26300, -17100=>26301, -17101=>26302, -17102=>26303, -17103=>26304, -17104=>26305, -17105=>26306, -17106=>26307, -17107=>26308, -17108=>26309, -17109=>26310, -17110=>26311, -17111=>26312, -17112=>26313, -17113=>26314, -17114=>26315, -17115=>26316, -17116=>26317, -17117=>26318, -17118=>26319, -17119=>26320, -17120=>26321, -17121=>26322, -17122=>26323, -17123=>26324, -17124=>26325, -17125=>26326, -17126=>26327, -17127=>26328, -17128=>26329, -17129=>26330, -17130=>26331, -17131=>26332, -17132=>26333, -17133=>26334, -17134=>26335, -17135=>26336, -17136=>26337, -17137=>26338, -17138=>26339, -17139=>26340, -17140=>26341, -17141=>26342, -17142=>26343, -17143=>26344, -17144=>26345, -17145=>26346, -17146=>26347, -17147=>26348, -17148=>26349, -17149=>26350, -17150=>26351, -17151=>26352, -17152=>26353, -17153=>26354, -17154=>26355, -17155=>26356, -17156=>26357, -17157=>26358, -17158=>26359, -17159=>26360, -17160=>26361, -17161=>26362, -17162=>26363, -17163=>26364, -17164=>26365, -17165=>26366, -17166=>26367, -17167=>26368, -17168=>26369, -17169=>26370, -17170=>26371, -17171=>26372, -17172=>26373, -17173=>26374, -17174=>26375, -17175=>26376, -17176=>26377, -17177=>26378, -17178=>26379, -17179=>26380, -17180=>26381, -17181=>26382, -17182=>26383, -17183=>26384, -17184=>26385, -17185=>26386, -17186=>26387, -17187=>26388, -17188=>26389, -17189=>26390, -17190=>26391, -17191=>26392, -17192=>26393, -17193=>26394, -17194=>26395, -17195=>26396, -17196=>26397, -17197=>26398, -17198=>26399, -17199=>26400, -17200=>26401, -17201=>26402, -17202=>26403, -17203=>26404, -17204=>26405, -17205=>26406, -17206=>26407, -17208=>26408, -17209=>26409, -17210=>26410, -17211=>26411, -17212=>26412, -17213=>26413, -17214=>26414, -17215=>26415, -17216=>26416, -17217=>26417, -17218=>26418, -17219=>26419, -17220=>26420, -17221=>26421, -17222=>26422, -17223=>26423, -17224=>26424, -17225=>26425, -17226=>26426, -17227=>26427, -17228=>26428, -17229=>26429, -17230=>26430, -17231=>26431, -17232=>26432, -17233=>26433, -17234=>26434, -17235=>26435, -17236=>26436, -17237=>26437, -17238=>26438, -17239=>26439, -17240=>26440, -17241=>26441, -17242=>26442, -17243=>26443, -17244=>26444, -17245=>26445, -17246=>26446, -17247=>26447, -17248=>26448, -17249=>26449, -17250=>26450, -17251=>26451, -17252=>26452, -17253=>26453, -17254=>26454, -17255=>26455, -17256=>26456, -17257=>26457, -17258=>26458, -17259=>26459, -17260=>26460, -17261=>26461, -17262=>26462, -17263=>26463, -17264=>26464, -17265=>26465, -17266=>26466, -17267=>26467, -17268=>26468, -17269=>26469, -17270=>26470, -17271=>26471, -17272=>26472, -17273=>26473, -17274=>26474, -17275=>26475, -17276=>26476, -17277=>26477, -17278=>26478, -17279=>26479, -17280=>26480, -17281=>26481, -17282=>26482, -17283=>26483, -17284=>26484, -17285=>26485, -17286=>26486, -17287=>26487, -17288=>26488, -17289=>26489, -17290=>26490, -17291=>26491, -17292=>26492, -17293=>26493, -17294=>26494, -17295=>26495, -17296=>26496, -17297=>26497, -17298=>26498, -17299=>26499, -17300=>26500, -17301=>26501, -17302=>26502, -17303=>26503, -17304=>26504, -17305=>26505, -17306=>26506, -17307=>26507, -17308=>26508, -17309=>26509, -17310=>26510, -17311=>26511, -17312=>26512, -17313=>26513, -17314=>26514, -17315=>26515, -17316=>26516, -17317=>26517, -17318=>26518, -17319=>26519, -17320=>26520, -17321=>26521, -17322=>26522, -17323=>26523, -17325=>26524, -17326=>26525, -17327=>26526, -17328=>26527, -17330=>26528, -17331=>26529, -17332=>26530, -17333=>26531, -17334=>26532, -17335=>26533, -17336=>26534, -17337=>26535, -17338=>26536, -17339=>26537, -17340=>26538, -17341=>26539, -17342=>26540, -17343=>26541, -17344=>26542, -17345=>26543, -17346=>26544, -17347=>26545, -17348=>26546, -17349=>26547, -17350=>26548, -17351=>26549, -17352=>26550, -17353=>26551, -17354=>26552, -17355=>26553, -17356=>26554, -17357=>26555, -17358=>26556, -17359=>26557, -17360=>26558, -17361=>26559, -17362=>26560, -17363=>26561, -17364=>26562, -17365=>26563, -17366=>26564, -17367=>26565, -17368=>26566, -17369=>26567, -17370=>26568, -17371=>26569, -17372=>26570, -17374=>26571, -17375=>26572, -17376=>26573, -17377=>26574, -17378=>26575, -17379=>26576, -17380=>26577, -17381=>26578, -17382=>26579, -17383=>26580, -17384=>26581, -17385=>26582, -17386=>26583, -17387=>26584, -17388=>26585, -17389=>26586, -17390=>26587, -17391=>26588, -17392=>26589, -17393=>26590, -17394=>26591, -17395=>26592, -17396=>26593, -17397=>26594, -17398=>26595, -17399=>26596, -17400=>26597, -17401=>26598, -17402=>26599, -17403=>26600, -17404=>26601, -17405=>26602, -17406=>26603, -17407=>26604, -17408=>26605, -17409=>26606, -17410=>26607, -17411=>26608, -17412=>26609, -17413=>26610, -17414=>26611, -17415=>26612, -17416=>26613, -17417=>26614, -17418=>26615, -17419=>26616, -17420=>26617, -17421=>26618, -17422=>26619, -17423=>26620, -17424=>26621, -17425=>26622, -17426=>26623, -17427=>26624, -17428=>26625, -17429=>26626, -17430=>26627, -17431=>26628, -17432=>26629, -17433=>26630, -17434=>26631, -17435=>26632, -17436=>26633, -17437=>26634, -17438=>26635, -17439=>26636, -17440=>26637, -17441=>26638, -17442=>26639, -17443=>26640, -17444=>26641, -17445=>26642, -17446=>26643, -17447=>26644, -17448=>26645, -17449=>26646, -17450=>26647, -17451=>26648, -17452=>26649, -17453=>26650, -17454=>26651, -17455=>26652, -17456=>26653, -17457=>26654, -17458=>26655, -17459=>26656, -17460=>26657, -17461=>26658, -17462=>26659, -17463=>26660, -17464=>26661, -17465=>26662, -17466=>26663, -17467=>26664, -17468=>26665, -17469=>26666, -17470=>26667, -17471=>26668, -17472=>26669, -17473=>26670, -17474=>26671, -17475=>26672, -17476=>26673, -17477=>26674, -17478=>26675, -17479=>26676, -17480=>26677, -17481=>26678, -17482=>26679, -17483=>26680, -17484=>26681, -17485=>26682, -17486=>26683, -17487=>26684, -17488=>26685, -17489=>26686, -17490=>26687, -17491=>26688, -17492=>26689, -17493=>26690, -17494=>26691, -17495=>26692, -17496=>26693, -17497=>26694, -17498=>26695, -17499=>26696, -17500=>26697, -17501=>26698, -17502=>26699, -17503=>26700, -17504=>26701, -17505=>26702, -17506=>26703, -17507=>26704, -17508=>26705, -17509=>26706, -17510=>26707, -17511=>26708, -17512=>26709, -17513=>26710, -17514=>26711, -17515=>26712, -17516=>26713, -17517=>26714, -17518=>26715, -17519=>26716, -17520=>26717, -17521=>26718, -17522=>26719, -17523=>26720, -17524=>26721, -17525=>26722, -17526=>26723, -17527=>26724, -17528=>26725, -17529=>26726, -17530=>26727, -17531=>26728, -17532=>26729, -17533=>26730, -17534=>26731, -17535=>26732, -17536=>26733, -17537=>26734, -17538=>26735, -17539=>26736, -17540=>26737, -17541=>26738, -17542=>26739, -17543=>26740, -17544=>26741, -17545=>26742, -17546=>26743, -17547=>26744, -17548=>26745, -17549=>26746, -17550=>26747, -17551=>26748, -17552=>26749, -17553=>26750, -17554=>26751, -17555=>26752, -17556=>26753, -17557=>26754, -17558=>26755, -17559=>26756, -17560=>26757, -17561=>26758, -17562=>26759, -17563=>26760, -17564=>26761, -17565=>26762, -17566=>26763, -17567=>26764, -17568=>26765, -17569=>26766, -17570=>26767, -17571=>26768, -17572=>26769, -17573=>26770, -17574=>26771, -17575=>26772, -17576=>26773, -17577=>26774, -17578=>26775, -17579=>26776, -17580=>26777, -17581=>26778, -17582=>26779, -17583=>26780, -17584=>26781, -17585=>26782, -17586=>26783, -17587=>26784, -17588=>26785, -17589=>26786, -17590=>26787, -17591=>26788, -17592=>26789, -17593=>26790, -17594=>26791, -17595=>26792, -17596=>26793, -17597=>26794, -17598=>26795, -17599=>26796, -17600=>26797, -17601=>26798, -17602=>26799, -17603=>26800, -17604=>26801, -17605=>26802, -17606=>26803, -17607=>26804, -17608=>26805, -17609=>26806, -17610=>26807, -17611=>26808, -17612=>26809, -17613=>26810, -17614=>26811, -17615=>26812, -17616=>26813, -17617=>26814, -17618=>26815, -17619=>26816, -17620=>26817, -17621=>26818, -17623=>26819, -17624=>26820, -17625=>26821, -17626=>26822, -17627=>26823, -17628=>26824, -17629=>26825, -17630=>26826, -17631=>26827, -17632=>26828, -17633=>26829, -17634=>26830, -17635=>26831, -17636=>26832, -17637=>26833, -17638=>26834, -17639=>26835, -17640=>26836, -17641=>26837, -17642=>26838, -17643=>26839, -17644=>26840, -17645=>26841, -17646=>26842, -17647=>26843, -17648=>26844, -17649=>26845, -17650=>26846, -17651=>26847, -17652=>26848, -17653=>26849, -17654=>26850, -17655=>26851, -17656=>26852, -17657=>26853, -17658=>26854, -17659=>26855, -17660=>26856, -17661=>26857, -17662=>26858, -17663=>26859, -17664=>26860, -17665=>26861, -17666=>26862, -17667=>26863, -17668=>26864, -17669=>26865, -17670=>26866, -17671=>26867, -17672=>26868, -17673=>26869, -17674=>26870, -17675=>26871, -17676=>26872, -17677=>26873, -17678=>26874, -17679=>26875, -17680=>26876, -17681=>26877, -17682=>26878, -17683=>26879, -17684=>26880, -17685=>26881, -17686=>26882, -17687=>26883, -17688=>26884, -17689=>26885, -17690=>26886, -17691=>26887, -17692=>26888, -17693=>26889, -17694=>26890, -17695=>26891, -17696=>26892, -17697=>26893, -17698=>26894, -17699=>26895, -17700=>26896, -17701=>26897, -17702=>26898, -17703=>26899, -17704=>26900, -17705=>26901, -17706=>26902, -17707=>26903, -17708=>26904, -17709=>26905, -17710=>26906, -17711=>26907, -17712=>26908, -17713=>26909, -17714=>26910, -17715=>26911, -17716=>26912, -17717=>26913, -17718=>26914, -17719=>26915, -17720=>26916, -17721=>26917, -17722=>26918, -17723=>26919, -17724=>26920, -17725=>26921, -17726=>26922, -17727=>26923, -17728=>26924, -17729=>26925, -17730=>26926, -17731=>26927, -17732=>26928, -17733=>26929, -17734=>26930, -17735=>26931, -17736=>26932, -17737=>26933, -17738=>26934, -17739=>26935, -17740=>26936, -17741=>26937, -17742=>26938, -17743=>26939, -17744=>26940, -17745=>26941, -17746=>26942, -17747=>26943, -17748=>26944, -17749=>26945, -17750=>26946, -17751=>26947, -17752=>26948, -17753=>26949, -17754=>26950, -17755=>26951, -17756=>26952, -17757=>26953, -17758=>26954, -17759=>26955, -17760=>26956, -17761=>26957, -17762=>26958, -17763=>26959, -17764=>26960, -17765=>26961, -17766=>26962, -17767=>26963, -17768=>26964, -17769=>26965, -17770=>26966, -17771=>26967, -17772=>26968, -17773=>26969, -17774=>26970, -17775=>26971, -17776=>26972, -17777=>26973, -17778=>26974, -17779=>26975, -17780=>26976, -17781=>26977, -17782=>26978, -17783=>26979, -17784=>26980, -17785=>26981, -17786=>26982, -17787=>26983, -17788=>26984, -17789=>26985, -17790=>26986, -17791=>26987, -17792=>26988, -17793=>26989, -17794=>26990, -17795=>26991, -17796=>26992, -17797=>26993, -17798=>26994, -17799=>26995, -17800=>26996, -17801=>26997, -17802=>26998, -17803=>26999, -17804=>27000, -17805=>27001, -17806=>27002, -17807=>27003, -17808=>27004, -17809=>27005, -17810=>27006, -17811=>27007, -17812=>27008, -17813=>27009, -17814=>27010, -17815=>27011, -17816=>27012, -17817=>27013, -17818=>27014, -17819=>27015, -17820=>27016, -17821=>27017, -17822=>27018, -17823=>27019, -17824=>27020, -17825=>27021, -17826=>27022, -17827=>27023, -17828=>27024, -17829=>27025, -17830=>27026, -17831=>27027, -17832=>27028, -17833=>27029, -17834=>27030, -17835=>27031, -17836=>27032, -17837=>27033, -17838=>27034, -17839=>27035, -17840=>27036, -17841=>27037, -17842=>27038, -17843=>27039, -17844=>27040, -17845=>27041, -17846=>27042, -17847=>27043, -17848=>27044, -17849=>27045, -17850=>27046, -17851=>27047, -17852=>27048, -17853=>27049, -17854=>27050, -17855=>27051, -17856=>27052, -17857=>27053, -17858=>27054, -17859=>27055, -17860=>27056, -17861=>27057, -17862=>27058, -17863=>27059, -17864=>27060, -17865=>27061, -17866=>27062, -17867=>27063, -17868=>27064, -17869=>27065, -17870=>27066, -17871=>27067, -17872=>27068, -17873=>27069, -17874=>27070, -17875=>27071, -17876=>27072, -17877=>27073, -17878=>27074, -17879=>27075, -17880=>27076, -17881=>27077, -17882=>27078, -17883=>27079, -17884=>27080, -17885=>27081, -17886=>27082, -17887=>27083, -17888=>27084, -17889=>27085, -17890=>27086, -17891=>27087, -17892=>27088, -17893=>27089, -17894=>27090, -17895=>27091, -17896=>27092, -17897=>27093, -17898=>27094, -17899=>27095, -17900=>27096, -17901=>27097, -17902=>27098, -17903=>27099, -17904=>27100, -17905=>27101, -17906=>27102, -17907=>27103, -17908=>27104, -17909=>27105, -17910=>27106, -17911=>27107, -17912=>27108, -17913=>27109, -17914=>27110, -17915=>27111, -17916=>27112, -17917=>27113, -17918=>27114, -17919=>27115, -17920=>27116, -17921=>27117, -17922=>27118, -17923=>27119, -17924=>27120, -17925=>27121, -17926=>27122, -17927=>27123, -17928=>27124, -17929=>27125, -17930=>27126, -17931=>27127, -17932=>27128, -17933=>27129, -17934=>27130, -17935=>27131, -17936=>27132, -17937=>27133, -17938=>27134, -17939=>27135, -17940=>27136, -17941=>27137, -17942=>27138, -17943=>27139, -17944=>27140, -17945=>27141, -17946=>27142, -17947=>27143, -17948=>27144, -17949=>27145, -17950=>27146, -17951=>27147, -17952=>27148, -17953=>27149, -17954=>27150, -17955=>27151, -17956=>27152, -17957=>27153, -17958=>27154, -17959=>27155, -17960=>27156, -17961=>27157, -17962=>27158, -17963=>27159, -17964=>27160, -17965=>27161, -17966=>27162, -17967=>27163, -17968=>27164, -17969=>27165, -17970=>27166, -17971=>27167, -17972=>27168, -17973=>27169, -17974=>27170, -17975=>27171, -17976=>27172, -17977=>27173, -17978=>27174, -17979=>27175, -17980=>27176, -17981=>27177, -17982=>27178, -17983=>27179, -17984=>27180, -17985=>27181, -17986=>27182, -17987=>27183, -17988=>27184, -17989=>27185, -17990=>27186, -17991=>27187, -17992=>27188, -17993=>27189, -17994=>27190, -17995=>27191, -17997=>27192, -17998=>27193, -17999=>27194, -18000=>27195, -18001=>27196, -18002=>27197, -18003=>27198, -18004=>27199, -18005=>27200, -18006=>27201, -18007=>27202, -18008=>27203, -18009=>27204, -18010=>27205, -18011=>27206, -18012=>27207, -18013=>27208, -18014=>27209, -18015=>27210, -18016=>27211, -18018=>27212, -18019=>27213, -18020=>27214, -18021=>27215, -18022=>27216, -18023=>27217, -18024=>27218, -18025=>27219, -18026=>27220, -18027=>27221, -18028=>27222, -18029=>27223, -18030=>27224, -18031=>27225, -18032=>27226, -18033=>27227, -18034=>27228, -18035=>27229, -18036=>27230, -18037=>27231, -18038=>27232, -18039=>27233, -18040=>27234, -18041=>27235, -18042=>27236, -18043=>27237, -18044=>27238, -18045=>27239, -18046=>27240, -18047=>27241, -18048=>27242, -18049=>27243, -18050=>27244, -18051=>27245, -18052=>27246, -18053=>27247, -18054=>27248, -18055=>27249, -18056=>27250, -18057=>27251, -18058=>27252, -18059=>27253, -18060=>27254, -18061=>27255, -18062=>27256, -18063=>27257, -18064=>27258, -18065=>27259, -18066=>27260, -18067=>27261, -18068=>27262, -18069=>27263, -18070=>27264, -18071=>27265, -18072=>27266, -18073=>27267, -18074=>27268, -18075=>27269, -18076=>27270, -18077=>27271, -18078=>27272, -18079=>27273, -18080=>27274, -18081=>27275, -18082=>27276, -18083=>27277, -18084=>27278, -18085=>27279, -18086=>27280, -18087=>27281, -18088=>27282, -18089=>27283, -18090=>27284, -18091=>27285, -18092=>27286, -18093=>27287, -18094=>27288, -18095=>27289, -18096=>27290, -18097=>27291, -18098=>27292, -18099=>27293, -18100=>27294, -18101=>27295, -18102=>27296, -18103=>27297, -18104=>27298, -18105=>27299, -18106=>27300, -18107=>27301, -18108=>27302, -18109=>27303, -18110=>27304, -18111=>27305, -18112=>27306, -18113=>27307, -18114=>27308, -18115=>27309, -18116=>27310, -18117=>27311, -18118=>27312, -18119=>27313, -18120=>27314, -18121=>27315, -18122=>27316, -18123=>27317, -18124=>27318, -18125=>27319, -18126=>27320, -18127=>27321, -18128=>27322, -18129=>27323, -18130=>27324, -18131=>27325, -18132=>27326, -18133=>27327, -18134=>27328, -18135=>27329, -18136=>27330, -18137=>27331, -18138=>27332, -18139=>27333, -18140=>27334, -18141=>27335, -18142=>27336, -18143=>27337, -18144=>27338, -18145=>27339, -18146=>27340, -18147=>27341, -18148=>27342, -18149=>27343, -18150=>27344, -18151=>27345, -18152=>27346, -18153=>27347, -18154=>27348, -18155=>27349, -18156=>27350, -18157=>27351, -18158=>27352, -18159=>27353, -18160=>27354, -18161=>27355, -18162=>27356, -18163=>27357, -18164=>27358, -18165=>27359, -18166=>27360, -18167=>27361, -18168=>27362, -18169=>27363, -18170=>27364, -18171=>27365, -18172=>27366, -18173=>27367, -18174=>27368, -18175=>27369, -18176=>27370, -18177=>27371, -18178=>27372, -18179=>27373, -18180=>27374, -18181=>27375, -18182=>27376, -18183=>27377, -18184=>27378, -18185=>27379, -18186=>27380, -18187=>27381, -18188=>27382, -18189=>27383, -18190=>27384, -18191=>27385, -18192=>27386, -18193=>27387, -18194=>27388, -18195=>27389, -18196=>27390, -18197=>27391, -18198=>27392, -18199=>27393, -18200=>27394, -18201=>27395, -18202=>27396, -18203=>27397, -18204=>27398, -18205=>27399, -18206=>27400, -18207=>27401, -18208=>27402, -18209=>27403, -18210=>27404, -18212=>27405, -18213=>27406, -18214=>27407, -18215=>27408, -18216=>27409, -18218=>27410, -18219=>27411, -18220=>27412, -18221=>27413, -18222=>27414, -18223=>27415, -18224=>27416, -18225=>27417, -18226=>27418, -18227=>27419, -18228=>27420, -18229=>27421, -18230=>27422, -18231=>27423, -18232=>27424, -18233=>27425, -18234=>27426, -18235=>27427, -18236=>27428, -18237=>27429, -18238=>27430, -18239=>27431, -18240=>27432, -18241=>27433, -18242=>27434, -18243=>27435, -18244=>27436, -18245=>27437, -18246=>27438, -18247=>27439, -18248=>27440, -18249=>27441, -18250=>27442, -18251=>27443, -18252=>27444, -18253=>27445, -18254=>27446, -18255=>27447, -18256=>27448, -18257=>27449, -18258=>27450, -18259=>27451, -18260=>27452, -18261=>27453, -18262=>27454, -18263=>27455, -18264=>27456, -18265=>27457, -18266=>27458, -18267=>27459, -18268=>27460, -18269=>27461, -18270=>27462, -18271=>27463, -18272=>27464, -18273=>27465, -18274=>27466, -18275=>27467, -18276=>27468, -18277=>27469, -18278=>27470, -18279=>27471, -18280=>27472, -18281=>27473, -18282=>27474, -18283=>27475, -18284=>27476, -18285=>27477, -18286=>27478, -18287=>27479, -18288=>27480, -18289=>27481, -18290=>27482, -18291=>27483, -18292=>27484, -18293=>27485, -18294=>27486, -18295=>27487, -18296=>27488, -18297=>27489, -18298=>27490, -18299=>27491, -18301=>27492, -18302=>27493, -18303=>27494, -18304=>27495, -18305=>27496, -18306=>27497, -18307=>27498, -18308=>27499, -18309=>27500, -18310=>27501, -18311=>27502, -18312=>27503, -18313=>27504, -18314=>27505, -18315=>27506, -18316=>27507, -18318=>27508, -18319=>27509, -18320=>27510, -18321=>27511, -18322=>27512, -18323=>27513, -18324=>27514, -18325=>27515, -18326=>27516, -18327=>27517, -18328=>27518, -18329=>27519, -18330=>27520, -18331=>27521, -18332=>27522, -18333=>27523, -18334=>27524, -18335=>27525, -18336=>27526, -18337=>27527, -18338=>27528, -18339=>27529, -18340=>27530, -18341=>27531, -18342=>27532, -18343=>27533, -18344=>27534, -18345=>27535, -18346=>27536, -18347=>27537, -18348=>27538, -18349=>27539, -18350=>27540, -18351=>27541, -18352=>27542, -18353=>27543, -18354=>27544, -18355=>27545, -18356=>27546, -18357=>27547, -18358=>27548, -18359=>27549, -18360=>27550, -18361=>27551, -18362=>27552, -18363=>27553, -18364=>27554, -18365=>27555, -18366=>27556, -18367=>27557, -18368=>27558, -18369=>27559, -18370=>27560, -18371=>27561, -18372=>27562, -18373=>27563, -18374=>27564, -18375=>27565, -18376=>27566, -18377=>27567, -18378=>27568, -18379=>27569, -18380=>27570, -18381=>27571, -18382=>27572, -18383=>27573, -18384=>27574, -18385=>27575, -18386=>27576, -18387=>27577, -18388=>27578, -18389=>27579, -18390=>27580, -18391=>27581, -18392=>27582, -18393=>27583, -18394=>27584, -18395=>27585, -18396=>27586, -18397=>27587, -18398=>27588, -18399=>27589, -18400=>27590, -18401=>27591, -18402=>27592, -18403=>27593, -18404=>27594, -18405=>27595, -18406=>27596, -18407=>27597, -18408=>27598, -18409=>27599, -18410=>27600, -18411=>27601, -18412=>27602, -18413=>27603, -18414=>27604, -18415=>27605, -18416=>27606, -18417=>27607, -18418=>27608, -18419=>27609, -18420=>27610, -18421=>27611, -18422=>27612, -18423=>27613, -18424=>27614, -18425=>27615, -18426=>27616, -18427=>27617, -18428=>27618, -18429=>27619, -18430=>27620, -18431=>27621, -18432=>27622, -18433=>27623, -18434=>27624, -18435=>27625, -18436=>27626, -18437=>27627, -18438=>27628, -18439=>27629, -18440=>27630, -18441=>27631, -18442=>27632, -18443=>27633, -18444=>27634, -18445=>27635, -18446=>27636, -18447=>27637, -18448=>27638, -18449=>27639, -18450=>27640, -18451=>27641, -18452=>27642, -18453=>27643, -18454=>27644, -18455=>27645, -18456=>27646, -18457=>27647, -18458=>27648, -18459=>27649, -18460=>27650, -18461=>27651, -18462=>27652, -18463=>27653, -18464=>27654, -18465=>27655, -18466=>27656, -18467=>27657, -18468=>27658, -18469=>27659, -18470=>27660, -18471=>27661, -18472=>27662, -18473=>27663, -18474=>27664, -18475=>27665, -18476=>27666, -18477=>27667, -18478=>27668, -18479=>27669, -18480=>27670, -18481=>27671, -18482=>27672, -18483=>27673, -18484=>27674, -18485=>27675, -18486=>27676, -18487=>27677, -18488=>27678, -18489=>27679, -18490=>27680, -18491=>27681, -18492=>27682, -18493=>27683, -18494=>27684, -18495=>27685, -18496=>27686, -18497=>27687, -18498=>27688, -18499=>27689, -18500=>27690, -18501=>27691, -18502=>27692, -18503=>27693, -18504=>27694, -18505=>27695, -18506=>27696, -18507=>27697, -18508=>27698, -18509=>27699, -18510=>27700, -18511=>27701, -18512=>27702, -18513=>27703, -18514=>27704, -18515=>27705, -18516=>27706, -18517=>27707, -18518=>27708, -18519=>27709, -18520=>27710, -18521=>27711, -18522=>27712, -18523=>27713, -18524=>27714, -18525=>27715, -18526=>27716, -18527=>27717, -18528=>27718, -18529=>27719, -18530=>27720, -18531=>27721, -18532=>27722, -18533=>27723, -18534=>27724, -18535=>27725, -18536=>27726, -18537=>27727, -18538=>27728, -18539=>27729, -18540=>27730, -18541=>27731, -18542=>27732, -18543=>27733, -18544=>27734, -18545=>27735, -18546=>27736, -18547=>27737, -18548=>27738, -18549=>27739, -18550=>27740, -18551=>27741, -18552=>27742, -18553=>27743, -18554=>27744, -18555=>27745, -18556=>27746, -18557=>27747, -18558=>27748, -18559=>27749, -18560=>27750, -18561=>27751, -18562=>27752, -18563=>27753, -18564=>27754, -18565=>27755, -18566=>27756, -18567=>27757, -18568=>27758, -18569=>27759, -18570=>27760, -18571=>27761, -18572=>27762, -18573=>27763, -18574=>27764, -18575=>27765, -18576=>27766, -18577=>27767, -18578=>27768, -18579=>27769, -18580=>27770, -18581=>27771, -18582=>27772, -18583=>27773, -18584=>27774, -18585=>27775, -18586=>27776, -18587=>27777, -18588=>27778, -18589=>27779, -18590=>27780, -18591=>27781, -18592=>27782, -18593=>27783, -18594=>27784, -18595=>27785, -18596=>27786, -18597=>27787, -18598=>27788, -18599=>27789, -18600=>27790, -18601=>27791, -18602=>27792, -18603=>27793, -18604=>27794, -18605=>27795, -18606=>27796, -18607=>27797, -18608=>27798, -18609=>27799, -18610=>27800, -18611=>27801, -18612=>27802, -18613=>27803, -18614=>27804, -18615=>27805, -18616=>27806, -18617=>27807, -18618=>27808, -18619=>27809, -18620=>27810, -18621=>27811, -18622=>27812, -18623=>27813, -18624=>27814, -18625=>27815, -18626=>27816, -18627=>27817, -18628=>27818, -18629=>27819, -18630=>27820, -18631=>27821, -18632=>27822, -18633=>27823, -18634=>27824, -18635=>27825, -18636=>27826, -18637=>27827, -18638=>27828, -18639=>27829, -18640=>27830, -18641=>27831, -18642=>27832, -18643=>27833, -18644=>27834, -18645=>27835, -18646=>27836, -18647=>27837, -18648=>27838, -18649=>27839, -18650=>27840, -18651=>27841, -18652=>27842, -18653=>27843, -18654=>27844, -18655=>27845, -18656=>27846, -18657=>27847, -18658=>27848, -18659=>27849, -18660=>27850, -18661=>27851, -18662=>27852, -18663=>27853, -18664=>27854, -18665=>27855, -18666=>27856, -18667=>27857, -18668=>27858, -18669=>27859, -18670=>27860, -18671=>27861, -18672=>27862, -18673=>27863, -18674=>27864, -18675=>27865, -18676=>27866, -18677=>27867, -18678=>27868, -18679=>27869, -18680=>27870, -18681=>27871, -18682=>27872, -18683=>27873, -18684=>27874, -18685=>27875, -18686=>27876, -18687=>27877, -18688=>27878, -18689=>27879, -18690=>27880, -18691=>27881, -18692=>27882, -18693=>27883, -18694=>27884, -18695=>27885, -18696=>27886, -18697=>27887, -18698=>27888, -18699=>27889, -18700=>27890, -18701=>27891, -18702=>27892, -18703=>27893, -18704=>27894, -18705=>27895, -18706=>27896, -18707=>27897, -18708=>27898, -18709=>27899, -18710=>27900, -18711=>27901, -18712=>27902, -18713=>27903, -18714=>27904, -18715=>27905, -18716=>27906, -18717=>27907, -18718=>27908, -18719=>27909, -18720=>27910, -18721=>27911, -18722=>27912, -18723=>27913, -18724=>27914, -18725=>27915, -18726=>27916, -18727=>27917, -18728=>27918, -18729=>27919, -18730=>27920, -18731=>27921, -18732=>27922, -18733=>27923, -18734=>27924, -18735=>27925, -18736=>27926, -18737=>27927, -18738=>27928, -18739=>27929, -18740=>27930, -18741=>27931, -18742=>27932, -18743=>27933, -18744=>27934, -18745=>27935, -18746=>27936, -18747=>27937, -18748=>27938, -18749=>27939, -18750=>27940, -18751=>27941, -18752=>27942, -18753=>27943, -18754=>27944, -18755=>27945, -18756=>27946, -18757=>27947, -18758=>27948, -18760=>27949, -18761=>27950, -18762=>27951, -18763=>27952, -18764=>27953, -18765=>27954, -18766=>27955, -18767=>27956, -18768=>27957, -18769=>27958, -18770=>27959, -18771=>27960, -18772=>27961, -18773=>27962, -18774=>27963, -18775=>27964, -18776=>27965, -18777=>27966, -18778=>27967, -18779=>27968, -18780=>27969, -18781=>27970, -18782=>27971, -18783=>27972, -18784=>27973, -18785=>27974, -18786=>27975, -18787=>27976, -18788=>27977, -18789=>27978, -18790=>27979, -18791=>27980, -18792=>27981, -18793=>27982, -18794=>27983, -18795=>27984, -18796=>27985, -18797=>27986, -18798=>27987, -18799=>27988, -18800=>27989, -18801=>27990, -18802=>27991, -18803=>27992, -18804=>27993, -18805=>27994, -18806=>27995, -18807=>27996, -18808=>27997, -18809=>27998, -18811=>27999, -18812=>28000, -18814=>28001, -18815=>28002, -18816=>28003, -18817=>28004, -18820=>28005, -18823=>28006, -18824=>28007, -18825=>28008, -18826=>28009, -18827=>28010, -18828=>28011, -18829=>28012, -18830=>28013, -18831=>28014, -18832=>28015, -18833=>28016, -18834=>28017, -18835=>28018, -18836=>28019, -18837=>28020, -18838=>28021, -18839=>28022, -18840=>28023, -18841=>28024, -18842=>28025, -18844=>28026, -18845=>28027, -18846=>28028, -18848=>28029, -18849=>28030, -18850=>28031, -18851=>28032, -18852=>28033, -18853=>28034, -18854=>28035, -18855=>28036, -18856=>28037, -18857=>28038, -18858=>28039, -18859=>28040, -18860=>28041, -18861=>28042, -18862=>28043, -18863=>28044, -18864=>28045, -18865=>28046, -18866=>28047, -18867=>28048, -18868=>28049, -18869=>28050, -18872=>28051, -18873=>28052, -18874=>28053, -18875=>28054, -18876=>28055, -18877=>28056, -18878=>28057, -18879=>28058, -18880=>28059, -18881=>28060, -18882=>28061, -18883=>28062, -18884=>28063, -18885=>28064, -18886=>28065, -18887=>28066, -18888=>28067, -18889=>28068, -18890=>28069, -18891=>28070, -18892=>28071, -18893=>28072, -18894=>28073, -18895=>28074, -18896=>28075, -18897=>28076, -18898=>28077, -18899=>28078, -18900=>28079, -18901=>28080, -18902=>28081, -18903=>28082, -18904=>28083, -18905=>28084, -18906=>28085, -18907=>28086, -18908=>28087, -18909=>28088, -18910=>28089, -18911=>28090, -18912=>28091, -18913=>28092, -18914=>28093, -18915=>28094, -18916=>28095, -18917=>28096, -18918=>28097, -18919=>28098, -18920=>28099, -18921=>28100, -18922=>28101, -18923=>28102, -18924=>28103, -18925=>28104, -18926=>28105, -18927=>28106, -18928=>28107, -18929=>28108, -18930=>28109, -18931=>28110, -18932=>28111, -18933=>28112, -18934=>28113, -18935=>28114, -18936=>28115, -18937=>28116, -18938=>28117, -18939=>28118, -18940=>28119, -18941=>28120, -18942=>28121, -18943=>28122, -18944=>28123, -18945=>28124, -18946=>28125, -18947=>28126, -18948=>28127, -18949=>28128, -18950=>28129, -18951=>28130, -18952=>28131, -18953=>28132, -18954=>28133, -18955=>28134, -18956=>28135, -18957=>28136, -18958=>28137, -18959=>28138, -18960=>28139, -18961=>28140, -18962=>28141, -18963=>28142, -18964=>28143, -18965=>28144, -18966=>28145, -18967=>28146, -18968=>28147, -18969=>28148, -18970=>28149, -18971=>28150, -18972=>28151, -18973=>28152, -18974=>28153, -18975=>28154, -18976=>28155, -18977=>28156, -18978=>28157, -18979=>28158, -18980=>28159, -18981=>28160, -18982=>28161, -18983=>28162, -18984=>28163, -18985=>28164, -18986=>28165, -18987=>28166, -18988=>28167, -18989=>28168, -18990=>28169, -18991=>28170, -18992=>28171, -18993=>28172, -18994=>28173, -18995=>28174, -18996=>28175, -18997=>28176, -18998=>28177, -18999=>28178, -19000=>28179, -19001=>28180, -19002=>28181, -19003=>28182, -19004=>28183, -19005=>28184, -19006=>28185, -19007=>28186, -19008=>28187, -19009=>28188, -19010=>28189, -19011=>28190, -19012=>28191, -19013=>28192, -19014=>28193, -19015=>28194, -19016=>28195, -19017=>28196, -19018=>28197, -19019=>28198, -19020=>28199, -19021=>28200, -19022=>28201, -19023=>28202, -19024=>28203, -19025=>28204, -19026=>28205, -19027=>28206, -19028=>28207, -19029=>28208, -19030=>28209, -19031=>28210, -19032=>28211, -19033=>28212, -19034=>28213, -19035=>28214, -19036=>28215, -19037=>28216, -19038=>28217, -19039=>28218, -19040=>28219, -19041=>28220, -19042=>28221, -19043=>28222, -19044=>28223, -19045=>28224, -19046=>28225, -19047=>28226, -19048=>28227, -19049=>28228, -19050=>28229, -19051=>28230, -19052=>28231, -19053=>28232, -19054=>28233, -19055=>28234, -19056=>28235, -19057=>28236, -19058=>28237, -19059=>28238, -19060=>28239, -19061=>28240, -19062=>28241, -19063=>28242, -19064=>28243, -19065=>28244, -19066=>28245, -19067=>28246, -19068=>28247, -19069=>28248, -19070=>28249, -19071=>28250, -19072=>28251, -19073=>28252, -19074=>28253, -19075=>28254, -19076=>28255, -19077=>28256, -19078=>28257, -19079=>28258, -19080=>28259, -19081=>28260, -19082=>28261, -19083=>28262, -19084=>28263, -19085=>28264, -19086=>28265, -19087=>28266, -19088=>28267, -19089=>28268, -19090=>28269, -19091=>28270, -19092=>28271, -19093=>28272, -19094=>28273, -19095=>28274, -19096=>28275, -19097=>28276, -19098=>28277, -19099=>28278, -19100=>28279, -19101=>28280, -19102=>28281, -19103=>28282, -19104=>28283, -19105=>28284, -19106=>28285, -19107=>28286, -19108=>28287, -19109=>28288, -19110=>28289, -19111=>28290, -19112=>28291, -19113=>28292, -19114=>28293, -19115=>28294, -19116=>28295, -19117=>28296, -19118=>28297, -19119=>28298, -19120=>28299, -19121=>28300, -19122=>28301, -19123=>28302, -19124=>28303, -19125=>28304, -19126=>28305, -19127=>28306, -19128=>28307, -19129=>28308, -19130=>28309, -19131=>28310, -19132=>28311, -19133=>28312, -19134=>28313, -19135=>28314, -19136=>28315, -19137=>28316, -19138=>28317, -19139=>28318, -19140=>28319, -19141=>28320, -19142=>28321, -19143=>28322, -19144=>28323, -19145=>28324, -19146=>28325, -19147=>28326, -19148=>28327, -19149=>28328, -19150=>28329, -19151=>28330, -19152=>28331, -19153=>28332, -19154=>28333, -19155=>28334, -19156=>28335, -19157=>28336, -19158=>28337, -19159=>28338, -19160=>28339, -19161=>28340, -19162=>28341, -19163=>28342, -19164=>28343, -19165=>28344, -19166=>28345, -19167=>28346, -19168=>28347, -19169=>28348, -19170=>28349, -19171=>28350, -19172=>28351, -19173=>28352, -19174=>28353, -19175=>28354, -19176=>28355, -19177=>28356, -19178=>28357, -19179=>28358, -19180=>28359, -19181=>28360, -19182=>28361, -19183=>28362, -19184=>28363, -19185=>28364, -19186=>28365, -19187=>28366, -19188=>28367, -19189=>28368, -19190=>28369, -19191=>28370, -19192=>28371, -19193=>28372, -19194=>28373, -19195=>28374, -19196=>28375, -19197=>28376, -19198=>28377, -19199=>28378, -19200=>28379, -19201=>28380, -19202=>28381, -19203=>28382, -19204=>28383, -19205=>28384, -19206=>28385, -19207=>28386, -19208=>28387, -19209=>28388, -19210=>28389, -19211=>28390, -19212=>28391, -19213=>28392, -19214=>28393, -19215=>28394, -19216=>28395, -19217=>28396, -19218=>28397, -19219=>28398, -19220=>28399, -19221=>28400, -19222=>28401, -19223=>28402, -19224=>28403, -19225=>28404, -19226=>28405, -19227=>28406, -19228=>28407, -19229=>28408, -19230=>28409, -19231=>28410, -19232=>28411, -19233=>28412, -19234=>28413, -19235=>28414, -19236=>28415, -19237=>28416, -19238=>28417, -19239=>28418, -19240=>28419, -19241=>28420, -19242=>28421, -19243=>28422, -19244=>28423, -19245=>28424, -19246=>28425, -19247=>28426, -19248=>28427, -19249=>28428, -19250=>28429, -19251=>28430, -19252=>28431, -19253=>28432, -19254=>28433, -19255=>28434, -19256=>28435, -19257=>28436, -19258=>28437, -19259=>28438, -19260=>28439, -19261=>28440, -19262=>28441, -19263=>28442, -19264=>28443, -19265=>28444, -19266=>28445, -19267=>28446, -19268=>28447, -19269=>28448, -19270=>28449, -19271=>28450, -19272=>28451, -19273=>28452, -19274=>28453, -19275=>28454, -19276=>28455, -19277=>28456, -19278=>28457, -19279=>28458, -19280=>28459, -19281=>28460, -19282=>28461, -19283=>28462, -19284=>28463, -19285=>28464, -19286=>28465, -19287=>28466, -19288=>28467, -19289=>28468, -19290=>28469, -19291=>28470, -19292=>28471, -19293=>28472, -19294=>28473, -19295=>28474, -19296=>28475, -19297=>28476, -19298=>28477, -19299=>28478, -19300=>28479, -19301=>28480, -19302=>28481, -19303=>28482, -19304=>28483, -19305=>28484, -19306=>28485, -19307=>28486, -19308=>28487, -19309=>28488, -19310=>28489, -19311=>28490, -19312=>28491, -19313=>28492, -19314=>28493, -19315=>28494, -19316=>28495, -19317=>28496, -19318=>28497, -19319=>28498, -19320=>28499, -19321=>28500, -19322=>28501, -19323=>28502, -19324=>28503, -19325=>28504, -19326=>28505, -19327=>28506, -19328=>28507, -19329=>28508, -19330=>28509, -19331=>28510, -19332=>28511, -19333=>28512, -19334=>28513, -19335=>28514, -19336=>28515, -19337=>28516, -19338=>28517, -19339=>28518, -19340=>28519, -19341=>28520, -19342=>28521, -19343=>28522, -19344=>28523, -19345=>28524, -19346=>28525, -19347=>28526, -19348=>28527, -19349=>28528, -19350=>28529, -19351=>28530, -19352=>28531, -19353=>28532, -19354=>28533, -19355=>28534, -19356=>28535, -19357=>28536, -19358=>28537, -19359=>28538, -19360=>28539, -19361=>28540, -19362=>28541, -19363=>28542, -19364=>28543, -19365=>28544, -19366=>28545, -19367=>28546, -19368=>28547, -19369=>28548, -19370=>28549, -19371=>28550, -19372=>28551, -19373=>28552, -19374=>28553, -19375=>28554, -19376=>28555, -19377=>28556, -19378=>28557, -19379=>28558, -19380=>28559, -19381=>28560, -19382=>28561, -19383=>28562, -19384=>28563, -19385=>28564, -19386=>28565, -19387=>28566, -19388=>28567, -19389=>28568, -19390=>28569, -19391=>28570, -19392=>28571, -19393=>28572, -19394=>28573, -19395=>28574, -19396=>28575, -19397=>28576, -19398=>28577, -19399=>28578, -19400=>28579, -19401=>28580, -19402=>28581, -19403=>28582, -19404=>28583, -19405=>28584, -19406=>28585, -19407=>28586, -19408=>28587, -19409=>28588, -19410=>28589, -19411=>28590, -19412=>28591, -19413=>28592, -19414=>28593, -19415=>28594, -19416=>28595, -19417=>28596, -19418=>28597, -19419=>28598, -19420=>28599, -19421=>28600, -19422=>28601, -19423=>28602, -19424=>28603, -19425=>28604, -19426=>28605, -19427=>28606, -19428=>28607, -19429=>28608, -19430=>28609, -19431=>28610, -19432=>28611, -19433=>28612, -19434=>28613, -19435=>28614, -19436=>28615, -19437=>28616, -19438=>28617, -19439=>28618, -19440=>28619, -19441=>28620, -19442=>28621, -19443=>28622, -19444=>28623, -19445=>28624, -19446=>28625, -19447=>28626, -19448=>28627, -19449=>28628, -19450=>28629, -19451=>28630, -19452=>28631, -19453=>28632, -19454=>28633, -19455=>28634, -19456=>28635, -19457=>28636, -19458=>28637, -19459=>28638, -19460=>28639, -19461=>28640, -19462=>28641, -19463=>28642, -19464=>28643, -19465=>28644, -19466=>28645, -19467=>28646, -19468=>28647, -19469=>28648, -19470=>28649, -19471=>28650, -19472=>28651, -19473=>28652, -19474=>28653, -19475=>28654, -19476=>28655, -19477=>28656, -19478=>28657, -19479=>28658, -19480=>28659, -19481=>28660, -19482=>28661, -19483=>28662, -19484=>28663, -19485=>28664, -19486=>28665, -19487=>28666, -19488=>28667, -19489=>28668, -19490=>28669, -19491=>28670, -19492=>28671, -19493=>28672, -19494=>28673, -19495=>28674, -19496=>28675, -19497=>28676, -19498=>28677, -19499=>28678, -19500=>28679, -19501=>28680, -19502=>28681, -19503=>28682, -19504=>28683, -19505=>28684, -19506=>28685, -19507=>28686, -19508=>28687, -19509=>28688, -19510=>28689, -19511=>28690, -19512=>28691, -19513=>28692, -19514=>28693, -19515=>28694, -19516=>28695, -19517=>28696, -19518=>28697, -19519=>28698, -19520=>28699, -19521=>28700, -19522=>28701, -19523=>28702, -19524=>28703, -19525=>28704, -19526=>28705, -19527=>28706, -19528=>28707, -19529=>28708, -19530=>28709, -19531=>28710, -19532=>28711, -19533=>28712, -19534=>28713, -19535=>28714, -19536=>28715, -19537=>28716, -19538=>28717, -19539=>28718, -19540=>28719, -19541=>28720, -19542=>28721, -19543=>28722, -19544=>28723, -19545=>28724, -19546=>28725, -19547=>28726, -19548=>28727, -19549=>28728, -19550=>28729, -19551=>28730, -19552=>28731, -19553=>28732, -19554=>28733, -19555=>28734, -19556=>28735, -19557=>28736, -19558=>28737, -19559=>28738, -19560=>28739, -19561=>28740, -19562=>28741, -19563=>28742, -19564=>28743, -19565=>28744, -19566=>28745, -19567=>28746, -19568=>28747, -19569=>28748, -19570=>28749, -19571=>28750, -19572=>28751, -19573=>28752, -19574=>28753, -19576=>28754, -19577=>28755, -19578=>28756, -19579=>28757, -19580=>28758, -19581=>28759, -19582=>28760, -19583=>28761, -19584=>28762, -19585=>28763, -19586=>28764, -19587=>28765, -19588=>28766, -19589=>28767, -19590=>28768, -19591=>28769, -19592=>28770, -19593=>28771, -19594=>28772, -19595=>28773, -19596=>28774, -19597=>28775, -19598=>28776, -19599=>28777, -19600=>28778, -19601=>28779, -19602=>28780, -19603=>28781, -19604=>28782, -19605=>28783, -19606=>28784, -19607=>28785, -19608=>28786, -19609=>28787, -19610=>28788, -19611=>28789, -19612=>28790, -19613=>28791, -19614=>28792, -19620=>28793, -19621=>28794, -19622=>28795, -19623=>28796, -19624=>28797, -19625=>28798, -19626=>28799, -19627=>28800, -19628=>28801, -19629=>28802, -19630=>28803, -19631=>28804, -19632=>28805, -19633=>28806, -19634=>28807, -19635=>28808, -19636=>28809, -19637=>28810, -19638=>28811, -19639=>28812, -19640=>28813, -19641=>28814, -19642=>28815, -19643=>28816, -19644=>28817, -19645=>28818, -19646=>28819, -19647=>28820, -19648=>28821, -19649=>28822, -19650=>28823, -19651=>28824, -19652=>28825, -19653=>28826, -19654=>28827, -19655=>28828, -19656=>28829, -19657=>28830, -19658=>28831, -19659=>28832, -19660=>28833, -19661=>28834, -19662=>28835, -19663=>28836, -19664=>28837, -19665=>28838, -19666=>28839, -19667=>28840, -19668=>28841, -19669=>28842, -19670=>28843, -19671=>28844, -19672=>28845, -19673=>28846, -19674=>28847, -19675=>28848, -19676=>28849, -19677=>28850, -19678=>28851, -19679=>28852, -19680=>28853, -19681=>28854, -19682=>28855, -19683=>28856, -19684=>28857, -19685=>28858, -19686=>28859, -19687=>28860, -19688=>28861, -19689=>28862, -19690=>28863, -19691=>28864, -19692=>28865, -19693=>28866, -19694=>28867, -19695=>28868, -19696=>28869, -19697=>28870, -19698=>28871, -19699=>28872, -19700=>28873, -19701=>28874, -19702=>28875, -19703=>28876, -19704=>28877, -19705=>28878, -19706=>28879, -19707=>28880, -19708=>28881, -19709=>28882, -19710=>28883, -19711=>28884, -19712=>28885, -19713=>28886, -19714=>28887, -19715=>28888, -19716=>28889, -19717=>28890, -19718=>28891, -19719=>28892, -19720=>28893, -19721=>28894, -19722=>28895, -19723=>28896, -19724=>28897, -19725=>28898, -19726=>28899, -19727=>28900, -19728=>28901, -19729=>28902, -19730=>28903, -19738=>28904, -19739=>28905, -19740=>28906, -19741=>28907, -19742=>28908, -19743=>28909, -19744=>28910, -19745=>28911, -19746=>28912, -19747=>28913, -19748=>28914, -19749=>28915, -19750=>28916, -19751=>28917, -19752=>28918, -19753=>28919, -19754=>28920, -19755=>28921, -19756=>28922, -19757=>28923, -19758=>28924, -19759=>28925, -19760=>28926, -19761=>28927, -19762=>28928, -19763=>28929, -19764=>28930, -19765=>28931, -19766=>28932, -19767=>28933, -19768=>28934, -19769=>28935, -19770=>28936, -19771=>28937, -19772=>28938, -19773=>28939, -19774=>28940, -19775=>28941, -19776=>28942, -19777=>28943, -19778=>28944, -19779=>28945, -19780=>28946, -19781=>28947, -19782=>28948, -19783=>28949, -19784=>28950, -19785=>28951, -19786=>28952, -19787=>28953, -19788=>28954, -19789=>28955, -19790=>28956, -19791=>28957, -19792=>28958, -19793=>28959, -19794=>28960, -19795=>28961, -19796=>28962, -19797=>28963, -19798=>28964, -19799=>28965, -19800=>28966, -19801=>28967, -19802=>28968, -19803=>28969, -19804=>28970, -19805=>28971, -19806=>28972, -19807=>28973, -19808=>28974, -19809=>28975, -19810=>28976, -19811=>28977, -19812=>28978, -19813=>28979, -19814=>28980, -19815=>28981, -19816=>28982, -19817=>28983, -19818=>28984, -19819=>28985, -19820=>28986, -19821=>28987, -19822=>28988, -19823=>28989, -19824=>28990, -19825=>28991, -19826=>28992, -19827=>28993, -19828=>28994, -19829=>28995, -19830=>28996, -19831=>28997, -19832=>28998, -19833=>28999, -19834=>29000, -19835=>29001, -19836=>29002, -19837=>29003, -19838=>29004, -19839=>29005, -19840=>29006, -19841=>29007, -19842=>29008, -19843=>29009, -19844=>29010, -19845=>29011, -19846=>29012, -19847=>29013, -19848=>29014, -19849=>29015, -19850=>29016, -19851=>29017, -19852=>29018, -19853=>29019, -19854=>29020, -19855=>29021, -19856=>29022, -19857=>29023, -19858=>29024, -19859=>29025, -19860=>29026, -19861=>29027, -19862=>29028, -19863=>29029, -19864=>29030, -19865=>29031, -19866=>29032, -19867=>29033, -19868=>29034, -19869=>29035, -19870=>29036, -19871=>29037, -19872=>29038, -19873=>29039, -19874=>29040, -19875=>29041, -19876=>29042, -19877=>29043, -19878=>29044, -19879=>29045, -19880=>29046, -19881=>29047, -19882=>29048, -19883=>29049, -19884=>29050, -19885=>29051, -19887=>29052, -19888=>29053, -19889=>29054, -19890=>29055, -19891=>29056, -19892=>29057, -19893=>29058, -40960=>29064, -40961=>29065, -40962=>29066, -40963=>29067, -40964=>29068, -40965=>29069, -40966=>29070, -40967=>29071, -40968=>29072, -40969=>29073, -40970=>29074, -40971=>29075, -40972=>29076, -40973=>29077, -40974=>29078, -40975=>29079, -40976=>29080, -40977=>29081, -40978=>29082, -40979=>29083, -40980=>29084, -40981=>29085, -40982=>29086, -40983=>29087, -40984=>29088, -40985=>29089, -40986=>29090, -40987=>29091, -40988=>29092, -40989=>29093, -40990=>29094, -40991=>29095, -40992=>29096, -40993=>29097, -40994=>29098, -40995=>29099, -40996=>29100, -40997=>29101, -40998=>29102, -40999=>29103, -41000=>29104, -41001=>29105, -41002=>29106, -41003=>29107, -41004=>29108, -41005=>29109, -41006=>29110, -41007=>29111, -41008=>29112, -41009=>29113, -41010=>29114, -41011=>29115, -41012=>29116, -41013=>29117, -41014=>29118, -41015=>29119, -41016=>29120, -41017=>29121, -41018=>29122, -41019=>29123, -41020=>29124, -41021=>29125, -41022=>29126, -41023=>29127, -41024=>29128, -41025=>29129, -41026=>29130, -41027=>29131, -41028=>29132, -41029=>29133, -41030=>29134, -41031=>29135, -41032=>29136, -41033=>29137, -41034=>29138, -41035=>29139, -41036=>29140, -41037=>29141, -41038=>29142, -41039=>29143, -41040=>29144, -41041=>29145, -41042=>29146, -41043=>29147, -41044=>29148, -41045=>29149, -41046=>29150, -41047=>29151, -41048=>29152, -41049=>29153, -41050=>29154, -41051=>29155, -41052=>29156, -41053=>29157, -41054=>29158, -41055=>29159, -41056=>29160, -41057=>29161, -41058=>29162, -41059=>29163, -41060=>29164, -41061=>29165, -41062=>29166, -41063=>29167, -41064=>29168, -41065=>29169, -41066=>29170, -41067=>29171, -41068=>29172, -41069=>29173, -41070=>29174, -41071=>29175, -41072=>29176, -41073=>29177, -41074=>29178, -41075=>29179, -41076=>29180, -41077=>29181, -41078=>29182, -41079=>29183, -41080=>29184, -41081=>29185, -41082=>29186, -41083=>29187, -41084=>29188, -41085=>29189, -41086=>29190, -41087=>29191, -41088=>29192, -41089=>29193, -41090=>29194, -41091=>29195, -41092=>29196, -41093=>29197, -41094=>29198, -41095=>29199, -41096=>29200, -41097=>29201, -41098=>29202, -41099=>29203, -41100=>29204, -41101=>29205, -41102=>29206, -41103=>29207, -41104=>29208, -41105=>29209, -41106=>29210, -41107=>29211, -41108=>29212, -41109=>29213, -41110=>29214, -41111=>29215, -41112=>29216, -41113=>29217, -41114=>29218, -41115=>29219, -41116=>29220, -41117=>29221, -41118=>29222, -41119=>29223, -41120=>29224, -41121=>29225, -41122=>29226, -41123=>29227, -41124=>29228, -41125=>29229, -41126=>29230, -41127=>29231, -41128=>29232, -41129=>29233, -41130=>29234, -41131=>29235, -41132=>29236, -41133=>29237, -41134=>29238, -41135=>29239, -41136=>29240, -41137=>29241, -41138=>29242, -41139=>29243, -41140=>29244, -41141=>29245, -41142=>29246, -41143=>29247, -41144=>29248, -41145=>29249, -41146=>29250, -41147=>29251, -41148=>29252, -41149=>29253, -41150=>29254, -41151=>29255, -41152=>29256, -41153=>29257, -41154=>29258, -41155=>29259, -41156=>29260, -41157=>29261, -41158=>29262, -41159=>29263, -41160=>29264, -41161=>29265, -41162=>29266, -41163=>29267, -41164=>29268, -41165=>29269, -41166=>29270, -41167=>29271, -41168=>29272, -41169=>29273, -41170=>29274, -41171=>29275, -41172=>29276, -41173=>29277, -41174=>29278, -41175=>29279, -41176=>29280, -41177=>29281, -41178=>29282, -41179=>29283, -41180=>29284, -41181=>29285, -41182=>29286, -41183=>29287, -41184=>29288, -41185=>29289, -41186=>29290, -41187=>29291, -41188=>29292, -41189=>29293, -41190=>29294, -41191=>29295, -41192=>29296, -41193=>29297, -41194=>29298, -41195=>29299, -41196=>29300, -41197=>29301, -41198=>29302, -41199=>29303, -41200=>29304, -41201=>29305, -41202=>29306, -41203=>29307, -41204=>29308, -41205=>29309, -41206=>29310, -41207=>29311, -41208=>29312, -41209=>29313, -41210=>29314, -41211=>29315, -41212=>29316, -41213=>29317, -41214=>29318, -41215=>29319, -41216=>29320, -41217=>29321, -41218=>29322, -41219=>29323, -41220=>29324, -41221=>29325, -41222=>29326, -41223=>29327, -41224=>29328, -41225=>29329, -41226=>29330, -41227=>29331, -41228=>29332, -41229=>29333, -41230=>29334, -41231=>29335, -41232=>29336, -41233=>29337, -41234=>29338, -41235=>29339, -41236=>29340, -41237=>29341, -41238=>29342, -41239=>29343, -41240=>29344, -41241=>29345, -41242=>29346, -41243=>29347, -41244=>29348, -41245=>29349, -41246=>29350, -41247=>29351, -41248=>29352, -41249=>29353, -41250=>29354, -41251=>29355, -41252=>29356, -41253=>29357, -41254=>29358, -41255=>29359, -41256=>29360, -41257=>29361, -41258=>29362, -41259=>29363, -41260=>29364, -41261=>29365, -41262=>29366, -41263=>29367, -41264=>29368, -41265=>29369, -41266=>29370, -41267=>29371, -41268=>29372, -41269=>29373, -41270=>29374, -41271=>29375, -41272=>29376, -41273=>29377, -41274=>29378, -41275=>29379, -41276=>29380, -41277=>29381, -41278=>29382, -41279=>29383, -41280=>29384, -41281=>29385, -41282=>29386, -41283=>29387, -41284=>29388, -41285=>29389, -41286=>29390, -41287=>29391, -41288=>29392, -41289=>29393, -41290=>29394, -41291=>29395, -41292=>29396, -41293=>29397, -41294=>29398, -41295=>29399, -41296=>29400, -41297=>29401, -41298=>29402, -41299=>29403, -41300=>29404, -41301=>29405, -41302=>29406, -41303=>29407, -41304=>29408, -41305=>29409, -41306=>29410, -41307=>29411, -41308=>29412, -41309=>29413, -41310=>29414, -41311=>29415, -41312=>29416, -41313=>29417, -41314=>29418, -41315=>29419, -41316=>29420, -41317=>29421, -41318=>29422, -41319=>29423, -41320=>29424, -41321=>29425, -41322=>29426, -41323=>29427, -41324=>29428, -41325=>29429, -41326=>29430, -41327=>29431, -41328=>29432, -41329=>29433, -41330=>29434, -41331=>29435, -41332=>29436, -41333=>29437, -41334=>29438, -41335=>29439, -41336=>29440, -41337=>29441, -41338=>29442, -41339=>29443, -41340=>29444, -41341=>29445, -41342=>29446, -41343=>29447, -41344=>29448, -41345=>29449, -41346=>29450, -41347=>29451, -41348=>29452, -41349=>29453, -41350=>29454, -41351=>29455, -41352=>29456, -41353=>29457, -41354=>29458, -41355=>29459, -41356=>29460, -41357=>29461, -41358=>29462, -41359=>29463, -41360=>29464, -41361=>29465, -41362=>29466, -41363=>29467, -41364=>29468, -41365=>29469, -41366=>29470, -41367=>29471, -41368=>29472, -41369=>29473, -41370=>29474, -41371=>29475, -41372=>29476, -41373=>29477, -41374=>29478, -41375=>29479, -41376=>29480, -41377=>29481, -41378=>29482, -41379=>29483, -41380=>29484, -41381=>29485, -41382=>29486, -41383=>29487, -41384=>29488, -41385=>29489, -41386=>29490, -41387=>29491, -41388=>29492, -41389=>29493, -41390=>29494, -41391=>29495, -41392=>29496, -41393=>29497, -41394=>29498, -41395=>29499, -41396=>29500, -41397=>29501, -41398=>29502, -41399=>29503, -41400=>29504, -41401=>29505, -41402=>29506, -41403=>29507, -41404=>29508, -41405=>29509, -41406=>29510, -41407=>29511, -41408=>29512, -41409=>29513, -41410=>29514, -41411=>29515, -41412=>29516, -41413=>29517, -41414=>29518, -41415=>29519, -41416=>29520, -41417=>29521, -41418=>29522, -41419=>29523, -41420=>29524, -41421=>29525, -41422=>29526, -41423=>29527, -41424=>29528, -41425=>29529, -41426=>29530, -41427=>29531, -41428=>29532, -41429=>29533, -41430=>29534, -41431=>29535, -41432=>29536, -41433=>29537, -41434=>29538, -41435=>29539, -41436=>29540, -41437=>29541, -41438=>29542, -41439=>29543, -41440=>29544, -41441=>29545, -41442=>29546, -41443=>29547, -41444=>29548, -41445=>29549, -41446=>29550, -41447=>29551, -41448=>29552, -41449=>29553, -41450=>29554, -41451=>29555, -41452=>29556, -41453=>29557, -41454=>29558, -41455=>29559, -41456=>29560, -41457=>29561, -41458=>29562, -41459=>29563, -41460=>29564, -41461=>29565, -41462=>29566, -41463=>29567, -41464=>29568, -41465=>29569, -41466=>29570, -41467=>29571, -41468=>29572, -41469=>29573, -41470=>29574, -41471=>29575, -41472=>29576, -41473=>29577, -41474=>29578, -41475=>29579, -41476=>29580, -41477=>29581, -41478=>29582, -41479=>29583, -41480=>29584, -41481=>29585, -41482=>29586, -41483=>29587, -41484=>29588, -41485=>29589, -41486=>29590, -41487=>29591, -41488=>29592, -41489=>29593, -41490=>29594, -41491=>29595, -41492=>29596, -41493=>29597, -41494=>29598, -41495=>29599, -41496=>29600, -41497=>29601, -41498=>29602, -41499=>29603, -41500=>29604, -41501=>29605, -41502=>29606, -41503=>29607, -41504=>29608, -41505=>29609, -41506=>29610, -41507=>29611, -41508=>29612, -41509=>29613, -41510=>29614, -41511=>29615, -41512=>29616, -41513=>29617, -41514=>29618, -41515=>29619, -41516=>29620, -41517=>29621, -41518=>29622, -41519=>29623, -41520=>29624, -41521=>29625, -41522=>29626, -41523=>29627, -41524=>29628, -41525=>29629, -41526=>29630, -41527=>29631, -41528=>29632, -41529=>29633, -41530=>29634, -41531=>29635, -41532=>29636, -41533=>29637, -41534=>29638, -41535=>29639, -41536=>29640, -41537=>29641, -41538=>29642, -41539=>29643, -41540=>29644, -41541=>29645, -41542=>29646, -41543=>29647, -41544=>29648, -41545=>29649, -41546=>29650, -41547=>29651, -41548=>29652, -41549=>29653, -41550=>29654, -41551=>29655, -41552=>29656, -41553=>29657, -41554=>29658, -41555=>29659, -41556=>29660, -41557=>29661, -41558=>29662, -41559=>29663, -41560=>29664, -41561=>29665, -41562=>29666, -41563=>29667, -41564=>29668, -41565=>29669, -41566=>29670, -41567=>29671, -41568=>29672, -41569=>29673, -41570=>29674, -41571=>29675, -41572=>29676, -41573=>29677, -41574=>29678, -41575=>29679, -41576=>29680, -41577=>29681, -41578=>29682, -41579=>29683, -41580=>29684, -41581=>29685, -41582=>29686, -41583=>29687, -41584=>29688, -41585=>29689, -41586=>29690, -41587=>29691, -41588=>29692, -41589=>29693, -41590=>29694, -41591=>29695, -41592=>29696, -41593=>29697, -41594=>29698, -41595=>29699, -41596=>29700, -41597=>29701, -41598=>29702, -41599=>29703, -41600=>29704, -41601=>29705, -41602=>29706, -41603=>29707, -41604=>29708, -41605=>29709, -41606=>29710, -41607=>29711, -41608=>29712, -41609=>29713, -41610=>29714, -41611=>29715, -41612=>29716, -41613=>29717, -41614=>29718, -41615=>29719, -41616=>29720, -41617=>29721, -41618=>29722, -41619=>29723, -41620=>29724, -41621=>29725, -41622=>29726, -41623=>29727, -41624=>29728, -41625=>29729, -41626=>29730, -41627=>29731, -41628=>29732, -41629=>29733, -41630=>29734, -41631=>29735, -41632=>29736, -41633=>29737, -41634=>29738, -41635=>29739, -41636=>29740, -41637=>29741, -41638=>29742, -41639=>29743, -41640=>29744, -41641=>29745, -41642=>29746, -41643=>29747, -41644=>29748, -41645=>29749, -41646=>29750, -41647=>29751, -41648=>29752, -41649=>29753, -41650=>29754, -41651=>29755, -41652=>29756, -41653=>29757, -41654=>29758, -41655=>29759, -41656=>29760, -41657=>29761, -41658=>29762, -41659=>29763, -41660=>29764, -41661=>29765, -41662=>29766, -41663=>29767, -41664=>29768, -41665=>29769, -41666=>29770, -41667=>29771, -41668=>29772, -41669=>29773, -41670=>29774, -41671=>29775, -41672=>29776, -41673=>29777, -41674=>29778, -41675=>29779, -41676=>29780, -41677=>29781, -41678=>29782, -41679=>29783, -41680=>29784, -41681=>29785, -41682=>29786, -41683=>29787, -41684=>29788, -41685=>29789, -41686=>29790, -41687=>29791, -41688=>29792, -41689=>29793, -41690=>29794, -41691=>29795, -41692=>29796, -41693=>29797, -41694=>29798, -41695=>29799, -41696=>29800, -41697=>29801, -41698=>29802, -41699=>29803, -41700=>29804, -41701=>29805, -41702=>29806, -41703=>29807, -41704=>29808, -41705=>29809, -41706=>29810, -41707=>29811, -41708=>29812, -41709=>29813, -41710=>29814, -41711=>29815, -41712=>29816, -41713=>29817, -41714=>29818, -41715=>29819, -41716=>29820, -41717=>29821, -41718=>29822, -41719=>29823, -41720=>29824, -41721=>29825, -41722=>29826, -41723=>29827, -41724=>29828, -41725=>29829, -41726=>29830, -41727=>29831, -41728=>29832, -41729=>29833, -41730=>29834, -41731=>29835, -41732=>29836, -41733=>29837, -41734=>29838, -41735=>29839, -41736=>29840, -41737=>29841, -41738=>29842, -41739=>29843, -41740=>29844, -41741=>29845, -41742=>29846, -41743=>29847, -41744=>29848, -41745=>29849, -41746=>29850, -41747=>29851, -41748=>29852, -41749=>29853, -41750=>29854, -41751=>29855, -41752=>29856, -41753=>29857, -41754=>29858, -41755=>29859, -41756=>29860, -41757=>29861, -41758=>29862, -41759=>29863, -41760=>29864, -41761=>29865, -41762=>29866, -41763=>29867, -41764=>29868, -41765=>29869, -41766=>29870, -41767=>29871, -41768=>29872, -41769=>29873, -41770=>29874, -41771=>29875, -41772=>29876, -41773=>29877, -41774=>29878, -41775=>29879, -41776=>29880, -41777=>29881, -41778=>29882, -41779=>29883, -41780=>29884, -41781=>29885, -41782=>29886, -41783=>29887, -41784=>29888, -41785=>29889, -41786=>29890, -41787=>29891, -41788=>29892, -41789=>29893, -41790=>29894, -41791=>29895, -41792=>29896, -41793=>29897, -41794=>29898, -41795=>29899, -41796=>29900, -41797=>29901, -41798=>29902, -41799=>29903, -41800=>29904, -41801=>29905, -41802=>29906, -41803=>29907, -41804=>29908, -41805=>29909, -41806=>29910, -41807=>29911, -41808=>29912, -41809=>29913, -41810=>29914, -41811=>29915, -41812=>29916, -41813=>29917, -41814=>29918, -41815=>29919, -41816=>29920, -41817=>29921, -41818=>29922, -41819=>29923, -41820=>29924, -41821=>29925, -41822=>29926, -41823=>29927, -41824=>29928, -41825=>29929, -41826=>29930, -41827=>29931, -41828=>29932, -41829=>29933, -41830=>29934, -41831=>29935, -41832=>29936, -41833=>29937, -41834=>29938, -41835=>29939, -41836=>29940, -41837=>29941, -41838=>29942, -41839=>29943, -41840=>29944, -41841=>29945, -41842=>29946, -41843=>29947, -41844=>29948, -41845=>29949, -41846=>29950, -41847=>29951, -41848=>29952, -41849=>29953, -41850=>29954, -41851=>29955, -41852=>29956, -41853=>29957, -41854=>29958, -41855=>29959, -41856=>29960, -41857=>29961, -41858=>29962, -41859=>29963, -41860=>29964, -41861=>29965, -41862=>29966, -41863=>29967, -41864=>29968, -41865=>29969, -41866=>29970, -41867=>29971, -41868=>29972, -41869=>29973, -41870=>29974, -41871=>29975, -41872=>29976, -41873=>29977, -41874=>29978, -41875=>29979, -41876=>29980, -41877=>29981, -41878=>29982, -41879=>29983, -41880=>29984, -41881=>29985, -41882=>29986, -41883=>29987, -41884=>29988, -41885=>29989, -41886=>29990, -41887=>29991, -41888=>29992, -41889=>29993, -41890=>29994, -41891=>29995, -41892=>29996, -41893=>29997, -41894=>29998, -41895=>29999, -41896=>30000, -41897=>30001, -41898=>30002, -41899=>30003, -41900=>30004, -41901=>30005, -41902=>30006, -41903=>30007, -41904=>30008, -41905=>30009, -41906=>30010, -41907=>30011, -41908=>30012, -41909=>30013, -41910=>30014, -41911=>30015, -41912=>30016, -41913=>30017, -41914=>30018, -41915=>30019, -41916=>30020, -41917=>30021, -41918=>30022, -41919=>30023, -41920=>30024, -41921=>30025, -41922=>30026, -41923=>30027, -41924=>30028, -41925=>30029, -41926=>30030, -41927=>30031, -41928=>30032, -41929=>30033, -41930=>30034, -41931=>30035, -41932=>30036, -41933=>30037, -41934=>30038, -41935=>30039, -41936=>30040, -41937=>30041, -41938=>30042, -41939=>30043, -41940=>30044, -41941=>30045, -41942=>30046, -41943=>30047, -41944=>30048, -41945=>30049, -41946=>30050, -41947=>30051, -41948=>30052, -41949=>30053, -41950=>30054, -41951=>30055, -41952=>30056, -41953=>30057, -41954=>30058, -41955=>30059, -41956=>30060, -41957=>30061, -41958=>30062, -41959=>30063, -41960=>30064, -41961=>30065, -41962=>30066, -41963=>30067, -41964=>30068, -41965=>30069, -41966=>30070, -41967=>30071, -41968=>30072, -41969=>30073, -41970=>30074, -41971=>30075, -41972=>30076, -41973=>30077, -41974=>30078, -41975=>30079, -41976=>30080, -41977=>30081, -41978=>30082, -41979=>30083, -41980=>30084, -41981=>30085, -41982=>30086, -41983=>30087, -41984=>30088, -41985=>30089, -41986=>30090, -41987=>30091, -41988=>30092, -41989=>30093, -41990=>30094, -41991=>30095, -41992=>30096, -41993=>30097, -41994=>30098, -41995=>30099, -41996=>30100, -41997=>30101, -41998=>30102, -41999=>30103, -42000=>30104, -42001=>30105, -42002=>30106, -42003=>30107, -42004=>30108, -42005=>30109, -42006=>30110, -42007=>30111, -42008=>30112, -42009=>30113, -42010=>30114, -42011=>30115, -42012=>30116, -42013=>30117, -42014=>30118, -42015=>30119, -42016=>30120, -42017=>30121, -42018=>30122, -42019=>30123, -42020=>30124, -42021=>30125, -42022=>30126, -42023=>30127, -42024=>30128, -42025=>30129, -42026=>30130, -42027=>30131, -42028=>30132, -42029=>30133, -42030=>30134, -42031=>30135, -42032=>30136, -42033=>30137, -42034=>30138, -42035=>30139, -42036=>30140, -42037=>30141, -42038=>30142, -42039=>30143, -42040=>30144, -42041=>30145, -42042=>30146, -42043=>30147, -42044=>30148, -42045=>30149, -42046=>30150, -42047=>30151, -42048=>30152, -42049=>30153, -42050=>30154, -42051=>30155, -42052=>30156, -42053=>30157, -42054=>30158, -42055=>30159, -42056=>30160, -42057=>30161, -42058=>30162, -42059=>30163, -42060=>30164, -42061=>30165, -42062=>30166, -42063=>30167, -42064=>30168, -42065=>30169, -42066=>30170, -42067=>30171, -42068=>30172, -42069=>30173, -42070=>30174, -42071=>30175, -42072=>30176, -42073=>30177, -42074=>30178, -42075=>30179, -42076=>30180, -42077=>30181, -42078=>30182, -42079=>30183, -42080=>30184, -42081=>30185, -42082=>30186, -42083=>30187, -42084=>30188, -42085=>30189, -42086=>30190, -42087=>30191, -42088=>30192, -42089=>30193, -42090=>30194, -42091=>30195, -42092=>30196, -42093=>30197, -42094=>30198, -42095=>30199, -42096=>30200, -42097=>30201, -42098=>30202, -42099=>30203, -42100=>30204, -42101=>30205, -42102=>30206, -42103=>30207, -42104=>30208, -42105=>30209, -42106=>30210, -42107=>30211, -42108=>30212, -42109=>30213, -42110=>30214, -42111=>30215, -42112=>30216, -42113=>30217, -42114=>30218, -42115=>30219, -42116=>30220, -42117=>30221, -42118=>30222, -42119=>30223, -42120=>30224, -42121=>30225, -42122=>30226, -42123=>30227, -42124=>30228, -42128=>30229, -42129=>30230, -42130=>30231, -42131=>30232, -42132=>30233, -42133=>30234, -42134=>30235, -42135=>30236, -42136=>30237, -42137=>30238, -42138=>30239, -42139=>30240, -42140=>30241, -42141=>30242, -42142=>30243, -42143=>30244, -42144=>30245, -42145=>30246, -42146=>30247, -42147=>30248, -42148=>30249, -42149=>30250, -42150=>30251, -42151=>30252, -42152=>30253, -42153=>30254, -42154=>30255, -42155=>30256, -42156=>30257, -42157=>30258, -42158=>30259, -42159=>30260, -42160=>30261, -42161=>30262, -42162=>30263, -42163=>30264, -42164=>30265, -42165=>30266, -42166=>30267, -42167=>30268, -42168=>30269, -42169=>30270, -42170=>30271, -42171=>30272, -42172=>30273, -42173=>30274, -42174=>30275, -42175=>30276, -42176=>30277, -42177=>30278, -42178=>30279, -42179=>30280, -42180=>30281, -42181=>30282, -42182=>30283, -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_aj16.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_aj16.php deleted file mode 100644 index a1e4dc74da..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_aj16.php +++ /dev/null @@ -1,15705 +0,0 @@ -<?php -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in aj16.tar.Z -$cidinfo['uni2cid'] = array( -160=>1, -32=>1, -33=>2, -34=>3, -35=>4, -36=>5, -37=>6, -38=>7, -39=>8, -40=>9, -41=>10, -42=>11, -43=>12, -44=>13, -8209=>14, -45=>14, -46=>15, -47=>16, -48=>17, -49=>18, -50=>19, -51=>20, -52=>21, -53=>22, -54=>23, -55=>24, -56=>25, -57=>26, -58=>27, -59=>28, -60=>29, -61=>30, -62=>31, -63=>32, -64=>33, -65=>34, -66=>35, -67=>36, -68=>37, -69=>38, -70=>39, -71=>40, -72=>41, -73=>42, -74=>43, -75=>44, -76=>45, -77=>46, -78=>47, -79=>48, -80=>49, -81=>50, -82=>51, -83=>52, -84=>53, -85=>54, -86=>55, -87=>56, -88=>57, -89=>58, -90=>59, -91=>60, -165=>61, -93=>62, -94=>63, -818=>64, -95=>64, -768=>65, -96=>65, -97=>66, -98=>67, -99=>68, -100=>69, -101=>70, -102=>71, -103=>72, -104=>73, -105=>74, -106=>75, -107=>76, -108=>77, -109=>78, -110=>79, -111=>80, -112=>81, -113=>82, -114=>83, -115=>84, -116=>85, -117=>86, -118=>87, -119=>88, -120=>89, -121=>90, -122=>91, -123=>92, -166=>93, -125=>94, -732=>95, -771=>95, -700=>96, -8217=>96, -92=>97, -699=>98, -8216=>98, -124=>99, -126=>100, -8764=>100, -161=>101, -162=>102, -163=>103, -8260=>104, -402=>105, -164=>107, -8220=>108, -171=>109, -8249=>110, -8250=>111, -64257=>112, -64258=>113, -8210=>114, -8211=>114, -183=>117, -8729=>117, -8226=>119, -8218=>120, -8222=>121, -8221=>122, -187=>123, -191=>126, -769=>127, -710=>128, -770=>128, -175=>129, -772=>129, -774=>130, -775=>131, -776=>132, -730=>133, -778=>133, -184=>134, -807=>134, -779=>135, -808=>136, -780=>137, -822=>138, -8212=>138, -198=>139, -170=>140, -321=>141, -216=>142, -338=>143, -186=>144, -230=>145, -305=>146, -322=>147, -248=>148, -339=>149, -223=>150, -173=>151, -169=>152, -172=>153, -174=>154, -178=>157, -179=>158, -181=>159, -185=>160, -188=>161, -189=>162, -190=>163, -192=>164, -193=>165, -194=>166, -195=>167, -196=>168, -197=>169, -199=>170, -200=>171, -201=>172, -202=>173, -203=>174, -204=>175, -205=>176, -206=>177, -207=>178, -208=>179, -209=>180, -210=>181, -211=>182, -212=>183, -213=>184, -214=>185, -217=>187, -218=>188, -219=>189, -220=>190, -221=>191, -222=>192, -224=>193, -225=>194, -226=>195, -227=>196, -228=>197, -229=>198, -231=>199, -232=>200, -233=>201, -234=>202, -235=>203, -236=>204, -237=>205, -238=>206, -239=>207, -240=>208, -241=>209, -242=>210, -243=>211, -244=>212, -245=>213, -246=>214, -249=>216, -250=>217, -251=>218, -252=>219, -253=>220, -254=>221, -255=>222, -352=>223, -376=>224, -381=>225, -773=>226, -8254=>226, -353=>227, -8482=>228, -382=>229, -8194=>231, -65512=>323, -65377=>327, -65378=>328, -65379=>329, -65380=>330, -65381=>331, -65382=>332, -65383=>333, -65384=>334, -65385=>335, -65386=>336, -65387=>337, -65388=>338, -65389=>339, -65390=>340, -65391=>341, -65392=>342, -65393=>343, -65394=>344, -65395=>345, -65396=>346, -65397=>347, -65398=>348, -65399=>349, -65400=>350, -65401=>351, -65402=>352, -65403=>353, -65404=>354, -65405=>355, -65406=>356, -65407=>357, -65408=>358, -65409=>359, -65410=>360, -65411=>361, -65412=>362, -65413=>363, -65414=>364, -65415=>365, -65416=>366, -65417=>367, -65418=>368, -65419=>369, -65420=>370, -65421=>371, -65422=>372, -65423=>373, -65424=>374, -65425=>375, -65426=>376, -65427=>377, -65428=>378, -65429=>379, -65430=>380, -65431=>381, -65432=>382, -65433=>383, -65434=>384, -65435=>385, -65436=>386, -65437=>387, -65438=>388, -65439=>389, -8195=>633, -12288=>633, -12289=>634, -12290=>635, -65292=>636, -65294=>637, -12539=>638, -65306=>639, -65307=>640, -65311=>641, -65281=>642, -12443=>643, -12444=>644, -180=>645, -65344=>646, -168=>647, -65342=>648, -65507=>649, -65343=>650, -12541=>651, -12542=>652, -12445=>653, -12446=>654, -12291=>655, -20189=>656, -12293=>657, -12294=>658, -12295=>659, -12540=>660, -8213=>661, -8208=>662, -65295=>663, -65340=>664, -12316=>665, -65374=>665, -8214=>666, -65372=>667, -8230=>668, -8229=>669, -65288=>674, -65289=>675, -12308=>676, -12309=>677, -65339=>678, -65341=>679, -65371=>680, -65373=>681, -12296=>682, -12297=>683, -12298=>684, -12299=>685, -12300=>686, -12301=>687, -12302=>688, -12303=>689, -12304=>690, -12305=>691, -65291=>692, -8722=>693, -65293=>693, -177=>694, -215=>695, -247=>696, -65309=>697, -8800=>698, -65308=>699, -65310=>700, -8806=>701, -8807=>702, -8734=>703, -8756=>704, -9794=>705, -9792=>706, -176=>707, -8242=>708, -8243=>709, -8451=>710, -65509=>711, -65284=>712, -65504=>713, -65505=>714, -65285=>715, -65283=>716, -65286=>717, -65290=>718, -65312=>719, -167=>720, -9734=>721, -9733=>722, -9675=>723, -9679=>724, -9678=>725, -9671=>726, -9670=>727, -9633=>728, -9632=>729, -9651=>730, -9650=>731, -9661=>732, -9660=>733, -8251=>734, -12306=>735, -8594=>736, -8592=>737, -8593=>738, -8595=>739, -12307=>740, -8712=>741, -8715=>742, -8838=>743, -8839=>744, -8834=>745, -8835=>746, -8746=>747, -8745=>748, -8743=>749, -8744=>750, -65506=>751, -8658=>752, -8660=>753, -8704=>754, -8707=>755, -8736=>756, -8869=>757, -8978=>758, -8706=>759, -8711=>760, -8801=>761, -8786=>762, -8810=>763, -8811=>764, -8730=>765, -8765=>766, -8733=>767, -8757=>768, -8747=>769, -8748=>770, -8491=>771, -8240=>772, -9839=>773, -9837=>774, -9834=>775, -8224=>776, -8225=>777, -182=>778, -9711=>779, -65296=>780, -65297=>781, -65298=>782, -65299=>783, -65300=>784, -65301=>785, -65302=>786, -65303=>787, -65304=>788, -65305=>789, -65313=>790, -65314=>791, -65315=>792, -65316=>793, -65317=>794, -65318=>795, -65319=>796, -65320=>797, -65321=>798, -65322=>799, -65323=>800, -65324=>801, -65325=>802, -65326=>803, -65327=>804, -65328=>805, -65329=>806, -65330=>807, -65331=>808, -65332=>809, -65333=>810, -65334=>811, -65335=>812, -65336=>813, -65337=>814, -65338=>815, -65345=>816, -65346=>817, -65347=>818, -65348=>819, -65349=>820, -65350=>821, -65351=>822, -65352=>823, -65353=>824, -65354=>825, -65355=>826, -65356=>827, -65357=>828, -65358=>829, -65359=>830, -65360=>831, -65361=>832, -65362=>833, -65363=>834, -65364=>835, -65365=>836, -65366=>837, -65367=>838, -65368=>839, -65369=>840, -65370=>841, -12353=>842, -12354=>843, -12355=>844, -12356=>845, -12357=>846, -12358=>847, -12359=>848, -12360=>849, -12361=>850, -12362=>851, -12363=>852, -12364=>853, -12365=>854, -12366=>855, -12367=>856, -12368=>857, -12369=>858, -12370=>859, -12371=>860, -12372=>861, -12373=>862, -12374=>863, -12375=>864, -12376=>865, -12377=>866, -12378=>867, -12379=>868, -12380=>869, -12381=>870, -12382=>871, -12383=>872, -12384=>873, -12385=>874, -12386=>875, -12387=>876, -12388=>877, -12389=>878, -12390=>879, -12391=>880, -12392=>881, -12393=>882, -12394=>883, -12395=>884, -12396=>885, -12397=>886, -12398=>887, -12399=>888, -12400=>889, -12401=>890, -12402=>891, -12403=>892, -12404=>893, -12405=>894, -12406=>895, -12407=>896, -12408=>897, -12409=>898, -12410=>899, -12411=>900, -12412=>901, -12413=>902, -12414=>903, -12415=>904, -12416=>905, -12417=>906, -12418=>907, -12419=>908, -12420=>909, -12421=>910, -12422=>911, -12423=>912, -12424=>913, -12425=>914, -12426=>915, -12427=>916, -12428=>917, -12429=>918, -12430=>919, -12431=>920, -12432=>921, -12433=>922, -12434=>923, -12435=>924, -12449=>925, -12450=>926, -12451=>927, -12452=>928, -12453=>929, -12454=>930, -12455=>931, -12456=>932, -12457=>933, -12458=>934, -12459=>935, -12460=>936, -12461=>937, -12462=>938, -12463=>939, -12464=>940, -12465=>941, -12466=>942, -12467=>943, -12468=>944, -12469=>945, -12470=>946, -12471=>947, -12472=>948, -12473=>949, -12474=>950, -12475=>951, -12476=>952, -12477=>953, -12478=>954, -12479=>955, -12480=>956, -12481=>957, -12482=>958, -12483=>959, -12484=>960, -12485=>961, -12486=>962, -12487=>963, -12488=>964, -12489=>965, -12490=>966, -12491=>967, -12492=>968, -12493=>969, -12494=>970, -12495=>971, -12496=>972, -12497=>973, -12498=>974, -12499=>975, -12500=>976, -12501=>977, -12502=>978, -12503=>979, -12504=>980, -12505=>981, -12506=>982, -12507=>983, -12508=>984, -12509=>985, -12510=>986, -12511=>987, -12512=>988, -12513=>989, -12514=>990, -12515=>991, -12516=>992, -12517=>993, -12518=>994, -12519=>995, -12520=>996, -12521=>997, -12522=>998, -12523=>999, -12524=>1000, -12525=>1001, -12526=>1002, -12527=>1003, -12528=>1004, -12529=>1005, -12530=>1006, -12531=>1007, -12532=>1008, -12533=>1009, -12534=>1010, -913=>1011, -914=>1012, -915=>1013, -916=>1014, -917=>1015, -918=>1016, -919=>1017, -920=>1018, -921=>1019, -922=>1020, -923=>1021, -924=>1022, -925=>1023, -926=>1024, -927=>1025, -928=>1026, -929=>1027, -931=>1028, -932=>1029, -933=>1030, -934=>1031, -935=>1032, -936=>1033, -937=>1034, -945=>1035, -946=>1036, -947=>1037, -948=>1038, -949=>1039, -950=>1040, -951=>1041, -952=>1042, -953=>1043, -954=>1044, -955=>1045, -956=>1046, -957=>1047, -958=>1048, -959=>1049, -960=>1050, -961=>1051, -963=>1052, -964=>1053, -965=>1054, -966=>1055, -967=>1056, -968=>1057, -969=>1058, -1040=>1059, -1041=>1060, -1042=>1061, -1043=>1062, -1044=>1063, -1045=>1064, -1025=>1065, -1046=>1066, -1047=>1067, -1048=>1068, -1049=>1069, -1050=>1070, -1051=>1071, -1052=>1072, -1053=>1073, -1054=>1074, -1055=>1075, -1056=>1076, -1057=>1077, -1058=>1078, -1059=>1079, -1060=>1080, -1061=>1081, -1062=>1082, -1063=>1083, -1064=>1084, -1065=>1085, -1066=>1086, -1067=>1087, -1068=>1088, -1069=>1089, -1070=>1090, -1071=>1091, -1072=>1092, -1073=>1093, -1074=>1094, -1075=>1095, -1076=>1096, -1077=>1097, -1105=>1098, -1078=>1099, -1079=>1100, -1080=>1101, -1081=>1102, -1082=>1103, -1083=>1104, -1084=>1105, -1085=>1106, -1086=>1107, -1087=>1108, -1088=>1109, -1089=>1110, -1090=>1111, -1091=>1112, -1092=>1113, -1093=>1114, -1094=>1115, -1095=>1116, -1096=>1117, -1097=>1118, -1098=>1119, -1099=>1120, -1100=>1121, -1101=>1122, -1102=>1123, -1103=>1124, -20124=>1125, -21782=>1126, -23043=>1127, -38463=>1128, -21696=>1129, -24859=>1130, -25384=>1131, -23030=>1132, -36898=>1133, -33909=>1134, -33564=>1135, -31312=>1136, -24746=>1137, -25569=>1138, -28197=>1139, -26093=>1140, -33894=>1141, -33446=>1142, -39925=>1143, -26771=>1144, -22311=>1145, -26017=>1146, -25201=>1147, -23451=>1148, -22992=>1149, -34427=>1150, -39156=>1151, -32098=>1152, -32190=>1153, -39822=>1154, -25110=>1155, -31903=>1156, -34999=>1157, -23433=>1158, -24245=>1159, -25353=>1160, -26263=>1161, -26696=>1162, -38343=>1163, -38797=>1164, -26447=>1165, -20197=>1166, -20234=>1167, -20301=>1168, -20381=>1169, -20553=>1170, -22258=>1171, -22839=>1172, -22996=>1173, -23041=>1174, -23561=>1175, -24799=>1176, -24847=>1177, -24944=>1178, -26131=>1179, -26885=>1180, -28858=>1181, -30031=>1182, -30064=>1183, -31227=>1184, -32173=>1185, -32239=>1186, -32963=>1187, -33806=>1188, -12176=>1189, -34915=>1189, -35586=>1190, -36949=>1191, -36986=>1192, -21307=>1193, -20117=>1194, -20133=>1195, -22495=>1196, -32946=>1197, -37057=>1198, -30959=>1199, -12032=>1200, -19968=>1200, -22769=>1201, -28322=>1202, -36920=>1203, -31282=>1204, -33576=>1205, -33419=>1206, -39983=>1207, -20801=>1208, -21360=>1209, -21693=>1210, -21729=>1211, -22240=>1212, -23035=>1213, -24341=>1214, -39154=>1215, -28139=>1216, -32996=>1217, -34093=>1218, -38498=>1219, -38512=>1220, -38560=>1221, -38907=>1222, -21515=>1223, -21491=>1224, -23431=>1225, -28879=>1226, -12155=>1227, -32701=>1227, -36802=>1228, -12204=>1229, -38632=>1229, -21359=>1230, -40284=>1231, -31418=>1232, -19985=>1233, -30867=>1234, -12165=>1235, -33276=>1235, -28198=>1236, -22040=>1237, -21764=>1238, -27421=>1239, -34074=>1240, -39995=>1241, -23013=>1242, -21417=>1243, -28006=>1244, -12128=>1245, -29916=>1245, -38287=>1246, -22082=>1247, -20113=>1248, -36939=>1249, -38642=>1250, -33615=>1251, -39180=>1252, -21473=>1253, -21942=>1254, -23344=>1255, -24433=>1256, -26144=>1257, -26355=>1258, -26628=>1259, -27704=>1260, -27891=>1261, -27945=>1262, -29787=>1263, -30408=>1264, -31310=>1265, -38964=>1266, -33521=>1267, -34907=>1268, -35424=>1269, -37613=>1270, -28082=>1271, -30123=>1272, -30410=>1273, -39365=>1274, -24742=>1275, -35585=>1276, -36234=>1277, -38322=>1278, -27022=>1279, -21421=>1280, -20870=>1281, -22290=>1282, -22576=>1283, -22852=>1284, -23476=>1285, -24310=>1286, -24616=>1287, -25513=>1288, -25588=>1289, -27839=>1290, -28436=>1291, -28814=>1292, -28948=>1293, -29017=>1294, -29141=>1295, -29503=>1296, -32257=>1297, -33398=>1298, -33489=>1299, -34199=>1300, -36960=>1301, -37467=>1302, -40219=>1303, -22633=>1304, -26044=>1305, -27738=>1306, -29989=>1307, -20985=>1308, -22830=>1309, -22885=>1310, -24448=>1311, -24540=>1312, -25276=>1313, -26106=>1314, -27178=>1315, -27431=>1316, -27572=>1317, -29579=>1318, -32705=>1319, -35158=>1320, -40236=>1321, -40206=>1322, -12009=>1323, -40644=>1323, -23713=>1324, -27798=>1325, -33659=>1326, -20740=>1327, -23627=>1328, -25014=>1329, -33222=>1330, -26742=>1331, -29281=>1332, -12036=>1333, -20057=>1333, -20474=>1334, -21368=>1335, -24681=>1336, -28201=>1337, -31311=>1338, -12211=>1339, -38899=>1339, -19979=>1340, -21270=>1341, -20206=>1342, -20309=>1343, -20285=>1344, -20385=>1345, -20339=>1346, -21152=>1347, -21487=>1348, -22025=>1349, -22799=>1350, -23233=>1351, -23478=>1352, -23521=>1353, -31185=>1354, -26247=>1355, -26524=>1356, -26550=>1357, -27468=>1358, -27827=>1359, -12117=>1360, -28779=>1360, -29634=>1361, -31117=>1362, -12146=>1363, -31166=>1363, -31292=>1364, -31623=>1365, -33457=>1366, -33499=>1367, -33540=>1368, -33655=>1369, -33775=>1370, -33747=>1371, -34662=>1372, -35506=>1373, -22057=>1374, -36008=>1375, -36838=>1376, -36942=>1377, -38686=>1378, -34442=>1379, -20420=>1380, -23784=>1381, -25105=>1382, -12123=>1383, -29273=>1383, -30011=>1384, -33253=>1385, -33469=>1386, -34558=>1387, -36032=>1388, -38597=>1389, -39187=>1390, -39381=>1391, -20171=>1392, -20250=>1393, -35299=>1394, -22238=>1395, -22602=>1396, -22730=>1397, -24315=>1398, -24555=>1399, -24618=>1400, -24724=>1401, -24674=>1402, -25040=>1403, -25106=>1404, -25296=>1405, -25913=>1406, -39745=>1407, -26214=>1408, -26800=>1409, -28023=>1410, -28784=>1411, -30028=>1412, -30342=>1413, -32117=>1414, -33445=>1415, -34809=>1416, -38283=>1417, -38542=>1418, -12185=>1419, -35997=>1419, -20977=>1420, -21182=>1421, -22806=>1422, -21683=>1423, -23475=>1424, -23830=>1425, -24936=>1426, -27010=>1427, -28079=>1428, -30861=>1429, -33995=>1430, -34903=>1431, -35442=>1432, -37799=>1433, -39608=>1434, -28012=>1435, -39336=>1436, -34521=>1437, -22435=>1438, -26623=>1439, -34510=>1440, -37390=>1441, -21123=>1442, -22151=>1443, -21508=>1444, -24275=>1445, -25313=>1446, -25785=>1447, -26684=>1448, -26680=>1449, -27579=>1450, -29554=>1451, -30906=>1452, -31339=>1453, -35226=>1454, -12179=>1455, -35282=>1455, -36203=>1456, -36611=>1457, -37101=>1458, -38307=>1459, -38548=>1460, -12208=>1461, -38761=>1461, -23398=>1462, -23731=>1463, -27005=>1464, -38989=>1465, -38990=>1466, -25499=>1467, -31520=>1468, -27179=>1469, -27263=>1470, -26806=>1471, -39949=>1472, -28511=>1473, -21106=>1474, -21917=>1475, -24688=>1476, -25324=>1477, -27963=>1478, -28167=>1479, -28369=>1480, -33883=>1481, -35088=>1482, -36676=>1483, -19988=>1484, -39993=>1485, -21494=>1486, -26907=>1487, -27194=>1488, -38788=>1489, -26666=>1490, -20828=>1491, -31427=>1492, -33970=>1493, -37340=>1494, -37772=>1495, -22107=>1496, -40232=>1497, -26658=>1498, -33541=>1499, -33841=>1500, -31909=>1501, -21000=>1502, -33477=>1503, -12129=>1504, -29926=>1504, -20094=>1505, -20355=>1506, -20896=>1507, -23506=>1508, -21002=>1509, -21208=>1510, -21223=>1511, -24059=>1512, -21914=>1513, -22570=>1514, -23014=>1515, -23436=>1516, -23448=>1517, -23515=>1518, -12082=>1519, -24178=>1519, -24185=>1520, -24739=>1521, -24863=>1522, -24931=>1523, -25022=>1524, -25563=>1525, -25954=>1526, -26577=>1527, -26707=>1528, -26874=>1529, -27454=>1530, -27475=>1531, -27735=>1532, -28450=>1533, -28567=>1534, -28485=>1535, -29872=>1536, -12130=>1537, -29976=>1537, -30435=>1538, -30475=>1539, -31487=>1540, -31649=>1541, -31777=>1542, -32233=>1543, -12152=>1544, -32566=>1544, -32752=>1545, -32925=>1546, -33382=>1547, -33694=>1548, -35251=>1549, -35532=>1550, -36011=>1551, -36996=>1552, -37969=>1553, -38291=>1554, -38289=>1555, -38306=>1556, -38501=>1557, -38867=>1558, -39208=>1559, -33304=>1560, -20024=>1561, -21547=>1562, -23736=>1563, -24012=>1564, -29609=>1565, -30284=>1566, -30524=>1567, -23721=>1568, -32747=>1569, -36107=>1570, -38593=>1571, -38929=>1572, -38996=>1573, -39000=>1574, -20225=>1575, -20238=>1576, -21361=>1577, -21916=>1578, -22120=>1579, -22522=>1580, -22855=>1581, -23305=>1582, -23492=>1583, -23696=>1584, -24076=>1585, -24190=>1586, -24524=>1587, -25582=>1588, -26426=>1589, -26071=>1590, -26082=>1591, -26399=>1592, -26827=>1593, -26820=>1594, -27231=>1595, -24112=>1596, -27589=>1597, -27671=>1598, -27773=>1599, -30079=>1600, -31048=>1601, -23395=>1602, -31232=>1603, -32000=>1604, -24509=>1605, -35215=>1606, -35352=>1607, -36020=>1608, -36215=>1609, -36556=>1610, -36637=>1611, -39138=>1612, -39438=>1613, -12004=>1614, -12225=>1614, -39740=>1614, -12018=>1615, -20096=>1615, -20605=>1616, -20736=>1617, -22931=>1618, -23452=>1619, -25135=>1620, -25216=>1621, -25836=>1622, -27450=>1623, -29344=>1624, -30097=>1625, -31047=>1626, -32681=>1627, -34811=>1628, -35516=>1629, -35696=>1630, -25516=>1631, -33738=>1632, -38816=>1633, -21513=>1634, -21507=>1635, -21931=>1636, -26708=>1637, -27224=>1638, -35440=>1639, -30759=>1640, -26485=>1641, -12233=>1642, -40653=>1642, -21364=>1643, -23458=>1644, -33050=>1645, -34384=>1646, -36870=>1647, -19992=>1648, -20037=>1649, -20167=>1650, -20241=>1651, -21450=>1652, -21560=>1653, -23470=>1654, -12088=>1655, -24339=>1655, -24613=>1656, -25937=>1657, -26429=>1658, -27714=>1659, -27762=>1660, -27875=>1661, -28792=>1662, -29699=>1663, -31350=>1664, -31406=>1665, -31496=>1666, -32026=>1667, -31998=>1668, -32102=>1669, -26087=>1670, -12124=>1671, -29275=>1671, -21435=>1672, -23621=>1673, -24040=>1674, -25298=>1675, -25312=>1676, -25369=>1677, -28192=>1678, -34394=>1679, -35377=>1680, -36317=>1681, -37624=>1682, -28417=>1683, -31142=>1684, -12226=>1685, -39770=>1685, -20136=>1686, -20139=>1687, -20140=>1688, -20379=>1689, -20384=>1690, -20689=>1691, -20807=>1692, -31478=>1693, -20849=>1694, -20982=>1695, -21332=>1696, -21281=>1697, -21375=>1698, -21483=>1699, -21932=>1700, -22659=>1701, -23777=>1702, -24375=>1703, -24394=>1704, -24623=>1705, -24656=>1706, -24685=>1707, -25375=>1708, -25945=>1709, -27211=>1710, -27841=>1711, -29378=>1712, -29421=>1713, -30703=>1714, -33016=>1715, -33029=>1716, -33288=>1717, -34126=>1718, -37111=>1719, -37857=>1720, -38911=>1721, -39255=>1722, -39514=>1723, -20208=>1724, -20957=>1725, -23597=>1726, -26241=>1727, -26989=>1728, -23616=>1729, -26354=>1730, -26997=>1731, -12127=>1732, -29577=>1732, -26704=>1733, -31873=>1734, -20677=>1735, -21220=>1736, -22343=>1737, -12081=>1738, -24062=>1738, -37670=>1739, -12100=>1740, -26020=>1740, -27427=>1741, -27453=>1742, -29748=>1743, -31105=>1744, -31165=>1745, -31563=>1746, -32202=>1747, -33465=>1748, -33740=>1749, -34943=>1750, -35167=>1751, -35641=>1752, -36817=>1753, -12198=>1754, -37329=>1754, -21535=>1755, -37504=>1756, -20061=>1757, -20534=>1758, -21477=>1759, -21306=>1760, -29399=>1761, -29590=>1762, -30697=>1763, -33510=>1764, -36527=>1765, -39366=>1766, -39368=>1767, -39378=>1768, -20855=>1769, -24858=>1770, -34398=>1771, -21936=>1772, -31354=>1773, -20598=>1774, -23507=>1775, -36935=>1776, -38533=>1777, -20018=>1778, -27355=>1779, -37351=>1780, -23633=>1781, -23624=>1782, -25496=>1783, -31391=>1784, -27795=>1785, -38772=>1786, -36705=>1787, -31402=>1788, -29066=>1789, -38536=>1790, -31874=>1791, -26647=>1792, -32368=>1793, -26705=>1794, -37740=>1795, -21234=>1796, -21531=>1797, -34219=>1798, -35347=>1799, -32676=>1800, -36557=>1801, -37089=>1802, -21350=>1803, -34952=>1804, -31041=>1805, -20418=>1806, -20670=>1807, -21009=>1808, -20804=>1809, -21843=>1810, -22317=>1811, -29674=>1812, -22411=>1813, -22865=>1814, -24418=>1815, -24452=>1816, -24693=>1817, -24950=>1818, -24935=>1819, -25001=>1820, -25522=>1821, -25658=>1822, -25964=>1823, -26223=>1824, -26690=>1825, -28179=>1826, -30054=>1827, -31293=>1828, -31995=>1829, -32076=>1830, -32153=>1831, -32331=>1832, -32619=>1833, -33550=>1834, -33610=>1835, -34509=>1836, -35336=>1837, -35427=>1838, -35686=>1839, -36605=>1840, -38938=>1841, -40335=>1842, -33464=>1843, -36814=>1844, -39912=>1845, -21127=>1846, -25119=>1847, -25731=>1848, -28608=>1849, -38553=>1850, -26689=>1851, -20625=>1852, -12107=>1853, -27424=>1853, -27770=>1854, -28500=>1855, -12147=>1856, -31348=>1856, -32080=>1857, -12174=>1858, -34880=>1858, -35363=>1859, -12105=>1860, -26376=>1860, -20214=>1861, -20537=>1862, -20518=>1863, -20581=>1864, -20860=>1865, -21048=>1866, -21091=>1867, -21927=>1868, -22287=>1869, -22533=>1870, -23244=>1871, -24314=>1872, -25010=>1873, -25080=>1874, -25331=>1875, -25458=>1876, -26908=>1877, -27177=>1878, -29309=>1879, -12125=>1880, -29356=>1880, -29486=>1881, -30740=>1882, -30831=>1883, -32121=>1884, -30476=>1885, -32937=>1886, -12178=>1887, -35211=>1887, -35609=>1888, -36066=>1889, -36562=>1890, -36963=>1891, -37749=>1892, -38522=>1893, -38997=>1894, -39443=>1895, -40568=>1896, -20803=>1897, -21407=>1898, -21427=>1899, -24187=>1900, -24358=>1901, -28187=>1902, -28304=>1903, -12126=>1904, -29572=>1904, -29694=>1905, -32067=>1906, -33335=>1907, -12180=>1908, -35328=>1908, -35578=>1909, -38480=>1910, -20046=>1911, -20491=>1912, -21476=>1913, -21628=>1914, -22266=>1915, -22993=>1916, -23396=>1917, -12080=>1918, -24049=>1918, -24235=>1919, -24359=>1920, -12094=>1921, -25144=>1921, -25925=>1922, -26543=>1923, -28246=>1924, -29392=>1925, -31946=>1926, -34996=>1927, -32929=>1928, -32993=>1929, -33776=>1930, -11969=>1931, -34382=>1931, -35463=>1932, -36328=>1933, -37431=>1934, -38599=>1935, -39015=>1936, -12238=>1937, -40723=>1937, -20116=>1938, -20114=>1939, -20237=>1940, -21320=>1941, -21577=>1942, -21566=>1943, -23087=>1944, -24460=>1945, -24481=>1946, -24735=>1947, -26791=>1948, -27278=>1949, -29786=>1950, -30849=>1951, -35486=>1952, -35492=>1953, -35703=>1954, -37264=>1955, -20062=>1956, -39881=>1957, -20132=>1958, -20348=>1959, -20399=>1960, -20505=>1961, -20502=>1962, -20809=>1963, -20844=>1964, -21151=>1965, -21177=>1966, -21246=>1967, -21402=>1968, -12061=>1969, -21475=>1969, -21521=>1970, -21518=>1971, -21897=>1972, -22353=>1973, -22434=>1974, -22909=>1975, -23380=>1976, -23389=>1977, -23439=>1978, -12079=>1979, -24037=>1979, -24039=>1980, -24055=>1981, -24184=>1982, -24195=>1983, -24218=>1984, -24247=>1985, -24344=>1986, -24658=>1987, -24908=>1988, -25239=>1989, -25304=>1990, -25511=>1991, -25915=>1992, -26114=>1993, -26179=>1994, -26356=>1995, -26477=>1996, -26657=>1997, -26775=>1998, -27083=>1999, -27743=>2000, -27946=>2001, -28009=>2002, -28207=>2003, -28317=>2004, -30002=>2005, -30343=>2006, -30828=>2007, -31295=>2008, -31968=>2009, -32005=>2010, -32024=>2011, -32094=>2012, -32177=>2013, -32789=>2014, -32771=>2015, -32943=>2016, -32945=>2017, -33108=>2018, -33167=>2019, -33322=>2020, -33618=>2021, -12175=>2022, -34892=>2022, -34913=>2023, -35611=>2024, -36002=>2025, -36092=>2026, -37066=>2027, -37237=>2028, -37489=>2029, -30783=>2030, -37628=>2031, -38308=>2032, -38477=>2033, -38917=>2034, -12217=>2035, -39321=>2035, -12220=>2036, -39640=>2036, -40251=>2037, -21083=>2038, -21163=>2039, -21495=>2040, -21512=>2041, -22741=>2042, -25335=>2043, -28640=>2044, -35946=>2045, -36703=>2046, -40633=>2047, -20811=>2048, -21051=>2049, -21578=>2050, -22269=>2051, -31296=>2052, -37239=>2053, -40288=>2054, -12234=>2055, -40658=>2055, -29508=>2056, -28425=>2057, -33136=>2058, -29969=>2059, -24573=>2060, -24794=>2061, -12219=>2062, -39592=>2062, -29403=>2063, -36796=>2064, -27492=>2065, -38915=>2066, -20170=>2067, -22256=>2068, -22372=>2069, -22718=>2070, -23130=>2071, -24680=>2072, -25031=>2073, -26127=>2074, -26118=>2075, -26681=>2076, -26801=>2077, -28151=>2078, -30165=>2079, -32058=>2080, -12169=>2081, -33390=>2081, -39746=>2082, -20123=>2083, -20304=>2084, -21449=>2085, -21766=>2086, -23919=>2087, -24038=>2088, -24046=>2089, -26619=>2090, -27801=>2091, -29811=>2092, -30722=>2093, -35408=>2094, -37782=>2095, -35039=>2096, -22352=>2097, -24231=>2098, -25387=>2099, -20661=>2100, -20652=>2101, -20877=>2102, -26368=>2103, -21705=>2104, -22622=>2105, -22971=>2106, -23472=>2107, -24425=>2108, -25165=>2109, -25505=>2110, -26685=>2111, -27507=>2112, -28168=>2113, -28797=>2114, -37319=>2115, -29312=>2116, -30741=>2117, -30758=>2118, -31085=>2119, -25998=>2120, -32048=>2121, -33756=>2122, -35009=>2123, -36617=>2124, -38555=>2125, -21092=>2126, -22312=>2127, -26448=>2128, -32618=>2129, -36001=>2130, -20916=>2131, -22338=>2132, -38442=>2133, -22586=>2134, -27018=>2135, -32948=>2136, -21682=>2137, -23822=>2138, -22524=>2139, -30869=>2140, -40442=>2141, -20316=>2142, -21066=>2143, -21643=>2144, -25662=>2145, -26152=>2146, -26388=>2147, -26613=>2148, -31364=>2149, -31574=>2150, -32034=>2151, -37679=>2152, -26716=>2153, -39853=>2154, -31545=>2155, -21273=>2156, -20874=>2157, -21047=>2158, -23519=>2159, -25334=>2160, -25774=>2161, -25830=>2162, -26413=>2163, -27578=>2164, -34217=>2165, -38609=>2166, -30352=>2167, -39894=>2168, -25420=>2169, -37638=>2170, -39851=>2171, -12139=>2172, -30399=>2172, -26194=>2173, -19977=>2174, -20632=>2175, -21442=>2176, -12077=>2177, -23665=>2177, -24808=>2178, -25746=>2179, -25955=>2180, -26719=>2181, -29158=>2182, -29642=>2183, -29987=>2184, -31639=>2185, -32386=>2186, -34453=>2187, -35715=>2188, -36059=>2189, -37240=>2190, -39184=>2191, -26028=>2192, -26283=>2193, -27531=>2194, -20181=>2195, -20180=>2196, -20282=>2197, -20351=>2198, -21050=>2199, -21496=>2200, -21490=>2201, -21987=>2202, -22235=>2203, -12064=>2204, -22763=>2204, -22987=>2205, -22985=>2206, -23039=>2207, -12070=>2208, -23376=>2208, -23629=>2209, -24066=>2210, -24107=>2211, -24535=>2212, -24605=>2213, -25351=>2214, -12096=>2215, -25903=>2215, -23388=>2216, -26031=>2217, -26045=>2218, -26088=>2219, -26525=>2220, -12108=>2221, -27490=>2221, -27515=>2222, -12114=>2223, -27663=>2223, -29509=>2224, -31049=>2225, -31169=>2226, -12151=>2227, -31992=>2227, -32025=>2228, -32043=>2229, -32930=>2230, -33026=>2231, -12164=>2232, -33267=>2232, -35222=>2233, -35422=>2234, -35433=>2235, -35430=>2236, -35468=>2237, -35566=>2238, -36039=>2239, -36060=>2240, -38604=>2241, -39164=>2242, -12013=>2243, -27503=>2243, -20107=>2244, -20284=>2245, -20365=>2246, -20816=>2247, -23383=>2248, -23546=>2249, -24904=>2250, -25345=>2251, -26178=>2252, -27425=>2253, -28363=>2254, -27835=>2255, -29246=>2256, -29885=>2257, -30164=>2258, -30913=>2259, -12144=>2260, -31034=>2260, -12157=>2261, -32780=>2261, -12159=>2262, -32819=>2262, -12163=>2263, -33258=>2263, -33940=>2264, -36766=>2265, -27728=>2266, -12229=>2267, -40575=>2267, -24335=>2268, -35672=>2269, -40235=>2270, -31482=>2271, -36600=>2272, -23437=>2273, -38635=>2274, -19971=>2275, -21489=>2276, -22519=>2277, -22833=>2278, -23241=>2279, -23460=>2280, -24713=>2281, -28287=>2282, -28422=>2283, -30142=>2284, -36074=>2285, -23455=>2286, -34048=>2287, -31712=>2288, -20594=>2289, -26612=>2290, -33437=>2291, -23649=>2292, -34122=>2293, -32286=>2294, -33294=>2295, -20889=>2296, -23556=>2297, -25448=>2298, -36198=>2299, -26012=>2300, -29038=>2301, -31038=>2302, -32023=>2303, -32773=>2304, -35613=>2305, -12190=>2306, -36554=>2306, -36974=>2307, -34503=>2308, -37034=>2309, -20511=>2310, -21242=>2311, -23610=>2312, -26451=>2313, -28796=>2314, -29237=>2315, -37196=>2316, -37320=>2317, -37675=>2318, -33509=>2319, -23490=>2320, -24369=>2321, -24825=>2322, -20027=>2323, -21462=>2324, -23432=>2325, -12095=>2326, -25163=>2326, -26417=>2327, -27530=>2328, -29417=>2329, -29664=>2330, -31278=>2331, -33131=>2332, -36259=>2333, -37202=>2334, -12216=>2335, -39318=>2335, -20754=>2336, -21463=>2337, -21610=>2338, -23551=>2339, -25480=>2340, -27193=>2341, -32172=>2342, -38656=>2343, -22234=>2344, -21454=>2345, -21608=>2346, -23447=>2347, -23601=>2348, -24030=>2349, -20462=>2350, -24833=>2351, -25342=>2352, -27954=>2353, -31168=>2354, -31179=>2355, -32066=>2356, -32333=>2357, -32722=>2358, -33261=>2359, -12168=>2360, -33311=>2360, -33936=>2361, -34886=>2362, -35186=>2363, -35728=>2364, -36468=>2365, -36655=>2366, -36913=>2367, -37195=>2368, -37228=>2369, -38598=>2370, -37276=>2371, -20160=>2372, -20303=>2373, -20805=>2374, -12055=>2375, -21313=>2375, -24467=>2376, -25102=>2377, -26580=>2378, -27713=>2379, -28171=>2380, -29539=>2381, -32294=>2382, -37325=>2383, -37507=>2384, -21460=>2385, -22809=>2386, -23487=>2387, -28113=>2388, -31069=>2389, -32302=>2390, -31899=>2391, -22654=>2392, -29087=>2393, -20986=>2394, -34899=>2395, -36848=>2396, -20426=>2397, -23803=>2398, -26149=>2399, -30636=>2400, -31459=>2401, -33308=>2402, -39423=>2403, -20934=>2404, -24490=>2405, -26092=>2406, -26991=>2407, -27529=>2408, -28147=>2409, -28310=>2410, -28516=>2411, -30462=>2412, -32020=>2413, -24033=>2414, -36981=>2415, -37255=>2416, -38918=>2417, -20966=>2418, -21021=>2419, -25152=>2420, -26257=>2421, -26329=>2422, -28186=>2423, -24246=>2424, -32210=>2425, -32626=>2426, -26360=>2427, -34223=>2428, -34295=>2429, -35576=>2430, -21161=>2431, -21465=>2432, -12069=>2433, -22899=>2433, -24207=>2434, -24464=>2435, -24661=>2436, -37604=>2437, -38500=>2438, -20663=>2439, -20767=>2440, -21213=>2441, -21280=>2442, -21319=>2443, -21484=>2444, -21736=>2445, -21830=>2446, -21809=>2447, -22039=>2448, -22888=>2449, -22974=>2450, -23100=>2451, -23477=>2452, -23558=>2453, -12073=>2454, -23567=>2454, -23569=>2455, -23578=>2456, -24196=>2457, -24202=>2458, -24288=>2459, -24432=>2460, -25215=>2461, -25220=>2462, -25307=>2463, -25484=>2464, -25463=>2465, -26119=>2466, -26124=>2467, -26157=>2468, -26230=>2469, -26494=>2470, -26786=>2471, -27167=>2472, -27189=>2473, -27836=>2474, -28040=>2475, -28169=>2476, -28248=>2477, -28988=>2478, -28966=>2479, -29031=>2480, -30151=>2481, -30465=>2482, -30813=>2483, -30977=>2484, -31077=>2485, -31216=>2486, -31456=>2487, -31505=>2488, -31911=>2489, -32057=>2490, -32918=>2491, -33750=>2492, -33931=>2493, -34121=>2494, -34909=>2495, -35059=>2496, -35359=>2497, -35388=>2498, -35412=>2499, -35443=>2500, -35937=>2501, -36062=>2502, -37284=>2503, -37478=>2504, -37758=>2505, -37912=>2506, -38556=>2507, -38808=>2508, -19978=>2509, -19976=>2510, -19998=>2511, -20055=>2512, -20887=>2513, -21104=>2514, -22478=>2515, -22580=>2516, -22732=>2517, -23330=>2518, -24120=>2519, -24773=>2520, -25854=>2521, -26465=>2522, -26454=>2523, -27972=>2524, -29366=>2525, -30067=>2526, -31331=>2527, -33976=>2528, -35698=>2529, -37304=>2530, -37664=>2531, -22065=>2532, -22516=>2533, -39166=>2534, -25325=>2535, -26893=>2536, -27542=>2537, -29165=>2538, -32340=>2539, -32887=>2540, -12170=>2541, -33394=>2541, -35302=>2542, -12215=>2543, -39135=>2543, -34645=>2544, -36785=>2545, -23611=>2546, -20280=>2547, -20449=>2548, -20405=>2549, -21767=>2550, -23072=>2551, -23517=>2552, -23529=>2553, -12092=>2554, -24515=>2554, -24910=>2555, -25391=>2556, -26032=>2557, -26187=>2558, -26862=>2559, -27035=>2560, -28024=>2561, -28145=>2562, -30003=>2563, -30137=>2564, -30495=>2565, -31070=>2566, -31206=>2567, -32051=>2568, -12162=>2569, -33251=>2569, -33455=>2570, -34218=>2571, -35242=>2572, -35386=>2573, -12189=>2574, -36523=>2574, -12191=>2575, -36763=>2575, -36914=>2576, -37341=>2577, -38663=>2578, -12040=>2579, -20154=>2579, -20161=>2580, -20995=>2581, -22645=>2582, -22764=>2583, -23563=>2584, -29978=>2585, -23613=>2586, -33102=>2587, -35338=>2588, -36805=>2589, -38499=>2590, -38765=>2591, -31525=>2592, -35535=>2593, -38920=>2594, -37218=>2595, -22259=>2596, -21416=>2597, -36887=>2598, -21561=>2599, -22402=>2600, -24101=>2601, -25512=>2602, -12116=>2603, -27700=>2603, -28810=>2604, -30561=>2605, -31883=>2606, -32736=>2607, -34928=>2608, -36930=>2609, -37204=>2610, -37648=>2611, -37656=>2612, -38543=>2613, -29790=>2614, -39620=>2615, -23815=>2616, -23913=>2617, -25968=>2618, -26530=>2619, -36264=>2620, -38619=>2621, -25454=>2622, -26441=>2623, -26905=>2624, -33733=>2625, -38935=>2626, -38592=>2627, -35070=>2628, -28548=>2629, -25722=>2630, -12072=>2631, -23544=>2631, -19990=>2632, -28716=>2633, -30045=>2634, -26159=>2635, -20932=>2636, -21046=>2637, -21218=>2638, -22995=>2639, -24449=>2640, -24615=>2641, -25104=>2642, -25919=>2643, -25972=>2644, -26143=>2645, -26228=>2646, -26866=>2647, -26646=>2648, -27491=>2649, -28165=>2650, -29298=>2651, -12131=>2652, -29983=>2652, -30427=>2653, -31934=>2654, -32854=>2655, -22768=>2656, -35069=>2657, -11972=>2658, -35199=>2658, -35488=>2659, -35475=>2660, -35531=>2661, -36893=>2662, -37266=>2663, -11992=>2664, -38738=>2664, -38745=>2665, -12011=>2666, -25993=>2666, -31246=>2667, -33030=>2668, -38587=>2669, -24109=>2670, -24796=>2671, -25114=>2672, -26021=>2673, -26132=>2674, -26512=>2675, -12143=>2676, -30707=>2676, -31309=>2677, -31821=>2678, -32318=>2679, -33034=>2680, -36012=>2681, -12186=>2682, -36196=>2682, -36321=>2683, -36447=>2684, -30889=>2685, -20999=>2686, -25305=>2687, -25509=>2688, -25666=>2689, -25240=>2690, -35373=>2691, -31363=>2692, -31680=>2693, -35500=>2694, -38634=>2695, -32118=>2696, -12166=>2697, -33292=>2697, -34633=>2698, -20185=>2699, -20808=>2700, -21315=>2701, -21344=>2702, -23459=>2703, -23554=>2704, -23574=>2705, -24029=>2706, -25126=>2707, -25159=>2708, -25776=>2709, -26643=>2710, -26676=>2711, -27849=>2712, -27973=>2713, -27927=>2714, -26579=>2715, -28508=>2716, -29006=>2717, -29053=>2718, -26059=>2719, -31359=>2720, -31661=>2721, -32218=>2722, -32330=>2723, -32680=>2724, -33146=>2725, -12167=>2726, -33307=>2726, -33337=>2727, -34214=>2728, -35438=>2729, -36046=>2730, -36341=>2731, -36984=>2732, -36983=>2733, -37549=>2734, -37521=>2735, -38275=>2736, -39854=>2737, -21069=>2738, -21892=>2739, -28472=>2740, -28982=>2741, -20840=>2742, -31109=>2743, -32341=>2744, -33203=>2745, -31950=>2746, -22092=>2747, -22609=>2748, -23720=>2749, -25514=>2750, -26366=>2751, -26365=>2752, -26970=>2753, -29401=>2754, -30095=>2755, -30094=>2756, -30990=>2757, -31062=>2758, -31199=>2759, -31895=>2760, -32032=>2761, -32068=>2762, -34311=>2763, -35380=>2764, -38459=>2765, -36961=>2766, -12239=>2767, -40736=>2767, -20711=>2768, -21109=>2769, -21452=>2770, -21474=>2771, -20489=>2772, -21930=>2773, -22766=>2774, -22863=>2775, -29245=>2776, -23435=>2777, -23652=>2778, -21277=>2779, -24803=>2780, -24819=>2781, -25436=>2782, -25475=>2783, -25407=>2784, -25531=>2785, -25805=>2786, -26089=>2787, -26361=>2788, -24035=>2789, -27085=>2790, -27133=>2791, -28437=>2792, -29157=>2793, -20105=>2794, -30185=>2795, -30456=>2796, -31379=>2797, -31967=>2798, -32207=>2799, -32156=>2800, -32865=>2801, -33609=>2802, -33624=>2803, -33900=>2804, -33980=>2805, -34299=>2806, -35013=>2807, -12187=>2808, -36208=>2808, -36865=>2809, -36973=>2810, -37783=>2811, -38684=>2812, -39442=>2813, -20687=>2814, -22679=>2815, -24974=>2816, -33235=>2817, -34101=>2818, -36104=>2819, -36896=>2820, -20419=>2821, -20596=>2822, -21063=>2823, -21363=>2824, -24687=>2825, -25417=>2826, -26463=>2827, -28204=>2828, -12188=>2829, -36275=>2829, -36895=>2830, -20439=>2831, -23646=>2832, -36042=>2833, -26063=>2834, -32154=>2835, -21330=>2836, -34966=>2837, -20854=>2838, -25539=>2839, -23384=>2840, -23403=>2841, -23562=>2842, -25613=>2843, -26449=>2844, -36956=>2845, -20182=>2846, -22810=>2847, -22826=>2848, -27760=>2849, -35409=>2850, -21822=>2851, -22549=>2852, -22949=>2853, -24816=>2854, -25171=>2855, -26561=>2856, -33333=>2857, -26965=>2858, -38464=>2859, -39364=>2860, -39464=>2861, -20307=>2862, -22534=>2863, -23550=>2864, -32784=>2865, -23729=>2866, -24111=>2867, -24453=>2868, -24608=>2869, -24907=>2870, -25140=>2871, -26367=>2872, -27888=>2873, -28382=>2874, -32974=>2875, -33151=>2876, -33492=>2877, -34955=>2878, -36024=>2879, -36864=>2880, -36910=>2881, -38538=>2882, -40667=>2883, -39899=>2884, -20195=>2885, -21488=>2886, -12068=>2887, -22823=>2887, -31532=>2888, -37261=>2889, -38988=>2890, -40441=>2891, -28381=>2892, -28711=>2893, -21331=>2894, -21828=>2895, -23429=>2896, -25176=>2897, -25246=>2898, -25299=>2899, -27810=>2900, -28655=>2901, -29730=>2902, -35351=>2903, -37944=>2904, -28609=>2905, -35582=>2906, -33592=>2907, -20967=>2908, -34552=>2909, -21482=>2910, -21481=>2911, -20294=>2912, -36948=>2913, -12192=>2914, -36784=>2914, -22890=>2915, -33073=>2916, -24061=>2917, -31466=>2918, -36799=>2919, -26842=>2920, -12181=>2921, -35895=>2921, -29432=>2922, -40008=>2923, -27197=>2924, -35504=>2925, -20025=>2926, -21336=>2927, -22022=>2928, -22374=>2929, -25285=>2930, -25506=>2931, -26086=>2932, -27470=>2933, -28129=>2934, -28251=>2935, -28845=>2936, -30701=>2937, -31471=>2938, -31658=>2939, -32187=>2940, -32829=>2941, -32966=>2942, -34507=>2943, -35477=>2944, -37723=>2945, -22243=>2946, -22727=>2947, -24382=>2948, -26029=>2949, -26262=>2950, -27264=>2951, -27573=>2952, -30007=>2953, -35527=>2954, -20516=>2955, -30693=>2956, -22320=>2957, -24347=>2958, -24677=>2959, -26234=>2960, -27744=>2961, -30196=>2962, -31258=>2963, -32622=>2964, -33268=>2965, -34584=>2966, -36933=>2967, -39347=>2968, -31689=>2969, -30044=>2970, -12149=>2971, -31481=>2971, -31569=>2972, -33988=>2973, -36880=>2974, -31209=>2975, -31378=>2976, -33590=>2977, -23265=>2978, -30528=>2979, -20013=>2980, -20210=>2981, -23449=>2982, -24544=>2983, -25277=>2984, -26172=>2985, -26609=>2986, -27880=>2987, -12173=>2988, -34411=>2988, -34935=>2989, -35387=>2990, -37198=>2991, -37619=>2992, -39376=>2993, -27159=>2994, -28710=>2995, -29482=>2996, -33511=>2997, -33879=>2998, -36015=>2999, -19969=>3000, -20806=>3001, -20939=>3002, -21899=>3003, -23541=>3004, -24086=>3005, -24115=>3006, -24193=>3007, -24340=>3008, -24373=>3009, -24427=>3010, -24500=>3011, -25074=>3012, -25361=>3013, -26274=>3014, -26397=>3015, -28526=>3016, -29266=>3017, -30010=>3018, -30522=>3019, -32884=>3020, -33081=>3021, -33144=>3022, -34678=>3023, -35519=>3024, -35548=>3025, -36229=>3026, -36339=>3027, -37530=>3028, -11985=>3029, -12199=>3029, -38263=>3029, -38914=>3030, -12227=>3031, -40165=>3031, -21189=>3032, -25431=>3033, -30452=>3034, -26389=>3035, -27784=>3036, -29645=>3037, -36035=>3038, -37806=>3039, -38515=>3040, -27941=>3041, -22684=>3042, -26894=>3043, -27084=>3044, -36861=>3045, -37786=>3046, -30171=>3047, -36890=>3048, -22618=>3049, -26626=>3050, -25524=>3051, -27131=>3052, -20291=>3053, -28460=>3054, -26584=>3055, -36795=>3056, -34086=>3057, -32180=>3058, -37716=>3059, -26943=>3060, -28528=>3061, -22378=>3062, -22775=>3063, -23340=>3064, -32044=>3065, -12118=>3066, -29226=>3066, -21514=>3067, -37347=>3068, -40372=>3069, -20141=>3070, -20302=>3071, -20572=>3072, -20597=>3073, -21059=>3074, -35998=>3075, -21576=>3076, -22564=>3077, -23450=>3078, -24093=>3079, -24213=>3080, -24237=>3081, -24311=>3082, -24351=>3083, -24716=>3084, -25269=>3085, -25402=>3086, -25552=>3087, -26799=>3088, -27712=>3089, -30855=>3090, -31118=>3091, -31243=>3092, -32224=>3093, -33351=>3094, -35330=>3095, -35558=>3096, -36420=>3097, -36883=>3098, -37048=>3099, -37165=>3100, -37336=>3101, -12237=>3102, -40718=>3102, -27877=>3103, -25688=>3104, -25826=>3105, -25973=>3106, -28404=>3107, -30340=>3108, -31515=>3109, -36969=>3110, -37841=>3111, -28346=>3112, -21746=>3113, -24505=>3114, -25764=>3115, -36685=>3116, -36845=>3117, -37444=>3118, -20856=>3119, -22635=>3120, -22825=>3121, -23637=>3122, -24215=>3123, -28155=>3124, -32399=>3125, -29980=>3126, -36028=>3127, -36578=>3128, -39003=>3129, -28857=>3130, -20253=>3131, -27583=>3132, -28593=>3133, -12133=>3134, -30000=>3134, -38651=>3135, -20814=>3136, -21520=>3137, -22581=>3138, -22615=>3139, -22956=>3140, -23648=>3141, -24466=>3142, -12099=>3143, -26007=>3143, -26460=>3144, -28193=>3145, -30331=>3146, -33759=>3147, -36077=>3148, -36884=>3149, -37117=>3150, -37709=>3151, -30757=>3152, -30778=>3153, -21162=>3154, -24230=>3155, -12063=>3156, -22303=>3156, -22900=>3157, -24594=>3158, -20498=>3159, -20826=>3160, -20908=>3161, -20941=>3162, -12049=>3163, -20992=>3163, -21776=>3164, -22612=>3165, -22616=>3166, -22871=>3167, -23445=>3168, -23798=>3169, -23947=>3170, -24764=>3171, -25237=>3172, -25645=>3173, -26481=>3174, -26691=>3175, -26812=>3176, -26847=>3177, -30423=>3178, -28120=>3179, -28271=>3180, -28059=>3181, -28783=>3182, -29128=>3183, -24403=>3184, -30168=>3185, -31095=>3186, -31561=>3187, -31572=>3188, -31570=>3189, -31958=>3190, -32113=>3191, -21040=>3192, -33891=>3193, -34153=>3194, -34276=>3195, -35342=>3196, -35588=>3197, -12182=>3198, -35910=>3198, -36367=>3199, -36867=>3200, -36879=>3201, -37913=>3202, -38518=>3203, -38957=>3204, -39472=>3205, -38360=>3206, -20685=>3207, -21205=>3208, -21516=>3209, -22530=>3210, -23566=>3211, -24999=>3212, -25758=>3213, -27934=>3214, -30643=>3215, -31461=>3216, -33012=>3217, -33796=>3218, -36947=>3219, -37509=>3220, -23776=>3221, -40199=>3222, -21311=>3223, -24471=>3224, -24499=>3225, -28060=>3226, -29305=>3227, -30563=>3228, -31167=>3229, -31716=>3230, -27602=>3231, -29420=>3232, -35501=>3233, -26627=>3234, -27233=>3235, -20984=>3236, -31361=>3237, -26932=>3238, -23626=>3239, -40182=>3240, -33515=>3241, -23493=>3242, -12195=>3243, -37193=>3243, -28702=>3244, -22136=>3245, -23663=>3246, -24775=>3247, -25958=>3248, -27788=>3249, -35930=>3250, -36929=>3251, -38931=>3252, -21585=>3253, -26311=>3254, -37389=>3255, -22856=>3256, -37027=>3257, -20869=>3258, -20045=>3259, -20970=>3260, -34201=>3261, -35598=>3262, -28760=>3263, -25466=>3264, -37707=>3265, -26978=>3266, -39348=>3267, -32260=>3268, -30071=>3269, -21335=>3270, -26976=>3271, -36575=>3272, -38627=>3273, -27741=>3274, -12038=>3275, -20108=>3275, -23612=>3276, -24336=>3277, -36841=>3278, -21250=>3279, -36049=>3280, -12161=>3281, -32905=>3281, -34425=>3282, -24319=>3283, -12103=>3284, -26085=>3284, -20083=>3285, -12042=>3286, -20837=>3286, -22914=>3287, -23615=>3288, -38894=>3289, -20219=>3290, -22922=>3291, -24525=>3292, -35469=>3293, -28641=>3294, -31152=>3295, -31074=>3296, -23527=>3297, -33905=>3298, -29483=>3299, -29105=>3300, -24180=>3301, -24565=>3302, -25467=>3303, -25754=>3304, -29123=>3305, -31896=>3306, -20035=>3307, -24316=>3308, -20043=>3309, -22492=>3310, -22178=>3311, -24745=>3312, -28611=>3313, -32013=>3314, -33021=>3315, -33075=>3316, -33215=>3317, -36786=>3318, -35223=>3319, -34468=>3320, -24052=>3321, -25226=>3322, -25773=>3323, -35207=>3324, -26487=>3325, -27874=>3326, -27966=>3327, -29750=>3328, -30772=>3329, -23110=>3330, -32629=>3331, -33453=>3332, -12218=>3333, -39340=>3333, -20467=>3334, -24259=>3335, -25309=>3336, -25490=>3337, -25943=>3338, -26479=>3339, -30403=>3340, -29260=>3341, -32972=>3342, -32954=>3343, -36649=>3344, -37197=>3345, -20493=>3346, -22521=>3347, -23186=>3348, -26757=>3349, -26995=>3350, -29028=>3351, -29437=>3352, -36023=>3353, -22770=>3354, -36064=>3355, -38506=>3356, -36889=>3357, -34687=>3358, -31204=>3359, -30695=>3360, -33833=>3361, -20271=>3362, -21093=>3363, -21338=>3364, -25293=>3365, -26575=>3366, -27850=>3367, -12137=>3368, -30333=>3368, -31636=>3369, -31893=>3370, -33334=>3371, -34180=>3372, -36843=>3373, -26333=>3374, -28448=>3375, -29190=>3376, -32283=>3377, -33707=>3378, -39361=>3379, -12008=>3380, -40614=>3380, -20989=>3381, -31665=>3382, -30834=>3383, -31672=>3384, -32903=>3385, -31560=>3386, -27368=>3387, -24161=>3388, -32908=>3389, -30033=>3390, -30048=>3391, -12043=>3392, -20843=>3392, -37474=>3393, -28300=>3394, -30330=>3395, -37271=>3396, -39658=>3397, -20240=>3398, -32624=>3399, -25244=>3400, -31567=>3401, -38309=>3402, -40169=>3403, -22138=>3404, -22617=>3405, -34532=>3406, -38588=>3407, -20276=>3408, -21028=>3409, -21322=>3410, -21453=>3411, -21467=>3412, -24070=>3413, -25644=>3414, -26001=>3415, -26495=>3416, -27710=>3417, -27726=>3418, -29256=>3419, -29359=>3420, -29677=>3421, -30036=>3422, -32321=>3423, -33324=>3424, -34281=>3425, -36009=>3426, -31684=>3427, -12196=>3428, -37318=>3428, -29033=>3429, -38930=>3430, -39151=>3431, -25405=>3432, -26217=>3433, -30058=>3434, -30436=>3435, -30928=>3436, -34115=>3437, -34542=>3438, -21290=>3439, -21329=>3440, -21542=>3441, -22915=>3442, -24199=>3443, -24444=>3444, -24754=>3445, -25161=>3446, -25209=>3447, -25259=>3448, -26000=>3449, -12112=>3450, -27604=>3450, -27852=>3451, -30130=>3452, -12138=>3453, -30382=>3453, -30865=>3454, -31192=>3455, -32203=>3456, -32631=>3457, -32933=>3458, -34987=>3459, -35513=>3460, -36027=>3461, -36991=>3462, -12206=>3463, -38750=>3463, -12214=>3464, -39131=>3464, -27147=>3465, -31800=>3466, -20633=>3467, -23614=>3468, -24494=>3469, -26503=>3470, -27608=>3471, -29749=>3472, -30473=>3473, -32654=>3474, -12240=>3475, -40763=>3475, -26570=>3476, -31255=>3477, -21305=>3478, -12134=>3479, -30091=>3479, -39661=>3480, -24422=>3481, -33181=>3482, -33777=>3483, -32920=>3484, -24380=>3485, -24517=>3486, -30050=>3487, -31558=>3488, -36924=>3489, -26727=>3490, -23019=>3491, -23195=>3492, -32016=>3493, -30334=>3494, -35628=>3495, -20469=>3496, -24426=>3497, -27161=>3498, -27703=>3499, -28418=>3500, -29922=>3501, -31080=>3502, -34920=>3503, -35413=>3504, -35961=>3505, -24287=>3506, -25551=>3507, -30149=>3508, -31186=>3509, -33495=>3510, -37672=>3511, -37618=>3512, -33948=>3513, -34541=>3514, -39981=>3515, -21697=>3516, -24428=>3517, -25996=>3518, -27996=>3519, -28693=>3520, -36007=>3521, -36051=>3522, -38971=>3523, -25935=>3524, -29942=>3525, -19981=>3526, -20184=>3527, -22496=>3528, -22827=>3529, -23142=>3530, -23500=>3531, -20904=>3532, -24067=>3533, -24220=>3534, -24598=>3535, -25206=>3536, -25975=>3537, -26023=>3538, -26222=>3539, -28014=>3540, -12119=>3541, -29238=>3541, -31526=>3542, -33104=>3543, -33178=>3544, -33433=>3545, -35676=>3546, -36000=>3547, -36070=>3548, -36212=>3549, -12201=>3550, -38428=>3550, -38468=>3551, -20398=>3552, -25771=>3553, -27494=>3554, -33310=>3555, -33889=>3556, -34154=>3557, -37096=>3558, -23553=>3559, -26963=>3560, -12213=>3561, -39080=>3561, -33914=>3562, -34135=>3563, -20239=>3564, -21103=>3565, -24489=>3566, -24133=>3567, -26381=>3568, -31119=>3569, -33145=>3570, -35079=>3571, -35206=>3572, -28149=>3573, -24343=>3574, -25173=>3575, -27832=>3576, -20175=>3577, -29289=>3578, -39826=>3579, -20998=>3580, -21563=>3581, -22132=>3582, -22707=>3583, -24996=>3584, -25198=>3585, -28954=>3586, -22894=>3587, -31881=>3588, -31966=>3589, -32027=>3590, -38640=>3591, -12098=>3592, -25991=>3592, -32862=>3593, -19993=>3594, -20341=>3595, -20853=>3596, -22592=>3597, -24163=>3598, -24179=>3599, -24330=>3600, -26564=>3601, -20006=>3602, -34109=>3603, -38281=>3604, -38491=>3605, -12150=>3606, -31859=>3606, -12212=>3607, -38913=>3607, -20731=>3608, -22721=>3609, -30294=>3610, -30887=>3611, -21029=>3612, -30629=>3613, -34065=>3614, -31622=>3615, -20559=>3616, -22793=>3617, -12122=>3618, -29255=>3618, -31687=>3619, -32232=>3620, -36794=>3621, -36820=>3622, -36941=>3623, -20415=>3624, -21193=>3625, -23081=>3626, -24321=>3627, -38829=>3628, -20445=>3629, -33303=>3630, -37610=>3631, -22275=>3632, -25429=>3633, -27497=>3634, -29995=>3635, -35036=>3636, -36628=>3637, -31298=>3638, -21215=>3639, -22675=>3640, -24917=>3641, -25098=>3642, -26286=>3643, -11935=>3644, -27597=>3644, -31807=>3645, -33769=>3646, -20515=>3647, -20472=>3648, -21253=>3649, -21574=>3650, -22577=>3651, -22857=>3652, -23453=>3653, -23792=>3654, -23791=>3655, -23849=>3656, -24214=>3657, -25265=>3658, -25447=>3659, -25918=>3660, -12101=>3661, -26041=>3661, -26379=>3662, -27861=>3663, -27873=>3664, -28921=>3665, -30770=>3666, -32299=>3667, -32990=>3668, -33459=>3669, -33804=>3670, -34028=>3671, -34562=>3672, -35090=>3673, -35370=>3674, -35914=>3675, -37030=>3676, -37586=>3677, -39165=>3678, -40179=>3679, -40300=>3680, -20047=>3681, -20129=>3682, -20621=>3683, -21078=>3684, -22346=>3685, -22952=>3686, -24125=>3687, -24536=>3688, -24537=>3689, -25151=>3690, -26292=>3691, -26395=>3692, -26576=>3693, -26834=>3694, -20882=>3695, -32033=>3696, -32938=>3697, -33192=>3698, -35584=>3699, -35980=>3700, -36031=>3701, -37502=>3702, -38450=>3703, -21536=>3704, -38956=>3705, -21271=>3706, -20693=>3707, -12056=>3708, -21340=>3708, -22696=>3709, -25778=>3710, -26420=>3711, -29287=>3712, -30566=>3713, -31302=>3714, -37350=>3715, -21187=>3716, -27809=>3717, -27526=>3718, -22528=>3719, -24140=>3720, -22868=>3721, -26412=>3722, -32763=>3723, -20961=>3724, -30406=>3725, -25705=>3726, -30952=>3727, -39764=>3728, -12231=>3729, -40635=>3729, -22475=>3730, -22969=>3731, -26151=>3732, -26522=>3733, -27598=>3734, -21737=>3735, -27097=>3736, -24149=>3737, -33180=>3738, -26517=>3739, -39850=>3740, -26622=>3741, -40018=>3742, -26717=>3743, -20134=>3744, -20451=>3745, -12060=>3746, -21448=>3746, -25273=>3747, -26411=>3748, -27819=>3749, -36804=>3750, -20397=>3751, -32365=>3752, -40639=>3753, -19975=>3754, -24930=>3755, -28288=>3756, -28459=>3757, -34067=>3758, -21619=>3759, -26410=>3760, -39749=>3761, -11922=>3762, -24051=>3762, -31637=>3763, -23724=>3764, -23494=>3765, -34588=>3766, -28234=>3767, -34001=>3768, -31252=>3769, -33032=>3770, -22937=>3771, -31885=>3772, -11936=>3773, -27665=>3773, -30496=>3774, -21209=>3775, -22818=>3776, -28961=>3777, -29279=>3778, -12141=>3779, -30683=>3779, -38695=>3780, -40289=>3781, -26891=>3782, -23167=>3783, -23064=>3784, -20901=>3785, -21517=>3786, -21629=>3787, -26126=>3788, -30431=>3789, -36855=>3790, -37528=>3791, -40180=>3792, -23018=>3793, -29277=>3794, -28357=>3795, -20813=>3796, -26825=>3797, -32191=>3798, -32236=>3799, -12207=>3800, -38754=>3800, -40634=>3801, -25720=>3802, -27169=>3803, -33538=>3804, -22916=>3805, -23391=>3806, -12113=>3807, -27611=>3807, -29467=>3808, -30450=>3809, -32178=>3810, -32791=>3811, -33945=>3812, -20786=>3813, -12106=>3814, -26408=>3814, -40665=>3815, -12140=>3816, -30446=>3816, -26466=>3817, -21247=>3818, -39173=>3819, -23588=>3820, -25147=>3821, -31870=>3822, -36016=>3823, -21839=>3824, -24758=>3825, -32011=>3826, -12200=>3827, -38272=>3827, -21249=>3828, -20063=>3829, -20918=>3830, -22812=>3831, -29242=>3832, -32822=>3833, -37326=>3834, -24357=>3835, -12142=>3836, -30690=>3836, -21380=>3837, -24441=>3838, -32004=>3839, -34220=>3840, -35379=>3841, -36493=>3842, -38742=>3843, -26611=>3844, -34222=>3845, -37971=>3846, -24841=>3847, -24840=>3848, -27833=>3849, -30290=>3850, -35565=>3851, -36664=>3852, -21807=>3853, -20305=>3854, -20778=>3855, -21191=>3856, -21451=>3857, -23461=>3858, -24189=>3859, -24736=>3860, -24962=>3861, -25558=>3862, -26377=>3863, -26586=>3864, -28263=>3865, -28044=>3866, -29494=>3867, -29495=>3868, -30001=>3869, -31056=>3870, -35029=>3871, -35480=>3872, -36938=>3873, -12194=>3874, -37009=>3874, -37109=>3875, -38596=>3876, -34701=>3877, -12067=>3878, -22805=>3878, -20104=>3879, -20313=>3880, -19982=>3881, -35465=>3882, -36671=>3883, -38928=>3884, -20653=>3885, -24188=>3886, -22934=>3887, -23481=>3888, -24248=>3889, -25562=>3890, -25594=>3891, -25793=>3892, -26332=>3893, -26954=>3894, -27096=>3895, -27915=>3896, -28342=>3897, -29076=>3898, -12132=>3899, -29992=>3899, -31407=>3900, -12154=>3901, -32650=>3901, -32768=>3902, -33865=>3903, -33993=>3904, -35201=>3905, -35617=>3906, -36362=>3907, -36965=>3908, -38525=>3909, -39178=>3910, -24958=>3911, -25233=>3912, -27442=>3913, -27779=>3914, -28020=>3915, -32716=>3916, -32764=>3917, -28096=>3918, -32645=>3919, -34746=>3920, -35064=>3921, -26469=>3922, -33713=>3923, -38972=>3924, -38647=>3925, -27931=>3926, -32097=>3927, -33853=>3928, -37226=>3929, -20081=>3930, -21365=>3931, -23888=>3932, -27396=>3933, -28651=>3934, -34253=>3935, -34349=>3936, -35239=>3937, -21033=>3938, -21519=>3939, -23653=>3940, -26446=>3941, -26792=>3942, -29702=>3943, -29827=>3944, -30178=>3945, -35023=>3946, -35041=>3947, -12197=>3948, -37324=>3948, -38626=>3949, -38520=>3950, -24459=>3951, -29575=>3952, -12148=>3953, -31435=>3953, -33870=>3954, -25504=>3955, -30053=>3956, -21129=>3957, -27969=>3958, -28316=>3959, -29705=>3960, -30041=>3961, -30827=>3962, -31890=>3963, -38534=>3964, -12015=>3965, -31452=>3965, -12243=>3966, -40845=>3966, -20406=>3967, -24942=>3968, -26053=>3969, -34396=>3970, -20102=>3971, -20142=>3972, -20698=>3973, -20001=>3974, -20940=>3975, -23534=>3976, -26009=>3977, -26753=>3978, -28092=>3979, -29471=>3980, -30274=>3981, -30637=>3982, -31260=>3983, -31975=>3984, -33391=>3985, -35538=>3986, -36988=>3987, -37327=>3988, -38517=>3989, -38936=>3990, -12050=>3991, -21147=>3991, -32209=>3992, -20523=>3993, -21400=>3994, -26519=>3995, -28107=>3996, -29136=>3997, -29747=>3998, -33256=>3999, -36650=>4000, -38563=>4001, -40023=>4002, -40607=>4003, -29792=>4004, -22593=>4005, -28057=>4006, -32047=>4007, -39006=>4008, -20196=>4009, -20278=>4010, -20363=>4011, -20919=>4012, -21169=>4013, -23994=>4014, -24604=>4015, -29618=>4016, -31036=>4017, -33491=>4018, -37428=>4019, -38583=>4020, -38646=>4021, -38666=>4022, -40599=>4023, -40802=>4024, -26278=>4025, -27508=>4026, -21015=>4027, -21155=>4028, -28872=>4029, -35010=>4030, -24265=>4031, -24651=>4032, -24976=>4033, -28451=>4034, -29001=>4035, -31806=>4036, -32244=>4037, -32879=>4038, -34030=>4039, -36899=>4040, -37676=>4041, -21570=>4042, -39791=>4043, -27347=>4044, -28809=>4045, -36034=>4046, -36335=>4047, -38706=>4048, -21172=>4049, -23105=>4050, -24266=>4051, -24324=>4052, -26391=>4053, -27004=>4054, -27028=>4055, -28010=>4056, -28431=>4057, -29282=>4058, -29436=>4059, -31725=>4060, -12156=>4061, -32769=>4061, -32894=>4062, -34635=>4063, -37070=>4064, -20845=>4065, -40595=>4066, -31108=>4067, -32907=>4068, -37682=>4069, -35542=>4070, -20525=>4071, -21644=>4072, -35441=>4073, -27498=>4074, -36036=>4075, -33031=>4076, -24785=>4077, -26528=>4078, -40434=>4079, -20121=>4080, -20120=>4081, -39952=>4082, -35435=>4083, -34241=>4084, -34152=>4085, -26880=>4086, -28286=>4087, -30871=>4088, -33109=>4089, -24332=>4090, -19984=>4091, -19989=>4092, -20010=>4093, -20017=>4094, -12034=>4095, -20022=>4095, -20028=>4096, -12035=>4097, -20031=>4097, -20034=>4098, -20054=>4099, -20056=>4100, -20098=>4101, -12037=>4102, -20101=>4102, -35947=>4103, -20106=>4104, -33298=>4105, -24333=>4106, -20110=>4107, -20126=>4108, -20127=>4109, -12039=>4110, -20128=>4110, -20130=>4111, -20144=>4112, -20147=>4113, -20150=>4114, -20174=>4115, -20173=>4116, -20164=>4117, -20166=>4118, -20162=>4119, -20183=>4120, -20190=>4121, -20205=>4122, -20191=>4123, -20215=>4124, -20233=>4125, -20314=>4126, -20272=>4127, -20315=>4128, -20317=>4129, -20311=>4130, -20295=>4131, -20342=>4132, -20360=>4133, -20367=>4134, -20376=>4135, -20347=>4136, -20329=>4137, -20336=>4138, -20369=>4139, -20335=>4140, -20358=>4141, -20374=>4142, -20760=>4143, -20436=>4144, -20447=>4145, -20430=>4146, -20440=>4147, -20443=>4148, -20433=>4149, -20442=>4150, -20432=>4151, -20452=>4152, -20453=>4153, -20506=>4154, -20520=>4155, -20500=>4156, -20522=>4157, -20517=>4158, -20485=>4159, -20252=>4160, -20470=>4161, -20513=>4162, -20521=>4163, -20524=>4164, -20478=>4165, -20463=>4166, -20497=>4167, -20486=>4168, -20547=>4169, -20551=>4170, -26371=>4171, -20565=>4172, -20560=>4173, -20552=>4174, -20570=>4175, -20566=>4176, -20588=>4177, -20600=>4178, -20608=>4179, -20634=>4180, -20613=>4181, -20660=>4182, -20658=>4183, -20681=>4184, -20682=>4185, -20659=>4186, -20674=>4187, -20694=>4188, -20702=>4189, -20709=>4190, -20717=>4191, -20707=>4192, -20718=>4193, -20729=>4194, -20725=>4195, -20745=>4196, -20737=>4197, -20738=>4198, -20758=>4199, -20757=>4200, -20756=>4201, -20762=>4202, -20769=>4203, -20794=>4204, -20791=>4205, -20796=>4206, -20795=>4207, -12041=>4208, -20799=>4208, -11918=>4209, -20800=>4209, -20818=>4210, -20812=>4211, -20820=>4212, -20834=>4213, -31480=>4214, -20841=>4215, -20842=>4216, -20846=>4217, -20864=>4218, -12044=>4219, -20866=>4219, -22232=>4220, -20876=>4221, -20873=>4222, -20879=>4223, -20881=>4224, -20883=>4225, -20885=>4226, -12045=>4227, -20886=>4227, -20900=>4228, -20902=>4229, -20898=>4230, -20905=>4231, -20906=>4232, -12046=>4233, -20907=>4233, -20915=>4234, -20913=>4235, -20914=>4236, -20912=>4237, -20917=>4238, -20925=>4239, -20933=>4240, -20937=>4241, -20955=>4242, -12047=>4243, -20960=>4243, -34389=>4244, -20969=>4245, -20973=>4246, -20976=>4247, -12048=>4248, -20981=>4248, -20990=>4249, -20996=>4250, -21003=>4251, -21012=>4252, -21006=>4253, -21031=>4254, -21034=>4255, -21038=>4256, -21043=>4257, -21049=>4258, -21071=>4259, -21060=>4260, -21067=>4261, -21068=>4262, -21086=>4263, -21076=>4264, -21098=>4265, -21108=>4266, -21097=>4267, -21107=>4268, -21119=>4269, -21117=>4270, -21133=>4271, -21140=>4272, -21138=>4273, -21105=>4274, -21128=>4275, -21137=>4276, -36776=>4277, -36775=>4278, -21164=>4279, -21165=>4280, -21180=>4281, -21173=>4282, -21185=>4283, -21197=>4284, -21207=>4285, -21214=>4286, -21219=>4287, -21222=>4288, -39149=>4289, -21216=>4290, -21235=>4291, -21237=>4292, -21240=>4293, -12051=>4294, -21241=>4294, -21254=>4295, -21256=>4296, -30008=>4297, -21261=>4298, -21264=>4299, -21263=>4300, -21269=>4301, -12052=>4301, -21274=>4302, -12053=>4302, -21283=>4303, -21295=>4304, -21297=>4305, -21299=>4306, -12054=>4307, -21304=>4307, -21312=>4308, -21318=>4309, -21317=>4310, -19991=>4311, -21321=>4312, -21325=>4313, -20950=>4314, -21342=>4315, -12057=>4316, -21353=>4316, -21358=>4317, -22808=>4318, -21371=>4319, -21367=>4320, -12058=>4321, -21378=>4321, -21398=>4322, -21408=>4323, -21414=>4324, -21413=>4325, -21422=>4326, -21424=>4327, -12059=>4328, -21430=>4328, -21443=>4329, -31762=>4330, -38617=>4331, -21471=>4332, -26364=>4333, -29166=>4334, -21486=>4335, -21480=>4336, -21485=>4337, -21498=>4338, -21505=>4339, -21565=>4340, -21568=>4341, -21548=>4342, -21549=>4343, -21564=>4344, -21550=>4345, -21558=>4346, -21545=>4347, -21533=>4348, -21582=>4349, -21647=>4350, -21621=>4351, -21646=>4352, -21599=>4353, -21617=>4354, -21623=>4355, -21616=>4356, -21650=>4357, -21627=>4358, -21632=>4359, -21622=>4360, -21636=>4361, -21648=>4362, -21638=>4363, -21703=>4364, -21666=>4365, -21688=>4366, -21669=>4367, -21676=>4368, -21700=>4369, -21704=>4370, -21672=>4371, -21675=>4372, -21698=>4373, -21668=>4374, -21694=>4375, -21692=>4376, -21720=>4377, -21733=>4378, -21734=>4379, -21775=>4380, -21780=>4381, -21757=>4382, -21742=>4383, -21741=>4384, -21754=>4385, -21730=>4386, -21817=>4387, -21824=>4388, -21859=>4389, -21836=>4390, -21806=>4391, -21852=>4392, -21829=>4393, -21846=>4394, -21847=>4395, -21816=>4396, -21811=>4397, -21853=>4398, -21913=>4399, -21888=>4400, -21679=>4401, -21898=>4402, -21919=>4403, -21883=>4404, -21886=>4405, -21912=>4406, -21918=>4407, -21934=>4408, -21884=>4409, -21891=>4410, -21929=>4411, -21895=>4412, -21928=>4413, -21978=>4414, -21957=>4415, -21983=>4416, -21956=>4417, -21980=>4418, -21988=>4419, -21972=>4420, -22036=>4421, -22007=>4422, -22038=>4423, -22014=>4424, -22013=>4425, -22043=>4426, -22009=>4427, -22094=>4428, -22096=>4429, -29151=>4430, -22068=>4431, -22070=>4432, -22066=>4433, -22072=>4434, -22123=>4435, -22116=>4436, -22063=>4437, -22124=>4438, -22122=>4439, -22150=>4440, -22144=>4441, -22154=>4442, -22176=>4443, -22164=>4444, -22159=>4445, -22181=>4446, -22190=>4447, -22198=>4448, -22196=>4449, -22210=>4450, -22204=>4451, -22209=>4452, -22211=>4453, -22208=>4454, -22216=>4455, -22222=>4456, -22225=>4457, -22227=>4458, -12062=>4459, -22231=>4459, -22254=>4460, -22265=>4461, -22272=>4462, -22271=>4463, -22276=>4464, -22281=>4465, -22280=>4466, -22283=>4467, -22285=>4468, -22291=>4469, -22296=>4470, -22294=>4471, -21959=>4472, -22300=>4473, -22310=>4474, -22327=>4475, -22328=>4476, -22350=>4477, -22331=>4478, -22336=>4479, -22351=>4480, -22377=>4481, -22464=>4482, -22408=>4483, -22369=>4484, -22399=>4485, -22409=>4486, -22419=>4487, -22432=>4488, -22451=>4489, -22436=>4490, -22442=>4491, -22448=>4492, -22467=>4493, -22470=>4494, -22484=>4495, -22482=>4496, -22483=>4497, -22538=>4498, -22486=>4499, -22499=>4500, -22539=>4501, -22553=>4502, -22557=>4503, -22642=>4504, -22561=>4505, -22626=>4506, -22603=>4507, -22640=>4508, -27584=>4509, -22610=>4510, -22589=>4511, -22649=>4512, -22661=>4513, -22713=>4514, -22687=>4515, -22699=>4516, -22714=>4517, -22750=>4518, -22715=>4519, -22712=>4520, -22702=>4521, -22725=>4522, -22739=>4523, -22737=>4524, -22743=>4525, -22745=>4526, -22744=>4527, -22757=>4528, -22748=>4529, -22756=>4530, -22751=>4531, -22767=>4532, -22778=>4533, -22777=>4534, -22779=>4535, -22780=>4536, -22781=>4537, -22786=>4538, -12065=>4538, -22794=>4539, -12066=>4539, -22800=>4540, -22811=>4541, -26790=>4542, -22821=>4543, -22828=>4544, -22829=>4545, -22834=>4546, -22840=>4547, -22846=>4548, -31442=>4549, -22869=>4550, -22864=>4551, -22862=>4552, -22874=>4553, -22872=>4554, -22882=>4555, -22880=>4556, -22887=>4557, -22892=>4558, -22889=>4559, -22904=>4560, -22913=>4561, -22941=>4562, -20318=>4563, -20395=>4564, -22947=>4565, -22962=>4566, -22982=>4567, -23016=>4568, -23004=>4569, -22925=>4570, -23001=>4571, -23002=>4572, -23077=>4573, -23071=>4574, -23057=>4575, -23068=>4576, -23049=>4577, -23066=>4578, -23104=>4579, -23148=>4580, -23113=>4581, -23093=>4582, -23094=>4583, -23138=>4584, -23146=>4585, -23194=>4586, -23228=>4587, -23230=>4588, -23243=>4589, -23234=>4590, -23229=>4591, -23267=>4592, -23255=>4593, -23270=>4594, -23273=>4595, -23254=>4596, -23290=>4597, -23291=>4598, -23308=>4599, -23307=>4600, -23318=>4601, -23346=>4602, -23248=>4603, -23338=>4604, -23350=>4605, -23358=>4606, -23363=>4607, -23365=>4608, -23360=>4609, -23377=>4610, -23381=>4611, -23386=>4612, -23387=>4613, -23397=>4614, -23401=>4615, -23408=>4616, -23411=>4617, -23413=>4618, -23416=>4619, -25992=>4620, -23418=>4621, -12071=>4622, -23424=>4622, -23427=>4623, -23462=>4624, -23480=>4625, -23491=>4626, -23495=>4627, -23497=>4628, -23508=>4629, -23504=>4630, -23524=>4631, -23526=>4632, -23522=>4633, -23518=>4634, -23525=>4635, -23531=>4636, -23536=>4637, -23542=>4638, -23539=>4639, -23557=>4640, -23559=>4641, -23560=>4642, -23565=>4643, -23571=>4644, -23584=>4645, -11920=>4646, -12074=>4646, -23586=>4646, -23592=>4647, -12075=>4648, -23608=>4648, -23609=>4649, -23617=>4650, -23622=>4651, -23630=>4652, -23635=>4653, -23632=>4654, -23631=>4655, -23409=>4656, -23660=>4657, -12076=>4658, -23662=>4658, -20066=>4659, -23670=>4660, -23673=>4661, -23692=>4662, -23697=>4663, -23700=>4664, -22939=>4665, -23723=>4666, -23739=>4667, -23734=>4668, -23740=>4669, -23735=>4670, -23749=>4671, -23742=>4672, -23751=>4673, -23769=>4674, -23785=>4675, -23805=>4676, -23802=>4677, -23789=>4678, -23948=>4679, -23786=>4680, -23819=>4681, -23829=>4682, -23831=>4683, -23900=>4684, -23839=>4685, -23835=>4686, -23825=>4687, -23828=>4688, -23842=>4689, -23834=>4690, -23833=>4691, -23832=>4692, -23884=>4693, -23890=>4694, -23886=>4695, -23883=>4696, -23916=>4697, -23923=>4698, -23926=>4699, -23943=>4700, -23940=>4701, -23938=>4702, -23970=>4703, -23965=>4704, -23980=>4705, -23982=>4706, -23997=>4707, -23952=>4708, -23991=>4709, -23996=>4710, -24009=>4711, -24013=>4712, -24019=>4713, -24018=>4714, -24022=>4715, -12078=>4716, -24027=>4716, -24043=>4717, -24050=>4718, -24053=>4719, -24075=>4720, -24090=>4721, -24089=>4722, -24081=>4723, -24091=>4724, -24118=>4725, -24119=>4726, -24132=>4727, -24131=>4728, -24128=>4729, -24142=>4730, -24151=>4731, -24148=>4732, -24159=>4733, -24162=>4734, -24164=>4735, -24135=>4736, -24181=>4737, -24182=>4738, -11923=>4739, -12083=>4739, -24186=>4739, -40636=>4740, -12084=>4741, -24191=>4741, -24224=>4742, -24257=>4743, -24258=>4744, -24264=>4745, -24272=>4746, -24271=>4747, -24278=>4748, -24291=>4749, -24285=>4750, -24282=>4751, -24283=>4752, -24290=>4753, -24289=>4754, -24296=>4755, -24297=>4756, -24300=>4757, -24305=>4758, -24307=>4759, -24304=>4760, -12085=>4761, -24308=>4761, -24312=>4762, -12086=>4763, -24318=>4763, -24323=>4764, -24329=>4765, -24413=>4766, -24412=>4767, -12087=>4768, -24331=>4768, -24337=>4769, -24342=>4770, -24361=>4771, -24365=>4772, -24376=>4773, -24385=>4774, -24392=>4775, -24396=>4776, -24398=>4777, -24367=>4778, -11924=>4779, -24401=>4779, -24406=>4780, -24407=>4781, -24409=>4782, -12090=>4783, -24417=>4783, -24429=>4784, -12091=>4785, -24435=>4785, -24439=>4786, -24451=>4787, -24450=>4788, -24447=>4789, -24458=>4790, -24456=>4791, -24465=>4792, -24455=>4793, -24478=>4794, -24473=>4795, -24472=>4796, -24480=>4797, -24488=>4798, -24493=>4799, -24508=>4800, -24534=>4801, -24571=>4802, -24548=>4803, -24568=>4804, -24561=>4805, -24541=>4806, -24755=>4807, -24575=>4808, -24609=>4809, -24672=>4810, -24601=>4811, -24592=>4812, -24617=>4813, -24590=>4814, -24625=>4815, -24603=>4816, -24597=>4817, -24619=>4818, -24614=>4819, -24591=>4820, -24634=>4821, -24666=>4822, -24641=>4823, -24682=>4824, -24695=>4825, -24671=>4826, -24650=>4827, -24646=>4828, -24653=>4829, -24675=>4830, -24643=>4831, -24676=>4832, -24642=>4833, -24684=>4834, -24683=>4835, -24665=>4836, -24705=>4837, -24717=>4838, -24807=>4839, -24707=>4840, -24730=>4841, -24708=>4842, -24731=>4843, -24726=>4844, -24727=>4845, -24722=>4846, -24743=>4847, -24715=>4848, -24801=>4849, -24760=>4850, -24800=>4851, -24787=>4852, -24756=>4853, -24560=>4854, -24765=>4855, -24774=>4856, -24757=>4857, -24792=>4858, -24909=>4859, -24853=>4860, -24838=>4861, -24822=>4862, -24823=>4863, -24832=>4864, -24820=>4865, -24826=>4866, -24835=>4867, -24865=>4868, -24827=>4869, -24817=>4870, -24845=>4871, -24846=>4872, -24903=>4873, -24894=>4874, -24872=>4875, -24871=>4876, -24906=>4877, -24895=>4878, -24892=>4879, -24876=>4880, -24884=>4881, -24893=>4882, -24898=>4883, -24900=>4884, -24947=>4885, -24951=>4886, -24920=>4887, -24921=>4888, -24922=>4889, -24939=>4890, -24948=>4891, -24943=>4892, -24933=>4893, -24945=>4894, -24927=>4895, -24925=>4896, -24915=>4897, -24949=>4898, -24985=>4899, -24982=>4900, -24967=>4901, -25004=>4902, -24980=>4903, -24986=>4904, -24970=>4905, -24977=>4906, -25003=>4907, -25006=>4908, -25036=>4909, -25034=>4910, -25033=>4911, -25079=>4912, -25032=>4913, -25027=>4914, -25030=>4915, -25018=>4916, -25035=>4917, -32633=>4918, -25037=>4919, -25062=>4920, -25059=>4921, -25078=>4922, -25082=>4923, -25076=>4924, -25087=>4925, -25085=>4926, -25084=>4927, -25086=>4928, -25088=>4929, -12093=>4930, -25096=>4930, -25097=>4931, -25101=>4932, -25100=>4933, -25108=>4934, -25115=>4935, -25118=>4936, -25121=>4937, -25130=>4938, -25134=>4939, -25136=>4940, -25138=>4941, -25139=>4942, -25153=>4943, -25166=>4944, -25182=>4945, -25187=>4946, -25179=>4947, -25184=>4948, -25192=>4949, -25212=>4950, -25218=>4951, -25225=>4952, -25214=>4953, -25234=>4954, -25235=>4955, -25238=>4956, -25300=>4957, -25219=>4958, -25236=>4959, -25303=>4960, -25297=>4961, -25275=>4962, -25295=>4963, -25343=>4964, -25286=>4965, -25812=>4966, -25288=>4967, -25308=>4968, -25292=>4969, -25290=>4970, -25282=>4971, -25287=>4972, -25243=>4973, -25289=>4974, -25356=>4975, -25326=>4976, -25329=>4977, -25383=>4978, -25346=>4979, -25352=>4980, -25327=>4981, -25333=>4982, -25424=>4983, -25406=>4984, -25421=>4985, -25628=>4986, -25423=>4987, -25494=>4988, -25486=>4989, -25472=>4990, -25515=>4991, -25462=>4992, -25507=>4993, -25487=>4994, -25481=>4995, -25503=>4996, -25525=>4997, -25451=>4998, -25449=>4999, -25534=>5000, -25577=>5001, -25536=>5002, -25542=>5003, -25571=>5004, -25545=>5005, -25554=>5006, -25590=>5007, -25540=>5008, -25622=>5009, -25652=>5010, -25606=>5011, -25619=>5012, -25638=>5013, -25654=>5014, -25885=>5015, -25623=>5016, -25640=>5017, -25615=>5018, -25703=>5019, -25711=>5020, -25718=>5021, -25678=>5022, -25898=>5023, -25749=>5024, -25747=>5025, -25765=>5026, -25769=>5027, -25736=>5028, -25788=>5029, -25818=>5030, -25810=>5031, -25797=>5032, -25799=>5033, -25787=>5034, -25816=>5035, -25794=>5036, -25841=>5037, -25831=>5038, -33289=>5039, -25824=>5040, -25825=>5041, -25260=>5042, -25827=>5043, -25839=>5044, -25900=>5045, -25846=>5046, -25844=>5047, -25842=>5048, -25850=>5049, -25856=>5050, -25853=>5051, -25880=>5052, -25884=>5053, -25861=>5054, -25892=>5055, -25891=>5056, -25899=>5057, -12097=>5058, -25908=>5058, -11929=>5059, -25909=>5059, -25911=>5060, -25910=>5061, -25912=>5062, -30027=>5063, -25928=>5064, -25942=>5065, -25941=>5066, -25933=>5067, -25944=>5068, -25950=>5069, -25949=>5070, -25970=>5071, -25976=>5072, -25986=>5073, -25987=>5074, -35722=>5075, -26011=>5076, -26015=>5077, -26027=>5078, -26039=>5079, -26051=>5080, -26054=>5081, -26049=>5082, -26052=>5083, -26060=>5084, -26066=>5085, -26075=>5086, -26073=>5087, -12102=>5088, -26080=>5088, -11931=>5089, -26081=>5089, -26097=>5090, -26482=>5091, -26122=>5092, -26115=>5093, -26107=>5094, -26483=>5095, -26165=>5096, -26166=>5097, -26164=>5098, -26140=>5099, -26191=>5100, -26180=>5101, -26185=>5102, -26177=>5103, -26206=>5104, -26205=>5105, -26212=>5106, -26215=>5107, -26216=>5108, -26207=>5109, -26210=>5110, -26224=>5111, -26243=>5112, -26248=>5113, -26254=>5114, -26249=>5115, -26244=>5116, -26264=>5117, -26269=>5118, -26305=>5119, -26297=>5120, -26313=>5121, -26302=>5122, -26300=>5123, -26308=>5124, -26296=>5125, -26326=>5126, -26330=>5127, -26336=>5128, -26175=>5129, -26342=>5130, -26345=>5131, -12104=>5132, -26352=>5132, -26357=>5133, -26359=>5134, -26383=>5135, -26390=>5136, -26398=>5137, -26406=>5138, -26407=>5139, -38712=>5140, -26414=>5141, -26431=>5142, -26422=>5143, -26433=>5144, -26424=>5145, -26423=>5146, -26438=>5147, -26462=>5148, -26464=>5149, -26457=>5150, -26467=>5151, -26468=>5152, -26505=>5153, -26480=>5154, -26537=>5155, -26492=>5156, -26474=>5157, -26508=>5158, -26507=>5159, -26534=>5160, -26529=>5161, -26501=>5162, -26551=>5163, -26607=>5164, -26548=>5165, -26604=>5166, -26547=>5167, -26601=>5168, -26552=>5169, -26596=>5170, -26590=>5171, -26589=>5172, -26594=>5173, -26606=>5174, -26553=>5175, -26574=>5176, -26566=>5177, -26599=>5178, -27292=>5179, -26654=>5180, -26694=>5181, -26665=>5182, -26688=>5183, -26701=>5184, -26674=>5185, -26702=>5186, -26803=>5187, -26667=>5188, -26713=>5189, -26723=>5190, -26743=>5191, -26751=>5192, -26783=>5193, -26767=>5194, -26797=>5195, -26772=>5196, -26781=>5197, -26779=>5198, -26755=>5199, -27310=>5200, -26809=>5201, -26740=>5202, -26805=>5203, -26784=>5204, -26810=>5205, -26895=>5206, -26765=>5207, -26750=>5208, -26881=>5209, -26826=>5210, -26888=>5211, -26840=>5212, -26914=>5213, -26918=>5214, -26849=>5215, -26892=>5216, -26829=>5217, -26836=>5218, -26855=>5219, -26837=>5220, -26934=>5221, -26898=>5222, -26884=>5223, -26839=>5224, -26851=>5225, -26917=>5226, -26873=>5227, -26848=>5228, -26863=>5229, -26920=>5230, -26922=>5231, -26906=>5232, -26915=>5233, -26913=>5234, -26822=>5235, -27001=>5236, -26999=>5237, -26972=>5238, -27000=>5239, -26987=>5240, -26964=>5241, -27006=>5242, -26990=>5243, -26937=>5244, -26996=>5245, -26941=>5246, -26969=>5247, -26928=>5248, -26977=>5249, -26974=>5250, -26973=>5251, -27009=>5252, -26986=>5253, -27058=>5254, -27054=>5255, -27088=>5256, -27071=>5257, -27073=>5258, -27091=>5259, -27070=>5260, -27086=>5261, -23528=>5262, -27082=>5263, -27101=>5264, -27067=>5265, -27075=>5266, -27047=>5267, -27182=>5268, -27025=>5269, -27040=>5270, -27036=>5271, -27029=>5272, -27060=>5273, -27102=>5274, -27112=>5275, -27138=>5276, -27163=>5277, -27135=>5278, -27402=>5279, -27129=>5280, -27122=>5281, -27111=>5282, -27141=>5283, -27057=>5284, -27166=>5285, -27117=>5286, -27156=>5287, -27115=>5288, -27146=>5289, -27154=>5290, -27329=>5291, -27171=>5292, -27155=>5293, -27204=>5294, -27148=>5295, -27250=>5296, -27190=>5297, -27256=>5298, -27207=>5299, -27234=>5300, -27225=>5301, -27238=>5302, -27208=>5303, -27192=>5304, -27170=>5305, -27280=>5306, -27277=>5307, -27296=>5308, -27268=>5309, -27298=>5310, -27299=>5311, -27287=>5312, -34327=>5313, -27323=>5314, -27331=>5315, -27330=>5316, -27320=>5317, -27315=>5318, -27308=>5319, -27358=>5320, -27345=>5321, -27359=>5322, -27306=>5323, -27354=>5324, -27370=>5325, -27387=>5326, -27397=>5327, -34326=>5328, -27386=>5329, -27410=>5330, -27414=>5331, -39729=>5332, -27423=>5333, -27448=>5334, -27447=>5335, -30428=>5336, -27449=>5337, -39150=>5338, -27463=>5339, -27459=>5340, -27465=>5341, -27472=>5342, -27481=>5343, -27476=>5344, -27483=>5345, -27487=>5346, -27489=>5347, -27512=>5348, -12109=>5349, -27513=>5349, -27519=>5350, -27520=>5351, -27524=>5352, -27523=>5353, -27533=>5354, -27544=>5355, -27541=>5356, -27550=>5357, -27556=>5358, -27562=>5359, -27563=>5360, -27567=>5361, -27570=>5362, -27569=>5363, -12110=>5364, -27571=>5364, -27575=>5365, -27580=>5366, -27590=>5367, -12111=>5368, -27595=>5368, -27603=>5369, -27615=>5370, -27628=>5371, -27627=>5372, -27635=>5373, -27631=>5374, -40638=>5375, -27656=>5376, -27667=>5377, -12115=>5378, -27668=>5378, -27675=>5379, -27684=>5380, -27683=>5381, -27742=>5382, -27733=>5383, -27746=>5384, -27754=>5385, -27778=>5386, -27789=>5387, -27802=>5388, -27777=>5389, -27803=>5390, -27774=>5391, -27752=>5392, -27763=>5393, -27794=>5394, -27792=>5395, -27844=>5396, -27889=>5397, -27859=>5398, -27837=>5399, -27863=>5400, -27845=>5401, -27869=>5402, -27822=>5403, -27825=>5404, -27838=>5405, -27834=>5406, -27867=>5407, -27887=>5408, -27865=>5409, -27882=>5410, -27935=>5411, -34893=>5412, -27958=>5413, -27947=>5414, -27965=>5415, -27960=>5416, -27929=>5417, -27957=>5418, -27955=>5419, -27922=>5420, -27916=>5421, -28003=>5422, -28051=>5423, -28004=>5424, -27994=>5425, -28025=>5426, -27993=>5427, -28046=>5428, -28053=>5429, -28644=>5430, -28037=>5431, -28153=>5432, -28181=>5433, -28170=>5434, -28085=>5435, -28103=>5436, -28134=>5437, -28088=>5438, -28102=>5439, -28140=>5440, -28126=>5441, -28108=>5442, -28136=>5443, -28114=>5444, -28101=>5445, -28154=>5446, -28121=>5447, -28132=>5448, -28117=>5449, -28138=>5450, -28142=>5451, -28205=>5452, -28270=>5453, -28206=>5454, -28185=>5455, -28274=>5456, -28255=>5457, -28222=>5458, -28195=>5459, -28267=>5460, -28203=>5461, -28278=>5462, -28237=>5463, -28191=>5464, -28227=>5465, -28218=>5466, -28238=>5467, -28196=>5468, -28415=>5469, -28189=>5470, -28216=>5471, -28290=>5472, -28330=>5473, -28312=>5474, -28361=>5475, -28343=>5476, -28371=>5477, -28349=>5478, -28335=>5479, -28356=>5480, -28338=>5481, -28372=>5482, -28373=>5483, -28303=>5484, -28325=>5485, -28354=>5486, -28319=>5487, -28481=>5488, -28433=>5489, -28748=>5490, -28396=>5491, -28408=>5492, -28414=>5493, -28479=>5494, -28402=>5495, -28465=>5496, -28399=>5497, -28466=>5498, -28364=>5499, -28478=>5500, -28435=>5501, -28407=>5502, -28550=>5503, -28538=>5504, -28536=>5505, -28545=>5506, -28544=>5507, -28527=>5508, -28507=>5509, -28659=>5510, -28525=>5511, -28546=>5512, -28540=>5513, -28504=>5514, -28558=>5515, -28561=>5516, -28610=>5517, -28518=>5518, -28595=>5519, -28579=>5520, -28577=>5521, -28580=>5522, -28601=>5523, -28614=>5524, -28586=>5525, -28639=>5526, -28629=>5527, -28652=>5528, -28628=>5529, -28632=>5530, -28657=>5531, -28654=>5532, -28635=>5533, -28681=>5534, -28683=>5535, -28666=>5536, -28689=>5537, -28673=>5538, -28687=>5539, -28670=>5540, -28699=>5541, -28698=>5542, -28532=>5543, -28701=>5544, -28696=>5545, -28703=>5546, -28720=>5547, -28734=>5548, -28722=>5549, -28753=>5550, -28771=>5551, -28825=>5552, -28818=>5553, -28847=>5554, -28913=>5555, -28844=>5556, -28856=>5557, -28851=>5558, -28846=>5559, -28895=>5560, -28875=>5561, -28893=>5562, -28889=>5563, -28937=>5564, -28925=>5565, -28956=>5566, -28953=>5567, -29029=>5568, -29013=>5569, -29064=>5570, -29030=>5571, -29026=>5572, -29004=>5573, -29014=>5574, -29036=>5575, -29071=>5576, -29179=>5577, -29060=>5578, -29077=>5579, -29096=>5580, -29100=>5581, -29143=>5582, -29113=>5583, -29118=>5584, -29138=>5585, -29129=>5586, -29140=>5587, -29134=>5588, -29152=>5589, -29164=>5590, -29159=>5591, -29173=>5592, -29180=>5593, -29177=>5594, -29183=>5595, -29197=>5596, -29200=>5597, -29211=>5598, -29224=>5599, -29229=>5600, -29228=>5601, -29232=>5602, -29234=>5603, -12120=>5604, -29243=>5604, -29244=>5605, -12121=>5606, -29247=>5606, -29248=>5607, -29254=>5608, -29259=>5609, -29272=>5610, -29300=>5611, -29310=>5612, -29314=>5613, -29313=>5614, -29319=>5615, -29330=>5616, -29334=>5617, -29346=>5618, -29351=>5619, -29369=>5620, -29362=>5621, -29379=>5622, -29382=>5623, -29380=>5624, -29390=>5625, -29394=>5626, -29410=>5627, -29408=>5628, -29409=>5629, -29433=>5630, -29431=>5631, -20495=>5632, -29463=>5633, -29450=>5634, -29468=>5635, -29462=>5636, -29469=>5637, -29492=>5638, -29487=>5639, -29481=>5640, -29477=>5641, -29502=>5642, -29518=>5643, -29519=>5644, -40664=>5645, -29527=>5646, -29546=>5647, -29544=>5648, -29552=>5649, -29560=>5650, -29557=>5651, -29563=>5652, -29562=>5653, -29640=>5654, -29619=>5655, -29646=>5656, -29627=>5657, -29632=>5658, -29669=>5659, -29678=>5660, -29662=>5661, -29858=>5662, -29701=>5663, -29807=>5664, -29733=>5665, -29688=>5666, -29746=>5667, -29754=>5668, -29781=>5669, -29759=>5670, -29791=>5671, -29785=>5672, -29761=>5673, -29788=>5674, -29801=>5675, -29808=>5676, -29795=>5677, -29802=>5678, -29814=>5679, -29822=>5680, -29835=>5681, -29854=>5682, -29863=>5683, -29898=>5684, -29903=>5685, -29908=>5686, -29681=>5687, -29920=>5688, -29923=>5689, -29927=>5690, -29929=>5691, -29934=>5692, -29938=>5693, -29936=>5694, -29937=>5695, -29944=>5696, -29943=>5697, -29956=>5698, -29955=>5699, -29957=>5700, -29964=>5701, -29966=>5702, -29965=>5703, -29973=>5704, -29971=>5705, -29982=>5706, -29990=>5707, -29996=>5708, -30012=>5709, -30020=>5710, -30029=>5711, -30026=>5712, -30025=>5713, -30043=>5714, -30022=>5715, -30042=>5716, -30057=>5717, -30052=>5718, -30055=>5719, -30059=>5720, -30061=>5721, -30072=>5722, -30070=>5723, -30086=>5724, -30087=>5725, -30068=>5726, -30090=>5727, -30089=>5728, -30082=>5729, -30100=>5730, -30106=>5731, -30109=>5732, -30117=>5733, -30115=>5734, -30146=>5735, -30131=>5736, -30147=>5737, -30133=>5738, -30141=>5739, -30136=>5740, -30140=>5741, -30129=>5742, -30157=>5743, -30154=>5744, -30162=>5745, -30169=>5746, -30179=>5747, -30174=>5748, -30206=>5749, -30207=>5750, -30204=>5751, -30209=>5752, -30192=>5753, -30202=>5754, -30194=>5755, -30195=>5756, -30219=>5757, -30221=>5758, -30217=>5759, -30239=>5760, -30247=>5761, -30240=>5762, -30241=>5763, -30242=>5764, -30244=>5765, -30260=>5766, -30256=>5767, -30267=>5768, -30279=>5769, -30280=>5770, -30278=>5771, -30300=>5772, -30296=>5773, -30305=>5774, -30306=>5775, -30312=>5776, -30313=>5777, -30314=>5778, -30311=>5779, -30316=>5780, -30320=>5781, -30322=>5782, -12136=>5783, -30326=>5783, -30328=>5784, -30332=>5785, -30336=>5786, -30339=>5787, -30344=>5788, -30347=>5789, -30350=>5790, -30358=>5791, -30355=>5792, -30361=>5793, -30362=>5794, -30384=>5795, -30388=>5796, -30392=>5797, -30393=>5798, -30394=>5799, -30402=>5800, -30413=>5801, -30422=>5802, -30418=>5803, -30430=>5804, -30433=>5805, -30437=>5806, -30439=>5807, -30442=>5808, -34351=>5809, -30459=>5810, -30472=>5811, -30471=>5812, -30468=>5813, -30505=>5814, -30500=>5815, -30494=>5816, -30501=>5817, -30502=>5818, -30491=>5819, -30519=>5820, -30520=>5821, -30535=>5822, -30554=>5823, -30568=>5824, -30571=>5825, -30555=>5826, -30565=>5827, -30591=>5828, -30590=>5829, -30585=>5830, -30606=>5831, -30603=>5832, -30609=>5833, -30624=>5834, -30622=>5835, -30640=>5836, -30646=>5837, -30649=>5838, -30655=>5839, -30652=>5840, -30653=>5841, -30651=>5842, -30663=>5843, -30669=>5844, -30679=>5845, -30682=>5846, -30684=>5847, -30691=>5848, -30702=>5849, -30716=>5850, -30732=>5851, -30738=>5852, -31014=>5853, -30752=>5854, -31018=>5855, -30789=>5856, -30862=>5857, -30836=>5858, -30854=>5859, -30844=>5860, -30874=>5861, -30860=>5862, -30883=>5863, -30901=>5864, -30890=>5865, -30895=>5866, -30929=>5867, -30918=>5868, -30923=>5869, -30932=>5870, -30910=>5871, -30908=>5872, -30917=>5873, -30922=>5874, -30956=>5875, -30951=>5876, -30938=>5877, -30973=>5878, -30964=>5879, -30983=>5880, -30994=>5881, -30993=>5882, -31001=>5883, -31020=>5884, -31019=>5885, -31040=>5886, -31072=>5887, -31063=>5888, -31071=>5889, -31066=>5890, -31061=>5891, -31059=>5892, -31098=>5893, -31103=>5894, -31114=>5895, -31133=>5896, -31143=>5897, -40779=>5898, -31146=>5899, -31150=>5900, -31155=>5901, -31161=>5902, -31162=>5903, -31177=>5904, -31189=>5905, -31207=>5906, -31212=>5907, -31201=>5908, -31203=>5909, -31240=>5910, -31245=>5911, -31256=>5912, -31257=>5913, -31264=>5914, -31263=>5915, -31104=>5916, -31281=>5917, -31291=>5918, -31294=>5919, -31287=>5920, -31299=>5921, -31319=>5922, -31305=>5923, -31329=>5924, -31330=>5925, -31337=>5926, -40861=>5927, -31344=>5928, -31353=>5929, -31357=>5930, -31368=>5931, -31383=>5932, -31381=>5933, -31384=>5934, -31382=>5935, -31401=>5936, -31432=>5937, -31408=>5938, -31414=>5939, -31429=>5940, -31428=>5941, -31423=>5942, -36995=>5943, -31431=>5944, -31434=>5945, -31437=>5946, -31439=>5947, -31445=>5948, -31443=>5949, -31449=>5950, -31450=>5951, -31453=>5952, -31457=>5953, -31458=>5954, -31462=>5955, -31469=>5956, -31472=>5957, -31490=>5958, -31503=>5959, -31498=>5960, -31494=>5961, -31539=>5962, -31512=>5963, -31513=>5964, -31518=>5965, -31541=>5966, -31528=>5967, -31542=>5968, -31568=>5969, -31610=>5970, -31492=>5971, -31565=>5972, -31499=>5973, -31564=>5974, -31557=>5975, -31605=>5976, -31589=>5977, -31604=>5978, -31591=>5979, -31600=>5980, -31601=>5981, -31596=>5982, -31598=>5983, -31645=>5984, -31640=>5985, -31647=>5986, -31629=>5987, -31644=>5988, -31642=>5989, -31627=>5990, -31634=>5991, -31631=>5992, -31581=>5993, -31641=>5994, -31691=>5995, -31681=>5996, -31692=>5997, -31695=>5998, -31668=>5999, -31686=>6000, -31709=>6001, -31721=>6002, -31761=>6003, -31764=>6004, -31718=>6005, -31717=>6006, -31840=>6007, -31744=>6008, -31751=>6009, -31763=>6010, -31731=>6011, -31735=>6012, -31767=>6013, -31757=>6014, -31734=>6015, -31779=>6016, -31783=>6017, -31786=>6018, -31775=>6019, -31799=>6020, -31787=>6021, -31805=>6022, -31820=>6023, -31811=>6024, -31828=>6025, -31823=>6026, -31808=>6027, -31824=>6028, -31832=>6029, -31839=>6030, -31844=>6031, -31830=>6032, -31845=>6033, -31852=>6034, -31861=>6035, -31875=>6036, -31888=>6037, -31908=>6038, -31917=>6039, -31906=>6040, -31915=>6041, -31905=>6042, -31912=>6043, -31923=>6044, -31922=>6045, -31921=>6046, -31918=>6047, -31929=>6048, -31933=>6049, -31936=>6050, -31941=>6051, -31938=>6052, -31960=>6053, -31954=>6054, -31964=>6055, -31970=>6056, -39739=>6057, -31983=>6058, -31986=>6059, -31988=>6060, -31990=>6061, -31994=>6062, -32006=>6063, -32002=>6064, -32028=>6065, -32021=>6066, -32010=>6067, -32069=>6068, -32075=>6069, -32046=>6070, -32050=>6071, -32063=>6072, -32053=>6073, -32070=>6074, -32115=>6075, -32086=>6076, -32078=>6077, -32114=>6078, -32104=>6079, -32110=>6080, -32079=>6081, -32099=>6082, -32147=>6083, -32137=>6084, -32091=>6085, -32143=>6086, -32125=>6087, -32155=>6088, -32186=>6089, -32174=>6090, -32163=>6091, -32181=>6092, -32199=>6093, -32189=>6094, -32171=>6095, -32317=>6096, -32162=>6097, -32175=>6098, -32220=>6099, -32184=>6100, -32159=>6101, -32176=>6102, -32216=>6103, -32221=>6104, -32228=>6105, -32222=>6106, -32251=>6107, -32242=>6108, -32225=>6109, -32261=>6110, -32266=>6111, -32291=>6112, -32289=>6113, -32274=>6114, -32305=>6115, -32287=>6116, -32265=>6117, -32267=>6118, -32290=>6119, -32326=>6120, -32358=>6121, -32315=>6122, -32309=>6123, -32313=>6124, -32323=>6125, -32311=>6126, -32306=>6127, -32314=>6128, -32359=>6129, -32349=>6130, -32342=>6131, -32350=>6132, -32345=>6133, -32346=>6134, -32377=>6135, -32362=>6136, -32361=>6137, -32380=>6138, -32379=>6139, -32387=>6140, -32213=>6141, -32381=>6142, -36782=>6143, -32383=>6144, -32392=>6145, -32393=>6146, -32396=>6147, -32402=>6148, -32400=>6149, -32403=>6150, -32404=>6151, -32406=>6152, -32398=>6153, -32411=>6154, -32412=>6155, -32568=>6156, -32570=>6157, -32581=>6158, -32588=>6159, -32589=>6160, -32590=>6161, -32592=>6162, -12153=>6163, -32593=>6163, -32597=>6164, -32596=>6165, -32600=>6166, -32607=>6167, -32608=>6168, -32616=>6169, -32617=>6170, -32615=>6171, -32632=>6172, -32642=>6173, -32646=>6174, -32643=>6175, -32648=>6176, -32647=>6177, -32652=>6178, -32660=>6179, -32670=>6180, -32669=>6181, -32666=>6182, -32675=>6183, -32687=>6184, -32690=>6185, -32697=>6186, -32686=>6187, -32694=>6188, -32696=>6189, -35697=>6190, -32709=>6191, -32710=>6192, -32714=>6193, -32725=>6194, -32724=>6195, -32737=>6196, -32742=>6197, -32745=>6198, -32755=>6199, -32761=>6200, -39132=>6201, -32774=>6202, -32772=>6203, -32779=>6204, -12158=>6205, -32786=>6205, -32792=>6206, -32793=>6207, -32796=>6208, -32801=>6209, -32808=>6210, -32831=>6211, -32827=>6212, -32842=>6213, -32838=>6214, -32850=>6215, -32856=>6216, -32858=>6217, -32863=>6218, -32866=>6219, -32872=>6220, -32883=>6221, -32882=>6222, -32880=>6223, -32886=>6224, -32889=>6225, -32893=>6226, -12160=>6227, -32895=>6227, -32900=>6228, -32902=>6229, -32901=>6230, -32923=>6231, -32915=>6232, -32922=>6233, -32941=>6234, -20880=>6235, -32940=>6236, -32987=>6237, -32997=>6238, -32985=>6239, -32989=>6240, -32964=>6241, -32986=>6242, -32982=>6243, -33033=>6244, -33007=>6245, -33009=>6246, -33051=>6247, -33065=>6248, -33059=>6249, -33071=>6250, -33099=>6251, -38539=>6252, -33094=>6253, -33086=>6254, -33107=>6255, -33105=>6256, -33020=>6257, -33137=>6258, -33134=>6259, -33125=>6260, -33126=>6261, -33140=>6262, -33155=>6263, -33160=>6264, -33162=>6265, -33152=>6266, -33154=>6267, -33184=>6268, -33173=>6269, -33188=>6270, -33187=>6271, -33119=>6272, -33171=>6273, -33193=>6274, -33200=>6275, -33205=>6276, -33214=>6277, -33208=>6278, -33213=>6279, -33216=>6280, -33218=>6281, -33210=>6282, -33225=>6283, -33229=>6284, -33233=>6285, -33241=>6286, -33240=>6287, -33224=>6288, -33242=>6289, -33247=>6290, -33248=>6291, -33255=>6292, -33274=>6293, -33275=>6294, -33278=>6295, -33281=>6296, -33282=>6297, -33285=>6298, -33287=>6299, -33290=>6300, -33293=>6301, -33296=>6302, -33302=>6303, -33321=>6304, -33323=>6305, -33336=>6306, -33331=>6307, -33344=>6308, -33369=>6309, -33368=>6310, -33373=>6311, -33370=>6312, -33375=>6313, -33380=>6314, -33378=>6315, -33384=>6316, -33386=>6317, -33387=>6318, -33326=>6319, -33393=>6320, -33399=>6321, -12171=>6322, -33400=>6322, -33406=>6323, -33421=>6324, -33426=>6325, -33451=>6326, -33439=>6327, -33467=>6328, -33452=>6329, -33505=>6330, -33507=>6331, -33503=>6332, -33490=>6333, -33524=>6334, -33523=>6335, -33530=>6336, -33683=>6337, -33539=>6338, -33531=>6339, -33529=>6340, -33502=>6341, -33542=>6342, -33500=>6343, -33545=>6344, -33497=>6345, -33589=>6346, -33588=>6347, -33558=>6348, -33586=>6349, -33585=>6350, -33600=>6351, -33593=>6352, -33616=>6353, -33605=>6354, -33583=>6355, -33579=>6356, -33559=>6357, -33560=>6358, -33669=>6359, -33690=>6360, -33706=>6361, -33695=>6362, -33698=>6363, -33686=>6364, -33571=>6365, -33678=>6366, -33671=>6367, -33674=>6368, -33660=>6369, -33717=>6370, -33651=>6371, -33653=>6372, -33696=>6373, -33673=>6374, -33704=>6375, -33780=>6376, -33811=>6377, -33771=>6378, -33742=>6379, -33789=>6380, -33795=>6381, -33752=>6382, -33803=>6383, -33729=>6384, -33783=>6385, -33799=>6386, -33760=>6387, -33778=>6388, -33805=>6389, -33826=>6390, -33824=>6391, -33725=>6392, -33848=>6393, -34054=>6394, -33787=>6395, -33901=>6396, -33834=>6397, -33852=>6398, -34138=>6399, -33924=>6400, -33911=>6401, -33899=>6402, -33965=>6403, -33902=>6404, -33922=>6405, -33897=>6406, -33862=>6407, -33836=>6408, -33903=>6409, -33913=>6410, -33845=>6411, -33994=>6412, -33890=>6413, -33977=>6414, -33983=>6415, -33951=>6416, -34009=>6417, -33997=>6418, -33979=>6419, -34010=>6420, -34000=>6421, -33985=>6422, -33990=>6423, -34006=>6424, -33953=>6425, -34081=>6426, -34047=>6427, -34036=>6428, -34071=>6429, -34072=>6430, -34092=>6431, -34079=>6432, -34069=>6433, -34068=>6434, -34044=>6435, -34112=>6436, -34147=>6437, -34136=>6438, -34120=>6439, -34113=>6440, -34306=>6441, -34123=>6442, -34133=>6443, -34176=>6444, -34212=>6445, -34184=>6446, -34193=>6447, -34186=>6448, -34216=>6449, -34157=>6450, -34196=>6451, -34203=>6452, -34282=>6453, -34183=>6454, -34204=>6455, -34167=>6456, -34174=>6457, -34192=>6458, -34249=>6459, -34234=>6460, -34255=>6461, -34233=>6462, -34256=>6463, -34261=>6464, -34269=>6465, -34277=>6466, -34268=>6467, -34297=>6468, -34314=>6469, -34323=>6470, -34315=>6471, -34302=>6472, -34298=>6473, -34310=>6474, -34338=>6475, -34330=>6476, -34352=>6477, -34367=>6478, -12172=>6479, -34381=>6479, -20053=>6480, -34388=>6481, -34399=>6482, -34407=>6483, -34417=>6484, -34451=>6485, -34467=>6486, -34473=>6487, -34474=>6488, -34443=>6489, -34444=>6490, -34486=>6491, -34479=>6492, -34500=>6493, -34502=>6494, -34480=>6495, -34505=>6496, -34851=>6497, -34475=>6498, -34516=>6499, -34526=>6500, -34537=>6501, -34540=>6502, -34527=>6503, -34523=>6504, -34543=>6505, -34578=>6506, -34566=>6507, -34568=>6508, -34560=>6509, -34563=>6510, -34555=>6511, -34577=>6512, -34569=>6513, -34573=>6514, -34553=>6515, -34570=>6516, -34612=>6517, -34623=>6518, -34615=>6519, -34619=>6520, -34597=>6521, -34601=>6522, -34586=>6523, -34656=>6524, -34655=>6525, -34680=>6526, -34636=>6527, -34638=>6528, -34676=>6529, -34647=>6530, -34664=>6531, -34670=>6532, -34649=>6533, -34643=>6534, -34659=>6535, -34666=>6536, -34821=>6537, -34722=>6538, -34719=>6539, -34690=>6540, -34735=>6541, -34763=>6542, -34749=>6543, -34752=>6544, -34768=>6545, -38614=>6546, -34731=>6547, -34756=>6548, -34739=>6549, -34759=>6550, -34758=>6551, -34747=>6552, -34799=>6553, -34802=>6554, -34784=>6555, -34831=>6556, -34829=>6557, -34814=>6558, -34806=>6559, -34807=>6560, -34830=>6561, -34770=>6562, -34833=>6563, -34838=>6564, -34837=>6565, -34850=>6566, -34849=>6567, -34865=>6568, -34870=>6569, -34873=>6570, -34855=>6571, -34875=>6572, -34884=>6573, -34882=>6574, -34898=>6575, -34905=>6576, -34910=>6577, -34914=>6578, -34923=>6579, -34945=>6580, -34942=>6581, -34974=>6582, -34933=>6583, -34941=>6584, -34997=>6585, -34930=>6586, -34946=>6587, -34967=>6588, -34962=>6589, -34990=>6590, -34969=>6591, -34978=>6592, -34957=>6593, -34980=>6594, -34992=>6595, -35007=>6596, -34993=>6597, -35011=>6598, -35012=>6599, -35028=>6600, -35032=>6601, -35033=>6602, -35037=>6603, -35065=>6604, -35074=>6605, -35068=>6606, -35060=>6607, -35048=>6608, -35058=>6609, -35076=>6610, -35084=>6611, -35082=>6612, -35091=>6613, -35139=>6614, -35102=>6615, -35109=>6616, -35114=>6617, -35115=>6618, -35137=>6619, -35140=>6620, -35131=>6621, -35126=>6622, -35128=>6623, -35148=>6624, -35101=>6625, -35168=>6626, -35166=>6627, -35174=>6628, -35172=>6629, -35181=>6630, -35178=>6631, -35183=>6632, -35188=>6633, -35191=>6634, -12177=>6635, -35198=>6635, -35203=>6636, -35208=>6637, -35210=>6638, -35219=>6639, -35224=>6640, -35233=>6641, -35241=>6642, -35238=>6643, -35244=>6644, -35247=>6645, -35250=>6646, -35258=>6647, -35261=>6648, -35263=>6649, -35264=>6650, -35290=>6651, -35292=>6652, -35293=>6653, -35303=>6654, -35316=>6655, -35320=>6656, -35331=>6657, -35350=>6658, -35344=>6659, -35340=>6660, -35355=>6661, -35357=>6662, -35365=>6663, -35382=>6664, -35393=>6665, -35419=>6666, -35410=>6667, -35398=>6668, -35400=>6669, -35452=>6670, -35437=>6671, -35436=>6672, -35426=>6673, -35461=>6674, -35458=>6675, -35460=>6676, -35496=>6677, -35489=>6678, -35473=>6679, -35493=>6680, -35494=>6681, -35482=>6682, -35491=>6683, -35524=>6684, -35533=>6685, -35522=>6686, -35546=>6687, -35563=>6688, -35571=>6689, -35559=>6690, -35556=>6691, -35569=>6692, -35604=>6693, -35552=>6694, -35554=>6695, -35575=>6696, -35550=>6697, -35547=>6698, -35596=>6699, -35591=>6700, -35610=>6701, -35553=>6702, -35606=>6703, -35600=>6704, -35607=>6705, -35616=>6706, -35635=>6707, -38827=>6708, -35622=>6709, -35627=>6710, -35646=>6711, -35624=>6712, -35649=>6713, -35660=>6714, -35663=>6715, -35662=>6716, -35657=>6717, -35670=>6718, -35675=>6719, -35674=>6720, -35691=>6721, -35679=>6722, -35692=>6723, -35695=>6724, -35700=>6725, -35709=>6726, -35712=>6727, -35724=>6728, -35726=>6729, -35730=>6730, -35731=>6731, -35734=>6732, -35737=>6733, -35738=>6734, -35898=>6735, -35905=>6736, -35903=>6737, -35912=>6738, -35916=>6739, -35918=>6740, -35920=>6741, -12183=>6742, -35925=>6742, -35938=>6743, -35948=>6744, -12184=>6745, -35960=>6745, -35962=>6746, -35970=>6747, -35977=>6748, -35973=>6749, -35978=>6750, -35981=>6751, -35982=>6752, -35988=>6753, -35964=>6754, -35992=>6755, -25117=>6756, -36013=>6757, -36010=>6758, -36029=>6759, -36018=>6760, -36019=>6761, -36014=>6762, -36022=>6763, -36040=>6764, -36033=>6765, -36068=>6766, -36067=>6767, -36058=>6768, -36093=>6769, -36090=>6770, -36091=>6771, -36100=>6772, -36101=>6773, -36106=>6774, -36103=>6775, -36111=>6776, -36109=>6777, -36112=>6778, -40782=>6779, -36115=>6780, -36045=>6781, -36116=>6782, -36118=>6783, -36199=>6784, -36205=>6785, -36209=>6786, -36211=>6787, -36225=>6788, -36249=>6789, -36290=>6790, -36286=>6791, -36282=>6792, -36303=>6793, -36314=>6794, -36310=>6795, -36300=>6796, -36315=>6797, -36299=>6798, -36330=>6799, -36331=>6800, -36319=>6801, -36323=>6802, -36348=>6803, -36360=>6804, -36361=>6805, -36351=>6806, -36381=>6807, -36382=>6808, -36368=>6809, -36383=>6810, -36418=>6811, -36405=>6812, -36400=>6813, -36404=>6814, -36426=>6815, -36423=>6816, -36425=>6817, -36428=>6818, -36432=>6819, -36424=>6820, -36441=>6821, -36452=>6822, -36448=>6823, -36394=>6824, -36451=>6825, -36437=>6826, -36470=>6827, -36466=>6828, -36476=>6829, -36481=>6830, -36487=>6831, -36485=>6832, -36484=>6833, -36491=>6834, -36490=>6835, -36499=>6836, -36497=>6837, -36500=>6838, -36505=>6839, -36522=>6840, -36513=>6841, -36524=>6842, -36528=>6843, -36550=>6844, -36529=>6845, -36542=>6846, -36549=>6847, -36552=>6848, -36555=>6849, -36571=>6850, -36579=>6851, -36604=>6852, -36603=>6853, -36587=>6854, -36606=>6855, -36618=>6856, -36613=>6857, -36629=>6858, -36626=>6859, -36633=>6860, -36627=>6861, -36636=>6862, -36639=>6863, -36635=>6864, -36620=>6865, -36646=>6866, -36659=>6867, -36667=>6868, -36665=>6869, -36677=>6870, -36674=>6871, -36670=>6872, -36684=>6873, -36681=>6874, -36678=>6875, -36686=>6876, -36695=>6877, -36700=>6878, -36706=>6879, -36707=>6880, -36708=>6881, -36764=>6882, -36767=>6883, -36771=>6884, -36781=>6885, -36783=>6886, -36791=>6887, -36826=>6888, -36837=>6889, -36834=>6890, -36842=>6891, -36847=>6892, -36999=>6893, -36852=>6894, -36869=>6895, -36857=>6896, -36858=>6897, -36881=>6898, -36885=>6899, -36897=>6900, -36877=>6901, -36894=>6902, -36886=>6903, -36875=>6904, -36903=>6905, -36918=>6906, -36917=>6907, -36921=>6908, -36856=>6909, -36943=>6910, -36944=>6911, -36945=>6912, -36946=>6913, -36878=>6914, -36937=>6915, -36926=>6916, -36950=>6917, -36952=>6918, -36958=>6919, -36968=>6920, -36975=>6921, -36982=>6922, -38568=>6923, -36978=>6924, -36994=>6925, -36989=>6926, -36993=>6927, -36992=>6928, -37002=>6929, -37001=>6930, -37007=>6931, -37032=>6932, -37039=>6933, -37041=>6934, -37045=>6935, -37090=>6936, -37092=>6937, -25160=>6938, -37083=>6939, -37122=>6940, -37138=>6941, -37145=>6942, -37170=>6943, -37168=>6944, -37194=>6945, -37206=>6946, -37208=>6947, -37219=>6948, -37221=>6949, -37225=>6950, -37235=>6951, -37234=>6952, -37259=>6953, -37257=>6954, -37250=>6955, -37282=>6956, -37291=>6957, -37295=>6958, -37290=>6959, -37301=>6960, -37300=>6961, -37306=>6962, -37312=>6963, -37313=>6964, -37321=>6965, -37323=>6966, -37328=>6967, -37334=>6968, -37343=>6969, -37345=>6970, -37339=>6971, -37372=>6972, -37365=>6973, -37366=>6974, -37406=>6975, -37375=>6976, -37396=>6977, -37420=>6978, -37397=>6979, -37393=>6980, -37470=>6981, -37463=>6982, -37445=>6983, -37449=>6984, -37476=>6985, -37448=>6986, -37525=>6987, -37439=>6988, -37451=>6989, -37456=>6990, -37532=>6991, -37526=>6992, -37523=>6993, -37531=>6994, -37466=>6995, -37583=>6996, -37561=>6997, -37559=>6998, -37609=>6999, -37647=>7000, -37626=>7001, -37700=>7002, -37678=>7003, -37657=>7004, -37666=>7005, -37658=>7006, -37667=>7007, -37690=>7008, -37685=>7009, -37691=>7010, -37724=>7011, -37728=>7012, -37756=>7013, -37742=>7014, -37718=>7015, -37808=>7016, -37804=>7017, -37805=>7018, -37780=>7019, -37817=>7020, -37846=>7021, -37847=>7022, -37864=>7023, -37861=>7024, -37848=>7025, -37827=>7026, -37853=>7027, -37840=>7028, -37832=>7029, -37860=>7030, -37914=>7031, -37908=>7032, -37907=>7033, -37891=>7034, -37895=>7035, -37904=>7036, -37942=>7037, -37931=>7038, -37941=>7039, -37921=>7040, -37946=>7041, -37953=>7042, -37970=>7043, -37956=>7044, -37979=>7045, -37984=>7046, -37986=>7047, -37982=>7048, -37994=>7049, -37417=>7050, -38000=>7051, -38005=>7052, -38007=>7053, -38013=>7054, -37978=>7055, -38012=>7056, -38014=>7057, -38017=>7058, -38015=>7059, -38274=>7060, -38279=>7061, -38282=>7062, -38292=>7063, -38294=>7064, -38296=>7065, -38297=>7066, -38304=>7067, -38312=>7068, -38311=>7069, -38317=>7070, -38332=>7071, -38331=>7072, -38329=>7073, -38334=>7074, -38346=>7075, -28662=>7076, -38339=>7077, -38349=>7078, -38348=>7079, -38357=>7080, -38356=>7081, -38358=>7082, -38364=>7083, -38369=>7084, -38373=>7085, -38370=>7086, -38433=>7087, -38440=>7088, -38446=>7089, -38447=>7090, -38466=>7091, -38476=>7092, -38479=>7093, -38475=>7094, -38519=>7095, -38492=>7096, -38494=>7097, -38493=>7098, -38495=>7099, -38502=>7100, -38514=>7101, -38508=>7102, -38541=>7103, -38552=>7104, -38549=>7105, -38551=>7106, -38570=>7107, -38567=>7108, -38577=>7109, -38578=>7110, -38576=>7111, -38580=>7112, -12202=>7113, -38582=>7113, -38584=>7114, -12203=>7115, -38585=>7115, -38606=>7116, -38603=>7117, -38601=>7118, -38605=>7119, -35149=>7120, -38620=>7121, -38669=>7122, -38613=>7123, -38649=>7124, -38660=>7125, -38662=>7126, -38664=>7127, -38675=>7128, -38670=>7129, -38673=>7130, -38671=>7131, -38678=>7132, -38681=>7133, -38692=>7134, -38698=>7135, -38704=>7136, -38713=>7137, -38717=>7138, -38718=>7139, -38724=>7140, -38726=>7141, -38728=>7142, -38722=>7143, -38729=>7144, -38748=>7145, -38752=>7146, -38756=>7147, -38758=>7148, -38760=>7149, -21202=>7150, -38763=>7151, -38769=>7152, -38777=>7153, -38789=>7154, -38780=>7155, -38785=>7156, -38778=>7157, -38790=>7158, -38795=>7159, -38799=>7160, -38800=>7161, -38812=>7162, -38824=>7163, -38822=>7164, -38819=>7165, -38835=>7166, -38836=>7167, -38851=>7168, -38854=>7169, -38856=>7170, -12209=>7171, -38859=>7171, -38876=>7172, -12210=>7173, -38893=>7173, -40783=>7174, -38898=>7175, -31455=>7176, -38902=>7177, -38901=>7178, -38927=>7179, -38924=>7180, -38968=>7181, -38948=>7182, -38945=>7183, -38967=>7184, -38973=>7185, -38982=>7186, -38991=>7187, -38987=>7188, -39019=>7189, -39023=>7190, -39024=>7191, -39025=>7192, -39028=>7193, -39027=>7194, -39082=>7195, -39087=>7196, -39089=>7197, -39094=>7198, -39108=>7199, -39107=>7200, -39110=>7201, -39145=>7202, -39147=>7203, -39171=>7204, -39177=>7205, -39186=>7206, -39188=>7207, -39192=>7208, -39201=>7209, -39197=>7210, -39198=>7211, -39204=>7212, -39200=>7213, -39212=>7214, -39214=>7215, -39229=>7216, -39230=>7217, -39234=>7218, -39241=>7219, -39237=>7220, -39248=>7221, -39243=>7222, -39249=>7223, -39250=>7224, -39244=>7225, -39253=>7226, -39319=>7227, -39320=>7228, -39333=>7229, -39341=>7230, -39342=>7231, -39356=>7232, -39391=>7233, -39387=>7234, -39389=>7235, -39384=>7236, -39377=>7237, -39405=>7238, -39406=>7239, -39409=>7240, -39410=>7241, -39419=>7242, -39416=>7243, -39425=>7244, -39439=>7245, -39429=>7246, -39394=>7247, -39449=>7248, -39467=>7249, -39479=>7250, -39493=>7251, -39490=>7252, -39488=>7253, -39491=>7254, -39486=>7255, -39509=>7256, -39501=>7257, -39515=>7258, -39511=>7259, -39519=>7260, -39522=>7261, -39525=>7262, -39524=>7263, -39529=>7264, -39531=>7265, -39530=>7266, -39597=>7267, -39600=>7268, -39612=>7269, -39616=>7270, -39631=>7271, -39633=>7272, -39635=>7273, -39636=>7274, -39646=>7275, -12221=>7276, -39647=>7276, -39650=>7277, -39651=>7278, -39654=>7279, -39663=>7280, -39659=>7281, -39662=>7282, -39668=>7283, -39665=>7284, -39671=>7285, -39675=>7286, -39686=>7287, -39704=>7288, -39706=>7289, -39711=>7290, -39714=>7291, -39715=>7292, -12222=>7293, -39717=>7293, -39719=>7294, -39720=>7295, -39721=>7296, -39722=>7297, -39726=>7298, -12223=>7299, -39727=>7299, -39730=>7300, -12224=>7300, -39748=>7301, -39747=>7302, -39759=>7303, -39757=>7304, -39758=>7305, -39761=>7306, -39768=>7307, -39796=>7308, -39827=>7309, -39811=>7310, -39825=>7311, -39830=>7312, -39831=>7313, -39839=>7314, -39840=>7315, -39848=>7316, -39860=>7317, -39872=>7318, -39882=>7319, -39865=>7320, -39878=>7321, -39887=>7322, -39889=>7323, -39890=>7324, -39907=>7325, -39906=>7326, -39908=>7327, -39892=>7328, -39905=>7329, -39994=>7330, -39922=>7331, -39921=>7332, -39920=>7333, -39957=>7334, -39956=>7335, -39945=>7336, -39955=>7337, -39948=>7338, -39942=>7339, -39944=>7340, -39954=>7341, -39946=>7342, -39940=>7343, -39982=>7344, -39963=>7345, -39973=>7346, -39972=>7347, -39969=>7348, -39984=>7349, -40007=>7350, -39986=>7351, -40006=>7352, -39998=>7353, -40026=>7354, -40032=>7355, -40039=>7356, -40054=>7357, -40056=>7358, -40167=>7359, -40172=>7360, -40176=>7361, -40201=>7362, -40200=>7363, -40171=>7364, -40195=>7365, -40198=>7366, -40234=>7367, -40230=>7368, -40367=>7369, -40227=>7370, -40223=>7371, -40260=>7372, -40213=>7373, -40210=>7374, -40257=>7375, -40255=>7376, -40254=>7377, -40262=>7378, -40264=>7379, -40285=>7380, -40286=>7381, -40292=>7382, -40273=>7383, -40272=>7384, -40281=>7385, -40306=>7386, -40329=>7387, -40327=>7388, -40363=>7389, -40303=>7390, -40314=>7391, -40346=>7392, -40356=>7393, -40361=>7394, -40370=>7395, -40388=>7396, -40385=>7397, -40379=>7398, -40376=>7399, -40378=>7400, -40390=>7401, -40399=>7402, -40386=>7403, -40409=>7404, -40403=>7405, -40440=>7406, -40422=>7407, -40429=>7408, -40431=>7409, -40445=>7410, -40474=>7411, -40475=>7412, -40478=>7413, -12228=>7414, -40565=>7414, -40569=>7415, -40573=>7416, -40577=>7417, -40584=>7418, -40587=>7419, -40588=>7420, -40594=>7421, -40597=>7422, -40593=>7423, -40605=>7424, -12230=>7425, -40613=>7425, -40617=>7426, -40632=>7427, -40618=>7428, -40621=>7429, -38753=>7430, -40652=>7431, -40654=>7432, -40655=>7433, -40656=>7434, -40660=>7435, -40668=>7436, -40670=>7437, -40669=>7438, -40672=>7439, -40677=>7440, -40680=>7441, -40687=>7442, -40692=>7443, -40694=>7444, -40695=>7445, -12235=>7446, -40697=>7446, -40699=>7447, -40700=>7448, -12236=>7449, -40701=>7449, -40711=>7450, -40712=>7451, -30391=>7452, -40725=>7453, -40737=>7454, -40748=>7455, -40766=>7456, -40778=>7457, -12241=>7457, -40786=>7458, -12242=>7458, -40788=>7459, -40803=>7460, -40799=>7461, -40800=>7462, -40801=>7463, -40806=>7464, -40807=>7465, -40812=>7466, -40810=>7467, -40823=>7468, -40818=>7469, -40822=>7470, -40853=>7471, -40860=>7472, -12244=>7472, -40864=>7473, -12245=>7473, -22575=>7474, -27079=>7475, -36953=>7476, -29796=>7477, -9472=>7479, -9473=>7480, -9474=>7481, -9475=>7482, -9476=>7483, -9477=>7484, -9478=>7485, -9479=>7486, -9480=>7487, -9481=>7488, -9482=>7489, -9483=>7490, -9484=>7491, -9485=>7492, -9486=>7493, -9487=>7494, -9488=>7495, -9489=>7496, -9490=>7497, -9491=>7498, -9492=>7499, -9493=>7500, -9494=>7501, -9495=>7502, -9496=>7503, -9497=>7504, -9498=>7505, -9499=>7506, -9500=>7507, -9501=>7508, -9502=>7509, -9503=>7510, -9504=>7511, -9505=>7512, -9506=>7513, -9507=>7514, -9508=>7515, -9509=>7516, -9510=>7517, -9511=>7518, -9512=>7519, -9513=>7520, -9514=>7521, -9515=>7522, -9516=>7523, -9517=>7524, -9518=>7525, -9519=>7526, -9520=>7527, -9521=>7528, -9522=>7529, -9523=>7530, -9524=>7531, -9525=>7532, -9526=>7533, -9527=>7534, -9528=>7535, -9529=>7536, -9530=>7537, -9531=>7538, -9532=>7539, -9533=>7540, -9534=>7541, -9535=>7542, -9536=>7543, -9537=>7544, -9538=>7545, -9539=>7546, -9540=>7547, -9541=>7548, -9542=>7549, -9543=>7550, -9544=>7551, -9545=>7552, -9546=>7553, -9547=>7554, -9312=>7555, -9313=>7556, -9314=>7557, -9315=>7558, -9316=>7559, -9317=>7560, -9318=>7561, -9319=>7562, -9320=>7563, -9321=>7564, -9322=>7565, -9323=>7566, -9324=>7567, -9325=>7568, -9326=>7569, -9327=>7570, -9328=>7571, -9329=>7572, -9330=>7573, -9331=>7574, -8544=>7575, -8545=>7576, -8546=>7577, -8547=>7578, -8548=>7579, -8549=>7580, -8550=>7581, -8551=>7582, -8552=>7583, -8553=>7584, -13129=>7585, -13076=>7586, -13133=>7588, -13095=>7590, -13110=>7592, -13137=>7593, -13069=>7595, -13094=>7596, -13099=>7598, -13130=>7599, -13212=>7601, -13213=>7602, -13214=>7603, -13198=>7604, -13199=>7605, -13252=>7606, -13217=>7607, -12317=>7608, -12319=>7609, -8470=>7610, -13261=>7611, -12964=>7613, -12965=>7614, -12966=>7615, -12967=>7616, -12968=>7617, -12849=>7618, -12850=>7619, -12857=>7620, -13182=>7621, -13181=>7622, -13180=>7623, -8750=>7624, -8721=>7625, -8735=>7629, -8895=>7630, -21854=>7633, -167133=>7641, -28976=>7644, -40407=>7646, -64054=>7651, -22169=>7654, -15694=>7655, -20448=>7660, -36544=>7663, -194797=>7665, -153716=>7670, -32363=>7671, -33606=>7672, -167670=>7673, -40572=>7677, -26171=>7680, -40628=>7682, -26629=>7687, -23650=>7693, -194780=>7695, -32353=>7697, -64070=>7700, -34083=>7706, -37292=>7707, -34796=>7715, -25620=>7724, -39506=>7727, -64074=>7732, -194692=>7734, -31774=>7739, -64016=>7746, -25681=>7747, -63980=>7750, -22625=>7751, -39002=>7752, -194679=>7754, -31153=>7758, -28678=>7760, -22218=>7770, -21085=>7774, -28497=>7776, -37297=>7777, -64106=>7788, -38960=>7795, -40629=>7797, -33802=>7807, -63939=>7808, -63890=>7809, -63891=>7810, -63897=>7811, -34847=>7813, -194575=>7814, -194771=>7816, -194584=>7817, -137754=>7825, -23643=>7826, -25890=>7831, -26618=>7834, -26766=>7836, -148432=>7838, -194848=>7839, -34110=>7861, -30562=>7877, -65041=>7887, -65042=>7888, -65075=>7890, -65073=>7892, -65074=>7893, -8285=>7897, -65049=>7897, -8282=>7898, -65072=>7898, -65077=>7899, -65078=>7900, -65081=>7901, -65082=>7902, -65095=>7903, -65096=>7904, -65079=>7905, -65080=>7906, -65087=>7907, -65088=>7908, -65085=>7909, -65086=>7910, -65089=>7911, -65090=>7912, -65091=>7913, -65092=>7914, -65083=>7915, -65084=>7916, -12436=>7958, -12437=>7959, -12438=>7960, -22099=>7963, -65508=>8005, -65287=>8006, -65282=>8007, -9665=>8009, -9655=>8010, -8681=>8011, -8679=>8012, -8678=>8013, -8680=>8014, -9634=>8015, -9831=>8016, -9825=>8017, -9828=>8018, -9826=>8019, -13216=>8020, -13218=>8021, -13220=>8022, -13221=>8023, -13207=>8024, -8467=>8025, -13208=>8026, -13235=>8027, -13234=>8028, -13233=>8029, -13232=>8030, -13189=>8031, -13190=>8032, -13191=>8033, -13259=>8034, -13200=>8035, -13268=>8036, -13206=>8037, -13090=>8038, -13078=>8039, -13080=>8040, -13077=>8041, -13059=>8042, -13091=>8043, -13143=>8044, -13122=>8045, -13113=>8046, -13115=>8047, -13056=>8048, -13105=>8049, -13127=>8050, -13086=>8051, -13098=>8052, -13183=>8054, -8481=>8055, -9742=>8056, -12342=>8057, -12320=>8058, -9352=>8062, -9353=>8063, -9354=>8064, -9355=>8065, -9356=>8066, -9357=>8067, -9358=>8068, -9359=>8069, -9360=>8070, -9332=>8071, -9333=>8072, -9334=>8073, -9335=>8074, -9336=>8075, -9337=>8076, -9338=>8077, -9339=>8078, -9340=>8079, -9341=>8080, -9342=>8081, -9343=>8082, -9344=>8083, -9345=>8084, -9346=>8085, -9347=>8086, -9348=>8087, -9349=>8088, -9350=>8089, -9351=>8090, -12881=>8091, -8560=>8092, -8561=>8093, -8562=>8094, -8563=>8095, -8564=>8096, -8565=>8097, -8566=>8098, -8567=>8099, -8568=>8100, -8569=>8101, -12882=>8102, -12883=>8103, -12884=>8104, -12885=>8105, -12886=>8106, -12887=>8107, -12888=>8108, -12889=>8109, -12890=>8110, -12891=>8111, -9372=>8112, -9373=>8113, -9374=>8114, -9375=>8115, -9376=>8116, -9377=>8117, -9378=>8118, -9379=>8119, -9380=>8120, -9381=>8121, -9382=>8122, -9383=>8123, -9384=>8124, -9385=>8125, -9386=>8126, -9387=>8127, -9388=>8128, -9389=>8129, -9390=>8130, -9391=>8131, -9392=>8132, -9393=>8133, -9394=>8134, -9395=>8135, -9396=>8136, -9397=>8137, -12867=>8138, -12861=>8139, -12863=>8140, -12852=>8141, -12856=>8142, -12851=>8143, -12860=>8144, -12866=>8145, -12862=>8146, -12854=>8147, -12853=>8148, -12859=>8149, -12864=>8150, -12858=>8151, -12976=>8152, -12973=>8153, -12969=>8154, -12975=>8155, -12948=>8156, -12970=>8157, -12952=>8158, -12971=>8159, -12946=>8160, -12945=>8161, -12947=>8162, -12972=>8163, -12974=>8164, -12950=>8165, -9131=>8174, -9132=>8175, -9133=>8176, -9127=>8178, -9128=>8179, -9129=>8180, -13260=>8182, -13061=>8183, -13215=>8186, -13219=>8187, -13222=>8188, -12958=>8191, -13192=>8192, -13193=>8193, -13256=>8194, -8749=>8195, -12848=>8197, -12842=>8198, -12843=>8199, -12844=>8200, -12845=>8201, -12846=>8202, -12847=>8203, -12855=>8204, -12865=>8205, -10145=>8206, -11013=>8207, -11014=>8208, -11015=>8209, -9673=>8210, -9824=>8211, -9829=>8212, -9827=>8213, -9830=>8214, -9728=>8215, -9729=>8216, -9730=>8217, -9731=>8218, -9758=>8219, -9756=>8220, -9757=>8221, -9759=>8222, -12953=>8223, -9450=>8224, -8554=>8225, -8555=>8226, -9601=>8230, -9602=>8231, -9603=>8232, -9604=>8233, -9605=>8234, -9606=>8235, -9607=>8236, -9608=>8237, -9615=>8238, -9614=>8239, -9613=>8240, -9612=>8241, -9611=>8242, -9610=>8243, -9609=>8244, -9620=>8245, -9621=>8246, -9581=>8247, -9582=>8248, -9584=>8249, -9583=>8250, -9552=>8251, -9566=>8252, -9578=>8253, -9569=>8254, -9698=>8255, -9699=>8256, -9701=>8257, -9700=>8258, -9585=>8261, -9586=>8262, -9587=>8263, -65040=>8268, -20956=>8284, -29081=>8285, -10102=>8286, -10103=>8287, -10104=>8288, -10105=>8289, -10106=>8290, -10107=>8291, -10108=>8292, -10109=>8293, -10110=>8294, -8570=>8298, -8571=>8299, -8575=>8303, -8458=>8304, -8457=>8305, -8507=>8307, -12292=>8308, -8646=>8309, -8644=>8310, -8645=>8311, -12535=>8313, -12536=>8314, -12537=>8315, -12538=>8316, -12957=>8319, -13179=>8323, -13107=>8327, -13134=>8328, -32394=>8359, -35100=>8360, -37704=>8361, -37512=>8362, -34012=>8363, -20425=>8364, -28859=>8365, -26161=>8366, -26824=>8367, -37625=>8368, -26363=>8369, -24389=>8370, -12033=>8371, -20008=>8371, -20193=>8372, -20220=>8373, -20224=>8374, -20227=>8375, -20281=>8376, -20310=>8377, -20370=>8378, -20362=>8379, -20378=>8380, -20372=>8381, -20429=>8382, -20544=>8383, -20514=>8384, -20479=>8385, -20510=>8386, -20550=>8387, -20592=>8388, -20546=>8389, -20628=>8390, -20724=>8391, -20696=>8392, -20810=>8393, -20836=>8394, -20893=>8395, -20926=>8396, -20972=>8397, -21013=>8398, -21148=>8399, -21158=>8400, -21184=>8401, -21211=>8402, -21248=>8403, -21284=>8405, -21362=>8406, -21395=>8407, -21426=>8408, -21469=>8409, -64014=>8410, -21660=>8411, -21642=>8412, -21673=>8413, -21759=>8414, -21894=>8415, -22361=>8416, -22373=>8417, -22444=>8418, -22472=>8419, -22471=>8420, -64015=>8421, -22686=>8423, -22706=>8424, -22795=>8425, -22867=>8426, -22875=>8427, -22877=>8428, -22883=>8429, -22948=>8430, -22970=>8431, -23382=>8432, -23488=>8433, -29999=>8434, -23512=>8435, -23582=>8437, -23718=>8438, -23738=>8439, -23797=>8440, -23847=>8441, -23891=>8442, -23874=>8444, -23917=>8445, -23992=>8446, -23993=>8447, -24016=>8448, -24353=>8449, -24372=>8450, -24423=>8451, -24503=>8452, -24542=>8453, -24669=>8454, -24709=>8455, -24714=>8456, -24798=>8457, -24789=>8458, -24864=>8459, -24818=>8460, -24849=>8461, -24887=>8462, -24880=>8463, -24984=>8464, -25107=>8465, -25254=>8466, -25589=>8467, -25696=>8468, -25757=>8469, -25806=>8470, -25934=>8471, -26112=>8472, -26133=>8473, -26121=>8474, -26158=>8475, -26148=>8477, -26213=>8478, -26199=>8479, -26201=>8480, -64018=>8481, -26227=>8482, -26265=>8483, -26272=>8484, -26290=>8485, -26303=>8486, -26362=>8487, -26382=>8488, -26470=>8490, -26555=>8491, -26706=>8492, -26560=>8493, -26692=>8495, -26831=>8496, -64019=>8497, -26984=>8498, -64020=>8499, -27032=>8500, -27106=>8501, -27184=>8502, -27243=>8503, -27206=>8504, -27251=>8505, -27262=>8506, -27362=>8507, -27364=>8508, -27606=>8509, -27711=>8510, -27740=>8511, -27782=>8512, -27759=>8513, -27866=>8514, -27908=>8515, -28039=>8516, -28015=>8517, -28054=>8518, -28076=>8519, -28111=>8520, -28152=>8521, -28146=>8522, -28156=>8523, -28217=>8524, -28252=>8525, -28199=>8526, -28220=>8527, -28351=>8528, -28552=>8529, -28597=>8530, -28661=>8531, -28677=>8532, -28679=>8533, -28712=>8534, -28805=>8535, -28843=>8536, -28943=>8537, -28932=>8538, -29020=>8539, -28998=>8540, -28999=>8541, -29121=>8543, -29182=>8544, -29361=>8545, -29374=>8546, -29476=>8547, -64022=>8548, -29559=>8549, -29629=>8550, -29641=>8551, -29654=>8552, -29667=>8553, -29650=>8554, -29703=>8555, -29685=>8556, -29734=>8557, -29738=>8558, -29737=>8559, -29742=>8560, -29833=>8562, -29855=>8563, -29953=>8564, -30063=>8565, -30338=>8566, -30364=>8567, -30366=>8568, -30363=>8569, -30374=>8570, -64023=>8571, -30534=>8572, -21167=>8573, -30753=>8574, -30798=>8575, -30820=>8576, -30842=>8577, -31024=>8578, -64024=>8579, -64025=>8580, -64026=>8581, -31124=>8582, -64027=>8583, -31131=>8584, -31441=>8585, -31463=>8586, -64028=>8587, -31467=>8588, -31646=>8589, -64029=>8590, -32072=>8591, -32183=>8593, -32160=>8594, -32214=>8595, -32338=>8596, -32583=>8597, -32673=>8598, -64030=>8599, -33537=>8600, -33634=>8601, -33663=>8602, -33735=>8603, -33782=>8604, -33864=>8605, -33972=>8606, -34131=>8607, -34137=>8608, -34155=>8609, -64031=>8610, -34224=>8611, -64032=>8612, -64033=>8613, -34823=>8614, -35061=>8615, -35346=>8616, -35383=>8617, -35449=>8618, -35495=>8619, -35518=>8620, -35551=>8621, -64034=>8622, -35574=>8623, -35667=>8624, -35711=>8625, -36080=>8626, -36084=>8627, -36114=>8628, -36214=>8629, -64035=>8630, -36559=>8631, -64037=>8633, -36967=>8634, -37086=>8635, -64038=>8636, -37141=>8637, -37159=>8638, -37338=>8639, -37335=>8640, -37342=>8641, -37357=>8642, -37358=>8643, -37348=>8644, -37349=>8645, -37382=>8646, -37392=>8647, -37386=>8648, -37434=>8649, -37440=>8650, -37436=>8651, -37454=>8652, -37465=>8653, -37457=>8654, -37433=>8655, -37479=>8656, -37543=>8657, -37495=>8658, -37496=>8659, -37607=>8660, -37591=>8661, -37593=>8662, -37584=>8663, -64039=>8664, -37589=>8665, -37600=>8666, -37587=>8667, -37669=>8668, -37665=>8669, -37627=>8670, -64040=>8671, -37662=>8672, -37631=>8673, -37661=>8674, -37634=>8675, -37744=>8676, -37719=>8677, -37796=>8678, -37830=>8679, -37854=>8680, -37880=>8681, -37937=>8682, -37957=>8683, -37960=>8684, -38290=>8685, -64041=>8687, -38557=>8688, -38575=>8689, -38707=>8690, -38715=>8691, -38723=>8692, -38733=>8693, -38735=>8694, -12205=>8695, -38737=>8695, -38999=>8697, -39013=>8698, -64042=>8699, -64043=>8700, -39207=>8701, -64044=>8702, -39326=>8703, -39502=>8704, -39641=>8705, -39644=>8706, -39797=>8707, -39794=>8708, -39823=>8709, -39857=>8710, -39867=>8711, -39936=>8712, -40304=>8713, -40299=>8714, -64045=>8715, -40473=>8716, -40657=>8717, -8364=>9354, -8486=>9355, -64256=>9358, -64259=>9359, -64260=>9360, -257=>9361, -299=>9362, -363=>9363, -275=>9364, -333=>9365, -256=>9366, -298=>9367, -362=>9368, -274=>9369, -332=>9370, -8539=>9371, -8540=>9372, -8541=>9373, -8542=>9374, -8531=>9375, -8532=>9376, -8304=>9377, -8308=>9378, -8309=>9379, -8310=>9380, -8311=>9381, -8312=>9382, -8313=>9383, -8320=>9384, -8321=>9385, -8322=>9386, -8323=>9387, -8324=>9388, -8325=>9389, -8326=>9390, -8327=>9391, -8328=>9392, -8329=>9393, -461=>9394, -282=>9395, -7868=>9397, -463=>9398, -296=>9400, -465=>9401, -467=>9403, -366=>9404, -360=>9405, -462=>9406, -283=>9407, -7869=>9409, -464=>9410, -297=>9412, -466=>9413, -468=>9415, -367=>9416, -361=>9417, -593=>9418, -8049=>9419, -8048=>9420, -509=>9421, -596=>9423, -601=>9426, -602=>9429, -603=>9432, -8051=>9433, -8050=>9434, -567=>9435, -331=>9436, -629=>9437, -652=>9438, -658=>9441, -643=>9442, -720=>9443, -8534=>9785, -8535=>9786, -8536=>9787, -8537=>9788, -8538=>9789, -12832=>10126, -12833=>10127, -12834=>10128, -12835=>10129, -12836=>10130, -12837=>10131, -12838=>10132, -12839=>10133, -12840=>10134, -12841=>10135, -12892=>10244, -12893=>10245, -12894=>10246, -12895=>10247, -12977=>10248, -12978=>10249, -12979=>10250, -12980=>10251, -12981=>10252, -12982=>10253, -12983=>10254, -12984=>10255, -12985=>10256, -12986=>10257, -12987=>10258, -12988=>10259, -12989=>10260, -12990=>10261, -12991=>10262, -9424=>10313, -9425=>10314, -9426=>10315, -9427=>10316, -9428=>10317, -9429=>10318, -9430=>10319, -9431=>10320, -9432=>10321, -9433=>10322, -9434=>10323, -9435=>10324, -9436=>10325, -9437=>10326, -9438=>10327, -9439=>10328, -9440=>10329, -9441=>10330, -9442=>10331, -9443=>10332, -9444=>10333, -9445=>10334, -9446=>10335, -9447=>10336, -9448=>10337, -9449=>10338, -9398=>10339, -9399=>10340, -9400=>10341, -9401=>10342, -9402=>10343, -9403=>10344, -9404=>10345, -9405=>10346, -9406=>10347, -9407=>10348, -9408=>10349, -9409=>10350, -9410=>10351, -9411=>10352, -9412=>10353, -9413=>10354, -9414=>10355, -9415=>10356, -9416=>10357, -9417=>10358, -9418=>10359, -9419=>10360, -9420=>10361, -9421=>10362, -9422=>10363, -9423=>10364, -13008=>10413, -13009=>10414, -13010=>10415, -13011=>10416, -13012=>10417, -13013=>10418, -13014=>10419, -13015=>10420, -13016=>10421, -13017=>10422, -13018=>10423, -13019=>10424, -13020=>10425, -13021=>10426, -13022=>10427, -13023=>10428, -13024=>10429, -13025=>10430, -13026=>10431, -13027=>10432, -13028=>10433, -13029=>10434, -13030=>10435, -13031=>10436, -13032=>10437, -13033=>10438, -13034=>10439, -13035=>10440, -13036=>10441, -13037=>10442, -13038=>10443, -13039=>10444, -13040=>10445, -13041=>10446, -13042=>10447, -13043=>10448, -13044=>10449, -13045=>10450, -13046=>10451, -13047=>10452, -13048=>10453, -13049=>10454, -13050=>10455, -13051=>10456, -13052=>10457, -13053=>10458, -13054=>10459, -12928=>10461, -12929=>10462, -12930=>10463, -12931=>10464, -12932=>10465, -12933=>10466, -12934=>10467, -12935=>10468, -12936=>10469, -12937=>10470, -12944=>10471, -12938=>10472, -12939=>10473, -12940=>10474, -12941=>10475, -12942=>10476, -12943=>10477, -12959=>10479, -12960=>10486, -12961=>10487, -12955=>10488, -12954=>10489, -12963=>10490, -12962=>10491, -12951=>10492, -12956=>10494, -12949=>10495, -9676=>10502, -9471=>10503, -10111=>10514, -9451=>10515, -9452=>10516, -9453=>10517, -9454=>10518, -9455=>10519, -9456=>10520, -9457=>10521, -9458=>10522, -9459=>10523, -9460=>10524, -8414=>11035, -13274=>11851, -8448=>11855, -13250=>11856, -8453=>11859, -13169=>11861, -13197=>11864, -13211=>11865, -13271=>11869, -13272=>11870, -13057=>11874, -13058=>11875, -13060=>11876, -13062=>11877, -13064=>11879, -13063=>11881, -13066=>11882, -13065=>11884, -13067=>11886, -13068=>11888, -13070=>11889, -13071=>11890, -13072=>11891, -13073=>11892, -13074=>11893, -13075=>11894, -13079=>11896, -13081=>11898, -13082=>11900, -13083=>11901, -13084=>11902, -13085=>11903, -13087=>11904, -13088=>11905, -13089=>11906, -13092=>11907, -13093=>11909, -13096=>11912, -13097=>11913, -13101=>11915, -13102=>11918, -13103=>11919, -13104=>11920, -13106=>11921, -13108=>11924, -13109=>11925, -13116=>11926, -13111=>11930, -13112=>11932, -13114=>11933, -13117=>11934, -13121=>11935, -13118=>11936, -13119=>11937, -13120=>11938, -13123=>11939, -13124=>11940, -13125=>11941, -13126=>11942, -13128=>11943, -13131=>11944, -13132=>11945, -13135=>11946, -13136=>11947, -13138=>11950, -13140=>11951, -13139=>11954, -13141=>11955, -13142=>11956, -8501=>12089, -976=>12090, -8714=>12091, -8463=>12092, -981=>12094, -987=>12095, -977=>12096, -9832=>12098, -9833=>12099, -9836=>12100, -12347=>12106, -12339=>12108, -12340=>12109, -12341=>12110, -8252=>12111, -8265=>12112, -8723=>12118, -8771=>12120, -8818=>12121, -8819=>12122, -12312=>12129, -12313=>12130, -65375=>12131, -65376=>12132, -9115=>12143, -9117=>12144, -9118=>12145, -9120=>12146, -9121=>12151, -9123=>12152, -9124=>12153, -9126=>12154, -9116=>12167, -9119=>12167, -9122=>12167, -9125=>12167, -9130=>12167, -9986=>12176, -12349=>12179, -12447=>12181, -8709=>12184, -8864=>12185, -8854=>12186, -8856=>12187, -8853=>12188, -8855=>12189, -9888=>12192, -9664=>12194, -9654=>12195, -8656=>12200, -8596=>12201, -8600=>12202, -8601=>12203, -8598=>12204, -8599=>12205, -8652=>12206, -8651=>12207, -12336=>12218, -8967=>12219, -10048=>12228, -10047=>12229, -9643=>12237, -9642=>12239, -10010=>12241, -9702=>12254, -10070=>12259, -65093=>12639, -65094=>12640, -64103=>13320, -64098=>13321, -32227=>13322, -12232=>13323, -40643=>13323, -28331=>13324, -64082=>13325, -64061=>13326, -64069=>13327, -64062=>13328, -27114=>13329, -28212=>13330, -64096=>13331, -64071=>13332, -64056=>13333, -64066=>13334, -64078=>13335, -34395=>13336, -64105=>13337, -64052=>13338, -64099=>13339, -25581=>13340, -25802=>13341, -30799=>13342, -64084=>13343, -63856=>13344, -64077=>13345, -64097=>13346, -64072=>13347, -64076=>13348, -64091=>13349, -64092=>13350, -64081=>13351, -64067=>13352, -64090=>13353, -28041=>13354, -29376=>13355, -194885=>13357, -64086=>13358, -64080=>13359, -64049=>13360, -64059=>13361, -24034=>13362, -64063=>13363, -64101=>13364, -21373=>13365, -64055=>13366, -64095=>13367, -24501=>13368, -64064=>13369, -64083=>13371, -64085=>13373, -64104=>13374, -64068=>13375, -64089=>13376, -26202=>13377, -64053=>13378, -64075=>13379, -64100=>13380, -64065=>13381, -64048=>13382, -64057=>13384, -64051=>13385, -27493=>13386, -64058=>13387, -27599=>13388, -64050=>13389, -25150=>13390, -64079=>13391, -63773=>13392, -63964=>13393, -63798=>13394, -28122=>13395, -63952=>13396, -26310=>13397, -27511=>13398, -64087=>13399, -37706=>13400, -37636=>13402, -133390=>13523, -35999=>13644, -11991=>13645, -11965=>13646, -158033=>13646, -37555=>13652, -38321=>13653, -194812=>13656, -194965=>13670, -194794=>13679, -26478=>13681, -11974=>13682, -194594=>13684, -156194=>13691, -13314=>13698, -26083=>13701, -134071=>13706, -171339=>13717, -194611=>13719, -24378=>13720, -11945=>13729, -20465=>13731, -63753=>13739, -11964=>13747, -194732=>13750, -26435=>13751, -133732=>13755, -35329=>13756, -25142=>13757, -21555=>13760, -23067=>13761, -25221=>13765, -194819=>13768, -21567=>13775, -27506=>13785, -29986=>13790, -19256=>13791, -24063=>13794, -194827=>13801, -29626=>13802, -134047=>13803, -194600=>13807, -194849=>13809, -194623=>13815, -194675=>13832, -11916=>13833, -11917=>13834, -23577=>13835, -131083=>13839, -23426=>13840, -194642=>13841, -11997=>13847, -11999=>13848, -39136=>13848, -11998=>13849, -169599=>13849, -14221=>13850, -11927=>13852, -14586=>13852, -194887=>13854, -11909=>13856, -20155=>13856, -131490=>13857, -13599=>13865, -194738=>13867, -11971=>13870, -35200=>13870, -31237=>13875, -35498=>13880, -32085=>13882, -28568=>13884, -25591=>13892, -30246=>13893, -11978=>13898, -163767=>13898, -146686=>13904, -13351=>13910, -33067=>13913, -194842=>13916, -11950=>13922, -154327=>13922, -194714=>13928, -194831=>13932, -22305=>13952, -135741=>13953, -194586=>13954, -64003=>13956, -21534=>13964, -15240=>13965, -20839=>13966, -63839=>13971, -20023=>13981, -11946=>13995, -150804=>13995, -24421=>13996, -23020=>13997, -194658=>13998, -24217=>14000, -13416=>14047, -40884=>14048, -21200=>14056, -38376=>14061, -26625=>14066, -195024=>14068, -195039=>14069, -153215=>14075, -11959=>14078, -36534=>14083, -63775=>14084, -63875=>14088, -31867=>14094, -63906=>14095, -63898=>14097, -11961=>14099, -32770=>14099, -157360=>14100, -11911=>14105, -132648=>14105, -131210=>14108, -133508=>14109, -194604=>14109, -11915=>14110, -13630=>14110, -21589=>14115, -22841=>14117, -23414=>14120, -194669=>14121, -23572=>14122, -14306=>14123, -23782=>14124, -20040=>14126, -194742=>14129, -158105=>14134, -25371=>14135, -26211=>14138, -194779=>14140, -27126=>14143, -27014=>14144, -27596=>14148, -28183=>14150, -27818=>14153, -11942=>14157, -20012=>14157, -29935=>14160, -30069=>14161, -30188=>14162, -30286=>14163, -16305=>14164, -30570=>14165, -30633=>14166, -31571=>14173, -16996=>14176, -194924=>14180, -32328=>14183, -132415=>14188, -11955=>14189, -156266=>14189, -33089=>14194, -17491=>14195, -33401=>14197, -11966=>14197, -64094=>14198, -11967=>14198, -64093=>14199, -11968=>14199, -20857=>14201, -33626=>14202, -17701=>14206, -34292=>14208, -131248=>14209, -34429=>14214, -13358=>14216, -35014=>14217, -18406=>14224, -36808=>14233, -166279=>14253, -167447=>14256, -38969=>14259, -39432=>14266, -39903=>14271, -148206=>14282, -21385=>14288, -64017=>14290, -194785=>14291, -146622=>14293, -132625=>14294, -19972=>14296, -19973=>14297, -19999=>14298, -20011=>14299, -20015=>14300, -20016=>14301, -20032=>14302, -20033=>14303, -20036=>14304, -11907=>14305, -20058=>14305, -20095=>14306, -20109=>14307, -20118=>14308, -20153=>14309, -20176=>14310, -20192=>14311, -20221=>14312, -20223=>14313, -20235=>14314, -20245=>14315, -20320=>14316, -20283=>14317, -20297=>14318, -20308=>14319, -20346=>14320, -20349=>14321, -20350=>14322, -20375=>14323, -20414=>14324, -20431=>14325, -20477=>14326, -20480=>14327, -20481=>14328, -20496=>14329, -20507=>14330, -20519=>14331, -20526=>14332, -20567=>14333, -20582=>14334, -20586=>14335, -20539=>14336, -20623=>14337, -20630=>14338, -20636=>14339, -20684=>14340, -20710=>14341, -20713=>14342, -20719=>14343, -20744=>14344, -20747=>14345, -20752=>14346, -20763=>14347, -20766=>14348, -20831=>14349, -20897=>14350, -20924=>14351, -20974=>14353, -20980=>14354, -20993=>14355, -11913=>14356, -20994=>14356, -21011=>14357, -21065=>14358, -21089=>14359, -21094=>14360, -21139=>14361, -21192=>14362, -21232=>14363, -21258=>14364, -21259=>14365, -21310=>14366, -21324=>14367, -21323=>14368, -21345=>14369, -21356=>14370, -21419=>14371, -21466=>14372, -21478=>14373, -21493=>14374, -21543=>14375, -21581=>14376, -21606=>14377, -21611=>14378, -21620=>14379, -21645=>14380, -21654=>14381, -21665=>14382, -21677=>14383, -21689=>14384, -21695=>14385, -21702=>14386, -21709=>14387, -21774=>14388, -21803=>14389, -21813=>14390, -21834=>14391, -21856=>14392, -21896=>14394, -21902=>14395, -22024=>14396, -22030=>14397, -22031=>14398, -22071=>14399, -22079=>14400, -22089=>14401, -22091=>14402, -22095=>14403, -22118=>14404, -22121=>14405, -22127=>14406, -22129=>14407, -22130=>14408, -22165=>14409, -22170=>14410, -22188=>14411, -22189=>14412, -22193=>14413, -22217=>14414, -22237=>14415, -22244=>14416, -22282=>14417, -22293=>14418, -22307=>14419, -22319=>14420, -22323=>14421, -22324=>14422, -22348=>14423, -22384=>14424, -22412=>14425, -22428=>14426, -22456=>14427, -22502=>14428, -22509=>14429, -22517=>14430, -22518=>14431, -22527=>14432, -22537=>14433, -22560=>14434, -22578=>14435, -22652=>14436, -22656=>14437, -22697=>14438, -22734=>14439, -22736=>14440, -22740=>14441, -22746=>14442, -22761=>14443, -22796=>14444, -22820=>14445, -22831=>14446, -22881=>14447, -22893=>14448, -22986=>14449, -22994=>14450, -23005=>14451, -23011=>14452, -23012=>14453, -23044=>14454, -23052=>14455, -23075=>14456, -23111=>14457, -23125=>14458, -23139=>14459, -23149=>14460, -23166=>14461, -23198=>14462, -23207=>14463, -23212=>14464, -23219=>14465, -23264=>14466, -23296=>14467, -23321=>14468, -23333=>14469, -23341=>14470, -23361=>14471, -23420=>14472, -23422=>14473, -23423=>14474, -23434=>14475, -11919=>14476, -23587=>14476, -23595=>14477, -23600=>14478, -23651=>14479, -23657=>14480, -23676=>14481, -23755=>14482, -23762=>14483, -23796=>14484, -23844=>14485, -23846=>14486, -23875=>14487, -23878=>14488, -23882=>14489, -23954=>14490, -23956=>14491, -23961=>14492, -23968=>14493, -24024=>14494, -24032=>14495, -24056=>14496, -24064=>14497, -24082=>14498, -24084=>14499, -24085=>14500, -24088=>14501, -24110=>14502, -24152=>14503, -24171=>14504, -24172=>14505, -24232=>14506, -24234=>14507, -24254=>14508, -24255=>14509, -24274=>14511, -24327=>14512, -24334=>14513, -24348=>14514, -24349=>14515, -24354=>14516, -24360=>14517, -24374=>14518, -24379=>14519, -24384=>14520, -12089=>14521, -24400=>14521, -24408=>14522, -24420=>14523, -24457=>14524, -24476=>14525, -24487=>14526, -24484=>14527, -24495=>14528, -24504=>14529, -11926=>14530, -24516=>14530, -24521=>14531, -24545=>14532, -24553=>14533, -24557=>14534, -24572=>14535, -24599=>14536, -24602=>14537, -24627=>14538, -24673=>14539, -24703=>14540, -24734=>14541, -24740=>14542, -24752=>14543, -24779=>14544, -24795=>14545, -24824=>14546, -24850=>14547, -24851=>14548, -24852=>14549, -24860=>14550, -24956=>14551, -24973=>14552, -24991=>14553, -25000=>14554, -25026=>14555, -25055=>14556, -25109=>14557, -25129=>14558, -25155=>14559, -25158=>14560, -11928=>14561, -25164=>14561, -25169=>14562, -25174=>14563, -25284=>14564, -25340=>14565, -25354=>14566, -25357=>14567, -25368=>14568, -25401=>14569, -25410=>14570, -25411=>14571, -25445=>14572, -25460=>14573, -25469=>14574, -25476=>14575, -25479=>14576, -25488=>14577, -25502=>14578, -25553=>14579, -25564=>14580, -25609=>14581, -25616=>14582, -25634=>14583, -25684=>14584, -25691=>14585, -25709=>14586, -25723=>14587, -25790=>14588, -25791=>14589, -25829=>14590, -25847=>14591, -25851=>14592, -25860=>14593, -25878=>14594, -25881=>14595, -25927=>14596, -25959=>14597, -25985=>14598, -25989=>14599, -26050=>14600, -26096=>14601, -26098=>14602, -26156=>14603, -26188=>14604, -26203=>14605, -26204=>14606, -26209=>14607, -26219=>14608, -26276=>14610, -26312=>14611, -26348=>14612, -26373=>14613, -26387=>14614, -26419=>14615, -26440=>14616, -26444=>14617, -26486=>14618, -26491=>14619, -26544=>14620, -26546=>14621, -26617=>14622, -26583=>14623, -26585=>14624, -26608=>14625, -26668=>14626, -26672=>14627, -26673=>14628, -26715=>14629, -26738=>14630, -26741=>14631, -26746=>14632, -26756=>14633, -26789=>14634, -26802=>14635, -26832=>14636, -26838=>14637, -26856=>14638, -26861=>14639, -26864=>14640, -26865=>14641, -26876=>14642, -26897=>14643, -26899=>14644, -26933=>14645, -26939=>14646, -26967=>14647, -26979=>14648, -26994=>14649, -27007=>14650, -27008=>14651, -27046=>14652, -27053=>14653, -27063=>14654, -27094=>14655, -27095=>14656, -27137=>14657, -27151=>14658, -27157=>14659, -27176=>14660, -27188=>14661, -27198=>14662, -27205=>14663, -27216=>14664, -27217=>14665, -27222=>14666, -27227=>14667, -27267=>14668, -27273=>14669, -27281=>14670, -27293=>14671, -27294=>14672, -27295=>14673, -27356=>14674, -27367=>14675, -27372=>14676, -27422=>14677, -27428=>14678, -27445=>14679, -27462=>14680, -27478=>14681, -27488=>14682, -27522=>14683, -27582=>14684, -27617=>14685, -27633=>14686, -27664=>14687, -27699=>14688, -27701=>14689, -11937=>14689, -11938=>14690, -27737=>14691, -27766=>14692, -27771=>14693, -27781=>14694, -27797=>14695, -27804=>14696, -27856=>14697, -27860=>14698, -27862=>14699, -27872=>14700, -27883=>14701, -27884=>14702, -27886=>14703, -27914=>14704, -27918=>14705, -27921=>14706, -27950=>14707, -27991=>14708, -27998=>14709, -28005=>14710, -28034=>14711, -28095=>14712, -28100=>14713, -28106=>14714, -28118=>14715, -28137=>14716, -28194=>14717, -28241=>14718, -28359=>14719, -28362=>14720, -28366=>14721, -28413=>14722, -28442=>14723, -28458=>14724, -28463=>14725, -28467=>14726, -28506=>14727, -28510=>14728, -28514=>14729, -28541=>14730, -28555=>14731, -28557=>14732, -28562=>14733, -28564=>14734, -28570=>14735, -28583=>14736, -28584=>14737, -28598=>14738, -28634=>14739, -28638=>14740, -28729=>14742, -28732=>14743, -28756=>14745, -28765=>14746, -28766=>14747, -28772=>14748, -11939=>14749, -28780=>14749, -28798=>14750, -28801=>14751, -28821=>14752, -28855=>14753, -28883=>14754, -28884=>14755, -28888=>14756, -28892=>14757, -28935=>14758, -28960=>14759, -28977=>14760, -29002=>14761, -29010=>14762, -29024=>14763, -29049=>14764, -29074=>14765, -29131=>14767, -29139=>14768, -29142=>14769, -29184=>14770, -29213=>14771, -29227=>14772, -29240=>14773, -29249=>14774, -29267=>14775, -29269=>14776, -29270=>14777, -29276=>14778, -29325=>14779, -11944=>14780, -29357=>14780, -29364=>14781, -29383=>14782, -29435=>14783, -29444=>14784, -29445=>14785, -29480=>14786, -29489=>14787, -29507=>14788, -29548=>14789, -29564=>14790, -29571=>14791, -29573=>14792, -29574=>14793, -29589=>14794, -29598=>14795, -29599=>14796, -29600=>14797, -29606=>14798, -29611=>14799, -29621=>14800, -29623=>14801, -29628=>14802, -29647=>14803, -29657=>14804, -29673=>14805, -29684=>14806, -29693=>14807, -29700=>14808, -29706=>14809, -29722=>14810, -29723=>14811, -29732=>14812, -29736=>14813, -29740=>14814, -29743=>14815, -29744=>14816, -29745=>14817, -29753=>14818, -29764=>14819, -29767=>14820, -29771=>14821, -29773=>14822, -29777=>14823, -29783=>14824, -29798=>14825, -29803=>14826, -29809=>14827, -29824=>14828, -29829=>14829, -29830=>14830, -29831=>14831, -29840=>14832, -29848=>14833, -29852=>14834, -29856=>14835, -29859=>14836, -29864=>14837, -29867=>14838, -29877=>14839, -29887=>14840, -29896=>14841, -29914=>14842, -29918=>14843, -30030=>14844, -30073=>14845, -30081=>14846, -30096=>14847, -12135=>14848, -30098=>14848, -30099=>14849, -30132=>14850, -30180=>14851, -30201=>14852, -30208=>14853, -30218=>14854, -30229=>14855, -30230=>14856, -30233=>14857, -30238=>14858, -30253=>14859, -30261=>14860, -30275=>14861, -30283=>14862, -30309=>14863, -30317=>14864, -30319=>14865, -30321=>14866, -30324=>14867, -30372=>14868, -30373=>14869, -30405=>14870, -30412=>14871, -30444=>14872, -30460=>14873, -30516=>14874, -30518=>14875, -30556=>14876, -30559=>14877, -30560=>14878, -30578=>14879, -30589=>14880, -30613=>14881, -30634=>14882, -30694=>14883, -30704=>14884, -30708=>14885, -30726=>14886, -30754=>14887, -30765=>14888, -30766=>14889, -30768=>14890, -30773=>14891, -30824=>14892, -30878=>14893, -30920=>14894, -30924=>14895, -30926=>14896, -30948=>14897, -30944=>14898, -30945=>14899, -30962=>14900, -30967=>14901, -30971=>14902, -31025=>14903, -11949=>14905, -31035=>14905, -31037=>14906, -31045=>14907, -31067=>14908, -31068=>14909, -31115=>14910, -31126=>14911, -31128=>14912, -12145=>14913, -31160=>14913, -31163=>14914, -31178=>14915, -31194=>14916, -31235=>14917, -31241=>14918, -31249=>14919, -31262=>14920, -31277=>14921, -31289=>14922, -31301=>14923, -31308=>14924, -31325=>14925, -31341=>14927, -31352=>14928, -31392=>14929, -31395=>14930, -31411=>14931, -31419=>14932, -31420=>14933, -31430=>14934, -31495=>14935, -31508=>14936, -31527=>14937, -31537=>14938, -31559=>14939, -31566=>14940, -31584=>14941, -31593=>14942, -31597=>14943, -31602=>14944, -31633=>14945, -31663=>14946, -31703=>14947, -31705=>14948, -31755=>14949, -31759=>14950, -31776=>14951, -31782=>14952, -31793=>14953, -31798=>14954, -31825=>14955, -31833=>14956, -31847=>14957, -31854=>14958, -31856=>14959, -31932=>14960, -31935=>14961, -31944=>14962, -31945=>14963, -31959=>14964, -31961=>14965, -31965=>14966, -31979=>14967, -32007=>14968, -32008=>14969, -32009=>14970, -32019=>14971, -32029=>14972, -32035=>14973, -32065=>14974, -32083=>14975, -32089=>14976, -32093=>14977, -32122=>14978, -32134=>14979, -32139=>14980, -32140=>14981, -32204=>14982, -32235=>14983, -32241=>14984, -32249=>14985, -32264=>14986, -32273=>14987, -32277=>14988, -32288=>14989, -32327=>14990, -32354=>14991, -32366=>14992, -32371=>14993, -32397=>14994, -32401=>14995, -32408=>14996, -32580=>14997, -32591=>14998, -11947=>14999, -11954=>14999, -32594=>14999, -11953=>15000, -32595=>15000, -32609=>15001, -32657=>15002, -32703=>15003, -32718=>15004, -32735=>15005, -32741=>15006, -32748=>15007, -32750=>15008, -32751=>15009, -32762=>15010, -32782=>15011, -32785=>15012, -32788=>15013, -32804=>15014, -32806=>15015, -32826=>15016, -32828=>15017, -32864=>15018, -32881=>15019, -32885=>15020, -32926=>15021, -32934=>15022, -32939=>15023, -32983=>15024, -32984=>15025, -33046=>15026, -33048=>15027, -33082=>15028, -33098=>15029, -33100=>15030, -33153=>15031, -33156=>15032, -33204=>15033, -33231=>15034, -33273=>15035, -33283=>15036, -33313=>15037, -33330=>15038, -33332=>15039, -33350=>15040, -33355=>15041, -33359=>15042, -33422=>15043, -33454=>15044, -33463=>15045, -33470=>15046, -33478=>15047, -33534=>15048, -33603=>15049, -33617=>15050, -33621=>15051, -33670=>15052, -33677=>15053, -33682=>15054, -33688=>15055, -33705=>15056, -33727=>15057, -33728=>15058, -33770=>15059, -33807=>15060, -33809=>15061, -33866=>15062, -33910=>15063, -33960=>15064, -33967=>15065, -33984=>15066, -33986=>15067, -34032=>15068, -34045=>15069, -34060=>15070, -34100=>15071, -34142=>15072, -34191=>15073, -34231=>15074, -34254=>15075, -34221=>15076, -34322=>15077, -34345=>15078, -34386=>15079, -34403=>15080, -34412=>15081, -34415=>15082, -34426=>15083, -34445=>15084, -34449=>15085, -34456=>15086, -34471=>15087, -34472=>15088, -34554=>15089, -34557=>15090, -34571=>15091, -34579=>15092, -34585=>15093, -34590=>15094, -34600=>15095, -34622=>15096, -34673=>15097, -34696=>15098, -34713=>15099, -34732=>15100, -34733=>15101, -34741=>15102, -34774=>15103, -34795=>15104, -34797=>15105, -34817=>15106, -34822=>15108, -34827=>15109, -34836=>15110, -34844=>15111, -34902=>15112, -34911=>15113, -11970=>15114, -34916=>15114, -34968=>15115, -34986=>15116, -35005=>15117, -35006=>15118, -35018=>15119, -35026=>15120, -35035=>15121, -35056=>15122, -35057=>15123, -35078=>15124, -35096=>15125, -35097=>15126, -35098=>15127, -35111=>15128, -35120=>15129, -35134=>15130, -35195=>15131, -35284=>15132, -35286=>15133, -35301=>15134, -35313=>15135, -35335=>15136, -35343=>15137, -35349=>15138, -35362=>15139, -35406=>15140, -35455=>15141, -35572=>15142, -35615=>15143, -35639=>15144, -35651=>15145, -35652=>15146, -35668=>15147, -35740=>15148, -35742=>15149, -35911=>15150, -35924=>15151, -35955=>15152, -36004=>15153, -36057=>15154, -36065=>15155, -36088=>15156, -36094=>15157, -36123=>15158, -36201=>15159, -36204=>15160, -36228=>15161, -36237=>15162, -36245=>15163, -36262=>15164, -36294=>15165, -36302=>15166, -36324=>15167, -36332=>15168, -36384=>15169, -36427=>15170, -36460=>15171, -36464=>15172, -36474=>15173, -36498=>15174, -36526=>15175, -36531=>15176, -36561=>15177, -36564=>15178, -36601=>15179, -36631=>15180, -36662=>15181, -36774=>15182, -12193=>15183, -36789=>15183, -11981=>15184, -36790=>15184, -36832=>15186, -36836=>15187, -36854=>15188, -36866=>15189, -36908=>15190, -36932=>15191, -37000=>15192, -37013=>15193, -37017=>15194, -37019=>15195, -37026=>15196, -37044=>15197, -37079=>15198, -37085=>15199, -37108=>15200, -37143=>15201, -37148=>15202, -37169=>15203, -37178=>15204, -37181=>15205, -37192=>15206, -37211=>15207, -37217=>15208, -37220=>15209, -37262=>15210, -37278=>15211, -37288=>15212, -37293=>15213, -37294=>15214, -37298=>15215, -37308=>15216, -37360=>15217, -37367=>15218, -37371=>15219, -37383=>15220, -37416=>15221, -37427=>15222, -37432=>15223, -37443=>15224, -37447=>15225, -37455=>15226, -37472=>15227, -37570=>15228, -37579=>15229, -37580=>15230, -37599=>15231, -37645=>15232, -37653=>15233, -37663=>15234, -37671=>15235, -37703=>15236, -37714=>15237, -37738=>15239, -37741=>15240, -37787=>15241, -37818=>15242, -37801=>15243, -37825=>15244, -37834=>15245, -37858=>15246, -37882=>15247, -37885=>15248, -37903=>15249, -37940=>15250, -37951=>15251, -37973=>15252, -37995=>15253, -38002=>15254, -11986=>15255, -38264=>15255, -38310=>15256, -38313=>15257, -38324=>15259, -38333=>15260, -38362=>15261, -11983=>15262, -11990=>15262, -38429=>15262, -38465=>15263, -38488=>15264, -38532=>15265, -38564=>15266, -38569=>15267, -38610=>15268, -195060=>15269, -38622=>15270, -38633=>15271, -38641=>15272, -38658=>15273, -38665=>15274, -38746=>15275, -38755=>15276, -38766=>15277, -38771=>15278, -38810=>15279, -38818=>15280, -38837=>15281, -38838=>15282, -38873=>15283, -38878=>15284, -38900=>15285, -38922=>15286, -38926=>15287, -38942=>15288, -38947=>15289, -38955=>15290, -38974=>15291, -38994=>15292, -38995=>15293, -39001=>15294, -39020=>15295, -39096=>15296, -39098=>15297, -39103=>15298, -39112=>15299, -39141=>15300, -39218=>15301, -39219=>15302, -39232=>15303, -39245=>15304, -39260=>15305, -39263=>15306, -39345=>15307, -39353=>15308, -39354=>15309, -39369=>15310, -39426=>15311, -39446=>15312, -39460=>15313, -39463=>15314, -39469=>15315, -39470=>15316, -39478=>15317, -39480=>15318, -39498=>15319, -39510=>15320, -39605=>15321, -39606=>15322, -39673=>15323, -39683=>15324, -39712=>15325, -39731=>15326, -39732=>15327, -39795=>15328, -39801=>15329, -39847=>15330, -39873=>15331, -39879=>15332, -39895=>15333, -39911=>15334, -39915=>15335, -39927=>15336, -39930=>15337, -39933=>15338, -39947=>15339, -39975=>15340, -39978=>15341, -39990=>15342, -40001=>15343, -40019=>15344, -40035=>15345, -40048=>15346, -40055=>15347, -40194=>15348, -40258=>15349, -40263=>15350, -40291=>15351, -40297=>15352, -40316=>15353, -40318=>15354, -40333=>15355, -40369=>15356, -40387=>15357, -40391=>15358, -40406=>15359, -40415=>15360, -40427=>15361, -40436=>15362, -40469=>15363, -40477=>15364, -40612=>15365, -40616=>15366, -40620=>15367, -40679=>15368, -40686=>15369, -40720=>15370, -40722=>15371, -40727=>15372, -40729=>15373, -40751=>15374, -40759=>15375, -40761=>15376, -40769=>15377, -40773=>15378, -40791=>15379, -40808=>15380, -40817=>15381, -40821=>15382, -40848=>15383, -40852=>15384, -40866=>15385, -13317=>15387, -194564=>15388, -22048=>15389, -24267=>15390, -11925=>15391, -144954=>15393, -28665=>15395, -28390=>15396, -29107=>15397, -11940=>15398, -64073=>15398, -11980=>15403, -64102=>15403, -23986=>15405, -20435=>15407, -20697=>15408, -20720=>15409, -20931=>15410, -22134=>15411, -27220=>15412, -27905=>15413, -28112=>15414, -28226=>15415, -28377=>15416, -29668=>15417, -29729=>15418, -30060=>15419, -30801=>15420, -34805=>15421, -144382=>15422, -29608=>15423, -15091=>15424, -13531=>15425, -17420=>15426, -16010=>15427, -40893=>15429, -19432=>15430, -40892=>15431, -16090=>15432, -15138=>15433, -40894=>15434, -17786=>15435, -16531=>15436, -18021=>15438, -16643=>15439, -17043=>15440, -18094=>15441, -13448=>15442, -140809=>15443, -63584=>15444, -63585=>15445, -63586=>15446, -63610=>15447, -63615=>15448, -8836=>15472, -8837=>15473, -8842=>15474, -8843=>15475, -8713=>15476, -8965=>15478, -8966=>15479, -8741=>15489, -8742=>15490, -8802=>15505, -8773=>15507, -8776=>15508, -8822=>15509, -8823=>15510, -8487=>15515, -8922=>15725, -8923=>15726, -8533=>15727, -8984=>15728, -7742=>15729, -7743=>15730, -504=>15731, -505=>15732, -470=>15733, -472=>15734, -474=>15735, -476=>15736, -260=>15737, -728=>15738, -317=>15739, -346=>15740, -350=>15741, -356=>15742, -377=>15743, -379=>15744, -261=>15745, -731=>15746, -318=>15747, -347=>15748, -711=>15749, -351=>15750, -357=>15751, -378=>15752, -733=>15753, -380=>15754, -340=>15755, -258=>15756, -313=>15757, -262=>15758, -268=>15759, -280=>15760, -270=>15761, -323=>15762, -327=>15763, -336=>15764, -344=>15765, -368=>15766, -354=>15767, -341=>15768, -259=>15769, -314=>15770, -263=>15771, -269=>15772, -281=>15773, -271=>15774, -273=>15775, -324=>15776, -328=>15777, -337=>15778, -345=>15779, -369=>15780, -355=>15781, -729=>15782, -264=>15783, -284=>15784, -292=>15785, -308=>15786, -348=>15787, -364=>15788, -265=>15789, -285=>15790, -293=>15791, -309=>15792, -349=>15793, -365=>15794, -625=>15795, -651=>15796, -638=>15797, -620=>15798, -622=>15799, -633=>15800, -648=>15801, -598=>15802, -627=>15803, -637=>15804, -642=>15805, -656=>15806, -635=>15807, -621=>15808, -607=>15809, -626=>15810, -669=>15811, -654=>15812, -609=>15813, -624=>15814, -641=>15815, -295=>15816, -661=>15817, -660=>15818, -614=>15819, -664=>15820, -450=>15821, -595=>15822, -599=>15823, -644=>15824, -608=>15825, -403=>15826, -616=>15827, -649=>15828, -600=>15829, -604=>15830, -606=>15831, -592=>15832, -623=>15833, -650=>15834, -612=>15835, -594=>15836, -653=>15837, -613=>15838, -674=>15839, -673=>15840, -597=>15841, -657=>15842, -634=>15843, -615=>15844, -865=>15845, -712=>15846, -716=>15847, -721=>15848, -8255=>15849, -783=>15850, -741=>15851, -742=>15852, -743=>15853, -744=>15854, -745=>15855, -805=>15858, -812=>15859, -825=>15860, -796=>15861, -799=>15862, -800=>15863, -829=>15864, -809=>15865, -815=>15866, -734=>15867, -804=>15868, -816=>15869, -828=>15870, -820=>15871, -797=>15872, -798=>15873, -792=>15874, -793=>15875, -810=>15876, -826=>15877, -827=>15878, -794=>15879, -610=>15883, -611=>15884, -618=>15885, -628=>15886, -630=>15887, -632=>15888, -640=>15889, -655=>15890, -665=>15891, -668=>15892, -671=>15893, -688=>15894, -690=>15895, -695=>15896, -705=>15897, -736=>15898, -737=>15899, -8862=>15906, -12348=>16194, -12543=>16195, -12310=>16197, -12311=>16198, -9838=>16199, -9835=>16200, -10548=>16201, -10549=>16202, -10687=>16203, -12448=>16205, -10746=>16207, -10747=>16208, -962=>16222, -9461=>16223, -9462=>16224, -9463=>16225, -9464=>16226, -9465=>16227, -9466=>16228, -9467=>16229, -9468=>16230, -9469=>16231, -9470=>16232, -9750=>16233, -9751=>16234, -9649=>16235, -12784=>16236, -12785=>16237, -12786=>16238, -12787=>16239, -12788=>16240, -12789=>16241, -12790=>16242, -12791=>16243, -12792=>16244, -12793=>16245, -12794=>16247, -12795=>16248, -12796=>16249, -12797=>16250, -12798=>16251, -12799=>16252, -9150=>16253, -9151=>16254, -9152=>16255, -9153=>16256, -9154=>16257, -9155=>16258, -9156=>16259, -9157=>16260, -9158=>16261, -9159=>16262, -9160=>16263, -9161=>16264, -9162=>16265, -9163=>16266, -9164=>16267, -10003=>16270, -9251=>16272, -9166=>16273, -9680=>16274, -9681=>16275, -9682=>16276, -9683=>16277, -8263=>16278, -8264=>16279, -8273=>16281, -8258=>16282, -12688=>16283, -12689=>16284, -12690=>16285, -12691=>16286, -12692=>16287, -12693=>16288, -12694=>16289, -12695=>16290, -12696=>16291, -12697=>16292, -12698=>16293, -12699=>16294, -12700=>16295, -12701=>16296, -12702=>16297, -12703=>16298, -9136=>16312, -9137=>16313, -9842=>16314, -9843=>16315, -9844=>16316, -9845=>16317, -9846=>16318, -9847=>16319, -9848=>16320, -9849=>16321, -9850=>16322, -9851=>16323, -9852=>16324, -9853=>16325, -12441=>16326, -12442=>16327, -8413=>16328, -20296=>16779, -20319=>16780, -20330=>16781, -20332=>16782, -20494=>16783, -20504=>16784, -20545=>16785, -20722=>16786, -20688=>16787, -20742=>16788, -20739=>16789, -20789=>16790, -20821=>16791, -20823=>16792, -13493=>16793, -20938=>16794, -20962=>16795, -21079=>16796, -21196=>16797, -21206=>16798, -21243=>16799, -21276=>16800, -21347=>16801, -21405=>16802, -21522=>16803, -21631=>16804, -21640=>16805, -21840=>16806, -21889=>16807, -21933=>16808, -21966=>16809, -22075=>16810, -22174=>16811, -22185=>16812, -22195=>16813, -22391=>16814, -22396=>16815, -135963=>16816, -22479=>16817, -22500=>16818, -22628=>16819, -22665=>16820, -136302=>16821, -22738=>16822, -22752=>16823, -34369=>16824, -22923=>16825, -22930=>16826, -22979=>16827, -23059=>16828, -23143=>16829, -23159=>16830, -23172=>16831, -23236=>16832, -137405=>16833, -23421=>16834, -23443=>16835, -23570=>16836, -64060=>16837, -136884=>16838, -23674=>16839, -23695=>16840, -23711=>16841, -23715=>16842, -23722=>16843, -23760=>16844, -138804=>16845, -23821=>16846, -23879=>16847, -23937=>16848, -23972=>16849, -23975=>16850, -24011=>16851, -24158=>16852, -24313=>16853, -24320=>16854, -24322=>16855, -24355=>16856, -24381=>16857, -24404=>16858, -24445=>16859, -24589=>16860, -24596=>16861, -24600=>16862, -24629=>16863, -24647=>16864, -24733=>16865, -24788=>16866, -24797=>16867, -24875=>16868, -25020=>16869, -25017=>16870, -25122=>16871, -25178=>16872, -25199=>16873, -25302=>16874, -25468=>16875, -25573=>16876, -25721=>16877, -25796=>16878, -25808=>16879, -25897=>16880, -26013=>16881, -26170=>16882, -26146=>16883, -26155=>16884, -26160=>16885, -26163=>16886, -26184=>16887, -143812=>16888, -26231=>16889, -26232=>16890, -26253=>16891, -26299=>16892, -26331=>16893, -26344=>16894, -26439=>16895, -26497=>16896, -26515=>16897, -26520=>16898, -26523=>16899, -26620=>16900, -26653=>16901, -26787=>16902, -26890=>16903, -26953=>16904, -144836=>16905, -26946=>16906, -26980=>16907, -27045=>16908, -27087=>16909, -15286=>16910, -15299=>16911, -27113=>16912, -27125=>16913, -145215=>16914, -27195=>16915, -145251=>16916, -27284=>16917, -27301=>16918, -15375=>16919, -27419=>16920, -27436=>16921, -27495=>16922, -27561=>16923, -27565=>16924, -27607=>16925, -27647=>16926, -27653=>16927, -27764=>16928, -27800=>16929, -27899=>16930, -27846=>16931, -27953=>16932, -27961=>16933, -27967=>16934, -27992=>16935, -28052=>16936, -28074=>16937, -28123=>16938, -28125=>16939, -28228=>16940, -28254=>16941, -28337=>16942, -28353=>16943, -28432=>16944, -28505=>16945, -28513=>16946, -28542=>16947, -28556=>16948, -28576=>16949, -28604=>16950, -28615=>16951, -28618=>16952, -28656=>16953, -28750=>16954, -28789=>16955, -28836=>16956, -28900=>16957, -28971=>16958, -28958=>16959, -28974=>16960, -29009=>16961, -29032=>16962, -29061=>16963, -29063=>16964, -29114=>16965, -29124=>16966, -29205=>16967, -15935=>16968, -29339=>16969, -149489=>16970, -29479=>16971, -29520=>16972, -29542=>16973, -29602=>16974, -29739=>16975, -29766=>16976, -29794=>16977, -29805=>16978, -29862=>16979, -29865=>16980, -29897=>16981, -29951=>16982, -29975=>16983, -16242=>16984, -30158=>16985, -30210=>16986, -30216=>16987, -30308=>16988, -30337=>16989, -30365=>16990, -30378=>16991, -30390=>16992, -30414=>16993, -30420=>16994, -30438=>16995, -30449=>16996, -30474=>16997, -30489=>16998, -30541=>16999, -30542=>17000, -30586=>17001, -30592=>17002, -30612=>17003, -30688=>17004, -152718=>17005, -30787=>17006, -30830=>17007, -30896=>17008, -152846=>17009, -30893=>17010, -30976=>17011, -31004=>17012, -31022=>17013, -31028=>17014, -31046=>17015, -31097=>17016, -31176=>17017, -153457=>17018, -31188=>17019, -31198=>17020, -31211=>17021, -31213=>17022, -31365=>17023, -154052=>17024, -31438=>17025, -31485=>17026, -31506=>17027, -31533=>17028, -31547=>17029, -31599=>17030, -31745=>17031, -31795=>17032, -155041=>17033, -31853=>17034, -31865=>17035, -31887=>17036, -31892=>17037, -31904=>17038, -31957=>17039, -32049=>17040, -32092=>17041, -32131=>17042, -32166=>17043, -32194=>17044, -32296=>17045, -32663=>17046, -32731=>17047, -32821=>17048, -32823=>17049, -32970=>17050, -32992=>17051, -33011=>17052, -33120=>17053, -33127=>17054, -33128=>17055, -33133=>17056, -33211=>17057, -33226=>17058, -33239=>17059, -17499=>17060, -33376=>17061, -33396=>17062, -158463=>17063, -33441=>17064, -33443=>17065, -33444=>17066, -33449=>17067, -33471=>17068, -33493=>17069, -33533=>17070, -33536=>17071, -33570=>17072, -33581=>17073, -33594=>17074, -33607=>17075, -33661=>17076, -33703=>17077, -33743=>17078, -33745=>17079, -33761=>17080, -33793=>17081, -33798=>17082, -33887=>17083, -33904=>17084, -33907=>17085, -33925=>17086, -33950=>17087, -33978=>17088, -159296=>17089, -34098=>17090, -34078=>17091, -34095=>17092, -34148=>17093, -34170=>17094, -34188=>17095, -34210=>17096, -34251=>17097, -34285=>17098, -34303=>17099, -34308=>17100, -34309=>17101, -34320=>17102, -159988=>17103, -34328=>17104, -34360=>17105, -34391=>17106, -34402=>17107, -17821=>17108, -34421=>17109, -34488=>17110, -34556=>17111, -34695=>17112, -17898=>17113, -34826=>17114, -34832=>17115, -35022=>17116, -161412=>17117, -35122=>17118, -35129=>17119, -35136=>17120, -35220=>17121, -35318=>17122, -35399=>17123, -35421=>17124, -35425=>17125, -35445=>17126, -35536=>17127, -35654=>17128, -35673=>17129, -35689=>17130, -35741=>17131, -35913=>17132, -35944=>17133, -36271=>17134, -36305=>17135, -36311=>17136, -36387=>17137, -36413=>17138, -36475=>17139, -164471=>17140, -18500=>17141, -36602=>17142, -36638=>17143, -36653=>17144, -36692=>17145, -164813=>17146, -36840=>17147, -36846=>17148, -36872=>17149, -36909=>17150, -37015=>17151, -37043=>17152, -37054=>17153, -37060=>17154, -37061=>17155, -37063=>17156, -37103=>17157, -37140=>17158, -37142=>17159, -37154=>17160, -37155=>17161, -37167=>17162, -37172=>17163, -37251=>17164, -37361=>17165, -37705=>17166, -37732=>17167, -37733=>17168, -37795=>17169, -37855=>17170, -37892=>17171, -37939=>17172, -37962=>17173, -37987=>17174, -38001=>17175, -38286=>17176, -38303=>17177, -38316=>17178, -38326=>17179, -38347=>17180, -38352=>17181, -38355=>17182, -18864=>17183, -38366=>17184, -38565=>17185, -38639=>17186, -38734=>17187, -38805=>17188, -38830=>17189, -38842=>17190, -38849=>17191, -38857=>17192, -38875=>17193, -38998=>17194, -39143=>17195, -39256=>17196, -39427=>17197, -39617=>17198, -39619=>17199, -39630=>17200, -39638=>17201, -39682=>17202, -39688=>17203, -19479=>17204, -39725=>17205, -39774=>17206, -39782=>17207, -39812=>17208, -39818=>17209, -39838=>17210, -39886=>17211, -39909=>17212, -39928=>17213, -39971=>17214, -40015=>17215, -40016=>17216, -40037=>17217, -40221=>17218, -40222=>17219, -40259=>17220, -40274=>17221, -40330=>17222, -40342=>17223, -40384=>17224, -40364=>17225, -40380=>17226, -172432=>17227, -40423=>17228, -40455=>17229, -40606=>17230, -40623=>17231, -40855=>17232, -131209=>17233, -19970=>17234, -19983=>17235, -19986=>17236, -20009=>17237, -20014=>17238, -20039=>17239, -131234=>17240, -20049=>17241, -13318=>17242, -131236=>17243, -20073=>17244, -20125=>17245, -13356=>17246, -20156=>17247, -20163=>17248, -20168=>17249, -20203=>17250, -20186=>17251, -20209=>17252, -20213=>17253, -20246=>17254, -20324=>17255, -20279=>17256, -20286=>17257, -20312=>17258, -131603=>17259, -20343=>17260, -20344=>17261, -20354=>17262, -20357=>17263, -20454=>17264, -20402=>17265, -20421=>17266, -20427=>17267, -20434=>17268, -13418=>17269, -20466=>17270, -20499=>17271, -20508=>17272, -20558=>17273, -20563=>17274, -20579=>17275, -20643=>17276, -20616=>17277, -20626=>17278, -20627=>17279, -20629=>17280, -20650=>17281, -131883=>17282, -20657=>17283, -20666=>17284, -20667=>17285, -20676=>17286, -20679=>17287, -20723=>17288, -131969=>17289, -20686=>17290, -131953=>17291, -20692=>17292, -20705=>17293, -13458=>17294, -132089=>17295, -20759=>17296, -132170=>17297, -20832=>17298, -132361=>17299, -20851=>17300, -20867=>17301, -20875=>17302, -13500=>17303, -20888=>17304, -20899=>17305, -20909=>17306, -13511=>17307, -132566=>17308, -20979=>17309, -21010=>17310, -21014=>17311, -132943=>17312, -21077=>17313, -21084=>17314, -21100=>17315, -21111=>17316, -21124=>17317, -21122=>17318, -133127=>17319, -21144=>17320, -133178=>17321, -21156=>17322, -21178=>17323, -21179=>17324, -21194=>17325, -21201=>17326, -133305=>17327, -21239=>17328, -21301=>17329, -21314=>17330, -133500=>17331, -133533=>17332, -21351=>17333, -21370=>17334, -21412=>17335, -21428=>17336, -133843=>17337, -21431=>17338, -21440=>17339, -133917=>17340, -13661=>17341, -13662=>17342, -21461=>17343, -13667=>17344, -21492=>17345, -21540=>17346, -21544=>17347, -13678=>17348, -21571=>17349, -21602=>17350, -21612=>17351, -21653=>17352, -21664=>17353, -21670=>17354, -21678=>17355, -21687=>17356, -21690=>17357, -21699=>17358, -134469=>17359, -21740=>17360, -21743=>17361, -21745=>17362, -21747=>17363, -21760=>17364, -21761=>17365, -21769=>17366, -21820=>17367, -21825=>17368, -13734=>17369, -21831=>17370, -13736=>17371, -21860=>17372, -134625=>17373, -21885=>17374, -21890=>17375, -21905=>17376, -13765=>17377, -21970=>17378, -134805=>17379, -134765=>17380, -21951=>17381, -21961=>17382, -21964=>17383, -21969=>17384, -21981=>17385, -13786=>17386, -21986=>17387, -134756=>17388, -21993=>17389, -22056=>17390, -135007=>17391, -22023=>17392, -22032=>17393, -22064=>17394, -13812=>17395, -22077=>17396, -22080=>17397, -22087=>17398, -22110=>17399, -22112=>17400, -22125=>17401, -13829=>17402, -22152=>17403, -22156=>17404, -22173=>17405, -22184=>17406, -22194=>17407, -22213=>17408, -22221=>17409, -22239=>17410, -22248=>17411, -22262=>17412, -22263=>17413, -135681=>17414, -135765=>17415, -22313=>17416, -135803=>17417, -22341=>17418, -22342=>17419, -22349=>17420, -135796=>17421, -22376=>17422, -22383=>17423, -22387=>17424, -22388=>17425, -22389=>17426, -22395=>17427, -135908=>17428, -135895=>17429, -22426=>17430, -22429=>17431, -22430=>17432, -22440=>17433, -22487=>17434, -135933=>17435, -22476=>17436, -135990=>17437, -136004=>17438, -22494=>17439, -22512=>17440, -13898=>17441, -22520=>17442, -22523=>17443, -22525=>17444, -22532=>17445, -22558=>17446, -22567=>17447, -22585=>17448, -136132=>17449, -22601=>17450, -22604=>17451, -22631=>17452, -22666=>17453, -22667=>17454, -22669=>17455, -22671=>17456, -22672=>17457, -22676=>17458, -22685=>17459, -22698=>17460, -22705=>17461, -136301=>17462, -22723=>17463, -22733=>17464, -22754=>17465, -22771=>17466, -22772=>17467, -22789=>17468, -22790=>17469, -22797=>17470, -22804=>17471, -136663=>17472, -13969=>17473, -22845=>17474, -13977=>17475, -22854=>17476, -13974=>17477, -158761=>17478, -22879=>17479, -136775=>17480, -22901=>17481, -22902=>17482, -22908=>17483, -22943=>17484, -22958=>17485, -22972=>17486, -22984=>17487, -22989=>17488, -23006=>17489, -23015=>17490, -23022=>17491, -136966=>17492, -137026=>17493, -14031=>17494, -23053=>17495, -23063=>17496, -23079=>17497, -23085=>17498, -23141=>17499, -23162=>17500, -23179=>17501, -23196=>17502, -23199=>17503, -23200=>17504, -23202=>17505, -23217=>17506, -23221=>17507, -23226=>17508, -23231=>17509, -23258=>17510, -23260=>17511, -23269=>17512, -23280=>17513, -23278=>17514, -23285=>17515, -23304=>17516, -23319=>17517, -23348=>17518, -23372=>17519, -23378=>17520, -23400=>17521, -23407=>17522, -23425=>17523, -23428=>17524, -137667=>17525, -23446=>17526, -23468=>17527, -14177=>17528, -14178=>17529, -23502=>17530, -23510=>17531, -14188=>17532, -14187=>17533, -23537=>17534, -23549=>17535, -14197=>17536, -23555=>17537, -23593=>17538, -138326=>17539, -23647=>17540, -23655=>17541, -23656=>17542, -23664=>17543, -138541=>17544, -138565=>17545, -138616=>17546, -138594=>17547, -23688=>17548, -23690=>17549, -14273=>17550, -138657=>17551, -138652=>17552, -23712=>17553, -23714=>17554, -23719=>17555, -138642=>17556, -23725=>17557, -23733=>17558, -138679=>17559, -23753=>17560, -138720=>17561, -138803=>17562, -23814=>17563, -23824=>17564, -23851=>17565, -23837=>17566, -23840=>17567, -23857=>17568, -23865=>17569, -14312=>17570, -23905=>17571, -23914=>17572, -14324=>17573, -23920=>17574, -139038=>17575, -14333=>17576, -23944=>17577, -14336=>17578, -23959=>17579, -23984=>17580, -23988=>17581, -139126=>17582, -24017=>17583, -24023=>17584, -139258=>17585, -24036=>17586, -24041=>17587, -14383=>17588, -14390=>17589, -14400=>17590, -24095=>17591, -24126=>17592, -24137=>17593, -14428=>17594, -24150=>17595, -14433=>17596, -24173=>17597, -24174=>17598, -139643=>17599, -24229=>17600, -24236=>17601, -24249=>17602, -24262=>17603, -24281=>17604, -140062=>17605, -24317=>17606, -24328=>17607, -140205=>17608, -24350=>17609, -24391=>17610, -24419=>17611, -24434=>17612, -24446=>17613, -24463=>17614, -24482=>17615, -24519=>17616, -24523=>17617, -24530=>17618, -24531=>17619, -24532=>17620, -24546=>17621, -24558=>17622, -24559=>17623, -24563=>17624, -14615=>17625, -24610=>17626, -24612=>17627, -14618=>17628, -24652=>17629, -24725=>17630, -24744=>17631, -141043=>17632, -24753=>17633, -24766=>17634, -24776=>17635, -24793=>17636, -24814=>17637, -24821=>17638, -24848=>17639, -24857=>17640, -24862=>17641, -24890=>17642, -14703=>17643, -24897=>17644, -24902=>17645, -24928=>17646, -141403=>17647, -24978=>17648, -24979=>17649, -24983=>17650, -24997=>17651, -25005=>17652, -141483=>17653, -25045=>17654, -25053=>17655, -25077=>17656, -141711=>17657, -25123=>17658, -25170=>17659, -25185=>17660, -25188=>17661, -25211=>17662, -25197=>17663, -25203=>17664, -25241=>17665, -25301=>17666, -142008=>17667, -25341=>17668, -25347=>17669, -25360=>17670, -142159=>17671, -142160=>17672, -25394=>17673, -25397=>17674, -25403=>17675, -25404=>17676, -25409=>17677, -25412=>17678, -25422=>17679, -142150=>17680, -25433=>17681, -142365=>17682, -142246=>17683, -25452=>17684, -25497=>17685, -142372=>17686, -25492=>17687, -25533=>17688, -25556=>17689, -25557=>17690, -25568=>17691, -25579=>17692, -25580=>17693, -25586=>17694, -25630=>17695, -25637=>17696, -25641=>17697, -25647=>17698, -25690=>17699, -25693=>17700, -25715=>17701, -25725=>17702, -25735=>17703, -25745=>17704, -25759=>17705, -25803=>17706, -25804=>17707, -25813=>17708, -25815=>17709, -142817=>17710, -25828=>17711, -25855=>17712, -14958=>17713, -25871=>17714, -25876=>17715, -14963=>17716, -25886=>17717, -25906=>17718, -25924=>17719, -25940=>17720, -25963=>17721, -25978=>17722, -25988=>17723, -25994=>17724, -26034=>17725, -26037=>17726, -26040=>17727, -26047=>17728, -26057=>17729, -26068=>17730, -15062=>17731, -26105=>17732, -26108=>17733, -26116=>17734, -26120=>17735, -26145=>17736, -26154=>17737, -26181=>17738, -26193=>17739, -26190=>17740, -15082=>17741, -143811=>17742, -143861=>17743, -143798=>17744, -26218=>17745, -26220=>17746, -26221=>17747, -26235=>17748, -26240=>17749, -26256=>17750, -26258=>17751, -15118=>17752, -26285=>17753, -26289=>17754, -26293=>17755, -15130=>17756, -15132=>17757, -15063=>17758, -26369=>17759, -26386=>17760, -144242=>17761, -26393=>17762, -144339=>17763, -144338=>17764, -26445=>17765, -26452=>17766, -26461=>17767, -144336=>17768, -144356=>17769, -144341=>17770, -26484=>17771, -144346=>17772, -26514=>17773, -144351=>17774, -33635=>17775, -26640=>17776, -26563=>17777, -26568=>17778, -26578=>17779, -26587=>17780, -26615=>17781, -144458=>17782, -144465=>17783, -144459=>17784, -26648=>17785, -26655=>17786, -26669=>17787, -144485=>17788, -26675=>17789, -26683=>17790, -26686=>17791, -26693=>17792, -26697=>17793, -26700=>17794, -26709=>17795, -26711=>17796, -15223=>17797, -26731=>17798, -26734=>17799, -26748=>17800, -26754=>17801, -26768=>17802, -26774=>17803, -15213=>17804, -26776=>17805, -26777=>17806, -26778=>17807, -26780=>17808, -26794=>17809, -26795=>17810, -26804=>17811, -26811=>17812, -26875=>17813, -144612=>17814, -144730=>17815, -26819=>17816, -26821=>17817, -26828=>17818, -26841=>17819, -26852=>17820, -26853=>17821, -26860=>17822, -26871=>17823, -26883=>17824, -26887=>17825, -15239=>17826, -144788=>17827, -15245=>17828, -26950=>17829, -26985=>17830, -26988=>17831, -27002=>17832, -27026=>17833, -15268=>17834, -27030=>17835, -27056=>17836, -27066=>17837, -27068=>17838, -27072=>17839, -27089=>17840, -144953=>17841, -144967=>17842, -144952=>17843, -27107=>17844, -27118=>17845, -27119=>17846, -27123=>17847, -15309=>17848, -27124=>17849, -27134=>17850, -27153=>17851, -27162=>17852, -27165=>17853, -145180=>17854, -27186=>17855, -27187=>17856, -27199=>17857, -27209=>17858, -27258=>17859, -27214=>17860, -27218=>17861, -27236=>17862, -145164=>17863, -27275=>17864, -15344=>17865, -27297=>17866, -145252=>17867, -27307=>17868, -27325=>17869, -27334=>17870, -27348=>17871, -27344=>17872, -27357=>17873, -145407=>17874, -145383=>17875, -27377=>17876, -27378=>17877, -27379=>17878, -27389=>17879, -145444=>17880, -27403=>17881, -27407=>17882, -27408=>17883, -27409=>17884, -145469=>17885, -27415=>17886, -15398=>17887, -27439=>17888, -27466=>17889, -27480=>17890, -27500=>17891, -27509=>17892, -11934=>17893, -27514=>17893, -27521=>17894, -27547=>17895, -27566=>17896, -146072=>17897, -27581=>17898, -27591=>17899, -27592=>17900, -27593=>17901, -27610=>17902, -27622=>17903, -27623=>17904, -27630=>17905, -27650=>17906, -27658=>17907, -27662=>17908, -27702=>17909, -146559=>17910, -27725=>17911, -27739=>17912, -27757=>17913, -27780=>17914, -27785=>17915, -15555=>17916, -27796=>17917, -27799=>17918, -27821=>17919, -27842=>17920, -15570=>17921, -27868=>17922, -27881=>17923, -27885=>17924, -146688=>17925, -27904=>17926, -27940=>17927, -27942=>17928, -27943=>17929, -27751=>17930, -27951=>17931, -27964=>17932, -27995=>17933, -28000=>17934, -28016=>17935, -28032=>17936, -28033=>17937, -28042=>17938, -28045=>17939, -28049=>17940, -28056=>17941, -146752=>17942, -146938=>17943, -146937=>17944, -146899=>17945, -28075=>17946, -28078=>17947, -28084=>17948, -28098=>17949, -27956=>17950, -28104=>17951, -28110=>17952, -28127=>17953, -28150=>17954, -28214=>17955, -28190=>17956, -15633=>17957, -28210=>17958, -28232=>17959, -28233=>17960, -28235=>17961, -28236=>17962, -28239=>17963, -28243=>17964, -28244=>17965, -28247=>17966, -28259=>17967, -15646=>17968, -28307=>17969, -28327=>17970, -28340=>17971, -28355=>17972, -28469=>17973, -28395=>17974, -28409=>17975, -28411=>17976, -28426=>17977, -28428=>17978, -28440=>17979, -28453=>17980, -28470=>17981, -28476=>17982, -147326=>17983, -28498=>17984, -28503=>17985, -28512=>17986, -28520=>17987, -28560=>17988, -28566=>17989, -28606=>17990, -28575=>17991, -28581=>17992, -28591=>17993, -15716=>17994, -28616=>17995, -28617=>17996, -28649=>17997, -147606=>17998, -28668=>17999, -28672=>18000, -28682=>18001, -28707=>18002, -147715=>18003, -28730=>18004, -28739=>18005, -28743=>18006, -28747=>18007, -15770=>18008, -28773=>18009, -28777=>18010, -28782=>18011, -28790=>18012, -28806=>18013, -28823=>18014, -147910=>18015, -28831=>18016, -28849=>18017, -147966=>18018, -28908=>18019, -28874=>18020, -28881=>18021, -28931=>18022, -28934=>18023, -28936=>18024, -28940=>18025, -15808=>18026, -28975=>18027, -29008=>18028, -29011=>18029, -29022=>18030, -15828=>18031, -29078=>18032, -29056=>18033, -29083=>18034, -29088=>18035, -29090=>18036, -29102=>18037, -29103=>18038, -148412=>18039, -29145=>18040, -29148=>18041, -29191=>18042, -15877=>18043, -29236=>18044, -29241=>18045, -29250=>18046, -29271=>18047, -29283=>18048, -149033=>18049, -29294=>18050, -29295=>18051, -29304=>18052, -29311=>18053, -29326=>18054, -149157=>18055, -29358=>18056, -29360=>18057, -29377=>18058, -15968=>18059, -29388=>18060, -15974=>18061, -15976=>18062, -29427=>18063, -29434=>18064, -29447=>18065, -29458=>18066, -29464=>18067, -29465=>18068, -16003=>18069, -29497=>18070, -29484=>18071, -29491=>18072, -29501=>18073, -29522=>18074, -16020=>18075, -29547=>18076, -149654=>18077, -29550=>18078, -29551=>18079, -29553=>18080, -29569=>18081, -29578=>18082, -29588=>18083, -29592=>18084, -29596=>18085, -29605=>18086, -29625=>18087, -29631=>18088, -29637=>18089, -29643=>18090, -29665=>18091, -29671=>18092, -29689=>18093, -29715=>18094, -29690=>18095, -29697=>18096, -29779=>18097, -29760=>18098, -29763=>18099, -29778=>18100, -29789=>18101, -29825=>18102, -29832=>18103, -150093=>18104, -29842=>18105, -29847=>18106, -29849=>18107, -29857=>18108, -29861=>18109, -29866=>18110, -29881=>18111, -29883=>18112, -29882=>18113, -29910=>18114, -29912=>18115, -29931=>18116, -150358=>18117, -29946=>18118, -150383=>18119, -29984=>18120, -29988=>18121, -29994=>18122, -16215=>18123, -150550=>18124, -30013=>18125, -30014=>18126, -30016=>18127, -30024=>18128, -30032=>18129, -30034=>18130, -30066=>18131, -30065=>18132, -30074=>18133, -30077=>18134, -30078=>18135, -30092=>18136, -16245=>18137, -30114=>18138, -16247=>18139, -30128=>18140, -30135=>18141, -30143=>18142, -30144=>18143, -30150=>18144, -30159=>18145, -30163=>18146, -30173=>18147, -30175=>18148, -30176=>18149, -30183=>18150, -30190=>18151, -30193=>18152, -30211=>18153, -30232=>18154, -30215=>18155, -30223=>18156, -16302=>18157, -151054=>18158, -30227=>18159, -30235=>18160, -30236=>18161, -151095=>18162, -30245=>18163, -30248=>18164, -30268=>18165, -30259=>18166, -151146=>18167, -16329=>18168, -30273=>18169, -151179=>18170, -30281=>18171, -30293=>18172, -16343=>18173, -30318=>18174, -30357=>18175, -30369=>18176, -30368=>18177, -30375=>18178, -30376=>18179, -30383=>18180, -151626=>18181, -30409=>18182, -151637=>18183, -30440=>18184, -151842=>18185, -30487=>18186, -30490=>18187, -30509=>18188, -30517=>18189, -151977=>18190, -16441=>18191, -152037=>18192, -152013=>18193, -30552=>18194, -152094=>18195, -30588=>18196, -152140=>18197, -16472=>18198, -30618=>18199, -30623=>18200, -30626=>18201, -30628=>18202, -30686=>18203, -30687=>18204, -30692=>18205, -30698=>18206, -30700=>18207, -30715=>18208, -152622=>18209, -30725=>18210, -30729=>18211, -30733=>18212, -30745=>18213, -30764=>18214, -30791=>18215, -30826=>18216, -152793=>18217, -30858=>18218, -30868=>18219, -30884=>18220, -30877=>18221, -30879=>18222, -30907=>18223, -30933=>18224, -30950=>18225, -30969=>18226, -30970=>18227, -30974=>18228, -152999=>18229, -30992=>18230, -31003=>18231, -31013=>18232, -31050=>18233, -31064=>18234, -16645=>18235, -31079=>18236, -31090=>18237, -31125=>18238, -31137=>18239, -31145=>18240, -31156=>18241, -31170=>18242, -31175=>18243, -31180=>18244, -31181=>18245, -31190=>18246, -16712=>18247, -153513=>18248, -153524=>18249, -16719=>18250, -31242=>18251, -31253=>18252, -31259=>18253, -16739=>18254, -31288=>18255, -31303=>18256, -31318=>18257, -31321=>18258, -31324=>18259, -31327=>18260, -31335=>18261, -31338=>18262, -31349=>18263, -31362=>18264, -31370=>18265, -31376=>18266, -31404=>18267, -154068=>18268, -16820=>18269, -31417=>18270, -31422=>18271, -16831=>18272, -31436=>18273, -31464=>18274, -31476=>18275, -154340=>18276, -154339=>18277, -154353=>18278, -31549=>18279, -31530=>18280, -31534=>18281, -31535=>18282, -16870=>18283, -16883=>18284, -31615=>18285, -31553=>18286, -16878=>18287, -31573=>18288, -31609=>18289, -31588=>18290, -31590=>18291, -31603=>18292, -154546=>18293, -16903=>18294, -31632=>18295, -31643=>18296, -16910=>18297, -31669=>18298, -31676=>18299, -31685=>18300, -31690=>18301, -154699=>18302, -154724=>18303, -31700=>18304, -31702=>18305, -31706=>18306, -31722=>18307, -31728=>18308, -31747=>18309, -31758=>18310, -31813=>18311, -31818=>18312, -31831=>18313, -31838=>18314, -31841=>18315, -31849=>18316, -31855=>18317, -155182=>18318, -155222=>18319, -155237=>18320, -31910=>18321, -155234=>18322, -31926=>18323, -31927=>18324, -155352=>18325, -31940=>18326, -155330=>18327, -31949=>18328, -155368=>18329, -155427=>18330, -31974=>18331, -155484=>18332, -31989=>18333, -32003=>18334, -17094=>18335, -32018=>18336, -32030=>18337, -155616=>18338, -155604=>18339, -32061=>18340, -32062=>18341, -32064=>18342, -32071=>18343, -155660=>18344, -155643=>18345, -17110=>18346, -32090=>18347, -32106=>18348, -32112=>18349, -17117=>18350, -32127=>18351, -155671=>18352, -32136=>18353, -32151=>18354, -155744=>18355, -32157=>18356, -32167=>18357, -32170=>18358, -32182=>18359, -32192=>18360, -32215=>18361, -32217=>18362, -32230=>18363, -17154=>18364, -155885=>18365, -64088=>18366, -32272=>18367, -32279=>18368, -32285=>18369, -32295=>18370, -32300=>18371, -32325=>18372, -32373=>18373, -32382=>18374, -32390=>18375, -32391=>18376, -17195=>18377, -32410=>18378, -17219=>18379, -32572=>18380, -32571=>18381, -32574=>18382, -32579=>18383, -13505=>18384, -156272=>18385, -156294=>18386, -32611=>18387, -32612=>18388, -32621=>18389, -32637=>18390, -32638=>18391, -32656=>18392, -20859=>18393, -146702=>18394, -32662=>18395, -32668=>18396, -32685=>18397, -156674=>18398, -32707=>18399, -32719=>18400, -32739=>18401, -32754=>18402, -32778=>18403, -32776=>18404, -32790=>18405, -32812=>18406, -32816=>18407, -32835=>18408, -32870=>18409, -32891=>18410, -32921=>18411, -32924=>18412, -32932=>18413, -32935=>18414, -32952=>18415, -157310=>18416, -32965=>18417, -32981=>18418, -32998=>18419, -33037=>18420, -33013=>18421, -33019=>18422, -17390=>18423, -33077=>18424, -33054=>18425, -17392=>18426, -33060=>18427, -33063=>18428, -33068=>18429, -157469=>18430, -33085=>18431, -17416=>18432, -33129=>18433, -17431=>18434, -17436=>18435, -33157=>18436, -17442=>18437, -33176=>18438, -33202=>18439, -33217=>18440, -33219=>18441, -33238=>18442, -33243=>18443, -157917=>18444, -33252=>18445, -157930=>18446, -33260=>18447, -33277=>18448, -33279=>18449, -158063=>18450, -33284=>18451, -158173=>18452, -33305=>18453, -33314=>18454, -158238=>18455, -33340=>18456, -33353=>18457, -33349=>18458, -158296=>18459, -17526=>18460, -17530=>18461, -33367=>18462, -158348=>18463, -33372=>18464, -33379=>18465, -158391=>18466, -17553=>18467, -33405=>18468, -33407=>18469, -33411=>18470, -33418=>18471, -33427=>18472, -33447=>18473, -33448=>18474, -33458=>18475, -33460=>18476, -33466=>18477, -33468=>18478, -33506=>18479, -33512=>18480, -33527=>18481, -33543=>18482, -33544=>18483, -33548=>18484, -33620=>18485, -33563=>18486, -33565=>18487, -33584=>18488, -33596=>18489, -33604=>18490, -33623=>18491, -17598=>18492, -17620=>18493, -17587=>18494, -33684=>18495, -33685=>18496, -33691=>18497, -33693=>18498, -33737=>18499, -33744=>18500, -33748=>18501, -33757=>18502, -33765=>18503, -33785=>18504, -33813=>18505, -158835=>18506, -33815=>18507, -33849=>18508, -33871=>18509, -33873=>18510, -33874=>18511, -33881=>18512, -33882=>18513, -33884=>18514, -158941=>18515, -33893=>18516, -33912=>18517, -33916=>18518, -33921=>18519, -17677=>18520, -33943=>18521, -33958=>18522, -33982=>18523, -17672=>18524, -33998=>18525, -33999=>18526, -34003=>18527, -159333=>18528, -34023=>18529, -34026=>18530, -34031=>18531, -34033=>18532, -34042=>18533, -34075=>18534, -34084=>18535, -34085=>18536, -34091=>18537, -34127=>18538, -34159=>18539, -17731=>18540, -34129=>18541, -34145=>18542, -34146=>18543, -159636=>18544, -34171=>18545, -34173=>18546, -34175=>18547, -34177=>18548, -34182=>18549, -34195=>18550, -34205=>18551, -34207=>18552, -159736=>18553, -159734=>18554, -159735=>18555, -34236=>18556, -34247=>18557, -34250=>18558, -34264=>18559, -34265=>18560, -34271=>18561, -34273=>18562, -34278=>18563, -34294=>18564, -34304=>18565, -34321=>18566, -34334=>18567, -34337=>18568, -34340=>18569, -34343=>18570, -160013=>18571, -34361=>18572, -34364=>18573, -160057=>18574, -34368=>18575, -34387=>18576, -34390=>18577, -34423=>18578, -34439=>18579, -34441=>18580, -34460=>18581, -34461=>18582, -34481=>18583, -34483=>18584, -34497=>18585, -34499=>18586, -34513=>18587, -34517=>18588, -34519=>18589, -34531=>18590, -34534=>18591, -17848=>18592, -34565=>18593, -34567=>18594, -34574=>18595, -34576=>18596, -34591=>18597, -34593=>18598, -34595=>18599, -34609=>18600, -34618=>18601, -34624=>18602, -34627=>18603, -34641=>18604, -34648=>18605, -34660=>18606, -34661=>18607, -34674=>18608, -34684=>18609, -160731=>18610, -160730=>18611, -34727=>18612, -34697=>18613, -34699=>18614, -34707=>18615, -34720=>18616, -160766=>18617, -17893=>18618, -34750=>18619, -160784=>18620, -34753=>18621, -34766=>18622, -34783=>18623, -160841=>18624, -34787=>18625, -34789=>18626, -34790=>18627, -34794=>18628, -34835=>18629, -34856=>18630, -34862=>18631, -34866=>18632, -34876=>18633, -17935=>18634, -34890=>18635, -34904=>18636, -161301=>18637, -161300=>18638, -34921=>18639, -161329=>18640, -34927=>18641, -34976=>18642, -35004=>18643, -35008=>18644, -161427=>18645, -35025=>18646, -35027=>18647, -17985=>18648, -35073=>18649, -161550=>18650, -35127=>18651, -161571=>18652, -35138=>18653, -35141=>18654, -35145=>18655, -161618=>18656, -35170=>18657, -35209=>18658, -35216=>18659, -35231=>18660, -35248=>18661, -35255=>18662, -35288=>18663, -35307=>18664, -18081=>18665, -35315=>18666, -35325=>18667, -35327=>18668, -18095=>18669, -35345=>18670, -35348=>18671, -162181=>18672, -35361=>18673, -35381=>18674, -35390=>18675, -35397=>18676, -35405=>18677, -35416=>18678, -35502=>18679, -35472=>18680, -35511=>18681, -35543=>18682, -35580=>18683, -162436=>18684, -35594=>18685, -35589=>18686, -35597=>18687, -35612=>18688, -35629=>18689, -18188=>18690, -35665=>18691, -35678=>18692, -35702=>18693, -35713=>18694, -35723=>18695, -35732=>18696, -35733=>18697, -35897=>18698, -162739=>18699, -35901=>18700, -162750=>18701, -162759=>18702, -35909=>18703, -35919=>18704, -35927=>18705, -35945=>18706, -35949=>18707, -163000=>18708, -35987=>18709, -35986=>18710, -35993=>18711, -18276=>18712, -35995=>18713, -36054=>18714, -36053=>18715, -163232=>18716, -36081=>18717, -163344=>18718, -36105=>18719, -36110=>18720, -36296=>18721, -36313=>18722, -36364=>18723, -18429=>18724, -36349=>18725, -36358=>18726, -163978=>18727, -36372=>18728, -36374=>18729, -36385=>18730, -36386=>18731, -36391=>18732, -164027=>18733, -18454=>18734, -36406=>18735, -36409=>18736, -36436=>18737, -36450=>18738, -36461=>18739, -36463=>18740, -36504=>18741, -36510=>18742, -36533=>18743, -36539=>18744, -164482=>18745, -18510=>18746, -164595=>18747, -36608=>18748, -36616=>18749, -36651=>18750, -36672=>18751, -36682=>18752, -36696=>18753, -164876=>18754, -36772=>18755, -36788=>18756, -164949=>18757, -36801=>18758, -36806=>18759, -64036=>18760, -36810=>18761, -36813=>18762, -36819=>18763, -36821=>18764, -36849=>18765, -36853=>18766, -36859=>18767, -36876=>18768, -36919=>18769, -165227=>18770, -36931=>18771, -36957=>18772, -165320=>18773, -165321=>18774, -36997=>18775, -37004=>18776, -37008=>18777, -37025=>18778, -18613=>18779, -37040=>18780, -37046=>18781, -37059=>18782, -37064=>18783, -165591=>18784, -37084=>18785, -37087=>18786, -165626=>18787, -37110=>18788, -37106=>18789, -37120=>18790, -37099=>18791, -37118=>18792, -37119=>18793, -37124=>18794, -37126=>18795, -37144=>18796, -37150=>18797, -37175=>18798, -37177=>18799, -37190=>18800, -37191=>18801, -37207=>18802, -37209=>18803, -37236=>18804, -37241=>18805, -37253=>18806, -37299=>18807, -37302=>18808, -37315=>18809, -37316=>18810, -166217=>18811, -166214=>18812, -37356=>18813, -37377=>18814, -37398=>18815, -37399=>18816, -166251=>18817, -37442=>18818, -37450=>18819, -37462=>18820, -37473=>18821, -37477=>18822, -37480=>18823, -166280=>18824, -37500=>18825, -37501=>18826, -37503=>18827, -37513=>18828, -37517=>18829, -37527=>18830, -37529=>18831, -37535=>18832, -37547=>18833, -166330=>18834, -166331=>18835, -37554=>18836, -37567=>18837, -37568=>18838, -37574=>18839, -37582=>18840, -37605=>18841, -37649=>18842, -166430=>18843, -166441=>18844, -37623=>18845, -37673=>18846, -166513=>18847, -166467=>18848, -37713=>18849, -37722=>18850, -37739=>18851, -37745=>18852, -37747=>18853, -37793=>18854, -166553=>18855, -166605=>18856, -37768=>18857, -37771=>18858, -37775=>18859, -37790=>18860, -37877=>18861, -166628=>18862, -166621=>18863, -37873=>18864, -37831=>18865, -37852=>18866, -37863=>18867, -37897=>18868, -37910=>18869, -37911=>18870, -37883=>18871, -37938=>18872, -37947=>18873, -166849=>18874, -166895=>18875, -37997=>18876, -37999=>18877, -38265=>18878, -38278=>18879, -38284=>18880, -38285=>18881, -167184=>18882, -167281=>18883, -38344=>18884, -167419=>18885, -167455=>18886, -38444=>18887, -38451=>18888, -38452=>18889, -167478=>18890, -38460=>18891, -38497=>18892, -167561=>18893, -38530=>18894, -167659=>18895, -38554=>18896, -167730=>18897, -18919=>18898, -38579=>18899, -38586=>18900, -38589=>18901, -18938=>18902, -167928=>18903, -38616=>18904, -38618=>18905, -38621=>18906, -18948=>18907, -38676=>18908, -38691=>18909, -18985=>18910, -38710=>18911, -38721=>18912, -38727=>18913, -38743=>18914, -38747=>18915, -38762=>18916, -168608=>18917, -168625=>18918, -38806=>18919, -38814=>18920, -38833=>18921, -38834=>18922, -38846=>18923, -38860=>18924, -38865=>18925, -38868=>18926, -38872=>18927, -38881=>18928, -38897=>18929, -38916=>18930, -38925=>18931, -38932=>18932, -38934=>18933, -19132=>18934, -169104=>18935, -38962=>18936, -38963=>18937, -38949=>18938, -38983=>18939, -39014=>18940, -39083=>18941, -39085=>18942, -39088=>18943, -169423=>18944, -39095=>18945, -39099=>18946, -39100=>18947, -39106=>18948, -39111=>18949, -39115=>18950, -39137=>18951, -39139=>18952, -39146=>18953, -39152=>18954, -39153=>18955, -39155=>18956, -39176=>18957, -19259=>18958, -169712=>18959, -39190=>18960, -39191=>18961, -169753=>18962, -39194=>18963, -39195=>18964, -39196=>18965, -169808=>18966, -39217=>18967, -39226=>18968, -39227=>18969, -39228=>18970, -39233=>18971, -39238=>18972, -39246=>18973, -39264=>18974, -39331=>18975, -39334=>18976, -39357=>18977, -39359=>18978, -39363=>18979, -39380=>18980, -39385=>18981, -39390=>18982, -170182=>18983, -39408=>18984, -39417=>18985, -39420=>18986, -39434=>18987, -39441=>18988, -39450=>18989, -39456=>18990, -39473=>18991, -39492=>18992, -39500=>18993, -39512=>18994, -19394=>18995, -39599=>18996, -19402=>18997, -39607=>18998, -19410=>18999, -39609=>19000, -170610=>19001, -39622=>19002, -39632=>19003, -39634=>19004, -39637=>19005, -39648=>19006, -39653=>19007, -39657=>19008, -39692=>19009, -39696=>19010, -39698=>19011, -39702=>19012, -39708=>19013, -39723=>19014, -39741=>19015, -19488=>19016, -39755=>19017, -39779=>19018, -39781=>19019, -39787=>19020, -39788=>19021, -39798=>19022, -39799=>19023, -39846=>19024, -39852=>19025, -171483=>19026, -39858=>19027, -39864=>19028, -39870=>19029, -39923=>19030, -39896=>19031, -39901=>19032, -39914=>19033, -39919=>19034, -39918=>19035, -171541=>19036, -171658=>19037, -171593=>19038, -39958=>19039, -39960=>19040, -39961=>19041, -39962=>19042, -39965=>19043, -39970=>19044, -39977=>19045, -171716=>19046, -39985=>19047, -39991=>19048, -40005=>19049, -40028=>19050, -171753=>19051, -40009=>19052, -40010=>19053, -171739=>19054, -40020=>19055, -40024=>19056, -40027=>19057, -40029=>19058, -40031=>19059, -40041=>19060, -40042=>19061, -40043=>19062, -40045=>19063, -40046=>19064, -40050=>19065, -40053=>19066, -40058=>19067, -40166=>19068, -40178=>19069, -40203=>19070, -171982=>19071, -171991=>19071, -40209=>19072, -40215=>19073, -40216=>19074, -172079=>19075, -19652=>19076, -172058=>19077, -40242=>19078, -19665=>19079, -40266=>19080, -40287=>19081, -40290=>19082, -172281=>19083, -172162=>19084, -40307=>19085, -40310=>19086, -40311=>19087, -40324=>19088, -40345=>19089, -40353=>19090, -40383=>19091, -40373=>19092, -40377=>19093, -40381=>19094, -40393=>19095, -40410=>19096, -40416=>19097, -40419=>19098, -19719=>19099, -40458=>19100, -40450=>19101, -40461=>19102, -40476=>19103, -40571=>19104, -139800=>19105, -40576=>19106, -40581=>19107, -40603=>19108, -172940=>19109, -40637=>19110, -173111=>19111, -40671=>19112, -40703=>19113, -40706=>19114, -19831=>19115, -40707=>19116, -40762=>19117, -40765=>19118, -40774=>19119, -40787=>19120, -40789=>19121, -40792=>19122, -173553=>19123, -40797=>19124, -173570=>19125, -40809=>19126, -40813=>19127, -40816=>19128, -173746=>19129, -11948=>19130, -13844=>19131, -14509=>19132, -15820=>19133, -16348=>19134, -17854=>19135, -17936=>19136, -19326=>19137, -19512=>19138, -19681=>19139, -19980=>19140, -20003=>19141, -20004=>19142, -20089=>19143, -20211=>19144, -20236=>19145, -20249=>19146, -20267=>19147, -20270=>19148, -20273=>19149, -20356=>19150, -20382=>19151, -20407=>19152, -20484=>19153, -20492=>19154, -20556=>19155, -20575=>19156, -20578=>19157, -20599=>19158, -20622=>19159, -20638=>19160, -20642=>19161, -20675=>19162, -20712=>19163, -20721=>19164, -20734=>19165, -20743=>19166, -20748=>19167, -20749=>19168, -20750=>19169, -20787=>19170, -20792=>19171, -20852=>19172, -20868=>19173, -20920=>19174, -20922=>19175, -20936=>19176, -20943=>19177, -20945=>19178, -20947=>19179, -20948=>19180, -20952=>19181, -20959=>19182, -20997=>19183, -21030=>19184, -21032=>19185, -21035=>19186, -21041=>19187, -21042=>19188, -21045=>19189, -21052=>19190, -21082=>19191, -21088=>19192, -21102=>19193, -21112=>19194, -21113=>19195, -21130=>19196, -21132=>19197, -21217=>19198, -21225=>19199, -21233=>19200, -21251=>19201, -21265=>19202, -21279=>19203, -21293=>19204, -21298=>19205, -21309=>19206, -21349=>19207, -21357=>19208, -21369=>19209, -21374=>19210, -21396=>19211, -21401=>19212, -21418=>19213, -21423=>19214, -21434=>19215, -21441=>19216, -21444=>19217, -21445=>19218, -21472=>19219, -21523=>19220, -21546=>19221, -21553=>19222, -21556=>19223, -21557=>19224, -21580=>19225, -21671=>19226, -21674=>19227, -21681=>19228, -21691=>19229, -21710=>19230, -21738=>19231, -21756=>19232, -21765=>19233, -21768=>19234, -21781=>19235, -21799=>19236, -21802=>19237, -21814=>19238, -21841=>19239, -21862=>19240, -21903=>19241, -21906=>19242, -21908=>19243, -21924=>19244, -21938=>19245, -21955=>19246, -21958=>19247, -21971=>19248, -21979=>19249, -21996=>19250, -21998=>19251, -22001=>19252, -22006=>19253, -22008=>19254, -22021=>19255, -22029=>19256, -22033=>19257, -22034=>19258, -22060=>19259, -22069=>19260, -22073=>19261, -22093=>19262, -22100=>19263, -22149=>19264, -22175=>19265, -22182=>19266, -22199=>19267, -22220=>19268, -22223=>19269, -22233=>19270, -22241=>19271, -22251=>19272, -22253=>19273, -22257=>19274, -22279=>19275, -22284=>19276, -22298=>19277, -22299=>19278, -22301=>19279, -22316=>19280, -22318=>19281, -22333=>19282, -22334=>19283, -22367=>19284, -22379=>19285, -22381=>19286, -22394=>19287, -22403=>19288, -22423=>19289, -22446=>19290, -22485=>19291, -22503=>19292, -22541=>19293, -22566=>19294, -22605=>19295, -22607=>19296, -22623=>19297, -22637=>19298, -22655=>19299, -22657=>19300, -22680=>19301, -22716=>19302, -22815=>19303, -22819=>19304, -22873=>19305, -22905=>19306, -22935=>19307, -22959=>19308, -22963=>19309, -23007=>19310, -23025=>19311, -23032=>19312, -23218=>19313, -23224=>19314, -23274=>19315, -23286=>19316, -23323=>19317, -23325=>19318, -23329=>19319, -23352=>19320, -23479=>19321, -23511=>19322, -23520=>19323, -23583=>19324, -23594=>19325, -23596=>19326, -23606=>19327, -23641=>19328, -23644=>19329, -23661=>19330, -23773=>19331, -23809=>19332, -23860=>19333, -23869=>19334, -23897=>19335, -23934=>19336, -23939=>19337, -24007=>19338, -24057=>19339, -24104=>19340, -24114=>19341, -24117=>19342, -24155=>19343, -24168=>19344, -24170=>19345, -24183=>19346, -24192=>19347, -24203=>19348, -24243=>19349, -24253=>19350, -24273=>19351, -24276=>19352, -24277=>19353, -24397=>19354, -24492=>19355, -24554=>19356, -24583=>19357, -24649=>19358, -24660=>19359, -24679=>19360, -24763=>19361, -24772=>19362, -24829=>19363, -24842=>19364, -24854=>19365, -24874=>19366, -24886=>19367, -24926=>19368, -24932=>19369, -24955=>19370, -24957=>19371, -24959=>19372, -24989=>19373, -25016=>19374, -25052=>19375, -25058=>19376, -25061=>19377, -25064=>19378, -25092=>19379, -25095=>19380, -25137=>19381, -25145=>19382, -25149=>19383, -25210=>19384, -25232=>19385, -25256=>19386, -25306=>19387, -25332=>19388, -25366=>19389, -25386=>19390, -25398=>19391, -25414=>19392, -25419=>19393, -25427=>19394, -25457=>19395, -25461=>19396, -25471=>19397, -25474=>19398, -25482=>19399, -25518=>19400, -25519=>19401, -25578=>19402, -25592=>19403, -25593=>19404, -25618=>19405, -25624=>19406, -25632=>19407, -25636=>19408, -25642=>19409, -25653=>19410, -25661=>19411, -25663=>19412, -25682=>19413, -25695=>19414, -25716=>19415, -25744=>19416, -25752=>19417, -25753=>19418, -25772=>19419, -25779=>19420, -25837=>19421, -25840=>19422, -25883=>19423, -25887=>19424, -25902=>19425, -25929=>19426, -25952=>19427, -26002=>19428, -26005=>19429, -26036=>19430, -26046=>19431, -26056=>19432, -26062=>19433, -26064=>19434, -26079=>19435, -26238=>19436, -26251=>19437, -26252=>19438, -26291=>19439, -26304=>19440, -26319=>19441, -26405=>19442, -26421=>19443, -26453=>19444, -26496=>19445, -26511=>19446, -26513=>19447, -26532=>19448, -26545=>19449, -26549=>19450, -26558=>19451, -26664=>19452, -26758=>19453, -26859=>19454, -26869=>19455, -26903=>19456, -26931=>19457, -26936=>19458, -26971=>19459, -26981=>19460, -27048=>19461, -27051=>19462, -27055=>19463, -27109=>19464, -27121=>19465, -27210=>19466, -27221=>19467, -27239=>19468, -27249=>19469, -27311=>19470, -27336=>19471, -27337=>19472, -27395=>19473, -27451=>19474, -27455=>19475, -27517=>19476, -27518=>19477, -27568=>19478, -27639=>19479, -27641=>19480, -27652=>19481, -27657=>19482, -27661=>19483, -27692=>19484, -27722=>19485, -27730=>19486, -27732=>19487, -27769=>19488, -27820=>19489, -27828=>19490, -27858=>19491, -28001=>19492, -28028=>19493, -28089=>19494, -28144=>19495, -28229=>19496, -28275=>19497, -28283=>19498, -28285=>19499, -28297=>19500, -28348=>19501, -28378=>19502, -28379=>19503, -28454=>19504, -28457=>19505, -28464=>19506, -28551=>19507, -28573=>19508, -28590=>19509, -28599=>19510, -28685=>19511, -28704=>19512, -28745=>19513, -28824=>19514, -28848=>19515, -28885=>19516, -28886=>19517, -28997=>19518, -29106=>19519, -29172=>19520, -29207=>19521, -29215=>19522, -29251=>19523, -29263=>19524, -29264=>19525, -29274=>19526, -29280=>19527, -29288=>19528, -29303=>19529, -29316=>19530, -29385=>19531, -29413=>19532, -29428=>19533, -29442=>19534, -29451=>19535, -29470=>19536, -29474=>19537, -29498=>19538, -29499=>19539, -29517=>19540, -29528=>19541, -29543=>19542, -29810=>19543, -29871=>19544, -29919=>19545, -29924=>19546, -29940=>19547, -29947=>19548, -29974=>19549, -29985=>19550, -30015=>19551, -30046=>19552, -30105=>19553, -30116=>19554, -30145=>19555, -30148=>19556, -30156=>19557, -30167=>19558, -30172=>19559, -30177=>19560, -30191=>19561, -30212=>19562, -30220=>19563, -30237=>19564, -30258=>19565, -30264=>19566, -30277=>19567, -30282=>19568, -30303=>19569, -30381=>19570, -30397=>19571, -30425=>19572, -30443=>19573, -30448=>19574, -30457=>19575, -30464=>19576, -30478=>19577, -30498=>19578, -30504=>19579, -30511=>19580, -30521=>19581, -30526=>19582, -30533=>19583, -30538=>19584, -30543=>19585, -30558=>19586, -30564=>19587, -30567=>19588, -30572=>19589, -30596=>19590, -30604=>19591, -30605=>19592, -30614=>19593, -30631=>19594, -30639=>19595, -30647=>19596, -30654=>19597, -30665=>19598, -30673=>19599, -30681=>19600, -30705=>19601, -30775=>19602, -30812=>19603, -30846=>19604, -30872=>19605, -30881=>19606, -30897=>19607, -30899=>19608, -30921=>19609, -30931=>19610, -30988=>19611, -31007=>19612, -31015=>19613, -31016=>19614, -31039=>19615, -31042=>19616, -31060=>19617, -31083=>19618, -31100=>19619, -31147=>19620, -31172=>19621, -31210=>19622, -31234=>19623, -31244=>19624, -31280=>19625, -31290=>19626, -31300=>19627, -31360=>19628, -31366=>19629, -31380=>19630, -31413=>19631, -31421=>19632, -31486=>19633, -31531=>19634, -31607=>19635, -31648=>19636, -31660=>19637, -31664=>19638, -31720=>19639, -31730=>19640, -31736=>19641, -31740=>19642, -31742=>19643, -31753=>19644, -31784=>19645, -31791=>19646, -31810=>19647, -31826=>19648, -31827=>19649, -31835=>19650, -31836=>19651, -31837=>19652, -31858=>19653, -31869=>19654, -31879=>19655, -31902=>19656, -31930=>19657, -31943=>19658, -31955=>19659, -31962=>19660, -32060=>19661, -32077=>19662, -32130=>19663, -32133=>19664, -32141=>19665, -32145=>19666, -32158=>19667, -32179=>19668, -32185=>19669, -32208=>19670, -32229=>19671, -32245=>19672, -32246=>19673, -32303=>19674, -32310=>19675, -32324=>19676, -32367=>19677, -32376=>19678, -32385=>19679, -32573=>19680, -32603=>19681, -32605=>19682, -32613=>19683, -32625=>19684, -32639=>19685, -32640=>19686, -32651=>19687, -32674=>19688, -32765=>19689, -32766=>19690, -32767=>19691, -32775=>19692, -32781=>19693, -32798=>19694, -32825=>19695, -32904=>19696, -32910=>19697, -32975=>19698, -32980=>19699, -33005=>19700, -33008=>19701, -33015=>19702, -33018=>19703, -33022=>19704, -33027=>19705, -33047=>19706, -33072=>19707, -33111=>19708, -33135=>19709, -33139=>19710, -33163=>19711, -33168=>19712, -33179=>19713, -33182=>19714, -33227=>19715, -33237=>19716, -33245=>19717, -33246=>19718, -33249=>19719, -33263=>19720, -33270=>19721, -33280=>19722, -33291=>19723, -33299=>19724, -33300=>19725, -33306=>19726, -33338=>19727, -33348=>19728, -33389=>19729, -33412=>19730, -33417=>19731, -33425=>19732, -33450=>19733, -33456=>19734, -33488=>19735, -33514=>19736, -33519=>19737, -33526=>19738, -33622=>19739, -33656=>19740, -33784=>19741, -33788=>19742, -33880=>19743, -33939=>19744, -33969=>19745, -33981=>19746, -34043=>19747, -34118=>19748, -34134=>19749, -34141=>19750, -34181=>19751, -34200=>19752, -34370=>19753, -34374=>19754, -34496=>19755, -34580=>19756, -34594=>19757, -34606=>19758, -34617=>19759, -34653=>19760, -34683=>19761, -34700=>19762, -34702=>19763, -34711=>19764, -34712=>19765, -34718=>19766, -34723=>19767, -34734=>19768, -34751=>19769, -34761=>19770, -34778=>19771, -34840=>19772, -34843=>19773, -34861=>19774, -34874=>19775, -34885=>19776, -34891=>19777, -34894=>19778, -34901=>19779, -34906=>19780, -34926=>19781, -34970=>19782, -34971=>19783, -34972=>19784, -35021=>19785, -35040=>19786, -35055=>19787, -35086=>19788, -35087=>19789, -35110=>19790, -35125=>19791, -35162=>19792, -35164=>19793, -35179=>19794, -35184=>19795, -35196=>19796, -35237=>19797, -35253=>19798, -35260=>19799, -35285=>19800, -35401=>19801, -35415=>19802, -35431=>19803, -35454=>19804, -35462=>19805, -35478=>19806, -35510=>19807, -35529=>19808, -35537=>19809, -35549=>19810, -35564=>19811, -35573=>19812, -35590=>19813, -35599=>19814, -35601=>19815, -35653=>19816, -35666=>19817, -35693=>19818, -35704=>19819, -35708=>19820, -35710=>19821, -35717=>19822, -35743=>19823, -35915=>19824, -35923=>19825, -35963=>19826, -36026=>19827, -36037=>19828, -36041=>19829, -36050=>19830, -36076=>19831, -36085=>19832, -36087=>19833, -36097=>19834, -36099=>19835, -36119=>19836, -36124=>19837, -36206=>19838, -36241=>19839, -36255=>19840, -36267=>19841, -36274=>19842, -36309=>19843, -36327=>19844, -36337=>19845, -36338=>19846, -36340=>19847, -36353=>19848, -36363=>19849, -36390=>19850, -36401=>19851, -36416=>19852, -36417=>19853, -36429=>19854, -36431=>19855, -36444=>19856, -36449=>19857, -36457=>19858, -36465=>19859, -36469=>19860, -36471=>19861, -36489=>19862, -36496=>19863, -36501=>19864, -36506=>19865, -36519=>19866, -36521=>19867, -36525=>19868, -36584=>19869, -36592=>19870, -36615=>19871, -36632=>19872, -36645=>19873, -36647=>19874, -36652=>19875, -36661=>19876, -36666=>19877, -36675=>19878, -36679=>19879, -36689=>19880, -36693=>19881, -36768=>19882, -36769=>19883, -36770=>19884, -36773=>19885, -36868=>19886, -36891=>19887, -36911=>19888, -36940=>19889, -36955=>19890, -36976=>19891, -36980=>19892, -36985=>19893, -37003=>19894, -37016=>19895, -37024=>19896, -37042=>19897, -37053=>19898, -37065=>19899, -37104=>19900, -37125=>19901, -37157=>19902, -37210=>19903, -37223=>19904, -37242=>19905, -37258=>19906, -37265=>19907, -37269=>19908, -37296=>19909, -37307=>19910, -37309=>19911, -37314=>19912, -37317=>19913, -37376=>19914, -37385=>19915, -37411=>19916, -37494=>19917, -37518=>19918, -37551=>19919, -37563=>19920, -37564=>19921, -37569=>19922, -37571=>19923, -37573=>19924, -37576=>19925, -37652=>19926, -37683=>19927, -37686=>19928, -37720=>19929, -37759=>19930, -37762=>19931, -37770=>19932, -37819=>19933, -37836=>19934, -37862=>19935, -37881=>19936, -37890=>19937, -37901=>19938, -37902=>19939, -37934=>19940, -37964=>19941, -38280=>19942, -38305=>19943, -38335=>19944, -38342=>19945, -38345=>19946, -38353=>19947, -38354=>19948, -38368=>19949, -38372=>19950, -38374=>19951, -38436=>19952, -38449=>19953, -38456=>19954, -38461=>19955, -38484=>19956, -38516=>19957, -38523=>19958, -38527=>19959, -38529=>19960, -38531=>19961, -38537=>19962, -38550=>19963, -38574=>19964, -38659=>19965, -38683=>19966, -38689=>19967, -38690=>19968, -38696=>19969, -38705=>19970, -38759=>19971, -38774=>19972, -38781=>19973, -38783=>19974, -38809=>19975, -38815=>19976, -38828=>19977, -38841=>19978, -38861=>19979, -38880=>19980, -38895=>19981, -38919=>19982, -38950=>19983, -38958=>19984, -39010=>19985, -39011=>19986, -39092=>19987, -39109=>19988, -39170=>19989, -39185=>19990, -39189=>19991, -39221=>19992, -39240=>19993, -39252=>19994, -39262=>19995, -39393=>19996, -39436=>19997, -39440=>19998, -39459=>19999, -39489=>20000, -39505=>20001, -39613=>20002, -39614=>20003, -39681=>20004, -39689=>20005, -39691=>20006, -39693=>20007, -39694=>20008, -39705=>20009, -39733=>20010, -39752=>20011, -39765=>20012, -39784=>20013, -39808=>20014, -39814=>20015, -39824=>20016, -39837=>20017, -39856=>20018, -39871=>20019, -39880=>20020, -39935=>20021, -39938=>20022, -39964=>20023, -39989=>20024, -40004=>20025, -40022=>20026, -40033=>20027, -40040=>20028, -40240=>20029, -40253=>20030, -40298=>20031, -40315=>20032, -40421=>20033, -40425=>20034, -40435=>20035, -40570=>20036, -40578=>20037, -40579=>20038, -40580=>20039, -40624=>20040, -40676=>20041, -40688=>20042, -40690=>20043, -40713=>20044, -40719=>20045, -40724=>20046, -40731=>20047, -40738=>20048, -40742=>20049, -40746=>20050, -40747=>20051, -40756=>20052, -40794=>20053, -40815=>20054, -40862=>20055, -40869=>20056, -131317=>20057, -151044=>20058, -151538=>20059, -163187=>20060, -194581=>20061, -194630=>20062, -194713=>20063, -194726=>20064, -194789=>20065, -195038=>20066, -13790=>20067, -40895=>20068, -40896=>20069, -40897=>20070, -40898=>20071, -172722=>20072, -131416=>20075, -132529=>20080, -132844=>20083, -134488=>20090, -154060=>20112, -14756=>20122, -14776=>20123, -142914=>20124, -14940=>20127, -133064=>20128, -143339=>20130, -162228=>20133, -15044=>20135, -15051=>20136, -14981=>20142, -15347=>20151, -27384=>20152, -15665=>20158, -147531=>20168, -15936=>20170, -14497=>20171, -158878=>20206, -18207=>20219, -162876=>20220, -18462=>20225, -39709=>20297, -39724=>20298, -20482=>20299, -20958=>20300, -21255=>20301, -23532=>20302, -63784=>20303, -26142=>20304, -63785=>20305, -28746=>20306, -64021=>20307, -21857=>20308, -27706=>20309, -31328=>20310, -156492=>20311, -34819=>20312, -38315=>20313, -38741=>20314, -171581=>20315, -173594=>20316, -900=>20317, -901=>20318, -272=>20322, -294=>20323, -306=>20324, -319=>20325, -330=>20326, -358=>20327, -307=>20328, -312=>20329, -320=>20330, -329=>20331, -359=>20332, -266=>20333, -278=>20334, -286=>20335, -290=>20336, -288=>20337, -304=>20338, -302=>20339, -310=>20340, -315=>20342, -325=>20343, -342=>20344, -370=>20345, -471=>20346, -475=>20347, -473=>20348, -469=>20349, -372=>20350, -374=>20351, -267=>20352, -279=>20353, -501=>20354, -287=>20355, -289=>20356, -303=>20357, -311=>20358, -316=>20360, -326=>20361, -343=>20362, -371=>20363, -373=>20364, -375=>20365, -8494=>20366, -8710=>20367, -8719=>20368, -8804=>20369, -8805=>20370, -9674=>20371, -902=>20427, -904=>20428, -905=>20429, -906=>20430, -938=>20431, -908=>20432, -910=>20433, -939=>20434, -911=>20435, -940=>20436, -941=>20437, -942=>20438, -943=>20439, -970=>20440, -912=>20441, -972=>20442, -973=>20443, -971=>20444, -944=>20445, -974=>20446, -1026=>20447, -1027=>20448, -1028=>20449, -1029=>20450, -1030=>20451, -1031=>20452, -1032=>20453, -1033=>20454, -1034=>20455, -1035=>20456, -1036=>20457, -1038=>20458, -1039=>20459, -1106=>20460, -1107=>20461, -1108=>20462, -1109=>20463, -1110=>20464, -1111=>20465, -1112=>20466, -1113=>20467, -1114=>20468, -1115=>20469, -1116=>20470, -1118=>20471, -1119=>20472, -9361=>20587, -9362=>20588, -20021=>21075, -20060=>21076, -20067=>21077, -20072=>21078, -20084=>21079, -20085=>21080, -20119=>21081, -20143=>21082, -20187=>21083, -20194=>21084, -20200=>21085, -20207=>21086, -20222=>21087, -20226=>21088, -20232=>21089, -20242=>21090, -20247=>21091, -20275=>21092, -20277=>21093, -20288=>21094, -20290=>21095, -20299=>21096, -20300=>21097, -20306=>21098, -20323=>21099, -20334=>21100, -20337=>21101, -20345=>21102, -20353=>21103, -20361=>21104, -20364=>21105, -20366=>21106, -20368=>21107, -20371=>21108, -20377=>21109, -20383=>21110, -20409=>21111, -20411=>21112, -20412=>21113, -20413=>21114, -20416=>21115, -20417=>21116, -20422=>21117, -20424=>21118, -20428=>21119, -20444=>21120, -20450=>21121, -20464=>21122, -20476=>21123, -20487=>21124, -20490=>21125, -20503=>21126, -20509=>21127, -20528=>21128, -20530=>21129, -20531=>21130, -20533=>21131, -20549=>21132, -20554=>21133, -20561=>21134, -20562=>21135, -20569=>21136, -20576=>21137, -20583=>21138, -20589=>21139, -20593=>21140, -20609=>21141, -20611=>21142, -20612=>21143, -20614=>21144, -20618=>21145, -20624=>21146, -20635=>21147, -20639=>21148, -20640=>21149, -20641=>21150, -20655=>21151, -20656=>21152, -20665=>21153, -20669=>21154, -20672=>21155, -20691=>21156, -20700=>21157, -20701=>21158, -20703=>21159, -20706=>21160, -20708=>21161, -20726=>21162, -20730=>21163, -20761=>21165, -20764=>21166, -20765=>21167, -20771=>21168, -20775=>21169, -20776=>21170, -20780=>21171, -20781=>21172, -20783=>21173, -20785=>21174, -20788=>21175, -20793=>21176, -20802=>21177, -20815=>21178, -20819=>21179, -20824=>21180, -20838=>21181, -20862=>21182, -20878=>21183, -20927=>21184, -20930=>21185, -20946=>21186, -20949=>21187, -20965=>21188, -20978=>21189, -20983=>21190, -21016=>21191, -21026=>21192, -21061=>21193, -21080=>21194, -21087=>21195, -21120=>21196, -21125=>21197, -21141=>21198, -21142=>21199, -21143=>21200, -21146=>21201, -21157=>21202, -21159=>21203, -21168=>21204, -21174=>21205, -21175=>21206, -21176=>21207, -21181=>21208, -21188=>21209, -21190=>21210, -21199=>21211, -21204=>21212, -21212=>21213, -21221=>21214, -21224=>21215, -21226=>21216, -21228=>21217, -21236=>21218, -21238=>21219, -21260=>21220, -21267=>21221, -21272=>21222, -21275=>21223, -21278=>21224, -21285=>21225, -21287=>21226, -21288=>21227, -21289=>21228, -21291=>21229, -21292=>21230, -21296=>21231, -21308=>21232, -21337=>21233, -21339=>21234, -21379=>21236, -21383=>21237, -21384=>21238, -21390=>21239, -21409=>21240, -21429=>21241, -21432=>21242, -21437=>21243, -21455=>21244, -21458=>21245, -21459=>21246, -21470=>21247, -21479=>21249, -21506=>21250, -21530=>21251, -21537=>21252, -21551=>21253, -21572=>21254, -21575=>21255, -21583=>21256, -21598=>21257, -21604=>21258, -21607=>21259, -21609=>21260, -21613=>21261, -21614=>21262, -21633=>21263, -21635=>21264, -21637=>21265, -21641=>21266, -21649=>21267, -21663=>21268, -21706=>21269, -21728=>21270, -21750=>21271, -21758=>21272, -21772=>21273, -21773=>21274, -21810=>21275, -21819=>21276, -21821=>21277, -21833=>21278, -21837=>21279, -21848=>21280, -21850=>21281, -21851=>21282, -21887=>21283, -21907=>21284, -21911=>21285, -21923=>21286, -21953=>21287, -21963=>21288, -21975=>21289, -21976=>21290, -21982=>21291, -22015=>21292, -22026=>21294, -22041=>21295, -22067=>21296, -22076=>21297, -22081=>21298, -22083=>21299, -22084=>21300, -22086=>21301, -22113=>21302, -22114=>21303, -22115=>21304, -22133=>21305, -22148=>21306, -22155=>21307, -22183=>21308, -22187=>21309, -22206=>21310, -22219=>21311, -22224=>21312, -22236=>21313, -22245=>21314, -22246=>21315, -22247=>21316, -22273=>21317, -22274=>21318, -22289=>21319, -22304=>21320, -22306=>21321, -22308=>21322, -22309=>21323, -22314=>21324, -22335=>21325, -22354=>21326, -22370=>21327, -22375=>21328, -22382=>21329, -22385=>21330, -22393=>21331, -22398=>21332, -22401=>21333, -22420=>21334, -22425=>21335, -22431=>21336, -22433=>21337, -22421=>21338, -22439=>21339, -22441=>21340, -22461=>21341, -22493=>21342, -22505=>21343, -22526=>21344, -22531=>21345, -22536=>21346, -22497=>21347, -22540=>21348, -22555=>21349, -22559=>21350, -22573=>21351, -22591=>21352, -22608=>21353, -22613=>21354, -22632=>21355, -22648=>21356, -22663=>21357, -22664=>21358, -22668=>21359, -22678=>21360, -22688=>21361, -22689=>21362, -22690=>21363, -22694=>21364, -22724=>21365, -22722=>21366, -22728=>21367, -22742=>21368, -22749=>21369, -22753=>21370, -22802=>21372, -22803=>21373, -22813=>21374, -22817=>21375, -22824=>21376, -22832=>21377, -22835=>21378, -22837=>21379, -22838=>21380, -22847=>21381, -22851=>21382, -22866=>21383, -22878=>21384, -22891=>21385, -22895=>21386, -22898=>21387, -22907=>21388, -22924=>21389, -22926=>21390, -22933=>21391, -22951=>21392, -22957=>21393, -22960=>21394, -22967=>21395, -22977=>21396, -22980=>21397, -23023=>21398, -23026=>21399, -23028=>21400, -23031=>21401, -23040=>21402, -23054=>21403, -23058=>21404, -23070=>21405, -23076=>21406, -23080=>21407, -23082=>21408, -23088=>21409, -23108=>21410, -23109=>21411, -23112=>21412, -23116=>21413, -23120=>21414, -23134=>21415, -23163=>21416, -23184=>21417, -23187=>21418, -23190=>21419, -23193=>21420, -23227=>21421, -23238=>21422, -23240=>21423, -23247=>21424, -23293=>21425, -23297=>21426, -23371=>21427, -23390=>21428, -23406=>21429, -23430=>21430, -23438=>21431, -23440=>21432, -23441=>21433, -23444=>21434, -23464=>21435, -23465=>21436, -23469=>21437, -23471=>21438, -23473=>21439, -23474=>21440, -23482=>21441, -23484=>21442, -23489=>21443, -23501=>21444, -23503=>21445, -23513=>21446, -23514=>21447, -23535=>21448, -23540=>21449, -23564=>21450, -23575=>21451, -23590=>21452, -23598=>21453, -23602=>21454, -23605=>21455, -23642=>21456, -23668=>21457, -23669=>21458, -23675=>21459, -23677=>21460, -23687=>21461, -23698=>21462, -23709=>21463, -23730=>21464, -23732=>21465, -23767=>21466, -23790=>21467, -23793=>21468, -23794=>21469, -23826=>21470, -23843=>21471, -23871=>21472, -23880=>21473, -23893=>21474, -23889=>21475, -23903=>21476, -23904=>21477, -23906=>21478, -23908=>21479, -23929=>21480, -23930=>21481, -23935=>21482, -23946=>21483, -23955=>21484, -23957=>21485, -23963=>21486, -23967=>21487, -23979=>21488, -24003=>21489, -24014=>21490, -24025=>21491, -24071=>21492, -24077=>21493, -24096=>21494, -24139=>21495, -24144=>21496, -24145=>21497, -24156=>21498, -24176=>21499, -24206=>21500, -24226=>21501, -24228=>21502, -24241=>21503, -24268=>21504, -24270=>21505, -24284=>21506, -24286=>21507, -24293=>21508, -24299=>21509, -24326=>21510, -24345=>21511, -24356=>21512, -24363=>21513, -24364=>21514, -24366=>21515, -24368=>21516, -24383=>21517, -24388=>21518, -24411=>21519, -24416=>21520, -24431=>21521, -24436=>21522, -24437=>21523, -24440=>21524, -24442=>21525, -24461=>21526, -24470=>21527, -24477=>21528, -24491=>21529, -24496=>21530, -24497=>21531, -24520=>21532, -24528=>21533, -24529=>21534, -24552=>21535, -24556=>21536, -24562=>21537, -24566=>21538, -24570=>21539, -24586=>21540, -24595=>21541, -24607=>21542, -24621=>21543, -24640=>21544, -24648=>21545, -24657=>21546, -24662=>21547, -24663=>21548, -24689=>21549, -24702=>21550, -24706=>21551, -24710=>21552, -24712=>21553, -24718=>21554, -24721=>21555, -24723=>21556, -24728=>21557, -24738=>21559, -24741=>21560, -24759=>21561, -24770=>21562, -24777=>21563, -24778=>21564, -24782=>21565, -24783=>21566, -24802=>21567, -24805=>21568, -24828=>21569, -24834=>21570, -24839=>21571, -24844=>21572, -24855=>21573, -24866=>21574, -24881=>21575, -24885=>21576, -24889=>21577, -24901=>21578, -24905=>21579, -24940=>21580, -24946=>21581, -24952=>21582, -24960=>21583, -24961=>21584, -24963=>21585, -24964=>21586, -24971=>21587, -24988=>21588, -24992=>21589, -25002=>21590, -25024=>21591, -25025=>21592, -25038=>21593, -25039=>21594, -25054=>21595, -25057=>21596, -25063=>21597, -25065=>21598, -25068=>21599, -25069=>21600, -25071=>21601, -25089=>21602, -25091=>21603, -25116=>21604, -25120=>21605, -25127=>21606, -25131=>21607, -25154=>21608, -25156=>21609, -25168=>21610, -25172=>21611, -25180=>21612, -25213=>21613, -25229=>21614, -25230=>21615, -25231=>21616, -25267=>21617, -25270=>21618, -25271=>21619, -25274=>21620, -25278=>21621, -25279=>21622, -25294=>21623, -25322=>21624, -25330=>21625, -25348=>21626, -25355=>21627, -25363=>21628, -25385=>21629, -25389=>21630, -25418=>21631, -25426=>21632, -25428=>21633, -25432=>21634, -25435=>21635, -25446=>21636, -25453=>21637, -25464=>21638, -25493=>21639, -25498=>21640, -25508=>21641, -25510=>21642, -25517=>21643, -25537=>21644, -25541=>21645, -25544=>21646, -25550=>21647, -25555=>21648, -25587=>21649, -25610=>21650, -25648=>21651, -25675=>21652, -25679=>21653, -25683=>21654, -25692=>21655, -25697=>21656, -25699=>21657, -25733=>21658, -25743=>21659, -25755=>21660, -25761=>21661, -25763=>21662, -25766=>21663, -25768=>21664, -25789=>21665, -25801=>21666, -25809=>21667, -25833=>21668, -25834=>21669, -25845=>21670, -25857=>21671, -25864=>21672, -25865=>21673, -25866=>21674, -25875=>21675, -25894=>21676, -25905=>21677, -25914=>21678, -25916=>21679, -25917=>21680, -25923=>21681, -25936=>21682, -25938=>21683, -25951=>21684, -25981=>21685, -26008=>21686, -26016=>21687, -26019=>21688, -26022=>21689, -26030=>21690, -26035=>21691, -26070=>21692, -26072=>21693, -26100=>21695, -26101=>21696, -26110=>21697, -26111=>21698, -26125=>21699, -26129=>21700, -26130=>21701, -26134=>21702, -26141=>21703, -26147=>21704, -26150=>21705, -26153=>21706, -26169=>21707, -26167=>21708, -26176=>21709, -26182=>21710, -26186=>21711, -26200=>21712, -26208=>21713, -26229=>21714, -26239=>21715, -26233=>21716, -26236=>21717, -26266=>21718, -26267=>21719, -26268=>21720, -26271=>21721, -26306=>21723, -26307=>21724, -26316=>21725, -26318=>21726, -26324=>21727, -26335=>21728, -26347=>21729, -26350=>21730, -26375=>21731, -26396=>21732, -26400=>21733, -26402=>21734, -26430=>21735, -26437=>21736, -26476=>21737, -26500=>21738, -26510=>21739, -26518=>21740, -26521=>21741, -26556=>21742, -26557=>21743, -26562=>21744, -26565=>21745, -26569=>21746, -26588=>21747, -26593=>21748, -26598=>21749, -26610=>21750, -26614=>21751, -26644=>21752, -26649=>21753, -26663=>21754, -26671=>21755, -26687=>21756, -26698=>21757, -26712=>21758, -26735=>21759, -26736=>21760, -26737=>21761, -26745=>21762, -26747=>21763, -26760=>21764, -26785=>21765, -26793=>21766, -26798=>21767, -26833=>21768, -26835=>21769, -26844=>21770, -26845=>21771, -26858=>21772, -26870=>21773, -26877=>21774, -26886=>21775, -26889=>21776, -26896=>21777, -26902=>21778, -26929=>21779, -26949=>21780, -26958=>21781, -26982=>21782, -26992=>21783, -26993=>21784, -27003=>21785, -27021=>21786, -27041=>21787, -27064=>21788, -27077=>21789, -27080=>21790, -27136=>21792, -27139=>21793, -27168=>21794, -27172=>21795, -27191=>21796, -27242=>21798, -27265=>21799, -27270=>21800, -27271=>21801, -27291=>21802, -27312=>21803, -27313=>21804, -27316=>21805, -27326=>21806, -27327=>21807, -27340=>21808, -27349=>21809, -27350=>21810, -27376=>21811, -27388=>21812, -27394=>21813, -27398=>21814, -27399=>21815, -27401=>21816, -27432=>21817, -27435=>21818, -27446=>21819, -27469=>21820, -27474=>21821, -27485=>21822, -27499=>21823, -27502=>21824, -27504=>21825, -27525=>21826, -27543=>21827, -27551=>21828, -27552=>21829, -27554=>21830, -27555=>21831, -27560=>21832, -27564=>21833, -27576=>21834, -27577=>21835, -27587=>21836, -27588=>21837, -27619=>21838, -27666=>21839, -27673=>21840, -27679=>21841, -27686=>21842, -27687=>21843, -27688=>21844, -27694=>21845, -27707=>21846, -27723=>21847, -27727=>21848, -27755=>21849, -27768=>21850, -27783=>21851, -27807=>21852, -27824=>21853, -27826=>21854, -27853=>21855, -27855=>21856, -27857=>21857, -27879=>21858, -27890=>21859, -27892=>21860, -27911=>21861, -27919=>21862, -27923=>21863, -27930=>21864, -27944=>21865, -27999=>21866, -28007=>21867, -28050=>21868, -28055=>21869, -28087=>21870, -28093=>21871, -28128=>21872, -28130=>21873, -28133=>21874, -28143=>21875, -28148=>21876, -28160=>21877, -28164=>21878, -28219=>21879, -28242=>21880, -28253=>21881, -28258=>21882, -28264=>21883, -28301=>21884, -28313=>21885, -28320=>21886, -28333=>21887, -28334=>21888, -28339=>21889, -28347=>21890, -28352=>21891, -28360=>21892, -28365=>21893, -28367=>21894, -28397=>21895, -28398=>21896, -28420=>21897, -28424=>21898, -28429=>21899, -28438=>21900, -28443=>21901, -28475=>21902, -28461=>21903, -28495=>21904, -28499=>21905, -28509=>21906, -28524=>21907, -28547=>21908, -28563=>21909, -28582=>21910, -28592=>21911, -28613=>21912, -28648=>21913, -28669=>21914, -28695=>21915, -28719=>21916, -28724=>21917, -28727=>21918, -28740=>21919, -28744=>21920, -28757=>21921, -28820=>21922, -28822=>21923, -28827=>21924, -28852=>21925, -28922=>21926, -28933=>21927, -28939=>21928, -28973=>21929, -28984=>21930, -28993=>21931, -29003=>21932, -29015=>21934, -29018=>21935, -29068=>21936, -29082=>21937, -29104=>21938, -29119=>21939, -29120=>21940, -29132=>21941, -29146=>21942, -29176=>21943, -29192=>21944, -29193=>21945, -29203=>21946, -29210=>21947, -29220=>21948, -29231=>21949, -29253=>21950, -29262=>21951, -29278=>21952, -29291=>21953, -29297=>21954, -29307=>21955, -29308=>21956, -29321=>21957, -29331=>21958, -29352=>21959, -29397=>21960, -29398=>21961, -29400=>21962, -29407=>21963, -29438=>21964, -29453=>21965, -29459=>21966, -29490=>21967, -29493=>21968, -29526=>21969, -29533=>21970, -29534=>21971, -29535=>21972, -29536=>21973, -29545=>21974, -29561=>21975, -29568=>21976, -29582=>21977, -29584=>21978, -29587=>21979, -29591=>21980, -29610=>21981, -29613=>21982, -29638=>21983, -29644=>21984, -29651=>21985, -29661=>21986, -29670=>21987, -29687=>21988, -29691=>21989, -29695=>21990, -29696=>21991, -29713=>21992, -29741=>21993, -29799=>21994, -29800=>21995, -29806=>21996, -29839=>21997, -29841=>21998, -29850=>21999, -29870=>22000, -29873=>22001, -29874=>22002, -29900=>22003, -29904=>22004, -29907=>22005, -29915=>22007, -29928=>22008, -29930=>22009, -29948=>22011, -29958=>22012, -29970=>22013, -29991=>22014, -29993=>22015, -30006=>22016, -30009=>22017, -30019=>22018, -30023=>22019, -30039=>22020, -30047=>22021, -30049=>22022, -30075=>22023, -30076=>22024, -30085=>22025, -30101=>22026, -30108=>22027, -30138=>22028, -30226=>22029, -30243=>22030, -30249=>22031, -30265=>22032, -30266=>22033, -30272=>22034, -30276=>22035, -30297=>22036, -30341=>22037, -30348=>22038, -30349=>22039, -30367=>22040, -30370=>22041, -30371=>22042, -30401=>22043, -30411=>22044, -30432=>22046, -30454=>22047, -30470=>22048, -30482=>22049, -30484=>22050, -30485=>22051, -30492=>22052, -30510=>22053, -30525=>22054, -30530=>22055, -30546=>22056, -30550=>22057, -30551=>22058, -30576=>22059, -30579=>22060, -30580=>22061, -30638=>22064, -30641=>22065, -30645=>22066, -30659=>22067, -30674=>22068, -30677=>22069, -30712=>22070, -30734=>22071, -30737=>22072, -30749=>22073, -30755=>22074, -30788=>22075, -30792=>22076, -30796=>22077, -30802=>22078, -30814=>22079, -30816=>22080, -30817=>22081, -30819=>22082, -30863=>22083, -30888=>22084, -30892=>22085, -30898=>22086, -30909=>22087, -30911=>22088, -30919=>22089, -30930=>22090, -30934=>22091, -30939=>22092, -30943=>22093, -30954=>22094, -30963=>22095, -30966=>22096, -30975=>22097, -30982=>22098, -31002=>22099, -31006=>22100, -31008=>22101, -31017=>22102, -31021=>22103, -31029=>22104, -31044=>22105, -31051=>22106, -31055=>22107, -31057=>22108, -31081=>22109, -31099=>22110, -31102=>22111, -31116=>22112, -31121=>22113, -31123=>22114, -31132=>22115, -31144=>22116, -31151=>22117, -31183=>22118, -31197=>22119, -31200=>22120, -31202=>22121, -31205=>22122, -31217=>22123, -31224=>22124, -31228=>22125, -31239=>22126, -31265=>22127, -31271=>22128, -31275=>22129, -31279=>22130, -31284=>22131, -31285=>22132, -31304=>22133, -31317=>22134, -31333=>22135, -31358=>22136, -31371=>22137, -31377=>22138, -31390=>22139, -31433=>22140, -31451=>22141, -31465=>22142, -31468=>22143, -31473=>22144, -31483=>22145, -31519=>22146, -31523=>22147, -31529=>22148, -31536=>22149, -31540=>22150, -31551=>22151, -31552=>22152, -31594=>22153, -31620=>22154, -31625=>22155, -31630=>22156, -31638=>22157, -31653=>22158, -31666=>22159, -31670=>22160, -31674=>22161, -31675=>22162, -31677=>22163, -31682=>22164, -31688=>22165, -31707=>22166, -31732=>22167, -31733=>22168, -31737=>22169, -31738=>22170, -31746=>22171, -31748=>22172, -31750=>22173, -31756=>22174, -31769=>22175, -31771=>22176, -31781=>22177, -31788=>22178, -31796=>22179, -31801=>22180, -31802=>22181, -31814=>22182, -31829=>22183, -31834=>22184, -31843=>22185, -31868=>22187, -31878=>22188, -31920=>22189, -31931=>22190, -31951=>22191, -31956=>22192, -31977=>22193, -32015=>22194, -32017=>22195, -32022=>22196, -32038=>22197, -32042=>22198, -32045=>22199, -32081=>22200, -32087=>22201, -32101=>22202, -32103=>22203, -32120=>22204, -32123=>22205, -32129=>22206, -32150=>22207, -32195=>22208, -32196=>22209, -32197=>22210, -32198=>22211, -32205=>22212, -32206=>22213, -32256=>22214, -32226=>22215, -32234=>22216, -32237=>22217, -32250=>22218, -32284=>22219, -32301=>22220, -32307=>22221, -32319=>22222, -32334=>22223, -32336=>22224, -32344=>22225, -32351=>22226, -32357=>22227, -32405=>22228, -32413=>22229, -32414=>22230, -32575=>22231, -32604=>22232, -32614=>22233, -32653=>22235, -32655=>22236, -32678=>22237, -32682=>22238, -32692=>22239, -32700=>22240, -32704=>22241, -32712=>22242, -32744=>22243, -32783=>22244, -32787=>22245, -32797=>22246, -32799=>22247, -32800=>22248, -32814=>22249, -32820=>22250, -32830=>22251, -32832=>22252, -32836=>22253, -32868=>22254, -32877=>22255, -32897=>22256, -32953=>22257, -32968=>22258, -32973=>22259, -32978=>22260, -33006=>22261, -33010=>22262, -33014=>22263, -33017=>22264, -33035=>22265, -33052=>22266, -33056=>22267, -33084=>22268, -33093=>22269, -33095=>22270, -33106=>22271, -33121=>22272, -33143=>22273, -33158=>22274, -33166=>22275, -33174=>22276, -33186=>22277, -33198=>22278, -33221=>22279, -33230=>22280, -33259=>22281, -33264=>22282, -33265=>22283, -33266=>22284, -33269=>22285, -33272=>22286, -33295=>22288, -33309=>22289, -33320=>22290, -33347=>22291, -33358=>22292, -33361=>22293, -33366=>22294, -33383=>22295, -33403=>22296, -33408=>22297, -33409=>22298, -33415=>22299, -33428=>22300, -33430=>22301, -33432=>22302, -33434=>22303, -33435=>22304, -33440=>22305, -33498=>22306, -33504=>22307, -33508=>22308, -33517=>22309, -33546=>22310, -33547=>22311, -33566=>22312, -33567=>22313, -33569=>22314, -33580=>22315, -33582=>22316, -33587=>22317, -33591=>22318, -33597=>22319, -33602=>22320, -33613=>22321, -33614=>22322, -33648=>22323, -33664=>22324, -33666=>22325, -33668=>22326, -33689=>22327, -33692=>22328, -33702=>22329, -33708=>22330, -33726=>22331, -33619=>22332, -33768=>22333, -33817=>22334, -33709=>22335, -33839=>22336, -33861=>22337, -33863=>22338, -33869=>22339, -33878=>22340, -33888=>22342, -33892=>22343, -33895=>22344, -33898=>22345, -33908=>22346, -33917=>22347, -33938=>22348, -33941=>22349, -33961=>22350, -33962=>22351, -33991=>22352, -33992=>22353, -33996=>22354, -34034=>22355, -34039=>22356, -34050=>22357, -34051=>22358, -34055=>22359, -34062=>22360, -34064=>22361, -34076=>22362, -34082=>22363, -34087=>22364, -34090=>22365, -34099=>22366, -34102=>22367, -34111=>22368, -34128=>22369, -34130=>22370, -34140=>22371, -34143=>22373, -34144=>22374, -34169=>22375, -34185=>22376, -34187=>22377, -34208=>22378, -34213=>22379, -34215=>22380, -34228=>22381, -34230=>22382, -34232=>22383, -34237=>22384, -34238=>22385, -34239=>22386, -34242=>22387, -34266=>22388, -34272=>22389, -34280=>22390, -34291=>22391, -34300=>22392, -34317=>22393, -34318=>22394, -34329=>22395, -34331=>22396, -34358=>22397, -34362=>22398, -34365=>22399, -34392=>22400, -34393=>22401, -34397=>22402, -34400=>22403, -34401=>22404, -34404=>22405, -34409=>22406, -34422=>22407, -34454=>22408, -34458=>22409, -34465=>22410, -34470=>22411, -34477=>22412, -34484=>22413, -34485=>22414, -34487=>22415, -34489=>22416, -34495=>22417, -34501=>22418, -34514=>22419, -34522=>22420, -34524=>22421, -34528=>22422, -34533=>22423, -34535=>22424, -34440=>22425, -34564=>22426, -34575=>22427, -34607=>22428, -34610=>22429, -34620=>22430, -34621=>22431, -34629=>22432, -34637=>22433, -34657=>22434, -34671=>22435, -34691=>22436, -34692=>22437, -34693=>22438, -34694=>22439, -34704=>22440, -34709=>22441, -34737=>22443, -34760=>22444, -34762=>22445, -34773=>22446, -34777=>22447, -34780=>22448, -34786=>22449, -34788=>22450, -34801=>22451, -34803=>22452, -34808=>22453, -34810=>22454, -34815=>22455, -34825=>22456, -34841=>22457, -34834=>22458, -34842=>22459, -34846=>22460, -34864=>22461, -34869=>22462, -34881=>22463, -34883=>22464, -34888=>22465, -34889=>22466, -34897=>22468, -34908=>22469, -34912=>22470, -34929=>22471, -34937=>22472, -34939=>22473, -34944=>22474, -34975=>22475, -34984=>22476, -35002=>22477, -35019=>22478, -35020=>22479, -35038=>22480, -35047=>22481, -35063=>22482, -35085=>22483, -35093=>22484, -35094=>22485, -35104=>22486, -35112=>22487, -35121=>22488, -35130=>22489, -35142=>22490, -35151=>22491, -35154=>22492, -35159=>22493, -35163=>22494, -35169=>22495, -35171=>22496, -35182=>22497, -35187=>22498, -35189=>22499, -35194=>22500, -35197=>22501, -35213=>22502, -35221=>22503, -35227=>22504, -35228=>22505, -35232=>22506, -35252=>22507, -35254=>22508, -35287=>22509, -35305=>22510, -35309=>22511, -35321=>22512, -35332=>22513, -35333=>22514, -35358=>22515, -35360=>22516, -35364=>22517, -35366=>22518, -35371=>22519, -35372=>22520, -35375=>22521, -35389=>22522, -35392=>22523, -35395=>22524, -35411=>22525, -35414=>22526, -35420=>22527, -35429=>22528, -35446=>22529, -35447=>22530, -35450=>22531, -35451=>22532, -35456=>22533, -35459=>22534, -35467=>22535, -35471=>22536, -35474=>22537, -35479=>22538, -35481=>22539, -35487=>22540, -35497=>22541, -35503=>22542, -35507=>22543, -35515=>22544, -35523=>22545, -35526=>22546, -35528=>22547, -35530=>22548, -35539=>22549, -35540=>22550, -35541=>22551, -35568=>22552, -35583=>22553, -35595=>22554, -35614=>22555, -35632=>22556, -35644=>22557, -35650=>22558, -35656=>22559, -35661=>22560, -35683=>22561, -35705=>22562, -35716=>22563, -35725=>22564, -35727=>22565, -35896=>22566, -35902=>22567, -35921=>22568, -35928=>22569, -35931=>22570, -35933=>22571, -35929=>22572, -35939=>22573, -35940=>22574, -35942=>22575, -35957=>22576, -35958=>22577, -35966=>22578, -35974=>22579, -35975=>22580, -35979=>22581, -35984=>22582, -35996=>22584, -36025=>22585, -36038=>22586, -36043=>22587, -36047=>22588, -36061=>22589, -36072=>22590, -36079=>22591, -36082=>22592, -36095=>22593, -36197=>22594, -36223=>22595, -36226=>22596, -36232=>22597, -36240=>22598, -36254=>22599, -36256=>22600, -36268=>22601, -36277=>22602, -36279=>22603, -36281=>22604, -36283=>22605, -36288=>22606, -36293=>22607, -36295=>22608, -36298=>22609, -36308=>22610, -36325=>22611, -36336=>22612, -36284=>22613, -36356=>22614, -36357=>22615, -36369=>22616, -36403=>22617, -36407=>22618, -36408=>22619, -36430=>22620, -36443=>22621, -36445=>22622, -36446=>22623, -36473=>22624, -36482=>22625, -36483=>22626, -36507=>22627, -36509=>22628, -36514=>22629, -36538=>22630, -36545=>22631, -36547=>22632, -36548=>22633, -36551=>22634, -36572=>22635, -36590=>22636, -36593=>22637, -36599=>22638, -36589=>22639, -36610=>22640, -36623=>22641, -36624=>22642, -36630=>22643, -36640=>22644, -36641=>22645, -36643=>22646, -36648=>22647, -36654=>22648, -36660=>22649, -36663=>22650, -36673=>22651, -36687=>22652, -36690=>22653, -36691=>22654, -36701=>22655, -36702=>22656, -36709=>22657, -36765=>22658, -36792=>22659, -36798=>22660, -36800=>22661, -36811=>22662, -36816=>22663, -36818=>22664, -36835=>22665, -36862=>22666, -36888=>22667, -36904=>22668, -36905=>22669, -36906=>22670, -36915=>22671, -36916=>22672, -36927=>22673, -36962=>22674, -36966=>22675, -36972=>22676, -37006=>22677, -37029=>22678, -37068=>22679, -37077=>22680, -37080=>22681, -37081=>22682, -37093=>22683, -37074=>22684, -37128=>22685, -37133=>22686, -37136=>22687, -37146=>22688, -37152=>22689, -37161=>22690, -37166=>22691, -37174=>22692, -37180=>22693, -37187=>22694, -37199=>22695, -37203=>22696, -37229=>22697, -37243=>22698, -37249=>22699, -37254=>22700, -37267=>22701, -37268=>22702, -37272=>22703, -37281=>22704, -37286=>22705, -37311=>22706, -37331=>22707, -37332=>22708, -37337=>22709, -37353=>22710, -37354=>22711, -37359=>22712, -37369=>22713, -37373=>22714, -37380=>22715, -37381=>22716, -37388=>22717, -37394=>22718, -37395=>22719, -37400=>22720, -37404=>22721, -37405=>22722, -37412=>22723, -37413=>22724, -37414=>22725, -37422=>22726, -37423=>22727, -37424=>22728, -37429=>22729, -37430=>22730, -37438=>22731, -37446=>22732, -37453=>22733, -37464=>22734, -37468=>22735, -37469=>22736, -37481=>22737, -37486=>22738, -37487=>22739, -37488=>22740, -37493=>22741, -37497=>22742, -37499=>22743, -37514=>22744, -37522=>22745, -37536=>22746, -37540=>22747, -37541=>22748, -37544=>22749, -37558=>22750, -37560=>22751, -37562=>22752, -37565=>22753, -37575=>22754, -37581=>22755, -37592=>22756, -37596=>22757, -37597=>22758, -37601=>22759, -37603=>22760, -37608=>22761, -37612=>22762, -37614=>22763, -37616=>22764, -37632=>22765, -37640=>22766, -37660=>22767, -37668=>22768, -37674=>22769, -37684=>22770, -37687=>22771, -37712=>22772, -37717=>22773, -37726=>22774, -37735=>22775, -37737=>22776, -37743=>22777, -37748=>22778, -37750=>22779, -37754=>22780, -37757=>22781, -37760=>22782, -37761=>22783, -37773=>22784, -37778=>22785, -37781=>22786, -37784=>22787, -37798=>22789, -37800=>22790, -37803=>22791, -37812=>22792, -37813=>22793, -37814=>22794, -37828=>22795, -37829=>22796, -37833=>22797, -37835=>22798, -37837=>22799, -37843=>22800, -37849=>22801, -37879=>22802, -37889=>22803, -37896=>22804, -37909=>22805, -37919=>22806, -37935=>22807, -37949=>22808, -37955=>22809, -37977=>22810, -37980=>22811, -37983=>22812, -37985=>22813, -37992=>22814, -37998=>22815, -38020=>22816, -38019=>22817, -38270=>22818, -38276=>22819, -38301=>22820, -38302=>22821, -38330=>22822, -38361=>22823, -38365=>22824, -38367=>22825, -38430=>22826, -38434=>22827, -38437=>22828, -38438=>22829, -38455=>22830, -38457=>22831, -38458=>22832, -38482=>22833, -38486=>22834, -38487=>22835, -38510=>22836, -38524=>22837, -38526=>22838, -38545=>22839, -38559=>22840, -38566=>22841, -38602=>22842, -38623=>22844, -38650=>22845, -38661=>22846, -38682=>22847, -38685=>22848, -38730=>22850, -38744=>22851, -38775=>22852, -38776=>22853, -38779=>22854, -38784=>22855, -38793=>22856, -38807=>22857, -38840=>22858, -38844=>22859, -38847=>22860, -38852=>22861, -38853=>22862, -38855=>22863, -38858=>22864, -38862=>22865, -38864=>22866, -38871=>22867, -38877=>22868, -38884=>22869, -38903=>22870, -38904=>22871, -38906=>22872, -38937=>22873, -38940=>22874, -38944=>22875, -38959=>22876, -38965=>22877, -38980=>22878, -38986=>22879, -38993=>22880, -39018=>22881, -39086=>22882, -39116=>22883, -39142=>22884, -39158=>22885, -39175=>22886, -39199=>22887, -39202=>22888, -39206=>22889, -39211=>22890, -39220=>22891, -39225=>22892, -39239=>22893, -39257=>22894, -39259=>22895, -39323=>22896, -39325=>22897, -39327=>22898, -39344=>22899, -39346=>22900, -39349=>22901, -39379=>22902, -39386=>22903, -39388=>22904, -39399=>22905, -39402=>22906, -39403=>22907, -39404=>22908, -39412=>22909, -39413=>22910, -39421=>22911, -39422=>22912, -39428=>22913, -39435=>22914, -39454=>22915, -39458=>22916, -39475=>22917, -39477=>22918, -39495=>22919, -39499=>22921, -39508=>22922, -39517=>22923, -39594=>22924, -39596=>22925, -39598=>22926, -39602=>22927, -39604=>22928, -39611=>22929, -39615=>22930, -39624=>22931, -39639=>22932, -39643=>22933, -39652=>22934, -39655=>22935, -39660=>22936, -39666=>22937, -39667=>22938, -39669=>22939, -39674=>22940, -39677=>22941, -39679=>22942, -39680=>22943, -39684=>22944, -39685=>22945, -39707=>22946, -39718=>22947, -39735=>22949, -39737=>22950, -39738=>22951, -39756=>22952, -39766=>22953, -39767=>22954, -39771=>22955, -39777=>22956, -39786=>22957, -39789=>22958, -39790=>22959, -39800=>22960, -39807=>22961, -39813=>22962, -39815=>22963, -39817=>22964, -39819=>22965, -39821=>22966, -39828=>22967, -39834=>22968, -39849=>22969, -39863=>22970, -39868=>22971, -39888=>22972, -39929=>22973, -39951=>22974, -39953=>22975, -39966=>22976, -39974=>22977, -39976=>22978, -39997=>22979, -40003=>22980, -40014=>22981, -40030=>22982, -40059=>22983, -40183=>22984, -40185=>22985, -40220=>22986, -40239=>22987, -40243=>22988, -40244=>22989, -40250=>22990, -40252=>22991, -40261=>22992, -40275=>22993, -40276=>22994, -40293=>22995, -40323=>22996, -40326=>22997, -40334=>22998, -40338=>22999, -40339=>23000, -40341=>23001, -40343=>23002, -40344=>23003, -40362=>23004, -40366=>23005, -40394=>23007, -40404=>23008, -40405=>23009, -40414=>23010, -40430=>23011, -40432=>23012, -40446=>23013, -40462=>23014, -40464=>23015, -40465=>23016, -40466=>23017, -40470=>23018, -40583=>23019, -40590=>23020, -40591=>23021, -40598=>23022, -40600=>23023, -40622=>23024, -40627=>23025, -40646=>23026, -40648=>23027, -40651=>23028, -40661=>23029, -40684=>23030, -40685=>23031, -40689=>23032, -40693=>23033, -40696=>23034, -40721=>23035, -40726=>23036, -40730=>23037, -40735=>23038, -40753=>23039, -40754=>23040, -40764=>23041, -40767=>23042, -40771=>23043, -40772=>23044, -40775=>23045, -40790=>23046, -40798=>23047, -40814=>23048, -40819=>23049, -40826=>23050, -40829=>23051, -40847=>23052, -40849=>23053, -40850=>23054, -40854=>23055, -40865=>23056, -40867=>23057, -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ak12.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ak12.php deleted file mode 100644 index 6d20827f8b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/uni2cid_ak12.php +++ /dev/null @@ -1,17530 +0,0 @@ -<?php -// unicode to cid conversion table is from -// ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/ -// cid2code.txt in ak12.tar.Z -$cidinfo['uni2cid'] = array( -32=>1, -33=>2, -34=>3, -35=>4, -36=>5, -37=>6, -38=>7, -39=>8, -40=>9, -41=>10, -42=>11, -43=>12, -44=>13, -45=>14, -46=>15, -47=>16, -48=>17, -49=>18, -50=>19, -51=>20, -52=>21, -53=>22, -54=>23, -55=>24, -56=>25, -57=>26, -58=>27, -59=>28, -60=>29, -61=>30, -62=>31, -63=>32, -64=>33, -65=>34, -66=>35, -67=>36, -68=>37, -69=>38, -70=>39, -71=>40, -72=>41, -73=>42, -74=>43, -75=>44, -76=>45, -77=>46, -78=>47, -79=>48, -80=>49, -81=>50, -82=>51, -83=>52, -84=>53, -85=>54, -86=>55, -87=>56, -88=>57, -89=>58, -90=>59, -91=>60, -92=>61, -93=>62, -94=>63, -95=>64, -96=>65, -97=>66, -98=>67, -99=>68, -100=>69, -101=>70, -102=>71, -103=>72, -104=>73, -105=>74, -106=>75, -107=>76, -108=>77, -109=>78, -110=>79, -111=>80, -112=>81, -113=>82, -114=>83, -115=>84, -116=>85, -117=>86, -118=>87, -119=>88, -120=>89, -121=>90, -122=>91, -123=>92, -124=>93, -125=>94, -126=>95, -8361=>96, -8208=>97, -169=>98, -12644=>101, -12288=>101, -12289=>102, -12290=>103, -183=>104, -12539=>104, -8229=>105, -8943=>106, -8230=>106, -168=>107, -12291=>108, -8211=>109, -8212=>110, -8214=>111, -65340=>112, -65374=>113, -8216=>114, -8217=>115, -8220=>116, -8221=>117, -12308=>118, -12309=>119, -12296=>120, -12297=>121, -12298=>122, -12299=>123, -12300=>124, -12301=>125, -12302=>126, -12303=>127, -12304=>128, -12305=>129, -177=>130, -215=>131, -247=>132, -8800=>133, -8804=>134, -8805=>135, -8734=>136, -8756=>137, -176=>138, -8242=>139, -8243=>140, -8451=>141, -8491=>142, -65504=>143, -65505=>144, -65509=>145, -9794=>146, -9792=>147, -8736=>148, -8869=>149, -8978=>150, -8706=>151, -8711=>152, -8801=>153, -8786=>154, -167=>155, -8251=>156, -9734=>157, -9733=>158, -9675=>159, -9679=>160, -9678=>161, -9671=>162, -9670=>163, -9633=>164, -9632=>165, -9651=>166, -9650=>167, -9661=>168, -9660=>169, -8594=>170, -8592=>171, -8593=>172, -8595=>173, -8596=>174, -12307=>175, -171=>176, -187=>177, -8730=>178, -8765=>179, -8733=>180, -8757=>181, -8747=>182, -8748=>183, -8712=>184, -8715=>185, -8838=>186, -8839=>187, -8834=>188, -8835=>189, -8746=>190, -8745=>191, -8743=>192, -8744=>193, -65506=>194, -8658=>195, -8660=>196, -8704=>197, -8707=>198, -180=>199, -732=>200, -711=>201, -728=>202, -733=>203, -730=>204, -729=>205, -184=>206, -731=>207, -161=>208, -191=>209, -8758=>210, -8750=>211, -8721=>212, -8719=>213, -164=>214, -8457=>215, -8240=>216, -9665=>217, -9664=>218, -9655=>219, -9654=>220, -9828=>221, -9824=>222, -9825=>223, -9829=>224, -9831=>225, -9827=>226, -9673=>227, -9672=>228, -9635=>229, -9680=>230, -9681=>231, -9618=>232, -9636=>233, -9637=>234, -9640=>235, -9639=>236, -9638=>237, -9641=>238, -9832=>239, -9743=>240, -9742=>241, -9756=>242, -9758=>243, -182=>244, -8224=>245, -8225=>246, -8597=>247, -8599=>248, -8601=>249, -8598=>250, -8600=>251, -9837=>252, -9833=>253, -9834=>254, -9836=>255, -12927=>256, -12828=>257, -8470=>258, -13255=>259, -8482=>260, -13250=>261, -13272=>262, -8481=>263, -65281=>264, -65282=>265, -65283=>266, -65284=>267, -65285=>268, -65286=>269, -65287=>270, -65288=>271, -65289=>272, -65290=>273, -65291=>274, -65292=>275, -65293=>276, -65294=>277, -65295=>278, -65296=>279, -65297=>280, -65298=>281, -65299=>282, -65300=>283, -65301=>284, -65302=>285, -65303=>286, -65304=>287, -65305=>288, -65306=>289, -65307=>290, -65308=>291, -65309=>292, -65310=>293, -65311=>294, -65312=>295, -65313=>296, -65314=>297, -65315=>298, -65316=>299, -65317=>300, -65318=>301, -65319=>302, -65320=>303, -65321=>304, -65322=>305, -65323=>306, -65324=>307, -65325=>308, -65326=>309, -65327=>310, -65328=>311, -65329=>312, -65330=>313, -65331=>314, -65332=>315, -65333=>316, -65334=>317, -65335=>318, -65336=>319, -65337=>320, -65338=>321, -65339=>322, -65510=>323, -65341=>324, -65342=>325, -65343=>326, -65344=>327, -65345=>328, -65346=>329, -65347=>330, -65348=>331, -65349=>332, -65350=>333, -65351=>334, -65352=>335, -65353=>336, -65354=>337, -65355=>338, -65356=>339, -65357=>340, -65358=>341, -65359=>342, -65360=>343, -65361=>344, -65362=>345, -65363=>346, -65364=>347, -65365=>348, -65366=>349, -65367=>350, -65368=>351, -65369=>352, -65370=>353, -65371=>354, -65372=>355, -65373=>356, -65507=>357, -12593=>358, -12594=>359, -12595=>360, -12596=>361, -12597=>362, -12598=>363, -12599=>364, -12600=>365, -12601=>366, -12602=>367, -12603=>368, -12604=>369, -12605=>370, -12606=>371, -12607=>372, -12608=>373, -12609=>374, -12610=>375, -12611=>376, -12612=>377, -12613=>378, -12614=>379, -12615=>380, -12616=>381, -12617=>382, -12618=>383, -12619=>384, -12620=>385, -12621=>386, -12622=>387, -12623=>388, -12624=>389, -12625=>390, -12626=>391, -12627=>392, -12628=>393, -12629=>394, -12630=>395, -12631=>396, -12632=>397, -12633=>398, -12634=>399, -12635=>400, -12636=>401, -12637=>402, -12638=>403, -12639=>404, -12640=>405, -12641=>406, -12642=>407, -12643=>408, -12645=>409, -12646=>410, -12647=>411, -12648=>412, -12649=>413, -12650=>414, -12651=>415, -12652=>416, -12653=>417, -12654=>418, -12655=>419, -12656=>420, -12657=>421, -12658=>422, -12659=>423, -12660=>424, -12661=>425, -12662=>426, -12663=>427, -12664=>428, -12665=>429, -12666=>430, -12667=>431, -12668=>432, -12669=>433, -12670=>434, -12671=>435, -12672=>436, -12673=>437, -12674=>438, -12675=>439, -12676=>440, -12677=>441, -12678=>442, -12679=>443, -12680=>444, -12681=>445, -12682=>446, -12683=>447, -12684=>448, -12685=>449, -12686=>450, -8560=>451, -8561=>452, -8562=>453, -8563=>454, -8564=>455, -8565=>456, -8566=>457, -8567=>458, -8568=>459, -8569=>460, -8544=>461, -8545=>462, -8546=>463, -8547=>464, -8548=>465, -8549=>466, -8550=>467, -8551=>468, -8552=>469, -8553=>470, -913=>471, -914=>472, -915=>473, -916=>474, -917=>475, -918=>476, -919=>477, -920=>478, -921=>479, -922=>480, -923=>481, -924=>482, -925=>483, -926=>484, -927=>485, -928=>486, -929=>487, -931=>488, -932=>489, -933=>490, -934=>491, -935=>492, -936=>493, -937=>494, -945=>495, -946=>496, -947=>497, -948=>498, -949=>499, -950=>500, -951=>501, -952=>502, -953=>503, -954=>504, -955=>505, -956=>506, -957=>507, -958=>508, -959=>509, -960=>510, -961=>511, -963=>512, -964=>513, -965=>514, -966=>515, -967=>516, -968=>517, -969=>518, -9472=>519, -9474=>520, -9484=>521, -9488=>522, -9496=>523, -9492=>524, -9500=>525, -9516=>526, -9508=>527, -9524=>528, -9532=>529, -9473=>530, -9475=>531, -9487=>532, -9491=>533, -9499=>534, -9495=>535, -9507=>536, -9523=>537, -9515=>538, -9531=>539, -9547=>540, -9504=>541, -9519=>542, -9512=>543, -9527=>544, -9535=>545, -9501=>546, -9520=>547, -9509=>548, -9528=>549, -9538=>550, -9490=>551, -9489=>552, -9498=>553, -9497=>554, -9494=>555, -9493=>556, -9486=>557, -9485=>558, -9502=>559, -9503=>560, -9505=>561, -9506=>562, -9510=>563, -9511=>564, -9513=>565, -9514=>566, -9517=>567, -9518=>568, -9521=>569, -9522=>570, -9525=>571, -9526=>572, -9529=>573, -9530=>574, -9533=>575, -9534=>576, -9536=>577, -9537=>578, -9539=>579, -9540=>580, -9541=>581, -9542=>582, -9543=>583, -9544=>584, -9545=>585, -9546=>586, -13205=>587, -13206=>588, -13207=>589, -8467=>590, -13208=>591, -13252=>592, -13219=>593, -13220=>594, -13221=>595, -13222=>596, -13209=>597, -13210=>598, -13211=>599, -13212=>600, -13213=>601, -13214=>602, -13215=>603, -13216=>604, -13217=>605, -13218=>606, -13258=>607, -13197=>608, -13198=>609, -13199=>610, -13263=>611, -13192=>612, -13193=>613, -13256=>614, -13223=>615, -13224=>616, -13232=>617, -13233=>618, -13234=>619, -13235=>620, -13236=>621, -13237=>622, -13238=>623, -13239=>624, -13240=>625, -13241=>626, -13184=>627, -13185=>628, -13186=>629, -13187=>630, -13188=>631, -13242=>632, -13243=>633, -13244=>634, -13245=>635, -13246=>636, -13247=>637, -13200=>638, -13201=>639, -13202=>640, -13203=>641, -13204=>642, -8486=>643, -13248=>644, -13249=>645, -13194=>646, -13195=>647, -13196=>648, -13270=>649, -13253=>650, -13229=>651, -13230=>652, -13231=>653, -13275=>654, -13225=>655, -13226=>656, -13227=>657, -13228=>658, -13277=>659, -13264=>660, -13267=>661, -13251=>662, -13257=>663, -13276=>664, -13254=>665, -198=>666, -208=>667, -170=>668, -294=>669, -306=>670, -319=>671, -321=>672, -216=>673, -338=>674, -186=>675, -222=>676, -358=>677, -330=>678, -12896=>679, -12897=>680, -12898=>681, -12899=>682, -12900=>683, -12901=>684, -12902=>685, -12903=>686, -12904=>687, -12905=>688, -12906=>689, -12907=>690, -12908=>691, -12909=>692, -12910=>693, -12911=>694, -12912=>695, -12913=>696, -12914=>697, -12915=>698, -12916=>699, -12917=>700, -12918=>701, -12919=>702, -12920=>703, -12921=>704, -12922=>705, -12923=>706, -9424=>707, -9425=>708, -9426=>709, -9427=>710, -9428=>711, -9429=>712, -9430=>713, -9431=>714, -9432=>715, -9433=>716, -9434=>717, -9435=>718, -9436=>719, -9437=>720, -9438=>721, -9439=>722, -9440=>723, -9441=>724, -9442=>725, -9443=>726, -9444=>727, -9445=>728, -9446=>729, -9447=>730, -9448=>731, -9449=>732, -9312=>733, -9313=>734, -9314=>735, -9315=>736, -9316=>737, -9317=>738, -9318=>739, -9319=>740, -9320=>741, -9321=>742, -9322=>743, -9323=>744, -9324=>745, -9325=>746, -9326=>747, -189=>748, -8531=>749, -8532=>750, -188=>751, -190=>752, -8539=>753, -8540=>754, -8541=>755, -8542=>756, -230=>757, -273=>758, -240=>759, -295=>760, -305=>761, -307=>762, -312=>763, -320=>764, -322=>765, -248=>766, -339=>767, -223=>768, -254=>769, -359=>770, -331=>771, -329=>772, -12800=>773, -12801=>774, -12802=>775, -12803=>776, -12804=>777, -12805=>778, -12806=>779, -12807=>780, -12808=>781, -12809=>782, -12810=>783, -12811=>784, -12812=>785, -12813=>786, -12814=>787, -12815=>788, -12816=>789, -12817=>790, -12818=>791, -12819=>792, -12820=>793, -12821=>794, -12822=>795, -12823=>796, -12824=>797, -12825=>798, -12826=>799, -12827=>800, -9372=>801, -9373=>802, -9374=>803, -9375=>804, -9376=>805, -9377=>806, -9378=>807, -9379=>808, -9380=>809, -9381=>810, -9382=>811, -9383=>812, -9384=>813, -9385=>814, -9386=>815, -9387=>816, -9388=>817, -9389=>818, -9390=>819, -9391=>820, -9392=>821, -9393=>822, -9394=>823, -9395=>824, -9396=>825, -9397=>826, -9332=>827, -9333=>828, -9334=>829, -9335=>830, -9336=>831, -9337=>832, -9338=>833, -9339=>834, -9340=>835, -9341=>836, -9342=>837, -9343=>838, -9344=>839, -9345=>840, -9346=>841, -185=>842, -178=>843, -179=>844, -8308=>845, -8319=>846, -8321=>847, -8322=>848, -8323=>849, -8324=>850, -12353=>851, -12354=>852, -12355=>853, -12356=>854, -12357=>855, -12358=>856, -12359=>857, -12360=>858, -12361=>859, -12362=>860, -12363=>861, -12364=>862, -12365=>863, -12366=>864, -12367=>865, -12368=>866, -12369=>867, -12370=>868, -12371=>869, -12372=>870, -12373=>871, -12374=>872, -12375=>873, -12376=>874, -12377=>875, -12378=>876, -12379=>877, -12380=>878, -12381=>879, -12382=>880, -12383=>881, -12384=>882, -12385=>883, -12386=>884, -12387=>885, -12388=>886, -12389=>887, -12390=>888, -12391=>889, -12392=>890, -12393=>891, -12394=>892, -12395=>893, -12396=>894, -12397=>895, -12398=>896, -12399=>897, -12400=>898, -12401=>899, -12402=>900, -12403=>901, -12404=>902, -12405=>903, -12406=>904, -12407=>905, -12408=>906, -12409=>907, -12410=>908, -12411=>909, -12412=>910, -12413=>911, -12414=>912, -12415=>913, -12416=>914, -12417=>915, -12418=>916, -12419=>917, -12420=>918, -12421=>919, -12422=>920, -12423=>921, -12424=>922, -12425=>923, -12426=>924, -12427=>925, -12428=>926, -12429=>927, -12430=>928, -12431=>929, -12432=>930, -12433=>931, -12434=>932, -12435=>933, -12449=>934, -12450=>935, -12451=>936, -12452=>937, -12453=>938, -12454=>939, -12455=>940, -12456=>941, -12457=>942, -12458=>943, -12459=>944, -12460=>945, -12461=>946, -12462=>947, -12463=>948, -12464=>949, -12465=>950, -12466=>951, -12467=>952, -12468=>953, -12469=>954, -12470=>955, -12471=>956, -12472=>957, -12473=>958, -12474=>959, -12475=>960, -12476=>961, -12477=>962, -12478=>963, -12479=>964, -12480=>965, -12481=>966, -12482=>967, -12483=>968, -12484=>969, -12485=>970, -12486=>971, -12487=>972, -12488=>973, -12489=>974, -12490=>975, -12491=>976, -12492=>977, -12493=>978, -12494=>979, -12495=>980, -12496=>981, -12497=>982, -12498=>983, -12499=>984, -12500=>985, -12501=>986, -12502=>987, -12503=>988, -12504=>989, -12505=>990, -12506=>991, -12507=>992, -12508=>993, -12509=>994, -12510=>995, -12511=>996, -12512=>997, -12513=>998, -12514=>999, -12515=>1000, -12516=>1001, -12517=>1002, -12518=>1003, -12519=>1004, -12520=>1005, -12521=>1006, -12522=>1007, -12523=>1008, -12524=>1009, -12525=>1010, -12526=>1011, -12527=>1012, -12528=>1013, -12529=>1014, -12530=>1015, -12531=>1016, -12532=>1017, -12533=>1018, -12534=>1019, -1040=>1020, -1041=>1021, -1042=>1022, -1043=>1023, -1044=>1024, -1045=>1025, -1025=>1026, -1046=>1027, -1047=>1028, -1048=>1029, -1049=>1030, -1050=>1031, -1051=>1032, -1052=>1033, -1053=>1034, -1054=>1035, -1055=>1036, -1056=>1037, -1057=>1038, -1058=>1039, -1059=>1040, -1060=>1041, -1061=>1042, -1062=>1043, -1063=>1044, -1064=>1045, -1065=>1046, -1066=>1047, -1067=>1048, -1068=>1049, -1069=>1050, -1070=>1051, -1071=>1052, -1072=>1053, -1073=>1054, -1074=>1055, -1075=>1056, -1076=>1057, -1077=>1058, -1105=>1059, -1078=>1060, -1079=>1061, -1080=>1062, -1081=>1063, -1082=>1064, -1083=>1065, -1084=>1066, -1085=>1067, -1086=>1068, -1087=>1069, -1088=>1070, -1089=>1071, -1090=>1072, -1091=>1073, -1092=>1074, -1093=>1075, -1094=>1076, -1095=>1077, -1096=>1078, -1097=>1079, -1098=>1080, -1099=>1081, -1100=>1082, -1101=>1083, -1102=>1084, -1103=>1085, -44032=>1086, -44033=>1087, -44036=>1088, -44039=>1089, -44040=>1090, -44041=>1091, -44042=>1092, -44048=>1093, -44049=>1094, -44050=>1095, -44051=>1096, -44052=>1097, -44053=>1098, -44054=>1099, -44055=>1100, -44057=>1101, -44058=>1102, -44059=>1103, -44060=>1104, -44061=>1105, -44064=>1106, -44068=>1107, -44076=>1108, -44077=>1109, -44079=>1110, -44080=>1111, -44081=>1112, -44088=>1113, -44089=>1114, -44092=>1115, -44096=>1116, -44107=>1117, -44109=>1118, -44116=>1119, -44120=>1120, -44124=>1121, -44144=>1122, -44145=>1123, -44148=>1124, -44151=>1125, -44152=>1126, -44154=>1127, -44160=>1128, -44161=>1129, -44163=>1130, -44164=>1131, -44165=>1132, -44166=>1133, -44169=>1134, -44170=>1135, -44171=>1136, -44172=>1137, -44176=>1138, -44180=>1139, -44188=>1140, -44189=>1141, -44191=>1142, -44192=>1143, -44193=>1144, -44200=>1145, -44201=>1146, -44202=>1147, -44204=>1148, -44207=>1149, -44208=>1150, -44216=>1151, -44217=>1152, -44219=>1153, -44220=>1154, -44221=>1155, -44225=>1156, -44228=>1157, -44232=>1158, -44236=>1159, -44245=>1160, -44247=>1161, -44256=>1162, -44257=>1163, -44260=>1164, -44263=>1165, -44264=>1166, -44266=>1167, -44268=>1168, -44271=>1169, -44272=>1170, -44273=>1171, -44275=>1172, -44277=>1173, -44278=>1174, -44284=>1175, -44285=>1176, -44288=>1177, -44292=>1178, -44294=>1179, -44300=>1180, -44301=>1181, -44303=>1182, -44305=>1183, -44312=>1184, -44316=>1185, -44320=>1186, -44329=>1187, -44332=>1188, -44333=>1189, -44340=>1190, -44341=>1191, -44344=>1192, -44348=>1193, -44356=>1194, -44357=>1195, -44359=>1196, -44361=>1197, -44368=>1198, -44372=>1199, -44376=>1200, -44385=>1201, -44387=>1202, -44396=>1203, -44397=>1204, -44400=>1205, -44403=>1206, -44404=>1207, -44405=>1208, -44406=>1209, -44411=>1210, -44412=>1211, -44413=>1212, -44415=>1213, -44417=>1214, -44418=>1215, -44424=>1216, -44425=>1217, -44428=>1218, -44432=>1219, -44444=>1220, -44445=>1221, -44452=>1222, -44471=>1223, -44480=>1224, -44481=>1225, -44484=>1226, -44488=>1227, -44496=>1228, -44497=>1229, -44499=>1230, -44508=>1231, -44512=>1232, -44516=>1233, -44536=>1234, -44537=>1235, -44540=>1236, -44543=>1237, -44544=>1238, -44545=>1239, -44552=>1240, -44553=>1241, -44555=>1242, -44557=>1243, -44564=>1244, -44592=>1245, -44593=>1246, -44596=>1247, -44599=>1248, -44600=>1249, -44602=>1250, -44608=>1251, -44609=>1252, -44611=>1253, -44613=>1254, -44614=>1255, -44618=>1256, -44620=>1257, -44621=>1258, -44622=>1259, -44624=>1260, -44628=>1261, -44630=>1262, -44636=>1263, -44637=>1264, -44639=>1265, -44640=>1266, -44641=>1267, -44645=>1268, -44648=>1269, -44649=>1270, -44652=>1271, -44656=>1272, -44664=>1273, -44665=>1274, -44667=>1275, -44668=>1276, -44669=>1277, -44676=>1278, -44677=>1279, -44684=>1280, -44732=>1281, -44733=>1282, -44734=>1283, -44736=>1284, -44740=>1285, -44748=>1286, -44749=>1287, -44751=>1288, -44752=>1289, -44753=>1290, -44760=>1291, -44761=>1292, -44764=>1293, -44776=>1294, -44779=>1295, -44781=>1296, -44788=>1297, -44792=>1298, -44796=>1299, -44807=>1300, -44808=>1301, -44813=>1302, -44816=>1303, -44844=>1304, -44845=>1305, -44848=>1306, -44850=>1307, -44852=>1308, -44860=>1309, -44861=>1310, -44863=>1311, -44865=>1312, -44866=>1313, -44867=>1314, -44872=>1315, -44873=>1316, -44880=>1317, -44892=>1318, -44893=>1319, -44900=>1320, -44901=>1321, -44921=>1322, -44928=>1323, -44932=>1324, -44936=>1325, -44944=>1326, -44945=>1327, -44949=>1328, -44956=>1329, -44984=>1330, -44985=>1331, -44988=>1332, -44992=>1333, -44999=>1334, -45000=>1335, -45001=>1336, -45003=>1337, -45005=>1338, -45006=>1339, -45012=>1340, -45020=>1341, -45032=>1342, -45033=>1343, -45040=>1344, -45041=>1345, -45044=>1346, -45048=>1347, -45056=>1348, -45057=>1349, -45060=>1350, -45068=>1351, -45072=>1352, -45076=>1353, -45084=>1354, -45085=>1355, -45096=>1356, -45124=>1357, -45125=>1358, -45128=>1359, -45130=>1360, -45132=>1361, -45134=>1362, -45139=>1363, -45140=>1364, -45141=>1365, -45143=>1366, -45145=>1367, -45149=>1368, -45180=>1369, -45181=>1370, -45184=>1371, -45188=>1372, -45196=>1373, -45197=>1374, -45199=>1375, -45201=>1376, -45208=>1377, -45209=>1378, -45210=>1379, -45212=>1380, -45215=>1381, -45216=>1382, -45217=>1383, -45218=>1384, -45224=>1385, -45225=>1386, -45227=>1387, -45228=>1388, -45229=>1389, -45230=>1390, -45231=>1391, -45233=>1392, -45235=>1393, -45236=>1394, -45237=>1395, -45240=>1396, -45244=>1397, -45252=>1398, -45253=>1399, -45255=>1400, -45256=>1401, -45257=>1402, -45264=>1403, -45265=>1404, -45268=>1405, -45272=>1406, -45280=>1407, -45285=>1408, -45320=>1409, -45321=>1410, -45323=>1411, -45324=>1412, -45328=>1413, -45330=>1414, -45331=>1415, -45336=>1416, -45337=>1417, -45339=>1418, -45340=>1419, -45341=>1420, -45347=>1421, -45348=>1422, -45349=>1423, -45352=>1424, -45356=>1425, -45364=>1426, -45365=>1427, -45367=>1428, -45368=>1429, -45369=>1430, -45376=>1431, -45377=>1432, -45380=>1433, -45384=>1434, -45392=>1435, -45393=>1436, -45396=>1437, -45397=>1438, -45400=>1439, -45404=>1440, -45408=>1441, -45432=>1442, -45433=>1443, -45436=>1444, -45440=>1445, -45442=>1446, -45448=>1447, -45449=>1448, -45451=>1449, -45453=>1450, -45458=>1451, -45459=>1452, -45460=>1453, -45464=>1454, -45468=>1455, -45480=>1456, -45516=>1457, -45520=>1458, -45524=>1459, -45532=>1460, -45533=>1461, -45535=>1462, -45544=>1463, -45545=>1464, -45548=>1465, -45552=>1466, -45561=>1467, -45563=>1468, -45565=>1469, -45572=>1470, -45573=>1471, -45576=>1472, -45579=>1473, -45580=>1474, -45588=>1475, -45589=>1476, -45591=>1477, -45593=>1478, -45600=>1479, -45620=>1480, -45628=>1481, -45656=>1482, -45660=>1483, -45664=>1484, -45672=>1485, -45673=>1486, -45684=>1487, -45685=>1488, -45692=>1489, -45700=>1490, -45701=>1491, -45705=>1492, -45712=>1493, -45713=>1494, -45716=>1495, -45720=>1496, -45721=>1497, -45722=>1498, -45728=>1499, -45729=>1500, -45731=>1501, -45733=>1502, -45734=>1503, -45738=>1504, -45740=>1505, -45744=>1506, -45748=>1507, -45768=>1508, -45769=>1509, -45772=>1510, -45776=>1511, -45778=>1512, -45784=>1513, -45785=>1514, -45787=>1515, -45789=>1516, -45794=>1517, -45796=>1518, -45797=>1519, -45798=>1520, -45800=>1521, -45803=>1522, -45804=>1523, -45805=>1524, -45806=>1525, -45807=>1526, -45811=>1527, -45812=>1528, -45813=>1529, -45815=>1530, -45816=>1531, -45817=>1532, -45818=>1533, -45819=>1534, -45823=>1535, -45824=>1536, -45825=>1537, -45828=>1538, -45832=>1539, -45840=>1540, -45841=>1541, -45843=>1542, -45844=>1543, -45845=>1544, -45852=>1545, -45908=>1546, -45909=>1547, -45910=>1548, -45912=>1549, -45915=>1550, -45916=>1551, -45918=>1552, -45919=>1553, -45924=>1554, -45925=>1555, -45927=>1556, -45929=>1557, -45931=>1558, -45934=>1559, -45936=>1560, -45937=>1561, -45940=>1562, -45944=>1563, -45952=>1564, -45953=>1565, -45955=>1566, -45956=>1567, -45957=>1568, -45964=>1569, -45968=>1570, -45972=>1571, -45984=>1572, -45985=>1573, -45992=>1574, -45996=>1575, -46020=>1576, -46021=>1577, -46024=>1578, -46027=>1579, -46028=>1580, -46030=>1581, -46032=>1582, -46036=>1583, -46037=>1584, -46039=>1585, -46041=>1586, -46043=>1587, -46045=>1588, -46048=>1589, -46052=>1590, -46056=>1591, -46076=>1592, -46096=>1593, -46104=>1594, -46108=>1595, -46112=>1596, -46120=>1597, -46121=>1598, -46123=>1599, -46132=>1600, -46160=>1601, -46161=>1602, -46164=>1603, -46168=>1604, -46176=>1605, -46177=>1606, -46179=>1607, -46181=>1608, -46188=>1609, -46208=>1610, -46216=>1611, -46237=>1612, -46244=>1613, -46248=>1614, -46252=>1615, -46261=>1616, -46263=>1617, -46265=>1618, -46272=>1619, -46276=>1620, -46280=>1621, -46288=>1622, -46293=>1623, -46300=>1624, -46301=>1625, -46304=>1626, -46307=>1627, -46308=>1628, -46310=>1629, -46316=>1630, -46317=>1631, -46319=>1632, -46321=>1633, -46328=>1634, -46356=>1635, -46357=>1636, -46360=>1637, -46363=>1638, -46364=>1639, -46372=>1640, -46373=>1641, -46375=>1642, -46376=>1643, -46377=>1644, -46378=>1645, -46384=>1646, -46385=>1647, -46388=>1648, -46392=>1649, -46400=>1650, -46401=>1651, -46403=>1652, -46404=>1653, -46405=>1654, -46411=>1655, -46412=>1656, -46413=>1657, -46416=>1658, -46420=>1659, -46428=>1660, -46429=>1661, -46431=>1662, -46432=>1663, -46433=>1664, -46496=>1665, -46497=>1666, -46500=>1667, -46504=>1668, -46506=>1669, -46507=>1670, -46512=>1671, -46513=>1672, -46515=>1673, -46516=>1674, -46517=>1675, -46523=>1676, -46524=>1677, -46525=>1678, -46528=>1679, -46532=>1680, -46540=>1681, -46541=>1682, -46543=>1683, -46544=>1684, -46545=>1685, -46552=>1686, -46572=>1687, -46608=>1688, -46609=>1689, -46612=>1690, -46616=>1691, -46629=>1692, -46636=>1693, -46644=>1694, -46664=>1695, -46692=>1696, -46696=>1697, -46748=>1698, -46749=>1699, -46752=>1700, -46756=>1701, -46763=>1702, -46764=>1703, -46769=>1704, -46804=>1705, -46832=>1706, -46836=>1707, -46840=>1708, -46848=>1709, -46849=>1710, -46853=>1711, -46888=>1712, -46889=>1713, -46892=>1714, -46895=>1715, -46896=>1716, -46904=>1717, -46905=>1718, -46907=>1719, -46916=>1720, -46920=>1721, -46924=>1722, -46932=>1723, -46933=>1724, -46944=>1725, -46948=>1726, -46952=>1727, -46960=>1728, -46961=>1729, -46963=>1730, -46965=>1731, -46972=>1732, -46973=>1733, -46976=>1734, -46980=>1735, -46988=>1736, -46989=>1737, -46991=>1738, -46992=>1739, -46993=>1740, -46994=>1741, -46998=>1742, -46999=>1743, -47000=>1744, -47001=>1745, -47004=>1746, -47008=>1747, -47016=>1748, -47017=>1749, -47019=>1750, -47020=>1751, -47021=>1752, -47028=>1753, -47029=>1754, -47032=>1755, -47047=>1756, -47049=>1757, -47084=>1758, -47085=>1759, -47088=>1760, -47092=>1761, -47100=>1762, -47101=>1763, -47103=>1764, -47104=>1765, -47105=>1766, -47111=>1767, -47112=>1768, -47113=>1769, -47116=>1770, -47120=>1771, -47128=>1772, -47129=>1773, -47131=>1774, -47133=>1775, -47140=>1776, -47141=>1777, -47144=>1778, -47148=>1779, -47156=>1780, -47157=>1781, -47159=>1782, -47160=>1783, -47161=>1784, -47168=>1785, -47172=>1786, -47185=>1787, -47187=>1788, -47196=>1789, -47197=>1790, -47200=>1791, -47204=>1792, -47212=>1793, -47213=>1794, -47215=>1795, -47217=>1796, -47224=>1797, -47228=>1798, -47245=>1799, -47272=>1800, -47280=>1801, -47284=>1802, -47288=>1803, -47296=>1804, -47297=>1805, -47299=>1806, -47301=>1807, -47308=>1808, -47312=>1809, -47316=>1810, -47325=>1811, -47327=>1812, -47329=>1813, -47336=>1814, -47337=>1815, -47340=>1816, -47344=>1817, -47352=>1818, -47353=>1819, -47355=>1820, -47357=>1821, -47364=>1822, -47384=>1823, -47392=>1824, -47420=>1825, -47421=>1826, -47424=>1827, -47428=>1828, -47436=>1829, -47439=>1830, -47441=>1831, -47448=>1832, -47449=>1833, -47452=>1834, -47456=>1835, -47464=>1836, -47465=>1837, -47467=>1838, -47469=>1839, -47476=>1840, -47477=>1841, -47480=>1842, -47484=>1843, -47492=>1844, -47493=>1845, -47495=>1846, -47497=>1847, -47498=>1848, -47501=>1849, -47502=>1850, -47532=>1851, -47533=>1852, -47536=>1853, -47540=>1854, -47548=>1855, -47549=>1856, -47551=>1857, -47553=>1858, -47560=>1859, -47561=>1860, -47564=>1861, -47566=>1862, -47567=>1863, -47568=>1864, -47569=>1865, -47570=>1866, -47576=>1867, -47577=>1868, -47579=>1869, -47581=>1870, -47582=>1871, -47585=>1872, -47587=>1873, -47588=>1874, -47589=>1875, -47592=>1876, -47596=>1877, -47604=>1878, -47605=>1879, -47607=>1880, -47608=>1881, -47609=>1882, -47610=>1883, -47616=>1884, -47617=>1885, -47624=>1886, -47637=>1887, -47672=>1888, -47673=>1889, -47676=>1890, -47680=>1891, -47682=>1892, -47688=>1893, -47689=>1894, -47691=>1895, -47693=>1896, -47694=>1897, -47699=>1898, -47700=>1899, -47701=>1900, -47704=>1901, -47708=>1902, -47716=>1903, -47717=>1904, -47719=>1905, -47720=>1906, -47721=>1907, -47728=>1908, -47729=>1909, -47732=>1910, -47736=>1911, -47747=>1912, -47748=>1913, -47749=>1914, -47751=>1915, -47756=>1916, -47784=>1917, -47785=>1918, -47787=>1919, -47788=>1920, -47792=>1921, -47794=>1922, -47800=>1923, -47801=>1924, -47803=>1925, -47805=>1926, -47812=>1927, -47816=>1928, -47832=>1929, -47833=>1930, -47868=>1931, -47872=>1932, -47876=>1933, -47885=>1934, -47887=>1935, -47889=>1936, -47896=>1937, -47900=>1938, -47904=>1939, -47913=>1940, -47915=>1941, -47924=>1942, -47925=>1943, -47926=>1944, -47928=>1945, -47931=>1946, -47932=>1947, -47933=>1948, -47934=>1949, -47940=>1950, -47941=>1951, -47943=>1952, -47945=>1953, -47949=>1954, -47951=>1955, -47952=>1956, -47956=>1957, -47960=>1958, -47969=>1959, -47971=>1960, -47980=>1961, -48008=>1962, -48012=>1963, -48016=>1964, -48036=>1965, -48040=>1966, -48044=>1967, -48052=>1968, -48055=>1969, -48064=>1970, -48068=>1971, -48072=>1972, -48080=>1973, -48083=>1974, -48120=>1975, -48121=>1976, -48124=>1977, -48127=>1978, -48128=>1979, -48130=>1980, -48136=>1981, -48137=>1982, -48139=>1983, -48140=>1984, -48141=>1985, -48143=>1986, -48145=>1987, -48148=>1988, -48149=>1989, -48150=>1990, -48151=>1991, -48152=>1992, -48155=>1993, -48156=>1994, -48157=>1995, -48158=>1996, -48159=>1997, -48164=>1998, -48165=>1999, -48167=>2000, -48169=>2001, -48173=>2002, -48176=>2003, -48177=>2004, -48180=>2005, -48184=>2006, -48192=>2007, -48193=>2008, -48195=>2009, -48196=>2010, -48197=>2011, -48201=>2012, -48204=>2013, -48205=>2014, -48208=>2015, -48221=>2016, -48260=>2017, -48261=>2018, -48264=>2019, -48267=>2020, -48268=>2021, -48270=>2022, -48276=>2023, -48277=>2024, -48279=>2025, -48281=>2026, -48282=>2027, -48288=>2028, -48289=>2029, -48292=>2030, -48295=>2031, -48296=>2032, -48304=>2033, -48305=>2034, -48307=>2035, -48308=>2036, -48309=>2037, -48316=>2038, -48317=>2039, -48320=>2040, -48324=>2041, -48333=>2042, -48335=>2043, -48336=>2044, -48337=>2045, -48341=>2046, -48344=>2047, -48348=>2048, -48372=>2049, -48373=>2050, -48374=>2051, -48376=>2052, -48380=>2053, -48388=>2054, -48389=>2055, -48391=>2056, -48393=>2057, -48400=>2058, -48404=>2059, -48420=>2060, -48428=>2061, -48448=>2062, -48456=>2063, -48457=>2064, -48460=>2065, -48464=>2066, -48472=>2067, -48473=>2068, -48484=>2069, -48488=>2070, -48512=>2071, -48513=>2072, -48516=>2073, -48519=>2074, -48520=>2075, -48521=>2076, -48522=>2077, -48528=>2078, -48529=>2079, -48531=>2080, -48533=>2081, -48537=>2082, -48538=>2083, -48540=>2084, -48548=>2085, -48560=>2086, -48568=>2087, -48596=>2088, -48597=>2089, -48600=>2090, -48604=>2091, -48617=>2092, -48624=>2093, -48628=>2094, -48632=>2095, -48640=>2096, -48643=>2097, -48645=>2098, -48652=>2099, -48653=>2100, -48656=>2101, -48660=>2102, -48668=>2103, -48669=>2104, -48671=>2105, -48708=>2106, -48709=>2107, -48712=>2108, -48716=>2109, -48718=>2110, -48724=>2111, -48725=>2112, -48727=>2113, -48729=>2114, -48730=>2115, -48731=>2116, -48736=>2117, -48737=>2118, -48740=>2119, -48744=>2120, -48746=>2121, -48752=>2122, -48753=>2123, -48755=>2124, -48756=>2125, -48757=>2126, -48763=>2127, -48764=>2128, -48765=>2129, -48768=>2130, -48772=>2131, -48780=>2132, -48781=>2133, -48783=>2134, -48784=>2135, -48785=>2136, -48792=>2137, -48793=>2138, -48808=>2139, -48848=>2140, -48849=>2141, -48852=>2142, -48855=>2143, -48856=>2144, -48864=>2145, -48867=>2146, -48868=>2147, -48869=>2148, -48876=>2149, -48897=>2150, -48904=>2151, -48905=>2152, -48920=>2153, -48921=>2154, -48923=>2155, -48924=>2156, -48925=>2157, -48960=>2158, -48961=>2159, -48964=>2160, -48968=>2161, -48976=>2162, -48977=>2163, -48981=>2164, -49044=>2165, -49072=>2166, -49093=>2167, -49100=>2168, -49101=>2169, -49104=>2170, -49108=>2171, -49116=>2172, -49119=>2173, -49121=>2174, -49212=>2175, -49233=>2176, -49240=>2177, -49244=>2178, -49248=>2179, -49256=>2180, -49257=>2181, -49296=>2182, -49297=>2183, -49300=>2184, -49304=>2185, -49312=>2186, -49313=>2187, -49315=>2188, -49317=>2189, -49324=>2190, -49325=>2191, -49327=>2192, -49328=>2193, -49331=>2194, -49332=>2195, -49333=>2196, -49334=>2197, -49340=>2198, -49341=>2199, -49343=>2200, -49344=>2201, -49345=>2202, -49349=>2203, -49352=>2204, -49353=>2205, -49356=>2206, -49360=>2207, -49368=>2208, -49369=>2209, -49371=>2210, -49372=>2211, -49373=>2212, -49380=>2213, -49381=>2214, -49384=>2215, -49388=>2216, -49396=>2217, -49397=>2218, -49399=>2219, -49401=>2220, -49408=>2221, -49412=>2222, -49416=>2223, -49424=>2224, -49429=>2225, -49436=>2226, -49437=>2227, -49438=>2228, -49439=>2229, -49440=>2230, -49443=>2231, -49444=>2232, -49446=>2233, -49447=>2234, -49452=>2235, -49453=>2236, -49455=>2237, -49456=>2238, -49457=>2239, -49462=>2240, -49464=>2241, -49465=>2242, -49468=>2243, -49472=>2244, -49480=>2245, -49481=>2246, -49483=>2247, -49484=>2248, -49485=>2249, -49492=>2250, -49493=>2251, -49496=>2252, -49500=>2253, -49508=>2254, -49509=>2255, -49511=>2256, -49512=>2257, -49513=>2258, -49520=>2259, -49524=>2260, -49528=>2261, -49541=>2262, -49548=>2263, -49549=>2264, -49550=>2265, -49552=>2266, -49556=>2267, -49558=>2268, -49564=>2269, -49565=>2270, -49567=>2271, -49569=>2272, -49573=>2273, -49576=>2274, -49577=>2275, -49580=>2276, -49584=>2277, -49597=>2278, -49604=>2279, -49608=>2280, -49612=>2281, -49620=>2282, -49623=>2283, -49624=>2284, -49632=>2285, -49636=>2286, -49640=>2287, -49648=>2288, -49649=>2289, -49651=>2290, -49660=>2291, -49661=>2292, -49664=>2293, -49668=>2294, -49676=>2295, -49677=>2296, -49679=>2297, -49681=>2298, -49688=>2299, -49689=>2300, -49692=>2301, -49695=>2302, -49696=>2303, -49704=>2304, -49705=>2305, -49707=>2306, -49709=>2307, -49711=>2308, -49713=>2309, -49714=>2310, -49716=>2311, -49736=>2312, -49744=>2313, -49745=>2314, -49748=>2315, -49752=>2316, -49760=>2317, -49765=>2318, -49772=>2319, -49773=>2320, -49776=>2321, -49780=>2322, -49788=>2323, -49789=>2324, -49791=>2325, -49793=>2326, -49800=>2327, -49801=>2328, -49808=>2329, -49816=>2330, -49819=>2331, -49821=>2332, -49828=>2333, -49829=>2334, -49832=>2335, -49836=>2336, -49837=>2337, -49844=>2338, -49845=>2339, -49847=>2340, -49849=>2341, -49884=>2342, -49885=>2343, -49888=>2344, -49891=>2345, -49892=>2346, -49899=>2347, -49900=>2348, -49901=>2349, -49903=>2350, -49905=>2351, -49910=>2352, -49912=>2353, -49913=>2354, -49915=>2355, -49916=>2356, -49920=>2357, -49928=>2358, -49929=>2359, -49932=>2360, -49933=>2361, -49939=>2362, -49940=>2363, -49941=>2364, -49944=>2365, -49948=>2366, -49956=>2367, -49957=>2368, -49960=>2369, -49961=>2370, -49989=>2371, -50024=>2372, -50025=>2373, -50028=>2374, -50032=>2375, -50034=>2376, -50040=>2377, -50041=>2378, -50044=>2379, -50045=>2380, -50052=>2381, -50056=>2382, -50060=>2383, -50112=>2384, -50136=>2385, -50137=>2386, -50140=>2387, -50143=>2388, -50144=>2389, -50146=>2390, -50152=>2391, -50153=>2392, -50157=>2393, -50164=>2394, -50165=>2395, -50168=>2396, -50184=>2397, -50192=>2398, -50212=>2399, -50220=>2400, -50224=>2401, -50228=>2402, -50236=>2403, -50237=>2404, -50248=>2405, -50276=>2406, -50277=>2407, -50280=>2408, -50284=>2409, -50292=>2410, -50293=>2411, -50297=>2412, -50304=>2413, -50324=>2414, -50332=>2415, -50360=>2416, -50364=>2417, -50409=>2418, -50416=>2419, -50417=>2420, -50420=>2421, -50424=>2422, -50426=>2423, -50431=>2424, -50432=>2425, -50433=>2426, -50444=>2427, -50448=>2428, -50452=>2429, -50460=>2430, -50472=>2431, -50473=>2432, -50476=>2433, -50480=>2434, -50488=>2435, -50489=>2436, -50491=>2437, -50493=>2438, -50500=>2439, -50501=>2440, -50504=>2441, -50505=>2442, -50506=>2443, -50508=>2444, -50509=>2445, -50510=>2446, -50515=>2447, -50516=>2448, -50517=>2449, -50519=>2450, -50520=>2451, -50521=>2452, -50525=>2453, -50526=>2454, -50528=>2455, -50529=>2456, -50532=>2457, -50536=>2458, -50544=>2459, -50545=>2460, -50547=>2461, -50548=>2462, -50549=>2463, -50556=>2464, -50557=>2465, -50560=>2466, -50564=>2467, -50567=>2468, -50572=>2469, -50573=>2470, -50575=>2471, -50577=>2472, -50581=>2473, -50583=>2474, -50584=>2475, -50588=>2476, -50592=>2477, -50601=>2478, -50612=>2479, -50613=>2480, -50616=>2481, -50617=>2482, -50619=>2483, -50620=>2484, -50621=>2485, -50622=>2486, -50628=>2487, -50629=>2488, -50630=>2489, -50631=>2490, -50632=>2491, -50633=>2492, -50634=>2493, -50636=>2494, -50638=>2495, -50640=>2496, -50641=>2497, -50644=>2498, -50648=>2499, -50656=>2500, -50657=>2501, -50659=>2502, -50661=>2503, -50668=>2504, -50669=>2505, -50670=>2506, -50672=>2507, -50676=>2508, -50678=>2509, -50679=>2510, -50684=>2511, -50685=>2512, -50686=>2513, -50687=>2514, -50688=>2515, -50689=>2516, -50693=>2517, -50694=>2518, -50695=>2519, -50696=>2520, -50700=>2521, -50704=>2522, -50712=>2523, -50713=>2524, -50715=>2525, -50716=>2526, -50724=>2527, -50725=>2528, -50728=>2529, -50732=>2530, -50733=>2531, -50734=>2532, -50736=>2533, -50739=>2534, -50740=>2535, -50741=>2536, -50743=>2537, -50745=>2538, -50747=>2539, -50752=>2540, -50753=>2541, -50756=>2542, -50760=>2543, -50768=>2544, -50769=>2545, -50771=>2546, -50772=>2547, -50773=>2548, -50780=>2549, -50781=>2550, -50784=>2551, -50796=>2552, -50799=>2553, -50801=>2554, -50808=>2555, -50809=>2556, -50812=>2557, -50816=>2558, -50824=>2559, -50825=>2560, -50827=>2561, -50829=>2562, -50836=>2563, -50837=>2564, -50840=>2565, -50844=>2566, -50852=>2567, -50853=>2568, -50855=>2569, -50857=>2570, -50864=>2571, -50865=>2572, -50868=>2573, -50872=>2574, -50873=>2575, -50874=>2576, -50880=>2577, -50881=>2578, -50883=>2579, -50885=>2580, -50892=>2581, -50893=>2582, -50896=>2583, -50900=>2584, -50908=>2585, -50909=>2586, -50912=>2587, -50913=>2588, -50920=>2589, -50921=>2590, -50924=>2591, -50928=>2592, -50936=>2593, -50937=>2594, -50941=>2595, -50948=>2596, -50949=>2597, -50952=>2598, -50956=>2599, -50964=>2600, -50965=>2601, -50967=>2602, -50969=>2603, -50976=>2604, -50977=>2605, -50980=>2606, -50984=>2607, -50992=>2608, -50993=>2609, -50995=>2610, -50997=>2611, -50999=>2612, -51004=>2613, -51005=>2614, -51008=>2615, -51012=>2616, -51018=>2617, -51020=>2618, -51021=>2619, -51023=>2620, -51025=>2621, -51026=>2622, -51027=>2623, -51028=>2624, -51029=>2625, -51030=>2626, -51031=>2627, -51032=>2628, -51036=>2629, -51040=>2630, -51048=>2631, -51051=>2632, -51060=>2633, -51061=>2634, -51064=>2635, -51068=>2636, -51069=>2637, -51070=>2638, -51075=>2639, -51076=>2640, -51077=>2641, -51079=>2642, -51080=>2643, -51081=>2644, -51082=>2645, -51086=>2646, -51088=>2647, -51089=>2648, -51092=>2649, -51094=>2650, -51095=>2651, -51096=>2652, -51098=>2653, -51104=>2654, -51105=>2655, -51107=>2656, -51108=>2657, -51109=>2658, -51110=>2659, -51116=>2660, -51117=>2661, -51120=>2662, -51124=>2663, -51132=>2664, -51133=>2665, -51135=>2666, -51136=>2667, -51137=>2668, -51144=>2669, -51145=>2670, -51148=>2671, -51150=>2672, -51152=>2673, -51160=>2674, -51165=>2675, -51172=>2676, -51176=>2677, -51180=>2678, -51200=>2679, -51201=>2680, -51204=>2681, -51208=>2682, -51210=>2683, -51216=>2684, -51217=>2685, -51219=>2686, -51221=>2687, -51222=>2688, -51228=>2689, -51229=>2690, -51232=>2691, -51236=>2692, -51244=>2693, -51245=>2694, -51247=>2695, -51249=>2696, -51256=>2697, -51260=>2698, -51264=>2699, -51272=>2700, -51273=>2701, -51276=>2702, -51277=>2703, -51284=>2704, -51312=>2705, -51313=>2706, -51316=>2707, -51320=>2708, -51322=>2709, -51328=>2710, -51329=>2711, -51331=>2712, -51333=>2713, -51334=>2714, -51335=>2715, -51339=>2716, -51340=>2717, -51341=>2718, -51348=>2719, -51357=>2720, -51359=>2721, -51361=>2722, -51368=>2723, -51388=>2724, -51389=>2725, -51396=>2726, -51400=>2727, -51404=>2728, -51412=>2729, -51413=>2730, -51415=>2731, -51417=>2732, -51424=>2733, -51425=>2734, -51428=>2735, -51445=>2736, -51452=>2737, -51453=>2738, -51456=>2739, -51460=>2740, -51461=>2741, -51462=>2742, -51468=>2743, -51469=>2744, -51471=>2745, -51473=>2746, -51480=>2747, -51500=>2748, -51508=>2749, -51536=>2750, -51537=>2751, -51540=>2752, -51544=>2753, -51552=>2754, -51553=>2755, -51555=>2756, -51564=>2757, -51568=>2758, -51572=>2759, -51580=>2760, -51592=>2761, -51593=>2762, -51596=>2763, -51600=>2764, -51608=>2765, -51609=>2766, -51611=>2767, -51613=>2768, -51648=>2769, -51649=>2770, -51652=>2771, -51655=>2772, -51656=>2773, -51658=>2774, -51664=>2775, -51665=>2776, -51667=>2777, -51669=>2778, -51670=>2779, -51673=>2780, -51674=>2781, -51676=>2782, -51677=>2783, -51680=>2784, -51682=>2785, -51684=>2786, -51687=>2787, -51692=>2788, -51693=>2789, -51695=>2790, -51696=>2791, -51697=>2792, -51704=>2793, -51705=>2794, -51708=>2795, -51712=>2796, -51720=>2797, -51721=>2798, -51723=>2799, -51724=>2800, -51725=>2801, -51732=>2802, -51736=>2803, -51753=>2804, -51788=>2805, -51789=>2806, -51792=>2807, -51796=>2808, -51804=>2809, -51805=>2810, -51807=>2811, -51808=>2812, -51809=>2813, -51816=>2814, -51837=>2815, -51844=>2816, -51864=>2817, -51900=>2818, -51901=>2819, -51904=>2820, -51908=>2821, -51916=>2822, -51917=>2823, -51919=>2824, -51921=>2825, -51923=>2826, -51928=>2827, -51929=>2828, -51936=>2829, -51948=>2830, -51956=>2831, -51976=>2832, -51984=>2833, -51988=>2834, -51992=>2835, -52000=>2836, -52001=>2837, -52033=>2838, -52040=>2839, -52041=>2840, -52044=>2841, -52048=>2842, -52056=>2843, -52057=>2844, -52061=>2845, -52068=>2846, -52088=>2847, -52089=>2848, -52124=>2849, -52152=>2850, -52180=>2851, -52196=>2852, -52199=>2853, -52201=>2854, -52236=>2855, -52237=>2856, -52240=>2857, -52244=>2858, -52252=>2859, -52253=>2860, -52257=>2861, -52258=>2862, -52263=>2863, -52264=>2864, -52265=>2865, -52268=>2866, -52270=>2867, -52272=>2868, -52280=>2869, -52281=>2870, -52283=>2871, -52284=>2872, -52285=>2873, -52286=>2874, -52292=>2875, -52293=>2876, -52296=>2877, -52300=>2878, -52308=>2879, -52309=>2880, -52311=>2881, -52312=>2882, -52313=>2883, -52320=>2884, -52324=>2885, -52326=>2886, -52328=>2887, -52336=>2888, -52341=>2889, -52376=>2890, -52377=>2891, -52380=>2892, -52384=>2893, -52392=>2894, -52393=>2895, -52395=>2896, -52396=>2897, -52397=>2898, -52404=>2899, -52405=>2900, -52408=>2901, -52412=>2902, -52420=>2903, -52421=>2904, -52423=>2905, -52425=>2906, -52432=>2907, -52436=>2908, -52452=>2909, -52460=>2910, -52464=>2911, -52481=>2912, -52488=>2913, -52489=>2914, -52492=>2915, -52496=>2916, -52504=>2917, -52505=>2918, -52507=>2919, -52509=>2920, -52516=>2921, -52520=>2922, -52524=>2923, -52537=>2924, -52572=>2925, -52576=>2926, -52580=>2927, -52588=>2928, -52589=>2929, -52591=>2930, -52593=>2931, -52600=>2932, -52616=>2933, -52628=>2934, -52629=>2935, -52632=>2936, -52636=>2937, -52644=>2938, -52645=>2939, -52647=>2940, -52649=>2941, -52656=>2942, -52676=>2943, -52684=>2944, -52688=>2945, -52712=>2946, -52716=>2947, -52720=>2948, -52728=>2949, -52729=>2950, -52731=>2951, -52733=>2952, -52740=>2953, -52744=>2954, -52748=>2955, -52756=>2956, -52761=>2957, -52768=>2958, -52769=>2959, -52772=>2960, -52776=>2961, -52784=>2962, -52785=>2963, -52787=>2964, -52789=>2965, -52824=>2966, -52825=>2967, -52828=>2968, -52831=>2969, -52832=>2970, -52833=>2971, -52840=>2972, -52841=>2973, -52843=>2974, -52845=>2975, -52852=>2976, -52853=>2977, -52856=>2978, -52860=>2979, -52868=>2980, -52869=>2981, -52871=>2982, -52873=>2983, -52880=>2984, -52881=>2985, -52884=>2986, -52888=>2987, -52896=>2988, -52897=>2989, -52899=>2990, -52900=>2991, -52901=>2992, -52908=>2993, -52909=>2994, -52929=>2995, -52964=>2996, -52965=>2997, -52968=>2998, -52971=>2999, -52972=>3000, -52980=>3001, -52981=>3002, -52983=>3003, -52984=>3004, -52985=>3005, -52992=>3006, -52993=>3007, -52996=>3008, -53000=>3009, -53008=>3010, -53009=>3011, -53011=>3012, -53013=>3013, -53020=>3014, -53024=>3015, -53028=>3016, -53036=>3017, -53037=>3018, -53039=>3019, -53040=>3020, -53041=>3021, -53048=>3022, -53076=>3023, -53077=>3024, -53080=>3025, -53084=>3026, -53092=>3027, -53093=>3028, -53095=>3029, -53097=>3030, -53104=>3031, -53105=>3032, -53108=>3033, -53112=>3034, -53120=>3035, -53125=>3036, -53132=>3037, -53153=>3038, -53160=>3039, -53168=>3040, -53188=>3041, -53216=>3042, -53217=>3043, -53220=>3044, -53224=>3045, -53232=>3046, -53233=>3047, -53235=>3048, -53237=>3049, -53244=>3050, -53248=>3051, -53252=>3052, -53265=>3053, -53272=>3054, -53293=>3055, -53300=>3056, -53301=>3057, -53304=>3058, -53308=>3059, -53316=>3060, -53317=>3061, -53319=>3062, -53321=>3063, -53328=>3064, -53332=>3065, -53336=>3066, -53344=>3067, -53356=>3068, -53357=>3069, -53360=>3070, -53364=>3071, -53372=>3072, -53373=>3073, -53377=>3074, -53412=>3075, -53413=>3076, -53416=>3077, -53420=>3078, -53428=>3079, -53429=>3080, -53431=>3081, -53433=>3082, -53440=>3083, -53441=>3084, -53444=>3085, -53448=>3086, -53449=>3087, -53456=>3088, -53457=>3089, -53459=>3090, -53460=>3091, -53461=>3092, -53468=>3093, -53469=>3094, -53472=>3095, -53476=>3096, -53484=>3097, -53485=>3098, -53487=>3099, -53488=>3100, -53489=>3101, -53496=>3102, -53517=>3103, -53552=>3104, -53553=>3105, -53556=>3106, -53560=>3107, -53562=>3108, -53568=>3109, -53569=>3110, -53571=>3111, -53572=>3112, -53573=>3113, -53580=>3114, -53581=>3115, -53584=>3116, -53588=>3117, -53596=>3118, -53597=>3119, -53599=>3120, -53601=>3121, -53608=>3122, -53612=>3123, -53628=>3124, -53636=>3125, -53640=>3126, -53664=>3127, -53665=>3128, -53668=>3129, -53672=>3130, -53680=>3131, -53681=>3132, -53683=>3133, -53685=>3134, -53690=>3135, -53692=>3136, -53696=>3137, -53720=>3138, -53748=>3139, -53752=>3140, -53767=>3141, -53769=>3142, -53776=>3143, -53804=>3144, -53805=>3145, -53808=>3146, -53812=>3147, -53820=>3148, -53821=>3149, -53823=>3150, -53825=>3151, -53832=>3152, -53852=>3153, -53860=>3154, -53888=>3155, -53889=>3156, -53892=>3157, -53896=>3158, -53904=>3159, -53905=>3160, -53909=>3161, -53916=>3162, -53920=>3163, -53924=>3164, -53932=>3165, -53937=>3166, -53944=>3167, -53945=>3168, -53948=>3169, -53951=>3170, -53952=>3171, -53954=>3172, -53960=>3173, -53961=>3174, -53963=>3175, -53972=>3176, -53976=>3177, -53980=>3178, -53988=>3179, -53989=>3180, -54000=>3181, -54001=>3182, -54004=>3183, -54008=>3184, -54016=>3185, -54017=>3186, -54019=>3187, -54021=>3188, -54028=>3189, -54029=>3190, -54030=>3191, -54032=>3192, -54036=>3193, -54038=>3194, -54044=>3195, -54045=>3196, -54047=>3197, -54048=>3198, -54049=>3199, -54053=>3200, -54056=>3201, -54057=>3202, -54060=>3203, -54064=>3204, -54072=>3205, -54073=>3206, -54075=>3207, -54076=>3208, -54077=>3209, -54084=>3210, -54085=>3211, -54140=>3212, -54141=>3213, -54144=>3214, -54148=>3215, -54156=>3216, -54157=>3217, -54159=>3218, -54160=>3219, -54161=>3220, -54168=>3221, -54169=>3222, -54172=>3223, -54176=>3224, -54184=>3225, -54185=>3226, -54187=>3227, -54189=>3228, -54196=>3229, -54200=>3230, -54204=>3231, -54212=>3232, -54213=>3233, -54216=>3234, -54217=>3235, -54224=>3236, -54232=>3237, -54241=>3238, -54243=>3239, -54252=>3240, -54253=>3241, -54256=>3242, -54260=>3243, -54268=>3244, -54269=>3245, -54271=>3246, -54273=>3247, -54280=>3248, -54301=>3249, -54336=>3250, -54340=>3251, -54364=>3252, -54368=>3253, -54372=>3254, -54381=>3255, -54383=>3256, -54392=>3257, -54393=>3258, -54396=>3259, -54399=>3260, -54400=>3261, -54402=>3262, -54408=>3263, -54409=>3264, -54411=>3265, -54413=>3266, -54420=>3267, -54441=>3268, -54476=>3269, -54480=>3270, -54484=>3271, -54492=>3272, -54495=>3273, -54504=>3274, -54508=>3275, -54512=>3276, -54520=>3277, -54523=>3278, -54525=>3279, -54532=>3280, -54536=>3281, -54540=>3282, -54548=>3283, -54549=>3284, -54551=>3285, -54588=>3286, -54589=>3287, -54592=>3288, -54596=>3289, -54604=>3290, -54605=>3291, -54607=>3292, -54609=>3293, -54616=>3294, -54617=>3295, -54620=>3296, -54624=>3297, -54629=>3298, -54632=>3299, -54633=>3300, -54635=>3301, -54637=>3302, -54644=>3303, -54645=>3304, -54648=>3305, -54652=>3306, -54660=>3307, -54661=>3308, -54663=>3309, -54664=>3310, -54665=>3311, -54672=>3312, -54693=>3313, -54728=>3314, -54729=>3315, -54732=>3316, -54736=>3317, -54738=>3318, -54744=>3319, -54745=>3320, -54747=>3321, -54749=>3322, -54756=>3323, -54757=>3324, -54760=>3325, -54764=>3326, -54772=>3327, -54773=>3328, -54775=>3329, -54777=>3330, -54784=>3331, -54785=>3332, -54788=>3333, -54792=>3334, -54800=>3335, -54801=>3336, -54803=>3337, -54804=>3338, -54805=>3339, -54812=>3340, -54816=>3341, -54820=>3342, -54829=>3343, -54840=>3344, -54841=>3345, -54844=>3346, -54848=>3347, -54853=>3348, -54856=>3349, -54857=>3350, -54859=>3351, -54861=>3352, -54865=>3353, -54868=>3354, -54869=>3355, -54872=>3356, -54876=>3357, -54887=>3358, -54889=>3359, -54896=>3360, -54897=>3361, -54900=>3362, -54915=>3363, -54917=>3364, -54924=>3365, -54925=>3366, -54928=>3367, -54932=>3368, -54941=>3369, -54943=>3370, -54945=>3371, -54952=>3372, -54956=>3373, -54960=>3374, -54969=>3375, -54971=>3376, -54980=>3377, -54981=>3378, -54984=>3379, -54988=>3380, -54993=>3381, -54996=>3382, -54999=>3383, -55001=>3384, -55008=>3385, -55012=>3386, -55016=>3387, -55024=>3388, -55029=>3389, -55036=>3390, -55037=>3391, -55040=>3392, -55044=>3393, -55057=>3394, -55064=>3395, -55065=>3396, -55068=>3397, -55072=>3398, -55080=>3399, -55081=>3400, -55083=>3401, -55085=>3402, -55092=>3403, -55093=>3404, -55096=>3405, -55100=>3406, -55108=>3407, -55111=>3408, -55113=>3409, -55120=>3410, -55121=>3411, -55124=>3412, -55126=>3413, -55127=>3414, -55128=>3415, -55129=>3416, -55136=>3417, -55137=>3418, -55139=>3419, -55141=>3420, -55145=>3421, -55148=>3422, -55152=>3423, -55156=>3424, -55164=>3425, -55165=>3426, -55169=>3427, -55176=>3428, -55177=>3429, -55180=>3430, -55184=>3431, -55192=>3432, -55193=>3433, -55195=>3434, -55197=>3435, -20285=>3436, -20339=>3437, -20551=>3438, -20729=>3439, -21152=>3440, -21487=>3441, -21621=>3442, -21733=>3443, -22025=>3444, -23233=>3445, -23478=>3446, -26247=>3447, -26550=>3448, -26551=>3449, -26607=>3450, -27468=>3451, -29634=>3452, -30146=>3453, -31292=>3454, -33499=>3455, -33540=>3456, -34903=>3457, -34952=>3458, -35382=>3459, -36040=>3460, -63747=>3460, -36303=>3461, -36603=>3462, -36838=>3463, -39381=>3464, -21051=>3465, -21364=>3466, -21508=>3467, -24682=>3468, -24932=>3469, -27580=>3470, -29647=>3471, -33050=>3472, -35258=>3473, -12179=>3474, -35282=>3474, -38307=>3475, -20355=>3476, -21002=>3477, -22718=>3478, -22904=>3479, -23014=>3480, -12082=>3481, -24178=>3481, -24185=>3482, -25031=>3483, -25536=>3484, -26438=>3485, -26604=>3486, -26751=>3487, -28567=>3488, -30286=>3489, -30475=>3490, -30965=>3491, -31240=>3492, -31487=>3493, -31777=>3494, -32925=>3495, -12169=>3496, -33390=>3496, -33393=>3497, -35563=>3498, -38291=>3499, -20075=>3500, -21917=>3501, -26359=>3502, -28212=>3503, -30883=>3504, -31469=>3505, -33883=>3506, -35088=>3507, -34638=>3508, -38824=>3509, -21208=>3510, -22350=>3511, -22570=>3512, -23884=>3513, -24863=>3514, -25022=>3515, -25121=>3516, -25954=>3517, -26577=>3518, -27204=>3519, -28187=>3520, -12130=>3521, -29976=>3521, -30131=>3522, -30435=>3523, -30640=>3524, -32058=>3525, -37039=>3526, -37969=>3527, -37970=>3528, -40853=>3529, -21283=>3530, -23724=>3531, -30002=>3532, -32987=>3533, -37440=>3534, -38296=>3535, -21083=>3536, -22536=>3537, -23004=>3538, -23713=>3539, -23831=>3540, -24247=>3541, -24378=>3542, -24394=>3543, -24951=>3544, -27743=>3545, -30074=>3546, -30086=>3547, -31968=>3548, -32115=>3549, -32177=>3550, -32652=>3551, -33108=>3552, -33313=>3553, -34193=>3554, -35137=>3555, -35611=>3556, -37628=>3557, -38477=>3558, -64009=>3558, -40007=>3559, -20171=>3560, -20215=>3561, -20491=>3562, -20977=>3563, -22607=>3564, -24887=>3565, -24894=>3566, -24936=>3567, -25913=>3568, -27114=>3569, -28433=>3570, -30117=>3571, -30342=>3572, -30422=>3573, -31623=>3574, -33445=>3575, -33995=>3576, -37799=>3577, -38283=>3578, -21888=>3579, -23458=>3580, -22353=>3581, -31923=>3582, -32697=>3583, -37301=>3584, -20520=>3585, -21435=>3586, -23621=>3587, -24040=>3588, -25298=>3589, -25454=>3590, -25818=>3591, -25831=>3592, -28192=>3593, -28844=>3594, -31067=>3595, -36317=>3596, -36382=>3597, -36989=>3598, -37445=>3599, -37624=>3600, -20094=>3601, -20214=>3602, -20581=>3603, -12081=>3604, -24062=>3604, -24314=>3605, -24838=>3606, -26967=>3607, -33137=>3608, -34388=>3609, -36423=>3610, -37749=>3611, -39467=>3612, -20062=>3613, -20625=>3614, -26480=>3615, -26688=>3616, -20745=>3617, -21133=>3618, -21138=>3619, -27298=>3620, -30652=>3621, -37392=>3622, -40660=>3623, -21163=>3624, -24623=>3625, -36850=>3626, -20552=>3627, -25001=>3628, -25581=>3629, -25802=>3630, -26684=>3631, -27268=>3632, -28608=>3633, -33160=>3634, -35233=>3635, -38548=>3636, -22533=>3637, -29309=>3638, -12125=>3639, -29356=>3639, -29956=>3640, -32121=>3641, -32365=>3642, -32937=>3643, -12178=>3644, -35211=>3644, -64010=>3644, -35700=>3645, -36963=>3646, -40273=>3647, -25225=>3648, -27770=>3649, -28500=>3650, -32080=>3651, -32570=>3652, -35363=>3653, -20860=>3654, -24906=>3655, -31645=>3656, -35609=>3657, -37463=>3658, -37772=>3659, -20140=>3660, -20435=>3661, -20510=>3662, -20670=>3663, -20742=>3664, -21185=>3665, -21197=>3666, -21375=>3667, -22384=>3668, -22659=>3669, -24218=>3670, -24465=>3671, -24950=>3672, -25004=>3673, -25806=>3674, -25964=>3675, -26223=>3676, -26299=>3677, -26356=>3678, -63745=>3678, -26775=>3679, -28039=>3680, -28805=>3681, -28913=>3682, -29855=>3683, -29861=>3684, -29898=>3685, -30169=>3686, -30828=>3687, -30956=>3688, -31455=>3689, -31478=>3690, -32069=>3691, -32147=>3692, -32789=>3693, -32831=>3694, -33051=>3695, -33686=>3696, -35686=>3697, -36629=>3698, -36885=>3699, -37857=>3700, -38915=>3701, -38968=>3702, -39514=>3703, -39912=>3704, -20418=>3705, -21843=>3706, -22586=>3707, -22865=>3708, -63753=>3708, -23395=>3709, -23622=>3710, -24760=>3711, -25106=>3712, -26690=>3713, -26800=>3714, -26856=>3715, -28330=>3716, -30028=>3717, -30328=>3718, -30926=>3719, -31293=>3720, -31995=>3721, -32363=>3722, -32380=>3723, -35336=>3724, -35489=>3725, -35903=>3726, -38542=>3727, -40388=>3728, -21476=>3729, -21481=>3730, -21578=>3731, -21617=>3732, -22266=>3733, -22993=>3734, -23396=>3735, -23611=>3736, -24235=>3737, -25335=>3738, -25911=>3739, -25925=>3740, -25970=>3741, -26272=>3742, -26543=>3743, -27073=>3744, -27837=>3745, -30204=>3746, -30352=>3747, -30590=>3748, -31295=>3749, -32660=>3750, -32771=>3751, -32929=>3752, -33167=>3753, -33510=>3754, -33533=>3755, -33776=>3756, -34241=>3757, -34865=>3758, -34996=>3759, -35493=>3760, -36764=>3761, -37678=>3762, -38599=>3763, -39015=>3764, -12220=>3765, -39640=>3765, -12238=>3766, -40723=>3766, -21741=>3767, -26011=>3768, -26354=>3769, -26767=>3770, -31296=>3771, -12181=>3772, -35895=>3772, -40288=>3773, -22256=>3774, -22372=>3775, -23825=>3776, -26118=>3777, -26801=>3778, -26829=>3779, -28414=>3780, -29736=>3781, -34974=>3782, -39908=>3783, -27752=>3784, -12219=>3785, -39592=>3785, -20379=>3786, -20844=>3787, -20849=>3788, -21151=>3789, -23380=>3790, -12079=>3791, -24037=>3791, -24656=>3792, -24685=>3793, -25329=>3794, -25511=>3795, -25915=>3796, -29657=>3797, -31354=>3798, -34467=>3799, -36002=>3800, -38799=>3801, -20018=>3802, -63749=>3802, -23521=>3803, -12093=>3804, -25096=>3804, -26524=>3805, -12128=>3806, -29916=>3806, -31185=>3807, -33747=>3808, -35463=>3809, -35506=>3810, -36328=>3811, -36942=>3812, -37707=>3813, -38982=>3814, -24275=>3815, -64011=>3815, -27112=>3816, -34303=>3817, -37101=>3818, -20896=>3819, -23448=>3820, -23532=>3821, -24931=>3822, -26874=>3823, -27454=>3824, -28748=>3825, -29743=>3826, -29912=>3827, -31649=>3828, -32592=>3829, -33733=>3830, -35264=>3831, -36011=>3832, -38364=>3833, -39208=>3834, -21038=>3835, -24669=>3836, -25324=>3837, -36866=>3838, -20362=>3839, -20809=>3840, -21281=>3841, -22745=>3842, -24291=>3843, -26336=>3844, -27960=>3845, -28826=>3846, -29378=>3847, -29654=>3848, -31568=>3849, -33009=>3850, -37979=>3851, -21350=>3852, -25499=>3853, -32619=>3854, -20054=>3855, -20608=>3856, -22602=>3857, -22750=>3858, -24618=>3859, -24871=>3860, -25296=>3861, -27088=>3862, -39745=>3863, -23439=>3864, -32024=>3865, -32945=>3866, -36703=>3867, -20132=>3868, -20689=>3869, -21676=>3870, -21932=>3871, -23308=>3872, -23968=>3873, -24039=>3874, -25898=>3875, -25934=>3876, -26657=>3877, -27211=>3878, -29409=>3879, -30350=>3880, -30703=>3881, -32094=>3882, -32761=>3883, -33184=>3884, -34126=>3885, -34527=>3886, -36611=>3887, -36686=>3888, -37066=>3889, -39171=>3890, -39509=>3891, -39851=>3892, -19992=>3893, -20037=>3894, -20061=>3895, -20167=>3896, -20465=>3897, -20855=>3898, -21246=>3899, -21312=>3900, -12061=>3901, -21475=>3901, -21477=>3902, -63750=>3902, -21646=>3903, -22036=>3904, -22389=>3905, -22434=>3906, -23495=>3907, -23943=>3908, -24272=>3909, -25084=>3910, -25304=>3911, -25937=>3912, -26552=>3913, -26601=>3914, -27083=>3915, -27472=>3916, -27590=>3917, -27628=>3918, -27714=>3919, -28317=>3920, -28792=>3921, -29399=>3922, -29590=>3923, -29699=>3924, -30655=>3925, -30697=>3926, -31350=>3927, -32127=>3928, -32777=>3929, -12165=>3930, -33276=>3930, -33285=>3931, -33290=>3932, -33503=>3933, -34914=>3934, -35635=>3935, -36092=>3936, -36544=>3937, -36881=>3938, -37041=>3939, -37476=>3940, -37558=>3941, -39378=>3942, -39493=>3943, -40169=>3944, -40407=>3945, -12244=>3946, -40860=>3946, -63751=>3946, -63752=>3946, -22283=>3947, -23616=>3948, -33738=>3949, -38816=>3950, -38827=>3951, -40628=>3952, -21531=>3953, -31384=>3954, -32676=>3955, -35033=>3956, -36557=>3957, -37089=>3958, -22528=>3959, -23624=>3960, -25496=>3961, -31391=>3962, -23470=>3963, -12088=>3964, -24339=>3964, -31353=>3965, -31406=>3966, -33422=>3967, -36524=>3968, -20518=>3969, -21048=>3970, -21240=>3971, -21367=>3972, -22280=>3973, -25331=>3974, -25458=>3975, -27402=>3976, -28099=>3977, -30519=>3978, -21413=>3979, -29527=>3980, -34152=>3981, -36470=>3982, -38357=>3983, -26426=>3984, -27331=>3985, -28528=>3986, -35437=>3987, -36556=>3988, -39243=>3989, -26231=>3990, -27512=>3991, -36020=>3992, -12225=>3993, -39740=>3993, -21483=>3994, -22317=>3995, -22862=>3996, -25542=>3997, -27131=>3998, -29674=>3999, -30789=>4000, -31418=>4001, -31429=>4002, -31998=>4003, -33909=>4004, -35215=>4005, -36211=>4006, -36917=>4007, -38312=>4008, -21243=>4009, -22343=>4010, -30023=>4011, -31584=>4012, -33740=>4013, -37406=>4014, -27224=>4015, -20811=>4016, -21067=>4017, -21127=>4018, -25119=>4019, -26840=>4020, -26997=>4021, -38553=>4022, -20677=>4023, -21156=>4024, -21220=>4025, -25027=>4026, -12100=>4027, -26020=>4027, -26681=>4028, -27135=>4029, -29822=>4030, -31563=>4031, -33465=>4032, -33771=>4033, -35250=>4034, -35641=>4035, -36817=>4036, -39241=>4037, -20170=>4038, -22935=>4039, -25810=>4040, -26129=>4041, -27278=>4042, -29748=>4043, -31105=>4044, -31165=>4045, -33449=>4046, -34942=>4047, -34943=>4048, -35167=>4049, -37670=>4050, -20235=>4051, -21450=>4052, -24613=>4053, -25201=>4054, -27762=>4055, -32026=>4056, -32102=>4057, -20120=>4058, -20834=>4059, -30684=>4060, -32943=>4061, -20225=>4062, -20238=>4063, -20854=>4064, -20864=>4065, -21980=>4066, -22120=>4067, -22331=>4068, -22522=>4069, -22524=>4070, -22804=>4071, -22855=>4072, -22931=>4073, -23492=>4074, -23696=>4075, -23822=>4076, -12080=>4077, -24049=>4077, -24190=>4078, -24524=>4079, -25216=>4080, -26071=>4081, -26083=>4082, -26398=>4083, -26399=>4084, -26462=>4085, -26827=>4086, -26820=>4087, -27231=>4088, -27450=>4089, -27683=>4090, -27773=>4091, -27778=>4092, -28103=>4093, -29592=>4094, -29734=>4095, -29738=>4096, -29826=>4097, -29859=>4098, -30072=>4099, -30079=>4100, -30849=>4101, -30959=>4102, -31041=>4103, -31047=>4104, -31048=>4105, -31098=>4106, -31637=>4107, -32000=>4108, -32186=>4109, -32648=>4110, -32774=>4111, -32813=>4112, -32908=>4113, -35352=>4114, -35663=>4115, -35912=>4116, -63744=>4116, -36215=>4117, -37665=>4118, -37668=>4119, -39138=>4120, -39249=>4121, -39438=>4122, -39439=>4123, -39525=>4124, -40594=>4125, -32202=>4126, -20342=>4127, -21513=>4128, -25326=>4129, -26708=>4130, -12198=>4131, -37329=>4131, -63754=>4131, -21931=>4132, -20794=>4133, -23068=>4134, -25062=>4135, -25295=>4136, -63835=>4136, -25343=>4137, -37027=>4138, -35582=>4139, -63837=>4139, -26262=>4140, -29014=>4141, -38627=>4142, -25423=>4143, -25466=>4144, -21335=>4145, -26511=>4146, -26976=>4147, -28275=>4148, -30007=>4149, -32013=>4150, -34930=>4151, -22218=>4152, -23064=>4153, -20035=>4154, -20839=>4155, -22856=>4156, -63756=>4156, -26608=>4157, -32784=>4158, -12069=>4159, -22899=>4159, -63873=>4159, -24180=>4160, -63886=>4160, -25754=>4161, -63889=>4161, -31178=>4162, -63893=>4162, -24565=>4163, -63907=>4163, -24684=>4164, -25288=>4165, -25467=>4166, -63908=>4166, -23527=>4167, -63839=>4167, -63914=>4167, -23511=>4168, -21162=>4169, -22900=>4170, -24361=>4171, -24594=>4172, -63840=>4172, -29785=>4173, -39377=>4174, -28611=>4175, -33215=>4176, -36786=>4177, -24817=>4178, -33126=>4179, -23615=>4180, -63933=>4180, -23273=>4181, -35365=>4182, -26491=>4183, -63944=>4183, -32016=>4184, -63951=>4184, -33021=>4185, -23612=>4186, -27877=>4187, -63971=>4187, -21311=>4188, -63979=>4188, -28346=>4189, -63980=>4189, -22810=>4190, -33590=>4191, -63998=>4191, -20025=>4192, -63838=>4192, -20150=>4193, -20294=>4194, -21934=>4195, -22296=>4196, -22727=>4197, -24406=>4198, -26039=>4199, -26086=>4200, -27264=>4201, -27573=>4202, -28237=>4203, -30701=>4204, -31471=>4205, -31774=>4206, -32222=>4207, -34507=>4208, -34962=>4209, -37170=>4210, -37723=>4211, -25787=>4212, -28606=>4213, -29562=>4214, -30136=>4215, -36948=>4216, -21846=>4217, -22349=>4218, -25018=>4219, -25812=>4220, -26311=>4221, -28129=>4222, -28251=>4223, -28525=>4224, -28601=>4225, -30192=>4226, -32835=>4227, -33213=>4228, -34113=>4229, -35203=>4230, -35527=>4231, -35674=>4232, -37663=>4233, -27795=>4234, -30035=>4235, -31572=>4236, -36367=>4237, -36957=>4238, -21776=>4239, -22530=>4240, -22616=>4241, -24162=>4242, -25095=>4243, -25758=>4244, -26848=>4245, -30070=>4246, -31958=>4247, -64003=>4247, -34739=>4248, -40680=>4249, -20195=>4250, -22408=>4251, -22382=>4252, -12068=>4253, -22823=>4253, -23565=>4254, -23729=>4255, -24118=>4256, -24453=>4257, -25140=>4258, -25825=>4259, -29619=>4260, -33274=>4261, -34955=>4262, -36024=>4263, -38538=>4264, -40667=>4265, -23429=>4266, -64004=>4266, -24503=>4267, -24755=>4268, -20498=>4269, -12049=>4270, -20992=>4270, -21040=>4271, -22294=>4272, -22581=>4273, -22615=>4274, -23566=>4275, -23648=>4276, -23798=>4277, -23947=>4278, -24230=>4279, -64001=>4279, -24466=>4280, -24764=>4281, -25361=>4282, -25481=>4283, -25623=>4284, -26691=>4285, -26873=>4286, -27330=>4287, -28120=>4288, -28193=>4289, -28372=>4290, -28644=>4291, -29182=>4292, -30428=>4293, -30585=>4294, -31153=>4295, -31291=>4296, -33796=>4297, -35241=>4298, -36077=>4299, -36339=>4300, -36424=>4301, -36867=>4302, -36884=>4303, -36947=>4304, -37117=>4305, -37709=>4306, -38518=>4307, -38876=>4308, -27602=>4309, -28678=>4310, -29272=>4311, -29346=>4312, -29544=>4313, -30563=>4314, -31167=>4315, -31716=>4316, -32411=>4317, -35712=>4318, -63834=>4318, -22697=>4319, -24775=>4320, -25958=>4321, -26109=>4322, -26302=>4323, -27788=>4324, -28958=>4325, -29129=>4326, -35930=>4327, -38931=>4328, -20077=>4329, -31361=>4330, -20189=>4331, -20908=>4332, -20941=>4333, -21205=>4334, -21516=>4335, -24999=>4336, -26481=>4337, -26704=>4338, -26847=>4339, -27934=>4340, -64005=>4340, -28540=>4341, -30140=>4342, -30643=>4343, -31461=>4344, -33012=>4345, -33891=>4346, -37509=>4347, -20828=>4348, -12099=>4349, -26007=>4349, -26460=>4350, -26515=>4351, -30168=>4352, -31431=>4353, -33651=>4354, -12182=>4355, -35910=>4355, -36887=>4356, -38957=>4357, -23663=>4358, -33216=>4359, -33434=>4360, -36929=>4361, -36975=>4362, -37389=>4363, -24471=>4364, -23965=>4365, -27225=>4366, -29128=>4367, -30331=>4368, -31561=>4369, -34276=>4370, -35588=>4371, -37159=>4372, -39472=>4373, -21895=>4374, -63755=>4374, -25078=>4375, -63757=>4375, -30313=>4376, -63758=>4376, -32645=>4377, -63759=>4377, -34367=>4378, -63760=>4378, -34746=>4379, -63761=>4379, -35064=>4380, -63762=>4380, -37007=>4381, -63763=>4381, -27931=>4382, -63765=>4382, -28889=>4383, -63766=>4383, -29662=>4384, -63767=>4384, -32097=>4385, -33853=>4386, -63768=>4386, -37226=>4387, -63769=>4387, -39409=>4388, -63770=>4388, -20098=>4389, -63771=>4389, -21365=>4390, -63772=>4390, -27396=>4391, -63773=>4391, -27410=>4392, -28734=>4393, -29211=>4394, -63774=>4394, -34349=>4395, -63775=>4395, -40478=>4396, -63776=>4396, -21068=>4397, -36771=>4398, -23888=>4399, -63777=>4399, -25829=>4400, -25900=>4401, -27414=>4402, -28651=>4403, -63778=>4403, -31811=>4404, -32412=>4405, -34253=>4406, -63779=>4406, -35172=>4407, -63780=>4407, -35261=>4408, -25289=>4409, -63781=>4409, -33240=>4410, -63782=>4410, -34847=>4411, -63783=>4411, -24266=>4412, -63784=>4412, -26391=>4413, -63785=>4413, -28010=>4414, -63786=>4414, -29436=>4415, -63787=>4415, -29701=>4416, -29807=>4417, -34690=>4418, -37086=>4419, -63788=>4419, -20358=>4420, -63789=>4420, -23821=>4421, -24480=>4422, -33802=>4423, -20919=>4424, -63790=>4424, -25504=>4425, -63861=>4425, -30053=>4426, -63862=>4426, -20142=>4427, -63863=>4427, -20486=>4428, -20841=>4429, -63864=>4429, -20937=>4430, -63865=>4430, -26753=>4431, -63866=>4431, -27153=>4432, -31918=>4433, -31921=>4434, -31975=>4435, -63867=>4435, -33391=>4436, -63868=>4436, -35538=>4437, -63869=>4437, -36635=>4438, -37327=>4439, -63870=>4439, -20406=>4440, -20791=>4441, -21237=>4442, -63871=>4442, -21570=>4443, -63872=>4443, -24300=>4444, -63874=>4444, -24942=>4445, -25150=>4446, -26053=>4447, -63875=>4447, -27354=>4448, -28670=>4449, -63876=>4449, -31018=>4450, -63877=>4450, -34268=>4451, -34851=>4452, -38317=>4453, -63878=>4453, -39522=>4454, -39530=>4455, -63879=>4455, -40599=>4456, -63880=>4456, -40654=>4457, -63881=>4457, -12050=>4458, -21147=>4458, -63882=>4458, -26310=>4459, -63883=>4459, -27511=>4460, -63884=>4460, -28701=>4461, -31019=>4462, -36706=>4463, -63885=>4463, -38722=>4464, -24976=>4465, -63887=>4465, -25088=>4466, -63888=>4466, -25891=>4467, -28451=>4468, -63890=>4468, -29001=>4469, -63891=>4469, -29833=>4470, -63892=>4470, -32244=>4471, -63894=>4471, -32879=>4472, -63895=>4472, -34030=>4473, -63897=>4473, -36646=>4474, -63896=>4474, -36899=>4475, -63898=>4475, -37706=>4476, -63899=>4476, -20925=>4477, -21015=>4478, -63900=>4478, -21155=>4479, -63901=>4479, -27916=>4480, -28872=>4481, -63903=>4481, -35010=>4482, -63904=>4482, -24265=>4483, -63906=>4483, -25986=>4484, -27566=>4485, -63909=>4485, -28610=>4486, -31806=>4487, -63910=>4487, -29557=>4488, -63911=>4488, -20196=>4489, -63912=>4489, -20278=>4490, -22265=>4491, -63913=>4491, -23738=>4492, -23994=>4493, -63915=>4493, -24604=>4494, -63916=>4494, -29618=>4495, -63917=>4495, -31533=>4496, -32666=>4497, -63919=>4497, -32718=>4498, -32838=>4499, -63920=>4499, -36894=>4500, -37428=>4501, -63921=>4501, -38646=>4502, -63922=>4502, -38728=>4503, -63923=>4503, -38936=>4504, -63924=>4504, -40801=>4505, -20363=>4506, -63925=>4506, -28583=>4507, -31150=>4508, -63926=>4508, -37300=>4509, -63927=>4509, -38583=>4510, -63928=>4510, -21214=>4511, -63791=>4511, -25736=>4512, -25796=>4513, -63792=>4513, -27347=>4514, -63793=>4514, -28510=>4515, -28696=>4516, -29200=>4517, -63794=>4517, -30439=>4518, -63795=>4518, -12156=>4519, -32769=>4519, -63796=>4519, -34310=>4520, -63797=>4520, -34396=>4521, -63798=>4521, -36335=>4522, -63799=>4522, -36613=>4523, -38706=>4524, -63800=>4524, -39791=>4525, -63801=>4525, -40442=>4526, -63802=>4526, -12228=>4527, -40565=>4527, -30860=>4528, -63803=>4528, -31103=>4529, -63804=>4529, -32160=>4530, -63805=>4530, -33737=>4531, -63806=>4531, -37636=>4532, -63807=>4532, -12229=>4533, -40575=>4533, -63808=>4533, -40595=>4534, -35542=>4535, -63809=>4535, -22751=>4536, -63810=>4536, -24324=>4537, -63811=>4537, -26407=>4538, -28711=>4539, -29903=>4540, -31840=>4541, -63812=>4541, -32894=>4542, -63813=>4542, -20769=>4543, -28712=>4544, -29282=>4545, -63814=>4545, -30922=>4546, -63815=>4546, -36034=>4547, -63816=>4547, -36058=>4548, -36084=>4549, -38647=>4550, -63817=>4550, -20102=>4551, -63930=>4551, -20698=>4552, -63931=>4552, -23534=>4553, -63932=>4553, -24278=>4554, -26009=>4555, -63934=>4555, -29134=>4556, -63936=>4556, -30274=>4557, -63937=>4557, -30637=>4558, -32842=>4559, -34044=>4560, -63938=>4560, -36988=>4561, -63939=>4561, -39719=>4562, -12243=>4563, -40845=>4563, -63940=>4563, -22744=>4564, -63818=>4564, -23105=>4565, -23650=>4566, -63819=>4566, -27155=>4567, -63820=>4567, -28122=>4568, -63821=>4568, -28431=>4569, -63822=>4569, -30267=>4570, -32047=>4571, -63823=>4571, -32311=>4572, -63824=>4572, -34078=>4573, -35128=>4574, -37860=>4575, -38475=>4576, -63825=>4576, -21129=>4577, -63943=>4577, -26066=>4578, -26611=>4579, -63945=>4579, -27060=>4580, -27969=>4581, -63946=>4581, -28316=>4582, -63947=>4582, -28687=>4583, -29705=>4584, -63948=>4584, -29792=>4585, -30041=>4586, -63949=>4586, -30244=>4587, -30827=>4588, -63950=>4588, -35628=>4589, -39006=>4590, -63952=>4590, -20845=>4591, -63953=>4591, -25134=>4592, -63954=>4592, -38520=>4593, -63955=>4593, -20374=>4594, -20523=>4595, -63956=>4595, -23833=>4596, -63957=>4596, -28138=>4597, -63958=>4597, -32184=>4598, -36650=>4599, -63959=>4599, -24459=>4600, -63960=>4600, -24900=>4601, -63961=>4601, -26647=>4602, -63962=>4602, -38534=>4603, -63964=>4603, -21202=>4604, -63826=>4604, -32907=>4605, -63827=>4605, -20956=>4606, -63828=>4606, -20940=>4607, -63829=>4607, -26974=>4608, -31260=>4609, -63830=>4609, -32190=>4610, -63831=>4610, -33777=>4611, -63832=>4611, -38517=>4612, -63833=>4612, -20442=>4613, -21033=>4614, -63965=>4614, -21400=>4615, -21519=>4616, -63966=>4616, -21774=>4617, -23653=>4618, -63967=>4618, -24743=>4619, -26446=>4620, -63969=>4620, -26792=>4621, -63970=>4621, -28012=>4622, -29313=>4623, -29432=>4624, -29702=>4625, -63972=>4625, -29827=>4626, -30178=>4627, -63973=>4627, -31852=>4628, -32633=>4629, -63974=>4629, -32696=>4630, -33673=>4631, -35023=>4632, -63975=>4632, -35041=>4633, -63976=>4633, -12197=>4634, -37324=>4634, -63977=>4634, -37328=>4635, -38626=>4636, -63978=>4636, -39881=>4637, -21533=>4638, -63981=>4638, -28542=>4639, -29136=>4640, -63982=>4640, -29848=>4641, -63983=>4641, -34298=>4642, -63984=>4642, -36522=>4643, -38563=>4644, -63985=>4644, -40023=>4645, -63986=>4645, -40607=>4646, -63987=>4646, -26519=>4647, -63988=>4647, -28107=>4648, -63989=>4648, -29747=>4649, -33256=>4650, -63990=>4650, -38678=>4651, -30764=>4652, -12148=>4653, -31435=>4653, -63991=>4653, -31520=>4654, -63992=>4654, -31890=>4655, -63993=>4655, -25705=>4656, -29802=>4657, -30194=>4658, -30908=>4659, -30952=>4660, -12218=>4661, -39340=>4661, -39764=>4662, -12231=>4663, -40635=>4663, -23518=>4664, -24149=>4665, -28448=>4666, -33180=>4667, -33707=>4668, -37000=>4669, -19975=>4670, -21325=>4671, -23081=>4672, -24018=>4673, -24398=>4674, -24930=>4675, -25405=>4676, -26217=>4677, -26364=>4678, -28415=>4679, -28459=>4680, -28771=>4681, -30622=>4682, -33836=>4683, -34067=>4684, -34875=>4685, -36627=>4686, -39237=>4687, -39995=>4688, -21788=>4689, -25273=>4690, -26411=>4691, -27819=>4692, -33545=>4693, -35178=>4694, -38778=>4695, -20129=>4696, -22916=>4697, -24536=>4698, -24537=>4699, -26395=>4700, -32178=>4701, -32596=>4702, -33426=>4703, -33579=>4704, -33725=>4705, -36638=>4706, -37017=>4707, -22475=>4708, -22969=>4709, -23186=>4710, -23504=>4711, -26151=>4712, -26522=>4713, -26757=>4714, -27599=>4715, -29028=>4716, -32629=>4717, -36023=>4718, -36067=>4719, -36993=>4720, -39749=>4721, -33032=>4722, -35978=>4723, -38476=>4724, -39488=>4725, -12230=>4726, -40613=>4726, -23391=>4727, -27667=>4728, -29467=>4729, -30450=>4730, -30431=>4731, -33804=>4732, -20906=>4733, -35219=>4734, -20813=>4735, -20885=>4736, -21193=>4737, -26825=>4738, -27796=>4739, -30468=>4740, -30496=>4741, -32191=>4742, -32236=>4743, -12207=>4744, -38754=>4744, -40629=>4745, -28357=>4746, -34065=>4747, -20901=>4748, -21517=>4749, -21629=>4750, -26126=>4751, -26269=>4752, -26919=>4753, -28319=>4754, -12139=>4755, -30399=>4755, -30609=>4756, -33559=>4757, -33986=>4758, -34719=>4759, -37225=>4760, -37528=>4761, -40180=>4762, -34946=>4763, -20398=>4764, -20882=>4765, -21215=>4766, -22982=>4767, -24125=>4768, -24917=>4769, -25720=>4770, -25721=>4771, -26286=>4772, -26576=>4773, -27169=>4774, -27597=>4775, -12113=>4776, -27611=>4776, -29279=>4777, -29281=>4778, -29761=>4779, -30520=>4780, -12141=>4781, -30683=>4781, -32791=>4782, -33468=>4783, -33541=>4784, -35584=>4785, -35624=>4786, -35980=>4787, -12106=>4788, -26408=>4788, -27792=>4789, -29287=>4790, -12140=>4791, -30446=>4791, -30566=>4792, -31302=>4793, -40361=>4794, -27519=>4795, -27794=>4796, -22818=>4797, -26406=>4798, -33945=>4799, -21359=>4800, -22675=>4801, -22937=>4802, -24287=>4803, -25551=>4804, -26164=>4805, -26483=>4806, -28218=>4807, -29483=>4808, -31447=>4809, -33495=>4810, -37672=>4811, -21209=>4812, -24043=>4813, -25006=>4814, -25035=>4815, -25098=>4816, -25287=>4817, -25771=>4818, -12102=>4819, -26080=>4819, -26969=>4820, -27494=>4821, -12111=>4822, -27595=>4822, -28961=>4823, -29687=>4824, -30045=>4825, -32326=>4826, -33310=>4827, -33538=>4828, -34154=>4829, -35491=>4830, -36031=>4831, -38695=>4832, -40289=>4833, -22696=>4834, -40664=>4835, -20497=>4836, -21006=>4837, -21563=>4838, -21839=>4839, -12098=>4840, -25991=>4840, -27766=>4841, -32010=>4842, -32011=>4843, -32862=>4844, -34442=>4845, -12200=>4846, -38272=>4846, -38639=>4847, -21247=>4848, -27797=>4849, -29289=>4850, -21619=>4851, -23194=>4852, -23614=>4853, -23883=>4854, -24396=>4855, -24494=>4856, -26410=>4857, -26806=>4858, -26979=>4859, -28220=>4860, -28228=>4861, -30473=>4862, -12150=>4863, -31859=>4863, -32654=>4864, -34183=>4865, -35598=>4866, -36855=>4867, -38753=>4868, -40692=>4869, -23735=>4870, -24758=>4871, -24845=>4872, -25003=>4873, -25935=>4874, -26107=>4875, -26108=>4876, -27665=>4877, -27887=>4878, -29599=>4879, -29641=>4880, -32225=>4881, -38292=>4882, -23494=>4883, -34588=>4884, -35600=>4885, -21085=>4886, -21338=>4887, -25293=>4888, -25615=>4889, -25778=>4890, -26420=>4891, -27192=>4892, -27850=>4893, -29632=>4894, -29854=>4895, -31636=>4896, -31893=>4897, -32283=>4898, -33162=>4899, -33334=>4900, -34180=>4901, -36843=>4902, -38649=>4903, -39361=>4904, -20276=>4905, -21322=>4906, -21453=>4907, -21467=>4908, -25292=>4909, -25644=>4910, -25856=>4911, -26001=>4912, -27075=>4913, -27886=>4914, -28504=>4915, -29677=>4916, -30036=>4917, -30242=>4918, -30436=>4919, -30460=>4920, -30928=>4921, -30971=>4922, -63844=>4922, -31020=>4923, -32070=>4924, -33324=>4925, -34784=>4926, -36820=>4927, -38930=>4928, -39151=>4929, -21187=>4930, -25300=>4931, -25765=>4932, -28196=>4933, -28497=>4934, -30332=>4935, -36299=>4936, -37297=>4937, -37474=>4938, -39662=>4939, -39747=>4940, -20515=>4941, -20621=>4942, -22346=>4943, -22952=>4944, -23592=>4945, -24135=>4946, -24439=>4947, -25151=>4948, -25918=>4949, -12101=>4950, -26041=>4950, -26049=>4951, -26121=>4952, -26507=>4953, -27036=>4954, -28354=>4955, -30917=>4956, -32033=>4957, -32938=>4958, -33152=>4959, -33323=>4960, -33459=>4961, -33953=>4962, -34444=>4963, -35370=>4964, -35607=>4965, -37030=>4966, -38450=>4967, -40848=>4968, -20493=>4969, -20467=>4970, -22521=>4971, -24472=>4972, -25308=>4973, -25490=>4974, -26479=>4975, -28227=>4976, -28953=>4977, -30403=>4978, -32972=>4979, -32986=>4980, -35060=>4981, -35061=>4982, -35097=>4983, -36064=>4984, -36649=>4985, -37197=>4986, -38506=>4987, -20271=>4988, -20336=>4989, -24091=>4990, -26575=>4991, -26658=>4992, -12137=>4993, -30333=>4993, -30334=>4994, -39748=>4995, -24161=>4996, -27146=>4997, -29033=>4998, -29140=>4999, -30058=>5000, -32321=>5001, -34115=>5002, -34281=>5003, -39132=>5004, -20240=>5005, -31567=>5006, -32624=>5007, -38309=>5008, -20961=>5009, -24070=>5010, -26805=>5011, -27710=>5012, -27726=>5013, -27867=>5014, -29359=>5015, -31684=>5016, -33539=>5017, -27861=>5018, -29754=>5019, -20731=>5020, -21128=>5021, -22721=>5022, -25816=>5023, -27287=>5024, -29863=>5025, -30294=>5026, -30887=>5027, -34327=>5028, -38370=>5029, -38713=>5030, -21342=>5031, -24321=>5032, -35722=>5033, -36776=>5034, -36783=>5035, -37002=>5036, -21029=>5037, -30629=>5038, -40009=>5039, -40712=>5040, -19993=>5041, -20482=>5042, -20853=>5043, -23643=>5044, -24183=>5045, -26142=>5046, -26170=>5047, -26564=>5048, -26821=>5049, -28851=>5050, -29953=>5051, -30149=>5052, -31177=>5053, -31453=>5054, -36647=>5055, -39200=>5056, -39432=>5057, -20445=>5058, -22561=>5059, -22577=>5060, -23542=>5061, -26222=>5062, -27493=>5063, -27921=>5064, -28282=>5065, -28541=>5066, -29668=>5067, -29995=>5068, -33769=>5069, -35036=>5070, -35091=>5071, -35676=>5072, -36628=>5073, -20239=>5074, -20693=>5075, -21264=>5076, -12056=>5077, -21340=>5077, -23443=>5078, -24489=>5079, -63846=>5079, -26381=>5080, -31119=>5081, -33145=>5082, -33583=>5083, -34068=>5084, -35079=>5085, -35206=>5086, -36665=>5087, -36667=>5088, -64007=>5088, -39333=>5089, -39954=>5090, -26412=>5091, -20086=>5092, -20472=>5093, -22857=>5094, -23553=>5095, -23791=>5096, -23792=>5097, -25447=>5098, -26834=>5099, -28925=>5100, -29090=>5101, -29739=>5102, -32299=>5103, -34028=>5104, -34562=>5105, -36898=>5106, -37586=>5107, -40179=>5108, -19981=>5109, -63847=>5109, -20184=>5110, -20463=>5111, -20613=>5112, -21078=>5113, -21103=>5114, -21542=>5115, -21648=>5116, -22496=>5117, -22827=>5118, -23142=>5119, -23386=>5120, -23413=>5121, -23500=>5122, -24220=>5123, -25206=>5124, -25975=>5125, -26023=>5126, -28014=>5127, -28325=>5128, -12119=>5129, -29238=>5129, -31526=>5130, -31807=>5131, -12152=>5132, -32566=>5132, -33104=>5133, -33105=>5134, -33178=>5135, -33344=>5136, -33433=>5137, -33705=>5138, -35331=>5139, -36000=>5140, -36070=>5141, -36091=>5142, -36212=>5143, -36282=>5144, -37096=>5145, -37340=>5146, -12201=>5147, -38428=>5147, -38468=>5148, -39385=>5149, -40167=>5150, -21271=>5151, -63843=>5151, -20998=>5152, -21545=>5153, -22132=>5154, -22707=>5155, -22868=>5156, -22894=>5157, -24575=>5158, -24996=>5159, -25198=>5160, -26128=>5161, -27774=>5162, -28954=>5163, -30406=>5164, -31881=>5165, -31966=>5166, -32027=>5167, -33452=>5168, -36033=>5169, -38640=>5170, -20315=>5171, -24343=>5172, -24447=>5173, -25282=>5174, -23849=>5175, -26379=>5176, -26842=>5177, -30844=>5178, -32323=>5179, -40300=>5180, -19989=>5181, -20633=>5182, -12052=>5183, -21269=>5183, -21290=>5184, -21329=>5185, -22915=>5186, -23138=>5187, -24199=>5188, -24754=>5189, -24970=>5190, -25161=>5191, -25209=>5192, -26000=>5193, -26503=>5194, -27047=>5195, -12112=>5196, -27604=>5196, -27606=>5197, -27607=>5198, -27608=>5199, -27832=>5200, -29749=>5201, -30202=>5202, -30738=>5203, -30865=>5204, -31189=>5205, -31192=>5206, -31875=>5207, -32203=>5208, -32737=>5209, -32933=>5210, -33086=>5211, -33218=>5212, -33778=>5213, -34586=>5214, -35048=>5215, -35513=>5216, -35692=>5217, -36027=>5218, -37145=>5219, -12206=>5220, -38750=>5220, -12214=>5221, -39131=>5221, -12240=>5222, -40763=>5222, -22188=>5223, -23338=>5224, -24428=>5225, -25996=>5226, -27315=>5227, -27567=>5228, -27996=>5229, -28657=>5230, -28693=>5231, -29277=>5232, -29613=>5233, -36007=>5234, -36051=>5235, -38971=>5236, -24977=>5237, -27703=>5238, -32856=>5239, -39425=>5240, -20045=>5241, -20107=>5242, -20123=>5243, -20181=>5244, -20282=>5245, -20284=>5246, -20351=>5247, -20447=>5248, -20735=>5249, -21490=>5250, -21496=>5251, -21766=>5252, -21987=>5253, -22235=>5254, -12064=>5255, -22763=>5255, -22882=>5256, -23057=>5257, -23531=>5258, -23546=>5259, -23556=>5260, -24051=>5261, -24107=>5262, -24473=>5263, -24605=>5264, -25448=>5265, -26012=>5266, -26031=>5267, -26614=>5268, -26619=>5269, -26797=>5270, -27515=>5271, -27801=>5272, -27863=>5273, -28195=>5274, -28681=>5275, -29509=>5276, -30722=>5277, -31038=>5278, -31040=>5279, -31072=>5280, -31169=>5281, -31721=>5282, -32023=>5283, -32114=>5284, -32902=>5285, -33293=>5286, -33678=>5287, -34001=>5288, -34503=>5289, -35039=>5290, -35408=>5291, -35422=>5292, -35613=>5293, -36060=>5294, -36198=>5295, -36781=>5296, -37034=>5297, -39164=>5298, -39391=>5299, -40605=>5300, -21066=>5301, -26388=>5302, -20632=>5303, -21034=>5304, -12077=>5305, -23665=>5305, -25955=>5306, -27733=>5307, -29642=>5308, -29987=>5309, -30109=>5310, -31639=>5311, -33948=>5312, -37240=>5313, -38704=>5314, -20087=>5315, -25746=>5316, -27578=>5317, -63856=>5317, -29022=>5318, -34217=>5319, -19977=>5320, -26441=>5321, -26862=>5322, -28183=>5323, -33439=>5324, -34072=>5325, -34923=>5326, -25591=>5327, -28545=>5328, -37394=>5329, -39087=>5330, -19978=>5331, -20663=>5332, -20687=>5333, -20767=>5334, -21830=>5335, -21930=>5336, -22039=>5337, -23360=>5338, -23577=>5339, -23776=>5340, -24120=>5341, -24202=>5342, -24224=>5343, -24258=>5344, -24819=>5345, -26705=>5346, -27233=>5347, -28248=>5348, -29245=>5349, -29248=>5350, -29376=>5351, -63994=>5351, -30456=>5352, -31077=>5353, -31665=>5354, -32724=>5355, -35059=>5356, -35316=>5357, -35443=>5358, -35937=>5359, -36062=>5360, -38684=>5361, -22622=>5362, -63852=>5362, -29885=>5363, -36093=>5364, -21959=>5365, -31329=>5366, -32034=>5367, -63850=>5367, -12170=>5368, -33394=>5368, -29298=>5369, -12131=>5370, -29983=>5370, -29989=>5371, -31513=>5372, -22661=>5373, -22779=>5374, -23996=>5375, -24207=>5376, -24246=>5377, -24464=>5378, -24661=>5379, -25234=>5380, -25471=>5381, -25933=>5382, -26257=>5383, -26329=>5384, -26360=>5385, -26646=>5386, -26866=>5387, -29312=>5388, -29790=>5389, -31598=>5390, -32110=>5391, -32214=>5392, -32626=>5393, -32997=>5394, -33298=>5395, -34223=>5396, -35199=>5397, -35475=>5398, -36893=>5399, -37604=>5400, -12233=>5401, -40653=>5401, -12239=>5402, -40736=>5402, -12067=>5403, -22805=>5403, -22893=>5404, -24109=>5405, -24796=>5406, -26132=>5407, -26227=>5408, -26512=>5409, -27728=>5410, -28101=>5411, -28511=>5412, -12143=>5413, -30707=>5413, -30889=>5414, -33990=>5415, -37323=>5416, -37675=>5417, -20185=>5418, -20682=>5419, -20808=>5420, -21892=>5421, -23307=>5422, -23459=>5423, -25159=>5424, -25982=>5425, -26059=>5426, -28210=>5427, -29053=>5428, -29697=>5429, -29764=>5430, -29831=>5431, -29887=>5432, -30316=>5433, -31146=>5434, -32218=>5435, -32341=>5436, -32680=>5437, -33146=>5438, -33203=>5439, -33337=>5440, -34330=>5441, -34796=>5442, -35445=>5443, -36323=>5444, -36984=>5445, -37521=>5446, -37925=>5447, -39245=>5448, -39854=>5449, -21352=>5450, -23633=>5451, -26964=>5452, -27844=>5453, -27945=>5454, -28203=>5455, -12166=>5456, -33292=>5456, -34203=>5457, -35131=>5458, -35373=>5459, -35498=>5460, -63855=>5460, -63905=>5460, -38634=>5461, -40807=>5462, -21089=>5463, -26297=>5464, -27570=>5465, -32406=>5466, -34814=>5467, -36109=>5468, -38275=>5469, -38493=>5470, -25885=>5471, -28041=>5472, -29166=>5473, -22478=>5474, -22995=>5475, -23468=>5476, -24615=>5477, -24826=>5478, -25104=>5479, -26143=>5480, -26207=>5481, -29481=>5482, -29689=>5483, -30427=>5484, -30465=>5485, -63853=>5485, -31596=>5486, -32854=>5487, -32882=>5488, -33125=>5489, -35488=>5490, -37266=>5491, -19990=>5492, -21218=>5493, -27506=>5494, -27927=>5495, -31237=>5496, -31545=>5497, -32048=>5498, -36016=>5499, -21484=>5500, -22063=>5501, -22609=>5502, -23477=>5503, -12073=>5504, -23567=>5504, -23569=>5505, -24034=>5506, -25152=>5507, -25475=>5508, -25620=>5509, -26157=>5510, -26803=>5511, -27836=>5512, -28040=>5513, -28335=>5514, -28703=>5515, -28836=>5516, -29138=>5517, -29990=>5518, -30095=>5519, -30094=>5520, -30233=>5521, -31505=>5522, -31712=>5523, -31787=>5524, -32032=>5525, -32057=>5526, -34092=>5527, -34157=>5528, -34311=>5529, -35380=>5530, -36877=>5531, -36961=>5532, -37045=>5533, -37559=>5534, -38902=>5535, -39479=>5536, -20439=>5537, -23660=>5538, -26463=>5539, -28049=>5540, -31903=>5541, -32396=>5542, -35606=>5543, -36118=>5544, -36895=>5545, -23403=>5546, -24061=>5547, -25613=>5548, -33984=>5549, -36956=>5550, -39137=>5551, -29575=>5552, -63841=>5552, -63963=>5552, -23435=>5553, -24730=>5554, -26494=>5555, -28126=>5556, -35359=>5557, -35494=>5558, -36865=>5559, -38924=>5560, -21047=>5561, -28753=>5562, -30862=>5563, -37782=>5564, -34928=>5565, -37335=>5566, -20462=>5567, -21463=>5568, -22013=>5569, -22234=>5570, -22402=>5571, -22781=>5572, -23234=>5573, -23432=>5574, -23723=>5575, -23744=>5576, -24101=>5577, -24833=>5578, -25101=>5579, -12095=>5580, -25163=>5580, -25480=>5581, -25628=>5582, -25910=>5583, -25976=>5584, -63849=>5584, -27193=>5585, -27530=>5586, -12116=>5587, -27700=>5587, -27929=>5588, -28465=>5589, -29159=>5590, -29417=>5591, -29560=>5592, -29703=>5593, -29874=>5594, -30246=>5595, -30561=>5596, -31168=>5597, -31319=>5598, -31466=>5599, -31929=>5600, -32143=>5601, -32172=>5602, -32353=>5603, -32670=>5604, -33065=>5605, -33585=>5606, -33936=>5607, -34010=>5608, -34282=>5609, -34966=>5610, -35504=>5611, -35728=>5612, -36664=>5613, -36930=>5614, -36995=>5615, -37228=>5616, -37526=>5617, -37561=>5618, -38539=>5619, -38567=>5620, -38568=>5621, -38614=>5622, -38656=>5623, -38920=>5624, -12216=>5625, -39318=>5625, -39635=>5626, -39706=>5627, -21460=>5628, -22654=>5629, -22809=>5630, -23408=>5631, -23487=>5632, -28113=>5633, -28506=>5634, -29087=>5635, -29729=>5636, -29881=>5637, -32901=>5638, -33789=>5639, -24033=>5640, -24455=>5641, -24490=>5642, -24642=>5643, -26092=>5644, -26642=>5645, -26991=>5646, -27219=>5647, -27529=>5648, -27957=>5649, -28147=>5650, -29667=>5651, -30462=>5652, -30636=>5653, -31565=>5654, -32020=>5655, -33059=>5656, -33308=>5657, -33600=>5658, -34036=>5659, -34147=>5660, -35426=>5661, -35524=>5662, -37255=>5663, -37662=>5664, -38918=>5665, -39348=>5666, -25100=>5667, -34899=>5668, -36848=>5669, -37477=>5670, -23815=>5671, -23847=>5672, -23913=>5673, -29791=>5674, -33181=>5675, -34664=>5676, -28629=>5677, -25342=>5678, -63859=>5678, -32722=>5679, -35126=>5680, -35186=>5681, -19998=>5682, -20056=>5683, -20711=>5684, -21213=>5685, -21319=>5686, -25215=>5687, -26119=>5688, -32361=>5689, -34821=>5690, -38494=>5691, -20365=>5692, -21273=>5693, -22070=>5694, -22987=>5695, -23204=>5696, -12075=>5697, -23608=>5697, -23630=>5698, -23629=>5699, -24066=>5700, -24337=>5701, -24643=>5702, -26045=>5703, -26159=>5704, -26178=>5705, -26558=>5706, -26612=>5707, -29468=>5708, -12142=>5709, -30690=>5709, -12144=>5710, -31034=>5710, -32709=>5711, -33940=>5712, -33997=>5713, -35222=>5714, -35430=>5715, -35433=>5716, -35553=>5717, -12183=>5718, -35925=>5718, -35962=>5719, -22516=>5720, -23508=>5721, -24335=>5722, -24687=>5723, -25325=>5724, -26893=>5725, -27542=>5726, -28252=>5727, -29060=>5728, -31698=>5729, -34645=>5730, -35672=>5731, -63996=>5731, -36606=>5732, -12215=>5733, -39135=>5733, -39166=>5734, -20280=>5735, -20353=>5736, -20449=>5737, -21627=>5738, -23072=>5739, -23480=>5740, -24892=>5741, -26032=>5742, -26216=>5743, -29180=>5744, -30003=>5745, -31070=>5746, -32051=>5747, -33102=>5748, -12162=>5749, -33251=>5749, -33688=>5750, -34218=>5751, -34254=>5752, -34563=>5753, -35338=>5754, -12189=>5755, -36523=>5755, -12191=>5756, -36763=>5756, -36805=>5757, -22833=>5758, -23460=>5759, -23526=>5760, -24713=>5761, -23529=>5762, -23563=>5763, -12092=>5764, -24515=>5764, -27777=>5765, -28145=>5766, -28683=>5767, -29978=>5768, -33455=>5769, -35574=>5770, -20160=>5771, -63997=>5771, -12055=>5772, -21313=>5772, -38617=>5773, -12114=>5774, -27663=>5774, -20126=>5775, -20420=>5776, -20818=>5777, -21854=>5778, -23077=>5779, -23784=>5780, -25105=>5781, -12123=>5782, -29273=>5782, -33469=>5783, -33706=>5784, -34558=>5785, -34905=>5786, -35357=>5787, -38463=>5788, -38597=>5789, -39187=>5790, -40201=>5791, -40285=>5792, -22538=>5793, -23731=>5794, -23997=>5795, -24132=>5796, -24801=>5797, -63929=>5797, -24853=>5798, -25569=>5799, -27138=>5800, -63764=>5800, -63836=>5800, -63935=>5800, -28197=>5801, -37122=>5802, -37716=>5803, -38990=>5804, -39952=>5805, -40823=>5806, -23433=>5807, -23736=>5808, -25353=>5809, -26191=>5810, -26696=>5811, -30524=>5812, -38593=>5813, -38797=>5814, -38996=>5815, -39839=>5816, -26017=>5817, -35585=>5818, -36555=>5819, -38332=>5820, -21813=>5821, -23721=>5822, -24022=>5823, -24245=>5824, -26263=>5825, -30284=>5826, -33780=>5827, -38343=>5828, -22739=>5829, -25276=>5830, -29390=>5831, -40232=>5832, -20208=>5833, -22830=>5834, -24591=>5835, -26171=>5836, -27523=>5837, -31207=>5838, -40230=>5839, -21395=>5840, -21696=>5841, -22467=>5842, -23830=>5843, -24859=>5844, -26326=>5845, -28079=>5846, -30861=>5847, -33406=>5848, -38552=>5849, -38724=>5850, -21380=>5851, -25212=>5852, -25494=>5853, -28082=>5854, -32266=>5855, -33099=>5856, -38989=>5857, -27387=>5858, -32588=>5859, -40367=>5860, -40474=>5861, -20063=>5862, -20539=>5863, -20918=>5864, -22812=>5865, -24825=>5866, -25590=>5867, -26928=>5868, -29242=>5869, -32822=>5870, -37326=>5871, -24369=>5872, -32004=>5873, -33509=>5874, -63860=>5874, -33903=>5875, -33979=>5876, -34277=>5877, -36493=>5878, -20335=>5879, -22756=>5880, -23363=>5881, -24665=>5882, -25562=>5883, -25880=>5884, -25965=>5885, -26264=>5886, -26954=>5887, -27171=>5888, -27915=>5889, -28673=>5890, -29036=>5891, -30162=>5892, -30221=>5893, -31155=>5894, -31344=>5895, -12154=>5896, -32650=>5896, -35140=>5897, -35731=>5898, -37312=>5899, -38525=>5900, -39178=>5901, -22276=>5902, -24481=>5903, -26044=>5904, -28417=>5905, -30208=>5906, -31142=>5907, -35486=>5908, -39341=>5909, -12226=>5910, -39770=>5910, -40812=>5911, -20740=>5912, -25014=>5913, -25233=>5914, -27277=>5915, -33222=>5916, -20547=>5917, -22576=>5918, -24422=>5919, -28937=>5920, -12180=>5921, -35328=>5921, -35578=>5922, -23420=>5923, -34326=>5924, -20474=>5925, -20796=>5926, -22196=>5927, -22852=>5928, -25513=>5929, -28153=>5930, -23978=>5931, -26989=>5932, -20870=>5933, -20104=>5934, -20313=>5935, -22914=>5936, -27487=>5937, -27741=>5938, -29877=>5939, -30998=>5940, -33287=>5941, -33349=>5942, -33593=>5943, -36671=>5944, -36701=>5945, -39192=>5946, -20134=>5947, -22495=>5948, -24441=>5949, -26131=>5950, -63968=>5950, -30123=>5951, -32377=>5952, -35695=>5953, -36870=>5954, -39515=>5955, -22181=>5956, -22567=>5957, -23032=>5958, -23071=>5959, -23476=>5960, -24310=>5961, -25424=>5962, -25403=>5963, -26941=>5964, -27783=>5965, -27839=>5966, -28046=>5967, -28051=>5968, -28149=>5969, -28436=>5970, -28895=>5971, -28982=>5972, -29017=>5973, -29123=>5974, -29141=>5975, -30799=>5976, -30831=>5977, -31605=>5978, -32227=>5979, -32303=>5980, -34893=>5981, -36575=>5982, -37467=>5983, -40182=>5984, -24709=>5985, -28037=>5986, -29105=>5987, -38321=>5988, -21421=>5989, -26579=>5990, -28814=>5991, -28976=>5992, -29744=>5993, -33398=>5994, -33490=>5995, -38331=>5996, -39653=>5997, -40573=>5998, -26308=>5999, -29121=>6000, -33865=>6001, -63854=>6001, -22603=>6002, -23992=>6003, -24433=>6004, -26144=>6005, -26254=>6006, -27001=>6007, -27054=>6008, -27704=>6009, -27891=>6010, -28214=>6011, -28481=>6012, -28634=>6013, -28699=>6014, -28719=>6015, -29008=>6016, -29151=>6017, -29552=>6018, -29787=>6019, -29908=>6020, -30408=>6021, -31310=>6022, -32403=>6023, -33521=>6024, -35424=>6025, -36814=>6026, -37704=>6027, -38681=>6028, -20034=>6029, -20522=>6030, -21000=>6031, -21473=>6032, -26355=>6033, -27757=>6034, -28618=>6035, -29450=>6036, -30591=>6037, -31330=>6038, -33454=>6039, -34269=>6040, -34306=>6041, -35028=>6042, -35427=>6043, -35709=>6044, -35947=>6045, -37555=>6046, -38675=>6047, -38928=>6048, -20116=>6049, -20237=>6050, -20425=>6051, -20658=>6052, -21320=>6053, -21566=>6054, -21555=>6055, -21978=>6056, -22626=>6057, -22714=>6058, -22887=>6059, -23067=>6060, -23524=>6061, -24735=>6062, -25034=>6063, -25942=>6064, -26111=>6065, -26212=>6066, -26791=>6067, -27738=>6068, -28595=>6069, -28879=>6070, -29100=>6071, -29522=>6072, -31613=>6073, -34568=>6074, -35492=>6075, -39986=>6076, -40711=>6077, -23627=>6078, -27779=>6079, -29508=>6080, -12127=>6081, -29577=>6081, -37434=>6082, -28331=>6083, -29797=>6084, -30239=>6085, -31337=>6086, -32277=>6087, -34314=>6088, -20800=>6089, -22725=>6090, -25793=>6091, -29934=>6092, -29973=>6093, -30320=>6094, -32705=>6095, -37013=>6096, -38605=>6097, -39252=>6098, -28198=>6099, -12129=>6100, -29926=>6100, -31401=>6101, -31402=>6102, -33253=>6103, -34521=>6104, -34680=>6105, -35355=>6106, -23113=>6107, -23436=>6108, -23451=>6109, -26785=>6110, -26880=>6111, -28003=>6112, -29609=>6113, -29715=>6114, -29740=>6115, -30871=>6116, -32233=>6117, -32747=>6118, -33048=>6119, -33109=>6120, -33694=>6121, -35916=>6122, -38446=>6123, -63942=>6123, -38929=>6124, -12104=>6125, -26352=>6125, -24448=>6126, -26106=>6127, -26505=>6128, -27754=>6129, -29579=>6130, -20525=>6131, -23043=>6132, -27498=>6133, -30702=>6134, -22806=>6135, -23916=>6136, -24013=>6137, -29477=>6138, -30031=>6139, -20709=>6140, -20985=>6141, -22575=>6142, -22829=>6143, -22934=>6144, -23002=>6145, -23525=>6146, -23970=>6147, -25303=>6148, -25622=>6149, -25747=>6150, -25854=>6151, -26332=>6152, -27208=>6153, -29183=>6154, -29796=>6155, -31368=>6156, -31407=>6157, -32327=>6158, -32350=>6159, -32768=>6160, -33136=>6161, -34799=>6162, -35201=>6163, -35616=>6164, -36953=>6165, -36992=>6166, -39250=>6167, -24958=>6168, -27442=>6169, -28020=>6170, -32287=>6171, -35109=>6172, -36785=>6173, -20433=>6174, -20653=>6175, -20887=>6176, -21191=>6177, -22471=>6178, -22665=>6179, -23481=>6180, -24248=>6181, -24898=>6182, -27029=>6183, -28044=>6184, -28263=>6185, -28342=>6186, -29076=>6187, -29794=>6188, -12132=>6189, -29992=>6189, -29996=>6190, -32883=>6191, -33592=>6192, -33993=>6193, -36362=>6194, -37780=>6195, -37854=>6196, -20110=>6197, -20305=>6198, -20598=>6199, -20778=>6200, -12060=>6201, -21448=>6201, -21451=>6202, -21491=>6203, -23431=>6204, -23507=>6205, -23588=>6206, -24858=>6207, -24962=>6208, -26100=>6209, -12124=>6210, -29275=>6210, -29591=>6211, -29760=>6212, -30402=>6213, -31056=>6214, -31121=>6215, -31161=>6216, -32006=>6217, -12155=>6218, -32701=>6218, -33419=>6219, -34261=>6220, -34398=>6221, -36802=>6222, -36935=>6223, -37109=>6224, -37354=>6225, -38533=>6226, -12204=>6227, -38632=>6227, -38633=>6228, -21206=>6229, -24423=>6230, -26093=>6231, -26161=>6232, -26671=>6233, -29020=>6234, -31286=>6235, -37057=>6236, -38922=>6237, -20113=>6238, -27218=>6239, -27550=>6240, -28560=>6241, -29065=>6242, -32792=>6243, -33464=>6244, -34131=>6245, -36939=>6246, -38549=>6247, -38642=>6248, -38907=>6249, -34074=>6250, -39729=>6251, -20112=>6252, -29066=>6253, -38596=>6254, -20803=>6255, -21407=>6256, -21729=>6257, -22291=>6258, -22290=>6259, -22435=>6260, -23195=>6261, -23236=>6262, -23491=>6263, -24616=>6264, -24895=>6265, -25588=>6266, -27781=>6267, -27961=>6268, -28274=>6269, -28304=>6270, -29232=>6271, -29503=>6272, -29783=>6273, -33489=>6274, -34945=>6275, -36677=>6276, -36960=>6277, -38498=>6278, -39000=>6279, -40219=>6280, -12105=>6281, -26376=>6281, -36234=>6282, -37470=>6283, -20301=>6284, -20553=>6285, -20702=>6286, -21361=>6287, -22285=>6288, -22996=>6289, -23041=>6290, -23561=>6291, -24944=>6292, -26256=>6293, -28205=>6294, -29234=>6295, -29771=>6296, -32239=>6297, -32963=>6298, -33806=>6299, -33894=>6300, -34111=>6301, -34655=>6302, -34907=>6303, -35096=>6304, -35586=>6305, -36949=>6306, -12209=>6307, -38859=>6307, -39759=>6308, -20083=>6309, -20369=>6310, -20754=>6311, -20842=>6312, -21807=>6313, -21929=>6314, -23418=>6315, -23461=>6316, -24188=>6317, -24189=>6318, -24254=>6319, -24736=>6320, -24799=>6321, -24840=>6322, -24841=>6323, -25540=>6324, -25912=>6325, -26377=>6326, -26580=>6327, -26586=>6328, -26977=>6329, -26978=>6330, -27833=>6331, -27943=>6332, -28216=>6333, -28641=>6334, -29494=>6335, -29495=>6336, -29788=>6337, -30001=>6338, -30290=>6339, -32173=>6340, -33278=>6341, -33848=>6342, -35029=>6343, -35480=>6344, -35547=>6345, -35565=>6346, -36400=>6347, -36418=>6348, -36938=>6349, -36926=>6350, -36986=>6351, -12195=>6352, -37193=>6352, -37321=>6353, -37742=>6354, -22537=>6355, -27603=>6356, -12161=>6357, -32905=>6357, -32946=>6358, -20801=>6359, -22891=>6360, -23609=>6361, -28516=>6362, -29607=>6363, -32996=>6364, -36103=>6365, -37399=>6366, -38287=>6367, -12160=>6368, -32895=>6368, -25102=>6369, -28700=>6370, -32104=>6371, -34701=>6372, -22432=>6373, -24681=>6374, -24903=>6375, -27575=>6376, -35518=>6377, -37504=>6378, -38577=>6379, -12036=>6380, -20057=>6380, -21535=>6381, -28139=>6382, -34093=>6383, -38512=>6384, -12211=>6385, -38899=>6385, -39150=>6386, -25558=>6387, -27875=>6388, -12194=>6389, -37009=>6389, -20957=>6390, -25033=>6391, -33210=>6392, -40441=>6393, -20381=>6394, -20506=>6395, -20736=>6396, -23452=>6397, -24847=>6398, -25087=>6399, -25836=>6400, -26885=>6401, -27589=>6402, -30097=>6403, -30691=>6404, -32681=>6405, -33380=>6406, -34191=>6407, -34811=>6408, -12176=>6409, -34915=>6409, -35516=>6410, -35696=>6411, -37291=>6412, -12038=>6413, -20108=>6413, -20197=>6414, -20234=>6415, -22839=>6416, -23016=>6417, -24050=>6418, -24347=>6419, -24411=>6420, -24609=>6421, -29246=>6422, -29669=>6423, -30064=>6424, -63842=>6424, -30157=>6425, -31227=>6426, -12157=>6427, -32780=>6427, -12159=>6428, -32819=>6428, -32900=>6429, -33505=>6430, -33617=>6431, -36029=>6432, -36019=>6433, -36999=>6434, -39156=>6435, -39180=>6436, -28727=>6437, -30410=>6438, -32714=>6439, -32716=>6440, -32764=>6441, -35610=>6442, -12040=>6443, -20154=>6443, -20161=>6444, -20995=>6445, -21360=>6446, -21693=>6447, -63902=>6447, -22240=>6448, -23035=>6449, -23493=>6450, -24341=>6451, -24525=>6452, -28270=>6453, -32106=>6454, -33589=>6455, -34451=>6456, -35469=>6457, -38765=>6458, -38775=>6459, -12032=>6460, -19968=>6460, -20314=>6461, -20350=>6462, -22777=>6463, -12103=>6464, -26085=>6464, -28322=>6465, -36920=>6466, -37808=>6467, -39353=>6468, -20219=>6469, -22764=>6470, -22922=>6471, -23001=>6472, -24641=>6473, -31252=>6474, -33615=>6475, -36035=>6476, -12042=>6477, -20837=>6477, -21316=>6478, -20173=>6479, -21097=>6480, -23381=>6481, -33471=>6482, -20180=>6483, -21050=>6484, -63999=>6484, -21672=>6485, -22985=>6486, -23039=>6487, -12070=>6488, -23376=>6488, -23383=>6489, -23388=>6490, -24675=>6491, -24904=>6492, -28363=>6493, -28825=>6494, -63995=>6494, -29038=>6495, -29574=>6496, -29943=>6497, -30133=>6498, -30913=>6499, -32043=>6500, -32773=>6501, -12163=>6502, -33258=>6502, -33576=>6503, -34071=>6504, -34249=>6505, -35566=>6506, -36039=>6507, -38604=>6508, -20316=>6509, -21242=>6510, -22204=>6511, -26027=>6512, -26152=>6513, -28796=>6514, -28856=>6515, -29237=>6516, -32189=>6517, -33421=>6518, -37196=>6519, -38592=>6520, -40306=>6521, -23409=>6522, -26855=>6523, -27544=>6524, -28538=>6525, -30430=>6526, -23697=>6527, -26283=>6528, -28507=>6529, -31668=>6530, -31786=>6531, -34870=>6532, -38620=>6533, -19976=>6534, -20183=>6535, -21280=>6536, -22580=>6537, -22715=>6538, -22767=>6539, -22892=>6540, -23559=>6541, -24115=>6542, -24196=>6543, -24373=>6544, -25484=>6545, -26290=>6546, -26454=>6547, -27167=>6548, -27299=>6549, -27404=>6550, -28479=>6551, -29254=>6552, -29520=>6553, -29835=>6554, -31456=>6555, -31911=>6556, -33144=>6557, -33247=>6558, -33255=>6559, -33674=>6560, -33900=>6561, -34083=>6562, -34196=>6563, -34255=>6564, -35037=>6565, -36115=>6566, -37292=>6567, -12199=>6568, -38263=>6568, -38556=>6569, -20877=>6570, -21705=>6571, -22312=>6572, -23472=>6573, -25165=>6574, -26448=>6575, -26685=>6576, -26771=>6577, -28221=>6578, -28371=>6579, -28797=>6580, -32289=>6581, -35009=>6582, -36001=>6583, -36617=>6584, -40779=>6585, -40782=>6586, -29229=>6587, -31631=>6588, -35533=>6589, -37658=>6590, -20295=>6591, -20302=>6592, -20786=>6593, -21632=>6594, -22992=>6595, -24213=>6596, -25269=>6597, -26485=>6598, -26990=>6599, -27159=>6600, -27822=>6601, -28186=>6602, -29401=>6603, -29482=>6604, -30141=>6605, -31672=>6606, -32053=>6607, -33511=>6608, -33785=>6609, -33879=>6610, -34295=>6611, -35419=>6612, -36015=>6613, -36487=>6614, -36889=>6615, -37048=>6616, -38606=>6617, -40799=>6618, -21219=>6619, -21514=>6620, -23265=>6621, -23490=>6622, -25688=>6623, -25973=>6624, -28404=>6625, -29380=>6626, -30340=>6627, -31309=>6628, -31515=>6629, -31821=>6630, -32318=>6631, -32735=>6632, -33659=>6633, -35627=>6634, -36042=>6635, -12186=>6636, -36196=>6636, -36321=>6637, -36447=>6638, -36842=>6639, -36857=>6640, -36969=>6641, -37841=>6642, -20291=>6643, -20346=>6644, -20659=>6645, -20840=>6646, -20856=>6647, -21069=>6648, -21098=>6649, -22625=>6650, -22652=>6651, -22880=>6652, -23560=>6653, -23637=>6654, -24283=>6655, -24731=>6656, -25136=>6657, -26643=>6658, -27583=>6659, -27656=>6660, -28593=>6661, -29006=>6662, -29728=>6663, -12133=>6664, -30000=>6664, -30008=>6665, -30033=>6666, -30322=>6667, -31564=>6668, -31627=>6669, -31661=>6670, -31686=>6671, -32399=>6672, -35438=>6673, -36670=>6674, -36681=>6675, -37439=>6676, -37523=>6677, -37666=>6678, -37931=>6679, -38651=>6680, -39002=>6681, -39019=>6682, -39198=>6683, -20999=>6684, -64000=>6684, -25130=>6685, -25240=>6686, -27993=>6687, -30308=>6688, -31434=>6689, -31680=>6690, -32118=>6691, -21344=>6692, -23742=>6693, -24215=>6694, -28472=>6695, -28857=>6696, -31896=>6697, -38673=>6698, -39822=>6699, -40670=>6700, -25509=>6701, -25722=>6702, -34678=>6703, -19969=>6704, -20117=>6705, -20141=>6706, -20572=>6707, -20597=>6708, -21576=>6709, -22979=>6710, -23450=>6711, -24128=>6712, -24237=>6713, -24311=>6714, -24449=>6715, -24773=>6716, -25402=>6717, -25919=>6718, -25972=>6719, -26060=>6720, -26230=>6721, -26232=>6722, -26622=>6723, -26984=>6724, -27273=>6725, -27491=>6726, -27712=>6727, -28096=>6728, -28136=>6729, -28191=>6730, -28254=>6731, -28702=>6732, -28833=>6733, -29582=>6734, -29693=>6735, -30010=>6736, -30555=>6737, -30855=>6738, -31118=>6739, -31243=>6740, -31357=>6741, -31934=>6742, -32142=>6743, -33351=>6744, -35330=>6745, -35562=>6746, -35998=>6747, -37165=>6748, -37194=>6749, -37336=>6750, -37478=>6751, -37580=>6752, -37664=>6753, -38662=>6754, -38742=>6755, -38748=>6756, -38914=>6757, -12237=>6758, -40718=>6758, -21046=>6759, -21137=>6760, -21884=>6761, -22564=>6762, -24093=>6763, -24351=>6764, -24716=>6765, -25552=>6766, -26799=>6767, -28639=>6768, -31085=>6769, -31532=>6770, -33229=>6771, -34234=>6772, -35069=>6773, -35576=>6774, -36420=>6775, -37261=>6776, -38500=>6777, -38555=>6778, -38717=>6779, -38988=>6780, -12241=>6781, -40778=>6781, -20430=>6782, -20806=>6783, -20939=>6784, -21161=>6785, -22066=>6786, -24340=>6787, -24427=>6788, -25514=>6789, -25805=>6790, -26089=>6791, -26177=>6792, -26362=>6793, -26361=>6794, -26397=>6795, -26781=>6796, -26839=>6797, -27133=>6798, -28437=>6799, -28526=>6800, -29031=>6801, -29157=>6802, -12118=>6803, -29226=>6803, -29866=>6804, -30522=>6805, -31062=>6806, -31066=>6807, -31199=>6808, -31264=>6809, -31381=>6810, -31895=>6811, -31967=>6812, -32068=>6813, -32368=>6814, -32903=>6815, -34299=>6816, -34468=>6817, -35412=>6818, -35519=>6819, -36249=>6820, -36481=>6821, -36896=>6822, -36973=>6823, -37347=>6824, -38459=>6825, -38613=>6826, -12227=>6827, -40165=>6827, -26063=>6828, -31751=>6829, -12188=>6830, -36275=>6830, -37827=>6831, -23384=>6832, -23562=>6833, -21330=>6834, -25305=>6835, -29469=>6836, -20519=>6837, -23447=>6838, -24478=>6839, -24752=>6840, -24939=>6841, -26837=>6842, -28121=>6843, -29742=>6844, -31278=>6845, -32066=>6846, -32156=>6847, -32305=>6848, -33131=>6849, -36394=>6850, -36405=>6851, -37758=>6852, -37912=>6853, -20304=>6854, -22352=>6855, -24038=>6856, -24231=>6857, -25387=>6858, -32618=>6859, -20027=>6860, -20303=>6861, -20367=>6862, -20570=>6863, -23005=>6864, -32964=>6865, -21610=>6866, -21608=>6867, -22014=>6868, -22863=>6869, -23449=>6870, -24030=>6871, -24282=>6872, -26205=>6873, -26417=>6874, -26609=>6875, -26666=>6876, -27880=>6877, -27954=>6878, -28234=>6879, -28557=>6880, -28855=>6881, -29664=>6882, -30087=>6883, -31820=>6884, -32002=>6885, -32044=>6886, -32162=>6887, -12168=>6888, -33311=>6888, -34523=>6889, -35387=>6890, -35461=>6891, -12187=>6892, -36208=>6892, -36490=>6893, -36659=>6894, -36913=>6895, -37198=>6896, -37202=>6897, -37956=>6898, -39376=>6899, -12149=>6900, -31481=>6900, -31909=>6901, -20426=>6902, -20737=>6903, -20934=>6904, -22472=>6905, -23535=>6906, -23803=>6907, -26201=>6908, -27197=>6909, -27994=>6910, -28310=>6911, -28652=>6912, -28940=>6913, -30063=>6914, -31459=>6915, -34850=>6916, -36897=>6917, -36981=>6918, -38603=>6919, -39423=>6920, -33537=>6921, -20013=>6922, -20210=>6923, -34886=>6924, -37325=>6925, -21373=>6926, -27355=>6927, -26987=>6928, -27713=>6929, -33914=>6930, -22686=>6931, -24974=>6932, -26366=>6933, -25327=>6934, -28893=>6935, -29969=>6936, -30151=>6937, -32338=>6938, -33976=>6939, -35657=>6940, -36104=>6941, -20043=>6942, -21482=>6943, -21675=>6944, -22320=>6945, -22336=>6946, -24535=>6947, -25345=>6948, -25351=>6949, -25711=>6950, -12096=>6951, -25903=>6951, -26088=>6952, -26234=>6953, -26525=>6954, -26547=>6955, -12108=>6956, -27490=>6956, -27744=>6957, -27802=>6958, -28460=>6959, -30693=>6960, -30757=>6961, -31049=>6962, -31063=>6963, -32025=>6964, -32930=>6965, -33026=>6966, -12164=>6967, -33267=>6967, -33437=>6968, -33463=>6969, -34584=>6970, -35468=>6971, -36100=>6972, -36286=>6973, -36978=>6974, -30452=>6975, -31257=>6976, -31287=>6977, -32340=>6978, -32887=>6979, -21767=>6980, -21972=>6981, -22645=>6982, -25391=>6983, -25634=>6984, -26185=>6985, -26187=>6986, -26733=>6987, -27035=>6988, -27524=>6989, -27941=>6990, -28337=>6991, -29645=>6992, -29800=>6993, -29857=>6994, -30043=>6995, -30137=>6996, -30433=>6997, -30494=>6998, -30603=>6999, -31206=>7000, -32265=>7001, -32285=>7002, -33275=>7003, -34095=>7004, -34967=>7005, -35386=>7006, -36049=>7007, -36587=>7008, -12192=>7009, -36784=>7009, -63857=>7009, -36914=>7010, -37805=>7011, -38499=>7012, -38515=>7013, -38663=>7014, -20356=>7015, -21489=>7016, -23018=>7017, -23241=>7018, -24089=>7019, -26702=>7020, -29894=>7021, -30142=>7022, -31209=>7023, -31378=>7024, -33187=>7025, -34541=>7026, -36074=>7027, -36300=>7028, -36845=>7029, -26015=>7030, -26389=>7031, -22519=>7032, -28503=>7033, -32221=>7034, -36655=>7035, -37878=>7036, -38598=>7037, -24501=>7038, -25074=>7039, -28548=>7040, -19988=>7041, -20376=>7042, -20511=>7043, -21449=>7044, -21983=>7045, -23919=>7046, -24046=>7047, -27425=>7048, -27492=>7049, -30923=>7050, -31642=>7051, -36425=>7052, -12190=>7053, -36554=>7053, -63746=>7053, -36974=>7054, -25417=>7055, -25662=>7056, -30528=>7057, -31364=>7058, -37679=>7059, -38015=>7060, -40810=>7061, -25776=>7062, -28591=>7063, -29158=>7064, -29864=>7065, -29914=>7066, -31428=>7067, -31762=>7068, -32386=>7069, -31922=>7070, -32408=>7071, -35738=>7072, -36106=>7073, -38013=>7074, -39184=>7075, -39244=>7076, -21049=>7077, -23519=>7078, -25830=>7079, -26413=>7080, -32046=>7081, -20717=>7082, -21443=>7083, -63851=>7083, -22649=>7084, -24920=>7085, -24921=>7086, -25082=>7087, -26028=>7088, -31449=>7089, -35730=>7090, -35734=>7091, -20489=>7092, -20513=>7093, -21109=>7094, -21809=>7095, -23100=>7096, -24288=>7097, -24432=>7098, -24884=>7099, -25950=>7100, -26124=>7101, -26166=>7102, -26274=>7103, -27085=>7104, -28356=>7105, -28466=>7106, -29462=>7107, -30241=>7108, -31379=>7109, -33081=>7110, -33369=>7111, -33750=>7112, -33980=>7113, -20661=>7114, -22512=>7115, -23488=>7116, -23528=>7117, -24425=>7118, -25505=>7119, -30758=>7120, -32181=>7121, -33756=>7122, -34081=>7123, -37319=>7124, -37365=>7125, -20874=>7126, -26613=>7127, -31574=>7128, -36012=>7129, -20932=>7130, -22971=>7131, -24765=>7132, -34389=>7133, -20508=>7134, -21076=>7135, -23610=>7136, -24957=>7137, -25114=>7138, -25299=>7139, -64002=>7139, -25842=>7140, -26021=>7141, -28364=>7142, -30240=>7143, -33034=>7144, -36448=>7145, -38495=>7146, -38587=>7147, -20191=>7148, -21315=>7149, -21912=>7150, -22825=>7151, -24029=>7152, -25797=>7153, -27849=>7154, -28154=>7155, -29588=>7156, -31359=>7157, -12167=>7158, -33307=>7158, -34214=>7159, -36068=>7160, -36368=>7161, -36983=>7162, -37351=>7163, -38369=>7164, -38433=>7165, -38854=>7166, -20984=>7167, -21746=>7168, -21894=>7169, -24505=>7170, -25764=>7171, -28552=>7172, -32180=>7173, -36639=>7174, -36685=>7175, -37941=>7176, -20681=>7177, -23574=>7178, -27838=>7179, -28155=>7180, -29979=>7181, -30651=>7182, -31805=>7183, -31844=>7184, -35449=>7185, -35522=>7186, -22558=>7187, -22974=>7188, -24086=>7189, -25463=>7190, -29266=>7191, -30090=>7192, -30571=>7193, -35548=>7194, -36028=>7195, -36626=>7196, -24307=>7197, -26228=>7198, -28152=>7199, -32893=>7200, -33729=>7201, -35531=>7202, -12205=>7203, -38737=>7203, -39894=>7204, -21059=>7205, -26367=>7206, -28053=>7207, -28399=>7208, -32224=>7209, -35558=>7210, -36910=>7211, -36958=>7212, -39636=>7213, -21021=>7214, -21119=>7215, -21736=>7216, -24980=>7217, -25220=>7218, -25307=>7219, -26786=>7220, -26898=>7221, -26970=>7222, -27189=>7223, -28818=>7224, -28966=>7225, -30813=>7226, -30977=>7227, -30990=>7228, -31186=>7229, -31245=>7230, -32918=>7231, -12171=>7232, -33400=>7232, -33493=>7233, -33609=>7234, -34121=>7235, -35970=>7236, -36229=>7237, -37218=>7238, -37259=>7239, -37294=>7240, -20419=>7241, -22225=>7242, -29165=>7243, -30679=>7244, -34560=>7245, -35320=>7246, -12072=>7247, -23544=>7247, -24534=>7248, -26449=>7249, -37032=>7250, -21474=>7251, -22618=>7252, -23541=>7253, -24740=>7254, -24961=>7255, -25696=>7256, -32317=>7257, -32880=>7258, -34085=>7259, -37507=>7260, -25774=>7261, -20652=>7262, -23828=>7263, -26368=>7264, -22684=>7265, -25277=>7266, -25512=>7267, -26894=>7268, -27000=>7269, -27166=>7270, -28267=>7271, -30394=>7272, -31179=>7273, -33467=>7274, -33833=>7275, -35535=>7276, -36264=>7277, -36861=>7278, -37138=>7279, -37195=>7280, -37276=>7281, -37648=>7282, -37656=>7283, -37786=>7284, -38619=>7285, -39478=>7286, -39949=>7287, -19985=>7288, -30044=>7289, -31069=>7290, -31482=>7291, -31569=>7292, -31689=>7293, -32302=>7294, -33988=>7295, -36441=>7296, -36468=>7297, -36600=>7298, -36880=>7299, -26149=>7300, -26943=>7301, -29763=>7302, -20986=>7303, -26414=>7304, -40668=>7305, -20805=>7306, -24544=>7307, -27798=>7308, -34802=>7309, -34909=>7310, -34935=>7311, -24756=>7312, -33205=>7313, -33795=>7314, -36101=>7315, -21462=>7316, -21561=>7317, -22068=>7318, -23094=>7319, -23601=>7320, -28810=>7321, -32736=>7322, -32858=>7323, -33030=>7324, -33261=>7325, -36259=>7326, -37257=>7327, -39519=>7328, -40434=>7329, -20596=>7330, -20164=>7331, -21408=>7332, -24827=>7333, -28204=>7334, -23652=>7335, -20360=>7336, -20516=>7337, -21988=>7338, -23769=>7339, -24159=>7340, -24677=>7341, -26772=>7342, -27835=>7343, -28100=>7344, -29118=>7345, -30164=>7346, -30196=>7347, -30305=>7348, -31258=>7349, -31305=>7350, -32199=>7351, -32251=>7352, -32622=>7353, -33268=>7354, -34473=>7355, -36636=>7356, -38601=>7357, -39347=>7358, -12242=>7359, -40786=>7359, -21063=>7360, -21189=>7361, -39149=>7362, -35242=>7363, -19971=>7364, -26578=>7365, -28422=>7366, -20405=>7367, -23522=>7368, -26517=>7369, -27784=>7370, -63858=>7370, -28024=>7371, -29723=>7372, -30759=>7373, -37341=>7374, -37756=>7375, -34756=>7376, -31204=>7377, -31281=>7378, -24555=>7379, -20182=>7380, -21668=>7381, -21822=>7382, -22702=>7383, -22949=>7384, -24816=>7385, -25171=>7386, -25302=>7387, -26422=>7388, -26965=>7389, -33333=>7390, -38464=>7391, -39345=>7392, -39389=>7393, -20524=>7394, -21331=>7395, -21828=>7396, -22396=>7397, -25176=>7398, -25826=>7399, -26219=>7400, -26589=>7401, -28609=>7402, -28655=>7403, -29730=>7404, -29752=>7405, -35351=>7406, -37944=>7407, -21585=>7408, -22022=>7409, -22374=>7410, -24392=>7411, -24986=>7412, -27470=>7413, -28760=>7414, -28845=>7415, -32187=>7416, -35477=>7417, -22890=>7418, -33067=>7419, -25506=>7420, -30472=>7421, -32829=>7422, -36010=>7423, -22612=>7424, -25645=>7425, -27067=>7426, -23445=>7427, -24081=>7428, -28271=>7429, -34153=>7430, -20812=>7431, -21488=>7432, -22826=>7433, -24608=>7434, -24907=>7435, -27526=>7436, -27760=>7437, -27888=>7438, -31518=>7439, -32974=>7440, -33492=>7441, -36294=>7442, -37040=>7443, -39089=>7444, -25799=>7445, -28580=>7446, -25745=>7447, -25860=>7448, -20814=>7449, -21520=>7450, -12063=>7451, -22303=>7451, -35342=>7452, -24927=>7453, -26742=>7454, -30171=>7455, -31570=>7456, -32113=>7457, -36890=>7458, -22534=>7459, -27084=>7460, -33151=>7461, -35114=>7462, -36864=>7463, -38969=>7464, -20600=>7465, -22871=>7466, -22956=>7467, -25237=>7468, -36879=>7469, -39722=>7470, -24925=>7471, -29305=>7472, -38358=>7473, -22369=>7474, -23110=>7475, -24052=>7476, -25226=>7477, -25773=>7478, -25850=>7479, -26487=>7480, -27874=>7481, -27966=>7482, -29228=>7483, -29750=>7484, -30772=>7485, -32631=>7486, -33453=>7487, -36315=>7488, -38935=>7489, -21028=>7490, -22338=>7491, -26495=>7492, -29256=>7493, -29923=>7494, -36009=>7495, -36774=>7496, -37393=>7497, -38442=>7498, -12043=>7499, -20843=>7499, -21485=>7500, -25420=>7501, -20329=>7502, -21764=>7503, -24726=>7504, -25943=>7505, -27803=>7506, -28031=>7507, -29260=>7508, -29437=>7509, -31255=>7510, -35207=>7511, -12185=>7512, -35997=>7512, -24429=>7513, -28558=>7514, -28921=>7515, -33192=>7516, -24846=>7517, -20415=>7518, -63845=>7518, -20559=>7519, -25153=>7520, -12122=>7521, -29255=>7521, -31687=>7522, -32232=>7523, -32745=>7524, -36941=>7525, -38829=>7526, -39449=>7527, -36022=>7528, -22378=>7529, -24179=>7530, -26544=>7531, -33805=>7532, -35413=>7533, -21536=>7534, -23318=>7535, -24163=>7536, -24290=>7537, -24330=>7538, -25987=>7539, -32954=>7540, -34109=>7541, -38281=>7542, -38491=>7543, -20296=>7544, -21253=>7545, -21261=>7546, -21263=>7547, -21638=>7548, -21754=>7549, -22275=>7550, -24067=>7551, -24598=>7552, -25243=>7553, -25265=>7554, -25429=>7555, -27873=>7556, -28006=>7557, -30129=>7558, -30770=>7559, -32990=>7560, -33071=>7561, -33502=>7562, -33889=>7563, -33970=>7564, -34957=>7565, -35090=>7566, -36875=>7567, -37610=>7568, -39165=>7569, -39825=>7570, -24133=>7571, -26292=>7572, -64006=>7572, -26333=>7573, -28689=>7574, -29190=>7575, -20469=>7576, -21117=>7577, -24426=>7578, -24915=>7579, -26451=>7580, -27161=>7581, -28418=>7582, -29922=>7583, -31080=>7584, -34920=>7585, -35961=>7586, -39111=>7587, -39108=>7588, -39491=>7589, -21697=>7590, -31263=>7591, -26963=>7592, -35575=>7593, -35914=>7594, -12213=>7595, -39080=>7595, -39342=>7596, -24444=>7597, -25259=>7598, -30130=>7599, -12138=>7600, -30382=>7600, -34987=>7601, -36991=>7602, -38466=>7603, -21305=>7604, -24380=>7605, -24517=>7606, -27852=>7607, -63848=>7607, -29644=>7608, -30050=>7609, -12134=>7610, -30091=>7610, -31558=>7611, -33534=>7612, -39325=>7613, -20047=>7614, -36924=>7615, -19979=>7616, -20309=>7617, -21414=>7618, -22799=>7619, -24264=>7620, -26160=>7621, -27827=>7622, -29781=>7623, -33655=>7624, -34662=>7625, -36032=>7626, -36944=>7627, -38686=>7628, -39957=>7629, -22737=>7630, -23416=>7631, -34384=>7632, -35604=>7633, -40372=>7634, -23506=>7635, -24680=>7636, -24717=>7637, -26097=>7638, -27735=>7639, -28450=>7640, -28579=>7641, -28698=>7642, -32597=>7643, -32752=>7644, -38289=>7645, -38290=>7646, -38480=>7647, -38867=>7648, -21106=>7649, -36676=>7650, -20989=>7651, -21547=>7652, -21688=>7653, -21859=>7654, -21898=>7655, -27323=>7656, -28085=>7657, -32216=>7658, -33382=>7659, -37532=>7660, -38519=>7661, -40569=>7662, -21512=>7663, -21704=>7664, -30418=>7665, -34532=>7666, -38308=>7667, -38356=>7668, -38492=>7669, -20130=>7670, -20233=>7671, -23022=>7672, -23270=>7673, -24055=>7674, -24658=>7675, -25239=>7676, -26477=>7677, -26689=>7678, -27782=>7679, -28207=>7680, -32568=>7681, -32923=>7682, -33322=>7683, -38917=>7684, -20133=>7685, -20565=>7686, -21683=>7687, -22419=>7688, -22874=>7689, -23401=>7690, -23475=>7691, -25032=>7692, -26999=>7693, -28023=>7694, -28707=>7695, -34809=>7696, -35299=>7697, -35442=>7698, -35559=>7699, -36994=>7700, -39405=>7701, -39608=>7702, -21182=>7703, -26680=>7704, -20502=>7705, -24184=>7706, -26447=>7707, -33607=>7708, -12175=>7709, -34892=>7709, -64008=>7709, -20139=>7710, -21521=>7711, -22190=>7712, -29670=>7713, -37141=>7714, -38911=>7715, -39177=>7716, -39255=>7717, -12217=>7718, -39321=>7718, -22099=>7719, -22687=>7720, -34395=>7721, -35377=>7722, -25010=>7723, -27382=>7724, -29563=>7725, -36562=>7726, -27463=>7727, -38570=>7728, -39511=>7729, -22869=>7730, -29184=>7731, -36203=>7732, -12208=>7733, -38761=>7733, -20436=>7734, -23796=>7735, -24358=>7736, -25080=>7737, -26203=>7738, -27883=>7739, -28843=>7740, -12126=>7741, -29572=>7741, -29625=>7742, -29694=>7743, -30505=>7744, -30541=>7745, -32067=>7746, -32098=>7747, -32291=>7748, -33335=>7749, -34898=>7750, -36066=>7751, -37449=>7752, -39023=>7753, -23377=>7754, -12147=>7755, -31348=>7755, -12174=>7756, -34880=>7756, -12212=>7757, -38913=>7757, -23244=>7758, -20448=>7759, -21332=>7760, -22846=>7761, -23805=>7762, -25406=>7763, -28025=>7764, -29433=>7765, -33029=>7766, -33031=>7767, -33698=>7768, -37583=>7769, -38960=>7770, -20136=>7771, -20804=>7772, -21009=>7773, -22411=>7774, -24418=>7775, -27842=>7776, -28366=>7777, -28677=>7778, -28752=>7779, -28847=>7780, -29074=>7781, -29673=>7782, -29801=>7783, -63918=>7783, -33610=>7784, -34722=>7785, -34913=>7786, -36872=>7787, -37026=>7788, -37795=>7789, -39336=>7790, -20846=>7791, -24407=>7792, -24800=>7793, -24935=>7794, -26291=>7795, -34137=>7796, -36426=>7797, -37295=>7798, -38795=>7799, -20046=>7800, -20114=>7801, -21628=>7802, -22741=>7803, -22778=>7804, -22909=>7805, -23733=>7806, -24359=>7807, -12094=>7808, -25142=>7808, -25160=>7809, -26122=>7810, -26215=>7811, -27627=>7812, -28009=>7813, -28111=>7814, -28246=>7815, -28408=>7816, -28564=>7817, -28640=>7818, -28649=>7819, -28765=>7820, -29392=>7821, -29733=>7822, -29786=>7823, -29920=>7824, -30355=>7825, -31068=>7826, -31946=>7827, -32286=>7828, -32993=>7829, -33446=>7830, -33899=>7831, -33983=>7832, -34382=>7833, -34399=>7834, -34676=>7835, -35703=>7836, -35946=>7837, -37804=>7838, -38912=>7839, -39013=>7840, -24785=>7841, -25110=>7842, -37239=>7843, -23130=>7844, -26127=>7845, -28151=>7846, -28222=>7847, -29759=>7848, -39746=>7849, -24573=>7850, -24794=>7851, -31503=>7852, -21700=>7853, -24344=>7854, -27742=>7855, -27859=>7856, -27946=>7857, -28888=>7858, -32005=>7859, -34425=>7860, -35340=>7861, -40251=>7862, -21270=>7863, -21644=>7864, -23301=>7865, -27194=>7866, -12117=>7867, -28779=>7867, -30069=>7868, -31117=>7869, -12146=>7870, -31166=>7870, -33457=>7871, -33775=>7872, -35441=>7873, -35649=>7874, -36008=>7875, -38772=>7876, -25844=>7877, -25899=>7878, -30906=>7879, -30907=>7880, -31339=>7881, -20024=>7882, -21914=>7883, -22864=>7884, -23462=>7885, -24187=>7886, -24739=>7887, -25563=>7888, -27489=>7889, -26213=>7890, -26707=>7891, -28185=>7892, -29029=>7893, -29872=>7894, -32008=>7895, -36996=>7896, -39529=>7897, -39973=>7898, -27963=>7899, -28369=>7900, -63748=>7900, -29502=>7901, -35905=>7902, -38346=>7903, -20976=>7904, -24140=>7905, -24488=>7906, -24653=>7907, -24822=>7908, -24880=>7909, -24908=>7910, -26179=>7911, -26180=>7912, -27045=>7913, -27841=>7914, -28255=>7915, -28361=>7916, -28514=>7917, -29004=>7918, -29852=>7919, -30343=>7920, -31681=>7921, -31783=>7922, -33618=>7923, -34647=>7924, -36945=>7925, -38541=>7926, -12232=>7927, -40643=>7927, -21295=>7928, -22238=>7929, -24315=>7930, -24458=>7931, -24674=>7932, -24724=>7933, -25079=>7934, -26214=>7935, -26371=>7936, -27292=>7937, -28142=>7938, -28590=>7939, -28784=>7940, -29546=>7941, -32362=>7942, -33214=>7943, -33588=>7944, -34516=>7945, -35496=>7946, -36036=>7947, -21123=>7948, -29554=>7949, -23446=>7950, -27243=>7951, -37892=>7952, -21742=>7953, -22150=>7954, -23389=>7955, -25928=>7956, -25989=>7957, -26313=>7958, -26783=>7959, -28045=>7960, -28102=>7961, -12120=>7962, -29243=>7962, -32948=>7963, -37237=>7964, -39501=>7965, -20399=>7966, -20505=>7967, -21402=>7968, -21518=>7969, -21564=>7970, -21897=>7971, -21957=>7972, -24127=>7973, -24460=>7974, -26429=>7975, -29030=>7976, -29661=>7977, -36869=>7978, -21211=>7979, -21235=>7980, -22628=>7981, -22734=>7982, -28932=>7983, -29071=>7984, -29179=>7985, -34224=>7986, -35347=>7987, -26248=>7988, -63941=>7988, -34216=>7989, -21927=>7990, -26244=>7991, -29002=>7992, -33841=>7993, -21321=>7994, -21913=>7995, -27585=>7996, -24409=>7997, -24509=>7998, -25582=>7999, -26249=>8000, -28999=>8001, -35569=>8002, -36637=>8003, -40638=>8004, -20241=>8005, -25658=>8006, -28875=>8007, -30054=>8008, -34407=>8009, -24676=>8010, -35662=>8011, -40440=>8012, -20807=>8013, -20982=>8014, -21256=>8015, -27958=>8016, -33016=>8017, -12234=>8018, -40657=>8018, -26133=>8019, -27427=>8020, -28824=>8021, -30165=>8022, -21507=>8023, -23673=>8024, -32007=>8025, -35350=>8026, -12107=>8027, -27424=>8027, -27453=>8028, -27462=>8029, -21560=>8030, -24688=>8031, -27965=>8032, -32725=>8033, -33288=>8034, -20694=>8035, -20958=>8036, -21916=>8037, -22123=>8038, -22221=>8039, -23020=>8040, -23305=>8041, -24076=>8042, -24985=>8043, -24984=>8044, -25137=>8045, -26206=>8046, -26342=>8047, -29081=>8048, -29113=>8049, -29114=>8050, -29351=>8051, -31143=>8052, -31232=>8053, -32690=>8054, -35440=>8055, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -12310=>8219, -12311=>8220, -12312=>8221, -12313=>8222, -8223=>8237, -8219=>8238, -8314=>8239, -8315=>8240, -8316=>8248, -8317=>8250, -8318=>8251, -700=>8275, -8942=>8320, -8759=>8321, -10122=>8342, -10123=>8343, -10124=>8344, -10125=>8345, -10126=>8346, -10127=>8347, -10128=>8348, -10129=>8349, -10130=>8350, -10131=>8351, -9398=>8388, -9399=>8389, -9400=>8390, -9401=>8391, -9402=>8392, -9403=>8393, -9404=>8394, -9405=>8395, -9406=>8396, -9407=>8397, -9408=>8398, -9409=>8399, -9410=>8400, -9411=>8401, -9412=>8402, -9413=>8403, -9414=>8404, -9415=>8405, -9416=>8406, -9417=>8407, -9418=>8408, -9419=>8409, -9420=>8410, -9421=>8411, -9422=>8412, -9423=>8413, -8826=>8475, -8827=>8476, -8910=>8477, -8911=>8478, -8832=>8479, -8833=>8480, -8816=>8481, -8817=>8482, -8818=>8483, -8819=>8484, -8842=>8486, -8843=>8488, -8822=>8489, -8823=>8490, -8825=>8491, -8922=>8492, -8923=>8493, -8773=>8499, -8771=>8500, -8776=>8501, -8868=>8503, -8244=>8582, -9839=>8594, -8258=>8599, -10045=>8604, -8226=>8607, -8249=>8612, -8250=>8613, -10010=>8630, -10006=>8631, -9711=>8633, -10070=>8637, -9676=>8639, -9775=>8664, -12320=>8671, -10102=>8673, -10103=>8674, -10104=>8675, -10105=>8676, -10106=>8677, -10107=>8678, -10108=>8679, -10109=>8680, -10110=>8681, -10111=>8682, -12306=>8700, -12342=>8701, -8710=>8715, -8735=>8717, -8741=>8719, -8742=>8720, -8787=>8722, -8785=>8723, -8806=>8724, -8807=>8725, -8723=>8726, -8853=>8727, -8854=>8728, -8855=>8729, -8980=>8731, -8802=>8734, -9649=>8736, -8738=>8738, -8784=>8739, -8867=>8742, -8814=>8745, -8815=>8746, -8837=>8747, -8836=>8748, -8713=>8749, -8716=>8750, -8891=>8751, -8892=>8752, -8794=>8753, -8966=>8754, -12958=>8761, -8252=>8763, -9702=>8775, -9663=>8779, -9653=>8780, -9657=>8781, -9667=>8782, -9674=>8787, -12849=>8788, -12857=>8789, -13259=>8790, -9327=>8791, -9328=>8792, -9329=>8793, -9330=>8794, -9331=>8795, -8656=>8814, -8655=>8815, -8653=>8816, -8657=>8854, -8659=>8855, -8626=>8864, -8625=>8865, -8628=>8867, -8624=>8868, -8627=>8869, -8636=>8884, -8640=>8885, -8644=>8896, -8645=>8897, -9347=>9042, -9348=>9043, -9349=>9044, -9350=>9045, -9351=>9046, -12948=>9080, -12965=>9096, -8672=>9190, -8674=>9191, -8673=>9192, -8675=>9193, -8678=>9198, -8680=>9199, -8679=>9200, -8681=>9201, -9757=>9222, -9759=>9223, -12944=>9300, -12938=>9301, -12939=>9302, -12940=>9303, -12941=>9304, -12942=>9305, -12943=>9306, -12318=>9322, -12319=>9323, -8246=>9324, -8245=>9326, -12540=>9330, -44034=>9333, -44035=>9334, -44037=>9335, -44038=>9336, -44043=>9337, -44044=>9338, -44045=>9339, -44046=>9340, -44047=>9341, -44056=>9342, -44062=>9343, -44063=>9344, -44065=>9345, -44066=>9346, -44067=>9347, -44069=>9348, -44070=>9349, -44071=>9350, -44072=>9351, -44073=>9352, -44074=>9353, -44075=>9354, -44078=>9355, -44082=>9356, -44083=>9357, -44084=>9358, -44085=>9359, -44086=>9360, -44087=>9361, -44090=>9362, -44091=>9363, -44093=>9364, -44094=>9365, -44095=>9366, -44097=>9367, -44098=>9368, -44099=>9369, -44100=>9370, -44101=>9371, -44102=>9372, -44103=>9373, -44104=>9374, -44105=>9375, -44106=>9376, -44108=>9377, -44110=>9378, -44111=>9379, -44112=>9380, -44113=>9381, -44114=>9382, -44115=>9383, -44117=>9384, -44118=>9385, -44119=>9386, -44121=>9387, -44122=>9388, -44123=>9389, -44125=>9390, -44126=>9391, -44127=>9392, -44128=>9393, -44129=>9394, -44130=>9395, -44131=>9396, -44132=>9397, -44133=>9398, -44134=>9399, -44135=>9400, -44136=>9401, -44137=>9402, -44138=>9403, -44139=>9404, -44140=>9405, -44141=>9406, -44142=>9407, -44143=>9408, -44146=>9409, -44147=>9410, -44149=>9411, -44150=>9412, -44153=>9413, -44155=>9414, -44156=>9415, -44157=>9416, -44158=>9417, -44159=>9418, -44162=>9419, -44167=>9420, -44168=>9421, -44173=>9422, -44174=>9423, -44175=>9424, -44177=>9425, -44178=>9426, -44179=>9427, -44181=>9428, -44182=>9429, -44183=>9430, -44184=>9431, -44185=>9432, -44186=>9433, -44187=>9434, -44190=>9435, -44194=>9436, -44195=>9437, -44196=>9438, -44197=>9439, -44198=>9440, -44199=>9441, -44203=>9442, -44205=>9443, -44206=>9444, -44209=>9445, -44210=>9446, -44211=>9447, -44212=>9448, -44213=>9449, -44214=>9450, -44215=>9451, -44218=>9452, -44222=>9453, -44223=>9454, -44224=>9455, -44226=>9456, -44227=>9457, -44229=>9458, -44230=>9459, -44231=>9460, -44233=>9461, -44234=>9462, -44235=>9463, -44237=>9464, -44238=>9465, -44239=>9466, -44240=>9467, -44241=>9468, -44242=>9469, -44243=>9470, -44244=>9471, -44246=>9472, -44248=>9473, -44249=>9474, -44250=>9475, -44251=>9476, -44252=>9477, -44253=>9478, -44254=>9479, -44255=>9480, -44258=>9481, -44259=>9482, -44261=>9483, -44262=>9484, -44265=>9485, -44267=>9486, -44269=>9487, -44270=>9488, -44274=>9489, -44276=>9490, -44279=>9491, -44280=>9492, -44281=>9493, -44282=>9494, -44283=>9495, -44286=>9496, -44287=>9497, -44289=>9498, -44290=>9499, -44291=>9500, -44293=>9501, -44295=>9502, -44296=>9503, -44297=>9504, -44298=>9505, -44299=>9506, -44302=>9507, -44304=>9508, -44306=>9509, -44307=>9510, -44308=>9511, -44309=>9512, -44310=>9513, -44311=>9514, -44313=>9515, -44314=>9516, -44315=>9517, -44317=>9518, -44318=>9519, -44319=>9520, -44321=>9521, -44322=>9522, -44323=>9523, -44324=>9524, -44325=>9525, -44326=>9526, -44327=>9527, -44328=>9528, -44330=>9529, -44331=>9530, -44334=>9531, -44335=>9532, -44336=>9533, -44337=>9534, -44338=>9535, -44339=>9536, -44342=>9537, -44343=>9538, -44345=>9539, -44346=>9540, -44347=>9541, -44349=>9542, -44350=>9543, -44351=>9544, -44352=>9545, -44353=>9546, -44354=>9547, -44355=>9548, -44358=>9549, -44360=>9550, -44362=>9551, -44363=>9552, -44364=>9553, -44365=>9554, -44366=>9555, -44367=>9556, -44369=>9557, -44370=>9558, -44371=>9559, -44373=>9560, -44374=>9561, -44375=>9562, -44377=>9563, -44378=>9564, -44379=>9565, -44380=>9566, -44381=>9567, -44382=>9568, -44383=>9569, -44384=>9570, -44386=>9571, -44388=>9572, -44389=>9573, -44390=>9574, -44391=>9575, -44392=>9576, -44393=>9577, -44394=>9578, -44395=>9579, -44398=>9580, -44399=>9581, -44401=>9582, -44402=>9583, -44407=>9584, -44408=>9585, -44409=>9586, -44410=>9587, -44414=>9588, -44416=>9589, -44419=>9590, -44420=>9591, -44421=>9592, -44422=>9593, -44423=>9594, -44426=>9595, -44427=>9596, -44429=>9597, -44430=>9598, -44431=>9599, -44433=>9600, -44434=>9601, -44435=>9602, -44436=>9603, -44437=>9604, -44438=>9605, -44439=>9606, -44440=>9607, -44441=>9608, -44442=>9609, -44443=>9610, -44446=>9611, -44447=>9612, -44448=>9613, -44449=>9614, -44450=>9615, -44451=>9616, -44453=>9617, -44454=>9618, -44455=>9619, -44456=>9620, -44457=>9621, -44458=>9622, -44459=>9623, -44460=>9624, -44461=>9625, -44462=>9626, -44463=>9627, -44464=>9628, -44465=>9629, -44466=>9630, -44467=>9631, -44468=>9632, -44469=>9633, -44470=>9634, -44472=>9635, -44473=>9636, -44474=>9637, -44475=>9638, -44476=>9639, -44477=>9640, -44478=>9641, -44479=>9642, -44482=>9643, -44483=>9644, -44485=>9645, -44486=>9646, -44487=>9647, -44489=>9648, -44490=>9649, -44491=>9650, -44492=>9651, -44493=>9652, -44494=>9653, -44495=>9654, -44498=>9655, -44500=>9656, -44501=>9657, -44502=>9658, -44503=>9659, -44504=>9660, -44505=>9661, -44506=>9662, -44507=>9663, -44509=>9664, -44510=>9665, -44511=>9666, -44513=>9667, -44514=>9668, -44515=>9669, -44517=>9670, -44518=>9671, -44519=>9672, -44520=>9673, -44521=>9674, -44522=>9675, -44523=>9676, -44524=>9677, -44525=>9678, -44526=>9679, -44527=>9680, -44528=>9681, -44529=>9682, -44530=>9683, -44531=>9684, -44532=>9685, -44533=>9686, -44534=>9687, -44535=>9688, -44538=>9689, -44539=>9690, -44541=>9691, -44542=>9692, -44546=>9693, -44547=>9694, -44548=>9695, -44549=>9696, -44550=>9697, -44551=>9698, -44554=>9699, -44556=>9700, -44558=>9701, -44559=>9702, -44560=>9703, -44561=>9704, -44562=>9705, -44563=>9706, -44565=>9707, -44566=>9708, -44567=>9709, -44568=>9710, -44569=>9711, -44570=>9712, -44571=>9713, -44572=>9714, -44573=>9715, -44574=>9716, -44575=>9717, -44576=>9718, -44577=>9719, -44578=>9720, -44579=>9721, -44580=>9722, -44581=>9723, -44582=>9724, -44583=>9725, -44584=>9726, -44585=>9727, -44586=>9728, -44587=>9729, -44588=>9730, -44589=>9731, -44590=>9732, -44591=>9733, -44594=>9734, -44595=>9735, -44597=>9736, -44598=>9737, -44601=>9738, -44603=>9739, -44604=>9740, -44605=>9741, -44606=>9742, -44607=>9743, -44610=>9744, -44612=>9745, -44615=>9746, -44616=>9747, -44617=>9748, -44619=>9749, -44623=>9750, -44625=>9751, -44626=>9752, -44627=>9753, -44629=>9754, -44631=>9755, -44632=>9756, -44633=>9757, -44634=>9758, -44635=>9759, -44638=>9760, -44642=>9761, -44643=>9762, -44644=>9763, -44646=>9764, -44647=>9765, -44650=>9766, -44651=>9767, -44653=>9768, -44654=>9769, -44655=>9770, -44657=>9771, -44658=>9772, -44659=>9773, -44660=>9774, -44661=>9775, -44662=>9776, -44663=>9777, -44666=>9778, -44670=>9779, -44671=>9780, -44672=>9781, -44673=>9782, -44674=>9783, -44675=>9784, -44678=>9785, -44679=>9786, -44680=>9787, -44681=>9788, -44682=>9789, -44683=>9790, -44685=>9791, -44686=>9792, -44687=>9793, -44688=>9794, -44689=>9795, -44690=>9796, -44691=>9797, -44692=>9798, -44693=>9799, -44694=>9800, -44695=>9801, -44696=>9802, -44697=>9803, -44698=>9804, -44699=>9805, -44700=>9806, -44701=>9807, -44702=>9808, -44703=>9809, -44704=>9810, -44705=>9811, -44706=>9812, -44707=>9813, -44708=>9814, -44709=>9815, -44710=>9816, -44711=>9817, -44712=>9818, -44713=>9819, -44714=>9820, -44715=>9821, -44716=>9822, -44717=>9823, -44718=>9824, -44719=>9825, -44720=>9826, -44721=>9827, -44722=>9828, -44723=>9829, -44724=>9830, -44725=>9831, -44726=>9832, -44727=>9833, -44728=>9834, -44729=>9835, -44730=>9836, -44731=>9837, -44735=>9838, -44737=>9839, -44738=>9840, -44739=>9841, -44741=>9842, -44742=>9843, -44743=>9844, -44744=>9845, -44745=>9846, -44746=>9847, -44747=>9848, -44750=>9849, -44754=>9850, -44755=>9851, -44756=>9852, -44757=>9853, -44758=>9854, -44759=>9855, -44762=>9856, -44763=>9857, -44765=>9858, -44766=>9859, -44767=>9860, -44768=>9861, -44769=>9862, -44770=>9863, -44771=>9864, -44772=>9865, -44773=>9866, -44774=>9867, -44775=>9868, -44777=>9869, -44778=>9870, -44780=>9871, -44782=>9872, -44783=>9873, -44784=>9874, -44785=>9875, -44786=>9876, -44787=>9877, -44789=>9878, -44790=>9879, -44791=>9880, -44793=>9881, -44794=>9882, -44795=>9883, -44797=>9884, -44798=>9885, -44799=>9886, -44800=>9887, -44801=>9888, -44802=>9889, -44803=>9890, -44804=>9891, -44805=>9892, -44806=>9893, -44809=>9894, -44810=>9895, -44811=>9896, -44812=>9897, -44814=>9898, -44815=>9899, -44817=>9900, -44818=>9901, -44819=>9902, -44820=>9903, -44821=>9904, -44822=>9905, -44823=>9906, -44824=>9907, -44825=>9908, -44826=>9909, -44827=>9910, -44828=>9911, -44829=>9912, -44830=>9913, -44831=>9914, -44832=>9915, -44833=>9916, -44834=>9917, -44835=>9918, -44836=>9919, -44837=>9920, -44838=>9921, -44839=>9922, -44840=>9923, -44841=>9924, -44842=>9925, -44843=>9926, -44846=>9927, -44847=>9928, -44849=>9929, -44851=>9930, -44853=>9931, -44854=>9932, -44855=>9933, -44856=>9934, -44857=>9935, -44858=>9936, -44859=>9937, -44862=>9938, -44864=>9939, -44868=>9940, -44869=>9941, -44870=>9942, -44871=>9943, -44874=>9944, -44875=>9945, -44876=>9946, -44877=>9947, -44878=>9948, -44879=>9949, -44881=>9950, -44882=>9951, -44883=>9952, -44884=>9953, -44885=>9954, -44886=>9955, -44887=>9956, -44888=>9957, -44889=>9958, -44890=>9959, -44891=>9960, -44894=>9961, -44895=>9962, -44896=>9963, -44897=>9964, -44898=>9965, -44899=>9966, -44902=>9967, -44903=>9968, -44904=>9969, -44905=>9970, -44906=>9971, -44907=>9972, -44908=>9973, -44909=>9974, -44910=>9975, -44911=>9976, -44912=>9977, -44913=>9978, -44914=>9979, -44915=>9980, -44916=>9981, -44917=>9982, -44918=>9983, -44919=>9984, -44920=>9985, -44922=>9986, -44923=>9987, -44924=>9988, -44925=>9989, -44926=>9990, -44927=>9991, -44929=>9992, -44930=>9993, -44931=>9994, -44933=>9995, -44934=>9996, -44935=>9997, -44937=>9998, -44938=>9999, -44939=>10000, -44940=>10001, -44941=>10002, -44942=>10003, -44943=>10004, -44946=>10005, -44947=>10006, -44948=>10007, -44950=>10008, -44951=>10009, -44952=>10010, -44953=>10011, -44954=>10012, -44955=>10013, -44957=>10014, -44958=>10015, -44959=>10016, -44960=>10017, -44961=>10018, -44962=>10019, -44963=>10020, -44964=>10021, -44965=>10022, -44966=>10023, -44967=>10024, -44968=>10025, -44969=>10026, -44970=>10027, -44971=>10028, -44972=>10029, -44973=>10030, -44974=>10031, -44975=>10032, -44976=>10033, -44977=>10034, -44978=>10035, -44979=>10036, -44980=>10037, -44981=>10038, -44982=>10039, -44983=>10040, -44986=>10041, -44987=>10042, -44989=>10043, -44990=>10044, -44991=>10045, -44993=>10046, -44994=>10047, -44995=>10048, -44996=>10049, -44997=>10050, -44998=>10051, -45002=>10052, -45004=>10053, -45007=>10054, -45008=>10055, -45009=>10056, -45010=>10057, -45011=>10058, -45013=>10059, -45014=>10060, -45015=>10061, -45016=>10062, -45017=>10063, -45018=>10064, -45019=>10065, -45021=>10066, -45022=>10067, -45023=>10068, -45024=>10069, -45025=>10070, -45026=>10071, -45027=>10072, -45028=>10073, -45029=>10074, -45030=>10075, -45031=>10076, -45034=>10077, -45035=>10078, -45036=>10079, -45037=>10080, -45038=>10081, -45039=>10082, -45042=>10083, -45043=>10084, -45045=>10085, -45046=>10086, -45047=>10087, -45049=>10088, -45050=>10089, -45051=>10090, -45052=>10091, -45053=>10092, -45054=>10093, -45055=>10094, -45058=>10095, -45059=>10096, -45061=>10097, -45062=>10098, -45063=>10099, -45064=>10100, -45065=>10101, -45066=>10102, -45067=>10103, -45069=>10104, -45070=>10105, -45071=>10106, -45073=>10107, -45074=>10108, -45075=>10109, -45077=>10110, -45078=>10111, -45079=>10112, -45080=>10113, -45081=>10114, -45082=>10115, -45083=>10116, -45086=>10117, -45087=>10118, -45088=>10119, -45089=>10120, -45090=>10121, -45091=>10122, -45092=>10123, -45093=>10124, -45094=>10125, -45095=>10126, -45097=>10127, -45098=>10128, -45099=>10129, -45100=>10130, -45101=>10131, -45102=>10132, -45103=>10133, -45104=>10134, -45105=>10135, -45106=>10136, -45107=>10137, -45108=>10138, -45109=>10139, -45110=>10140, -45111=>10141, -45112=>10142, -45113=>10143, -45114=>10144, -45115=>10145, -45116=>10146, -45117=>10147, -45118=>10148, -45119=>10149, -45120=>10150, -45121=>10151, -45122=>10152, -45123=>10153, -45126=>10154, -45127=>10155, -45129=>10156, -45131=>10157, -45133=>10158, -45135=>10159, -45136=>10160, -45137=>10161, -45138=>10162, -45142=>10163, -45144=>10164, -45146=>10165, -45147=>10166, -45148=>10167, -45150=>10168, -45151=>10169, -45152=>10170, -45153=>10171, -45154=>10172, -45155=>10173, -45156=>10174, -45157=>10175, -45158=>10176, -45159=>10177, -45160=>10178, -45161=>10179, -45162=>10180, -45163=>10181, -45164=>10182, -45165=>10183, -45166=>10184, -45167=>10185, -45168=>10186, -45169=>10187, -45170=>10188, -45171=>10189, -45172=>10190, -45173=>10191, -45174=>10192, -45175=>10193, -45176=>10194, -45177=>10195, -45178=>10196, -45179=>10197, -45182=>10198, -45183=>10199, -45185=>10200, -45186=>10201, -45187=>10202, -45189=>10203, -45190=>10204, -45191=>10205, -45192=>10206, -45193=>10207, -45194=>10208, -45195=>10209, -45198=>10210, -45200=>10211, -45202=>10212, -45203=>10213, -45204=>10214, -45205=>10215, -45206=>10216, -45207=>10217, -45211=>10218, -45213=>10219, -45214=>10220, -45219=>10221, -45220=>10222, -45221=>10223, -45222=>10224, -45223=>10225, -45226=>10226, -45232=>10227, -45234=>10228, -45238=>10229, -45239=>10230, -45241=>10231, -45242=>10232, -45243=>10233, -45245=>10234, -45246=>10235, -45247=>10236, -45248=>10237, -45249=>10238, -45250=>10239, -45251=>10240, -45254=>10241, -45258=>10242, -45259=>10243, -45260=>10244, -45261=>10245, -45262=>10246, -45263=>10247, -45266=>10248, -45267=>10249, -45269=>10250, -45270=>10251, -45271=>10252, -45273=>10253, -45274=>10254, -45275=>10255, -45276=>10256, -45277=>10257, -45278=>10258, -45279=>10259, -45281=>10260, -45282=>10261, -45283=>10262, -45284=>10263, -45286=>10264, -45287=>10265, -45288=>10266, -45289=>10267, -45290=>10268, -45291=>10269, -45292=>10270, -45293=>10271, -45294=>10272, -45295=>10273, -45296=>10274, -45297=>10275, -45298=>10276, -45299=>10277, -45300=>10278, -45301=>10279, -45302=>10280, -45303=>10281, -45304=>10282, -45305=>10283, -45306=>10284, -45307=>10285, -45308=>10286, -45309=>10287, -45310=>10288, -45311=>10289, -45312=>10290, -45313=>10291, -45314=>10292, -45315=>10293, -45316=>10294, -45317=>10295, -45318=>10296, -45319=>10297, -45322=>10298, -45325=>10299, -45326=>10300, -45327=>10301, -45329=>10302, -45332=>10303, -45333=>10304, -45334=>10305, -45335=>10306, -45338=>10307, -45342=>10308, -45343=>10309, -45344=>10310, -45345=>10311, -45346=>10312, -45350=>10313, -45351=>10314, -45353=>10315, -45354=>10316, -45355=>10317, -45357=>10318, -45358=>10319, -45359=>10320, -45360=>10321, -45361=>10322, -45362=>10323, -45363=>10324, -45366=>10325, -45370=>10326, -45371=>10327, -45372=>10328, -45373=>10329, -45374=>10330, -45375=>10331, -45378=>10332, -45379=>10333, -45381=>10334, -45382=>10335, -45383=>10336, -45385=>10337, -45386=>10338, -45387=>10339, -45388=>10340, -45389=>10341, -45390=>10342, -45391=>10343, -45394=>10344, -45395=>10345, -45398=>10346, -45399=>10347, -45401=>10348, -45402=>10349, -45403=>10350, -45405=>10351, -45406=>10352, -45407=>10353, -45409=>10354, -45410=>10355, -45411=>10356, -45412=>10357, -45413=>10358, -45414=>10359, -45415=>10360, -45416=>10361, -45417=>10362, -45418=>10363, -45419=>10364, -45420=>10365, -45421=>10366, -45422=>10367, -45423=>10368, -45424=>10369, -45425=>10370, -45426=>10371, -45427=>10372, -45428=>10373, -45429=>10374, -45430=>10375, -45431=>10376, -45434=>10377, -45435=>10378, -45437=>10379, -45438=>10380, -45439=>10381, -45441=>10382, -45443=>10383, -45444=>10384, -45445=>10385, -45446=>10386, -45447=>10387, -45450=>10388, -45452=>10389, -45454=>10390, -45455=>10391, -45456=>10392, -45457=>10393, -45461=>10394, -45462=>10395, -45463=>10396, -45465=>10397, -45466=>10398, -45467=>10399, -45469=>10400, -45470=>10401, -45471=>10402, -45472=>10403, -45473=>10404, -45474=>10405, -45475=>10406, -45476=>10407, -45477=>10408, -45478=>10409, -45479=>10410, -45481=>10411, -45482=>10412, -45483=>10413, -45484=>10414, -45485=>10415, -45486=>10416, -45487=>10417, -45488=>10418, -45489=>10419, -45490=>10420, -45491=>10421, -45492=>10422, -45493=>10423, -45494=>10424, -45495=>10425, -45496=>10426, -45497=>10427, -45498=>10428, -45499=>10429, -45500=>10430, -45501=>10431, -45502=>10432, -45503=>10433, -45504=>10434, -45505=>10435, -45506=>10436, -45507=>10437, -45508=>10438, -45509=>10439, -45510=>10440, -45511=>10441, -45512=>10442, -45513=>10443, -45514=>10444, -45515=>10445, -45517=>10446, -45518=>10447, -45519=>10448, -45521=>10449, -45522=>10450, -45523=>10451, -45525=>10452, -45526=>10453, -45527=>10454, -45528=>10455, -45529=>10456, -45530=>10457, -45531=>10458, -45534=>10459, -45536=>10460, -45537=>10461, -45538=>10462, -45539=>10463, -45540=>10464, -45541=>10465, -45542=>10466, -45543=>10467, -45546=>10468, -45547=>10469, -45549=>10470, -45550=>10471, -45551=>10472, -45553=>10473, -45554=>10474, -45555=>10475, -45556=>10476, -45557=>10477, -45558=>10478, -45559=>10479, -45560=>10480, -45562=>10481, -45564=>10482, -45566=>10483, -45567=>10484, -45568=>10485, -45569=>10486, -45570=>10487, -45571=>10488, -45574=>10489, -45575=>10490, -45577=>10491, -45578=>10492, -45581=>10493, -45582=>10494, -45583=>10495, -45584=>10496, -45585=>10497, -45586=>10498, -45587=>10499, -45590=>10500, -45592=>10501, -45594=>10502, -45595=>10503, -45596=>10504, -45597=>10505, -45598=>10506, -45599=>10507, -45601=>10508, -45602=>10509, -45603=>10510, -45604=>10511, -45605=>10512, -45606=>10513, -45607=>10514, -45608=>10515, -45609=>10516, -45610=>10517, -45611=>10518, -45612=>10519, -45613=>10520, -45614=>10521, -45615=>10522, -45616=>10523, -45617=>10524, -45618=>10525, -45619=>10526, -45621=>10527, -45622=>10528, -45623=>10529, -45624=>10530, -45625=>10531, -45626=>10532, -45627=>10533, -45629=>10534, -45630=>10535, -45631=>10536, -45632=>10537, -45633=>10538, -45634=>10539, -45635=>10540, -45636=>10541, -45637=>10542, -45638=>10543, -45639=>10544, -45640=>10545, -45641=>10546, -45642=>10547, -45643=>10548, -45644=>10549, -45645=>10550, -45646=>10551, -45647=>10552, -45648=>10553, -45649=>10554, -45650=>10555, -45651=>10556, -45652=>10557, -45653=>10558, -45654=>10559, -45655=>10560, -45657=>10561, -45658=>10562, -45659=>10563, -45661=>10564, -45662=>10565, -45663=>10566, -45665=>10567, -45666=>10568, -45667=>10569, -45668=>10570, -45669=>10571, -45670=>10572, -45671=>10573, -45674=>10574, -45675=>10575, -45676=>10576, -45677=>10577, -45678=>10578, -45679=>10579, -45680=>10580, -45681=>10581, -45682=>10582, -45683=>10583, -45686=>10584, -45687=>10585, -45688=>10586, -45689=>10587, -45690=>10588, -45691=>10589, -45693=>10590, -45694=>10591, -45695=>10592, -45696=>10593, -45697=>10594, -45698=>10595, -45699=>10596, -45702=>10597, -45703=>10598, -45704=>10599, -45706=>10600, -45707=>10601, -45708=>10602, -45709=>10603, -45710=>10604, -45711=>10605, -45714=>10606, -45715=>10607, -45717=>10608, -45718=>10609, -45719=>10610, -45723=>10611, -45724=>10612, -45725=>10613, -45726=>10614, -45727=>10615, -45730=>10616, -45732=>10617, -45735=>10618, -45736=>10619, -45737=>10620, -45739=>10621, -45741=>10622, -45742=>10623, -45743=>10624, -45745=>10625, -45746=>10626, -45747=>10627, -45749=>10628, -45750=>10629, -45751=>10630, -45752=>10631, -45753=>10632, -45754=>10633, -45755=>10634, -45756=>10635, -45757=>10636, -45758=>10637, -45759=>10638, -45760=>10639, -45761=>10640, -45762=>10641, -45763=>10642, -45764=>10643, -45765=>10644, -45766=>10645, -45767=>10646, -45770=>10647, -45771=>10648, -45773=>10649, -45774=>10650, -45775=>10651, -45777=>10652, -45779=>10653, -45780=>10654, -45781=>10655, -45782=>10656, -45783=>10657, -45786=>10658, -45788=>10659, -45790=>10660, -45791=>10661, -45792=>10662, -45793=>10663, -45795=>10664, -45799=>10665, -45801=>10666, -45802=>10667, -45808=>10668, -45809=>10669, -45810=>10670, -45814=>10671, -45820=>10672, -45821=>10673, -45822=>10674, -45826=>10675, -45827=>10676, -45829=>10677, -45830=>10678, -45831=>10679, -45833=>10680, -45834=>10681, -45835=>10682, -45836=>10683, -45837=>10684, -45838=>10685, -45839=>10686, -45842=>10687, -45846=>10688, -45847=>10689, -45848=>10690, -45849=>10691, -45850=>10692, -45851=>10693, -45853=>10694, -45854=>10695, -45855=>10696, -45856=>10697, -45857=>10698, -45858=>10699, -45859=>10700, -45860=>10701, -45861=>10702, -45862=>10703, -45863=>10704, -45864=>10705, -45865=>10706, -45866=>10707, -45867=>10708, -45868=>10709, -45869=>10710, -45870=>10711, -45871=>10712, -45872=>10713, -45873=>10714, -45874=>10715, -45875=>10716, -45876=>10717, -45877=>10718, -45878=>10719, -45879=>10720, -45880=>10721, -45881=>10722, -45882=>10723, -45883=>10724, -45884=>10725, -45885=>10726, -45886=>10727, -45887=>10728, -45888=>10729, -45889=>10730, -45890=>10731, -45891=>10732, -45892=>10733, -45893=>10734, -45894=>10735, -45895=>10736, -45896=>10737, -45897=>10738, -45898=>10739, -45899=>10740, -45900=>10741, -45901=>10742, -45902=>10743, -45903=>10744, -45904=>10745, -45905=>10746, -45906=>10747, -45907=>10748, -45911=>10749, -45913=>10750, -45914=>10751, -45917=>10752, -45920=>10753, -45921=>10754, -45922=>10755, -45923=>10756, -45926=>10757, -45928=>10758, -45930=>10759, -45932=>10760, -45933=>10761, -45935=>10762, -45938=>10763, -45939=>10764, -45941=>10765, -45942=>10766, -45943=>10767, -45945=>10768, -45946=>10769, -45947=>10770, -45948=>10771, -45949=>10772, -45950=>10773, -45951=>10774, -45954=>10775, -45958=>10776, -45959=>10777, -45960=>10778, -45961=>10779, -45962=>10780, -45963=>10781, -45965=>10782, -45966=>10783, -45967=>10784, -45969=>10785, -45970=>10786, -45971=>10787, -45973=>10788, -45974=>10789, -45975=>10790, -45976=>10791, -45977=>10792, -45978=>10793, -45979=>10794, -45980=>10795, -45981=>10796, -45982=>10797, -45983=>10798, -45986=>10799, -45987=>10800, -45988=>10801, -45989=>10802, -45990=>10803, -45991=>10804, -45993=>10805, -45994=>10806, -45995=>10807, -45997=>10808, -45998=>10809, -45999=>10810, -46000=>10811, -46001=>10812, -46002=>10813, -46003=>10814, -46004=>10815, -46005=>10816, -46006=>10817, -46007=>10818, -46008=>10819, -46009=>10820, -46010=>10821, -46011=>10822, -46012=>10823, -46013=>10824, -46014=>10825, -46015=>10826, -46016=>10827, -46017=>10828, -46018=>10829, -46019=>10830, -46022=>10831, -46023=>10832, -46025=>10833, -46026=>10834, -46029=>10835, -46031=>10836, -46033=>10837, -46034=>10838, -46035=>10839, -46038=>10840, -46040=>10841, -46042=>10842, -46044=>10843, -46046=>10844, -46047=>10845, -46049=>10846, -46050=>10847, -46051=>10848, -46053=>10849, -46054=>10850, -46055=>10851, -46057=>10852, -46058=>10853, -46059=>10854, -46060=>10855, -46061=>10856, -46062=>10857, -46063=>10858, -46064=>10859, -46065=>10860, -46066=>10861, -46067=>10862, -46068=>10863, -46069=>10864, -46070=>10865, -46071=>10866, -46072=>10867, -46073=>10868, -46074=>10869, -46075=>10870, -46077=>10871, -46078=>10872, -46079=>10873, -46080=>10874, -46081=>10875, -46082=>10876, -46083=>10877, -46084=>10878, -46085=>10879, -46086=>10880, -46087=>10881, -46088=>10882, -46089=>10883, -46090=>10884, -46091=>10885, -46092=>10886, -46093=>10887, -46094=>10888, -46095=>10889, -46097=>10890, -46098=>10891, -46099=>10892, -46100=>10893, -46101=>10894, -46102=>10895, -46103=>10896, -46105=>10897, -46106=>10898, -46107=>10899, -46109=>10900, -46110=>10901, -46111=>10902, -46113=>10903, -46114=>10904, -46115=>10905, -46116=>10906, -46117=>10907, -46118=>10908, -46119=>10909, -46122=>10910, -46124=>10911, -46125=>10912, -46126=>10913, -46127=>10914, -46128=>10915, -46129=>10916, -46130=>10917, -46131=>10918, -46133=>10919, -46134=>10920, -46135=>10921, -46136=>10922, -46137=>10923, -46138=>10924, -46139=>10925, -46140=>10926, -46141=>10927, -46142=>10928, -46143=>10929, -46144=>10930, -46145=>10931, -46146=>10932, -46147=>10933, -46148=>10934, -46149=>10935, -46150=>10936, -46151=>10937, -46152=>10938, -46153=>10939, -46154=>10940, -46155=>10941, -46156=>10942, -46157=>10943, -46158=>10944, -46159=>10945, -46162=>10946, -46163=>10947, -46165=>10948, -46166=>10949, -46167=>10950, -46169=>10951, -46170=>10952, -46171=>10953, -46172=>10954, -46173=>10955, -46174=>10956, -46175=>10957, -46178=>10958, -46180=>10959, -46182=>10960, -46183=>10961, -46184=>10962, -46185=>10963, -46186=>10964, -46187=>10965, -46189=>10966, -46190=>10967, -46191=>10968, -46192=>10969, -46193=>10970, -46194=>10971, -46195=>10972, -46196=>10973, -46197=>10974, -46198=>10975, -46199=>10976, -46200=>10977, -46201=>10978, -46202=>10979, -46203=>10980, -46204=>10981, -46205=>10982, -46206=>10983, -46207=>10984, -46209=>10985, -46210=>10986, -46211=>10987, -46212=>10988, -46213=>10989, -46214=>10990, -46215=>10991, -46217=>10992, -46218=>10993, -46219=>10994, -46220=>10995, -46221=>10996, -46222=>10997, -46223=>10998, -46224=>10999, -46225=>11000, -46226=>11001, -46227=>11002, -46228=>11003, -46229=>11004, -46230=>11005, -46231=>11006, -46232=>11007, -46233=>11008, -46234=>11009, -46235=>11010, -46236=>11011, -46238=>11012, -46239=>11013, -46240=>11014, -46241=>11015, -46242=>11016, -46243=>11017, -46245=>11018, -46246=>11019, -46247=>11020, -46249=>11021, -46250=>11022, -46251=>11023, -46253=>11024, -46254=>11025, -46255=>11026, -46256=>11027, -46257=>11028, -46258=>11029, -46259=>11030, -46260=>11031, -46262=>11032, -46264=>11033, -46266=>11034, -46267=>11035, -46268=>11036, -46269=>11037, -46270=>11038, -46271=>11039, -46273=>11040, -46274=>11041, -46275=>11042, -46277=>11043, -46278=>11044, -46279=>11045, -46281=>11046, -46282=>11047, -46283=>11048, -46284=>11049, -46285=>11050, -46286=>11051, -46287=>11052, -46289=>11053, -46290=>11054, -46291=>11055, -46292=>11056, -46294=>11057, -46295=>11058, -46296=>11059, -46297=>11060, -46298=>11061, -46299=>11062, -46302=>11063, -46303=>11064, -46305=>11065, -46306=>11066, -46309=>11067, -46311=>11068, -46312=>11069, -46313=>11070, -46314=>11071, -46315=>11072, -46318=>11073, -46320=>11074, -46322=>11075, -46323=>11076, -46324=>11077, -46325=>11078, -46326=>11079, -46327=>11080, -46329=>11081, -46330=>11082, -46331=>11083, -46332=>11084, -46333=>11085, -46334=>11086, -46335=>11087, -46336=>11088, -46337=>11089, -46338=>11090, -46339=>11091, -46340=>11092, -46341=>11093, -46342=>11094, -46343=>11095, -46344=>11096, -46345=>11097, -46346=>11098, -46347=>11099, -46348=>11100, -46349=>11101, -46350=>11102, -46351=>11103, -46352=>11104, -46353=>11105, -46354=>11106, -46355=>11107, -46358=>11108, -46359=>11109, -46361=>11110, -46362=>11111, -46365=>11112, -46366=>11113, -46367=>11114, -46368=>11115, -46369=>11116, -46370=>11117, -46371=>11118, -46374=>11119, -46379=>11120, -46380=>11121, -46381=>11122, -46382=>11123, -46383=>11124, -46386=>11125, -46387=>11126, -46389=>11127, -46390=>11128, -46391=>11129, -46393=>11130, -46394=>11131, -46395=>11132, -46396=>11133, -46397=>11134, -46398=>11135, -46399=>11136, -46402=>11137, -46406=>11138, -46407=>11139, -46408=>11140, -46409=>11141, -46410=>11142, -46414=>11143, -46415=>11144, -46417=>11145, -46418=>11146, -46419=>11147, -46421=>11148, -46422=>11149, -46423=>11150, -46424=>11151, -46425=>11152, -46426=>11153, -46427=>11154, -46430=>11155, -46434=>11156, -46435=>11157, -46436=>11158, -46437=>11159, -46438=>11160, -46439=>11161, -46440=>11162, -46441=>11163, -46442=>11164, -46443=>11165, -46444=>11166, -46445=>11167, -46446=>11168, -46447=>11169, -46448=>11170, -46449=>11171, -46450=>11172, -46451=>11173, -46452=>11174, -46453=>11175, -46454=>11176, -46455=>11177, -46456=>11178, -46457=>11179, -46458=>11180, -46459=>11181, -46460=>11182, -46461=>11183, -46462=>11184, -46463=>11185, -46464=>11186, -46465=>11187, -46466=>11188, -46467=>11189, -46468=>11190, -46469=>11191, -46470=>11192, -46471=>11193, -46472=>11194, -46473=>11195, -46474=>11196, -46475=>11197, -46476=>11198, -46477=>11199, -46478=>11200, -46479=>11201, -46480=>11202, -46481=>11203, -46482=>11204, -46483=>11205, -46484=>11206, -46485=>11207, -46486=>11208, -46487=>11209, -46488=>11210, -46489=>11211, -46490=>11212, -46491=>11213, -46492=>11214, -46493=>11215, -46494=>11216, -46495=>11217, -46498=>11218, -46499=>11219, -46501=>11220, -46502=>11221, -46503=>11222, -46505=>11223, -46508=>11224, -46509=>11225, -46510=>11226, -46511=>11227, -46514=>11228, -46518=>11229, -46519=>11230, -46520=>11231, -46521=>11232, -46522=>11233, -46526=>11234, -46527=>11235, -46529=>11236, -46530=>11237, -46531=>11238, -46533=>11239, -46534=>11240, -46535=>11241, -46536=>11242, -46537=>11243, -46538=>11244, -46539=>11245, -46542=>11246, -46546=>11247, -46547=>11248, -46548=>11249, -46549=>11250, -46550=>11251, -46551=>11252, -46553=>11253, -46554=>11254, -46555=>11255, -46556=>11256, -46557=>11257, -46558=>11258, -46559=>11259, -46560=>11260, -46561=>11261, -46562=>11262, -46563=>11263, -46564=>11264, -46565=>11265, -46566=>11266, -46567=>11267, -46568=>11268, -46569=>11269, -46570=>11270, -46571=>11271, -46573=>11272, -46574=>11273, -46575=>11274, -46576=>11275, -46577=>11276, -46578=>11277, -46579=>11278, -46580=>11279, -46581=>11280, -46582=>11281, -46583=>11282, -46584=>11283, -46585=>11284, -46586=>11285, -46587=>11286, -46588=>11287, -46589=>11288, -46590=>11289, -46591=>11290, -46592=>11291, -46593=>11292, -46594=>11293, -46595=>11294, -46596=>11295, -46597=>11296, -46598=>11297, -46599=>11298, -46600=>11299, -46601=>11300, -46602=>11301, -46603=>11302, -46604=>11303, -46605=>11304, -46606=>11305, -46607=>11306, -46610=>11307, -46611=>11308, -46613=>11309, -46614=>11310, -46615=>11311, -46617=>11312, -46618=>11313, -46619=>11314, -46620=>11315, -46621=>11316, -46622=>11317, -46623=>11318, -46624=>11319, -46625=>11320, -46626=>11321, -46627=>11322, -46628=>11323, -46630=>11324, -46631=>11325, -46632=>11326, -46633=>11327, -46634=>11328, -46635=>11329, -46637=>11330, -46638=>11331, -46639=>11332, -46640=>11333, -46641=>11334, -46642=>11335, -46643=>11336, -46645=>11337, -46646=>11338, -46647=>11339, -46648=>11340, -46649=>11341, -46650=>11342, -46651=>11343, -46652=>11344, -46653=>11345, -46654=>11346, -46655=>11347, -46656=>11348, -46657=>11349, -46658=>11350, -46659=>11351, -46660=>11352, -46661=>11353, -46662=>11354, -46663=>11355, -46665=>11356, -46666=>11357, -46667=>11358, -46668=>11359, -46669=>11360, -46670=>11361, -46671=>11362, -46672=>11363, -46673=>11364, -46674=>11365, -46675=>11366, -46676=>11367, -46677=>11368, -46678=>11369, -46679=>11370, -46680=>11371, -46681=>11372, -46682=>11373, -46683=>11374, -46684=>11375, -46685=>11376, -46686=>11377, -46687=>11378, -46688=>11379, -46689=>11380, -46690=>11381, -46691=>11382, -46693=>11383, -46694=>11384, -46695=>11385, -46697=>11386, -46698=>11387, -46699=>11388, -46700=>11389, -46701=>11390, -46702=>11391, -46703=>11392, -46704=>11393, -46705=>11394, -46706=>11395, -46707=>11396, -46708=>11397, -46709=>11398, -46710=>11399, -46711=>11400, -46712=>11401, -46713=>11402, -46714=>11403, -46715=>11404, -46716=>11405, -46717=>11406, -46718=>11407, -46719=>11408, -46720=>11409, -46721=>11410, -46722=>11411, -46723=>11412, -46724=>11413, -46725=>11414, -46726=>11415, -46727=>11416, -46728=>11417, -46729=>11418, -46730=>11419, -46731=>11420, -46732=>11421, -46733=>11422, -46734=>11423, -46735=>11424, -46736=>11425, -46737=>11426, -46738=>11427, -46739=>11428, -46740=>11429, -46741=>11430, -46742=>11431, -46743=>11432, -46744=>11433, -46745=>11434, -46746=>11435, -46747=>11436, -46750=>11437, -46751=>11438, -46753=>11439, -46754=>11440, -46755=>11441, -46757=>11442, -46758=>11443, -46759=>11444, -46760=>11445, -46761=>11446, -46762=>11447, -46765=>11448, -46766=>11449, -46767=>11450, -46768=>11451, -46770=>11452, -46771=>11453, -46772=>11454, -46773=>11455, -46774=>11456, -46775=>11457, -46776=>11458, -46777=>11459, -46778=>11460, -46779=>11461, -46780=>11462, -46781=>11463, -46782=>11464, -46783=>11465, -46784=>11466, -46785=>11467, -46786=>11468, -46787=>11469, -46788=>11470, -46789=>11471, -46790=>11472, -46791=>11473, -46792=>11474, -46793=>11475, -46794=>11476, -46795=>11477, -46796=>11478, -46797=>11479, -46798=>11480, -46799=>11481, -46800=>11482, -46801=>11483, -46802=>11484, -46803=>11485, -46805=>11486, -46806=>11487, -46807=>11488, -46808=>11489, -46809=>11490, -46810=>11491, -46811=>11492, -46812=>11493, -46813=>11494, -46814=>11495, -46815=>11496, -46816=>11497, -46817=>11498, -46818=>11499, -46819=>11500, -46820=>11501, -46821=>11502, -46822=>11503, -46823=>11504, -46824=>11505, -46825=>11506, -46826=>11507, -46827=>11508, -46828=>11509, -46829=>11510, -46830=>11511, -46831=>11512, -46833=>11513, -46834=>11514, -46835=>11515, -46837=>11516, -46838=>11517, -46839=>11518, -46841=>11519, -46842=>11520, -46843=>11521, -46844=>11522, -46845=>11523, -46846=>11524, -46847=>11525, -46850=>11526, -46851=>11527, -46852=>11528, -46854=>11529, -46855=>11530, -46856=>11531, -46857=>11532, -46858=>11533, -46859=>11534, -46860=>11535, -46861=>11536, -46862=>11537, -46863=>11538, -46864=>11539, -46865=>11540, -46866=>11541, -46867=>11542, -46868=>11543, -46869=>11544, -46870=>11545, -46871=>11546, -46872=>11547, -46873=>11548, -46874=>11549, -46875=>11550, -46876=>11551, -46877=>11552, -46878=>11553, -46879=>11554, -46880=>11555, -46881=>11556, -46882=>11557, -46883=>11558, -46884=>11559, -46885=>11560, -46886=>11561, -46887=>11562, -46890=>11563, -46891=>11564, -46893=>11565, -46894=>11566, -46897=>11567, -46898=>11568, -46899=>11569, -46900=>11570, -46901=>11571, -46902=>11572, -46903=>11573, -46906=>11574, -46908=>11575, -46909=>11576, -46910=>11577, -46911=>11578, -46912=>11579, -46913=>11580, -46914=>11581, -46915=>11582, -46917=>11583, -46918=>11584, -46919=>11585, -46921=>11586, -46922=>11587, -46923=>11588, -46925=>11589, -46926=>11590, -46927=>11591, -46928=>11592, -46929=>11593, -46930=>11594, -46931=>11595, -46934=>11596, -46935=>11597, -46936=>11598, -46937=>11599, -46938=>11600, -46939=>11601, -46940=>11602, -46941=>11603, -46942=>11604, -46943=>11605, -46945=>11606, -46946=>11607, -46947=>11608, -46949=>11609, -46950=>11610, -46951=>11611, -46953=>11612, -46954=>11613, -46955=>11614, -46956=>11615, -46957=>11616, -46958=>11617, -46959=>11618, -46962=>11619, -46964=>11620, -46966=>11621, -46967=>11622, -46968=>11623, -46969=>11624, -46970=>11625, -46971=>11626, -46974=>11627, -46975=>11628, -46977=>11629, -46978=>11630, -46979=>11631, -46981=>11632, -46982=>11633, -46983=>11634, -46984=>11635, -46985=>11636, -46986=>11637, -46987=>11638, -46990=>11639, -46995=>11640, -46996=>11641, -46997=>11642, -47002=>11643, -47003=>11644, -47005=>11645, -47006=>11646, -47007=>11647, -47009=>11648, -47010=>11649, -47011=>11650, -47012=>11651, -47013=>11652, -47014=>11653, -47015=>11654, -47018=>11655, -47022=>11656, -47023=>11657, -47024=>11658, -47025=>11659, -47026=>11660, -47027=>11661, -47030=>11662, -47031=>11663, -47033=>11664, -47034=>11665, -47035=>11666, -47036=>11667, -47037=>11668, -47038=>11669, -47039=>11670, -47040=>11671, -47041=>11672, -47042=>11673, -47043=>11674, -47044=>11675, -47045=>11676, -47046=>11677, -47048=>11678, -47050=>11679, -47051=>11680, -47052=>11681, -47053=>11682, -47054=>11683, -47055=>11684, -47056=>11685, -47057=>11686, -47058=>11687, -47059=>11688, -47060=>11689, -47061=>11690, -47062=>11691, -47063=>11692, -47064=>11693, -47065=>11694, -47066=>11695, -47067=>11696, -47068=>11697, -47069=>11698, -47070=>11699, -47071=>11700, -47072=>11701, -47073=>11702, -47074=>11703, -47075=>11704, -47076=>11705, -47077=>11706, -47078=>11707, -47079=>11708, -47080=>11709, -47081=>11710, -47082=>11711, -47083=>11712, -47086=>11713, -47087=>11714, -47089=>11715, -47090=>11716, -47091=>11717, -47093=>11718, -47094=>11719, -47095=>11720, -47096=>11721, -47097=>11722, -47098=>11723, -47099=>11724, -47102=>11725, -47106=>11726, -47107=>11727, -47108=>11728, -47109=>11729, -47110=>11730, -47114=>11731, -47115=>11732, -47117=>11733, -47118=>11734, -47119=>11735, -47121=>11736, -47122=>11737, -47123=>11738, -47124=>11739, -47125=>11740, -47126=>11741, -47127=>11742, -47130=>11743, -47132=>11744, -47134=>11745, -47135=>11746, -47136=>11747, -47137=>11748, -47138=>11749, -47139=>11750, -47142=>11751, -47143=>11752, -47145=>11753, -47146=>11754, -47147=>11755, -47149=>11756, -47150=>11757, -47151=>11758, -47152=>11759, -47153=>11760, -47154=>11761, -47155=>11762, -47158=>11763, -47162=>11764, -47163=>11765, -47164=>11766, -47165=>11767, -47166=>11768, -47167=>11769, -47169=>11770, -47170=>11771, -47171=>11772, -47173=>11773, -47174=>11774, -47175=>11775, -47176=>11776, -47177=>11777, -47178=>11778, -47179=>11779, -47180=>11780, -47181=>11781, -47182=>11782, -47183=>11783, -47184=>11784, -47186=>11785, -47188=>11786, -47189=>11787, -47190=>11788, -47191=>11789, -47192=>11790, -47193=>11791, -47194=>11792, -47195=>11793, -47198=>11794, -47199=>11795, -47201=>11796, -47202=>11797, -47203=>11798, -47205=>11799, -47206=>11800, -47207=>11801, -47208=>11802, -47209=>11803, -47210=>11804, -47211=>11805, -47214=>11806, -47216=>11807, -47218=>11808, -47219=>11809, -47220=>11810, -47221=>11811, -47222=>11812, -47223=>11813, -47225=>11814, -47226=>11815, -47227=>11816, -47229=>11817, -47230=>11818, -47231=>11819, -47232=>11820, -47233=>11821, -47234=>11822, -47235=>11823, -47236=>11824, -47237=>11825, -47238=>11826, -47239=>11827, -47240=>11828, -47241=>11829, -47242=>11830, -47243=>11831, -47244=>11832, -47246=>11833, -47247=>11834, -47248=>11835, -47249=>11836, -47250=>11837, -47251=>11838, -47252=>11839, -47253=>11840, -47254=>11841, -47255=>11842, -47256=>11843, -47257=>11844, -47258=>11845, -47259=>11846, -47260=>11847, -47261=>11848, -47262=>11849, -47263=>11850, -47264=>11851, -47265=>11852, -47266=>11853, -47267=>11854, -47268=>11855, -47269=>11856, -47270=>11857, -47271=>11858, -47273=>11859, -47274=>11860, -47275=>11861, -47276=>11862, -47277=>11863, -47278=>11864, -47279=>11865, -47281=>11866, -47282=>11867, -47283=>11868, -47285=>11869, -47286=>11870, -47287=>11871, -47289=>11872, -47290=>11873, -47291=>11874, -47292=>11875, -47293=>11876, -47294=>11877, -47295=>11878, -47298=>11879, -47300=>11880, -47302=>11881, -47303=>11882, -47304=>11883, -47305=>11884, -47306=>11885, -47307=>11886, -47309=>11887, -47310=>11888, -47311=>11889, -47313=>11890, -47314=>11891, -47315=>11892, -47317=>11893, -47318=>11894, -47319=>11895, -47320=>11896, -47321=>11897, -47322=>11898, -47323=>11899, -47324=>11900, -47326=>11901, -47328=>11902, -47330=>11903, -47331=>11904, -47332=>11905, -47333=>11906, -47334=>11907, -47335=>11908, -47338=>11909, -47339=>11910, -47341=>11911, -47342=>11912, -47343=>11913, -47345=>11914, -47346=>11915, -47347=>11916, -47348=>11917, -47349=>11918, -47350=>11919, -47351=>11920, -47354=>11921, -47356=>11922, -47358=>11923, -47359=>11924, -47360=>11925, -47361=>11926, -47362=>11927, -47363=>11928, -47365=>11929, -47366=>11930, -47367=>11931, -47368=>11932, -47369=>11933, -47370=>11934, -47371=>11935, -47372=>11936, -47373=>11937, -47374=>11938, -47375=>11939, -47376=>11940, -47377=>11941, -47378=>11942, -47379=>11943, -47380=>11944, -47381=>11945, -47382=>11946, -47383=>11947, -47385=>11948, -47386=>11949, -47387=>11950, -47388=>11951, -47389=>11952, -47390=>11953, -47391=>11954, -47393=>11955, -47394=>11956, -47395=>11957, -47396=>11958, -47397=>11959, -47398=>11960, -47399=>11961, -47400=>11962, -47401=>11963, -47402=>11964, -47403=>11965, -47404=>11966, -47405=>11967, -47406=>11968, -47407=>11969, -47408=>11970, -47409=>11971, -47410=>11972, -47411=>11973, -47412=>11974, -47413=>11975, -47414=>11976, -47415=>11977, -47416=>11978, -47417=>11979, -47418=>11980, -47419=>11981, -47422=>11982, -47423=>11983, -47425=>11984, -47426=>11985, -47427=>11986, -47429=>11987, -47430=>11988, -47431=>11989, -47432=>11990, -47433=>11991, -47434=>11992, -47435=>11993, -47437=>11994, -47438=>11995, -47440=>11996, -47442=>11997, -47443=>11998, -47444=>11999, -47445=>12000, -47446=>12001, -47447=>12002, -47450=>12003, -47451=>12004, -47453=>12005, -47454=>12006, -47455=>12007, -47457=>12008, -47458=>12009, -47459=>12010, -47460=>12011, -47461=>12012, -47462=>12013, -47463=>12014, -47466=>12015, -47468=>12016, -47470=>12017, -47471=>12018, -47472=>12019, -47473=>12020, -47474=>12021, -47475=>12022, -47478=>12023, -47479=>12024, -47481=>12025, -47482=>12026, -47483=>12027, -47485=>12028, -47486=>12029, -47487=>12030, -47488=>12031, -47489=>12032, -47490=>12033, -47491=>12034, -47494=>12035, -47496=>12036, -47499=>12037, -47500=>12038, -47503=>12039, -47504=>12040, -47505=>12041, -47506=>12042, -47507=>12043, -47508=>12044, -47509=>12045, -47510=>12046, -47511=>12047, -47512=>12048, -47513=>12049, -47514=>12050, -47515=>12051, -47516=>12052, -47517=>12053, -47518=>12054, -47519=>12055, -47520=>12056, -47521=>12057, -47522=>12058, -47523=>12059, -47524=>12060, -47525=>12061, -47526=>12062, -47527=>12063, -47528=>12064, -47529=>12065, -47530=>12066, -47531=>12067, -47534=>12068, -47535=>12069, -47537=>12070, -47538=>12071, -47539=>12072, -47541=>12073, -47542=>12074, -47543=>12075, -47544=>12076, -47545=>12077, -47546=>12078, -47547=>12079, -47550=>12080, -47552=>12081, -47554=>12082, -47555=>12083, -47556=>12084, -47557=>12085, -47558=>12086, -47559=>12087, -47562=>12088, -47563=>12089, -47565=>12090, -47571=>12091, -47572=>12092, -47573=>12093, -47574=>12094, -47575=>12095, -47578=>12096, -47580=>12097, -47583=>12098, -47584=>12099, -47586=>12100, -47590=>12101, -47591=>12102, -47593=>12103, -47594=>12104, -47595=>12105, -47597=>12106, -47598=>12107, -47599=>12108, -47600=>12109, -47601=>12110, -47602=>12111, -47603=>12112, -47606=>12113, -47611=>12114, -47612=>12115, -47613=>12116, -47614=>12117, -47615=>12118, -47618=>12119, -47619=>12120, -47620=>12121, -47621=>12122, -47622=>12123, -47623=>12124, -47625=>12125, -47626=>12126, -47627=>12127, -47628=>12128, -47629=>12129, -47630=>12130, -47631=>12131, -47632=>12132, -47633=>12133, -47634=>12134, -47635=>12135, -47636=>12136, -47638=>12137, -47639=>12138, -47640=>12139, -47641=>12140, -47642=>12141, -47643=>12142, -47644=>12143, -47645=>12144, -47646=>12145, -47647=>12146, -47648=>12147, -47649=>12148, -47650=>12149, -47651=>12150, -47652=>12151, -47653=>12152, -47654=>12153, -47655=>12154, -47656=>12155, -47657=>12156, -47658=>12157, -47659=>12158, -47660=>12159, -47661=>12160, -47662=>12161, -47663=>12162, -47664=>12163, -47665=>12164, -47666=>12165, -47667=>12166, -47668=>12167, -47669=>12168, -47670=>12169, -47671=>12170, -47674=>12171, -47675=>12172, -47677=>12173, -47678=>12174, -47679=>12175, -47681=>12176, -47683=>12177, -47684=>12178, -47685=>12179, -47686=>12180, -47687=>12181, -47690=>12182, -47692=>12183, -47695=>12184, -47696=>12185, -47697=>12186, -47698=>12187, -47702=>12188, -47703=>12189, -47705=>12190, -47706=>12191, -47707=>12192, -47709=>12193, -47710=>12194, -47711=>12195, -47712=>12196, -47713=>12197, -47714=>12198, -47715=>12199, -47718=>12200, -47722=>12201, -47723=>12202, -47724=>12203, -47725=>12204, -47726=>12205, -47727=>12206, -47730=>12207, -47731=>12208, -47733=>12209, -47734=>12210, -47735=>12211, -47737=>12212, -47738=>12213, -47739=>12214, -47740=>12215, -47741=>12216, -47742=>12217, -47743=>12218, -47744=>12219, -47745=>12220, -47746=>12221, -47750=>12222, -47752=>12223, -47753=>12224, -47754=>12225, -47755=>12226, -47757=>12227, -47758=>12228, -47759=>12229, -47760=>12230, -47761=>12231, -47762=>12232, -47763=>12233, -47764=>12234, -47765=>12235, -47766=>12236, -47767=>12237, -47768=>12238, -47769=>12239, -47770=>12240, -47771=>12241, -47772=>12242, -47773=>12243, -47774=>12244, -47775=>12245, -47776=>12246, -47777=>12247, -47778=>12248, -47779=>12249, -47780=>12250, -47781=>12251, -47782=>12252, -47783=>12253, -47786=>12254, -47789=>12255, -47790=>12256, -47791=>12257, -47793=>12258, -47795=>12259, -47796=>12260, -47797=>12261, -47798=>12262, -47799=>12263, -47802=>12264, -47804=>12265, -47806=>12266, -47807=>12267, -47808=>12268, -47809=>12269, -47810=>12270, -47811=>12271, -47813=>12272, -47814=>12273, -47815=>12274, -47817=>12275, -47818=>12276, -47819=>12277, -47820=>12278, -47821=>12279, -47822=>12280, -47823=>12281, -47824=>12282, -47825=>12283, -47826=>12284, -47827=>12285, -47828=>12286, -47829=>12287, -47830=>12288, -47831=>12289, -47834=>12290, -47835=>12291, -47836=>12292, -47837=>12293, -47838=>12294, -47839=>12295, -47840=>12296, -47841=>12297, -47842=>12298, -47843=>12299, -47844=>12300, -47845=>12301, -47846=>12302, -47847=>12303, -47848=>12304, -47849=>12305, -47850=>12306, -47851=>12307, -47852=>12308, -47853=>12309, -47854=>12310, -47855=>12311, -47856=>12312, -47857=>12313, -47858=>12314, -47859=>12315, -47860=>12316, -47861=>12317, -47862=>12318, -47863=>12319, -47864=>12320, -47865=>12321, -47866=>12322, -47867=>12323, -47869=>12324, -47870=>12325, -47871=>12326, -47873=>12327, -47874=>12328, -47875=>12329, -47877=>12330, -47878=>12331, -47879=>12332, -47880=>12333, -47881=>12334, -47882=>12335, -47883=>12336, -47884=>12337, -47886=>12338, -47888=>12339, -47890=>12340, -47891=>12341, -47892=>12342, -47893=>12343, -47894=>12344, -47895=>12345, -47897=>12346, -47898=>12347, -47899=>12348, -47901=>12349, -47902=>12350, -47903=>12351, -47905=>12352, -47906=>12353, -47907=>12354, -47908=>12355, -47909=>12356, -47910=>12357, -47911=>12358, -47912=>12359, -47914=>12360, -47916=>12361, -47917=>12362, -47918=>12363, -47919=>12364, -47920=>12365, -47921=>12366, -47922=>12367, -47923=>12368, -47927=>12369, -47929=>12370, -47930=>12371, -47935=>12372, -47936=>12373, -47937=>12374, -47938=>12375, -47939=>12376, -47942=>12377, -47944=>12378, -47946=>12379, -47947=>12380, -47948=>12381, -47950=>12382, -47953=>12383, -47954=>12384, -47955=>12385, -47957=>12386, -47958=>12387, -47959=>12388, -47961=>12389, -47962=>12390, -47963=>12391, -47964=>12392, -47965=>12393, -47966=>12394, -47967=>12395, -47968=>12396, -47970=>12397, -47972=>12398, -47973=>12399, -47974=>12400, -47975=>12401, -47976=>12402, -47977=>12403, -47978=>12404, -47979=>12405, -47981=>12406, -47982=>12407, -47983=>12408, -47984=>12409, -47985=>12410, -47986=>12411, -47987=>12412, -47988=>12413, -47989=>12414, -47990=>12415, -47991=>12416, -47992=>12417, -47993=>12418, -47994=>12419, -47995=>12420, -47996=>12421, -47997=>12422, -47998=>12423, -47999=>12424, -48000=>12425, -48001=>12426, -48002=>12427, -48003=>12428, -48004=>12429, -48005=>12430, -48006=>12431, -48007=>12432, -48009=>12433, -48010=>12434, -48011=>12435, -48013=>12436, -48014=>12437, -48015=>12438, -48017=>12439, -48018=>12440, -48019=>12441, -48020=>12442, -48021=>12443, -48022=>12444, -48023=>12445, -48024=>12446, -48025=>12447, -48026=>12448, -48027=>12449, -48028=>12450, -48029=>12451, -48030=>12452, -48031=>12453, -48032=>12454, -48033=>12455, -48034=>12456, -48035=>12457, -48037=>12458, -48038=>12459, -48039=>12460, -48041=>12461, -48042=>12462, -48043=>12463, -48045=>12464, -48046=>12465, -48047=>12466, -48048=>12467, -48049=>12468, -48050=>12469, -48051=>12470, -48053=>12471, -48054=>12472, -48056=>12473, -48057=>12474, -48058=>12475, -48059=>12476, -48060=>12477, -48061=>12478, -48062=>12479, -48063=>12480, -48065=>12481, -48066=>12482, -48067=>12483, -48069=>12484, -48070=>12485, -48071=>12486, -48073=>12487, -48074=>12488, -48075=>12489, -48076=>12490, -48077=>12491, -48078=>12492, -48079=>12493, -48081=>12494, -48082=>12495, -48084=>12496, -48085=>12497, -48086=>12498, -48087=>12499, -48088=>12500, -48089=>12501, -48090=>12502, -48091=>12503, -48092=>12504, -48093=>12505, -48094=>12506, -48095=>12507, -48096=>12508, -48097=>12509, -48098=>12510, -48099=>12511, -48100=>12512, -48101=>12513, -48102=>12514, -48103=>12515, -48104=>12516, -48105=>12517, -48106=>12518, -48107=>12519, -48108=>12520, -48109=>12521, -48110=>12522, -48111=>12523, -48112=>12524, -48113=>12525, -48114=>12526, -48115=>12527, -48116=>12528, -48117=>12529, -48118=>12530, -48119=>12531, -48122=>12532, -48123=>12533, -48125=>12534, -48126=>12535, -48129=>12536, -48131=>12537, -48132=>12538, -48133=>12539, -48134=>12540, -48135=>12541, -48138=>12542, -48142=>12543, -48144=>12544, -48146=>12545, -48147=>12546, -48153=>12547, -48154=>12548, -48160=>12549, -48161=>12550, -48162=>12551, -48163=>12552, -48166=>12553, -48168=>12554, -48170=>12555, -48171=>12556, -48172=>12557, -48174=>12558, -48175=>12559, -48178=>12560, -48179=>12561, -48181=>12562, -48182=>12563, -48183=>12564, -48185=>12565, -48186=>12566, -48187=>12567, -48188=>12568, -48189=>12569, -48190=>12570, -48191=>12571, -48194=>12572, -48198=>12573, -48199=>12574, -48200=>12575, -48202=>12576, -48203=>12577, -48206=>12578, -48207=>12579, -48209=>12580, -48210=>12581, -48211=>12582, -48212=>12583, -48213=>12584, -48214=>12585, -48215=>12586, -48216=>12587, -48217=>12588, -48218=>12589, -48219=>12590, -48220=>12591, -48222=>12592, -48223=>12593, -48224=>12594, -48225=>12595, -48226=>12596, -48227=>12597, -48228=>12598, -48229=>12599, -48230=>12600, -48231=>12601, -48232=>12602, -48233=>12603, -48234=>12604, -48235=>12605, -48236=>12606, -48237=>12607, -48238=>12608, -48239=>12609, -48240=>12610, -48241=>12611, -48242=>12612, -48243=>12613, -48244=>12614, -48245=>12615, -48246=>12616, -48247=>12617, -48248=>12618, -48249=>12619, -48250=>12620, -48251=>12621, -48252=>12622, -48253=>12623, -48254=>12624, -48255=>12625, -48256=>12626, -48257=>12627, -48258=>12628, -48259=>12629, -48262=>12630, -48263=>12631, -48265=>12632, -48266=>12633, -48269=>12634, -48271=>12635, -48272=>12636, -48273=>12637, -48274=>12638, -48275=>12639, -48278=>12640, -48280=>12641, -48283=>12642, -48284=>12643, -48285=>12644, -48286=>12645, -48287=>12646, -48290=>12647, -48291=>12648, -48293=>12649, -48294=>12650, -48297=>12651, -48298=>12652, -48299=>12653, -48300=>12654, -48301=>12655, -48302=>12656, -48303=>12657, -48306=>12658, -48310=>12659, -48311=>12660, -48312=>12661, -48313=>12662, -48314=>12663, -48315=>12664, -48318=>12665, -48319=>12666, -48321=>12667, -48322=>12668, -48323=>12669, -48325=>12670, -48326=>12671, -48327=>12672, -48328=>12673, -48329=>12674, -48330=>12675, -48331=>12676, -48332=>12677, -48334=>12678, -48338=>12679, -48339=>12680, -48340=>12681, -48342=>12682, -48343=>12683, -48345=>12684, -48346=>12685, -48347=>12686, -48349=>12687, -48350=>12688, -48351=>12689, -48352=>12690, -48353=>12691, -48354=>12692, -48355=>12693, -48356=>12694, -48357=>12695, -48358=>12696, -48359=>12697, -48360=>12698, -48361=>12699, -48362=>12700, -48363=>12701, -48364=>12702, -48365=>12703, -48366=>12704, -48367=>12705, -48368=>12706, -48369=>12707, -48370=>12708, -48371=>12709, -48375=>12710, -48377=>12711, -48378=>12712, -48379=>12713, -48381=>12714, -48382=>12715, -48383=>12716, -48384=>12717, -48385=>12718, -48386=>12719, -48387=>12720, -48390=>12721, -48392=>12722, -48394=>12723, -48395=>12724, -48396=>12725, -48397=>12726, -48398=>12727, -48399=>12728, -48401=>12729, -48402=>12730, -48403=>12731, -48405=>12732, -48406=>12733, -48407=>12734, -48408=>12735, -48409=>12736, -48410=>12737, -48411=>12738, -48412=>12739, -48413=>12740, -48414=>12741, -48415=>12742, -48416=>12743, -48417=>12744, -48418=>12745, -48419=>12746, -48421=>12747, -48422=>12748, -48423=>12749, -48424=>12750, -48425=>12751, -48426=>12752, -48427=>12753, -48429=>12754, -48430=>12755, -48431=>12756, -48432=>12757, -48433=>12758, -48434=>12759, -48435=>12760, -48436=>12761, -48437=>12762, -48438=>12763, -48439=>12764, -48440=>12765, -48441=>12766, -48442=>12767, -48443=>12768, -48444=>12769, -48445=>12770, -48446=>12771, -48447=>12772, -48449=>12773, -48450=>12774, -48451=>12775, -48452=>12776, -48453=>12777, -48454=>12778, -48455=>12779, -48458=>12780, -48459=>12781, -48461=>12782, -48462=>12783, -48463=>12784, -48465=>12785, -48466=>12786, -48467=>12787, -48468=>12788, -48469=>12789, -48470=>12790, -48471=>12791, -48474=>12792, -48475=>12793, -48476=>12794, -48477=>12795, -48478=>12796, -48479=>12797, -48480=>12798, -48481=>12799, -48482=>12800, -48483=>12801, -48485=>12802, -48486=>12803, -48487=>12804, -48489=>12805, -48490=>12806, -48491=>12807, -48492=>12808, -48493=>12809, -48494=>12810, -48495=>12811, -48496=>12812, -48497=>12813, -48498=>12814, -48499=>12815, -48500=>12816, -48501=>12817, -48502=>12818, -48503=>12819, -48504=>12820, -48505=>12821, -48506=>12822, -48507=>12823, -48508=>12824, -48509=>12825, -48510=>12826, -48511=>12827, -48514=>12828, -48515=>12829, -48517=>12830, -48518=>12831, -48523=>12832, -48524=>12833, -48525=>12834, -48526=>12835, -48527=>12836, -48530=>12837, -48532=>12838, -48534=>12839, -48535=>12840, -48536=>12841, -48539=>12842, -48541=>12843, -48542=>12844, -48543=>12845, -48544=>12846, -48545=>12847, -48546=>12848, -48547=>12849, -48549=>12850, -48550=>12851, -48551=>12852, -48552=>12853, -48553=>12854, -48554=>12855, -48555=>12856, -48556=>12857, -48557=>12858, -48558=>12859, -48559=>12860, -48561=>12861, -48562=>12862, -48563=>12863, -48564=>12864, -48565=>12865, -48566=>12866, -48567=>12867, -48569=>12868, -48570=>12869, -48571=>12870, -48572=>12871, -48573=>12872, -48574=>12873, -48575=>12874, -48576=>12875, -48577=>12876, -48578=>12877, -48579=>12878, -48580=>12879, -48581=>12880, -48582=>12881, -48583=>12882, -48584=>12883, -48585=>12884, -48586=>12885, -48587=>12886, -48588=>12887, -48589=>12888, -48590=>12889, -48591=>12890, -48592=>12891, -48593=>12892, -48594=>12893, -48595=>12894, -48598=>12895, -48599=>12896, -48601=>12897, -48602=>12898, -48603=>12899, -48605=>12900, -48606=>12901, -48607=>12902, -48608=>12903, -48609=>12904, -48610=>12905, -48611=>12906, -48612=>12907, -48613=>12908, -48614=>12909, -48615=>12910, -48616=>12911, -48618=>12912, -48619=>12913, -48620=>12914, -48621=>12915, -48622=>12916, -48623=>12917, -48625=>12918, -48626=>12919, -48627=>12920, -48629=>12921, -48630=>12922, -48631=>12923, -48633=>12924, -48634=>12925, -48635=>12926, -48636=>12927, -48637=>12928, -48638=>12929, -48639=>12930, -48641=>12931, -48642=>12932, -48644=>12933, -48646=>12934, -48647=>12935, -48648=>12936, -48649=>12937, -48650=>12938, -48651=>12939, -48654=>12940, -48655=>12941, -48657=>12942, -48658=>12943, -48659=>12944, -48661=>12945, -48662=>12946, -48663=>12947, -48664=>12948, -48665=>12949, -48666=>12950, -48667=>12951, -48670=>12952, -48672=>12953, -48673=>12954, -48674=>12955, -48675=>12956, -48676=>12957, -48677=>12958, -48678=>12959, -48679=>12960, -48680=>12961, -48681=>12962, -48682=>12963, -48683=>12964, -48684=>12965, -48685=>12966, -48686=>12967, -48687=>12968, -48688=>12969, -48689=>12970, -48690=>12971, -48691=>12972, -48692=>12973, -48693=>12974, -48694=>12975, -48695=>12976, -48696=>12977, -48697=>12978, -48698=>12979, -48699=>12980, -48700=>12981, -48701=>12982, -48702=>12983, -48703=>12984, -48704=>12985, -48705=>12986, -48706=>12987, -48707=>12988, -48710=>12989, -48711=>12990, -48713=>12991, -48714=>12992, -48715=>12993, -48717=>12994, -48719=>12995, -48720=>12996, -48721=>12997, -48722=>12998, -48723=>12999, -48726=>13000, -48728=>13001, -48732=>13002, -48733=>13003, -48734=>13004, -48735=>13005, -48738=>13006, -48739=>13007, -48741=>13008, -48742=>13009, -48743=>13010, -48745=>13011, -48747=>13012, -48748=>13013, -48749=>13014, -48750=>13015, -48751=>13016, -48754=>13017, -48758=>13018, -48759=>13019, -48760=>13020, -48761=>13021, -48762=>13022, -48766=>13023, -48767=>13024, -48769=>13025, -48770=>13026, -48771=>13027, -48773=>13028, -48774=>13029, -48775=>13030, -48776=>13031, -48777=>13032, -48778=>13033, -48779=>13034, -48782=>13035, -48786=>13036, -48787=>13037, -48788=>13038, -48789=>13039, -48790=>13040, -48791=>13041, -48794=>13042, -48795=>13043, -48796=>13044, -48797=>13045, -48798=>13046, -48799=>13047, -48800=>13048, -48801=>13049, -48802=>13050, -48803=>13051, -48804=>13052, -48805=>13053, -48806=>13054, -48807=>13055, -48809=>13056, -48810=>13057, -48811=>13058, -48812=>13059, -48813=>13060, -48814=>13061, -48815=>13062, -48816=>13063, -48817=>13064, -48818=>13065, -48819=>13066, -48820=>13067, -48821=>13068, -48822=>13069, -48823=>13070, -48824=>13071, -48825=>13072, -48826=>13073, -48827=>13074, -48828=>13075, -48829=>13076, -48830=>13077, -48831=>13078, -48832=>13079, -48833=>13080, -48834=>13081, -48835=>13082, -48836=>13083, -48837=>13084, -48838=>13085, -48839=>13086, -48840=>13087, -48841=>13088, -48842=>13089, -48843=>13090, -48844=>13091, -48845=>13092, -48846=>13093, -48847=>13094, -48850=>13095, -48851=>13096, -48853=>13097, -48854=>13098, -48857=>13099, -48858=>13100, -48859=>13101, -48860=>13102, -48861=>13103, -48862=>13104, -48863=>13105, -48865=>13106, -48866=>13107, -48870=>13108, -48871=>13109, -48872=>13110, -48873=>13111, -48874=>13112, -48875=>13113, -48877=>13114, -48878=>13115, -48879=>13116, -48880=>13117, -48881=>13118, -48882=>13119, -48883=>13120, -48884=>13121, -48885=>13122, -48886=>13123, -48887=>13124, -48888=>13125, -48889=>13126, -48890=>13127, -48891=>13128, -48892=>13129, -48893=>13130, -48894=>13131, -48895=>13132, -48896=>13133, -48898=>13134, -48899=>13135, -48900=>13136, -48901=>13137, -48902=>13138, -48903=>13139, -48906=>13140, -48907=>13141, -48908=>13142, -48909=>13143, -48910=>13144, -48911=>13145, -48912=>13146, -48913=>13147, -48914=>13148, -48915=>13149, -48916=>13150, -48917=>13151, -48918=>13152, -48919=>13153, -48922=>13154, -48926=>13155, -48927=>13156, -48928=>13157, -48929=>13158, -48930=>13159, -48931=>13160, -48932=>13161, -48933=>13162, -48934=>13163, -48935=>13164, -48936=>13165, -48937=>13166, -48938=>13167, -48939=>13168, -48940=>13169, -48941=>13170, -48942=>13171, -48943=>13172, -48944=>13173, -48945=>13174, -48946=>13175, -48947=>13176, -48948=>13177, -48949=>13178, -48950=>13179, -48951=>13180, -48952=>13181, -48953=>13182, -48954=>13183, -48955=>13184, -48956=>13185, -48957=>13186, -48958=>13187, -48959=>13188, -48962=>13189, -48963=>13190, -48965=>13191, -48966=>13192, -48967=>13193, -48969=>13194, -48970=>13195, -48971=>13196, -48972=>13197, -48973=>13198, -48974=>13199, -48975=>13200, -48978=>13201, -48979=>13202, -48980=>13203, -48982=>13204, -48983=>13205, -48984=>13206, -48985=>13207, -48986=>13208, -48987=>13209, -48988=>13210, -48989=>13211, -48990=>13212, -48991=>13213, -48992=>13214, -48993=>13215, -48994=>13216, -48995=>13217, -48996=>13218, -48997=>13219, -48998=>13220, -48999=>13221, -49000=>13222, -49001=>13223, -49002=>13224, -49003=>13225, -49004=>13226, -49005=>13227, -49006=>13228, -49007=>13229, -49008=>13230, -49009=>13231, -49010=>13232, -49011=>13233, -49012=>13234, -49013=>13235, -49014=>13236, -49015=>13237, -49016=>13238, -49017=>13239, -49018=>13240, -49019=>13241, -49020=>13242, -49021=>13243, -49022=>13244, -49023=>13245, -49024=>13246, -49025=>13247, -49026=>13248, -49027=>13249, -49028=>13250, -49029=>13251, -49030=>13252, -49031=>13253, -49032=>13254, -49033=>13255, -49034=>13256, -49035=>13257, -49036=>13258, -49037=>13259, -49038=>13260, -49039=>13261, -49040=>13262, -49041=>13263, -49042=>13264, -49043=>13265, -49045=>13266, -49046=>13267, -49047=>13268, -49048=>13269, -49049=>13270, -49050=>13271, -49051=>13272, -49052=>13273, -49053=>13274, -49054=>13275, -49055=>13276, -49056=>13277, -49057=>13278, -49058=>13279, -49059=>13280, -49060=>13281, -49061=>13282, -49062=>13283, -49063=>13284, -49064=>13285, -49065=>13286, -49066=>13287, -49067=>13288, -49068=>13289, -49069=>13290, -49070=>13291, -49071=>13292, -49073=>13293, -49074=>13294, -49075=>13295, -49076=>13296, -49077=>13297, -49078=>13298, -49079=>13299, -49080=>13300, -49081=>13301, -49082=>13302, -49083=>13303, -49084=>13304, -49085=>13305, -49086=>13306, -49087=>13307, -49088=>13308, -49089=>13309, -49090=>13310, -49091=>13311, -49092=>13312, -49094=>13313, -49095=>13314, -49096=>13315, -49097=>13316, -49098=>13317, -49099=>13318, -49102=>13319, -49103=>13320, -49105=>13321, -49106=>13322, -49107=>13323, -49109=>13324, -49110=>13325, -49111=>13326, -49112=>13327, -49113=>13328, -49114=>13329, -49115=>13330, -49117=>13331, -49118=>13332, -49120=>13333, -49122=>13334, -49123=>13335, -49124=>13336, -49125=>13337, -49126=>13338, -49127=>13339, -49128=>13340, -49129=>13341, -49130=>13342, -49131=>13343, -49132=>13344, -49133=>13345, -49134=>13346, -49135=>13347, -49136=>13348, -49137=>13349, -49138=>13350, -49139=>13351, -49140=>13352, -49141=>13353, -49142=>13354, -49143=>13355, -49144=>13356, -49145=>13357, -49146=>13358, -49147=>13359, -49148=>13360, -49149=>13361, -49150=>13362, -49151=>13363, -49152=>13364, -49153=>13365, -49154=>13366, -49155=>13367, -49156=>13368, -49157=>13369, -49158=>13370, -49159=>13371, -49160=>13372, -49161=>13373, -49162=>13374, -49163=>13375, -49164=>13376, -49165=>13377, -49166=>13378, -49167=>13379, -49168=>13380, -49169=>13381, -49170=>13382, -49171=>13383, -49172=>13384, -49173=>13385, -49174=>13386, -49175=>13387, -49176=>13388, -49177=>13389, -49178=>13390, -49179=>13391, -49180=>13392, -49181=>13393, -49182=>13394, -49183=>13395, -49184=>13396, -49185=>13397, -49186=>13398, -49187=>13399, -49188=>13400, -49189=>13401, -49190=>13402, -49191=>13403, -49192=>13404, -49193=>13405, -49194=>13406, -49195=>13407, -49196=>13408, -49197=>13409, -49198=>13410, -49199=>13411, -49200=>13412, -49201=>13413, -49202=>13414, -49203=>13415, -49204=>13416, -49205=>13417, -49206=>13418, -49207=>13419, -49208=>13420, -49209=>13421, -49210=>13422, -49211=>13423, -49213=>13424, -49214=>13425, -49215=>13426, -49216=>13427, -49217=>13428, -49218=>13429, -49219=>13430, -49220=>13431, -49221=>13432, -49222=>13433, -49223=>13434, -49224=>13435, -49225=>13436, -49226=>13437, -49227=>13438, -49228=>13439, -49229=>13440, -49230=>13441, -49231=>13442, -49232=>13443, -49234=>13444, -49235=>13445, -49236=>13446, -49237=>13447, -49238=>13448, -49239=>13449, -49241=>13450, -49242=>13451, -49243=>13452, -49245=>13453, -49246=>13454, -49247=>13455, -49249=>13456, -49250=>13457, -49251=>13458, -49252=>13459, -49253=>13460, -49254=>13461, -49255=>13462, -49258=>13463, -49259=>13464, -49260=>13465, -49261=>13466, -49262=>13467, -49263=>13468, -49264=>13469, -49265=>13470, -49266=>13471, -49267=>13472, -49268=>13473, -49269=>13474, -49270=>13475, -49271=>13476, -49272=>13477, -49273=>13478, -49274=>13479, -49275=>13480, -49276=>13481, -49277=>13482, -49278=>13483, -49279=>13484, -49280=>13485, -49281=>13486, -49282=>13487, -49283=>13488, -49284=>13489, -49285=>13490, -49286=>13491, -49287=>13492, -49288=>13493, -49289=>13494, -49290=>13495, -49291=>13496, -49292=>13497, -49293=>13498, -49294=>13499, -49295=>13500, -49298=>13501, -49299=>13502, -49301=>13503, -49302=>13504, -49303=>13505, -49305=>13506, -49306=>13507, -49307=>13508, -49308=>13509, -49309=>13510, -49310=>13511, -49311=>13512, -49314=>13513, -49316=>13514, -49318=>13515, -49319=>13516, -49320=>13517, -49321=>13518, -49322=>13519, -49323=>13520, -49326=>13521, -49329=>13522, -49330=>13523, -49335=>13524, -49336=>13525, -49337=>13526, -49338=>13527, -49339=>13528, -49342=>13529, -49346=>13530, -49347=>13531, -49348=>13532, -49350=>13533, -49351=>13534, -49354=>13535, -49355=>13536, -49357=>13537, -49358=>13538, -49359=>13539, -49361=>13540, -49362=>13541, -49363=>13542, -49364=>13543, -49365=>13544, -49366=>13545, -49367=>13546, -49370=>13547, -49374=>13548, -49375=>13549, -49376=>13550, -49377=>13551, -49378=>13552, -49379=>13553, -49382=>13554, -49383=>13555, -49385=>13556, -49386=>13557, -49387=>13558, -49389=>13559, -49390=>13560, -49391=>13561, -49392=>13562, -49393=>13563, -49394=>13564, -49395=>13565, -49398=>13566, -49400=>13567, -49402=>13568, -49403=>13569, -49404=>13570, -49405=>13571, -49406=>13572, -49407=>13573, -49409=>13574, -49410=>13575, -49411=>13576, -49413=>13577, -49414=>13578, -49415=>13579, -49417=>13580, -49418=>13581, -49419=>13582, -49420=>13583, -49421=>13584, -49422=>13585, -49423=>13586, -49425=>13587, -49426=>13588, -49427=>13589, -49428=>13590, -49430=>13591, -49431=>13592, -49432=>13593, -49433=>13594, -49434=>13595, -49435=>13596, -49441=>13597, -49442=>13598, -49445=>13599, -49448=>13600, -49449=>13601, -49450=>13602, -49451=>13603, -49454=>13604, -49458=>13605, -49459=>13606, -49460=>13607, -49461=>13608, -49463=>13609, -49466=>13610, -49467=>13611, -49469=>13612, -49470=>13613, -49471=>13614, -49473=>13615, -49474=>13616, -49475=>13617, -49476=>13618, -49477=>13619, -49478=>13620, -49479=>13621, -49482=>13622, -49486=>13623, -49487=>13624, -49488=>13625, -49489=>13626, -49490=>13627, -49491=>13628, -49494=>13629, -49495=>13630, -49497=>13631, -49498=>13632, -49499=>13633, -49501=>13634, -49502=>13635, -49503=>13636, -49504=>13637, -49505=>13638, -49506=>13639, -49507=>13640, -49510=>13641, -49514=>13642, -49515=>13643, -49516=>13644, -49517=>13645, -49518=>13646, -49519=>13647, -49521=>13648, -49522=>13649, -49523=>13650, -49525=>13651, -49526=>13652, -49527=>13653, -49529=>13654, -49530=>13655, -49531=>13656, -49532=>13657, -49533=>13658, -49534=>13659, -49535=>13660, -49536=>13661, -49537=>13662, -49538=>13663, -49539=>13664, -49540=>13665, -49542=>13666, -49543=>13667, -49544=>13668, -49545=>13669, -49546=>13670, -49547=>13671, -49551=>13672, -49553=>13673, -49554=>13674, -49555=>13675, -49557=>13676, -49559=>13677, -49560=>13678, -49561=>13679, -49562=>13680, -49563=>13681, -49566=>13682, -49568=>13683, -49570=>13684, -49571=>13685, -49572=>13686, -49574=>13687, -49575=>13688, -49578=>13689, -49579=>13690, -49581=>13691, -49582=>13692, -49583=>13693, -49585=>13694, -49586=>13695, -49587=>13696, -49588=>13697, -49589=>13698, -49590=>13699, -49591=>13700, -49592=>13701, -49593=>13702, -49594=>13703, -49595=>13704, -49596=>13705, -49598=>13706, -49599=>13707, -49600=>13708, -49601=>13709, -49602=>13710, -49603=>13711, -49605=>13712, -49606=>13713, -49607=>13714, -49609=>13715, -49610=>13716, -49611=>13717, -49613=>13718, -49614=>13719, -49615=>13720, -49616=>13721, -49617=>13722, -49618=>13723, -49619=>13724, -49621=>13725, -49622=>13726, -49625=>13727, -49626=>13728, -49627=>13729, -49628=>13730, -49629=>13731, -49630=>13732, -49631=>13733, -49633=>13734, -49634=>13735, -49635=>13736, -49637=>13737, -49638=>13738, -49639=>13739, -49641=>13740, -49642=>13741, -49643=>13742, -49644=>13743, -49645=>13744, -49646=>13745, -49647=>13746, -49650=>13747, -49652=>13748, -49653=>13749, -49654=>13750, -49655=>13751, -49656=>13752, -49657=>13753, -49658=>13754, -49659=>13755, -49662=>13756, -49663=>13757, -49665=>13758, -49666=>13759, -49667=>13760, -49669=>13761, -49670=>13762, -49671=>13763, -49672=>13764, -49673=>13765, -49674=>13766, -49675=>13767, -49678=>13768, -49680=>13769, -49682=>13770, -49683=>13771, -49684=>13772, -49685=>13773, -49686=>13774, -49687=>13775, -49690=>13776, -49691=>13777, -49693=>13778, -49694=>13779, -49697=>13780, -49698=>13781, -49699=>13782, -49700=>13783, -49701=>13784, -49702=>13785, -49703=>13786, -49706=>13787, -49708=>13788, -49710=>13789, -49712=>13790, -49715=>13791, -49717=>13792, -49718=>13793, -49719=>13794, -49720=>13795, -49721=>13796, -49722=>13797, -49723=>13798, -49724=>13799, -49725=>13800, -49726=>13801, -49727=>13802, -49728=>13803, -49729=>13804, -49730=>13805, -49731=>13806, -49732=>13807, -49733=>13808, -49734=>13809, -49735=>13810, -49737=>13811, -49738=>13812, -49739=>13813, -49740=>13814, -49741=>13815, -49742=>13816, -49743=>13817, -49746=>13818, -49747=>13819, -49749=>13820, -49750=>13821, -49751=>13822, -49753=>13823, -49754=>13824, -49755=>13825, -49756=>13826, -49757=>13827, -49758=>13828, -49759=>13829, -49761=>13830, -49762=>13831, -49763=>13832, -49764=>13833, -49766=>13834, -49767=>13835, -49768=>13836, -49769=>13837, -49770=>13838, -49771=>13839, -49774=>13840, -49775=>13841, -49777=>13842, -49778=>13843, -49779=>13844, -49781=>13845, -49782=>13846, -49783=>13847, -49784=>13848, -49785=>13849, -49786=>13850, -49787=>13851, -49790=>13852, -49792=>13853, -49794=>13854, -49795=>13855, -49796=>13856, -49797=>13857, -49798=>13858, -49799=>13859, -49802=>13860, -49803=>13861, -49804=>13862, -49805=>13863, -49806=>13864, -49807=>13865, -49809=>13866, -49810=>13867, -49811=>13868, -49812=>13869, -49813=>13870, -49814=>13871, -49815=>13872, -49817=>13873, -49818=>13874, -49820=>13875, -49822=>13876, -49823=>13877, -49824=>13878, -49825=>13879, -49826=>13880, -49827=>13881, -49830=>13882, -49831=>13883, -49833=>13884, -49834=>13885, -49835=>13886, -49838=>13887, -49839=>13888, -49840=>13889, -49841=>13890, -49842=>13891, -49843=>13892, -49846=>13893, -49848=>13894, -49850=>13895, -49851=>13896, -49852=>13897, -49853=>13898, -49854=>13899, -49855=>13900, -49856=>13901, -49857=>13902, -49858=>13903, -49859=>13904, -49860=>13905, -49861=>13906, -49862=>13907, -49863=>13908, -49864=>13909, -49865=>13910, -49866=>13911, -49867=>13912, -49868=>13913, -49869=>13914, -49870=>13915, -49871=>13916, -49872=>13917, -49873=>13918, -49874=>13919, -49875=>13920, -49876=>13921, -49877=>13922, -49878=>13923, -49879=>13924, -49880=>13925, -49881=>13926, -49882=>13927, -49883=>13928, -49886=>13929, -49887=>13930, -49889=>13931, -49890=>13932, -49893=>13933, -49894=>13934, -49895=>13935, -49896=>13936, -49897=>13937, -49898=>13938, -49902=>13939, -49904=>13940, -49906=>13941, -49907=>13942, -49908=>13943, -49909=>13944, -49911=>13945, -49914=>13946, -49917=>13947, -49918=>13948, -49919=>13949, -49921=>13950, -49922=>13951, -49923=>13952, -49924=>13953, -49925=>13954, -49926=>13955, -49927=>13956, -49930=>13957, -49931=>13958, -49934=>13959, -49935=>13960, -49936=>13961, -49937=>13962, -49938=>13963, -49942=>13964, -49943=>13965, -49945=>13966, -49946=>13967, -49947=>13968, -49949=>13969, -49950=>13970, -49951=>13971, -49952=>13972, -49953=>13973, -49954=>13974, -49955=>13975, -49958=>13976, -49959=>13977, -49962=>13978, -49963=>13979, -49964=>13980, -49965=>13981, -49966=>13982, -49967=>13983, -49968=>13984, -49969=>13985, -49970=>13986, -49971=>13987, -49972=>13988, -49973=>13989, -49974=>13990, -49975=>13991, -49976=>13992, -49977=>13993, -49978=>13994, -49979=>13995, -49980=>13996, -49981=>13997, -49982=>13998, -49983=>13999, -49984=>14000, -49985=>14001, -49986=>14002, -49987=>14003, -49988=>14004, -49990=>14005, -49991=>14006, -49992=>14007, -49993=>14008, -49994=>14009, -49995=>14010, -49996=>14011, -49997=>14012, -49998=>14013, -49999=>14014, -50000=>14015, -50001=>14016, -50002=>14017, -50003=>14018, -50004=>14019, -50005=>14020, -50006=>14021, -50007=>14022, -50008=>14023, -50009=>14024, -50010=>14025, -50011=>14026, -50012=>14027, -50013=>14028, -50014=>14029, -50015=>14030, -50016=>14031, -50017=>14032, -50018=>14033, -50019=>14034, -50020=>14035, -50021=>14036, -50022=>14037, -50023=>14038, -50026=>14039, -50027=>14040, -50029=>14041, -50030=>14042, -50031=>14043, -50033=>14044, -50035=>14045, -50036=>14046, -50037=>14047, -50038=>14048, -50039=>14049, -50042=>14050, -50043=>14051, -50046=>14052, -50047=>14053, -50048=>14054, -50049=>14055, -50050=>14056, -50051=>14057, -50053=>14058, -50054=>14059, -50055=>14060, -50057=>14061, -50058=>14062, -50059=>14063, -50061=>14064, -50062=>14065, -50063=>14066, -50064=>14067, -50065=>14068, -50066=>14069, -50067=>14070, -50068=>14071, -50069=>14072, -50070=>14073, -50071=>14074, -50072=>14075, -50073=>14076, -50074=>14077, -50075=>14078, -50076=>14079, -50077=>14080, -50078=>14081, -50079=>14082, -50080=>14083, -50081=>14084, -50082=>14085, -50083=>14086, -50084=>14087, -50085=>14088, -50086=>14089, -50087=>14090, -50088=>14091, -50089=>14092, -50090=>14093, -50091=>14094, -50092=>14095, -50093=>14096, -50094=>14097, -50095=>14098, -50096=>14099, -50097=>14100, -50098=>14101, -50099=>14102, -50100=>14103, -50101=>14104, -50102=>14105, -50103=>14106, -50104=>14107, -50105=>14108, -50106=>14109, -50107=>14110, -50108=>14111, -50109=>14112, -50110=>14113, -50111=>14114, -50113=>14115, -50114=>14116, -50115=>14117, -50116=>14118, -50117=>14119, -50118=>14120, -50119=>14121, -50120=>14122, -50121=>14123, -50122=>14124, -50123=>14125, -50124=>14126, -50125=>14127, -50126=>14128, -50127=>14129, -50128=>14130, -50129=>14131, -50130=>14132, -50131=>14133, -50132=>14134, -50133=>14135, -50134=>14136, -50135=>14137, -50138=>14138, -50139=>14139, -50141=>14140, -50142=>14141, -50145=>14142, -50147=>14143, -50148=>14144, -50149=>14145, -50150=>14146, -50151=>14147, -50154=>14148, -50155=>14149, -50156=>14150, -50158=>14151, -50159=>14152, -50160=>14153, -50161=>14154, -50162=>14155, -50163=>14156, -50166=>14157, -50167=>14158, -50169=>14159, -50170=>14160, -50171=>14161, -50172=>14162, -50173=>14163, -50174=>14164, -50175=>14165, -50176=>14166, -50177=>14167, -50178=>14168, -50179=>14169, -50180=>14170, -50181=>14171, -50182=>14172, -50183=>14173, -50185=>14174, -50186=>14175, -50187=>14176, -50188=>14177, -50189=>14178, -50190=>14179, -50191=>14180, -50193=>14181, -50194=>14182, -50195=>14183, -50196=>14184, -50197=>14185, -50198=>14186, -50199=>14187, -50200=>14188, -50201=>14189, -50202=>14190, -50203=>14191, -50204=>14192, -50205=>14193, -50206=>14194, -50207=>14195, -50208=>14196, -50209=>14197, -50210=>14198, -50211=>14199, -50213=>14200, -50214=>14201, -50215=>14202, -50216=>14203, -50217=>14204, -50218=>14205, -50219=>14206, -50221=>14207, -50222=>14208, -50223=>14209, -50225=>14210, -50226=>14211, -50227=>14212, -50229=>14213, -50230=>14214, -50231=>14215, -50232=>14216, -50233=>14217, -50234=>14218, -50235=>14219, -50238=>14220, -50239=>14221, -50240=>14222, -50241=>14223, -50242=>14224, -50243=>14225, -50244=>14226, -50245=>14227, -50246=>14228, -50247=>14229, -50249=>14230, -50250=>14231, -50251=>14232, -50252=>14233, -50253=>14234, -50254=>14235, -50255=>14236, -50256=>14237, -50257=>14238, -50258=>14239, -50259=>14240, -50260=>14241, -50261=>14242, -50262=>14243, -50263=>14244, -50264=>14245, -50265=>14246, -50266=>14247, -50267=>14248, -50268=>14249, -50269=>14250, -50270=>14251, -50271=>14252, -50272=>14253, -50273=>14254, -50274=>14255, -50275=>14256, -50278=>14257, -50279=>14258, -50281=>14259, -50282=>14260, -50283=>14261, -50285=>14262, -50286=>14263, -50287=>14264, -50288=>14265, -50289=>14266, -50290=>14267, -50291=>14268, -50294=>14269, -50295=>14270, -50296=>14271, -50298=>14272, -50299=>14273, -50300=>14274, -50301=>14275, -50302=>14276, -50303=>14277, -50305=>14278, -50306=>14279, -50307=>14280, -50308=>14281, -50309=>14282, -50310=>14283, -50311=>14284, -50312=>14285, -50313=>14286, -50314=>14287, -50315=>14288, -50316=>14289, -50317=>14290, -50318=>14291, -50319=>14292, -50320=>14293, -50321=>14294, -50322=>14295, -50323=>14296, -50325=>14297, -50326=>14298, -50327=>14299, -50328=>14300, -50329=>14301, -50330=>14302, -50331=>14303, -50333=>14304, -50334=>14305, -50335=>14306, -50336=>14307, -50337=>14308, -50338=>14309, -50339=>14310, -50340=>14311, -50341=>14312, -50342=>14313, -50343=>14314, -50344=>14315, -50345=>14316, -50346=>14317, -50347=>14318, -50348=>14319, -50349=>14320, -50350=>14321, -50351=>14322, -50352=>14323, -50353=>14324, -50354=>14325, -50355=>14326, -50356=>14327, -50357=>14328, -50358=>14329, -50359=>14330, -50361=>14331, -50362=>14332, -50363=>14333, -50365=>14334, -50366=>14335, -50367=>14336, -50368=>14337, -50369=>14338, -50370=>14339, -50371=>14340, -50372=>14341, -50373=>14342, -50374=>14343, -50375=>14344, -50376=>14345, -50377=>14346, -50378=>14347, -50379=>14348, -50380=>14349, -50381=>14350, -50382=>14351, -50383=>14352, -50384=>14353, -50385=>14354, -50386=>14355, -50387=>14356, -50388=>14357, -50389=>14358, -50390=>14359, -50391=>14360, -50392=>14361, -50393=>14362, -50394=>14363, -50395=>14364, -50396=>14365, -50397=>14366, -50398=>14367, -50399=>14368, -50400=>14369, -50401=>14370, -50402=>14371, -50403=>14372, -50404=>14373, -50405=>14374, -50406=>14375, -50407=>14376, -50408=>14377, -50410=>14378, -50411=>14379, -50412=>14380, -50413=>14381, -50414=>14382, -50415=>14383, -50418=>14384, -50419=>14385, -50421=>14386, -50422=>14387, -50423=>14388, -50425=>14389, -50427=>14390, -50428=>14391, -50429=>14392, -50430=>14393, -50434=>14394, -50435=>14395, -50436=>14396, -50437=>14397, -50438=>14398, -50439=>14399, -50440=>14400, -50441=>14401, -50442=>14402, -50443=>14403, -50445=>14404, -50446=>14405, -50447=>14406, -50449=>14407, -50450=>14408, -50451=>14409, -50453=>14410, -50454=>14411, -50455=>14412, -50456=>14413, -50457=>14414, -50458=>14415, -50459=>14416, -50461=>14417, -50462=>14418, -50463=>14419, -50464=>14420, -50465=>14421, -50466=>14422, -50467=>14423, -50468=>14424, -50469=>14425, -50470=>14426, -50471=>14427, -50474=>14428, -50475=>14429, -50477=>14430, -50478=>14431, -50479=>14432, -50481=>14433, -50482=>14434, -50483=>14435, -50484=>14436, -50485=>14437, -50486=>14438, -50487=>14439, -50490=>14440, -50492=>14441, -50494=>14442, -50495=>14443, -50496=>14444, -50497=>14445, -50498=>14446, -50499=>14447, -50502=>14448, -50503=>14449, -50507=>14450, -50511=>14451, -50512=>14452, -50513=>14453, -50514=>14454, -50518=>14455, -50522=>14456, -50523=>14457, -50524=>14458, -50527=>14459, -50530=>14460, -50531=>14461, -50533=>14462, -50534=>14463, -50535=>14464, -50537=>14465, -50538=>14466, -50539=>14467, -50540=>14468, -50541=>14469, -50542=>14470, -50543=>14471, -50546=>14472, -50550=>14473, -50551=>14474, -50552=>14475, -50553=>14476, -50554=>14477, -50555=>14478, -50558=>14479, -50559=>14480, -50561=>14481, -50562=>14482, -50563=>14483, -50565=>14484, -50566=>14485, -50568=>14486, -50569=>14487, -50570=>14488, -50571=>14489, -50574=>14490, -50576=>14491, -50578=>14492, -50579=>14493, -50580=>14494, -50582=>14495, -50585=>14496, -50586=>14497, -50587=>14498, -50589=>14499, -50590=>14500, -50591=>14501, -50593=>14502, -50594=>14503, -50595=>14504, -50596=>14505, -50597=>14506, -50598=>14507, -50599=>14508, -50600=>14509, -50602=>14510, -50603=>14511, -50604=>14512, -50605=>14513, -50606=>14514, -50607=>14515, -50608=>14516, -50609=>14517, -50610=>14518, -50611=>14519, -50614=>14520, -50615=>14521, -50618=>14522, -50623=>14523, -50624=>14524, -50625=>14525, -50626=>14526, -50627=>14527, -50635=>14528, -50637=>14529, -50639=>14530, -50642=>14531, -50643=>14532, -50645=>14533, -50646=>14534, -50647=>14535, -50649=>14536, -50650=>14537, -50651=>14538, -50652=>14539, -50653=>14540, -50654=>14541, -50655=>14542, -50658=>14543, -50660=>14544, -50662=>14545, -50663=>14546, -50664=>14547, -50665=>14548, -50666=>14549, -50667=>14550, -50671=>14551, -50673=>14552, -50674=>14553, -50675=>14554, -50677=>14555, -50680=>14556, -50681=>14557, -50682=>14558, -50683=>14559, -50690=>14560, -50691=>14561, -50692=>14562, -50697=>14563, -50698=>14564, -50699=>14565, -50701=>14566, -50702=>14567, -50703=>14568, -50705=>14569, -50706=>14570, -50707=>14571, -50708=>14572, -50709=>14573, -50710=>14574, -50711=>14575, -50714=>14576, -50717=>14577, -50718=>14578, -50719=>14579, -50720=>14580, -50721=>14581, -50722=>14582, -50723=>14583, -50726=>14584, -50727=>14585, -50729=>14586, -50730=>14587, -50731=>14588, -50735=>14589, -50737=>14590, -50738=>14591, -50742=>14592, -50744=>14593, -50746=>14594, -50748=>14595, -50749=>14596, -50750=>14597, -50751=>14598, -50754=>14599, -50755=>14600, -50757=>14601, -50758=>14602, -50759=>14603, -50761=>14604, -50762=>14605, -50763=>14606, -50764=>14607, -50765=>14608, -50766=>14609, -50767=>14610, -50770=>14611, -50774=>14612, -50775=>14613, -50776=>14614, -50777=>14615, -50778=>14616, -50779=>14617, -50782=>14618, -50783=>14619, -50785=>14620, -50786=>14621, -50787=>14622, -50788=>14623, -50789=>14624, -50790=>14625, -50791=>14626, -50792=>14627, -50793=>14628, -50794=>14629, -50795=>14630, -50797=>14631, -50798=>14632, -50800=>14633, -50802=>14634, -50803=>14635, -50804=>14636, -50805=>14637, -50806=>14638, -50807=>14639, -50810=>14640, -50811=>14641, -50813=>14642, -50814=>14643, -50815=>14644, -50817=>14645, -50818=>14646, -50819=>14647, -50820=>14648, -50821=>14649, -50822=>14650, -50823=>14651, -50826=>14652, -50828=>14653, -50830=>14654, -50831=>14655, -50832=>14656, -50833=>14657, -50834=>14658, -50835=>14659, -50838=>14660, -50839=>14661, -50841=>14662, -50842=>14663, -50843=>14664, -50845=>14665, -50846=>14666, -50847=>14667, -50848=>14668, -50849=>14669, -50850=>14670, -50851=>14671, -50854=>14672, -50856=>14673, -50858=>14674, -50859=>14675, -50860=>14676, -50861=>14677, -50862=>14678, -50863=>14679, -50866=>14680, -50867=>14681, -50869=>14682, -50870=>14683, -50871=>14684, -50875=>14685, -50876=>14686, -50877=>14687, -50878=>14688, -50879=>14689, -50882=>14690, -50884=>14691, -50886=>14692, -50887=>14693, -50888=>14694, -50889=>14695, -50890=>14696, -50891=>14697, -50894=>14698, -50895=>14699, -50897=>14700, -50898=>14701, -50899=>14702, -50901=>14703, -50902=>14704, -50903=>14705, -50904=>14706, -50905=>14707, -50906=>14708, -50907=>14709, -50910=>14710, -50911=>14711, -50914=>14712, -50915=>14713, -50916=>14714, -50917=>14715, -50918=>14716, -50919=>14717, -50922=>14718, -50923=>14719, -50925=>14720, -50926=>14721, -50927=>14722, -50929=>14723, -50930=>14724, -50931=>14725, -50932=>14726, -50933=>14727, -50934=>14728, -50935=>14729, -50938=>14730, -50939=>14731, -50940=>14732, -50942=>14733, -50943=>14734, -50944=>14735, -50945=>14736, -50946=>14737, -50947=>14738, -50950=>14739, -50951=>14740, -50953=>14741, -50954=>14742, -50955=>14743, -50957=>14744, -50958=>14745, -50959=>14746, -50960=>14747, -50961=>14748, -50962=>14749, -50963=>14750, -50966=>14751, -50968=>14752, -50970=>14753, -50971=>14754, -50972=>14755, -50973=>14756, -50974=>14757, -50975=>14758, -50978=>14759, -50979=>14760, -50981=>14761, -50982=>14762, -50983=>14763, -50985=>14764, -50986=>14765, -50987=>14766, -50988=>14767, -50989=>14768, -50990=>14769, -50991=>14770, -50994=>14771, -50996=>14772, -50998=>14773, -51000=>14774, -51001=>14775, -51002=>14776, -51003=>14777, -51006=>14778, -51007=>14779, -51009=>14780, -51010=>14781, -51011=>14782, -51013=>14783, -51014=>14784, -51015=>14785, -51016=>14786, -51017=>14787, -51019=>14788, -51022=>14789, -51024=>14790, -51033=>14791, -51034=>14792, -51035=>14793, -51037=>14794, -51038=>14795, -51039=>14796, -51041=>14797, -51042=>14798, -51043=>14799, -51044=>14800, -51045=>14801, -51046=>14802, -51047=>14803, -51049=>14804, -51050=>14805, -51052=>14806, -51053=>14807, -51054=>14808, -51055=>14809, -51056=>14810, -51057=>14811, -51058=>14812, -51059=>14813, -51062=>14814, -51063=>14815, -51065=>14816, -51066=>14817, -51067=>14818, -51071=>14819, -51072=>14820, -51073=>14821, -51074=>14822, -51078=>14823, -51083=>14824, -51084=>14825, -51085=>14826, -51087=>14827, -51090=>14828, -51091=>14829, -51093=>14830, -51097=>14831, -51099=>14832, -51100=>14833, -51101=>14834, -51102=>14835, -51103=>14836, -51106=>14837, -51111=>14838, -51112=>14839, -51113=>14840, -51114=>14841, -51115=>14842, -51118=>14843, -51119=>14844, -51121=>14845, -51122=>14846, -51123=>14847, -51125=>14848, -51126=>14849, -51127=>14850, -51128=>14851, -51129=>14852, -51130=>14853, -51131=>14854, -51134=>14855, -51138=>14856, -51139=>14857, -51140=>14858, -51141=>14859, -51142=>14860, -51143=>14861, -51146=>14862, -51147=>14863, -51149=>14864, -51151=>14865, -51153=>14866, -51154=>14867, -51155=>14868, -51156=>14869, -51157=>14870, -51158=>14871, -51159=>14872, -51161=>14873, -51162=>14874, -51163=>14875, -51164=>14876, -51166=>14877, -51167=>14878, -51168=>14879, -51169=>14880, -51170=>14881, -51171=>14882, -51173=>14883, -51174=>14884, -51175=>14885, -51177=>14886, -51178=>14887, -51179=>14888, -51181=>14889, -51182=>14890, -51183=>14891, -51184=>14892, -51185=>14893, -51186=>14894, -51187=>14895, -51188=>14896, -51189=>14897, -51190=>14898, -51191=>14899, -51192=>14900, -51193=>14901, -51194=>14902, -51195=>14903, -51196=>14904, -51197=>14905, -51198=>14906, -51199=>14907, -51202=>14908, -51203=>14909, -51205=>14910, -51206=>14911, -51207=>14912, -51209=>14913, -51211=>14914, -51212=>14915, -51213=>14916, -51214=>14917, -51215=>14918, -51218=>14919, -51220=>14920, -51223=>14921, -51224=>14922, -51225=>14923, -51226=>14924, -51227=>14925, -51230=>14926, -51231=>14927, -51233=>14928, -51234=>14929, -51235=>14930, -51237=>14931, -51238=>14932, -51239=>14933, -51240=>14934, -51241=>14935, -51242=>14936, -51243=>14937, -51246=>14938, -51248=>14939, -51250=>14940, -51251=>14941, -51252=>14942, -51253=>14943, -51254=>14944, -51255=>14945, -51257=>14946, -51258=>14947, -51259=>14948, -51261=>14949, -51262=>14950, -51263=>14951, -51265=>14952, -51266=>14953, -51267=>14954, -51268=>14955, -51269=>14956, -51270=>14957, -51271=>14958, -51274=>14959, -51275=>14960, -51278=>14961, -51279=>14962, -51280=>14963, -51281=>14964, -51282=>14965, -51283=>14966, -51285=>14967, -51286=>14968, -51287=>14969, -51288=>14970, -51289=>14971, -51290=>14972, -51291=>14973, -51292=>14974, -51293=>14975, -51294=>14976, -51295=>14977, -51296=>14978, -51297=>14979, -51298=>14980, -51299=>14981, -51300=>14982, -51301=>14983, -51302=>14984, -51303=>14985, -51304=>14986, -51305=>14987, -51306=>14988, -51307=>14989, -51308=>14990, -51309=>14991, -51310=>14992, -51311=>14993, -51314=>14994, -51315=>14995, -51317=>14996, -51318=>14997, -51319=>14998, -51321=>14999, -51323=>15000, -51324=>15001, -51325=>15002, -51326=>15003, -51327=>15004, -51330=>15005, -51332=>15006, -51336=>15007, -51337=>15008, -51338=>15009, -51342=>15010, -51343=>15011, -51344=>15012, -51345=>15013, -51346=>15014, -51347=>15015, -51349=>15016, -51350=>15017, -51351=>15018, -51352=>15019, -51353=>15020, -51354=>15021, -51355=>15022, -51356=>15023, -51358=>15024, -51360=>15025, -51362=>15026, -51363=>15027, -51364=>15028, -51365=>15029, -51366=>15030, -51367=>15031, -51369=>15032, -51370=>15033, -51371=>15034, -51372=>15035, -51373=>15036, -51374=>15037, -51375=>15038, -51376=>15039, -51377=>15040, -51378=>15041, -51379=>15042, -51380=>15043, -51381=>15044, -51382=>15045, -51383=>15046, -51384=>15047, -51385=>15048, -51386=>15049, -51387=>15050, -51390=>15051, -51391=>15052, -51392=>15053, -51393=>15054, -51394=>15055, -51395=>15056, -51397=>15057, -51398=>15058, -51399=>15059, -51401=>15060, -51402=>15061, -51403=>15062, -51405=>15063, -51406=>15064, -51407=>15065, -51408=>15066, -51409=>15067, -51410=>15068, -51411=>15069, -51414=>15070, -51416=>15071, -51418=>15072, -51419=>15073, -51420=>15074, -51421=>15075, -51422=>15076, -51423=>15077, -51426=>15078, -51427=>15079, -51429=>15080, -51430=>15081, -51431=>15082, -51432=>15083, -51433=>15084, -51434=>15085, -51435=>15086, -51436=>15087, -51437=>15088, -51438=>15089, -51439=>15090, -51440=>15091, -51441=>15092, -51442=>15093, -51443=>15094, -51444=>15095, -51446=>15096, -51447=>15097, -51448=>15098, -51449=>15099, -51450=>15100, -51451=>15101, -51454=>15102, -51455=>15103, -51457=>15104, -51458=>15105, -51459=>15106, -51463=>15107, -51464=>15108, -51465=>15109, -51466=>15110, -51467=>15111, -51470=>15112, -51472=>15113, -51474=>15114, -51475=>15115, -51476=>15116, -51477=>15117, -51478=>15118, -51479=>15119, -51481=>15120, -51482=>15121, -51483=>15122, -51484=>15123, -51485=>15124, -51486=>15125, -51487=>15126, -51488=>15127, -51489=>15128, -51490=>15129, -51491=>15130, -51492=>15131, -51493=>15132, -51494=>15133, -51495=>15134, -51496=>15135, -51497=>15136, -51498=>15137, -51499=>15138, -51501=>15139, -51502=>15140, -51503=>15141, -51504=>15142, -51505=>15143, -51506=>15144, -51507=>15145, -51509=>15146, -51510=>15147, -51511=>15148, -51512=>15149, -51513=>15150, -51514=>15151, -51515=>15152, -51516=>15153, -51517=>15154, -51518=>15155, -51519=>15156, -51520=>15157, -51521=>15158, -51522=>15159, -51523=>15160, -51524=>15161, -51525=>15162, -51526=>15163, -51527=>15164, -51528=>15165, -51529=>15166, -51530=>15167, -51531=>15168, -51532=>15169, -51533=>15170, -51534=>15171, -51535=>15172, -51538=>15173, -51539=>15174, -51541=>15175, -51542=>15176, -51543=>15177, -51545=>15178, -51546=>15179, -51547=>15180, -51548=>15181, -51549=>15182, -51550=>15183, -51551=>15184, -51554=>15185, -51556=>15186, -51557=>15187, -51558=>15188, -51559=>15189, -51560=>15190, -51561=>15191, -51562=>15192, -51563=>15193, -51565=>15194, -51566=>15195, -51567=>15196, -51569=>15197, -51570=>15198, -51571=>15199, -51573=>15200, -51574=>15201, -51575=>15202, -51576=>15203, -51577=>15204, -51578=>15205, -51579=>15206, -51581=>15207, -51582=>15208, -51583=>15209, -51584=>15210, -51585=>15211, -51586=>15212, -51587=>15213, -51588=>15214, -51589=>15215, -51590=>15216, -51591=>15217, -51594=>15218, -51595=>15219, -51597=>15220, -51598=>15221, -51599=>15222, -51601=>15223, -51602=>15224, -51603=>15225, -51604=>15226, -51605=>15227, -51606=>15228, -51607=>15229, -51610=>15230, -51612=>15231, -51614=>15232, -51615=>15233, -51616=>15234, -51617=>15235, -51618=>15236, -51619=>15237, -51620=>15238, -51621=>15239, -51622=>15240, -51623=>15241, -51624=>15242, -51625=>15243, -51626=>15244, -51627=>15245, -51628=>15246, -51629=>15247, -51630=>15248, -51631=>15249, -51632=>15250, -51633=>15251, -51634=>15252, -51635=>15253, -51636=>15254, -51637=>15255, -51638=>15256, -51639=>15257, -51640=>15258, -51641=>15259, -51642=>15260, -51643=>15261, -51644=>15262, -51645=>15263, -51646=>15264, -51647=>15265, -51650=>15266, -51651=>15267, -51653=>15268, -51654=>15269, -51657=>15270, -51659=>15271, -51660=>15272, -51661=>15273, -51662=>15274, -51663=>15275, -51666=>15276, -51668=>15277, -51671=>15278, -51672=>15279, -51675=>15280, -51678=>15281, -51679=>15282, -51681=>15283, -51683=>15284, -51685=>15285, -51686=>15286, -51688=>15287, -51689=>15288, -51690=>15289, -51691=>15290, -51694=>15291, -51698=>15292, -51699=>15293, -51700=>15294, -51701=>15295, -51702=>15296, -51703=>15297, -51706=>15298, -51707=>15299, -51709=>15300, -51710=>15301, -51711=>15302, -51713=>15303, -51714=>15304, -51715=>15305, -51716=>15306, -51717=>15307, -51718=>15308, -51719=>15309, -51722=>15310, -51726=>15311, -51727=>15312, -51728=>15313, -51729=>15314, -51730=>15315, -51731=>15316, -51733=>15317, -51734=>15318, -51735=>15319, -51737=>15320, -51738=>15321, -51739=>15322, -51740=>15323, -51741=>15324, -51742=>15325, -51743=>15326, -51744=>15327, -51745=>15328, -51746=>15329, -51747=>15330, -51748=>15331, -51749=>15332, -51750=>15333, -51751=>15334, -51752=>15335, -51754=>15336, -51755=>15337, -51756=>15338, -51757=>15339, -51758=>15340, -51759=>15341, -51760=>15342, -51761=>15343, -51762=>15344, -51763=>15345, -51764=>15346, -51765=>15347, -51766=>15348, -51767=>15349, -51768=>15350, -51769=>15351, -51770=>15352, -51771=>15353, -51772=>15354, -51773=>15355, -51774=>15356, -51775=>15357, -51776=>15358, -51777=>15359, -51778=>15360, -51779=>15361, -51780=>15362, -51781=>15363, -51782=>15364, -51783=>15365, -51784=>15366, -51785=>15367, -51786=>15368, -51787=>15369, -51790=>15370, -51791=>15371, -51793=>15372, -51794=>15373, -51795=>15374, -51797=>15375, -51798=>15376, -51799=>15377, -51800=>15378, -51801=>15379, -51802=>15380, -51803=>15381, -51806=>15382, -51810=>15383, -51811=>15384, -51812=>15385, -51813=>15386, -51814=>15387, -51815=>15388, -51817=>15389, -51818=>15390, -51819=>15391, -51820=>15392, -51821=>15393, -51822=>15394, -51823=>15395, -51824=>15396, -51825=>15397, -51826=>15398, -51827=>15399, -51828=>15400, -51829=>15401, -51830=>15402, -51831=>15403, -51832=>15404, -51833=>15405, -51834=>15406, -51835=>15407, -51836=>15408, -51838=>15409, -51839=>15410, -51840=>15411, -51841=>15412, -51842=>15413, -51843=>15414, -51845=>15415, -51846=>15416, -51847=>15417, -51848=>15418, -51849=>15419, -51850=>15420, -51851=>15421, -51852=>15422, -51853=>15423, -51854=>15424, -51855=>15425, -51856=>15426, -51857=>15427, -51858=>15428, -51859=>15429, -51860=>15430, -51861=>15431, -51862=>15432, -51863=>15433, -51865=>15434, -51866=>15435, -51867=>15436, -51868=>15437, -51869=>15438, -51870=>15439, -51871=>15440, -51872=>15441, -51873=>15442, -51874=>15443, -51875=>15444, -51876=>15445, -51877=>15446, -51878=>15447, -51879=>15448, -51880=>15449, -51881=>15450, -51882=>15451, -51883=>15452, -51884=>15453, -51885=>15454, -51886=>15455, -51887=>15456, -51888=>15457, -51889=>15458, -51890=>15459, -51891=>15460, -51892=>15461, -51893=>15462, -51894=>15463, -51895=>15464, -51896=>15465, -51897=>15466, -51898=>15467, -51899=>15468, -51902=>15469, -51903=>15470, -51905=>15471, -51906=>15472, -51907=>15473, -51909=>15474, -51910=>15475, -51911=>15476, -51912=>15477, -51913=>15478, -51914=>15479, -51915=>15480, -51918=>15481, -51920=>15482, -51922=>15483, -51924=>15484, -51925=>15485, -51926=>15486, -51927=>15487, -51930=>15488, -51931=>15489, -51932=>15490, -51933=>15491, -51934=>15492, -51935=>15493, -51937=>15494, -51938=>15495, -51939=>15496, -51940=>15497, -51941=>15498, -51942=>15499, -51943=>15500, -51944=>15501, -51945=>15502, -51946=>15503, -51947=>15504, -51949=>15505, -51950=>15506, -51951=>15507, -51952=>15508, -51953=>15509, -51954=>15510, -51955=>15511, -51957=>15512, -51958=>15513, -51959=>15514, -51960=>15515, -51961=>15516, -51962=>15517, -51963=>15518, -51964=>15519, -51965=>15520, -51966=>15521, -51967=>15522, -51968=>15523, -51969=>15524, -51970=>15525, -51971=>15526, -51972=>15527, -51973=>15528, -51974=>15529, -51975=>15530, -51977=>15531, -51978=>15532, -51979=>15533, -51980=>15534, -51981=>15535, -51982=>15536, -51983=>15537, -51985=>15538, -51986=>15539, -51987=>15540, -51989=>15541, -51990=>15542, -51991=>15543, -51993=>15544, -51994=>15545, -51995=>15546, -51996=>15547, -51997=>15548, -51998=>15549, -51999=>15550, -52002=>15551, -52003=>15552, -52004=>15553, -52005=>15554, -52006=>15555, -52007=>15556, -52008=>15557, -52009=>15558, -52010=>15559, -52011=>15560, -52012=>15561, -52013=>15562, -52014=>15563, -52015=>15564, -52016=>15565, -52017=>15566, -52018=>15567, -52019=>15568, -52020=>15569, -52021=>15570, -52022=>15571, -52023=>15572, -52024=>15573, -52025=>15574, -52026=>15575, -52027=>15576, -52028=>15577, -52029=>15578, -52030=>15579, -52031=>15580, -52032=>15581, -52034=>15582, -52035=>15583, -52036=>15584, -52037=>15585, -52038=>15586, -52039=>15587, -52042=>15588, -52043=>15589, -52045=>15590, -52046=>15591, -52047=>15592, -52049=>15593, -52050=>15594, -52051=>15595, -52052=>15596, -52053=>15597, -52054=>15598, -52055=>15599, -52058=>15600, -52059=>15601, -52060=>15602, -52062=>15603, -52063=>15604, -52064=>15605, -52065=>15606, -52066=>15607, -52067=>15608, -52069=>15609, -52070=>15610, -52071=>15611, -52072=>15612, -52073=>15613, -52074=>15614, -52075=>15615, -52076=>15616, -52077=>15617, -52078=>15618, -52079=>15619, -52080=>15620, -52081=>15621, -52082=>15622, -52083=>15623, -52084=>15624, -52085=>15625, -52086=>15626, -52087=>15627, -52090=>15628, -52091=>15629, -52092=>15630, -52093=>15631, -52094=>15632, -52095=>15633, -52096=>15634, -52097=>15635, -52098=>15636, -52099=>15637, -52100=>15638, -52101=>15639, -52102=>15640, -52103=>15641, -52104=>15642, -52105=>15643, -52106=>15644, -52107=>15645, -52108=>15646, -52109=>15647, -52110=>15648, -52111=>15649, -52112=>15650, -52113=>15651, -52114=>15652, -52115=>15653, -52116=>15654, -52117=>15655, -52118=>15656, -52119=>15657, -52120=>15658, -52121=>15659, -52122=>15660, -52123=>15661, -52125=>15662, -52126=>15663, -52127=>15664, -52128=>15665, -52129=>15666, -52130=>15667, -52131=>15668, -52132=>15669, -52133=>15670, -52134=>15671, -52135=>15672, -52136=>15673, -52137=>15674, -52138=>15675, -52139=>15676, -52140=>15677, -52141=>15678, -52142=>15679, -52143=>15680, -52144=>15681, -52145=>15682, -52146=>15683, -52147=>15684, -52148=>15685, -52149=>15686, -52150=>15687, -52151=>15688, -52153=>15689, -52154=>15690, -52155=>15691, -52156=>15692, -52157=>15693, -52158=>15694, -52159=>15695, -52160=>15696, -52161=>15697, -52162=>15698, -52163=>15699, -52164=>15700, -52165=>15701, -52166=>15702, -52167=>15703, -52168=>15704, -52169=>15705, -52170=>15706, -52171=>15707, -52172=>15708, -52173=>15709, -52174=>15710, -52175=>15711, -52176=>15712, -52177=>15713, -52178=>15714, -52179=>15715, -52181=>15716, -52182=>15717, -52183=>15718, -52184=>15719, -52185=>15720, -52186=>15721, -52187=>15722, -52188=>15723, -52189=>15724, -52190=>15725, -52191=>15726, -52192=>15727, -52193=>15728, -52194=>15729, -52195=>15730, -52197=>15731, -52198=>15732, -52200=>15733, -52202=>15734, -52203=>15735, -52204=>15736, -52205=>15737, -52206=>15738, -52207=>15739, -52208=>15740, -52209=>15741, -52210=>15742, -52211=>15743, -52212=>15744, -52213=>15745, -52214=>15746, -52215=>15747, -52216=>15748, -52217=>15749, -52218=>15750, -52219=>15751, -52220=>15752, -52221=>15753, -52222=>15754, -52223=>15755, -52224=>15756, -52225=>15757, -52226=>15758, -52227=>15759, -52228=>15760, -52229=>15761, -52230=>15762, -52231=>15763, -52232=>15764, -52233=>15765, -52234=>15766, -52235=>15767, -52238=>15768, -52239=>15769, -52241=>15770, -52242=>15771, -52243=>15772, -52245=>15773, -52246=>15774, -52247=>15775, -52248=>15776, -52249=>15777, -52250=>15778, -52251=>15779, -52254=>15780, -52255=>15781, -52256=>15782, -52259=>15783, -52260=>15784, -52261=>15785, -52262=>15786, -52266=>15787, -52267=>15788, -52269=>15789, -52271=>15790, -52273=>15791, -52274=>15792, -52275=>15793, -52276=>15794, -52277=>15795, -52278=>15796, -52279=>15797, -52282=>15798, -52287=>15799, -52288=>15800, -52289=>15801, -52290=>15802, -52291=>15803, -52294=>15804, -52295=>15805, -52297=>15806, -52298=>15807, -52299=>15808, -52301=>15809, -52302=>15810, -52303=>15811, -52304=>15812, -52305=>15813, -52306=>15814, -52307=>15815, -52310=>15816, -52314=>15817, -52315=>15818, -52316=>15819, -52317=>15820, -52318=>15821, -52319=>15822, -52321=>15823, -52322=>15824, -52323=>15825, -52325=>15826, -52327=>15827, -52329=>15828, -52330=>15829, -52331=>15830, -52332=>15831, -52333=>15832, -52334=>15833, -52335=>15834, -52337=>15835, -52338=>15836, -52339=>15837, -52340=>15838, -52342=>15839, -52343=>15840, -52344=>15841, -52345=>15842, -52346=>15843, -52347=>15844, -52348=>15845, -52349=>15846, -52350=>15847, -52351=>15848, -52352=>15849, -52353=>15850, -52354=>15851, -52355=>15852, -52356=>15853, -52357=>15854, -52358=>15855, -52359=>15856, -52360=>15857, -52361=>15858, -52362=>15859, -52363=>15860, -52364=>15861, -52365=>15862, -52366=>15863, -52367=>15864, -52368=>15865, -52369=>15866, -52370=>15867, -52371=>15868, -52372=>15869, -52373=>15870, -52374=>15871, -52375=>15872, -52378=>15873, -52379=>15874, -52381=>15875, -52382=>15876, -52383=>15877, -52385=>15878, -52386=>15879, -52387=>15880, -52388=>15881, -52389=>15882, -52390=>15883, -52391=>15884, -52394=>15885, -52398=>15886, -52399=>15887, -52400=>15888, -52401=>15889, -52402=>15890, -52403=>15891, -52406=>15892, -52407=>15893, -52409=>15894, -52410=>15895, -52411=>15896, -52413=>15897, -52414=>15898, -52415=>15899, -52416=>15900, -52417=>15901, -52418=>15902, -52419=>15903, -52422=>15904, -52424=>15905, -52426=>15906, -52427=>15907, -52428=>15908, -52429=>15909, -52430=>15910, -52431=>15911, -52433=>15912, -52434=>15913, -52435=>15914, -52437=>15915, -52438=>15916, -52439=>15917, -52440=>15918, -52441=>15919, -52442=>15920, -52443=>15921, -52444=>15922, -52445=>15923, -52446=>15924, -52447=>15925, -52448=>15926, -52449=>15927, -52450=>15928, -52451=>15929, -52453=>15930, -52454=>15931, -52455=>15932, -52456=>15933, -52457=>15934, -52458=>15935, -52459=>15936, -52461=>15937, -52462=>15938, -52463=>15939, -52465=>15940, -52466=>15941, -52467=>15942, -52468=>15943, -52469=>15944, -52470=>15945, -52471=>15946, -52472=>15947, -52473=>15948, -52474=>15949, -52475=>15950, -52476=>15951, -52477=>15952, -52478=>15953, -52479=>15954, -52480=>15955, -52482=>15956, -52483=>15957, -52484=>15958, -52485=>15959, -52486=>15960, -52487=>15961, -52490=>15962, -52491=>15963, -52493=>15964, -52494=>15965, -52495=>15966, -52497=>15967, -52498=>15968, -52499=>15969, -52500=>15970, -52501=>15971, -52502=>15972, -52503=>15973, -52506=>15974, -52508=>15975, -52510=>15976, -52511=>15977, -52512=>15978, -52513=>15979, -52514=>15980, -52515=>15981, -52517=>15982, -52518=>15983, -52519=>15984, -52521=>15985, -52522=>15986, -52523=>15987, -52525=>15988, -52526=>15989, -52527=>15990, -52528=>15991, -52529=>15992, -52530=>15993, -52531=>15994, -52532=>15995, -52533=>15996, -52534=>15997, -52535=>15998, -52536=>15999, -52538=>16000, -52539=>16001, -52540=>16002, -52541=>16003, -52542=>16004, -52543=>16005, -52544=>16006, -52545=>16007, -52546=>16008, -52547=>16009, -52548=>16010, -52549=>16011, -52550=>16012, -52551=>16013, -52552=>16014, -52553=>16015, -52554=>16016, -52555=>16017, -52556=>16018, -52557=>16019, -52558=>16020, -52559=>16021, -52560=>16022, -52561=>16023, -52562=>16024, -52563=>16025, -52564=>16026, -52565=>16027, -52566=>16028, -52567=>16029, -52568=>16030, -52569=>16031, -52570=>16032, -52571=>16033, -52573=>16034, -52574=>16035, -52575=>16036, -52577=>16037, -52578=>16038, -52579=>16039, -52581=>16040, -52582=>16041, -52583=>16042, -52584=>16043, -52585=>16044, -52586=>16045, -52587=>16046, -52590=>16047, -52592=>16048, -52594=>16049, -52595=>16050, -52596=>16051, -52597=>16052, -52598=>16053, -52599=>16054, -52601=>16055, -52602=>16056, -52603=>16057, -52604=>16058, -52605=>16059, -52606=>16060, -52607=>16061, -52608=>16062, -52609=>16063, -52610=>16064, -52611=>16065, -52612=>16066, -52613=>16067, -52614=>16068, -52615=>16069, -52617=>16070, -52618=>16071, -52619=>16072, -52620=>16073, -52621=>16074, -52622=>16075, -52623=>16076, -52624=>16077, -52625=>16078, -52626=>16079, -52627=>16080, -52630=>16081, -52631=>16082, -52633=>16083, -52634=>16084, -52635=>16085, -52637=>16086, -52638=>16087, -52639=>16088, -52640=>16089, -52641=>16090, -52642=>16091, -52643=>16092, -52646=>16093, -52648=>16094, -52650=>16095, -52651=>16096, -52652=>16097, -52653=>16098, -52654=>16099, -52655=>16100, -52657=>16101, -52658=>16102, -52659=>16103, -52660=>16104, -52661=>16105, -52662=>16106, -52663=>16107, -52664=>16108, -52665=>16109, -52666=>16110, -52667=>16111, -52668=>16112, -52669=>16113, -52670=>16114, -52671=>16115, -52672=>16116, -52673=>16117, -52674=>16118, -52675=>16119, -52677=>16120, -52678=>16121, -52679=>16122, -52680=>16123, -52681=>16124, -52682=>16125, -52683=>16126, -52685=>16127, -52686=>16128, -52687=>16129, -52689=>16130, -52690=>16131, -52691=>16132, -52692=>16133, -52693=>16134, -52694=>16135, -52695=>16136, -52696=>16137, -52697=>16138, -52698=>16139, -52699=>16140, -52700=>16141, -52701=>16142, -52702=>16143, -52703=>16144, -52704=>16145, -52705=>16146, -52706=>16147, -52707=>16148, -52708=>16149, -52709=>16150, -52710=>16151, -52711=>16152, -52713=>16153, -52714=>16154, -52715=>16155, -52717=>16156, -52718=>16157, -52719=>16158, -52721=>16159, -52722=>16160, -52723=>16161, -52724=>16162, -52725=>16163, -52726=>16164, -52727=>16165, -52730=>16166, -52732=>16167, -52734=>16168, -52735=>16169, -52736=>16170, -52737=>16171, -52738=>16172, -52739=>16173, -52741=>16174, -52742=>16175, -52743=>16176, -52745=>16177, -52746=>16178, -52747=>16179, -52749=>16180, -52750=>16181, -52751=>16182, -52752=>16183, -52753=>16184, -52754=>16185, -52755=>16186, -52757=>16187, -52758=>16188, -52759=>16189, -52760=>16190, -52762=>16191, -52763=>16192, -52764=>16193, -52765=>16194, -52766=>16195, -52767=>16196, -52770=>16197, -52771=>16198, -52773=>16199, -52774=>16200, -52775=>16201, -52777=>16202, -52778=>16203, -52779=>16204, -52780=>16205, -52781=>16206, -52782=>16207, -52783=>16208, -52786=>16209, -52788=>16210, -52790=>16211, -52791=>16212, -52792=>16213, -52793=>16214, -52794=>16215, -52795=>16216, -52796=>16217, -52797=>16218, -52798=>16219, -52799=>16220, -52800=>16221, -52801=>16222, -52802=>16223, -52803=>16224, -52804=>16225, -52805=>16226, -52806=>16227, -52807=>16228, -52808=>16229, -52809=>16230, -52810=>16231, -52811=>16232, -52812=>16233, -52813=>16234, -52814=>16235, -52815=>16236, -52816=>16237, -52817=>16238, -52818=>16239, -52819=>16240, -52820=>16241, -52821=>16242, -52822=>16243, -52823=>16244, -52826=>16245, -52827=>16246, -52829=>16247, -52830=>16248, -52834=>16249, -52835=>16250, -52836=>16251, -52837=>16252, -52838=>16253, -52839=>16254, -52842=>16255, -52844=>16256, -52846=>16257, -52847=>16258, -52848=>16259, -52849=>16260, -52850=>16261, -52851=>16262, -52854=>16263, -52855=>16264, -52857=>16265, -52858=>16266, -52859=>16267, -52861=>16268, -52862=>16269, -52863=>16270, -52864=>16271, -52865=>16272, -52866=>16273, -52867=>16274, -52870=>16275, -52872=>16276, -52874=>16277, -52875=>16278, -52876=>16279, -52877=>16280, -52878=>16281, -52879=>16282, -52882=>16283, -52883=>16284, -52885=>16285, -52886=>16286, -52887=>16287, -52889=>16288, -52890=>16289, -52891=>16290, -52892=>16291, -52893=>16292, -52894=>16293, -52895=>16294, -52898=>16295, -52902=>16296, -52903=>16297, -52904=>16298, -52905=>16299, -52906=>16300, -52907=>16301, -52910=>16302, -52911=>16303, -52912=>16304, -52913=>16305, -52914=>16306, -52915=>16307, -52916=>16308, -52917=>16309, -52918=>16310, -52919=>16311, -52920=>16312, -52921=>16313, -52922=>16314, -52923=>16315, -52924=>16316, -52925=>16317, -52926=>16318, -52927=>16319, -52928=>16320, -52930=>16321, -52931=>16322, -52932=>16323, -52933=>16324, -52934=>16325, -52935=>16326, -52936=>16327, -52937=>16328, -52938=>16329, -52939=>16330, -52940=>16331, -52941=>16332, -52942=>16333, -52943=>16334, -52944=>16335, -52945=>16336, -52946=>16337, -52947=>16338, -52948=>16339, -52949=>16340, -52950=>16341, -52951=>16342, -52952=>16343, -52953=>16344, -52954=>16345, -52955=>16346, -52956=>16347, -52957=>16348, -52958=>16349, -52959=>16350, -52960=>16351, -52961=>16352, -52962=>16353, -52963=>16354, -52966=>16355, -52967=>16356, -52969=>16357, -52970=>16358, -52973=>16359, -52974=>16360, -52975=>16361, -52976=>16362, -52977=>16363, -52978=>16364, -52979=>16365, -52982=>16366, -52986=>16367, -52987=>16368, -52988=>16369, -52989=>16370, -52990=>16371, -52991=>16372, -52994=>16373, -52995=>16374, -52997=>16375, -52998=>16376, -52999=>16377, -53001=>16378, -53002=>16379, -53003=>16380, -53004=>16381, -53005=>16382, -53006=>16383, -53007=>16384, -53010=>16385, -53012=>16386, -53014=>16387, -53015=>16388, -53016=>16389, -53017=>16390, -53018=>16391, -53019=>16392, -53021=>16393, -53022=>16394, -53023=>16395, -53025=>16396, -53026=>16397, -53027=>16398, -53029=>16399, -53030=>16400, -53031=>16401, -53032=>16402, -53033=>16403, -53034=>16404, -53035=>16405, -53038=>16406, -53042=>16407, -53043=>16408, -53044=>16409, -53045=>16410, -53046=>16411, -53047=>16412, -53049=>16413, -53050=>16414, -53051=>16415, -53052=>16416, -53053=>16417, -53054=>16418, -53055=>16419, -53056=>16420, -53057=>16421, -53058=>16422, -53059=>16423, -53060=>16424, -53061=>16425, -53062=>16426, -53063=>16427, -53064=>16428, -53065=>16429, -53066=>16430, -53067=>16431, -53068=>16432, -53069=>16433, -53070=>16434, -53071=>16435, -53072=>16436, -53073=>16437, -53074=>16438, -53075=>16439, -53078=>16440, -53079=>16441, -53081=>16442, -53082=>16443, -53083=>16444, -53085=>16445, -53086=>16446, -53087=>16447, -53088=>16448, -53089=>16449, -53090=>16450, -53091=>16451, -53094=>16452, -53096=>16453, -53098=>16454, -53099=>16455, -53100=>16456, -53101=>16457, -53102=>16458, -53103=>16459, -53106=>16460, -53107=>16461, -53109=>16462, -53110=>16463, -53111=>16464, -53113=>16465, -53114=>16466, -53115=>16467, -53116=>16468, -53117=>16469, -53118=>16470, -53119=>16471, -53121=>16472, -53122=>16473, -53123=>16474, -53124=>16475, -53126=>16476, -53127=>16477, -53128=>16478, -53129=>16479, -53130=>16480, -53131=>16481, -53133=>16482, -53134=>16483, -53135=>16484, -53136=>16485, -53137=>16486, -53138=>16487, -53139=>16488, -53140=>16489, -53141=>16490, -53142=>16491, -53143=>16492, -53144=>16493, -53145=>16494, -53146=>16495, -53147=>16496, -53148=>16497, -53149=>16498, -53150=>16499, -53151=>16500, -53152=>16501, -53154=>16502, -53155=>16503, -53156=>16504, -53157=>16505, -53158=>16506, -53159=>16507, -53161=>16508, -53162=>16509, -53163=>16510, -53164=>16511, -53165=>16512, -53166=>16513, -53167=>16514, -53169=>16515, -53170=>16516, -53171=>16517, -53172=>16518, -53173=>16519, -53174=>16520, -53175=>16521, -53176=>16522, -53177=>16523, -53178=>16524, -53179=>16525, -53180=>16526, -53181=>16527, -53182=>16528, -53183=>16529, -53184=>16530, -53185=>16531, -53186=>16532, -53187=>16533, -53189=>16534, -53190=>16535, -53191=>16536, -53192=>16537, -53193=>16538, -53194=>16539, -53195=>16540, -53196=>16541, -53197=>16542, -53198=>16543, -53199=>16544, -53200=>16545, -53201=>16546, -53202=>16547, -53203=>16548, -53204=>16549, -53205=>16550, -53206=>16551, -53207=>16552, -53208=>16553, -53209=>16554, -53210=>16555, -53211=>16556, -53212=>16557, -53213=>16558, -53214=>16559, -53215=>16560, -53218=>16561, -53219=>16562, -53221=>16563, -53222=>16564, -53223=>16565, -53225=>16566, -53226=>16567, -53227=>16568, -53228=>16569, -53229=>16570, -53230=>16571, -53231=>16572, -53234=>16573, -53236=>16574, -53238=>16575, -53239=>16576, -53240=>16577, -53241=>16578, -53242=>16579, -53243=>16580, -53245=>16581, -53246=>16582, -53247=>16583, -53249=>16584, -53250=>16585, -53251=>16586, -53253=>16587, -53254=>16588, -53255=>16589, -53256=>16590, -53257=>16591, -53258=>16592, -53259=>16593, -53260=>16594, -53261=>16595, -53262=>16596, -53263=>16597, -53264=>16598, -53266=>16599, -53267=>16600, -53268=>16601, -53269=>16602, -53270=>16603, -53271=>16604, -53273=>16605, -53274=>16606, -53275=>16607, -53276=>16608, -53277=>16609, -53278=>16610, -53279=>16611, -53280=>16612, -53281=>16613, -53282=>16614, -53283=>16615, -53284=>16616, -53285=>16617, -53286=>16618, -53287=>16619, -53288=>16620, -53289=>16621, -53290=>16622, -53291=>16623, -53292=>16624, -53294=>16625, -53295=>16626, -53296=>16627, -53297=>16628, -53298=>16629, -53299=>16630, -53302=>16631, -53303=>16632, -53305=>16633, -53306=>16634, -53307=>16635, -53309=>16636, -53310=>16637, -53311=>16638, -53312=>16639, -53313=>16640, -53314=>16641, -53315=>16642, -53318=>16643, -53320=>16644, -53322=>16645, -53323=>16646, -53324=>16647, -53325=>16648, -53326=>16649, -53327=>16650, -53329=>16651, -53330=>16652, -53331=>16653, -53333=>16654, -53334=>16655, -53335=>16656, -53337=>16657, -53338=>16658, -53339=>16659, -53340=>16660, -53341=>16661, -53342=>16662, -53343=>16663, -53345=>16664, -53346=>16665, -53347=>16666, -53348=>16667, -53349=>16668, -53350=>16669, -53351=>16670, -53352=>16671, -53353=>16672, -53354=>16673, -53355=>16674, -53358=>16675, -53359=>16676, -53361=>16677, -53362=>16678, -53363=>16679, -53365=>16680, -53366=>16681, -53367=>16682, -53368=>16683, -53369=>16684, -53370=>16685, -53371=>16686, -53374=>16687, -53375=>16688, -53376=>16689, -53378=>16690, -53379=>16691, -53380=>16692, -53381=>16693, -53382=>16694, -53383=>16695, -53384=>16696, -53385=>16697, -53386=>16698, -53387=>16699, -53388=>16700, -53389=>16701, -53390=>16702, -53391=>16703, -53392=>16704, -53393=>16705, -53394=>16706, -53395=>16707, -53396=>16708, -53397=>16709, -53398=>16710, -53399=>16711, -53400=>16712, -53401=>16713, -53402=>16714, -53403=>16715, -53404=>16716, -53405=>16717, -53406=>16718, -53407=>16719, -53408=>16720, -53409=>16721, -53410=>16722, -53411=>16723, -53414=>16724, -53415=>16725, -53417=>16726, -53418=>16727, -53419=>16728, -53421=>16729, -53422=>16730, -53423=>16731, -53424=>16732, -53425=>16733, -53426=>16734, -53427=>16735, -53430=>16736, -53432=>16737, -53434=>16738, -53435=>16739, -53436=>16740, -53437=>16741, -53438=>16742, -53439=>16743, -53442=>16744, -53443=>16745, -53445=>16746, -53446=>16747, -53447=>16748, -53450=>16749, -53451=>16750, -53452=>16751, -53453=>16752, -53454=>16753, -53455=>16754, -53458=>16755, -53462=>16756, -53463=>16757, -53464=>16758, -53465=>16759, -53466=>16760, -53467=>16761, -53470=>16762, -53471=>16763, -53473=>16764, -53474=>16765, -53475=>16766, -53477=>16767, -53478=>16768, -53479=>16769, -53480=>16770, -53481=>16771, -53482=>16772, -53483=>16773, -53486=>16774, -53490=>16775, -53491=>16776, -53492=>16777, -53493=>16778, -53494=>16779, -53495=>16780, -53497=>16781, -53498=>16782, -53499=>16783, -53500=>16784, -53501=>16785, -53502=>16786, -53503=>16787, -53504=>16788, -53505=>16789, -53506=>16790, -53507=>16791, -53508=>16792, -53509=>16793, -53510=>16794, -53511=>16795, -53512=>16796, -53513=>16797, -53514=>16798, -53515=>16799, -53516=>16800, -53518=>16801, -53519=>16802, -53520=>16803, -53521=>16804, -53522=>16805, -53523=>16806, -53524=>16807, -53525=>16808, -53526=>16809, -53527=>16810, -53528=>16811, -53529=>16812, -53530=>16813, -53531=>16814, -53532=>16815, -53533=>16816, -53534=>16817, -53535=>16818, -53536=>16819, -53537=>16820, -53538=>16821, -53539=>16822, -53540=>16823, -53541=>16824, -53542=>16825, -53543=>16826, -53544=>16827, -53545=>16828, -53546=>16829, -53547=>16830, -53548=>16831, -53549=>16832, -53550=>16833, -53551=>16834, -53554=>16835, -53555=>16836, -53557=>16837, -53558=>16838, -53559=>16839, -53561=>16840, -53563=>16841, -53564=>16842, -53565=>16843, -53566=>16844, -53567=>16845, -53570=>16846, -53574=>16847, -53575=>16848, -53576=>16849, -53577=>16850, -53578=>16851, -53579=>16852, -53582=>16853, -53583=>16854, -53585=>16855, -53586=>16856, -53587=>16857, -53589=>16858, -53590=>16859, -53591=>16860, -53592=>16861, -53593=>16862, -53594=>16863, -53595=>16864, -53598=>16865, -53600=>16866, -53602=>16867, -53603=>16868, -53604=>16869, -53605=>16870, -53606=>16871, -53607=>16872, -53609=>16873, -53610=>16874, -53611=>16875, -53613=>16876, -53614=>16877, -53615=>16878, -53616=>16879, -53617=>16880, -53618=>16881, -53619=>16882, -53620=>16883, -53621=>16884, -53622=>16885, -53623=>16886, -53624=>16887, -53625=>16888, -53626=>16889, -53627=>16890, -53629=>16891, -53630=>16892, -53631=>16893, -53632=>16894, -53633=>16895, -53634=>16896, -53635=>16897, -53637=>16898, -53638=>16899, -53639=>16900, -53641=>16901, -53642=>16902, -53643=>16903, -53644=>16904, -53645=>16905, -53646=>16906, -53647=>16907, -53648=>16908, -53649=>16909, -53650=>16910, -53651=>16911, -53652=>16912, -53653=>16913, -53654=>16914, -53655=>16915, -53656=>16916, -53657=>16917, -53658=>16918, -53659=>16919, -53660=>16920, -53661=>16921, -53662=>16922, -53663=>16923, -53666=>16924, -53667=>16925, -53669=>16926, -53670=>16927, -53671=>16928, -53673=>16929, -53674=>16930, -53675=>16931, -53676=>16932, -53677=>16933, -53678=>16934, -53679=>16935, -53682=>16936, -53684=>16937, -53686=>16938, -53687=>16939, -53688=>16940, -53689=>16941, -53691=>16942, -53693=>16943, -53694=>16944, -53695=>16945, -53697=>16946, -53698=>16947, -53699=>16948, -53700=>16949, -53701=>16950, -53702=>16951, -53703=>16952, -53704=>16953, -53705=>16954, -53706=>16955, -53707=>16956, -53708=>16957, -53709=>16958, -53710=>16959, -53711=>16960, -53712=>16961, -53713=>16962, -53714=>16963, -53715=>16964, -53716=>16965, -53717=>16966, -53718=>16967, -53719=>16968, -53721=>16969, -53722=>16970, -53723=>16971, -53724=>16972, -53725=>16973, -53726=>16974, -53727=>16975, -53728=>16976, -53729=>16977, -53730=>16978, -53731=>16979, -53732=>16980, -53733=>16981, -53734=>16982, -53735=>16983, -53736=>16984, -53737=>16985, -53738=>16986, -53739=>16987, -53740=>16988, -53741=>16989, -53742=>16990, -53743=>16991, -53744=>16992, -53745=>16993, -53746=>16994, -53747=>16995, -53749=>16996, -53750=>16997, -53751=>16998, -53753=>16999, -53754=>17000, -53755=>17001, -53756=>17002, -53757=>17003, -53758=>17004, -53759=>17005, -53760=>17006, -53761=>17007, -53762=>17008, -53763=>17009, -53764=>17010, -53765=>17011, -53766=>17012, -53768=>17013, -53770=>17014, -53771=>17015, -53772=>17016, -53773=>17017, -53774=>17018, -53775=>17019, -53777=>17020, -53778=>17021, -53779=>17022, -53780=>17023, -53781=>17024, -53782=>17025, -53783=>17026, -53784=>17027, -53785=>17028, -53786=>17029, -53787=>17030, -53788=>17031, -53789=>17032, -53790=>17033, -53791=>17034, -53792=>17035, -53793=>17036, -53794=>17037, -53795=>17038, -53796=>17039, -53797=>17040, -53798=>17041, -53799=>17042, -53800=>17043, -53801=>17044, -53802=>17045, -53803=>17046, -53806=>17047, -53807=>17048, -53809=>17049, -53810=>17050, -53811=>17051, -53813=>17052, -53814=>17053, -53815=>17054, -53816=>17055, -53817=>17056, -53818=>17057, -53819=>17058, -53822=>17059, -53824=>17060, -53826=>17061, -53827=>17062, -53828=>17063, -53829=>17064, -53830=>17065, -53831=>17066, -53833=>17067, -53834=>17068, -53835=>17069, -53836=>17070, -53837=>17071, -53838=>17072, -53839=>17073, -53840=>17074, -53841=>17075, -53842=>17076, -53843=>17077, -53844=>17078, -53845=>17079, -53846=>17080, -53847=>17081, -53848=>17082, -53849=>17083, -53850=>17084, -53851=>17085, -53853=>17086, -53854=>17087, -53855=>17088, -53856=>17089, -53857=>17090, -53858=>17091, -53859=>17092, -53861=>17093, -53862=>17094, -53863=>17095, -53864=>17096, -53865=>17097, -53866=>17098, -53867=>17099, -53868=>17100, -53869=>17101, -53870=>17102, -53871=>17103, -53872=>17104, -53873=>17105, -53874=>17106, -53875=>17107, -53876=>17108, -53877=>17109, -53878=>17110, -53879=>17111, -53880=>17112, -53881=>17113, -53882=>17114, -53883=>17115, -53884=>17116, -53885=>17117, -53886=>17118, -53887=>17119, -53890=>17120, -53891=>17121, -53893=>17122, -53894=>17123, -53895=>17124, -53897=>17125, -53898=>17126, -53899=>17127, -53900=>17128, -53901=>17129, -53902=>17130, -53903=>17131, -53906=>17132, -53907=>17133, -53908=>17134, -53910=>17135, -53911=>17136, -53912=>17137, -53913=>17138, -53914=>17139, -53915=>17140, -53917=>17141, -53918=>17142, -53919=>17143, -53921=>17144, -53922=>17145, -53923=>17146, -53925=>17147, -53926=>17148, -53927=>17149, -53928=>17150, -53929=>17151, -53930=>17152, -53931=>17153, -53933=>17154, -53934=>17155, -53935=>17156, -53936=>17157, -53938=>17158, -53939=>17159, -53940=>17160, -53941=>17161, -53942=>17162, -53943=>17163, -53946=>17164, -53947=>17165, -53949=>17166, -53950=>17167, -53953=>17168, -53955=>17169, -53956=>17170, -53957=>17171, -53958=>17172, -53959=>17173, -53962=>17174, -53964=>17175, -53965=>17176, -53966=>17177, -53967=>17178, -53968=>17179, -53969=>17180, -53970=>17181, -53971=>17182, -53973=>17183, -53974=>17184, -53975=>17185, -53977=>17186, -53978=>17187, -53979=>17188, -53981=>17189, -53982=>17190, -53983=>17191, -53984=>17192, -53985=>17193, -53986=>17194, -53987=>17195, -53990=>17196, -53991=>17197, -53992=>17198, -53993=>17199, -53994=>17200, -53995=>17201, -53996=>17202, -53997=>17203, -53998=>17204, -53999=>17205, -54002=>17206, -54003=>17207, -54005=>17208, -54006=>17209, -54007=>17210, -54009=>17211, -54010=>17212, -54011=>17213, -54012=>17214, -54013=>17215, -54014=>17216, -54015=>17217, -54018=>17218, -54020=>17219, -54022=>17220, -54023=>17221, -54024=>17222, -54025=>17223, -54026=>17224, -54027=>17225, -54031=>17226, -54033=>17227, -54034=>17228, -54035=>17229, -54037=>17230, -54039=>17231, -54040=>17232, -54041=>17233, -54042=>17234, -54043=>17235, -54046=>17236, -54050=>17237, -54051=>17238, -54052=>17239, -54054=>17240, -54055=>17241, -54058=>17242, -54059=>17243, -54061=>17244, -54062=>17245, -54063=>17246, -54065=>17247, -54066=>17248, -54067=>17249, -54068=>17250, -54069=>17251, -54070=>17252, -54071=>17253, -54074=>17254, -54078=>17255, -54079=>17256, -54080=>17257, -54081=>17258, -54082=>17259, -54083=>17260, -54086=>17261, -54087=>17262, -54088=>17263, -54089=>17264, -54090=>17265, -54091=>17266, -54092=>17267, -54093=>17268, -54094=>17269, -54095=>17270, -54096=>17271, -54097=>17272, -54098=>17273, -54099=>17274, -54100=>17275, -54101=>17276, -54102=>17277, -54103=>17278, -54104=>17279, -54105=>17280, -54106=>17281, -54107=>17282, -54108=>17283, -54109=>17284, -54110=>17285, -54111=>17286, -54112=>17287, -54113=>17288, -54114=>17289, -54115=>17290, -54116=>17291, -54117=>17292, -54118=>17293, -54119=>17294, -54120=>17295, -54121=>17296, -54122=>17297, -54123=>17298, -54124=>17299, -54125=>17300, -54126=>17301, -54127=>17302, -54128=>17303, -54129=>17304, -54130=>17305, -54131=>17306, -54132=>17307, -54133=>17308, -54134=>17309, -54135=>17310, -54136=>17311, -54137=>17312, -54138=>17313, -54139=>17314, -54142=>17315, -54143=>17316, -54145=>17317, -54146=>17318, -54147=>17319, -54149=>17320, -54150=>17321, -54151=>17322, -54152=>17323, -54153=>17324, -54154=>17325, -54155=>17326, -54158=>17327, -54162=>17328, -54163=>17329, -54164=>17330, -54165=>17331, -54166=>17332, -54167=>17333, -54170=>17334, -54171=>17335, -54173=>17336, -54174=>17337, -54175=>17338, -54177=>17339, -54178=>17340, -54179=>17341, -54180=>17342, -54181=>17343, -54182=>17344, -54183=>17345, -54186=>17346, -54188=>17347, -54190=>17348, -54191=>17349, -54192=>17350, -54193=>17351, -54194=>17352, -54195=>17353, -54197=>17354, -54198=>17355, -54199=>17356, -54201=>17357, -54202=>17358, -54203=>17359, -54205=>17360, -54206=>17361, -54207=>17362, -54208=>17363, -54209=>17364, -54210=>17365, -54211=>17366, -54214=>17367, -54215=>17368, -54218=>17369, -54219=>17370, -54220=>17371, -54221=>17372, -54222=>17373, -54223=>17374, -54225=>17375, -54226=>17376, -54227=>17377, -54228=>17378, -54229=>17379, -54230=>17380, -54231=>17381, -54233=>17382, -54234=>17383, -54235=>17384, -54236=>17385, -54237=>17386, -54238=>17387, -54239=>17388, -54240=>17389, -54242=>17390, -54244=>17391, -54245=>17392, -54246=>17393, -54247=>17394, -54248=>17395, -54249=>17396, -54250=>17397, -54251=>17398, -54254=>17399, -54255=>17400, -54257=>17401, -54258=>17402, -54259=>17403, -54261=>17404, -54262=>17405, -54263=>17406, -54264=>17407, -54265=>17408, -54266=>17409, -54267=>17410, -54270=>17411, -54272=>17412, -54274=>17413, -54275=>17414, -54276=>17415, -54277=>17416, -54278=>17417, -54279=>17418, -54281=>17419, -54282=>17420, -54283=>17421, -54284=>17422, -54285=>17423, -54286=>17424, -54287=>17425, -54288=>17426, -54289=>17427, -54290=>17428, -54291=>17429, -54292=>17430, -54293=>17431, -54294=>17432, -54295=>17433, -54296=>17434, -54297=>17435, -54298=>17436, -54299=>17437, -54300=>17438, -54302=>17439, -54303=>17440, -54304=>17441, -54305=>17442, -54306=>17443, -54307=>17444, -54308=>17445, -54309=>17446, -54310=>17447, -54311=>17448, -54312=>17449, -54313=>17450, -54314=>17451, -54315=>17452, -54316=>17453, -54317=>17454, -54318=>17455, -54319=>17456, -54320=>17457, -54321=>17458, -54322=>17459, -54323=>17460, -54324=>17461, -54325=>17462, -54326=>17463, -54327=>17464, -54328=>17465, -54329=>17466, -54330=>17467, -54331=>17468, -54332=>17469, -54333=>17470, -54334=>17471, -54335=>17472, -54337=>17473, -54338=>17474, -54339=>17475, -54341=>17476, -54342=>17477, -54343=>17478, -54344=>17479, -54345=>17480, -54346=>17481, -54347=>17482, -54348=>17483, -54349=>17484, -54350=>17485, -54351=>17486, -54352=>17487, -54353=>17488, -54354=>17489, -54355=>17490, -54356=>17491, -54357=>17492, -54358=>17493, -54359=>17494, -54360=>17495, -54361=>17496, -54362=>17497, -54363=>17498, -54365=>17499, -54366=>17500, -54367=>17501, -54369=>17502, -54370=>17503, -54371=>17504, -54373=>17505, -54374=>17506, -54375=>17507, -54376=>17508, -54377=>17509, -54378=>17510, -54379=>17511, -54380=>17512, -54382=>17513, -54384=>17514, -54385=>17515, -54386=>17516, -54387=>17517, -54388=>17518, -54389=>17519, -54390=>17520, -54391=>17521, -54394=>17522, -54395=>17523, -54397=>17524, -54398=>17525, -54401=>17526, -54403=>17527, -54404=>17528, -54405=>17529, -54406=>17530, -54407=>17531, -54410=>17532, -54412=>17533, -54414=>17534, -54415=>17535, -54416=>17536, -54417=>17537, -54418=>17538, -54419=>17539, -54421=>17540, -54422=>17541, -54423=>17542, -54424=>17543, -54425=>17544, -54426=>17545, -54427=>17546, -54428=>17547, -54429=>17548, -54430=>17549, -54431=>17550, -54432=>17551, -54433=>17552, -54434=>17553, -54435=>17554, -54436=>17555, -54437=>17556, -54438=>17557, -54439=>17558, -54440=>17559, -54442=>17560, -54443=>17561, -54444=>17562, -54445=>17563, -54446=>17564, -54447=>17565, -54448=>17566, -54449=>17567, -54450=>17568, -54451=>17569, -54452=>17570, -54453=>17571, -54454=>17572, -54455=>17573, -54456=>17574, -54457=>17575, -54458=>17576, -54459=>17577, -54460=>17578, -54461=>17579, -54462=>17580, -54463=>17581, -54464=>17582, -54465=>17583, -54466=>17584, -54467=>17585, -54468=>17586, -54469=>17587, -54470=>17588, -54471=>17589, -54472=>17590, -54473=>17591, -54474=>17592, -54475=>17593, -54477=>17594, -54478=>17595, -54479=>17596, -54481=>17597, -54482=>17598, -54483=>17599, -54485=>17600, -54486=>17601, -54487=>17602, -54488=>17603, -54489=>17604, -54490=>17605, -54491=>17606, -54493=>17607, -54494=>17608, -54496=>17609, -54497=>17610, -54498=>17611, -54499=>17612, -54500=>17613, -54501=>17614, -54502=>17615, -54503=>17616, -54505=>17617, -54506=>17618, -54507=>17619, -54509=>17620, -54510=>17621, -54511=>17622, -54513=>17623, -54514=>17624, -54515=>17625, -54516=>17626, -54517=>17627, -54518=>17628, -54519=>17629, -54521=>17630, -54522=>17631, -54524=>17632, -54526=>17633, -54527=>17634, -54528=>17635, -54529=>17636, -54530=>17637, -54531=>17638, -54533=>17639, -54534=>17640, -54535=>17641, -54537=>17642, -54538=>17643, -54539=>17644, -54541=>17645, -54542=>17646, -54543=>17647, -54544=>17648, -54545=>17649, -54546=>17650, -54547=>17651, -54550=>17652, -54552=>17653, -54553=>17654, -54554=>17655, -54555=>17656, -54556=>17657, -54557=>17658, -54558=>17659, -54559=>17660, -54560=>17661, -54561=>17662, -54562=>17663, -54563=>17664, -54564=>17665, -54565=>17666, -54566=>17667, -54567=>17668, -54568=>17669, -54569=>17670, -54570=>17671, -54571=>17672, -54572=>17673, -54573=>17674, -54574=>17675, -54575=>17676, -54576=>17677, -54577=>17678, -54578=>17679, -54579=>17680, -54580=>17681, -54581=>17682, -54582=>17683, -54583=>17684, -54584=>17685, -54585=>17686, -54586=>17687, -54587=>17688, -54590=>17689, -54591=>17690, -54593=>17691, -54594=>17692, -54595=>17693, -54597=>17694, -54598=>17695, -54599=>17696, -54600=>17697, -54601=>17698, -54602=>17699, -54603=>17700, -54606=>17701, -54608=>17702, -54610=>17703, -54611=>17704, -54612=>17705, -54613=>17706, -54614=>17707, -54615=>17708, -54618=>17709, -54619=>17710, -54621=>17711, -54622=>17712, -54623=>17713, -54625=>17714, -54626=>17715, -54627=>17716, -54628=>17717, -54630=>17718, -54631=>17719, -54634=>17720, -54636=>17721, -54638=>17722, -54639=>17723, -54640=>17724, -54641=>17725, -54642=>17726, -54643=>17727, -54646=>17728, -54647=>17729, -54649=>17730, -54650=>17731, -54651=>17732, -54653=>17733, -54654=>17734, -54655=>17735, -54656=>17736, -54657=>17737, -54658=>17738, -54659=>17739, -54662=>17740, -54666=>17741, -54667=>17742, -54668=>17743, -54669=>17744, -54670=>17745, -54671=>17746, -54673=>17747, -54674=>17748, -54675=>17749, -54676=>17750, -54677=>17751, -54678=>17752, -54679=>17753, -54680=>17754, -54681=>17755, -54682=>17756, -54683=>17757, -54684=>17758, -54685=>17759, -54686=>17760, -54687=>17761, -54688=>17762, -54689=>17763, -54690=>17764, -54691=>17765, -54692=>17766, -54694=>17767, -54695=>17768, -54696=>17769, -54697=>17770, -54698=>17771, -54699=>17772, -54700=>17773, -54701=>17774, -54702=>17775, -54703=>17776, -54704=>17777, -54705=>17778, -54706=>17779, -54707=>17780, -54708=>17781, -54709=>17782, -54710=>17783, -54711=>17784, -54712=>17785, -54713=>17786, -54714=>17787, -54715=>17788, -54716=>17789, -54717=>17790, -54718=>17791, -54719=>17792, -54720=>17793, -54721=>17794, -54722=>17795, -54723=>17796, -54724=>17797, -54725=>17798, -54726=>17799, -54727=>17800, -54730=>17801, -54731=>17802, -54733=>17803, -54734=>17804, -54735=>17805, -54737=>17806, -54739=>17807, -54740=>17808, -54741=>17809, -54742=>17810, -54743=>17811, -54746=>17812, -54748=>17813, -54750=>17814, -54751=>17815, -54752=>17816, -54753=>17817, -54754=>17818, -54755=>17819, -54758=>17820, -54759=>17821, -54761=>17822, -54762=>17823, -54763=>17824, -54765=>17825, -54766=>17826, -54767=>17827, -54768=>17828, -54769=>17829, -54770=>17830, -54771=>17831, -54774=>17832, -54776=>17833, -54778=>17834, -54779=>17835, -54780=>17836, -54781=>17837, -54782=>17838, -54783=>17839, -54786=>17840, -54787=>17841, -54789=>17842, -54790=>17843, -54791=>17844, -54793=>17845, -54794=>17846, -54795=>17847, -54796=>17848, -54797=>17849, -54798=>17850, -54799=>17851, -54802=>17852, -54806=>17853, -54807=>17854, -54808=>17855, -54809=>17856, -54810=>17857, -54811=>17858, -54813=>17859, -54814=>17860, -54815=>17861, -54817=>17862, -54818=>17863, -54819=>17864, -54821=>17865, -54822=>17866, -54823=>17867, -54824=>17868, -54825=>17869, -54826=>17870, -54827=>17871, -54828=>17872, -54830=>17873, -54831=>17874, -54832=>17875, -54833=>17876, -54834=>17877, -54835=>17878, -54836=>17879, -54837=>17880, -54838=>17881, -54839=>17882, -54842=>17883, -54843=>17884, -54845=>17885, -54846=>17886, -54847=>17887, -54849=>17888, -54850=>17889, -54851=>17890, -54852=>17891, -54854=>17892, -54855=>17893, -54858=>17894, -54860=>17895, -54862=>17896, -54863=>17897, -54864=>17898, -54866=>17899, -54867=>17900, -54870=>17901, -54871=>17902, -54873=>17903, -54874=>17904, -54875=>17905, -54877=>17906, -54878=>17907, -54879=>17908, -54880=>17909, -54881=>17910, -54882=>17911, -54883=>17912, -54884=>17913, -54885=>17914, -54886=>17915, -54888=>17916, -54890=>17917, -54891=>17918, -54892=>17919, -54893=>17920, -54894=>17921, -54895=>17922, -54898=>17923, -54899=>17924, -54901=>17925, -54902=>17926, -54903=>17927, -54904=>17928, -54905=>17929, -54906=>17930, -54907=>17931, -54908=>17932, -54909=>17933, -54910=>17934, -54911=>17935, -54912=>17936, -54913=>17937, -54914=>17938, -54916=>17939, -54918=>17940, -54919=>17941, -54920=>17942, -54921=>17943, -54922=>17944, -54923=>17945, -54926=>17946, -54927=>17947, -54929=>17948, -54930=>17949, -54931=>17950, -54933=>17951, -54934=>17952, -54935=>17953, -54936=>17954, -54937=>17955, -54938=>17956, -54939=>17957, -54940=>17958, -54942=>17959, -54944=>17960, -54946=>17961, -54947=>17962, -54948=>17963, -54949=>17964, -54950=>17965, -54951=>17966, -54953=>17967, -54954=>17968, -54955=>17969, -54957=>17970, -54958=>17971, -54959=>17972, -54961=>17973, -54962=>17974, -54963=>17975, -54964=>17976, -54965=>17977, -54966=>17978, -54967=>17979, -54968=>17980, -54970=>17981, -54972=>17982, -54973=>17983, -54974=>17984, -54975=>17985, -54976=>17986, -54977=>17987, -54978=>17988, -54979=>17989, -54982=>17990, -54983=>17991, -54985=>17992, -54986=>17993, -54987=>17994, -54989=>17995, -54990=>17996, -54991=>17997, -54992=>17998, -54994=>17999, -54995=>18000, -54997=>18001, -54998=>18002, -55000=>18003, -55002=>18004, -55003=>18005, -55004=>18006, -55005=>18007, -55006=>18008, -55007=>18009, -55009=>18010, -55010=>18011, -55011=>18012, -55013=>18013, -55014=>18014, -55015=>18015, -55017=>18016, -55018=>18017, -55019=>18018, -55020=>18019, -55021=>18020, -55022=>18021, -55023=>18022, -55025=>18023, -55026=>18024, -55027=>18025, -55028=>18026, -55030=>18027, -55031=>18028, -55032=>18029, -55033=>18030, -55034=>18031, -55035=>18032, -55038=>18033, -55039=>18034, -55041=>18035, -55042=>18036, -55043=>18037, -55045=>18038, -55046=>18039, -55047=>18040, -55048=>18041, -55049=>18042, -55050=>18043, -55051=>18044, -55052=>18045, -55053=>18046, -55054=>18047, -55055=>18048, -55056=>18049, -55058=>18050, -55059=>18051, -55060=>18052, -55061=>18053, -55062=>18054, -55063=>18055, -55066=>18056, -55067=>18057, -55069=>18058, -55070=>18059, -55071=>18060, -55073=>18061, -55074=>18062, -55075=>18063, -55076=>18064, -55077=>18065, -55078=>18066, -55079=>18067, -55082=>18068, -55084=>18069, -55086=>18070, -55087=>18071, -55088=>18072, -55089=>18073, -55090=>18074, -55091=>18075, -55094=>18076, -55095=>18077, -55097=>18078, -55098=>18079, -55099=>18080, -55101=>18081, -55102=>18082, -55103=>18083, -55104=>18084, -55105=>18085, -55106=>18086, -55107=>18087, -55109=>18088, -55110=>18089, -55112=>18090, -55114=>18091, -55115=>18092, -55116=>18093, -55117=>18094, -55118=>18095, -55119=>18096, -55122=>18097, -55123=>18098, -55125=>18099, -55130=>18100, -55131=>18101, -55132=>18102, -55133=>18103, -55134=>18104, -55135=>18105, -55138=>18106, -55140=>18107, -55142=>18108, -55143=>18109, -55144=>18110, -55146=>18111, -55147=>18112, -55149=>18113, -55150=>18114, -55151=>18115, -55153=>18116, -55154=>18117, -55155=>18118, -55157=>18119, -55158=>18120, -55159=>18121, -55160=>18122, -55161=>18123, -55162=>18124, -55163=>18125, -55166=>18126, -55167=>18127, -55168=>18128, -55170=>18129, -55171=>18130, -55172=>18131, -55173=>18132, -55174=>18133, -55175=>18134, -55178=>18135, -55179=>18136, -55181=>18137, -55182=>18138, -55183=>18139, -55185=>18140, -55186=>18141, -55187=>18142, -55188=>18143, -55189=>18144, -55190=>18145, -55191=>18146, -55194=>18147, -55196=>18148, -55198=>18149, -55199=>18150, -55200=>18151, -55201=>18152, -55202=>18153, -55203=>18154, -); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/README.TXT b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/README.TXT deleted file mode 100644 index 96d39fb892..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/README.TXT +++ /dev/null @@ -1,135 +0,0 @@ -TCPDF Fonts - -TCPDF supports TrueTypeUnicode (UTF-8 Unicode), OpenTypeUnicode, TrueType, OpenType, Type1, CID-0 and Core (standard) fonts. - -There are two ways to use a new font: embedding it in the PDF (with or without subsetting) or not. When a font is not embedded, it is searched in the system. The advantage is that the PDF file is lighter; on the other hand, if it is not available, a substitution font is used. So it is preferable to ensure that the needed font is installed on the client systems. If the file is to be viewed by a large audience, it is recommended to embed. - -TCPDF support font subsetting to reduce the size of documents using large unicode font files. -If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font. -If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF. -The option for enabling/disabling the font subsetting are explained on the source code documentation for methods SetFont() and AddFont(). - -The fonts that could be not embedded are only the standard core fonts and CID-0 fonts. - -The PDF Core (standard) fonts are: - - * courier : Courier - * courierb : Courier Bold - * courierbi : Courier Bold Italic - * courieri : Courier Italic - * helvetica : Helvetica - * helveticab : Helvetica Bold - * helveticabi : Helvetica Bold Italic - * helveticai : Helvetica Italic - * symbol : Symbol - * times : Times New Roman - * timesb : Times New Roman Bold - * timesbi : Times New Roman Bold Italic - * timesi : Times New Roman Italic - * zapfdingbats : Zapf Dingbats - -Setting up a font for usage with TCPDF requires the following steps: - - 1. Convert all font filenames to lowercase and rename using the following schema: - * [basic-font-name-in-lowercase].ttf for regular font - * [basic-font-name-in-lowercase]b.ttf for bold variation - * [basic-font-name-in-lowercase]i.ttf for oblique variation - * [basic-font-name-in-lowercase]bi.ttf for bold oblique variation - - 2. Generate the font's metrics file. - * For Type1 font files this first step is not necessary because the AFM file is usually shipped with the font. In case you have only a metric file in PFM format, use the pfm2afm utility (fonts/utils/pfm2afm) to get the AFM file. If you own a Type1 font in ASCII format (.pfa), you can convert it to binary format with Type 1 utilities. - * For TrueTypeUnicode or TrueType font files, use the the provided ttf2ufm utility (fonts/utils/ttf2ufm): - - $ ttf2ufm -a -F myfont.ttf - - * For OpenTypeUnicode or OpenType font files, use the the provided ttf2ufm utility (fonts/utils/ttf2ufm): - - $ ttf2ufm -a -F myfont.otf - - 3. Run makefont.php script. - * For TrueTypeUnicode: - - $ php -q makefont.php myfont.ttf myfont.ufm - - * For OpenTypeUnicode: - - $ php -q makefont.php myfont.otf myfont.ufm - - * For TrueType: - - $ php -q makefont.php myfont.ttf myfont.afm - - * For OpenType: - - $ php -q makefont.php myfont.otf myfont.afm - - * For Type1: - - $ php -q makefont.php myfont.pfb myfont.afm - - You may also specify additional parameters: - - MakeFont(string $fontfile, string $fmfile [, boolean $embedded [, $enc="cp1252" [, $patch=array()]]]) - - * $fontfile : Path to the .ttf or .pfb file. - * $fmfile : Path to the .afm file for Type1 and TrueType or .ufm for TrueTypeUnicode. - * $embedded : Set to false to not embed the font, true otherwise (default). - * $enc : Name of the encoding table to use. Default value: cp1252. Omit this parameter for TrueType Unicode, OpenType Unicode and symbolic fonts like Symbol or ZapfDingBats. The encoding defines the association between a code (from 0 to 255) and a character. The first 128 are fixed and correspond to ASCII. The encodings are stored in .map files. Those available are: - o cp1250 (Central Europe) - o cp1251 (Cyrillic) - o cp1252 (Western Europe) - o cp1253 (Greek) - o cp1254 (Turkish) - o cp1255 (Hebrew) - o cp1257 (Baltic) - o cp1258 (Vietnamese) - o cp874 (Thai) - o iso-8859-1 (Western Europe) - o iso-8859-2 (Central Europe) - o iso-8859-4 (Baltic) - o iso-8859-5 (Cyrillic) - o iso-8859-7 (Greek) - o iso-8859-9 (Turkish) - o iso-8859-11 (Thai) - o iso-8859-15 (Western Europe) - o iso-8859-16 (Central Europe) - o koi8-r (Russian) - o koi8-u (Ukrainian) - Of course, the font must contain the characters corresponding to the chosen encoding. The encodings which begin with cp are those used by Windows; Linux systems usually use ISO. - * $patch : Optional modification of the encoding. Empty by default. This parameter gives the possibility to alter the encoding. Sometimes you may want to add some characters. For instance, ISO-8859-1 does not contain the euro symbol. To add it at position 164, pass array(164=>'Euro'). - - 4. Edit and copy resulting files by case: - * For embedded fonts: copy the resulting .php, .z and .ctg.z (if available) files to the TCPDF fonts directory. - * For not-embedding the font, edit the .php file and comment the $file entry. - * For CID-0 fonts (not embeddeed) you have to edit the .php file: - o change the font type to: $type='cidfont0'; - o set the default font width by adding the line: $dw=1000; - o remove the $enc, $file and $ctg variables definitions - o add one of the following blocks of text at the end of the file (depends by the language you are using - see the arialunicid0.php file for a working example): - + // Chinese Simplified - $enc='UniCNS-UTF16-H'; - $cidinfo=array('Registry'=>'Adobe', 'Ordering'=>'CNS1','Supplement'=>0); - include(dirname(__FILE__).'/uni2cid_ac15.php'); - - + // Chinese Traditional - $enc='UniGB-UTF16-H'; - $cidinfo=array('Registry'=>'Adobe', 'Ordering'=>'GB1','Supplement'=>2); - include(dirname(__FILE__).'/uni2cid_ag15.php'); - - + // Korean - $enc='UniKS-UTF16-H'; - $cidinfo=array('Registry'=>'Adobe', 'Ordering'=>'Korea1','Supplement'=>0); - include(dirname(__FILE__).'/uni2cid_ak12.php'); - - + // Japanese - $enc='UniJIS-UTF16-H'; - $cidinfo=array('Registry'=>'Adobe', 'Ordering'=>'Japan1','Supplement'=>5); - include(dirname(__FILE__).'/uni2cid_aj16.php'); - - o copy the .php file to the TCPDF fonts directory. - 5. Rename php font files variations using the following schema: - * [basic-font-name-in-lowercase].php for regular font - * [basic-font-name-in-lowercase]b.php for bold variation - * [basic-font-name-in-lowercase]i.php for oblique variation - * [basic-font-name-in-lowercase]bi.php for bold oblique variation - diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1250.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1250.map deleted file mode 100644 index ec110af061..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1250.map +++ /dev/null @@ -1,251 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!89 U+2030 perthousand -!8A U+0160 Scaron -!8B U+2039 guilsinglleft -!8C U+015A Sacute -!8D U+0164 Tcaron -!8E U+017D Zcaron -!8F U+0179 Zacute -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!99 U+2122 trademark -!9A U+0161 scaron -!9B U+203A guilsinglright -!9C U+015B sacute -!9D U+0165 tcaron -!9E U+017E zcaron -!9F U+017A zacute -!A0 U+00A0 space -!A1 U+02C7 caron -!A2 U+02D8 breve -!A3 U+0141 Lslash -!A4 U+00A4 currency -!A5 U+0104 Aogonek -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+015E Scedilla -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+017B Zdotaccent -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+02DB ogonek -!B3 U+0142 lslash -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+0105 aogonek -!BA U+015F scedilla -!BB U+00BB guillemotright -!BC U+013D Lcaron -!BD U+02DD hungarumlaut -!BE U+013E lcaron -!BF U+017C zdotaccent -!C0 U+0154 Racute -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+0102 Abreve -!C4 U+00C4 Adieresis -!C5 U+0139 Lacute -!C6 U+0106 Cacute -!C7 U+00C7 Ccedilla -!C8 U+010C Ccaron -!C9 U+00C9 Eacute -!CA U+0118 Eogonek -!CB U+00CB Edieresis -!CC U+011A Ecaron -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+010E Dcaron -!D0 U+0110 Dcroat -!D1 U+0143 Nacute -!D2 U+0147 Ncaron -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+0150 Ohungarumlaut -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+0158 Rcaron -!D9 U+016E Uring -!DA U+00DA Uacute -!DB U+0170 Uhungarumlaut -!DC U+00DC Udieresis -!DD U+00DD Yacute -!DE U+0162 Tcommaaccent -!DF U+00DF germandbls -!E0 U+0155 racute -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+0103 abreve -!E4 U+00E4 adieresis -!E5 U+013A lacute -!E6 U+0107 cacute -!E7 U+00E7 ccedilla -!E8 U+010D ccaron -!E9 U+00E9 eacute -!EA U+0119 eogonek -!EB U+00EB edieresis -!EC U+011B ecaron -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+010F dcaron -!F0 U+0111 dcroat -!F1 U+0144 nacute -!F2 U+0148 ncaron -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+0151 ohungarumlaut -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+0159 rcaron -!F9 U+016F uring -!FA U+00FA uacute -!FB U+0171 uhungarumlaut -!FC U+00FC udieresis -!FD U+00FD yacute -!FE U+0163 tcommaaccent -!FF U+02D9 dotaccent diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1251.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1251.map deleted file mode 100644 index de6a198d99..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1251.map +++ /dev/null @@ -1,255 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0402 afii10051 -!81 U+0403 afii10052 -!82 U+201A quotesinglbase -!83 U+0453 afii10100 -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!88 U+20AC Euro -!89 U+2030 perthousand -!8A U+0409 afii10058 -!8B U+2039 guilsinglleft -!8C U+040A afii10059 -!8D U+040C afii10061 -!8E U+040B afii10060 -!8F U+040F afii10145 -!90 U+0452 afii10099 -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!99 U+2122 trademark -!9A U+0459 afii10106 -!9B U+203A guilsinglright -!9C U+045A afii10107 -!9D U+045C afii10109 -!9E U+045B afii10108 -!9F U+045F afii10193 -!A0 U+00A0 space -!A1 U+040E afii10062 -!A2 U+045E afii10110 -!A3 U+0408 afii10057 -!A4 U+00A4 currency -!A5 U+0490 afii10050 -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+0401 afii10023 -!A9 U+00A9 copyright -!AA U+0404 afii10053 -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+0407 afii10056 -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+0406 afii10055 -!B3 U+0456 afii10103 -!B4 U+0491 afii10098 -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+0451 afii10071 -!B9 U+2116 afii61352 -!BA U+0454 afii10101 -!BB U+00BB guillemotright -!BC U+0458 afii10105 -!BD U+0405 afii10054 -!BE U+0455 afii10102 -!BF U+0457 afii10104 -!C0 U+0410 afii10017 -!C1 U+0411 afii10018 -!C2 U+0412 afii10019 -!C3 U+0413 afii10020 -!C4 U+0414 afii10021 -!C5 U+0415 afii10022 -!C6 U+0416 afii10024 -!C7 U+0417 afii10025 -!C8 U+0418 afii10026 -!C9 U+0419 afii10027 -!CA U+041A afii10028 -!CB U+041B afii10029 -!CC U+041C afii10030 -!CD U+041D afii10031 -!CE U+041E afii10032 -!CF U+041F afii10033 -!D0 U+0420 afii10034 -!D1 U+0421 afii10035 -!D2 U+0422 afii10036 -!D3 U+0423 afii10037 -!D4 U+0424 afii10038 -!D5 U+0425 afii10039 -!D6 U+0426 afii10040 -!D7 U+0427 afii10041 -!D8 U+0428 afii10042 -!D9 U+0429 afii10043 -!DA U+042A afii10044 -!DB U+042B afii10045 -!DC U+042C afii10046 -!DD U+042D afii10047 -!DE U+042E afii10048 -!DF U+042F afii10049 -!E0 U+0430 afii10065 -!E1 U+0431 afii10066 -!E2 U+0432 afii10067 -!E3 U+0433 afii10068 -!E4 U+0434 afii10069 -!E5 U+0435 afii10070 -!E6 U+0436 afii10072 -!E7 U+0437 afii10073 -!E8 U+0438 afii10074 -!E9 U+0439 afii10075 -!EA U+043A afii10076 -!EB U+043B afii10077 -!EC U+043C afii10078 -!ED U+043D afii10079 -!EE U+043E afii10080 -!EF U+043F afii10081 -!F0 U+0440 afii10082 -!F1 U+0441 afii10083 -!F2 U+0442 afii10084 -!F3 U+0443 afii10085 -!F4 U+0444 afii10086 -!F5 U+0445 afii10087 -!F6 U+0446 afii10088 -!F7 U+0447 afii10089 -!F8 U+0448 afii10090 -!F9 U+0449 afii10091 -!FA U+044A afii10092 -!FB U+044B afii10093 -!FC U+044C afii10094 -!FD U+044D afii10095 -!FE U+044E afii10096 -!FF U+044F afii10097 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1252.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1252.map deleted file mode 100644 index dd490e5961..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1252.map +++ /dev/null @@ -1,251 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!83 U+0192 florin -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!88 U+02C6 circumflex -!89 U+2030 perthousand -!8A U+0160 Scaron -!8B U+2039 guilsinglleft -!8C U+0152 OE -!8E U+017D Zcaron -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!98 U+02DC tilde -!99 U+2122 trademark -!9A U+0161 scaron -!9B U+203A guilsinglright -!9C U+0153 oe -!9E U+017E zcaron -!9F U+0178 Ydieresis -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+00D0 Eth -!D1 U+00D1 Ntilde -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+00DD Yacute -!DE U+00DE Thorn -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+00F0 eth -!F1 U+00F1 ntilde -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+00FD yacute -!FE U+00FE thorn -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1253.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1253.map deleted file mode 100644 index 4bd826fb26..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1253.map +++ /dev/null @@ -1,239 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!83 U+0192 florin -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!89 U+2030 perthousand -!8B U+2039 guilsinglleft -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!99 U+2122 trademark -!9B U+203A guilsinglright -!A0 U+00A0 space -!A1 U+0385 dieresistonos -!A2 U+0386 Alphatonos -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+2015 afii00208 -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+0384 tonos -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+0388 Epsilontonos -!B9 U+0389 Etatonos -!BA U+038A Iotatonos -!BB U+00BB guillemotright -!BC U+038C Omicrontonos -!BD U+00BD onehalf -!BE U+038E Upsilontonos -!BF U+038F Omegatonos -!C0 U+0390 iotadieresistonos -!C1 U+0391 Alpha -!C2 U+0392 Beta -!C3 U+0393 Gamma -!C4 U+0394 Delta -!C5 U+0395 Epsilon -!C6 U+0396 Zeta -!C7 U+0397 Eta -!C8 U+0398 Theta -!C9 U+0399 Iota -!CA U+039A Kappa -!CB U+039B Lambda -!CC U+039C Mu -!CD U+039D Nu -!CE U+039E Xi -!CF U+039F Omicron -!D0 U+03A0 Pi -!D1 U+03A1 Rho -!D3 U+03A3 Sigma -!D4 U+03A4 Tau -!D5 U+03A5 Upsilon -!D6 U+03A6 Phi -!D7 U+03A7 Chi -!D8 U+03A8 Psi -!D9 U+03A9 Omega -!DA U+03AA Iotadieresis -!DB U+03AB Upsilondieresis -!DC U+03AC alphatonos -!DD U+03AD epsilontonos -!DE U+03AE etatonos -!DF U+03AF iotatonos -!E0 U+03B0 upsilondieresistonos -!E1 U+03B1 alpha -!E2 U+03B2 beta -!E3 U+03B3 gamma -!E4 U+03B4 delta -!E5 U+03B5 epsilon -!E6 U+03B6 zeta -!E7 U+03B7 eta -!E8 U+03B8 theta -!E9 U+03B9 iota -!EA U+03BA kappa -!EB U+03BB lambda -!EC U+03BC mu -!ED U+03BD nu -!EE U+03BE xi -!EF U+03BF omicron -!F0 U+03C0 pi -!F1 U+03C1 rho -!F2 U+03C2 sigma1 -!F3 U+03C3 sigma -!F4 U+03C4 tau -!F5 U+03C5 upsilon -!F6 U+03C6 phi -!F7 U+03C7 chi -!F8 U+03C8 psi -!F9 U+03C9 omega -!FA U+03CA iotadieresis -!FB U+03CB upsilondieresis -!FC U+03CC omicrontonos -!FD U+03CD upsilontonos -!FE U+03CE omegatonos diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1254.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1254.map deleted file mode 100644 index 829473b28c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1254.map +++ /dev/null @@ -1,249 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!83 U+0192 florin -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!88 U+02C6 circumflex -!89 U+2030 perthousand -!8A U+0160 Scaron -!8B U+2039 guilsinglleft -!8C U+0152 OE -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!98 U+02DC tilde -!99 U+2122 trademark -!9A U+0161 scaron -!9B U+203A guilsinglright -!9C U+0153 oe -!9F U+0178 Ydieresis -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+011E Gbreve -!D1 U+00D1 Ntilde -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+0130 Idotaccent -!DE U+015E Scedilla -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+011F gbreve -!F1 U+00F1 ntilde -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+0131 dotlessi -!FE U+015F scedilla -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1255.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1255.map deleted file mode 100644 index 079e10c61c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1255.map +++ /dev/null @@ -1,233 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!83 U+0192 florin -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!88 U+02C6 circumflex -!89 U+2030 perthousand -!8B U+2039 guilsinglleft -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!98 U+02DC tilde -!99 U+2122 trademark -!9B U+203A guilsinglright -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+20AA afii57636 -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00D7 multiply -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD sfthyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 middot -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00F7 divide -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+05B0 afii57799 -!C1 U+05B1 afii57801 -!C2 U+05B2 afii57800 -!C3 U+05B3 afii57802 -!C4 U+05B4 afii57793 -!C5 U+05B5 afii57794 -!C6 U+05B6 afii57795 -!C7 U+05B7 afii57798 -!C8 U+05B8 afii57797 -!C9 U+05B9 afii57806 -!CB U+05BB afii57796 -!CC U+05BC afii57807 -!CD U+05BD afii57839 -!CE U+05BE afii57645 -!CF U+05BF afii57841 -!D0 U+05C0 afii57842 -!D1 U+05C1 afii57804 -!D2 U+05C2 afii57803 -!D3 U+05C3 afii57658 -!D4 U+05F0 afii57716 -!D5 U+05F1 afii57717 -!D6 U+05F2 afii57718 -!D7 U+05F3 gereshhebrew -!D8 U+05F4 gershayimhebrew -!E0 U+05D0 afii57664 -!E1 U+05D1 afii57665 -!E2 U+05D2 afii57666 -!E3 U+05D3 afii57667 -!E4 U+05D4 afii57668 -!E5 U+05D5 afii57669 -!E6 U+05D6 afii57670 -!E7 U+05D7 afii57671 -!E8 U+05D8 afii57672 -!E9 U+05D9 afii57673 -!EA U+05DA afii57674 -!EB U+05DB afii57675 -!EC U+05DC afii57676 -!ED U+05DD afii57677 -!EE U+05DE afii57678 -!EF U+05DF afii57679 -!F0 U+05E0 afii57680 -!F1 U+05E1 afii57681 -!F2 U+05E2 afii57682 -!F3 U+05E3 afii57683 -!F4 U+05E4 afii57684 -!F5 U+05E5 afii57685 -!F6 U+05E6 afii57686 -!F7 U+05E7 afii57687 -!F8 U+05E8 afii57688 -!F9 U+05E9 afii57689 -!FA U+05EA afii57690 -!FD U+200E afii299 -!FE U+200F afii300 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1257.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1257.map deleted file mode 100644 index 2f2ecfa21d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1257.map +++ /dev/null @@ -1,244 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!89 U+2030 perthousand -!8B U+2039 guilsinglleft -!8D U+00A8 dieresis -!8E U+02C7 caron -!8F U+00B8 cedilla -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!99 U+2122 trademark -!9B U+203A guilsinglright -!9D U+00AF macron -!9E U+02DB ogonek -!A0 U+00A0 space -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00D8 Oslash -!A9 U+00A9 copyright -!AA U+0156 Rcommaaccent -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00C6 AE -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00F8 oslash -!B9 U+00B9 onesuperior -!BA U+0157 rcommaaccent -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00E6 ae -!C0 U+0104 Aogonek -!C1 U+012E Iogonek -!C2 U+0100 Amacron -!C3 U+0106 Cacute -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+0118 Eogonek -!C7 U+0112 Emacron -!C8 U+010C Ccaron -!C9 U+00C9 Eacute -!CA U+0179 Zacute -!CB U+0116 Edotaccent -!CC U+0122 Gcommaaccent -!CD U+0136 Kcommaaccent -!CE U+012A Imacron -!CF U+013B Lcommaaccent -!D0 U+0160 Scaron -!D1 U+0143 Nacute -!D2 U+0145 Ncommaaccent -!D3 U+00D3 Oacute -!D4 U+014C Omacron -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+0172 Uogonek -!D9 U+0141 Lslash -!DA U+015A Sacute -!DB U+016A Umacron -!DC U+00DC Udieresis -!DD U+017B Zdotaccent -!DE U+017D Zcaron -!DF U+00DF germandbls -!E0 U+0105 aogonek -!E1 U+012F iogonek -!E2 U+0101 amacron -!E3 U+0107 cacute -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+0119 eogonek -!E7 U+0113 emacron -!E8 U+010D ccaron -!E9 U+00E9 eacute -!EA U+017A zacute -!EB U+0117 edotaccent -!EC U+0123 gcommaaccent -!ED U+0137 kcommaaccent -!EE U+012B imacron -!EF U+013C lcommaaccent -!F0 U+0161 scaron -!F1 U+0144 nacute -!F2 U+0146 ncommaaccent -!F3 U+00F3 oacute -!F4 U+014D omacron -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+0173 uogonek -!F9 U+0142 lslash -!FA U+015B sacute -!FB U+016B umacron -!FC U+00FC udieresis -!FD U+017C zdotaccent -!FE U+017E zcaron -!FF U+02D9 dotaccent diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1258.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1258.map deleted file mode 100644 index fed915f715..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp1258.map +++ /dev/null @@ -1,247 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!82 U+201A quotesinglbase -!83 U+0192 florin -!84 U+201E quotedblbase -!85 U+2026 ellipsis -!86 U+2020 dagger -!87 U+2021 daggerdbl -!88 U+02C6 circumflex -!89 U+2030 perthousand -!8B U+2039 guilsinglleft -!8C U+0152 OE -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!98 U+02DC tilde -!99 U+2122 trademark -!9B U+203A guilsinglright -!9C U+0153 oe -!9F U+0178 Ydieresis -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+0102 Abreve -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+0300 gravecomb -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+0110 Dcroat -!D1 U+00D1 Ntilde -!D2 U+0309 hookabovecomb -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+01A0 Ohorn -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+01AF Uhorn -!DE U+0303 tildecomb -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+0103 abreve -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+0301 acutecomb -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+0111 dcroat -!F1 U+00F1 ntilde -!F2 U+0323 dotbelowcomb -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+01A1 ohorn -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+01B0 uhorn -!FE U+20AB dong -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp874.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp874.map deleted file mode 100644 index 1006e6b17f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/cp874.map +++ /dev/null @@ -1,225 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+20AC Euro -!85 U+2026 ellipsis -!91 U+2018 quoteleft -!92 U+2019 quoteright -!93 U+201C quotedblleft -!94 U+201D quotedblright -!95 U+2022 bullet -!96 U+2013 endash -!97 U+2014 emdash -!A0 U+00A0 space -!A1 U+0E01 kokaithai -!A2 U+0E02 khokhaithai -!A3 U+0E03 khokhuatthai -!A4 U+0E04 khokhwaithai -!A5 U+0E05 khokhonthai -!A6 U+0E06 khorakhangthai -!A7 U+0E07 ngonguthai -!A8 U+0E08 chochanthai -!A9 U+0E09 chochingthai -!AA U+0E0A chochangthai -!AB U+0E0B sosothai -!AC U+0E0C chochoethai -!AD U+0E0D yoyingthai -!AE U+0E0E dochadathai -!AF U+0E0F topatakthai -!B0 U+0E10 thothanthai -!B1 U+0E11 thonangmonthothai -!B2 U+0E12 thophuthaothai -!B3 U+0E13 nonenthai -!B4 U+0E14 dodekthai -!B5 U+0E15 totaothai -!B6 U+0E16 thothungthai -!B7 U+0E17 thothahanthai -!B8 U+0E18 thothongthai -!B9 U+0E19 nonuthai -!BA U+0E1A bobaimaithai -!BB U+0E1B poplathai -!BC U+0E1C phophungthai -!BD U+0E1D fofathai -!BE U+0E1E phophanthai -!BF U+0E1F fofanthai -!C0 U+0E20 phosamphaothai -!C1 U+0E21 momathai -!C2 U+0E22 yoyakthai -!C3 U+0E23 roruathai -!C4 U+0E24 ruthai -!C5 U+0E25 lolingthai -!C6 U+0E26 luthai -!C7 U+0E27 wowaenthai -!C8 U+0E28 sosalathai -!C9 U+0E29 sorusithai -!CA U+0E2A sosuathai -!CB U+0E2B hohipthai -!CC U+0E2C lochulathai -!CD U+0E2D oangthai -!CE U+0E2E honokhukthai -!CF U+0E2F paiyannoithai -!D0 U+0E30 saraathai -!D1 U+0E31 maihanakatthai -!D2 U+0E32 saraaathai -!D3 U+0E33 saraamthai -!D4 U+0E34 saraithai -!D5 U+0E35 saraiithai -!D6 U+0E36 sarauethai -!D7 U+0E37 saraueethai -!D8 U+0E38 sarauthai -!D9 U+0E39 sarauuthai -!DA U+0E3A phinthuthai -!DF U+0E3F bahtthai -!E0 U+0E40 saraethai -!E1 U+0E41 saraaethai -!E2 U+0E42 saraothai -!E3 U+0E43 saraaimaimuanthai -!E4 U+0E44 saraaimaimalaithai -!E5 U+0E45 lakkhangyaothai -!E6 U+0E46 maiyamokthai -!E7 U+0E47 maitaikhuthai -!E8 U+0E48 maiekthai -!E9 U+0E49 maithothai -!EA U+0E4A maitrithai -!EB U+0E4B maichattawathai -!EC U+0E4C thanthakhatthai -!ED U+0E4D nikhahitthai -!EE U+0E4E yamakkanthai -!EF U+0E4F fongmanthai -!F0 U+0E50 zerothai -!F1 U+0E51 onethai -!F2 U+0E52 twothai -!F3 U+0E53 threethai -!F4 U+0E54 fourthai -!F5 U+0E55 fivethai -!F6 U+0E56 sixthai -!F7 U+0E57 seventhai -!F8 U+0E58 eightthai -!F9 U+0E59 ninethai -!FA U+0E5A angkhankhuthai -!FB U+0E5B khomutthai diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-1.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-1.map deleted file mode 100644 index 61740a38fa..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-1.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+00D0 Eth -!D1 U+00D1 Ntilde -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+00DD Yacute -!DE U+00DE Thorn -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+00F0 eth -!F1 U+00F1 ntilde -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+00FD yacute -!FE U+00FE thorn -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-11.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-11.map deleted file mode 100644 index 9168812066..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-11.map +++ /dev/null @@ -1,248 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+0E01 kokaithai -!A2 U+0E02 khokhaithai -!A3 U+0E03 khokhuatthai -!A4 U+0E04 khokhwaithai -!A5 U+0E05 khokhonthai -!A6 U+0E06 khorakhangthai -!A7 U+0E07 ngonguthai -!A8 U+0E08 chochanthai -!A9 U+0E09 chochingthai -!AA U+0E0A chochangthai -!AB U+0E0B sosothai -!AC U+0E0C chochoethai -!AD U+0E0D yoyingthai -!AE U+0E0E dochadathai -!AF U+0E0F topatakthai -!B0 U+0E10 thothanthai -!B1 U+0E11 thonangmonthothai -!B2 U+0E12 thophuthaothai -!B3 U+0E13 nonenthai -!B4 U+0E14 dodekthai -!B5 U+0E15 totaothai -!B6 U+0E16 thothungthai -!B7 U+0E17 thothahanthai -!B8 U+0E18 thothongthai -!B9 U+0E19 nonuthai -!BA U+0E1A bobaimaithai -!BB U+0E1B poplathai -!BC U+0E1C phophungthai -!BD U+0E1D fofathai -!BE U+0E1E phophanthai -!BF U+0E1F fofanthai -!C0 U+0E20 phosamphaothai -!C1 U+0E21 momathai -!C2 U+0E22 yoyakthai -!C3 U+0E23 roruathai -!C4 U+0E24 ruthai -!C5 U+0E25 lolingthai -!C6 U+0E26 luthai -!C7 U+0E27 wowaenthai -!C8 U+0E28 sosalathai -!C9 U+0E29 sorusithai -!CA U+0E2A sosuathai -!CB U+0E2B hohipthai -!CC U+0E2C lochulathai -!CD U+0E2D oangthai -!CE U+0E2E honokhukthai -!CF U+0E2F paiyannoithai -!D0 U+0E30 saraathai -!D1 U+0E31 maihanakatthai -!D2 U+0E32 saraaathai -!D3 U+0E33 saraamthai -!D4 U+0E34 saraithai -!D5 U+0E35 saraiithai -!D6 U+0E36 sarauethai -!D7 U+0E37 saraueethai -!D8 U+0E38 sarauthai -!D9 U+0E39 sarauuthai -!DA U+0E3A phinthuthai -!DF U+0E3F bahtthai -!E0 U+0E40 saraethai -!E1 U+0E41 saraaethai -!E2 U+0E42 saraothai -!E3 U+0E43 saraaimaimuanthai -!E4 U+0E44 saraaimaimalaithai -!E5 U+0E45 lakkhangyaothai -!E6 U+0E46 maiyamokthai -!E7 U+0E47 maitaikhuthai -!E8 U+0E48 maiekthai -!E9 U+0E49 maithothai -!EA U+0E4A maitrithai -!EB U+0E4B maichattawathai -!EC U+0E4C thanthakhatthai -!ED U+0E4D nikhahitthai -!EE U+0E4E yamakkanthai -!EF U+0E4F fongmanthai -!F0 U+0E50 zerothai -!F1 U+0E51 onethai -!F2 U+0E52 twothai -!F3 U+0E53 threethai -!F4 U+0E54 fourthai -!F5 U+0E55 fivethai -!F6 U+0E56 sixthai -!F7 U+0E57 seventhai -!F8 U+0E58 eightthai -!F9 U+0E59 ninethai -!FA U+0E5A angkhankhuthai -!FB U+0E5B khomutthai diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-15.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-15.map deleted file mode 100644 index 6c2b571279..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-15.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+20AC Euro -!A5 U+00A5 yen -!A6 U+0160 Scaron -!A7 U+00A7 section -!A8 U+0161 scaron -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+017D Zcaron -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+017E zcaron -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+0152 OE -!BD U+0153 oe -!BE U+0178 Ydieresis -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+00D0 Eth -!D1 U+00D1 Ntilde -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+00DD Yacute -!DE U+00DE Thorn -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+00F0 eth -!F1 U+00F1 ntilde -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+00FD yacute -!FE U+00FE thorn -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-16.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-16.map deleted file mode 100644 index 202c8fe594..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-16.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+0104 Aogonek -!A2 U+0105 aogonek -!A3 U+0141 Lslash -!A4 U+20AC Euro -!A5 U+201E quotedblbase -!A6 U+0160 Scaron -!A7 U+00A7 section -!A8 U+0161 scaron -!A9 U+00A9 copyright -!AA U+0218 Scommaaccent -!AB U+00AB guillemotleft -!AC U+0179 Zacute -!AD U+00AD hyphen -!AE U+017A zacute -!AF U+017B Zdotaccent -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+010C Ccaron -!B3 U+0142 lslash -!B4 U+017D Zcaron -!B5 U+201D quotedblright -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+017E zcaron -!B9 U+010D ccaron -!BA U+0219 scommaaccent -!BB U+00BB guillemotright -!BC U+0152 OE -!BD U+0153 oe -!BE U+0178 Ydieresis -!BF U+017C zdotaccent -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+0102 Abreve -!C4 U+00C4 Adieresis -!C5 U+0106 Cacute -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+0110 Dcroat -!D1 U+0143 Nacute -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+0150 Ohungarumlaut -!D6 U+00D6 Odieresis -!D7 U+015A Sacute -!D8 U+0170 Uhungarumlaut -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+0118 Eogonek -!DE U+021A Tcommaaccent -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+0103 abreve -!E4 U+00E4 adieresis -!E5 U+0107 cacute -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+0111 dcroat -!F1 U+0144 nacute -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+0151 ohungarumlaut -!F6 U+00F6 odieresis -!F7 U+015B sacute -!F8 U+0171 uhungarumlaut -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+0119 eogonek -!FE U+021B tcommaaccent -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-2.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-2.map deleted file mode 100644 index 65ae09f958..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-2.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+0104 Aogonek -!A2 U+02D8 breve -!A3 U+0141 Lslash -!A4 U+00A4 currency -!A5 U+013D Lcaron -!A6 U+015A Sacute -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+0160 Scaron -!AA U+015E Scedilla -!AB U+0164 Tcaron -!AC U+0179 Zacute -!AD U+00AD hyphen -!AE U+017D Zcaron -!AF U+017B Zdotaccent -!B0 U+00B0 degree -!B1 U+0105 aogonek -!B2 U+02DB ogonek -!B3 U+0142 lslash -!B4 U+00B4 acute -!B5 U+013E lcaron -!B6 U+015B sacute -!B7 U+02C7 caron -!B8 U+00B8 cedilla -!B9 U+0161 scaron -!BA U+015F scedilla -!BB U+0165 tcaron -!BC U+017A zacute -!BD U+02DD hungarumlaut -!BE U+017E zcaron -!BF U+017C zdotaccent -!C0 U+0154 Racute -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+0102 Abreve -!C4 U+00C4 Adieresis -!C5 U+0139 Lacute -!C6 U+0106 Cacute -!C7 U+00C7 Ccedilla -!C8 U+010C Ccaron -!C9 U+00C9 Eacute -!CA U+0118 Eogonek -!CB U+00CB Edieresis -!CC U+011A Ecaron -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+010E Dcaron -!D0 U+0110 Dcroat -!D1 U+0143 Nacute -!D2 U+0147 Ncaron -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+0150 Ohungarumlaut -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+0158 Rcaron -!D9 U+016E Uring -!DA U+00DA Uacute -!DB U+0170 Uhungarumlaut -!DC U+00DC Udieresis -!DD U+00DD Yacute -!DE U+0162 Tcommaaccent -!DF U+00DF germandbls -!E0 U+0155 racute -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+0103 abreve -!E4 U+00E4 adieresis -!E5 U+013A lacute -!E6 U+0107 cacute -!E7 U+00E7 ccedilla -!E8 U+010D ccaron -!E9 U+00E9 eacute -!EA U+0119 eogonek -!EB U+00EB edieresis -!EC U+011B ecaron -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+010F dcaron -!F0 U+0111 dcroat -!F1 U+0144 nacute -!F2 U+0148 ncaron -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+0151 ohungarumlaut -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+0159 rcaron -!F9 U+016F uring -!FA U+00FA uacute -!FB U+0171 uhungarumlaut -!FC U+00FC udieresis -!FD U+00FD yacute -!FE U+0163 tcommaaccent -!FF U+02D9 dotaccent diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-4.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-4.map deleted file mode 100644 index a7d87bf3ef..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-4.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+0104 Aogonek -!A2 U+0138 kgreenlandic -!A3 U+0156 Rcommaaccent -!A4 U+00A4 currency -!A5 U+0128 Itilde -!A6 U+013B Lcommaaccent -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+0160 Scaron -!AA U+0112 Emacron -!AB U+0122 Gcommaaccent -!AC U+0166 Tbar -!AD U+00AD hyphen -!AE U+017D Zcaron -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+0105 aogonek -!B2 U+02DB ogonek -!B3 U+0157 rcommaaccent -!B4 U+00B4 acute -!B5 U+0129 itilde -!B6 U+013C lcommaaccent -!B7 U+02C7 caron -!B8 U+00B8 cedilla -!B9 U+0161 scaron -!BA U+0113 emacron -!BB U+0123 gcommaaccent -!BC U+0167 tbar -!BD U+014A Eng -!BE U+017E zcaron -!BF U+014B eng -!C0 U+0100 Amacron -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+012E Iogonek -!C8 U+010C Ccaron -!C9 U+00C9 Eacute -!CA U+0118 Eogonek -!CB U+00CB Edieresis -!CC U+0116 Edotaccent -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+012A Imacron -!D0 U+0110 Dcroat -!D1 U+0145 Ncommaaccent -!D2 U+014C Omacron -!D3 U+0136 Kcommaaccent -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+0172 Uogonek -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+0168 Utilde -!DE U+016A Umacron -!DF U+00DF germandbls -!E0 U+0101 amacron -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+012F iogonek -!E8 U+010D ccaron -!E9 U+00E9 eacute -!EA U+0119 eogonek -!EB U+00EB edieresis -!EC U+0117 edotaccent -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+012B imacron -!F0 U+0111 dcroat -!F1 U+0146 ncommaaccent -!F2 U+014D omacron -!F3 U+0137 kcommaaccent -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+0173 uogonek -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+0169 utilde -!FE U+016B umacron -!FF U+02D9 dotaccent diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-5.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-5.map deleted file mode 100644 index f9cd4edcf8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-5.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+0401 afii10023 -!A2 U+0402 afii10051 -!A3 U+0403 afii10052 -!A4 U+0404 afii10053 -!A5 U+0405 afii10054 -!A6 U+0406 afii10055 -!A7 U+0407 afii10056 -!A8 U+0408 afii10057 -!A9 U+0409 afii10058 -!AA U+040A afii10059 -!AB U+040B afii10060 -!AC U+040C afii10061 -!AD U+00AD hyphen -!AE U+040E afii10062 -!AF U+040F afii10145 -!B0 U+0410 afii10017 -!B1 U+0411 afii10018 -!B2 U+0412 afii10019 -!B3 U+0413 afii10020 -!B4 U+0414 afii10021 -!B5 U+0415 afii10022 -!B6 U+0416 afii10024 -!B7 U+0417 afii10025 -!B8 U+0418 afii10026 -!B9 U+0419 afii10027 -!BA U+041A afii10028 -!BB U+041B afii10029 -!BC U+041C afii10030 -!BD U+041D afii10031 -!BE U+041E afii10032 -!BF U+041F afii10033 -!C0 U+0420 afii10034 -!C1 U+0421 afii10035 -!C2 U+0422 afii10036 -!C3 U+0423 afii10037 -!C4 U+0424 afii10038 -!C5 U+0425 afii10039 -!C6 U+0426 afii10040 -!C7 U+0427 afii10041 -!C8 U+0428 afii10042 -!C9 U+0429 afii10043 -!CA U+042A afii10044 -!CB U+042B afii10045 -!CC U+042C afii10046 -!CD U+042D afii10047 -!CE U+042E afii10048 -!CF U+042F afii10049 -!D0 U+0430 afii10065 -!D1 U+0431 afii10066 -!D2 U+0432 afii10067 -!D3 U+0433 afii10068 -!D4 U+0434 afii10069 -!D5 U+0435 afii10070 -!D6 U+0436 afii10072 -!D7 U+0437 afii10073 -!D8 U+0438 afii10074 -!D9 U+0439 afii10075 -!DA U+043A afii10076 -!DB U+043B afii10077 -!DC U+043C afii10078 -!DD U+043D afii10079 -!DE U+043E afii10080 -!DF U+043F afii10081 -!E0 U+0440 afii10082 -!E1 U+0441 afii10083 -!E2 U+0442 afii10084 -!E3 U+0443 afii10085 -!E4 U+0444 afii10086 -!E5 U+0445 afii10087 -!E6 U+0446 afii10088 -!E7 U+0447 afii10089 -!E8 U+0448 afii10090 -!E9 U+0449 afii10091 -!EA U+044A afii10092 -!EB U+044B afii10093 -!EC U+044C afii10094 -!ED U+044D afii10095 -!EE U+044E afii10096 -!EF U+044F afii10097 -!F0 U+2116 afii61352 -!F1 U+0451 afii10071 -!F2 U+0452 afii10099 -!F3 U+0453 afii10100 -!F4 U+0454 afii10101 -!F5 U+0455 afii10102 -!F6 U+0456 afii10103 -!F7 U+0457 afii10104 -!F8 U+0458 afii10105 -!F9 U+0459 afii10106 -!FA U+045A afii10107 -!FB U+045B afii10108 -!FC U+045C afii10109 -!FD U+00A7 section -!FE U+045E afii10110 -!FF U+045F afii10193 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-7.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-7.map deleted file mode 100644 index e163796b1c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-7.map +++ /dev/null @@ -1,250 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+2018 quoteleft -!A2 U+2019 quoteright -!A3 U+00A3 sterling -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AF U+2015 afii00208 -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+0384 tonos -!B5 U+0385 dieresistonos -!B6 U+0386 Alphatonos -!B7 U+00B7 periodcentered -!B8 U+0388 Epsilontonos -!B9 U+0389 Etatonos -!BA U+038A Iotatonos -!BB U+00BB guillemotright -!BC U+038C Omicrontonos -!BD U+00BD onehalf -!BE U+038E Upsilontonos -!BF U+038F Omegatonos -!C0 U+0390 iotadieresistonos -!C1 U+0391 Alpha -!C2 U+0392 Beta -!C3 U+0393 Gamma -!C4 U+0394 Delta -!C5 U+0395 Epsilon -!C6 U+0396 Zeta -!C7 U+0397 Eta -!C8 U+0398 Theta -!C9 U+0399 Iota -!CA U+039A Kappa -!CB U+039B Lambda -!CC U+039C Mu -!CD U+039D Nu -!CE U+039E Xi -!CF U+039F Omicron -!D0 U+03A0 Pi -!D1 U+03A1 Rho -!D3 U+03A3 Sigma -!D4 U+03A4 Tau -!D5 U+03A5 Upsilon -!D6 U+03A6 Phi -!D7 U+03A7 Chi -!D8 U+03A8 Psi -!D9 U+03A9 Omega -!DA U+03AA Iotadieresis -!DB U+03AB Upsilondieresis -!DC U+03AC alphatonos -!DD U+03AD epsilontonos -!DE U+03AE etatonos -!DF U+03AF iotatonos -!E0 U+03B0 upsilondieresistonos -!E1 U+03B1 alpha -!E2 U+03B2 beta -!E3 U+03B3 gamma -!E4 U+03B4 delta -!E5 U+03B5 epsilon -!E6 U+03B6 zeta -!E7 U+03B7 eta -!E8 U+03B8 theta -!E9 U+03B9 iota -!EA U+03BA kappa -!EB U+03BB lambda -!EC U+03BC mu -!ED U+03BD nu -!EE U+03BE xi -!EF U+03BF omicron -!F0 U+03C0 pi -!F1 U+03C1 rho -!F2 U+03C2 sigma1 -!F3 U+03C3 sigma -!F4 U+03C4 tau -!F5 U+03C5 upsilon -!F6 U+03C6 phi -!F7 U+03C7 chi -!F8 U+03C8 psi -!F9 U+03C9 omega -!FA U+03CA iotadieresis -!FB U+03CB upsilondieresis -!FC U+03CC omicrontonos -!FD U+03CD upsilontonos -!FE U+03CE omegatonos diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-9.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-9.map deleted file mode 100644 index 48c123ae6f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/iso-8859-9.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+0080 .notdef -!81 U+0081 .notdef -!82 U+0082 .notdef -!83 U+0083 .notdef -!84 U+0084 .notdef -!85 U+0085 .notdef -!86 U+0086 .notdef -!87 U+0087 .notdef -!88 U+0088 .notdef -!89 U+0089 .notdef -!8A U+008A .notdef -!8B U+008B .notdef -!8C U+008C .notdef -!8D U+008D .notdef -!8E U+008E .notdef -!8F U+008F .notdef -!90 U+0090 .notdef -!91 U+0091 .notdef -!92 U+0092 .notdef -!93 U+0093 .notdef -!94 U+0094 .notdef -!95 U+0095 .notdef -!96 U+0096 .notdef -!97 U+0097 .notdef -!98 U+0098 .notdef -!99 U+0099 .notdef -!9A U+009A .notdef -!9B U+009B .notdef -!9C U+009C .notdef -!9D U+009D .notdef -!9E U+009E .notdef -!9F U+009F .notdef -!A0 U+00A0 space -!A1 U+00A1 exclamdown -!A2 U+00A2 cent -!A3 U+00A3 sterling -!A4 U+00A4 currency -!A5 U+00A5 yen -!A6 U+00A6 brokenbar -!A7 U+00A7 section -!A8 U+00A8 dieresis -!A9 U+00A9 copyright -!AA U+00AA ordfeminine -!AB U+00AB guillemotleft -!AC U+00AC logicalnot -!AD U+00AD hyphen -!AE U+00AE registered -!AF U+00AF macron -!B0 U+00B0 degree -!B1 U+00B1 plusminus -!B2 U+00B2 twosuperior -!B3 U+00B3 threesuperior -!B4 U+00B4 acute -!B5 U+00B5 mu -!B6 U+00B6 paragraph -!B7 U+00B7 periodcentered -!B8 U+00B8 cedilla -!B9 U+00B9 onesuperior -!BA U+00BA ordmasculine -!BB U+00BB guillemotright -!BC U+00BC onequarter -!BD U+00BD onehalf -!BE U+00BE threequarters -!BF U+00BF questiondown -!C0 U+00C0 Agrave -!C1 U+00C1 Aacute -!C2 U+00C2 Acircumflex -!C3 U+00C3 Atilde -!C4 U+00C4 Adieresis -!C5 U+00C5 Aring -!C6 U+00C6 AE -!C7 U+00C7 Ccedilla -!C8 U+00C8 Egrave -!C9 U+00C9 Eacute -!CA U+00CA Ecircumflex -!CB U+00CB Edieresis -!CC U+00CC Igrave -!CD U+00CD Iacute -!CE U+00CE Icircumflex -!CF U+00CF Idieresis -!D0 U+011E Gbreve -!D1 U+00D1 Ntilde -!D2 U+00D2 Ograve -!D3 U+00D3 Oacute -!D4 U+00D4 Ocircumflex -!D5 U+00D5 Otilde -!D6 U+00D6 Odieresis -!D7 U+00D7 multiply -!D8 U+00D8 Oslash -!D9 U+00D9 Ugrave -!DA U+00DA Uacute -!DB U+00DB Ucircumflex -!DC U+00DC Udieresis -!DD U+0130 Idotaccent -!DE U+015E Scedilla -!DF U+00DF germandbls -!E0 U+00E0 agrave -!E1 U+00E1 aacute -!E2 U+00E2 acircumflex -!E3 U+00E3 atilde -!E4 U+00E4 adieresis -!E5 U+00E5 aring -!E6 U+00E6 ae -!E7 U+00E7 ccedilla -!E8 U+00E8 egrave -!E9 U+00E9 eacute -!EA U+00EA ecircumflex -!EB U+00EB edieresis -!EC U+00EC igrave -!ED U+00ED iacute -!EE U+00EE icircumflex -!EF U+00EF idieresis -!F0 U+011F gbreve -!F1 U+00F1 ntilde -!F2 U+00F2 ograve -!F3 U+00F3 oacute -!F4 U+00F4 ocircumflex -!F5 U+00F5 otilde -!F6 U+00F6 odieresis -!F7 U+00F7 divide -!F8 U+00F8 oslash -!F9 U+00F9 ugrave -!FA U+00FA uacute -!FB U+00FB ucircumflex -!FC U+00FC udieresis -!FD U+0131 dotlessi -!FE U+015F scedilla -!FF U+00FF ydieresis diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-r.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-r.map deleted file mode 100644 index 6ad5d05d0d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-r.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+2500 SF100000 -!81 U+2502 SF110000 -!82 U+250C SF010000 -!83 U+2510 SF030000 -!84 U+2514 SF020000 -!85 U+2518 SF040000 -!86 U+251C SF080000 -!87 U+2524 SF090000 -!88 U+252C SF060000 -!89 U+2534 SF070000 -!8A U+253C SF050000 -!8B U+2580 upblock -!8C U+2584 dnblock -!8D U+2588 block -!8E U+258C lfblock -!8F U+2590 rtblock -!90 U+2591 ltshade -!91 U+2592 shade -!92 U+2593 dkshade -!93 U+2320 integraltp -!94 U+25A0 filledbox -!95 U+2219 periodcentered -!96 U+221A radical -!97 U+2248 approxequal -!98 U+2264 lessequal -!99 U+2265 greaterequal -!9A U+00A0 space -!9B U+2321 integralbt -!9C U+00B0 degree -!9D U+00B2 twosuperior -!9E U+00B7 periodcentered -!9F U+00F7 divide -!A0 U+2550 SF430000 -!A1 U+2551 SF240000 -!A2 U+2552 SF510000 -!A3 U+0451 afii10071 -!A4 U+2553 SF520000 -!A5 U+2554 SF390000 -!A6 U+2555 SF220000 -!A7 U+2556 SF210000 -!A8 U+2557 SF250000 -!A9 U+2558 SF500000 -!AA U+2559 SF490000 -!AB U+255A SF380000 -!AC U+255B SF280000 -!AD U+255C SF270000 -!AE U+255D SF260000 -!AF U+255E SF360000 -!B0 U+255F SF370000 -!B1 U+2560 SF420000 -!B2 U+2561 SF190000 -!B3 U+0401 afii10023 -!B4 U+2562 SF200000 -!B5 U+2563 SF230000 -!B6 U+2564 SF470000 -!B7 U+2565 SF480000 -!B8 U+2566 SF410000 -!B9 U+2567 SF450000 -!BA U+2568 SF460000 -!BB U+2569 SF400000 -!BC U+256A SF540000 -!BD U+256B SF530000 -!BE U+256C SF440000 -!BF U+00A9 copyright -!C0 U+044E afii10096 -!C1 U+0430 afii10065 -!C2 U+0431 afii10066 -!C3 U+0446 afii10088 -!C4 U+0434 afii10069 -!C5 U+0435 afii10070 -!C6 U+0444 afii10086 -!C7 U+0433 afii10068 -!C8 U+0445 afii10087 -!C9 U+0438 afii10074 -!CA U+0439 afii10075 -!CB U+043A afii10076 -!CC U+043B afii10077 -!CD U+043C afii10078 -!CE U+043D afii10079 -!CF U+043E afii10080 -!D0 U+043F afii10081 -!D1 U+044F afii10097 -!D2 U+0440 afii10082 -!D3 U+0441 afii10083 -!D4 U+0442 afii10084 -!D5 U+0443 afii10085 -!D6 U+0436 afii10072 -!D7 U+0432 afii10067 -!D8 U+044C afii10094 -!D9 U+044B afii10093 -!DA U+0437 afii10073 -!DB U+0448 afii10090 -!DC U+044D afii10095 -!DD U+0449 afii10091 -!DE U+0447 afii10089 -!DF U+044A afii10092 -!E0 U+042E afii10048 -!E1 U+0410 afii10017 -!E2 U+0411 afii10018 -!E3 U+0426 afii10040 -!E4 U+0414 afii10021 -!E5 U+0415 afii10022 -!E6 U+0424 afii10038 -!E7 U+0413 afii10020 -!E8 U+0425 afii10039 -!E9 U+0418 afii10026 -!EA U+0419 afii10027 -!EB U+041A afii10028 -!EC U+041B afii10029 -!ED U+041C afii10030 -!EE U+041D afii10031 -!EF U+041E afii10032 -!F0 U+041F afii10033 -!F1 U+042F afii10049 -!F2 U+0420 afii10034 -!F3 U+0421 afii10035 -!F4 U+0422 afii10036 -!F5 U+0423 afii10037 -!F6 U+0416 afii10024 -!F7 U+0412 afii10019 -!F8 U+042C afii10046 -!F9 U+042B afii10045 -!FA U+0417 afii10025 -!FB U+0428 afii10042 -!FC U+042D afii10047 -!FD U+0429 afii10043 -!FE U+0427 afii10041 -!FF U+042A afii10044 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-u.map b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-u.map deleted file mode 100644 index 40a7e4fd7e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/enc/koi8-u.map +++ /dev/null @@ -1,256 +0,0 @@ -!00 U+0000 .notdef -!01 U+0001 .notdef -!02 U+0002 .notdef -!03 U+0003 .notdef -!04 U+0004 .notdef -!05 U+0005 .notdef -!06 U+0006 .notdef -!07 U+0007 .notdef -!08 U+0008 .notdef -!09 U+0009 .notdef -!0A U+000A .notdef -!0B U+000B .notdef -!0C U+000C .notdef -!0D U+000D .notdef -!0E U+000E .notdef -!0F U+000F .notdef -!10 U+0010 .notdef -!11 U+0011 .notdef -!12 U+0012 .notdef -!13 U+0013 .notdef -!14 U+0014 .notdef -!15 U+0015 .notdef -!16 U+0016 .notdef -!17 U+0017 .notdef -!18 U+0018 .notdef -!19 U+0019 .notdef -!1A U+001A .notdef -!1B U+001B .notdef -!1C U+001C .notdef -!1D U+001D .notdef -!1E U+001E .notdef -!1F U+001F .notdef -!20 U+0020 space -!21 U+0021 exclam -!22 U+0022 quotedbl -!23 U+0023 numbersign -!24 U+0024 dollar -!25 U+0025 percent -!26 U+0026 ampersand -!27 U+0027 quotesingle -!28 U+0028 parenleft -!29 U+0029 parenright -!2A U+002A asterisk -!2B U+002B plus -!2C U+002C comma -!2D U+002D hyphen -!2E U+002E period -!2F U+002F slash -!30 U+0030 zero -!31 U+0031 one -!32 U+0032 two -!33 U+0033 three -!34 U+0034 four -!35 U+0035 five -!36 U+0036 six -!37 U+0037 seven -!38 U+0038 eight -!39 U+0039 nine -!3A U+003A colon -!3B U+003B semicolon -!3C U+003C less -!3D U+003D equal -!3E U+003E greater -!3F U+003F question -!40 U+0040 at -!41 U+0041 A -!42 U+0042 B -!43 U+0043 C -!44 U+0044 D -!45 U+0045 E -!46 U+0046 F -!47 U+0047 G -!48 U+0048 H -!49 U+0049 I -!4A U+004A J -!4B U+004B K -!4C U+004C L -!4D U+004D M -!4E U+004E N -!4F U+004F O -!50 U+0050 P -!51 U+0051 Q -!52 U+0052 R -!53 U+0053 S -!54 U+0054 T -!55 U+0055 U -!56 U+0056 V -!57 U+0057 W -!58 U+0058 X -!59 U+0059 Y -!5A U+005A Z -!5B U+005B bracketleft -!5C U+005C backslash -!5D U+005D bracketright -!5E U+005E asciicircum -!5F U+005F underscore -!60 U+0060 grave -!61 U+0061 a -!62 U+0062 b -!63 U+0063 c -!64 U+0064 d -!65 U+0065 e -!66 U+0066 f -!67 U+0067 g -!68 U+0068 h -!69 U+0069 i -!6A U+006A j -!6B U+006B k -!6C U+006C l -!6D U+006D m -!6E U+006E n -!6F U+006F o -!70 U+0070 p -!71 U+0071 q -!72 U+0072 r -!73 U+0073 s -!74 U+0074 t -!75 U+0075 u -!76 U+0076 v -!77 U+0077 w -!78 U+0078 x -!79 U+0079 y -!7A U+007A z -!7B U+007B braceleft -!7C U+007C bar -!7D U+007D braceright -!7E U+007E asciitilde -!7F U+007F .notdef -!80 U+2500 SF100000 -!81 U+2502 SF110000 -!82 U+250C SF010000 -!83 U+2510 SF030000 -!84 U+2514 SF020000 -!85 U+2518 SF040000 -!86 U+251C SF080000 -!87 U+2524 SF090000 -!88 U+252C SF060000 -!89 U+2534 SF070000 -!8A U+253C SF050000 -!8B U+2580 upblock -!8C U+2584 dnblock -!8D U+2588 block -!8E U+258C lfblock -!8F U+2590 rtblock -!90 U+2591 ltshade -!91 U+2592 shade -!92 U+2593 dkshade -!93 U+2320 integraltp -!94 U+25A0 filledbox -!95 U+2022 bullet -!96 U+221A radical -!97 U+2248 approxequal -!98 U+2264 lessequal -!99 U+2265 greaterequal -!9A U+00A0 space -!9B U+2321 integralbt -!9C U+00B0 degree -!9D U+00B2 twosuperior -!9E U+00B7 periodcentered -!9F U+00F7 divide -!A0 U+2550 SF430000 -!A1 U+2551 SF240000 -!A2 U+2552 SF510000 -!A3 U+0451 afii10071 -!A4 U+0454 afii10101 -!A5 U+2554 SF390000 -!A6 U+0456 afii10103 -!A7 U+0457 afii10104 -!A8 U+2557 SF250000 -!A9 U+2558 SF500000 -!AA U+2559 SF490000 -!AB U+255A SF380000 -!AC U+255B SF280000 -!AD U+0491 afii10098 -!AE U+255D SF260000 -!AF U+255E SF360000 -!B0 U+255F SF370000 -!B1 U+2560 SF420000 -!B2 U+2561 SF190000 -!B3 U+0401 afii10023 -!B4 U+0404 afii10053 -!B5 U+2563 SF230000 -!B6 U+0406 afii10055 -!B7 U+0407 afii10056 -!B8 U+2566 SF410000 -!B9 U+2567 SF450000 -!BA U+2568 SF460000 -!BB U+2569 SF400000 -!BC U+256A SF540000 -!BD U+0490 afii10050 -!BE U+256C SF440000 -!BF U+00A9 copyright -!C0 U+044E afii10096 -!C1 U+0430 afii10065 -!C2 U+0431 afii10066 -!C3 U+0446 afii10088 -!C4 U+0434 afii10069 -!C5 U+0435 afii10070 -!C6 U+0444 afii10086 -!C7 U+0433 afii10068 -!C8 U+0445 afii10087 -!C9 U+0438 afii10074 -!CA U+0439 afii10075 -!CB U+043A afii10076 -!CC U+043B afii10077 -!CD U+043C afii10078 -!CE U+043D afii10079 -!CF U+043E afii10080 -!D0 U+043F afii10081 -!D1 U+044F afii10097 -!D2 U+0440 afii10082 -!D3 U+0441 afii10083 -!D4 U+0442 afii10084 -!D5 U+0443 afii10085 -!D6 U+0436 afii10072 -!D7 U+0432 afii10067 -!D8 U+044C afii10094 -!D9 U+044B afii10093 -!DA U+0437 afii10073 -!DB U+0448 afii10090 -!DC U+044D afii10095 -!DD U+0449 afii10091 -!DE U+0447 afii10089 -!DF U+044A afii10092 -!E0 U+042E afii10048 -!E1 U+0410 afii10017 -!E2 U+0411 afii10018 -!E3 U+0426 afii10040 -!E4 U+0414 afii10021 -!E5 U+0415 afii10022 -!E6 U+0424 afii10038 -!E7 U+0413 afii10020 -!E8 U+0425 afii10039 -!E9 U+0418 afii10026 -!EA U+0419 afii10027 -!EB U+041A afii10028 -!EC U+041B afii10029 -!ED U+041C afii10030 -!EE U+041D afii10031 -!EF U+041E afii10032 -!F0 U+041F afii10033 -!F1 U+042F afii10049 -!F2 U+0420 afii10034 -!F3 U+0421 afii10035 -!F4 U+0422 afii10036 -!F5 U+0423 afii10037 -!F6 U+0416 afii10024 -!F7 U+0412 afii10019 -!F8 U+042C afii10046 -!F9 U+042B afii10045 -!FA U+0417 afii10025 -!FB U+0428 afii10042 -!FC U+042D afii10047 -!FD U+0429 afii10043 -!FE U+0427 afii10041 -!FF U+042A afii10044 diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll deleted file mode 100644 index 53878a0312..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/freetype6.dll and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makeallttffonts.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makeallttffonts.php deleted file mode 100644 index e84164256b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makeallttffonts.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php -//============================================================+ -// File name : makeallttffonts.php -// Begin : 2008-12-07 -// Last Update : 2010-08-08 -// -// Description : Process all TTF files on current directory to -// build TCPDF compatible font files. -// -// Author: Nicola Asuni -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com S.r.l. -// Via della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -// -// License: -// Copyright (C) 2004-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -//============================================================+ - -/** - * Process all TTF files on current directory to build TCPDF compatible font files. - * @package com.tecnick.tcpdf - * @author Nicola Asuni - * @copyright Copyright &copy; 2004-2009, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License - * @link www.tecnick.com - * @since 2008-12-07 - */ - -/** - */ - -// read directory for files (only graphics files). -$handle = opendir('.'); -while($file = readdir($handle)) { - $path_parts = pathinfo($file); - $file_ext = strtolower($path_parts['extension']); - if ($file_ext == 'ttf') { - exec('./ttf2ufm -a -F '.$path_parts['basename'].''); - exec('php -q makefont.php '.$path_parts['basename'].' '.$path_parts['filename'].'.ufm'); - } -} -closedir($handle); - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makefont.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makefont.php deleted file mode 100644 index 608ec04073..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/makefont.php +++ /dev/null @@ -1,615 +0,0 @@ -<?php -//============================================================+ -// File name : makefont.php -// Begin : 2004-12-31 -// Last Update : 2010-08-08 -// Version : 1.2.006 -// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html) -// ---------------------------------------------------------------------------- -// Copyright (C) 2008-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ---------------------------------------------------------------------------- -// -// Description : Utility to generate font definition files fot TCPDF -// -// Authors: Nicola Asuni, Olivier Plathey, Steven Wittens -// -// (c) Copyright: -// Nicola Asuni -// Tecnick.com S.r.l. -// Via della Pace, 11 -// 09044 Quartucciu (CA) -// ITALY -// www.tecnick.com -// info@tecnick.com -//============================================================+ - -/** - * Utility to generate font definition files fot TCPDF. - * @author Nicola Asuni, Olivier Plathey, Steven Wittens - * @copyright 2004-2008 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @package com.tecnick.tcpdf - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL -*/ - -/** - * - * @param string $fontfile path to font file (TTF, OTF or PFB). - * @param string $fmfile font metrics file (UFM or AFM). - * @param boolean $embedded Set to false to not embed the font, true otherwise (default). - * @param string $enc Name of the encoding table to use. Omit this parameter for TrueType Unicode, OpenType Unicode and symbolic fonts like Symbol or ZapfDingBats. - * @param array $patch Optional modification of the encoding - */ -function MakeFont($fontfile, $fmfile, $embedded=true, $enc='cp1252', $patch=array()) { - //Generate a font definition file - set_magic_quotes_runtime(0); - ini_set('auto_detect_line_endings', '1'); - if (!file_exists($fontfile)) { - die('Error: file not found: '.$fontfile); - } - if (!file_exists($fmfile)) { - die('Error: file not found: '.$fmfile); - } - $cidtogidmap = ''; - $map = array(); - $diff = ''; - $dw = 0; // default width - $ffext = strtolower(substr($fontfile, -3)); - $fmext = strtolower(substr($fmfile, -3)); - if ($fmext == 'afm') { - if (($ffext == 'ttf') OR ($ffext == 'otf')) { - $type = 'TrueType'; - } elseif ($ffext == 'pfb') { - $type = 'Type1'; - } else { - die('Error: unrecognized font file extension: '.$ffext); - } - if ($enc) { - $map = ReadMap($enc); - foreach ($patch as $cc => $gn) { - $map[$cc] = $gn; - } - } - $fm = ReadAFM($fmfile, $map); - if (isset($widths['.notdef'])) { - $dw = $widths['.notdef']; - } - if ($enc) { - $diff = MakeFontEncoding($map); - } - $fd = MakeFontDescriptor($fm, empty($map)); - } elseif ($fmext == 'ufm') { - $enc = ''; - if (($ffext == 'ttf') OR ($ffext == 'otf')) { - $type = 'TrueTypeUnicode'; - } else { - die('Error: not a TrueType font: '.$ffext); - } - $fm = ReadUFM($fmfile, $cidtogidmap); - $dw = $fm['MissingWidth']; - $fd = MakeFontDescriptor($fm, false); - } - //Start generation - $s = '<?php'."\n"; - $s .= '$type=\''.$type."';\n"; - $s .= '$name=\''.$fm['FontName']."';\n"; - $s .= '$desc='.$fd.";\n"; - if (!isset($fm['UnderlinePosition'])) { - $fm['UnderlinePosition'] = -100; - } - if (!isset($fm['UnderlineThickness'])) { - $fm['UnderlineThickness'] = 50; - } - $s .= '$up='.$fm['UnderlinePosition'].";\n"; - $s .= '$ut='.$fm['UnderlineThickness'].";\n"; - if ($dw <= 0) { - if (isset($fm['Widths'][32]) AND ($fm['Widths'][32] > 0)) { - // assign default space width - $dw = $fm['Widths'][32]; - } else { - $dw = 600; - } - } - $s .= '$dw='.$dw.";\n"; - $w = MakeWidthArray($fm); - $s .= '$cw='.$w.";\n"; - $s .= '$enc=\''.$enc."';\n"; - $s .= '$diff=\''.$diff."';\n"; - $basename = substr(basename($fmfile), 0, -4); - if ($embedded) { - //Embedded font - if (($type == 'TrueType') OR ($type == 'TrueTypeUnicode')) { - CheckTTF($fontfile); - } - $f = fopen($fontfile,'rb'); - if (!$f) { - die('Error: Unable to open '.$fontfile); - } - $file = fread($f, filesize($fontfile)); - fclose($f); - if ($type == 'Type1') { - //Find first two sections and discard third one - $header = (ord($file{0}) == 128); - if ($header) { - //Strip first binary header - $file = substr($file, 6); - } - $pos = strpos($file, 'eexec'); - if (!$pos) { - die('Error: font file does not seem to be valid Type1'); - } - $size1 = $pos + 6; - if ($header AND (ord($file{$size1}) == 128)) { - //Strip second binary header - $file = substr($file, 0, $size1).substr($file, $size1+6); - } - $pos = strpos($file, '00000000'); - if (!$pos) { - die('Error: font file does not seem to be valid Type1'); - } - $size2 = $pos - $size1; - $file = substr($file, 0, ($size1 + $size2)); - } - $basename = strtolower($basename); - if (function_exists('gzcompress')) { - $cmp = $basename.'.z'; - SaveToFile($cmp, gzcompress($file, 9), 'b'); - $s .= '$file=\''.$cmp."';\n"; - print "Font file compressed (".$cmp.")\n"; - if (!empty($cidtogidmap)) { - $cmp = $basename.'.ctg.z'; - SaveToFile($cmp, gzcompress($cidtogidmap, 9), 'b'); - print "CIDToGIDMap created and compressed (".$cmp.")\n"; - $s .= '$ctg=\''.$cmp."';\n"; - } - } else { - $s .= '$file=\''.basename($fontfile)."';\n"; - print "Notice: font file could not be compressed (zlib extension not available)\n"; - if (!empty($cidtogidmap)) { - $cmp = $basename.'.ctg'; - $f = fopen($cmp, 'wb'); - fwrite($f, $cidtogidmap); - fclose($f); - print "CIDToGIDMap created (".$cmp.")\n"; - $s .= '$ctg=\''.$cmp."';\n"; - } - } - if($type == 'Type1') { - $s .= '$size1='.$size1.";\n"; - $s .= '$size2='.$size2.";\n"; - } else { - $s.='$originalsize='.filesize($fontfile).";\n"; - } - } else { - //Not embedded font - $s .= '$file='."'';\n"; - } - $s .= '// --- EOF ---'; - SaveToFile($basename.'.php',$s); - print "Font definition file generated (".$basename.".php)\n"; -} - -/** - * Read the specified encoding map. - * @param string $enc map name (see /enc/ folder for valid names). - */ -function ReadMap($enc) { - //Read a map file - $file = dirname(__FILE__).'/enc/'.strtolower($enc).'.map'; - $a = file($file); - if (empty($a)) { - die('Error: encoding not found: '.$enc); - } - $cc2gn = array(); - foreach ($a as $l) { - if ($l{0} == '!') { - $e = preg_split('/[ \\t]+/',rtrim($l)); - $cc = hexdec(substr($e[0],1)); - $gn = $e[2]; - $cc2gn[$cc] = $gn; - } - } - for($i = 0; $i <= 255; $i++) { - if(!isset($cc2gn[$i])) { - $cc2gn[$i] = '.notdef'; - } - } - return $cc2gn; -} - -/** - * Read UFM file - */ -function ReadUFM($file, &$cidtogidmap) { - //Prepare empty CIDToGIDMap - $cidtogidmap = str_pad('', (256 * 256 * 2), "\x00"); - //Read a font metric file - $a = file($file); - if (empty($a)) { - die('File not found'); - } - $widths = array(); - $fm = array(); - foreach($a as $l) { - $e = explode(' ',chop($l)); - if(count($e) < 2) { - continue; - } - $code = $e[0]; - $param = $e[1]; - if($code == 'U') { - // U 827 ; WX 0 ; N squaresubnosp ; G 675 ; - //Character metrics - $cc = (int)$e[1]; - if ($cc != -1) { - $gn = $e[7]; - $w = $e[4]; - $glyph = $e[10]; - $widths[$cc] = $w; - if($cc == ord('X')) { - $fm['CapXHeight'] = $e[13]; - } - // Set GID - if (($cc >= 0) AND ($cc < 0xFFFF) AND $glyph) { - $cidtogidmap{($cc * 2)} = chr($glyph >> 8); - $cidtogidmap{(($cc * 2) + 1)} = chr($glyph & 0xFF); - } - } - if((isset($gn) AND ($gn == '.notdef')) AND (!isset($fm['MissingWidth']))) { - $fm['MissingWidth'] = $w; - } - } elseif($code == 'FontName') { - $fm['FontName'] = $param; - } elseif($code == 'Weight') { - $fm['Weight'] = $param; - } elseif($code == 'ItalicAngle') { - $fm['ItalicAngle'] = (double)$param; - } elseif($code == 'Ascender') { - $fm['Ascender'] = (int)$param; - } elseif($code == 'Descender') { - $fm['Descender'] = (int)$param; - } elseif($code == 'UnderlineThickness') { - $fm['UnderlineThickness'] = (int)$param; - } elseif($code == 'UnderlinePosition') { - $fm['UnderlinePosition'] = (int)$param; - } elseif($code == 'IsFixedPitch') { - $fm['IsFixedPitch'] = ($param == 'true'); - } elseif($code == 'FontBBox') { - $fm['FontBBox'] = array($e[1], $e[2], $e[3], $e[4]); - } elseif($code == 'CapHeight') { - $fm['CapHeight'] = (int)$param; - } elseif($code == 'StdVW') { - $fm['StdVW'] = (int)$param; - } - } - if(!isset($fm['MissingWidth'])) { - $fm['MissingWidth'] = 600; - } - if(!isset($fm['FontName'])) { - die('FontName not found'); - } - $fm['Widths'] = $widths; - return $fm; -} - -/** - * Read AFM file - */ -function ReadAFM($file,&$map) { - //Read a font metric file - $a = file($file); - if(empty($a)) { - die('File not found'); - } - $widths = array(); - $fm = array(); - $fix = array( - 'Edot'=>'Edotaccent', - 'edot'=>'edotaccent', - 'Idot'=>'Idotaccent', - 'Zdot'=>'Zdotaccent', - 'zdot'=>'zdotaccent', - 'Odblacute' => 'Ohungarumlaut', - 'odblacute' => 'ohungarumlaut', - 'Udblacute'=>'Uhungarumlaut', - 'udblacute'=>'uhungarumlaut', - 'Gcedilla'=>'Gcommaaccent' - ,'gcedilla'=>'gcommaaccent', - 'Kcedilla'=>'Kcommaaccent', - 'kcedilla'=>'kcommaaccent', - 'Lcedilla'=>'Lcommaaccent', - 'lcedilla'=>'lcommaaccent', - 'Ncedilla'=>'Ncommaaccent', - 'ncedilla'=>'ncommaaccent', - 'Rcedilla'=>'Rcommaaccent', - 'rcedilla'=>'rcommaaccent', - 'Scedilla'=>'Scommaaccent', - 'scedilla'=>'scommaaccent', - 'Tcedilla'=>'Tcommaaccent', - 'tcedilla'=>'tcommaaccent', - 'Dslash'=>'Dcroat', - 'dslash'=>'dcroat', - 'Dmacron'=>'Dcroat', - 'dmacron'=>'dcroat', - 'combininggraveaccent'=>'gravecomb', - 'combininghookabove'=>'hookabovecomb', - 'combiningtildeaccent'=>'tildecomb', - 'combiningacuteaccent'=>'acutecomb', - 'combiningdotbelow'=>'dotbelowcomb', - 'dongsign'=>'dong' - ); - foreach($a as $l) { - $e = explode(' ', rtrim($l)); - if (count($e) < 2) { - continue; - } - $code = $e[0]; - $param = $e[1]; - if ($code == 'C') { - //Character metrics - $cc = (int)$e[1]; - $w = $e[4]; - $gn = $e[7]; - if (substr($gn, -4) == '20AC') { - $gn = 'Euro'; - } - if (isset($fix[$gn])) { - //Fix incorrect glyph name - foreach ($map as $c => $n) { - if ($n == $fix[$gn]) { - $map[$c] = $gn; - } - } - } - if (empty($map)) { - //Symbolic font: use built-in encoding - $widths[$cc] = $w; - } else { - $widths[$gn] = $w; - if($gn == 'X') { - $fm['CapXHeight'] = $e[13]; - } - } - if($gn == '.notdef') { - $fm['MissingWidth'] = $w; - } - } elseif($code == 'FontName') { - $fm['FontName'] = $param; - } elseif($code == 'Weight') { - $fm['Weight'] = $param; - } elseif($code == 'ItalicAngle') { - $fm['ItalicAngle'] = (double)$param; - } elseif($code == 'Ascender') { - $fm['Ascender'] = (int)$param; - } elseif($code == 'Descender') { - $fm['Descender'] = (int)$param; - } elseif($code == 'UnderlineThickness') { - $fm['UnderlineThickness'] = (int)$param; - } elseif($code == 'UnderlinePosition') { - $fm['UnderlinePosition'] = (int)$param; - } elseif($code == 'IsFixedPitch') { - $fm['IsFixedPitch'] = ($param == 'true'); - } elseif($code == 'FontBBox') { - $fm['FontBBox'] = array($e[1], $e[2], $e[3], $e[4]); - } elseif($code == 'CapHeight') { - $fm['CapHeight'] = (int)$param; - } elseif($code == 'StdVW') { - $fm['StdVW'] = (int)$param; - } - } - if (!isset($fm['FontName'])) { - die('FontName not found'); - } - if (!empty($map)) { - if (!isset($widths['.notdef'])) { - $widths['.notdef'] = 600; - } - if (!isset($widths['Delta']) AND isset($widths['increment'])) { - $widths['Delta'] = $widths['increment']; - } - //Order widths according to map - for ($i = 0; $i <= 255; $i++) { - if (!isset($widths[$map[$i]])) { - print "Warning: character ".$map[$i]." is missing\n"; - $widths[$i] = $widths['.notdef']; - } else { - $widths[$i] = $widths[$map[$i]]; - } - } - } - $fm['Widths'] = $widths; - return $fm; -} - -function MakeFontDescriptor($fm, $symbolic=false) { - //Ascent - $asc = (isset($fm['Ascender']) ? $fm['Ascender'] : 1000); - $fd = "array('Ascent'=>".$asc; - //Descent - $desc = (isset($fm['Descender']) ? $fm['Descender'] : -200); - $fd .= ",'Descent'=>".$desc; - //CapHeight - if (isset($fm['CapHeight'])) { - $ch = $fm['CapHeight']; - } elseif (isset($fm['CapXHeight'])) { - $ch = $fm['CapXHeight']; - } else { - $ch = $asc; - } - $fd .= ",'CapHeight'=>".$ch; - //Flags - $flags = 0; - if (isset($fm['IsFixedPitch']) AND $fm['IsFixedPitch']) { - $flags += 1<<0; - } - if ($symbolic) { - $flags += 1<<2; - } else { - $flags += 1<<5; - } - if (isset($fm['ItalicAngle']) AND ($fm['ItalicAngle'] != 0)) { - $flags += 1<<6; - } - $fd .= ",'Flags'=>".$flags; - //FontBBox - if (isset($fm['FontBBox'])) { - $fbb = $fm['FontBBox']; - } else { - $fbb = array(0, ($desc - 100), 1000, ($asc + 100)); - } - $fd .= ",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; - //ItalicAngle - $ia = (isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); - $fd .= ",'ItalicAngle'=>".$ia; - //StemV - if (isset($fm['StdVW'])) { - $stemv = $fm['StdVW']; - } elseif (isset($fm['Weight']) AND preg_match('/(bold|black)/i', $fm['Weight'])) { - $stemv = 120; - } else { - $stemv = 70; - } - $fd .= ",'StemV'=>".$stemv; - //MissingWidth - if(isset($fm['MissingWidth'])) { - $fd .= ",'MissingWidth'=>".$fm['MissingWidth']; - } - $fd .= ')'; - return $fd; -} - -function MakeWidthArray($fm) { - //Make character width array - $s = 'array('; - $cw = $fm['Widths']; - $els = array(); - $c = 0; - foreach ($cw as $i => $w) { - if (is_numeric($i)) { - $els[] = (((($c++)%10) == 0) ? "\n" : '').$i.'=>'.$w; - } - } - $s .= implode(',', $els); - $s .= ')'; - return $s; -} - -function MakeFontEncoding($map) { - //Build differences from reference encoding - $ref = ReadMap('cp1252'); - $s = ''; - $last = 0; - for ($i = 32; $i <= 255; $i++) { - if ($map[$i] != $ref[$i]) { - if ($i != $last+1) { - $s .= $i.' '; - } - $last = $i; - $s .= '/'.$map[$i].' '; - } - } - return rtrim($s); -} - -function SaveToFile($file, $s, $mode='t') { - $f = fopen($file, 'w'.$mode); - if(!$f) { - die('Can\'t write to file '.$file); - } - fwrite($f, $s, strlen($s)); - fclose($f); -} - -function ReadShort($f) { - $a = unpack('n1n', fread($f, 2)); - return $a['n']; -} - -function ReadLong($f) { - $a = unpack('N1N', fread($f, 4)); - return $a['N']; -} - -function CheckTTF($file) { - //Check if font license allows embedding - $f = fopen($file, 'rb'); - if (!$f) { - die('Error: unable to open '.$file); - } - //Extract number of tables - fseek($f, 4, SEEK_CUR); - $nb = ReadShort($f); - fseek($f, 6, SEEK_CUR); - //Seek OS/2 table - $found = false; - for ($i = 0; $i < $nb; $i++) { - if (fread($f, 4) == 'OS/2') { - $found = true; - break; - } - fseek($f, 12, SEEK_CUR); - } - if (!$found) { - fclose($f); - return; - } - fseek($f, 4, SEEK_CUR); - $offset = ReadLong($f); - fseek($f, $offset, SEEK_SET); - //Extract fsType flags - fseek($f, 8, SEEK_CUR); - $fsType = ReadShort($f); - $rl = ($fsType & 0x02) != 0; - $pp = ($fsType & 0x04) != 0; - $e = ($fsType & 0x08) != 0; - fclose($f); - if($rl AND (!$pp) AND (!$e)) { - print "Warning: font license does not allow embedding\n"; - } -} - -$arg = $GLOBALS['argv']; -if (count($arg) >= 3) { - ob_start(); - array_shift($arg); - if (sizeof($arg) == 3) { - $arg[3] = $arg[2]; - $arg[2] = true; - } else { - if (!isset($arg[2])) { - $arg[2] = true; - } - if (!isset($arg[3])) { - $arg[3] = 'cp1252'; - } - } - if (!isset($arg[4])) { - $arg[4] = array(); - } - MakeFont($arg[0], $arg[1], $arg[2], $arg[3], $arg[4]); - $t = ob_get_clean(); - print preg_replace('!<BR( /)?>!i', "\n", $t); -} else { - print "Usage: makefont.php <ttf/otf/pfb file> <afm/ufm file> <encoding> <patch>\n"; -} - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm deleted file mode 100644 index c75b565c2f..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe deleted file mode 100644 index 25c21fa1af..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/pfm2afm.exe and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/pfm2afm-src.tar.gz b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/pfm2afm-src.tar.gz deleted file mode 100644 index 72abae50f9..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/pfm2afm-src.tar.gz and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/readme.txt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/readme.txt deleted file mode 100644 index 6e5b40d98a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/readme.txt +++ /dev/null @@ -1,17 +0,0 @@ -To embed TrueType and OpenType font files, you need to extract the -font metrics from the font files and build the required tables using -the utility TTF2UFM. - -TTF2UFM is a modified version of Mark Heath's TTF 2 PT1 converter -(http://ttf2pt1.sourceforge.net/) by Steven Wittens <steven@acko.net> -(http://www.acko.net/blog/ufpdf). That version has been further -modified by Ulrich Telle for use with the wxWidgets component -wxPdfDocument. - -Following changes where made: - -1) Generated AFM files contain the glyph number for each character. -2) Generated UFM files contain the bounding box for each character. -3) OpenType support has been activated for the Windows binary, - and the generated AFM/UFM files contain the associated - original Unicode codes for each character. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/ttf2ufm-src.tar.gz b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/ttf2ufm-src.tar.gz deleted file mode 100644 index 2aeca60821..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/src/ttf2ufm-src.tar.gz and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm deleted file mode 100644 index f81604fa0c..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm.exe b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm.exe deleted file mode 100644 index 0775105516..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/ttf2ufm.exe and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll deleted file mode 100644 index 31996cd3e2..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/utils/zlib1.dll and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zapfdingbats.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zapfdingbats.php deleted file mode 100644 index c1362dbbc2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zapfdingbats.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - // core font definition file for TCPDF (www.tcpdf.org) -$type='core'; -$dw=788; -$cw=array(0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0,8=>0,9=>0,10=>0,11=>0,12=>0, -13=>0,14=>0,15=>0,16=>0,17=>0,18=>0,19=>0,20=>0,21=>0,22=>0,23=>0,24=>0,25=>0, -26=>0,27=>0,28=>0,29=>0,30=>0,31=>0,32=>278,33=>974,34=>961,35=>974,36=>980, -37=>719,38=>789,39=>790,40=>791,41=>690,42=>960,43=>939,44=>549,45=>855,46=>911, -47=>933,48=>911,49=>945,50=>974,51=>755,52=>846,53=>762,54=>761,55=>571,56=>677, -57=>763,58=>760,59=>759,60=>754,61=>494,62=>552,63=>537,64=>577,65=>692,66=>786, -67=>788,68=>788,69=>790,70=>793,71=>794,72=>816,73=>823,74=>789,75=>841,76=>823, -77=>833,78=>816,79=>831,80=>923,81=>744,82=>723,83=>749,84=>790,85=>792,86=>695, -87=>776,88=>768,89=>792,90=>759,91=>707,92=>708,93=>682,94=>701,95=>826,96=>815, -97=>789,98=>789,99=>707,100=>687,101=>696,102=>689,103=>786,104=>787,105=>713, -106=>791,107=>785,108=>791,109=>873,110=>761,111=>762,112=>762,113=>759,114=>759, -115=>892,116=>892,117=>788,118=>784,119=>438,120=>138,121=>277,122=>415,123=>392, -124=>392,125=>668,126=>668,127=>0,128=>390,129=>390,130=>317,131=>317,132=>276, -133=>276,134=>509,135=>509,136=>410,137=>410,138=>234,139=>234,140=>334,141=>334, -142=>0,143=>0,144=>0,145=>0,146=>0,147=>0,148=>0,149=>0,150=>0,151=>0,152=>0, -153=>0,154=>0,155=>0,156=>0,157=>0,158=>0,159=>0,160=>0,161=>732,162=>544,163=>544, -164=>910,165=>667,166=>760,167=>760,168=>776,169=>595,170=>694,171=>626,172=>788, -173=>788,174=>788,175=>788,176=>788,177=>788,178=>788,179=>788,180=>788,181=>788, -182=>788,183=>788,184=>788,185=>788,186=>788,187=>788,188=>788,189=>788,190=>788, -191=>788,192=>788,193=>788,194=>788,195=>788,196=>788,197=>788,198=>788,199=>788, -200=>788,201=>788,202=>788,203=>788,204=>788,205=>788,206=>788,207=>788,208=>788, -209=>788,210=>788,211=>788,212=>894,213=>838,214=>1016,215=>458,216=>748,217=>924, -218=>748,219=>918,220=>927,221=>928,222=>928,223=>834,224=>873,225=>828,226=>924, -227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867, -236=>867,237=>696,238=>696,239=>874,240=>0,241=>874,242=>760,243=>946,244=>771, -245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970, -254=>918,255=>0); -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zarbold.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zarbold.php deleted file mode 100644 index 5597c17e63..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/zarbold.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/* Mohammad Ali Golkar - m.a.golkar@gmail.com - http://www.30minonline.com - LICENSE : GPLv2 */ -$type='TrueTypeUnicode'; -$name='ZarBold'; -$desc=array('Ascent'=>733,'Descent'=>-317,'CapHeight'=>733,'Flags'=>32,'FontBBox'=>'[-126 -535 1164 1046]','ItalicAngle'=>0,'StemV'=>120,'MissingWidth'=>600); -$up=-356; -$ut=49; -$dw=600; -$cw=array( - 0=>0,32=>227,33=>235,34=>282,35=>667,36=>458,37=>493,38=>635,39=>156,40=>303,41=>303,42=>489,43=>489,44=>237,45=>489,46=>231,47=>277, - 48=>552,49=>552,50=>552,51=>552,52=>552,53=>552,54=>552,55=>552,56=>552,57=>552,58=>231,59=>237,60=>667,61=>489,62=>667,63=>448, - 64=>917,65=>604,66=>542,67=>615,68=>708,69=>479,70=>427,71=>667,72=>688,73=>302,74=>292,75=>583,76=>469,77=>885,78=>677,79=>729, - 80=>479,81=>729,82=>542,83=>448,84=>521,85=>677,86=>615,87=>969,88=>604,89=>583,90=>594,91=>208,92=>510,93=>208,94=>469,95=>500, - 96=>333,97=>469,98=>510,99=>448,100=>521,101=>438,102=>313,103=>500,104=>552,105=>271,106=>260,107=>500,108=>271,109=>802,110=>552,111=>490, - 112=>531,113=>521,114=>396,115=>365,116=>292,117=>552,118=>479,119=>750,120=>521,121=>469,122=>448,123=>479,124=>510,125=>479,126=>667,8218=>240, - 402=>531,8222=>458,8230=>1000,8224=>438,8225=>438,710=>333,8240=>1010,352=>448,8249=>250,338=>865,8216=>240,8217=>240,8220=>317,8221=>317,8226=>281,8211=>500, - 8212=>1000,8482=>906,353=>365,8250=>250,339=>823,376=>583,160=>244,161=>317,162=>448,163=>583,164=>500,165=>583,166=>200,167=>417,168=>333,169=>765, - 170=>313,171=>417,172=>667,173=>564,174=>765,175=>333,176=>375,177=>462,178=>354,179=>354,180=>333,181=>510,182=>438,183=>198,184=>333,185=>354, - 186=>323,187=>417,188=>854,189=>854,190=>854,191=>448,192=>604,711=>333,215=>462,224=>469,226=>469,231=>448,232=>438,233=>438,234=>438,235=>438, - 238=>271,239=>271,244=>490,305=>271,247=>483,249=>552,251=>552,252=>552,255=>469,9249=>781,1548=>237,1563=>237,1567=>340,1569=>426,1570=>416,1571=>238, - 1572=>429,1573=>260,1574=>817,1575=>238,1576=>853,1577=>439,1578=>853,1579=>853,1580=>720,1581=>720,1582=>720,1583=>485,1584=>485,1585=>423,1586=>423,1587=>1016, - 1588=>1016,1589=>1128,1590=>1128,1591=>794,1592=>794,1593=>685,1594=>685,1600=>371,1601=>840,1602=>696,1603=>1148,1604=>744,1605=>514,1606=>686,1607=>439,1608=>429, - 1609=>817,1610=>817,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1632=>479,1633=>479,1634=>479,1635=>479,1636=>479,1637=>479, - 1638=>479,1639=>479,1640=>479,1641=>483,1642=>493,1645=>563,1648=>227,1649=>363,1652=>227,1662=>853,1670=>720,1688=>423,1700=>840,1705=>1148,1711=>1149,1740=>817, - 1749=>439,1764=>227,1776=>479,1777=>479,1778=>479,1779=>479,1780=>479,1781=>479,1782=>479,1783=>479,1784=>479,1785=>483,8204=>22,8205=>22,8206=>22,8207=>22, - 59424=>227,59425=>227,59426=>227,59427=>227,59428=>227,59429=>227,59430=>227,59431=>227,59432=>227,59433=>227,59434=>227,59435=>227,59436=>227,59416=>227,59437=>227,59442=>227, - 59443=>227,59444=>227,59445=>227,59446=>227,64336=>363,64337=>263,64342=>853,64343=>967,64344=>267,64345=>271,64362=>840,64363=>959,64364=>305,64365=>341,64378=>720,64379=>725, - 64380=>630,64381=>652,64394=>423,64395=>450,64398=>1148,64399=>1089,64400=>522,64401=>461,64402=>1149,64403=>1084,64404=>525,64405=>462,64508=>817,64509=>784,64606=>227,64607=>227, - 64608=>227,64609=>227,64610=>227,64754=>371,64755=>371,64756=>371,64828=>331,64829=>276,64830=>303,64831=>303,65010=>866,65136=>227,65137=>371,65138=>227,65140=>227,65142=>227, - 65143=>371,65144=>227,65145=>371,65146=>227,65147=>371,65148=>227,65149=>371,65150=>227,65151=>371,65152=>426,65153=>416,65154=>354,65155=>238,65156=>282,65157=>429,65158=>507, - 65159=>260,65160=>286,65161=>817,65162=>784,65163=>190,65164=>276,65165=>238,65166=>263,65167=>853,65168=>967,65169=>186,65170=>271,65171=>439,65172=>452,65173=>853,65174=>967, - 65175=>256,65176=>271,65177=>853,65178=>967,65179=>267,65180=>271,65181=>720,65182=>725,65183=>630,65184=>652,65185=>720,65186=>725,65187=>630,65188=>652,65189=>720,65190=>725, - 65191=>630,65192=>652,65193=>485,65194=>608,65195=>485,65196=>608,65197=>423,65198=>450,65199=>423,65200=>450,65201=>1016,65202=>1041,65203=>498,65204=>475,65205=>1016,65206=>1041, - 65207=>498,65208=>475,65209=>1128,65210=>1150,65211=>633,65212=>655,65213=>1128,65214=>1150,65215=>633,65216=>655,65217=>794,65218=>814,65219=>566,65220=>588,65221=>794,65222=>814, - 65223=>566,65224=>588,65225=>685,65226=>655,65227=>414,65228=>330,65229=>685,65230=>655,65231=>414,65232=>330,65233=>840,65234=>959,65235=>305,65236=>341,65237=>696,65238=>780, - 65239=>305,65240=>341,65241=>1148,65242=>1089,65243=>522,65244=>461,65245=>744,65246=>741,65247=>202,65248=>259,65249=>514,65250=>585,65251=>345,65252=>477,65253=>686,65254=>764, - 65255=>186,65256=>271,65257=>439,65258=>452,65259=>501,65260=>381,65261=>429,65262=>507,65263=>817,65264=>784,65265=>817,65266=>784,64510=>265,64511=>271,65269=>610,65270=>652, - 65271=>539,65272=>611,65273=>539,65274=>611,65275=>539,65276=>611,65279=>0,64486=>408,64487=>408); -$enc=''; -$diff=''; -$file='zarbold.z'; -$ctg='zarbold.ctg.z'; -$originalsize=73296; -// --- EOF --- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/htmlcolors.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/htmlcolors.php deleted file mode 100644 index e07be272fd..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/htmlcolors.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php -//============================================================+ -// File name : htmlcolors.php -// Version : 1.0.007 -// Begin : 2002-04-09 -// Last Update : 2010-10-18 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : Array of WEB safe colors -// -//============================================================+ - -/** - * Array of WEB safe colors. - * @author Nicola Asuni - * @copyright 2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @package com.tecnick.tcpdf - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2.9.000 (2008-03-26) -*/ - -/** - * Array of WEB safe colors - */ -$webcolor = array ( -'aliceblue' => 'f0f8ff', -'antiquewhite' => 'faebd7', -'aqua' => '00ffff', -'aquamarine' => '7fffd4', -'azure' => 'f0ffff', -'beige' => 'f5f5dc', -'bisque' => 'ffe4c4', -'black' => '000000', -'blanchedalmond' => 'ffebcd', -'blue' => '0000ff', -'blueviolet' => '8a2be2', -'brown' => 'a52a2a', -'burlywood' => 'deb887', -'cadetblue' => '5f9ea0', -'chartreuse' => '7fff00', -'chocolate' => 'd2691e', -'coral' => 'ff7f50', -'cornflowerblue' => '6495ed', -'cornsilk' => 'fff8dc', -'crimson' => 'dc143c', -'cyan' => '00ffff', -'darkblue' => '00008b', -'darkcyan' => '008b8b', -'darkgoldenrod' => 'b8860b', -'dkgray' => 'a9a9a9', -'darkgray' => 'a9a9a9', -'darkgrey' => 'a9a9a9', -'darkgreen' => '006400', -'darkkhaki' => 'bdb76b', -'darkmagenta' => '8b008b', -'darkolivegreen' => '556b2f', -'darkorange' => 'ff8c00', -'darkorchid' => '9932cc', -'darkred' => '8b0000', -'darksalmon' => 'e9967a', -'darkseagreen' => '8fbc8f', -'darkslateblue' => '483d8b', -'darkslategray' => '2f4f4f', -'darkslategrey' => '2f4f4f', -'darkturquoise' => '00ced1', -'darkviolet' => '9400d3', -'deeppink' => 'ff1493', -'deepskyblue' => '00bfff', -'dimgray' => '696969', -'dimgrey' => '696969', -'dodgerblue' => '1e90ff', -'firebrick' => 'b22222', -'floralwhite' => 'fffaf0', -'forestgreen' => '228b22', -'fuchsia' => 'ff00ff', -'gainsboro' => 'dcdcdc', -'ghostwhite' => 'f8f8ff', -'gold' => 'ffd700', -'goldenrod' => 'daa520', -'gray' => '808080', -'grey' => '808080', -'green' => '008000', -'greenyellow' => 'adff2f', -'honeydew' => 'f0fff0', -'hotpink' => 'ff69b4', -'indianred' => 'cd5c5c', -'indigo' => '4b0082', -'ivory' => 'fffff0', -'khaki' => 'f0e68c', -'lavender' => 'e6e6fa', -'lavenderblush' => 'fff0f5', -'lawngreen' => '7cfc00', -'lemonchiffon' => 'fffacd', -'lightblue' => 'add8e6', -'lightcoral' => 'f08080', -'lightcyan' => 'e0ffff', -'lightgoldenrodyellow' => 'fafad2', -'ltgray' => 'd3d3d3', -'lightgray' => 'd3d3d3', -'lightgrey' => 'd3d3d3', -'lightgreen' => '90ee90', -'lightpink' => 'ffb6c1', -'lightsalmon' => 'ffa07a', -'lightseagreen' => '20b2aa', -'lightskyblue' => '87cefa', -'lightslategray' => '778899', -'lightslategrey' => '778899', -'lightsteelblue' => 'b0c4de', -'lightyellow' => 'ffffe0', -'lime' => '00ff00', -'limegreen' => '32cd32', -'linen' => 'faf0e6', -'magenta' => 'ff00ff', -'maroon' => '800000', -'mediumaquamarine' => '66cdaa', -'mediumblue' => '0000cd', -'mediumorchid' => 'ba55d3', -'mediumpurple' => '9370d8', -'mediumseagreen' => '3cb371', -'mediumslateblue' => '7b68ee', -'mediumspringgreen' => '00fa9a', -'mediumturquoise' => '48d1cc', -'mediumvioletred' => 'c71585', -'midnightblue' => '191970', -'mintcream' => 'f5fffa', -'mistyrose' => 'ffe4e1', -'moccasin' => 'ffe4b5', -'navajowhite' => 'ffdead', -'navy' => '000080', -'oldlace' => 'fdf5e6', -'olive' => '808000', -'olivedrab' => '6b8e23', -'orange' => 'ffa500', -'orangered' => 'ff4500', -'orchid' => 'da70d6', -'palegoldenrod' => 'eee8aa', -'palegreen' => '98fb98', -'paleturquoise' => 'afeeee', -'palevioletred' => 'd87093', -'papayawhip' => 'ffefd5', -'peachpuff' => 'ffdab9', -'peru' => 'cd853f', -'pink' => 'ffc0cb', -'plum' => 'dda0dd', -'powderblue' => 'b0e0e6', -'purple' => '800080', -'red' => 'ff0000', -'rosybrown' => 'bc8f8f', -'royalblue' => '4169e1', -'saddlebrown' => '8b4513', -'salmon' => 'fa8072', -'sandybrown' => 'f4a460', -'seagreen' => '2e8b57', -'seashell' => 'fff5ee', -'sienna' => 'a0522d', -'silver' => 'c0c0c0', -'skyblue' => '87ceeb', -'slateblue' => '6a5acd', -'slategray' => '708090', -'slategrey' => '708090', -'snow' => 'fffafa', -'springgreen' => '00ff7f', -'steelblue' => '4682b4', -'tan' => 'd2b48c', -'teal' => '008080', -'thistle' => 'd8bfd8', -'tomato' => 'ff6347', -'turquoise' => '40e0d0', -'violet' => 'ee82ee', -'wheat' => 'f5deb3', -'white' => 'ffffff', -'whitesmoke' => 'f5f5f5', -'yellow' => 'ffff00', -'yellowgreen' => '9acd32' -); - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/_blank.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/_blank.png deleted file mode 100644 index 38f7b2fa56..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/_blank.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/alpha.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/alpha.png deleted file mode 100644 index 08daf2d44c..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/alpha.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/bug.eps b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/bug.eps deleted file mode 100644 index 7df891e7d9..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/bug.eps +++ /dev/null @@ -1,1809 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: Adobe Illustrator(TM) 3.2 -%%AI8_CreatorVersion: 12.0.0 -%%For: (fluxus) (x) -%%Title: (bug.eps) -%%CreationDate: 4/15/2006 11:11 PM -%%BoundingBox: -2 747 53 843 -% -2 747 53 843 -%%DocumentProcessColors: Cyan Magenta Yellow Black -%%DocumentSuppliedResources: procset Adobe_packedarray 2.0 0 -%%+ procset Adobe_cmykcolor 1.1 0 -%%+ procset Adobe_cshow 1.1 0 -%%+ procset Adobe_customcolor 1.0 0 -%%+ procset Adobe_pattern_AI3 1.0 0 -%%+ procset Adobe_Illustrator_AI3 1.0 1 -%AI3_ColorUsage: Color -%AI3_IncludePlacedImages -%%CMYKCustomColor: 1 1 1 1 ([Registration]) -%AI3_TemplateBox: 298.5 420.3896 298.5 420.3896 -%AI3_TileBox: 0.157715 0.044861 595.1177 841.9648 -%AI3_DocumentPreview: Header -%%PageOrigin:-32 11.8896 -%AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 -%AI9_Flatten: 1 -%AI12_CMSettings: 00.MS -%%EndComments -%%BeginProlog -%%BeginResource: procset Adobe_packedarray 2.0 0 -%%Title: (Packed Array Operators) -%%Version: 2.0 0 -%%CreationDate: (8/2/90) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -userdict /Adobe_packedarray 5 dict dup begin put -/initialize -{ -/packedarray where - { - pop - } - { - Adobe_packedarray begin - Adobe_packedarray - { - dup xcheck - { - bind - } if - userdict 3 1 roll put - } forall - end - } ifelse -} def -/terminate -{ -} def -/packedarray -{ -array astore readonly -} def -/setpacking -{ -pop -} def -/currentpacking -{ -false -} def -currentdict readonly pop end -%%EndResource -Adobe_packedarray /initialize get exec -%%BeginResource: procset Adobe_cmykcolor 1.1 0 -%%Title: (CMYK Color Operators) -%%Version: 1.1 0 -%%CreationDate: (1/23/89) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -currentpacking true setpacking -userdict /Adobe_cmykcolor 4 dict dup begin put -/initialize -{ -/setcmykcolor where - { - pop - } - { - userdict /Adobe_cmykcolor_vars 2 dict dup begin put - /_setrgbcolor - /setrgbcolor load def - /_currentrgbcolor - /currentrgbcolor load def - Adobe_cmykcolor begin - Adobe_cmykcolor - { - dup xcheck - { - bind - } if - pop pop - } forall - end - end - Adobe_cmykcolor begin - } ifelse -} def -/terminate -{ -currentdict Adobe_cmykcolor eq - { - end - } if -} def -/setcmykcolor -{ -1 sub 4 1 roll -3 - { - 3 index add neg dup 0 lt - { - pop 0 - } if - 3 1 roll - } repeat -Adobe_cmykcolor_vars /_setrgbcolor get exec -pop -} def -/currentcmykcolor -{ -Adobe_cmykcolor_vars /_currentrgbcolor get exec -3 - { - 1 sub neg 3 1 roll - } repeat -0 -} def -currentdict readonly pop end -setpacking -%%EndResource -%%BeginResource: procset Adobe_cshow 1.1 0 -%%Title: (cshow Operator) -%%Version: 1.1 0 -%%CreationDate: (1/23/89) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -currentpacking true setpacking -userdict /Adobe_cshow 3 dict dup begin put -/initialize -{ -/cshow where - { - pop - } - { - userdict /Adobe_cshow_vars 1 dict dup begin put - /_cshow - {} def - Adobe_cshow begin - Adobe_cshow - { - dup xcheck - { - bind - } if - userdict 3 1 roll put - } forall - end - end - } ifelse -} def -/terminate -{ -} def -/cshow -{ -exch -Adobe_cshow_vars - exch /_cshow - exch put - { - 0 0 Adobe_cshow_vars /_cshow get exec - } forall -} def -currentdict readonly pop end -setpacking -%%EndResource -%%BeginResource: procset Adobe_customcolor 1.0 0 -%%Title: (Custom Color Operators) -%%Version: 1.0 0 -%%CreationDate: (5/9/88) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -currentpacking true setpacking -userdict /Adobe_customcolor 5 dict dup begin put -/initialize -{ -/setcustomcolor where - { - pop - } - { - Adobe_customcolor begin - Adobe_customcolor - { - dup xcheck - { - bind - } if - pop pop - } forall - end - Adobe_customcolor begin - } ifelse -} def -/terminate -{ -currentdict Adobe_customcolor eq - { - end - } if -} def -/findcmykcustomcolor -{ -5 packedarray -} def -/setcustomcolor -{ -exch -aload pop pop -4 - { - 4 index mul 4 1 roll - } repeat -5 -1 roll pop -setcmykcolor -} def -/setoverprint -{ -pop -} def -currentdict readonly pop end -setpacking -%%EndResource -%%BeginResource: procset Adobe_pattern_AI3 1.1 0 -%%Title: (Adobe Illustrator (R) Version 3.0 Pattern Operators) -%%Version: 1.1 0 -%%CreationDate: (7/21/89) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -currentpacking true setpacking -userdict /Adobe_pattern_AI3 16 dict dup begin put -/initialize -{ -/definepattern where - { - pop - } - { - Adobe_pattern_AI3 begin - Adobe_pattern_AI3 - { - dup xcheck - { - bind - } if - pop pop - } forall - mark - cachestatus 7 1 roll pop pop pop pop exch pop exch - { - { - 10000 add - dup 2 index gt - { - exit - } if - dup setcachelimit - } loop - } stopped - cleartomark - } ifelse -} def -/terminate -{ -currentdict Adobe_pattern_AI3 eq - { - end - } if -} def -errordict -/nocurrentpoint -{ -pop -stop -} put -errordict -/invalidaccess -{ -pop -stop -} put -/patternencoding -256 array def -0 1 255 -{ -patternencoding exch ( ) 2 copy exch 0 exch put cvn put -} for -/definepattern -{ -17 dict begin -/uniform exch def -/cache exch def -/key exch def -/procarray exch def -/mtx exch matrix invertmatrix def -/height exch def -/width exch def -/ctm matrix currentmatrix def -/ptm matrix def -/str 32 string def -/slice 9 dict def -slice /s 1 put -slice /q 256 procarray length div sqrt floor cvi put -slice /b 0 put -/FontBBox [0 0 0 0] def -/FontMatrix mtx matrix copy def -/Encoding patternencoding def -/FontType 3 def -/BuildChar - { - exch - begin - /setstrokeadjust where {pop true setstrokeadjust} if - slice begin - dup q dup mul mod s idiv /i exch def - dup q dup mul mod s mod /j exch def - q dup mul idiv procarray exch get - /xl j width s div mul def - /xg j 1 add width s div mul def - /yl i height s div mul def - /yg i 1 add height s div mul def - uniform - { - 1 1 - } - { - width 0 dtransform - dup mul exch dup mul add sqrt dup 1 add exch div - 0 height dtransform - dup mul exch dup mul add sqrt dup 1 add exch div - } ifelse - width 0 cache - { - xl 4 index mul yl 4 index mul xg 6 index mul yg 6 index mul - setcachedevice - } - { - setcharwidth - } ifelse - gsave - scale - newpath - xl yl moveto - xg yl lineto - xg yg lineto - xl yg lineto - closepath - clip - newpath - end - end - exec - grestore - } def -key currentdict definefont -end -} def -/patterncachesize -{ -gsave -newpath -0 0 moveto -width 0 lineto -width height lineto -0 height lineto -closepath -patternmatrix setmatrix -pathbbox -exch ceiling 4 -1 roll floor sub 3 1 roll -ceiling exch floor sub -mul 1 add -grestore -} def -/patterncachelimit -{ -cachestatus 7 1 roll 6 npop 8 mul -} def -/patternpath -{ -exch dup begin setfont -ctm setmatrix -concat -slice exch /b exch slice /q get dup mul mul put -FontMatrix concat -uniform - { - width 0 dtransform round width div exch round width div exch - 0 height dtransform round height div exch height div exch - 0 0 transform round exch round exch - ptm astore setmatrix - } - { - ptm currentmatrix pop - } ifelse -{currentpoint} stopped not - { - 2 npop - pathbbox - true - 4 index 3 index eq - 4 index 3 index eq - and - { - pop false - { - {2 npop} - {3 npop true} - {7 npop true} - {pop true} - pathforall - } stopped - { - 5 npop true - } if - } if - { - height div ceiling height mul 4 1 roll - width div ceiling width mul 4 1 roll - height div floor height mul 4 1 roll - width div floor width mul 4 1 roll - 2 index sub height div ceiling cvi exch - 3 index sub width div ceiling cvi exch - 4 2 roll moveto - FontMatrix mtx invertmatrix - dup dup 4 get exch 5 get rmoveto - ptm ptm concatmatrix pop - slice /s - patterncachesize patterncachelimit div ceiling sqrt ceiling cvi - dup slice /q get gt - { - pop slice /q get - } if - put - 0 1 slice /s get dup mul 1 sub - { - slice /b get add - gsave - 0 1 str length 1 sub - { - str exch 2 index put - } for - pop - dup - { - gsave - ptm setmatrix - 1 index str length idiv {str show} repeat - 1 index str length mod str exch 0 exch getinterval show - grestore - 0 height rmoveto - } repeat - grestore - } for - 2 npop - } - { - 4 npop - } ifelse - } if -end -} def -/patternclip -{ -clip -} def -/patternstrokepath -{ -strokepath -} def -/patternmatrix -matrix def -/patternfill -{ -dup type /dicttype eq - { - Adobe_pattern_AI3 /patternmatrix get - } if -gsave -patternclip -Adobe_pattern_AI3 /patternpath get exec -grestore -newpath -} def -/patternstroke -{ -dup type /dicttype eq - { - Adobe_pattern_AI3 /patternmatrix get - } if -gsave -patternstrokepath -true - { - { - { - newpath - moveto - } - { - lineto - } - { - curveto - } - { - closepath - 3 copy - Adobe_pattern_AI3 /patternfill get exec - } pathforall - 3 npop - } stopped - { - 5 npop - patternclip - Adobe_pattern_AI3 /patternfill get exec - } if - } - { - patternclip - Adobe_pattern_AI3 /patternfill get exec - } ifelse -grestore -newpath -} def -/patternashow -{ -3 index type /dicttype eq - { - Adobe_pattern_AI3 /patternmatrix get 4 1 roll - } if - { - 2 npop (0) exch - 2 copy 0 exch put pop - gsave - false charpath currentpoint - 6 index 6 index 6 index - Adobe_pattern_AI3 /patternfill get exec - grestore - newpath moveto - 2 copy rmoveto - } exch cshow -5 npop -} def -/patternawidthshow -{ -6 index type /dicttype eq - { - Adobe_pattern_AI3 /patternmatrix get 7 1 roll - } if - { - 2 npop (0) exch - 2 copy 0 exch put - gsave - _sp eq {5 index 5 index rmoveto} if - false charpath currentpoint - 9 index 9 index 9 index - Adobe_pattern_AI3 /patternfill get exec - grestore - newpath moveto - 2 copy rmoveto - } exch cshow -8 npop -} def -/patternashowstroke -{ -4 index type /dicttype eq - { - patternmatrix /patternmatrix get 5 1 roll - } if -4 1 roll - { - 2 npop (0) exch - 2 copy 0 exch put pop - gsave - false charpath - currentpoint - 4 index setmatrix - 7 index 7 index 7 index - Adobe_pattern_AI3 /patternstroke get exec - grestore - newpath moveto - 2 copy rmoveto - } exch cshow -6 npop -} def -/patternawidthshowstroke -{ -7 index type /dicttype eq - { - patternmatrix /patternmatrix get 8 1 roll - } if -7 1 roll - { - 2 npop (0) exch - 2 copy 0 exch put - gsave - _sp eq {5 index 5 index rmoveto} if - false charpath currentpoint - 7 index setmatrix - 10 index 10 index 10 index - Adobe_pattern_AI3 /patternstroke get exec - grestore - newpath moveto - 2 copy rmoveto - } exch cshow -9 npop -} def -currentdict readonly pop end -setpacking -%%EndResource -%%BeginResource: procset Adobe_Illustrator_AI3 1.1 0 -%%Title: (Adobe Illustrator (R) Version 3.0 Full Prolog) -%%Version: 1.1 0 -%%CreationDate: (3/7/1994) () -%%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) -currentpacking true setpacking -userdict /Adobe_Illustrator_AI3 71 dict dup begin put -/initialize -{ -userdict /Adobe_Illustrator_AI3_vars 67 dict dup begin put -/_lp /none def -/_pf {} def -/_ps {} def -/_psf {} def -/_pss {} def -/_pjsf {} def -/_pjss {} def -/_pola 0 def -/_doClip 0 def -/cf currentflat def -/_tm matrix def -/_renderStart [/e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0] def -/_renderEnd [null null null null /i1 /i1 /i1 /i1] def -/_render -1 def -/_rise 0 def -/_ax 0 def -/_ay 0 def -/_cx 0 def -/_cy 0 def -/_leading [0 0] def -/_ctm matrix def -/_mtx matrix def -/_sp 16#020 def -/_hyphen (-) def -/_fScl 0 def -/_cnt 0 def -/_hs 1 def -/_nativeEncoding 0 def -/_useNativeEncoding 0 def -/_tempEncode 0 def -/_pntr 0 def -/_tDict 2 dict def -/_wv 0 def -/Tx {} def -/Tj {} def -/CRender {} def -/_AI3_savepage {} def -/_gf null def -/_cf 4 array def -/_if null def -/_of false def -/_fc {} def -/_gs null def -/_cs 4 array def -/_is null def -/_os false def -/_sc {} def -/_pd 1 dict def -/_ed 15 dict def -/_pm matrix def -/_fm null def -/_fd null def -/_fdd null def -/_sm null def -/_sd null def -/_sdd null def -/_i null def -Adobe_Illustrator_AI3 begin -Adobe_Illustrator_AI3 dup /nc get begin - { - dup xcheck - { - bind - } if - pop pop - } forall -end -end -end -Adobe_Illustrator_AI3 begin -Adobe_Illustrator_AI3_vars begin -newpath -} def -/terminate -{ -end -end -} def -/_ -null def -/ddef -{ -Adobe_Illustrator_AI3_vars 3 1 roll put -} def -/xput -{ -dup load dup length exch maxlength eq - { - dup dup load dup - length 2 mul dict copy def - } if -load begin def end -} def -/npop -{ - { - pop - } repeat -} def -/sw -{ -dup length exch stringwidth -exch 5 -1 roll 3 index mul add -4 1 roll 3 1 roll mul add -} def -/swj -{ -dup 4 1 roll -dup length exch stringwidth -exch 5 -1 roll 3 index mul add -4 1 roll 3 1 roll mul add -6 2 roll /_cnt 0 ddef -{1 index eq {/_cnt _cnt 1 add ddef} if} forall pop -exch _cnt mul exch _cnt mul 2 index add 4 1 roll 2 index add 4 1 roll pop pop -} def -/ss -{ -4 1 roll - { - 2 npop - (0) exch 2 copy 0 exch put pop - gsave - false charpath currentpoint - 4 index setmatrix - stroke - grestore - moveto - 2 copy rmoveto - } exch cshow -3 npop -} def -/jss -{ -4 1 roll - { - 2 npop - (0) exch 2 copy 0 exch put - gsave - _sp eq - { - exch 6 index 6 index 6 index 5 -1 roll widthshow - currentpoint - } - { - false charpath currentpoint - 4 index setmatrix stroke - }ifelse - grestore - moveto - 2 copy rmoveto - } exch cshow -6 npop -} def -/sp -{ - { - 2 npop (0) exch - 2 copy 0 exch put pop - false charpath - 2 copy rmoveto - } exch cshow -2 npop -} def -/jsp -{ - { - 2 npop - (0) exch 2 copy 0 exch put - _sp eq - { - exch 5 index 5 index 5 index 5 -1 roll widthshow - } - { - false charpath - }ifelse - 2 copy rmoveto - } exch cshow -5 npop -} def -/pl -{ -transform -0.25 sub round 0.25 add exch -0.25 sub round 0.25 add exch -itransform -} def -/setstrokeadjust where - { - pop true setstrokeadjust - /c - { - curveto - } def - /C - /c load def - /v - { - currentpoint 6 2 roll curveto - } def - /V - /v load def - /y - { - 2 copy curveto - } def - /Y - /y load def - /l - { - lineto - } def - /L - /l load def - /m - { - moveto - } def - } - { - /c - { - pl curveto - } def - /C - /c load def - /v - { - currentpoint 6 2 roll pl curveto - } def - /V - /v load def - /y - { - pl 2 copy curveto - } def - /Y - /y load def - /l - { - pl lineto - } def - /L - /l load def - /m - { - pl moveto - } def - } ifelse -/d -{ -setdash -} def -/cf {} def -/i -{ -dup 0 eq - { - pop cf - } if -setflat -} def -/j -{ -setlinejoin -} def -/J -{ -setlinecap -} def -/M -{ -setmiterlimit -} def -/w -{ -setlinewidth -} def -/H -{} def -/h -{ -closepath -} def -/N -{ -_pola 0 eq - { - _doClip 1 eq {clip /_doClip 0 ddef} if - newpath - } - { - /CRender {N} ddef - }ifelse -} def -/n -{N} def -/F -{ -_pola 0 eq - { - _doClip 1 eq - { - gsave _pf grestore clip newpath /_lp /none ddef _fc - /_doClip 0 ddef - } - { - _pf - }ifelse - } - { - /CRender {F} ddef - }ifelse -} def -/f -{ -closepath -F -} def -/S -{ -_pola 0 eq - { - _doClip 1 eq - { - gsave _ps grestore clip newpath /_lp /none ddef _sc - /_doClip 0 ddef - } - { - _ps - }ifelse - } - { - /CRender {S} ddef - }ifelse -} def -/s -{ -closepath -S -} def -/B -{ -_pola 0 eq - { - _doClip 1 eq - gsave F grestore - { - gsave S grestore clip newpath /_lp /none ddef _sc - /_doClip 0 ddef - } - { - S - }ifelse - } - { - /CRender {B} ddef - }ifelse -} def -/b -{ -closepath -B -} def -/W -{ -/_doClip 1 ddef -} def -/* -{ -count 0 ne - { - dup type (stringtype) eq {pop} if - } if -_pola 0 eq {newpath} if -} def -/u -{} def -/U -{} def -/q -{ -_pola 0 eq {gsave} if -} def -/Q -{ -_pola 0 eq {grestore} if -} def -/*u -{ -_pola 1 add /_pola exch ddef -} def -/*U -{ -_pola 1 sub /_pola exch ddef -_pola 0 eq {CRender} if -} def -/D -{pop} def -/*w -{} def -/*W -{} def -/` -{ -/_i save ddef -6 1 roll 4 npop -concat pop -userdict begin -/showpage {} def -0 setgray -0 setlinecap -1 setlinewidth -0 setlinejoin -10 setmiterlimit -[] 0 setdash -/setstrokeadjust where {pop false setstrokeadjust} if -newpath -0 setgray -false setoverprint -} def -/~ -{ -end -_i restore -} def -/@ -{} def -/& -{} def -/O -{ -0 ne -/_of exch ddef -/_lp /none ddef -} def -/R -{ -0 ne -/_os exch ddef -/_lp /none ddef -} def -/g -{ -/_gf exch ddef -/_fc -{ -_lp /fill ne - { - _of setoverprint - _gf setgray - /_lp /fill ddef - } if -} ddef -/_pf -{ -_fc -fill -} ddef -/_psf -{ -_fc -ashow -} ddef -/_pjsf -{ -_fc -awidthshow -} ddef -/_lp /none ddef -} def -/G -{ -/_gs exch ddef -/_sc -{ -_lp /stroke ne - { - _os setoverprint - _gs setgray - /_lp /stroke ddef - } if -} ddef -/_ps -{ -_sc -stroke -} ddef -/_pss -{ -_sc -ss -} ddef -/_pjss -{ -_sc -jss -} ddef -/_lp /none ddef -} def -/k -{ -_cf astore pop -/_fc -{ -_lp /fill ne - { - _of setoverprint - _cf aload pop setcmykcolor - /_lp /fill ddef - } if -} ddef -/_pf -{ -_fc -fill -} ddef -/_psf -{ -_fc -ashow -} ddef -/_pjsf -{ -_fc -awidthshow -} ddef -/_lp /none ddef -} def -/K -{ -_cs astore pop -/_sc -{ -_lp /stroke ne - { - _os setoverprint - _cs aload pop setcmykcolor - /_lp /stroke ddef - } if -} ddef -/_ps -{ -_sc -stroke -} ddef -/_pss -{ -_sc -ss -} ddef -/_pjss -{ -_sc -jss -} ddef -/_lp /none ddef -} def -/x -{ -/_gf exch ddef -findcmykcustomcolor -/_if exch ddef -/_fc -{ -_lp /fill ne - { - _of setoverprint - _if _gf 1 exch sub setcustomcolor - /_lp /fill ddef - } if -} ddef -/_pf -{ -_fc -fill -} ddef -/_psf -{ -_fc -ashow -} ddef -/_pjsf -{ -_fc -awidthshow -} ddef -/_lp /none ddef -} def -/X -{ -/_gs exch ddef -findcmykcustomcolor -/_is exch ddef -/_sc -{ -_lp /stroke ne - { - _os setoverprint - _is _gs 1 exch sub setcustomcolor - /_lp /stroke ddef - } if -} ddef -/_ps -{ -_sc -stroke -} ddef -/_pss -{ -_sc -ss -} ddef -/_pjss -{ -_sc -jss -} ddef -/_lp /none ddef -} def -/dp -{ -dup null eq -{ -pop -_dp 0 ne - { - 0 1 _dp 1 sub _dl mod - { - _da exch get 3 get - } for - _dp 1 sub _dl mod 1 add packedarray - _da 0 get aload pop 8 -1 roll 5 -1 roll pop 4 1 roll - definepattern pop - } if -} -{ -_dp 0 ne _dp _dl mod 0 eq and - { - null dp - } if -7 packedarray _da exch _dp _dl mod exch put -_dp _dl mod _da 0 get 4 get 2 packedarray -/_dp _dp 1 add def -} ifelse -} def -/E -{ -_ed begin -dup 0 get type /arraytype ne - { - 0 - { - dup 1 add index type /arraytype eq - { - 1 add - } - { - exit - } ifelse - } loop - array astore - } if -/_dd exch def -/_ury exch def -/_urx exch def -/_lly exch def -/_llx exch def -/_n exch def -/_y 0 def -/_dl 4 def -/_dp 0 def -/_da _dl array def -0 1 _dd length 1 sub - { - /_d exch _dd exch get def - 0 2 _d length 2 sub - { - /_x exch def - /_c _d _x get _ ne def - /_r _d _x 1 add get cvlit def - _r _ ne - { - _urx _llx sub _ury _lly sub [1 0 0 1 0 0] - [ - /save cvx - _llx neg _lly neg /translate cvx - _c - { - nc /begin cvx - } if - _r dup type /stringtype eq - { - cvx - } - { - {exec} /forall cvx - } ifelse - _c - { - /end cvx - } if - /restore cvx - ] cvx - /_fn 12 _n length add string def - _y _fn cvs pop - /_y _y 1 add def - _fn 12 _n putinterval - _fn _c false dp - _d exch _x 1 add exch put - } if - } for - } for -null dp -_n _dd /_pd -end xput -} def -/fc -{ -_fm dup concatmatrix pop -} def -/p -{ -/_fm exch ddef -9 -2 roll _pm translate fc -7 -2 roll _pm scale fc -5 -1 roll _pm rotate fc -4 -2 roll exch 0 ne - { - dup _pm rotate fc - 1 -1 _pm scale fc - neg _pm rotate fc - } - { - pop - } ifelse -dup _pm rotate fc -exch dup sin exch cos div 1 0 0 1 0 6 2 roll -_pm astore fc -neg _pm rotate fc -_pd exch get /_fdd exch ddef -/_pf -{ -save -/_doClip 0 ddef -0 1 _fdd length 1 sub - { - /_fd exch _fdd exch get ddef - _fd - 0 2 _fd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _fc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _fm - patternfill - } - { - pop - fill - } ifelse - grestore - pop - } for - pop - } for -restore -newpath -} ddef -/_psf -{ -save -/_doClip 0 ddef -0 1 _fdd length 1 sub - { - /_fd exch _fdd exch get ddef - _fd - 0 2 _fd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _fc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _fm - 9 copy 6 npop patternashow - } - { - pop - 6 copy 3 npop ashow - } ifelse - grestore - pop - } for - pop - } for -restore -%3 npop newpath -sw rmoveto -} ddef -/_pjsf -{ -save -/_doClip 0 ddef -0 1 _fdd length 1 sub - { - /_fd exch _fdd exch get ddef - _fd - 0 2 _fd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _fc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _fm - 12 copy 6 npop patternawidthshow - } - { - pop 9 copy 3 npop awidthshow - } ifelse - grestore - pop - } for - pop - } for -restore -swj rmoveto -} ddef -/_lp /none ddef -} def -/sc -{ -_sm dup concatmatrix pop -} def -/P -{ -/_sm exch ddef -9 -2 roll _pm translate sc -7 -2 roll _pm scale sc -5 -1 roll _pm rotate sc -4 -2 roll exch 0 ne - { - dup _pm rotate sc - 1 -1 _pm scale sc - neg _pm rotate sc - } - { - pop - } ifelse -dup _pm rotate sc -exch dup sin exch cos div 1 0 0 1 0 6 2 roll -_pm astore sc -neg _pm rotate sc -_pd exch get /_sdd exch ddef -/_ps -{ -save -/_doClip 0 ddef -0 1 _sdd length 1 sub - { - /_sd exch _sdd exch get ddef - _sd - 0 2 _sd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _sc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _sm - patternstroke - } - { - pop stroke - } ifelse - grestore - pop - } for - pop - } for -restore -newpath -} ddef -/_pss -{ -save -/_doClip 0 ddef -0 1 _sdd length 1 sub - { - /_sd exch _sdd exch get ddef - _sd - 0 2 _sd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _sc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _sm - 10 copy 6 npop patternashowstroke - } - { - pop 7 copy 3 npop ss - } ifelse - grestore - pop - } for - pop - } for -restore -pop sw rmoveto -} ddef -/_pjss -{ -save -/_doClip 0 ddef -0 1 _sdd length 1 sub - { - /_sd exch _sdd exch get ddef - _sd - 0 2 _sd length 2 sub - { - gsave - 2 copy get dup _ ne - { - cvx exec _sc - } - { - pop - } ifelse - 2 copy 1 add get dup _ ne - { - aload pop findfont _sm - 13 copy 6 npop patternawidthshowstroke - } - { - pop 10 copy 3 npop jss - } ifelse - grestore - pop - } for - pop - } for -restore -pop swj rmoveto -} ddef -/_lp /none ddef -} def -/A -{ -pop -} def -/nc 3 dict def -nc begin -/setgray -{ -pop -} bind def -/setcmykcolor -{ -4 npop -} bind def -/setcustomcolor -{ -2 npop -} bind def -currentdict readonly pop end -currentdict readonly pop end -setpacking -/annotatepage -{ -} def -%%EndResource -%%EndProlog -%%BeginSetup -Adobe_cmykcolor /initialize get exec -Adobe_cshow /initialize get exec -Adobe_customcolor /initialize get exec -Adobe_pattern_AI3 /initialize get exec -Adobe_Illustrator_AI3 /initialize get exec -%%EndSetup -0 A -0 O -0.25 1 1 0.25 k -0 R -0 0 0 1 K -0 J 0 j 0.2 w 4 M []0 d -9.19971 841.8735 m -10.3311 842.1226 8.4126 839.4165 8 839.2729 c -9.57471 839.1421 9.3999 839.0728 v -9 838.9233 8.8623 838.561 8.6001 838.2729 c -7.39355 836.9985 6.49365 836.7915 7.3999 834.8735 C -8.03125 834.9233 8.1626 835.1919 8.6001 834.8735 c -9.32471 834.3423 7.78125 832.979 10 832.0728 c -11.356 831.5229 14.1997 832.1792 15.7998 832.2729 C -15.1997 831.8481 12.5186 830.4546 12.3999 829.6733 c -12.1812 828.2612 12.9434 828.686 13.5996 828.4731 C -13.2998 827.2544 13.106 827.5854 14.1997 827.0737 C -13.9058 825.7485 14.3687 824.8296 15.3999 824.0737 C -15.1309 824.0229 15.0996 823.2983 15.1997 823.4731 C -16.7246 820.23 19.1123 818.5229 21.9995 816.6733 C -21.6309 816.3979 20.6558 815.2925 20.5996 815.2739 C -21.5811 815.061 22.6807 814.1675 23.1997 814.0737 c -25.1621 813.7358 24.1309 815.5171 25.7998 814.2739 C -26.6689 815.0239 26.7061 815.8735 25.9995 816.2729 C -28.0439 816.4048 32.4873 820.0112 33.7998 821.6733 c -34.6494 822.7612 35.0557 823.9985 34.999 825.4731 C -36.499 826.3667 36.6807 826.5669 35.999 828.0737 C -38.5498 828.7544 34.6494 830.9604 33.5996 831.6733 C -35.2559 831.6235 37.4619 830.6421 39.3994 831.0728 c -40.8428 831.4048 40.2432 832.3169 40.5996 833.2729 c -41.0186 834.4165 42.5557 833.5415 42.999 834.4731 c -43.1182 834.7417 42.999 836.0728 Y -42.3311 836.8979 41.6055 837.5981 40.7998 838.2729 c -40.0811 838.8794 42.4736 838.6919 41.999 838.8735 c -41.293 839.1479 40.9424 840.7671 40.5996 841.4731 C -42.5557 840.1978 45.3623 837.6665 44.5986 833.8735 c -44.124 831.5298 41.2871 829.8423 40.1992 827.8735 c -37.6934 823.3608 36.5117 817.7612 33.3994 813.8735 c -33.2178 813.6548 33.1182 813.3608 32.7998 813.2739 c -32.3496 813.1606 33.4121 812.8677 33.5996 812.8735 c -38.4121 813.0864 39.874 811.2544 40.7998 816.0737 C -40.8428 815.8169 40.4053 818.0737 42.1992 818.6733 C -42.5557 815.4302 40.749 813.4673 39.3994 811.2739 C -37.5996 811.7231 36.3115 812.2739 33.7998 812.2739 C -33.7998 810.0112 33.793 805.686 33.1992 804.4731 c -33.168 804.4233 32.6182 803.5981 32.7998 803.4731 c -33.9248 802.7231 34.6367 801.4048 34.1992 800.0737 c -33.9365 799.3052 32.999 797.7427 33.7998 797.2739 c -35.624 796.2114 37.168 797.3052 38.7998 796.8735 C -40.0742 800.6548 40.874 803.8608 42.1992 807.8735 C -42.624 807.6987 42.6924 807.5425 42.999 807.2739 C -44.7861 810.73 46.999 812.7485 47.999 817.0737 C -48.3994 815.8735 L -49.7373 815.98 49.999 816.0737 V -48.4678 814.7856 47.0674 812.6235 46.999 812.4731 c -44.9561 809.3237 44.4111 808.8481 43.999 807.2739 C -44.9932 807.2427 44.6494 807.5552 45.5986 806.6733 C -44.6436 805.8989 45.2686 805.9048 44.7998 805.0737 c -44.7617 805.0171 44.0742 805.0737 43.999 805.0737 C -43.624 803.2427 42.4307 802.436 41.999 801.0737 c -41.3994 799.2046 41.5557 798.2983 40.3994 796.4741 c -38.4561 793.4302 38.249 794.9546 34.5996 793.8745 c -33.7686 792.7495 33.5996 792.6733 v -32.6748 792.2983 31.1309 792.1987 30.1992 792.0737 C -30.9619 790.1802 31.7998 790.4741 34.3994 790.4741 C -35.0371 788.0308 35.1934 789.2681 37.1992 788.2739 c -38.0742 787.8433 38.793 786.0991 39.3994 785.2739 c -39.999 784.4614 41.499 783.8433 41.999 783.0737 c -42.1807 782.7866 41.668 782.5308 41.5996 782.4741 C -44.5049 779.7056 47.499 773.8804 51.1992 772.0737 c -51.3242 772.0181 51.7803 771.8862 51.7998 771.8745 c -52.1436 771.6929 52.2178 771.3745 52.3994 771.2749 C -50.8682 771.6245 51.3057 771.1558 50.999 771.2749 C -51.2178 769.8745 50.5986 769.8745 V -49.4561 774.1743 45.3369 775.1304 43.5986 778.8745 C -43.3555 778.4624 42.8369 778.3179 42.7998 778.2749 C -40.999 780.8931 38.7305 783.2056 37.3994 786.0737 C -36.4248 785.9429 35.9678 785.9429 34.999 786.0737 C -35.1553 784.6245 35.5244 783.0181 35.3994 781.2749 c -35.2432 779.2612 34.8623 776.6558 34.5996 774.6743 C -35.3623 774.3237 36.1309 773.9556 36.7998 773.4741 c -37.2559 773.1499 38.1992 772.437 38.3994 771.8745 c -39.1621 769.6929 38.1992 765.2183 38.5996 762.0747 c -38.6748 761.437 39.2871 760.2368 39.1992 759.4741 c -39.1494 759.0991 38.4619 758.9116 38.5996 758.0747 c -38.7686 757.0122 39.7549 755.5435 40.1992 754.6753 c -41.0811 752.9253 41.6924 751.1128 41.999 748.8745 C -40.3496 749.8628 41.7373 748.5815 40.1992 748.0747 c -39.7061 747.9185 40.1992 748.8745 Y -40.3115 751.7866 39.9424 753.1685 38.999 755.2749 c -38.9492 755.3804 38.0498 756.2866 37.999 756.4741 c -37.2178 759.269 36.6367 763.4556 36.999 767.4741 c -37.1992 769.7495 37.5303 770.1245 35.999 770.8745 c -35.3311 771.2056 34.8994 771.2437 33.999 771.4741 C -33.3057 768.7056 32.5557 766.3491 30.999 764.4741 c -27.2686 759.9995 20.481 761.3491 17.9995 766.0737 c -17.1621 767.6675 16.3745 769.3179 15.7998 771.2749 C -14.7061 770.8745 14.106 770.73 13 770.2749 C -13.5308 766.6675 12.6812 763.0366 12.7998 760.0747 C -12.5308 760.4312 12.0562 760.731 11.7998 761.0747 C -10.4248 756.4253 6.0376 755.6304 5 750.2749 C -4.7998 752.7437 4 751.8745 Y -3.20605 751.9312 3.625 752.4683 3.6001 752.4741 C -5.65625 753.9116 9.43115 757.1304 10.3999 759.4741 c -11.6875 762.606 10.7437 769.3433 12 771.8745 c -12.4497 772.7993 14.3062 773.5366 15.1997 774.0737 C -14.7124 777.6558 14.1436 781.7925 14.5996 785.8745 C -13.8184 785.8745 12.9746 785.8745 12.1997 785.8745 C -11.6997 783.9868 10.1812 779.5679 9.19971 778.0737 c -9.125 777.9683 8.5376 778.2368 8.3999 778.2749 C -8.10596 777.1675 8.2876 776.6616 7.7998 775.6743 c -7.79346 775.6675 7.2251 775.6743 7.19971 775.6743 C -6.08105 773.3062 2.625 770.9116 4.19971 767.8745 C -3.88721 768.0425 3.49365 768.4312 3.3999 768.4741 C -3.33105 768.4741 3.26855 768.4741 3.19971 768.4741 C -3 768.6675 3.08105 769.1304 3 769.4741 C -0.90625 769.6245 1.65625 769.6187 2.6001 770.4741 c -3.94971 771.7124 5.19385 773.7368 6.19971 775.2749 c -4.34375 772.1187 8.3125 778.4487 7 778.4741 C -7.51855 779.5181 8.44336 780.4995 9 781.4741 C -8.78125 781.5181 9.19971 782.2749 Y -8.9751 782.2241 8.8999 782.1812 8.6001 782.0737 C -10.2813 783.4116 10.3062 786.6304 12 787.8745 c -14.1748 789.48 14.7935 787.48 15.5996 790.6733 C -18.1558 790.6733 19.1245 790.0806 19.7998 792.0737 C -19.8496 792.0864 18.7998 792.0737 Y -18.0435 792.2983 16.062 792.2495 15.1997 792.6733 c -14.9434 792.8052 14.6685 793.7808 14.3999 793.8745 c -10.856 795.1489 10.5747 792.9116 8.6001 796.6733 c -6.70605 800.2739 6.4126 803.3481 4.19971 806.0737 C -4.76855 806.9175 4.86865 806.7544 5.3999 807.0737 C -3.6626 809.73 2.69385 813.2114 0 814.2739 C -0 814.3481 0.037598 815.0552 0 815.0737 C -1.2251 815.4106 1.44385 815.311 2.3999 815.8735 C -1.44385 813.9487 5.23096 809.1489 6.3999 806.6733 C -7.1748 807.186 7.13721 807.6177 7.7998 806.2739 C -7.70605 806.2173 7.5874 805.2612 7.6001 805.0737 c -7.75 802.3608 9.5625 799.7358 10.1997 796.6733 C -12.1748 797.1802 13.3999 796.6304 15.5996 797.2739 C -15.2061 799.3921 14.6309 800.1548 14.1997 802.2739 C -15.4873 802.5171 15.231 802.6548 16.1997 803.4731 c -16.437 803.6802 15.8184 804.23 15.7998 804.2739 c -15.2749 805.3735 15.1875 810.2046 15.3999 812.0737 C -13.7124 811.73 12.3311 810.6606 11.1997 810.4731 c -10.7749 810.4106 10.4248 810.4731 10 810.4731 C -9.2749 812.2671 6.80615 814.355 6.6001 815.4731 c -6.4375 816.3481 6.875 816.7856 7 817.2729 C -7.1499 817.1733 7.94336 817.0854 8 817.0737 C -8.44336 814.0796 9.2373 813.8921 10.5996 811.4731 C -12.6558 811.8794 14.0186 812.7231 16.3999 813.0737 C -13.4497 817.5854 12.0747 823.5542 9.3999 828.4731 c -8.1875 830.6978 5.5249 832.2856 5.19971 835.2729 c -5.16846 835.5103 5.38086 836.1919 5.3999 836.0728 C -5.79346 838.0298 6.21875 838.8296 7.19971 840.0728 c -7.50586 840.4731 7.81836 840.9673 8.19971 841.2729 c -8.3999 841.4419 8.9624 841.8228 9.19971 841.8735 c -b -%%PageTrailer -gsave annotatepage grestore showpage -%%Trailer -Adobe_Illustrator_AI3 /terminate get exec -Adobe_pattern_AI3 /terminate get exec -Adobe_customcolor /terminate get exec -Adobe_cshow /terminate get exec -Adobe_cmykcolor /terminate get exec -Adobe_packedarray /terminate get exec -%%EOF diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_demo.jpg b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_demo.jpg deleted file mode 100644 index 262bce272c..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_demo.jpg and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_with_alpha.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_with_alpha.png deleted file mode 100644 index 27df6afcb2..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/image_with_alpha.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/img.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/img.png deleted file mode 100644 index 1816e3f0a6..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/img.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.gif b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.gif deleted file mode 100644 index 010b487d93..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.gif and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.jpg b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.jpg deleted file mode 100644 index 6d9b8fd807..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.jpg and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.png deleted file mode 100644 index 13799452be..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/logo_example.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/pelican.ai b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/pelican.ai deleted file mode 100644 index e4d461e968..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/pelican.ai +++ /dev/null @@ -1,147 +0,0 @@ -%!PS-Adobe-3.0 -%%Creator: Adobe Illustrator(TM) 3.2 -%%AI8_CreatorVersion: 12.0.0 -%%For: (fluxus) (x) -%%Title: (pelican.ai) -%%CreationDate: 4/15/2006 11:28 PM -%%BoundingBox: 38 221 564 654 -%%DocumentProcessColors: Black -%%DocumentNeededResources: procset Adobe_packedarray 2.0 0 -%%+ procset Adobe_cshow 1.1 0 -%%+ procset Adobe_customcolor 1.0 0 -%%+ procset Adobe_pattern_AI3 1.0 0 -%%+ procset Adobe_Illustrator_AI3 1.0 1 -%AI3_ColorUsage: Color -%%CMYKCustomColor: 1 1 1 1 ([Registration]) -%AI3_TemplateBox: 298.5 420.3896 298.5 420.3896 -%AI3_TileBox: 0.157715 0.044861 595.1177 841.9648 -%AI3_DocumentPreview: None -%%PageOrigin:-32 11.8896 -%AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 -%AI9_Flatten: 1 -%AI12_CMSettings: 00.MS -%%EndComments -%%BeginProlog -%%IncludeResource: procset Adobe_packedarray 2.0 0 -Adobe_packedarray /initialize get exec -%%IncludeResource: procset Adobe_cshow 1.1 0 -%%IncludeResource: procset Adobe_customcolor 1.0 0 -%%IncludeResource: procset Adobe_pattern_AI3 1.0 0 -%%IncludeResource: procset Adobe_Illustrator_AI3 1.0 1 -%%EndProlog -%%BeginSetup -Adobe_cshow /initialize get exec -Adobe_customcolor /initialize get exec -Adobe_pattern_AI3 /initialize get exec -Adobe_Illustrator_AI3 /initialize get exec -%%EndSetup -0 A -0 O -0.823529 g -0 J 0 j 1 w 4 M []0 d -406.3574 653.9336 m -464.8369 654.4839 476.1016 604.7227 506.8555 577.2656 c -518.2334 567.1074 538.876 556.4058 541.0449 537.8945 C -525.793 545.1372 515.3398 557.5967 502.1924 566.9033 c -492.1299 574.0298 478.9131 577.0991 467.4844 582.9634 c -454.5439 589.603 441.3213 599.4785 424.4873 589.1792 c -413.7012 582.5776 412.9746 565.8579 406.3574 554.9893 c -401.2715 546.6338 390.2637 539.4668 382.0098 534.269 c -370.5801 527.0684 326.3232 509.3872 322.4365 499.042 C -331.416 493.8628 340.3955 488.6816 349.375 483.5005 C -370.4541 474.8203 420.0293 453.8994 428.1152 435.3247 C -427.9424 435.3247 427.7695 435.3247 427.5967 435.3247 C -422.0781 438.2988 418.0566 441.834 411.0205 443.6128 C -411.0205 442.9214 411.0205 442.2324 411.0205 441.541 C -415.6807 438.0884 420.3457 434.6333 425.0059 431.1807 C -426.5615 431.6968 428.1152 432.2153 429.6689 432.7339 C -436.3252 429.1694 440.0146 421.5771 446.2451 417.1924 c -468.749 401.3643 540.2861 360.04 557.624 408.9043 C -559.6963 408.7314 561.7676 408.5586 563.8398 408.3857 C -564.2002 369.6592 525.0967 377.3896 496.4951 382.4844 c -485.8457 384.3838 476.0742 379.3203 465.4141 380.9307 c -458.0371 382.0459 454.999 385.5068 447.8008 386.1123 C -444.6514 384.4326 443.9072 382.2314 441.583 379.8955 C -441.7559 379.5498 441.9287 379.2041 442.1016 378.8584 C -453.1211 376.5439 474.8496 358.7158 485.6162 352.4404 c -499.0371 344.6182 513.7188 346.8398 528.6133 341.043 C -531.0205 346.2412 546.2559 365.248 551.9258 365.9072 C -552.0986 365.3896 552.2715 364.8721 552.4424 364.3545 C -553.4883 360.7607 550.0078 356.1338 548.2988 353.4756 c -539.4346 339.6855 527.2559 336.8584 503.748 337.415 C -507.8379 329.7158 516.5977 331.1191 522.3965 325.501 C -510.8311 324.9131 495.6875 323.7822 486.6533 327.5732 C -483.0273 329.6455 479.4004 331.7178 475.7744 333.79 C -468.749 335.082 467.1133 328.6885 461.7891 327.5732 c -451.8096 325.4854 442.6299 328.9424 433.8125 329.6455 C -427.6152 314.2881 411.4697 330.1348 399.1045 326.5381 C -395.1328 323.6025 391.1621 320.666 387.1904 317.7314 C -380.2559 315.4561 375.2725 320.9756 368.0234 319.2861 C -363.707 316.8682 359.3877 314.4502 355.0732 312.0322 C -346.0449 325.4189 337.3516 308.3584 325.0264 313.0693 c -319.249 315.2764 317.3877 322.9951 312.0762 324.9834 c -302.3477 328.626 290.0044 321.8848 280.4756 325.501 c -275.7075 327.3125 274.5767 334.043 270.1157 335.8623 C -266.6616 335.6885 263.208 335.5166 259.7544 335.3428 C -254.7881 336.4834 253.1904 341.9092 248.8755 343.6338 C -245.7686 343.8066 242.6592 343.9775 239.5513 344.1494 C -236.9614 347.4326 234.3711 350.7119 231.7803 353.9941 C -227.1187 356.2158 222.1738 353.7666 218.312 356.0654 C -217.707 358.9385 216.9556 361.4961 214.6855 362.8008 C -210.5415 362.9736 206.396 363.1465 202.2529 363.3174 C -200.6987 365.3896 199.145 367.4639 197.5903 369.5332 C -193.9648 370.2246 190.3384 370.916 186.7119 371.6074 C -183.0776 383.6631 179.9097 377.1084 172.7246 383.0029 C -172.0347 384.5557 171.3433 386.1123 170.6528 387.665 C -167.4033 390.2705 160.396 389.1025 157.1846 391.291 C -150.2778 399.2334 143.3691 407.1787 136.4629 415.1201 C -135.7725 415.1201 135.0811 415.1201 134.3906 415.1201 C -129.8872 408.9912 123.022 405.2783 118.332 399.5791 c -109.856 389.2803 103.8877 376.3271 98.6465 362.8008 c -91.7344 344.96 87.7056 323.8467 83.6235 304.2627 c -81.5273 294.2061 81.9316 284.2168 78.4434 275.7705 c -74.5234 266.2822 66.5 259.7139 60.8296 251.9404 c -54.7129 243.5557 51.2388 224.7588 40.627 221.3779 C -40.7998 221.7217 40.9727 222.0674 41.144 222.4131 C -39.79 227.2139 42.2383 230.333 43.2163 234.3291 C -41.1147 235.4502 39.3652 235.8232 38.5547 238.4736 C -40.1084 244.3438 41.6626 250.2139 43.2163 256.085 C -42.6357 258.7764 38.5103 262.4824 40.1084 267.4814 c -41.354 271.3818 44.9365 271.5908 45.2896 277.3262 C -43.8086 279.5244 41.9907 280.7529 40.1084 282.5049 C -40.1084 282.6777 40.1084 282.8506 40.1084 283.0234 C -52.8052 283.6553 57.1475 290.5166 61.3481 299.6006 C -53.7988 301.8721 41.7808 303.3838 38.5547 309.96 C -46.126 307.9092 59.4692 305.3623 67.0459 307.3721 C -69.4639 315.3115 71.8813 323.2568 74.2993 331.1992 C -77.9248 347.085 81.5513 362.9736 85.1777 378.8584 C -87.957 392.2158 84.7827 409.2002 90.3579 419.7832 C -92.7749 421.6826 95.1934 423.5815 97.6104 425.481 C -99.3364 431.1782 101.064 436.8784 102.7905 442.5757 C -107.7554 450.8428 114.814 456.6777 119.3677 465.8892 C -115.0508 468.8232 110.7329 471.7593 106.417 474.6938 C -106.7617 476.2495 107.1074 477.8027 107.4531 479.3564 C -93.3389 475.1343 85.5649 470.4336 75.8525 462.7798 C -65.6665 462.7798 55.4756 462.7798 45.2896 462.7798 C -45.4609 463.1255 45.6338 463.4712 45.8066 463.8169 C -74.2612 470.5581 82.3726 479.2275 102.7905 491.7886 C -114.7041 497.832 126.6211 503.8774 138.5347 509.9204 C -142.1606 513.2007 145.7881 516.4824 149.4136 519.7622 C -168.4629 531.9883 188.5562 540.2256 210.5415 549.8081 c -217.877 553.0059 224.0391 558.6489 232.2988 561.2056 c -245.8008 565.3853 266.6577 569.8081 284.1025 566.3867 C -292.7354 563.4507 301.3701 560.5142 310.0039 557.5801 C -324.5254 553.9165 346.2764 558.8447 355.0732 564.3149 c -369.0625 573.0098 372.4688 593.5171 375.793 613.0088 C -376.6572 620.606 377.5195 628.2046 378.3838 635.8013 C -383.2783 647.8481 394.3535 648.647 406.3574 653.9336 C -f -%%PageTrailer -gsave annotatepage grestore showpage -%%Trailer -Adobe_Illustrator_AI3 /terminate get exec -Adobe_pattern_AI3 /terminate get exec -Adobe_customcolor /terminate get exec -Adobe_cshow /terminate get exec -Adobe_packedarray /terminate get exec -%%EOF diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_cell.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_cell.png deleted file mode 100644 index 98a1553a82..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_cell.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_logo.jpg b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_logo.jpg deleted file mode 100644 index 257f8fb6d9..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_logo.jpg and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_signature.png b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_signature.png deleted file mode 100644 index a4f0637251..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tcpdf_signature.png and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/testsvg.svg b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/testsvg.svg deleted file mode 100644 index fd8314e348..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/testsvg.svg +++ /dev/null @@ -1,328 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - version="1.1" - width="12cm" - height="6cm" - id="svg2"> - <desc - id="desc4">TCPDF SVG EXAMPLE</desc> - <defs - id="defs42"> - <radialGradient - cx="85" - cy="15" - r="5.25" - fx="85" - fy="15" - id="radialGradient2865" - xlink:href="#MyRGradient" - gradientUnits="userSpaceOnUse" /> - <radialGradient - cx="60" - cy="25" - r="10.5" - fx="60" - fy="25" - id="radialGradient2867" - xlink:href="#MyRGradient" - gradientUnits="userSpaceOnUse" /> - <radialGradient - cx="17.82198" - cy="28.055244" - r="10.871407" - fx="17.82198" - fy="28.055244" - id="radialGradient2869" - xlink:href="#MyRGradient" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.6200333,0,0,1.8396889,173.9517,-9.005912)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5087" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <linearGradient - id="linearGradient5075"> - <stop - id="stop5077" - style="stop-color:#ffff00;stop-opacity:1" - offset="0" /> - <stop - id="stop5079" - style="stop-color:#ff0000;stop-opacity:1" - offset="1" /> - </linearGradient> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient2846" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <linearGradient - id="linearGradient2848"> - <stop - id="stop2850" - style="stop-color:#ffff00;stop-opacity:1" - offset="0" /> - <stop - id="stop2852" - style="stop-color:#ff0000;stop-opacity:1" - offset="1" /> - </linearGradient> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient2854" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <linearGradient - id="linearGradient2856"> - <stop - id="stop2858" - style="stop-color:#ffff00;stop-opacity:1" - offset="0" /> - <stop - id="stop2860" - style="stop-color:#ff0000;stop-opacity:1" - offset="1" /> - </linearGradient> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient2862" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <linearGradient - id="linearGradient2864"> - <stop - id="stop2866" - style="stop-color:#ffff00;stop-opacity:1" - offset="0" /> - <stop - id="stop2868" - style="stop-color:#ff0000;stop-opacity:1" - offset="1" /> - </linearGradient> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient2885" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <radialGradient - cx="60" - cy="25" - r="10.5" - fx="60" - fy="25" - id="radialGradient5215" - xlink:href="#MyRGradient" - gradientUnits="userSpaceOnUse" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5223" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5245" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5261" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(3.2520801,0,0,1.0907419,-234.6921,-1.613686)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5264" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.53063427,0,0,0.17133835,-41.5959,-53.579631)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5267" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.53063427,0,0,0.17133835,-41.5959,-53.579631)" /> - <radialGradient - cx="184.10963" - cy="476.55164" - r="74.151497" - fx="184.10963" - fy="476.55164" - id="radialGradient5270" - xlink:href="#linearGradient5075" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.53063427,0,0,0.17133835,-41.5959,-53.579631)" /> - <radialGradient - cx="85" - cy="15" - r="5.25" - fx="85" - fy="15" - id="radialGradient5295" - xlink:href="#MyRGradient" - gradientUnits="userSpaceOnUse" /> - </defs> - <linearGradient - x1="2.4930596" - y1="8.1225491" - x2="58.448399" - y2="8.1225491" - id="MyLGradient" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(2.1674701,3.2244804e-8,-1.0401032e-8,0.46846403,253.27742,-193.75856)"> - <stop - id="stop7" - style="stop-color:#ff6600;stop-opacity:1" - offset="0.05" /> - <stop - id="stop9" - style="stop-color:#ffff66;stop-opacity:1" - offset="0.94999999" /> - </linearGradient> - <radialGradient - id="MyRGradient"> - <stop - id="stop12" - style="stop-color:#0033ff;stop-opacity:1" - offset="0.05" /> - <stop - id="stop14" - style="stop-color:#ffff66;stop-opacity:1" - offset="0.94999999" /> - </radialGradient> - <rect - width="120.08073" - height="25.367481" - rx="3.602421" - ry="2.5367482" - x="259.28146" - y="-189.53065" - transform="matrix(0.71626866,0.69782463,-0.72008162,0.69388937,0,0)" - id="rect16" - style="fill:url(#MyLGradient);stroke:#0000ff;stroke-width:1.00766146" /> - <ellipse - cx="90" - cy="30" - rx="20" - ry="10" - transform="matrix(1.4285714,0,0,1.4285714,178.03709,88.814199)" - id="ellipse20" - style="fill:#00ff00;stroke:#008000;stroke-width:1" /> - <path - d="m 199.75816,42.607008 c 0,-25.80645 38.7097,-25.80645 38.7097,0 0,25.80645 38.70969,25.80645 38.70969,0 z" - id="path30" - style="fill:url(#radialGradient2869);stroke:#0000ff;stroke-width:1.29032314" /> - <path - d="m 56.981711,101.40999 q 38.411107,-48.013879 76.822209,0 38.41109,48.01387 76.8222,0" - id="path32" - style="fill:none;stroke:#008000;stroke-width:0.96027768" /> - <path - d="m 56.981711,101.40999 38.411107,-48.013879 38.411102,48.013879 38.41109,48.01387 38.41111,-48.01387" - id="path34" - style="fill:none;stroke:#888888;stroke-width:0.38411102" /> - <line - x1="158.17" - y1="196.27382" - x2="403.61057" - y2="196.27382" - id="line22" - style="fill:#ff0000;stroke:#ff0000;stroke-width:2.72711658;stroke-opacity:1" /> - <text - x="158.15259" - y="182.61755" - id="text38" - style="font-size:35.67964172px;font-weight:bold;fill:#0000ff;font-family:Helvetica">www.tcpdf.org</text> - <polygon - points="80,10 90,10 90,20 80,20 80,10 " - transform="matrix(4.7619048,0,0,4.7619048,-28.55484,-29.862646)" - id="polygon26" - style="fill:url(#radialGradient5295);stroke:#ff0000;stroke-width:0.5" /> - <path - d="M 172.22678,86.983374 H 140.4086 A 31.818187,31.818187 0 1 0 172.22678,55.16517 z" - id="path10" - style="fill:#ff0000;stroke:#0000ff;stroke-width:1.06060624" /> - <path - d="M 166.92376,81.680334 V 49.86215 a 31.818187,31.818187 0 0 0 -31.81821,31.818184 z" - id="path12" - style="fill:#ffff00;stroke:#0000ff;stroke-width:1.06060624" /> - <path - d="m 191.9699,155.18875 13.78038,-6.89018 a 7.7034622,7.7034622 0 1 1 13.78037,-6.89018 l 13.78033,-6.89018 a 15.386158,7.6930793 60 0 1 13.78034,-6.89016 l 13.78034,-6.89017 a 23.073485,7.6911617 60 0 1 13.78037,-6.89019 l 13.78037,-6.89017 a 30.761945,7.6904861 60 1 1 13.78036,-6.89019 l 13.78034,-6.890167" - id="path14" - style="fill:none;stroke:#ff0000;stroke-width:1.37803578" /> - <circle - cx="60" - cy="25" - r="10" - transform="matrix(2.3809524,0,0,2.3809524,-86.105483,113.11357)" - id="circle18" - style="fill:url(#radialGradient5215);stroke:#ff0000;stroke-width:1" /> - <path - d="m 32.361418,52.28906 48.780487,0 -24.39025,48.78049 z" - id="path28" - style="fill:#ffff00;stroke:#0000ff;stroke-width:1.21951222" /> - <image - xlink:href="tcpdf_logo.jpg" - id="image36" - height="26.666664" - width="80" - y="111.32501" - x="16.751661" /> - <text - x="13.399332" - y="41.580627" - id="text5343" - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#008000;font-family:helvetica;font-size:30pt">SVG</text> -</svg> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tiger.ai b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tiger.ai deleted file mode 100644 index 37c8b5b484..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tiger.ai +++ /dev/null @@ -1,3599 +0,0 @@ -%!PS-Adobe-3.0 -%%Creator: Adobe Illustrator(TM) 3.2 -%%AI8_CreatorVersion: 12.0.0 -%%For: (fluxus) (x) -%%Title: (tiger.ai) -%%CreationDate: 4/14/2006 11:35 PM -%%BoundingBox: 22 167 567 730 -%%DocumentProcessColors: Cyan Magenta Yellow Black -%%DocumentNeededResources: procset Adobe_packedarray 2.0 0 -%%+ procset Adobe_cmykcolor 1.1 0 -%%+ procset Adobe_cshow 1.1 0 -%%+ procset Adobe_customcolor 1.0 0 -%%+ procset Adobe_pattern_AI3 1.0 0 -%%+ procset Adobe_Illustrator_AI3 1.0 1 -%AI3_ColorUsage: Color -%%CMYKCustomColor: 0.74902 0.678431 0.670588 0.901961 ([Registration]) -%AI3_TemplateBox: 306.5 396.5 306.5 396.5 -%AI3_TileBox: 0 1 612 793 -%AI3_DocumentPreview: None -%%PageOrigin:0 0 -%AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 -%AI9_Flatten: 1 -%AI12_CMSettings: 00.MS -%%EndComments -%%BeginProlog -%%IncludeResource: procset Adobe_packedarray 2.0 0 -Adobe_packedarray /initialize get exec -%%IncludeResource: procset Adobe_cmykcolor 1.1 0 -%%IncludeResource: procset Adobe_cshow 1.1 0 -%%IncludeResource: procset Adobe_customcolor 1.0 0 -%%IncludeResource: procset Adobe_pattern_AI3 1.0 0 -%%IncludeResource: procset Adobe_Illustrator_AI3 1.0 1 -%%EndProlog -0 A -u -0 O -1 g -0 J 0 j 1 w 4 M []0 d -90.5 477.5 m -90.5767 475.4434 89.7798 475.5801 v -88.7646 475.4863 70.6641 528.3682 48.02 525.9795 c -67.6445 533.9883 90.5 477.5 v -F -0 R -0 G -0.1892 w 10 M -90.5 477.5 m -90.5767 475.4434 89.7798 475.5801 v -88.7646 475.4863 70.6641 528.3682 48.02 525.9795 c -67.6445 533.9883 90.5 477.5 v -90.5 477.5 l -s -0 O -1 g -1 w 4 M -94.3398 480.8594 m -93.7446 478.8555 92.8999 479.1797 v -92.0552 479.5107 93.0249 535.3975 71.0601 540.8594 c -92.0981 541.709 94.3398 480.8594 v -F -0 R -0 G -0.1892 w 10 M -94.3398 480.8594 m -93.7446 478.8555 92.8999 479.1797 v -92.0552 479.5107 93.0249 535.3975 71.0601 540.8594 c -92.0981 541.709 94.3398 480.8594 v -94.3398 480.8594 l -s -0 O -1 g -1 w 4 M -124.5801 434.2998 m -126.3872 433.2363 125.7798 432.3799 v -125.3525 431.7461 71.2617 445.8291 60.98 425.6602 c -64.9063 446.4102 124.5801 434.2998 v -F -0 R -0 G -0.1892 w 10 M -124.5801 434.2998 m -126.3872 433.2363 125.7798 432.3799 v -125.3525 431.7461 71.2617 445.8291 60.98 425.6602 c -64.9063 446.4102 124.5801 434.2998 v -124.5801 434.2998 l -s -0 O -1 g -1 w 4 M -121.46 423.0195 m -123.5381 422.624 123.3799 421.8193 v -123.0249 420.8838 67.2534 417.207 63.8599 394.7002 c -61.04 415.7598 121.46 423.0195 v -F -0 R -0 G -0.1892 w 10 M -121.46 423.0195 m -123.5381 422.624 123.3799 421.8193 v -123.0249 420.8838 67.2534 417.207 63.8599 394.7002 c -61.04 415.7598 121.46 423.0195 v -121.46 423.0195 l -s -0 O -1 g -1 w 4 M -116.8999 429.0195 m -118.8223 428.4082 118.3398 427.5801 v -118.0615 426.7617 62.3481 431.2617 55.7002 409.5801 c -55.9902 430.7334 116.8999 429.0195 v -F -0 R -0 G -0.1892 w 10 M -116.8999 429.0195 m -118.8223 428.4082 118.3398 427.5801 v -118.0615 426.7617 62.3481 431.2617 55.7002 409.5801 c -55.9902 430.7334 116.8999 429.0195 v -116.8999 429.0195 l -s -0 O -1 g -1 w 4 M -105.1401 449.1797 m -106.5298 447.6514 105.8599 447.0195 v -105.123 446.5039 57.0054 474.9434 41.54 458.2998 c -51.0586 477.2549 105.1401 449.1797 v -F -0 R -0 G -0.1892 w 10 M -105.1401 449.1797 m -106.5298 447.6514 105.8599 447.0195 v -105.123 446.5039 57.0054 474.9434 41.54 458.2998 c -51.0586 477.2549 105.1401 449.1797 v -105.1401 449.1797 l -s -0 O -1 g -1 w 4 M -96.7402 444.6201 m -98.3936 443.2139 97.7002 442.46 v -97.1265 441.9131 46.0977 464.7266 32.4199 446.54 c -39.9297 466.3496 96.7402 444.6201 v -F -0 R -0 G -0.1892 w 10 M -96.7402 444.6201 m -98.3936 443.2139 97.7002 442.46 v -97.1265 441.9131 46.0977 464.7266 32.4199 446.54 c -39.9297 466.3496 96.7402 444.6201 v -96.7402 444.6201 l -s -0 O -1 g -1 w 4 M -93.8599 440.0596 m -95.6982 438.9629 95.0601 438.1396 v -94.6206 437.5059 40.9614 453.1494 30.02 433.3398 c -34.6279 453.917 93.8599 440.0596 v -F -0 R -0 G -0.1892 w 10 M -93.8599 440.0596 m -95.6982 438.9629 95.0601 438.1396 v -94.6206 437.5059 40.9614 453.1494 30.02 433.3398 c -34.6279 453.917 93.8599 440.0596 v -93.8599 440.0596 l -s -0 O -1 g -1 w 4 M -105.6201 439.3398 m -106.9736 437.7129 106.1001 437.1797 v -105.4302 436.7549 61.3545 471.1279 43.7002 456.6201 c -55.7529 474.1826 105.6201 439.3398 v -F -0 R -0 G -0.1892 w 10 M -105.6201 439.3398 m -106.9736 437.7129 106.1001 437.1797 v -105.4302 436.7549 61.3545 471.1279 43.7002 456.6201 c -55.7529 474.1826 105.6201 439.3398 v -105.6201 439.3398 l -s -0 O -1 g -1 w 4 M -84.02 471.2598 m -84.6416 469.2607 83.7798 469.0996 v -82.8799 468.8213 51.4209 515.0215 30.2598 506.7803 c -47.0215 519.6416 84.02 471.2598 v -F -0 R -0 G -0.1892 w 10 M -84.02 471.2598 m -84.6416 469.2607 83.7798 469.0996 v -82.8799 468.8213 51.4209 515.0215 30.2598 506.7803 c -47.0215 519.6416 84.02 471.2598 v -84.02 471.2598 l -s -0 O -1 g -1 w 4 M -84.7402 463.5801 m -85.8174 461.7725 84.98 461.4199 v -84.1929 460.9639 43.5078 499.292 24.7402 486.6201 c -38.2158 502.8535 84.7402 463.5801 v -F -0 R -0 G -0.1892 w 10 M -84.7402 463.5801 m -85.8174 461.7725 84.98 461.4199 v -84.1929 460.9639 43.5078 499.292 24.7402 486.6201 c -38.2158 502.8535 84.7402 463.5801 v -84.7402 463.5801 l -s -0 O -1 g -1 w 4 M -84.5 458.7803 m -85.8535 457.0732 84.98 456.6201 v -84.3105 456.1182 40.2344 490.4883 22.5801 476.0596 c -34.6328 493.541 84.5 458.7803 v -F -0 R -0 G -0.1892 w 10 M -84.5 458.7803 m -85.8535 457.0732 84.98 456.6201 v -84.3105 456.1182 40.2344 490.4883 22.5801 476.0596 c -34.6328 493.541 84.5 458.7803 v -84.5 458.7803 l -s -0 O -1 g -1 w 4 M -82.1001 456.8594 m -82.7407 450.2168 83.8281 442.9902 85.7002 439.5801 c -81.7808 425.9189 91.46 411.5 v -91.0205 403.4795 92.8999 399.9795 v -97.1816 390.7207 102.5 389.8994 v -106.7334 389.1299 116.3286 385.7529 127.2197 384.1396 c -146.0215 368.7197 142.5801 354.6201 v -142.0615 336.6006 138.02 334.9395 v -150.8599 347.1582 140.4199 328.7002 v -135.3799 308.0596 l -163.6206 331.7598 146.4199 311.4199 v -135.3799 282.8594 l -157.0205 303.1592 149.0601 293.8994 v -145.7002 284.2998 l -193.1001 314.1582 159.1401 281.6602 v -168.02 285.5596 172.8198 282.3799 v -180.3418 283.8008 179.54 282.1396 v -156.5815 270.6006 152.6602 250.46 v -161.8613 261.3584 158.4199 249.5 v -158.8999 236.7803 l -163.1816 260.4795 162.7402 219.0195 v -183.8599 238.9209 171.1401 216.1396 v -171.1401 197.6602 l -187.8198 215.5996 180.7402 201.5 v -191.7798 211.2002 187.46 194.54 v -186.5 183.0391 191.2998 195.2598 v -208.9399 229.0205 202.3398 200.2998 v -201.4614 179.0791 206.6602 195.2598 v -207.1807 183.9199 217.2197 176.0596 v -215.9814 231.8789 230.1802 192.3799 v -234.5 174.1396 l -237.541 184.3594 237.1401 189.9795 v -253.3809 208.1191 246.02 181.3398 v -262.6206 206.3594 259.2197 191.8994 v -250.7407 174.2402 252.5 168.8594 v -270.98 207.2402 272.4199 208.9395 v -270.1016 162.3584 282.02 201.9795 v -288.1401 188.7607 285.1401 183.9795 v -293.8613 192.7207 293.0601 196.2197 v -298.04 205.2607 301.2197 190.2197 v -303.1016 179.96 304.8198 183.5 v -309.2598 157.0781 310.5801 182.0596 v -312.3418 197.1201 304.3398 209.8994 v -305.2998 213.3994 302.1802 217.8193 v -317.1797 194.04 309.3799 225.7393 v -321.582 216.9199 322.8203 216.8594 v -307.9395 242.4385 317.54 237.2598 v -311.9004 248.5996 331.7002 235.3398 v -314.1006 252.999 333.3799 242.54 v -342.2617 235.3994 333.8594 246.3799 v -318.0605 264.001 342.2598 244.2197 v -355.0205 226.1602 355.9395 223.0996 v -344.9023 255.2002 340.0996 258.3799 v -349.3018 298.3203 394.5801 281.1797 v -402.1016 262.2393 407.0605 282.3799 v -421.0215 289.5195 433.46 259.0996 v -437.7422 274.1191 436.8203 277.0996 v -444.3418 275.8779 443.54 277.0996 v -457.9805 272.3594 459.3799 273.2598 v -466.7813 265.7598 467.2998 269.6602 v -477.3418 266.6406 475.2197 270.6201 v -484.8223 253.4404 485.2998 249.5 v -487.9395 264.8594 l -490.0996 261.7393 l -491.8613 270.1592 491.0605 271.5801 v -490.1025 272.7988 512.9814 264.001 518.1797 241.0996 c -520.5801 231.9795 l -527.0625 248.1602 525.3799 252.6201 v -531.0225 251.6787 531.3799 246.8594 v -535.8613 272.3594 530.6602 279.0195 v -535.4219 279.8408 536.6602 275.8994 v -536.6602 283.8193 l -544.6621 282.9199 544.5801 285.5 v -549.502 289.959 551.7793 284.7803 v -538.0615 323.4004 558.2598 302.2998 v -566.2207 290.4004 562.3398 311.1797 v -558.3008 331.7598 553.9014 333.5186 559.2207 333.9795 c -560.0625 337.9209 557.7793 339.7393 v -555.6602 341.4385 559.2207 339.7393 y -564.4609 335.2803 558.7402 359.4199 v -565.7813 357.7207 552.5 389.8994 v -555.6602 392.4795 551.2998 401.6602 v -560.0625 396.8789 563.0605 398.54 v -562.7021 400.3994 559.2207 404.7803 v -535.4219 465.0801 557.7793 440.7803 v -570.8965 425.9746 563.7793 451.0996 v -553.834 477.4658 554.6602 482.2998 v -82.1001 456.8594 l -F -0 R -0 G -1.1 w 10 M -82.1001 456.8594 m -82.7407 450.2168 83.8281 442.9902 85.7002 439.5801 c -81.7808 425.9189 91.46 411.5 v -91.0205 403.4795 92.8999 399.9795 v -97.1816 390.7207 102.5 389.8994 v -106.7334 389.1299 116.3286 385.7529 127.2197 384.1396 c -146.0215 368.7197 142.5801 354.6201 v -142.0615 336.6006 138.02 334.9395 v -150.8599 347.1582 140.4199 328.7002 v -135.3799 308.0596 l -163.6206 331.7598 146.4199 311.4199 v -135.3799 282.8594 l -157.0205 303.1592 149.0601 293.8994 v -145.7002 284.2998 l -193.1001 314.1582 159.1401 281.6602 v -168.02 285.5596 172.8198 282.3799 v -180.3418 283.8008 179.54 282.1396 v -156.5815 270.6006 152.6602 250.46 v -161.8613 261.3584 158.4199 249.5 v -158.8999 236.7803 l -163.1816 260.4795 162.7402 219.0195 v -183.8599 238.9209 171.1401 216.1396 v -171.1401 197.6602 l -187.8198 215.5996 180.7402 201.5 v -191.7798 211.2002 187.46 194.54 v -186.5 183.0391 191.2998 195.2598 v -208.9399 229.0205 202.3398 200.2998 v -201.4614 179.0791 206.6602 195.2598 v -207.1807 183.9199 217.2197 176.0596 v -215.9814 231.8789 230.1802 192.3799 v -234.5 174.1396 l -237.541 184.3594 237.1401 189.9795 v -253.3809 208.1191 246.02 181.3398 v -262.6206 206.3594 259.2197 191.8994 v -250.7407 174.2402 252.5 168.8594 v -270.98 207.2402 272.4199 208.9395 v -270.1016 162.3584 282.02 201.9795 v -288.1401 188.7607 285.1401 183.9795 v -293.8613 192.7207 293.0601 196.2197 v -298.04 205.2607 301.2197 190.2197 v -303.1016 179.96 304.8198 183.5 v -309.2598 157.0781 310.5801 182.0596 v -312.3418 197.1201 304.3398 209.8994 v -305.2998 213.3994 302.1802 217.8193 v -317.1797 194.04 309.3799 225.7393 v -321.582 216.9199 322.8203 216.8594 v -307.9395 242.4385 317.54 237.2598 v -311.9004 248.5996 331.7002 235.3398 v -314.1006 252.999 333.3799 242.54 v -342.2617 235.3994 333.8594 246.3799 v -318.0605 264.001 342.2598 244.2197 v -355.0205 226.1602 355.9395 223.0996 v -344.9023 255.2002 340.0996 258.3799 v -349.3018 298.3203 394.5801 281.1797 v -402.1016 262.2393 407.0605 282.3799 v -421.0215 289.5195 433.46 259.0996 v -437.7422 274.1191 436.8203 277.0996 v -444.3418 275.8779 443.54 277.0996 v -457.9805 272.3594 459.3799 273.2598 v -466.7813 265.7598 467.2998 269.6602 v -477.3418 266.6406 475.2197 270.6201 v -484.8223 253.4404 485.2998 249.5 v -487.9395 264.8594 l -490.0996 261.7393 l -491.8613 270.1592 491.0605 271.5801 v -490.1025 272.7988 512.9814 264.001 518.1797 241.0996 c -520.5801 231.9795 l -527.0625 248.1602 525.3799 252.6201 v -531.0225 251.6787 531.3799 246.8594 v -535.8613 272.3594 530.6602 279.0195 v -535.4219 279.8408 536.6602 275.8994 v -536.6602 283.8193 l -544.6621 282.9199 544.5801 285.5 v -549.502 289.959 551.7793 284.7803 v -538.0615 323.4004 558.2598 302.2998 v -566.2207 290.4004 562.3398 311.1797 v -558.3008 331.7598 553.9014 333.5186 559.2207 333.9795 c -560.0625 337.9209 557.7793 339.7393 v -555.6602 341.4385 559.2207 339.7393 y -564.4609 335.2803 558.7402 359.4199 v -565.7813 357.7207 552.5 389.8994 v -555.6602 392.4795 551.2998 401.6602 v -560.0625 396.8789 563.0605 398.54 v -562.7021 400.3994 559.2207 404.7803 v -535.4219 465.0801 557.7793 440.7803 v -570.8965 425.9746 563.7793 451.0996 v -553.834 477.4658 554.6602 482.2998 v -82.1001 456.8594 l -82.1001 456.8594 l -s -0 O -0.164706 0.627451 1 0.031373 k -1 w 4 M -554.6602 482.0596 m -555.3799 481.7715 557.8066 480.5361 559.2197 478.7002 c -566.6621 466.8418 560.9004 487.0996 v -550.8223 518.7607 560.4199 506.54 v -567.1016 498.5215 563.54 513.5 v -559.3301 531.5498 556.5801 538.46 y -569.3027 533.2803 539.7793 576.8594 v -549.6201 572.7793 l -527.9414 616.4404 504.2598 622.2197 v -495.3799 628.7002 l -537.623 670.5605 523.46 711.0195 v -516.0605 716.7607 505.46 706.7002 v -498.4609 701.3594 491.7793 703.0996 v -457.9805 701.8018 455.7793 701.8994 v -453.582 701.8018 415.3018 742.7217 343.2197 723.2598 c -337.4219 721.1602 332.6602 722.54 v -312.3418 740.0811 258.7397 715.0996 v -247.6616 712.8008 246.02 712.7002 v -244.1406 712.8008 241.0615 712.8008 232.3398 705.7393 c -223.46 698.7197 223.0205 697.8418 220.8198 696.1396 c -202.7817 683.7607 197.54 682.9395 v -184.7407 675.8408 180.02 664.9395 v -175.9399 663.5 l -174.1807 655.6016 173.7798 654.3799 v -168.4614 650.3213 167.54 644.0596 v -157.9014 637.5605 158.4199 632.7793 v -156.5815 627.001 155.7798 621.7393 v -147.7808 616.4404 148.5801 613.3398 v -140.2998 597.9609 141.6201 590.54 v -134.5806 590.9209 131.54 588.3799 v -130.6206 583.001 128.8999 582.6201 v -125.7798 581.2393 128.4199 576.8594 v -126.6606 573.7617 126.2598 572.0596 v -127.1001 568.9209 122.1797 562.7002 v -115.2197 542.0811 117.3799 536.2998 v -117.8599 531.0801 114.7397 529.3398 v -110.8208 529.7598 120.02 516.6201 v -120.9414 515.2393 117.3799 512.54 v -98.5015 508.6396 95.7798 490.7002 v -80.8999 474.3193 80.8999 468.6201 v -80.8999 466.0664 81.1973 462.6025 81.8599 457.5801 c -81.3418 448.3594 111.6201 447.5 v -142.0615 446.5996 554.6602 482.0596 y -F -0 R -0 G -1.1 w 10 M -554.6602 482.0596 m -555.3799 481.7715 557.8066 480.5361 559.2197 478.7002 c -566.6621 466.8418 560.9004 487.0996 v -550.8223 518.7607 560.4199 506.54 v -567.1016 498.5215 563.54 513.5 v -559.3301 531.5498 556.5801 538.46 y -569.3027 533.2803 539.7793 576.8594 v -549.6201 572.7793 l -527.9414 616.4404 504.2598 622.2197 v -495.3799 628.7002 l -537.623 670.5605 523.46 711.0195 v -516.0605 716.7607 505.46 706.7002 v -498.4609 701.3594 491.7793 703.0996 v -457.9805 701.8018 455.7793 701.8994 v -453.582 701.8018 415.3018 742.7217 343.2197 723.2598 c -337.4219 721.1602 332.6602 722.54 v -312.3418 740.0811 258.7397 715.0996 v -247.6616 712.8008 246.02 712.7002 v -244.1406 712.8008 241.0615 712.8008 232.3398 705.7393 c -223.46 698.7197 223.0205 697.8418 220.8198 696.1396 c -202.7817 683.7607 197.54 682.9395 v -184.7407 675.8408 180.02 664.9395 v -175.9399 663.5 l -174.1807 655.6016 173.7798 654.3799 v -168.4614 650.3213 167.54 644.0596 v -157.9014 637.5605 158.4199 632.7793 v -156.5815 627.001 155.7798 621.7393 v -147.7808 616.4404 148.5801 613.3398 v -140.2998 597.9609 141.6201 590.54 v -134.5806 590.9209 131.54 588.3799 v -130.6206 583.001 128.8999 582.6201 v -125.7798 581.2393 128.4199 576.8594 v -126.6606 573.7617 126.2598 572.0596 v -127.1001 568.9209 122.1797 562.7002 v -115.2197 542.0811 117.3799 536.2998 v -117.8599 531.0801 114.7397 529.3398 v -110.8208 529.7598 120.02 516.6201 v -120.9414 515.2393 117.3799 512.54 v -98.5015 508.6396 95.7798 490.7002 v -80.8999 474.3193 80.8999 468.6201 v -80.8999 466.0664 81.1973 462.6025 81.8599 457.5801 c -81.3418 448.3594 111.6201 447.5 v -142.0615 446.5996 554.6602 482.0596 y -554.6602 482.0596 l -s -0 O -0.164706 0.627451 1 0.031373 k -1 w 4 M -97.9399 457.3398 m -70.3398 500.7197 86.1802 438.6201 y -95.8613 400.8389 238.3398 442.2197 y -424.1025 475.6396 436.3398 480.1396 v -448.7402 484.4404 553.46 477.5 y -547.2207 495.9795 l -476.0215 546.9199 454.9014 521.4004 439.9395 525.7402 c -424.9805 530.2012 427.6211 519.6416 424.0996 518.7803 c -420.582 517.8799 377.4609 545.1602 370.3398 544.2197 c -363.3828 543.4014 335.5059 569.5273 351.8594 534.6201 c -369.541 497.2012 287.7007 491.4795 269.2998 503.8994 c -250.7407 516.1201 277.2197 483.5 y -297.3799 461.5615 259.46 480.1396 y -221.7007 494.1201 195.3008 465.9609 191.7798 465.0195 c -188.2617 464.2012 182.9814 460.6807 182.1802 467.6602 c -181.2197 474.7617 172.959 493.1309 138.02 464.2998 c -116.1006 445.9395 100.8198 470.0596 y -97.9399 457.3398 l -F -0.054902 0.607843 0.878431 0 k -371.7793 542.2998 m -364.8203 541.4814 336.918 567.5938 353.2998 532.7002 c -371.6406 493.9609 289.1406 489.5596 270.7402 501.9795 c -252.1807 514.2002 278.6602 481.5801 y -298.8198 459.6416 260.8999 478.2197 y -223.1406 492.2002 196.7407 464.04 193.2197 463.0996 c -189.7017 462.2813 184.4214 458.7607 183.6201 465.7393 c -182.6602 472.8418 174.543 491.0283 139.46 462.3799 c -116.1802 443.1992 101.2998 466.7002 y -97.9399 455.6602 l -70.3208 499.46 86.8999 435.2598 y -96.5815 397.4785 239.7798 440.2998 y -425.54 473.7197 437.7793 478.2197 v -450.1807 482.5205 553.9395 475.5801 y -547.9395 494.54 l -476.5801 545.6406 456.3418 519.4805 441.3799 523.8193 c -426.4209 528.2813 429.0605 517.7217 425.54 516.8594 c -422.0215 515.96 378.9004 543.2402 371.7793 542.2998 c -F -0.047059 0.537255 0.772549 0 k -373.2197 540.3799 m -366.2598 539.5615 339.0537 565.9922 354.7402 530.7793 c -372.6416 490.9395 290.5806 487.6396 272.1802 500.0596 c -253.6206 512.2783 280.1001 479.6602 y -300.2598 457.7188 262.3398 476.2998 y -224.5806 490.2793 198.1807 462.1182 194.6602 461.1797 c -191.1392 460.3594 185.8594 456.8379 185.0601 463.8193 c -184.1001 470.9189 176.127 488.9238 140.8999 460.46 c -116.2593 440.458 101.7798 463.3398 y -97.7002 453.9795 l -71.6216 496.8799 87.6201 431.8994 y -97.3018 394.1191 241.2197 438.3799 y -426.9805 471.7998 439.2197 476.2998 v -451.6211 480.5977 554.4199 473.6602 y -548.4199 493.3398 l -477.1406 544.3594 457.7813 517.5605 442.8203 521.8994 c -427.8613 526.3613 430.501 515.8018 426.9805 514.9395 c -423.4609 514.04 380.3408 541.3203 373.2197 540.3799 c -F -0.039216 0.462745 0.67451 0 k -374.6602 538.46 m -367.7002 537.6416 340.498 564.0752 356.1797 528.8594 c -374.7422 487.5293 291.4326 486.1113 273.6201 498.1396 c -255.0605 510.3604 281.54 477.7393 y -301.7002 455.8018 263.7798 474.3799 y -226.0205 488.3594 199.6206 460.2002 196.1001 459.2598 c -192.5815 458.4414 187.3018 454.9209 186.5 461.8994 c -185.54 469.001 177.7134 486.8164 142.3398 458.54 c -116.3408 437.7197 102.2598 460.2197 y -97.7002 452.2998 l -73.7983 492.7617 88.3398 428.54 y -98.0215 390.7588 242.6602 436.46 y -428.4199 469.8799 440.6602 474.3799 v -453.0625 478.6807 554.9004 471.9795 y -548.9004 492.1396 l -477.7012 543.0801 459.2217 515.6406 444.2598 519.9795 c -429.3008 524.4414 431.9414 513.8818 428.4199 513.0195 c -424.9014 512.1201 381.7813 539.4004 374.6602 538.46 c -F -0.035294 0.396078 0.572549 0 k -376.0996 536.54 m -369.1406 535.7188 342.4951 562.3994 357.6201 526.9395 c -376.1816 483.7998 293.4609 483.7998 275.0601 496.2197 c -256.501 508.4385 282.98 475.8193 y -303.1401 453.8789 265.2197 472.46 y -227.4609 486.4395 201.0605 458.2783 197.54 457.3398 c -194.0215 456.5186 188.7417 452.998 187.9399 459.9795 c -186.98 467.0791 179.2974 484.7139 143.7798 456.6201 c -116.4199 434.9785 102.5 456.8594 y -97.7002 450.6201 l -75.98 488.8613 89.0601 425.1797 y -98.7393 387.3994 244.1001 434.54 y -429.8623 467.96 442.0996 472.46 v -454.5039 476.7578 555.3799 470.0596 y -549.6201 490.7002 l -478.2637 541.8008 460.6621 513.7178 445.7002 518.0596 c -430.7432 522.5186 433.3828 511.959 429.8594 511.0996 c -426.3418 510.2002 383.2227 537.4785 376.0996 536.54 c -F -0.031373 0.333333 0.470588 0 k -377.54 534.6201 m -370.582 533.8018 342.0225 559.5967 359.0605 525.0195 c -380.2617 482.3213 294.9009 481.8799 276.5 494.2998 c -257.9409 506.5205 284.4199 473.8994 y -304.5801 451.959 266.6602 470.54 y -228.9009 484.5195 202.501 456.3604 198.98 455.4199 c -195.4614 454.6016 190.1816 451.0801 189.3799 458.0596 c -188.4199 465.1592 180.8818 482.6094 145.2197 454.7002 c -116.5015 432.2383 102.98 453.5 y -97.7002 448.9395 l -77.9409 485.4004 89.7798 421.8193 y -99.4614 384.0391 245.54 432.6201 y -431.3027 466.04 443.54 470.54 v -455.9434 474.8408 555.8594 468.1396 y -550.0996 489.5 l -478.8223 540.5186 462.1016 511.8008 447.1406 516.1396 c -432.1836 520.6016 434.8232 510.0391 431.2998 509.1797 c -427.7813 508.2793 384.6631 535.5605 377.54 534.6201 c -F -0.027451 0.278431 0.372549 0 k -378.9805 532.7002 m -372.0195 531.8818 343.0449 557.4678 360.5 523.0996 c -383.0215 479.0791 296.3408 479.96 277.9399 492.3799 c -259.3809 504.5977 285.8599 471.9795 y -306.02 450.0391 268.1001 468.6201 y -230.3408 482.5996 203.9409 454.4385 200.4199 453.5 c -196.9014 452.6787 191.6216 449.1582 190.8198 456.1396 c -189.8599 463.2393 182.4658 480.5049 146.6602 452.7793 c -116.5806 429.5 103.46 450.1396 y -97.7002 447.2598 l -80.1201 480.3994 90.5 418.46 y -100.1792 380.6787 246.98 430.7002 y -432.7422 464.1201 444.9805 468.6201 v -457.3828 472.918 556.3398 466.46 y -550.5801 488.2998 l -479.3818 539.2393 463.541 509.8779 448.5801 514.2197 c -433.623 518.6816 436.2637 508.1191 432.7402 507.2598 c -429.2217 506.3594 386.1035 533.6406 378.9805 532.7002 c -F -0.019608 0.215686 0.286275 0 k -380.4199 530.7793 m -373.4629 529.959 343.2754 554.9023 361.9395 521.1797 c -386.2227 477.6006 297.7808 478.04 279.3799 490.46 c -260.8208 502.6807 287.2998 470.0596 y -307.46 448.1191 269.54 466.7002 y -231.7808 480.6797 205.3809 452.5205 201.8599 451.5801 c -198.3418 450.7588 193.0615 447.2402 192.2598 454.2197 c -191.2998 461.3193 184.0498 478.3994 148.1001 450.8594 c -116.6602 426.7588 103.9399 446.7793 y -97.7002 445.5801 l -81.8599 476.7197 91.2197 415.0996 y -100.9014 377.3193 248.4199 428.7793 y -434.1826 462.2002 446.4199 466.7002 v -458.8232 471.001 556.8203 464.54 y -551.2998 486.8594 l -479.9434 537.9609 464.9814 507.9609 450.0195 512.2998 c -435.0625 516.7588 437.7031 506.1992 434.1797 505.3398 c -430.6621 504.4395 387.543 531.7207 380.4199 530.7793 c -F -0.015686 0.156863 0.203922 0 k -381.8594 528.8594 m -374.9023 528.0391 344.7148 552.9824 363.3799 519.2598 c -387.6631 475.6777 299.2231 476.1201 280.8198 488.54 c -262.2607 500.7578 288.7402 468.1396 y -308.9023 446.1992 270.98 464.7793 y -233.2207 478.7598 206.8208 450.5977 203.2998 449.6602 c -199.7817 448.8389 194.5015 445.3184 193.7002 452.2998 c -192.7402 459.3994 185.6357 476.2949 149.54 448.9395 c -116.7417 424.0186 104.1802 443.4199 y -97.7002 443.6602 l -82.7192 472.8193 91.9399 411.7393 y -101.6216 373.959 249.8599 426.8594 y -435.623 460.2793 447.8594 464.7793 v -460.2637 469.0781 557.2998 462.6201 y -551.7793 485.6602 l -480.502 536.6787 466.4219 506.0381 451.46 510.3799 c -436.501 514.8389 439.1426 504.2793 435.6201 503.4199 c -432.1016 502.5195 388.9834 529.7979 381.8594 528.8594 c -F -0.011765 0.098039 0.12549 0 k -383.2998 526.9395 m -376.3418 526.1191 346.582 551.2949 364.8203 517.3398 c -389.1006 472.4404 300.6606 474.2002 282.2598 486.6201 c -263.7007 498.8408 290.1802 466.2197 y -310.3418 444.2793 272.4199 462.8594 y -234.6606 476.8398 208.2607 448.6807 204.7402 447.7393 c -201.2217 446.9189 195.9414 443.4004 195.1401 450.3799 c -194.1802 457.4785 187.2197 474.1904 150.98 447.0195 c -116.8208 421.2793 104.6602 440.0596 y -97.7002 441.9795 l -83.3599 468.4805 92.6602 408.3799 y -102.3418 370.5986 251.2998 424.9395 y -437.0625 458.3594 449.2998 462.8594 v -461.7012 467.1602 557.7793 460.9395 y -552.2598 484.46 l -481.0615 535.3994 467.8613 504.1201 452.9004 508.46 c -437.9414 512.9189 440.5801 502.3594 437.0605 501.5 c -433.541 500.5996 390.4209 527.8809 383.2998 526.9395 c -F -0 0.039216 0.05098 0 k -384.7402 525.0195 m -377.7822 524.2012 349.208 549.9893 366.2598 515.4199 c -389.6621 468.3193 302.1006 472.2793 283.7002 484.7002 c -265.1406 496.918 291.6201 464.2998 y -311.7822 442.3594 273.8599 460.9395 y -236.1006 474.9199 209.7007 446.7578 206.1802 445.8193 c -202.6616 444.999 197.3818 441.4785 196.5801 448.46 c -195.6226 455.5586 188.8042 472.085 152.4199 445.0996 c -116.8999 418.5391 105.1401 436.7002 y -97.7002 440.2998 l -83.5591 465.8984 93.3799 405.0195 y -103.0615 367.2393 252.7402 423.0195 y -438.502 456.4395 450.7402 460.9395 v -463.1426 465.2383 558.2598 459.0195 y -552.9805 483.0195 l -481.6211 534.1201 469.3018 502.1982 454.3398 506.54 c -439.3828 511.001 442.0234 500.4385 438.5 499.5801 c -434.9814 498.6797 391.8613 525.9609 384.7402 525.0195 c -F -1 g -97.7002 438.6201 m -83.54 462.8818 94.1001 401.6602 y -103.7817 363.8789 254.1802 421.0996 y -439.9424 454.5195 452.1797 459.0195 v -464.5801 463.3203 558.7402 457.0996 y -553.46 481.8193 l -482.1826 532.8418 470.7422 500.2803 455.7793 504.6201 c -440.8203 509.0811 443.4609 498.5215 439.9395 497.6602 c -436.4219 496.7598 393.3008 524.041 386.1797 523.0996 c -379.2227 522.2813 351.4785 548.4678 367.7002 513.5 c -392.2305 461.002 300.9463 472.0898 285.1401 482.7803 c -266.5806 495.001 293.0601 462.3799 y -313.2197 440.4395 275.2998 459.0195 y -237.541 473 211.1406 444.8408 207.6201 443.8994 c -204.1016 443.0791 198.8218 439.5586 198.02 446.54 c -197.0601 453.6416 190.3877 469.9834 153.8599 443.1797 c -116.9814 415.8008 105.6201 433.3398 y -97.7002 438.6201 l -F -0 g -143.2998 405.7402 m -135.4614 392.9189 158.4199 378.3799 v -159.8818 376.8584 140.1802 381.5 v -133.2607 383.6787 131.54 395.1797 v -126.2217 399.958 120.98 406.2197 v -115.6616 412.2803 143.2998 405.7402 y -F -0.8 g -297.3799 458.0596 m -316.8486 428.5371 316.0996 423.2598 v -314.7607 411.8408 314.54 401.2803 318.0195 396.8594 c -321.582 392.4795 331.2197 356.0596 y -330.8223 354.6387 344.4199 396.3799 v -357.2217 414.0391 335.2998 434.2998 v -296.5015 465.9609 297.3799 458.0596 v -F -0 g -165.3799 376.2197 m -177.7017 368.2803 161.7798 333.9795 v -168.98 336.6201 l -168.02 324.2793 164.4199 321.7393 v -172.3398 325.0996 l -177.7017 316.3594 173.2998 311.1797 v -191.7798 302.2803 190.8198 295.3398 v -197.9409 304.04 193.46 311.1797 v -189.1401 318.1201 181.2197 313.7188 182.1802 333.9795 c -172.3398 330.3799 l -178.5801 340.1191 178.5801 347.1797 v -169.7002 344.54 l -186.7949 373.7549 174.98 375.2598 v -168.4614 376.2002 165.3799 376.2197 y -F -0.8 g -201.1401 357.7393 m -204.1016 362.5586 201.1401 361.5801 v -197.9409 360.7998 163.6206 344.5205 156.98 333.9795 c -194.8613 360.7998 201.1401 357.7393 v -F -212.4199 348.8594 m -215.54 353.7578 212.4199 352.9395 v -209.3818 351.999 175.0615 335.7197 168.5 325.0996 c -206.2998 351.999 212.4199 348.8594 v -F -227.0601 365.6602 m -230.0601 370.4795 227.0601 369.5 v -223.9014 368.7197 189.5815 352.4404 182.8999 341.8994 c -220.8198 368.7197 227.0601 365.6602 v -F -201.3799 317.6602 m -201.4614 324.2793 198.5 323.4199 v -195.3008 322.5195 155.7007 303.1592 149.0601 292.7002 c -195.3008 320.7578 201.3799 317.6602 v -F -202.8198 329.6602 m -204.1016 334.8389 201.1401 333.9795 v -198.8218 333.958 169.7817 321.2002 163.2197 310.7002 c -195.7402 334.3994 202.8198 329.6602 v -F -186.98 277.0996 m -175.9399 268.9395 l -187.3809 277.2002 191.2998 275.8994 v -183.8599 263.5586 182.8999 257.8994 v -194.4199 271.9209 200.6602 271.5801 v -208.9399 271.04 209.0601 259.0996 v -215.1006 270.6006 218.6602 270.1396 v -219.9414 263.1201 218.6602 255.7393 v -223.0205 264.001 227.54 262.2197 v -234.4614 264.4395 233.54 251.6602 v -233.5806 240.2402 232.8198 237.2598 v -238.8608 266.1992 241.46 266.54 v -250.3018 267.958 255.6201 258.3799 v -251.1802 266.6406 256.5801 264.3799 v -268.3398 262.6777 271.9399 255.2598 v -264.3799 268.3994 270.5 264.8594 v -278.0215 264.8789 279.3799 257.8994 v -288.5815 234.5186 290.8999 232.7002 v -282.4209 256.5195 284.1802 256.46 v -281.9814 269.7197 287.7798 253.3398 v -284.1802 268.8389 290.4199 267.9795 v -296.5015 267.0801 301.3398 256.0781 310.5801 258.6201 c -321.1426 252.5596 323.2998 328.7002 v -186.98 277.0996 l -F -0 g -192.2598 379.3398 m -208.501 385.8799 252.5 379.3398 v -260.4199 378.8408 267.8599 388.46 v -275.3818 398.1992 304.8608 406.1191 312.0195 403.8193 c -322.5801 396.8594 l -323.2998 395.6602 l -336.9824 384.1201 337.46 375.7393 v -337.8613 367.3994 321.582 314.5996 311.0605 297.0195 c -300.4614 279.3994 289.9014 265.7598 268.8198 268.46 c -245.8999 272.7988 217.7002 268.46 v -185.6216 270.1592 182.6602 279.0195 v -179.4609 287.7578 194.8999 304.46 y -199.7002 313.7188 198.5 329.6602 v -197.0601 345.3994 197.5015 376.2002 192.2598 379.3398 c -F -0.047059 0.745098 0.211765 0 k -216.5 377.1797 m -225.6606 356.8398 193.2197 285.0195 y -190.9014 283.3594 207.0273 276.7109 218.1802 279.5 c -230.2207 282.3008 274.5801 277.5801 y -300.4614 294.7998 314.6602 343.5801 y -325.9805 370.04 306.7402 373.5801 v -287.2617 377.0791 216.5 377.1797 y -F -0.247059 0.933333 0.509804 0.070588 k -214.1001 343.0996 m -217.8438 357.1641 219.5864 370.1426 216.5 377.1797 c -285.0605 370.04 297.3799 393.0195 v -302.0454 401.583 318.2813 367.8389 317.7793 357.2598 c -248.54 341.4385 232.3398 353.6602 v -214.1001 343.0996 l -F -0.266667 0.972549 0.580392 0.137255 k -219.1401 325.0996 m -221.2617 317.2393 218.6602 312.8594 v -216.8599 311.96 215.54 311.4199 v -216.8599 307.5586 223.46 305.8994 v -225.6606 300.958 228.2598 300.6201 v -230.9409 300.0801 236.2207 293.9189 240.7402 295.3398 c -245.0215 296.5586 257.2998 300.8594 y -263.5015 304.4795 273.1401 300.6201 v -275.792 301.4023 276.2598 305.8994 v -276.8096 310.9707 280.2197 315.0391 282.5 317.1797 c -284.6216 319.4404 295.1816 333.5186 293.7798 333.9795 c -292.5415 334.3994 219.1401 325.0996 y -F -0 0.698039 0.356863 0 k -214.3398 378.3799 m -211.1406 353.7578 214.5801 344.54 v -218.1802 335.2803 217.3018 333.0801 216.5 328.7002 c -215.54 324.2793 220.3809 313.2803 226.5801 306.6201 c -239.7798 304.9395 l -256.46 308.8809 266.6602 305.8994 v -276.4736 304.3232 280.3398 320.7803 v -285.5 327.7998 293.54 330.8594 v -301.3398 333.958 309.2598 379.7188 304.8198 388.46 c -300.4614 397.3203 284.6216 402.1592 267.1401 385.0996 c -249.4209 367.8389 247.2197 386.3193 214.3398 378.3799 c -F -0 R -0 G -1.1 w 10 M -214.3398 378.3799 m -211.1406 353.7578 214.5801 344.54 v -218.1802 335.2803 217.3018 333.0801 216.5 328.7002 c -215.54 324.2793 220.3809 313.2803 226.5801 306.6201 c -239.7798 304.9395 l -256.46 308.8809 266.6602 305.8994 v -276.4736 304.3232 280.3398 320.7803 v -285.5 327.7998 293.54 330.8594 v -301.3398 333.958 309.2598 379.7188 304.8198 388.46 c -300.4614 397.3203 284.6216 402.1592 267.1401 385.0996 c -249.4209 367.8389 247.2197 386.3193 214.3398 378.3799 c -214.3398 378.3799 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -216.02 296.0596 m -215.1006 298.3203 210.2598 298.7002 v -185.6216 302.7197 176.4199 316.46 v -168.9009 322.5195 173.7798 309.7393 v -185.1802 287.3193 192.7402 284.2998 v -210.7017 279.8408 216.02 296.0596 v -F -0 R -0 G -0.550001 w 10 M -216.02 296.0596 m -215.1006 298.3203 210.2598 298.7002 v -185.6216 302.7197 176.4199 316.46 v -168.9009 322.5195 173.7798 309.7393 v -185.1802 287.3193 192.7402 284.2998 v -210.7017 279.8408 216.02 296.0596 v -216.02 296.0596 l -s -0 O -0.145098 0.898039 0.682353 0.027451 k -1 w 4 M -303.8599 366.3799 m -304.6426 375.1855 306.7905 384.6602 304.8198 388.46 c -297.771 402.7041 279.0991 396.7754 267.1401 385.0996 c -249.4209 367.8389 247.2197 386.3193 214.3398 378.3799 c -212.2998 363.041 213.1401 351.9795 v -254.2617 364.7598 255.1401 358.7002 v -256.9014 362.1201 267.1401 362.0596 v -277.1406 362.1201 302.1558 363.4082 303.8599 366.3799 c -F -0 R -0.231373 1 0.941176 0.172549 K -2.2 w 10 M -256.5801 377.4199 m -261.7402 372.2402 257.7798 361.5801 v -241.9399 344.0791 244.1001 328.7002 v -S -0 O -0.011765 0 0.239216 0 k -1 w 4 M -203.7798 284.2998 m -198.8218 298.3203 208.5801 290.7803 v -213.7808 288.6387 212.4199 286.9395 v -211.1406 285.1201 204.98 280.7188 203.7798 284.2998 c -F -0 R -0 G -0.550001 w 10 M -203.7798 284.2998 m -198.8218 298.3203 208.5801 290.7803 v -213.7808 288.6387 212.4199 286.9395 v -211.1406 285.1201 204.98 280.7188 203.7798 284.2998 c -203.7798 284.2998 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -209.2998 282.8594 m -205.333 294.1826 213.1401 288.1396 v -217.9399 285.5068 216.2598 285.0195 v -211.2295 283.623 216.2432 280.8076 209.2998 282.8594 c -F -0 R -0 G -0.550001 w 10 M -209.2998 282.8594 m -205.333 294.1826 213.1401 288.1396 v -217.9399 285.5068 216.2598 285.0195 v -211.2295 283.623 216.2432 280.8076 209.2998 282.8594 c -209.2998 282.8594 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -214.5801 282.8594 m -210.6128 294.1826 218.4199 288.1396 v -223.1694 285.6582 221.54 285.0195 v -217.8296 283.623 221.5229 280.8076 214.5801 282.8594 c -F -0 R -0 G -0.550001 w 10 M -214.5801 282.8594 m -210.6128 294.1826 218.4199 288.1396 v -223.1694 285.6582 221.54 285.0195 v -217.8296 283.623 221.5229 280.8076 214.5801 282.8594 c -214.5801 282.8594 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -221.7798 282.6201 m -217.8726 293.9648 225.6201 287.8994 v -230.4365 285.4131 228.7402 284.7803 v -225.5288 283.623 228.7856 280.5869 221.7798 282.6201 c -F -0 R -0 G -0.550001 w 10 M -221.7798 282.6201 m -217.8726 293.9648 225.6201 287.8994 v -230.4365 285.4131 228.7402 284.7803 v -225.5288 283.623 228.7856 280.5869 221.7798 282.6201 c -221.7798 282.6201 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -228.98 282.8594 m -225.001 294.0508 232.8198 288.1396 v -236.9697 286.3086 235.9399 284.7803 v -234.8574 283.4912 235.9136 280.6758 228.98 282.8594 c -F -0 R -0 G -0.550001 w 10 M -228.98 282.8594 m -225.001 294.0508 232.8198 288.1396 v -236.9697 286.3086 235.9399 284.7803 v -234.8574 283.4912 235.9136 280.6758 228.98 282.8594 c -228.98 282.8594 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -236.1802 282.1396 m -230.9409 295.6807 240.98 288.6201 v -246.3418 286.4404 245.0601 284.7803 v -243.7017 282.9199 245.0215 279.3994 236.1802 282.1396 c -F -0 R -0 G -0.550001 w 10 M -236.1802 282.1396 m -230.9409 295.6807 240.98 288.6201 v -246.3418 286.4404 245.0601 284.7803 v -243.7017 282.9199 245.0215 279.3994 236.1802 282.1396 c -236.1802 282.1396 l -s -*u -0.266667 0.972549 0.580392 0.137255 K -2.2 w -204.98 300.8594 m -219.5 304.04 226.1001 300.6201 v -232.7002 299.1992 234.02 299.6602 v -235.3398 300.0801 238.8198 300.6201 y -S -1 D -242.4199 291.2598 m -255.5815 306.2402 268.8198 301.3398 v -276.4976 298.5703 275.3818 302.2803 276.2598 305.4199 c -277.1406 308.4385 277.3613 313.0586 282.98 316.46 c -S -*U -0 D -0 O -0.011765 0 0.239216 0 k -1 w 4 M -261.3799 308.7803 m -256.9014 320.7578 253.9399 306.6201 v -250.7407 292.5986 247.2197 288.6387 245.54 285.5 c -245.4609 279.8408 254.6602 280.2197 v -266.5806 280.7188 267.1401 283.8193 v -267.4614 286.8799 265.7002 299.6406 261.3799 308.7803 c -F -0 R -0 G -0.550001 w 10 M -261.3799 308.7803 m -256.9014 320.7578 253.9399 306.6201 v -250.7407 292.5986 247.2197 288.6387 245.54 285.5 c -245.4609 279.8408 254.6602 280.2197 v -266.5806 280.7188 267.1401 283.8193 v -267.4614 286.8799 265.7002 299.6406 261.3799 308.7803 c -261.3799 308.7803 l -s -*u -0.266667 0.972549 0.580392 0.137255 K -2.2 w -276.7402 300.8594 m -280.6616 303.6006 283.2197 302.2998 v -S -283.9399 319.0996 m -287.041 324.3896 292.3398 325.3398 v -S -*U -0 O -0.701961 g -1 w 4 M -196.5801 278.54 m -216.4209 275 221.2998 276.8594 v -230.9409 276.7588 221.7798 274.46 v -207.6201 274.5586 198.7402 275.8994 v -186.0605 282.0391 196.5801 278.54 v -F -0.011765 0 0.239216 0 k -211.9399 381.0195 m -231.3799 381.0391 233.54 380.0596 v -241.501 346.2803 237.6201 337.8193 v -236.2207 334.8389 233.0601 340.9395 v -212.8999 377.0791 209.2998 379.3398 v -205.8608 381.4805 210.7017 381.0391 211.9399 381.0195 c -F -0 R -0 G -0.550001 w 10 M -211.9399 381.0195 m -231.3799 381.0391 233.54 380.0596 v -241.501 346.2803 237.6201 337.8193 v -236.2207 334.8389 233.0601 340.9395 v -212.8999 377.0791 209.2998 379.3398 v -205.8608 381.4805 210.7017 381.0391 211.9399 381.0195 c -211.9399 381.0195 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -127.2197 383.8994 m -137 382.1406 150.98 379.3398 v -156.1401 354.6387 159.6201 349.3398 v -163.1816 344.0791 159.2217 344.0791 155.2998 347.1797 c -151.3018 350.2393 135.02 365.6406 132.7402 370.46 c -130.6206 375.3193 127.2197 383.8994 y -F -0 R -0 G -0.550001 w 10 M -127.2197 383.8994 m -137 382.1406 150.98 379.3398 v -156.1401 354.6387 159.6201 349.3398 v -163.1816 344.0791 159.2217 344.0791 155.2998 347.1797 c -151.3018 350.2393 135.02 365.6406 132.7402 370.46 c -130.6206 375.3193 127.2197 383.8994 y -127.2197 383.8994 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -151.2197 379.0996 m -157.6377 377.3379 158.6602 375.0195 v -159.855 372.4658 157.46 368.7803 y -156.3247 365.2041 155.0601 367.5801 v -153.6802 369.9629 150.5215 378.3867 151.2197 379.0996 c -F -0 R -0 G -0.550001 w 10 M -151.2197 379.0996 m -157.6377 377.3379 158.6602 375.0195 v -159.855 372.4658 157.46 368.7803 y -156.3247 365.2041 155.0601 367.5801 v -153.6802 369.9629 150.5215 378.3867 151.2197 379.0996 c -151.2197 379.0996 l -s -0 O -0 g -1 w 4 M -151.2197 379.3398 m -155.2617 373.5586 159.1401 373.5801 v -163.1816 373.5586 163.6016 374.0146 166.8198 373.3398 c -171.7617 372.2402 171.3198 374.4385 178.5801 373.0996 c -181.4839 372.5908 184.3018 373.5586 187.46 372.1396 c -190.46 370.9209 193.981 371.7988 195.3799 374.0596 c -196.6206 376.2002 201.8599 380.7803 y -187.8198 378.8408 184.8198 377.8994 v -160.1001 376.6396 151.2197 379.3398 v -F -0.011765 0 0.239216 0 k -200.4199 379.0996 m -193.2656 375.209 192.7402 372.6201 v -192.3848 369.9297 198.5 365.8994 y -201.625 360.7998 202.3398 363.5 v -202.9448 366.0801 201.2407 378.6201 200.4199 379.0996 c -F -0 R -0 G -0.550001 w 10 M -200.4199 379.0996 m -193.2656 375.209 192.7402 372.6201 v -192.3848 369.9297 198.5 365.8994 y -201.625 360.7998 202.3398 363.5 v -202.9448 366.0801 201.2407 378.6201 200.4199 379.0996 c -200.4199 379.0996 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -159.1401 373.0996 m -166.8345 360.7422 167.0601 373.0996 v -167.6865 374.458 165.8599 374.54 v -159.0679 374.5664 160.7407 379.0781 159.1401 373.0996 c -F -0 R -0 G -0.550001 w 10 M -159.1401 373.0996 m -166.8345 360.7422 167.0601 373.0996 v -167.6865 374.458 165.8599 374.54 v -159.0679 374.5664 160.7407 379.0781 159.1401 373.0996 c -159.1401 373.0996 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -167.0601 372.8594 m -175.7358 360.4707 174.98 372.8594 v -175.0449 373.2441 173.0601 373.3398 v -167.8926 373.8682 168.272 378.8359 167.0601 372.8594 c -F -0 R -0 G -0.550001 w 10 M -167.0601 372.8594 m -175.7358 360.4707 174.98 372.8594 v -175.0449 373.2441 173.0601 373.3398 v -167.8926 373.8682 168.272 378.8359 167.0601 372.8594 c -167.0601 372.8594 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -174.98 372.8594 m -183.7134 361.0762 182.8999 371.6602 v -183.1089 373.0664 181.2197 373.3398 v -177.0078 374.1729 176.7754 377.7461 174.98 372.8594 c -F -0 R -0 G -0.550001 w 10 M -174.98 372.8594 m -183.7134 361.0762 182.8999 371.6602 v -183.1089 373.0664 181.2197 373.3398 v -177.0078 374.1729 176.7754 377.7461 174.98 372.8594 c -174.98 372.8594 l -s -0 O -0.011765 0 0.239216 0 k -1 w 4 M -182.4199 372.6201 m -191.2109 359.9619 191.54 370.7002 v -193.4023 372.2354 191.54 372.3799 v -185.0815 373.2939 185.96 378.1953 182.4199 372.6201 c -F -0 R -0 G -0.550001 w 10 M -182.4199 372.6201 m -191.2109 359.9619 191.54 370.7002 v -193.4023 372.2354 191.54 372.3799 v -185.0815 373.2939 185.96 378.1953 182.4199 372.6201 c -182.4199 372.6201 l -s -0 O -0.105882 0.031373 0.356863 0 k -1 w 4 M -142.8198 368.7803 m -134.4199 370.46 l -131.4463 375.9795 129.1401 382.7002 y -136.1216 381.6465 149.7798 378.6201 v -150.8335 374.9141 152.4199 368.54 v -142.8198 368.7803 l -F -214.3398 373.8193 m -212.4702 376.6807 211.0229 378.6152 210.2598 379.0996 c -206.9937 381.1328 211.5513 380.7178 212.8999 380.7803 c -231.02 380.7178 233.0601 379.8193 v -233.6694 377.4219 234.5 373.5801 v -223.3232 375.9033 214.3398 373.8193 v -F -0.164706 0.627451 1 0.031373 k -273.3799 525.9795 m -303.7617 521.5303 331.832 560.7363 333.8594 571.3398 c -335.7051 582.0322 324.5 595.0996 y -326.0264 598.4883 320.7012 613.9756 314.9004 624.1396 c -309.085 634.3057 291.5938 633.2334 272.4199 634.2197 c -254.876 635.2734 234.5479 609.6201 233.0601 607.5801 c -231.644 605.749 238.4214 563.6406 239.7798 557.4199 c -241.3232 551.0547 238.3398 521.8994 y -276.085 532.0254 242.7754 530.2441 273.3799 525.9795 c -F -0.047059 0.517647 0.756863 0 k -233.7798 606.8594 m -232.4722 605.0713 239.125 563.7266 240.5 557.6602 c -241.9761 551.3721 239.0601 522.8594 y -275.0649 532.6279 243.4014 530.9385 273.3799 526.7002 c -303.2769 522.3848 330.8379 560.876 332.6602 571.3398 c -334.6406 581.7871 323.7793 594.6201 y -325.1357 597.9434 319.9082 613.1504 314.1797 623.1797 c -308.5039 633.1084 291.332 632.0547 272.4199 633.0195 c -255.2817 634.0586 235.3232 608.873 233.7798 606.8594 c -F -0.035294 0.372549 0.533333 0 k -234.7402 606.1396 m -233.2998 604.3926 239.8281 563.8154 241.2197 557.6602 c -242.6265 551.6885 239.7798 523.8193 y -274.3735 533.7822 244.0254 531.6338 273.3799 527.4199 c -302.792 523.2393 329.8447 561.0176 331.7002 571.3398 c -333.5762 581.54 322.8203 594.1396 y -324.248 597.3965 319.1172 612.3223 313.46 622.2197 c -307.9238 631.9111 291.0703 630.8789 272.4199 631.8193 c -255.6846 632.8447 236.0981 608.124 234.7402 606.1396 c -F -0.023529 0.239216 0.32549 0 k -235.46 605.6602 m -234.1255 603.7158 240.5313 563.9043 241.9399 557.8994 c -243.2769 552.0049 240.5 524.54 y -272.9121 534.4951 244.6494 532.3301 273.3799 528.1396 c -302.3096 524.0938 328.8516 561.1563 330.7402 571.3398 c -332.5117 581.293 322.0996 593.6602 y -323.3594 596.8516 318.3242 611.4941 312.7402 621.0195 c -307.3418 630.7129 290.8066 629.7002 272.6602 630.6201 c -256.0903 631.6299 236.8711 607.376 235.46 605.6602 c -F -0.011765 0.109804 0.137255 0 k -236.1802 604.9395 m -234.9536 603.0391 241.2368 563.9912 242.6602 558.1396 c -243.9297 552.3223 241.2197 525.5 y -271.8921 535.208 245.2759 533.0234 273.6201 529.0996 c -301.8247 524.9453 327.8555 561.2979 329.54 571.0996 c -331.4453 581.0479 321.1406 593.1797 y -322.4697 596.3066 317.5332 610.6689 312.2598 620.0596 c -306.7617 629.5186 290.5449 628.5244 272.6602 629.4199 c -256.4961 630.416 237.6465 606.6289 236.1802 604.9395 c -F -1 g -273.6201 529.8193 m -301.3398 525.7998 326.8613 561.4395 328.5801 571.0996 c -330.3828 580.8008 320.1797 592.7002 y -321.582 595.7598 316.7402 609.8408 311.54 619.0996 c -306.1807 628.3203 290.2808 627.3457 272.6602 628.2197 c -256.9014 629.2012 238.4214 605.8809 237.1401 604.2197 c -235.7817 602.3594 241.9399 564.0801 243.3799 558.3799 c -244.5801 552.6416 241.9399 526.2197 y -269.9912 535.7002 245.8999 533.7197 273.6201 529.8193 c -F -0.8 g -324.7402 567.2598 m -294.0801 558.7998 281.2998 560.54 v -263.9409 567.8213 254.1802 543.7393 v -250.3018 535.9209 248.1802 533.6602 v -245.8999 531.5215 324.7402 567.2598 y -F -0 g -328.8203 569.6602 m -296.9409 556.1602 285.8599 556.7002 v -267.9009 561.6602 258.7402 545.6602 v -249.4209 535.4814 246.02 533.6602 v -245.4609 531.9609 252.5 536.2998 v -264.02 530.54 l -280.2197 520.0801 290.8999 537.7393 v -295.1816 550.001 295.2197 552.1396 v -295.1816 554.4004 318.5 560.5615 320.1797 561.0195 c -322.0205 561.4395 329.2813 566.0596 328.8203 569.6602 c -F -0.45098 0 1 0 k -276.7402 530.0596 m -269.1416 530.0762 259.9302 534.3271 259.9399 541.0996 c -259.9302 548.0742 269.1416 554.9648 276.7402 555.0195 c -284.2617 554.9648 290.3911 549.3945 290.4199 542.54 c -290.3911 535.6465 284.2617 530.0762 276.7402 530.0596 c -F -0.658824 0.2 1 0.039216 k -272.6602 548.54 m -267.3848 547.6328 261.7881 545.9814 261.8599 546.1396 c -263.5591 551.2998 270.5576 554.9648 276.7402 555.0195 c -281.4248 554.9648 285.5938 552.79 288.02 549.5 c -282.2046 549.8408 272.6602 548.54 v -F -1 g -285.8599 548.7793 m -281.1006 552.2002 281.0601 549.7393 v -285.0605 544.9395 285.8599 548.7793 v -F -0 g -275.0601 539.6602 m -272.1919 539.7412 269.9624 541.9707 270.02 544.7002 c -269.9624 547.4697 272.1919 549.6992 275.0601 549.7393 c -277.6904 549.6992 279.9199 547.4697 279.8599 544.7002 c -279.9199 541.9707 277.6904 539.7412 275.0601 539.6602 c -F -0.164706 0.627451 1 0.031373 k -160.5801 554.2998 m -157.0205 577.7217 159.6201 582.6201 v -171.541 593.5615 171.1401 597.5 v -170.6602 617.3213 169.46 618.1396 v -168.02 619.0801 159.6606 625.6807 153.1401 618.6201 c -141.6201 598.8418 142.5801 591.7393 v -142.5801 589.5801 l -134.1416 590.04 132.5 587.8994 v -131.0601 582.1201 129.8599 581.6602 v -126.6606 579.041 128.8999 575.8994 v -126.6606 573.3193 127.2197 568.9395 v -135.3799 564.6201 l -137.6602 548.6816 149.54 543.0195 v -154.8608 540.3994 158.3408 547.8008 160.5801 554.2998 c -F -1 g -159.3799 556.46 m -156.272 577.4121 158.6602 581.6602 v -169.3398 591.668 168.98 595.3398 v -168.5479 613.0518 167.2998 613.8193 v -166.1719 614.6357 158.6479 620.5752 152.6602 614.2998 c -142.4121 596.4199 143.2998 590.0596 v -143.2998 588.1396 l -135.6802 588.5 134.1802 586.46 v -132.9082 581.3721 131.7798 580.9395 v -128.9478 578.5996 130.8198 575.8994 v -128.9478 573.4521 129.3799 569.4199 v -136.8198 565.5801 l -138.8481 551.2754 149.54 546.1396 v -154.3281 543.8232 157.46 550.4863 159.3799 556.46 c -F -0.043137 0.478431 0.701961 0 k -168.7402 617.1797 m -167.6455 618.0576 159.4063 624.4063 152.8999 617.6602 c -141.8193 598.2363 142.5801 591.2598 v -142.5801 589.3398 l -134.5254 589.6563 132.7402 587.4199 v -131.5229 581.9336 130.3398 581.4199 v -127.2319 578.9307 129.3799 575.8994 v -127.2319 573.3535 127.7002 569.1797 v -135.8599 564.8594 l -137.9575 549.3291 149.54 543.7393 v -154.7266 541.2559 158.1201 548.4697 160.3398 555.0195 c -156.8335 577.6445 159.3799 582.3799 v -170.9912 593.0889 170.6602 597.0195 v -170.1318 616.2529 168.7402 617.1797 v -F -0.027451 0.305882 0.423529 0 k -168.2598 615.9795 m -167.271 617.0332 159.1543 623.1289 152.8999 616.46 c -142.0161 597.6318 142.8198 591.0195 v -142.8198 588.8594 l -134.9097 589.2705 133.2197 587.1797 v -131.9839 581.7461 130.8198 581.4199 v -127.8032 578.8203 129.8599 575.8994 v -127.8032 573.3867 128.1802 569.1797 v -136.1001 565.0996 l -138.2554 549.9795 149.54 544.46 v -154.5942 542.1104 157.9014 549.1426 160.1001 555.5 c -156.6465 577.5674 159.1401 582.1396 v -170.4414 592.6133 169.9399 596.2998 v -169.604 615.1875 168.2598 615.9795 v -F -0.015686 0.141176 0.184314 0 k -167.7798 615.0195 m -166.8994 616.0107 158.8999 621.8525 152.8999 615.2598 c -142.2153 597.0244 143.0601 590.54 v -143.0601 588.3799 l -135.2959 588.8857 133.7002 586.9395 v -132.4473 581.5586 131.2998 581.1797 v -128.377 578.71 130.3398 575.8994 v -128.377 573.4209 128.8999 569.4199 v -136.5801 565.3398 l -138.5503 550.6279 149.54 545.4199 v -154.46 542.9668 157.6807 549.8145 159.6201 555.9795 c -156.459 577.4912 158.8999 581.8994 v -169.8896 592.1426 169.46 595.8193 v -169.0762 614.1201 167.7798 615.0195 v -F -1 g -159.3799 556.46 m -156.272 577.4121 158.6602 581.6602 v -169.3398 591.668 168.98 595.3398 v -168.5479 613.0518 167.2998 613.8193 v -166.5249 614.9883 158.6479 620.5752 152.6602 614.2998 c -142.4121 596.4199 143.2998 590.0596 v -143.2998 588.1396 l -135.6802 588.5 134.1802 586.46 v -132.9082 581.3721 131.7798 580.9395 v -128.9478 578.5996 130.8198 575.8994 v -128.9478 573.4521 129.3799 569.4199 v -136.8198 565.5801 l -138.8481 551.2754 149.54 546.1396 v -154.3281 543.8232 157.46 550.5938 159.3799 556.46 c -F -0.8 g -156.02 563.4199 m -132.2695 574.6396 131.2998 575.4199 v -141.291 566.501 142.1001 566.54 v -143.0503 566.501 156.02 563.4199 y -F -0 g -137.2998 570.1396 m -157.46 566.2803 157.46 561.5 v -157.46 558.2383 157.1934 543.4756 151.2197 545.1797 c -142.0615 547.8008 146.0215 563.6406 137.2998 570.1396 c -F -0.45098 0 1 0 k -146.4199 566.0596 m -156.3369 564.4395 157.46 561.5 v -158.1201 559.6807 158.8496 550.541 152.8999 549.2598 c -147.8335 548.3379 145.3809 559.582 146.4199 566.0596 c -F -0 g -240.98 519.2598 m -240.5098 521.1729 241.9497 521.0283 243.8599 521.6602 c -246.1206 522.2813 259.5415 526.46 260.4199 529.3398 c -261.3008 532.1816 275.7798 527.4199 y -277.8008 526.46 282.7402 523.5801 y -287.9214 522.2813 295.2197 521.8994 y -297.8218 520.7402 301.46 517.5801 y -317.6211 506.4414 331.2197 514.46 y -353.2617 521.6211 346.5801 540.6201 y -343.3613 550.4404 346.8203 554.2998 y -347.1006 558.3604 354.9805 551.4199 y -357.8818 546.7012 358.8203 541.0996 y -367.5605 528.8818 363.8594 548.54 y -364.043 549.5596 360.9609 553.5195 360.9805 554.7793 c -360.9609 556.1602 359.0605 559.8193 y -355.6807 563.6406 358.3398 571.3398 y -360.3008 586.5195 357.8594 584.54 y -356.5615 586.5195 346.3398 575.4199 y -344.0215 571.7813 337.46 570.1396 y -334.3418 568.04 330.5 569.6602 y -327.7422 570.0195 321.6201 562.2197 y -324.6602 562.541 327.3008 557.7002 330.0195 557.4199 c -332.5801 557.2617 334.5605 560.1201 336.2598 560.7793 c -338.082 561.4395 341.0605 555.0195 y -341.6025 552.2002 335.54 546.8594 y -335.002 541.8604 333.1406 543.7393 y -329.9414 544.2793 328.6211 540.1016 327.6201 535.0996 c -326.4219 529.9805 321.8594 529.5801 y -320.041 521.4004 318.7402 524.7793 y -318.5 530.8613 312.0195 524.54 y -310.5801 522.2813 305.54 524.7793 y -298.04 526.9014 300.7402 529.0996 y -302.6602 531.5215 314.9004 529.0996 y -317.4004 530.8613 308.6602 535.3398 y -307.9395 537.2402 309.1406 542.0596 y -310.3613 545.5996 317.7793 551.6602 y -328.1816 553.0801 325.2197 554.7793 y -318.2813 560.5615 312.0195 552.1396 y -309.4805 545.3818 290.4199 528.8594 y -285.0605 525.1396 287.9214 532.6201 283.46 528.8594 c -279.1206 525.1396 256.5801 535.0996 y -243.7422 536.3525 240.7373 519.0361 236.8999 522.3799 c -242.8135 513.0967 240.98 519.2598 v -F -455.2998 702.1396 m -427.1816 693.4395 424.0996 672.8594 v -421.4629 647.6816 444.0195 628.2197 v -444.3418 621.2813 446.6602 617.6602 v -444.7813 612.4805 465.3799 620.7793 v -495.3799 630.1396 l -502.4219 632.7197 508.0996 642.3799 v -513.8623 652.0801 530.5801 672.7617 526.5801 700.46 c -527.9414 712.8008 521.2998 713.1797 v -512.1006 715.001 504.2598 706.7002 v -496.7021 703.1211 494.1797 703.5801 v -455.2998 702.1396 l -F -515.54 703.3398 m -517.7334 713.1533 512.4199 707.8994 v -504.668 701.5371 496.3398 701.4199 v -480.4668 699.1162 475.6992 684.6201 v -471.2695 655.0732 480.0195 648.8594 v -485.3047 640.5537 492.9805 647.8994 v -500.7949 655.0732 517.8438 688.3252 515.54 703.3398 c -F -0.2 g -515.0605 702.8594 m -517.3105 712.5537 512.1797 707.4199 v -504.4805 701.1514 496.3398 701.1797 v -480.7207 698.7725 475.9395 684.6201 v -471.6914 655.5293 480.2598 649.3398 v -485.4727 641.2734 492.9805 648.3799 v -500.6797 655.5293 517.3877 688.2051 515.0605 702.8594 c -F -0.4 g -514.5801 702.6201 m -516.8906 711.9561 511.6992 706.9395 v -504.2959 700.7617 496.3398 700.7002 v -480.9746 698.4297 476.4199 684.3799 v -472.1143 655.9873 480.5 649.8193 v -485.6387 641.9961 493.2197 649.0996 v -500.5664 655.9873 516.9346 688.083 514.5801 702.6201 c -F -0.6 g -514.0996 702.1396 m -516.4668 711.3584 511.46 706.2197 v -504.1113 700.376 496.3398 700.46 v -481.2324 698.0859 476.6602 684.3799 v -472.5371 656.4463 480.7402 650.54 v -485.8066 642.7178 493.2197 649.5801 v -500.4512 656.4463 516.4785 687.9629 514.0996 702.1396 c -F -0.8 g -513.8594 701.6602 m -516.0469 710.7578 511.2197 705.7393 v -503.9258 699.9893 496.3398 699.9795 v -481.4863 697.7432 476.9004 684.3799 v -472.959 656.9043 480.9805 651.0195 v -485.9746 643.4385 493.2197 650.0596 v -500.3359 656.9043 516.0225 687.8428 513.8594 701.6602 c -F -1 g -513.3799 701.4199 m -515.6211 710.1602 510.7402 705.2598 v -503.7422 699.6006 496.3398 699.5 v -481.7402 697.3994 477.3799 684.1396 v -473.3809 657.3604 481.2197 651.7393 v -486.1426 644.1602 493.2197 650.7793 v -500.2207 657.3604 515.5664 687.7207 513.3799 701.4199 c -F -0.254902 0.941176 1 0.243137 k -280.5801 477.7402 m -258.2217 498.9609 249.3799 499.8193 v -211.5801 504.2402 195.3799 484.46 v -214.6616 506.8809 245.0601 500.7803 v -221.2617 505.5605 207.6201 501.9795 v -189.1401 502.04 178.5801 486.6201 v -175.46 481.3398 l -179.8999 497.6406 200.1802 504.1396 v -225.2217 509.5205 237.1401 504.1396 v -213.3418 511.7217 202.3398 509.4199 v -168.9009 512.1602 154.8198 483.0195 v -159.2217 498.9609 175.46 506.7803 v -190.46 516.5596 212.8999 513.5 v -228.7402 509.96 234.5 507.2598 v -240.1807 504.6797 238.8608 507.7617 229.7002 513.0195 c -223.46 524.041 208.1001 523.5801 v -160.981 519.6416 149.54 506.54 v -164.5015 518.7607 175.9399 521.8994 v -200.5806 530.6406 209.7798 529.8193 v -237.1016 528.6602 245.54 533.1797 v -233.1416 527.5615 236.6602 524.0596 v -240.1807 520.5195 247.6616 512.1602 247.7002 510.8594 c -247.6616 509.5205 274.2798 485.2109 278.1802 480.3799 c -280.5801 477.7402 l -F -0.8 g -432.9805 264.3799 m -415.8516 304.5918 402.0195 315.0195 v -430.7002 297.4395 434.6602 277.5801 v -434.5498 266.6406 432.9805 264.3799 v -F -484.5801 256.2197 m -455.4512 316.6904 435.1406 343.0996 v -482.9502 301.8418 488.4199 272.7803 v -488.9004 266.54 l -485.7793 269.4199 l -485.1514 259.4912 484.5801 256.2197 v -F -546.7402 309.5 m -478.002 374.9912 476.4199 377.6602 v -542.9004 305.1416 546.2598 296.7803 v -544.002 306.79 546.7402 309.5 v -F -339.3799 261.7393 m -360.8506 318.8906 381.8594 294.1396 v -398.25 283.1406 397.7002 279.7393 v -393.3008 286.9902 373.46 286.46 v -352.6016 289.7402 339.3799 261.7393 v -F -548.9004 401.8994 m -499.4502 433.292 491.2998 435.0195 v -478.2129 437.5371 545.6504 403.04 551.0605 391.5801 c -553.3496 394.2412 548.9004 401.8994 v -F -0 g -383.2998 284.7803 m -405.623 286.8799 413.0605 294.3799 v -417.8594 290.2998 l -437.2998 332.54 l -441.3799 327.0195 l -457.1025 343.2002 456.2598 351.9795 v -455.3408 360.7998 470.4199 345.5 y -469.4219 358.1602 477.3799 350.7803 v -474.7012 367.8389 483.8594 358.9395 v -472.3496 392.2139 497.0605 363.9795 v -503.3027 356.8398 498.5 364.2197 y -469.8613 417.1201 493.7002 401.1797 v -495.8213 426.3584 494.4199 431.1797 v -493.1816 436.04 490.9805 460.6807 485.7793 466.46 c -480.4209 472.1211 486.1426 473.8809 492.2598 468.1396 c -479.9814 494.5615 494.4199 481.3398 v -490.541 498.0801 485.7793 501.2598 v -479.543 520.0811 496.3398 508.2197 v -491.4219 521.8398 487.9395 525.2598 v -475.1406 555.7207 483.1406 550.46 v -487.9395 546.3799 l -480.4209 561.8818 487.46 556.9395 v -494.502 552.2002 494.4199 552.6201 y -471.1807 589.1602 493.7002 569.8994 v -484.6465 585.1113 480.9805 592.7002 v -460.1816 615.1201 475.9395 608.0596 v -481.2197 606.3799 l -471.623 617.3213 462.7402 619.0996 v -454.0205 620.8398 465.4609 627.8818 472.5801 625.5801 c -479.543 623.4795 496.8203 615.0195 y -510.7813 594.4395 515.2998 593.8994 v -493.1816 602.3594 499.7002 593.6602 v -515.6211 578.1602 507.6201 578.54 v -501.1016 570.6797 506.4199 561.0195 v -486.0752 581.2305 502.3398 553.0996 v -510.0195 535.0996 l -483.0605 562.3203 495.3799 538.2197 v -514.3018 512.1602 516.5 511.8193 v -518.7012 511.2803 523.46 501.5 y -518.6602 503.8994 l -524.4199 494.0596 l -512.1006 507.3193 518.6602 492.8594 v -524.9004 477.0195 l -502.4219 501.1611 517.46 468.6201 v -499.3418 474.3193 509.0605 455.4199 v -507.2617 437.7988 507.6201 432.1396 v -508.1406 426.3584 509.4609 395.1201 504.7402 386.2998 c -499.7813 377.5205 511.2227 356.4004 513.3799 351.9795 c -515.6211 347.5996 519.582 335.7197 510.0195 345.7393 c -500.2207 355.959 505.0615 349.8008 507.3799 340.2197 c -509.4609 330.4395 516.0605 313.2803 515.2998 307.0996 c -513.8623 305.7988 510.2598 309.7393 v -494.0625 334.8389 495.8594 319.0996 v -494.502 310.2002 491.0605 300.6201 v -487.4629 288.6387 487.46 298.2197 v -483.9414 316.8008 480.9805 308.54 v -477.7813 300.0801 473.8203 293.4795 470.6602 290.7803 c -467.6621 288.2002 461.9414 313.2803 460.5801 301.8193 c -447.4209 315.4805 442.0996 297.5 v -429.3799 279.5 l -428.9414 293.04 427.7002 286.46 v -394.6211 279.8408 383.2998 284.7803 v -F -345.3799 677.1797 m -332.5801 685.9609 328.0996 685.5801 v -323.7822 685.0801 358.541 695.2012 403.9395 664.9395 c -409.1406 661.7598 413.0605 662.2998 v -416.6211 659.5615 413.54 655.5801 v -403.8613 645.041 416.1797 632.7793 v -436.4219 625.2412 430.3398 634.9395 v -442.1406 630.5215 444.7402 626.0596 v -447.4209 621.7207 446.1797 626.0596 y -439.0615 634.04 432.5 639.7393 v -426.7422 641.96 423.6201 651.2598 v -420.582 660.4395 417.9414 671.4414 422.9004 675.0195 c -418.3809 670.1211 419.2998 674.54 v -420.1426 678.9199 424.1025 682.8799 425.7793 683.4199 c -427.6211 683.7607 445.6621 701.1416 453.1406 701.6602 c -443.0215 700.04 439.7002 701.1797 v -436.4219 702.2402 407.1602 714.7803 400.5801 716.0596 c -382.0801 723.3604 395.2998 721.0996 v -434.6621 716.9814 454.5801 702.3799 v -446.7607 711.7012 426.5 719.4199 v -402.1016 733.2607 363.3799 727.8193 v -343.8008 724.2412 335.2998 722.2998 v -332.3623 722.9209 331.7002 723.2598 v -331.043 723.7998 318.0605 733.7002 287.7798 725.8994 c -269 720.9414 259.46 715.5801 v -242.8208 714.3408 238.8198 710.7793 v -218.4009 694.7598 216.2598 693.9795 v -214.0015 693.001 201.4614 684.6416 200.6602 684.1396 c -227.6406 691.46 230.1802 694.2197 v -232.9209 696.7393 252.0605 699.6006 254.6602 698.0596 c -257.3408 696.5215 266.5806 697.1816 256.1001 696.6201 c -339.1807 680.2393 340.0996 678.1396 v -340.9424 675.8408 345.3799 677.1797 y -F -0.164706 0.627451 1 0.031373 k -423.8594 687.2598 m -412.6621 695.4199 410.4199 695.4199 v -408.2617 695.4199 394.6211 706.6396 390.0195 706.2197 c -385.3809 705.7617 371.9629 716.7607 341.7793 707.6602 c -341.1602 709.9395 345.1406 710.7793 v -352.1621 713.2393 352.5801 713.8994 v -374.8203 718.5195 382.8203 714.6201 v -392.8613 711.7012 399.6201 704.7793 v -412.002 701.3594 415.46 702.3799 v -425.2012 700.04 425.54 698.0596 v -432.0225 694.7598 430.0996 691.8193 v -430.4814 690.1396 423.8594 687.2598 v -F -410.1797 689.6602 m -411.0508 688.9063 412.1719 688.7979 412.8203 687.9795 c -413.0938 687.5625 412.7773 687.2041 412.3398 687.0195 c -411.2842 686.749 410.123 687.375 408.9805 686.7793 c -408.4238 686.501 407.7178 686.7002 407.0605 686.7793 c -405.3125 687.3506 403.3018 687.377 401.54 686.54 c -399.2578 687.8623 396.6631 687.2217 394.3398 688.2197 c -394.3086 688.3516 394.0645 687.9697 394.0996 687.9795 c -390.6318 689.2588 386.5156 688.9492 383.7793 691.5801 c -381.1709 691.9131 378.5762 692.4219 375.8594 693.2598 c -373.9063 693.7305 372.3584 694.8174 370.5801 695.6602 c -369.0605 696.5117 367.457 697.085 365.7793 697.5801 c -363.7207 697.9922 361.707 697.8701 359.54 698.54 c -359.5234 698.4678 359.3125 698.0908 359.2998 698.0596 c -358.8652 698.2393 358.5469 698.8809 358.3398 698.7793 c -356.5088 698.2471 354.8721 699.3174 353.0605 699.0195 c -351.7441 700.2871 349.8438 700.0186 348.2598 700.46 c -344.8828 701.4365 341.415 700.04 338.1797 701.1797 c -342.6055 703.167 347.7607 701.8105 352.3398 704.0596 c -354.791 705.3916 357.7188 704.1797 360.5 705.0195 c -361.0801 705.1729 361.8418 705.3965 362.1797 704.7793 c -362.4297 704.8086 362.6289 705.0723 362.6602 705.0195 c -365.3887 703.7695 367.9355 702.3682 370.5801 701.1797 c -371.0391 701.0332 371.627 701.29 372.0195 701.1797 c -373.5752 699.7305 375.7109 699.8428 377.2998 698.54 c -379.1094 699.0537 381.082 698.6338 383.0605 699.2598 c -383.0693 699.3506 383.3262 698.9766 383.2998 699.0195 c -384.6055 699.8232 385.875 699.5264 386.9004 699.2598 c -387.2285 699.0625 387.959 698.792 388.3398 698.7793 c -389.5303 698.4072 390.4736 697.8799 391.7002 697.5801 c -391.8965 697.6592 392.0986 698.0332 392.1797 698.0596 c -393.4141 697.5195 394.5586 697.5801 395.2998 696.3799 c -395.4297 696.4492 395.6113 696.7109 395.7793 696.6201 c -396.8311 696.3105 397.5469 695.4795 398.6602 695.1797 c -399.291 695.0977 399.9629 694.4092 400.5801 694.2197 c -403.2266 693.4111 405.2559 691.7285 407.7793 690.8594 c -408.5049 690.4033 409.4668 690.1465 410.1797 689.6602 c -F -325.9395 705.2598 m -323.0957 707.1514 320.4922 708.3682 317.7793 710.2998 c -317.6055 710.4795 317.2109 710.29 317.0605 710.54 c -315.8789 711.0967 314.9043 711.7354 313.9395 712.46 c -313.2295 712.9209 312.3271 712.9082 311.7793 713.1797 c -308.9697 714.6123 306.0776 715.2266 303.3799 716.54 c -304.0713 717.2432 305.3047 716.9736 306.02 717.9795 c -306.1733 717.5527 306.4351 717.2402 306.7402 717.5 c -308.6699 718.4453 310.7051 718.6133 312.5 718.46 c -314.4248 718.4121 316.3164 718.0781 318.2598 717.7393 c -318.6055 717.7275 318.8242 717.1514 319.2197 717.0195 c -321.6318 716.3145 324.2598 716.8926 326.6602 716.0596 c -328.3398 715.2793 330.0684 714.375 331.46 712.9395 c -331.707 712.6855 331.3496 712.3545 330.9805 712.2197 c -331.4697 712.2607 331.7695 712.0352 331.9395 711.7393 c -331.9834 711.4277 331.9834 711.0938 331.9395 710.7793 c -331.7676 710.4893 331.46 710.377 330.9805 710.2998 c -329.502 710.1123 331.4502 711.6289 330.7402 711.0195 c -329.2813 710.2422 330.1016 708.6963 329.2998 707.4199 c -328.9736 707.5137 328.7217 707.7529 328.8203 708.1396 c -329.0977 707.6064 328.4355 707.2881 328.3398 706.9395 c -327.8281 706.1426 326.8398 704.585 325.9395 705.2598 c -F -290.1802 697.0996 m -286.6494 698.043 283.2944 697.918 279.8599 699.2598 c -279.9033 699.3535 279.6582 698.9697 279.6201 699.0195 c -278.084 699.6533 277.0737 700.7168 275.7798 701.8994 c -274.8872 702.8428 273.063 702.418 271.7002 702.8594 c -271.3042 703.0898 271.0806 703.6514 270.7402 703.5801 c -269.4102 703.8682 268.3906 704.9121 267.1401 705.5 c -269.811 706.4141 272.4629 706.3809 275.0601 706.7002 c -275.2949 706.8242 275.4536 706.4697 275.54 706.46 c -275.751 706.4697 275.8926 706.7119 276.02 706.9395 c -276.2554 706.5537 276.5864 706.1934 276.98 706.46 c -277.4722 707.0674 278.084 706.8584 278.6602 706.7002 c -278.835 706.8027 278.9746 706.4697 279.1401 706.46 c -279.2695 706.4697 279.4136 706.8125 279.6201 706.7002 c -279.7109 706.8105 279.855 706.4697 280.1001 706.46 c -280.1504 706.4697 280.292 706.7119 280.3398 706.9395 c -281.2017 706.001 282.1733 706.6113 282.98 706.46 c -284.2207 706.165 284.5137 704.8994 285.6201 704.54 c -290.8833 703.1377 295.4336 700.7793 300.2598 698.54 c -300.5693 698.3213 300.7998 698.0479 300.7402 697.5801 c -300.9751 697.6201 301.3184 697.7168 301.46 697.5801 c -302.6914 696.7666 303.8359 696.1641 304.5801 694.9395 c -304.8418 694.585 304.479 694.1357 304.3398 694.2197 c -299.3506 695.2881 294.9438 695.9551 290.1802 697.0996 c -F -274.8198 648.6201 m -273.1206 649.8799 272.4775 652.1113 271.2197 654.1396 c -271.0015 654.4561 271.3042 654.8047 271.7002 654.8594 c -272.2686 655.0752 272.8662 654.5498 273.3799 654.3799 c -275.2354 653.3789 276.9248 652.0137 279.1401 651.9795 c -281.3096 649.4043 285.9941 648.9795 286.1001 645.2598 c -286.0039 644.3164 284.4321 645.3242 283.9399 644.2998 c -281.2642 645.4834 278.6357 645.3701 276.02 646.9395 c -275.3384 647.4033 275.7031 647.9023 274.8198 648.6201 c -F -244.5801 706.46 m -244.729 706.3711 252.4614 706.1143 252.5 705.9795 c -252.3945 705.6514 243.8911 704.4971 243.3799 704.7793 c -243.3105 704.7676 235.0474 702.0938 234.98 702.1396 c -235.1934 702.3896 244.2871 706.373 244.5801 706.46 c -F -0 g -261.6201 695.6602 m -245.2402 693.6602 240.5 692.2998 v -235.5605 691.0205 215.1006 682.6611 211.7002 680.54 c -197.0601 674.5205 178.3398 652.46 v -186.7207 656.2617 189.1401 659.4199 v -204.1016 673.2002 203.7798 670.46 v -217.3018 679.8008 216.7402 677.4199 v -243.481 689.7002 241.2197 686.2998 v -265.04 691.2412 264.02 688.9395 v -284.6216 684.2002 281.54 683.8994 v -275.1606 682.6611 282.2598 678.6201 v -278.4609 673.8604 272.4199 678.3799 v -266.5806 682.6611 269.8809 680.2393 264.5 679.0996 c -261.5215 678.2598 256.5801 682.7002 v -250.3018 687.7207 240.7402 683.6602 v -206.96 669.9004 204.7402 669.2598 v -200.8018 666.1611 198.2598 662.2998 v -191.7798 657.3604 188.4199 655.8193 v -174.4014 643.0615 173.0601 641.4199 v -169.3398 635.8018 168.5 635.4199 v -175.501 639.54 177.6201 641.6602 v -193.1001 652.7402 198.98 653.6602 v -203.8809 656.9209 204.7402 658.46 v -220.6016 668.5801 225.1401 668.54 v -235.3398 662.8613 238.1001 670.46 v -244.3613 672.54 250.5801 671.1797 v -254.041 674.0811 253.2197 676.46 v -254.9214 678.4805 256.1001 674.2998 v -259.7598 670.3398 264.98 672.6201 v -269.4414 672.7617 267.1401 670.2197 v -262.3999 665.9404 249.3799 665.6602 v -235.7817 665.0596 217.7002 656.7793 v -184.9614 645.2598 174.7402 633.7393 v -167.8018 624.1396 161.7798 622.9395 v -155.48 621.9414 148.8198 613.8193 v -159.6606 620.1797 169.46 620.2998 v -173.96 622.8193 169.7002 618.8594 v -165.8218 610.501 167.54 604.46 v -166.9209 598.8418 166.1001 597.0195 v -157.46 583.001 157.46 580.46 v -157.46 577.7217 158.7798 566.9404 159.1401 566.2998 c -159.6606 565.6201 158.1201 568.04 162.2598 565.3398 c -166.4814 562.7598 169.5605 561.001 170.4199 557.8994 c -171.3198 554.8398 168.2407 563.8613 168.02 565.8193 c -167.8018 567.8213 163.1816 575.7412 164.1802 578.2998 c -165.1616 577.2793 166.1001 575.6602 v -165.3799 576.4014 166.1001 580.46 v -166.9209 586.0801 168.5 589.5801 v -170 593.1201 172.2007 597.3008 172.5801 598.2197 c -173.0815 599.0596 173.0815 605.4414 174.7402 602.54 c -178.3398 599.6602 l -175.2798 602.5801 177.6201 604.9395 v -176.6001 611.1602 178.5801 614.0596 v -186.2817 623.2617 187.9399 624.3799 v -189.7998 625.46 188.1802 625.0996 y -194.8613 629.6406 188.4199 627.9795 v -184.0806 626.1201 180.7402 626.0596 v -172.4214 623.9209 176.8999 628.46 v -181.2197 633.1611 192.2217 639.1016 196.3398 638.7793 c -197.2998 637.0996 l -209.54 639.7393 l -208.3398 638.7793 l -208.0615 639.1016 212.6602 639.5 v -217.3018 639.9795 223.6807 638.4414 225.1401 640.46 c -226.7598 642.4014 230.5015 643.501 230.1802 641.8994 c -229.6206 640.4209 229.46 638.2998 y -234.9009 644.5996 234.2598 642.1396 v -233.5806 639.7617 224.5615 634.04 222.98 627.2598 c -234.5 636.1396 l -238.3398 639.5 l -242.3818 637.1211 242.6602 638.7793 v -242.8208 640.6396 247.8799 647.0215 249.1401 646.7002 c -250.52 646.5801 252.7207 649.6611 252.5 646.7002 c -252.2817 643.9395 260.6602 638.0596 y -264.1616 639.9795 265.7002 638.54 v -267.2407 636.9004 271.9399 660.1396 y -299.2998 671.8994 l -347.2998 675.7393 l -328.5801 683.1797 l -261.6201 695.6602 l -F -*u -1 D -0 R -0.435294 0.886275 0.8 0.670588 K -1 J 2.2 w 10 M -281.54 476.7803 m -265.04 495.2217 255.8599 498.1396 v -241.0615 505.5605 214.1001 496.9395 v -S -252.2598 499.5801 m -224.5615 508.4209 207.6201 503.8994 v -187.3809 501.6006 178.1001 486.3799 v -S -248.4199 501.0195 m -229.6206 508.8604 213.3799 511.3398 v -195.0801 514.1406 176.8999 506.2998 v -163.3999 499.6201 157.46 488.2998 v -S -249.3799 500.54 m -232.4814 512.5996 231.3799 514.2197 v -223.6807 526.2412 209.2998 526.7002 v -185.8398 525.7998 166.8198 517.0996 v -S -*U -0 D -0 O -0 g -0 J 1 w 4 M -247.9399 510.3799 m -249.6802 508.7842 279.3799 477.0195 y -318.0605 436.7002 287.2998 474.3799 y -278.8999 479.5996 268.8198 500.2998 y -267.4614 503.3594 284.1802 492.3799 y -288.5815 491.4795 303.6201 470.2998 y -296.0601 473 301.46 465.0195 y -304.4214 462.8818 326.9004 445.8193 y -330.8223 441.3193 335.2998 439.5801 y -350.6211 445.2793 343.7002 430.7002 y -346.2227 423.2793 352.3398 435.9795 y -364.7021 454.5195 346.5801 451.8193 y -313.6621 448.8008 306.2598 466.46 y -303.541 469.04 313.2197 466.46 y -322.4629 464.2012 305.2998 480.1396 y -307.9395 480.041 318.0195 472.46 y -329.502 462.4395 331.7002 464.54 y -351.502 474.3193 362.9004 465.9795 y -365.1416 464.2012 358.9805 456.7207 360.7402 451.0996 c -362.502 445.2793 367.7002 431.6602 y -365.1416 429.8789 365.54 417.9795 y -384.0605 392.4795 373.46 394.7002 y -356.3408 395.1201 372.7402 386.7793 y -376.1406 384.5596 385.9395 376.7002 y -382.7402 377.96 380.9004 372.1396 y -386.2617 367.8389 383.2998 362.54 y -376.582 361.2393 375.3799 356.7793 y -382.7402 348.0391 371.7793 347.6602 y -375.7012 342.7588 370.3398 329.6602 y -365.1416 329.5586 358.0996 323.4199 y -360.7422 318.1201 349.2197 311.8994 y -340.0615 310.2002 343.2197 302.7793 y -334.3418 296.1201 331.7002 278.54 y -330.8223 267.0801 328.1816 263.5586 333.8594 265.8193 c -339.623 267.958 338.6602 281.6602 y -333.4609 298.7598 380.6602 316.46 y -384.9414 318.1201 385.9395 323.8994 y -388.0215 323.4004 397.7002 315.0195 y -406.0615 302.7197 406.5801 312.8594 y -407.8203 316.8008 406.0996 323.4199 y -412.6621 347.1582 397.2197 354.1396 y -386.2617 391.1602 401.7793 381.9795 y -404.7422 375.7588 416.6602 369.9795 y -420.5 372.6201 l -418.8223 377.96 428.1797 384.6201 y -431.1416 377.5205 437.7793 386.2998 y -441.7012 413.1582 455.2998 397.3398 y -459.7422 396.001 461.0605 403.5801 y -465.0225 414.9199 461.0605 429.9795 y -465.0225 430.3203 475.7002 423.7393 y -478.6621 427.6807 468.541 446.1582 473.0605 443.4199 c -477.3418 440.8809 482.1797 439.0996 y -483.0605 441.3193 472.0996 454.9395 y -467.2207 458.04 461.54 480.3799 y -469.4219 476.5205 458.4199 493.3398 y -458.4219 496.7598 465.1406 509.1797 y -464.1416 516.5596 465.1406 516.1396 y -468.1016 514.8008 476.9023 513.041 469.46 519.9795 c -461.9414 527.1201 470.4199 532.46 y -475.1406 535.4814 460.0996 535.0996 y -454.4629 539.8809 454.8203 544.2197 y -463.7021 542.0811 447.8623 557.9209 445.2197 561.9795 c -442.582 565.8418 453.1406 571.5801 y -467.6621 575.5205 454.8203 579.0195 y -433.3418 578.5996 445.2197 590.54 y -451.8223 590.04 450.0195 592.7002 y -444.3418 594.001 433.7002 601.0996 y -429.3828 605 433.46 604.2197 y -451.8223 602.8018 420.2598 615.0195 y -428.9414 615.1201 409.2197 626.54 y -406.9424 628.3203 403.46 636.6201 y -396.8223 642.4014 391.46 649.8193 y -391.1025 654.7207 385.9395 659.8994 y -373.0615 674.96 366.9805 674.54 y -350.6211 678.4805 344.9004 677.6602 y -286.8198 672.8594 l -257.7798 658.6807 266.4199 635.6602 y -273.4014 626.3408 283.46 630.6201 y -288.5815 637.3398 301.46 634.9395 y -323.7822 631.3994 320.9004 635.4199 y -318.2813 640.4209 300.4614 647.2393 300.2598 647.8994 c -300.02 648.5596 290.4199 652.2197 y -287.041 653.6211 282.2598 663.7393 y -278.6816 667.4814 296.1802 661.0996 y -294.7402 660.001 302.8999 655.5801 y -322.0205 656.7002 333.6201 644.7793 y -345.5625 626.5615 345.8594 635.6602 y -348.8623 645.9199 335.7793 669.2598 y -336.3223 671.4414 345.3799 664.2197 y -346.8828 666.3799 347.7793 659.8994 y -347.9814 657.3604 352.0996 648.6201 y -355.2422 634.2607 359.2998 642.3799 y -364.3398 632.0596 l -365.8018 629.2012 359.2998 620.7793 y -358.9805 617.7607 359.8613 617.9814 353.7793 609.7393 c -347.543 601.2607 351.3799 596.54 y -349.7402 589.1602 359.54 589.5801 y -362.2813 587.1797 366.0195 587.1797 y -368.002 584.9814 370.5801 585.7393 y -372.4014 589.8193 379.2197 587.6602 y -380.7607 590.2617 389.7793 590.7793 y -390.8809 593.5615 391.3203 595.3203 395.0605 596.0596 c -398.8018 596.6406 371.7793 644.0596 y -378.7813 644.8203 369.8594 658.46 y -367.3418 665.7197 379.8828 649.6611 382.3398 648.1396 c -384.7207 646.5801 385.8223 644.1602 384.0195 644.2998 c -382.3018 644.5996 380.3223 642.1807 381.8594 641.8994 c -383.4004 641.7412 397.7021 625.2412 401.54 614.0596 c -405.1807 602.8018 411.7813 598.3994 418.5801 591.7393 c -425.4219 585.2002 424.5801 558.6201 y -424.1025 548.8994 430.8203 537.2598 y -432.9004 533.0596 428.1797 513.0195 y -426.082 510.6201 427.7002 509.6602 y -428.7227 508.4209 436.0996 493.8193 y -434.2207 494.1201 438.2598 490.2197 y -443.9023 483.5596 436.8203 486.8594 y -430.2607 488.6211 438.0195 477.7393 y -439.2822 475.8604 429.3799 480.8594 y -419.2617 481.5801 432.0195 473.6602 y -441.4805 465.7393 428.9004 470.54 y -423.8809 472.5605 427.46 465.0195 y -430.9209 463.3203 449.7793 455.6602 y -450.2813 451.4404 446.9004 445.8193 y -447.4209 441.54 444.9805 437.8994 y -443.6816 428.7793 443.0605 427.8193 y -438.4014 427.6807 430.3398 412.46 y -428.2813 409.6396 417.1406 396.3799 y -414.8623 388.7402 395.0605 396.6201 y -387.8027 392.9189 390.0195 396.6201 y -389.5615 399.0801 394.8203 405.7393 y -402.541 408.54 399.6201 420.3799 y -404.082 421.959 391.7617 425.04 391.9395 426.3799 c -392.2012 427.6807 398.6602 429.2598 y -407.3809 431.4199 402.5 434.0596 y -401.8809 438.459 405.1406 444.6201 y -417.9414 445.501 405.1406 463.3398 y -393.3008 471.6797 392.1797 477.9795 y -406.0615 487.0801 397.043 500.7197 397.2197 504.6201 c -397.4814 508.6396 398.9004 532.46 y -396.6006 539.2207 393.3799 554.2998 y -395.7227 559.9014 403.9395 573.7393 y -406.9424 578.3818 416.6211 583.6611 414.2598 586.9395 c -411.7813 590.2617 403.2197 588.3799 y -394.6211 589.8193 395.2998 584.0596 y -393.5215 583.001 392.6602 577.5801 y -391.8486 568.7744 382.0996 561.9795 y -369.7617 555.0605 379.9395 550.7002 y -386.4824 543.4014 375.6201 543.2598 y -363.6006 545.1602 372.7402 533.8994 y -384.502 519.8594 381.1406 516.8594 y -369.9824 515.6816 383.7793 505.5801 y -382.9609 507.7617 383.2998 505.8193 v -383.4004 503.8018 386.7012 499.1816 387.6201 496.9395 c -388.4629 494.7793 384.0195 494.54 y -384.7207 484.001 367.7002 488.54 y -367.7813 488.6211 366.0195 488.2998 v -364.2607 488.1797 351.9414 489.0605 345.6201 491.4199 c -339.1807 493.9014 331.7002 493.8193 y -327.3008 491.9209 318.9805 492.1396 v -310.5801 492.3604 301.7002 489.2598 y -296.9409 489.7207 306.4014 494.5615 306.7402 494.2998 c -306.8408 494.1201 313.002 500.2803 304.1001 499.5801 c -280.2246 497.8232 268.3398 509.1797 y -266.1416 510.6201 263.2998 513.7393 y -252.2817 515.8994 264.7402 500.0596 y -266.1416 498.5215 264.5 497.4199 y -263.7197 499.1816 255.1401 505.0996 y -252.0488 506.1914 250.5488 507.6582 247.9399 510.3799 c -F -0.435294 0.886275 0.8 0.670588 k -221.7798 523.0996 m -234.4614 517.001 237.3799 513.9795 v -240.1807 510.8408 255.6201 498.3799 y -249.6416 500.501 246.7402 502.46 v -243.9199 504.4609 232.1001 513.5 y -227.8613 520.0801 221.7798 523.0996 v -F -0.45098 0 1 0 k -157.9399 557.4199 m -158.2617 557.6406 157.6855 560.624 157.46 561.2598 c -156.3369 564.2188 146.4199 565.8193 y -146.2109 564.3389 146.1514 562.585 146.1802 560.7793 c -151.6206 554.71 157.9399 557.4199 v -F -0.658824 0.2 1 0.039216 k -157.9399 557.6602 m -157.395 557.5225 157.875 560.7051 157.7002 561.2598 c -156.5552 564.2188 146.4199 566.0596 y -146.2109 564.4492 146.1514 562.6924 146.1802 560.7793 c -150.9609 555.2598 157.9399 557.6602 v -F -0 g -153.1401 557.6602 m -152.3721 557.54 151.8154 558.7949 151.7002 560.2998 c -151.8154 561.8857 152.3721 563.1416 153.1401 563.1797 c -153.7471 563.1416 154.3066 561.8857 154.3398 560.2998 c -154.3066 558.7949 153.7471 557.54 153.1401 557.6602 c -F -102.98 449.6602 m -96.7402 438.6797 124.1001 445.3398 v -139.4214 446.5996 142.1001 449.1797 v -143.3818 448.3594 152.583 445.1338 155.7798 444.3799 c -163.1816 442.6396 172.3398 453.7402 y -177.481 465.1904 180.5 465.2598 v -183.6416 465.1904 180.02 463.3398 y -172.8608 452.3193 173.2998 450.6201 v -167.5806 428.5586 150.02 427.5801 v -132.2144 426.6338 133.7002 420.1396 v -143.3818 422.8398 145.9399 420.1396 v -157.9014 420.6387 149.0601 413.6602 v -141.6201 400.9395 l -141.7734 396.5313 130.5801 400.46 v -119.8398 404.1387 108.5 418.2197 y -90.9658 434.333 102.98 449.6602 v -F -0.066667 0.470588 0.290196 0 k -101.54 445.3398 m -99.3799 434.7197 139.9399 446.0596 v -144.7017 446.1582 147.3799 445.3398 v -149.9814 444.3994 163.1816 441.3193 165.3799 442.7002 c -157.46 427.6807 144.7402 429.5 v -130.1816 427.6807 130.5801 422.2998 v -135.02 414.4805 140.4199 411.7402 v -143.3818 409.2002 143.0601 405.7402 v -142.501 402.1592 139.4214 400.3994 137.2998 399.5 c -135.02 398.6406 131.5015 402.1592 129.8599 402.1396 c -127.981 402.1592 118.7407 409.2002 114.02 414.3799 c -109.0615 419.7578 99.8218 432.958 100.3398 435.9795 c -100.7002 439.1191 101.54 445.3398 y -F -0.262745 0.682353 0.52549 0.062745 k -105.1401 426.1396 m -107.96 421.7402 111.481 417.1201 114.02 414.3799 c -118.7407 409.2002 127.981 402.1592 129.8599 402.1396 c -131.5015 402.1592 135.02 398.6406 137.2998 399.5 c -139.4214 400.3994 142.501 402.1592 143.0601 405.7402 c -143.3818 409.2002 140.4199 411.7402 y -136.9277 413.5254 133.9136 417.3682 132.2598 419.8994 c -132.3799 417.1201 126.7402 417.9795 v -120.9414 418.8799 115.2197 421.959 113.54 425.4199 c -111.7017 429.001 109.0615 431.6406 110.8999 427.5801 c -112.5801 423.7207 115.2197 419.7578 116.8999 419.4199 c -118.7407 418.8799 118.3018 417.5596 115.7002 417.9795 c -113.0215 418.4404 109.9399 418.8799 105.1401 424.7002 c -F -0.254902 0.941176 1 0.243137 k -102.2598 449.1797 m -104.2207 464.2012 105.6201 468.6201 v -104.6602 476.0811 107.2998 480.6201 v -109.9399 485.3213 112.1406 492.1396 115.46 498.1396 c -118.7407 504.0195 118.9614 508.4209 123.3799 510.1396 c -127.7598 511.9395 134.3599 521.4004 137.54 522.6201 c -140.5205 523.6016 140.4199 522.6201 y -147.7808 539 162.7402 534.6201 v -144.9199 537.6797 162.2598 548.0596 v -157.0205 546.8115 160.5801 554.54 v -163.0713 559.6445 162.5215 552.2002 150.5 539.1797 c -144.9199 529.7598 139.2197 526.46 v -133.4814 523.1602 120.2817 515.4609 119.0601 511.3398 c -117.6416 507.1016 114.1206 500.7197 111.8599 498.8594 c -109.7217 497.2012 106.6401 492.5811 106.1001 488.7803 c -104.8809 484.4404 103.46 483.0195 v -101.8018 481.8008 101.5806 478.2803 101.54 476.0596 c -101.5806 473.8809 99.3799 470.8018 99.6201 468.1396 c -100.4814 447.2598 100.1001 445.0996 v -102.2598 449.1797 l -F -1 g -92.8999 444.1396 m -90.5815 445.7188 85.7002 439.0996 v -93.771 402.8193 93.8599 401.1797 v -94.981 403.5898 93.6201 411.5 v -92.1201 419.4297 91.2197 433.3398 y -92.8999 444.1396 l -F -0.254902 0.941176 1 0.243137 k -116.6602 510.8594 m -97.1816 507.3193 97.7002 475.0996 v -96.7402 447.9795 l -95.4199 476.0811 94.1001 477.7393 v -92.7798 479.5996 97.1816 491.9209 93.6201 485.4199 c -78.2598 469.9209 87.1401 446.54 v -88.7095 442.9707 85.46 447.9795 v -80.3506 461.8896 81.6201 468.8594 v -81.7808 471.3506 83.7798 474.3799 v -93.3296 487.3018 96.2598 489.7393 v -98.2808 505.6709 115.2197 511.3398 v -121.4912 513.9199 116.6602 510.8594 v -F -0 g -269.7798 583.5801 m -270.6055 584.0498 270.5957 585.1182 271.2197 585.2598 c -272.499 585.6846 272.6792 586.8584 273.1401 587.6602 c -274.208 589.1719 274.4214 590.8594 275.0601 592.46 c -275.3599 593.2686 275.3911 594.3193 275.0601 595.0996 c -273.7544 597.7734 272.9814 600.4688 271.46 603.0195 c -271.1001 603.6318 270.812 604.5049 270.5 605.1797 c -270.0825 606.6865 268.7002 607.7764 267.8599 609.2598 c -267.4375 609.7129 268.0137 610.7305 267.1401 610.9395 c -266.2402 610.9395 264.6465 611.5752 264.5 610.46 c -263.7441 607.6016 264.855 604.8271 265.9399 602.0596 c -265.0591 601.3779 265.4263 600.3682 265.7002 599.4199 c -266.377 595.5557 265.0566 591.8691 264.2598 588.1396 c -264.1953 587.9336 264.5718 587.7148 264.5 587.6602 c -263.1968 584.6934 261.5981 582.0029 259.7002 579.5 c -258.7642 578.293 257.8066 577.2842 257.2998 576.1396 c -256.8535 575.249 256.4048 574.1885 256.5801 573.0195 c -252.9033 570.0439 250.4263 565.8125 247.46 561.5 c -247.0474 560.835 247.3662 559.5049 247.9399 559.0996 c -248.8662 558.7705 249.9199 559.8965 250.3398 560.7793 c -250.8633 561.5957 251.252 562.3105 251.7798 562.9395 c -251.9385 563.2109 251.7417 563.6719 251.7798 563.8994 c -254.7871 566.3857 256.623 569.6162 259.2197 572.2998 c -261.4663 572.583 263.1558 573.6797 264.98 574.7002 c -265.417 574.9902 265.9951 574.7168 266.4199 574.9395 c -268.2417 576.2266 268.2393 578.4678 268.3398 580.46 c -268.4097 581.54 268.6255 582.9893 269.7798 583.5801 c -F -260.1802 588.6201 m -260.2905 588.6582 260.1201 589.124 260.1802 589.3398 c -260.4199 589.7168 260.8613 589.9229 261.1401 590.2998 c -261.1616 590.5186 260.9814 590.9355 261.1401 591.0195 c -263.6982 593.7842 263.979 597.1113 262.8198 600.3799 c -263.9673 601.0635 264.0342 602.4512 263.54 603.5 c -262.6279 605.252 262.417 607.3711 261.3799 609.0195 c -260.4609 610.4648 258.7256 611.833 257.2998 610.46 c -256.7554 609.958 256.3999 609.0938 256.8198 608.2998 c -256.7769 608.1318 257.0913 607.9707 257.0601 607.8193 c -256.9424 607.5244 256.3423 607.2773 256.3398 606.8594 c -256.3042 605.333 255.2529 603.6699 255.8599 602.2998 c -256.7959 600.418 257.6958 598.373 258.5 596.54 c -257.0815 594.0918 258.2192 591.3994 256.3398 589.3398 c -256.1406 589.1738 256.1504 588.749 256.3398 588.6201 c -256.6064 587.9932 257.0527 587.5469 257.54 587.1797 c -257.811 587.0908 258.1929 587.0908 258.5 587.1797 c -259.0498 587.624 259.4863 588.1592 260.1802 588.6201 c -F -329.2998 599.8994 m -330.7754 597.9434 331.0957 594.8691 328.8203 593.4199 c -329.4463 589.7002 333.1328 591.877 335.54 592.46 c -335.3223 592.8867 335.5713 593.2666 335.7793 593.1797 c -337.0449 593.2881 337.793 594.4229 338.9004 594.1396 c -339.4395 595.9326 341.2402 596.7051 342.0195 598.2197 c -343.8457 602.2881 343.1982 606.9893 340.3398 610.46 c -340.1338 610.8389 340.3711 611.4072 340.3398 611.8994 c -339.4043 614.2373 337.1289 614.583 335.0605 615.2598 c -333.707 619.6035 332.9785 624.0361 330.9805 628.2197 c -329.2666 628.376 328.498 630.2881 327.1406 631.0996 c -325.5605 631.8701 324.9365 630.1348 324.9805 628.9395 c -324.9902 628.7598 325.4863 628.5127 325.2197 628.2197 c -325.2148 627.9297 324.9297 627.8096 324.9805 627.7393 c -324.9316 627.5117 325.1738 627.3682 325.2197 627.2598 c -324.3105 626.3193 322.7461 625.793 322.3398 624.6201 c -321.373 620.4531 324.2021 617.0166 325.9395 613.5801 c -326.6865 612.248 325.877 610.8486 324.9805 609.5 c -324.5605 608.7559 324.6797 607.5146 324.9805 606.6201 c -325.8105 604.0107 327.5605 602.0957 329.2998 599.8994 c -F -288.2598 579.7393 m -286.7358 577.6543 282.9849 574.8291 286.1001 572.7793 c -286.4048 572.5664 286.8125 572.5615 287.0601 572.7793 c -289.2246 574.4307 291.4302 575.4248 294.02 576.1396 c -294.2456 576.0967 294.5479 575.583 294.98 575.6602 c -296.7271 576.5332 298.9375 576.4688 300.2598 578.0596 c -304.3833 577.6953 308.3047 578.9209 312.0195 580.46 c -313.3135 580.8535 314.7109 581.4678 316.0996 582.1396 c -317.5449 582.6533 318.8691 583.6758 320.1797 585.0195 c -320.2373 585.0801 320.6289 584.9814 320.9004 585.0195 c -320.8789 585.9297 321.9365 586.0713 322.0996 586.7002 c -322.3086 587.0098 322.1426 587.4463 322.3398 587.6602 c -324.6416 589.3496 325.6543 591.5693 324.2598 594.1396 c -324.0537 594.8213 323.7793 595.501 323.0605 596.0596 c -321.9629 597.0244 320.751 596.0859 319.7002 596.54 c -319.4258 595.7305 318.625 595.918 318.2598 595.8193 c -317.2539 595.2197 315.7881 595.8633 314.9004 595.3398 c -313.3447 594.6152 311.9785 594.4297 310.3398 593.8994 c -310.0713 593.9258 309.2168 594.0293 309.1406 593.4199 c -308.8926 593.4893 308.7295 593.7461 308.6602 593.6602 c -306.5146 593.2852 305.1294 593.0498 303.6201 591.2598 c -303.584 591.0439 303.0967 591.2402 302.8999 591.0195 c -301.8701 590.2012 301.4263 588.8457 300.2598 588.1396 c -299.9937 587.9697 299.605 588.1563 299.2998 587.8994 c -298.6807 587.54 298.2773 586.834 297.6201 586.46 c -297.2095 586.0898 296.7705 586.4473 296.8999 586.7002 c -297.0752 588.8721 297.793 590.8369 297.1401 592.9395 c -299.4463 595.6729 302.2134 597.8164 304.1001 600.8594 c -304.2178 603.2041 304.9785 605.5635 304.8198 607.8193 c -304.8418 608.0596 304.5249 608.8662 304.3398 609.2598 c -304.0449 610.1885 305.041 611.3594 304.1001 612.1396 c -302.5688 613.4814 301.1479 612.5166 300.2598 610.9395 c -298.2178 610.5098 295.9448 609.749 294.2598 611.1797 c -293.103 611.9717 292.4673 612.9697 291.6201 614.0596 c -290.5039 615.5625 290.8735 617.1416 290.8999 618.8594 c -290.9551 619.0039 290.6094 619.1523 290.6602 619.3398 c -290.6118 619.4502 290.8521 619.5938 290.8999 619.8193 c -290.2231 620.4297 289.9209 621.5938 288.7402 621.9795 c -289.1357 623.1416 288.3921 624.1133 287.54 624.3799 c -285.2383 625.208 283.395 623.1025 281.2998 622.9395 c -280.748 623.002 280.2344 624.1445 279.6201 624.6201 c -279.0464 624.7393 278.271 624.7754 277.9399 624.3799 c -277.1167 623.9287 276.4688 623.8037 275.54 623.6602 c -273.855 623.0977 272.4512 621.8936 270.7402 621.0195 c -269.1895 620.0117 268.1382 618.4297 266.8999 616.9395 c -265.9136 615.7109 265.7646 613.0566 267.3799 612.6201 c -269.355 611.792 270.7881 614.7656 272.8999 614.2998 c -273.2935 614.3506 273.5215 614.0068 273.3799 613.5801 c -273.8286 613.46 274.0688 613.7119 274.3398 614.0596 c -275.2231 612.9004 276.5049 612.5283 277.46 611.6602 c -278.605 610.5752 280.5249 611.0332 281.54 609.9795 c -283.3232 608.2852 282.7065 605.3359 284.8999 603.9795 c -284.1968 602.4561 283.5298 601.0518 283.2197 599.4199 c -282.8506 598.1553 283.9424 596.8398 285.3799 597.0195 c -286.6592 597.041 286.9473 597.877 287.54 599.1797 c -287.7754 598.7666 288.291 598.4404 288.2598 598.2197 c -287.7417 595.5771 286.6133 593.3857 286.1001 590.7793 c -286.0449 590.3623 285.709 590.1387 285.3799 590.2998 c -284.7656 585.6963 280.3086 583.0635 277.46 579.5 c -277.0664 579.0293 277.0615 577.6563 277.46 577.0996 c -279.0537 575.6865 281.2109 577.3877 282.98 578.0596 c -283.3135 579.2666 284.2593 580.3037 285.6201 580.2197 c -286.0063 580.2314 286.2656 580.8271 286.5801 580.9395 c -287.0049 581.1221 287.5566 580.875 287.7798 581.1797 c -289.772 582.4082 291.3223 583.625 293.2998 585.0195 c -293.4438 585.0752 293.8232 584.9023 294.02 585.0195 c -294.4185 585.2002 294.625 585.624 294.98 585.7393 c -295.3613 586.0469 295.6279 585.7275 295.9399 585.5 c -295.1313 585.0361 295.1265 583.9834 294.5 583.8193 c -293.6338 583.4668 293.0166 582.9033 292.3398 582.3799 c -291.9536 582.2002 291.229 582.4707 291.1401 582.3799 c -290.4561 581.1436 289.1528 580.6611 288.2598 579.7393 c -F -227.54 633.9795 m -217.2583 637.2002 204.98 609.0195 v -202.3398 603.2402 199.7002 601.0996 v -197.0601 598.8418 184.7407 594.8818 182.6602 590.54 c -171.1401 572.7793 l -187.3809 590.4795 190.8198 593.1797 v -199.7002 602.3594 196.1001 594.8594 v -180.7808 583.001 182.1802 572.7793 v -175.9399 557.04 174.98 554.7793 v -192.6606 590.04 195.3799 591.2598 v -197.9409 592.6807 199.2607 592.6807 198.02 588.6201 c -196.6206 584.7607 196.1816 566.7197 193.2197 564.6201 c -201.9009 586.9609 201.1401 590.54 v -204.541 594.4395 207.1401 588.6201 v -205.9399 571.0996 l -210.7402 557.8994 l -208.0615 570.2402 209.7798 587.4199 v -207.6201 598.8418 211.9399 592.7002 v -216.4209 586.5195 226.981 579.9199 227.0601 574.7002 c -221.2617 594.001 211.2197 599.1797 v -206.6602 592.7002 l -205.46 594.8594 l -201.4614 595.7598 206.4199 603.2598 v -211.1406 610.7217 210.7402 611.6602 y -217.7407 603.6797 219.6201 603.7393 v -234.02 612.041 235.46 585.2598 v -242.8208 601.04 232.8198 608.54 v -216.4209 610.7217 217.7002 616.46 v -225.6201 630.1396 l -229.6206 635.8018 227.7798 632.7793 y -F -205.46 615.9795 m -191.3408 616.001 187.9399 610.2197 v -180.02 599.6602 l -198.8218 610.7217 203.2998 612.1396 v -207.6201 613.3613 205.46 615.9795 y -F -161.54 609.0195 m -159.2217 607.6396 158.8999 604.46 v -158.3408 601.4814 155.7007 601.04 156.5 597.9795 c -157.46 594.8818 159.6606 592.2412 159.6201 596.54 c -159.6606 601.04 161.4199 603.2402 162.2598 604.46 c -163.1816 605.8809 164.9409 610.7217 161.54 609.0195 c -F -151.7002 541.5801 m -142.501 546.041 138.98 549.9795 v -135.4614 553.9609 135.9585 548.2783 130.5801 548.7793 c -124.189 549.166 125.2998 566.7793 y -120.98 558.3799 l -119.6216 542.5205 128.4199 545.1797 v -132.7183 546.4492 134.1416 544.7217 132.5 543.7393 c -130.6206 542.96 138.541 542.5205 135.3799 540.8594 c -132.3799 539 148.2197 544.7217 145.7002 533.1797 c -151.7002 541.5801 l -F -137.7798 525.7393 m -120.9414 520.9609 116.8999 531.5 v -111.7017 528.8818 114.02 525.5 v -116.54 522.2813 117.8599 521.8994 y -123.7998 520.5195 123.1401 519.7393 v -122.48 518.7607 119.7798 514.9395 y -131.0601 521.6211 137.7798 525.7393 v -F -1 g -389.0605 439.8193 m -388.6523 437.4316 386.8135 436.5508 384.7402 435.7402 c -382.6133 436.8721 379.7559 440.29 377.7793 437.8994 c -377.1602 438.5479 376.3037 438.6123 375.8594 439.3398 c -375.4141 440.3311 375.7129 441.4805 375.3799 442.46 c -374.7363 443.7578 373.957 445.2607 374.1797 446.7803 c -376.1484 447.6025 376.8027 449.6982 376.3398 451.5801 c -376.2051 451.9209 375.7324 452.1387 375.8594 452.54 c -376.1582 452.8779 376.5078 453.1279 376.8203 453.5 c -376.6523 453.2715 376.4941 453.0146 376.3398 453.0195 c -375.7012 453.1543 375.8359 453.8545 375.8594 454.2197 c -376.623 456.2021 378.8379 456.4922 380.4199 455.1797 c -380.6025 455.8018 381.1621 455.5879 381.6201 455.6602 c -381.5859 456.2578 382.0352 456.8379 382.3398 457.3398 c -382.8223 458.5059 384.6152 457.2891 385.46 458.0596 c -386.6738 458.8711 387.8438 459.6416 389.0605 459.0195 c -391.0215 457.8633 392.9004 456.5313 394.0996 454.7002 c -394.8516 453.6963 395.1152 452.2881 395.0605 451.3398 c -395.0098 450.5215 393.4902 450.9102 393.1406 449.8994 c -392.4033 447.9658 394.417 447.3945 395.2998 445.8193 c -395.4678 445.5391 395.1777 445.2031 394.8203 445.0996 c -394.3789 444.9561 393.5166 445.165 393.6201 444.6201 c -394.7363 441.1514 391.7051 440.4082 389.0605 439.8193 c -F -378.5 418.2197 m -378.5527 420.1299 376.791 422.0645 378.0195 423.9795 c -378.2695 423.793 378.4141 423.5498 378.5 423.5 c -378.7109 423.5498 378.8555 423.793 378.9805 423.9795 c -380.6455 421.5029 384.6631 420.4805 384.5 417.2598 c -384.4834 416.8594 383.2881 415.8486 384.2598 415.0996 c -382.2871 413.6572 382.2266 411.0508 381.1406 408.8594 c -379.8398 409.2939 378.5078 409.6924 377.2998 410.2998 c -377.6289 411.9346 377.499 413.7871 378.5 415.3398 c -378.8789 416.0068 378.5645 417.1924 378.5 418.2197 c -F -0.8 g -195.8599 428.0596 m -177.1953 416.9697 192.7402 433.8193 v -202.3398 444.3994 213.3799 450.6201 y -224.7798 455.4004 228.7402 456.6201 v -232.7002 458.041 249.4209 463.7598 252.98 464.2998 c -256.46 464.6406 267.02 469.04 274.5801 464.54 c -281.9814 460.2412 290.8999 455.4199 y -272.7417 464.6406 268.8198 461.8994 v -264.8218 459.3604 256.9014 459.7998 250.3398 456.3799 c -234.02 451.4404 230.4199 449.1797 v -226.981 447.0391 215.54 434.2803 213.8599 435.2598 c -212.0215 436.04 214.2197 436.4795 215.54 439.5801 c -216.8599 442.6396 214.6616 444.3994 205.9399 437.4199 c -197.0601 430.3203 195.8599 428.0596 y -F -0 g -203.7798 434.7803 m -205.436 449.0264 214.8198 447.2598 v -223.8105 451.7842 226.8198 453.9795 v -235.7578 455.8203 237.1401 456.3799 v -257.5254 466.0684 273.7183 461.0986 274.3398 462.3799 c -274.9185 463.5605 296.5063 455.7314 300.5 451.3398 c -300.9082 450.749 289.2222 457.3945 278.6602 459.5 c -269.4536 461.249 245.6934 459.2021 233.7798 453.0195 c -230.4248 451.4521 220.585 445.0898 217.7002 445.0996 c -215.0166 445.335 203.7798 434.7803 y -F -0.8 g -199.7002 406.46 m -182.9814 409.2002 201.3799 411.0195 v -221.2617 413.1582 225.6201 418.9395 v -240.6201 429.001 243.6201 429.5 v -246.7808 429.8789 279.7808 437.7988 280.3398 440.54 c -280.6616 443.0791 286.8198 443.0791 288.5 442.2197 c -290.3408 441.3193 289.46 440 286.3398 439.0996 c -283.3018 438.2402 248.9814 420.2002 241.9399 418.9395 c -234.9009 417.5596 222.1401 409.2002 216.98 407.8994 c -211.5801 406.5586 199.7002 406.46 y -F -0 g -221.0601 414.6201 m -211.731 415.6113 221.2998 416.54 v -230.8906 420.2764 233.0601 423.2598 v -240.8047 428.3887 242.4199 428.54 v -243.9585 428.8369 259.3135 432.8936 259.46 434.2998 c -259.7646 435.5957 297.2383 449.4365 302.1802 445.8193 c -305.3022 443.6162 294.4111 445.46 283.7002 440.54 c -282.3223 439.9277 245.084 423.8818 241.46 423.2598 c -237.8745 422.5303 231.3418 418.251 228.7402 417.5 c -225.9346 416.8975 221.0601 414.6201 y -F -212.4199 412.2197 m -218.1802 412.7188 216.98 411.0195 v -215.54 409.2002 212.8999 410.0596 y -212.4199 412.2197 l -F -204.5 410.54 m -210.2598 410.96 209.0601 409.0996 v -207.6201 407.4395 204.98 408.3799 y -204.5 410.54 l -F -193.2197 408.8594 m -198.8218 409.2002 197.54 407.4199 v -196.1816 405.6797 193.46 406.46 y -193.2197 408.8594 l -F -184.8198 407.8994 m -190.46 408.3193 189.1401 406.46 v -187.8198 404.7988 185.2998 405.7402 y -184.8198 407.8994 l -F -227.0601 451.3398 m -231.8218 451.4404 230.4199 449.6602 v -229.1816 447.9199 225.6201 448.46 y -227.0601 451.3398 l -F -216.02 445.3398 m -223.1357 447.6338 220.3398 443.8994 v -219.0605 442.2002 216.5 443.1797 y -216.02 445.3398 l -F -203.7798 440.0596 m -209.3818 440.4395 208.1001 438.6201 v -206.7417 436.9209 204.02 437.8994 y -203.7798 440.0596 l -F -195.3799 433.3398 m -201.02 433.8389 199.7002 432.1396 v -198.3799 430.3203 195.8599 431.1797 y -195.3799 433.3398 l -F -187.9399 428.0596 m -193.5415 428.5586 192.2598 426.8594 v -190.9014 425.041 188.1802 425.8994 y -187.9399 428.0596 l -F -230.8999 421.0996 m -238.4238 421.6689 236.6602 419.4199 v -234.9102 416.9834 231.3799 418.2197 y -230.8999 421.0996 l -F -242.1802 426.3799 m -249.8647 426.9482 248.1802 424.7002 v -246.3511 422.2637 242.8999 423.5 y -242.1802 426.3799 l -F -254.1802 431.1797 m -261.7446 431.7891 259.9399 429.5 v -258.231 427.1045 254.6602 428.2998 y -254.1802 431.1797 l -F -265.46 436.46 m -273.1831 437.0693 271.46 434.7803 v -269.6694 432.3848 266.1802 433.5801 y -265.46 436.46 l -F -235.2197 456.3799 m -242.8232 456.8691 240.98 454.46 v -239.3096 452.1846 234.98 452.54 y -235.2197 456.3799 l -F -246.2598 459.7402 m -253.8247 460.3877 252.02 458.0596 v -250.311 455.7031 245.54 455.8994 y -246.2598 459.7402 l -F -221.2998 415.8193 m -226.981 416.2402 225.6201 414.3799 v -224.3408 412.7188 221.7798 413.6602 y -221.2998 415.8193 l -F -0.254902 0.941176 1 0.243137 k -140.6602 525.0195 m -135.9009 515.2393 135.3799 511.8193 v -136.3398 521.4004 137.7798 523.5801 v -138.98 525.7998 140.6602 525.0195 y -F -120.5 509.4199 m -116.9814 493.6807 117.3799 490.7002 v -116.1006 503.3594 116.6602 504.6201 v -116.9814 506 120.5 509.4199 y -F -0.8 g -143.2998 591.5 m -143.0601 588.1396 l -140.6602 587.8994 l -156.3608 573.9795 156.98 565.5801 v -157.9014 574.6396 143.2998 591.5 v -F -0 g -147.8599 590.2998 m -147.2891 590.6475 147.5288 591.4658 147.1401 591.7393 c -146.1919 592.3203 148.5078 592.3828 148.3398 593.1797 c -147.8359 594.4971 148.0425 594.5215 147.8599 595.8193 c -147.8457 596.5801 148.4912 598.2744 148.8198 598.7002 c -150.5073 600.5762 149.0503 603.8018 150.7402 605.4199 c -151.189 605.8252 151.6016 606.4326 151.9399 606.8594 c -152.6406 607.9521 153.9414 608.4893 155.0601 609.5 c -155.3384 609.7041 155.1152 610.6133 155.7798 610.46 c -156.5264 610.3857 157.8921 610.5293 157.9399 609.5 c -157.7192 607.2705 156.2578 605.3789 154.8198 603.5 c -155.3457 602.7705 154.8418 602.0713 154.5801 601.3398 c -153.0605 598.5771 153.2695 595.4502 153.1401 592.2197 c -153.0703 592.2344 152.7344 592.1475 152.6602 591.9795 c -153.1304 589.5225 153.7734 587.1025 154.8198 584.54 c -155.1416 583.6279 155.6602 582.6436 155.7798 581.6602 c -155.9478 580.8682 156.0605 579.9531 155.54 579.2598 c -157.8511 575.998 156.4111 573.082 157.7002 569.1797 c -157.9233 568.5098 159.7856 566.4053 159.3799 566.54 c -156.5117 567.54 156.3896 567.9775 156.2598 568.7002 c -156.0342 569.4922 155.6694 571.0059 155.2998 571.5801 c -155.3384 571.8486 155.1514 573.9219 155.0601 573.9795 c -153.4014 576.6748 154.8945 576.4834 153.3799 579.0195 c -151.8174 579.8232 150.7544 581.0381 149.54 582.3799 c -149.3022 582.54 150.5601 583.3369 150.2598 583.5801 c -149.1582 584.9912 147.8911 585.833 148.3398 587.4199 c -148.4312 588.2334 148.5801 589.3975 147.8599 590.2998 c -F -143.7798 588.3799 m -144.2598 580.8008 146.8999 579.0195 v -149.54 577.2793 148.2197 578.1602 144.7402 579.5 c -141.1807 580.8008 142.5801 581.6602 y -139.4214 581.2393 142.1001 579.0195 v -144.7017 576.8408 148.6616 574.2002 146.8999 574.2197 c -145.1406 574.2002 136.7817 578.5996 136.8198 581.6602 c -136.7817 584.7607 135.6201 589.3398 y -136.8896 590.1514 142.1001 590.0596 v -143.7104 589.2705 143.7798 588.3799 v -F -1 g -143.0601 567.7393 m -133.5679 570.8906 113.2998 567.2598 v -123.1733 569.4463 143.7798 567.0195 v -155.1514 565.5654 143.0601 567.7393 y -F -0 R -0 G -1 J 0.11 w 10 M -143.0601 567.7393 m -133.5679 570.8906 113.2998 567.2598 v -123.1733 569.4463 143.7798 567.0195 v -155.1514 565.5654 143.0601 567.7393 y -143.0601 567.7393 l -s -0 O -1 g -0 J 1 w 4 M -145.2197 567.9795 m -136.1768 571.7695 115.7002 569.8994 v -125.6982 571.2266 145.9399 567.0195 v -157.2178 564.5957 145.2197 567.9795 y -F -0 R -0 G -1 J 0.11 w 10 M -145.2197 567.9795 m -136.1768 571.7695 115.7002 569.8994 v -125.6982 571.2266 145.9399 567.0195 v -157.2178 564.5957 145.2197 567.9795 y -145.2197 567.9795 l -s -0 O -1 g -0 J 1 w 4 M -147.1401 567.7393 m -138.457 572.3311 117.8599 571.8193 v -127.9663 572.5713 147.8599 566.7793 v -158.9048 563.6113 147.1401 567.7393 y -F -0 R -0 G -1 J 0.11 w 10 M -147.1401 567.7393 m -138.457 572.3311 117.8599 571.8193 v -127.9663 572.5713 147.8599 566.7793 v -158.9048 563.6113 147.1401 567.7393 y -147.1401 567.7393 l -s -0 O -1 g -0 J 1 w 4 M -148.5801 567.5 m -141.1064 572.2881 122.6602 573.5 v -131.7178 573.3105 149.2998 566.54 v -158.7729 562.9014 148.5801 567.5 y -F -0 R -0 G -1 J 0.11 w 10 M -148.5801 567.5 m -141.1064 572.2881 122.6602 573.5 v -131.7178 573.3105 149.2998 566.54 v -158.7729 562.9014 148.5801 567.5 y -148.5801 567.5 l -s -0 O -1 g -0 J 1 w 4 M -275.54 555.9795 m -274.3999 555.2764 274.5801 556.46 v -274.8726 557.873 305.9023 572.3594 309.8594 572.0596 c -276.6055 557.5586 275.54 555.9795 v -F -0 R -0 G -1 J 0.11 w 10 M -275.54 555.9795 m -274.3999 555.2764 274.5801 556.46 v -274.8726 557.873 305.9023 572.3594 309.8594 572.0596 c -276.6055 557.5586 275.54 555.9795 v -275.54 555.9795 l -s -0 O -1 g -0 J 1 w 4 M -271.7002 555.2598 m -270.728 554.4941 270.98 555.7393 v -270.9922 557.1201 300.7881 574.001 304.8198 573.9795 c -272.7441 556.9424 271.7002 555.2598 v -F -0 R -0 G -1 J 0.11 w 10 M -271.7002 555.2598 m -270.728 554.4941 270.98 555.7393 v -270.9922 557.1201 300.7881 574.001 304.8198 573.9795 c -272.7441 556.9424 271.7002 555.2598 v -271.7002 555.2598 l -s -0 O -1 g -0 J 1 w 4 M -268.1001 553.8193 m -267.1665 552.9199 267.1401 554.2998 v -267.2578 555.5576 289.0566 572.6045 299.7798 574.7002 c -280.0161 565.7266 268.1001 553.8193 v -F -0 R -0 G -1 J 0.11 w 10 M -268.1001 553.8193 m -267.1665 552.9199 267.1401 554.2998 v -267.2578 555.5576 289.0566 572.6045 299.7798 574.7002 c -280.0161 565.7266 268.1001 553.8193 v -268.1001 553.8193 l -s -0 O -1 g -0 J 1 w 4 M -264.98 551.6602 m -264.0918 550.9561 264.02 552.1396 v -264.1758 553.3301 283.7935 568.6709 293.54 570.6201 c -275.6602 562.4814 264.98 551.6602 v -F -0 R -0 G -1 J 0.11 w 10 M -264.98 551.6602 m -264.0918 550.9561 264.02 552.1396 v -264.1758 553.3301 283.7935 568.6709 293.54 570.6201 c -275.6602 562.4814 264.98 551.6602 v -264.98 551.6602 l -s -0 O -0.8 g -0 J 1 w 4 M -230.1802 388.9395 m -213.3418 391.5986 231.8599 393.2598 v -251.6216 395.5586 256.1001 401.1797 v -270.98 411.3994 274.1001 411.7402 v -277.1406 412.2803 295.1816 416.2402 295.7002 418.9395 c -296.0601 421.5195 302.6602 424.1602 304.3398 423.2598 c -306.1807 422.4004 306.1807 412.2803 303.1401 411.5 c -300.02 410.5205 279.3418 402.6006 272.4199 401.1797 c -265.2607 399.958 252.5 391.5986 247.2197 390.3799 c -241.9399 388.959 230.1802 388.9395 y -F -0 g -310.3398 429.9795 m -307.0615 428.3408 305.7798 425.4199 v -298.7002 413.8203 282.98 410.2998 v -257.7798 400.3994 249.1401 398.2998 v -234.4614 392.7002 226.3398 393.5 v -218.6216 393.3584 225.3799 391.5801 v -247.6616 393.7998 251.2998 395.6602 v -268.5605 401.499 271.9399 404.2998 v -275.1606 407.2207 295.1816 412.7188 297.6201 414.8594 c -300.02 417.1201 310.8008 426.3584 310.3398 429.9795 c -F -245.7798 395.4199 m -251.5229 395.6865 250.3398 393.9795 v -248.9863 392.2783 246.2598 393.2598 y -245.7798 395.4199 l -F -237.8599 393.9795 m -243.5981 394.2002 242.4199 392.54 v -241.064 390.79 238.3398 391.8193 y -237.8599 393.9795 l -F -226.3398 392.54 m -232.1289 392.8281 230.8999 391.0996 v -229.5918 389.4199 226.8198 390.3799 y -226.3398 392.54 l -F -217.9399 392.0596 m -223.731 392.2275 222.5 390.6201 v -221.1943 388.8193 218.4199 389.8994 y -217.9399 392.0596 l -F -264.02 403.5801 m -271.6133 403.9082 270.02 401.6602 v -268.2368 399.3701 264.7402 400.7002 y -264.02 403.5801 l -F -275.2998 408.3799 m -281.8569 412.0762 281.2998 406.46 v -280.9736 403.6953 276.02 405.5 y -275.2998 408.3799 l -F -285.3799 411.5 m -293.2231 415.6113 291.3799 409.5801 v -290.4609 406.9063 286.1001 408.6201 y -285.3799 411.5 l -F -295.7002 416.7803 m -300.6079 422.2373 301.7002 414.8594 v -302.228 412.1162 296.4199 413.8994 y -295.7002 416.7803 l -F -254.4199 398.54 m -260.2686 398.8945 258.98 397.0996 v -257.7319 395.4844 255.1401 396.3799 y -254.4199 398.54 l -F -1 g -293.7798 532.2197 m -292.8799 531.4473 292.8198 532.7002 v -292.8774 533.8018 312.1113 548.3906 321.8594 549.9795 c -304.1289 542.5107 293.7798 532.2197 v -F -0 R -0 G -1 J 0.11 w 10 M -293.7798 532.2197 m -292.8799 531.4473 292.8198 532.7002 v -292.8774 533.8018 312.1113 548.3906 321.8594 549.9795 c -304.1289 542.5107 293.7798 532.2197 v -293.7798 532.2197 l -s -0 O -0 g -0 J 1 w 4 M -296.8999 461.8994 m -321.1426 437.3594 331.2197 433.3398 v -341.3818 421.0811 336.9805 392.54 v -333.4609 384.1201 330.0195 406.9395 v -333.4609 434.7197 321.1406 417.0195 v -311.9004 428.0098 318.9805 427.5801 v -322.4629 425.4795 322.8203 427.3398 v -323.3408 429.001 314.54 443.96 295.7002 459.7402 c -276.7017 475.6396 296.8999 461.8994 y -F -1 g -232.8198 419.4199 m -232.4814 421.2988 234.5 420.3799 v -236.4414 419.54 340.0615 412.7188 374.9004 386.2998 c -325.1025 411.8408 232.8198 419.4199 v -F -0 R -0 G -1 J 0.11 w 10 M -232.8198 419.4199 m -232.4814 421.2988 234.5 420.3799 v -236.4414 419.54 340.0615 412.7188 374.9004 386.2998 c -325.1025 411.8408 232.8198 419.4199 v -232.8198 419.4199 l -s -0 O -1 g -0 J 1 w 4 M -244.1001 424.2197 m -243.9199 426.1396 246.02 425.1797 v -247.8799 424.3809 398.1416 425.4795 424.0996 389.8994 c -399.9004 417.5596 244.1001 424.2197 v -F -0 R -0 G -1 J 0.11 w 10 M -244.1001 424.2197 m -243.9199 426.1396 246.02 425.1797 v -247.8799 424.3809 398.1416 425.4795 424.0996 389.8994 c -399.9004 417.5596 244.1001 424.2197 v -244.1001 424.2197 l -s -0 O -1 g -0 J 1 w 4 M -256.8198 428.54 m -256.6807 430.5391 258.7402 429.7402 v -260.6406 428.7803 451.3809 443.0791 477.3799 407.4199 c -466.7813 435.6006 256.8198 428.54 v -F -0 R -0 G -1 J 0.11 w 10 M -256.8198 428.54 m -256.6807 430.5391 258.7402 429.7402 v -260.6406 428.7803 451.3809 443.0791 477.3799 407.4199 c -466.7813 435.6006 256.8198 428.54 v -256.8198 428.54 l -s -0 O -1 g -0 J 1 w 4 M -267.8599 433.8193 m -267.6802 435.8193 269.7798 435.0195 v -271.6401 434.0596 406.0615 476.5205 432.0195 440.7803 c -417.2813 467.9404 267.8599 433.8193 v -F -0 R -0 G -1 J 0.11 w 10 M -267.8599 433.8193 m -267.6802 435.8193 269.7798 435.0195 v -271.6401 434.0596 406.0615 476.5205 432.0195 440.7803 c -417.2813 467.9404 267.8599 433.8193 v -267.8599 433.8193 l -s -0 O -1 g -0 J 1 w 4 M -204.02 408.8594 m -203.8809 410.7393 205.9399 409.8193 v -207.8408 408.9795 227.4199 406.5586 229.7002 363.9795 c -221.7007 410.0791 204.02 408.8594 v -F -0 R -0 G -1 J 0.11 w 10 M -204.02 408.8594 m -203.8809 410.7393 205.9399 409.8193 v -207.8408 408.9795 227.4199 406.5586 229.7002 363.9795 c -221.7007 410.0791 204.02 408.8594 v -204.02 408.8594 l -s -0 O -1 g -0 J 1 w 4 M -194.4199 406.9395 m -194.2017 408.9795 196.1001 408.1396 v -198.1616 407.2207 213.7808 412.2803 210.7402 369.5 c -212.0215 408.3193 194.4199 406.9395 v -F -0 R -0 G -1 J 0.11 w 10 M -194.4199 406.9395 m -194.2017 408.9795 196.1001 408.1396 v -198.1616 407.2207 213.7808 412.2803 210.7402 369.5 c -212.0215 408.3193 194.4199 406.9395 v -194.4199 406.9395 l -s -0 O -1 g -0 J 1 w 4 M -185.54 406.46 m -185.4009 408.541 187.46 407.6602 v -189.3608 406.7793 206.2998 406.1191 192.7402 381.5 c -203.2207 407.8809 185.54 406.46 v -F -0 R -0 G -1 J 0.11 w 10 M -185.54 406.46 m -185.4009 408.541 187.46 407.6602 v -189.3608 406.7793 206.2998 406.1191 192.7402 381.5 c -203.2207 407.8809 185.54 406.46 v -185.54 406.46 l -s -0 O -1 g -0 J 1 w 4 M -237.6201 455.4199 m -237.1904 453.1299 238.8198 454.46 v -256.5703 468.3555 292.2559 533.1484 353.54 539.4199 c -311.3691 552.668 237.6201 455.4199 v -F -0 R -0 G -1 J 0.11 w 10 M -237.6201 455.4199 m -237.1904 453.1299 238.8198 454.46 v -256.5703 468.3555 292.2559 533.1484 353.54 539.4199 c -311.3691 552.668 237.6201 455.4199 v -237.6201 455.4199 l -s -0 O -1 g -0 J 1 w 4 M -250.1001 457.3398 m -248.499 458.6211 250.5801 459.2598 v -252.6104 459.9971 376.2949 539.749 419.54 531.0195 c -389.6914 539.2471 250.1001 457.3398 v -F -0 R -0 G -1 J 0.11 w 10 M -250.1001 457.3398 m -248.499 458.6211 250.5801 459.2598 v -252.6104 459.9971 376.2949 539.749 419.54 531.0195 c -389.6914 539.2471 250.1001 457.3398 v -250.1001 457.3398 l -s -0 O -1 g -0 J 1 w 4 M -227.0601 450.6201 m -226.5151 448.8389 228.5 449.8994 v -238.2681 455.5449 242.2446 518.4746 290.1802 519.7402 c -254.5278 536.043 227.0601 450.6201 v -F -0 R -0 G -1 J 0.11 w 10 M -227.0601 450.6201 m -226.5151 448.8389 228.5 449.8994 v -238.2681 455.5449 242.2446 518.4746 290.1802 519.7402 c -254.5278 536.043 227.0601 450.6201 v -227.0601 450.6201 l -s -0 O -1 g -0 J 1 w 4 M -205.2197 438.3799 m -203.9746 437.0547 206.1802 437.4199 v -217.3926 438.7998 240.9365 484.1953 289.9399 478.7002 c -254.6577 494.3906 205.2197 438.3799 v -F -0 R -0 G -1 J 0.11 w 10 M -205.2197 438.3799 m -203.9746 437.0547 206.1802 437.4199 v -217.3926 438.7998 240.9365 484.1953 289.9399 478.7002 c -254.6577 494.3906 205.2197 438.3799 v -205.2197 438.3799 l -s -0 O -1 g -0 J 1 w 4 M -217.46 445.0996 m -216.6294 443.5898 218.6602 444.3799 v -229.4624 447.8818 243.855 496.9521 292.8198 500.7803 c -255.3633 509.5928 217.46 445.0996 v -F -0 R -0 G -1 J 0.11 w 10 M -217.46 445.0996 m -216.6294 443.5898 218.6602 444.3799 v -229.4624 447.8818 243.855 496.9521 292.8198 500.7803 c -255.3633 509.5928 217.46 445.0996 v -217.46 445.0996 l -s -0 O -1 g -0 J 1 w 4 M -197.2998 432.8594 m -196.4551 431.6914 198.2598 431.8994 v -207.3247 433.1045 226.395 469.877 265.9399 465.2598 c -237.5098 478.1338 197.2998 432.8594 v -F -0 R -0 G -1 J 0.11 w 10 M -197.2998 432.8594 m -196.4551 431.6914 198.2598 431.8994 v -207.3247 433.1045 226.395 469.877 265.9399 465.2598 c -237.5098 478.1338 197.2998 432.8594 v -197.2998 432.8594 l -s -0 O -1 g -0 J 1 w 4 M -189.1401 426.3799 m -187.9497 425.1895 189.6201 425.4199 v -194.2856 425.6572 227.9863 462.0459 248.4199 445.0996 c -235.0854 465.5889 189.1401 426.3799 v -F -0 R -0 G -1 J 0.11 w 10 M -189.1401 426.3799 m -187.9497 425.1895 189.6201 425.4199 v -194.2856 425.6572 227.9863 462.0459 248.4199 445.0996 c -235.0854 465.5889 189.1401 426.3799 v -189.1401 426.3799 l -s -0 O -1 g -0 J 1 w 4 M -265.46 461.4199 m -264.2192 462.9434 266.4199 463.3398 v -268.4697 463.791 401.2441 527.2734 443.0605 513.0195 c -414.4668 525.082 265.46 461.4199 v -F -0 R -0 G -1 J 0.11 w 10 M -265.46 461.4199 m -264.2192 462.9434 266.4199 463.3398 v -268.4697 463.791 401.2441 527.2734 443.0605 513.0195 c -414.4668 525.082 265.46 461.4199 v -265.46 461.4199 l -s -0 O -1 g -0 J 1 w 4 M -228.7402 390.6201 m -228.5215 392.7002 230.4199 391.8193 v -232.4814 390.9395 249.4209 390.2793 235.7002 365.6602 c -246.3418 392.041 228.7402 390.6201 v -F -0 R -0 G -1 J 0.11 w 10 M -228.7402 390.6201 m -228.5215 392.7002 230.4199 391.8193 v -232.4814 390.9395 249.4209 390.2793 235.7002 365.6602 c -246.3418 392.041 228.7402 390.6201 v -228.7402 390.6201 l -s -0 O -1 g -0 J 1 w 4 M -240.2598 392.54 m -239.96 394.46 241.9399 393.5 v -243.9199 392.7002 263.5015 390.2793 265.7002 347.6602 c -257.7798 393.7998 240.2598 392.54 v -F -0 R -0 G -1 J 0.11 w 10 M -240.2598 392.54 m -239.96 394.46 241.9399 393.5 v -243.9199 392.7002 263.5015 390.2793 265.7002 347.6602 c -257.7798 393.7998 240.2598 392.54 v -240.2598 392.54 l -s -0 O -1 g -0 J 1 w 4 M -247.7002 394.2197 m -247.4409 396.2188 249.3799 395.4199 v -251.4009 394.46 278.4609 390.7207 304.3398 355.0996 c -265.2607 395.5586 247.7002 394.2197 v -F -0 R -0 G -1 J 0.11 w 10 M -247.7002 394.2197 m -247.4409 396.2188 249.3799 395.4199 v -251.4009 394.46 278.4609 390.7207 304.3398 355.0996 c -265.2607 395.5586 247.7002 394.2197 v -247.7002 394.2197 l -s -0 O -1 g -0 J 1 w 4 M -256.1001 396.3799 m -255.5674 398.4053 257.54 397.8193 v -259.7266 397.1865 282.2021 399.2764 324.0195 361.5801 c -273.3174 400.1191 256.1001 396.3799 v -F -0 R -0 G -1 J 0.11 w 10 M -256.1001 396.3799 m -255.5674 398.4053 257.54 397.8193 v -259.7266 397.1865 282.2021 399.2764 324.0195 361.5801 c -273.3174 400.1191 256.1001 396.3799 v -256.1001 396.3799 l -s -0 O -1 g -0 J 1 w 4 M -267.3799 401.4199 m -267.0078 403.2461 269.0601 402.6201 v -271.165 402.0273 309.4834 397.0762 366.2598 358.7002 c -284.7559 404.96 267.3799 401.4199 v -F -0 R -0 G -1 J 0.11 w 10 M -267.3799 401.4199 m -267.0078 403.2461 269.0601 402.6201 v -271.165 402.0273 309.4834 397.0762 366.2598 358.7002 c -284.7559 404.96 267.3799 401.4199 v -267.3799 401.4199 l -s -0 O -1 g -0 J 1 w 4 M -222.98 414.1396 m -222.7998 416.0186 224.8999 415.0996 v -226.7598 414.2598 285.5 411.3994 318.9805 381.9795 c -280.5488 409.1719 222.98 414.1396 v -F -0 R -0 G -1 J 0.11 w 10 M -222.98 414.1396 m -222.7998 416.0186 224.8999 415.0996 v -226.7598 414.2598 285.5 411.3994 318.9805 381.9795 c -280.5488 409.1719 222.98 414.1396 v -222.98 414.1396 l -s -0 O -1 g -0 J 1 w 4 M -211.9399 409.5801 m -211.8008 411.6201 213.8599 410.7803 v -215.7607 409.8584 242.8208 406.1191 268.8198 370.46 c -229.6206 410.96 211.9399 409.5801 v -F -0 R -0 G -1 J 0.11 w 10 M -211.9399 409.5801 m -211.8008 411.6201 213.8599 410.7803 v -215.7607 409.8584 242.8208 406.1191 268.8198 370.46 c -229.6206 410.96 211.9399 409.5801 v -211.9399 409.5801 l -s -0 O -1 g -0 J 1 w 4 M -279.3799 406.46 m -278.833 408.2764 281.0601 407.8994 v -283.0688 407.3672 321.6465 405.2354 381.1406 370.9395 c -295.748 408.8672 279.3799 406.46 v -F -0 R -0 G -1 J 0.11 w 10 M -279.3799 406.46 m -278.833 408.2764 281.0601 407.8994 v -283.0688 407.3672 321.6465 405.2354 381.1406 370.9395 c -295.748 408.8672 279.3799 406.46 v -279.3799 406.46 l -s -0 O -1 g -0 J 1 w 4 M -288.7402 409.0996 m -288.0728 410.917 290.1802 410.54 v -292.3086 410.0068 330.8867 407.876 390.5 373.5801 c -305.6479 411.9463 288.7402 409.0996 v -F -0 R -0 G -1 J 0.11 w 10 M -288.7402 409.0996 m -288.0728 410.917 290.1802 410.54 v -292.3086 410.0068 330.8867 407.876 390.5 373.5801 c -305.6479 411.9463 288.7402 409.0996 v -288.7402 409.0996 l -s -0 O -1 g -0 J 1 w 4 M -299.2998 414.6201 m -298.6328 416.415 300.7402 416.0596 v -302.8687 415.5049 350.2471 410.7363 449.0605 373.0996 c -316.208 417.4473 299.2998 414.6201 v -F -0 R -0 G -1 J 0.11 w 10 M -299.2998 414.6201 m -298.6328 416.415 300.7402 416.0596 v -302.8687 415.5049 350.2471 410.7363 449.0605 373.0996 c -316.208 417.4473 299.2998 414.6201 v -299.2998 414.6201 l -s -0 O -0 g -0 J 1 w 4 M -176.8999 406.9395 m -182.54 407.4395 181.2197 405.7402 v -179.8999 403.9209 177.3799 404.7803 y -176.8999 406.9395 l -F -210.7402 391.5801 m -216.4209 392.041 215.0601 390.3799 v -213.7808 388.5195 211.2197 389.4199 y -210.7402 391.5801 l -F -201.1401 392.0596 m -206.7417 392.4795 205.46 390.6201 v -204.1016 388.959 201.3799 389.8994 y -201.1401 392.0596 l -F -96.02 405.0195 m -101.665 403.585 99.8599 402.3799 v -98.0166 401.1221 95.7798 402.8594 y -96.02 405.0195 l -F -98.4199 415.5801 m -103.8633 414.1445 102.02 412.9395 v -100.2178 411.6826 97.9399 413.4199 y -98.4199 415.5801 l -F -90.5 420.3799 m -95.9434 418.9854 94.1001 417.7402 v -92.2974 416.5225 90.02 418.2197 y -90.5 420.3799 l -F -0.8 g -178.1001 337.8193 m -176.3818 337.9209 172.1001 335.6602 v -169.7817 335.7197 157.46 331.7598 151.2197 320.7803 c -164.9409 331.3203 178.1001 337.8193 v -F -274.5801 236.0596 m -274.7842 235.7266 274.8438 235.2627 275.0601 235.3398 c -275.8877 235.2002 277.2441 234.8691 277.2197 235.5801 c -276.1733 240.3057 275.2134 245.7363 270.7402 247.8193 c -269.9648 248.0313 268.3784 247.5771 268.3398 246.6201 c -268.1553 244.9277 268.0278 243.4443 268.3398 241.8193 c -268.6978 240.2695 271.0713 240.2578 272.1802 241.8193 c -273.1113 239.9404 273.5864 237.9121 274.5801 236.0596 c -F -262.3398 230.7803 m -263.2666 229.2461 263.125 227.2012 264.7402 226.7002 c -265.4961 226.2607 267.5313 227.333 267.1401 228.6201 c -266.1895 230.7803 265.7622 233.2441 264.2598 235.3398 c -264.0151 235.5244 264.2769 236.1104 264.02 236.54 c -263.4487 237.8115 262.189 238.623 260.6602 238.2197 c -259.4146 235.8369 260.6768 233.4941 262.3398 231.5 c -262.501 231.4473 262.3184 231.0342 262.3398 230.7803 c -F -218.8999 236.54 m -218.7607 236.9258 218.7197 237.4346 218.8999 237.7393 c -219.4854 238.9229 220.3569 240.1592 220.1001 241.3398 c -219.603 242.4434 218.377 242.2441 217.7002 241.5801 c -216.4136 240.5234 216.3584 238.5146 215.54 237.0195 c -215.3838 236.5947 215.4395 235.9658 215.0601 235.5801 c -214.4336 235.0732 213.9487 233.3955 214.1001 232.7002 c -214.1118 232.4238 213.9102 221.5254 214.1001 221.8994 c -214.8369 222.6201 218.1919 233.3291 218.1802 234.3799 c -218.3311 235.1143 219.1353 235.625 218.8999 236.54 c -F -190.5801 243.9795 m -193.5752 246.7305 196.6445 249.9893 196.1001 254.0596 c -196.0303 255.1445 194.0767 254.5664 193.9399 253.5801 c -192.9897 249.6465 190.748 246.7207 187.9399 243.9795 c -185.5063 241.8369 183.459 234.8594 183.1401 234.3799 c -187.2681 240.082 189.7495 243.1016 190.5801 243.9795 c -F -175.7002 250.46 m -176.3218 250.9492 175.9902 251.4893 176.1802 251.8994 c -177.2769 253.457 178.707 254.8281 178.8198 256.7002 c -178.731 257.0449 178.3159 257.3857 177.8599 257.1797 c -177.6416 256.9375 177.2646 256.793 177.1401 256.7002 c -174.915 253.957 173.3745 251.0186 171.8599 247.8193 c -171.5864 247.5322 170.3262 242.5928 170.6602 242.54 c -170.9336 242.377 172.8271 246.9746 173.0601 247.0996 c -174.4473 247.8555 174.459 249.6318 175.7002 250.46 c -F -194.1802 229.0996 m -194.6406 230 196.3735 231.3223 196.3398 232.2197 c -196.1216 233.3213 196.6353 234.9082 195.6201 234.1396 c -194.2495 233.1074 190.4551 231.625 190.1001 225.2598 c -190.1313 224.6064 193.4023 227.5713 194.1802 229.0996 c -F -210.02 247.8193 m -210.481 248.6738 211.2583 248.1533 211.7002 248.54 c -212.4775 248.8516 213.1494 249.4658 213.3799 250.2197 c -214.5366 252.543 216.4834 254.5469 216.7402 257.1797 c -215 258.7256 214.2534 256.4814 213.6201 255.5 c -212.1055 257.2305 211.0063 255.1709 209.54 254.54 c -209.499 254.5684 209.2642 254.9502 209.2998 255.0195 c -207.8862 254.4365 207.1401 253.2461 205.9399 252.3799 c -205.8535 252.2402 205.4097 252.4395 205.2197 252.3799 c -204.5288 251.626 203.4585 251.2686 203.0601 250.46 c -201.9297 247.541 198.4761 245.2354 196.3398 237.0195 c -196.8198 235.9395 201.3633 244.2461 201.8599 244.9395 c -202.8198 246.3291 202.9497 243.1875 204.2598 243.9795 c -204.4087 243.9482 204.6128 243.6865 204.7402 243.5 c -204.9727 243.8477 205.2129 244.0996 205.7002 243.9795 c -205.6401 244.4189 205.4937 245.0313 205.7002 245.1797 c -207.0752 246.2813 206.9814 247.4551 207.8599 248.7803 c -208.3447 247.9521 209.5112 248.7412 210.02 247.8193 c -F -275.7798 188.0596 m -283.9614 210.54 279.1401 222.8594 v -291.6606 199.0996 286.5801 186.8594 v -286.1602 198.2188 281.7798 203.6602 v -277.3613 189.6387 275.7798 188.0596 v -F -259.46 190.9395 m -265.4814 200.6406 256.5801 220.9395 v -255.7998 198.4395 248.4199 186.3799 v -263.9409 208.5605 259.46 190.9395 v -F -248.6602 193.0996 m -248.3218 215.1602 248.6602 218.54 v -244.5801 200.1992 233.2998 189.7393 v -249.2002 202.8389 248.6602 193.0996 v -F -238.1001 228.3799 m -244.5801 213.3994 233.54 193.0996 v -240.6201 206.5781 235.46 214.2197 v -238.2007 218.0186 238.1001 228.3799 v -F -216.98 193.5801 m -215.7607 210.7588 217.7002 213.2598 v -217.9614 220.2197 217.46 221.4199 v -221.9214 228.1396 222.2598 219.9795 v -223.6807 211.4189 226.8198 206.2998 v -230.7197 200.4199 230.4199 193.3398 v -219.5 226.5986 216.98 193.5801 v -F -212.8999 224.0596 m -205.6401 212.0791 203.7798 191.1797 v -202.1216 198.001 206.4199 213.7393 v -210.9199 230.7803 212.8999 224.0596 v -F -188.8999 202.2197 m -194.4199 208.1191 195.8599 213.5 v -199.9209 231.001 192.98 221.4199 v -193.1001 212.7393 184.1001 204.6201 v -189.3608 207.2402 188.8999 202.2197 v -F -182.6602 207.7393 m -186.2817 226.8193 187.2197 227.6602 v -189.1401 231.4395 186.02 227.8994 v -176.3818 206.7988 172.1001 199.5801 v -180.7808 209.6602 182.6602 207.7393 v -F -176.1802 225.9795 m -188.9214 250.5801 164.8999 222.1396 v -177.0415 232.9785 176.1802 225.9795 v -F -159.1401 242.0596 m -164.5015 262.6777 167.2998 262.46 v -176.3818 272.3594 169.2197 260.7803 v -162.5215 250.1406 163.2197 239.4199 v -162.5215 249.9199 159.1401 242.0596 v -F -522.5 254.54 m -509.3496 265.541 506.6602 269.4199 v -521.4512 249.041 521.54 241.3398 v -524.2012 249.5908 522.5 254.54 v -F -528.5 278.7803 m -505.501 295.2412 501.6201 303.5 v -530.8018 271.04 530.9004 266.0596 v -531.3516 275.9912 528.5 278.7803 v -F -547.2197 448.2197 m -534.1016 456.9414 532.3398 454.7002 v -544.002 447.5908 546.7402 438.1396 v -545.1006 448.1406 547.2197 448.2197 v -F -556.5801 359.6602 m -537.3799 372.8594 l -558.3008 354.0918 558.7402 349.5801 v -556.5801 359.6602 l -F -*u -0 R -0 G -1 J 1.1 w 10 M -126.7402 384.3799 m -150.98 379.0996 l -S -1 D -182.1802 206.0596 m -181.5513 209.9912 171.6201 198.3799 v -S -188.1802 200.54 m -190.3496 207.79 183.1401 202.9395 v -S -247.46 191.1797 m -249.2002 203.3906 236.6602 189.0195 v -S -*U -U -%%PageTrailer -gsave annotatepage grestore showpage -%%Trailer -Adobe_Illustrator_AI3 /terminate get exec -Adobe_pattern_AI3 /terminate get exec -Adobe_customcolor /terminate get exec -Adobe_cshow /terminate get exec -Adobe_cmykcolor /terminate get exec -Adobe_packedarray /terminate get exec -%%EOF diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tux.svg b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tux.svg deleted file mode 100644 index de8c869688..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/images/tux.svg +++ /dev/null @@ -1,1487 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="500pt" - height="600pt" - id="svg5620" - sodipodi:version="0.32" - inkscape:version="0.46" - sodipodi:docname="mh_inksc_100511_NewTux.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape" - inkscape:export-filename="/media/disk/※T h i n g S/UB SOFTWARE/Openclipart/mh_inksc_100511_NewTux.png" - inkscape:export-xdpi="150.03999" - inkscape:export-ydpi="150.03999"> - <metadata - id="metadata5712"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - </cc:Work> - </rdf:RDF> - </metadata> - <sodipodi:namedview - inkscape:window-height="728" - inkscape:window-width="1280" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - guidetolerance="10.0" - gridtolerance="10.0" - objecttolerance="10.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - showgrid="false" - inkscape:zoom="0.65866667" - inkscape:cx="837.03841" - inkscape:cy="362.33556" - inkscape:window-x="0" - inkscape:window-y="24" - inkscape:current-layer="svg5620" - showguides="true" - inkscape:guide-bbox="true" /> - <defs - id="defs5622"> - <linearGradient - id="linearGradient6810"> - <stop - id="stop6812" - offset="0" - style="stop-color:#ffffff;stop-opacity:0.04385965;" /> - <stop - style="stop-color:#ffffff;stop-opacity:0.35964912;" - offset="0.46429399" - id="stop6816" /> - <stop - id="stop6814" - offset="1" - style="stop-color:#ffffff;stop-opacity:0;" /> - </linearGradient> - <inkscape:perspective - sodipodi:type="inkscape:persp3d" - inkscape:vp_x="0 : 375 : 1" - inkscape:vp_y="0 : 1000 : 0" - inkscape:vp_z="625 : 375 : 1" - inkscape:persp3d-origin="312.5 : 250 : 1" - id="perspective5714" /> - <linearGradient - id="linearGradient172"> - <stop - style="stop-color:#3f2600;stop-opacity:0.6;" - offset="0" - id="stop173" /> - <stop - style="stop-color:#3f2600;stop-opacity:0;" - offset="1" - id="stop174" /> - </linearGradient> - <linearGradient - id="linearGradient167"> - <stop - style="stop-color:#ffffff;stop-opacity:0.65;" - offset="0" - id="stop168" /> - <stop - style="stop-color:#ffffff;stop-opacity:0;" - offset="1" - id="stop169" /> - </linearGradient> - <linearGradient - id="linearGradient162"> - <stop - style="stop-color:#ffa63f;stop-opacity:1;" - offset="0" - id="stop163" /> - <stop - style="stop-color:#ffff00;stop-opacity:1;" - offset="1" - id="stop164" /> - </linearGradient> - <linearGradient - id="linearGradient153"> - <stop - style="stop-color:#ffeed7;stop-opacity:1;" - offset="0" - id="stop154" /> - <stop - style="stop-color:#bdbfc2;stop-opacity:1;" - offset="1" - id="stop155" /> - </linearGradient> - <linearGradient - id="linearGradient138"> - <stop - style="stop-color:#ffffff;stop-opacity:0.8;" - offset="0" - id="stop139" /> - <stop - style="stop-color:#ffffff;stop-opacity:0;" - offset="1" - id="stop140" /> - </linearGradient> - <linearGradient - xlink:href="#linearGradient138" - id="linearGradient141" - x1="0.47424799" - y1="0.020191999" - x2="0.417539" - y2="0.90125799" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient142" - x1="0.55880702" - y1="0.031192999" - x2="0.553922" - y2="0.94531101" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient143" - x1="0.46557701" - y1="0.028819799" - x2="0.41365999" - y2="0.93366498" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient144" - x1="0.70346397" - y1="0.059404202" - x2="0.64553201" - y2="0.94063401" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient145" - x1="0.46741399" - y1="-0.036155298" - x2="0.86741799" - y2="0.75857902" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient146" - x1="0.57152498" - y1="0.023441499" - x2="0.57143003" - y2="0.71875" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient147" - x1="0.5" - y1="0.0234362" - x2="0.5" - y2="0.8125" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient148" - x1="0.50799799" - y1="0.37435901" - x2="0.51599997" - y2="0.92820501" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient138" - id="linearGradient149" - x1="0.5" - y1="0.131707" - x2="0.50400001" - y2="0.94634098" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient150" - x1="-0.30509499" - y1="0.099496603" - x2="0.156323" - y2="0.94191301" - gradientUnits="objectBoundingBox" - gradientTransform="matrix(-0.928523,0.283938,0.435332,0.943857,-1.91327e-7,5.49908e-8)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient151" - x1="0.433979" - y1="0.022184599" - x2="0.487055" - y2="1.02569" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient152" - x1="0.5" - y1="0.89842999" - x2="0.5" - y2="0.40625" - gradientUnits="objectBoundingBox" - spreadMethod="reflect" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient156" - x1="0.43568701" - y1="0.98882002" - x2="0.453989" - y2="0.23093501" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient157" - x1="0.49180499" - y1="1.15284" - x2="0.49482101" - y2="0.41252401" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient158" - x1="0.51730198" - y1="0.85418499" - x2="0.49843901" - y2="0.136172" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient159" - x1="0.46201" - y1="0.87917101" - x2="0.49215299" - y2="0.096282303" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient161" - x1="0.50086302" - y1="0.34872901" - x2="0.41209599" - y2="0.98558098" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient165" - x1="0.60399801" - y1="0.51020199" - x2="0.46399999" - y2="0.98367399" - gradientUnits="objectBoundingBox" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient166" - x1="0.50000501" - y1="0.191616" - x2="0.50800002" - y2="0.97005898" - gradientUnits="objectBoundingBox" /> - <radialGradient - xlink:href="#linearGradient172" - id="radialGradient171" - cx="0.5" - cy="0.5" - fx="0.5" - fy="0.5" - r="0.5" - gradientUnits="objectBoundingBox" /> - <radialGradient - xlink:href="#linearGradient172" - id="radialGradient176" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient178" - x1="0.94027299" - y1="1.2934099" - x2="0.19452" - y2="-0.675295" - gradientUnits="objectBoundingBox" /> - <radialGradient - xlink:href="#linearGradient172" - id="radialGradient1399" - gradientTransform="scale(1.045233,0.956725)" - cx="446.77762" - cy="1219.4125" - fx="446.77762" - fy="1219.4125" - r="195.07191" - gradientUnits="userSpaceOnUse" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1401" - gradientUnits="userSpaceOnUse" - x1="400.57785" - y1="369.53015" - x2="400.84448" - y2="304.07886" - gradientTransform="scale(0.575262,1.738339)" /> - <linearGradient - xlink:href="#linearGradient138" - id="linearGradient1403" - gradientUnits="userSpaceOnUse" - x1="303.01761" - y1="237.93179" - x2="297.0856" - y2="330.09561" - gradientTransform="scale(1.116071,0.896001)" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1405" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="378.93771" - y1="278.60202" - x2="380.27319" - y2="243.91606" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1407" - gradientUnits="userSpaceOnUse" - x1="381.38742" - y1="277.495" - x2="380.5517" - y2="245.68338" - gradientTransform="scale(0.816497,1.224744)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1409" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="379.09573" - y1="240.92712" - x2="376.79556" - y2="281.01636" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1411" - gradientUnits="userSpaceOnUse" - x1="389.63535" - y1="242.28218" - x2="387.06866" - y2="281.32513" - gradientTransform="scale(0.816497,1.224744)" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1413" - gradientUnits="userSpaceOnUse" - spreadMethod="reflect" - x1="437.57941" - y1="528.87177" - x2="437.57941" - y2="394.10361" - gradientTransform="scale(0.812855,1.230232)" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1415" - gradientUnits="userSpaceOnUse" - x1="375.17325" - y1="419.78485" - x2="377.48541" - y2="324.03815" - gradientTransform="scale(0.649784,1.538974)" /> - <linearGradient - xlink:href="#linearGradient138" - id="linearGradient1417" - gradientUnits="userSpaceOnUse" - x1="320.75104" - y1="498.17776" - x2="321.32224" - y2="614.50439" - gradientTransform="scale(1.074798,0.930408)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1419" - gradientUnits="userSpaceOnUse" - x1="322.48257" - y1="435.26761" - x2="323.2514" - y2="488.48251" - gradientTransform="scale(1.077001,0.928504)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1421" - gradientUnits="userSpaceOnUse" - x1="411.2215" - y1="242.94365" - x2="411.2215" - y2="331.44858" - gradientTransform="scale(0.571707,1.749147)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1423" - gradientUnits="userSpaceOnUse" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" - gradientTransform="scale(0.572667,1.746214)" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient1425" - gradientUnits="userSpaceOnUse" - x1="236.25362" - y1="657.11133" - x2="212.5099" - y2="737.41229" - gradientTransform="scale(1.011514,0.988617)" /> - <linearGradient - xlink:href="#linearGradient153" - id="linearGradient1427" - gradientUnits="userSpaceOnUse" - x1="381.56607" - y1="655.73102" - x2="279.64313" - y2="386.66583" - gradientTransform="scale(1.065499,0.938527)" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient1429" - gradientUnits="userSpaceOnUse" - x1="218.11714" - y1="630.30475" - x2="203.12654" - y2="737.8537" - gradientTransform="scale(1.009851,0.990245)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1431" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.007724,0.992335)" - x1="117.88966" - y1="587.23602" - x2="182.24524" - y2="704.73077" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1433" - gradientUnits="userSpaceOnUse" - x1="223.10072" - y1="570.41809" - x2="230.53499" - y2="710.97723" - gradientTransform="scale(0.999504,1.000496)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1435" - gradientUnits="userSpaceOnUse" - x1="316.93988" - y1="474.01779" - x2="371.60889" - y2="582.63507" - gradientTransform="scale(1.065499,0.938527)" /> - <linearGradient - xlink:href="#linearGradient162" - id="linearGradient1437" - gradientUnits="userSpaceOnUse" - x1="284.68652" - y1="410.46326" - x2="285.45923" - y2="485.69934" - gradientTransform="scale(1.218684,0.820557)" /> - <linearGradient - xlink:href="#linearGradient167" - id="linearGradient1439" - gradientUnits="userSpaceOnUse" - x1="288.82358" - y1="398.85422" - x2="288.37628" - y2="482.55939" - gradientTransform="scale(1.221941,0.81837)" /> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient172" - id="radialGradient5844" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.045233,0.956725)" - cx="446.77762" - cy="1219.4125" - fx="446.77762" - fy="1219.4125" - r="195.07191" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5846" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.575262,1.738339)" - x1="400.57785" - y1="369.53015" - x2="400.84448" - y2="304.07886" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient5848" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.116071,0.896001)" - x1="303.01761" - y1="237.93179" - x2="297.0856" - y2="330.09561" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5850" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="378.93771" - y1="278.60202" - x2="380.27319" - y2="243.91606" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5852" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="381.38742" - y1="277.495" - x2="380.5517" - y2="245.68338" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5854" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="379.09573" - y1="240.92712" - x2="376.79556" - y2="281.01636" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5856" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.816497,1.224744)" - x1="389.63535" - y1="242.28218" - x2="387.06866" - y2="281.32513" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5858" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.812855,1.230232)" - spreadMethod="reflect" - x1="437.57941" - y1="528.87177" - x2="437.57941" - y2="394.10361" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5860" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.649784,1.538974)" - x1="375.17325" - y1="419.78485" - x2="377.48541" - y2="324.03815" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient5862" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.074798,0.930408)" - x1="320.75104" - y1="498.17776" - x2="321.32224" - y2="614.50439" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5864" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.077001,0.928504)" - x1="322.48257" - y1="435.26761" - x2="323.2514" - y2="488.48251" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5866" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.571707,1.749147)" - x1="411.2215" - y1="242.94365" - x2="411.2215" - y2="331.44858" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5868" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.572667,1.746214)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5870" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.011514,0.988617)" - x1="236.25362" - y1="657.11133" - x2="212.5099" - y2="737.41229" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5872" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.065499,0.938527)" - x1="381.56607" - y1="655.73102" - x2="279.64313" - y2="386.66583" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5874" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.009851,0.990245)" - x1="218.11714" - y1="630.30475" - x2="203.12654" - y2="737.8537" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5876" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.007724,0.992335)" - x1="117.88966" - y1="587.23602" - x2="182.24524" - y2="704.73077" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5878" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(0.999504,1.000496)" - x1="223.10072" - y1="570.41809" - x2="230.53499" - y2="710.97723" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5880" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.065499,0.938527)" - x1="316.93988" - y1="474.01779" - x2="371.60889" - y2="582.63507" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5882" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.218684,0.820557)" - x1="284.68652" - y1="410.46326" - x2="285.45923" - y2="485.69934" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5884" - gradientUnits="userSpaceOnUse" - gradientTransform="scale(1.221941,0.81837)" - x1="288.82358" - y1="398.85422" - x2="288.37628" - y2="482.55939" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5936" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(6.8689234e-2,-0.4008691,0.3415516,4.336381e-2,-313.66484,483.36861)" - x1="316.93988" - y1="474.01779" - x2="371.60889" - y2="582.63507" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5949" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.6373879,0.286176,-0.2248927,0.5792711,-190.14391,-154.55792)" - x1="381.56607" - y1="655.73102" - x2="279.64313" - y2="386.66583" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5992" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.9649387,-1.2915552e-2,-3.6719978e-2,2.5569228,169.00168,-594.11178)" - x1="400.57785" - y1="369.53015" - x2="400.84448" - y2="304.07886" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient6820" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.1593287,2.2594958e-2,6.8898041e-2,-0.4858355,313.34561,293.76431)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient6824" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.184254,-0.3061768,0.2434767,-0.1724949,439.82488,377.41134)" - x1="294.40485" - y1="481.32233" - x2="371.60889" - y2="582.63507" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2514" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(7.6104436e-3,-0.1875898,0.5720113,2.3206217e-2,1167.6399,-164.81318)" - x1="892.69696" - y1="258.28925" - x2="564.89618" - y2="281.90463" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2517" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2316272,0.2342907,0.7144146,-0.7062927,960.97808,-166.19015)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2520" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7672384,0,0,0.4874752,936.37068,-466.38275)" - x1="288.82358" - y1="398.85422" - x2="288.37628" - y2="482.55939" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient2524" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.523355,0,0,1.0256962,729.45868,-685.70504)" - x1="284.68652" - y1="410.46326" - x2="285.45923" - y2="485.69934" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2527" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0038119,-5.2260066e-2,-1.740863e-2,1.0462687,788.19568,-546.66535)" - x1="223.10072" - y1="570.41809" - x2="230.53499" - y2="710.97723" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2530" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.9523959,0.3464001,0.4208255,0.9487298,1258.3327,-582.54204)" - x1="117.88966" - y1="587.23602" - x2="182.24524" - y2="704.73077" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient2533" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.1800109,0.4273134,0.4706466,1.1534176,1272.3477,-732.02104)" - x1="218.11714" - y1="630.30475" - x2="203.12654" - y2="737.8537" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient2536" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2643925,0,0,1.2357712,729.45868,-685.70504)" - x1="236.25362" - y1="657.11133" - x2="212.5099" - y2="737.41229" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient6810" - id="linearGradient2539" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.599201,7.9485483e-2,-0.2318863,1.9097465,860.80461,-630.61189)" - x1="855.06372" - y1="238.8383" - x2="871.15576" - y2="315.45914" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2545" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2781848,0,0,0.990788,754.62768,-618.27804)" - x1="322.48257" - y1="435.26761" - x2="323.2514" - y2="488.48251" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient2548" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.3994837,0,0,1.1399824,714.04668,-671.75704)" - x1="320.75104" - y1="498.17776" - x2="321.32224" - y2="614.50439" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient2555" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0160687,0,0,1.53779,729.45868,-686.43004)" - spreadMethod="reflect" - x1="437.57941" - y1="528.87177" - x2="437.57941" - y2="394.10361" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2558" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2914159,-3.3330306e-2,5.0610341e-2,0.4881144,1003.9662,-404.72726)" - x1="389.63535" - y1="242.28218" - x2="387.06866" - y2="281.32513" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient2561" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.3921823,-2.9764582e-2,-5.7310058e-2,0.5824956,1376.4784,-428.91032)" - x1="379.09573" - y1="240.92712" - x2="376.79556" - y2="281.01636" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient2566" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.4785291,4.0425338e-2,3.8864067e-2,1.9024316,1751.4647,-802.97704)" - x1="381.38742" - y1="277.495" - x2="380.5517" - y2="245.68338" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient2569" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0650795,-6.1672141e-2,9.4458503e-2,1.6443046,688.76168,-695.81704)" - x1="378.93771" - y1="278.60202" - x2="380.27319" - y2="243.91606" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient2572" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4132361,-7.9650304e-2,-4.1197678e-2,1.0713842,746.14768,-643.96104)" - x1="303.01761" - y1="237.93179" - x2="297.0856" - y2="330.09561" /> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient172" - id="radialGradient2577" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4818268,0,0,0.3967969,505.21028,-296.00604)" - cx="446.77762" - cy="1219.4125" - fx="446.77762" - fy="1219.4125" - r="195.07191" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3353" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-7.6104436e-3,-0.1875898,-0.5720113,2.3206217e-2,1186.0942,-162.08752)" - x1="892.69696" - y1="258.28925" - x2="564.89618" - y2="281.90463" /> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient172" - id="radialGradient3411" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4818268,0,0,0.3967969,-359.87341,176.94177)" - cx="446.77762" - cy="1219.4125" - fx="446.77762" - fy="1219.4125" - r="195.07191" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient3413" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4132361,-7.9650304e-2,-4.1197678e-2,1.0713842,-118.936,-171.0132)" - x1="303.01761" - y1="237.93179" - x2="297.0856" - y2="330.09561" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient3415" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0650795,-6.1672141e-2,9.4458503e-2,1.6443046,-176.32201,-222.8692)" - x1="378.93771" - y1="278.60202" - x2="380.27319" - y2="243.91606" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient3417" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.4785291,4.0425338e-2,3.8864067e-2,1.9024316,886.38099,-330.0292)" - x1="381.38742" - y1="277.495" - x2="380.5517" - y2="245.68338" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3419" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.3921823,-2.9764582e-2,-5.7310058e-2,0.5824956,511.39472,44.037525)" - x1="379.09573" - y1="240.92712" - x2="376.79556" - y2="281.01636" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3421" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2914159,-3.3330306e-2,5.0610341e-2,0.4881144,138.88252,68.220525)" - x1="389.63535" - y1="242.28218" - x2="387.06866" - y2="281.32513" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient3423" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0160687,0,0,1.53779,-135.62501,-213.4822)" - spreadMethod="reflect" - x1="437.57941" - y1="528.87177" - x2="437.57941" - y2="394.10361" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient3425" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.9027839,-7.2174108e-2,0.1573001,2.0039596,-212.66601,-211.1902)" - x1="375.17325" - y1="419.78485" - x2="377.48541" - y2="324.03815" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient3427" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.3994837,0,0,1.1399824,-151.03701,-198.8092)" - x1="320.75104" - y1="498.17776" - x2="321.32224" - y2="614.50439" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3429" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2781848,0,0,0.990788,-110.456,-145.33018)" - x1="322.48257" - y1="435.26761" - x2="323.2514" - y2="488.48251" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3431" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7146338,0,0,2.1864338,-135.62501,-212.7572)" - x1="411.2215" - y1="242.94365" - x2="411.2215" - y2="331.44858" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient6810" - id="linearGradient3433" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.599201,7.9485483e-2,-0.2318863,1.9097465,10.90312,-180.4374)" - x1="855.06372" - y1="238.8383" - x2="871.15576" - y2="315.45914" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient3435" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2643925,0,0,1.2357712,-135.62501,-212.7572)" - x1="236.25362" - y1="657.11133" - x2="212.5099" - y2="737.41229" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient3437" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.1800109,0.4273134,0.4706466,1.1534176,407.26399,-259.0732)" - x1="218.11714" - y1="630.30475" - x2="203.12654" - y2="737.8537" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3439" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.9523959,0.3464001,0.4208255,0.9487298,393.24899,-109.59418)" - x1="117.88966" - y1="587.23602" - x2="182.24524" - y2="704.73077" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3441" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0038119,-5.2260066e-2,-1.740863e-2,1.0462687,-76.888003,-73.717475)" - x1="223.10072" - y1="570.41809" - x2="230.53499" - y2="710.97723" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient3443" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.523355,0,0,1.0256962,-135.62501,-212.7572)" - x1="284.68652" - y1="410.46326" - x2="285.45923" - y2="485.69934" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3445" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7672384,0,0,0.4874752,71.286992,6.5651249)" - x1="288.82358" - y1="398.85422" - x2="288.37628" - y2="482.55939" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3447" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2316272,0.2342907,0.7144146,-0.7062927,95.894394,306.75766)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3449" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(7.6104436e-3,-0.1875898,0.5720113,2.3206217e-2,302.55621,308.13463)" - x1="892.69696" - y1="258.28925" - x2="564.89618" - y2="281.90463" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient3455" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.1449278,0.2958704,-0.9021871,-0.4419231,1401.2488,-283.33537)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient6810" - id="linearGradient3459" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.6037841,2.836597e-2,6.9037787e-2,1.9225339,1538.2922,-593.33926)" - x1="855.06372" - y1="238.8383" - x2="871.15576" - y2="315.45914" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5957" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(7.6104436e-3,-0.1875898,0.5720113,2.3206217e-2,313.36793,291.43423)" - x1="892.69696" - y1="258.28925" - x2="564.89618" - y2="281.90463" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5960" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2316272,0.2342907,0.7144146,-0.7062927,95.894394,306.75766)" - x1="867.34546" - y1="234.73897" - x2="867.33453" - y2="314.83911" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5963" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7672384,0,0,0.4874752,71.286992,6.5651249)" - x1="288.82358" - y1="398.85422" - x2="288.37628" - y2="482.55939" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5967" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.523355,0,0,1.0256962,-135.62501,-212.7572)" - x1="284.68652" - y1="410.46326" - x2="285.45923" - y2="485.69934" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5970" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0038119,-5.2260066e-2,-1.740863e-2,1.0462687,-76.888003,-73.717475)" - x1="223.10072" - y1="570.41809" - x2="230.53499" - y2="710.97723" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5973" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.9523959,0.3464001,0.4208255,0.9487298,393.24899,-109.59418)" - x1="117.88966" - y1="587.23602" - x2="182.24524" - y2="704.73077" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5976" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.1800109,0.4273134,0.4706466,1.1534176,407.26399,-259.0732)" - x1="218.11714" - y1="630.30475" - x2="203.12654" - y2="737.8537" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient162" - id="linearGradient5979" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2643925,0,0,1.2357712,-135.62501,-212.7572)" - x1="236.25362" - y1="657.11133" - x2="212.5099" - y2="737.41229" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient6810" - id="linearGradient5982" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.599201,7.9485483e-2,-0.2318863,1.9097465,10.90312,-180.4374)" - x1="855.06372" - y1="238.8383" - x2="871.15576" - y2="315.45914" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5985" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.7146338,0,0,2.1864338,-135.62501,-212.7572)" - x1="411.2215" - y1="242.94365" - x2="411.2215" - y2="331.44858" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient5988" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2781848,0,0,0.990788,-110.456,-145.33018)" - x1="322.48257" - y1="435.26761" - x2="323.2514" - y2="488.48251" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient5991" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.3994837,0,0,1.1399824,-151.03701,-198.8092)" - x1="320.75104" - y1="498.17776" - x2="321.32224" - y2="614.50439" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5995" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.9027839,-7.2174108e-2,0.1573001,2.0039596,-212.66601,-211.1902)" - x1="375.17325" - y1="419.78485" - x2="377.48541" - y2="324.03815" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient5998" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0160687,0,0,1.53779,-135.62501,-213.4822)" - spreadMethod="reflect" - x1="437.57941" - y1="528.87177" - x2="437.57941" - y2="394.10361" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient6001" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2914159,-3.3330306e-2,5.0610341e-2,0.4881144,138.88252,68.220525)" - x1="389.63535" - y1="242.28218" - x2="387.06866" - y2="281.32513" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient167" - id="linearGradient6004" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-0.3921823,-2.9764582e-2,-5.7310058e-2,0.5824956,511.39472,44.037525)" - x1="379.09573" - y1="240.92712" - x2="376.79556" - y2="281.01636" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient6009" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-1.4785291,4.0425338e-2,3.8864067e-2,1.9024316,886.38099,-330.0292)" - x1="381.38742" - y1="277.495" - x2="380.5517" - y2="245.68338" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient153" - id="linearGradient6012" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.0650795,-6.1672141e-2,9.4458503e-2,1.6443046,-176.32201,-222.8692)" - x1="378.93771" - y1="278.60202" - x2="380.27319" - y2="243.91606" /> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient138" - id="linearGradient6015" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4132361,-7.9650304e-2,-4.1197678e-2,1.0713842,-118.936,-171.0132)" - x1="303.01761" - y1="237.93179" - x2="297.0856" - y2="330.09561" /> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient172" - id="radialGradient6020" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.4818268,0,0,0.3967969,-359.87341,176.94177)" - cx="446.77762" - cy="1219.4125" - fx="446.77762" - fy="1219.4125" - r="195.07191" /> - </defs> - <g - id="g6022"> - <path - d="M 591.23603,660.80083 C 591.23603,703.54984 461.81827,738.20477 302.17337,738.20477 C 142.52846,738.20477 13.110708,703.54984 13.110708,660.80083 C 13.110708,618.05182 142.52846,583.39691 302.17337,583.39691 C 461.81827,583.39691 591.23603,618.05182 591.23603,660.80083 z" - id="path3355" - style="fill:url(#radialGradient6020);stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter" /> - <path - sodipodi:nodetypes="ccccccccc" - id="path3357" - d="M 143.90874,577.54277 C 115.92374,537.26402 110.46624,406.31277 175.76749,325.75527 C 208.12499,287.10777 216.37999,260.17402 218.93124,224.01402 C 220.66749,182.79027 189.77499,59.711525 306.28499,50.334025 C 424.29249,40.919025 417.95499,157.40902 417.27624,219.05277 C 416.71249,271.10277 419.0565,276.31252 445.584,316.88002 C 494.68275,391.41752 526.96749,544.04652 472.77249,613.51152 C 404.12624,700.47152 345.33124,662.75902 306.28499,665.92402 C 233.16874,669.92652 230.75124,708.91277 143.90874,577.54277 z" - style="fill:#000000;stroke:none;stroke-width:1.25" /> - <path - sodipodi:nodetypes="cssccc" - id="path3359" - d="M 437.66398,210.61794 C 450.11848,228.11403 483.19457,249.41586 502.10694,275.91451 C 521.01932,302.41316 477.73746,333.2079 443.1675,314.23928 C 417.44041,300.12277 444.25181,384.39183 467.34598,377.01641 C 614.65479,312.95238 492.4139,250.78608 485.61266,191.90909 C 540.40451,67.355773 400.47822,152.79209 437.66398,210.61794 z" - style="fill:#000000;stroke:#000000;stroke-width:1.5625006" /> - <path - d="M 375.15201,109.16012 C 373.96198,140.10802 339.90409,167.06128 299.08159,169.36204 C 258.25909,171.66281 226.13061,148.43982 227.32064,117.49192 C 228.51067,86.544125 262.56856,59.590825 303.39106,57.290125 C 344.21356,54.989325 376.34204,78.212325 375.15201,109.16012 z" - id="path3361" - style="fill:url(#linearGradient6015);stroke:none;stroke-width:1.26498997" /> - <path - d="M 277.39315,182.77455 C 278.54881,202.89182 268.92216,219.81175 255.89144,220.56628 C 242.86071,221.3208 231.36038,205.62421 230.20473,185.50694 C 229.04907,165.38967 238.67572,148.46972 251.70644,147.71522 C 264.73717,146.96072 276.2375,162.65728 277.39315,182.77455 z" - id="path3363" - style="fill:url(#linearGradient6012);stroke:none;stroke-width:1.17873001" /> - <path - d="M 301.04358,184.3151 C 301.51907,207.59043 316.56861,226.05786 334.65769,225.56328 C 352.74677,225.06869 367.02541,205.79938 366.54992,182.52405 C 366.07444,159.24872 351.02489,140.78132 332.93581,141.27592 C 314.84674,141.77042 300.5681,161.03977 301.04358,184.3151 z" - id="path3365" - style="fill:url(#linearGradient6009);stroke:none;stroke-width:0.93138498" /> - <path - d="M 331.21231,191.85453 C 330.93912,204.63094 337.38392,215.00253 345.60719,215.02013 C 353.83046,215.03772 360.7182,204.69466 360.99139,191.91824 C 361.26458,179.14182 354.81978,168.77023 346.59651,168.75264 C 338.37324,168.73505 331.4855,179.07811 331.21231,191.85453 z" - id="path3367" - style="fill:#000000;stroke:none;stroke-width:1.86495996" /> - <path - d="M 273.01381,188.19365 C 274.04499,198.77003 270.0676,207.92934 264.13008,208.65153 C 258.19256,209.37373 252.54331,201.38533 251.51214,190.80895 C 250.48097,180.23257 254.45835,171.07326 260.39587,170.35107 C 266.33339,169.62887 271.98264,177.61727 273.01381,188.19365 z" - id="path3369" - style="fill:#000000;stroke:none;stroke-width:2.39814997" /> - <path - d="M 338.4302,184.54815 C 337.72904,191.6747 341.05031,197.74711 345.84847,198.11127 C 350.64663,198.47542 355.10471,192.99342 355.80587,185.86687 C 356.50703,178.74032 353.18576,172.6679 348.3876,172.30374 C 343.58944,171.93959 339.13136,177.42159 338.4302,184.54815 z" - id="path3371" - style="fill:url(#linearGradient6004);stroke:none;stroke-width:3.1916101" /> - <path - d="M 269.50703,182.58574 C 270.12623,188.55758 267.73791,193.72929 264.17258,194.13707 C 260.60725,194.54485 257.21502,190.03429 256.59583,184.06244 C 255.97663,178.0906 258.36495,172.91889 261.93028,172.51111 C 265.49561,172.10333 268.88784,176.6139 269.50703,182.58574 z" - id="path3373" - style="fill:url(#linearGradient6001);stroke:none;stroke-width:4.12025976" /> - <path - id="path3375" - d="M 187.75249,405.79902 C 203.79749,369.42027 237.89499,305.51652 238.62124,256.10152 C 238.62124,216.79902 356.34499,207.41277 365.79249,246.65402 C 375.23999,285.89527 399.21874,344.75777 414.47999,373.09902 C 429.73999,401.43902 474.24124,491.46777 426.83499,570.03152 C 384.13874,639.58652 254.67874,694.61402 185.57249,560.58527 C 162.31874,514.07652 166.46624,456.44152 187.75249,405.79902 z" - style="fill:url(#linearGradient5998);stroke:none;stroke-width:1.25" /> - <path - id="path3377" - d="M 173.24559,378.8028 C 159.53586,404.75152 131.00745,472.99595 200.53857,510.33418 C 275.38701,549.97538 275.02711,631.56055 185.18731,592.7418 C 103.05444,557.65452 139.36496,415.87304 162.33593,381.94969 C 177.39745,358.18988 199.98644,329.10722 173.24559,378.8028 z" - style="fill:url(#linearGradient5995);stroke:none;stroke-width:1.15804005" /> - <path - id="path3379" - d="M 185.01624,349.39277 C 163.18499,385.02777 110.79499,469.15902 180.90624,512.79652 C 275.36749,570.74027 248.62249,628.68527 162.40749,576.51402 C 41.021247,503.68402 147.62624,356.99402 196.32124,301.09152 C 251.87624,238.34152 207.01374,312.45027 185.01624,349.39277 z" - style="fill:#000000;stroke:#000000;stroke-width:1.5625" /> - <path - id="path3381" - d="M 397.76919,419.60753 C 397.76919,459.32033 359.65441,510.90826 294.21657,510.44511 C 226.73185,511.0026 197.92832,459.32033 197.92832,419.60753 C 197.92832,379.89472 242.69287,347.66452 297.8494,347.66452 C 353.00463,347.66452 397.76919,379.89472 397.76919,419.60753 z" - style="font-size:12px;fill:url(#linearGradient5991);stroke:none;stroke-width:1.23705006;stroke-dasharray:none" /> - <path - id="path3383" - d="M 362.15979,294.61832 C 361.43347,335.77773 334.64977,345.48709 300.75476,345.48709 C 266.85857,345.48709 242.25502,339.41113 239.34854,294.61832 C 239.34854,266.53917 266.85857,250.28968 300.75476,250.28968 C 334.64977,250.28968 362.15979,266.53917 362.15979,294.61832 z" - style="font-size:12px;fill:url(#linearGradient5988);stroke:none;stroke-width:1.38846004;stroke-dasharray:none" /> - <path - id="path3385" - d="M 157.23124,357.83652 C 179.37624,324.09152 225.99999,272.38152 165.95249,365.10277 C 117.26374,441.40652 147.94874,490.44402 163.77249,503.90152 C 209.43124,544.60402 207.47999,571.83777 171.76624,550.40902 C 94.734994,504.62652 110.72249,427.59902 157.23124,357.83652 z" - style="fill:url(#linearGradient5985);stroke:none;stroke-width:1.25" /> - <path - id="path3387" - d="M 462.21568,398.96909 C 450.39659,362.17304 409.96999,267.68577 467.11982,378.94676 C 519.1881,479.53006 466.98563,537.85433 458.30537,543.16377 C 449.62629,548.47226 421.31707,557.63765 431.92723,536.4342 C 442.53632,515.23062 487.08834,478.21682 462.21568,398.96909 z" - style="fill:url(#linearGradient5982);fill-opacity:1;stroke:none;stroke-width:1.25" /> - <path - id="path3389" - d="M 140.51874,683.39402 C 89.966244,656.62402 16.453747,688.54902 43.141247,615.81152 C 48.486247,599.26402 35.172497,574.55152 43.867497,558.40402 C 54.041247,538.78152 75.842494,543.14277 88.923744,530.06152 C 101.82124,516.44777 109.99749,493.00027 133.97874,496.63402 C 157.95874,500.26777 173.90999,529.71027 190.65874,565.67027 C 203.01249,591.46777 246.83499,627.75027 243.97124,656.61777 C 240.60124,700.99277 190.18749,709.35527 140.51874,683.39402 z" - style="fill:url(#linearGradient5979);stroke:#e68c3f;stroke-width:7.8125" /> - <path - id="path3391" - d="M 491.31808,670.91489 C 528.39675,625.95042 610.70818,635.17384 555.19701,573.52225 C 543.452,560.30492 546.95774,531.65049 532.68995,519.54726 C 515.71854,504.70652 496.99731,516.87766 479.79512,509.11645 C 462.56223,500.79684 444.55058,484.62292 423.51456,496.12697 C 402.4797,507.6306 400.21642,537.55836 398.23263,576.73647 C 396.49323,604.95714 370.77728,652.14775 384.4305,678.07775 C 404.45332,718.28664 455.96509,712.96302 491.31808,670.91489 z" - style="fill:url(#linearGradient5976);stroke:#e68c3f;stroke-width:7.81249762" /> - <path - id="path3393" - d="M 475.19239,610.80964 C 532.58685,526.08884 489.81056,526.70588 475.48217,520.29802 C 461.11206,513.43236 445.8707,500.12629 428.97182,509.5003 C 412.07389,518.87396 411.10688,543.40025 410.64335,575.50997 C 410.05505,598.63832 390.69247,637.08007 402.33826,658.54446 C 416.30733,683.56395 450.20934,647.22527 475.19239,610.80964 z" - style="fill:url(#linearGradient5973);stroke:none;stroke-width:1.52532005" /> - <path - id="path3395" - d="M 128.7701,623.00924 C 42.866706,567.39983 83.051524,548.52024 96.092064,539.78558 C 111.73042,528.58358 111.85185,506.75151 131.06896,508.78839 C 150.28506,510.82534 161.47212,534.4833 174.42831,563.86686 C 183.9948,584.9323 216.82272,612.77142 214.47562,637.07862 C 211.37663,665.56569 165.98235,646.7897 128.7701,623.00924 z" - style="fill:url(#linearGradient5970);stroke:none;stroke-width:1.52532005" /> - <path - id="path3397" - d="M 251.81749,210.65402 C 260.75124,202.19152 282.83124,176.82152 324.26874,203.46027 C 331.97124,208.47277 338.22124,208.93152 353.04499,215.27902 C 382.70249,227.46527 368.52249,256.85277 337.11499,266.66402 C 323.66749,271.02527 311.44499,287.35902 286.95374,285.96277 C 266.03624,284.74152 260.55499,271.12027 247.70624,263.58027 C 224.86999,250.69152 221.49999,233.26277 233.83124,224.01402 C 246.16374,214.76527 250.98749,211.44027 251.81749,210.65402 z" - style="fill:url(#linearGradient5967);stroke:#e68c3f;stroke-width:4.6875" /> - <path - id="path3399" - d="M 353.43874,234.29902 C 341.08499,235.02527 314.19749,261.91277 285.85624,261.91277 C 257.51499,261.91277 240.80124,235.75152 236.44124,235.75152" - style="fill:none;stroke:#e68c3f;stroke-width:3.125" /> - <path - id="path3401" - d="M 265.90246,208.33442 C 270.38995,204.30176 284.54499,193.23548 303.31687,204.56504 C 307.27192,206.80832 311.35631,209.24996 317.43047,212.58509 C 329.462,219.58298 323.50274,229.6676 309.08839,236.04837 C 302.54708,238.72589 291.76316,244.6349 283.55168,244.22151 C 274.42662,243.38281 268.52325,237.43151 262.47546,233.55551 C 251.38073,226.22703 252.05445,220.30969 257.20813,215.38293 C 261.10416,212.00015 265.48554,208.70909 265.90246,208.33442 z" - style="fill:url(#linearGradient5963);stroke:none" /> - <path - sodipodi:nodetypes="ccscc" - id="path3403" - d="M 485.62558,318.40009 C 470.31375,326.6082 417.68681,322.14515 480.02902,326.05185 C 529.45102,323.13335 535.62952,273.72084 534.95116,268.27709 C 534.2728,262.83418 518.48464,252.49699 513.21723,263.8189 C 507.9494,275.14041 526.70967,304.0309 485.62558,318.40009 z" - style="fill:url(#linearGradient5960);stroke:none;stroke-width:1.25" /> - <path - sodipodi:nodetypes="ccscc" - id="path3405" - d="M 473.26296,135.03602 C 463.66338,137.45706 448.44209,148.26182 466.22252,134.32762 C 494.98909,121.13922 505.82847,135.59547 486.85683,175.63681 C 482.71091,184.38715 460.74905,201.85561 454.18436,199.10941 C 500.29783,163.55611 496.08175,126.83432 473.26296,135.03602 z" - style="fill:url(#linearGradient5957);stroke:none;stroke-width:1.25" /> - </g> -</svg> diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/pdf417.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/pdf417.php deleted file mode 100644 index d31163b9ed..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/pdf417.php +++ /dev/null @@ -1,1003 +0,0 @@ -<?php -//============================================================+ -// File name : pdf417.php -// Version : 1.0.003 -// Begin : 2010-06-03 -// Last Update : 2010-08-08 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2010-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// DESCRIPTION : -// -// Class to create PDF417 barcode arrays for TCPDF class. -// PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. -// It is one of the most popular 2D codes because of its ability to be read with slightly modified handheld laser or linear CCD scanners. -// TECHNICAL DATA / FEATURES OF PDF417: -// Encodable Character Set: All 128 ASCII Characters (including extended) -// Code Type: Continuous, Multi-Row -// Symbol Height: 3 - 90 Rows -// Symbol Width: 90X - 583X -// Bidirectional Decoding: Yes -// Error Correction Characters: 2 - 512 -// Maximum Data Characters: 1850 text, 2710 digits, 1108 bytes -// -//============================================================+ - -/** - * Class to create PDF417 barcode arrays for TCPDF class. - * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. - * (requires PHP bcmath extension) - * @package com.tecnick.tcpdf - * @abstract Class to create PDF417 barcode arrays for TCPDF class. - * @author Nicola Asuni - * @copyright 2010-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.003 - */ - -// definitions -if (!defined('PDF417DEFS')) { - - /** - * Indicate that definitions for this class are set - */ - define('PDF417DEFS', true); - - // ----------------------------------------------------- - - /** - * Row height respect X dimension of single module - */ - define('ROWHEIGHT', 4); - - /** - * Horizontal quiet zone in modules - */ - define('QUIETH', 2); - - /** - * Vertical quiet zone in modules - */ - define('QUIETV', 2); - - - -} // end of definitions - -// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# - -if (!class_exists('PDF417', false)) { - - /** - * Class to create PDF417 barcode arrays for TCPDF class. - * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. - * @name PDF417 - * @package com.tecnick.tcpdf - * @abstract Class to create PDF417 barcode arrays for TCPDF class. - * @author Nicola Asuni - * @copyright 2010-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.003 - */ - class PDF417 { - - /** - * @var barcode array to be returned which is readable by TCPDF - * @access protected - */ - protected $barcode_array = array(); - - /** - * @var start pattern - * @access protected - */ - protected $start_pattern = '11111111010101000'; - - /** - * @var start pattern - * @access protected - */ - protected $stop_pattern = '111111101000101001'; - - /** - * @var Text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers) - * @access protected - */ - protected $textsubmodes = array( - array(0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x20,0xFD,0xFE,0xFF), // Alpha - array(0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x20,0xFD,0xFE,0xFF), // Lower - array(0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x26,0x0d,0x09,0x2c,0x3a,0x23,0x2d,0x2e,0x24,0x2f,0x2b,0x25,0x2a,0x3d,0x5e,0xFB,0x20,0xFD,0xFE,0xFF), // Mixed - array(0x3b,0x3c,0x3e,0x40,0x5b,0x5c,0x5d,0x5f,0x60,0x7e,0x21,0x0d,0x09,0x2c,0x3a,0x0a,0x2d,0x2e,0x24,0x2f,0x22,0x7c,0x2a,0x28,0x29,0x3f,0x7b,0x7d,0x27,0xFF) // Puntuaction - ); - - /** - * @var Switching codes for Text Compaction Sub-Modes - * @access protected - */ - protected $textlatch = array( - '01' => array(27), '02' => array(28), '03' => array(28,25), // - '10' => array(28,28), '12' => array(28), '13' => array(28,25), // - '20' => array(28), '21' => array(27), '23' => array(25), // - '30' => array(29), '31' => array(29,27), '32' => array(29,28) // - ); - - /** - * @var clusters of codewords (0, 3, 6)<br/> - * Values are hex equivalents of binary representation of bars (1 = bar, 0 = space).<br/> - * The codewords numbered from 900 to 928 have special meaning, some enable to switch between modes in order to optimise the code:<ul> - * <li>900 : Switch to "Text" mode</li> - * <li>901 : Switch to "Byte" mode</li> - * <li>902 : Switch to "Numeric" mode</li> - * <li>903 - 912 : Reserved</li> - * <li>913 : Switch to "Octet" only for the next codeword</li> - * <li>914 - 920 : Reserved</li> - * <li>921 : Initialization</li> - * <li>922 : Terminator codeword for Macro PDF control block</li> - * <li>923 : Sequence tag to identify the beginning of optional fields in the Macro PDF control block</li> - * <li>924 : Switch to "Byte" mode (If the total number of byte is multiple of 6)</li> - * <li>925 : Identifier for a user defined Extended Channel Interpretation (ECI)</li> - * <li>926 : Identifier for a general purpose ECI format</li> - * <li>927 : Identifier for an ECI of a character set or code page</li> - * <li>928 : Macro marker codeword to indicate the beginning of a Macro PDF Control Block</li> - * </ul> - * @access protected - */ - protected $clusters = array( - array( // cluster 0 ----------------------------------------------------------------------- - 0x1d5c0,0x1eaf0,0x1f57c,0x1d4e0,0x1ea78,0x1f53e,0x1a8c0,0x1d470,0x1a860,0x15040, // 10 - 0x1a830,0x15020,0x1adc0,0x1d6f0,0x1eb7c,0x1ace0,0x1d678,0x1eb3e,0x158c0,0x1ac70, // 20 - 0x15860,0x15dc0,0x1aef0,0x1d77c,0x15ce0,0x1ae78,0x1d73e,0x15c70,0x1ae3c,0x15ef0, // 30 - 0x1af7c,0x15e78,0x1af3e,0x15f7c,0x1f5fa,0x1d2e0,0x1e978,0x1f4be,0x1a4c0,0x1d270, // 40 - 0x1e93c,0x1a460,0x1d238,0x14840,0x1a430,0x1d21c,0x14820,0x1a418,0x14810,0x1a6e0, // 50 - 0x1d378,0x1e9be,0x14cc0,0x1a670,0x1d33c,0x14c60,0x1a638,0x1d31e,0x14c30,0x1a61c, // 60 - 0x14ee0,0x1a778,0x1d3be,0x14e70,0x1a73c,0x14e38,0x1a71e,0x14f78,0x1a7be,0x14f3c, // 70 - 0x14f1e,0x1a2c0,0x1d170,0x1e8bc,0x1a260,0x1d138,0x1e89e,0x14440,0x1a230,0x1d11c, // 80 - 0x14420,0x1a218,0x14410,0x14408,0x146c0,0x1a370,0x1d1bc,0x14660,0x1a338,0x1d19e, // 90 - 0x14630,0x1a31c,0x14618,0x1460c,0x14770,0x1a3bc,0x14738,0x1a39e,0x1471c,0x147bc, // 100 - 0x1a160,0x1d0b8,0x1e85e,0x14240,0x1a130,0x1d09c,0x14220,0x1a118,0x1d08e,0x14210, // 110 - 0x1a10c,0x14208,0x1a106,0x14360,0x1a1b8,0x1d0de,0x14330,0x1a19c,0x14318,0x1a18e, // 120 - 0x1430c,0x14306,0x1a1de,0x1438e,0x14140,0x1a0b0,0x1d05c,0x14120,0x1a098,0x1d04e, // 130 - 0x14110,0x1a08c,0x14108,0x1a086,0x14104,0x141b0,0x14198,0x1418c,0x140a0,0x1d02e, // 140 - 0x1a04c,0x1a046,0x14082,0x1cae0,0x1e578,0x1f2be,0x194c0,0x1ca70,0x1e53c,0x19460, // 150 - 0x1ca38,0x1e51e,0x12840,0x19430,0x12820,0x196e0,0x1cb78,0x1e5be,0x12cc0,0x19670, // 160 - 0x1cb3c,0x12c60,0x19638,0x12c30,0x12c18,0x12ee0,0x19778,0x1cbbe,0x12e70,0x1973c, // 170 - 0x12e38,0x12e1c,0x12f78,0x197be,0x12f3c,0x12fbe,0x1dac0,0x1ed70,0x1f6bc,0x1da60, // 180 - 0x1ed38,0x1f69e,0x1b440,0x1da30,0x1ed1c,0x1b420,0x1da18,0x1ed0e,0x1b410,0x1da0c, // 190 - 0x192c0,0x1c970,0x1e4bc,0x1b6c0,0x19260,0x1c938,0x1e49e,0x1b660,0x1db38,0x1ed9e, // 200 - 0x16c40,0x12420,0x19218,0x1c90e,0x16c20,0x1b618,0x16c10,0x126c0,0x19370,0x1c9bc, // 210 - 0x16ec0,0x12660,0x19338,0x1c99e,0x16e60,0x1b738,0x1db9e,0x16e30,0x12618,0x16e18, // 220 - 0x12770,0x193bc,0x16f70,0x12738,0x1939e,0x16f38,0x1b79e,0x16f1c,0x127bc,0x16fbc, // 230 - 0x1279e,0x16f9e,0x1d960,0x1ecb8,0x1f65e,0x1b240,0x1d930,0x1ec9c,0x1b220,0x1d918, // 240 - 0x1ec8e,0x1b210,0x1d90c,0x1b208,0x1b204,0x19160,0x1c8b8,0x1e45e,0x1b360,0x19130, // 250 - 0x1c89c,0x16640,0x12220,0x1d99c,0x1c88e,0x16620,0x12210,0x1910c,0x16610,0x1b30c, // 260 - 0x19106,0x12204,0x12360,0x191b8,0x1c8de,0x16760,0x12330,0x1919c,0x16730,0x1b39c, // 270 - 0x1918e,0x16718,0x1230c,0x12306,0x123b8,0x191de,0x167b8,0x1239c,0x1679c,0x1238e, // 280 - 0x1678e,0x167de,0x1b140,0x1d8b0,0x1ec5c,0x1b120,0x1d898,0x1ec4e,0x1b110,0x1d88c, // 290 - 0x1b108,0x1d886,0x1b104,0x1b102,0x12140,0x190b0,0x1c85c,0x16340,0x12120,0x19098, // 300 - 0x1c84e,0x16320,0x1b198,0x1d8ce,0x16310,0x12108,0x19086,0x16308,0x1b186,0x16304, // 310 - 0x121b0,0x190dc,0x163b0,0x12198,0x190ce,0x16398,0x1b1ce,0x1638c,0x12186,0x16386, // 320 - 0x163dc,0x163ce,0x1b0a0,0x1d858,0x1ec2e,0x1b090,0x1d84c,0x1b088,0x1d846,0x1b084, // 330 - 0x1b082,0x120a0,0x19058,0x1c82e,0x161a0,0x12090,0x1904c,0x16190,0x1b0cc,0x19046, // 340 - 0x16188,0x12084,0x16184,0x12082,0x120d8,0x161d8,0x161cc,0x161c6,0x1d82c,0x1d826, // 350 - 0x1b042,0x1902c,0x12048,0x160c8,0x160c4,0x160c2,0x18ac0,0x1c570,0x1e2bc,0x18a60, // 360 - 0x1c538,0x11440,0x18a30,0x1c51c,0x11420,0x18a18,0x11410,0x11408,0x116c0,0x18b70, // 370 - 0x1c5bc,0x11660,0x18b38,0x1c59e,0x11630,0x18b1c,0x11618,0x1160c,0x11770,0x18bbc, // 380 - 0x11738,0x18b9e,0x1171c,0x117bc,0x1179e,0x1cd60,0x1e6b8,0x1f35e,0x19a40,0x1cd30, // 390 - 0x1e69c,0x19a20,0x1cd18,0x1e68e,0x19a10,0x1cd0c,0x19a08,0x1cd06,0x18960,0x1c4b8, // 400 - 0x1e25e,0x19b60,0x18930,0x1c49c,0x13640,0x11220,0x1cd9c,0x1c48e,0x13620,0x19b18, // 410 - 0x1890c,0x13610,0x11208,0x13608,0x11360,0x189b8,0x1c4de,0x13760,0x11330,0x1cdde, // 420 - 0x13730,0x19b9c,0x1898e,0x13718,0x1130c,0x1370c,0x113b8,0x189de,0x137b8,0x1139c, // 430 - 0x1379c,0x1138e,0x113de,0x137de,0x1dd40,0x1eeb0,0x1f75c,0x1dd20,0x1ee98,0x1f74e, // 440 - 0x1dd10,0x1ee8c,0x1dd08,0x1ee86,0x1dd04,0x19940,0x1ccb0,0x1e65c,0x1bb40,0x19920, // 450 - 0x1eedc,0x1e64e,0x1bb20,0x1dd98,0x1eece,0x1bb10,0x19908,0x1cc86,0x1bb08,0x1dd86, // 460 - 0x19902,0x11140,0x188b0,0x1c45c,0x13340,0x11120,0x18898,0x1c44e,0x17740,0x13320, // 470 - 0x19998,0x1ccce,0x17720,0x1bb98,0x1ddce,0x18886,0x17710,0x13308,0x19986,0x17708, // 480 - 0x11102,0x111b0,0x188dc,0x133b0,0x11198,0x188ce,0x177b0,0x13398,0x199ce,0x17798, // 490 - 0x1bbce,0x11186,0x13386,0x111dc,0x133dc,0x111ce,0x177dc,0x133ce,0x1dca0,0x1ee58, // 500 - 0x1f72e,0x1dc90,0x1ee4c,0x1dc88,0x1ee46,0x1dc84,0x1dc82,0x198a0,0x1cc58,0x1e62e, // 510 - 0x1b9a0,0x19890,0x1ee6e,0x1b990,0x1dccc,0x1cc46,0x1b988,0x19884,0x1b984,0x19882, // 520 - 0x1b982,0x110a0,0x18858,0x1c42e,0x131a0,0x11090,0x1884c,0x173a0,0x13190,0x198cc, // 530 - 0x18846,0x17390,0x1b9cc,0x11084,0x17388,0x13184,0x11082,0x13182,0x110d8,0x1886e, // 540 - 0x131d8,0x110cc,0x173d8,0x131cc,0x110c6,0x173cc,0x131c6,0x110ee,0x173ee,0x1dc50, // 550 - 0x1ee2c,0x1dc48,0x1ee26,0x1dc44,0x1dc42,0x19850,0x1cc2c,0x1b8d0,0x19848,0x1cc26, // 560 - 0x1b8c8,0x1dc66,0x1b8c4,0x19842,0x1b8c2,0x11050,0x1882c,0x130d0,0x11048,0x18826, // 570 - 0x171d0,0x130c8,0x19866,0x171c8,0x1b8e6,0x11042,0x171c4,0x130c2,0x171c2,0x130ec, // 580 - 0x171ec,0x171e6,0x1ee16,0x1dc22,0x1cc16,0x19824,0x19822,0x11028,0x13068,0x170e8, // 590 - 0x11022,0x13062,0x18560,0x10a40,0x18530,0x10a20,0x18518,0x1c28e,0x10a10,0x1850c, // 600 - 0x10a08,0x18506,0x10b60,0x185b8,0x1c2de,0x10b30,0x1859c,0x10b18,0x1858e,0x10b0c, // 610 - 0x10b06,0x10bb8,0x185de,0x10b9c,0x10b8e,0x10bde,0x18d40,0x1c6b0,0x1e35c,0x18d20, // 620 - 0x1c698,0x18d10,0x1c68c,0x18d08,0x1c686,0x18d04,0x10940,0x184b0,0x1c25c,0x11b40, // 630 - 0x10920,0x1c6dc,0x1c24e,0x11b20,0x18d98,0x1c6ce,0x11b10,0x10908,0x18486,0x11b08, // 640 - 0x18d86,0x10902,0x109b0,0x184dc,0x11bb0,0x10998,0x184ce,0x11b98,0x18dce,0x11b8c, // 650 - 0x10986,0x109dc,0x11bdc,0x109ce,0x11bce,0x1cea0,0x1e758,0x1f3ae,0x1ce90,0x1e74c, // 660 - 0x1ce88,0x1e746,0x1ce84,0x1ce82,0x18ca0,0x1c658,0x19da0,0x18c90,0x1c64c,0x19d90, // 670 - 0x1cecc,0x1c646,0x19d88,0x18c84,0x19d84,0x18c82,0x19d82,0x108a0,0x18458,0x119a0, // 680 - 0x10890,0x1c66e,0x13ba0,0x11990,0x18ccc,0x18446,0x13b90,0x19dcc,0x10884,0x13b88, // 690 - 0x11984,0x10882,0x11982,0x108d8,0x1846e,0x119d8,0x108cc,0x13bd8,0x119cc,0x108c6, // 700 - 0x13bcc,0x119c6,0x108ee,0x119ee,0x13bee,0x1ef50,0x1f7ac,0x1ef48,0x1f7a6,0x1ef44, // 710 - 0x1ef42,0x1ce50,0x1e72c,0x1ded0,0x1ef6c,0x1e726,0x1dec8,0x1ef66,0x1dec4,0x1ce42, // 720 - 0x1dec2,0x18c50,0x1c62c,0x19cd0,0x18c48,0x1c626,0x1bdd0,0x19cc8,0x1ce66,0x1bdc8, // 730 - 0x1dee6,0x18c42,0x1bdc4,0x19cc2,0x1bdc2,0x10850,0x1842c,0x118d0,0x10848,0x18426, // 740 - 0x139d0,0x118c8,0x18c66,0x17bd0,0x139c8,0x19ce6,0x10842,0x17bc8,0x1bde6,0x118c2, // 750 - 0x17bc4,0x1086c,0x118ec,0x10866,0x139ec,0x118e6,0x17bec,0x139e6,0x17be6,0x1ef28, // 760 - 0x1f796,0x1ef24,0x1ef22,0x1ce28,0x1e716,0x1de68,0x1ef36,0x1de64,0x1ce22,0x1de62, // 770 - 0x18c28,0x1c616,0x19c68,0x18c24,0x1bce8,0x19c64,0x18c22,0x1bce4,0x19c62,0x1bce2, // 780 - 0x10828,0x18416,0x11868,0x18c36,0x138e8,0x11864,0x10822,0x179e8,0x138e4,0x11862, // 790 - 0x179e4,0x138e2,0x179e2,0x11876,0x179f6,0x1ef12,0x1de34,0x1de32,0x19c34,0x1bc74, // 800 - 0x1bc72,0x11834,0x13874,0x178f4,0x178f2,0x10540,0x10520,0x18298,0x10510,0x10508, // 810 - 0x10504,0x105b0,0x10598,0x1058c,0x10586,0x105dc,0x105ce,0x186a0,0x18690,0x1c34c, // 820 - 0x18688,0x1c346,0x18684,0x18682,0x104a0,0x18258,0x10da0,0x186d8,0x1824c,0x10d90, // 830 - 0x186cc,0x10d88,0x186c6,0x10d84,0x10482,0x10d82,0x104d8,0x1826e,0x10dd8,0x186ee, // 840 - 0x10dcc,0x104c6,0x10dc6,0x104ee,0x10dee,0x1c750,0x1c748,0x1c744,0x1c742,0x18650, // 850 - 0x18ed0,0x1c76c,0x1c326,0x18ec8,0x1c766,0x18ec4,0x18642,0x18ec2,0x10450,0x10cd0, // 860 - 0x10448,0x18226,0x11dd0,0x10cc8,0x10444,0x11dc8,0x10cc4,0x10442,0x11dc4,0x10cc2, // 870 - 0x1046c,0x10cec,0x10466,0x11dec,0x10ce6,0x11de6,0x1e7a8,0x1e7a4,0x1e7a2,0x1c728, // 880 - 0x1cf68,0x1e7b6,0x1cf64,0x1c722,0x1cf62,0x18628,0x1c316,0x18e68,0x1c736,0x19ee8, // 890 - 0x18e64,0x18622,0x19ee4,0x18e62,0x19ee2,0x10428,0x18216,0x10c68,0x18636,0x11ce8, // 900 - 0x10c64,0x10422,0x13de8,0x11ce4,0x10c62,0x13de4,0x11ce2,0x10436,0x10c76,0x11cf6, // 910 - 0x13df6,0x1f7d4,0x1f7d2,0x1e794,0x1efb4,0x1e792,0x1efb2,0x1c714,0x1cf34,0x1c712, // 920 - 0x1df74,0x1cf32,0x1df72,0x18614,0x18e34,0x18612,0x19e74,0x18e32,0x1bef4), // 929 - array( // cluster 3 ----------------------------------------------------------------------- - 0x1f560,0x1fab8,0x1ea40,0x1f530,0x1fa9c,0x1ea20,0x1f518,0x1fa8e,0x1ea10,0x1f50c, // 10 - 0x1ea08,0x1f506,0x1ea04,0x1eb60,0x1f5b8,0x1fade,0x1d640,0x1eb30,0x1f59c,0x1d620, // 20 - 0x1eb18,0x1f58e,0x1d610,0x1eb0c,0x1d608,0x1eb06,0x1d604,0x1d760,0x1ebb8,0x1f5de, // 30 - 0x1ae40,0x1d730,0x1eb9c,0x1ae20,0x1d718,0x1eb8e,0x1ae10,0x1d70c,0x1ae08,0x1d706, // 40 - 0x1ae04,0x1af60,0x1d7b8,0x1ebde,0x15e40,0x1af30,0x1d79c,0x15e20,0x1af18,0x1d78e, // 50 - 0x15e10,0x1af0c,0x15e08,0x1af06,0x15f60,0x1afb8,0x1d7de,0x15f30,0x1af9c,0x15f18, // 60 - 0x1af8e,0x15f0c,0x15fb8,0x1afde,0x15f9c,0x15f8e,0x1e940,0x1f4b0,0x1fa5c,0x1e920, // 70 - 0x1f498,0x1fa4e,0x1e910,0x1f48c,0x1e908,0x1f486,0x1e904,0x1e902,0x1d340,0x1e9b0, // 80 - 0x1f4dc,0x1d320,0x1e998,0x1f4ce,0x1d310,0x1e98c,0x1d308,0x1e986,0x1d304,0x1d302, // 90 - 0x1a740,0x1d3b0,0x1e9dc,0x1a720,0x1d398,0x1e9ce,0x1a710,0x1d38c,0x1a708,0x1d386, // 100 - 0x1a704,0x1a702,0x14f40,0x1a7b0,0x1d3dc,0x14f20,0x1a798,0x1d3ce,0x14f10,0x1a78c, // 110 - 0x14f08,0x1a786,0x14f04,0x14fb0,0x1a7dc,0x14f98,0x1a7ce,0x14f8c,0x14f86,0x14fdc, // 120 - 0x14fce,0x1e8a0,0x1f458,0x1fa2e,0x1e890,0x1f44c,0x1e888,0x1f446,0x1e884,0x1e882, // 130 - 0x1d1a0,0x1e8d8,0x1f46e,0x1d190,0x1e8cc,0x1d188,0x1e8c6,0x1d184,0x1d182,0x1a3a0, // 140 - 0x1d1d8,0x1e8ee,0x1a390,0x1d1cc,0x1a388,0x1d1c6,0x1a384,0x1a382,0x147a0,0x1a3d8, // 150 - 0x1d1ee,0x14790,0x1a3cc,0x14788,0x1a3c6,0x14784,0x14782,0x147d8,0x1a3ee,0x147cc, // 160 - 0x147c6,0x147ee,0x1e850,0x1f42c,0x1e848,0x1f426,0x1e844,0x1e842,0x1d0d0,0x1e86c, // 170 - 0x1d0c8,0x1e866,0x1d0c4,0x1d0c2,0x1a1d0,0x1d0ec,0x1a1c8,0x1d0e6,0x1a1c4,0x1a1c2, // 180 - 0x143d0,0x1a1ec,0x143c8,0x1a1e6,0x143c4,0x143c2,0x143ec,0x143e6,0x1e828,0x1f416, // 190 - 0x1e824,0x1e822,0x1d068,0x1e836,0x1d064,0x1d062,0x1a0e8,0x1d076,0x1a0e4,0x1a0e2, // 200 - 0x141e8,0x1a0f6,0x141e4,0x141e2,0x1e814,0x1e812,0x1d034,0x1d032,0x1a074,0x1a072, // 210 - 0x1e540,0x1f2b0,0x1f95c,0x1e520,0x1f298,0x1f94e,0x1e510,0x1f28c,0x1e508,0x1f286, // 220 - 0x1e504,0x1e502,0x1cb40,0x1e5b0,0x1f2dc,0x1cb20,0x1e598,0x1f2ce,0x1cb10,0x1e58c, // 230 - 0x1cb08,0x1e586,0x1cb04,0x1cb02,0x19740,0x1cbb0,0x1e5dc,0x19720,0x1cb98,0x1e5ce, // 240 - 0x19710,0x1cb8c,0x19708,0x1cb86,0x19704,0x19702,0x12f40,0x197b0,0x1cbdc,0x12f20, // 250 - 0x19798,0x1cbce,0x12f10,0x1978c,0x12f08,0x19786,0x12f04,0x12fb0,0x197dc,0x12f98, // 260 - 0x197ce,0x12f8c,0x12f86,0x12fdc,0x12fce,0x1f6a0,0x1fb58,0x16bf0,0x1f690,0x1fb4c, // 270 - 0x169f8,0x1f688,0x1fb46,0x168fc,0x1f684,0x1f682,0x1e4a0,0x1f258,0x1f92e,0x1eda0, // 280 - 0x1e490,0x1fb6e,0x1ed90,0x1f6cc,0x1f246,0x1ed88,0x1e484,0x1ed84,0x1e482,0x1ed82, // 290 - 0x1c9a0,0x1e4d8,0x1f26e,0x1dba0,0x1c990,0x1e4cc,0x1db90,0x1edcc,0x1e4c6,0x1db88, // 300 - 0x1c984,0x1db84,0x1c982,0x1db82,0x193a0,0x1c9d8,0x1e4ee,0x1b7a0,0x19390,0x1c9cc, // 310 - 0x1b790,0x1dbcc,0x1c9c6,0x1b788,0x19384,0x1b784,0x19382,0x1b782,0x127a0,0x193d8, // 320 - 0x1c9ee,0x16fa0,0x12790,0x193cc,0x16f90,0x1b7cc,0x193c6,0x16f88,0x12784,0x16f84, // 330 - 0x12782,0x127d8,0x193ee,0x16fd8,0x127cc,0x16fcc,0x127c6,0x16fc6,0x127ee,0x1f650, // 340 - 0x1fb2c,0x165f8,0x1f648,0x1fb26,0x164fc,0x1f644,0x1647e,0x1f642,0x1e450,0x1f22c, // 350 - 0x1ecd0,0x1e448,0x1f226,0x1ecc8,0x1f666,0x1ecc4,0x1e442,0x1ecc2,0x1c8d0,0x1e46c, // 360 - 0x1d9d0,0x1c8c8,0x1e466,0x1d9c8,0x1ece6,0x1d9c4,0x1c8c2,0x1d9c2,0x191d0,0x1c8ec, // 370 - 0x1b3d0,0x191c8,0x1c8e6,0x1b3c8,0x1d9e6,0x1b3c4,0x191c2,0x1b3c2,0x123d0,0x191ec, // 380 - 0x167d0,0x123c8,0x191e6,0x167c8,0x1b3e6,0x167c4,0x123c2,0x167c2,0x123ec,0x167ec, // 390 - 0x123e6,0x167e6,0x1f628,0x1fb16,0x162fc,0x1f624,0x1627e,0x1f622,0x1e428,0x1f216, // 400 - 0x1ec68,0x1f636,0x1ec64,0x1e422,0x1ec62,0x1c868,0x1e436,0x1d8e8,0x1c864,0x1d8e4, // 410 - 0x1c862,0x1d8e2,0x190e8,0x1c876,0x1b1e8,0x1d8f6,0x1b1e4,0x190e2,0x1b1e2,0x121e8, // 420 - 0x190f6,0x163e8,0x121e4,0x163e4,0x121e2,0x163e2,0x121f6,0x163f6,0x1f614,0x1617e, // 430 - 0x1f612,0x1e414,0x1ec34,0x1e412,0x1ec32,0x1c834,0x1d874,0x1c832,0x1d872,0x19074, // 440 - 0x1b0f4,0x19072,0x1b0f2,0x120f4,0x161f4,0x120f2,0x161f2,0x1f60a,0x1e40a,0x1ec1a, // 450 - 0x1c81a,0x1d83a,0x1903a,0x1b07a,0x1e2a0,0x1f158,0x1f8ae,0x1e290,0x1f14c,0x1e288, // 460 - 0x1f146,0x1e284,0x1e282,0x1c5a0,0x1e2d8,0x1f16e,0x1c590,0x1e2cc,0x1c588,0x1e2c6, // 470 - 0x1c584,0x1c582,0x18ba0,0x1c5d8,0x1e2ee,0x18b90,0x1c5cc,0x18b88,0x1c5c6,0x18b84, // 480 - 0x18b82,0x117a0,0x18bd8,0x1c5ee,0x11790,0x18bcc,0x11788,0x18bc6,0x11784,0x11782, // 490 - 0x117d8,0x18bee,0x117cc,0x117c6,0x117ee,0x1f350,0x1f9ac,0x135f8,0x1f348,0x1f9a6, // 500 - 0x134fc,0x1f344,0x1347e,0x1f342,0x1e250,0x1f12c,0x1e6d0,0x1e248,0x1f126,0x1e6c8, // 510 - 0x1f366,0x1e6c4,0x1e242,0x1e6c2,0x1c4d0,0x1e26c,0x1cdd0,0x1c4c8,0x1e266,0x1cdc8, // 520 - 0x1e6e6,0x1cdc4,0x1c4c2,0x1cdc2,0x189d0,0x1c4ec,0x19bd0,0x189c8,0x1c4e6,0x19bc8, // 530 - 0x1cde6,0x19bc4,0x189c2,0x19bc2,0x113d0,0x189ec,0x137d0,0x113c8,0x189e6,0x137c8, // 540 - 0x19be6,0x137c4,0x113c2,0x137c2,0x113ec,0x137ec,0x113e6,0x137e6,0x1fba8,0x175f0, // 550 - 0x1bafc,0x1fba4,0x174f8,0x1ba7e,0x1fba2,0x1747c,0x1743e,0x1f328,0x1f996,0x132fc, // 560 - 0x1f768,0x1fbb6,0x176fc,0x1327e,0x1f764,0x1f322,0x1767e,0x1f762,0x1e228,0x1f116, // 570 - 0x1e668,0x1e224,0x1eee8,0x1f776,0x1e222,0x1eee4,0x1e662,0x1eee2,0x1c468,0x1e236, // 580 - 0x1cce8,0x1c464,0x1dde8,0x1cce4,0x1c462,0x1dde4,0x1cce2,0x1dde2,0x188e8,0x1c476, // 590 - 0x199e8,0x188e4,0x1bbe8,0x199e4,0x188e2,0x1bbe4,0x199e2,0x1bbe2,0x111e8,0x188f6, // 600 - 0x133e8,0x111e4,0x177e8,0x133e4,0x111e2,0x177e4,0x133e2,0x177e2,0x111f6,0x133f6, // 610 - 0x1fb94,0x172f8,0x1b97e,0x1fb92,0x1727c,0x1723e,0x1f314,0x1317e,0x1f734,0x1f312, // 620 - 0x1737e,0x1f732,0x1e214,0x1e634,0x1e212,0x1ee74,0x1e632,0x1ee72,0x1c434,0x1cc74, // 630 - 0x1c432,0x1dcf4,0x1cc72,0x1dcf2,0x18874,0x198f4,0x18872,0x1b9f4,0x198f2,0x1b9f2, // 640 - 0x110f4,0x131f4,0x110f2,0x173f4,0x131f2,0x173f2,0x1fb8a,0x1717c,0x1713e,0x1f30a, // 650 - 0x1f71a,0x1e20a,0x1e61a,0x1ee3a,0x1c41a,0x1cc3a,0x1dc7a,0x1883a,0x1987a,0x1b8fa, // 660 - 0x1107a,0x130fa,0x171fa,0x170be,0x1e150,0x1f0ac,0x1e148,0x1f0a6,0x1e144,0x1e142, // 670 - 0x1c2d0,0x1e16c,0x1c2c8,0x1e166,0x1c2c4,0x1c2c2,0x185d0,0x1c2ec,0x185c8,0x1c2e6, // 680 - 0x185c4,0x185c2,0x10bd0,0x185ec,0x10bc8,0x185e6,0x10bc4,0x10bc2,0x10bec,0x10be6, // 690 - 0x1f1a8,0x1f8d6,0x11afc,0x1f1a4,0x11a7e,0x1f1a2,0x1e128,0x1f096,0x1e368,0x1e124, // 700 - 0x1e364,0x1e122,0x1e362,0x1c268,0x1e136,0x1c6e8,0x1c264,0x1c6e4,0x1c262,0x1c6e2, // 710 - 0x184e8,0x1c276,0x18de8,0x184e4,0x18de4,0x184e2,0x18de2,0x109e8,0x184f6,0x11be8, // 720 - 0x109e4,0x11be4,0x109e2,0x11be2,0x109f6,0x11bf6,0x1f9d4,0x13af8,0x19d7e,0x1f9d2, // 730 - 0x13a7c,0x13a3e,0x1f194,0x1197e,0x1f3b4,0x1f192,0x13b7e,0x1f3b2,0x1e114,0x1e334, // 740 - 0x1e112,0x1e774,0x1e332,0x1e772,0x1c234,0x1c674,0x1c232,0x1cef4,0x1c672,0x1cef2, // 750 - 0x18474,0x18cf4,0x18472,0x19df4,0x18cf2,0x19df2,0x108f4,0x119f4,0x108f2,0x13bf4, // 760 - 0x119f2,0x13bf2,0x17af0,0x1bd7c,0x17a78,0x1bd3e,0x17a3c,0x17a1e,0x1f9ca,0x1397c, // 770 - 0x1fbda,0x17b7c,0x1393e,0x17b3e,0x1f18a,0x1f39a,0x1f7ba,0x1e10a,0x1e31a,0x1e73a, // 780 - 0x1ef7a,0x1c21a,0x1c63a,0x1ce7a,0x1defa,0x1843a,0x18c7a,0x19cfa,0x1bdfa,0x1087a, // 790 - 0x118fa,0x139fa,0x17978,0x1bcbe,0x1793c,0x1791e,0x138be,0x179be,0x178bc,0x1789e, // 800 - 0x1785e,0x1e0a8,0x1e0a4,0x1e0a2,0x1c168,0x1e0b6,0x1c164,0x1c162,0x182e8,0x1c176, // 810 - 0x182e4,0x182e2,0x105e8,0x182f6,0x105e4,0x105e2,0x105f6,0x1f0d4,0x10d7e,0x1f0d2, // 820 - 0x1e094,0x1e1b4,0x1e092,0x1e1b2,0x1c134,0x1c374,0x1c132,0x1c372,0x18274,0x186f4, // 830 - 0x18272,0x186f2,0x104f4,0x10df4,0x104f2,0x10df2,0x1f8ea,0x11d7c,0x11d3e,0x1f0ca, // 840 - 0x1f1da,0x1e08a,0x1e19a,0x1e3ba,0x1c11a,0x1c33a,0x1c77a,0x1823a,0x1867a,0x18efa, // 850 - 0x1047a,0x10cfa,0x11dfa,0x13d78,0x19ebe,0x13d3c,0x13d1e,0x11cbe,0x13dbe,0x17d70, // 860 - 0x1bebc,0x17d38,0x1be9e,0x17d1c,0x17d0e,0x13cbc,0x17dbc,0x13c9e,0x17d9e,0x17cb8, // 870 - 0x1be5e,0x17c9c,0x17c8e,0x13c5e,0x17cde,0x17c5c,0x17c4e,0x17c2e,0x1c0b4,0x1c0b2, // 880 - 0x18174,0x18172,0x102f4,0x102f2,0x1e0da,0x1c09a,0x1c1ba,0x1813a,0x1837a,0x1027a, // 890 - 0x106fa,0x10ebe,0x11ebc,0x11e9e,0x13eb8,0x19f5e,0x13e9c,0x13e8e,0x11e5e,0x13ede, // 900 - 0x17eb0,0x1bf5c,0x17e98,0x1bf4e,0x17e8c,0x17e86,0x13e5c,0x17edc,0x13e4e,0x17ece, // 910 - 0x17e58,0x1bf2e,0x17e4c,0x17e46,0x13e2e,0x17e6e,0x17e2c,0x17e26,0x10f5e,0x11f5c, // 920 - 0x11f4e,0x13f58,0x19fae,0x13f4c,0x13f46,0x11f2e,0x13f6e,0x13f2c,0x13f26), // 929 - array( // cluster 6 ----------------------------------------------------------------------- - 0x1abe0,0x1d5f8,0x153c0,0x1a9f0,0x1d4fc,0x151e0,0x1a8f8,0x1d47e,0x150f0,0x1a87c, // 10 - 0x15078,0x1fad0,0x15be0,0x1adf8,0x1fac8,0x159f0,0x1acfc,0x1fac4,0x158f8,0x1ac7e, // 20 - 0x1fac2,0x1587c,0x1f5d0,0x1faec,0x15df8,0x1f5c8,0x1fae6,0x15cfc,0x1f5c4,0x15c7e, // 30 - 0x1f5c2,0x1ebd0,0x1f5ec,0x1ebc8,0x1f5e6,0x1ebc4,0x1ebc2,0x1d7d0,0x1ebec,0x1d7c8, // 40 - 0x1ebe6,0x1d7c4,0x1d7c2,0x1afd0,0x1d7ec,0x1afc8,0x1d7e6,0x1afc4,0x14bc0,0x1a5f0, // 50 - 0x1d2fc,0x149e0,0x1a4f8,0x1d27e,0x148f0,0x1a47c,0x14878,0x1a43e,0x1483c,0x1fa68, // 60 - 0x14df0,0x1a6fc,0x1fa64,0x14cf8,0x1a67e,0x1fa62,0x14c7c,0x14c3e,0x1f4e8,0x1fa76, // 70 - 0x14efc,0x1f4e4,0x14e7e,0x1f4e2,0x1e9e8,0x1f4f6,0x1e9e4,0x1e9e2,0x1d3e8,0x1e9f6, // 80 - 0x1d3e4,0x1d3e2,0x1a7e8,0x1d3f6,0x1a7e4,0x1a7e2,0x145e0,0x1a2f8,0x1d17e,0x144f0, // 90 - 0x1a27c,0x14478,0x1a23e,0x1443c,0x1441e,0x1fa34,0x146f8,0x1a37e,0x1fa32,0x1467c, // 100 - 0x1463e,0x1f474,0x1477e,0x1f472,0x1e8f4,0x1e8f2,0x1d1f4,0x1d1f2,0x1a3f4,0x1a3f2, // 110 - 0x142f0,0x1a17c,0x14278,0x1a13e,0x1423c,0x1421e,0x1fa1a,0x1437c,0x1433e,0x1f43a, // 120 - 0x1e87a,0x1d0fa,0x14178,0x1a0be,0x1413c,0x1411e,0x141be,0x140bc,0x1409e,0x12bc0, // 130 - 0x195f0,0x1cafc,0x129e0,0x194f8,0x1ca7e,0x128f0,0x1947c,0x12878,0x1943e,0x1283c, // 140 - 0x1f968,0x12df0,0x196fc,0x1f964,0x12cf8,0x1967e,0x1f962,0x12c7c,0x12c3e,0x1f2e8, // 150 - 0x1f976,0x12efc,0x1f2e4,0x12e7e,0x1f2e2,0x1e5e8,0x1f2f6,0x1e5e4,0x1e5e2,0x1cbe8, // 160 - 0x1e5f6,0x1cbe4,0x1cbe2,0x197e8,0x1cbf6,0x197e4,0x197e2,0x1b5e0,0x1daf8,0x1ed7e, // 170 - 0x169c0,0x1b4f0,0x1da7c,0x168e0,0x1b478,0x1da3e,0x16870,0x1b43c,0x16838,0x1b41e, // 180 - 0x1681c,0x125e0,0x192f8,0x1c97e,0x16de0,0x124f0,0x1927c,0x16cf0,0x1b67c,0x1923e, // 190 - 0x16c78,0x1243c,0x16c3c,0x1241e,0x16c1e,0x1f934,0x126f8,0x1937e,0x1fb74,0x1f932, // 200 - 0x16ef8,0x1267c,0x1fb72,0x16e7c,0x1263e,0x16e3e,0x1f274,0x1277e,0x1f6f4,0x1f272, // 210 - 0x16f7e,0x1f6f2,0x1e4f4,0x1edf4,0x1e4f2,0x1edf2,0x1c9f4,0x1dbf4,0x1c9f2,0x1dbf2, // 220 - 0x193f4,0x193f2,0x165c0,0x1b2f0,0x1d97c,0x164e0,0x1b278,0x1d93e,0x16470,0x1b23c, // 230 - 0x16438,0x1b21e,0x1641c,0x1640e,0x122f0,0x1917c,0x166f0,0x12278,0x1913e,0x16678, // 240 - 0x1b33e,0x1663c,0x1221e,0x1661e,0x1f91a,0x1237c,0x1fb3a,0x1677c,0x1233e,0x1673e, // 250 - 0x1f23a,0x1f67a,0x1e47a,0x1ecfa,0x1c8fa,0x1d9fa,0x191fa,0x162e0,0x1b178,0x1d8be, // 260 - 0x16270,0x1b13c,0x16238,0x1b11e,0x1621c,0x1620e,0x12178,0x190be,0x16378,0x1213c, // 270 - 0x1633c,0x1211e,0x1631e,0x121be,0x163be,0x16170,0x1b0bc,0x16138,0x1b09e,0x1611c, // 280 - 0x1610e,0x120bc,0x161bc,0x1209e,0x1619e,0x160b8,0x1b05e,0x1609c,0x1608e,0x1205e, // 290 - 0x160de,0x1605c,0x1604e,0x115e0,0x18af8,0x1c57e,0x114f0,0x18a7c,0x11478,0x18a3e, // 300 - 0x1143c,0x1141e,0x1f8b4,0x116f8,0x18b7e,0x1f8b2,0x1167c,0x1163e,0x1f174,0x1177e, // 310 - 0x1f172,0x1e2f4,0x1e2f2,0x1c5f4,0x1c5f2,0x18bf4,0x18bf2,0x135c0,0x19af0,0x1cd7c, // 320 - 0x134e0,0x19a78,0x1cd3e,0x13470,0x19a3c,0x13438,0x19a1e,0x1341c,0x1340e,0x112f0, // 330 - 0x1897c,0x136f0,0x11278,0x1893e,0x13678,0x19b3e,0x1363c,0x1121e,0x1361e,0x1f89a, // 340 - 0x1137c,0x1f9ba,0x1377c,0x1133e,0x1373e,0x1f13a,0x1f37a,0x1e27a,0x1e6fa,0x1c4fa, // 350 - 0x1cdfa,0x189fa,0x1bae0,0x1dd78,0x1eebe,0x174c0,0x1ba70,0x1dd3c,0x17460,0x1ba38, // 360 - 0x1dd1e,0x17430,0x1ba1c,0x17418,0x1ba0e,0x1740c,0x132e0,0x19978,0x1ccbe,0x176e0, // 370 - 0x13270,0x1993c,0x17670,0x1bb3c,0x1991e,0x17638,0x1321c,0x1761c,0x1320e,0x1760e, // 380 - 0x11178,0x188be,0x13378,0x1113c,0x17778,0x1333c,0x1111e,0x1773c,0x1331e,0x1771e, // 390 - 0x111be,0x133be,0x177be,0x172c0,0x1b970,0x1dcbc,0x17260,0x1b938,0x1dc9e,0x17230, // 400 - 0x1b91c,0x17218,0x1b90e,0x1720c,0x17206,0x13170,0x198bc,0x17370,0x13138,0x1989e, // 410 - 0x17338,0x1b99e,0x1731c,0x1310e,0x1730e,0x110bc,0x131bc,0x1109e,0x173bc,0x1319e, // 420 - 0x1739e,0x17160,0x1b8b8,0x1dc5e,0x17130,0x1b89c,0x17118,0x1b88e,0x1710c,0x17106, // 430 - 0x130b8,0x1985e,0x171b8,0x1309c,0x1719c,0x1308e,0x1718e,0x1105e,0x130de,0x171de, // 440 - 0x170b0,0x1b85c,0x17098,0x1b84e,0x1708c,0x17086,0x1305c,0x170dc,0x1304e,0x170ce, // 450 - 0x17058,0x1b82e,0x1704c,0x17046,0x1302e,0x1706e,0x1702c,0x17026,0x10af0,0x1857c, // 460 - 0x10a78,0x1853e,0x10a3c,0x10a1e,0x10b7c,0x10b3e,0x1f0ba,0x1e17a,0x1c2fa,0x185fa, // 470 - 0x11ae0,0x18d78,0x1c6be,0x11a70,0x18d3c,0x11a38,0x18d1e,0x11a1c,0x11a0e,0x10978, // 480 - 0x184be,0x11b78,0x1093c,0x11b3c,0x1091e,0x11b1e,0x109be,0x11bbe,0x13ac0,0x19d70, // 490 - 0x1cebc,0x13a60,0x19d38,0x1ce9e,0x13a30,0x19d1c,0x13a18,0x19d0e,0x13a0c,0x13a06, // 500 - 0x11970,0x18cbc,0x13b70,0x11938,0x18c9e,0x13b38,0x1191c,0x13b1c,0x1190e,0x13b0e, // 510 - 0x108bc,0x119bc,0x1089e,0x13bbc,0x1199e,0x13b9e,0x1bd60,0x1deb8,0x1ef5e,0x17a40, // 520 - 0x1bd30,0x1de9c,0x17a20,0x1bd18,0x1de8e,0x17a10,0x1bd0c,0x17a08,0x1bd06,0x17a04, // 530 - 0x13960,0x19cb8,0x1ce5e,0x17b60,0x13930,0x19c9c,0x17b30,0x1bd9c,0x19c8e,0x17b18, // 540 - 0x1390c,0x17b0c,0x13906,0x17b06,0x118b8,0x18c5e,0x139b8,0x1189c,0x17bb8,0x1399c, // 550 - 0x1188e,0x17b9c,0x1398e,0x17b8e,0x1085e,0x118de,0x139de,0x17bde,0x17940,0x1bcb0, // 560 - 0x1de5c,0x17920,0x1bc98,0x1de4e,0x17910,0x1bc8c,0x17908,0x1bc86,0x17904,0x17902, // 570 - 0x138b0,0x19c5c,0x179b0,0x13898,0x19c4e,0x17998,0x1bcce,0x1798c,0x13886,0x17986, // 580 - 0x1185c,0x138dc,0x1184e,0x179dc,0x138ce,0x179ce,0x178a0,0x1bc58,0x1de2e,0x17890, // 590 - 0x1bc4c,0x17888,0x1bc46,0x17884,0x17882,0x13858,0x19c2e,0x178d8,0x1384c,0x178cc, // 600 - 0x13846,0x178c6,0x1182e,0x1386e,0x178ee,0x17850,0x1bc2c,0x17848,0x1bc26,0x17844, // 610 - 0x17842,0x1382c,0x1786c,0x13826,0x17866,0x17828,0x1bc16,0x17824,0x17822,0x13816, // 620 - 0x17836,0x10578,0x182be,0x1053c,0x1051e,0x105be,0x10d70,0x186bc,0x10d38,0x1869e, // 630 - 0x10d1c,0x10d0e,0x104bc,0x10dbc,0x1049e,0x10d9e,0x11d60,0x18eb8,0x1c75e,0x11d30, // 640 - 0x18e9c,0x11d18,0x18e8e,0x11d0c,0x11d06,0x10cb8,0x1865e,0x11db8,0x10c9c,0x11d9c, // 650 - 0x10c8e,0x11d8e,0x1045e,0x10cde,0x11dde,0x13d40,0x19eb0,0x1cf5c,0x13d20,0x19e98, // 660 - 0x1cf4e,0x13d10,0x19e8c,0x13d08,0x19e86,0x13d04,0x13d02,0x11cb0,0x18e5c,0x13db0, // 670 - 0x11c98,0x18e4e,0x13d98,0x19ece,0x13d8c,0x11c86,0x13d86,0x10c5c,0x11cdc,0x10c4e, // 680 - 0x13ddc,0x11cce,0x13dce,0x1bea0,0x1df58,0x1efae,0x1be90,0x1df4c,0x1be88,0x1df46, // 690 - 0x1be84,0x1be82,0x13ca0,0x19e58,0x1cf2e,0x17da0,0x13c90,0x19e4c,0x17d90,0x1becc, // 700 - 0x19e46,0x17d88,0x13c84,0x17d84,0x13c82,0x17d82,0x11c58,0x18e2e,0x13cd8,0x11c4c, // 710 - 0x17dd8,0x13ccc,0x11c46,0x17dcc,0x13cc6,0x17dc6,0x10c2e,0x11c6e,0x13cee,0x17dee, // 720 - 0x1be50,0x1df2c,0x1be48,0x1df26,0x1be44,0x1be42,0x13c50,0x19e2c,0x17cd0,0x13c48, // 730 - 0x19e26,0x17cc8,0x1be66,0x17cc4,0x13c42,0x17cc2,0x11c2c,0x13c6c,0x11c26,0x17cec, // 740 - 0x13c66,0x17ce6,0x1be28,0x1df16,0x1be24,0x1be22,0x13c28,0x19e16,0x17c68,0x13c24, // 750 - 0x17c64,0x13c22,0x17c62,0x11c16,0x13c36,0x17c76,0x1be14,0x1be12,0x13c14,0x17c34, // 760 - 0x13c12,0x17c32,0x102bc,0x1029e,0x106b8,0x1835e,0x1069c,0x1068e,0x1025e,0x106de, // 770 - 0x10eb0,0x1875c,0x10e98,0x1874e,0x10e8c,0x10e86,0x1065c,0x10edc,0x1064e,0x10ece, // 780 - 0x11ea0,0x18f58,0x1c7ae,0x11e90,0x18f4c,0x11e88,0x18f46,0x11e84,0x11e82,0x10e58, // 790 - 0x1872e,0x11ed8,0x18f6e,0x11ecc,0x10e46,0x11ec6,0x1062e,0x10e6e,0x11eee,0x19f50, // 800 - 0x1cfac,0x19f48,0x1cfa6,0x19f44,0x19f42,0x11e50,0x18f2c,0x13ed0,0x19f6c,0x18f26, // 810 - 0x13ec8,0x11e44,0x13ec4,0x11e42,0x13ec2,0x10e2c,0x11e6c,0x10e26,0x13eec,0x11e66, // 820 - 0x13ee6,0x1dfa8,0x1efd6,0x1dfa4,0x1dfa2,0x19f28,0x1cf96,0x1bf68,0x19f24,0x1bf64, // 830 - 0x19f22,0x1bf62,0x11e28,0x18f16,0x13e68,0x11e24,0x17ee8,0x13e64,0x11e22,0x17ee4, // 840 - 0x13e62,0x17ee2,0x10e16,0x11e36,0x13e76,0x17ef6,0x1df94,0x1df92,0x19f14,0x1bf34, // 850 - 0x19f12,0x1bf32,0x11e14,0x13e34,0x11e12,0x17e74,0x13e32,0x17e72,0x1df8a,0x19f0a, // 860 - 0x1bf1a,0x11e0a,0x13e1a,0x17e3a,0x1035c,0x1034e,0x10758,0x183ae,0x1074c,0x10746, // 870 - 0x1032e,0x1076e,0x10f50,0x187ac,0x10f48,0x187a6,0x10f44,0x10f42,0x1072c,0x10f6c, // 880 - 0x10726,0x10f66,0x18fa8,0x1c7d6,0x18fa4,0x18fa2,0x10f28,0x18796,0x11f68,0x18fb6, // 890 - 0x11f64,0x10f22,0x11f62,0x10716,0x10f36,0x11f76,0x1cfd4,0x1cfd2,0x18f94,0x19fb4, // 900 - 0x18f92,0x19fb2,0x10f14,0x11f34,0x10f12,0x13f74,0x11f32,0x13f72,0x1cfca,0x18f8a, // 910 - 0x19f9a,0x10f0a,0x11f1a,0x13f3a,0x103ac,0x103a6,0x107a8,0x183d6,0x107a4,0x107a2, // 920 - 0x10396,0x107b6,0x187d4,0x187d2,0x10794,0x10fb4,0x10792,0x10fb2,0x1c7ea) // 929 - ); // end of $clusters array - - /** - * @var Factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8) - * @access protected - */ - protected $rsfactors = array( - array( // ECL 0 (2 factors) ------------------------------------------------------------------------------- - 0x01b,0x395), // 2 - array( // ECL 1 (4 factors) ------------------------------------------------------------------------------- - 0x20a,0x238,0x2d3,0x329), // 4 - array( // ECL 2 (8 factors) ------------------------------------------------------------------------------- - 0x0ed,0x134,0x1b4,0x11c,0x286,0x28d,0x1ac,0x17b), // 8 - array( // ECL 3 (16 factors) ------------------------------------------------------------------------------ - 0x112,0x232,0x0e8,0x2f3,0x257,0x20c,0x321,0x084,0x127,0x074,0x1ba,0x1ac,0x127,0x02a,0x0b0,0x041),// 16 - array( // ECL 4 (32 factors) ------------------------------------------------------------------------------ - 0x169,0x23f,0x39a,0x20d,0x0b0,0x24a,0x280,0x141,0x218,0x2e6,0x2a5,0x2e6,0x2af,0x11c,0x0c1,0x205, // 16 - 0x111,0x1ee,0x107,0x093,0x251,0x320,0x23b,0x140,0x323,0x085,0x0e7,0x186,0x2ad,0x14a,0x03f,0x19a),// 32 - array( // ECL 5 (64 factors) ------------------------------------------------------------------------------ - 0x21b,0x1a6,0x006,0x05d,0x35e,0x303,0x1c5,0x06a,0x262,0x11f,0x06b,0x1f9,0x2dd,0x36d,0x17d,0x264, // 16 - 0x2d3,0x1dc,0x1ce,0x0ac,0x1ae,0x261,0x35a,0x336,0x21f,0x178,0x1ff,0x190,0x2a0,0x2fa,0x11b,0x0b8, // 32 - 0x1b8,0x023,0x207,0x01f,0x1cc,0x252,0x0e1,0x217,0x205,0x160,0x25d,0x09e,0x28b,0x0c9,0x1e8,0x1f6, // 48 - 0x288,0x2dd,0x2cd,0x053,0x194,0x061,0x118,0x303,0x348,0x275,0x004,0x17d,0x34b,0x26f,0x108,0x21f),// 64 - array( // ECL 6 (128 factors) ----------------------------------------------------------------------------- - 0x209,0x136,0x360,0x223,0x35a,0x244,0x128,0x17b,0x035,0x30b,0x381,0x1bc,0x190,0x39d,0x2ed,0x19f, // 16 - 0x336,0x05d,0x0d9,0x0d0,0x3a0,0x0f4,0x247,0x26c,0x0f6,0x094,0x1bf,0x277,0x124,0x38c,0x1ea,0x2c0, // 32 - 0x204,0x102,0x1c9,0x38b,0x252,0x2d3,0x2a2,0x124,0x110,0x060,0x2ac,0x1b0,0x2ae,0x25e,0x35c,0x239, // 48 - 0x0c1,0x0db,0x081,0x0ba,0x0ec,0x11f,0x0c0,0x307,0x116,0x0ad,0x028,0x17b,0x2c8,0x1cf,0x286,0x308, // 64 - 0x0ab,0x1eb,0x129,0x2fb,0x09c,0x2dc,0x05f,0x10e,0x1bf,0x05a,0x1fb,0x030,0x0e4,0x335,0x328,0x382, // 80 - 0x310,0x297,0x273,0x17a,0x17e,0x106,0x17c,0x25a,0x2f2,0x150,0x059,0x266,0x057,0x1b0,0x29e,0x268, // 96 - 0x09d,0x176,0x0f2,0x2d6,0x258,0x10d,0x177,0x382,0x34d,0x1c6,0x162,0x082,0x32e,0x24b,0x324,0x022, // 112 - 0x0d3,0x14a,0x21b,0x129,0x33b,0x361,0x025,0x205,0x342,0x13b,0x226,0x056,0x321,0x004,0x06c,0x21b),// 128 - array( // ECL 7 (256 factors) ----------------------------------------------------------------------------- - 0x20c,0x37e,0x04b,0x2fe,0x372,0x359,0x04a,0x0cc,0x052,0x24a,0x2c4,0x0fa,0x389,0x312,0x08a,0x2d0, // 16 - 0x35a,0x0c2,0x137,0x391,0x113,0x0be,0x177,0x352,0x1b6,0x2dd,0x0c2,0x118,0x0c9,0x118,0x33c,0x2f5, // 32 - 0x2c6,0x32e,0x397,0x059,0x044,0x239,0x00b,0x0cc,0x31c,0x25d,0x21c,0x391,0x321,0x2bc,0x31f,0x089, // 48 - 0x1b7,0x1a2,0x250,0x29c,0x161,0x35b,0x172,0x2b6,0x145,0x0f0,0x0d8,0x101,0x11c,0x225,0x0d1,0x374, // 64 - 0x13b,0x046,0x149,0x319,0x1ea,0x112,0x36d,0x0a2,0x2ed,0x32c,0x2ac,0x1cd,0x14e,0x178,0x351,0x209, // 80 - 0x133,0x123,0x323,0x2c8,0x013,0x166,0x18f,0x38c,0x067,0x1ff,0x033,0x008,0x205,0x0e1,0x121,0x1d6, // 96 - 0x27d,0x2db,0x042,0x0ff,0x395,0x10d,0x1cf,0x33e,0x2da,0x1b1,0x350,0x249,0x088,0x21a,0x38a,0x05a, // 112 - 0x002,0x122,0x2e7,0x0c7,0x28f,0x387,0x149,0x031,0x322,0x244,0x163,0x24c,0x0bc,0x1ce,0x00a,0x086, // 128 - 0x274,0x140,0x1df,0x082,0x2e3,0x047,0x107,0x13e,0x176,0x259,0x0c0,0x25d,0x08e,0x2a1,0x2af,0x0ea, // 144 - 0x2d2,0x180,0x0b1,0x2f0,0x25f,0x280,0x1c7,0x0c1,0x2b1,0x2c3,0x325,0x281,0x030,0x03c,0x2dc,0x26d, // 160 - 0x37f,0x220,0x105,0x354,0x28f,0x135,0x2b9,0x2f3,0x2f4,0x03c,0x0e7,0x305,0x1b2,0x1a5,0x2d6,0x210, // 176 - 0x1f7,0x076,0x031,0x31b,0x020,0x090,0x1f4,0x0ee,0x344,0x18a,0x118,0x236,0x13f,0x009,0x287,0x226, // 192 - 0x049,0x392,0x156,0x07e,0x020,0x2a9,0x14b,0x318,0x26c,0x03c,0x261,0x1b9,0x0b4,0x317,0x37d,0x2f2, // 208 - 0x25d,0x17f,0x0e4,0x2ed,0x2f8,0x0d5,0x036,0x129,0x086,0x036,0x342,0x12b,0x39a,0x0bf,0x38e,0x214, // 224 - 0x261,0x33d,0x0bd,0x014,0x0a7,0x01d,0x368,0x1c1,0x053,0x192,0x029,0x290,0x1f9,0x243,0x1e1,0x0ad, // 240 - 0x194,0x0fb,0x2b0,0x05f,0x1f1,0x22b,0x282,0x21f,0x133,0x09f,0x39c,0x22e,0x288,0x037,0x1f1,0x00a),// 256 - array( // ECL 8 (512 factors) ----------------------------------------------------------------------------- - 0x160,0x04d,0x175,0x1f8,0x023,0x257,0x1ac,0x0cf,0x199,0x23e,0x076,0x1f2,0x11d,0x17c,0x15e,0x1ec, // 16 - 0x0c5,0x109,0x398,0x09b,0x392,0x12b,0x0e5,0x283,0x126,0x367,0x132,0x058,0x057,0x0c1,0x160,0x30d, // 32 - 0x34e,0x04b,0x147,0x208,0x1b3,0x21f,0x0cb,0x29a,0x0f9,0x15a,0x30d,0x26d,0x280,0x10c,0x31a,0x216, // 48 - 0x21b,0x30d,0x198,0x186,0x284,0x066,0x1dc,0x1f3,0x122,0x278,0x221,0x025,0x35a,0x394,0x228,0x029, // 64 - 0x21e,0x121,0x07a,0x110,0x17f,0x320,0x1e5,0x062,0x2f0,0x1d8,0x2f9,0x06b,0x310,0x35c,0x292,0x2e5, // 80 - 0x122,0x0cc,0x2a9,0x197,0x357,0x055,0x063,0x03e,0x1e2,0x0b4,0x014,0x129,0x1c3,0x251,0x391,0x08e, // 96 - 0x328,0x2ac,0x11f,0x218,0x231,0x04c,0x28d,0x383,0x2d9,0x237,0x2e8,0x186,0x201,0x0c0,0x204,0x102, // 112 - 0x0f0,0x206,0x31a,0x18b,0x300,0x350,0x033,0x262,0x180,0x0a8,0x0be,0x33a,0x148,0x254,0x312,0x12f, // 128 - 0x23a,0x17d,0x19f,0x281,0x09c,0x0ed,0x097,0x1ad,0x213,0x0cf,0x2a4,0x2c6,0x059,0x0a8,0x130,0x192, // 144 - 0x028,0x2c4,0x23f,0x0a2,0x360,0x0e5,0x041,0x35d,0x349,0x200,0x0a4,0x1dd,0x0dd,0x05c,0x166,0x311, // 160 - 0x120,0x165,0x352,0x344,0x33b,0x2e0,0x2c3,0x05e,0x008,0x1ee,0x072,0x209,0x002,0x1f3,0x353,0x21f, // 176 - 0x098,0x2d9,0x303,0x05f,0x0f8,0x169,0x242,0x143,0x358,0x31d,0x121,0x033,0x2ac,0x1d2,0x215,0x334, // 192 - 0x29d,0x02d,0x386,0x1c4,0x0a7,0x156,0x0f4,0x0ad,0x023,0x1cf,0x28b,0x033,0x2bb,0x24f,0x1c4,0x242, // 208 - 0x025,0x07c,0x12a,0x14c,0x228,0x02b,0x1ab,0x077,0x296,0x309,0x1db,0x352,0x2fc,0x16c,0x242,0x38f, // 224 - 0x11b,0x2c7,0x1d8,0x1a4,0x0f5,0x120,0x252,0x18a,0x1ff,0x147,0x24d,0x309,0x2bb,0x2b0,0x02b,0x198, // 240 - 0x34a,0x17f,0x2d1,0x209,0x230,0x284,0x2ca,0x22f,0x03e,0x091,0x369,0x297,0x2c9,0x09f,0x2a0,0x2d9, // 256 - 0x270,0x03b,0x0c1,0x1a1,0x09e,0x0d1,0x233,0x234,0x157,0x2b5,0x06d,0x260,0x233,0x16d,0x0b5,0x304, // 272 - 0x2a5,0x136,0x0f8,0x161,0x2c4,0x19a,0x243,0x366,0x269,0x349,0x278,0x35c,0x121,0x218,0x023,0x309, // 288 - 0x26a,0x24a,0x1a8,0x341,0x04d,0x255,0x15a,0x10d,0x2f5,0x278,0x2b7,0x2ef,0x14b,0x0f7,0x0b8,0x02d, // 304 - 0x313,0x2a8,0x012,0x042,0x197,0x171,0x036,0x1ec,0x0e4,0x265,0x33e,0x39a,0x1b5,0x207,0x284,0x389, // 320 - 0x315,0x1a4,0x131,0x1b9,0x0cf,0x12c,0x37c,0x33b,0x08d,0x219,0x17d,0x296,0x201,0x038,0x0fc,0x155, // 336 - 0x0f2,0x31d,0x346,0x345,0x2d0,0x0e0,0x133,0x277,0x03d,0x057,0x230,0x136,0x2f4,0x299,0x18d,0x328, // 352 - 0x353,0x135,0x1d9,0x31b,0x17a,0x01f,0x287,0x393,0x1cb,0x326,0x24e,0x2db,0x1a9,0x0d8,0x224,0x0f9, // 368 - 0x141,0x371,0x2bb,0x217,0x2a1,0x30e,0x0d2,0x32f,0x389,0x12f,0x34b,0x39a,0x119,0x049,0x1d5,0x317, // 384 - 0x294,0x0a2,0x1f2,0x134,0x09b,0x1a6,0x38b,0x331,0x0bb,0x03e,0x010,0x1a9,0x217,0x150,0x11e,0x1b5, // 400 - 0x177,0x111,0x262,0x128,0x0b7,0x39b,0x074,0x29b,0x2ef,0x161,0x03e,0x16e,0x2b3,0x17b,0x2af,0x34a, // 416 - 0x025,0x165,0x2d0,0x2e6,0x14a,0x005,0x027,0x39b,0x137,0x1a8,0x0f2,0x2ed,0x141,0x036,0x29d,0x13c, // 432 - 0x156,0x12b,0x216,0x069,0x29b,0x1e8,0x280,0x2a0,0x240,0x21c,0x13c,0x1e6,0x2d1,0x262,0x02e,0x290, // 448 - 0x1bf,0x0ab,0x268,0x1d0,0x0be,0x213,0x129,0x141,0x2fa,0x2f0,0x215,0x0af,0x086,0x00e,0x17d,0x1b1, // 464 - 0x2cd,0x02d,0x06f,0x014,0x254,0x11c,0x2e0,0x08a,0x286,0x19b,0x36d,0x29d,0x08d,0x397,0x02d,0x30c, // 480 - 0x197,0x0a4,0x14c,0x383,0x0a5,0x2d6,0x258,0x145,0x1f2,0x28f,0x165,0x2f0,0x300,0x0df,0x351,0x287, // 496 - 0x03f,0x136,0x35f,0x0fb,0x16e,0x130,0x11a,0x2e2,0x2a3,0x19a,0x185,0x0f4,0x01f,0x079,0x12f,0x107) // 512 - ); - - /** - * This is the class constructor. - * Creates a PDF417 object - * @param string $code code to represent using PDF417 - * @param int $ecl error correction level (0-8); default -1 = automatic correction level - * @param float $aspectratio the width to height of the symbol (excluding quiet zones) - * òparam array $macro information for macro block - * @access public - */ - public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) { - $barcode_array = array(); - if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { - return false; - } - // get the input sequence array - $sequence = $this->getInputSequences($code); - $codewords = array(); // array of code-words - foreach($sequence as $seq) { - $cw = $this->getCompaction($seq[0], $seq[1], true); - $codewords = array_merge($codewords, $cw); - } - if ($codewords[0] == 900) { - // Text Alpha is the default mode, so remove the first code - array_shift($codewords); - } - // count number of codewords - $numcw = count($codewords); - if ($numcw > 925) { - // reached maximum data codeword capacity - return false; - } - // build macro control block codewords - if (!empty($macro)) { - $macrocw = array(); - // beginning of macro control block - $macrocw[] = 928; - // segment index - $cw = $this->getCompaction(902, sprintf('%05d', $macro['segment_index']), false); - $macrocw = array_merge($macrocw, $cw); - // file ID - $cw = $this->getCompaction(900, $macro['file_id'], false); - $macrocw = array_merge($macrocw, $cw); - // optional fields - $optmodes = array(900,902,902,900,900,902,902); - $optsize = array(-1,2,4,-1,-1,-1,2); - foreach ($optmodes as $k => $omode) { - if (isset($macro['option_'.$k])) { - $macrocw[] = 923; - $macrocw[] = $k; - if ($optsize[$k] == 2) { - $macro['option_'.$k] = sprintf('%05d', $macro['option_'.$k]); - } elseif ($optsize[$k] == 4) { - $macro['option_'.$k] = sprintf('%010d', $macro['option_'.$k]); - } - $cw = $this->getCompaction($omode, $macro['option_'.$k], false); - $macrocw = array_merge($macrocw, $cw); - } - } - if ($macro['segment_index'] == ($macro['segment_total'] - 1)) { - // end of control block - $macrocw[] = 922; - } - // update total codewords - $numcw += count($macrocw); - } - // set error correction level - $ecl = $this->getErrorCorrectionLevel($ecl, $numcw); - // number of codewords for error correction - $errsize = (2 << $ecl); - // calculate number of columns (number of codewords per row) and rows - $nce = ($numcw + $errsize + 1); - $cols = round((sqrt(4761 + (68 * $aspectratio * ROWHEIGHT * $nce)) - 69) / 34); - // adjust cols - if ($cols < 1) { - $cols = 1; - } elseif ($cols > 30) { - $cols = 30; - } - $rows = ceil($nce / $cols); - $size = ($cols * $rows); - // adjust rows - if (($rows < 3) OR ($rows > 90)) { - if ($rows < 3) { - $rows = 3; - } elseif ($rows > 90) { - $rows = 90; - } - $cols = ceil($size / $rows); - $size = ($cols * $rows); - } - if ($size > 928) { - // set dimensions to get maximum capacity - if (abs($aspectratio - (17 * 29 / 32)) < abs($aspectratio - (17 * 16 / 58))) { - $cols = 29; - $rows = 32; - } else { - $cols = 16; - $rows = 58; - } - $size = 928; - } - // calculate padding - $pad = ($size - $nce); - if ($pad > 0) { - if (($size - $rows) == $nce) { - --$rows; - $size -= $rows; - } else { - // add pading - $codewords = array_merge($codewords, array_fill(0, $pad, 900)); - } - } - if (!empty($macro)) { - // add macro section - $codewords = array_merge($codewords, $macrocw); - } - // Symbol Lenght Descriptor (number of data codewords including Symbol Lenght Descriptor and pad codewords) - $sld = $size - $errsize; - // add symbol length description - array_unshift($codewords, $sld); - // calculate error correction - $ecw = $this->getErrorCorrection($codewords, $ecl); - // add error correction codewords - $codewords = array_merge($codewords, $ecw); - // add horizontal quiet zones to start and stop patterns - $pstart = str_repeat('0', QUIETH).$this->start_pattern; - $pstop = $this->stop_pattern.str_repeat('0', QUIETH); - $barcode_array['num_rows'] = ($rows * ROWHEIGHT) + (2 * QUIETV); - $barcode_array['num_cols'] = (($cols + 2) * 17) + 35 + (2 * QUIETH); - $barcode_array['bcode'] = array(); - // build rows for vertical quiet zone - if (QUIETV > 0) { - $empty_row = array_fill(0, $barcode_array['num_cols'], 0); - for ($i = 0; $i < QUIETV; ++$i) { - // add vertical quiet rows - $barcode_array['bcode'][] = $empty_row; - } - } - $k = 0; // codeword index - $cid = 0; // initial cluster - // for each row - for ($r = 0; $r < $rows; ++$r) { - // row start code - $row = $pstart; - switch ($cid) { - case 0: { - $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3)); - break; - } - case 1: { - $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3)); - break; - } - case 2: { - $L = ((30 * intval($r / 3)) + ($cols - 1)); - break; - } - } - // left row indicator - $row .= sprintf('%17b', $this->clusters[$cid][$L]); - // for each column - for ($c = 0; $c < $cols; ++$c) { - $row .= sprintf('%17b', $this->clusters[$cid][$codewords[$k]]); - ++$k; - } - switch ($cid) { - case 0: { - $L = ((30 * intval($r / 3)) + ($cols - 1)); - break; - } - case 1: { - $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3)); - break; - } - case 2: { - $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3)); - break; - } - } - // right row indicator - $row .= sprintf('%17b', $this->clusters[$cid][$L]); - // row stop code - $row .= $pstop; - // convert the string to array - $arow = preg_split('//', $row, -1, PREG_SPLIT_NO_EMPTY); - // duplicate row to get the desired height - for ($h = 0; $h < ROWHEIGHT; ++$h) { - $barcode_array['bcode'][] = $arow; - } - ++$cid; - if ($cid > 2) { - $cid = 0; - } - } - if (QUIETV > 0) { - for ($i = 0; $i < QUIETV; ++$i) { - // add vertical quiet rows - $barcode_array['bcode'][] = $empty_row; - } - } - $this->barcode_array = $barcode_array; - } - - /** - * Returns a barcode array which is readable by TCPDF - * @return array barcode array readable by TCPDF; - * @access public - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Returns the error correction level (0-8) to be used - * @param int $ecl error correction level - * @param int $numcw number of data codewords - * @return int error correction level - * @access protected - */ - protected function getErrorCorrectionLevel($ecl, $numcw) { - // get maximum correction level - $maxecl = 8; // starting error level - $maxerrsize = (928 - $numcw); // available codewords for error - while ($maxecl > 0) { - $errsize = (2 << $ecl); - if ($maxerrsize >= $errsize) { - break; - } - --$maxecl; - } - // check for automatic levels - if (($ecl < 0) OR ($ecl > 8)) { - if ($numcw < 41) { - $ecl = 2; - } elseif ($numcw < 161) { - $ecl = 3; - } elseif ($numcw < 321) { - $ecl = 4; - } elseif ($numcw < 864) { - $ecl = 5; - } else { - $ecl = $maxecl; - } - } - if ($ecl > $maxecl) { - $ecl = $maxecl; - } - return $ecl; - } - - /** - * Returns the error correction codewords - * @param array $cw array of codewords including Symbol Lenght Descriptor and pad - * @param int $ecl error correction level 0-8 - * @return array of error correction codewords - * @access protected - */ - protected function getErrorCorrection($cw, $ecl) { - // get error correction coefficients - $ecc = $this->rsfactors[$ecl]; - // number of error correction factors - $eclsize = (2 << $ecl); - // maximum index for $rsfactors[$ecl] - $eclmaxid = ($eclsize - 1); - // initialize array of error correction codewords - $ecw = array_fill(0, $eclsize, 0); - // for each data codeword - foreach($cw as $k => $d) { - $t1 = ($d + $ecw[$eclmaxid]) % 929; - for ($j = $eclmaxid; $j > 0; --$j) { - $t2 = ($t1 * $ecc[$j]) % 929; - $t3 = 929 - $t2; - $ecw[$j] = ($ecw[($j - 1)] + $t3) % 929; - } - $t2 = ($t1 * $ecc[0]) % 929; - $t3 = 929 - $t2; - $ecw[0] = $t3 % 929; - } - foreach($ecw as $j => $e) { - if ($e != 0) { - $ecw[$j] = 929 - $e; - } - } - $ecw = array_reverse($ecw); - return $ecw; - } - - /** - * Create array of sequences from input - * @param string $code code - * @return bidimensional array containing characters and classification - * @access protected - */ - protected function getInputSequences($code) { - $sequence_array = array(); // array to be returned - $numseq = array(); - // get numeric sequences - preg_match_all('/([0-9]{13,})/', $code, $numseq, PREG_OFFSET_CAPTURE); - $numseq[1][] = array('', strlen($code)); - $offset = 0; - foreach($numseq[1] as $seq) { - $seqlen = strlen($seq[0]); - if ($seq[1] > 0) { - // extract text sequence before the number sequence - $prevseq = substr($code, $offset, ($seq[1] - $offset)); - $textseq = array(); - // get text sequences - preg_match_all('/([\x09\x0a\x0d\x20-\x7e]{5,})/', $prevseq, $textseq, PREG_OFFSET_CAPTURE); - $textseq[1][] = array('', strlen($prevseq)); - $txtoffset = 0; - foreach($textseq[1] as $txtseq) { - $txtseqlen = strlen($txtseq[0]); - if ($txtseq[1] > 0) { - // extract byte sequence before the text sequence - $prevtxtseq = substr($prevseq, $txtoffset, ($txtseq[1] - $txtoffset)); - if (strlen($prevtxtseq) > 0) { - // add BYTE sequence - if ((strlen($prevtxtseq) == 1) AND ((count($sequence_array) > 0) AND ($sequence_array[(count($sequence_array) - 1)][0] == 900))) { - $sequence_array[] = array(913, $prevtxtseq); - } elseif ((strlen($prevtxtseq) % 6) == 0) { - $sequence_array[] = array(924, $prevtxtseq); - } else { - $sequence_array[] = array(901, $prevtxtseq); - } - } - } - if ($txtseqlen > 0) { - // add numeric sequence - $sequence_array[] = array(900, $txtseq[0]); - } - $txtoffset = $txtseq[1] + $txtseqlen; - } - } - if ($seqlen > 0) { - // add numeric sequence - $sequence_array[] = array(902, $seq[0]); - } - $offset = $seq[1] + $seqlen; - } - return $sequence_array; - } - - /** - * Compact data by mode. - * @param int $mode compaction mode number - * @param string $code data to compact - * @param boolean $addmode if true add the mode codeword at first position - * @return array of codewords - * @access protected - */ - protected function getCompaction($mode, $code, $addmode=true) { - $cw = array(); // array of codewords to return - switch($mode) { - case 900: { // Text Compaction mode latch - $submode = 0; // default Alpha sub-mode - $txtarr = array(); // array of characters and sub-mode switching characters - $codelen = strlen($code); - for ($i = 0; $i < $codelen; ++$i) { - $chval = ord($code{$i}); - if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) { - // we are on the same sub-mode - $txtarr[] = $k; - } else { - // the sub-mode is changed - for ($s = 0; $s < 4; ++$s) { - // search new sub-mode - if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) { - // $s is the new submode - if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code{($i + 1)}), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) { - // shift (temporary change only for this char) - if ($s == 3) { - // shift to puntuaction - $txtarr[] = 29; - } else { - // shift from lower to alpha - $txtarr[] = 27; - } - } else { - // latch - $txtarr = array_merge($txtarr, $this->textlatch[''.$submode.$s]); - // set new submode - $submode = $s; - } - // add characted code to array - $txtarr[] = $k; - break; - } - } - } - } - $txtarrlen = count($txtarr); - if (($txtarrlen % 2) != 0) { - // add padding - $txtarr[] = 29; - ++$txtarrlen; - } - // calculate codewords - for ($i = 0; $i < $txtarrlen; $i += 2) { - $cw[] = (30 * $txtarr[$i]) + $txtarr[($i + 1)]; - } - break; - } - case 901: - case 924: { // Byte Compaction mode latch - while (($codelen = strlen($code)) > 0) { - if ($codelen > 6) { - $rest = substr($code, 6); - $code = substr($code, 0, 6); - $sublen = 6; - } else { - $rest = ''; - $sublen = strlen($code); - } - if ($sublen == 6) { - $t = bcmul(''.ord($code{0}), '1099511627776'); - $t = bcadd($t, bcmul(''.ord($code{1}), '4294967296')); - $t = bcadd($t, bcmul(''.ord($code{2}), '16777216')); - $t = bcadd($t, bcmul(''.ord($code{3}), '65536')); - $t = bcadd($t, bcmul(''.ord($code{4}), '256')); - $t = bcadd($t, ''.ord($code{5})); - do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); - array_unshift($cw, $d); - } while ($t != '0'); - } else { - for ($i = 0; $i < $sublen; ++$i) { - $cw[] = ord($code{$i}); - } - } - $code = $rest; - } - break; - } - case 902: { // Numeric Compaction mode latch - while (($codelen = strlen($code)) > 0) { - if ($codelen > 44) { - $rest = substr($code, 44); - $code = substr($code, 0, 44); - } else { - $rest = ''; - } - $t = '1'.$code; - do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); - array_unshift($cw, $d); - } while ($t != '0'); - $code = $rest; - } - break; - } - case 913: { // Byte Compaction mode shift - $cw[] = ord($code); - break; - } - } - if ($addmode) { - // add the compaction mode codeword at the beginning - array_unshift($cw, $mode); - } - return $cw; - } - - } // end PDF417 class - -} // END OF "class_exists PDF417" -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/qrcode.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/qrcode.php deleted file mode 100644 index 636b07e81d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/qrcode.php +++ /dev/null @@ -1,2879 +0,0 @@ -<?php -//============================================================+ -// File name : qrcode.php -// Version : 1.0.006 -// Begin : 2010-03-22 -// Last Update : 2010-08-30 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2010-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// DESCRIPTION : -// -// Class to create QR-code arrays for TCPDF class. -// QR Code symbol is a 2D barcode that can be scanned by -// handy terminals such as a mobile phone with CCD. -// The capacity of QR Code is up to 7000 digits or 4000 -// characters, and has high robustness. -// This class supports QR Code model 2, described in -// JIS (Japanese Industrial Standards) X0510:2004 -// or ISO/IEC 18004. -// Currently the following features are not supported: -// ECI and FNC1 mode, Micro QR Code, QR Code model 1, -// Structured mode. -// -// This class is derived from the following projects: -// --------------------------------------------------------- -// "PHP QR Code encoder" -// License: GNU-LGPLv3 -// Copyright (C) 2010 by Dominik Dzienia <deltalab at poczta dot fm> -// http://phpqrcode.sourceforge.net/ -// https://sourceforge.net/projects/phpqrcode/ -// -// The "PHP QR Code encoder" is based on -// "C libqrencode library" (ver. 3.1.1) -// License: GNU-LGPL 2.1 -// Copyright (C) 2006-2010 by Kentaro Fukuchi -// http://megaui.net/fukuchi/works/qrencode/index.en.html -// -// Reed-Solomon code encoder is written by Phil Karn, KA9Q. -// Copyright (C) 2002-2006 Phil Karn, KA9Q -// -// QR Code is registered trademark of DENSO WAVE INCORPORATED -// http://www.denso-wave.com/qrcode/index-e.html -// --------------------------------------------------------- -//============================================================+ - -/** - * Class to create QR-code arrays for TCPDF class. - * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. - * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. - * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. - * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. - * - * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). - * Please read comments on this class source file for full copyright and license information. - * - * @package com.tecnick.tcpdf - * @abstract Class for generating QR-code array for TCPDF. - * @author Nicola Asuni - * @copyright 2010-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.006 - */ - -// definitions -if (!defined('QRCODEDEFS')) { - - /** - * Indicate that definitions for this class are set - */ - define('QRCODEDEFS', true); - - // ----------------------------------------------------- - - // Encoding modes (characters which can be encoded in QRcode) - - /** - * Encoding mode - */ - define('QR_MODE_NL', -1); - - /** - * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode. - */ - define('QR_MODE_NM', 0); - - /** - * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode. - */ - define('QR_MODE_AN', 1); - - /** - * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode. - */ - define('QR_MODE_8B', 2); - - /** - * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode. - */ - define('QR_MODE_KJ', 3); - - /** - * Encoding mode STRUCTURED (currently unsupported) - */ - define('QR_MODE_ST', 4); - - // ----------------------------------------------------- - - // Levels of error correction. - // QRcode has a function of an error correcting for miss reading that white is black. - // Error correcting is defined in 4 level as below. - - /** - * Error correction level L : About 7% or less errors can be corrected. - */ - define('QR_ECLEVEL_L', 0); - - /** - * Error correction level M : About 15% or less errors can be corrected. - */ - define('QR_ECLEVEL_M', 1); - - /** - * Error correction level Q : About 25% or less errors can be corrected. - */ - define('QR_ECLEVEL_Q', 2); - - /** - * Error correction level H : About 30% or less errors can be corrected. - */ - define('QR_ECLEVEL_H', 3); - - // ----------------------------------------------------- - - // Version. Size of QRcode is defined as version. - // Version is from 1 to 40. - // Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. - // So version 40 is 177*177 matrix. - - /** - * Maximum QR Code version. - */ - define('QRSPEC_VERSION_MAX', 40); - - /** - * Maximum matrix size for maximum version (version 40 is 177*177 matrix). - */ - define('QRSPEC_WIDTH_MAX', 177); - - // ----------------------------------------------------- - - /** - * Matrix index to get width from $capacity array. - */ - define('QRCAP_WIDTH', 0); - - /** - * Matrix index to get number of words from $capacity array. - */ - define('QRCAP_WORDS', 1); - - /** - * Matrix index to get remainder from $capacity array. - */ - define('QRCAP_REMINDER', 2); - - /** - * Matrix index to get error correction level from $capacity array. - */ - define('QRCAP_EC', 3); - - // ----------------------------------------------------- - - // Structure (currently usupported) - - /** - * Number of header bits for structured mode - */ - define('STRUCTURE_HEADER_BITS', 20); - - /** - * Max number of symbols for structured mode - */ - define('MAX_STRUCTURED_SYMBOLS', 16); - - // ----------------------------------------------------- - - // Masks - - /** - * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column) - */ - define('N1', 3); - - /** - * Down point base value for case 2 mask pattern (module block of same color) - */ - define('N2', 3); - - /** - * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column) - */ - define('N3', 40); - - /** - * Down point base value for case 4 mask pattern (ration of dark modules in whole) - */ - define('N4', 10); - - // ----------------------------------------------------- - - // Optimization settings - - /** - * if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code - */ - define('QR_FIND_BEST_MASK', true); - - /** - * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly - */ - define('QR_FIND_FROM_RANDOM', 2); - - /** - * when QR_FIND_BEST_MASK === false - */ - define('QR_DEFAULT_MASK', 2); - - // ----------------------------------------------------- - -} // end of definitions - -// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# - -if (!class_exists('QRcode', false)) { - - // for compatibility with PHP4 - if (!function_exists('str_split')) { - /** - * Convert a string to an array (needed for PHP4 compatibility) - * @param string $string The input string. - * @param int $split_length Maximum length of the chunk. - * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element. - */ - function str_split($string, $split_length=1) { - if ((strlen($string) > $split_length) OR (!$split_length)) { - do { - $c = strlen($string); - $parts[] = substr($string, 0, $split_length); - $string = substr($string, $split_length); - } while ($string !== false); - } else { - $parts = array($string); - } - return $parts; - } - } - - // ##################################################### - - /** - * Class to create QR-code arrays for TCPDF class. - * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. - * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. - * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. - * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. - * - * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). - * Please read comments on this class source file for full copyright and license information. - * - * @name QRcode - * @package com.tecnick.tcpdf - * @abstract Class for generating QR-code array for TCPDF. - * @author Nicola Asuni - * @copyright 2010-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 1.0.006 - */ - class QRcode { - - /** - * @var barcode array to be returned which is readable by TCPDF - * @access protected - */ - protected $barcode_array = array(); - - /** - * @var QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix. - * @access protected - */ - protected $version = 0; - - /** - * @var Levels of error correction. See definitions for possible values. - * @access protected - */ - protected $level = QR_ECLEVEL_L; - - /** - * @var Encoding mode - * @access protected - */ - protected $hint = QR_MODE_8B; - - /** - * @var if true the input string will be converted to uppercase - * @access protected - */ - protected $casesensitive = true; - - /** - * @var structured QR code (not supported yet) - * @access protected - */ - protected $structured = 0; - - /** - * @var mask data - * @access protected - */ - protected $data; - - // FrameFiller - - /** - * @var width - * @access protected - */ - protected $width; - - /** - * @var frame - * @access protected - */ - protected $frame; - - /** - * @var X position of bit - * @access protected - */ - protected $x; - - /** - * @var Y position of bit - * @access protected - */ - protected $y; - - /** - * @var direction - * @access protected - */ - protected $dir; - - /** - * @var single bit - * @access protected - */ - protected $bit; - - // ---- QRrawcode ---- - - /** - * @var data code - * @access protected - */ - protected $datacode = array(); - - /** - * @var error correction code - * @access protected - */ - protected $ecccode = array(); - - /** - * @var blocks - * @access protected - */ - protected $blocks; - - /** - * @var Reed-Solomon blocks - * @access protected - */ - protected $rsblocks = array(); //of RSblock - - /** - * @var counter - * @access protected - */ - protected $count; - - /** - * @var data length - * @access protected - */ - protected $dataLength; - - /** - * @var error correction length - * @access protected - */ - protected $eccLength; - - /** - * @var b1 - * @access protected - */ - protected $b1; - - // ---- QRmask ---- - - /** - * @var run length - * @access protected - */ - protected $runLength = array(); - - // ---- QRsplit ---- - - /** - * @var input data string - * @access protected - */ - protected $dataStr = ''; - - /** - * @var input items - * @access protected - */ - protected $items; - - // Reed-Solomon items - - /** - * @var Reed-Solomon items - * @access protected - */ - protected $rsitems = array(); - - /** - * @var array of frames - * @access protected - */ - protected $frames = array(); - - /** - * @var alphabet-numeric convesion table - * @access protected - */ - protected $anTable = array( - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // - 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, // - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // - ); - - /** - * @var array Table of the capacity of symbols - * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004. - * @access protected - */ - protected $capacity = array( - array( 0, 0, 0, array( 0, 0, 0, 0)), // - array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 - array( 25, 44, 7, array( 10, 16, 22, 28)), // - array( 29, 70, 7, array( 15, 26, 36, 44)), // - array( 33, 100, 7, array( 20, 36, 52, 64)), // - array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 - array( 41, 172, 7, array( 36, 64, 96, 112)), // - array( 45, 196, 0, array( 40, 72, 108, 130)), // - array( 49, 242, 0, array( 48, 88, 132, 156)), // - array( 53, 292, 0, array( 60, 110, 160, 192)), // - array( 57, 346, 0, array( 72, 130, 192, 224)), // 10 - array( 61, 404, 0, array( 80, 150, 224, 264)), // - array( 65, 466, 0, array( 96, 176, 260, 308)), // - array( 69, 532, 0, array( 104, 198, 288, 352)), // - array( 73, 581, 3, array( 120, 216, 320, 384)), // - array( 77, 655, 3, array( 132, 240, 360, 432)), // 15 - array( 81, 733, 3, array( 144, 280, 408, 480)), // - array( 85, 815, 3, array( 168, 308, 448, 532)), // - array( 89, 901, 3, array( 180, 338, 504, 588)), // - array( 93, 991, 3, array( 196, 364, 546, 650)), // - array( 97, 1085, 3, array( 224, 416, 600, 700)), // 20 - array(101, 1156, 4, array( 224, 442, 644, 750)), // - array(105, 1258, 4, array( 252, 476, 690, 816)), // - array(109, 1364, 4, array( 270, 504, 750, 900)), // - array(113, 1474, 4, array( 300, 560, 810, 960)), // - array(117, 1588, 4, array( 312, 588, 870, 1050)), // 25 - array(121, 1706, 4, array( 336, 644, 952, 1110)), // - array(125, 1828, 4, array( 360, 700, 1020, 1200)), // - array(129, 1921, 3, array( 390, 728, 1050, 1260)), // - array(133, 2051, 3, array( 420, 784, 1140, 1350)), // - array(137, 2185, 3, array( 450, 812, 1200, 1440)), // 30 - array(141, 2323, 3, array( 480, 868, 1290, 1530)), // - array(145, 2465, 3, array( 510, 924, 1350, 1620)), // - array(149, 2611, 3, array( 540, 980, 1440, 1710)), // - array(153, 2761, 3, array( 570, 1036, 1530, 1800)), // - array(157, 2876, 0, array( 570, 1064, 1590, 1890)), // 35 - array(161, 3034, 0, array( 600, 1120, 1680, 1980)), // - array(165, 3196, 0, array( 630, 1204, 1770, 2100)), // - array(169, 3362, 0, array( 660, 1260, 1860, 2220)), // - array(173, 3532, 0, array( 720, 1316, 1950, 2310)), // - array(177, 3706, 0, array( 750, 1372, 2040, 2430)) // 40 - ); - - /** - * @var array Length indicator - * @access protected - */ - protected $lengthTableBits = array( - array(10, 12, 14), - array( 9, 11, 13), - array( 8, 16, 16), - array( 8, 10, 12) - ); - - /** - * @var array Table of the error correction code (Reed-Solomon block) - * See Table 12-16 (pp.30-36), JIS X0510:2004. - * @access protected - */ - protected $eccTable = array( - array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), // - array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 - array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // - array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), // - array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), // - array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 - array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), // - array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), // - array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), // - array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), // - array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), // 10 - array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), // - array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), // - array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), // - array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), // - array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), // 15 - array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), // - array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), // - array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), // - array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), // - array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), // 20 - array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), // - array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), // - array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), // - array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), // - array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), // 25 - array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), // - array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), // - array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), // - array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), // - array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), // 30 - array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), // - array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), // - array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), // - array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), // - array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), // 35 - array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), // - array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), // - array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), // - array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), // - array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)) // 40 - ); - - /** - * @var array Positions of alignment patterns. - * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them. - * See Table 1 in Appendix E (pp.71) of JIS X0510:2004. - * @access protected - */ - protected $alignmentPattern = array( - array( 0, 0), - array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 - array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 - array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), // 11-15 - array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), // 16-20 - array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), // 21-25 - array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), // 26-30 - array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), // 31-35 - array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58) // 35-40 - ); - - /** - * @var array Version information pattern (BCH coded). - * See Table 1 in Appendix D (pp.68) of JIS X0510:2004. - * size: [QRSPEC_VERSION_MAX - 6] - * @access protected - */ - protected $versionPattern = array( - 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, // - 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, // - 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, // - 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, // - 0x27541, 0x28c69 - ); - - /** - * @var array Format information - * @access protected - */ - protected $formatInfo = array( - array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), // - array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), // - array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), // - array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) // - ); - - - // ------------------------------------------------- - // ------------------------------------------------- - - - /** - * This is the class constructor. - * Creates a QRcode object - * @param string $code code to represent using QRcode - * @param string $eclevel error level: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul> - * @access public - * @since 1.0.000 - */ - public function __construct($code, $eclevel = 'L') { - $barcode_array = array(); - if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { - return false; - } - // set error correction level - $this->level = array_search($eclevel, array('L', 'M', 'Q', 'H')); - if ($this->level === false) { - $this->level = QR_ECLEVEL_L; - } - if (($this->hint != QR_MODE_8B) AND ($this->hint != QR_MODE_KJ)) { - return false; - } - if (($this->version < 0) OR ($this->version > QRSPEC_VERSION_MAX)) { - return false; - } - $this->items = array(); - $this->encodeString($code); - if (is_null($this->data)) { - return false; - } - $qrTab = $this->binarize($this->data); - $size = count($qrTab); - $barcode_array['num_rows'] = $size; - $barcode_array['num_cols'] = $size; - $barcode_array['bcode'] = array(); - foreach ($qrTab as $line) { - $arrAdd = array(); - foreach (str_split($line) as $char) { - $arrAdd[] = ($char=='1')?1:0; - } - $barcode_array['bcode'][] = $arrAdd; - } - $this->barcode_array = $barcode_array; - } - - /** - * Returns a barcode array which is readable by TCPDF - * @return array barcode array readable by TCPDF; - * @access public - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Convert the frame in binary form - * @param array $frame array to binarize - * @return array frame in binary form - */ - protected function binarize($frame) { - $len = count($frame); - // the frame is square (width = height) - foreach ($frame as &$frameLine) { - for ($i=0; $i<$len; $i++) { - $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; - } - } - return $frame; - } - - /** - * Encode the input string to QR code - * @param string $string input string to encode - */ - protected function encodeString($string) { - $this->dataStr = $string; - if (!$this->casesensitive) { - $this->toUpper(); - } - $ret = $this->splitString(); - if ($ret < 0) { - return NULL; - } - $this->encodeMask(-1); - } - - /** - * Encode mask - * @param int $mask masking mode - */ - protected function encodeMask($mask) { - $spec = array(0, 0, 0, 0, 0); - $this->datacode = $this->getByteStream($this->items); - if (is_null($this->datacode)) { - return NULL; - } - $spec = $this->getEccSpec($this->version, $this->level, $spec); - $this->b1 = $this->rsBlockNum1($spec); - $this->dataLength = $this->rsDataLength($spec); - $this->eccLength = $this->rsEccLength($spec); - $this->ecccode = array_fill(0, $this->eccLength, 0); - $this->blocks = $this->rsBlockNum($spec); - $ret = $this->init($spec); - if ($ret < 0) { - return NULL; - } - $this->count = 0; - $this->width = $this->getWidth($this->version); - $this->frame = $this->newFrame($this->version); - $this->x = $this->width - 1; - $this->y = $this->width - 1; - $this->dir = -1; - $this->bit = -1; - // inteleaved data and ecc codes - for ($i=0; $i < ($this->dataLength + $this->eccLength); $i++) { - $code = $this->getCode(); - $bit = 0x80; - for ($j=0; $j<8; $j++) { - $addr = $this->getNextPosition(); - $this->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); - $bit = $bit >> 1; - } - } - // remainder bits - $j = $this->getRemainder($this->version); - for ($i=0; $i<$j; $i++) { - $addr = $this->getNextPosition(); - $this->setFrameAt($addr, 0x02); - } - // masking - $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); - if ($mask < 0) { - if (QR_FIND_BEST_MASK) { - $masked = $this->mask($this->width, $this->frame, $this->level); - } else { - $masked = $this->makeMask($this->width, $this->frame, (intval(QR_DEFAULT_MASK) % 8), $this->level); - } - } else { - $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level); - } - if ($masked == NULL) { - return NULL; - } - $this->data = $masked; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // FrameFiller - - /** - * Set frame value at specified position - * @param array $at x,y position - * @param int $val value of the character to set - */ - protected function setFrameAt($at, $val) { - $this->frame[$at['y']][$at['x']] = chr($val); - } - - /** - * Get frame value at specified position - * @param array $at x,y position - * @return value at specified position - */ - protected function getFrameAt($at) { - return ord($this->frame[$at['y']][$at['x']]); - } - - /** - * Return the next frame position - * @return array of x,y coordinates - */ - protected function getNextPosition() { - do { - if ($this->bit == -1) { - $this->bit = 0; - return array('x'=>$this->x, 'y'=>$this->y); - } - $x = $this->x; - $y = $this->y; - $w = $this->width; - if ($this->bit == 0) { - $x--; - $this->bit++; - } else { - $x++; - $y += $this->dir; - $this->bit--; - } - if ($this->dir < 0) { - if ($y < 0) { - $y = 0; - $x -= 2; - $this->dir = 1; - if ($x == 6) { - $x--; - $y = 9; - } - } - } else { - if ($y == $w) { - $y = $w - 1; - $x -= 2; - $this->dir = -1; - if ($x == 6) { - $x--; - $y -= 8; - } - } - } - if (($x < 0) OR ($y < 0)) { - return NULL; - } - $this->x = $x; - $this->y = $y; - } while(ord($this->frame[$y][$x]) & 0x80); - return array('x'=>$x, 'y'=>$y); - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRrawcode - - /** - * Initialize code. - * @param array $spec array of ECC specification - * @return 0 in case of success, -1 in case of error - */ - protected function init($spec) { - $dl = $this->rsDataCodes1($spec); - $el = $this->rsEccCodes1($spec); - $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); - $blockNo = 0; - $dataPos = 0; - $eccPos = 0; - $endfor = $this->rsBlockNum1($spec); - for ($i=0; $i < $endfor; ++$i) { - $ecc = array_slice($this->ecccode, $eccPos); - $this->rsblocks[$blockNo] = array(); - $this->rsblocks[$blockNo]['dataLength'] = $dl; - $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); - $this->rsblocks[$blockNo]['eccLength'] = $el; - $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); - $this->rsblocks[$blockNo]['ecc'] = $ecc; - $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); - $dataPos += $dl; - $eccPos += $el; - $blockNo++; - } - if ($this->rsBlockNum2($spec) == 0) { - return 0; - } - $dl = $this->rsDataCodes2($spec); - $el = $this->rsEccCodes2($spec); - $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); - if ($rs == NULL) { - return -1; - } - $endfor = $this->rsBlockNum2($spec); - for ($i=0; $i < $endfor; ++$i) { - $ecc = array_slice($this->ecccode, $eccPos); - $this->rsblocks[$blockNo] = array(); - $this->rsblocks[$blockNo]['dataLength'] = $dl; - $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); - $this->rsblocks[$blockNo]['eccLength'] = $el; - $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); - $this->rsblocks[$blockNo]['ecc'] = $ecc; - $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc); - $dataPos += $dl; - $eccPos += $el; - $blockNo++; - } - return 0; - } - - /** - * Return Reed-Solomon block code. - * @return array rsblocks - */ - protected function getCode() { - if ($this->count < $this->dataLength) { - $row = $this->count % $this->blocks; - $col = $this->count / $this->blocks; - if ($col >= $this->rsblocks[0]['dataLength']) { - $row += $this->b1; - } - $ret = $this->rsblocks[$row]['data'][$col]; - } elseif ($this->count < $this->dataLength + $this->eccLength) { - $row = ($this->count - $this->dataLength) % $this->blocks; - $col = ($this->count - $this->dataLength) / $this->blocks; - $ret = $this->rsblocks[$row]['ecc'][$col]; - } else { - return 0; - } - $this->count++; - return $ret; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRmask - - /** - * Write Format Information on frame and returns the number of black bits - * @param int $width frame width - * @param array $frame frame - * @param array $mask masking mode - * @param int $level error correction level - * @return int blacks - */ - protected function writeFormatInformation($width, &$frame, $mask, $level) { - $blacks = 0; - $format = $this->getFormatInfo($mask, $level); - for ($i=0; $i<8; ++$i) { - if ($format & 1) { - $blacks += 2; - $v = 0x85; - } else { - $v = 0x84; - } - $frame[8][$width - 1 - $i] = chr($v); - if ($i < 6) { - $frame[$i][8] = chr($v); - } else { - $frame[$i + 1][8] = chr($v); - } - $format = $format >> 1; - } - for ($i=0; $i<7; ++$i) { - if ($format & 1) { - $blacks += 2; - $v = 0x85; - } else { - $v = 0x84; - } - $frame[$width - 7 + $i][8] = chr($v); - if ($i == 0) { - $frame[8][7] = chr($v); - } else { - $frame[8][6 - $i] = chr($v); - } - $format = $format >> 1; - } - return $blacks; - } - - /** - * mask0 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask0($x, $y) { - return ($x + $y) & 1; - } - - /** - * mask1 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask1($x, $y) { - return ($y & 1); - } - - /** - * mask2 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask2($x, $y) { - return ($x % 3); - } - - /** - * mask3 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask3($x, $y) { - return ($x + $y) % 3; - } - - /** - * mask4 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask4($x, $y) { - return (((int)($y / 2)) + ((int)($x / 3))) & 1; - } - - /** - * mask5 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask5($x, $y) { - return (($x * $y) & 1) + ($x * $y) % 3; - } - - /** - * mask6 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask6($x, $y) { - return ((($x * $y) & 1) + ($x * $y) % 3) & 1; - } - - /** - * mask7 - * @param int $x X position - * @param int $y Y position - * @return int mask - */ - protected function mask7($x, $y) { - return ((($x * $y) % 3) + (($x + $y) & 1)) & 1; - } - - /** - * Return bitmask - * @param int $maskNo mask number - * @param int $width width - * @param array $frame frame - * @return array bitmask - */ - protected function generateMaskNo($maskNo, $width, $frame) { - $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); - for ($y=0; $y<$width; ++$y) { - for ($x=0; $x<$width; ++$x) { - if (ord($frame[$y][$x]) & 0x80) { - $bitMask[$y][$x] = 0; - } else { - $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); - $bitMask[$y][$x] = ($maskFunc == 0)?1:0; - } - } - } - return $bitMask; - } - - /** - * makeMaskNo - * @param int $maskNo - * @param int $width - * @param int $s - * @param int $d - * @param boolean $maskGenOnly - * @return int b - */ - protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) { - $b = 0; - $bitMask = array(); - $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); - if ($maskGenOnly) { - return; - } - $d = $s; - for ($y=0; $y<$width; ++$y) { - for ($x=0; $x<$width; ++$x) { - if ($bitMask[$y][$x] == 1) { - $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); - } - $b += (int)(ord($d[$y][$x]) & 1); - } - } - return $b; - } - - /** - * makeMask - * @param int $width - * @param array $frame - * @param int $maskNo - * @param int $level - * @return array mask - */ - protected function makeMask($width, $frame, $maskNo, $level) { - $masked = array_fill(0, $width, str_repeat("\0", $width)); - $this->makeMaskNo($maskNo, $width, $frame, $masked); - $this->writeFormatInformation($width, $masked, $maskNo, $level); - return $masked; - } - - /** - * calcN1N3 - * @param int $length - * @return int demerit - */ - protected function calcN1N3($length) { - $demerit = 0; - for ($i=0; $i<$length; ++$i) { - if ($this->runLength[$i] >= 5) { - $demerit += (N1 + ($this->runLength[$i] - 5)); - } - if ($i & 1) { - if (($i >= 3) AND ($i < ($length-2)) AND ($this->runLength[$i] % 3 == 0)) { - $fact = (int)($this->runLength[$i] / 3); - if (($this->runLength[$i-2] == $fact) - AND ($this->runLength[$i-1] == $fact) - AND ($this->runLength[$i+1] == $fact) - AND ($this->runLength[$i+2] == $fact)) { - if (($this->runLength[$i-3] < 0) OR ($this->runLength[$i-3] >= (4 * $fact))) { - $demerit += N3; - } elseif ((($i+3) >= $length) OR ($this->runLength[$i+3] >= (4 * $fact))) { - $demerit += N3; - } - } - } - } - } - return $demerit; - } - - /** - * evaluateSymbol - * @param int $width - * @param array $frame - * @return int demerit - */ - protected function evaluateSymbol($width, $frame) { - $head = 0; - $demerit = 0; - for ($y=0; $y<$width; ++$y) { - $head = 0; - $this->runLength[0] = 1; - $frameY = $frame[$y]; - if ($y > 0) { - $frameYM = $frame[$y-1]; - } - for ($x=0; $x<$width; ++$x) { - if (($x > 0) AND ($y > 0)) { - $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); - $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); - if (($b22 | ($w22 ^ 1)) & 1) { - $demerit += N2; - } - } - if (($x == 0) AND (ord($frameY[$x]) & 1)) { - $this->runLength[0] = -1; - $head = 1; - $this->runLength[$head] = 1; - } elseif ($x > 0) { - if ((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { - $head++; - $this->runLength[$head] = 1; - } else { - $this->runLength[$head]++; - } - } - } - $demerit += $this->calcN1N3($head+1); - } - for ($x=0; $x<$width; ++$x) { - $head = 0; - $this->runLength[0] = 1; - for ($y=0; $y<$width; ++$y) { - if (($y == 0) AND (ord($frame[$y][$x]) & 1)) { - $this->runLength[0] = -1; - $head = 1; - $this->runLength[$head] = 1; - } elseif ($y > 0) { - if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { - $head++; - $this->runLength[$head] = 1; - } else { - $this->runLength[$head]++; - } - } - } - $demerit += $this->calcN1N3($head+1); - } - return $demerit; - } - - /** - * mask - * @param int $width - * @param array $frame - * @param int $level - * @return array best mask - */ - protected function mask($width, $frame, $level) { - $minDemerit = PHP_INT_MAX; - $bestMaskNum = 0; - $bestMask = array(); - $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7); - if (QR_FIND_FROM_RANDOM !== false) { - $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9); - for ($i = 0; $i < $howManuOut; ++$i) { - $remPos = rand (0, count($checked_masks)-1); - unset($checked_masks[$remPos]); - $checked_masks = array_values($checked_masks); - } - } - $bestMask = $frame; - foreach ($checked_masks as $i) { - $mask = array_fill(0, $width, str_repeat("\0", $width)); - $demerit = 0; - $blacks = 0; - $blacks = $this->makeMaskNo($i, $width, $frame, $mask); - $blacks += $this->writeFormatInformation($width, $mask, $i, $level); - $blacks = (int)(100 * $blacks / ($width * $width)); - $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); - $demerit += $this->evaluateSymbol($width, $mask); - if ($demerit < $minDemerit) { - $minDemerit = $demerit; - $bestMask = $mask; - $bestMaskNum = $i; - } - } - return $bestMask; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRsplit - - /** - * Return true if the character at specified position is a number - * @param string $str string - * @param int $pos characted position - * @return boolean true of false - */ - protected function isdigitat($str, $pos) { - if ($pos >= strlen($str)) { - return false; - } - return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); - } - - /** - * Return true if the character at specified position is an alphanumeric character - * @param string $str string - * @param int $pos characted position - * @return boolean true of false - */ - protected function isalnumat($str, $pos) { - if ($pos >= strlen($str)) { - return false; - } - return ($this->lookAnTable(ord($str[$pos])) >= 0); - } - - /** - * identifyMode - * @param int $pos - * @return int mode - */ - protected function identifyMode($pos) { - if ($pos >= strlen($this->dataStr)) { - return QR_MODE_NL; - } - $c = $this->dataStr[$pos]; - if ($this->isdigitat($this->dataStr, $pos)) { - return QR_MODE_NM; - } elseif ($this->isalnumat($this->dataStr, $pos)) { - return QR_MODE_AN; - } elseif ($this->hint == QR_MODE_KJ) { - if ($pos+1 < strlen($this->dataStr)) { - $d = $this->dataStr[$pos+1]; - $word = (ord($c) << 8) | ord($d); - if (($word >= 0x8140 && $word <= 0x9ffc) OR ($word >= 0xe040 && $word <= 0xebbf)) { - return QR_MODE_KJ; - } - } - } - return QR_MODE_8B; - } - - /** - * eatNum - * @return int run - */ - protected function eatNum() { - $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); - $p = 0; - while($this->isdigitat($this->dataStr, $p)) { - $p++; - } - $run = $p; - $mode = $this->identifyMode($p); - if ($mode == QR_MODE_8B) { - $dif = $this->estimateBitsModeNum($run) + 4 + $ln - + $this->estimateBitsMode8(1) // + 4 + l8 - - $this->estimateBitsMode8($run + 1); // - 4 - l8 - if ($dif > 0) { - return $this->eat8(); - } - } - if ($mode == QR_MODE_AN) { - $dif = $this->estimateBitsModeNum($run) + 4 + $ln - + $this->estimateBitsModeAn(1) // + 4 + la - - $this->estimateBitsModeAn($run + 1);// - 4 - la - if ($dif > 0) { - return $this->eatAn(); - } - } - $this->items = $this->appendNewInputItem($this->items, QR_MODE_NM, $run, str_split($this->dataStr)); - return $run; - } - - /** - * eatAn - * @return int run - */ - protected function eatAn() { - $la = $this->lengthIndicator(QR_MODE_AN, $this->version); - $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); - $p = 0; - while($this->isalnumat($this->dataStr, $p)) { - if ($this->isdigitat($this->dataStr, $p)) { - $q = $p; - while($this->isdigitat($this->dataStr, $q)) { - $q++; - } - $dif = $this->estimateBitsModeAn($p) // + 4 + la - + $this->estimateBitsModeNum($q - $p) + 4 + $ln - - $this->estimateBitsModeAn($q); // - 4 - la - if ($dif < 0) { - break; - } else { - $p = $q; - } - } else { - $p++; - } - } - $run = $p; - if (!$this->isalnumat($this->dataStr, $p)) { - $dif = $this->estimateBitsModeAn($run) + 4 + $la - + $this->estimateBitsMode8(1) // + 4 + l8 - - $this->estimateBitsMode8($run + 1); // - 4 - l8 - if ($dif > 0) { - return $this->eat8(); - } - } - $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr)); - return $run; - } - - /** - * eatKanji - * @return int run - */ - protected function eatKanji() { - $p = 0; - while($this->identifyMode($p) == QR_MODE_KJ) { - $p += 2; - } - $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr)); - return $run; - } - - /** - * eat8 - * @return int run - */ - protected function eat8() { - $la = $this->lengthIndicator(QR_MODE_AN, $this->version); - $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); - $p = 1; - $dataStrLen = strlen($this->dataStr); - while($p < $dataStrLen) { - $mode = $this->identifyMode($p); - if ($mode == QR_MODE_KJ) { - break; - } - if ($mode == QR_MODE_NM) { - $q = $p; - while($this->isdigitat($this->dataStr, $q)) { - $q++; - } - $dif = $this->estimateBitsMode8($p) // + 4 + l8 - + $this->estimateBitsModeNum($q - $p) + 4 + $ln - - $this->estimateBitsMode8($q); // - 4 - l8 - if ($dif < 0) { - break; - } else { - $p = $q; - } - } elseif ($mode == QR_MODE_AN) { - $q = $p; - while($this->isalnumat($this->dataStr, $q)) { - $q++; - } - $dif = $this->estimateBitsMode8($p) // + 4 + l8 - + $this->estimateBitsModeAn($q - $p) + 4 + $la - - $this->estimateBitsMode8($q); // - 4 - l8 - if ($dif < 0) { - break; - } else { - $p = $q; - } - } else { - $p++; - } - } - $run = $p; - $this->items = $this->appendNewInputItem($this->items, QR_MODE_8B, $run, str_split($this->dataStr)); - return $run; - } - - /** - * splitString - */ - protected function splitString() { - while (strlen($this->dataStr) > 0) { - if ($this->dataStr == '') { - return 0; - } - $mode = $this->identifyMode(0); - switch ($mode) { - case QR_MODE_NM: { - $length = $this->eatNum(); - break; - } - case QR_MODE_AN: { - $length = $this->eatAn(); - break; - } - case QR_MODE_KJ: { - if ($hint == QR_MODE_KJ) { - $length = $this->eatKanji(); - } else { - $length = $this->eat8(); - } - break; - } - default: { - $length = $this->eat8(); - break; - } - } - if ($length == 0) { - return 0; - } - if ($length < 0) { - return -1; - } - $this->dataStr = substr($this->dataStr, $length); - } - } - - /** - * toUpper - */ - protected function toUpper() { - $stringLen = strlen($this->dataStr); - $p = 0; - while ($p < $stringLen) { - $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint); - if ($mode == QR_MODE_KJ) { - $p += 2; - } else { - if ((ord($this->dataStr[$p]) >= ord('a')) AND (ord($this->dataStr[$p]) <= ord('z'))) { - $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); - } - $p++; - } - } - return $this->dataStr; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRinputItem - - /** - * newInputItem - * @param int $mode - * @param int $size - * @param array $data - * @param array $bstream - * @return array input item - */ - protected function newInputItem($mode, $size, $data, $bstream=null) { - $setData = array_slice($data, 0, $size); - if (count($setData) < $size) { - $setData = array_merge($setData, array_fill(0, ($size - count($setData)), 0)); - } - if (!$this->check($mode, $size, $setData)) { - return NULL; - } - $inputitem = array(); - $inputitem['mode'] = $mode; - $inputitem['size'] = $size; - $inputitem['data'] = $setData; - $inputitem['bstream'] = $bstream; - return $inputitem; - } - - /** - * encodeModeNum - * @param array $inputitem - * @param int $version - * @return array input item - */ - protected function encodeModeNum($inputitem, $version) { - $words = (int)($inputitem['size'] / 3); - $inputitem['bstream'] = array(); - $val = 0x1; - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_NM, $version), $inputitem['size']); - for ($i=0; $i < $words; ++$i) { - $val = (ord($inputitem['data'][$i*3 ]) - ord('0')) * 100; - $val += (ord($inputitem['data'][$i*3+1]) - ord('0')) * 10; - $val += (ord($inputitem['data'][$i*3+2]) - ord('0')); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 10, $val); - } - if ($inputitem['size'] - $words * 3 == 1) { - $val = ord($inputitem['data'][$words*3]) - ord('0'); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); - } elseif (($inputitem['size'] - ($words * 3)) == 2) { - $val = (ord($inputitem['data'][$words*3 ]) - ord('0')) * 10; - $val += (ord($inputitem['data'][$words*3+1]) - ord('0')); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 7, $val); - } - return $inputitem; - } - - /** - * encodeModeAn - * @param array $inputitem - * @param int $version - * @return array input item - */ - protected function encodeModeAn($inputitem, $version) { - $words = (int)($inputitem['size'] / 2); - $inputitem['bstream'] = array(); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x02); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_AN, $version), $inputitem['size']); - for ($i=0; $i < $words; ++$i) { - $val = (int)$this->lookAnTable(ord($inputitem['data'][$i*2 ])) * 45; - $val += (int)$this->lookAnTable(ord($inputitem['data'][$i*2+1])); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 11, $val); - } - if ($inputitem['size'] & 1) { - $val = $this->lookAnTable(ord($inputitem['data'][($words * 2)])); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 6, $val); - } - return $inputitem; - } - - /** - * encodeMode8 - * @param array $inputitem - * @param int $version - * @return array input item - */ - protected function encodeMode8($inputitem, $version) { - $inputitem['bstream'] = array(); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x4); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_8B, $version), $inputitem['size']); - for ($i=0; $i < $inputitem['size']; ++$i) { - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][$i])); - } - return $inputitem; - } - - /** - * encodeModeKanji - * @param array $inputitem - * @param int $version - * @return array input item - */ - protected function encodeModeKanji($inputitem, $version) { - $inputitem['bstream'] = array(); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x8); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_KJ, $version), (int)($inputitem['size'] / 2)); - for ($i=0; $i<$inputitem['size']; $i+=2) { - $val = (ord($inputitem['data'][$i]) << 8) | ord($inputitem['data'][$i+1]); - if ($val <= 0x9ffc) { - $val -= 0x8140; - } else { - $val -= 0xc140; - } - $h = ($val >> 8) * 0xc0; - $val = ($val & 0xff) + $h; - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 13, $val); - } - return $inputitem; - } - - /** - * encodeModeStructure - * @param array $inputitem - * @return array input item - */ - protected function encodeModeStructure($inputitem) { - $inputitem['bstream'] = array(); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x03); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][1]) - 1); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][0]) - 1); - $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][2])); - return $inputitem; - } - - /** - * encodeBitStream - * @param array $inputitem - * @param int $version - * @return array input item - */ - protected function encodeBitStream($inputitem, $version) { - $inputitem['bstream'] = array(); - $words = $this->maximumWords($inputitem['mode'], $version); - if ($inputitem['size'] > $words) { - $st1 = $this->newInputItem($inputitem['mode'], $words, $inputitem['data']); - $st2 = $this->newInputItem($inputitem['mode'], $inputitem['size'] - $words, array_slice($inputitem['data'], $words)); - $st1 = $this->encodeBitStream($st1, $version); - $st2 = $this->encodeBitStream($st2, $version); - $inputitem['bstream'] = array(); - $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st1['bstream']); - $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st2['bstream']); - } else { - switch($inputitem['mode']) { - case QR_MODE_NM: { - $inputitem = $this->encodeModeNum($inputitem, $version); - break; - } - case QR_MODE_AN: { - $inputitem = $this->encodeModeAn($inputitem, $version); - break; - } - case QR_MODE_8B: { - $inputitem = $this->encodeMode8($inputitem, $version); - break; - } - case QR_MODE_KJ: { - $inputitem = $this->encodeModeKanji($inputitem, $version); - break; - } - case QR_MODE_ST: { - $inputitem = $this->encodeModeStructure($inputitem); - break; - } - default: { - break; - } - } - } - return $inputitem; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRinput - - /** - * Append data to an input object. - * The data is copied and appended to the input object. - * @param array items input items - * @param int $mode encoding mode. - * @param int $size size of data (byte). - * @param array $data array of input data. - * @return items - * - */ - protected function appendNewInputItem($items, $mode, $size, $data) { - $items[] = $this->newInputItem($mode, $size, $data); - return $items; - } - - /** - * insertStructuredAppendHeader - * @param array $items - * @param int $size - * @param int $index - * @param int $parity - * @return array items - */ - protected function insertStructuredAppendHeader($items, $size, $index, $parity) { - if ($size > MAX_STRUCTURED_SYMBOLS) { - return -1; - } - if (($index <= 0) OR ($index > MAX_STRUCTURED_SYMBOLS)) { - return -1; - } - $buf = array($size, $index, $parity); - $entry = $this->newInputItem(QR_MODE_ST, 3, buf); - array_unshift($items, $entry); - return $items; - } - - /** - * calcParity - * @param array $items - * @return int parity - */ - protected function calcParity($items) { - $parity = 0; - foreach ($items as $item) { - if ($item['mode'] != QR_MODE_ST) { - for ($i=$item['size']-1; $i>=0; --$i) { - $parity ^= $item['data'][$i]; - } - } - } - return $parity; - } - - /** - * checkModeNum - * @param int $size - * @param array $data - * @return boolean true or false - */ - protected function checkModeNum($size, $data) { - for ($i=0; $i<$size; ++$i) { - if ((ord($data[$i]) < ord('0')) OR (ord($data[$i]) > ord('9'))){ - return false; - } - } - return true; - } - - /** - * estimateBitsModeNum - * @param int $size - * @return int number of bits - */ - protected function estimateBitsModeNum($size) { - $w = (int)$size / 3; - $bits = $w * 10; - switch($size - $w * 3) { - case 1: { - $bits += 4; - break; - } - case 2: { - $bits += 7; - break; - } - default: { - break; - } - } - return $bits; - } - - /** - * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). - * @param int $c character value - * @return value - */ - protected function lookAnTable($c) { - return (($c > 127)?-1:$this->anTable[$c]); - } - - /** - * checkModeAn - * @param int $size - * @param array $data - * @return boolean true or false - */ - protected function checkModeAn($size, $data) { - for ($i=0; $i<$size; ++$i) { - if ($this->lookAnTable(ord($data[$i])) == -1) { - return false; - } - } - return true; - } - - /** - * estimateBitsModeAn - * @param int $size - * @return int number of bits - */ - protected function estimateBitsModeAn($size) { - $w = (int)($size / 2); - $bits = $w * 11; - if ($size & 1) { - $bits += 6; - } - return $bits; - } - - /** - * estimateBitsMode8 - * @param int $size - * @return int number of bits - */ - protected function estimateBitsMode8($size) { - return $size * 8; - } - - /** - * estimateBitsModeKanji - * @param int $size - * @return int number of bits - */ - protected function estimateBitsModeKanji($size) { - return (int)(($size / 2) * 13); - } - - /** - * checkModeKanji - * @param int $size - * @param array $data - * @return boolean true or false - */ - protected function checkModeKanji($size, $data) { - if ($size & 1) { - return false; - } - for ($i=0; $i<$size; $i+=2) { - $val = (ord($data[$i]) << 8) | ord($data[$i+1]); - if (($val < 0x8140) OR (($val > 0x9ffc) AND ($val < 0xe040)) OR ($val > 0xebbf)) { - return false; - } - } - return true; - } - - /** - * Validate the input data. - * @param int $mode encoding mode. - * @param int $size size of data (byte). - * @param array data data to validate - * @return boolean true in case of valid data, false otherwise - */ - protected function check($mode, $size, $data) { - if ($size <= 0) { - return false; - } - switch($mode) { - case QR_MODE_NM: { - return $this->checkModeNum($size, $data); - } - case QR_MODE_AN: { - return $this->checkModeAn($size, $data); - } - case QR_MODE_KJ: { - return $this->checkModeKanji($size, $data); - } - case QR_MODE_8B: { - return true; - } - case QR_MODE_ST: { - return true; - } - default: { - break; - } - } - return false; - } - - /** - * estimateBitStreamSize - * @param array $items - * @param int $version - * @return int bits - */ - protected function estimateBitStreamSize($items, $version) { - $bits = 0; - if ($version == 0) { - $version = 1; - } - foreach ($items as $item) { - switch($item['mode']) { - case QR_MODE_NM: { - $bits = $this->estimateBitsModeNum($item['size']); - break; - } - case QR_MODE_AN: { - $bits = $this->estimateBitsModeAn($item['size']); - break; - } - case QR_MODE_8B: { - $bits = $this->estimateBitsMode8($item['size']); - break; - } - case QR_MODE_KJ: { - $bits = $this->estimateBitsModeKanji($item['size']); - break; - } - case QR_MODE_ST: { - return STRUCTURE_HEADER_BITS; - } - default: { - return 0; - } - } - $l = $this->lengthIndicator($item['mode'], $version); - $m = 1 << $l; - $num = (int)(($item['size'] + $m - 1) / $m); - $bits += $num * (4 + $l); - } - return $bits; - } - - /** - * estimateVersion - * @param array $items - * @return int version - */ - protected function estimateVersion($items) { - $version = 0; - $prev = 0; - do { - $prev = $version; - $bits = $this->estimateBitStreamSize($items, $prev); - $version = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); - if ($version < 0) { - return -1; - } - } while ($version > $prev); - return $version; - } - - /** - * lengthOfCode - * @param int $mode - * @param int $version - * @param int $bits - * @return int size - */ - protected function lengthOfCode($mode, $version, $bits) { - $payload = $bits - 4 - $this->lengthIndicator($mode, $version); - switch($mode) { - case QR_MODE_NM: { - $chunks = (int)($payload / 10); - $remain = $payload - $chunks * 10; - $size = $chunks * 3; - if ($remain >= 7) { - $size += 2; - } elseif ($remain >= 4) { - $size += 1; - } - break; - } - case QR_MODE_AN: { - $chunks = (int)($payload / 11); - $remain = $payload - $chunks * 11; - $size = $chunks * 2; - if ($remain >= 6) { - ++$size; - } - break; - } - case QR_MODE_8B: { - $size = (int)($payload / 8); - break; - } - case QR_MODE_KJ: { - $size = (int)(($payload / 13) * 2); - break; - } - case QR_MODE_ST: { - $size = (int)($payload / 8); - break; - } - default: { - $size = 0; - break; - } - } - $maxsize = $this->maximumWords($mode, $version); - if ($size < 0) { - $size = 0; - } - if ($size > $maxsize) { - $size = $maxsize; - } - return $size; - } - - /** - * createBitStream - * @param array $items - * @return array of items and total bits - */ - protected function createBitStream($items) { - $total = 0; - foreach ($items as $key => $item) { - $items[$key] = $this->encodeBitStream($item, $this->version); - $bits = count($items[$key]['bstream']); - $total += $bits; - } - return array($items, $total); - } - - /** - * convertData - * @param array $items - * @return array items - */ - protected function convertData($items) { - $ver = $this->estimateVersion($items); - if ($ver > $this->version) { - $this->version = $ver; - } - for (;;) { - $cbs = $this->createBitStream($items); - $items = $cbs[0]; - $bits = $cbs[1]; - if ($bits < 0) { - return -1; - } - $ver = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); - if ($ver < 0) { - return -1; - } elseif ($ver > $this->version) { - $this->version = $ver; - } else { - break; - } - } - return $items; - } - - /** - * Append Padding Bit to bitstream - * @param array $bstream - * @return array bitstream - */ - protected function appendPaddingBit($bstream) { - if (is_null($bstream)) { - return null; - } - $bits = count($bstream); - $maxwords = $this->getDataLength($this->version, $this->level); - $maxbits = $maxwords * 8; - if ($maxbits == $bits) { - return 0; - } - if ($maxbits - $bits < 5) { - return $this->appendNum($bstream, $maxbits - $bits, 0); - } - $bits += 4; - $words = (int)(($bits + 7) / 8); - $padding = array(); - $padding = $this->appendNum($padding, $words * 8 - $bits + 4, 0); - $padlen = $maxwords - $words; - if ($padlen > 0) { - $padbuf = array(); - for ($i=0; $i<$padlen; ++$i) { - $padbuf[$i] = ($i&1)?0x11:0xec; - } - $padding = $this->appendBytes($padding, $padlen, $padbuf); - } - return $this->appendBitstream($bstream, $padding); - } - - /** - * mergeBitStream - * @param array $bstream - * @return array bitstream - */ - protected function mergeBitStream($items) { - $items = $this->convertData($items); - if (!is_array($items)) { - return null; - } - $bstream = array(); - foreach ($items as $item) { - $bstream = $this->appendBitstream($bstream, $item['bstream']); - } - return $bstream; - } - - /** - * Returns a stream of bits. - * @param int $items - * @return array padded merged byte stream - */ - protected function getBitStream($items) { - $bstream = $this->mergeBitStream($items); - return $this->appendPaddingBit($bstream); - } - - /** - * Pack all bit streams padding bits into a byte array. - * @param int $items - * @return array padded merged byte stream - */ - protected function getByteStream($items) { - $bstream = $this->getBitStream($items); - return $this->bitstreamToByte($bstream); - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRbitstream - - /** - * Return an array with zeros - * @param int $setLength array size - * @return array - */ - protected function allocate($setLength) { - return array_fill(0, $setLength, 0); - } - - /** - * Return new bitstream from number - * @param int $bits number of bits - * @param int $num number - * @return array bitstream - */ - protected function newFromNum($bits, $num) { - $bstream = $this->allocate($bits); - $mask = 1 << ($bits - 1); - for ($i=0; $i<$bits; ++$i) { - if ($num & $mask) { - $bstream[$i] = 1; - } else { - $bstream[$i] = 0; - } - $mask = $mask >> 1; - } - return $bstream; - } - - /** - * Return new bitstream from bytes - * @param int $size size - * @param array $data bytes - * @return array bitstream - */ - protected function newFromBytes($size, $data) { - $bstream = $this->allocate($size * 8); - $p=0; - for ($i=0; $i<$size; ++$i) { - $mask = 0x80; - for ($j=0; $j<8; ++$j) { - if ($data[$i] & $mask) { - $bstream[$p] = 1; - } else { - $bstream[$p] = 0; - } - $p++; - $mask = $mask >> 1; - } - } - return $bstream; - } - - /** - * Append one bitstream to another - * @param array $bitstream original bitstream - * @param array $append bitstream to append - * @return array bitstream - */ - protected function appendBitstream($bitstream, $append) { - if ((!is_array($append)) OR (count($append) == 0)) { - return $bitstream; - } - if (count($bitstream) == 0) { - return $append; - } - return array_values(array_merge($bitstream, $append)); - } - - /** - * Append one bitstream created from number to another - * @param array $bitstream original bitstream - * @param int $bits number of bits - * @param int $num number - * @return array bitstream - */ - protected function appendNum($bitstream, $bits, $num) { - if ($bits == 0) { - return 0; - } - $b = $this->newFromNum($bits, $num); - return $this->appendBitstream($bitstream, $b); - } - - /** - * Append one bitstream created from bytes to another - * @param array $bitstream original bitstream - * @param int $size size - * @param array $data bytes - * @return array bitstream - */ - protected function appendBytes($bitstream, $size, $data) { - if ($size == 0) { - return 0; - } - $b = $this->newFromBytes($size, $data); - return $this->appendBitstream($bitstream, $b); - } - - /** - * Convert bitstream to bytes - * @param array $bitstream original bitstream - * @return array of bytes - */ - protected function bitstreamToByte($bstream) { - if (is_null($bstream)) { - return null; - } - $size = count($bstream); - if ($size == 0) { - return array(); - } - $data = array_fill(0, (int)(($size + 7) / 8), 0); - $bytes = (int)($size / 8); - $p = 0; - for ($i=0; $i<$bytes; $i++) { - $v = 0; - for ($j=0; $j<8; $j++) { - $v = $v << 1; - $v |= $bstream[$p]; - $p++; - } - $data[$i] = $v; - } - if ($size & 7) { - $v = 0; - for ($j=0; $j<($size & 7); $j++) { - $v = $v << 1; - $v |= $bstream[$p]; - $p++; - } - $data[$bytes] = $v; - } - return $data; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRspec - - /** - * Replace a value on the array at the specified position - * @param array $srctab - * @param int $x X position - * @param int $y Y position - * @param string $repl value to replace - * @param int $replLen length of the repl string - * @return array srctab - */ - protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) { - $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); - return $srctab; - } - - /** - * Return maximum data code length (bytes) for the version. - * @param int $version version - * @param int $level error correction level - * @return int maximum size (bytes) - */ - protected function getDataLength($version, $level) { - return $this->capacity[$version][QRCAP_WORDS] - $this->capacity[$version][QRCAP_EC][$level]; - } - - /** - * Return maximum error correction code length (bytes) for the version. - * @param int $version version - * @param int $level error correction level - * @return int ECC size (bytes) - */ - protected function getECCLength($version, $level){ - return $this->capacity[$version][QRCAP_EC][$level]; - } - - /** - * Return the width of the symbol for the version. - * @param int $version version - * @return int width - */ - protected function getWidth($version) { - return $this->capacity[$version][QRCAP_WIDTH]; - } - - /** - * Return the numer of remainder bits. - * @param int $version version - * @return int number of remainder bits - */ - protected function getRemainder($version) { - return $this->capacity[$version][QRCAP_REMINDER]; - } - - /** - * Return a version number that satisfies the input code length. - * @param int $size input code length (byte) - * @param int $level error correction level - * @return int version number - */ - protected function getMinimumVersion($size, $level) { - for ($i=1; $i <= QRSPEC_VERSION_MAX; ++$i) { - $words = $this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]; - if ($words >= $size) { - return $i; - } - } - return -1; - } - - /** - * Return the size of length indicator for the mode and version. - * @param int $mode encoding mode - * @param int $version version - * @return int the size of the appropriate length indicator (bits). - */ - protected function lengthIndicator($mode, $version) { - if ($mode == QR_MODE_ST) { - return 0; - } - if ($version <= 9) { - $l = 0; - } elseif ($version <= 26) { - $l = 1; - } else { - $l = 2; - } - return $this->lengthTableBits[$mode][$l]; - } - - /** - * Return the maximum length for the mode and version. - * @param int $mode encoding mode - * @param int $version version - * @return int the maximum length (bytes) - */ - protected function maximumWords($mode, $version) { - if ($mode == QR_MODE_ST) { - return 3; - } - if ($version <= 9) { - $l = 0; - } else if ($version <= 26) { - $l = 1; - } else { - $l = 2; - } - $bits = $this->lengthTableBits[$mode][$l]; - $words = (1 << $bits) - 1; - if ($mode == QR_MODE_KJ) { - $words *= 2; // the number of bytes is required - } - return $words; - } - - /** - * Return an array of ECC specification. - * @param int $version version - * @param int $level error correction level - * @param array $spec an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code} - * @return array spec - */ - protected function getEccSpec($version, $level, $spec) { - if (count($spec) < 5) { - $spec = array(0, 0, 0, 0, 0); - } - $b1 = $this->eccTable[$version][$level][0]; - $b2 = $this->eccTable[$version][$level][1]; - $data = $this->getDataLength($version, $level); - $ecc = $this->getECCLength($version, $level); - if ($b2 == 0) { - $spec[0] = $b1; - $spec[1] = (int)($data / $b1); - $spec[2] = (int)($ecc / $b1); - $spec[3] = 0; - $spec[4] = 0; - } else { - $spec[0] = $b1; - $spec[1] = (int)($data / ($b1 + $b2)); - $spec[2] = (int)($ecc / ($b1 + $b2)); - $spec[3] = $b2; - $spec[4] = $spec[1] + 1; - } - return $spec; - } - - /** - * Put an alignment marker. - * @param array $frame frame - * @param int $width width - * @param int $ox X center coordinate of the pattern - * @param int $oy Y center coordinate of the pattern - * @return array frame - */ - protected function putAlignmentMarker($frame, $ox, $oy) { - $finder = array( - "\xa1\xa1\xa1\xa1\xa1", - "\xa1\xa0\xa0\xa0\xa1", - "\xa1\xa0\xa1\xa0\xa1", - "\xa1\xa0\xa0\xa0\xa1", - "\xa1\xa1\xa1\xa1\xa1" - ); - $yStart = $oy - 2; - $xStart = $ox - 2; - for ($y=0; $y < 5; $y++) { - $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]); - } - return $frame; - } - - /** - * Put an alignment pattern. - * @param int $version version - * @param array $fram frame - * @param int $width width - * @return array frame - */ - protected function putAlignmentPattern($version, $frame, $width) { - if ($version < 2) { - return $frame; - } - $d = $this->alignmentPattern[$version][1] - $this->alignmentPattern[$version][0]; - if ($d < 0) { - $w = 2; - } else { - $w = (int)(($width - $this->alignmentPattern[$version][0]) / $d + 2); - } - if ($w * $w - 3 == 1) { - $x = $this->alignmentPattern[$version][0]; - $y = $this->alignmentPattern[$version][0]; - $frame = $this->putAlignmentMarker($frame, $x, $y); - return $frame; - } - $cx = $this->alignmentPattern[$version][0]; - $wo = $w - 1; - for ($x=1; $x < $wo; ++$x) { - $frame = $this->putAlignmentMarker($frame, 6, $cx); - $frame = $this->putAlignmentMarker($frame, $cx, 6); - $cx += $d; - } - $cy = $this->alignmentPattern[$version][0]; - for ($y=0; $y < $wo; ++$y) { - $cx = $this->alignmentPattern[$version][0]; - for ($x=0; $x < $wo; ++$x) { - $frame = $this->putAlignmentMarker($frame, $cx, $cy); - $cx += $d; - } - $cy += $d; - } - return $frame; - } - - /** - * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits. - * @param int $version version - * @return BCH encoded version information pattern - */ - protected function getVersionPattern($version) { - if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) { - return 0; - } - return $this->versionPattern[($version - 7)]; - } - - /** - * Return BCH encoded format information pattern. - * @param array $mask - * @param int $level error correction level - * @return BCH encoded format information pattern - */ - protected function getFormatInfo($mask, $level) { - if (($mask < 0) OR ($mask > 7)) { - return 0; - } - if (($level < 0) OR ($level > 3)) { - return 0; - } - return $this->formatInfo[$level][$mask]; - } - - /** - * Put a finder pattern. - * @param array $frame frame - * @param int $width width - * @param int $ox X center coordinate of the pattern - * @param int $oy Y center coordinate of the pattern - * @return array frame - */ - protected function putFinderPattern($frame, $ox, $oy) { - $finder = array( - "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", - "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", - "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", - "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", - "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", - "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", - "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" - ); - for ($y=0; $y < 7; $y++) { - $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]); - } - return $frame; - } - - /** - * Return a copy of initialized frame. - * @param int $version version - * @return Array of unsigned char. - */ - protected function createFrame($version) { - $width = $this->capacity[$version][QRCAP_WIDTH]; - $frameLine = str_repeat ("\0", $width); - $frame = array_fill(0, $width, $frameLine); - // Finder pattern - $frame = $this->putFinderPattern($frame, 0, 0); - $frame = $this->putFinderPattern($frame, $width - 7, 0); - $frame = $this->putFinderPattern($frame, 0, $width - 7); - // Separator - $yOffset = $width - 7; - for ($y=0; $y < 7; ++$y) { - $frame[$y][7] = "\xc0"; - $frame[$y][$width - 8] = "\xc0"; - $frame[$yOffset][7] = "\xc0"; - ++$yOffset; - } - $setPattern = str_repeat("\xc0", 8); - $frame = $this->qrstrset($frame, 0, 7, $setPattern); - $frame = $this->qrstrset($frame, $width-8, 7, $setPattern); - $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern); - // Format info - $setPattern = str_repeat("\x84", 9); - $frame = $this->qrstrset($frame, 0, 8, $setPattern); - $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8); - $yOffset = $width - 8; - for ($y=0; $y < 8; ++$y,++$yOffset) { - $frame[$y][8] = "\x84"; - $frame[$yOffset][8] = "\x84"; - } - // Timing pattern - $wo = $width - 15; - for ($i=1; $i < $wo; ++$i) { - $frame[6][7+$i] = chr(0x90 | ($i & 1)); - $frame[7+$i][6] = chr(0x90 | ($i & 1)); - } - // Alignment pattern - $frame = $this->putAlignmentPattern($version, $frame, $width); - // Version information - if ($version >= 7) { - $vinf = $this->getVersionPattern($version); - $v = $vinf; - for ($x=0; $x<6; ++$x) { - for ($y=0; $y<3; ++$y) { - $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); - $v = $v >> 1; - } - } - $v = $vinf; - for ($y=0; $y<6; ++$y) { - for ($x=0; $x<3; ++$x) { - $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); - $v = $v >> 1; - } - } - } - // and a little bit... - $frame[$width - 8][8] = "\x81"; - return $frame; - } - - /** - * Set new frame for the specified version. - * @param int $version version - * @return Array of unsigned char. - */ - protected function newFrame($version) { - if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) { - return NULL; - } - if (!isset($this->frames[$version])) { - $this->frames[$version] = $this->createFrame($version); - } - if (is_null($this->frames[$version])) { - return NULL; - } - return $this->frames[$version]; - } - - /** - * Return block number 0 - * @param array $spec - * @return int value - */ - protected function rsBlockNum($spec) { - return ($spec[0] + $spec[3]); - } - - /** - * Return block number 1 - * @param array $spec - * @return int value - */ - protected function rsBlockNum1($spec) { - return $spec[0]; - } - - /** - * Return data codes 1 - * @param array $spec - * @return int value - */ - protected function rsDataCodes1($spec) { - return $spec[1]; - } - - /** - * Return ecc codes 1 - * @param array $spec - * @return int value - */ - protected function rsEccCodes1($spec) { - return $spec[2]; - } - - /** - * Return block number 2 - * @param array $spec - * @return int value - */ - protected function rsBlockNum2($spec) { - return $spec[3]; - } - - /** - * Return data codes 2 - * @param array $spec - * @return int value - */ - protected function rsDataCodes2($spec) { - return $spec[4]; - } - - /** - * Return ecc codes 2 - * @param array $spec - * @return int value - */ - protected function rsEccCodes2($spec) { - return $spec[2]; - } - - /** - * Return data length - * @param array $spec - * @return int value - */ - protected function rsDataLength($spec) { - return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); - } - - /** - * Return ecc length - * @param array $spec - * @return int value - */ - protected function rsEccLength($spec) { - return ($spec[0] + $spec[3]) * $spec[2]; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRrs - - /** - * Initialize a Reed-Solomon codec and add it to existing rsitems - * @param int $symsize symbol size, bits - * @param int $gfpoly Field generator polynomial coefficients - * @param int $fcr first root of RS code generator polynomial, index form - * @param int $prim primitive element to generate polynomial roots - * @param int $nroots RS code generator polynomial degree (number of roots) - * @param int $pad padding bytes at front of shortened block - * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>. - */ - protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { - foreach ($this->rsitems as $rs) { - if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize) - OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) { - continue; - } - return $rs; - } - $rs = $this->init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); - array_unshift($this->rsitems, $rs); - return $rs; - } - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - // QRrsItem - - /** - * modnn - * @param array RS values - * @param int $x X position - * @return int X osition - */ - protected function modnn($rs, $x) { - while ($x >= $rs['nn']) { - $x -= $rs['nn']; - $x = ($x >> $rs['mm']) + ($x & $rs['nn']); - } - return $x; - } - - /** - * Initialize a Reed-Solomon codec and returns an array of values. - * @param int $symsize symbol size, bits - * @param int $gfpoly Field generator polynomial coefficients - * @param int $fcr first root of RS code generator polynomial, index form - * @param int $prim primitive element to generate polynomial roots - * @param int $nroots RS code generator polynomial degree (number of roots) - * @param int $pad padding bytes at front of shortened block - * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>. - */ - protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { - // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2) - $rs = null; - // Check parameter ranges - if (($symsize < 0) OR ($symsize > 8)) { - return $rs; - } - if (($fcr < 0) OR ($fcr >= (1<<$symsize))) { - return $rs; - } - if (($prim <= 0) OR ($prim >= (1<<$symsize))) { - return $rs; - } - if (($nroots < 0) OR ($nroots >= (1<<$symsize))) { - return $rs; - } - if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) { - return $rs; - } - $rs = array(); - $rs['mm'] = $symsize; - $rs['nn'] = (1 << $symsize) - 1; - $rs['pad'] = $pad; - $rs['alpha_to'] = array_fill(0, ($rs['nn'] + 1), 0); - $rs['index_of'] = array_fill(0, ($rs['nn'] + 1), 0); - // PHP style macro replacement ;) - $NN =& $rs['nn']; - $A0 =& $NN; - // Generate Galois field lookup tables - $rs['index_of'][0] = $A0; // log(zero) = -inf - $rs['alpha_to'][$A0] = 0; // alpha**-inf = 0 - $sr = 1; - for ($i=0; $i<$rs['nn']; ++$i) { - $rs['index_of'][$sr] = $i; - $rs['alpha_to'][$i] = $sr; - $sr <<= 1; - if ($sr & (1 << $symsize)) { - $sr ^= $gfpoly; - } - $sr &= $rs['nn']; - } - if ($sr != 1) { - // field generator polynomial is not primitive! - return NULL; - } - // Form RS code generator polynomial from its roots - $rs['genpoly'] = array_fill(0, ($nroots + 1), 0); - $rs['fcr'] = $fcr; - $rs['prim'] = $prim; - $rs['nroots'] = $nroots; - $rs['gfpoly'] = $gfpoly; - // Find prim-th root of 1, used in decoding - for ($iprim=1; ($iprim % $prim) != 0; $iprim += $rs['nn']) { - ; // intentional empty-body loop! - } - $rs['iprim'] = (int)($iprim / $prim); - $rs['genpoly'][0] = 1; - for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { - $rs['genpoly'][$i+1] = 1; - // Multiply rs->genpoly[] by @**(root + x) - for ($j = $i; $j > 0; --$j) { - if ($rs['genpoly'][$j] != 0) { - $rs['genpoly'][$j] = $rs['genpoly'][$j-1] ^ $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][$j]] + $root)]; - } else { - $rs['genpoly'][$j] = $rs['genpoly'][$j-1]; - } - } - // rs->genpoly[0] can never be zero - $rs['genpoly'][0] = $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][0]] + $root)]; - } - // convert rs->genpoly[] to index form for quicker encoding - for ($i = 0; $i <= $nroots; ++$i) { - $rs['genpoly'][$i] = $rs['index_of'][$rs['genpoly'][$i]]; - } - return $rs; - } - - /** - * Encode a Reed-Solomon codec and returns the parity array - * @param array $rs RS values - * @param array $data data - * @param array $parity parity - * @return parity array - */ - protected function encode_rs_char($rs, $data, $parity) { - $MM =& $rs['mm']; // bits per symbol - $NN =& $rs['nn']; // the total number of symbols in a RS block - $ALPHA_TO =& $rs['alpha_to']; // the address of an array of NN elements to convert Galois field elements in index (log) form to polynomial form - $INDEX_OF =& $rs['index_of']; // the address of an array of NN elements to convert Galois field elements in polynomial form to index (log) form - $GENPOLY =& $rs['genpoly']; // an array of NROOTS+1 elements containing the generator polynomial in index form - $NROOTS =& $rs['nroots']; // the number of roots in the RS code generator polynomial, which is the same as the number of parity symbols in a block - $FCR =& $rs['fcr']; // first consecutive root, index form - $PRIM =& $rs['prim']; // primitive element, index form - $IPRIM =& $rs['iprim']; // prim-th root of 1, index form - $PAD =& $rs['pad']; // the number of pad symbols in a block - $A0 =& $NN; - $parity = array_fill(0, $NROOTS, 0); - for ($i=0; $i < ($NN - $NROOTS - $PAD); $i++) { - $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; - if ($feedback != $A0) { - // feedback term is non-zero - // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must - // always be for the polynomials constructed by init_rs() - $feedback = $this->modnn($rs, $NN - $GENPOLY[$NROOTS] + $feedback); - for ($j=1; $j < $NROOTS; ++$j) { - $parity[$j] ^= $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[($NROOTS - $j)])]; - } - } - // Shift - array_shift($parity); - if ($feedback != $A0) { - array_push($parity, $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[0])]); - } else { - array_push($parity, 0); - } - } - return $parity; - } - - } // end QRcode class - -} // END OF "class_exists QRcode" -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.crt b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.crt deleted file mode 100644 index f0491391cf..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.crt +++ /dev/null @@ -1,40 +0,0 @@ -Bag Attributes - localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C -subject=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT -issuer=/CN=TCPDF DEMO/O=TCPDF/OU=DEMO/emailAddress=you@example.com/C=IT ------BEGIN CERTIFICATE----- -MIIC1TCCAj6gAwIBAgIKkehOL/XGkB5cjjANBgkqhkiG9w0BAQUFADBhMRMwEQYD -VQQDEwpUQ1BERiBERU1PMQ4wDAYDVQQKEwVUQ1BERjENMAsGA1UECxMEREVNTzEe -MBwGCSqGSIb3DQEJARYPeW91QGV4YW1wbGUuY29tMQswCQYDVQQGEwJJVDAeFw0w -OTA4MjExMjU0NDhaFw0xNDA4MjExMjU0NDhaMGExEzARBgNVBAMTClRDUERGIERF -TU8xDjAMBgNVBAoTBVRDUERGMQ0wCwYDVQQLEwRERU1PMR4wHAYJKoZIhvcNAQkB -Fg95b3VAZXhhbXBsZS5jb20xCzAJBgNVBAYTAklUMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H -XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0 -Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB -o4GTMIGQMDcGA1UdEgQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwGA1UECgwFVENQ -REagCwYDVQQLDARERU1PMDcGA1UdEQQwMC6gEQYDVQQDDApUQ1BERiBERU1PoAwG -A1UECgwFVENQREagCwYDVQQLDARERU1PMA8GCSqGSIb3LwEBCgQCBQAwCwYDVR0P -BAQDAgSQMA0GCSqGSIb3DQEBBQUAA4GBAEhTQfqX3ZNdHmpTLDbIj22RHXii2roE -OavCbu9WsHoWpva0qSd+yIoD594VHvYAd29sfzDfiN+7W0aiZfDhq5jpaSQMVlN8 -RGYMupbHY/+a9Gz1wqxnR84mlTtIkZVRYAhsfPwy6M1BEjdMqfdh9h40JIdkdjtb -8faTCfXPePWQ ------END CERTIFICATE----- -Bag Attributes - localKeyID: 7B AB 1B 7A BE 4C 85 C0 1A A6 DC 59 3F 79 48 C3 93 38 68 9C -Key Attributes: <No Attributes> ------BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQDAqIL0uGKmTR98Lxx2vEEE1OGKkMXFo0JViitALe7Onhxxqx0H -XMUDKF5mvEVu1rcvh7/oAnAfrCuEpL/up3u1mQCgBE7WXBnFFE/AE3jCksh9OkS0 -Z0Xj9woN5bzxRDsGoPiOu/4xzk5qSEXt8jf2Ep90QuNkqLIRT4swAzpDbwIDAQAB -AoGAXc+wNMmz/5Z+RlIKYia44klmqbplEx+0JULqXI4BQsrqvs67i+I4bJkznoL+ -rEIRYSuQ3sCRKFsFtckjTGpxadnxkB+uwGKc6pZChv99BFX6HFR4hgBlT/BBRAQA -hMDlM2JIRr4S4SMVXR7MHwGMUf9mUeanGLR3ZWtU3aXJrIECQQD7OaYUVYNEEnM9 -uXyjm22CuHyqyEf5gb13sK0uQty67547yJTMUQZd/sQc9KGwhzBbhrob2LO2jAhh -S+f+NSRnAkEAxFHm3fMI5RgXmswxlGm4QW07a/Ueo7ZJG6xjTkFXluJhd+XHswRD -dQIO3zG9nGjNUoeMrPhXhPvKqFc2F9RDuQJAQBEGin74N77gxqfr4ik79y8nE8J5 -oGZ2s/RJZdfFRKLg3mwbjjNHhWb4Ck5UgZkoOt8TzRApXG8/n9hktE5HFwJBALur -M5AueO1Pl5kB489lNJ9OxUQRYUXMxpxuscuoCQwSwmv0O2+0/qtG2WKhUQnI4aYo -L+FV0YwtivBb1jj3T/kCQQDIWOxq8eRowdaMzvJpRUHFgMcf1AVZExKyrugwYOWd -KNsDxC4KaQOsPt8iT/Ulo4g/MJC0HolCOhWibKmR9Ayl ------END RSA PRIVATE KEY----- diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.fdf b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.fdf deleted file mode 100644 index a8f7c35d9a..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.fdf and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.p12 b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.p12 deleted file mode 100644 index 611f0dfb17..0000000000 Binary files a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.p12 and /dev/null differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.php deleted file mode 100644 index 65852f2304..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/tcpdf.php +++ /dev/null @@ -1,25629 +0,0 @@ -<?php -//============================================================+ -// File name : tcpdf.php -// Version : 5.9.009 -// Begin : 2002-08-03 -// Last Update : 2010-10-21 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2002-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : This is a PHP class for generating PDF documents without -// requiring external extensions. -// -// NOTE: -// This class was originally derived in 2002 from the Public -// Domain FPDF class by Olivier Plathey (http://www.fpdf.org), -// but now is almost entirely rewritten and contains thousands of -// new lines of code and hundreds new features. -// -// Main features: -// * no external libraries are required for the basic functions; -// * all standard page formats, custom page formats, custom margins and units of measure; -// * UTF-8 Unicode and Right-To-Left languages; -// * TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts; -// * font subsetting; -// * methods to publish some XHTML + CSS code, Javascript and Forms; -// * images, graphic (geometric figures) and transformation methods; -// * supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html) -// * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417; -// * Grayscale, RGB, CMYK, Spot Colors and Transparencies; -// * automatic page header and footer management; -// * document encryption up to 256 bit and digital signature certifications; -// * transactions to UNDO commands; -// * PDF annotations, including links, text and file attachments; -// * text rendering modes (fill, stroke and clipping); -// * multiple columns mode; -// * no-write page regions; -// * bookmarks and table of content; -// * text hyphenation; -// * text stretching and spacing (tracking/kerning); -// * automatic page break, line break and text alignments including justification; -// * automatic page numbering and page groups; -// * move and delete pages; -// * page compression (requires php-zlib extension); -// * XOBject Templates; -// -// ----------------------------------------------------------- -// THANKS TO: -// -// Olivier Plathey (http://www.fpdf.org) for original FPDF. -// Efthimios Mavrogeorgiadis (emavro@yahoo.com) for suggestions on RTL language support. -// Klemen Vodopivec (http://www.fpdf.de/downloads/addons/37/) for Encryption algorithm. -// Warren Sherliker (wsherliker@gmail.com) for better image handling. -// dullus for text Justification. -// Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute. -// Patrick Benny for text stretch suggestion on Cell(). -// Johannes Güntert for JavaScript support. -// Denis Van Nuffelen for Dynamic Form. -// Jacek Czekaj for multibyte justification -// Anthony Ferrara for the reintroduction of legacy image methods. -// Sourceforge user 1707880 (hucste) for line-trough mode. -// Larry Stanbery for page groups. -// Martin Hall-May for transparency. -// Aaron C. Spike for Polycurve method. -// Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support. -// Moritz Wagner and Andreas Wurmser for graphic functions. -// Andrew Whitehead for core fonts support. -// Esteban Joël Marín for OpenType font conversion. -// Teus Hagen for several suggestions and fixes. -// Yukihiro Nakadaira for CID-0 CJK fonts fixes. -// Kosmas Papachristos for some CSS improvements. -// Marcel Partap for some fixes. -// Won Kyu Park for several suggestions, fixes and patches. -// Dominik Dzienia for QR-code support. -// Laurent Minguet for some suggestions. -// Christian Deligant for some suggestions and fixes. -// Anyone that has reported a bug or sent a suggestion. -//============================================================+ - -/** - * This is a PHP class for generating PDF documents without requiring external extensions.<br> - * TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> - * <h3>TCPDF main features are:</h3> - * <ul> - * <li>no external libraries are required for the basic functions;</li> - * <li>all standard page formats, custom page formats, custom margins and units of measure;</li> - * <li>UTF-8 Unicode and Right-To-Left languages;</li> - * <li>TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li> - * <li>font subsetting;</li> - * <li>methods to publish some XHTML + CSS code, Javascript and Forms;</li> - * <li>images, graphic (geometric figures) and transformation methods; - * <li>supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)</li> - * <li>1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, QR-Code, PDF417;</li> - * <li>Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li> - * <li>automatic page header and footer management;</li> - * <li>document encryption up to 256 bit and digital signature certifications;</li> - * <li>transactions to UNDO commands;</li> - * <li>PDF annotations, including links, text and file attachments;</li> - * <li>text rendering modes (fill, stroke and clipping);</li> - * <li>multiple columns mode;</li> - * <li>no-write page regions;</li> - * <li>bookmarks and table of content;</li> - * <li>text hyphenation;</li> - * <li>text stretching and spacing (tracking/kerning);</li> - * <li>automatic page break, line break and text alignments including justification;</li> - * <li>automatic page numbering and page groups;</li> - * <li>move and delete pages;</li> - * <li>page compression (requires php-zlib extension);</li> - * <li>XOBject Templates;</li> - * </ul> - * Tools to encode your unicode fonts are on fonts/utils directory.</p> - * @package com.tecnick.tcpdf - * @abstract Class for generating PDF files on-the-fly without requiring external extensions. - * @author Nicola Asuni - * @copyright 2002-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @version 5.9.009 - */ - -/** - * main configuration file - * (define the K_TCPDF_EXTERNAL_CONFIG constant to skip this file) - */ -require_once(dirname(__FILE__).'/config/tcpdf_config.php'); - -/** - * define default PDF document producer - */ -define('PDF_PRODUCER', 'TCPDF 5.9.009 (http://www.tcpdf.org)'); - -/** -* This is a PHP class for generating PDF documents without requiring external extensions.<br> -* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br> -* @name TCPDF -* @package com.tecnick.tcpdf -* @version 5.9.009 -* @author Nicola Asuni - info@tecnick.com -* @link http://www.tcpdf.org -* @license http://www.gnu.org/copyleft/lesser.html LGPL -*/ -class TCPDF { - - // Protected properties - - /** - * @var current page number - * @access protected - */ - protected $page; - - /** - * @var current object number - * @access protected - */ - protected $n; - - /** - * @var array of object offsets - * @access protected - */ - protected $offsets; - - /** - * @var buffer holding in-memory PDF - * @access protected - */ - protected $buffer; - - /** - * @var array containing pages - * @access protected - */ - protected $pages = array(); - - /** - * @var current document state - * @access protected - */ - protected $state; - - /** - * @var compression flag - * @access protected - */ - protected $compress; - - /** - * @var current page orientation (P = Portrait, L = Landscape) - * @access protected - */ - protected $CurOrientation; - - /** - * @var Page dimensions - * @access protected - */ - protected $pagedim = array(); - - /** - * @var scale factor (number of points in user unit) - * @access protected - */ - protected $k; - - /** - * @var width of page format in points - * @access protected - */ - protected $fwPt; - - /** - * @var height of page format in points - * @access protected - */ - protected $fhPt; - - /** - * @var current width of page in points - * @access protected - */ - protected $wPt; - - /** - * @var current height of page in points - * @access protected - */ - protected $hPt; - - /** - * @var current width of page in user unit - * @access protected - */ - protected $w; - - /** - * @var current height of page in user unit - * @access protected - */ - protected $h; - - /** - * @var left margin - * @access protected - */ - protected $lMargin; - - /** - * @var top margin - * @access protected - */ - protected $tMargin; - - /** - * @var right margin - * @access protected - */ - protected $rMargin; - - /** - * @var page break margin - * @access protected - */ - protected $bMargin; - - /** - * @var array of cell internal paddings ('T' => top, 'R' => right, 'B' => bottom, 'L' => left) - * @since 5.9.000 (2010-10-03) - * @access protected - */ - protected $cell_padding = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0); - - /** - * @var array of cell margins ('T' => top, 'R' => right, 'B' => bottom, 'L' => left) - * @since 5.9.000 (2010-10-04) - * @access protected - */ - protected $cell_margin = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0); - - /** - * @var current horizontal position in user unit for cell positioning - * @access protected - */ - protected $x; - - /** - * @var current vertical position in user unit for cell positioning - * @access protected - */ - protected $y; - - /** - * @var height of last cell printed - * @access protected - */ - protected $lasth; - - /** - * @var line width in user unit - * @access protected - */ - protected $LineWidth; - - /** - * @var array of standard font names - * @access protected - */ - protected $CoreFonts; - - /** - * @var array of used fonts - * @access protected - */ - protected $fonts = array(); - - /** - * @var array of font files - * @access protected - */ - protected $FontFiles = array(); - - /** - * @var array of encoding differences - * @access protected - */ - protected $diffs = array(); - - /** - * @var array of used images - * @access protected - */ - protected $images = array(); - - /** - * @var array of Annotations in pages - * @access protected - */ - protected $PageAnnots = array(); - - /** - * @var array of internal links - * @access protected - */ - protected $links = array(); - - /** - * @var current font family - * @access protected - */ - protected $FontFamily; - - /** - * @var current font style - * @access protected - */ - protected $FontStyle; - - /** - * @var current font ascent (distance between font top and baseline) - * @access protected - * @since 2.8.000 (2007-03-29) - */ - protected $FontAscent; - - /** - * @var current font descent (distance between font bottom and baseline) - * @access protected - * @since 2.8.000 (2007-03-29) - */ - protected $FontDescent; - - /** - * @var underlining flag - * @access protected - */ - protected $underline; - - /** - * @var overlining flag - * @access protected - */ - protected $overline; - - /** - * @var current font info - * @access protected - */ - protected $CurrentFont; - - /** - * @var current font size in points - * @access protected - */ - protected $FontSizePt; - - /** - * @var current font size in user unit - * @access protected - */ - protected $FontSize; - - /** - * @var commands for drawing color - * @access protected - */ - protected $DrawColor; - - /** - * @var commands for filling color - * @access protected - */ - protected $FillColor; - - /** - * @var commands for text color - * @access protected - */ - protected $TextColor; - - /** - * @var indicates whether fill and text colors are different - * @access protected - */ - protected $ColorFlag; - - /** - * @var automatic page breaking - * @access protected - */ - protected $AutoPageBreak; - - /** - * @var threshold used to trigger page breaks - * @access protected - */ - protected $PageBreakTrigger; - - /** - * @var flag set when processing footer - * @access protected - */ - protected $InFooter = false; - - /** - * @var zoom display mode - * @access protected - */ - protected $ZoomMode; - - /** - * @var layout display mode - * @access protected - */ - protected $LayoutMode; - - /** - * @var title - * @access protected - */ - protected $title = ''; - - /** - * @var subject - * @access protected - */ - protected $subject = ''; - - /** - * @var author - * @access protected - */ - protected $author = ''; - - /** - * @var keywords - * @access protected - */ - protected $keywords = ''; - - /** - * @var creator - * @access protected - */ - protected $creator = ''; - - /** - * @var alias for total number of pages - * @access protected - */ - protected $AliasNbPages = '{nb}'; - - /** - * @var alias for page number - * @access protected - */ - protected $AliasNumPage = '{pnb}'; - - /** - * @var right-bottom corner X coordinate of inserted image - * @since 2002-07-31 - * @author Nicola Asuni - * @access protected - */ - protected $img_rb_x; - - /** - * @var right-bottom corner Y coordinate of inserted image - * @since 2002-07-31 - * @author Nicola Asuni - * @access protected - */ - protected $img_rb_y; - - /** - * @var adjusting factor to convert pixels to user units. - * @since 2004-06-14 - * @author Nicola Asuni - * @access protected - */ - protected $imgscale = 1; - - /** - * @var boolean set to true when the input text is unicode (require unicode fonts) - * @since 2005-01-02 - * @author Nicola Asuni - * @access protected - */ - protected $isunicode = false; - - /** - * @var object containing unicode data - * @since 5.9.004 (2010-10-18) - * @author Nicola Asuni - * @access protected - */ - protected $unicode; - - /** - * @var PDF version - * @since 1.5.3 - * @access protected - */ - protected $PDFVersion = '1.7'; - - /** - * @var Minimum distance between header and top page margin. - * @access protected - */ - protected $header_margin; - - /** - * @var Minimum distance between footer and bottom page margin. - * @access protected - */ - protected $footer_margin; - - /** - * @var original left margin value - * @access protected - * @since 1.53.0.TC013 - */ - protected $original_lMargin; - - /** - * @var original right margin value - * @access protected - * @since 1.53.0.TC013 - */ - protected $original_rMargin; - - /** - * @var Header font. - * @access protected - */ - protected $header_font; - - /** - * @var Footer font. - * @access protected - */ - protected $footer_font; - - /** - * @var Language templates. - * @access protected - */ - protected $l; - - /** - * @var Barcode to print on page footer (only if set). - * @access protected - */ - protected $barcode = false; - - /** - * @var If true prints header - * @access protected - */ - protected $print_header = true; - - /** - * @var If true prints footer. - * @access protected - */ - protected $print_footer = true; - - /** - * @var Header image logo. - * @access protected - */ - protected $header_logo = ''; - - /** - * @var Header image logo width in mm. - * @access protected - */ - protected $header_logo_width = 30; - - /** - * @var String to print as title on document header. - * @access protected - */ - protected $header_title = ''; - - /** - * @var String to print on document header. - * @access protected - */ - protected $header_string = ''; - - /** - * @var Default number of columns for html table. - * @access protected - */ - protected $default_table_columns = 4; - - // variables for html parser - - /** - * @var HTML PARSER: array to store current link and rendering styles. - * @access protected - */ - protected $HREF = array(); - - /** - * @var store a list of available fonts on filesystem. - * @access protected - */ - protected $fontlist = array(); - - /** - * @var current foreground color - * @access protected - */ - protected $fgcolor; - - /** - * @var HTML PARSER: array of boolean values, true in case of ordered list (OL), false otherwise. - * @access protected - */ - protected $listordered = array(); - - /** - * @var HTML PARSER: array count list items on nested lists. - * @access protected - */ - protected $listcount = array(); - - /** - * @var HTML PARSER: current list nesting level. - * @access protected - */ - protected $listnum = 0; - - /** - * @var HTML PARSER: indent amount for lists. - * @access protected - */ - protected $listindent = 0; - - /** - * @var HTML PARSER: current list indententation level. - * @access protected - */ - protected $listindentlevel = 0; - - /** - * @var current background color - * @access protected - */ - protected $bgcolor; - - /** - * @var Store temporary font size in points. - * @access protected - */ - protected $tempfontsize = 10; - - /** - * @var spacer for LI tags. - * @access protected - */ - protected $lispacer = ''; - - /** - * @var default encoding - * @access protected - * @since 1.53.0.TC010 - */ - protected $encoding = 'UTF-8'; - - /** - * @var PHP internal encoding - * @access protected - * @since 1.53.0.TC016 - */ - protected $internal_encoding; - - /** - * @var indicates if the document language is Right-To-Left - * @access protected - * @since 2.0.000 - */ - protected $rtl = false; - - /** - * @var used to force RTL or LTR string inversion - * @access protected - * @since 2.0.000 - */ - protected $tmprtl = false; - - // --- Variables used for document encryption: - - /** - * Indicates whether document is protected - * @access protected - * @since 2.0.000 (2008-01-02) - */ - protected $encrypted; - - /** - * Array containing encryption settings - * @access protected - * @since 5.0.005 (2010-05-11) - */ - protected $encryptdata = array(); - - /** - * last RC4 key encrypted (cached for optimisation) - * @access protected - * @since 2.0.000 (2008-01-02) - */ - protected $last_enc_key; - - /** - * last RC4 computed key - * @access protected - * @since 2.0.000 (2008-01-02) - */ - protected $last_enc_key_c; - - /** - * Encryption padding - * @access protected - */ - protected $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A"; - - /** - * File ID (used on trailer) - * @access protected - * @since 5.0.005 (2010-05-12) - */ - protected $file_id; - - // --- bookmark --- - - /** - * Outlines for bookmark - * @access protected - * @since 2.1.002 (2008-02-12) - */ - protected $outlines = array(); - - /** - * Outline root for bookmark - * @access protected - * @since 2.1.002 (2008-02-12) - */ - protected $OutlineRoot; - - // --- javascript and form --- - - /** - * javascript code - * @access protected - * @since 2.1.002 (2008-02-12) - */ - protected $javascript = ''; - - /** - * javascript counter - * @access protected - * @since 2.1.002 (2008-02-12) - */ - protected $n_js; - - /** - * line trough state - * @access protected - * @since 2.8.000 (2008-03-19) - */ - protected $linethrough; - - /** - * Array with additional document-wide usage rights for the document. - * @access protected - * @since 5.8.014 (2010-08-23) - */ - protected $ur = array(); - - /** - * Dot Per Inch Document Resolution (do not change) - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $dpi = 72; - - /** - * Array of page numbers were a new page group was started - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $newpagegroup = array(); - - /** - * Contains the number of pages of the groups - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $pagegroups; - - /** - * Contains the alias of the current page group - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $currpagegroup; - - /** - * Restrict the rendering of some elements to screen or printout. - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $visibility = 'all'; - - /** - * Print visibility. - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $n_ocg_print; - - /** - * View visibility. - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $n_ocg_view; - - /** - * Array of transparency objects and parameters. - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $extgstates; - - /** - * Set the default JPEG compression quality (1-100) - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected $jpeg_quality; - - /** - * Default cell height ratio. - * @access protected - * @since 3.0.014 (2008-05-23) - */ - protected $cell_height_ratio = K_CELL_HEIGHT_RATIO; - - /** - * PDF viewer preferences. - * @access protected - * @since 3.1.000 (2008-06-09) - */ - protected $viewer_preferences; - - /** - * A name object specifying how the document should be displayed when opened. - * @access protected - * @since 3.1.000 (2008-06-09) - */ - protected $PageMode; - - /** - * Array for storing gradient information. - * @access protected - * @since 3.1.000 (2008-06-09) - */ - protected $gradients = array(); - - /** - * Array used to store positions inside the pages buffer. - * keys are the page numbers - * @access protected - * @since 3.2.000 (2008-06-26) - */ - protected $intmrk = array(); - - /** - * Array used to store positions inside the pages buffer. - * keys are the page numbers - * @access protected - * @since 5.7.000 (2010-08-03) - */ - protected $bordermrk = array(); - - /** - * Array used to store page positions to track empty pages. - * keys are the page numbers - * @access protected - * @since 5.8.007 (2010-08-18) - */ - protected $emptypagemrk = array(); - - /** - * Array used to store content positions inside the pages buffer. - * keys are the page numbers - * @access protected - * @since 4.6.021 (2009-07-20) - */ - protected $cntmrk = array(); - - /** - * Array used to store footer positions of each page. - * @access protected - * @since 3.2.000 (2008-07-01) - */ - protected $footerpos = array(); - - /** - * Array used to store footer length of each page. - * @access protected - * @since 4.0.014 (2008-07-29) - */ - protected $footerlen = array(); - - /** - * True if a newline is created. - * @access protected - * @since 3.2.000 (2008-07-01) - */ - protected $newline = true; - - /** - * End position of the latest inserted line - * @access protected - * @since 3.2.000 (2008-07-01) - */ - protected $endlinex = 0; - - /** - * PDF string for last line width - * @access protected - * @since 4.0.006 (2008-07-16) - */ - protected $linestyleWidth = ''; - - /** - * PDF string for last line width - * @access protected - * @since 4.0.006 (2008-07-16) - */ - protected $linestyleCap = '0 J'; - - /** - * PDF string for last line width - * @access protected - * @since 4.0.006 (2008-07-16) - */ - protected $linestyleJoin = '0 j'; - - /** - * PDF string for last line width - * @access protected - * @since 4.0.006 (2008-07-16) - */ - protected $linestyleDash = '[] 0 d'; - - /** - * True if marked-content sequence is open - * @access protected - * @since 4.0.013 (2008-07-28) - */ - protected $openMarkedContent = false; - - /** - * Count the latest inserted vertical spaces on HTML - * @access protected - * @since 4.0.021 (2008-08-24) - */ - protected $htmlvspace = 0; - - /** - * Array of Spot colors - * @access protected - * @since 4.0.024 (2008-09-12) - */ - protected $spot_colors = array(); - - /** - * Symbol used for HTML unordered list items - * @access protected - * @since 4.0.028 (2008-09-26) - */ - protected $lisymbol = ''; - - /** - * String used to mark the beginning and end of EPS image blocks - * @access protected - * @since 4.1.000 (2008-10-18) - */ - protected $epsmarker = 'x#!#EPS#!#x'; - - /** - * Array of transformation matrix - * @access protected - * @since 4.2.000 (2008-10-29) - */ - protected $transfmatrix = array(); - - /** - * Current key for transformation matrix - * @access protected - * @since 4.8.005 (2009-09-17) - */ - protected $transfmatrix_key = 0; - - /** - * Booklet mode for double-sided pages - * @access protected - * @since 4.2.000 (2008-10-29) - */ - protected $booklet = false; - - /** - * Epsilon value used for float calculations - * @access protected - * @since 4.2.000 (2008-10-29) - */ - protected $feps = 0.005; - - /** - * Array used for custom vertical spaces for HTML tags - * @access protected - * @since 4.2.001 (2008-10-30) - */ - protected $tagvspaces = array(); - - /** - * @var HTML PARSER: custom indent amount for lists. - * Negative value means disabled. - * @access protected - * @since 4.2.007 (2008-11-12) - */ - protected $customlistindent = -1; - - /** - * @var if true keeps the border open for the cell sides that cross the page. - * @access protected - * @since 4.2.010 (2008-11-14) - */ - protected $opencell = true; - - /** - * @var array of files to embedd - * @access protected - * @since 4.4.000 (2008-12-07) - */ - protected $embeddedfiles = array(); - - /** - * @var boolean true when inside html pre tag - * @access protected - * @since 4.4.001 (2008-12-08) - */ - protected $premode = false; - - /** - * Array used to store positions of graphics transformation blocks inside the page buffer. - * keys are the page numbers - * @access protected - * @since 4.4.002 (2008-12-09) - */ - protected $transfmrk = array(); - - /** - * Default color for html links - * @access protected - * @since 4.4.003 (2008-12-09) - */ - protected $htmlLinkColorArray = array(0, 0, 255); - - /** - * Default font style to add to html links - * @access protected - * @since 4.4.003 (2008-12-09) - */ - protected $htmlLinkFontStyle = 'U'; - - /** - * Counts the number of pages. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $numpages = 0; - - /** - * Array containing page lengths in bytes. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $pagelen = array(); - - /** - * Counts the number of pages. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $numimages = 0; - - /** - * Store the image keys. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $imagekeys = array(); - - /** - * Length of the buffer in bytes. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $bufferlen = 0; - - /** - * If true enables disk caching. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected $diskcache = false; - - /** - * Counts the number of fonts. - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected $numfonts = 0; - - /** - * Store the font keys. - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected $fontkeys = array(); - - /** - * Store the font object IDs. - * @access protected - * @since 4.8.001 (2009-09-09) - */ - protected $font_obj_ids = array(); - - /** - * Store the fage status (true when opened, false when closed). - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected $pageopen = array(); - - /** - * Default monospaced font - * @access protected - * @since 4.5.025 (2009-03-10) - */ - protected $default_monospaced_font = 'courier'; - - /** - * Used to store a cloned copy of the current class object - * @access protected - * @since 4.5.029 (2009-03-19) - */ - protected $objcopy; - - /** - * Array used to store the lengths of cache files - * @access protected - * @since 4.5.029 (2009-03-19) - */ - protected $cache_file_length = array(); - - /** - * Table header content to be repeated on each new page - * @access protected - * @since 4.5.030 (2009-03-20) - */ - protected $thead = ''; - - /** - * Margins used for table header. - * @access protected - * @since 4.5.030 (2009-03-20) - */ - protected $theadMargins = array(); - - /** - * Cache array for UTF8StringToArray() method. - * @access protected - * @since 4.5.037 (2009-04-07) - */ - protected $cache_UTF8StringToArray = array(); - - /** - * Maximum size of cache array used for UTF8StringToArray() method. - * @access protected - * @since 4.5.037 (2009-04-07) - */ - protected $cache_maxsize_UTF8StringToArray = 8; - - /** - * Current size of cache array used for UTF8StringToArray() method. - * @access protected - * @since 4.5.037 (2009-04-07) - */ - protected $cache_size_UTF8StringToArray = 0; - - /** - * If true enables document signing - * @access protected - * @since 4.6.005 (2009-04-24) - */ - protected $sign = false; - - /** - * Signature data - * @access protected - * @since 4.6.005 (2009-04-24) - */ - protected $signature_data = array(); - - /** - * Signature max length - * @access protected - * @since 4.6.005 (2009-04-24) - */ - protected $signature_max_length = 11742; - - /** - * data for signature appearance - * @access protected - * @since 5.3.011 (2010-06-16) - */ - protected $signature_appearance = array('page' => 1, 'rect' => '0 0 0 0'); - - /** - * Regular expression used to find blank characters used for word-wrapping. - * @access protected - * @since 4.6.006 (2009-04-28) - */ - protected $re_spaces = '/[^\S\xa0]/'; - - /** - * Array of parts $re_spaces - * @access protected - * @since 5.5.011 (2010-07-09) - */ - protected $re_space = array('p' => '[^\S\xa0]', 'm' => ''); - - /** - * Signature object ID - * @access protected - * @since 4.6.022 (2009-06-23) - */ - protected $sig_obj_id = 0; - - /** - * ByteRange placemark used during signature process. - * @access protected - * @since 4.6.028 (2009-08-25) - */ - protected $byterange_string = '/ByteRange[0 ********** ********** **********]'; - - /** - * Placemark used during signature process. - * @access protected - * @since 4.6.028 (2009-08-25) - */ - protected $sig_annot_ref = '***SIGANNREF*** 0 R'; - - /** - * ID of page objects - * @access protected - * @since 4.7.000 (2009-08-29) - */ - protected $page_obj_id = array(); - - /** - * List of form annotations IDs - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $form_obj_id = array(); - - /** - * Deafult Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. Annotation options can be directly specified using the 'aopt' entry. - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); - - /** - * Javascript objects array - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $js_objects = array(); - - /** - * Current form action (used during XHTML rendering) - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $form_action = ''; - - /** - * Current form encryption type (used during XHTML rendering) - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $form_enctype = 'application/x-www-form-urlencoded'; - - /** - * Current method to submit forms. - * @access protected - * @since 4.8.000 (2009-09-07) - */ - protected $form_mode = 'post'; - - /** - * List of fonts used on form fields (fontname => fontkey). - * @access protected - * @since 4.8.001 (2009-09-09) - */ - protected $annotation_fonts = array(); - - /** - * List of radio buttons parent objects. - * @access protected - * @since 4.8.001 (2009-09-09) - */ - protected $radiobutton_groups = array(); - - /** - * List of radio group objects IDs - * @access protected - * @since 4.8.001 (2009-09-09) - */ - protected $radio_groups = array(); - - /** - * Text indentation value (used for text-indent CSS attribute) - * @access protected - * @since 4.8.006 (2009-09-23) - */ - protected $textindent = 0; - - /** - * Store page number when startTransaction() is called. - * @access protected - * @since 4.8.006 (2009-09-23) - */ - protected $start_transaction_page = 0; - - /** - * Store Y position when startTransaction() is called. - * @access protected - * @since 4.9.001 (2010-03-28) - */ - protected $start_transaction_y = 0; - - /** - * True when we are printing the thead section on a new page - * @access protected - * @since 4.8.027 (2010-01-25) - */ - protected $inthead = false; - - /** - * Array of column measures (width, space, starting Y position) - * @access protected - * @since 4.9.001 (2010-03-28) - */ - protected $columns = array(); - - /** - * Number of colums - * @access protected - * @since 4.9.001 (2010-03-28) - */ - protected $num_columns = 1; - - /** - * Current column number - * @access protected - * @since 4.9.001 (2010-03-28) - */ - protected $current_column = 0; - - /** - * Starting page for columns - * @access protected - * @since 4.9.001 (2010-03-28) - */ - protected $column_start_page = 0; - - /** - * Maximum page and column selected - * @access protected - * @since 5.8.000 (2010-08-11) - */ - protected $maxselcol = array('page' => 0, 'column' => 0); - - /** - * Array of: X difference between table cell x start and starting page margin, cellspacing, cellpadding - * @access protected - * @since 5.8.000 (2010-08-11) - */ - protected $colxshift = array('x' => 0, 's' => 0, 'p' => 0); - - /** - * Text rendering mode: 0 = Fill text; 1 = Stroke text; 2 = Fill, then stroke text; 3 = Neither fill nor stroke text (invisible); 4 = Fill text and add to path for clipping; 5 = Stroke text and add to path for clipping; 6 = Fill, then stroke text and add to path for clipping; 7 = Add text to path for clipping. - * @access protected - * @since 4.9.008 (2010-04-03) - */ - protected $textrendermode = 0; - - /** - * Text stroke width in doc units - * @access protected - * @since 4.9.008 (2010-04-03) - */ - protected $textstrokewidth = 0; - - /** - * @var current stroke color - * @access protected - * @since 4.9.008 (2010-04-03) - */ - protected $strokecolor; - - /** - * @var default unit of measure for document - * @access protected - * @since 5.0.000 (2010-04-22) - */ - protected $pdfunit = 'mm'; - - /** - * @var true when we are on TOC (Table Of Content) page - * @access protected - */ - protected $tocpage = false; - - /** - * @var If true convert vector images (SVG, EPS) to raster image using GD or ImageMagick library. - * @access protected - * @since 5.0.000 (2010-04-26) - */ - protected $rasterize_vector_images = false; - - /** - * @var If true enables font subsetting by default - * @access protected - * @since 5.3.002 (2010-06-07) - */ - protected $font_subsetting = true; - - /** - * @var Array of default graphic settings - * @access protected - * @since 5.5.008 (2010-07-02) - */ - protected $default_graphic_vars = array(); - - /** - * @var Array of XObjects - * @access protected - * @since 5.8.014 (2010-08-23) - */ - protected $xobjects = array(); - - /** - * @var boolean true when we are inside an XObject - * @access protected - * @since 5.8.017 (2010-08-24) - */ - protected $inxobj = false; - - /** - * @var current XObject ID - * @access protected - * @since 5.8.017 (2010-08-24) - */ - protected $xobjid = ''; - - /** - * @var percentage of character stretching - * @access protected - * @since 5.9.000 (2010-09-29) - */ - protected $font_stretching = 100; - - /** - * @var increases or decreases the space between characters in a text by the specified amount (tracking/kerning). - * @access protected - * @since 5.9.000 (2010-09-29) - */ - protected $font_spacing = 0; - - /** - * @var array of no-write regions - * ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right) - * @access protected - * @since 5.9.003 (2010-10-14) - */ - protected $page_regions = array(); - - /** - * @var array containing HTML color names and values - * @access protected - * @since 5.9.004 (2010-10-18) - */ - protected $webcolor = array(); - - /** - * @var directory used for the last SVG image - * @access protected - * @since 5.0.000 (2010-05-05) - */ - protected $svgdir = ''; - - /** - * @var Deafult unit of measure for SVG - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgunit = 'px'; - - /** - * @var array of SVG gradients - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svggradients = array(); - - /** - * @var ID of last SVG gradient - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svggradientid = 0; - - /** - * @var true when in SVG defs group - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgdefsmode = false; - - /** - * @var array of SVG defs - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgdefs = array(); - - /** - * @var true when in SVG clipPath tag - * @access protected - * @since 5.0.000 (2010-04-26) - */ - protected $svgclipmode = false; - - /** - * @var array of SVG clipPath commands - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgclippaths = array(); - - /** - * @var array of SVG clipPath tranformation matrix - * @access protected - * @since 5.8.022 (2010-08-31) - */ - protected $svgcliptm = array(); - - /** - * @var ID of last SVG clipPath - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgclipid = 0; - - /** - * @var svg text - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgtext = ''; - - /** - * @var svg text properties - * @access protected - * @since 5.8.013 (2010-08-23) - */ - protected $svgtextmode = array(); - - /** - * @var array of hinheritable SVG properties - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode'); - - /** - * @var array of SVG properties - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected $svgstyles = array(array( - 'alignment-baseline' => 'auto', - 'baseline-shift' => 'baseline', - 'clip' => 'auto', - 'clip-path' => 'none', - 'clip-rule' => 'nonzero', - 'color' => 'black', - 'color-interpolation' => 'sRGB', - 'color-interpolation-filters' => 'linearRGB', - 'color-profile' => 'auto', - 'color-rendering' => 'auto', - 'cursor' => 'auto', - 'direction' => 'ltr', - 'display' => 'inline', - 'dominant-baseline' => 'auto', - 'enable-background' => 'accumulate', - 'fill' => 'black', - 'fill-opacity' => 1, - 'fill-rule' => 'nonzero', - 'filter' => 'none', - 'flood-color' => 'black', - 'flood-opacity' => 1, - 'font' => '', - 'font-family' => 'helvetica', - 'font-size' => 'medium', - 'font-size-adjust' => 'none', - 'font-stretch' => 'normal', - 'font-style' => 'normal', - 'font-variant' => 'normal', - 'font-weight' => 'normal', - 'glyph-orientation-horizontal' => '0deg', - 'glyph-orientation-vertical' => 'auto', - 'image-rendering' => 'auto', - 'kerning' => 'auto', - 'letter-spacing' => 'normal', - 'lighting-color' => 'white', - 'marker' => '', - 'marker-end' => 'none', - 'marker-mid' => 'none', - 'marker-start' => 'none', - 'mask' => 'none', - 'opacity' => 1, - 'overflow' => 'auto', - 'pointer-events' => 'visiblePainted', - 'shape-rendering' => 'auto', - 'stop-color' => 'black', - 'stop-opacity' => 1, - 'stroke' => 'none', - 'stroke-dasharray' => 'none', - 'stroke-dashoffset' => 0, - 'stroke-linecap' => 'butt', - 'stroke-linejoin' => 'miter', - 'stroke-miterlimit' => 4, - 'stroke-opacity' => 1, - 'stroke-width' => 1, - 'text-anchor' => 'start', - 'text-decoration' => 'none', - 'text-rendering' => 'auto', - 'unicode-bidi' => 'normal', - 'visibility' => 'visible', - 'word-spacing' => 'normal', - 'writing-mode' => 'lr-tb', - 'text-color' => 'black', - 'transfmatrix' => array(1, 0, 0, 1, 0, 0) - )); - - //------------------------------------------------------------ - // METHODS - //------------------------------------------------------------ - - /** - * This is the class constructor. - * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes). - * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li><li>'' (empty string) for automatic orientation</li></ul> - * @param string $unit User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in: inch</li></ul><br />A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. - * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param boolean $unicode TRUE means that the input text is unicode (default = true) - * @param boolean $diskcache if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower). - * @param String $encoding charset encoding; default is UTF-8 - * @access public - * @see getPageSizeFromFormat(), setPageFormat() - */ - public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false) { - /* Set internal character encoding to ASCII */ - if (function_exists('mb_internal_encoding') AND mb_internal_encoding()) { - $this->internal_encoding = mb_internal_encoding(); - mb_internal_encoding('ASCII'); - } - require(dirname(__FILE__).'/htmlcolors.php'); - $this->webcolor = $webcolor; - require_once(dirname(__FILE__).'/unicode_data.php'); - $this->unicode = new TCPDF_UNICODE_DATA(); - $this->font_obj_ids = array(); - $this->page_obj_id = array(); - $this->form_obj_id = array(); - // set disk caching - $this->diskcache = $diskcache ? true : false; - // set language direction - $this->rtl = false; - $this->tmprtl = false; - // some checks - $this->_dochecks(); - // initialization of properties - $this->isunicode = $unicode; - $this->page = 0; - $this->transfmrk[0] = array(); - $this->pagedim = array(); - $this->n = 2; - $this->buffer = ''; - $this->pages = array(); - $this->state = 0; - $this->fonts = array(); - $this->FontFiles = array(); - $this->diffs = array(); - $this->images = array(); - $this->links = array(); - $this->gradients = array(); - $this->InFooter = false; - $this->lasth = 0; - $this->FontFamily = 'helvetica'; - $this->FontStyle = ''; - $this->FontSizePt = 12; - $this->underline = false; - $this->overline = false; - $this->linethrough = false; - $this->DrawColor = '0 G'; - $this->FillColor = '0 g'; - $this->TextColor = '0 g'; - $this->ColorFlag = false; - // encryption values - $this->encrypted = false; - $this->last_enc_key = ''; - // standard Unicode fonts - $this->CoreFonts = array( - 'courier'=>'Courier', - 'courierB'=>'Courier-Bold', - 'courierI'=>'Courier-Oblique', - 'courierBI'=>'Courier-BoldOblique', - 'helvetica'=>'Helvetica', - 'helveticaB'=>'Helvetica-Bold', - 'helveticaI'=>'Helvetica-Oblique', - 'helveticaBI'=>'Helvetica-BoldOblique', - 'times'=>'Times-Roman', - 'timesB'=>'Times-Bold', - 'timesI'=>'Times-Italic', - 'timesBI'=>'Times-BoldItalic', - 'symbol'=>'Symbol', - 'zapfdingbats'=>'ZapfDingbats' - ); - // set scale factor - $this->setPageUnit($unit); - // set page format and orientation - $this->setPageFormat($format, $orientation); - // page margins (1 cm) - $margin = 28.35 / $this->k; - $this->SetMargins($margin, $margin); - // internal cell padding - $cpadding = $margin / 10; - $this->setCellPaddings($cpadding, 0, $cpadding, 0); - // cell margins - $this->setCellMargins(0, 0, 0, 0); - // line width (0.2 mm) - $this->LineWidth = 0.57 / $this->k; - $this->linestyleWidth = sprintf('%.2F w', ($this->LineWidth * $this->k)); - $this->linestyleCap = '0 J'; - $this->linestyleJoin = '0 j'; - $this->linestyleDash = '[] 0 d'; - // automatic page break - $this->SetAutoPageBreak(true, (2 * $margin)); - // full width display mode - $this->SetDisplayMode('fullwidth'); - // compression - $this->SetCompression(true); - // set default PDF version number - $this->PDFVersion = '1.7'; - $this->encoding = $encoding; - $this->HREF = array(); - $this->getFontsList(); - $this->fgcolor = array('R' => 0, 'G' => 0, 'B' => 0); - $this->strokecolor = array('R' => 0, 'G' => 0, 'B' => 0); - $this->bgcolor = array('R' => 255, 'G' => 255, 'B' => 255); - $this->extgstates = array(); - // user's rights - $this->sign = false; - $this->ur['enabled'] = false; - $this->ur['document'] = '/FullSave'; - $this->ur['annots'] = '/Create/Delete/Modify/Copy/Import/Export'; - $this->ur['form'] = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate'; - $this->ur['signature'] = '/Modify'; - $this->ur['ef'] = '/Create/Delete/Modify/Import'; - $this->ur['formex'] = ''; - $this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0'); - // set default JPEG quality - $this->jpeg_quality = 75; - // initialize some settings - $this->utf8Bidi(array(''), ''); - // set default font - $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); - // check if PCRE Unicode support is enabled - if ($this->isunicode AND (@preg_match('/\pL/u', 'a') == 1)) { - // PCRE unicode support is turned ON - // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. - // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. - // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. - //$this->setSpacesRE('/[^\S\P{Z}\P{Lo}\xa0]/u'); - $this->setSpacesRE('/[^\S\P{Z}\xa0]/u'); - } else { - // PCRE unicode support is turned OFF - $this->setSpacesRE('/[^\S\xa0]/'); - } - $this->default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); - // set file ID for trailer - $this->file_id = md5($this->getRandomSeed('TCPDF'.$orientation.$unit.$format.$encoding)); - // get default graphic vars - $this->default_graphic_vars = $this->getGraphicVars(); - } - - /** - * Default destructor. - * @access public - * @since 1.53.0.TC016 - */ - public function __destruct() { - // restore internal encoding - if (isset($this->internal_encoding) AND !empty($this->internal_encoding)) { - mb_internal_encoding($this->internal_encoding); - } - // unset all class variables - $this->_destroy(true); - } - - /** - * Set the units of measure for the document. - * @param string $unit User measure unit. Possible values are:<ul><li>pt: point</li><li>mm: millimeter (default)</li><li>cm: centimeter</li><li>in: inch</li></ul><br />A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. - * @access public - * @since 3.0.015 (2008-06-06) - */ - public function setPageUnit($unit) { - $unit = strtolower($unit); - //Set scale factor - switch ($unit) { - // points - case 'px': - case 'pt': { - $this->k = 1; - break; - } - // millimeters - case 'mm': { - $this->k = $this->dpi / 25.4; - break; - } - // centimeters - case 'cm': { - $this->k = $this->dpi / 2.54; - break; - } - // inches - case 'in': { - $this->k = $this->dpi; - break; - } - // unsupported unit - default : { - $this->Error('Incorrect unit: '.$unit); - break; - } - } - $this->pdfunit = $unit; - if (isset($this->CurOrientation)) { - $this->setPageOrientation($this->CurOrientation); - } - } - - /** - * Get page dimensions from format name. - * @param mixed $format The format name. It can be: <ul> - * <li><b>ISO 216 A Series + 2 SIS 014711 extensions</b></li> - * <li>A0 (841x1189 mm ; 33.11x46.81 in)</li> - * <li>A1 (594x841 mm ; 23.39x33.11 in)</li> - * <li>A2 (420x594 mm ; 16.54x23.39 in)</li> - * <li>A3 (297x420 mm ; 11.69x16.54 in)</li> - * <li>A4 (210x297 mm ; 8.27x11.69 in)</li> - * <li>A5 (148x210 mm ; 5.83x8.27 in)</li> - * <li>A6 (105x148 mm ; 4.13x5.83 in)</li> - * <li>A7 (74x105 mm ; 2.91x4.13 in)</li> - * <li>A8 (52x74 mm ; 2.05x2.91 in)</li> - * <li>A9 (37x52 mm ; 1.46x2.05 in)</li> - * <li>A10 (26x37 mm ; 1.02x1.46 in)</li> - * <li>A11 (18x26 mm ; 0.71x1.02 in)</li> - * <li>A12 (13x18 mm ; 0.51x0.71 in)</li> - * <li><b>ISO 216 B Series + 2 SIS 014711 extensions</b></li> - * <li>B0 (1000x1414 mm ; 39.37x55.67 in)</li> - * <li>B1 (707x1000 mm ; 27.83x39.37 in)</li> - * <li>B2 (500x707 mm ; 19.69x27.83 in)</li> - * <li>B3 (353x500 mm ; 13.90x19.69 in)</li> - * <li>B4 (250x353 mm ; 9.84x13.90 in)</li> - * <li>B5 (176x250 mm ; 6.93x9.84 in)</li> - * <li>B6 (125x176 mm ; 4.92x6.93 in)</li> - * <li>B7 (88x125 mm ; 3.46x4.92 in)</li> - * <li>B8 (62x88 mm ; 2.44x3.46 in)</li> - * <li>B9 (44x62 mm ; 1.73x2.44 in)</li> - * <li>B10 (31x44 mm ; 1.22x1.73 in)</li> - * <li>B11 (22x31 mm ; 0.87x1.22 in)</li> - * <li>B12 (15x22 mm ; 0.59x0.87 in)</li> - * <li><b>ISO 216 C Series + 2 SIS 014711 extensions + 2 EXTENSION</b></li> - * <li>C0 (917x1297 mm ; 36.10x51.06 in)</li> - * <li>C1 (648x917 mm ; 25.51x36.10 in)</li> - * <li>C2 (458x648 mm ; 18.03x25.51 in)</li> - * <li>C3 (324x458 mm ; 12.76x18.03 in)</li> - * <li>C4 (229x324 mm ; 9.02x12.76 in)</li> - * <li>C5 (162x229 mm ; 6.38x9.02 in)</li> - * <li>C6 (114x162 mm ; 4.49x6.38 in)</li> - * <li>C7 (81x114 mm ; 3.19x4.49 in)</li> - * <li>C8 (57x81 mm ; 2.24x3.19 in)</li> - * <li>C9 (40x57 mm ; 1.57x2.24 in)</li> - * <li>C10 (28x40 mm ; 1.10x1.57 in)</li> - * <li>C11 (20x28 mm ; 0.79x1.10 in)</li> - * <li>C12 (14x20 mm ; 0.55x0.79 in)</li> - * <li>C76 (81x162 mm ; 3.19x6.38 in)</li> - * <li>DL (110x220 mm ; 4.33x8.66 in)</li> - * <li><b>SIS 014711 E Series</b></li> - * <li>E0 (879x1241 mm ; 34.61x48.86 in)</li> - * <li>E1 (620x879 mm ; 24.41x34.61 in)</li> - * <li>E2 (440x620 mm ; 17.32x24.41 in)</li> - * <li>E3 (310x440 mm ; 12.20x17.32 in)</li> - * <li>E4 (220x310 mm ; 8.66x12.20 in)</li> - * <li>E5 (155x220 mm ; 6.10x8.66 in)</li> - * <li>E6 (110x155 mm ; 4.33x6.10 in)</li> - * <li>E7 (78x110 mm ; 3.07x4.33 in)</li> - * <li>E8 (55x78 mm ; 2.17x3.07 in)</li> - * <li>E9 (39x55 mm ; 1.54x2.17 in)</li> - * <li>E10 (27x39 mm ; 1.06x1.54 in)</li> - * <li>E11 (19x27 mm ; 0.75x1.06 in)</li> - * <li>E12 (13x19 mm ; 0.51x0.75 in)</li> - * <li><b>SIS 014711 G Series</b></li> - * <li>G0 (958x1354 mm ; 37.72x53.31 in)</li> - * <li>G1 (677x958 mm ; 26.65x37.72 in)</li> - * <li>G2 (479x677 mm ; 18.86x26.65 in)</li> - * <li>G3 (338x479 mm ; 13.31x18.86 in)</li> - * <li>G4 (239x338 mm ; 9.41x13.31 in)</li> - * <li>G5 (169x239 mm ; 6.65x9.41 in)</li> - * <li>G6 (119x169 mm ; 4.69x6.65 in)</li> - * <li>G7 (84x119 mm ; 3.31x4.69 in)</li> - * <li>G8 (59x84 mm ; 2.32x3.31 in)</li> - * <li>G9 (42x59 mm ; 1.65x2.32 in)</li> - * <li>G10 (29x42 mm ; 1.14x1.65 in)</li> - * <li>G11 (21x29 mm ; 0.83x1.14 in)</li> - * <li>G12 (14x21 mm ; 0.55x0.83 in)</li> - * <li><b>ISO Press</b></li> - * <li>RA0 (860x1220 mm ; 33.86x48.03 in)</li> - * <li>RA1 (610x860 mm ; 24.02x33.86 in)</li> - * <li>RA2 (430x610 mm ; 16.93x24.02 in)</li> - * <li>RA3 (305x430 mm ; 12.01x16.93 in)</li> - * <li>RA4 (215x305 mm ; 8.46x12.01 in)</li> - * <li>SRA0 (900x1280 mm ; 35.43x50.39 in)</li> - * <li>SRA1 (640x900 mm ; 25.20x35.43 in)</li> - * <li>SRA2 (450x640 mm ; 17.72x25.20 in)</li> - * <li>SRA3 (320x450 mm ; 12.60x17.72 in)</li> - * <li>SRA4 (225x320 mm ; 8.86x12.60 in)</li> - * <li><b>German DIN 476</b></li> - * <li>4A0 (1682x2378 mm ; 66.22x93.62 in)</li> - * <li>2A0 (1189x1682 mm ; 46.81x66.22 in)</li> - * <li><b>Variations on the ISO Standard</b></li> - * <li>A2_EXTRA (445x619 mm ; 17.52x24.37 in)</li> - * <li>A3+ (329x483 mm ; 12.95x19.02 in)</li> - * <li>A3_EXTRA (322x445 mm ; 12.68x17.52 in)</li> - * <li>A3_SUPER (305x508 mm ; 12.01x20.00 in)</li> - * <li>SUPER_A3 (305x487 mm ; 12.01x19.17 in)</li> - * <li>A4_EXTRA (235x322 mm ; 9.25x12.68 in)</li> - * <li>A4_SUPER (229x322 mm ; 9.02x12.68 in)</li> - * <li>SUPER_A4 (227x356 mm ; 8.94x14.02 in)</li> - * <li>A4_LONG (210x348 mm ; 8.27x13.70 in)</li> - * <li>F4 (210x330 mm ; 8.27x12.99 in)</li> - * <li>SO_B5_EXTRA (202x276 mm ; 7.95x10.87 in)</li> - * <li>A5_EXTRA (173x235 mm ; 6.81x9.25 in)</li> - * <li><b>ANSI Series</b></li> - * <li>ANSI_E (864x1118 mm ; 34.00x44.00 in)</li> - * <li>ANSI_D (559x864 mm ; 22.00x34.00 in)</li> - * <li>ANSI_C (432x559 mm ; 17.00x22.00 in)</li> - * <li>ANSI_B (279x432 mm ; 11.00x17.00 in)</li> - * <li>ANSI_A (216x279 mm ; 8.50x11.00 in)</li> - * <li><b>Traditional 'Loose' North American Paper Sizes</b></li> - * <li>LEDGER, USLEDGER (432x279 mm ; 17.00x11.00 in)</li> - * <li>TABLOID, USTABLOID, BIBLE, ORGANIZERK (279x432 mm ; 11.00x17.00 in)</li> - * <li>LETTER, USLETTER, ORGANIZERM (216x279 mm ; 8.50x11.00 in)</li> - * <li>LEGAL, USLEGAL (216x356 mm ; 8.50x14.00 in)</li> - * <li>GLETTER, GOVERNMENTLETTER (203x267 mm ; 8.00x10.50 in)</li> - * <li>JLEGAL, JUNIORLEGAL (203x127 mm ; 8.00x5.00 in)</li> - * <li><b>Other North American Paper Sizes</b></li> - * <li>QUADDEMY (889x1143 mm ; 35.00x45.00 in)</li> - * <li>SUPER_B (330x483 mm ; 13.00x19.00 in)</li> - * <li>QUARTO (229x279 mm ; 9.00x11.00 in)</li> - * <li>FOLIO, GOVERNMENTLEGAL (216x330 mm ; 8.50x13.00 in)</li> - * <li>EXECUTIVE, MONARCH (184x267 mm ; 7.25x10.50 in)</li> - * <li>MEMO, STATEMENT, ORGANIZERL (140x216 mm ; 5.50x8.50 in)</li> - * <li>FOOLSCAP (210x330 mm ; 8.27x13.00 in)</li> - * <li>COMPACT (108x171 mm ; 4.25x6.75 in)</li> - * <li>ORGANIZERJ (70x127 mm ; 2.75x5.00 in)</li> - * <li><b>Canadian standard CAN 2-9.60M</b></li> - * <li>P1 (560x860 mm ; 22.05x33.86 in)</li> - * <li>P2 (430x560 mm ; 16.93x22.05 in)</li> - * <li>P3 (280x430 mm ; 11.02x16.93 in)</li> - * <li>P4 (215x280 mm ; 8.46x11.02 in)</li> - * <li>P5 (140x215 mm ; 5.51x8.46 in)</li> - * <li>P6 (107x140 mm ; 4.21x5.51 in)</li> - * <li><b>North American Architectural Sizes</b></li> - * <li>ARCH_E (914x1219 mm ; 36.00x48.00 in)</li> - * <li>ARCH_E1 (762x1067 mm ; 30.00x42.00 in)</li> - * <li>ARCH_D (610x914 mm ; 24.00x36.00 in)</li> - * <li>ARCH_C, BROADSHEET (457x610 mm ; 18.00x24.00 in)</li> - * <li>ARCH_B (305x457 mm ; 12.00x18.00 in)</li> - * <li>ARCH_A (229x305 mm ; 9.00x12.00 in)</li> - * <li><b>Announcement Envelopes</b></li> - * <li>ANNENV_A2 (111x146 mm ; 4.37x5.75 in)</li> - * <li>ANNENV_A6 (121x165 mm ; 4.75x6.50 in)</li> - * <li>ANNENV_A7 (133x184 mm ; 5.25x7.25 in)</li> - * <li>ANNENV_A8 (140x206 mm ; 5.50x8.12 in)</li> - * <li>ANNENV_A10 (159x244 mm ; 6.25x9.62 in)</li> - * <li>ANNENV_SLIM (98x225 mm ; 3.87x8.87 in)</li> - * <li><b>Commercial Envelopes</b></li> - * <li>COMMENV_N6_1/4 (89x152 mm ; 3.50x6.00 in)</li> - * <li>COMMENV_N6_3/4 (92x165 mm ; 3.62x6.50 in)</li> - * <li>COMMENV_N8 (98x191 mm ; 3.87x7.50 in)</li> - * <li>COMMENV_N9 (98x225 mm ; 3.87x8.87 in)</li> - * <li>COMMENV_N10 (105x241 mm ; 4.12x9.50 in)</li> - * <li>COMMENV_N11 (114x263 mm ; 4.50x10.37 in)</li> - * <li>COMMENV_N12 (121x279 mm ; 4.75x11.00 in)</li> - * <li>COMMENV_N14 (127x292 mm ; 5.00x11.50 in)</li> - * <li><b>Catalogue Envelopes</b></li> - * <li>CATENV_N1 (152x229 mm ; 6.00x9.00 in)</li> - * <li>CATENV_N1_3/4 (165x241 mm ; 6.50x9.50 in)</li> - * <li>CATENV_N2 (165x254 mm ; 6.50x10.00 in)</li> - * <li>CATENV_N3 (178x254 mm ; 7.00x10.00 in)</li> - * <li>CATENV_N6 (191x267 mm ; 7.50x10.50 in)</li> - * <li>CATENV_N7 (203x279 mm ; 8.00x11.00 in)</li> - * <li>CATENV_N8 (210x286 mm ; 8.25x11.25 in)</li> - * <li>CATENV_N9_1/2 (216x267 mm ; 8.50x10.50 in)</li> - * <li>CATENV_N9_3/4 (222x286 mm ; 8.75x11.25 in)</li> - * <li>CATENV_N10_1/2 (229x305 mm ; 9.00x12.00 in)</li> - * <li>CATENV_N12_1/2 (241x318 mm ; 9.50x12.50 in)</li> - * <li>CATENV_N13_1/2 (254x330 mm ; 10.00x13.00 in)</li> - * <li>CATENV_N14_1/4 (286x311 mm ; 11.25x12.25 in)</li> - * <li>CATENV_N14_1/2 (292x368 mm ; 11.50x14.50 in)</li> - * <li><b>Japanese (JIS P 0138-61) Standard B-Series</b></li> - * <li>JIS_B0 (1030x1456 mm ; 40.55x57.32 in)</li> - * <li>JIS_B1 (728x1030 mm ; 28.66x40.55 in)</li> - * <li>JIS_B2 (515x728 mm ; 20.28x28.66 in)</li> - * <li>JIS_B3 (364x515 mm ; 14.33x20.28 in)</li> - * <li>JIS_B4 (257x364 mm ; 10.12x14.33 in)</li> - * <li>JIS_B5 (182x257 mm ; 7.17x10.12 in)</li> - * <li>JIS_B6 (128x182 mm ; 5.04x7.17 in)</li> - * <li>JIS_B7 (91x128 mm ; 3.58x5.04 in)</li> - * <li>JIS_B8 (64x91 mm ; 2.52x3.58 in)</li> - * <li>JIS_B9 (45x64 mm ; 1.77x2.52 in)</li> - * <li>JIS_B10 (32x45 mm ; 1.26x1.77 in)</li> - * <li>JIS_B11 (22x32 mm ; 0.87x1.26 in)</li> - * <li>JIS_B12 (16x22 mm ; 0.63x0.87 in)</li> - * <li><b>PA Series</b></li> - * <li>PA0 (840x1120 mm ; 33.07x44.09 in)</li> - * <li>PA1 (560x840 mm ; 22.05x33.07 in)</li> - * <li>PA2 (420x560 mm ; 16.54x22.05 in)</li> - * <li>PA3 (280x420 mm ; 11.02x16.54 in)</li> - * <li>PA4 (210x280 mm ; 8.27x11.02 in)</li> - * <li>PA5 (140x210 mm ; 5.51x8.27 in)</li> - * <li>PA6 (105x140 mm ; 4.13x5.51 in)</li> - * <li>PA7 (70x105 mm ; 2.76x4.13 in)</li> - * <li>PA8 (52x70 mm ; 2.05x2.76 in)</li> - * <li>PA9 (35x52 mm ; 1.38x2.05 in)</li> - * <li>PA10 (26x35 mm ; 1.02x1.38 in)</li> - * <li><b>Standard Photographic Print Sizes</b></li> - * <li>PASSPORT_PHOTO (35x45 mm ; 1.38x1.77 in)</li> - * <li>E (82x120 mm ; 3.25x4.72 in)</li> - * <li>3R, L (89x127 mm ; 3.50x5.00 in)</li> - * <li>4R, KG (102x152 mm ; 4.02x5.98 in)</li> - * <li>4D (120x152 mm ; 4.72x5.98 in)</li> - * <li>5R, 2L (127x178 mm ; 5.00x7.01 in)</li> - * <li>6R, 8P (152x203 mm ; 5.98x7.99 in)</li> - * <li>8R, 6P (203x254 mm ; 7.99x10.00 in)</li> - * <li>S8R, 6PW (203x305 mm ; 7.99x12.01 in)</li> - * <li>10R, 4P (254x305 mm ; 10.00x12.01 in)</li> - * <li>S10R, 4PW (254x381 mm ; 10.00x15.00 in)</li> - * <li>11R (279x356 mm ; 10.98x14.02 in)</li> - * <li>S11R (279x432 mm ; 10.98x17.01 in)</li> - * <li>12R (305x381 mm ; 12.01x15.00 in)</li> - * <li>S12R (305x456 mm ; 12.01x17.95 in)</li> - * <li><b>Common Newspaper Sizes</b></li> - * <li>NEWSPAPER_BROADSHEET (750x600 mm ; 29.53x23.62 in)</li> - * <li>NEWSPAPER_BERLINER (470x315 mm ; 18.50x12.40 in)</li> - * <li>NEWSPAPER_COMPACT, NEWSPAPER_TABLOID (430x280 mm ; 16.93x11.02 in)</li> - * <li><b>Business Cards</b></li> - * <li>CREDIT_CARD, BUSINESS_CARD, BUSINESS_CARD_ISO7810 (54x86 mm ; 2.13x3.37 in)</li> - * <li>BUSINESS_CARD_ISO216 (52x74 mm ; 2.05x2.91 in)</li> - * <li>BUSINESS_CARD_IT, BUSINESS_CARD_UK, BUSINESS_CARD_FR, BUSINESS_CARD_DE, BUSINESS_CARD_ES (55x85 mm ; 2.17x3.35 in)</li> - * <li>BUSINESS_CARD_US, BUSINESS_CARD_CA (51x89 mm ; 2.01x3.50 in)</li> - * <li>BUSINESS_CARD_JP (55x91 mm ; 2.17x3.58 in)</li> - * <li>BUSINESS_CARD_HK (54x90 mm ; 2.13x3.54 in)</li> - * <li>BUSINESS_CARD_AU, BUSINESS_CARD_DK, BUSINESS_CARD_SE (55x90 mm ; 2.17x3.54 in)</li> - * <li>BUSINESS_CARD_RU, BUSINESS_CARD_CZ, BUSINESS_CARD_FI, BUSINESS_CARD_HU, BUSINESS_CARD_IL (50x90 mm ; 1.97x3.54 in)</li> - * <li><b>Billboards</b></li> - * <li>4SHEET (1016x1524 mm ; 40.00x60.00 in)</li> - * <li>6SHEET (1200x1800 mm ; 47.24x70.87 in)</li> - * <li>12SHEET (3048x1524 mm ; 120.00x60.00 in)</li> - * <li>16SHEET (2032x3048 mm ; 80.00x120.00 in)</li> - * <li>32SHEET (4064x3048 mm ; 160.00x120.00 in)</li> - * <li>48SHEET (6096x3048 mm ; 240.00x120.00 in)</li> - * <li>64SHEET (8128x3048 mm ; 320.00x120.00 in)</li> - * <li>96SHEET (12192x3048 mm ; 480.00x120.00 in)</li> - * <li><b>Old Imperial English (some are still used in USA)</b></li> - * <li>EN_EMPEROR (1219x1829 mm ; 48.00x72.00 in)</li> - * <li>EN_ANTIQUARIAN (787x1346 mm ; 31.00x53.00 in)</li> - * <li>EN_GRAND_EAGLE (730x1067 mm ; 28.75x42.00 in)</li> - * <li>EN_DOUBLE_ELEPHANT (679x1016 mm ; 26.75x40.00 in)</li> - * <li>EN_ATLAS (660x864 mm ; 26.00x34.00 in)</li> - * <li>EN_COLOMBIER (597x876 mm ; 23.50x34.50 in)</li> - * <li>EN_ELEPHANT (584x711 mm ; 23.00x28.00 in)</li> - * <li>EN_DOUBLE_DEMY (572x902 mm ; 22.50x35.50 in)</li> - * <li>EN_IMPERIAL (559x762 mm ; 22.00x30.00 in)</li> - * <li>EN_PRINCESS (546x711 mm ; 21.50x28.00 in)</li> - * <li>EN_CARTRIDGE (533x660 mm ; 21.00x26.00 in)</li> - * <li>EN_DOUBLE_LARGE_POST (533x838 mm ; 21.00x33.00 in)</li> - * <li>EN_ROYAL (508x635 mm ; 20.00x25.00 in)</li> - * <li>EN_SHEET, EN_HALF_POST (495x597 mm ; 19.50x23.50 in)</li> - * <li>EN_SUPER_ROYAL (483x686 mm ; 19.00x27.00 in)</li> - * <li>EN_DOUBLE_POST (483x775 mm ; 19.00x30.50 in)</li> - * <li>EN_MEDIUM (445x584 mm ; 17.50x23.00 in)</li> - * <li>EN_DEMY (445x572 mm ; 17.50x22.50 in)</li> - * <li>EN_LARGE_POST (419x533 mm ; 16.50x21.00 in)</li> - * <li>EN_COPY_DRAUGHT (406x508 mm ; 16.00x20.00 in)</li> - * <li>EN_POST (394x489 mm ; 15.50x19.25 in)</li> - * <li>EN_CROWN (381x508 mm ; 15.00x20.00 in)</li> - * <li>EN_PINCHED_POST (375x470 mm ; 14.75x18.50 in)</li> - * <li>EN_BRIEF (343x406 mm ; 13.50x16.00 in)</li> - * <li>EN_FOOLSCAP (343x432 mm ; 13.50x17.00 in)</li> - * <li>EN_SMALL_FOOLSCAP (337x419 mm ; 13.25x16.50 in)</li> - * <li>EN_POTT (318x381 mm ; 12.50x15.00 in)</li> - * <li><b>Old Imperial Belgian</b></li> - * <li>BE_GRAND_AIGLE (700x1040 mm ; 27.56x40.94 in)</li> - * <li>BE_COLOMBIER (620x850 mm ; 24.41x33.46 in)</li> - * <li>BE_DOUBLE_CARRE (620x920 mm ; 24.41x36.22 in)</li> - * <li>BE_ELEPHANT (616x770 mm ; 24.25x30.31 in)</li> - * <li>BE_PETIT_AIGLE (600x840 mm ; 23.62x33.07 in)</li> - * <li>BE_GRAND_JESUS (550x730 mm ; 21.65x28.74 in)</li> - * <li>BE_JESUS (540x730 mm ; 21.26x28.74 in)</li> - * <li>BE_RAISIN (500x650 mm ; 19.69x25.59 in)</li> - * <li>BE_GRAND_MEDIAN (460x605 mm ; 18.11x23.82 in)</li> - * <li>BE_DOUBLE_POSTE (435x565 mm ; 17.13x22.24 in)</li> - * <li>BE_COQUILLE (430x560 mm ; 16.93x22.05 in)</li> - * <li>BE_PETIT_MEDIAN (415x530 mm ; 16.34x20.87 in)</li> - * <li>BE_RUCHE (360x460 mm ; 14.17x18.11 in)</li> - * <li>BE_PROPATRIA (345x430 mm ; 13.58x16.93 in)</li> - * <li>BE_LYS (317x397 mm ; 12.48x15.63 in)</li> - * <li>BE_POT (307x384 mm ; 12.09x15.12 in)</li> - * <li>BE_ROSETTE (270x347 mm ; 10.63x13.66 in)</li> - * <li><b>Old Imperial French</b></li> - * <li>FR_UNIVERS (1000x1300 mm ; 39.37x51.18 in)</li> - * <li>FR_DOUBLE_COLOMBIER (900x1260 mm ; 35.43x49.61 in)</li> - * <li>FR_GRANDE_MONDE (900x1260 mm ; 35.43x49.61 in)</li> - * <li>FR_DOUBLE_SOLEIL (800x1200 mm ; 31.50x47.24 in)</li> - * <li>FR_DOUBLE_JESUS (760x1120 mm ; 29.92x44.09 in)</li> - * <li>FR_GRAND_AIGLE (750x1060 mm ; 29.53x41.73 in)</li> - * <li>FR_PETIT_AIGLE (700x940 mm ; 27.56x37.01 in)</li> - * <li>FR_DOUBLE_RAISIN (650x1000 mm ; 25.59x39.37 in)</li> - * <li>FR_JOURNAL (650x940 mm ; 25.59x37.01 in)</li> - * <li>FR_COLOMBIER_AFFICHE (630x900 mm ; 24.80x35.43 in)</li> - * <li>FR_DOUBLE_CAVALIER (620x920 mm ; 24.41x36.22 in)</li> - * <li>FR_CLOCHE (600x800 mm ; 23.62x31.50 in)</li> - * <li>FR_SOLEIL (600x800 mm ; 23.62x31.50 in)</li> - * <li>FR_DOUBLE_CARRE (560x900 mm ; 22.05x35.43 in)</li> - * <li>FR_DOUBLE_COQUILLE (560x880 mm ; 22.05x34.65 in)</li> - * <li>FR_JESUS (560x760 mm ; 22.05x29.92 in)</li> - * <li>FR_RAISIN (500x650 mm ; 19.69x25.59 in)</li> - * <li>FR_CAVALIER (460x620 mm ; 18.11x24.41 in)</li> - * <li>FR_DOUBLE_COURONNE (460x720 mm ; 18.11x28.35 in)</li> - * <li>FR_CARRE (450x560 mm ; 17.72x22.05 in)</li> - * <li>FR_COQUILLE (440x560 mm ; 17.32x22.05 in)</li> - * <li>FR_DOUBLE_TELLIERE (440x680 mm ; 17.32x26.77 in)</li> - * <li>FR_DOUBLE_CLOCHE (400x600 mm ; 15.75x23.62 in)</li> - * <li>FR_DOUBLE_POT (400x620 mm ; 15.75x24.41 in)</li> - * <li>FR_ECU (400x520 mm ; 15.75x20.47 in)</li> - * <li>FR_COURONNE (360x460 mm ; 14.17x18.11 in)</li> - * <li>FR_TELLIERE (340x440 mm ; 13.39x17.32 in)</li> - * <li>FR_POT (310x400 mm ; 12.20x15.75 in)</li> - * </ul> - * @return array containing page width and height in points - * @access public - * @since 5.0.010 (2010-05-17) - */ - public function getPageSizeFromFormat($format) { - // Paper cordinates are calculated in this way: (inches * 72) where (1 inch = 25.4 mm) - switch (strtoupper($format)) { - // ISO 216 A Series + 2 SIS 014711 extensions - case 'A0' : {$pf = array( 2383.937, 3370.394); break;} - case 'A1' : {$pf = array( 1683.780, 2383.937); break;} - case 'A2' : {$pf = array( 1190.551, 1683.780); break;} - case 'A3' : {$pf = array( 841.890, 1190.551); break;} - case 'A4' : {$pf = array( 595.276, 841.890); break;} - case 'A5' : {$pf = array( 419.528, 595.276); break;} - case 'A6' : {$pf = array( 297.638, 419.528); break;} - case 'A7' : {$pf = array( 209.764, 297.638); break;} - case 'A8' : {$pf = array( 147.402, 209.764); break;} - case 'A9' : {$pf = array( 104.882, 147.402); break;} - case 'A10': {$pf = array( 73.701, 104.882); break;} - case 'A11': {$pf = array( 51.024, 73.701); break;} - case 'A12': {$pf = array( 36.850, 51.024); break;} - // ISO 216 B Series + 2 SIS 014711 extensions - case 'B0' : {$pf = array( 2834.646, 4008.189); break;} - case 'B1' : {$pf = array( 2004.094, 2834.646); break;} - case 'B2' : {$pf = array( 1417.323, 2004.094); break;} - case 'B3' : {$pf = array( 1000.630, 1417.323); break;} - case 'B4' : {$pf = array( 708.661, 1000.630); break;} - case 'B5' : {$pf = array( 498.898, 708.661); break;} - case 'B6' : {$pf = array( 354.331, 498.898); break;} - case 'B7' : {$pf = array( 249.449, 354.331); break;} - case 'B8' : {$pf = array( 175.748, 249.449); break;} - case 'B9' : {$pf = array( 124.724, 175.748); break;} - case 'B10': {$pf = array( 87.874, 124.724); break;} - case 'B11': {$pf = array( 62.362, 87.874); break;} - case 'B12': {$pf = array( 42.520, 62.362); break;} - // ISO 216 C Series + 2 SIS 014711 extensions + 2 EXTENSION - case 'C0' : {$pf = array( 2599.370, 3676.535); break;} - case 'C1' : {$pf = array( 1836.850, 2599.370); break;} - case 'C2' : {$pf = array( 1298.268, 1836.850); break;} - case 'C3' : {$pf = array( 918.425, 1298.268); break;} - case 'C4' : {$pf = array( 649.134, 918.425); break;} - case 'C5' : {$pf = array( 459.213, 649.134); break;} - case 'C6' : {$pf = array( 323.150, 459.213); break;} - case 'C7' : {$pf = array( 229.606, 323.150); break;} - case 'C8' : {$pf = array( 161.575, 229.606); break;} - case 'C9' : {$pf = array( 113.386, 161.575); break;} - case 'C10': {$pf = array( 79.370, 113.386); break;} - case 'C11': {$pf = array( 56.693, 79.370); break;} - case 'C12': {$pf = array( 39.685, 56.693); break;} - case 'C76': {$pf = array( 229.606, 459.213); break;} - case 'DL' : {$pf = array( 311.811, 623.622); break;} - // SIS 014711 E Series - case 'E0' : {$pf = array( 2491.654, 3517.795); break;} - case 'E1' : {$pf = array( 1757.480, 2491.654); break;} - case 'E2' : {$pf = array( 1247.244, 1757.480); break;} - case 'E3' : {$pf = array( 878.740, 1247.244); break;} - case 'E4' : {$pf = array( 623.622, 878.740); break;} - case 'E5' : {$pf = array( 439.370, 623.622); break;} - case 'E6' : {$pf = array( 311.811, 439.370); break;} - case 'E7' : {$pf = array( 221.102, 311.811); break;} - case 'E8' : {$pf = array( 155.906, 221.102); break;} - case 'E9' : {$pf = array( 110.551, 155.906); break;} - case 'E10': {$pf = array( 76.535, 110.551); break;} - case 'E11': {$pf = array( 53.858, 76.535); break;} - case 'E12': {$pf = array( 36.850, 53.858); break;} - // SIS 014711 G Series - case 'G0' : {$pf = array( 2715.591, 3838.110); break;} - case 'G1' : {$pf = array( 1919.055, 2715.591); break;} - case 'G2' : {$pf = array( 1357.795, 1919.055); break;} - case 'G3' : {$pf = array( 958.110, 1357.795); break;} - case 'G4' : {$pf = array( 677.480, 958.110); break;} - case 'G5' : {$pf = array( 479.055, 677.480); break;} - case 'G6' : {$pf = array( 337.323, 479.055); break;} - case 'G7' : {$pf = array( 238.110, 337.323); break;} - case 'G8' : {$pf = array( 167.244, 238.110); break;} - case 'G9' : {$pf = array( 119.055, 167.244); break;} - case 'G10': {$pf = array( 82.205, 119.055); break;} - case 'G11': {$pf = array( 59.528, 82.205); break;} - case 'G12': {$pf = array( 39.685, 59.528); break;} - // ISO Press - case 'RA0': {$pf = array( 2437.795, 3458.268); break;} - case 'RA1': {$pf = array( 1729.134, 2437.795); break;} - case 'RA2': {$pf = array( 1218.898, 1729.134); break;} - case 'RA3': {$pf = array( 864.567, 1218.898); break;} - case 'RA4': {$pf = array( 609.449, 864.567); break;} - case 'SRA0': {$pf = array( 2551.181, 3628.346); break;} - case 'SRA1': {$pf = array( 1814.173, 2551.181); break;} - case 'SRA2': {$pf = array( 1275.591, 1814.173); break;} - case 'SRA3': {$pf = array( 907.087, 1275.591); break;} - case 'SRA4': {$pf = array( 637.795, 907.087); break;} - // German DIN 476 - case '4A0': {$pf = array( 4767.874, 6740.787); break;} - case '2A0': {$pf = array( 3370.394, 4767.874); break;} - // Variations on the ISO Standard - case 'A2_EXTRA' : {$pf = array( 1261.417, 1754.646); break;} - case 'A3+' : {$pf = array( 932.598, 1369.134); break;} - case 'A3_EXTRA' : {$pf = array( 912.756, 1261.417); break;} - case 'A3_SUPER' : {$pf = array( 864.567, 1440.000); break;} - case 'SUPER_A3' : {$pf = array( 864.567, 1380.472); break;} - case 'A4_EXTRA' : {$pf = array( 666.142, 912.756); break;} - case 'A4_SUPER' : {$pf = array( 649.134, 912.756); break;} - case 'SUPER_A4' : {$pf = array( 643.465, 1009.134); break;} - case 'A4_LONG' : {$pf = array( 595.276, 986.457); break;} - case 'F4' : {$pf = array( 595.276, 935.433); break;} - case 'SO_B5_EXTRA': {$pf = array( 572.598, 782.362); break;} - case 'A5_EXTRA' : {$pf = array( 490.394, 666.142); break;} - // ANSI Series - case 'ANSI_E': {$pf = array( 2448.000, 3168.000); break;} - case 'ANSI_D': {$pf = array( 1584.000, 2448.000); break;} - case 'ANSI_C': {$pf = array( 1224.000, 1584.000); break;} - case 'ANSI_B': {$pf = array( 792.000, 1224.000); break;} - case 'ANSI_A': {$pf = array( 612.000, 792.000); break;} - // Traditional 'Loose' North American Paper Sizes - case 'USLEDGER': - case 'LEDGER' : {$pf = array( 1224.000, 792.000); break;} - case 'ORGANIZERK': - case 'BIBLE': - case 'USTABLOID': - case 'TABLOID': {$pf = array( 792.000, 1224.000); break;} - case 'ORGANIZERM': - case 'USLETTER': - case 'LETTER' : {$pf = array( 612.000, 792.000); break;} - case 'USLEGAL': - case 'LEGAL' : {$pf = array( 612.000, 1008.000); break;} - case 'GOVERNMENTLETTER': - case 'GLETTER': {$pf = array( 576.000, 756.000); break;} - case 'JUNIORLEGAL': - case 'JLEGAL' : {$pf = array( 576.000, 360.000); break;} - // Other North American Paper Sizes - case 'QUADDEMY': {$pf = array( 2520.000, 3240.000); break;} - case 'SUPER_B': {$pf = array( 936.000, 1368.000); break;} - case 'QUARTO': {$pf = array( 648.000, 792.000); break;} - case 'GOVERNMENTLEGAL': - case 'FOLIO': {$pf = array( 612.000, 936.000); break;} - case 'MONARCH': - case 'EXECUTIVE': {$pf = array( 522.000, 756.000); break;} - case 'ORGANIZERL': - case 'STATEMENT': - case 'MEMO': {$pf = array( 396.000, 612.000); break;} - case 'FOOLSCAP': {$pf = array( 595.440, 936.000); break;} - case 'COMPACT': {$pf = array( 306.000, 486.000); break;} - case 'ORGANIZERJ': {$pf = array( 198.000, 360.000); break;} - // Canadian standard CAN 2-9.60M - case 'P1': {$pf = array( 1587.402, 2437.795); break;} - case 'P2': {$pf = array( 1218.898, 1587.402); break;} - case 'P3': {$pf = array( 793.701, 1218.898); break;} - case 'P4': {$pf = array( 609.449, 793.701); break;} - case 'P5': {$pf = array( 396.850, 609.449); break;} - case 'P6': {$pf = array( 303.307, 396.850); break;} - // North American Architectural Sizes - case 'ARCH_E' : {$pf = array( 2592.000, 3456.000); break;} - case 'ARCH_E1': {$pf = array( 2160.000, 3024.000); break;} - case 'ARCH_D' : {$pf = array( 1728.000, 2592.000); break;} - case 'BROADSHEET': - case 'ARCH_C' : {$pf = array( 1296.000, 1728.000); break;} - case 'ARCH_B' : {$pf = array( 864.000, 1296.000); break;} - case 'ARCH_A' : {$pf = array( 648.000, 864.000); break;} - // --- North American Envelope Sizes --- - // - Announcement Envelopes - case 'ANNENV_A2' : {$pf = array( 314.640, 414.000); break;} - case 'ANNENV_A6' : {$pf = array( 342.000, 468.000); break;} - case 'ANNENV_A7' : {$pf = array( 378.000, 522.000); break;} - case 'ANNENV_A8' : {$pf = array( 396.000, 584.640); break;} - case 'ANNENV_A10' : {$pf = array( 450.000, 692.640); break;} - case 'ANNENV_SLIM': {$pf = array( 278.640, 638.640); break;} - // - Commercial Envelopes - case 'COMMENV_N6_1/4': {$pf = array( 252.000, 432.000); break;} - case 'COMMENV_N6_3/4': {$pf = array( 260.640, 468.000); break;} - case 'COMMENV_N8' : {$pf = array( 278.640, 540.000); break;} - case 'COMMENV_N9' : {$pf = array( 278.640, 638.640); break;} - case 'COMMENV_N10' : {$pf = array( 296.640, 684.000); break;} - case 'COMMENV_N11' : {$pf = array( 324.000, 746.640); break;} - case 'COMMENV_N12' : {$pf = array( 342.000, 792.000); break;} - case 'COMMENV_N14' : {$pf = array( 360.000, 828.000); break;} - // - Catalogue Envelopes - case 'CATENV_N1' : {$pf = array( 432.000, 648.000); break;} - case 'CATENV_N1_3/4' : {$pf = array( 468.000, 684.000); break;} - case 'CATENV_N2' : {$pf = array( 468.000, 720.000); break;} - case 'CATENV_N3' : {$pf = array( 504.000, 720.000); break;} - case 'CATENV_N6' : {$pf = array( 540.000, 756.000); break;} - case 'CATENV_N7' : {$pf = array( 576.000, 792.000); break;} - case 'CATENV_N8' : {$pf = array( 594.000, 810.000); break;} - case 'CATENV_N9_1/2' : {$pf = array( 612.000, 756.000); break;} - case 'CATENV_N9_3/4' : {$pf = array( 630.000, 810.000); break;} - case 'CATENV_N10_1/2': {$pf = array( 648.000, 864.000); break;} - case 'CATENV_N12_1/2': {$pf = array( 684.000, 900.000); break;} - case 'CATENV_N13_1/2': {$pf = array( 720.000, 936.000); break;} - case 'CATENV_N14_1/4': {$pf = array( 810.000, 882.000); break;} - case 'CATENV_N14_1/2': {$pf = array( 828.000, 1044.000); break;} - // Japanese (JIS P 0138-61) Standard B-Series - case 'JIS_B0' : {$pf = array( 2919.685, 4127.244); break;} - case 'JIS_B1' : {$pf = array( 2063.622, 2919.685); break;} - case 'JIS_B2' : {$pf = array( 1459.843, 2063.622); break;} - case 'JIS_B3' : {$pf = array( 1031.811, 1459.843); break;} - case 'JIS_B4' : {$pf = array( 728.504, 1031.811); break;} - case 'JIS_B5' : {$pf = array( 515.906, 728.504); break;} - case 'JIS_B6' : {$pf = array( 362.835, 515.906); break;} - case 'JIS_B7' : {$pf = array( 257.953, 362.835); break;} - case 'JIS_B8' : {$pf = array( 181.417, 257.953); break;} - case 'JIS_B9' : {$pf = array( 127.559, 181.417); break;} - case 'JIS_B10': {$pf = array( 90.709, 127.559); break;} - case 'JIS_B11': {$pf = array( 62.362, 90.709); break;} - case 'JIS_B12': {$pf = array( 45.354, 62.362); break;} - // PA Series - case 'PA0' : {$pf = array( 2381.102, 3174.803,); break;} - case 'PA1' : {$pf = array( 1587.402, 2381.102); break;} - case 'PA2' : {$pf = array( 1190.551, 1587.402); break;} - case 'PA3' : {$pf = array( 793.701, 1190.551); break;} - case 'PA4' : {$pf = array( 595.276, 793.701); break;} - case 'PA5' : {$pf = array( 396.850, 595.276); break;} - case 'PA6' : {$pf = array( 297.638, 396.850); break;} - case 'PA7' : {$pf = array( 198.425, 297.638); break;} - case 'PA8' : {$pf = array( 147.402, 198.425); break;} - case 'PA9' : {$pf = array( 99.213, 147.402); break;} - case 'PA10': {$pf = array( 73.701, 99.213); break;} - // Standard Photographic Print Sizes - case 'PASSPORT_PHOTO': {$pf = array( 99.213, 127.559); break;} - case 'E' : {$pf = array( 233.858, 340.157); break;} - case 'L': - case '3R' : {$pf = array( 252.283, 360.000); break;} - case 'KG': - case '4R' : {$pf = array( 289.134, 430.866); break;} - case '4D' : {$pf = array( 340.157, 430.866); break;} - case '2L': - case '5R' : {$pf = array( 360.000, 504.567); break;} - case '8P': - case '6R' : {$pf = array( 430.866, 575.433); break;} - case '6P': - case '8R' : {$pf = array( 575.433, 720.000); break;} - case '6PW': - case 'S8R' : {$pf = array( 575.433, 864.567); break;} - case '4P': - case '10R' : {$pf = array( 720.000, 864.567); break;} - case '4PW': - case 'S10R': {$pf = array( 720.000, 1080.000); break;} - case '11R' : {$pf = array( 790.866, 1009.134); break;} - case 'S11R': {$pf = array( 790.866, 1224.567); break;} - case '12R' : {$pf = array( 864.567, 1080.000); break;} - case 'S12R': {$pf = array( 864.567, 1292.598); break;} - // Common Newspaper Sizes - case 'NEWSPAPER_BROADSHEET': {$pf = array( 2125.984, 1700.787); break;} - case 'NEWSPAPER_BERLINER' : {$pf = array( 1332.283, 892.913); break;} - case 'NEWSPAPER_TABLOID': - case 'NEWSPAPER_COMPACT' : {$pf = array( 1218.898, 793.701); break;} - // Business Cards - case 'CREDIT_CARD': - case 'BUSINESS_CARD': - case 'BUSINESS_CARD_ISO7810': {$pf = array( 153.014, 242.646); break;} - case 'BUSINESS_CARD_ISO216' : {$pf = array( 147.402, 209.764); break;} - case 'BUSINESS_CARD_IT': - case 'BUSINESS_CARD_UK': - case 'BUSINESS_CARD_FR': - case 'BUSINESS_CARD_DE': - case 'BUSINESS_CARD_ES' : {$pf = array( 155.906, 240.945); break;} - case 'BUSINESS_CARD_CA': - case 'BUSINESS_CARD_US' : {$pf = array( 144.567, 252.283); break;} - case 'BUSINESS_CARD_JP' : {$pf = array( 155.906, 257.953); break;} - case 'BUSINESS_CARD_HK' : {$pf = array( 153.071, 255.118); break;} - case 'BUSINESS_CARD_AU': - case 'BUSINESS_CARD_DK': - case 'BUSINESS_CARD_SE' : {$pf = array( 155.906, 255.118); break;} - case 'BUSINESS_CARD_RU': - case 'BUSINESS_CARD_CZ': - case 'BUSINESS_CARD_FI': - case 'BUSINESS_CARD_HU': - case 'BUSINESS_CARD_IL' : {$pf = array( 141.732, 255.118); break;} - // Billboards - case '4SHEET' : {$pf = array( 2880.000, 4320.000); break;} - case '6SHEET' : {$pf = array( 3401.575, 5102.362); break;} - case '12SHEET': {$pf = array( 8640.000, 4320.000); break;} - case '16SHEET': {$pf = array( 5760.000, 8640.000); break;} - case '32SHEET': {$pf = array(11520.000, 8640.000); break;} - case '48SHEET': {$pf = array(17280.000, 8640.000); break;} - case '64SHEET': {$pf = array(23040.000, 8640.000); break;} - case '96SHEET': {$pf = array(34560.000, 8640.000); break;} - // Old European Sizes - // - Old Imperial English Sizes - case 'EN_EMPEROR' : {$pf = array( 3456.000, 5184.000); break;} - case 'EN_ANTIQUARIAN' : {$pf = array( 2232.000, 3816.000); break;} - case 'EN_GRAND_EAGLE' : {$pf = array( 2070.000, 3024.000); break;} - case 'EN_DOUBLE_ELEPHANT' : {$pf = array( 1926.000, 2880.000); break;} - case 'EN_ATLAS' : {$pf = array( 1872.000, 2448.000); break;} - case 'EN_COLOMBIER' : {$pf = array( 1692.000, 2484.000); break;} - case 'EN_ELEPHANT' : {$pf = array( 1656.000, 2016.000); break;} - case 'EN_DOUBLE_DEMY' : {$pf = array( 1620.000, 2556.000); break;} - case 'EN_IMPERIAL' : {$pf = array( 1584.000, 2160.000); break;} - case 'EN_PRINCESS' : {$pf = array( 1548.000, 2016.000); break;} - case 'EN_CARTRIDGE' : {$pf = array( 1512.000, 1872.000); break;} - case 'EN_DOUBLE_LARGE_POST': {$pf = array( 1512.000, 2376.000); break;} - case 'EN_ROYAL' : {$pf = array( 1440.000, 1800.000); break;} - case 'EN_SHEET': - case 'EN_HALF_POST' : {$pf = array( 1404.000, 1692.000); break;} - case 'EN_SUPER_ROYAL' : {$pf = array( 1368.000, 1944.000); break;} - case 'EN_DOUBLE_POST' : {$pf = array( 1368.000, 2196.000); break;} - case 'EN_MEDIUM' : {$pf = array( 1260.000, 1656.000); break;} - case 'EN_DEMY' : {$pf = array( 1260.000, 1620.000); break;} - case 'EN_LARGE_POST' : {$pf = array( 1188.000, 1512.000); break;} - case 'EN_COPY_DRAUGHT' : {$pf = array( 1152.000, 1440.000); break;} - case 'EN_POST' : {$pf = array( 1116.000, 1386.000); break;} - case 'EN_CROWN' : {$pf = array( 1080.000, 1440.000); break;} - case 'EN_PINCHED_POST' : {$pf = array( 1062.000, 1332.000); break;} - case 'EN_BRIEF' : {$pf = array( 972.000, 1152.000); break;} - case 'EN_FOOLSCAP' : {$pf = array( 972.000, 1224.000); break;} - case 'EN_SMALL_FOOLSCAP' : {$pf = array( 954.000, 1188.000); break;} - case 'EN_POTT' : {$pf = array( 900.000, 1080.000); break;} - // - Old Imperial Belgian Sizes - case 'BE_GRAND_AIGLE' : {$pf = array( 1984.252, 2948.031); break;} - case 'BE_COLOMBIER' : {$pf = array( 1757.480, 2409.449); break;} - case 'BE_DOUBLE_CARRE': {$pf = array( 1757.480, 2607.874); break;} - case 'BE_ELEPHANT' : {$pf = array( 1746.142, 2182.677); break;} - case 'BE_PETIT_AIGLE' : {$pf = array( 1700.787, 2381.102); break;} - case 'BE_GRAND_JESUS' : {$pf = array( 1559.055, 2069.291); break;} - case 'BE_JESUS' : {$pf = array( 1530.709, 2069.291); break;} - case 'BE_RAISIN' : {$pf = array( 1417.323, 1842.520); break;} - case 'BE_GRAND_MEDIAN': {$pf = array( 1303.937, 1714.961); break;} - case 'BE_DOUBLE_POSTE': {$pf = array( 1233.071, 1601.575); break;} - case 'BE_COQUILLE' : {$pf = array( 1218.898, 1587.402); break;} - case 'BE_PETIT_MEDIAN': {$pf = array( 1176.378, 1502.362); break;} - case 'BE_RUCHE' : {$pf = array( 1020.472, 1303.937); break;} - case 'BE_PROPATRIA' : {$pf = array( 977.953, 1218.898); break;} - case 'BE_LYS' : {$pf = array( 898.583, 1125.354); break;} - case 'BE_POT' : {$pf = array( 870.236, 1088.504); break;} - case 'BE_ROSETTE' : {$pf = array( 765.354, 983.622); break;} - // - Old Imperial French Sizes - case 'FR_UNIVERS' : {$pf = array( 2834.646, 3685.039); break;} - case 'FR_DOUBLE_COLOMBIER' : {$pf = array( 2551.181, 3571.654); break;} - case 'FR_GRANDE_MONDE' : {$pf = array( 2551.181, 3571.654); break;} - case 'FR_DOUBLE_SOLEIL' : {$pf = array( 2267.717, 3401.575); break;} - case 'FR_DOUBLE_JESUS' : {$pf = array( 2154.331, 3174.803); break;} - case 'FR_GRAND_AIGLE' : {$pf = array( 2125.984, 3004.724); break;} - case 'FR_PETIT_AIGLE' : {$pf = array( 1984.252, 2664.567); break;} - case 'FR_DOUBLE_RAISIN' : {$pf = array( 1842.520, 2834.646); break;} - case 'FR_JOURNAL' : {$pf = array( 1842.520, 2664.567); break;} - case 'FR_COLOMBIER_AFFICHE': {$pf = array( 1785.827, 2551.181); break;} - case 'FR_DOUBLE_CAVALIER' : {$pf = array( 1757.480, 2607.874); break;} - case 'FR_CLOCHE' : {$pf = array( 1700.787, 2267.717); break;} - case 'FR_SOLEIL' : {$pf = array( 1700.787, 2267.717); break;} - case 'FR_DOUBLE_CARRE' : {$pf = array( 1587.402, 2551.181); break;} - case 'FR_DOUBLE_COQUILLE' : {$pf = array( 1587.402, 2494.488); break;} - case 'FR_JESUS' : {$pf = array( 1587.402, 2154.331); break;} - case 'FR_RAISIN' : {$pf = array( 1417.323, 1842.520); break;} - case 'FR_CAVALIER' : {$pf = array( 1303.937, 1757.480); break;} - case 'FR_DOUBLE_COURONNE' : {$pf = array( 1303.937, 2040.945); break;} - case 'FR_CARRE' : {$pf = array( 1275.591, 1587.402); break;} - case 'FR_COQUILLE' : {$pf = array( 1247.244, 1587.402); break;} - case 'FR_DOUBLE_TELLIERE' : {$pf = array( 1247.244, 1927.559); break;} - case 'FR_DOUBLE_CLOCHE' : {$pf = array( 1133.858, 1700.787); break;} - case 'FR_DOUBLE_POT' : {$pf = array( 1133.858, 1757.480); break;} - case 'FR_ECU' : {$pf = array( 1133.858, 1474.016); break;} - case 'FR_COURONNE' : {$pf = array( 1020.472, 1303.937); break;} - case 'FR_TELLIERE' : {$pf = array( 963.780, 1247.244); break;} - case 'FR_POT' : {$pf = array( 878.740, 1133.858); break;} - // DEFAULT ISO A4 - default: {$pf = array( 595.276, 841.890); break;} - } - return $pf; - } - - /** - * Change the format of the current page - * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numners (width, height) or an array containing the following measures and options:<ul> - * <li>['format'] = page format name (one of the above);</li> - * <li>['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.</li> - * <li>['PZ'] : The page's preferred zoom (magnification) factor.</li> - * <li>['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:</li> - * <li>['MediaBox']['llx'] : lower-left x coordinate in points</li> - * <li>['MediaBox']['lly'] : lower-left y coordinate in points</li> - * <li>['MediaBox']['urx'] : upper-right x coordinate in points</li> - * <li>['MediaBox']['ury'] : upper-right y coordinate in points</li> - * <li>['CropBox'] : the visible region of default user space:</li> - * <li>['CropBox']['llx'] : lower-left x coordinate in points</li> - * <li>['CropBox']['lly'] : lower-left y coordinate in points</li> - * <li>['CropBox']['urx'] : upper-right x coordinate in points</li> - * <li>['CropBox']['ury'] : upper-right y coordinate in points</li> - * <li>['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:</li> - * <li>['BleedBox']['llx'] : lower-left x coordinate in points</li> - * <li>['BleedBox']['lly'] : lower-left y coordinate in points</li> - * <li>['BleedBox']['urx'] : upper-right x coordinate in points</li> - * <li>['BleedBox']['ury'] : upper-right y coordinate in points</li> - * <li>['TrimBox'] : the intended dimensions of the finished page after trimming:</li> - * <li>['TrimBox']['llx'] : lower-left x coordinate in points</li> - * <li>['TrimBox']['lly'] : lower-left y coordinate in points</li> - * <li>['TrimBox']['urx'] : upper-right x coordinate in points</li> - * <li>['TrimBox']['ury'] : upper-right y coordinate in points</li> - * <li>['ArtBox'] : the extent of the page's meaningful content:</li> - * <li>['ArtBox']['llx'] : lower-left x coordinate in points</li> - * <li>['ArtBox']['lly'] : lower-left y coordinate in points</li> - * <li>['ArtBox']['urx'] : upper-right x coordinate in points</li> - * <li>['ArtBox']['ury'] : upper-right y coordinate in points</li> - * <li>['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:</li> - * <li>['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.</li> - * <li>['BoxColorInfo'][BOXTYPE]['W'] : the guideline width in default user units</li> - * <li>['BoxColorInfo'][BOXTYPE]['S'] : the guideline style: S = Solid; D = Dashed</li> - * <li>['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines</li> - * <li>['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation</li> - * <li>['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.</li> - * <li>['trans']['S'] : transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade</li> - * <li>['trans']['D'] : The duration of the transition effect, in seconds.</li> - * <li>['trans']['Dm'] : (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.</li> - * <li>['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.</li> - * <li>['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.</li> - * <li>['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.</li> - * <li>['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.</li> - * </ul> - * @param string $orientation page orientation. Possible values are (case insensitive):<ul> - * <li>P or Portrait (default)</li> - * <li>L or Landscape</li> - * <li>'' (empty string) for automatic orientation</li> - * </ul> - * @access protected - * @since 3.0.015 (2008-06-06) - * @see getPageSizeFromFormat() - */ - protected function setPageFormat($format, $orientation='P') { - if (!empty($format) AND isset($this->pagedim[$this->page])) { - // remove inherited values - unset($this->pagedim[$this->page]); - } - if (is_string($format)) { - // get page measures from format name - $pf = $this->getPageSizeFromFormat($format); - $this->fwPt = $pf[0]; - $this->fhPt = $pf[1]; - } else { - // the boundaries of the physical medium on which the page shall be displayed or printed - if (isset($format['MediaBox'])) { - $this->setPageBoxes($this->page, 'MediaBox', $format['MediaBox']['llx'], $format['MediaBox']['lly'], $format['MediaBox']['urx'], $format['MediaBox']['ury'], false); - $this->fwPt = (($format['MediaBox']['urx'] - $format['MediaBox']['llx']) * $this->k); - $this->fhPt = (($format['MediaBox']['ury'] - $format['MediaBox']['lly']) * $this->k); - } else { - if (isset($format[0]) AND is_numeric($format[0]) AND isset($format[1]) AND is_numeric($format[1])) { - $pf = array(($format[0] * $this->k), ($format[1] * $this->k)); - } else { - if (!isset($format['format'])) { - // default value - $format['format'] = 'A4'; - } - $pf = $this->getPageSizeFromFormat($format['format']); - } - $this->fwPt = $pf[0]; - $this->fhPt = $pf[1]; - $this->setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true); - } - // the visible region of default user space - if (isset($format['CropBox'])) { - $this->setPageBoxes($this->page, 'CropBox', $format['CropBox']['llx'], $format['CropBox']['lly'], $format['CropBox']['urx'], $format['CropBox']['ury'], false); - } - // the region to which the contents of the page shall be clipped when output in a production environment - if (isset($format['BleedBox'])) { - $this->setPageBoxes($this->page, 'BleedBox', $format['BleedBox']['llx'], $format['BleedBox']['lly'], $format['BleedBox']['urx'], $format['BleedBox']['ury'], false); - } - // the intended dimensions of the finished page after trimming - if (isset($format['TrimBox'])) { - $this->setPageBoxes($this->page, 'TrimBox', $format['TrimBox']['llx'], $format['TrimBox']['lly'], $format['TrimBox']['urx'], $format['TrimBox']['ury'], false); - } - // the page's meaningful content (including potential white space) - if (isset($format['ArtBox'])) { - $this->setPageBoxes($this->page, 'ArtBox', $format['ArtBox']['llx'], $format['ArtBox']['lly'], $format['ArtBox']['urx'], $format['ArtBox']['ury'], false); - } - // specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for the various page boundaries - if (isset($format['BoxColorInfo'])) { - $this->pagedim[$this->page]['BoxColorInfo'] = $format['BoxColorInfo']; - } - if (isset($format['Rotate']) AND (($format['Rotate'] % 90) == 0)) { - // The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90. - $this->pagedim[$this->page]['Rotate'] = intval($format['Rotate']); - } - if (isset($format['PZ'])) { - // The page's preferred zoom (magnification) factor - $this->pagedim[$this->page]['PZ'] = floatval($format['PZ']); - } - if (isset($format['trans'])) { - // The style and duration of the visual transition to use when moving from another page to the given page during a presentation - if (isset($format['trans']['Dur'])) { - // The page's display duration - $this->pagedim[$this->page]['trans']['Dur'] = floatval($format['trans']['Dur']); - } - $stansition_styles = array('Split', 'Blinds', 'Box', 'Wipe', 'Dissolve', 'Glitter', 'R', 'Fly', 'Push', 'Cover', 'Uncover', 'Fade'); - if (isset($format['trans']['S']) AND in_array($format['trans']['S'], $stansition_styles)) { - // The transition style that shall be used when moving to this page from another during a presentation - $this->pagedim[$this->page]['trans']['S'] = $format['trans']['S']; - $valid_effect = array('Split', 'Blinds'); - $valid_vals = array('H', 'V'); - if (isset($format['trans']['Dm']) AND in_array($format['trans']['S'], $valid_effect) AND in_array($format['trans']['Dm'], $valid_vals)) { - $this->pagedim[$this->page]['trans']['Dm'] = $format['trans']['Dm']; - } - $valid_effect = array('Split', 'Box', 'Fly'); - $valid_vals = array('I', 'O'); - if (isset($format['trans']['M']) AND in_array($format['trans']['S'], $valid_effect) AND in_array($format['trans']['M'], $valid_vals)) { - $this->pagedim[$this->page]['trans']['M'] = $format['trans']['M']; - } - $valid_effect = array('Wipe', 'Glitter', 'Fly', 'Cover', 'Uncover', 'Push'); - if (isset($format['trans']['Di']) AND in_array($format['trans']['S'], $valid_effect)) { - if (((($format['trans']['Di'] == 90) OR ($format['trans']['Di'] == 180)) AND ($format['trans']['S'] == 'Wipe')) - OR (($format['trans']['Di'] == 315) AND ($format['trans']['S'] == 'Glitter')) - OR (($format['trans']['Di'] == 0) OR ($format['trans']['Di'] == 270))) { - $this->pagedim[$this->page]['trans']['Di'] = intval($format['trans']['Di']); - } - } - if (isset($format['trans']['SS']) AND ($format['trans']['S'] == 'Fly')) { - $this->pagedim[$this->page]['trans']['SS'] = floatval($format['trans']['SS']); - } - if (isset($format['trans']['B']) AND ($format['trans']['B'] === true) AND ($format['trans']['S'] == 'Fly')) { - $this->pagedim[$this->page]['trans']['B'] = 'true'; - } - } else { - $this->pagedim[$this->page]['trans']['S'] = 'R'; - } - if (isset($format['trans']['D'])) { - // The duration of the transition effect, in seconds - $this->pagedim[$this->page]['trans']['D'] = floatval($format['trans']['D']); - } else { - $this->pagedim[$this->page]['trans']['D'] = 1; - } - } - } - $this->setPageOrientation($orientation); - } - - /** - * Set page boundaries. - * @param int $page page number - * @param string $type valid values are: <ul><li>'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;</li><li>'CropBox' : the visible region of default user space;</li><li>'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;</li><li>'TrimBox' : the intended dimensions of the finished page after trimming;</li><li>'ArtBox' : the page's meaningful content (including potential white space).</li></ul> - * @param float $llx lower-left x coordinate in user units - * @param float $lly lower-left y coordinate in user units - * @param float $urx upper-right x coordinate in user units - * @param float $ury upper-right y coordinate in user units - * @param boolean $points if true uses user units as unit of measure, otherwise uses PDF points - * @access public - * @since 5.0.010 (2010-05-17) - */ - public function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points=false) { - if (!isset($this->pagedim[$page])) { - // initialize array - $this->pagedim[$page] = array(); - } - $pageboxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); - if (!in_array($type, $pageboxes)) { - return; - } - if ($points) { - $k = 1; - } else { - $k = $this->k; - } - $this->pagedim[$page][$type]['llx'] = ($llx * $k); - $this->pagedim[$page][$type]['lly'] = ($lly * $k); - $this->pagedim[$page][$type]['urx'] = ($urx * $k); - $this->pagedim[$page][$type]['ury'] = ($ury * $k); - } - - /** - * Swap X and Y coordinates of page boxes (change page boxes orientation). - * @param int $page page number - * @access protected - * @since 5.0.010 (2010-05-17) - */ - protected function swapPageBoxCoordinates($page) { - $pageboxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); - foreach ($pageboxes as $type) { - // swap X and Y coordinates - if (isset($this->pagedim[$page][$type])) { - $tmp = $this->pagedim[$page][$type]['llx']; - $this->pagedim[$page][$type]['llx'] = $this->pagedim[$page][$type]['lly']; - $this->pagedim[$page][$type]['lly'] = $tmp; - $tmp = $this->pagedim[$page][$type]['urx']; - $this->pagedim[$page][$type]['urx'] = $this->pagedim[$page][$type]['ury']; - $this->pagedim[$page][$type]['ury'] = $tmp; - } - } - } - - /** - * Set page orientation. - * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or Portrait (default)</li><li>L or Landscape</li><li>'' (empty string) for automatic orientation</li></ul> - * @param boolean $autopagebreak Boolean indicating if auto-page-break mode should be on or off. - * @param float $bottommargin bottom margin of the page. - * @access public - * @since 3.0.015 (2008-06-06) - */ - public function setPageOrientation($orientation, $autopagebreak='', $bottommargin='') { - if (!isset($this->pagedim[$this->page]['MediaBox'])) { - // the boundaries of the physical medium on which the page shall be displayed or printed - $this->setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true); - } - if (!isset($this->pagedim[$this->page]['CropBox'])) { - // the visible region of default user space - $this->setPageBoxes($this->page, 'CropBox', $this->pagedim[$this->page]['MediaBox']['llx'], $this->pagedim[$this->page]['MediaBox']['lly'], $this->pagedim[$this->page]['MediaBox']['urx'], $this->pagedim[$this->page]['MediaBox']['ury'], true); - } - if (!isset($this->pagedim[$this->page]['BleedBox'])) { - // the region to which the contents of the page shall be clipped when output in a production environment - $this->setPageBoxes($this->page, 'BleedBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true); - } - if (!isset($this->pagedim[$this->page]['TrimBox'])) { - // the intended dimensions of the finished page after trimming - $this->setPageBoxes($this->page, 'TrimBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true); - } - if (!isset($this->pagedim[$this->page]['ArtBox'])) { - // the page's meaningful content (including potential white space) - $this->setPageBoxes($this->page, 'ArtBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true); - } - if (!isset($this->pagedim[$this->page]['Rotate'])) { - // The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90. - $this->pagedim[$this->page]['Rotate'] = 0; - } - if (!isset($this->pagedim[$this->page]['PZ'])) { - // The page's preferred zoom (magnification) factor - $this->pagedim[$this->page]['PZ'] = 1; - } - if ($this->fwPt > $this->fhPt) { - // landscape - $default_orientation = 'L'; - } else { - // portrait - $default_orientation = 'P'; - } - $valid_orientations = array('P', 'L'); - if (empty($orientation)) { - $orientation = $default_orientation; - } else { - $orientation = strtoupper($orientation{0}); - } - if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) { - $this->CurOrientation = $orientation; - $this->wPt = $this->fhPt; - $this->hPt = $this->fwPt; - } else { - $this->CurOrientation = $default_orientation; - $this->wPt = $this->fwPt; - $this->hPt = $this->fhPt; - } - if ((abs($this->pagedim[$this->page]['MediaBox']['urx'] - $this->hPt) < $this->feps) AND (abs($this->pagedim[$this->page]['MediaBox']['ury'] - $this->wPt) < $this->feps)){ - // swap X and Y coordinates (change page orientation) - $this->swapPageBoxCoordinates($this->page); - } - $this->w = $this->wPt / $this->k; - $this->h = $this->hPt / $this->k; - if ($this->empty_string($autopagebreak)) { - if (isset($this->AutoPageBreak)) { - $autopagebreak = $this->AutoPageBreak; - } else { - $autopagebreak = true; - } - } - if ($this->empty_string($bottommargin)) { - if (isset($this->bMargin)) { - $bottommargin = $this->bMargin; - } else { - // default value = 2 cm - $bottommargin = 2 * 28.35 / $this->k; - } - } - $this->SetAutoPageBreak($autopagebreak, $bottommargin); - // store page dimensions - $this->pagedim[$this->page]['w'] = $this->wPt; - $this->pagedim[$this->page]['h'] = $this->hPt; - $this->pagedim[$this->page]['wk'] = $this->w; - $this->pagedim[$this->page]['hk'] = $this->h; - $this->pagedim[$this->page]['tm'] = $this->tMargin; - $this->pagedim[$this->page]['bm'] = $bottommargin; - $this->pagedim[$this->page]['lm'] = $this->lMargin; - $this->pagedim[$this->page]['rm'] = $this->rMargin; - $this->pagedim[$this->page]['pb'] = $autopagebreak; - $this->pagedim[$this->page]['or'] = $this->CurOrientation; - $this->pagedim[$this->page]['olm'] = $this->original_lMargin; - $this->pagedim[$this->page]['orm'] = $this->original_rMargin; - } - - /** - * Set regular expression to detect withespaces or word separators. - * The pattern delimiter must be the forward-slash character '/'. - * Some example patterns are: - * <pre> - * Non-Unicode or missing PCRE unicode support: '/[^\S\xa0]/' - * Unicode and PCRE unicode support: '/[^\S\P{Z}\xa0]/u' - * Unicode and PCRE unicode support in Chinese mode: '/[^\S\P{Z}\P{Lo}\xa0]/u' - * if PCRE unicode support is turned ON (\P is the negate class of \p): - * \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. - * \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. - * \p{Lo} is needed for Chinese characters because are packed next to each other without spaces in between. - * </pre> - * @param string $re regular expression (leave empty for default). - * @access public - * @since 4.6.016 (2009-06-15) - */ - public function setSpacesRE($re='/[^\S\xa0]/') { - $this->re_spaces = $re; - $re_parts = explode('/', $re); - // get pattern parts - $this->re_space = array(); - if (isset($re_parts[1]) AND !empty($re_parts[1])) { - $this->re_space['p'] = $re_parts[1]; - } else { - $this->re_space['p'] = '[\s]'; - } - // set pattern modifiers - if (isset($re_parts[2]) AND !empty($re_parts[2])) { - $this->re_space['m'] = $re_parts[2]; - } else { - $this->re_space['m'] = ''; - } - } - - /** - * Enable or disable Right-To-Left language mode - * @param Boolean $enable if true enable Right-To-Left language mode. - * @param Boolean $resetx if true reset the X position on direction change. - * @access public - * @since 2.0.000 (2008-01-03) - */ - public function setRTL($enable, $resetx=true) { - $enable = $enable ? true : false; - $resetx = ($resetx AND ($enable != $this->rtl)); - $this->rtl = $enable; - $this->tmprtl = false; - if ($resetx) { - $this->Ln(0); - } - } - - /** - * Return the RTL status - * @return boolean - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getRTL() { - return $this->rtl; - } - - /** - * Force temporary RTL language direction - * @param mixed $mode can be false, 'L' for LTR or 'R' for RTL - * @access public - * @since 2.1.000 (2008-01-09) - */ - public function setTempRTL($mode) { - $newmode = false; - switch (strtoupper($mode)) { - case 'LTR': - case 'L': { - if ($this->rtl) { - $newmode = 'L'; - } - break; - } - case 'RTL': - case 'R': { - if (!$this->rtl) { - $newmode = 'R'; - } - break; - } - case false: - default: { - $newmode = false; - break; - } - } - $this->tmprtl = $newmode; - } - - /** - * Return the current temporary RTL status - * @return boolean - * @access public - * @since 4.8.014 (2009-11-04) - */ - public function isRTLTextDir() { - return ($this->rtl OR ($this->tmprtl == 'R')); - } - - /** - * Set the last cell height. - * @param float $h cell height. - * @author Nicola Asuni - * @access public - * @since 1.53.0.TC034 - */ - public function setLastH($h) { - $this->lasth = $h; - } - - /** - * Reset the last cell height. - * @access public - * @since 5.9.000 (2010-10-03) - */ - public function resetLastH() { - $this->lasth = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']; - } - - /** - * Get the last cell height. - * @return last cell height - * @access public - * @since 4.0.017 (2008-08-05) - */ - public function getLastH() { - return $this->lasth; - } - - /** - * Set the adjusting factor to convert pixels to user units. - * @param float $scale adjusting factor to convert pixels to user units. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ - public function setImageScale($scale) { - $this->imgscale = $scale; - } - - /** - * Returns the adjusting factor to convert pixels to user units. - * @return float adjusting factor to convert pixels to user units. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ - public function getImageScale() { - return $this->imgscale; - } - - /** - * Returns an array of page dimensions: - * <ul><li>$this->pagedim[$this->page]['w'] = page width in points</li><li>$this->pagedim[$this->page]['h'] = height in points</li><li>$this->pagedim[$this->page]['wk'] = page width in user units</li><li>$this->pagedim[$this->page]['hk'] = page height in user units</li><li>$this->pagedim[$this->page]['tm'] = top margin</li><li>$this->pagedim[$this->page]['bm'] = bottom margin</li><li>$this->pagedim[$this->page]['lm'] = left margin</li><li>$this->pagedim[$this->page]['rm'] = right margin</li><li>$this->pagedim[$this->page]['pb'] = auto page break</li><li>$this->pagedim[$this->page]['or'] = page orientation</li><li>$this->pagedim[$this->page]['olm'] = original left margin</li><li>$this->pagedim[$this->page]['orm'] = original right margin</li><li>$this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.</li><li>$this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.</li><li>$this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation<ul><li>$this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.</li><li>$this->pagedim[$this->page]['trans']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade</li><li>$this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.</li><li>$this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.</li><li>$this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.</li><li>$this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.</li><li>$this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0. </li><li>$this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.</li></ul></li><li>$this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed<ul><li>$this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['CropBox'] : the visible region of default user space<ul><li>$this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment<ul><li>$this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming<ul><li>$this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points</li></ul></li><li>$this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content<ul><li>$this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points</li><li>$this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points</li></ul></li></ul> - * @param int $pagenum page number (empty = current page) - * @return array of page dimensions. - * @author Nicola Asuni - * @access public - * @since 4.5.027 (2009-03-16) - */ - public function getPageDimensions($pagenum='') { - if (empty($pagenum)) { - $pagenum = $this->page; - } - return $this->pagedim[$pagenum]; - } - - /** - * Returns the page width in units. - * @param int $pagenum page number (empty = current page) - * @return int page width. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ - public function getPageWidth($pagenum='') { - if (empty($pagenum)) { - return $this->w; - } - return $this->pagedim[$pagenum]['w']; - } - - /** - * Returns the page height in units. - * @param int $pagenum page number (empty = current page) - * @return int page height. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ - public function getPageHeight($pagenum='') { - if (empty($pagenum)) { - return $this->h; - } - return $this->pagedim[$pagenum]['h']; - } - - /** - * Returns the page break margin. - * @param int $pagenum page number (empty = current page) - * @return int page break margin. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - * @see getPageDimensions() - */ - public function getBreakMargin($pagenum='') { - if (empty($pagenum)) { - return $this->bMargin; - } - return $this->pagedim[$pagenum]['bm']; - } - - /** - * Returns the scale factor (number of points in user unit). - * @return int scale factor. - * @author Nicola Asuni - * @access public - * @since 1.5.2 - */ - public function getScaleFactor() { - return $this->k; - } - - /** - * Defines the left, top and right margins. - * @param float $left Left margin. - * @param float $top Top margin. - * @param float $right Right margin. Default value is the left one. - * @param boolean $keepmargins if true overwrites the default page margins - * @access public - * @since 1.0 - * @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak() - */ - public function SetMargins($left, $top, $right=-1, $keepmargins=false) { - //Set left, top and right margins - $this->lMargin = $left; - $this->tMargin = $top; - if ($right == -1) { - $right = $left; - } - $this->rMargin = $right; - if ($keepmargins) { - // overwrite original values - $this->original_lMargin = $this->lMargin; - $this->original_rMargin = $this->rMargin; - } - } - - /** - * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. - * @param float $margin The margin. - * @access public - * @since 1.4 - * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() - */ - public function SetLeftMargin($margin) { - //Set left margin - $this->lMargin = $margin; - if (($this->page > 0) AND ($this->x < $margin)) { - $this->x = $margin; - } - } - - /** - * Defines the top margin. The method can be called before creating the first page. - * @param float $margin The margin. - * @access public - * @since 1.5 - * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() - */ - public function SetTopMargin($margin) { - //Set top margin - $this->tMargin = $margin; - if (($this->page > 0) AND ($this->y < $margin)) { - $this->y = $margin; - } - } - - /** - * Defines the right margin. The method can be called before creating the first page. - * @param float $margin The margin. - * @access public - * @since 1.5 - * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() - */ - public function SetRightMargin($margin) { - $this->rMargin = $margin; - if (($this->page > 0) AND ($this->x > ($this->w - $margin))) { - $this->x = $this->w - $margin; - } - } - - /** - * Set the same internal Cell padding for top, right, bottom, left- - * @param float $pad internal padding. - * @access public - * @since 2.1.000 (2008-01-09) - * @see getCellPaddings(), setCellPaddings() - */ - public function SetCellPadding($pad) { - if ($pad >= 0) { - $this->cell_padding['L'] = $pad; - $this->cell_padding['T'] = $pad; - $this->cell_padding['R'] = $pad; - $this->cell_padding['B'] = $pad; - } - } - - /** - * Set the internal Cell paddings. - * @param float $left left padding - * @param float $top top padding - * @param float $right right padding - * @param float $bottom bottom padding - * @access public - * @since 5.9.000 (2010-10-03) - * @see getCellPaddings(), SetCellPadding() - */ - public function setCellPaddings($left='', $top='', $right='', $bottom='') { - if (($left !== '') AND ($left >= 0)) { - $this->cell_padding['L'] = $left; - } - if (($top !== '') AND ($top >= 0)) { - $this->cell_padding['T'] = $top; - } - if (($right !== '') AND ($right >= 0)) { - $this->cell_padding['R'] = $right; - } - if (($bottom !== '') AND ($bottom >= 0)) { - $this->cell_padding['B'] = $bottom; - } - } - - /** - * Get the internal Cell padding array. - * @return array of padding values - * @access public - * @since 5.9.000 (2010-10-03) - * @see setCellPaddings(), SetCellPadding() - */ - public function getCellPaddings() { - return $this->cell_padding; - } - - /** - * Set the internal Cell margins. - * @param float $left left margin - * @param float $top top margin - * @param float $right right margin - * @param float $bottom bottom margin - * @access public - * @since 5.9.000 (2010-10-03) - * @see getCellMargins() - */ - public function setCellMargins($left='', $top='', $right='', $bottom='') { - if (($left !== '') AND ($left >= 0)) { - $this->cell_margin['L'] = $left; - } - if (($top !== '') AND ($top >= 0)) { - $this->cell_margin['T'] = $top; - } - if (($right !== '') AND ($right >= 0)) { - $this->cell_margin['R'] = $right; - } - if (($bottom !== '') AND ($bottom >= 0)) { - $this->cell_margin['B'] = $bottom; - } - } - - /** - * Get the internal Cell margin array. - * @return array of margin values - * @access public - * @since 5.9.000 (2010-10-03) - * @see setCellMargins() - */ - public function getCellMargins() { - return $this->cell_margin; - } - - /** - * Adjust the internal Cell padding array to take account of the line width. - * @param mixed $brd Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @return array of adjustments - * @access public - * @since 5.9.000 (2010-10-03) - */ - protected function adjustCellPadding($brd=0) { - if (empty($brd)) { - return; - } - if (is_string($brd)) { - // convert string to array - $slen = strlen($brd); - $newbrd = array(); - for ($i = 0; $i < $slen; ++$i) { - $newbrd[$brd{$i}] = true; - } - $brd = $newbrd; - } elseif (($brd === 1) OR ($brd === true) OR (is_numeric($brd) AND (intval($brd) > 0))) { - $brd = array('LRTB' => true); - } - if (!is_array($brd)) { - return; - } - // store current cell padding - $cp = $this->cell_padding; - // select border mode - if (isset($brd['mode'])) { - $mode = $brd['mode']; - unset($brd['mode']); - } else { - $mode = 'normal'; - } - // process borders - foreach ($brd as $border => $style) { - $line_width = $this->LineWidth; - if (is_array($style) AND isset($style['width'])) { - // get border width - $line_width = $style['width']; - } - $adj = 0; // line width inside the cell - switch ($mode) { - case 'ext': { - $adj = 0; - break; - } - case 'int': { - $adj = $line_width; - break; - } - case 'normal': - default: { - $adj = ($line_width / 2); - break; - } - } - // correct internal cell padding if required to avoid overlap between text and lines - if ((strpos($border,'T') !== false) AND ($this->cell_padding['T'] < $adj)) { - $this->cell_padding['T'] = $adj; - } - if ((strpos($border,'R') !== false) AND ($this->cell_padding['R'] < $adj)) { - $this->cell_padding['R'] = $adj; - } - if ((strpos($border,'B') !== false) AND ($this->cell_padding['B'] < $adj)) { - $this->cell_padding['B'] = $adj; - } - if ((strpos($border,'L') !== false) AND ($this->cell_padding['L'] < $adj)) { - $this->cell_padding['L'] = $adj; - } - } - return array('T' => ($this->cell_padding['T'] - $cp['T']), 'R' => ($this->cell_padding['R'] - $cp['R']), 'B' => ($this->cell_padding['B'] - $cp['B']), 'L' => ($this->cell_padding['L'] - $cp['L'])); - } - - /** - * Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm. - * @param boolean $auto Boolean indicating if mode should be on or off. - * @param float $margin Distance from the bottom of the page. - * @access public - * @since 1.0 - * @see Cell(), MultiCell(), AcceptPageBreak() - */ - public function SetAutoPageBreak($auto, $margin=0) { - //Set auto page break mode and triggering margin - $this->AutoPageBreak = $auto; - $this->bMargin = $margin; - $this->PageBreakTrigger = $this->h - $margin; - } - - /** - * Defines the way the document is to be displayed by the viewer. - * @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use. <ul><li>fullpage: displays the entire page on screen </li><li>fullwidth: uses maximum width of window</li><li>real: uses real size (equivalent to 100% zoom)</li><li>default: uses viewer default mode</li></ul> - * @param string $layout The page layout. Possible values are:<ul><li>SinglePage Display one page at a time</li><li>OneColumn Display the pages in one column</li><li>TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left</li><li>TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right</li><li>TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left</li><li>TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right</li></ul> - * @param string $mode A name object specifying how the document should be displayed when opened:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible</li><li>UseOC (PDF 1.5) Optional content group panel visible</li><li>UseAttachments (PDF 1.6) Attachments panel visible</li></ul> - * @access public - * @since 1.2 - */ - public function SetDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') { - //Set display mode in viewer - if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) { - $this->ZoomMode = $zoom; - } else { - $this->Error('Incorrect zoom display mode: '.$zoom); - } - switch ($layout) { - case 'default': - case 'single': - case 'SinglePage': { - $this->LayoutMode = 'SinglePage'; - break; - } - case 'continuous': - case 'OneColumn': { - $this->LayoutMode = 'OneColumn'; - break; - } - case 'two': - case 'TwoColumnLeft': { - $this->LayoutMode = 'TwoColumnLeft'; - break; - } - case 'TwoColumnRight': { - $this->LayoutMode = 'TwoColumnRight'; - break; - } - case 'TwoPageLeft': { - $this->LayoutMode = 'TwoPageLeft'; - break; - } - case 'TwoPageRight': { - $this->LayoutMode = 'TwoPageRight'; - break; - } - default: { - $this->LayoutMode = 'SinglePage'; - } - } - switch ($mode) { - case 'UseNone': { - $this->PageMode = 'UseNone'; - break; - } - case 'UseOutlines': { - $this->PageMode = 'UseOutlines'; - break; - } - case 'UseThumbs': { - $this->PageMode = 'UseThumbs'; - break; - } - case 'FullScreen': { - $this->PageMode = 'FullScreen'; - break; - } - case 'UseOC': { - $this->PageMode = 'UseOC'; - break; - } - case '': { - $this->PageMode = 'UseAttachments'; - break; - } - default: { - $this->PageMode = 'UseNone'; - } - } - } - - /** - * Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default. - * Note: the Zlib extension is required for this feature. If not present, compression will be turned off. - * @param boolean $compress Boolean indicating if compression must be enabled. - * @access public - * @since 1.4 - */ - public function SetCompression($compress) { - //Set page compression - if (function_exists('gzcompress')) { - $this->compress = $compress ? true : false; - } else { - $this->compress = false; - } - } - - /** - * Defines the title of the document. - * @param string $title The title. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject() - */ - public function SetTitle($title) { - //Title of document - $this->title = $title; - } - - /** - * Defines the subject of the document. - * @param string $subject The subject. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle() - */ - public function SetSubject($subject) { - //Subject of document - $this->subject = $subject; - } - - /** - * Defines the author of the document. - * @param string $author The name of the author. - * @access public - * @since 1.2 - * @see SetCreator(), SetKeywords(), SetSubject(), SetTitle() - */ - public function SetAuthor($author) { - //Author of document - $this->author = $author; - } - - /** - * Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. - * @param string $keywords The list of keywords. - * @access public - * @since 1.2 - * @see SetAuthor(), SetCreator(), SetSubject(), SetTitle() - */ - public function SetKeywords($keywords) { - //Keywords of document - $this->keywords = $keywords; - } - - /** - * Defines the creator of the document. This is typically the name of the application that generates the PDF. - * @param string $creator The name of the creator. - * @access public - * @since 1.2 - * @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle() - */ - public function SetCreator($creator) { - //Creator of document - $this->creator = $creator; - } - - /** - * This method is automatically called in case of fatal error; it simply outputs the message and halts the execution. An inherited class may override it to customize the error handling but should always halt the script, or the resulting document would probably be invalid. - * 2004-06-11 :: Nicola Asuni : changed bold tag with strong - * @param string $msg The error message - * @access public - * @since 1.0 - */ - public function Error($msg) { - // unset all class variables - $this->_destroy(true); - // exit program and print error - die('<strong>TCPDF ERROR: </strong>'.$msg); - } - - /** - * This method begins the generation of the PDF document. - * It is not necessary to call it explicitly because AddPage() does it automatically. - * Note: no page is created by this method - * @access public - * @since 1.0 - * @see AddPage(), Close() - */ - public function Open() { - //Begin document - $this->state = 1; - } - - /** - * Terminates the PDF document. - * It is not necessary to call this method explicitly because Output() does it automatically. - * If the document contains no page, AddPage() is called to prevent from getting an invalid document. - * @access public - * @since 1.0 - * @see Open(), Output() - */ - public function Close() { - if ($this->state == 3) { - return; - } - if ($this->page == 0) { - $this->AddPage(); - } - // save current graphic settings - $gvars = $this->getGraphicVars(); - $this->lastpage(true); - $this->SetAutoPageBreak(false); - $this->x = 0; - $this->y = $this->h - (1 / $this->k); - $this->lMargin = 0; - $this->_out('q'); - $this->setVisibility('screen'); - $this->SetFont('helvetica', '', 1); - $this->SetTextColor(255, 255, 255); - $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; - $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67"; - $this->Cell(0, 0, $msg, 0, 0, 'L', 0, $lnk, 0, false, 'D', 'B'); - $this->setVisibility('all'); - $this->_out('Q'); - // restore graphic settings - $this->setGraphicVars($gvars); - // close page - $this->endPage(); - // close document - $this->_enddoc(); - // unset all class variables (except critical ones) - $this->_destroy(false); - } - - /** - * Move pointer at the specified document page and update page dimensions. - * @param int $pnum page number (1 ... numpages) - * @param boolean $resetmargins if true reset left, right, top margins and Y position. - * @access public - * @since 2.1.000 (2008-01-07) - * @see getPage(), lastpage(), getNumPages() - */ - public function setPage($pnum, $resetmargins=false) { - if (($pnum == $this->page) AND ($this->state == 2)) { - return; - } - if (($pnum > 0) AND ($pnum <= $this->numpages)) { - $this->state = 2; - // save current graphic settings - //$gvars = $this->getGraphicVars(); - $oldpage = $this->page; - $this->page = $pnum; - $this->wPt = $this->pagedim[$this->page]['w']; - $this->hPt = $this->pagedim[$this->page]['h']; - $this->w = $this->pagedim[$this->page]['wk']; - $this->h = $this->pagedim[$this->page]['hk']; - $this->tMargin = $this->pagedim[$this->page]['tm']; - $this->bMargin = $this->pagedim[$this->page]['bm']; - $this->original_lMargin = $this->pagedim[$this->page]['olm']; - $this->original_rMargin = $this->pagedim[$this->page]['orm']; - $this->AutoPageBreak = $this->pagedim[$this->page]['pb']; - $this->CurOrientation = $this->pagedim[$this->page]['or']; - $this->SetAutoPageBreak($this->AutoPageBreak, $this->bMargin); - // restore graphic settings - //$this->setGraphicVars($gvars); - if ($resetmargins) { - $this->lMargin = $this->pagedim[$this->page]['olm']; - $this->rMargin = $this->pagedim[$this->page]['orm']; - $this->SetY($this->tMargin); - } else { - // account for booklet mode - if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) { - $deltam = $this->pagedim[$this->page]['olm'] - $this->pagedim[$this->page]['orm']; - $this->lMargin += $deltam; - $this->rMargin -= $deltam; - } - } - } else { - $this->Error('Wrong page number on setPage() function: '.$pnum); - } - } - - /** - * Reset pointer to the last document page. - * @param boolean $resetmargins if true reset left, right, top margins and Y position. - * @access public - * @since 2.0.000 (2008-01-04) - * @see setPage(), getPage(), getNumPages() - */ - public function lastPage($resetmargins=false) { - $this->setPage($this->getNumPages(), $resetmargins); - } - - /** - * Get current document page number. - * @return int page number - * @access public - * @since 2.1.000 (2008-01-07) - * @see setPage(), lastpage(), getNumPages() - */ - public function getPage() { - return $this->page; - } - - /** - * Get the total number of insered pages. - * @return int number of pages - * @access public - * @since 2.1.000 (2008-01-07) - * @see setPage(), getPage(), lastpage() - */ - public function getNumPages() { - return $this->numpages; - } - - /** - * Adds a new TOC (Table Of Content) page to the document. - * @param string $orientation page orientation. - * @param boolean $keepmargins if true overwrites the default page margins with the current margins - * @access public - * @since 5.0.001 (2010-05-06) - * @see AddPage(), startPage(), endPage(), endTOCPage() - */ - public function addTOCPage($orientation='', $format='', $keepmargins=false) { - $this->AddPage($orientation, $format, $keepmargins, true); - } - - /** - * Terminate the current TOC (Table Of Content) page - * @access public - * @since 5.0.001 (2010-05-06) - * @see AddPage(), startPage(), endPage(), addTOCPage() - */ - public function endTOCPage() { - $this->endPage(true); - } - - /** - * Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled). - * The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards. - * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or PORTRAIT (default)</li><li>L or LANDSCAPE</li></ul> - * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @param boolean $keepmargins if true overwrites the default page margins with the current margins - * @param boolean $tocpage if true set the tocpage state to true (the added page will be used to display Table Of Content). - * @access public - * @since 1.0 - * @see startPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() - */ - public function AddPage($orientation='', $format='', $keepmargins=false, $tocpage=false) { - if ($this->inxobj) { - // we are inside an XObject template - return; - } - if (!isset($this->original_lMargin) OR $keepmargins) { - $this->original_lMargin = $this->lMargin; - } - if (!isset($this->original_rMargin) OR $keepmargins) { - $this->original_rMargin = $this->rMargin; - } - // terminate previous page - $this->endPage(); - // start new page - $this->startPage($orientation, $format, $tocpage); - } - - /** - * Terminate the current page - * @param boolean $tocpage if true set the tocpage state to false (end the page used to display Table Of Content). - * @access public - * @since 4.2.010 (2008-11-14) - * @see AddPage(), startPage(), addTOCPage(), endTOCPage() - */ - public function endPage($tocpage=false) { - // check if page is already closed - if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) { - return; - } - $this->InFooter = true; - // print page footer - $this->setFooter(); - // close page - $this->_endpage(); - // mark page as closed - $this->pageopen[$this->page] = false; - $this->InFooter = false; - if ($tocpage) { - $this->tocpage = false; - } - } - - /** - * Starts a new page to the document. The page must be closed using the endPage() function. - * The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards. - * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or PORTRAIT (default)</li><li>L or LANDSCAPE</li></ul> - * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @access public - * @since 4.2.010 (2008-11-14) - * @see AddPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() - */ - public function startPage($orientation='', $format='', $tocpage=false) { - if ($tocpage) { - $this->tocpage = true; - } - if ($this->numpages > $this->page) { - // this page has been already added - $this->setPage($this->page + 1); - $this->SetY($this->tMargin); - return; - } - // start a new page - if ($this->state == 0) { - $this->Open(); - } - ++$this->numpages; - $this->swapMargins($this->booklet); - // save current graphic settings - $gvars = $this->getGraphicVars(); - // start new page - $this->_beginpage($orientation, $format); - // mark page as open - $this->pageopen[$this->page] = true; - // restore graphic settings - $this->setGraphicVars($gvars); - // mark this point - $this->setPageMark(); - // print page header - $this->setHeader(); - // restore graphic settings - $this->setGraphicVars($gvars); - // mark this point - $this->setPageMark(); - // print table header (if any) - $this->setTableHeader(); - // set mark for empty page check - $this->emptypagemrk[$this->page]= $this->pagelen[$this->page]; - } - - /** - * Set start-writing mark on current page stream used to put borders and fills. - * Borders and fills are always created after content and inserted on the position marked by this method. - * This function must be called after calling Image() function for a background image. - * Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions. - * @access public - * @since 4.0.016 (2008-07-30) - */ - public function setPageMark() { - $this->intmrk[$this->page] = $this->pagelen[$this->page]; - $this->bordermrk[$this->page] = $this->intmrk[$this->page]; - $this->setContentMark(); - } - - /** - * Set start-writing mark on selected page. - * Borders and fills are always created after content and inserted on the position marked by this method. - * @param int $page page number (default is the current page) - * @access protected - * @since 4.6.021 (2009-07-20) - */ - protected function setContentMark($page=0) { - if ($page <= 0) { - $page = $this->page; - } - if (isset($this->footerlen[$page])) { - $this->cntmrk[$page] = $this->pagelen[$page] - $this->footerlen[$page]; - } else { - $this->cntmrk[$page] = $this->pagelen[$page]; - } - } - - /** - * Set header data. - * @param string $ln header image logo - * @param string $lw header image logo width in mm - * @param string $ht string to print as title on document header - * @param string $hs string to print on document header - * @access public - */ - public function setHeaderData($ln='', $lw=0, $ht='', $hs='') { - $this->header_logo = $ln; - $this->header_logo_width = $lw; - $this->header_title = $ht; - $this->header_string = $hs; - } - - /** - * Returns header data: - * <ul><li>$ret['logo'] = logo image</li><li>$ret['logo_width'] = width of the image logo in user units</li><li>$ret['title'] = header title</li><li>$ret['string'] = header description string</li></ul> - * @return array() - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getHeaderData() { - $ret = array(); - $ret['logo'] = $this->header_logo; - $ret['logo_width'] = $this->header_logo_width; - $ret['title'] = $this->header_title; - $ret['string'] = $this->header_string; - return $ret; - } - - /** - * Set header margin. - * (minimum distance between header and top page margin) - * @param int $hm distance in user units - * @access public - */ - public function setHeaderMargin($hm=10) { - $this->header_margin = $hm; - } - - /** - * Returns header margin in user units. - * @return float - * @since 4.0.012 (2008-07-24) - * @access public - */ - public function getHeaderMargin() { - return $this->header_margin; - } - - /** - * Set footer margin. - * (minimum distance between footer and bottom page margin) - * @param int $fm distance in user units - * @access public - */ - public function setFooterMargin($fm=10) { - $this->footer_margin = $fm; - } - - /** - * Returns footer margin in user units. - * @return float - * @since 4.0.012 (2008-07-24) - * @access public - */ - public function getFooterMargin() { - return $this->footer_margin; - } - /** - * Set a flag to print page header. - * @param boolean $val set to true to print the page header (default), false otherwise. - * @access public - */ - public function setPrintHeader($val=true) { - $this->print_header = $val; - } - - /** - * Set a flag to print page footer. - * @param boolean $value set to true to print the page footer (default), false otherwise. - * @access public - */ - public function setPrintFooter($val=true) { - $this->print_footer = $val; - } - - /** - * Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image - * @return float - * @access public - */ - public function getImageRBX() { - return $this->img_rb_x; - } - - /** - * Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last inserted image - * @return float - * @access public - */ - public function getImageRBY() { - return $this->img_rb_y; - } - - /** - * This method is used to render the page header. - * It is automatically called by AddPage() and could be overwritten in your own inherited class. - * @access public - */ - public function Header() { - $ormargins = $this->getOriginalMargins(); - $headerfont = $this->getHeaderFont(); - $headerdata = $this->getHeaderData(); - if (($headerdata['logo']) AND ($headerdata['logo'] != K_BLANK_IMAGE)) { - $this->Image(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']); - $imgy = $this->getImageRBY(); - } else { - $imgy = $this->GetY(); - } - $cell_height = round(($this->getCellHeightRatio() * $headerfont[2]) / $this->getScaleFactor(), 2); - // set starting margin for text data cell - if ($this->getRTL()) { - $header_x = $ormargins['right'] + ($headerdata['logo_width'] * 1.1); - } else { - $header_x = $ormargins['left'] + ($headerdata['logo_width'] * 1.1); - } - $this->SetTextColor(0, 0, 0); - // header title - $this->SetFont($headerfont[0], 'B', $headerfont[2] + 1); - $this->SetX($header_x); - $this->Cell(0, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0); - // header string - $this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]); - $this->SetX($header_x); - $this->MultiCell(0, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false); - // print an ending header line - $this->SetLineStyle(array('width' => 0.85 / $this->getScaleFactor(), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); - $this->SetY((2.835 / $this->getScaleFactor()) + max($imgy, $this->GetY())); - if ($this->getRTL()) { - $this->SetX($ormargins['right']); - } else { - $this->SetX($ormargins['left']); - } - $this->Cell(0, 0, '', 'T', 0, 'C'); - } - - /** - * This method is used to render the page footer. - * It is automatically called by AddPage() and could be overwritten in your own inherited class. - * @access public - */ - public function Footer() { - $cur_y = $this->GetY(); - $ormargins = $this->getOriginalMargins(); - $this->SetTextColor(0, 0, 0); - //set style for cell border - $line_width = 0.85 / $this->getScaleFactor(); - $this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); - //print document barcode - $barcode = $this->getBarcode(); - if (!empty($barcode)) { - $this->Ln($line_width); - $barcode_width = round(($this->getPageWidth() - $ormargins['left'] - $ormargins['right']) / 3); - $style = array( - 'position' => $this->rtl?'R':'L', - 'align' => $this->rtl?'R':'L', - 'stretch' => false, - 'fitwidth' => true, - 'cellfitalign' => '', - 'border' => false, - 'padding' => 0, - 'fgcolor' => array(0,0,0), - 'bgcolor' => false, - 'text' => false - ); - $this->write1DBarcode($barcode, 'C128B', '', $cur_y + $line_width, '', (($this->getFooterMargin() / 3) - $line_width), 0.3, $style, ''); - } - if (empty($this->pagegroups)) { - $pagenumtxt = $this->l['w_page'].' '.$this->getAliasNumPage().' / '.$this->getAliasNbPages(); - } else { - $pagenumtxt = $this->l['w_page'].' '.$this->getPageNumGroupAlias().' / '.$this->getPageGroupAlias(); - } - $this->SetY($cur_y); - //Print page number - if ($this->getRTL()) { - $this->SetX($ormargins['right']); - $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L'); - } else { - $this->SetX($ormargins['left']); - $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'R'); - } - } - - /** - * This method is used to render the page header. - * @access protected - * @since 4.0.012 (2008-07-24) - */ - protected function setHeader() { - if ($this->print_header) { - $this->setGraphicVars($this->default_graphic_vars); - $temp_thead = $this->thead; - $temp_theadMargins = $this->theadMargins; - $lasth = $this->lasth; - $this->_out('q'); - $this->rMargin = $this->original_rMargin; - $this->lMargin = $this->original_lMargin; - $this->SetCellPadding(0); - //set current position - if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->header_margin); - } else { - $this->SetXY($this->original_lMargin, $this->header_margin); - } - $this->SetFont($this->header_font[0], $this->header_font[1], $this->header_font[2]); - $this->Header(); - //restore position - if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->tMargin); - } else { - $this->SetXY($this->original_lMargin, $this->tMargin); - } - $this->_out('Q'); - $this->lasth = $lasth; - $this->thead = $temp_thead; - $this->theadMargins = $temp_theadMargins; - $this->newline = false; - } - } - - /** - * This method is used to render the page footer. - * @access protected - * @since 4.0.012 (2008-07-24) - */ - protected function setFooter() { - //Page footer - // save current graphic settings - $gvars = $this->getGraphicVars(); - // mark this point - $this->footerpos[$this->page] = $this->pagelen[$this->page]; - $this->_out("\n"); - if ($this->print_footer) { - $this->setGraphicVars($this->default_graphic_vars); - $this->current_column = 0; - $this->num_columns = 1; - $temp_thead = $this->thead; - $temp_theadMargins = $this->theadMargins; - $lasth = $this->lasth; - $this->_out('q'); - $this->rMargin = $this->original_rMargin; - $this->lMargin = $this->original_lMargin; - $this->SetCellPadding(0); - //set current position - $footer_y = $this->h - $this->footer_margin; - if ($this->rtl) { - $this->SetXY($this->original_rMargin, $footer_y); - } else { - $this->SetXY($this->original_lMargin, $footer_y); - } - $this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]); - $this->Footer(); - //restore position - if ($this->rtl) { - $this->SetXY($this->original_rMargin, $this->tMargin); - } else { - $this->SetXY($this->original_lMargin, $this->tMargin); - } - $this->_out('Q'); - $this->lasth = $lasth; - $this->thead = $temp_thead; - $this->theadMargins = $temp_theadMargins; - } - // restore graphic settings - $this->setGraphicVars($gvars); - $this->current_column = $gvars['current_column']; - $this->num_columns = $gvars['num_columns']; - // calculate footer length - $this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page] + 1; - } - - /** - * This method is used to render the table header on new page (if any). - * @access protected - * @since 4.5.030 (2009-03-25) - */ - protected function setTableHeader() { - if ($this->num_columns > 1) { - // multi column mode - return; - } - if (isset($this->theadMargins['top'])) { - // restore the original top-margin - $this->tMargin = $this->theadMargins['top']; - $this->pagedim[$this->page]['tm'] = $this->tMargin; - $this->y = $this->tMargin; - } - if (!$this->empty_string($this->thead) AND (!$this->inthead)) { - // set margins - $prev_lMargin = $this->lMargin; - $prev_rMargin = $this->rMargin; - $prev_cell_padding = $this->cell_padding; - $this->lMargin = $this->theadMargins['lmargin'] + ($this->pagedim[$this->page]['olm'] - $this->pagedim[$this->theadMargins['page']]['olm']); - $this->rMargin = $this->theadMargins['rmargin'] + ($this->pagedim[$this->page]['orm'] - $this->pagedim[$this->theadMargins['page']]['orm']); - $this->cell_padding = $this->theadMargins['cell_padding']; - if ($this->rtl) { - $this->x = $this->w - $this->rMargin; - } else { - $this->x = $this->lMargin; - } - // print table header - $this->writeHTML($this->thead, false, false, false, false, ''); - // set new top margin to skip the table headers - if (!isset($this->theadMargins['top'])) { - $this->theadMargins['top'] = $this->tMargin; - } - $this->tMargin = $this->y; - $this->pagedim[$this->page]['tm'] = $this->tMargin; - $this->lasth = 0; - $this->lMargin = $prev_lMargin; - $this->rMargin = $prev_rMargin; - $this->cell_padding = $prev_cell_padding; - } - } - - /** - * Returns the current page number. - * @return int page number - * @access public - * @since 1.0 - * @see AliasNbPages(), getAliasNbPages() - */ - public function PageNo() { - return $this->page; - } - - /** - * Defines a new spot color. - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param int $c Cyan color for CMYK. Value between 0 and 255 - * @param int $m Magenta color for CMYK. Value between 0 and 255 - * @param int $y Yellow color for CMYK. Value between 0 and 255 - * @param int $k Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 4.0.024 (2008-09-12) - * @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor() - */ - public function AddSpotColor($name, $c, $m, $y, $k) { - if (!isset($this->spot_colors[$name])) { - $i = 1 + count($this->spot_colors); - $this->spot_colors[$name] = array('i' => $i, 'c' => $c, 'm' => $m, 'y' => $y, 'k' => $k); - } - } - - /** - * Defines the color used for all drawing operations (lines, rectangles and cell borders). - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @param boolean $ret if true do not send the command. - * @return string the PDF command - * @access public - * @since 3.1.000 (2008-06-11) - * @see SetDrawColor() - */ - public function SetDrawColorArray($color, $ret=false) { - if (is_array($color)) { - $color = array_values($color); - $r = isset($color[0]) ? $color[0] : -1; - $g = isset($color[1]) ? $color[1] : -1; - $b = isset($color[2]) ? $color[2] : -1; - $k = isset($color[3]) ? $color[3] : -1; - if ($r >= 0) { - return $this->SetDrawColor($r, $g, $b, $k, $ret); - } - } - return ''; - } - - /** - * Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @param boolean $ret if true do not send the command. - * @return string the PDF command - * @access public - * @since 1.3 - * @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell() - */ - public function SetDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false) { - // set default values - if (!is_numeric($col1)) { - $col1 = 0; - } - if (!is_numeric($col2)) { - $col2 = -1; - } - if (!is_numeric($col3)) { - $col3 = -1; - } - if (!is_numeric($col4)) { - $col4 = -1; - } - //Set color for all stroking operations - if (($col2 == -1) AND ($col3 == -1) AND ($col4 == -1)) { - // Grey scale - $this->DrawColor = sprintf('%.3F G', $col1/255); - $this->strokecolor = array('G' => $col1); - } elseif ($col4 == -1) { - // RGB - $this->DrawColor = sprintf('%.3F %.3F %.3F RG', $col1/255, $col2/255, $col3/255); - $this->strokecolor = array('R' => $col1, 'G' => $col2, 'B' => $col3); - } else { - // CMYK - $this->DrawColor = sprintf('%.3F %.3F %.3F %.3F K', $col1/100, $col2/100, $col3/100, $col4/100); - $this->strokecolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4); - } - if ($this->page > 0) { - if (!$ret) { - $this->_out($this->DrawColor); - } - return $this->DrawColor; - } - return ''; - } - - /** - * Defines the spot color used for all drawing operations (lines, rectangles and cell borders). - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor() - */ - public function SetDrawSpotColor($name, $tint=100) { - if (!isset($this->spot_colors[$name])) { - $this->Error('Undefined spot color: '.$name); - } - $this->DrawColor = sprintf('/CS%d CS %.3F SCN', $this->spot_colors[$name]['i'], $tint/100); - if ($this->page > 0) { - $this->_out($this->DrawColor); - } - } - - /** - * Defines the color used for all filling operations (filled rectangles and cell backgrounds). - * It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @access public - * @since 3.1.000 (2008-6-11) - * @see SetFillColor() - */ - public function SetFillColorArray($color) { - if (is_array($color)) { - $color = array_values($color); - $r = isset($color[0]) ? $color[0] : -1; - $g = isset($color[1]) ? $color[1] : -1; - $b = isset($color[2]) ? $color[2] : -1; - $k = isset($color[3]) ? $color[3] : -1; - if ($r >= 0) { - $this->SetFillColor($r, $g, $b, $k); - } - } - } - - /** - * Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 1.3 - * @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell() - */ - public function SetFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1) { - // set default values - if (!is_numeric($col1)) { - $col1 = 0; - } - if (!is_numeric($col2)) { - $col2 = -1; - } - if (!is_numeric($col3)) { - $col3 = -1; - } - if (!is_numeric($col4)) { - $col4 = -1; - } - //Set color for all filling operations - if (($col2 == -1) AND ($col3 == -1) AND ($col4 == -1)) { - // Grey scale - $this->FillColor = sprintf('%.3F g', $col1/255); - $this->bgcolor = array('G' => $col1); - } elseif ($col4 == -1) { - // RGB - $this->FillColor = sprintf('%.3F %.3F %.3F rg', $col1/255, $col2/255, $col3/255); - $this->bgcolor = array('R' => $col1, 'G' => $col2, 'B' => $col3); - } else { - // CMYK - $this->FillColor = sprintf('%.3F %.3F %.3F %.3F k', $col1/100, $col2/100, $col3/100, $col4/100); - $this->bgcolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4); - } - $this->ColorFlag = ($this->FillColor != $this->TextColor); - if ($this->page > 0) { - $this->_out($this->FillColor); - } - } - - /** - * Defines the spot color used for all filling operations (filled rectangles and cell backgrounds). - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor() - */ - public function SetFillSpotColor($name, $tint=100) { - if (!isset($this->spot_colors[$name])) { - $this->Error('Undefined spot color: '.$name); - } - $this->FillColor = sprintf('/CS%d cs %.3F scn', $this->spot_colors[$name]['i'], $tint/100); - $this->ColorFlag = ($this->FillColor != $this->TextColor); - if ($this->page > 0) { - $this->_out($this->FillColor); - } - } - - /** - * Defines the color used for text. It can be expressed in RGB components or gray scale. - * The method can be called before the first page is created and the value is retained from page to page. - * @param array $color array of colors - * @access public - * @since 3.1.000 (2008-6-11) - * @see SetFillColor() - */ - public function SetTextColorArray($color) { - if (is_array($color)) { - $color = array_values($color); - $r = isset($color[0]) ? $color[0] : -1; - $g = isset($color[1]) ? $color[1] : -1; - $b = isset($color[2]) ? $color[2] : -1; - $k = isset($color[3]) ? $color[3] : -1; - if ($r >= 0) { - $this->SetTextColor($r, $g, $b, $k); - } - } - } - - /** - * Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. - * @param int $col1 Gray level for single color, or Red color for RGB, or Cyan color for CMYK. Value between 0 and 255 - * @param int $col2 Green color for RGB, or Magenta color for CMYK. Value between 0 and 255 - * @param int $col3 Blue color for RGB, or Yellow color for CMYK. Value between 0 and 255 - * @param int $col4 Key (Black) color for CMYK. Value between 0 and 255 - * @access public - * @since 1.3 - * @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell() - */ - public function SetTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1) { - // set default values - if (!is_numeric($col1)) { - $col1 = 0; - } - if (!is_numeric($col2)) { - $col2 = -1; - } - if (!is_numeric($col3)) { - $col3 = -1; - } - if (!is_numeric($col4)) { - $col4 = -1; - } - //Set color for text - if (($col2 == -1) AND ($col3 == -1) AND ($col4 == -1)) { - // Grey scale - $this->TextColor = sprintf('%.3F g', $col1/255); - $this->fgcolor = array('G' => $col1); - } elseif ($col4 == -1) { - // RGB - $this->TextColor = sprintf('%.3F %.3F %.3F rg', $col1/255, $col2/255, $col3/255); - $this->fgcolor = array('R' => $col1, 'G' => $col2, 'B' => $col3); - } else { - // CMYK - $this->TextColor = sprintf('%.3F %.3F %.3F %.3F k', $col1/100, $col2/100, $col3/100, $col4/100); - $this->fgcolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4); - } - $this->ColorFlag = ($this->FillColor != $this->TextColor); - } - - /** - * Defines the spot color used for text. - * @param string $name name of the spot color - * @param int $tint the intensity of the color (from 0 to 100 ; 100 = full intensity by default). - * @access public - * @since 4.0.024 (2008-09-12) - * @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor() - */ - public function SetTextSpotColor($name, $tint=100) { - if (!isset($this->spot_colors[$name])) { - $this->Error('Undefined spot color: '.$name); - } - $this->TextColor = sprintf('/CS%d cs %.3F scn', $this->spot_colors[$name]['i'], $tint/100); - $this->ColorFlag = ($this->FillColor != $this->TextColor); - if ($this->page > 0) { - $this->_out($this->TextColor); - } - } - - /** - * Returns the length of a string in user unit. A font must be selected.<br> - * @param string $s The string whose length is to be computed - * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line-trough</li><li>O: overline</li></ul> or any combination. The default value is regular. - * @param float $fontsize Font size in points. The default value is the current size. - * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths - * @author Nicola Asuni - * @access public - * @since 1.2 - */ - public function GetStringWidth($s, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { - return $this->GetArrStringWidth($this->utf8Bidi($this->UTF8StringToArray($s), $s, $this->tmprtl), $fontname, $fontstyle, $fontsize, $getarray); - } - - /** - * Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.<br> - * @param string $sa The array of chars whose total length is to be computed - * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. - * @param string $fontstyle Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li><li>O: overline</li></ul> or any combination. The default value is regular. - * @param float $fontsize Font size in points. The default value is the current size. - * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. - * @return mixed int total string length or array of characted widths - * @author Nicola Asuni - * @access public - * @since 2.4.000 (2008-03-06) - */ - public function GetArrStringWidth($sa, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { - // store current values - if (!$this->empty_string($fontname)) { - $prev_FontFamily = $this->FontFamily; - $prev_FontStyle = $this->FontStyle; - $prev_FontSizePt = $this->FontSizePt; - $this->SetFont($fontname, $fontstyle, $fontsize); - } - // convert UTF-8 array to Latin1 if required - $sa = $this->UTF8ArrToLatin1($sa); - $w = 0; // total width - $wa = array(); // array of characters widths - foreach ($sa as $ck => $char) { - // character width - $cw = $this->GetCharWidth($char, isset($sa[($ck + 1)])); - $wa[] = $cw; - $w += $cw; - } - // restore previous values - if (!$this->empty_string($fontname)) { - $this->SetFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt); - } - if ($getarray) { - return $wa; - } - return $w; - } - - /** - * Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking/kerning). - * @param int $char The char code whose length is to be returned - * @param boolean $notlast set to false for the latest character on string, true otherwise (default) - * @return float char width - * @author Nicola Asuni - * @access public - * @since 2.4.000 (2008-03-06) - */ - public function GetCharWidth($char, $notlast=true) { - // get raw width - $chw = $this->getRawCharWidth($char); - if (($this->font_spacing != 0) AND $notlast) { - // increase/decrease font spacing - $chw += $this->font_spacing; - } - if ($this->font_stretching != 100) { - // fixed stretching mode - $chw *= ($this->font_stretching / 100); - } - return $chw; - } - - /** - * Returns the length of the char in user unit for the current font. - * @param int $char The char code whose length is to be returned - * @return float char width - * @author Nicola Asuni - * @access public - * @since 5.9.000 (2010-09-28) - */ - public function getRawCharWidth($char) { - if ($char == 173) { - // SHY character will not be printed - return (0); - } - $cw = &$this->CurrentFont['cw']; - if (isset($cw[$char])) { - $w = $cw[$char]; - } elseif (isset($this->CurrentFont['dw'])) { - // default width - $w = $this->CurrentFont['dw']; - } elseif (isset($cw[32])) { - // default width - $w = $cw[32]; - } else { - $w = 600; - } - return ($w * $this->FontSize / 1000); - } - - /** - * Returns the numbero of characters in a string. - * @param string $s The input string. - * @return int number of characters - * @access public - * @since 2.0.0001 (2008-01-07) - */ - public function GetNumChars($s) { - if ($this->isUnicodeFont()) { - return count($this->UTF8StringToArray($s)); - } - return strlen($s); - } - - /** - * Fill the list of available fonts ($this->fontlist). - * @access protected - * @since 4.0.013 (2008-07-28) - */ - protected function getFontsList() { - $fontsdir = opendir($this->_getfontpath()); - while (($file = readdir($fontsdir)) !== false) { - if (substr($file, -4) == '.php') { - array_push($this->fontlist, strtolower(basename($file, '.php'))); - } - } - closedir($fontsdir); - } - - /** - * Imports a TrueType, Type1, core, or CID0 font and makes it available. - * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). - * The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. - * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. - * @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular (default)</li><li>B: bold</li><li>I: italic</li><li>BI or IB: bold italic</li></ul> - * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @return array containing the font data, or false in case of error. - * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. - * @access public - * @since 1.5 - * @see SetFont(), setFontSubsetting() - */ - public function AddFont($family, $style='', $fontfile='', $subset='default') { - if ($subset === 'default') { - $subset = $this->font_subsetting; - } - if ($this->empty_string($family)) { - if (!$this->empty_string($this->FontFamily)) { - $family = $this->FontFamily; - } else { - $this->Error('Empty font family'); - } - } - // move embedded styles on $style - if (substr($family, -1) == 'I') { - $style .= 'I'; - $family = substr($family, 0, -1); - } - if (substr($family, -1) == 'B') { - $style .= 'B'; - $family = substr($family, 0, -1); - } - // normalize family name - $family = strtolower($family); - if ((!$this->isunicode) AND ($family == 'arial')) { - $family = 'helvetica'; - } - if (($family == 'symbol') OR ($family == 'zapfdingbats')) { - $style = ''; - } - $tempstyle = strtoupper($style); - $style = ''; - // underline - if (strpos($tempstyle, 'U') !== false) { - $this->underline = true; - } else { - $this->underline = false; - } - // line-through (deleted) - if (strpos($tempstyle, 'D') !== false) { - $this->linethrough = true; - } else { - $this->linethrough = false; - } - // overline - if (strpos($tempstyle, 'O') !== false) { - $this->overline = true; - } else { - $this->overline = false; - } - // bold - if (strpos($tempstyle, 'B') !== false) { - $style .= 'B'; - } - // oblique - if (strpos($tempstyle, 'I') !== false) { - $style .= 'I'; - } - $bistyle = $style; - $fontkey = $family.$style; - $font_style = $style.($this->underline ? 'U' : '').($this->linethrough ? 'D' : '').($this->overline ? 'O' : ''); - $fontdata = array('fontkey' => $fontkey, 'family' => $family, 'style' => $font_style); - // check if the font has been already added - $fb = $this->getFontBuffer($fontkey); - if ($fb !== false) { - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $fb['i']; - } - return $fontdata; - } - if (isset($type)) { - unset($type); - } - if (isset($cw)) { - unset($cw); - } - // get specified font directory (if any) - $fontdir = false; - if (!$this->empty_string($fontfile)) { - $fontdir = dirname($fontfile); - if ($this->empty_string($fontdir) OR ($fontdir == '.')) { - $fontdir = ''; - } else { - $fontdir .= '/'; - } - } - // search and include font file - if ($this->empty_string($fontfile) OR (!file_exists($fontfile))) { - // build a standard filenames for specified font - $fontfile1 = str_replace(' ', '', $family).strtolower($style).'.php'; - $fontfile2 = str_replace(' ', '', $family).'.php'; - // search files on various directories - if (($fontdir !== false) AND file_exists($fontdir.$fontfile1)) { - $fontfile = $fontdir.$fontfile1; - } elseif (file_exists($this->_getfontpath().$fontfile1)) { - $fontfile = $this->_getfontpath().$fontfile1; - } elseif (file_exists($fontfile1)) { - $fontfile = $fontfile1; - } elseif (($fontdir !== false) AND file_exists($fontdir.$fontfile2)) { - $fontfile = $fontdir.$fontfile2; - } elseif (file_exists($this->_getfontpath().$fontfile2)) { - $fontfile = $this->_getfontpath().$fontfile2; - } else { - $fontfile = $fontfile2; - } - } - // include font file - if (file_exists($fontfile)) { - include($fontfile); - } else { - $this->Error('Could not include font definition file: '.$family.''); - } - // check font parameters - if ((!isset($type)) OR (!isset($cw))) { - $this->Error('The font definition file has a bad format: '.$fontfile.''); - } - // SET default parameters - if (!isset($file) OR $this->empty_string($file)) { - $file = ''; - } - if (!isset($enc) OR $this->empty_string($enc)) { - $enc = ''; - } - if (!isset($cidinfo) OR $this->empty_string($cidinfo)) { - $cidinfo = array('Registry'=>'Adobe','Ordering'=>'Identity','Supplement'=>0); - $cidinfo['uni2cid'] = array(); - } - if (!isset($ctg) OR $this->empty_string($ctg)) { - $ctg = ''; - } - if (!isset($desc) OR $this->empty_string($desc)) { - $desc = array(); - } - if (!isset($up) OR $this->empty_string($up)) { - $up = -100; - } - if (!isset($ut) OR $this->empty_string($ut)) { - $ut = 50; - } - if (!isset($cw) OR $this->empty_string($cw)) { - $cw = array(); - } - if (!isset($dw) OR $this->empty_string($dw)) { - // set default width - if (isset($desc['MissingWidth']) AND ($desc['MissingWidth'] > 0)) { - $dw = $desc['MissingWidth']; - } elseif (isset($cw[32])) { - $dw = $cw[32]; - } else { - $dw = 600; - } - } - ++$this->numfonts; - if ($type == 'cidfont0') { - // register CID font (all styles at once) - $styles = array('' => '', 'B' => ',Bold', 'I' => ',Italic', 'BI' => ',BoldItalic'); - $sname = $name.$styles[$bistyle]; - // artificial bold - if (strpos($bistyle, 'B') !== false) { - if (isset($desc['StemV'])) { - $desc['StemV'] *= 2; - } else { - $desc['StemV'] = 120; - } - } - // artificial italic - if (strpos($bistyle, 'I') !== false) { - if (isset($desc['ItalicAngle'])) { - $desc['ItalicAngle'] -= 11; - } else { - $desc['ItalicAngle'] = -11; - } - } - } elseif ($type == 'core') { - $name = $this->CoreFonts[$fontkey]; - $subset = false; - } elseif (($type == 'TrueType') OR ($type == 'Type1')) { - $subset = false; - } elseif ($type == 'TrueTypeUnicode') { - $enc = 'Identity-H'; - } else { - $this->Error('Unknow font type: '.$type.''); - } - // initialize subsetchars to contain default ASCII values (0-255) - $subsetchars = array_fill(0, 256, true); - $this->setFontBuffer($fontkey, array('fontkey' => $fontkey, 'i' => $this->numfonts, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'dw' => $dw, 'enc' => $enc, 'cidinfo' => $cidinfo, 'file' => $file, 'ctg' => $ctg, 'subset' => $subset, 'subsetchars' => $subsetchars)); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $this->numfonts; - } - if (isset($diff) AND (!empty($diff))) { - //Search existing encodings - $d = 0; - $nb = count($this->diffs); - for ($i=1; $i <= $nb; ++$i) { - if ($this->diffs[$i] == $diff) { - $d = $i; - break; - } - } - if ($d == 0) { - $d = $nb + 1; - $this->diffs[$d] = $diff; - } - $this->setFontSubBuffer($fontkey, 'diff', $d); - } - if (!$this->empty_string($file)) { - if (!isset($this->FontFiles[$file])) { - if ((strcasecmp($type,'TrueType') == 0) OR (strcasecmp($type, 'TrueTypeUnicode') == 0)) { - $this->FontFiles[$file] = array('length1' => $originalsize, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); - } elseif ($type != 'core') { - $this->FontFiles[$file] = array('length1' => $size1, 'length2' => $size2, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); - } - } else { - // update fontkeys that are sharing this font file - $this->FontFiles[$file]['subset'] = ($this->FontFiles[$file]['subset'] AND $subset); - if (!in_array($fontkey, $this->FontFiles[$file]['fontkeys'])) { - $this->FontFiles[$file]['fontkeys'][] = $fontkey; - } - } - } - return $fontdata; - } - - /** - * Sets the font used to print character strings. - * The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe). - * The method can be called before the first page is created and the font is retained from page to page. - * If you just wish to change the current font size, it is simpler to call SetFontSize(). - * Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:<ul><li>They are in the current directory (the one where the running script lies)</li><li>They are in one of the directories defined by the include_path parameter</li><li>They are in the directory defined by the K_PATH_FONTS constant</li></ul><br /> - * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):<ul><li>times (Times-Roman)</li><li>timesb (Times-Bold)</li><li>timesi (Times-Italic)</li><li>timesbi (Times-BoldItalic)</li><li>helvetica (Helvetica)</li><li>helveticab (Helvetica-Bold)</li><li>helveticai (Helvetica-Oblique)</li><li>helveticabi (Helvetica-BoldOblique)</li><li>courier (Courier)</li><li>courierb (Courier-Bold)</li><li>courieri (Courier-Oblique)</li><li>courierbi (Courier-BoldOblique)</li><li>symbol (Symbol)</li><li>zapfdingbats (ZapfDingbats)</li></ul> It is also possible to pass an empty string. In that case, the current family is retained. - * @param string $style Font style. Possible values are (case insensitive):<ul><li>empty string: regular</li><li>B: bold</li><li>I: italic</li><li>U: underline</li><li>D: line trough</li><li>O: overline</li></ul> or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. - * @param float $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 - * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. - * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. - * @author Nicola Asuni - * @access public - * @since 1.0 - * @see AddFont(), SetFontSize() - */ - public function SetFont($family, $style='', $size=0, $fontfile='', $subset='default') { - //Select a font; size given in points - if ($size == 0) { - $size = $this->FontSizePt; - } - // try to add font (if not already added) - $fontdata = $this->AddFont($family, $style, $fontfile, $subset); - $this->FontFamily = $fontdata['family']; - $this->FontStyle = $fontdata['style']; - $this->CurrentFont = $this->getFontBuffer($fontdata['fontkey']); - $this->SetFontSize($size); - } - - /** - * Defines the size of the current font. - * @param float $size The size (in points) - * @param boolean $out if true output the font size command, otherwise only set the font properties. - * @access public - * @since 1.0 - * @see SetFont() - */ - public function SetFontSize($size, $out=true) { - // font size in points - $this->FontSizePt = $size; - // font size in user units - $this->FontSize = $size / $this->k; - // calculate some font metrics - if (isset($this->CurrentFont['desc']['FontBBox'])) { - $bbox = explode(' ', substr($this->CurrentFont['desc']['FontBBox'], 1, -1)); - $font_height = ((intval($bbox[3]) - intval($bbox[1])) * $size / 1000); - } else { - $font_height = $size * 1.219; - } - if (isset($this->CurrentFont['desc']['Ascent']) AND ($this->CurrentFont['desc']['Ascent'] > 0)) { - $font_ascent = ($this->CurrentFont['desc']['Ascent'] * $size / 1000); - } - if (isset($this->CurrentFont['desc']['Descent']) AND ($this->CurrentFont['desc']['Descent'] <= 0)) { - $font_descent = (- $this->CurrentFont['desc']['Descent'] * $size / 1000); - } - if (!isset($font_ascent) AND !isset($font_descent)) { - // core font - $font_ascent = 0.76 * $font_height; - $font_descent = $font_height - $font_ascent; - } elseif (!isset($font_descent)) { - $font_descent = $font_height - $font_ascent; - } elseif (!isset($font_ascent)) { - $font_ascent = $font_height - $font_descent; - } - $this->FontAscent = $font_ascent / $this->k; - $this->FontDescent = $font_descent / $this->k; - if ($out AND ($this->page > 0) AND (isset($this->CurrentFont['i']))) { - $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); - } - } - - /** - * Return the font descent value - * @param string $font font name - * @param string $style font style - * @param float $size The size (in points) - * @return int font descent - * @access public - * @author Nicola Asuni - * @since 4.9.003 (2010-03-30) - */ - public function getFontDescent($font, $style='', $size=0) { - $fontdata = $this->AddFont($font, $style); - $fontinfo = $this->getFontBuffer($fontdata['fontkey']); - if (isset($fontinfo['desc']['Descent']) AND ($fontinfo['desc']['Descent'] <= 0)) { - $descent = (- $fontinfo['desc']['Descent'] * $size / 1000); - } else { - $descent = 1.219 * 0.24 * $size; - } - return ($descent / $this->k); - } - - /** - * Return the font ascent value - * @param string $font font name - * @param string $style font style - * @param float $size The size (in points) - * @return int font ascent - * @access public - * @author Nicola Asuni - * @since 4.9.003 (2010-03-30) - */ - public function getFontAscent($font, $style='', $size=0) { - $fontdata = $this->AddFont($font, $style); - $fontinfo = $this->getFontBuffer($fontdata['fontkey']); - if (isset($fontinfo['desc']['Ascent']) AND ($fontinfo['desc']['Ascent'] > 0)) { - $ascent = ($fontinfo['desc']['Ascent'] * $size / 1000); - } else { - $ascent = 1.219 * 0.76 * $size; - } - return ($ascent / $this->k); - } - - /** - * Defines the default monospaced font. - * @param string $font Font name. - * @access public - * @since 4.5.025 - */ - public function SetDefaultMonospacedFont($font) { - $this->default_monospaced_font = $font; - } - - /** - * Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.<br /> - * The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink(). - * @access public - * @since 1.5 - * @see Cell(), Write(), Image(), Link(), SetLink() - */ - public function AddLink() { - //Create a new internal link - $n = count($this->links) + 1; - $this->links[$n] = array(0, 0); - return $n; - } - - /** - * Defines the page and position a link points to. - * @param int $link The link identifier returned by AddLink() - * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) - * @param int $page Number of target page; -1 indicates the current page. This is the default value - * @access public - * @since 1.5 - * @see AddLink() - */ - public function SetLink($link, $y=0, $page=-1) { - if ($y == -1) { - $y = $this->y; - } - if ($page == -1) { - $page = $this->page; - } - $this->links[$link] = array($page, $y); - } - - /** - * Puts a link on a rectangular area of the page. - * Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param mixed $link URL or identifier returned by AddLink() - * @param int $spaces number of spaces on the text to link - * @access public - * @since 1.5 - * @see AddLink(), Annotation(), Cell(), Write(), Image() - */ - public function Link($x, $y, $w, $h, $link, $spaces=0) { - $this->Annotation($x, $y, $w, $h, $link, array('Subtype'=>'Link'), $spaces); - } - - /** - * Puts a markup annotation on a rectangular area of the page. - * !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!! - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param string $text annotation text or alternate content - * @param array $opt array of options (see section 8.4 of PDF reference 1.7). - * @param int $spaces number of spaces on the text to link - * @access public - * @since 4.0.018 (2008-08-06) - */ - public function Annotation($x, $y, $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { - if ($this->inxobj) { - // store parameters for later use on template - $this->xobjects[$this->xobjid]['annotations'][] = array('x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'text' => $text, 'opt' => $opt, 'spaces' => $spaces); - return; - } - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - // recalculate coordinates to account for graphic transformations - if (isset($this->transfmatrix) AND !empty($this->transfmatrix)) { - for ($i=$this->transfmatrix_key; $i > 0; --$i) { - $maxid = count($this->transfmatrix[$i]) - 1; - for ($j=$maxid; $j >= 0; --$j) { - $ctm = $this->transfmatrix[$i][$j]; - if (isset($ctm['a'])) { - $x = $x * $this->k; - $y = ($this->h - $y) * $this->k; - $w = $w * $this->k; - $h = $h * $this->k; - // top left - $xt = $x; - $yt = $y; - $x1 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; - $y1 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; - // top right - $xt = $x + $w; - $yt = $y; - $x2 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; - $y2 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; - // bottom left - $xt = $x; - $yt = $y - $h; - $x3 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; - $y3 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; - // bottom right - $xt = $x + $w; - $yt = $y - $h; - $x4 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; - $y4 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; - // new coordinates (rectangle area) - $x = min($x1, $x2, $x3, $x4); - $y = max($y1, $y2, $y3, $y4); - $w = (max($x1, $x2, $x3, $x4) - $x) / $this->k; - $h = ($y - min($y1, $y2, $y3, $y4)) / $this->k; - $x = $x / $this->k; - $y = $this->h - ($y / $this->k); - } - } - } - } - if ($this->page <= 0) { - $page = 1; - } else { - $page = $this->page; - } - if (!isset($this->PageAnnots[$page])) { - $this->PageAnnots[$page] = array(); - } - ++$this->n; - $this->PageAnnots[$page][] = array('n' => $this->n, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces); - if ((($opt['Subtype'] == 'FileAttachment') OR ($opt['Subtype'] == 'Sound')) AND (!$this->empty_string($opt['FS'])) AND file_exists($opt['FS']) AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) { - ++$this->n; - $this->embeddedfiles[basename($opt['FS'])] = array('n' => $this->n, 'file' => $opt['FS']); - } - // Add widgets annotation's icons - if (isset($opt['mk']['i']) AND file_exists($opt['mk']['i'])) { - $this->Image($opt['mk']['i'], '', '', 10, 10, '', '', '', false, 300, '', false, false, 0, false, true); - } - if (isset($opt['mk']['ri']) AND file_exists($opt['mk']['ri'])) { - $this->Image($opt['mk']['ri'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); - } - if (isset($opt['mk']['ix']) AND file_exists($opt['mk']['ix'])) { - $this->Image($opt['mk']['ix'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); - } - } - - /** - * Embedd the attached files. - * @since 4.4.000 (2008-12-07) - * @access protected - * @see Annotation() - */ - protected function _putEmbeddedFiles() { - reset($this->embeddedfiles); - foreach ($this->embeddedfiles as $filename => $filedata) { - $data = file_get_contents($filedata['file']); - $filter = ''; - if ($this->compress) { - $data = gzcompress($data); - $filter = ' /Filter /FlateDecode'; - } - $stream = $this->_getrawstream($data, $filedata['n']); - $out = $this->_getobj($filedata['n'])."\n"; - $out .= '<< /Type /EmbeddedFile'.$filter.' /Length '.strlen($stream).' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - - /** - * Prints a text cell at the specified position. - * The origin is on the left of the first charcter, on the baseline. - * This method allows to place a string precisely on the page. - * @param float $x Abscissa of the cell origin - * @param float $y Ordinate of the cell origin - * @param string $txt String to print - * @param int $fstroke outline size in user units (false = disable) - * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). - * @param boolean $ffill if true fills the text - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul> - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible. - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li><li>B : cell bottom</li></ul> - * @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul> - * @param boolean $rtloff if true uses the page top-left corner as origin of axis for $x and $y initial position. - * @access public - * @since 1.0 - * @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell() - */ - public function Text($x, $y, $txt, $fstroke=false, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M', $rtloff=false) { - $textrendermode = $this->textrendermode; - $textstrokewidth = $this->textstrokewidth; - $this->setTextRenderingMode($fstroke, $ffill, $fclip); - $this->SetXY($x, $y, $rtloff); - $this->Cell(0, 0, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign); - // restore previous rendering mode - $this->textrendermode = $textrendermode; - $this->textstrokewidth = $textstrokewidth; - } - - /** - * Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. - * The default implementation returns a value according to the mode selected by SetAutoPageBreak().<br /> - * This method is called automatically and should not be called directly by the application. - * @return boolean - * @access public - * @since 1.4 - * @see SetAutoPageBreak() - */ - public function AcceptPageBreak() { - if ($this->num_columns > 1) { - // multi column mode - if($this->current_column < ($this->num_columns - 1)) { - // go to next column - $this->selectColumn($this->current_column + 1); - } else { - // add a new page - $this->AddPage(); - // set first column - $this->selectColumn(0); - } - // avoid page breaking from checkPageBreak() - return false; - } - return $this->AutoPageBreak; - } - - /** - * Add page if needed. - * @param float $h Cell height. Default value: 0. - * @param mixed $y starting y position, leave empty for current position. - * @param boolean $addpage if true add a page, otherwise only return the true/false state - * @return boolean true in case of page break, false otherwise. - * @since 3.2.000 (2008-07-01) - * @access protected - */ - protected function checkPageBreak($h=0, $y='', $addpage=true) { - if ($this->empty_string($y)) { - $y = $this->y; - } - $current_page = $this->page; - if ((($y + $h) > $this->PageBreakTrigger) AND (!$this->InFooter) AND ($this->AcceptPageBreak())) { - if ($addpage) { - //Automatic page break - $x = $this->x; - $this->AddPage($this->CurOrientation); - $this->y = $this->tMargin; - $oldpage = $this->page - 1; - if ($this->rtl) { - if ($this->pagedim[$this->page]['orm'] != $this->pagedim[$oldpage]['orm']) { - $this->x = $x - ($this->pagedim[$this->page]['orm'] - $this->pagedim[$oldpage]['orm']); - } else { - $this->x = $x; - } - } else { - if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) { - $this->x = $x + ($this->pagedim[$this->page]['olm'] - $this->pagedim[$oldpage]['olm']); - } else { - $this->x = $x; - } - } - } - $this->newline = true; - return true; - } - if ($current_page != $this->page) { - // account for columns mode - $this->newline = true; - return true; - } - return false; - } - - /** - * Removes SHY characters from text. - * Unicode Data:<ul> - * <li>Name : SOFT HYPHEN, commonly abbreviated as SHY</li> - * <li>HTML Entity (decimal): &amp;#173;</li> - * <li>HTML Entity (hex): &amp;#xad;</li> - * <li>HTML Entity (named): &amp;shy;</li> - * <li>How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]</li> - * <li>UTF-8 (hex): 0xC2 0xAD (c2ad)</li> - * <li>UTF-8 character: chr(194).chr(173)</li> - * </ul> - * @param string $txt input string - * @return string without SHY characters. - * @access public - * @since (4.5.019) 2009-02-28 - */ - public function removeSHY($txt='') { - $txt = preg_replace('/([\\xc2]{1}[\\xad]{1})/', '', $txt); - if (!$this->isunicode) { - $txt = preg_replace('/([\\xad]{1})/', '', $txt); - } - return $txt; - } - - /** - * Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br /> - * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param float $w Cell width. If 0, the cell extends up to the right margin. - * @param float $h Cell height. Default value: 0. - * @param string $txt String to print. Default value: empty string. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul> Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul> - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible. - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul> - * @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>C : center</li><li>B : bottom</li></ul> - * @access public - * @since 1.0 - * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak() - */ - public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { - $prev_cell_margin = $this->cell_margin; - $prev_cell_padding = $this->cell_padding; - $this->adjustCellPadding($border); - if (!$ignore_min_height) { - $min_cell_height = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']; - if ($h < $min_cell_height) { - $h = $min_cell_height; - } - } - $this->checkPageBreak($h + $this->cell_margin['T'] + $this->cell_margin['B']); - $this->_out($this->getCellCode($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, true, $calign, $valign)); - $this->cell_padding = $prev_cell_padding; - $this->cell_margin = $prev_cell_margin; - } - - /** - * Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.<br /> - * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param float $w Cell width. If 0, the cell extends up to the right margin. - * @param float $h Cell height. Default value: 0. - * @param string $txt String to print. Default value: empty string. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL languages)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul>Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul> - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param mixed $link URL or identifier returned by AddLink(). - * @param int $stretch font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible. - * @param boolean $ignore_min_height if true ignore automatic minimum height value. - * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:<ul><li>T : cell top</li><li>C : center</li><li>B : cell bottom</li><li>A : font top</li><li>L : font baseline</li><li>D : font bottom</li></ul> - * @param string $valign text vertical alignment inside the cell. Possible values are:<ul><li>T : top</li><li>M : middle</li><li>B : bottom</li></ul> - * @return string containing cell code - * @access protected - * @since 1.0 - * @see Cell() - */ - protected function getCellCode($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { - $prev_cell_margin = $this->cell_margin; - $prev_cell_padding = $this->cell_padding; - $txt = $this->removeSHY($txt); - $rs = ''; //string to be returned - $this->adjustCellPadding($border); - if (!$ignore_min_height) { - $min_cell_height = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']; - if ($h < $min_cell_height) { - $h = $min_cell_height; - } - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h); - $k = $this->k; - if ($this->rtl) { - $x = $this->x - $this->cell_margin['R']; - } else { - $x = $this->x + $this->cell_margin['L']; - } - $y = $this->y + $this->cell_margin['T']; - $prev_font_stretching = $this->font_stretching; - $prev_font_spacing = $this->font_spacing; - // cell vertical alignment - switch ($calign) { - case 'A': { - // font top - switch ($valign) { - case 'T': { - // top - $y -= $this->cell_padding['T']; - break; - } - case 'B': { - // bottom - $y -= ($h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent); - break; - } - default: - case 'C': - case 'M': { - // center - $y -= (($h - $this->FontAscent - $this->FontDescent) / 2); - break; - } - } - break; - } - case 'L': { - // font baseline - switch ($valign) { - case 'T': { - // top - $y -= ($this->cell_padding['T'] + $this->FontAscent); - break; - } - case 'B': { - // bottom - $y -= ($h - $this->cell_padding['B'] - $this->FontDescent); - break; - } - default: - case 'C': - case 'M': { - // center - $y -= (($h + $this->FontAscent - $this->FontDescent) / 2); - break; - } - } - break; - } - case 'D': { - // font bottom - switch ($valign) { - case 'T': { - // top - $y -= ($this->cell_padding['T'] + $this->FontAscent + $this->FontDescent); - break; - } - case 'B': { - // bottom - $y -= ($h - $this->cell_padding['B']); - break; - } - default: - case 'C': - case 'M': { - // center - $y -= (($h + $this->FontAscent + $this->FontDescent) / 2); - break; - } - } - break; - } - case 'B': { - // cell bottom - $y -= $h; - break; - } - case 'C': - case 'M': { - // cell center - $y -= ($h / 2); - break; - } - default: - case 'T': { - // cell top - break; - } - } - // text vertical alignment - switch ($valign) { - case 'T': { - // top - $yt = $y + $this->cell_padding['T']; - break; - } - case 'B': { - // bottom - $yt = $y + $h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent; - break; - } - default: - case 'C': - case 'M': { - // center - $yt = $y + (($h - $this->FontAscent - $this->FontDescent) / 2); - break; - } - } - $basefonty = $yt + $this->FontAscent; - if ($this->empty_string($w) OR ($w <= 0)) { - if ($this->rtl) { - $w = $x - $this->lMargin; - } else { - $w = $this->w - $this->rMargin - $x; - } - } - $s = ''; - // fill and borders - if (is_string($border) AND (strlen($border) == 4)) { - // full border - $border = 1; - } - if ($fill OR ($border == 1)) { - if ($fill) { - $op = ($border == 1) ? 'B' : 'f'; - } else { - $op = 'S'; - } - if ($this->rtl) { - $xk = (($x - $w) * $k); - } else { - $xk = ($x * $k); - } - $s .= sprintf('%.2F %.2F %.2F %.2F re %s ', $xk, (($this->h - $y) * $k), ($w * $k), (-$h * $k), $op); - } - // draw borders - $s .= $this->getCellBorder($x, $y, $w, $h, $border); - if ($txt != '') { - $txt2 = $txt; - if ($this->isunicode) { - if (($this->CurrentFont['type'] == 'core') OR ($this->CurrentFont['type'] == 'TrueType') OR ($this->CurrentFont['type'] == 'Type1')) { - $txt2 = $this->UTF8ToLatin1($txt2); - } else { - $unicode = $this->UTF8StringToArray($txt); // array of UTF-8 unicode values - $unicode = $this->utf8Bidi($unicode, '', $this->tmprtl); - if (defined('K_THAI_TOPCHARS') AND (K_THAI_TOPCHARS == true)) { - // ---- Fix for bug #2977340 "Incorrect Thai characters position arrangement" ---- - // NOTE: this doesn't work with HTML justification - // Symbols that could overlap on the font top (only works in LTR) - $topchar = array(3611, 3613, 3615, 3650, 3651, 3652); // chars that extends on top - $topsym = array(3633, 3636, 3637, 3638, 3639, 3655, 3656, 3657, 3658, 3659, 3660, 3661, 3662); // symbols with top position - $numchars = count($unicode); // number of chars - $unik = 0; - $uniblock = array(); - $uniblock[$unik] = array(); - $uniblock[$unik][] = $unicode[0]; - // resolve overlapping conflicts by splitting the string in several parts - for ($i = 1; $i < $numchars; ++$i) { - // check if symbols overlaps at top - if (in_array($unicode[$i], $topsym) AND (in_array($unicode[($i - 1)], $topsym) OR in_array($unicode[($i - 1)], $topchar))) { - // move symbols to another array - ++$unik; - $uniblock[$unik] = array(); - $uniblock[$unik][] = $unicode[$i]; - ++$unik; - $uniblock[$unik] = array(); - $unicode[$i] = 0x200b; // Unicode Character 'ZERO WIDTH SPACE' (DEC:8203, U+200B) - } else { - $uniblock[$unik][] = $unicode[$i]; - } - } - // ---- END OF Fix for bug #2977340 - } - $txt2 = $this->arrUTF8ToUTF16BE($unicode, false); - } - } - $txt2 = $this->_escape($txt2); - // get current text width (considering general font stretching and spacing) - $txwidth = $this->GetStringWidth($txt); - $width = $txwidth; - // check for stretch mode - if ($stretch > 0) { - // calculate ratio between cell width and text width - if ($width <= 0) { - $ratio = 1; - } else { - $ratio = (($w - $this->cell_padding['L'] - $this->cell_padding['R']) / $width); - } - // check if stretching is required - if (($ratio < 1) OR (($ratio > 1) AND (($stretch % 2) == 0))) { - // the text will be stretched to fit cell width - if ($stretch > 2) { - // set new character spacing - $this->font_spacing += ($w - $this->cell_padding['L'] - $this->cell_padding['R'] - $width) / (max(($this->GetNumChars($txt) - 1), 1) * ($this->font_stretching / 100)); - } else { - // set new horizontal stretching - $this->font_stretching *= $ratio; - } - // recalculate text width (the text fills the entire cell) - $width = $w - $this->cell_padding['L'] - $this->cell_padding['R']; - // reset alignment - $align = ''; - } - } - if ($this->font_stretching != 100) { - // apply font stretching - $rs .= sprintf('BT %.2F Tz ET ', $this->font_stretching); - } - if ($this->font_spacing != 0) { - // increase/decrease font spacing - $rs .= sprintf('BT %.2F Tc ET ', ($this->font_spacing * $this->k)); - } - if ($this->ColorFlag) { - $s .= 'q '.$this->TextColor.' '; - } - // rendering mode - $s .= sprintf('BT %d Tr %.2F w ET ', $this->textrendermode, $this->textstrokewidth); - // count number of spaces - $ns = substr_count($txt, chr(32)); - // Justification - $spacewidth = 0; - if (($align == 'J') AND ($ns > 0)) { - if ($this->isUnicodeFont()) { - // get string width without spaces - $width = $this->GetStringWidth(str_replace(' ', '', $txt)); - // calculate average space width - $spacewidth = -1000 * ($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1) / $this->FontSize; - if ($this->font_stretching != 100) { - // word spacing is affected by stretching - $spacewidth /= ($this->font_stretching / 100); - } - // set word position to be used with TJ operator - $txt2 = str_replace(chr(0).chr(32), ') '.sprintf('%.3F', $spacewidth).' (', $txt2); - $unicode_justification = true; - } else { - // get string width - $width = $txwidth; - // new space width - $spacewidth = (($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)) * $this->k; - if ($this->font_stretching != 100) { - // word spacing (Tw) is affected by stretching - $spacewidth /= ($this->font_stretching / 100); - } - // set word spacing - $rs .= sprintf('BT %.3F Tw ET ', $spacewidth); - } - $width = $w - $this->cell_padding['L'] - $this->cell_padding['R']; - } - // replace carriage return characters - $txt2 = str_replace("\r", ' ', $txt2); - switch ($align) { - case 'C': { - $dx = ($w - $width) / 2; - break; - } - case 'R': { - if ($this->rtl) { - $dx = $this->cell_padding['R']; - } else { - $dx = $w - $width - $this->cell_padding['R']; - } - break; - } - case 'L': { - if ($this->rtl) { - $dx = $w - $width - $this->cell_padding['L']; - } else { - $dx = $this->cell_padding['L']; - } - break; - } - case 'J': - default: { - if ($this->rtl) { - $dx = $this->cell_padding['R']; - } else { - $dx = $this->cell_padding['L']; - } - break; - } - } - if ($this->rtl) { - $xdx = $x - $dx - $width; - } else { - $xdx = $x + $dx; - } - $xdk = $xdx * $k; - // print text - $s .= sprintf('BT %.2F %.2F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2); - if (isset($uniblock)) { - // print overlapping characters as separate string - $xshift = 0; // horizontal shift - $ty = (($this->h - $basefonty + (0.2 * $this->FontSize)) * $k); - $spw = (($w - $txwidth - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)); - foreach ($uniblock as $uk => $uniarr) { - if (($uk % 2) == 0) { - // x space to skip - if ($spacewidth != 0) { - // justification shift - $xshift += (count(array_keys($uniarr, 32)) * $spw); - } - $xshift += $this->GetArrStringWidth($uniarr); // + shift justification - } else { - // character to print - $topchr = $this->arrUTF8ToUTF16BE($uniarr, false); - $topchr = $this->_escape($topchr); - $s .= sprintf(' BT %.2F %.2F Td [(%s)] TJ ET', ($xdk + ($xshift * $k)), $ty, $topchr); - } - } - } - if ($this->underline) { - $s .= ' '.$this->_dounderlinew($xdx, $basefonty, $width); - } - if ($this->linethrough) { - $s .= ' '.$this->_dolinethroughw($xdx, $basefonty, $width); - } - if ($this->overline) { - $s .= ' '.$this->_dooverlinew($xdx, $basefonty, $width); - } - if ($this->ColorFlag) { - $s .= ' Q'; - } - if ($link) { - $this->Link($xdx, $yt, $width, ($this->FontAscent + $this->FontDescent), $link, $ns); - } - } - // output cell - if ($s) { - // output cell - $rs .= $s; - if ($this->font_spacing != 0) { - // reset font spacing mode - $rs .= ' BT 0 Tc ET'; - } - if ($this->font_stretching != 100) { - // reset font stretching mode - $rs .= ' BT 100 Tz ET'; - } - } - // reset word spacing - if (!$this->isUnicodeFont() AND ($align == 'J')) { - $rs .= ' BT 0 Tw ET'; - } - // reset stretching and spacing - $this->font_stretching = $prev_font_stretching; - $this->font_spacing = $prev_font_spacing; - $this->lasth = $h; - if ($ln > 0) { - //Go to the beginning of the next line - $this->y = $y + $h + $this->cell_margin['B']; - if ($ln == 1) { - if ($this->rtl) { - $this->x = $this->w - $this->rMargin; - } else { - $this->x = $this->lMargin; - } - } - } else { - // go left or right by case - if ($this->rtl) { - $this->x = $x - $w - $this->cell_margin['L']; - } else { - $this->x = $x + $w + $this->cell_margin['R']; - } - } - $gstyles = ''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor."\n"; - $rs = $gstyles.$rs; - $this->cell_padding = $prev_cell_padding; - $this->cell_margin = $prev_cell_margin; - return $rs; - } - - /** - * Returns the code to draw the cell border - * @param float $x X coordinate. - * @param float $y Y coordinate. - * @param float $w Cell width. - * @param float $h Cell height. - * @param mixed $brd Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param string $mode border position respect the square edge: normal: centered; ext: external; int: internal; - * @return string containing cell border code - * @access protected - * @see SetLineStyle() - * @since 5.7.000 (2010-08-02) - */ - protected function getCellBorder($x, $y, $w, $h, $brd) { - $s = ''; // string to be returned - if (empty($brd)) { - return $s; - } - if ($brd == 1) { - $brd = array('LRTB' => true); - } - // calculate coordinates for border - $k = $this->k; - if ($this->rtl) { - $xeL = ($x - $w) * $k; - $xeR = $x * $k; - } else { - $xeL = $x * $k; - $xeR = ($x + $w) * $k; - } - $yeL = (($this->h - ($y + $h)) * $k); - $yeT = (($this->h - $y) * $k); - $xeT = $xeL; - $xeB = $xeR; - $yeR = $yeT; - $yeB = $yeL; - if (is_string($brd)) { - // convert string to array - $slen = strlen($brd); - $newbrd = array(); - for ($i = 0; $i < $slen; ++$i) { - $newbrd[$brd{$i}] = array('cap' => 'square', 'join' => 'miter'); - } - $brd = $newbrd; - } - if (isset($brd['mode'])) { - $mode = $brd['mode']; - unset($brd['mode']); - } else { - $mode = 'normal'; - } - foreach ($brd as $border => $style) { - if (is_array($style) AND !empty($style)) { - // apply border style - $prev_style = $this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '; - $s .= $this->SetLineStyle($style, true)."\n"; - } - switch ($mode) { - case 'ext': { - $off = (($this->LineWidth / 2) * $k); - $xL = $xeL - $off; - $xR = $xeR + $off; - $yT = $yeT + $off; - $yL = $yeL - $off; - $xT = $xL; - $xB = $xR; - $yR = $yT; - $yB = $yL; - $w += $this->LineWidth; - $h += $this->LineWidth; - break; - } - case 'int': { - $off = ($this->LineWidth / 2) * $k; - $xL = $xeL + $off; - $xR = $xeR - $off; - $yT = $yeT - $off; - $yL = $yeL + $off; - $xT = $xL; - $xB = $xR; - $yR = $yT; - $yB = $yL; - $w -= $this->LineWidth; - $h -= $this->LineWidth; - break; - } - case 'normal': - default: { - $xL = $xeL; - $xT = $xeT; - $xB = $xeB; - $xR = $xeR; - $yL = $yeL; - $yT = $yeT; - $yB = $yeB; - $yR = $yeR; - break; - } - } - // draw borders by case - if (strlen($border) == 4) { - $s .= sprintf('%.2F %.2F %.2F %.2F re S ', $xT, $yT, ($w * $k), (-$h * $k)); - } elseif (strlen($border) == 3) { - if (strpos($border,'B') === false) { // LTR - $s .= sprintf('%.2F %.2F m ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= 'S '; - } elseif (strpos($border,'L') === false) { // TRB - $s .= sprintf('%.2F %.2F m ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= 'S '; - } elseif (strpos($border,'T') === false) { // RBL - $s .= sprintf('%.2F %.2F m ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= 'S '; - } elseif (strpos($border,'R') === false) { // BLT - $s .= sprintf('%.2F %.2F m ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= 'S '; - } - } elseif (strlen($border) == 2) { - if ((strpos($border,'L') !== false) AND (strpos($border,'T') !== false)) { // LT - $s .= sprintf('%.2F %.2F m ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= 'S '; - } elseif ((strpos($border,'T') !== false) AND (strpos($border,'R') !== false)) { // TR - $s .= sprintf('%.2F %.2F m ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= 'S '; - } elseif ((strpos($border,'R') !== false) AND (strpos($border,'B') !== false)) { // RB - $s .= sprintf('%.2F %.2F m ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= 'S '; - } elseif ((strpos($border,'B') !== false) AND (strpos($border,'L') !== false)) { // BL - $s .= sprintf('%.2F %.2F m ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= 'S '; - } elseif ((strpos($border,'L') !== false) AND (strpos($border,'R') !== false)) { // LR - $s .= sprintf('%.2F %.2F m ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= 'S '; - $s .= sprintf('%.2F %.2F m ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= 'S '; - } elseif ((strpos($border,'T') !== false) AND (strpos($border,'B') !== false)) { // TB - $s .= sprintf('%.2F %.2F m ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= 'S '; - $s .= sprintf('%.2F %.2F m ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= 'S '; - } - } else { // strlen($border) == 1 - if (strpos($border,'L') !== false) { // L - $s .= sprintf('%.2F %.2F m ', $xL, $yL); - $s .= sprintf('%.2F %.2F l ', $xT, $yT); - $s .= 'S '; - } elseif (strpos($border,'T') !== false) { // T - $s .= sprintf('%.2F %.2F m ', $xT, $yT); - $s .= sprintf('%.2F %.2F l ', $xR, $yR); - $s .= 'S '; - } elseif (strpos($border,'R') !== false) { // R - $s .= sprintf('%.2F %.2F m ', $xR, $yR); - $s .= sprintf('%.2F %.2F l ', $xB, $yB); - $s .= 'S '; - } elseif (strpos($border,'B') !== false) { // B - $s .= sprintf('%.2F %.2F m ', $xB, $yB); - $s .= sprintf('%.2F %.2F l ', $xL, $yL); - $s .= 'S '; - } - } - if (is_array($style) AND !empty($style)) { - // reset border style to previous value - $s .= "\n".$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor."\n"; - } - } - return $s; - } - - /** - * This method allows printing text with line breaks. - * They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.<br /> - * Text can be aligned, centered or justified. The cell block can be framed and the background painted. - * @param float $w Width of cells. If 0, they extend up to the right margin of the page. - * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param string $txt String to print - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align</li><li>C: center</li><li>R: right align</li><li>J: justification (default value when $ishtml=false)</li></ul> - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right</li><li>1: to the beginning of the next line [DEFAULT]</li><li>2: below</li></ul> - * @param float $x x position in user units - * @param float $y y position in user units - * @param boolean $reseth if true reset the last cell height (default true). - * @param int $stretch font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible. - * @param boolean $ishtml set to true if $txt is HTML content (default = false). - * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. - * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. - * @param string $valign Vertical alignment of text (requires $maxh = $h > 0). Possible values are:<ul><li>T: TOP</li><li>M: middle</li><li>B: bottom</li></ul>. This feature works only when $ishtml=false. - * @param boolean $fitcell if true attempt to fit all the text within the cell by reducing the font size. - * @return int Return the number of cells or 1 for html mode. - * @access public - * @since 1.3 - * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() - */ - public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) { - $prev_cell_margin = $this->cell_margin; - $prev_cell_padding = $this->cell_padding; - // adjust internal padding - $this->adjustCellPadding($border); - $mc_padding = $this->cell_padding; - $mc_margin = $this->cell_margin; - $this->cell_padding['T'] = 0; - $this->cell_padding['B'] = 0; - $this->setCellMargins(0, 0, 0, 0); - if ($this->empty_string($this->lasth) OR $reseth) { - // reset row height - $this->resetLastH(); - } - if (!$this->empty_string($y)) { - $this->SetY($y); - } else { - $y = $this->GetY(); - } - $resth = 0; - if ((!$this->InFooter) AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) { - // spit cell in more pages/columns - $newh = $this->PageBreakTrigger - $y; - $resth = $h - $newh; // cell to be printed on the next page/column - $h = $newh; - } - // get current page number - $startpage = $this->page; - // get current column - $startcolumn = $this->current_column; - if (!$this->empty_string($x)) { - $this->SetX($x); - } else { - $x = $this->GetX(); - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions(0, $x, $y); - // apply margins - $oy = $y + $mc_margin['T']; - if ($this->rtl) { - $ox = $this->w - $x - $mc_margin['R']; - } else { - $ox = $x + $mc_margin['L']; - } - $this->x = $ox; - $this->y = $oy; - // set width - if ($this->empty_string($w) OR ($w <= 0)) { - if ($this->rtl) { - $w = $this->x - $this->lMargin - $mc_margin['L']; - } else { - $w = $this->w - $this->x - $this->rMargin - $mc_margin['R']; - } - } - // store original margin values - $lMargin = $this->lMargin; - $rMargin = $this->rMargin; - if ($this->rtl) { - $this->rMargin = $this->w - $this->x; - $this->lMargin = $this->x - $w; - } else { - $this->lMargin = $this->x; - $this->rMargin = $this->w - $this->x - $w; - } - if ($autopadding) { - // add top padding - $this->y += $mc_padding['T']; - } - if ($ishtml) { // ******* Write HTML text - $this->writeHTML($txt, true, 0, $reseth, true, $align); - $nl = 1; - } else { // ******* Write simple text - // vertical alignment - if ($maxh > 0) { - // get text height - $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); - if ($fitcell) { - $prev_FontSizePt = $this->FontSizePt; - // try to reduce font size to fit text on cell (use a quick search algorithm) - $fmin = 1; - $fmax = $this->FontSizePt; - $prev_text_height = $text_height; - $maxit = 100; // max number of iterations - while ($maxit > 0) { - $fmid = (($fmax + $fmin) / 2); - $this->SetFontSize($fmid, false); - $this->resetLastH(); - $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); - if (($text_height == $maxh) OR (($text_height < $maxh) AND ($fmin >= ($fmax - 0.01)))) { - break; - } elseif ($text_height < $maxh) { - $fmin = $fmid; - } else { - $fmax = $fmid; - } - --$maxit; - } - $this->SetFontSize($this->FontSizePt); - } - if ($text_height < $maxh) { - if ($valign == 'M') { - // text vertically centered - $this->y += (($maxh - $text_height) / 2); - } elseif ($valign == 'B') { - // text vertically aligned on bottom - $this->y += ($maxh - $text_height); - } - } - } - $nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh, 0, $mc_margin); - if ($fitcell) { - // restore font size - $this->SetFontSize($prev_FontSizePt); - } - } - if ($autopadding) { - // add bottom padding - $this->y += $mc_padding['B']; - } - // Get end-of-text Y position - $currentY = $this->y; - // get latest page number - $endpage = $this->page; - if ($resth > 0) { - $skip = ($endpage - $startpage); - $tmpresth = $resth; - while ($tmpresth > 0) { - if ($skip <= 0) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - if ($this->num_columns > 1) { - $tmpresth -= ($this->h - $this->y - $this->bMargin); - } else { - $tmpresth -= ($this->h - $this->tMargin - $this->bMargin); - } - --$skip; - } - $currentY = $this->y; - $endpage = $this->page; - } - // get latest column - $endcolumn = $this->current_column; - if ($this->num_columns == 0) { - $this->num_columns = 1; - } - // get border modes - $border_start = $this->getBorderMode($border, $position='start'); - $border_end = $this->getBorderMode($border, $position='end'); - $border_middle = $this->getBorderMode($border, $position='middle'); - // design borders around HTML cells. - for ($page = $startpage; $page <= $endpage; ++$page) { // for each page - $ccode = ''; - $this->setPage($page); - if ($this->num_columns < 2) { - // single-column mode - $this->SetX($x); - $this->y = $this->tMargin; - } - // account for margin changes - if ($page > $startpage) { - if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); - } - } - if ($startpage == $endpage) { - // single page - for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($this->rtl) { - $this->x -= $mc_margin['R']; - } else { - $this->x += $mc_margin['L']; - } - if ($startcolumn == $endcolumn) { // single column - $cborder = $border; - $h = max($h, ($currentY - $oy)); - $this->y = $oy; - } elseif ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $oy; - $h = $this->h - $this->y - $this->bMargin; - } elseif ($column == $endcolumn) { // end column - $cborder = $border_end; - $h = $currentY - $this->y; - if ($resth > $h) { - $h = $resth; - } - } else { // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - $resth -= $h; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $startpage) { // first page - for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - if ($this->rtl) { - $this->x -= $mc_margin['R']; - } else { - $this->x += $mc_margin['L']; - } - if ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $oy; - $h = $this->h - $this->y - $this->bMargin; - } else { // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - $resth -= $h; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $endpage) { // last page - for ($column = 0; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($this->rtl) { - $this->x -= $mc_margin['R']; - } else { - $this->x += $mc_margin['L']; - } - if ($column == $endcolumn) { - // end column - $cborder = $border_end; - $h = $currentY - $this->y; - if ($resth > $h) { - $h = $resth; - } - } else { - // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - $resth -= $h; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } else { // middle page - for ($column = 0; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - if ($this->rtl) { - $this->x -= $mc_margin['R']; - } else { - $this->x += $mc_margin['L']; - } - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - $resth -= $h; - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } - if ($cborder OR $fill) { - // draw border and fill - if ($this->inxobj) { - // we are inside an XObject template - if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { - $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); - $pagemark = &$this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; - } else { - $pagemark = &$this->xobjects[$this->xobjid]['intmrk']; - } - $pagebuff = $this->xobjects[$this->xobjid]['outdata']; - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; - $pagemark += strlen($ccode); - } else { - if (end($this->transfmrk[$this->page]) !== false) { - $pagemarkkey = key($this->transfmrk[$this->page]); - $pagemark = &$this->transfmrk[$this->page][$pagemarkkey]; - } elseif ($this->InFooter) { - $pagemark = &$this->footerpos[$this->page]; - } else { - $pagemark = &$this->intmrk[$this->page]; - } - $pagebuff = $this->getPageBuffer($this->page); - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->setPageBuffer($this->page, $pstart.$ccode.$pend); - $pagemark += strlen($ccode); - } - } - } // end for each page - // Get end-of-cell Y position - $currentY = $this->GetY(); - // restore original margin values - $this->SetLeftMargin($lMargin); - $this->SetRightMargin($rMargin); - if ($ln > 0) { - //Go to the beginning of the next line - $this->SetY($currentY + $mc_margin['B']); - if ($ln == 2) { - $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']); - } - } else { - // go left or right by case - $this->setPage($startpage); - $this->y = $y; - $this->SetX($x + $w + $mc_margin['L'] + $mc_margin['R']); - } - $this->setContentMark(); - $this->cell_padding = $prev_cell_padding; - $this->cell_margin = $prev_cell_margin; - return $nl; - } - - /** - * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) - * @param mixed $brd Indicates if borders must be drawn around the cell block. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul>or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param string multicell position: 'start', 'middle', 'end' - * @return border mode array - * @access protected - * @since 4.4.002 (2008-12-09) - */ - protected function getBorderMode($brd, $position='start') { - if ((!$this->opencell) OR empty($brd)) { - return $brd; - } - if ($brd == 1) { - $brd = 'LTRB'; - } - if (is_string($brd)) { - // convert string to array - $slen = strlen($brd); - $newbrd = array(); - for ($i = 0; $i < $slen; ++$i) { - $newbrd[$brd{$i}] = array('cap' => 'square', 'join' => 'miter'); - } - $brd = $newbrd; - } - foreach ($brd as $border => $style) { - switch ($position) { - case 'start': { - if (strpos($border, 'B') !== false) { - // remove bottom line - $newkey = str_replace('B', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - case 'middle': { - if (strpos($border, 'B') !== false) { - // remove bottom line - $newkey = str_replace('B', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - $border = $newkey; - } - if (strpos($border, 'T') !== false) { - // remove bottom line - $newkey = str_replace('T', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - case 'end': { - if (strpos($border, 'T') !== false) { - // remove bottom line - $newkey = str_replace('T', '', $border); - if (strlen($newkey) > 0) { - $brd[$newkey] = $style; - } - unset($brd[$border]); - } - break; - } - } - } - return $brd; - } - - /** - * This method return the estimated number of lines for print a simple text string using Multicell() method. - * @param string $txt String for calculating his height - * @param float $w Width of cells. If 0, they extend up to the right margin of the page. - * @param boolean $reseth if true reset the last cell height (default false). - * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). - * @param float $cellpadding Internal cell padding, if empty uses default cell padding. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @return float Return the minimal height needed for multicell method for printing the $txt param. - * @author Alexander Escalona Fernández, Nicola Asuni - * @access public - * @since 4.5.011 - */ - public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding='', $border=0) { - if ($txt === '') { - // empty string - return 1; - } - // adjust internal padding - $prev_cell_padding = $this->cell_padding; - $prev_lasth = $this->lasth; - if (is_array($cellpadding)) { - $this->cell_padding = $cellpadding; - } - $this->adjustCellPadding($border); - if ($this->empty_string($w) OR ($w <= 0)) { - if ($this->rtl) { - $w = $this->x - $this->lMargin; - } else { - $w = $this->w - $this->rMargin - $this->x; - } - } - $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; - if ($reseth) { - // reset row height - $this->resetLastH(); - } - $lines = 1; - $sum = 0; - $chars = $this->utf8Bidi($this->UTF8StringToArray($txt), $txt, $this->tmprtl); - $charsWidth = $this->GetArrStringWidth($chars, '', '', 0, true); - $length = count($chars); - $lastSeparator = -1; - for ($i = 0; $i < $length; ++$i) { - $charWidth = $charsWidth[$i]; - if (preg_match($this->re_spaces, $this->unichr($chars[$i]))) { - $lastSeparator = $i; - } - if ((($sum + $charWidth) > $wmax) OR ($chars[$i] == 10)) { - ++$lines; - if ($lastSeparator != -1) { - $i = $lastSeparator; - $lastSeparator = -1; - $sum = 0; - } else { - $sum = $charWidth; - } - } else { - $sum += $charWidth; - } - } - if ($chars[($length - 1)] == 10) { - --$lines; - } - $this->cell_padding = $prev_cell_padding; - $this->lasth = $prev_lasth; - return $lines; - } - - /** - * This method return the estimated needed height for print a simple text string in Multicell() method. - * Generally, if you want to know the exact height for a block of content you can use the following alternative technique: - * <pre> - * // store current object - * $pdf->startTransaction(); - * // store starting values - * $start_y = $pdf->GetY(); - * $start_page = $pdf->getPage(); - * // call your printing functions with your parameters - * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0); - * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * // get the new Y - * $end_y = $pdf->GetY(); - * $end_page = $pdf->getPage(); - * // calculate height - * $height = 0; - * if ($end_page == $start_page) { - * $height = $end_y - $start_y; - * } else { - * for ($page=$start_page; $page <= $end_page; ++$page) { - * $this->setPage($page); - * if ($page == $start_page) { - * // first page - * $height = $this->h - $start_y - $this->bMargin; - * } elseif ($page == $end_page) { - * // last page - * $height = $end_y - $this->tMargin; - * } else { - * $height = $this->h - $this->tMargin - $this->bMargin; - * } - * } - * } - * // restore previous object - * $pdf = $pdf->rollbackTransaction(); - * </pre> - * @param float $w Width of cells. If 0, they extend up to the right margin of the page. - * @param string $txt String for calculating his height - * @param boolean $reseth if true reset the last cell height (default false). - * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). - * @param float $cellpadding Internal cell padding, if empty uses default cell padding. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @return float Return the minimal height needed for multicell method for printing the $txt param. - * @author Nicola Asuni, Alexander Escalona Fernández - * @access public - */ - public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding='', $border=0) { - // adjust internal padding - $prev_cell_padding = $this->cell_padding; - $prev_lasth = $this->lasth; - if (is_array($cellpadding)) { - $this->cell_padding = $cellpadding; - } - $this->adjustCellPadding($border); - $lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border); - $height = $lines * ($this->FontSize * $this->cell_height_ratio); - if ($autopadding) { - // add top and bottom padding - $height += ($this->cell_padding['T'] + $this->cell_padding['B']); - } - $this->cell_padding = $prev_cell_padding; - $this->lasth = $prev_lasth; - return $height; - } - - /** - * This method prints text from the current position.<br /> - * @param float $h Line height - * @param string $txt String to print - * @param mixed $link URL or identifier returned by AddLink() - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L or empty string: left align (default value)</li><li>C: center</li><li>R: right align</li><li>J: justify</li></ul> - * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. - * @param int $stretch font stretch mode: <ul><li>0 = disabled</li><li>1 = horizontal scaling only if text is larger than cell width</li><li>2 = forced horizontal scaling to fit cell width</li><li>3 = character spacing only if text is larger than cell width</li><li>4 = forced character spacing to fit cell width</li></ul> General font stretching and scaling values will be preserved when possible. - * @param boolean $firstline if true prints only the first line and return the remaining string. - * @param boolean $firstblock if true the string is the starting of a line. - * @param float $maxh maximum height. The remaining unprinted text will be returned. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. - * @param float $wadj first line width will be reduced by this amount (used in HTML mode). - * @param array $margin margin array of the parent container - * @return mixed Return the number of cells or the remaining string if $firstline = true. - * @access public - * @since 1.5 - */ - public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin='') { - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h); - if (strlen($txt) == 0) { - // fix empty text - $txt = ' '; - } - if ($margin === '') { - // set default margins - $margin = $this->cell_margin; - } - // remove carriage returns - $s = str_replace("\r", '', $txt); - // check if string contains arabic text - if (preg_match($this->unicode->uni_RE_PATTERN_ARABIC, $s)) { - $arabic = true; - } else { - $arabic = false; - } - // check if string contains RTL text - if ($arabic OR ($this->tmprtl == 'R') OR preg_match($this->unicode->uni_RE_PATTERN_RTL, $s)) { - $rtlmode = true; - } else { - $rtlmode = false; - } - // get a char width - $chrwidth = $this->GetCharWidth('.'); - // get array of unicode values - $chars = $this->UTF8StringToArray($s); - // get array of chars - $uchars = $this->UTF8ArrayToUniArray($chars); - // get the number of characters - $nb = count($chars); - // replacement for SHY character (minus symbol) - $shy_replacement = 45; - $shy_replacement_char = $this->unichr($shy_replacement); - // widht for SHY replacement - $shy_replacement_width = $this->GetCharWidth($shy_replacement); - // max Y - $maxy = $this->y + $maxh - $h - $this->cell_padding['T'] - $this->cell_padding['B']; - // calculate remaining line width ($w) - if ($this->rtl) { - $w = $this->x - $this->lMargin; - } else { - $w = $this->w - $this->rMargin - $this->x; - } - // max column width - $wmax = $w - $wadj; - if (!$firstline) { - $wmax -= ($this->cell_padding['L'] + $this->cell_padding['R']); - } - if ((!$firstline) AND (($chrwidth > $wmax) OR ($this->GetCharWidth($chars[0]) > $wmax))) { - // a single character do not fit on column - return ''; - } - // minimum row height - $row_height = max($h, $this->FontSize * $this->cell_height_ratio); - $start_page = $this->page; - $i = 0; // character position - $j = 0; // current starting position - $sep = -1; // position of the last blank space - $shy = false; // true if the last blank is a soft hypen (SHY) - $l = 0; // current string length - $nl = 0; //number of lines - $linebreak = false; - $pc = 0; // previous character - // for each character - while ($i < $nb) { - if (($maxh > 0) AND ($this->y >= $maxy) ) { - break; - } - //Get the current character - $c = $chars[$i]; - if ($c == 10) { // 10 = "\n" = new line - //Explicit line break - if ($align == 'J') { - if ($this->rtl) { - $talign = 'R'; - } else { - $talign = 'L'; - } - } else { - $talign = $align; - } - $tmpstr = $this->UniArrSubString($uchars, $j, $i); - if ($firstline) { - $startx = $this->x; - $tmparr = array_slice($chars, $j, ($i - $j)); - if ($rtlmode) { - $tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl); - } - $linew = $this->GetArrStringWidth($tmparr); - unset($tmparr); - if ($this->rtl) { - $this->endlinex = $startx - $linew; - } else { - $this->endlinex = $startx + $linew; - } - $w = $linew; - $tmpcellpadding = $this->cell_padding; - if ($maxh == 0) { - $this->SetCellPadding(0); - } - } - if ($firstblock AND $this->isRTLTextDir()) { - $tmpstr = $this->stringRightTrim($tmpstr); - } - // Skip newlines at the begining of a page or column - if (!empty($tmpstr) OR ($this->y < ($this->PageBreakTrigger - $row_height))) { - $this->Cell($w, $h, $tmpstr, 0, 1, $talign, $fill, $link, $stretch); - } - unset($tmpstr); - if ($firstline) { - $this->cell_padding = $tmpcellpadding; - return ($this->UniArrSubString($uchars, $i)); - } - ++$nl; - $j = $i + 1; - $l = 0; - $sep = -1; - $shy = false; - // account for margin changes - if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; - } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; - } - $w = $this->getRemainingWidth(); - $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; - } else { - // 160 is the non-breaking space. - // 173 is SHY (Soft Hypen). - // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. - // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. - // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. - if (($c != 160) AND (($c == 173) OR preg_match($this->re_spaces, $this->unichr($c)))) { - // update last blank space position - $sep = $i; - // check if is a SHY - if ($c == 173) { - $shy = true; - if ($pc == 45) { - $tmp_shy_replacement_width = 0; - $tmp_shy_replacement_char = ''; - } else { - $tmp_shy_replacement_width = $shy_replacement_width; - $tmp_shy_replacement_char = $shy_replacement_char; - } - } else { - $shy = false; - } - } - // update string length - if ($this->isUnicodeFont() AND ($arabic)) { - // with bidirectional algorithm some chars may be changed affecting the line length - // *** very slow *** - $l = $this->GetArrStringWidth($this->utf8Bidi(array_slice($chars, $j, ($i - $j)), '', $this->tmprtl)); - } else { - $l += $this->GetCharWidth($c); - } - if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) ) { - // we have reached the end of column - if ($sep == -1) { - // check if the line was already started - if (($this->rtl AND ($this->x <= ($this->w - $this->rMargin - $chrwidth))) - OR ((!$this->rtl) AND ($this->x >= ($this->lMargin + $chrwidth)))) { - // print a void cell and go to next line - $this->Cell($w, $h, '', 0, 1); - $linebreak = true; - if ($firstline) { - return ($this->UniArrSubString($uchars, $j)); - } - } else { - // truncate the word because do not fit on column - $tmpstr = $this->UniArrSubString($uchars, $j, $i); - if ($firstline) { - $startx = $this->x; - $tmparr = array_slice($chars, $j, ($i - $j)); - if ($rtlmode) { - $tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl); - } - $linew = $this->GetArrStringWidth($tmparr); - unset($tmparr); - if ($this->rtl) { - $this->endlinex = $startx - $linew; - } else { - $this->endlinex = $startx + $linew; - } - $w = $linew; - $tmpcellpadding = $this->cell_padding; - if ($maxh == 0) { - $this->SetCellPadding(0); - } - } - if ($firstblock AND $this->isRTLTextDir()) { - $tmpstr = $this->stringRightTrim($tmpstr); - } - $this->Cell($w, $h, $tmpstr, 0, 1, $align, $fill, $link, $stretch); - unset($tmpstr); - if ($firstline) { - $this->cell_padding = $tmpcellpadding; - return ($this->UniArrSubString($uchars, $i)); - } - $j = $i; - --$i; - } - } else { - // word wrapping - if ($this->rtl AND (!$firstblock) AND ($sep < $i)) { - $endspace = 1; - } else { - $endspace = 0; - } - if ($shy) { - // add hypen (minus symbol) at the end of the line - $shy_width = $tmp_shy_replacement_width; - if ($this->rtl) { - $shy_char_left = $tmp_shy_replacement_char; - $shy_char_right = ''; - } else { - $shy_char_left = ''; - $shy_char_right = $tmp_shy_replacement_char; - } - } else { - $shy_width = 0; - $shy_char_left = ''; - $shy_char_right = ''; - } - $tmpstr = $this->UniArrSubString($uchars, $j, ($sep + $endspace)); - if ($firstline) { - $startx = $this->x; - $tmparr = array_slice($chars, $j, (($sep + $endspace) - $j)); - if ($rtlmode) { - $tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl); - } - $linew = $this->GetArrStringWidth($tmparr); - unset($tmparr); - if ($this->rtl) { - $this->endlinex = $startx - $linew - $shy_width; - } else { - $this->endlinex = $startx + $linew + $shy_width; - } - $w = $linew; - $tmpcellpadding = $this->cell_padding; - if ($maxh == 0) { - $this->SetCellPadding(0); - } - } - // print the line - if ($firstblock AND $this->isRTLTextDir()) { - $tmpstr = $this->stringRightTrim($tmpstr); - } - $this->Cell($w, $h, $shy_char_left.$tmpstr.$shy_char_right, 0, 1, $align, $fill, $link, $stretch); - unset($tmpstr); - if ($firstline) { - // return the remaining text - $this->cell_padding = $tmpcellpadding; - return ($this->UniArrSubString($uchars, ($sep + $endspace))); - } - $i = $sep; - $sep = -1; - $shy = false; - $j = ($i+1); - } - // account for margin changes - if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND (!$this->InFooter)) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; - } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; - } - $w = $this->getRemainingWidth(); - $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; - if ($linebreak) { - $linebreak = false; - } else { - ++$nl; - $l = 0; - } - } - } - // save last character - $pc = $c; - ++$i; - } // end while i < nb - // print last substring (if any) - if ($l > 0) { - switch ($align) { - case 'J': - case 'C': { - $w = $w; - break; - } - case 'L': { - if ($this->rtl) { - $w = $w; - } else { - $w = $l; - } - break; - } - case 'R': { - if ($this->rtl) { - $w = $l; - } else { - $w = $w; - } - break; - } - default: { - $w = $l; - break; - } - } - $tmpstr = $this->UniArrSubString($uchars, $j, $nb); - if ($firstline) { - $startx = $this->x; - $tmparr = array_slice($chars, $j, ($nb - $j)); - if ($rtlmode) { - $tmparr = $this->utf8Bidi($tmparr, $tmpstr, $this->tmprtl); - } - $linew = $this->GetArrStringWidth($tmparr); - unset($tmparr); - if ($this->rtl) { - $this->endlinex = $startx - $linew; - } else { - $this->endlinex = $startx + $linew; - } - $w = $linew; - $tmpcellpadding = $this->cell_padding; - if ($maxh == 0) { - $this->SetCellPadding(0); - } - } - if ($firstblock AND $this->isRTLTextDir()) { - $tmpstr = $this->stringRightTrim($tmpstr); - } - $this->Cell($w, $h, $tmpstr, 0, $ln, $align, $fill, $link, $stretch); - unset($tmpstr); - if ($firstline) { - $this->cell_padding = $tmpcellpadding; - return ($this->UniArrSubString($uchars, $nb)); - } - ++$nl; - } - if ($firstline) { - return ''; - } - return $nl; - } - - /** - * Returns the remaining width between the current position and margins. - * @return int Return the remaining width - * @access protected - */ - protected function getRemainingWidth() { - $this->checkPageRegions(); - if ($this->rtl) { - return ($this->x - $this->lMargin); - } else { - return ($this->w - $this->rMargin - $this->x); - } - } - - /** - * Extract a slice of the $strarr array and return it as string. - * @param string $strarr The input array of characters. - * @param int $start the starting element of $strarr. - * @param int $end first element that will not be returned. - * @return Return part of a string - * @access public - */ - public function UTF8ArrSubString($strarr, $start='', $end='') { - if (strlen($start) == 0) { - $start = 0; - } - if (strlen($end) == 0) { - $end = count($strarr); - } - $string = ''; - for ($i=$start; $i < $end; ++$i) { - $string .= $this->unichr($strarr[$i]); - } - return $string; - } - - /** - * Extract a slice of the $uniarr array and return it as string. - * @param string $uniarr The input array of characters. - * @param int $start the starting element of $strarr. - * @param int $end first element that will not be returned. - * @return Return part of a string - * @access public - * @since 4.5.037 (2009-04-07) - */ - public function UniArrSubString($uniarr, $start='', $end='') { - if (strlen($start) == 0) { - $start = 0; - } - if (strlen($end) == 0) { - $end = count($uniarr); - } - $string = ''; - for ($i=$start; $i < $end; ++$i) { - $string .= $uniarr[$i]; - } - return $string; - } - - /** - * Convert an array of UTF8 values to array of unicode characters - * @param string $ta The input array of UTF8 values. - * @return Return array of unicode characters - * @access public - * @since 4.5.037 (2009-04-07) - */ - public function UTF8ArrayToUniArray($ta) { - return array_map(array($this, 'unichr'), $ta); - } - - /** - * Returns the unicode caracter specified by UTF-8 value - * @param int $c UTF-8 value - * @return Returns the specified character. - * @author Miguel Perez, Nicola Asuni - * @access public - * @since 2.3.000 (2008-03-05) - */ - public function unichr($c) { - if (!$this->isunicode) { - return chr($c); - } elseif ($c <= 0x7F) { - // one byte - return chr($c); - } elseif ($c <= 0x7FF) { - // two bytes - return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); - } elseif ($c <= 0xFFFF) { - // three bytes - return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); - } elseif ($c <= 0x10FFFF) { - // four bytes - return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); - } else { - return ''; - } - } - - /** - * Return the image type given the file name or array returned by getimagesize() function. - * @param string $imgfile image file name - * @param array $iminfo array of image information returned by getimagesize() function. - * @return string image type - * @since 4.8.017 (2009-11-27) - */ - public function getImageFileType($imgfile, $iminfo=array()) { - $type = ''; - if (isset($iminfo['mime']) AND !empty($iminfo['mime'])) { - $mime = explode('/', $iminfo['mime']); - if ((count($mime) > 1) AND ($mime[0] == 'image') AND (!empty($mime[1]))) { - $type = strtolower(trim($mime[1])); - } - } - if (empty($type)) { - $fileinfo = pathinfo($imgfile); - if (isset($fileinfo['extension']) AND (!$this->empty_string($fileinfo['extension']))) { - $type = strtolower(trim($fileinfo['extension'])); - } - } - if ($type == 'jpg') { - $type = 'jpeg'; - } - return $type; - } - - /** - * Set the block dimensions accounting for page breaks and page/column fitting - * @param float $w width - * @param float $h height - * @param float $x X coordinate - * @param float $y Y coodiante - * @param boolean $fitonpage if true the block is resized to not exceed page dimensions. - * @access protected - * @since 5.5.009 (2010-07-05) - */ - protected function fitBlock(&$w, &$h, &$x, &$y, $fitonpage=false) { - // resize the block to be vertically contained on a single page or single column - if ($fitonpage OR $this->AutoPageBreak) { - $ratio_wh = ($w / $h); - if ($h > ($this->PageBreakTrigger - $this->tMargin)) { - $h = $this->PageBreakTrigger - $this->tMargin; - $w = ($h * $ratio_wh); - } - // resize the block to be horizontally contained on a single page or single column - if ($fitonpage) { - $maxw = ($this->w - $this->lMargin - $this->rMargin); - if ($w > $maxw) { - $w = $maxw; - $h = ($w / $ratio_wh); - } - } - } - // Check whether we need a new page or new column first as this does not fit - $prev_x = $this->x; - $prev_y = $this->y; - if ($this->checkPageBreak($h, $y) OR ($this->y < $prev_y)) { - $y = $this->y; - if ($this->rtl) { - $x += ($prev_x - $this->x); - } else { - $x += ($this->x - $prev_x); - } - } - // resize the block to be contained on the remaining available page or column space - if ($fitonpage) { - $ratio_wh = ($w / $h); - if (($y + $h) > $this->PageBreakTrigger) { - $h = $this->PageBreakTrigger - $y; - $w = ($h * $ratio_wh); - } - if ((!$this->rtl) AND (($x + $w) > ($this->w - $this->rMargin))) { - $w = $this->w - $this->rMargin - $x; - $h = ($w / $ratio_wh); - } elseif (($this->rtl) AND (($x - $w) < ($this->lMargin))) { - $w = $x - $this->lMargin; - $h = ($w / $ratio_wh); - } - } - } - - /** - * Puts an image in the page. - * The upper-left corner must be given. - * The dimensions can be specified in different ways:<ul> - * <li>explicit width and height (expressed in user unit)</li> - * <li>one explicit dimension, the other being calculated automatically in order to keep the original proportions</li> - * <li>no explicit dimension, in which case the image is put at 72 dpi</li></ul> - * Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; - * The format can be specified explicitly or inferred from the file extension.<br /> - * It is possible to put a link on the image.<br /> - * Remark: if an image is used several times, only one copy will be embedded in the file.<br /> - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner (LTR) or upper-right corner (RTL). - * @param float $y Ordinate of the upper-left corner (LTR) or upper-right corner (RTL). - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param mixed $link URL or identifier returned by AddLink(). - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). - * @param int $dpi dot-per-inch resolution used on resize - * @param string $palign Allows to center or align the image on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @param boolean $ismask true if this image is a mask, false otherwise - * @param mixed $imgmask image object returned by this function or false - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param boolean $fitbox If true scale image dimensions proportionally to fit within the ($w, $h) box. - * @param boolean $hidden if true do not display the image. - * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. - * @return image information - * @access public - * @since 1.1 - */ - public function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - $cached_file = false; // true when the file is cached - // get image dimensions - $imsize = @getimagesize($file); - if ($imsize === FALSE) { - // try to encode spaces on filename - $file = str_replace(' ', '%20', $file); - $imsize = @getimagesize($file); - if ($imsize === FALSE) { - if (function_exists('curl_init')) { - // try to get remote file data using cURL - $cs = curl_init(); // curl session - curl_setopt($cs, CURLOPT_URL, $file); - curl_setopt($cs, CURLOPT_BINARYTRANSFER, true); - curl_setopt($cs, CURLOPT_FAILONERROR, true); - curl_setopt($cs, CURLOPT_RETURNTRANSFER, true); - curl_setopt($cs, CURLOPT_CONNECTTIMEOUT, 5); - curl_setopt($cs, CURLOPT_TIMEOUT, 30); - $imgdata = curl_exec($cs); - curl_close($cs); - if($imgdata !== FALSE) { - // copy image to cache - $file = tempnam(K_PATH_CACHE, 'img_'); - $fp = fopen($file, 'w'); - fwrite($fp, $imgdata); - fclose($fp); - unset($imgdata); - $cached_file = true; - $imsize = @getimagesize($file); - if ($imsize === FALSE) { - unlink($file); - $cached_file = false; - } - } - } elseif (($w > 0) AND ($h > 0)) { - // get measures from specified data - $pw = $this->getHTMLUnitToUnits($w, 0, $this->pdfunit, true) * $this->imgscale * $this->k; - $ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k; - $imsize = array($pw, $ph); - } - } - } - if ($imsize === FALSE) { - $this->Error('[Image] Unable to get image: '.$file); - } - // get original image width and height in pixels - list($pixw, $pixh) = $imsize; - // calculate image width and height on document - if (($w <= 0) AND ($h <= 0)) { - // convert image size to document unit - $w = $this->pixelsToUnits($pixw); - $h = $this->pixelsToUnits($pixh); - } elseif ($w <= 0) { - $w = $h * $pixw / $pixh; - } elseif ($h <= 0) { - $h = $w * $pixh / $pixw; - } elseif ($fitbox AND ($w > 0) AND ($h > 0)) { - // scale image dimensions proportionally to fit within the ($w, $h) box - if ((($w * $pixh) / ($h * $pixw)) < 1) { - $h = $w * $pixh / $pixw; - } else { - $w = $h * $pixw / $pixh; - } - } - // fit the image on available space - $this->fitBlock($w, $h, $x, $y, $fitonpage); - // calculate new minimum dimensions in pixels - $neww = round($w * $this->k * $dpi / $this->dpi); - $newh = round($h * $this->k * $dpi / $this->dpi); - // check if resize is necessary (resize is used only to reduce the image) - $newsize = ($neww * $newh); - $pixsize = ($pixw * $pixh); - if (intval($resize) == 2) { - $resize = true; - } elseif ($newsize >= $pixsize) { - $resize = false; - } - // check if image has been already added on document - $newimage = true; - if (in_array($file, $this->imagekeys)) { - $newimage = false; - // get existing image data - $info = $this->getImageBuffer($file); - // check if the newer image is larger - $oldsize = ($info['w'] * $info['h']); - if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) { - $newimage = true; - } - } - if ($newimage) { - //First use of image, get info - $type = strtolower($type); - if ($type == '') { - $type = $this->getImageFileType($file, $imsize); - } elseif ($type == 'jpg') { - $type = 'jpeg'; - } - $mqr = $this->get_mqr(); - $this->set_mqr(false); - // Specific image handlers - $mtd = '_parse'.$type; - // GD image handler function - $gdfunction = 'imagecreatefrom'.$type; - $info = false; - if ((method_exists($this, $mtd)) AND (!($resize AND function_exists($gdfunction)))) { - // TCPDF image functions - $info = $this->$mtd($file); - if ($info == 'pngalpha') { - return $this->ImagePngAlpha($file, $x, $y, $pixw, $pixh, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign); - } - } - if (!$info) { - if (function_exists($gdfunction)) { - // GD library - $img = $gdfunction($file); - if ($resize) { - $imgr = imagecreatetruecolor($neww, $newh); - if (($type == 'gif') OR ($type == 'png')) { - $imgr = $this->_setGDImageTransparency($imgr, $img); - } - imagecopyresampled($imgr, $img, 0, 0, 0, 0, $neww, $newh, $pixw, $pixh); - if (($type == 'gif') OR ($type == 'png')) { - $info = $this->_toPNG($imgr); - } else { - $info = $this->_toJPEG($imgr); - } - } else { - if (($type == 'gif') OR ($type == 'png')) { - $info = $this->_toPNG($img); - } else { - $info = $this->_toJPEG($img); - } - } - } elseif (extension_loaded('imagick')) { - // ImageMagick library - $img = new Imagick(); - if ($type == 'SVG') { - // get SVG file content - $svgimg = file_get_contents($file); - // get width and height - $regs = array(); - if (preg_match('/<svg([^\>]*)>/si', $svgimg, $regs)) { - $svgtag = $regs[1]; - $tmp = array(); - if (preg_match('/[\s]+width[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) { - $ow = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); - $owu = sprintf('%.3F', ($ow * $dpi / 72)).$this->pdfunit; - $svgtag = preg_replace('/[\s]+width[\s]*=[\s]*"[^"]*"/si', ' width="'.$owu.'"', $svgtag, 1); - } else { - $ow = $w; - } - $tmp = array(); - if (preg_match('/[\s]+height[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) { - $oh = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); - $ohu = sprintf('%.3F', ($oh * $dpi / 72)).$this->pdfunit; - $svgtag = preg_replace('/[\s]+height[\s]*=[\s]*"[^"]*"/si', ' height="'.$ohu.'"', $svgtag, 1); - } else { - $oh = $h; - } - $tmp = array(); - if (!preg_match('/[\s]+viewBox[\s]*=[\s]*"[\s]*([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]*"/si', $svgtag, $tmp)) { - $vbw = ($ow * $this->imgscale * $this->k); - $vbh = ($oh * $this->imgscale * $this->k); - $vbox = sprintf(' viewBox="0 0 %.3F %.3F" ', $vbw, $vbh); - $svgtag = $vbox.$svgtag; - } - $svgimg = preg_replace('/<svg([^\>]*)>/si', '<svg'.$svgtag.'>', $svgimg, 1); - } - $img->readImageBlob($svgimg); - } else { - $img->readImage($file); - } - if ($resize) { - $img->resizeImage($neww, $newh, 10, 1, false); - } - $img->setCompressionQuality($this->jpeg_quality); - $img->setImageFormat('jpeg'); - $tempname = tempnam(K_PATH_CACHE, 'jpg_'); - $img->writeImage($tempname); - $info = $this->_parsejpeg($tempname); - unlink($tempname); - $img->destroy(); - } else { - return; - } - } - if ($info === false) { - //If false, we cannot process image - return; - } - $this->set_mqr($mqr); - if ($ismask) { - // force grayscale - $info['cs'] = 'DeviceGray'; - } - $info['i'] = $this->numimages; - if (!in_array($file, $this->imagekeys)) { - ++$info['i']; - } - if ($imgmask !== false) { - $info['masked'] = $imgmask; - } - // add image to document - $this->setImageBuffer($file, $info); - } - if ($cached_file) { - // remove cached file - unlink($file); - } - // set alignment - $this->img_rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x - $w; - } - $this->img_rb_x = $ximg; - } else { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x; - } - $this->img_rb_x = $ximg + $w; - } - if ($ismask OR $hidden) { - // image is not displayed - return $info['i']; - } - $xkimg = $ximg * $this->k; - $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%u Do Q', ($w * $this->k), ($h * $this->k), $xkimg, (($this->h - ($y + $h)) * $this->k), $info['i'])); - if (!empty($border)) { - $bx = $this->x; - $by = $this->y; - $this->x = $ximg; - if ($this->rtl) { - $this->x += $w; - } - $this->y = $y; - $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); - $this->x = $bx; - $this->y = $by; - } - if ($link) { - $this->Link($ximg, $y, $w, $h, $link, 0); - } - // set pointer to align the next text/objects - switch($align) { - case 'T': { - $this->y = $y; - $this->x = $this->img_rb_x; - break; - } - case 'M': { - $this->y = $y + round($h/2); - $this->x = $this->img_rb_x; - break; - } - case 'B': { - $this->y = $this->img_rb_y; - $this->x = $this->img_rb_x; - break; - } - case 'N': { - $this->SetY($this->img_rb_y); - break; - } - default:{ - break; - } - } - $this->endlinex = $this->img_rb_x; - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['images'][] = $info['i']; - } - return $info['i']; - } - - /** - * Sets the current active configuration setting of magic_quotes_runtime (if the set_magic_quotes_runtime function exist) - * @param boolean $mqr FALSE for off, TRUE for on. - * @since 4.6.025 (2009-08-17) - */ - public function set_mqr($mqr) { - if(!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); - } - if (PHP_VERSION_ID < 50300) { - @set_magic_quotes_runtime($mqr); - } - } - - /** - * Gets the current active configuration setting of magic_quotes_runtime (if the get_magic_quotes_runtime function exist) - * @return Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1 otherwise. - * @since 4.6.025 (2009-08-17) - */ - public function get_mqr() { - if(!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version{0} * 10000) + ($version{2} * 100) + $version{4})); - } - if (PHP_VERSION_ID < 50300) { - return @get_magic_quotes_runtime(); - } - return 0; - } - - /** - * Convert the loaded image to a JPEG and then return a structure for the PDF creator. - * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param string $file Image file name. - * @param image $image Image object. - * return image JPEG image object. - * @access protected - */ - protected function _toJPEG($image) { - $tempname = tempnam(K_PATH_CACHE, 'jpg_'); - imagejpeg($image, $tempname, $this->jpeg_quality); - imagedestroy($image); - $retvars = $this->_parsejpeg($tempname); - // tidy up by removing temporary image - unlink($tempname); - return $retvars; - } - - /** - * Convert the loaded image to a PNG and then return a structure for the PDF creator. - * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. - * @param string $file Image file name. - * @param image $image Image object. - * return image PNG image object. - * @access protected - * @since 4.9.016 (2010-04-20) - */ - protected function _toPNG($image) { - $tempname = tempnam(K_PATH_CACHE, 'jpg_'); - imagepng($image, $tempname); - imagedestroy($image); - $retvars = $this->_parsepng($tempname); - // tidy up by removing temporary image - unlink($tempname); - return $retvars; - } - - /** - * Set the transparency for the given GD image. - * @param image $new_image GD image object - * @param image $image GD image object. - * return GD image object. - * @access protected - * @since 4.9.016 (2010-04-20) - */ - protected function _setGDImageTransparency($new_image, $image) { - // transparency index - $tid = imagecolortransparent($image); - // default transparency color - $tcol = array('red' => 255, 'green' => 255, 'blue' => 255); - if ($tid >= 0) { - // get the colors for the transparency index - $tcol = imagecolorsforindex($image, $tid); - } - $tid = imagecolorallocate($new_image, $tcol['red'], $tcol['green'], $tcol['blue']); - imagefill($new_image, 0, 0, $tid); - imagecolortransparent($new_image, $tid); - return $new_image; - } - - /** - * Extract info from a JPEG file without using the GD library. - * @param string $file image file to parse - * @return array structure containing the image data - * @access protected - */ - protected function _parsejpeg($file) { - $a = getimagesize($file); - if (empty($a)) { - $this->Error('Missing or incorrect image file: '.$file); - } - if ($a[2] != 2) { - $this->Error('Not a JPEG file: '.$file); - } - if ((!isset($a['channels'])) OR ($a['channels'] == 3)) { - $colspace = 'DeviceRGB'; - } elseif ($a['channels'] == 4) { - $colspace = 'DeviceCMYK'; - } else { - $colspace = 'DeviceGray'; - } - $bpc = isset($a['bits']) ? $a['bits'] : 8; - $data = file_get_contents($file); - return array('w' => $a[0], 'h' => $a[1], 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'DCTDecode', 'data' => $data); - } - - /** - * Extract info from a PNG file without using the GD library. - * @param string $file image file to parse - * @return array structure containing the image data - * @access protected - */ - protected function _parsepng($file) { - $f = fopen($file, 'rb'); - if ($f === false) { - $this->Error('Can\'t open image file: '.$file); - } - //Check signature - if (fread($f, 8) != chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { - $this->Error('Not a PNG file: '.$file); - } - //Read header chunk - fread($f, 4); - if (fread($f, 4) != 'IHDR') { - $this->Error('Incorrect PNG file: '.$file); - } - $w = $this->_freadint($f); - $h = $this->_freadint($f); - $bpc = ord(fread($f, 1)); - if ($bpc > 8) { - //$this->Error('16-bit depth not supported: '.$file); - fclose($f); - return false; - } - $ct = ord(fread($f, 1)); - if ($ct == 0) { - $colspace = 'DeviceGray'; - } elseif ($ct == 2) { - $colspace = 'DeviceRGB'; - } elseif ($ct == 3) { - $colspace = 'Indexed'; - } else { - // alpha channel - fclose($f); - return 'pngalpha'; - } - if (ord(fread($f, 1)) != 0) { - //$this->Error('Unknown compression method: '.$file); - fclose($f); - return false; - } - if (ord(fread($f, 1)) != 0) { - //$this->Error('Unknown filter method: '.$file); - fclose($f); - return false; - } - if (ord(fread($f, 1)) != 0) { - //$this->Error('Interlacing not supported: '.$file); - fclose($f); - return false; - } - fread($f, 4); - $parms = '/DecodeParms << /Predictor 15 /Colors '.($ct == 2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.' >>'; - //Scan chunks looking for palette, transparency and image data - $pal = ''; - $trns = ''; - $data = ''; - do { - $n = $this->_freadint($f); - $type = fread($f, 4); - if ($type == 'PLTE') { - //Read palette - $pal = $this->rfread($f, $n); - fread($f, 4); - } elseif ($type == 'tRNS') { - //Read transparency info - $t = $this->rfread($f, $n); - if ($ct == 0) { - $trns = array(ord(substr($t, 1, 1))); - } elseif ($ct == 2) { - $trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1))); - } else { - $pos = strpos($t, chr(0)); - if ($pos !== false) { - $trns = array($pos); - } - } - fread($f, 4); - } elseif ($type == 'IDAT') { - //Read image data block - $data .= $this->rfread($f, $n); - fread($f, 4); - } elseif ($type == 'IEND') { - break; - } else { - $this->rfread($f, $n + 4); - } - } while ($n); - if (($colspace == 'Indexed') AND (empty($pal))) { - //$this->Error('Missing palette in '.$file); - fclose($f); - return false; - } - fclose($f); - return array('w' => $w, 'h' => $h, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $data); - } - - /** - * Binary-safe and URL-safe file read. - * Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached. - * @param resource $handle - * @param int $length - * @return Returns the read string or FALSE in case of error. - * @author Nicola Asuni - * @access protected - * @since 4.5.027 (2009-03-16) - */ - protected function rfread($handle, $length) { - $data = fread($handle, $length); - if ($data === false) { - return false; - } - $rest = $length - strlen($data); - if ($rest > 0) { - $data .= $this->rfread($handle, $rest); - } - return $data; - } - - /** - * Extract info from a PNG image with alpha channel using the GD library. - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $wpx Original width of the image in pixels. - * @param float $hpx original height of the image in pixels. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. - * @param mixed $link URL or identifier returned by AddLink(). - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). - * @param int $dpi dot-per-inch resolution used on resize - * @param string $palign Allows to center or align the image on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @author Nicola Asuni - * @access protected - * @since 4.3.007 (2008-12-04) - * @see Image() - */ - protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign) { - // create temp image file (without alpha channel) - $tempfile_plain = tempnam(K_PATH_CACHE, 'mskp_'); - // create temp alpha file - $tempfile_alpha = tempnam(K_PATH_CACHE, 'mska_'); - if (extension_loaded('imagick')) { // ImageMagick - // ImageMagick library - $img = new Imagick(); - $img->readImage($file); - // clone image object - $imga = $img->clone(); - // extract alpha channel - $img->separateImageChannel(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); - $img->negateImage(true); - $img->setImageFormat('png'); - $img->writeImage($tempfile_alpha); - // remove alpha channel - $imga->separateImageChannel(imagick::CHANNEL_ALL & ~(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE)); - $imga->setImageFormat('png'); - $imga->writeImage($tempfile_plain); - } else { // GD library - // generate images - $img = imagecreatefrompng($file); - $imgalpha = imagecreate($wpx, $hpx); - // generate gray scale palette (0 -> 255) - for ($c = 0; $c < 256; ++$c) { - ImageColorAllocate($imgalpha, $c, $c, $c); - } - // extract alpha channel - for ($xpx = 0; $xpx < $wpx; ++$xpx) { - for ($ypx = 0; $ypx < $hpx; ++$ypx) { - $color = imagecolorat($img, $xpx, $ypx); - $alpha = ($color >> 24); // shifts off the first 24 bits (where 8x3 are used for each color), and returns the remaining 7 allocated bits (commonly used for alpha) - $alpha = (((127 - $alpha) / 127) * 255); // GD alpha is only 7 bit (0 -> 127) - $alpha = $this->getGDgamma($alpha); // correct gamma - imagesetpixel($imgalpha, $xpx, $ypx, $alpha); - } - } - imagepng($imgalpha, $tempfile_alpha); - imagedestroy($imgalpha); - // extract image without alpha channel - $imgplain = imagecreatetruecolor($wpx, $hpx); - imagecopy($imgplain, $img, 0, 0, 0, 0, $wpx, $hpx); - imagepng($imgplain, $tempfile_plain); - imagedestroy($imgplain); - } - // embed mask image - $imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false); - // embed image, masked with previously embedded mask - $this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask); - // remove temp files - unlink($tempfile_alpha); - unlink($tempfile_plain); - } - - /** - * Correct the gamma value to be used with GD library - * @param float $v the gamma value to be corrected - * @access protected - * @since 4.3.007 (2008-12-04) - */ - protected function getGDgamma($v) { - return (pow(($v / 255), 2.2) * 255); - } - - /** - * Performs a line break. - * The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. - * @param float $h The height of the break. By default, the value equals the height of the last printed cell. - * @param boolean $cell if true add the current left (or right o for RTL) padding to the X coordinate - * @access public - * @since 1.0 - * @see Cell() - */ - public function Ln($h='', $cell=false) { - if (($this->num_columns > 1) AND ($this->y == $this->columns[$this->current_column]['y']) AND isset($this->columns[$this->current_column]['x']) AND ($this->x == $this->columns[$this->current_column]['x'])) { - // revove vertical space from the top of the column - return; - } - if ($cell) { - if ($this->rtl) { - $cellpadding = $this->cell_padding['R']; - } else { - $cellpadding = $this->cell_padding['L']; - } - } else { - $cellpadding = 0; - } - if ($this->rtl) { - $this->x = $this->w - $this->rMargin - $cellpadding; - } else { - $this->x = $this->lMargin + $cellpadding; - } - if (is_string($h)) { - $this->y += $this->lasth; - } else { - $this->y += $h; - } - $this->newline = true; - } - - /** - * Returns the relative X value of current position. - * The value is relative to the left border for LTR languages and to the right border for RTL languages. - * @return float - * @access public - * @since 1.2 - * @see SetX(), GetY(), SetY() - */ - public function GetX() { - //Get x position - if ($this->rtl) { - return ($this->w - $this->x); - } else { - return $this->x; - } - } - - /** - * Returns the absolute X value of current position. - * @return float - * @access public - * @since 1.2 - * @see SetX(), GetY(), SetY() - */ - public function GetAbsX() { - return $this->x; - } - - /** - * Returns the ordinate of the current position. - * @return float - * @access public - * @since 1.0 - * @see SetY(), GetX(), SetX() - */ - public function GetY() { - return $this->y; - } - - /** - * Defines the abscissa of the current position. - * If the passed value is negative, it is relative to the right of the page (or left if language is RTL). - * @param float $x The value of the abscissa. - * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. - * @access public - * @since 1.2 - * @see GetX(), GetY(), SetY(), SetXY() - */ - public function SetX($x, $rtloff=false) { - if (!$rtloff AND $this->rtl) { - if ($x >= 0) { - $this->x = $this->w - $x; - } else { - $this->x = abs($x); - } - } else { - if ($x >= 0) { - $this->x = $x; - } else { - $this->x = $this->w + $x; - } - } - if ($this->x < 0) { - $this->x = 0; - } - if ($this->x > $this->w) { - $this->x = $this->w; - } - } - - /** - * Moves the current abscissa back to the left margin and sets the ordinate. - * If the passed value is negative, it is relative to the bottom of the page. - * @param float $y The value of the ordinate. - * @param bool $resetx if true (default) reset the X position. - * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. - * @access public - * @since 1.0 - * @see GetX(), GetY(), SetY(), SetXY() - */ - public function SetY($y, $resetx=true, $rtloff=false) { - if ($resetx) { - //reset x - if (!$rtloff AND $this->rtl) { - $this->x = $this->w - $this->rMargin; - } else { - $this->x = $this->lMargin; - } - } - if ($y >= 0) { - $this->y = $y; - } else { - $this->y = $this->h + $y; - } - if ($this->y < 0) { - $this->y = 0; - } - if ($this->y > $this->h) { - $this->y = $this->h; - } - } - - /** - * Defines the abscissa and ordinate of the current position. - * If the passed values are negative, they are relative respectively to the right and bottom of the page. - * @param float $x The value of the abscissa. - * @param float $y The value of the ordinate. - * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. - * @access public - * @since 1.2 - * @see SetX(), SetY() - */ - public function SetXY($x, $y, $rtloff=false) { - $this->SetY($y, false, $rtloff); - $this->SetX($x, $rtloff); - } - - /** - * Send the document to a given destination: string, local file or browser. - * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.<br /> - * The method first calls Close() if necessary to terminate the document. - * @param string $name The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character. - * @param string $dest Destination where to send the document. It can take one of the following values:<ul><li>I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.</li><li>D: send to the browser and force a file download with the name given by name.</li><li>F: save to a local server file with the name given by name.</li><li>S: return the document as a string. name is ignored.</li><li>FI: equivalent to F + I option</li><li>FD: equivalent to F + D option</li></ul> - * @access public - * @since 1.0 - * @see Close() - */ - public function Output($name='doc.pdf', $dest='I') { - //Output PDF to some destination - //Finish document if necessary - if ($this->state < 3) { - $this->Close(); - } - //Normalize parameters - if (is_bool($dest)) { - $dest = $dest ? 'D' : 'F'; - } - $dest = strtoupper($dest); - if ($dest{0} != 'F') { - $name = preg_replace('/[\s]+/', '_', $name); - $name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name); - } - if ($this->sign) { - // *** apply digital signature to the document *** - // get the document content - $pdfdoc = $this->getBuffer(); - // remove last newline - $pdfdoc = substr($pdfdoc, 0, -1); - // Remove the original buffer - if (isset($this->diskcache) AND $this->diskcache) { - // remove buffer file from cache - unlink($this->buffer); - } - unset($this->buffer); - // remove filler space - $byterange_string_len = strlen($this->byterange_string); - // define the ByteRange - $byte_range = array(); - $byte_range[0] = 0; - $byte_range[1] = strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10; - $byte_range[2] = $byte_range[1] + $this->signature_max_length + 2; - $byte_range[3] = strlen($pdfdoc) - $byte_range[2]; - $pdfdoc = substr($pdfdoc, 0, $byte_range[1]).substr($pdfdoc, $byte_range[2]); - // replace the ByteRange - $byterange = sprintf('/ByteRange[0 %u %u %u]', $byte_range[1], $byte_range[2], $byte_range[3]); - $byterange .= str_repeat(' ', ($byterange_string_len - strlen($byterange))); - $pdfdoc = str_replace($this->byterange_string, $byterange, $pdfdoc); - // write the document to a temporary folder - $tempdoc = tempnam(K_PATH_CACHE, 'tmppdf_'); - $f = fopen($tempdoc, 'wb'); - if (!$f) { - $this->Error('Unable to create temporary file: '.$tempdoc); - } - $pdfdoc_length = strlen($pdfdoc); - fwrite($f, $pdfdoc, $pdfdoc_length); - fclose($f); - // get digital signature via openssl library - $tempsign = tempnam(K_PATH_CACHE, 'tmpsig_'); - if (empty($this->signature_data['extracerts'])) { - openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED); - } else { - openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED, $this->signature_data['extracerts']); - } - unlink($tempdoc); - // read signature - $signature = file_get_contents($tempsign); - unlink($tempsign); - // extract signature - $signature = substr($signature, $pdfdoc_length); - $signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13)); - $tmparr = explode("\n\n", $signature); - $signature = $tmparr[1]; - unset($tmparr); - // decode signature - $signature = base64_decode(trim($signature)); - // convert signature to hex - $signature = current(unpack('H*', $signature)); - $signature = str_pad($signature, $this->signature_max_length, '0'); - // Add signature to the document - $pdfdoc = substr($pdfdoc, 0, $byte_range[1]).'<'.$signature.'>'.substr($pdfdoc, $byte_range[1]); - $this->diskcache = false; - $this->buffer = &$pdfdoc; - $this->bufferlen = strlen($pdfdoc); - } - switch($dest) { - case 'I': { - // Send PDF to the standard output - if (ob_get_contents()) { - $this->Error('Some data has already been output, can\'t send PDF file'); - } - if (php_sapi_name() != 'cli') { - //We send to a browser - header('Content-Type: application/pdf'); - if (headers_sent()) { - $this->Error('Some data has already been output to browser, can\'t send PDF file'); - } - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Length: '.$this->bufferlen); - header('Content-Disposition: inline; filename="'.basename($name).'";'); - } - echo $this->getBuffer(); - break; - } - case 'D': { - // Download PDF as file - if (ob_get_contents()) { - $this->Error('Some data has already been output, can\'t send PDF file'); - } - header('Content-Description: File Transfer'); - if (headers_sent()) { - $this->Error('Some data has already been output to browser, can\'t send PDF file'); - } - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - // force download dialog - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream', false); - header('Content-Type: application/download', false); - header('Content-Type: application/pdf', false); - // use the Content-Disposition header to supply a recommended filename - header('Content-Disposition: attachment; filename="'.basename($name).'";'); - header('Content-Transfer-Encoding: binary'); - header('Content-Length: '.$this->bufferlen); - echo $this->getBuffer(); - break; - } - case 'F': - case 'FI': - case 'FD': { - // Save PDF to a local file - if ($this->diskcache) { - copy($this->buffer, $name); - } else { - $f = fopen($name, 'wb'); - if (!$f) { - $this->Error('Unable to create output file: '.$name); - } - fwrite($f, $this->getBuffer(), $this->bufferlen); - fclose($f); - } - if ($dest == 'FI') { - // send headers to browser - header('Content-Type: application/pdf'); - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Length: '.filesize($name)); - header('Content-Disposition: inline; filename="'.basename($name).'";'); - // send document to the browser - echo file_get_contents($name); - } elseif ($dest == 'FD') { - // send headers to browser - if (ob_get_contents()) { - $this->Error('Some data has already been output, can\'t send PDF file'); - } - header('Content-Description: File Transfer'); - if (headers_sent()) { - $this->Error('Some data has already been output to browser, can\'t send PDF file'); - } - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - // force download dialog - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream', false); - header('Content-Type: application/download', false); - header('Content-Type: application/pdf', false); - // use the Content-Disposition header to supply a recommended filename - header('Content-Disposition: attachment; filename="'.basename($name).'";'); - header('Content-Transfer-Encoding: binary'); - header('Content-Length: '.filesize($name)); - // send document to the browser - echo file_get_contents($name); - } - break; - } - case 'S': { - // Returns PDF as a string - return $this->getBuffer(); - } - default: { - $this->Error('Incorrect output destination: '.$dest); - } - } - return ''; - } - - /** - * Unset all class variables except the following critical variables: internal_encoding, state, bufferlen, buffer and diskcache. - * @param boolean $destroyall if true destroys all class variables, otherwise preserves critical variables. - * @param boolean $preserve_objcopy if true preserves the objcopy variable - * @access public - * @since 4.5.016 (2009-02-24) - */ - public function _destroy($destroyall=false, $preserve_objcopy=false) { - if ($destroyall AND isset($this->diskcache) AND $this->diskcache AND (!$preserve_objcopy) AND (!$this->empty_string($this->buffer))) { - // remove buffer file from cache - unlink($this->buffer); - } - foreach (array_keys(get_object_vars($this)) as $val) { - if ($destroyall OR ( - ($val != 'internal_encoding') - AND ($val != 'state') - AND ($val != 'bufferlen') - AND ($val != 'buffer') - AND ($val != 'diskcache') - AND ($val != 'sign') - AND ($val != 'signature_data') - AND ($val != 'signature_max_length') - AND ($val != 'byterange_string') - )) { - if ((!$preserve_objcopy OR ($val != 'objcopy')) AND isset($this->$val)) { - unset($this->$val); - } - } - } - } - - /** - * Check for locale-related bug - * @access protected - */ - protected function _dochecks() { - //Check for locale-related bug - if (1.1 == 1) { - $this->Error('Don\'t alter the locale before including class file'); - } - //Check for decimal separator - if (sprintf('%.1F', 1.0) != '1.0') { - setlocale(LC_NUMERIC, 'C'); - } - } - - /** - * Return fonts path - * @return string - * @access protected - */ - protected function _getfontpath() { - if (!defined('K_PATH_FONTS') AND is_dir(dirname(__FILE__).'/fonts')) { - define('K_PATH_FONTS', dirname(__FILE__).'/fonts/'); - } - return defined('K_PATH_FONTS') ? K_PATH_FONTS : ''; - } - - /** - * Output pages. - * @access protected - */ - protected function _putpages() { - $nb = $this->numpages; - if (!empty($this->AliasNbPages)) { - $nbs = $this->formatPageNumber($nb); - $nbu = $this->UTF8ToUTF16BE($nbs, false); // replacement for unicode font - $alias_a = $this->_escape($this->AliasNbPages); - $alias_au = $this->_escape('{'.$this->AliasNbPages.'}'); - if ($this->isunicode) { - $alias_b = $this->_escape($this->UTF8ToLatin1($this->AliasNbPages)); - $alias_bu = $this->_escape($this->UTF8ToLatin1('{'.$this->AliasNbPages.'}')); - $alias_c = $this->_escape($this->utf8StrRev($this->AliasNbPages, false, $this->tmprtl)); - $alias_cu = $this->_escape($this->utf8StrRev('{'.$this->AliasNbPages.'}', false, $this->tmprtl)); - } - } - if (!empty($this->AliasNumPage)) { - $alias_pa = $this->_escape($this->AliasNumPage); - $alias_pau = $this->_escape('{'.$this->AliasNumPage.'}'); - if ($this->isunicode) { - $alias_pb = $this->_escape($this->UTF8ToLatin1($this->AliasNumPage)); - $alias_pbu = $this->_escape($this->UTF8ToLatin1('{'.$this->AliasNumPage.'}')); - $alias_pc = $this->_escape($this->utf8StrRev($this->AliasNumPage, false, $this->tmprtl)); - $alias_pcu = $this->_escape($this->utf8StrRev('{'.$this->AliasNumPage.'}', false, $this->tmprtl)); - } - } - $pagegroupnum = 0; - $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; - for ($n=1; $n <= $nb; ++$n) { - $temppage = $this->getPageBuffer($n); - if (!empty($this->pagegroups)) { - if(isset($this->newpagegroup[$n])) { - $pagegroupnum = 0; - } - ++$pagegroupnum; - foreach ($this->pagegroups as $k => $v) { - // replace total pages group numbers - $vs = $this->formatPageNumber($v); - $vu = $this->UTF8ToUTF16BE($vs, false); - $alias_ga = $this->_escape($k); - $alias_gau = $this->_escape('{'.$k.'}'); - if ($this->isunicode) { - $alias_gb = $this->_escape($this->UTF8ToLatin1($k)); - $alias_gbu = $this->_escape($this->UTF8ToLatin1('{'.$k.'}')); - $alias_gc = $this->_escape($this->utf8StrRev($k, false, $this->tmprtl)); - $alias_gcu = $this->_escape($this->utf8StrRev('{'.$k.'}', false, $this->tmprtl)); - } - $temppage = str_replace($alias_gau, $vu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_gbu, $vu, $temppage); - $temppage = str_replace($alias_gcu, $vu, $temppage); - $temppage = str_replace($alias_gb, $vs, $temppage); - $temppage = str_replace($alias_gc, $vs, $temppage); - } - $temppage = str_replace($alias_ga, $vs, $temppage); - // replace page group numbers - $pvs = $this->formatPageNumber($pagegroupnum); - $pvu = $this->UTF8ToUTF16BE($pvs, false); - $pk = str_replace('{nb', '{pnb', $k); - $alias_pga = $this->_escape($pk); - $alias_pgau = $this->_escape('{'.$pk.'}'); - if ($this->isunicode) { - $alias_pgb = $this->_escape($this->UTF8ToLatin1($pk)); - $alias_pgbu = $this->_escape($this->UTF8ToLatin1('{'.$pk.'}')); - $alias_pgc = $this->_escape($this->utf8StrRev($pk, false, $this->tmprtl)); - $alias_pgcu = $this->_escape($this->utf8StrRev('{'.$pk.'}', false, $this->tmprtl)); - } - $temppage = str_replace($alias_pgau, $pvu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_pgbu, $pvu, $temppage); - $temppage = str_replace($alias_pgcu, $pvu, $temppage); - $temppage = str_replace($alias_pgb, $pvs, $temppage); - $temppage = str_replace($alias_pgc, $pvs, $temppage); - } - $temppage = str_replace($alias_pga, $pvs, $temppage); - } - } - if (!empty($this->AliasNbPages)) { - // replace total pages number - $temppage = str_replace($alias_au, $nbu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_bu, $nbu, $temppage); - $temppage = str_replace($alias_cu, $nbu, $temppage); - $temppage = str_replace($alias_b, $nbs, $temppage); - $temppage = str_replace($alias_c, $nbs, $temppage); - } - $temppage = str_replace($alias_a, $nbs, $temppage); - } - if (!empty($this->AliasNumPage)) { - // replace page number - $pnbs = $this->formatPageNumber($n); - $pnbu = $this->UTF8ToUTF16BE($pnbs, false); // replacement for unicode font - $temppage = str_replace($alias_pau, $pnbu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_pbu, $pnbu, $temppage); - $temppage = str_replace($alias_pcu, $pnbu, $temppage); - $temppage = str_replace($alias_pb, $pnbs, $temppage); - $temppage = str_replace($alias_pc, $pnbs, $temppage); - } - $temppage = str_replace($alias_pa, $pnbs, $temppage); - } - $temppage = str_replace($this->epsmarker, '', $temppage); - //Page - $this->page_obj_id[$n] = $this->_newobj(); - $out = '<<'; - $out .= ' /Type /Page'; - $out .= ' /Parent 1 0 R'; - $out .= ' /LastModified '.$this->_datestring(); - $out .= ' /Resources 2 0 R'; - $boxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); - foreach ($boxes as $box) { - $out .= ' /'.$box; - $out .= sprintf(' [%.2F %.2F %.2F %.2F]', $this->pagedim[$n][$box]['llx'], $this->pagedim[$n][$box]['lly'], $this->pagedim[$n][$box]['urx'], $this->pagedim[$n][$box]['ury']); - } - if (isset($this->pagedim[$n]['BoxColorInfo']) AND !empty($this->pagedim[$n]['BoxColorInfo'])) { - $out .= ' /BoxColorInfo <<'; - foreach ($boxes as $box) { - if (isset($this->pagedim[$n]['BoxColorInfo'][$box])) { - $out .= ' /'.$box.' <<'; - if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['C'])) { - $color = $this->pagedim[$n]['BoxColorInfo'][$box]['C']; - $out .= ' /C ['; - $out .= sprintf(' %.3F %.3F %.3F', $color[0]/255, $color[1]/255, $color[2]/255); - $out .= ' ]'; - } - if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['W'])) { - $out .= ' /W '.($this->pagedim[$n]['BoxColorInfo'][$box]['W'] * $this->k); - } - if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['S'])) { - $out .= ' /S /'.$this->pagedim[$n]['BoxColorInfo'][$box]['S']; - } - if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['D'])) { - $dashes = $this->pagedim[$n]['BoxColorInfo'][$box]['D']; - $out .= ' /D ['; - foreach ($dashes as $dash) { - $out .= sprintf(' %.3F', ($dash * $this->k)); - } - $out .= ' ]'; - } - $out .= ' >>'; - } - } - $out .= ' >>'; - } - $out .= ' /Contents '.($this->n + 1).' 0 R'; - $out .= ' /Rotate '.$this->pagedim[$n]['Rotate']; - $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceRGB >>'; - if (isset($this->pagedim[$n]['trans']) AND !empty($this->pagedim[$n]['trans'])) { - // page transitions - if (isset($this->pagedim[$n]['trans']['Dur'])) { - $out .= ' /Dur '.$this->pagedim[$n]['trans']['Dur']; - } - $out .= ' /Trans <<'; - $out .= ' /Type /Trans'; - if (isset($this->pagedim[$n]['trans']['S'])) { - $out .= ' /S /'.$this->pagedim[$n]['trans']['S']; - } - if (isset($this->pagedim[$n]['trans']['D'])) { - $out .= ' /D '.$this->pagedim[$n]['trans']['D']; - } - if (isset($this->pagedim[$n]['trans']['Dm'])) { - $out .= ' /Dm /'.$this->pagedim[$n]['trans']['Dm']; - } - if (isset($this->pagedim[$n]['trans']['M'])) { - $out .= ' /M /'.$this->pagedim[$n]['trans']['M']; - } - if (isset($this->pagedim[$n]['trans']['Di'])) { - $out .= ' /Di '.$this->pagedim[$n]['trans']['Di']; - } - if (isset($this->pagedim[$n]['trans']['SS'])) { - $out .= ' /SS '.$this->pagedim[$n]['trans']['SS']; - } - if (isset($this->pagedim[$n]['trans']['B'])) { - $out .= ' /B '.$this->pagedim[$n]['trans']['B']; - } - $out .= ' >>'; - } - $out .= $this->_getannotsrefs($n); - $out .= ' /PZ '.$this->pagedim[$n]['PZ']; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - //Page content - $p = ($this->compress) ? gzcompress($temppage) : $temppage; - $this->_newobj(); - $p = $this->_getrawstream($p); - $this->_out('<<'.$filter.'/Length '.strlen($p).'>> stream'."\n".$p."\n".'endstream'."\n".'endobj'); - if ($this->diskcache) { - // remove temporary files - unlink($this->pages[$n]); - } - } - //Pages root - $out = $this->_getobj(1)."\n"; - $out .= '<< /Type /Pages /Kids ['; - foreach($this->page_obj_id as $page_obj) { - $out .= ' '.$page_obj.' 0 R'; - } - $out .= ' ] /Count '.$nb.' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - - /** - * Output references to page annotations - * @param int $n page number - * @access protected - * @author Nicola Asuni - * @since 4.7.000 (2008-08-29) - * @deprecated - */ - protected function _putannotsrefs($n) { - $this->_out($this->_getannotsrefs($n)); - } - - /** - * Get references to page annotations. - * @param int $n page number - * @return string - * @access protected - * @author Nicola Asuni - * @since 5.0.010 (2010-05-17) - */ - protected function _getannotsrefs($n) { - if (!(isset($this->PageAnnots[$n]) OR ($this->sign AND isset($this->signature_data['cert_type'])))) { - return ''; - } - $out = ' /Annots ['; - if (isset($this->PageAnnots[$n])) { - foreach ($this->PageAnnots[$n] as $key => $val) { - if (!in_array($val['n'], $this->radio_groups)) { - $out .= ' '.$val['n'].' 0 R'; - } - } - // add radiobutton groups - if (isset($this->radiobutton_groups[$n])) { - foreach ($this->radiobutton_groups[$n] as $key => $data) { - if (isset($data['n'])) { - $out .= ' '.$data['n'].' 0 R'; - } - } - } - } - if ($this->sign AND ($n == $this->signature_appearance['page']) AND isset($this->signature_data['cert_type'])) { - // set reference for signature object - $out .= ' '.$this->sig_obj_id.' 0 R'; - } - $out .= ' ]'; - return $out; - } - - /** - * Output annotations objects for all pages. - * !!! THIS METHOD IS NOT YET COMPLETED !!! - * See section 12.5 of PDF 32000_2008 reference. - * @access protected - * @author Nicola Asuni - * @since 4.0.018 (2008-08-06) - */ - protected function _putannotsobjs() { - // reset object counter - for ($n=1; $n <= $this->numpages; ++$n) { - if (isset($this->PageAnnots[$n])) { - // set page annotations - foreach ($this->PageAnnots[$n] as $key => $pl) { - $annot_obj_id = $this->PageAnnots[$n][$key]['n']; - // create annotation object for grouping radiobuttons - if (isset($this->radiobutton_groups[$n][$pl['txt']]) AND is_array($this->radiobutton_groups[$n][$pl['txt']])) { - $radio_button_obj_id = $this->radiobutton_groups[$n][$pl['txt']]['n']; - $annots = '<<'; - $annots .= ' /Type /Annot'; - $annots .= ' /Subtype /Widget'; - $annots .= ' /Rect [0 0 0 0]'; - $annots .= ' /T '.$this->_datastring($pl['txt'], $radio_button_obj_id); - $annots .= ' /FT /Btn'; - $annots .= ' /Ff 49152'; - $annots .= ' /Kids ['; - foreach ($this->radiobutton_groups[$n][$pl['txt']] as $key => $data) { - if ($key !== 'n') { - $annots .= ' '.$data['kid'].' 0 R'; - if ($data['def'] !== 'Off') { - $defval = $data['def']; - } - } - } - $annots .= ' ]'; - if (isset($defval)) { - $annots .= ' /V /'.$defval; - } - $annots .= ' >>'; - $this->_out($this->_getobj($radio_button_obj_id)."\n".$annots."\n".'endobj'); - $this->form_obj_id[] = $radio_button_obj_id; - // store object id to be used on Parent entry of Kids - $this->radiobutton_groups[$n][$pl['txt']] = $radio_button_obj_id; - } - $formfield = false; - $pl['opt'] = array_change_key_case($pl['opt'], CASE_LOWER); - $a = $pl['x'] * $this->k; - $b = $this->pagedim[$n]['h'] - (($pl['y'] + $pl['h']) * $this->k); - $c = $pl['w'] * $this->k; - $d = $pl['h'] * $this->k; - $rect = sprintf('%.2F %.2F %.2F %.2F', $a, $b, $a+$c, $b+$d); - // create new annotation object - $annots = '<</Type /Annot'; - $annots .= ' /Subtype /'.$pl['opt']['subtype']; - $annots .= ' /Rect ['.$rect.']'; - $ft = array('Btn', 'Tx', 'Ch', 'Sig'); - if (isset($pl['opt']['ft']) AND in_array($pl['opt']['ft'], $ft)) { - $annots .= ' /FT /'.$pl['opt']['ft']; - $formfield = true; - } - $annots .= ' /Contents '.$this->_textstring($pl['txt'], $annot_obj_id); - $annots .= ' /P '.$this->page_obj_id[$n].' 0 R'; - $annots .= ' /NM '.$this->_datastring(sprintf('%04u-%04u', $n, $key), $annot_obj_id); - $annots .= ' /M '.$this->_datestring($annot_obj_id); - if (isset($pl['opt']['f'])) { - $val = 0; - if (is_array($pl['opt']['f'])) { - foreach ($pl['opt']['f'] as $f) { - switch (strtolower($f)) { - case 'invisible': { - $val += 1 << 0; - break; - } - case 'hidden': { - $val += 1 << 1; - break; - } - case 'print': { - $val += 1 << 2; - break; - } - case 'nozoom': { - $val += 1 << 3; - break; - } - case 'norotate': { - $val += 1 << 4; - break; - } - case 'noview': { - $val += 1 << 5; - break; - } - case 'readonly': { - $val += 1 << 6; - break; - } - case 'locked': { - $val += 1 << 8; - break; - } - case 'togglenoview': { - $val += 1 << 9; - break; - } - case 'lockedcontents': { - $val += 1 << 10; - break; - } - default: { - break; - } - } - } - } else { - $val = intval($pl['opt']['f']); - } - $annots .= ' /F '.intval($val); - } - if (isset($pl['opt']['as']) AND is_string($pl['opt']['as'])) { - $annots .= ' /AS /'.$pl['opt']['as']; - } - if (isset($pl['opt']['ap'])) { - // appearance stream - $annots .= ' /AP <<'; - if (is_array($pl['opt']['ap'])) { - foreach ($pl['opt']['ap'] as $apmode => $apdef) { - // $apmode can be: n = normal; r = rollover; d = down; - $annots .= ' /'.strtoupper($apmode); - if (is_array($apdef)) { - $annots .= ' <<'; - foreach ($apdef as $apstate => $stream) { - // reference to XObject that define the appearance for this mode-state - $apsobjid = $this->_putAPXObject($c, $d, $stream); - $annots .= ' /'.$apstate.' '.$apsobjid.' 0 R'; - } - $annots .= ' >>'; - } else { - // reference to XObject that define the appearance for this mode - $apsobjid = $this->_putAPXObject($c, $d, $apdef); - $annots .= ' '.$apsobjid.' 0 R'; - } - } - } else { - $annots .= $pl['opt']['ap']; - } - $annots .= ' >>'; - } - if (isset($pl['opt']['bs']) AND (is_array($pl['opt']['bs']))) { - $annots .= ' /BS <<'; - $annots .= ' /Type /Border'; - if (isset($pl['opt']['bs']['w'])) { - $annots .= ' /W '.intval($pl['opt']['bs']['w']); - } - $bstyles = array('S', 'D', 'B', 'I', 'U'); - if (isset($pl['opt']['bs']['s']) AND in_array($pl['opt']['bs']['s'], $bstyles)) { - $annots .= ' /S /'.$pl['opt']['bs']['s']; - } - if (isset($pl['opt']['bs']['d']) AND (is_array($pl['opt']['bs']['d']))) { - $annots .= ' /D ['; - foreach ($pl['opt']['bs']['d'] as $cord) { - $annots .= ' '.intval($cord); - } - $annots .= ']'; - } - $annots .= ' >>'; - } else { - $annots .= ' /Border ['; - if (isset($pl['opt']['border']) AND (count($pl['opt']['border']) >= 3)) { - $annots .= intval($pl['opt']['border'][0]).' '; - $annots .= intval($pl['opt']['border'][1]).' '; - $annots .= intval($pl['opt']['border'][2]); - if (isset($pl['opt']['border'][3]) AND is_array($pl['opt']['border'][3])) { - $annots .= ' ['; - foreach ($pl['opt']['border'][3] as $dash) { - $annots .= intval($dash).' '; - } - $annots .= ']'; - } - } else { - $annots .= '0 0 0'; - } - $annots .= ']'; - } - if (isset($pl['opt']['be']) AND (is_array($pl['opt']['be']))) { - $annots .= ' /BE <<'; - $bstyles = array('S', 'C'); - if (isset($pl['opt']['be']['s']) AND in_array($pl['opt']['be']['s'], $markups)) { - $annots .= ' /S /'.$pl['opt']['bs']['s']; - } else { - $annots .= ' /S /S'; - } - if (isset($pl['opt']['be']['i']) AND ($pl['opt']['be']['i'] >= 0) AND ($pl['opt']['be']['i'] <= 2)) { - $annots .= ' /I '.sprintf(' %.4F', $pl['opt']['be']['i']); - } - $annots .= '>>'; - } - if (isset($pl['opt']['c']) AND (is_array($pl['opt']['c'])) AND !empty($pl['opt']['c'])) { - $annots .= ' /C ['; - foreach ($pl['opt']['c'] as $col) { - $col = intval($col); - $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); - $annots .= sprintf(' %.4F', $color); - } - $annots .= ']'; - } - //$annots .= ' /StructParent '; - //$annots .= ' /OC '; - $markups = array('text', 'freetext', 'line', 'square', 'circle', 'polygon', 'polyline', 'highlight', 'underline', 'squiggly', 'strikeout', 'stamp', 'caret', 'ink', 'fileattachment', 'sound'); - if (in_array(strtolower($pl['opt']['subtype']), $markups)) { - // this is a markup type - if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { - $annots .= ' /T '.$this->_textstring($pl['opt']['t'], $annot_obj_id); - } - //$annots .= ' /Popup '; - if (isset($pl['opt']['ca'])) { - $annots .= ' /CA '.sprintf('%.4F', floatval($pl['opt']['ca'])); - } - if (isset($pl['opt']['rc'])) { - $annots .= ' /RC '.$this->_textstring($pl['opt']['rc'], $annot_obj_id); - } - $annots .= ' /CreationDate '.$this->_datestring($annot_obj_id); - //$annots .= ' /IRT '; - if (isset($pl['opt']['subj'])) { - $annots .= ' /Subj '.$this->_textstring($pl['opt']['subj'], $annot_obj_id); - } - //$annots .= ' /RT '; - //$annots .= ' /IT '; - //$annots .= ' /ExData '; - } - $lineendings = array('Square', 'Circle', 'Diamond', 'OpenArrow', 'ClosedArrow', 'None', 'Butt', 'ROpenArrow', 'RClosedArrow', 'Slash'); - // Annotation types - switch (strtolower($pl['opt']['subtype'])) { - case 'text': { - if (isset($pl['opt']['open'])) { - $annots .= ' /Open '. (strtolower($pl['opt']['open']) == 'true' ? 'true' : 'false'); - } - $iconsapp = array('Comment', 'Help', 'Insert', 'Key', 'NewParagraph', 'Note', 'Paragraph'); - if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { - $annots .= ' /Name /'.$pl['opt']['name']; - } else { - $annots .= ' /Name /Note'; - } - $statemodels = array('Marked', 'Review'); - if (isset($pl['opt']['statemodel']) AND in_array($pl['opt']['statemodel'], $statemodels)) { - $annots .= ' /StateModel /'.$pl['opt']['statemodel']; - } else { - $pl['opt']['statemodel'] = 'Marked'; - $annots .= ' /StateModel /'.$pl['opt']['statemodel']; - } - if ($pl['opt']['statemodel'] == 'Marked') { - $states = array('Accepted', 'Unmarked'); - } else { - $states = array('Accepted', 'Rejected', 'Cancelled', 'Completed', 'None'); - } - if (isset($pl['opt']['state']) AND in_array($pl['opt']['state'], $states)) { - $annots .= ' /State /'.$pl['opt']['state']; - } else { - if ($pl['opt']['statemodel'] == 'Marked') { - $annots .= ' /State /Unmarked'; - } else { - $annots .= ' /State /None'; - } - } - break; - } - case 'link': { - if(is_string($pl['txt'])) { - // external URI link - $annots .= ' /A <</S /URI /URI '.$this->_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; - } else { - // internal link - $l = $this->links[$pl['txt']]; - $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($l[0])], ($this->pagedim[$l[0]]['h'] - ($l[1] * $this->k))); - } - $hmodes = array('N', 'I', 'O', 'P'); - if (isset($pl['opt']['h']) AND in_array($pl['opt']['h'], $hmodes)) { - $annots .= ' /H /'.$pl['opt']['h']; - } else { - $annots .= ' /H /I'; - } - //$annots .= ' /PA '; - //$annots .= ' /Quadpoints '; - break; - } - case 'freetext': { - if (isset($pl['opt']['da']) AND !empty($pl['opt']['da'])) { - $annots .= ' /DA ('.$pl['opt']['da'].')'; - } - if (isset($pl['opt']['q']) AND ($pl['opt']['q'] >= 0) AND ($pl['opt']['q'] <= 2)) { - $annots .= ' /Q '.intval($pl['opt']['q']); - } - if (isset($pl['opt']['rc'])) { - $annots .= ' /RC '.$this->_textstring($pl['opt']['rc'], $annot_obj_id); - } - if (isset($pl['opt']['ds'])) { - $annots .= ' /DS '.$this->_textstring($pl['opt']['ds'], $annot_obj_id); - } - if (isset($pl['opt']['cl']) AND is_array($pl['opt']['cl'])) { - $annots .= ' /CL ['; - foreach ($pl['opt']['cl'] as $cl) { - $annots .= sprintf('%.4F ', $cl * $this->k); - } - $annots .= ']'; - } - $tfit = array('FreeText', 'FreeTextCallout', 'FreeTextTypeWriter'); - if (isset($pl['opt']['it']) AND in_array($pl['opt']['it'], $tfit)) { - $annots .= ' /IT /'.$pl['opt']['it']; - } - if (isset($pl['opt']['rd']) AND is_array($pl['opt']['rd'])) { - $l = $pl['opt']['rd'][0] * $this->k; - $r = $pl['opt']['rd'][1] * $this->k; - $t = $pl['opt']['rd'][2] * $this->k; - $b = $pl['opt']['rd'][3] * $this->k; - $annots .= ' /RD ['.sprintf('%.2F %.2F %.2F %.2F', $l, $r, $t, $b).']'; - } - if (isset($pl['opt']['le']) AND in_array($pl['opt']['le'], $lineendings)) { - $annots .= ' /LE /'.$pl['opt']['le']; - } - break; - } - case 'line': { - break; - } - case 'square': { - break; - } - case 'circle': { - break; - } - case 'polygon': { - break; - } - case 'polyline': { - break; - } - case 'highlight': { - break; - } - case 'underline': { - break; - } - case 'squiggly': { - break; - } - case 'strikeout': { - break; - } - case 'stamp': { - break; - } - case 'caret': { - break; - } - case 'ink': { - break; - } - case 'popup': { - break; - } - case 'fileattachment': { - if (!isset($pl['opt']['fs'])) { - break; - } - $filename = basename($pl['opt']['fs']); - if (isset($this->embeddedfiles[$filename]['n'])) { - $annots .= ' /FS <</Type /Filespec /F '.$this->_datastring($filename, $annot_obj_id).' /EF <</F '.$this->embeddedfiles[$filename]['n'].' 0 R>> >>'; - $iconsapp = array('Graph', 'Paperclip', 'PushPin', 'Tag'); - if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { - $annots .= ' /Name /'.$pl['opt']['name']; - } else { - $annots .= ' /Name /PushPin'; - } - } - break; - } - case 'sound': { - if (!isset($pl['opt']['fs'])) { - break; - } - $filename = basename($pl['opt']['fs']); - if (isset($this->embeddedfiles[$filename]['n'])) { - // ... TO BE COMPLETED ... - // /R /C /B /E /CO /CP - $annots .= ' /Sound <</Type /Filespec /F '.$this->_datastring($filename, $annot_obj_id).' /EF <</F '.$this->embeddedfiles[$filename]['n'].' 0 R>> >>'; - $iconsapp = array('Speaker', 'Mic'); - if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { - $annots .= ' /Name /'.$pl['opt']['name']; - } else { - $annots .= ' /Name /Speaker'; - } - } - break; - } - case 'movie': { - break; - } - case 'widget': { - $hmode = array('N', 'I', 'O', 'P', 'T'); - if (isset($pl['opt']['h']) AND in_array($pl['opt']['h'], $hmode)) { - $annots .= ' /H /'.$pl['opt']['h']; - } - if (isset($pl['opt']['mk']) AND (is_array($pl['opt']['mk'])) AND !empty($pl['opt']['mk'])) { - $annots .= ' /MK <<'; - if (isset($pl['opt']['mk']['r'])) { - $annots .= ' /R '.$pl['opt']['mk']['r']; - } - if (isset($pl['opt']['mk']['bc']) AND (is_array($pl['opt']['mk']['bc']))) { - $annots .= ' /BC ['; - foreach($pl['opt']['mk']['bc'] AS $col) { - $col = intval($col); - $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); - $annots .= sprintf(' %.2F', $color); - } - $annots .= ']'; - } - if (isset($pl['opt']['mk']['bg']) AND (is_array($pl['opt']['mk']['bg']))) { - $annots .= ' /BG ['; - foreach($pl['opt']['mk']['bg'] AS $col) { - $col = intval($col); - $color = $col <= 0 ? 0 : ($col >= 255 ? 1 : $col / 255); - $annots .= sprintf(' %.2F', $color); - } - $annots .= ']'; - } - if (isset($pl['opt']['mk']['ca'])) { - $annots .= ' /CA '.$pl['opt']['mk']['ca']; - } - if (isset($pl['opt']['mk']['rc'])) { - $annots .= ' /RC '.$pl['opt']['mk']['rc']; - } - if (isset($pl['opt']['mk']['ac'])) { - $annots .= ' /AC '.$pl['opt']['mk']['ac']; - } - if (isset($pl['opt']['mk']['i'])) { - $info = $this->getImageBuffer($pl['opt']['mk']['i']); - if ($info !== false) { - $annots .= ' /I '.$info['n'].' 0 R'; - } - } - if (isset($pl['opt']['mk']['ri'])) { - $info = $this->getImageBuffer($pl['opt']['mk']['ri']); - if ($info !== false) { - $annots .= ' /RI '.$info['n'].' 0 R'; - } - } - if (isset($pl['opt']['mk']['ix'])) { - $info = $this->getImageBuffer($pl['opt']['mk']['ix']); - if ($info !== false) { - $annots .= ' /IX '.$info['n'].' 0 R'; - } - } - if (isset($pl['opt']['mk']['if']) AND (is_array($pl['opt']['mk']['if'])) AND !empty($pl['opt']['mk']['if'])) { - $annots .= ' /IF <<'; - $if_sw = array('A', 'B', 'S', 'N'); - if (isset($pl['opt']['mk']['if']['sw']) AND in_array($pl['opt']['mk']['if']['sw'], $if_sw)) { - $annots .= ' /SW /'.$pl['opt']['mk']['if']['sw']; - } - $if_s = array('A', 'P'); - if (isset($pl['opt']['mk']['if']['s']) AND in_array($pl['opt']['mk']['if']['s'], $if_s)) { - $annots .= ' /S /'.$pl['opt']['mk']['if']['s']; - } - if (isset($pl['opt']['mk']['if']['a']) AND (is_array($pl['opt']['mk']['if']['a'])) AND !empty($pl['opt']['mk']['if']['a'])) { - $annots .= sprintf(' /A [%.2F %.2F]', $pl['opt']['mk']['if']['a'][0], $pl['opt']['mk']['if']['a'][1]); - } - if (isset($pl['opt']['mk']['if']['fb']) AND ($pl['opt']['mk']['if']['fb'])) { - $annots .= ' /FB true'; - } - $annots .= '>>'; - } - if (isset($pl['opt']['mk']['tp']) AND ($pl['opt']['mk']['tp'] >= 0) AND ($pl['opt']['mk']['tp'] <= 6)) { - $annots .= ' /TP '.intval($pl['opt']['mk']['tp']); - } else { - $annots .= ' /TP 0'; - } - $annots .= '>>'; - } // end MK - // --- Entries for field dictionaries --- - if (isset($this->radiobutton_groups[$n][$pl['txt']])) { - // set parent - $annots .= ' /Parent '.$this->radiobutton_groups[$n][$pl['txt']].' 0 R'; - } - if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { - $annots .= ' /T '.$this->_datastring($pl['opt']['t'], $annot_obj_id); - } - if (isset($pl['opt']['tu']) AND is_string($pl['opt']['tu'])) { - $annots .= ' /TU '.$this->_datastring($pl['opt']['tu'], $annot_obj_id); - } - if (isset($pl['opt']['tm']) AND is_string($pl['opt']['tm'])) { - $annots .= ' /TM '.$this->_datastring($pl['opt']['tm'], $annot_obj_id); - } - if (isset($pl['opt']['ff'])) { - if (is_array($pl['opt']['ff'])) { - // array of bit settings - $flag = 0; - foreach($pl['opt']['ff'] as $val) { - $flag += 1 << ($val - 1); - } - } else { - $flag = intval($pl['opt']['ff']); - } - $annots .= ' /Ff '.$flag; - } - if (isset($pl['opt']['maxlen'])) { - $annots .= ' /MaxLen '.intval($pl['opt']['maxlen']); - } - if (isset($pl['opt']['v'])) { - $annots .= ' /V'; - if (is_array($pl['opt']['v'])) { - foreach ($pl['opt']['v'] AS $optval) { - if (is_float($optval)) { - $optval = sprintf('%.2F', $optval); - } - $annots .= ' '.$optval; - } - } else { - $annots .= ' '.$this->_textstring($pl['opt']['v'], $annot_obj_id); - } - } - if (isset($pl['opt']['dv'])) { - $annots .= ' /DV'; - if (is_array($pl['opt']['dv'])) { - foreach ($pl['opt']['dv'] AS $optval) { - if (is_float($optval)) { - $optval = sprintf('%.2F', $optval); - } - $annots .= ' '.$optval; - } - } else { - $annots .= ' '.$this->_textstring($pl['opt']['dv'], $annot_obj_id); - } - } - if (isset($pl['opt']['rv'])) { - $annots .= ' /RV'; - if (is_array($pl['opt']['rv'])) { - foreach ($pl['opt']['rv'] AS $optval) { - if (is_float($optval)) { - $optval = sprintf('%.2F', $optval); - } - $annots .= ' '.$optval; - } - } else { - $annots .= ' '.$this->_textstring($pl['opt']['rv'], $annot_obj_id); - } - } - if (isset($pl['opt']['a']) AND !empty($pl['opt']['a'])) { - $annots .= ' /A << '.$pl['opt']['a'].' >>'; - } - if (isset($pl['opt']['aa']) AND !empty($pl['opt']['aa'])) { - $annots .= ' /AA << '.$pl['opt']['aa'].' >>'; - } - if (isset($pl['opt']['da']) AND !empty($pl['opt']['da'])) { - $annots .= ' /DA ('.$pl['opt']['da'].')'; - } - if (isset($pl['opt']['q']) AND ($pl['opt']['q'] >= 0) AND ($pl['opt']['q'] <= 2)) { - $annots .= ' /Q '.intval($pl['opt']['q']); - } - if (isset($pl['opt']['opt']) AND (is_array($pl['opt']['opt'])) AND !empty($pl['opt']['opt'])) { - $annots .= ' /Opt ['; - foreach($pl['opt']['opt'] AS $copt) { - if (is_array($copt)) { - $annots .= ' ['.$this->_textstring($copt[0], $annot_obj_id).' '.$this->_textstring($copt[1], $annot_obj_id).']'; - } else { - $annots .= ' '.$this->_textstring($copt, $annot_obj_id); - } - } - $annots .= ']'; - } - if (isset($pl['opt']['ti'])) { - $annots .= ' /TI '.intval($pl['opt']['ti']); - } - if (isset($pl['opt']['i']) AND (is_array($pl['opt']['i'])) AND !empty($pl['opt']['i'])) { - $annots .= ' /I ['; - foreach($pl['opt']['i'] AS $copt) { - $annots .= intval($copt).' '; - } - $annots .= ']'; - } - break; - } - case 'screen': { - break; - } - case 'printermark': { - break; - } - case 'trapnet': { - break; - } - case 'watermark': { - break; - } - case '3d': { - break; - } - default: { - break; - } - } - $annots .= '>>'; - // create new annotation object - $this->_out($this->_getobj($annot_obj_id)."\n".$annots."\n".'endobj'); - if ($formfield AND !isset($this->radiobutton_groups[$n][$pl['txt']])) { - // store reference of form object - $this->form_obj_id[] = $annot_obj_id; - } - } - } - } // end for each page - } - - /** - * Put appearance streams XObject used to define annotation's appearance states - * @param int $w annotation width - * @param int $h annotation height - * @param string $stream appearance stream - * @return int object ID - * @access protected - * @since 4.8.001 (2009-09-09) - */ - protected function _putAPXObject($w=0, $h=0, $stream='') { - $stream = trim($stream); - $out = $this->_getobj()."\n"; - $this->xobjects['AX'.$this->n] = array('n' => $this->n); - $out .= '<<'; - $out .= ' /Type /XObject'; - $out .= ' /Subtype /Form'; - $out .= ' /FormType 1'; - if ($this->compress) { - $stream = gzcompress($stream); - $out .= ' /Filter /FlateDecode'; - } - $rect = sprintf('%.2F %.2F', $w, $h); - $out .= ' /BBox [0 0 '.$rect.']'; - $out .= ' /Matrix [1 0 0 1 0 0]'; - $out .= ' /Resources <<'; - $out .= ' /ProcSet [/PDF /Text]'; - $out .= ' /Font <<'; - foreach ($this->annotation_fonts as $fontkey => $fontid) { - $out .= ' /F'.$fontid.' '.$this->font_obj_ids[$fontkey].' 0 R'; - } - $out .= ' >>'; - $out .= ' >>'; - $stream = $this->_getrawstream($stream); - $out .= ' /Length '.strlen($stream); - $out .= ' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - return $this->n; - } - - /** - * Get ULONG from string (Big Endian 32-bit unsigned integer). - * @param string $str string from where to extract value - * @param int $offset point from where to read the data - * @return int 32 bit value - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getULONG(&$str, &$offset) { - $v = unpack('Ni', substr($str, $offset, 4)); - $offset += 4; - return $v['i']; - } - - /** - * Get USHORT from string (Big Endian 16-bit unsigned integer). - * @param string $str string from where to extract value - * @param int $offset point from where to read the data - * @return int 16 bit value - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getUSHORT(&$str, &$offset) { - $v = unpack('ni', substr($str, $offset, 2)); - $offset += 2; - return $v['i']; - } - - /** - * Get SHORT from string (Big Endian 16-bit signed integer). - * @param string $str string from where to extract value - * @param int $offset point from where to read the data - * @return int 16 bit value - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getSHORT(&$str, &$offset) { - $v = unpack('si', substr($str, $offset, 2)); - $offset += 2; - return $v['i']; - } - - /** - * Get BYTE from string (8-bit unsigned integer). - * @param string $str string from where to extract value - * @param int $offset point from where to read the data - * @return int 8 bit value - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getBYTE(&$str, &$offset) { - $v = unpack('Ci', substr($str, $offset, 1)); - ++$offset; - return $v['i']; - } - - /** - * Returns a subset of the TrueType font data without the unused glyphs. - * @param string $font TrueType font data - * @param array $subsetchars array of used characters (the glyphs to keep) - * @return string a subset of TrueType font data without the unused glyphs - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getTrueTypeFontSubset($font, $subsetchars) { - ksort($subsetchars); - $offset = 0; // offset position of the font data - if ($this->_getULONG($font, $offset) != 0x10000) { - // sfnt version must be 0x00010000 for TrueType version 1.0. - return $font; - } - // get number of tables - $numTables = $this->_getUSHORT($font, $offset); - // skip searchRange, entrySelector and rangeShift - $offset += 6; - // tables array - $table = array(); - // for each table - for ($i = 0; $i < $numTables; ++$i) { - // get table info - $tag = substr($font, $offset, 4); - $offset += 4; - $table[$tag] = array(); - $table[$tag]['checkSum'] = $this->_getULONG($font, $offset); - $table[$tag]['offset'] = $this->_getULONG($font, $offset); - $table[$tag]['length'] = $this->_getULONG($font, $offset); - } - // check magicNumber - $offset = $table['head']['offset'] + 12; - if ($this->_getULONG($font, $offset) != 0x5F0F3CF5) { - // magicNumber must be 0x5F0F3CF5 - return $font; - } - // get offset mode (indexToLocFormat : 0 = short, 1 = long) - $offset = $table['head']['offset'] + 50; - $short_offset = ($this->_getSHORT($font, $offset) == 0); - // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table - $indexToLoc = array(); - $offset = $table['loca']['offset']; - if ($short_offset) { - // short version - $n = $table['loca']['length'] / 2; // numGlyphs + 1 - for ($i = 0; $i < $n; ++$i) { - $indexToLoc[$i] = $this->_getUSHORT($font, $offset) * 2; - } - } else { - // long version - $n = $table['loca']['length'] / 4; // numGlyphs + 1 - for ($i = 0; $i < $n; ++$i) { - $indexToLoc[$i] = $this->_getULONG($font, $offset); - } - } - // get glyphs indexes of chars from cmap table - $subsetglyphs = array(); // glyph IDs on key - $subsetglyphs[0] = true; // character codes that do not correspond to any glyph in the font should be mapped to glyph index 0 - $offset = $table['cmap']['offset'] + 2; - $numEncodingTables = $this->_getUSHORT($font, $offset); - $encodingTables = array(); - for ($i = 0; $i < $numEncodingTables; ++$i) { - $encodingTables[$i]['platformID'] = $this->_getUSHORT($font, $offset); - $encodingTables[$i]['encodingID'] = $this->_getUSHORT($font, $offset); - $encodingTables[$i]['offset'] = $this->_getULONG($font, $offset); - } - foreach ($encodingTables as $enctable) { - if (($enctable['platformID'] == 3) AND ($enctable['encodingID'] == 0)) { - $modesymbol = true; - } else { - $modesymbol = false; - } - $offset = $table['cmap']['offset'] + $enctable['offset']; - $format = $this->_getUSHORT($font, $offset); - switch ($format) { - case 0: { // Format 0: Byte encoding table - $offset += 4; // skip length and version/language - for ($k = 0; $k < 256; ++$k) { - if (isset($subsetchars[$k])) { - $g = $this->_getBYTE($font, $offset); - $subsetglyphs[$g] = $k; - } else { - ++$offset; - } - } - break; - } - case 2: { // Format 2: High-byte mapping through table - $offset += 4; // skip length and version - // to be implemented ... - break; - } - case 4: { // Format 4: Segment mapping to delta values - $length = $this->_getUSHORT($font, $offset); - $offset += 2; // skip version/language - $segCount = ($this->_getUSHORT($font, $offset) / 2); - $offset += 6; // skip searchRange, entrySelector, rangeShift - $endCount = array(); // array of end character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $endCount[$k] = $this->_getUSHORT($font, $offset); - } - $offset += 2; // skip reservedPad - $startCount = array(); // array of start character codes for each segment - for ($k = 0; $k < $segCount; ++$k) { - $startCount[$k] = $this->_getUSHORT($font, $offset); - } - $idDelta = array(); // delta for all character codes in segment - for ($k = 0; $k < $segCount; ++$k) { - $idDelta[$k] = $this->_getUSHORT($font, $offset); - } - $idRangeOffset = array(); // Offsets into glyphIdArray or 0 - for ($k = 0; $k < $segCount; ++$k) { - $idRangeOffset[$k] = $this->_getUSHORT($font, $offset); - } - $gidlen = ($length / 2) - 8 - (4 * $segCount); - $glyphIdArray = array(); // glyph index array - for ($k = 0; $k < $gidlen; ++$k) { - $glyphIdArray[$k] = $this->_getUSHORT($font, $offset); - } - for ($k = 0; $k < $segCount; ++$k) { - for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { - if (isset($subsetchars[$c])) { - if ($idRangeOffset[$k] == 0) { - $g = $c; - } else { - $gid = (($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); - $g = $glyphIdArray[$gid]; - } - $g += ($idDelta[$k] - 65536); - if ($g < 0) { - $g = 0; - } - $subsetglyphs[$g] = $c; - } - } - } - break; - } - case 6: { // Format 6: Trimmed table mapping - $offset += 4; // skip length and version/language - $firstCode = $this->_getUSHORT($font, $offset); - $entryCount = $this->_getUSHORT($font, $offset); - for ($k = 0; $k < $entryCount; ++$k) { - $c = ($k + $firstCode); - if (isset($subsetchars[$c])) { - $g = $this->_getUSHORT($font, $offset); - $subsetglyphs[$g] = $c; - } else { - $offset += 2; - } - } - break; - } - case 8: { // Format 8: Mixed 16-bit and 32-bit coverage - $offset += 10; // skip length and version - // to be implemented ... - break; - } - case 10: { // Format 10: Trimmed array - $offset += 10; // skip length and version/language - $startCharCode = $this->_getULONG($font, $offset); - $numChars = $this->_getULONG($font, $offset); - for ($k = 0; $k < $numChars; ++$k) { - $c = ($k + $startCharCode); - if (isset($subsetchars[$c])) { - $g = $this->_getUSHORT($font, $offset); - $subsetglyphs[$g] = $c; - } else { - $offset += 2; - } - } - break; - } - case 12: { // Format 12: Segmented coverage - $offset += 10; // skip length and version/language - $nGroups = $this->_getULONG($font, $offset); - for ($k = 0; $k < $nGroups; ++$k) { - $startCharCode = $this->_getULONG($font, $offset); - $endCharCode = $this->_getULONG($font, $offset); - $startGlyphCode = $this->_getULONG($font, $offset); - for ($c = $startCharCode; $c <= $endCharCode; ++$c) { - if (isset($subsetchars[$c])) { - $subsetglyphs[$startGlyphCode] = $c; - } - ++$startGlyphCode; - } - } - break; - } - } - } - // sort glyphs by key - ksort($subsetglyphs); - // add composite glyps to $subsetglyphs and remove missing glyphs - foreach ($subsetglyphs as $key => $val) { - if (isset($indexToLoc[$key])) { - $offset = $table['glyf']['offset'] + $indexToLoc[$key]; - $numberOfContours = $this->_getSHORT($font, $offset); - if ($numberOfContours < 0) { // composite glyph - $offset += 8; // skip xMin, yMin, xMax, yMax - do { - $flags = $this->_getUSHORT($font, $offset); - $glyphIndex = $this->_getUSHORT($font, $offset); - if (!isset($subsetglyphs[$glyphIndex]) AND isset($indexToLoc[$glyphIndex])) { - // add missing glyphs - $subsetglyphs[$glyphIndex] = true; - } - // skip some bytes by case - if ($flags & 1) { - $offset += 4; - } else { - $offset += 2; - } - if ($flags & 8) { - $offset += 2; - } elseif ($flags & 64) { - $offset += 4; - } elseif ($flags & 128) { - $offset += 8; - } - } while ($flags & 32); - } - } else { - unset($subsetglyphs[$key]); - } - } - // build new glyf table with only used glyphs - $glyf = ''; - $glyfSize = 0; - // create new empty indexToLoc table - $newIndexToLoc = array_fill(0, count($indexToLoc), 0); - $goffset = 0; - foreach ($subsetglyphs as $glyphID => $char) { - if (isset($indexToLoc[$glyphID]) AND isset($indexToLoc[($glyphID + 1)])) { - $start = $indexToLoc[$glyphID]; - $length = ($indexToLoc[($glyphID + 1)] - $start); - $glyf .= substr($font, ($table['glyf']['offset'] + $start), $length); - $newIndexToLoc[$glyphID] = $goffset; - $goffset += $length; - } - } - // build new loca table - $loca = ''; - if ($short_offset) { - foreach ($newIndexToLoc as $glyphID => $offset) { - $loca .= pack('n', ($offset / 2)); - } - } else { - foreach ($newIndexToLoc as $glyphID => $offset) { - $loca .= pack('N', $offset); - } - } - // array of table names to preserve (loca and glyf tables will be added later) - //$table_names = array ('cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'OS/2', 'post', 'cvt ', 'fpgm', 'prep'); - // the cmap table is not needed and shall not be present, since the mapping from character codes to glyph descriptions is provided separately - $table_names = array ('head', 'hhea', 'hmtx', 'maxp', 'cvt ', 'fpgm', 'prep'); // minimum required table names - // get the tables to preserve - $offset = 12; - foreach ($table as $tag => $val) { - if (in_array($tag, $table_names)) { - $table[$tag]['data'] = substr($font, $table[$tag]['offset'], $table[$tag]['length']); - if ($tag == 'head') { - // set the checkSumAdjustment to 0 - $table[$tag]['data'] = substr($table[$tag]['data'], 0, 8)."\x0\x0\x0\x0".substr($table[$tag]['data'], 12); - } - $pad = 4 - ($table[$tag]['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table[$tag]['length'] += $pad; - $table[$tag]['data'] .= str_repeat("\x0", $pad); - } - $table[$tag]['offset'] = $offset; - $offset += $table[$tag]['length']; - // check sum is not changed (so keep the following line commented) - //$table[$tag]['checkSum'] = $this->_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length']); - } else { - unset($table[$tag]); - } - } - // add loca - $table['loca']['data'] = $loca; - $table['loca']['length'] = strlen($loca); - $pad = 4 - ($table['loca']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['loca']['length'] += $pad; - $table['loca']['data'] .= str_repeat("\x0", $pad); - } - $table['loca']['offset'] = $offset; - $table['loca']['checkSum'] = $this->_getTTFtableChecksum($table['loca']['data'], $table['loca']['length']); - $offset += $table['loca']['length']; - // add glyf - $table['glyf']['data'] = $glyf; - $table['glyf']['length'] = strlen($glyf); - $pad = 4 - ($table['glyf']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['glyf']['length'] += $pad; - $table['glyf']['data'] .= str_repeat("\x0", $pad); - } - $table['glyf']['offset'] = $offset; - $table['glyf']['checkSum'] = $this->_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length']); - // rebuild font - $font = ''; - $font .= pack('N', 0x10000); // sfnt version - $numTables = count($table); - $font .= pack('n', $numTables); // numTables - $entrySelector = floor(log($numTables, 2)); - $searchRange = pow(2, $entrySelector) * 16; - $rangeShift = ($numTables * 16) - $searchRange; - $font .= pack('n', $searchRange); // searchRange - $font .= pack('n', $entrySelector); // entrySelector - $font .= pack('n', $rangeShift); // rangeShift - $offset = ($numTables * 16); - foreach ($table as $tag => $data) { - $font .= $tag; // tag - $font .= pack('N', $data['checkSum']); // checkSum - $font .= pack('N', ($data['offset'] + $offset)); // offset - $font .= pack('N', $data['length']); // length - } - foreach ($table as $data) { - $font .= $data['data']; - } - // set checkSumAdjustment on head table - $checkSumAdjustment = 0xB1B0AFBA - $this->_getTTFtableChecksum($font, strlen($font)); - $font = substr($font, 0, $table['head']['offset'] + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + 12); - return $font; - } - - /** - * Returs the checksum of a TTF table. - * @param string $table table to check - * @param int $length lenght of table in bytes - * @return int checksum - * @author Nicola Asuni - * @access protected - * @since 5.2.000 (2010-06-02) - */ - protected function _getTTFtableChecksum($table, $length) { - $sum = 0; - $tlen = ($length / 4); - $offset = 0; - for ($i = 0; $i < $tlen; ++$i) { - $v = unpack('Ni', substr($table, $offset, 4)); - $sum += $v['i']; - $offset += 4; - } - $sum = unpack('Ni', pack('N', $sum)); - return $sum['i']; - } - - /** - * Outputs font widths - * @param array $font font data - * @param int $cidoffset offset for CID values - * @return PDF command string for font widths - * @author Nicola Asuni - * @access protected - * @since 4.4.000 (2008-12-07) - */ - protected function _putfontwidths($font, $cidoffset=0) { - ksort($font['cw']); - $rangeid = 0; - $range = array(); - $prevcid = -2; - $prevwidth = -1; - $interval = false; - // for each character - foreach ($font['cw'] as $cid => $width) { - $cid -= $cidoffset; - if ($font['subset'] AND ($cid > 255) AND (!isset($font['subsetchars'][$cid]))) { - // ignore the unused characters (font subsetting) - continue; - } - if ($width != $font['dw']) { - if ($cid == ($prevcid + 1)) { - // consecutive CID - if ($width == $prevwidth) { - if ($width == $range[$rangeid][0]) { - $range[$rangeid][] = $width; - } else { - array_pop($range[$rangeid]); - // new range - $rangeid = $prevcid; - $range[$rangeid] = array(); - $range[$rangeid][] = $prevwidth; - $range[$rangeid][] = $width; - } - $interval = true; - $range[$rangeid]['interval'] = true; - } else { - if ($interval) { - // new range - $rangeid = $cid; - $range[$rangeid] = array(); - $range[$rangeid][] = $width; - } else { - $range[$rangeid][] = $width; - } - $interval = false; - } - } else { - // new range - $rangeid = $cid; - $range[$rangeid] = array(); - $range[$rangeid][] = $width; - $interval = false; - } - $prevcid = $cid; - $prevwidth = $width; - } - } - // optimize ranges - $prevk = -1; - $nextk = -1; - $prevint = false; - foreach ($range as $k => $ws) { - $cws = count($ws); - if (($k == $nextk) AND (!$prevint) AND ((!isset($ws['interval'])) OR ($cws < 4))) { - if (isset($range[$k]['interval'])) { - unset($range[$k]['interval']); - } - $range[$prevk] = array_merge($range[$prevk], $range[$k]); - unset($range[$k]); - } else { - $prevk = $k; - } - $nextk = $k + $cws; - if (isset($ws['interval'])) { - if ($cws > 3) { - $prevint = true; - } else { - $prevint = false; - } - unset($range[$k]['interval']); - --$nextk; - } else { - $prevint = false; - } - } - // output data - $w = ''; - foreach ($range as $k => $ws) { - if (count(array_count_values($ws)) == 1) { - // interval mode is more compact - $w .= ' '.$k.' '.($k + count($ws) - 1).' '.$ws[0]; - } else { - // range mode - $w .= ' '.$k.' [ '.implode(' ', $ws).' ]'; - } - } - return '/W ['.$w.' ]'; - } - - /** - * Output fonts. - * @author Nicola Asuni - * @access protected - */ - protected function _putfonts() { - $nf = $this->n; - foreach ($this->diffs as $diff) { - //Encodings - $this->_newobj(); - $this->_out('<< /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.'] >>'."\n".'endobj'); - } - $mqr = $this->get_mqr(); - $this->set_mqr(false); - foreach ($this->FontFiles as $file => $info) { - // search and get font file to embedd - $fontdir = $info['fontdir']; - $file = strtolower($file); - $fontfile = ''; - // search files on various directories - if (($fontdir !== false) AND file_exists($fontdir.$file)) { - $fontfile = $fontdir.$file; - } elseif (file_exists($this->_getfontpath().$file)) { - $fontfile = $this->_getfontpath().$file; - } elseif (file_exists($file)) { - $fontfile = $file; - } - if (!$this->empty_string($fontfile)) { - $font = file_get_contents($fontfile); - $compressed = (substr($file, -2) == '.z'); - if ((!$compressed) AND (isset($info['length2']))) { - $header = (ord($font{0}) == 128); - if ($header) { - //Strip first binary header - $font = substr($font, 6); - } - if ($header AND (ord($font{$info['length1']}) == 128)) { - //Strip second binary header - $font = substr($font, 0, $info['length1']).substr($font, ($info['length1'] + 6)); - } - } elseif ($info['subset'] AND ((!$compressed) OR ($compressed AND function_exists('gzcompress')))) { - if ($compressed) { - // uncompress font - $font = gzuncompress($font); - } - // merge subset characters - $subsetchars = array(); // used chars - foreach ($info['fontkeys'] as $fontkey) { - $fontinfo = $this->getFontBuffer($fontkey); - $subsetchars += $fontinfo['subsetchars']; - } - $font = $this->_getTrueTypeFontSubset($font, $subsetchars); - if ($compressed) { - // recompress font - $font = gzcompress($font); - } - } - $this->_newobj(); - $this->FontFiles[$file]['n'] = $this->n; - $stream = $this->_getrawstream($font); - $out = '<< /Length '.strlen($stream); - if ($compressed) { - $out .= ' /Filter /FlateDecode'; - } - $out .= ' /Length1 '.$info['length1']; - if (isset($info['length2'])) { - $out .= ' /Length2 '.$info['length2'].' /Length3 0'; - } - $out .= ' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - $this->set_mqr($mqr); - foreach ($this->fontkeys as $k) { - //Font objects - $font = $this->getFontBuffer($k); - $type = $font['type']; - $name = $font['name']; - if ($type == 'core') { - // standard core font - $out = $this->_getobj($this->font_obj_ids[$k])."\n"; - $out .= '<</Type /Font'; - $out .= ' /Subtype /Type1'; - $out .= ' /BaseFont /'.$name; - $out .= ' /Name /F'.$font['i']; - if ((strtolower($name) != 'symbol') AND (strtolower($name) != 'zapfdingbats')) { - $out .= ' /Encoding /WinAnsiEncoding'; - } - if ($k == 'helvetica') { - // add default font for annotations - $this->annotation_fonts[$k] = $font['i']; - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } elseif (($type == 'Type1') OR ($type == 'TrueType')) { - // additional Type1 or TrueType font - $out = $this->_getobj($this->font_obj_ids[$k])."\n"; - $out .= '<</Type /Font'; - $out .= ' /Subtype /'.$type; - $out .= ' /BaseFont /'.$name; - $out .= ' /Name /F'.$font['i']; - $out .= ' /FirstChar 32 /LastChar 255'; - $out .= ' /Widths '.($this->n + 1).' 0 R'; - $out .= ' /FontDescriptor '.($this->n + 2).' 0 R'; - if ($font['enc']) { - if (isset($font['diff'])) { - $out .= ' /Encoding '.($nf + $font['diff']).' 0 R'; - } else { - $out .= ' /Encoding /WinAnsiEncoding'; - } - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - // Widths - $this->_newobj(); - $cw = &$font['cw']; - $s = '['; - for ($i = 32; $i < 256; ++$i) { - $s .= $cw[$i].' '; - } - $s .= ']'; - $s .= "\n".'endobj'; - $this->_out($s); - //Descriptor - $this->_newobj(); - $s = '<</Type /FontDescriptor /FontName /'.$name; - foreach ($font['desc'] as $fdk => $fdv) { - if(is_float($fdv)) { - $fdv = sprintf('%.3F', $fdv); - } - $s .= ' /'.$fdk.' '.$fdv.''; - } - if (!$this->empty_string($font['file'])) { - $s .= ' /FontFile'.($type == 'Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R'; - } - $s .= '>>'; - $s .= "\n".'endobj'; - $this->_out($s); - } else { - // additional types - $mtd = '_put'.strtolower($type); - if (!method_exists($this, $mtd)) { - $this->Error('Unsupported font type: '.$type); - } - $this->$mtd($font); - } - } - } - - /** - * Adds unicode fonts.<br> - * Based on PDF Reference 1.3 (section 5) - * @param array $font font data - * @access protected - * @author Nicola Asuni - * @since 1.52.0.TC005 (2005-01-05) - */ - protected function _puttruetypeunicode($font) { - $fontname = ''; - if ($font['subset']) { - // change name for font subsetting - $subtag = sprintf('%06u', $font['i']); - $subtag = strtr($subtag, '0123456789', 'ABCDEFGHIJ'); - $fontname .= $subtag.'+'; - } - $fontname .= $font['name']; - // Type0 Font - // A composite font composed of other fonts, organized hierarchically - $out = $this->_getobj($this->font_obj_ids[$font['fontkey']])."\n"; - $out .= '<< /Type /Font'; - $out .= ' /Subtype /Type0'; - $out .= ' /BaseFont /'.$fontname; - $out .= ' /Name /F'.$font['i']; - $out .= ' /Encoding /'.$font['enc']; - $out .= ' /ToUnicode '.($this->n + 1).' 0 R'; - $out .= ' /DescendantFonts ['.($this->n + 2).' 0 R]'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - // ToUnicode map for Identity-H - $stream = "/CIDInit /ProcSet findresource begin\n"; - $stream .= "12 dict begin\n"; - $stream .= "begincmap\n"; - $stream .= "/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n"; - $stream .= "/CMapName /Adobe-Identity-UCS def\n"; - $stream .= "/CMapType 2 def\n"; - $stream .= "/WMode 0 def\n"; - $stream .= "1 begincodespacerange\n"; - $stream .= "<0000> <FFFF>\n"; - $stream .= "endcodespacerange\n"; - $stream .= "100 beginbfrange\n"; - $stream .= "<0000> <00ff> <0000>\n"; - $stream .= "<0100> <01ff> <0100>\n"; - $stream .= "<0200> <02ff> <0200>\n"; - $stream .= "<0300> <03ff> <0300>\n"; - $stream .= "<0400> <04ff> <0400>\n"; - $stream .= "<0500> <05ff> <0500>\n"; - $stream .= "<0600> <06ff> <0600>\n"; - $stream .= "<0700> <07ff> <0700>\n"; - $stream .= "<0800> <08ff> <0800>\n"; - $stream .= "<0900> <09ff> <0900>\n"; - $stream .= "<0a00> <0aff> <0a00>\n"; - $stream .= "<0b00> <0bff> <0b00>\n"; - $stream .= "<0c00> <0cff> <0c00>\n"; - $stream .= "<0d00> <0dff> <0d00>\n"; - $stream .= "<0e00> <0eff> <0e00>\n"; - $stream .= "<0f00> <0fff> <0f00>\n"; - $stream .= "<1000> <10ff> <1000>\n"; - $stream .= "<1100> <11ff> <1100>\n"; - $stream .= "<1200> <12ff> <1200>\n"; - $stream .= "<1300> <13ff> <1300>\n"; - $stream .= "<1400> <14ff> <1400>\n"; - $stream .= "<1500> <15ff> <1500>\n"; - $stream .= "<1600> <16ff> <1600>\n"; - $stream .= "<1700> <17ff> <1700>\n"; - $stream .= "<1800> <18ff> <1800>\n"; - $stream .= "<1900> <19ff> <1900>\n"; - $stream .= "<1a00> <1aff> <1a00>\n"; - $stream .= "<1b00> <1bff> <1b00>\n"; - $stream .= "<1c00> <1cff> <1c00>\n"; - $stream .= "<1d00> <1dff> <1d00>\n"; - $stream .= "<1e00> <1eff> <1e00>\n"; - $stream .= "<1f00> <1fff> <1f00>\n"; - $stream .= "<2000> <20ff> <2000>\n"; - $stream .= "<2100> <21ff> <2100>\n"; - $stream .= "<2200> <22ff> <2200>\n"; - $stream .= "<2300> <23ff> <2300>\n"; - $stream .= "<2400> <24ff> <2400>\n"; - $stream .= "<2500> <25ff> <2500>\n"; - $stream .= "<2600> <26ff> <2600>\n"; - $stream .= "<2700> <27ff> <2700>\n"; - $stream .= "<2800> <28ff> <2800>\n"; - $stream .= "<2900> <29ff> <2900>\n"; - $stream .= "<2a00> <2aff> <2a00>\n"; - $stream .= "<2b00> <2bff> <2b00>\n"; - $stream .= "<2c00> <2cff> <2c00>\n"; - $stream .= "<2d00> <2dff> <2d00>\n"; - $stream .= "<2e00> <2eff> <2e00>\n"; - $stream .= "<2f00> <2fff> <2f00>\n"; - $stream .= "<3000> <30ff> <3000>\n"; - $stream .= "<3100> <31ff> <3100>\n"; - $stream .= "<3200> <32ff> <3200>\n"; - $stream .= "<3300> <33ff> <3300>\n"; - $stream .= "<3400> <34ff> <3400>\n"; - $stream .= "<3500> <35ff> <3500>\n"; - $stream .= "<3600> <36ff> <3600>\n"; - $stream .= "<3700> <37ff> <3700>\n"; - $stream .= "<3800> <38ff> <3800>\n"; - $stream .= "<3900> <39ff> <3900>\n"; - $stream .= "<3a00> <3aff> <3a00>\n"; - $stream .= "<3b00> <3bff> <3b00>\n"; - $stream .= "<3c00> <3cff> <3c00>\n"; - $stream .= "<3d00> <3dff> <3d00>\n"; - $stream .= "<3e00> <3eff> <3e00>\n"; - $stream .= "<3f00> <3fff> <3f00>\n"; - $stream .= "<4000> <40ff> <4000>\n"; - $stream .= "<4100> <41ff> <4100>\n"; - $stream .= "<4200> <42ff> <4200>\n"; - $stream .= "<4300> <43ff> <4300>\n"; - $stream .= "<4400> <44ff> <4400>\n"; - $stream .= "<4500> <45ff> <4500>\n"; - $stream .= "<4600> <46ff> <4600>\n"; - $stream .= "<4700> <47ff> <4700>\n"; - $stream .= "<4800> <48ff> <4800>\n"; - $stream .= "<4900> <49ff> <4900>\n"; - $stream .= "<4a00> <4aff> <4a00>\n"; - $stream .= "<4b00> <4bff> <4b00>\n"; - $stream .= "<4c00> <4cff> <4c00>\n"; - $stream .= "<4d00> <4dff> <4d00>\n"; - $stream .= "<4e00> <4eff> <4e00>\n"; - $stream .= "<4f00> <4fff> <4f00>\n"; - $stream .= "<5000> <50ff> <5000>\n"; - $stream .= "<5100> <51ff> <5100>\n"; - $stream .= "<5200> <52ff> <5200>\n"; - $stream .= "<5300> <53ff> <5300>\n"; - $stream .= "<5400> <54ff> <5400>\n"; - $stream .= "<5500> <55ff> <5500>\n"; - $stream .= "<5600> <56ff> <5600>\n"; - $stream .= "<5700> <57ff> <5700>\n"; - $stream .= "<5800> <58ff> <5800>\n"; - $stream .= "<5900> <59ff> <5900>\n"; - $stream .= "<5a00> <5aff> <5a00>\n"; - $stream .= "<5b00> <5bff> <5b00>\n"; - $stream .= "<5c00> <5cff> <5c00>\n"; - $stream .= "<5d00> <5dff> <5d00>\n"; - $stream .= "<5e00> <5eff> <5e00>\n"; - $stream .= "<5f00> <5fff> <5f00>\n"; - $stream .= "<6000> <60ff> <6000>\n"; - $stream .= "<6100> <61ff> <6100>\n"; - $stream .= "<6200> <62ff> <6200>\n"; - $stream .= "<6300> <63ff> <6300>\n"; - $stream .= "endbfrange\n"; - $stream .= "100 beginbfrange\n"; - $stream .= "<6400> <64ff> <6400>\n"; - $stream .= "<6500> <65ff> <6500>\n"; - $stream .= "<6600> <66ff> <6600>\n"; - $stream .= "<6700> <67ff> <6700>\n"; - $stream .= "<6800> <68ff> <6800>\n"; - $stream .= "<6900> <69ff> <6900>\n"; - $stream .= "<6a00> <6aff> <6a00>\n"; - $stream .= "<6b00> <6bff> <6b00>\n"; - $stream .= "<6c00> <6cff> <6c00>\n"; - $stream .= "<6d00> <6dff> <6d00>\n"; - $stream .= "<6e00> <6eff> <6e00>\n"; - $stream .= "<6f00> <6fff> <6f00>\n"; - $stream .= "<7000> <70ff> <7000>\n"; - $stream .= "<7100> <71ff> <7100>\n"; - $stream .= "<7200> <72ff> <7200>\n"; - $stream .= "<7300> <73ff> <7300>\n"; - $stream .= "<7400> <74ff> <7400>\n"; - $stream .= "<7500> <75ff> <7500>\n"; - $stream .= "<7600> <76ff> <7600>\n"; - $stream .= "<7700> <77ff> <7700>\n"; - $stream .= "<7800> <78ff> <7800>\n"; - $stream .= "<7900> <79ff> <7900>\n"; - $stream .= "<7a00> <7aff> <7a00>\n"; - $stream .= "<7b00> <7bff> <7b00>\n"; - $stream .= "<7c00> <7cff> <7c00>\n"; - $stream .= "<7d00> <7dff> <7d00>\n"; - $stream .= "<7e00> <7eff> <7e00>\n"; - $stream .= "<7f00> <7fff> <7f00>\n"; - $stream .= "<8000> <80ff> <8000>\n"; - $stream .= "<8100> <81ff> <8100>\n"; - $stream .= "<8200> <82ff> <8200>\n"; - $stream .= "<8300> <83ff> <8300>\n"; - $stream .= "<8400> <84ff> <8400>\n"; - $stream .= "<8500> <85ff> <8500>\n"; - $stream .= "<8600> <86ff> <8600>\n"; - $stream .= "<8700> <87ff> <8700>\n"; - $stream .= "<8800> <88ff> <8800>\n"; - $stream .= "<8900> <89ff> <8900>\n"; - $stream .= "<8a00> <8aff> <8a00>\n"; - $stream .= "<8b00> <8bff> <8b00>\n"; - $stream .= "<8c00> <8cff> <8c00>\n"; - $stream .= "<8d00> <8dff> <8d00>\n"; - $stream .= "<8e00> <8eff> <8e00>\n"; - $stream .= "<8f00> <8fff> <8f00>\n"; - $stream .= "<9000> <90ff> <9000>\n"; - $stream .= "<9100> <91ff> <9100>\n"; - $stream .= "<9200> <92ff> <9200>\n"; - $stream .= "<9300> <93ff> <9300>\n"; - $stream .= "<9400> <94ff> <9400>\n"; - $stream .= "<9500> <95ff> <9500>\n"; - $stream .= "<9600> <96ff> <9600>\n"; - $stream .= "<9700> <97ff> <9700>\n"; - $stream .= "<9800> <98ff> <9800>\n"; - $stream .= "<9900> <99ff> <9900>\n"; - $stream .= "<9a00> <9aff> <9a00>\n"; - $stream .= "<9b00> <9bff> <9b00>\n"; - $stream .= "<9c00> <9cff> <9c00>\n"; - $stream .= "<9d00> <9dff> <9d00>\n"; - $stream .= "<9e00> <9eff> <9e00>\n"; - $stream .= "<9f00> <9fff> <9f00>\n"; - $stream .= "<a000> <a0ff> <a000>\n"; - $stream .= "<a100> <a1ff> <a100>\n"; - $stream .= "<a200> <a2ff> <a200>\n"; - $stream .= "<a300> <a3ff> <a300>\n"; - $stream .= "<a400> <a4ff> <a400>\n"; - $stream .= "<a500> <a5ff> <a500>\n"; - $stream .= "<a600> <a6ff> <a600>\n"; - $stream .= "<a700> <a7ff> <a700>\n"; - $stream .= "<a800> <a8ff> <a800>\n"; - $stream .= "<a900> <a9ff> <a900>\n"; - $stream .= "<aa00> <aaff> <aa00>\n"; - $stream .= "<ab00> <abff> <ab00>\n"; - $stream .= "<ac00> <acff> <ac00>\n"; - $stream .= "<ad00> <adff> <ad00>\n"; - $stream .= "<ae00> <aeff> <ae00>\n"; - $stream .= "<af00> <afff> <af00>\n"; - $stream .= "<b000> <b0ff> <b000>\n"; - $stream .= "<b100> <b1ff> <b100>\n"; - $stream .= "<b200> <b2ff> <b200>\n"; - $stream .= "<b300> <b3ff> <b300>\n"; - $stream .= "<b400> <b4ff> <b400>\n"; - $stream .= "<b500> <b5ff> <b500>\n"; - $stream .= "<b600> <b6ff> <b600>\n"; - $stream .= "<b700> <b7ff> <b700>\n"; - $stream .= "<b800> <b8ff> <b800>\n"; - $stream .= "<b900> <b9ff> <b900>\n"; - $stream .= "<ba00> <baff> <ba00>\n"; - $stream .= "<bb00> <bbff> <bb00>\n"; - $stream .= "<bc00> <bcff> <bc00>\n"; - $stream .= "<bd00> <bdff> <bd00>\n"; - $stream .= "<be00> <beff> <be00>\n"; - $stream .= "<bf00> <bfff> <bf00>\n"; - $stream .= "<c000> <c0ff> <c000>\n"; - $stream .= "<c100> <c1ff> <c100>\n"; - $stream .= "<c200> <c2ff> <c200>\n"; - $stream .= "<c300> <c3ff> <c300>\n"; - $stream .= "<c400> <c4ff> <c400>\n"; - $stream .= "<c500> <c5ff> <c500>\n"; - $stream .= "<c600> <c6ff> <c600>\n"; - $stream .= "<c700> <c7ff> <c700>\n"; - $stream .= "endbfrange\n"; - $stream .= "56 beginbfrange\n"; - $stream .= "<c800> <c8ff> <c800>\n"; - $stream .= "<c900> <c9ff> <c900>\n"; - $stream .= "<ca00> <caff> <ca00>\n"; - $stream .= "<cb00> <cbff> <cb00>\n"; - $stream .= "<cc00> <ccff> <cc00>\n"; - $stream .= "<cd00> <cdff> <cd00>\n"; - $stream .= "<ce00> <ceff> <ce00>\n"; - $stream .= "<cf00> <cfff> <cf00>\n"; - $stream .= "<d000> <d0ff> <d000>\n"; - $stream .= "<d100> <d1ff> <d100>\n"; - $stream .= "<d200> <d2ff> <d200>\n"; - $stream .= "<d300> <d3ff> <d300>\n"; - $stream .= "<d400> <d4ff> <d400>\n"; - $stream .= "<d500> <d5ff> <d500>\n"; - $stream .= "<d600> <d6ff> <d600>\n"; - $stream .= "<d700> <d7ff> <d700>\n"; - $stream .= "<d800> <d8ff> <d800>\n"; - $stream .= "<d900> <d9ff> <d900>\n"; - $stream .= "<da00> <daff> <da00>\n"; - $stream .= "<db00> <dbff> <db00>\n"; - $stream .= "<dc00> <dcff> <dc00>\n"; - $stream .= "<dd00> <ddff> <dd00>\n"; - $stream .= "<de00> <deff> <de00>\n"; - $stream .= "<df00> <dfff> <df00>\n"; - $stream .= "<e000> <e0ff> <e000>\n"; - $stream .= "<e100> <e1ff> <e100>\n"; - $stream .= "<e200> <e2ff> <e200>\n"; - $stream .= "<e300> <e3ff> <e300>\n"; - $stream .= "<e400> <e4ff> <e400>\n"; - $stream .= "<e500> <e5ff> <e500>\n"; - $stream .= "<e600> <e6ff> <e600>\n"; - $stream .= "<e700> <e7ff> <e700>\n"; - $stream .= "<e800> <e8ff> <e800>\n"; - $stream .= "<e900> <e9ff> <e900>\n"; - $stream .= "<ea00> <eaff> <ea00>\n"; - $stream .= "<eb00> <ebff> <eb00>\n"; - $stream .= "<ec00> <ecff> <ec00>\n"; - $stream .= "<ed00> <edff> <ed00>\n"; - $stream .= "<ee00> <eeff> <ee00>\n"; - $stream .= "<ef00> <efff> <ef00>\n"; - $stream .= "<f000> <f0ff> <f000>\n"; - $stream .= "<f100> <f1ff> <f100>\n"; - $stream .= "<f200> <f2ff> <f200>\n"; - $stream .= "<f300> <f3ff> <f300>\n"; - $stream .= "<f400> <f4ff> <f400>\n"; - $stream .= "<f500> <f5ff> <f500>\n"; - $stream .= "<f600> <f6ff> <f600>\n"; - $stream .= "<f700> <f7ff> <f700>\n"; - $stream .= "<f800> <f8ff> <f800>\n"; - $stream .= "<f900> <f9ff> <f900>\n"; - $stream .= "<fa00> <faff> <fa00>\n"; - $stream .= "<fb00> <fbff> <fb00>\n"; - $stream .= "<fc00> <fcff> <fc00>\n"; - $stream .= "<fd00> <fdff> <fd00>\n"; - $stream .= "<fe00> <feff> <fe00>\n"; - $stream .= "<ff00> <ffff> <ff00>\n"; - $stream .= "endbfrange\n"; - $stream .= "endcmap\n"; - $stream .= "CMapName currentdict /CMap defineresource pop\n"; - $stream .= "end\n"; - $stream .= "end"; - // ToUnicode Object - $this->_newobj(); - $stream = ($this->compress) ? gzcompress($stream) : $stream; - $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; - $stream = $this->_getrawstream($stream); - $this->_out('<<'.$filter.'/Length '.strlen($stream).'>> stream'."\n".$stream."\n".'endstream'."\n".'endobj'); - // CIDFontType2 - // A CIDFont whose glyph descriptions are based on TrueType font technology - $oid = $this->_newobj(); - $out = '<< /Type /Font'; - $out .= ' /Subtype /CIDFontType2'; - $out .= ' /BaseFont /'.$fontname; - // A dictionary containing entries that define the character collection of the CIDFont. - $cidinfo = '/Registry '.$this->_datastring($font['cidinfo']['Registry'], $oid); - $cidinfo .= ' /Ordering '.$this->_datastring($font['cidinfo']['Ordering'], $oid); - $cidinfo .= ' /Supplement '.$font['cidinfo']['Supplement']; - $out .= ' /CIDSystemInfo << '.$cidinfo.' >>'; - $out .= ' /FontDescriptor '.($this->n + 1).' 0 R'; - $out .= ' /DW '.$font['dw']; // default width - $out .= "\n".$this->_putfontwidths($font, 0); - if (isset($font['ctg']) AND (!$this->empty_string($font['ctg']))) { - $out .= "\n".'/CIDToGIDMap '.($this->n + 2).' 0 R'; - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - // Font descriptor - // A font descriptor describing the CIDFont default metrics other than its glyph widths - $this->_newobj(); - $out = '<< /Type /FontDescriptor'; - $out .= ' /FontName /'.$fontname; - foreach ($font['desc'] as $key => $value) { - if(is_float($value)) { - $value = sprintf('%.3F', $value); - } - $out .= ' /'.$key.' '.$value; - } - $fontdir = false; - if (!$this->empty_string($font['file'])) { - // A stream containing a TrueType font - $out .= ' /FontFile2 '.$this->FontFiles[$font['file']]['n'].' 0 R'; - $fontdir = $this->FontFiles[$font['file']]['fontdir']; - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - if (isset($font['ctg']) AND (!$this->empty_string($font['ctg']))) { - $this->_newobj(); - // Embed CIDToGIDMap - // A specification of the mapping from CIDs to glyph indices - // search and get CTG font file to embedd - $ctgfile = strtolower($font['ctg']); - // search and get ctg font file to embedd - $fontfile = ''; - // search files on various directories - if (($fontdir !== false) AND file_exists($fontdir.$ctgfile)) { - $fontfile = $fontdir.$ctgfile; - } elseif (file_exists($this->_getfontpath().$ctgfile)) { - $fontfile = $this->_getfontpath().$ctgfile; - } elseif (file_exists($ctgfile)) { - $fontfile = $ctgfile; - } - if ($this->empty_string($fontfile)) { - $this->Error('Font file not found: '.$ctgfile); - } - $stream = $this->_getrawstream(file_get_contents($fontfile)); - $out = '<< /Length '.strlen($stream).''; - if (substr($fontfile, -2) == '.z') { // check file extension - // Decompresses data encoded using the public-domain - // zlib/deflate compression method, reproducing the - // original text or binary data - $out .= ' /Filter /FlateDecode'; - } - $out .= ' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - - /** - * Output CID-0 fonts. - * A Type 0 CIDFont contains glyph descriptions based on the Adobe Type 1 font format - * @param array $font font data - * @access protected - * @author Andrew Whitehead, Nicola Asuni, Yukihiro Nakadaira - * @since 3.2.000 (2008-06-23) - */ - protected function _putcidfont0($font) { - $cidoffset = 0; - if (!isset($font['cw'][1])) { - $cidoffset = 31; - } - if (isset($font['cidinfo']['uni2cid'])) { - // convert unicode to cid. - $uni2cid = $font['cidinfo']['uni2cid']; - $cw = array(); - foreach ($font['cw'] as $uni => $width) { - if (isset($uni2cid[$uni])) { - $cw[($uni2cid[$uni] + $cidoffset)] = $width; - } elseif ($uni < 256) { - $cw[$uni] = $width; - } // else unknown character - } - $font = array_merge($font, array('cw' => $cw)); - } - $name = $font['name']; - $enc = $font['enc']; - if ($enc) { - $longname = $name.'-'.$enc; - } else { - $longname = $name; - } - $out = $this->_getobj($this->font_obj_ids[$font['fontkey']])."\n"; - $out .= '<</Type /Font'; - $out .= ' /Subtype /Type0'; - $out .= ' /BaseFont /'.$longname; - $out .= ' /Name /F'.$font['i']; - if ($enc) { - $out .= ' /Encoding /'.$enc; - } - $out .= ' /DescendantFonts ['.($this->n + 1).' 0 R]'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - $oid = $this->_newobj(); - $out = '<</Type /Font'; - $out .= ' /Subtype /CIDFontType0'; - $out .= ' /BaseFont /'.$name; - $cidinfo = '/Registry '.$this->_datastring($font['cidinfo']['Registry'], $oid); - $cidinfo .= ' /Ordering '.$this->_datastring($font['cidinfo']['Ordering'], $oid); - $cidinfo .= ' /Supplement '.$font['cidinfo']['Supplement']; - $out .= ' /CIDSystemInfo <<'.$cidinfo.'>>'; - $out .= ' /FontDescriptor '.($this->n + 1).' 0 R'; - $out .= ' /DW '.$font['dw']; - $out .= "\n".$this->_putfontwidths($font, $cidoffset); - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - $this->_newobj(); - $s = '<</Type /FontDescriptor /FontName /'.$name; - foreach ($font['desc'] as $k => $v) { - if ($k != 'Style') { - if(is_float($v)) { - $v = sprintf('%.3F', $v); - } - $s .= ' /'.$k.' '.$v.''; - } - } - $s .= '>>'; - $s .= "\n".'endobj'; - $this->_out($s); - } - - /** - * Output images. - * @access protected - */ - protected function _putimages() { - $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; - foreach ($this->imagekeys as $file) { - $info = $this->getImageBuffer($file); - $oid = $this->_newobj(); - $this->xobjects['I'.$info['i']] = array('n' => $oid); - $this->setImageSubBuffer($file, 'n', $this->n); - $out = '<</Type /XObject'; - $out .= ' /Subtype /Image'; - $out .= ' /Width '.$info['w']; - $out .= ' /Height '.$info['h']; - if (array_key_exists('masked', $info)) { - $out .= ' /SMask '.($this->n - 1).' 0 R'; - } - if ($info['cs'] == 'Indexed') { - $out .= ' /ColorSpace [/Indexed /DeviceRGB '.((strlen($info['pal']) / 3) - 1).' '.($this->n + 1).' 0 R]'; - } else { - $out .= ' /ColorSpace /'.$info['cs']; - if ($info['cs'] == 'DeviceCMYK') { - $out .= ' /Decode [1 0 1 0 1 0 1 0]'; - } - } - $out .= ' /BitsPerComponent '.$info['bpc']; - if (isset($info['f'])) { - $out .= ' /Filter /'.$info['f']; - } - if (isset($info['parms'])) { - $out .= ' '.$info['parms']; - } - if (isset($info['trns']) AND is_array($info['trns'])) { - $trns=''; - $count_info = count($info['trns']); - for ($i=0; $i < $count_info; ++$i) { - $trns .= $info['trns'][$i].' '.$info['trns'][$i].' '; - } - $out .= ' /Mask ['.$trns.']'; - } - $stream = $this->_getrawstream($info['data']); - $out .= ' /Length '.strlen($stream).' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - //Palette - if ($info['cs'] == 'Indexed') { - $this->_newobj(); - $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; - $pal = $this->_getrawstream($pal); - $this->_out('<<'.$filter.'/Length '.strlen($pal).'>> stream'."\n".$pal."\n".'endstream'."\n".'endobj'); - } - } - } - - /** - * Output Form XObjects Templates. - * @author Nicola Asuni - * @since 5.8.017 (2010-08-24) - * @access protected - * @see startTemplate(), endTemplate(), printTemplate() - */ - protected function _putxobjects() { - foreach ($this->xobjects as $key => $data) { - if (isset($data['outdata'])) { - $stream = trim($data['outdata']); - $out = $this->_getobj($data['n'])."\n"; - $out .= '<<'; - $out .= ' /Type /XObject'; - $out .= ' /Subtype /Form'; - $out .= ' /FormType 1'; - if ($this->compress) { - $stream = gzcompress($stream); - $out .= ' /Filter /FlateDecode'; - } - $out .= sprintf(' /BBox [%.2F %.2F %.2F %.2F]', ($data['x'] * $this->k), (-$data['y'] * $this->k), (($data['w'] + $data['x']) * $this->k), (($data['h'] - $data['y']) * $this->k)); - $out .= ' /Matrix [1 0 0 1 0 0]'; - $out .= ' /Resources <<'; - $out .= ' /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; - // fonts - if (!empty($data['fonts'])) { - $out .= ' /Font <<'; - foreach ($data['fonts'] as $fontkey => $fontid) { - $out .= ' /F'.$fontid.' '.$this->font_obj_ids[$fontkey].' 0 R'; - } - $out .= ' >>'; - } - // images or nested xobjects - if (!empty($data['images']) OR !empty($data['xobjects'])) { - $out .= ' /XObject <<'; - foreach ($data['images'] as $imgid) { - $out .= ' /I'.$imgid.' '.$this->xobjects['I'.$imgid]['n'].' 0 R'; - } - foreach ($data['xobjects'] as $sub_id => $sub_objid) { - $out .= ' /'.$sub_id.' '.$sub_objid['n'].' 0 R'; - } - $out .= ' >>'; - } - $out .= ' >>'; - $stream = $this->_getrawstream($stream); - $out .= ' /Length '.strlen($stream); - $out .= ' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - } - - /** - * Output Spot Colors Resources. - * @access protected - * @since 4.0.024 (2008-09-12) - */ - protected function _putspotcolors() { - foreach ($this->spot_colors as $name => $color) { - $this->_newobj(); - $this->spot_colors[$name]['n'] = $this->n; - $out = '[/Separation /'.str_replace(' ', '#20', $name); - $out .= ' /DeviceCMYK <<'; - $out .= ' /Range [0 1 0 1 0 1 0 1] /C0 [0 0 0 0]'; - $out .= ' '.sprintf('/C1 [%.4F %.4F %.4F %.4F] ', $color['c']/100, $color['m']/100, $color['y']/100, $color['k']/100); - $out .= ' /FunctionType 2 /Domain [0 1] /N 1>>]'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - - /** - * Return XObjects Dictionary. - * @return string XObjects dictionary - * @access protected - * @since 5.8.014 (2010-08-23) - */ - protected function _getxobjectdict() { - $out = ''; - foreach ($this->xobjects as $id => $objid) { - $out .= ' /'.$id.' '.$objid['n'].' 0 R'; - } - return $out; - } - - /** - * Output Resources Dictionary. - * @access protected - */ - protected function _putresourcedict() { - $out = $this->_getobj(2)."\n"; - $out .= '<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; - $out .= ' /Font <<'; - foreach ($this->fontkeys as $fontkey) { - $font = $this->getFontBuffer($fontkey); - $out .= ' /F'.$font['i'].' '.$font['n'].' 0 R'; - } - $out .= ' >>'; - $out .= ' /XObject <<'; - $out .= $this->_getxobjectdict(); - $out .= ' >>'; - // visibility - $out .= ' /Properties <</OC1 '.$this->n_ocg_print.' 0 R /OC2 '.$this->n_ocg_view.' 0 R>>'; - // transparency - $out .= ' /ExtGState <<'; - foreach ($this->extgstates as $k => $extgstate) { - if (isset($extgstate['name'])) { - $out .= ' /'.$extgstate['name']; - } else { - $out .= ' /GS'.$k; - } - $out .= ' '.$extgstate['n'].' 0 R'; - } - $out .= ' >>'; - // gradient patterns - if (isset($this->gradients) AND (count($this->gradients) > 0)) { - $out .= ' /Pattern <<'; - foreach ($this->gradients as $id => $grad) { - $out .= ' /p'.$id.' '.$grad['pattern'].' 0 R'; - } - $out .= ' >>'; - } - // gradient shadings - if (isset($this->gradients) AND (count($this->gradients) > 0)) { - $out .= ' /Shading <<'; - foreach ($this->gradients as $id => $grad) { - $out .= ' /Sh'.$id.' '.$grad['id'].' 0 R'; - } - $out .= ' >>'; - } - // spot colors - if (isset($this->spot_colors) AND (count($this->spot_colors) > 0)) { - $out .= ' /ColorSpace <<'; - foreach ($this->spot_colors as $color) { - $out .= ' /CS'.$color['i'].' '.$color['n'].' 0 R'; - } - $out .= ' >>'; - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - - /** - * Output Resources. - * @access protected - */ - protected function _putresources() { - $this->_putextgstates(); - $this->_putocg(); - $this->_putfonts(); - $this->_putimages(); - $this->_putxobjects(); - $this->_putspotcolors(); - $this->_putshaders(); - $this->_putresourcedict(); - $this->_putbookmarks(); - $this->_putEmbeddedFiles(); - $this->_putannotsobjs(); - $this->_putjavascript(); - $this->_putencryption(); - } - - /** - * Adds some Metadata information (Document Information Dictionary) - * (see Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference) - * @return int object id - * @access protected - */ - protected function _putinfo() { - $oid = $this->_newobj(); - $out = '<<'; - if (!$this->empty_string($this->title)) { - // The document's title. - $out .= ' /Title '.$this->_textstring($this->title, $oid); - } - if (!$this->empty_string($this->author)) { - // The name of the person who created the document. - $out .= ' /Author '.$this->_textstring($this->author, $oid); - } - if (!$this->empty_string($this->subject)) { - // The subject of the document. - $out .= ' /Subject '.$this->_textstring($this->subject, $oid); - } - if (!$this->empty_string($this->keywords)) { - // Keywords associated with the document. - $out .= ' /Keywords '.$this->_textstring($this->keywords.' TCP'.'DF', $oid); - } - if (!$this->empty_string($this->creator)) { - // If the document was converted to PDF from another format, the name of the conforming product that created the original document from which it was converted. - $out .= ' /Creator '.$this->_textstring($this->creator, $oid); - } - if (defined('PDF_PRODUCER')) { - // If the document was converted to PDF from another format, the name of the conforming product that converted it to PDF. - $out .= ' /Producer '.$this->_textstring(PDF_PRODUCER.' (TCP'.'DF)', $oid); - } else { - // default producer - $out .= ' /Producer '.$this->_textstring('TCP'.'DF', $oid); - } - // The date and time the document was created, in human-readable form - $out .= ' /CreationDate '.$this->_datestring(); - // The date and time the document was most recently modified, in human-readable form - $out .= ' /ModDate '.$this->_datestring(); - // A name object indicating whether the document has been modified to include trapping information - $out .= ' /Trapped /False'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - return $oid; - } - - /** - * Output Catalog. - * @return int object id - * @access protected - */ - protected function _putcatalog() { - $oid = $this->_newobj(); - $out = '<< /Type /Catalog'; - $out .= ' /Pages 1 0 R'; - if ($this->ZoomMode == 'fullpage') { - $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /Fit]'; - } elseif ($this->ZoomMode == 'fullwidth') { - $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /FitH null]'; - } elseif ($this->ZoomMode == 'real') { - $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /XYZ null null 1]'; - } elseif (!is_string($this->ZoomMode)) { - $out .= sprintf(' /OpenAction ['.$this->page_obj_id[1].' 0 R /XYZ null null %.2F]',($this->ZoomMode / 100)); - } - if (isset($this->LayoutMode) AND (!$this->empty_string($this->LayoutMode))) { - $out .= ' /PageLayout /'.$this->LayoutMode; - } - if (isset($this->PageMode) AND (!$this->empty_string($this->PageMode))) { - $out .= ' /PageMode /'.$this->PageMode; - } - if (isset($this->l['a_meta_language'])) { - $out .= ' /Lang '.$this->_textstring($this->l['a_meta_language'], $oid); - } - $out .= ' /Names <<'; - if ((!empty($this->javascript)) OR (!empty($this->js_objects))) { - $out .= ' /JavaScript '.($this->n_js).' 0 R'; - } - $out .= ' >>'; - if (count($this->outlines) > 0) { - $out .= ' /Outlines '.$this->OutlineRoot.' 0 R'; - $out .= ' /PageMode /UseOutlines'; - } - $out .= ' '.$this->_putviewerpreferences(); - $p = $this->n_ocg_print.' 0 R'; - $v = $this->n_ocg_view.' 0 R'; - $as = '<< /Event /Print /OCGs ['.$p.' '.$v.'] /Category [/Print] >> << /Event /View /OCGs ['.$p.' '.$v.'] /Category [/View] >>'; - $out .= ' /OCProperties << /OCGs ['.$p.' '.$v.'] /D << /ON ['.$p.'] /OFF ['.$v.'] /AS ['.$as.'] >> >>'; - // AcroForm - if (!empty($this->form_obj_id) OR ($this->sign AND isset($this->signature_data['cert_type']))) { - $out .= ' /AcroForm <<'; - $objrefs = ''; - if ($this->sign AND isset($this->signature_data['cert_type'])) { - $objrefs .= $this->sig_obj_id.' 0 R'; - } - if (!empty($this->form_obj_id)) { - foreach($this->form_obj_id as $objid) { - $objrefs .= ' '.$objid.' 0 R'; - } - } - $out .= ' /Fields ['.$objrefs.']'; - if (!empty($this->form_obj_id) AND !$this->sign) { - // It's better to turn off this value and set the appearance stream for each annotation (/AP) to avoid conflicts with signature fields. - $out .= ' /NeedAppearances true'; - } - if ($this->sign AND isset($this->signature_data['cert_type'])) { - if ($this->signature_data['cert_type'] > 0) { - $out .= ' /SigFlags 3'; - } else { - $out .= ' /SigFlags 1'; - } - } - //$out .= ' /CO '; - if (isset($this->annotation_fonts) AND !empty($this->annotation_fonts)) { - $out .= ' /DR <<'; - $out .= ' /Font <<'; - foreach ($this->annotation_fonts as $fontkey => $fontid) { - $out .= ' /F'.$fontid.' '.$this->font_obj_ids[$fontkey].' 0 R'; - } - $out .= ' >> >>'; - } - $font = $this->getFontBuffer('helvetica'); - $out .= ' /DA (/F'.$font['i'].' 0 Tf 0 g)'; - $out .= ' /Q '.(($this->rtl)?'2':'0'); - //$out .= ' /XFA '; - $out .= ' >>'; - // signatures - if ($this->sign AND isset($this->signature_data['cert_type'])) { - if ($this->signature_data['cert_type'] > 0) { - $out .= ' /Perms << /DocMDP '.($this->sig_obj_id + 1).' 0 R >>'; - } else { - $out .= ' /Perms << /UR3 '.($this->sig_obj_id + 1).' 0 R >>'; - } - } - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - return $oid; - } - - /** - * Output viewer preferences. - * @return string for viewer preferences - * @author Nicola asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ - protected function _putviewerpreferences() { - $out = '/ViewerPreferences <<'; - if ($this->rtl) { - $out .= ' /Direction /R2L'; - } else { - $out .= ' /Direction /L2R'; - } - if (isset($this->viewer_preferences['HideToolbar']) AND ($this->viewer_preferences['HideToolbar'])) { - $out .= ' /HideToolbar true'; - } - if (isset($this->viewer_preferences['HideMenubar']) AND ($this->viewer_preferences['HideMenubar'])) { - $out .= ' /HideMenubar true'; - } - if (isset($this->viewer_preferences['HideWindowUI']) AND ($this->viewer_preferences['HideWindowUI'])) { - $out .= ' /HideWindowUI true'; - } - if (isset($this->viewer_preferences['FitWindow']) AND ($this->viewer_preferences['FitWindow'])) { - $out .= ' /FitWindow true'; - } - if (isset($this->viewer_preferences['CenterWindow']) AND ($this->viewer_preferences['CenterWindow'])) { - $out .= ' /CenterWindow true'; - } - if (isset($this->viewer_preferences['DisplayDocTitle']) AND ($this->viewer_preferences['DisplayDocTitle'])) { - $out .= ' /DisplayDocTitle true'; - } - if (isset($this->viewer_preferences['NonFullScreenPageMode'])) { - $out .= ' /NonFullScreenPageMode /'.$this->viewer_preferences['NonFullScreenPageMode']; - } - if (isset($this->viewer_preferences['ViewArea'])) { - $out .= ' /ViewArea /'.$this->viewer_preferences['ViewArea']; - } - if (isset($this->viewer_preferences['ViewClip'])) { - $out .= ' /ViewClip /'.$this->viewer_preferences['ViewClip']; - } - if (isset($this->viewer_preferences['PrintArea'])) { - $out .= ' /PrintArea /'.$this->viewer_preferences['PrintArea']; - } - if (isset($this->viewer_preferences['PrintClip'])) { - $out .= ' /PrintClip /'.$this->viewer_preferences['PrintClip']; - } - if (isset($this->viewer_preferences['PrintScaling'])) { - $out .= ' /PrintScaling /'.$this->viewer_preferences['PrintScaling']; - } - if (isset($this->viewer_preferences['Duplex']) AND (!$this->empty_string($this->viewer_preferences['Duplex']))) { - $out .= ' /Duplex /'.$this->viewer_preferences['Duplex']; - } - if (isset($this->viewer_preferences['PickTrayByPDFSize'])) { - if ($this->viewer_preferences['PickTrayByPDFSize']) { - $out .= ' /PickTrayByPDFSize true'; - } else { - $out .= ' /PickTrayByPDFSize false'; - } - } - if (isset($this->viewer_preferences['PrintPageRange'])) { - $PrintPageRangeNum = ''; - foreach ($this->viewer_preferences['PrintPageRange'] as $k => $v) { - $PrintPageRangeNum .= ' '.($v - 1).''; - } - $out .= ' /PrintPageRange ['.substr($PrintPageRangeNum,1).']'; - } - if (isset($this->viewer_preferences['NumCopies'])) { - $out .= ' /NumCopies '.intval($this->viewer_preferences['NumCopies']); - } - $out .= ' >>'; - return $out; - } - - /** - * Output PDF header. - * @access protected - */ - protected function _putheader() { - $this->_out('%PDF-'.$this->PDFVersion); - } - - /** - * Output end of document (EOF). - * @access protected - */ - protected function _enddoc() { - $this->state = 1; - $this->_putheader(); - $this->_putpages(); - $this->_putresources(); - // Signature - if ($this->sign AND isset($this->signature_data['cert_type'])) { - // widget annotation for signature - $out = $this->_getobj($this->sig_obj_id)."\n"; - $out .= '<< /Type /Annot'; - $out .= ' /Subtype /Widget'; - $out .= ' /Rect ['.$this->signature_appearance['rect'].']'; - $out .= ' /P '.$this->page_obj_id[($this->signature_appearance['page'])].' 0 R'; // link to signature appearance page - $out .= ' /F 4'; - $out .= ' /FT /Sig'; - $out .= ' /T '.$this->_textstring('Signature', $this->sig_obj_id); - $out .= ' /Ff 0'; - $out .= ' /V '.($this->sig_obj_id + 1).' 0 R'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - // signature - $this->_putsignature(); - } - // Info - $objid_info = $this->_putinfo(); - // Catalog - $objid_catalog = $this->_putcatalog(); - // Cross-ref - $o = $this->bufferlen; - // XREF section - $this->_out('xref'); - $this->_out('0 '.($this->n + 1)); - $this->_out('0000000000 65535 f '); - for ($i=1; $i <= $this->n; ++$i) { - $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); - } - // TRAILER - $out = 'trailer <<'; - $out .= ' /Size '.($this->n + 1); - $out .= ' /Root '.$objid_catalog.' 0 R'; - $out .= ' /Info '.$objid_info.' 0 R'; - if ($this->encrypted) { - $out .= ' /Encrypt '.$this->encryptdata['objid'].' 0 R'; - } - $out .= ' /ID [ <'.$this->file_id.'> <'.$this->file_id.'> ]'; - $out .= ' >>'; - $this->_out($out); - $this->_out('startxref'); - $this->_out($o); - $this->_out('%%EOF'); - $this->state = 3; // end-of-doc - if ($this->diskcache) { - // remove temporary files used for images - foreach ($this->imagekeys as $key) { - // remove temporary files - unlink($this->images[$key]); - } - foreach ($this->fontkeys as $key) { - // remove temporary files - unlink($this->fonts[$key]); - } - } - } - - /** - * Initialize a new page. - * @param string $orientation page orientation. Possible values are (case insensitive):<ul><li>P or PORTRAIT (default)</li><li>L or LANDSCAPE</li></ul> - * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). - * @access protected - * @see getPageSizeFromFormat(), setPageFormat() - */ - protected function _beginpage($orientation='', $format='') { - ++$this->page; - $this->setPageBuffer($this->page, ''); - // initialize array for graphics tranformation positions inside a page buffer - $this->transfmrk[$this->page] = array(); - $this->state = 2; - if ($this->empty_string($orientation)) { - if (isset($this->CurOrientation)) { - $orientation = $this->CurOrientation; - } elseif ($this->fwPt > $this->fhPt) { - // landscape - $orientation = 'L'; - } else { - // portrait - $orientation = 'P'; - } - } - if ($this->empty_string($format)) { - $this->pagedim[$this->page] = $this->pagedim[($this->page - 1)]; - $this->setPageOrientation($orientation); - } else { - $this->setPageFormat($format, $orientation); - } - if ($this->rtl) { - $this->x = $this->w - $this->rMargin; - } else { - $this->x = $this->lMargin; - } - $this->y = $this->tMargin; - if (isset($this->newpagegroup[$this->page])) { - // start a new group - $n = sizeof($this->pagegroups) + 1; - $alias = '{nb'.$n.'}'; - $this->pagegroups[$alias] = 1; - $this->currpagegroup = $alias; - } elseif ($this->currpagegroup) { - ++$this->pagegroups[$this->currpagegroup]; - } - } - - /** - * Mark end of page. - * @access protected - */ - protected function _endpage() { - $this->setVisibility('all'); - $this->state = 1; - } - - /** - * Begin a new object and return the object number. - * @return int object number - * @access protected - */ - protected function _newobj() { - $this->_out($this->_getobj()); - return $this->n; - } - - /** - * Return the starting object string for the selected object ID. - * @param int $objid Object ID (leave empty to get a new ID). - * @return string the starting object string - * @access protected - * @since 5.8.009 (2010-08-20) - */ - protected function _getobj($objid='') { - if ($objid === '') { - ++$this->n; - $objid = $this->n; - } - $this->offsets[$objid] = $this->bufferlen; - return $objid.' 0 obj'; - } - - /** - * Underline text. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to underline - * @access protected - */ - protected function _dounderline($x, $y, $txt) { - $w = $this->GetStringWidth($txt); - return $this->_dounderlinew($x, $y, $w); - } - - /** - * Underline for rectangular text area. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param int $w width to underline - * @access protected - * @since 4.8.008 (2009-09-29) - */ - protected function _dounderlinew($x, $y, $w) { - $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; - return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew), $w * $this->k, $linew); - } - - /** - * Line through text. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to linethrough - * @access protected - */ - protected function _dolinethrough($x, $y, $txt) { - $w = $this->GetStringWidth($txt); - return $this->_dolinethroughw($x, $y, $w); - } - - /** - * Line through for rectangular text area. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to linethrough - * @access protected - * @since 4.9.008 (2009-09-29) - */ - protected function _dolinethroughw($x, $y, $w) { - $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; - return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew + ($this->FontSizePt / 3)), $w * $this->k, $linew); - } - - /** - * Overline text. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param string $txt text to overline - * @access protected - * @since 4.9.015 (2010-04-19) - */ - protected function _dooverline($x, $y, $txt) { - $w = $this->GetStringWidth($txt); - return $this->_dooverlinew($x, $y, $w); - } - - /** - * Overline for rectangular text area. - * @param int $x X coordinate - * @param int $y Y coordinate - * @param int $w width to overline - * @access protected - * @since 4.9.015 (2010-04-19) - */ - protected function _dooverlinew($x, $y, $w) { - $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; - return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, (($this->h - $y + $this->FontAscent) * $this->k) - $linew, $w * $this->k, $linew); - - } - - /** - * Read a 4-byte (32 bit) integer from file. - * @param string $f file name. - * @return 4-byte integer - * @access protected - */ - protected function _freadint($f) { - $a = unpack('Ni', fread($f, 4)); - return $a['i']; - } - - /** - * Add "\" before "\", "(" and ")" - * @param string $s string to escape. - * @return string escaped string. - * @access protected - */ - protected function _escape($s) { - // the chr(13) substitution fixes the Bugs item #1421290. - return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); - } - - /** - * Format a data string for meta information - * @param string $s data string to escape. - * @param int $n object ID - * @return string escaped string. - * @access protected - */ - protected function _datastring($s, $n=0) { - if ($n == 0) { - $n = $this->n; - } - $s = $this->_encrypt_data($n, $s); - return '('. $this->_escape($s).')'; - } - - /** - * Returns a formatted date for meta information - * @param int $n object ID - * @return string escaped date string. - * @access protected - * @since 4.6.028 (2009-08-25) - */ - protected function _datestring($n=0) { - $current_time = substr_replace(date('YmdHisO'), '\'', (0 - 2), 0).'\''; - return $this->_datastring('D:'.$current_time, $n); - } - - /** - * Format a text string for meta information - * @param string $s string to escape. - * @param int $n object ID - * @return string escaped string. - * @access protected - */ - protected function _textstring($s, $n=0) { - if ($this->isunicode) { - //Convert string to UTF-16BE - $s = $this->UTF8ToUTF16BE($s, true); - } - return $this->_datastring($s, $n); - } - - /** - * THIS METHOD IS DEPRECATED - * Format a text string - * @param string $s string to escape. - * @return string escaped string. - * @access protected - * @deprecated - */ - protected function _escapetext($s) { - if ($this->isunicode) { - if (($this->CurrentFont['type'] == 'core') OR ($this->CurrentFont['type'] == 'TrueType') OR ($this->CurrentFont['type'] == 'Type1')) { - $s = $this->UTF8ToLatin1($s); - } else { - //Convert string to UTF-16BE and reverse RTL language - $s = $this->utf8StrRev($s, false, $this->tmprtl); - } - } - return $this->_escape($s); - } - - /** - * get raw output stream. - * @param string $s string to output. - * @param int $n object reference for encryption mode - * @access protected - * @author Nicola Asuni - * @since 5.5.000 (2010-06-22) - */ - protected function _getrawstream($s, $n=0) { - if ($n <= 0) { - // default to current object - $n = $this->n; - } - return $this->_encrypt_data($n, $s); - } - - /** - * Format output stream (DEPRECATED). - * @param string $s string to output. - * @param int $n object reference for encryption mode - * @access protected - * @deprecated - */ - protected function _getstream($s, $n=0) { - return 'stream'."\n".$this->_getrawstream($s, $n)."\n".'endstream'; - } - - /** - * Output a stream (DEPRECATED). - * @param string $s string to output. - * @param int $n object reference for encryption mode - * @access protected - * @deprecated - */ - protected function _putstream($s, $n=0) { - $this->_out($this->_getstream($s, $n)); - } - - /** - * Output a string to the document. - * @param string $s string to output. - * @access protected - */ - protected function _out($s) { - if ($this->state == 2) { - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['outdata'] .= $s."\n"; - } elseif ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { - // puts data before page footer - $pagebuff = $this->getPageBuffer($this->page); - $page = substr($pagebuff, 0, -$this->footerlen[$this->page]); - $footer = substr($pagebuff, -$this->footerlen[$this->page]); - $this->setPageBuffer($this->page, $page.$s."\n".$footer); - // update footer position - $this->footerpos[$this->page] += strlen($s."\n"); - } else { - $this->setPageBuffer($this->page, $s."\n", true); - } - } else { - $this->setBuffer($s."\n"); - } - } - - /** - * Converts UTF-8 strings to codepoints array.<br> - * Invalid byte sequences will be replaced with 0xFFFD (replacement character)<br> - * Based on: http://www.faqs.org/rfcs/rfc3629.html - * <pre> - * Char. number range | UTF-8 octet sequence - * (hexadecimal) | (binary) - * --------------------+----------------------------------------------- - * 0000 0000-0000 007F | 0xxxxxxx - * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx - * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx - * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - * --------------------------------------------------------------------- - * - * ABFN notation: - * --------------------------------------------------------------------- - * UTF8-octets = *( UTF8-char ) - * UTF8-char = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4 - * UTF8-1 = %x00-7F - * UTF8-2 = %xC2-DF UTF8-tail - * - * UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) / - * %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail ) - * UTF8-4 = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) / - * %xF4 %x80-8F 2( UTF8-tail ) - * UTF8-tail = %x80-BF - * --------------------------------------------------------------------- - * </pre> - * @param string $str string to process. - * @return array containing codepoints (UTF-8 characters values) - * @access protected - * @author Nicola Asuni - * @since 1.53.0.TC005 (2005-01-05) - */ - protected function UTF8StringToArray($str) { - // build a unique string key - $strkey = md5($str); - if (isset($this->cache_UTF8StringToArray[$strkey])) { - // return cached value - $chrarray = $this->cache_UTF8StringToArray[$strkey]['s']; - if (!isset($this->cache_UTF8StringToArray[$strkey]['f'][$this->CurrentFont['fontkey']])) { - if ($this->isunicode) { - foreach ($chrarray as $chr) { - // store this char for font subsetting - $this->CurrentFont['subsetchars'][$chr] = true; - } - // update font subsetchars - $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); - } - $this->cache_UTF8StringToArray[$strkey]['f'][$this->CurrentFont['fontkey']] = true; - } - return $chrarray; - } - // check cache size - if ($this->cache_size_UTF8StringToArray >= $this->cache_maxsize_UTF8StringToArray) { - // remove first element - array_shift($this->cache_UTF8StringToArray); - } - // new cache array for selected string - $this->cache_UTF8StringToArray[$strkey] = array('s' => array(), 'f' => array()); - ++$this->cache_size_UTF8StringToArray; - if (!$this->isunicode) { - // split string into array of equivalent codes - $strarr = array(); - $strlen = strlen($str); - for ($i=0; $i < $strlen; ++$i) { - $strarr[] = ord($str{$i}); - } - // insert new value on cache - $this->cache_UTF8StringToArray[$strkey]['s'] = $strarr; - $this->cache_UTF8StringToArray[$strkey]['f'][$this->CurrentFont['fontkey']] = true; - return $strarr; - } - $unichar = -1; // last unicode char - $unicode = array(); // array containing unicode values - $bytes = array(); // array containing single character byte sequences - $numbytes = 1; // number of octetc needed to represent the UTF-8 character - $str .= ''; // force $str to be a string - $length = strlen($str); - for ($i = 0; $i < $length; ++$i) { - $char = ord($str{$i}); // get one string character at time - if (count($bytes) == 0) { // get starting octect - if ($char <= 0x7F) { - $unichar = $char; // use the character "as is" because is ASCII - $numbytes = 1; - } elseif (($char >> 0x05) == 0x06) { // 2 bytes character (0x06 = 110 BIN) - $bytes[] = ($char - 0xC0) << 0x06; - $numbytes = 2; - } elseif (($char >> 0x04) == 0x0E) { // 3 bytes character (0x0E = 1110 BIN) - $bytes[] = ($char - 0xE0) << 0x0C; - $numbytes = 3; - } elseif (($char >> 0x03) == 0x1E) { // 4 bytes character (0x1E = 11110 BIN) - $bytes[] = ($char - 0xF0) << 0x12; - $numbytes = 4; - } else { - // use replacement character for other invalid sequences - $unichar = 0xFFFD; - $bytes = array(); - $numbytes = 1; - } - } elseif (($char >> 0x06) == 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN - $bytes[] = $char - 0x80; - if (count($bytes) == $numbytes) { - // compose UTF-8 bytes to a single unicode value - $char = $bytes[0]; - for ($j = 1; $j < $numbytes; ++$j) { - $char += ($bytes[$j] << (($numbytes - $j - 1) * 0x06)); - } - if ((($char >= 0xD800) AND ($char <= 0xDFFF)) OR ($char >= 0x10FFFF)) { - /* The definition of UTF-8 prohibits encoding character numbers between - U+D800 and U+DFFF, which are reserved for use with the UTF-16 - encoding form (as surrogate pairs) and do not directly represent - characters. */ - $unichar = 0xFFFD; // use replacement character - } else { - $unichar = $char; // add char to array - } - // reset data for next char - $bytes = array(); - $numbytes = 1; - } - } else { - // use replacement character for other invalid sequences - $unichar = 0xFFFD; - $bytes = array(); - $numbytes = 1; - } - if ($unichar >= 0) { - // insert unicode value into array - $unicode[] = $unichar; - // store this char for font subsetting - $this->CurrentFont['subsetchars'][$unichar] = true; - $unichar = -1; - } - } - // update font subsetchars - $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); - // insert new value on cache - $this->cache_UTF8StringToArray[$strkey]['s'] = $unicode; - $this->cache_UTF8StringToArray[$strkey]['f'][$this->CurrentFont['fontkey']] = true; - return $unicode; - } - - /** - * Converts UTF-8 strings to UTF16-BE.<br> - * @param string $str string to process. - * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) - * @return string - * @access protected - * @author Nicola Asuni - * @since 1.53.0.TC005 (2005-01-05) - * @uses UTF8StringToArray(), arrUTF8ToUTF16BE() - */ - protected function UTF8ToUTF16BE($str, $setbom=true) { - if (!$this->isunicode) { - return $str; // string is not in unicode - } - $unicode = $this->UTF8StringToArray($str); // array containing UTF-8 unicode values - return $this->arrUTF8ToUTF16BE($unicode, $setbom); - } - - /** - * Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.<br> - * @param string $str string to process. - * @return string - * @author Andrew Whitehead, Nicola Asuni - * @access protected - * @since 3.2.000 (2008-06-23) - */ - protected function UTF8ToLatin1($str) { - if (!$this->isunicode) { - return $str; // string is not in unicode - } - $outstr = ''; // string to be returned - $unicode = $this->UTF8StringToArray($str); // array containing UTF-8 unicode values - foreach ($unicode as $char) { - if ($char < 256) { - $outstr .= chr($char); - } elseif (array_key_exists($char, $this->unicode->uni_utf8tolatin)) { - // map from UTF-8 - $outstr .= chr($this->unicode->uni_utf8tolatin[$char]); - } elseif ($char == 0xFFFD) { - // skip - } else { - $outstr .= '?'; - } - } - return $outstr; - } - - /** - * Converts UTF-8 characters array to array of Latin1 characters<br> - * @param array $unicode array containing UTF-8 unicode values - * @return array - * @author Nicola Asuni - * @access protected - * @since 4.8.023 (2010-01-15) - */ - protected function UTF8ArrToLatin1($unicode) { - if ((!$this->isunicode) OR $this->isUnicodeFont()) { - return $unicode; - } - $outarr = array(); // array to be returned - foreach ($unicode as $char) { - if ($char < 256) { - $outarr[] = $char; - } elseif (array_key_exists($char, $this->unicode->uni_utf8tolatin)) { - // map from UTF-8 - $outarr[] = $this->unicode->uni_utf8tolatin[$char]; - } elseif ($char == 0xFFFD) { - // skip - } else { - $outarr[] = 63; // '?' character - } - } - return $outarr; - } - - /** - * Converts array of UTF-8 characters to UTF16-BE string.<br> - * Based on: http://www.faqs.org/rfcs/rfc2781.html - * <pre> - * Encoding UTF-16: - * - * Encoding of a single character from an ISO 10646 character value to - * UTF-16 proceeds as follows. Let U be the character number, no greater - * than 0x10FFFF. - * - * 1) If U < 0x10000, encode U as a 16-bit unsigned integer and - * terminate. - * - * 2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF, - * U' must be less than or equal to 0xFFFFF. That is, U' can be - * represented in 20 bits. - * - * 3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and - * 0xDC00, respectively. These integers each have 10 bits free to - * encode the character value, for a total of 20 bits. - * - * 4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order - * bits of W1 and the 10 low-order bits of U' to the 10 low-order - * bits of W2. Terminate. - * - * Graphically, steps 2 through 4 look like: - * U' = yyyyyyyyyyxxxxxxxxxx - * W1 = 110110yyyyyyyyyy - * W2 = 110111xxxxxxxxxx - * </pre> - * @param array $unicode array containing UTF-8 unicode values - * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) - * @return string - * @access protected - * @author Nicola Asuni - * @since 2.1.000 (2008-01-08) - * @see UTF8ToUTF16BE() - */ - protected function arrUTF8ToUTF16BE($unicode, $setbom=true) { - $outstr = ''; // string to be returned - if ($setbom) { - $outstr .= "\xFE\xFF"; // Byte Order Mark (BOM) - } - foreach ($unicode as $char) { - if ($char == 0x200b) { - // skip Unicode Character 'ZERO WIDTH SPACE' (DEC:8203, U+200B) - } elseif ($char == 0xFFFD) { - $outstr .= "\xFF\xFD"; // replacement character - } elseif ($char < 0x10000) { - $outstr .= chr($char >> 0x08); - $outstr .= chr($char & 0xFF); - } else { - $char -= 0x10000; - $w1 = 0xD800 | ($char >> 0x10); - $w2 = 0xDC00 | ($char & 0x3FF); - $outstr .= chr($w1 >> 0x08); - $outstr .= chr($w1 & 0xFF); - $outstr .= chr($w2 >> 0x08); - $outstr .= chr($w2 & 0xFF); - } - } - return $outstr; - } - // ==================================================== - - /** - * Set header font. - * @param array $font font - * @access public - * @since 1.1 - */ - public function setHeaderFont($font) { - $this->header_font = $font; - } - - /** - * Get header font. - * @return array() - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getHeaderFont() { - return $this->header_font; - } - - /** - * Set footer font. - * @param array $font font - * @access public - * @since 1.1 - */ - public function setFooterFont($font) { - $this->footer_font = $font; - } - - /** - * Get Footer font. - * @return array() - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getFooterFont() { - return $this->footer_font; - } - - /** - * Set language array. - * @param array $language - * @access public - * @since 1.1 - */ - public function setLanguageArray($language) { - $this->l = $language; - if (isset($this->l['a_meta_dir'])) { - $this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; - } else { - $this->rtl = false; - } - } - - /** - * Returns the PDF data. - * @access public - */ - public function getPDFData() { - if ($this->state < 3) { - $this->Close(); - } - return $this->buffer; - } - - /** - * Output anchor link. - * @param string $url link URL or internal link (i.e.: &lt;a href="#23,4.5"&gt;link to page 23 at 4.5 Y position&lt;/a&gt;) - * @param string $name link name - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param boolean $firstline if true prints only the first line and return the remaining string. - * @param array $color array of RGB text color - * @param string $style font style (U, D, B, I) - * @param boolean $firstblock if true the string is the starting of a line. - * @return the number of cells used or the remaining text if $firstline = true; - * @access public - */ - public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color='', $style=-1, $firstblock=false) { - if (!$this->empty_string($url) AND ($url{0} == '#')) { - // convert url to internal link - $lnkdata = explode(',', $url); - if (isset($lnkdata[0])) { - $page = intval(substr($lnkdata[0], 1)); - if (empty($page) OR ($page <= 0)) { - $page = $this->page; - } - if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) { - $lnky = floatval($lnkdata[1]); - } else { - $lnky = 0; - } - $url = $this->AddLink(); - $this->SetLink($url, $lnky, $page); - } - } - // store current settings - $prevcolor = $this->fgcolor; - $prevstyle = $this->FontStyle; - if (empty($color)) { - $this->SetTextColorArray($this->htmlLinkColorArray); - } else { - $this->SetTextColorArray($color); - } - if ($style == -1) { - $this->SetFont('', $this->FontStyle.$this->htmlLinkFontStyle); - } else { - $this->SetFont('', $this->FontStyle.$style); - } - $ret = $this->Write($this->lasth, $name, $url, $fill, '', false, 0, $firstline, $firstblock, 0); - // restore settings - $this->SetFont('', $prevstyle); - $this->SetTextColorArray($prevcolor); - return $ret; - } - - /** - * Returns an associative array (keys: R,G,B) from an html color name or a six-digit or three-digit hexadecimal color representation (i.e. #3FE5AA or #7FF). - * @param string $color html color - * @return array RGB color or false in case of error. - * @access public - */ - public function convertHTMLColorToDec($color='#FFFFFF') { - $returncolor = false; - $color = preg_replace('/[\s]*/', '', $color); // remove extra spaces - $color = strtolower($color); - if (($dotpos = strpos($color, '.')) !== false) { - // remove class parent (i.e.: color.red) - $color = substr($color, ($dotpos + 1)); - } - if (strlen($color) == 0) { - return false; - } - // RGB ARRAY - if (substr($color, 0, 3) == 'rgb') { - $codes = substr($color, 4); - $codes = str_replace(')', '', $codes); - $returncolor = explode(',', $codes); - return $returncolor; - } - // CMYK ARRAY - if (substr($color, 0, 4) == 'cmyk') { - $codes = substr($color, 5); - $codes = str_replace(')', '', $codes); - $returncolor = explode(',', $codes); - return $returncolor; - } - // COLOR NAME - if (substr($color, 0, 1) != '#') { - // decode color name - if (isset($this->webcolor[$color])) { - $color_code = $this->webcolor[$color]; - } else { - return false; - } - } else { - $color_code = substr($color, 1); - } - // RGB VALUE - switch (strlen($color_code)) { - case 3: { - // three-digit hexadecimal representation - $r = substr($color_code, 0, 1); - $g = substr($color_code, 1, 1); - $b = substr($color_code, 2, 1); - $returncolor['R'] = hexdec($r.$r); - $returncolor['G'] = hexdec($g.$g); - $returncolor['B'] = hexdec($b.$b); - break; - } - case 6: { - // six-digit hexadecimal representation - $returncolor['R'] = hexdec(substr($color_code, 0, 2)); - $returncolor['G'] = hexdec(substr($color_code, 2, 2)); - $returncolor['B'] = hexdec(substr($color_code, 4, 2)); - break; - } - } - return $returncolor; - } - - /** - * Converts pixels to User's Units. - * @param int $px pixels - * @return float value in user's unit - * @access public - * @see setImageScale(), getImageScale() - */ - public function pixelsToUnits($px) { - return ($px / ($this->imgscale * $this->k)); - } - - /** - * Reverse function for htmlentities. - * Convert entities in UTF-8. - * @param string $text_to_convert Text to convert. - * @return string converted text string - * @access public - */ - public function unhtmlentities($text_to_convert) { - return html_entity_decode($text_to_convert, ENT_QUOTES, $this->encoding); - } - - // ENCRYPTION METHODS ---------------------------------- - - /** - * Returns a string containing random data to be used as a seed for encryption methods. - * @param string $seed starting seed value - * @return string containing random data - * @author Nicola Asuni - * @since 5.9.006 (2010-10-19) - * @access protected - */ - protected function getRandomSeed($seed='') { - $seed .= microtime(); - if (function_exists('openssl_random_pseudo_bytes')) { - $seed .= openssl_random_pseudo_bytes(512); - } - $seed .= uniqid('', true); - $seed .= rand(); - $seed .= getmypid(); - $seed .= __FILE__; - $seed .= $this->bufferlen; - if (isset($_SERVER['REMOTE_ADDR'])) { - $seed .= $_SERVER['REMOTE_ADDR']; - } - if (isset($_SERVER['HTTP_USER_AGENT'])) { - $seed .= $_SERVER['HTTP_USER_AGENT']; - } - if (isset($_SERVER['HTTP_ACCEPT'])) { - $seed .= $_SERVER['HTTP_ACCEPT']; - } - if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { - $seed .= $_SERVER['HTTP_ACCEPT_ENCODING']; - } - if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $seed .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; - } - if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) { - $seed .= $_SERVER['HTTP_ACCEPT_CHARSET']; - } - $seed .= rand(); - $seed .= uniqid('', true); - $seed .= microtime(); - return $seed; - } - - /** - * Compute encryption key depending on object number where the encrypted data is stored. - * This is used for all strings and streams without crypt filter specifier. - * @param int $n object number - * @return int object key - * @access protected - * @author Nicola Asuni - * @since 2.0.000 (2008-01-02) - */ - protected function _objectkey($n) { - $objkey = $this->encryptdata['key'].pack('VXxx', $n); - if ($this->encryptdata['mode'] == 2) { // AES-128 - // AES padding - $objkey .= "\x73\x41\x6C\x54"; // sAlT - } - $objkey = substr($this->_md5_16($objkey), 0, (($this->encryptdata['Length'] / 8) + 5)); - $objkey = substr($objkey, 0, 16); - return $objkey; - } - - /** - * Encrypt the input string. - * @param int $n object number - * @param string $s data string to encrypt - * @return encrypted string - * @access protected - * @author Nicola Asuni - * @since 5.0.005 (2010-05-11) - */ - protected function _encrypt_data($n, $s) { - if (!$this->encrypted) { - return $s; - } - switch ($this->encryptdata['mode']) { - case 0: // RC4-40 - case 1: { // RC4-128 - $s = $this->_RC4($this->_objectkey($n), $s); - break; - } - case 2: { // AES-128 - $s = $this->_AES($this->_objectkey($n), $s); - break; - } - case 3: { // AES-256 - $s = $this->_AES($this->encryptdata['key'], $s); - break; - } - } - return $s; - } - - /** - * Put encryption on PDF document. - * @access protected - * @author Nicola Asuni - * @since 2.0.000 (2008-01-02) - */ - protected function _putencryption() { - if (!$this->encrypted) { - return; - } - $this->encryptdata['objid'] = $this->_newobj(); - $out = '<<'; - if (!isset($this->encryptdata['Filter']) OR empty($this->encryptdata['Filter'])) { - $this->encryptdata['Filter'] = 'Standard'; - } - $out .= ' /Filter /'.$this->encryptdata['Filter']; - if (isset($this->encryptdata['SubFilter']) AND !empty($this->encryptdata['SubFilter'])) { - $out .= ' /SubFilter /'.$this->encryptdata['SubFilter']; - } - if (!isset($this->encryptdata['V']) OR empty($this->encryptdata['V'])) { - $this->encryptdata['V'] = 1; - } - // V is a code specifying the algorithm to be used in encrypting and decrypting the document - $out .= ' /V '.$this->encryptdata['V']; - if (isset($this->encryptdata['Length']) AND !empty($this->encryptdata['Length'])) { - // The length of the encryption key, in bits. The value shall be a multiple of 8, in the range 40 to 256 - $out .= ' /Length '.$this->encryptdata['Length']; - } else { - $out .= ' /Length 40'; - } - if ($this->encryptdata['V'] >= 4) { - if (!isset($this->encryptdata['StmF']) OR empty($this->encryptdata['StmF'])) { - $this->encryptdata['StmF'] = 'Identity'; - } - if (!isset($this->encryptdata['StrF']) OR empty($this->encryptdata['StrF'])) { - // The name of the crypt filter that shall be used when decrypting all strings in the document. - $this->encryptdata['StrF'] = 'Identity'; - } - // A dictionary whose keys shall be crypt filter names and whose values shall be the corresponding crypt filter dictionaries. - if (isset($this->encryptdata['CF']) AND !empty($this->encryptdata['CF'])) { - $out .= ' /CF <<'; - $out .= ' /'.$this->encryptdata['StmF'].' <<'; - $out .= ' /Type /CryptFilter'; - if (isset($this->encryptdata['CF']['CFM']) AND !empty($this->encryptdata['CF']['CFM'])) { - // The method used - $out .= ' /CFM /'.$this->encryptdata['CF']['CFM']; - if ($this->encryptdata['pubkey']) { - $out .= ' /Recipients ['; - foreach ($this->encryptdata['Recipients'] as $rec) { - $out .= ' <'.$rec.'>'; - } - $out .= ' ]'; - if (isset($this->encryptdata['CF']['EncryptMetadata']) AND (!$this->encryptdata['CF']['EncryptMetadata'])) { - $out .= ' /EncryptMetadata false'; - } else { - $out .= ' /EncryptMetadata true'; - } - } - } else { - $out .= ' /CFM /None'; - } - if (isset($this->encryptdata['CF']['AuthEvent']) AND !empty($this->encryptdata['CF']['AuthEvent'])) { - // The event to be used to trigger the authorization that is required to access encryption keys used by this filter. - $out .= ' /AuthEvent /'.$this->encryptdata['CF']['AuthEvent']; - } else { - $out .= ' /AuthEvent /DocOpen'; - } - if (isset($this->encryptdata['CF']['Length']) AND !empty($this->encryptdata['CF']['Length'])) { - // The bit length of the encryption key. - $out .= ' /Length '.$this->encryptdata['CF']['Length']; - } - $out .= ' >> >>'; - } - // The name of the crypt filter that shall be used by default when decrypting streams. - $out .= ' /StmF /'.$this->encryptdata['StmF']; - // The name of the crypt filter that shall be used when decrypting all strings in the document. - $out .= ' /StrF /'.$this->encryptdata['StrF']; - if (isset($this->encryptdata['EFF']) AND !empty($this->encryptdata['EFF'])) { - // The name of the crypt filter that shall be used when encrypting embedded file streams that do not have their own crypt filter specifier. - $out .= ' /EFF /'.$this->encryptdata['']; - } - } - // Additional encryption dictionary entries for the standard security handler - if ($this->encryptdata['pubkey']) { - if (($this->encryptdata['V'] < 4) AND isset($this->encryptdata['Recipients']) AND !empty($this->encryptdata['Recipients'])) { - $out .= ' /Recipients ['; - foreach ($this->encryptdata['Recipients'] as $rec) { - $out .= ' <'.$rec.'>'; - } - $out .= ' ]'; - } - } else { - $out .= ' /R'; - if ($this->encryptdata['V'] == 5) { // AES-256 - $out .= ' 5'; - $out .= ' /OE ('.$this->_escape($this->encryptdata['OE']).')'; - $out .= ' /UE ('.$this->_escape($this->encryptdata['UE']).')'; - $out .= ' /Perms ('.$this->_escape($this->encryptdata['perms']).')'; - } elseif ($this->encryptdata['V'] == 4) { // AES-128 - $out .= ' 4'; - } elseif ($this->encryptdata['V'] < 2) { // RC-40 - $out .= ' 2'; - } else { // RC-128 - $out .= ' 3'; - } - $out .= ' /O ('.$this->_escape($this->encryptdata['O']).')'; - $out .= ' /U ('.$this->_escape($this->encryptdata['U']).')'; - $out .= ' /P '.$this->encryptdata['P']; - if (isset($this->encryptdata['EncryptMetadata']) AND (!$this->encryptdata['EncryptMetadata'])) { - $out .= ' /EncryptMetadata false'; - } else { - $out .= ' /EncryptMetadata true'; - } - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - - /** - * Returns the input text encrypted using RC4 algorithm and the specified key. - * RC4 is the standard encryption algorithm used in PDF format - * @param string $key encryption key - * @param String $text input text to be encrypted - * @return String encrypted text - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec, Nicola Asuni - */ - protected function _RC4($key, $text) { - if (function_exists('mcrypt_decrypt') AND ($out = @mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) { - // try to use mcrypt function if exist - return $out; - } - if ($this->last_enc_key != $key) { - $k = str_repeat($key, ((256 / strlen($key)) + 1)); - $rc4 = range(0, 255); - $j = 0; - for ($i = 0; $i < 256; ++$i) { - $t = $rc4[$i]; - $j = ($j + $t + ord($k{$i})) % 256; - $rc4[$i] = $rc4[$j]; - $rc4[$j] = $t; - } - $this->last_enc_key = $key; - $this->last_enc_key_c = $rc4; - } else { - $rc4 = $this->last_enc_key_c; - } - $len = strlen($text); - $a = 0; - $b = 0; - $out = ''; - for ($i = 0; $i < $len; ++$i) { - $a = ($a + 1) % 256; - $t = $rc4[$a]; - $b = ($b + $t) % 256; - $rc4[$a] = $rc4[$b]; - $rc4[$b] = $t; - $k = $rc4[($rc4[$a] + $rc4[$b]) % 256]; - $out .= chr(ord($text{$i}) ^ $k); - } - return $out; - } - - /** - * Returns the input text exrypted using AES algorithm and the specified key. - * This method requires mcrypt. - * @param string $key encryption key - * @param String $text input text to be encrypted - * @return String encrypted text - * @access protected - * @author Nicola Asuni - * @since 5.0.005 (2010-05-11) - */ - protected function _AES($key, $text) { - // padding (RFC 2898, PKCS #5: Password-Based Cryptography Specification Version 2.0) - $padding = 16 - (strlen($text) % 16); - $text .= str_repeat(chr($padding), $padding); - $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); - $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv); - $text = $iv.$text; - return $text; - } - - /** - * Encrypts a string using MD5 and returns it's value as a binary string. - * @param string $str input string - * @return String MD5 encrypted binary string - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Klemen Vodopivec - */ - protected function _md5_16($str) { - return pack('H*', md5($str)); - } - - /** - * Compute U value (used for encryption) - * @return string U value - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Nicola Asuni - */ - protected function _Uvalue() { - if ($this->encryptdata['mode'] == 0) { // RC4-40 - return $this->_RC4($this->encryptdata['key'], $this->enc_padding); - } elseif ($this->encryptdata['mode'] < 3) { // RC4-128, AES-128 - $tmp = $this->_md5_16($this->enc_padding.$this->encryptdata['fileid']); - $enc = $this->_RC4($this->encryptdata['key'], $tmp); - $len = strlen($tmp); - for ($i = 1; $i <= 19; ++$i) { - $ek = ''; - for ($j = 0; $j < $len; ++$j) { - $ek .= chr(ord($this->encryptdata['key']{$j}) ^ $i); - } - $enc = $this->_RC4($ek, $enc); - } - $enc .= str_repeat("\x00", 16); - return substr($enc, 0, 32); - } elseif ($this->encryptdata['mode'] == 3) { // AES-256 - $seed = $this->_md5_16($this->getRandomSeed()); - // User Validation Salt - $this->encryptdata['UVS'] = substr($seed, 0, 8); - // User Key Salt - $this->encryptdata['UKS'] = substr($seed, 8, 16); - return hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UVS'], true).$this->encryptdata['UVS'].$this->encryptdata['UKS']; - } - } - - /** - * Compute UE value (used for encryption) - * @return string UE value - * @access protected - * @since 5.9.006 (2010-10-19) - * @author Nicola Asuni - */ - protected function _UEvalue() { - $hashkey = hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UKS'], true); - $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); - return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $hashkey, $this->encryptdata['key'], MCRYPT_MODE_CBC, $iv); - } - - /** - * Compute O value (used for encryption) - * @return string O value - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Nicola Asuni - */ - protected function _Ovalue() { - if ($this->encryptdata['mode'] < 3) { // RC4-40, RC4-128, AES-128 - $tmp = $this->_md5_16($this->encryptdata['owner_password']); - if ($this->encryptdata['mode'] > 0) { - for ($i = 0; $i < 50; ++$i) { - $tmp = $this->_md5_16($tmp); - } - } - $owner_key = substr($tmp, 0, ($this->encryptdata['Length'] / 8)); - $enc = $this->_RC4($owner_key, $this->encryptdata['user_password']); - if ($this->encryptdata['mode'] > 0) { - $len = strlen($owner_key); - for ($i = 1; $i <= 19; ++$i) { - $ek = ''; - for ($j = 0; $j < $len; ++$j) { - $ek .= chr(ord($owner_key{$j}) ^ $i); - } - $enc = $this->_RC4($ek, $enc); - } - } - return $enc; - } elseif ($this->encryptdata['mode'] == 3) { // AES-256 - $seed = $this->_md5_16($this->getRandomSeed()); - // Owner Validation Salt - $this->encryptdata['OVS'] = substr($seed, 0, 8); - // Owner Key Salt - $this->encryptdata['OKS'] = substr($seed, 8, 16); - return hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OVS'].$this->encryptdata['U'], true).$this->encryptdata['OVS'].$this->encryptdata['OKS']; - } - } - - /** - * Compute OE value (used for encryption) - * @return string OE value - * @access protected - * @since 5.9.006 (2010-10-19) - * @author Nicola Asuni - */ - protected function _OEvalue() { - $hashkey = hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OKS'].$this->encryptdata['U'], true); - $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); - return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $hashkey, $this->encryptdata['key'], MCRYPT_MODE_CBC, $iv); - } - - /** - * Convert password for AES-256 encryption mode - * @return string password - * @access protected - * @since 5.9.006 (2010-10-19) - * @author Nicola Asuni - */ - protected function _fixAES256Password($password) { - $psw = ''; // password to be returned - $psw_array = $this->utf8Bidi($this->UTF8StringToArray($password), $password, $this->rtl); - foreach ($psw_array as $c) { - $psw .= $this->unichr($c); - } - return substr($psw, 0, 127); - } - - /** - * Compute encryption key - * @access protected - * @since 2.0.000 (2008-01-02) - * @author Nicola Asuni - */ - protected function _generateencryptionkey() { - $keybytelen = ($this->encryptdata['Length'] / 8); - if (!$this->encryptdata['pubkey']) { // standard mode - if ($this->encryptdata['mode'] == 3) { // AES-256 - // generate 256 bit random key - $this->encryptdata['key'] = substr(hash('sha256', $this->getRandomSeed(), true), 0, $keybytelen); - // truncate passwords - $this->encryptdata['user_password'] = $this->_fixAES256Password($this->encryptdata['user_password']); - $this->encryptdata['owner_password'] = $this->_fixAES256Password($this->encryptdata['owner_password']); - // Compute U value - $this->encryptdata['U'] = $this->_Uvalue(); - // Compute UE value - $this->encryptdata['UE'] = $this->_UEvalue(); - // Compute O value - $this->encryptdata['O'] = $this->_Ovalue(); - // Compute OE value - $this->encryptdata['OE'] = $this->_OEvalue(); - // Compute P value - $this->encryptdata['P'] = $this->encryptdata['protection']; - // Computing the encryption dictionary's Perms (permissions) value - $perms = $this->getEncPermissionsString($this->encryptdata['protection']); // bytes 0-3 - $perms .= chr(255).chr(255).chr(255).chr(255); // bytes 4-7 - if (isset($this->encryptdata['CF']['EncryptMetadata']) AND (!$this->encryptdata['CF']['EncryptMetadata'])) { // byte 8 - $perms .= 'F'; - } else { - $perms .= 'T'; - } - $perms .= 'adb'; // bytes 9-11 - $perms .= 'nick'; // bytes 12-15 - $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB)); - $this->encryptdata['perms'] = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->encryptdata['key'], $perms, MCRYPT_MODE_ECB, $iv); - } else { // RC4-40, RC4-128, AES-128 - // Pad passwords - $this->encryptdata['user_password'] = substr($this->encryptdata['user_password'].$this->enc_padding, 0, 32); - $this->encryptdata['owner_password'] = substr($this->encryptdata['owner_password'].$this->enc_padding, 0, 32); - // Compute O value - $this->encryptdata['O'] = $this->_Ovalue(); - // get default permissions (reverse byte order) - $permissions = $this->getEncPermissionsString($this->encryptdata['protection']); - // Compute encryption key - $tmp = $this->_md5_16($this->encryptdata['user_password'].$this->encryptdata['O'].$permissions.$this->encryptdata['fileid']); - if ($this->encryptdata['mode'] > 0) { - for ($i = 0; $i < 50; ++$i) { - $tmp = $this->_md5_16(substr($tmp, 0, $keybytelen)); - } - } - $this->encryptdata['key'] = substr($tmp, 0, $keybytelen); - // Compute U value - $this->encryptdata['U'] = $this->_Uvalue(); - // Compute P value - $this->encryptdata['P'] = $this->encryptdata['protection']; - } - } else { // Public-Key mode - // random 20-byte seed - $seed = sha1($this->getRandomSeed(), true); - $recipient_bytes = ''; - foreach ($this->encryptdata['pubkeys'] as $pubkey) { - // for each public certificate - if (isset($pubkey['p'])) { - $pkprotection = $this->getUserPermissionCode($pubkey['p'], $this->encryptdata['mode']); - } else { - $pkprotection = $this->encryptdata['protection']; - } - // get default permissions (reverse byte order) - $pkpermissions = $this->getEncPermissionsString($pkprotection); - // envelope data - $envelope = $seed.$pkpermissions; - // write the envelope data to a temporary file - $tempkeyfile = tempnam(K_PATH_CACHE, 'tmpkey_'); - $f = fopen($tempkeyfile, 'wb'); - if (!$f) { - $this->Error('Unable to create temporary key file: '.$tempkeyfile); - } - $envelope_lenght = strlen($envelope); - fwrite($f, $envelope, $envelope_lenght); - fclose($f); - $tempencfile = tempnam(K_PATH_CACHE, 'tmpenc_'); - if (!openssl_pkcs7_encrypt($tempkeyfile, $tempencfile, $pubkey['c'], array(), PKCS7_DETACHED | PKCS7_BINARY)) { - $this->Error('Unable to encrypt the file: '.$tempkeyfile); - } - unlink($tempkeyfile); - // read encryption signature - $signature = file_get_contents($tempencfile, false, null, $envelope_lenght); - unlink($tempencfile); - // extract signature - $signature = substr($signature, strpos($signature, 'Content-Disposition')); - $tmparr = explode("\n\n", $signature); - $signature = trim($tmparr[1]); - unset($tmparr); - // decode signature - $signature = base64_decode($signature); - // convert signature to hex - $hexsignature = current(unpack('H*', $signature)); - // store signature on recipients array - $this->encryptdata['Recipients'][] = $hexsignature; - // The bytes of each item in the Recipients array of PKCS#7 objects in the order in which they appear in the array - $recipient_bytes .= $signature; - } - // calculate encryption key - if ($this->encryptdata['mode'] == 3) { // AES-256 - $this->encryptdata['key'] = substr(hash('sha256', $seed.$recipient_bytes, true), 0, $keybytelen); - } else { // RC4-40, RC4-128, AES-128 - $this->encryptdata['key'] = substr(sha1($seed.$recipient_bytes, true), 0, $keybytelen); - } - } - } - - /** - * Return the premission code used on encryption (P value). - * @param Array $permissions the set of permissions (specify the ones you want to block). - * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. - * @access protected - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - */ - protected function getUserPermissionCode($permissions, $mode=0) { - $options = array( - 'owner' => 2, // bit 2 -- inverted logic: cleared by default - 'print' => 4, // bit 3 - 'modify' => 8, // bit 4 - 'copy' => 16, // bit 5 - 'annot-forms' => 32, // bit 6 - 'fill-forms' => 256, // bit 9 - 'extract' => 512, // bit 10 - 'assemble' => 1024,// bit 11 - 'print-high' => 2048 // bit 12 - ); - $protection = 2147422012; // 32 bit: (01111111 11111111 00001111 00111100) - foreach ($permissions as $permission) { - if (!isset($options[$permission])) { - $this->Error('Incorrect permission: '.$permission); - } - if (($mode > 0) OR ($options[$permission] <= 32)) { - // set only valid permissions - if ($options[$permission] == 2) { - // the logic for bit 2 is inverted (cleared by default) - $protection += $options[$permission]; - } else { - $protection -= $options[$permission]; - } - } - } - return $protection; - } - - /** - * Set document protection - * Remark: the protection against modification is for people who have the full Acrobat product. - * If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. - * Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts. - * @param Array $permissions the set of permissions (specify the ones you want to block):<ul><li>print : Print the document;</li><li>modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';</li><li>copy : Copy or otherwise extract text and graphics from the document;</li><li>annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);</li><li>fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;</li><li>extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);</li><li>assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;</li><li>print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.</li><li>owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.</li></ul> - * @param String $user_pass user password. Empty by default. - * @param String $owner_pass owner password. If not specified, a random value is used. - * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. - * @param String $pubkeys array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../tcpdf.crt', 'p' => array('print'))) - * @access public - * @since 2.0.000 (2008-01-02) - * @author Nicola Asuni - */ - public function SetProtection($permissions=array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null) { - $this->encryptdata['protection'] = $this->getUserPermissionCode($permissions, $mode); - if (($pubkeys !== null) AND (is_array($pubkeys))) { - // public-key mode - $this->encryptdata['pubkeys'] = $pubkeys; - if ($mode == 0) { - // public-Key Security requires at least 128 bit - $mode = 1; - } - if (!function_exists('openssl_pkcs7_encrypt')) { - $this->Error('Public-Key Security requires openssl library.'); - } - // Set Public-Key filter (availabe are: Entrust.PPKEF, Adobe.PPKLite, Adobe.PubSec) - $this->encryptdata['pubkey'] = true; - $this->encryptdata['Filter'] = 'Adobe.PubSec'; - $this->encryptdata['StmF'] = 'DefaultCryptFilter'; - $this->encryptdata['StrF'] = 'DefaultCryptFilter'; - } else { - // standard mode (password mode) - $this->encryptdata['pubkey'] = false; - $this->encryptdata['Filter'] = 'Standard'; - $this->encryptdata['StmF'] = 'StdCF'; - $this->encryptdata['StrF'] = 'StdCF'; - } - if ($mode > 1) { // AES - if (!extension_loaded('mcrypt')) { - $this->Error('AES encryption requires mcrypt library (http://www.php.net/manual/en/mcrypt.requirements.php).'); - } - if (mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) { - $this->Error('AES encryption requires MCRYPT_RIJNDAEL_128 cypher.'); - } - if (($mode == 3) AND !function_exists('hash')) { - // the Hash extension requires no external libraries and is enabled by default as of PHP 5.1.2. - $this->Error('AES 256 encryption requires HASH Message Digest Framework (http://www.php.net/manual/en/book.hash.php).'); - } - } - if ($owner_pass === null) { - $owner_pass = md5($this->getRandomSeed()); - } - $this->encryptdata['user_password'] = $user_pass; - $this->encryptdata['owner_password'] = $owner_pass; - $this->encryptdata['mode'] = $mode; - switch ($mode) { - case 0: { // RC4 40 bit - $this->encryptdata['V'] = 1; - $this->encryptdata['Length'] = 40; - $this->encryptdata['CF']['CFM'] = 'V2'; - break; - } - case 1: { // RC4 128 bit - $this->encryptdata['V'] = 2; - $this->encryptdata['Length'] = 128; - $this->encryptdata['CF']['CFM'] = 'V2'; - if ($this->encryptdata['pubkey']) { - $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s4'; - $this->encryptdata['Recipients'] = array(); - } - break; - } - case 2: { // AES 128 bit - $this->encryptdata['V'] = 4; - $this->encryptdata['Length'] = 128; - $this->encryptdata['CF']['CFM'] = 'AESV2'; - $this->encryptdata['CF']['Length'] = 128; - if ($this->encryptdata['pubkey']) { - $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s5'; - $this->encryptdata['Recipients'] = array(); - } - break; - } - case 3: { // AES 256 bit - $this->encryptdata['V'] = 5; - $this->encryptdata['Length'] = 256; - $this->encryptdata['CF']['CFM'] = 'AESV3'; - $this->encryptdata['CF']['Length'] = 256; - if ($this->encryptdata['pubkey']) { - $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s5'; - $this->encryptdata['Recipients'] = array(); - } - break; - } - } - $this->encrypted = true; - $this->encryptdata['fileid'] = $this->convertHexStringToString($this->file_id); - $this->_generateencryptionkey(); - } - - /** - * Convert hexadecimal string to string - * @param string $bs byte-string to convert - * @return String - * @access protected - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - */ - protected function convertHexStringToString($bs) { - $string = ''; // string to be returned - $bslenght = strlen($bs); - if (($bslenght % 2) != 0) { - // padding - $bs .= '0'; - ++$bslenght; - } - for ($i = 0; $i < $bslenght; $i += 2) { - $string .= chr(hexdec($bs{$i}.$bs{($i + 1)})); - } - return $string; - } - - /** - * Convert string to hexadecimal string (byte string) - * @param string $s string to convert - * @return byte string - * @access protected - * @since 5.0.010 (2010-05-17) - * @author Nicola Asuni - */ - protected function convertStringToHexString($s) { - $bs = ''; - $chars = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY); - foreach ($chars as $c) { - $bs .= sprintf('%02s', dechex(ord($c))); - } - return $bs; - } - - /** - * Convert encryption P value to a string of bytes, low-order byte first. - * @param string $protection 32bit encryption permission value (P value) - * @return String - * @access protected - * @since 5.0.005 (2010-05-12) - * @author Nicola Asuni - */ - protected function getEncPermissionsString($protection) { - $binprot = sprintf('%032b', $protection); - $str = chr(bindec(substr($binprot, 24, 8))); - $str .= chr(bindec(substr($binprot, 16, 8))); - $str .= chr(bindec(substr($binprot, 8, 8))); - $str .= chr(bindec(substr($binprot, 0, 8))); - return $str; - } - - // END OF ENCRYPTION FUNCTIONS ------------------------- - - // START TRANSFORMATIONS SECTION ----------------------- - - /** - * Starts a 2D tranformation saving current graphic state. - * This function must be called before scaling, mirroring, translation, rotation and skewing. - * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function StartTransform() { - $this->_out('q'); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['transfmrk'][] = strlen($this->xobjects[$this->xobjid]['outdata']); - } else { - $this->transfmrk[$this->page][] = $this->pagelen[$this->page]; - } - ++$this->transfmatrix_key; - $this->transfmatrix[$this->transfmatrix_key] = array(); - } - - /** - * Stops a 2D tranformation restoring previous graphic state. - * This function must be called after scaling, mirroring, translation, rotation and skewing. - * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function StopTransform() { - $this->_out('Q'); - if (isset($this->transfmatrix[$this->transfmatrix_key])) { - array_pop($this->transfmatrix[$this->transfmatrix_key]); - --$this->transfmatrix_key; - } - if ($this->inxobj) { - // we are inside an XObject template - array_pop($this->xobjects[$this->xobjid]['transfmrk']); - } else { - array_pop($this->transfmrk[$this->page]); - } - } - /** - * Horizontal Scaling. - * @param float $s_x scaling factor for width as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function ScaleX($s_x, $x='', $y='') { - $this->Scale($s_x, 100, $x, $y); - } - - /** - * Vertical Scaling. - * @param float $s_y scaling factor for height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function ScaleY($s_y, $x='', $y='') { - $this->Scale(100, $s_y, $x, $y); - } - - /** - * Vertical and horizontal proportional Scaling. - * @param float $s scaling factor for width and height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function ScaleXY($s, $x='', $y='') { - $this->Scale($s, $s, $x, $y); - } - - /** - * Vertical and horizontal non-proportional Scaling. - * @param float $s_x scaling factor for width as percent. 0 is not allowed. - * @param float $s_y scaling factor for height as percent. 0 is not allowed. - * @param int $x abscissa of the scaling center. Default is current x position - * @param int $y ordinate of the scaling center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function Scale($s_x, $s_y, $x='', $y='') { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - if (($s_x == 0) OR ($s_y == 0)) { - $this->Error('Please do not use values equal to zero for scaling'); - } - $y = ($this->h - $y) * $this->k; - $x *= $this->k; - //calculate elements of transformation matrix - $s_x /= 100; - $s_y /= 100; - $tm = array(); - $tm[0] = $s_x; - $tm[1] = 0; - $tm[2] = 0; - $tm[3] = $s_y; - $tm[4] = $x * (1 - $s_x); - $tm[5] = $y * (1 - $s_y); - //scale the coordinate system - $this->Transform($tm); - } - - /** - * Horizontal Mirroring. - * @param int $x abscissa of the point. Default is current x position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function MirrorH($x='') { - $this->Scale(-100, 100, $x); - } - - /** - * Verical Mirroring. - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function MirrorV($y='') { - $this->Scale(100, -100, '', $y); - } - - /** - * Point reflection mirroring. - * @param int $x abscissa of the point. Default is current x position - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function MirrorP($x='',$y='') { - $this->Scale(-100, -100, $x, $y); - } - - /** - * Reflection against a straight line through point (x, y) with the gradient angle (angle). - * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line). - * @param int $x abscissa of the point. Default is current x position - * @param int $y ordinate of the point. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function MirrorL($angle=0, $x='',$y='') { - $this->Scale(-100, 100, $x, $y); - $this->Rotate(-2*($angle-90), $x, $y); - } - - /** - * Translate graphic object horizontally. - * @param int $t_x movement to the right (or left for RTL) - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function TranslateX($t_x) { - $this->Translate($t_x, 0); - } - - /** - * Translate graphic object vertically. - * @param int $t_y movement to the bottom - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function TranslateY($t_y) { - $this->Translate(0, $t_y); - } - - /** - * Translate graphic object horizontally and vertically. - * @param int $t_x movement to the right - * @param int $t_y movement to the bottom - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function Translate($t_x, $t_y) { - //calculate elements of transformation matrix - $tm = array(); - $tm[0] = 1; - $tm[1] = 0; - $tm[2] = 0; - $tm[3] = 1; - $tm[4] = $t_x * $this->k; - $tm[5] = -$t_y * $this->k; - //translate the coordinate system - $this->Transform($tm); - } - - /** - * Rotate object. - * @param float $angle angle in degrees for counter-clockwise rotation - * @param int $x abscissa of the rotation center. Default is current x position - * @param int $y ordinate of the rotation center. Default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function Rotate($angle, $x='', $y='') { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - $y = ($this->h - $y) * $this->k; - $x *= $this->k; - //calculate elements of transformation matrix - $tm = array(); - $tm[0] = cos(deg2rad($angle)); - $tm[1] = sin(deg2rad($angle)); - $tm[2] = -$tm[1]; - $tm[3] = $tm[0]; - $tm[4] = $x + ($tm[1] * $y) - ($tm[0] * $x); - $tm[5] = $y - ($tm[0] * $y) - ($tm[1] * $x); - //rotate the coordinate system around ($x,$y) - $this->Transform($tm); - } - - /** - * Skew horizontally. - * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function SkewX($angle_x, $x='', $y='') { - $this->Skew($angle_x, 0, $x, $y); - } - - /** - * Skew vertically. - * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function SkewY($angle_y, $x='', $y='') { - $this->Skew(0, $angle_y, $x, $y); - } - - /** - * Skew. - * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) - * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) - * @param int $x abscissa of the skewing center. default is current x position - * @param int $y ordinate of the skewing center. default is current y position - * @access public - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - public function Skew($angle_x, $angle_y, $x='', $y='') { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - if (($angle_x <= -90) OR ($angle_x >= 90) OR ($angle_y <= -90) OR ($angle_y >= 90)) { - $this->Error('Please use values between -90 and +90 degrees for Skewing.'); - } - $x *= $this->k; - $y = ($this->h - $y) * $this->k; - //calculate elements of transformation matrix - $tm = array(); - $tm[0] = 1; - $tm[1] = tan(deg2rad($angle_y)); - $tm[2] = tan(deg2rad($angle_x)); - $tm[3] = 1; - $tm[4] = -$tm[2] * $y; - $tm[5] = -$tm[1] * $x; - //skew the coordinate system - $this->Transform($tm); - } - - /** - * Apply graphic transformations. - * @param array $tm transformation matrix - * @access protected - * @since 2.1.000 (2008-01-07) - * @see StartTransform(), StopTransform() - */ - protected function Transform($tm) { - $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $tm[0], $tm[1], $tm[2], $tm[3], $tm[4], $tm[5])); - // add tranformation matrix - $this->transfmatrix[$this->transfmatrix_key][] = array('a' => $tm[0], 'b' => $tm[1], 'c' => $tm[2], 'd' => $tm[3], 'e' => $tm[4], 'f' => $tm[5]); - // update transformation mark - if ($this->inxobj) { - // we are inside an XObject template - if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { - $key = key($this->xobjects[$this->xobjid]['transfmrk']); - $this->xobjects[$this->xobjid]['transfmrk'][$key] = strlen($this->xobjects[$this->xobjid]['outdata']); - } - } elseif (end($this->transfmrk[$this->page]) !== false) { - $key = key($this->transfmrk[$this->page]); - $this->transfmrk[$this->page][$key] = $this->pagelen[$this->page]; - } - } - - // END TRANSFORMATIONS SECTION ------------------------- - - // START GRAPHIC FUNCTIONS SECTION --------------------- - // The following section is based on the code provided by David Hernandez Sanz - - /** - * Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page. - * @param float $width The width. - * @access public - * @since 1.0 - * @see Line(), Rect(), Cell(), MultiCell() - */ - public function SetLineWidth($width) { - //Set line width - $this->LineWidth = $width; - $this->linestyleWidth = sprintf('%.2F w', ($width * $this->k)); - if ($this->page > 0) { - $this->_out($this->linestyleWidth); - } - } - - /** - * Returns the current the line width. - * @return int Line width - * @access public - * @since 2.1.000 (2008-01-07) - * @see Line(), SetLineWidth() - */ - public function GetLineWidth() { - return $this->LineWidth; - } - - /** - * Set line style. - * @param array $style Line style. Array with keys among the following: - * <ul> - * <li>width (float): Width of the line in user units.</li> - * <li>cap (string): Type of cap to put on the line. Possible values are: - * butt, round, square. The difference between "square" and "butt" is that - * "square" projects a flat end past the end of the line.</li> - * <li>join (string): Type of join. Possible values are: miter, round, - * bevel.</li> - * <li>dash (mixed): Dash pattern. Is 0 (without dash) or string with - * series of length values, which are the lengths of the on and off dashes. - * For example: "2" represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, - * 1 off, 2 on, 1 off, ...</li> - * <li>phase (integer): Modifier on the dash pattern which is used to shift - * the point at which the pattern starts.</li> - * <li>color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K).</li> - * </ul> - * @param boolean $ret if true do not send the command. - * @return string the PDF command - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function SetLineStyle($style, $ret=false) { - $s = ''; // string to be returned - if (!is_array($style)) { - return; - } - extract($style); - if (isset($width)) { - $this->LineWidth = $width; - $this->linestyleWidth = sprintf('%.2F w', ($width * $this->k)); - $s .= $this->linestyleWidth.' '; - } - if (isset($cap)) { - $ca = array('butt' => 0, 'round'=> 1, 'square' => 2); - if (isset($ca[$cap])) { - $this->linestyleCap = $ca[$cap].' J'; - $s .= $this->linestyleCap.' '; - } - } - if (isset($join)) { - $ja = array('miter' => 0, 'round' => 1, 'bevel' => 2); - if (isset($ja[$join])) { - $this->linestyleJoin = $ja[$join].' j'; - $s .= $this->linestyleJoin.' '; - } - } - if (isset($dash)) { - $dash_string = ''; - if ($dash) { - if (preg_match('/^.+,/', $dash) > 0) { - $tab = explode(',', $dash); - } else { - $tab = array($dash); - } - $dash_string = ''; - foreach ($tab as $i => $v) { - if ($i) { - $dash_string .= ' '; - } - $dash_string .= sprintf('%.2F', $v); - } - } - if (!isset($phase) OR !$dash) { - $phase = 0; - } - $this->linestyleDash = sprintf('[%s] %.2F d', $dash_string, $phase); - $s .= $this->linestyleDash.' '; - } - if (isset($color)) { - $s .= $this->SetDrawColorArray($color, true).' '; - } - if (!$ret) { - $this->_out($s); - } - return $s; - } - - /** - * Begin a new subpath by moving the current point to coordinates (x, y), omitting any connecting line segment. - * @param float $x Abscissa of point. - * @param float $y Ordinate of point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ - protected function _outPoint($x, $y) { - $this->_out(sprintf('%.2F %.2F m', $x * $this->k, ($this->h - $y) * $this->k)); - } - - /** - * Append a straight line segment from the current point to the point (x, y). - * The new current point shall be (x, y). - * @param float $x Abscissa of end point. - * @param float $y Ordinate of end point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ - protected function _outLine($x, $y) { - $this->_out(sprintf('%.2F %.2F l', $x * $this->k, ($this->h - $y) * $this->k)); - } - - /** - * Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space. - * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). - * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). - * @param float $w Width. - * @param float $h Height. - * @param string $op options - * @access protected - * @since 2.1.000 (2008-01-08) - */ - protected function _outRect($x, $y, $w, $h, $op) { - $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x * $this->k, ($this->h - $y) * $this->k, $w * $this->k, -$h * $this->k, $op)); - } - - /** - * Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bézier control points. - * The new current point shall be (x3, y3). - * @param float $x1 Abscissa of control point 1. - * @param float $y1 Ordinate of control point 1. - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ - protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) { - $this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k)); - } - - /** - * Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bézier control points. - * The new current point shall be (x3, y3). - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @access protected - * @since 4.9.019 (2010-04-26) - */ - protected function _outCurveV($x2, $y2, $x3, $y3) { - $this->_out(sprintf('%.2F %.2F %.2F %.2F v', $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k)); - } - - /** - * Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bézier control points. - * The new current point shall be (x3, y3). - * @param float $x1 Abscissa of control point 1. - * @param float $y1 Ordinate of control point 1. - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @access protected - * @since 2.1.000 (2008-01-08) - */ - protected function _outCurveY($x1, $y1, $x3, $y3) { - $this->_out(sprintf('%.2F %.2F %.2F %.2F y', $x1 * $this->k, ($this->h - $y1) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k)); - } - - /** - * Draws a line between two points. - * @param float $x1 Abscissa of first point. - * @param float $y1 Ordinate of first point. - * @param float $x2 Abscissa of second point. - * @param float $y2 Ordinate of second point. - * @param array $style Line style. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @access public - * @since 1.0 - * @see SetLineWidth(), SetDrawColor(), SetLineStyle() - */ - public function Line($x1, $y1, $x2, $y2, $style=array()) { - if (is_array($style)) { - $this->SetLineStyle($style); - } - $this->_outPoint($x1, $y1); - $this->_outLine($x2, $y2); - $this->_out('S'); - } - - /** - * Draws a rectangle. - * @param float $x Abscissa of upper-left corner (or upper-right corner for RTL language). - * @param float $y Ordinate of upper-left corner (or upper-right corner for RTL language). - * @param float $w Width. - * @param float $h Height. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $border_style Border style of rectangle. Array with keys among the following: - * <ul> - * <li>all: Line style of all borders. Array like for {@link SetLineStyle SetLineStyle}.</li> - * <li>L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for {@link SetLineStyle SetLineStyle}.</li> - * </ul> - * If a key is not present or is null, not draws the border. Default value: default line style (empty array). - * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @since 1.0 - * @see SetLineStyle() - */ - public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND !empty($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ((!$border_style) OR (isset($border_style['all']))) { - if (isset($border_style['all']) AND $border_style['all']) { - $this->SetLineStyle($border_style['all']); - $border_style = array(); - } - } - $this->_outRect($x, $y, $w, $h, $op); - if ($border_style) { - $border_style2 = array(); - foreach ($border_style as $line => $value) { - $length = strlen($line); - for ($i = 0; $i < $length; ++$i) { - $border_style2[$line[$i]] = $value; - } - } - $border_style = $border_style2; - if (isset($border_style['L']) AND $border_style['L']) { - $this->Line($x, $y, $x, $y + $h, $border_style['L']); - } - if (isset($border_style['T']) AND $border_style['T']) { - $this->Line($x, $y, $x + $w, $y, $border_style['T']); - } - if (isset($border_style['R']) AND $border_style['R']) { - $this->Line($x + $w, $y, $x + $w, $y + $h, $border_style['R']); - } - if (isset($border_style['B']) AND $border_style['B']) { - $this->Line($x, $y + $h, $x + $w, $y + $h, $border_style['B']); - } - } - } - - /** - * Draws a Bezier curve. - * The Bezier curve is a tangent to the line between the control points at - * either end of the curve. - * @param float $x0 Abscissa of start point. - * @param float $y0 Ordinate of start point. - * @param float $x1 Abscissa of control point 1. - * @param float $y1 Ordinate of control point 1. - * @param float $x2 Abscissa of control point 2. - * @param float $y2 Ordinate of control point 2. - * @param float $x3 Abscissa of end point. - * @param float $y3 Ordinate of end point. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @see SetLineStyle() - * @since 2.1.000 (2008-01-08) - */ - public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ($line_style) { - $this->SetLineStyle($line_style); - } - $this->_outPoint($x0, $y0); - $this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3); - $this->_out($op); - } - - /** - * Draws a poly-Bezier curve. - * Each Bezier curve segment is a tangent to the line between the control points at - * either end of the curve. - * @param float $x0 Abscissa of start point. - * @param float $y0 Ordinate of start point. - * @param float $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of curve. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @see SetLineStyle() - * @since 3.0008 (2008-05-12) - */ - public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ($op == 'f') { - $line_style = array(); - } - if ($line_style) { - $this->SetLineStyle($line_style); - } - $this->_outPoint($x0, $y0); - foreach ($segments as $segment) { - list($x1, $y1, $x2, $y2, $x3, $y3) = $segment; - $this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3); - } - $this->_out($op); - } - - /** - * Draws an ellipse. - * An ellipse is formed from n Bezier curves. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $rx Horizontal radius. - * @param float $ry Vertical radius (if ry = 0 then is a circle, see {@link Circle Circle}). Default value: 0. - * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. - * @param float $astart: Angle start of draw line. Default value: 0. - * @param float $afinish: Angle finish of draw line. Default value: 360. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of ellipse. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. - * @author Nicola Asuni - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function Ellipse($x0, $y0, $rx, $ry='', $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { - if ($this->empty_string($ry) OR ($ry == 0)) { - $ry = $rx; - } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ($op == 'f') { - $line_style = array(); - } - if ($line_style) { - $this->SetLineStyle($line_style); - } - $this->_outellipticalarc($x0, $y0, $rx, $ry, $angle, $astart, $afinish, false, $nc); - $this->_out($op); - } - - /** - * Append an elliptical arc to the current path. - * An ellipse is formed from n Bezier curves. - * @param float $xc Abscissa of center point. - * @param float $yc Ordinate of center point. - * @param float $rx Horizontal radius. - * @param float $ry Vertical radius (if ry = 0 then is a circle, see {@link Circle Circle}). Default value: 0. - * @param float $xang: Angle between the X-axis and the major axis of the ellipse. Default value: 0. - * @param float $angs: Angle start of draw line. Default value: 0. - * @param float $angf: Angle finish of draw line. Default value: 360. - * @param boolean $pie if true do not mark the border point (used to draw pie sectors). - * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. - * @author Nicola Asuni - * @access protected - * @since 4.9.019 (2010-04-26) - */ - protected function _outellipticalarc($xc, $yc, $rx, $ry, $xang=0, $angs=0, $angf=360, $pie=false, $nc=2) { - $k = $this->k; - if ($nc < 2) { - $nc = 2; - } - if ($pie) { - // center of the arc - $this->_outPoint($xc, $yc); - } - $xang = deg2rad((float) $xang); - $angs = deg2rad((float) $angs); - $angf = deg2rad((float) $angf); - $as = atan2((sin($angs) / $ry), (cos($angs) / $rx)); - $af = atan2((sin($angf) / $ry), (cos($angf) / $rx)); - if ($as < 0) { - $as += (2 * M_PI); - } - if ($af < 0) { - $af += (2 * M_PI); - } - if ($as > $af) { - // reverse rotation go clockwise - $as -= (2 * M_PI); - } - $total_angle = ($af - $as); - if ($nc < 2) { - $nc = 2; - } - // total arcs to draw - $nc *= (2 * abs($total_angle) / M_PI); - $nc = round($nc) + 1; - // angle of each arc - $arcang = $total_angle / $nc; - // center point in PDF coordiantes - $x0 = $xc; - $y0 = ($this->h - $yc); - // starting angle - $ang = $as; - $alpha = sin($arcang) * ((sqrt(4 + (3 * pow(tan(($arcang) / 2), 2))) - 1) / 3); - $cos_xang = cos($xang); - $sin_xang = sin($xang); - $cos_ang = cos($ang); - $sin_ang = sin($ang); - // first arc point - $px1 = $x0 + ($rx * $cos_xang * $cos_ang) - ($ry * $sin_xang * $sin_ang); - $py1 = $y0 + ($rx * $sin_xang * $cos_ang) + ($ry * $cos_xang * $sin_ang); - // first Bezier control point - $qx1 = ($alpha * ((-$rx * $cos_xang * $sin_ang) - ($ry * $sin_xang * $cos_ang))); - $qy1 = ($alpha * ((-$rx * $sin_xang * $sin_ang) + ($ry * $cos_xang * $cos_ang))); - if ($pie) { - $this->_outLine($px1, $this->h - $py1); - } else { - $this->_outPoint($px1, $this->h - $py1); - } - // draw arcs - for ($i = 1; $i <= $nc; ++$i) { - // starting angle - $ang = $as + ($i * $arcang); - $cos_xang = cos($xang); - $sin_xang = sin($xang); - $cos_ang = cos($ang); - $sin_ang = sin($ang); - // second arc point - $px2 = $x0 + ($rx * $cos_xang * $cos_ang) - ($ry * $sin_xang * $sin_ang); - $py2 = $y0 + ($rx * $sin_xang * $cos_ang) + ($ry * $cos_xang * $sin_ang); - // second Bezier control point - $qx2 = ($alpha * ((-$rx * $cos_xang * $sin_ang) - ($ry * $sin_xang * $cos_ang))); - $qy2 = ($alpha * ((-$rx * $sin_xang * $sin_ang) + ($ry * $cos_xang * $cos_ang))); - // draw arc - $this->_outCurve(($px1 + $qx1), ($this->h - ($py1 + $qy1)), ($px2 - $qx2), ($this->h - ($py2 - $qy2)), $px2, ($this->h - $py2)); - // move to next point - $px1 = $px2; - $py1 = $py2; - $qx1 = $qx2; - $qy1 = $qy2; - } - if ($pie) { - $this->_outLine($xc, $yc); - } - } - - /** - * Draws a circle. - * A circle is formed from n Bezier curves. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r Radius. - * @param float $angstr: Angle start of draw line. Default value: 0. - * @param float $angend: Angle finish of draw line. Default value: 360. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of circle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param integer $nc Number of curves used to draw a 90 degrees portion of circle. - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function Circle($x0, $y0, $r, $angstr=0, $angend=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { - $this->Ellipse($x0, $y0, $r, $r, 0, $angstr, $angend, $style, $line_style, $fill_color, $nc); - } - - /** - * Draws a polygonal line - * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of polygon. Array with keys among the following: - * <ul> - * <li>all: Line style of all lines. Array like for {@link SetLineStyle SetLineStyle}.</li> - * <li>0 to ($np - 1): Line style of each line. Array like for {@link SetLineStyle SetLineStyle}.</li> - * </ul> - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param boolean $closed if true the polygon is closes, otherwise will remain open - * @access public - * @since 4.8.003 (2009-09-15) - */ - public function PolyLine($p, $style='', $line_style=array(), $fill_color=array()) { - $this->Polygon($p, $style, $line_style, $fill_color, false); - } - - /** - * Draws a polygon. - * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of polygon. Array with keys among the following: - * <ul> - * <li>all: Line style of all lines. Array like for {@link SetLineStyle SetLineStyle}.</li> - * <li>0 to ($np - 1): Line style of each line. Array like for {@link SetLineStyle SetLineStyle}.</li> - * </ul> - * If a key is not present or is null, not draws the line. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @param boolean $closed if true the polygon is closes, otherwise will remain open - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function Polygon($p, $style='', $line_style=array(), $fill_color=array(), $closed=true) { - $nc = count($p); // number of coordinates - $np = $nc / 2; // number of points - if ($closed) { - // close polygon by adding the first 2 points at the end (one line) - for ($i = 0; $i < 4; ++$i) { - $p[$nc + $i] = $p[$i]; - } - // copy style for the last added line - if (isset($line_style[0])) { - $line_style[$np] = $line_style[0]; - } - $nc += 4; - } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ($op == 'f') { - $line_style = array(); - } - $draw = true; - if ($line_style) { - if (isset($line_style['all'])) { - $this->SetLineStyle($line_style['all']); - } else { - $draw = false; - if ($op == 'B') { - // draw fill - $op = 'f'; - $this->_outPoint($p[0], $p[1]); - for ($i = 2; $i < $nc; $i = $i + 2) { - $this->_outLine($p[$i], $p[$i + 1]); - } - $this->_out($op); - } - // draw outline - $this->_outPoint($p[0], $p[1]); - for ($i = 2; $i < $nc; $i = $i + 2) { - $line_num = ($i / 2) - 1; - if (isset($line_style[$line_num])) { - if ($line_style[$line_num] != 0) { - if (is_array($line_style[$line_num])) { - $this->_out('S'); - $this->SetLineStyle($line_style[$line_num]); - $this->_outPoint($p[$i - 2], $p[$i - 1]); - $this->_outLine($p[$i], $p[$i + 1]); - $this->_out('S'); - $this->_outPoint($p[$i], $p[$i + 1]); - } else { - $this->_outLine($p[$i], $p[$i + 1]); - } - } - } else { - $this->_outLine($p[$i], $p[$i + 1]); - } - } - $this->_out($op); - } - } - if ($draw) { - $this->_outPoint($p[0], $p[1]); - for ($i = 2; $i < $nc; $i = $i + 2) { - $this->_outLine($p[$i], $p[$i + 1]); - } - $this->_out($op); - } - } - - /** - * Draws a regular polygon. - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r: Radius of inscribed circle. - * @param integer $ns Number of sides. - * @param float $angle Angle oriented (anti-clockwise). Default value: 0. - * @param boolean $draw_circle Draw inscribed circle or not. Default value: false. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of polygon sides. Array with keys among the following: - * <ul> - * <li>all: Line style of all sides. Array like for {@link SetLineStyle SetLineStyle}.</li> - * <li>0 to ($ns - 1): Line style of each side. Array like for {@link SetLineStyle SetLineStyle}.</li> - * </ul> - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: - * <ul> - * <li>D or empty string: Draw (default).</li> - * <li>F: Fill.</li> - * <li>DF or FD: Draw and fill.</li> - * <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li> - * <li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li> - * </ul> - * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function RegularPolygon($x0, $y0, $r, $ns, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { - if (3 > $ns) { - $ns = 3; - } - if ($draw_circle) { - $this->Circle($x0, $y0, $r, 0, 360, $circle_style, $circle_outLine_style, $circle_fill_color); - } - $p = array(); - for ($i = 0; $i < $ns; ++$i) { - $a = $angle + ($i * 360 / $ns); - $a_rad = deg2rad((float) $a); - $p[] = $x0 + ($r * sin($a_rad)); - $p[] = $y0 + ($r * cos($a_rad)); - } - $this->Polygon($p, $style, $line_style, $fill_color); - } - - /** - * Draws a star polygon - * @param float $x0 Abscissa of center point. - * @param float $y0 Ordinate of center point. - * @param float $r Radius of inscribed circle. - * @param integer $nv Number of vertices. - * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon). - * @param float $angle: Angle oriented (anti-clockwise). Default value: 0. - * @param boolean $draw_circle: Draw inscribed circle or not. Default value is false. - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $line_style Line style of polygon sides. Array with keys among the following: - * <ul> - * <li>all: Line style of all sides. Array like for - * {@link SetLineStyle SetLineStyle}.</li> - * <li>0 to (n - 1): Line style of each side. Array like for {@link SetLineStyle SetLineStyle}.</li> - * </ul> - * If a key is not present or is null, not draws the side. Default value is default line style (empty array). - * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). - * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: - * <ul> - * <li>D or empty string: Draw (default).</li> - * <li>F: Fill.</li> - * <li>DF or FD: Draw and fill.</li> - * <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li> - * <li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li> - * </ul> - * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function StarPolygon($x0, $y0, $r, $nv, $ng, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { - if ($nv < 2) { - $nv = 2; - } - if ($draw_circle) { - $this->Circle($x0, $y0, $r, 0, 360, $circle_style, $circle_outLine_style, $circle_fill_color); - } - $p2 = array(); - $visited = array(); - for ($i = 0; $i < $nv; ++$i) { - $a = $angle + ($i * 360 / $nv); - $a_rad = deg2rad((float) $a); - $p2[] = $x0 + ($r * sin($a_rad)); - $p2[] = $y0 + ($r * cos($a_rad)); - $visited[] = false; - } - $p = array(); - $i = 0; - do { - $p[] = $p2[$i * 2]; - $p[] = $p2[($i * 2) + 1]; - $visited[$i] = true; - $i += $ng; - $i %= $nv; - } while (!$visited[$i]); - $this->Polygon($p, $style, $line_style, $fill_color); - } - - /** - * Draws a rounded rectangle. - * @param float $x Abscissa of upper-left corner. - * @param float $y Ordinate of upper-left corner. - * @param float $w Width. - * @param float $h Height. - * @param float $r the radius of the circle used to round off the corners of the rectangle. - * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top left, top right, bottom right and bottom left. Default value: all rounded corner ("1111"). - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @since 2.1.000 (2008-01-08) - */ - public function RoundedRect($x, $y, $w, $h, $r, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { - $this->RoundedRectXY($x, $y, $w, $h, $r, $r, $round_corner, $style, $border_style, $fill_color); - } - - /** - * Draws a rounded rectangle. - * @param float $x Abscissa of upper-left corner. - * @param float $y Ordinate of upper-left corner. - * @param float $w Width. - * @param float $h Height. - * @param float $rx the x-axis radius of the ellipse used to round off the corners of the rectangle. - * @param float $ry the y-axis radius of the ellipse used to round off the corners of the rectangle. - * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top left, top right, bottom right and bottom left. Default value: all rounded corner ("1111"). - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param array $border_style Border style of rectangle. Array like for {@link SetLineStyle SetLineStyle}. Default value: default line style (empty array). - * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K). Default value: default color (empty array). - * @access public - * @since 4.9.019 (2010-04-22) - */ - public function RoundedRectXY($x, $y, $w, $h, $rx, $ry, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { - if (($round_corner == '0000') OR (($rx == $ry) AND ($rx == 0))) { - // Not rounded - $this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color); - return; - } - // Rounded - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { - $this->SetFillColorArray($fill_color); - } - $op = $this->getPathPaintOperator($style); - if ($op == 'f') { - $border_style = array(); - } - if ($border_style) { - $this->SetLineStyle($border_style); - } - $MyArc = 4 / 3 * (sqrt(2) - 1); - $this->_outPoint($x + $rx, $y); - $xc = $x + $w - $rx; - $yc = $y + $ry; - $this->_outLine($xc, $y); - if ($round_corner[0]) { - $this->_outCurve($xc + ($rx * $MyArc), $yc - $ry, $xc + $rx, $yc - ($ry * $MyArc), $xc + $rx, $yc); - } else { - $this->_outLine($x + $w, $y); - } - $xc = $x + $w - $rx; - $yc = $y + $h - $ry; - $this->_outLine($x + $w, $yc); - if ($round_corner[1]) { - $this->_outCurve($xc + $rx, $yc + ($ry * $MyArc), $xc + ($rx * $MyArc), $yc + $ry, $xc, $yc + $ry); - } else { - $this->_outLine($x + $w, $y + $h); - } - $xc = $x + $rx; - $yc = $y + $h - $ry; - $this->_outLine($xc, $y + $h); - if ($round_corner[2]) { - $this->_outCurve($xc - ($rx * $MyArc), $yc + $ry, $xc - $rx, $yc + ($ry * $MyArc), $xc - $rx, $yc); - } else { - $this->_outLine($x, $y + $h); - } - $xc = $x + $rx; - $yc = $y + $ry; - $this->_outLine($x, $yc); - if ($round_corner[3]) { - $this->_outCurve($xc - $rx, $yc - ($ry * $MyArc), $xc - ($rx * $MyArc), $yc - $ry, $xc, $yc - $ry); - } else { - $this->_outLine($x, $y); - $this->_outLine($x + $rx, $y); - } - $this->_out($op); - } - - /** - * Draws a grahic arrow. - * @param float $x0 Abscissa of first point. - * @param float $y0 Ordinate of first point. - * @param float $x0 Abscissa of second point. - * @param float $y1 Ordinate of second point. - * @param int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) - * @param float $arm_size length of arrowhead arms - * @param int $arm_angle angle between an arm and the shaft - * @author Piotr Galecki, Nicola Asuni, Andy Meier - * @since 4.6.018 (2009-07-10) - */ - public function Arrow($x0, $y0, $x1, $y1, $head_style=0, $arm_size=5, $arm_angle=15) { - // getting arrow direction angle - // 0 deg angle is when both arms go along X axis. angle grows clockwise. - $dir_angle = atan2(($y0 - $y1), ($x0 - $x1)); - if ($dir_angle < 0) { - $dir_angle += (2 * M_PI); - } - $arm_angle = deg2rad($arm_angle); - $sx1 = $x1; - $sy1 = $y1; - if ($head_style > 0) { - // calculate the stopping point for the arrow shaft - $sx1 = $x1 + (($arm_size - $this->LineWidth) * cos($dir_angle)); - $sy1 = $y1 + (($arm_size - $this->LineWidth) * sin($dir_angle)); - } - // main arrow line / shaft - $this->Line($x0, $y0, $sx1, $sy1); - // left arrowhead arm tip - $x2L = $x1 + ($arm_size * cos($dir_angle + $arm_angle)); - $y2L = $y1 + ($arm_size * sin($dir_angle + $arm_angle)); - // right arrowhead arm tip - $x2R = $x1 + ($arm_size * cos($dir_angle - $arm_angle)); - $y2R = $y1 + ($arm_size * sin($dir_angle - $arm_angle)); - $mode = 'D'; - $style = array(); - switch ($head_style) { - case 0: { - // draw only arrowhead arms - $mode = 'D'; - $style = array(1, 1, 0); - break; - } - case 1: { - // draw closed arrowhead, but no fill - $mode = 'D'; - break; - } - case 2: { - // closed and filled arrowhead - $mode = 'DF'; - break; - } - case 3: { - // filled arrowhead - $mode = 'F'; - break; - } - } - $this->Polygon(array($x2L, $y2L, $x1, $y1, $x2R, $y2R), $mode, $style, array()); - } - - // END GRAPHIC FUNCTIONS SECTION ----------------------- - - // BIDIRECTIONAL TEXT SECTION -------------------------- - - /** - * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param string $str string to manipulate. - * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) - * @param bool $forcertl if true forces RTL text direction - * @return string - * @access protected - * @author Nicola Asuni - * @since 2.1.000 (2008-01-08) - */ - protected function utf8StrRev($str, $setbom=false, $forcertl=false) { - return $this->utf8StrArrRev($this->UTF8StringToArray($str), $str, $setbom, $forcertl); - } - - /** - * Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param array $arr array of unicode values. - * @param string $str string to manipulate (or empty value). - * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) - * @param bool $forcertl if true forces RTL text direction - * @return string - * @access protected - * @author Nicola Asuni - * @since 4.9.000 (2010-03-27) - */ - protected function utf8StrArrRev($arr, $str='', $setbom=false, $forcertl=false) { - return $this->arrUTF8ToUTF16BE($this->utf8Bidi($arr, $str, $forcertl), $setbom); - } - - /** - * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). - * @param array $ta array of characters composing the string. - * @param string $str string to process - * @param bool $forcertl if 'R' forces RTL, if 'L' forces LTR - * @return array of unicode chars - * @author Nicola Asuni - * @access protected - * @since 2.4.000 (2008-03-06) - */ - protected function utf8Bidi($ta, $str='', $forcertl=false) { - // paragraph embedding level - $pel = 0; - // max level - $maxlevel = 0; - if ($this->empty_string($str)) { - // create string from array - $str = $this->UTF8ArrSubString($ta); - } - // check if string contains arabic text - if (preg_match($this->unicode->uni_RE_PATTERN_ARABIC, $str)) { - $arabic = true; - } else { - $arabic = false; - } - // check if string contains RTL text - if (!($forcertl OR $arabic OR preg_match($this->unicode->uni_RE_PATTERN_RTL, $str))) { - return $ta; - } - - // get number of chars - $numchars = count($ta); - - if ($forcertl == 'R') { - $pel = 1; - } elseif ($forcertl == 'L') { - $pel = 0; - } else { - // P2. In each paragraph, find the first character of type L, AL, or R. - // P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero. - for ($i=0; $i < $numchars; ++$i) { - $type = $this->unicode->uni_type[$ta[$i]]; - if ($type == 'L') { - $pel = 0; - break; - } elseif (($type == 'AL') OR ($type == 'R')) { - $pel = 1; - break; - } - } - } - - // Current Embedding Level - $cel = $pel; - // directional override status - $dos = 'N'; - $remember = array(); - // start-of-level-run - $sor = $pel % 2 ? 'R' : 'L'; - $eor = $sor; - - // Array of characters data - $chardata = Array(); - - // X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral. Process each character iteratively, applying rules X2 through X9. Only embedding levels from 0 to 61 are valid in this phase. - // In the resolution of levels in rules I1 and I2, the maximum embedding level of 62 can be reached. - for ($i=0; $i < $numchars; ++$i) { - if ($ta[$i] == $this->unicode->uni_RLE) { - // X2. With each RLE, compute the least greater odd embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + ($cel % 2) + 1; - if ($next_level < 62) { - $remember[] = array('num' => $this->unicode->uni_RLE, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'N'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == $this->unicode->uni_LRE) { - // X3. With each LRE, compute the least greater even embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + 2 - ($cel % 2); - if ( $next_level < 62 ) { - $remember[] = array('num' => $this->unicode->uni_LRE, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'N'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == $this->unicode->uni_RLO) { - // X4. With each RLO, compute the least greater odd embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to right-to-left. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + ($cel % 2) + 1; - if ($next_level < 62) { - $remember[] = array('num' => $this->unicode->uni_RLO, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'R'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == $this->unicode->uni_LRO) { - // X5. With each LRO, compute the least greater even embedding level. - // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to left-to-right. - // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. - $next_level = $cel + 2 - ($cel % 2); - if ( $next_level < 62 ) { - $remember[] = array('num' => $this->unicode->uni_LRO, 'cel' => $cel, 'dos' => $dos); - $cel = $next_level; - $dos = 'L'; - $sor = $eor; - $eor = $cel % 2 ? 'R' : 'L'; - } - } elseif ($ta[$i] == $this->unicode->uni_PDF) { - // X7. With each PDF, determine the matching embedding or override code. If there was a valid matching code, restore (pop) the last remembered (pushed) embedding level and directional override. - if (count($remember)) { - $last = count($remember ) - 1; - if (($remember[$last]['num'] == $this->unicode->uni_RLE) OR - ($remember[$last]['num'] == $this->unicode->uni_LRE) OR - ($remember[$last]['num'] == $this->unicode->uni_RLO) OR - ($remember[$last]['num'] == $this->unicode->uni_LRO)) { - $match = array_pop($remember); - $cel = $match['cel']; - $dos = $match['dos']; - $sor = $eor; - $eor = ($cel > $match['cel'] ? $cel : $match['cel']) % 2 ? 'R' : 'L'; - } - } - } elseif (($ta[$i] != $this->unicode->uni_RLE) AND - ($ta[$i] != $this->unicode->uni_LRE) AND - ($ta[$i] != $this->unicode->uni_RLO) AND - ($ta[$i] != $this->unicode->uni_LRO) AND - ($ta[$i] != $this->unicode->uni_PDF)) { - // X6. For all types besides RLE, LRE, RLO, LRO, and PDF: - // a. Set the level of the current character to the current embedding level. - // b. Whenever the directional override status is not neutral, reset the current character type to the directional override status. - if ($dos != 'N') { - $chardir = $dos; - } else { - if (isset($this->unicode->uni_type[$ta[$i]])) { - $chardir = $this->unicode->uni_type[$ta[$i]]; - } else { - $chardir = 'L'; - } - } - // stores string characters and other information - $chardata[] = array('char' => $ta[$i], 'level' => $cel, 'type' => $chardir, 'sor' => $sor, 'eor' => $eor); - } - } // end for each char - - // X8. All explicit directional embeddings and overrides are completely terminated at the end of each paragraph. Paragraph separators are not included in the embedding. - // X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes. - // X10. The remaining rules are applied to each run of characters at the same level. For each run, determine the start-of-level-run (sor) and end-of-level-run (eor) type, either L or R. This depends on the higher of the two levels on either side of the boundary (at the start or end of the paragraph, the level of the 'other' run is the base embedding level). If the higher level is odd, the type is R; otherwise, it is L. - - // 3.3.3 Resolving Weak Types - // Weak types are now resolved one level run at a time. At level run boundaries where the type of the character on the other side of the boundary is required, the type assigned to sor or eor is used. - // Nonspacing marks are now resolved based on the previous characters. - $numchars = count($chardata); - - // W1. Examine each nonspacing mark (NSM) in the level run, and change the type of the NSM to the type of the previous character. If the NSM is at the start of the level run, it will get the type of sor. - $prevlevel = -1; // track level changes - $levcount = 0; // counts consecutive chars at the same level - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'NSM') { - if ($levcount) { - $chardata[$i]['type'] = $chardata[$i]['sor']; - } elseif ($i > 0) { - $chardata[$i]['type'] = $chardata[($i-1)]['type']; - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W2. Search backward from each instance of a European number until the first strong type (R, L, AL, or sor) is found. If an AL is found, change the type of the European number to Arabic number. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['char'] == 'EN') { - for ($j=$levcount; $j >= 0; $j--) { - if ($chardata[$j]['type'] == 'AL') { - $chardata[$i]['type'] = 'AN'; - } elseif (($chardata[$j]['type'] == 'L') OR ($chardata[$j]['type'] == 'R')) { - break; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W3. Change all ALs to R. - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'AL') { - $chardata[$i]['type'] = 'R'; - } - } - - // W4. A single European separator between two European numbers changes to a European number. A single common separator between two numbers of the same type changes to that type. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - if (($chardata[$i]['type'] == 'ES') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'AN') AND ($chardata[($i+1)]['type'] == 'AN')) { - $chardata[$i]['type'] = 'AN'; - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W5. A sequence of European terminators adjacent to European numbers changes to all European numbers. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['type'] == 'ET') { - if (($levcount > 0) AND ($chardata[($i-1)]['type'] == 'EN')) { - $chardata[$i]['type'] = 'EN'; - } else { - $j = $i+1; - while (($j < $numchars) AND ($chardata[$j]['level'] == $prevlevel)) { - if ($chardata[$j]['type'] == 'EN') { - $chardata[$i]['type'] = 'EN'; - break; - } elseif ($chardata[$j]['type'] != 'ET') { - break; - } - ++$j; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // W6. Otherwise, separators and terminators change to Other Neutral. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($chardata[$i]['type'] == 'ET') OR ($chardata[$i]['type'] == 'ES') OR ($chardata[$i]['type'] == 'CS')) { - $chardata[$i]['type'] = 'ON'; - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - //W7. Search backward from each instance of a European number until the first strong type (R, L, or sor) is found. If an L is found, then change the type of the European number to L. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['char'] == 'EN') { - for ($j=$levcount; $j >= 0; $j--) { - if ($chardata[$j]['type'] == 'L') { - $chardata[$i]['type'] = 'L'; - } elseif ($chardata[$j]['type'] == 'R') { - break; - } - } - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // N1. A sequence of neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. European and Arabic numbers act as if they were R in terms of their influence on neutrals. Start-of-level-run (sor) and end-of-level-run (eor) are used at level run boundaries. - $prevlevel = -1; - $levcount = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND - (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { - // first char - if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND - (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) { - //last char - if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) { - $chardata[$i]['type'] = 'L'; - } elseif (($chardata[$i]['type'] == 'N') AND - (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND - (($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) { - $chardata[$i]['type'] = 'R'; - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - } elseif ($chardata[$i]['type'] == 'N') { - // N2. Any remaining neutrals take the embedding direction - $chardata[$i]['type'] = $chardata[$i]['sor']; - } - if ($chardata[$i]['level'] != $prevlevel) { - $levcount = 0; - } else { - ++$levcount; - } - $prevlevel = $chardata[$i]['level']; - } - - // I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels. - // I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level. - for ($i=0; $i < $numchars; ++$i) { - $odd = $chardata[$i]['level'] % 2; - if ($odd) { - if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { - $chardata[$i]['level'] += 1; - } - } else { - if ($chardata[$i]['type'] == 'R') { - $chardata[$i]['level'] += 1; - } elseif (($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { - $chardata[$i]['level'] += 2; - } - } - $maxlevel = max($chardata[$i]['level'],$maxlevel); - } - - // L1. On each line, reset the embedding level of the following characters to the paragraph embedding level: - // 1. Segment separators, - // 2. Paragraph separators, - // 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and - // 4. Any sequence of white space characters at the end of the line. - for ($i=0; $i < $numchars; ++$i) { - if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) { - $chardata[$i]['level'] = $pel; - } elseif ($chardata[$i]['type'] == 'WS') { - $j = $i+1; - while ($j < $numchars) { - if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR - (($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) { - $chardata[$i]['level'] = $pel; - break; - } elseif ($chardata[$j]['type'] != 'WS') { - break; - } - ++$j; - } - } - } - - // Arabic Shaping - // Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run. - if ($arabic) { - $endedletter = array(1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688); - $alfletter = array(1570,1571,1573,1575); - $chardata2 = $chardata; - $laaletter = false; - $charAL = array(); - $x = 0; - for ($i=0; $i < $numchars; ++$i) { - if (($this->unicode->uni_type[$chardata[$i]['char']] == 'AL') OR ($chardata[$i]['char'] == 32) OR ($chardata[$i]['char'] == 8204)) { - $charAL[$x] = $chardata[$i]; - $charAL[$x]['i'] = $i; - $chardata[$i]['x'] = $x; - ++$x; - } - } - $numAL = $x; - for ($i=0; $i < $numchars; ++$i) { - $thischar = $chardata[$i]; - if ($i > 0) { - $prevchar = $chardata[($i-1)]; - } else { - $prevchar = false; - } - if (($i+1) < $numchars) { - $nextchar = $chardata[($i+1)]; - } else { - $nextchar = false; - } - if ($this->unicode->uni_type[$thischar['char']] == 'AL') { - $x = $thischar['x']; - if ($x > 0) { - $prevchar = $charAL[($x-1)]; - } else { - $prevchar = false; - } - if (($x+1) < $numAL) { - $nextchar = $charAL[($x+1)]; - } else { - $nextchar = false; - } - // if laa letter - if (($prevchar !== false) AND ($prevchar['char'] == 1604) AND (in_array($thischar['char'], $alfletter))) { - $arabicarr = $this->unicode->uni_laa_array; - $laaletter = true; - if ($x > 1) { - $prevchar = $charAL[($x-2)]; - } else { - $prevchar = false; - } - } else { - $arabicarr = $this->unicode->uni_arabicsubst; - $laaletter = false; - } - if (($prevchar !== false) AND ($nextchar !== false) AND - (($this->unicode->uni_type[$prevchar['char']] == 'AL') OR ($this->unicode->uni_type[$prevchar['char']] == 'NSM')) AND - (($this->unicode->uni_type[$nextchar['char']] == 'AL') OR ($this->unicode->uni_type[$nextchar['char']] == 'NSM')) AND - ($prevchar['type'] == $thischar['type']) AND - ($nextchar['type'] == $thischar['type']) AND - ($nextchar['char'] != 1567)) { - if (in_array($prevchar['char'], $endedletter)) { - if (isset($arabicarr[$thischar['char']][2])) { - // initial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; - } - } else { - if (isset($arabicarr[$thischar['char']][3])) { - // medial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][3]; - } - } - } elseif (($nextchar !== false) AND - (($this->unicode->uni_type[$nextchar['char']] == 'AL') OR ($this->unicode->uni_type[$nextchar['char']] == 'NSM')) AND - ($nextchar['type'] == $thischar['type']) AND - ($nextchar['char'] != 1567)) { - if (isset($arabicarr[$chardata[$i]['char']][2])) { - // initial - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; - } - } elseif ((($prevchar !== false) AND - (($this->unicode->uni_type[$prevchar['char']] == 'AL') OR ($this->unicode->uni_type[$prevchar['char']] == 'NSM')) AND - ($prevchar['type'] == $thischar['type'])) OR - (($nextchar !== false) AND ($nextchar['char'] == 1567))) { - // final - if (($i > 1) AND ($thischar['char'] == 1607) AND - ($chardata[$i-1]['char'] == 1604) AND - ($chardata[$i-2]['char'] == 1604)) { - //Allah Word - // mark characters to delete with false - $chardata2[$i-2]['char'] = false; - $chardata2[$i-1]['char'] = false; - $chardata2[$i]['char'] = 65010; - } else { - if (($prevchar !== false) AND in_array($prevchar['char'], $endedletter)) { - if (isset($arabicarr[$thischar['char']][0])) { - // isolated - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; - } - } else { - if (isset($arabicarr[$thischar['char']][1])) { - // final - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][1]; - } - } - } - } elseif (isset($arabicarr[$thischar['char']][0])) { - // isolated - $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; - } - // if laa letter - if ($laaletter) { - // mark characters to delete with false - $chardata2[($charAL[($x-1)]['i'])]['char'] = false; - } - } // end if AL (Arabic Letter) - } // end for each char - /* - * Combining characters that can occur with Arabic Shadda (0651 HEX, 1617 DEC) are replaced. - * Putting the combining mark and shadda in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. - */ - $cw = &$this->CurrentFont['cw']; - for ($i = 0; $i < ($numchars-1); ++$i) { - if (($chardata2[$i]['char'] == 1617) AND (isset($this->unicode->uni_diacritics[($chardata2[$i+1]['char'])]))) { - // check if the subtitution font is defined on current font - if (isset($cw[($this->unicode->uni_diacritics[($chardata2[$i+1]['char'])])])) { - $chardata2[$i]['char'] = false; - $chardata2[$i+1]['char'] = $this->unicode->uni_diacritics[($chardata2[$i+1]['char'])]; - } - } - } - // remove marked characters - foreach ($chardata2 as $key => $value) { - if ($value['char'] === false) { - unset($chardata2[$key]); - } - } - $chardata = array_values($chardata2); - $numchars = count($chardata); - unset($chardata2); - unset($arabicarr); - unset($laaletter); - unset($charAL); - } - - // L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher. - for ($j=$maxlevel; $j > 0; $j--) { - $ordarray = Array(); - $revarr = Array(); - $onlevel = false; - for ($i=0; $i < $numchars; ++$i) { - if ($chardata[$i]['level'] >= $j) { - $onlevel = true; - if (isset($this->unicode->uni_mirror[$chardata[$i]['char']])) { - // L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true. - $chardata[$i]['char'] = $this->unicode->uni_mirror[$chardata[$i]['char']]; - } - $revarr[] = $chardata[$i]; - } else { - if ($onlevel) { - $revarr = array_reverse($revarr); - $ordarray = array_merge($ordarray, $revarr); - $revarr = Array(); - $onlevel = false; - } - $ordarray[] = $chardata[$i]; - } - } - if ($onlevel) { - $revarr = array_reverse($revarr); - $ordarray = array_merge($ordarray, $revarr); - } - $chardata = $ordarray; - } - - $ordarray = array(); - for ($i=0; $i < $numchars; ++$i) { - $ordarray[] = $chardata[$i]['char']; - // store char values for subsetting - $this->CurrentFont['subsetchars'][$chardata[$i]['char']] = true; - } - // update font subsetchars - $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); - return $ordarray; - } - - // END OF BIDIRECTIONAL TEXT SECTION ------------------- - - /** - * Adds a bookmark. - * @param string $txt bookmark description. - * @param int $level bookmark level (minimum value is 0). - * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). - * @param int $page target page number (leave empty for current page). - * @access public - * @author Olivier Plathey, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - public function Bookmark($txt, $level=0, $y=-1, $page='') { - if ($level < 0) { - $level = 0; - } - if (isset($this->outlines[0])) { - $lastoutline = end($this->outlines); - $maxlevel = $lastoutline['l'] + 1; - } else { - $maxlevel = 0; - } - if ($level > $maxlevel) { - $level = $maxlevel; - } - if ($y == -1) { - $y = $this->GetY(); - } - if (empty($page)) { - $page = $this->PageNo(); - if (empty($page)) { - return; - } - } - $this->outlines[] = array('t' => $txt, 'l' => $level, 'y' => $y, 'p' => $page); - } - - /** - * Create a bookmark PDF string. - * @access protected - * @author Olivier Plathey, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - protected function _putbookmarks() { - $nb = count($this->outlines); - if ($nb == 0) { - return; - } - // get sorting columns - $outline_p = array(); - $outline_y = array(); - foreach ($this->outlines as $key => $row) { - $outline_p[$key] = $row['p']; - $outline_k[$key] = $key; - } - // sort outlines by page and original position - array_multisort($outline_p, SORT_NUMERIC, SORT_ASC, $outline_k, SORT_NUMERIC, SORT_ASC, $this->outlines); - $lru = array(); - $level = 0; - foreach ($this->outlines as $i => $o) { - if ($o['l'] > 0) { - $parent = $lru[($o['l'] - 1)]; - //Set parent and last pointers - $this->outlines[$i]['parent'] = $parent; - $this->outlines[$parent]['last'] = $i; - if ($o['l'] > $level) { - //Level increasing: set first pointer - $this->outlines[$parent]['first'] = $i; - } - } else { - $this->outlines[$i]['parent'] = $nb; - } - if (($o['l'] <= $level) AND ($i > 0)) { - //Set prev and next pointers - $prev = $lru[$o['l']]; - $this->outlines[$prev]['next'] = $i; - $this->outlines[$i]['prev'] = $prev; - } - $lru[$o['l']] = $i; - $level = $o['l']; - } - //Outline items - $n = $this->n + 1; - $nltags = '/<br[\s]?\/>|<\/(blockquote|dd|dl|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|p|pre|ul|tcpdf|table|tr|td)>/si'; - foreach ($this->outlines as $i => $o) { - if (isset($this->page_obj_id[($o['p'])])) { - $oid = $this->_newobj(); - // covert HTML title to string - $title = preg_replace($nltags, "\n", $o['t']); - $title = preg_replace("/[\r]+/si", '', $title); - $title = preg_replace("/[\n]+/si", "\n", $title); - $title = strip_tags($title); - $title = $this->stringTrim($title); - $out = '<</Title '.$this->_textstring($title, $oid); - $out .= ' /Parent '.($n + $o['parent']).' 0 R'; - if (isset($o['prev'])) { - $out .= ' /Prev '.($n + $o['prev']).' 0 R'; - } - if (isset($o['next'])) { - $out .= ' /Next '.($n + $o['next']).' 0 R'; - } - if (isset($o['first'])) { - $out .= ' /First '.($n + $o['first']).' 0 R'; - } - if (isset($o['last'])) { - $out .= ' /Last '.($n + $o['last']).' 0 R'; - } - $out .= ' '.sprintf('/Dest [%u 0 R /XYZ 0 %.2F null]', $this->page_obj_id[($o['p'])], ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); - $out .= ' /Count 0 >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - //Outline root - $this->OutlineRoot = $this->_newobj(); - $this->_out('<< /Type /Outlines /First '.$n.' 0 R /Last '.($n + $lru[0]).' 0 R >>'."\n".'endobj'); - } - - // --- JAVASCRIPT ------------------------------------------------------ - - /** - * Adds a javascript - * @param string $script Javascript code - * @access public - * @author Johannes Güntert, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - public function IncludeJS($script) { - $this->javascript .= $script; - } - - /** - * Adds a javascript object and return object ID - * @param string $script Javascript code - * @param boolean $onload if true executes this object when opening the document - * @return int internal object ID - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function addJavascriptObject($script, $onload=false) { - ++$this->n; - $this->js_objects[$this->n] = array('n' => $this->n, 'js' => $script, 'onload' => $onload); - return $this->n; - } - - /** - * Create a javascript PDF string. - * @access protected - * @author Johannes Güntert, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - protected function _putjavascript() { - if (empty($this->javascript) AND empty($this->js_objects)) { - return; - } - if (strpos($this->javascript, 'this.addField') > 0) { - if (!$this->ur['enabled']) { - //$this->setUserRights(); - } - // the following two lines are used to avoid form fields duplication after saving - // The addField method only works when releasing user rights (UR3) - $jsa = sprintf("ftcpdfdocsaved=this.addField('%s','%s',%d,[%.2F,%.2F,%.2F,%.2F]);", 'tcpdfdocsaved', 'text', 0, 0, 1, 0, 1); - $jsb = "getField('tcpdfdocsaved').value='saved';"; - $this->javascript = $jsa."\n".$this->javascript."\n".$jsb; - } - $this->n_js = $this->_newobj(); - $out = ' << /Names ['; - if (!empty($this->javascript)) { - $out .= ' (EmbeddedJS) '.($this->n + 1).' 0 R'; - } - if (!empty($this->js_objects)) { - foreach ($this->js_objects as $key => $val) { - if ($val['onload']) { - $out .= ' (JS'.$key.') '.$key.' 0 R'; - } - } - } - $out .= ' ] >>'; - $out .= "\n".'endobj'; - $this->_out($out); - // default Javascript object - if (!empty($this->javascript)) { - $obj_id = $this->_newobj(); - $out = '<< /S /JavaScript'; - $out .= ' /JS '.$this->_textstring($this->javascript, $obj_id); - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - // additional Javascript objects - if (!empty($this->js_objects)) { - foreach ($this->js_objects as $key => $val) { - $out = $this->_getobj($key)."\n".' << /S /JavaScript /JS '.$this->_textstring($val['js'], $key).' >>'."\n".'endobj'; - $this->_out($out); - } - } - } - - /** - * Convert color to javascript color. - * @param string $color color name or #RRGGBB - * @access protected - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - protected function _JScolor($color) { - static $aColors = array('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray'); - if (substr($color,0,1) == '#') { - return sprintf("['RGB',%.3F,%.3F,%.3F]", hexdec(substr($color,1,2))/255, hexdec(substr($color,3,2))/255, hexdec(substr($color,5,2))/255); - } - if (!in_array($color,$aColors)) { - $this->Error('Invalid color: '.$color); - } - return 'color.'.$color; - } - - /** - * Adds a javascript form field. - * @param string $type field type - * @param string $name field name - * @param int $x horizontal position - * @param int $y vertical position - * @param int $w width - * @param int $h height - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access protected - * @author Denis Van Nuffelen, Nicola Asuni - * @since 2.1.002 (2008-02-12) - */ - protected function _addfield($type, $name, $x, $y, $w, $h, $prop) { - if ($this->rtl) { - $x = $x - $w; - } - // the followind avoid fields duplication after saving the document - $this->javascript .= "if(getField('tcpdfdocsaved').value != 'saved') {"; - $k = $this->k; - $this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%.2F,%.2F,%.2F,%.2F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n"; - $this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n"; - while (list($key, $val) = each($prop)) { - if (strcmp(substr($key, -5), 'Color') == 0) { - $val = $this->_JScolor($val); - } else { - $val = "'".$val."'"; - } - $this->javascript .= 'f'.$name.'.'.$key.'='.$val.";\n"; - } - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - $this->javascript .= '}'; - } - - // --- FORM FIELDS ----------------------------------------------------- - - /** - * Convert JavaScript form fields properties array to Annotation Properties array. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @return array of annotation properties - * @access protected - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ - protected function getAnnotOptFromJSProp($prop) { - if (isset($prop['aopt']) AND is_array($prop['aopt'])) { - // the annotation options area lready defined - return $prop['aopt']; - } - $opt = array(); // value to be returned - // alignment: Controls how the text is laid out within the text field. - if (isset($prop['alignment'])) { - switch ($prop['alignment']) { - case 'left': { - $opt['q'] = 0; - break; - } - case 'center': { - $opt['q'] = 1; - break; - } - case 'right': { - $opt['q'] = 2; - break; - } - default: { - $opt['q'] = ($this->rtl)?2:0; - break; - } - } - } - // lineWidth: Specifies the thickness of the border when stroking the perimeter of a field's rectangle. - if (isset($prop['lineWidth'])) { - $linewidth = intval($prop['lineWidth']); - } else { - $linewidth = 1; - } - // borderStyle: The border style for a field. - if (isset($prop['borderStyle'])) { - switch ($prop['borderStyle']) { - case 'border.d': - case 'dashed': { - $opt['border'] = array(0, 0, $linewidth, array(3, 2)); - $opt['bs'] = array('w'=>$linewidth, 's'=>'D', 'd'=>array(3, 2)); - break; - } - case 'border.b': - case 'beveled': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'B'); - break; - } - case 'border.i': - case 'inset': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'I'); - break; - } - case 'border.u': - case 'underline': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'U'); - break; - } - default: - case 'border.s': - case 'solid': { - $opt['border'] = array(0, 0, $linewidth); - $opt['bs'] = array('w'=>$linewidth, 's'=>'S'); - break; - } - } - } - if (isset($prop['border']) AND is_array($prop['border'])) { - $opt['border'] = $prop['border']; - } - if (!isset($opt['mk'])) { - $opt['mk'] = array(); - } - if (!isset($opt['mk']['if'])) { - $opt['mk']['if'] = array(); - } - $opt['mk']['if']['a'] = array(0.5, 0.5); - // buttonAlignX: Controls how space is distributed from the left of the button face with respect to the icon. - if (isset($prop['buttonAlignX'])) { - $opt['mk']['if']['a'][0] = $prop['buttonAlignX']; - } - // buttonAlignY: Controls how unused space is distributed from the bottom of the button face with respect to the icon. - if (isset($prop['buttonAlignY'])) { - $opt['mk']['if']['a'][1] = $prop['buttonAlignY']; - } - // buttonFitBounds: If true, the extent to which the icon may be scaled is set to the bounds of the button field. - if (isset($prop['buttonFitBounds']) AND ($prop['buttonFitBounds'] == 'true')) { - $opt['mk']['if']['fb'] = true; - } - // buttonScaleHow: Controls how the icon is scaled (if necessary) to fit inside the button face. - if (isset($prop['buttonScaleHow'])) { - switch ($prop['buttonScaleHow']) { - case 'scaleHow.proportional': { - $opt['mk']['if']['s'] = 'P'; - break; - } - case 'scaleHow.anamorphic': { - $opt['mk']['if']['s'] = 'A'; - break; - } - } - } - // buttonScaleWhen: Controls when an icon is scaled to fit inside the button face. - if (isset($prop['buttonScaleWhen'])) { - switch ($prop['buttonScaleWhen']) { - case 'scaleWhen.always': { - $opt['mk']['if']['sw'] = 'A'; - break; - } - case 'scaleWhen.never': { - $opt['mk']['if']['sw'] = 'N'; - break; - } - case 'scaleWhen.tooBig': { - $opt['mk']['if']['sw'] = 'B'; - break; - } - case 'scaleWhen.tooSmall': { - $opt['mk']['if']['sw'] = 'S'; - break; - } - } - } - // buttonPosition: Controls how the text and the icon of the button are positioned with respect to each other within the button face. - if (isset($prop['buttonPosition'])) { - switch ($prop['buttonPosition']) { - case 0: - case 'position.textOnly': { - $opt['mk']['tp'] = 0; - break; - } - case 1: - case 'position.iconOnly': { - $opt['mk']['tp'] = 1; - break; - } - case 2: - case 'position.iconTextV': { - $opt['mk']['tp'] = 2; - break; - } - case 3: - case 'position.textIconV': { - $opt['mk']['tp'] = 3; - break; - } - case 4: - case 'position.iconTextH': { - $opt['mk']['tp'] = 4; - break; - } - case 5: - case 'position.textIconH': { - $opt['mk']['tp'] = 5; - break; - } - case 6: - case 'position.overlay': { - $opt['mk']['tp'] = 6; - break; - } - } - } - // fillColor: Specifies the background color for a field. - if (isset($prop['fillColor'])) { - if (is_array($prop['fillColor'])) { - $opt['mk']['bg'] = $prop['fillColor']; - } else { - $opt['mk']['bg'] = $this->convertHTMLColorToDec($prop['fillColor']); - } - } - // strokeColor: Specifies the stroke color for a field that is used to stroke the rectangle of the field with a line as large as the line width. - if (isset($prop['strokeColor'])) { - if (is_array($prop['strokeColor'])) { - $opt['mk']['bc'] = $prop['strokeColor']; - } else { - $opt['mk']['bc'] = $this->convertHTMLColorToDec($prop['strokeColor']); - } - } - // rotation: The rotation of a widget in counterclockwise increments. - if (isset($prop['rotation'])) { - $opt['mk']['r'] = $prop['rotation']; - } - // charLimit: Limits the number of characters that a user can type into a text field. - if (isset($prop['charLimit'])) { - $opt['maxlen'] = intval($prop['charLimit']); - } - if (!isset($ff)) { - $ff = 0; - } - // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. - if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { - $ff += 1 << 0; - } - // required: Specifies whether a field requires a value. - if (isset($prop['required']) AND ($prop['required'] == 'true')) { - $ff += 1 << 1; - } - // multiline: Controls how text is wrapped within the field. - if (isset($prop['multiline']) AND ($prop['multiline'] == 'true')) { - $ff += 1 << 12; - } - // password: Specifies whether the field should display asterisks when data is entered in the field. - if (isset($prop['password']) AND ($prop['password'] == 'true')) { - $ff += 1 << 13; - } - // NoToggleToOff: If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. - if (isset($prop['NoToggleToOff']) AND ($prop['NoToggleToOff'] == 'true')) { - $ff += 1 << 14; - } - // Radio: If set, the field is a set of radio buttons. - if (isset($prop['Radio']) AND ($prop['Radio'] == 'true')) { - $ff += 1 << 15; - } - // Pushbutton: If set, the field is a pushbutton that does not retain a permanent value. - if (isset($prop['Pushbutton']) AND ($prop['Pushbutton'] == 'true')) { - $ff += 1 << 16; - } - // Combo: If set, the field is a combo box; if clear, the field is a list box. - if (isset($prop['Combo']) AND ($prop['Combo'] == 'true')) { - $ff += 1 << 17; - } - // editable: Controls whether a combo box is editable. - if (isset($prop['editable']) AND ($prop['editable'] == 'true')) { - $ff += 1 << 18; - } - // Sort: If set, the field's option items shall be sorted alphabetically. - if (isset($prop['Sort']) AND ($prop['Sort'] == 'true')) { - $ff += 1 << 19; - } - // fileSelect: If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection). - if (isset($prop['fileSelect']) AND ($prop['fileSelect'] == 'true')) { - $ff += 1 << 20; - } - // multipleSelection: If true, indicates that a list box allows a multiple selection of items. - if (isset($prop['multipleSelection']) AND ($prop['multipleSelection'] == 'true')) { - $ff += 1 << 21; - } - // doNotSpellCheck: If true, spell checking is not performed on this editable text field. - if (isset($prop['doNotSpellCheck']) AND ($prop['doNotSpellCheck'] == 'true')) { - $ff += 1 << 22; - } - // doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. - if (isset($prop['doNotScroll']) AND ($prop['doNotScroll'] == 'true')) { - $ff += 1 << 23; - } - // comb: If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set. - if (isset($prop['comb']) AND ($prop['comb'] == 'true')) { - $ff += 1 << 24; - } - // radiosInUnison: If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons. - if (isset($prop['radiosInUnison']) AND ($prop['radiosInUnison'] == 'true')) { - $ff += 1 << 25; - } - // richText: If true, the field allows rich text formatting. - if (isset($prop['richText']) AND ($prop['richText'] == 'true')) { - $ff += 1 << 25; - } - // commitOnSelChange: Controls whether a field value is committed after a selection change. - if (isset($prop['commitOnSelChange']) AND ($prop['commitOnSelChange'] == 'true')) { - $ff += 1 << 26; - } - $opt['ff'] = $ff; - // defaultValue: The default value of a field - that is, the value that the field is set to when the form is reset. - if (isset($prop['defaultValue'])) { - $opt['dv'] = $prop['defaultValue']; - } - $f = 4; // default value for annotation flags - // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. - if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { - $f += 1 << 6; - } - // display: Controls whether the field is hidden or visible on screen and in print. - if (isset($prop['display'])) { - if ($prop['display'] == 'display.visible') { - // - } elseif ($prop['display'] == 'display.hidden') { - $f += 1 << 1; - } elseif ($prop['display'] == 'display.noPrint') { - $f -= 1 << 2; - } elseif ($prop['display'] == 'display.noView') { - $f += 1 << 5; - } - } - $opt['f'] = $f; - // currentValueIndices: Reads and writes single or multiple values of a list box or combo box. - if (isset($prop['currentValueIndices']) AND is_array($prop['currentValueIndices'])) { - $opt['i'] = $prop['currentValueIndices']; - } - // value: The value of the field data that the user has entered. - if (isset($prop['value'])) { - if (is_array($prop['value'])) { - $opt['opt'] = array(); - foreach ($prop['value'] AS $key => $optval) { - // exportValues: An array of strings representing the export values for the field. - if (isset($prop['exportValues'][$key])) { - $opt['opt'][$key] = array($prop['exportValues'][$key], $prop['value'][$key]); - } else { - $opt['opt'][$key] = $prop['value'][$key]; - } - } - } else { - $opt['v'] = $prop['value']; - } - } - // richValue: This property specifies the text contents and formatting of a rich text field. - if (isset($prop['richValue'])) { - $opt['rv'] = $prop['richValue']; - } - // submitName: If nonempty, used during form submission instead of name. Only applicable if submitting in HTML format (that is, URL-encoded). - if (isset($prop['submitName'])) { - $opt['tm'] = $prop['submitName']; - } - // name: Fully qualified field name. - if (isset($prop['name'])) { - $opt['t'] = $prop['name']; - } - // userName: The user name (short description string) of the field. - if (isset($prop['userName'])) { - $opt['tu'] = $prop['userName']; - } - // highlight: Defines how a button reacts when a user clicks it. - if (isset($prop['highlight'])) { - switch ($prop['highlight']) { - case 'none': - case 'highlight.n': { - $opt['h'] = 'N'; - break; - } - case 'invert': - case 'highlight.i': { - $opt['h'] = 'i'; - break; - } - case 'push': - case 'highlight.p': { - $opt['h'] = 'P'; - break; - } - case 'outline': - case 'highlight.o': { - $opt['h'] = 'O'; - break; - } - } - } - // Unsupported options: - // - calcOrderIndex: Changes the calculation order of fields in the document. - // - delay: Delays the redrawing of a field's appearance. - // - defaultStyle: This property defines the default style attributes for the form field. - // - style: Allows the user to set the glyph style of a check box or radio button. - // - textColor, textFont, textSize - return $opt; - } - - /** - * Set default properties for form fields. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ - public function setFormDefaultProp($prop=array()) { - $this->default_form_prop = $prop; - } - - /** - * Return the default properties for form fields. - * @return array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-06) - */ - public function getFormDefaultProp() { - return $this->default_form_prop; - } - - /** - * Creates a text field - * @param string $name field name - * @param float $w Width of the rectangle - * @param float $h Height of the rectangle - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - if ($js) { - $this->_addfield('text', $name, $x, $y, $w, $h, $prop); - return; - } - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - // set default appearance stream - $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = 'q BT '.$fontstyle.' ET Q'; - // merge options - $opt = array_merge($popt, $opt); - // remove some conflicting options - unset($opt['bs']); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Tx'; - $opt['t'] = $name; - /* - Additional annotation's parameters (check _putannotsobj() method): - //$opt['f'] - //$opt['ap'] - //$opt['as'] - //$opt['bs'] - //$opt['be'] - //$opt['c'] - //$opt['border'] - //$opt['h'] - //$opt['mk'] - //$opt['mk']['r'] - //$opt['mk']['bc'] - //$opt['mk']['bg'] - //$opt['mk']['ca'] - //$opt['mk']['rc'] - //$opt['mk']['ac'] - //$opt['mk']['i'] - //$opt['mk']['ri'] - //$opt['mk']['ix'] - //$opt['mk']['if'] - //$opt['mk']['if']['sw'] - //$opt['mk']['if']['s'] - //$opt['mk']['if']['a'] - //$opt['mk']['if']['fb'] - //$opt['mk']['tp'] - //$opt['tu'] - //$opt['tm'] - //$opt['ff'] - //$opt['v'] - //$opt['dv'] - //$opt['a'] - //$opt['aa'] - //$opt['q'] - */ - $this->Annotation($x, $y, $w, $h, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - /** - * Creates a RadioButton field - * @param string $name field name - * @param int $w width - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param string $onvalue value to be returned if selected. - * @param boolean $checked define the initial state. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($w, $x, $y); - if ($js) { - $this->_addfield('radiobutton', $name, $x, $y, $w, $w, $prop); - return; - } - if ($this->empty_string($onvalue)) { - $onvalue = 'On'; - } - if ($checked) { - $defval = $onvalue; - } else { - $defval = 'Off'; - } - // set data for parent group - if (!isset($this->radiobutton_groups[$this->page])) { - $this->radiobutton_groups[$this->page] = array(); - } - if (!isset($this->radiobutton_groups[$this->page][$name])) { - $this->radiobutton_groups[$this->page][$name] = array(); - ++$this->n; - $this->radiobutton_groups[$this->page][$name]['n'] = $this->n; - $this->radio_groups[] = $this->n; - $kid = ($this->n + 2); - } else { - $kid = ($this->n + 1); - } - // save object ID to be added on Kids entry on parent object - $this->radiobutton_groups[$this->page][$name][] = array('kid' => $kid, 'def' => $defval); - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - $prop['NoToggleToOff'] = 'true'; - $prop['Radio'] = 'true'; - $prop['borderStyle'] = 'inset'; - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - // set additional default values - $font = 'zapfdingbats'; - $this->AddFont($font); - $tmpfont = $this->getFontBuffer($font); - $this->annotation_fonts[$tmpfont['fontkey']] = $tmpfont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $tmpfont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = array(); - $popt['ap']['n'][$onvalue] = 'q BT '.$fontstyle.' 0 0 Td (8) Tj ET Q'; - $popt['ap']['n']['Off'] = 'q BT '.$fontstyle.' 0 0 Td (8) Tj ET Q'; - if (!isset($popt['mk'])) { - $popt['mk'] = array(); - } - $popt['mk']['ca'] = '(l)'; - // merge options - $opt = array_merge($popt, $opt); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Btn'; - if ($checked) { - $opt['v'] = array('/'.$onvalue); - $opt['as'] = $onvalue; - } else { - $opt['as'] = 'Off'; - } - $this->Annotation($x, $y, $w, $w, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - /** - * Creates a List-box field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param array $values array containing the list of values. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - if ($js) { - $this->_addfield('listbox', $name, $x, $y, $w, $h, $prop); - $s = ''; - foreach ($values as $value) { - $s .= "'".addslashes($value)."',"; - } - $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; - return; - } - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - // set additional default values - $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = 'q BT '.$fontstyle.' ET Q'; - // merge options - $opt = array_merge($popt, $opt); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Ch'; - $opt['t'] = $name; - $opt['opt'] = $values; - $this->Annotation($x, $y, $w, $h, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - /** - * Creates a Combo-box field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param array $values array containing the list of values. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - if ($js) { - $this->_addfield('combobox', $name, $x, $y, $w, $h, $prop); - $s = ''; - foreach ($values as $value) { - $s .= "'".addslashes($value)."',"; - } - $this->javascript .= 'f'.$name.'.setItems(['.substr($s, 0, -1)."]);\n"; - return; - } - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - $prop['Combo'] = true; - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - // set additional default options - $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = 'q BT '.$fontstyle.' ET Q'; - // merge options - $opt = array_merge($popt, $opt); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Ch'; - $opt['t'] = $name; - $opt['opt'] = $values; - $this->Annotation($x, $y, $w, $h, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - /** - * Creates a CheckBox field - * @param string $name field name - * @param int $w width - * @param boolean $checked define the initial state. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param string $onvalue value to be returned if selected. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($w, $x, $y); - if ($js) { - $this->_addfield('checkbox', $name, $x, $y, $w, $w, $prop); - return; - } - if (!isset($prop['value'])) { - $prop['value'] = array('Yes'); - } - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - $prop['borderStyle'] = 'inset'; - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - // set additional default options - $font = 'zapfdingbats'; - $this->AddFont($font); - $tmpfont = $this->getFontBuffer($font); - $this->annotation_fonts[$tmpfont['fontkey']] = $tmpfont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $tmpfont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = array(); - $popt['ap']['n']['Yes'] = 'q BT '.$fontstyle.' 0 0 Td (8) Tj ET Q'; - $popt['ap']['n']['Off'] = 'q BT '.$fontstyle.' 0 0 Td (8) Tj ET Q'; - // merge options - $opt = array_merge($popt, $opt); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Btn'; - $opt['t'] = $name; - $opt['opt'] = array($onvalue); - if ($checked) { - $opt['v'] = array('/0'); - $opt['as'] = 'Yes'; - } else { - $opt['v'] = array('/Off'); - $opt['as'] = 'Off'; - } - $this->Annotation($x, $y, $w, $w, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - /** - * Creates a button field - * @param string $name field name - * @param int $w width - * @param int $h height - * @param string $caption caption. - * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. - * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. - * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. - * @param float $x Abscissa of the upper-left corner of the rectangle - * @param float $y Ordinate of the upper-left corner of the rectangle - * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). - * @access public - * @author Nicola Asuni - * @since 4.8.000 (2009-09-07) - */ - public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x='', $y='', $js=false) { - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - if ($js) { - $this->_addfield('button', $name, $this->x, $this->y, $w, $h, $prop); - $this->javascript .= 'f'.$name.".buttonSetCaption('".addslashes($caption)."');\n"; - $this->javascript .= 'f'.$name.".setAction('MouseUp','".addslashes($action)."');\n"; - $this->javascript .= 'f'.$name.".highlight='push';\n"; - $this->javascript .= 'f'.$name.".print=false;\n"; - return; - } - // get default style - $prop = array_merge($this->getFormDefaultProp(), $prop); - $prop['Pushbutton'] = 'true'; - $prop['highlight'] = 'push'; - $prop['display'] = 'display.noPrint'; - // get annotation data - $popt = $this->getAnnotOptFromJSProp($prop); - $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; - $fontstyle = sprintf('/F%d %.2F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); - $popt['da'] = $fontstyle; - $popt['ap'] = array(); - $popt['ap']['n'] = 'q BT '.$fontstyle.' ET Q'; - // set additional default options - if (!isset($popt['mk'])) { - $popt['mk'] = array(); - } - $ann_obj_id = ($this->n + 1); - if (!empty($action) AND !is_array($action)) { - $ann_obj_id = ($this->n + 2); - } - $popt['mk']['ca'] = $this->_textstring($caption, $ann_obj_id); - $popt['mk']['rc'] = $this->_textstring($caption, $ann_obj_id); - $popt['mk']['ac'] = $this->_textstring($caption, $ann_obj_id); - // merge options - $opt = array_merge($popt, $opt); - // set remaining annotation data - $opt['Subtype'] = 'Widget'; - $opt['ft'] = 'Btn'; - $opt['t'] = $caption; - $opt['v'] = $name; - if (!empty($action)) { - if (is_array($action)) { - // form action options as on section 12.7.5 of PDF32000_2008. - $opt['aa'] = '/D <<'; - $bmode = array('SubmitForm', 'ResetForm', 'ImportData'); - foreach ($action AS $key => $val) { - if (($key == 'S') AND in_array($val, $bmode)) { - $opt['aa'] .= ' /S /'.$val; - } elseif (($key == 'F') AND (!empty($val))) { - $opt['aa'] .= ' /F '.$this->_datastring($val, $ann_obj_id); - } elseif (($key == 'Fields') AND is_array($val) AND !empty($val)) { - $opt['aa'] .= ' /Fields ['; - foreach ($val AS $field) { - $opt['aa'] .= ' '.$this->_textstring($field, $ann_obj_id); - } - $opt['aa'] .= ']'; - } elseif (($key == 'Flags')) { - $ff = 0; - if (is_array($val)) { - foreach ($val AS $flag) { - switch ($flag) { - case 'Include/Exclude': { - $ff += 1 << 0; - break; - } - case 'IncludeNoValueFields': { - $ff += 1 << 1; - break; - } - case 'ExportFormat': { - $ff += 1 << 2; - break; - } - case 'GetMethod': { - $ff += 1 << 3; - break; - } - case 'SubmitCoordinates': { - $ff += 1 << 4; - break; - } - case 'XFDF': { - $ff += 1 << 5; - break; - } - case 'IncludeAppendSaves': { - $ff += 1 << 6; - break; - } - case 'IncludeAnnotations': { - $ff += 1 << 7; - break; - } - case 'SubmitPDF': { - $ff += 1 << 8; - break; - } - case 'CanonicalFormat': { - $ff += 1 << 9; - break; - } - case 'ExclNonUserAnnots': { - $ff += 1 << 10; - break; - } - case 'ExclFKey': { - $ff += 1 << 11; - break; - } - case 'EmbedForm': { - $ff += 1 << 13; - break; - } - } - } - } else { - $ff = intval($val); - } - $opt['aa'] .= ' /Flags '.$ff; - } - } - $opt['aa'] .= ' >>'; - } else { - // Javascript action or raw action command - $js_obj_id = $this->addJavascriptObject($action); - $opt['aa'] = '/D '.$js_obj_id.' 0 R'; - } - } - $this->Annotation($x, $y, $w, $h, $name, $opt, 0); - if ($this->rtl) { - $this->x -= $w; - } else { - $this->x += $w; - } - } - - // --- END FORMS FIELDS ------------------------------------------------ - - /** - * Add certification signature (DocMDP or UR3) - * You can set only one signature type - * @access protected - * @author Nicola Asuni - * @since 4.6.008 (2009-05-07) - */ - protected function _putsignature() { - if ((!$this->sign) OR (!isset($this->signature_data['cert_type']))) { - return; - } - $out = $this->_getobj($this->sig_obj_id + 1)."\n"; - $out .= '<< /Type /Sig'; - $out .= ' /Filter /Adobe.PPKLite'; - $out .= ' /SubFilter /adbe.pkcs7.detached'; - $out .= ' '.$this->byterange_string; - $out .= ' /Contents<'.str_repeat('0', $this->signature_max_length).'>'; - $out .= ' /Reference ['; // array of signature reference dictionaries - $out .= ' << /Type /SigRef'; - if ($this->signature_data['cert_type'] > 0) { - $out .= ' /TransformMethod /DocMDP'; - $out .= ' /TransformParams <<'; - $out .= ' /Type /TransformParams'; - $out .= ' /V /1.2'; - $out .= ' /P '.$this->signature_data['cert_type']; - } else { - $out .= ' /TransformMethod /UR3'; - $out .= ' /TransformParams <<'; - $out .= ' /Type /TransformParams'; - $out .= ' /V /2.2'; - if (!$this->empty_string($this->ur['document'])) { - $out .= ' /Document['.$this->ur['document'].']'; - } - if (!$this->empty_string($this->ur['form'])) { - $out .= ' /Form['.$this->ur['form'].']'; - } - if (!$this->empty_string($this->ur['signature'])) { - $out .= ' /Signature['.$this->ur['signature'].']'; - } - if (!$this->empty_string($this->ur['annots'])) { - $out .= ' /Annots['.$this->ur['annots'].']'; - } - if (!$this->empty_string($this->ur['ef'])) { - $out .= ' /EF['.$this->ur['ef'].']'; - } - if (!$this->empty_string($this->ur['formex'])) { - $out .= ' /FormEX['.$this->ur['formex'].']'; - } - } - $out .= ' >>'; // close TransformParams - // optional digest data (values must be calculated and replaced later) - //$out .= ' /Data ********** 0 R'; - //$out .= ' /DigestMethod/MD5'; - //$out .= ' /DigestLocation[********** 34]'; - //$out .= ' /DigestValue<********************************>'; - $out .= ' >>'; - $out .= ' ]'; // end of reference - if (isset($this->signature_data['info']['Name']) AND !$this->empty_string($this->signature_data['info']['Name'])) { - $out .= ' /Name '.$this->_textstring($this->signature_data['info']['Name']); - } - if (isset($this->signature_data['info']['Location']) AND !$this->empty_string($this->signature_data['info']['Location'])) { - $out .= ' /Location '.$this->_textstring($this->signature_data['info']['Location']); - } - if (isset($this->signature_data['info']['Reason']) AND !$this->empty_string($this->signature_data['info']['Reason'])) { - $out .= ' /Reason '.$this->_textstring($this->signature_data['info']['Reason']); - } - if (isset($this->signature_data['info']['ContactInfo']) AND !$this->empty_string($this->signature_data['info']['ContactInfo'])) { - $out .= ' /ContactInfo '.$this->_textstring($this->signature_data['info']['ContactInfo']); - } - $out .= ' /M '.$this->_datestring(); - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - - /** - * Set User's Rights for PDF Reader - * WARNING: This is experimental and currently do not work. - * Check the PDF Reference 8.7.1 Transform Methods, - * Table 8.105 Entries in the UR transform parameters dictionary - * @param boolean $enable if true enable user's rights on PDF reader - * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. - * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. - * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate - * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. - * @param string $ef Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files - Names specifying additional embedded-files-related usage rights for the document. - * @param string $formex Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode. - * @access public - * @author Nicola Asuni - * @since 2.9.000 (2008-03-26) - */ - public function setUserRights( - $enable=true, - $document='/FullSave', - $annots='/Create/Delete/Modify/Copy/Import/Export', - $form='/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', - $signature='/Modify', - $ef='/Create/Delete/Modify/Import', - $formex='') { - $this->ur['enabled'] = $enable; - $this->ur['document'] = $document; - $this->ur['annots'] = $annots; - $this->ur['form'] = $form; - $this->ur['signature'] = $signature; - $this->ur['ef'] = $ef; - $this->ur['formex'] = $formex; - if (!$this->sign) { - $this->setSignature('', '', '', '', 0, array()); - } - } - - /** - * Enable document signature (requires the OpenSSL Library). - * The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. - * To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt - * To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 - * To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes - * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://') - * @param mixed $private_key private key (string or filename prefixed with 'file://') - * @param string $private_key_password password - * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. - * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. - * @param array $info array of option information: Name, Location, Reason, ContactInfo. - * @access public - * @author Nicola Asuni - * @since 4.6.005 (2009-04-24) - */ - public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array()) { - // to create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt - // to export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 - // to convert pfx certificate to pem: openssl - // OpenSSL> pkcs12 -in <cert.pfx> -out <cert.crt> -nodes - $this->sign = true; - ++$this->n; - $this->sig_obj_id = $this->n; // signature widget - ++$this->n; // signature object ($this->sig_obj_id + 1) - $this->signature_data = array(); - if (strlen($signing_cert) == 0) { - $signing_cert = 'file://'.dirname(__FILE__).'/tcpdf.crt'; - $private_key_password = 'tcpdfdemo'; - } - if (strlen($private_key) == 0) { - $private_key = $signing_cert; - } - $this->signature_data['signcert'] = $signing_cert; - $this->signature_data['privkey'] = $private_key; - $this->signature_data['password'] = $private_key_password; - $this->signature_data['extracerts'] = $extracerts; - $this->signature_data['cert_type'] = $cert_type; - $this->signature_data['info'] = $info; - } - - /** - * Set the digital signature appearance (a cliccable rectangle area to get signature properties) - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the signature area. - * @param float $h Height of the signature area. - * @param int $page option page number (if < 0 the current page is used). - * @access public - * @author Nicola Asuni - * @since 5.3.011 (2010-06-17) - */ - public function setSignatureAppearance($x=0, $y=0, $w=0, $h=0, $page=-1) { - if (($page < 1) OR ($page > $this->numpages)) { - $this->signature_appearance['page'] = $this->page; - } else { - $this->signature_appearance['page'] = intval($page); - } - $a = $x * $this->k; - $b = $this->pagedim[($this->signature_appearance['page'])]['h'] - (($y + $h) * $this->k); - $c = $w * $this->k; - $d = $h * $this->k; - $this->signature_appearance['rect'] = sprintf('%.2F %.2F %.2F %.2F', $a, $b, $a+$c, $b+$d); - } - - /** - * Create a new page group. - * NOTE: call this function before calling AddPage() - * @param int $page starting group page (leave empty for next page). - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function startPageGroup($page='') { - if (empty($page)) { - $page = $this->page + 1; - } - $this->newpagegroup[$page] = true; - } - - /** - * Defines an alias for the total number of pages. - * It will be substituted as the document is closed. - * @param string $alias The alias. - * @access public - * @since 1.4 - * @see getAliasNbPages(), PageNo(), Footer() - */ - public function AliasNbPages($alias='{nb}') { - $this->AliasNbPages = $alias; - } - - /** - * Returns the string alias used for the total number of pages. - * If the current font is unicode type, the returned string is surrounded by additional curly braces. - * @return string - * @access public - * @since 4.0.018 (2008-08-08) - * @see AliasNbPages(), PageNo(), Footer() - */ - public function getAliasNbPages() { - if ($this->isUnicodeFont()) { - return '{'.$this->AliasNbPages.'}'; - } - return $this->AliasNbPages; - } - - /** - * Defines an alias for the page number. - * It will be substituted as the document is closed. - * @param string $alias The alias. - * @access public - * @since 4.5.000 (2009-01-02) - * @see getAliasNbPages(), PageNo(), Footer() - */ - public function AliasNumPage($alias='{pnb}') { - //Define an alias for total number of pages - $this->AliasNumPage = $alias; - } - - /** - * Returns the string alias used for the page number. - * If the current font is unicode type, the returned string is surrounded by additional curly braces. - * @return string - * @access public - * @since 4.5.000 (2009-01-02) - * @see AliasNbPages(), PageNo(), Footer() - */ - public function getAliasNumPage() { - if ($this->isUnicodeFont()) { - return '{'.$this->AliasNumPage.'}'; - } - return $this->AliasNumPage; - } - - /** - * Return the current page in the group. - * @return current page in the group - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function getGroupPageNo() { - return $this->pagegroups[$this->currpagegroup]; - } - - /** - * Returns the current group page number formatted as a string. - * @access public - * @since 4.3.003 (2008-11-18) - * @see PaneNo(), formatPageNumber() - */ - public function getGroupPageNoFormatted() { - return $this->formatPageNumber($this->getGroupPageNo()); - } - - /** - * Return the alias of the current page group - * If the current font is unicode type, the returned string is surrounded by additional curly braces. - * (will be replaced by the total number of pages in this group). - * @return alias of the current page group - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function getPageGroupAlias() { - if ($this->isUnicodeFont()) { - return '{'.$this->currpagegroup.'}'; - } - return $this->currpagegroup; - } - - /** - * Return the alias for the page number on the current page group - * If the current font is unicode type, the returned string is surrounded by additional curly braces. - * (will be replaced by the total number of pages in this group). - * @return alias of the current page group - * @access public - * @since 4.5.000 (2009-01-02) - */ - public function getPageNumGroupAlias() { - if ($this->isUnicodeFont()) { - return '{'.str_replace('{nb', '{pnb', $this->currpagegroup).'}'; - } - return str_replace('{nb', '{pnb', $this->currpagegroup); - } - - /** - * Format the page numbers. - * This method can be overriden for custom formats. - * @param int $num page number - * @access protected - * @since 4.2.005 (2008-11-06) - */ - protected function formatPageNumber($num) { - return number_format((float)$num, 0, '', '.'); - } - - /** - * Format the page numbers on the Table Of Content. - * This method can be overriden for custom formats. - * @param int $num page number - * @access protected - * @since 4.5.001 (2009-01-04) - * @see addTOC(), addHTMLTOC() - */ - protected function formatTOCPageNumber($num) { - return number_format((float)$num, 0, '', '.'); - } - - /** - * Returns the current page number formatted as a string. - * @access public - * @since 4.2.005 (2008-11-06) - * @see PaneNo(), formatPageNumber() - */ - public function PageNoFormatted() { - return $this->formatPageNumber($this->PageNo()); - } - - /** - * Put visibility settings. - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected function _putocg() { - $this->n_ocg_print = $this->_newobj(); - $this->_out('<< /Type /OCG /Name '.$this->_textstring('print', $this->n_ocg_print).' /Usage << /Print <</PrintState /ON>> /View <</ViewState /OFF>> >> >>'."\n".'endobj'); - $this->n_ocg_view = $this->_newobj(); - $this->_out('<< /Type /OCG /Name '.$this->_textstring('view', $this->n_ocg_view).' /Usage << /Print <</PrintState /OFF>> /View <</ViewState /ON>> >> >>'."\n".'endobj'); - } - - /** - * Set the visibility of the successive elements. - * This can be useful, for instance, to put a background - * image or color that will show on screen but won't print. - * @param string $v visibility mode. Legal values are: all, print, screen. - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function setVisibility($v) { - if ($this->openMarkedContent) { - // close existing open marked-content - $this->_out('EMC'); - $this->openMarkedContent = false; - } - switch($v) { - case 'print': { - $this->_out('/OC /OC1 BDC'); - $this->openMarkedContent = true; - break; - } - case 'screen': { - $this->_out('/OC /OC2 BDC'); - $this->openMarkedContent = true; - break; - } - case 'all': { - $this->_out(''); - break; - } - default: { - $this->Error('Incorrect visibility: '.$v); - break; - } - } - $this->visibility = $v; - } - - /** - * Add transparency parameters to the current extgstate - * @param array $params parameters - * @return the number of extgstates - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected function addExtGState($parms) { - $n = count($this->extgstates) + 1; - // check if this ExtGState already exist - for ($i = 1; $i < $n; ++$i) { - if ($this->extgstates[$i]['parms'] == $parms) { - // return reference to existing ExtGState - return $i; - } - } - $this->extgstates[$n]['parms'] = $parms; - return $n; - } - - /** - * Add an extgstate - * @param array $gs extgstate - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected function setExtGState($gs) { - $this->_out(sprintf('/GS%d gs', $gs)); - } - - /** - * Put extgstates for object transparency - * @param array $gs extgstate - * @access protected - * @since 3.0.000 (2008-03-27) - */ - protected function _putextgstates() { - $ne = count($this->extgstates); - for ($i = 1; $i <= $ne; ++$i) { - $this->extgstates[$i]['n'] = $this->_newobj(); - $out = '<< /Type /ExtGState'; - foreach ($this->extgstates[$i]['parms'] as $k => $v) { - if (is_float($v)) { - $v = sprintf('%.2F', $v); - } - $out .= ' /'.$k.' '.$v; - } - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - - /** - * Set alpha for stroking (CA) and non-stroking (ca) operations. - * @param float $alpha real value from 0 (transparent) to 1 (opaque) - * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function setAlpha($alpha, $bm='Normal') { - $gs = $this->addExtGState(array('ca' => $alpha, 'CA' => $alpha, 'BM' => '/'.$bm, 'AIS' => 'false')); - $this->setExtGState($gs); - } - - /** - * Set the default JPEG compression quality (1-100) - * @param int $quality JPEG quality, integer between 1 and 100 - * @access public - * @since 3.0.000 (2008-03-27) - */ - public function setJPEGQuality($quality) { - if (($quality < 1) OR ($quality > 100)) { - $quality = 75; - } - $this->jpeg_quality = intval($quality); - } - - /** - * Set the default number of columns in a row for HTML tables. - * @param int $cols number of columns - * @access public - * @since 3.0.014 (2008-06-04) - */ - public function setDefaultTableColumns($cols=4) { - $this->default_table_columns = intval($cols); - } - - /** - * Set the height of the cell (line height) respect the font height. - * @param int $h cell proportion respect font height (typical value = 1.25). - * @access public - * @since 3.0.014 (2008-06-04) - */ - public function setCellHeightRatio($h) { - $this->cell_height_ratio = $h; - } - - /** - * return the height of cell repect font height. - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getCellHeightRatio() { - return $this->cell_height_ratio; - } - - /** - * Set the PDF version (check PDF reference for valid values). - * Default value is 1.t - * @access public - * @since 3.1.000 (2008-06-09) - */ - public function setPDFVersion($version='1.7') { - $this->PDFVersion = $version; - } - - /** - * Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print. - * (see Section 8.1 of PDF reference, "Viewer Preferences"). - * <ul><li>HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.</li><li>HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.</li><li>HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.</li><li>FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.</li><li>CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.</li><li>DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.</li><li>NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:<ul><li>UseNone Neither document outline nor thumbnail images visible</li><li>UseOutlines Document outline visible</li><li>UseThumbs Thumbnail images visible</li><li>UseOC Optional content group panel visible</li></ul>This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.</li><li>ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:<ul><li>MediaBox</li><li>CropBox (default)</li><li>BleedBox</li><li>TrimBox</li><li>ArtBox</li></ul></li><li>ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:<ul><li>MediaBox</li><li>CropBox (default)</li><li>BleedBox</li><li>TrimBox</li><li>ArtBox</li></ul></li><li>PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:<ul><li>MediaBox</li><li>CropBox (default)</li><li>BleedBox</li><li>TrimBox</li><li>ArtBox</li></ul></li><li>PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:<ul><li>MediaBox</li><li>CropBox (default)</li><li>BleedBox</li><li>TrimBox</li><li>ArtBox</li></ul></li><li>PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are: <ul><li>None, which indicates that the print dialog should reflect no page scaling</li><li>AppDefault (default), which indicates that applications should use the current print scaling</li></ul></li><li>Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:<ul><li>Simplex - Print single-sided</li><li>DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet</li><li>DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet</li></ul>Default value: none</li><li>PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.</li><li>PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application</li><li>NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1</li></ul> - * @param array $preferences array of options. - * @author Nicola Asuni - * @access public - * @since 3.1.000 (2008-06-09) - */ - public function setViewerPreferences($preferences) { - $this->viewer_preferences = $preferences; - } - - /** - * Paints color transition registration bars - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param boolean $transition if true prints tcolor transitions to white. - * @param boolean $vertical if true prints bar vertically. - * @param string $colors colors to print, one letter per color separated by comma (for example 'A,W,R,G,B,C,M,Y,K'): A=black, W=white, R=red, G=green, B=blue, C=cyan, M=magenta, Y=yellow, K=black. - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ - public function colorRegistrationBar($x, $y, $w, $h, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K') { - $bars = explode(',', $colors); - $numbars = count($bars); // number of bars to print - // set bar measures - if ($vertical) { - $coords = array(0, 0, 0, 1); - $wb = $w / $numbars; // bar width - $hb = $h; // bar height - $xd = $wb; // delta x - $yd = 0; // delta y - } else { - $coords = array(1, 0, 0, 0); - $wb = $w; // bar width - $hb = $h / $numbars; // bar height - $xd = 0; // delta x - $yd = $hb; // delta y - } - $xb = $x; - $yb = $y; - foreach ($bars as $col) { - switch ($col) { - // set transition colors - case 'A': { // BLACK - $col_a = array(255); - $col_b = array(0); - break; - } - case 'W': { // WHITE - $col_a = array(0); - $col_b = array(255); - break; - } - case 'R': { // R - $col_a = array(255,255,255); - $col_b = array(255,0,0); - break; - } - case 'G': { // G - $col_a = array(255,255,255); - $col_b = array(0,255,0); - break; - } - case 'B': { // B - $col_a = array(255,255,255); - $col_b = array(0,0,255); - break; - } - case 'C': { // C - $col_a = array(0,0,0,0); - $col_b = array(100,0,0,0); - break; - } - case 'M': { // M - $col_a = array(0,0,0,0); - $col_b = array(0,100,0,0); - break; - } - case 'Y': { // Y - $col_a = array(0,0,0,0); - $col_b = array(0,0,100,0); - break; - } - case 'K': { // K - $col_a = array(0,0,0,0); - $col_b = array(0,0,0,100); - break; - } - default: { // GRAY - $col_a = array(255); - $col_b = array(0); - break; - } - } - if ($transition) { - // color gradient - $this->LinearGradient($xb, $yb, $wb, $hb, $col_a, $col_b, $coords); - } else { - // color rectangle - $this->SetFillColorArray($col_b); - $this->Rect($xb, $yb, $wb, $hb, 'F', array()); - } - $xb += $xd; - $yb += $yd; - } - } - - /** - * Paints crop mark - * @param float $x abscissa of the crop mark center. - * @param float $y ordinate of the crop mark center. - * @param float $w width of the crop mark. - * @param float $h height of the crop mark. - * @param string $type type of crop mark, one sybol per type separated by comma: A = top left, B = top right, C = bottom left, D = bottom right. - * @param array $color crop mark color (default black). - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ - public function cropMark($x, $y, $w, $h, $type='A,B,C,D', $color=array(0,0,0)) { - $this->SetLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color)); - $crops = explode(',', $type); - $numcrops = count($crops); // number of crop marks to print - $dw = $w / 4; // horizontal space to leave before the intersection point - $dh = $h / 4; // vertical space to leave before the intersection point - foreach ($crops as $crop) { - switch ($crop) { - case 'A': { - $x1 = $x; - $y1 = $y - $h; - $x2 = $x; - $y2 = $y - $dh; - $x3 = $x - $w; - $y3 = $y; - $x4 = $x - $dw; - $y4 = $y; - break; - } - case 'B': { - $x1 = $x; - $y1 = $y - $h; - $x2 = $x; - $y2 = $y - $dh; - $x3 = $x + $dw; - $y3 = $y; - $x4 = $x + $w; - $y4 = $y; - break; - } - case 'C': { - $x1 = $x - $w; - $y1 = $y; - $x2 = $x - $dw; - $y2 = $y; - $x3 = $x; - $y3 = $y + $dh; - $x4 = $x; - $y4 = $y + $h; - break; - } - case 'D': { - $x1 = $x + $dw; - $y1 = $y; - $x2 = $x + $w; - $y2 = $y; - $x3 = $x; - $y3 = $y + $dh; - $x4 = $x; - $y4 = $y + $h; - break; - } - } - $this->Line($x1, $y1, $x2, $y2); - $this->Line($x3, $y3, $x4, $y4); - } - } - - /** - * Paints a registration mark - * @param float $x abscissa of the registration mark center. - * @param float $y ordinate of the registration mark center. - * @param float $r radius of the crop mark. - * @param boolean $double if true print two concentric crop marks. - * @param array $cola crop mark color (default black). - * @param array $colb second crop mark color. - * @author Nicola Asuni - * @since 4.9.000 (2010-03-26) - * @access public - */ - public function registrationMark($x, $y, $r, $double=false, $cola=array(0,0,0), $colb=array(255,255,255)) { - $line_style = array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola); - $this->SetFillColorArray($cola); - $this->PieSector($x, $y, $r, 90, 180, 'F'); - $this->PieSector($x, $y, $r, 270, 360, 'F'); - $this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8); - if ($double) { - $r2 = $r * 0.5; - $this->SetFillColorArray($colb); - $this->PieSector($x, $y, $r2, 90, 180, 'F'); - $this->PieSector($x, $y, $r2, 270, 360, 'F'); - $this->SetFillColorArray($cola); - $this->PieSector($x, $y, $r2, 0, 90, 'F'); - $this->PieSector($x, $y, $r2, 180, 270, 'F'); - $this->Circle($x, $y, $r2, 0, 360, 'C', $line_style, array(), 8); - } - } - - /** - * Paints a linear colour gradient. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (Grayscale, RGB or CMYK components). - * @param array $col2 second color (Grayscale, RGB or CMYK components). - * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function LinearGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0,0,1,0)) { - $this->Clip($x, $y, $w, $h); - $this->Gradient(2, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); - } - - /** - * Paints a radial colour gradient. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (Grayscale, RGB or CMYK components). - * @param array $col2 second color (Grayscale, RGB or CMYK components). - * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function RadialGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0.5,0.5,0.5,0.5,1)) { - $this->Clip($x, $y, $w, $h); - $this->Gradient(3, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); - } - - /** - * Paints a coons patch mesh. - * @param float $x abscissa of the top left corner of the rectangle. - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @param array $col1 first color (lower left corner) (RGB components). - * @param array $col2 second color (lower right corner) (RGB components). - * @param array $col3 third color (upper right corner) (RGB components). - * @param array $col4 fourth color (upper left corner) (RGB components). - * @param array $coords <ul><li>for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).</li><li>for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches</li></ul> - * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 - * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 - * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $col3=array(), $col4=array(), $coords=array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min=0, $coords_max=1, $antialias=false) { - $this->Clip($x, $y, $w, $h); - $n = count($this->gradients) + 1; - $this->gradients[$n] = array(); - $this->gradients[$n]['type'] = 6; //coons patch mesh - $this->gradients[$n]['coords'] = array(); - $this->gradients[$n]['antialias'] = $antialias; - $this->gradients[$n]['colors'] = array(); - $this->gradients[$n]['transparency'] = false; - //check the coords array if it is the simple array or the multi patch array - if (!isset($coords[0]['f'])) { - //simple array -> convert to multi patch array - if (!isset($col1[1])) { - $col1[1] = $col1[2] = $col1[0]; - } - if (!isset($col2[1])) { - $col2[1] = $col2[2] = $col2[0]; - } - if (!isset($col3[1])) { - $col3[1] = $col3[2] = $col3[0]; - } - if (!isset($col4[1])) { - $col4[1] = $col4[2] = $col4[0]; - } - $patch_array[0]['f'] = 0; - $patch_array[0]['points'] = $coords; - $patch_array[0]['colors'][0]['r'] = $col1[0]; - $patch_array[0]['colors'][0]['g'] = $col1[1]; - $patch_array[0]['colors'][0]['b'] = $col1[2]; - $patch_array[0]['colors'][1]['r'] = $col2[0]; - $patch_array[0]['colors'][1]['g'] = $col2[1]; - $patch_array[0]['colors'][1]['b'] = $col2[2]; - $patch_array[0]['colors'][2]['r'] = $col3[0]; - $patch_array[0]['colors'][2]['g'] = $col3[1]; - $patch_array[0]['colors'][2]['b'] = $col3[2]; - $patch_array[0]['colors'][3]['r'] = $col4[0]; - $patch_array[0]['colors'][3]['g'] = $col4[1]; - $patch_array[0]['colors'][3]['b'] = $col4[2]; - } else { - //multi patch array - $patch_array = $coords; - } - $bpcd = 65535; //16 bits per coordinate - //build the data stream - $this->gradients[$n]['stream'] = ''; - $count_patch = count($patch_array); - for ($i=0; $i < $count_patch; ++$i) { - $this->gradients[$n]['stream'] .= chr($patch_array[$i]['f']); //start with the edge flag as 8 bit - $count_points = count($patch_array[$i]['points']); - for ($j=0; $j < $count_points; ++$j) { - //each point as 16 bit - $patch_array[$i]['points'][$j] = (($patch_array[$i]['points'][$j] - $coords_min) / ($coords_max - $coords_min)) * $bpcd; - if ($patch_array[$i]['points'][$j] < 0) { - $patch_array[$i]['points'][$j] = 0; - } - if ($patch_array[$i]['points'][$j] > $bpcd) { - $patch_array[$i]['points'][$j] = $bpcd; - } - $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] / 256)); - $this->gradients[$n]['stream'] .= chr(floor($patch_array[$i]['points'][$j] % 256)); - } - $count_cols = count($patch_array[$i]['colors']); - for ($j=0; $j < $count_cols; ++$j) { - //each color component as 8 bit - $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['r']); - $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['g']); - $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['b']); - } - } - //paint the gradient - $this->_out('/Sh'.$n.' sh'); - //restore previous Graphic State - $this->_out('Q'); - } - - /** - * Set a rectangular clipping area. - * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode). - * @param float $y ordinate of the top left corner of the rectangle. - * @param float $w width of the rectangle. - * @param float $h height of the rectangle. - * @author Andreas Würmser, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ - protected function Clip($x, $y, $w, $h) { - if ($this->rtl) { - $x = $this->w - $x - $w; - } - //save current Graphic State - $s = 'q'; - //set clipping area - $s .= sprintf(' %.2F %.2F %.2F %.2F re W n', $x*$this->k, ($this->h-$y)*$this->k, $w*$this->k, -$h*$this->k); - //set up transformation matrix for gradient - $s .= sprintf(' %.3F 0 0 %.3F %.3F %.3F cm', $w*$this->k, $h*$this->k, $x*$this->k, ($this->h-($y+$h))*$this->k); - $this->_out($s); - } - - /** - * Output gradient. - * @param int $type type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported) - * @param array $coords array of coordinates. - * @param array $stops array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1). - * @param array $background An array of colour components appropriate to the colour space, specifying a single background colour value. - * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. - * @author Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function Gradient($type, $coords, $stops, $background=array(), $antialias=false) { - $n = count($this->gradients) + 1; - $this->gradients[$n] = array(); - $this->gradients[$n]['type'] = $type; - $this->gradients[$n]['coords'] = $coords; - $this->gradients[$n]['antialias'] = $antialias; - $this->gradients[$n]['colors'] = array(); - $this->gradients[$n]['transparency'] = false; - // color space - $numcolspace = count($stops[0]['color']); - $bcolor = array_values($background); - switch($numcolspace) { - case 4: { // CMYK - $this->gradients[$n]['colspace'] = 'DeviceCMYK'; - if (!empty($background)) { - $this->gradients[$n]['background'] = sprintf('%.3F %.3F %.3F %.3F', $bcolor[0]/100, $bcolor[1]/100, $bcolor[2]/100, $bcolor[3]/100); - } - break; - } - case 3: { // RGB - $this->gradients[$n]['colspace'] = 'DeviceRGB'; - if (!empty($background)) { - $this->gradients[$n]['background'] = sprintf('%.3F %.3F %.3F', $bcolor[0]/255, $bcolor[1]/255, $bcolor[2]/255); - } - break; - } - case 1: { // Gray scale - $this->gradients[$n]['colspace'] = 'DeviceGray'; - if (!empty($background)) { - $this->gradients[$n]['background'] = sprintf('%.3F', $bcolor[0]/255); - } - break; - } - } - $num_stops = count($stops); - $last_stop_id = $num_stops - 1; - foreach ($stops as $key => $stop) { - $this->gradients[$n]['colors'][$key] = array(); - // offset represents a location along the gradient vector - if (isset($stop['offset'])) { - $this->gradients[$n]['colors'][$key]['offset'] = $stop['offset']; - } else { - if ($key == 0) { - $this->gradients[$n]['colors'][$key]['offset'] = 0; - } elseif ($key == $last_stop_id) { - $this->gradients[$n]['colors'][$key]['offset'] = 1; - } else { - $offsetstep = (1 - $this->gradients[$n]['colors'][($key - 1)]['offset']) / ($num_stops - $key); - $this->gradients[$n]['colors'][$key]['offset'] = $this->gradients[$n]['colors'][($key - 1)]['offset'] + $offsetstep; - } - } - if (isset($stop['opacity'])) { - $this->gradients[$n]['colors'][$key]['opacity'] = $stop['opacity']; - if ($stop['opacity'] < 1) { - $this->gradients[$n]['transparency'] = true; - } - } else { - $this->gradients[$n]['colors'][$key]['opacity'] = 1; - } - // exponent for the exponential interpolation function - if (isset($stop['exponent'])) { - $this->gradients[$n]['colors'][$key]['exponent'] = $stop['exponent']; - } else { - $this->gradients[$n]['colors'][$key]['exponent'] = 1; - } - // set colors - $color = array_values($stop['color']); - switch($numcolspace) { - case 4: { // CMYK - $this->gradients[$n]['colors'][$key]['color'] = sprintf('%.3F %.3F %.3F %.3F', $color[0]/100, $color[1]/100, $color[2]/100, $color[3]/100); - break; - } - case 3: { // RGB - $this->gradients[$n]['colors'][$key]['color'] = sprintf('%.3F %.3F %.3F', $color[0]/255, $color[1]/255, $color[2]/255); - break; - } - case 1: { // Gray scale - $this->gradients[$n]['colors'][$key]['color'] = sprintf('%.3F', $color[0]/255); - break; - } - } - } - if ($this->gradients[$n]['transparency']) { - // paint luminosity gradient - $this->_out('/TGS'.$n.' gs'); - } - //paint the gradient - $this->_out('/Sh'.$n.' sh'); - //restore previous Graphic State - $this->_out('Q'); - } - - /** - * Output gradient shaders. - * @author Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access protected - */ - function _putshaders() { - $idt = count($this->gradients); //index for transparency gradients - foreach ($this->gradients as $id => $grad) { - if (($grad['type'] == 2) OR ($grad['type'] == 3)) { - $fc = $this->_newobj(); - $out = '<<'; - $out .= ' /FunctionType 3'; - $out .= ' /Domain [0 1]'; - $functions = ''; - $bounds = ''; - $encode = ''; - $i = 1; - $num_cols = count($grad['colors']); - $lastcols = $num_cols - 1; - for ($i = 1; $i < $num_cols; ++$i) { - $functions .= ($fc + $i).' 0 R '; - if ($i < $lastcols) { - $bounds .= sprintf('%.3F ', $grad['colors'][$i]['offset']); - } - $encode .= '0 1 '; - } - $out .= ' /Functions ['.trim($functions).']'; - $out .= ' /Bounds ['.trim($bounds).']'; - $out .= ' /Encode ['.trim($encode).']'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - for ($i = 1; $i < $num_cols; ++$i) { - $this->_newobj(); - $out = '<<'; - $out .= ' /FunctionType 2'; - $out .= ' /Domain [0 1]'; - $out .= ' /C0 ['.$grad['colors'][($i - 1)]['color'].']'; - $out .= ' /C1 ['.$grad['colors'][$i]['color'].']'; - $out .= ' /N '.$grad['colors'][$i]['exponent']; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - // set transparency fuctions - if ($grad['transparency']) { - $ft = $this->_newobj(); - $out = '<<'; - $out .= ' /FunctionType 3'; - $out .= ' /Domain [0 1]'; - $functions = ''; - $i = 1; - $num_cols = count($grad['colors']); - for ($i = 1; $i < $num_cols; ++$i) { - $functions .= ($ft + $i).' 0 R '; - } - $out .= ' /Functions ['.trim($functions).']'; - $out .= ' /Bounds ['.trim($bounds).']'; - $out .= ' /Encode ['.trim($encode).']'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - for ($i = 1; $i < $num_cols; ++$i) { - $this->_newobj(); - $out = '<<'; - $out .= ' /FunctionType 2'; - $out .= ' /Domain [0 1]'; - $out .= ' /C0 ['.$grad['colors'][($i - 1)]['opacity'].']'; - $out .= ' /C1 ['.$grad['colors'][$i]['opacity'].']'; - $out .= ' /N '.$grad['colors'][$i]['exponent']; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - } - } - } - // set shading object - $this->_newobj(); - $out = '<< /ShadingType '.$grad['type']; - if (isset($grad['colspace'])) { - $out .= ' /ColorSpace /'.$grad['colspace']; - } else { - $out .= ' /ColorSpace /DeviceRGB'; - } - if (isset($grad['background']) AND !empty($grad['background'])) { - $out .= ' /Background ['.$grad['background'].']'; - } - if (isset($grad['antialias']) AND ($grad['antialias'] === true)) { - $out .= ' /AntiAlias true'; - } - if ($grad['type'] == 2) { - $out .= ' '.sprintf('/Coords [%.3F %.3F %.3F %.3F]', $grad['coords'][0], $grad['coords'][1], $grad['coords'][2], $grad['coords'][3]); - $out .= ' /Domain [0 1]'; - $out .= ' /Function '.$fc.' 0 R'; - $out .= ' /Extend [true true]'; - $out .= ' >>'; - } elseif ($grad['type'] == 3) { - //x0, y0, r0, x1, y1, r1 - //at this this time radius of inner circle is 0 - $out .= ' '.sprintf('/Coords [%.3F %.3F 0 %.3F %.3F %.3F]', $grad['coords'][0], $grad['coords'][1], $grad['coords'][2], $grad['coords'][3], $grad['coords'][4]); - $out .= ' /Domain [0 1]'; - $out .= ' /Function '.$fc.' 0 R'; - $out .= ' /Extend [true true]'; - $out .= ' >>'; - } elseif ($grad['type'] == 6) { - $out .= ' /BitsPerCoordinate 16'; - $out .= ' /BitsPerComponent 8'; - $out .= ' /Decode[0 1 0 1 0 1 0 1 0 1]'; - $out .= ' /BitsPerFlag 8'; - $stream = $this->_getrawstream($grad['stream']); - $out .= ' /Length '.strlen($stream); - $out .= ' >>'; - $out .= ' stream'."\n".$stream."\n".'endstream'; - } - $out .= "\n".'endobj'; - $this->_out($out); - if ($grad['transparency']) { - $shading_transparency = preg_replace('/\/ColorSpace \/[^\s]+/si', '/ColorSpace /DeviceGray', $out); - $shading_transparency = preg_replace('/\/Function [0-9]+ /si', '/Function '.$ft.' ', $shading_transparency); - } - $this->gradients[$id]['id'] = $this->n; - // set pattern object - $this->_newobj(); - $out = '<< /Type /Pattern /PatternType 2'; - $out .= ' /Shading '.$this->gradients[$id]['id'].' 0 R'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - $this->gradients[$id]['pattern'] = $this->n; - // set shading and pattern for transparency mask - if ($grad['transparency']) { - // luminosity pattern - $idgs = $id + $idt; - $this->_newobj(); - $this->_out($shading_transparency); - $this->gradients[$idgs]['id'] = $this->n; - $this->_newobj(); - $out = '<< /Type /Pattern /PatternType 2'; - $out .= ' /Shading '.$this->gradients[$idgs]['id'].' 0 R'; - $out .= ' >>'; - $out .= "\n".'endobj'; - $this->_out($out); - $this->gradients[$idgs]['pattern'] = $this->n; - // luminosity XObject - $oid = $this->_newobj(); - $this->xobjects['LX'.$oid] = array('n' => $oid); - $filter = ''; - $stream = 'q /a0 gs /Pattern cs /p'.$idgs.' scn 0 0 '.$this->wPt.' '.$this->hPt.' re f Q'; - if ($this->compress) { - $filter = ' /Filter /FlateDecode'; - $stream = gzcompress($stream); - } - $stream = $this->_getrawstream($stream); - $out = '<< /Type /XObject /Subtype /Form /FormType 1'.$filter; - $out .= ' /Length '.strlen($stream); - $rect = sprintf('%.2F %.2F', $this->wPt, $this->hPt); - $out .= ' /BBox [0 0 '.$rect.']'; - $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceGray >>'; - $out .= ' /Resources <<'; - $out .= ' /ExtGState << /a0 << /ca 1 /CA 1 >> >>'; - $out .= ' /Pattern << /p'.$idgs.' '.$this->gradients[$idgs]['pattern'].' 0 R >>'; - $out .= ' >>'; - $out .= ' >> '; - $out .= ' stream'."\n".$stream."\n".'endstream'; - $out .= "\n".'endobj'; - $this->_out($out); - // SMask - $this->_newobj(); - $out = '<< /Type /Mask /S /Luminosity /G '.($this->n - 1).' 0 R >>'."\n".'endobj'; - $this->_out($out); - // ExtGState - $this->_newobj(); - $out = '<< /Type /ExtGState /SMask '.($this->n - 1).' 0 R /AIS false >>'."\n".'endobj'; - $this->_out($out); - $this->extgstates[] = array('n' => $this->n, 'name' => 'TGS'.$id); - } - } - } - - /** - * Draw the sector of a circle. - * It can be used for instance to render pie charts. - * @param float $xc abscissa of the center. - * @param float $yc ordinate of the center. - * @param float $r radius. - * @param float $a start angle (in degrees). - * @param float $b end angle (in degrees). - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param float $cw: indicates whether to go clockwise (default: true). - * @param float $o: origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. - * @author Maxime Delorme, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function PieSector($xc, $yc, $r, $a, $b, $style='FD', $cw=true, $o=90) { - $this->PieSectorXY($xc, $yc, $r, $r, $a, $b, $style, $cw, $o); - } - - /** - * Draw the sector of an ellipse. - * It can be used for instance to render pie charts. - * @param float $xc abscissa of the center. - * @param float $yc ordinate of the center. - * @param float $rx the x-axis radius. - * @param float $ry the y-axis radius. - * @param float $a start angle (in degrees). - * @param float $b end angle (in degrees). - * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. - * @param float $cw: indicates whether to go clockwise. - * @param float $o: origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). - * @param integer $nc Number of curves used to draw a 90 degrees portion of arc. - * @author Maxime Delorme, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function PieSectorXY($xc, $yc, $rx, $ry, $a, $b, $style='FD', $cw=false, $o=0, $nc=2) { - if ($this->rtl) { - $xc = $this->w - $xc; - } - $op = $this->getPathPaintOperator($style); - if ($op == 'f') { - $line_style = array(); - } - if ($cw) { - $d = $b; - $b = 360 - $a + $o; - $a = 360 - $d + $o; - } else { - $b += $o; - $a += $o; - } - $this->_outellipticalarc($xc, $yc, $rx, $ry, 0, $a, $b, true, $nc); - $this->_out($op); - } - - /** - * Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. - * NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. - * Only vector drawing is supported, not text or bitmap. - * Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2). - * @param string $file Name of the file containing the image. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param mixed $link URL or identifier returned by AddLink(). - * @param boolean useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @param string $palign Allows to center or align the image on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. - * @author Valentin Schmidt, Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function ImageEps($file, $x='', $y='', $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false) { - if ($this->rasterize_vector_images AND ($w > 0) AND ($h > 0)) { - // convert EPS to raster image using GD or ImageMagick libraries - return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage); - } - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - $k = $this->k; - $data = file_get_contents($file); - if ($data === false) { - $this->Error('EPS file not found: '.$file); - } - $regs = array(); - // EPS/AI compatibility check (only checks files created by Adobe Illustrator!) - preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator - if (count($regs) > 1) { - $version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0" - if (strpos($version_str, 'Adobe Illustrator') !== false) { - $versexp = explode(' ', $version_str); - $version = (float)array_pop($versexp); - if ($version >= 9) { - $this->Error('This version of Adobe Illustrator file is not supported: '.$file); - } - } - } - // strip binary bytes in front of PS-header - $start = strpos($data, '%!PS-Adobe'); - if ($start > 0) { - $data = substr($data, $start); - } - // find BoundingBox params - preg_match("/%%BoundingBox:([^\r\n]+)/", $data, $regs); - if (count($regs) > 1) { - list($x1, $y1, $x2, $y2) = explode(' ', trim($regs[1])); - } else { - $this->Error('No BoundingBox found in EPS file: '.$file); - } - $start = strpos($data, '%%EndSetup'); - if ($start === false) { - $start = strpos($data, '%%EndProlog'); - } - if ($start === false) { - $start = strpos($data, '%%BoundingBox'); - } - $data = substr($data, $start); - $end = strpos($data, '%%PageTrailer'); - if ($end===false) { - $end = strpos($data, 'showpage'); - } - if ($end) { - $data = substr($data, 0, $end); - } - // calculate image width and height on document - if (($w <= 0) AND ($h <= 0)) { - $w = ($x2 - $x1) / $k; - $h = ($y2 - $y1) / $k; - } elseif ($w <= 0) { - $w = ($x2-$x1) / $k * ($h / (($y2 - $y1) / $k)); - } elseif ($h <= 0) { - $h = ($y2 - $y1) / $k * ($w / (($x2 - $x1) / $k)); - } - // fit the image on available space - $this->fitBlock($w, $h, $x, $y, $fitonpage); - if ($this->rasterize_vector_images) { - // convert EPS to raster image using GD or ImageMagick libraries - return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage); - } - // set scaling factors - $scale_x = $w / (($x2 - $x1) / $k); - $scale_y = $h / (($y2 - $y1) / $k); - // set alignment - $this->img_rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x - $w; - } - $this->img_rb_x = $ximg; - } else { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x; - } - $this->img_rb_x = $ximg + $w; - } - if ($useBoundingBox) { - $dx = $ximg * $k - $x1; - $dy = $y * $k - $y1; - } else { - $dx = $ximg * $k; - $dy = $y * $k; - } - // save the current graphic state - $this->_out('q'.$this->epsmarker); - // translate - $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', 1, 0, 0, 1, $dx, $dy + ($this->hPt - (2 * $y * $k) - ($y2 - $y1)))); - // scale - if (isset($scale_x)) { - $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); - } - // handle pc/unix/mac line endings - preg_match('/[\r\n]+/s', $data, $regs); - $lines = explode($regs[0], $data); - $u=0; - $cnt = count($lines); - for ($i=0; $i < $cnt; ++$i) { - $line = $lines[$i]; - if (($line == '') OR ($line{0} == '%')) { - continue; - } - $len = strlen($line); - $chunks = explode(' ', $line); - $cmd = array_pop($chunks); - // RGB - if (($cmd == 'Xa') OR ($cmd == 'XA')) { - $b = array_pop($chunks); - $g = array_pop($chunks); - $r = array_pop($chunks); - $this->_out(''.$r.' '.$g.' '.$b.' '.($cmd=='Xa'?'rg':'RG')); //substr($line, 0, -2).'rg' -> in EPS (AI8): c m y k r g b rg! - continue; - } - switch ($cmd) { - case 'm': - case 'l': - case 'v': - case 'y': - case 'c': - case 'k': - case 'K': - case 'g': - case 'G': - case 's': - case 'S': - case 'J': - case 'j': - case 'w': - case 'M': - case 'd': - case 'n': { - $this->_out($line); - break; - } - case 'x': {// custom fill color - list($c,$m,$y,$k) = $chunks; - $this->_out(''.$c.' '.$m.' '.$y.' '.$k.' k'); - break; - } - case 'X': { // custom stroke color - list($c,$m,$y,$k) = $chunks; - $this->_out(''.$c.' '.$m.' '.$y.' '.$k.' K'); - break; - } - case 'Y': - case 'N': - case 'V': - case 'L': - case 'C': { - $line{$len-1} = strtolower($cmd); - $this->_out($line); - break; - } - case 'b': - case 'B': { - $this->_out($cmd . '*'); - break; - } - case 'f': - case 'F': { - if ($u > 0) { - $isU = false; - $max = min($i+5, $cnt); - for ($j=$i+1; $j < $max; ++$j) { - $isU = ($isU OR (($lines[$j] == 'U') OR ($lines[$j] == '*U'))); - } - if ($isU) { - $this->_out('f*'); - } - } else { - $this->_out('f*'); - } - break; - } - case '*u': { - ++$u; - break; - } - case '*U': { - --$u; - break; - } - } - } - // restore previous graphic state - $this->_out($this->epsmarker.'Q'); - if (!empty($border)) { - $bx = $this->x; - $by = $this->y; - $this->x = $ximg; - if ($this->rtl) { - $this->x += $w; - } - $this->y = $y; - $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); - $this->x = $bx; - $this->y = $by; - } - if ($link) { - $this->Link($ximg, $y, $w, $h, $link, 0); - } - // set pointer to align the next text/objects - switch($align) { - case 'T':{ - $this->y = $y; - $this->x = $this->img_rb_x; - break; - } - case 'M':{ - $this->y = $y + round($h/2); - $this->x = $this->img_rb_x; - break; - } - case 'B':{ - $this->y = $this->img_rb_y; - $this->x = $this->img_rb_x; - break; - } - case 'N':{ - $this->SetY($this->img_rb_y); - break; - } - default:{ - break; - } - } - $this->endlinex = $this->img_rb_x; - } - - /** - * Set document barcode. - * @param string $bc barcode - * @access public - */ - public function setBarcode($bc='') { - $this->barcode = $bc; - } - - /** - * Get current barcode. - * @return string - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getBarcode() { - return $this->barcode; - } - - /** - * Print a Linear Barcode. - * @param string $code code to print - * @param string $type type of barcode (see barcodes.php for supported formats). - * @param int $x x position in user units (empty string = current x position) - * @param int $y y position in user units (empty string = current y position) - * @param int $w width in user units (empty string = remaining page width) - * @param int $h height in user units (empty string = remaining page height) - * @param float $xres width of the smallest bar in user units (empty string = default value = 0.4mm) - * @param array $style array of options:<ul> - * <li>boolean $style['border'] if true prints a border</li> - * <li>int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)</li> - * <li>int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)</li> - * <li>int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)</li> - * <li>array $style['fgcolor'] color array for bars and text</li> - * <li>mixed $style['bgcolor'] color array for background (set to false for transparent)</li> - * <li>boolean $style['text'] if true prints text below the barcode</li> - * <li>string $style['label'] override default label</li> - * <li>string $style['font'] font name for text</li><li>int $style['fontsize'] font size for text</li> - * <li>int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.</li> - * <li>string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.</li> - * <li>string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.</li> - * <li>string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.</li> - * <li>string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.</li> - * <li>string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.</li></ul> - * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @author Nicola Asuni - * @since 3.1.000 (2008-06-09) - * @access public - */ - public function write1DBarcode($code, $type, $x='', $y='', $w='', $h='', $xres='', $style='', $align='') { - if ($this->empty_string(trim($code))) { - return; - } - require_once(dirname(__FILE__).'/barcodes.php'); - // save current graphic settings - $gvars = $this->getGraphicVars(); - // create new barcode object - $barcodeobj = new TCPDFBarcode($code, $type); - $arrcode = $barcodeobj->getBarcodeArray(); - if ($arrcode === false) { - $this->Error('Error in 1D barcode string'); - } - // set default values - if (!isset($style['position'])) { - $style['position'] = ''; - } elseif ($style['position'] == 'S') { - // keep this for backward compatibility - $style['position'] = ''; - $style['stretch'] = true; - } - if (!isset($style['fitwidth'])) { - if (!isset($style['stretch'])) { - $style['fitwidth'] = true; - } else { - $style['fitwidth'] = false; - } - } - if ($style['fitwidth']) { - // disable stretch - $style['stretch'] = false; - } - if (!isset($style['stretch'])) { - if (($w === '') OR ($w <= 0)) { - $style['stretch'] = false; - } else { - $style['stretch'] = true; - } - } - if (!isset($style['fgcolor'])) { - $style['fgcolor'] = array(0,0,0); // default black - } - if (!isset($style['bgcolor'])) { - $style['bgcolor'] = false; // default transparent - } - if (!isset($style['border'])) { - $style['border'] = false; - } - $fontsize = 0; - if (!isset($style['text'])) { - $style['text'] = false; - } - if ($style['text'] AND isset($style['font'])) { - if (isset($style['fontsize'])) { - $fontsize = $style['fontsize']; - } - $this->SetFont($style['font'], '', $fontsize); - } - if (!isset($style['stretchtext'])) { - $style['stretchtext'] = 4; - } - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - if (($w === '') OR ($w <= 0)) { - if ($this->rtl) { - $w = $x - $this->lMargin; - } else { - $w = $this->w - $this->rMargin - $x; - } - } - // padding - if (!isset($style['padding'])) { - $padding = 0; - } elseif ($style['padding'] === 'auto') { - $padding = 10 * ($w / ($arrcode['maxw'] + 20)); - } else { - $padding = floatval($style['padding']); - } - // horizontal padding - if (!isset($style['hpadding'])) { - $hpadding = $padding; - } elseif ($style['hpadding'] === 'auto') { - $hpadding = 10 * ($w / ($arrcode['maxw'] + 20)); - } else { - $hpadding = floatval($style['hpadding']); - } - // vertical padding - if (!isset($style['vpadding'])) { - $vpadding = $padding; - } elseif ($style['vpadding'] === 'auto') { - $vpadding = ($hpadding / 2); - } else { - $vpadding = floatval($style['vpadding']); - } - // calculate xres (single bar width) - $max_xres = ($w - (2 * $hpadding)) / $arrcode['maxw']; - if ($style['stretch']) { - $xres = $max_xres; - } else { - if ($this->empty_string($xres)) { - $xres = (0.141 * $this->k); // default bar width = 0.4 mm - } - if ($xres > $max_xres) { - // correct xres to fit on $w - $xres = $max_xres; - } - if ((isset($style['padding']) AND ($style['padding'] === 'auto')) - OR (isset($style['hpadding']) AND ($style['hpadding'] === 'auto'))) { - $hpadding = 10 * $xres; - if (isset($style['vpadding']) AND ($style['vpadding'] === 'auto')) { - $vpadding = ($hpadding / 2); - } - } - } - if ($style['fitwidth']) { - $wold = $w; - $w = (($arrcode['maxw'] * $xres) + (2 * $hpadding)); - if (isset($style['cellfitalign'])) { - switch ($style['cellfitalign']) { - case 'L': { - if ($this->rtl) { - $x -= ($wold - $w); - } - break; - } - case 'R': { - if (!$this->rtl) { - $x += ($wold - $w); - } - break; - } - case 'C': { - if ($this->rtl) { - $x -= (($wold - $w) / 2); - } else { - $x += (($wold - $w) / 2); - } - break; - } - default : { - break; - } - } - } - } - $text_height = ($this->cell_height_ratio * $fontsize / $this->k); - // height - if (($h === '') OR ($h <= 0)) { - // set default height - $h = (($arrcode['maxw'] * $xres) / 3) + (2 * $vpadding) + $text_height; - } - $barh = $h - $text_height - (2 * $vpadding); - if ($barh <=0) { - // try to reduce font or padding to fit barcode on available height - if ($text_height > $h) { - $fontsize = (($h * $this->k) / (4 * $this->cell_height_ratio)); - $text_height = ($this->cell_height_ratio * $fontsize / $this->k); - $this->SetFont($style['font'], '', $fontsize); - } - if ($vpadding > 0) { - $vpadding = (($h - $text_height) / 4); - } - $barh = $h - $text_height - (2 * $vpadding); - } - // fit the barcode on available space - $this->fitBlock($w, $h, $x, $y, false); - // set alignment - $this->img_rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($style['position'] == 'L') { - $xpos = $this->lMargin; - } elseif ($style['position'] == 'C') { - $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($style['position'] == 'R') { - $xpos = $this->w - $this->rMargin - $w; - } else { - $xpos = $x - $w; - } - $this->img_rb_x = $xpos; - } else { - if ($style['position'] == 'L') { - $xpos = $this->lMargin; - } elseif ($style['position'] == 'C') { - $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($style['position'] == 'R') { - $xpos = $this->w - $this->rMargin - $w; - } else { - $xpos = $x; - } - $this->img_rb_x = $xpos + $w; - } - $xpos_rect = $xpos; - if (!isset($style['align'])) { - $style['align'] = 'C'; - } - switch ($style['align']) { - case 'L': { - $xpos = $xpos_rect + $hpadding; - break; - } - case 'R': { - $xpos = $xpos_rect + ($w - ($arrcode['maxw'] * $xres)) - $hpadding; - break; - } - case 'C': - default : { - $xpos = $xpos_rect + (($w - ($arrcode['maxw'] * $xres)) / 2); - break; - } - } - $xpos_text = $xpos; - // barcode is always printed in LTR direction - $tempRTL = $this->rtl; - $this->rtl = false; - // print background color - if ($style['bgcolor']) { - $this->Rect($xpos_rect, $y, $w, $h, $style['border'] ? 'DF' : 'F', '', $style['bgcolor']); - } elseif ($style['border']) { - $this->Rect($xpos_rect, $y, $w, $h, 'D'); - } - // set foreground color - $this->SetDrawColorArray($style['fgcolor']); - $this->SetTextColorArray($style['fgcolor']); - // print bars - foreach ($arrcode['bcode'] as $k => $v) { - $bw = ($v['w'] * $xres); - if ($v['t']) { - // draw a vertical bar - $ypos = $y + $vpadding + ($v['p'] * $barh / $arrcode['maxh']); - $this->Rect($xpos, $ypos, $bw, ($v['h'] * $barh / $arrcode['maxh']), 'F', array(), $style['fgcolor']); - } - $xpos += $bw; - } - // print text - if ($style['text']) { - if (isset($style['label']) AND !$this->empty_string($style['label'])) { - $label = $style['label']; - } else { - $label = $code; - } - $txtwidth = ($arrcode['maxw'] * $xres); - if ($this->GetStringWidth($label) > $txtwidth) { - $style['stretchtext'] = 2; - } - // print text - $this->x = $xpos_text; - $this->y = $y + $vpadding + $barh; - $cellpadding = $this->cell_padding; - $this->SetCellPadding(0); - $this->Cell($txtwidth, '', $label, 0, 0, 'C', 0, '', $style['stretchtext'], false, 'T', 'T'); - $this->cell_padding = $cellpadding; - } - // restore original direction - $this->rtl = $tempRTL; - // restore previous settings - $this->setGraphicVars($gvars); - // set pointer to align the next text/objects - switch($align) { - case 'T':{ - $this->y = $y; - $this->x = $this->img_rb_x; - break; - } - case 'M':{ - $this->y = $y + round($h / 2); - $this->x = $this->img_rb_x; - break; - } - case 'B':{ - $this->y = $this->img_rb_y; - $this->x = $this->img_rb_x; - break; - } - case 'N':{ - $this->SetY($this->img_rb_y); - break; - } - default:{ - break; - } - } - $this->endlinex = $this->img_rb_x; - } - - /** - * This function is DEPRECATED, please use the new write1DBarcode() function. - * @param int $x x position in user units - * @param int $y y position in user units - * @param int $w width in user units - * @param int $h height position in user units - * @param string $type type of barcode - * @param string $style barcode style - * @param string $font font for text - * @param int $xres x resolution - * @param string $code code to print - * @deprecated deprecated since version 3.1.000 (2008-06-10) - * @access public - * @see write1DBarcode() - */ - public function writeBarcode($x, $y, $w, $h, $type, $style, $font, $xres, $code) { - // convert old settings for the new write1DBarcode() function. - $xres = 1 / $xres; - $newstyle = array( - 'position' => '', - 'align' => '', - 'stretch' => false, - 'fitwidth' => false, - 'cellfitalign' => '', - 'border' => false, - 'padding' => 0, - 'fgcolor' => array(0,0,0), - 'bgcolor' => false, - 'text' => true, - 'font' => $font, - 'fontsize' => 8, - 'stretchtext' => 4 - ); - if ($style & 1) { - $newstyle['border'] = true; - } - if ($style & 2) { - $newstyle['bgcolor'] = false; - } - if ($style & 4) { - $newstyle['position'] = 'C'; - } elseif ($style & 8) { - $newstyle['position'] = 'L'; - } elseif ($style & 16) { - $newstyle['position'] = 'R'; - } - if ($style & 128) { - $newstyle['text'] = true; - } - if ($style & 256) { - $newstyle['stretchtext'] = 4; - } - $this->write1DBarcode($code, $type, $x, $y, $w, $h, $xres, $newstyle, ''); - } - - /** - * Print 2D Barcode. - * @param string $code code to print - * @param string $type type of barcode (see 2dbarcodes.php for supported formats). - * @param int $x x position in user units - * @param int $y y position in user units - * @param int $w width in user units - * @param int $h height in user units - * @param array $style array of options:<ul> - * <li>boolean $style['border'] if true prints a border around the barcode</li> - * <li>int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)</li> - * <li>int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)</li> - * <li>int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)</li> - * <li>int $style['module_width'] width of a single module in points</li> - * <li>int $style['module_height'] height of a single module in points</li> - * <li>array $style['fgcolor'] color array for bars and text</li> - * <li>mixed $style['bgcolor'] color array for background or false for transparent</li> - * <li>string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch</li><li>$style['module_width'] width of a single module in points</li> - * <li>$style['module_height'] height of a single module in points</li></ul> - * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @param boolean $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio - * @author Nicola Asuni - * @since 4.5.037 (2009-04-07) - * @access public - */ - public function write2DBarcode($code, $type, $x='', $y='', $w='', $h='', $style='', $align='', $distort=false) { - if ($this->empty_string(trim($code))) { - return; - } - require_once(dirname(__FILE__).'/2dbarcodes.php'); - // save current graphic settings - $gvars = $this->getGraphicVars(); - // create new barcode object - $barcodeobj = new TCPDF2DBarcode($code, $type); - $arrcode = $barcodeobj->getBarcodeArray(); - if (($arrcode === false) OR empty($arrcode)) { - $this->Error('Error in 2D barcode string'); - } - // set default values - if (!isset($style['position'])) { - $style['position'] = ''; - } - if (!isset($style['fgcolor'])) { - $style['fgcolor'] = array(0,0,0); // default black - } - if (!isset($style['bgcolor'])) { - $style['bgcolor'] = false; // default transparent - } - if (!isset($style['border'])) { - $style['border'] = false; - } - // padding - if (!isset($style['padding'])) { - $style['padding'] = 0; - } elseif ($style['padding'] === 'auto') { - $style['padding'] = 4; - } - if (!isset($style['hpadding'])) { - $style['hpadding'] = $style['padding']; - } elseif ($style['hpadding'] === 'auto') { - $style['hpadding'] = 4; - } - if (!isset($style['vpadding'])) { - $style['vpadding'] = $style['padding']; - } elseif ($style['vpadding'] === 'auto') { - $style['vpadding'] = 4; - } - // cell (module) dimension - if (!isset($style['module_width'])) { - $style['module_width'] = 1; // width of a single module in points - } - if (!isset($style['module_height'])) { - $style['module_height'] = 1; // height of a single module in points - } - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - // number of barcode columns and rows - $rows = $arrcode['num_rows']; - $cols = $arrcode['num_cols']; - // module width and height - $mw = $style['module_width']; - $mh = $style['module_height']; - // get max dimensions - if ($this->rtl) { - $maxw = $x - $this->lMargin; - } else { - $maxw = $this->w - $this->rMargin - $x; - } - $maxh = ($this->h - $this->tMargin - $this->bMargin); - $ratioHW = ($rows * $mh) / ($cols * $mw); - $ratioWH = ($cols * $mw) / ($rows * $mh); - if (!$distort) { - if (($maxw * $ratioHW) > $maxh) { - $maxw = $maxh * $ratioWH; - } - if (($maxh * $ratioWH) > $maxw) { - $maxh = $maxw * $ratioHW; - } - } - // set maximum dimesions - if ($w > $maxw) { - $w = $maxw; - } - if ($h > $maxh) { - $h = $maxh; - } - $hpad = (2 * $style['hpadding']); - $vpad = (2 * $style['vpadding']); - // set dimensions - if ((($w === '') OR ($w <= 0)) AND (($h === '') OR ($h <= 0))) { - $w = ($cols + $hpad) * ($mw / $this->k); - $h = ($rows + $vpad) * ($mh / $this->k); - } elseif (($w === '') OR ($w <= 0)) { - $w = $h * $ratioWH; - } elseif (($h === '') OR ($h <= 0)) { - $h = $w * $ratioHW; - } - // barcode size (excluding padding) - $bw = ($w * $cols) / ($cols + $hpad); - $bh = ($h * $rows) / ($rows + $vpad); - // dimension of single barcode cell unit - $cw = $bw / $cols; - $ch = $bh / $rows; - if (!$distort) { - if (($cw / $ch) > ($mw / $mh)) { - // correct horizontal distortion - $cw = $ch * $mw / $mh; - $bw = $cw * $cols; - $style['hpadding'] = ($w - $bw) / (2 * $cw); - } else { - // correct vertical distortion - $ch = $cw * $mh / $mw; - $bh = $ch * $rows; - $style['vpadding'] = ($h - $bh) / (2 * $ch); - } - } - // fit the barcode on available space - $this->fitBlock($w, $h, $x, $y, false); - // set alignment - $this->img_rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($style['position'] == 'L') { - $xpos = $this->lMargin; - } elseif ($style['position'] == 'C') { - $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($style['position'] == 'R') { - $xpos = $this->w - $this->rMargin - $w; - } else { - $xpos = $x - $w; - } - $this->img_rb_x = $xpos; - } else { - if ($style['position'] == 'L') { - $xpos = $this->lMargin; - } elseif ($style['position'] == 'C') { - $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($style['position'] == 'R') { - $xpos = $this->w - $this->rMargin - $w; - } else { - $xpos = $x; - } - $this->img_rb_x = $xpos + $w; - } - $xstart = $xpos + ($style['hpadding'] * $cw); - $ystart = $y + ($style['vpadding'] * $ch); - // barcode is always printed in LTR direction - $tempRTL = $this->rtl; - $this->rtl = false; - // print background color - if ($style['bgcolor']) { - $this->Rect($xpos, $y, $w, $h, $style['border'] ? 'DF' : 'F', '', $style['bgcolor']); - } elseif ($style['border']) { - $this->Rect($xpos, $y, $w, $h, 'D'); - } - // set foreground color - $this->SetDrawColorArray($style['fgcolor']); - // print barcode cells - // for each row - for ($r = 0; $r < $rows; ++$r) { - $xr = $xstart; - // for each column - for ($c = 0; $c < $cols; ++$c) { - if ($arrcode['bcode'][$r][$c] == 1) { - // draw a single barcode cell - $this->Rect($xr, $ystart, $cw, $ch, 'F', array(), $style['fgcolor']); - } - $xr += $cw; - } - $ystart += $ch; - } - // restore original direction - $this->rtl = $tempRTL; - // restore previous settings - $this->setGraphicVars($gvars); - // set pointer to align the next text/objects - switch($align) { - case 'T':{ - $this->y = $y; - $this->x = $this->img_rb_x; - break; - } - case 'M':{ - $this->y = $y + round($h/2); - $this->x = $this->img_rb_x; - break; - } - case 'B':{ - $this->y = $this->img_rb_y; - $this->x = $this->img_rb_x; - break; - } - case 'N':{ - $this->SetY($this->img_rb_y); - break; - } - default:{ - break; - } - } - $this->endlinex = $this->img_rb_x; - } - - /** - * Returns an array containing current margins: - * <ul> - <li>$ret['left'] = left margin</li> - <li>$ret['right'] = right margin</li> - <li>$ret['top'] = top margin</li> - <li>$ret['bottom'] = bottom margin</li> - <li>$ret['header'] = header margin</li> - <li>$ret['footer'] = footer margin</li> - <li>$ret['cell'] = cell padding array</li> - <li>$ret['padding_left'] = cell left padding</li> - <li>$ret['padding_top'] = cell top padding</li> - <li>$ret['padding_right'] = cell right padding</li> - <li>$ret['padding_bottom'] = cell bottom padding</li> - * </ul> - * @return array containing all margins measures - * @access public - * @since 3.2.000 (2008-06-23) - */ - public function getMargins() { - $ret = array( - 'left' => $this->lMargin, - 'right' => $this->rMargin, - 'top' => $this->tMargin, - 'bottom' => $this->bMargin, - 'header' => $this->header_margin, - 'footer' => $this->footer_margin, - 'cell' => $this->cell_padding, - 'padding_left' => $this->cell_padding['L'], - 'padding_top' => $this->cell_padding['T'], - 'padding_right' => $this->cell_padding['R'], - 'padding_bottom' => $this->cell_padding['B'] - ); - return $ret; - } - - /** - * Returns an array containing original margins: - * <ul> - <li>$ret['left'] = left margin</li> - <li>$ret['right'] = right margin</li> - * </ul> - * @return array containing all margins measures - * @access public - * @since 4.0.012 (2008-07-24) - */ - public function getOriginalMargins() { - $ret = array( - 'left' => $this->original_lMargin, - 'right' => $this->original_rMargin - ); - return $ret; - } - - /** - * Returns the current font size. - * @return current font size - * @access public - * @since 3.2.000 (2008-06-23) - */ - public function getFontSize() { - return $this->FontSize; - } - - /** - * Returns the current font size in points unit. - * @return current font size in points unit - * @access public - * @since 3.2.000 (2008-06-23) - */ - public function getFontSizePt() { - return $this->FontSizePt; - } - - /** - * Returns the current font family name. - * @return string current font family name - * @access public - * @since 4.3.008 (2008-12-05) - */ - public function getFontFamily() { - return $this->FontFamily; - } - - /** - * Returns the current font style. - * @return string current font style - * @access public - * @since 4.3.008 (2008-12-05) - */ - public function getFontStyle() { - return $this->FontStyle; - } - - /** - * Extracts the CSS properties from a CSS string. - * @param string $cssdata string containing CSS definitions. - * @return An array where the keys are the CSS selectors and the values are the CSS properties. - * @author Nicola Asuni - * @since 5.1.000 (2010-05-25) - * @access protected - */ - protected function extractCSSproperties($cssdata) { - if (empty($cssdata)) { - return array(); - } - // remove comments - $cssdata = preg_replace('/\/\*[^\*]*\*\//', '', $cssdata); - // remove newlines and multiple spaces - $cssdata = preg_replace('/[\s]+/', ' ', $cssdata); - // remove some spaces - $cssdata = preg_replace('/[\s]*([;:\{\}]{1})[\s]*/', '\\1', $cssdata); - // remove empty blocks - $cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata); - // replace media type parenthesis - $cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1§', $cssdata); - $cssdata = preg_replace('/\}\}/si', '}§', $cssdata); - // trim string - $cssdata = trim($cssdata); - // find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) - $cssblocks = array(); - $matches = array(); - if (preg_match_all('/@media[\s]+([^\§]*)§([^§]*)§/i', $cssdata, $matches) > 0) { - foreach ($matches[1] as $key => $type) { - $cssblocks[$type] = $matches[2][$key]; - } - // remove media blocks - $cssdata = preg_replace('/@media[\s]+([^\§]*)§([^§]*)§/i', '', $cssdata); - } - // keep 'all' and 'print' media, other media types are discarded - if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) { - $cssdata .= $cssblocks['all']; - } - if (isset($cssblocks['print']) AND !empty($cssblocks['print'])) { - $cssdata .= $cssblocks['print']; - } - // reset css blocks array - $cssblocks = array(); - $matches = array(); - // explode css data string into array - if (substr($cssdata, -1) == '}') { - // remove last parethesis - $cssdata = substr($cssdata, 0, -1); - } - $matches = explode('}', $cssdata); - foreach ($matches as $key => $block) { - // index 0 contains the CSS selector, index 1 contains CSS properties - $cssblocks[$key] = explode('{', $block); - if (!isset($cssblocks[$key][1])) { - // remove empty definitions - unset($cssblocks[$key]); - } - } - // split groups of selectors (comma-separated list of selectors) - foreach ($cssblocks as $key => $block) { - if (strpos($block[0], ',') > 0) { - $selectors = explode(',', $block[0]); - foreach ($selectors as $sel) { - $cssblocks[] = array(0 => trim($sel), 1 => $block[1]); - } - unset($cssblocks[$key]); - } - } - // covert array to selector => properties - $cssdata = array(); - foreach ($cssblocks as $block) { - $selector = $block[0]; - // calculate selector's specificity - $matches = array(); - $a = 0; // the declaration is not from is a 'style' attribute - $b = intval(preg_match_all('/[\#]/', $selector, $matches)); // number of ID attributes - $c = intval(preg_match_all('/[\[\.]/', $selector, $matches)); // number of other attributes - $c += intval(preg_match_all('/[\:]link|visited|hover|active|focus|target|lang|enabled|disabled|checked|indeterminate|root|nth|first|last|only|empty|contains|not/i', $selector, $matches)); // number of pseudo-classes - $d = intval(preg_match_all('/[\>\+\~\s]{1}[a-zA-Z0-9\*]+/', ' '.$selector, $matches)); // number of element names - $d += intval(preg_match_all('/[\:][\:]/', $selector, $matches)); // number of pseudo-elements - $specificity = $a.$b.$c.$d; - // add specificity to the beginning of the selector - $cssdata[$specificity.' '.$selector] = $block[1]; - } - // sort selectors alphabetically to account for specificity - ksort($cssdata, SORT_STRING); - // return array - return $cssdata; - } - - /** - * Returns true if the CSS selector is valid for the selected HTML tag - * @param array $dom array of HTML tags and properties - * @param int $key key of the current HTML tag - * @param string $selector CSS selector string - * @return true if the selector is valid, false otherwise - * @access protected - * @since 5.1.000 (2010-05-25) - */ - protected function isValidCSSSelectorForTag($dom, $key, $selector) { - $valid = false; // value to be returned - $tag = $dom[$key]['value']; - $class = array(); - if (isset($dom[$key]['attribute']['class']) AND !empty($dom[$key]['attribute']['class'])) { - $class = explode(' ', strtolower($dom[$key]['attribute']['class'])); - } - $id = ''; - if (isset($dom[$key]['attribute']['id']) AND !empty($dom[$key]['attribute']['id'])) { - $id = strtolower($dom[$key]['attribute']['id']); - } - $selector = preg_replace('/([\>\+\~\s]{1})([\.]{1})([^\>\+\~\s]*)/si', '\\1*.\\3', $selector); - $matches = array(); - if (preg_match_all('/([\>\+\~\s]{1})([a-zA-Z0-9\*]+)([^\>\+\~\s]*)/si', $selector, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) > 0) { - $parentop = array_pop($matches[1]); - $operator = $parentop[0]; - $offset = $parentop[1]; - $lasttag = array_pop($matches[2]); - $lasttag = strtolower(trim($lasttag[0])); - if (($lasttag == '*') OR ($lasttag == $tag)) { - // the last element on selector is our tag or 'any tag' - $attrib = array_pop($matches[3]); - $attrib = strtolower(trim($attrib[0])); - if (!empty($attrib)) { - // check if matches class, id, attribute, pseudo-class or pseudo-element - switch ($attrib{0}) { - case '.': { // class - if (in_array(substr($attrib, 1), $class)) { - $valid = true; - } - break; - } - case '#': { // ID - if (substr($attrib, 1) == $id) { - $valid = true; - } - break; - } - case '[': { // attribute - $attrmatch = array(); - if (preg_match('/\[([a-zA-Z0-9]*)[\s]*([\~\^\$\*\|\=]*)[\s]*["]?([^"\]]*)["]?\]/i', $attrib, $attrmatch) > 0) { - $att = strtolower($attrmatch[1]); - $val = $attrmatch[3]; - if (isset($dom[$key]['attribute'][$att])) { - switch ($attrmatch[2]) { - case '=': { - if ($dom[$key]['attribute'][$att] == $val) { - $valid = true; - } - break; - } - case '~=': { - if (in_array($val, explode(' ', $dom[$key]['attribute'][$att]))) { - $valid = true; - } - break; - } - case '^=': { - if ($val == substr($dom[$key]['attribute'][$att], 0, strlen($val))) { - $valid = true; - } - break; - } - case '$=': { - if ($val == substr($dom[$key]['attribute'][$att], -strlen($val))) { - $valid = true; - } - break; - } - case '*=': { - if (strpos($dom[$key]['attribute'][$att], $val) !== false) { - $valid = true; - } - break; - } - case '|=': { - if ($dom[$key]['attribute'][$att] == $val) { - $valid = true; - } elseif (preg_match('/'.$val.'[\-]{1}/i', $dom[$key]['attribute'][$att]) > 0) { - $valid = true; - } - break; - } - default: { - $valid = true; - } - } - } - } - break; - } - case ':': { // pseudo-class or pseudo-element - if ($attrib{1} == ':') { // pseudo-element - // pseudo-elements are not supported! - // (::first-line, ::first-letter, ::before, ::after) - } else { // pseudo-class - // pseudo-classes are not supported! - // (:root, :nth-child(n), :nth-last-child(n), :nth-of-type(n), :nth-last-of-type(n), :first-child, :last-child, :first-of-type, :last-of-type, :only-child, :only-of-type, :empty, :link, :visited, :active, :hover, :focus, :target, :lang(fr), :enabled, :disabled, :checked) - } - break; - } - } // end of switch - } else { - $valid = true; - } - if ($valid AND ($offset > 0)) { - $valid = false; - // check remaining selector part - $selector = substr($selector, 0, $offset); - switch ($operator) { - case ' ': { // descendant of an element - while ($dom[$key]['parent'] > 0) { - if ($this->isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector)) { - $valid = true; - break; - } else { - $key = $dom[$key]['parent']; - } - } - break; - } - case '>': { // child of an element - $valid = $this->isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector); - break; - } - case '+': { // immediately preceded by an element - for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { - if ($dom[$i]['tag'] AND $dom[$i]['opening']) { - $valid = $this->isValidCSSSelectorForTag($dom, $i, $selector); - break; - } - } - break; - } - case '~': { // preceded by an element - for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { - if ($dom[$i]['tag'] AND $dom[$i]['opening']) { - if ($this->isValidCSSSelectorForTag($dom, $i, $selector)) { - break; - } - } - } - break; - } - } - } - } - } - return $valid; - } - - /** - * Returns the styles that apply for the selected HTML tag. - * @param array $dom array of HTML tags and properties - * @param int $key key of the current HTML tag - * @param array $css array of CSS properties - * @return string containing CSS properties - * @access protected - * @since 5.1.000 (2010-05-25) - */ - protected function getTagStyleFromCSS($dom, $key, $css) { - $tagstyle = ''; // style to be returned - // get all styles that apply - foreach($css as $selector => $style) { - // remove specificity - $selector = substr($selector, strpos($selector, ' ')); - // check if this selector apply to current tag - if ($this->isValidCSSSelectorForTag($dom, $key, $selector)) { - // apply style - $tagstyle .= ';'.$style; - } - } - if (isset($dom[$key]['attribute']['style'])) { - // attach inline style (latest properties have high priority) - $tagstyle .= ';'.$dom[$key]['attribute']['style']; - } - // remove multiple semicolons - $tagstyle = preg_replace('/[;]+/', ';', $tagstyle); - return $tagstyle; - } - - /** - * Returns the border width from CSS property - * @param string $width border width - * @return int with in user units - * @access protected - * @since 5.7.000 (2010-08-02) - */ - protected function getCSSBorderWidth($width) { - if ($width == 'thin') { - $width = (2 / $this->k); - } elseif ($width == 'medium') { - $width = (4 / $this->k); - } elseif ($width == 'thick') { - $width = (6 / $this->k); - } else { - $width = $this->getHTMLUnitToUnits($width, 1, 'px', false); - } - return $width; - } - - /** - * Returns the border dash style from CSS property - * @param string $style border style to convert - * @return int sash style (return -1 in case of none or hidden border) - * @access protected - * @since 5.7.000 (2010-08-02) - */ - protected function getCSSBorderDashStyle($style) { - switch (strtolower($style)) { - case 'none': - case 'hidden': { - $dash = -1; - break; - } - case 'dotted': { - $dash = 1; - break; - } - case 'dashed': { - $dash = 3; - break; - } - case 'double': - case 'groove': - case 'ridge': - case 'inset': - case 'outset': - case 'solid': - default: { - $dash = 0; - break; - } - } - return $dash; - } - - /** - * Returns the border style array from CSS border properties - * @param string $cssborder border properties - * @return array containing border properties - * @access protected - * @since 5.7.000 (2010-08-02) - */ - protected function getCSSBorderStyle($cssborder) { - $bprop = preg_split('/[\s]+/', trim($cssborder)); - $border = array(); // value to be returned - switch (count($bprop)) { - case 3: { - $width = $bprop[0]; - $style = $bprop[1]; - $color = $bprop[2]; - break; - } - case 2: { - $width = 'medium'; - $style = $bprop[0]; - $color = $bprop[1]; - break; - } - case 1: { - $width = 'medium'; - $style = $bprop[0]; - $color = 'black'; - break; - } - default: { - $width = 'medium'; - $style = 'solid'; - $color = 'black'; - break; - } - } - if ($style == 'none') { - return array(); - } - $border['cap'] = 'square'; - $border['join'] = 'miter'; - $border['dash'] = $this->getCSSBorderDashStyle($style); - if ($border['dash'] < 0) { - return array(); - } - $border['width'] = $this->getCSSBorderWidth($width); - $border['color'] = $this->convertHTMLColorToDec($color); - return $border; - } - - /** - * Get the internal Cell padding from CSS attribute. - * @param string $csspadding padding properties - * @param float $width width of the containing element - * @access public - * @since 5.9.000 (2010-10-04) - */ - public function getCSSPadding($csspadding, $width=0) { - $padding = preg_split('/[\s]+/', trim($csspadding)); - $cell_padding = array(); // value to be returned - switch (count($padding)) { - case 4: { - $cell_padding['T'] = $padding[0]; - $cell_padding['R'] = $padding[1]; - $cell_padding['B'] = $padding[2]; - $cell_padding['L'] = $padding[3]; - break; - } - case 3: { - $cell_padding['T'] = $padding[0]; - $cell_padding['R'] = $padding[1]; - $cell_padding['B'] = $padding[2]; - $cell_padding['L'] = $padding[1]; - break; - } - case 2: { - $cell_padding['T'] = $padding[0]; - $cell_padding['R'] = $padding[1]; - $cell_padding['B'] = $padding[0]; - $cell_padding['L'] = $padding[1]; - break; - } - case 1: { - $cell_padding['T'] = $padding[0]; - $cell_padding['R'] = $padding[0]; - $cell_padding['B'] = $padding[0]; - $cell_padding['L'] = $padding[0]; - break; - } - default: { - return $this->cell_padding; - } - } - if ($width == 0) { - $width = $this->w - $this->lMargin - $this->rMargin; - } - $cell_padding['T'] = $this->getHTMLUnitToUnits($cell_padding['T'], $width, 'px', false); - $cell_padding['R'] = $this->getHTMLUnitToUnits($cell_padding['R'], $width, 'px', false); - $cell_padding['B'] = $this->getHTMLUnitToUnits($cell_padding['B'], $width, 'px', false); - $cell_padding['L'] = $this->getHTMLUnitToUnits($cell_padding['L'], $width, 'px', false); - return $cell_padding; - } - - /** - * Get the internal Cell margin from CSS attribute. - * @param string $cssmargin margin properties - * @param float $width width of the containing element - * @access public - * @since 5.9.000 (2010-10-04) - */ - public function getCSSMargin($cssmargin, $width=0) { - $margin = preg_split('/[\s]+/', trim($cssmargin)); - $cell_margin = array(); // value to be returned - switch (count($margin)) { - case 4: { - $cell_margin['T'] = $margin[0]; - $cell_margin['R'] = $margin[1]; - $cell_margin['B'] = $margin[2]; - $cell_margin['L'] = $margin[3]; - break; - } - case 3: { - $cell_margin['T'] = $margin[0]; - $cell_margin['R'] = $margin[1]; - $cell_margin['B'] = $margin[2]; - $cell_margin['L'] = $margin[1]; - break; - } - case 2: { - $cell_margin['T'] = $margin[0]; - $cell_margin['R'] = $margin[1]; - $cell_margin['B'] = $margin[0]; - $cell_margin['L'] = $margin[1]; - break; - } - case 1: { - $cell_margin['T'] = $margin[0]; - $cell_margin['R'] = $margin[0]; - $cell_margin['B'] = $margin[0]; - $cell_margin['L'] = $margin[0]; - break; - } - default: { - return $this->cell_margin; - } - } - if ($width == 0) { - $width = $this->w - $this->lMargin - $this->rMargin; - } - $cell_margin['T'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['T']), $width, 'px', false); - $cell_margin['R'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['R']), $width, 'px', false); - $cell_margin['B'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['B']), $width, 'px', false); - $cell_margin['L'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['L']), $width, 'px', false); - return $cell_margin; - } - - /** - * Returns the letter-spacing value from CSS value - * @param string $spacing letter-spacing value - * @param float $parent font spacing (tracking/kerning) value of the parent element - * @return float quantity to increases or decreases the space between characters in a text. - * @access protected - * @since 5.9.000 (2010-10-02) - */ - protected function getCSSFontSpacing($spacing, $parent=0) { - $val = 0; // value to be returned - $spacing = trim($spacing); - switch ($spacing) { - case 'normal': { - $val = 0; - break; - } - case 'inherit': { - if ($parent == 'normal') { - $val = 0; - } else { - $val = $parent; - } - break; - } - default: { - $val = $this->getHTMLUnitToUnits($spacing, 0, 'px', false); - } - } - return $val; - } - - /** - * Returns the percentage of font stretching from CSS value - * @param string $stretch stretch mode - * @param float $parent stretch value of the parent element - * @return float font stretching percentage - * @access protected - * @since 5.9.000 (2010-10-02) - */ - protected function getCSSFontStretching($stretch, $parent=100) { - $val = 100; // value to be returned - $stretch = trim($stretch); - switch ($stretch) { - case 'ultra-condensed': { - $val = 40; - break; - } - case 'extra-condensed': { - $val = 55; - break; - } - case 'condensed': { - $val = 70; - break; - } - case 'semi-condensed': { - $val = 85; - break; - } - case 'normal': { - $val = 100; - break; - } - case 'semi-expanded': { - $val = 115; - break; - } - case 'expanded': { - $val = 130; - break; - } - case 'extra-expanded': { - $val = 145; - break; - } - case 'ultra-expanded': { - $val = 160; - break; - } - case 'wider': { - $val = $parent + 10; - break; - } - case 'narrower': { - $val = $parent - 10; - break; - } - case 'inherit': { - if ($parent == 'normal') { - $val = 100; - } else { - $val = $parent; - } - break; - } - default: { - $val = $this->getHTMLUnitToUnits($stretch, 100, '%', false); - } - } - return $val; - } - - /** - * Returns the HTML DOM array. - * @param string $html html code - * @return array - * @access protected - * @since 3.2.000 (2008-06-20) - */ - protected function getHtmlDomArray($html) { - // array of CSS styles ( selector => properties). - $css = array(); - // get CSS array defined at previous call - $matches = array(); - if (preg_match_all('/<cssarray>([^\<]*)<\/cssarray>/isU', $html, $matches) > 0) { - if (isset($matches[1][0])) { - $css = array_merge($css, unserialize($this->unhtmlentities($matches[1][0]))); - } - $html = preg_replace('/<cssarray>(.*?)<\/cssarray>/isU', '', $html); - } - // extract external CSS files - $matches = array(); - if (preg_match_all('/<link([^\>]*)>/isU', $html, $matches) > 0) { - foreach ($matches[1] as $key => $link) { - $type = array(); - if (preg_match('/type[\s]*=[\s]*"text\/css"/', $link, $type)) { - $type = array(); - preg_match('/media[\s]*=[\s]*"([^"]*)"/', $link, $type); - // get 'all' and 'print' media, other media types are discarded - // (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) - if (empty($type) OR (isset($type[1]) AND (($type[1] == 'all') OR ($type[1] == 'print')))) { - $type = array(); - if (preg_match('/href[\s]*=[\s]*"([^"]*)"/', $link, $type) > 0) { - // read CSS data file - $cssdata = file_get_contents(trim($type[1])); - $css = array_merge($css, $this->extractCSSproperties($cssdata)); - } - } - } - } - } - // extract style tags - $matches = array(); - if (preg_match_all('/<style([^\>]*)>([^\<]*)<\/style>/isU', $html, $matches) > 0) { - foreach ($matches[1] as $key => $media) { - $type = array(); - preg_match('/media[\s]*=[\s]*"([^"]*)"/', $media, $type); - // get 'all' and 'print' media, other media types are discarded - // (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) - if (empty($type) OR (isset($type[1]) AND (($type[1] == 'all') OR ($type[1] == 'print')))) { - $cssdata = $matches[2][$key]; - $css = array_merge($css, $this->extractCSSproperties($cssdata)); - } - } - } - // create a special tag to contain the CSS array (used for table content) - $csstagarray = '<cssarray>'.htmlentities(serialize($css)).'</cssarray>'; - // remove head and style blocks - $html = preg_replace('/<head([^\>]*)>(.*?)<\/head>/siU', '', $html); - $html = preg_replace('/<style([^\>]*)>([^\<]*)<\/style>/isU', '', $html); - // define block tags - $blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td'); - // define self-closing tags - $selfclosingtags = array('area','base','basefont','br','hr','input','img','link','meta'); - // remove all unsupported tags (the line below lists all supported tags) - $html = strip_tags($html, '<marker/><a><b><blockquote><body><br><br/><dd><del><div><dl><dt><em><font><form><h1><h2><h3><h4><h5><h6><hr><hr/><i><img><input><label><li><ol><option><p><pre><s><select><small><span><strike><strong><sub><sup><table><tablehead><tcpdf><td><textarea><th><thead><tr><tt><u><ul>'); - //replace some blank characters - $html = preg_replace('/<pre/', '<xre', $html); // preserve pre tag - $html = preg_replace('/<(table|tr|td|th|tcpdf|blockquote|dd|div|dl|dt|form|h1|h2|h3|h4|h5|h6|br|hr|li|ol|ul|p)([^\>]*)>[\n\r\t]+/', '<\\1\\2>', $html); - $html = preg_replace('@(\r\n|\r)@', "\n", $html); - $repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\"); - $html = strtr($html, $repTable); - $offset = 0; - while (($offset < strlen($html)) AND ($pos = strpos($html, '</pre>', $offset)) !== false) { - $html_a = substr($html, 0, $offset); - $html_b = substr($html, $offset, ($pos - $offset + 6)); - while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html_b)) { - // preserve newlines on <pre> tag - $html_b = preg_replace("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", "<xre\\1>\\2<br />\\3</pre>", $html_b); - } - while (preg_match("'<xre([^\>]*)>(.*?)".$this->re_space['p']."(.*?)</pre>'".$this->re_space['m'], $html_b)) { - // preserve spaces on <pre> tag - $html_b = preg_replace("'<xre([^\>]*)>(.*?)".$this->re_space['p']."(.*?)</pre>'".$this->re_space['m'], "<xre\\1>\\2&nbsp;\\3</pre>", $html_b); - } - $html = $html_a.$html_b.substr($html, $pos + 6); - $offset = strlen($html_a.$html_b); - } - $offset = 0; - while (($offset < strlen($html)) AND ($pos = strpos($html, '</textarea>', $offset)) !== false) { - $html_a = substr($html, 0, $offset); - $html_b = substr($html, $offset, ($pos - $offset + 11)); - while (preg_match("'<textarea([^\>]*)>(.*?)\n(.*?)</textarea>'si", $html_b)) { - // preserve newlines on <textarea> tag - $html_b = preg_replace("'<textarea([^\>]*)>(.*?)\n(.*?)</textarea>'si", "<textarea\\1>\\2<TBR>\\3</textarea>", $html_b); - $html_b = preg_replace("'<textarea([^\>]*)>(.*?)[\"](.*?)</textarea>'si", "<textarea\\1>\\2''\\3</textarea>", $html_b); - } - $html = $html_a.$html_b.substr($html, $pos + 11); - $offset = strlen($html_a.$html_b); - } - $html = preg_replace('/([\s]*)<option/si', '<option', $html); - $html = preg_replace('/<\/option>([\s]*)/si', '</option>', $html); - $offset = 0; - while (($offset < strlen($html)) AND ($pos = strpos($html, '</option>', $offset)) !== false) { - $html_a = substr($html, 0, $offset); - $html_b = substr($html, $offset, ($pos - $offset + 9)); - while (preg_match("'<option([^\>]*)>(.*?)</option>'si", $html_b)) { - $html_b = preg_replace("'<option([\s]+)value=\"([^\"]*)\"([^\>]*)>(.*?)</option>'si", "\\2#!TaB!#\\4#!NwL!#", $html_b); - $html_b = preg_replace("'<option([^\>]*)>(.*?)</option>'si", "\\2#!NwL!#", $html_b); - } - $html = $html_a.$html_b.substr($html, $pos + 9); - $offset = strlen($html_a.$html_b); - } - if (preg_match("'</select'si", $html)) { - $html = preg_replace("'<select([^\>]*)>'si", "<select\\1 opt=\"", $html); - $html = preg_replace("'#!NwL!#</select>'si", "\" />", $html); - } - $html = str_replace("\n", ' ', $html); - // restore textarea newlines - $html = str_replace('<TBR>', "\n", $html); - // remove extra spaces from code - $html = preg_replace('/[\s]+<\/(table|tr|ul|ol|dl)>/', '</\\1>', $html); - $html = preg_replace('/'.$this->re_space['p'].'+<\/(td|th|li|dt|dd)>/'.$this->re_space['m'], '</\\1>', $html); - $html = preg_replace('/[\s]+<(tr|td|th|li|dt|dd)/', '<\\1', $html); - $html = preg_replace('/'.$this->re_space['p'].'+<(ul|ol|dl|br)/'.$this->re_space['m'], '<\\1', $html); - $html = preg_replace('/<\/(table|tr|td|th|blockquote|dd|dt|dl|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|ul|p)>[\s]+</', '</\\1><', $html); - $html = preg_replace('/<\/(td|th)>/', '<marker style="font-size:0"/></\\1>', $html); - $html = preg_replace('/<\/table>([\s]*)<marker style="font-size:0"\/>/', '</table>', $html); - $html = preg_replace('/'.$this->re_space['p'].'+<img/'.$this->re_space['m'], chr(32).'<img', $html); - $html = preg_replace('/<img([^\>]*)>/xi', '<img\\1><span><marker style="font-size:0"/></span>', $html); - $html = preg_replace('/<xre/', '<pre', $html); // restore pre tag - $html = preg_replace('/<textarea([^\>]*)>([^\<]*)<\/textarea>/xi', '<textarea\\1 value="\\2" />', $html); - $html = preg_replace('/<li([^\>]*)><\/li>/', '<li\\1>&nbsp;</li>', $html); - $html = preg_replace('/<li([^\>]*)>'.$this->re_space['p'].'*<img/'.$this->re_space['m'], '<li\\1><font size="1">&nbsp;</font><img', $html); - $html = preg_replace('/<([^\>\/]*)>[\s]/', '<\\1>&nbsp;', $html); // preserve some spaces - $html = preg_replace('/[\s]<\/([^\>]*)>/', '&nbsp;</\\1>', $html); // preserve some spaces - $html = preg_replace('/'.$this->re_space['p'].'+/'.$this->re_space['m'], chr(32), $html); // replace multiple spaces with a single space - // trim string - $html = $this->stringTrim($html); - // pattern for generic tag - $tagpattern = '/(<[^>]+>)/'; - // explodes the string - $a = preg_split($tagpattern, $html, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - // count elements - $maxel = count($a); - $elkey = 0; - $key = 0; - // create an array of elements - $dom = array(); - $dom[$key] = array(); - // set inheritable properties fot the first void element - // possible inheritable properties are: azimuth, border-collapse, border-spacing, caption-side, color, cursor, direction, empty-cells, font, font-family, font-stretch, font-size, font-size-adjust, font-style, font-variant, font-weight, letter-spacing, line-height, list-style, list-style-image, list-style-position, list-style-type, orphans, page, page-break-inside, quotes, speak, speak-header, text-align, text-indent, text-transform, volume, white-space, widows, word-spacing - $dom[$key]['tag'] = false; - $dom[$key]['block'] = false; - $dom[$key]['value'] = ''; - $dom[$key]['parent'] = 0; - $dom[$key]['fontname'] = $this->FontFamily; - $dom[$key]['fontstyle'] = $this->FontStyle; - $dom[$key]['fontsize'] = $this->FontSizePt; - $dom[$key]['font-stretch'] = 100; - $dom[$key]['letter-spacing'] = 0; - $dom[$key]['stroke'] = $this->textstrokewidth; - $dom[$key]['fill'] = (($this->textrendermode % 2) == 0); - $dom[$key]['clip'] = ($this->textrendermode > 3); - $dom[$key]['line-height'] = $this->cell_height_ratio; - $dom[$key]['bgcolor'] = false; - $dom[$key]['fgcolor'] = $this->fgcolor; // color - $dom[$key]['strokecolor'] = $this->strokecolor; - $dom[$key]['align'] = ''; - $dom[$key]['listtype'] = ''; - $dom[$key]['text-indent'] = 0; - $dom[$key]['border'] = array(); - $dom[$key]['dir'] = $this->rtl?'rtl':'ltr'; - $thead = false; // true when we are inside the THEAD tag - ++$key; - $level = array(); - array_push($level, 0); // root - while ($elkey < $maxel) { - $dom[$key] = array(); - $element = $a[$elkey]; - $dom[$key]['elkey'] = $elkey; - if (preg_match($tagpattern, $element)) { - // html tag - $element = substr($element, 1, -1); - // get tag name - preg_match('/[\/]?([a-zA-Z0-9]*)/', $element, $tag); - $tagname = strtolower($tag[1]); - // check if we are inside a table header - if ($tagname == 'thead') { - if ($element{0} == '/') { - $thead = false; - } else { - $thead = true; - } - ++$elkey; - continue; - } - $dom[$key]['tag'] = true; - $dom[$key]['value'] = $tagname; - if (in_array($dom[$key]['value'], $blocktags)) { - $dom[$key]['block'] = true; - } else { - $dom[$key]['block'] = false; - } - if ($element{0} == '/') { - // *** closing html tag - $dom[$key]['opening'] = false; - $dom[$key]['parent'] = end($level); - array_pop($level); - $dom[$key]['fontname'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontname']; - $dom[$key]['fontstyle'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontstyle']; - $dom[$key]['fontsize'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontsize']; - $dom[$key]['font-stretch'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['font-stretch']; - $dom[$key]['letter-spacing'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['letter-spacing']; - $dom[$key]['stroke'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['stroke']; - $dom[$key]['fill'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fill']; - $dom[$key]['clip'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['clip']; - $dom[$key]['line-height'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['line-height']; - $dom[$key]['bgcolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['bgcolor']; - $dom[$key]['fgcolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fgcolor']; - $dom[$key]['strokecolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['strokecolor']; - $dom[$key]['align'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['align']; - $dom[$key]['dir'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['dir']; - if (isset($dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype'])) { - $dom[$key]['listtype'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype']; - } - // set the number of columns in table tag - if (($dom[$key]['value'] == 'tr') AND (!isset($dom[($dom[($dom[$key]['parent'])]['parent'])]['cols']))) { - $dom[($dom[($dom[$key]['parent'])]['parent'])]['cols'] = $dom[($dom[$key]['parent'])]['cols']; - } - if (($dom[$key]['value'] == 'td') OR ($dom[$key]['value'] == 'th')) { - $dom[($dom[$key]['parent'])]['content'] = $csstagarray; - for ($i = ($dom[$key]['parent'] + 1); $i < $key; ++$i) { - $dom[($dom[$key]['parent'])]['content'] .= $a[$dom[$i]['elkey']]; - } - $key = $i; - $parent_table = $dom[$dom[$dom[($dom[$key]['parent'])]['parent']]['parent']]; - $parent_padding = 0; - $parent_spacing = 0; - if (isset($parent_table['attribute']['cellpadding'])) { - $parent_padding = $this->getHTMLUnitToUnits($parent_table['attribute']['cellpadding'], 1, 'px'); - } - if (isset($parent_table['attribute']['cellspacing'])) { - $parent_spacing = $this->getHTMLUnitToUnits($parent_table['attribute']['cellspacing'], 1, 'px'); - } - // mark nested tables - $dom[($dom[$key]['parent'])]['content'] = str_replace('<table', '<table nested="true" pcellpadding="'.$parent_padding.'" pcellspacing="'.$parent_spacing.'"', $dom[($dom[$key]['parent'])]['content']); - // remove thead sections from nested tables - $dom[($dom[$key]['parent'])]['content'] = str_replace('<thead>', '', $dom[($dom[$key]['parent'])]['content']); - $dom[($dom[$key]['parent'])]['content'] = str_replace('</thead>', '', $dom[($dom[$key]['parent'])]['content']); - } - // store header rows on a new table - if (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['thead'] === true)) { - if ($this->empty_string($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) { - $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] = $a[$dom[($dom[($dom[$key]['parent'])]['parent'])]['elkey']]; - } - for ($i = $dom[$key]['parent']; $i <= $key; ++$i) { - $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] .= $a[$dom[$i]['elkey']]; - } - if (!isset($dom[($dom[$key]['parent'])]['attribute'])) { - $dom[($dom[$key]['parent'])]['attribute'] = array(); - } - // header elements must be always contained in a single page - $dom[($dom[$key]['parent'])]['attribute']['nobr'] = 'true'; - } - if (($dom[$key]['value'] == 'table') AND (!$this->empty_string($dom[($dom[$key]['parent'])]['thead']))) { - // remove the nobr attributes from the table header - $dom[($dom[$key]['parent'])]['thead'] = str_replace(' nobr="true"', '', $dom[($dom[$key]['parent'])]['thead']); - $dom[($dom[$key]['parent'])]['thead'] .= '</tablehead>'; - } - } else { - // *** opening or self-closing html tag - $dom[$key]['opening'] = true; - $dom[$key]['parent'] = end($level); - if ((substr($element, -1, 1) == '/') OR (in_array($dom[$key]['value'], $selfclosingtags))) { - // self-closing tag - $dom[$key]['self'] = true; - } else { - // opening tag - array_push($level, $key); - $dom[$key]['self'] = false; - } - // copy some values from parent - $parentkey = 0; - if ($key > 0) { - $parentkey = $dom[$key]['parent']; - $dom[$key]['fontname'] = $dom[$parentkey]['fontname']; - $dom[$key]['fontstyle'] = $dom[$parentkey]['fontstyle']; - $dom[$key]['fontsize'] = $dom[$parentkey]['fontsize']; - $dom[$key]['font-stretch'] = $dom[$parentkey]['font-stretch']; - $dom[$key]['letter-spacing'] = $dom[$parentkey]['letter-spacing']; - $dom[$key]['stroke'] = $dom[$parentkey]['stroke']; - $dom[$key]['fill'] = $dom[$parentkey]['fill']; - $dom[$key]['clip'] = $dom[$parentkey]['clip']; - $dom[$key]['line-height'] = $dom[$parentkey]['line-height']; - $dom[$key]['bgcolor'] = $dom[$parentkey]['bgcolor']; - $dom[$key]['fgcolor'] = $dom[$parentkey]['fgcolor']; - $dom[$key]['strokecolor'] = $dom[$parentkey]['strokecolor']; - $dom[$key]['align'] = $dom[$parentkey]['align']; - $dom[$key]['listtype'] = $dom[$parentkey]['listtype']; - $dom[$key]['text-indent'] = $dom[$parentkey]['text-indent']; - $dom[$key]['border'] = array(); - $dom[$key]['dir'] = $dom[$parentkey]['dir']; - } - // get attributes - preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER); - $dom[$key]['attribute'] = array(); // reset attribute array - while (list($id, $name) = each($attr_array[1])) { - $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; - } - if (!empty($css)) { - // merge eternal CSS style to current style - $dom[$key]['attribute']['style'] = $this->getTagStyleFromCSS($dom, $key, $css); - } - // split style attributes - if (isset($dom[$key]['attribute']['style']) AND !empty($dom[$key]['attribute']['style'])) { - // get style attributes - preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER); - $dom[$key]['style'] = array(); // reset style attribute array - while (list($id, $name) = each($style_array[1])) { - // in case of duplicate attribute the last replace the previous - $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); - } - // --- get some style attributes --- - // text direction - if (isset($dom[$key]['style']['direction'])) { - $dom[$key]['dir'] = $dom[$key]['style']['direction']; - } - // font family - if (isset($dom[$key]['style']['font-family'])) { - $dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['style']['font-family']); - } - // list-style-type - if (isset($dom[$key]['style']['list-style-type'])) { - $dom[$key]['listtype'] = trim(strtolower($dom[$key]['style']['list-style-type'])); - if ($dom[$key]['listtype'] == 'inherit') { - $dom[$key]['listtype'] = $dom[$parentkey]['listtype']; - } - } - // text-indent - if (isset($dom[$key]['style']['text-indent'])) { - $dom[$key]['text-indent'] = $this->getHTMLUnitToUnits($dom[$key]['style']['text-indent']); - if ($dom[$key]['text-indent'] == 'inherit') { - $dom[$key]['text-indent'] = $dom[$parentkey]['text-indent']; - } - } - // font size - if (isset($dom[$key]['style']['font-size'])) { - $fsize = trim($dom[$key]['style']['font-size']); - switch ($fsize) { - // absolute-size - case 'xx-small': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] - 4; - break; - } - case 'x-small': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] - 3; - break; - } - case 'small': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] - 2; - break; - } - case 'medium': { - $dom[$key]['fontsize'] = $dom[0]['fontsize']; - break; - } - case 'large': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] + 2; - break; - } - case 'x-large': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] + 4; - break; - } - case 'xx-large': { - $dom[$key]['fontsize'] = $dom[0]['fontsize'] + 6; - break; - } - // relative-size - case 'smaller': { - $dom[$key]['fontsize'] = $dom[$parentkey]['fontsize'] - 3; - break; - } - case 'larger': { - $dom[$key]['fontsize'] = $dom[$parentkey]['fontsize'] + 3; - break; - } - default: { - $dom[$key]['fontsize'] = $this->getHTMLUnitToUnits($fsize, $dom[$parentkey]['fontsize'], 'pt', true); - } - } - } - // font-stretch - if (isset($dom[$key]['style']['font-stretch'])) { - $dom[$key]['font-stretch'] = $this->getCSSFontStretching($dom[$key]['style']['font-stretch'], $dom[$parentkey]['font-stretch']); - } - // letter-spacing - if (isset($dom[$key]['style']['letter-spacing'])) { - $dom[$key]['letter-spacing'] = $this->getCSSFontSpacing($dom[$key]['style']['letter-spacing'], $dom[$parentkey]['letter-spacing']); - } - // line-height - if (isset($dom[$key]['style']['line-height'])) { - $lineheight = trim($dom[$key]['style']['line-height']); - switch ($lineheight) { - // A normal line height. This is default - case 'normal': { - $dom[$key]['line-height'] = $dom[0]['line-height']; - break; - } - default: { - if (is_numeric($lineheight)) { - $lineheight = $lineheight * 100; - } - $dom[$key]['line-height'] = $this->getHTMLUnitToUnits($lineheight, 1, '%', true); - } - } - } - // font style - if (isset($dom[$key]['style']['font-weight']) AND (strtolower($dom[$key]['style']['font-weight']{0}) == 'b')) { - $dom[$key]['fontstyle'] .= 'B'; - } - if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style']{0}) == 'i')) { - $dom[$key]['fontstyle'] .= 'I'; - } - // font color - if (isset($dom[$key]['style']['color']) AND (!$this->empty_string($dom[$key]['style']['color']))) { - $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['style']['color']); - } elseif ($dom[$key]['value'] == 'a') { - $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; - } - // background color - if (isset($dom[$key]['style']['background-color']) AND (!$this->empty_string($dom[$key]['style']['background-color']))) { - $dom[$key]['bgcolor'] = $this->convertHTMLColorToDec($dom[$key]['style']['background-color']); - } - // text-decoration - if (isset($dom[$key]['style']['text-decoration'])) { - $decors = explode(' ', strtolower($dom[$key]['style']['text-decoration'])); - foreach ($decors as $dec) { - $dec = trim($dec); - if (!$this->empty_string($dec)) { - if ($dec{0} == 'u') { - // underline - $dom[$key]['fontstyle'] .= 'U'; - } elseif ($dec{0} == 'l') { - // line-trough - $dom[$key]['fontstyle'] .= 'D'; - } elseif ($dec{0} == 'o') { - // overline - $dom[$key]['fontstyle'] .= 'O'; - } - } - } - } elseif ($dom[$key]['value'] == 'a') { - $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; - } - // check for width attribute - if (isset($dom[$key]['style']['width'])) { - $dom[$key]['width'] = $dom[$key]['style']['width']; - } - // check for height attribute - if (isset($dom[$key]['style']['height'])) { - $dom[$key]['height'] = $dom[$key]['style']['height']; - } - // check for text alignment - if (isset($dom[$key]['style']['text-align'])) { - $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align']{0}); - } - // check for CSS border properties - if (isset($dom[$key]['style']['border'])) { - $borderstyle = $this->getCSSBorderStyle($dom[$key]['style']['border']); - if (!empty($borderstyle)) { - $dom[$key]['border']['LTRB'] = $borderstyle; - } - } - if (isset($dom[$key]['style']['border-color'])) { - $brd_colors = preg_split('/[\s]+/', trim($dom[$key]['style']['border-color'])); - if (isset($brd_colors[3])) { - $dom[$key]['border']['L']['color'] = $this->convertHTMLColorToDec($brd_colors[3]); - } - if (isset($brd_colors[1])) { - $dom[$key]['border']['R']['color'] = $this->convertHTMLColorToDec($brd_colors[1]); - } - if (isset($brd_colors[0])) { - $dom[$key]['border']['T']['color'] = $this->convertHTMLColorToDec($brd_colors[0]); - } - if (isset($brd_colors[2])) { - $dom[$key]['border']['B']['color'] = $this->convertHTMLColorToDec($brd_colors[2]); - } - } - if (isset($dom[$key]['style']['border-width'])) { - $brd_widths = preg_split('/[\s]+/', trim($dom[$key]['style']['border-width'])); - if (isset($brd_widths[3])) { - $dom[$key]['border']['L']['width'] = $this->getCSSBorderWidth($brd_widths[3]); - } - if (isset($brd_widths[1])) { - $dom[$key]['border']['R']['width'] = $this->getCSSBorderWidth($brd_widths[1]); - } - if (isset($brd_widths[0])) { - $dom[$key]['border']['T']['width'] = $this->getCSSBorderWidth($brd_widths[0]); - } - if (isset($brd_widths[2])) { - $dom[$key]['border']['B']['width'] = $this->getCSSBorderWidth($brd_widths[2]); - } - } - if (isset($dom[$key]['style']['border-style'])) { - $brd_styles = preg_split('/[\s]+/', trim($dom[$key]['style']['border-style'])); - if (isset($brd_styles[3])) { - $dom[$key]['border']['L']['cap'] = 'square'; - $dom[$key]['border']['L']['join'] = 'miter'; - $dom[$key]['border']['L']['dash'] = $this->getCSSBorderDashStyle($brd_styles[3]); - if ($dom[$key]['border']['L']['dash'] < 0) { - $dom[$key]['border']['L'] = array(); - } - } - if (isset($brd_styles[1])) { - $dom[$key]['border']['R']['cap'] = 'square'; - $dom[$key]['border']['R']['join'] = 'miter'; - $dom[$key]['border']['R']['dash'] = $this->getCSSBorderDashStyle($brd_styles[1]); - if ($dom[$key]['border']['R']['dash'] < 0) { - $dom[$key]['border']['R'] = array(); - } - } - if (isset($brd_styles[0])) { - $dom[$key]['border']['T']['cap'] = 'square'; - $dom[$key]['border']['T']['join'] = 'miter'; - $dom[$key]['border']['T']['dash'] = $this->getCSSBorderDashStyle($brd_styles[0]); - if ($dom[$key]['border']['T']['dash'] < 0) { - $dom[$key]['border']['T'] = array(); - } - } - if (isset($brd_styles[2])) { - $dom[$key]['border']['B']['cap'] = 'square'; - $dom[$key]['border']['B']['join'] = 'miter'; - $dom[$key]['border']['B']['dash'] = $this->getCSSBorderDashStyle($brd_styles[2]); - if ($dom[$key]['border']['B']['dash'] < 0) { - $dom[$key]['border']['B'] = array(); - } - } - } - $cellside = array('L' => 'left', 'R' => 'right', 'T' => 'top', 'B' => 'bottom'); - foreach ($cellside as $bsk => $bsv) { - if (isset($dom[$key]['style']['border-'.$bsv])) { - $borderstyle = $this->getCSSBorderStyle($dom[$key]['style']['border-'.$bsv]); - if (!empty($borderstyle)) { - $dom[$key]['border'][$bsk] = $borderstyle; - } - } - if (isset($dom[$key]['style']['border-'.$bsv.'-color'])) { - $dom[$key]['border'][$bsk]['color'] = $this->convertHTMLColorToDec($dom[$key]['style']['border-'.$bsv.'-color']); - } - if (isset($dom[$key]['style']['border-'.$bsv.'-width'])) { - $dom[$key]['border'][$bsk]['width'] = $this->getCSSBorderWidth($dom[$key]['style']['border-'.$bsv.'-width']); - } - if (isset($dom[$key]['style']['border-'.$bsv.'-style'])) { - $dom[$key]['border'][$bsk]['dash'] = $this->getCSSBorderDashStyle($dom[$key]['style']['border-'.$bsv.'-style']); - if ($dom[$key]['border'][$bsk]['dash'] < 0) { - $dom[$key]['border'][$bsk] = array(); - } - } - } - // check for CSS padding properties - if (isset($dom[$key]['style']['padding'])) { - $dom[$key]['padding'] = $this->getCSSPadding($dom[$key]['style']['padding']); - } else { - $dom[$key]['padding'] = $this->cell_padding; - } - foreach ($cellside as $psk => $psv) { - if (isset($dom[$key]['style']['padding-'.$psv])) { - $dom[$key]['padding'][$psk] = $this->getHTMLUnitToUnits($dom[$key]['style']['padding-'.$psv], 0, 'px', false); - } - } - // check for CSS margin properties - if (isset($dom[$key]['style']['margin'])) { - $dom[$key]['margin'] = $this->getCSSMargin($dom[$key]['style']['margin']); - } else { - $dom[$key]['margin'] = $this->cell_margin; - } - foreach ($cellside as $psk => $psv) { - if (isset($dom[$key]['style']['margin-'.$psv])) { - $dom[$key]['margin'][$psk] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $dom[$key]['style']['margin-'.$psv]), 0, 'px', false); - } - } - // page-break-inside - if (isset($dom[$key]['style']['page-break-inside']) AND ($dom[$key]['style']['page-break-inside'] == 'avoid')) { - $dom[$key]['attribute']['nobr'] = 'true'; - } - // page-break-before - if (isset($dom[$key]['style']['page-break-before'])) { - if ($dom[$key]['style']['page-break-before'] == 'always') { - $dom[$key]['attribute']['pagebreak'] = 'true'; - } elseif ($dom[$key]['style']['page-break-before'] == 'left') { - $dom[$key]['attribute']['pagebreak'] = 'left'; - } elseif ($dom[$key]['style']['page-break-before'] == 'right') { - $dom[$key]['attribute']['pagebreak'] = 'right'; - } - } - // page-break-after - if (isset($dom[$key]['style']['page-break-after'])) { - if ($dom[$key]['style']['page-break-after'] == 'always') { - $dom[$key]['attribute']['pagebreakafter'] = 'true'; - } elseif ($dom[$key]['style']['page-break-after'] == 'left') { - $dom[$key]['attribute']['pagebreakafter'] = 'left'; - } elseif ($dom[$key]['style']['page-break-after'] == 'right') { - $dom[$key]['attribute']['pagebreakafter'] = 'right'; - } - } - } - if (isset($dom[$key]['attribute']['border']) AND ($dom[$key]['attribute']['border'] != 0)) { - $borderstyle = $this->getCSSBorderStyle($dom[$key]['attribute']['border'].' solid black'); - if (!empty($borderstyle)) { - $dom[$key]['border']['LTRB'] = $borderstyle; - } - } - // check for font tag - if ($dom[$key]['value'] == 'font') { - // font family - if (isset($dom[$key]['attribute']['face'])) { - $dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['attribute']['face']); - } - // font size - if (isset($dom[$key]['attribute']['size'])) { - if ($key > 0) { - if ($dom[$key]['attribute']['size']{0} == '+') { - $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1)); - } elseif ($dom[$key]['attribute']['size']{0} == '-') { - $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1)); - } else { - $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); - } - } else { - $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); - } - } - } - // force natural alignment for lists - if ((($dom[$key]['value'] == 'ul') OR ($dom[$key]['value'] == 'ol') OR ($dom[$key]['value'] == 'dl')) - AND (!isset($dom[$key]['align']) OR $this->empty_string($dom[$key]['align']) OR ($dom[$key]['align'] != 'J'))) { - if ($this->rtl) { - $dom[$key]['align'] = 'R'; - } else { - $dom[$key]['align'] = 'L'; - } - } - if (($dom[$key]['value'] == 'small') OR ($dom[$key]['value'] == 'sup') OR ($dom[$key]['value'] == 'sub')) { - if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { - $dom[$key]['fontsize'] = $dom[$key]['fontsize'] * K_SMALL_RATIO; - } - } - if (($dom[$key]['value'] == 'strong') OR ($dom[$key]['value'] == 'b')) { - $dom[$key]['fontstyle'] .= 'B'; - } - if (($dom[$key]['value'] == 'em') OR ($dom[$key]['value'] == 'i')) { - $dom[$key]['fontstyle'] .= 'I'; - } - if ($dom[$key]['value'] == 'u') { - $dom[$key]['fontstyle'] .= 'U'; - } - if (($dom[$key]['value'] == 'del') OR ($dom[$key]['value'] == 's') OR ($dom[$key]['value'] == 'strike')) { - $dom[$key]['fontstyle'] .= 'D'; - } - if (!isset($dom[$key]['style']['text-decoration']) AND ($dom[$key]['value'] == 'a')) { - $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; - } - if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) { - $dom[$key]['fontname'] = $this->default_monospaced_font; - } - if (($dom[$key]['value']{0} == 'h') AND (intval($dom[$key]['value']{1}) > 0) AND (intval($dom[$key]['value']{1}) < 7)) { - // headings h1, h2, h3, h4, h5, h6 - if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { - $headsize = (4 - intval($dom[$key]['value']{1})) * 2; - $dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize; - } - if (!isset($dom[$key]['style']['font-weight'])) { - $dom[$key]['fontstyle'] .= 'B'; - } - } - if (($dom[$key]['value'] == 'table')) { - $dom[$key]['rows'] = 0; // number of rows - $dom[$key]['trids'] = array(); // IDs of TR elements - $dom[$key]['thead'] = ''; // table header rows - } - if (($dom[$key]['value'] == 'tr')) { - $dom[$key]['cols'] = 0; - if ($thead) { - $dom[$key]['thead'] = true; - // rows on thead block are printed as a separate table - } else { - $dom[$key]['thead'] = false; - // store the number of rows on table element - ++$dom[($dom[$key]['parent'])]['rows']; - // store the TR elements IDs on table element - array_push($dom[($dom[$key]['parent'])]['trids'], $key); - } - } - if (($dom[$key]['value'] == 'th') OR ($dom[$key]['value'] == 'td')) { - if (isset($dom[$key]['attribute']['colspan'])) { - $colspan = intval($dom[$key]['attribute']['colspan']); - } else { - $colspan = 1; - } - $dom[$key]['attribute']['colspan'] = $colspan; - $dom[($dom[$key]['parent'])]['cols'] += $colspan; - } - // text direction - if (isset($dom[$key]['attribute']['dir'])) { - $dom[$key]['dir'] = $dom[$key]['attribute']['dir']; - } - // set foreground color attribute - if (isset($dom[$key]['attribute']['color']) AND (!$this->empty_string($dom[$key]['attribute']['color']))) { - $dom[$key]['fgcolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['color']); - } elseif (!isset($dom[$key]['style']['color']) AND ($dom[$key]['value'] == 'a')) { - $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; - } - // set background color attribute - if (isset($dom[$key]['attribute']['bgcolor']) AND (!$this->empty_string($dom[$key]['attribute']['bgcolor']))) { - $dom[$key]['bgcolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['bgcolor']); - } - // set stroke color attribute - if (isset($dom[$key]['attribute']['strokecolor']) AND (!$this->empty_string($dom[$key]['attribute']['strokecolor']))) { - $dom[$key]['strokecolor'] = $this->convertHTMLColorToDec($dom[$key]['attribute']['strokecolor']); - } - // check for width attribute - if (isset($dom[$key]['attribute']['width'])) { - $dom[$key]['width'] = $dom[$key]['attribute']['width']; - } - // check for height attribute - if (isset($dom[$key]['attribute']['height'])) { - $dom[$key]['height'] = $dom[$key]['attribute']['height']; - } - // check for text alignment - if (isset($dom[$key]['attribute']['align']) AND (!$this->empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { - $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align']{0}); - } - // check for text rendering mode (the following attributes do not exist in HTML) - if (isset($dom[$key]['attribute']['stroke'])) { - // font stroke width - $dom[$key]['stroke'] = $this->getHTMLUnitToUnits($dom[$key]['attribute']['stroke'], $dom[$key]['fontsize'], 'pt', true); - } - if (isset($dom[$key]['attribute']['fill'])) { - // font fill - if ($dom[$key]['attribute']['fill'] == 'true') { - $dom[$key]['fill'] = true; - } else { - $dom[$key]['fill'] = false; - } - } - if (isset($dom[$key]['attribute']['clip'])) { - // clipping mode - if ($dom[$key]['attribute']['clip'] == 'true') { - $dom[$key]['clip'] = true; - } else { - $dom[$key]['clip'] = false; - } - } - } // end opening tag - } else { - // text - $dom[$key]['tag'] = false; - $dom[$key]['block'] = false; - $element = str_replace('$nbsp;', $this->unichr(160), $element); - $dom[$key]['value'] = stripslashes($this->unhtmlentities($element)); - $dom[$key]['parent'] = end($level); - } - ++$elkey; - ++$key; - } - return $dom; - } - - /** - * Returns the string used to find spaces - * @return string - * @access protected - * @author Nicola Asuni - * @since 4.8.024 (2010-01-15) - */ - protected function getSpaceString() { - $spacestr = chr(32); - if ($this->isUnicodeFont()) { - $spacestr = chr(0).chr(32); - } - return $spacestr; - } - - /** - * Prints a cell (rectangular area) with optional borders, background color and html text string. - * The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.<br /> - * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. - * @param float $w Cell width. If 0, the cell extends up to the right margin. - * @param float $h Cell minimum height. The cell extends automatically if needed. - * @param float $x upper-left corner X coordinate - * @param float $y upper-left corner Y coordinate - * @param string $html html text to print. Default value: empty string. - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param int $ln Indicates where the current position should go after the call. Possible values are:<ul><li>0: to the right (or left for RTL language)</li><li>1: to the beginning of the next line</li><li>2: below</li></ul> -Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. - * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). - * @param boolean $reseth if true reset the last cell height (default true). - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. - * @access public - * @uses MultiCell() - * @see Multicell(), writeHTML() - */ - public function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=false, $reseth=true, $align='', $autopadding=true) { - return $this->MultiCell($w, $h, $html, $border, $align, $fill, $ln, $x, $y, $reseth, 0, true, $autopadding, 0); - } - - /** - * Allows to preserve some HTML formatting (limited support).<br /> - * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. - * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul - * @param string $html text to display - * @param boolean $ln if true add a new line after text (default = true) - * @param boolean $fill Indicates if the background must be painted (true) or transparent (false). - * @param boolean $reseth if true reset the last cell height (default false). - * @param boolean $cell if true add the current left (or right for RTL) padding to each Write (default false). - * @param string $align Allows to center or align the text. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @access public - */ - public function writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') { - $gvars = $this->getGraphicVars(); - // store current values - $prev_cell_margin = $this->cell_margin; - $prev_cell_padding = $this->cell_padding; - $prevPage = $this->page; - $prevlMargin = $this->lMargin; - $prevrMargin = $this->rMargin; - $curfontname = $this->FontFamily; - $curfontstyle = $this->FontStyle; - $curfontsize = $this->FontSizePt; - $curfontascent = $this->getFontAscent($curfontname, $curfontstyle, $curfontsize); - $curfontdescent = $this->getFontDescent($curfontname, $curfontstyle, $curfontsize); - $curfontstretcing = $this->font_stretching; - $curfontkerning = $this->font_spacing; - $this->newline = true; - $newline = true; - $startlinepage = $this->page; - $minstartliney = $this->y; - $maxbottomliney = 0; - $startlinex = $this->x; - $startliney = $this->y; - $yshift = 0; - $loop = 0; - $curpos = 0; - $this_method_vars = array(); - $undo = false; - $fontaligned = false; - $reverse_dir = false; // true when the text direction is reversed - $this->premode = false; - if ($this->inxobj) { - // we are inside an XObject template - $pask = count($this->xobjects[$this->xobjid]['annotations']); - } elseif (isset($this->PageAnnots[$this->page])) { - $pask = count($this->PageAnnots[$this->page]); - } else { - $pask = 0; - } - if ($this->inxobj) { - // we are inside an XObject template - $startlinepos = strlen($this->xobjects[$this->xobjid]['outdata']); - } elseif (!$this->InFooter) { - if (isset($this->footerlen[$this->page])) { - $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; - } else { - $this->footerpos[$this->page] = $this->pagelen[$this->page]; - } - $startlinepos = $this->footerpos[$this->page]; - } else { - // we are inside the footer - $startlinepos = $this->pagelen[$this->page]; - } - $lalign = $align; - $plalign = $align; - if ($this->rtl) { - $w = $this->x - $this->lMargin; - } else { - $w = $this->w - $this->rMargin - $this->x; - } - $w -= ($this->cell_padding['L'] + $this->cell_padding['R']); - if ($cell) { - if ($this->rtl) { - $this->x -= $this->cell_padding['R']; - $this->lMargin += $this->cell_padding['R']; - } else { - $this->x += $this->cell_padding['L']; - $this->rMargin += $this->cell_padding['L']; - } - } - if ($this->customlistindent >= 0) { - $this->listindent = $this->customlistindent; - } else { - $this->listindent = $this->GetStringWidth('0000'); - } - $this->listindentlevel = 0; - // save previous states - $prev_cell_height_ratio = $this->cell_height_ratio; - $prev_listnum = $this->listnum; - $prev_listordered = $this->listordered; - $prev_listcount = $this->listcount; - $prev_lispacer = $this->lispacer; - $this->listnum = 0; - $this->listordered = array(); - $this->listcount = array(); - $this->lispacer = ''; - if (($this->empty_string($this->lasth)) OR ($reseth)) { - // reset row height - $this->resetLastH(); - } - $dom = $this->getHtmlDomArray($html); - $maxel = count($dom); - $key = 0; - while ($key < $maxel) { - if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) { - // check for pagebreak - if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - if ((($dom[$key]['attribute']['pagebreak'] == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) - OR (($dom[$key]['attribute']['pagebreak'] == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - } - if ($dom[$key]['tag'] AND $dom[$key]['opening'] AND isset($dom[$key]['attribute']['nobr']) AND ($dom[$key]['attribute']['nobr'] == 'true')) { - if (isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true')) { - $dom[$key]['attribute']['nobr'] = false; - } else { - // store current object - $this->startTransaction(); - // save this method vars - $this_method_vars['html'] = $html; - $this_method_vars['ln'] = $ln; - $this_method_vars['fill'] = $fill; - $this_method_vars['reseth'] = $reseth; - $this_method_vars['cell'] = $cell; - $this_method_vars['align'] = $align; - $this_method_vars['gvars'] = $gvars; - $this_method_vars['prevPage'] = $prevPage; - $this_method_vars['prev_cell_margin'] = $prev_cell_margin; - $this_method_vars['prev_cell_padding'] = $prev_cell_padding; - $this_method_vars['prevlMargin'] = $prevlMargin; - $this_method_vars['prevrMargin'] = $prevrMargin; - $this_method_vars['curfontname'] = $curfontname; - $this_method_vars['curfontstyle'] = $curfontstyle; - $this_method_vars['curfontsize'] = $curfontsize; - $this_method_vars['curfontascent'] = $curfontascent; - $this_method_vars['curfontdescent'] = $curfontdescent; - $this_method_vars['curfontstretcing'] = $curfontstretcing; - $this_method_vars['curfontkerning'] = $curfontkerning; - $this_method_vars['minstartliney'] = $minstartliney; - $this_method_vars['maxbottomliney'] = $maxbottomliney; - $this_method_vars['yshift'] = $yshift; - $this_method_vars['startlinepage'] = $startlinepage; - $this_method_vars['startlinepos'] = $startlinepos; - $this_method_vars['startlinex'] = $startlinex; - $this_method_vars['startliney'] = $startliney; - $this_method_vars['newline'] = $newline; - $this_method_vars['loop'] = $loop; - $this_method_vars['curpos'] = $curpos; - $this_method_vars['pask'] = $pask; - $this_method_vars['lalign'] = $lalign; - $this_method_vars['plalign'] = $plalign; - $this_method_vars['w'] = $w; - $this_method_vars['prev_cell_height_ratio'] = $prev_cell_height_ratio; - $this_method_vars['prev_listnum'] = $prev_listnum; - $this_method_vars['prev_listordered'] = $prev_listordered; - $this_method_vars['prev_listcount'] = $prev_listcount; - $this_method_vars['prev_lispacer'] = $prev_lispacer; - $this_method_vars['fontaligned'] = $fontaligned; - $this_method_vars['key'] = $key; - $this_method_vars['dom'] = $dom; - } - } - // print THEAD block - if (($dom[$key]['value'] == 'tr') AND isset($dom[$key]['thead']) AND $dom[$key]['thead']) { - if (isset($dom[$key]['parent']) AND isset($dom[$dom[$key]['parent']]['thead']) AND !$this->empty_string($dom[$dom[$key]['parent']]['thead'])) { - $this->inthead = true; - // print table header (thead) - $this->writeHTML($this->thead, false, false, false, false, ''); - // check if we are on a new page or on a new column - if (($this->y < $this->start_transaction_y) OR ($this->checkPageBreak($this->lasth, '', false))) { - // we are on a new page or on a new column and the total object height is less than the available vertical space. - // restore previous object - $this->rollbackTransaction(true); - // restore previous values - foreach ($this_method_vars as $vkey => $vval) { - $$vkey = $vval; - } - // disable table header - $tmp_thead = $this->thead; - $this->thead = ''; - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $pre_y = $this->y; - if ((!$this->checkPageBreak($this->PageBreakTrigger + 1)) AND ($this->y < $pre_y)) { - // fix for multicolumn mode - $startliney = $this->y; - } - $this->start_transaction_page = $this->page; - $this->start_transaction_y = $this->y; - // restore table header - $this->thead = $tmp_thead; - // fix table border properties - if (isset($dom[$dom[$key]['parent']]['attribute']['cellspacing'])) { - $tmp_cellspacing = $this->getHTMLUnitToUnits($dom[$dom[$key]['parent']]['attribute']['cellspacing'], 1, 'px'); - } else { - $tmp_cellspacing = 0; - } - $dom[$dom[$key]['parent']]['borderposition']['page'] = $this->page; - $dom[$dom[$key]['parent']]['borderposition']['column'] = $this->current_column; - $dom[$dom[$key]['parent']]['borderposition']['y'] = $this->y + $tmp_cellspacing; - $xoffset = ($this->x - $dom[$dom[$key]['parent']]['borderposition']['x']); - $dom[$dom[$key]['parent']]['borderposition']['x'] += $xoffset; - $dom[$dom[$key]['parent']]['borderposition']['xmax'] += $xoffset; - // print table header (thead) - $this->writeHTML($this->thead, false, false, false, false, ''); - } - } - // move $key index forward to skip THEAD block - while ( ($key < $maxel) AND (!( - ($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'tr') AND (!isset($dom[$key]['thead']) OR !$dom[$key]['thead'])) - OR ($dom[$key]['tag'] AND (!$dom[$key]['opening']) AND ($dom[$key]['value'] == 'table'))) )) { - ++$key; - } - } - if ($dom[$key]['tag'] OR ($key == 0)) { - if ((($dom[$key]['value'] == 'table') OR ($dom[$key]['value'] == 'tr')) AND (isset($dom[$key]['align']))) { - $dom[$key]['align'] = ($this->rtl) ? 'R' : 'L'; - } - // vertically align image in line - if ((!$this->newline) AND ($dom[$key]['value'] == 'img') AND (isset($dom[$key]['height'])) AND ($dom[$key]['height'] > 0)) { - // get image height - $imgh = $this->getHTMLUnitToUnits($dom[$key]['height'], $this->lasth, 'px'); - // check for automatic line break - $autolinebreak = false; - if (isset($dom[$key]['width']) AND ($dom[$key]['width'] > 0)) { - $imgw = $this->getHTMLUnitToUnits($dom[$key]['width'], 1, 'px', false); - if (($this->rtl AND (($this->x - $imgw) < ($this->lMargin + $this->cell_padding['L']))) - OR (!$this->rtl AND (($this->x + $imgw) > ($this->w - $this->rMargin - $this->cell_padding['R'])))) { - // add automatic line break - $autolinebreak = true; - $this->Ln('', $cell); - // go back to evaluate this line break - --$key; - } - } - if (!$autolinebreak) { - if (!$this->InFooter) { - $pre_y = $this->y; - // check for page break - if ((!$this->checkPageBreak($imgh)) AND ($this->y < $pre_y)) { - // fix for multicolumn mode - $startliney = $this->y; - } - } - if ($this->page > $startlinepage) { - // fix line splitted over two pages - if (isset($this->footerlen[$startlinepage])) { - $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - } - // line to be moved one page forward - $pagebuff = $this->getPageBuffer($startlinepage); - $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); - $tstart = substr($pagebuff, 0, $startlinepos); - $tend = substr($this->getPageBuffer($startlinepage), $curpos); - // remove line from previous page - $this->setPageBuffer($startlinepage, $tstart.''.$tend); - $pagebuff = $this->getPageBuffer($this->page); - $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]); - $tend = substr($pagebuff, $this->cntmrk[$this->page]); - // add line start to current page - $yshift = $minstartliney - $this->y; - if ($fontaligned) { - $yshift += ($curfontsize / $this->k); - } - $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); - $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); - // shift the annotations and links - if (isset($this->PageAnnots[$this->page])) { - $next_pask = count($this->PageAnnots[$this->page]); - } else { - $next_pask = 0; - } - if (isset($this->PageAnnots[$startlinepage])) { - foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { - if ($pak >= $pask) { - $this->PageAnnots[$this->page][] = $pac; - unset($this->PageAnnots[$startlinepage][$pak]); - $npak = count($this->PageAnnots[$this->page]) - 1; - $this->PageAnnots[$this->page][$npak]['y'] -= $yshift; - } - } - } - $pask = $next_pask; - $startlinepos = $this->cntmrk[$this->page]; - $startlinepage = $this->page; - $startliney = $this->y; - $this->newline = false; - } - $this->y += ((($curfontsize * $this->cell_height_ratio / $this->k) + $curfontascent - $curfontdescent) / 2) - $imgh; - $minstartliney = min($this->y, $minstartliney); - $maxbottomliney = ($startliney + ($this->FontSize * $this->cell_height_ratio)); - } - } elseif (isset($dom[$key]['fontname']) OR isset($dom[$key]['fontstyle']) OR isset($dom[$key]['fontsize']) OR isset($dom[$key]['line-height'])) { - // account for different font size - $pfontname = $curfontname; - $pfontstyle = $curfontstyle; - $pfontsize = $curfontsize; - $fontname = isset($dom[$key]['fontname']) ? $dom[$key]['fontname'] : $curfontname; - $fontstyle = isset($dom[$key]['fontstyle']) ? $dom[$key]['fontstyle'] : $curfontstyle; - $fontsize = isset($dom[$key]['fontsize']) ? $dom[$key]['fontsize'] : $curfontsize; - $fontascent = $this->getFontAscent($fontname, $fontstyle, $fontsize); - $fontdescent = $this->getFontDescent($fontname, $fontstyle, $fontsize); - if (($fontname != $curfontname) OR ($fontstyle != $curfontstyle) OR ($fontsize != $curfontsize) OR ($this->cell_height_ratio != $dom[$key]['line-height'])) { - if ((!$this->newline) AND ($key < ($maxel - 1)) - AND ((is_numeric($fontsize) AND ($fontsize >= 0) AND is_numeric($curfontsize) AND ($curfontsize >= 0) AND ($fontsize != $curfontsize)) - OR ($this->cell_height_ratio != $dom[$key]['line-height']))) { - if ($this->page > $startlinepage) { - // fix lines splitted over two pages - if (isset($this->footerlen[$startlinepage])) { - $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - } - // line to be moved one page forward - $pagebuff = $this->getPageBuffer($startlinepage); - $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); - $tstart = substr($pagebuff, 0, $startlinepos); - $tend = substr($this->getPageBuffer($startlinepage), $curpos); - // remove line start from previous page - $this->setPageBuffer($startlinepage, $tstart.''.$tend); - $pagebuff = $this->getPageBuffer($this->page); - $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]); - $tend = substr($pagebuff, $this->cntmrk[$this->page]); - // add line start to current page - $yshift = $minstartliney - $this->y; - $try = sprintf('1 0 0 1 0 %.3F cm', ($yshift * $this->k)); - $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); - // shift the annotations and links - if (isset($this->PageAnnots[$this->page])) { - $next_pask = count($this->PageAnnots[$this->page]); - } else { - $next_pask = 0; - } - if (isset($this->PageAnnots[$startlinepage])) { - foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { - if ($pak >= $pask) { - $this->PageAnnots[$this->page][] = $pac; - unset($this->PageAnnots[$startlinepage][$pak]); - $npak = count($this->PageAnnots[$this->page]) - 1; - $this->PageAnnots[$this->page][$npak]['y'] -= $yshift; - } - } - } - $pask = $next_pask; - $startlinepos = $this->cntmrk[$this->page]; - $startlinepage = $this->page; - $startliney = $this->y; - } - if (!isset($dom[$key]['line-height'])) { - $dom[$key]['line-height'] = $this->cell_height_ratio; - } - if (!$dom[$key]['block']) { - $this->y += (((($curfontsize * $this->cell_height_ratio ) - ($fontsize * $dom[$key]['line-height'])) / $this->k) + $curfontascent - $fontascent - $curfontdescent + $fontdescent) / 2; - if (($dom[$key]['value'] != 'sup') AND ($dom[$key]['value'] != 'sub')) { - $minstartliney = min($this->y, $minstartliney); - $maxbottomliney = max(($this->y + (($fontsize * $this->cell_height_ratio) / $this->k)), $maxbottomliney); - } - } - $this->cell_height_ratio = $dom[$key]['line-height']; - $fontaligned = true; - } - $this->SetFont($fontname, $fontstyle, $fontsize); - // reset row height - $this->resetLastH(); - $curfontname = $fontname; - $curfontstyle = $fontstyle; - $curfontsize = $fontsize; - $curfontascent = $fontascent; - $curfontdescent = $fontdescent; - } - } - // set text rendering mode - $textstroke = isset($dom[$key]['stroke']) ? $dom[$key]['stroke'] : $this->textstrokewidth; - $textfill = isset($dom[$key]['fill']) ? $dom[$key]['fill'] : (($this->textrendermode % 2) == 0); - $textclip = isset($dom[$key]['clip']) ? $dom[$key]['clip'] : ($this->textrendermode > 3); - $this->setTextRenderingMode($textstroke, $textfill, $textclip); - if (isset($dom[$key]['font-stretch']) AND ($dom[$key]['font-stretch'] !== false)) { - $this->setFontStretching($dom[$key]['font-stretch']); - } - if (isset($dom[$key]['letter-spacing']) AND ($dom[$key]['letter-spacing'] !== false)) { - $this->setFontSpacing($dom[$key]['letter-spacing']); - } - if (($plalign == 'J') AND $dom[$key]['block']) { - $plalign = ''; - } - // get current position on page buffer - $curpos = $this->pagelen[$startlinepage]; - if (isset($dom[$key]['bgcolor']) AND ($dom[$key]['bgcolor'] !== false)) { - $this->SetFillColorArray($dom[$key]['bgcolor']); - $wfill = true; - } else { - $wfill = $fill | false; - } - if (isset($dom[$key]['fgcolor']) AND ($dom[$key]['fgcolor'] !== false)) { - $this->SetTextColorArray($dom[$key]['fgcolor']); - } - if (isset($dom[$key]['strokecolor']) AND ($dom[$key]['strokecolor'] !== false)) { - $this->SetDrawColorArray($dom[$key]['strokecolor']); - } - if (isset($dom[$key]['align'])) { - $lalign = $dom[$key]['align']; - } - if ($this->empty_string($lalign)) { - $lalign = $align; - } - } - // align lines - if ($this->newline AND (strlen($dom[$key]['value']) > 0) AND ($dom[$key]['value'] != 'td') AND ($dom[$key]['value'] != 'th')) { - $newline = true; - $fontaligned = false; - // we are at the beginning of a new line - if (isset($startlinex)) { - $yshift = $minstartliney - $startliney; - if (($yshift > 0) OR ($this->page > $startlinepage)) { - $yshift = 0; - } - $t_x = 0; - // the last line must be shifted to be aligned as requested - $linew = abs($this->endlinex - $startlinex); - if ($this->inxobj) { - // we are inside an XObject template - $pstart = substr($this->xobjects[$this->xobjid]['outdata'], 0, $startlinepos); - if (isset($opentagpos)) { - $midpos = $opentagpos; - } else { - $midpos = 0; - } - if ($midpos > 0) { - $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos, ($midpos - $startlinepos)); - $pend = substr($this->xobjects[$this->xobjid]['outdata'], $midpos); - } else { - $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos); - $pend = ''; - } - } else { - $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { - $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - $midpos = min($opentagpos, $this->footerpos[$startlinepage]); - } elseif (isset($opentagpos)) { - $midpos = $opentagpos; - } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { - $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - $midpos = $this->footerpos[$startlinepage]; - } else { - $midpos = 0; - } - if ($midpos > 0) { - $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos, ($midpos - $startlinepos)); - $pend = substr($this->getPageBuffer($startlinepage), $midpos); - } else { - $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos); - $pend = ''; - } - } - if ((isset($plalign) AND ((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { - // calculate shifting amount - $tw = $w; - if (($plalign == 'J') AND $this->isRTLTextDir() AND ($this->num_columns > 1)) { - $tw += $this->cell_padding['R']; - } - if ($this->lMargin != $prevlMargin) { - $tw += ($prevlMargin - $this->lMargin); - } - if ($this->rMargin != $prevrMargin) { - $tw += ($prevrMargin - $this->rMargin); - } - $one_space_width = $this->GetStringWidth(chr(32)); - $no = 0; // number of spaces on a line contained on a single block - if ($this->isRTLTextDir()) { // RTL - // remove left space if exist - $pos1 = $this->revstrpos($pmid, '[('); - if ($pos1 > 0) { - $pos1 = intval($pos1); - if ($this->isUnicodeFont()) { - $pos2 = intval($this->revstrpos($pmid, '[('.chr(0).chr(32))); - $spacelen = 2; - } else { - $pos2 = intval($this->revstrpos($pmid, '[('.chr(32))); - $spacelen = 1; - } - if ($pos1 == $pos2) { - $pmid = substr($pmid, 0, ($pos1 + 2)).substr($pmid, ($pos1 + 2 + $spacelen)); - if (substr($pmid, $pos1, 4) == '[()]') { - $linew -= $one_space_width; - } elseif ($pos1 == strpos($pmid, '[(')) { - $no = 1; - } - } - } - } else { // LTR - // remove right space if exist - $pos1 = $this->revstrpos($pmid, ')]'); - if ($pos1 > 0) { - $pos1 = intval($pos1); - if ($this->isUnicodeFont()) { - $pos2 = intval($this->revstrpos($pmid, chr(0).chr(32).')]')) + 2; - $spacelen = 2; - } else { - $pos2 = intval($this->revstrpos($pmid, chr(32).')]')) + 1; - $spacelen = 1; - } - if ($pos1 == $pos2) { - $pmid = substr($pmid, 0, ($pos1 - $spacelen)).substr($pmid, $pos1); - $linew -= $one_space_width; - } - } - } - $mdiff = ($tw - $linew); - if ($plalign == 'C') { - if ($this->rtl) { - $t_x = -($mdiff / 2); - } else { - $t_x = ($mdiff / 2); - } - } elseif ($plalign == 'R') { - // right alignment on LTR document - $t_x = $mdiff; - } elseif ($plalign == 'L') { - // left alignment on RTL document - $t_x = -$mdiff; - } elseif (($plalign == 'J') AND ($plalign == $lalign)) { - // Justification - if ($this->isRTLTextDir()) { - // align text on the left - $t_x = -$mdiff; - } - $ns = 0; // number of spaces - $pmidtemp = $pmid; - // escape special characters - $pmidtemp = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmidtemp); - $pmidtemp = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmidtemp); - // search spaces - if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmidtemp, $lnstring, PREG_PATTERN_ORDER)) { - $spacestr = $this->getSpaceString(); - $maxkk = count($lnstring[1]) - 1; - for ($kk=0; $kk <= $maxkk; ++$kk) { - // restore special characters - $lnstring[1][$kk] = str_replace('#!#OP#!#', '(', $lnstring[1][$kk]); - $lnstring[1][$kk] = str_replace('#!#CP#!#', ')', $lnstring[1][$kk]); - // store number of spaces on the strings - $lnstring[2][$kk] = substr_count($lnstring[1][$kk], $spacestr); - // count total spaces on line - $ns += $lnstring[2][$kk]; - $lnstring[3][$kk] = $ns; - } - if ($ns == 0) { - $ns = 1; - } - // calculate additional space to add to each existing space - $spacewidth = ($mdiff / ($ns - $no)) * $this->k; - $spacewidthu = -1000 * ($mdiff + (($ns + $no) * $one_space_width)) / $ns / $this->FontSize; - if ($this->font_spacing != 0) { - // fixed spacing mode - $osw = -1000 * $this->font_spacing / $this->FontSize; - $spacewidthu += $osw; - } - $nsmax = $ns; - $ns = 0; - reset($lnstring); - $offset = 0; - $strcount = 0; - $prev_epsposbeg = 0; - $textpos = 0; - if ($this->isRTLTextDir()) { - $textpos = $this->wPt; - } - global $spacew; - while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) { - // check if we are inside a string section '[( ... )]' - $stroffset = strpos($pmid, '[(', $offset); - if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) { - // set offset to the end of string section - $offset = strpos($pmid, ')]', $stroffset); - while (($offset !== false) AND ($pmid{($offset - 1)} == '\\')) { - $offset = strpos($pmid, ')]', ($offset + 1)); - } - if ($offset === false) { - $this->Error('HTML Justification: malformed PDF code.'); - } - continue; - } - if ($this->isRTLTextDir()) { - $spacew = ($spacewidth * ($nsmax - $ns)); - } else { - $spacew = ($spacewidth * $ns); - } - $offset = $strpiece[2][1] + strlen($strpiece[2][0]); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset); - $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset) + strlen($this->epsmarker.'Q'); - if ((($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend)) - OR (($epsposbeg === false) AND ($epsposend > 0) AND ($offset < $epsposend))) { - // shift EPS images - $trx = sprintf('1 0 0 1 %.3F 0 cm', $spacew); - $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); - $pmid_b = substr($pmid, 0, $epsposbeg); - $pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg)); - $pmid_e = substr($pmid, $epsposend); - $pmid = $pmid_b."\nq\n".$trx."\n".$pmid_m."\nQ\n".$pmid_e; - $offset = $epsposend; - continue; - - } - $prev_epsposbeg = $epsposbeg; - $currentxpos = 0; - // shift blocks of code - switch ($strpiece[2][0]) { - case 'Td': - case 'cm': - case 'm': - case 'l': { - // get current X position - preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches); - $currentxpos = $xmatches[1]; - $textpos = $currentxpos; - if (($strcount <= $maxkk) AND ($strpiece[2][0] == 'Td')) { - $ns = $lnstring[3][$strcount]; - if ($this->isRTLTextDir()) { - $spacew = ($spacewidth * ($nsmax - $ns)); - } - ++$strcount; - } - // justify block - $pmid = preg_replace_callback('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', - create_function('$matches', 'global $spacew; - $newx = sprintf("%.2F",(floatval($matches[1]) + $spacew)); - return "".$newx." ".$matches[2]." x*#!#*x".$matches[3].$matches[4];'), $pmid, 1); - break; - } - case 're': { - // justify block - if (!$this->empty_string($this->lispacer)) { - $this->lispacer = ''; - continue; - } - preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches); - $currentxpos = $xmatches[1]; - global $x_diff, $w_diff; - $x_diff = 0; - $w_diff = 0; - if ($this->isRTLTextDir()) { // RTL - if ($currentxpos < $textpos) { - $x_diff = ($spacewidth * ($nsmax - $lnstring[3][$strcount])); - $w_diff = ($spacewidth * $lnstring[2][$strcount]); - } else { - if ($strcount > 0) { - $x_diff = ($spacewidth * ($nsmax - $lnstring[3][($strcount - 1)])); - $w_diff = ($spacewidth * $lnstring[2][($strcount - 1)]); - } - } - } else { // LTR - if ($currentxpos > $textpos) { - if ($strcount > 0) { - $x_diff = ($spacewidth * $lnstring[3][($strcount - 1)]); - } - $w_diff = ($spacewidth * $lnstring[2][$strcount]); - } else { - if ($strcount > 1) { - $x_diff = ($spacewidth * $lnstring[3][($strcount - 2)]); - } - if ($strcount > 0) { - $w_diff = ($spacewidth * $lnstring[2][($strcount - 1)]); - } - } - } - $pmid = preg_replace_callback('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', - create_function('$matches', 'global $x_diff, $w_diff; - $newx = sprintf("%.2F",(floatval($matches[1]) + $x_diff)); - $neww = sprintf("%.2F",(floatval($matches[3]) + $w_diff)); - return "".$newx." ".$matches[2]." ".$neww." ".$matches[4]." x*#!#*x".$matches[5].$matches[6];'), $pmid, 1); - break; - } - case 'c': { - // get current X position - preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $xmatches); - $currentxpos = $xmatches[1]; - // justify block - $pmid = preg_replace_callback('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$xmatches[4].')[\s]('.$xmatches[5].')[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', - create_function('$matches', 'global $spacew; - $newx1 = sprintf("%.3F",(floatval($matches[1]) + $spacew)); - $newx2 = sprintf("%.3F",(floatval($matches[3]) + $spacew)); - $newx3 = sprintf("%.3F",(floatval($matches[5]) + $spacew)); - return "".$newx1." ".$matches[2]." ".$newx2." ".$matches[4]." ".$newx3." ".$matches[6]." x*#!#*x".$matches[7].$matches[8];'), $pmid, 1); - break; - } - } - // shift the annotations and links - $cxpos = ($currentxpos / $this->k); - $lmpos = ($this->lMargin + $this->cell_padding['L'] + $this->feps); - if ($this->inxobj) { - // we are inside an XObject template - foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { - if (($pac['y'] >= $minstartliney) AND (($pac['x'] * $this->k) >= ($currentxpos - $this->feps)) AND (($pac['x'] * $this->k) <= ($currentxpos + $this->feps))) { - if ($cxpos > $lmpos) { - $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += ($spacew / $this->k); - $this->xobjects[$this->xobjid]['annotations'][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); - } else { - $this->xobjects[$this->xobjid]['annotations'][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); - } - break; - } - } - } elseif (isset($this->PageAnnots[$this->page])) { - foreach ($this->PageAnnots[$this->page] as $pak => $pac) { - if (($pac['y'] >= $minstartliney) AND (($pac['x'] * $this->k) >= ($currentxpos - $this->feps)) AND (($pac['x'] * $this->k) <= ($currentxpos + $this->feps))) { - if ($cxpos > $lmpos) { - $this->PageAnnots[$this->page][$pak]['x'] += ($spacew / $this->k); - $this->PageAnnots[$this->page][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); - } else { - $this->PageAnnots[$this->page][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); - } - break; - } - } - } - } // end of while - // remove markers - $pmid = str_replace('x*#!#*x', '', $pmid); - if ($this->isUnicodeFont()) { - // multibyte characters - $spacew = $spacewidthu; - if ($this->font_stretching != 100) { - // word spacing is affected by stretching - $spacew /= ($this->font_stretching / 100); - } - $pmidtemp = $pmid; - // escape special characters - $pmidtemp = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmidtemp); - $pmidtemp = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmidtemp); - $pmid = preg_replace_callback("/\[\(([^\)]*)\)\]/x", - create_function('$matches', 'global $spacew; - $matches[1] = str_replace("#!#OP#!#", "(", $matches[1]); - $matches[1] = str_replace("#!#CP#!#", ")", $matches[1]); - return "[(".str_replace(chr(0).chr(32), ") ".sprintf("%.3F", $spacew)." (", $matches[1]).")]";'), $pmidtemp); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['outdata'] = $pstart."\n".$pmid."\n".$pend; - } else { - $this->setPageBuffer($startlinepage, $pstart."\n".$pmid."\n".$pend); - } - $endlinepos = strlen($pstart."\n".$pmid."\n"); - } else { - // non-unicode (single-byte characters) - if ($this->font_stretching != 100) { - // word spacing (Tw) is affected by stretching - $spacewidth /= ($this->font_stretching / 100); - } - $rs = sprintf('%.3F Tw', $spacewidth); - $pmid = preg_replace("/\[\(/x", $rs.' [(', $pmid); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['outdata'] = $pstart."\n".$pmid."\nBT 0 Tw ET\n".$pend; - } else { - $this->setPageBuffer($startlinepage, $pstart."\n".$pmid."\nBT 0 Tw ET\n".$pend); - } - $endlinepos = strlen($pstart."\n".$pmid."\nBT 0 Tw ET\n"); - } - } - } // end of J - } // end if $startlinex - if (($t_x != 0) OR ($yshift < 0)) { - // shift the line - $trx = sprintf('1 0 0 1 %.3F %.3F cm', ($t_x * $this->k), ($yshift * $this->k)); - $pstart .= "\nq\n".$trx."\n".$pmid."\nQ\n"; - $endlinepos = strlen($pstart); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$pend; - foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { - if ($pak >= $pask) { - $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += $t_x; - $this->xobjects[$this->xobjid]['annotations'][$pak]['y'] -= $yshift; - } - } - } else { - $this->setPageBuffer($startlinepage, $pstart.$pend); - // shift the annotations and links - if (isset($this->PageAnnots[$this->page])) { - foreach ($this->PageAnnots[$this->page] as $pak => $pac) { - if ($pak >= $pask) { - $this->PageAnnots[$this->page][$pak]['x'] += $t_x; - $this->PageAnnots[$this->page][$pak]['y'] -= $yshift; - } - } - } - } - $this->y -= $yshift; - } - } - $pbrk = $this->checkPageBreak($this->lasth); - $this->newline = false; - $startlinex = $this->x; - $startliney = $this->y; - if ($dom[$dom[$key]['parent']]['value'] == 'sup') { - $startliney -= ((0.3 * $this->FontSizePt) / $this->k); - } elseif ($dom[$dom[$key]['parent']]['value'] == 'sub') { - $startliney -= (($this->FontSizePt / 0.7) / $this->k); - } else { - $minstartliney = $startliney; - $maxbottomliney = ($this->y + (($fontsize * $this->cell_height_ratio) / $this->k)); - } - $startlinepage = $this->page; - if (isset($endlinepos) AND (!$pbrk)) { - $startlinepos = $endlinepos; - } else { - if ($this->inxobj) { - // we are inside an XObject template - $startlinepos = strlen($this->xobjects[$this->xobjid]['outdata']); - } elseif (!$this->InFooter) { - if (isset($this->footerlen[$this->page])) { - $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; - } else { - $this->footerpos[$this->page] = $this->pagelen[$this->page]; - } - $startlinepos = $this->footerpos[$this->page]; - } else { - $startlinepos = $this->pagelen[$this->page]; - } - } - unset($endlinepos); - $plalign = $lalign; - if (isset($this->PageAnnots[$this->page])) { - $pask = count($this->PageAnnots[$this->page]); - } else { - $pask = 0; - } - if (!($dom[$key]['tag'] AND !$dom[$key]['opening'] AND ($dom[$key]['value'] == 'table') AND ($this->emptypagemrk[$this->page] == $this->pagelen[$this->page]))) { - $this->SetFont($fontname, $fontstyle, $fontsize); - if ($wfill) { - $this->SetFillColorArray($this->bgcolor); - } - } - } // end newline - if (isset($opentagpos)) { - unset($opentagpos); - } - if ($dom[$key]['tag']) { - if ($dom[$key]['opening']) { - // get text indentation (if any) - if (isset($dom[$key]['text-indent']) AND $dom[$key]['block']) { - $this->textindent = $dom[$key]['text-indent']; - $this->newline = true; - } - // table - if ($dom[$key]['value'] == 'table') { - // available page width - if ($this->rtl) { - $wtmp = $this->x - $this->lMargin; - } else { - $wtmp = $this->w - $this->rMargin - $this->x; - } - if (isset($dom[$key]['attribute']['cellspacing'])) { - $cellspacing = $this->getHTMLUnitToUnits($dom[$key]['attribute']['cellspacing'], 1, 'px'); - } else { - $cellspacing = 0; - } - // table width - if (isset($dom[$key]['width'])) { - $table_width = $this->getHTMLUnitToUnits($dom[$key]['width'], $wtmp, 'px'); - } else { - $table_width = $wtmp; - } - $table_width -= (2 * $cellspacing); - if (!$this->inthead) { - $this->y += $cellspacing; - } - if ($this->rtl) { - $cellspacingx = -$cellspacing; - } else { - $cellspacingx = $cellspacing; - } - // total table width without cellspaces - $table_columns_width = ($table_width - ($cellspacing * ($dom[$key]['cols'] - 1))); - // minimum column width - $table_min_column_width = ($table_columns_width / $dom[$key]['cols']); - // array of custom column widths - $table_colwidths = array_fill(0, $dom[$key]['cols'], $table_min_column_width); - } - // table row - if ($dom[$key]['value'] == 'tr') { - // reset column counter - $colid = 0; - } - // table cell - if (($dom[$key]['value'] == 'td') OR ($dom[$key]['value'] == 'th')) { - $trid = $dom[$key]['parent']; - $table_el = $dom[$trid]['parent']; - if (!isset($dom[$table_el]['cols'])) { - $dom[$table_el]['cols'] = $dom[$trid]['cols']; - } - // store border info - $tdborder = 0; - if (isset($dom[$key]['border']) AND !empty($dom[$key]['border'])) { - $tdborder = $dom[$key]['border']; - } - $colspan = $dom[$key]['attribute']['colspan']; - $old_cell_padding = $this->cell_padding; - if (isset($dom[($dom[$trid]['parent'])]['attribute']['cellpadding'])) { - $current_cell_padding = $this->getHTMLUnitToUnits($dom[($dom[$trid]['parent'])]['attribute']['cellpadding'], 1, 'px'); - } else { - $current_cell_padding = 0; - } - $this->SetCellPadding($current_cell_padding); - if (isset($dom[$key]['height'])) { - // minimum cell height - $cellh = $this->getHTMLUnitToUnits($dom[$key]['height'], 0, 'px'); - } else { - $cellh = 0; - } - if (isset($dom[$key]['content'])) { - $cell_content = $dom[$key]['content']; - } else { - $cell_content = '&nbsp;'; - } - $tagtype = $dom[$key]['value']; - $parentid = $key; - while (($key < $maxel) AND (!(($dom[$key]['tag']) AND (!$dom[$key]['opening']) AND ($dom[$key]['value'] == $tagtype) AND ($dom[$key]['parent'] == $parentid)))) { - // move $key index forward - ++$key; - } - if (!isset($dom[$trid]['startpage'])) { - $dom[$trid]['startpage'] = $this->page; - } else { - $this->setPage($dom[$trid]['startpage']); - } - if (!isset($dom[$trid]['startcolumn'])) { - $dom[$trid]['startcolumn'] = $this->current_column; - } elseif ($this->current_column != $dom[$trid]['startcolumn']) { - $tmpx = $this->x; - $this->selectColumn($dom[$trid]['startcolumn']); - $this->x = $tmpx; - } - if (!isset($dom[$trid]['starty'])) { - $dom[$trid]['starty'] = $this->y; - } else { - $this->y = $dom[$trid]['starty']; - } - if (!isset($dom[$trid]['startx'])) { - $dom[$trid]['startx'] = $this->x; - $this->x += $cellspacingx; - } else { - $this->x += ($cellspacingx / 2); - } - if (isset($dom[$parentid]['attribute']['rowspan'])) { - $rowspan = intval($dom[$parentid]['attribute']['rowspan']); - } else { - $rowspan = 1; - } - // skip row-spanned cells started on the previous rows - if (isset($dom[$table_el]['rowspans'])) { - $rsk = 0; - $rskmax = count($dom[$table_el]['rowspans']); - while ($rsk < $rskmax) { - $trwsp = $dom[$table_el]['rowspans'][$rsk]; - $rsstartx = $trwsp['startx']; - $rsendx = $trwsp['endx']; - // account for margin changes - if ($trwsp['startpage'] < $this->page) { - if (($this->rtl) AND ($this->pagedim[$this->page]['orm'] != $this->pagedim[$trwsp['startpage']]['orm'])) { - $dl = ($this->pagedim[$this->page]['orm'] - $this->pagedim[$trwsp['startpage']]['orm']); - $rsstartx -= $dl; - $rsendx -= $dl; - } elseif ((!$this->rtl) AND ($this->pagedim[$this->page]['olm'] != $this->pagedim[$trwsp['startpage']]['olm'])) { - $dl = ($this->pagedim[$this->page]['olm'] - $this->pagedim[$trwsp['startpage']]['olm']); - $rsstartx += $dl; - $rsendx += $dl; - } - } - if (($trwsp['rowspan'] > 0) - AND ($rsstartx > ($this->x - $cellspacing - $current_cell_padding - $this->feps)) - AND ($rsstartx < ($this->x + $cellspacing + $current_cell_padding + $this->feps)) - AND (($trwsp['starty'] < ($this->y - $this->feps)) OR ($trwsp['startpage'] < $this->page) OR ($trwsp['startcolumn'] < $this->current_column))) { - // set the starting X position of the current cell - $this->x = $rsendx + $cellspacingx; - // increment column indicator - $colid += $trwsp['colspan']; - if (($trwsp['rowspan'] == 1) - AND (isset($dom[$trid]['endy'])) - AND (isset($dom[$trid]['endpage'])) - AND (isset($dom[$trid]['endcolumn'])) - AND ($trwsp['endpage'] == $dom[$trid]['endpage']) - AND ($trwsp['endcolumn'] == $dom[$trid]['endcolumn'])) { - // set ending Y position for row - $dom[$table_el]['rowspans'][$rsk]['endy'] = max($dom[$trid]['endy'], $trwsp['endy']); - $dom[$trid]['endy'] = $dom[$table_el]['rowspans'][$rsk]['endy']; - } - $rsk = 0; - } else { - ++$rsk; - } - } - } - if (isset($dom[$parentid]['width'])) { - // user specified width - $cellw = $this->getHTMLUnitToUnits($dom[$parentid]['width'], $table_columns_width, 'px'); - $tmpcw = ($cellw / $colspan); - for ($i = 0; $i < $colspan; ++$i) { - $table_colwidths[($colid + $i)] = $tmpcw; - } - } else { - // inherit column width - $cellw = 0; - for ($i = 0; $i < $colspan; ++$i) { - $cellw += $table_colwidths[($colid + $i)]; - } - } - $cellw += (($colspan - 1) * $cellspacing); - // increment column indicator - $colid += $colspan; - // add rowspan information to table element - if ($rowspan > 1) { - $trsid = array_push($dom[$table_el]['rowspans'], array('trid' => $trid, 'rowspan' => $rowspan, 'mrowspan' => $rowspan, 'colspan' => $colspan, 'startpage' => $this->page, 'startcolumn' => $this->current_column, 'startx' => $this->x, 'starty' => $this->y)); - } - $cellid = array_push($dom[$trid]['cellpos'], array('startx' => $this->x)); - if ($rowspan > 1) { - $dom[$trid]['cellpos'][($cellid - 1)]['rowspanid'] = ($trsid - 1); - } - // push background colors - if (isset($dom[$parentid]['bgcolor']) AND ($dom[$parentid]['bgcolor'] !== false)) { - $dom[$trid]['cellpos'][($cellid - 1)]['bgcolor'] = $dom[$parentid]['bgcolor']; - } - // store border info - if (isset($tdborder) AND !empty($tdborder)) { - $dom[$trid]['cellpos'][($cellid - 1)]['border'] = $tdborder; - } - $prevLastH = $this->lasth; - // store some info for multicolumn mode - if ($this->rtl) { - $this->colxshift['x'] = $this->w - $this->x - $this->rMargin; - } else { - $this->colxshift['x'] = $this->x - $this->lMargin; - } - $this->colxshift['s'] = $cellspacing; - $this->colxshift['p'] = $current_cell_padding; - // ****** write the cell content ****** - $this->MultiCell($cellw, $cellh, $cell_content, false, $lalign, false, 2, '', '', true, 0, true); - // restore some values - $this->colxshift = array('x' => 0, 's' => 0, 'p' => 0); - $this->lasth = $prevLastH; - $this->cell_padding = $old_cell_padding; - $dom[$trid]['cellpos'][($cellid - 1)]['endx'] = $this->x; - // update the end of row position - if ($rowspan <= 1) { - if (isset($dom[$trid]['endy'])) { - if (($this->page == $dom[$trid]['endpage']) AND ($this->current_column == $dom[$trid]['endcolumn'])) { - $dom[$trid]['endy'] = max($this->y, $dom[$trid]['endy']); - } elseif (($this->page > $dom[$trid]['endpage']) OR ($this->current_column > $dom[$trid]['endcolumn'])) { - $dom[$trid]['endy'] = $this->y; - } - } else { - $dom[$trid]['endy'] = $this->y; - } - if (isset($dom[$trid]['endpage'])) { - $dom[$trid]['endpage'] = max($this->page, $dom[$trid]['endpage']); - } else { - $dom[$trid]['endpage'] = $this->page; - } - if (isset($dom[$trid]['endcolumn'])) { - $dom[$trid]['endcolumn'] = max($this->current_column, $dom[$trid]['endcolumn']); - } else { - $dom[$trid]['endcolumn'] = $this->current_column; - } - } else { - // account for row-spanned cells - $dom[$table_el]['rowspans'][($trsid - 1)]['endx'] = $this->x; - $dom[$table_el]['rowspans'][($trsid - 1)]['endy'] = $this->y; - $dom[$table_el]['rowspans'][($trsid - 1)]['endpage'] = $this->page; - $dom[$table_el]['rowspans'][($trsid - 1)]['endcolumn'] = $this->current_column; - } - if (isset($dom[$table_el]['rowspans'])) { - // update endy and endpage on rowspanned cells - foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { - if ($trwsp['rowspan'] > 0) { - if (isset($dom[$trid]['endpage'])) { - if (($trwsp['endpage'] == $dom[$trid]['endpage']) AND ($trwsp['endcolumn'] == $dom[$trid]['endcolumn'])) { - $dom[$table_el]['rowspans'][$k]['endy'] = max($dom[$trid]['endy'], $trwsp['endy']); - } elseif (($trwsp['endpage'] < $dom[$trid]['endpage']) OR ($trwsp['endcolumn'] < $dom[$trid]['endcolumn'])) { - $dom[$table_el]['rowspans'][$k]['endy'] = $dom[$trid]['endy']; - $dom[$table_el]['rowspans'][$k]['endpage'] = $dom[$trid]['endpage']; - $dom[$table_el]['rowspans'][$k]['endcolumn'] = $dom[$trid]['endcolumn']; - } else { - $dom[$trid]['endy'] = $this->pagedim[$dom[$trid]['endpage']]['hk'] - $this->pagedim[$dom[$trid]['endpage']]['bm']; - } - } - } - } - } - $this->x += ($cellspacingx / 2); - } else { - // opening tag (or self-closing tag) - if (!isset($opentagpos)) { - if ($this->inxobj) { - // we are inside an XObject template - $opentagpos = strlen($this->xobjects[$this->xobjid]['outdata']); - } elseif (!$this->InFooter) { - if (isset($this->footerlen[$this->page])) { - $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; - } else { - $this->footerpos[$this->page] = $this->pagelen[$this->page]; - } - $opentagpos = $this->footerpos[$this->page]; - } - } - $this->openHTMLTagHandler($dom, $key, $cell); - } - } else { // closing tag - $prev_numpages = $this->numpages; - $old_bordermrk = $this->bordermrk[$this->page]; - $this->closeHTMLTagHandler($dom, $key, $cell, $maxbottomliney); - if ($this->bordermrk[$this->page] > $old_bordermrk) { - $startlinepos += ($this->bordermrk[$this->page] - $old_bordermrk); - } - if ($prev_numpages > $this->numpages) { - $startlinepage = $this->page; - } - } - } elseif (strlen($dom[$key]['value']) > 0) { - // print list-item - if (!$this->empty_string($this->lispacer) AND ($this->lispacer != '^')) { - $this->SetFont($pfontname, $pfontstyle, $pfontsize); - $this->resetLastH(); - $minstartliney = $this->y; - $maxbottomliney = ($startliney + ($this->FontSize * $this->cell_height_ratio)); - $this->putHtmlListBullet($this->listnum, $this->lispacer, $pfontsize); - $this->SetFont($curfontname, $curfontstyle, $curfontsize); - $this->resetLastH(); - if (is_numeric($pfontsize) AND ($pfontsize > 0) AND is_numeric($curfontsize) AND ($curfontsize > 0) AND ($pfontsize != $curfontsize)) { - $pfontascent = $this->getFontAscent($pfontname, $pfontstyle, $pfontsize); - $pfontdescent = $this->getFontDescent($pfontname, $pfontstyle, $pfontsize); - $this->y += ((($pfontsize - $curfontsize) * $this->cell_height_ratio / $this->k) + $pfontascent - $curfontascent - $pfontdescent + $curfontdescent) / 2; - $minstartliney = min($this->y, $minstartliney); - $maxbottomliney = max(($this->y + (($pfontsize * $this->cell_height_ratio) / $this->k)), $maxbottomliney); - } - } - // text - $this->htmlvspace = 0; - if ((!$this->premode) AND $this->isRTLTextDir()) { - // reverse spaces order - $lsp = ''; // left spaces - $rsp = ''; // right spaces - if (preg_match('/^('.$this->re_space['p'].'+)/'.$this->re_space['m'], $dom[$key]['value'], $matches)) { - $lsp = $matches[1]; - } - if (preg_match('/('.$this->re_space['p'].'+)$/'.$this->re_space['m'], $dom[$key]['value'], $matches)) { - $rsp = $matches[1]; - } - $dom[$key]['value'] = $rsp.$this->stringTrim($dom[$key]['value']).$lsp; - } - if ($newline) { - if (!$this->premode) { - $prelen = strlen($dom[$key]['value']); - if ($this->isRTLTextDir()) { - // right trim except non-breaking space - $dom[$key]['value'] = $this->stringRightTrim($dom[$key]['value']); - } else { - // left trim except non-breaking space - $dom[$key]['value'] = $this->stringLeftTrim($dom[$key]['value']); - } - $postlen = strlen($dom[$key]['value']); - if (($postlen == 0) AND ($prelen > 0)) { - $dom[$key]['trimmed_space'] = true; - } - } - $newline = false; - $firstblock = true; - } else { - $firstblock = false; - // replace empty multiple spaces string with a single space - $dom[$key]['value'] = preg_replace('/^'.$this->re_space['p'].'+$/'.$this->re_space['m'], chr(32), $dom[$key]['value']); - } - $strrest = ''; - if ($this->rtl) { - $this->x -= $this->textindent; - } else { - $this->x += $this->textindent; - } - if (!isset($dom[$key]['trimmed_space']) OR !$dom[$key]['trimmed_space']) { - if (!empty($this->HREF) AND (isset($this->HREF['url']))) { - // HTML <a> Link - $hrefcolor = ''; - if (isset($dom[($dom[$key]['parent'])]['fgcolor']) AND ($dom[($dom[$key]['parent'])]['fgcolor'] !== false)) { - $hrefcolor = $dom[($dom[$key]['parent'])]['fgcolor']; - } - $hrefstyle = -1; - if (isset($dom[($dom[$key]['parent'])]['fontstyle']) AND ($dom[($dom[$key]['parent'])]['fontstyle'] !== false)) { - $hrefstyle = $dom[($dom[$key]['parent'])]['fontstyle']; - } - $strrest = $this->addHtmlLink($this->HREF['url'], $dom[$key]['value'], $wfill, true, $hrefcolor, $hrefstyle, true); - } else { - $wadj = 0; // space to leave for block continuity - $adjblks = 0; // number of blocks - // check the next text blocks for continuity - $nkey = ($key + 1); - $write_block = true; - $tmp_fontname = $this->FontFamily; - $tmp_fontstyle = $this->FontStyle; - $tmp_fontsize = $this->FontSizePt; - while ($write_block AND isset($dom[$nkey])) { - if ($dom[$nkey]['tag']) { - if ($dom[$nkey]['block']) { - // end of block - $write_block = false; - } - $tmp_fontname = isset($dom[$nkey]['fontname']) ? $dom[$nkey]['fontname'] : $this->FontFamily; - $tmp_fontstyle = isset($dom[$nkey]['fontstyle']) ? $dom[$nkey]['fontstyle'] : $this->FontStyle; - $tmp_fontsize = isset($dom[$nkey]['fontsize']) ? $dom[$nkey]['fontsize'] : $this->FontSizePt; - } else { - $nextstr = preg_split('/'.$this->re_space['p'].'+/'.$this->re_space['m'], $dom[$nkey]['value']); - if (isset($nextstr[0])) { - $wadj += $this->GetStringWidth($nextstr[0], $tmp_fontname, $tmp_fontstyle, $tmp_fontsize); - ++$adjblks; - } - if (isset($nextstr[1])) { - $write_block = false; - } - } - ++$nkey; - } - // check for reversed text direction - if (($wadj > 0) AND (($this->rtl AND ($this->tmprtl == 'L')) OR (!$this->rtl AND ($this->tmprtl == 'R')))) { - // LTR text on RTL direction or RTL text on LTR direction - $reverse_dir = true; - $this->rtl = !$this->rtl; - $revshift = ($this->GetStringWidth($dom[$key]['value']) + $wadj) + 0.000001; // add little quantity for rounding problems - if ($this->rtl) { - $this->x += $revshift; - } else { - $this->x -= $revshift; - } - $xws = $this->x; - } - // ****** write only until the end of the line and get the rest ****** - $strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0, $wadj); - // restore default direction - if ($reverse_dir AND ($wadj == 0)) { - $this->x = $xws; - $this->rtl = !$this->rtl; - $reverse_dir = false; - } - } - } - $this->textindent = 0; - if (strlen($strrest) > 0) { - // store the remaining string on the previous $key position - $this->newline = true; - if ($strrest == $dom[$key]['value']) { - // used to avoid infinite loop - ++$loop; - } else { - $loop = 0; - } - $dom[$key]['value'] = $strrest; - if ($cell) { - if ($this->rtl) { - $this->x -= $this->cell_padding['R']; - } else { - $this->x += $this->cell_padding['L']; - } - } - if ($loop < 3) { - --$key; - } - } else { - $loop = 0; - } - } - ++$key; - if (isset($dom[$key]['tag']) AND $dom[$key]['tag'] AND (!isset($dom[$key]['opening']) OR !$dom[$key]['opening']) AND isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true')) { - // check if we are on a new page or on a new column - if ((!$undo) AND ($this->y < $this->start_transaction_y)) { - // we are on a new page or on a new column and the total object height is less than the available vertical space. - // restore previous object - $this->rollbackTransaction(true); - // restore previous values - foreach ($this_method_vars as $vkey => $vval) { - $$vkey = $vval; - } - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $pre_y = $this->y; - if ((!$this->checkPageBreak($this->PageBreakTrigger + 1)) AND ($this->y < $pre_y)) { - $startliney = $this->y; - } - $undo = true; // avoid infinite loop - } else { - $undo = false; - } - } - } // end for each $key - // align the last line - if (isset($startlinex)) { - $yshift = $minstartliney - $startliney; - if (($yshift > 0) OR ($this->page > $startlinepage)) { - $yshift = 0; - } - $t_x = 0; - // the last line must be shifted to be aligned as requested - $linew = abs($this->endlinex - $startlinex); - if ($this->inxobj) { - // we are inside an XObject template - $pstart = substr($this->xobjects[$this->xobjid]['outdata'], 0, $startlinepos); - if (isset($opentagpos)) { - $midpos = $opentagpos; - } else { - $midpos = 0; - } - if ($midpos > 0) { - $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos, ($midpos - $startlinepos)); - $pend = substr($this->xobjects[$this->xobjid]['outdata'], $midpos); - } else { - $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos); - $pend = ''; - } - } else { - $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); - if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { - $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - $midpos = min($opentagpos, $this->footerpos[$startlinepage]); - } elseif (isset($opentagpos)) { - $midpos = $opentagpos; - } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { - $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; - $midpos = $this->footerpos[$startlinepage]; - } else { - $midpos = 0; - } - if ($midpos > 0) { - $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos, ($midpos - $startlinepos)); - $pend = substr($this->getPageBuffer($startlinepage), $midpos); - } else { - $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos); - $pend = ''; - } - } - if ((isset($plalign) AND ((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { - // calculate shifting amount - $tw = $w; - if ($this->lMargin != $prevlMargin) { - $tw += ($prevlMargin - $this->lMargin); - } - if ($this->rMargin != $prevrMargin) { - $tw += ($prevrMargin - $this->rMargin); - } - $one_space_width = $this->GetStringWidth(chr(32)); - $no = 0; // number of spaces on a line contained on a single block - if ($this->isRTLTextDir()) { // RTL - // remove left space if exist - $pos1 = $this->revstrpos($pmid, '[('); - if ($pos1 > 0) { - $pos1 = intval($pos1); - if ($this->isUnicodeFont()) { - $pos2 = intval($this->revstrpos($pmid, '[('.chr(0).chr(32))); - $spacelen = 2; - } else { - $pos2 = intval($this->revstrpos($pmid, '[('.chr(32))); - $spacelen = 1; - } - if ($pos1 == $pos2) { - $pmid = substr($pmid, 0, ($pos1 + 2)).substr($pmid, ($pos1 + 2 + $spacelen)); - if (substr($pmid, $pos1, 4) == '[()]') { - $linew -= $one_space_width; - } elseif ($pos1 == strpos($pmid, '[(')) { - $no = 1; - } - } - } - } else { // LTR - // remove right space if exist - $pos1 = $this->revstrpos($pmid, ')]'); - if ($pos1 > 0) { - $pos1 = intval($pos1); - if ($this->isUnicodeFont()) { - $pos2 = intval($this->revstrpos($pmid, chr(0).chr(32).')]')) + 2; - $spacelen = 2; - } else { - $pos2 = intval($this->revstrpos($pmid, chr(32).')]')) + 1; - $spacelen = 1; - } - if ($pos1 == $pos2) { - $pmid = substr($pmid, 0, ($pos1 - $spacelen)).substr($pmid, $pos1); - $linew -= $one_space_width; - } - } - } - $mdiff = ($tw - $linew); - if ($plalign == 'C') { - if ($this->rtl) { - $t_x = -($mdiff / 2); - } else { - $t_x = ($mdiff / 2); - } - } elseif ($plalign == 'R') { - // right alignment on LTR document - $t_x = $mdiff; - } elseif ($plalign == 'L') { - // left alignment on RTL document - $t_x = -$mdiff; - } - } // end if startlinex - if (($t_x != 0) OR ($yshift < 0)) { - // shift the line - $trx = sprintf('1 0 0 1 %.3F %.3F cm', ($t_x * $this->k), ($yshift * $this->k)); - $pstart .= "\nq\n".$trx."\n".$pmid."\nQ\n"; - $endlinepos = strlen($pstart); - if ($this->inxobj) { - // we are inside an XObject template - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$pend; - foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { - if ($pak >= $pask) { - $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += $t_x; - $this->xobjects[$this->xobjid]['annotations'][$pak]['y'] -= $yshift; - } - } - } else { - $this->setPageBuffer($startlinepage, $pstart.$pend); - // shift the annotations and links - if (isset($this->PageAnnots[$this->page])) { - foreach ($this->PageAnnots[$this->page] as $pak => $pac) { - if ($pak >= $pask) { - $this->PageAnnots[$this->page][$pak]['x'] += $t_x; - $this->PageAnnots[$this->page][$pak]['y'] -= $yshift; - } - } - } - } - $this->y -= $yshift; - } - } - // restore previous values - $this->setGraphicVars($gvars); - if ($this->num_columns > 1) { - $this->selectColumn(); - } elseif ($this->page > $prevPage) { - $this->lMargin = $this->pagedim[$this->page]['olm']; - $this->rMargin = $this->pagedim[$this->page]['orm']; - } - // restore previous list state - $this->cell_height_ratio = $prev_cell_height_ratio; - $this->listnum = $prev_listnum; - $this->listordered = $prev_listordered; - $this->listcount = $prev_listcount; - $this->lispacer = $prev_lispacer; - if ($ln AND (!($cell AND ($dom[$key-1]['value'] == 'table')))) { - $this->Ln($this->lasth); - if ($this->y < $maxbottomliney) { - $this->y = $maxbottomliney; - } - } - unset($dom); - } - - /** - * Process opening tags. - * @param array $dom html dom array - * @param int $key current element id - * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). - * @access protected - */ - protected function openHTMLTagHandler(&$dom, $key, $cell) { - $tag = $dom[$key]; - $parent = $dom[($dom[$key]['parent'])]; - $firsttag = ($key == 1); - // check for text direction attribute - if (isset($tag['dir'])) { - $this->setTempRTL($tag['dir']); - } else { - $this->tmprtl = false; - } - if ($tag['block']) { - $hbz = 0; // distance from y to line bottom - $hb = 0; // vertical space between block tags - // calculate vertical space for block tags - if (isset($this->tagvspaces[$tag['value']][0]['h']) AND ($this->tagvspaces[$tag['value']][0]['h'] >= 0)) { - $cur_h = $this->tagvspaces[$tag['value']][0]['h']; - } elseif (isset($tag['fontsize'])) { - $cur_h = ($tag['fontsize'] / $this->k) * $this->cell_height_ratio; - } else { - $cur_h = $this->FontSize * $this->cell_height_ratio; - } - if (isset($this->tagvspaces[$tag['value']][0]['n'])) { - $n = $this->tagvspaces[$tag['value']][0]['n']; - } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { - $n = 0.6; - } else { - $n = 1; - } - $hb = ($n * $cur_h); - if (($this->htmlvspace <= 0) AND ($n > 0)) { - if (isset($parent['fontsize'])) { - $hbz = (($parent['fontsize'] / $this->k) * $this->cell_height_ratio); - } else { - $hbz = $this->FontSize * $this->cell_height_ratio; - } - } - } - // Opening tag - switch($tag['value']) { - case 'table': { - $cp = 0; - $cs = 0; - $dom[$key]['rowspans'] = array(); - if (!isset($dom[$key]['attribute']['nested']) OR ($dom[$key]['attribute']['nested'] != 'true')) { - // set table header - if (!$this->empty_string($dom[$key]['thead'])) { - // set table header - $this->thead = $dom[$key]['thead']; - if (!isset($this->theadMargins) OR (empty($this->theadMargins))) { - $this->theadMargins = array(); - $this->theadMargins['cell_padding'] = $this->cell_padding; - $this->theadMargins['lmargin'] = $this->lMargin; - $this->theadMargins['rmargin'] = $this->rMargin; - $this->theadMargins['page'] = $this->page; - } - } - } - // store current margins and page - $dom[$key]['old_cell_padding'] = $this->cell_padding; - if (isset($tag['attribute']['cellpadding'])) { - $pad = $this->getHTMLUnitToUnits($tag['attribute']['cellpadding'], 1, 'px'); - $this->SetCellPadding($pad); - } - if (isset($tag['attribute']['cellspacing'])) { - $cs = $this->getHTMLUnitToUnits($tag['attribute']['cellspacing'], 1, 'px'); - } - $prev_y = $this->y; - if ($this->checkPageBreak(((2 * $cp) + (2 * $cs) + $this->lasth), '', false) OR ($this->y < $prev_y)) { - $this->inthead = true; - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - break; - } - case 'tr': { - // array of columns positions - $dom[$key]['cellpos'] = array(); - break; - } - case 'hr': { - if ((isset($tag['height'])) AND ($tag['height'] != '')) { - $hrHeight = $this->getHTMLUnitToUnits($tag['height'], 1, 'px'); - } else { - $hrHeight = $this->GetLineWidth(); - } - $this->addHTMLVertSpace($hbz, ($hrHeight / 2), $cell, $firsttag); - $x = $this->GetX(); - $y = $this->GetY(); - $wtmp = $this->w - $this->lMargin - $this->rMargin; - if ($cell) { - $wtmp -= ($this->cell_padding['L'] + $this->cell_padding['R']); - } - if ((isset($tag['width'])) AND ($tag['width'] != '')) { - $hrWidth = $this->getHTMLUnitToUnits($tag['width'], $wtmp, 'px'); - } else { - $hrWidth = $wtmp; - } - $prevlinewidth = $this->GetLineWidth(); - $this->SetLineWidth($hrHeight); - $this->Line($x, $y, $x + $hrWidth, $y); - $this->SetLineWidth($prevlinewidth); - $this->addHTMLVertSpace(($hrHeight / 2), 0, $cell, !isset($dom[($key + 1)])); - break; - } - case 'a': { - if (array_key_exists('href', $tag['attribute'])) { - $this->HREF['url'] = $tag['attribute']['href']; - } - break; - } - case 'img': { - if (isset($tag['attribute']['src'])) { - // replace relative path with real server path - if (($tag['attribute']['src'][0] == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { - $findroot = strpos($tag['attribute']['src'], $_SERVER['DOCUMENT_ROOT']); - if (($findroot === false) OR ($findroot > 1)) { - $tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src']; - } - } - $tag['attribute']['src'] = urldecode($tag['attribute']['src']); - $type = $this->getImageFileType($tag['attribute']['src']); - $testscrtype = @parse_url($tag['attribute']['src']); - if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) { - // convert URL to server path - $tag['attribute']['src'] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag['attribute']['src']); - } - if (!isset($tag['width'])) { - $tag['width'] = 0; - } - if (!isset($tag['height'])) { - $tag['height'] = 0; - } - //if (!isset($tag['attribute']['align'])) { - // the only alignment supported is "bottom" - // further development is required for other modes. - $tag['attribute']['align'] = 'bottom'; - //} - switch($tag['attribute']['align']) { - case 'top': { - $align = 'T'; - break; - } - case 'middle': { - $align = 'M'; - break; - } - case 'bottom': { - $align = 'B'; - break; - } - default: { - $align = 'B'; - break; - } - } - $prevy = $this->y; - $xpos = $this->x; - // eliminate marker spaces - if (isset($dom[($key - 1)])) { - if (($dom[($key - 1)]['value'] == ' ') OR (isset($dom[($key - 1)]['trimmed_space']))) { - $xpos -= $this->GetStringWidth(chr(32)); - } elseif ($this->rtl AND $dom[($key - 1)]['value'] == ' ') { - $xpos += (2 * $this->GetStringWidth(chr(32))); - } - } - $imglink = ''; - if (isset($this->HREF['url']) AND !$this->empty_string($this->HREF['url'])) { - $imglink = $this->HREF['url']; - if ($imglink{0} == '#') { - // convert url to internal link - $lnkdata = explode(',', $imglink); - if (isset($lnkdata[0])) { - $page = intval(substr($lnkdata[0], 1)); - if (empty($page) OR ($page <= 0)) { - $page = $this->page; - } - if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) { - $lnky = floatval($lnkdata[1]); - } else { - $lnky = 0; - } - $imglink = $this->AddLink(); - $this->SetLink($imglink, $lnky, $page); - } - } - } - $border = 0; - if (isset($tag['border']) AND !empty($tag['border'])) { - // currently only support 1 (frame) or a combination of 'LTRB' - $border = $tag['border']; - } - $iw = ''; - if (isset($tag['width'])) { - $iw = $this->getHTMLUnitToUnits($tag['width'], 1, 'px', false); - } - $ih = ''; - if (isset($tag['height'])) { - $ih = $this->getHTMLUnitToUnits($tag['height'], 1, 'px', false); - } - if (($type == 'eps') OR ($type == 'ai')) { - $this->ImageEps($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, $imglink, true, $align, '', $border, true); - } elseif ($type == 'svg') { - $this->ImageSVG($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, $imglink, $align, '', $border, true); - } else { - $this->Image($tag['attribute']['src'], $xpos, $this->y, $iw, $ih, '', $imglink, $align, false, 300, '', false, false, $border, false, false, true); - } - switch($align) { - case 'T': { - $this->y = $prevy; - break; - } - case 'M': { - $this->y = (($this->img_rb_y + $prevy - ($tag['fontsize'] / $this->k)) / 2) ; - break; - } - case 'B': { - $this->y = $this->img_rb_y - ($tag['fontsize'] / $this->k); - break; - } - } - } - break; - } - case 'dl': { - ++$this->listnum; - if ($this->listnum == 1) { - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, $firsttag); - } - break; - } - case 'dt': { - $this->addHTMLVertSpace($hbz, 0, $cell, $firsttag); - break; - } - case 'dd': { - if ($this->rtl) { - $this->rMargin += $this->listindent; - } else { - $this->lMargin += $this->listindent; - } - ++$this->listindentlevel; - $this->addHTMLVertSpace($hbz, 0, $cell, $firsttag); - break; - } - case 'ul': - case 'ol': { - ++$this->listnum; - if ($tag['value'] == 'ol') { - $this->listordered[$this->listnum] = true; - } else { - $this->listordered[$this->listnum] = false; - } - if (isset($tag['attribute']['start'])) { - $this->listcount[$this->listnum] = intval($tag['attribute']['start']) - 1; - } else { - $this->listcount[$this->listnum] = 0; - } - if ($this->rtl) { - $this->rMargin += $this->listindent; - $this->x -= $this->listindent; - } else { - $this->lMargin += $this->listindent; - $this->x += $this->listindent; - } - ++$this->listindentlevel; - if ($this->listnum == 1) { - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, $firsttag); - } - break; - } - case 'li': { - $this->addHTMLVertSpace($hbz, 0, $cell, $firsttag); - if ($this->listordered[$this->listnum]) { - // ordered item - if (isset($parent['attribute']['type']) AND !$this->empty_string($parent['attribute']['type'])) { - $this->lispacer = $parent['attribute']['type']; - } elseif (isset($parent['listtype']) AND !$this->empty_string($parent['listtype'])) { - $this->lispacer = $parent['listtype']; - } elseif (isset($this->lisymbol) AND !$this->empty_string($this->lisymbol)) { - $this->lispacer = $this->lisymbol; - } else { - $this->lispacer = '#'; - } - ++$this->listcount[$this->listnum]; - if (isset($tag['attribute']['value'])) { - $this->listcount[$this->listnum] = intval($tag['attribute']['value']); - } - } else { - // unordered item - if (isset($parent['attribute']['type']) AND !$this->empty_string($parent['attribute']['type'])) { - $this->lispacer = $parent['attribute']['type']; - } elseif (isset($parent['listtype']) AND !$this->empty_string($parent['listtype'])) { - $this->lispacer = $parent['listtype']; - } elseif (isset($this->lisymbol) AND !$this->empty_string($this->lisymbol)) { - $this->lispacer = $this->lisymbol; - } else { - $this->lispacer = '!'; - } - } - break; - } - case 'blockquote': { - if ($this->rtl) { - $this->rMargin += $this->listindent; - } else { - $this->lMargin += $this->listindent; - } - ++$this->listindentlevel; - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - break; - } - case 'br': { - $this->addHTMLVertSpace($hbz, 0, $cell, $firsttag); - break; - } - case 'div': { - $this->addHTMLVertSpace($hbz, 0, $cell, $firsttag); - break; - } - case 'p': { - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - break; - } - case 'pre': { - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - $this->premode = true; - break; - } - case 'sup': { - $this->SetXY($this->GetX(), $this->GetY() - ((0.7 * $this->FontSizePt) / $this->k)); - break; - } - case 'sub': { - $this->SetXY($this->GetX(), $this->GetY() + ((0.3 * $this->FontSizePt) / $this->k)); - break; - } - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': { - $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); - break; - } - // Form fields (since 4.8.000 - 2009-09-07) - case 'form': { - if (isset($tag['attribute']['action'])) { - $this->form_action = $tag['attribute']['action']; - } else { - $this->form_action = K_PATH_URL.$_SERVER['SCRIPT_NAME']; - } - if (isset($tag['attribute']['enctype'])) { - $this->form_enctype = $tag['attribute']['enctype']; - } else { - $this->form_enctype = 'application/x-www-form-urlencoded'; - } - if (isset($tag['attribute']['method'])) { - $this->form_mode = $tag['attribute']['method']; - } else { - $this->form_mode = 'post'; - } - break; - } - case 'input': { - if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { - $name = $tag['attribute']['name']; - } else { - break; - } - $prop = array(); - $opt = array(); - if (isset($tag['attribute']['readonly']) AND !$this->empty_string($tag['attribute']['readonly'])) { - $prop['readonly'] = true; - } - if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) { - $value = $tag['attribute']['value']; - } - if (isset($tag['attribute']['maxlength']) AND !$this->empty_string($tag['attribute']['maxlength'])) { - $opt['maxlen'] = intval($tag['attribute']['value']); - } - $h = $this->FontSize * $this->cell_height_ratio; - if (isset($tag['attribute']['size']) AND !$this->empty_string($tag['attribute']['size'])) { - $w = intval($tag['attribute']['size']) * $this->GetStringWidth(chr(32)) * 2; - } else { - $w = $h; - } - if (isset($tag['attribute']['checked']) AND (($tag['attribute']['checked'] == 'checked') OR ($tag['attribute']['checked'] == 'true'))) { - $checked = true; - } else { - $checked = false; - } - switch ($tag['attribute']['type']) { - case 'text': { - if (isset($value)) { - $opt['v'] = $value; - } - $this->TextField($name, $w, $h, $prop, $opt, '', '', false); - break; - } - case 'password': { - if (isset($value)) { - $opt['v'] = $value; - } - $prop['password'] = 'true'; - $this->TextField($name, $w, $h, $prop, $opt, '', '', false); - break; - } - case 'checkbox': { - $this->CheckBox($name, $w, $checked, $prop, $opt, $value, '', '', false); - break; - } - case 'radio': { - $this->RadioButton($name, $w, $prop, $opt, $value, $checked, '', '', false); - break; - } - case 'submit': { - $w = $this->GetStringWidth($value) * 1.5; - $h *= 1.6; - $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); - $action = array(); - $action['S'] = 'SubmitForm'; - $action['F'] = $this->form_action; - if ($this->form_enctype != 'FDF') { - $action['Flags'] = array('ExportFormat'); - } - if ($this->form_mode == 'get') { - $action['Flags'] = array('GetMethod'); - } - $this->Button($name, $w, $h, $value, $action, $prop, $opt, '', '', false); - break; - } - case 'reset': { - $w = $this->GetStringWidth($value) * 1.5; - $h *= 1.6; - $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); - $this->Button($name, $w, $h, $value, array('S'=>'ResetForm'), $prop, $opt, '', '', false); - break; - } - case 'file': { - $prop['fileSelect'] = 'true'; - $this->TextField($name, $w, $h, $prop, $opt, '', '', false); - if (!isset($value)) { - $value = '*'; - } - $w = $this->GetStringWidth($value) * 2; - $h *= 1.2; - $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); - $jsaction = 'var f=this.getField(\''.$name.'\'); f.browseForFileToSubmit();'; - $this->Button('FB_'.$name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); - break; - } - case 'hidden': { - if (isset($value)) { - $opt['v'] = $value; - } - $opt['f'] = array('invisible', 'hidden'); - $this->TextField($name, 0, 0, $prop, $opt, '', '', false); - break; - } - case 'image': { - // THIS TYPE MUST BE FIXED - if (isset($tag['attribute']['src']) AND !$this->empty_string($tag['attribute']['src'])) { - $img = $tag['attribute']['src']; - } else { - break; - } - $value = 'img'; - //$opt['mk'] = array('i'=>$img, 'tp'=>1, 'if'=>array('sw'=>'A', 's'=>'A', 'fb'=>false)); - if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { - $jsaction = $tag['attribute']['onclick']; - } else { - $jsaction = ''; - } - $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); - break; - } - case 'button': { - $w = $this->GetStringWidth($value) * 1.5; - $h *= 1.6; - $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); - if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { - $jsaction = $tag['attribute']['onclick']; - } else { - $jsaction = ''; - } - $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); - break; - } - } - break; - } - case 'textarea': { - $prop = array(); - $opt = array(); - if (isset($tag['attribute']['readonly']) AND !$this->empty_string($tag['attribute']['readonly'])) { - $prop['readonly'] = true; - } - if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { - $name = $tag['attribute']['name']; - } else { - break; - } - if (isset($tag['attribute']['value']) AND !$this->empty_string($tag['attribute']['value'])) { - $opt['v'] = $tag['attribute']['value']; - } - if (isset($tag['attribute']['cols']) AND !$this->empty_string($tag['attribute']['cols'])) { - $w = intval($tag['attribute']['cols']) * $this->GetStringWidth(chr(32)) * 2; - } else { - $w = 40; - } - if (isset($tag['attribute']['rows']) AND !$this->empty_string($tag['attribute']['rows'])) { - $h = intval($tag['attribute']['rows']) * $this->FontSize * $this->cell_height_ratio; - } else { - $h = 10; - } - $prop['multiline'] = 'true'; - $this->TextField($name, $w, $h, $prop, $opt, '', '', false); - break; - } - case 'select': { - $h = $this->FontSize * $this->cell_height_ratio; - if (isset($tag['attribute']['size']) AND !$this->empty_string($tag['attribute']['size'])) { - $h *= ($tag['attribute']['size'] + 1); - } - $prop = array(); - $opt = array(); - if (isset($tag['attribute']['name']) AND !$this->empty_string($tag['attribute']['name'])) { - $name = $tag['attribute']['name']; - } else { - break; - } - $w = 0; - if (isset($tag['attribute']['opt']) AND !$this->empty_string($tag['attribute']['opt'])) { - $options = explode('#!NwL!#', $tag['attribute']['opt']); - $values = array(); - foreach ($options as $val) { - if (strpos($val, '#!TaB!#') !== false) { - $opts = explode('#!TaB!#', $val); - $values[] = $opts; - $w = max($w, $this->GetStringWidth($opts[1])); - } else { - $values[] = $val; - $w = max($w, $this->GetStringWidth($val)); - } - } - } else { - break; - } - $w *= 2; - if (isset($tag['attribute']['multiple']) AND ($tag['attribute']['multiple']='multiple')) { - $prop['multipleSelection'] = 'true'; - $this->ListBox($name, $w, $h, $values, $prop, $opt, '', '', false); - } else { - $this->ComboBox($name, $w, $h, $values, $prop, $opt, '', '', false); - } - break; - } - case 'tcpdf': { - if (defined('K_TCPDF_CALLS_IN_HTML') AND (K_TCPDF_CALLS_IN_HTML === true)) { - // Special tag used to call TCPDF methods - if (isset($tag['attribute']['method'])) { - $tcpdf_method = $tag['attribute']['method']; - if (method_exists($this, $tcpdf_method)) { - if (isset($tag['attribute']['params']) AND (!empty($tag['attribute']['params']))) { - $params = unserialize(urldecode($tag['attribute']['params'])); - call_user_func_array(array($this, $tcpdf_method), $params); - } else { - $this->$tcpdf_method(); - } - $this->newline = true; - } - } - } - break; - } - default: { - break; - } - } - // define tags that support borders and background colors - $bordertags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table'); - if (in_array($tag['value'], $bordertags)) { - // set border - $dom[$key]['borderposition'] = $this->getBorderStartPosition(); - } - if ($dom[$key]['self'] AND isset($dom[$key]['attribute']['pagebreakafter'])) { - $pba = $dom[$key]['attribute']['pagebreakafter']; - // check for pagebreak - if (($pba == 'true') OR ($pba == 'left') OR ($pba == 'right')) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - if ((($pba == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) - OR (($pba == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - } - } - - /** - * Process closing tags. - * @param array $dom html dom array - * @param int $key current element id - * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). - * @param int $maxbottomliney maximum y value of current line - * @access protected - */ - protected function closeHTMLTagHandler(&$dom, $key, $cell, $maxbottomliney=0) { - $tag = $dom[$key]; - $parent = $dom[($dom[$key]['parent'])]; - $lasttag = ((!isset($dom[($key + 1)])) OR ((!isset($dom[($key + 2)])) AND ($dom[($key + 1)]['value'] == 'marker'))); - $in_table_head = false; - // maximum x position (used to draw borders) - if ($this->rtl) { - $xmax = $this->w; - } else { - $xmax = 0; - } - if ($tag['block']) { - $hbz = 0; // distance from y to line bottom - $hb = 0; // vertical space between block tags - // calculate vertical space for block tags - if (isset($this->tagvspaces[$tag['value']][1]['h']) AND ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) { - $pre_h = $this->tagvspaces[$tag['value']][1]['h']; - } elseif (isset($parent['fontsize'])) { - $pre_h = (($parent['fontsize'] / $this->k) * $this->cell_height_ratio); - } else { - $pre_h = $this->FontSize * $this->cell_height_ratio; - } - if (isset($this->tagvspaces[$tag['value']][1]['n'])) { - $n = $this->tagvspaces[$tag['value']][1]['n']; - } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { - $n = 0.6; - } else { - $n = 1; - } - $hb = ($n * $pre_h); - if ($this->y < $maxbottomliney) { - $hbz = ($maxbottomliney - $this->y); - } - } - // Closing tag - switch($tag['value']) { - case 'tr': { - $table_el = $dom[($dom[$key]['parent'])]['parent']; - if (!isset($parent['endy'])) { - $dom[($dom[$key]['parent'])]['endy'] = $this->y; - $parent['endy'] = $this->y; - } - if (!isset($parent['endpage'])) { - $dom[($dom[$key]['parent'])]['endpage'] = $this->page; - $parent['endpage'] = $this->page; - } - if (!isset($parent['endcolumn'])) { - $dom[($dom[$key]['parent'])]['endcolumn'] = $this->current_column; - $parent['endcolumn'] = $this->current_column; - } - // update row-spanned cells - if (isset($dom[$table_el]['rowspans'])) { - foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { - $dom[$table_el]['rowspans'][$k]['rowspan'] -= 1; - if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { - if (($dom[$table_el]['rowspans'][$k]['endpage'] == $parent['endpage']) AND ($dom[$table_el]['rowspans'][$k]['endcolumn'] == $parent['endcolumn'])) { - $dom[($dom[$key]['parent'])]['endy'] = max($dom[$table_el]['rowspans'][$k]['endy'], $parent['endy']); - } elseif (($dom[$table_el]['rowspans'][$k]['endpage'] > $parent['endpage']) OR ($dom[$table_el]['rowspans'][$k]['endcolumn'] > $parent['endcolumn'])) { - $dom[($dom[$key]['parent'])]['endy'] = $dom[$table_el]['rowspans'][$k]['endy']; - $dom[($dom[$key]['parent'])]['endpage'] = $dom[$table_el]['rowspans'][$k]['endpage']; - $dom[($dom[$key]['parent'])]['endcolumn'] = $dom[$table_el]['rowspans'][$k]['endcolumn']; - } - } - } - // report new endy and endpage to the rowspanned cells - foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { - if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { - $dom[$table_el]['rowspans'][$k]['endpage'] = max($dom[$table_el]['rowspans'][$k]['endpage'], $dom[($dom[$key]['parent'])]['endpage']); - $dom[($dom[$key]['parent'])]['endpage'] = $dom[$table_el]['rowspans'][$k]['endpage']; - $dom[$table_el]['rowspans'][$k]['endcolumn'] = max($dom[$table_el]['rowspans'][$k]['endcolumn'], $dom[($dom[$key]['parent'])]['endcolumn']); - $dom[($dom[$key]['parent'])]['endcolumn'] = $dom[$table_el]['rowspans'][$k]['endcolumn']; - $dom[$table_el]['rowspans'][$k]['endy'] = max($dom[$table_el]['rowspans'][$k]['endy'], $dom[($dom[$key]['parent'])]['endy']); - $dom[($dom[$key]['parent'])]['endy'] = $dom[$table_el]['rowspans'][$k]['endy']; - } - } - // update remaining rowspanned cells - foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { - if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { - $dom[$table_el]['rowspans'][$k]['endpage'] = $dom[($dom[$key]['parent'])]['endpage']; - $dom[$table_el]['rowspans'][$k]['endcolumn'] = $dom[($dom[$key]['parent'])]['endcolumn']; - $dom[$table_el]['rowspans'][$k]['endy'] = $dom[($dom[$key]['parent'])]['endy']; - } - } - } - $this->setPage($dom[($dom[$key]['parent'])]['endpage']); - if ($this->num_columns > 1) { - $this->selectColumn($dom[($dom[$key]['parent'])]['endcolumn']); - } - $this->y = $dom[($dom[$key]['parent'])]['endy']; - if (isset($dom[$table_el]['attribute']['cellspacing'])) { - $cellspacing = $this->getHTMLUnitToUnits($dom[$table_el]['attribute']['cellspacing'], 1, 'px'); - $this->y += $cellspacing; - } - $this->Ln(0, $cell); - if ($this->current_column == $parent['startcolumn']) { - $this->x = $parent['startx']; - } - // account for booklet mode - if ($this->page > $parent['startpage']) { - if (($this->rtl) AND ($this->pagedim[$this->page]['orm'] != $this->pagedim[$parent['startpage']]['orm'])) { - $this->x -= ($this->pagedim[$this->page]['orm'] - $this->pagedim[$parent['startpage']]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$this->page]['olm'] != $this->pagedim[$parent['startpage']]['olm'])) { - $this->x += ($this->pagedim[$this->page]['olm'] - $this->pagedim[$parent['startpage']]['olm']); - } - } - break; - } - case 'tablehead': - // closing tag used for the thead part - $in_table_head = true; - $this->inthead = false; - case 'table': { - $table_el = $parent; - // set default border - if (isset($table_el['attribute']['border']) AND ($table_el['attribute']['border'] > 0)) { - // set default border - $border = array('LTRB' => array('width' => $this->getCSSBorderWidth($table_el['attribute']['border']), 'cap'=>'square', 'join'=>'miter', 'dash'=> 0, 'color'=>array(0,0,0))); - } else { - $border = 0; - } - $default_border = $border; - if (isset($table_el['attribute']['cellspacing'])) { - $cellspacing = $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px'); - } else { - $cellspacing = 0; - } - // fix bottom line alignment of last line before page break - foreach ($dom[($dom[$key]['parent'])]['trids'] as $j => $trkey) { - // update row-spanned cells - if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { - foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { - if ($trwsp['trid'] == $trkey) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] -= 1; - } - if (isset($prevtrkey) AND ($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] >= 0)) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] = $trkey; - } - } - } - if (isset($prevtrkey) AND ($dom[$trkey]['startpage'] > $dom[$prevtrkey]['endpage'])) { - $pgendy = $this->pagedim[$dom[$prevtrkey]['endpage']]['hk'] - $this->pagedim[$dom[$prevtrkey]['endpage']]['bm']; - $dom[$prevtrkey]['endy'] = $pgendy; - // update row-spanned cells - if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { - foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { - if (($trwsp['trid'] == $trkey) AND ($trwsp['mrowspan'] > 1) AND ($trwsp['endpage'] == $dom[$prevtrkey]['endpage'])) { - $dom[($dom[$key]['parent'])]['rowspans'][$k]['endy'] = $pgendy; - $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] = -1; - } - } - } - } - $prevtrkey = $trkey; - $table_el = $dom[($dom[$key]['parent'])]; - } - // for each row - unset($xmax); - foreach ($table_el['trids'] as $j => $trkey) { - $parent = $dom[$trkey]; - if (!isset($xmax)) { - $xmax = $parent['cellpos'][(count($parent['cellpos']) - 1)]['endx']; - } - // for each cell on the row - foreach ($parent['cellpos'] as $k => $cellpos) { - if (isset($cellpos['rowspanid']) AND ($cellpos['rowspanid'] >= 0)) { - $cellpos['startx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['startx']; - $cellpos['endx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['endx']; - $endy = $table_el['rowspans'][($cellpos['rowspanid'])]['endy']; - $startpage = $table_el['rowspans'][($cellpos['rowspanid'])]['startpage']; - $endpage = $table_el['rowspans'][($cellpos['rowspanid'])]['endpage']; - $startcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['startcolumn']; - $endcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['endcolumn']; - } else { - $endy = $parent['endy']; - $startpage = $parent['startpage']; - $endpage = $parent['endpage']; - $startcolumn = $parent['startcolumn']; - $endcolumn = $parent['endcolumn']; - } - if ($this->num_columns == 0) { - $this->num_columns = 1; - } - if (isset($cellpos['border'])) { - $border = $cellpos['border']; - } - if (isset($cellpos['bgcolor']) AND ($cellpos['bgcolor']) !== false) { - $this->SetFillColorArray($cellpos['bgcolor']); - $fill = true; - } else { - $fill = false; - } - $x = $cellpos['startx']; - $y = $parent['starty']; - $starty = $y; - $w = abs($cellpos['endx'] - $cellpos['startx']); - // get border modes - $border_start = $this->getBorderMode($border, $position='start'); - $border_end = $this->getBorderMode($border, $position='end'); - $border_middle = $this->getBorderMode($border, $position='middle'); - // design borders around HTML cells. - for ($page = $startpage; $page <= $endpage; ++$page) { // for each page - $ccode = ''; - $this->setPage($page); - if ($this->num_columns < 2) { - // single-column mode - $this->x = $x; - $this->y = $this->tMargin; - } - // account for margin changes - if ($page > $startpage) { - if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); - } - } - if ($startpage == $endpage) { // single page - $deltacol = 0; - $deltath = 0; - for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($startcolumn == $endcolumn) { // single column - $cborder = $border; - $h = $endy - $parent['starty']; - $this->y = $y; - $this->x = $x; - } elseif ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $this->x = $x; - $h = $this->h - $this->y - $this->bMargin; - if ($this->rtl) { - $deltacol = $this->x + $this->rMargin - $this->w; - } else { - $deltacol = $this->x - $this->lMargin; - } - } elseif ($column == $endcolumn) { // end column - $cborder = $border_end; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $endy - $this->y; - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $startpage) { // first page - $deltacol = 0; - $deltath = 0; - for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $this->x = $x; - $h = $this->h - $this->y - $this->bMargin; - if ($this->rtl) { - $deltacol = $this->x + $this->rMargin - $this->w; - } else { - $deltacol = $this->x - $this->lMargin; - } - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $endpage) { // last page - $deltacol = 0; - $deltath = 0; - for ($column = 0; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $endcolumn) { // end column - $cborder = $border_end; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $endy - $this->y; - } else { // middle column - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } else { // middle page - $deltacol = 0; - $deltath = 0; - for ($column = 0; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - $cborder = $border_middle; - if (isset($this->columns[$column]['th']['\''.$page.'\''])) { - $this->y = $this->columns[$column]['th']['\''.$page.'\'']; - } - $this->x += $deltacol; - $h = $this->h - $this->y - $this->bMargin; - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } - if ($cborder OR $fill) { - // draw border and fill - if ($this->inxobj) { - // we are inside an XObject template - if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { - $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); - $pagemark = &$this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; - } else { - $pagemark = &$this->xobjects[$this->xobjid]['intmrk']; - } - $pagebuff = $this->xobjects[$this->xobjid]['outdata']; - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; - $pagemark += strlen($ccode); - } else { - // draw border and fill - if (end($this->transfmrk[$this->page]) !== false) { - $pagemarkkey = key($this->transfmrk[$this->page]); - $pagemark = &$this->transfmrk[$this->page][$pagemarkkey]; - } elseif ($this->InFooter) { - $pagemark = &$this->footerpos[$this->page]; - } else { - $pagemark = &$this->intmrk[$this->page]; - } - $pagebuff = $this->getPageBuffer($this->page); - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->setPageBuffer($this->page, $pstart.$ccode.$pend); - $pagemark += strlen($ccode); - } - } - } // end for each page - // restore default border - $border = $default_border; - } // end for each cell on the row - if (isset($table_el['attribute']['cellspacing'])) { - $cellspacing = $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px'); - $this->y += $cellspacing; - } - $this->Ln(0, $cell); - $this->x = $parent['startx']; - if ($endpage > $startpage) { - if (($this->rtl) AND ($this->pagedim[$endpage]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x += ($this->pagedim[$endpage]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$endpage]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$endpage]['olm'] - $this->pagedim[$startpage]['olm']); - } - } - } - if (!$in_table_head) { // we are not inside a thead section - $this->cell_padding = $table_el['old_cell_padding']; - // reset row height - $this->resetLastH(); - if (($this->page == ($this->numpages - 1)) AND ($this->pageopen[$this->numpages]) AND ($this->emptypagemrk[$this->numpages] == $this->pagelen[$this->numpages])) { - // remove last blank page - $this->deletePage($this->numpages); - } - if (isset($this->theadMargins['top'])) { - // restore top margin - $this->tMargin = $this->theadMargins['top']; - $this->pagedim[$this->page]['tm'] = $this->tMargin; - } - if (!isset($table_el['attribute']['nested']) OR ($table_el['attribute']['nested'] != 'true')) { - // reset main table header - $this->thead = ''; - $this->theadMargins = array(); - } - } - $parent = $table_el; - break; - } - case 'a': { - $this->HREF = ''; - break; - } - case 'sup': { - $this->SetXY($this->GetX(), $this->GetY() + ((0.7 * $parent['fontsize']) / $this->k)); - break; - } - case 'sub': { - $this->SetXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize'])/$this->k)); - break; - } - case 'div': { - $this->addHTMLVertSpace($hbz, 0, $cell, false, $lasttag); - break; - } - case 'blockquote': { - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; - } - --$this->listindentlevel; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - case 'p': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - case 'pre': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - $this->premode = false; - break; - } - case 'dl': { - --$this->listnum; - if ($this->listnum <= 0) { - $this->listnum = 0; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - } - $this->resetLastH(); - break; - } - case 'dt': { - $this->lispacer = ''; - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; - } - case 'dd': { - $this->lispacer = ''; - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; - } - --$this->listindentlevel; - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; - } - case 'ul': - case 'ol': { - --$this->listnum; - $this->lispacer = ''; - if ($this->rtl) { - $this->rMargin -= $this->listindent; - } else { - $this->lMargin -= $this->listindent; - } - --$this->listindentlevel; - if ($this->listnum <= 0) { - $this->listnum = 0; - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - } else { - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - } - $this->resetLastH(); - break; - } - case 'li': { - $this->lispacer = ''; - $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); - break; - } - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': { - $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); - break; - } - // Form fields (since 4.8.000 - 2009-09-07) - case 'form': { - $this->form_action = ''; - $this->form_enctype = 'application/x-www-form-urlencoded'; - break; - } - default : { - break; - } - } - // draw border and background (if any) - $this->drawHTMLTagBorder($parent, $xmax); - if (isset($dom[($dom[$key]['parent'])]['attribute']['pagebreakafter'])) { - $pba = $dom[($dom[$key]['parent'])]['attribute']['pagebreakafter']; - // check for pagebreak - if (($pba == 'true') OR ($pba == 'left') OR ($pba == 'right')) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - if ((($pba == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) - OR (($pba == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { - // add a page (or trig AcceptPageBreak() for multicolumn mode) - $this->checkPageBreak($this->PageBreakTrigger + 1); - } - } - $this->tmprtl = false; - } - - /** - * Add vertical spaces if needed. - * @param string $hbz Distance between current y and line bottom. - * @param string $hb The height of the break. - * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). - * @param boolean $firsttag set to true when the tag is the first. - * @param boolean $lasttag set to true when the tag is the last. - * @access protected - */ - protected function addHTMLVertSpace($hbz=0, $hb=0, $cell=false, $firsttag=false, $lasttag=false) { - if ($firsttag) { - $this->Ln(0, $cell); - $this->htmlvspace = 0; - return; - } - if ($lasttag) { - $this->Ln($hbz, $cell); - $this->htmlvspace = 0; - return; - } - if ($hb < $this->htmlvspace) { - $hd = 0; - } else { - $hd = $hb - $this->htmlvspace; - $this->htmlvspace = $hb; - } - $this->Ln(($hbz + $hd), $cell); - } - - /** - * Return the starting coordinates to draw an html border - * @return array containing top-left border coordinates - * @access protected - * @since 5.7.000 (2010-08-03) - */ - protected function getBorderStartPosition() { - if ($this->rtl) { - $xmax = $this->lMargin; - } else { - $xmax = $this->w - $this->rMargin; - } - return array('page' => $this->page, 'column' => $this->current_column, 'x' => $this->x, 'y' => $this->y, 'xmax' => $xmax); - } - - /** - * Draw an HTML block border and fill - * @param array $tag array of tag properties. - * @param int $xmax end X coordinate for border. - * @access protected - * @since 5.7.000 (2010-08-03) - */ - protected function drawHTMLTagBorder($tag, $xmax) { - if (!isset($tag['borderposition'])) { - // nothing to draw - return; - } - $prev_x = $this->x; - $prev_y = $this->y; - $prev_lasth = $this->lasth; - $border = 0; - $fill = false; - $this->lasth = 0; - if (isset($tag['border']) AND !empty($tag['border'])) { - // get border style - $border = $tag['border']; - if (!$this->empty_string($this->thead) AND (!$this->inthead)) { - // border for table header - $border = $this->getBorderMode($border, $position='middle'); - } - } - if (isset($tag['bgcolor']) AND ($tag['bgcolor'] !== false)) { - // get background color - $old_bgcolor = $this->bgcolor; - $this->SetFillColorArray($tag['bgcolor']); - $fill = true; - } - if (!$border AND !$fill) { - // nothing to draw - return; - } - if (isset($tag['attribute']['cellspacing'])) { - $cellspacing = $this->getHTMLUnitToUnits($tag['attribute']['cellspacing'], 1, 'px'); - } else { - $cellspacing = 0; - } - if (($tag['value'] != 'table') AND (is_array($border)) AND (!empty($border))) { - // draw the border externally respect the sqare edge. - $border['mode'] = 'ext'; - } - if ($this->rtl) { - if ($xmax >= $tag['borderposition']['x']) { - $xmax = $tag['borderposition']['xmax']; - } - $w = ($tag['borderposition']['x'] - $xmax); - } else { - if ($xmax <= $tag['borderposition']['x']) { - $xmax = $tag['borderposition']['xmax']; - } - $w = ($xmax - $tag['borderposition']['x']); - } - if ($w <= 0) { - return; - } - $w += $cellspacing; - $startpage = $tag['borderposition']['page']; - $startcolumn = $tag['borderposition']['column']; - $x = $tag['borderposition']['x']; - $y = $tag['borderposition']['y']; - $endpage = $this->page; - $starty = $tag['borderposition']['y'] - $cellspacing; - $currentY = $this->y; - $this->x = $x; - // get latest column - $endcolumn = $this->current_column; - if ($this->num_columns == 0) { - $this->num_columns = 1; - } - // get border modes - $border_start = $this->getBorderMode($border, $position='start'); - $border_end = $this->getBorderMode($border, $position='end'); - $border_middle = $this->getBorderMode($border, $position='middle'); - // design borders around HTML cells. - for ($page = $startpage; $page <= $endpage; ++$page) { // for each page - $ccode = ''; - $this->setPage($page); - if ($this->num_columns < 2) { - // single-column mode - $this->x = $x; - $this->y = $this->tMargin; - } - // account for margin changes - if ($page > $startpage) { - if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { - $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); - } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { - $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); - } - } - if ($startpage == $endpage) { - // single page - for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($startcolumn == $endcolumn) { // single column - $cborder = $border; - $h = ($currentY - $y) + $cellspacing; - $this->y = $starty; - } elseif ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $h = $this->h - $this->y - $this->bMargin; - } elseif ($column == $endcolumn) { // end column - $cborder = $border_end; - $h = $currentY - $this->y; - } else { // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $startpage) { // first page - for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $startcolumn) { // first column - $cborder = $border_start; - $this->y = $starty; - $h = $this->h - $this->y - $this->bMargin; - } else { // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } elseif ($page == $endpage) { // last page - for ($column = 0; $column <= $endcolumn; ++$column) { // for each column - $this->selectColumn($column); - if ($column == $endcolumn) { - // end column - $cborder = $border_end; - $h = $currentY - $this->y; - } else { - // middle column - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - } - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } else { // middle page - for ($column = 0; $column < $this->num_columns; ++$column) { // for each column - $this->selectColumn($column); - $cborder = $border_middle; - $h = $this->h - $this->y - $this->bMargin; - $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; - } // end for each column - } - if ($cborder OR $fill) { - // draw border and fill - if ($this->inxobj) { - // we are inside an XObject template - if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { - $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); - $pagemark = &$this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; - } else { - $pagemark = &$this->xobjects[$this->xobjid]['intmrk']; - } - $pagebuff = $this->xobjects[$this->xobjid]['outdata']; - $pstart = substr($pagebuff, 0, $pagemark); - $pend = substr($pagebuff, $pagemark); - $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; - $pagemark += strlen($ccode); - } else { - if (end($this->transfmrk[$this->page]) !== false) { - $pagemarkkey = key($this->transfmrk[$this->page]); - $pagemark = &$this->transfmrk[$this->page][$pagemarkkey]; - } elseif ($this->InFooter) { - $pagemark = &$this->footerpos[$this->page]; - } else { - $pagemark = &$this->intmrk[$this->page]; - } - $pagebuff = $this->getPageBuffer($this->page); - $pstart = substr($pagebuff, 0, $this->bordermrk[$this->page]); - $pend = substr($pagebuff, $this->bordermrk[$this->page]); - $this->setPageBuffer($this->page, $pstart.$ccode.$pend); - $offsetlen = strlen($ccode); - $this->bordermrk[$this->page] += $offsetlen; - $this->cntmrk[$this->page] += $offsetlen; - $pagemark += $offsetlen; - } - } - } // end for each page - if (isset($old_bgcolor)) { - // restore background color - $this->SetFillColorArray($old_bgcolor); - } - // restore pointer position - $this->x = $prev_x; - $this->y = $prev_y; - $this->lasth = $prev_lasth; - } - - /** - * Set the default bullet to be used as LI bullet symbol - * @param string $symbol character or string to be used (legal values are: '' = automatic, '!' = auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek') - * @access public - * @since 4.0.028 (2008-09-26) - */ - public function setLIsymbol($symbol='!') { - $symbol = strtolower($symbol); - switch ($symbol) { - case '!' : - case '#' : - case 'disc' : - case 'circle' : - case 'square' : - case '1': - case 'decimal': - case 'decimal-leading-zero': - case 'i': - case 'lower-roman': - case 'I': - case 'upper-roman': - case 'a': - case 'lower-alpha': - case 'lower-latin': - case 'A': - case 'upper-alpha': - case 'upper-latin': - case 'lower-greek': { - $this->lisymbol = $symbol; - break; - } - default : { - $this->lisymbol = ''; - } - } - } - - /** - * Set the booklet mode for double-sided pages. - * @param boolean $booklet true set the booklet mode on, false otherwise. - * @param float $inner Inner page margin. - * @param float $outer Outer page margin. - * @access public - * @since 4.2.000 (2008-10-29) - */ - public function SetBooklet($booklet=true, $inner=-1, $outer=-1) { - $this->booklet = $booklet; - if ($inner >= 0) { - $this->lMargin = $inner; - } - if ($outer >= 0) { - $this->rMargin = $outer; - } - } - - /** - * Swap the left and right margins. - * @param boolean $reverse if true swap left and right margins. - * @access protected - * @since 4.2.000 (2008-10-29) - */ - protected function swapMargins($reverse=true) { - if ($reverse) { - // swap left and right margins - $mtemp = $this->original_lMargin; - $this->original_lMargin = $this->original_rMargin; - $this->original_rMargin = $mtemp; - $deltam = $this->original_lMargin - $this->original_rMargin; - $this->lMargin += $deltam; - $this->rMargin -= $deltam; - } - } - - /** - * Set the vertical spaces for HTML tags. - * The array must have the following structure (example): - * $tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); - * The first array level contains the tag names, - * the second level contains 0 for opening tags or 1 for closing tags, - * the third level contains the vertical space unit (h) and the number spaces to add (n). - * If the h parameter is not specified, default values are used. - * @param array $tagvs array of tags and relative vertical spaces. - * @access public - * @since 4.2.001 (2008-10-30) - */ - public function setHtmlVSpace($tagvs) { - $this->tagvspaces = $tagvs; - } - - /** - * Set custom width for list indentation. - * @param float $width width of the indentation. Use negative value to disable it. - * @access public - * @since 4.2.007 (2008-11-12) - */ - public function setListIndentWidth($width) { - return $this->customlistindent = floatval($width); - } - - /** - * Set the top/bottom cell sides to be open or closed when the cell cross the page. - * @param boolean $isopen if true keeps the top/bottom border open for the cell sides that cross the page. - * @access public - * @since 4.2.010 (2008-11-14) - */ - public function setOpenCell($isopen) { - $this->opencell = $isopen; - } - - /** - * Set the color and font style for HTML links. - * @param array $color RGB array of colors - * @param string $fontstyle additional font styles to add - * @access public - * @since 4.4.003 (2008-12-09) - */ - public function setHtmlLinksStyle($color=array(0,0,255), $fontstyle='U') { - $this->htmlLinkColorArray = $color; - $this->htmlLinkFontStyle = $fontstyle; - } - - /** - * Convert HTML string containing value and unit of measure to user's units or points. - * @param string $htmlval string containing values and unit - * @param string $refsize reference value in points - * @param string $defaultunit default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). - * @param boolean $point if true returns points, otherwise returns value in user's units - * @return float value in user's unit or point if $points=true - * @access public - * @since 4.4.004 (2008-12-10) - */ - public function getHTMLUnitToUnits($htmlval, $refsize=1, $defaultunit='px', $points=false) { - $supportedunits = array('%', 'em', 'ex', 'px', 'in', 'cm', 'mm', 'pc', 'pt'); - $retval = 0; - $value = 0; - $unit = 'px'; - $k = $this->k; - if ($points) { - $k = 1; - } - if (in_array($defaultunit, $supportedunits)) { - $unit = $defaultunit; - } - if (is_numeric($htmlval)) { - $value = floatval($htmlval); - } elseif (preg_match('/([0-9\.\-\+]+)/', $htmlval, $mnum)) { - $value = floatval($mnum[1]); - if (preg_match('/([a-z%]+)/', $htmlval, $munit)) { - if (in_array($munit[1], $supportedunits)) { - $unit = $munit[1]; - } - } - } - switch ($unit) { - // percentage - case '%': { - $retval = (($value * $refsize) / 100); - break; - } - // relative-size - case 'em': { - $retval = ($value * $refsize); - break; - } - // height of lower case 'x' (about half the font-size) - case 'ex': { - $retval = $value * ($refsize / 2); - break; - } - // absolute-size - case 'in': { - $retval = ($value * $this->dpi) / $k; - break; - } - // centimeters - case 'cm': { - $retval = ($value / 2.54 * $this->dpi) / $k; - break; - } - // millimeters - case 'mm': { - $retval = ($value / 25.4 * $this->dpi) / $k; - break; - } - // one pica is 12 points - case 'pc': { - $retval = ($value * 12) / $k; - break; - } - // points - case 'pt': { - $retval = $value / $k; - break; - } - // pixels - case 'px': { - $retval = $this->pixelsToUnits($value); - break; - } - } - return $retval; - } - - /** - * Returns the Roman representation of an integer number - * @param int number to convert - * @return string roman representation of the specified number - * @access public - * @since 4.4.004 (2008-12-10) - */ - public function intToRoman($number) { - $roman = ''; - while ($number >= 1000) { - $roman .= 'M'; - $number -= 1000; - } - while ($number >= 900) { - $roman .= 'CM'; - $number -= 900; - } - while ($number >= 500) { - $roman .= 'D'; - $number -= 500; - } - while ($number >= 400) { - $roman .= 'CD'; - $number -= 400; - } - while ($number >= 100) { - $roman .= 'C'; - $number -= 100; - } - while ($number >= 90) { - $roman .= 'XC'; - $number -= 90; - } - while ($number >= 50) { - $roman .= 'L'; - $number -= 50; - } - while ($number >= 40) { - $roman .= 'XL'; - $number -= 40; - } - while ($number >= 10) { - $roman .= 'X'; - $number -= 10; - } - while ($number >= 9) { - $roman .= 'IX'; - $number -= 9; - } - while ($number >= 5) { - $roman .= 'V'; - $number -= 5; - } - while ($number >= 4) { - $roman .= 'IV'; - $number -= 4; - } - while ($number >= 1) { - $roman .= 'I'; - --$number; - } - return $roman; - } - - /** - * Output an HTML list bullet or ordered item symbol - * @param int $listdepth list nesting level - * @param string $listtype type of list - * @param float $size current font size - * @access protected - * @since 4.4.004 (2008-12-10) - */ - protected function putHtmlListBullet($listdepth, $listtype='', $size=10) { - $size /= $this->k; - $fill = ''; - $color = $this->fgcolor; - $width = 0; - $textitem = ''; - $tmpx = $this->x; - $lspace = $this->GetStringWidth(' '); - if ($listtype == '^') { - // special symbol used for avoid justification of rect bullet - $this->lispacer = ''; - return; - } elseif ($listtype == '!') { - // set default list type for unordered list - $deftypes = array('disc', 'circle', 'square'); - $listtype = $deftypes[($listdepth - 1) % 3]; - } elseif ($listtype == '#') { - // set default list type for ordered list - $listtype = 'decimal'; - } - switch ($listtype) { - // unordered types - case 'none': { - break; - } - case 'disc': { - $fill = 'F'; - } - case 'circle': { - $fill .= 'D'; - $r = $size / 6; - $lspace += (2 * $r); - if ($this->rtl) { - $this->x += $lspace; - } else { - $this->x -= $lspace; - } - $this->Circle(($this->x + $r), ($this->y + ($this->lasth / 2)), $r, 0, 360, $fill, array('color'=>$color), $color, 8); - break; - } - case 'square': { - $l = $size / 3; - $lspace += $l; - if ($this->rtl) {; - $this->x += $lspace; - } else { - $this->x -= $lspace; - } - $this->Rect($this->x, ($this->y + (($this->lasth - $l)/ 2)), $l, $l, 'F', array(), $color); - break; - } - // ordered types - // $this->listcount[$this->listnum]; - // $textitem - case '1': - case 'decimal': { - $textitem = $this->listcount[$this->listnum]; - break; - } - case 'decimal-leading-zero': { - $textitem = sprintf('%02d', $this->listcount[$this->listnum]); - break; - } - case 'i': - case 'lower-roman': { - $textitem = strtolower($this->intToRoman($this->listcount[$this->listnum])); - break; - } - case 'I': - case 'upper-roman': { - $textitem = $this->intToRoman($this->listcount[$this->listnum]); - break; - } - case 'a': - case 'lower-alpha': - case 'lower-latin': { - $textitem = chr(97 + $this->listcount[$this->listnum] - 1); - break; - } - case 'A': - case 'upper-alpha': - case 'upper-latin': { - $textitem = chr(65 + $this->listcount[$this->listnum] - 1); - break; - } - case 'lower-greek': { - $textitem = $this->unichr(945 + $this->listcount[$this->listnum] - 1); - break; - } - /* - // Types to be implemented (special handling) - case 'hebrew': { - break; - } - case 'armenian': { - break; - } - case 'georgian': { - break; - } - case 'cjk-ideographic': { - break; - } - case 'hiragana': { - break; - } - case 'katakana': { - break; - } - case 'hiragana-iroha': { - break; - } - case 'katakana-iroha': { - break; - } - */ - default: { - $textitem = $this->listcount[$this->listnum]; - } - } - if (!$this->empty_string($textitem)) { - // print ordered item - if ($this->rtl) { - $textitem = '.'.$textitem; - } else { - $textitem = $textitem.'.'; - } - $lspace += $this->GetStringWidth($textitem); - if ($this->rtl) { - $this->x += $lspace; - } else { - $this->x -= $lspace; - } - $this->Write($this->lasth, $textitem, '', false, '', false, 0, false); - } - $this->x = $tmpx; - $this->lispacer = '^'; - } - - /** - * Returns current graphic variables as array. - * @return array of graphic variables - * @access protected - * @since 4.2.010 (2008-11-14) - */ - protected function getGraphicVars() { - $grapvars = array( - 'FontFamily' => $this->FontFamily, - 'FontStyle' => $this->FontStyle, - 'FontSizePt' => $this->FontSizePt, - 'rMargin' => $this->rMargin, - 'lMargin' => $this->lMargin, - 'cell_padding' => $this->cell_padding, - 'cell_margin' => $this->cell_margin, - 'LineWidth' => $this->LineWidth, - 'linestyleWidth' => $this->linestyleWidth, - 'linestyleCap' => $this->linestyleCap, - 'linestyleJoin' => $this->linestyleJoin, - 'linestyleDash' => $this->linestyleDash, - 'textrendermode' => $this->textrendermode, - 'textstrokewidth' => $this->textstrokewidth, - 'DrawColor' => $this->DrawColor, - 'FillColor' => $this->FillColor, - 'TextColor' => $this->TextColor, - 'ColorFlag' => $this->ColorFlag, - 'bgcolor' => $this->bgcolor, - 'fgcolor' => $this->fgcolor, - 'htmlvspace' => $this->htmlvspace, - 'listindent' => $this->listindent, - 'listindentlevel' => $this->listindentlevel, - 'listnum' => $this->listnum, - 'listordered' => $this->listordered, - 'listcount' => $this->listcount, - 'lispacer' => $this->lispacer, - 'cell_height_ratio' => $this->cell_height_ratio, - 'font_stretching' => $this->font_stretching, - 'font_spacing' => $this->font_spacing, - // extended - 'lasth' => $this->lasth, - 'tMargin' => $this->tMargin, - 'bMargin' => $this->bMargin, - 'AutoPageBreak' => $this->AutoPageBreak, - 'PageBreakTrigger' => $this->PageBreakTrigger, - 'x' => $this->x, - 'y' => $this->y, - 'w' => $this->w, - 'h' => $this->h, - 'wPt' => $this->wPt, - 'hPt' => $this->hPt, - 'fwPt' => $this->fwPt, - 'fhPt' => $this->fhPt, - 'page' => $this->page, - 'current_column' => $this->current_column, - 'num_columns' => $this->num_columns - ); - return $grapvars; - } - - /** - * Set graphic variables. - * @param array $gvars array of graphic variablesto restore - * @param boolean $extended if true restore extended graphic variables - * @access protected - * @since 4.2.010 (2008-11-14) - */ - protected function setGraphicVars($gvars, $extended=false) { - $this->FontFamily = $gvars['FontFamily']; - $this->FontStyle = $gvars['FontStyle']; - $this->FontSizePt = $gvars['FontSizePt']; - $this->rMargin = $gvars['rMargin']; - $this->lMargin = $gvars['lMargin']; - $this->cell_padding = $gvars['cell_padding']; - $this->cell_margin = $gvars['cell_margin']; - $this->LineWidth = $gvars['LineWidth']; - $this->linestyleWidth = $gvars['linestyleWidth']; - $this->linestyleCap = $gvars['linestyleCap']; - $this->linestyleJoin = $gvars['linestyleJoin']; - $this->linestyleDash = $gvars['linestyleDash']; - $this->textrendermode = $gvars['textrendermode']; - $this->textstrokewidth = $gvars['textstrokewidth']; - $this->DrawColor = $gvars['DrawColor']; - $this->FillColor = $gvars['FillColor']; - $this->TextColor = $gvars['TextColor']; - $this->ColorFlag = $gvars['ColorFlag']; - $this->bgcolor = $gvars['bgcolor']; - $this->fgcolor = $gvars['fgcolor']; - $this->htmlvspace = $gvars['htmlvspace']; - $this->listindent = $gvars['listindent']; - $this->listindentlevel = $gvars['listindentlevel']; - $this->listnum = $gvars['listnum']; - $this->listordered = $gvars['listordered']; - $this->listcount = $gvars['listcount']; - $this->lispacer = $gvars['lispacer']; - $this->cell_height_ratio = $gvars['cell_height_ratio']; - $this->font_stretching = $gvars['font_stretching']; - $this->font_spacing = $gvars['font_spacing']; - if ($extended) { - // restore extended values - $this->lasth = $gvars['lasth']; - $this->tMargin = $gvars['tMargin']; - $this->bMargin = $gvars['bMargin']; - $this->AutoPageBreak = $gvars['AutoPageBreak']; - $this->PageBreakTrigger = $gvars['PageBreakTrigger']; - $this->x = $gvars['x']; - $this->y = $gvars['y']; - $this->w = $gvars['w']; - $this->h = $gvars['h']; - $this->wPt = $gvars['wPt']; - $this->hPt = $gvars['hPt']; - $this->fwPt = $gvars['fwPt']; - $this->fhPt = $gvars['fhPt']; - $this->page = $gvars['page']; - $this->current_column = $gvars['current_column']; - $this->num_columns = $gvars['num_columns']; - } - $this->_out(''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor.''); - if (!$this->empty_string($this->FontFamily)) { - $this->SetFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); - } - } - - /** - * Returns a temporary filename for caching object on filesystem. - * @param string $prefix prefix to add to filename - * return string filename. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function getObjFilename($name) { - return tempnam(K_PATH_CACHE, $name.'_'); - } - - /** - * Writes data to a temporary file on filesystem. - * @param string $file file name - * @param mixed $data data to write on file - * @param boolean $append if true append data, false replace. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function writeDiskCache($filename, $data, $append=false) { - if ($append) { - $fmode = 'ab+'; - } else { - $fmode = 'wb+'; - } - $f = @fopen($filename, $fmode); - if (!$f) { - $this->Error('Unable to write cache file: '.$filename); - } else { - fwrite($f, $data); - fclose($f); - } - // update file length (needed for transactions) - if (!isset($this->cache_file_length['_'.$filename])) { - $this->cache_file_length['_'.$filename] = strlen($data); - } else { - $this->cache_file_length['_'.$filename] += strlen($data); - } - } - - /** - * Read data from a temporary file on filesystem. - * @param string $file file name - * @return mixed retrieved data - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function readDiskCache($filename) { - return file_get_contents($filename); - } - - /** - * Set buffer content (always append data). - * @param string $data data - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected function setBuffer($data) { - $this->bufferlen += strlen($data); - if ($this->diskcache) { - if (!isset($this->buffer) OR $this->empty_string($this->buffer)) { - $this->buffer = $this->getObjFilename('buffer'); - } - $this->writeDiskCache($this->buffer, $data, true); - } else { - $this->buffer .= $data; - } - } - - /** - * Replace the buffer content - * @param string $data data - * @access protected - * @since 5.5.000 (2010-06-22) - */ - protected function replaceBuffer($data) { - $this->bufferlen = strlen($data); - if ($this->diskcache) { - if (!isset($this->buffer) OR $this->empty_string($this->buffer)) { - $this->buffer = $this->getObjFilename('buffer'); - } - $this->writeDiskCache($this->buffer, $data, false); - } else { - $this->buffer = $data; - } - } - - /** - * Get buffer content. - * @return string buffer content - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected function getBuffer() { - if ($this->diskcache) { - return $this->readDiskCache($this->buffer); - } else { - return $this->buffer; - } - } - - /** - * Set page buffer content. - * @param int $page page number - * @param string $data page data - * @param boolean $append if true append data, false replace. - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function setPageBuffer($page, $data, $append=false) { - if ($this->diskcache) { - if (!isset($this->pages[$page])) { - $this->pages[$page] = $this->getObjFilename('page'.$page); - } - $this->writeDiskCache($this->pages[$page], $data, $append); - } else { - if ($append) { - $this->pages[$page] .= $data; - } else { - $this->pages[$page] = $data; - } - } - if ($append AND isset($this->pagelen[$page])) { - $this->pagelen[$page] += strlen($data); - } else { - $this->pagelen[$page] = strlen($data); - } - } - - /** - * Get page buffer content. - * @param int $page page number - * @return string page buffer content or false in case of error - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function getPageBuffer($page) { - if ($this->diskcache) { - return $this->readDiskCache($this->pages[$page]); - } elseif (isset($this->pages[$page])) { - return $this->pages[$page]; - } - return false; - } - - /** - * Set image buffer content. - * @param string $image image key - * @param array $data image data - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function setImageBuffer($image, $data) { - if ($this->diskcache) { - if (!isset($this->images[$image])) { - $this->images[$image] = $this->getObjFilename('image'.$image); - } - $this->writeDiskCache($this->images[$image], serialize($data)); - } else { - $this->images[$image] = $data; - } - if (!in_array($image, $this->imagekeys)) { - $this->imagekeys[] = $image; - ++$this->numimages; - } - } - - /** - * Set image buffer content for a specified sub-key. - * @param string $image image key - * @param string $key image sub-key - * @param array $data image data - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function setImageSubBuffer($image, $key, $data) { - if (!isset($this->images[$image])) { - $this->setImageBuffer($image, array()); - } - if ($this->diskcache) { - $tmpimg = $this->getImageBuffer($image); - $tmpimg[$key] = $data; - $this->writeDiskCache($this->images[$image], serialize($tmpimg)); - } else { - $this->images[$image][$key] = $data; - } - } - - /** - * Get image buffer content. - * @param string $image image key - * @return string image buffer content or false in case of error - * @access protected - * @since 4.5.000 (2008-12-31) - */ - protected function getImageBuffer($image) { - if ($this->diskcache AND isset($this->images[$image])) { - return unserialize($this->readDiskCache($this->images[$image])); - } elseif (isset($this->images[$image])) { - return $this->images[$image]; - } - return false; - } - - /** - * Set font buffer content. - * @param string $font font key - * @param array $data font data - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected function setFontBuffer($font, $data) { - if ($this->diskcache) { - if (!isset($this->fonts[$font])) { - $this->fonts[$font] = $this->getObjFilename('font'); - } - $this->writeDiskCache($this->fonts[$font], serialize($data)); - } else { - $this->fonts[$font] = $data; - } - if (!in_array($font, $this->fontkeys)) { - $this->fontkeys[] = $font; - // store object ID for current font - ++$this->n; - $this->font_obj_ids[$font] = $this->n; - $this->setFontSubBuffer($font, 'n', $this->n); - } - } - - /** - * Set font buffer content. - * @param string $font font key - * @param string $key font sub-key - * @param array $data font data - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected function setFontSubBuffer($font, $key, $data) { - if (!isset($this->fonts[$font])) { - $this->setFontBuffer($font, array()); - } - if ($this->diskcache) { - $tmpfont = $this->getFontBuffer($font); - $tmpfont[$key] = $data; - $this->writeDiskCache($this->fonts[$font], serialize($tmpfont)); - } else { - $this->fonts[$font][$key] = $data; - } - } - - /** - * Get font buffer content. - * @param string $font font key - * @return string font buffer content or false in case of error - * @access protected - * @since 4.5.000 (2009-01-02) - */ - protected function getFontBuffer($font) { - if ($this->diskcache AND isset($this->fonts[$font])) { - return unserialize($this->readDiskCache($this->fonts[$font])); - } elseif (isset($this->fonts[$font])) { - return $this->fonts[$font]; - } - return false; - } - - /** - * Move a page to a previous position. - * @param int $frompage number of the source page - * @param int $topage number of the destination page (must be less than $frompage) - * @return true in case of success, false in case of error. - * @access public - * @since 4.5.000 (2009-01-02) - */ - public function movePage($frompage, $topage) { - if (($frompage > $this->numpages) OR ($frompage <= $topage)) { - return false; - } - if ($frompage == $this->page) { - // close the page before moving it - $this->endPage(); - } - // move all page-related states - $tmppage = $this->pages[$frompage]; - $tmppagedim = $this->pagedim[$frompage]; - $tmppagelen = $this->pagelen[$frompage]; - $tmpintmrk = $this->intmrk[$frompage]; - $tmpbordermrk = $this->bordermrk[$frompage]; - $tmpcntmrk = $this->cntmrk[$frompage]; - if (isset($this->footerpos[$frompage])) { - $tmpfooterpos = $this->footerpos[$frompage]; - } - if (isset($this->footerlen[$frompage])) { - $tmpfooterlen = $this->footerlen[$frompage]; - } - if (isset($this->transfmrk[$frompage])) { - $tmptransfmrk = $this->transfmrk[$frompage]; - } - if (isset($this->PageAnnots[$frompage])) { - $tmpannots = $this->PageAnnots[$frompage]; - } - if (isset($this->newpagegroup[$frompage])) { - $tmpnewpagegroup = $this->newpagegroup[$frompage]; - } - for ($i = $frompage; $i > $topage; --$i) { - $j = $i - 1; - // shift pages down - $this->pages[$i] = $this->pages[$j]; - $this->pagedim[$i] = $this->pagedim[$j]; - $this->pagelen[$i] = $this->pagelen[$j]; - $this->intmrk[$i] = $this->intmrk[$j]; - $this->bordermrk[$i] = $this->bordermrk[$j]; - $this->cntmrk[$i] = $this->cntmrk[$j]; - if (isset($this->footerpos[$j])) { - $this->footerpos[$i] = $this->footerpos[$j]; - } elseif (isset($this->footerpos[$i])) { - unset($this->footerpos[$i]); - } - if (isset($this->footerlen[$j])) { - $this->footerlen[$i] = $this->footerlen[$j]; - } elseif (isset($this->footerlen[$i])) { - unset($this->footerlen[$i]); - } - if (isset($this->transfmrk[$j])) { - $this->transfmrk[$i] = $this->transfmrk[$j]; - } elseif (isset($this->transfmrk[$i])) { - unset($this->transfmrk[$i]); - } - if (isset($this->PageAnnots[$j])) { - $this->PageAnnots[$i] = $this->PageAnnots[$j]; - } elseif (isset($this->PageAnnots[$i])) { - unset($this->PageAnnots[$i]); - } - if (isset($this->newpagegroup[$j])) { - $this->newpagegroup[$i] = $this->newpagegroup[$j]; - } elseif (isset($this->newpagegroup[$i])) { - unset($this->newpagegroup[$i]); - } - } - $this->pages[$topage] = $tmppage; - $this->pagedim[$topage] = $tmppagedim; - $this->pagelen[$topage] = $tmppagelen; - $this->intmrk[$topage] = $tmpintmrk; - $this->bordermrk[$topage] = $tmpbordermrk; - $this->cntmrk[$topage] = $tmpcntmrk; - if (isset($tmpfooterpos)) { - $this->footerpos[$topage] = $tmpfooterpos; - } elseif (isset($this->footerpos[$topage])) { - unset($this->footerpos[$topage]); - } - if (isset($tmpfooterlen)) { - $this->footerlen[$topage] = $tmpfooterlen; - } elseif (isset($this->footerlen[$topage])) { - unset($this->footerlen[$topage]); - } - if (isset($tmptransfmrk)) { - $this->transfmrk[$topage] = $tmptransfmrk; - } elseif (isset($this->transfmrk[$topage])) { - unset($this->transfmrk[$topage]); - } - if (isset($tmpannots)) { - $this->PageAnnots[$topage] = $tmpannots; - } elseif (isset($this->PageAnnots[$topage])) { - unset($this->PageAnnots[$topage]); - } - if (isset($tmpnewpagegroup)) { - $this->newpagegroup[$topage] = $tmpnewpagegroup; - } elseif (isset($this->newpagegroup[$topage])) { - unset($this->newpagegroup[$topage]); - } - // adjust outlines - $tmpoutlines = $this->outlines; - foreach ($tmpoutlines as $key => $outline) { - if (($outline['p'] >= $topage) AND ($outline['p'] < $frompage)) { - $this->outlines[$key]['p'] = $outline['p'] + 1; - } elseif ($outline['p'] == $frompage) { - $this->outlines[$key]['p'] = $topage; - } - } - // adjust links - $tmplinks = $this->links; - foreach ($tmplinks as $key => $link) { - if (($link[0] >= $topage) AND ($link[0] < $frompage)) { - $this->links[$key][0] = $link[0] + 1; - } elseif ($link[0] == $frompage) { - $this->links[$key][0] = $topage; - } - } - // adjust javascript - $tmpjavascript = $this->javascript; - global $jfrompage, $jtopage; - $jfrompage = $frompage; - $jtopage = $topage; - $this->javascript = preg_replace_callback('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', - create_function('$matches', 'global $jfrompage, $jtopage; - $pagenum = intval($matches[3]) + 1; - if (($pagenum >= $jtopage) AND ($pagenum < $jfrompage)) { - $newpage = ($pagenum + 1); - } elseif ($pagenum == $jfrompage) { - $newpage = $jtopage; - } else { - $newpage = $pagenum; - } - --$newpage; - return "this.addField(\'".$matches[1]."\',\'".$matches[2]."\',".$newpage."";'), $tmpjavascript); - // return to last page - $this->lastPage(true); - return true; - } - - /** - * Remove the specified page. - * @param int $page page to remove - * @return true in case of success, false in case of error. - * @access public - * @since 4.6.004 (2009-04-23) - */ - public function deletePage($page) { - if (($page < 1) OR ($page > $this->numpages)) { - return false; - } - // delete current page - unset($this->pages[$page]); - unset($this->pagedim[$page]); - unset($this->pagelen[$page]); - unset($this->intmrk[$page]); - unset($this->bordermrk[$page]); - unset($this->cntmrk[$page]); - if (isset($this->footerpos[$page])) { - unset($this->footerpos[$page]); - } - if (isset($this->footerlen[$page])) { - unset($this->footerlen[$page]); - } - if (isset($this->transfmrk[$page])) { - unset($this->transfmrk[$page]); - } - if (isset($this->PageAnnots[$page])) { - unset($this->PageAnnots[$page]); - } - if (isset($this->newpagegroup[$page])) { - unset($this->newpagegroup[$page]); - } - if (isset($this->pageopen[$page])) { - unset($this->pageopen[$page]); - } - // update remaining pages - for ($i = $page; $i < $this->numpages; ++$i) { - $j = $i + 1; - // shift pages - $this->pages[$i] = $this->pages[$j]; - $this->pagedim[$i] = $this->pagedim[$j]; - $this->pagelen[$i] = $this->pagelen[$j]; - $this->intmrk[$i] = $this->intmrk[$j]; - $this->bordermrk[$i] = $this->bordermrk[$j]; - $this->cntmrk[$i] = $this->cntmrk[$j]; - if (isset($this->footerpos[$j])) { - $this->footerpos[$i] = $this->footerpos[$j]; - } elseif (isset($this->footerpos[$i])) { - unset($this->footerpos[$i]); - } - if (isset($this->footerlen[$j])) { - $this->footerlen[$i] = $this->footerlen[$j]; - } elseif (isset($this->footerlen[$i])) { - unset($this->footerlen[$i]); - } - if (isset($this->transfmrk[$j])) { - $this->transfmrk[$i] = $this->transfmrk[$j]; - } elseif (isset($this->transfmrk[$i])) { - unset($this->transfmrk[$i]); - } - if (isset($this->PageAnnots[$j])) { - $this->PageAnnots[$i] = $this->PageAnnots[$j]; - } elseif (isset($this->PageAnnots[$i])) { - unset($this->PageAnnots[$i]); - } - if (isset($this->newpagegroup[$j])) { - $this->newpagegroup[$i] = $this->newpagegroup[$j]; - } elseif (isset($this->newpagegroup[$i])) { - unset($this->newpagegroup[$i]); - } - if (isset($this->pageopen[$j])) { - $this->pageopen[$i] = $this->pageopen[$j]; - } elseif (isset($this->pageopen[$i])) { - unset($this->pageopen[$i]); - } - } - // remove last page - unset($this->pages[$this->numpages]); - unset($this->pagedim[$this->numpages]); - unset($this->pagelen[$this->numpages]); - unset($this->intmrk[$this->numpages]); - unset($this->bordermrk[$this->numpages]); - unset($this->cntmrk[$this->numpages]); - if (isset($this->footerpos[$this->numpages])) { - unset($this->footerpos[$this->numpages]); - } - if (isset($this->footerlen[$this->numpages])) { - unset($this->footerlen[$this->numpages]); - } - if (isset($this->transfmrk[$this->numpages])) { - unset($this->transfmrk[$this->numpages]); - } - if (isset($this->PageAnnots[$this->numpages])) { - unset($this->PageAnnots[$this->numpages]); - } - if (isset($this->newpagegroup[$this->numpages])) { - unset($this->newpagegroup[$this->numpages]); - } - if (isset($this->pageopen[$this->numpages])) { - unset($this->pageopen[$this->numpages]); - } - --$this->numpages; - $this->page = $this->numpages; - // adjust outlines - $tmpoutlines = $this->outlines; - foreach ($tmpoutlines as $key => $outline) { - if ($outline['p'] > $page) { - $this->outlines[$key]['p'] = $outline['p'] - 1; - } elseif ($outline['p'] == $page) { - unset($this->outlines[$key]); - } - } - // adjust links - $tmplinks = $this->links; - foreach ($tmplinks as $key => $link) { - if ($link[0] > $page) { - $this->links[$key][0] = $link[0] - 1; - } elseif ($link[0] == $page) { - unset($this->links[$key]); - } - } - // adjust javascript - $tmpjavascript = $this->javascript; - global $jpage; - $jpage = $page; - $this->javascript = preg_replace_callback('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', - create_function('$matches', 'global $jpage; - $pagenum = intval($matches[3]) + 1; - if ($pagenum >= $jpage) { - $newpage = ($pagenum - 1); - } elseif ($pagenum == $jpage) { - $newpage = 1; - } else { - $newpage = $pagenum; - } - --$newpage; - return "this.addField(\'".$matches[1]."\',\'".$matches[2]."\',".$newpage."";'), $tmpjavascript); - // return to last page - $this->lastPage(true); - return true; - } - - /** - * Clone the specified page to a new page. - * @param int $page number of page to copy (0 = current page) - * @return true in case of success, false in case of error. - * @access public - * @since 4.9.015 (2010-04-20) - */ - public function copyPage($page=0) { - if ($page == 0) { - // default value - $page = $this->page; - } - if (($page < 1) OR ($page > $this->numpages)) { - return false; - } - if ($page == $this->page) { - // close the page before cloning it - $this->endPage(); - } - // copy all page-related states - ++$this->numpages; - $this->page = $this->numpages; - $this->pages[$this->page] = $this->pages[$page]; - $this->pagedim[$this->page] = $this->pagedim[$page]; - $this->pagelen[$this->page] = $this->pagelen[$page]; - $this->intmrk[$this->page] = $this->intmrk[$page]; - $this->bordermrk[$this->page] = $this->bordermrk[$page]; - $this->cntmrk[$this->page] = $this->cntmrk[$page]; - $this->pageopen[$this->page] = false; - if (isset($this->footerpos[$page])) { - $this->footerpos[$this->page] = $this->footerpos[$page]; - } - if (isset($this->footerlen[$page])) { - $this->footerlen[$this->page] = $this->footerlen[$page]; - } - if (isset($this->transfmrk[$page])) { - $this->transfmrk[$this->page] = $this->transfmrk[$page]; - } - if (isset($this->PageAnnots[$page])) { - $this->PageAnnots[$this->page] = $this->PageAnnots[$page]; - } - if (isset($this->newpagegroup[$page])) { - $this->newpagegroup[$this->page] = $this->newpagegroup[$page]; - } - // copy outlines - $tmpoutlines = $this->outlines; - foreach ($tmpoutlines as $key => $outline) { - if ($outline['p'] == $page) { - $this->outlines[] = array('t' => $outline['t'], 'l' => $outline['l'], 'y' => $outline['y'], 'p' => $this->page); - } - } - // copy links - $tmplinks = $this->links; - foreach ($tmplinks as $key => $link) { - if ($link[0] == $page) { - $this->links[] = array($this->page, $link[1]); - } - } - // return to last page - $this->lastPage(true); - return true; - } - - /** - * Output a Table of Content Index (TOC). - * Before calling this method you have to open the page using the addTOCPage() method. - * After calling this method you have to call endTOCPage() to close the TOC page. - * You can override this method to achieve different styles. - * @param int $page page number where this TOC should be inserted (leave empty for current page). - * @param string $numbersfont set the font for page numbers (please use monospaced font for better alignment). - * @param string $filler string used to fill the space between text and page number. - * @param string $toc_name name to use for TOC bookmark. - * @access public - * @author Nicola Asuni - * @since 4.5.000 (2009-01-02) - * @see addTOCPage(), endTOCPage(), addHTMLTOC() - */ - public function addTOC($page='', $numbersfont='', $filler='.', $toc_name='TOC') { - $fontsize = $this->FontSizePt; - $fontfamily = $this->FontFamily; - $fontstyle = $this->FontStyle; - $w = $this->w - $this->lMargin - $this->rMargin; - $spacer = $this->GetStringWidth(chr(32)) * 4; - $page_first = $this->getPage(); - $lmargin = $this->lMargin; - $rmargin = $this->rMargin; - $x_start = $this->GetX(); - $current_page = $this->page; - $current_column = $this->current_column; - if ($this->empty_string($numbersfont)) { - $numbersfont = $this->default_monospaced_font; - } - if ($this->empty_string($filler)) { - $filler = ' '; - } - if ($this->empty_string($page)) { - $gap = ' '; - } else { - $gap = ''; - if ($page < 1) { - $page = 1; - } - } - foreach ($this->outlines as $key => $outline) { - if ($this->rtl) { - $aligntext = 'R'; - $alignnum = 'L'; - } else { - $aligntext = 'L'; - $alignnum = 'R'; - } - if ($outline['l'] == 0) { - $this->SetFont($fontfamily, $fontstyle.'B', $fontsize); - } else { - $this->SetFont($fontfamily, $fontstyle, $fontsize - $outline['l']); - } - // check for page break - $this->checkPageBreak(($this->FontSize * $this->cell_height_ratio)); - // set margins and X position - if (($this->page == $current_page) AND ($this->current_column == $current_column)) { - $this->lMargin = $lmargin; - $this->rMargin = $rmargin; - } else { - if ($this->current_column != $current_column) { - if ($this->rtl) { - $x_start = $this->w - $this->columns[$this->current_column]['x']; - } else { - $x_start = $this->columns[$this->current_column]['x']; - } - } - $lmargin = $this->lMargin; - $rmargin = $this->rMargin; - $current_page = $this->page; - $current_column = $this->current_column; - } - $this->SetX($x_start); - $indent = ($spacer * $outline['l']); - if ($this->rtl) { - $this->rMargin += $indent; - $this->x -= $indent; - } else { - $this->lMargin += $indent; - $this->x += $indent; - } - $link = $this->AddLink(); - $this->SetLink($link, $outline['y'], $outline['p']); - // write the text - $this->Write(0, $outline['t'], $link, 0, $aligntext, false, 0, false, false, 0); - $this->SetFont($numbersfont, $fontstyle, $fontsize); - if ($this->empty_string($page)) { - $pagenum = $outline['p']; - } else { - // placemark to be replaced with the correct number - $pagenum = '{#'.($outline['p']).'}'; - if ($this->isUnicodeFont()) { - $pagenum = '{'.$pagenum.'}'; - } - } - $numwidth = $this->GetStringWidth($pagenum); - if ($this->rtl) { - $tw = $this->x - $this->lMargin; - } else { - $tw = $this->w - $this->rMargin - $this->x; - } - $fw = $tw - $numwidth - $this->GetStringWidth(chr(32)); - $numfills = floor($fw / $this->GetStringWidth($filler)); - if ($numfills > 0) { - $rowfill = str_repeat($filler, $numfills); - } else { - $rowfill = ''; - } - if ($this->rtl) { - $pagenum = $pagenum.$gap.$rowfill.' '; - } else { - $pagenum = ' '.$rowfill.$gap.$pagenum; - } - // write the number - $this->Cell($tw, 0, $pagenum, 0, 1, $alignnum, 0, $link, 0); - } - $page_last = $this->getPage(); - $numpages = $page_last - $page_first + 1; - if (!$this->empty_string($page)) { - for ($p = $page_first; $p <= $page_last; ++$p) { - // get page data - $temppage = $this->getPageBuffer($p); - for ($n = 1; $n <= $this->numpages; ++$n) { - // update page numbers - $k = '{#'.$n.'}'; - $ku = '{'.$k.'}'; - $alias_a = $this->_escape($k); - $alias_au = $this->_escape($ku); - if ($this->isunicode) { - $alias_b = $this->_escape($this->UTF8ToLatin1($k)); - $alias_bu = $this->_escape($this->UTF8ToLatin1($ku)); - $alias_c = $this->_escape($this->utf8StrRev($k, false, $this->tmprtl)); - $alias_cu = $this->_escape($this->utf8StrRev($ku, false, $this->tmprtl)); - } - if ($n >= $page) { - $np = $n + $numpages; - } else { - $np = $n; - } - $ns = $this->formatTOCPageNumber($np); - $nu = $ns; - $sdiff = strlen($k) - strlen($ns) - 1; - $sdiffu = strlen($ku) - strlen($ns) - 1; - $sfill = str_repeat($filler, $sdiff); - $sfillu = str_repeat($filler, $sdiffu); - if ($this->rtl) { - $ns = $ns.' '.$sfill; - $nu = $nu.' '.$sfillu; - } else { - $ns = $sfill.' '.$ns; - $nu = $sfillu.' '.$nu; - } - $nu = $this->UTF8ToUTF16BE($nu, false); - $temppage = str_replace($alias_au, $nu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_bu, $nu, $temppage); - $temppage = str_replace($alias_cu, $nu, $temppage); - $temppage = str_replace($alias_b, $ns, $temppage); - $temppage = str_replace($alias_c, $ns, $temppage); - } - $temppage = str_replace($alias_a, $ns, $temppage); - } - // save changes - $this->setPageBuffer($p, $temppage); - } - // move pages - $this->Bookmark($toc_name, 0, 0, $page_first); - for ($i = 0; $i < $numpages; ++$i) { - $this->movePage($page_last, $page); - } - } - } - - /** - * Output a Table Of Content Index (TOC) using HTML templates. - * Before calling this method you have to open the page using the addTOCPage() method. - * After calling this method you have to call endTOCPage() to close the TOC page. - * @param int $page page number where this TOC should be inserted (leave empty for current page). - * @param string $toc_name name to use for TOC bookmark. - * @param array $templates array of html templates. Use: #TOC_DESCRIPTION# for bookmark title, #TOC_PAGE_NUMBER# for page number. - * @param boolean $correct_align if true correct the number alignment (numbers must be in monospaced font like courier and right aligned on LTR, or left aligned on RTL) - * @access public - * @author Nicola Asuni - * @since 5.0.001 (2010-05-06) - * @see addTOCPage(), endTOCPage(), addTOC() - */ - public function addHTMLTOC($page='', $toc_name='TOC', $templates=array(), $correct_align=true) { - $prev_htmlLinkColorArray = $this->htmlLinkColorArray; - $prev_htmlLinkFontStyle = $this->htmlLinkFontStyle; - // set new style for link - $this->htmlLinkColorArray = array(); - $this->htmlLinkFontStyle = ''; - $page_first = $this->getPage(); - // get the font type used for numbers in each template - $current_font = $this->FontFamily; - foreach ($templates as $level => $html) { - $dom = $this->getHtmlDomArray($html); - foreach ($dom as $key => $value) { - if ($value['value'] == '#TOC_PAGE_NUMBER#') { - $this->SetFont($dom[($key - 1)]['fontname']); - $templates['F'.$level] = $this->isUnicodeFont(); - } - } - } - $this->SetFont($current_font); - foreach ($this->outlines as $key => $outline) { - // get HTML template - $row = $templates[$outline['l']]; - if ($this->empty_string($page)) { - $pagenum = $outline['p']; - } else { - // placemark to be replaced with the correct number - $pagenum = '{#'.($outline['p']).'}'; - if ($templates['F'.$outline['l']]) { - $pagenum = '{'.$pagenum.'}'; - } - } - // replace templates with current values - $row = str_replace('#TOC_DESCRIPTION#', $outline['t'], $row); - $row = str_replace('#TOC_PAGE_NUMBER#', $pagenum, $row); - // add link to page - $row = '<a href="#'.$outline['p'].','.$outline['y'].'">'.$row.'</a>'; - // write bookmark entry - $this->writeHTML($row, false, false, true, false, ''); - } - // restore link styles - $this->htmlLinkColorArray = $prev_htmlLinkColorArray; - $this->htmlLinkFontStyle = $prev_htmlLinkFontStyle; - // move TOC page and replace numbers - $page_last = $this->getPage(); - $numpages = $page_last - $page_first + 1; - if (!$this->empty_string($page)) { - for ($p = $page_first; $p <= $page_last; ++$p) { - // get page data - $temppage = $this->getPageBuffer($p); - for ($n = 1; $n <= $this->numpages; ++$n) { - // update page numbers - $k = '{#'.$n.'}'; - $ku = '{'.$k.'}'; - $alias_a = $this->_escape($k); - $alias_au = $this->_escape('{'.$k.'}'); - if ($this->isunicode) { - $alias_b = $this->_escape($this->UTF8ToLatin1($k)); - $alias_bu = $this->_escape($this->UTF8ToLatin1($ku)); - $alias_c = $this->_escape($this->utf8StrRev($k, false, $this->tmprtl)); - $alias_cu = $this->_escape($this->utf8StrRev($ku, false, $this->tmprtl)); - } - if ($n >= $page) { - $np = $n + $numpages; - } else { - $np = $n; - } - $ns = $this->formatTOCPageNumber($np); - $nu = $ns; - if ($correct_align) { - $sdiff = strlen($k) - strlen($ns); - $sdiffu = strlen($ku) - strlen($ns); - $sfill = str_repeat(' ', $sdiff); - $sfillu = str_repeat(' ', $sdiffu); - if ($this->rtl) { - $ns = $ns.$sfill; - $nu = $nu.$sfillu; - } else { - $ns = $sfill.$ns; - $nu = $sfillu.$nu; - } - } - $nu = $this->UTF8ToUTF16BE($nu, false); - $temppage = str_replace($alias_au, $nu, $temppage); - if ($this->isunicode) { - $temppage = str_replace($alias_bu, $nu, $temppage); - $temppage = str_replace($alias_cu, $nu, $temppage); - $temppage = str_replace($alias_b, $ns, $temppage); - $temppage = str_replace($alias_c, $ns, $temppage); - } - $temppage = str_replace($alias_a, $ns, $temppage); - } - // save changes - $this->setPageBuffer($p, $temppage); - } - // move pages - $this->Bookmark($toc_name, 0, 0, $page_first); - for ($i = 0; $i < $numpages; ++$i) { - $this->movePage($page_last, $page); - } - } - } - - /** - * Stores a copy of the current TCPDF object used for undo operation. - * @access public - * @since 4.5.029 (2009-03-19) - */ - public function startTransaction() { - if (isset($this->objcopy)) { - // remove previous copy - $this->commitTransaction(); - } - // record current page number and Y position - $this->start_transaction_page = $this->page; - $this->start_transaction_y = $this->y; - // clone current object - $this->objcopy = $this->objclone($this); - } - - /** - * Delete the copy of the current TCPDF object used for undo operation. - * @access public - * @since 4.5.029 (2009-03-19) - */ - public function commitTransaction() { - if (isset($this->objcopy)) { - $this->objcopy->_destroy(true, true); - unset($this->objcopy); - } - } - - /** - * This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction(). - * @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value. - * @return TCPDF object. - * @access public - * @since 4.5.029 (2009-03-19) - */ - public function rollbackTransaction($self=false) { - if (isset($this->objcopy)) { - if (isset($this->objcopy->diskcache) AND $this->objcopy->diskcache) { - // truncate files to previous values - foreach ($this->objcopy->cache_file_length as $file => $length) { - $file = substr($file, 1); - $handle = fopen($file, 'r+'); - ftruncate($handle, $length); - } - } - $this->_destroy(true, true); - if ($self) { - $objvars = get_object_vars($this->objcopy); - foreach ($objvars as $key => $value) { - $this->$key = $value; - } - } - return $this->objcopy; - } - return $this; - } - - /** - * Creates a copy of a class object - * @param object $object class object to be cloned - * @return cloned object - * @access public - * @since 4.5.029 (2009-03-19) - */ - public function objclone($object) { - return @clone($object); - } - - /** - * Determine whether a string is empty. - * @param string $str string to be checked - * @return boolean true if string is empty - * @access public - * @since 4.5.044 (2009-04-16) - */ - public function empty_string($str) { - return (is_null($str) OR (is_string($str) AND (strlen($str) == 0))); - } - - /** - * Find position of last occurrence of a substring in a string - * @param string $haystack The string to search in. - * @param string $needle substring to search. - * @param int $offset May be specified to begin searching an arbitrary number of characters into the string. - * @return Returns the position where the needle exists. Returns FALSE if the needle was not found. - * @access public - * @since 4.8.038 (2010-03-13) - */ - public function revstrpos($haystack, $needle, $offset = 0) { - $length = strlen($haystack); - $offset = ($offset > 0)?($length - $offset):abs($offset); - $pos = strpos(strrev($haystack), strrev($needle), $offset); - return ($pos === false)?false:($length - $pos - strlen($needle)); - } - - // --- MULTI COLUMNS METHODS ----------------------- - - /** - * Set multiple columns of the same size - * @param int $numcols number of columns (set to zero to disable columns mode) - * @param int $width column width - * @param int $y column starting Y position (leave empty for current Y position) - * @access public - * @since 4.9.001 (2010-03-28) - */ - public function setEqualColumns($numcols=0, $width=0, $y='') { - $this->columns = array(); - if ($numcols < 2) { - $numcols = 0; - $this->columns = array(); - } else { - // maximum column width - $maxwidth = ($this->w - $this->original_lMargin - $this->original_rMargin) / $numcols; - if (($width == 0) OR ($width > $maxwidth)) { - $width = $maxwidth; - } - if ($this->empty_string($y)) { - $y = $this->y; - } - // space between columns - $space = (($this->w - $this->original_lMargin - $this->original_rMargin - ($numcols * $width)) / ($numcols - 1)); - // fill the columns array (with, space, starting Y position) - for ($i = 0; $i < $numcols; ++$i) { - $this->columns[$i] = array('w' => $width, 's' => $space, 'y' => $y); - } - } - $this->num_columns = $numcols; - $this->current_column = 0; - $this->column_start_page = $this->page; - } - - /** - * Set columns array. - * Each column is represented by and array with the following keys: (w = width, s = space between columns, y = column top position). - * @param array $columns - * @access public - * @since 4.9.001 (2010-03-28) - */ - public function setColumnsArray($columns) { - $this->columns = $columns; - $this->num_columns = count($columns); - $this->current_column = 0; - $this->column_start_page = $this->page; - } - - /** - * Set position at a given column - * @param int $col column number (from 0 to getNumberOfColumns()-1); empty string = current column. - * @access public - * @since 4.9.001 (2010-03-28) - */ - public function selectColumn($col='') { - if (is_string($col)) { - $col = $this->current_column; - } elseif($col >= $this->num_columns) { - $col = 0; - } - $xshift = 0; - $enable_thead = false; - if ($this->num_columns > 1) { - if ($col != $this->current_column) { - // move Y pointer at the top of the column - if ($this->column_start_page == $this->page) { - $this->y = $this->columns[$col]['y']; - } else { - $this->y = $this->tMargin; - } - // Avoid to write table headers more than once - if (($this->page > $this->maxselcol['page']) OR (($this->page == $this->maxselcol['page']) AND ($col > $this->maxselcol['column']))) { - $enable_thead = true; - $this->maxselcol['page'] = $this->page; - $this->maxselcol['column'] = $col; - } - } - $xshift = $this->colxshift; - // set X position of the current column by case - $listindent = ($this->listindentlevel * $this->listindent); - $colpos = ($col * ($this->columns[$col]['w'] + $this->columns[$col]['s'])); - if ($this->rtl) { - $x = $this->w - $this->original_rMargin - $colpos; - $this->rMargin = ($this->w - $x + $listindent); - $this->lMargin = ($x - $this->columns[$col]['w']); - $this->x = $x - $listindent; - } else { - $x = $this->original_lMargin + $colpos; - $this->lMargin = ($x + $listindent); - $this->rMargin = ($this->w - $x - $this->columns[$col]['w']); - $this->x = $x + $listindent; - } - $this->columns[$col]['x'] = $x; - } - $this->current_column = $col; - // fix for HTML mode - $this->newline = true; - // print HTML table header (if any) - if ((!$this->empty_string($this->thead)) AND (!$this->inthead)) { - if ($enable_thead) { - // print table header - $this->writeHTML($this->thead, false, false, false, false, ''); - $this->y += $xshift['s']; - // store end of header position - if (!isset($this->columns[$col]['th'])) { - $this->columns[$col]['th'] = array(); - } - $this->columns[$col]['th']['\''.$this->page.'\''] = $this->y; - $this->lasth = 0; - } elseif (isset($this->columns[$col]['th']['\''.$this->page.'\''])) { - $this->y = $this->columns[$col]['th']['\''.$this->page.'\'']; - } - } - // account for an html table cell over multiple columns - if ($this->rtl) { - $this->rMargin += $xshift['x']; - $this->x -= ($xshift['x'] + $xshift['p']); - } else { - $this->lMargin += $xshift['x']; - $this->x += $xshift['x'] + $xshift['p']; - } - } - - /** - * Return the current column number - * @return int current column number - * @access public - * @since 5.5.011 (2010-07-08) - */ - public function getColumn() { - return $this->current_column; - } - - /** - * Return the current number of columns. - * @return int number of columns - * @access public - * @since 5.8.018 (2010-08-25) - */ - public function getNumberOfColumns() { - return $this->num_columns; - } - - /** - * Serialize an array of parameters to be used with TCPDF tag in HTML code. - * @param array $pararray parameters array - * @return sting containing serialized data - * @access public - * @since 4.9.006 (2010-04-02) - */ - public function serializeTCPDFtagParameters($pararray) { - return urlencode(serialize($pararray)); - } - - /** - * Set Text rendering mode. - * @param int $stroke outline size in user units (0 = disable). - * @param boolean $fill if true fills the text (default). - * @param boolean $clip if true activate clipping mode - * @access public - * @since 4.9.008 (2009-04-02) - */ - public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { - // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode - // convert text rendering parameters - if ($stroke < 0) { - $stroke = 0; - } - if ($fill === true) { - if ($stroke > 0) { - if ($clip === true) { - // Fill, then stroke text and add to path for clipping - $textrendermode = 6; - } else { - // Fill, then stroke text - $textrendermode = 2; - } - $textstrokewidth = $stroke; - } else { - if ($clip === true) { - // Fill text and add to path for clipping - $textrendermode = 4; - } else { - // Fill text - $textrendermode = 0; - } - } - } else { - if ($stroke > 0) { - if ($clip === true) { - // Stroke text and add to path for clipping - $textrendermode = 5; - } else { - // Stroke text - $textrendermode = 1; - } - $textstrokewidth = $stroke; - } else { - if ($clip === true) { - // Add text to path for clipping - $textrendermode = 7; - } else { - // Neither fill nor stroke text (invisible) - $textrendermode = 3; - } - } - } - $this->textrendermode = $textrendermode; - $this->textstrokewidth = $stroke * $this->k; - } - - /** - * Returns an array of chars containing soft hyphens. - * @param array $word array of chars - * @param array $patterns Array of hypenation patterns. - * @param array $dictionary Array of words to be returned without applying the hyphenation algoritm. - * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. - * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. - * @param int $charmin Minimum word lenght to apply the hyphenation algoritm. - * @param int $charmax Maximum lenght of broken piece of word. - * @return array text with soft hyphens - * @author Nicola Asuni - * @since 4.9.012 (2010-04-12) - * @access protected - */ - protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { - $hyphenword = array(); // hyphens positions - $numchars = count($word); - if ($numchars <= $charmin) { - return $word; - } - $word_string = $this->UTF8ArrSubString($word); - // some words will be returned as-is - $pattern = '/^([a-zA-Z0-9_\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; - if (preg_match($pattern, $word_string) > 0) { - // email - return $word; - } - $pattern = '/(([a-zA-Z0-9\-]+\.)?)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; - if (preg_match($pattern, $word_string) > 0) { - // URL - return $word; - } - if (isset($dictionary[$word_string])) { - return $this->UTF8StringToArray($dictionary[$word_string]); - } - // suround word with '_' characters - $tmpword = array_merge(array(95), $word, array(95)); - $tmpnumchars = $numchars + 2; - $maxpos = $tmpnumchars - $charmin; - for ($pos = 0; $pos < $maxpos; ++$pos) { - $imax = min(($tmpnumchars - $pos), $charmax); - for ($i = $charmin; $i <= $imax; ++$i) { - $subword = strtolower($this->UTF8ArrSubString($tmpword, $pos, $pos + $i)); - if (isset($patterns[$subword])) { - $pattern = $this->UTF8StringToArray($patterns[$subword]); - $pattern_length = count($pattern); - $digits = 1; - for ($j = 0; $j < $pattern_length; ++$j) { - // check if $pattern[$j] is a number - if (($pattern[$j] >= 48) AND ($pattern[$j] <= 57)) { - if ($j == 0) { - $zero = $pos - 1; - } else { - $zero = $pos + $j - $digits; - } - if (!isset($hyphenword[$zero]) OR ($hyphenword[$zero] != $pattern[$j])) { - $hyphenword[$zero] = $this->unichr($pattern[$j]); - } - ++$digits; - } - } - } - } - } - $inserted = 0; - $maxpos = $numchars - $rightmin; - for($i = $leftmin; $i <= $maxpos; ++$i) { - if(isset($hyphenword[$i]) AND (($hyphenword[$i] % 2) != 0)) { - // 173 = soft hyphen character - array_splice($word, $i + $inserted, 0, 173); - ++$inserted; - } - } - return $word; - } - - /** - * Returns an array of hyphenation patterns. - * @param string $file TEX file containing hypenation patterns. TEX pattrns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ - * @return array of hyphenation patterns - * @author Nicola Asuni - * @since 4.9.012 (2010-04-12) - * @access public - */ - public function getHyphenPatternsFromTEX($file) { - // TEX patterns are available at: - // http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ - $data = file_get_contents($file); - $patterns = array(); - // remove comments - $data = preg_replace('/\%[^\n]*/', '', $data); - // extract the patterns part - preg_match('/\\\\patterns\{([^\}]*)\}/i', $data, $matches); - $data = trim(substr($matches[0], 10, -1)); - // extract each pattern - $patterns_array = preg_split('/[\s]+/', $data); - // create new language array of patterns - $patterns = array(); - foreach($patterns_array as $val) { - if (!$this->empty_string($val)) { - $val = trim($val); - $val = str_replace('\'', '\\\'', $val); - $key = preg_replace('/[0-9]+/', '', $val); - $patterns[$key] = $val; - } - } - return $patterns; - } - - /** - * Returns text with soft hyphens. - * @param string $text text to process - * @param mixed $patterns Array of hypenation patterns or a TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ - * @param array $dictionary Array of words to be returned without applying the hyphenation algoritm. - * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. - * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. - * @param int $charmin Minimum word lenght to apply the hyphenation algoritm. - * @param int $charmax Maximum lenght of broken piece of word. - * @return array text with soft hyphens - * @author Nicola Asuni - * @since 4.9.012 (2010-04-12) - * @access public - */ - public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { - $text = $this->unhtmlentities($text); - $word = array(); // last word - $txtarr = array(); // text to be returned - $intag = false; // true if we are inside an HTML tag - if (!is_array($patterns)) { - $patterns = $this->getHyphenPatternsFromTEX($patterns); - } - // get array of characters - $unichars = $this->UTF8StringToArray($text); - // for each char - foreach ($unichars as $char) { - if ((!$intag) AND $this->unicode->uni_type[$char] == 'L') { - // letter character - $word[] = $char; - } else { - // other type of character - if (!$this->empty_string($word)) { - // hypenate the word - $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); - $word = array(); - } - $txtarr[] = $char; - if (chr($char) == '<') { - // we are inside an HTML tag - $intag = true; - } elseif ($intag AND (chr($char) == '>')) { - // end of HTML tag - $intag = false; - } - } - } - if (!$this->empty_string($word)) { - // hypenate the word - $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); - } - // convert char array to string and return - return $this->UTF8ArrSubString($txtarr); - } - - /** - * Enable/disable rasterization of vector images using ImageMagick library. - * @param boolean $mode if true enable rasterization, false otherwise. - * @access public - * @since 5.0.000 (2010-04-27) - */ - public function setRasterizeVectorImages($mode) { - $this->rasterize_vector_images = $mode; - } - - /** - * Get the Path-Painting Operators. - * @param string $style Style of rendering. Possible values are: - * <ul> - * <li>S or D: Stroke the path.</li> - * <li>s or d: Close and stroke the path.</li> - * <li>f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.</li> - * <li>f* or F*: Fill the path, using the even-odd rule to determine the region to fill.</li> - * <li>B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.</li> - * <li>B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.</li> - * <li>b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.</li> - * <li>b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.</li> - * <li>CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.</li> - * <li>CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path</li> - * <li>n: End the path object without filling or stroking it.</li> - * </ul> - * @param string $default default style - * @param boolean $mode if true enable rasterization, false otherwise. - * @author Nicola Asuni - * @access protected - * @since 5.0.000 (2010-04-30) - */ - protected function getPathPaintOperator($style, $default='S') { - $op = ''; - switch($style) { - case 'S': - case 'D': { - $op = 'S'; - break; - } - case 's': - case 'd': { - $op = 's'; - break; - } - case 'f': - case 'F': { - $op = 'f'; - break; - } - case 'f*': - case 'F*': { - $op = 'f*'; - break; - } - case 'B': - case 'FD': - case 'DF': { - $op = 'B'; - break; - } - case 'B*': - case 'F*D': - case 'DF*': { - $op = 'B*'; - break; - } - case 'b': - case 'fd': - case 'df': { - $op = 'b'; - break; - } - case 'b*': - case 'f*d': - case 'df*': { - $op = 'b*'; - break; - } - case 'CNZ': { - $op = 'W n'; - break; - } - case 'CEO': { - $op = 'W* n'; - break; - } - case 'n': { - $op = 'n'; - break; - } - default: { - if (!empty($default)) { - $op = $this->getPathPaintOperator($default, ''); - } else { - $op = ''; - } - } - } - return $op; - } - - /** - * Enable or disable default option for font subsetting. - * @param boolean $enable if true enable font subsetting by default. - * @author Nicola Asuni - * @access public - * @since 5.3.002 (2010-06-07) - */ - public function setFontSubsetting($enable=true) { - $this->font_subsetting = $enable ? true : false; - } - - /** - * Return the default option for font subsetting. - * @return boolean default font subsetting state. - * @author Nicola Asuni - * @access public - * @since 5.3.002 (2010-06-07) - */ - public function getFontSubsetting() { - return $this->font_subsetting; - } - - /** - * Left trim the input string - * @param string $str string to trim - * @param string $replace string that replace spaces. - * @return left trimmed string - * @author Nicola Asuni - * @access public - * @since 5.8.000 (2010-08-11) - */ - public function stringLeftTrim($str, $replace='') { - return preg_replace('/^'.$this->re_space['p'].'+/'.$this->re_space['m'], $replace, $str); - } - - /** - * Right trim the input string - * @param string $str string to trim - * @param string $replace string that replace spaces. - * @return right trimmed string - * @author Nicola Asuni - * @access public - * @since 5.8.000 (2010-08-11) - */ - public function stringRightTrim($str, $replace='') { - return preg_replace('/'.$this->re_space['p'].'+$/'.$this->re_space['m'], $replace, $str); - } - - /** - * Trim the input string - * @param string $str string to trim - * @param string $replace string that replace spaces. - * @return trimmed string - * @author Nicola Asuni - * @access public - * @since 5.8.000 (2010-08-11) - */ - public function stringTrim($str, $replace='') { - $str = $this->stringLeftTrim($str, $replace); - $str = $this->stringRightTrim($str, $replace); - return $str; - } - - /** - * Return true if the current font is unicode type. - * @return true for unicode font, false otherwise. - * @author Nicola Asuni - * @access public - * @since 5.8.002 (2010-08-14) - */ - public function isUnicodeFont() { - return (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')); - } - - /** - * Return normalized font name - * @param string $fontfamily property string containing font family names - * @return string normalized font name - * @author Nicola Asuni - * @access public - * @since 5.8.004 (2010-08-17) - */ - public function getFontFamilyName($fontfamily) { - // remove spaces and symbols - $fontfamily = preg_replace('/[^a-z0-9\,]/', '', strtolower($fontfamily)); - // extract all font names - $fontslist = preg_split('/[,]/', $fontfamily); - // find first valid font name - foreach ($fontslist as $font) { - // replace font variations - $font = preg_replace('/italic$/', 'I', $font); - $font = preg_replace('/oblique$/', 'I', $font); - $font = preg_replace('/bold([I]?)$/', 'B\\1', $font); - // replace common family names and core fonts - $pattern = array(); - $replacement = array(); - $pattern[] = '/^serif|^cursive|^fantasy|^timesnewroman/'; - $replacement[] = 'times'; - $pattern[] = '/^sansserif/'; - $replacement[] = 'helvetica'; - $pattern[] = '/^monospace/'; - $replacement[] = 'courier'; - $font = preg_replace($pattern, $replacement, $font); - if (in_array(strtolower($font), $this->fontlist) OR in_array($font, $this->fontkeys)) { - return $font; - } - } - // return current font as default - return $this->CurrentFont['fontkey']; - } - - /** - * Start a new XObject Template. - * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). - * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. - * Note: X,Y coordinates will be reset to 0,0. - * @param int $w Template width in user units (empty string or zero = page width less margins) - * @param int $h Template height in user units (empty string or zero = page height less margins) - * @return int the XObject Template ID in case of success or false in case of error. - * @author Nicola Asuni - * @access public - * @since 5.8.017 (2010-08-24) - * @see endTemplate(), printTemplate() - */ - public function startTemplate($w=0, $h=0) { - if ($this->inxobj) { - // we are already inside an XObject template - return false; - } - $this->inxobj = true; - ++$this->n; - // XObject ID - $this->xobjid = 'XT'.$this->n; - // object ID - $this->xobjects[$this->xobjid] = array('n' => $this->n); - // store current graphic state - $this->xobjects[$this->xobjid]['gvars'] = $this->getGraphicVars(); - // initialize data - $this->xobjects[$this->xobjid]['intmrk'] = 0; - $this->xobjects[$this->xobjid]['transfmrk'] = array(); - $this->xobjects[$this->xobjid]['outdata'] = ''; - $this->xobjects[$this->xobjid]['xobjects'] = array(); - $this->xobjects[$this->xobjid]['images'] = array(); - $this->xobjects[$this->xobjid]['fonts'] = array(); - $this->xobjects[$this->xobjid]['annotations'] = array(); - // set new environment - $this->num_columns = 1; - $this->current_column = 0; - $this->SetAutoPageBreak(false); - if (($w === '') OR ($w <= 0)) { - $w = $this->w - $this->lMargin - $this->rMargin; - } - if (($h === '') OR ($h <= 0)) { - $h = $this->h - $this->tMargin - $this->bMargin; - } - $this->xobjects[$this->xobjid]['x'] = 0; - $this->xobjects[$this->xobjid]['y'] = 0; - $this->xobjects[$this->xobjid]['w'] = $w; - $this->xobjects[$this->xobjid]['h'] = $h; - $this->w = $w; - $this->h = $h; - $this->wPt = $this->w * $this->k; - $this->hPt = $this->h * $this->k; - $this->fwPt = $this->wPt; - $this->fhPt = $this->hPt; - $this->x = 0; - $this->y = 0; - $this->lMargin = 0; - $this->rMargin = 0; - $this->tMargin = 0; - $this->bMargin = 0; - return $this->xobjid; - } - - /** - * End the current XObject Template started with startTemplate() and restore the previous graphic state. - * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). - * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. - * @return int the XObject Template ID in case of success or false in case of error. - * @author Nicola Asuni - * @access public - * @since 5.8.017 (2010-08-24) - * @see startTemplate(), printTemplate() - */ - public function endTemplate() { - if (!$this->inxobj) { - // we are not inside a template - return false; - } - $this->inxobj = false; - // restore previous graphic state - $this->setGraphicVars($this->xobjects[$this->xobjid]['gvars'], true); - return $this->xobjid; - } - - /** - * Print an XObject Template. - * You can print an XObject Template inside the currently opened Template. - * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). - * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. - * @param string $id The ID of XObject Template to print. - * @param int $x X position in user units (empty string = current x position) - * @param int $y Y position in user units (empty string = current y position) - * @param int $w Width in user units (zero = remaining page width) - * @param int $h Height in user units (zero = remaining page height) - * @param string $align Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> - * @param string $palign Allows to center or align the template on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @param boolean $fitonpage if true the template is resized to not exceed page dimensions. - * @author Nicola Asuni - * @access public - * @since 5.8.017 (2010-08-24) - * @see startTemplate(), endTemplate() - */ - public function printTemplate($id, $x='', $y='', $w=0, $h=0, $align='', $palign='', $fitonpage=false) { - if (!isset($this->xobjects[$id])) { - $this->Error('The XObject Template \''.$id.'\' doesn\'t exist!'); - } - if ($this->inxobj) { - if ($id == $this->xobjid) { - // close current template - $this->endTemplate(); - } else { - // use the template as resource for the template currently opened - $this->xobjects[$this->xobjid]['xobjects'][$id] = $this->xobjects[$id]; - } - } - // set default values - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($h, $x, $y); - $ow = $this->xobjects[$id]['w']; - $oh = $this->xobjects[$id]['h']; - // calculate template width and height on document - if (($w <= 0) AND ($h <= 0)) { - $w = $ow; - $h = $oh; - } elseif ($w <= 0) { - $w = $h * $ow / $oh; - } elseif ($h <= 0) { - $h = $w * $oh / $ow; - } - // fit the template on available space - $this->fitBlock($w, $h, $x, $y, $fitonpage); - // set page alignment - $rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($palign == 'L') { - $xt = $this->lMargin; - } elseif ($palign == 'C') { - $xt = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $xt = $this->w - $this->rMargin - $w; - } else { - $xt = $x - $w; - } - $rb_x = $xt; - } else { - if ($palign == 'L') { - $xt = $this->lMargin; - } elseif ($palign == 'C') { - $xt = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $xt = $this->w - $this->rMargin - $w; - } else { - $xt = $x; - } - $rb_x = $xt + $w; - } - // print XObject Template + Transformation matrix - $this->StartTransform(); - // translate and scale - $sx = ($w / $this->xobjects[$id]['w']); - $sy = ($h / $this->xobjects[$id]['h']); - $tm = array(); - $tm[0] = $sx; - $tm[1] = 0; - $tm[2] = 0; - $tm[3] = $sy; - $tm[4] = $xt * $this->k; - $tm[5] = ($this->h - $h - $y) * $this->k; - $this->Transform($tm); - // set object - $this->_out('/'.$id.' Do'); - $this->StopTransform(); - // add annotations - if (!empty($this->xobjects[$id]['annotations'])) { - foreach ($this->xobjects[$id]['annotations'] as $annot) { - // transform original coordinates - $coordlt = $this->getTransformationMatrixProduct($tm, array(1, 0, 0, 1, ($annot['x'] * $this->k), (-$annot['y'] * $this->k))); - $ax = ($coordlt[4] / $this->k); - $ay = ($this->h - $h - ($coordlt[5] / $this->k)); - $coordrb = $this->getTransformationMatrixProduct($tm, array(1, 0, 0, 1, (($annot['x'] + $annot['w']) * $this->k), ((-$annot['y'] - $annot['h']) * $this->k))); - $aw = ($coordrb[4] / $this->k) - $ax; - $ah = ($this->h - $h - ($coordrb[5] / $this->k)) - $ay; - $this->Annotation($ax, $ay, $aw, $ah, $annot['text'], $annot['opt'], $annot['spaces']); - } - } - // set pointer to align the next text/objects - switch($align) { - case 'T': { - $this->y = $y; - $this->x = $rb_x; - break; - } - case 'M': { - $this->y = $y + round($h/2); - $this->x = $rb_x; - break; - } - case 'B': { - $this->y = $rb_y; - $this->x = $rb_x; - break; - } - case 'N': { - $this->SetY($rb_y); - break; - } - default:{ - break; - } - } - } - - /** - * Set the percentage of character stretching. - * @param int $perc percentage of stretching (100 = no stretching) - * @author Nicola Asuni - * @access public - * @since 5.9.000 (2010-09-29) - */ - public function setFontStretching($perc=100) { - $this->font_stretching = $perc; - } - - /** - * Get the percentage of character stretching. - * @return float stretching value - * @author Nicola Asuni - * @access public - * @since 5.9.000 (2010-09-29) - */ - public function getFontStretching() { - return $this->font_stretching; - } - - /** - * Set the amount to increase or decrease the space between characters in a text. - * @param float $spacing amount to increase or decrease the space between characters in a text (0 = default spacing) - * @author Nicola Asuni - * @access public - * @since 5.9.000 (2010-09-29) - */ - public function setFontSpacing($spacing=0) { - $this->font_spacing = $spacing; - } - - /** - * Get the amount to increase or decrease the space between characters in a text. - * @return int font spacing (tracking/kerning) value - * @author Nicola Asuni - * @access public - * @since 5.9.000 (2010-09-29) - */ - public function getFontSpacing() { - return $this->font_spacing; - } - - /** - * Return an array of no-write page regions - * @return array of no-write page regions - * @author Nicola Asuni - * @access public - * @since 5.9.003 (2010-10-13) - * @see setPageRegions(), addPageRegion() - */ - public function getPageRegions() { - return $this->page_regions; - } - - /** - * Set no-write regions on page. - * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. - * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. - * You can set multiple regions for the same page. - * @param array $regions array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions. - * @author Nicola Asuni - * @access public - * @since 5.9.003 (2010-10-13) - * @see addPageRegion(), getPageRegions() - */ - public function setPageRegions($regions=array()) { - // empty current regions array - $this->page_regions = array(); - // add regions - foreach ($regions as $data) { - $this->addPageRegion($data); - } - } - - /** - * Add a single no-write region on selected page. - * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. - * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. - * You can set multiple regions for the same page. - * @param array $region array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). - * @author Nicola Asuni - * @access public - * @since 5.9.003 (2010-10-13) - * @see setPageRegions(), getPageRegions() - */ - public function addPageRegion($region) { - if (!isset($region['page']) OR empty($region['page'])) { - $region['page'] = $this->page; - } - if (isset($region['xt']) AND isset($region['xb']) AND ($region['xt'] > 0) AND ($region['xb'] > 0) - AND isset($region['yt']) AND isset($region['yb']) AND ($region['yt'] >= 0) AND ($region['yt'] < $region['yb']) - AND isset($region['side']) AND (($region['side'] == 'L') OR ($region['side'] == 'R'))) { - $this->page_regions[] = $region; - } - } - - /** - * Remove a single no-write region. - * @param int $key region key - * @author Nicola Asuni - * @access public - * @since 5.9.003 (2010-10-13) - * @see setPageRegions(), getPageRegions() - */ - public function removePageRegion($key) { - if (isset($this->page_regions[$key])) { - unset($this->page_regions[$key]); - } - } - - /** - * Check page for no-write regions and adapt current coordinates and page margins if necessary. - * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. - * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. - * @param float $h height of the text/image/object to print in user units - * @param float $x current X coordinate in user units - * @param float $y current Y coordinate in user units - * @author Nicola Asuni - * @access protected - * @since 5.9.003 (2010-10-13) - */ - protected function checkPageRegions($h=0, &$x='', &$y='') { - // set default values - if ($x === '') { - $x = &$this->x; - } - if ($y === '') { - $y = &$this->y; - } - if (empty($this->page_regions)) { - // no page regions defined - return; - } - if (empty($h)) { - $h = ($this->FontSize * $this->cell_height_ratio) + $this->cell_padding['T'] + $this->cell_padding['B']; - } - if ($this->rtl) { - $this->lMargin = $this->original_lMargin; - } else { - $this->rMargin = $this->original_rMargin; - } - if ($this->AutoPageBreak AND !$this->InFooter AND (($y + $h) > $this->PageBreakTrigger)) { - // the content will be printed on a new page - return; - } - // adjust coordinates and page margins - foreach ($this->page_regions as $regid => $regdata) { - if ($regdata['page'] == $this->page) { - // check region boundaries - if (($y > ($regdata['yt'] - $h)) AND ($y <= $regdata['yb'])) { - // Y is inside the region - $minv = ($regdata['xb'] - $regdata['xt']) / ($regdata['yb'] - $regdata['yt']); // inverse of angular coefficient - $yt = max($y, $regdata['yt']); - $yb = min(($yt + $h), $regdata['yb']); - $xt = (($yt - $regdata['yt']) * $minv) + $regdata['xt']; - $xb = (($yb - $regdata['yt']) * $minv) + $regdata['xt']; - if ($regdata['side'] == 'L') { // left side - $new_margin = max($xt, $xb); - if ($this->lMargin < $new_margin) { - if ($this->rtl) { - // adjust left page margin - $this->lMargin = $new_margin; - } - if ($x < $new_margin) { - // adjust x position - $x = $new_margin; - } - } - } elseif ($regdata['side'] == 'R') { // right side - $new_margin = min($xt, $xb); - if (($this->w - $this->rMargin) > $new_margin) { - if (!$this->rtl) { - // adjust right page margin - $this->rMargin = ($this->w - $new_margin); - } - if ($x > $new_margin) { - // adjust x position - $x = $new_margin; - } - } - } - } - } - } - } - - // -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- - // SVG METHODS - // -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- - - /** - * Embedd a Scalable Vector Graphics (SVG) image. - * NOTE: SVG standard is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. - * @param string $file Name of the SVG file. - * @param float $x Abscissa of the upper-left corner. - * @param float $y Ordinate of the upper-left corner. - * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. - * @param mixed $link URL or identifier returned by AddLink(). - * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:<ul><li>T: top-right for LTR or top-left for RTL</li><li>M: middle-right for LTR or middle-left for RTL</li><li>B: bottom-right for LTR or bottom-left for RTL</li><li>N: next line</li></ul> If the alignment is an empty string, then the pointer will be restored on the starting SVG position. - * @param string $palign Allows to center or align the image on the current line. Possible values are:<ul><li>L : left align</li><li>C : center</li><li>R : right align</li><li>'' : empty string : left for LTR or right for RTL</li></ul> - * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:<ul><li>0: no border (default)</li><li>1: frame</li></ul> or a string containing some or all of the following characters (in any order):<ul><li>L: left</li><li>T: top</li><li>R: right</li><li>B: bottom</li></ul> or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) - * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access public - */ - public function ImageSVG($file, $x='', $y='', $w=0, $h=0, $link='', $align='', $palign='', $border=0, $fitonpage=false) { - if ($this->rasterize_vector_images AND ($w > 0) AND ($h > 0)) { - // convert SVG to raster image using GD or ImageMagick libraries - return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false); - } - $this->svgdir = dirname($file); - $svgdata = file_get_contents($file); - if ($svgdata === false) { - $this->Error('SVG file not found: '.$file); - } - if ($x === '') { - $x = $this->x; - } - if ($y === '') { - $y = $this->y; - } - // check page for no-write regions and adapt page margins if necessary - $this->checkPageRegions($x, $y); - $k = $this->k; - $ox = 0; - $oy = 0; - $ow = $w; - $oh = $h; - $aspect_ratio_align = 'xMidYMid'; - $aspect_ratio_ms = 'meet'; - $regs = array(); - // get original image width and height - preg_match('/<svg([^\>]*)>/si', $svgdata, $regs); - if (isset($regs[1]) AND !empty($regs[1])) { - $tmp = array(); - if (preg_match('/[\s]+x[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { - $ox = $this->getHTMLUnitToUnits($tmp[1], 0, $this->svgunit, false); - } - $tmp = array(); - if (preg_match('/[\s]+y[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { - $oy = $this->getHTMLUnitToUnits($tmp[1], 0, $this->svgunit, false); - } - $tmp = array(); - if (preg_match('/[\s]+width[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { - $ow = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); - } - $tmp = array(); - if (preg_match('/[\s]+height[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { - $oh = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); - } - $tmp = array(); - $view_box = array(); - if (preg_match('/[\s]+viewBox[\s]*=[\s]*"[\s]*([0-9\.\-]+)[\s]+([0-9\.\-]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]*"/si', $regs[1], $tmp)) { - if (count($tmp) == 5) { - array_shift($tmp); - foreach ($tmp as $key => $val) { - $view_box[$key] = $this->getHTMLUnitToUnits($val, 0, $this->svgunit, false); - } - $ox = $view_box[0]; - $oy = $view_box[1]; - } - // get aspect ratio - $tmp = array(); - if (preg_match('/[\s]+preserveAspectRatio[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { - $aspect_ratio = preg_split('/[\s]+/si', $tmp[1]); - switch (count($aspect_ratio)) { - case 3: { - $aspect_ratio_align = $aspect_ratio[1]; - $aspect_ratio_ms = $aspect_ratio[2]; - break; - } - case 2: { - $aspect_ratio_align = $aspect_ratio[0]; - $aspect_ratio_ms = $aspect_ratio[1]; - break; - } - case 1: { - $aspect_ratio_align = $aspect_ratio[0]; - $aspect_ratio_ms = 'meet'; - break; - } - } - } - } - } - // calculate image width and height on document - if (($w <= 0) AND ($h <= 0)) { - // convert image size to document unit - $w = $ow; - $h = $oh; - } elseif ($w <= 0) { - $w = $h * $ow / $oh; - } elseif ($h <= 0) { - $h = $w * $oh / $ow; - } - // fit the image on available space - $this->fitBlock($w, $h, $x, $y, $fitonpage); - if ($this->rasterize_vector_images) { - // convert SVG to raster image using GD or ImageMagick libraries - return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false); - } - // set alignment - $this->img_rb_y = $y + $h; - // set alignment - if ($this->rtl) { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x - $w; - } - $this->img_rb_x = $ximg; - } else { - if ($palign == 'L') { - $ximg = $this->lMargin; - } elseif ($palign == 'C') { - $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; - } elseif ($palign == 'R') { - $ximg = $this->w - $this->rMargin - $w; - } else { - $ximg = $x; - } - $this->img_rb_x = $ximg + $w; - } - // store current graphic vars - $gvars = $this->getGraphicVars(); - // store SVG position and scale factors - $svgoffset_x = ($ximg - $ox) * $this->k; - $svgoffset_y = -($y - $oy) * $this->k; - if (isset($view_box[2]) AND ($view_box[2] > 0) AND ($view_box[3] > 0)) { - $ow = $view_box[2]; - $oh = $view_box[3]; - } - $svgscale_x = $w / $ow; - $svgscale_y = $h / $oh; - // scaling and alignment - if ($aspect_ratio_align != 'none') { - // store current scaling values - $svgscale_old_x = $svgscale_x; - $svgscale_old_y = $svgscale_y; - // force uniform scaling - if ($aspect_ratio_ms == 'slice') { - // the entire viewport is covered by the viewBox - if ($svgscale_x > $svgscale_y) { - $svgscale_y = $svgscale_x; - } elseif ($svgscale_x < $svgscale_y) { - $svgscale_x = $svgscale_y; - } - } else { // meet - // the entire viewBox is visible within the viewport - if ($svgscale_x < $svgscale_y) { - $svgscale_y = $svgscale_x; - } elseif ($svgscale_x > $svgscale_y) { - $svgscale_x = $svgscale_y; - } - } - // correct X alignment - switch (substr($aspect_ratio_align, 1, 3)) { - case 'Min': { - // do nothing - break; - } - case 'Max': { - $svgoffset_x += (($w * $this->k) - ($ow * $this->k * $svgscale_x)); - break; - } - default: - case 'Mid': { - $svgoffset_x += ((($w * $this->k) - ($ow * $this->k * $svgscale_x)) / 2); - break; - } - } - // correct Y alignment - switch (substr($aspect_ratio_align, 5)) { - case 'Min': { - // do nothing - break; - } - case 'Max': { - $svgoffset_y -= (($h * $this->k) - ($oh * $this->k * $svgscale_y)); - break; - } - default: - case 'Mid': { - $svgoffset_y -= ((($h * $this->k) - ($oh * $this->k * $svgscale_y)) / 2); - break; - } - } - } - // store current page break mode - $page_break_mode = $this->AutoPageBreak; - $page_break_margin = $this->getBreakMargin(); - $cell_padding = $this->cell_padding; - $this->SetCellPadding(0); - $this->SetAutoPageBreak(false); - // save the current graphic state - $this->_out('q'.$this->epsmarker); - // set initial clipping mask - $this->Rect($x, $y, $w, $h, 'CNZ', array(), array()); - // scale and translate - $e = $ox * $this->k * (1 - $svgscale_x); - $f = ($this->h - $oy) * $this->k * (1 - $svgscale_y); - $this->_out(sprintf('%.3F %.3F %.3F %.3F %.3F %.3F cm', $svgscale_x, 0, 0, $svgscale_y, $e + $svgoffset_x, $f + $svgoffset_y)); - // creates a new XML parser to be used by the other XML functions - $this->parser = xml_parser_create('UTF-8'); - // the following function allows to use parser inside object - xml_set_object($this->parser, $this); - // disable case-folding for this XML parser - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); - // sets the element handler functions for the XML parser - xml_set_element_handler($this->parser, 'startSVGElementHandler', 'endSVGElementHandler'); - // sets the character data handler function for the XML parser - xml_set_character_data_handler($this->parser, 'segSVGContentHandler'); - // start parsing an XML document - if(!xml_parse($this->parser, $svgdata)) { - $error_message = sprintf("SVG Error: %s at line %d", xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser)); - $this->Error($error_message); - } - // free this XML parser - xml_parser_free($this->parser); - // restore previous graphic state - $this->_out($this->epsmarker.'Q'); - // restore graphic vars - $this->setGraphicVars($gvars); - $this->lasth = $gvars['lasth']; - if (!empty($border)) { - $bx = $this->x; - $by = $this->y; - $this->x = $ximg; - if ($this->rtl) { - $this->x += $w; - } - $this->y = $y; - $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); - $this->x = $bx; - $this->y = $by; - } - if ($link) { - $this->Link($ximg, $y, $w, $h, $link, 0); - } - // set pointer to align the next text/objects - switch($align) { - case 'T':{ - $this->y = $y; - $this->x = $this->img_rb_x; - break; - } - case 'M':{ - $this->y = $y + round($h/2); - $this->x = $this->img_rb_x; - break; - } - case 'B':{ - $this->y = $this->img_rb_y; - $this->x = $this->img_rb_x; - break; - } - case 'N':{ - $this->SetY($this->img_rb_y); - break; - } - default:{ - // restore pointer to starting position - $this->x = $gvars['x']; - $this->y = $gvars['y']; - $this->page = $gvars['page']; - $this->current_column = $gvars['current_column']; - $this->tMargin = $gvars['tMargin']; - $this->bMargin = $gvars['bMargin']; - $this->w = $gvars['w']; - $this->h = $gvars['h']; - $this->wPt = $gvars['wPt']; - $this->hPt = $gvars['hPt']; - $this->fwPt = $gvars['fwPt']; - $this->fhPt = $gvars['fhPt']; - break; - } - } - $this->endlinex = $this->img_rb_x; - // restore page break - $this->SetAutoPageBreak($page_break_mode, $page_break_margin); - $this->cell_padding = $cell_padding; - } - - /** - * Get the tranformation matrix from SVG transform attribute - * @param string transformation - * @return array of transformations - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function getSVGTransformMatrix($attribute) { - // identity matrix - $tm = array(1, 0, 0, 1, 0, 0); - $transform = array(); - if (preg_match_all('/(matrix|translate|scale|rotate|skewX|skewY)[\s]*\(([^\)]+)\)/si', $attribute, $transform, PREG_SET_ORDER) > 0) { - foreach ($transform as $key => $data) { - if (!empty($data[2])) { - $a = 1; - $b = 0; - $c = 0; - $d = 1; - $e = 0; - $f = 0; - $regs = array(); - switch ($data[1]) { - case 'matrix': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $b = $regs[2]; - $c = $regs[3]; - $d = $regs[4]; - $e = $regs[5]; - $f = $regs[6]; - } - break; - } - case 'translate': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $e = $regs[1]; - $f = $regs[2]; - } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $e = $regs[1]; - } - break; - } - case 'scale': { - if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $d = $regs[2]; - } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $a = $regs[1]; - $d = $a; - } - break; - } - case 'rotate': { - if (preg_match('/([0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { - $ang = deg2rad($regs[1]); - $x = $regs[2]; - $y = $regs[3]; - $a = cos($ang); - $b = sin($ang); - $c = -$b; - $d = $a; - $e = ($x * (1 - $a)) - ($y * $c); - $f = ($y * (1 - $d)) - ($x * $b); - } elseif (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $ang = deg2rad($regs[1]); - $a = cos($ang); - $b = sin($ang); - $c = -$b; - $d = $a; - $e = 0; - $f = 0; - } - break; - } - case 'skewX': { - if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $c = tan(deg2rad($regs[1])); - } - break; - } - case 'skewY': { - if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { - $b = tan(deg2rad($regs[1])); - } - break; - } - } - $tm = $this->getTransformationMatrixProduct($tm, array($a, $b, $c, $d, $e, $f)); - } - } - } - return $tm; - } - - /** - * Get the product of two SVG tranformation matrices - * @param array $ta first SVG tranformation matrix - * @param array $tb second SVG tranformation matrix - * @return transformation array - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function getTransformationMatrixProduct($ta, $tb) { - $tm = array(); - $tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]); - $tm[1] = ($ta[1] * $tb[0]) + ($ta[3] * $tb[1]); - $tm[2] = ($ta[0] * $tb[2]) + ($ta[2] * $tb[3]); - $tm[3] = ($ta[1] * $tb[2]) + ($ta[3] * $tb[3]); - $tm[4] = ($ta[0] * $tb[4]) + ($ta[2] * $tb[5]) + $ta[4]; - $tm[5] = ($ta[1] * $tb[4]) + ($ta[3] * $tb[5]) + $ta[5]; - return $tm; - } - - /** - * Convert SVG transformation matrix to PDF. - * @param array $tm original SVG transformation matrix - * @return array transformation matrix - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected function convertSVGtMatrix($tm) { - $a = $tm[0]; - $b = -$tm[1]; - $c = -$tm[2]; - $d = $tm[3]; - $e = $this->getHTMLUnitToUnits($tm[4], 1, $this->svgunit, false) * $this->k; - $f = -$this->getHTMLUnitToUnits($tm[5], 1, $this->svgunit, false) * $this->k; - $x = 0; - $y = $this->h * $this->k; - $e = ($x * (1 - $a)) - ($y * $c) + $e; - $f = ($y * (1 - $d)) - ($x * $b) + $f; - return array($a, $b, $c, $d, $e, $f); - } - - /** - * Apply SVG graphic transformation matrix. - * @param array $tm original SVG transformation matrix - * @access protected - * @since 5.0.000 (2010-05-02) - */ - protected function SVGTransform($tm) { - $this->Transform($this->convertSVGtMatrix($tm)); - } - - /** - * Apply the requested SVG styles (*** TO BE COMPLETED ***) - * @param array $svgstyle array of SVG styles to apply - * @param array $prevsvgstyle array of previous SVG style - * @param int $x X origin of the bounding box - * @param int $y Y origin of the bounding box - * @param int $w width of the bounding box - * @param int $h height of the bounding box - * @param string $clip_function clip function - * @param array $clip_params array of parameters for clipping function - * @return object style - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1, $clip_function='', $clip_params=array()) { - $objstyle = ''; - if(!isset($svgstyle['opacity'])) { - return $objstyle; - } - // clip-path - $regs = array(); - if (preg_match('/url\([\s]*\#([^\)]*)\)/si', $svgstyle['clip-path'], $regs)) { - $clip_path = $this->svgclippaths[$regs[1]]; - foreach ($clip_path as $cp) { - $this->startSVGElementHandler('clip-path', $cp['name'], $cp['attribs'], $cp['tm']); - } - } - // opacity - if ($svgstyle['opacity'] != 1) { - $this->SetAlpha($svgstyle['opacity']); - } - // color - $fill_color = $this->convertHTMLColorToDec($svgstyle['color']); - $this->SetFillColorArray($fill_color); - // text color - $text_color = $this->convertHTMLColorToDec($svgstyle['text-color']); - $this->SetTextColorArray($text_color); - // clip - if (preg_match('/rect\(([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)\)/si', $svgstyle['clip'], $regs)) { - $top = (isset($regs[1])?$this->getHTMLUnitToUnits($regs[1], 0, $this->svgunit, false):0); - $right = (isset($regs[2])?$this->getHTMLUnitToUnits($regs[2], 0, $this->svgunit, false):0); - $bottom = (isset($regs[3])?$this->getHTMLUnitToUnits($regs[3], 0, $this->svgunit, false):0); - $left = (isset($regs[4])?$this->getHTMLUnitToUnits($regs[4], 0, $this->svgunit, false):0); - $cx = $x + $left; - $cy = $y + $top; - $cw = $w - $left - $right; - $ch = $h - $top - $bottom; - if ($svgstyle['clip-rule'] == 'evenodd') { - $clip_rule = 'CNZ'; - } else { - $clip_rule = 'CEO'; - } - $this->Rect($cx, $cy, $cw, $ch, $clip_rule, array(), array()); - } - // fill - $regs = array(); - if (preg_match('/url\([\s]*\#([^\)]*)\)/si', $svgstyle['fill'], $regs)) { - // gradient - $gradient = $this->svggradients[$regs[1]]; - if (isset($gradient['xref'])) { - // reference to another gradient definition - $newgradient = $this->svggradients[$gradient['xref']]; - $newgradient['coords'] = $gradient['coords']; - $newgradient['mode'] = $gradient['mode']; - $newgradient['gradientUnits'] = $gradient['gradientUnits']; - if (isset($gradient['gradientTransform'])) { - $newgradient['gradientTransform'] = $gradient['gradientTransform']; - } - $gradient = $newgradient; - } - //save current Graphic State - $this->_out('q'); - //set clipping area - if (!empty($clip_function) AND method_exists($this, $clip_function)) { - $bbox = call_user_func_array(array($this, $clip_function), $clip_params); - if (is_array($bbox) AND (count($bbox) == 4)) { - list($x, $y, $w, $h) = $bbox; - } - } - if ($gradient['mode'] == 'measure') { - if (isset($gradient['gradientTransform']) AND !empty($gradient['gradientTransform'])) { - $gtm = $gradient['gradientTransform']; - // apply transformation matrix - $xa = ($gtm[0] * $gradient['coords'][0]) + ($gtm[2] * $gradient['coords'][1]) + $gtm[4]; - $ya = ($gtm[1] * $gradient['coords'][0]) + ($gtm[3] * $gradient['coords'][1]) + $gtm[5]; - $xb = ($gtm[0] * $gradient['coords'][2]) + ($gtm[2] * $gradient['coords'][3]) + $gtm[4]; - $yb = ($gtm[1] * $gradient['coords'][2]) + ($gtm[3] * $gradient['coords'][3]) + $gtm[5]; - if (isset($gradient['coords'][4])) { - $gradient['coords'][4] = sqrt(pow(($gtm[0] * $gradient['coords'][4]), 2) + pow(($gtm[1] * $gradient['coords'][4]), 2)); - } - $gradient['coords'][0] = $xa; - $gradient['coords'][1] = $ya; - $gradient['coords'][2] = $xb; - $gradient['coords'][3] = $yb; - - } - // convert SVG coordinates to user units - $gradient['coords'][0] = $this->getHTMLUnitToUnits($gradient['coords'][0], 0, $this->svgunit, false); - $gradient['coords'][1] = $this->getHTMLUnitToUnits($gradient['coords'][1], 0, $this->svgunit, false); - $gradient['coords'][2] = $this->getHTMLUnitToUnits($gradient['coords'][2], 0, $this->svgunit, false); - $gradient['coords'][3] = $this->getHTMLUnitToUnits($gradient['coords'][3], 0, $this->svgunit, false); - if (isset($gradient['coords'][4])) { - $gradient['coords'][4] = $this->getHTMLUnitToUnits($gradient['coords'][4], 0, $this->svgunit, false); - } - // shift units - if ($gradient['gradientUnits'] == 'objectBoundingBox') { - // convert to SVG coordinate system - $gradient['coords'][0] += $x; - $gradient['coords'][1] += $y; - $gradient['coords'][2] += $x; - $gradient['coords'][3] += $y; - } - // calculate percentages - $gradient['coords'][0] = ($gradient['coords'][0] - $x) / $w; - $gradient['coords'][1] = ($gradient['coords'][1] - $y) / $h; - $gradient['coords'][2] = ($gradient['coords'][2] - $x) / $w; - $gradient['coords'][3] = ($gradient['coords'][3] - $y) / $h; - if (isset($gradient['coords'][4])) { - $gradient['coords'][4] /= $w; - } - // fix values - foreach($gradient['coords'] as $key => $val) { - if ($val < 0) { - $gradient['coords'][$key] = 0; - } elseif ($val > 1) { - $gradient['coords'][$key] = 1; - } - } - if (($gradient['type'] == 2) AND ($gradient['coords'][0] == $gradient['coords'][2]) AND ($gradient['coords'][1] == $gradient['coords'][3])) { - // single color (no shading) - $gradient['coords'][0] = 1; - $gradient['coords'][1] = 0; - $gradient['coords'][2] = 0.999; - $gradient['coords'][3] = 0; - } - } - // swap Y coordinates - $tmp = $gradient['coords'][1]; - $gradient['coords'][1] = $gradient['coords'][3]; - $gradient['coords'][3] = $tmp; - // set transformation map for gradient - if (($gradient['type'] == 3) AND ($gradient['mode'] == 'measure')) { - // gradient is always circular - $cy = $this->h - $y - ($gradient['coords'][1] * ($w + $h)); - $this->_out(sprintf('%.3F 0 0 %.3F %.3F %.3F cm', $w*$this->k, $w*$this->k, $x*$this->k, $cy*$this->k)); - } else { - $this->_out(sprintf('%.3F 0 0 %.3F %.3F %.3F cm', $w*$this->k, $h*$this->k, $x*$this->k, ($this->h-($y+$h))*$this->k)); - } - if (count($gradient['stops']) > 1) { - $this->Gradient($gradient['type'], $gradient['coords'], $gradient['stops'], array(), false); - } - } elseif ($svgstyle['fill'] != 'none') { - $fill_color = $this->convertHTMLColorToDec($svgstyle['fill']); - if ($svgstyle['fill-opacity'] != 1) { - $this->SetAlpha($svgstyle['fill-opacity']); - } - $this->SetFillColorArray($fill_color); - if ($svgstyle['fill-rule'] == 'evenodd') { - $objstyle .= 'F*'; - } else { - $objstyle .= 'F'; - } - } - // stroke - if ($svgstyle['stroke'] != 'none') { - $stroke_style = array( - 'color' => $this->convertHTMLColorToDec($svgstyle['stroke']), - 'width' => $this->getHTMLUnitToUnits($svgstyle['stroke-width'], 0, $this->svgunit, false), - 'cap' => $svgstyle['stroke-linecap'], - 'join' => $svgstyle['stroke-linejoin'] - ); - if (isset($svgstyle['stroke-dasharray']) AND !empty($svgstyle['stroke-dasharray']) AND ($svgstyle['stroke-dasharray'] != 'none')) { - $stroke_style['dash'] = $svgstyle['stroke-dasharray']; - } - $this->SetLineStyle($stroke_style); - $objstyle .= 'D'; - } - // font - $regs = array(); - if (!empty($svgstyle['font'])) { - if (preg_match('/font-family[\s]*:[\s]*([^\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_family = $this->getFontFamilyName($regs[1]); - } else { - $font_family = $svgstyle['font-family']; - } - if (preg_match('/font-size[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_size = trim($regs[1]); - } else { - $font_size = $svgstyle['font-size']; - } - if (preg_match('/font-style[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_style = trim($regs[1]); - } else { - $font_style = $svgstyle['font-style']; - } - if (preg_match('/font-weight[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_weight = trim($regs[1]); - } else { - $font_weight = $svgstyle['font-weight']; - } - if (preg_match('/font-stretch[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_stretch = trim($regs[1]); - } else { - $font_stretch = $svgstyle['font-stretch']; - } - if (preg_match('/letter-spacing[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { - $font_spacing = trim($regs[1]); - } else { - $font_spacing = $svgstyle['letter-spacing']; - } - } else { - $font_family = $this->getFontFamilyName($svgstyle['font-family']); - $font_size = $svgstyle['font-size']; - $font_style = $svgstyle['font-style']; - $font_weight = $svgstyle['font-weight']; - $font_stretch = $svgstyle['font-stretch']; - $font_spacing = $svgstyle['letter-spacing']; - } - $font_size = $this->getHTMLUnitToUnits($font_size, $prevsvgstyle['font-size'], $this->svgunit, false) * $this->k; - $font_stretch = $this->getCSSFontStretching($font_stretch, $svgstyle['font-stretch']); - $font_spacing = $this->getCSSFontSpacing($font_spacing, $svgstyle['letter-spacing']); - switch ($font_style) { - case 'italic': { - $font_style = 'I'; - break; - } - case 'oblique': { - $font_style = 'I'; - break; - } - default: - case 'normal': { - $font_style = ''; - break; - } - } - switch ($font_weight) { - case 'bold': - case 'bolder': { - $font_style .= 'B'; - break; - } - } - switch ($svgstyle['text-decoration']) { - case 'underline': { - $font_style .= 'U'; - break; - } - case 'overline': { - $font_style .= 'O'; - break; - } - case 'line-through': { - $font_style .= 'D'; - break; - } - default: - case 'none': { - break; - } - } - $this->SetFont($font_family, $font_style, $font_size); - $this->setFontStretching($font_stretch); - $this->setFontSpacing($font_spacing); - return $objstyle; - } - - /** - * Draws an SVG path - * @param string $d attribute d of the path SVG element - * @param string $style Style of rendering. Possible values are: - * <ul> - * <li>D or empty string: Draw (default).</li> - * <li>F: Fill.</li> - * <li>F*: Fill using the even-odd rule to determine which regions lie inside the clipping path.</li> - * <li>DF or FD: Draw and fill.</li> - * <li>DF* or FD*: Draw and fill using the even-odd rule to determine which regions lie inside the clipping path.</li> - * <li>CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).</li> - * <li>CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).</li> - * </ul> - * @return array of container box measures (x, y, w, h) - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function SVGPath($d, $style='') { - // set fill/stroke style - $op = $this->getPathPaintOperator($style, ''); - if (empty($op)) { - return; - } - $paths = array(); - $d = str_replace('-', ' -', $d); - $d = str_replace('+', ' +', $d); - preg_match_all('/([a-zA-Z])[\s]*([^a-zA-Z\"]*)/si', $d, $paths, PREG_SET_ORDER); - $x = 0; - $y = 0; - $x1 = 0; - $y1 = 0; - $x2 = 0; - $y2 = 0; - $xmin = 2147483647; - $xmax = 0; - $ymin = 2147483647; - $ymax = 0; - $relcoord = false; - // draw curve pieces - foreach ($paths as $key => $val) { - // get curve type - $cmd = trim($val[1]); - if (strtolower($cmd) == $cmd) { - // use relative coordinated instead of absolute - $relcoord = true; - $xoffset = $x; - $yoffset = $y; - } else { - $relcoord = false; - $xoffset = 0; - $yoffset = 0; - } - $params = array(); - if (isset($val[2])) { - // get curve parameters - $rawparams = preg_split('/([\,\s]+)/si', trim($val[2])); - $params = array(); - foreach ($rawparams as $ck => $cp) { - $params[$ck] = $this->getHTMLUnitToUnits($cp, 0, $this->svgunit, false); - } - } - switch (strtoupper($cmd)) { - case 'M': { // moveto - foreach ($params as $ck => $cp) { - if (($ck % 2) == 0) { - $x = $cp + $xoffset; - } else { - $y = $cp + $yoffset; - if ($ck == 1) { - $this->_outPoint($x, $y); - } else { - $this->_outLine($x, $y); - } - $xmin = min($xmin, $x); - $ymin = min($ymin, $y); - $xmax = max($xmax, $x); - $ymax = max($ymax, $y); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'L': { // lineto - foreach ($params as $ck => $cp) { - if (($ck % 2) == 0) { - $x = $cp + $xoffset; - } else { - $y = $cp + $yoffset; - $this->_outLine($x, $y); - $xmin = min($xmin, $x); - $ymin = min($ymin, $y); - $xmax = max($xmax, $x); - $ymax = max($ymax, $y); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'H': { // horizontal lineto - foreach ($params as $ck => $cp) { - $x = $cp + $xoffset; - $this->_outLine($x, $y); - $xmin = min($xmin, $x); - $xmax = max($xmax, $x); - if ($relcoord) { - $xoffset = $x; - } - } - break; - } - case 'V': { // vertical lineto - foreach ($params as $ck => $cp) { - $y = $cp + $yoffset; - $this->_outLine($x, $y); - $ymin = min($ymin, $y); - $ymax = max($ymax, $y); - if ($relcoord) { - $yoffset = $y; - } - } - break; - } - case 'C': { // curveto - foreach ($params as $ck => $cp) { - $params[$ck] = $cp; - if ((($ck + 1) % 6) == 0) { - $x1 = $params[($ck - 5)] + $xoffset; - $y1 = $params[($ck - 4)] + $yoffset; - $x2 = $params[($ck - 3)] + $xoffset; - $y2 = $params[($ck - 2)] + $yoffset; - $x = $params[($ck - 1)] + $xoffset; - $y = $params[($ck)] + $yoffset; - $this->_outCurve($x1, $y1, $x2, $y2, $x, $y); - $xmin = min($xmin, $x, $x1, $x2); - $ymin = min($ymin, $y, $y1, $y2); - $xmax = max($xmax, $x, $x1, $x2); - $ymax = max($ymax, $y, $y1, $y2); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'S': { // shorthand/smooth curveto - foreach ($params as $ck => $cp) { - $params[$ck] = $cp; - if ((($ck + 1) % 4) == 0) { - if (($key > 0) AND ((strtoupper($paths[($key - 1)][1]) == 'C') OR (strtoupper($paths[($key - 1)][1]) == 'S'))) { - $x1 = (2 * $x) - $x2; - $y1 = (2 * $y) - $y2; - } else { - $x1 = $x; - $y1 = $y; - } - $x2 = $params[($ck - 3)] + $xoffset; - $y2 = $params[($ck - 2)] + $yoffset; - $x = $params[($ck - 1)] + $xoffset; - $y = $params[($ck)] + $yoffset; - $this->_outCurve($x1, $y1, $x2, $y2, $x, $y); - $xmin = min($xmin, $x, $x1, $x2); - $ymin = min($ymin, $y, $y1, $y2); - $xmax = max($xmax, $x, $x1, $x2); - $ymax = max($ymax, $y, $y1, $y2); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'Q': { // quadratic Bézier curveto - foreach ($params as $ck => $cp) { - $params[$ck] = $cp; - if ((($ck + 1) % 4) == 0) { - // convert quadratic points to cubic points - $x1 = $params[($ck - 3)] + $xoffset; - $y1 = $params[($ck - 2)] + $yoffset; - $xa = ($x + (2 * $x1)) / 3; - $ya = ($y + (2 * $y1)) / 3; - $x = $params[($ck - 1)] + $xoffset; - $y = $params[($ck)] + $yoffset; - $xb = ($x + (2 * $x1)) / 3; - $yb = ($y + (2 * $y1)) / 3; - $this->_outCurve($xa, $ya, $xb, $yb, $x, $y); - $xmin = min($xmin, $x, $xa, $xb); - $ymin = min($ymin, $y, $ya, $yb); - $xmax = max($xmax, $x, $xa, $xb); - $ymax = max($ymax, $y, $ya, $yb); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'T': { // shorthand/smooth quadratic Bézier curveto - foreach ($params as $ck => $cp) { - $params[$ck] = $cp; - if (($ck % 2) != 0) { - if (($key > 0) AND ((strtoupper($paths[($key - 1)][1]) == 'Q') OR (strtoupper($paths[($key - 1)][1]) == 'T'))) { - $x1 = (2 * $x) - $x1; - $y1 = (2 * $y) - $y1; - } else { - $x1 = $x; - $y1 = $y; - } - // convert quadratic points to cubic points - $xa = ($x + (2 * $x1)) / 3; - $ya = ($y + (2 * $y1)) / 3; - $x = $params[($ck - 1)] + $xoffset; - $y = $params[($ck)] + $yoffset; - $xb = ($x + (2 * $x1)) / 3; - $yb = ($y + (2 * $y1)) / 3; - $this->_outCurve($xa, $ya, $xb, $yb, $x, $y); - $xmin = min($xmin, $x, $x1, $x2); - $ymin = min($ymin, $y, $y1, $y2); - $xmax = max($xmax, $x, $x1, $x2); - $ymax = max($ymax, $y, $y1, $y2); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'A': { // elliptical arc - foreach ($params as $ck => $cp) { - $params[$ck] = $cp; - if ((($ck + 1) % 7) == 0) { - $x0 = $x; - $y0 = $y; - $rx = abs($params[($ck - 6)]); - $ry = abs($params[($ck - 5)]); - $ang = -$rawparams[($ck - 4)]; - $angle = deg2rad($ang); - $fa = $rawparams[($ck - 3)]; // large-arc-flag - $fs = $rawparams[($ck - 2)]; // sweep-flag - $x = $params[($ck - 1)] + $xoffset; - $y = $params[$ck] + $yoffset; - $cos_ang = cos($angle); - $sin_ang = sin($angle); - $a = ($x0 - $x) / 2; - $b = ($y0 - $y) / 2; - $xa = ($a * $cos_ang) - ($b * $sin_ang); - $ya = ($a * $sin_ang) + ($b * $cos_ang); - $rx2 = $rx * $rx; - $ry2 = $ry * $ry; - $xa2 = $xa * $xa; - $ya2 = $ya * $ya; - $delta = ($xa2 / $rx2) + ($ya2 / $ry2); - if ($delta > 1) { - $rx *= sqrt($delta); - $ry *= sqrt($delta); - $rx2 = $rx * $rx; - $ry2 = $ry * $ry; - } - $numerator = (($rx2 * $ry2) - ($rx2 * $ya2) - ($ry2 * $xa2)); - if ($numerator < 0) { - $root = 0; - } else { - $root = sqrt($numerator / (($rx2 * $ya2) + ($ry2 * $xa2))); - } - if ($fa == $fs) { - $root *= -1; - } - $cax = $root * (($rx * $ya) / $ry); - $cay = -$root * (($ry * $xa) / $rx); - // coordinates of ellipse center - $cx = ($cax * $cos_ang) - ($cay * $sin_ang) + (($x0 + $x) / 2); - $cy = ($cax * $sin_ang) + ($cay * $cos_ang) + (($y0 + $y) / 2); - // get angles - $angs = $this->getVectorsAngle(1, 0, (($xa - $cax) / $rx), (($cay - $ya) / $ry)); - $dang = $this->getVectorsAngle((($xa - $cax) / $rx), (($ya - $cay) / $ry), ((-$xa - $cax) / $rx), ((-$ya - $cay) / $ry)); - if (($fs == 0) AND ($dang > 0)) { - $dang -= (2 * M_PI); - } elseif (($fs == 1) AND ($dang < 0)) { - $dang += (2 * M_PI); - } - $angf = $angs - $dang; - if (($fs == 1) AND ($angs > $angf)) { - $tmp = $angs; - $angs = $angf; - $angf = $tmp; - } - $angs = rad2deg($angs); - $angf = rad2deg($angf); - $pie = false; - if ((isset($paths[($key + 1)][1])) AND (trim($paths[($key + 1)][1]) == 'z')) { - $pie = true; - } - $this->_outellipticalarc($cx, $cy, $rx, $ry, $ang, $angs, $angf, $pie, 2); - $this->_outPoint($x, $y); - $xmin = min($xmin, $x); - $ymin = min($ymin, $y); - $xmax = max($xmax, $x); - $ymax = max($ymax, $y); - if ($relcoord) { - $xoffset = $x; - $yoffset = $y; - } - } - } - break; - } - case 'Z': { - $this->_out('h'); - break; - } - } - } // end foreach - if (!empty($op)) { - $this->_out($op); - } - return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin)); - } - - /** - * Returns the angle in radiants between two vectors - * @param int $x1 X coordiante of first vector point - * @param int $y1 Y coordiante of first vector point - * @param int $x2 X coordiante of second vector point - * @param int $y2 Y coordiante of second vector point - * @author Nicola Asuni - * @since 5.0.000 (2010-05-04) - * @access protected - */ - protected function getVectorsAngle($x1, $y1, $x2, $y2) { - $dprod = ($x1 * $x2) + ($y1 * $y2); - $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1)); - $dist2 = sqrt(($x2 * $x2) + ($y2 * $y2)); - $angle = acos($dprod / ($dist1 * $dist2)); - if (is_nan($angle)) { - $angle = M_PI; - } - if ((($x1 * $y2) - ($x2 * $y1)) < 0) { - $angle *= -1; - } - return $angle; - } - - /** - * Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***) - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. - * @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. - * @param array $ctm tranformation matrix for clipping mode (starting transformation matrix). - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function startSVGElementHandler($parser, $name, $attribs, $ctm=array()) { - // check if we are in clip mode - if ($this->svgclipmode) { - $this->svgclippaths[$this->svgclipid][] = array('name' => $name, 'attribs' => $attribs, 'tm' => $this->svgcliptm[$this->svgclipid]); - return; - } - if ($this->svgdefsmode AND !in_array($name, array('clipPath', 'linearGradient', 'radialGradient', 'stop'))) { - if (!isset($attribs['id'])) { - $attribs['id'] = 'DF_'.(count($this->svgdefs) + 1); - } - $this->svgdefs[$attribs['id']] = array('name' => $name, 'attribs' => $attribs); - return; - } - $clipping = false; - if ($parser == 'clip-path') { - // set clipping mode - $clipping = true; - } - // get styling properties - $prev_svgstyle = $this->svgstyles[(count($this->svgstyles) - 1)]; // previous style - $svgstyle = $this->svgstyles[0]; // set default style - if (isset($attribs['style']) AND !$this->empty_string($attribs['style'])) { - // fix style for regular expression - $attribs['style'] = ';'.$attribs['style']; - } - foreach ($prev_svgstyle as $key => $val) { - if (in_array($key, $this->svginheritprop)) { - // inherit previous value - $svgstyle[$key] = $val; - } - if (isset($attribs[$key]) AND !$this->empty_string($attribs[$key])) { - // specific attribute settings - if ($attribs[$key] == 'inherit') { - $svgstyle[$key] = $val; - } else { - $svgstyle[$key] = $attribs[$key]; - } - } elseif (isset($attribs['style']) AND !$this->empty_string($attribs['style'])) { - // CSS style syntax - $attrval = array(); - if (preg_match('/[;\"\s]{1}'.$key.'[\s]*:[\s]*([^;\"]*)/si', $attribs['style'], $attrval) AND isset($attrval[1])) { - if ($attrval[1] == 'inherit') { - $svgstyle[$key] = $val; - } else { - $svgstyle[$key] = $attrval[1]; - } - } - } - } - // transformation matrix - if (!empty($ctm)) { - $tm = $ctm; - } else { - $tm = $this->svgstyles[(count($this->svgstyles) - 1)]['transfmatrix']; - } - if (isset($attribs['transform']) AND !empty($attribs['transform'])) { - $tm = $this->getTransformationMatrixProduct($tm, $this->getSVGTransformMatrix($attribs['transform'])); - } - $svgstyle['transfmatrix'] = $tm; - $invisible = false; - if (($svgstyle['visibility'] == 'hidden') OR ($svgstyle['visibility'] == 'collapse') OR ($svgstyle['display'] == 'none')) { - // the current graphics element is invisible (nothing is painted) - $invisible = true; - } - // process tag - switch($name) { - case 'defs': { - $this->svgdefsmode = true; - break; - } - // clipPath - case 'clipPath': { - if ($invisible) { - break; - } - $this->svgclipmode = true; - if (!isset($attribs['id'])) { - $attribs['id'] = 'CP_'.(count($this->svgcliptm) + 1); - } - $this->svgclipid = $attribs['id']; - $this->svgclippaths[$this->svgclipid] = array(); - $this->svgcliptm[$this->svgclipid] = $tm; - break; - } - case 'svg': { - // start of SVG object - break; - } - case 'g': { - // group together related graphics elements - array_push($this->svgstyles, $svgstyle); - $this->StartTransform(); - $this->setSVGStyles($svgstyle, $prev_svgstyle); - break; - } - case 'linearGradient': { - if (!isset($attribs['id'])) { - $attribs['id'] = 'GR_'.(count($this->svggradients) + 1); - } - $this->svggradientid = $attribs['id']; - $this->svggradients[$this->svggradientid] = array(); - $this->svggradients[$this->svggradientid]['type'] = 2; - $this->svggradients[$this->svggradientid]['stops'] = array(); - if (isset($attribs['gradientUnits'])) { - $this->svggradients[$this->svggradientid]['gradientUnits'] = $attribs['gradientUnits']; - } else { - $this->svggradients[$this->svggradientid]['gradientUnits'] = 'objectBoundingBox'; - } - //$attribs['spreadMethod'] - $x1 = (isset($attribs['x1'])?$attribs['x1']:0); - $y1 = (isset($attribs['y1'])?$attribs['y1']:0); - $x2 = (isset($attribs['x2'])?$attribs['x2']:1); - $y2 = (isset($attribs['y2'])?$attribs['y2']:0); - if (isset($attribs['x1']) AND (substr($attribs['x1'], -1) != '%')) { - $this->svggradients[$this->svggradientid]['mode'] = 'measure'; - } else { - $this->svggradients[$this->svggradientid]['mode'] = 'percentage'; - } - if (isset($attribs['gradientTransform'])) { - $this->svggradients[$this->svggradientid]['gradientTransform'] = $this->getSVGTransformMatrix($attribs['gradientTransform']); - } - $this->svggradients[$this->svggradientid]['coords'] = array($x1, $y1, $x2, $y2); - if (isset($attribs['xlink:href']) AND !empty($attribs['xlink:href'])) { - // gradient is defined on another place - $this->svggradients[$this->svggradientid]['xref'] = substr($attribs['xlink:href'], 1); - } - break; - } - case 'radialGradient': { - if (!isset($attribs['id'])) { - $attribs['id'] = 'GR_'.(count($this->svggradients) + 1); - } - $this->svggradientid = $attribs['id']; - $this->svggradients[$this->svggradientid] = array(); - $this->svggradients[$this->svggradientid]['type'] = 3; - $this->svggradients[$this->svggradientid]['stops'] = array(); - if (isset($attribs['gradientUnits'])) { - $this->svggradients[$this->svggradientid]['gradientUnits'] = $attribs['gradientUnits']; - } else { - $this->svggradients[$this->svggradientid]['gradientUnits'] = 'objectBoundingBox'; - } - //$attribs['spreadMethod'] - $cx = (isset($attribs['cx'])?$attribs['cx']:0.5); - $cy = (isset($attribs['cy'])?$attribs['cy']:0.5); - $fx = (isset($attribs['fx'])?$attribs['fx']:$cx); - $fy = (isset($attribs['fy'])?$attribs['fy']:$cy); - $r = (isset($attribs['r'])?$attribs['r']:0.5); - if (isset($attribs['cx']) AND (substr($attribs['cx'], -1) != '%')) { - $this->svggradients[$this->svggradientid]['mode'] = 'measure'; - } else { - $this->svggradients[$this->svggradientid]['mode'] = 'percentage'; - } - if (isset($attribs['gradientTransform'])) { - $this->svggradients[$this->svggradientid]['gradientTransform'] = $this->getSVGTransformMatrix($attribs['gradientTransform']); - } - $this->svggradients[$this->svggradientid]['coords'] = array($cx, $cy, $fx, $fy, $r); - if (isset($attribs['xlink:href']) AND !empty($attribs['xlink:href'])) { - // gradient is defined on another place - $this->svggradients[$this->svggradientid]['xref'] = substr($attribs['xlink:href'], 1); - } - break; - } - case 'stop': { - // gradient stops - if (substr($attribs['offset'], -1) == '%') { - $offset = floatval(substr($attribs['offset'], -1)) / 100; - } else { - $offset = floatval($attribs['offset']); - if ($offset > 1) { - $offset /= 100; - } - } - $stop_color = isset($svgstyle['stop-color'])?$this->convertHTMLColorToDec($svgstyle['stop-color']):'black'; - $opacity = isset($svgstyle['stop-opacity'])?$svgstyle['stop-opacity']:1; - $this->svggradients[$this->svggradientid]['stops'][] = array('offset' => $offset, 'color' => $stop_color, 'opacity' => $opacity); - break; - } - // paths - case 'path': { - if ($invisible) { - break; - } - $d = trim($attribs['d']); - if ($clipping) { - $this->SVGTransform($tm); - $this->SVGPath($d, 'CNZ'); - } else { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, 0, 0, 1, 1, 'SVGPath', array($d, 'CNZ')); - if (!empty($obstyle)) { - $this->SVGPath($d, $obstyle); - } - $this->StopTransform(); - } - break; - } - // shapes - case 'rect': { - if ($invisible) { - break; - } - $x = (isset($attribs['x'])?$this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false):0); - $y = (isset($attribs['y'])?$this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false):0); - $w = (isset($attribs['width'])?$this->getHTMLUnitToUnits($attribs['width'], 0, $this->svgunit, false):0); - $h = (isset($attribs['height'])?$this->getHTMLUnitToUnits($attribs['height'], 0, $this->svgunit, false):0); - $rx = (isset($attribs['rx'])?$this->getHTMLUnitToUnits($attribs['rx'], 0, $this->svgunit, false):0); - $ry = (isset($attribs['ry'])?$this->getHTMLUnitToUnits($attribs['ry'], 0, $this->svgunit, false):$rx); - if ($clipping) { - $this->SVGTransform($tm); - $this->RoundedRectXY($x, $y, $w, $h, $rx, $ry, '1111', 'CNZ', array(), array()); - } else { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'RoundedRectXY', array($x, $y, $w, $h, $rx, $ry, '1111', 'CNZ')); - if (!empty($obstyle)) { - $this->RoundedRectXY($x, $y, $w, $h, $rx, $ry, '1111', $obstyle, array(), array()); - } - $this->StopTransform(); - } - break; - } - case 'circle': { - if ($invisible) { - break; - } - $cx = (isset($attribs['cx'])?$this->getHTMLUnitToUnits($attribs['cx'], 0, $this->svgunit, false):0); - $cy = (isset($attribs['cy'])?$this->getHTMLUnitToUnits($attribs['cy'], 0, $this->svgunit, false):0); - $r = (isset($attribs['r'])?$this->getHTMLUnitToUnits($attribs['r'], 0, $this->svgunit, false):0); - $x = $cx - $r; - $y = $cy - $r; - $w = 2 * $r; - $h = $w; - if ($clipping) { - $this->SVGTransform($tm); - $this->Circle($cx, $cy, $r, 0, 360, 'CNZ', array(), array(), 8); - } else { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Circle', array($cx, $cy, $r, 0, 360, 'CNZ')); - if (!empty($obstyle)) { - $this->Circle($cx, $cy, $r, 0, 360, $obstyle, array(), array(), 8); - } - $this->StopTransform(); - } - break; - } - case 'ellipse': { - if ($invisible) { - break; - } - $cx = (isset($attribs['cx'])?$this->getHTMLUnitToUnits($attribs['cx'], 0, $this->svgunit, false):0); - $cy = (isset($attribs['cy'])?$this->getHTMLUnitToUnits($attribs['cy'], 0, $this->svgunit, false):0); - $rx = (isset($attribs['rx'])?$this->getHTMLUnitToUnits($attribs['rx'], 0, $this->svgunit, false):0); - $ry = (isset($attribs['ry'])?$this->getHTMLUnitToUnits($attribs['ry'], 0, $this->svgunit, false):0); - $x = $cx - $rx; - $y = $cy - $ry; - $w = 2 * $rx; - $h = 2 * $ry; - if ($clipping) { - $this->SVGTransform($tm); - $this->Ellipse($cx, $cy, $rx, $ry, 0, 0, 360, 'CNZ', array(), array(), 8); - } else { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Ellipse', array($cx, $cy, $rx, $ry, 0, 0, 360, 'CNZ')); - if (!empty($obstyle)) { - $this->Ellipse($cx, $cy, $rx, $ry, 0, 0, 360, $obstyle, array(), array(), 8); - } - $this->StopTransform(); - } - break; - } - case 'line': { - if ($invisible) { - break; - } - $x1 = (isset($attribs['x1'])?$this->getHTMLUnitToUnits($attribs['x1'], 0, $this->svgunit, false):0); - $y1 = (isset($attribs['y1'])?$this->getHTMLUnitToUnits($attribs['y1'], 0, $this->svgunit, false):0); - $x2 = (isset($attribs['x2'])?$this->getHTMLUnitToUnits($attribs['x2'], 0, $this->svgunit, false):0); - $y2 = (isset($attribs['y2'])?$this->getHTMLUnitToUnits($attribs['y2'], 0, $this->svgunit, false):0); - $x = $x1; - $y = $y1; - $w = abs($x2 - $x1); - $h = abs($y2 - $y1); - if (!$clipping) { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Line', array($x1, $y1, $x2, $y2)); - $this->Line($x1, $y1, $x2, $y2); - $this->StopTransform(); - } - break; - } - case 'polyline': - case 'polygon': { - if ($invisible) { - break; - } - $points = (isset($attribs['points'])?$attribs['points']:'0 0'); - $points = trim($points); - // note that point may use a complex syntax not covered here - $points = preg_split('/[\,\s]+/si', $points); - if (count($points) < 4) { - break; - } - $p = array(); - $xmin = 2147483647; - $xmax = 0; - $ymin = 2147483647; - $ymax = 0; - foreach ($points as $key => $val) { - $p[$key] = $this->getHTMLUnitToUnits($val, 0, $this->svgunit, false); - if (($key % 2) == 0) { - // X coordinate - $xmin = min($xmin, $p[$key]); - $xmax = max($xmax, $p[$key]); - } else { - // Y coordinate - $ymin = min($ymin, $p[$key]); - $ymax = max($ymax, $p[$key]); - } - } - $x = $xmin; - $y = $ymin; - $w = ($xmax - $xmin); - $h = ($ymax - $ymin); - if ($name == 'polyline') { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'PolyLine', array($p, 'CNZ')); - $this->PolyLine($p, 'D', array(), array()); - $this->StopTransform(); - } else { // polygon - if ($clipping) { - $this->SVGTransform($tm); - $this->Polygon($p, 'CNZ', array(), array(), true); - } else { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Polygon', array($p, 'CNZ')); - if (!empty($obstyle)) { - $this->Polygon($p, $obstyle, array(), array(), true); - } - $this->StopTransform(); - } - } - break; - } - // image - case 'image': { - if ($invisible) { - break; - } - if (!isset($attribs['xlink:href']) OR empty($attribs['xlink:href'])) { - break; - } - $x = (isset($attribs['x'])?$this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false):0); - $y = (isset($attribs['y'])?$this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false):0); - $w = (isset($attribs['width'])?$this->getHTMLUnitToUnits($attribs['width'], 0, $this->svgunit, false):0); - $h = (isset($attribs['height'])?$this->getHTMLUnitToUnits($attribs['height'], 0, $this->svgunit, false):0); - $img = $attribs['xlink:href']; - if (!$clipping) { - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h); - // fix image path - if (!$this->empty_string($this->svgdir) AND (($img{0} == '.') OR (basename($img) == $img))) { - // replace relative path with full server path - $img = $this->svgdir.'/'.$img; - } - if (($img{0} == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { - $findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']); - if (($findroot === false) OR ($findroot > 1)) { - // replace relative path with full server path - $img = $_SERVER['DOCUMENT_ROOT'].$img; - } - } - $img = urldecode($img); - $testscrtype = @parse_url($img); - if (!isset($testscrtype['query']) OR empty($testscrtype['query'])) { - // convert URL to server path - $img = str_replace(K_PATH_URL, K_PATH_MAIN, $img); - } - $this->Image($img, $x, $y, $w, $h); - $this->StopTransform(); - } - break; - } - // text - case 'text': - case 'tspan': { - $this->svgtextmode['invisible'] = $invisible; - if ($invisible) { - break; - } - array_push($this->svgstyles, $svgstyle); - // only basic support - advanced features must be implemented - $x = (isset($attribs['x'])?$this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false):$this->x); - $y = (isset($attribs['y'])?$this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false):$this->y); - $svgstyle['text-color'] = $svgstyle['fill']; - $this->svgtext = ''; - if (isset($svgstyle['text-anchor'])) { - $this->svgtextmode['text-anchor'] = $svgstyle['text-anchor']; - } else { - $this->svgtextmode['text-anchor'] = 'start'; - } - if (isset($svgstyle['direction'])) { - if ($svgstyle['direction'] == 'rtl') { - $this->svgtextmode['rtl'] = true; - } else { - $this->svgtextmode['rtl'] = false; - } - } else { - $this->svgtextmode['rtl'] = false; - } - if (isset($svgstyle['stroke']) AND ($svgstyle['stroke'] != 'none') AND isset($svgstyle['stroke-width']) AND ($svgstyle['stroke-width'] > 0)) { - $this->svgtextmode['stroke'] = $this->getHTMLUnitToUnits($svgstyle['stroke-width'], 0, $this->svgunit, false); - } else { - $this->svgtextmode['stroke'] = false; - } - $this->StartTransform(); - $this->SVGTransform($tm); - $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, 1, 1); - $this->x = $x; - $this->y = $y; - break; - } - // use - case 'use': { - if (isset($attribs['xlink:href'])) { - $use = $this->svgdefs[substr($attribs['xlink:href'], 1)]; - if (isset($attribs['xlink:href'])) { - unset($attribs['xlink:href']); - } - if (isset($attribs['id'])) { - unset($attribs['id']); - } - $attribs = array_merge($use['attribs'], $attribs); - $this->startSVGElementHandler($parser, $use['name'], $use['attribs']); - } - break; - } - default: { - break; - } - } // end of switch - } - - /** - * Sets the closing SVG element handler function for the XML parser. - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function endSVGElementHandler($parser, $name) { - switch($name) { - case 'defs': { - $this->svgdefsmode = false; - break; - } - // clipPath - case 'clipPath': { - $this->svgclipmode = false; - break; - } - case 'g': { - // ungroup: remove last style from array - array_pop($this->svgstyles); - $this->StopTransform(); - break; - } - case 'text': - case 'tspan': { - if ($this->svgtextmode['invisible']) { - // This implementation must be fixed to following the rule: - // If the 'visibility' property is set to hidden on a 'tspan', 'tref' or 'altGlyph' element, then the text is invisible but still takes up space in text layout calculations. - break; - } - // print text - $text = $this->stringTrim($this->svgtext); - if ($this->svgtextmode['text-anchor'] != 'start') { - $textlen = $this->GetStringWidth($text); - // check if string is RTL text - if ($this->svgtextmode['text-anchor'] == 'end') { - if ($this->svgtextmode['rtl']) { - $this->x += $textlen; - } else { - $this->x -= $textlen; - } - } elseif ($this->svgtextmode['text-anchor'] == 'middle') { - if ($this->svgtextmode['rtl']) { - $this->x += ($textlen / 2); - } else { - $this->x -= ($textlen / 2); - } - } - } - $textrendermode = $this->textrendermode; - $textstrokewidth = $this->textstrokewidth; - $this->setTextRenderingMode($this->svgtextmode['stroke'], true, false); - $this->Cell(0, 0, $text, 0, 0, '', false, '', 0, false, 'L', 'T'); - // restore previous rendering mode - $this->textrendermode = $textrendermode; - $this->textstrokewidth = $textstrokewidth; - $this->svgtext = ''; - $this->StopTransform(); - array_pop($this->svgstyles); - break; - } - default: { - break; - } - } - } - - /** - * Sets the character data handler function for the XML parser. - * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. - * @param string $data The second parameter, data, contains the character data as a string. - * @author Nicola Asuni - * @since 5.0.000 (2010-05-02) - * @access protected - */ - protected function segSVGContentHandler($parser, $data) { - $this->svgtext .= $data; - } - - // --- END SVG METHODS ----------------------------- - -} // END OF TCPDF CLASS - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/unicode_data.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/unicode_data.php deleted file mode 100644 index 190dbc5465..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/unicode_data.php +++ /dev/null @@ -1,18378 +0,0 @@ -<?php -//============================================================+ -// File name : unicode_data.php -// Version : 1.0.006 -// Begin : 2008-01-01 -// Last Update : 2010-10-18 -// Author : Nicola Asuni - Tecnick.com S.r.l - Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2008-2010 Nicola Asuni - Tecnick.com S.r.l. -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : Unicode data for TCPDF library. -// -//============================================================+ -// THANKS TO -// Efthimios Mavrogeorgiadis -// Saleh AlMatrafe - -/** - * Unicode data class for TCPDF library. - * @author Nicola Asuni - * @copyright 2008-2010 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com - * @package com.tecnick.tcpdf - * @link http://www.tcpdf.org - * @license http://www.gnu.org/copyleft/lesser.html LGPL - * @since 2.1.000 (2008-01-08) -*/ - -/** -* This is a PHP class containing Unicde data for TCPDF library -* @name TCPDF_UNICODE_DATA -* @package com.tecnick.tcpdf -* @version 1.0.006 -* @author Nicola Asuni - info@tecnick.com -* @link http://www.tcpdf.org -* @license http://www.gnu.org/copyleft/lesser.html LGPL -*/ -class TCPDF_UNICODE_DATA { - -/** - * @var Unicode code for Left-to-Right Mark - * @access public - */ -public $uni_LRM = 8206; - -/** - * @var Unicode code for Right-to-Left Mark - * @access public - */ -public $uni_RLM = 8207; - -/** - * @var Unicode code for Left-to-Right Embedding - * @access public - */ -public $uni_LRE = 8234; - -/** - * @var Unicode code for Right-to-Left Embedding - * @access public - */ -public $uni_RLE = 8235; - -/** - * @var Unicode code for Pop Directional Format - * @access public - */ -public $uni_PDF = 8236; - -/** - * @var Unicode code for Left-to-Right Override - * @access public - */ -public $uni_LRO = 8237; - -/** - * @var Unicode code for Right-to-Left Override - * @access public - */ -public $uni_RLO = 8238; - -/* - * @var Pattern to test RTL (Righ-To-Left) strings using regular expressions. - * @access public - */ -public $uni_RE_PATTERN_RTL = "/( - \xD6\xBE # R - | \xD7[\x80\x83\x86\x90-\xAA\xB0-\xB4] # R - | \xDF[\x80-\xAA\xB4\xB5\xBA] # R - | \xE2\x80\x8F # R - | \xEF\xAC[\x9D\x9F\xA0-\xA8\xAA-\xB6\xB8-\xBC\xBE] # R - | \xEF\xAD[\x80\x81\x83\x84\x86-\x8F] # R - | \xF0\x90\xA0[\x80-\x85\x88\x8A-\xB5\xB7\xB8\xBC\xBF] # R - | \xF0\x90\xA4[\x80-\x99] # R - | \xF0\x90\xA8[\x80\x90-\x93\x95-\x97\x99-\xB3] # R - | \xF0\x90\xA9[\x80-\x87\x90-\x98] # R - | \xE2\x80[\xAB\xAE] # RLE & RLO - )/x"; - -/* - * @var Pattern to test Arabic strings using regular expressions. - * Source: http://www.w3.org/International/questions/qa-forms-utf-8 - * @access public - */ -public $uni_RE_PATTERN_ARABIC = "/( - \xD8[\x80-\x83\x8B\x8D\x9B\x9E\x9F\xA1-\xBA] # AL - | \xD9[\x80-\x8A\xAD-\xAF\xB1-\xBF] # AL - | \xDA[\x80-\xBF] # AL - | \xDB[\x80-\x95\x9D\xA5\xA6\xAE\xAF\xBA-\xBF] # AL - | \xDC[\x80-\x8D\x90\x92-\xAF] # AL - | \xDD[\x8D-\xAD] # AL - | \xDE[\x80-\xA5\xB1] # AL - | \xEF\xAD[\x90-\xBF] # AL - | \xEF\xAE[\x80-\xB1] # AL - | \xEF\xAF[\x93-\xBF] # AL - | \xEF[\xB0-\xB3][\x80-\xBF] # AL - | \xEF\xB4[\x80-\xBD] # AL - | \xEF\xB5[\x90-\xBF] # AL - | \xEF\xB6[\x80-\x8F\x92-\xBF] # AL - | \xEF\xB7[\x80-\x87\xB0-\xBC] # AL - | \xEF\xB9[\xB0-\xB4\xB6-\xBF] # AL - | \xEF\xBA[\x80-\xBF] # AL - | \xEF\xBB[\x80-\xBC] # AL - | \xD9[\xA0-\xA9\xAB\xAC] # AN - )/x"; - -/** - * @var Array of Unicode types - * @access public - */ -public $uni_type = array( -0=>'BN', -1=>'BN', -2=>'BN', -3=>'BN', -4=>'BN', -5=>'BN', -6=>'BN', -7=>'BN', -8=>'BN', -9=>'S', -10=>'B', -11=>'S', -12=>'WS', -13=>'B', -14=>'BN', -15=>'BN', -16=>'BN', -17=>'BN', -18=>'BN', -19=>'BN', -20=>'BN', -21=>'BN', -22=>'BN', -23=>'BN', -24=>'BN', -25=>'BN', -26=>'BN', -27=>'BN', -28=>'B', -29=>'B', -30=>'B', -31=>'S', -32=>'WS', -33=>'ON', -34=>'ON', -35=>'ET', -36=>'ET', -37=>'ET', -38=>'ON', -39=>'ON', -40=>'ON', -41=>'ON', -42=>'ON', -43=>'ES', -44=>'CS', -45=>'ES', -46=>'CS', -47=>'CS', -48=>'EN', -49=>'EN', -50=>'EN', -51=>'EN', -52=>'EN', -53=>'EN', -54=>'EN', -55=>'EN', -56=>'EN', -57=>'EN', -58=>'CS', -59=>'ON', -60=>'ON', -61=>'ON', -62=>'ON', -63=>'ON', -64=>'ON', -65=>'L', -66=>'L', -67=>'L', -68=>'L', -69=>'L', -70=>'L', -71=>'L', -72=>'L', -73=>'L', -74=>'L', -75=>'L', -76=>'L', -77=>'L', -78=>'L', -79=>'L', -80=>'L', -81=>'L', -82=>'L', -83=>'L', -84=>'L', -85=>'L', -86=>'L', -87=>'L', -88=>'L', -89=>'L', -90=>'L', -91=>'ON', -92=>'ON', -93=>'ON', -94=>'ON', -95=>'ON', -96=>'ON', -97=>'L', -98=>'L', -99=>'L', -100=>'L', -101=>'L', -102=>'L', -103=>'L', -104=>'L', -105=>'L', -106=>'L', -107=>'L', -108=>'L', -109=>'L', -110=>'L', -111=>'L', -112=>'L', -113=>'L', -114=>'L', -115=>'L', -116=>'L', -117=>'L', -118=>'L', -119=>'L', -120=>'L', -121=>'L', -122=>'L', -123=>'ON', -124=>'ON', -125=>'ON', -126=>'ON', -127=>'BN', -128=>'BN', -129=>'BN', -130=>'BN', -131=>'BN', -132=>'BN', -133=>'B', -134=>'BN', -135=>'BN', -136=>'BN', -137=>'BN', -138=>'BN', -139=>'BN', -140=>'BN', -141=>'BN', -142=>'BN', -143=>'BN', -144=>'BN', -145=>'BN', -146=>'BN', -147=>'BN', -148=>'BN', -149=>'BN', -150=>'BN', -151=>'BN', -152=>'BN', -153=>'BN', -154=>'BN', -155=>'BN', -156=>'BN', -157=>'BN', -158=>'BN', -159=>'BN', -160=>'CS', -161=>'ON', -162=>'ET', -163=>'ET', -164=>'ET', -165=>'ET', -166=>'ON', -167=>'ON', -168=>'ON', -169=>'ON', -170=>'L', -171=>'ON', -172=>'ON', -173=>'BN', -174=>'ON', -175=>'ON', -176=>'ET', -177=>'ET', -178=>'EN', -179=>'EN', -180=>'ON', -181=>'L', -182=>'ON', -183=>'ON', -184=>'ON', -185=>'EN', -186=>'L', -187=>'ON', -188=>'ON', -189=>'ON', -190=>'ON', -191=>'ON', -192=>'L', -193=>'L', -194=>'L', -195=>'L', -196=>'L', -197=>'L', -198=>'L', -199=>'L', -200=>'L', -201=>'L', -202=>'L', -203=>'L', -204=>'L', -205=>'L', -206=>'L', -207=>'L', -208=>'L', -209=>'L', -210=>'L', -211=>'L', -212=>'L', -213=>'L', -214=>'L', -215=>'ON', -216=>'L', -217=>'L', -218=>'L', -219=>'L', -220=>'L', -221=>'L', -222=>'L', -223=>'L', -224=>'L', -225=>'L', -226=>'L', -227=>'L', -228=>'L', -229=>'L', -230=>'L', -231=>'L', -232=>'L', -233=>'L', -234=>'L', -235=>'L', -236=>'L', -237=>'L', -238=>'L', -239=>'L', -240=>'L', -241=>'L', -242=>'L', -243=>'L', -244=>'L', -245=>'L', -246=>'L', -247=>'ON', -248=>'L', -249=>'L', -250=>'L', -251=>'L', -252=>'L', -253=>'L', -254=>'L', -255=>'L', -256=>'L', -257=>'L', -258=>'L', -259=>'L', -260=>'L', -261=>'L', -262=>'L', -263=>'L', -264=>'L', -265=>'L', -266=>'L', -267=>'L', -268=>'L', -269=>'L', -270=>'L', -271=>'L', -272=>'L', -273=>'L', -274=>'L', -275=>'L', -276=>'L', -277=>'L', -278=>'L', -279=>'L', -280=>'L', -281=>'L', -282=>'L', -283=>'L', -284=>'L', -285=>'L', -286=>'L', -287=>'L', -288=>'L', -289=>'L', -290=>'L', -291=>'L', -292=>'L', -293=>'L', -294=>'L', -295=>'L', -296=>'L', -297=>'L', -298=>'L', -299=>'L', -300=>'L', -301=>'L', -302=>'L', -303=>'L', -304=>'L', -305=>'L', -306=>'L', -307=>'L', -308=>'L', -309=>'L', -310=>'L', -311=>'L', -312=>'L', -313=>'L', -314=>'L', -315=>'L', -316=>'L', -317=>'L', -318=>'L', -319=>'L', -320=>'L', -321=>'L', -322=>'L', -323=>'L', -324=>'L', -325=>'L', -326=>'L', -327=>'L', -328=>'L', -329=>'L', -330=>'L', -331=>'L', -332=>'L', -333=>'L', -334=>'L', -335=>'L', -336=>'L', -337=>'L', -338=>'L', -339=>'L', -340=>'L', -341=>'L', -342=>'L', -343=>'L', -344=>'L', -345=>'L', -346=>'L', -347=>'L', -348=>'L', -349=>'L', -350=>'L', -351=>'L', -352=>'L', -353=>'L', -354=>'L', -355=>'L', -356=>'L', -357=>'L', -358=>'L', -359=>'L', -360=>'L', -361=>'L', -362=>'L', -363=>'L', -364=>'L', -365=>'L', -366=>'L', -367=>'L', -368=>'L', -369=>'L', -370=>'L', -371=>'L', -372=>'L', -373=>'L', -374=>'L', -375=>'L', -376=>'L', -377=>'L', -378=>'L', -379=>'L', -380=>'L', -381=>'L', -382=>'L', -383=>'L', -384=>'L', -385=>'L', -386=>'L', -387=>'L', -388=>'L', -389=>'L', -390=>'L', -391=>'L', -392=>'L', -393=>'L', -394=>'L', -395=>'L', -396=>'L', -397=>'L', -398=>'L', -399=>'L', -400=>'L', -401=>'L', -402=>'L', -403=>'L', -404=>'L', -405=>'L', -406=>'L', -407=>'L', -408=>'L', -409=>'L', -410=>'L', -411=>'L', -412=>'L', -413=>'L', -414=>'L', -415=>'L', -416=>'L', -417=>'L', -418=>'L', -419=>'L', -420=>'L', -421=>'L', -422=>'L', -423=>'L', -424=>'L', -425=>'L', -426=>'L', -427=>'L', -428=>'L', -429=>'L', -430=>'L', -431=>'L', -432=>'L', -433=>'L', -434=>'L', -435=>'L', -436=>'L', -437=>'L', -438=>'L', -439=>'L', -440=>'L', -441=>'L', -442=>'L', -443=>'L', -444=>'L', -445=>'L', -446=>'L', -447=>'L', -448=>'L', -449=>'L', -450=>'L', -451=>'L', -452=>'L', -453=>'L', -454=>'L', -455=>'L', -456=>'L', -457=>'L', -458=>'L', -459=>'L', -460=>'L', -461=>'L', -462=>'L', -463=>'L', -464=>'L', -465=>'L', -466=>'L', -467=>'L', -468=>'L', -469=>'L', -470=>'L', -471=>'L', -472=>'L', -473=>'L', -474=>'L', -475=>'L', -476=>'L', -477=>'L', -478=>'L', -479=>'L', -480=>'L', -481=>'L', -482=>'L', -483=>'L', -484=>'L', -485=>'L', -486=>'L', -487=>'L', -488=>'L', -489=>'L', -490=>'L', -491=>'L', -492=>'L', -493=>'L', -494=>'L', -495=>'L', -496=>'L', -497=>'L', -498=>'L', -499=>'L', -500=>'L', -501=>'L', -502=>'L', -503=>'L', -504=>'L', -505=>'L', -506=>'L', -507=>'L', -508=>'L', -509=>'L', -510=>'L', -511=>'L', -512=>'L', -513=>'L', -514=>'L', -515=>'L', -516=>'L', -517=>'L', -518=>'L', -519=>'L', -520=>'L', -521=>'L', -522=>'L', -523=>'L', -524=>'L', -525=>'L', -526=>'L', -527=>'L', -528=>'L', -529=>'L', -530=>'L', -531=>'L', -532=>'L', -533=>'L', -534=>'L', -535=>'L', -536=>'L', -537=>'L', -538=>'L', -539=>'L', -540=>'L', -541=>'L', -542=>'L', -543=>'L', -544=>'L', -545=>'L', -546=>'L', -547=>'L', -548=>'L', -549=>'L', -550=>'L', -551=>'L', -552=>'L', -553=>'L', -554=>'L', -555=>'L', -556=>'L', -557=>'L', -558=>'L', -559=>'L', -560=>'L', -561=>'L', -562=>'L', -563=>'L', -564=>'L', -565=>'L', -566=>'L', -567=>'L', -568=>'L', -569=>'L', -570=>'L', -571=>'L', -572=>'L', -573=>'L', -574=>'L', -575=>'L', -576=>'L', -577=>'L', -578=>'L', -579=>'L', -580=>'L', -581=>'L', -582=>'L', -583=>'L', -584=>'L', -585=>'L', -586=>'L', -587=>'L', -588=>'L', -589=>'L', -590=>'L', -591=>'L', -592=>'L', -593=>'L', -594=>'L', -595=>'L', -596=>'L', -597=>'L', -598=>'L', -599=>'L', -600=>'L', -601=>'L', -602=>'L', -603=>'L', -604=>'L', -605=>'L', -606=>'L', -607=>'L', -608=>'L', -609=>'L', -610=>'L', -611=>'L', -612=>'L', -613=>'L', -614=>'L', -615=>'L', -616=>'L', -617=>'L', -618=>'L', -619=>'L', -620=>'L', -621=>'L', -622=>'L', -623=>'L', -624=>'L', -625=>'L', -626=>'L', -627=>'L', -628=>'L', -629=>'L', -630=>'L', -631=>'L', -632=>'L', -633=>'L', -634=>'L', -635=>'L', -636=>'L', -637=>'L', -638=>'L', -639=>'L', -640=>'L', -641=>'L', -642=>'L', -643=>'L', -644=>'L', -645=>'L', -646=>'L', -647=>'L', -648=>'L', -649=>'L', -650=>'L', -651=>'L', -652=>'L', -653=>'L', -654=>'L', -655=>'L', -656=>'L', -657=>'L', -658=>'L', -659=>'L', -660=>'L', -661=>'L', -662=>'L', -663=>'L', -664=>'L', -665=>'L', -666=>'L', -667=>'L', -668=>'L', -669=>'L', -670=>'L', -671=>'L', -672=>'L', -673=>'L', -674=>'L', -675=>'L', -676=>'L', -677=>'L', -678=>'L', -679=>'L', -680=>'L', -681=>'L', -682=>'L', -683=>'L', -684=>'L', -685=>'L', -686=>'L', -687=>'L', -688=>'L', -689=>'L', -690=>'L', -691=>'L', -692=>'L', -693=>'L', -694=>'L', -695=>'L', -696=>'L', -697=>'ON', -698=>'ON', -699=>'L', -700=>'L', -701=>'L', -702=>'L', -703=>'L', -704=>'L', -705=>'L', -706=>'ON', -707=>'ON', -708=>'ON', -709=>'ON', -710=>'ON', -711=>'ON', -712=>'ON', -713=>'ON', -714=>'ON', -715=>'ON', -716=>'ON', -717=>'ON', -718=>'ON', -719=>'ON', -720=>'L', -721=>'L', -722=>'ON', -723=>'ON', -724=>'ON', -725=>'ON', -726=>'ON', -727=>'ON', -728=>'ON', -729=>'ON', -730=>'ON', -731=>'ON', -732=>'ON', -733=>'ON', -734=>'ON', -735=>'ON', -736=>'L', -737=>'L', -738=>'L', -739=>'L', -740=>'L', -741=>'ON', -742=>'ON', -743=>'ON', -744=>'ON', -745=>'ON', -746=>'ON', -747=>'ON', -748=>'ON', -749=>'ON', -750=>'L', -751=>'ON', -752=>'ON', -753=>'ON', -754=>'ON', -755=>'ON', -756=>'ON', -757=>'ON', -758=>'ON', -759=>'ON', -760=>'ON', -761=>'ON', -762=>'ON', -763=>'ON', -764=>'ON', -765=>'ON', -766=>'ON', -767=>'ON', -768=>'NSM', -769=>'NSM', -770=>'NSM', -771=>'NSM', -772=>'NSM', -773=>'NSM', -774=>'NSM', -775=>'NSM', -776=>'NSM', -777=>'NSM', -778=>'NSM', -779=>'NSM', -780=>'NSM', -781=>'NSM', -782=>'NSM', -783=>'NSM', -784=>'NSM', -785=>'NSM', -786=>'NSM', -787=>'NSM', -788=>'NSM', -789=>'NSM', -790=>'NSM', -791=>'NSM', -792=>'NSM', -793=>'NSM', -794=>'NSM', -795=>'NSM', -796=>'NSM', -797=>'NSM', -798=>'NSM', -799=>'NSM', -800=>'NSM', -801=>'NSM', -802=>'NSM', -803=>'NSM', -804=>'NSM', -805=>'NSM', -806=>'NSM', -807=>'NSM', -808=>'NSM', -809=>'NSM', -810=>'NSM', -811=>'NSM', -812=>'NSM', -813=>'NSM', -814=>'NSM', -815=>'NSM', -816=>'NSM', -817=>'NSM', -818=>'NSM', -819=>'NSM', -820=>'NSM', -821=>'NSM', -822=>'NSM', -823=>'NSM', -824=>'NSM', -825=>'NSM', -826=>'NSM', -827=>'NSM', -828=>'NSM', -829=>'NSM', -830=>'NSM', -831=>'NSM', -832=>'NSM', -833=>'NSM', -834=>'NSM', -835=>'NSM', -836=>'NSM', -837=>'NSM', -838=>'NSM', -839=>'NSM', -840=>'NSM', -841=>'NSM', -842=>'NSM', -843=>'NSM', -844=>'NSM', -845=>'NSM', -846=>'NSM', -847=>'NSM', -848=>'NSM', -849=>'NSM', -850=>'NSM', -851=>'NSM', -852=>'NSM', -853=>'NSM', -854=>'NSM', -855=>'NSM', -856=>'NSM', -857=>'NSM', -858=>'NSM', -859=>'NSM', -860=>'NSM', -861=>'NSM', -862=>'NSM', -863=>'NSM', -864=>'NSM', -865=>'NSM', -866=>'NSM', -867=>'NSM', -868=>'NSM', -869=>'NSM', -870=>'NSM', -871=>'NSM', -872=>'NSM', -873=>'NSM', -874=>'NSM', -875=>'NSM', -876=>'NSM', -877=>'NSM', -878=>'NSM', -879=>'NSM', -884=>'ON', -885=>'ON', -890=>'L', -891=>'L', -892=>'L', -893=>'L', -894=>'ON', -900=>'ON', -901=>'ON', -902=>'L', -903=>'ON', -904=>'L', -905=>'L', -906=>'L', -908=>'L', -910=>'L', -911=>'L', -912=>'L', -913=>'L', -914=>'L', -915=>'L', -916=>'L', -917=>'L', -918=>'L', -919=>'L', -920=>'L', -921=>'L', -922=>'L', -923=>'L', -924=>'L', -925=>'L', -926=>'L', -927=>'L', -928=>'L', -929=>'L', -931=>'L', -932=>'L', -933=>'L', -934=>'L', -935=>'L', -936=>'L', -937=>'L', -938=>'L', -939=>'L', -940=>'L', -941=>'L', -942=>'L', -943=>'L', -944=>'L', -945=>'L', -946=>'L', -947=>'L', -948=>'L', -949=>'L', -950=>'L', -951=>'L', -952=>'L', -953=>'L', -954=>'L', -955=>'L', -956=>'L', -957=>'L', -958=>'L', -959=>'L', -960=>'L', -961=>'L', -962=>'L', -963=>'L', -964=>'L', -965=>'L', -966=>'L', -967=>'L', -968=>'L', -969=>'L', -970=>'L', -971=>'L', -972=>'L', -973=>'L', -974=>'L', -976=>'L', -977=>'L', -978=>'L', -979=>'L', -980=>'L', -981=>'L', -982=>'L', -983=>'L', -984=>'L', -985=>'L', -986=>'L', -987=>'L', -988=>'L', -989=>'L', -990=>'L', -991=>'L', -992=>'L', -993=>'L', -994=>'L', -995=>'L', -996=>'L', -997=>'L', -998=>'L', -999=>'L', -1000=>'L', -1001=>'L', -1002=>'L', -1003=>'L', -1004=>'L', -1005=>'L', -1006=>'L', -1007=>'L', -1008=>'L', -1009=>'L', -1010=>'L', -1011=>'L', -1012=>'L', -1013=>'L', -1014=>'ON', -1015=>'L', -1016=>'L', -1017=>'L', -1018=>'L', -1019=>'L', -1020=>'L', -1021=>'L', -1022=>'L', -1023=>'L', -1024=>'L', -1025=>'L', -1026=>'L', -1027=>'L', -1028=>'L', -1029=>'L', -1030=>'L', -1031=>'L', -1032=>'L', -1033=>'L', -1034=>'L', -1035=>'L', -1036=>'L', -1037=>'L', -1038=>'L', -1039=>'L', -1040=>'L', -1041=>'L', -1042=>'L', -1043=>'L', -1044=>'L', -1045=>'L', -1046=>'L', -1047=>'L', -1048=>'L', -1049=>'L', -1050=>'L', -1051=>'L', -1052=>'L', -1053=>'L', -1054=>'L', -1055=>'L', -1056=>'L', -1057=>'L', -1058=>'L', -1059=>'L', -1060=>'L', -1061=>'L', -1062=>'L', -1063=>'L', -1064=>'L', -1065=>'L', -1066=>'L', -1067=>'L', -1068=>'L', -1069=>'L', -1070=>'L', -1071=>'L', -1072=>'L', -1073=>'L', -1074=>'L', -1075=>'L', -1076=>'L', -1077=>'L', -1078=>'L', -1079=>'L', -1080=>'L', -1081=>'L', -1082=>'L', -1083=>'L', -1084=>'L', -1085=>'L', -1086=>'L', -1087=>'L', -1088=>'L', -1089=>'L', -1090=>'L', -1091=>'L', -1092=>'L', -1093=>'L', -1094=>'L', -1095=>'L', -1096=>'L', -1097=>'L', -1098=>'L', -1099=>'L', -1100=>'L', -1101=>'L', -1102=>'L', -1103=>'L', -1104=>'L', -1105=>'L', -1106=>'L', -1107=>'L', -1108=>'L', -1109=>'L', -1110=>'L', -1111=>'L', -1112=>'L', -1113=>'L', -1114=>'L', -1115=>'L', -1116=>'L', -1117=>'L', -1118=>'L', -1119=>'L', -1120=>'L', -1121=>'L', -1122=>'L', -1123=>'L', -1124=>'L', -1125=>'L', -1126=>'L', -1127=>'L', -1128=>'L', -1129=>'L', -1130=>'L', -1131=>'L', -1132=>'L', -1133=>'L', -1134=>'L', -1135=>'L', -1136=>'L', -1137=>'L', -1138=>'L', -1139=>'L', -1140=>'L', -1141=>'L', -1142=>'L', -1143=>'L', -1144=>'L', -1145=>'L', -1146=>'L', -1147=>'L', -1148=>'L', -1149=>'L', -1150=>'L', -1151=>'L', -1152=>'L', -1153=>'L', -1154=>'L', -1155=>'NSM', -1156=>'NSM', -1157=>'NSM', -1158=>'NSM', -1160=>'NSM', -1161=>'NSM', -1162=>'L', -1163=>'L', -1164=>'L', -1165=>'L', -1166=>'L', -1167=>'L', -1168=>'L', -1169=>'L', -1170=>'L', -1171=>'L', -1172=>'L', -1173=>'L', -1174=>'L', -1175=>'L', -1176=>'L', -1177=>'L', -1178=>'L', -1179=>'L', -1180=>'L', -1181=>'L', -1182=>'L', -1183=>'L', -1184=>'L', -1185=>'L', -1186=>'L', -1187=>'L', -1188=>'L', -1189=>'L', -1190=>'L', -1191=>'L', -1192=>'L', -1193=>'L', -1194=>'L', -1195=>'L', -1196=>'L', -1197=>'L', -1198=>'L', -1199=>'L', -1200=>'L', -1201=>'L', -1202=>'L', -1203=>'L', -1204=>'L', -1205=>'L', -1206=>'L', -1207=>'L', -1208=>'L', -1209=>'L', -1210=>'L', -1211=>'L', -1212=>'L', -1213=>'L', -1214=>'L', -1215=>'L', -1216=>'L', -1217=>'L', -1218=>'L', -1219=>'L', -1220=>'L', -1221=>'L', -1222=>'L', -1223=>'L', -1224=>'L', -1225=>'L', -1226=>'L', -1227=>'L', -1228=>'L', -1229=>'L', -1230=>'L', -1231=>'L', -1232=>'L', -1233=>'L', -1234=>'L', -1235=>'L', -1236=>'L', -1237=>'L', -1238=>'L', -1239=>'L', -1240=>'L', -1241=>'L', -1242=>'L', -1243=>'L', -1244=>'L', -1245=>'L', -1246=>'L', -1247=>'L', -1248=>'L', -1249=>'L', -1250=>'L', -1251=>'L', -1252=>'L', -1253=>'L', -1254=>'L', -1255=>'L', -1256=>'L', -1257=>'L', -1258=>'L', -1259=>'L', -1260=>'L', -1261=>'L', -1262=>'L', -1263=>'L', -1264=>'L', -1265=>'L', -1266=>'L', -1267=>'L', -1268=>'L', -1269=>'L', -1270=>'L', -1271=>'L', -1272=>'L', -1273=>'L', -1274=>'L', -1275=>'L', -1276=>'L', -1277=>'L', -1278=>'L', -1279=>'L', -1280=>'L', -1281=>'L', -1282=>'L', -1283=>'L', -1284=>'L', -1285=>'L', -1286=>'L', -1287=>'L', -1288=>'L', -1289=>'L', -1290=>'L', -1291=>'L', -1292=>'L', -1293=>'L', -1294=>'L', -1295=>'L', -1296=>'L', -1297=>'L', -1298=>'L', -1299=>'L', -1329=>'L', -1330=>'L', -1331=>'L', -1332=>'L', -1333=>'L', -1334=>'L', -1335=>'L', -1336=>'L', -1337=>'L', -1338=>'L', -1339=>'L', -1340=>'L', -1341=>'L', -1342=>'L', -1343=>'L', -1344=>'L', -1345=>'L', -1346=>'L', -1347=>'L', -1348=>'L', -1349=>'L', -1350=>'L', -1351=>'L', -1352=>'L', -1353=>'L', -1354=>'L', -1355=>'L', -1356=>'L', -1357=>'L', -1358=>'L', -1359=>'L', -1360=>'L', -1361=>'L', -1362=>'L', -1363=>'L', -1364=>'L', -1365=>'L', -1366=>'L', -1369=>'L', -1370=>'L', -1371=>'L', -1372=>'L', -1373=>'L', -1374=>'L', -1375=>'L', -1377=>'L', -1378=>'L', -1379=>'L', -1380=>'L', -1381=>'L', -1382=>'L', -1383=>'L', -1384=>'L', -1385=>'L', -1386=>'L', -1387=>'L', -1388=>'L', -1389=>'L', -1390=>'L', -1391=>'L', -1392=>'L', -1393=>'L', -1394=>'L', -1395=>'L', -1396=>'L', -1397=>'L', -1398=>'L', -1399=>'L', -1400=>'L', -1401=>'L', -1402=>'L', -1403=>'L', -1404=>'L', -1405=>'L', -1406=>'L', -1407=>'L', -1408=>'L', -1409=>'L', -1410=>'L', -1411=>'L', -1412=>'L', -1413=>'L', -1414=>'L', -1415=>'L', -1417=>'L', -1418=>'ON', -1425=>'NSM', -1426=>'NSM', -1427=>'NSM', -1428=>'NSM', -1429=>'NSM', -1430=>'NSM', -1431=>'NSM', -1432=>'NSM', -1433=>'NSM', -1434=>'NSM', -1435=>'NSM', -1436=>'NSM', -1437=>'NSM', -1438=>'NSM', -1439=>'NSM', -1440=>'NSM', -1441=>'NSM', -1442=>'NSM', -1443=>'NSM', -1444=>'NSM', -1445=>'NSM', -1446=>'NSM', -1447=>'NSM', -1448=>'NSM', -1449=>'NSM', -1450=>'NSM', -1451=>'NSM', -1452=>'NSM', -1453=>'NSM', -1454=>'NSM', -1455=>'NSM', -1456=>'NSM', -1457=>'NSM', -1458=>'NSM', -1459=>'NSM', -1460=>'NSM', -1461=>'NSM', -1462=>'NSM', -1463=>'NSM', -1464=>'NSM', -1465=>'NSM', -1466=>'NSM', -1467=>'NSM', -1468=>'NSM', -1469=>'NSM', -1470=>'R', -1471=>'NSM', -1472=>'R', -1473=>'NSM', -1474=>'NSM', -1475=>'R', -1476=>'NSM', -1477=>'NSM', -1478=>'R', -1479=>'NSM', -1488=>'R', -1489=>'R', -1490=>'R', -1491=>'R', -1492=>'R', -1493=>'R', -1494=>'R', -1495=>'R', -1496=>'R', -1497=>'R', -1498=>'R', -1499=>'R', -1500=>'R', -1501=>'R', -1502=>'R', -1503=>'R', -1504=>'R', -1505=>'R', -1506=>'R', -1507=>'R', -1508=>'R', -1509=>'R', -1510=>'R', -1511=>'R', -1512=>'R', -1513=>'R', -1514=>'R', -1520=>'R', -1521=>'R', -1522=>'R', -1523=>'R', -1524=>'R', -1536=>'AL', -1537=>'AL', -1538=>'AL', -1539=>'AL', -1547=>'AL', -1548=>'CS', -1549=>'AL', -1550=>'ON', -1551=>'ON', -1552=>'NSM', -1553=>'NSM', -1554=>'NSM', -1555=>'NSM', -1556=>'NSM', -1557=>'NSM', -1563=>'AL', -1566=>'AL', -1567=>'AL', -1569=>'AL', -1570=>'AL', -1571=>'AL', -1572=>'AL', -1573=>'AL', -1574=>'AL', -1575=>'AL', -1576=>'AL', -1577=>'AL', -1578=>'AL', -1579=>'AL', -1580=>'AL', -1581=>'AL', -1582=>'AL', -1583=>'AL', -1584=>'AL', -1585=>'AL', -1586=>'AL', -1587=>'AL', -1588=>'AL', -1589=>'AL', -1590=>'AL', -1591=>'AL', -1592=>'AL', -1593=>'AL', -1594=>'AL', -1600=>'AL', -1601=>'AL', -1602=>'AL', -1603=>'AL', -1604=>'AL', -1605=>'AL', -1606=>'AL', -1607=>'AL', -1608=>'AL', -1609=>'AL', -1610=>'AL', -1611=>'NSM', -1612=>'NSM', -1613=>'NSM', -1614=>'NSM', -1615=>'NSM', -1616=>'NSM', -1617=>'NSM', -1618=>'NSM', -1619=>'NSM', -1620=>'NSM', -1621=>'NSM', -1622=>'NSM', -1623=>'NSM', -1624=>'NSM', -1625=>'NSM', -1626=>'NSM', -1627=>'NSM', -1628=>'NSM', -1629=>'NSM', -1630=>'NSM', -1632=>'AN', -1633=>'AN', -1634=>'AN', -1635=>'AN', -1636=>'AN', -1637=>'AN', -1638=>'AN', -1639=>'AN', -1640=>'AN', -1641=>'AN', -1642=>'ET', -1643=>'AN', -1644=>'AN', -1645=>'AL', -1646=>'AL', -1647=>'AL', -1648=>'NSM', -1649=>'AL', -1650=>'AL', -1651=>'AL', -1652=>'AL', -1653=>'AL', -1654=>'AL', -1655=>'AL', -1656=>'AL', -1657=>'AL', -1658=>'AL', -1659=>'AL', -1660=>'AL', -1661=>'AL', -1662=>'AL', -1663=>'AL', -1664=>'AL', -1665=>'AL', -1666=>'AL', -1667=>'AL', -1668=>'AL', -1669=>'AL', -1670=>'AL', -1671=>'AL', -1672=>'AL', -1673=>'AL', -1674=>'AL', -1675=>'AL', -1676=>'AL', -1677=>'AL', -1678=>'AL', -1679=>'AL', -1680=>'AL', -1681=>'AL', -1682=>'AL', -1683=>'AL', -1684=>'AL', -1685=>'AL', -1686=>'AL', -1687=>'AL', -1688=>'AL', -1689=>'AL', -1690=>'AL', -1691=>'AL', -1692=>'AL', -1693=>'AL', -1694=>'AL', -1695=>'AL', -1696=>'AL', -1697=>'AL', -1698=>'AL', -1699=>'AL', -1700=>'AL', -1701=>'AL', -1702=>'AL', -1703=>'AL', -1704=>'AL', -1705=>'AL', -1706=>'AL', -1707=>'AL', -1708=>'AL', -1709=>'AL', -1710=>'AL', -1711=>'AL', -1712=>'AL', -1713=>'AL', -1714=>'AL', -1715=>'AL', -1716=>'AL', -1717=>'AL', -1718=>'AL', -1719=>'AL', -1720=>'AL', -1721=>'AL', -1722=>'AL', -1723=>'AL', -1724=>'AL', -1725=>'AL', -1726=>'AL', -1727=>'AL', -1728=>'AL', -1729=>'AL', -1730=>'AL', -1731=>'AL', -1732=>'AL', -1733=>'AL', -1734=>'AL', -1735=>'AL', -1736=>'AL', -1737=>'AL', -1738=>'AL', -1739=>'AL', -1740=>'AL', -1741=>'AL', -1742=>'AL', -1743=>'AL', -1744=>'AL', -1745=>'AL', -1746=>'AL', -1747=>'AL', -1748=>'AL', -1749=>'AL', -1750=>'NSM', -1751=>'NSM', -1752=>'NSM', -1753=>'NSM', -1754=>'NSM', -1755=>'NSM', -1756=>'NSM', -1757=>'AL', -1758=>'NSM', -1759=>'NSM', -1760=>'NSM', -1761=>'NSM', -1762=>'NSM', -1763=>'NSM', -1764=>'NSM', -1765=>'AL', -1766=>'AL', -1767=>'NSM', -1768=>'NSM', -1769=>'ON', -1770=>'NSM', -1771=>'NSM', -1772=>'NSM', -1773=>'NSM', -1774=>'AL', -1775=>'AL', -1776=>'EN', -1777=>'EN', -1778=>'EN', -1779=>'EN', -1780=>'EN', -1781=>'EN', -1782=>'EN', -1783=>'EN', -1784=>'EN', -1785=>'EN', -1786=>'AL', -1787=>'AL', -1788=>'AL', -1789=>'AL', -1790=>'AL', -1791=>'AL', -1792=>'AL', -1793=>'AL', -1794=>'AL', -1795=>'AL', -1796=>'AL', -1797=>'AL', -1798=>'AL', -1799=>'AL', -1800=>'AL', -1801=>'AL', -1802=>'AL', -1803=>'AL', -1804=>'AL', -1805=>'AL', -1807=>'BN', -1808=>'AL', -1809=>'NSM', -1810=>'AL', -1811=>'AL', -1812=>'AL', -1813=>'AL', -1814=>'AL', -1815=>'AL', -1816=>'AL', -1817=>'AL', -1818=>'AL', -1819=>'AL', -1820=>'AL', -1821=>'AL', -1822=>'AL', -1823=>'AL', -1824=>'AL', -1825=>'AL', -1826=>'AL', -1827=>'AL', -1828=>'AL', -1829=>'AL', -1830=>'AL', -1831=>'AL', -1832=>'AL', -1833=>'AL', -1834=>'AL', -1835=>'AL', -1836=>'AL', -1837=>'AL', -1838=>'AL', -1839=>'AL', -1840=>'NSM', -1841=>'NSM', -1842=>'NSM', -1843=>'NSM', -1844=>'NSM', -1845=>'NSM', -1846=>'NSM', -1847=>'NSM', -1848=>'NSM', -1849=>'NSM', -1850=>'NSM', -1851=>'NSM', -1852=>'NSM', -1853=>'NSM', -1854=>'NSM', -1855=>'NSM', -1856=>'NSM', -1857=>'NSM', -1858=>'NSM', -1859=>'NSM', -1860=>'NSM', -1861=>'NSM', -1862=>'NSM', -1863=>'NSM', -1864=>'NSM', -1865=>'NSM', -1866=>'NSM', -1869=>'AL', -1870=>'AL', -1871=>'AL', -1872=>'AL', -1873=>'AL', -1874=>'AL', -1875=>'AL', -1876=>'AL', -1877=>'AL', -1878=>'AL', -1879=>'AL', -1880=>'AL', -1881=>'AL', -1882=>'AL', -1883=>'AL', -1884=>'AL', -1885=>'AL', -1886=>'AL', -1887=>'AL', -1888=>'AL', -1889=>'AL', -1890=>'AL', -1891=>'AL', -1892=>'AL', -1893=>'AL', -1894=>'AL', -1895=>'AL', -1896=>'AL', -1897=>'AL', -1898=>'AL', -1899=>'AL', -1900=>'AL', -1901=>'AL', -1920=>'AL', -1921=>'AL', -1922=>'AL', -1923=>'AL', -1924=>'AL', -1925=>'AL', -1926=>'AL', -1927=>'AL', -1928=>'AL', -1929=>'AL', -1930=>'AL', -1931=>'AL', -1932=>'AL', -1933=>'AL', -1934=>'AL', -1935=>'AL', -1936=>'AL', -1937=>'AL', -1938=>'AL', -1939=>'AL', -1940=>'AL', -1941=>'AL', -1942=>'AL', -1943=>'AL', -1944=>'AL', -1945=>'AL', -1946=>'AL', -1947=>'AL', -1948=>'AL', -1949=>'AL', -1950=>'AL', -1951=>'AL', -1952=>'AL', -1953=>'AL', -1954=>'AL', -1955=>'AL', -1956=>'AL', -1957=>'AL', -1958=>'NSM', -1959=>'NSM', -1960=>'NSM', -1961=>'NSM', -1962=>'NSM', -1963=>'NSM', -1964=>'NSM', -1965=>'NSM', -1966=>'NSM', -1967=>'NSM', -1968=>'NSM', -1969=>'AL', -1984=>'R', -1985=>'R', -1986=>'R', -1987=>'R', -1988=>'R', -1989=>'R', -1990=>'R', -1991=>'R', -1992=>'R', -1993=>'R', -1994=>'R', -1995=>'R', -1996=>'R', -1997=>'R', -1998=>'R', -1999=>'R', -2000=>'R', -2001=>'R', -2002=>'R', -2003=>'R', -2004=>'R', -2005=>'R', -2006=>'R', -2007=>'R', -2008=>'R', -2009=>'R', -2010=>'R', -2011=>'R', -2012=>'R', -2013=>'R', -2014=>'R', -2015=>'R', -2016=>'R', -2017=>'R', -2018=>'R', -2019=>'R', -2020=>'R', -2021=>'R', -2022=>'R', -2023=>'R', -2024=>'R', -2025=>'R', -2026=>'R', -2027=>'NSM', -2028=>'NSM', -2029=>'NSM', -2030=>'NSM', -2031=>'NSM', -2032=>'NSM', -2033=>'NSM', -2034=>'NSM', -2035=>'NSM', -2036=>'R', -2037=>'R', -2038=>'ON', -2039=>'ON', -2040=>'ON', -2041=>'ON', -2042=>'R', -2305=>'NSM', -2306=>'NSM', -2307=>'L', -2308=>'L', -2309=>'L', -2310=>'L', -2311=>'L', -2312=>'L', -2313=>'L', -2314=>'L', -2315=>'L', -2316=>'L', -2317=>'L', -2318=>'L', -2319=>'L', -2320=>'L', -2321=>'L', -2322=>'L', -2323=>'L', -2324=>'L', -2325=>'L', -2326=>'L', -2327=>'L', -2328=>'L', -2329=>'L', -2330=>'L', -2331=>'L', -2332=>'L', -2333=>'L', -2334=>'L', -2335=>'L', -2336=>'L', -2337=>'L', -2338=>'L', -2339=>'L', -2340=>'L', -2341=>'L', -2342=>'L', -2343=>'L', -2344=>'L', -2345=>'L', -2346=>'L', -2347=>'L', -2348=>'L', -2349=>'L', -2350=>'L', -2351=>'L', -2352=>'L', -2353=>'L', -2354=>'L', -2355=>'L', -2356=>'L', -2357=>'L', -2358=>'L', -2359=>'L', -2360=>'L', -2361=>'L', -2364=>'NSM', -2365=>'L', -2366=>'L', -2367=>'L', -2368=>'L', -2369=>'NSM', -2370=>'NSM', -2371=>'NSM', -2372=>'NSM', -2373=>'NSM', -2374=>'NSM', -2375=>'NSM', -2376=>'NSM', -2377=>'L', -2378=>'L', -2379=>'L', -2380=>'L', -2381=>'NSM', -2384=>'L', -2385=>'NSM', -2386=>'NSM', -2387=>'NSM', -2388=>'NSM', -2392=>'L', -2393=>'L', -2394=>'L', -2395=>'L', -2396=>'L', -2397=>'L', -2398=>'L', -2399=>'L', -2400=>'L', -2401=>'L', -2402=>'NSM', -2403=>'NSM', -2404=>'L', -2405=>'L', -2406=>'L', -2407=>'L', -2408=>'L', -2409=>'L', -2410=>'L', -2411=>'L', -2412=>'L', -2413=>'L', -2414=>'L', -2415=>'L', -2416=>'L', -2427=>'L', -2428=>'L', -2429=>'L', -2430=>'L', -2431=>'L', -2433=>'NSM', -2434=>'L', -2435=>'L', -2437=>'L', -2438=>'L', -2439=>'L', -2440=>'L', -2441=>'L', -2442=>'L', -2443=>'L', -2444=>'L', -2447=>'L', -2448=>'L', -2451=>'L', -2452=>'L', -2453=>'L', -2454=>'L', -2455=>'L', -2456=>'L', -2457=>'L', -2458=>'L', -2459=>'L', -2460=>'L', -2461=>'L', -2462=>'L', -2463=>'L', -2464=>'L', -2465=>'L', -2466=>'L', -2467=>'L', -2468=>'L', -2469=>'L', -2470=>'L', -2471=>'L', -2472=>'L', -2474=>'L', -2475=>'L', -2476=>'L', -2477=>'L', -2478=>'L', -2479=>'L', -2480=>'L', -2482=>'L', -2486=>'L', -2487=>'L', -2488=>'L', -2489=>'L', -2492=>'NSM', -2493=>'L', -2494=>'L', -2495=>'L', -2496=>'L', -2497=>'NSM', -2498=>'NSM', -2499=>'NSM', -2500=>'NSM', -2503=>'L', -2504=>'L', -2507=>'L', -2508=>'L', -2509=>'NSM', -2510=>'L', -2519=>'L', -2524=>'L', -2525=>'L', -2527=>'L', -2528=>'L', -2529=>'L', -2530=>'NSM', -2531=>'NSM', -2534=>'L', -2535=>'L', -2536=>'L', -2537=>'L', -2538=>'L', -2539=>'L', -2540=>'L', -2541=>'L', -2542=>'L', -2543=>'L', -2544=>'L', -2545=>'L', -2546=>'ET', -2547=>'ET', -2548=>'L', -2549=>'L', -2550=>'L', -2551=>'L', -2552=>'L', -2553=>'L', -2554=>'L', -2561=>'NSM', -2562=>'NSM', -2563=>'L', -2565=>'L', -2566=>'L', -2567=>'L', -2568=>'L', -2569=>'L', -2570=>'L', -2575=>'L', -2576=>'L', -2579=>'L', -2580=>'L', -2581=>'L', -2582=>'L', -2583=>'L', -2584=>'L', -2585=>'L', -2586=>'L', -2587=>'L', -2588=>'L', -2589=>'L', -2590=>'L', -2591=>'L', -2592=>'L', -2593=>'L', -2594=>'L', -2595=>'L', -2596=>'L', -2597=>'L', -2598=>'L', -2599=>'L', -2600=>'L', -2602=>'L', -2603=>'L', -2604=>'L', -2605=>'L', -2606=>'L', -2607=>'L', -2608=>'L', -2610=>'L', -2611=>'L', -2613=>'L', -2614=>'L', -2616=>'L', -2617=>'L', -2620=>'NSM', -2622=>'L', -2623=>'L', -2624=>'L', -2625=>'NSM', -2626=>'NSM', -2631=>'NSM', -2632=>'NSM', -2635=>'NSM', -2636=>'NSM', -2637=>'NSM', -2649=>'L', -2650=>'L', -2651=>'L', -2652=>'L', -2654=>'L', -2662=>'L', -2663=>'L', -2664=>'L', -2665=>'L', -2666=>'L', -2667=>'L', -2668=>'L', -2669=>'L', -2670=>'L', -2671=>'L', -2672=>'NSM', -2673=>'NSM', -2674=>'L', -2675=>'L', -2676=>'L', -2689=>'NSM', -2690=>'NSM', -2691=>'L', -2693=>'L', -2694=>'L', -2695=>'L', -2696=>'L', -2697=>'L', -2698=>'L', -2699=>'L', -2700=>'L', -2701=>'L', -2703=>'L', -2704=>'L', -2705=>'L', -2707=>'L', -2708=>'L', -2709=>'L', -2710=>'L', -2711=>'L', -2712=>'L', -2713=>'L', -2714=>'L', -2715=>'L', -2716=>'L', -2717=>'L', -2718=>'L', -2719=>'L', -2720=>'L', -2721=>'L', -2722=>'L', -2723=>'L', -2724=>'L', -2725=>'L', -2726=>'L', -2727=>'L', -2728=>'L', -2730=>'L', -2731=>'L', -2732=>'L', -2733=>'L', -2734=>'L', -2735=>'L', -2736=>'L', -2738=>'L', -2739=>'L', -2741=>'L', -2742=>'L', -2743=>'L', -2744=>'L', -2745=>'L', -2748=>'NSM', -2749=>'L', -2750=>'L', -2751=>'L', -2752=>'L', -2753=>'NSM', -2754=>'NSM', -2755=>'NSM', -2756=>'NSM', -2757=>'NSM', -2759=>'NSM', -2760=>'NSM', -2761=>'L', -2763=>'L', -2764=>'L', -2765=>'NSM', -2768=>'L', -2784=>'L', -2785=>'L', -2786=>'NSM', -2787=>'NSM', -2790=>'L', -2791=>'L', -2792=>'L', -2793=>'L', -2794=>'L', -2795=>'L', -2796=>'L', -2797=>'L', -2798=>'L', -2799=>'L', -2801=>'ET', -2817=>'NSM', -2818=>'L', -2819=>'L', -2821=>'L', -2822=>'L', -2823=>'L', -2824=>'L', -2825=>'L', -2826=>'L', -2827=>'L', -2828=>'L', -2831=>'L', -2832=>'L', -2835=>'L', -2836=>'L', -2837=>'L', -2838=>'L', -2839=>'L', -2840=>'L', -2841=>'L', -2842=>'L', -2843=>'L', -2844=>'L', -2845=>'L', -2846=>'L', -2847=>'L', -2848=>'L', -2849=>'L', -2850=>'L', -2851=>'L', -2852=>'L', -2853=>'L', -2854=>'L', -2855=>'L', -2856=>'L', -2858=>'L', -2859=>'L', -2860=>'L', -2861=>'L', -2862=>'L', -2863=>'L', -2864=>'L', -2866=>'L', -2867=>'L', -2869=>'L', -2870=>'L', -2871=>'L', -2872=>'L', -2873=>'L', -2876=>'NSM', -2877=>'L', -2878=>'L', -2879=>'NSM', -2880=>'L', -2881=>'NSM', -2882=>'NSM', -2883=>'NSM', -2887=>'L', -2888=>'L', -2891=>'L', -2892=>'L', -2893=>'NSM', -2902=>'NSM', -2903=>'L', -2908=>'L', -2909=>'L', -2911=>'L', -2912=>'L', -2913=>'L', -2918=>'L', -2919=>'L', -2920=>'L', -2921=>'L', -2922=>'L', -2923=>'L', -2924=>'L', -2925=>'L', -2926=>'L', -2927=>'L', -2928=>'L', -2929=>'L', -2946=>'NSM', -2947=>'L', -2949=>'L', -2950=>'L', -2951=>'L', -2952=>'L', -2953=>'L', -2954=>'L', -2958=>'L', -2959=>'L', -2960=>'L', -2962=>'L', -2963=>'L', -2964=>'L', -2965=>'L', -2969=>'L', -2970=>'L', -2972=>'L', -2974=>'L', -2975=>'L', -2979=>'L', -2980=>'L', -2984=>'L', -2985=>'L', -2986=>'L', -2990=>'L', -2991=>'L', -2992=>'L', -2993=>'L', -2994=>'L', -2995=>'L', -2996=>'L', -2997=>'L', -2998=>'L', -2999=>'L', -3000=>'L', -3001=>'L', -3006=>'L', -3007=>'L', -3008=>'NSM', -3009=>'L', -3010=>'L', -3014=>'L', -3015=>'L', -3016=>'L', -3018=>'L', -3019=>'L', -3020=>'L', -3021=>'NSM', -3031=>'L', -3046=>'L', -3047=>'L', -3048=>'L', -3049=>'L', -3050=>'L', -3051=>'L', -3052=>'L', -3053=>'L', -3054=>'L', -3055=>'L', -3056=>'L', -3057=>'L', -3058=>'L', -3059=>'ON', -3060=>'ON', -3061=>'ON', -3062=>'ON', -3063=>'ON', -3064=>'ON', -3065=>'ET', -3066=>'ON', -3073=>'L', -3074=>'L', -3075=>'L', -3077=>'L', -3078=>'L', -3079=>'L', -3080=>'L', -3081=>'L', -3082=>'L', -3083=>'L', -3084=>'L', -3086=>'L', -3087=>'L', -3088=>'L', -3090=>'L', -3091=>'L', -3092=>'L', -3093=>'L', -3094=>'L', -3095=>'L', -3096=>'L', -3097=>'L', -3098=>'L', -3099=>'L', -3100=>'L', -3101=>'L', -3102=>'L', -3103=>'L', -3104=>'L', -3105=>'L', -3106=>'L', -3107=>'L', -3108=>'L', -3109=>'L', -3110=>'L', -3111=>'L', -3112=>'L', -3114=>'L', -3115=>'L', -3116=>'L', -3117=>'L', -3118=>'L', -3119=>'L', -3120=>'L', -3121=>'L', -3122=>'L', -3123=>'L', -3125=>'L', -3126=>'L', -3127=>'L', -3128=>'L', -3129=>'L', -3134=>'NSM', -3135=>'NSM', -3136=>'NSM', -3137=>'L', -3138=>'L', -3139=>'L', -3140=>'L', -3142=>'NSM', -3143=>'NSM', -3144=>'NSM', -3146=>'NSM', -3147=>'NSM', -3148=>'NSM', -3149=>'NSM', -3157=>'NSM', -3158=>'NSM', -3168=>'L', -3169=>'L', -3174=>'L', -3175=>'L', -3176=>'L', -3177=>'L', -3178=>'L', -3179=>'L', -3180=>'L', -3181=>'L', -3182=>'L', -3183=>'L', -3202=>'L', -3203=>'L', -3205=>'L', -3206=>'L', -3207=>'L', -3208=>'L', -3209=>'L', -3210=>'L', -3211=>'L', -3212=>'L', -3214=>'L', -3215=>'L', -3216=>'L', -3218=>'L', -3219=>'L', -3220=>'L', -3221=>'L', -3222=>'L', -3223=>'L', -3224=>'L', -3225=>'L', -3226=>'L', -3227=>'L', -3228=>'L', -3229=>'L', -3230=>'L', -3231=>'L', -3232=>'L', -3233=>'L', -3234=>'L', -3235=>'L', -3236=>'L', -3237=>'L', -3238=>'L', -3239=>'L', -3240=>'L', -3242=>'L', -3243=>'L', -3244=>'L', -3245=>'L', -3246=>'L', -3247=>'L', -3248=>'L', -3249=>'L', -3250=>'L', -3251=>'L', -3253=>'L', -3254=>'L', -3255=>'L', -3256=>'L', -3257=>'L', -3260=>'NSM', -3261=>'L', -3262=>'L', -3263=>'L', -3264=>'L', -3265=>'L', -3266=>'L', -3267=>'L', -3268=>'L', -3270=>'L', -3271=>'L', -3272=>'L', -3274=>'L', -3275=>'L', -3276=>'NSM', -3277=>'NSM', -3285=>'L', -3286=>'L', -3294=>'L', -3296=>'L', -3297=>'L', -3298=>'NSM', -3299=>'NSM', -3302=>'L', -3303=>'L', -3304=>'L', -3305=>'L', -3306=>'L', -3307=>'L', -3308=>'L', -3309=>'L', -3310=>'L', -3311=>'L', -3313=>'ON', -3314=>'ON', -3330=>'L', -3331=>'L', -3333=>'L', -3334=>'L', -3335=>'L', -3336=>'L', -3337=>'L', -3338=>'L', -3339=>'L', -3340=>'L', -3342=>'L', -3343=>'L', -3344=>'L', -3346=>'L', -3347=>'L', -3348=>'L', -3349=>'L', -3350=>'L', -3351=>'L', -3352=>'L', -3353=>'L', -3354=>'L', -3355=>'L', -3356=>'L', -3357=>'L', -3358=>'L', -3359=>'L', -3360=>'L', -3361=>'L', -3362=>'L', -3363=>'L', -3364=>'L', -3365=>'L', -3366=>'L', -3367=>'L', -3368=>'L', -3370=>'L', -3371=>'L', -3372=>'L', -3373=>'L', -3374=>'L', -3375=>'L', -3376=>'L', -3377=>'L', -3378=>'L', -3379=>'L', -3380=>'L', -3381=>'L', -3382=>'L', -3383=>'L', -3384=>'L', -3385=>'L', -3390=>'L', -3391=>'L', -3392=>'L', -3393=>'NSM', -3394=>'NSM', -3395=>'NSM', -3398=>'L', -3399=>'L', -3400=>'L', -3402=>'L', -3403=>'L', -3404=>'L', -3405=>'NSM', -3415=>'L', -3424=>'L', -3425=>'L', -3430=>'L', -3431=>'L', -3432=>'L', -3433=>'L', -3434=>'L', -3435=>'L', -3436=>'L', -3437=>'L', -3438=>'L', -3439=>'L', -3458=>'L', -3459=>'L', -3461=>'L', -3462=>'L', -3463=>'L', -3464=>'L', -3465=>'L', -3466=>'L', -3467=>'L', -3468=>'L', -3469=>'L', -3470=>'L', -3471=>'L', -3472=>'L', -3473=>'L', -3474=>'L', -3475=>'L', -3476=>'L', -3477=>'L', -3478=>'L', -3482=>'L', -3483=>'L', -3484=>'L', -3485=>'L', -3486=>'L', -3487=>'L', -3488=>'L', -3489=>'L', -3490=>'L', -3491=>'L', -3492=>'L', -3493=>'L', -3494=>'L', -3495=>'L', -3496=>'L', -3497=>'L', -3498=>'L', -3499=>'L', -3500=>'L', -3501=>'L', -3502=>'L', -3503=>'L', -3504=>'L', -3505=>'L', -3507=>'L', -3508=>'L', -3509=>'L', -3510=>'L', -3511=>'L', -3512=>'L', -3513=>'L', -3514=>'L', -3515=>'L', -3517=>'L', -3520=>'L', -3521=>'L', -3522=>'L', -3523=>'L', -3524=>'L', -3525=>'L', -3526=>'L', -3530=>'NSM', -3535=>'L', -3536=>'L', -3537=>'L', -3538=>'NSM', -3539=>'NSM', -3540=>'NSM', -3542=>'NSM', -3544=>'L', -3545=>'L', -3546=>'L', -3547=>'L', -3548=>'L', -3549=>'L', -3550=>'L', -3551=>'L', -3570=>'L', -3571=>'L', -3572=>'L', -3585=>'L', -3586=>'L', -3587=>'L', -3588=>'L', -3589=>'L', -3590=>'L', -3591=>'L', -3592=>'L', -3593=>'L', -3594=>'L', -3595=>'L', -3596=>'L', -3597=>'L', -3598=>'L', -3599=>'L', -3600=>'L', -3601=>'L', -3602=>'L', -3603=>'L', -3604=>'L', -3605=>'L', -3606=>'L', -3607=>'L', -3608=>'L', -3609=>'L', -3610=>'L', -3611=>'L', -3612=>'L', -3613=>'L', -3614=>'L', -3615=>'L', -3616=>'L', -3617=>'L', -3618=>'L', -3619=>'L', -3620=>'L', -3621=>'L', -3622=>'L', -3623=>'L', -3624=>'L', -3625=>'L', -3626=>'L', -3627=>'L', -3628=>'L', -3629=>'L', -3630=>'L', -3631=>'L', -3632=>'L', -3633=>'NSM', -3634=>'L', -3635=>'L', -3636=>'NSM', -3637=>'NSM', -3638=>'NSM', -3639=>'NSM', -3640=>'NSM', -3641=>'NSM', -3642=>'NSM', -3647=>'ET', -3648=>'L', -3649=>'L', -3650=>'L', -3651=>'L', -3652=>'L', -3653=>'L', -3654=>'L', -3655=>'NSM', -3656=>'NSM', -3657=>'NSM', -3658=>'NSM', -3659=>'NSM', -3660=>'NSM', -3661=>'NSM', -3662=>'NSM', -3663=>'L', -3664=>'L', -3665=>'L', -3666=>'L', -3667=>'L', -3668=>'L', -3669=>'L', -3670=>'L', -3671=>'L', -3672=>'L', -3673=>'L', -3674=>'L', -3675=>'L', -3713=>'L', -3714=>'L', -3716=>'L', -3719=>'L', -3720=>'L', -3722=>'L', -3725=>'L', -3732=>'L', -3733=>'L', -3734=>'L', -3735=>'L', -3737=>'L', -3738=>'L', -3739=>'L', -3740=>'L', -3741=>'L', -3742=>'L', -3743=>'L', -3745=>'L', -3746=>'L', -3747=>'L', -3749=>'L', -3751=>'L', -3754=>'L', -3755=>'L', -3757=>'L', -3758=>'L', -3759=>'L', -3760=>'L', -3761=>'NSM', -3762=>'L', -3763=>'L', -3764=>'NSM', -3765=>'NSM', -3766=>'NSM', -3767=>'NSM', -3768=>'NSM', -3769=>'NSM', -3771=>'NSM', -3772=>'NSM', -3773=>'L', -3776=>'L', -3777=>'L', -3778=>'L', -3779=>'L', -3780=>'L', -3782=>'L', -3784=>'NSM', -3785=>'NSM', -3786=>'NSM', -3787=>'NSM', -3788=>'NSM', -3789=>'NSM', -3792=>'L', -3793=>'L', -3794=>'L', -3795=>'L', -3796=>'L', -3797=>'L', -3798=>'L', -3799=>'L', -3800=>'L', -3801=>'L', -3804=>'L', -3805=>'L', -3840=>'L', -3841=>'L', -3842=>'L', -3843=>'L', -3844=>'L', -3845=>'L', -3846=>'L', -3847=>'L', -3848=>'L', -3849=>'L', -3850=>'L', -3851=>'L', -3852=>'L', -3853=>'L', -3854=>'L', -3855=>'L', -3856=>'L', -3857=>'L', -3858=>'L', -3859=>'L', -3860=>'L', -3861=>'L', -3862=>'L', -3863=>'L', -3864=>'NSM', -3865=>'NSM', -3866=>'L', -3867=>'L', -3868=>'L', -3869=>'L', -3870=>'L', -3871=>'L', -3872=>'L', -3873=>'L', -3874=>'L', -3875=>'L', -3876=>'L', -3877=>'L', -3878=>'L', -3879=>'L', -3880=>'L', -3881=>'L', -3882=>'L', -3883=>'L', -3884=>'L', -3885=>'L', -3886=>'L', -3887=>'L', -3888=>'L', -3889=>'L', -3890=>'L', -3891=>'L', -3892=>'L', -3893=>'NSM', -3894=>'L', -3895=>'NSM', -3896=>'L', -3897=>'NSM', -3898=>'ON', -3899=>'ON', -3900=>'ON', -3901=>'ON', -3902=>'L', -3903=>'L', -3904=>'L', -3905=>'L', -3906=>'L', -3907=>'L', -3908=>'L', -3909=>'L', -3910=>'L', -3911=>'L', -3913=>'L', -3914=>'L', -3915=>'L', -3916=>'L', -3917=>'L', -3918=>'L', -3919=>'L', -3920=>'L', -3921=>'L', -3922=>'L', -3923=>'L', -3924=>'L', -3925=>'L', -3926=>'L', -3927=>'L', -3928=>'L', -3929=>'L', -3930=>'L', -3931=>'L', -3932=>'L', -3933=>'L', -3934=>'L', -3935=>'L', -3936=>'L', -3937=>'L', -3938=>'L', -3939=>'L', -3940=>'L', -3941=>'L', -3942=>'L', -3943=>'L', -3944=>'L', -3945=>'L', -3946=>'L', -3953=>'NSM', -3954=>'NSM', -3955=>'NSM', -3956=>'NSM', -3957=>'NSM', -3958=>'NSM', -3959=>'NSM', -3960=>'NSM', -3961=>'NSM', -3962=>'NSM', -3963=>'NSM', -3964=>'NSM', -3965=>'NSM', -3966=>'NSM', -3967=>'L', -3968=>'NSM', -3969=>'NSM', -3970=>'NSM', -3971=>'NSM', -3972=>'NSM', -3973=>'L', -3974=>'NSM', -3975=>'NSM', -3976=>'L', -3977=>'L', -3978=>'L', -3979=>'L', -3984=>'NSM', -3985=>'NSM', -3986=>'NSM', -3987=>'NSM', -3988=>'NSM', -3989=>'NSM', -3990=>'NSM', -3991=>'NSM', -3993=>'NSM', -3994=>'NSM', -3995=>'NSM', -3996=>'NSM', -3997=>'NSM', -3998=>'NSM', -3999=>'NSM', -4000=>'NSM', -4001=>'NSM', -4002=>'NSM', -4003=>'NSM', -4004=>'NSM', -4005=>'NSM', -4006=>'NSM', -4007=>'NSM', -4008=>'NSM', -4009=>'NSM', -4010=>'NSM', -4011=>'NSM', -4012=>'NSM', -4013=>'NSM', -4014=>'NSM', -4015=>'NSM', -4016=>'NSM', -4017=>'NSM', -4018=>'NSM', -4019=>'NSM', -4020=>'NSM', -4021=>'NSM', -4022=>'NSM', -4023=>'NSM', -4024=>'NSM', -4025=>'NSM', -4026=>'NSM', -4027=>'NSM', -4028=>'NSM', -4030=>'L', -4031=>'L', -4032=>'L', -4033=>'L', -4034=>'L', -4035=>'L', -4036=>'L', -4037=>'L', -4038=>'NSM', -4039=>'L', -4040=>'L', -4041=>'L', -4042=>'L', -4043=>'L', -4044=>'L', -4047=>'L', -4048=>'L', -4049=>'L', -4096=>'L', -4097=>'L', -4098=>'L', -4099=>'L', -4100=>'L', -4101=>'L', -4102=>'L', -4103=>'L', -4104=>'L', -4105=>'L', -4106=>'L', -4107=>'L', -4108=>'L', -4109=>'L', -4110=>'L', -4111=>'L', -4112=>'L', -4113=>'L', -4114=>'L', -4115=>'L', -4116=>'L', -4117=>'L', -4118=>'L', -4119=>'L', -4120=>'L', -4121=>'L', -4122=>'L', -4123=>'L', -4124=>'L', -4125=>'L', -4126=>'L', -4127=>'L', -4128=>'L', -4129=>'L', -4131=>'L', -4132=>'L', -4133=>'L', -4134=>'L', -4135=>'L', -4137=>'L', -4138=>'L', -4140=>'L', -4141=>'NSM', -4142=>'NSM', -4143=>'NSM', -4144=>'NSM', -4145=>'L', -4146=>'NSM', -4150=>'NSM', -4151=>'NSM', -4152=>'L', -4153=>'NSM', -4160=>'L', -4161=>'L', -4162=>'L', -4163=>'L', -4164=>'L', -4165=>'L', -4166=>'L', -4167=>'L', -4168=>'L', -4169=>'L', -4170=>'L', -4171=>'L', -4172=>'L', -4173=>'L', -4174=>'L', -4175=>'L', -4176=>'L', -4177=>'L', -4178=>'L', -4179=>'L', -4180=>'L', -4181=>'L', -4182=>'L', -4183=>'L', -4184=>'NSM', -4185=>'NSM', -4256=>'L', -4257=>'L', -4258=>'L', -4259=>'L', -4260=>'L', -4261=>'L', -4262=>'L', -4263=>'L', -4264=>'L', -4265=>'L', -4266=>'L', -4267=>'L', -4268=>'L', -4269=>'L', -4270=>'L', -4271=>'L', -4272=>'L', -4273=>'L', -4274=>'L', -4275=>'L', -4276=>'L', -4277=>'L', -4278=>'L', -4279=>'L', -4280=>'L', -4281=>'L', -4282=>'L', -4283=>'L', -4284=>'L', -4285=>'L', -4286=>'L', -4287=>'L', -4288=>'L', -4289=>'L', -4290=>'L', -4291=>'L', -4292=>'L', -4293=>'L', -4304=>'L', -4305=>'L', -4306=>'L', -4307=>'L', -4308=>'L', -4309=>'L', -4310=>'L', -4311=>'L', -4312=>'L', -4313=>'L', -4314=>'L', -4315=>'L', -4316=>'L', -4317=>'L', -4318=>'L', -4319=>'L', -4320=>'L', -4321=>'L', -4322=>'L', -4323=>'L', -4324=>'L', -4325=>'L', -4326=>'L', -4327=>'L', -4328=>'L', -4329=>'L', -4330=>'L', -4331=>'L', -4332=>'L', -4333=>'L', -4334=>'L', -4335=>'L', -4336=>'L', -4337=>'L', -4338=>'L', -4339=>'L', -4340=>'L', -4341=>'L', -4342=>'L', -4343=>'L', -4344=>'L', -4345=>'L', -4346=>'L', -4347=>'L', -4348=>'L', -4352=>'L', -4353=>'L', -4354=>'L', -4355=>'L', -4356=>'L', -4357=>'L', -4358=>'L', -4359=>'L', -4360=>'L', -4361=>'L', -4362=>'L', -4363=>'L', -4364=>'L', -4365=>'L', -4366=>'L', -4367=>'L', -4368=>'L', -4369=>'L', -4370=>'L', -4371=>'L', -4372=>'L', -4373=>'L', -4374=>'L', -4375=>'L', -4376=>'L', -4377=>'L', -4378=>'L', -4379=>'L', -4380=>'L', -4381=>'L', -4382=>'L', -4383=>'L', -4384=>'L', -4385=>'L', -4386=>'L', -4387=>'L', -4388=>'L', -4389=>'L', -4390=>'L', -4391=>'L', -4392=>'L', -4393=>'L', -4394=>'L', -4395=>'L', -4396=>'L', -4397=>'L', -4398=>'L', -4399=>'L', -4400=>'L', -4401=>'L', -4402=>'L', -4403=>'L', -4404=>'L', -4405=>'L', -4406=>'L', -4407=>'L', -4408=>'L', -4409=>'L', -4410=>'L', -4411=>'L', -4412=>'L', -4413=>'L', -4414=>'L', -4415=>'L', -4416=>'L', -4417=>'L', -4418=>'L', -4419=>'L', -4420=>'L', -4421=>'L', -4422=>'L', -4423=>'L', -4424=>'L', -4425=>'L', -4426=>'L', -4427=>'L', -4428=>'L', -4429=>'L', -4430=>'L', -4431=>'L', -4432=>'L', -4433=>'L', -4434=>'L', -4435=>'L', -4436=>'L', -4437=>'L', -4438=>'L', -4439=>'L', -4440=>'L', -4441=>'L', -4447=>'L', -4448=>'L', -4449=>'L', -4450=>'L', -4451=>'L', -4452=>'L', -4453=>'L', -4454=>'L', -4455=>'L', -4456=>'L', -4457=>'L', -4458=>'L', -4459=>'L', -4460=>'L', -4461=>'L', -4462=>'L', -4463=>'L', -4464=>'L', -4465=>'L', -4466=>'L', -4467=>'L', -4468=>'L', -4469=>'L', -4470=>'L', -4471=>'L', -4472=>'L', -4473=>'L', -4474=>'L', -4475=>'L', -4476=>'L', -4477=>'L', -4478=>'L', -4479=>'L', -4480=>'L', -4481=>'L', -4482=>'L', -4483=>'L', -4484=>'L', -4485=>'L', -4486=>'L', -4487=>'L', -4488=>'L', -4489=>'L', -4490=>'L', -4491=>'L', -4492=>'L', -4493=>'L', -4494=>'L', -4495=>'L', -4496=>'L', -4497=>'L', -4498=>'L', -4499=>'L', -4500=>'L', -4501=>'L', -4502=>'L', -4503=>'L', -4504=>'L', -4505=>'L', -4506=>'L', -4507=>'L', -4508=>'L', -4509=>'L', -4510=>'L', -4511=>'L', -4512=>'L', -4513=>'L', -4514=>'L', -4520=>'L', -4521=>'L', -4522=>'L', -4523=>'L', -4524=>'L', -4525=>'L', -4526=>'L', -4527=>'L', -4528=>'L', -4529=>'L', -4530=>'L', -4531=>'L', -4532=>'L', -4533=>'L', -4534=>'L', -4535=>'L', -4536=>'L', -4537=>'L', -4538=>'L', -4539=>'L', -4540=>'L', -4541=>'L', -4542=>'L', -4543=>'L', -4544=>'L', -4545=>'L', -4546=>'L', -4547=>'L', -4548=>'L', -4549=>'L', -4550=>'L', -4551=>'L', -4552=>'L', -4553=>'L', -4554=>'L', -4555=>'L', -4556=>'L', -4557=>'L', -4558=>'L', -4559=>'L', -4560=>'L', -4561=>'L', -4562=>'L', -4563=>'L', -4564=>'L', -4565=>'L', -4566=>'L', -4567=>'L', -4568=>'L', -4569=>'L', -4570=>'L', -4571=>'L', -4572=>'L', -4573=>'L', -4574=>'L', -4575=>'L', -4576=>'L', -4577=>'L', -4578=>'L', -4579=>'L', -4580=>'L', -4581=>'L', -4582=>'L', -4583=>'L', -4584=>'L', -4585=>'L', -4586=>'L', -4587=>'L', -4588=>'L', -4589=>'L', -4590=>'L', -4591=>'L', -4592=>'L', -4593=>'L', -4594=>'L', -4595=>'L', -4596=>'L', -4597=>'L', -4598=>'L', -4599=>'L', -4600=>'L', -4601=>'L', -4608=>'L', -4609=>'L', -4610=>'L', -4611=>'L', -4612=>'L', -4613=>'L', -4614=>'L', -4615=>'L', -4616=>'L', -4617=>'L', -4618=>'L', -4619=>'L', -4620=>'L', -4621=>'L', -4622=>'L', -4623=>'L', -4624=>'L', -4625=>'L', -4626=>'L', -4627=>'L', -4628=>'L', -4629=>'L', -4630=>'L', -4631=>'L', -4632=>'L', -4633=>'L', -4634=>'L', -4635=>'L', -4636=>'L', -4637=>'L', -4638=>'L', -4639=>'L', -4640=>'L', -4641=>'L', -4642=>'L', -4643=>'L', -4644=>'L', -4645=>'L', -4646=>'L', -4647=>'L', -4648=>'L', -4649=>'L', -4650=>'L', -4651=>'L', -4652=>'L', -4653=>'L', -4654=>'L', -4655=>'L', -4656=>'L', -4657=>'L', -4658=>'L', -4659=>'L', -4660=>'L', -4661=>'L', -4662=>'L', -4663=>'L', -4664=>'L', -4665=>'L', -4666=>'L', -4667=>'L', -4668=>'L', -4669=>'L', -4670=>'L', -4671=>'L', -4672=>'L', -4673=>'L', -4674=>'L', -4675=>'L', -4676=>'L', -4677=>'L', -4678=>'L', -4679=>'L', -4680=>'L', -4682=>'L', -4683=>'L', -4684=>'L', -4685=>'L', -4688=>'L', -4689=>'L', -4690=>'L', -4691=>'L', -4692=>'L', -4693=>'L', -4694=>'L', -4696=>'L', -4698=>'L', -4699=>'L', -4700=>'L', -4701=>'L', -4704=>'L', -4705=>'L', -4706=>'L', -4707=>'L', -4708=>'L', -4709=>'L', -4710=>'L', -4711=>'L', -4712=>'L', -4713=>'L', -4714=>'L', -4715=>'L', -4716=>'L', -4717=>'L', -4718=>'L', -4719=>'L', -4720=>'L', -4721=>'L', -4722=>'L', -4723=>'L', -4724=>'L', -4725=>'L', -4726=>'L', -4727=>'L', -4728=>'L', -4729=>'L', -4730=>'L', -4731=>'L', -4732=>'L', -4733=>'L', -4734=>'L', -4735=>'L', -4736=>'L', -4737=>'L', -4738=>'L', -4739=>'L', -4740=>'L', -4741=>'L', -4742=>'L', -4743=>'L', -4744=>'L', -4746=>'L', -4747=>'L', -4748=>'L', -4749=>'L', -4752=>'L', -4753=>'L', -4754=>'L', -4755=>'L', -4756=>'L', -4757=>'L', -4758=>'L', -4759=>'L', -4760=>'L', -4761=>'L', -4762=>'L', -4763=>'L', -4764=>'L', -4765=>'L', -4766=>'L', -4767=>'L', -4768=>'L', -4769=>'L', -4770=>'L', -4771=>'L', -4772=>'L', -4773=>'L', -4774=>'L', -4775=>'L', -4776=>'L', -4777=>'L', -4778=>'L', -4779=>'L', -4780=>'L', -4781=>'L', -4782=>'L', -4783=>'L', -4784=>'L', -4786=>'L', -4787=>'L', -4788=>'L', -4789=>'L', -4792=>'L', -4793=>'L', -4794=>'L', -4795=>'L', -4796=>'L', -4797=>'L', -4798=>'L', -4800=>'L', -4802=>'L', -4803=>'L', -4804=>'L', -4805=>'L', -4808=>'L', -4809=>'L', -4810=>'L', -4811=>'L', -4812=>'L', -4813=>'L', -4814=>'L', -4815=>'L', -4816=>'L', -4817=>'L', -4818=>'L', -4819=>'L', -4820=>'L', -4821=>'L', -4822=>'L', -4824=>'L', -4825=>'L', -4826=>'L', -4827=>'L', -4828=>'L', -4829=>'L', -4830=>'L', -4831=>'L', -4832=>'L', -4833=>'L', -4834=>'L', -4835=>'L', -4836=>'L', -4837=>'L', -4838=>'L', -4839=>'L', -4840=>'L', -4841=>'L', -4842=>'L', -4843=>'L', -4844=>'L', -4845=>'L', -4846=>'L', -4847=>'L', -4848=>'L', -4849=>'L', -4850=>'L', -4851=>'L', -4852=>'L', -4853=>'L', -4854=>'L', -4855=>'L', -4856=>'L', -4857=>'L', -4858=>'L', -4859=>'L', -4860=>'L', -4861=>'L', -4862=>'L', -4863=>'L', -4864=>'L', -4865=>'L', -4866=>'L', -4867=>'L', -4868=>'L', -4869=>'L', -4870=>'L', -4871=>'L', -4872=>'L', -4873=>'L', -4874=>'L', -4875=>'L', -4876=>'L', -4877=>'L', -4878=>'L', -4879=>'L', -4880=>'L', -4882=>'L', -4883=>'L', -4884=>'L', -4885=>'L', -4888=>'L', -4889=>'L', -4890=>'L', -4891=>'L', -4892=>'L', -4893=>'L', -4894=>'L', -4895=>'L', -4896=>'L', -4897=>'L', -4898=>'L', -4899=>'L', -4900=>'L', -4901=>'L', -4902=>'L', -4903=>'L', -4904=>'L', -4905=>'L', -4906=>'L', -4907=>'L', -4908=>'L', -4909=>'L', -4910=>'L', -4911=>'L', -4912=>'L', -4913=>'L', -4914=>'L', -4915=>'L', -4916=>'L', -4917=>'L', -4918=>'L', -4919=>'L', -4920=>'L', -4921=>'L', -4922=>'L', -4923=>'L', -4924=>'L', -4925=>'L', -4926=>'L', -4927=>'L', -4928=>'L', -4929=>'L', -4930=>'L', -4931=>'L', -4932=>'L', -4933=>'L', -4934=>'L', -4935=>'L', -4936=>'L', -4937=>'L', -4938=>'L', -4939=>'L', -4940=>'L', -4941=>'L', -4942=>'L', -4943=>'L', -4944=>'L', -4945=>'L', -4946=>'L', -4947=>'L', -4948=>'L', -4949=>'L', -4950=>'L', -4951=>'L', -4952=>'L', -4953=>'L', -4954=>'L', -4959=>'NSM', -4960=>'L', -4961=>'L', -4962=>'L', -4963=>'L', -4964=>'L', -4965=>'L', -4966=>'L', -4967=>'L', -4968=>'L', -4969=>'L', -4970=>'L', -4971=>'L', -4972=>'L', -4973=>'L', -4974=>'L', -4975=>'L', -4976=>'L', -4977=>'L', -4978=>'L', -4979=>'L', -4980=>'L', -4981=>'L', -4982=>'L', -4983=>'L', -4984=>'L', -4985=>'L', -4986=>'L', -4987=>'L', -4988=>'L', -4992=>'L', -4993=>'L', -4994=>'L', -4995=>'L', -4996=>'L', -4997=>'L', -4998=>'L', -4999=>'L', -5000=>'L', -5001=>'L', -5002=>'L', -5003=>'L', -5004=>'L', -5005=>'L', -5006=>'L', -5007=>'L', -5008=>'ON', -5009=>'ON', -5010=>'ON', -5011=>'ON', -5012=>'ON', -5013=>'ON', -5014=>'ON', -5015=>'ON', -5016=>'ON', -5017=>'ON', -5024=>'L', -5025=>'L', -5026=>'L', -5027=>'L', -5028=>'L', -5029=>'L', -5030=>'L', -5031=>'L', -5032=>'L', -5033=>'L', -5034=>'L', -5035=>'L', -5036=>'L', -5037=>'L', -5038=>'L', -5039=>'L', -5040=>'L', -5041=>'L', -5042=>'L', -5043=>'L', -5044=>'L', -5045=>'L', -5046=>'L', -5047=>'L', -5048=>'L', -5049=>'L', -5050=>'L', -5051=>'L', -5052=>'L', -5053=>'L', -5054=>'L', -5055=>'L', -5056=>'L', -5057=>'L', -5058=>'L', -5059=>'L', -5060=>'L', -5061=>'L', -5062=>'L', -5063=>'L', -5064=>'L', -5065=>'L', -5066=>'L', -5067=>'L', -5068=>'L', -5069=>'L', -5070=>'L', -5071=>'L', -5072=>'L', -5073=>'L', -5074=>'L', -5075=>'L', -5076=>'L', -5077=>'L', -5078=>'L', -5079=>'L', -5080=>'L', -5081=>'L', -5082=>'L', -5083=>'L', -5084=>'L', -5085=>'L', -5086=>'L', -5087=>'L', -5088=>'L', -5089=>'L', -5090=>'L', -5091=>'L', -5092=>'L', -5093=>'L', -5094=>'L', -5095=>'L', -5096=>'L', -5097=>'L', -5098=>'L', -5099=>'L', -5100=>'L', -5101=>'L', -5102=>'L', -5103=>'L', -5104=>'L', -5105=>'L', -5106=>'L', -5107=>'L', -5108=>'L', -5121=>'L', -5122=>'L', -5123=>'L', -5124=>'L', -5125=>'L', -5126=>'L', -5127=>'L', -5128=>'L', -5129=>'L', -5130=>'L', -5131=>'L', -5132=>'L', -5133=>'L', -5134=>'L', -5135=>'L', -5136=>'L', -5137=>'L', -5138=>'L', -5139=>'L', -5140=>'L', -5141=>'L', -5142=>'L', -5143=>'L', -5144=>'L', -5145=>'L', -5146=>'L', -5147=>'L', -5148=>'L', -5149=>'L', -5150=>'L', -5151=>'L', -5152=>'L', -5153=>'L', -5154=>'L', -5155=>'L', -5156=>'L', -5157=>'L', -5158=>'L', -5159=>'L', -5160=>'L', -5161=>'L', -5162=>'L', -5163=>'L', -5164=>'L', -5165=>'L', -5166=>'L', -5167=>'L', -5168=>'L', -5169=>'L', -5170=>'L', -5171=>'L', -5172=>'L', -5173=>'L', -5174=>'L', -5175=>'L', -5176=>'L', -5177=>'L', -5178=>'L', -5179=>'L', -5180=>'L', -5181=>'L', -5182=>'L', -5183=>'L', -5184=>'L', -5185=>'L', -5186=>'L', -5187=>'L', -5188=>'L', -5189=>'L', -5190=>'L', -5191=>'L', -5192=>'L', -5193=>'L', -5194=>'L', -5195=>'L', -5196=>'L', -5197=>'L', -5198=>'L', -5199=>'L', -5200=>'L', -5201=>'L', -5202=>'L', -5203=>'L', -5204=>'L', -5205=>'L', -5206=>'L', -5207=>'L', -5208=>'L', -5209=>'L', -5210=>'L', -5211=>'L', -5212=>'L', -5213=>'L', -5214=>'L', -5215=>'L', -5216=>'L', -5217=>'L', -5218=>'L', -5219=>'L', -5220=>'L', -5221=>'L', -5222=>'L', -5223=>'L', -5224=>'L', -5225=>'L', -5226=>'L', -5227=>'L', -5228=>'L', -5229=>'L', -5230=>'L', -5231=>'L', -5232=>'L', -5233=>'L', -5234=>'L', -5235=>'L', -5236=>'L', -5237=>'L', -5238=>'L', -5239=>'L', -5240=>'L', -5241=>'L', -5242=>'L', -5243=>'L', -5244=>'L', -5245=>'L', -5246=>'L', -5247=>'L', -5248=>'L', -5249=>'L', -5250=>'L', -5251=>'L', -5252=>'L', -5253=>'L', -5254=>'L', -5255=>'L', -5256=>'L', -5257=>'L', -5258=>'L', -5259=>'L', -5260=>'L', -5261=>'L', -5262=>'L', -5263=>'L', -5264=>'L', -5265=>'L', -5266=>'L', -5267=>'L', -5268=>'L', -5269=>'L', -5270=>'L', -5271=>'L', -5272=>'L', -5273=>'L', -5274=>'L', -5275=>'L', -5276=>'L', -5277=>'L', -5278=>'L', -5279=>'L', -5280=>'L', -5281=>'L', -5282=>'L', -5283=>'L', -5284=>'L', -5285=>'L', -5286=>'L', -5287=>'L', -5288=>'L', -5289=>'L', -5290=>'L', -5291=>'L', -5292=>'L', -5293=>'L', -5294=>'L', -5295=>'L', -5296=>'L', -5297=>'L', -5298=>'L', -5299=>'L', -5300=>'L', -5301=>'L', -5302=>'L', -5303=>'L', -5304=>'L', -5305=>'L', -5306=>'L', -5307=>'L', -5308=>'L', -5309=>'L', -5310=>'L', -5311=>'L', -5312=>'L', -5313=>'L', -5314=>'L', -5315=>'L', -5316=>'L', -5317=>'L', -5318=>'L', -5319=>'L', -5320=>'L', -5321=>'L', -5322=>'L', -5323=>'L', -5324=>'L', -5325=>'L', -5326=>'L', -5327=>'L', -5328=>'L', -5329=>'L', -5330=>'L', -5331=>'L', -5332=>'L', -5333=>'L', -5334=>'L', -5335=>'L', -5336=>'L', -5337=>'L', -5338=>'L', -5339=>'L', -5340=>'L', -5341=>'L', -5342=>'L', -5343=>'L', -5344=>'L', -5345=>'L', -5346=>'L', -5347=>'L', -5348=>'L', -5349=>'L', -5350=>'L', -5351=>'L', -5352=>'L', -5353=>'L', -5354=>'L', -5355=>'L', -5356=>'L', -5357=>'L', -5358=>'L', -5359=>'L', -5360=>'L', -5361=>'L', -5362=>'L', -5363=>'L', -5364=>'L', -5365=>'L', -5366=>'L', -5367=>'L', -5368=>'L', -5369=>'L', -5370=>'L', -5371=>'L', -5372=>'L', -5373=>'L', -5374=>'L', -5375=>'L', -5376=>'L', -5377=>'L', -5378=>'L', -5379=>'L', -5380=>'L', -5381=>'L', -5382=>'L', -5383=>'L', -5384=>'L', -5385=>'L', -5386=>'L', -5387=>'L', -5388=>'L', -5389=>'L', -5390=>'L', -5391=>'L', -5392=>'L', -5393=>'L', -5394=>'L', -5395=>'L', -5396=>'L', -5397=>'L', -5398=>'L', -5399=>'L', -5400=>'L', -5401=>'L', -5402=>'L', -5403=>'L', -5404=>'L', -5405=>'L', -5406=>'L', -5407=>'L', -5408=>'L', -5409=>'L', -5410=>'L', -5411=>'L', -5412=>'L', -5413=>'L', -5414=>'L', -5415=>'L', -5416=>'L', -5417=>'L', -5418=>'L', -5419=>'L', -5420=>'L', -5421=>'L', -5422=>'L', -5423=>'L', -5424=>'L', -5425=>'L', -5426=>'L', -5427=>'L', -5428=>'L', -5429=>'L', -5430=>'L', -5431=>'L', -5432=>'L', -5433=>'L', -5434=>'L', -5435=>'L', -5436=>'L', -5437=>'L', -5438=>'L', -5439=>'L', -5440=>'L', -5441=>'L', -5442=>'L', -5443=>'L', -5444=>'L', -5445=>'L', -5446=>'L', -5447=>'L', -5448=>'L', -5449=>'L', -5450=>'L', -5451=>'L', -5452=>'L', -5453=>'L', -5454=>'L', -5455=>'L', -5456=>'L', -5457=>'L', -5458=>'L', -5459=>'L', -5460=>'L', -5461=>'L', -5462=>'L', -5463=>'L', -5464=>'L', -5465=>'L', -5466=>'L', -5467=>'L', -5468=>'L', -5469=>'L', -5470=>'L', -5471=>'L', -5472=>'L', -5473=>'L', -5474=>'L', -5475=>'L', -5476=>'L', -5477=>'L', -5478=>'L', -5479=>'L', -5480=>'L', -5481=>'L', -5482=>'L', -5483=>'L', -5484=>'L', -5485=>'L', -5486=>'L', -5487=>'L', -5488=>'L', -5489=>'L', -5490=>'L', -5491=>'L', -5492=>'L', -5493=>'L', -5494=>'L', -5495=>'L', -5496=>'L', -5497=>'L', -5498=>'L', -5499=>'L', -5500=>'L', -5501=>'L', -5502=>'L', -5503=>'L', -5504=>'L', -5505=>'L', -5506=>'L', -5507=>'L', -5508=>'L', -5509=>'L', -5510=>'L', -5511=>'L', -5512=>'L', -5513=>'L', -5514=>'L', -5515=>'L', -5516=>'L', -5517=>'L', -5518=>'L', -5519=>'L', -5520=>'L', -5521=>'L', -5522=>'L', -5523=>'L', -5524=>'L', -5525=>'L', -5526=>'L', -5527=>'L', -5528=>'L', -5529=>'L', -5530=>'L', -5531=>'L', -5532=>'L', -5533=>'L', -5534=>'L', -5535=>'L', -5536=>'L', -5537=>'L', -5538=>'L', -5539=>'L', -5540=>'L', -5541=>'L', -5542=>'L', -5543=>'L', -5544=>'L', -5545=>'L', -5546=>'L', -5547=>'L', -5548=>'L', -5549=>'L', -5550=>'L', -5551=>'L', -5552=>'L', -5553=>'L', -5554=>'L', -5555=>'L', -5556=>'L', -5557=>'L', -5558=>'L', -5559=>'L', -5560=>'L', -5561=>'L', -5562=>'L', -5563=>'L', -5564=>'L', -5565=>'L', -5566=>'L', -5567=>'L', -5568=>'L', -5569=>'L', -5570=>'L', -5571=>'L', -5572=>'L', -5573=>'L', -5574=>'L', -5575=>'L', -5576=>'L', -5577=>'L', -5578=>'L', -5579=>'L', -5580=>'L', -5581=>'L', -5582=>'L', -5583=>'L', -5584=>'L', -5585=>'L', -5586=>'L', -5587=>'L', -5588=>'L', -5589=>'L', -5590=>'L', -5591=>'L', -5592=>'L', -5593=>'L', -5594=>'L', -5595=>'L', -5596=>'L', -5597=>'L', -5598=>'L', -5599=>'L', -5600=>'L', -5601=>'L', -5602=>'L', -5603=>'L', -5604=>'L', -5605=>'L', -5606=>'L', -5607=>'L', -5608=>'L', -5609=>'L', -5610=>'L', -5611=>'L', -5612=>'L', -5613=>'L', -5614=>'L', -5615=>'L', -5616=>'L', -5617=>'L', -5618=>'L', -5619=>'L', -5620=>'L', -5621=>'L', -5622=>'L', -5623=>'L', -5624=>'L', -5625=>'L', -5626=>'L', -5627=>'L', -5628=>'L', -5629=>'L', -5630=>'L', -5631=>'L', -5632=>'L', -5633=>'L', -5634=>'L', -5635=>'L', -5636=>'L', -5637=>'L', -5638=>'L', -5639=>'L', -5640=>'L', -5641=>'L', -5642=>'L', -5643=>'L', -5644=>'L', -5645=>'L', -5646=>'L', -5647=>'L', -5648=>'L', -5649=>'L', -5650=>'L', -5651=>'L', -5652=>'L', -5653=>'L', -5654=>'L', -5655=>'L', -5656=>'L', -5657=>'L', -5658=>'L', -5659=>'L', -5660=>'L', -5661=>'L', -5662=>'L', -5663=>'L', -5664=>'L', -5665=>'L', -5666=>'L', -5667=>'L', -5668=>'L', -5669=>'L', -5670=>'L', -5671=>'L', -5672=>'L', -5673=>'L', -5674=>'L', -5675=>'L', -5676=>'L', -5677=>'L', -5678=>'L', -5679=>'L', -5680=>'L', -5681=>'L', -5682=>'L', -5683=>'L', -5684=>'L', -5685=>'L', -5686=>'L', -5687=>'L', -5688=>'L', -5689=>'L', -5690=>'L', -5691=>'L', -5692=>'L', -5693=>'L', -5694=>'L', -5695=>'L', -5696=>'L', -5697=>'L', -5698=>'L', -5699=>'L', -5700=>'L', -5701=>'L', -5702=>'L', -5703=>'L', -5704=>'L', -5705=>'L', -5706=>'L', -5707=>'L', -5708=>'L', -5709=>'L', -5710=>'L', -5711=>'L', -5712=>'L', -5713=>'L', -5714=>'L', -5715=>'L', -5716=>'L', -5717=>'L', -5718=>'L', -5719=>'L', -5720=>'L', -5721=>'L', -5722=>'L', -5723=>'L', -5724=>'L', -5725=>'L', -5726=>'L', -5727=>'L', -5728=>'L', -5729=>'L', -5730=>'L', -5731=>'L', -5732=>'L', -5733=>'L', -5734=>'L', -5735=>'L', -5736=>'L', -5737=>'L', -5738=>'L', -5739=>'L', -5740=>'L', -5741=>'L', -5742=>'L', -5743=>'L', -5744=>'L', -5745=>'L', -5746=>'L', -5747=>'L', -5748=>'L', -5749=>'L', -5750=>'L', -5760=>'WS', -5761=>'L', -5762=>'L', -5763=>'L', -5764=>'L', -5765=>'L', -5766=>'L', -5767=>'L', -5768=>'L', -5769=>'L', -5770=>'L', -5771=>'L', -5772=>'L', -5773=>'L', -5774=>'L', -5775=>'L', -5776=>'L', -5777=>'L', -5778=>'L', -5779=>'L', -5780=>'L', -5781=>'L', -5782=>'L', -5783=>'L', -5784=>'L', -5785=>'L', -5786=>'L', -5787=>'ON', -5788=>'ON', -5792=>'L', -5793=>'L', -5794=>'L', -5795=>'L', -5796=>'L', -5797=>'L', -5798=>'L', -5799=>'L', -5800=>'L', -5801=>'L', -5802=>'L', -5803=>'L', -5804=>'L', -5805=>'L', -5806=>'L', -5807=>'L', -5808=>'L', -5809=>'L', -5810=>'L', -5811=>'L', -5812=>'L', -5813=>'L', -5814=>'L', -5815=>'L', -5816=>'L', -5817=>'L', -5818=>'L', -5819=>'L', -5820=>'L', -5821=>'L', -5822=>'L', -5823=>'L', -5824=>'L', -5825=>'L', -5826=>'L', -5827=>'L', -5828=>'L', -5829=>'L', -5830=>'L', -5831=>'L', -5832=>'L', -5833=>'L', -5834=>'L', -5835=>'L', -5836=>'L', -5837=>'L', -5838=>'L', -5839=>'L', -5840=>'L', -5841=>'L', -5842=>'L', -5843=>'L', -5844=>'L', -5845=>'L', -5846=>'L', -5847=>'L', -5848=>'L', -5849=>'L', -5850=>'L', -5851=>'L', -5852=>'L', -5853=>'L', -5854=>'L', -5855=>'L', -5856=>'L', -5857=>'L', -5858=>'L', -5859=>'L', -5860=>'L', -5861=>'L', -5862=>'L', -5863=>'L', -5864=>'L', -5865=>'L', -5866=>'L', -5867=>'L', -5868=>'L', -5869=>'L', -5870=>'L', -5871=>'L', -5872=>'L', -5888=>'L', -5889=>'L', -5890=>'L', -5891=>'L', -5892=>'L', -5893=>'L', -5894=>'L', -5895=>'L', -5896=>'L', -5897=>'L', -5898=>'L', -5899=>'L', -5900=>'L', -5902=>'L', -5903=>'L', -5904=>'L', -5905=>'L', -5906=>'NSM', -5907=>'NSM', -5908=>'NSM', -5920=>'L', -5921=>'L', -5922=>'L', -5923=>'L', -5924=>'L', -5925=>'L', -5926=>'L', -5927=>'L', -5928=>'L', -5929=>'L', -5930=>'L', -5931=>'L', -5932=>'L', -5933=>'L', -5934=>'L', -5935=>'L', -5936=>'L', -5937=>'L', -5938=>'NSM', -5939=>'NSM', -5940=>'NSM', -5941=>'L', -5942=>'L', -5952=>'L', -5953=>'L', -5954=>'L', -5955=>'L', -5956=>'L', -5957=>'L', -5958=>'L', -5959=>'L', -5960=>'L', -5961=>'L', -5962=>'L', -5963=>'L', -5964=>'L', -5965=>'L', -5966=>'L', -5967=>'L', -5968=>'L', -5969=>'L', -5970=>'NSM', -5971=>'NSM', -5984=>'L', -5985=>'L', -5986=>'L', -5987=>'L', -5988=>'L', -5989=>'L', -5990=>'L', -5991=>'L', -5992=>'L', -5993=>'L', -5994=>'L', -5995=>'L', -5996=>'L', -5998=>'L', -5999=>'L', -6000=>'L', -6002=>'NSM', -6003=>'NSM', -6016=>'L', -6017=>'L', -6018=>'L', -6019=>'L', -6020=>'L', -6021=>'L', -6022=>'L', -6023=>'L', -6024=>'L', -6025=>'L', -6026=>'L', -6027=>'L', -6028=>'L', -6029=>'L', -6030=>'L', -6031=>'L', -6032=>'L', -6033=>'L', -6034=>'L', -6035=>'L', -6036=>'L', -6037=>'L', -6038=>'L', -6039=>'L', -6040=>'L', -6041=>'L', -6042=>'L', -6043=>'L', -6044=>'L', -6045=>'L', -6046=>'L', -6047=>'L', -6048=>'L', -6049=>'L', -6050=>'L', -6051=>'L', -6052=>'L', -6053=>'L', -6054=>'L', -6055=>'L', -6056=>'L', -6057=>'L', -6058=>'L', -6059=>'L', -6060=>'L', -6061=>'L', -6062=>'L', -6063=>'L', -6064=>'L', -6065=>'L', -6066=>'L', -6067=>'L', -6068=>'L', -6069=>'L', -6070=>'L', -6071=>'NSM', -6072=>'NSM', -6073=>'NSM', -6074=>'NSM', -6075=>'NSM', -6076=>'NSM', -6077=>'NSM', -6078=>'L', -6079=>'L', -6080=>'L', -6081=>'L', -6082=>'L', -6083=>'L', -6084=>'L', -6085=>'L', -6086=>'NSM', -6087=>'L', -6088=>'L', -6089=>'NSM', -6090=>'NSM', -6091=>'NSM', -6092=>'NSM', -6093=>'NSM', -6094=>'NSM', -6095=>'NSM', -6096=>'NSM', -6097=>'NSM', -6098=>'NSM', -6099=>'NSM', -6100=>'L', -6101=>'L', -6102=>'L', -6103=>'L', -6104=>'L', -6105=>'L', -6106=>'L', -6107=>'ET', -6108=>'L', -6109=>'NSM', -6112=>'L', -6113=>'L', -6114=>'L', -6115=>'L', -6116=>'L', -6117=>'L', -6118=>'L', -6119=>'L', -6120=>'L', -6121=>'L', -6128=>'ON', -6129=>'ON', -6130=>'ON', -6131=>'ON', -6132=>'ON', -6133=>'ON', -6134=>'ON', -6135=>'ON', -6136=>'ON', -6137=>'ON', -6144=>'ON', -6145=>'ON', -6146=>'ON', -6147=>'ON', -6148=>'ON', -6149=>'ON', -6150=>'ON', -6151=>'ON', -6152=>'ON', -6153=>'ON', -6154=>'ON', -6155=>'NSM', -6156=>'NSM', -6157=>'NSM', -6158=>'WS', -6160=>'L', -6161=>'L', -6162=>'L', -6163=>'L', -6164=>'L', -6165=>'L', -6166=>'L', -6167=>'L', -6168=>'L', -6169=>'L', -6176=>'L', -6177=>'L', -6178=>'L', -6179=>'L', -6180=>'L', -6181=>'L', -6182=>'L', -6183=>'L', -6184=>'L', -6185=>'L', -6186=>'L', -6187=>'L', -6188=>'L', -6189=>'L', -6190=>'L', -6191=>'L', -6192=>'L', -6193=>'L', -6194=>'L', -6195=>'L', -6196=>'L', -6197=>'L', -6198=>'L', -6199=>'L', -6200=>'L', -6201=>'L', -6202=>'L', -6203=>'L', -6204=>'L', -6205=>'L', -6206=>'L', -6207=>'L', -6208=>'L', -6209=>'L', -6210=>'L', -6211=>'L', -6212=>'L', -6213=>'L', -6214=>'L', -6215=>'L', -6216=>'L', -6217=>'L', -6218=>'L', -6219=>'L', -6220=>'L', -6221=>'L', -6222=>'L', -6223=>'L', -6224=>'L', -6225=>'L', -6226=>'L', -6227=>'L', -6228=>'L', -6229=>'L', -6230=>'L', -6231=>'L', -6232=>'L', -6233=>'L', -6234=>'L', -6235=>'L', -6236=>'L', -6237=>'L', -6238=>'L', -6239=>'L', -6240=>'L', -6241=>'L', -6242=>'L', -6243=>'L', -6244=>'L', -6245=>'L', -6246=>'L', -6247=>'L', -6248=>'L', -6249=>'L', -6250=>'L', -6251=>'L', -6252=>'L', -6253=>'L', -6254=>'L', -6255=>'L', -6256=>'L', -6257=>'L', -6258=>'L', -6259=>'L', -6260=>'L', -6261=>'L', -6262=>'L', -6263=>'L', -6272=>'L', -6273=>'L', -6274=>'L', -6275=>'L', -6276=>'L', -6277=>'L', -6278=>'L', -6279=>'L', -6280=>'L', -6281=>'L', -6282=>'L', -6283=>'L', -6284=>'L', -6285=>'L', -6286=>'L', -6287=>'L', -6288=>'L', -6289=>'L', -6290=>'L', -6291=>'L', -6292=>'L', -6293=>'L', -6294=>'L', -6295=>'L', -6296=>'L', -6297=>'L', -6298=>'L', -6299=>'L', -6300=>'L', -6301=>'L', -6302=>'L', -6303=>'L', -6304=>'L', -6305=>'L', -6306=>'L', -6307=>'L', -6308=>'L', -6309=>'L', -6310=>'L', -6311=>'L', -6312=>'L', -6313=>'NSM', -6400=>'L', -6401=>'L', -6402=>'L', -6403=>'L', -6404=>'L', -6405=>'L', -6406=>'L', -6407=>'L', -6408=>'L', -6409=>'L', -6410=>'L', -6411=>'L', -6412=>'L', -6413=>'L', -6414=>'L', -6415=>'L', -6416=>'L', -6417=>'L', -6418=>'L', -6419=>'L', -6420=>'L', -6421=>'L', -6422=>'L', -6423=>'L', -6424=>'L', -6425=>'L', -6426=>'L', -6427=>'L', -6428=>'L', -6432=>'NSM', -6433=>'NSM', -6434=>'NSM', -6435=>'L', -6436=>'L', -6437=>'L', -6438=>'L', -6439=>'NSM', -6440=>'NSM', -6441=>'NSM', -6442=>'NSM', -6443=>'NSM', -6448=>'L', -6449=>'L', -6450=>'NSM', -6451=>'L', -6452=>'L', -6453=>'L', -6454=>'L', -6455=>'L', -6456=>'L', -6457=>'NSM', -6458=>'NSM', -6459=>'NSM', -6464=>'ON', -6468=>'ON', -6469=>'ON', -6470=>'L', -6471=>'L', -6472=>'L', -6473=>'L', -6474=>'L', -6475=>'L', -6476=>'L', -6477=>'L', -6478=>'L', -6479=>'L', -6480=>'L', -6481=>'L', -6482=>'L', -6483=>'L', -6484=>'L', -6485=>'L', -6486=>'L', -6487=>'L', -6488=>'L', -6489=>'L', -6490=>'L', -6491=>'L', -6492=>'L', -6493=>'L', -6494=>'L', -6495=>'L', -6496=>'L', -6497=>'L', -6498=>'L', -6499=>'L', -6500=>'L', -6501=>'L', -6502=>'L', -6503=>'L', -6504=>'L', -6505=>'L', -6506=>'L', -6507=>'L', -6508=>'L', -6509=>'L', -6512=>'L', -6513=>'L', -6514=>'L', -6515=>'L', -6516=>'L', -6528=>'L', -6529=>'L', -6530=>'L', -6531=>'L', -6532=>'L', -6533=>'L', -6534=>'L', -6535=>'L', -6536=>'L', -6537=>'L', -6538=>'L', -6539=>'L', -6540=>'L', -6541=>'L', -6542=>'L', -6543=>'L', -6544=>'L', -6545=>'L', -6546=>'L', -6547=>'L', -6548=>'L', -6549=>'L', -6550=>'L', -6551=>'L', -6552=>'L', -6553=>'L', -6554=>'L', -6555=>'L', -6556=>'L', -6557=>'L', -6558=>'L', -6559=>'L', -6560=>'L', -6561=>'L', -6562=>'L', -6563=>'L', -6564=>'L', -6565=>'L', -6566=>'L', -6567=>'L', -6568=>'L', -6569=>'L', -6576=>'L', -6577=>'L', -6578=>'L', -6579=>'L', -6580=>'L', -6581=>'L', -6582=>'L', -6583=>'L', -6584=>'L', -6585=>'L', -6586=>'L', -6587=>'L', -6588=>'L', -6589=>'L', -6590=>'L', -6591=>'L', -6592=>'L', -6593=>'L', -6594=>'L', -6595=>'L', -6596=>'L', -6597=>'L', -6598=>'L', -6599=>'L', -6600=>'L', -6601=>'L', -6608=>'L', -6609=>'L', -6610=>'L', -6611=>'L', -6612=>'L', -6613=>'L', -6614=>'L', -6615=>'L', -6616=>'L', -6617=>'L', -6622=>'ON', -6623=>'ON', -6624=>'ON', -6625=>'ON', -6626=>'ON', -6627=>'ON', -6628=>'ON', -6629=>'ON', -6630=>'ON', -6631=>'ON', -6632=>'ON', -6633=>'ON', -6634=>'ON', -6635=>'ON', -6636=>'ON', -6637=>'ON', -6638=>'ON', -6639=>'ON', -6640=>'ON', -6641=>'ON', -6642=>'ON', -6643=>'ON', -6644=>'ON', -6645=>'ON', -6646=>'ON', -6647=>'ON', -6648=>'ON', -6649=>'ON', -6650=>'ON', -6651=>'ON', -6652=>'ON', -6653=>'ON', -6654=>'ON', -6655=>'ON', -6656=>'L', -6657=>'L', -6658=>'L', -6659=>'L', -6660=>'L', -6661=>'L', -6662=>'L', -6663=>'L', -6664=>'L', -6665=>'L', -6666=>'L', -6667=>'L', -6668=>'L', -6669=>'L', -6670=>'L', -6671=>'L', -6672=>'L', -6673=>'L', -6674=>'L', -6675=>'L', -6676=>'L', -6677=>'L', -6678=>'L', -6679=>'NSM', -6680=>'NSM', -6681=>'L', -6682=>'L', -6683=>'L', -6686=>'L', -6687=>'L', -6912=>'NSM', -6913=>'NSM', -6914=>'NSM', -6915=>'NSM', -6916=>'L', -6917=>'L', -6918=>'L', -6919=>'L', -6920=>'L', -6921=>'L', -6922=>'L', -6923=>'L', -6924=>'L', -6925=>'L', -6926=>'L', -6927=>'L', -6928=>'L', -6929=>'L', -6930=>'L', -6931=>'L', -6932=>'L', -6933=>'L', -6934=>'L', -6935=>'L', -6936=>'L', -6937=>'L', -6938=>'L', -6939=>'L', -6940=>'L', -6941=>'L', -6942=>'L', -6943=>'L', -6944=>'L', -6945=>'L', -6946=>'L', -6947=>'L', -6948=>'L', -6949=>'L', -6950=>'L', -6951=>'L', -6952=>'L', -6953=>'L', -6954=>'L', -6955=>'L', -6956=>'L', -6957=>'L', -6958=>'L', -6959=>'L', -6960=>'L', -6961=>'L', -6962=>'L', -6963=>'L', -6964=>'NSM', -6965=>'L', -6966=>'NSM', -6967=>'NSM', -6968=>'NSM', -6969=>'NSM', -6970=>'NSM', -6971=>'L', -6972=>'NSM', -6973=>'L', -6974=>'L', -6975=>'L', -6976=>'L', -6977=>'L', -6978=>'NSM', -6979=>'L', -6980=>'L', -6981=>'L', -6982=>'L', -6983=>'L', -6984=>'L', -6985=>'L', -6986=>'L', -6987=>'L', -6992=>'L', -6993=>'L', -6994=>'L', -6995=>'L', -6996=>'L', -6997=>'L', -6998=>'L', -6999=>'L', -7000=>'L', -7001=>'L', -7002=>'L', -7003=>'L', -7004=>'L', -7005=>'L', -7006=>'L', -7007=>'L', -7008=>'L', -7009=>'L', -7010=>'L', -7011=>'L', -7012=>'L', -7013=>'L', -7014=>'L', -7015=>'L', -7016=>'L', -7017=>'L', -7018=>'L', -7019=>'NSM', -7020=>'NSM', -7021=>'NSM', -7022=>'NSM', -7023=>'NSM', -7024=>'NSM', -7025=>'NSM', -7026=>'NSM', -7027=>'NSM', -7028=>'L', -7029=>'L', -7030=>'L', -7031=>'L', -7032=>'L', -7033=>'L', -7034=>'L', -7035=>'L', -7036=>'L', -7424=>'L', -7425=>'L', -7426=>'L', -7427=>'L', -7428=>'L', -7429=>'L', -7430=>'L', -7431=>'L', -7432=>'L', -7433=>'L', -7434=>'L', -7435=>'L', -7436=>'L', -7437=>'L', -7438=>'L', -7439=>'L', -7440=>'L', -7441=>'L', -7442=>'L', -7443=>'L', -7444=>'L', -7445=>'L', -7446=>'L', -7447=>'L', -7448=>'L', -7449=>'L', -7450=>'L', -7451=>'L', -7452=>'L', -7453=>'L', -7454=>'L', -7455=>'L', -7456=>'L', -7457=>'L', -7458=>'L', -7459=>'L', -7460=>'L', -7461=>'L', -7462=>'L', -7463=>'L', -7464=>'L', -7465=>'L', -7466=>'L', -7467=>'L', -7468=>'L', -7469=>'L', -7470=>'L', -7471=>'L', -7472=>'L', -7473=>'L', -7474=>'L', -7475=>'L', -7476=>'L', -7477=>'L', -7478=>'L', -7479=>'L', -7480=>'L', -7481=>'L', -7482=>'L', -7483=>'L', -7484=>'L', -7485=>'L', -7486=>'L', -7487=>'L', -7488=>'L', -7489=>'L', -7490=>'L', -7491=>'L', -7492=>'L', -7493=>'L', -7494=>'L', -7495=>'L', -7496=>'L', -7497=>'L', -7498=>'L', -7499=>'L', -7500=>'L', -7501=>'L', -7502=>'L', -7503=>'L', -7504=>'L', -7505=>'L', -7506=>'L', -7507=>'L', -7508=>'L', -7509=>'L', -7510=>'L', -7511=>'L', -7512=>'L', -7513=>'L', -7514=>'L', -7515=>'L', -7516=>'L', -7517=>'L', -7518=>'L', -7519=>'L', -7520=>'L', -7521=>'L', -7522=>'L', -7523=>'L', -7524=>'L', -7525=>'L', -7526=>'L', -7527=>'L', -7528=>'L', -7529=>'L', -7530=>'L', -7531=>'L', -7532=>'L', -7533=>'L', -7534=>'L', -7535=>'L', -7536=>'L', -7537=>'L', -7538=>'L', -7539=>'L', -7540=>'L', -7541=>'L', -7542=>'L', -7543=>'L', -7544=>'L', -7545=>'L', -7546=>'L', -7547=>'L', -7548=>'L', -7549=>'L', -7550=>'L', -7551=>'L', -7552=>'L', -7553=>'L', -7554=>'L', -7555=>'L', -7556=>'L', -7557=>'L', -7558=>'L', -7559=>'L', -7560=>'L', -7561=>'L', -7562=>'L', -7563=>'L', -7564=>'L', -7565=>'L', -7566=>'L', -7567=>'L', -7568=>'L', -7569=>'L', -7570=>'L', -7571=>'L', -7572=>'L', -7573=>'L', -7574=>'L', -7575=>'L', -7576=>'L', -7577=>'L', -7578=>'L', -7579=>'L', -7580=>'L', -7581=>'L', -7582=>'L', -7583=>'L', -7584=>'L', -7585=>'L', -7586=>'L', -7587=>'L', -7588=>'L', -7589=>'L', -7590=>'L', -7591=>'L', -7592=>'L', -7593=>'L', -7594=>'L', -7595=>'L', -7596=>'L', -7597=>'L', -7598=>'L', -7599=>'L', -7600=>'L', -7601=>'L', -7602=>'L', -7603=>'L', -7604=>'L', -7605=>'L', -7606=>'L', -7607=>'L', -7608=>'L', -7609=>'L', -7610=>'L', -7611=>'L', -7612=>'L', -7613=>'L', -7614=>'L', -7615=>'L', -7616=>'NSM', -7617=>'NSM', -7618=>'NSM', -7619=>'NSM', -7620=>'NSM', -7621=>'NSM', -7622=>'NSM', -7623=>'NSM', -7624=>'NSM', -7625=>'NSM', -7626=>'NSM', -7678=>'NSM', -7679=>'NSM', -7680=>'L', -7681=>'L', -7682=>'L', -7683=>'L', -7684=>'L', -7685=>'L', -7686=>'L', -7687=>'L', -7688=>'L', -7689=>'L', -7690=>'L', -7691=>'L', -7692=>'L', -7693=>'L', -7694=>'L', -7695=>'L', -7696=>'L', -7697=>'L', -7698=>'L', -7699=>'L', -7700=>'L', -7701=>'L', -7702=>'L', -7703=>'L', -7704=>'L', -7705=>'L', -7706=>'L', -7707=>'L', -7708=>'L', -7709=>'L', -7710=>'L', -7711=>'L', -7712=>'L', -7713=>'L', -7714=>'L', -7715=>'L', -7716=>'L', -7717=>'L', -7718=>'L', -7719=>'L', -7720=>'L', -7721=>'L', -7722=>'L', -7723=>'L', -7724=>'L', -7725=>'L', -7726=>'L', -7727=>'L', -7728=>'L', -7729=>'L', -7730=>'L', -7731=>'L', -7732=>'L', -7733=>'L', -7734=>'L', -7735=>'L', -7736=>'L', -7737=>'L', -7738=>'L', -7739=>'L', -7740=>'L', -7741=>'L', -7742=>'L', -7743=>'L', -7744=>'L', -7745=>'L', -7746=>'L', -7747=>'L', -7748=>'L', -7749=>'L', -7750=>'L', -7751=>'L', -7752=>'L', -7753=>'L', -7754=>'L', -7755=>'L', -7756=>'L', -7757=>'L', -7758=>'L', -7759=>'L', -7760=>'L', -7761=>'L', -7762=>'L', -7763=>'L', -7764=>'L', -7765=>'L', -7766=>'L', -7767=>'L', -7768=>'L', -7769=>'L', -7770=>'L', -7771=>'L', -7772=>'L', -7773=>'L', -7774=>'L', -7775=>'L', -7776=>'L', -7777=>'L', -7778=>'L', -7779=>'L', -7780=>'L', -7781=>'L', -7782=>'L', -7783=>'L', -7784=>'L', -7785=>'L', -7786=>'L', -7787=>'L', -7788=>'L', -7789=>'L', -7790=>'L', -7791=>'L', -7792=>'L', -7793=>'L', -7794=>'L', -7795=>'L', -7796=>'L', -7797=>'L', -7798=>'L', -7799=>'L', -7800=>'L', -7801=>'L', -7802=>'L', -7803=>'L', -7804=>'L', -7805=>'L', -7806=>'L', -7807=>'L', -7808=>'L', -7809=>'L', -7810=>'L', -7811=>'L', -7812=>'L', -7813=>'L', -7814=>'L', -7815=>'L', -7816=>'L', -7817=>'L', -7818=>'L', -7819=>'L', -7820=>'L', -7821=>'L', -7822=>'L', -7823=>'L', -7824=>'L', -7825=>'L', -7826=>'L', -7827=>'L', -7828=>'L', -7829=>'L', -7830=>'L', -7831=>'L', -7832=>'L', -7833=>'L', -7834=>'L', -7835=>'L', -7840=>'L', -7841=>'L', -7842=>'L', -7843=>'L', -7844=>'L', -7845=>'L', -7846=>'L', -7847=>'L', -7848=>'L', -7849=>'L', -7850=>'L', -7851=>'L', -7852=>'L', -7853=>'L', -7854=>'L', -7855=>'L', -7856=>'L', -7857=>'L', -7858=>'L', -7859=>'L', -7860=>'L', -7861=>'L', -7862=>'L', -7863=>'L', -7864=>'L', -7865=>'L', -7866=>'L', -7867=>'L', -7868=>'L', -7869=>'L', -7870=>'L', -7871=>'L', -7872=>'L', -7873=>'L', -7874=>'L', -7875=>'L', -7876=>'L', -7877=>'L', -7878=>'L', -7879=>'L', -7880=>'L', -7881=>'L', -7882=>'L', -7883=>'L', -7884=>'L', -7885=>'L', -7886=>'L', -7887=>'L', -7888=>'L', -7889=>'L', -7890=>'L', -7891=>'L', -7892=>'L', -7893=>'L', -7894=>'L', -7895=>'L', -7896=>'L', -7897=>'L', -7898=>'L', -7899=>'L', -7900=>'L', -7901=>'L', -7902=>'L', -7903=>'L', -7904=>'L', -7905=>'L', -7906=>'L', -7907=>'L', -7908=>'L', -7909=>'L', -7910=>'L', -7911=>'L', -7912=>'L', -7913=>'L', -7914=>'L', -7915=>'L', -7916=>'L', -7917=>'L', -7918=>'L', -7919=>'L', -7920=>'L', -7921=>'L', -7922=>'L', -7923=>'L', -7924=>'L', -7925=>'L', -7926=>'L', -7927=>'L', -7928=>'L', -7929=>'L', -7936=>'L', -7937=>'L', -7938=>'L', -7939=>'L', -7940=>'L', -7941=>'L', -7942=>'L', -7943=>'L', -7944=>'L', -7945=>'L', -7946=>'L', -7947=>'L', -7948=>'L', -7949=>'L', -7950=>'L', -7951=>'L', -7952=>'L', -7953=>'L', -7954=>'L', -7955=>'L', -7956=>'L', -7957=>'L', -7960=>'L', -7961=>'L', -7962=>'L', -7963=>'L', -7964=>'L', -7965=>'L', -7968=>'L', -7969=>'L', -7970=>'L', -7971=>'L', -7972=>'L', -7973=>'L', -7974=>'L', -7975=>'L', -7976=>'L', -7977=>'L', -7978=>'L', -7979=>'L', -7980=>'L', -7981=>'L', -7982=>'L', -7983=>'L', -7984=>'L', -7985=>'L', -7986=>'L', -7987=>'L', -7988=>'L', -7989=>'L', -7990=>'L', -7991=>'L', -7992=>'L', -7993=>'L', -7994=>'L', -7995=>'L', -7996=>'L', -7997=>'L', -7998=>'L', -7999=>'L', -8000=>'L', -8001=>'L', -8002=>'L', -8003=>'L', -8004=>'L', -8005=>'L', -8008=>'L', -8009=>'L', -8010=>'L', -8011=>'L', -8012=>'L', -8013=>'L', -8016=>'L', -8017=>'L', -8018=>'L', -8019=>'L', -8020=>'L', -8021=>'L', -8022=>'L', -8023=>'L', -8025=>'L', -8027=>'L', -8029=>'L', -8031=>'L', -8032=>'L', -8033=>'L', -8034=>'L', -8035=>'L', -8036=>'L', -8037=>'L', -8038=>'L', -8039=>'L', -8040=>'L', -8041=>'L', -8042=>'L', -8043=>'L', -8044=>'L', -8045=>'L', -8046=>'L', -8047=>'L', -8048=>'L', -8049=>'L', -8050=>'L', -8051=>'L', -8052=>'L', -8053=>'L', -8054=>'L', -8055=>'L', -8056=>'L', -8057=>'L', -8058=>'L', -8059=>'L', -8060=>'L', -8061=>'L', -8064=>'L', -8065=>'L', -8066=>'L', -8067=>'L', -8068=>'L', -8069=>'L', -8070=>'L', -8071=>'L', -8072=>'L', -8073=>'L', -8074=>'L', -8075=>'L', -8076=>'L', -8077=>'L', -8078=>'L', -8079=>'L', -8080=>'L', -8081=>'L', -8082=>'L', -8083=>'L', -8084=>'L', -8085=>'L', -8086=>'L', -8087=>'L', -8088=>'L', -8089=>'L', -8090=>'L', -8091=>'L', -8092=>'L', -8093=>'L', -8094=>'L', -8095=>'L', -8096=>'L', -8097=>'L', -8098=>'L', -8099=>'L', -8100=>'L', -8101=>'L', -8102=>'L', -8103=>'L', -8104=>'L', -8105=>'L', -8106=>'L', -8107=>'L', -8108=>'L', -8109=>'L', -8110=>'L', -8111=>'L', -8112=>'L', -8113=>'L', -8114=>'L', -8115=>'L', -8116=>'L', -8118=>'L', -8119=>'L', -8120=>'L', -8121=>'L', -8122=>'L', -8123=>'L', -8124=>'L', -8125=>'ON', -8126=>'L', -8127=>'ON', -8128=>'ON', -8129=>'ON', -8130=>'L', -8131=>'L', -8132=>'L', -8134=>'L', -8135=>'L', -8136=>'L', -8137=>'L', -8138=>'L', -8139=>'L', -8140=>'L', -8141=>'ON', -8142=>'ON', -8143=>'ON', -8144=>'L', -8145=>'L', -8146=>'L', -8147=>'L', -8150=>'L', -8151=>'L', -8152=>'L', -8153=>'L', -8154=>'L', -8155=>'L', -8157=>'ON', -8158=>'ON', -8159=>'ON', -8160=>'L', -8161=>'L', -8162=>'L', -8163=>'L', -8164=>'L', -8165=>'L', -8166=>'L', -8167=>'L', -8168=>'L', -8169=>'L', -8170=>'L', -8171=>'L', -8172=>'L', -8173=>'ON', -8174=>'ON', -8175=>'ON', -8178=>'L', -8179=>'L', -8180=>'L', -8182=>'L', -8183=>'L', -8184=>'L', -8185=>'L', -8186=>'L', -8187=>'L', -8188=>'L', -8189=>'ON', -8190=>'ON', -8192=>'WS', -8193=>'WS', -8194=>'WS', -8195=>'WS', -8196=>'WS', -8197=>'WS', -8198=>'WS', -8199=>'WS', -8200=>'WS', -8201=>'WS', -8202=>'WS', -8203=>'BN', -8204=>'BN', -8205=>'BN', -8206=>'L', -8207=>'R', -8208=>'ON', -8209=>'ON', -8210=>'ON', -8211=>'ON', -8212=>'ON', -8213=>'ON', -8214=>'ON', -8215=>'ON', -8216=>'ON', -8217=>'ON', -8218=>'ON', -8219=>'ON', -8220=>'ON', -8221=>'ON', -8222=>'ON', -8223=>'ON', -8224=>'ON', -8225=>'ON', -8226=>'ON', -8227=>'ON', -8228=>'ON', -8229=>'ON', -8230=>'ON', -8231=>'ON', -8232=>'WS', -8233=>'B', -8234=>'LRE', -8235=>'RLE', -8236=>'PDF', -8237=>'LRO', -8238=>'RLO', -8239=>'CS', -8240=>'ET', -8241=>'ET', -8242=>'ET', -8243=>'ET', -8244=>'ET', -8245=>'ON', -8246=>'ON', -8247=>'ON', -8248=>'ON', -8249=>'ON', -8250=>'ON', -8251=>'ON', -8252=>'ON', -8253=>'ON', -8254=>'ON', -8255=>'ON', -8256=>'ON', -8257=>'ON', -8258=>'ON', -8259=>'ON', -8260=>'CS', -8261=>'ON', -8262=>'ON', -8263=>'ON', -8264=>'ON', -8265=>'ON', -8266=>'ON', -8267=>'ON', -8268=>'ON', -8269=>'ON', -8270=>'ON', -8271=>'ON', -8272=>'ON', -8273=>'ON', -8274=>'ON', -8275=>'ON', -8276=>'ON', -8277=>'ON', -8278=>'ON', -8279=>'ON', -8280=>'ON', -8281=>'ON', -8282=>'ON', -8283=>'ON', -8284=>'ON', -8285=>'ON', -8286=>'ON', -8287=>'WS', -8288=>'BN', -8289=>'BN', -8290=>'BN', -8291=>'BN', -8298=>'BN', -8299=>'BN', -8300=>'BN', -8301=>'BN', -8302=>'BN', -8303=>'BN', -8304=>'EN', -8305=>'L', -8308=>'EN', -8309=>'EN', -8310=>'EN', -8311=>'EN', -8312=>'EN', -8313=>'EN', -8314=>'ES', -8315=>'ES', -8316=>'ON', -8317=>'ON', -8318=>'ON', -8319=>'L', -8320=>'EN', -8321=>'EN', -8322=>'EN', -8323=>'EN', -8324=>'EN', -8325=>'EN', -8326=>'EN', -8327=>'EN', -8328=>'EN', -8329=>'EN', -8330=>'ES', -8331=>'ES', -8332=>'ON', -8333=>'ON', -8334=>'ON', -8336=>'L', -8337=>'L', -8338=>'L', -8339=>'L', -8340=>'L', -8352=>'ET', -8353=>'ET', -8354=>'ET', -8355=>'ET', -8356=>'ET', -8357=>'ET', -8358=>'ET', -8359=>'ET', -8360=>'ET', -8361=>'ET', -8362=>'ET', -8363=>'ET', -8364=>'ET', -8365=>'ET', -8366=>'ET', -8367=>'ET', -8368=>'ET', -8369=>'ET', -8370=>'ET', -8371=>'ET', -8372=>'ET', -8373=>'ET', -8400=>'NSM', -8401=>'NSM', -8402=>'NSM', -8403=>'NSM', -8404=>'NSM', -8405=>'NSM', -8406=>'NSM', -8407=>'NSM', -8408=>'NSM', -8409=>'NSM', -8410=>'NSM', -8411=>'NSM', -8412=>'NSM', -8413=>'NSM', -8414=>'NSM', -8415=>'NSM', -8416=>'NSM', -8417=>'NSM', -8418=>'NSM', -8419=>'NSM', -8420=>'NSM', -8421=>'NSM', -8422=>'NSM', -8423=>'NSM', -8424=>'NSM', -8425=>'NSM', -8426=>'NSM', -8427=>'NSM', -8428=>'NSM', -8429=>'NSM', -8430=>'NSM', -8431=>'NSM', -8448=>'ON', -8449=>'ON', -8450=>'L', -8451=>'ON', -8452=>'ON', -8453=>'ON', -8454=>'ON', -8455=>'L', -8456=>'ON', -8457=>'ON', -8458=>'L', -8459=>'L', -8460=>'L', -8461=>'L', -8462=>'L', -8463=>'L', -8464=>'L', -8465=>'L', -8466=>'L', -8467=>'L', -8468=>'ON', -8469=>'L', -8470=>'ON', -8471=>'ON', -8472=>'ON', -8473=>'L', -8474=>'L', -8475=>'L', -8476=>'L', -8477=>'L', -8478=>'ON', -8479=>'ON', -8480=>'ON', -8481=>'ON', -8482=>'ON', -8483=>'ON', -8484=>'L', -8485=>'ON', -8486=>'L', -8487=>'ON', -8488=>'L', -8489=>'ON', -8490=>'L', -8491=>'L', -8492=>'L', -8493=>'L', -8494=>'ET', -8495=>'L', -8496=>'L', -8497=>'L', -8498=>'L', -8499=>'L', -8500=>'L', -8501=>'L', -8502=>'L', -8503=>'L', -8504=>'L', -8505=>'L', -8506=>'ON', -8507=>'ON', -8508=>'L', -8509=>'L', -8510=>'L', -8511=>'L', -8512=>'ON', -8513=>'ON', -8514=>'ON', -8515=>'ON', -8516=>'ON', -8517=>'L', -8518=>'L', -8519=>'L', -8520=>'L', -8521=>'L', -8522=>'ON', -8523=>'ON', -8524=>'ON', -8525=>'ON', -8526=>'L', -8531=>'ON', -8532=>'ON', -8533=>'ON', -8534=>'ON', -8535=>'ON', -8536=>'ON', -8537=>'ON', -8538=>'ON', -8539=>'ON', -8540=>'ON', -8541=>'ON', -8542=>'ON', -8543=>'ON', -8544=>'L', -8545=>'L', -8546=>'L', -8547=>'L', -8548=>'L', -8549=>'L', -8550=>'L', -8551=>'L', -8552=>'L', -8553=>'L', -8554=>'L', -8555=>'L', -8556=>'L', -8557=>'L', -8558=>'L', -8559=>'L', -8560=>'L', -8561=>'L', -8562=>'L', -8563=>'L', -8564=>'L', -8565=>'L', -8566=>'L', -8567=>'L', -8568=>'L', -8569=>'L', -8570=>'L', -8571=>'L', -8572=>'L', -8573=>'L', -8574=>'L', -8575=>'L', -8576=>'L', -8577=>'L', -8578=>'L', -8579=>'L', -8580=>'L', -8592=>'ON', -8593=>'ON', -8594=>'ON', -8595=>'ON', -8596=>'ON', -8597=>'ON', -8598=>'ON', -8599=>'ON', -8600=>'ON', -8601=>'ON', -8602=>'ON', -8603=>'ON', -8604=>'ON', -8605=>'ON', -8606=>'ON', -8607=>'ON', -8608=>'ON', -8609=>'ON', -8610=>'ON', -8611=>'ON', -8612=>'ON', -8613=>'ON', -8614=>'ON', -8615=>'ON', -8616=>'ON', -8617=>'ON', -8618=>'ON', -8619=>'ON', -8620=>'ON', -8621=>'ON', -8622=>'ON', -8623=>'ON', -8624=>'ON', -8625=>'ON', -8626=>'ON', -8627=>'ON', -8628=>'ON', -8629=>'ON', -8630=>'ON', -8631=>'ON', -8632=>'ON', -8633=>'ON', -8634=>'ON', -8635=>'ON', -8636=>'ON', -8637=>'ON', -8638=>'ON', -8639=>'ON', -8640=>'ON', -8641=>'ON', -8642=>'ON', -8643=>'ON', -8644=>'ON', -8645=>'ON', -8646=>'ON', -8647=>'ON', -8648=>'ON', -8649=>'ON', -8650=>'ON', -8651=>'ON', -8652=>'ON', -8653=>'ON', -8654=>'ON', -8655=>'ON', -8656=>'ON', -8657=>'ON', -8658=>'ON', -8659=>'ON', -8660=>'ON', -8661=>'ON', -8662=>'ON', -8663=>'ON', -8664=>'ON', -8665=>'ON', -8666=>'ON', -8667=>'ON', -8668=>'ON', -8669=>'ON', -8670=>'ON', -8671=>'ON', -8672=>'ON', -8673=>'ON', -8674=>'ON', -8675=>'ON', -8676=>'ON', -8677=>'ON', -8678=>'ON', -8679=>'ON', -8680=>'ON', -8681=>'ON', -8682=>'ON', -8683=>'ON', -8684=>'ON', -8685=>'ON', -8686=>'ON', -8687=>'ON', -8688=>'ON', -8689=>'ON', -8690=>'ON', -8691=>'ON', -8692=>'ON', -8693=>'ON', -8694=>'ON', -8695=>'ON', -8696=>'ON', -8697=>'ON', -8698=>'ON', -8699=>'ON', -8700=>'ON', -8701=>'ON', -8702=>'ON', -8703=>'ON', -8704=>'ON', -8705=>'ON', -8706=>'ON', -8707=>'ON', -8708=>'ON', -8709=>'ON', -8710=>'ON', -8711=>'ON', -8712=>'ON', -8713=>'ON', -8714=>'ON', -8715=>'ON', -8716=>'ON', -8717=>'ON', -8718=>'ON', -8719=>'ON', -8720=>'ON', -8721=>'ON', -8722=>'ES', -8723=>'ET', -8724=>'ON', -8725=>'ON', -8726=>'ON', -8727=>'ON', -8728=>'ON', -8729=>'ON', -8730=>'ON', -8731=>'ON', -8732=>'ON', -8733=>'ON', -8734=>'ON', -8735=>'ON', -8736=>'ON', -8737=>'ON', -8738=>'ON', -8739=>'ON', -8740=>'ON', -8741=>'ON', -8742=>'ON', -8743=>'ON', -8744=>'ON', -8745=>'ON', -8746=>'ON', -8747=>'ON', -8748=>'ON', -8749=>'ON', -8750=>'ON', -8751=>'ON', -8752=>'ON', -8753=>'ON', -8754=>'ON', -8755=>'ON', -8756=>'ON', -8757=>'ON', -8758=>'ON', -8759=>'ON', -8760=>'ON', -8761=>'ON', -8762=>'ON', -8763=>'ON', -8764=>'ON', -8765=>'ON', -8766=>'ON', -8767=>'ON', -8768=>'ON', -8769=>'ON', -8770=>'ON', -8771=>'ON', -8772=>'ON', -8773=>'ON', -8774=>'ON', -8775=>'ON', -8776=>'ON', -8777=>'ON', -8778=>'ON', -8779=>'ON', -8780=>'ON', -8781=>'ON', -8782=>'ON', -8783=>'ON', -8784=>'ON', -8785=>'ON', -8786=>'ON', -8787=>'ON', -8788=>'ON', -8789=>'ON', -8790=>'ON', -8791=>'ON', -8792=>'ON', -8793=>'ON', -8794=>'ON', -8795=>'ON', -8796=>'ON', -8797=>'ON', -8798=>'ON', -8799=>'ON', -8800=>'ON', -8801=>'ON', -8802=>'ON', -8803=>'ON', -8804=>'ON', -8805=>'ON', -8806=>'ON', -8807=>'ON', -8808=>'ON', -8809=>'ON', -8810=>'ON', -8811=>'ON', -8812=>'ON', -8813=>'ON', -8814=>'ON', -8815=>'ON', -8816=>'ON', -8817=>'ON', -8818=>'ON', -8819=>'ON', -8820=>'ON', -8821=>'ON', -8822=>'ON', -8823=>'ON', -8824=>'ON', -8825=>'ON', -8826=>'ON', -8827=>'ON', -8828=>'ON', -8829=>'ON', -8830=>'ON', -8831=>'ON', -8832=>'ON', -8833=>'ON', -8834=>'ON', -8835=>'ON', -8836=>'ON', -8837=>'ON', -8838=>'ON', -8839=>'ON', -8840=>'ON', -8841=>'ON', -8842=>'ON', -8843=>'ON', -8844=>'ON', -8845=>'ON', -8846=>'ON', -8847=>'ON', -8848=>'ON', -8849=>'ON', -8850=>'ON', -8851=>'ON', -8852=>'ON', -8853=>'ON', -8854=>'ON', -8855=>'ON', -8856=>'ON', -8857=>'ON', -8858=>'ON', -8859=>'ON', -8860=>'ON', -8861=>'ON', -8862=>'ON', -8863=>'ON', -8864=>'ON', -8865=>'ON', -8866=>'ON', -8867=>'ON', -8868=>'ON', -8869=>'ON', -8870=>'ON', -8871=>'ON', -8872=>'ON', -8873=>'ON', -8874=>'ON', -8875=>'ON', -8876=>'ON', -8877=>'ON', -8878=>'ON', -8879=>'ON', -8880=>'ON', -8881=>'ON', -8882=>'ON', -8883=>'ON', -8884=>'ON', -8885=>'ON', -8886=>'ON', -8887=>'ON', -8888=>'ON', -8889=>'ON', -8890=>'ON', -8891=>'ON', -8892=>'ON', -8893=>'ON', -8894=>'ON', -8895=>'ON', -8896=>'ON', -8897=>'ON', -8898=>'ON', -8899=>'ON', -8900=>'ON', -8901=>'ON', -8902=>'ON', -8903=>'ON', -8904=>'ON', -8905=>'ON', -8906=>'ON', -8907=>'ON', -8908=>'ON', -8909=>'ON', -8910=>'ON', -8911=>'ON', -8912=>'ON', -8913=>'ON', -8914=>'ON', -8915=>'ON', -8916=>'ON', -8917=>'ON', -8918=>'ON', -8919=>'ON', -8920=>'ON', -8921=>'ON', -8922=>'ON', -8923=>'ON', -8924=>'ON', -8925=>'ON', -8926=>'ON', -8927=>'ON', -8928=>'ON', -8929=>'ON', -8930=>'ON', -8931=>'ON', -8932=>'ON', -8933=>'ON', -8934=>'ON', -8935=>'ON', -8936=>'ON', -8937=>'ON', -8938=>'ON', -8939=>'ON', -8940=>'ON', -8941=>'ON', -8942=>'ON', -8943=>'ON', -8944=>'ON', -8945=>'ON', -8946=>'ON', -8947=>'ON', -8948=>'ON', -8949=>'ON', -8950=>'ON', -8951=>'ON', -8952=>'ON', -8953=>'ON', -8954=>'ON', -8955=>'ON', -8956=>'ON', -8957=>'ON', -8958=>'ON', -8959=>'ON', -8960=>'ON', -8961=>'ON', -8962=>'ON', -8963=>'ON', -8964=>'ON', -8965=>'ON', -8966=>'ON', -8967=>'ON', -8968=>'ON', -8969=>'ON', -8970=>'ON', -8971=>'ON', -8972=>'ON', -8973=>'ON', -8974=>'ON', -8975=>'ON', -8976=>'ON', -8977=>'ON', -8978=>'ON', -8979=>'ON', -8980=>'ON', -8981=>'ON', -8982=>'ON', -8983=>'ON', -8984=>'ON', -8985=>'ON', -8986=>'ON', -8987=>'ON', -8988=>'ON', -8989=>'ON', -8990=>'ON', -8991=>'ON', -8992=>'ON', -8993=>'ON', -8994=>'ON', -8995=>'ON', -8996=>'ON', -8997=>'ON', -8998=>'ON', -8999=>'ON', -9000=>'ON', -9001=>'ON', -9002=>'ON', -9003=>'ON', -9004=>'ON', -9005=>'ON', -9006=>'ON', -9007=>'ON', -9008=>'ON', -9009=>'ON', -9010=>'ON', -9011=>'ON', -9012=>'ON', -9013=>'ON', -9014=>'L', -9015=>'L', -9016=>'L', -9017=>'L', -9018=>'L', -9019=>'L', -9020=>'L', -9021=>'L', -9022=>'L', -9023=>'L', -9024=>'L', -9025=>'L', -9026=>'L', -9027=>'L', -9028=>'L', -9029=>'L', -9030=>'L', -9031=>'L', -9032=>'L', -9033=>'L', -9034=>'L', -9035=>'L', -9036=>'L', -9037=>'L', -9038=>'L', -9039=>'L', -9040=>'L', -9041=>'L', -9042=>'L', -9043=>'L', -9044=>'L', -9045=>'L', -9046=>'L', -9047=>'L', -9048=>'L', -9049=>'L', -9050=>'L', -9051=>'L', -9052=>'L', -9053=>'L', -9054=>'L', -9055=>'L', -9056=>'L', -9057=>'L', -9058=>'L', -9059=>'L', -9060=>'L', -9061=>'L', -9062=>'L', -9063=>'L', -9064=>'L', -9065=>'L', -9066=>'L', -9067=>'L', -9068=>'L', -9069=>'L', -9070=>'L', -9071=>'L', -9072=>'L', -9073=>'L', -9074=>'L', -9075=>'L', -9076=>'L', -9077=>'L', -9078=>'L', -9079=>'L', -9080=>'L', -9081=>'L', -9082=>'L', -9083=>'ON', -9084=>'ON', -9085=>'ON', -9086=>'ON', -9087=>'ON', -9088=>'ON', -9089=>'ON', -9090=>'ON', -9091=>'ON', -9092=>'ON', -9093=>'ON', -9094=>'ON', -9095=>'ON', -9096=>'ON', -9097=>'ON', -9098=>'ON', -9099=>'ON', -9100=>'ON', -9101=>'ON', -9102=>'ON', -9103=>'ON', -9104=>'ON', -9105=>'ON', -9106=>'ON', -9107=>'ON', -9108=>'ON', -9109=>'L', -9110=>'ON', -9111=>'ON', -9112=>'ON', -9113=>'ON', -9114=>'ON', -9115=>'ON', -9116=>'ON', -9117=>'ON', -9118=>'ON', -9119=>'ON', -9120=>'ON', -9121=>'ON', -9122=>'ON', -9123=>'ON', -9124=>'ON', -9125=>'ON', -9126=>'ON', -9127=>'ON', -9128=>'ON', -9129=>'ON', -9130=>'ON', -9131=>'ON', -9132=>'ON', -9133=>'ON', -9134=>'ON', -9135=>'ON', -9136=>'ON', -9137=>'ON', -9138=>'ON', -9139=>'ON', -9140=>'ON', -9141=>'ON', -9142=>'ON', -9143=>'ON', -9144=>'ON', -9145=>'ON', -9146=>'ON', -9147=>'ON', -9148=>'ON', -9149=>'ON', -9150=>'ON', -9151=>'ON', -9152=>'ON', -9153=>'ON', -9154=>'ON', -9155=>'ON', -9156=>'ON', -9157=>'ON', -9158=>'ON', -9159=>'ON', -9160=>'ON', -9161=>'ON', -9162=>'ON', -9163=>'ON', -9164=>'ON', -9165=>'ON', -9166=>'ON', -9167=>'ON', -9168=>'ON', -9169=>'ON', -9170=>'ON', -9171=>'ON', -9172=>'ON', -9173=>'ON', -9174=>'ON', -9175=>'ON', -9176=>'ON', -9177=>'ON', -9178=>'ON', -9179=>'ON', -9180=>'ON', -9181=>'ON', -9182=>'ON', -9183=>'ON', -9184=>'ON', -9185=>'ON', -9186=>'ON', -9187=>'ON', -9188=>'ON', -9189=>'ON', -9190=>'ON', -9191=>'ON', -9216=>'ON', -9217=>'ON', -9218=>'ON', -9219=>'ON', -9220=>'ON', -9221=>'ON', -9222=>'ON', -9223=>'ON', -9224=>'ON', -9225=>'ON', -9226=>'ON', -9227=>'ON', -9228=>'ON', -9229=>'ON', -9230=>'ON', -9231=>'ON', -9232=>'ON', -9233=>'ON', -9234=>'ON', -9235=>'ON', -9236=>'ON', -9237=>'ON', -9238=>'ON', -9239=>'ON', -9240=>'ON', -9241=>'ON', -9242=>'ON', -9243=>'ON', -9244=>'ON', -9245=>'ON', -9246=>'ON', -9247=>'ON', -9248=>'ON', -9249=>'ON', -9250=>'ON', -9251=>'ON', -9252=>'ON', -9253=>'ON', -9254=>'ON', -9280=>'ON', -9281=>'ON', -9282=>'ON', -9283=>'ON', -9284=>'ON', -9285=>'ON', -9286=>'ON', -9287=>'ON', -9288=>'ON', -9289=>'ON', -9290=>'ON', -9312=>'ON', -9313=>'ON', -9314=>'ON', -9315=>'ON', -9316=>'ON', -9317=>'ON', -9318=>'ON', -9319=>'ON', -9320=>'ON', -9321=>'ON', -9322=>'ON', -9323=>'ON', -9324=>'ON', -9325=>'ON', -9326=>'ON', -9327=>'ON', -9328=>'ON', -9329=>'ON', -9330=>'ON', -9331=>'ON', -9332=>'ON', -9333=>'ON', -9334=>'ON', -9335=>'ON', -9336=>'ON', -9337=>'ON', -9338=>'ON', -9339=>'ON', -9340=>'ON', -9341=>'ON', -9342=>'ON', -9343=>'ON', -9344=>'ON', -9345=>'ON', -9346=>'ON', -9347=>'ON', -9348=>'ON', -9349=>'ON', -9350=>'ON', -9351=>'ON', -9352=>'EN', -9353=>'EN', -9354=>'EN', -9355=>'EN', -9356=>'EN', -9357=>'EN', -9358=>'EN', -9359=>'EN', -9360=>'EN', -9361=>'EN', -9362=>'EN', -9363=>'EN', -9364=>'EN', -9365=>'EN', -9366=>'EN', -9367=>'EN', -9368=>'EN', -9369=>'EN', -9370=>'EN', -9371=>'EN', -9372=>'L', -9373=>'L', -9374=>'L', -9375=>'L', -9376=>'L', -9377=>'L', -9378=>'L', -9379=>'L', -9380=>'L', -9381=>'L', -9382=>'L', -9383=>'L', -9384=>'L', -9385=>'L', -9386=>'L', -9387=>'L', -9388=>'L', -9389=>'L', -9390=>'L', -9391=>'L', -9392=>'L', -9393=>'L', -9394=>'L', -9395=>'L', -9396=>'L', -9397=>'L', -9398=>'L', -9399=>'L', -9400=>'L', -9401=>'L', -9402=>'L', -9403=>'L', -9404=>'L', -9405=>'L', -9406=>'L', -9407=>'L', -9408=>'L', -9409=>'L', -9410=>'L', -9411=>'L', -9412=>'L', -9413=>'L', -9414=>'L', -9415=>'L', -9416=>'L', -9417=>'L', -9418=>'L', -9419=>'L', -9420=>'L', -9421=>'L', -9422=>'L', -9423=>'L', -9424=>'L', -9425=>'L', -9426=>'L', -9427=>'L', -9428=>'L', -9429=>'L', -9430=>'L', -9431=>'L', -9432=>'L', -9433=>'L', -9434=>'L', -9435=>'L', -9436=>'L', -9437=>'L', -9438=>'L', -9439=>'L', -9440=>'L', -9441=>'L', -9442=>'L', -9443=>'L', -9444=>'L', -9445=>'L', -9446=>'L', -9447=>'L', -9448=>'L', -9449=>'L', -9450=>'ON', -9451=>'ON', -9452=>'ON', -9453=>'ON', -9454=>'ON', -9455=>'ON', -9456=>'ON', -9457=>'ON', -9458=>'ON', -9459=>'ON', -9460=>'ON', -9461=>'ON', -9462=>'ON', -9463=>'ON', -9464=>'ON', -9465=>'ON', -9466=>'ON', -9467=>'ON', -9468=>'ON', -9469=>'ON', -9470=>'ON', -9471=>'ON', -9472=>'ON', -9473=>'ON', -9474=>'ON', -9475=>'ON', -9476=>'ON', -9477=>'ON', -9478=>'ON', -9479=>'ON', -9480=>'ON', -9481=>'ON', -9482=>'ON', -9483=>'ON', -9484=>'ON', -9485=>'ON', -9486=>'ON', -9487=>'ON', -9488=>'ON', -9489=>'ON', -9490=>'ON', -9491=>'ON', -9492=>'ON', -9493=>'ON', -9494=>'ON', -9495=>'ON', -9496=>'ON', -9497=>'ON', -9498=>'ON', -9499=>'ON', -9500=>'ON', -9501=>'ON', -9502=>'ON', -9503=>'ON', -9504=>'ON', -9505=>'ON', -9506=>'ON', -9507=>'ON', -9508=>'ON', -9509=>'ON', -9510=>'ON', -9511=>'ON', -9512=>'ON', -9513=>'ON', -9514=>'ON', -9515=>'ON', -9516=>'ON', -9517=>'ON', -9518=>'ON', -9519=>'ON', -9520=>'ON', -9521=>'ON', -9522=>'ON', -9523=>'ON', -9524=>'ON', -9525=>'ON', -9526=>'ON', -9527=>'ON', -9528=>'ON', -9529=>'ON', -9530=>'ON', -9531=>'ON', -9532=>'ON', -9533=>'ON', -9534=>'ON', -9535=>'ON', -9536=>'ON', -9537=>'ON', -9538=>'ON', -9539=>'ON', -9540=>'ON', -9541=>'ON', -9542=>'ON', -9543=>'ON', -9544=>'ON', -9545=>'ON', -9546=>'ON', -9547=>'ON', -9548=>'ON', -9549=>'ON', -9550=>'ON', -9551=>'ON', -9552=>'ON', -9553=>'ON', -9554=>'ON', -9555=>'ON', -9556=>'ON', -9557=>'ON', -9558=>'ON', -9559=>'ON', -9560=>'ON', -9561=>'ON', -9562=>'ON', -9563=>'ON', -9564=>'ON', -9565=>'ON', -9566=>'ON', -9567=>'ON', -9568=>'ON', -9569=>'ON', -9570=>'ON', -9571=>'ON', -9572=>'ON', -9573=>'ON', -9574=>'ON', -9575=>'ON', -9576=>'ON', -9577=>'ON', -9578=>'ON', -9579=>'ON', -9580=>'ON', -9581=>'ON', -9582=>'ON', -9583=>'ON', -9584=>'ON', -9585=>'ON', -9586=>'ON', -9587=>'ON', -9588=>'ON', -9589=>'ON', -9590=>'ON', -9591=>'ON', -9592=>'ON', -9593=>'ON', -9594=>'ON', -9595=>'ON', -9596=>'ON', -9597=>'ON', -9598=>'ON', -9599=>'ON', -9600=>'ON', -9601=>'ON', -9602=>'ON', -9603=>'ON', -9604=>'ON', -9605=>'ON', -9606=>'ON', -9607=>'ON', -9608=>'ON', -9609=>'ON', -9610=>'ON', -9611=>'ON', -9612=>'ON', -9613=>'ON', -9614=>'ON', -9615=>'ON', -9616=>'ON', -9617=>'ON', -9618=>'ON', -9619=>'ON', -9620=>'ON', -9621=>'ON', -9622=>'ON', -9623=>'ON', -9624=>'ON', -9625=>'ON', -9626=>'ON', -9627=>'ON', -9628=>'ON', -9629=>'ON', -9630=>'ON', -9631=>'ON', -9632=>'ON', -9633=>'ON', -9634=>'ON', -9635=>'ON', -9636=>'ON', -9637=>'ON', -9638=>'ON', -9639=>'ON', -9640=>'ON', -9641=>'ON', -9642=>'ON', -9643=>'ON', -9644=>'ON', -9645=>'ON', -9646=>'ON', -9647=>'ON', -9648=>'ON', -9649=>'ON', -9650=>'ON', -9651=>'ON', -9652=>'ON', -9653=>'ON', -9654=>'ON', -9655=>'ON', -9656=>'ON', -9657=>'ON', -9658=>'ON', -9659=>'ON', -9660=>'ON', -9661=>'ON', -9662=>'ON', -9663=>'ON', -9664=>'ON', -9665=>'ON', -9666=>'ON', -9667=>'ON', -9668=>'ON', -9669=>'ON', -9670=>'ON', -9671=>'ON', -9672=>'ON', -9673=>'ON', -9674=>'ON', -9675=>'ON', -9676=>'ON', -9677=>'ON', -9678=>'ON', -9679=>'ON', -9680=>'ON', -9681=>'ON', -9682=>'ON', -9683=>'ON', -9684=>'ON', -9685=>'ON', -9686=>'ON', -9687=>'ON', -9688=>'ON', -9689=>'ON', -9690=>'ON', -9691=>'ON', -9692=>'ON', -9693=>'ON', -9694=>'ON', -9695=>'ON', -9696=>'ON', -9697=>'ON', -9698=>'ON', -9699=>'ON', -9700=>'ON', -9701=>'ON', -9702=>'ON', -9703=>'ON', -9704=>'ON', -9705=>'ON', -9706=>'ON', -9707=>'ON', -9708=>'ON', -9709=>'ON', -9710=>'ON', -9711=>'ON', -9712=>'ON', -9713=>'ON', -9714=>'ON', -9715=>'ON', -9716=>'ON', -9717=>'ON', -9718=>'ON', -9719=>'ON', -9720=>'ON', -9721=>'ON', -9722=>'ON', -9723=>'ON', -9724=>'ON', -9725=>'ON', -9726=>'ON', -9727=>'ON', -9728=>'ON', -9729=>'ON', -9730=>'ON', -9731=>'ON', -9732=>'ON', -9733=>'ON', -9734=>'ON', -9735=>'ON', -9736=>'ON', -9737=>'ON', -9738=>'ON', -9739=>'ON', -9740=>'ON', -9741=>'ON', -9742=>'ON', -9743=>'ON', -9744=>'ON', -9745=>'ON', -9746=>'ON', -9747=>'ON', -9748=>'ON', -9749=>'ON', -9750=>'ON', -9751=>'ON', -9752=>'ON', -9753=>'ON', -9754=>'ON', -9755=>'ON', -9756=>'ON', -9757=>'ON', -9758=>'ON', -9759=>'ON', -9760=>'ON', -9761=>'ON', -9762=>'ON', -9763=>'ON', -9764=>'ON', -9765=>'ON', -9766=>'ON', -9767=>'ON', -9768=>'ON', -9769=>'ON', -9770=>'ON', -9771=>'ON', -9772=>'ON', -9773=>'ON', -9774=>'ON', -9775=>'ON', -9776=>'ON', -9777=>'ON', -9778=>'ON', -9779=>'ON', -9780=>'ON', -9781=>'ON', -9782=>'ON', -9783=>'ON', -9784=>'ON', -9785=>'ON', -9786=>'ON', -9787=>'ON', -9788=>'ON', -9789=>'ON', -9790=>'ON', -9791=>'ON', -9792=>'ON', -9793=>'ON', -9794=>'ON', -9795=>'ON', -9796=>'ON', -9797=>'ON', -9798=>'ON', -9799=>'ON', -9800=>'ON', -9801=>'ON', -9802=>'ON', -9803=>'ON', -9804=>'ON', -9805=>'ON', -9806=>'ON', -9807=>'ON', -9808=>'ON', -9809=>'ON', -9810=>'ON', -9811=>'ON', -9812=>'ON', -9813=>'ON', -9814=>'ON', -9815=>'ON', -9816=>'ON', -9817=>'ON', -9818=>'ON', -9819=>'ON', -9820=>'ON', -9821=>'ON', -9822=>'ON', -9823=>'ON', -9824=>'ON', -9825=>'ON', -9826=>'ON', -9827=>'ON', -9828=>'ON', -9829=>'ON', -9830=>'ON', -9831=>'ON', -9832=>'ON', -9833=>'ON', -9834=>'ON', -9835=>'ON', -9836=>'ON', -9837=>'ON', -9838=>'ON', -9839=>'ON', -9840=>'ON', -9841=>'ON', -9842=>'ON', -9843=>'ON', -9844=>'ON', -9845=>'ON', -9846=>'ON', -9847=>'ON', -9848=>'ON', -9849=>'ON', -9850=>'ON', -9851=>'ON', -9852=>'ON', -9853=>'ON', -9854=>'ON', -9855=>'ON', -9856=>'ON', -9857=>'ON', -9858=>'ON', -9859=>'ON', -9860=>'ON', -9861=>'ON', -9862=>'ON', -9863=>'ON', -9864=>'ON', -9865=>'ON', -9866=>'ON', -9867=>'ON', -9868=>'ON', -9869=>'ON', -9870=>'ON', -9871=>'ON', -9872=>'ON', -9873=>'ON', -9874=>'ON', -9875=>'ON', -9876=>'ON', -9877=>'ON', -9878=>'ON', -9879=>'ON', -9880=>'ON', -9881=>'ON', -9882=>'ON', -9883=>'ON', -9884=>'ON', -9888=>'ON', -9889=>'ON', -9890=>'ON', -9891=>'ON', -9892=>'ON', -9893=>'ON', -9894=>'ON', -9895=>'ON', -9896=>'ON', -9897=>'ON', -9898=>'ON', -9899=>'ON', -9900=>'L', -9901=>'ON', -9902=>'ON', -9903=>'ON', -9904=>'ON', -9905=>'ON', -9906=>'ON', -9985=>'ON', -9986=>'ON', -9987=>'ON', -9988=>'ON', -9990=>'ON', -9991=>'ON', -9992=>'ON', -9993=>'ON', -9996=>'ON', -9997=>'ON', -9998=>'ON', -9999=>'ON', -10000=>'ON', -10001=>'ON', -10002=>'ON', -10003=>'ON', -10004=>'ON', -10005=>'ON', -10006=>'ON', -10007=>'ON', -10008=>'ON', -10009=>'ON', -10010=>'ON', -10011=>'ON', -10012=>'ON', -10013=>'ON', -10014=>'ON', -10015=>'ON', -10016=>'ON', -10017=>'ON', -10018=>'ON', -10019=>'ON', -10020=>'ON', -10021=>'ON', -10022=>'ON', -10023=>'ON', -10025=>'ON', -10026=>'ON', -10027=>'ON', -10028=>'ON', -10029=>'ON', -10030=>'ON', -10031=>'ON', -10032=>'ON', -10033=>'ON', -10034=>'ON', -10035=>'ON', -10036=>'ON', -10037=>'ON', -10038=>'ON', -10039=>'ON', -10040=>'ON', -10041=>'ON', -10042=>'ON', -10043=>'ON', -10044=>'ON', -10045=>'ON', -10046=>'ON', -10047=>'ON', -10048=>'ON', -10049=>'ON', -10050=>'ON', -10051=>'ON', -10052=>'ON', -10053=>'ON', -10054=>'ON', -10055=>'ON', -10056=>'ON', -10057=>'ON', -10058=>'ON', -10059=>'ON', -10061=>'ON', -10063=>'ON', -10064=>'ON', -10065=>'ON', -10066=>'ON', -10070=>'ON', -10072=>'ON', -10073=>'ON', -10074=>'ON', -10075=>'ON', -10076=>'ON', -10077=>'ON', -10078=>'ON', -10081=>'ON', -10082=>'ON', -10083=>'ON', -10084=>'ON', -10085=>'ON', -10086=>'ON', -10087=>'ON', -10088=>'ON', -10089=>'ON', -10090=>'ON', -10091=>'ON', -10092=>'ON', -10093=>'ON', -10094=>'ON', -10095=>'ON', -10096=>'ON', -10097=>'ON', -10098=>'ON', -10099=>'ON', -10100=>'ON', -10101=>'ON', -10102=>'ON', -10103=>'ON', -10104=>'ON', -10105=>'ON', -10106=>'ON', -10107=>'ON', -10108=>'ON', -10109=>'ON', -10110=>'ON', -10111=>'ON', -10112=>'ON', -10113=>'ON', -10114=>'ON', -10115=>'ON', -10116=>'ON', -10117=>'ON', -10118=>'ON', -10119=>'ON', -10120=>'ON', -10121=>'ON', -10122=>'ON', -10123=>'ON', -10124=>'ON', -10125=>'ON', -10126=>'ON', -10127=>'ON', -10128=>'ON', -10129=>'ON', -10130=>'ON', -10131=>'ON', -10132=>'ON', -10136=>'ON', -10137=>'ON', -10138=>'ON', -10139=>'ON', -10140=>'ON', -10141=>'ON', -10142=>'ON', -10143=>'ON', -10144=>'ON', -10145=>'ON', -10146=>'ON', -10147=>'ON', -10148=>'ON', -10149=>'ON', -10150=>'ON', -10151=>'ON', -10152=>'ON', -10153=>'ON', -10154=>'ON', -10155=>'ON', -10156=>'ON', -10157=>'ON', -10158=>'ON', -10159=>'ON', -10161=>'ON', -10162=>'ON', -10163=>'ON', -10164=>'ON', -10165=>'ON', -10166=>'ON', -10167=>'ON', -10168=>'ON', -10169=>'ON', -10170=>'ON', -10171=>'ON', -10172=>'ON', -10173=>'ON', -10174=>'ON', -10176=>'ON', -10177=>'ON', -10178=>'ON', -10179=>'ON', -10180=>'ON', -10181=>'ON', -10182=>'ON', -10183=>'ON', -10184=>'ON', -10185=>'ON', -10186=>'ON', -10192=>'ON', -10193=>'ON', -10194=>'ON', -10195=>'ON', -10196=>'ON', -10197=>'ON', -10198=>'ON', -10199=>'ON', -10200=>'ON', -10201=>'ON', -10202=>'ON', -10203=>'ON', -10204=>'ON', -10205=>'ON', -10206=>'ON', -10207=>'ON', -10208=>'ON', -10209=>'ON', -10210=>'ON', -10211=>'ON', -10212=>'ON', -10213=>'ON', -10214=>'ON', -10215=>'ON', -10216=>'ON', -10217=>'ON', -10218=>'ON', -10219=>'ON', -10224=>'ON', -10225=>'ON', -10226=>'ON', -10227=>'ON', -10228=>'ON', -10229=>'ON', -10230=>'ON', -10231=>'ON', -10232=>'ON', -10233=>'ON', -10234=>'ON', -10235=>'ON', -10236=>'ON', -10237=>'ON', -10238=>'ON', -10239=>'ON', -10240=>'L', -10241=>'L', -10242=>'L', -10243=>'L', -10244=>'L', -10245=>'L', -10246=>'L', -10247=>'L', -10248=>'L', -10249=>'L', -10250=>'L', -10251=>'L', -10252=>'L', -10253=>'L', -10254=>'L', -10255=>'L', -10256=>'L', -10257=>'L', -10258=>'L', -10259=>'L', -10260=>'L', -10261=>'L', -10262=>'L', -10263=>'L', -10264=>'L', -10265=>'L', -10266=>'L', -10267=>'L', -10268=>'L', -10269=>'L', -10270=>'L', -10271=>'L', -10272=>'L', -10273=>'L', -10274=>'L', -10275=>'L', -10276=>'L', -10277=>'L', -10278=>'L', -10279=>'L', -10280=>'L', -10281=>'L', -10282=>'L', -10283=>'L', -10284=>'L', -10285=>'L', -10286=>'L', -10287=>'L', -10288=>'L', -10289=>'L', -10290=>'L', -10291=>'L', -10292=>'L', -10293=>'L', -10294=>'L', -10295=>'L', -10296=>'L', -10297=>'L', -10298=>'L', -10299=>'L', -10300=>'L', -10301=>'L', -10302=>'L', -10303=>'L', -10304=>'L', -10305=>'L', -10306=>'L', -10307=>'L', -10308=>'L', -10309=>'L', -10310=>'L', -10311=>'L', -10312=>'L', -10313=>'L', -10314=>'L', -10315=>'L', -10316=>'L', -10317=>'L', -10318=>'L', -10319=>'L', -10320=>'L', -10321=>'L', -10322=>'L', -10323=>'L', -10324=>'L', -10325=>'L', -10326=>'L', -10327=>'L', -10328=>'L', -10329=>'L', -10330=>'L', -10331=>'L', -10332=>'L', -10333=>'L', -10334=>'L', -10335=>'L', -10336=>'L', -10337=>'L', -10338=>'L', -10339=>'L', -10340=>'L', -10341=>'L', -10342=>'L', -10343=>'L', -10344=>'L', -10345=>'L', -10346=>'L', -10347=>'L', -10348=>'L', -10349=>'L', -10350=>'L', -10351=>'L', -10352=>'L', -10353=>'L', -10354=>'L', -10355=>'L', -10356=>'L', -10357=>'L', -10358=>'L', -10359=>'L', -10360=>'L', -10361=>'L', -10362=>'L', -10363=>'L', -10364=>'L', -10365=>'L', -10366=>'L', -10367=>'L', -10368=>'L', -10369=>'L', -10370=>'L', -10371=>'L', -10372=>'L', -10373=>'L', -10374=>'L', -10375=>'L', -10376=>'L', -10377=>'L', -10378=>'L', -10379=>'L', -10380=>'L', -10381=>'L', -10382=>'L', -10383=>'L', -10384=>'L', -10385=>'L', -10386=>'L', -10387=>'L', -10388=>'L', -10389=>'L', -10390=>'L', -10391=>'L', -10392=>'L', -10393=>'L', -10394=>'L', -10395=>'L', -10396=>'L', -10397=>'L', -10398=>'L', -10399=>'L', -10400=>'L', -10401=>'L', -10402=>'L', -10403=>'L', -10404=>'L', -10405=>'L', -10406=>'L', -10407=>'L', -10408=>'L', -10409=>'L', -10410=>'L', -10411=>'L', -10412=>'L', -10413=>'L', -10414=>'L', -10415=>'L', -10416=>'L', -10417=>'L', -10418=>'L', -10419=>'L', -10420=>'L', -10421=>'L', -10422=>'L', -10423=>'L', -10424=>'L', -10425=>'L', -10426=>'L', -10427=>'L', -10428=>'L', -10429=>'L', -10430=>'L', -10431=>'L', -10432=>'L', -10433=>'L', -10434=>'L', -10435=>'L', -10436=>'L', -10437=>'L', -10438=>'L', -10439=>'L', -10440=>'L', -10441=>'L', -10442=>'L', -10443=>'L', -10444=>'L', -10445=>'L', -10446=>'L', -10447=>'L', -10448=>'L', -10449=>'L', -10450=>'L', -10451=>'L', -10452=>'L', -10453=>'L', -10454=>'L', -10455=>'L', -10456=>'L', -10457=>'L', -10458=>'L', -10459=>'L', -10460=>'L', -10461=>'L', -10462=>'L', -10463=>'L', -10464=>'L', -10465=>'L', -10466=>'L', -10467=>'L', -10468=>'L', -10469=>'L', -10470=>'L', -10471=>'L', -10472=>'L', -10473=>'L', -10474=>'L', -10475=>'L', -10476=>'L', -10477=>'L', -10478=>'L', -10479=>'L', -10480=>'L', -10481=>'L', -10482=>'L', -10483=>'L', -10484=>'L', -10485=>'L', -10486=>'L', -10487=>'L', -10488=>'L', -10489=>'L', -10490=>'L', -10491=>'L', -10492=>'L', -10493=>'L', -10494=>'L', -10495=>'L', -10496=>'ON', -10497=>'ON', -10498=>'ON', -10499=>'ON', -10500=>'ON', -10501=>'ON', -10502=>'ON', -10503=>'ON', -10504=>'ON', -10505=>'ON', -10506=>'ON', -10507=>'ON', -10508=>'ON', -10509=>'ON', -10510=>'ON', -10511=>'ON', -10512=>'ON', -10513=>'ON', -10514=>'ON', -10515=>'ON', -10516=>'ON', -10517=>'ON', -10518=>'ON', -10519=>'ON', -10520=>'ON', -10521=>'ON', -10522=>'ON', -10523=>'ON', -10524=>'ON', -10525=>'ON', -10526=>'ON', -10527=>'ON', -10528=>'ON', -10529=>'ON', -10530=>'ON', -10531=>'ON', -10532=>'ON', -10533=>'ON', -10534=>'ON', -10535=>'ON', -10536=>'ON', -10537=>'ON', -10538=>'ON', -10539=>'ON', -10540=>'ON', -10541=>'ON', -10542=>'ON', -10543=>'ON', -10544=>'ON', -10545=>'ON', -10546=>'ON', -10547=>'ON', -10548=>'ON', -10549=>'ON', -10550=>'ON', -10551=>'ON', -10552=>'ON', -10553=>'ON', -10554=>'ON', -10555=>'ON', -10556=>'ON', -10557=>'ON', -10558=>'ON', -10559=>'ON', -10560=>'ON', -10561=>'ON', -10562=>'ON', -10563=>'ON', -10564=>'ON', -10565=>'ON', -10566=>'ON', -10567=>'ON', -10568=>'ON', -10569=>'ON', -10570=>'ON', -10571=>'ON', -10572=>'ON', -10573=>'ON', -10574=>'ON', -10575=>'ON', -10576=>'ON', -10577=>'ON', -10578=>'ON', -10579=>'ON', -10580=>'ON', -10581=>'ON', -10582=>'ON', -10583=>'ON', -10584=>'ON', -10585=>'ON', -10586=>'ON', -10587=>'ON', -10588=>'ON', -10589=>'ON', -10590=>'ON', -10591=>'ON', -10592=>'ON', -10593=>'ON', -10594=>'ON', -10595=>'ON', -10596=>'ON', -10597=>'ON', -10598=>'ON', -10599=>'ON', -10600=>'ON', -10601=>'ON', -10602=>'ON', -10603=>'ON', -10604=>'ON', -10605=>'ON', -10606=>'ON', -10607=>'ON', -10608=>'ON', -10609=>'ON', -10610=>'ON', -10611=>'ON', -10612=>'ON', -10613=>'ON', -10614=>'ON', -10615=>'ON', -10616=>'ON', -10617=>'ON', -10618=>'ON', -10619=>'ON', -10620=>'ON', -10621=>'ON', -10622=>'ON', -10623=>'ON', -10624=>'ON', -10625=>'ON', -10626=>'ON', -10627=>'ON', -10628=>'ON', -10629=>'ON', -10630=>'ON', -10631=>'ON', -10632=>'ON', -10633=>'ON', -10634=>'ON', -10635=>'ON', -10636=>'ON', -10637=>'ON', -10638=>'ON', -10639=>'ON', -10640=>'ON', -10641=>'ON', -10642=>'ON', -10643=>'ON', -10644=>'ON', -10645=>'ON', -10646=>'ON', -10647=>'ON', -10648=>'ON', -10649=>'ON', -10650=>'ON', -10651=>'ON', -10652=>'ON', -10653=>'ON', -10654=>'ON', -10655=>'ON', -10656=>'ON', -10657=>'ON', -10658=>'ON', -10659=>'ON', -10660=>'ON', -10661=>'ON', -10662=>'ON', -10663=>'ON', -10664=>'ON', -10665=>'ON', -10666=>'ON', -10667=>'ON', -10668=>'ON', -10669=>'ON', -10670=>'ON', -10671=>'ON', -10672=>'ON', -10673=>'ON', -10674=>'ON', -10675=>'ON', -10676=>'ON', -10677=>'ON', -10678=>'ON', -10679=>'ON', -10680=>'ON', -10681=>'ON', -10682=>'ON', -10683=>'ON', -10684=>'ON', -10685=>'ON', -10686=>'ON', -10687=>'ON', -10688=>'ON', -10689=>'ON', -10690=>'ON', -10691=>'ON', -10692=>'ON', -10693=>'ON', -10694=>'ON', -10695=>'ON', -10696=>'ON', -10697=>'ON', -10698=>'ON', -10699=>'ON', -10700=>'ON', -10701=>'ON', -10702=>'ON', -10703=>'ON', -10704=>'ON', -10705=>'ON', -10706=>'ON', -10707=>'ON', -10708=>'ON', -10709=>'ON', -10710=>'ON', -10711=>'ON', -10712=>'ON', -10713=>'ON', -10714=>'ON', -10715=>'ON', -10716=>'ON', -10717=>'ON', -10718=>'ON', -10719=>'ON', -10720=>'ON', -10721=>'ON', -10722=>'ON', -10723=>'ON', -10724=>'ON', -10725=>'ON', -10726=>'ON', -10727=>'ON', -10728=>'ON', -10729=>'ON', -10730=>'ON', -10731=>'ON', -10732=>'ON', -10733=>'ON', -10734=>'ON', -10735=>'ON', -10736=>'ON', -10737=>'ON', -10738=>'ON', -10739=>'ON', -10740=>'ON', -10741=>'ON', -10742=>'ON', -10743=>'ON', -10744=>'ON', -10745=>'ON', -10746=>'ON', -10747=>'ON', -10748=>'ON', -10749=>'ON', -10750=>'ON', -10751=>'ON', -10752=>'ON', -10753=>'ON', -10754=>'ON', -10755=>'ON', -10756=>'ON', -10757=>'ON', -10758=>'ON', -10759=>'ON', -10760=>'ON', -10761=>'ON', -10762=>'ON', -10763=>'ON', -10764=>'ON', -10765=>'ON', -10766=>'ON', -10767=>'ON', -10768=>'ON', -10769=>'ON', -10770=>'ON', -10771=>'ON', -10772=>'ON', -10773=>'ON', -10774=>'ON', -10775=>'ON', -10776=>'ON', -10777=>'ON', -10778=>'ON', -10779=>'ON', -10780=>'ON', -10781=>'ON', -10782=>'ON', -10783=>'ON', -10784=>'ON', -10785=>'ON', -10786=>'ON', -10787=>'ON', -10788=>'ON', -10789=>'ON', -10790=>'ON', -10791=>'ON', -10792=>'ON', -10793=>'ON', -10794=>'ON', -10795=>'ON', -10796=>'ON', -10797=>'ON', -10798=>'ON', -10799=>'ON', -10800=>'ON', -10801=>'ON', -10802=>'ON', -10803=>'ON', -10804=>'ON', -10805=>'ON', -10806=>'ON', -10807=>'ON', -10808=>'ON', -10809=>'ON', -10810=>'ON', -10811=>'ON', -10812=>'ON', -10813=>'ON', -10814=>'ON', -10815=>'ON', -10816=>'ON', -10817=>'ON', -10818=>'ON', -10819=>'ON', -10820=>'ON', -10821=>'ON', -10822=>'ON', -10823=>'ON', -10824=>'ON', -10825=>'ON', -10826=>'ON', -10827=>'ON', -10828=>'ON', -10829=>'ON', -10830=>'ON', -10831=>'ON', -10832=>'ON', -10833=>'ON', -10834=>'ON', -10835=>'ON', -10836=>'ON', -10837=>'ON', -10838=>'ON', -10839=>'ON', -10840=>'ON', -10841=>'ON', -10842=>'ON', -10843=>'ON', -10844=>'ON', -10845=>'ON', -10846=>'ON', -10847=>'ON', -10848=>'ON', -10849=>'ON', -10850=>'ON', -10851=>'ON', -10852=>'ON', -10853=>'ON', -10854=>'ON', -10855=>'ON', -10856=>'ON', -10857=>'ON', -10858=>'ON', -10859=>'ON', -10860=>'ON', -10861=>'ON', -10862=>'ON', -10863=>'ON', -10864=>'ON', -10865=>'ON', -10866=>'ON', -10867=>'ON', -10868=>'ON', -10869=>'ON', -10870=>'ON', -10871=>'ON', -10872=>'ON', -10873=>'ON', -10874=>'ON', -10875=>'ON', -10876=>'ON', -10877=>'ON', -10878=>'ON', -10879=>'ON', -10880=>'ON', -10881=>'ON', -10882=>'ON', -10883=>'ON', -10884=>'ON', -10885=>'ON', -10886=>'ON', -10887=>'ON', -10888=>'ON', -10889=>'ON', -10890=>'ON', -10891=>'ON', -10892=>'ON', -10893=>'ON', -10894=>'ON', -10895=>'ON', -10896=>'ON', -10897=>'ON', -10898=>'ON', -10899=>'ON', -10900=>'ON', -10901=>'ON', -10902=>'ON', -10903=>'ON', -10904=>'ON', -10905=>'ON', -10906=>'ON', -10907=>'ON', -10908=>'ON', -10909=>'ON', -10910=>'ON', -10911=>'ON', -10912=>'ON', -10913=>'ON', -10914=>'ON', -10915=>'ON', -10916=>'ON', -10917=>'ON', -10918=>'ON', -10919=>'ON', -10920=>'ON', -10921=>'ON', -10922=>'ON', -10923=>'ON', -10924=>'ON', -10925=>'ON', -10926=>'ON', -10927=>'ON', -10928=>'ON', -10929=>'ON', -10930=>'ON', -10931=>'ON', -10932=>'ON', -10933=>'ON', -10934=>'ON', -10935=>'ON', -10936=>'ON', -10937=>'ON', -10938=>'ON', -10939=>'ON', -10940=>'ON', -10941=>'ON', -10942=>'ON', -10943=>'ON', -10944=>'ON', -10945=>'ON', -10946=>'ON', -10947=>'ON', -10948=>'ON', -10949=>'ON', -10950=>'ON', -10951=>'ON', -10952=>'ON', -10953=>'ON', -10954=>'ON', -10955=>'ON', -10956=>'ON', -10957=>'ON', -10958=>'ON', -10959=>'ON', -10960=>'ON', -10961=>'ON', -10962=>'ON', -10963=>'ON', -10964=>'ON', -10965=>'ON', -10966=>'ON', -10967=>'ON', -10968=>'ON', -10969=>'ON', -10970=>'ON', -10971=>'ON', -10972=>'ON', -10973=>'ON', -10974=>'ON', -10975=>'ON', -10976=>'ON', -10977=>'ON', -10978=>'ON', -10979=>'ON', -10980=>'ON', -10981=>'ON', -10982=>'ON', -10983=>'ON', -10984=>'ON', -10985=>'ON', -10986=>'ON', -10987=>'ON', -10988=>'ON', -10989=>'ON', -10990=>'ON', -10991=>'ON', -10992=>'ON', -10993=>'ON', -10994=>'ON', -10995=>'ON', -10996=>'ON', -10997=>'ON', -10998=>'ON', -10999=>'ON', -11000=>'ON', -11001=>'ON', -11002=>'ON', -11003=>'ON', -11004=>'ON', -11005=>'ON', -11006=>'ON', -11007=>'ON', -11008=>'ON', -11009=>'ON', -11010=>'ON', -11011=>'ON', -11012=>'ON', -11013=>'ON', -11014=>'ON', -11015=>'ON', -11016=>'ON', -11017=>'ON', -11018=>'ON', -11019=>'ON', -11020=>'ON', -11021=>'ON', -11022=>'ON', -11023=>'ON', -11024=>'ON', -11025=>'ON', -11026=>'ON', -11027=>'ON', -11028=>'ON', -11029=>'ON', -11030=>'ON', -11031=>'ON', -11032=>'ON', -11033=>'ON', -11034=>'ON', -11040=>'ON', -11041=>'ON', -11042=>'ON', -11043=>'ON', -11264=>'L', -11265=>'L', -11266=>'L', -11267=>'L', -11268=>'L', -11269=>'L', -11270=>'L', -11271=>'L', -11272=>'L', -11273=>'L', -11274=>'L', -11275=>'L', -11276=>'L', -11277=>'L', -11278=>'L', -11279=>'L', -11280=>'L', -11281=>'L', -11282=>'L', -11283=>'L', -11284=>'L', -11285=>'L', -11286=>'L', -11287=>'L', -11288=>'L', -11289=>'L', -11290=>'L', -11291=>'L', -11292=>'L', -11293=>'L', -11294=>'L', -11295=>'L', -11296=>'L', -11297=>'L', -11298=>'L', -11299=>'L', -11300=>'L', -11301=>'L', -11302=>'L', -11303=>'L', -11304=>'L', -11305=>'L', -11306=>'L', -11307=>'L', -11308=>'L', -11309=>'L', -11310=>'L', -11312=>'L', -11313=>'L', -11314=>'L', -11315=>'L', -11316=>'L', -11317=>'L', -11318=>'L', -11319=>'L', -11320=>'L', -11321=>'L', -11322=>'L', -11323=>'L', -11324=>'L', -11325=>'L', -11326=>'L', -11327=>'L', -11328=>'L', -11329=>'L', -11330=>'L', -11331=>'L', -11332=>'L', -11333=>'L', -11334=>'L', -11335=>'L', -11336=>'L', -11337=>'L', -11338=>'L', -11339=>'L', -11340=>'L', -11341=>'L', -11342=>'L', -11343=>'L', -11344=>'L', -11345=>'L', -11346=>'L', -11347=>'L', -11348=>'L', -11349=>'L', -11350=>'L', -11351=>'L', -11352=>'L', -11353=>'L', -11354=>'L', -11355=>'L', -11356=>'L', -11357=>'L', -11358=>'L', -11360=>'L', -11361=>'L', -11362=>'L', -11363=>'L', -11364=>'L', -11365=>'L', -11366=>'L', -11367=>'L', -11368=>'L', -11369=>'L', -11370=>'L', -11371=>'L', -11372=>'L', -11380=>'L', -11381=>'L', -11382=>'L', -11383=>'L', -11392=>'L', -11393=>'L', -11394=>'L', -11395=>'L', -11396=>'L', -11397=>'L', -11398=>'L', -11399=>'L', -11400=>'L', -11401=>'L', -11402=>'L', -11403=>'L', -11404=>'L', -11405=>'L', -11406=>'L', -11407=>'L', -11408=>'L', -11409=>'L', -11410=>'L', -11411=>'L', -11412=>'L', -11413=>'L', -11414=>'L', -11415=>'L', -11416=>'L', -11417=>'L', -11418=>'L', -11419=>'L', -11420=>'L', -11421=>'L', -11422=>'L', -11423=>'L', -11424=>'L', -11425=>'L', -11426=>'L', -11427=>'L', -11428=>'L', -11429=>'L', -11430=>'L', -11431=>'L', -11432=>'L', -11433=>'L', -11434=>'L', -11435=>'L', -11436=>'L', -11437=>'L', -11438=>'L', -11439=>'L', -11440=>'L', -11441=>'L', -11442=>'L', -11443=>'L', -11444=>'L', -11445=>'L', -11446=>'L', -11447=>'L', -11448=>'L', -11449=>'L', -11450=>'L', -11451=>'L', -11452=>'L', -11453=>'L', -11454=>'L', -11455=>'L', -11456=>'L', -11457=>'L', -11458=>'L', -11459=>'L', -11460=>'L', -11461=>'L', -11462=>'L', -11463=>'L', -11464=>'L', -11465=>'L', -11466=>'L', -11467=>'L', -11468=>'L', -11469=>'L', -11470=>'L', -11471=>'L', -11472=>'L', -11473=>'L', -11474=>'L', -11475=>'L', -11476=>'L', -11477=>'L', -11478=>'L', -11479=>'L', -11480=>'L', -11481=>'L', -11482=>'L', -11483=>'L', -11484=>'L', -11485=>'L', -11486=>'L', -11487=>'L', -11488=>'L', -11489=>'L', -11490=>'L', -11491=>'L', -11492=>'L', -11493=>'ON', -11494=>'ON', -11495=>'ON', -11496=>'ON', -11497=>'ON', -11498=>'ON', -11513=>'ON', -11514=>'ON', -11515=>'ON', -11516=>'ON', -11517=>'ON', -11518=>'ON', -11519=>'ON', -11520=>'L', -11521=>'L', -11522=>'L', -11523=>'L', -11524=>'L', -11525=>'L', -11526=>'L', -11527=>'L', -11528=>'L', -11529=>'L', -11530=>'L', -11531=>'L', -11532=>'L', -11533=>'L', -11534=>'L', -11535=>'L', -11536=>'L', -11537=>'L', -11538=>'L', -11539=>'L', -11540=>'L', -11541=>'L', -11542=>'L', -11543=>'L', -11544=>'L', -11545=>'L', -11546=>'L', -11547=>'L', -11548=>'L', -11549=>'L', -11550=>'L', -11551=>'L', -11552=>'L', -11553=>'L', -11554=>'L', -11555=>'L', -11556=>'L', -11557=>'L', -11568=>'L', -11569=>'L', -11570=>'L', -11571=>'L', -11572=>'L', -11573=>'L', -11574=>'L', -11575=>'L', -11576=>'L', -11577=>'L', -11578=>'L', -11579=>'L', -11580=>'L', -11581=>'L', -11582=>'L', -11583=>'L', -11584=>'L', -11585=>'L', -11586=>'L', -11587=>'L', -11588=>'L', -11589=>'L', -11590=>'L', -11591=>'L', -11592=>'L', -11593=>'L', -11594=>'L', -11595=>'L', -11596=>'L', -11597=>'L', -11598=>'L', -11599=>'L', -11600=>'L', -11601=>'L', -11602=>'L', -11603=>'L', -11604=>'L', -11605=>'L', -11606=>'L', -11607=>'L', -11608=>'L', -11609=>'L', -11610=>'L', -11611=>'L', -11612=>'L', -11613=>'L', -11614=>'L', -11615=>'L', -11616=>'L', -11617=>'L', -11618=>'L', -11619=>'L', -11620=>'L', -11621=>'L', -11631=>'L', -11648=>'L', -11649=>'L', -11650=>'L', -11651=>'L', -11652=>'L', -11653=>'L', -11654=>'L', -11655=>'L', -11656=>'L', -11657=>'L', -11658=>'L', -11659=>'L', -11660=>'L', -11661=>'L', -11662=>'L', -11663=>'L', -11664=>'L', -11665=>'L', -11666=>'L', -11667=>'L', -11668=>'L', -11669=>'L', -11670=>'L', -11680=>'L', -11681=>'L', -11682=>'L', -11683=>'L', -11684=>'L', -11685=>'L', -11686=>'L', -11688=>'L', -11689=>'L', -11690=>'L', -11691=>'L', -11692=>'L', -11693=>'L', -11694=>'L', -11696=>'L', -11697=>'L', -11698=>'L', -11699=>'L', -11700=>'L', -11701=>'L', -11702=>'L', -11704=>'L', -11705=>'L', -11706=>'L', -11707=>'L', -11708=>'L', -11709=>'L', -11710=>'L', -11712=>'L', -11713=>'L', -11714=>'L', -11715=>'L', -11716=>'L', -11717=>'L', -11718=>'L', -11720=>'L', -11721=>'L', -11722=>'L', -11723=>'L', -11724=>'L', -11725=>'L', -11726=>'L', -11728=>'L', -11729=>'L', -11730=>'L', -11731=>'L', -11732=>'L', -11733=>'L', -11734=>'L', -11736=>'L', -11737=>'L', -11738=>'L', -11739=>'L', -11740=>'L', -11741=>'L', -11742=>'L', -11776=>'ON', -11777=>'ON', -11778=>'ON', -11779=>'ON', -11780=>'ON', -11781=>'ON', -11782=>'ON', -11783=>'ON', -11784=>'ON', -11785=>'ON', -11786=>'ON', -11787=>'ON', -11788=>'ON', -11789=>'ON', -11790=>'ON', -11791=>'ON', -11792=>'ON', -11793=>'ON', -11794=>'ON', -11795=>'ON', -11796=>'ON', -11797=>'ON', -11798=>'ON', -11799=>'ON', -11804=>'ON', -11805=>'ON', -11904=>'ON', -11905=>'ON', -11906=>'ON', -11907=>'ON', -11908=>'ON', -11909=>'ON', -11910=>'ON', -11911=>'ON', -11912=>'ON', -11913=>'ON', -11914=>'ON', -11915=>'ON', -11916=>'ON', -11917=>'ON', -11918=>'ON', -11919=>'ON', -11920=>'ON', -11921=>'ON', -11922=>'ON', -11923=>'ON', -11924=>'ON', -11925=>'ON', -11926=>'ON', -11927=>'ON', -11928=>'ON', -11929=>'ON', -11931=>'ON', -11932=>'ON', -11933=>'ON', -11934=>'ON', -11935=>'ON', -11936=>'ON', -11937=>'ON', -11938=>'ON', -11939=>'ON', -11940=>'ON', -11941=>'ON', -11942=>'ON', -11943=>'ON', -11944=>'ON', -11945=>'ON', -11946=>'ON', -11947=>'ON', -11948=>'ON', -11949=>'ON', -11950=>'ON', -11951=>'ON', -11952=>'ON', -11953=>'ON', -11954=>'ON', -11955=>'ON', -11956=>'ON', -11957=>'ON', -11958=>'ON', -11959=>'ON', -11960=>'ON', -11961=>'ON', -11962=>'ON', -11963=>'ON', -11964=>'ON', -11965=>'ON', -11966=>'ON', -11967=>'ON', -11968=>'ON', -11969=>'ON', -11970=>'ON', -11971=>'ON', -11972=>'ON', -11973=>'ON', -11974=>'ON', -11975=>'ON', -11976=>'ON', -11977=>'ON', -11978=>'ON', -11979=>'ON', -11980=>'ON', -11981=>'ON', -11982=>'ON', -11983=>'ON', -11984=>'ON', -11985=>'ON', -11986=>'ON', -11987=>'ON', -11988=>'ON', -11989=>'ON', -11990=>'ON', -11991=>'ON', -11992=>'ON', -11993=>'ON', -11994=>'ON', -11995=>'ON', -11996=>'ON', -11997=>'ON', -11998=>'ON', -11999=>'ON', -12000=>'ON', -12001=>'ON', -12002=>'ON', -12003=>'ON', -12004=>'ON', -12005=>'ON', -12006=>'ON', -12007=>'ON', -12008=>'ON', -12009=>'ON', -12010=>'ON', -12011=>'ON', -12012=>'ON', -12013=>'ON', -12014=>'ON', -12015=>'ON', -12016=>'ON', -12017=>'ON', -12018=>'ON', -12019=>'ON', -12032=>'ON', -12033=>'ON', -12034=>'ON', -12035=>'ON', -12036=>'ON', -12037=>'ON', -12038=>'ON', -12039=>'ON', -12040=>'ON', -12041=>'ON', -12042=>'ON', -12043=>'ON', -12044=>'ON', -12045=>'ON', -12046=>'ON', -12047=>'ON', -12048=>'ON', -12049=>'ON', -12050=>'ON', -12051=>'ON', -12052=>'ON', -12053=>'ON', -12054=>'ON', -12055=>'ON', -12056=>'ON', -12057=>'ON', -12058=>'ON', -12059=>'ON', -12060=>'ON', -12061=>'ON', -12062=>'ON', -12063=>'ON', -12064=>'ON', -12065=>'ON', -12066=>'ON', -12067=>'ON', -12068=>'ON', -12069=>'ON', -12070=>'ON', -12071=>'ON', -12072=>'ON', -12073=>'ON', -12074=>'ON', -12075=>'ON', -12076=>'ON', -12077=>'ON', -12078=>'ON', -12079=>'ON', -12080=>'ON', -12081=>'ON', -12082=>'ON', -12083=>'ON', -12084=>'ON', -12085=>'ON', -12086=>'ON', -12087=>'ON', -12088=>'ON', -12089=>'ON', -12090=>'ON', -12091=>'ON', -12092=>'ON', -12093=>'ON', -12094=>'ON', -12095=>'ON', -12096=>'ON', -12097=>'ON', -12098=>'ON', -12099=>'ON', -12100=>'ON', -12101=>'ON', -12102=>'ON', -12103=>'ON', -12104=>'ON', -12105=>'ON', -12106=>'ON', -12107=>'ON', -12108=>'ON', -12109=>'ON', -12110=>'ON', -12111=>'ON', -12112=>'ON', -12113=>'ON', -12114=>'ON', -12115=>'ON', -12116=>'ON', -12117=>'ON', -12118=>'ON', -12119=>'ON', -12120=>'ON', -12121=>'ON', -12122=>'ON', -12123=>'ON', -12124=>'ON', -12125=>'ON', -12126=>'ON', -12127=>'ON', -12128=>'ON', -12129=>'ON', -12130=>'ON', -12131=>'ON', -12132=>'ON', -12133=>'ON', -12134=>'ON', -12135=>'ON', -12136=>'ON', -12137=>'ON', -12138=>'ON', -12139=>'ON', -12140=>'ON', -12141=>'ON', -12142=>'ON', -12143=>'ON', -12144=>'ON', -12145=>'ON', -12146=>'ON', -12147=>'ON', -12148=>'ON', -12149=>'ON', -12150=>'ON', -12151=>'ON', -12152=>'ON', -12153=>'ON', -12154=>'ON', -12155=>'ON', -12156=>'ON', -12157=>'ON', -12158=>'ON', -12159=>'ON', -12160=>'ON', -12161=>'ON', -12162=>'ON', -12163=>'ON', -12164=>'ON', -12165=>'ON', -12166=>'ON', -12167=>'ON', -12168=>'ON', -12169=>'ON', -12170=>'ON', -12171=>'ON', -12172=>'ON', -12173=>'ON', -12174=>'ON', -12175=>'ON', -12176=>'ON', -12177=>'ON', -12178=>'ON', -12179=>'ON', -12180=>'ON', -12181=>'ON', -12182=>'ON', -12183=>'ON', -12184=>'ON', -12185=>'ON', -12186=>'ON', -12187=>'ON', -12188=>'ON', -12189=>'ON', -12190=>'ON', -12191=>'ON', -12192=>'ON', -12193=>'ON', -12194=>'ON', -12195=>'ON', -12196=>'ON', -12197=>'ON', -12198=>'ON', -12199=>'ON', -12200=>'ON', -12201=>'ON', -12202=>'ON', -12203=>'ON', -12204=>'ON', -12205=>'ON', -12206=>'ON', -12207=>'ON', -12208=>'ON', -12209=>'ON', -12210=>'ON', -12211=>'ON', -12212=>'ON', -12213=>'ON', -12214=>'ON', -12215=>'ON', -12216=>'ON', -12217=>'ON', -12218=>'ON', -12219=>'ON', -12220=>'ON', -12221=>'ON', -12222=>'ON', -12223=>'ON', -12224=>'ON', -12225=>'ON', -12226=>'ON', -12227=>'ON', -12228=>'ON', -12229=>'ON', -12230=>'ON', -12231=>'ON', -12232=>'ON', -12233=>'ON', -12234=>'ON', -12235=>'ON', -12236=>'ON', -12237=>'ON', -12238=>'ON', -12239=>'ON', -12240=>'ON', -12241=>'ON', -12242=>'ON', -12243=>'ON', -12244=>'ON', -12245=>'ON', -12272=>'ON', -12273=>'ON', -12274=>'ON', -12275=>'ON', -12276=>'ON', -12277=>'ON', -12278=>'ON', -12279=>'ON', -12280=>'ON', -12281=>'ON', -12282=>'ON', -12283=>'ON', -12288=>'WS', -12289=>'ON', -12290=>'ON', -12291=>'ON', -12292=>'ON', -12293=>'L', -12294=>'L', -12295=>'L', -12296=>'ON', -12297=>'ON', -12298=>'ON', -12299=>'ON', -12300=>'ON', -12301=>'ON', -12302=>'ON', -12303=>'ON', -12304=>'ON', -12305=>'ON', -12306=>'ON', -12307=>'ON', -12308=>'ON', -12309=>'ON', -12310=>'ON', -12311=>'ON', -12312=>'ON', -12313=>'ON', -12314=>'ON', -12315=>'ON', -12316=>'ON', -12317=>'ON', -12318=>'ON', -12319=>'ON', -12320=>'ON', -12321=>'L', -12322=>'L', -12323=>'L', -12324=>'L', -12325=>'L', -12326=>'L', -12327=>'L', -12328=>'L', -12329=>'L', -12330=>'NSM', -12331=>'NSM', -12332=>'NSM', -12333=>'NSM', -12334=>'NSM', -12335=>'NSM', -12336=>'ON', -12337=>'L', -12338=>'L', -12339=>'L', -12340=>'L', -12341=>'L', -12342=>'ON', -12343=>'ON', -12344=>'L', -12345=>'L', -12346=>'L', -12347=>'L', -12348=>'L', -12349=>'ON', -12350=>'ON', -12351=>'ON', -12353=>'L', -12354=>'L', -12355=>'L', -12356=>'L', -12357=>'L', -12358=>'L', -12359=>'L', -12360=>'L', -12361=>'L', -12362=>'L', -12363=>'L', -12364=>'L', -12365=>'L', -12366=>'L', -12367=>'L', -12368=>'L', -12369=>'L', -12370=>'L', -12371=>'L', -12372=>'L', -12373=>'L', -12374=>'L', -12375=>'L', -12376=>'L', -12377=>'L', -12378=>'L', -12379=>'L', -12380=>'L', -12381=>'L', -12382=>'L', -12383=>'L', -12384=>'L', -12385=>'L', -12386=>'L', -12387=>'L', -12388=>'L', -12389=>'L', -12390=>'L', -12391=>'L', -12392=>'L', -12393=>'L', -12394=>'L', -12395=>'L', -12396=>'L', -12397=>'L', -12398=>'L', -12399=>'L', -12400=>'L', -12401=>'L', -12402=>'L', -12403=>'L', -12404=>'L', -12405=>'L', -12406=>'L', -12407=>'L', -12408=>'L', -12409=>'L', -12410=>'L', -12411=>'L', -12412=>'L', -12413=>'L', -12414=>'L', -12415=>'L', -12416=>'L', -12417=>'L', -12418=>'L', -12419=>'L', -12420=>'L', -12421=>'L', -12422=>'L', -12423=>'L', -12424=>'L', -12425=>'L', -12426=>'L', -12427=>'L', -12428=>'L', -12429=>'L', -12430=>'L', -12431=>'L', -12432=>'L', -12433=>'L', -12434=>'L', -12435=>'L', -12436=>'L', -12437=>'L', -12438=>'L', -12441=>'NSM', -12442=>'NSM', -12443=>'ON', -12444=>'ON', -12445=>'L', -12446=>'L', -12447=>'L', -12448=>'ON', -12449=>'L', -12450=>'L', -12451=>'L', -12452=>'L', -12453=>'L', -12454=>'L', -12455=>'L', -12456=>'L', -12457=>'L', -12458=>'L', -12459=>'L', -12460=>'L', -12461=>'L', -12462=>'L', -12463=>'L', -12464=>'L', -12465=>'L', -12466=>'L', -12467=>'L', -12468=>'L', -12469=>'L', -12470=>'L', -12471=>'L', -12472=>'L', -12473=>'L', -12474=>'L', -12475=>'L', -12476=>'L', -12477=>'L', -12478=>'L', -12479=>'L', -12480=>'L', -12481=>'L', -12482=>'L', -12483=>'L', -12484=>'L', -12485=>'L', -12486=>'L', -12487=>'L', -12488=>'L', -12489=>'L', -12490=>'L', -12491=>'L', -12492=>'L', -12493=>'L', -12494=>'L', -12495=>'L', -12496=>'L', -12497=>'L', -12498=>'L', -12499=>'L', -12500=>'L', -12501=>'L', -12502=>'L', -12503=>'L', -12504=>'L', -12505=>'L', -12506=>'L', -12507=>'L', -12508=>'L', -12509=>'L', -12510=>'L', -12511=>'L', -12512=>'L', -12513=>'L', -12514=>'L', -12515=>'L', -12516=>'L', -12517=>'L', -12518=>'L', -12519=>'L', -12520=>'L', -12521=>'L', -12522=>'L', -12523=>'L', -12524=>'L', -12525=>'L', -12526=>'L', -12527=>'L', -12528=>'L', -12529=>'L', -12530=>'L', -12531=>'L', -12532=>'L', -12533=>'L', -12534=>'L', -12535=>'L', -12536=>'L', -12537=>'L', -12538=>'L', -12539=>'ON', -12540=>'L', -12541=>'L', -12542=>'L', -12543=>'L', -12549=>'L', -12550=>'L', -12551=>'L', -12552=>'L', -12553=>'L', -12554=>'L', -12555=>'L', -12556=>'L', -12557=>'L', -12558=>'L', -12559=>'L', -12560=>'L', -12561=>'L', -12562=>'L', -12563=>'L', -12564=>'L', -12565=>'L', -12566=>'L', -12567=>'L', -12568=>'L', -12569=>'L', -12570=>'L', -12571=>'L', -12572=>'L', -12573=>'L', -12574=>'L', -12575=>'L', -12576=>'L', -12577=>'L', -12578=>'L', -12579=>'L', -12580=>'L', -12581=>'L', -12582=>'L', -12583=>'L', -12584=>'L', -12585=>'L', -12586=>'L', -12587=>'L', -12588=>'L', -12593=>'L', -12594=>'L', -12595=>'L', -12596=>'L', -12597=>'L', -12598=>'L', -12599=>'L', -12600=>'L', -12601=>'L', -12602=>'L', -12603=>'L', -12604=>'L', -12605=>'L', -12606=>'L', -12607=>'L', -12608=>'L', -12609=>'L', -12610=>'L', -12611=>'L', -12612=>'L', -12613=>'L', -12614=>'L', -12615=>'L', -12616=>'L', -12617=>'L', -12618=>'L', -12619=>'L', -12620=>'L', -12621=>'L', -12622=>'L', -12623=>'L', -12624=>'L', -12625=>'L', -12626=>'L', -12627=>'L', -12628=>'L', -12629=>'L', -12630=>'L', -12631=>'L', -12632=>'L', -12633=>'L', -12634=>'L', -12635=>'L', -12636=>'L', -12637=>'L', -12638=>'L', -12639=>'L', -12640=>'L', -12641=>'L', -12642=>'L', -12643=>'L', -12644=>'L', -12645=>'L', -12646=>'L', -12647=>'L', -12648=>'L', -12649=>'L', -12650=>'L', -12651=>'L', -12652=>'L', -12653=>'L', -12654=>'L', -12655=>'L', -12656=>'L', -12657=>'L', -12658=>'L', -12659=>'L', -12660=>'L', -12661=>'L', -12662=>'L', -12663=>'L', -12664=>'L', -12665=>'L', -12666=>'L', -12667=>'L', -12668=>'L', -12669=>'L', -12670=>'L', -12671=>'L', -12672=>'L', -12673=>'L', -12674=>'L', -12675=>'L', -12676=>'L', -12677=>'L', -12678=>'L', -12679=>'L', -12680=>'L', -12681=>'L', -12682=>'L', -12683=>'L', -12684=>'L', -12685=>'L', -12686=>'L', -12688=>'L', -12689=>'L', -12690=>'L', -12691=>'L', -12692=>'L', -12693=>'L', -12694=>'L', -12695=>'L', -12696=>'L', -12697=>'L', -12698=>'L', -12699=>'L', -12700=>'L', -12701=>'L', -12702=>'L', -12703=>'L', -12704=>'L', -12705=>'L', -12706=>'L', -12707=>'L', -12708=>'L', -12709=>'L', -12710=>'L', -12711=>'L', -12712=>'L', -12713=>'L', -12714=>'L', -12715=>'L', -12716=>'L', -12717=>'L', -12718=>'L', -12719=>'L', -12720=>'L', -12721=>'L', -12722=>'L', -12723=>'L', -12724=>'L', -12725=>'L', -12726=>'L', -12727=>'L', -12736=>'ON', -12737=>'ON', -12738=>'ON', -12739=>'ON', -12740=>'ON', -12741=>'ON', -12742=>'ON', -12743=>'ON', -12744=>'ON', -12745=>'ON', -12746=>'ON', -12747=>'ON', -12748=>'ON', -12749=>'ON', -12750=>'ON', -12751=>'ON', -12784=>'L', -12785=>'L', -12786=>'L', -12787=>'L', -12788=>'L', -12789=>'L', -12790=>'L', -12791=>'L', -12792=>'L', -12793=>'L', -12794=>'L', -12795=>'L', -12796=>'L', -12797=>'L', -12798=>'L', -12799=>'L', -12800=>'L', -12801=>'L', -12802=>'L', -12803=>'L', -12804=>'L', -12805=>'L', -12806=>'L', -12807=>'L', -12808=>'L', -12809=>'L', -12810=>'L', -12811=>'L', -12812=>'L', -12813=>'L', -12814=>'L', -12815=>'L', -12816=>'L', -12817=>'L', -12818=>'L', -12819=>'L', -12820=>'L', -12821=>'L', -12822=>'L', -12823=>'L', -12824=>'L', -12825=>'L', -12826=>'L', -12827=>'L', -12828=>'L', -12829=>'ON', -12830=>'ON', -12832=>'L', -12833=>'L', -12834=>'L', -12835=>'L', -12836=>'L', -12837=>'L', -12838=>'L', -12839=>'L', -12840=>'L', -12841=>'L', -12842=>'L', -12843=>'L', -12844=>'L', -12845=>'L', -12846=>'L', -12847=>'L', -12848=>'L', -12849=>'L', -12850=>'L', -12851=>'L', -12852=>'L', -12853=>'L', -12854=>'L', -12855=>'L', -12856=>'L', -12857=>'L', -12858=>'L', -12859=>'L', -12860=>'L', -12861=>'L', -12862=>'L', -12863=>'L', -12864=>'L', -12865=>'L', -12866=>'L', -12867=>'L', -12880=>'ON', -12881=>'ON', -12882=>'ON', -12883=>'ON', -12884=>'ON', -12885=>'ON', -12886=>'ON', -12887=>'ON', -12888=>'ON', -12889=>'ON', -12890=>'ON', -12891=>'ON', -12892=>'ON', -12893=>'ON', -12894=>'ON', -12895=>'ON', -12896=>'L', -12897=>'L', -12898=>'L', -12899=>'L', -12900=>'L', -12901=>'L', -12902=>'L', -12903=>'L', -12904=>'L', -12905=>'L', -12906=>'L', -12907=>'L', -12908=>'L', -12909=>'L', -12910=>'L', -12911=>'L', -12912=>'L', -12913=>'L', -12914=>'L', -12915=>'L', -12916=>'L', -12917=>'L', -12918=>'L', -12919=>'L', -12920=>'L', -12921=>'L', -12922=>'L', -12923=>'L', -12924=>'ON', -12925=>'ON', -12926=>'ON', -12927=>'L', -12928=>'L', -12929=>'L', -12930=>'L', -12931=>'L', -12932=>'L', -12933=>'L', -12934=>'L', -12935=>'L', -12936=>'L', -12937=>'L', -12938=>'L', -12939=>'L', -12940=>'L', -12941=>'L', -12942=>'L', -12943=>'L', -12944=>'L', -12945=>'L', -12946=>'L', -12947=>'L', -12948=>'L', -12949=>'L', -12950=>'L', -12951=>'L', -12952=>'L', -12953=>'L', -12954=>'L', -12955=>'L', -12956=>'L', -12957=>'L', -12958=>'L', -12959=>'L', -12960=>'L', -12961=>'L', -12962=>'L', -12963=>'L', -12964=>'L', -12965=>'L', -12966=>'L', -12967=>'L', -12968=>'L', -12969=>'L', -12970=>'L', -12971=>'L', -12972=>'L', -12973=>'L', -12974=>'L', -12975=>'L', -12976=>'L', -12977=>'ON', -12978=>'ON', -12979=>'ON', -12980=>'ON', -12981=>'ON', -12982=>'ON', -12983=>'ON', -12984=>'ON', -12985=>'ON', -12986=>'ON', -12987=>'ON', -12988=>'ON', -12989=>'ON', -12990=>'ON', -12991=>'ON', -12992=>'L', -12993=>'L', -12994=>'L', -12995=>'L', -12996=>'L', -12997=>'L', -12998=>'L', -12999=>'L', -13000=>'L', -13001=>'L', -13002=>'L', -13003=>'L', -13004=>'ON', -13005=>'ON', -13006=>'ON', -13007=>'ON', -13008=>'L', -13009=>'L', -13010=>'L', -13011=>'L', -13012=>'L', -13013=>'L', -13014=>'L', -13015=>'L', -13016=>'L', -13017=>'L', -13018=>'L', -13019=>'L', -13020=>'L', -13021=>'L', -13022=>'L', -13023=>'L', -13024=>'L', -13025=>'L', -13026=>'L', -13027=>'L', -13028=>'L', -13029=>'L', -13030=>'L', -13031=>'L', -13032=>'L', -13033=>'L', -13034=>'L', -13035=>'L', -13036=>'L', -13037=>'L', -13038=>'L', -13039=>'L', -13040=>'L', -13041=>'L', -13042=>'L', -13043=>'L', -13044=>'L', -13045=>'L', -13046=>'L', -13047=>'L', -13048=>'L', -13049=>'L', -13050=>'L', -13051=>'L', -13052=>'L', -13053=>'L', -13054=>'L', -13056=>'L', -13057=>'L', -13058=>'L', -13059=>'L', -13060=>'L', -13061=>'L', -13062=>'L', -13063=>'L', -13064=>'L', -13065=>'L', -13066=>'L', -13067=>'L', -13068=>'L', -13069=>'L', -13070=>'L', -13071=>'L', -13072=>'L', -13073=>'L', -13074=>'L', -13075=>'L', -13076=>'L', -13077=>'L', -13078=>'L', -13079=>'L', -13080=>'L', -13081=>'L', -13082=>'L', -13083=>'L', -13084=>'L', -13085=>'L', -13086=>'L', -13087=>'L', -13088=>'L', -13089=>'L', -13090=>'L', -13091=>'L', -13092=>'L', -13093=>'L', -13094=>'L', -13095=>'L', -13096=>'L', -13097=>'L', -13098=>'L', -13099=>'L', -13100=>'L', -13101=>'L', -13102=>'L', -13103=>'L', -13104=>'L', -13105=>'L', -13106=>'L', -13107=>'L', -13108=>'L', -13109=>'L', -13110=>'L', -13111=>'L', -13112=>'L', -13113=>'L', -13114=>'L', -13115=>'L', -13116=>'L', -13117=>'L', -13118=>'L', -13119=>'L', -13120=>'L', -13121=>'L', -13122=>'L', -13123=>'L', -13124=>'L', -13125=>'L', -13126=>'L', -13127=>'L', -13128=>'L', -13129=>'L', -13130=>'L', -13131=>'L', -13132=>'L', -13133=>'L', -13134=>'L', -13135=>'L', -13136=>'L', -13137=>'L', -13138=>'L', -13139=>'L', -13140=>'L', -13141=>'L', -13142=>'L', -13143=>'L', -13144=>'L', -13145=>'L', -13146=>'L', -13147=>'L', -13148=>'L', -13149=>'L', -13150=>'L', -13151=>'L', -13152=>'L', -13153=>'L', -13154=>'L', -13155=>'L', -13156=>'L', -13157=>'L', -13158=>'L', -13159=>'L', -13160=>'L', -13161=>'L', -13162=>'L', -13163=>'L', -13164=>'L', -13165=>'L', -13166=>'L', -13167=>'L', -13168=>'L', -13169=>'L', -13170=>'L', -13171=>'L', -13172=>'L', -13173=>'L', -13174=>'L', -13175=>'ON', -13176=>'ON', -13177=>'ON', -13178=>'ON', -13179=>'L', -13180=>'L', -13181=>'L', -13182=>'L', -13183=>'L', -13184=>'L', -13185=>'L', -13186=>'L', -13187=>'L', -13188=>'L', -13189=>'L', -13190=>'L', -13191=>'L', -13192=>'L', -13193=>'L', -13194=>'L', -13195=>'L', -13196=>'L', -13197=>'L', -13198=>'L', -13199=>'L', -13200=>'L', -13201=>'L', -13202=>'L', -13203=>'L', -13204=>'L', -13205=>'L', -13206=>'L', -13207=>'L', -13208=>'L', -13209=>'L', -13210=>'L', -13211=>'L', -13212=>'L', -13213=>'L', -13214=>'L', -13215=>'L', -13216=>'L', -13217=>'L', -13218=>'L', -13219=>'L', -13220=>'L', -13221=>'L', -13222=>'L', -13223=>'L', -13224=>'L', -13225=>'L', -13226=>'L', -13227=>'L', -13228=>'L', -13229=>'L', -13230=>'L', -13231=>'L', -13232=>'L', -13233=>'L', -13234=>'L', -13235=>'L', -13236=>'L', -13237=>'L', -13238=>'L', -13239=>'L', -13240=>'L', -13241=>'L', -13242=>'L', -13243=>'L', -13244=>'L', -13245=>'L', -13246=>'L', -13247=>'L', -13248=>'L', -13249=>'L', -13250=>'L', -13251=>'L', -13252=>'L', -13253=>'L', -13254=>'L', -13255=>'L', -13256=>'L', -13257=>'L', -13258=>'L', -13259=>'L', -13260=>'L', -13261=>'L', -13262=>'L', -13263=>'L', -13264=>'L', -13265=>'L', -13266=>'L', -13267=>'L', -13268=>'L', -13269=>'L', -13270=>'L', -13271=>'L', -13272=>'L', -13273=>'L', -13274=>'L', -13275=>'L', -13276=>'L', -13277=>'L', -13278=>'ON', -13279=>'ON', -13280=>'L', -13281=>'L', -13282=>'L', -13283=>'L', -13284=>'L', -13285=>'L', -13286=>'L', -13287=>'L', -13288=>'L', -13289=>'L', -13290=>'L', -13291=>'L', -13292=>'L', -13293=>'L', -13294=>'L', -13295=>'L', -13296=>'L', -13297=>'L', -13298=>'L', -13299=>'L', -13300=>'L', -13301=>'L', -13302=>'L', -13303=>'L', -13304=>'L', -13305=>'L', -13306=>'L', -13307=>'L', -13308=>'L', -13309=>'L', -13310=>'L', -13311=>'ON', -13312=>'L', -19893=>'L', -19904=>'ON', -19905=>'ON', -19906=>'ON', -19907=>'ON', -19908=>'ON', -19909=>'ON', -19910=>'ON', -19911=>'ON', -19912=>'ON', -19913=>'ON', -19914=>'ON', -19915=>'ON', -19916=>'ON', -19917=>'ON', -19918=>'ON', -19919=>'ON', -19920=>'ON', -19921=>'ON', -19922=>'ON', -19923=>'ON', -19924=>'ON', -19925=>'ON', -19926=>'ON', -19927=>'ON', -19928=>'ON', -19929=>'ON', -19930=>'ON', -19931=>'ON', -19932=>'ON', -19933=>'ON', -19934=>'ON', -19935=>'ON', -19936=>'ON', -19937=>'ON', -19938=>'ON', -19939=>'ON', -19940=>'ON', -19941=>'ON', -19942=>'ON', -19943=>'ON', -19944=>'ON', -19945=>'ON', -19946=>'ON', -19947=>'ON', -19948=>'ON', -19949=>'ON', -19950=>'ON', -19951=>'ON', -19952=>'ON', -19953=>'ON', -19954=>'ON', -19955=>'ON', -19956=>'ON', -19957=>'ON', -19958=>'ON', -19959=>'ON', -19960=>'ON', -19961=>'ON', -19962=>'ON', -19963=>'ON', -19964=>'ON', -19965=>'ON', -19966=>'ON', -19967=>'ON', -19968=>'L', -40891=>'L', -40960=>'L', -40961=>'L', -40962=>'L', -40963=>'L', -40964=>'L', -40965=>'L', -40966=>'L', -40967=>'L', -40968=>'L', -40969=>'L', -40970=>'L', -40971=>'L', -40972=>'L', -40973=>'L', -40974=>'L', -40975=>'L', -40976=>'L', -40977=>'L', -40978=>'L', -40979=>'L', -40980=>'L', -40981=>'L', -40982=>'L', -40983=>'L', -40984=>'L', -40985=>'L', -40986=>'L', -40987=>'L', -40988=>'L', -40989=>'L', -40990=>'L', -40991=>'L', -40992=>'L', -40993=>'L', -40994=>'L', -40995=>'L', -40996=>'L', -40997=>'L', -40998=>'L', -40999=>'L', -41000=>'L', -41001=>'L', -41002=>'L', -41003=>'L', -41004=>'L', -41005=>'L', -41006=>'L', -41007=>'L', -41008=>'L', -41009=>'L', -41010=>'L', -41011=>'L', -41012=>'L', -41013=>'L', -41014=>'L', -41015=>'L', -41016=>'L', -41017=>'L', -41018=>'L', -41019=>'L', -41020=>'L', -41021=>'L', -41022=>'L', -41023=>'L', -41024=>'L', -41025=>'L', -41026=>'L', -41027=>'L', -41028=>'L', -41029=>'L', -41030=>'L', -41031=>'L', -41032=>'L', -41033=>'L', -41034=>'L', -41035=>'L', -41036=>'L', -41037=>'L', -41038=>'L', -41039=>'L', -41040=>'L', -41041=>'L', -41042=>'L', -41043=>'L', -41044=>'L', -41045=>'L', -41046=>'L', -41047=>'L', -41048=>'L', -41049=>'L', -41050=>'L', -41051=>'L', -41052=>'L', -41053=>'L', -41054=>'L', -41055=>'L', -41056=>'L', -41057=>'L', -41058=>'L', -41059=>'L', -41060=>'L', -41061=>'L', -41062=>'L', -41063=>'L', -41064=>'L', -41065=>'L', -41066=>'L', -41067=>'L', -41068=>'L', -41069=>'L', -41070=>'L', -41071=>'L', -41072=>'L', -41073=>'L', -41074=>'L', -41075=>'L', -41076=>'L', -41077=>'L', -41078=>'L', -41079=>'L', -41080=>'L', -41081=>'L', -41082=>'L', -41083=>'L', -41084=>'L', -41085=>'L', -41086=>'L', -41087=>'L', -41088=>'L', -41089=>'L', -41090=>'L', -41091=>'L', -41092=>'L', -41093=>'L', -41094=>'L', -41095=>'L', -41096=>'L', -41097=>'L', -41098=>'L', -41099=>'L', -41100=>'L', -41101=>'L', -41102=>'L', -41103=>'L', -41104=>'L', -41105=>'L', -41106=>'L', -41107=>'L', -41108=>'L', -41109=>'L', -41110=>'L', -41111=>'L', -41112=>'L', -41113=>'L', -41114=>'L', -41115=>'L', -41116=>'L', -41117=>'L', -41118=>'L', -41119=>'L', -41120=>'L', -41121=>'L', -41122=>'L', -41123=>'L', -41124=>'L', -41125=>'L', -41126=>'L', -41127=>'L', -41128=>'L', -41129=>'L', -41130=>'L', -41131=>'L', -41132=>'L', -41133=>'L', -41134=>'L', -41135=>'L', -41136=>'L', -41137=>'L', -41138=>'L', -41139=>'L', -41140=>'L', -41141=>'L', -41142=>'L', -41143=>'L', -41144=>'L', -41145=>'L', -41146=>'L', -41147=>'L', -41148=>'L', -41149=>'L', -41150=>'L', -41151=>'L', -41152=>'L', -41153=>'L', -41154=>'L', -41155=>'L', -41156=>'L', -41157=>'L', -41158=>'L', -41159=>'L', -41160=>'L', -41161=>'L', -41162=>'L', -41163=>'L', -41164=>'L', -41165=>'L', -41166=>'L', -41167=>'L', -41168=>'L', -41169=>'L', -41170=>'L', -41171=>'L', -41172=>'L', -41173=>'L', -41174=>'L', -41175=>'L', -41176=>'L', -41177=>'L', -41178=>'L', -41179=>'L', -41180=>'L', -41181=>'L', -41182=>'L', -41183=>'L', -41184=>'L', -41185=>'L', -41186=>'L', -41187=>'L', -41188=>'L', -41189=>'L', -41190=>'L', -41191=>'L', -41192=>'L', -41193=>'L', -41194=>'L', -41195=>'L', -41196=>'L', -41197=>'L', -41198=>'L', -41199=>'L', -41200=>'L', -41201=>'L', -41202=>'L', -41203=>'L', -41204=>'L', -41205=>'L', -41206=>'L', -41207=>'L', -41208=>'L', -41209=>'L', -41210=>'L', -41211=>'L', -41212=>'L', -41213=>'L', -41214=>'L', -41215=>'L', -41216=>'L', -41217=>'L', -41218=>'L', -41219=>'L', -41220=>'L', -41221=>'L', -41222=>'L', -41223=>'L', -41224=>'L', -41225=>'L', -41226=>'L', -41227=>'L', -41228=>'L', -41229=>'L', -41230=>'L', -41231=>'L', -41232=>'L', -41233=>'L', -41234=>'L', -41235=>'L', -41236=>'L', -41237=>'L', -41238=>'L', -41239=>'L', -41240=>'L', -41241=>'L', -41242=>'L', -41243=>'L', -41244=>'L', -41245=>'L', -41246=>'L', -41247=>'L', -41248=>'L', -41249=>'L', -41250=>'L', -41251=>'L', -41252=>'L', -41253=>'L', -41254=>'L', -41255=>'L', -41256=>'L', -41257=>'L', -41258=>'L', -41259=>'L', -41260=>'L', -41261=>'L', -41262=>'L', -41263=>'L', -41264=>'L', -41265=>'L', -41266=>'L', -41267=>'L', -41268=>'L', -41269=>'L', -41270=>'L', -41271=>'L', -41272=>'L', -41273=>'L', -41274=>'L', -41275=>'L', -41276=>'L', -41277=>'L', -41278=>'L', -41279=>'L', -41280=>'L', -41281=>'L', -41282=>'L', -41283=>'L', -41284=>'L', -41285=>'L', -41286=>'L', -41287=>'L', -41288=>'L', -41289=>'L', -41290=>'L', -41291=>'L', -41292=>'L', -41293=>'L', -41294=>'L', -41295=>'L', -41296=>'L', -41297=>'L', -41298=>'L', -41299=>'L', -41300=>'L', -41301=>'L', -41302=>'L', -41303=>'L', -41304=>'L', -41305=>'L', -41306=>'L', -41307=>'L', -41308=>'L', -41309=>'L', -41310=>'L', -41311=>'L', -41312=>'L', -41313=>'L', -41314=>'L', -41315=>'L', -41316=>'L', -41317=>'L', -41318=>'L', -41319=>'L', -41320=>'L', -41321=>'L', -41322=>'L', -41323=>'L', -41324=>'L', -41325=>'L', -41326=>'L', -41327=>'L', -41328=>'L', -41329=>'L', -41330=>'L', -41331=>'L', -41332=>'L', -41333=>'L', -41334=>'L', -41335=>'L', -41336=>'L', -41337=>'L', -41338=>'L', -41339=>'L', -41340=>'L', -41341=>'L', -41342=>'L', -41343=>'L', -41344=>'L', -41345=>'L', -41346=>'L', -41347=>'L', -41348=>'L', -41349=>'L', -41350=>'L', -41351=>'L', -41352=>'L', -41353=>'L', -41354=>'L', -41355=>'L', -41356=>'L', -41357=>'L', -41358=>'L', -41359=>'L', -41360=>'L', -41361=>'L', -41362=>'L', -41363=>'L', -41364=>'L', -41365=>'L', -41366=>'L', -41367=>'L', -41368=>'L', -41369=>'L', -41370=>'L', -41371=>'L', -41372=>'L', -41373=>'L', -41374=>'L', -41375=>'L', -41376=>'L', -41377=>'L', -41378=>'L', -41379=>'L', -41380=>'L', -41381=>'L', -41382=>'L', -41383=>'L', -41384=>'L', -41385=>'L', -41386=>'L', -41387=>'L', -41388=>'L', -41389=>'L', -41390=>'L', -41391=>'L', -41392=>'L', -41393=>'L', -41394=>'L', -41395=>'L', -41396=>'L', -41397=>'L', -41398=>'L', -41399=>'L', -41400=>'L', -41401=>'L', -41402=>'L', -41403=>'L', -41404=>'L', -41405=>'L', -41406=>'L', -41407=>'L', -41408=>'L', -41409=>'L', -41410=>'L', -41411=>'L', -41412=>'L', -41413=>'L', -41414=>'L', -41415=>'L', -41416=>'L', -41417=>'L', -41418=>'L', -41419=>'L', -41420=>'L', -41421=>'L', -41422=>'L', -41423=>'L', -41424=>'L', -41425=>'L', -41426=>'L', -41427=>'L', -41428=>'L', -41429=>'L', -41430=>'L', -41431=>'L', -41432=>'L', -41433=>'L', -41434=>'L', -41435=>'L', -41436=>'L', -41437=>'L', -41438=>'L', -41439=>'L', -41440=>'L', -41441=>'L', -41442=>'L', -41443=>'L', -41444=>'L', -41445=>'L', -41446=>'L', -41447=>'L', -41448=>'L', -41449=>'L', -41450=>'L', -41451=>'L', -41452=>'L', -41453=>'L', -41454=>'L', -41455=>'L', -41456=>'L', -41457=>'L', -41458=>'L', -41459=>'L', -41460=>'L', -41461=>'L', -41462=>'L', -41463=>'L', -41464=>'L', -41465=>'L', -41466=>'L', -41467=>'L', -41468=>'L', -41469=>'L', -41470=>'L', -41471=>'L', -41472=>'L', -41473=>'L', -41474=>'L', -41475=>'L', -41476=>'L', -41477=>'L', -41478=>'L', -41479=>'L', -41480=>'L', -41481=>'L', -41482=>'L', -41483=>'L', -41484=>'L', -41485=>'L', -41486=>'L', -41487=>'L', -41488=>'L', -41489=>'L', -41490=>'L', -41491=>'L', -41492=>'L', -41493=>'L', -41494=>'L', -41495=>'L', -41496=>'L', -41497=>'L', -41498=>'L', -41499=>'L', -41500=>'L', -41501=>'L', -41502=>'L', -41503=>'L', -41504=>'L', -41505=>'L', -41506=>'L', -41507=>'L', -41508=>'L', -41509=>'L', -41510=>'L', -41511=>'L', -41512=>'L', -41513=>'L', -41514=>'L', -41515=>'L', -41516=>'L', -41517=>'L', -41518=>'L', -41519=>'L', -41520=>'L', -41521=>'L', -41522=>'L', -41523=>'L', -41524=>'L', -41525=>'L', -41526=>'L', -41527=>'L', -41528=>'L', -41529=>'L', -41530=>'L', -41531=>'L', -41532=>'L', -41533=>'L', -41534=>'L', -41535=>'L', -41536=>'L', -41537=>'L', -41538=>'L', -41539=>'L', -41540=>'L', -41541=>'L', -41542=>'L', -41543=>'L', -41544=>'L', -41545=>'L', -41546=>'L', -41547=>'L', -41548=>'L', -41549=>'L', -41550=>'L', -41551=>'L', -41552=>'L', -41553=>'L', -41554=>'L', -41555=>'L', -41556=>'L', -41557=>'L', -41558=>'L', -41559=>'L', -41560=>'L', -41561=>'L', -41562=>'L', -41563=>'L', -41564=>'L', -41565=>'L', -41566=>'L', -41567=>'L', -41568=>'L', -41569=>'L', -41570=>'L', -41571=>'L', -41572=>'L', -41573=>'L', -41574=>'L', -41575=>'L', -41576=>'L', -41577=>'L', -41578=>'L', -41579=>'L', -41580=>'L', -41581=>'L', -41582=>'L', -41583=>'L', -41584=>'L', -41585=>'L', -41586=>'L', -41587=>'L', -41588=>'L', -41589=>'L', -41590=>'L', -41591=>'L', -41592=>'L', -41593=>'L', -41594=>'L', -41595=>'L', -41596=>'L', -41597=>'L', -41598=>'L', -41599=>'L', -41600=>'L', -41601=>'L', -41602=>'L', -41603=>'L', -41604=>'L', -41605=>'L', -41606=>'L', -41607=>'L', -41608=>'L', -41609=>'L', -41610=>'L', -41611=>'L', -41612=>'L', -41613=>'L', -41614=>'L', -41615=>'L', -41616=>'L', -41617=>'L', -41618=>'L', -41619=>'L', -41620=>'L', -41621=>'L', -41622=>'L', -41623=>'L', -41624=>'L', -41625=>'L', -41626=>'L', -41627=>'L', -41628=>'L', -41629=>'L', -41630=>'L', -41631=>'L', -41632=>'L', -41633=>'L', -41634=>'L', -41635=>'L', -41636=>'L', -41637=>'L', -41638=>'L', -41639=>'L', -41640=>'L', -41641=>'L', -41642=>'L', -41643=>'L', -41644=>'L', -41645=>'L', -41646=>'L', -41647=>'L', -41648=>'L', -41649=>'L', -41650=>'L', -41651=>'L', -41652=>'L', -41653=>'L', -41654=>'L', -41655=>'L', -41656=>'L', -41657=>'L', -41658=>'L', -41659=>'L', -41660=>'L', -41661=>'L', -41662=>'L', -41663=>'L', -41664=>'L', -41665=>'L', -41666=>'L', -41667=>'L', -41668=>'L', -41669=>'L', -41670=>'L', -41671=>'L', -41672=>'L', -41673=>'L', -41674=>'L', -41675=>'L', -41676=>'L', -41677=>'L', -41678=>'L', -41679=>'L', -41680=>'L', -41681=>'L', -41682=>'L', -41683=>'L', -41684=>'L', -41685=>'L', -41686=>'L', -41687=>'L', -41688=>'L', -41689=>'L', -41690=>'L', -41691=>'L', -41692=>'L', -41693=>'L', -41694=>'L', -41695=>'L', -41696=>'L', -41697=>'L', -41698=>'L', -41699=>'L', -41700=>'L', -41701=>'L', -41702=>'L', -41703=>'L', -41704=>'L', -41705=>'L', -41706=>'L', -41707=>'L', -41708=>'L', -41709=>'L', -41710=>'L', -41711=>'L', -41712=>'L', -41713=>'L', -41714=>'L', -41715=>'L', -41716=>'L', -41717=>'L', -41718=>'L', -41719=>'L', -41720=>'L', -41721=>'L', -41722=>'L', -41723=>'L', -41724=>'L', -41725=>'L', -41726=>'L', -41727=>'L', -41728=>'L', -41729=>'L', -41730=>'L', -41731=>'L', -41732=>'L', -41733=>'L', -41734=>'L', -41735=>'L', -41736=>'L', -41737=>'L', -41738=>'L', -41739=>'L', -41740=>'L', -41741=>'L', -41742=>'L', -41743=>'L', -41744=>'L', -41745=>'L', -41746=>'L', -41747=>'L', -41748=>'L', -41749=>'L', -41750=>'L', -41751=>'L', -41752=>'L', -41753=>'L', -41754=>'L', -41755=>'L', -41756=>'L', -41757=>'L', -41758=>'L', -41759=>'L', -41760=>'L', -41761=>'L', -41762=>'L', -41763=>'L', -41764=>'L', -41765=>'L', -41766=>'L', -41767=>'L', -41768=>'L', -41769=>'L', -41770=>'L', -41771=>'L', -41772=>'L', -41773=>'L', -41774=>'L', -41775=>'L', -41776=>'L', -41777=>'L', -41778=>'L', -41779=>'L', -41780=>'L', -41781=>'L', -41782=>'L', -41783=>'L', -41784=>'L', -41785=>'L', -41786=>'L', -41787=>'L', -41788=>'L', -41789=>'L', -41790=>'L', -41791=>'L', -41792=>'L', -41793=>'L', -41794=>'L', -41795=>'L', -41796=>'L', -41797=>'L', -41798=>'L', -41799=>'L', -41800=>'L', -41801=>'L', -41802=>'L', -41803=>'L', -41804=>'L', -41805=>'L', -41806=>'L', -41807=>'L', -41808=>'L', -41809=>'L', -41810=>'L', -41811=>'L', -41812=>'L', -41813=>'L', -41814=>'L', -41815=>'L', -41816=>'L', -41817=>'L', -41818=>'L', -41819=>'L', -41820=>'L', -41821=>'L', -41822=>'L', -41823=>'L', -41824=>'L', -41825=>'L', -41826=>'L', -41827=>'L', -41828=>'L', -41829=>'L', -41830=>'L', -41831=>'L', -41832=>'L', -41833=>'L', -41834=>'L', -41835=>'L', -41836=>'L', -41837=>'L', -41838=>'L', -41839=>'L', -41840=>'L', -41841=>'L', -41842=>'L', -41843=>'L', -41844=>'L', -41845=>'L', -41846=>'L', -41847=>'L', -41848=>'L', -41849=>'L', -41850=>'L', -41851=>'L', -41852=>'L', -41853=>'L', -41854=>'L', -41855=>'L', -41856=>'L', -41857=>'L', -41858=>'L', -41859=>'L', -41860=>'L', -41861=>'L', -41862=>'L', -41863=>'L', -41864=>'L', -41865=>'L', -41866=>'L', -41867=>'L', -41868=>'L', -41869=>'L', -41870=>'L', -41871=>'L', -41872=>'L', -41873=>'L', -41874=>'L', -41875=>'L', -41876=>'L', -41877=>'L', -41878=>'L', -41879=>'L', -41880=>'L', -41881=>'L', -41882=>'L', -41883=>'L', -41884=>'L', -41885=>'L', -41886=>'L', -41887=>'L', -41888=>'L', -41889=>'L', -41890=>'L', -41891=>'L', -41892=>'L', -41893=>'L', -41894=>'L', -41895=>'L', -41896=>'L', -41897=>'L', -41898=>'L', -41899=>'L', -41900=>'L', -41901=>'L', -41902=>'L', -41903=>'L', -41904=>'L', -41905=>'L', -41906=>'L', -41907=>'L', -41908=>'L', -41909=>'L', -41910=>'L', -41911=>'L', -41912=>'L', -41913=>'L', -41914=>'L', -41915=>'L', -41916=>'L', -41917=>'L', -41918=>'L', -41919=>'L', -41920=>'L', -41921=>'L', -41922=>'L', -41923=>'L', -41924=>'L', -41925=>'L', -41926=>'L', -41927=>'L', -41928=>'L', -41929=>'L', -41930=>'L', -41931=>'L', -41932=>'L', -41933=>'L', -41934=>'L', -41935=>'L', -41936=>'L', -41937=>'L', -41938=>'L', -41939=>'L', -41940=>'L', -41941=>'L', -41942=>'L', -41943=>'L', -41944=>'L', -41945=>'L', -41946=>'L', -41947=>'L', -41948=>'L', -41949=>'L', -41950=>'L', -41951=>'L', -41952=>'L', -41953=>'L', -41954=>'L', -41955=>'L', -41956=>'L', -41957=>'L', -41958=>'L', -41959=>'L', -41960=>'L', -41961=>'L', -41962=>'L', -41963=>'L', -41964=>'L', -41965=>'L', -41966=>'L', -41967=>'L', -41968=>'L', -41969=>'L', -41970=>'L', -41971=>'L', -41972=>'L', -41973=>'L', -41974=>'L', -41975=>'L', -41976=>'L', -41977=>'L', -41978=>'L', -41979=>'L', -41980=>'L', -41981=>'L', -41982=>'L', -41983=>'L', -41984=>'L', -41985=>'L', -41986=>'L', -41987=>'L', -41988=>'L', -41989=>'L', -41990=>'L', -41991=>'L', -41992=>'L', -41993=>'L', -41994=>'L', -41995=>'L', -41996=>'L', -41997=>'L', -41998=>'L', -41999=>'L', -42000=>'L', -42001=>'L', -42002=>'L', -42003=>'L', -42004=>'L', -42005=>'L', -42006=>'L', -42007=>'L', -42008=>'L', -42009=>'L', -42010=>'L', -42011=>'L', -42012=>'L', -42013=>'L', -42014=>'L', -42015=>'L', -42016=>'L', -42017=>'L', -42018=>'L', -42019=>'L', -42020=>'L', -42021=>'L', -42022=>'L', -42023=>'L', -42024=>'L', -42025=>'L', -42026=>'L', -42027=>'L', -42028=>'L', -42029=>'L', -42030=>'L', -42031=>'L', -42032=>'L', -42033=>'L', -42034=>'L', -42035=>'L', -42036=>'L', -42037=>'L', -42038=>'L', -42039=>'L', -42040=>'L', -42041=>'L', -42042=>'L', -42043=>'L', -42044=>'L', -42045=>'L', -42046=>'L', -42047=>'L', -42048=>'L', -42049=>'L', -42050=>'L', -42051=>'L', -42052=>'L', -42053=>'L', -42054=>'L', -42055=>'L', -42056=>'L', -42057=>'L', -42058=>'L', -42059=>'L', -42060=>'L', -42061=>'L', -42062=>'L', -42063=>'L', -42064=>'L', -42065=>'L', -42066=>'L', -42067=>'L', -42068=>'L', -42069=>'L', -42070=>'L', -42071=>'L', -42072=>'L', -42073=>'L', -42074=>'L', -42075=>'L', -42076=>'L', -42077=>'L', -42078=>'L', -42079=>'L', -42080=>'L', -42081=>'L', -42082=>'L', -42083=>'L', -42084=>'L', -42085=>'L', -42086=>'L', -42087=>'L', -42088=>'L', -42089=>'L', -42090=>'L', -42091=>'L', -42092=>'L', -42093=>'L', -42094=>'L', -42095=>'L', -42096=>'L', -42097=>'L', -42098=>'L', -42099=>'L', -42100=>'L', -42101=>'L', -42102=>'L', -42103=>'L', -42104=>'L', -42105=>'L', -42106=>'L', -42107=>'L', -42108=>'L', -42109=>'L', -42110=>'L', -42111=>'L', -42112=>'L', -42113=>'L', -42114=>'L', -42115=>'L', -42116=>'L', -42117=>'L', -42118=>'L', -42119=>'L', -42120=>'L', -42121=>'L', -42122=>'L', -42123=>'L', -42124=>'L', -42128=>'ON', -42129=>'ON', -42130=>'ON', -42131=>'ON', -42132=>'ON', -42133=>'ON', -42134=>'ON', -42135=>'ON', -42136=>'ON', -42137=>'ON', -42138=>'ON', -42139=>'ON', -42140=>'ON', -42141=>'ON', -42142=>'ON', -42143=>'ON', -42144=>'ON', -42145=>'ON', -42146=>'ON', -42147=>'ON', -42148=>'ON', -42149=>'ON', -42150=>'ON', -42151=>'ON', -42152=>'ON', -42153=>'ON', -42154=>'ON', -42155=>'ON', -42156=>'ON', -42157=>'ON', -42158=>'ON', -42159=>'ON', -42160=>'ON', -42161=>'ON', -42162=>'ON', -42163=>'ON', -42164=>'ON', -42165=>'ON', -42166=>'ON', -42167=>'ON', -42168=>'ON', -42169=>'ON', -42170=>'ON', -42171=>'ON', -42172=>'ON', -42173=>'ON', -42174=>'ON', -42175=>'ON', -42176=>'ON', -42177=>'ON', -42178=>'ON', -42179=>'ON', -42180=>'ON', -42181=>'ON', -42182=>'ON', -42752=>'ON', -42753=>'ON', -42754=>'ON', -42755=>'ON', -42756=>'ON', -42757=>'ON', -42758=>'ON', -42759=>'ON', -42760=>'ON', -42761=>'ON', -42762=>'ON', -42763=>'ON', -42764=>'ON', -42765=>'ON', -42766=>'ON', -42767=>'ON', -42768=>'ON', -42769=>'ON', -42770=>'ON', -42771=>'ON', -42772=>'ON', -42773=>'ON', -42774=>'ON', -42775=>'ON', -42776=>'ON', -42777=>'ON', -42778=>'ON', -42784=>'ON', -42785=>'ON', -43008=>'L', -43009=>'L', -43010=>'NSM', -43011=>'L', -43012=>'L', -43013=>'L', -43014=>'NSM', -43015=>'L', -43016=>'L', -43017=>'L', -43018=>'L', -43019=>'NSM', -43020=>'L', -43021=>'L', -43022=>'L', -43023=>'L', -43024=>'L', -43025=>'L', -43026=>'L', -43027=>'L', -43028=>'L', -43029=>'L', -43030=>'L', -43031=>'L', -43032=>'L', -43033=>'L', -43034=>'L', -43035=>'L', -43036=>'L', -43037=>'L', -43038=>'L', -43039=>'L', -43040=>'L', -43041=>'L', -43042=>'L', -43043=>'L', -43044=>'L', -43045=>'NSM', -43046=>'NSM', -43047=>'L', -43048=>'ON', -43049=>'ON', -43050=>'ON', -43051=>'ON', -43072=>'L', -43073=>'L', -43074=>'L', -43075=>'L', -43076=>'L', -43077=>'L', -43078=>'L', -43079=>'L', -43080=>'L', -43081=>'L', -43082=>'L', -43083=>'L', -43084=>'L', -43085=>'L', -43086=>'L', -43087=>'L', -43088=>'L', -43089=>'L', -43090=>'L', -43091=>'L', -43092=>'L', -43093=>'L', -43094=>'L', -43095=>'L', -43096=>'L', -43097=>'L', -43098=>'L', -43099=>'L', -43100=>'L', -43101=>'L', -43102=>'L', -43103=>'L', -43104=>'L', -43105=>'L', -43106=>'L', -43107=>'L', -43108=>'L', -43109=>'L', -43110=>'L', -43111=>'L', -43112=>'L', -43113=>'L', -43114=>'L', -43115=>'L', -43116=>'L', -43117=>'L', -43118=>'L', -43119=>'L', -43120=>'L', -43121=>'L', -43122=>'L', -43123=>'L', -43124=>'ON', -43125=>'ON', -43126=>'ON', -43127=>'ON', -44032=>'L', -55203=>'L', -55296=>'L', -56191=>'L', -56192=>'L', -56319=>'L', -56320=>'L', -57343=>'L', -57344=>'L', -63743=>'L', -63744=>'L', -63745=>'L', -63746=>'L', -63747=>'L', -63748=>'L', -63749=>'L', -63750=>'L', -63751=>'L', -63752=>'L', -63753=>'L', -63754=>'L', -63755=>'L', -63756=>'L', -63757=>'L', -63758=>'L', -63759=>'L', -63760=>'L', -63761=>'L', -63762=>'L', -63763=>'L', -63764=>'L', -63765=>'L', -63766=>'L', -63767=>'L', -63768=>'L', -63769=>'L', -63770=>'L', -63771=>'L', -63772=>'L', -63773=>'L', -63774=>'L', -63775=>'L', -63776=>'L', -63777=>'L', -63778=>'L', -63779=>'L', -63780=>'L', -63781=>'L', -63782=>'L', -63783=>'L', -63784=>'L', -63785=>'L', -63786=>'L', -63787=>'L', -63788=>'L', -63789=>'L', -63790=>'L', -63791=>'L', -63792=>'L', -63793=>'L', -63794=>'L', -63795=>'L', -63796=>'L', -63797=>'L', -63798=>'L', -63799=>'L', -63800=>'L', -63801=>'L', -63802=>'L', -63803=>'L', -63804=>'L', -63805=>'L', -63806=>'L', -63807=>'L', -63808=>'L', -63809=>'L', -63810=>'L', -63811=>'L', -63812=>'L', -63813=>'L', -63814=>'L', -63815=>'L', -63816=>'L', -63817=>'L', -63818=>'L', -63819=>'L', -63820=>'L', -63821=>'L', -63822=>'L', -63823=>'L', -63824=>'L', -63825=>'L', -63826=>'L', -63827=>'L', -63828=>'L', -63829=>'L', -63830=>'L', -63831=>'L', -63832=>'L', -63833=>'L', -63834=>'L', -63835=>'L', -63836=>'L', -63837=>'L', -63838=>'L', -63839=>'L', -63840=>'L', -63841=>'L', -63842=>'L', -63843=>'L', -63844=>'L', -63845=>'L', -63846=>'L', -63847=>'L', -63848=>'L', -63849=>'L', -63850=>'L', -63851=>'L', -63852=>'L', -63853=>'L', -63854=>'L', -63855=>'L', -63856=>'L', -63857=>'L', -63858=>'L', -63859=>'L', -63860=>'L', -63861=>'L', -63862=>'L', -63863=>'L', -63864=>'L', -63865=>'L', -63866=>'L', -63867=>'L', -63868=>'L', -63869=>'L', -63870=>'L', -63871=>'L', -63872=>'L', -63873=>'L', -63874=>'L', -63875=>'L', -63876=>'L', -63877=>'L', -63878=>'L', -63879=>'L', -63880=>'L', -63881=>'L', -63882=>'L', -63883=>'L', -63884=>'L', -63885=>'L', -63886=>'L', -63887=>'L', -63888=>'L', -63889=>'L', -63890=>'L', -63891=>'L', -63892=>'L', -63893=>'L', -63894=>'L', -63895=>'L', -63896=>'L', -63897=>'L', -63898=>'L', -63899=>'L', -63900=>'L', -63901=>'L', -63902=>'L', -63903=>'L', -63904=>'L', -63905=>'L', -63906=>'L', -63907=>'L', -63908=>'L', -63909=>'L', -63910=>'L', -63911=>'L', -63912=>'L', -63913=>'L', -63914=>'L', -63915=>'L', -63916=>'L', -63917=>'L', -63918=>'L', -63919=>'L', -63920=>'L', -63921=>'L', -63922=>'L', -63923=>'L', -63924=>'L', -63925=>'L', -63926=>'L', -63927=>'L', -63928=>'L', -63929=>'L', -63930=>'L', -63931=>'L', -63932=>'L', -63933=>'L', -63934=>'L', -63935=>'L', -63936=>'L', -63937=>'L', -63938=>'L', -63939=>'L', -63940=>'L', -63941=>'L', -63942=>'L', -63943=>'L', -63944=>'L', -63945=>'L', -63946=>'L', -63947=>'L', -63948=>'L', -63949=>'L', -63950=>'L', -63951=>'L', -63952=>'L', -63953=>'L', -63954=>'L', -63955=>'L', -63956=>'L', -63957=>'L', -63958=>'L', -63959=>'L', -63960=>'L', -63961=>'L', -63962=>'L', -63963=>'L', -63964=>'L', -63965=>'L', -63966=>'L', -63967=>'L', -63968=>'L', -63969=>'L', -63970=>'L', -63971=>'L', -63972=>'L', -63973=>'L', -63974=>'L', -63975=>'L', -63976=>'L', -63977=>'L', -63978=>'L', -63979=>'L', -63980=>'L', -63981=>'L', -63982=>'L', -63983=>'L', -63984=>'L', -63985=>'L', -63986=>'L', -63987=>'L', -63988=>'L', -63989=>'L', -63990=>'L', -63991=>'L', -63992=>'L', -63993=>'L', -63994=>'L', -63995=>'L', -63996=>'L', -63997=>'L', -63998=>'L', -63999=>'L', -64000=>'L', -64001=>'L', -64002=>'L', -64003=>'L', -64004=>'L', -64005=>'L', -64006=>'L', -64007=>'L', -64008=>'L', -64009=>'L', -64010=>'L', -64011=>'L', -64012=>'L', -64013=>'L', -64014=>'L', -64015=>'L', -64016=>'L', -64017=>'L', -64018=>'L', -64019=>'L', -64020=>'L', -64021=>'L', -64022=>'L', -64023=>'L', -64024=>'L', -64025=>'L', -64026=>'L', -64027=>'L', -64028=>'L', -64029=>'L', -64030=>'L', -64031=>'L', -64032=>'L', -64033=>'L', -64034=>'L', -64035=>'L', -64036=>'L', -64037=>'L', -64038=>'L', -64039=>'L', -64040=>'L', -64041=>'L', -64042=>'L', -64043=>'L', -64044=>'L', -64045=>'L', -64048=>'L', -64049=>'L', -64050=>'L', -64051=>'L', -64052=>'L', -64053=>'L', -64054=>'L', -64055=>'L', -64056=>'L', -64057=>'L', -64058=>'L', -64059=>'L', -64060=>'L', -64061=>'L', -64062=>'L', -64063=>'L', -64064=>'L', -64065=>'L', -64066=>'L', -64067=>'L', -64068=>'L', -64069=>'L', -64070=>'L', -64071=>'L', -64072=>'L', -64073=>'L', -64074=>'L', -64075=>'L', -64076=>'L', -64077=>'L', -64078=>'L', -64079=>'L', -64080=>'L', -64081=>'L', -64082=>'L', -64083=>'L', -64084=>'L', -64085=>'L', -64086=>'L', -64087=>'L', -64088=>'L', -64089=>'L', -64090=>'L', -64091=>'L', -64092=>'L', -64093=>'L', -64094=>'L', -64095=>'L', -64096=>'L', -64097=>'L', -64098=>'L', -64099=>'L', -64100=>'L', -64101=>'L', -64102=>'L', -64103=>'L', -64104=>'L', -64105=>'L', -64106=>'L', -64112=>'L', -64113=>'L', -64114=>'L', -64115=>'L', -64116=>'L', -64117=>'L', -64118=>'L', -64119=>'L', -64120=>'L', -64121=>'L', -64122=>'L', -64123=>'L', -64124=>'L', -64125=>'L', -64126=>'L', -64127=>'L', -64128=>'L', -64129=>'L', -64130=>'L', -64131=>'L', -64132=>'L', -64133=>'L', -64134=>'L', -64135=>'L', -64136=>'L', -64137=>'L', -64138=>'L', -64139=>'L', -64140=>'L', -64141=>'L', -64142=>'L', -64143=>'L', -64144=>'L', -64145=>'L', -64146=>'L', -64147=>'L', -64148=>'L', -64149=>'L', -64150=>'L', -64151=>'L', -64152=>'L', -64153=>'L', -64154=>'L', -64155=>'L', -64156=>'L', -64157=>'L', -64158=>'L', -64159=>'L', -64160=>'L', -64161=>'L', -64162=>'L', -64163=>'L', -64164=>'L', -64165=>'L', -64166=>'L', -64167=>'L', -64168=>'L', -64169=>'L', -64170=>'L', -64171=>'L', -64172=>'L', -64173=>'L', -64174=>'L', -64175=>'L', -64176=>'L', -64177=>'L', -64178=>'L', -64179=>'L', -64180=>'L', -64181=>'L', -64182=>'L', -64183=>'L', -64184=>'L', -64185=>'L', -64186=>'L', -64187=>'L', -64188=>'L', -64189=>'L', -64190=>'L', -64191=>'L', -64192=>'L', -64193=>'L', -64194=>'L', -64195=>'L', -64196=>'L', -64197=>'L', -64198=>'L', -64199=>'L', -64200=>'L', -64201=>'L', -64202=>'L', -64203=>'L', -64204=>'L', -64205=>'L', -64206=>'L', -64207=>'L', -64208=>'L', -64209=>'L', -64210=>'L', -64211=>'L', -64212=>'L', -64213=>'L', -64214=>'L', -64215=>'L', -64216=>'L', -64217=>'L', -64256=>'L', -64257=>'L', -64258=>'L', -64259=>'L', -64260=>'L', -64261=>'L', -64262=>'L', -64275=>'L', -64276=>'L', -64277=>'L', -64278=>'L', -64279=>'L', -64285=>'R', -64286=>'NSM', -64287=>'R', -64288=>'R', -64289=>'R', -64290=>'R', -64291=>'R', -64292=>'R', -64293=>'R', -64294=>'R', -64295=>'R', -64296=>'R', -64297=>'ES', -64298=>'R', -64299=>'R', -64300=>'R', -64301=>'R', -64302=>'R', -64303=>'R', -64304=>'R', -64305=>'R', -64306=>'R', -64307=>'R', -64308=>'R', -64309=>'R', -64310=>'R', -64312=>'R', -64313=>'R', -64314=>'R', -64315=>'R', -64316=>'R', -64318=>'R', -64320=>'R', -64321=>'R', -64323=>'R', -64324=>'R', -64326=>'R', -64327=>'R', -64328=>'R', -64329=>'R', -64330=>'R', -64331=>'R', -64332=>'R', -64333=>'R', -64334=>'R', -64335=>'R', -64336=>'AL', -64337=>'AL', -64338=>'AL', -64339=>'AL', -64340=>'AL', -64341=>'AL', -64342=>'AL', -64343=>'AL', -64344=>'AL', -64345=>'AL', -64346=>'AL', -64347=>'AL', -64348=>'AL', -64349=>'AL', -64350=>'AL', -64351=>'AL', -64352=>'AL', -64353=>'AL', -64354=>'AL', -64355=>'AL', -64356=>'AL', -64357=>'AL', -64358=>'AL', -64359=>'AL', -64360=>'AL', -64361=>'AL', -64362=>'AL', -64363=>'AL', -64364=>'AL', -64365=>'AL', -64366=>'AL', -64367=>'AL', -64368=>'AL', -64369=>'AL', -64370=>'AL', -64371=>'AL', -64372=>'AL', -64373=>'AL', -64374=>'AL', -64375=>'AL', -64376=>'AL', -64377=>'AL', -64378=>'AL', -64379=>'AL', -64380=>'AL', -64381=>'AL', -64382=>'AL', -64383=>'AL', -64384=>'AL', -64385=>'AL', -64386=>'AL', -64387=>'AL', -64388=>'AL', -64389=>'AL', -64390=>'AL', -64391=>'AL', -64392=>'AL', -64393=>'AL', -64394=>'AL', -64395=>'AL', -64396=>'AL', -64397=>'AL', -64398=>'AL', -64399=>'AL', -64400=>'AL', -64401=>'AL', -64402=>'AL', -64403=>'AL', -64404=>'AL', -64405=>'AL', -64406=>'AL', -64407=>'AL', -64408=>'AL', -64409=>'AL', -64410=>'AL', -64411=>'AL', -64412=>'AL', -64413=>'AL', -64414=>'AL', -64415=>'AL', -64416=>'AL', -64417=>'AL', -64418=>'AL', -64419=>'AL', -64420=>'AL', -64421=>'AL', -64422=>'AL', -64423=>'AL', -64424=>'AL', -64425=>'AL', -64426=>'AL', -64427=>'AL', -64428=>'AL', -64429=>'AL', -64430=>'AL', -64431=>'AL', -64432=>'AL', -64433=>'AL', -64467=>'AL', -64468=>'AL', -64469=>'AL', -64470=>'AL', -64471=>'AL', -64472=>'AL', -64473=>'AL', -64474=>'AL', -64475=>'AL', -64476=>'AL', -64477=>'AL', -64478=>'AL', -64479=>'AL', -64480=>'AL', -64481=>'AL', -64482=>'AL', -64483=>'AL', -64484=>'AL', -64485=>'AL', -64486=>'AL', -64487=>'AL', -64488=>'AL', -64489=>'AL', -64490=>'AL', -64491=>'AL', -64492=>'AL', -64493=>'AL', -64494=>'AL', -64495=>'AL', -64496=>'AL', -64497=>'AL', -64498=>'AL', -64499=>'AL', -64500=>'AL', -64501=>'AL', -64502=>'AL', -64503=>'AL', -64504=>'AL', -64505=>'AL', -64506=>'AL', -64507=>'AL', -64508=>'AL', -64509=>'AL', -64510=>'AL', -64511=>'AL', -64512=>'AL', -64513=>'AL', -64514=>'AL', -64515=>'AL', -64516=>'AL', -64517=>'AL', -64518=>'AL', -64519=>'AL', -64520=>'AL', -64521=>'AL', -64522=>'AL', -64523=>'AL', -64524=>'AL', -64525=>'AL', -64526=>'AL', -64527=>'AL', -64528=>'AL', -64529=>'AL', -64530=>'AL', -64531=>'AL', -64532=>'AL', -64533=>'AL', -64534=>'AL', -64535=>'AL', -64536=>'AL', -64537=>'AL', -64538=>'AL', -64539=>'AL', -64540=>'AL', -64541=>'AL', -64542=>'AL', -64543=>'AL', -64544=>'AL', -64545=>'AL', -64546=>'AL', -64547=>'AL', -64548=>'AL', -64549=>'AL', -64550=>'AL', -64551=>'AL', -64552=>'AL', -64553=>'AL', -64554=>'AL', -64555=>'AL', -64556=>'AL', -64557=>'AL', -64558=>'AL', -64559=>'AL', -64560=>'AL', -64561=>'AL', -64562=>'AL', -64563=>'AL', -64564=>'AL', -64565=>'AL', -64566=>'AL', -64567=>'AL', -64568=>'AL', -64569=>'AL', -64570=>'AL', -64571=>'AL', -64572=>'AL', -64573=>'AL', -64574=>'AL', -64575=>'AL', -64576=>'AL', -64577=>'AL', -64578=>'AL', -64579=>'AL', -64580=>'AL', -64581=>'AL', -64582=>'AL', -64583=>'AL', -64584=>'AL', -64585=>'AL', -64586=>'AL', -64587=>'AL', -64588=>'AL', -64589=>'AL', -64590=>'AL', -64591=>'AL', -64592=>'AL', -64593=>'AL', -64594=>'AL', -64595=>'AL', -64596=>'AL', -64597=>'AL', -64598=>'AL', -64599=>'AL', -64600=>'AL', -64601=>'AL', -64602=>'AL', -64603=>'AL', -64604=>'AL', -64605=>'AL', -64606=>'AL', -64607=>'AL', -64608=>'AL', -64609=>'AL', -64610=>'AL', -64611=>'AL', -64612=>'AL', -64613=>'AL', -64614=>'AL', -64615=>'AL', -64616=>'AL', -64617=>'AL', -64618=>'AL', -64619=>'AL', -64620=>'AL', -64621=>'AL', -64622=>'AL', -64623=>'AL', -64624=>'AL', -64625=>'AL', -64626=>'AL', -64627=>'AL', -64628=>'AL', -64629=>'AL', -64630=>'AL', -64631=>'AL', -64632=>'AL', -64633=>'AL', -64634=>'AL', -64635=>'AL', -64636=>'AL', -64637=>'AL', -64638=>'AL', -64639=>'AL', -64640=>'AL', -64641=>'AL', -64642=>'AL', -64643=>'AL', -64644=>'AL', -64645=>'AL', -64646=>'AL', -64647=>'AL', -64648=>'AL', -64649=>'AL', -64650=>'AL', -64651=>'AL', -64652=>'AL', -64653=>'AL', -64654=>'AL', -64655=>'AL', -64656=>'AL', -64657=>'AL', -64658=>'AL', -64659=>'AL', -64660=>'AL', -64661=>'AL', -64662=>'AL', -64663=>'AL', -64664=>'AL', -64665=>'AL', -64666=>'AL', -64667=>'AL', -64668=>'AL', -64669=>'AL', -64670=>'AL', -64671=>'AL', -64672=>'AL', -64673=>'AL', -64674=>'AL', -64675=>'AL', -64676=>'AL', -64677=>'AL', -64678=>'AL', -64679=>'AL', -64680=>'AL', -64681=>'AL', -64682=>'AL', -64683=>'AL', -64684=>'AL', -64685=>'AL', -64686=>'AL', -64687=>'AL', -64688=>'AL', -64689=>'AL', -64690=>'AL', -64691=>'AL', -64692=>'AL', -64693=>'AL', -64694=>'AL', -64695=>'AL', -64696=>'AL', -64697=>'AL', -64698=>'AL', -64699=>'AL', -64700=>'AL', -64701=>'AL', -64702=>'AL', -64703=>'AL', -64704=>'AL', -64705=>'AL', -64706=>'AL', -64707=>'AL', -64708=>'AL', -64709=>'AL', -64710=>'AL', -64711=>'AL', -64712=>'AL', -64713=>'AL', -64714=>'AL', -64715=>'AL', -64716=>'AL', -64717=>'AL', -64718=>'AL', -64719=>'AL', -64720=>'AL', -64721=>'AL', -64722=>'AL', -64723=>'AL', -64724=>'AL', -64725=>'AL', -64726=>'AL', -64727=>'AL', -64728=>'AL', -64729=>'AL', -64730=>'AL', -64731=>'AL', -64732=>'AL', -64733=>'AL', -64734=>'AL', -64735=>'AL', -64736=>'AL', -64737=>'AL', -64738=>'AL', -64739=>'AL', -64740=>'AL', -64741=>'AL', -64742=>'AL', -64743=>'AL', -64744=>'AL', -64745=>'AL', -64746=>'AL', -64747=>'AL', -64748=>'AL', -64749=>'AL', -64750=>'AL', -64751=>'AL', -64752=>'AL', -64753=>'AL', -64754=>'AL', -64755=>'AL', -64756=>'AL', -64757=>'AL', -64758=>'AL', -64759=>'AL', -64760=>'AL', -64761=>'AL', -64762=>'AL', -64763=>'AL', -64764=>'AL', -64765=>'AL', -64766=>'AL', -64767=>'AL', -64768=>'AL', -64769=>'AL', -64770=>'AL', -64771=>'AL', -64772=>'AL', -64773=>'AL', -64774=>'AL', -64775=>'AL', -64776=>'AL', -64777=>'AL', -64778=>'AL', -64779=>'AL', -64780=>'AL', -64781=>'AL', -64782=>'AL', -64783=>'AL', -64784=>'AL', -64785=>'AL', -64786=>'AL', -64787=>'AL', -64788=>'AL', -64789=>'AL', -64790=>'AL', -64791=>'AL', -64792=>'AL', -64793=>'AL', -64794=>'AL', -64795=>'AL', -64796=>'AL', -64797=>'AL', -64798=>'AL', -64799=>'AL', -64800=>'AL', -64801=>'AL', -64802=>'AL', -64803=>'AL', -64804=>'AL', -64805=>'AL', -64806=>'AL', -64807=>'AL', -64808=>'AL', -64809=>'AL', -64810=>'AL', -64811=>'AL', -64812=>'AL', -64813=>'AL', -64814=>'AL', -64815=>'AL', -64816=>'AL', -64817=>'AL', -64818=>'AL', -64819=>'AL', -64820=>'AL', -64821=>'AL', -64822=>'AL', -64823=>'AL', -64824=>'AL', -64825=>'AL', -64826=>'AL', -64827=>'AL', -64828=>'AL', -64829=>'AL', -64830=>'ON', -64831=>'ON', -64848=>'AL', -64849=>'AL', -64850=>'AL', -64851=>'AL', -64852=>'AL', -64853=>'AL', -64854=>'AL', -64855=>'AL', -64856=>'AL', -64857=>'AL', -64858=>'AL', -64859=>'AL', -64860=>'AL', -64861=>'AL', -64862=>'AL', -64863=>'AL', -64864=>'AL', -64865=>'AL', -64866=>'AL', -64867=>'AL', -64868=>'AL', -64869=>'AL', -64870=>'AL', -64871=>'AL', -64872=>'AL', -64873=>'AL', -64874=>'AL', -64875=>'AL', -64876=>'AL', -64877=>'AL', -64878=>'AL', -64879=>'AL', -64880=>'AL', -64881=>'AL', -64882=>'AL', -64883=>'AL', -64884=>'AL', -64885=>'AL', -64886=>'AL', -64887=>'AL', -64888=>'AL', -64889=>'AL', -64890=>'AL', -64891=>'AL', -64892=>'AL', -64893=>'AL', -64894=>'AL', -64895=>'AL', -64896=>'AL', -64897=>'AL', -64898=>'AL', -64899=>'AL', -64900=>'AL', -64901=>'AL', -64902=>'AL', -64903=>'AL', -64904=>'AL', -64905=>'AL', -64906=>'AL', -64907=>'AL', -64908=>'AL', -64909=>'AL', -64910=>'AL', -64911=>'AL', -64914=>'AL', -64915=>'AL', -64916=>'AL', -64917=>'AL', -64918=>'AL', -64919=>'AL', -64920=>'AL', -64921=>'AL', -64922=>'AL', -64923=>'AL', -64924=>'AL', -64925=>'AL', -64926=>'AL', -64927=>'AL', -64928=>'AL', -64929=>'AL', -64930=>'AL', -64931=>'AL', -64932=>'AL', -64933=>'AL', -64934=>'AL', -64935=>'AL', -64936=>'AL', -64937=>'AL', -64938=>'AL', -64939=>'AL', -64940=>'AL', -64941=>'AL', -64942=>'AL', -64943=>'AL', -64944=>'AL', -64945=>'AL', -64946=>'AL', -64947=>'AL', -64948=>'AL', -64949=>'AL', -64950=>'AL', -64951=>'AL', -64952=>'AL', -64953=>'AL', -64954=>'AL', -64955=>'AL', -64956=>'AL', -64957=>'AL', -64958=>'AL', -64959=>'AL', -64960=>'AL', -64961=>'AL', -64962=>'AL', -64963=>'AL', -64964=>'AL', -64965=>'AL', -64966=>'AL', -64967=>'AL', -65008=>'AL', -65009=>'AL', -65010=>'AL', -65011=>'AL', -65012=>'AL', -65013=>'AL', -65014=>'AL', -65015=>'AL', -65016=>'AL', -65017=>'AL', -65018=>'AL', -65019=>'AL', -65020=>'AL', -65021=>'ON', -65024=>'NSM', -65025=>'NSM', -65026=>'NSM', -65027=>'NSM', -65028=>'NSM', -65029=>'NSM', -65030=>'NSM', -65031=>'NSM', -65032=>'NSM', -65033=>'NSM', -65034=>'NSM', -65035=>'NSM', -65036=>'NSM', -65037=>'NSM', -65038=>'NSM', -65039=>'NSM', -65040=>'ON', -65041=>'ON', -65042=>'ON', -65043=>'ON', -65044=>'ON', -65045=>'ON', -65046=>'ON', -65047=>'ON', -65048=>'ON', -65049=>'ON', -65056=>'NSM', -65057=>'NSM', -65058=>'NSM', -65059=>'NSM', -65072=>'ON', -65073=>'ON', -65074=>'ON', -65075=>'ON', -65076=>'ON', -65077=>'ON', -65078=>'ON', -65079=>'ON', -65080=>'ON', -65081=>'ON', -65082=>'ON', -65083=>'ON', -65084=>'ON', -65085=>'ON', -65086=>'ON', -65087=>'ON', -65088=>'ON', -65089=>'ON', -65090=>'ON', -65091=>'ON', -65092=>'ON', -65093=>'ON', -65094=>'ON', -65095=>'ON', -65096=>'ON', -65097=>'ON', -65098=>'ON', -65099=>'ON', -65100=>'ON', -65101=>'ON', -65102=>'ON', -65103=>'ON', -65104=>'CS', -65105=>'ON', -65106=>'CS', -65108=>'ON', -65109=>'CS', -65110=>'ON', -65111=>'ON', -65112=>'ON', -65113=>'ON', -65114=>'ON', -65115=>'ON', -65116=>'ON', -65117=>'ON', -65118=>'ON', -65119=>'ET', -65120=>'ON', -65121=>'ON', -65122=>'ES', -65123=>'ES', -65124=>'ON', -65125=>'ON', -65126=>'ON', -65128=>'ON', -65129=>'ET', -65130=>'ET', -65131=>'ON', -65136=>'AL', -65137=>'AL', -65138=>'AL', -65139=>'AL', -65140=>'AL', -65142=>'AL', -65143=>'AL', -65144=>'AL', -65145=>'AL', -65146=>'AL', -65147=>'AL', -65148=>'AL', -65149=>'AL', -65150=>'AL', -65151=>'AL', -65152=>'AL', -65153=>'AL', -65154=>'AL', -65155=>'AL', -65156=>'AL', -65157=>'AL', -65158=>'AL', -65159=>'AL', -65160=>'AL', -65161=>'AL', -65162=>'AL', -65163=>'AL', -65164=>'AL', -65165=>'AL', -65166=>'AL', -65167=>'AL', -65168=>'AL', -65169=>'AL', -65170=>'AL', -65171=>'AL', -65172=>'AL', -65173=>'AL', -65174=>'AL', -65175=>'AL', -65176=>'AL', -65177=>'AL', -65178=>'AL', -65179=>'AL', -65180=>'AL', -65181=>'AL', -65182=>'AL', -65183=>'AL', -65184=>'AL', -65185=>'AL', -65186=>'AL', -65187=>'AL', -65188=>'AL', -65189=>'AL', -65190=>'AL', -65191=>'AL', -65192=>'AL', -65193=>'AL', -65194=>'AL', -65195=>'AL', -65196=>'AL', -65197=>'AL', -65198=>'AL', -65199=>'AL', -65200=>'AL', -65201=>'AL', -65202=>'AL', -65203=>'AL', -65204=>'AL', -65205=>'AL', -65206=>'AL', -65207=>'AL', -65208=>'AL', -65209=>'AL', -65210=>'AL', -65211=>'AL', -65212=>'AL', -65213=>'AL', -65214=>'AL', -65215=>'AL', -65216=>'AL', -65217=>'AL', -65218=>'AL', -65219=>'AL', -65220=>'AL', -65221=>'AL', -65222=>'AL', -65223=>'AL', -65224=>'AL', -65225=>'AL', -65226=>'AL', -65227=>'AL', -65228=>'AL', -65229=>'AL', -65230=>'AL', -65231=>'AL', -65232=>'AL', -65233=>'AL', -65234=>'AL', -65235=>'AL', -65236=>'AL', -65237=>'AL', -65238=>'AL', -65239=>'AL', -65240=>'AL', -65241=>'AL', -65242=>'AL', -65243=>'AL', -65244=>'AL', -65245=>'AL', -65246=>'AL', -65247=>'AL', -65248=>'AL', -65249=>'AL', -65250=>'AL', -65251=>'AL', -65252=>'AL', -65253=>'AL', -65254=>'AL', -65255=>'AL', -65256=>'AL', -65257=>'AL', -65258=>'AL', -65259=>'AL', -65260=>'AL', -65261=>'AL', -65262=>'AL', -65263=>'AL', -65264=>'AL', -65265=>'AL', -65266=>'AL', -65267=>'AL', -65268=>'AL', -65269=>'AL', -65270=>'AL', -65271=>'AL', -65272=>'AL', -65273=>'AL', -65274=>'AL', -65275=>'AL', -65276=>'AL', -65279=>'BN', -65281=>'ON', -65282=>'ON', -65283=>'ET', -65284=>'ET', -65285=>'ET', -65286=>'ON', -65287=>'ON', -65288=>'ON', -65289=>'ON', -65290=>'ON', -65291=>'ES', -65292=>'CS', -65293=>'ES', -65294=>'CS', -65295=>'CS', -65296=>'EN', -65297=>'EN', -65298=>'EN', -65299=>'EN', -65300=>'EN', -65301=>'EN', -65302=>'EN', -65303=>'EN', -65304=>'EN', -65305=>'EN', -65306=>'CS', -65307=>'ON', -65308=>'ON', -65309=>'ON', -65310=>'ON', -65311=>'ON', -65312=>'ON', -65313=>'L', -65314=>'L', -65315=>'L', -65316=>'L', -65317=>'L', -65318=>'L', -65319=>'L', -65320=>'L', -65321=>'L', -65322=>'L', -65323=>'L', -65324=>'L', -65325=>'L', -65326=>'L', -65327=>'L', -65328=>'L', -65329=>'L', -65330=>'L', -65331=>'L', -65332=>'L', -65333=>'L', -65334=>'L', -65335=>'L', -65336=>'L', -65337=>'L', -65338=>'L', -65339=>'ON', -65340=>'ON', -65341=>'ON', -65342=>'ON', -65343=>'ON', -65344=>'ON', -65345=>'L', -65346=>'L', -65347=>'L', -65348=>'L', -65349=>'L', -65350=>'L', -65351=>'L', -65352=>'L', -65353=>'L', -65354=>'L', -65355=>'L', -65356=>'L', -65357=>'L', -65358=>'L', -65359=>'L', -65360=>'L', -65361=>'L', -65362=>'L', -65363=>'L', -65364=>'L', -65365=>'L', -65366=>'L', -65367=>'L', -65368=>'L', -65369=>'L', -65370=>'L', -65371=>'ON', -65372=>'ON', -65373=>'ON', -65374=>'ON', -65375=>'ON', -65376=>'ON', -65377=>'ON', -65378=>'ON', -65379=>'ON', -65380=>'ON', -65381=>'ON', -65382=>'L', -65383=>'L', -65384=>'L', -65385=>'L', -65386=>'L', -65387=>'L', -65388=>'L', -65389=>'L', -65390=>'L', -65391=>'L', -65392=>'L', -65393=>'L', -65394=>'L', -65395=>'L', -65396=>'L', -65397=>'L', -65398=>'L', -65399=>'L', -65400=>'L', -65401=>'L', -65402=>'L', -65403=>'L', -65404=>'L', -65405=>'L', -65406=>'L', -65407=>'L', -65408=>'L', -65409=>'L', -65410=>'L', -65411=>'L', -65412=>'L', -65413=>'L', -65414=>'L', -65415=>'L', -65416=>'L', -65417=>'L', -65418=>'L', -65419=>'L', -65420=>'L', -65421=>'L', -65422=>'L', -65423=>'L', -65424=>'L', -65425=>'L', -65426=>'L', -65427=>'L', -65428=>'L', -65429=>'L', -65430=>'L', -65431=>'L', -65432=>'L', -65433=>'L', -65434=>'L', -65435=>'L', -65436=>'L', -65437=>'L', -65438=>'L', -65439=>'L', -65440=>'L', -65441=>'L', -65442=>'L', -65443=>'L', -65444=>'L', -65445=>'L', -65446=>'L', -65447=>'L', -65448=>'L', -65449=>'L', -65450=>'L', -65451=>'L', -65452=>'L', -65453=>'L', -65454=>'L', -65455=>'L', -65456=>'L', -65457=>'L', -65458=>'L', -65459=>'L', -65460=>'L', -65461=>'L', -65462=>'L', -65463=>'L', -65464=>'L', -65465=>'L', -65466=>'L', -65467=>'L', -65468=>'L', -65469=>'L', -65470=>'L', -65474=>'L', -65475=>'L', -65476=>'L', -65477=>'L', -65478=>'L', -65479=>'L', -65482=>'L', -65483=>'L', -65484=>'L', -65485=>'L', -65486=>'L', -65487=>'L', -65490=>'L', -65491=>'L', -65492=>'L', -65493=>'L', -65494=>'L', -65495=>'L', -65498=>'L', -65499=>'L', -65500=>'L', -65504=>'ET', -65505=>'ET', -65506=>'ON', -65507=>'ON', -65508=>'ON', -65509=>'ET', -65510=>'ET', -65512=>'ON', -65513=>'ON', -65514=>'ON', -65515=>'ON', -65516=>'ON', -65517=>'ON', -65518=>'ON', -65529=>'ON', -65530=>'ON', -65531=>'ON', -65532=>'ON', -65533=>'ON', -65536=>'L', -65537=>'L', -65538=>'L', -65539=>'L', -65540=>'L', -65541=>'L', -65542=>'L', -65543=>'L', -65544=>'L', -65545=>'L', -65546=>'L', -65547=>'L', -65549=>'L', -65550=>'L', -65551=>'L', -65552=>'L', -65553=>'L', -65554=>'L', -65555=>'L', -65556=>'L', -65557=>'L', -65558=>'L', -65559=>'L', -65560=>'L', -65561=>'L', -65562=>'L', -65563=>'L', -65564=>'L', -65565=>'L', -65566=>'L', -65567=>'L', -65568=>'L', -65569=>'L', -65570=>'L', -65571=>'L', -65572=>'L', -65573=>'L', -65574=>'L', -65576=>'L', -65577=>'L', -65578=>'L', -65579=>'L', -65580=>'L', -65581=>'L', -65582=>'L', -65583=>'L', -65584=>'L', -65585=>'L', -65586=>'L', -65587=>'L', -65588=>'L', -65589=>'L', -65590=>'L', -65591=>'L', -65592=>'L', -65593=>'L', -65594=>'L', -65596=>'L', -65597=>'L', -65599=>'L', -65600=>'L', -65601=>'L', -65602=>'L', -65603=>'L', -65604=>'L', -65605=>'L', -65606=>'L', -65607=>'L', -65608=>'L', -65609=>'L', -65610=>'L', -65611=>'L', -65612=>'L', -65613=>'L', -65616=>'L', -65617=>'L', -65618=>'L', -65619=>'L', -65620=>'L', -65621=>'L', -65622=>'L', -65623=>'L', -65624=>'L', -65625=>'L', -65626=>'L', -65627=>'L', -65628=>'L', -65629=>'L', -65664=>'L', -65665=>'L', -65666=>'L', -65667=>'L', -65668=>'L', -65669=>'L', -65670=>'L', -65671=>'L', -65672=>'L', -65673=>'L', -65674=>'L', -65675=>'L', -65676=>'L', -65677=>'L', -65678=>'L', -65679=>'L', -65680=>'L', -65681=>'L', -65682=>'L', -65683=>'L', -65684=>'L', -65685=>'L', -65686=>'L', -65687=>'L', -65688=>'L', -65689=>'L', -65690=>'L', -65691=>'L', -65692=>'L', -65693=>'L', -65694=>'L', -65695=>'L', -65696=>'L', -65697=>'L', -65698=>'L', -65699=>'L', -65700=>'L', -65701=>'L', -65702=>'L', -65703=>'L', -65704=>'L', -65705=>'L', -65706=>'L', -65707=>'L', -65708=>'L', -65709=>'L', -65710=>'L', -65711=>'L', -65712=>'L', -65713=>'L', -65714=>'L', -65715=>'L', -65716=>'L', -65717=>'L', -65718=>'L', -65719=>'L', -65720=>'L', -65721=>'L', -65722=>'L', -65723=>'L', -65724=>'L', -65725=>'L', -65726=>'L', -65727=>'L', -65728=>'L', -65729=>'L', -65730=>'L', -65731=>'L', -65732=>'L', -65733=>'L', -65734=>'L', -65735=>'L', -65736=>'L', -65737=>'L', -65738=>'L', -65739=>'L', -65740=>'L', -65741=>'L', -65742=>'L', -65743=>'L', -65744=>'L', -65745=>'L', -65746=>'L', -65747=>'L', -65748=>'L', -65749=>'L', -65750=>'L', -65751=>'L', -65752=>'L', -65753=>'L', -65754=>'L', -65755=>'L', -65756=>'L', -65757=>'L', -65758=>'L', -65759=>'L', -65760=>'L', -65761=>'L', -65762=>'L', -65763=>'L', -65764=>'L', -65765=>'L', -65766=>'L', -65767=>'L', -65768=>'L', -65769=>'L', -65770=>'L', -65771=>'L', -65772=>'L', -65773=>'L', -65774=>'L', -65775=>'L', -65776=>'L', -65777=>'L', -65778=>'L', -65779=>'L', -65780=>'L', -65781=>'L', -65782=>'L', -65783=>'L', -65784=>'L', -65785=>'L', -65786=>'L', -65792=>'L', -65793=>'ON', -65794=>'L', -65799=>'L', -65800=>'L', -65801=>'L', -65802=>'L', -65803=>'L', -65804=>'L', -65805=>'L', -65806=>'L', -65807=>'L', -65808=>'L', -65809=>'L', -65810=>'L', -65811=>'L', -65812=>'L', -65813=>'L', -65814=>'L', -65815=>'L', -65816=>'L', -65817=>'L', -65818=>'L', -65819=>'L', -65820=>'L', -65821=>'L', -65822=>'L', -65823=>'L', -65824=>'L', -65825=>'L', -65826=>'L', -65827=>'L', -65828=>'L', -65829=>'L', -65830=>'L', -65831=>'L', -65832=>'L', -65833=>'L', -65834=>'L', -65835=>'L', -65836=>'L', -65837=>'L', -65838=>'L', -65839=>'L', -65840=>'L', -65841=>'L', -65842=>'L', -65843=>'L', -65847=>'L', -65848=>'L', -65849=>'L', -65850=>'L', -65851=>'L', -65852=>'L', -65853=>'L', -65854=>'L', -65855=>'L', -65856=>'ON', -65857=>'ON', -65858=>'ON', -65859=>'ON', -65860=>'ON', -65861=>'ON', -65862=>'ON', -65863=>'ON', -65864=>'ON', -65865=>'ON', -65866=>'ON', -65867=>'ON', -65868=>'ON', -65869=>'ON', -65870=>'ON', -65871=>'ON', -65872=>'ON', -65873=>'ON', -65874=>'ON', -65875=>'ON', -65876=>'ON', -65877=>'ON', -65878=>'ON', -65879=>'ON', -65880=>'ON', -65881=>'ON', -65882=>'ON', -65883=>'ON', -65884=>'ON', -65885=>'ON', -65886=>'ON', -65887=>'ON', -65888=>'ON', -65889=>'ON', -65890=>'ON', -65891=>'ON', -65892=>'ON', -65893=>'ON', -65894=>'ON', -65895=>'ON', -65896=>'ON', -65897=>'ON', -65898=>'ON', -65899=>'ON', -65900=>'ON', -65901=>'ON', -65902=>'ON', -65903=>'ON', -65904=>'ON', -65905=>'ON', -65906=>'ON', -65907=>'ON', -65908=>'ON', -65909=>'ON', -65910=>'ON', -65911=>'ON', -65912=>'ON', -65913=>'ON', -65914=>'ON', -65915=>'ON', -65916=>'ON', -65917=>'ON', -65918=>'ON', -65919=>'ON', -65920=>'ON', -65921=>'ON', -65922=>'ON', -65923=>'ON', -65924=>'ON', -65925=>'ON', -65926=>'ON', -65927=>'ON', -65928=>'ON', -65929=>'ON', -65930=>'ON', -66304=>'L', -66305=>'L', -66306=>'L', -66307=>'L', -66308=>'L', -66309=>'L', -66310=>'L', -66311=>'L', -66312=>'L', -66313=>'L', -66314=>'L', -66315=>'L', -66316=>'L', -66317=>'L', -66318=>'L', -66319=>'L', -66320=>'L', -66321=>'L', -66322=>'L', -66323=>'L', -66324=>'L', -66325=>'L', -66326=>'L', -66327=>'L', -66328=>'L', -66329=>'L', -66330=>'L', -66331=>'L', -66332=>'L', -66333=>'L', -66334=>'L', -66336=>'L', -66337=>'L', -66338=>'L', -66339=>'L', -66352=>'L', -66353=>'L', -66354=>'L', -66355=>'L', -66356=>'L', -66357=>'L', -66358=>'L', -66359=>'L', -66360=>'L', -66361=>'L', -66362=>'L', -66363=>'L', -66364=>'L', -66365=>'L', -66366=>'L', -66367=>'L', -66368=>'L', -66369=>'L', -66370=>'L', -66371=>'L', -66372=>'L', -66373=>'L', -66374=>'L', -66375=>'L', -66376=>'L', -66377=>'L', -66378=>'L', -66432=>'L', -66433=>'L', -66434=>'L', -66435=>'L', -66436=>'L', -66437=>'L', -66438=>'L', -66439=>'L', -66440=>'L', -66441=>'L', -66442=>'L', -66443=>'L', -66444=>'L', -66445=>'L', -66446=>'L', -66447=>'L', -66448=>'L', -66449=>'L', -66450=>'L', -66451=>'L', -66452=>'L', -66453=>'L', -66454=>'L', -66455=>'L', -66456=>'L', -66457=>'L', -66458=>'L', -66459=>'L', -66460=>'L', -66461=>'L', -66463=>'L', -66464=>'L', -66465=>'L', -66466=>'L', -66467=>'L', -66468=>'L', -66469=>'L', -66470=>'L', -66471=>'L', -66472=>'L', -66473=>'L', -66474=>'L', -66475=>'L', -66476=>'L', -66477=>'L', -66478=>'L', -66479=>'L', -66480=>'L', -66481=>'L', -66482=>'L', -66483=>'L', -66484=>'L', -66485=>'L', -66486=>'L', -66487=>'L', -66488=>'L', -66489=>'L', -66490=>'L', -66491=>'L', -66492=>'L', -66493=>'L', -66494=>'L', -66495=>'L', -66496=>'L', -66497=>'L', -66498=>'L', -66499=>'L', -66504=>'L', -66505=>'L', -66506=>'L', -66507=>'L', -66508=>'L', -66509=>'L', -66510=>'L', -66511=>'L', -66512=>'L', -66513=>'L', -66514=>'L', -66515=>'L', -66516=>'L', -66517=>'L', -66560=>'L', -66561=>'L', -66562=>'L', -66563=>'L', -66564=>'L', -66565=>'L', -66566=>'L', -66567=>'L', -66568=>'L', -66569=>'L', -66570=>'L', -66571=>'L', -66572=>'L', -66573=>'L', -66574=>'L', -66575=>'L', -66576=>'L', -66577=>'L', -66578=>'L', -66579=>'L', -66580=>'L', -66581=>'L', -66582=>'L', -66583=>'L', -66584=>'L', -66585=>'L', -66586=>'L', -66587=>'L', -66588=>'L', -66589=>'L', -66590=>'L', -66591=>'L', -66592=>'L', -66593=>'L', -66594=>'L', -66595=>'L', -66596=>'L', -66597=>'L', -66598=>'L', -66599=>'L', -66600=>'L', -66601=>'L', -66602=>'L', -66603=>'L', -66604=>'L', -66605=>'L', -66606=>'L', -66607=>'L', -66608=>'L', -66609=>'L', -66610=>'L', -66611=>'L', -66612=>'L', -66613=>'L', -66614=>'L', -66615=>'L', -66616=>'L', -66617=>'L', -66618=>'L', -66619=>'L', -66620=>'L', -66621=>'L', -66622=>'L', -66623=>'L', -66624=>'L', -66625=>'L', -66626=>'L', -66627=>'L', -66628=>'L', -66629=>'L', -66630=>'L', -66631=>'L', -66632=>'L', -66633=>'L', -66634=>'L', -66635=>'L', -66636=>'L', -66637=>'L', -66638=>'L', -66639=>'L', -66640=>'L', -66641=>'L', -66642=>'L', -66643=>'L', -66644=>'L', -66645=>'L', -66646=>'L', -66647=>'L', -66648=>'L', -66649=>'L', -66650=>'L', -66651=>'L', -66652=>'L', -66653=>'L', -66654=>'L', -66655=>'L', -66656=>'L', -66657=>'L', -66658=>'L', -66659=>'L', -66660=>'L', -66661=>'L', -66662=>'L', -66663=>'L', -66664=>'L', -66665=>'L', -66666=>'L', -66667=>'L', -66668=>'L', -66669=>'L', -66670=>'L', -66671=>'L', -66672=>'L', -66673=>'L', -66674=>'L', -66675=>'L', -66676=>'L', -66677=>'L', -66678=>'L', -66679=>'L', -66680=>'L', -66681=>'L', -66682=>'L', -66683=>'L', -66684=>'L', -66685=>'L', -66686=>'L', -66687=>'L', -66688=>'L', -66689=>'L', -66690=>'L', -66691=>'L', -66692=>'L', -66693=>'L', -66694=>'L', -66695=>'L', -66696=>'L', -66697=>'L', -66698=>'L', -66699=>'L', -66700=>'L', -66701=>'L', -66702=>'L', -66703=>'L', -66704=>'L', -66705=>'L', -66706=>'L', -66707=>'L', -66708=>'L', -66709=>'L', -66710=>'L', -66711=>'L', -66712=>'L', -66713=>'L', -66714=>'L', -66715=>'L', -66716=>'L', -66717=>'L', -66720=>'L', -66721=>'L', -66722=>'L', -66723=>'L', -66724=>'L', -66725=>'L', -66726=>'L', -66727=>'L', -66728=>'L', -66729=>'L', -67584=>'R', -67585=>'R', -67586=>'R', -67587=>'R', -67588=>'R', -67589=>'R', -67592=>'R', -67594=>'R', -67595=>'R', -67596=>'R', -67597=>'R', -67598=>'R', -67599=>'R', -67600=>'R', -67601=>'R', -67602=>'R', -67603=>'R', -67604=>'R', -67605=>'R', -67606=>'R', -67607=>'R', -67608=>'R', -67609=>'R', -67610=>'R', -67611=>'R', -67612=>'R', -67613=>'R', -67614=>'R', -67615=>'R', -67616=>'R', -67617=>'R', -67618=>'R', -67619=>'R', -67620=>'R', -67621=>'R', -67622=>'R', -67623=>'R', -67624=>'R', -67625=>'R', -67626=>'R', -67627=>'R', -67628=>'R', -67629=>'R', -67630=>'R', -67631=>'R', -67632=>'R', -67633=>'R', -67634=>'R', -67635=>'R', -67636=>'R', -67637=>'R', -67639=>'R', -67640=>'R', -67644=>'R', -67647=>'R', -67840=>'R', -67841=>'R', -67842=>'R', -67843=>'R', -67844=>'R', -67845=>'R', -67846=>'R', -67847=>'R', -67848=>'R', -67849=>'R', -67850=>'R', -67851=>'R', -67852=>'R', -67853=>'R', -67854=>'R', -67855=>'R', -67856=>'R', -67857=>'R', -67858=>'R', -67859=>'R', -67860=>'R', -67861=>'R', -67862=>'R', -67863=>'R', -67864=>'R', -67865=>'R', -67871=>'ON', -68096=>'R', -68097=>'NSM', -68098=>'NSM', -68099=>'NSM', -68101=>'NSM', -68102=>'NSM', -68108=>'NSM', -68109=>'NSM', -68110=>'NSM', -68111=>'NSM', -68112=>'R', -68113=>'R', -68114=>'R', -68115=>'R', -68117=>'R', -68118=>'R', -68119=>'R', -68121=>'R', -68122=>'R', -68123=>'R', -68124=>'R', -68125=>'R', -68126=>'R', -68127=>'R', -68128=>'R', -68129=>'R', -68130=>'R', -68131=>'R', -68132=>'R', -68133=>'R', -68134=>'R', -68135=>'R', -68136=>'R', -68137=>'R', -68138=>'R', -68139=>'R', -68140=>'R', -68141=>'R', -68142=>'R', -68143=>'R', -68144=>'R', -68145=>'R', -68146=>'R', -68147=>'R', -68152=>'NSM', -68153=>'NSM', -68154=>'NSM', -68159=>'NSM', -68160=>'R', -68161=>'R', -68162=>'R', -68163=>'R', -68164=>'R', -68165=>'R', -68166=>'R', -68167=>'R', -68176=>'R', -68177=>'R', -68178=>'R', -68179=>'R', -68180=>'R', -68181=>'R', -68182=>'R', -68183=>'R', -68184=>'R', -73728=>'L', -73729=>'L', -73730=>'L', -73731=>'L', -73732=>'L', -73733=>'L', -73734=>'L', -73735=>'L', -73736=>'L', -73737=>'L', -73738=>'L', -73739=>'L', -73740=>'L', -73741=>'L', -73742=>'L', -73743=>'L', -73744=>'L', -73745=>'L', -73746=>'L', -73747=>'L', -73748=>'L', -73749=>'L', -73750=>'L', -73751=>'L', -73752=>'L', -73753=>'L', -73754=>'L', -73755=>'L', -73756=>'L', -73757=>'L', -73758=>'L', -73759=>'L', -73760=>'L', -73761=>'L', -73762=>'L', -73763=>'L', -73764=>'L', -73765=>'L', -73766=>'L', -73767=>'L', -73768=>'L', -73769=>'L', -73770=>'L', -73771=>'L', -73772=>'L', -73773=>'L', -73774=>'L', -73775=>'L', -73776=>'L', -73777=>'L', -73778=>'L', -73779=>'L', -73780=>'L', -73781=>'L', -73782=>'L', -73783=>'L', -73784=>'L', -73785=>'L', -73786=>'L', -73787=>'L', -73788=>'L', -73789=>'L', -73790=>'L', -73791=>'L', -73792=>'L', -73793=>'L', -73794=>'L', -73795=>'L', -73796=>'L', -73797=>'L', -73798=>'L', -73799=>'L', -73800=>'L', -73801=>'L', -73802=>'L', -73803=>'L', -73804=>'L', -73805=>'L', -73806=>'L', -73807=>'L', -73808=>'L', -73809=>'L', -73810=>'L', -73811=>'L', -73812=>'L', -73813=>'L', -73814=>'L', -73815=>'L', -73816=>'L', -73817=>'L', -73818=>'L', -73819=>'L', -73820=>'L', -73821=>'L', -73822=>'L', -73823=>'L', -73824=>'L', -73825=>'L', -73826=>'L', -73827=>'L', -73828=>'L', -73829=>'L', -73830=>'L', -73831=>'L', -73832=>'L', -73833=>'L', -73834=>'L', -73835=>'L', -73836=>'L', -73837=>'L', -73838=>'L', -73839=>'L', -73840=>'L', -73841=>'L', -73842=>'L', -73843=>'L', -73844=>'L', -73845=>'L', -73846=>'L', -73847=>'L', -73848=>'L', -73849=>'L', -73850=>'L', -73851=>'L', -73852=>'L', -73853=>'L', -73854=>'L', -73855=>'L', -73856=>'L', -73857=>'L', -73858=>'L', -73859=>'L', -73860=>'L', -73861=>'L', -73862=>'L', -73863=>'L', -73864=>'L', -73865=>'L', -73866=>'L', -73867=>'L', -73868=>'L', -73869=>'L', -73870=>'L', -73871=>'L', -73872=>'L', -73873=>'L', -73874=>'L', -73875=>'L', -73876=>'L', -73877=>'L', -73878=>'L', -73879=>'L', -73880=>'L', -73881=>'L', -73882=>'L', -73883=>'L', -73884=>'L', -73885=>'L', -73886=>'L', -73887=>'L', -73888=>'L', -73889=>'L', -73890=>'L', -73891=>'L', -73892=>'L', -73893=>'L', -73894=>'L', -73895=>'L', -73896=>'L', -73897=>'L', -73898=>'L', -73899=>'L', -73900=>'L', -73901=>'L', -73902=>'L', -73903=>'L', -73904=>'L', -73905=>'L', -73906=>'L', -73907=>'L', -73908=>'L', -73909=>'L', -73910=>'L', -73911=>'L', -73912=>'L', -73913=>'L', -73914=>'L', -73915=>'L', -73916=>'L', -73917=>'L', -73918=>'L', -73919=>'L', -73920=>'L', -73921=>'L', -73922=>'L', -73923=>'L', -73924=>'L', -73925=>'L', -73926=>'L', -73927=>'L', -73928=>'L', -73929=>'L', -73930=>'L', -73931=>'L', -73932=>'L', -73933=>'L', -73934=>'L', -73935=>'L', -73936=>'L', -73937=>'L', -73938=>'L', -73939=>'L', -73940=>'L', -73941=>'L', -73942=>'L', -73943=>'L', -73944=>'L', -73945=>'L', -73946=>'L', -73947=>'L', -73948=>'L', -73949=>'L', -73950=>'L', -73951=>'L', -73952=>'L', -73953=>'L', -73954=>'L', -73955=>'L', -73956=>'L', -73957=>'L', -73958=>'L', -73959=>'L', -73960=>'L', -73961=>'L', -73962=>'L', -73963=>'L', -73964=>'L', -73965=>'L', -73966=>'L', -73967=>'L', -73968=>'L', -73969=>'L', -73970=>'L', -73971=>'L', -73972=>'L', -73973=>'L', -73974=>'L', -73975=>'L', -73976=>'L', -73977=>'L', -73978=>'L', -73979=>'L', -73980=>'L', -73981=>'L', -73982=>'L', -73983=>'L', -73984=>'L', -73985=>'L', -73986=>'L', -73987=>'L', -73988=>'L', -73989=>'L', -73990=>'L', -73991=>'L', -73992=>'L', -73993=>'L', -73994=>'L', -73995=>'L', -73996=>'L', -73997=>'L', -73998=>'L', -73999=>'L', -74000=>'L', -74001=>'L', -74002=>'L', -74003=>'L', -74004=>'L', -74005=>'L', -74006=>'L', -74007=>'L', -74008=>'L', -74009=>'L', -74010=>'L', -74011=>'L', -74012=>'L', -74013=>'L', -74014=>'L', -74015=>'L', -74016=>'L', -74017=>'L', -74018=>'L', -74019=>'L', -74020=>'L', -74021=>'L', -74022=>'L', -74023=>'L', -74024=>'L', -74025=>'L', -74026=>'L', -74027=>'L', -74028=>'L', -74029=>'L', -74030=>'L', -74031=>'L', -74032=>'L', -74033=>'L', -74034=>'L', -74035=>'L', -74036=>'L', -74037=>'L', -74038=>'L', -74039=>'L', -74040=>'L', -74041=>'L', -74042=>'L', -74043=>'L', -74044=>'L', -74045=>'L', -74046=>'L', -74047=>'L', -74048=>'L', -74049=>'L', -74050=>'L', -74051=>'L', -74052=>'L', -74053=>'L', -74054=>'L', -74055=>'L', -74056=>'L', -74057=>'L', -74058=>'L', -74059=>'L', -74060=>'L', -74061=>'L', -74062=>'L', -74063=>'L', -74064=>'L', -74065=>'L', -74066=>'L', -74067=>'L', -74068=>'L', -74069=>'L', -74070=>'L', -74071=>'L', -74072=>'L', -74073=>'L', -74074=>'L', -74075=>'L', -74076=>'L', -74077=>'L', -74078=>'L', -74079=>'L', -74080=>'L', -74081=>'L', -74082=>'L', -74083=>'L', -74084=>'L', -74085=>'L', -74086=>'L', -74087=>'L', -74088=>'L', -74089=>'L', -74090=>'L', -74091=>'L', -74092=>'L', -74093=>'L', -74094=>'L', -74095=>'L', -74096=>'L', -74097=>'L', -74098=>'L', -74099=>'L', -74100=>'L', -74101=>'L', -74102=>'L', -74103=>'L', -74104=>'L', -74105=>'L', -74106=>'L', -74107=>'L', -74108=>'L', -74109=>'L', -74110=>'L', -74111=>'L', -74112=>'L', -74113=>'L', -74114=>'L', -74115=>'L', -74116=>'L', -74117=>'L', -74118=>'L', -74119=>'L', -74120=>'L', -74121=>'L', -74122=>'L', -74123=>'L', -74124=>'L', -74125=>'L', -74126=>'L', -74127=>'L', -74128=>'L', -74129=>'L', -74130=>'L', -74131=>'L', -74132=>'L', -74133=>'L', -74134=>'L', -74135=>'L', -74136=>'L', -74137=>'L', -74138=>'L', -74139=>'L', -74140=>'L', -74141=>'L', -74142=>'L', -74143=>'L', -74144=>'L', -74145=>'L', -74146=>'L', -74147=>'L', -74148=>'L', -74149=>'L', -74150=>'L', -74151=>'L', -74152=>'L', -74153=>'L', -74154=>'L', -74155=>'L', -74156=>'L', -74157=>'L', -74158=>'L', -74159=>'L', -74160=>'L', -74161=>'L', -74162=>'L', -74163=>'L', -74164=>'L', -74165=>'L', -74166=>'L', -74167=>'L', -74168=>'L', -74169=>'L', -74170=>'L', -74171=>'L', -74172=>'L', -74173=>'L', -74174=>'L', -74175=>'L', -74176=>'L', -74177=>'L', -74178=>'L', -74179=>'L', -74180=>'L', -74181=>'L', -74182=>'L', -74183=>'L', -74184=>'L', -74185=>'L', -74186=>'L', -74187=>'L', -74188=>'L', -74189=>'L', -74190=>'L', -74191=>'L', -74192=>'L', -74193=>'L', -74194=>'L', -74195=>'L', -74196=>'L', -74197=>'L', -74198=>'L', -74199=>'L', -74200=>'L', -74201=>'L', -74202=>'L', -74203=>'L', -74204=>'L', -74205=>'L', -74206=>'L', -74207=>'L', -74208=>'L', -74209=>'L', -74210=>'L', -74211=>'L', -74212=>'L', -74213=>'L', -74214=>'L', -74215=>'L', -74216=>'L', -74217=>'L', -74218=>'L', -74219=>'L', -74220=>'L', -74221=>'L', -74222=>'L', -74223=>'L', -74224=>'L', -74225=>'L', -74226=>'L', -74227=>'L', -74228=>'L', -74229=>'L', -74230=>'L', -74231=>'L', -74232=>'L', -74233=>'L', -74234=>'L', -74235=>'L', -74236=>'L', -74237=>'L', -74238=>'L', -74239=>'L', -74240=>'L', -74241=>'L', -74242=>'L', -74243=>'L', -74244=>'L', -74245=>'L', -74246=>'L', -74247=>'L', -74248=>'L', -74249=>'L', -74250=>'L', -74251=>'L', -74252=>'L', -74253=>'L', -74254=>'L', -74255=>'L', -74256=>'L', -74257=>'L', -74258=>'L', -74259=>'L', -74260=>'L', -74261=>'L', -74262=>'L', -74263=>'L', -74264=>'L', -74265=>'L', -74266=>'L', -74267=>'L', -74268=>'L', -74269=>'L', -74270=>'L', -74271=>'L', -74272=>'L', -74273=>'L', -74274=>'L', -74275=>'L', -74276=>'L', -74277=>'L', -74278=>'L', -74279=>'L', -74280=>'L', -74281=>'L', -74282=>'L', -74283=>'L', -74284=>'L', -74285=>'L', -74286=>'L', -74287=>'L', -74288=>'L', -74289=>'L', -74290=>'L', -74291=>'L', -74292=>'L', -74293=>'L', -74294=>'L', -74295=>'L', -74296=>'L', -74297=>'L', -74298=>'L', -74299=>'L', -74300=>'L', -74301=>'L', -74302=>'L', -74303=>'L', -74304=>'L', -74305=>'L', -74306=>'L', -74307=>'L', -74308=>'L', -74309=>'L', -74310=>'L', -74311=>'L', -74312=>'L', -74313=>'L', -74314=>'L', -74315=>'L', -74316=>'L', -74317=>'L', -74318=>'L', -74319=>'L', -74320=>'L', -74321=>'L', -74322=>'L', -74323=>'L', -74324=>'L', -74325=>'L', -74326=>'L', -74327=>'L', -74328=>'L', -74329=>'L', -74330=>'L', -74331=>'L', -74332=>'L', -74333=>'L', -74334=>'L', -74335=>'L', -74336=>'L', -74337=>'L', -74338=>'L', -74339=>'L', -74340=>'L', -74341=>'L', -74342=>'L', -74343=>'L', -74344=>'L', -74345=>'L', -74346=>'L', -74347=>'L', -74348=>'L', -74349=>'L', -74350=>'L', -74351=>'L', -74352=>'L', -74353=>'L', -74354=>'L', -74355=>'L', -74356=>'L', -74357=>'L', -74358=>'L', -74359=>'L', -74360=>'L', -74361=>'L', -74362=>'L', -74363=>'L', -74364=>'L', -74365=>'L', -74366=>'L', -74367=>'L', -74368=>'L', -74369=>'L', -74370=>'L', -74371=>'L', -74372=>'L', -74373=>'L', -74374=>'L', -74375=>'L', -74376=>'L', -74377=>'L', -74378=>'L', -74379=>'L', -74380=>'L', -74381=>'L', -74382=>'L', -74383=>'L', -74384=>'L', -74385=>'L', -74386=>'L', -74387=>'L', -74388=>'L', -74389=>'L', -74390=>'L', -74391=>'L', -74392=>'L', -74393=>'L', -74394=>'L', -74395=>'L', -74396=>'L', -74397=>'L', -74398=>'L', -74399=>'L', -74400=>'L', -74401=>'L', -74402=>'L', -74403=>'L', -74404=>'L', -74405=>'L', -74406=>'L', -74407=>'L', -74408=>'L', -74409=>'L', -74410=>'L', -74411=>'L', -74412=>'L', -74413=>'L', -74414=>'L', -74415=>'L', -74416=>'L', -74417=>'L', -74418=>'L', -74419=>'L', -74420=>'L', -74421=>'L', -74422=>'L', -74423=>'L', -74424=>'L', -74425=>'L', -74426=>'L', -74427=>'L', -74428=>'L', -74429=>'L', -74430=>'L', -74431=>'L', -74432=>'L', -74433=>'L', -74434=>'L', -74435=>'L', -74436=>'L', -74437=>'L', -74438=>'L', -74439=>'L', -74440=>'L', -74441=>'L', -74442=>'L', -74443=>'L', -74444=>'L', -74445=>'L', -74446=>'L', -74447=>'L', -74448=>'L', -74449=>'L', -74450=>'L', -74451=>'L', -74452=>'L', -74453=>'L', -74454=>'L', -74455=>'L', -74456=>'L', -74457=>'L', -74458=>'L', -74459=>'L', -74460=>'L', -74461=>'L', -74462=>'L', -74463=>'L', -74464=>'L', -74465=>'L', -74466=>'L', -74467=>'L', -74468=>'L', -74469=>'L', -74470=>'L', -74471=>'L', -74472=>'L', -74473=>'L', -74474=>'L', -74475=>'L', -74476=>'L', -74477=>'L', -74478=>'L', -74479=>'L', -74480=>'L', -74481=>'L', -74482=>'L', -74483=>'L', -74484=>'L', -74485=>'L', -74486=>'L', -74487=>'L', -74488=>'L', -74489=>'L', -74490=>'L', -74491=>'L', -74492=>'L', -74493=>'L', -74494=>'L', -74495=>'L', -74496=>'L', -74497=>'L', -74498=>'L', -74499=>'L', -74500=>'L', -74501=>'L', -74502=>'L', -74503=>'L', -74504=>'L', -74505=>'L', -74506=>'L', -74507=>'L', -74508=>'L', -74509=>'L', -74510=>'L', -74511=>'L', -74512=>'L', -74513=>'L', -74514=>'L', -74515=>'L', -74516=>'L', -74517=>'L', -74518=>'L', -74519=>'L', -74520=>'L', -74521=>'L', -74522=>'L', -74523=>'L', -74524=>'L', -74525=>'L', -74526=>'L', -74527=>'L', -74528=>'L', -74529=>'L', -74530=>'L', -74531=>'L', -74532=>'L', -74533=>'L', -74534=>'L', -74535=>'L', -74536=>'L', -74537=>'L', -74538=>'L', -74539=>'L', -74540=>'L', -74541=>'L', -74542=>'L', -74543=>'L', -74544=>'L', -74545=>'L', -74546=>'L', -74547=>'L', -74548=>'L', -74549=>'L', -74550=>'L', -74551=>'L', -74552=>'L', -74553=>'L', -74554=>'L', -74555=>'L', -74556=>'L', -74557=>'L', -74558=>'L', -74559=>'L', -74560=>'L', -74561=>'L', -74562=>'L', -74563=>'L', -74564=>'L', -74565=>'L', -74566=>'L', -74567=>'L', -74568=>'L', -74569=>'L', -74570=>'L', -74571=>'L', -74572=>'L', -74573=>'L', -74574=>'L', -74575=>'L', -74576=>'L', -74577=>'L', -74578=>'L', -74579=>'L', -74580=>'L', -74581=>'L', -74582=>'L', -74583=>'L', -74584=>'L', -74585=>'L', -74586=>'L', -74587=>'L', -74588=>'L', -74589=>'L', -74590=>'L', -74591=>'L', -74592=>'L', -74593=>'L', -74594=>'L', -74595=>'L', -74596=>'L', -74597=>'L', -74598=>'L', -74599=>'L', -74600=>'L', -74601=>'L', -74602=>'L', -74603=>'L', -74604=>'L', -74605=>'L', -74606=>'L', -74752=>'L', -74753=>'L', -74754=>'L', -74755=>'L', -74756=>'L', -74757=>'L', -74758=>'L', -74759=>'L', -74760=>'L', -74761=>'L', -74762=>'L', -74763=>'L', -74764=>'L', -74765=>'L', -74766=>'L', -74767=>'L', -74768=>'L', -74769=>'L', -74770=>'L', -74771=>'L', -74772=>'L', -74773=>'L', -74774=>'L', -74775=>'L', -74776=>'L', -74777=>'L', -74778=>'L', -74779=>'L', -74780=>'L', -74781=>'L', -74782=>'L', -74783=>'L', -74784=>'L', -74785=>'L', -74786=>'L', -74787=>'L', -74788=>'L', -74789=>'L', -74790=>'L', -74791=>'L', -74792=>'L', -74793=>'L', -74794=>'L', -74795=>'L', -74796=>'L', -74797=>'L', -74798=>'L', -74799=>'L', -74800=>'L', -74801=>'L', -74802=>'L', -74803=>'L', -74804=>'L', -74805=>'L', -74806=>'L', -74807=>'L', -74808=>'L', -74809=>'L', -74810=>'L', -74811=>'L', -74812=>'L', -74813=>'L', -74814=>'L', -74815=>'L', -74816=>'L', -74817=>'L', -74818=>'L', -74819=>'L', -74820=>'L', -74821=>'L', -74822=>'L', -74823=>'L', -74824=>'L', -74825=>'L', -74826=>'L', -74827=>'L', -74828=>'L', -74829=>'L', -74830=>'L', -74831=>'L', -74832=>'L', -74833=>'L', -74834=>'L', -74835=>'L', -74836=>'L', -74837=>'L', -74838=>'L', -74839=>'L', -74840=>'L', -74841=>'L', -74842=>'L', -74843=>'L', -74844=>'L', -74845=>'L', -74846=>'L', -74847=>'L', -74848=>'L', -74849=>'L', -74850=>'L', -74864=>'L', -74865=>'L', -74866=>'L', -74867=>'L', -118784=>'L', -118785=>'L', -118786=>'L', -118787=>'L', -118788=>'L', -118789=>'L', -118790=>'L', -118791=>'L', -118792=>'L', -118793=>'L', -118794=>'L', -118795=>'L', -118796=>'L', -118797=>'L', -118798=>'L', -118799=>'L', -118800=>'L', -118801=>'L', -118802=>'L', -118803=>'L', -118804=>'L', -118805=>'L', -118806=>'L', -118807=>'L', -118808=>'L', -118809=>'L', -118810=>'L', -118811=>'L', -118812=>'L', -118813=>'L', -118814=>'L', -118815=>'L', -118816=>'L', -118817=>'L', -118818=>'L', -118819=>'L', -118820=>'L', -118821=>'L', -118822=>'L', -118823=>'L', -118824=>'L', -118825=>'L', -118826=>'L', -118827=>'L', -118828=>'L', -118829=>'L', -118830=>'L', -118831=>'L', -118832=>'L', -118833=>'L', -118834=>'L', -118835=>'L', -118836=>'L', -118837=>'L', -118838=>'L', -118839=>'L', -118840=>'L', -118841=>'L', -118842=>'L', -118843=>'L', -118844=>'L', -118845=>'L', -118846=>'L', -118847=>'L', -118848=>'L', -118849=>'L', -118850=>'L', -118851=>'L', -118852=>'L', -118853=>'L', -118854=>'L', -118855=>'L', -118856=>'L', -118857=>'L', -118858=>'L', -118859=>'L', -118860=>'L', -118861=>'L', -118862=>'L', -118863=>'L', -118864=>'L', -118865=>'L', -118866=>'L', -118867=>'L', -118868=>'L', -118869=>'L', -118870=>'L', -118871=>'L', -118872=>'L', -118873=>'L', -118874=>'L', -118875=>'L', -118876=>'L', -118877=>'L', -118878=>'L', -118879=>'L', -118880=>'L', -118881=>'L', -118882=>'L', -118883=>'L', -118884=>'L', -118885=>'L', -118886=>'L', -118887=>'L', -118888=>'L', -118889=>'L', -118890=>'L', -118891=>'L', -118892=>'L', -118893=>'L', -118894=>'L', -118895=>'L', -118896=>'L', -118897=>'L', -118898=>'L', -118899=>'L', -118900=>'L', -118901=>'L', -118902=>'L', -118903=>'L', -118904=>'L', -118905=>'L', -118906=>'L', -118907=>'L', -118908=>'L', -118909=>'L', -118910=>'L', -118911=>'L', -118912=>'L', -118913=>'L', -118914=>'L', -118915=>'L', -118916=>'L', -118917=>'L', -118918=>'L', -118919=>'L', -118920=>'L', -118921=>'L', -118922=>'L', -118923=>'L', -118924=>'L', -118925=>'L', -118926=>'L', -118927=>'L', -118928=>'L', -118929=>'L', -118930=>'L', -118931=>'L', -118932=>'L', -118933=>'L', -118934=>'L', -118935=>'L', -118936=>'L', -118937=>'L', -118938=>'L', -118939=>'L', -118940=>'L', -118941=>'L', -118942=>'L', -118943=>'L', -118944=>'L', -118945=>'L', -118946=>'L', -118947=>'L', -118948=>'L', -118949=>'L', -118950=>'L', -118951=>'L', -118952=>'L', -118953=>'L', -118954=>'L', -118955=>'L', -118956=>'L', -118957=>'L', -118958=>'L', -118959=>'L', -118960=>'L', -118961=>'L', -118962=>'L', -118963=>'L', -118964=>'L', -118965=>'L', -118966=>'L', -118967=>'L', -118968=>'L', -118969=>'L', -118970=>'L', -118971=>'L', -118972=>'L', -118973=>'L', -118974=>'L', -118975=>'L', -118976=>'L', -118977=>'L', -118978=>'L', -118979=>'L', -118980=>'L', -118981=>'L', -118982=>'L', -118983=>'L', -118984=>'L', -118985=>'L', -118986=>'L', -118987=>'L', -118988=>'L', -118989=>'L', -118990=>'L', -118991=>'L', -118992=>'L', -118993=>'L', -118994=>'L', -118995=>'L', -118996=>'L', -118997=>'L', -118998=>'L', -118999=>'L', -119000=>'L', -119001=>'L', -119002=>'L', -119003=>'L', -119004=>'L', -119005=>'L', -119006=>'L', -119007=>'L', -119008=>'L', -119009=>'L', -119010=>'L', -119011=>'L', -119012=>'L', -119013=>'L', -119014=>'L', -119015=>'L', -119016=>'L', -119017=>'L', -119018=>'L', -119019=>'L', -119020=>'L', -119021=>'L', -119022=>'L', -119023=>'L', -119024=>'L', -119025=>'L', -119026=>'L', -119027=>'L', -119028=>'L', -119029=>'L', -119040=>'L', -119041=>'L', -119042=>'L', -119043=>'L', -119044=>'L', -119045=>'L', -119046=>'L', -119047=>'L', -119048=>'L', -119049=>'L', -119050=>'L', -119051=>'L', -119052=>'L', -119053=>'L', -119054=>'L', -119055=>'L', -119056=>'L', -119057=>'L', -119058=>'L', -119059=>'L', -119060=>'L', -119061=>'L', -119062=>'L', -119063=>'L', -119064=>'L', -119065=>'L', -119066=>'L', -119067=>'L', -119068=>'L', -119069=>'L', -119070=>'L', -119071=>'L', -119072=>'L', -119073=>'L', -119074=>'L', -119075=>'L', -119076=>'L', -119077=>'L', -119078=>'L', -119082=>'L', -119083=>'L', -119084=>'L', -119085=>'L', -119086=>'L', -119087=>'L', -119088=>'L', -119089=>'L', -119090=>'L', -119091=>'L', -119092=>'L', -119093=>'L', -119094=>'L', -119095=>'L', -119096=>'L', -119097=>'L', -119098=>'L', -119099=>'L', -119100=>'L', -119101=>'L', -119102=>'L', -119103=>'L', -119104=>'L', -119105=>'L', -119106=>'L', -119107=>'L', -119108=>'L', -119109=>'L', -119110=>'L', -119111=>'L', -119112=>'L', -119113=>'L', -119114=>'L', -119115=>'L', -119116=>'L', -119117=>'L', -119118=>'L', -119119=>'L', -119120=>'L', -119121=>'L', -119122=>'L', -119123=>'L', -119124=>'L', -119125=>'L', -119126=>'L', -119127=>'L', -119128=>'L', -119129=>'L', -119130=>'L', -119131=>'L', -119132=>'L', -119133=>'L', -119134=>'L', -119135=>'L', -119136=>'L', -119137=>'L', -119138=>'L', -119139=>'L', -119140=>'L', -119141=>'L', -119142=>'L', -119143=>'NSM', -119144=>'NSM', -119145=>'NSM', -119146=>'L', -119147=>'L', -119148=>'L', -119149=>'L', -119150=>'L', -119151=>'L', -119152=>'L', -119153=>'L', -119154=>'L', -119155=>'BN', -119156=>'BN', -119157=>'BN', -119158=>'BN', -119159=>'BN', -119160=>'BN', -119161=>'BN', -119162=>'BN', -119163=>'NSM', -119164=>'NSM', -119165=>'NSM', -119166=>'NSM', -119167=>'NSM', -119168=>'NSM', -119169=>'NSM', -119170=>'NSM', -119171=>'L', -119172=>'L', -119173=>'NSM', -119174=>'NSM', -119175=>'NSM', -119176=>'NSM', -119177=>'NSM', -119178=>'NSM', -119179=>'NSM', -119180=>'L', -119181=>'L', -119182=>'L', -119183=>'L', -119184=>'L', -119185=>'L', -119186=>'L', -119187=>'L', -119188=>'L', -119189=>'L', -119190=>'L', -119191=>'L', -119192=>'L', -119193=>'L', -119194=>'L', -119195=>'L', -119196=>'L', -119197=>'L', -119198=>'L', -119199=>'L', -119200=>'L', -119201=>'L', -119202=>'L', -119203=>'L', -119204=>'L', -119205=>'L', -119206=>'L', -119207=>'L', -119208=>'L', -119209=>'L', -119210=>'NSM', -119211=>'NSM', -119212=>'NSM', -119213=>'NSM', -119214=>'L', -119215=>'L', -119216=>'L', -119217=>'L', -119218=>'L', -119219=>'L', -119220=>'L', -119221=>'L', -119222=>'L', -119223=>'L', -119224=>'L', -119225=>'L', -119226=>'L', -119227=>'L', -119228=>'L', -119229=>'L', -119230=>'L', -119231=>'L', -119232=>'L', -119233=>'L', -119234=>'L', -119235=>'L', -119236=>'L', -119237=>'L', -119238=>'L', -119239=>'L', -119240=>'L', -119241=>'L', -119242=>'L', -119243=>'L', -119244=>'L', -119245=>'L', -119246=>'L', -119247=>'L', -119248=>'L', -119249=>'L', -119250=>'L', -119251=>'L', -119252=>'L', -119253=>'L', -119254=>'L', -119255=>'L', -119256=>'L', -119257=>'L', -119258=>'L', -119259=>'L', -119260=>'L', -119261=>'L', -119296=>'ON', -119297=>'ON', -119298=>'ON', -119299=>'ON', -119300=>'ON', -119301=>'ON', -119302=>'ON', -119303=>'ON', -119304=>'ON', -119305=>'ON', -119306=>'ON', -119307=>'ON', -119308=>'ON', -119309=>'ON', -119310=>'ON', -119311=>'ON', -119312=>'ON', -119313=>'ON', -119314=>'ON', -119315=>'ON', -119316=>'ON', -119317=>'ON', -119318=>'ON', -119319=>'ON', -119320=>'ON', -119321=>'ON', -119322=>'ON', -119323=>'ON', -119324=>'ON', -119325=>'ON', -119326=>'ON', -119327=>'ON', -119328=>'ON', -119329=>'ON', -119330=>'ON', -119331=>'ON', -119332=>'ON', -119333=>'ON', -119334=>'ON', -119335=>'ON', -119336=>'ON', -119337=>'ON', -119338=>'ON', -119339=>'ON', -119340=>'ON', -119341=>'ON', -119342=>'ON', -119343=>'ON', -119344=>'ON', -119345=>'ON', -119346=>'ON', -119347=>'ON', -119348=>'ON', -119349=>'ON', -119350=>'ON', -119351=>'ON', -119352=>'ON', -119353=>'ON', -119354=>'ON', -119355=>'ON', -119356=>'ON', -119357=>'ON', -119358=>'ON', -119359=>'ON', -119360=>'ON', -119361=>'ON', -119362=>'NSM', -119363=>'NSM', -119364=>'NSM', -119365=>'ON', -119552=>'ON', -119553=>'ON', -119554=>'ON', -119555=>'ON', -119556=>'ON', -119557=>'ON', -119558=>'ON', -119559=>'ON', -119560=>'ON', -119561=>'ON', -119562=>'ON', -119563=>'ON', -119564=>'ON', -119565=>'ON', -119566=>'ON', -119567=>'ON', -119568=>'ON', -119569=>'ON', -119570=>'ON', -119571=>'ON', -119572=>'ON', -119573=>'ON', -119574=>'ON', -119575=>'ON', -119576=>'ON', -119577=>'ON', -119578=>'ON', -119579=>'ON', -119580=>'ON', -119581=>'ON', -119582=>'ON', -119583=>'ON', -119584=>'ON', -119585=>'ON', -119586=>'ON', -119587=>'ON', -119588=>'ON', -119589=>'ON', -119590=>'ON', -119591=>'ON', -119592=>'ON', -119593=>'ON', -119594=>'ON', -119595=>'ON', -119596=>'ON', -119597=>'ON', -119598=>'ON', -119599=>'ON', -119600=>'ON', -119601=>'ON', -119602=>'ON', -119603=>'ON', -119604=>'ON', -119605=>'ON', -119606=>'ON', -119607=>'ON', -119608=>'ON', -119609=>'ON', -119610=>'ON', -119611=>'ON', -119612=>'ON', -119613=>'ON', -119614=>'ON', -119615=>'ON', -119616=>'ON', -119617=>'ON', -119618=>'ON', -119619=>'ON', -119620=>'ON', -119621=>'ON', -119622=>'ON', -119623=>'ON', -119624=>'ON', -119625=>'ON', -119626=>'ON', -119627=>'ON', -119628=>'ON', -119629=>'ON', -119630=>'ON', -119631=>'ON', -119632=>'ON', -119633=>'ON', -119634=>'ON', -119635=>'ON', -119636=>'ON', -119637=>'ON', -119638=>'ON', -119648=>'L', -119649=>'L', -119650=>'L', -119651=>'L', -119652=>'L', -119653=>'L', -119654=>'L', -119655=>'L', -119656=>'L', -119657=>'L', -119658=>'L', -119659=>'L', -119660=>'L', -119661=>'L', -119662=>'L', -119663=>'L', -119664=>'L', -119665=>'L', -119808=>'L', -119809=>'L', -119810=>'L', -119811=>'L', -119812=>'L', -119813=>'L', -119814=>'L', -119815=>'L', -119816=>'L', -119817=>'L', -119818=>'L', -119819=>'L', -119820=>'L', -119821=>'L', -119822=>'L', -119823=>'L', -119824=>'L', -119825=>'L', -119826=>'L', -119827=>'L', -119828=>'L', -119829=>'L', -119830=>'L', -119831=>'L', -119832=>'L', -119833=>'L', -119834=>'L', -119835=>'L', -119836=>'L', -119837=>'L', -119838=>'L', -119839=>'L', -119840=>'L', -119841=>'L', -119842=>'L', -119843=>'L', -119844=>'L', -119845=>'L', -119846=>'L', -119847=>'L', -119848=>'L', -119849=>'L', -119850=>'L', -119851=>'L', -119852=>'L', -119853=>'L', -119854=>'L', -119855=>'L', -119856=>'L', -119857=>'L', -119858=>'L', -119859=>'L', -119860=>'L', -119861=>'L', -119862=>'L', -119863=>'L', -119864=>'L', -119865=>'L', -119866=>'L', -119867=>'L', -119868=>'L', -119869=>'L', -119870=>'L', -119871=>'L', -119872=>'L', -119873=>'L', -119874=>'L', -119875=>'L', -119876=>'L', -119877=>'L', -119878=>'L', -119879=>'L', -119880=>'L', -119881=>'L', -119882=>'L', -119883=>'L', -119884=>'L', -119885=>'L', -119886=>'L', -119887=>'L', -119888=>'L', -119889=>'L', -119890=>'L', -119891=>'L', -119892=>'L', -119894=>'L', -119895=>'L', -119896=>'L', -119897=>'L', -119898=>'L', -119899=>'L', -119900=>'L', -119901=>'L', -119902=>'L', -119903=>'L', -119904=>'L', -119905=>'L', -119906=>'L', -119907=>'L', -119908=>'L', -119909=>'L', -119910=>'L', -119911=>'L', -119912=>'L', -119913=>'L', -119914=>'L', -119915=>'L', -119916=>'L', -119917=>'L', -119918=>'L', -119919=>'L', -119920=>'L', -119921=>'L', -119922=>'L', -119923=>'L', -119924=>'L', -119925=>'L', -119926=>'L', -119927=>'L', -119928=>'L', -119929=>'L', -119930=>'L', -119931=>'L', -119932=>'L', -119933=>'L', -119934=>'L', -119935=>'L', -119936=>'L', -119937=>'L', -119938=>'L', -119939=>'L', -119940=>'L', -119941=>'L', -119942=>'L', -119943=>'L', -119944=>'L', -119945=>'L', -119946=>'L', -119947=>'L', -119948=>'L', -119949=>'L', -119950=>'L', -119951=>'L', -119952=>'L', -119953=>'L', -119954=>'L', -119955=>'L', -119956=>'L', -119957=>'L', -119958=>'L', -119959=>'L', -119960=>'L', -119961=>'L', -119962=>'L', -119963=>'L', -119964=>'L', -119966=>'L', -119967=>'L', -119970=>'L', -119973=>'L', -119974=>'L', -119977=>'L', -119978=>'L', -119979=>'L', -119980=>'L', -119982=>'L', -119983=>'L', -119984=>'L', -119985=>'L', -119986=>'L', -119987=>'L', -119988=>'L', -119989=>'L', -119990=>'L', -119991=>'L', -119992=>'L', -119993=>'L', -119995=>'L', -119997=>'L', -119998=>'L', -119999=>'L', -120000=>'L', -120001=>'L', -120002=>'L', -120003=>'L', -120005=>'L', -120006=>'L', -120007=>'L', -120008=>'L', -120009=>'L', -120010=>'L', -120011=>'L', -120012=>'L', -120013=>'L', -120014=>'L', -120015=>'L', -120016=>'L', -120017=>'L', -120018=>'L', -120019=>'L', -120020=>'L', -120021=>'L', -120022=>'L', -120023=>'L', -120024=>'L', -120025=>'L', -120026=>'L', -120027=>'L', -120028=>'L', -120029=>'L', -120030=>'L', -120031=>'L', -120032=>'L', -120033=>'L', -120034=>'L', -120035=>'L', -120036=>'L', -120037=>'L', -120038=>'L', -120039=>'L', -120040=>'L', -120041=>'L', -120042=>'L', -120043=>'L', -120044=>'L', -120045=>'L', -120046=>'L', -120047=>'L', -120048=>'L', -120049=>'L', -120050=>'L', -120051=>'L', -120052=>'L', -120053=>'L', -120054=>'L', -120055=>'L', -120056=>'L', -120057=>'L', -120058=>'L', -120059=>'L', -120060=>'L', -120061=>'L', -120062=>'L', -120063=>'L', -120064=>'L', -120065=>'L', -120066=>'L', -120067=>'L', -120068=>'L', -120069=>'L', -120071=>'L', -120072=>'L', -120073=>'L', -120074=>'L', -120077=>'L', -120078=>'L', -120079=>'L', -120080=>'L', -120081=>'L', -120082=>'L', -120083=>'L', -120084=>'L', -120086=>'L', -120087=>'L', -120088=>'L', -120089=>'L', -120090=>'L', -120091=>'L', -120092=>'L', -120094=>'L', -120095=>'L', -120096=>'L', -120097=>'L', -120098=>'L', -120099=>'L', -120100=>'L', -120101=>'L', -120102=>'L', -120103=>'L', -120104=>'L', -120105=>'L', -120106=>'L', -120107=>'L', -120108=>'L', -120109=>'L', -120110=>'L', -120111=>'L', -120112=>'L', -120113=>'L', -120114=>'L', -120115=>'L', -120116=>'L', -120117=>'L', -120118=>'L', -120119=>'L', -120120=>'L', -120121=>'L', -120123=>'L', -120124=>'L', -120125=>'L', -120126=>'L', -120128=>'L', -120129=>'L', -120130=>'L', -120131=>'L', -120132=>'L', -120134=>'L', -120138=>'L', -120139=>'L', -120140=>'L', -120141=>'L', -120142=>'L', -120143=>'L', -120144=>'L', -120146=>'L', -120147=>'L', -120148=>'L', -120149=>'L', -120150=>'L', -120151=>'L', -120152=>'L', -120153=>'L', -120154=>'L', -120155=>'L', -120156=>'L', -120157=>'L', -120158=>'L', -120159=>'L', -120160=>'L', -120161=>'L', -120162=>'L', -120163=>'L', -120164=>'L', -120165=>'L', -120166=>'L', -120167=>'L', -120168=>'L', -120169=>'L', -120170=>'L', -120171=>'L', -120172=>'L', -120173=>'L', -120174=>'L', -120175=>'L', -120176=>'L', -120177=>'L', -120178=>'L', -120179=>'L', -120180=>'L', -120181=>'L', -120182=>'L', -120183=>'L', -120184=>'L', -120185=>'L', -120186=>'L', -120187=>'L', -120188=>'L', -120189=>'L', -120190=>'L', -120191=>'L', -120192=>'L', -120193=>'L', -120194=>'L', -120195=>'L', -120196=>'L', -120197=>'L', -120198=>'L', -120199=>'L', -120200=>'L', -120201=>'L', -120202=>'L', -120203=>'L', -120204=>'L', -120205=>'L', -120206=>'L', -120207=>'L', -120208=>'L', -120209=>'L', -120210=>'L', -120211=>'L', -120212=>'L', -120213=>'L', -120214=>'L', -120215=>'L', -120216=>'L', -120217=>'L', -120218=>'L', -120219=>'L', -120220=>'L', -120221=>'L', -120222=>'L', -120223=>'L', -120224=>'L', -120225=>'L', -120226=>'L', -120227=>'L', -120228=>'L', -120229=>'L', -120230=>'L', -120231=>'L', -120232=>'L', -120233=>'L', -120234=>'L', -120235=>'L', -120236=>'L', -120237=>'L', -120238=>'L', -120239=>'L', -120240=>'L', -120241=>'L', -120242=>'L', -120243=>'L', -120244=>'L', -120245=>'L', -120246=>'L', -120247=>'L', -120248=>'L', -120249=>'L', -120250=>'L', -120251=>'L', -120252=>'L', -120253=>'L', -120254=>'L', -120255=>'L', -120256=>'L', -120257=>'L', -120258=>'L', -120259=>'L', -120260=>'L', -120261=>'L', -120262=>'L', -120263=>'L', -120264=>'L', -120265=>'L', -120266=>'L', -120267=>'L', -120268=>'L', -120269=>'L', -120270=>'L', -120271=>'L', -120272=>'L', -120273=>'L', -120274=>'L', -120275=>'L', -120276=>'L', -120277=>'L', -120278=>'L', -120279=>'L', -120280=>'L', -120281=>'L', -120282=>'L', -120283=>'L', -120284=>'L', -120285=>'L', -120286=>'L', -120287=>'L', -120288=>'L', -120289=>'L', -120290=>'L', -120291=>'L', -120292=>'L', -120293=>'L', -120294=>'L', -120295=>'L', -120296=>'L', -120297=>'L', -120298=>'L', -120299=>'L', -120300=>'L', -120301=>'L', -120302=>'L', -120303=>'L', -120304=>'L', -120305=>'L', -120306=>'L', -120307=>'L', -120308=>'L', -120309=>'L', -120310=>'L', -120311=>'L', -120312=>'L', -120313=>'L', -120314=>'L', -120315=>'L', -120316=>'L', -120317=>'L', -120318=>'L', -120319=>'L', -120320=>'L', -120321=>'L', -120322=>'L', -120323=>'L', -120324=>'L', -120325=>'L', -120326=>'L', -120327=>'L', -120328=>'L', -120329=>'L', -120330=>'L', -120331=>'L', -120332=>'L', -120333=>'L', -120334=>'L', -120335=>'L', -120336=>'L', -120337=>'L', -120338=>'L', -120339=>'L', -120340=>'L', -120341=>'L', -120342=>'L', -120343=>'L', -120344=>'L', -120345=>'L', -120346=>'L', -120347=>'L', -120348=>'L', -120349=>'L', -120350=>'L', -120351=>'L', -120352=>'L', -120353=>'L', -120354=>'L', -120355=>'L', -120356=>'L', -120357=>'L', -120358=>'L', -120359=>'L', -120360=>'L', -120361=>'L', -120362=>'L', -120363=>'L', -120364=>'L', -120365=>'L', -120366=>'L', -120367=>'L', -120368=>'L', -120369=>'L', -120370=>'L', -120371=>'L', -120372=>'L', -120373=>'L', -120374=>'L', -120375=>'L', -120376=>'L', -120377=>'L', -120378=>'L', -120379=>'L', -120380=>'L', -120381=>'L', -120382=>'L', -120383=>'L', -120384=>'L', -120385=>'L', -120386=>'L', -120387=>'L', -120388=>'L', -120389=>'L', -120390=>'L', -120391=>'L', -120392=>'L', -120393=>'L', -120394=>'L', -120395=>'L', -120396=>'L', -120397=>'L', -120398=>'L', -120399=>'L', -120400=>'L', -120401=>'L', -120402=>'L', -120403=>'L', -120404=>'L', -120405=>'L', -120406=>'L', -120407=>'L', -120408=>'L', -120409=>'L', -120410=>'L', -120411=>'L', -120412=>'L', -120413=>'L', -120414=>'L', -120415=>'L', -120416=>'L', -120417=>'L', -120418=>'L', -120419=>'L', -120420=>'L', -120421=>'L', -120422=>'L', -120423=>'L', -120424=>'L', -120425=>'L', -120426=>'L', -120427=>'L', -120428=>'L', -120429=>'L', -120430=>'L', -120431=>'L', -120432=>'L', -120433=>'L', -120434=>'L', -120435=>'L', -120436=>'L', -120437=>'L', -120438=>'L', -120439=>'L', -120440=>'L', -120441=>'L', -120442=>'L', -120443=>'L', -120444=>'L', -120445=>'L', -120446=>'L', -120447=>'L', -120448=>'L', -120449=>'L', -120450=>'L', -120451=>'L', -120452=>'L', -120453=>'L', -120454=>'L', -120455=>'L', -120456=>'L', -120457=>'L', -120458=>'L', -120459=>'L', -120460=>'L', -120461=>'L', -120462=>'L', -120463=>'L', -120464=>'L', -120465=>'L', -120466=>'L', -120467=>'L', -120468=>'L', -120469=>'L', -120470=>'L', -120471=>'L', -120472=>'L', -120473=>'L', -120474=>'L', -120475=>'L', -120476=>'L', -120477=>'L', -120478=>'L', -120479=>'L', -120480=>'L', -120481=>'L', -120482=>'L', -120483=>'L', -120484=>'L', -120485=>'L', -120488=>'L', -120489=>'L', -120490=>'L', -120491=>'L', -120492=>'L', -120493=>'L', -120494=>'L', -120495=>'L', -120496=>'L', -120497=>'L', -120498=>'L', -120499=>'L', -120500=>'L', -120501=>'L', -120502=>'L', -120503=>'L', -120504=>'L', -120505=>'L', -120506=>'L', -120507=>'L', -120508=>'L', -120509=>'L', -120510=>'L', -120511=>'L', -120512=>'L', -120513=>'L', -120514=>'L', -120515=>'L', -120516=>'L', -120517=>'L', -120518=>'L', -120519=>'L', -120520=>'L', -120521=>'L', -120522=>'L', -120523=>'L', -120524=>'L', -120525=>'L', -120526=>'L', -120527=>'L', -120528=>'L', -120529=>'L', -120530=>'L', -120531=>'L', -120532=>'L', -120533=>'L', -120534=>'L', -120535=>'L', -120536=>'L', -120537=>'L', -120538=>'L', -120539=>'L', -120540=>'L', -120541=>'L', -120542=>'L', -120543=>'L', -120544=>'L', -120545=>'L', -120546=>'L', -120547=>'L', -120548=>'L', -120549=>'L', -120550=>'L', -120551=>'L', -120552=>'L', -120553=>'L', -120554=>'L', -120555=>'L', -120556=>'L', -120557=>'L', -120558=>'L', -120559=>'L', -120560=>'L', -120561=>'L', -120562=>'L', -120563=>'L', -120564=>'L', -120565=>'L', -120566=>'L', -120567=>'L', -120568=>'L', -120569=>'L', -120570=>'L', -120571=>'L', -120572=>'L', -120573=>'L', -120574=>'L', -120575=>'L', -120576=>'L', -120577=>'L', -120578=>'L', -120579=>'L', -120580=>'L', -120581=>'L', -120582=>'L', -120583=>'L', -120584=>'L', -120585=>'L', -120586=>'L', -120587=>'L', -120588=>'L', -120589=>'L', -120590=>'L', -120591=>'L', -120592=>'L', -120593=>'L', -120594=>'L', -120595=>'L', -120596=>'L', -120597=>'L', -120598=>'L', -120599=>'L', -120600=>'L', -120601=>'L', -120602=>'L', -120603=>'L', -120604=>'L', -120605=>'L', -120606=>'L', -120607=>'L', -120608=>'L', -120609=>'L', -120610=>'L', -120611=>'L', -120612=>'L', -120613=>'L', -120614=>'L', -120615=>'L', -120616=>'L', -120617=>'L', -120618=>'L', -120619=>'L', -120620=>'L', -120621=>'L', -120622=>'L', -120623=>'L', -120624=>'L', -120625=>'L', -120626=>'L', -120627=>'L', -120628=>'L', -120629=>'L', -120630=>'L', -120631=>'L', -120632=>'L', -120633=>'L', -120634=>'L', -120635=>'L', -120636=>'L', -120637=>'L', -120638=>'L', -120639=>'L', -120640=>'L', -120641=>'L', -120642=>'L', -120643=>'L', -120644=>'L', -120645=>'L', -120646=>'L', -120647=>'L', -120648=>'L', -120649=>'L', -120650=>'L', -120651=>'L', -120652=>'L', -120653=>'L', -120654=>'L', -120655=>'L', -120656=>'L', -120657=>'L', -120658=>'L', -120659=>'L', -120660=>'L', -120661=>'L', -120662=>'L', -120663=>'L', -120664=>'L', -120665=>'L', -120666=>'L', -120667=>'L', -120668=>'L', -120669=>'L', -120670=>'L', -120671=>'L', -120672=>'L', -120673=>'L', -120674=>'L', -120675=>'L', -120676=>'L', -120677=>'L', -120678=>'L', -120679=>'L', -120680=>'L', -120681=>'L', -120682=>'L', -120683=>'L', -120684=>'L', -120685=>'L', -120686=>'L', -120687=>'L', -120688=>'L', -120689=>'L', -120690=>'L', -120691=>'L', -120692=>'L', -120693=>'L', -120694=>'L', -120695=>'L', -120696=>'L', -120697=>'L', -120698=>'L', -120699=>'L', -120700=>'L', -120701=>'L', -120702=>'L', -120703=>'L', -120704=>'L', -120705=>'L', -120706=>'L', -120707=>'L', -120708=>'L', -120709=>'L', -120710=>'L', -120711=>'L', -120712=>'L', -120713=>'L', -120714=>'L', -120715=>'L', -120716=>'L', -120717=>'L', -120718=>'L', -120719=>'L', -120720=>'L', -120721=>'L', -120722=>'L', -120723=>'L', -120724=>'L', -120725=>'L', -120726=>'L', -120727=>'L', -120728=>'L', -120729=>'L', -120730=>'L', -120731=>'L', -120732=>'L', -120733=>'L', -120734=>'L', -120735=>'L', -120736=>'L', -120737=>'L', -120738=>'L', -120739=>'L', -120740=>'L', -120741=>'L', -120742=>'L', -120743=>'L', -120744=>'L', -120745=>'L', -120746=>'L', -120747=>'L', -120748=>'L', -120749=>'L', -120750=>'L', -120751=>'L', -120752=>'L', -120753=>'L', -120754=>'L', -120755=>'L', -120756=>'L', -120757=>'L', -120758=>'L', -120759=>'L', -120760=>'L', -120761=>'L', -120762=>'L', -120763=>'L', -120764=>'L', -120765=>'L', -120766=>'L', -120767=>'L', -120768=>'L', -120769=>'L', -120770=>'L', -120771=>'L', -120772=>'L', -120773=>'L', -120774=>'L', -120775=>'L', -120776=>'L', -120777=>'L', -120778=>'L', -120779=>'L', -120782=>'EN', -120783=>'EN', -120784=>'EN', -120785=>'EN', -120786=>'EN', -120787=>'EN', -120788=>'EN', -120789=>'EN', -120790=>'EN', -120791=>'EN', -120792=>'EN', -120793=>'EN', -120794=>'EN', -120795=>'EN', -120796=>'EN', -120797=>'EN', -120798=>'EN', -120799=>'EN', -120800=>'EN', -120801=>'EN', -120802=>'EN', -120803=>'EN', -120804=>'EN', -120805=>'EN', -120806=>'EN', -120807=>'EN', -120808=>'EN', -120809=>'EN', -120810=>'EN', -120811=>'EN', -120812=>'EN', -120813=>'EN', -120814=>'EN', -120815=>'EN', -120816=>'EN', -120817=>'EN', -120818=>'EN', -120819=>'EN', -120820=>'EN', -120821=>'EN', -120822=>'EN', -120823=>'EN', -120824=>'EN', -120825=>'EN', -120826=>'EN', -120827=>'EN', -120828=>'EN', -120829=>'EN', -120830=>'EN', -120831=>'EN', -131072=>'L', -173782=>'L', -194560=>'L', -194561=>'L', -194562=>'L', -194563=>'L', -194564=>'L', -194565=>'L', -194566=>'L', -194567=>'L', -194568=>'L', -194569=>'L', -194570=>'L', -194571=>'L', -194572=>'L', -194573=>'L', -194574=>'L', -194575=>'L', -194576=>'L', -194577=>'L', -194578=>'L', -194579=>'L', -194580=>'L', -194581=>'L', -194582=>'L', -194583=>'L', -194584=>'L', -194585=>'L', -194586=>'L', -194587=>'L', -194588=>'L', -194589=>'L', -194590=>'L', -194591=>'L', -194592=>'L', -194593=>'L', -194594=>'L', -194595=>'L', -194596=>'L', -194597=>'L', -194598=>'L', -194599=>'L', -194600=>'L', -194601=>'L', -194602=>'L', -194603=>'L', -194604=>'L', -194605=>'L', -194606=>'L', -194607=>'L', -194608=>'L', -194609=>'L', -194610=>'L', -194611=>'L', -194612=>'L', -194613=>'L', -194614=>'L', -194615=>'L', -194616=>'L', -194617=>'L', -194618=>'L', -194619=>'L', -194620=>'L', -194621=>'L', -194622=>'L', -194623=>'L', -194624=>'L', -194625=>'L', -194626=>'L', -194627=>'L', -194628=>'L', -194629=>'L', -194630=>'L', -194631=>'L', -194632=>'L', -194633=>'L', -194634=>'L', -194635=>'L', -194636=>'L', -194637=>'L', -194638=>'L', -194639=>'L', -194640=>'L', -194641=>'L', -194642=>'L', -194643=>'L', -194644=>'L', -194645=>'L', -194646=>'L', -194647=>'L', -194648=>'L', -194649=>'L', -194650=>'L', -194651=>'L', -194652=>'L', -194653=>'L', -194654=>'L', -194655=>'L', -194656=>'L', -194657=>'L', -194658=>'L', -194659=>'L', -194660=>'L', -194661=>'L', -194662=>'L', -194663=>'L', -194664=>'L', -194665=>'L', -194666=>'L', -194667=>'L', -194668=>'L', -194669=>'L', -194670=>'L', -194671=>'L', -194672=>'L', -194673=>'L', -194674=>'L', -194675=>'L', -194676=>'L', -194677=>'L', -194678=>'L', -194679=>'L', -194680=>'L', -194681=>'L', -194682=>'L', -194683=>'L', -194684=>'L', -194685=>'L', -194686=>'L', -194687=>'L', -194688=>'L', -194689=>'L', -194690=>'L', -194691=>'L', -194692=>'L', -194693=>'L', -194694=>'L', -194695=>'L', -194696=>'L', -194697=>'L', -194698=>'L', -194699=>'L', -194700=>'L', -194701=>'L', -194702=>'L', -194703=>'L', -194704=>'L', -194705=>'L', -194706=>'L', -194707=>'L', -194708=>'L', -194709=>'L', -194710=>'L', -194711=>'L', -194712=>'L', -194713=>'L', -194714=>'L', -194715=>'L', -194716=>'L', -194717=>'L', -194718=>'L', -194719=>'L', -194720=>'L', -194721=>'L', -194722=>'L', -194723=>'L', -194724=>'L', -194725=>'L', -194726=>'L', -194727=>'L', -194728=>'L', -194729=>'L', -194730=>'L', -194731=>'L', -194732=>'L', -194733=>'L', -194734=>'L', -194735=>'L', -194736=>'L', -194737=>'L', -194738=>'L', -194739=>'L', -194740=>'L', -194741=>'L', -194742=>'L', -194743=>'L', -194744=>'L', -194745=>'L', -194746=>'L', -194747=>'L', -194748=>'L', -194749=>'L', -194750=>'L', -194751=>'L', -194752=>'L', -194753=>'L', -194754=>'L', -194755=>'L', -194756=>'L', -194757=>'L', -194758=>'L', -194759=>'L', -194760=>'L', -194761=>'L', -194762=>'L', -194763=>'L', -194764=>'L', -194765=>'L', -194766=>'L', -194767=>'L', -194768=>'L', -194769=>'L', -194770=>'L', -194771=>'L', -194772=>'L', -194773=>'L', -194774=>'L', -194775=>'L', -194776=>'L', -194777=>'L', -194778=>'L', -194779=>'L', -194780=>'L', -194781=>'L', -194782=>'L', -194783=>'L', -194784=>'L', -194785=>'L', -194786=>'L', -194787=>'L', -194788=>'L', -194789=>'L', -194790=>'L', -194791=>'L', -194792=>'L', -194793=>'L', -194794=>'L', -194795=>'L', -194796=>'L', -194797=>'L', -194798=>'L', -194799=>'L', -194800=>'L', -194801=>'L', -194802=>'L', -194803=>'L', -194804=>'L', -194805=>'L', -194806=>'L', -194807=>'L', -194808=>'L', -194809=>'L', -194810=>'L', -194811=>'L', -194812=>'L', -194813=>'L', -194814=>'L', -194815=>'L', -194816=>'L', -194817=>'L', -194818=>'L', -194819=>'L', -194820=>'L', -194821=>'L', -194822=>'L', -194823=>'L', -194824=>'L', -194825=>'L', -194826=>'L', -194827=>'L', -194828=>'L', -194829=>'L', -194830=>'L', -194831=>'L', -194832=>'L', -194833=>'L', -194834=>'L', -194835=>'L', -194836=>'L', -194837=>'L', -194838=>'L', -194839=>'L', -194840=>'L', -194841=>'L', -194842=>'L', -194843=>'L', -194844=>'L', -194845=>'L', -194846=>'L', -194847=>'L', -194848=>'L', -194849=>'L', -194850=>'L', -194851=>'L', -194852=>'L', -194853=>'L', -194854=>'L', -194855=>'L', -194856=>'L', -194857=>'L', -194858=>'L', -194859=>'L', -194860=>'L', -194861=>'L', -194862=>'L', -194863=>'L', -194864=>'L', -194865=>'L', -194866=>'L', -194867=>'L', -194868=>'L', -194869=>'L', -194870=>'L', -194871=>'L', -194872=>'L', -194873=>'L', -194874=>'L', -194875=>'L', -194876=>'L', -194877=>'L', -194878=>'L', -194879=>'L', -194880=>'L', -194881=>'L', -194882=>'L', -194883=>'L', -194884=>'L', -194885=>'L', -194886=>'L', -194887=>'L', -194888=>'L', -194889=>'L', -194890=>'L', -194891=>'L', -194892=>'L', -194893=>'L', -194894=>'L', -194895=>'L', -194896=>'L', -194897=>'L', -194898=>'L', -194899=>'L', -194900=>'L', -194901=>'L', -194902=>'L', -194903=>'L', -194904=>'L', -194905=>'L', -194906=>'L', -194907=>'L', -194908=>'L', -194909=>'L', -194910=>'L', -194911=>'L', -194912=>'L', -194913=>'L', -194914=>'L', -194915=>'L', -194916=>'L', -194917=>'L', -194918=>'L', -194919=>'L', -194920=>'L', -194921=>'L', -194922=>'L', -194923=>'L', -194924=>'L', -194925=>'L', -194926=>'L', -194927=>'L', -194928=>'L', -194929=>'L', -194930=>'L', -194931=>'L', -194932=>'L', -194933=>'L', -194934=>'L', -194935=>'L', -194936=>'L', -194937=>'L', -194938=>'L', -194939=>'L', -194940=>'L', -194941=>'L', -194942=>'L', -194943=>'L', -194944=>'L', -194945=>'L', -194946=>'L', -194947=>'L', -194948=>'L', -194949=>'L', -194950=>'L', -194951=>'L', -194952=>'L', -194953=>'L', -194954=>'L', -194955=>'L', -194956=>'L', -194957=>'L', -194958=>'L', -194959=>'L', -194960=>'L', -194961=>'L', -194962=>'L', -194963=>'L', -194964=>'L', -194965=>'L', -194966=>'L', -194967=>'L', -194968=>'L', -194969=>'L', -194970=>'L', -194971=>'L', -194972=>'L', -194973=>'L', -194974=>'L', -194975=>'L', -194976=>'L', -194977=>'L', -194978=>'L', -194979=>'L', -194980=>'L', -194981=>'L', -194982=>'L', -194983=>'L', -194984=>'L', -194985=>'L', -194986=>'L', -194987=>'L', -194988=>'L', -194989=>'L', -194990=>'L', -194991=>'L', -194992=>'L', -194993=>'L', -194994=>'L', -194995=>'L', -194996=>'L', -194997=>'L', -194998=>'L', -194999=>'L', -195000=>'L', -195001=>'L', -195002=>'L', -195003=>'L', -195004=>'L', -195005=>'L', -195006=>'L', -195007=>'L', -195008=>'L', -195009=>'L', -195010=>'L', -195011=>'L', -195012=>'L', -195013=>'L', -195014=>'L', -195015=>'L', -195016=>'L', -195017=>'L', -195018=>'L', -195019=>'L', -195020=>'L', -195021=>'L', -195022=>'L', -195023=>'L', -195024=>'L', -195025=>'L', -195026=>'L', -195027=>'L', -195028=>'L', -195029=>'L', -195030=>'L', -195031=>'L', -195032=>'L', -195033=>'L', -195034=>'L', -195035=>'L', -195036=>'L', -195037=>'L', -195038=>'L', -195039=>'L', -195040=>'L', -195041=>'L', -195042=>'L', -195043=>'L', -195044=>'L', -195045=>'L', -195046=>'L', -195047=>'L', -195048=>'L', -195049=>'L', -195050=>'L', -195051=>'L', -195052=>'L', -195053=>'L', -195054=>'L', -195055=>'L', -195056=>'L', -195057=>'L', -195058=>'L', -195059=>'L', -195060=>'L', -195061=>'L', -195062=>'L', -195063=>'L', -195064=>'L', -195065=>'L', -195066=>'L', -195067=>'L', -195068=>'L', -195069=>'L', -195070=>'L', -195071=>'L', -195072=>'L', -195073=>'L', -195074=>'L', -195075=>'L', -195076=>'L', -195077=>'L', -195078=>'L', -195079=>'L', -195080=>'L', -195081=>'L', -195082=>'L', -195083=>'L', -195084=>'L', -195085=>'L', -195086=>'L', -195087=>'L', -195088=>'L', -195089=>'L', -195090=>'L', -195091=>'L', -195092=>'L', -195093=>'L', -195094=>'L', -195095=>'L', -195096=>'L', -195097=>'L', -195098=>'L', -195099=>'L', -195100=>'L', -195101=>'L', -917505=>'BN', -917536=>'BN', -917537=>'BN', -917538=>'BN', -917539=>'BN', -917540=>'BN', -917541=>'BN', -917542=>'BN', -917543=>'BN', -917544=>'BN', -917545=>'BN', -917546=>'BN', -917547=>'BN', -917548=>'BN', -917549=>'BN', -917550=>'BN', -917551=>'BN', -917552=>'BN', -917553=>'BN', -917554=>'BN', -917555=>'BN', -917556=>'BN', -917557=>'BN', -917558=>'BN', -917559=>'BN', -917560=>'BN', -917561=>'BN', -917562=>'BN', -917563=>'BN', -917564=>'BN', -917565=>'BN', -917566=>'BN', -917567=>'BN', -917568=>'BN', -917569=>'BN', -917570=>'BN', -917571=>'BN', -917572=>'BN', -917573=>'BN', -917574=>'BN', -917575=>'BN', -917576=>'BN', -917577=>'BN', -917578=>'BN', -917579=>'BN', -917580=>'BN', -917581=>'BN', -917582=>'BN', -917583=>'BN', -917584=>'BN', -917585=>'BN', -917586=>'BN', -917587=>'BN', -917588=>'BN', -917589=>'BN', -917590=>'BN', -917591=>'BN', -917592=>'BN', -917593=>'BN', -917594=>'BN', -917595=>'BN', -917596=>'BN', -917597=>'BN', -917598=>'BN', -917599=>'BN', -917600=>'BN', -917601=>'BN', -917602=>'BN', -917603=>'BN', -917604=>'BN', -917605=>'BN', -917606=>'BN', -917607=>'BN', -917608=>'BN', -917609=>'BN', -917610=>'BN', -917611=>'BN', -917612=>'BN', -917613=>'BN', -917614=>'BN', -917615=>'BN', -917616=>'BN', -917617=>'BN', -917618=>'BN', -917619=>'BN', -917620=>'BN', -917621=>'BN', -917622=>'BN', -917623=>'BN', -917624=>'BN', -917625=>'BN', -917626=>'BN', -917627=>'BN', -917628=>'BN', -917629=>'BN', -917630=>'BN', -917631=>'BN', -917760=>'NSM', -917761=>'NSM', -917762=>'NSM', -917763=>'NSM', -917764=>'NSM', -917765=>'NSM', -917766=>'NSM', -917767=>'NSM', -917768=>'NSM', -917769=>'NSM', -917770=>'NSM', -917771=>'NSM', -917772=>'NSM', -917773=>'NSM', -917774=>'NSM', -917775=>'NSM', -917776=>'NSM', -917777=>'NSM', -917778=>'NSM', -917779=>'NSM', -917780=>'NSM', -917781=>'NSM', -917782=>'NSM', -917783=>'NSM', -917784=>'NSM', -917785=>'NSM', -917786=>'NSM', -917787=>'NSM', -917788=>'NSM', -917789=>'NSM', -917790=>'NSM', -917791=>'NSM', -917792=>'NSM', -917793=>'NSM', -917794=>'NSM', -917795=>'NSM', -917796=>'NSM', -917797=>'NSM', -917798=>'NSM', -917799=>'NSM', -917800=>'NSM', -917801=>'NSM', -917802=>'NSM', -917803=>'NSM', -917804=>'NSM', -917805=>'NSM', -917806=>'NSM', -917807=>'NSM', -917808=>'NSM', -917809=>'NSM', -917810=>'NSM', -917811=>'NSM', -917812=>'NSM', -917813=>'NSM', -917814=>'NSM', -917815=>'NSM', -917816=>'NSM', -917817=>'NSM', -917818=>'NSM', -917819=>'NSM', -917820=>'NSM', -917821=>'NSM', -917822=>'NSM', -917823=>'NSM', -917824=>'NSM', -917825=>'NSM', -917826=>'NSM', -917827=>'NSM', -917828=>'NSM', -917829=>'NSM', -917830=>'NSM', -917831=>'NSM', -917832=>'NSM', -917833=>'NSM', -917834=>'NSM', -917835=>'NSM', -917836=>'NSM', -917837=>'NSM', -917838=>'NSM', -917839=>'NSM', -917840=>'NSM', -917841=>'NSM', -917842=>'NSM', -917843=>'NSM', -917844=>'NSM', -917845=>'NSM', -917846=>'NSM', -917847=>'NSM', -917848=>'NSM', -917849=>'NSM', -917850=>'NSM', -917851=>'NSM', -917852=>'NSM', -917853=>'NSM', -917854=>'NSM', -917855=>'NSM', -917856=>'NSM', -917857=>'NSM', -917858=>'NSM', -917859=>'NSM', -917860=>'NSM', -917861=>'NSM', -917862=>'NSM', -917863=>'NSM', -917864=>'NSM', -917865=>'NSM', -917866=>'NSM', -917867=>'NSM', -917868=>'NSM', -917869=>'NSM', -917870=>'NSM', -917871=>'NSM', -917872=>'NSM', -917873=>'NSM', -917874=>'NSM', -917875=>'NSM', -917876=>'NSM', -917877=>'NSM', -917878=>'NSM', -917879=>'NSM', -917880=>'NSM', -917881=>'NSM', -917882=>'NSM', -917883=>'NSM', -917884=>'NSM', -917885=>'NSM', -917886=>'NSM', -917887=>'NSM', -917888=>'NSM', -917889=>'NSM', -917890=>'NSM', -917891=>'NSM', -917892=>'NSM', -917893=>'NSM', -917894=>'NSM', -917895=>'NSM', -917896=>'NSM', -917897=>'NSM', -917898=>'NSM', -917899=>'NSM', -917900=>'NSM', -917901=>'NSM', -917902=>'NSM', -917903=>'NSM', -917904=>'NSM', -917905=>'NSM', -917906=>'NSM', -917907=>'NSM', -917908=>'NSM', -917909=>'NSM', -917910=>'NSM', -917911=>'NSM', -917912=>'NSM', -917913=>'NSM', -917914=>'NSM', -917915=>'NSM', -917916=>'NSM', -917917=>'NSM', -917918=>'NSM', -917919=>'NSM', -917920=>'NSM', -917921=>'NSM', -917922=>'NSM', -917923=>'NSM', -917924=>'NSM', -917925=>'NSM', -917926=>'NSM', -917927=>'NSM', -917928=>'NSM', -917929=>'NSM', -917930=>'NSM', -917931=>'NSM', -917932=>'NSM', -917933=>'NSM', -917934=>'NSM', -917935=>'NSM', -917936=>'NSM', -917937=>'NSM', -917938=>'NSM', -917939=>'NSM', -917940=>'NSM', -917941=>'NSM', -917942=>'NSM', -917943=>'NSM', -917944=>'NSM', -917945=>'NSM', -917946=>'NSM', -917947=>'NSM', -917948=>'NSM', -917949=>'NSM', -917950=>'NSM', -917951=>'NSM', -917952=>'NSM', -917953=>'NSM', -917954=>'NSM', -917955=>'NSM', -917956=>'NSM', -917957=>'NSM', -917958=>'NSM', -917959=>'NSM', -917960=>'NSM', -917961=>'NSM', -917962=>'NSM', -917963=>'NSM', -917964=>'NSM', -917965=>'NSM', -917966=>'NSM', -917967=>'NSM', -917968=>'NSM', -917969=>'NSM', -917970=>'NSM', -917971=>'NSM', -917972=>'NSM', -917973=>'NSM', -917974=>'NSM', -917975=>'NSM', -917976=>'NSM', -917977=>'NSM', -917978=>'NSM', -917979=>'NSM', -917980=>'NSM', -917981=>'NSM', -917982=>'NSM', -917983=>'NSM', -917984=>'NSM', -917985=>'NSM', -917986=>'NSM', -917987=>'NSM', -917988=>'NSM', -917989=>'NSM', -917990=>'NSM', -917991=>'NSM', -917992=>'NSM', -917993=>'NSM', -917994=>'NSM', -917995=>'NSM', -917996=>'NSM', -917997=>'NSM', -917998=>'NSM', -917999=>'NSM', -983040=>'L', -1048573=>'L', -1048576=>'L', -1114109=>'L' -); - -/** - * @var Mirror unicode characters. - * For information on bidi mirroring, see UAX #9: Bidirectional Algorithm, - * at http://www.unicode.org/unicode/reports/tr9/ - * @access public - */ -public $uni_mirror = array ( -0x0028=>0x0029, -0x0029=>0x0028, -0x003C=>0x003E, -0x003E=>0x003C, -0x005B=>0x005D, -0x005D=>0x005B, -0x007B=>0x007D, -0x007D=>0x007B, -0x00AB=>0x00BB, -0x00BB=>0x00AB, -0x0F3A=>0x0F3B, -0x0F3B=>0x0F3A, -0x0F3C=>0x0F3D, -0x0F3D=>0x0F3C, -0x169B=>0x169C, -0x169C=>0x169B, -0x2018=>0x2019, -0x2019=>0x2018, -0x201C=>0x201D, -0x201D=>0x201C, -0x2039=>0x203A, -0x203A=>0x2039, -0x2045=>0x2046, -0x2046=>0x2045, -0x207D=>0x207E, -0x207E=>0x207D, -0x208D=>0x208E, -0x208E=>0x208D, -0x2208=>0x220B, -0x2209=>0x220C, -0x220A=>0x220D, -0x220B=>0x2208, -0x220C=>0x2209, -0x220D=>0x220A, -0x2215=>0x29F5, -0x223C=>0x223D, -0x223D=>0x223C, -0x2243=>0x22CD, -0x2252=>0x2253, -0x2253=>0x2252, -0x2254=>0x2255, -0x2255=>0x2254, -0x2264=>0x2265, -0x2265=>0x2264, -0x2266=>0x2267, -0x2267=>0x2266, -0x2268=>0x2269, -0x2269=>0x2268, -0x226A=>0x226B, -0x226B=>0x226A, -0x226E=>0x226F, -0x226F=>0x226E, -0x2270=>0x2271, -0x2271=>0x2270, -0x2272=>0x2273, -0x2273=>0x2272, -0x2274=>0x2275, -0x2275=>0x2274, -0x2276=>0x2277, -0x2277=>0x2276, -0x2278=>0x2279, -0x2279=>0x2278, -0x227A=>0x227B, -0x227B=>0x227A, -0x227C=>0x227D, -0x227D=>0x227C, -0x227E=>0x227F, -0x227F=>0x227E, -0x2280=>0x2281, -0x2281=>0x2280, -0x2282=>0x2283, -0x2283=>0x2282, -0x2284=>0x2285, -0x2285=>0x2284, -0x2286=>0x2287, -0x2287=>0x2286, -0x2288=>0x2289, -0x2289=>0x2288, -0x228A=>0x228B, -0x228B=>0x228A, -0x228F=>0x2290, -0x2290=>0x228F, -0x2291=>0x2292, -0x2292=>0x2291, -0x2298=>0x29B8, -0x22A2=>0x22A3, -0x22A3=>0x22A2, -0x22A6=>0x2ADE, -0x22A8=>0x2AE4, -0x22A9=>0x2AE3, -0x22AB=>0x2AE5, -0x22B0=>0x22B1, -0x22B1=>0x22B0, -0x22B2=>0x22B3, -0x22B3=>0x22B2, -0x22B4=>0x22B5, -0x22B5=>0x22B4, -0x22B6=>0x22B7, -0x22B7=>0x22B6, -0x22C9=>0x22CA, -0x22CA=>0x22C9, -0x22CB=>0x22CC, -0x22CC=>0x22CB, -0x22CD=>0x2243, -0x22D0=>0x22D1, -0x22D1=>0x22D0, -0x22D6=>0x22D7, -0x22D7=>0x22D6, -0x22D8=>0x22D9, -0x22D9=>0x22D8, -0x22DA=>0x22DB, -0x22DB=>0x22DA, -0x22DC=>0x22DD, -0x22DD=>0x22DC, -0x22DE=>0x22DF, -0x22DF=>0x22DE, -0x22E0=>0x22E1, -0x22E1=>0x22E0, -0x22E2=>0x22E3, -0x22E3=>0x22E2, -0x22E4=>0x22E5, -0x22E5=>0x22E4, -0x22E6=>0x22E7, -0x22E7=>0x22E6, -0x22E8=>0x22E9, -0x22E9=>0x22E8, -0x22EA=>0x22EB, -0x22EB=>0x22EA, -0x22EC=>0x22ED, -0x22ED=>0x22EC, -0x22F0=>0x22F1, -0x22F1=>0x22F0, -0x22F2=>0x22FA, -0x22F3=>0x22FB, -0x22F4=>0x22FC, -0x22F6=>0x22FD, -0x22F7=>0x22FE, -0x22FA=>0x22F2, -0x22FB=>0x22F3, -0x22FC=>0x22F4, -0x22FD=>0x22F6, -0x22FE=>0x22F7, -0x2308=>0x2309, -0x2309=>0x2308, -0x230A=>0x230B, -0x230B=>0x230A, -0x2329=>0x232A, -0x232A=>0x2329, -0x2768=>0x2769, -0x2769=>0x2768, -0x276A=>0x276B, -0x276B=>0x276A, -0x276C=>0x276D, -0x276D=>0x276C, -0x276E=>0x276F, -0x276F=>0x276E, -0x2770=>0x2771, -0x2771=>0x2770, -0x2772=>0x2773, -0x2773=>0x2772, -0x2774=>0x2775, -0x2775=>0x2774, -0x27C3=>0x27C4, -0x27C4=>0x27C3, -0x27C5=>0x27C6, -0x27C6=>0x27C5, -0x27D5=>0x27D6, -0x27D6=>0x27D5, -0x27DD=>0x27DE, -0x27DE=>0x27DD, -0x27E2=>0x27E3, -0x27E3=>0x27E2, -0x27E4=>0x27E5, -0x27E5=>0x27E4, -0x27E6=>0x27E7, -0x27E7=>0x27E6, -0x27E8=>0x27E9, -0x27E9=>0x27E8, -0x27EA=>0x27EB, -0x27EB=>0x27EA, -0x2983=>0x2984, -0x2984=>0x2983, -0x2985=>0x2986, -0x2986=>0x2985, -0x2987=>0x2988, -0x2988=>0x2987, -0x2989=>0x298A, -0x298A=>0x2989, -0x298B=>0x298C, -0x298C=>0x298B, -0x298D=>0x2990, -0x298E=>0x298F, -0x298F=>0x298E, -0x2990=>0x298D, -0x2991=>0x2992, -0x2992=>0x2991, -0x2993=>0x2994, -0x2994=>0x2993, -0x2995=>0x2996, -0x2996=>0x2995, -0x2997=>0x2998, -0x2998=>0x2997, -0x29B8=>0x2298, -0x29C0=>0x29C1, -0x29C1=>0x29C0, -0x29C4=>0x29C5, -0x29C5=>0x29C4, -0x29CF=>0x29D0, -0x29D0=>0x29CF, -0x29D1=>0x29D2, -0x29D2=>0x29D1, -0x29D4=>0x29D5, -0x29D5=>0x29D4, -0x29D8=>0x29D9, -0x29D9=>0x29D8, -0x29DA=>0x29DB, -0x29DB=>0x29DA, -0x29F5=>0x2215, -0x29F8=>0x29F9, -0x29F9=>0x29F8, -0x29FC=>0x29FD, -0x29FD=>0x29FC, -0x2A2B=>0x2A2C, -0x2A2C=>0x2A2B, -0x2A2D=>0x2A2E, -0x2A2E=>0x2A2D, -0x2A34=>0x2A35, -0x2A35=>0x2A34, -0x2A3C=>0x2A3D, -0x2A3D=>0x2A3C, -0x2A64=>0x2A65, -0x2A65=>0x2A64, -0x2A79=>0x2A7A, -0x2A7A=>0x2A79, -0x2A7D=>0x2A7E, -0x2A7E=>0x2A7D, -0x2A7F=>0x2A80, -0x2A80=>0x2A7F, -0x2A81=>0x2A82, -0x2A82=>0x2A81, -0x2A83=>0x2A84, -0x2A84=>0x2A83, -0x2A8B=>0x2A8C, -0x2A8C=>0x2A8B, -0x2A91=>0x2A92, -0x2A92=>0x2A91, -0x2A93=>0x2A94, -0x2A94=>0x2A93, -0x2A95=>0x2A96, -0x2A96=>0x2A95, -0x2A97=>0x2A98, -0x2A98=>0x2A97, -0x2A99=>0x2A9A, -0x2A9A=>0x2A99, -0x2A9B=>0x2A9C, -0x2A9C=>0x2A9B, -0x2AA1=>0x2AA2, -0x2AA2=>0x2AA1, -0x2AA6=>0x2AA7, -0x2AA7=>0x2AA6, -0x2AA8=>0x2AA9, -0x2AA9=>0x2AA8, -0x2AAA=>0x2AAB, -0x2AAB=>0x2AAA, -0x2AAC=>0x2AAD, -0x2AAD=>0x2AAC, -0x2AAF=>0x2AB0, -0x2AB0=>0x2AAF, -0x2AB3=>0x2AB4, -0x2AB4=>0x2AB3, -0x2ABB=>0x2ABC, -0x2ABC=>0x2ABB, -0x2ABD=>0x2ABE, -0x2ABE=>0x2ABD, -0x2ABF=>0x2AC0, -0x2AC0=>0x2ABF, -0x2AC1=>0x2AC2, -0x2AC2=>0x2AC1, -0x2AC3=>0x2AC4, -0x2AC4=>0x2AC3, -0x2AC5=>0x2AC6, -0x2AC6=>0x2AC5, -0x2ACD=>0x2ACE, -0x2ACE=>0x2ACD, -0x2ACF=>0x2AD0, -0x2AD0=>0x2ACF, -0x2AD1=>0x2AD2, -0x2AD2=>0x2AD1, -0x2AD3=>0x2AD4, -0x2AD4=>0x2AD3, -0x2AD5=>0x2AD6, -0x2AD6=>0x2AD5, -0x2ADE=>0x22A6, -0x2AE3=>0x22A9, -0x2AE4=>0x22A8, -0x2AE5=>0x22AB, -0x2AEC=>0x2AED, -0x2AED=>0x2AEC, -0x2AF7=>0x2AF8, -0x2AF8=>0x2AF7, -0x2AF9=>0x2AFA, -0x2AFA=>0x2AF9, -0x2E02=>0x2E03, -0x2E03=>0x2E02, -0x2E04=>0x2E05, -0x2E05=>0x2E04, -0x2E09=>0x2E0A, -0x2E0A=>0x2E09, -0x2E0C=>0x2E0D, -0x2E0D=>0x2E0C, -0x2E1C=>0x2E1D, -0x2E1D=>0x2E1C, -0x3008=>0x3009, -0x3009=>0x3008, -0x300A=>0x300B, -0x300B=>0x300A, -0x300C=>0x300D, -0x300D=>0x300C, -0x300E=>0x300F, -0x300F=>0x300E, -0x3010=>0x3011, -0x3011=>0x3010, -0x3014=>0x3015, -0x3015=>0x3014, -0x3016=>0x3017, -0x3017=>0x3016, -0x3018=>0x3019, -0x3019=>0x3018, -0x301A=>0x301B, -0x301B=>0x301A, -0x301D=>0x301E, -0x301E=>0x301D, -0xFE59=>0xFE5A, -0xFE5A=>0xFE59, -0xFE5B=>0xFE5C, -0xFE5C=>0xFE5B, -0xFE5D=>0xFE5E, -0xFE5E=>0xFE5D, -0xFE64=>0xFE65, -0xFE65=>0xFE64, -0xFF08=>0xFF09, -0xFF09=>0xFF08, -0xFF1C=>0xFF1E, -0xFF1E=>0xFF1C, -0xFF3B=>0xFF3D, -0xFF3D=>0xFF3B, -0xFF5B=>0xFF5D, -0xFF5D=>0xFF5B, -0xFF5F=>0xFF60, -0xFF60=>0xFF5F, -0xFF62=>0xFF63, -0xFF63=>0xFF62); - -/** - * @var Arabic shape substitutions: char code => (isolated, final, initial, medial) - * @access public - */ -public $uni_arabicsubst = array( -1569=>array(65152), -1570=>array(65153, 65154, 65153, 65154), -1571=>array(65155, 65156, 65155, 65156), -1572=>array(65157, 65158), -1573=>array(65159, 65160, 65159, 65160), -1574=>array(65161, 65162, 65163, 65164), -1575=>array(65165, 65166, 65165, 65166), -1576=>array(65167, 65168, 65169, 65170), -1577=>array(65171, 65172), -1578=>array(65173, 65174, 65175, 65176), -1579=>array(65177, 65178, 65179, 65180), -1580=>array(65181, 65182, 65183, 65184), -1581=>array(65185, 65186, 65187, 65188), -1582=>array(65189, 65190, 65191, 65192), -1583=>array(65193, 65194, 65193, 65194), -1584=>array(65195, 65196, 65195, 65196), -1585=>array(65197, 65198, 65197, 65198), -1586=>array(65199, 65200, 65199, 65200), -1587=>array(65201, 65202, 65203, 65204), -1588=>array(65205, 65206, 65207, 65208), -1589=>array(65209, 65210, 65211, 65212), -1590=>array(65213, 65214, 65215, 65216), -1591=>array(65217, 65218, 65219, 65220), -1592=>array(65221, 65222, 65223, 65224), -1593=>array(65225, 65226, 65227, 65228), -1594=>array(65229, 65230, 65231, 65232), -1601=>array(65233, 65234, 65235, 65236), -1602=>array(65237, 65238, 65239, 65240), -1603=>array(65241, 65242, 65243, 65244), -1604=>array(65245, 65246, 65247, 65248), -1605=>array(65249, 65250, 65251, 65252), -1606=>array(65253, 65254, 65255, 65256), -1607=>array(65257, 65258, 65259, 65260), -1608=>array(65261, 65262, 65261, 65262), -1609=>array(65263, 65264, 64488, 64489), -1610=>array(65265, 65266, 65267, 65268), -1649=>array(64336, 64337), -1655=>array(64477), -1657=>array(64358, 64359, 64360, 64361), -1658=>array(64350, 64351, 64352, 64353), -1659=>array(64338, 64339, 64340, 64341), -1662=>array(64342, 64343, 64344, 64345), -1663=>array(64354, 64355, 64356, 64357), -1664=>array(64346, 64347, 64348, 64349), -1667=>array(64374, 64375, 64376, 64377), -1668=>array(64370, 64371, 64372, 64373), -1670=>array(64378, 64379, 64380, 64381), -1671=>array(64382, 64383, 64384, 64385), -1672=>array(64392, 64393), -1676=>array(64388, 64389), -1677=>array(64386, 64387), -1678=>array(64390, 64391), -1681=>array(64396, 64397), -1688=>array(64394, 64395, 64394, 64395), -1700=>array(64362, 64363, 64364, 64365), -1702=>array(64366, 64367, 64368, 64369), -1705=>array(64398, 64399, 64400, 64401), -1709=>array(64467, 64468, 64469, 64470), -1711=>array(64402, 64403, 64404, 64405), -1713=>array(64410, 64411, 64412, 64413), -1715=>array(64406, 64407, 64408, 64409), -1722=>array(64414, 64415), -1723=>array(64416, 64417, 64418, 64419), -1726=>array(64426, 64427, 64428, 64429), -1728=>array(64420, 64421), -1729=>array(64422, 64423, 64424, 64425), -1733=>array(64480, 64481), -1734=>array(64473, 64474), -1735=>array(64471, 64472), -1736=>array(64475, 64476), -1737=>array(64482, 64483), -1739=>array(64478, 64479), -1740=>array(64508, 64509, 64510, 64511), -1744=>array(64484, 64485, 64486, 64487), -1746=>array(64430, 64431), -1747=>array(64432, 64433) -); - -/** - * @var Arabic laa letter: char code => isolated, final, initial, medial - * @access public - */ -public $uni_laa_array = array ( -1570 =>array(65269, 65270, 65269, 65270), -1571 =>array(65271, 65272, 65271, 65272), -1573 =>array(65273, 65274, 65273, 65274), -1575 =>array(65275, 65276, 65275, 65276) -); - -/** - * @var Array of character substitutions for sequences of two diacritics symbols. - * Putting the combining mark and character in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. - * second NSM char code => substitution char - * @access public - */ -public $uni_diacritics = array ( -1612=>64606, # Shadda + Dammatan -1613=>64607, # Shadda + Kasratan -1614=>64608, # Shadda + Fatha -1615=>64609, # Shadda + Damma -1616=>64610 # Shadda + Kasra -); - -/** - * @var Array of character substitutions from UTF-8 Unicode to Latin1 - * @access public - */ -public $uni_utf8tolatin = array ( -8364=>128, # Euro1 -338=>140, # OE -352=>138, # Scaron -376=>159, # Ydieresis -381=>142, # Zcaron2 -8226=>149, # bullet3 -710=>136, # circumflex -8224=>134, # dagger -8225=>135, # daggerdbl -8230=>133, # ellipsis -8212=>151, # emdash -8211=>150, # endash -402=>131, # florin -8249=>139, # guilsinglleft -8250=>155, # guilsinglright -339=>156, # oe -8240=>137, # perthousand -8222=>132, # quotedblbase -8220=>147, # quotedblleft -8221=>148, # quotedblright -8216=>145, # quoteleft -8217=>146, # quoteright -8218=>130, # quotesinglbase -353=>154, # scaron -732=>152, # tilde -8482=>153, # trademark -382=>158 # zcaron2 -); - -} // --- END OF CLASS --- - -//============================================================+ -// END OF FILE -//============================================================+ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PasswordHasher.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PasswordHasher.php deleted file mode 100644 index 49ffcef0e2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PasswordHasher.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_PasswordHasher - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_PasswordHasher -{ - /** - * Create a password hash from a given string. - * - * This method is based on the algorithm provided by - * Daniel Rentz of OpenOffice and the PEAR package - * Spreadsheet_Excel_Writer by Xavier Noguer <xnoguer@rezebra.com>. - * - * @param string $pPassword Password to hash - * @return string Hashed password - */ - public static function hashPassword($pPassword = '') { - $password = 0x0000; - $i = 1; // char position - - // split the plain text password in its component characters - $chars = preg_split('//', $pPassword, -1, PREG_SPLIT_NO_EMPTY); - foreach ($chars as $char) { - $value = ord($char) << $i; // shifted ASCII value - $rotated_bits = $value >> 15; // rotated bits beyond bit 15 - $value &= 0x7fff; // first 15 bits - $password ^= ($value | $rotated_bits); - ++$i; - } - - $password ^= strlen($pPassword); - $password ^= 0xCE4B; - - return(strtoupper(dechex($password))); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/String.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/String.php deleted file mode 100644 index aab02f1cd2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/String.php +++ /dev/null @@ -1,706 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_String - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_String -{ - /** Constants */ - /** Regular Expressions */ - // Fraction - const STRING_REGEXP_FRACTION = '(-?)(\d+)\s+(\d+\/\d+)'; - - - /** - * Control characters array - * - * @var string[] - */ - private static $_controlCharacters = array(); - - /** - * SYLK Characters array - * - * $var array - */ - private static $_SYLKCharacters = array(); - - /** - * Decimal separator - * - * @var string - */ - private static $_decimalSeparator; - - /** - * Thousands separator - * - * @var string - */ - private static $_thousandsSeparator; - - /** - * Currency code - * - * @var string - */ - private static $_currencyCode; - - /** - * Is mbstring extension avalable? - * - * @var boolean - */ - private static $_isMbstringEnabled; - - /** - * Is iconv extension avalable? - * - * @var boolean - */ - private static $_isIconvEnabled; - - /** - * Build control characters array - */ - private static function _buildControlCharacters() { - for ($i = 0; $i <= 31; ++$i) { - if ($i != 9 && $i != 10 && $i != 13) { - $find = '_x' . sprintf('%04s' , strtoupper(dechex($i))) . '_'; - $replace = chr($i); - self::$_controlCharacters[$find] = $replace; - } - } - } - - /** - * Build SYLK characters array - */ - private static function _buildSYLKCharacters() - { - self::$_SYLKCharacters = array( - "\x1B 0" => chr(0), - "\x1B 1" => chr(1), - "\x1B 2" => chr(2), - "\x1B 3" => chr(3), - "\x1B 4" => chr(4), - "\x1B 5" => chr(5), - "\x1B 6" => chr(6), - "\x1B 7" => chr(7), - "\x1B 8" => chr(8), - "\x1B 9" => chr(9), - "\x1B :" => chr(10), - "\x1B ;" => chr(11), - "\x1B <" => chr(12), - "\x1B :" => chr(13), - "\x1B >" => chr(14), - "\x1B ?" => chr(15), - "\x1B!0" => chr(16), - "\x1B!1" => chr(17), - "\x1B!2" => chr(18), - "\x1B!3" => chr(19), - "\x1B!4" => chr(20), - "\x1B!5" => chr(21), - "\x1B!6" => chr(22), - "\x1B!7" => chr(23), - "\x1B!8" => chr(24), - "\x1B!9" => chr(25), - "\x1B!:" => chr(26), - "\x1B!;" => chr(27), - "\x1B!<" => chr(28), - "\x1B!=" => chr(29), - "\x1B!>" => chr(30), - "\x1B!?" => chr(31), - "\x1B'?" => chr(127), - "\x1B(0" => '€', // 128 in CP1252 - "\x1B(2" => '‚', // 130 in CP1252 - "\x1B(3" => 'Æ’', // 131 in CP1252 - "\x1B(4" => '„', // 132 in CP1252 - "\x1B(5" => '…', // 133 in CP1252 - "\x1B(6" => '†', // 134 in CP1252 - "\x1B(7" => '‡', // 135 in CP1252 - "\x1B(8" => 'ˆ', // 136 in CP1252 - "\x1B(9" => '‰', // 137 in CP1252 - "\x1B(:" => 'Å ', // 138 in CP1252 - "\x1B(;" => '‹', // 139 in CP1252 - "\x1BNj" => 'Å’', // 140 in CP1252 - "\x1B(>" => 'Ž', // 142 in CP1252 - "\x1B)1" => '‘', // 145 in CP1252 - "\x1B)2" => '’', // 146 in CP1252 - "\x1B)3" => '“', // 147 in CP1252 - "\x1B)4" => 'â€', // 148 in CP1252 - "\x1B)5" => '•', // 149 in CP1252 - "\x1B)6" => '–', // 150 in CP1252 - "\x1B)7" => '—', // 151 in CP1252 - "\x1B)8" => 'Ëœ', // 152 in CP1252 - "\x1B)9" => 'â„¢', // 153 in CP1252 - "\x1B):" => 'Å¡', // 154 in CP1252 - "\x1B);" => '›', // 155 in CP1252 - "\x1BNz" => 'Å“', // 156 in CP1252 - "\x1B)>" => 'ž', // 158 in CP1252 - "\x1B)?" => 'Ÿ', // 159 in CP1252 - "\x1B*0" => ' ', // 160 in CP1252 - "\x1BN!" => '¡', // 161 in CP1252 - "\x1BN\"" => '¢', // 162 in CP1252 - "\x1BN#" => '£', // 163 in CP1252 - "\x1BN(" => '¤', // 164 in CP1252 - "\x1BN%" => 'Â¥', // 165 in CP1252 - "\x1B*6" => '¦', // 166 in CP1252 - "\x1BN'" => '§', // 167 in CP1252 - "\x1BNH " => '¨', // 168 in CP1252 - "\x1BNS" => '©', // 169 in CP1252 - "\x1BNc" => 'ª', // 170 in CP1252 - "\x1BN+" => '«', // 171 in CP1252 - "\x1B*<" => '¬', // 172 in CP1252 - "\x1B*=" => '­', // 173 in CP1252 - "\x1BNR" => '®', // 174 in CP1252 - "\x1B*?" => '¯', // 175 in CP1252 - "\x1BN0" => '°', // 176 in CP1252 - "\x1BN1" => '±', // 177 in CP1252 - "\x1BN2" => '²', // 178 in CP1252 - "\x1BN3" => '³', // 179 in CP1252 - "\x1BNB " => '´', // 180 in CP1252 - "\x1BN5" => 'µ', // 181 in CP1252 - "\x1BN6" => '¶', // 182 in CP1252 - "\x1BN7" => '·', // 183 in CP1252 - "\x1B+8" => '¸', // 184 in CP1252 - "\x1BNQ" => '¹', // 185 in CP1252 - "\x1BNk" => 'º', // 186 in CP1252 - "\x1BN;" => '»', // 187 in CP1252 - "\x1BN<" => '¼', // 188 in CP1252 - "\x1BN=" => '½', // 189 in CP1252 - "\x1BN>" => '¾', // 190 in CP1252 - "\x1BN?" => '¿', // 191 in CP1252 - "\x1BNAA" => 'À', // 192 in CP1252 - "\x1BNBA" => 'Ã', // 193 in CP1252 - "\x1BNCA" => 'Â', // 194 in CP1252 - "\x1BNDA" => 'Ã', // 195 in CP1252 - "\x1BNHA" => 'Ä', // 196 in CP1252 - "\x1BNJA" => 'Ã…', // 197 in CP1252 - "\x1BNa" => 'Æ', // 198 in CP1252 - "\x1BNKC" => 'Ç', // 199 in CP1252 - "\x1BNAE" => 'È', // 200 in CP1252 - "\x1BNBE" => 'É', // 201 in CP1252 - "\x1BNCE" => 'Ê', // 202 in CP1252 - "\x1BNHE" => 'Ë', // 203 in CP1252 - "\x1BNAI" => 'ÃŒ', // 204 in CP1252 - "\x1BNBI" => 'Ã', // 205 in CP1252 - "\x1BNCI" => 'ÃŽ', // 206 in CP1252 - "\x1BNHI" => 'Ã', // 207 in CP1252 - "\x1BNb" => 'Ã', // 208 in CP1252 - "\x1BNDN" => 'Ñ', // 209 in CP1252 - "\x1BNAO" => 'Ã’', // 210 in CP1252 - "\x1BNBO" => 'Ó', // 211 in CP1252 - "\x1BNCO" => 'Ô', // 212 in CP1252 - "\x1BNDO" => 'Õ', // 213 in CP1252 - "\x1BNHO" => 'Ö', // 214 in CP1252 - "\x1B-7" => '×', // 215 in CP1252 - "\x1BNi" => 'Ø', // 216 in CP1252 - "\x1BNAU" => 'Ù', // 217 in CP1252 - "\x1BNBU" => 'Ú', // 218 in CP1252 - "\x1BNCU" => 'Û', // 219 in CP1252 - "\x1BNHU" => 'Ü', // 220 in CP1252 - "\x1B-=" => 'Ã', // 221 in CP1252 - "\x1BNl" => 'Þ', // 222 in CP1252 - "\x1BN{" => 'ß', // 223 in CP1252 - "\x1BNAa" => 'à', // 224 in CP1252 - "\x1BNBa" => 'á', // 225 in CP1252 - "\x1BNCa" => 'â', // 226 in CP1252 - "\x1BNDa" => 'ã', // 227 in CP1252 - "\x1BNHa" => 'ä', // 228 in CP1252 - "\x1BNJa" => 'Ã¥', // 229 in CP1252 - "\x1BNq" => 'æ', // 230 in CP1252 - "\x1BNKc" => 'ç', // 231 in CP1252 - "\x1BNAe" => 'è', // 232 in CP1252 - "\x1BNBe" => 'é', // 233 in CP1252 - "\x1BNCe" => 'ê', // 234 in CP1252 - "\x1BNHe" => 'ë', // 235 in CP1252 - "\x1BNAi" => 'ì', // 236 in CP1252 - "\x1BNBi" => 'í', // 237 in CP1252 - "\x1BNCi" => 'î', // 238 in CP1252 - "\x1BNHi" => 'ï', // 239 in CP1252 - "\x1BNs" => 'ð', // 240 in CP1252 - "\x1BNDn" => 'ñ', // 241 in CP1252 - "\x1BNAo" => 'ò', // 242 in CP1252 - "\x1BNBo" => 'ó', // 243 in CP1252 - "\x1BNCo" => 'ô', // 244 in CP1252 - "\x1BNDo" => 'õ', // 245 in CP1252 - "\x1BNHo" => 'ö', // 246 in CP1252 - "\x1B/7" => '÷', // 247 in CP1252 - "\x1BNy" => 'ø', // 248 in CP1252 - "\x1BNAu" => 'ù', // 249 in CP1252 - "\x1BNBu" => 'ú', // 250 in CP1252 - "\x1BNCu" => 'û', // 251 in CP1252 - "\x1BNHu" => 'ü', // 252 in CP1252 - "\x1B/=" => 'ý', // 253 in CP1252 - "\x1BN|" => 'þ', // 254 in CP1252 - "\x1BNHy" => 'ÿ', // 255 in CP1252 - ); - } - - /** - * Get whether mbstring extension is available - * - * @return boolean - */ - public static function getIsMbstringEnabled() - { - if (isset(self::$_isMbstringEnabled)) { - return self::$_isMbstringEnabled; - } - - self::$_isMbstringEnabled = function_exists('mb_convert_encoding') ? - true : false; - - return self::$_isMbstringEnabled; - } - - /** - * Get whether iconv extension is available - * - * @return boolean - */ - public static function getIsIconvEnabled() - { - if (isset(self::$_isIconvEnabled)) { - return self::$_isIconvEnabled; - } - - // Fail if iconv doesn't exist - if (!function_exists('iconv')) { - self::$_isIconvEnabled = false; - return false; - } - - // Sometimes iconv is not working, and e.g. iconv('UTF-8', 'UTF-16LE', 'x') just returns false, - if (!@iconv('UTF-8', 'UTF-16LE', 'x')) { - self::$_isIconvEnabled = false; - return false; - } - - // Sometimes iconv_substr('A', 0, 1, 'UTF-8') just returns false in PHP 5.2.0 - // we cannot use iconv in that case either (http://bugs.php.net/bug.php?id=37773) - if (!@iconv_substr('A', 0, 1, 'UTF-8')) { - self::$_isIconvEnabled = false; - return false; - } - - // CUSTOM: IBM AIX iconv() does not work - if ( defined('PHP_OS') && @stristr(PHP_OS, 'AIX') - && defined('ICONV_IMPL') && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) - && defined('ICONV_VERSION') && (@strcasecmp(ICONV_VERSION, 'unknown') == 0) ) - { - self::$_isIconvEnabled = false; - return false; - } - - // If we reach here no problems were detected with iconv - self::$_isIconvEnabled = true; - return true; - } - - public static function buildCharacterSets() { - if(empty(self::$_controlCharacters)) { - self::_buildControlCharacters(); - } - if(empty(self::$_SYLKCharacters)) { - self::_buildSYLKCharacters(); - } - } - - /** - * Convert from OpenXML escaped control character to PHP control character - * - * Excel 2007 team: - * ---------------- - * That's correct, control characters are stored directly in the shared-strings table. - * We do encode characters that cannot be represented in XML using the following escape sequence: - * _xHHHH_ where H represents a hexadecimal character in the character's value... - * So you could end up with something like _x0008_ in a string (either in a cell value (<v>) - * element or in the shared string <t> element. - * - * @param string $value Value to unescape - * @return string - */ - public static function ControlCharacterOOXML2PHP($value = '') { - return str_replace( array_keys(self::$_controlCharacters), array_values(self::$_controlCharacters), $value ); - } - - /** - * Convert from PHP control character to OpenXML escaped control character - * - * Excel 2007 team: - * ---------------- - * That's correct, control characters are stored directly in the shared-strings table. - * We do encode characters that cannot be represented in XML using the following escape sequence: - * _xHHHH_ where H represents a hexadecimal character in the character's value... - * So you could end up with something like _x0008_ in a string (either in a cell value (<v>) - * element or in the shared string <t> element. - * - * @param string $value Value to escape - * @return string - */ - public static function ControlCharacterPHP2OOXML($value = '') { - return str_replace( array_values(self::$_controlCharacters), array_keys(self::$_controlCharacters), $value ); - } - - /** - * Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters. - * - * @param string $value - * @return string - */ - public static function SanitizeUTF8($value) - { - if (self::getIsIconvEnabled()) { - $value = @iconv('UTF-8', 'UTF-8', $value); - return $value; - } - - if (self::getIsMbstringEnabled()) { - $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); - return $value; - } - - // else, no conversion - return $value; - } - - /** - * Check if a string contains UTF8 data - * - * @param string $value - * @return boolean - */ - public static function IsUTF8($value = '') { - return utf8_encode(utf8_decode($value)) === $value; - } - - /** - * Formats a numeric value as a string for output in various output writers forcing - * point as decimal separator in case locale is other than English. - * - * @param mixed $value - * @return string - */ - public static function FormatNumber($value) { - if (is_float($value)) { - return str_replace(',', '.', $value); - } - return (string) $value; - } - - /** - * Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length) - * Writes the string using uncompressed notation, no rich text, no Asian phonetics - * If mbstring extension is not available, ASCII is assumed, and compressed notation is used - * although this will give wrong results for non-ASCII strings - * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3 - * - * @param string $value UTF-8 encoded string - * @return string - */ - public static function UTF8toBIFF8UnicodeShort($value) - { - // character count - $ln = self::CountCharacters($value, 'UTF-8'); - - // option flags - $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ? - 0x0001 : 0x0000; - - // characters - $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); - - $data = pack('CC', $ln, $opt) . $chars; - return $data; - } - - /** - * Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length) - * Writes the string using uncompressed notation, no rich text, no Asian phonetics - * If mbstring extension is not available, ASCII is assumed, and compressed notation is used - * although this will give wrong results for non-ASCII strings - * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3 - * - * @param string $value UTF-8 encoded string - * @return string - */ - public static function UTF8toBIFF8UnicodeLong($value) - { - // character count - $ln = self::CountCharacters($value, 'UTF-8'); - - // option flags - $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ? - 0x0001 : 0x0000; - - // characters - $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8'); - - $data = pack('vC', $ln, $opt) . $chars; - return $data; - } - - /** - * Convert string from one encoding to another. First try iconv, then mbstring, or no convertion - * - * @param string $value - * @param string $to Encoding to convert to, e.g. 'UTF-8' - * @param string $from Encoding to convert from, e.g. 'UTF-16LE' - * @return string - */ - public static function ConvertEncoding($value, $to, $from) - { - if (self::getIsIconvEnabled()) { - $value = iconv($from, $to, $value); - return $value; - } - - if (self::getIsMbstringEnabled()) { - $value = mb_convert_encoding($value, $to, $from); - return $value; - } - if($from == 'UTF-16LE'){ - return self::utf16_decode($value, false); - }else if($from == 'UTF-16BE'){ - return self::utf16_decode($value); - } - // else, no conversion - return $value; - } - - /** - * Decode UTF-16 encoded strings. - * - * Can handle both BOM'ed data and un-BOM'ed data. - * Assumes Big-Endian byte order if no BOM is available. - * This function was taken from http://php.net/manual/en/function.utf8-decode.php - * and $bom_be parameter added. - * - * @param string $str UTF-16 encoded data to decode. - * @return string UTF-8 / ISO encoded data. - * @access public - * @version 0.2 / 2010-05-13 - * @author Rasmus Andersson {@link http://rasmusandersson.se/} - * @author vadik56 - */ - public static function utf16_decode( $str, $bom_be=true ) { - if( strlen($str) < 2 ) return $str; - $c0 = ord($str{0}); - $c1 = ord($str{1}); - if( $c0 == 0xfe && $c1 == 0xff ) { $str = substr($str,2); } - elseif( $c0 == 0xff && $c1 == 0xfe ) { $str = substr($str,2); $bom_be = false; } - $len = strlen($str); - $newstr = ''; - for($i=0;$i<$len;$i+=2) { - if( $bom_be ) { $val = ord($str{$i}) << 4; $val += ord($str{$i+1}); } - else { $val = ord($str{$i+1}) << 4; $val += ord($str{$i}); } - $newstr .= ($val == 0x228) ? "\n" : chr($val); - } - return $newstr; - } - - /** - * Get character count. First try mbstring, then iconv, finally strlen - * - * @param string $value - * @param string $enc Encoding - * @return int Character count - */ - public static function CountCharacters($value, $enc = 'UTF-8') - { - if (self::getIsIconvEnabled()) { - return iconv_strlen($value, $enc); - } - - if (self::getIsMbstringEnabled()) { - return mb_strlen($value, $enc); - } - - // else strlen - return strlen($value); - } - - /** - * Get a substring of a UTF-8 encoded string - * - * @param string $pValue UTF-8 encoded string - * @param int $start Start offset - * @param int $length Maximum number of characters in substring - * @return string - */ - public static function Substring($pValue = '', $pStart = 0, $pLength = 0) - { - if (self::getIsIconvEnabled()) { - return iconv_substr($pValue, $pStart, $pLength, 'UTF-8'); - } - - if (self::getIsMbstringEnabled()) { - return mb_substr($pValue, $pStart, $pLength, 'UTF-8'); - } - - // else substr - return substr($pValue, $pStart, $pLength); - } - - - /** - * Identify whether a string contains a fractional numeric value, - * and convert it to a numeric if it is - * - * @param string &$operand string value to test - * @return boolean - */ - public static function convertToNumberIfFraction(&$operand) { - if (preg_match('/^'.self::STRING_REGEXP_FRACTION.'$/i', $operand, $match)) { - $sign = ($match[1] == '-') ? '-' : '+'; - $fractionFormula = '='.$sign.$match[2].$sign.$match[3]; - $operand = PHPExcel_Calculation::getInstance()->_calculateFormulaValue($fractionFormula); - return true; - } - return false; - } // function convertToNumberIfFraction() - - /** - * Get the decimal separator. If it has not yet been set explicitly, try to obtain number - * formatting information from locale. - * - * @return string - */ - public static function getDecimalSeparator() - { - if (!isset(self::$_decimalSeparator)) { - $localeconv = localeconv(); - self::$_decimalSeparator = $localeconv['decimal_point'] != '' - ? $localeconv['decimal_point'] : $localeconv['mon_decimal_point']; - - if (self::$_decimalSeparator == '') { - // Default to . - self::$_decimalSeparator = '.'; - } - } - return self::$_decimalSeparator; - } - - /** - * Set the decimal separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() - * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF - * - * @param string $pValue Character for decimal separator - */ - public static function setDecimalSeparator($pValue = '.') - { - self::$_decimalSeparator = $pValue; - } - - /** - * Get the thousands separator. If it has not yet been set explicitly, try to obtain number - * formatting information from locale. - * - * @return string - */ - public static function getThousandsSeparator() - { - if (!isset(self::$_thousandsSeparator)) { - $localeconv = localeconv(); - self::$_thousandsSeparator = $localeconv['thousands_sep'] != '' - ? $localeconv['thousands_sep'] : $localeconv['mon_thousands_sep']; - } - return self::$_thousandsSeparator; - } - - /** - * Set the thousands separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString() - * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF - * - * @param string $pValue Character for thousands separator - */ - public static function setThousandsSeparator($pValue = ',') - { - self::$_thousandsSeparator = $pValue; - } - - /** - * Get the currency code. If it has not yet been set explicitly, try to obtain the - * symbol information from locale. - * - * @return string - */ - public static function getCurrencyCode() - { - if (!isset(self::$_currencyCode)) { - $localeconv = localeconv(); - self::$_currencyCode = $localeconv['currency_symbol'] != '' - ? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol']; - - if (self::$_currencyCode == '') { - // Default to $ - self::$_currencyCode = '$'; - } - } - return self::$_currencyCode; - } - - /** - * Set the currency code. Only used by PHPExcel_Style_NumberFormat::toFormattedString() - * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF - * - * @param string $pValue Character for currency code - */ - public static function setCurrencyCode($pValue = '$') - { - self::$_currencyCode = $pValue; - } - - /** - * Convert SYLK encoded string to UTF-8 - * - * @param string $pValue - * @return string UTF-8 encoded string - */ - public static function SYLKtoUTF8($pValue = '') - { - // If there is no escape character in the string there is nothing to do - if (strpos($pValue, '') === false) { - return $pValue; - } - - foreach (self::$_SYLKCharacters as $k => $v) { - $pValue = str_replace($k, $v, $pValue); - } - - return $pValue; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/XMLWriter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/XMLWriter.php deleted file mode 100644 index 96ef1b4119..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/XMLWriter.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -if (!defined('DATE_W3C')) { - define('DATE_W3C', 'Y-m-d\TH:i:sP'); -} - -if (!defined('DEBUGMODE_ENABLED')) { - define('DEBUGMODE_ENABLED', false); -} - - -/** - * PHPExcel_Shared_XMLWriter - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_XMLWriter extends XMLWriter { - /** Temporary storage method */ - const STORAGE_MEMORY = 1; - const STORAGE_DISK = 2; - - /** - * Temporary filename - * - * @var string - */ - private $_tempFileName = ''; - - /** - * Create a new PHPExcel_Shared_XMLWriter instance - * - * @param int $pTemporaryStorage Temporary storage location - * @param string $pTemporaryStorageFolder Temporary storage folder - */ - public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder = './') { - // Open temporary storage - if ($pTemporaryStorage == self::STORAGE_MEMORY) { - $this->openMemory(); - } else { - // Create temporary filename - $this->_tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); - - // Open storage - if ($this->openUri($this->_tempFileName) === false) { - // Fallback to memory... - $this->openMemory(); - } - } - - // Set default values - if (DEBUGMODE_ENABLED) { - $this->setIndent(true); - } - } - - /** - * Destructor - */ - public function __destruct() { - // Unlink temporary files - if ($this->_tempFileName != '') { - @unlink($this->_tempFileName); - } - } - - /** - * Get written data - * - * @return $data - */ - public function getData() { - if ($this->_tempFileName == '') { - return $this->outputMemory(true); - } else { - $this->flush(); - return file_get_contents($this->_tempFileName); - } - } - - /** - * Fallback method for writeRaw, introduced in PHP 5.2 - * - * @param string $text - * @return string - */ - public function writeRawData($text) - { - if (method_exists($this, 'writeRaw')) { - return $this->writeRaw(htmlspecialchars($text)); - } - - return $this->text($text); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipArchive.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipArchive.php deleted file mode 100644 index 559f166a6f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipArchive.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_ZipArchive - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php'; - - -/** - * PHPExcel_Shared_ZipArchive - * - * @category PHPExcel - * @package PHPExcel_Shared_ZipArchive - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_ZipArchive -{ - - /** - * Temporary storage directory - * - * @var string - */ - private $_tempDir; - - /** - * Zip Archive Stream Handle - * - * @var string - */ - private $_zip; - - - public function open($fileName) - { - $this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); - - $this->_zip = new PclZip($fileName); - - return true; - } - - - public function close() - { - } - - - public function addFromString($localname, $contents) - { - $filenameParts = pathinfo($localname); - - $handle = fopen($this->_tempDir.'/'.$filenameParts["basename"], "wb"); - fwrite($handle, $contents); - fclose($handle); - - $res = $this->_zip->add($this->_tempDir.'/'.$filenameParts["basename"], - PCLZIP_OPT_REMOVE_PATH, $this->_tempDir, - PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"] - ); - if ($res == 0) { - throw new Exception("Error zipping files : " . $this->_zip->errorInfo(true)); - } - - unlink($this->_tempDir.'/'.$filenameParts["basename"]); - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipStreamWrapper.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipStreamWrapper.php deleted file mode 100644 index 06df19dedc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/ZipStreamWrapper.php +++ /dev/null @@ -1,163 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_ZipStreamWrapper - * - * @category PHPExcel - * @package PHPExcel_Shared - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Shared_ZipStreamWrapper { - /** - * Internal ZipAcrhive - * - * @var ZipAcrhive - */ - private $_archive; - - /** - * Filename in ZipAcrhive - * - * @var string - */ - private $_fileNameInArchive = ''; - - /** - * Position in file - * - * @var int - */ - private $_position = 0; - - /** - * Data - * - * @var mixed - */ - private $_data = ''; - - /** - * Register wrapper - */ - public static function register() { - @stream_wrapper_unregister("zip"); - @stream_wrapper_register("zip", __CLASS__); - } - - /** - * Open stream - */ - public function stream_open($path, $mode, $options, &$opened_path) { - // Check for mode - if ($mode{0} != 'r') { - throw new Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.'); - } - - $pos = strrpos($path, '#'); - $url['host'] = substr($path, 6, $pos - 6); // 6: strlen('zip://') - $url['fragment'] = substr($path, $pos + 1); - - // Open archive - $this->_archive = new ZipArchive(); - $this->_archive->open($url['host']); - - $this->_fileNameInArchive = $url['fragment']; - $this->_position = 0; - $this->_data = $this->_archive->getFromName( $this->_fileNameInArchive ); - - return true; - } - - /** - * Stat stream - */ - public function stream_stat() { - return $this->_archive->statName( $this->_fileNameInArchive ); - } - - /** - * Read stream - */ - function stream_read($count) { - $ret = substr($this->_data, $this->_position, $count); - $this->_position += strlen($ret); - return $ret; - } - - /** - * Tell stream - */ - public function stream_tell() { - return $this->_position; - } - - /** - * EOF stream - */ - public function stream_eof() { - return $this->_position >= strlen($this->_data); - } - - /** - * Seek stream - */ - public function stream_seek($offset, $whence) { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($this->_data) && $offset >= 0) { - $this->_position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->_position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($this->_data) + $offset >= 0) { - $this->_position = strlen($this->_data) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/bestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/bestFitClass.php deleted file mode 100644 index 4224d4ffbe..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/bestFitClass.php +++ /dev/null @@ -1,331 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Best_Fit -{ - protected $_error = False; - - protected $_bestFitType = 'undetermined'; - - protected $_valueCount = 0; - - protected $_xValues = array(); - - protected $_yValues = array(); - - protected $_adjustToZero = False; - - protected $_yBestFitValues = array(); - - protected $_goodnessOfFit = 1; - - protected $_stdevOfResiduals = 0; - - protected $_covariance = 0; - - protected $_correlation = 0; - - protected $_SSRegression = 0; - - protected $_SSResiduals = 0; - - protected $_DFResiduals = 0; - - protected $_F = 0; - - protected $_slope = 0; - - protected $_slopeSE = 0; - - protected $_intersect = 0; - - protected $_intersectSE = 0; - - protected $_Xoffset = 0; - - protected $_Yoffset = 0; - - - public function getError() { - return $this->_error; - } // function getBestFitType() - - - public function getBestFitType() { - return $this->_bestFitType; - } // function getBestFitType() - - - public function getValueOfYForX($xValue) { - return False; - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return False; - } // function getValueOfXForY() - - - public function getXValues() { - return $this->_xValues; - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - return False; - } // function getEquation() - - - public function getSlope($dp=0) { - if ($dp != 0) { - return round($this->_slope,$dp); - } - return $this->_slope; - } // function getSlope() - - - public function getSlopeSE($dp=0) { - if ($dp != 0) { - return round($this->_slopeSE,$dp); - } - return $this->_slopeSE; - } // function getSlopeSE() - - - public function getIntersect($dp=0) { - if ($dp != 0) { - return round($this->_intersect,$dp); - } - return $this->_intersect; - } // function getIntersect() - - - public function getIntersectSE($dp=0) { - if ($dp != 0) { - return round($this->_intersectSE,$dp); - } - return $this->_intersectSE; - } // function getIntersectSE() - - - public function getGoodnessOfFit($dp=0) { - if ($dp != 0) { - return round($this->_goodnessOfFit,$dp); - } - return $this->_goodnessOfFit; - } // function getGoodnessOfFit() - - - public function getGoodnessOfFitPercent($dp=0) { - if ($dp != 0) { - return round($this->_goodnessOfFit * 100,$dp); - } - return $this->_goodnessOfFit * 100; - } // function getGoodnessOfFitPercent() - - - public function getStdevOfResiduals($dp=0) { - if ($dp != 0) { - return round($this->_stdevOfResiduals,$dp); - } - return $this->_stdevOfResiduals; - } // function getStdevOfResiduals() - - - public function getSSRegression($dp=0) { - if ($dp != 0) { - return round($this->_SSRegression,$dp); - } - return $this->_SSRegression; - } // function getSSRegression() - - - public function getSSResiduals($dp=0) { - if ($dp != 0) { - return round($this->_SSResiduals,$dp); - } - return $this->_SSResiduals; - } // function getSSResiduals() - - - public function getDFResiduals($dp=0) { - if ($dp != 0) { - return round($this->_DFResiduals,$dp); - } - return $this->_DFResiduals; - } // function getDFResiduals() - - - public function getF($dp=0) { - if ($dp != 0) { - return round($this->_F,$dp); - } - return $this->_F; - } // function getF() - - - public function getCovariance($dp=0) { - if ($dp != 0) { - return round($this->_covariance,$dp); - } - return $this->_covariance; - } // function getCovariance() - - - public function getCorrelation($dp=0) { - if ($dp != 0) { - return round($this->_correlation,$dp); - } - return $this->_correlation; - } // function getCorrelation() - - - public function getYBestFitValues() { - return $this->_yBestFitValues; - } // function getYBestFitValues() - - - protected function _calculateGoodnessOfFit($sumX,$sumY,$sumX2,$sumY2,$sumXY,$meanX,$meanY, $const) { - $SSres = $SScov = $SScor = $SStot = $SSsex = 0.0; - foreach($this->_xValues as $xKey => $xValue) { - $bestFitY = $this->_yBestFitValues[$xKey] = $this->getValueOfYForX($xValue); - - $SSres += ($this->_yValues[$xKey] - $bestFitY) * ($this->_yValues[$xKey] - $bestFitY); - if ($const) { - $SStot += ($this->_yValues[$xKey] - $meanY) * ($this->_yValues[$xKey] - $meanY); - } else { - $SStot += $this->_yValues[$xKey] * $this->_yValues[$xKey]; - } - $SScov += ($this->_xValues[$xKey] - $meanX) * ($this->_yValues[$xKey] - $meanY); - if ($const) { - $SSsex += ($this->_xValues[$xKey] - $meanX) * ($this->_xValues[$xKey] - $meanX); - } else { - $SSsex += $this->_xValues[$xKey] * $this->_xValues[$xKey]; - } - } - - $this->_SSResiduals = $SSres; - $this->_DFResiduals = $this->_valueCount - 1 - $const; - - if ($this->_DFResiduals == 0.0) { - $this->_stdevOfResiduals = 0.0; - } else { - $this->_stdevOfResiduals = sqrt($SSres / $this->_DFResiduals); - } - if (($SStot == 0.0) || ($SSres == $SStot)) { - $this->_goodnessOfFit = 1; - } else { - $this->_goodnessOfFit = 1 - ($SSres / $SStot); - } - - $this->_SSRegression = $this->_goodnessOfFit * $SStot; - $this->_covariance = $SScov / $this->_valueCount; - $this->_correlation = ($this->_valueCount * $sumXY - $sumX * $sumY) / sqrt(($this->_valueCount * $sumX2 - pow($sumX,2)) * ($this->_valueCount * $sumY2 - pow($sumY,2))); - $this->_slopeSE = $this->_stdevOfResiduals / sqrt($SSsex); - $this->_intersectSE = $this->_stdevOfResiduals * sqrt(1 / ($this->_valueCount - ($sumX * $sumX) / $sumX2)); - if ($this->_SSResiduals != 0.0) { - if ($this->_DFResiduals == 0.0) { - $this->_F = 0.0; - } else { - $this->_F = $this->_SSRegression / ($this->_SSResiduals / $this->_DFResiduals); - } - } else { - if ($this->_DFResiduals == 0.0) { - $this->_F = 0.0; - } else { - $this->_F = $this->_SSRegression / $this->_DFResiduals; - } - } - } // function _calculateGoodnessOfFit() - - - protected function _leastSquareFit($yValues, $xValues, $const) { - // calculate sums - $x_sum = array_sum($xValues); - $y_sum = array_sum($yValues); - $meanX = $x_sum / $this->_valueCount; - $meanY = $y_sum / $this->_valueCount; - $mBase = $mDivisor = $xx_sum = $xy_sum = $yy_sum = 0.0; - for($i = 0; $i < $this->_valueCount; ++$i) { - $xy_sum += $xValues[$i] * $yValues[$i]; - $xx_sum += $xValues[$i] * $xValues[$i]; - $yy_sum += $yValues[$i] * $yValues[$i]; - - if ($const) { - $mBase += ($xValues[$i] - $meanX) * ($yValues[$i] - $meanY); - $mDivisor += ($xValues[$i] - $meanX) * ($xValues[$i] - $meanX); - } else { - $mBase += $xValues[$i] * $yValues[$i]; - $mDivisor += $xValues[$i] * $xValues[$i]; - } - } - - // calculate slope -// $this->_slope = (($this->_valueCount * $xy_sum) - ($x_sum * $y_sum)) / (($this->_valueCount * $xx_sum) - ($x_sum * $x_sum)); - $this->_slope = $mBase / $mDivisor; - - // calculate intersect -// $this->_intersect = ($y_sum - ($this->_slope * $x_sum)) / $this->_valueCount; - if ($const) { - $this->_intersect = $meanY - ($this->_slope * $meanX); - } else { - $this->_intersect = 0; - } - - $this->_calculateGoodnessOfFit($x_sum,$y_sum,$xx_sum,$yy_sum,$xy_sum,$meanX,$meanY,$const); - } // function _leastSquareFit() - - - function __construct($yValues, $xValues=array(), $const=True) { - // Calculate number of points - $nY = count($yValues); - $nX = count($xValues); - - // Define X Values if necessary - if ($nX == 0) { - $xValues = range(1,$nY); - $nX = $nY; - } elseif ($nY != $nX) { - // Ensure both arrays of points are the same size - $this->_error = True; - return False; - } - - $this->_valueCount = $nY; - $this->_xValues = $xValues; - $this->_yValues = $yValues; - } // function __construct() - -} // class bestFit diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/exponentialBestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/exponentialBestFitClass.php deleted file mode 100644 index b2a3b33134..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/exponentialBestFitClass.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); - - -/** - * PHPExcel_Exponential_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Exponential_Best_Fit extends PHPExcel_Best_Fit -{ - protected $_bestFitType = 'exponential'; - - - public function getValueOfYForX($xValue) { - return $this->getIntersect() * pow($this->getSlope(),($xValue - $this->_Xoffset)); - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return log(($yValue + $this->_Yoffset) / $this->getIntersect()) / log($this->getSlope()); - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - $slope = $this->getSlope($dp); - $intersect = $this->getIntersect($dp); - - return 'Y = '.$intersect.' * '.$slope.'^X'; - } // function getEquation() - - - public function getSlope($dp=0) { - if ($dp != 0) { - return round(exp($this->_slope),$dp); - } - return exp($this->_slope); - } // function getSlope() - - - public function getIntersect($dp=0) { - if ($dp != 0) { - return round(exp($this->_intersect),$dp); - } - return exp($this->_intersect); - } // function getIntersect() - - - private function _exponential_regression($yValues, $xValues, $const) { - foreach($yValues as &$value) { - if ($value < 0.0) { - $value = 0 - log(abs($value)); - } elseif ($value > 0.0) { - $value = log($value); - } - } - unset($value); - - $this->_leastSquareFit($yValues, $xValues, $const); - } // function _exponential_regression() - - - function __construct($yValues, $xValues=array(), $const=True) { - if (parent::__construct($yValues, $xValues) !== False) { - $this->_exponential_regression($yValues, $xValues, $const); - } - } // function __construct() - -} // class exponentialBestFit \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/linearBestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/linearBestFitClass.php deleted file mode 100644 index 19a8641134..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/linearBestFitClass.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); - - -/** - * PHPExcel_Linear_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Linear_Best_Fit extends PHPExcel_Best_Fit -{ - protected $_bestFitType = 'linear'; - - - public function getValueOfYForX($xValue) { - return $this->getIntersect() + $this->getSlope() * $xValue; - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return ($yValue - $this->getIntersect()) / $this->getSlope(); - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - $slope = $this->getSlope($dp); - $intersect = $this->getIntersect($dp); - - return 'Y = '.$intersect.' + '.$slope.' * X'; - } // function getEquation() - - - private function _linear_regression($yValues, $xValues, $const) { - $this->_leastSquareFit($yValues, $xValues,$const); - } // function _linear_regression() - - - function __construct($yValues, $xValues=array(), $const=True) { - if (parent::__construct($yValues, $xValues) !== False) { - $this->_linear_regression($yValues, $xValues, $const); - } - } // function __construct() - -} // class linearBestFit \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/logarithmicBestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/logarithmicBestFitClass.php deleted file mode 100644 index e5d98516c0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/logarithmicBestFitClass.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -require_once(PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'); - - -/** - * PHPExcel_Logarithmic_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Logarithmic_Best_Fit extends PHPExcel_Best_Fit -{ - protected $_bestFitType = 'logarithmic'; - - - public function getValueOfYForX($xValue) { - return $this->getIntersect() + $this->getSlope() * log($xValue - $this->_Xoffset); - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return exp(($yValue - $this->getIntersect()) / $this->getSlope()); - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - $slope = $this->getSlope($dp); - $intersect = $this->getIntersect($dp); - - return 'Y = '.$intersect.' + '.$slope.' * log(X)'; - } // function getEquation() - - - private function _logarithmic_regression($yValues, $xValues, $const) { - foreach($xValues as &$value) { - if ($value < 0.0) { - $value = 0 - log(abs($value)); - } elseif ($value > 0.0) { - $value = log($value); - } - } - unset($value); - - $this->_leastSquareFit($yValues, $xValues, $const); - } // function _logarithmic_regression() - - - function __construct($yValues, $xValues=array(), $const=True) { - if (parent::__construct($yValues, $xValues) !== False) { - $this->_logarithmic_regression($yValues, $xValues, $const); - } - } // function __construct() - -} // class logarithmicBestFit \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/polynomialBestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/polynomialBestFitClass.php deleted file mode 100644 index e16e2002ad..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/polynomialBestFitClass.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/JAMA/Matrix.php'; - - -/** - * PHPExcel_Polynomial_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Polynomial_Best_Fit extends PHPExcel_Best_Fit -{ - protected $_bestFitType = 'polynomial'; - - protected $_order = 0; - - - public function getOrder() { - return $this->_order; - } // function getOrder() - - - public function getValueOfYForX($xValue) { - $retVal = $this->getIntersect(); - $slope = $this->getSlope(); - foreach($slope as $key => $value) { - if ($value != 0.0) { - $retVal += $value * pow($xValue, $key + 1); - } - } - return $retVal; - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return ($yValue - $this->getIntersect()) / $this->getSlope(); - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - $slope = $this->getSlope($dp); - $intersect = $this->getIntersect($dp); - - $equation = 'Y = '.$intersect; - foreach($slope as $key => $value) { - if ($value != 0.0) { - $equation .= ' + '.$value.' * X'; - if ($key > 0) { - $equation .= '^'.($key + 1); - } - } - } - return $equation; - } // function getEquation() - - - public function getSlope($dp=0) { - if ($dp != 0) { - $coefficients = array(); - foreach($this->_slope as $coefficient) { - $coefficients[] = round($coefficient,$dp); - } - return $coefficients; - } - return $this->_slope; - } // function getSlope() - - - public function getCoefficients($dp=0) { - return array_merge(array($this->getIntersect($dp)),$this->getSlope($dp)); - } // function getCoefficients() - - - private function _polynomial_regression($order, $yValues, $xValues, $const) { - // calculate sums - $x_sum = array_sum($xValues); - $y_sum = array_sum($yValues); - $xx_sum = $xy_sum = 0; - for($i = 0; $i < $this->_valueCount; ++$i) { - $xy_sum += $xValues[$i] * $yValues[$i]; - $xx_sum += $xValues[$i] * $xValues[$i]; - $yy_sum += $yValues[$i] * $yValues[$i]; - } - /* - * This routine uses logic from the PHP port of polyfit version 0.1 - * written by Michael Bommarito and Paul Meagher - * - * The function fits a polynomial function of order $order through - * a series of x-y data points using least squares. - * - */ - for ($i = 0; $i < $this->_valueCount; ++$i) { - for ($j = 0; $j <= $order; ++$j) { - $A[$i][$j] = pow($xValues[$i], $j); - } - } - for ($i=0; $i < $this->_valueCount; ++$i) { - $B[$i] = array($yValues[$i]); - } - $matrixA = new Matrix($A); - $matrixB = new Matrix($B); - $C = $matrixA->solve($matrixB); - - $coefficients = array(); - for($i = 0; $i < $C->m; ++$i) { - $r = $C->get($i, 0); - if (abs($r) <= pow(10, -9)) { - $r = 0; - } - $coefficients[] = $r; - } - - $this->_intersect = array_shift($coefficients); - $this->_slope = $coefficients; - - $this->_calculateGoodnessOfFit($x_sum,$y_sum,$xx_sum,$yy_sum,$xy_sum); - foreach($this->_xValues as $xKey => $xValue) { - $this->_yBestFitValues[$xKey] = $this->getValueOfYForX($xValue); - } - } // function _polynomial_regression() - - - function __construct($order, $yValues, $xValues=array(), $const=True) { - if (parent::__construct($yValues, $xValues) !== False) { - if ($order < $this->_valueCount) { - $this->_bestFitType .= '_'.$order; - $this->_order = $order; - $this->_polynomial_regression($order, $yValues, $xValues, $const); - if (($this->getGoodnessOfFit() < 0.0) || ($this->getGoodnessOfFit() > 1.0)) { - $this->_error = True; - } - } else { - $this->_error = True; - } - } - } // function __construct() - -} // class polynomialBestFit \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/powerBestFitClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/powerBestFitClass.php deleted file mode 100644 index bb82423d35..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/powerBestFitClass.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/bestFitClass.php'; - - -/** - * PHPExcel_Power_Best_Fit - * - * @category PHPExcel - * @package PHPExcel_Shared_Best_Fit - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Power_Best_Fit extends PHPExcel_Best_Fit -{ - protected $_bestFitType = 'power'; - - - public function getValueOfYForX($xValue) { - return $this->getIntersect() * pow(($xValue - $this->_Xoffset),$this->getSlope()); - } // function getValueOfYForX() - - - public function getValueOfXForY($yValue) { - return pow((($yValue + $this->_Yoffset) / $this->getIntersect()),(1 / $this->getSlope())); - } // function getValueOfXForY() - - - public function getEquation($dp=0) { - $slope = $this->getSlope($dp); - $intersect = $this->getIntersect($dp); - - return 'Y = '.$intersect.' * X^'.$slope; - } // function getEquation() - - - public function getIntersect($dp=0) { - if ($dp != 0) { - return round(exp($this->_intersect),$dp); - } - return exp($this->_intersect); - } // function getIntersect() - - - private function _power_regression($yValues, $xValues, $const) { - foreach($xValues as &$value) { - if ($value < 0.0) { - $value = 0 - log(abs($value)); - } elseif ($value > 0.0) { - $value = log($value); - } - } - unset($value); - foreach($yValues as &$value) { - if ($value < 0.0) { - $value = 0 - log(abs($value)); - } elseif ($value > 0.0) { - $value = log($value); - } - } - unset($value); - - $this->_leastSquareFit($yValues, $xValues, $const); - } // function _power_regression() - - - function __construct($yValues, $xValues=array(), $const=True) { - if (parent::__construct($yValues, $xValues) !== False) { - $this->_power_regression($yValues, $xValues, $const); - } - } // function __construct() - -} // class powerBestFit \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/trendClass.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/trendClass.php deleted file mode 100644 index f987831cdc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/trend/trendClass.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/linearBestFitClass.php'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/logarithmicBestFitClass.php'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/exponentialBestFitClass.php'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/powerBestFitClass.php'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/trend/polynomialBestFitClass.php'; - - -class trendClass -{ - const TREND_LINEAR = 'Linear'; - const TREND_LOGARITHMIC = 'Logarithmic'; - const TREND_EXPONENTIAL = 'Exponential'; - const TREND_POWER = 'Power'; - const TREND_POLYNOMIAL_2 = 'Polynomial_2'; - const TREND_POLYNOMIAL_3 = 'Polynomial_3'; - const TREND_POLYNOMIAL_4 = 'Polynomial_4'; - const TREND_POLYNOMIAL_5 = 'Polynomial_5'; - const TREND_POLYNOMIAL_6 = 'Polynomial_6'; - const TREND_BEST_FIT = 'Bestfit'; - const TREND_BEST_FIT_NO_POLY = 'Bestfit_no_Polynomials'; - - private static $_trendTypes = array( self::TREND_LINEAR, - self::TREND_LOGARITHMIC, - self::TREND_EXPONENTIAL, - self::TREND_POWER - ); - private static $_trendTypePolyOrders = array( self::TREND_POLYNOMIAL_2, - self::TREND_POLYNOMIAL_3, - self::TREND_POLYNOMIAL_4, - self::TREND_POLYNOMIAL_5, - self::TREND_POLYNOMIAL_6 - ); - - private static $_trendCache = array(); - - - public static function calculate($trendType=self::TREND_BEST_FIT, $yValues, $xValues=array(), $const=True) { - // Calculate number of points in each dataset - $nY = count($yValues); - $nX = count($xValues); - - // Define X Values if necessary - if ($nX == 0) { - $xValues = range(1,$nY); - $nX = $nY; - } elseif ($nY != $nX) { - // Ensure both arrays of points are the same size - trigger_error("trend(): Number of elements in coordinate arrays do not match.", E_USER_ERROR); - } - - $key = md5($trendType.$const.serialize($yValues).serialize($xValues)); - // Determine which trend method has been requested - switch ($trendType) { - // Instantiate and return the class for the requested trend method - case self::TREND_LINEAR : - case self::TREND_LOGARITHMIC : - case self::TREND_EXPONENTIAL : - case self::TREND_POWER : - if (!isset(self::$_trendCache[$key])) { - $className = 'PHPExcel_'.$trendType.'_Best_Fit'; - self::$_trendCache[$key] = new $className($yValues,$xValues,$const); - } - return self::$_trendCache[$key]; - break; - case self::TREND_POLYNOMIAL_2 : - case self::TREND_POLYNOMIAL_3 : - case self::TREND_POLYNOMIAL_4 : - case self::TREND_POLYNOMIAL_5 : - case self::TREND_POLYNOMIAL_6 : - if (!isset(self::$_trendCache[$key])) { - $order = substr($trendType,-1); - self::$_trendCache[$key] = new PHPExcel_Polynomial_Best_Fit($order,$yValues,$xValues,$const); - } - return self::$_trendCache[$key]; - break; - case self::TREND_BEST_FIT : - case self::TREND_BEST_FIT_NO_POLY : - // If the request is to determine the best fit regression, then we test each trend line in turn - // Start by generating an instance of each available trend method - foreach(self::$_trendTypes as $trendMethod) { - $className = 'PHPExcel_'.$trendMethod.'BestFit'; - $bestFit[$trendMethod] = new $className($yValues,$xValues,$const); - $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); - } - if ($trendType != self::TREND_BEST_FIT_NO_POLY) { - foreach(self::$_trendTypePolyOrders as $trendMethod) { - $order = substr($trendMethod,-1); - $bestFit[$trendMethod] = new PHPExcel_Polynomial_Best_Fit($order,$yValues,$xValues,$const); - if ($bestFit[$trendMethod]->getError()) { - unset($bestFit[$trendMethod]); - } else { - $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit(); - } - } - } - // Determine which of our trend lines is the best fit, and then we return the instance of that trend class - arsort($bestFitValue); - $bestFitType = key($bestFitValue); - return $bestFit[$bestFitType]; - break; - default : - return false; - } - } // function calculate() - -} // class trendClass \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style.php deleted file mode 100644 index 4cf468c9c5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style.php +++ /dev/null @@ -1,679 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style implements PHPExcel_IComparable -{ - /** - * Font - * - * @var PHPExcel_Style_Font - */ - private $_font; - - /** - * Fill - * - * @var PHPExcel_Style_Fill - */ - private $_fill; - - /** - * Borders - * - * @var PHPExcel_Style_Borders - */ - private $_borders; - - /** - * Alignment - * - * @var PHPExcel_Style_Alignment - */ - private $_alignment; - - /** - * Number Format - * - * @var PHPExcel_Style_NumberFormat - */ - private $_numberFormat; - - /** - * Conditional styles - * - * @var PHPExcel_Style_Conditional[] - */ - private $_conditionalStyles; - - /** - * Protection - * - * @var PHPExcel_Style_Protection - */ - private $_protection; - - /** - * Style supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for style supervisor - * - * @var PHPExcel - */ - private $_parent; - - /** - * Index of style in collection. Only used for real style. - * - * @var int - */ - private $_index; - - /** - * Create a new PHPExcel_Style - * - * @param boolean $isSupervisor - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_conditionalStyles = array(); - $this->_font = new PHPExcel_Style_Font($isSupervisor); - $this->_fill = new PHPExcel_Style_Fill($isSupervisor); - $this->_borders = new PHPExcel_Style_Borders($isSupervisor); - $this->_alignment = new PHPExcel_Style_Alignment($isSupervisor); - $this->_numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor); - $this->_protection = new PHPExcel_Style_Protection($isSupervisor); - - // bind parent if we are a supervisor - if ($isSupervisor) { - $this->_font->bindParent($this); - $this->_fill->bindParent($this); - $this->_borders->bindParent($this); - $this->_alignment->bindParent($this); - $this->_numberFormat->bindParent($this); - $this->_protection->bindParent($this); - } - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel $parent - * @return PHPExcel_Style - */ - public function bindParent($parent) - { - $this->_parent = $parent; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style - */ - public function getSharedComponent() - { - $activeSheet = $this->getActiveSheet(); - $selectedCell = $this->getActiveCell(); // e.g. 'A1' - - if ($activeSheet->cellExists($selectedCell)) { - $xfIndex = $activeSheet->getCell($selectedCell)->getXfIndex(); - } else { - $xfIndex = 0; - } - - return $this->_parent->getCellXfByIndex($xfIndex); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->_parent->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->_parent->getActiveSheet()->getActiveCell(); - } - - /** - * Get parent. Only used for style supervisor - * - * @return PHPExcel - */ - public function getParent() - { - return $this->_parent; - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray( - * array( - * 'font' => array( - * 'name' => 'Arial', - * 'bold' => true, - * 'italic' => false, - * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, - * 'strike' => false, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ), - * 'borders' => array( - * 'bottom' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ), - * 'top' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ) - * ) - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @param boolean $pAdvanced Advanced mode for setting borders. - * @throws Exception - * @return PHPExcel_Style - */ - public function applyFromArray($pStyles = null, $pAdvanced = true) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - - $pRange = $this->getSelectedCells(); - - // Uppercase coordinate - $pRange = strtoupper($pRange); - - // Is it a cell range or a single cell? - if (strpos($pRange, ':') === false) { - $rangeA = $pRange; - $rangeB = $pRange; - } else { - list($rangeA, $rangeB) = explode(':', $pRange); - } - - // Calculate range outer borders - $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA); - $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB); - - // Translate column into index - $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1; - $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1; - - // Make sure we can loop upwards on rows and columns - if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { - $tmp = $rangeStart; - $rangeStart = $rangeEnd; - $rangeEnd = $tmp; - } - - // ADVANCED MODE: - - if ($pAdvanced && isset($pStyles['borders'])) { - - // 'allborders' is a shorthand property for 'outline' and 'inside' and - // it applies to components that have not been set explicitly - if (isset($pStyles['borders']['allborders'])) { - foreach (array('outline', 'inside') as $component) { - if (!isset($pStyles['borders'][$component])) { - $pStyles['borders'][$component] = $pStyles['borders']['allborders']; - } - } - unset($pStyles['borders']['allborders']); // not needed any more - } - - // 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left' - // it applies to components that have not been set explicitly - if (isset($pStyles['borders']['outline'])) { - foreach (array('top', 'right', 'bottom', 'left') as $component) { - if (!isset($pStyles['borders'][$component])) { - $pStyles['borders'][$component] = $pStyles['borders']['outline']; - } - } - unset($pStyles['borders']['outline']); // not needed any more - } - - // 'inside' is a shorthand property for 'vertical' and 'horizontal' - // it applies to components that have not been set explicitly - if (isset($pStyles['borders']['inside'])) { - foreach (array('vertical', 'horizontal') as $component) { - if (!isset($pStyles['borders'][$component])) { - $pStyles['borders'][$component] = $pStyles['borders']['inside']; - } - } - unset($pStyles['borders']['inside']); // not needed any more - } - - // width and height characteristics of selection, 1, 2, or 3 (for 3 or more) - $xMax = min($rangeEnd[0] - $rangeStart[0] + 1, 3); - $yMax = min($rangeEnd[1] - $rangeStart[1] + 1, 3); - - // loop through up to 3 x 3 = 9 regions - for ($x = 1; $x <= $xMax; ++$x) { - // start column index for region - $colStart = ($x == 3) ? - PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]) - : PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1); - - // end column index for region - $colEnd = ($x == 1) ? - PHPExcel_Cell::stringFromColumnIndex($rangeStart[0]) - : PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x); - - for ($y = 1; $y <= $yMax; ++$y) { - - // which edges are touching the region - $edges = array(); - - // are we at left edge - if ($x == 1) { - $edges[] = 'left'; - } - - // are we at right edge - if ($x == $xMax) { - $edges[] = 'right'; - } - - // are we at top edge? - if ($y == 1) { - $edges[] = 'top'; - } - - // are we at bottom edge? - if ($y == $yMax) { - $edges[] = 'bottom'; - } - - // start row index for region - $rowStart = ($y == 3) ? - $rangeEnd[1] : $rangeStart[1] + $y - 1; - - // end row index for region - $rowEnd = ($y == 1) ? - $rangeStart[1] : $rangeEnd[1] - $yMax + $y; - - // build range for region - $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd; - - // retrieve relevant style array for region - $regionStyles = $pStyles; - unset($regionStyles['borders']['inside']); - - // what are the inner edges of the region when looking at the selection - $innerEdges = array_diff( array('top', 'right', 'bottom', 'left'), $edges ); - - // inner edges that are not touching the region should take the 'inside' border properties if they have been set - foreach ($innerEdges as $innerEdge) { - switch ($innerEdge) { - case 'top': - case 'bottom': - // should pick up 'horizontal' border property if set - if (isset($pStyles['borders']['horizontal'])) { - $regionStyles['borders'][$innerEdge] = $pStyles['borders']['horizontal']; - } else { - unset($regionStyles['borders'][$innerEdge]); - } - break; - case 'left': - case 'right': - // should pick up 'vertical' border property if set - if (isset($pStyles['borders']['vertical'])) { - $regionStyles['borders'][$innerEdge] = $pStyles['borders']['vertical']; - } else { - unset($regionStyles['borders'][$innerEdge]); - } - break; - } - } - - // apply region style to region by calling applyFromArray() in simple mode - $this->getActiveSheet()->getStyle($range)->applyFromArray($regionStyles, false); - } - } - return; - } - - // SIMPLE MODE: - - // Selection type, inspect - if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) { - $selectionType = 'COLUMN'; - } else if (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) { - $selectionType = 'ROW'; - } else { - $selectionType = 'CELL'; - } - - // First loop through columns, rows, or cells to find out which styles are affected by this operation - switch ($selectionType) { - case 'COLUMN': - $oldXfIndexes = array(); - for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { - $oldXfIndexes[$this->getActiveSheet()->getColumnDimensionByColumn($col)->getXfIndex()] = true; - } - break; - - case 'ROW': - $oldXfIndexes = array(); - for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - if ($this->getActiveSheet()->getRowDimension($row)->getXfIndex() == null) { - $oldXfIndexes[0] = true; // row without explicit style should be formatted based on default style - } else { - $oldXfIndexes[$this->getActiveSheet()->getRowDimension($row)->getXfIndex()] = true; - } - } - break; - - case 'CELL': - $oldXfIndexes = array(); - for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { - for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $oldXfIndexes[$this->getActiveSheet()->getCellByColumnAndRow($col, $row)->getXfIndex()] = true; - } - } - break; - } - - // clone each of the affected styles, apply the style arrray, and add the new styles to the workbook - $workbook = $this->getActiveSheet()->getParent(); - foreach ($oldXfIndexes as $oldXfIndex => $dummy) { - $style = $workbook->getCellXfByIndex($oldXfIndex); - $newStyle = clone $style; - $newStyle->applyFromArray($pStyles); - - if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) { - // there is already such cell Xf in our collection - $newXfIndexes[$oldXfIndex] = $existingStyle->getIndex(); - } else { - // we don't have such a cell Xf, need to add - $workbook->addCellXf($newStyle); - $newXfIndexes[$oldXfIndex] = $newStyle->getIndex(); - } - } - - // Loop through columns, rows, or cells again and update the XF index - switch ($selectionType) { - case 'COLUMN': - for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { - $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col); - $oldXfIndex = $columnDimension->getXfIndex(); - $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]); - } - break; - - case 'ROW': - for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $rowDimension = $this->getActiveSheet()->getRowDimension($row); - $oldXfIndex = $rowDimension->getXfIndex() === null ? - 0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style - $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]); - } - break; - - case 'CELL': - for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { - for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $cell = $this->getActiveSheet()->getCellByColumnAndRow($col, $row); - $oldXfIndex = $cell->getXfIndex(); - $cell->setXfIndex($newXfIndexes[$oldXfIndex]); - } - } - break; - } - - } else { - // not a supervisor, just apply the style array directly on style object - if (array_key_exists('fill', $pStyles)) { - $this->getFill()->applyFromArray($pStyles['fill']); - } - if (array_key_exists('font', $pStyles)) { - $this->getFont()->applyFromArray($pStyles['font']); - } - if (array_key_exists('borders', $pStyles)) { - $this->getBorders()->applyFromArray($pStyles['borders']); - } - if (array_key_exists('alignment', $pStyles)) { - $this->getAlignment()->applyFromArray($pStyles['alignment']); - } - if (array_key_exists('numberformat', $pStyles)) { - $this->getNumberFormat()->applyFromArray($pStyles['numberformat']); - } - if (array_key_exists('protection', $pStyles)) { - $this->getProtection()->applyFromArray($pStyles['protection']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Fill - * - * @return PHPExcel_Style_Fill - */ - public function getFill() { - return $this->_fill; - } - - /** - * Get Font - * - * @return PHPExcel_Style_Font - */ - public function getFont() { - return $this->_font; - } - - /** - * Set font - * - * @param PHPExcel_Style_Font $font - * @return PHPExcel_Style - */ - public function setFont(PHPExcel_Style_Font $font) - { - $this->_font = $font; - return $this; - } - - /** - * Get Borders - * - * @return PHPExcel_Style_Borders - */ - public function getBorders() { - return $this->_borders; - } - - /** - * Get Alignment - * - * @return PHPExcel_Style_Alignment - */ - public function getAlignment() { - return $this->_alignment; - } - - /** - * Get Number Format - * - * @return PHPExcel_Style_NumberFormat - */ - public function getNumberFormat() { - return $this->_numberFormat; - } - - /** - * Get Conditional Styles. Only used on supervisor. - * - * @return PHPExcel_Style_Conditional[] - */ - public function getConditionalStyles() { - return $this->getActiveSheet()->getConditionalStyles($this->getActiveCell()); - } - - /** - * Set Conditional Styles. Only used on supervisor. - * - * @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles - * @return PHPExcel_Style - */ - public function setConditionalStyles($pValue = null) { - if (is_array($pValue)) { - $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue); - } - return $this; - } - - /** - * Get Protection - * - * @return PHPExcel_Style_Protection - */ - public function getProtection() { - return $this->_protection; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - $hashConditionals = ''; - foreach ($this->_conditionalStyles as $conditional) { - $hashConditionals .= $conditional->getHashCode(); - } - - return md5( - $this->_fill->getHashCode() - . $this->_font->getHashCode() - . $this->_borders->getHashCode() - . $this->_alignment->getHashCode() - . $this->_numberFormat->getHashCode() - . $hashConditionals - . $this->_protection->getHashCode() - . __CLASS__ - ); - } - - /** - * Get own index in style collection - * - * @return int - */ - public function getIndex() - { - return $this->_index; - } - - /** - * Set own index in style collection - * - * @param int $pValue - */ - public function setIndex($pValue) - { - $this->_index = $pValue; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Alignment.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Alignment.php deleted file mode 100644 index a274ae0d18..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Alignment.php +++ /dev/null @@ -1,481 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Alignment - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Alignment implements PHPExcel_IComparable -{ - /* Horizontal alignment styles */ - const HORIZONTAL_GENERAL = 'general'; - const HORIZONTAL_LEFT = 'left'; - const HORIZONTAL_RIGHT = 'right'; - const HORIZONTAL_CENTER = 'center'; - const HORIZONTAL_CENTER_CONTINUOUS = 'centerContinuous'; - const HORIZONTAL_JUSTIFY = 'justify'; - - /* Vertical alignment styles */ - const VERTICAL_BOTTOM = 'bottom'; - const VERTICAL_TOP = 'top'; - const VERTICAL_CENTER = 'center'; - const VERTICAL_JUSTIFY = 'justify'; - - /** - * Horizontal - * - * @var string - */ - private $_horizontal = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; - - /** - * Vertical - * - * @var string - */ - private $_vertical = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; - - /** - * Text rotation - * - * @var int - */ - private $_textRotation = 0; - - /** - * Wrap text - * - * @var boolean - */ - private $_wrapText = false; - - /** - * Shrink to fit - * - * @var boolean - */ - private $_shrinkToFit = false; - - /** - * Indent - only possible with horizontal alignment left and right - * - * @var int - */ - private $_indent = 0; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_Alignment - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel $parent - * @return PHPExcel_Style_Alignment - */ - public function bindParent($parent) - { - $this->_parent = $parent; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Alignment - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getAlignment(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('alignment' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( - * array( - * 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER, - * 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER, - * 'rotation' => 0, - * 'wrap' => true - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Alignment - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('horizontal', $pStyles)) { - $this->setHorizontal($pStyles['horizontal']); - } - if (array_key_exists('vertical', $pStyles)) { - $this->setVertical($pStyles['vertical']); - } - if (array_key_exists('rotation', $pStyles)) { - $this->setTextRotation($pStyles['rotation']); - } - if (array_key_exists('wrap', $pStyles)) { - $this->setWrapText($pStyles['wrap']); - } - if (array_key_exists('shrinkToFit', $pStyles)) { - $this->setShrinkToFit($pStyles['shrinkToFit']); - } - if (array_key_exists('indent', $pStyles)) { - $this->setIndent($pStyles['indent']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Horizontal - * - * @return string - */ - public function getHorizontal() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHorizontal(); - } - return $this->_horizontal; - } - - /** - * Set Horizontal - * - * @param string $pValue - * @return PHPExcel_Style_Alignment - */ - public function setHorizontal($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL) { - if ($pValue == '') { - $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL; - } - - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('horizontal' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } - else { - $this->_horizontal = $pValue; - } - return $this; - } - - /** - * Get Vertical - * - * @return string - */ - public function getVertical() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getVertical(); - } - return $this->_vertical; - } - - /** - * Set Vertical - * - * @param string $pValue - * @return PHPExcel_Style_Alignment - */ - public function setVertical($pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM) { - if ($pValue == '') { - $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM; - } - - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('vertical' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_vertical = $pValue; - } - return $this; - } - - /** - * Get TextRotation - * - * @return int - */ - public function getTextRotation() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getTextRotation(); - } - return $this->_textRotation; - } - - /** - * Set TextRotation - * - * @param int $pValue - * @throws Exception - * @return PHPExcel_Style_Alignment - */ - public function setTextRotation($pValue = 0) { - // Excel2007 value 255 => PHPExcel value -165 - if ($pValue == 255) { - $pValue = -165; - } - - // Set rotation - if ( ($pValue >= -90 && $pValue <= 90) || $pValue == -165 ) { - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('rotation' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_textRotation = $pValue; - } - } else { - throw new Exception("Text rotation should be a value between -90 and 90."); - } - - return $this; - } - - /** - * Get Wrap Text - * - * @return boolean - */ - public function getWrapText() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getWrapText(); - } - return $this->_wrapText; - } - - /** - * Set Wrap Text - * - * @param boolean $pValue - * @return PHPExcel_Style_Alignment - */ - public function setWrapText($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('wrap' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_wrapText = $pValue; - } - return $this; - } - - /** - * Get Shrink to fit - * - * @return boolean - */ - public function getShrinkToFit() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getShrinkToFit(); - } - return $this->_shrinkToFit; - } - - /** - * Set Shrink to fit - * - * @param boolean $pValue - * @return PHPExcel_Style_Alignment - */ - public function setShrinkToFit($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('shrinkToFit' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_shrinkToFit = $pValue; - } - return $this; - } - - /** - * Get indent - * - * @return int - */ - public function getIndent() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getIndent(); - } - return $this->_indent; - } - - /** - * Set indent - * - * @param int $pValue - * @return PHPExcel_Style_Alignment - */ - public function setIndent($pValue = 0) { - if ($pValue > 0) { - if ($this->getHorizontal() != self::HORIZONTAL_GENERAL && $this->getHorizontal() != self::HORIZONTAL_LEFT && $this->getHorizontal() != self::HORIZONTAL_RIGHT) { - $pValue = 0; // indent not supported - } - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('indent' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_indent = $pValue; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_horizontal - . $this->_vertical - . $this->_textRotation - . ($this->_wrapText ? 't' : 'f') - . ($this->_shrinkToFit ? 't' : 'f') - . $this->_indent - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Border.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Border.php deleted file mode 100644 index c20de948a0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Border.php +++ /dev/null @@ -1,381 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Border - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Border implements PHPExcel_IComparable -{ - /* Border style */ - const BORDER_NONE = 'none'; - const BORDER_DASHDOT = 'dashDot'; - const BORDER_DASHDOTDOT = 'dashDotDot'; - const BORDER_DASHED = 'dashed'; - const BORDER_DOTTED = 'dotted'; - const BORDER_DOUBLE = 'double'; - const BORDER_HAIR = 'hair'; - const BORDER_MEDIUM = 'medium'; - const BORDER_MEDIUMDASHDOT = 'mediumDashDot'; - const BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'; - const BORDER_MEDIUMDASHED = 'mediumDashed'; - const BORDER_SLANTDASHDOT = 'slantDashDot'; - const BORDER_THICK = 'thick'; - const BORDER_THIN = 'thin'; - - /** - * Border style - * - * @var string - */ - private $_borderStyle = PHPExcel_Style_Border::BORDER_NONE; - - /** - * Border color - * - * @var PHPExcel_Style_Color - */ - private $_color; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style_Borders - */ - private $_parent; - - /** - * Parent property name - * - * @var string - */ - private $_parentPropertyName; - - /** - * Create a new PHPExcel_Style_Border - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); - - // bind parent if we are a supervisor - if ($isSupervisor) { - $this->_color->bindParent($this, '_color'); - } - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style_Borders $parent - * @param string $parentPropertyName - * @return PHPExcel_Style_Border - */ - public function bindParent($parent, $parentPropertyName) - { - $this->_parent = $parent; - $this->_parentPropertyName = $parentPropertyName; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Border - * @throws Exception - */ - public function getSharedComponent() - { - switch ($this->_parentPropertyName) { - case '_allBorders': - case '_horizontal': - case '_inside': - case '_outline': - case '_vertical': - throw new Exception('Cannot get shared component for a pseudo-border.'); - break; - - case '_bottom': - return $this->_parent->getSharedComponent()->getBottom(); - break; - - case '_diagonal': - return $this->_parent->getSharedComponent()->getDiagonal(); - break; - - case '_left': - return $this->_parent->getSharedComponent()->getLeft(); - break; - - case '_right': - return $this->_parent->getSharedComponent()->getRight(); - break; - - case '_top': - return $this->_parent->getSharedComponent()->getTop(); - break; - - } - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - switch ($this->_parentPropertyName) { - case '_allBorders': - $key = 'allborders'; - break; - - case '_bottom': - $key = 'bottom'; - break; - - case '_diagonal': - $key = 'diagonal'; - break; - - case '_horizontal': - $key = 'horizontal'; - break; - - case '_inside': - $key = 'inside'; - break; - - case '_left': - $key = 'left'; - break; - - case '_outline': - $key = 'outline'; - break; - - case '_right': - $key = 'right'; - break; - - case '_top': - $key = 'top'; - break; - - case '_vertical': - $key = 'vertical'; - break; - } - return $this->_parent->getStyleArray(array($key => $array)); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( - * array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Border - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('style', $pStyles)) { - $this->setBorderStyle($pStyles['style']); - } - if (array_key_exists('color', $pStyles)) { - $this->getColor()->applyFromArray($pStyles['color']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Border style - * - * @return string - */ - public function getBorderStyle() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getBorderStyle(); - } - return $this->_borderStyle; - } - - /** - * Set Border style - * - * @param string $pValue - * @return PHPExcel_Style_Border - */ - public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE) { - - if ($pValue == '') { - $pValue = PHPExcel_Style_Border::BORDER_NONE; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('style' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_borderStyle = $pValue; - } - return $this; - } - - /** - * Get Border Color - * - * @return PHPExcel_Style_Color - */ - public function getColor() { - return $this->_color; - } - - /** - * Set Border Color - * - * @param PHPExcel_Style_Color $pValue - * @throws Exception - * @return PHPExcel_Style_Border - */ - public function setColor(PHPExcel_Style_Color $pValue = null) { - // make sure parameter is a real color and not a supervisor - $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; - - if ($this->_isSupervisor) { - $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB())); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_color = $color; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_borderStyle - . $this->_color->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Borders.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Borders.php deleted file mode 100644 index 46c51b6d04..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Borders.php +++ /dev/null @@ -1,505 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Borders - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Borders implements PHPExcel_IComparable -{ - /* Diagonal directions */ - const DIAGONAL_NONE = 0; - const DIAGONAL_UP = 1; - const DIAGONAL_DOWN = 2; - const DIAGONAL_BOTH = 3; - - /** - * Left - * - * @var PHPExcel_Style_Border - */ - private $_left; - - /** - * Right - * - * @var PHPExcel_Style_Border - */ - private $_right; - - /** - * Top - * - * @var PHPExcel_Style_Border - */ - private $_top; - - /** - * Bottom - * - * @var PHPExcel_Style_Border - */ - private $_bottom; - - /** - * Diagonal - * - * @var PHPExcel_Style_Border - */ - private $_diagonal; - - /** - * DiagonalDirection - * - * @var int - */ - private $_diagonalDirection; - - /** - * All borders psedo-border. Only applies to supervisor. - * - * @var PHPExcel_Style_Border - */ - private $_allBorders; - - /** - * Outline psedo-border. Only applies to supervisor. - * - * @var PHPExcel_Style_Border - */ - private $_outline; - - /** - * Inside psedo-border. Only applies to supervisor. - * - * @var PHPExcel_Style_Border - */ - private $_inside; - - /** - * Vertical pseudo-border. Only applies to supervisor. - * - * @var PHPExcel_Style_Border - */ - private $_vertical; - - /** - * Horizontal pseudo-border. Only applies to supervisor. - * - * @var PHPExcel_Style_Border - */ - private $_horizontal; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_Borders - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_left = new PHPExcel_Style_Border($isSupervisor); - $this->_right = new PHPExcel_Style_Border($isSupervisor); - $this->_top = new PHPExcel_Style_Border($isSupervisor); - $this->_bottom = new PHPExcel_Style_Border($isSupervisor); - $this->_diagonal = new PHPExcel_Style_Border($isSupervisor); - $this->_diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE; - - // Specially for supervisor - if ($isSupervisor) { - // Initialize pseudo-borders - $this->_allBorders = new PHPExcel_Style_Border(true); - $this->_outline = new PHPExcel_Style_Border(true); - $this->_inside = new PHPExcel_Style_Border(true); - $this->_vertical = new PHPExcel_Style_Border(true); - $this->_horizontal = new PHPExcel_Style_Border(true); - - // bind parent if we are a supervisor - $this->_left->bindParent($this, '_left'); - $this->_right->bindParent($this, '_right'); - $this->_top->bindParent($this, '_top'); - $this->_bottom->bindParent($this, '_bottom'); - $this->_diagonal->bindParent($this, '_diagonal'); - $this->_allBorders->bindParent($this, '_allBorders'); - $this->_outline->bindParent($this, '_outline'); - $this->_inside->bindParent($this, '_inside'); - $this->_vertical->bindParent($this, '_vertical'); - $this->_horizontal->bindParent($this, '_horizontal'); - } - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style $parent - * @return PHPExcel_Style_Borders - */ - public function bindParent($parent) - { - $this->_parent = $parent; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Borders - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getBorders(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('borders' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( - * array( - * 'bottom' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ), - * 'top' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ) - * ) - * ); - * </code> - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( - * array( - * 'allborders' => array( - * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ) - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Borders - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('left', $pStyles)) { - $this->getLeft()->applyFromArray($pStyles['left']); - } - if (array_key_exists('right', $pStyles)) { - $this->getRight()->applyFromArray($pStyles['right']); - } - if (array_key_exists('top', $pStyles)) { - $this->getTop()->applyFromArray($pStyles['top']); - } - if (array_key_exists('bottom', $pStyles)) { - $this->getBottom()->applyFromArray($pStyles['bottom']); - } - if (array_key_exists('diagonal', $pStyles)) { - $this->getDiagonal()->applyFromArray($pStyles['diagonal']); - } - if (array_key_exists('diagonaldirection', $pStyles)) { - $this->setDiagonalDirection($pStyles['diagonaldirection']); - } - if (array_key_exists('allborders', $pStyles)) { - $this->getLeft()->applyFromArray($pStyles['allborders']); - $this->getRight()->applyFromArray($pStyles['allborders']); - $this->getTop()->applyFromArray($pStyles['allborders']); - $this->getBottom()->applyFromArray($pStyles['allborders']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Left - * - * @return PHPExcel_Style_Border - */ - public function getLeft() { - return $this->_left; - } - - /** - * Get Right - * - * @return PHPExcel_Style_Border - */ - public function getRight() { - return $this->_right; - } - - /** - * Get Top - * - * @return PHPExcel_Style_Border - */ - public function getTop() { - return $this->_top; - } - - /** - * Get Bottom - * - * @return PHPExcel_Style_Border - */ - public function getBottom() { - return $this->_bottom; - } - - /** - * Get Diagonal - * - * @return PHPExcel_Style_Border - */ - public function getDiagonal() { - return $this->_diagonal; - } - - /** - * Get AllBorders (pseudo-border). Only applies to supervisor. - * - * @return PHPExcel_Style_Border - * @throws Exception - */ - public function getAllBorders() { - if (!$this->_isSupervisor) { - throw new Exception('Can only get pseudo-border for supervisor.'); - } - return $this->_allBorders; - } - - /** - * Get Outline (pseudo-border). Only applies to supervisor. - * - * @return boolean - * @throws Exception - */ - public function getOutline() { - if (!$this->_isSupervisor) { - throw new Exception('Can only get pseudo-border for supervisor.'); - } - return $this->_outline; - } - - /** - * Get Inside (pseudo-border). Only applies to supervisor. - * - * @return boolean - * @throws Exception - */ - public function getInside() { - if (!$this->_isSupervisor) { - throw new Exception('Can only get pseudo-border for supervisor.'); - } - return $this->_inside; - } - - /** - * Get Vertical (pseudo-border). Only applies to supervisor. - * - * @return PHPExcel_Style_Border - * @throws Exception - */ - public function getVertical() { - if (!$this->_isSupervisor) { - throw new Exception('Can only get pseudo-border for supervisor.'); - } - return $this->_vertical; - } - - /** - * Get Horizontal (pseudo-border). Only applies to supervisor. - * - * @return PHPExcel_Style_Border - * @throws Exception - */ - public function getHorizontal() { - if (!$this->_isSupervisor) { - throw new Exception('Can only get pseudo-border for supervisor.'); - } - return $this->_horizontal; - } - - /** - * Get DiagonalDirection - * - * @return int - */ - public function getDiagonalDirection() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getDiagonalDirection(); - } - return $this->_diagonalDirection; - } - - /** - * Set DiagonalDirection - * - * @param int $pValue - * @return PHPExcel_Style_Borders - */ - public function setDiagonalDirection($pValue = PHPExcel_Style_Borders::DIAGONAL_NONE) { - if ($pValue == '') { - $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_diagonalDirection = $pValue; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashcode(); - } - return md5( - $this->getLeft()->getHashCode() - . $this->getRight()->getHashCode() - . $this->getTop()->getHashCode() - . $this->getBottom()->getHashCode() - . $this->getDiagonal()->getHashCode() - . $this->getDiagonalDirection() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Color.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Color.php deleted file mode 100644 index b36e69c0e8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Color.php +++ /dev/null @@ -1,476 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Color - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Color implements PHPExcel_IComparable -{ - /* Colors */ - const COLOR_BLACK = 'FF000000'; - const COLOR_WHITE = 'FFFFFFFF'; - const COLOR_RED = 'FFFF0000'; - const COLOR_DARKRED = 'FF800000'; - const COLOR_BLUE = 'FF0000FF'; - const COLOR_DARKBLUE = 'FF000080'; - const COLOR_GREEN = 'FF00FF00'; - const COLOR_DARKGREEN = 'FF008000'; - const COLOR_YELLOW = 'FFFFFF00'; - const COLOR_DARKYELLOW = 'FF808000'; - - /** - * Indexed colors array - * - * @var array - */ - private static $_indexedColors; - - /** - * ARGB - Alpha RGB - * - * @var string - */ - private $_argb; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var mixed - */ - private $_parent; - - /** - * Parent property name - * - * @var string - */ - private $_parentPropertyName; - - /** - * Create a new PHPExcel_Style_Color - * - * @param string $pARGB - */ - public function __construct($pARGB = PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_argb = $pARGB; - } - - /** - * Bind parent. Only used for supervisor - * - * @param mixed $parent - * @param string $parentPropertyName - * @return PHPExcel_Style_Color - */ - public function bindParent($parent, $parentPropertyName) - { - $this->_parent = $parent; - $this->_parentPropertyName = $parentPropertyName; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Color - */ - public function getSharedComponent() - { - switch ($this->_parentPropertyName) { - case '_endColor': - return $this->_parent->getSharedComponent()->getEndColor(); - break; - - case '_color': - return $this->_parent->getSharedComponent()->getColor(); - break; - - case '_startColor': - return $this->_parent->getSharedComponent()->getStartColor(); - break; - } - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - switch ($this->_parentPropertyName) { - case '_endColor': - $key = 'endcolor'; - break; - - case '_color': - $key = 'color'; - break; - - case '_startColor': - $key = 'startcolor'; - break; - - } - return $this->_parent->getStyleArray(array($key => $array)); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Color - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('rgb', $pStyles)) { - $this->setRGB($pStyles['rgb']); - } - if (array_key_exists('argb', $pStyles)) { - $this->setARGB($pStyles['argb']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get ARGB - * - * @return string - */ - public function getARGB() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getARGB(); - } - return $this->_argb; - } - - /** - * Set ARGB - * - * @param string $pValue - * @return PHPExcel_Style_Color - */ - public function setARGB($pValue = PHPExcel_Style_Color::COLOR_BLACK) { - if ($pValue == '') { - $pValue = PHPExcel_Style_Color::COLOR_BLACK; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('argb' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_argb = $pValue; - } - return $this; - } - - /** - * Get RGB - * - * @return string - */ - public function getRGB() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getRGB(); - } - return substr($this->_argb, 2); - } - - /** - * Set RGB - * - * @param string $pValue - * @return PHPExcel_Style_Color - */ - public function setRGB($pValue = '000000') { - if ($pValue == '') { - $pValue = '000000'; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('argb' => 'FF' . $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_argb = 'FF' . $pValue; - } - return $this; - } - - private static function _getColourComponent($RGB,$offset,$hex=true) { - $colour = substr($RGB,$offset,2); - if (!$hex) - $colour = hexdec($colour); - return $colour; - } - - public static function getRed($RGB,$hex=true) { - if (strlen($RGB) == 8) { - return self::_getColourComponent($RGB,2,$hex); - } elseif (strlen($RGB) == 6) { - return self::_getColourComponent($RGB,0,$hex); - } - } - - public static function getGreen($RGB,$hex=true) { - if (strlen($RGB) == 8) { - return self::_getColourComponent($RGB,4,$hex); - } elseif (strlen($RGB) == 6) { - return self::_getColourComponent($RGB,2,$hex); - } - } - - public static function getBlue($RGB,$hex=true) { - if (strlen($RGB) == 8) { - return self::_getColourComponent($RGB,6,$hex); - } elseif (strlen($RGB) == 6) { - return self::_getColourComponent($RGB,4,$hex); - } - } - - /** - * Adjust the brightness of a color - * - * @param string $hex The colour as an RGB value (e.g. FF00CCCC or CCDDEE - * @param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1 - * @return string The adjusted colour as an RGB value (e.g. FF00CCCC or CCDDEE - */ - public static function changeBrightness($hex, $adjustPercentage) { - $red = self::getRed($hex,false); - $green = self::getGreen($hex,false); - $blue = self::getBlue($hex,false); - if ($adjustPercentage > 0) { - $red += (255 - $red) * $adjustPercentage; - $green += (255 - $green) * $adjustPercentage; - $blue += (255 - $blue) * $adjustPercentage; - } else { - $red += $red * $adjustPercentage; - $green += $green * $adjustPercentage; - $blue += $blue * $adjustPercentage; - } - - if ($red < 0) $red = 0; - elseif ($red > 255) $red = 255; - if ($green < 0) $green = 0; - elseif ($green > 255) $green = 255; - if ($blue < 0) $blue = 0; - elseif ($blue > 255) $blue = 255; - - return strtoupper( str_pad(dechex($red), 2, '0', 0) . - str_pad(dechex($green), 2, '0', 0) . - str_pad(dechex($blue), 2, '0', 0) - ); - } - - /** - * Get indexed color - * - * @param int $pIndex - * @return PHPExcel_Style_Color - */ - public static function indexedColor($pIndex, $background=false) { - // Clean parameter - $pIndex = intval($pIndex); - - // Indexed colors - if (is_null(self::$_indexedColors)) { - self::$_indexedColors = array(); - self::$_indexedColors[] = '00000000'; - self::$_indexedColors[] = '00FFFFFF'; - self::$_indexedColors[] = '00FF0000'; - self::$_indexedColors[] = '0000FF00'; - self::$_indexedColors[] = '000000FF'; - self::$_indexedColors[] = '00FFFF00'; - self::$_indexedColors[] = '00FF00FF'; - self::$_indexedColors[] = '0000FFFF'; - self::$_indexedColors[] = '00000000'; - self::$_indexedColors[] = '00FFFFFF'; - self::$_indexedColors[] = '00FF0000'; - self::$_indexedColors[] = '0000FF00'; - self::$_indexedColors[] = '000000FF'; - self::$_indexedColors[] = '00FFFF00'; - self::$_indexedColors[] = '00FF00FF'; - self::$_indexedColors[] = '0000FFFF'; - self::$_indexedColors[] = '00800000'; - self::$_indexedColors[] = '00008000'; - self::$_indexedColors[] = '00000080'; - self::$_indexedColors[] = '00808000'; - self::$_indexedColors[] = '00800080'; - self::$_indexedColors[] = '00008080'; - self::$_indexedColors[] = '00C0C0C0'; - self::$_indexedColors[] = '00808080'; - self::$_indexedColors[] = '009999FF'; - self::$_indexedColors[] = '00993366'; - self::$_indexedColors[] = '00FFFFCC'; - self::$_indexedColors[] = '00CCFFFF'; - self::$_indexedColors[] = '00660066'; - self::$_indexedColors[] = '00FF8080'; - self::$_indexedColors[] = '000066CC'; - self::$_indexedColors[] = '00CCCCFF'; - self::$_indexedColors[] = '00000080'; - self::$_indexedColors[] = '00FF00FF'; - self::$_indexedColors[] = '00FFFF00'; - self::$_indexedColors[] = '0000FFFF'; - self::$_indexedColors[] = '00800080'; - self::$_indexedColors[] = '00800000'; - self::$_indexedColors[] = '00008080'; - self::$_indexedColors[] = '000000FF'; - self::$_indexedColors[] = '0000CCFF'; - self::$_indexedColors[] = '00CCFFFF'; - self::$_indexedColors[] = '00CCFFCC'; - self::$_indexedColors[] = '00FFFF99'; - self::$_indexedColors[] = '0099CCFF'; - self::$_indexedColors[] = '00FF99CC'; - self::$_indexedColors[] = '00CC99FF'; - self::$_indexedColors[] = '00FFCC99'; - self::$_indexedColors[] = '003366FF'; - self::$_indexedColors[] = '0033CCCC'; - self::$_indexedColors[] = '0099CC00'; - self::$_indexedColors[] = '00FFCC00'; - self::$_indexedColors[] = '00FF9900'; - self::$_indexedColors[] = '00FF6600'; - self::$_indexedColors[] = '00666699'; - self::$_indexedColors[] = '00969696'; - self::$_indexedColors[] = '00003366'; - self::$_indexedColors[] = '00339966'; - self::$_indexedColors[] = '00003300'; - self::$_indexedColors[] = '00333300'; - self::$_indexedColors[] = '00993300'; - self::$_indexedColors[] = '00993366'; - self::$_indexedColors[] = '00333399'; - self::$_indexedColors[] = '00333333'; - } - - if (array_key_exists($pIndex, self::$_indexedColors)) { - return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]); - } - - if ($background) { - return new PHPExcel_Style_Color('FFFFFFFF'); - } - return new PHPExcel_Style_Color('FF000000'); - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_argb - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Conditional.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Conditional.php deleted file mode 100644 index fbdb62368a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Conditional.php +++ /dev/null @@ -1,277 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Conditional - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Conditional implements PHPExcel_IComparable -{ - /* Condition types */ - const CONDITION_NONE = 'none'; - const CONDITION_CELLIS = 'cellIs'; - const CONDITION_CONTAINSTEXT = 'containsText'; - const CONDITION_EXPRESSION = 'expression'; - - /* Operator types */ - const OPERATOR_NONE = ''; - const OPERATOR_BEGINSWITH = 'beginsWith'; - const OPERATOR_ENDSWITH = 'endsWith'; - const OPERATOR_EQUAL = 'equal'; - const OPERATOR_GREATERTHAN = 'greaterThan'; - const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual'; - const OPERATOR_LESSTHAN = 'lessThan'; - const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual'; - const OPERATOR_NOTEQUAL = 'notEqual'; - const OPERATOR_CONTAINSTEXT = 'containsText'; - const OPERATOR_NOTCONTAINS = 'notContains'; - const OPERATOR_BETWEEN = 'between'; - - /** - * Condition type - * - * @var int - */ - private $_conditionType; - - /** - * Operator type - * - * @var int - */ - private $_operatorType; - - /** - * Text - * - * @var string - */ - private $_text; - - /** - * Condition - * - * @var string[] - */ - private $_condition = array(); - - /** - * Style - * - * @var PHPExcel_Style - */ - private $_style; - - /** - * Create a new PHPExcel_Style_Conditional - */ - public function __construct() - { - // Initialise values - $this->_conditionType = PHPExcel_Style_Conditional::CONDITION_NONE; - $this->_operatorType = PHPExcel_Style_Conditional::OPERATOR_NONE; - $this->_text = null; - $this->_condition = array(); - $this->_style = new PHPExcel_Style(); - } - - /** - * Get Condition type - * - * @return string - */ - public function getConditionType() { - return $this->_conditionType; - } - - /** - * Set Condition type - * - * @param string $pValue PHPExcel_Style_Conditional condition type - * @return PHPExcel_Style_Conditional - */ - public function setConditionType($pValue = PHPExcel_Style_Conditional::CONDITION_NONE) { - $this->_conditionType = $pValue; - return $this; - } - - /** - * Get Operator type - * - * @return string - */ - public function getOperatorType() { - return $this->_operatorType; - } - - /** - * Set Operator type - * - * @param string $pValue PHPExcel_Style_Conditional operator type - * @return PHPExcel_Style_Conditional - */ - public function setOperatorType($pValue = PHPExcel_Style_Conditional::OPERATOR_NONE) { - $this->_operatorType = $pValue; - return $this; - } - - /** - * Get text - * - * @return string - */ - public function getText() { - return $this->_text; - } - - /** - * Set text - * - * @param string $value - * @return PHPExcel_Style_Conditional - */ - public function setText($value = null) { - $this->_text = $value; - return $this; - } - - /** - * Get Condition - * - * @deprecated Deprecated, use getConditions instead - * @return string - */ - public function getCondition() { - if (isset($this->_condition[0])) { - return $this->_condition[0]; - } - - return ''; - } - - /** - * Set Condition - * - * @deprecated Deprecated, use setConditions instead - * @param string $pValue Condition - * @return PHPExcel_Style_Conditional - */ - public function setCondition($pValue = '') { - if (!is_array($pValue)) - $pValue = array($pValue); - - return $this->setConditions($pValue); - } - - /** - * Get Conditions - * - * @return string[] - */ - public function getConditions() { - return $this->_condition; - } - - /** - * Set Conditions - * - * @param string[] $pValue Condition - * @return PHPExcel_Style_Conditional - */ - public function setConditions($pValue) { - if (!is_array($pValue)) - $pValue = array($pValue); - - $this->_condition = $pValue; - return $this; - } - - /** - * Add Condition - * - * @param string $pValue Condition - * @return PHPExcel_Style_Conditional - */ - public function addCondition($pValue = '') { - $this->_condition[] = $pValue; - return $this; - } - - /** - * Get Style - * - * @return PHPExcel_Style - */ - public function getStyle() { - return $this->_style; - } - - /** - * Set Style - * - * @param PHPExcel_Style $pValue - * @throws Exception - * @return PHPExcel_Style_Conditional - */ - public function setStyle(PHPExcel_Style $pValue = null) { - $this->_style = $pValue; - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_conditionType - . $this->_operatorType - . implode(';', $this->_condition) - . $this->_style->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Fill.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Fill.php deleted file mode 100644 index b9b1e63ade..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Fill.php +++ /dev/null @@ -1,399 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Fill - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Fill implements PHPExcel_IComparable -{ - /* Fill types */ - const FILL_NONE = 'none'; - const FILL_SOLID = 'solid'; - const FILL_GRADIENT_LINEAR = 'linear'; - const FILL_GRADIENT_PATH = 'path'; - const FILL_PATTERN_DARKDOWN = 'darkDown'; - const FILL_PATTERN_DARKGRAY = 'darkGray'; - const FILL_PATTERN_DARKGRID = 'darkGrid'; - const FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal'; - const FILL_PATTERN_DARKTRELLIS = 'darkTrellis'; - const FILL_PATTERN_DARKUP = 'darkUp'; - const FILL_PATTERN_DARKVERTICAL = 'darkVertical'; - const FILL_PATTERN_GRAY0625 = 'gray0625'; - const FILL_PATTERN_GRAY125 = 'gray125'; - const FILL_PATTERN_LIGHTDOWN = 'lightDown'; - const FILL_PATTERN_LIGHTGRAY = 'lightGray'; - const FILL_PATTERN_LIGHTGRID = 'lightGrid'; - const FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal'; - const FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis'; - const FILL_PATTERN_LIGHTUP = 'lightUp'; - const FILL_PATTERN_LIGHTVERTICAL = 'lightVertical'; - const FILL_PATTERN_MEDIUMGRAY = 'mediumGray'; - - /** - * Fill type - * - * @var string - */ - private $_fillType = PHPExcel_Style_Fill::FILL_NONE; - - /** - * Rotation - * - * @var double - */ - private $_rotation = 0; - - /** - * Start color - * - * @var PHPExcel_Style_Color - */ - private $_startColor; - - /** - * End color - * - * @var PHPExcel_Style_Color - */ - private $_endColor; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_Fill - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor); - $this->_endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); - - // bind parent if we are a supervisor - if ($isSupervisor) { - $this->_startColor->bindParent($this, '_startColor'); - $this->_endColor->bindParent($this, '_endColor'); - } - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style $parent - * @return PHPExcel_Style_Fill - */ - public function bindParent($parent) - { - $this->_parent = $parent; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Fill - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getFill(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('fill' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( - * array( - * 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, - * 'rotation' => 0, - * 'startcolor' => array( - * 'rgb' => '000000' - * ), - * 'endcolor' => array( - * 'argb' => 'FFFFFFFF' - * ) - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Fill - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('type', $pStyles)) { - $this->setFillType($pStyles['type']); - } - if (array_key_exists('rotation', $pStyles)) { - $this->setRotation($pStyles['rotation']); - } - if (array_key_exists('startcolor', $pStyles)) { - $this->getStartColor()->applyFromArray($pStyles['startcolor']); - } - if (array_key_exists('endcolor', $pStyles)) { - $this->getEndColor()->applyFromArray($pStyles['endcolor']); - } - if (array_key_exists('color', $pStyles)) { - $this->getStartColor()->applyFromArray($pStyles['color']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Fill Type - * - * @return string - */ - public function getFillType() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getFillType(); - } - return $this->_fillType; - } - - /** - * Set Fill Type - * - * @param string $pValue PHPExcel_Style_Fill fill type - * @return PHPExcel_Style_Fill - */ - public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE) { - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('type' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_fillType = $pValue; - } - return $this; - } - - /** - * Get Rotation - * - * @return double - */ - public function getRotation() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getRotation(); - } - return $this->_rotation; - } - - /** - * Set Rotation - * - * @param double $pValue - * @return PHPExcel_Style_Fill - */ - public function setRotation($pValue = 0) { - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('rotation' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_rotation = $pValue; - } - return $this; - } - - /** - * Get Start Color - * - * @return PHPExcel_Style_Color - */ - public function getStartColor() { - return $this->_startColor; - } - - /** - * Set Start Color - * - * @param PHPExcel_Style_Color $pValue - * @throws Exception - * @return PHPExcel_Style_Fill - */ - public function setStartColor(PHPExcel_Style_Color $pValue = null) { - // make sure parameter is a real color and not a supervisor - $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; - - if ($this->_isSupervisor) { - $styleArray = $this->getStartColor()->getStyleArray(array('argb' => $color->getARGB())); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_startColor = $color; - } - return $this; - } - - /** - * Get End Color - * - * @return PHPExcel_Style_Color - */ - public function getEndColor() { - return $this->_endColor; - } - - /** - * Set End Color - * - * @param PHPExcel_Style_Color $pValue - * @throws Exception - * @return PHPExcel_Style_Fill - */ - public function setEndColor(PHPExcel_Style_Color $pValue = null) { - // make sure parameter is a real color and not a supervisor - $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; - - if ($this->_isSupervisor) { - $styleArray = $this->getEndColor()->getStyleArray(array('argb' => $color->getARGB())); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_endColor = $color; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->getFillType() - . $this->getRotation() - . $this->getStartColor()->getHashCode() - . $this->getEndColor()->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Font.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Font.php deleted file mode 100644 index 869244402f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Font.php +++ /dev/null @@ -1,618 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_Font - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Font implements PHPExcel_IComparable -{ - /* Underline types */ - const UNDERLINE_NONE = 'none'; - const UNDERLINE_DOUBLE = 'double'; - const UNDERLINE_DOUBLEACCOUNTING = 'doubleAccounting'; - const UNDERLINE_SINGLE = 'single'; - const UNDERLINE_SINGLEACCOUNTING = 'singleAccounting'; - - /** - * Font Name - * - * @var string - */ - private $_name = 'Calibri'; - - /** - * Font Size - * - * @var float - */ - private $_size = 11; - - /** - * Bold - * - * @var boolean - */ - private $_bold = false; - - /** - * Italic - * - * @var boolean - */ - private $_italic = false; - - /** - * Superscript - * - * @var boolean - */ - private $_superScript = false; - - /** - * Subscript - * - * @var boolean - */ - private $_subScript = false; - - /** - * Underline - * - * @var string - */ - private $_underline = PHPExcel_Style_Font::UNDERLINE_NONE; - - /** - * Strikethrough - * - * @var boolean - */ - private $_strikethrough = false; - - /** - * Foreground color - * - * @var PHPExcel_Style_Color - */ - private $_color; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_Font - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor); - - // bind parent if we are a supervisor - if ($isSupervisor) { - $this->_color->bindParent($this, '_color'); - } - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style $parent - * @return PHPExcel_Style_Font - */ - public function bindParent($parent) - { - $this->_parent = $parent; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Font - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getFont(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('font' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray( - * array( - * 'name' => 'Arial', - * 'bold' => true, - * 'italic' => false, - * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, - * 'strike' => false, - * 'color' => array( - * 'rgb' => '808080' - * ) - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Font - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('name', $pStyles)) { - $this->setName($pStyles['name']); - } - if (array_key_exists('bold', $pStyles)) { - $this->setBold($pStyles['bold']); - } - if (array_key_exists('italic', $pStyles)) { - $this->setItalic($pStyles['italic']); - } - if (array_key_exists('superScript', $pStyles)) { - $this->setSuperScript($pStyles['superScript']); - } - if (array_key_exists('subScript', $pStyles)) { - $this->setSubScript($pStyles['subScript']); - } - if (array_key_exists('underline', $pStyles)) { - $this->setUnderline($pStyles['underline']); - } - if (array_key_exists('strike', $pStyles)) { - $this->setStrikethrough($pStyles['strike']); - } - if (array_key_exists('color', $pStyles)) { - $this->getColor()->applyFromArray($pStyles['color']); - } - if (array_key_exists('size', $pStyles)) { - $this->setSize($pStyles['size']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Name - * - * @return string - */ - public function getName() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getName(); - } - return $this->_name; - } - - /** - * Set Name - * - * @param string $pValue - * @return PHPExcel_Style_Font - */ - public function setName($pValue = 'Calibri') { - if ($pValue == '') { - $pValue = 'Calibri'; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('name' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_name = $pValue; - } - return $this; - } - - /** - * Get Size - * - * @return double - */ - public function getSize() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getSize(); - } - return $this->_size; - } - - /** - * Set Size - * - * @param double $pValue - * @return PHPExcel_Style_Font - */ - public function setSize($pValue = 10) { - if ($pValue == '') { - $pValue = 10; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('size' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_size = $pValue; - } - return $this; - } - - /** - * Get Bold - * - * @return boolean - */ - public function getBold() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getBold(); - } - return $this->_bold; - } - - /** - * Set Bold - * - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setBold($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('bold' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_bold = $pValue; - } - return $this; - } - - /** - * Get Italic - * - * @return boolean - */ - public function getItalic() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getItalic(); - } - return $this->_italic; - } - - /** - * Set Italic - * - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setItalic($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('italic' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_italic = $pValue; - } - return $this; - } - - /** - * Get SuperScript - * - * @return boolean - */ - public function getSuperScript() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getSuperScript(); - } - return $this->_superScript; - } - - /** - * Set SuperScript - * - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setSuperScript($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('superScript' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_superScript = $pValue; - $this->_subScript = !$pValue; - } - return $this; - } - - /** - * Get SubScript - * - * @return boolean - */ - public function getSubScript() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getSubScript(); - } - return $this->_subScript; - } - - /** - * Set SubScript - * - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setSubScript($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('subScript' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_subScript = $pValue; - $this->_superScript = !$pValue; - } - return $this; - } - - /** - * Get Underline - * - * @return string - */ - public function getUnderline() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getUnderline(); - } - return $this->_underline; - } - - /** - * Set Underline - * - * @param string $pValue PHPExcel_Style_Font underline type - * @return PHPExcel_Style_Font - */ - public function setUnderline($pValue = PHPExcel_Style_Font::UNDERLINE_NONE) { - if ($pValue == '') { - $pValue = PHPExcel_Style_Font::UNDERLINE_NONE; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('underline' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_underline = $pValue; - } - return $this; - } - - /** - * Get Striketrough - * - * @deprecated Use getStrikethrough() instead. - * @return boolean - */ - public function getStriketrough() { - return $this->getStrikethrough(); - } - - /** - * Set Striketrough - * - * @deprecated Use setStrikethrough() instead. - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setStriketrough($pValue = false) { - return $this->setStrikethrough($pValue); - } - - /** - * Get Strikethrough - * - * @return boolean - */ - public function getStrikethrough() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getStrikethrough(); - } - return $this->_strikethrough; - } - - /** - * Set Strikethrough - * - * @param boolean $pValue - * @return PHPExcel_Style_Font - */ - public function setStrikethrough($pValue = false) { - if ($pValue == '') { - $pValue = false; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('strike' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_strikethrough = $pValue; - } - return $this; - } - - /** - * Get Color - * - * @return PHPExcel_Style_Color - */ - public function getColor() { - return $this->_color; - } - - /** - * Set Color - * - * @param PHPExcel_Style_Color $pValue - * @throws Exception - * @return PHPExcel_Style_Font - */ - public function setColor(PHPExcel_Style_Color $pValue = null) { - // make sure parameter is a real color and not a supervisor - $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; - - if ($this->_isSupervisor) { - $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB())); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_color = $color; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_name - . $this->_size - . ($this->_bold ? 't' : 'f') - . ($this->_italic ? 't' : 'f') - . ($this->_superScript ? 't' : 'f') - . ($this->_subScript ? 't' : 'f') - . $this->_underline - . ($this->_strikethrough ? 't' : 'f') - . $this->_color->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/NumberFormat.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/NumberFormat.php deleted file mode 100644 index 73fe396220..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/NumberFormat.php +++ /dev/null @@ -1,714 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Style_NumberFormat - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_NumberFormat implements PHPExcel_IComparable -{ - /* Pre-defined formats */ - const FORMAT_GENERAL = 'General'; - - const FORMAT_TEXT = '@'; - - const FORMAT_NUMBER = '0'; - const FORMAT_NUMBER_00 = '0.00'; - const FORMAT_NUMBER_COMMA_SEPARATED1 = '#,##0.00'; - const FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-'; - - const FORMAT_PERCENTAGE = '0%'; - const FORMAT_PERCENTAGE_00 = '0.00%'; - - const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd'; - const FORMAT_DATE_YYYYMMDD = 'yy-mm-dd'; - const FORMAT_DATE_DDMMYYYY = 'dd/mm/yy'; - const FORMAT_DATE_DMYSLASH = 'd/m/y'; - const FORMAT_DATE_DMYMINUS = 'd-m-y'; - const FORMAT_DATE_DMMINUS = 'd-m'; - const FORMAT_DATE_MYMINUS = 'm-y'; - const FORMAT_DATE_XLSX14 = 'mm-dd-yy'; - const FORMAT_DATE_XLSX15 = 'd-mmm-yy'; - const FORMAT_DATE_XLSX16 = 'd-mmm'; - const FORMAT_DATE_XLSX17 = 'mmm-yy'; - const FORMAT_DATE_XLSX22 = 'm/d/yy h:mm'; - const FORMAT_DATE_DATETIME = 'd/m/y h:mm'; - const FORMAT_DATE_TIME1 = 'h:mm AM/PM'; - const FORMAT_DATE_TIME2 = 'h:mm:ss AM/PM'; - const FORMAT_DATE_TIME3 = 'h:mm'; - const FORMAT_DATE_TIME4 = 'h:mm:ss'; - const FORMAT_DATE_TIME5 = 'mm:ss'; - const FORMAT_DATE_TIME6 = 'h:mm:ss'; - const FORMAT_DATE_TIME7 = 'i:s.S'; - const FORMAT_DATE_TIME8 = 'h:mm:ss;@'; - const FORMAT_DATE_YYYYMMDDSLASH = 'yy/mm/dd;@'; - - const FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-'; - const FORMAT_CURRENCY_USD = '$#,##0_-'; - const FORMAT_CURRENCY_EUR_SIMPLE = '[$EUR ]#,##0.00_-'; - - /** - * Excel built-in number formats - * - * @var array - */ - private static $_builtInFormats; - - /** - * Excel built-in number formats (flipped, for faster lookups) - * - * @var array - */ - private static $_flippedBuiltInFormats; - - /** - * Format Code - * - * @var string - */ - private $_formatCode = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; - - /** - * Built-in format Code - * - * @var string - */ - private $_builtInFormatCode = 0; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_NumberFormat - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style $parent - * @return PHPExcel_Style_NumberFormat - */ - public function bindParent($parent) - { - $this->_parent = $parent; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_NumberFormat - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getNumberFormat(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('numberformat' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( - * array( - * 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE - * ) - * ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_NumberFormat - */ - public function applyFromArray($pStyles = null) - { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('code', $pStyles)) { - $this->setFormatCode($pStyles['code']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get Format Code - * - * @return string - */ - public function getFormatCode() - { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getFormatCode(); - } - if ($this->_builtInFormatCode !== false) - { - return self::builtInFormatCode($this->_builtInFormatCode); - } - return $this->_formatCode; - } - - /** - * Set Format Code - * - * @param string $pValue - * @return PHPExcel_Style_NumberFormat - */ - public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL) - { - if ($pValue == '') { - $pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; - } - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('code' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_formatCode = $pValue; - $this->_builtInFormatCode = self::builtInFormatCodeIndex($pValue); - } - return $this; - } - - /** - * Get Built-In Format Code - * - * @return int - */ - public function getBuiltInFormatCode() - { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getBuiltInFormatCode(); - } - return $this->_builtInFormatCode; - } - - /** - * Set Built-In Format Code - * - * @param int $pValue - * @return PHPExcel_Style_NumberFormat - */ - public function setBuiltInFormatCode($pValue = 0) - { - - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('code' => self::builtInFormatCode($pValue))); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_builtInFormatCode = $pValue; - $this->_formatCode = self::builtInFormatCode($pValue); - } - return $this; - } - - /** - * Fill built-in format codes - */ - private static function fillBuiltInFormatCodes() - { - // Built-in format codes - if (is_null(self::$_builtInFormats)) { - self::$_builtInFormats = array(); - - // General - self::$_builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL; - self::$_builtInFormats[1] = '0'; - self::$_builtInFormats[2] = '0.00'; - self::$_builtInFormats[3] = '#,##0'; - self::$_builtInFormats[4] = '#,##0.00'; - - self::$_builtInFormats[9] = '0%'; - self::$_builtInFormats[10] = '0.00%'; - self::$_builtInFormats[11] = '0.00E+00'; - self::$_builtInFormats[12] = '# ?/?'; - self::$_builtInFormats[13] = '# ??/??'; - self::$_builtInFormats[14] = 'mm-dd-yy'; - self::$_builtInFormats[15] = 'd-mmm-yy'; - self::$_builtInFormats[16] = 'd-mmm'; - self::$_builtInFormats[17] = 'mmm-yy'; - self::$_builtInFormats[18] = 'h:mm AM/PM'; - self::$_builtInFormats[19] = 'h:mm:ss AM/PM'; - self::$_builtInFormats[20] = 'h:mm'; - self::$_builtInFormats[21] = 'h:mm:ss'; - self::$_builtInFormats[22] = 'm/d/yy h:mm'; - - self::$_builtInFormats[37] = '#,##0 ;(#,##0)'; - self::$_builtInFormats[38] = '#,##0 ;[Red](#,##0)'; - self::$_builtInFormats[39] = '#,##0.00;(#,##0.00)'; - self::$_builtInFormats[40] = '#,##0.00;[Red](#,##0.00)'; - - self::$_builtInFormats[44] = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)'; - self::$_builtInFormats[45] = 'mm:ss'; - self::$_builtInFormats[46] = '[h]:mm:ss'; - self::$_builtInFormats[47] = 'mmss.0'; - self::$_builtInFormats[48] = '##0.0E+0'; - self::$_builtInFormats[49] = '@'; - - // CHT - self::$_builtInFormats[27] = '[$-404]e/m/d'; - self::$_builtInFormats[30] = 'm/d/yy'; - self::$_builtInFormats[36] = '[$-404]e/m/d'; - self::$_builtInFormats[50] = '[$-404]e/m/d'; - self::$_builtInFormats[57] = '[$-404]e/m/d'; - - // THA - self::$_builtInFormats[59] = 't0'; - self::$_builtInFormats[60] = 't0.00'; - self::$_builtInFormats[61] = 't#,##0'; - self::$_builtInFormats[62] = 't#,##0.00'; - self::$_builtInFormats[67] = 't0%'; - self::$_builtInFormats[68] = 't0.00%'; - self::$_builtInFormats[69] = 't# ?/?'; - self::$_builtInFormats[70] = 't# ??/??'; - - // Flip array (for faster lookups) - self::$_flippedBuiltInFormats = array_flip(self::$_builtInFormats); - } - } - - /** - * Get built-in format code - * - * @param int $pIndex - * @return string - */ - public static function builtInFormatCode($pIndex) - { - // Clean parameter - $pIndex = intval($pIndex); - - // Ensure built-in format codes are available - self::fillBuiltInFormatCodes(); - - // Lookup format code - if (isset(self::$_builtInFormats[$pIndex])) { - return self::$_builtInFormats[$pIndex]; - } - - return ''; - } - - /** - * Get built-in format code index - * - * @param string $formatCode - * @return int|boolean - */ - public static function builtInFormatCodeIndex($formatCode) - { - // Ensure built-in format codes are available - self::fillBuiltInFormatCodes(); - - // Lookup format code - if (isset(self::$_flippedBuiltInFormats[$formatCode])) { - return self::$_flippedBuiltInFormats[$formatCode]; - } - - return false; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() - { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_formatCode - . $this->_builtInFormatCode - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() - { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } - - private static $_dateFormatReplacements = array( - // first remove escapes related to non-format characters - '\\' => '', - // 12-hour suffix - 'am/pm' => 'A', - // 4-digit year - 'yyyy' => 'Y', - // 2-digit year - 'yy' => 'y', - // first letter of month - no php equivalent - 'mmmmm' => 'M', - // full month name - 'mmmm' => 'F', - // short month name - 'mmm' => 'M', - // mm is minutes if time or month w/leading zero - ':mm' => ':i', - // month leading zero - 'mm' => 'm', - // month no leading zero - 'm' => 'n', - // full day of week name - 'dddd' => 'l', - // short day of week name - 'ddd' => 'D', - // days leading zero - 'dd' => 'd', - // days no leading zero - 'd' => 'j', - // seconds - 'ss' => 's', - // fractional seconds - no php equivalent - '.s' => '' - ); - private static $_dateFormatReplacements24 = array( - 'hh' => 'H', - 'h' => 'G' - ); - private static $_dateFormatReplacements12 = array( - 'hh' => 'h', - 'h' => 'g' - ); - - /** - * Convert a value in a pre-defined format to a PHP string - * - * @param mixed $value Value to format - * @param string $format Format code - * @param array $callBack Callback function for additional formatting of string - * @return string Formatted string - */ - public static function toFormattedString($value = '', $format = '', $callBack = null) - { - // For now we do not treat strings although section 4 of a format code affects strings - if (!is_numeric($value)) return $value; - - // For 'General' format code, we just pass the value although this is not entirely the way Excel does it, - // it seems to round numbers to a total of 10 digits. - if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) { - return $value; - } - - // Get the sections, there can be up to four sections - $sections = explode(';', $format); - - // Fetch the relevant section depending on whether number is positive, negative, or zero? - // Text not supported yet. - // Here is how the sections apply to various values in Excel: - // 1 section: [POSITIVE/NEGATIVE/ZERO/TEXT] - // 2 sections: [POSITIVE/ZERO/TEXT] [NEGATIVE] - // 3 sections: [POSITIVE/TEXT] [NEGATIVE] [ZERO] - // 4 sections: [POSITIVE] [NEGATIVE] [ZERO] [TEXT] - switch (count($sections)) { - case 1: - $format = $sections[0]; - break; - - case 2: - $format = ($value >= 0) ? $sections[0] : $sections[1]; - $value = abs($value); // Use the absolute value - break; - - case 3: - $format = ($value > 0) ? - $sections[0] : ( ($value < 0) ? - $sections[1] : $sections[2]); - $value = abs($value); // Use the absolute value - break; - - case 4: - $format = ($value > 0) ? - $sections[0] : ( ($value < 0) ? - $sections[1] : $sections[2]); - $value = abs($value); // Use the absolute value - break; - - default: - // something is wrong, just use first section - $format = $sections[0]; - break; - } - - // Save format with color information for later use below - $formatColor = $format; - - // Strip color information - $color_regex = '/^\\[[a-zA-Z]+\\]/'; - $format = preg_replace($color_regex, '', $format); - - // Let's begin inspecting the format and converting the value to a formatted string - if (preg_match('/^(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy]/i', $format)) { // datetime format - // dvc: convert Excel formats to PHP date formats - - // strip off first part containing e.g. [$-F800] or [$USD-409] - // general syntax: [$<Currency string>-<language info>] - // language info is in hexadecimal - $format = preg_replace('/^(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format); - - // OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case - $format = strtolower($format); - - $format = strtr($format,self::$_dateFormatReplacements); - if (!strpos($format,'A')) { // 24-hour time format - $format = strtr($format,self::$_dateFormatReplacements24); - } else { // 12-hour time format - $format = strtr($format,self::$_dateFormatReplacements12); - } - - $dateObj = PHPExcel_Shared_Date::ExcelToPHPObject($value); - $value = $dateObj->format($format); - - } else if (preg_match('/%$/', $format)) { // % number format - if ($format === self::FORMAT_PERCENTAGE) { - $value = round( (100 * $value), 0) . '%'; - } else { - if (preg_match('/\.[#0]+/i', $format, $m)) { - $s = substr($m[0], 0, 1) . (strlen($m[0]) - 1); - $format = str_replace($m[0], $s, $format); - } - if (preg_match('/^[#0]+/', $format, $m)) { - $format = str_replace($m[0], strlen($m[0]), $format); - } - $format = '%' . str_replace('%', 'f%%', $format); - - $value = sprintf($format, 100 * $value); - } - - } else { - if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) { - $value = 'EUR ' . sprintf('%1.2f', $value); - - } else { - // In Excel formats, "_" is used to add spacing, which we can't do in HTML - $format = preg_replace('/_./', '', $format); - - // Some non-number characters are escaped with \, which we don't need - $format = preg_replace("/\\\\/", '', $format); - - // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols - $format = str_replace(array('"','*'), '', $format); - - // Find out if we need thousands separator - // This is indicated by a comma enclosed by a digit placeholder: - // #,# or 0,0 - $useThousands = preg_match('/(#,#|0,0)/', $format); - if ($useThousands) { - $format = preg_replace('/0,0/', '00', $format); - $format = preg_replace('/#,#/', '##', $format); - } - - // Scale thousands, millions,... - // This is indicated by a number of commas after a digit placeholder: - // #, or 0.0,, - $scale = 1; // same as no scale - $matches = array(); - if (preg_match('/(#|0)(,+)/', $format, $matches)) { - $scale = pow(1000, strlen($matches[2])); - - // strip the commas - $format = preg_replace('/0,+/', '0', $format); - $format = preg_replace('/#,+/', '#', $format); - } - - if (preg_match('/#?.*\?\/\?/', $format, $m)) { - //echo 'Format mask is fractional '.$format.' <br />'; - if ($value != (int)$value) { - $sign = ($value < 0) ? '-' : ''; - - $integerPart = floor(abs($value)); - $decimalPart = trim(fmod(abs($value),1),'0.'); - $decimalLength = strlen($decimalPart); - $decimalDivisor = pow(10,$decimalLength); - - $GCD = PHPExcel_Calculation_MathTrig::GCD($decimalPart,$decimalDivisor); - - $adjustedDecimalPart = $decimalPart/$GCD; - $adjustedDecimalDivisor = $decimalDivisor/$GCD; - - if ((strpos($format,'0') !== false) || (strpos($format,'#') !== false) || (substr($format,0,3) == '? ?')) { - if ($integerPart == 0) { $integerPart = ''; } - $value = "$sign$integerPart $adjustedDecimalPart/$adjustedDecimalDivisor"; - } else { - $adjustedDecimalPart += $integerPart * $adjustedDecimalDivisor; - $value = "$sign$adjustedDecimalPart/$adjustedDecimalDivisor"; - } - } - - } else { - // Handle the number itself - - // scale number - $value = $value / $scale; - - // Strip # - $format = preg_replace('/\\#/', '', $format); - - $n = "/\[[^\]]+\]/"; - $m = preg_replace($n, '', $format); - $number_regex = "/(0+)(\.?)(0*)/"; - if (preg_match($number_regex, $m, $matches)) { - $left = $matches[1]; - $dec = $matches[2]; - $right = $matches[3]; - - // minimun width of formatted number (including dot) - $minWidth = strlen($left) + strlen($dec) + strlen($right); - - if ($useThousands) { - $value = number_format( - $value - , strlen($right) - , PHPExcel_Shared_String::getDecimalSeparator() - , PHPExcel_Shared_String::getThousandsSeparator() - ); - } else { - $sprintf_pattern = "%0$minWidth." . strlen($right) . "f"; - $value = sprintf($sprintf_pattern, $value); - } - - $value = preg_replace($number_regex, $value, $format); - } - } - if (preg_match('/\[\$(.*)\]/u', $format, $m)) { - // Currency or Accounting - $currencyFormat = $m[0]; - $currencyCode = $m[1]; - list($currencyCode) = explode('-',$currencyCode); - if ($currencyCode == '') { - $currencyCode = PHPExcel_Shared_String::getCurrencyCode(); - } - $value = preg_replace('/\[\$([^\]]*)\]/u',$currencyCode,$value); - } - } - } - - // Additional formatting provided by callback function - if ($callBack !== null) { - list($writerInstance, $function) = $callBack; - $value = $writerInstance->$function($value, $formatColor); - } - - return $value; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Protection.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Protection.php deleted file mode 100644 index 84201a2f64..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Style/Protection.php +++ /dev/null @@ -1,281 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.4.5, 2007-08-23 - */ - - -/** - * PHPExcel_Style_Protection - * - * @category PHPExcel - * @package PHPExcel_Style - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Style_Protection implements PHPExcel_IComparable -{ - /** Protection styles */ - const PROTECTION_INHERIT = 'inherit'; - const PROTECTION_PROTECTED = 'protected'; - const PROTECTION_UNPROTECTED = 'unprotected'; - - /** - * Locked - * - * @var string - */ - private $_locked; - - /** - * Hidden - * - * @var string - */ - private $_hidden; - - /** - * Parent Borders - * - * @var _parentPropertyName string - */ - private $_parentPropertyName; - - /** - * Supervisor? - * - * @var boolean - */ - private $_isSupervisor; - - /** - * Parent. Only used for supervisor - * - * @var PHPExcel_Style - */ - private $_parent; - - /** - * Create a new PHPExcel_Style_Protection - */ - public function __construct($isSupervisor = false) - { - // Supervisor? - $this->_isSupervisor = $isSupervisor; - - // Initialise values - $this->_locked = self::PROTECTION_INHERIT; - $this->_hidden = self::PROTECTION_INHERIT; - } - - /** - * Bind parent. Only used for supervisor - * - * @param PHPExcel_Style $parent - * @return PHPExcel_Style_Protection - */ - public function bindParent($parent) - { - $this->_parent = $parent; - return $this; - } - - /** - * Is this a supervisor or a real style component? - * - * @return boolean - */ - public function getIsSupervisor() - { - return $this->_isSupervisor; - } - - /** - * Get the shared style component for the currently active cell in currently active sheet. - * Only used for style supervisor - * - * @return PHPExcel_Style_Protection - */ - public function getSharedComponent() - { - return $this->_parent->getSharedComponent()->getProtection(); - } - - /** - * Get the currently active sheet. Only used for supervisor - * - * @return PHPExcel_Worksheet - */ - public function getActiveSheet() - { - return $this->_parent->getActiveSheet(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getSelectedCells() - { - return $this->getActiveSheet()->getSelectedCells(); - } - - /** - * Get the currently active cell coordinate in currently active sheet. - * Only used for supervisor - * - * @return string E.g. 'A1' - */ - public function getActiveCell() - { - return $this->getActiveSheet()->getActiveCell(); - } - - /** - * Build style array from subcomponents - * - * @param array $array - * @return array - */ - public function getStyleArray($array) - { - return array('protection' => $array); - } - - /** - * Apply styles from array - * - * <code> - * $objPHPExcel->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray( array('locked' => true, 'hidden' => false) ); - * </code> - * - * @param array $pStyles Array containing style information - * @throws Exception - * @return PHPExcel_Style_Protection - */ - public function applyFromArray($pStyles = null) { - if (is_array($pStyles)) { - if ($this->_isSupervisor) { - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles)); - } else { - if (array_key_exists('locked', $pStyles)) { - $this->setLocked($pStyles['locked']); - } - if (array_key_exists('hidden', $pStyles)) { - $this->setHidden($pStyles['hidden']); - } - } - } else { - throw new Exception("Invalid style array passed."); - } - return $this; - } - - /** - * Get locked - * - * @return string - */ - public function getLocked() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getLocked(); - } - return $this->_locked; - } - - /** - * Set locked - * - * @param string $pValue - * @return PHPExcel_Style_Protection - */ - public function setLocked($pValue = self::PROTECTION_INHERIT) { - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('locked' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_locked = $pValue; - } - return $this; - } - - /** - * Get hidden - * - * @return string - */ - public function getHidden() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHidden(); - } - return $this->_hidden; - } - - /** - * Set hidden - * - * @param string $pValue - * @return PHPExcel_Style_Protection - */ - public function setHidden($pValue = self::PROTECTION_INHERIT) { - if ($this->_isSupervisor) { - $styleArray = $this->getStyleArray(array('hidden' => $pValue)); - $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray); - } else { - $this->_hidden = $pValue; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_isSupervisor) { - return $this->getSharedComponent()->getHashCode(); - } - return md5( - $this->_locked - . $this->_hidden - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if ((is_object($value)) && ($key != '_parent')) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet.php deleted file mode 100644 index a6d7054c11..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet.php +++ /dev/null @@ -1,2583 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet implements PHPExcel_IComparable -{ - /* Break types */ - const BREAK_NONE = 0; - const BREAK_ROW = 1; - const BREAK_COLUMN = 2; - - /* Sheet state */ - const SHEETSTATE_VISIBLE = 'visible'; - const SHEETSTATE_HIDDEN = 'hidden'; - const SHEETSTATE_VERYHIDDEN = 'veryHidden'; - - /** - * Invalid characters in sheet title - * - * @var array - */ - private static $_invalidCharacters = array('*', ':', '/', '\\', '?', '[', ']'); - - /** - * Parent spreadsheet - * - * @var PHPExcel - */ - private $_parent; - - /** - * Cacheable collection of cells - * - * @var PHPExcel_CachedObjectStorage_xxx - */ - private $_cellCollection = null; - - /** - * Collection of row dimensions - * - * @var PHPExcel_Worksheet_RowDimension[] - */ - private $_rowDimensions = array(); - - /** - * Default row dimension - * - * @var PHPExcel_Worksheet_RowDimension - */ - private $_defaultRowDimension = null; - - /** - * Collection of column dimensions - * - * @var PHPExcel_Worksheet_ColumnDimension[] - */ - private $_columnDimensions = array(); - - /** - * Default column dimension - * - * @var PHPExcel_Worksheet_ColumnDimension - */ - private $_defaultColumnDimension = null; - - /** - * Collection of drawings - * - * @var PHPExcel_Worksheet_BaseDrawing[] - */ - private $_drawingCollection = null; - - /** - * Worksheet title - * - * @var string - */ - private $_title; - - /** - * Sheet state - * - * @var string - */ - private $_sheetState; - - /** - * Page setup - * - * @var PHPExcel_Worksheet_PageSetup - */ - private $_pageSetup; - - /** - * Page margins - * - * @var PHPExcel_Worksheet_PageMargins - */ - private $_pageMargins; - - /** - * Page header/footer - * - * @var PHPExcel_Worksheet_HeaderFooter - */ - private $_headerFooter; - - /** - * Sheet view - * - * @var PHPExcel_Worksheet_SheetView - */ - private $_sheetView; - - /** - * Protection - * - * @var PHPExcel_Worksheet_Protection - */ - private $_protection; - - /** - * Collection of styles - * - * @var PHPExcel_Style[] - */ - private $_styles = array(); - - /** - * Conditional styles. Indexed by cell coordinate, e.g. 'A1' - * - * @var array - */ - private $_conditionalStylesCollection = array(); - - /** - * Is the current cell collection sorted already? - * - * @var boolean - */ - private $_cellCollectionIsSorted = false; - - /** - * Collection of breaks - * - * @var array - */ - private $_breaks = array(); - - /** - * Collection of merged cell ranges - * - * @var array - */ - private $_mergeCells = array(); - - /** - * Collection of protected cell ranges - * - * @var array - */ - private $_protectedCells = array(); - - /** - * Autofilter Range - * - * @var string - */ - private $_autoFilter = ''; - - /** - * Freeze pane - * - * @var string - */ - private $_freezePane = ''; - - /** - * Show gridlines? - * - * @var boolean - */ - private $_showGridlines = true; - - /** - * Print gridlines? - * - * @var boolean - */ - private $_printGridlines = false; - - /** - * Show row and column headers? - * - * @var boolean - */ - private $_showRowColHeaders = true; - - /** - * Show summary below? (Row/Column outline) - * - * @var boolean - */ - private $_showSummaryBelow = true; - - /** - * Show summary right? (Row/Column outline) - * - * @var boolean - */ - private $_showSummaryRight = true; - - /** - * Collection of comments - * - * @var PHPExcel_Comment[] - */ - private $_comments = array(); - - /** - * Active cell. (Only one!) - * - * @var string - */ - private $_activeCell = 'A1'; - - /** - * Selected cells - * - * @var string - */ - private $_selectedCells = 'A1'; - - /** - * Cached highest column - * - * @var string - */ - private $_cachedHighestColumn = 'A'; - - /** - * Cached highest row - * - * @var int - */ - private $_cachedHighestRow = 1; - - /** - * Right-to-left? - * - * @var boolean - */ - private $_rightToLeft = false; - - /** - * Hyperlinks. Indexed by cell coordinate, e.g. 'A1' - * - * @var array - */ - private $_hyperlinkCollection = array(); - - /** - * Data validation objects. Indexed by cell coordinate, e.g. 'A1' - * - * @var array - */ - private $_dataValidationCollection = array(); - - /** - * Tab color - * - * @var PHPExcel_Style_Color - */ - private $_tabColor; - - /** - * Dirty flag - * - * @var boolean - */ - private $_dirty = true; - - /** - * Hash - * - * @var string - */ - private $_hash = null; - - /** - * Create a new worksheet - * - * @param PHPExcel $pParent - * @param string $pTitle - */ - public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet') - { - // Set parent and title - $this->_parent = $pParent; - $this->setTitle($pTitle); - $this->setSheetState(PHPExcel_Worksheet::SHEETSTATE_VISIBLE); - - $this->_cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this); - - // Set page setup - $this->_pageSetup = new PHPExcel_Worksheet_PageSetup(); - - // Set page margins - $this->_pageMargins = new PHPExcel_Worksheet_PageMargins(); - - // Set page header/footer - $this->_headerFooter = new PHPExcel_Worksheet_HeaderFooter(); - - // Set sheet view - $this->_sheetView = new PHPExcel_Worksheet_SheetView(); - - // Drawing collection - $this->_drawingCollection = new ArrayObject(); - - // Protection - $this->_protection = new PHPExcel_Worksheet_Protection(); - - // Default row dimension - $this->_defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null); - - // Default column dimension - $this->_defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null); - } - - - public function disconnectCells() { - $this->_cellCollection->unsetWorksheetCells(); - $this->_cellCollection = null; - - // detach ourself from the workbook, so that it can then delete this worksheet successfully - $this->_parent = null; - } - - /** - * Return the cache controller for the cell collection - * - * @return PHPExcel_CachedObjectStorage_xxx - */ - public function getCellCacheController() { - return $this->_cellCollection; - } // function getCellCacheController() - - - /** - * Get array of invalid characters for sheet title - * - * @return array - */ - public static function getInvalidCharacters() - { - return self::$_invalidCharacters; - } - - /** - * Check sheet title for valid Excel syntax - * - * @param string $pValue The string to check - * @return string The valid string - * @throws Exception - */ - private static function _checkSheetTitle($pValue) - { - // Some of the printable ASCII characters are invalid: * : / \ ? [ ] - if (str_replace(self::$_invalidCharacters, '', $pValue) !== $pValue) { - throw new Exception('Invalid character found in sheet title'); - } - - // Maximum 31 characters allowed for sheet title - if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) { - throw new Exception('Maximum 31 characters allowed in sheet title.'); - } - - return $pValue; - } - - /** - * Get collection of cells - * - * @param boolean $pSorted Also sort the cell collection? - * @return PHPExcel_Cell[] - */ - public function getCellCollection($pSorted = true) - { - if ($pSorted) { - // Re-order cell collection - return $this->sortCellCollection(); - } - if (!is_null($this->_cellCollection)) { - return $this->_cellCollection->getCellList(); - } - return array(); - } - - /** - * Sort collection of cells - * - * @return PHPExcel_Worksheet - */ - public function sortCellCollection() - { - if (!is_null($this->_cellCollection)) { - return $this->_cellCollection->getSortedCellList(); - } - return array(); - } - - /** - * Get collection of row dimensions - * - * @return PHPExcel_Worksheet_RowDimension[] - */ - public function getRowDimensions() - { - return $this->_rowDimensions; - } - - /** - * Get default row dimension - * - * @return PHPExcel_Worksheet_RowDimension - */ - public function getDefaultRowDimension() - { - return $this->_defaultRowDimension; - } - - /** - * Get collection of column dimensions - * - * @return PHPExcel_Worksheet_ColumnDimension[] - */ - public function getColumnDimensions() - { - return $this->_columnDimensions; - } - - /** - * Get default column dimension - * - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function getDefaultColumnDimension() - { - return $this->_defaultColumnDimension; - } - - /** - * Get collection of drawings - * - * @return PHPExcel_Worksheet_BaseDrawing[] - */ - public function getDrawingCollection() - { - return $this->_drawingCollection; - } - - /** - * Refresh column dimensions - * - * @return PHPExcel_Worksheet - */ - public function refreshColumnDimensions() - { - $currentColumnDimensions = $this->getColumnDimensions(); - $newColumnDimensions = array(); - - foreach ($currentColumnDimensions as $objColumnDimension) { - $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension; - } - - $this->_columnDimensions = $newColumnDimensions; - - return $this; - } - - /** - * Refresh row dimensions - * - * @return PHPExcel_Worksheet - */ - public function refreshRowDimensions() - { - $currentRowDimensions = $this->getRowDimensions(); - $newRowDimensions = array(); - - foreach ($currentRowDimensions as $objRowDimension) { - $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension; - } - - $this->_rowDimensions = $newRowDimensions; - - return $this; - } - - /** - * Calculate worksheet dimension - * - * @return string String containing the dimension of this worksheet - */ - public function calculateWorksheetDimension() - { - // Return - return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow(); - } - - /** - * Calculate widths for auto-size columns - * - * @param boolean $calculateMergeCells Calculate merge cell width - * @return PHPExcel_Worksheet; - */ - public function calculateColumnWidths($calculateMergeCells = false) - { - // initialize $autoSizes array - $autoSizes = array(); - foreach ($this->getColumnDimensions() as $colDimension) { - if ($colDimension->getAutoSize()) { - $autoSizes[$colDimension->getColumnIndex()] = -1; - } - } - - // There is only something to do if there are some auto-size columns - if (!empty($autoSizes)) { - - // build list of cells references that participate in a merge - $isMergeCell = array(); - foreach ($this->getMergeCells() as $cells) { - foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) { - $isMergeCell[$cellReference] = true; - } - } - - // loop through all cells in the worksheet - foreach ($this->getCellCollection(false) as $cellID) { - $cell = $this->getCell($cellID); - if (isset($autoSizes[$cell->getColumn()])) { - // Determine width if cell does not participate in a merge - if (!isset($isMergeCell[$cell->getCoordinate()])) { - // Calculated value - $cellValue = $cell->getCalculatedValue(); - - // To formatted string - $cellValue = PHPExcel_Style_NumberFormat::toFormattedString($cellValue, $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()); - - $autoSizes[$cell->getColumn()] = max( - (float)$autoSizes[$cell->getColumn()], - (float)PHPExcel_Shared_Font::calculateColumnWidth( - $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(), - $cellValue, - $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(), - $this->getDefaultStyle()->getFont() - ) - ); - } - } - } - - // adjust column widths - foreach ($autoSizes as $columnIndex => $width) { - if ($width == -1) $width = $this->getDefaultColumnDimension()->getWidth(); - $this->getColumnDimension($columnIndex)->setWidth($width); - } - } - - return $this; - } - - /** - * Get parent - * - * @return PHPExcel - */ - public function getParent() { - return $this->_parent; - } - - /** - * Re-bind parent - * - * @param PHPExcel $parent - * @return PHPExcel_Worksheet - */ - public function rebindParent(PHPExcel $parent) { - $namedRanges = $this->_parent->getNamedRanges(); - foreach ($namedRanges as $namedRange) { - $parent->addNamedRange($namedRange); - } - - $this->_parent->removeSheetByIndex( - $this->_parent->getIndex($this) - ); - $this->_parent = $parent; - - return $this; - } - - /** - * Get title - * - * @return string - */ - public function getTitle() - { - return $this->_title; - } - - /** - * Set title - * - * @param string $pValue String containing the dimension of this worksheet - * @return PHPExcel_Worksheet - */ - public function setTitle($pValue = 'Worksheet') - { - // Is this a 'rename' or not? - if ($this->getTitle() == $pValue) { - return $this; - } - - // Syntax check - self::_checkSheetTitle($pValue); - - // Old title - $oldTitle = $this->getTitle(); - - // Is there already such sheet name? - if ($this->getParent()->getSheetByName($pValue)) { - // Use name, but append with lowest possible integer - - if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) { - $pValue = PHPExcel_Shared_String::Substring($pValue,0,29); - } - $i = 1; - while ($this->getParent()->getSheetByName($pValue . ' ' . $i)) { - ++$i; - if ($i == 10) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) { - $pValue = PHPExcel_Shared_String::Substring($pValue,0,28); - } - } elseif ($i == 100) { - if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) { - $pValue = PHPExcel_Shared_String::Substring($pValue,0,27); - } - } - } - - $altTitle = $pValue . ' ' . $i; - return $this->setTitle($altTitle); - } - - // Set title - $this->_title = $pValue; - $this->_dirty = true; - - // New title - $newTitle = $this->getTitle(); - PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->getParent(), $oldTitle, $newTitle); - - return $this; - } - - /** - * Get sheet state - * - * @return string Sheet state (visible, hidden, veryHidden) - */ - public function getSheetState() { - return $this->_sheetState; - } - - /** - * Set sheet state - * - * @param string $value Sheet state (visible, hidden, veryHidden) - * @return PHPExcel_Worksheet - */ - public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE) { - $this->_sheetState = $value; - return $this; - } - - /** - * Get page setup - * - * @return PHPExcel_Worksheet_PageSetup - */ - public function getPageSetup() - { - return $this->_pageSetup; - } - - /** - * Set page setup - * - * @param PHPExcel_Worksheet_PageSetup $pValue - * @return PHPExcel_Worksheet - */ - public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue) - { - $this->_pageSetup = $pValue; - return $this; - } - - /** - * Get page margins - * - * @return PHPExcel_Worksheet_PageMargins - */ - public function getPageMargins() - { - return $this->_pageMargins; - } - - /** - * Set page margins - * - * @param PHPExcel_Worksheet_PageMargins $pValue - * @return PHPExcel_Worksheet - */ - public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue) - { - $this->_pageMargins = $pValue; - return $this; - } - - /** - * Get page header/footer - * - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function getHeaderFooter() - { - return $this->_headerFooter; - } - - /** - * Set page header/footer - * - * @param PHPExcel_Worksheet_HeaderFooter $pValue - * @return PHPExcel_Worksheet - */ - public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue) - { - $this->_headerFooter = $pValue; - return $this; - } - - /** - * Get sheet view - * - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function getSheetView() - { - return $this->_sheetView; - } - - /** - * Set sheet view - * - * @param PHPExcel_Worksheet_SheetView $pValue - * @return PHPExcel_Worksheet - */ - public function setSheetView(PHPExcel_Worksheet_SheetView $pValue) - { - $this->_sheetView = $pValue; - return $this; - } - - /** - * Get Protection - * - * @return PHPExcel_Worksheet_Protection - */ - public function getProtection() - { - return $this->_protection; - } - - /** - * Set Protection - * - * @param PHPExcel_Worksheet_Protection $pValue - * @return PHPExcel_Worksheet - */ - public function setProtection(PHPExcel_Worksheet_Protection $pValue) - { - $this->_protection = $pValue; - $this->_dirty = true; - - return $this; - } - - /** - * Get highest worksheet column - * - * @return string Highest column name - */ - public function getHighestColumn() - { - return $this->_cachedHighestColumn; - } - - /** - * Get highest worksheet row - * - * @return int Highest row number - */ - public function getHighestRow() - { - return $this->_cachedHighestRow; - } - - /** - * Set a cell value - * - * @param string $pCoordinate Coordinate of the cell - * @param mixed $pValue Value of the cell - * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified - */ - public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false) - { - $cell = $this->getCell($pCoordinate); - $cell->setValue($pValue); - - if ($returnCell) { - return $cell; - } - return $this; - } - - /** - * Set a cell value by using numeric cell coordinates - * - * @param string $pColumn Numeric column coordinate of the cell - * @param string $pRow Numeric row coordinate of the cell - * @param mixed $pValue Value of the cell - * @param bool $returnCell Return the worksheet (false, default) or the cell (true) - * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified - */ - public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false) - { - $cell = $this->getCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - $cell->setValue($pValue); - - if ($returnCell) { - return $cell; - } - return $this; - } - - /** - * Set a cell value - * - * @param string $pCoordinate Coordinate of the cell - * @param mixed $pValue Value of the cell - * @param string $pDataType Explicit data type - * @return PHPExcel_Worksheet - */ - public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) - { - // Set value - $this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType); - return $this; - } - - /** - * Set a cell value by using numeric cell coordinates - * - * @param string $pColumn Numeric column coordinate of the cell - * @param string $pRow Numeric row coordinate of the cell - * @param mixed $pValue Value of the cell - * @param string $pDataType Explicit data type - * @return PHPExcel_Worksheet - */ - public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING) - { - return $this->getCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow)->setValueExplicit($pValue, $pDataType); - } - - /** - * Get cell at a specific coordinate - * - * @param string $pCoordinate Coordinate of the cell - * @throws Exception - * @return PHPExcel_Cell Cell that was found - */ - public function getCell($pCoordinate = 'A1') - { - // Check cell collection - if ($this->_cellCollection->isDataSet($pCoordinate)) { - return $this->_cellCollection->getCacheData($pCoordinate); - } - - // Worksheet reference? - if (strpos($pCoordinate, '!') !== false) { - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); - return $this->getParent()->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]); - } - - // Named range? - if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && - (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { - $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); - if (!is_null($namedRange)) { - $pCoordinate = $namedRange->getRange(); - return $namedRange->getWorksheet()->getCell($pCoordinate); - } - } - - // Uppercase coordinate - $pCoordinate = strtoupper($pCoordinate); - - if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) { - throw new Exception('Cell coordinate can not be a range of cells.'); - } elseif (strpos($pCoordinate,'$') !== false) { - throw new Exception('Cell coordinate must not be absolute.'); - } else { - // Create new cell object - - // Coordinates - $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); - - $cell = $this->_cellCollection->addCacheData($pCoordinate,new PHPExcel_Cell($aCoordinates[0], $aCoordinates[1], null, PHPExcel_Cell_DataType::TYPE_NULL, $this)); - $this->_cellCollectionIsSorted = false; - - if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0])) - $this->_cachedHighestColumn = $aCoordinates[0]; - - $this->_cachedHighestRow = max($this->_cachedHighestRow,$aCoordinates[1]); - - // Cell needs appropriate xfIndex - $rowDimensions = $this->getRowDimensions(); - $columnDimensions = $this->getColumnDimensions(); - - if ( isset($rowDimensions[$aCoordinates[1]]) && $rowDimensions[$aCoordinates[1]]->getXfIndex() !== null ) { - // then there is a row dimension with explicit style, assign it to the cell - $cell->setXfIndex($rowDimensions[$aCoordinates[1]]->getXfIndex()); - } else if ( isset($columnDimensions[$aCoordinates[0]]) ) { - // then there is a column dimension, assign it to the cell - $cell->setXfIndex($columnDimensions[$aCoordinates[0]]->getXfIndex()); - } else { - // set to default index - $cell->setXfIndex(0); - } - - return $cell; - } - } - - /** - * Get cell at a specific coordinate by using numeric cell coordinates - * - * @param string $pColumn Numeric column coordinate of the cell - * @param string $pRow Numeric row coordinate of the cell - * @return PHPExcel_Cell Cell that was found - */ - public function getCellByColumnAndRow($pColumn = 0, $pRow = 1) - { - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn); - $coordinate = $columnLetter . $pRow; - - if (!$this->_cellCollection->isDataSet($coordinate)) { - $cell = $this->_cellCollection->addCacheData($coordinate, new PHPExcel_Cell($columnLetter, $pRow, null, PHPExcel_Cell_DataType::TYPE_NULL, $this)); - $this->_cellCollectionIsSorted = false; - - if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < $pColumn) - $this->_cachedHighestColumn = $columnLetter; - - $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow); - - return $cell; - } - - return $this->_cellCollection->getCacheData($coordinate); - } - - /** - * Cell at a specific coordinate exists? - * - * @param string $pCoordinate Coordinate of the cell - * @throws Exception - * @return boolean - */ - public function cellExists($pCoordinate = 'A1') - { - // Worksheet reference? - if (strpos($pCoordinate, '!') !== false) { - $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true); - return $this->getParent()->getSheetByName($worksheetReference[0])->cellExists($worksheetReference[1]); - } - - // Named range? - if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) && - (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) { - $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this); - if (!is_null($namedRange)) { - $pCoordinate = $namedRange->getRange(); - if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) { - if (!$namedRange->getLocalOnly()) { - return $namedRange->getWorksheet()->cellExists($pCoordinate); - } else { - throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle()); - } - } - } - } - - // Uppercase coordinate - $pCoordinate = strtoupper($pCoordinate); - - if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) { - throw new Exception('Cell coordinate can not be a range of cells.'); - } elseif (strpos($pCoordinate,'$') !== false) { - throw new Exception('Cell coordinate must not be absolute.'); - } else { - // Coordinates - $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate); - - // Cell exists? - return $this->_cellCollection->isDataSet($pCoordinate); - } - } - - /** - * Cell at a specific coordinate by using numeric cell coordinates exists? - * - * @param string $pColumn Numeric column coordinate of the cell - * @param string $pRow Numeric row coordinate of the cell - * @return boolean - */ - public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1) - { - return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - } - - /** - * Get row dimension at a specific row - * - * @param int $pRow Numeric index of the row - * @return PHPExcel_Worksheet_RowDimension - */ - public function getRowDimension($pRow = 1) - { - // Found - $found = null; - - // Get row dimension - if (!isset($this->_rowDimensions[$pRow])) { - $this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow); - - $this->_cachedHighestRow = max($this->_cachedHighestRow,$pRow); - } - return $this->_rowDimensions[$pRow]; - } - - /** - * Get column dimension at a specific column - * - * @param string $pColumn String index of the column - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function getColumnDimension($pColumn = 'A') - { - // Uppercase coordinate - $pColumn = strtoupper($pColumn); - - // Fetch dimensions - if (!isset($this->_columnDimensions[$pColumn])) { - $this->_columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn); - - if (PHPExcel_Cell::columnIndexFromString($this->_cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn)) - $this->_cachedHighestColumn = $pColumn; - } - return $this->_columnDimensions[$pColumn]; - } - - /** - * Get column dimension at a specific column by using numeric cell coordinates - * - * @param string $pColumn Numeric column coordinate of the cell - * @param string $pRow Numeric row coordinate of the cell - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function getColumnDimensionByColumn($pColumn = 0) - { - return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn)); - } - - /** - * Get styles - * - * @return PHPExcel_Style[] - */ - public function getStyles() - { - return $this->_styles; - } - - /** - * Get default style of workbork. - * - * @deprecated - * @return PHPExcel_Style - * @throws Exception - */ - public function getDefaultStyle() - { - return $this->_parent->getDefaultStyle(); - } - - /** - * Set default style - should only be used by PHPExcel_IReader implementations! - * - * @deprecated - * @param PHPExcel_Style $value - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setDefaultStyle(PHPExcel_Style $pValue) - { - $this->_parent->getDefaultStyle()->applyFromArray(array( - 'font' => array( - 'name' => $pValue->getFont()->getName(), - 'size' => $pValue->getFont()->getSize(), - ), - )); - return $this; - } - - /** - * Get style for cell - * - * @param string $pCellCoordinate Cell coordinate to get style for - * @return PHPExcel_Style - * @throws Exception - */ - public function getStyle($pCellCoordinate = 'A1') - { - // set this sheet as active - $this->_parent->setActiveSheetIndex($this->_parent->getIndex($this)); - - // set cell coordinate as active - $this->setSelectedCells($pCellCoordinate); - - return $this->_parent->getCellXfSupervisor(); - } - - /** - * Get conditional styles for a cell - * - * @param string $pCoordinate - * @return PHPExcel_Style_Conditional[] - */ - public function getConditionalStyles($pCoordinate = 'A1') - { - if (!isset($this->_conditionalStylesCollection[$pCoordinate])) { - $this->_conditionalStylesCollection[$pCoordinate] = array(); - } - return $this->_conditionalStylesCollection[$pCoordinate]; - } - - /** - * Do conditional styles exist for this cell? - * - * @param string $pCoordinate - * @return boolean - */ - public function conditionalStylesExists($pCoordinate = 'A1') - { - if (isset($this->_conditionalStylesCollection[$pCoordinate])) { - return true; - } - return false; - } - - /** - * Removes conditional styles for a cell - * - * @param string $pCoordinate - * @return PHPExcel_Worksheet - */ - public function removeConditionalStyles($pCoordinate = 'A1') - { - unset($this->_conditionalStylesCollection[$pCoordinate]); - return $this; - } - - /** - * Get collection of conditional styles - * - * @return array - */ - public function getConditionalStylesCollection() - { - return $this->_conditionalStylesCollection; - } - - /** - * Set conditional styles - * - * @param $pCoordinate string E.g. 'A1' - * @param $pValue PHPExcel_Style_Conditional[] - * @return PHPExcel_Worksheet - */ - public function setConditionalStyles($pCoordinate = 'A1', $pValue) - { - $this->_conditionalStylesCollection[$pCoordinate] = $pValue; - return $this; - } - - /** - * Get style for cell by using numeric cell coordinates - * - * @param int $pColumn Numeric column coordinate of the cell - * @param int $pRow Numeric row coordinate of the cell - * @return PHPExcel_Style - */ - public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1) - { - return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - } - - /** - * Set shared cell style to a range of cells - * - * Please note that this will overwrite existing cell styles for cells in range! - * - * @deprecated - * @param PHPExcel_Style $pSharedCellStyle Cell style to share - * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '') - { - $this->duplicateStyle($pSharedCellStyle, $pRange); - return $this; - } - - /** - * Duplicate cell style to a range of cells - * - * Please note that this will overwrite existing cell styles for cells in range! - * - * @param PHPExcel_Style $pCellStyle Cell style to duplicate - * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '') - { - // make sure we have a real style and not supervisor - $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle; - - // Add the style to the workbook if necessary - $workbook = $this->_parent; - if ($existingStyle = $this->_parent->getCellXfByHashCode($pCellStyle->getHashCode())) { - // there is already such cell Xf in our collection - $xfIndex = $existingStyle->getIndex(); - } else { - // we don't have such a cell Xf, need to add - $workbook->addCellXf($pCellStyle); - $xfIndex = $pCellStyle->getIndex(); - } - - // Uppercase coordinate - $pRange = strtoupper($pRange); - - // Is it a cell range or a single cell? - $rangeA = ''; - $rangeB = ''; - if (strpos($pRange, ':') === false) { - $rangeA = $pRange; - $rangeB = $pRange; - } else { - list($rangeA, $rangeB) = explode(':', $pRange); - } - - // Calculate range outer borders - $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA); - $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB); - - // Translate column into index - $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1; - $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1; - - // Make sure we can loop upwards on rows and columns - if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) { - $tmp = $rangeStart; - $rangeStart = $rangeEnd; - $rangeEnd = $tmp; - } - - // Loop through cells and apply styles - for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) { - for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) { - $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row)->setXfIndex($xfIndex); - } - } - - return $this; - } - - /** - * Duplicate cell style array to a range of cells - * - * Please note that this will overwrite existing cell styles for cells in range, - * if they are in the styles array. For example, if you decide to set a range of - * cells to font bold, only include font bold in the styles array. - * - * @deprecated - * @param array $pStyles Array containing style information - * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @param boolean $pAdvanced Advanced mode for setting borders. - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true) - { - $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced); - return $this; - } - - /** - * Set break on a cell - * - * @param string $pCell Cell coordinate (e.g. A1) - * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE) - { - // Uppercase coordinate - $pCell = strtoupper($pCell); - - if ($pCell != '') { - $this->_breaks[$pCell] = $pBreak; - } else { - throw new Exception('No cell coordinate specified.'); - } - - return $this; - } - - /** - * Set break on a cell by using numeric cell coordinates - * - * @param integer $pColumn Numeric column coordinate of the cell - * @param integer $pRow Numeric row coordinate of the cell - * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE) - { - return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak); - } - - /** - * Get breaks - * - * @return array[] - */ - public function getBreaks() - { - return $this->_breaks; - } - - /** - * Set merge on a cell range - * - * @param string $pRange Cell range (e.g. A1:E1) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function mergeCells($pRange = 'A1:A1') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - if (strpos($pRange,':') !== false) { - $this->_mergeCells[$pRange] = $pRange; - - // make sure cells are created - - // get the cells in the range - $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange); - - // create upper left cell if it does not already exist - $upperLeft = $aReferences[0]; - if (!$this->cellExists($upperLeft)) { - $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); - } - - // create or blank out the rest of the cells in the range - $count = count($aReferences); - for ($i = 1; $i < $count; $i++) { - $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL); - } - - } else { - throw new Exception('Merge must be set on a range of cells.'); - } - - return $this; - } - - /** - * Set merge on a cell range by using numeric cell coordinates - * - * @param int $pColumn1 Numeric column coordinate of the first cell - * @param int $pRow1 Numeric row coordinate of the first cell - * @param int $pColumn2 Numeric column coordinate of the last cell - * @param int $pRow2 Numeric row coordinate of the last cell - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) - { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; - return $this->mergeCells($cellRange); - } - - /** - * Remove merge on a cell range - * - * @param string $pRange Cell range (e.g. A1:E1) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function unmergeCells($pRange = 'A1:A1') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - if (strpos($pRange,':') !== false) { - if (isset($this->_mergeCells[$pRange])) { - unset($this->_mergeCells[$pRange]); - } else { - throw new Exception('Cell range ' . $pRange . ' not known as merged.'); - } - } else { - throw new Exception('Merge can only be removed from a range of cells.'); - } - - return $this; - } - - /** - * Remove merge on a cell range by using numeric cell coordinates - * - * @param int $pColumn1 Numeric column coordinate of the first cell - * @param int $pRow1 Numeric row coordinate of the first cell - * @param int $pColumn2 Numeric column coordinate of the last cell - * @param int $pRow2 Numeric row coordinate of the last cell - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) - { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; - return $this->unmergeCells($cellRange); - } - - /** - * Get merge cells array. - * - * @return array[] - */ - public function getMergeCells() - { - return $this->_mergeCells; - } - - /** - * Set merge cells array for the entire sheet. Use instead mergeCells() to merge - * a single cell range. - * - * @param array - */ - public function setMergeCells($pValue = array()) - { - $this->_mergeCells = $pValue; - - return $this; - } - - /** - * Set protection on a cell range - * - * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) - * @param string $pPassword Password to unlock the protection - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false) - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - if (!$pAlreadyHashed) { - $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword); - } - $this->_protectedCells[$pRange] = $pPassword; - - return $this; - } - - /** - * Set protection on a cell range by using numeric cell coordinates - * - * @param int $pColumn1 Numeric column coordinate of the first cell - * @param int $pRow1 Numeric row coordinate of the first cell - * @param int $pColumn2 Numeric column coordinate of the last cell - * @param int $pRow2 Numeric row coordinate of the last cell - * @param string $pPassword Password to unlock the protection - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) - { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; - return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed); - } - - /** - * Remove protection on a cell range - * - * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function unprotectCells($pRange = 'A1') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - if (isset($this->_protectedCells[$pRange])) { - unset($this->_protectedCells[$pRange]); - } else { - throw new Exception('Cell range ' . $pRange . ' not known as protected.'); - } - return $this; - } - - /** - * Remove protection on a cell range by using numeric cell coordinates - * - * @param int $pColumn1 Numeric column coordinate of the first cell - * @param int $pRow1 Numeric row coordinate of the first cell - * @param int $pColumn2 Numeric column coordinate of the last cell - * @param int $pRow2 Numeric row coordinate of the last cell - * @param string $pPassword Password to unlock the protection - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false) - { - $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2; - return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed); - } - - /** - * Get protected cells - * - * @return array[] - */ - public function getProtectedCells() - { - return $this->_protectedCells; - } - - /** - * Get Autofilter Range - * - * @return string - */ - public function getAutoFilter() - { - return $this->_autoFilter; - } - - /** - * Set Autofilter Range - * - * @param string $pRange Cell range (i.e. A1:E10) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setAutoFilter($pRange = '') - { - // Uppercase coordinate - $pRange = strtoupper($pRange); - - if (strpos($pRange,':') !== false) { - $this->_autoFilter = $pRange; - $this->_dirty = true; - } else { - throw new Exception('Autofilter must be set on a range of cells.'); - } - return $this; - } - - /** - * Set Autofilter Range by using numeric cell coordinates - * - * @param int $pColumn1 Numeric column coordinate of the first cell - * @param int $pRow1 Numeric row coordinate of the first cell - * @param int $pColumn2 Numeric column coordinate of the second cell - * @param int $pRow2 Numeric row coordinate of the second cell - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1) - { - return $this->setAutoFilter( - PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 - . ':' . - PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2 - ); - } - - /** - * Remove autofilter - * - * @return PHPExcel_Worksheet - */ - public function removeAutoFilter() - { - $this->_autoFilter = ''; - return $this; - } - - /** - * Get Freeze Pane - * - * @return string - */ - public function getFreezePane() - { - return $this->_freezePane; - } - - /** - * Freeze Pane - * - * @param string $pCell Cell (i.e. A1) - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function freezePane($pCell = '') - { - // Uppercase coordinate - $pCell = strtoupper($pCell); - - if (strpos($pCell,':') === false && strpos($pCell,',') === false) { - $this->_freezePane = $pCell; - } else { - throw new Exception('Freeze pane can not be set on a range of cells.'); - } - return $this; - } - - /** - * Freeze Pane by using numeric cell coordinates - * - * @param int $pColumn Numeric column coordinate of the cell - * @param int $pRow Numeric row coordinate of the cell - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1) - { - return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - } - - /** - * Unfreeze Pane - * - * @return PHPExcel_Worksheet - */ - public function unfreezePane() - { - return $this->freezePane(''); - } - - /** - * Insert a new row, updating all possible related data - * - * @param int $pBefore Insert before this one - * @param int $pNumRows Number of rows to insert - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) { - if ($pBefore >= 1) { - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); - $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this); - } else { - throw new Exception("Rows can only be inserted before at least row 1."); - } - return $this; - } - - /** - * Insert a new column, updating all possible related data - * - * @param int $pBefore Insert before this one - * @param int $pNumCols Number of columns to insert - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) { - if (!is_numeric($pBefore)) { - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); - $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this); - } else { - throw new Exception("Column references should not be numeric."); - } - return $this; - } - - /** - * Insert a new column, updating all possible related data - * - * @param int $pBefore Insert before this one (numeric column coordinate of the cell) - * @param int $pNumCols Number of columns to insert - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) { - if ($pBefore >= 0) { - return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols); - } else { - throw new Exception("Columns can only be inserted before at least column A (0)."); - } - } - - /** - * Delete a row, updating all possible related data - * - * @param int $pRow Remove starting with this one - * @param int $pNumRows Number of rows to remove - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function removeRow($pRow = 1, $pNumRows = 1) { - if ($pRow >= 1) { - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); - $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this); - } else { - throw new Exception("Rows to be deleted should at least start from row 1."); - } - return $this; - } - - /** - * Remove a column, updating all possible related data - * - * @param int $pColumn Remove starting with this one - * @param int $pNumCols Number of columns to remove - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function removeColumn($pColumn = 'A', $pNumCols = 1) { - if (!is_numeric($pColumn)) { - $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols); - $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance(); - $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this); - } else { - throw new Exception("Column references should not be numeric."); - } - return $this; - } - - /** - * Remove a column, updating all possible related data - * - * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell) - * @param int $pNumCols Number of columns to remove - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) { - if ($pColumn >= 0) { - return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols); - } else { - throw new Exception("Columns to be deleted should at least start from column 0"); - } - } - - /** - * Show gridlines? - * - * @return boolean - */ - public function getShowGridlines() { - return $this->_showGridlines; - } - - /** - * Set show gridlines - * - * @param boolean $pValue Show gridlines (true/false) - * @return PHPExcel_Worksheet - */ - public function setShowGridlines($pValue = false) { - $this->_showGridlines = $pValue; - return $this; - } - - /** - * Print gridlines? - * - * @return boolean - */ - public function getPrintGridlines() { - return $this->_printGridlines; - } - - /** - * Set print gridlines - * - * @param boolean $pValue Print gridlines (true/false) - * @return PHPExcel_Worksheet - */ - public function setPrintGridlines($pValue = false) { - $this->_printGridlines = $pValue; - return $this; - } - - /** - * Show row and column headers? - * - * @return boolean - */ - public function getShowRowColHeaders() { - return $this->_showRowColHeaders; - } - - /** - * Set show row and column headers - * - * @param boolean $pValue Show row and column headers (true/false) - * @return PHPExcel_Worksheet - */ - public function setShowRowColHeaders($pValue = false) { - $this->_showRowColHeaders = $pValue; - return $this; - } - - /** - * Show summary below? (Row/Column outlining) - * - * @return boolean - */ - public function getShowSummaryBelow() { - return $this->_showSummaryBelow; - } - - /** - * Set show summary below - * - * @param boolean $pValue Show summary below (true/false) - * @return PHPExcel_Worksheet - */ - public function setShowSummaryBelow($pValue = true) { - $this->_showSummaryBelow = $pValue; - return $this; - } - - /** - * Show summary right? (Row/Column outlining) - * - * @return boolean - */ - public function getShowSummaryRight() { - return $this->_showSummaryRight; - } - - /** - * Set show summary right - * - * @param boolean $pValue Show summary right (true/false) - * @return PHPExcel_Worksheet - */ - public function setShowSummaryRight($pValue = true) { - $this->_showSummaryRight = $pValue; - return $this; - } - - /** - * Get comments - * - * @return PHPExcel_Comment[] - */ - public function getComments() - { - return $this->_comments; - } - - /** - * Set comments array for the entire sheet. - * - * @param array of PHPExcel_Comment - * @return PHPExcel_Worksheet - */ - public function setComments($pValue = array()) - { - $this->_comments = $pValue; - - return $this; - } - - /** - * Get comment for cell - * - * @param string $pCellCoordinate Cell coordinate to get comment for - * @return PHPExcel_Comment - * @throws Exception - */ - public function getComment($pCellCoordinate = 'A1') - { - // Uppercase coordinate - $pCellCoordinate = strtoupper($pCellCoordinate); - - if (strpos($pCellCoordinate,':') !== false || strpos($pCellCoordinate,',') !== false) { - throw new Exception('Cell coordinate string can not be a range of cells.'); - } else if (strpos($pCellCoordinate,'$') !== false) { - throw new Exception('Cell coordinate string must not be absolute.'); - } else if ($pCellCoordinate == '') { - throw new Exception('Cell coordinate can not be zero-length string.'); - } else { - // Check if we already have a comment for this cell. - // If not, create a new comment. - if (isset($this->_comments[$pCellCoordinate])) { - return $this->_comments[$pCellCoordinate]; - } else { - $newComment = new PHPExcel_Comment(); - $this->_comments[$pCellCoordinate] = $newComment; - return $newComment; - } - } - } - - /** - * Get comment for cell by using numeric cell coordinates - * - * @param int $pColumn Numeric column coordinate of the cell - * @param int $pRow Numeric row coordinate of the cell - * @return PHPExcel_Comment - */ - public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1) - { - return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - } - - /** - * Get selected cell - * - * @deprecated - * @return string - */ - public function getSelectedCell() - { - return $this->getSelectedCells(); - } - - /** - * Get active cell - * - * @return string Example: 'A1' - */ - public function getActiveCell() - { - return $this->_activeCell; - } - - /** - * Get selected cells - * - * @return string - */ - public function getSelectedCells() - { - return $this->_selectedCells; - } - - /** - * Selected cell - * - * @param string $pCell Cell (i.e. A1) - * @return PHPExcel_Worksheet - */ - public function setSelectedCell($pCoordinate = 'A1') - { - return $this->setSelectedCells($pCoordinate); - } - - /** - * Select a range of cells. - * - * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6' - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setSelectedCells($pCoordinate = 'A1') - { - // Uppercase coordinate - $pCoordinate = strtoupper($pCoordinate); - - // Convert 'A' to 'A:A' - $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate); - - // Convert '1' to '1:1' - $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate); - - // Convert 'A:C' to 'A1:C1048576' - $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate); - - // Convert '1:3' to 'A1:XFD3' - $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate); - - if (strpos($pCoordinate,':') !== false || strpos($pCoordinate,',') !== false) { - list($first, ) = PHPExcel_Cell::splitRange($pCoordinate); - $this->_activeCell = $first[0]; - } else { - $this->_activeCell = $pCoordinate; - } - $this->_selectedCells = $pCoordinate; - return $this; - } - - /** - * Selected cell by using numeric cell coordinates - * - * @param int $pColumn Numeric column coordinate of the cell - * @param int $pRow Numeric row coordinate of the cell - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1) - { - return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow); - } - - /** - * Get right-to-left - * - * @return boolean - */ - public function getRightToLeft() { - return $this->_rightToLeft; - } - - /** - * Set right-to-left - * - * @param boolean $value Right-to-left true/false - * @return PHPExcel_Worksheet - */ - public function setRightToLeft($value = false) { - $this->_rightToLeft = $value; - return $this; - } - - /** - * Fill worksheet from values in array - * - * @param array $source Source array - * @param mixed $nullValue Value in source array that stands for blank cell - * @param string $startCell Insert array starting from this cell address as the top left coordinate - * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array - * @throws Exception - * @return PHPExcel_Worksheet - */ - public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false) { - if (is_array($source)) { - // Convert a 1-D array to 2-D (for ease of looping) - if (!is_array(end($source))) { - $source = array($source); - } - - // start coordinate - list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell); - - // Loop through $source - foreach ($source as $rowData) { - $currentColumn = $startColumn; - foreach($rowData as $cellValue) { - if ($strictNullComparison) { - if ($cellValue !== $nullValue) { - // Set cell value - $this->getCell($currentColumn . $startRow)->setValue($cellValue); - } - } else { - if ($cellValue != $nullValue) { - // Set cell value - $this->getCell($currentColumn . $startRow)->setValue($cellValue); - } - } - ++$currentColumn; - } - ++$startRow; - } - } else { - throw new Exception("Parameter \$source should be an array."); - } - return $this; - } - - /** - * Create array from a range of cells - * - * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1") - * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist - * @param boolean $calculateFormulas Should formulas be calculated? - * @param boolean $formatData Should formatting be applied to cell values? - * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero - * True - Return rows and columns indexed by their actual row and column IDs - * @return array - */ - public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { - // Returnvalue - $returnValue = array(); - - // Identify the range that we need to extract from the worksheet - list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange); - $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1); - $minRow = $rangeStart[1]; - $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1); - $maxRow = $rangeEnd[1]; - - $maxCol++; - - // Loop through rows - for ($row = $minRow; $row <= $maxRow; ++$row) { - $c = -1; - // Loop through columns in the current row - for ($col = $minCol; $col != $maxCol; ++$col) { - $rRef = ($returnCellRef) ? $row : $row-1; - $cRef = ($returnCellRef) ? $col : ++$c; - // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen - // so we test and retrieve directly against _cellCollection - if ($this->_cellCollection->isDataSet($col.$row)) { - // Cell exists - $cell = $this->_cellCollection->getCacheData($col.$row); - if ($cell->getValue() !== null) { - if ($cell->getValue() instanceof PHPExcel_RichText) { - $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText(); - } else { - if ($calculateFormulas) { - $returnValue[$rRef][$cRef] = $cell->getCalculatedValue(); - } else { - $returnValue[$rRef][$cRef] = $cell->getValue(); - } - } - - if ($formatData) { - $style = $this->_parent->getCellXfByIndex($cell->getXfIndex()); - $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString($returnValue[$rRef][$cRef], $style->getNumberFormat()->getFormatCode()); - } - } else { - // Cell holds a NULL - $returnValue[$rRef][$cRef] = $nullValue; - } - } else { - // Cell doesn't exist - $returnValue[$rRef][$cRef] = $nullValue; - } - } - } - - // Return - return $returnValue; - } - - - /** - * Create array from a range of cells - * - * @param string $pNamedRange Name of the Named Range - * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist - * @param boolean $calculateFormulas Should formulas be calculated? - * @param boolean $formatData Should formatting be applied to cell values? - * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero - * True - Return rows and columns indexed by their actual row and column IDs - * @return array - * @throws Exception - */ - public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { - $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this); - if (!is_null($namedRange)) { - $pWorkSheet = $namedRange->getWorksheet(); - $pCellRange = $namedRange->getRange(); - - return $pWorkSheet->rangeToArray( $pCellRange, - $nullValue, $calculateFormulas, $formatData, $returnCellRef); - } - - throw new Exception('Named Range '.$pNamedRange.' does not exist.'); - } - - - /** - * Create array from worksheet - * - * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist - * @param boolean $calculateFormulas Should formulas be calculated? - * @param boolean $formatData Should formatting be applied to cell values? - * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero - * True - Return rows and columns indexed by their actual row and column IDs - * @return array - */ - public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false) { - // Garbage collect... - $this->garbageCollect(); - - // Identify the range that we need to extract from the worksheet - $maxCol = $this->getHighestColumn(); - $maxRow = $this->getHighestRow(); - - // Return - return $this->rangeToArray( 'A1:'.$maxCol.$maxRow, - $nullValue, $calculateFormulas, $formatData, $returnCellRef); - } - - /** - * Get row iterator - * - * @return PHPExcel_Worksheet_RowIterator - */ - public function getRowIterator() { - return new PHPExcel_Worksheet_RowIterator($this); - } - - /** - * Run PHPExcel garabage collector. - * - * @return PHPExcel_Worksheet - */ - public function garbageCollect() { - // Build a reference table from images -// $imageCoordinates = array(); -// $iterator = $this->getDrawingCollection()->getIterator(); -// while ($iterator->valid()) { -// $imageCoordinates[$iterator->current()->getCoordinates()] = true; -// -// $iterator->next(); -// } -// - // Lookup highest column and highest row if cells are cleaned - $highestColumn = -1; - $highestRow = 1; - - // Find cells that can be cleaned - $col = $row = array(); - foreach ($this->_cellCollection->getCellList() as $coord) { - list($c,$r) = sscanf($coord,'%[A-Z]%d'); - $row[$r] = $r; - $col[$c] = strlen($c).$c; - } - if (count($row) > 0) { - // Determine highest column and row - $highestRow = max($row); - $highestColumn = PHPExcel_Cell::columnIndexFromString(substr(max($col),1)); - } - - // Loop through column dimensions - foreach ($this->_columnDimensions as $dimension) { - $highestColumn = max($highestColumn,PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex())); - } - - // Loop through row dimensions - foreach ($this->_rowDimensions as $dimension) { - $highestRow = max($highestRow,$dimension->getRowIndex()); - } - - // Cache values - if ($highestColumn < 0) { - $this->_cachedHighestColumn = 'A'; - } else { - $this->_cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn); - } - $this->_cachedHighestRow = $highestRow; - - // Return - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - if ($this->_dirty) { - $this->_hash = md5( $this->_title . - $this->_autoFilter . - ($this->_protection->isProtectionEnabled() ? 't' : 'f') . - __CLASS__ - ); - $this->_dirty = false; - } - return $this->_hash; - } - - /** - * Extract worksheet title from range. - * - * Example: extractSheetTitle("testSheet!A1") ==> 'A1' - * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1'); - * - * @param string $pRange Range to extract title from - * @param bool $returnRange Return range? (see example) - * @return mixed - */ - public static function extractSheetTitle($pRange, $returnRange = false) { - // Sheet title included? - if (($sep = strpos($pRange, '!')) === false) { - return ''; - } - - if ($returnRange) { - return array( trim(substr($pRange, 0, $sep),"'"), - substr($pRange, $sep + 1) - ); - } - - return substr($pRange, $sep + 1); - } - - /** - * Get hyperlink - * - * @param string $pCellCoordinate Cell coordinate to get hyperlink for - */ - public function getHyperlink($pCellCoordinate = 'A1') - { - // return hyperlink if we already have one - if (isset($this->_hyperlinkCollection[$pCellCoordinate])) { - return $this->_hyperlinkCollection[$pCellCoordinate]; - } - - // else create hyperlink - $this->_hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink(); - return $this->_hyperlinkCollection[$pCellCoordinate]; - } - - /** - * Set hyperlnk - * - * @param string $pCellCoordinate Cell coordinate to insert hyperlink - * @param PHPExcel_Cell_Hyperlink $pHyperlink - * @return PHPExcel_Worksheet - */ - public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null) - { - if ($pHyperlink === null) { - unset($this->_hyperlinkCollection[$pCellCoordinate]); - } else { - $this->_hyperlinkCollection[$pCellCoordinate] = $pHyperlink; - } - return $this; - } - - /** - * Hyperlink at a specific coordinate exists? - * - * @param string $pCellCoordinate - * @return boolean - */ - public function hyperlinkExists($pCoordinate = 'A1') - { - return isset($this->_hyperlinkCollection[$pCoordinate]); - } - - /** - * Get collection of hyperlinks - * - * @return PHPExcel_Cell_Hyperlink[] - */ - public function getHyperlinkCollection() - { - return $this->_hyperlinkCollection; - } - - /** - * Get data validation - * - * @param string $pCellCoordinate Cell coordinate to get data validation for - */ - public function getDataValidation($pCellCoordinate = 'A1') - { - // return data validation if we already have one - if (isset($this->_dataValidationCollection[$pCellCoordinate])) { - return $this->_dataValidationCollection[$pCellCoordinate]; - } - - // else create data validation - $this->_dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation(); - return $this->_dataValidationCollection[$pCellCoordinate]; - } - - /** - * Set data validation - * - * @param string $pCellCoordinate Cell coordinate to insert data validation - * @param PHPExcel_Cell_DataValidation $pDataValidation - * @return PHPExcel_Worksheet - */ - public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null) - { - if ($pDataValidation === null) { - unset($this->_dataValidationCollection[$pCellCoordinate]); - } else { - $this->_dataValidationCollection[$pCellCoordinate] = $pDataValidation; - } - return $this; - } - - /** - * Data validation at a specific coordinate exists? - * - * @param string $pCellCoordinate - * @return boolean - */ - public function dataValidationExists($pCoordinate = 'A1') - { - return isset($this->_dataValidationCollection[$pCoordinate]); - } - - /** - * Get collection of data validations - * - * @return PHPExcel_Cell_DataValidation[] - */ - public function getDataValidationCollection() - { - return $this->_dataValidationCollection; - } - - /** - * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet - * - * @param string $range - * @return string Adjusted range value - */ - public function shrinkRangeToFit($range) { - $maxCol = $this->getHighestColumn(); - $maxRow = $this->getHighestRow(); - $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol); - - $rangeBlocks = explode(' ',$range); - foreach ($rangeBlocks as &$rangeSet) { - $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet); - - if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) { $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); } - if ($rangeBoundaries[0][1] > $maxRow) { $rangeBoundaries[0][1] = $maxRow; } - if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) { $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol); } - if ($rangeBoundaries[1][1] > $maxRow) { $rangeBoundaries[1][1] = $maxRow; } - $rangeSet = $rangeBoundaries[0][0].$rangeBoundaries[0][1].':'.$rangeBoundaries[1][0].$rangeBoundaries[1][1]; - } - unset($rangeSet); - $stRange = implode(' ',$rangeBlocks); - - return $stRange; - } - - - /** - * Get tab color - * - * @return PHPExcel_Style_Color - */ - public function getTabColor() - { - if (is_null($this->_tabColor)) - $this->_tabColor = new PHPExcel_Style_Color(); - - return $this->_tabColor; - } - - /** - * Reset tab color - * - * @return PHPExcel_Worksheet - */ - public function resetTabColor() - { - $this->_tabColor = null; - unset($this->_tabColor); - - return $this; - } - - /** - * Tab color set? - * - * @return boolean - */ - public function isTabColorSet() - { - return !is_null($this->_tabColor); - } - - /** - * Copy worksheet (!= clone!) - * - * @return PHPExcel_Worksheet - */ - public function copy() { - $copied = clone $this; - - return $copied; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - foreach ($this as $key => $val) { - if ($key == '_parent') { - continue; - } - - if (is_object($val) || (is_array($val))) { - if ($key == '_cellCollection') { - $newCollection = clone $this->_cellCollection; - $newCollection->copyCellCollection($this); - $this->_cellCollection = $newCollection; - } elseif ($key == '_drawingCollection') { - $newCollection = clone $this->_drawingCollection; - $this->_drawingCollection = $newCollection; - } else { - $this->{$key} = unserialize(serialize($val)); - } - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/BaseDrawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/BaseDrawing.php deleted file mode 100644 index 6d6c56a653..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/BaseDrawing.php +++ /dev/null @@ -1,485 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_BaseDrawing - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable -{ - /** - * Image counter - * - * @var int - */ - private static $_imageCounter = 0; - - /** - * Image index - * - * @var int - */ - private $_imageIndex = 0; - - /** - * Name - * - * @var string - */ - protected $_name; - - /** - * Description - * - * @var string - */ - protected $_description; - - /** - * Worksheet - * - * @var PHPExcel_Worksheet - */ - protected $_worksheet; - - /** - * Coordinates - * - * @var string - */ - protected $_coordinates; - - /** - * Offset X - * - * @var int - */ - protected $_offsetX; - - /** - * Offset Y - * - * @var int - */ - protected $_offsetY; - - /** - * Width - * - * @var int - */ - protected $_width; - - /** - * Height - * - * @var int - */ - protected $_height; - - /** - * Proportional resize - * - * @var boolean - */ - protected $_resizeProportional; - - /** - * Rotation - * - * @var int - */ - protected $_rotation; - - /** - * Shadow - * - * @var PHPExcel_Worksheet_Drawing_Shadow - */ - protected $_shadow; - - /** - * Create a new PHPExcel_Worksheet_BaseDrawing - */ - public function __construct() - { - // Initialise values - $this->_name = ''; - $this->_description = ''; - $this->_worksheet = null; - $this->_coordinates = 'A1'; - $this->_offsetX = 0; - $this->_offsetY = 0; - $this->_width = 0; - $this->_height = 0; - $this->_resizeProportional = true; - $this->_rotation = 0; - $this->_shadow = new PHPExcel_Worksheet_Drawing_Shadow(); - - // Set image index - self::$_imageCounter++; - $this->_imageIndex = self::$_imageCounter; - } - - /** - * Get image index - * - * @return int - */ - public function getImageIndex() { - return $this->_imageIndex; - } - - /** - * Get Name - * - * @return string - */ - public function getName() { - return $this->_name; - } - - /** - * Set Name - * - * @param string $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setName($pValue = '') { - $this->_name = $pValue; - return $this; - } - - /** - * Get Description - * - * @return string - */ - public function getDescription() { - return $this->_description; - } - - /** - * Set Description - * - * @param string $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setDescription($pValue = '') { - $this->_description = $pValue; - return $this; - } - - /** - * Get Worksheet - * - * @return PHPExcel_Worksheet - */ - public function getWorksheet() { - return $this->_worksheet; - } - - /** - * Set Worksheet - * - * @param PHPExcel_Worksheet $pValue - * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet? - * @throws Exception - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false) { - if (is_null($this->_worksheet)) { - // Add drawing to PHPExcel_Worksheet - $this->_worksheet = $pValue; - $this->_worksheet->getCell($this->_coordinates); - $this->_worksheet->getDrawingCollection()->append($this); - } else { - if ($pOverrideOld) { - // Remove drawing from old PHPExcel_Worksheet - $iterator = $this->_worksheet->getDrawingCollection()->getIterator(); - - while ($iterator->valid()) { - if ($iterator->current()->getHashCode() == $this->getHashCode()) { - $this->_worksheet->getDrawingCollection()->offsetUnset( $iterator->key() ); - $this->_worksheet = null; - break; - } - } - - // Set new PHPExcel_Worksheet - $this->setWorksheet($pValue); - } else { - throw new Exception("A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet."); - } - } - return $this; - } - - /** - * Get Coordinates - * - * @return string - */ - public function getCoordinates() { - return $this->_coordinates; - } - - /** - * Set Coordinates - * - * @param string $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setCoordinates($pValue = 'A1') { - $this->_coordinates = $pValue; - return $this; - } - - /** - * Get OffsetX - * - * @return int - */ - public function getOffsetX() { - return $this->_offsetX; - } - - /** - * Set OffsetX - * - * @param int $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setOffsetX($pValue = 0) { - $this->_offsetX = $pValue; - return $this; - } - - /** - * Get OffsetY - * - * @return int - */ - public function getOffsetY() { - return $this->_offsetY; - } - - /** - * Set OffsetY - * - * @param int $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setOffsetY($pValue = 0) { - $this->_offsetY = $pValue; - return $this; - } - - /** - * Get Width - * - * @return int - */ - public function getWidth() { - return $this->_width; - } - - /** - * Set Width - * - * @param int $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setWidth($pValue = 0) { - // Resize proportional? - if ($this->_resizeProportional && $pValue != 0) { - $ratio = $this->_height / $this->_width; - $this->_height = round($ratio * $pValue); - } - - // Set width - $this->_width = $pValue; - - return $this; - } - - /** - * Get Height - * - * @return int - */ - public function getHeight() { - return $this->_height; - } - - /** - * Set Height - * - * @param int $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setHeight($pValue = 0) { - // Resize proportional? - if ($this->_resizeProportional && $pValue != 0) { - $ratio = $this->_width / $this->_height; - $this->_width = round($ratio * $pValue); - } - - // Set height - $this->_height = $pValue; - - return $this; - } - - /** - * Set width and height with proportional resize - * Example: - * <code> - * $objDrawing->setResizeProportional(true); - * $objDrawing->setWidthAndHeight(160,120); - * </code> - * - * @author Vincent@luo MSN:kele_100@hotmail.com - * @param int $width - * @param int $height - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setWidthAndHeight($width = 0, $height = 0) { - $xratio = $width / $this->_width; - $yratio = $height / $this->_height; - if ($this->_resizeProportional && !($width == 0 || $height == 0)) { - if (($xratio * $this->_height) < $height) { - $this->_height = ceil($xratio * $this->_height); - $this->_width = $width; - } else { - $this->_width = ceil($yratio * $this->_width); - $this->_height = $height; - } - } - return $this; - } - - /** - * Get ResizeProportional - * - * @return boolean - */ - public function getResizeProportional() { - return $this->_resizeProportional; - } - - /** - * Set ResizeProportional - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setResizeProportional($pValue = true) { - $this->_resizeProportional = $pValue; - return $this; - } - - /** - * Get Rotation - * - * @return int - */ - public function getRotation() { - return $this->_rotation; - } - - /** - * Set Rotation - * - * @param int $pValue - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setRotation($pValue = 0) { - $this->_rotation = $pValue; - return $this; - } - - /** - * Get Shadow - * - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function getShadow() { - return $this->_shadow; - } - - /** - * Set Shadow - * - * @param PHPExcel_Worksheet_Drawing_Shadow $pValue - * @throws Exception - * @return PHPExcel_Worksheet_BaseDrawing - */ - public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null) { - $this->_shadow = $pValue; - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_name - . $this->_description - . $this->_worksheet->getHashCode() - . $this->_coordinates - . $this->_offsetX - . $this->_offsetY - . $this->_width - . $this->_height - . $this->_rotation - . $this->_shadow->getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/CellIterator.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/CellIterator.php deleted file mode 100644 index 75904eab94..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/CellIterator.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_CellIterator - * - * Used to iterate rows in a PHPExcel_Worksheet - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_CellIterator extends CachingIterator -{ - /** - * PHPExcel_Worksheet to iterate - * - * @var PHPExcel_Worksheet - */ - private $_subject; - - /** - * Row index - * - * @var int - */ - private $_rowIndex; - - /** - * Current iterator position - * - * @var int - */ - private $_position = 0; - - /** - * Loop only existing cells - * - * @var boolean - */ - private $_onlyExistingCells = true; - - /** - * Create a new cell iterator - * - * @param PHPExcel_Worksheet $subject - * @param int $rowIndex - */ - public function __construct(PHPExcel_Worksheet $subject = null, $rowIndex = 1) { - // Set subject and row index - $this->_subject = $subject; - $this->_rowIndex = $rowIndex; - } - - /** - * Destructor - */ - public function __destruct() { - unset($this->_subject); - } - - /** - * Rewind iterator - */ - public function rewind() { - $this->_position = 0; - } - - /** - * Current PHPExcel_Cell - * - * @return PHPExcel_Cell - */ - public function current() { - return $this->_subject->getCellByColumnAndRow($this->_position, $this->_rowIndex); - } - - /** - * Current key - * - * @return int - */ - public function key() { - return $this->_position; - } - - /** - * Next value - */ - public function next() { - ++$this->_position; - } - - /** - * More PHPExcel_Cell instances available? - * - * @return boolean - */ - public function valid() { - // columnIndexFromString() returns an index based at one, - // treat it as a count when comparing it to the base zero - // position. - $columnCount = PHPExcel_Cell::columnIndexFromString($this->_subject->getHighestColumn()); - - if ($this->_onlyExistingCells) { - // If we aren't looking at an existing cell, either - // because the first column doesn't exist or next() has - // been called onto a nonexistent cell, then loop until we - // find one, or pass the last column. - while ($this->_position < $columnCount && - !$this->_subject->cellExistsByColumnAndRow($this->_position, $this->_rowIndex)) { - ++$this->_position; - } - } - - return $this->_position < $columnCount; - } - - /** - * Get loop only existing cells - * - * @return boolean - */ - public function getIterateOnlyExistingCells() { - return $this->_onlyExistingCells; - } - - /** - * Set loop only existing cells - * - * @return boolean - */ - public function setIterateOnlyExistingCells($value = true) { - $this->_onlyExistingCells = $value; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/ColumnDimension.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/ColumnDimension.php deleted file mode 100644 index 227b4df102..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/ColumnDimension.php +++ /dev/null @@ -1,266 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_ColumnDimension - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_ColumnDimension -{ - /** - * Column index - * - * @var int - */ - private $_columnIndex; - - /** - * Column width - * - * When this is set to a negative value, the column width should be ignored by IWriter - * - * @var double - */ - private $_width = -1; - - /** - * Auto size? - * - * @var bool - */ - private $_autoSize = false; - - /** - * Visible? - * - * @var bool - */ - private $_visible = true; - - /** - * Outline level - * - * @var int - */ - private $_outlineLevel = 0; - - /** - * Collapsed - * - * @var bool - */ - private $_collapsed = false; - - /** - * Index to cellXf - * - * @var int - */ - private $_xfIndex; - - /** - * Create a new PHPExcel_Worksheet_ColumnDimension - * - * @param string $pIndex Character column index - */ - public function __construct($pIndex = 'A') - { - // Initialise values - $this->_columnIndex = $pIndex; - - // set default index to cellXf - $this->_xfIndex = 0; - } - - /** - * Get ColumnIndex - * - * @return string - */ - public function getColumnIndex() { - return $this->_columnIndex; - } - - /** - * Set ColumnIndex - * - * @param string $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setColumnIndex($pValue) { - $this->_columnIndex = $pValue; - return $this; - } - - /** - * Get Width - * - * @return double - */ - public function getWidth() { - return $this->_width; - } - - /** - * Set Width - * - * @param double $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setWidth($pValue = -1) { - $this->_width = $pValue; - return $this; - } - - /** - * Get Auto Size - * - * @return bool - */ - public function getAutoSize() { - return $this->_autoSize; - } - - /** - * Set Auto Size - * - * @param bool $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setAutoSize($pValue = false) { - $this->_autoSize = $pValue; - return $this; - } - - /** - * Get Visible - * - * @return bool - */ - public function getVisible() { - return $this->_visible; - } - - /** - * Set Visible - * - * @param bool $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setVisible($pValue = true) { - $this->_visible = $pValue; - return $this; - } - - /** - * Get Outline Level - * - * @return int - */ - public function getOutlineLevel() { - return $this->_outlineLevel; - } - - /** - * Set Outline Level - * - * Value must be between 0 and 7 - * - * @param int $pValue - * @throws Exception - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setOutlineLevel($pValue) { - if ($pValue < 0 || $pValue > 7) { - throw new Exception("Outline level must range between 0 and 7."); - } - - $this->_outlineLevel = $pValue; - return $this; - } - - /** - * Get Collapsed - * - * @return bool - */ - public function getCollapsed() { - return $this->_collapsed; - } - - /** - * Set Collapsed - * - * @param bool $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setCollapsed($pValue = true) { - $this->_collapsed = $pValue; - return $this; - } - - /** - * Get index to cellXf - * - * @return int - */ - public function getXfIndex() - { - return $this->_xfIndex; - } - - /** - * Set index to cellXf - * - * @param int $pValue - * @return PHPExcel_Worksheet_ColumnDimension - */ - public function setXfIndex($pValue = 0) - { - $this->_xfIndex = $pValue; - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing.php deleted file mode 100644 index 3a24b8a32e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_Drawing - * - * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_Drawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable -{ - /** - * Path - * - * @var string - */ - private $_path; - - /** - * Create a new PHPExcel_Worksheet_Drawing - */ - public function __construct() - { - // Initialise values - $this->_path = ''; - - // Initialize parent - parent::__construct(); - } - - /** - * Get Filename - * - * @return string - */ - public function getFilename() { - return basename($this->_path); - } - - /** - * Get indexed filename (using image index) - * - * @return string - */ - public function getIndexedFilename() { - $fileName = $this->getFilename(); - $fileName = str_replace(' ', '_', $fileName); - return str_replace('.' . $this->getExtension(), '', $fileName) . $this->getImageIndex() . '.' . $this->getExtension(); - } - - /** - * Get Extension - * - * @return string - */ - public function getExtension() { - $exploded = explode(".", basename($this->_path)); - return $exploded[count($exploded) - 1]; - } - - /** - * Get Path - * - * @return string - */ - public function getPath() { - return $this->_path; - } - - /** - * Set Path - * - * @param string $pValue File path - * @param boolean $pVerifyFile Verify file - * @throws Exception - * @return PHPExcel_Worksheet_Drawing - */ - public function setPath($pValue = '', $pVerifyFile = true) { - if ($pVerifyFile) { - if (file_exists($pValue)) { - $this->_path = $pValue; - - if ($this->_width == 0 && $this->_height == 0) { - // Get width/height - list($this->_width, $this->_height) = getimagesize($pValue); - } - } else { - throw new Exception("File $pValue not found!"); - } - } else { - $this->_path = $pValue; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_path - . parent::getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing/Shadow.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing/Shadow.php deleted file mode 100644 index 2366a799b0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Drawing/Shadow.php +++ /dev/null @@ -1,288 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_Drawing_Shadow - * - * @category PHPExcel - * @package PHPExcel_Worksheet_Drawing - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable -{ - /* Shadow alignment */ - const SHADOW_BOTTOM = 'b'; - const SHADOW_BOTTOM_LEFT = 'bl'; - const SHADOW_BOTTOM_RIGHT = 'br'; - const SHADOW_CENTER = 'ctr'; - const SHADOW_LEFT = 'l'; - const SHADOW_TOP = 't'; - const SHADOW_TOP_LEFT = 'tl'; - const SHADOW_TOP_RIGHT = 'tr'; - - /** - * Visible - * - * @var boolean - */ - private $_visible; - - /** - * Blur radius - * - * Defaults to 6 - * - * @var int - */ - private $_blurRadius; - - /** - * Shadow distance - * - * Defaults to 2 - * - * @var int - */ - private $_distance; - - /** - * Shadow direction (in degrees) - * - * @var int - */ - private $_direction; - - /** - * Shadow alignment - * - * @var int - */ - private $_alignment; - - /** - * Color - * - * @var PHPExcel_Style_Color - */ - private $_color; - - /** - * Alpha - * - * @var int - */ - private $_alpha; - - /** - * Create a new PHPExcel_Worksheet_Drawing_Shadow - */ - public function __construct() - { - // Initialise values - $this->_visible = false; - $this->_blurRadius = 6; - $this->_distance = 2; - $this->_direction = 0; - $this->_alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT; - $this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK); - $this->_alpha = 50; - } - - /** - * Get Visible - * - * @return boolean - */ - public function getVisible() { - return $this->_visible; - } - - /** - * Set Visible - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setVisible($pValue = false) { - $this->_visible = $pValue; - return $this; - } - - /** - * Get Blur radius - * - * @return int - */ - public function getBlurRadius() { - return $this->_blurRadius; - } - - /** - * Set Blur radius - * - * @param int $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setBlurRadius($pValue = 6) { - $this->_blurRadius = $pValue; - return $this; - } - - /** - * Get Shadow distance - * - * @return int - */ - public function getDistance() { - return $this->_distance; - } - - /** - * Set Shadow distance - * - * @param int $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setDistance($pValue = 2) { - $this->_distance = $pValue; - return $this; - } - - /** - * Get Shadow direction (in degrees) - * - * @return int - */ - public function getDirection() { - return $this->_direction; - } - - /** - * Set Shadow direction (in degrees) - * - * @param int $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setDirection($pValue = 0) { - $this->_direction = $pValue; - return $this; - } - - /** - * Get Shadow alignment - * - * @return int - */ - public function getAlignment() { - return $this->_alignment; - } - - /** - * Set Shadow alignment - * - * @param int $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setAlignment($pValue = 0) { - $this->_alignment = $pValue; - return $this; - } - - /** - * Get Color - * - * @return PHPExcel_Style_Color - */ - public function getColor() { - return $this->_color; - } - - /** - * Set Color - * - * @param PHPExcel_Style_Color $pValue - * @throws Exception - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setColor(PHPExcel_Style_Color $pValue = null) { - $this->_color = $pValue; - return $this; - } - - /** - * Get Alpha - * - * @return int - */ - public function getAlpha() { - return $this->_alpha; - } - - /** - * Set Alpha - * - * @param int $pValue - * @return PHPExcel_Worksheet_Drawing_Shadow - */ - public function setAlpha($pValue = 0) { - $this->_alpha = $pValue; - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - ($this->_visible ? 't' : 'f') - . $this->_blurRadius - . $this->_distance - . $this->_direction - . $this->_alignment - . $this->_color->getHashCode() - . $this->_alpha - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooter.php deleted file mode 100644 index 8cae5526d4..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooter.php +++ /dev/null @@ -1,465 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_HeaderFooter - * - * <code> - * Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970: - * - * There are a number of formatting codes that can be written inline with the actual header / footer text, which - * affect the formatting in the header or footer. - * - * Example: This example shows the text "Center Bold Header" on the first line (center section), and the date on - * the second line (center section). - * &CCenter &"-,Bold"Bold&"-,Regular"Header_x000A_&D - * - * General Rules: - * There is no required order in which these codes must appear. - * - * The first occurrence of the following codes turns the formatting ON, the second occurrence turns it OFF again: - * - strikethrough - * - superscript - * - subscript - * Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, - * while the first is ON. - * &L - code for "left section" (there are three header / footer locations, "left", "center", and "right"). When - * two or more occurrences of this section marker exist, the contents from all markers are concatenated, in the - * order of appearance, and placed into the left section. - * &P - code for "current page #" - * &N - code for "total pages" - * &font size - code for "text font size", where font size is a font size in points. - * &K - code for "text font color" - * RGB Color is specified as RRGGBB - * Theme Color is specifed as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade - * value, NN is the tint/shade value. - * &S - code for "text strikethrough" on / off - * &X - code for "text super script" on / off - * &Y - code for "text subscript" on / off - * &C - code for "center section". When two or more occurrences of this section marker exist, the contents - * from all markers are concatenated, in the order of appearance, and placed into the center section. - * - * &D - code for "date" - * &T - code for "time" - * &G - code for "picture as background" - * &U - code for "text single underline" - * &E - code for "double underline" - * &R - code for "right section". When two or more occurrences of this section marker exist, the contents - * from all markers are concatenated, in the order of appearance, and placed into the right section. - * &Z - code for "this workbook's file path" - * &F - code for "this workbook's file name" - * &A - code for "sheet tab name" - * &+ - code for add to page #. - * &- - code for subtract from page #. - * &"font name,font type" - code for "text font name" and "text font type", where font name and font type - * are strings specifying the name and type of the font, separated by a comma. When a hyphen appears in font - * name, it means "none specified". Both of font name and font type can be localized values. - * &"-,Bold" - code for "bold font style" - * &B - also means "bold font style". - * &"-,Regular" - code for "regular font style" - * &"-,Italic" - code for "italic font style" - * &I - also means "italic font style" - * &"-,Bold Italic" code for "bold italic font style" - * &O - code for "outline style" - * &H - code for "shadow style" - * </code> - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_HeaderFooter -{ - /* Header/footer image location */ - const IMAGE_HEADER_LEFT = 'LH'; - const IMAGE_HEADER_CENTER = 'CH'; - const IMAGE_HEADER_RIGHT = 'RH'; - const IMAGE_FOOTER_LEFT = 'LF'; - const IMAGE_FOOTER_CENTER = 'CF'; - const IMAGE_FOOTER_RIGHT = 'RF'; - - /** - * OddHeader - * - * @var string - */ - private $_oddHeader = ''; - - /** - * OddFooter - * - * @var string - */ - private $_oddFooter = ''; - - /** - * EvenHeader - * - * @var string - */ - private $_evenHeader = ''; - - /** - * EvenFooter - * - * @var string - */ - private $_evenFooter = ''; - - /** - * FirstHeader - * - * @var string - */ - private $_firstHeader = ''; - - /** - * FirstFooter - * - * @var string - */ - private $_firstFooter = ''; - - /** - * Different header for Odd/Even, defaults to false - * - * @var boolean - */ - private $_differentOddEven = false; - - /** - * Different header for first page, defaults to false - * - * @var boolean - */ - private $_differentFirst = false; - - /** - * Scale with document, defaults to true - * - * @var boolean - */ - private $_scaleWithDocument = true; - - /** - * Align with margins, defaults to true - * - * @var boolean - */ - private $_alignWithMargins = true; - - /** - * Header/footer images - * - * @var PHPExcel_Worksheet_HeaderFooterDrawing[] - */ - private $_headerFooterImages = array(); - - /** - * Create a new PHPExcel_Worksheet_HeaderFooter - */ - public function __construct() - { - } - - /** - * Get OddHeader - * - * @return string - */ - public function getOddHeader() { - return $this->_oddHeader; - } - - /** - * Set OddHeader - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setOddHeader($pValue) { - $this->_oddHeader = $pValue; - return $this; - } - - /** - * Get OddFooter - * - * @return string - */ - public function getOddFooter() { - return $this->_oddFooter; - } - - /** - * Set OddFooter - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setOddFooter($pValue) { - $this->_oddFooter = $pValue; - return $this; - } - - /** - * Get EvenHeader - * - * @return string - */ - public function getEvenHeader() { - return $this->_evenHeader; - } - - /** - * Set EvenHeader - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setEvenHeader($pValue) { - $this->_evenHeader = $pValue; - return $this; - } - - /** - * Get EvenFooter - * - * @return string - */ - public function getEvenFooter() { - return $this->_evenFooter; - } - - /** - * Set EvenFooter - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setEvenFooter($pValue) { - $this->_evenFooter = $pValue; - return $this; - } - - /** - * Get FirstHeader - * - * @return string - */ - public function getFirstHeader() { - return $this->_firstHeader; - } - - /** - * Set FirstHeader - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setFirstHeader($pValue) { - $this->_firstHeader = $pValue; - return $this; - } - - /** - * Get FirstFooter - * - * @return string - */ - public function getFirstFooter() { - return $this->_firstFooter; - } - - /** - * Set FirstFooter - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setFirstFooter($pValue) { - $this->_firstFooter = $pValue; - return $this; - } - - /** - * Get DifferentOddEven - * - * @return boolean - */ - public function getDifferentOddEven() { - return $this->_differentOddEven; - } - - /** - * Set DifferentOddEven - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setDifferentOddEven($pValue = false) { - $this->_differentOddEven = $pValue; - return $this; - } - - /** - * Get DifferentFirst - * - * @return boolean - */ - public function getDifferentFirst() { - return $this->_differentFirst; - } - - /** - * Set DifferentFirst - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setDifferentFirst($pValue = false) { - $this->_differentFirst = $pValue; - return $this; - } - - /** - * Get ScaleWithDocument - * - * @return boolean - */ - public function getScaleWithDocument() { - return $this->_scaleWithDocument; - } - - /** - * Set ScaleWithDocument - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setScaleWithDocument($pValue = true) { - $this->_scaleWithDocument = $pValue; - return $this; - } - - /** - * Get AlignWithMargins - * - * @return boolean - */ - public function getAlignWithMargins() { - return $this->_alignWithMargins; - } - - /** - * Set AlignWithMargins - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setAlignWithMargins($pValue = true) { - $this->_alignWithMargins = $pValue; - return $this; - } - - /** - * Add header/footer image - * - * @param PHPExcel_Worksheet_HeaderFooterDrawing $image - * @param string $location - * @throws Exception - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) { - $this->_headerFooterImages[$location] = $image; - return $this; - } - - /** - * Remove header/footer image - * - * @param string $location - * @throws Exception - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function removeImage($location = self::IMAGE_HEADER_LEFT) { - if (isset($this->_headerFooterImages[$location])) { - unset($this->_headerFooterImages[$location]); - } - return $this; - } - - /** - * Set header/footer images - * - * @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images - * @throws Exception - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setImages($images) { - if (!is_array($images)) { - throw new Exception('Invalid parameter!'); - } - - $this->_headerFooterImages = $images; - return $this; - } - - /** - * Get header/footer images - * - * @return PHPExcel_Worksheet_HeaderFooterDrawing[] - */ - public function getImages() { - // Sort array - $images = array(); - if (isset($this->_headerFooterImages[self::IMAGE_HEADER_LEFT])) $images[self::IMAGE_HEADER_LEFT] = $this->_headerFooterImages[self::IMAGE_HEADER_LEFT]; - if (isset($this->_headerFooterImages[self::IMAGE_HEADER_CENTER])) $images[self::IMAGE_HEADER_CENTER] = $this->_headerFooterImages[self::IMAGE_HEADER_CENTER]; - if (isset($this->_headerFooterImages[self::IMAGE_HEADER_RIGHT])) $images[self::IMAGE_HEADER_RIGHT] = $this->_headerFooterImages[self::IMAGE_HEADER_RIGHT]; - if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_LEFT])) $images[self::IMAGE_FOOTER_LEFT] = $this->_headerFooterImages[self::IMAGE_FOOTER_LEFT]; - if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_CENTER])) $images[self::IMAGE_FOOTER_CENTER] = $this->_headerFooterImages[self::IMAGE_FOOTER_CENTER]; - if (isset($this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT])) $images[self::IMAGE_FOOTER_RIGHT] = $this->_headerFooterImages[self::IMAGE_FOOTER_RIGHT]; - $this->_headerFooterImages = $images; - - return $this->_headerFooterImages; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooterDrawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooterDrawing.php deleted file mode 100644 index 15e1424aa0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/HeaderFooterDrawing.php +++ /dev/null @@ -1,350 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_HeaderFooterDrawing - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_HeaderFooterDrawing extends PHPExcel_Worksheet_Drawing implements PHPExcel_IComparable -{ - /** - * Path - * - * @var string - */ - private $_path; - - /** - * Name - * - * @var string - */ - protected $_name; - - /** - * Offset X - * - * @var int - */ - protected $_offsetX; - - /** - * Offset Y - * - * @var int - */ - protected $_offsetY; - - /** - * Width - * - * @var int - */ - protected $_width; - - /** - * Height - * - * @var int - */ - protected $_height; - - /** - * Proportional resize - * - * @var boolean - */ - protected $_resizeProportional; - - /** - * Create a new PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function __construct() - { - // Initialise values - $this->_path = ''; - $this->_name = ''; - $this->_offsetX = 0; - $this->_offsetY = 0; - $this->_width = 0; - $this->_height = 0; - $this->_resizeProportional = true; - } - - /** - * Get Name - * - * @return string - */ - public function getName() { - return $this->_name; - } - - /** - * Set Name - * - * @param string $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setName($pValue = '') { - $this->_name = $pValue; - return $this; - } - - /** - * Get OffsetX - * - * @return int - */ - public function getOffsetX() { - return $this->_offsetX; - } - - /** - * Set OffsetX - * - * @param int $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setOffsetX($pValue = 0) { - $this->_offsetX = $pValue; - return $this; - } - - /** - * Get OffsetY - * - * @return int - */ - public function getOffsetY() { - return $this->_offsetY; - } - - /** - * Set OffsetY - * - * @param int $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setOffsetY($pValue = 0) { - $this->_offsetY = $pValue; - return $this; - } - - /** - * Get Width - * - * @return int - */ - public function getWidth() { - return $this->_width; - } - - /** - * Set Width - * - * @param int $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setWidth($pValue = 0) { - // Resize proportional? - if ($this->_resizeProportional && $pValue != 0) { - $ratio = $this->_width / $this->_height; - $this->_height = round($ratio * $pValue); - } - - // Set width - $this->_width = $pValue; - - return $this; - } - - /** - * Get Height - * - * @return int - */ - public function getHeight() { - return $this->_height; - } - - /** - * Set Height - * - * @param int $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setHeight($pValue = 0) { - // Resize proportional? - if ($this->_resizeProportional && $pValue != 0) { - $ratio = $this->_width / $this->_height; - $this->_width = round($ratio * $pValue); - } - - // Set height - $this->_height = $pValue; - - return $this; - } - - /** - * Set width and height with proportional resize - * Example: - * <code> - * $objDrawing->setResizeProportional(true); - * $objDrawing->setWidthAndHeight(160,120); - * </code> - * - * @author Vincent@luo MSN:kele_100@hotmail.com - * @param int $width - * @param int $height - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setWidthAndHeight($width = 0, $height = 0) { - $xratio = $width / $this->_width; - $yratio = $height / $this->_height; - if ($this->_resizeProportional && !($width == 0 || $height == 0)) { - if (($xratio * $this->_height) < $height) { - $this->_height = ceil($xratio * $this->_height); - $this->_width = $width; - } else { - $this->_width = ceil($yratio * $this->_width); - $this->_height = $height; - } - } - return $this; - } - - /** - * Get ResizeProportional - * - * @return boolean - */ - public function getResizeProportional() { - return $this->_resizeProportional; - } - - /** - * Set ResizeProportional - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setResizeProportional($pValue = true) { - $this->_resizeProportional = $pValue; - return $this; - } - - /** - * Get Filename - * - * @return string - */ - public function getFilename() { - return basename($this->_path); - } - - /** - * Get Extension - * - * @return string - */ - public function getExtension() { - $parts = explode(".", basename($this->_path)); - return end($parts); - } - - /** - * Get Path - * - * @return string - */ - public function getPath() { - return $this->_path; - } - - /** - * Set Path - * - * @param string $pValue File path - * @param boolean $pVerifyFile Verify file - * @throws Exception - * @return PHPExcel_Worksheet_HeaderFooterDrawing - */ - public function setPath($pValue = '', $pVerifyFile = true) { - if ($pVerifyFile) { - if (file_exists($pValue)) { - $this->_path = $pValue; - - if ($this->_width == 0 && $this->_height == 0) { - // Get width/height - list($this->_width, $this->_height) = getimagesize($pValue); - } - } else { - throw new Exception("File $pValue not found!"); - } - } else { - $this->_path = $pValue; - } - return $this; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_path - . $this->_name - . $this->_offsetX - . $this->_offsetY - . $this->_width - . $this->_height - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/MemoryDrawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/MemoryDrawing.php deleted file mode 100644 index 71ac251041..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/MemoryDrawing.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_MemoryDrawing - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_MemoryDrawing extends PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable -{ - /* Rendering functions */ - const RENDERING_DEFAULT = 'imagepng'; - const RENDERING_PNG = 'imagepng'; - const RENDERING_GIF = 'imagegif'; - const RENDERING_JPEG = 'imagejpeg'; - - /* MIME types */ - const MIMETYPE_DEFAULT = 'image/png'; - const MIMETYPE_PNG = 'image/png'; - const MIMETYPE_GIF = 'image/gif'; - const MIMETYPE_JPEG = 'image/jpeg'; - - /** - * Image resource - * - * @var resource - */ - private $_imageResource; - - /** - * Rendering function - * - * @var string - */ - private $_renderingFunction; - - /** - * Mime type - * - * @var string - */ - private $_mimeType; - - /** - * Unique name - * - * @var string - */ - private $_uniqueName; - - /** - * Create a new PHPExcel_Worksheet_MemoryDrawing - */ - public function __construct() - { - // Initialise values - $this->_imageResource = null; - $this->_renderingFunction = self::RENDERING_DEFAULT; - $this->_mimeType = self::MIMETYPE_DEFAULT; - $this->_uniqueName = md5(rand(0, 9999). time() . rand(0, 9999)); - - // Initialize parent - parent::__construct(); - } - - /** - * Get image resource - * - * @return resource - */ - public function getImageResource() { - return $this->_imageResource; - } - - /** - * Set image resource - * - * @param $value resource - * @return PHPExcel_Worksheet_MemoryDrawing - */ - public function setImageResource($value = null) { - $this->_imageResource = $value; - - if (!is_null($this->_imageResource)) { - // Get width/height - $this->_width = imagesx($this->_imageResource); - $this->_height = imagesy($this->_imageResource); - } - return $this; - } - - /** - * Get rendering function - * - * @return string - */ - public function getRenderingFunction() { - return $this->_renderingFunction; - } - - /** - * Set rendering function - * - * @param string $value - * @return PHPExcel_Worksheet_MemoryDrawing - */ - public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT) { - $this->_renderingFunction = $value; - return $this; - } - - /** - * Get mime type - * - * @return string - */ - public function getMimeType() { - return $this->_mimeType; - } - - /** - * Set mime type - * - * @param string $value - * @return PHPExcel_Worksheet_MemoryDrawing - */ - public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT) { - $this->_mimeType = $value; - return $this; - } - - /** - * Get indexed filename (using image index) - * - * @return string - */ - public function getIndexedFilename() { - $extension = strtolower($this->getMimeType()); - $extension = explode('/', $extension); - $extension = $extension[1]; - - return $this->_uniqueName . $this->getImageIndex() . '.' . $extension; - } - - /** - * Get hash code - * - * @return string Hash code - */ - public function getHashCode() { - return md5( - $this->_renderingFunction - . $this->_mimeType - . $this->_uniqueName - . parent::getHashCode() - . __CLASS__ - ); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageMargins.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageMargins.php deleted file mode 100644 index 6490f61aeb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageMargins.php +++ /dev/null @@ -1,220 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_PageMargins - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_PageMargins -{ - /** - * Left - * - * @var double - */ - private $_left = 0.7; - - /** - * Right - * - * @var double - */ - private $_right = 0.7; - - /** - * Top - * - * @var double - */ - private $_top = 0.75; - - /** - * Bottom - * - * @var double - */ - private $_bottom = 0.75; - - /** - * Header - * - * @var double - */ - private $_header = 0.3; - - /** - * Footer - * - * @var double - */ - private $_footer = 0.3; - - /** - * Create a new PHPExcel_Worksheet_PageMargins - */ - public function __construct() - { - } - - /** - * Get Left - * - * @return double - */ - public function getLeft() { - return $this->_left; - } - - /** - * Set Left - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setLeft($pValue) { - $this->_left = $pValue; - return $this; - } - - /** - * Get Right - * - * @return double - */ - public function getRight() { - return $this->_right; - } - - /** - * Set Right - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setRight($pValue) { - $this->_right = $pValue; - return $this; - } - - /** - * Get Top - * - * @return double - */ - public function getTop() { - return $this->_top; - } - - /** - * Set Top - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setTop($pValue) { - $this->_top = $pValue; - return $this; - } - - /** - * Get Bottom - * - * @return double - */ - public function getBottom() { - return $this->_bottom; - } - - /** - * Set Bottom - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setBottom($pValue) { - $this->_bottom = $pValue; - return $this; - } - - /** - * Get Header - * - * @return double - */ - public function getHeader() { - return $this->_header; - } - - /** - * Set Header - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setHeader($pValue) { - $this->_header = $pValue; - return $this; - } - - /** - * Get Footer - * - * @return double - */ - public function getFooter() { - return $this->_footer; - } - - /** - * Set Footer - * - * @param double $pValue - * @return PHPExcel_Worksheet_PageMargins - */ - public function setFooter($pValue) { - $this->_footer = $pValue; - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageSetup.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageSetup.php deleted file mode 100644 index beeaeeacfb..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/PageSetup.php +++ /dev/null @@ -1,798 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_PageSetup - * - * <code> - * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988: - * - * 1 = Letter paper (8.5 in. by 11 in.) - * 2 = Letter small paper (8.5 in. by 11 in.) - * 3 = Tabloid paper (11 in. by 17 in.) - * 4 = Ledger paper (17 in. by 11 in.) - * 5 = Legal paper (8.5 in. by 14 in.) - * 6 = Statement paper (5.5 in. by 8.5 in.) - * 7 = Executive paper (7.25 in. by 10.5 in.) - * 8 = A3 paper (297 mm by 420 mm) - * 9 = A4 paper (210 mm by 297 mm) - * 10 = A4 small paper (210 mm by 297 mm) - * 11 = A5 paper (148 mm by 210 mm) - * 12 = B4 paper (250 mm by 353 mm) - * 13 = B5 paper (176 mm by 250 mm) - * 14 = Folio paper (8.5 in. by 13 in.) - * 15 = Quarto paper (215 mm by 275 mm) - * 16 = Standard paper (10 in. by 14 in.) - * 17 = Standard paper (11 in. by 17 in.) - * 18 = Note paper (8.5 in. by 11 in.) - * 19 = #9 envelope (3.875 in. by 8.875 in.) - * 20 = #10 envelope (4.125 in. by 9.5 in.) - * 21 = #11 envelope (4.5 in. by 10.375 in.) - * 22 = #12 envelope (4.75 in. by 11 in.) - * 23 = #14 envelope (5 in. by 11.5 in.) - * 24 = C paper (17 in. by 22 in.) - * 25 = D paper (22 in. by 34 in.) - * 26 = E paper (34 in. by 44 in.) - * 27 = DL envelope (110 mm by 220 mm) - * 28 = C5 envelope (162 mm by 229 mm) - * 29 = C3 envelope (324 mm by 458 mm) - * 30 = C4 envelope (229 mm by 324 mm) - * 31 = C6 envelope (114 mm by 162 mm) - * 32 = C65 envelope (114 mm by 229 mm) - * 33 = B4 envelope (250 mm by 353 mm) - * 34 = B5 envelope (176 mm by 250 mm) - * 35 = B6 envelope (176 mm by 125 mm) - * 36 = Italy envelope (110 mm by 230 mm) - * 37 = Monarch envelope (3.875 in. by 7.5 in.). - * 38 = 6 3/4 envelope (3.625 in. by 6.5 in.) - * 39 = US standard fanfold (14.875 in. by 11 in.) - * 40 = German standard fanfold (8.5 in. by 12 in.) - * 41 = German legal fanfold (8.5 in. by 13 in.) - * 42 = ISO B4 (250 mm by 353 mm) - * 43 = Japanese double postcard (200 mm by 148 mm) - * 44 = Standard paper (9 in. by 11 in.) - * 45 = Standard paper (10 in. by 11 in.) - * 46 = Standard paper (15 in. by 11 in.) - * 47 = Invite envelope (220 mm by 220 mm) - * 50 = Letter extra paper (9.275 in. by 12 in.) - * 51 = Legal extra paper (9.275 in. by 15 in.) - * 52 = Tabloid extra paper (11.69 in. by 18 in.) - * 53 = A4 extra paper (236 mm by 322 mm) - * 54 = Letter transverse paper (8.275 in. by 11 in.) - * 55 = A4 transverse paper (210 mm by 297 mm) - * 56 = Letter extra transverse paper (9.275 in. by 12 in.) - * 57 = SuperA/SuperA/A4 paper (227 mm by 356 mm) - * 58 = SuperB/SuperB/A3 paper (305 mm by 487 mm) - * 59 = Letter plus paper (8.5 in. by 12.69 in.) - * 60 = A4 plus paper (210 mm by 330 mm) - * 61 = A5 transverse paper (148 mm by 210 mm) - * 62 = JIS B5 transverse paper (182 mm by 257 mm) - * 63 = A3 extra paper (322 mm by 445 mm) - * 64 = A5 extra paper (174 mm by 235 mm) - * 65 = ISO B5 extra paper (201 mm by 276 mm) - * 66 = A2 paper (420 mm by 594 mm) - * 67 = A3 transverse paper (297 mm by 420 mm) - * 68 = A3 extra transverse paper (322 mm by 445 mm) - * </code> - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_PageSetup -{ - /* Paper size */ - const PAPERSIZE_LETTER = 1; - const PAPERSIZE_LETTER_SMALL = 2; - const PAPERSIZE_TABLOID = 3; - const PAPERSIZE_LEDGER = 4; - const PAPERSIZE_LEGAL = 5; - const PAPERSIZE_STATEMENT = 6; - const PAPERSIZE_EXECUTIVE = 7; - const PAPERSIZE_A3 = 8; - const PAPERSIZE_A4 = 9; - const PAPERSIZE_A4_SMALL = 10; - const PAPERSIZE_A5 = 11; - const PAPERSIZE_B4 = 12; - const PAPERSIZE_B5 = 13; - const PAPERSIZE_FOLIO = 14; - const PAPERSIZE_QUARTO = 15; - const PAPERSIZE_STANDARD_1 = 16; - const PAPERSIZE_STANDARD_2 = 17; - const PAPERSIZE_NOTE = 18; - const PAPERSIZE_NO9_ENVELOPE = 19; - const PAPERSIZE_NO10_ENVELOPE = 20; - const PAPERSIZE_NO11_ENVELOPE = 21; - const PAPERSIZE_NO12_ENVELOPE = 22; - const PAPERSIZE_NO14_ENVELOPE = 23; - const PAPERSIZE_C = 24; - const PAPERSIZE_D = 25; - const PAPERSIZE_E = 26; - const PAPERSIZE_DL_ENVELOPE = 27; - const PAPERSIZE_C5_ENVELOPE = 28; - const PAPERSIZE_C3_ENVELOPE = 29; - const PAPERSIZE_C4_ENVELOPE = 30; - const PAPERSIZE_C6_ENVELOPE = 31; - const PAPERSIZE_C65_ENVELOPE = 32; - const PAPERSIZE_B4_ENVELOPE = 33; - const PAPERSIZE_B5_ENVELOPE = 34; - const PAPERSIZE_B6_ENVELOPE = 35; - const PAPERSIZE_ITALY_ENVELOPE = 36; - const PAPERSIZE_MONARCH_ENVELOPE = 37; - const PAPERSIZE_6_3_4_ENVELOPE = 38; - const PAPERSIZE_US_STANDARD_FANFOLD = 39; - const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40; - const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41; - const PAPERSIZE_ISO_B4 = 42; - const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43; - const PAPERSIZE_STANDARD_PAPER_1 = 44; - const PAPERSIZE_STANDARD_PAPER_2 = 45; - const PAPERSIZE_STANDARD_PAPER_3 = 46; - const PAPERSIZE_INVITE_ENVELOPE = 47; - const PAPERSIZE_LETTER_EXTRA_PAPER = 48; - const PAPERSIZE_LEGAL_EXTRA_PAPER = 49; - const PAPERSIZE_TABLOID_EXTRA_PAPER = 50; - const PAPERSIZE_A4_EXTRA_PAPER = 51; - const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52; - const PAPERSIZE_A4_TRANSVERSE_PAPER = 53; - const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54; - const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55; - const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56; - const PAPERSIZE_LETTER_PLUS_PAPER = 57; - const PAPERSIZE_A4_PLUS_PAPER = 58; - const PAPERSIZE_A5_TRANSVERSE_PAPER = 59; - const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60; - const PAPERSIZE_A3_EXTRA_PAPER = 61; - const PAPERSIZE_A5_EXTRA_PAPER = 62; - const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63; - const PAPERSIZE_A2_PAPER = 64; - const PAPERSIZE_A3_TRANSVERSE_PAPER = 65; - const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66; - - /* Page orientation */ - const ORIENTATION_DEFAULT = 'default'; - const ORIENTATION_LANDSCAPE = 'landscape'; - const ORIENTATION_PORTRAIT = 'portrait'; - - /* Print Range Set Method */ - const SETPRINTRANGE_OVERWRITE = 'O'; - const SETPRINTRANGE_INSERT = 'I'; - - - /** - * Paper size - * - * @var int - */ - private $_paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER; - - /** - * Orientation - * - * @var string - */ - private $_orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT; - - /** - * Scale (Print Scale) - * - * Print scaling. Valid values range from 10 to 400 - * This setting is overridden when fitToWidth and/or fitToHeight are in use - * - * @var int? - */ - private $_scale = 100; - - /** - * Fit To Page - * Whether scale or fitToWith / fitToHeight applies - * - * @var boolean - */ - private $_fitToPage = false; - - /** - * Fit To Height - * Number of vertical pages to fit on - * - * @var int? - */ - private $_fitToHeight = 1; - - /** - * Fit To Width - * Number of horizontal pages to fit on - * - * @var int? - */ - private $_fitToWidth = 1; - - /** - * Columns to repeat at left - * - * @var array Containing start column and end column, empty array if option unset - */ - private $_columnsToRepeatAtLeft = array('', ''); - - /** - * Rows to repeat at top - * - * @var array Containing start row number and end row number, empty array if option unset - */ - private $_rowsToRepeatAtTop = array(0, 0); - - /** - * Center page horizontally - * - * @var boolean - */ - private $_horizontalCentered = false; - - /** - * Center page vertically - * - * @var boolean - */ - private $_verticalCentered = false; - - /** - * Print area - * - * @var string - */ - private $_printArea = null; - - /** - * First page number - * - * @var int - */ - private $_firstPageNumber = null; - - /** - * Create a new PHPExcel_Worksheet_PageSetup - */ - public function __construct() - { - } - - /** - * Get Paper Size - * - * @return int - */ - public function getPaperSize() { - return $this->_paperSize; - } - - /** - * Set Paper Size - * - * @param int $pValue - * @return PHPExcel_Worksheet_PageSetup - */ - public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) { - $this->_paperSize = $pValue; - return $this; - } - - /** - * Get Orientation - * - * @return string - */ - public function getOrientation() { - return $this->_orientation; - } - - /** - * Set Orientation - * - * @param string $pValue - * @return PHPExcel_Worksheet_PageSetup - */ - public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) { - $this->_orientation = $pValue; - return $this; - } - - /** - * Get Scale - * - * @return int? - */ - public function getScale() { - return $this->_scale; - } - - /** - * Set Scale - * - * Print scaling. Valid values range from 10 to 400 - * This setting is overridden when fitToWidth and/or fitToHeight are in use - * - * @param int? $pValue - * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth - * @throws Exception - * @return PHPExcel_Worksheet_PageSetup - */ - public function setScale($pValue = 100, $pUpdate = true) { - // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, - // but it is apparently still able to handle any scale >= 0, where 0 results in 100 - if (($pValue >= 0) || is_null($pValue)) { - $this->_scale = $pValue; - if ($pUpdate) { - $this->_fitToPage = false; - } - } else { - throw new Exception("Scale must not be negative"); - } - return $this; - } - - /** - * Get Fit To Page - * - * @return boolean - */ - public function getFitToPage() { - return $this->_fitToPage; - } - - /** - * Set Fit To Page - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_PageSetup - */ - public function setFitToPage($pValue = true) { - $this->_fitToPage = $pValue; - return $this; - } - - /** - * Get Fit To Height - * - * @return int? - */ - public function getFitToHeight() { - return $this->_fitToHeight; - } - - /** - * Set Fit To Height - * - * @param int? $pValue - * @param boolean $pUpdate Update fitToPage so it applies rather than scaling - * @return PHPExcel_Worksheet_PageSetup - */ - public function setFitToHeight($pValue = 1, $pUpdate = true) { - $this->_fitToHeight = $pValue; - if ($pUpdate) { - $this->_fitToPage = true; - } - return $this; - } - - /** - * Get Fit To Width - * - * @return int? - */ - public function getFitToWidth() { - return $this->_fitToWidth; - } - - /** - * Set Fit To Width - * - * @param int? $pValue - * @param boolean $pUpdate Update fitToPage so it applies rather than scaling - * @return PHPExcel_Worksheet_PageSetup - */ - public function setFitToWidth($pValue = 1, $pUpdate = true) { - $this->_fitToWidth = $pValue; - if ($pUpdate) { - $this->_fitToPage = true; - } - return $this; - } - - /** - * Is Columns to repeat at left set? - * - * @return boolean - */ - public function isColumnsToRepeatAtLeftSet() { - if (is_array($this->_columnsToRepeatAtLeft)) { - if ($this->_columnsToRepeatAtLeft[0] != '' && $this->_columnsToRepeatAtLeft[1] != '') { - return true; - } - } - - return false; - } - - /** - * Get Columns to repeat at left - * - * @return array Containing start column and end column, empty array if option unset - */ - public function getColumnsToRepeatAtLeft() { - return $this->_columnsToRepeatAtLeft; - } - - /** - * Set Columns to repeat at left - * - * @param array $pValue Containing start column and end column, empty array if option unset - * @return PHPExcel_Worksheet_PageSetup - */ - public function setColumnsToRepeatAtLeft($pValue = null) { - if (is_array($pValue)) { - $this->_columnsToRepeatAtLeft = $pValue; - } - return $this; - } - - /** - * Set Columns to repeat at left by start and end - * - * @param string $pStart - * @param string $pEnd - * @return PHPExcel_Worksheet_PageSetup - */ - public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') { - $this->_columnsToRepeatAtLeft = array($pStart, $pEnd); - return $this; - } - - /** - * Is Rows to repeat at top set? - * - * @return boolean - */ - public function isRowsToRepeatAtTopSet() { - if (is_array($this->_rowsToRepeatAtTop)) { - if ($this->_rowsToRepeatAtTop[0] != 0 && $this->_rowsToRepeatAtTop[1] != 0) { - return true; - } - } - - return false; - } - - /** - * Get Rows to repeat at top - * - * @return array Containing start column and end column, empty array if option unset - */ - public function getRowsToRepeatAtTop() { - return $this->_rowsToRepeatAtTop; - } - - /** - * Set Rows to repeat at top - * - * @param array $pValue Containing start column and end column, empty array if option unset - * @return PHPExcel_Worksheet_PageSetup - */ - public function setRowsToRepeatAtTop($pValue = null) { - if (is_array($pValue)) { - $this->_rowsToRepeatAtTop = $pValue; - } - return $this; - } - - /** - * Set Rows to repeat at top by start and end - * - * @param int $pStart - * @param int $pEnd - * @return PHPExcel_Worksheet_PageSetup - */ - public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) { - $this->_rowsToRepeatAtTop = array($pStart, $pEnd); - return $this; - } - - /** - * Get center page horizontally - * - * @return bool - */ - public function getHorizontalCentered() { - return $this->_horizontalCentered; - } - - /** - * Set center page horizontally - * - * @param bool $value - * @return PHPExcel_Worksheet_PageSetup - */ - public function setHorizontalCentered($value = false) { - $this->_horizontalCentered = $value; - return $this; - } - - /** - * Get center page vertically - * - * @return bool - */ - public function getVerticalCentered() { - return $this->_verticalCentered; - } - - /** - * Set center page vertically - * - * @param bool $value - * @return PHPExcel_Worksheet_PageSetup - */ - public function setVerticalCentered($value = false) { - $this->_verticalCentered = $value; - return $this; - } - - /** - * Get print area - * - * @param int $index Identifier for a specific print area range if several ranges have been set - * Default behaviour, or a index value of 0, will return all ranges as a comma-separated string - * Otherwise, the specific range identified by the value of $index will be returned - * Print areas are numbered from 1 - * @throws Exception - * @return string - */ - public function getPrintArea($index = 0) { - if ($index == 0) { - return $this->_printArea; - } - $printAreas = explode(',',$this->_printArea); - if (isset($printAreas[$index-1])) { - return $printAreas[$index-1]; - } - throw new Exception("Requested Print Area does not exist"); - } - - /** - * Is print area set? - * - * @param int $index Identifier for a specific print area range if several ranges have been set - * Default behaviour, or an index value of 0, will identify whether any print range is set - * Otherwise, existence of the range identified by the value of $index will be returned - * Print areas are numbered from 1 - * @return boolean - */ - public function isPrintAreaSet($index = 0) { - if ($index == 0) { - return !is_null($this->_printArea); - } - $printAreas = explode(',',$this->_printArea); - return isset($printAreas[$index-1]); - } - - /** - * Clear a print area - * - * @param int $index Identifier for a specific print area range if several ranges have been set - * Default behaviour, or an index value of 0, will clear all print ranges that are set - * Otherwise, the range identified by the value of $index will be removed from the series - * Print areas are numbered from 1 - * @return PHPExcel_Worksheet_PageSetup - */ - public function clearPrintArea($index = 0) { - if ($index == 0) { - $this->_printArea = NULL; - } else { - $printAreas = explode(',',$this->_printArea); - if (isset($printAreas[$index-1])) { - unset($printAreas[$index-1]); - $this->_printArea = implode(',',$printAreas); - } - } - - return $this; - } - - /** - * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20' - * - * @param string $value - * @param int $index Identifier for a specific print area range allowing several ranges to be set - * When the method is "O"verwrite, then a positive integer index will overwrite that indexed - * entry in the print areas list; a negative index value will identify which entry to - * overwrite working bacward through the print area to the list, with the last entry as -1. - * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges. - * When the method is "I"nsert, then a positive index will insert after that indexed entry in - * the print areas list, while a negative index will insert before the indexed entry. - * Specifying an index value of 0, will always append the new print range at the end of the - * list. - * Print areas are numbered from 1 - * @param string $method Determines the method used when setting multiple print areas - * Default behaviour, or the "O" method, overwrites existing print area - * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @throws Exception - * @return PHPExcel_Worksheet_PageSetup - */ - public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) { - if (strpos($value,'!') !== false) { - throw new Exception('Cell coordinate must not specify a worksheet.'); - } elseif (strpos($value,':') === false) { - throw new Exception('Cell coordinate must be a range of cells.'); - } elseif (strpos($value,'$') !== false) { - throw new Exception('Cell coordinate must not be absolute.'); - } - $value = strtoupper($value); - - if ($method == self::SETPRINTRANGE_OVERWRITE) { - if ($index == 0) { - $this->_printArea = $value; - } else { - $printAreas = explode(',',$this->_printArea); - if($index < 0) { - $index = count($printAreas) - abs($index) + 1; - } - if (($index <= 0) || ($index > count($printAreas))) { - throw new Exception('Invalid index for setting print range.'); - } - $printAreas[$index-1] = $value; - $this->_printArea = implode(',',$printAreas); - } - } elseif($method == self::SETPRINTRANGE_INSERT) { - if ($index == 0) { - $this->_printArea .= ($this->_printArea == '') ? $value : ','.$value; - } else { - $printAreas = explode(',',$this->_printArea); - if($index < 0) { - $index = abs($index) - 1; - } - if ($index > count($printAreas)) { - throw new Exception('Invalid index for setting print range.'); - } - $printAreas = array_merge(array_slice($printAreas,0,$index),array($value),array_slice($printAreas,$index)); - $this->_printArea = implode(',',$printAreas); - } - } else { - throw new Exception('Invalid method for setting print range.'); - } - - return $this; - } - - /** - * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas - * - * @param string $value - * @param int $index Identifier for a specific print area range allowing several ranges to be set - * A positive index will insert after that indexed entry in the print areas list, while a - * negative index will insert before the indexed entry. - * Specifying an index value of 0, will always append the new print range at the end of the - * list. - * Print areas are numbered from 1 - * @throws Exception - * @return PHPExcel_Worksheet_PageSetup - */ - public function addPrintArea($value, $index = -1) { - return $this->setPrintArea($value, $index, self::SETPRINTRANGE_INSERT); - } - - /** - * Set print area - * - * @param int $column1 Column 1 - * @param int $row1 Row 1 - * @param int $column2 Column 2 - * @param int $row2 Row 2 - * @param int $index Identifier for a specific print area range allowing several ranges to be set - * When the method is "O"verwrite, then a positive integer index will overwrite that indexed - * entry in the print areas list; a negative index value will identify which entry to - * overwrite working bacward through the print area to the list, with the last entry as -1. - * Specifying an index value of 0, will overwrite <b>all</b> existing print ranges. - * When the method is "I"nsert, then a positive index will insert after that indexed entry in - * the print areas list, while a negative index will insert before the indexed entry. - * Specifying an index value of 0, will always append the new print range at the end of the - * list. - * Print areas are numbered from 1 - * @param string $method Determines the method used when setting multiple print areas - * Default behaviour, or the "O" method, overwrites existing print area - * The "I" method, inserts the new print area before any specified index, or at the end of the list - * @throws Exception - * @return PHPExcel_Worksheet_PageSetup - */ - public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) - { - return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, $method); - } - - /** - * Add a new print area to the list of print areas - * - * @param int $column1 Column 1 - * @param int $row1 Row 1 - * @param int $column2 Column 2 - * @param int $row2 Row 2 - * @param int $index Identifier for a specific print area range allowing several ranges to be set - * A positive index will insert after that indexed entry in the print areas list, while a - * negative index will insert before the indexed entry. - * Specifying an index value of 0, will always append the new print range at the end of the - * list. - * Print areas are numbered from 1 - * @throws Exception - * @return PHPExcel_Worksheet_PageSetup - */ - public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1) - { - return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT); - } - - /** - * Get first page number - * - * @return int - */ - public function getFirstPageNumber() { - return $this->_firstPageNumber; - } - - /** - * Set first page number - * - * @param int $value - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function setFirstPageNumber($value = null) { - $this->_firstPageNumber = $value; - return $this; - } - - /** - * Reset first page number - * - * @return PHPExcel_Worksheet_HeaderFooter - */ - public function resetFirstPageNumber() { - return $this->setFirstPageNumber(null); - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Protection.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Protection.php deleted file mode 100644 index 17d253903f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Protection.php +++ /dev/null @@ -1,545 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_Protection - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_Protection -{ - /** - * Sheet - * - * @var boolean - */ - private $_sheet = false; - - /** - * Objects - * - * @var boolean - */ - private $_objects = false; - - /** - * Scenarios - * - * @var boolean - */ - private $_scenarios = false; - - /** - * Format cells - * - * @var boolean - */ - private $_formatCells = false; - - /** - * Format columns - * - * @var boolean - */ - private $_formatColumns = false; - - /** - * Format rows - * - * @var boolean - */ - private $_formatRows = false; - - /** - * Insert columns - * - * @var boolean - */ - private $_insertColumns = false; - - /** - * Insert rows - * - * @var boolean - */ - private $_insertRows = false; - - /** - * Insert hyperlinks - * - * @var boolean - */ - private $_insertHyperlinks = false; - - /** - * Delete columns - * - * @var boolean - */ - private $_deleteColumns = false; - - /** - * Delete rows - * - * @var boolean - */ - private $_deleteRows = false; - - /** - * Select locked cells - * - * @var boolean - */ - private $_selectLockedCells = false; - - /** - * Sort - * - * @var boolean - */ - private $_sort = false; - - /** - * AutoFilter - * - * @var boolean - */ - private $_autoFilter = false; - - /** - * Pivot tables - * - * @var boolean - */ - private $_pivotTables = false; - - /** - * Select unlocked cells - * - * @var boolean - */ - private $_selectUnlockedCells = false; - - /** - * Password - * - * @var string - */ - private $_password = ''; - - /** - * Create a new PHPExcel_Worksheet_Protection - */ - public function __construct() - { - } - - /** - * Is some sort of protection enabled? - * - * @return boolean - */ - function isProtectionEnabled() { - return $this->_sheet || - $this->_objects || - $this->_scenarios || - $this->_formatCells || - $this->_formatColumns || - $this->_formatRows || - $this->_insertColumns || - $this->_insertRows || - $this->_insertHyperlinks || - $this->_deleteColumns || - $this->_deleteRows || - $this->_selectLockedCells || - $this->_sort || - $this->_autoFilter || - $this->_pivotTables || - $this->_selectUnlockedCells; - } - - /** - * Get Sheet - * - * @return boolean - */ - function getSheet() { - return $this->_sheet; - } - - /** - * Set Sheet - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setSheet($pValue = false) { - $this->_sheet = $pValue; - return $this; - } - - /** - * Get Objects - * - * @return boolean - */ - function getObjects() { - return $this->_objects; - } - - /** - * Set Objects - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setObjects($pValue = false) { - $this->_objects = $pValue; - return $this; - } - - /** - * Get Scenarios - * - * @return boolean - */ - function getScenarios() { - return $this->_scenarios; - } - - /** - * Set Scenarios - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setScenarios($pValue = false) { - $this->_scenarios = $pValue; - return $this; - } - - /** - * Get FormatCells - * - * @return boolean - */ - function getFormatCells() { - return $this->_formatCells; - } - - /** - * Set FormatCells - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setFormatCells($pValue = false) { - $this->_formatCells = $pValue; - return $this; - } - - /** - * Get FormatColumns - * - * @return boolean - */ - function getFormatColumns() { - return $this->_formatColumns; - } - - /** - * Set FormatColumns - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setFormatColumns($pValue = false) { - $this->_formatColumns = $pValue; - return $this; - } - - /** - * Get FormatRows - * - * @return boolean - */ - function getFormatRows() { - return $this->_formatRows; - } - - /** - * Set FormatRows - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setFormatRows($pValue = false) { - $this->_formatRows = $pValue; - return $this; - } - - /** - * Get InsertColumns - * - * @return boolean - */ - function getInsertColumns() { - return $this->_insertColumns; - } - - /** - * Set InsertColumns - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setInsertColumns($pValue = false) { - $this->_insertColumns = $pValue; - return $this; - } - - /** - * Get InsertRows - * - * @return boolean - */ - function getInsertRows() { - return $this->_insertRows; - } - - /** - * Set InsertRows - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setInsertRows($pValue = false) { - $this->_insertRows = $pValue; - return $this; - } - - /** - * Get InsertHyperlinks - * - * @return boolean - */ - function getInsertHyperlinks() { - return $this->_insertHyperlinks; - } - - /** - * Set InsertHyperlinks - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setInsertHyperlinks($pValue = false) { - $this->_insertHyperlinks = $pValue; - return $this; - } - - /** - * Get DeleteColumns - * - * @return boolean - */ - function getDeleteColumns() { - return $this->_deleteColumns; - } - - /** - * Set DeleteColumns - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setDeleteColumns($pValue = false) { - $this->_deleteColumns = $pValue; - return $this; - } - - /** - * Get DeleteRows - * - * @return boolean - */ - function getDeleteRows() { - return $this->_deleteRows; - } - - /** - * Set DeleteRows - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setDeleteRows($pValue = false) { - $this->_deleteRows = $pValue; - return $this; - } - - /** - * Get SelectLockedCells - * - * @return boolean - */ - function getSelectLockedCells() { - return $this->_selectLockedCells; - } - - /** - * Set SelectLockedCells - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setSelectLockedCells($pValue = false) { - $this->_selectLockedCells = $pValue; - return $this; - } - - /** - * Get Sort - * - * @return boolean - */ - function getSort() { - return $this->_sort; - } - - /** - * Set Sort - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setSort($pValue = false) { - $this->_sort = $pValue; - return $this; - } - - /** - * Get AutoFilter - * - * @return boolean - */ - function getAutoFilter() { - return $this->_autoFilter; - } - - /** - * Set AutoFilter - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setAutoFilter($pValue = false) { - $this->_autoFilter = $pValue; - return $this; - } - - /** - * Get PivotTables - * - * @return boolean - */ - function getPivotTables() { - return $this->_pivotTables; - } - - /** - * Set PivotTables - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setPivotTables($pValue = false) { - $this->_pivotTables = $pValue; - return $this; - } - - /** - * Get SelectUnlockedCells - * - * @return boolean - */ - function getSelectUnlockedCells() { - return $this->_selectUnlockedCells; - } - - /** - * Set SelectUnlockedCells - * - * @param boolean $pValue - * @return PHPExcel_Worksheet_Protection - */ - function setSelectUnlockedCells($pValue = false) { - $this->_selectUnlockedCells = $pValue; - return $this; - } - - /** - * Get Password (hashed) - * - * @return string - */ - function getPassword() { - return $this->_password; - } - - /** - * Set Password - * - * @param string $pValue - * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true - * @return PHPExcel_Worksheet_Protection - */ - function setPassword($pValue = '', $pAlreadyHashed = false) { - if (!$pAlreadyHashed) { - $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue); - } - $this->_password = $pValue; - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Row.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Row.php deleted file mode 100644 index fe5e0c9216..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/Row.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_Row - * - * Represents a row in PHPExcel_Worksheet, used by PHPExcel_Worksheet_RowIterator - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_Row -{ - /** - * PHPExcel_Worksheet - * - * @var PHPExcel_Worksheet - */ - private $_parent; - - /** - * Row index - * - * @var int - */ - private $_rowIndex = 0; - - /** - * Create a new row - * - * @param PHPExcel_Worksheet $parent - * @param int $rowIndex - */ - public function __construct(PHPExcel_Worksheet $parent = null, $rowIndex = 1) { - // Set parent and row index - $this->_parent = $parent; - $this->_rowIndex = $rowIndex; - } - - /** - * Destructor - */ - public function __destruct() { - unset($this->_parent); - } - - /** - * Get row index - * - * @return int - */ - public function getRowIndex() { - return $this->_rowIndex; - } - - /** - * Get cell iterator - * - * @return PHPExcel_Worksheet_CellIterator - */ - public function getCellIterator() { - return new PHPExcel_Worksheet_CellIterator($this->_parent, $this->_rowIndex); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowDimension.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowDimension.php deleted file mode 100644 index f1de4f6782..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowDimension.php +++ /dev/null @@ -1,238 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_RowDimension - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_RowDimension -{ - /** - * Row index - * - * @var int - */ - private $_rowIndex; - - /** - * Row height (in pt) - * - * When this is set to a negative value, the row height should be ignored by IWriter - * - * @var double - */ - private $_rowHeight = -1; - - /** - * Visible? - * - * @var bool - */ - private $_visible = true; - - /** - * Outline level - * - * @var int - */ - private $_outlineLevel = 0; - - /** - * Collapsed - * - * @var bool - */ - private $_collapsed = false; - - /** - * Index to cellXf. Null value means row has no explicit cellXf format. - * - * @var int|null - */ - private $_xfIndex; - - /** - * Create a new PHPExcel_Worksheet_RowDimension - * - * @param int $pIndex Numeric row index - */ - public function __construct($pIndex = 0) - { - // Initialise values - $this->_rowIndex = $pIndex; - - // set row dimension as unformatted by default - $this->_xfIndex = null; - } - - /** - * Get Row Index - * - * @return int - */ - public function getRowIndex() { - return $this->_rowIndex; - } - - /** - * Set Row Index - * - * @param int $pValue - * @return PHPExcel_Worksheet_RowDimension - */ - public function setRowIndex($pValue) { - $this->_rowIndex = $pValue; - return $this; - } - - /** - * Get Row Height - * - * @return double - */ - public function getRowHeight() { - return $this->_rowHeight; - } - - /** - * Set Row Height - * - * @param double $pValue - * @return PHPExcel_Worksheet_RowDimension - */ - public function setRowHeight($pValue = -1) { - $this->_rowHeight = $pValue; - return $this; - } - - /** - * Get Visible - * - * @return bool - */ - public function getVisible() { - return $this->_visible; - } - - /** - * Set Visible - * - * @param bool $pValue - * @return PHPExcel_Worksheet_RowDimension - */ - public function setVisible($pValue = true) { - $this->_visible = $pValue; - return $this; - } - - /** - * Get Outline Level - * - * @return int - */ - public function getOutlineLevel() { - return $this->_outlineLevel; - } - - /** - * Set Outline Level - * - * Value must be between 0 and 7 - * - * @param int $pValue - * @throws Exception - * @return PHPExcel_Worksheet_RowDimension - */ - public function setOutlineLevel($pValue) { - if ($pValue < 0 || $pValue > 7) { - throw new Exception("Outline level must range between 0 and 7."); - } - - $this->_outlineLevel = $pValue; - return $this; - } - - /** - * Get Collapsed - * - * @return bool - */ - public function getCollapsed() { - return $this->_collapsed; - } - - /** - * Set Collapsed - * - * @param bool $pValue - * @return PHPExcel_Worksheet_RowDimension - */ - public function setCollapsed($pValue = true) { - $this->_collapsed = $pValue; - return $this; - } - - /** - * Get index to cellXf - * - * @return int - */ - public function getXfIndex() - { - return $this->_xfIndex; - } - - /** - * Set index to cellXf - * - * @param int $pValue - * @return PHPExcel_Worksheet_RowDimension - */ - public function setXfIndex($pValue = 0) - { - $this->_xfIndex = $pValue; - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowIterator.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowIterator.php deleted file mode 100644 index 2f16d138fc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/RowIterator.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_RowIterator - * - * Used to iterate rows in a PHPExcel_Worksheet - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_RowIterator extends CachingIterator -{ - /** - * PHPExcel_Worksheet to iterate - * - * @var PHPExcel_Worksheet - */ - private $_subject; - - /** - * Current iterator position - * - * @var int - */ - private $_position = 1; - - /** - * Create a new row iterator - * - * @param PHPExcel_Worksheet $subject - */ - public function __construct(PHPExcel_Worksheet $subject = null) { - // Set subject - $this->_subject = $subject; - } - - /** - * Destructor - */ - public function __destruct() { - unset($this->_subject); - } - - /** - * Rewind iterator - */ - public function rewind() { - $this->_position = 1; - } - - /** - * Current PHPExcel_Worksheet_Row - * - * @return PHPExcel_Worksheet_Row - */ - public function current() { - return new PHPExcel_Worksheet_Row($this->_subject, $this->_position); - } - - /** - * Current key - * - * @return int - */ - public function key() { - return $this->_position; - } - - /** - * Next value - */ - public function next() { - ++$this->_position; - } - - /** - * More PHPExcel_Worksheet_Row instances available? - * - * @return boolean - */ - public function valid() { - return $this->_position <= $this->_subject->getHighestRow(); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/SheetView.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/SheetView.php deleted file mode 100644 index 84a0ca8969..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Worksheet/SheetView.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Worksheet_SheetView - * - * @category PHPExcel - * @package PHPExcel_Worksheet - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Worksheet_SheetView -{ - /** - * ZoomScale - * - * Valid values range from 10 to 400. - * - * @var int - */ - private $_zoomScale = 100; - - /** - * ZoomScaleNormal - * - * Valid values range from 10 to 400. - * - * @var int - */ - private $_zoomScaleNormal = 100; - - /** - * Create a new PHPExcel_Worksheet_SheetView - */ - public function __construct() - { - } - - /** - * Get ZoomScale - * - * @return int - */ - public function getZoomScale() { - return $this->_zoomScale; - } - - /** - * Set ZoomScale - * - * Valid values range from 10 to 400. - * - * @param int $pValue - * @throws Exception - * @return PHPExcel_Worksheet_SheetView - */ - public function setZoomScale($pValue = 100) { - // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface, - // but it is apparently still able to handle any scale >= 1 - if (($pValue >= 1) || is_null($pValue)) { - $this->_zoomScale = $pValue; - } else { - throw new Exception("Scale must be greater than or equal to 1."); - } - return $this; - } - - /** - * Get ZoomScaleNormal - * - * @return int - */ - public function getZoomScaleNormal() { - return $this->_zoomScaleNormal; - } - - /** - * Set ZoomScale - * - * Valid values range from 10 to 400. - * - * @param int $pValue - * @throws Exception - * @return PHPExcel_Worksheet_SheetView - */ - public function setZoomScaleNormal($pValue = 100) { - if (($pValue >= 1) || is_null($pValue)) { - $this->_zoomScaleNormal = $pValue; - } else { - throw new Exception("Scale must be greater than or equal to 1."); - } - return $this; - } - - /** - * Implement PHP __clone to create a deep clone, not just a shallow copy. - */ - public function __clone() { - $vars = get_object_vars($this); - foreach ($vars as $key => $value) { - if (is_object($value)) { - $this->$key = clone $value; - } else { - $this->$key = $value; - } - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/WorksheetIterator.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/WorksheetIterator.php deleted file mode 100644 index fcf20351c9..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/WorksheetIterator.php +++ /dev/null @@ -1,111 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_WorksheetIterator - * - * Used to iterate worksheets in PHPExcel - * - * @category PHPExcel - * @package PHPExcel - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_WorksheetIterator extends CachingIterator -{ - /** - * Spreadsheet to iterate - * - * @var PHPExcel - */ - private $_subject; - - /** - * Current iterator position - * - * @var int - */ - private $_position = 0; - - /** - * Create a new worksheet iterator - * - * @param PHPExcel $subject - */ - public function __construct(PHPExcel $subject = null) { - // Set subject - $this->_subject = $subject; - } - - /** - * Destructor - */ - public function __destruct() { - unset($this->_subject); - } - - /** - * Rewind iterator - */ - public function rewind() { - $this->_position = 0; - } - - /** - * Current PHPExcel_Worksheet - * - * @return PHPExcel_Worksheet - */ - public function current() { - return $this->_subject->getSheet($this->_position); - } - - /** - * Current key - * - * @return int - */ - public function key() { - return $this->_position; - } - - /** - * Next value - */ - public function next() { - ++$this->_position; - } - - /** - * More PHPExcel_Worksheet instances available? - * - * @return boolean - */ - public function valid() { - return $this->_position < $this->_subject->getSheetCount(); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/CSV.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/CSV.php deleted file mode 100644 index aa50de78cf..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/CSV.php +++ /dev/null @@ -1,298 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_CSV - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter { - /** - * PHPExcel object - * - * @var PHPExcel - */ - private $_phpExcel; - - /** - * Delimiter - * - * @var string - */ - private $_delimiter = ','; - - /** - * Enclosure - * - * @var string - */ - private $_enclosure = '"'; - - /** - * Line ending - * - * @var string - */ - private $_lineEnding = PHP_EOL; - - /** - * Sheet index to write - * - * @var int - */ - private $_sheetIndex = 0; - - /** - * Pre-calculate formulas - * - * @var boolean - */ - private $_preCalculateFormulas = true; - - /** - * Whether to write a BOM (for UTF8). - * - * @var boolean - */ - private $_useBOM = false; - - /** - * Create a new PHPExcel_Writer_CSV - * - * @param PHPExcel $phpExcel PHPExcel object - */ - public function __construct(PHPExcel $phpExcel) { - $this->_phpExcel = $phpExcel; - } - - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null) { - // Fetch sheet - $sheet = $this->_phpExcel->getSheet($this->_sheetIndex); - - $saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog; - PHPExcel_Calculation::getInstance()->writeDebugLog = false; - $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); - PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); - - // Open file - $fileHandle = fopen($pFilename, 'wb+'); - if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); - } - - if ($this->_useBOM) { - // Write the UTF-8 BOM code - fwrite($fileHandle, "\xEF\xBB\xBF"); - } - - // Convert sheet to array - $cellsArray = $sheet->toArray('', $this->_preCalculateFormulas); - - // Write rows to file - foreach ($cellsArray as $row) { - $this->_writeLine($fileHandle, $row); - } - - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); - PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog; - } - - /** - * Get delimiter - * - * @return string - */ - public function getDelimiter() { - return $this->_delimiter; - } - - /** - * Set delimiter - * - * @param string $pValue Delimiter, defaults to , - * @return PHPExcel_Writer_CSV - */ - public function setDelimiter($pValue = ',') { - $this->_delimiter = $pValue; - return $this; - } - - /** - * Get enclosure - * - * @return string - */ - public function getEnclosure() { - return $this->_enclosure; - } - - /** - * Set enclosure - * - * @param string $pValue Enclosure, defaults to " - * @return PHPExcel_Writer_CSV - */ - public function setEnclosure($pValue = '"') { - if ($pValue == '') { - $pValue = null; - } - $this->_enclosure = $pValue; - return $this; - } - - /** - * Get line ending - * - * @return string - */ - public function getLineEnding() { - return $this->_lineEnding; - } - - /** - * Set line ending - * - * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL) - * @return PHPExcel_Writer_CSV - */ - public function setLineEnding($pValue = PHP_EOL) { - $this->_lineEnding = $pValue; - return $this; - } - - /** - * Get whether BOM should be used - * - * @return boolean - */ - public function getUseBOM() { - return $this->_useBOM; - } - - /** - * Set whether BOM should be used - * - * @param boolean $pValue Use UTF-8 byte-order mark? Defaults to false - * @return PHPExcel_Writer_CSV - */ - public function setUseBOM($pValue = false) { - $this->_useBOM = $pValue; - return $this; - } - - /** - * Get sheet index - * - * @return int - */ - public function getSheetIndex() { - return $this->_sheetIndex; - } - - /** - * Set sheet index - * - * @param int $pValue Sheet index - * @return PHPExcel_Writer_CSV - */ - public function setSheetIndex($pValue = 0) { - $this->_sheetIndex = $pValue; - return $this; - } - - /** - * Write line to CSV file - * - * @param mixed $pFileHandle PHP filehandle - * @param array $pValues Array containing values in a row - * @throws Exception - */ - private function _writeLine($pFileHandle = null, $pValues = null) { - if (is_array($pValues)) { - // No leading delimiter - $writeDelimiter = false; - - // Build the line - $line = ''; - - foreach ($pValues as $element) { - // Escape enclosures - $element = str_replace($this->_enclosure, $this->_enclosure . $this->_enclosure, $element); - - // Add delimiter - if ($writeDelimiter) { - $line .= $this->_delimiter; - } else { - $writeDelimiter = true; - } - - // Add enclosed string - $line .= $this->_enclosure . $element . $this->_enclosure; - } - - // Add line ending - $line .= $this->_lineEnding; - - // Write to file - fwrite($pFileHandle, $line); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Get Pre-Calculate Formulas - * - * @return boolean - */ - public function getPreCalculateFormulas() { - return $this->_preCalculateFormulas; - } - - /** - * Set Pre-Calculate Formulas - * - * @param boolean $pValue Pre-Calculate Formulas? - * @return PHPExcel_Writer_CSV - */ - public function setPreCalculateFormulas($pValue = true) { - $this->_preCalculateFormulas = $pValue; - return $this; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007.php deleted file mode 100644 index ebc51c6ec6..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007.php +++ /dev/null @@ -1,526 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007 - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007 implements PHPExcel_Writer_IWriter -{ - /** - * Pre-calculate formulas - * - * @var boolean - */ - private $_preCalculateFormulas = true; - - /** - * Office2003 compatibility - * - * @var boolean - */ - private $_office2003compatibility = false; - - /** - * Private writer parts - * - * @var PHPExcel_Writer_Excel2007_WriterPart[] - */ - private $_writerParts = array(); - - /** - * Private PHPExcel - * - * @var PHPExcel - */ - private $_spreadSheet; - - /** - * Private string table - * - * @var string[] - */ - private $_stringTable = array(); - - /** - * Private unique PHPExcel_Style_Conditional HashTable - * - * @var PHPExcel_HashTable - */ - private $_stylesConditionalHashTable; - - /** - * Private unique PHPExcel_Style_Fill HashTable - * - * @var PHPExcel_HashTable - */ - private $_fillHashTable; - - /** - * Private unique PHPExcel_Style_Font HashTable - * - * @var PHPExcel_HashTable - */ - private $_fontHashTable; - - /** - * Private unique PHPExcel_Style_Borders HashTable - * - * @var PHPExcel_HashTable - */ - private $_bordersHashTable ; - - /** - * Private unique PHPExcel_Style_NumberFormat HashTable - * - * @var PHPExcel_HashTable - */ - private $_numFmtHashTable; - - /** - * Private unique PHPExcel_Worksheet_BaseDrawing HashTable - * - * @var PHPExcel_HashTable - */ - private $_drawingHashTable; - - /** - * Use disk caching where possible? - * - * @var boolean - */ - private $_useDiskCaching = false; - - /** - * Disk caching directory - * - * @var string - */ - private $_diskCachingDirectory = './'; - - /** - * Create a new PHPExcel_Writer_Excel2007 - * - * @param PHPExcel $pPHPExcel - */ - public function __construct(PHPExcel $pPHPExcel = null) - { - // Assign PHPExcel - $this->setPHPExcel($pPHPExcel); - - $writerPartsArray = array( 'stringtable' => 'PHPExcel_Writer_Excel2007_StringTable', - 'contenttypes' => 'PHPExcel_Writer_Excel2007_ContentTypes', - 'docprops' => 'PHPExcel_Writer_Excel2007_DocProps', - 'rels' => 'PHPExcel_Writer_Excel2007_Rels', - 'theme' => 'PHPExcel_Writer_Excel2007_Theme', - 'style' => 'PHPExcel_Writer_Excel2007_Style', - 'workbook' => 'PHPExcel_Writer_Excel2007_Workbook', - 'worksheet' => 'PHPExcel_Writer_Excel2007_Worksheet', - 'drawing' => 'PHPExcel_Writer_Excel2007_Drawing', - 'comments' => 'PHPExcel_Writer_Excel2007_Comments' - ); - - // Initialise writer parts - // and Assign their parent IWriters - foreach ($writerPartsArray as $writer => $class) { - $this->_writerParts[$writer] = new $class($this); - } - - $hashTablesArray = array( '_stylesConditionalHashTable', '_fillHashTable', '_fontHashTable', - '_bordersHashTable', '_numFmtHashTable', '_drawingHashTable' - ); - - // Set HashTable variables - foreach ($hashTablesArray as $tableName) { - $this->$tableName = new PHPExcel_HashTable(); - } - } - - /** - * Get writer part - * - * @param string $pPartName Writer part name - * @return PHPExcel_Writer_Excel2007_WriterPart - */ - public function getWriterPart($pPartName = '') { - if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { - return $this->_writerParts[strtolower($pPartName)]; - } else { - return null; - } - } - - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null) - { - if ($this->_spreadSheet !== NULL) { - // garbage collect - $this->_spreadSheet->garbageCollect(); - - // If $pFilename is php://output or php://stdout, make it a temporary file... - $originalFilename = $pFilename; - if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { - $pFilename = @tempnam('./', 'phpxltmp'); - if ($pFilename == '') { - $pFilename = $originalFilename; - } - } - - $saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog; - PHPExcel_Calculation::getInstance()->writeDebugLog = false; - $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); - - // Create string lookup table - $this->_stringTable = array(); - for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) { - $this->_stringTable = $this->getWriterPart('StringTable')->createStringTable($this->_spreadSheet->getSheet($i), $this->_stringTable); - } - - // Create styles dictionaries - $this->_stylesConditionalHashTable->addFromSource( $this->getWriterPart('Style')->allConditionalStyles($this->_spreadSheet) ); - $this->_fillHashTable->addFromSource( $this->getWriterPart('Style')->allFills($this->_spreadSheet) ); - $this->_fontHashTable->addFromSource( $this->getWriterPart('Style')->allFonts($this->_spreadSheet) ); - $this->_bordersHashTable->addFromSource( $this->getWriterPart('Style')->allBorders($this->_spreadSheet) ); - $this->_numFmtHashTable->addFromSource( $this->getWriterPart('Style')->allNumberFormats($this->_spreadSheet) ); - - // Create drawing dictionary - $this->_drawingHashTable->addFromSource( $this->getWriterPart('Drawing')->allDrawings($this->_spreadSheet) ); - - // Create new ZIP file and open it for writing - $zipClass = PHPExcel_Settings::getZipClass(); - $objZip = new $zipClass(); - - if (file_exists($pFilename)) { - unlink($pFilename); - } - // Try opening the ZIP file - if ($objZip->open($pFilename, ZIPARCHIVE::OVERWRITE) !== true) { - if ($objZip->open($pFilename, ZIPARCHIVE::CREATE) !== true) { - throw new Exception("Could not open " . $pFilename . " for writing."); - } - } - - // Add [Content_Types].xml to ZIP file - $objZip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->_spreadSheet)); - - // Add relationships to ZIP file - $objZip->addFromString('_rels/.rels', $this->getWriterPart('Rels')->writeRelationships($this->_spreadSheet)); - $objZip->addFromString('xl/_rels/workbook.xml.rels', $this->getWriterPart('Rels')->writeWorkbookRelationships($this->_spreadSheet)); - - // Add document properties to ZIP file - $objZip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->_spreadSheet)); - $objZip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->_spreadSheet)); - $customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->_spreadSheet); - if ($customPropertiesPart !== NULL) { - $objZip->addFromString('docProps/custom.xml', $customPropertiesPart); - } - - // Add theme to ZIP file - $objZip->addFromString('xl/theme/theme1.xml', $this->getWriterPart('Theme')->writeTheme($this->_spreadSheet)); - - // Add string table to ZIP file - $objZip->addFromString('xl/sharedStrings.xml', $this->getWriterPart('StringTable')->writeStringTable($this->_stringTable)); - - // Add styles to ZIP file - $objZip->addFromString('xl/styles.xml', $this->getWriterPart('Style')->writeStyles($this->_spreadSheet)); - - // Add workbook to ZIP file - $objZip->addFromString('xl/workbook.xml', $this->getWriterPart('Workbook')->writeWorkbook($this->_spreadSheet)); - - // Add worksheets - for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) { - $objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->_spreadSheet->getSheet($i), $this->_stringTable)); - } - - // Add worksheet relationships (drawings, ...) - for ($i = 0; $i < $this->_spreadSheet->getSheetCount(); ++$i) { - - // Add relationships - $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->_spreadSheet->getSheet($i), ($i + 1))); - - // Add drawing relationship parts - if ($this->_spreadSheet->getSheet($i)->getDrawingCollection()->count() > 0) { - // Drawing relationships - $objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->_spreadSheet->getSheet($i))); - - // Drawings - $objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->_spreadSheet->getSheet($i))); - } - - // Add comment relationship parts - if (count($this->_spreadSheet->getSheet($i)->getComments()) > 0) { - // VML Comments - $objZip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->_spreadSheet->getSheet($i))); - - // Comments - $objZip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->_spreadSheet->getSheet($i))); - } - - // Add header/footer relationship parts - if (count($this->_spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) { - // VML Drawings - $objZip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->_spreadSheet->getSheet($i))); - - // VML Drawing relationships - $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->_spreadSheet->getSheet($i))); - - // Media - foreach ($this->_spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) { - $objZip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath())); - } - } - } - - // Add media - for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { - if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { - $imageContents = null; - $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath(); - - if (strpos($imagePath, 'zip://') !== false) { - $imagePath = substr($imagePath, 6); - $imagePathSplitted = explode('#', $imagePath); - - $imageZip = new ZipArchive(); - $imageZip->open($imagePathSplitted[0]); - $imageContents = $imageZip->getFromName($imagePathSplitted[1]); - $imageZip->close(); - unset($imageZip); - } else { - $imageContents = file_get_contents($imagePath); - } - - $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); - } else if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { - ob_start(); - call_user_func( - $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(), - $this->getDrawingHashTable()->getByIndex($i)->getImageResource() - ); - $imageContents = ob_get_contents(); - ob_end_clean(); - - $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents); - } - } - - PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType); - PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog; - - // Close file - if ($objZip->close() === false) { - throw new Exception("Could not close zip file $pFilename."); - } - - // If a temporary file was used, copy it to the correct file stream - if ($originalFilename != $pFilename) { - if (copy($pFilename, $originalFilename) === false) { - throw new Exception("Could not copy temporary zip file $pFilename to $originalFilename."); - } - @unlink($pFilename); - } - } else { - throw new Exception("PHPExcel object unassigned."); - } - } - - /** - * Get PHPExcel object - * - * @return PHPExcel - * @throws Exception - */ - public function getPHPExcel() { - if ($this->_spreadSheet !== null) { - return $this->_spreadSheet; - } else { - throw new Exception("No PHPExcel assigned."); - } - } - - /** - * Set PHPExcel object - * - * @param PHPExcel $pPHPExcel PHPExcel object - * @throws Exception - * @return PHPExcel_Writer_Excel2007 - */ - public function setPHPExcel(PHPExcel $pPHPExcel = null) { - $this->_spreadSheet = $pPHPExcel; - return $this; - } - - /** - * Get string table - * - * @return string[] - */ - public function getStringTable() { - return $this->_stringTable; - } - - /** - * Get PHPExcel_Style_Conditional HashTable - * - * @return PHPExcel_HashTable - */ - public function getStylesConditionalHashTable() { - return $this->_stylesConditionalHashTable; - } - - /** - * Get PHPExcel_Style_Fill HashTable - * - * @return PHPExcel_HashTable - */ - public function getFillHashTable() { - return $this->_fillHashTable; - } - - /** - * Get PHPExcel_Style_Font HashTable - * - * @return PHPExcel_HashTable - */ - public function getFontHashTable() { - return $this->_fontHashTable; - } - - /** - * Get PHPExcel_Style_Borders HashTable - * - * @return PHPExcel_HashTable - */ - public function getBordersHashTable() { - return $this->_bordersHashTable; - } - - /** - * Get PHPExcel_Style_NumberFormat HashTable - * - * @return PHPExcel_HashTable - */ - public function getNumFmtHashTable() { - return $this->_numFmtHashTable; - } - - /** - * Get PHPExcel_Worksheet_BaseDrawing HashTable - * - * @return PHPExcel_HashTable - */ - public function getDrawingHashTable() { - return $this->_drawingHashTable; - } - - /** - * Get Pre-Calculate Formulas - * - * @return boolean - */ - public function getPreCalculateFormulas() { - return $this->_preCalculateFormulas; - } - - /** - * Set Pre-Calculate Formulas - * - * @param boolean $pValue Pre-Calculate Formulas? - */ - public function setPreCalculateFormulas($pValue = true) { - $this->_preCalculateFormulas = $pValue; - } - - /** - * Get Office2003 compatibility - * - * @return boolean - */ - public function getOffice2003Compatibility() { - return $this->_office2003compatibility; - } - - /** - * Set Pre-Calculate Formulas - * - * @param boolean $pValue Office2003 compatibility? - * @return PHPExcel_Writer_Excel2007 - */ - public function setOffice2003Compatibility($pValue = false) { - $this->_office2003compatibility = $pValue; - return $this; - } - - /** - * Get use disk caching where possible? - * - * @return boolean - */ - public function getUseDiskCaching() { - return $this->_useDiskCaching; - } - - /** - * Set use disk caching where possible? - * - * @param boolean $pValue - * @param string $pDirectory Disk caching directory - * @throws Exception Exception when directory does not exist - * @return PHPExcel_Writer_Excel2007 - */ - public function setUseDiskCaching($pValue = false, $pDirectory = null) { - $this->_useDiskCaching = $pValue; - - if ($pDirectory !== NULL) { - if (is_dir($pDirectory)) { - $this->_diskCachingDirectory = $pDirectory; - } else { - throw new Exception("Directory does not exist: $pDirectory"); - } - } - return $this; - } - - /** - * Get disk caching directory - * - * @return string - */ - public function getDiskCachingDirectory() { - return $this->_diskCachingDirectory; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Comments.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Comments.php deleted file mode 100644 index 2b758c2a9b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Comments.php +++ /dev/null @@ -1,268 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Comments - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Comments extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write comments to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeComments(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Comments cache - $comments = $pWorksheet->getComments(); - - // Authors cache - $authors = array(); - $authorId = 0; - foreach ($comments as $comment) { - if (!isset($authors[$comment->getAuthor()])) { - $authors[$comment->getAuthor()] = $authorId++; - } - } - - // comments - $objWriter->startElement('comments'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); - - // Loop through authors - $objWriter->startElement('authors'); - foreach ($authors as $author => $index) { - $objWriter->writeElement('author', $author); - } - $objWriter->endElement(); - - // Loop through comments - $objWriter->startElement('commentList'); - foreach ($comments as $key => $value) { - $this->_writeComment($objWriter, $key, $value, $authors); - } - $objWriter->endElement(); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write comment to XML format - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pCellReference Cell reference - * @param PHPExcel_Comment $pComment Comment - * @param array $pAuthors Array of authors - * @throws Exception - */ - public function _writeComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null, $pAuthors = null) - { - // comment - $objWriter->startElement('comment'); - $objWriter->writeAttribute('ref', $pCellReference); - $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]); - - // text - $objWriter->startElement('text'); - $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText()); - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write VML comments to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeVMLComments(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Comments cache - $comments = $pWorksheet->getComments(); - - // xml - $objWriter->startElement('xml'); - $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel'); - - // o:shapelayout - $objWriter->startElement('o:shapelayout'); - $objWriter->writeAttribute('v:ext', 'edit'); - - // o:idmap - $objWriter->startElement('o:idmap'); - $objWriter->writeAttribute('v:ext', 'edit'); - $objWriter->writeAttribute('data', '1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // v:shapetype - $objWriter->startElement('v:shapetype'); - $objWriter->writeAttribute('id', '_x0000_t202'); - $objWriter->writeAttribute('coordsize', '21600,21600'); - $objWriter->writeAttribute('o:spt', '202'); - $objWriter->writeAttribute('path', 'm,l,21600r21600,l21600,xe'); - - // v:stroke - $objWriter->startElement('v:stroke'); - $objWriter->writeAttribute('joinstyle', 'miter'); - $objWriter->endElement(); - - // v:path - $objWriter->startElement('v:path'); - $objWriter->writeAttribute('gradientshapeok', 't'); - $objWriter->writeAttribute('o:connecttype', 'rect'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // Loop through comments - foreach ($comments as $key => $value) { - $this->_writeVMLComment($objWriter, $key, $value); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write VML comment to XML format - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pCellReference Cell reference - * @param PHPExcel_Comment $pComment Comment - * @throws Exception - */ - public function _writeVMLComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null) - { - // Metadata - list($column, $row) = PHPExcel_Cell::coordinateFromString($pCellReference); - $column = PHPExcel_Cell::columnIndexFromString($column); - $id = 1024 + $column + $row; - $id = substr($id, 0, 4); - - // v:shape - $objWriter->startElement('v:shape'); - $objWriter->writeAttribute('id', '_x0000_s' . $id); - $objWriter->writeAttribute('type', '#_x0000_t202'); - $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden')); - $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB()); - $objWriter->writeAttribute('o:insetmode', 'auto'); - - // v:fill - $objWriter->startElement('v:fill'); - $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB()); - $objWriter->endElement(); - - // v:shadow - $objWriter->startElement('v:shadow'); - $objWriter->writeAttribute('on', 't'); - $objWriter->writeAttribute('color', 'black'); - $objWriter->writeAttribute('obscured', 't'); - $objWriter->endElement(); - - // v:path - $objWriter->startElement('v:path'); - $objWriter->writeAttribute('o:connecttype', 'none'); - $objWriter->endElement(); - - // v:textbox - $objWriter->startElement('v:textbox'); - $objWriter->writeAttribute('style', 'mso-direction-alt:auto'); - - // div - $objWriter->startElement('div'); - $objWriter->writeAttribute('style', 'text-align:left'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // x:ClientData - $objWriter->startElement('x:ClientData'); - $objWriter->writeAttribute('ObjectType', 'Note'); - - // x:MoveWithCells - $objWriter->writeElement('x:MoveWithCells', ''); - - // x:SizeWithCells - $objWriter->writeElement('x:SizeWithCells', ''); - - // x:Anchor - //$objWriter->writeElement('x:Anchor', $column . ', 15, ' . ($row - 2) . ', 10, ' . ($column + 4) . ', 15, ' . ($row + 5) . ', 18'); - - // x:AutoFill - $objWriter->writeElement('x:AutoFill', 'False'); - - // x:Row - $objWriter->writeElement('x:Row', ($row - 1)); - - // x:Column - $objWriter->writeElement('x:Column', ($column - 1)); - - $objWriter->endElement(); - - $objWriter->endElement(); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/ContentTypes.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/ContentTypes.php deleted file mode 100644 index 0b3191bb12..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/ContentTypes.php +++ /dev/null @@ -1,245 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_ContentTypes - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write content types to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeContentTypes(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Types - $objWriter->startElement('Types'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/content-types'); - - // Theme - $this->_writeOverrideContentType( - $objWriter, '/xl/theme/theme1.xml', 'application/vnd.openxmlformats-officedocument.theme+xml' - ); - - // Styles - $this->_writeOverrideContentType( - $objWriter, '/xl/styles.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml' - ); - - // Rels - $this->_writeDefaultContentType( - $objWriter, 'rels', 'application/vnd.openxmlformats-package.relationships+xml' - ); - - // XML - $this->_writeDefaultContentType( - $objWriter, 'xml', 'application/xml' - ); - - // VML - $this->_writeDefaultContentType( - $objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing' - ); - - // Workbook - $this->_writeOverrideContentType( - $objWriter, '/xl/workbook.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml' - ); - - // DocProps - $this->_writeOverrideContentType( - $objWriter, '/docProps/app.xml', 'application/vnd.openxmlformats-officedocument.extended-properties+xml' - ); - - $this->_writeOverrideContentType( - $objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml' - ); - - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); - if (count($customPropertyList) > 0) { - $this->_writeOverrideContentType( - $objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml' - ); - } - - // Worksheets - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - $this->_writeOverrideContentType( - $objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml' - ); - } - - // Shared strings - $this->_writeOverrideContentType( - $objWriter, '/xl/sharedStrings.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml' - ); - - // Add worksheet relationship content types - for ($i = 0; $i < $sheetCount; ++$i) { - if ($pPHPExcel->getSheet($i)->getDrawingCollection()->count() > 0) { - $this->_writeOverrideContentType( - $objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml' - ); - } - } - - // Comments - for ($i = 0; $i < $sheetCount; ++$i) { - if (count($pPHPExcel->getSheet($i)->getComments()) > 0) { - $this->_writeOverrideContentType( - $objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml' - ); - } - } - - // Add media content-types - $aMediaContentTypes = array(); - $mediaCount = $this->getParentWriter()->getDrawingHashTable()->count(); - for ($i = 0; $i < $mediaCount; ++$i) { - $extension = ''; - $mimeType = ''; - - if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) { - $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension()); - $mimeType = $this->_getImageMimeType( $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath() ); - } else if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) { - $extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType()); - $extension = explode('/', $extension); - $extension = $extension[1]; - - $mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType(); - } - - if (!isset( $aMediaContentTypes[$extension]) ) { - $aMediaContentTypes[$extension] = $mimeType; - - $this->_writeDefaultContentType( - $objWriter, $extension, $mimeType - ); - } - } - - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - if (count($pPHPExcel->getSheet()->getHeaderFooter()->getImages()) > 0) { - foreach ($pPHPExcel->getSheet()->getHeaderFooter()->getImages() as $image) { - if (!isset( $aMediaContentTypes[strtolower($image->getExtension())]) ) { - $aMediaContentTypes[strtolower($image->getExtension())] = $this->_getImageMimeType( $image->getPath() ); - - $this->_writeDefaultContentType( - $objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())] - ); - } - } - } - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Get image mime type - * - * @param string $pFile Filename - * @return string Mime Type - * @throws Exception - */ - private function _getImageMimeType($pFile = '') - { - if (PHPExcel_Shared_File::file_exists($pFile)) { - $image = getimagesize($pFile); - return image_type_to_mime_type($image[2]); - } else { - throw new Exception("File $pFile does not exist"); - } - } - - /** - * Write Default content type - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pPartname Part name - * @param string $pContentType Content type - * @throws Exception - */ - private function _writeDefaultContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') - { - if ($pPartname != '' && $pContentType != '') { - // Write content type - $objWriter->startElement('Default'); - $objWriter->writeAttribute('Extension', $pPartname); - $objWriter->writeAttribute('ContentType', $pContentType); - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Write Override content type - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pPartname Part name - * @param string $pContentType Content type - * @throws Exception - */ - private function _writeOverrideContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '') - { - if ($pPartname != '' && $pContentType != '') { - // Write content type - $objWriter->startElement('Override'); - $objWriter->writeAttribute('PartName', $pPartname); - $objWriter->writeAttribute('ContentType', $pContentType); - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/DocProps.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/DocProps.php deleted file mode 100644 index f6c6bbcd6d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/DocProps.php +++ /dev/null @@ -1,272 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_DocProps - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_WriterPart -{ -/** - * Write docProps/app.xml to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeDocPropsApp(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Properties - $objWriter->startElement('Properties'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'); - $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); - - // Application - $objWriter->writeElement('Application', 'Microsoft Excel'); - - // DocSecurity - $objWriter->writeElement('DocSecurity', '0'); - - // ScaleCrop - $objWriter->writeElement('ScaleCrop', 'false'); - - // HeadingPairs - $objWriter->startElement('HeadingPairs'); - - // Vector - $objWriter->startElement('vt:vector'); - $objWriter->writeAttribute('size', '2'); - $objWriter->writeAttribute('baseType', 'variant'); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:lpstr', 'Worksheets'); - $objWriter->endElement(); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:i4', $pPHPExcel->getSheetCount()); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // TitlesOfParts - $objWriter->startElement('TitlesOfParts'); - - // Vector - $objWriter->startElement('vt:vector'); - $objWriter->writeAttribute('size', $pPHPExcel->getSheetCount()); - $objWriter->writeAttribute('baseType', 'lpstr'); - - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - $objWriter->writeElement('vt:lpstr', $pPHPExcel->getSheet($i)->getTitle()); - } - - $objWriter->endElement(); - - $objWriter->endElement(); - - // Company - $objWriter->writeElement('Company', $pPHPExcel->getProperties()->getCompany()); - - // Company - $objWriter->writeElement('Manager', $pPHPExcel->getProperties()->getManager()); - - // LinksUpToDate - $objWriter->writeElement('LinksUpToDate', 'false'); - - // SharedDoc - $objWriter->writeElement('SharedDoc', 'false'); - - // HyperlinksChanged - $objWriter->writeElement('HyperlinksChanged', 'false'); - - // AppVersion - $objWriter->writeElement('AppVersion', '12.0000'); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write docProps/core.xml to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeDocPropsCore(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // cp:coreProperties - $objWriter->startElement('cp:coreProperties'); - $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'); - $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); - $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/'); - $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/'); - $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - - // dc:creator - $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator()); - - // cp:lastModifiedBy - $objWriter->writeElement('cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy()); - - // dcterms:created - $objWriter->startElement('dcterms:created'); - $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated())); - $objWriter->endElement(); - - // dcterms:modified - $objWriter->startElement('dcterms:modified'); - $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getModified())); - $objWriter->endElement(); - - // dc:title - $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle()); - - // dc:description - $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription()); - - // dc:subject - $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject()); - - // cp:keywords - $objWriter->writeElement('cp:keywords', $pPHPExcel->getProperties()->getKeywords()); - - // cp:category - $objWriter->writeElement('cp:category', $pPHPExcel->getProperties()->getCategory()); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write docProps/custom.xml to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeDocPropsCustom(PHPExcel $pPHPExcel = null) - { - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); - if (count($customPropertyList) == 0) { - return; - } - - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // cp:coreProperties - $objWriter->startElement('Properties'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/custom-properties'); - $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); - - - foreach($customPropertyList as $key => $customProperty) { - $propertyValue = $pPHPExcel->getProperties()->getCustomPropertyValue($customProperty); - $propertyType = $pPHPExcel->getProperties()->getCustomPropertyType($customProperty); - - $objWriter->startElement('property'); - $objWriter->writeAttribute('fmtid', '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'); - $objWriter->writeAttribute('pid', $key+2); - $objWriter->writeAttribute('name', $customProperty); - - switch($propertyType) { - case 'i' : - $objWriter->writeElement('vt:i4', $propertyValue); - break; - case 'f' : - $objWriter->writeElement('vt:r8', $propertyValue); - break; - case 'b' : - $objWriter->writeElement('vt:bool', ($propertyValue) ? 'true' : 'false'); - break; - case 'd' : - $objWriter->startElement('vt:filetime'); - $objWriter->writeRawData(date(DATE_W3C, $propertyValue)); - $objWriter->endElement(); - break; - default : - $objWriter->writeElement('vt:lpwstr', $propertyValue); - break; - } - - $objWriter->endElement(); - } - - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Drawing.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Drawing.php deleted file mode 100644 index 59b3bfb640..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Drawing.php +++ /dev/null @@ -1,513 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Drawing - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Drawing extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write drawings to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeDrawings(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // xdr:wsDr - $objWriter->startElement('xdr:wsDr'); - $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); - $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); - - // Loop through images and write drawings - $i = 1; - $iterator = $pWorksheet->getDrawingCollection()->getIterator(); - while ($iterator->valid()) { - $this->_writeDrawing($objWriter, $iterator->current(), $i); - - $iterator->next(); - ++$i; - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write drawings to XML format - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet_BaseDrawing $pDrawing - * @param int $pRelationId - * @throws Exception - */ - public function _writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1) - { - if ($pRelationId >= 0) { - // xdr:oneCellAnchor - $objWriter->startElement('xdr:oneCellAnchor'); - // Image location - $aCoordinates = PHPExcel_Cell::coordinateFromString($pDrawing->getCoordinates()); - $aCoordinates[0] = PHPExcel_Cell::columnIndexFromString($aCoordinates[0]); - - // xdr:from - $objWriter->startElement('xdr:from'); - $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1); - $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX())); - $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1); - $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY())); - $objWriter->endElement(); - - // xdr:ext - $objWriter->startElement('xdr:ext'); - $objWriter->writeAttribute('cx', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth())); - $objWriter->writeAttribute('cy', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight())); - $objWriter->endElement(); - - // xdr:pic - $objWriter->startElement('xdr:pic'); - - // xdr:nvPicPr - $objWriter->startElement('xdr:nvPicPr'); - - // xdr:cNvPr - $objWriter->startElement('xdr:cNvPr'); - $objWriter->writeAttribute('id', $pRelationId); - $objWriter->writeAttribute('name', $pDrawing->getName()); - $objWriter->writeAttribute('descr', $pDrawing->getDescription()); - $objWriter->endElement(); - - // xdr:cNvPicPr - $objWriter->startElement('xdr:cNvPicPr'); - - // a:picLocks - $objWriter->startElement('a:picLocks'); - $objWriter->writeAttribute('noChangeAspect', '1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // xdr:blipFill - $objWriter->startElement('xdr:blipFill'); - - // a:blip - $objWriter->startElement('a:blip'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId); - $objWriter->endElement(); - - // a:stretch - $objWriter->startElement('a:stretch'); - $objWriter->writeElement('a:fillRect', null); - $objWriter->endElement(); - - $objWriter->endElement(); - - // xdr:spPr - $objWriter->startElement('xdr:spPr'); - - // a:xfrm - $objWriter->startElement('a:xfrm'); - $objWriter->writeAttribute('rot', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getRotation())); - $objWriter->endElement(); - - // a:prstGeom - $objWriter->startElement('a:prstGeom'); - $objWriter->writeAttribute('prst', 'rect'); - - // a:avLst - $objWriter->writeElement('a:avLst', null); - - $objWriter->endElement(); - -// // a:solidFill -// $objWriter->startElement('a:solidFill'); - -// // a:srgbClr -// $objWriter->startElement('a:srgbClr'); -// $objWriter->writeAttribute('val', 'FFFFFF'); - -///* SHADE -// // a:shade -// $objWriter->startElement('a:shade'); -// $objWriter->writeAttribute('val', '85000'); -// $objWriter->endElement(); -//*/ - -// $objWriter->endElement(); - -// $objWriter->endElement(); -/* - // a:ln - $objWriter->startElement('a:ln'); - $objWriter->writeAttribute('w', '88900'); - $objWriter->writeAttribute('cap', 'sq'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', 'FFFFFF'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:miter - $objWriter->startElement('a:miter'); - $objWriter->writeAttribute('lim', '800000'); - $objWriter->endElement(); - - $objWriter->endElement(); -*/ - - if ($pDrawing->getShadow()->getVisible()) { - // a:effectLst - $objWriter->startElement('a:effectLst'); - - // a:outerShdw - $objWriter->startElement('a:outerShdw'); - $objWriter->writeAttribute('blurRad', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); - $objWriter->writeAttribute('dist', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); - $objWriter->writeAttribute('dir', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); - $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment()); - $objWriter->writeAttribute('rotWithShape', '0'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', $pDrawing->getShadow()->getColor()->getRGB()); - - // a:alpha - $objWriter->startElement('a:alpha'); - $objWriter->writeAttribute('val', $pDrawing->getShadow()->getAlpha() * 1000); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } -/* - - // a:scene3d - $objWriter->startElement('a:scene3d'); - - // a:camera - $objWriter->startElement('a:camera'); - $objWriter->writeAttribute('prst', 'orthographicFront'); - $objWriter->endElement(); - - // a:lightRig - $objWriter->startElement('a:lightRig'); - $objWriter->writeAttribute('rig', 'twoPt'); - $objWriter->writeAttribute('dir', 't'); - - // a:rot - $objWriter->startElement('a:rot'); - $objWriter->writeAttribute('lat', '0'); - $objWriter->writeAttribute('lon', '0'); - $objWriter->writeAttribute('rev', '0'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); -*/ -/* - // a:sp3d - $objWriter->startElement('a:sp3d'); - - // a:bevelT - $objWriter->startElement('a:bevelT'); - $objWriter->writeAttribute('w', '25400'); - $objWriter->writeAttribute('h', '19050'); - $objWriter->endElement(); - - // a:contourClr - $objWriter->startElement('a:contourClr'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', 'FFFFFF'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); -*/ - $objWriter->endElement(); - - $objWriter->endElement(); - - // xdr:clientData - $objWriter->writeElement('xdr:clientData', null); - - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Write VML header/footer images to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Header/footer images - $images = $pWorksheet->getHeaderFooter()->getImages(); - - // xml - $objWriter->startElement('xml'); - $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel'); - - // o:shapelayout - $objWriter->startElement('o:shapelayout'); - $objWriter->writeAttribute('v:ext', 'edit'); - - // o:idmap - $objWriter->startElement('o:idmap'); - $objWriter->writeAttribute('v:ext', 'edit'); - $objWriter->writeAttribute('data', '1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // v:shapetype - $objWriter->startElement('v:shapetype'); - $objWriter->writeAttribute('id', '_x0000_t75'); - $objWriter->writeAttribute('coordsize', '21600,21600'); - $objWriter->writeAttribute('o:spt', '75'); - $objWriter->writeAttribute('o:preferrelative', 't'); - $objWriter->writeAttribute('path', 'm@4@5l@4@11@9@11@9@5xe'); - $objWriter->writeAttribute('filled', 'f'); - $objWriter->writeAttribute('stroked', 'f'); - - // v:stroke - $objWriter->startElement('v:stroke'); - $objWriter->writeAttribute('joinstyle', 'miter'); - $objWriter->endElement(); - - // v:formulas - $objWriter->startElement('v:formulas'); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'if lineDrawn pixelLineWidth 0'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'sum @0 1 0'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'sum 0 0 @1'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @2 1 2'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelWidth'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelHeight'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'sum @0 0 1'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @6 1 2'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelWidth'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'sum @8 21600 0'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelHeight'); - $objWriter->endElement(); - - // v:f - $objWriter->startElement('v:f'); - $objWriter->writeAttribute('eqn', 'sum @10 21600 0'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // v:path - $objWriter->startElement('v:path'); - $objWriter->writeAttribute('o:extrusionok', 'f'); - $objWriter->writeAttribute('gradientshapeok', 't'); - $objWriter->writeAttribute('o:connecttype', 'rect'); - $objWriter->endElement(); - - // o:lock - $objWriter->startElement('o:lock'); - $objWriter->writeAttribute('v:ext', 'edit'); - $objWriter->writeAttribute('aspectratio', 't'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // Loop through images - foreach ($images as $key => $value) { - $this->_writeVMLHeaderFooterImage($objWriter, $key, $value); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write VML comment to XML format - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pReference Reference - * @param PHPExcel_Worksheet_HeaderFooterDrawing $pImage Image - * @throws Exception - */ - public function _writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter = null, $pReference = '', PHPExcel_Worksheet_HeaderFooterDrawing $pImage = null) - { - // Calculate object id - preg_match('{(\d+)}', md5($pReference), $m); - $id = 1500 + (substr($m[1], 0, 2) * 1); - - // Calculate offset - $width = $pImage->getWidth(); - $height = $pImage->getHeight(); - $marginLeft = $pImage->getOffsetX(); - $marginTop = $pImage->getOffsetY(); - - // v:shape - $objWriter->startElement('v:shape'); - $objWriter->writeAttribute('id', $pReference); - $objWriter->writeAttribute('o:spid', '_x0000_s' . $id); - $objWriter->writeAttribute('type', '#_x0000_t75'); - $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1"); - - // v:imagedata - $objWriter->startElement('v:imagedata'); - $objWriter->writeAttribute('o:relid', 'rId' . $pReference); - $objWriter->writeAttribute('o:title', $pImage->getName()); - $objWriter->endElement(); - - // o:lock - $objWriter->startElement('o:lock'); - $objWriter->writeAttribute('v:ext', 'edit'); - $objWriter->writeAttribute('rotation', 't'); - $objWriter->endElement(); - - $objWriter->endElement(); - } - - - /** - * Get an array of all drawings - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel - * @throws Exception - */ - public function allDrawings(PHPExcel $pPHPExcel = null) - { - // Get an array of all drawings - $aDrawings = array(); - - // Loop through PHPExcel - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - // Loop through images and add to array - $iterator = $pPHPExcel->getSheet($i)->getDrawingCollection()->getIterator(); - while ($iterator->valid()) { - $aDrawings[] = $iterator->current(); - - $iterator->next(); - } - } - - return $aDrawings; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Rels.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Rels.php deleted file mode 100644 index fbde8cdc2d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Rels.php +++ /dev/null @@ -1,377 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Rels - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write relationships to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeRelationships(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Relationships - $objWriter->startElement('Relationships'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - - $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties(); - if (count($customPropertyList) > 0) { - // Relationship docProps/app.xml - $this->_writeRelationship( - $objWriter, - 4, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties', - 'docProps/custom.xml' - ); - - } - - // Relationship docProps/app.xml - $this->_writeRelationship( - $objWriter, - 3, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties', - 'docProps/app.xml' - ); - - // Relationship docProps/core.xml - $this->_writeRelationship( - $objWriter, - 2, - 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties', - 'docProps/core.xml' - ); - - // Relationship xl/workbook.xml - $this->_writeRelationship( - $objWriter, - 1, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument', - 'xl/workbook.xml' - ); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write workbook relationships to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Relationships - $objWriter->startElement('Relationships'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - - // Relationship styles.xml - $this->_writeRelationship( - $objWriter, - 1, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles', - 'styles.xml' - ); - - // Relationship theme/theme1.xml - $this->_writeRelationship( - $objWriter, - 2, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', - 'theme/theme1.xml' - ); - - // Relationship sharedStrings.xml - $this->_writeRelationship( - $objWriter, - 3, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings', - 'sharedStrings.xml' - ); - - // Relationships with sheets - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - $this->_writeRelationship( - $objWriter, - ($i + 1 + 3), - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet', - 'worksheets/sheet' . ($i + 1) . '.xml' - ); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write worksheet relationships to XML format - * - * Numbering is as follows: - * rId1 - Drawings - * rId_hyperlink_x - Hyperlinks - * - * @param PHPExcel_Worksheet $pWorksheet - * @param int $pWorksheetId - * @return string XML Output - * @throws Exception - */ - public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Relationships - $objWriter->startElement('Relationships'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - - // Write drawing relationships? - if ($pWorksheet->getDrawingCollection()->count() > 0) { - $this->_writeRelationship( - $objWriter, - 1, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing', - '../drawings/drawing' . $pWorksheetId . '.xml' - ); - } - - // Write hyperlink relationships? - $i = 1; - foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) { - if (!$hyperlink->isInternal()) { - $this->_writeRelationship( - $objWriter, - '_hyperlink_' . $i, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', - $hyperlink->getUrl(), - 'External' - ); - - ++$i; - } - } - - // Write comments relationship? - $i = 1; - if (count($pWorksheet->getComments()) > 0) { - $this->_writeRelationship( - $objWriter, - '_comments_vml' . $i, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', - '../drawings/vmlDrawing' . $pWorksheetId . '.vml' - ); - - $this->_writeRelationship( - $objWriter, - '_comments' . $i, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments', - '../comments' . $pWorksheetId . '.xml' - ); - } - - // Write header/footer relationship? - $i = 1; - if (count($pWorksheet->getHeaderFooter()->getImages()) > 0) { - $this->_writeRelationship( - $objWriter, - '_headerfooter_vml' . $i, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing', - '../drawings/vmlDrawingHF' . $pWorksheetId . '.vml' - ); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write drawing relationships to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Relationships - $objWriter->startElement('Relationships'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - - // Loop through images and write relationships - $i = 1; - $iterator = $pWorksheet->getDrawingCollection()->getIterator(); - while ($iterator->valid()) { - if ($iterator->current() instanceof PHPExcel_Worksheet_Drawing - || $iterator->current() instanceof PHPExcel_Worksheet_MemoryDrawing) { - // Write relationship for image drawing - $this->_writeRelationship( - $objWriter, - $i, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', - '../media/' . str_replace(' ', '', $iterator->current()->getIndexedFilename()) - ); - } - - $iterator->next(); - ++$i; - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write header/footer drawing relationships to XML format - * - * @param PHPExcel_Worksheet $pWorksheet - * @return string XML Output - * @throws Exception - */ - public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Relationships - $objWriter->startElement('Relationships'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); - - // Loop through images and write relationships - foreach ($pWorksheet->getHeaderFooter()->getImages() as $key => $value) { - // Write relationship for image drawing - $this->_writeRelationship( - $objWriter, - $key, - 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', - '../media/' . $value->getIndexedFilename() - ); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write Override content type - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param int $pId Relationship ID. rId will be prepended! - * @param string $pType Relationship type - * @param string $pTarget Relationship target - * @param string $pTargetMode Relationship target mode - * @throws Exception - */ - private function _writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') - { - if ($pType != '' && $pTarget != '') { - // Write relationship - $objWriter->startElement('Relationship'); - $objWriter->writeAttribute('Id', 'rId' . $pId); - $objWriter->writeAttribute('Type', $pType); - $objWriter->writeAttribute('Target', $pTarget); - - if ($pTargetMode != '') { - $objWriter->writeAttribute('TargetMode', $pTargetMode); - } - - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/StringTable.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/StringTable.php deleted file mode 100644 index 2e71c67d19..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/StringTable.php +++ /dev/null @@ -1,243 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_StringTable - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_StringTable extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Create worksheet stringtable - * - * @param PHPExcel_Worksheet $pSheet Worksheet - * @param string[] $pExistingTable Existing table to eventually merge with - * @return string[] String table for worksheet - * @throws Exception - */ - public function createStringTable($pSheet = null, $pExistingTable = null) - { - if (!is_null($pSheet)) { - // Create string lookup table - $aStringTable = array(); - $cellCollection = null; - $aFlippedStringTable = null; // For faster lookup - - // Is an existing table given? - if (!is_null($pExistingTable) && is_array($pExistingTable)) { - $aStringTable = $pExistingTable; - } - - // Fill index array - $aFlippedStringTable = $this->flipStringTable($aStringTable); - - // Loop through cells - foreach ($pSheet->getCellCollection() as $cellID) { - $cell = $pSheet->getCell($cellID); - $cellValue = $cell->getValue(); - if (!is_object($cellValue) && - !is_null($cellValue) && - $cellValue !== '' && - !isset($aFlippedStringTable[$cellValue]) && - ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) { - $aStringTable[] = $cellValue; - $aFlippedStringTable[$cellValue] = 1; - } elseif ($cellValue instanceof PHPExcel_RichText && - !is_null($cellValue) && - !isset($aFlippedStringTable[$cellValue->getHashCode()])) { - $aStringTable[] = $cellValue; - $aFlippedStringTable[$cellValue->getHashCode()] = 1; - } - } - - // Return - return $aStringTable; - } else { - throw new Exception("Invalid PHPExcel_Worksheet object passed."); - } - } - - /** - * Write string table to XML format - * - * @param string[] $pStringTable - * @return string XML Output - * @throws Exception - */ - public function writeStringTable($pStringTable = null) - { - if (!is_null($pStringTable)) { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // String table - $objWriter->startElement('sst'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); - $objWriter->writeAttribute('uniqueCount', count($pStringTable)); - - // Loop through string table - foreach ($pStringTable as $textElement) { - $objWriter->startElement('si'); - - if (! $textElement instanceof PHPExcel_RichText) { - $textToWrite = PHPExcel_Shared_String::ControlCharacterPHP2OOXML( $textElement ); - $objWriter->startElement('t'); - if ($textToWrite !== trim($textToWrite)) { - $objWriter->writeAttribute('xml:space', 'preserve'); - } - $objWriter->writeRawData($textToWrite); - $objWriter->endElement(); - } else if ($textElement instanceof PHPExcel_RichText) { - $this->writeRichText($objWriter, $textElement); - } - - $objWriter->endElement(); - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } else { - throw new Exception("Invalid string table array passed."); - } - } - - /** - * Write Rich Text - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_RichText $pRichText Rich text - * @throws Exception - */ - public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null) - { - // Loop through rich text elements - $elements = $pRichText->getRichTextElements(); - foreach ($elements as $element) { - // r - $objWriter->startElement('r'); - - // rPr - if ($element instanceof PHPExcel_RichText_Run) { - // rPr - $objWriter->startElement('rPr'); - - // rFont - $objWriter->startElement('rFont'); - $objWriter->writeAttribute('val', $element->getFont()->getName()); - $objWriter->endElement(); - - // Bold - $objWriter->startElement('b'); - $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false')); - $objWriter->endElement(); - - // Italic - $objWriter->startElement('i'); - $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false')); - $objWriter->endElement(); - - // Superscript / subscript - if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) { - $objWriter->startElement('vertAlign'); - if ($element->getFont()->getSuperScript()) { - $objWriter->writeAttribute('val', 'superscript'); - } else if ($element->getFont()->getSubScript()) { - $objWriter->writeAttribute('val', 'subscript'); - } - $objWriter->endElement(); - } - - // Strikethrough - $objWriter->startElement('strike'); - $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false')); - $objWriter->endElement(); - - // Color - $objWriter->startElement('color'); - $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB()); - $objWriter->endElement(); - - // Size - $objWriter->startElement('sz'); - $objWriter->writeAttribute('val', $element->getFont()->getSize()); - $objWriter->endElement(); - - // Underline - $objWriter->startElement('u'); - $objWriter->writeAttribute('val', $element->getFont()->getUnderline()); - $objWriter->endElement(); - - $objWriter->endElement(); - } - - // t - $objWriter->startElement('t'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML( $element->getText() )); - $objWriter->endElement(); - - $objWriter->endElement(); - } - } - - /** - * Flip string table (for index searching) - * - * @param array $stringTable Stringtable - * @return array - */ - public function flipStringTable($stringTable = array()) { - // Return value - $returnValue = array(); - - // Loop through stringtable and add flipped items to $returnValue - foreach ($stringTable as $key => $value) { - if (! $value instanceof PHPExcel_RichText) { - $returnValue[$value] = $key; - } else if ($value instanceof PHPExcel_RichText) { - $returnValue[$value->getHashCode()] = $key; - } - } - - // Return - return $returnValue; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Style.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Style.php deleted file mode 100644 index 2cdc89adce..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Style.php +++ /dev/null @@ -1,665 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Style - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write styles to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeStyles(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // styleSheet - $objWriter->startElement('styleSheet'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); - - // numFmts - $objWriter->startElement('numFmts'); - $objWriter->writeAttribute('count', $this->getParentWriter()->getNumFmtHashTable()->count()); - - // numFmt - for ($i = 0; $i < $this->getParentWriter()->getNumFmtHashTable()->count(); ++$i) { - $this->_writeNumFmt($objWriter, $this->getParentWriter()->getNumFmtHashTable()->getByIndex($i), $i); - } - - $objWriter->endElement(); - - // fonts - $objWriter->startElement('fonts'); - $objWriter->writeAttribute('count', $this->getParentWriter()->getFontHashTable()->count()); - - // font - for ($i = 0; $i < $this->getParentWriter()->getFontHashTable()->count(); ++$i) { - $this->_writeFont($objWriter, $this->getParentWriter()->getFontHashTable()->getByIndex($i)); - } - - $objWriter->endElement(); - - // fills - $objWriter->startElement('fills'); - $objWriter->writeAttribute('count', $this->getParentWriter()->getFillHashTable()->count()); - - // fill - for ($i = 0; $i < $this->getParentWriter()->getFillHashTable()->count(); ++$i) { - $this->_writeFill($objWriter, $this->getParentWriter()->getFillHashTable()->getByIndex($i)); - } - - $objWriter->endElement(); - - // borders - $objWriter->startElement('borders'); - $objWriter->writeAttribute('count', $this->getParentWriter()->getBordersHashTable()->count()); - - // border - for ($i = 0; $i < $this->getParentWriter()->getBordersHashTable()->count(); ++$i) { - $this->_writeBorder($objWriter, $this->getParentWriter()->getBordersHashTable()->getByIndex($i)); - } - - $objWriter->endElement(); - - // cellStyleXfs - $objWriter->startElement('cellStyleXfs'); - $objWriter->writeAttribute('count', 1); - - // xf - $objWriter->startElement('xf'); - $objWriter->writeAttribute('numFmtId', 0); - $objWriter->writeAttribute('fontId', 0); - $objWriter->writeAttribute('fillId', 0); - $objWriter->writeAttribute('borderId', 0); - $objWriter->endElement(); - - $objWriter->endElement(); - - // cellXfs - $objWriter->startElement('cellXfs'); - $objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection())); - - // xf - foreach ($pPHPExcel->getCellXfCollection() as $cellXf) { - $this->_writeCellStyleXf($objWriter, $cellXf, $pPHPExcel); - } - - $objWriter->endElement(); - - // cellStyles - $objWriter->startElement('cellStyles'); - $objWriter->writeAttribute('count', 1); - - // cellStyle - $objWriter->startElement('cellStyle'); - $objWriter->writeAttribute('name', 'Normal'); - $objWriter->writeAttribute('xfId', 0); - $objWriter->writeAttribute('builtinId', 0); - $objWriter->endElement(); - - $objWriter->endElement(); - - // dxfs - $objWriter->startElement('dxfs'); - $objWriter->writeAttribute('count', $this->getParentWriter()->getStylesConditionalHashTable()->count()); - - // dxf - for ($i = 0; $i < $this->getParentWriter()->getStylesConditionalHashTable()->count(); ++$i) { - $this->_writeCellStyleDxf($objWriter, $this->getParentWriter()->getStylesConditionalHashTable()->getByIndex($i)->getStyle()); - } - - $objWriter->endElement(); - - // tableStyles - $objWriter->startElement('tableStyles'); - $objWriter->writeAttribute('defaultTableStyle', 'TableStyleMedium9'); - $objWriter->writeAttribute('defaultPivotStyle', 'PivotTableStyle1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write Fill - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_Fill $pFill Fill style - * @throws Exception - */ - private function _writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) - { - // Check if this is a pattern type or gradient type - if ($pFill->getFillType() == PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR - || $pFill->getFillType() == PHPExcel_Style_Fill::FILL_GRADIENT_PATH) { - // Gradient fill - $this->_writeGradientFill($objWriter, $pFill); - } else { - // Pattern fill - $this->_writePatternFill($objWriter, $pFill); - } - } - - /** - * Write Gradient Fill - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_Fill $pFill Fill style - * @throws Exception - */ - private function _writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) - { - // fill - $objWriter->startElement('fill'); - - // gradientFill - $objWriter->startElement('gradientFill'); - $objWriter->writeAttribute('type', $pFill->getFillType()); - $objWriter->writeAttribute('degree', $pFill->getRotation()); - - // stop - $objWriter->startElement('stop'); - $objWriter->writeAttribute('position', '0'); - - // color - $objWriter->startElement('color'); - $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB()); - $objWriter->endElement(); - - $objWriter->endElement(); - - // stop - $objWriter->startElement('stop'); - $objWriter->writeAttribute('position', '1'); - - // color - $objWriter->startElement('color'); - $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB()); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write Pattern Fill - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_Fill $pFill Fill style - * @throws Exception - */ - private function _writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) - { - // fill - $objWriter->startElement('fill'); - - // patternFill - $objWriter->startElement('patternFill'); - $objWriter->writeAttribute('patternType', $pFill->getFillType()); - - // fgColor - $objWriter->startElement('fgColor'); - $objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB()); - $objWriter->endElement(); - - // bgColor - $objWriter->startElement('bgColor'); - $objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB()); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write Font - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_Font $pFont Font style - * @throws Exception - */ - private function _writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null) - { - // font - $objWriter->startElement('font'); - - // Name - $objWriter->startElement('name'); - $objWriter->writeAttribute('val', $pFont->getName()); - $objWriter->endElement(); - - // Size - $objWriter->startElement('sz'); - $objWriter->writeAttribute('val', $pFont->getSize()); - $objWriter->endElement(); - - // Bold. We explicitly write this element also when false (like MS Office Excel 2007 does - // for conditional formatting). Otherwise it will apparently not be picked up in conditional - // formatting style dialog - $objWriter->startElement('b'); - $objWriter->writeAttribute('val', $pFont->getBold() ? '1' : '0'); - $objWriter->endElement(); - - // Italic - $objWriter->startElement('i'); - $objWriter->writeAttribute('val', $pFont->getItalic() ? '1' : '0'); - $objWriter->endElement(); - - // Superscript / subscript - if ($pFont->getSuperScript() || $pFont->getSubScript()) { - $objWriter->startElement('vertAlign'); - if ($pFont->getSuperScript()) { - $objWriter->writeAttribute('val', 'superscript'); - } else if ($pFont->getSubScript()) { - $objWriter->writeAttribute('val', 'subscript'); - } - $objWriter->endElement(); - } - - // Underline - $objWriter->startElement('u'); - $objWriter->writeAttribute('val', $pFont->getUnderline()); - $objWriter->endElement(); - - // Strikethrough - $objWriter->startElement('strike'); - $objWriter->writeAttribute('val', $pFont->getStrikethrough() ? '1' : '0'); - $objWriter->endElement(); - - // Foreground color - $objWriter->startElement('color'); - $objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB()); - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write Border - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_Borders $pBorders Borders style - * @throws Exception - */ - private function _writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null) - { - // Write border - $objWriter->startElement('border'); - // Diagonal? - switch ($pBorders->getDiagonalDirection()) { - case PHPExcel_Style_Borders::DIAGONAL_UP: - $objWriter->writeAttribute('diagonalUp', 'true'); - $objWriter->writeAttribute('diagonalDown', 'false'); - break; - case PHPExcel_Style_Borders::DIAGONAL_DOWN: - $objWriter->writeAttribute('diagonalUp', 'false'); - $objWriter->writeAttribute('diagonalDown', 'true'); - break; - case PHPExcel_Style_Borders::DIAGONAL_BOTH: - $objWriter->writeAttribute('diagonalUp', 'true'); - $objWriter->writeAttribute('diagonalDown', 'true'); - break; - } - - // BorderPr - $this->_writeBorderPr($objWriter, 'left', $pBorders->getLeft()); - $this->_writeBorderPr($objWriter, 'right', $pBorders->getRight()); - $this->_writeBorderPr($objWriter, 'top', $pBorders->getTop()); - $this->_writeBorderPr($objWriter, 'bottom', $pBorders->getBottom()); - $this->_writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal()); - $objWriter->endElement(); - } - - /** - * Write Cell Style Xf - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style $pStyle Style - * @param PHPExcel $pPHPExcel Workbook - * @throws Exception - */ - private function _writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null) - { - // xf - $objWriter->startElement('xf'); - $objWriter->writeAttribute('xfId', 0); - $objWriter->writeAttribute('fontId', (int)$this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode())); - - if ($pStyle->getNumberFormat()->getBuiltInFormatCode() === false) { - $objWriter->writeAttribute('numFmtId', (int)($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164) ); - } else { - $objWriter->writeAttribute('numFmtId', (int)$pStyle->getNumberFormat()->getBuiltInFormatCode()); - } - - $objWriter->writeAttribute('fillId', (int)$this->getParentWriter()->getFillHashTable()->getIndexForHashCode($pStyle->getFill()->getHashCode())); - $objWriter->writeAttribute('borderId', (int)$this->getParentWriter()->getBordersHashTable()->getIndexForHashCode($pStyle->getBorders()->getHashCode())); - - // Apply styles? - $objWriter->writeAttribute('applyFont', ($pPHPExcel->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyNumberFormat', ($pPHPExcel->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0'); - $objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0'); - if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('applyProtection', 'true'); - } - - // alignment - $objWriter->startElement('alignment'); - $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); - $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); - - $textRotation = 0; - if ($pStyle->getAlignment()->getTextRotation() >= 0) { - $textRotation = $pStyle->getAlignment()->getTextRotation(); - } else if ($pStyle->getAlignment()->getTextRotation() < 0) { - $textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); - } - - $objWriter->writeAttribute('textRotation', $textRotation); - $objWriter->writeAttribute('wrapText', ($pStyle->getAlignment()->getWrapText() ? 'true' : 'false')); - $objWriter->writeAttribute('shrinkToFit', ($pStyle->getAlignment()->getShrinkToFit() ? 'true' : 'false')); - - if ($pStyle->getAlignment()->getIndent() > 0) { - $objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent()); - } - $objWriter->endElement(); - - // protection - if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->startElement('protection'); - if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); - } - if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); - } - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - - /** - * Write Cell Style Dxf - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style $pStyle Style - * @throws Exception - */ - private function _writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null) - { - // dxf - $objWriter->startElement('dxf'); - - // font - $this->_writeFont($objWriter, $pStyle->getFont()); - - // numFmt - $this->_writeNumFmt($objWriter, $pStyle->getNumberFormat()); - - // fill - $this->_writeFill($objWriter, $pStyle->getFill()); - - // alignment - $objWriter->startElement('alignment'); - $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); - $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); - - $textRotation = 0; - if ($pStyle->getAlignment()->getTextRotation() >= 0) { - $textRotation = $pStyle->getAlignment()->getTextRotation(); - } else if ($pStyle->getAlignment()->getTextRotation() < 0) { - $textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); - } - - $objWriter->writeAttribute('textRotation', $textRotation); - $objWriter->endElement(); - - // border - $this->_writeBorder($objWriter, $pStyle->getBorders()); - - // protection - if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->startElement('protection'); - if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); - } - if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) { - $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false')); - } - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - - /** - * Write BorderPr - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pName Element name - * @param PHPExcel_Style_Border $pBorder Border style - * @throws Exception - */ - private function _writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null) - { - // Write BorderPr - if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) { - $objWriter->startElement($pName); - $objWriter->writeAttribute('style', $pBorder->getBorderStyle()); - - // color - $objWriter->startElement('color'); - $objWriter->writeAttribute('rgb', $pBorder->getColor()->getARGB()); - $objWriter->endElement(); - - $objWriter->endElement(); - } - } - - /** - * Write NumberFormat - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format - * @param int $pId Number Format identifier - * @throws Exception - */ - private function _writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0) - { - // Translate formatcode - $formatCode = $pNumberFormat->getFormatCode(); - - // numFmt - $objWriter->startElement('numFmt'); - $objWriter->writeAttribute('numFmtId', ($pId + 164)); - $objWriter->writeAttribute('formatCode', $formatCode); - $objWriter->endElement(); - } - - /** - * Get an array of all styles - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style[] All styles in PHPExcel - * @throws Exception - */ - public function allStyles(PHPExcel $pPHPExcel = null) - { - $aStyles = $pPHPExcel->getCellXfCollection(); - - return $aStyles; - } - - /** - * Get an array of all conditional styles - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel - * @throws Exception - */ - public function allConditionalStyles(PHPExcel $pPHPExcel = null) - { - // Get an array of all styles - $aStyles = array(); - - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) { - foreach ($conditionalStyles as $conditionalStyle) { - $aStyles[] = $conditionalStyle; - } - } - } - - return $aStyles; - } - - /** - * Get an array of all fills - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style_Fill[] All fills in PHPExcel - * @throws Exception - */ - public function allFills(PHPExcel $pPHPExcel = null) - { - // Get an array of unique fills - $aFills = array(); - - // Two first fills are predefined - $fill0 = new PHPExcel_Style_Fill(); - $fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE); - $aFills[] = $fill0; - - $fill1 = new PHPExcel_Style_Fill(); - $fill1->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125); - $aFills[] = $fill1; - - // The remaining fills - $aStyles = $this->allStyles($pPHPExcel); - foreach ($aStyles as $style) { - if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) { - $aFills[ $style->getFill()->getHashCode() ] = $style->getFill(); - } - } - - return $aFills; - } - - /** - * Get an array of all fonts - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style_Font[] All fonts in PHPExcel - * @throws Exception - */ - public function allFonts(PHPExcel $pPHPExcel = null) - { - // Get an array of unique fonts - $aFonts = array(); - $aStyles = $this->allStyles($pPHPExcel); - - foreach ($aStyles as $style) { - if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) { - $aFonts[ $style->getFont()->getHashCode() ] = $style->getFont(); - } - } - - return $aFonts; - } - - /** - * Get an array of all borders - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style_Borders[] All borders in PHPExcel - * @throws Exception - */ - public function allBorders(PHPExcel $pPHPExcel = null) - { - // Get an array of unique borders - $aBorders = array(); - $aStyles = $this->allStyles($pPHPExcel); - - foreach ($aStyles as $style) { - if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) { - $aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders(); - } - } - - return $aBorders; - } - - /** - * Get an array of all number formats - * - * @param PHPExcel $pPHPExcel - * @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel - * @throws Exception - */ - public function allNumberFormats(PHPExcel $pPHPExcel = null) - { - // Get an array of unique number formats - $aNumFmts = array(); - $aStyles = $this->allStyles($pPHPExcel); - - foreach ($aStyles as $style) { - if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) { - $aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat(); - } - } - - return $aNumFmts; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Theme.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Theme.php deleted file mode 100644 index 7af5a939b7..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Theme.php +++ /dev/null @@ -1,1202 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_DocProps - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write theme to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeTheme(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // a:theme - $objWriter->startElement('a:theme'); - $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); - $objWriter->writeAttribute('name', 'Office Theme'); - - // a:themeElements - $objWriter->startElement('a:themeElements'); - - { - // a:clrScheme - $objWriter->startElement('a:clrScheme'); - $objWriter->writeAttribute('name', 'Office'); - - // a:dk1 - $objWriter->startElement('a:dk1'); - - // a:sysClr - $objWriter->startElement('a:sysClr'); - $objWriter->writeAttribute('val', 'windowText'); - $objWriter->writeAttribute('lastClr', '000000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lt1 - $objWriter->startElement('a:lt1'); - - // a:sysClr - $objWriter->startElement('a:sysClr'); - $objWriter->writeAttribute('val', 'window'); - $objWriter->writeAttribute('lastClr', 'FFFFFF'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:dk2 - $objWriter->startElement('a:dk2'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '1F497D'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lt2 - $objWriter->startElement('a:lt2'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', 'EEECE1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent1 - $objWriter->startElement('a:accent1'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '4F81BD'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent2 - $objWriter->startElement('a:accent2'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', 'C0504D'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent3 - $objWriter->startElement('a:accent3'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '9BBB59'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent4 - $objWriter->startElement('a:accent4'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '8064A2'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent5 - $objWriter->startElement('a:accent5'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '4BACC6'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:accent6 - $objWriter->startElement('a:accent6'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', 'F79646'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:hlink - $objWriter->startElement('a:hlink'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '0000FF'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:folHlink - $objWriter->startElement('a:folHlink'); - - // a:sysClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '800080'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - { - // a:fontScheme - $objWriter->startElement('a:fontScheme'); - $objWriter->writeAttribute('name', 'Office'); - - // a:majorFont - $objWriter->startElement('a:majorFont'); - - // a:latin - $objWriter->startElement('a:latin'); - $objWriter->writeAttribute('typeface', 'Cambria'); - $objWriter->endElement(); - - // a:ea - $objWriter->startElement('a:ea'); - $objWriter->writeAttribute('typeface', ''); - $objWriter->endElement(); - - // a:cs - $objWriter->startElement('a:cs'); - $objWriter->writeAttribute('typeface', ''); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Jpan'); - $objWriter->writeAttribute('typeface', '?? ?????'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hang'); - $objWriter->writeAttribute('typeface', '?? ??'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hans'); - $objWriter->writeAttribute('typeface', '??'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hant'); - $objWriter->writeAttribute('typeface', '????'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Arab'); - $objWriter->writeAttribute('typeface', 'Times New Roman'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hebr'); - $objWriter->writeAttribute('typeface', 'Times New Roman'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Thai'); - $objWriter->writeAttribute('typeface', 'Tahoma'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Ethi'); - $objWriter->writeAttribute('typeface', 'Nyala'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Beng'); - $objWriter->writeAttribute('typeface', 'Vrinda'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Gujr'); - $objWriter->writeAttribute('typeface', 'Shruti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Khmr'); - $objWriter->writeAttribute('typeface', 'MoolBoran'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Knda'); - $objWriter->writeAttribute('typeface', 'Tunga'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Guru'); - $objWriter->writeAttribute('typeface', 'Raavi'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Cans'); - $objWriter->writeAttribute('typeface', 'Euphemia'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Cher'); - $objWriter->writeAttribute('typeface', 'Plantagenet Cherokee'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Yiii'); - $objWriter->writeAttribute('typeface', 'Microsoft Yi Baiti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Tibt'); - $objWriter->writeAttribute('typeface', 'Microsoft Himalaya'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Thaa'); - $objWriter->writeAttribute('typeface', 'MV Boli'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Deva'); - $objWriter->writeAttribute('typeface', 'Mangal'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Telu'); - $objWriter->writeAttribute('typeface', 'Gautami'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Taml'); - $objWriter->writeAttribute('typeface', 'Latha'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Syrc'); - $objWriter->writeAttribute('typeface', 'Estrangelo Edessa'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Orya'); - $objWriter->writeAttribute('typeface', 'Kalinga'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Mlym'); - $objWriter->writeAttribute('typeface', 'Kartika'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Laoo'); - $objWriter->writeAttribute('typeface', 'DokChampa'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Sinh'); - $objWriter->writeAttribute('typeface', 'Iskoola Pota'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Mong'); - $objWriter->writeAttribute('typeface', 'Mongolian Baiti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Viet'); - $objWriter->writeAttribute('typeface', 'Times New Roman'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Uigh'); - $objWriter->writeAttribute('typeface', 'Microsoft Uighur'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:minorFont - $objWriter->startElement('a:minorFont'); - - // a:latin - $objWriter->startElement('a:latin'); - $objWriter->writeAttribute('typeface', 'Calibri'); - $objWriter->endElement(); - - // a:ea - $objWriter->startElement('a:ea'); - $objWriter->writeAttribute('typeface', ''); - $objWriter->endElement(); - - // a:cs - $objWriter->startElement('a:cs'); - $objWriter->writeAttribute('typeface', ''); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Jpan'); - $objWriter->writeAttribute('typeface', '?? ?????'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hang'); - $objWriter->writeAttribute('typeface', '?? ??'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hans'); - $objWriter->writeAttribute('typeface', '??'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hant'); - $objWriter->writeAttribute('typeface', '????'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Arab'); - $objWriter->writeAttribute('typeface', 'Arial'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Hebr'); - $objWriter->writeAttribute('typeface', 'Arial'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Thai'); - $objWriter->writeAttribute('typeface', 'Tahoma'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Ethi'); - $objWriter->writeAttribute('typeface', 'Nyala'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Beng'); - $objWriter->writeAttribute('typeface', 'Vrinda'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Gujr'); - $objWriter->writeAttribute('typeface', 'Shruti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Khmr'); - $objWriter->writeAttribute('typeface', 'DaunPenh'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Knda'); - $objWriter->writeAttribute('typeface', 'Tunga'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Guru'); - $objWriter->writeAttribute('typeface', 'Raavi'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Cans'); - $objWriter->writeAttribute('typeface', 'Euphemia'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Cher'); - $objWriter->writeAttribute('typeface', 'Plantagenet Cherokee'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Yiii'); - $objWriter->writeAttribute('typeface', 'Microsoft Yi Baiti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Tibt'); - $objWriter->writeAttribute('typeface', 'Microsoft Himalaya'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Thaa'); - $objWriter->writeAttribute('typeface', 'MV Boli'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Deva'); - $objWriter->writeAttribute('typeface', 'Mangal'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Telu'); - $objWriter->writeAttribute('typeface', 'Gautami'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Taml'); - $objWriter->writeAttribute('typeface', 'Latha'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Syrc'); - $objWriter->writeAttribute('typeface', 'Estrangelo Edessa'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Orya'); - $objWriter->writeAttribute('typeface', 'Kalinga'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Mlym'); - $objWriter->writeAttribute('typeface', 'Kartika'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Laoo'); - $objWriter->writeAttribute('typeface', 'DokChampa'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Sinh'); - $objWriter->writeAttribute('typeface', 'Iskoola Pota'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Mong'); - $objWriter->writeAttribute('typeface', 'Mongolian Baiti'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Viet'); - $objWriter->writeAttribute('typeface', 'Arial'); - $objWriter->endElement(); - - // a:font - $objWriter->startElement('a:font'); - $objWriter->writeAttribute('script', 'Uigh'); - $objWriter->writeAttribute('typeface', 'Microsoft Uighur'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - { - // a:fmtScheme - $objWriter->startElement('a:fmtScheme'); - $objWriter->writeAttribute('name', 'Office'); - - // a:fillStyleLst - $objWriter->startElement('a:fillStyleLst'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gradFill - $objWriter->startElement('a:gradFill'); - $objWriter->writeAttribute('rotWithShape', '1'); - - // a:gsLst - $objWriter->startElement('a:gsLst'); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '0'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '50000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '300000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '35000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '37000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '300000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '100000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '15000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '350000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lin - $objWriter->startElement('a:lin'); - $objWriter->writeAttribute('ang', '16200000'); - $objWriter->writeAttribute('scaled', '1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gradFill - $objWriter->startElement('a:gradFill'); - $objWriter->writeAttribute('rotWithShape', '1'); - - // a:gsLst - $objWriter->startElement('a:gsLst'); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '0'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '51000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '130000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '80000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '93000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '130000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '100000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '94000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '135000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lin - $objWriter->startElement('a:lin'); - $objWriter->writeAttribute('ang', '16200000'); - $objWriter->writeAttribute('scaled', '0'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lnStyleLst - $objWriter->startElement('a:lnStyleLst'); - - // a:ln - $objWriter->startElement('a:ln'); - $objWriter->writeAttribute('w', '9525'); - $objWriter->writeAttribute('cap', 'flat'); - $objWriter->writeAttribute('cmpd', 'sng'); - $objWriter->writeAttribute('algn', 'ctr'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '95000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '105000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:prstDash - $objWriter->startElement('a:prstDash'); - $objWriter->writeAttribute('val', 'solid'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:ln - $objWriter->startElement('a:ln'); - $objWriter->writeAttribute('w', '25400'); - $objWriter->writeAttribute('cap', 'flat'); - $objWriter->writeAttribute('cmpd', 'sng'); - $objWriter->writeAttribute('algn', 'ctr'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:prstDash - $objWriter->startElement('a:prstDash'); - $objWriter->writeAttribute('val', 'solid'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:ln - $objWriter->startElement('a:ln'); - $objWriter->writeAttribute('w', '38100'); - $objWriter->writeAttribute('cap', 'flat'); - $objWriter->writeAttribute('cmpd', 'sng'); - $objWriter->writeAttribute('algn', 'ctr'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:prstDash - $objWriter->startElement('a:prstDash'); - $objWriter->writeAttribute('val', 'solid'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - - - // a:effectStyleLst - $objWriter->startElement('a:effectStyleLst'); - - // a:effectStyle - $objWriter->startElement('a:effectStyle'); - - // a:effectLst - $objWriter->startElement('a:effectLst'); - - // a:outerShdw - $objWriter->startElement('a:outerShdw'); - $objWriter->writeAttribute('blurRad', '40000'); - $objWriter->writeAttribute('dist', '20000'); - $objWriter->writeAttribute('dir', '5400000'); - $objWriter->writeAttribute('rotWithShape', '0'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '000000'); - - // a:alpha - $objWriter->startElement('a:alpha'); - $objWriter->writeAttribute('val', '38000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:effectStyle - $objWriter->startElement('a:effectStyle'); - - // a:effectLst - $objWriter->startElement('a:effectLst'); - - // a:outerShdw - $objWriter->startElement('a:outerShdw'); - $objWriter->writeAttribute('blurRad', '40000'); - $objWriter->writeAttribute('dist', '23000'); - $objWriter->writeAttribute('dir', '5400000'); - $objWriter->writeAttribute('rotWithShape', '0'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '000000'); - - // a:alpha - $objWriter->startElement('a:alpha'); - $objWriter->writeAttribute('val', '35000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:effectStyle - $objWriter->startElement('a:effectStyle'); - - // a:effectLst - $objWriter->startElement('a:effectLst'); - - // a:outerShdw - $objWriter->startElement('a:outerShdw'); - $objWriter->writeAttribute('blurRad', '40000'); - $objWriter->writeAttribute('dist', '23000'); - $objWriter->writeAttribute('dir', '5400000'); - $objWriter->writeAttribute('rotWithShape', '0'); - - // a:srgbClr - $objWriter->startElement('a:srgbClr'); - $objWriter->writeAttribute('val', '000000'); - - // a:alpha - $objWriter->startElement('a:alpha'); - $objWriter->writeAttribute('val', '35000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:scene3d - $objWriter->startElement('a:scene3d'); - - // a:camera - $objWriter->startElement('a:camera'); - $objWriter->writeAttribute('prst', 'orthographicFront'); - - // a:rot - $objWriter->startElement('a:rot'); - $objWriter->writeAttribute('lat', '0'); - $objWriter->writeAttribute('lon', '0'); - $objWriter->writeAttribute('rev', '0'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:lightRig - $objWriter->startElement('a:lightRig'); - $objWriter->writeAttribute('rig', 'threePt'); - $objWriter->writeAttribute('dir', 't'); - - // a:rot - $objWriter->startElement('a:rot'); - $objWriter->writeAttribute('lat', '0'); - $objWriter->writeAttribute('lon', '0'); - $objWriter->writeAttribute('rev', '1200000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:sp3d - $objWriter->startElement('a:sp3d'); - - // a:bevelT - $objWriter->startElement('a:bevelT'); - $objWriter->writeAttribute('w', '63500'); - $objWriter->writeAttribute('h', '25400'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:bgFillStyleLst - $objWriter->startElement('a:bgFillStyleLst'); - - // a:solidFill - $objWriter->startElement('a:solidFill'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gradFill - $objWriter->startElement('a:gradFill'); - $objWriter->writeAttribute('rotWithShape', '1'); - - // a:gsLst - $objWriter->startElement('a:gsLst'); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '0'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '40000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '350000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '40000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '45000'); - $objWriter->endElement(); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '99000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '350000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '100000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '20000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '255000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:path - $objWriter->startElement('a:path'); - $objWriter->writeAttribute('path', 'circle'); - - // a:fillToRect - $objWriter->startElement('a:fillToRect'); - $objWriter->writeAttribute('l', '50000'); - $objWriter->writeAttribute('t', '-80000'); - $objWriter->writeAttribute('r', '50000'); - $objWriter->writeAttribute('b', '180000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gradFill - $objWriter->startElement('a:gradFill'); - $objWriter->writeAttribute('rotWithShape', '1'); - - // a:gsLst - $objWriter->startElement('a:gsLst'); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '0'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:tint - $objWriter->startElement('a:tint'); - $objWriter->writeAttribute('val', '80000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '300000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:gs - $objWriter->startElement('a:gs'); - $objWriter->writeAttribute('pos', '100000'); - - // a:schemeClr - $objWriter->startElement('a:schemeClr'); - $objWriter->writeAttribute('val', 'phClr'); - - // a:shade - $objWriter->startElement('a:shade'); - $objWriter->writeAttribute('val', '30000'); - $objWriter->endElement(); - - // a:satMod - $objWriter->startElement('a:satMod'); - $objWriter->writeAttribute('val', '200000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // a:path - $objWriter->startElement('a:path'); - $objWriter->writeAttribute('path', 'circle'); - - // a:fillToRect - $objWriter->startElement('a:fillToRect'); - $objWriter->writeAttribute('l', '50000'); - $objWriter->writeAttribute('t', '50000'); - $objWriter->writeAttribute('r', '50000'); - $objWriter->writeAttribute('b', '50000'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - $objWriter->endElement(); - - // a:objectDefaults - $objWriter->writeElement('a:objectDefaults', null); - - // a:extraClrSchemeLst - $objWriter->writeElement('a:extraClrSchemeLst', null); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Workbook.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Workbook.php deleted file mode 100644 index 6bc8b5a75a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Workbook.php +++ /dev/null @@ -1,443 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Workbook - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Workbook extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write workbook to XML format - * - * @param PHPExcel $pPHPExcel - * @return string XML Output - * @throws Exception - */ - public function writeWorkbook(PHPExcel $pPHPExcel = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // workbook - $objWriter->startElement('workbook'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - - // fileVersion - $this->_writeFileVersion($objWriter); - - // workbookPr - $this->_writeWorkbookPr($objWriter); - - // workbookProtection - $this->_writeWorkbookProtection($objWriter, $pPHPExcel); - - // bookViews - if ($this->getParentWriter()->getOffice2003Compatibility() === false) { - $this->_writeBookViews($objWriter, $pPHPExcel); - } - - // sheets - $this->_writeSheets($objWriter, $pPHPExcel); - - // definedNames - $this->_writeDefinedNames($objWriter, $pPHPExcel); - - // calcPr - $this->_writeCalcPr($objWriter); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write file version - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws Exception - */ - private function _writeFileVersion(PHPExcel_Shared_XMLWriter $objWriter = null) - { - $objWriter->startElement('fileVersion'); - $objWriter->writeAttribute('appName', 'xl'); - $objWriter->writeAttribute('lastEdited', '4'); - $objWriter->writeAttribute('lowestEdited', '4'); - $objWriter->writeAttribute('rupBuild', '4505'); - $objWriter->endElement(); - } - - /** - * Write WorkbookPr - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws Exception - */ - private function _writeWorkbookPr(PHPExcel_Shared_XMLWriter $objWriter = null) - { - $objWriter->startElement('workbookPr'); - - if (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) { - $objWriter->writeAttribute('date1904', '1'); - } - - $objWriter->writeAttribute('codeName', 'ThisWorkbook'); - - $objWriter->endElement(); - } - - /** - * Write BookViews - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws Exception - */ - private function _writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) - { - // bookViews - $objWriter->startElement('bookViews'); - - // workbookView - $objWriter->startElement('workbookView'); - - $objWriter->writeAttribute('activeTab', $pPHPExcel->getActiveSheetIndex()); - $objWriter->writeAttribute('autoFilterDateGrouping', '1'); - $objWriter->writeAttribute('firstSheet', '0'); - $objWriter->writeAttribute('minimized', '0'); - $objWriter->writeAttribute('showHorizontalScroll', '1'); - $objWriter->writeAttribute('showSheetTabs', '1'); - $objWriter->writeAttribute('showVerticalScroll', '1'); - $objWriter->writeAttribute('tabRatio', '600'); - $objWriter->writeAttribute('visibility', 'visible'); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write WorkbookProtection - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws Exception - */ - private function _writeWorkbookProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) - { - if ($pPHPExcel->getSecurity()->isSecurityEnabled()) { - $objWriter->startElement('workbookProtection'); - $objWriter->writeAttribute('lockRevision', ($pPHPExcel->getSecurity()->getLockRevision() ? 'true' : 'false')); - $objWriter->writeAttribute('lockStructure', ($pPHPExcel->getSecurity()->getLockStructure() ? 'true' : 'false')); - $objWriter->writeAttribute('lockWindows', ($pPHPExcel->getSecurity()->getLockWindows() ? 'true' : 'false')); - - if ($pPHPExcel->getSecurity()->getRevisionsPassword() != '') { - $objWriter->writeAttribute('revisionsPassword', $pPHPExcel->getSecurity()->getRevisionsPassword()); - } - - if ($pPHPExcel->getSecurity()->getWorkbookPassword() != '') { - $objWriter->writeAttribute('workbookPassword', $pPHPExcel->getSecurity()->getWorkbookPassword()); - } - - $objWriter->endElement(); - } - } - - /** - * Write calcPr - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @throws Exception - */ - private function _writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null) - { - $objWriter->startElement('calcPr'); - - $objWriter->writeAttribute('calcId', '124519'); - $objWriter->writeAttribute('calcMode', 'auto'); - $objWriter->writeAttribute('fullCalcOnLoad', '1'); - - $objWriter->endElement(); - } - - /** - * Write sheets - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws Exception - */ - private function _writeSheets(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) - { - // Write sheets - $objWriter->startElement('sheets'); - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - // sheet - $this->_writeSheet( - $objWriter, - $pPHPExcel->getSheet($i)->getTitle(), - ($i + 1), - ($i + 1 + 3), - $pPHPExcel->getSheet($i)->getSheetState() - ); - } - - $objWriter->endElement(); - } - - /** - * Write sheet - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param string $pSheetname Sheet name - * @param int $pSheetId Sheet id - * @param int $pRelId Relationship ID - * @param string $sheetState Sheet state (visible, hidden, veryHidden) - * @throws Exception - */ - private function _writeSheet(PHPExcel_Shared_XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible') - { - if ($pSheetname != '') { - // Write sheet - $objWriter->startElement('sheet'); - $objWriter->writeAttribute('name', $pSheetname); - $objWriter->writeAttribute('sheetId', $pSheetId); - if ($sheetState != 'visible' && $sheetState != '') { - $objWriter->writeAttribute('state', $sheetState); - } - $objWriter->writeAttribute('r:id', 'rId' . $pRelId); - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Write Defined Names - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws Exception - */ - private function _writeDefinedNames(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null) - { - // Write defined names - $objWriter->startElement('definedNames'); - - // Named ranges - if (count($pPHPExcel->getNamedRanges()) > 0) { - // Named ranges - $this->_writeNamedRanges($objWriter, $pPHPExcel); - } - - // Other defined names - $sheetCount = $pPHPExcel->getSheetCount(); - for ($i = 0; $i < $sheetCount; ++$i) { - // definedName for autoFilter - $this->_writeDefinedNameForAutofilter($objWriter, $pPHPExcel->getSheet($i), $i); - - // definedName for Print_Titles - $this->_writeDefinedNameForPrintTitles($objWriter, $pPHPExcel->getSheet($i), $i); - - // definedName for Print_Area - $this->_writeDefinedNameForPrintArea($objWriter, $pPHPExcel->getSheet($i), $i); - } - - $objWriter->endElement(); - } - - /** - * Write named ranges - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel $pPHPExcel - * @throws Exception - */ - private function _writeNamedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel) - { - // Loop named ranges - $namedRanges = $pPHPExcel->getNamedRanges(); - foreach ($namedRanges as $namedRange) { - $this->_writeDefinedNameForNamedRange($objWriter, $namedRange); - } - } - - /** - * Write Defined Name for autoFilter - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_NamedRange $pNamedRange - * @throws Exception - */ - private function _writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange) - { - // definedName for named range - $objWriter->startElement('definedName'); - $objWriter->writeAttribute('name', $pNamedRange->getName()); - if ($pNamedRange->getLocalOnly()) { - $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope())); - } - - // Create absolute coordinate and write as raw text - $range = PHPExcel_Cell::splitRange($pNamedRange->getRange()); - for ($i = 0; $i < count($range); $i++) { - $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]); - if (isset($range[$i][1])) { - $range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]); - } - } - $range = PHPExcel_Cell::buildRange($range); - - $objWriter->writeRawData($range); - - $objWriter->endElement(); - } - - /** - * Write Defined Name for autoFilter - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet - * @param int $pSheetId - * @throws Exception - */ - private function _writeDefinedNameForAutofilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) - { - // definedName for autoFilter - if ($pSheet->getAutoFilter() != '') { - $objWriter->startElement('definedName'); - $objWriter->writeAttribute('name', '_xlnm._FilterDatabase'); - $objWriter->writeAttribute('localSheetId', $pSheetId); - $objWriter->writeAttribute('hidden', '1'); - - // Create absolute coordinate and write as raw text - $range = PHPExcel_Cell::splitRange($pSheet->getAutoFilter()); - $range = $range[0]; - $range[0] = PHPExcel_Cell::absoluteCoordinate($range[0]); - $range[1] = PHPExcel_Cell::absoluteCoordinate($range[1]); - $range = implode(':', $range); - - $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range); - - $objWriter->endElement(); - } - } - - /** - * Write Defined Name for PrintTitles - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet - * @param int $pSheetId - * @throws Exception - */ - private function _writeDefinedNameForPrintTitles(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) - { - // definedName for PrintTitles - if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { - $objWriter->startElement('definedName'); - $objWriter->writeAttribute('name', '_xlnm.Print_Titles'); - $objWriter->writeAttribute('localSheetId', $pSheetId); - - // Setting string - $settingString = ''; - - // Columns to repeat - if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) { - $repeat = $pSheet->getPageSetup()->getColumnsToRepeatAtLeft(); - - $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; - } - - // Rows to repeat - if ($pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) { - if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) { - $settingString .= ','; - } - - $repeat = $pSheet->getPageSetup()->getRowsToRepeatAtTop(); - - $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1]; - } - - $objWriter->writeRawData($settingString); - - $objWriter->endElement(); - } - } - - /** - * Write Defined Name for PrintTitles - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet - * @param int $pSheetId - * @throws Exception - */ - private function _writeDefinedNameForPrintArea(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0) - { - // definedName for PrintArea - if ($pSheet->getPageSetup()->isPrintAreaSet()) { - $objWriter->startElement('definedName'); - $objWriter->writeAttribute('name', '_xlnm.Print_Area'); - $objWriter->writeAttribute('localSheetId', $pSheetId); - - // Setting string - $settingString = ''; - - // Print area - $printArea = PHPExcel_Cell::splitRange($pSheet->getPageSetup()->getPrintArea()); - - $chunks = array(); - foreach ($printArea as $printAreaRect) { - $printAreaRect[0] = PHPExcel_Cell::absoluteReference($printAreaRect[0]); - $printAreaRect[1] = PHPExcel_Cell::absoluteReference($printAreaRect[1]); - $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect); - } - - $objWriter->writeRawData(implode(',', $chunks)); - - $objWriter->endElement(); - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Worksheet.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Worksheet.php deleted file mode 100644 index a84b075248..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/Worksheet.php +++ /dev/null @@ -1,1119 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_Worksheet - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel2007_Worksheet extends PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Write worksheet to XML format - * - * @param PHPExcel_Worksheet $pSheet - * @param string[] $pStringTable - * @return string XML Output - * @throws Exception - */ - public function writeWorksheet($pSheet = null, $pStringTable = null) - { - if (!is_null($pSheet)) { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0','UTF-8','yes'); - - // Worksheet - $objWriter->startElement('worksheet'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - - // sheetPr - $this->_writeSheetPr($objWriter, $pSheet); - - // Dimension - $this->_writeDimension($objWriter, $pSheet); - - // sheetViews - $this->_writeSheetViews($objWriter, $pSheet); - - // sheetFormatPr - $this->_writeSheetFormatPr($objWriter, $pSheet); - - // cols - $this->_writeCols($objWriter, $pSheet); - - // sheetData - $this->_writeSheetData($objWriter, $pSheet, $pStringTable); - - // sheetProtection - $this->_writeSheetProtection($objWriter, $pSheet); - - // protectedRanges - $this->_writeProtectedRanges($objWriter, $pSheet); - - // autoFilter - $this->_writeAutoFilter($objWriter, $pSheet); - - // mergeCells - $this->_writeMergeCells($objWriter, $pSheet); - - // conditionalFormatting - $this->_writeConditionalFormatting($objWriter, $pSheet); - - // dataValidations - $this->_writeDataValidations($objWriter, $pSheet); - - // hyperlinks - $this->_writeHyperlinks($objWriter, $pSheet); - - // Print options - $this->_writePrintOptions($objWriter, $pSheet); - - // Page margins - $this->_writePageMargins($objWriter, $pSheet); - - // Page setup - $this->_writePageSetup($objWriter, $pSheet); - - // Header / footer - $this->_writeHeaderFooter($objWriter, $pSheet); - - // Breaks - $this->_writeBreaks($objWriter, $pSheet); - - // Drawings - $this->_writeDrawings($objWriter, $pSheet); - - // LegacyDrawing - $this->_writeLegacyDrawing($objWriter, $pSheet); - - // LegacyDrawingHF - $this->_writeLegacyDrawingHF($objWriter, $pSheet); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } else { - throw new Exception("Invalid PHPExcel_Worksheet object passed."); - } - } - - /** - * Write SheetPr - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // sheetPr - $objWriter->startElement('sheetPr'); - //$objWriter->writeAttribute('codeName', $pSheet->getTitle()); - - // tabColor - if ($pSheet->isTabColorSet()) { - $objWriter->startElement('tabColor'); - $objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB()); - $objWriter->endElement(); - } - - // outlinePr - $objWriter->startElement('outlinePr'); - $objWriter->writeAttribute('summaryBelow', ($pSheet->getShowSummaryBelow() ? '1' : '0')); - $objWriter->writeAttribute('summaryRight', ($pSheet->getShowSummaryRight() ? '1' : '0')); - $objWriter->endElement(); - - // pageSetUpPr - if ($pSheet->getPageSetup()->getFitToPage()) { - $objWriter->startElement('pageSetUpPr'); - $objWriter->writeAttribute('fitToPage', '1'); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - - /** - * Write Dimension - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeDimension(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // dimension - $objWriter->startElement('dimension'); - $objWriter->writeAttribute('ref', $pSheet->calculateWorksheetDimension()); - $objWriter->endElement(); - } - - /** - * Write SheetViews - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // sheetViews - $objWriter->startElement('sheetViews'); - - // Sheet selected? - $sheetSelected = false; - if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) - $sheetSelected = true; - - - // sheetView - $objWriter->startElement('sheetView'); - $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0'); - $objWriter->writeAttribute('workbookViewId', '0'); - - // Zoom scales - if ($pSheet->getSheetView()->getZoomScale() != 100) { - $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale()); - } - if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) { - $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal()); - } - - // Gridlines - if ($pSheet->getShowGridlines()) { - $objWriter->writeAttribute('showGridLines', 'true'); - } else { - $objWriter->writeAttribute('showGridLines', 'false'); - } - - // Row and column headers - if ($pSheet->getShowRowColHeaders()) { - $objWriter->writeAttribute('showRowColHeaders', '1'); - } else { - $objWriter->writeAttribute('showRowColHeaders', '0'); - } - - // Right-to-left - if ($pSheet->getRightToLeft()) { - $objWriter->writeAttribute('rightToLeft', 'true'); - } - - $activeCell = $pSheet->getActiveCell(); - - // Pane - $pane = ''; - $topLeftCell = $pSheet->getFreezePane(); - if (($topLeftCell != '') && ($topLeftCell != 'A1')) { - $activeCell = $topLeftCell; - // Calculate freeze coordinates - $xSplit = $ySplit = 0; - - list($xSplit, $ySplit) = PHPExcel_Cell::coordinateFromString($topLeftCell); - $xSplit = PHPExcel_Cell::columnIndexFromString($xSplit); - - // pane - $pane = 'topRight'; - $objWriter->startElement('pane'); - if ($xSplit > 1) - $objWriter->writeAttribute('xSplit', $xSplit - 1); - if ($ySplit > 1) { - $objWriter->writeAttribute('ySplit', $ySplit - 1); - $pane = ($xSplit > 1) ? 'bottomRight' : 'bottomLeft'; - } - $objWriter->writeAttribute('topLeftCell', $topLeftCell); - $objWriter->writeAttribute('activePane', $pane); - $objWriter->writeAttribute('state', 'frozen'); - $objWriter->endElement(); - - if (($xSplit > 1) && ($ySplit > 1)) { - // Write additional selections if more than two panes (ie both an X and a Y split) - $objWriter->startElement('selection'); $objWriter->writeAttribute('pane', 'topRight'); $objWriter->endElement(); - $objWriter->startElement('selection'); $objWriter->writeAttribute('pane', 'bottomLeft'); $objWriter->endElement(); - } - } - - // Selection - if ($pane != '') { - // Only need to write selection element if we have a split pane - // We cheat a little by over-riding the active cell selection, setting it to the split cell - $objWriter->startElement('selection'); - $objWriter->writeAttribute('pane', $pane); - $objWriter->writeAttribute('activeCell', $activeCell); - $objWriter->writeAttribute('sqref', $activeCell); - $objWriter->endElement(); - } - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write SheetFormatPr - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeSheetFormatPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // sheetFormatPr - $objWriter->startElement('sheetFormatPr'); - - // Default row height - if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) { - $objWriter->writeAttribute('customHeight', 'true'); - $objWriter->writeAttribute('defaultRowHeight', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultRowDimension()->getRowHeight())); - } else { - $objWriter->writeAttribute('defaultRowHeight', '12.75'); - } - - // Default column width - if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) { - $objWriter->writeAttribute('defaultColWidth', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth())); - } - - // Outline level - row - $outlineLevelRow = 0; - foreach ($pSheet->getRowDimensions() as $dimension) { - if ($dimension->getOutlineLevel() > $outlineLevelRow) { - $outlineLevelRow = $dimension->getOutlineLevel(); - } - } - $objWriter->writeAttribute('outlineLevelRow', (int)$outlineLevelRow); - - // Outline level - column - $outlineLevelCol = 0; - foreach ($pSheet->getColumnDimensions() as $dimension) { - if ($dimension->getOutlineLevel() > $outlineLevelCol) { - $outlineLevelCol = $dimension->getOutlineLevel(); - } - } - $objWriter->writeAttribute('outlineLevelCol', (int)$outlineLevelCol); - - $objWriter->endElement(); - } - - /** - * Write Cols - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeCols(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // cols - if (count($pSheet->getColumnDimensions()) > 0) { - $objWriter->startElement('cols'); - - $pSheet->calculateColumnWidths(); - - // Loop through column dimensions - foreach ($pSheet->getColumnDimensions() as $colDimension) { - // col - $objWriter->startElement('col'); - $objWriter->writeAttribute('min', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex())); - $objWriter->writeAttribute('max', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex())); - - if ($colDimension->getWidth() < 0) { - // No width set, apply default of 10 - $objWriter->writeAttribute('width', '9.10'); - } else { - // Width set - $objWriter->writeAttribute('width', PHPExcel_Shared_String::FormatNumber($colDimension->getWidth())); - } - - // Column visibility - if ($colDimension->getVisible() == false) { - $objWriter->writeAttribute('hidden', 'true'); - } - - // Auto size? - if ($colDimension->getAutoSize()) { - $objWriter->writeAttribute('bestFit', 'true'); - } - - // Custom width? - if ($colDimension->getWidth() != $pSheet->getDefaultColumnDimension()->getWidth()) { - $objWriter->writeAttribute('customWidth', 'true'); - } - - // Collapsed - if ($colDimension->getCollapsed() == true) { - $objWriter->writeAttribute('collapsed', 'true'); - } - - // Outline level - if ($colDimension->getOutlineLevel() > 0) { - $objWriter->writeAttribute('outlineLevel', $colDimension->getOutlineLevel()); - } - - // Style - $objWriter->writeAttribute('style', $colDimension->getXfIndex()); - - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write SheetProtection - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // sheetProtection - $objWriter->startElement('sheetProtection'); - - if ($pSheet->getProtection()->getPassword() != '') { - $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword()); - } - - $objWriter->writeAttribute('sheet', ($pSheet->getProtection()->getSheet() ? 'true' : 'false')); - $objWriter->writeAttribute('objects', ($pSheet->getProtection()->getObjects() ? 'true' : 'false')); - $objWriter->writeAttribute('scenarios', ($pSheet->getProtection()->getScenarios() ? 'true' : 'false')); - $objWriter->writeAttribute('formatCells', ($pSheet->getProtection()->getFormatCells() ? 'true' : 'false')); - $objWriter->writeAttribute('formatColumns', ($pSheet->getProtection()->getFormatColumns() ? 'true' : 'false')); - $objWriter->writeAttribute('formatRows', ($pSheet->getProtection()->getFormatRows() ? 'true' : 'false')); - $objWriter->writeAttribute('insertColumns', ($pSheet->getProtection()->getInsertColumns() ? 'true' : 'false')); - $objWriter->writeAttribute('insertRows', ($pSheet->getProtection()->getInsertRows() ? 'true' : 'false')); - $objWriter->writeAttribute('insertHyperlinks', ($pSheet->getProtection()->getInsertHyperlinks() ? 'true' : 'false')); - $objWriter->writeAttribute('deleteColumns', ($pSheet->getProtection()->getDeleteColumns() ? 'true' : 'false')); - $objWriter->writeAttribute('deleteRows', ($pSheet->getProtection()->getDeleteRows() ? 'true' : 'false')); - $objWriter->writeAttribute('selectLockedCells', ($pSheet->getProtection()->getSelectLockedCells() ? 'true' : 'false')); - $objWriter->writeAttribute('sort', ($pSheet->getProtection()->getSort() ? 'true' : 'false')); - $objWriter->writeAttribute('autoFilter', ($pSheet->getProtection()->getAutoFilter() ? 'true' : 'false')); - $objWriter->writeAttribute('pivotTables', ($pSheet->getProtection()->getPivotTables() ? 'true' : 'false')); - $objWriter->writeAttribute('selectUnlockedCells', ($pSheet->getProtection()->getSelectUnlockedCells() ? 'true' : 'false')); - $objWriter->endElement(); - } - - /** - * Write ConditionalFormatting - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeConditionalFormatting(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // Conditional id - $id = 1; - - // Loop through styles in the current worksheet - foreach ($pSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) { - foreach ($conditionalStyles as $conditional) { - // WHY was this again? - // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode( $conditional->getHashCode() ) == '') { - // continue; - // } - - if ($conditional->getConditionType() != PHPExcel_Style_Conditional::CONDITION_NONE) { - // conditionalFormatting - $objWriter->startElement('conditionalFormatting'); - $objWriter->writeAttribute('sqref', $cellCoordinate); - - // cfRule - $objWriter->startElement('cfRule'); - $objWriter->writeAttribute('type', $conditional->getConditionType()); - $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode( $conditional->getHashCode() )); - $objWriter->writeAttribute('priority', $id++); - - if (($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS - || - $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT) - && $conditional->getOperatorType() != PHPExcel_Style_Conditional::OPERATOR_NONE) { - $objWriter->writeAttribute('operator', $conditional->getOperatorType()); - } - - if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - && !is_null($conditional->getText())) { - $objWriter->writeAttribute('text', $conditional->getText()); - } - - if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT - && !is_null($conditional->getText())) { - $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))'); - } else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH - && !is_null($conditional->getText())) { - $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH - && !is_null($conditional->getText())) { - $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"'); - } else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS - && !is_null($conditional->getText())) { - $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))'); - } else if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS - || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT - || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) { - foreach ($conditional->getConditions() as $formula) { - // Formula - $objWriter->writeElement('formula', $formula); - } - } - - $objWriter->endElement(); - - $objWriter->endElement(); - } - } - } - } - - /** - * Write DataValidations - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeDataValidations(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // Datavalidation collection - $dataValidationCollection = $pSheet->getDataValidationCollection(); - - // Write data validations? - if (count($dataValidationCollection) > 0) { - $objWriter->startElement('dataValidations'); - $objWriter->writeAttribute('count', count($dataValidationCollection)); - - foreach ($dataValidationCollection as $coordinate => $dv) { - $objWriter->startElement('dataValidation'); - - if ($dv->getType() != '') { - $objWriter->writeAttribute('type', $dv->getType()); - } - - if ($dv->getErrorStyle() != '') { - $objWriter->writeAttribute('errorStyle', $dv->getErrorStyle()); - } - - if ($dv->getOperator() != '') { - $objWriter->writeAttribute('operator', $dv->getOperator()); - } - - $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0')); - $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0')); - $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0')); - $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0')); - - if ($dv->getErrorTitle() !== '') { - $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle()); - } - if ($dv->getError() !== '') { - $objWriter->writeAttribute('error', $dv->getError()); - } - if ($dv->getPromptTitle() !== '') { - $objWriter->writeAttribute('promptTitle', $dv->getPromptTitle()); - } - if ($dv->getPrompt() !== '') { - $objWriter->writeAttribute('prompt', $dv->getPrompt()); - } - - $objWriter->writeAttribute('sqref', $coordinate); - - if ($dv->getFormula1() !== '') { - $objWriter->writeElement('formula1', $dv->getFormula1()); - } - if ($dv->getFormula2() !== '') { - $objWriter->writeElement('formula2', $dv->getFormula2()); - } - - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write Hyperlinks - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeHyperlinks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // Hyperlink collection - $hyperlinkCollection = $pSheet->getHyperlinkCollection(); - - // Relation ID - $relationId = 1; - - // Write hyperlinks? - if (count($hyperlinkCollection) > 0) { - $objWriter->startElement('hyperlinks'); - - foreach ($hyperlinkCollection as $coordinate => $hyperlink) { - $objWriter->startElement('hyperlink'); - - $objWriter->writeAttribute('ref', $coordinate); - if (!$hyperlink->isInternal()) { - $objWriter->writeAttribute('r:id', 'rId_hyperlink_' . $relationId); - ++$relationId; - } else { - $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl())); - } - - if ($hyperlink->getTooltip() != '') { - $objWriter->writeAttribute('tooltip', $hyperlink->getTooltip()); - } - - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write ProtectedRanges - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - if (count($pSheet->getProtectedCells()) > 0) { - // protectedRanges - $objWriter->startElement('protectedRanges'); - - // Loop protectedRanges - foreach ($pSheet->getProtectedCells() as $protectedCell => $passwordHash) { - // protectedRange - $objWriter->startElement('protectedRange'); - $objWriter->writeAttribute('name', 'p' . md5($protectedCell)); - $objWriter->writeAttribute('sqref', $protectedCell); - $objWriter->writeAttribute('password', $passwordHash); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write MergeCells - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - if (count($pSheet->getMergeCells()) > 0) { - // mergeCells - $objWriter->startElement('mergeCells'); - - // Loop mergeCells - foreach ($pSheet->getMergeCells() as $mergeCell) { - // mergeCell - $objWriter->startElement('mergeCell'); - $objWriter->writeAttribute('ref', $mergeCell); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write PrintOptions - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writePrintOptions(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // printOptions - $objWriter->startElement('printOptions'); - - $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true': 'false')); - $objWriter->writeAttribute('gridLinesSet', 'true'); - - if ($pSheet->getPageSetup()->getHorizontalCentered()) { - $objWriter->writeAttribute('horizontalCentered', 'true'); - } - - if ($pSheet->getPageSetup()->getVerticalCentered()) { - $objWriter->writeAttribute('verticalCentered', 'true'); - } - - $objWriter->endElement(); - } - - /** - * Write PageMargins - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writePageMargins(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // pageMargins - $objWriter->startElement('pageMargins'); - $objWriter->writeAttribute('left', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft())); - $objWriter->writeAttribute('right', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight())); - $objWriter->writeAttribute('top', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop())); - $objWriter->writeAttribute('bottom', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom())); - $objWriter->writeAttribute('header', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getHeader())); - $objWriter->writeAttribute('footer', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getFooter())); - $objWriter->endElement(); - } - - /** - * Write AutoFilter - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - if ($pSheet->getAutoFilter() != '') { - // autoFilter - $objWriter->startElement('autoFilter'); - $objWriter->writeAttribute('ref', $pSheet->getAutoFilter()); - $objWriter->endElement(); - } - } - - /** - * Write PageSetup - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writePageSetup(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // pageSetup - $objWriter->startElement('pageSetup'); - $objWriter->writeAttribute('paperSize', $pSheet->getPageSetup()->getPaperSize()); - $objWriter->writeAttribute('orientation', $pSheet->getPageSetup()->getOrientation()); - - if (!is_null($pSheet->getPageSetup()->getScale())) { - $objWriter->writeAttribute('scale', $pSheet->getPageSetup()->getScale()); - } - if (!is_null($pSheet->getPageSetup()->getFitToHeight())) { - $objWriter->writeAttribute('fitToHeight', $pSheet->getPageSetup()->getFitToHeight()); - } else { - $objWriter->writeAttribute('fitToHeight', '0'); - } - if (!is_null($pSheet->getPageSetup()->getFitToWidth())) { - $objWriter->writeAttribute('fitToWidth', $pSheet->getPageSetup()->getFitToWidth()); - } else { - $objWriter->writeAttribute('fitToWidth', '0'); - } - if (!is_null($pSheet->getPageSetup()->getFirstPageNumber())) { - $objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber()); - $objWriter->writeAttribute('useFirstPageNumber', '1'); - } - - $objWriter->endElement(); - } - - /** - * Write Header / Footer - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeHeaderFooter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // headerFooter - $objWriter->startElement('headerFooter'); - $objWriter->writeAttribute('differentOddEven', ($pSheet->getHeaderFooter()->getDifferentOddEven() ? 'true' : 'false')); - $objWriter->writeAttribute('differentFirst', ($pSheet->getHeaderFooter()->getDifferentFirst() ? 'true' : 'false')); - $objWriter->writeAttribute('scaleWithDoc', ($pSheet->getHeaderFooter()->getScaleWithDocument() ? 'true' : 'false')); - $objWriter->writeAttribute('alignWithMargins', ($pSheet->getHeaderFooter()->getAlignWithMargins() ? 'true' : 'false')); - - $objWriter->writeElement('oddHeader', $pSheet->getHeaderFooter()->getOddHeader()); - $objWriter->writeElement('oddFooter', $pSheet->getHeaderFooter()->getOddFooter()); - $objWriter->writeElement('evenHeader', $pSheet->getHeaderFooter()->getEvenHeader()); - $objWriter->writeElement('evenFooter', $pSheet->getHeaderFooter()->getEvenFooter()); - $objWriter->writeElement('firstHeader', $pSheet->getHeaderFooter()->getFirstHeader()); - $objWriter->writeElement('firstFooter', $pSheet->getHeaderFooter()->getFirstFooter()); - $objWriter->endElement(); - } - - /** - * Write Breaks - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // Get row and column breaks - $aRowBreaks = array(); - $aColumnBreaks = array(); - foreach ($pSheet->getBreaks() as $cell => $breakType) { - if ($breakType == PHPExcel_Worksheet::BREAK_ROW) { - $aRowBreaks[] = $cell; - } else if ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) { - $aColumnBreaks[] = $cell; - } - } - - // rowBreaks - if (count($aRowBreaks) > 0) { - $objWriter->startElement('rowBreaks'); - $objWriter->writeAttribute('count', count($aRowBreaks)); - $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks)); - - foreach ($aRowBreaks as $cell) { - $coords = PHPExcel_Cell::coordinateFromString($cell); - - $objWriter->startElement('brk'); - $objWriter->writeAttribute('id', $coords[1]); - $objWriter->writeAttribute('man', '1'); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - - // Second, write column breaks - if (count($aColumnBreaks) > 0) { - $objWriter->startElement('colBreaks'); - $objWriter->writeAttribute('count', count($aColumnBreaks)); - $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks)); - - foreach ($aColumnBreaks as $cell) { - $coords = PHPExcel_Cell::coordinateFromString($cell); - - $objWriter->startElement('brk'); - $objWriter->writeAttribute('id', PHPExcel_Cell::columnIndexFromString($coords[0]) - 1); - $objWriter->writeAttribute('man', '1'); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - - /** - * Write SheetData - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @param string[] $pStringTable String table - * @throws Exception - */ - private function _writeSheetData(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pStringTable = null) - { - if (is_array($pStringTable)) { - // Flipped stringtable, for faster index searching - $aFlippedStringTable = $this->getParentWriter()->getWriterPart('stringtable')->flipStringTable($pStringTable); - - // sheetData - $objWriter->startElement('sheetData'); - - // Get column count - $colCount = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()); - - // Highest row number - $highestRow = $pSheet->getHighestRow(); - - // Loop through cells - $cellsByRow = array(); - foreach ($pSheet->getCellCollection() as $cellID) { - $cellAddress = PHPExcel_Cell::coordinateFromString($cellID); - $cellsByRow[$cellAddress[1]][] = $cellID; - } - - $currentRow = 0; - while($currentRow++ < $highestRow) { - // Get row dimension - $rowDimension = $pSheet->getRowDimension($currentRow); - - // Write current row? - $writeCurrentRow = isset($cellsByRow[$currentRow]) || - $rowDimension->getRowHeight() >= 0 || - $rowDimension->getVisible() == false || - $rowDimension->getCollapsed() == true || - $rowDimension->getOutlineLevel() > 0 || - $rowDimension->getXfIndex() !== null; - - if ($writeCurrentRow) { - // Start a new row - $objWriter->startElement('row'); - $objWriter->writeAttribute('r', $currentRow); - $objWriter->writeAttribute('spans', '1:' . $colCount); - - // Row dimensions - if ($rowDimension->getRowHeight() >= 0) { - $objWriter->writeAttribute('customHeight', '1'); - $objWriter->writeAttribute('ht', PHPExcel_Shared_String::FormatNumber($rowDimension->getRowHeight())); - } - - // Row visibility - if ($rowDimension->getVisible() == false) { - $objWriter->writeAttribute('hidden', 'true'); - } - - // Collapsed - if ($rowDimension->getCollapsed() == true) { - $objWriter->writeAttribute('collapsed', 'true'); - } - - // Outline level - if ($rowDimension->getOutlineLevel() > 0) { - $objWriter->writeAttribute('outlineLevel', $rowDimension->getOutlineLevel()); - } - - // Style - if ($rowDimension->getXfIndex() !== null) { - $objWriter->writeAttribute('s', $rowDimension->getXfIndex()); - $objWriter->writeAttribute('customFormat', '1'); - } - - // Write cells - if (isset($cellsByRow[$currentRow])) { - foreach($cellsByRow[$currentRow] as $cellAddress) { - // Write cell - $this->_writeCell($objWriter, $pSheet, $cellAddress, $pStringTable, $aFlippedStringTable); - } - } - - // End row - $objWriter->endElement(); - } - } - - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Write Cell - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @param PHPExcel_Cell $pCell Cell - * @param string[] $pStringTable String table - * @param string[] $pFlippedStringTable String table (flipped), for faster index searching - * @throws Exception - */ - private function _writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null) - { - if (is_array($pStringTable) && is_array($pFlippedStringTable)) { - // Cell - $pCell = $pSheet->getCell($pCellAddress); - $objWriter->startElement('c'); - $objWriter->writeAttribute('r', $pCellAddress); - - // Sheet styles - if ($pCell->getXfIndex() != '') { - $objWriter->writeAttribute('s', $pCell->getXfIndex()); - } - - // If cell value is supplied, write cell value - $cellValue = $pCell->getValue(); - if (is_object($cellValue) || $cellValue !== '') { - // Map type - $mappedType = $pCell->getDataType(); - - // Write data type depending on its type - switch (strtolower($mappedType)) { - case 'inlinestr': // Inline string - case 's': // String - case 'b': // Boolean - $objWriter->writeAttribute('t', $mappedType); - break; - case 'f': // Formula - $calculatedValue = null; - if ($this->getParentWriter()->getPreCalculateFormulas()) { - $calculatedValue = $pCell->getCalculatedValue(); - } else { - $calculatedValue = $cellValue; - } - if (is_string($calculatedValue)) { - $objWriter->writeAttribute('t', 'str'); - } - break; - case 'e': // Error - $objWriter->writeAttribute('t', $mappedType); - } - - // Write data depending on its type - switch (strtolower($mappedType)) { - case 'inlinestr': // Inline string - if (! $cellValue instanceof PHPExcel_RichText) { - $objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML( htmlspecialchars($cellValue) ) ); - } else if ($cellValue instanceof PHPExcel_RichText) { - $objWriter->startElement('is'); - $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue); - $objWriter->endElement(); - } - - break; - case 's': // String - if (! $cellValue instanceof PHPExcel_RichText) { - if (isset($pFlippedStringTable[$cellValue])) { - $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]); - } - } else if ($cellValue instanceof PHPExcel_RichText) { - $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]); - } - - break; - case 'f': // Formula - $attributes = $pCell->getFormulaAttributes(); - if($attributes['t'] == 'array') { - $objWriter->startElement('f'); - $objWriter->writeAttribute('t', 'array'); - $objWriter->writeAttribute('ref', $pCellAddress); - $objWriter->writeAttribute('aca', '1'); - $objWriter->writeAttribute('ca', '1'); - $objWriter->text(substr($cellValue, 1)); - $objWriter->endElement(); - } else { - $objWriter->writeElement('f', substr($cellValue, 1)); - } - if ($this->getParentWriter()->getOffice2003Compatibility() === false) { - if ($this->getParentWriter()->getPreCalculateFormulas()) { - $calculatedValue = $pCell->getCalculatedValue(); - if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') { - $objWriter->writeElement('v', PHPExcel_Shared_String::FormatNumber($calculatedValue)); - } else { - $objWriter->writeElement('v', '0'); - } - } else { - $objWriter->writeElement('v', '0'); - } - } - break; - case 'n': // Numeric - // force point as decimal separator in case current locale uses comma - $objWriter->writeElement('v', str_replace(',', '.', $cellValue)); - break; - case 'b': // Boolean - $objWriter->writeElement('v', ($cellValue ? '1' : '0')); - break; - case 'e': // Error - if (substr($cellValue, 0, 1) == '=') { - $objWriter->writeElement('f', substr($cellValue, 1)); - $objWriter->writeElement('v', substr($cellValue, 1)); - } else { - $objWriter->writeElement('v', $cellValue); - } - - break; - } - } - - $objWriter->endElement(); - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Write Drawings - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // If sheet contains drawings, add the relationships - if ($pSheet->getDrawingCollection()->count() > 0) { - $objWriter->startElement('drawing'); - $objWriter->writeAttribute('r:id', 'rId1'); - $objWriter->endElement(); - } - } - - /** - * Write LegacyDrawing - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeLegacyDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // If sheet contains comments, add the relationships - if (count($pSheet->getComments()) > 0) { - $objWriter->startElement('legacyDrawing'); - $objWriter->writeAttribute('r:id', 'rId_comments_vml1'); - $objWriter->endElement(); - } - } - - /** - * Write LegacyDrawingHF - * - * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer - * @param PHPExcel_Worksheet $pSheet Worksheet - * @throws Exception - */ - private function _writeLegacyDrawingHF(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null) - { - // If sheet contains comments, add the relationships - if (count($pSheet->getHeaderFooter()->getImages()) > 0) { - $objWriter->startElement('legacyDrawingHF'); - $objWriter->writeAttribute('r:id', 'rId_headerfooter_vml1'); - $objWriter->endElement(); - } - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/WriterPart.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/WriterPart.php deleted file mode 100644 index 638cbb62c2..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel2007/WriterPart.php +++ /dev/null @@ -1,81 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel2007_WriterPart - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel2007 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -abstract class PHPExcel_Writer_Excel2007_WriterPart -{ - /** - * Parent IWriter object - * - * @var PHPExcel_Writer_IWriter - */ - private $_parentWriter; - - /** - * Set parent IWriter object - * - * @param PHPExcel_Writer_IWriter $pWriter - * @throws Exception - */ - public function setParentWriter(PHPExcel_Writer_IWriter $pWriter = null) { - $this->_parentWriter = $pWriter; - } - - /** - * Get parent IWriter object - * - * @return PHPExcel_Writer_IWriter - * @throws Exception - */ - public function getParentWriter() { - if (!is_null($this->_parentWriter)) { - return $this->_parentWriter; - } else { - throw new Exception("No parent PHPExcel_Writer_IWriter assigned."); - } - } - - /** - * Set parent IWriter object - * - * @param PHPExcel_Writer_IWriter $pWriter - * @throws Exception - */ - public function __construct(PHPExcel_Writer_IWriter $pWriter = null) { - if (!is_null($pWriter)) { - $this->_parentWriter = $pWriter; - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5.php deleted file mode 100644 index f69bc4d5cd..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5.php +++ /dev/null @@ -1,468 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel5 - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5 implements PHPExcel_Writer_IWriter -{ - /** - * Pre-calculate formulas - * - * @var boolean - */ - private $_preCalculateFormulas = true; - - /** - * PHPExcel object - * - * @var PHPExcel - */ - private $_phpExcel; - - /** - * The BIFF version of the written Excel file, BIFF5 = 0x0500, BIFF8 = 0x0600 - * - * @var integer - */ - private $_BIFF_version = 0x0600; - - /** - * Total number of shared strings in workbook - * - * @var int - */ - private $_str_total = 0; - - /** - * Number of unique shared strings in workbook - * - * @var int - */ - private $_str_unique = 0; - - /** - * Array of unique shared strings in workbook - * - * @var array - */ - private $_str_table = array(); - - /** - * Color cache. Mapping between RGB value and color index. - * - * @var array - */ - private $_colors; - - /** - * Formula parser - * - * @var PHPExcel_Writer_Excel5_Parser - */ - private $_parser; - - /** - * Identifier clusters for drawings. Used in MSODRAWINGGROUP record. - * - * @var array - */ - private $_IDCLs; - - - /** - * Create a new PHPExcel_Writer_Excel5 - * - * @param PHPExcel $phpExcel PHPExcel object - */ - public function __construct(PHPExcel $phpExcel) { - $this->_phpExcel = $phpExcel; - - $this->_parser = new PHPExcel_Writer_Excel5_Parser($this->_BIFF_version); - } - - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null) { - - // garbage collect - $this->_phpExcel->garbageCollect(); - - $saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog; - PHPExcel_Calculation::getInstance()->writeDebugLog = false; - $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType(); - PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL); - - // initialize colors array - $this->_colors = array(); - - // Initialise workbook writer - $this->_writerWorkbook = new PHPExcel_Writer_Excel5_Workbook($this->_phpExcel, $this->_BIFF_version, - $this->_str_total, $this->_str_unique, $this->_str_table, $this->_colors, $this->_parser); - - // Initialise worksheet writers - $countSheets = $this->_phpExcel->getSheetCount(); - for ($i = 0; $i < $countSheets; ++$i) { - $this->_writerWorksheets[$i] = new PHPExcel_Writer_Excel5_Worksheet($this->_BIFF_version, - $this->_str_total, $this->_str_unique, - $this->_str_table, $this->_colors, - $this->_parser, - $this->_preCalculateFormulas, - $this->_phpExcel->getSheet($i)); - } - - // build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook. - $this->_buildWorksheetEschers(); - $this->_buildWorkbookEscher(); - - // add 15 identical cell style Xfs - // for now, we use the first cellXf instead of cellStyleXf - $cellXfCollection = $this->_phpExcel->getCellXfCollection(); - for ($i = 0; $i < 15; ++$i) { - $this->_writerWorkbook->addXfWriter($cellXfCollection[0], true); - } - - // add all the cell Xfs - foreach ($this->_phpExcel->getCellXfCollection() as $style) { - $this->_writerWorkbook->addXfWriter($style, false); - } - - // initialize OLE file - $workbookStreamName = ($this->_BIFF_version == 0x0600) ? 'Workbook' : 'Book'; - $OLE = new PHPExcel_Shared_OLE_PPS_File(PHPExcel_Shared_OLE::Asc2Ucs($workbookStreamName)); - - // Write the worksheet streams before the global workbook stream, - // because the byte sizes of these are needed in the global workbook stream - $worksheetSizes = array(); - for ($i = 0; $i < $countSheets; ++$i) { - $this->_writerWorksheets[$i]->close(); - $worksheetSizes[] = $this->_writerWorksheets[$i]->_datasize; - } - - // add binary data for global workbook stream - $OLE->append( $this->_writerWorkbook->writeWorkbook($worksheetSizes) ); - - // add binary data for sheet streams - for ($i = 0; $i < $countSheets; ++$i) { - $OLE->append($this->_writerWorksheets[$i]->getData()); - } - - $root = new PHPExcel_Shared_OLE_PPS_Root(time(), time(), array($OLE)); - // save the OLE file - $res = $root->save($pFilename); - - PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType); - PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog; - } - - /** - * Set temporary storage directory - * - * @deprecated - * @param string $pValue Temporary storage directory - * @throws Exception Exception when directory does not exist - * @return PHPExcel_Writer_Excel5 - */ - public function setTempDir($pValue = '') { - return $this; - } - - /** - * Get Pre-Calculate Formulas - * - * @return boolean - */ - public function getPreCalculateFormulas() { - return $this->_preCalculateFormulas; - } - - /** - * Set Pre-Calculate Formulas - * - * @param boolean $pValue Pre-Calculate Formulas? - */ - public function setPreCalculateFormulas($pValue = true) { - $this->_preCalculateFormulas = $pValue; - } - - private function _buildWorksheetEschers() - { - // 1-based index to BstoreContainer - $blipIndex = 0; - - foreach ($this->_phpExcel->getAllsheets() as $sheet) { - // sheet index - $sheetIndex = $sheet->getParent()->getIndex($sheet); - - $escher = null; - - // check if there are any shapes for this sheet - if (count($sheet->getDrawingCollection()) == 0) { - continue; - } - - // create intermediate Escher object - $escher = new PHPExcel_Shared_Escher(); - - // dgContainer - $dgContainer = new PHPExcel_Shared_Escher_DgContainer(); - - // set the drawing index (we use sheet index + 1) - $dgId = $sheet->getParent()->getIndex($sheet) + 1; - $dgContainer->setDgId($dgId); - $escher->setDgContainer($dgContainer); - - // spgrContainer - $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer(); - $dgContainer->setSpgrContainer($spgrContainer); - - // add one shape which is the group shape - $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); - $spContainer->setSpgr(true); - $spContainer->setSpType(0); - $spContainer->setSpId(($sheet->getParent()->getIndex($sheet) + 1) << 10); - $spgrContainer->addChild($spContainer); - - // add the shapes - - $countShapes[$sheetIndex] = 0; // count number of shapes (minus group shape), in sheet - - foreach ($sheet->getDrawingCollection() as $drawing) { - ++$blipIndex; - - ++$countShapes[$sheetIndex]; - - // add the shape - $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer(); - - // set the shape type - $spContainer->setSpType(0x004B); - - // set the shape index (we combine 1-based sheet index and $countShapes to create unique shape index) - $reducedSpId = $countShapes[$sheetIndex]; - $spId = $reducedSpId - | ($sheet->getParent()->getIndex($sheet) + 1) << 10; - $spContainer->setSpId($spId); - - // keep track of last reducedSpId - $lastReducedSpId = $reducedSpId; - - // keep track of last spId - $lastSpId = $spId; - - // set the BLIP index - $spContainer->setOPT(0x4104, $blipIndex); - - // set coordinates and offsets, client anchor - $coordinates = $drawing->getCoordinates(); - $offsetX = $drawing->getOffsetX(); - $offsetY = $drawing->getOffsetY(); - $width = $drawing->getWidth(); - $height = $drawing->getHeight(); - - $twoAnchor = PHPExcel_Shared_Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height); - - $spContainer->setStartCoordinates($twoAnchor['startCoordinates']); - $spContainer->setStartOffsetX($twoAnchor['startOffsetX']); - $spContainer->setStartOffsetY($twoAnchor['startOffsetY']); - $spContainer->setEndCoordinates($twoAnchor['endCoordinates']); - $spContainer->setEndOffsetX($twoAnchor['endOffsetX']); - $spContainer->setEndOffsetY($twoAnchor['endOffsetY']); - - $spgrContainer->addChild($spContainer); - } - - // identifier clusters, used for workbook Escher object - $this->_IDCLs[$dgId] = $lastReducedSpId; - - // set last shape index - $dgContainer->setLastSpId($lastSpId); - - // set the Escher object - $this->_writerWorksheets[$sheetIndex]->setEscher($escher); - } - } - - /** - * Build the Escher object corresponding to the MSODRAWINGGROUP record - */ - private function _buildWorkbookEscher() - { - $escher = null; - - // any drawings in this workbook? - $found = false; - foreach ($this->_phpExcel->getAllSheets() as $sheet) { - if (count($sheet->getDrawingCollection()) > 0) { - $found = true; - } - } - - // nothing to do if there are no drawings - if (!$found) { - return; - } - - // if we reach here, then there are drawings in the workbook - $escher = new PHPExcel_Shared_Escher(); - - // dggContainer - $dggContainer = new PHPExcel_Shared_Escher_DggContainer(); - $escher->setDggContainer($dggContainer); - - // set IDCLs (identifier clusters) - $dggContainer->setIDCLs($this->_IDCLs); - - // this loop is for determining maximum shape identifier of all drawing - $spIdMax = 0; - $totalCountShapes = 0; - $countDrawings = 0; - - foreach ($this->_phpExcel->getAllsheets() as $sheet) { - $sheetCountShapes = 0; // count number of shapes (minus group shape), in sheet - - if (count($sheet->getDrawingCollection()) > 0) { - ++$countDrawings; - - foreach ($sheet->getDrawingCollection() as $drawing) { - ++$sheetCountShapes; - ++$totalCountShapes; - - $spId = $sheetCountShapes - | ($this->_phpExcel->getIndex($sheet) + 1) << 10; - $spIdMax = max($spId, $spIdMax); - } - } - } - - $dggContainer->setSpIdMax($spIdMax + 1); - $dggContainer->setCDgSaved($countDrawings); - $dggContainer->setCSpSaved($totalCountShapes + $countDrawings); // total number of shapes incl. one group shapes per drawing - - // bstoreContainer - $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer(); - $dggContainer->setBstoreContainer($bstoreContainer); - - // the BSE's (all the images) - foreach ($this->_phpExcel->getAllsheets() as $sheet) { - foreach ($sheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof PHPExcel_Worksheet_Drawing) { - - $filename = $drawing->getPath(); - - list($imagesx, $imagesy, $imageFormat) = getimagesize($filename); - - switch ($imageFormat) { - - case 1: // GIF, not supported by BIFF8, we convert to PNG - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; - ob_start(); - imagepng(imagecreatefromgif($filename)); - $blipData = ob_get_contents(); - ob_end_clean(); - break; - - case 2: // JPEG - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG; - $blipData = file_get_contents($filename); - break; - - case 3: // PNG - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; - $blipData = file_get_contents($filename); - break; - - case 6: // Windows DIB (BMP), we convert to PNG - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; - ob_start(); - imagepng(PHPExcel_Shared_Drawing::imagecreatefrombmp($filename)); - $blipData = ob_get_contents(); - ob_end_clean(); - break; - - default: continue 2; - - } - - $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); - $blip->setData($blipData); - - $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); - $BSE->setBlipType($blipType); - $BSE->setBlip($blip); - - $bstoreContainer->addBSE($BSE); - - } else if ($drawing instanceof PHPExcel_Worksheet_MemoryDrawing) { - - switch ($drawing->getRenderingFunction()) { - - case PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG: - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG; - $renderingFunction = 'imagejpeg'; - break; - - case PHPExcel_Worksheet_MemoryDrawing::RENDERING_GIF: - case PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG: - case PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT: - $blipType = PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG; - $renderingFunction = 'imagepng'; - break; - - } - - ob_start(); - call_user_func($renderingFunction, $drawing->getImageResource()); - $blipData = ob_get_contents(); - ob_end_clean(); - - $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip(); - $blip->setData($blipData); - - $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE(); - $BSE->setBlipType($blipType); - $BSE->setBlip($blip); - - $bstoreContainer->addBSE($BSE); - } - } - } - - // Set the Escher object - $this->_writerWorkbook->setEscher($escher); - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/BIFFwriter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/BIFFwriter.php deleted file mode 100644 index 6ff3c19669..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/BIFFwriter.php +++ /dev/null @@ -1,270 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -// Original file header of PEAR::Spreadsheet_Excel_Writer_BIFFwriter (used as the base for this class): -// ----------------------------------------------------------------------------------------- -// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> -// * -// * The majority of this is _NOT_ my code. I simply ported it from the -// * PERL Spreadsheet::WriteExcel module. -// * -// * The author of the Spreadsheet::WriteExcel module is John McNamara -// * <jmcnamara@cpan.org> -// * -// * I _DO_ maintain this code, and John McNamara has nothing to do with the -// * porting of this code to PHP. Any questions directly related to this -// * class library should be directed to me. -// * -// * License Information: -// * -// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets -// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com -// * -// * This library is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 2.1 of the License, or (at your option) any later version. -// * -// * This library is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public -// * License along with this library; if not, write to the Free Software -// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// */ - - -/** - * PHPExcel_Writer_Excel5_BIFFwriter - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_BIFFwriter -{ - /** - * The BIFF/Excel version (5). - * @var integer - */ - public $_BIFF_version = 0x0500; - - /** - * The byte order of this architecture. 0 => little endian, 1 => big endian - * @var integer - */ - private static $_byte_order; - - /** - * The string containing the data of the BIFF stream - * @var string - */ - public $_data; - - /** - * The size of the data in bytes. Should be the same as strlen($this->_data) - * @var integer - */ - public $_datasize; - - /** - * The maximum length for a BIFF record (excluding record header and length field). See _addContinue() - * @var integer - * @see _addContinue() - */ - public $_limit; - - /** - * Constructor - */ - public function __construct() - { - $this->_data = ''; - $this->_datasize = 0; - $this->_limit = 2080; - } - - /** - * Determine the byte order and store it as class data to avoid - * recalculating it for each call to new(). - * - * @return int - */ - public static function getByteOrder() - { - if (!isset(self::$_byte_order)) { - // Check if "pack" gives the required IEEE 64bit float - $teststr = pack("d", 1.2345); - $number = pack("C8", 0x8D, 0x97, 0x6E, 0x12, 0x83, 0xC0, 0xF3, 0x3F); - if ($number == $teststr) { - $byte_order = 0; // Little Endian - } elseif ($number == strrev($teststr)){ - $byte_order = 1; // Big Endian - } else { - // Give up. I'll fix this in a later version. - throw new Exception("Required floating point format ". - "not supported on this platform."); - } - self::$_byte_order = $byte_order; - } - - return self::$_byte_order; - } - - /** - * General storage function - * - * @param string $data binary data to append - * @access private - */ - function _append($data) - { - if (strlen($data) - 4 > $this->_limit) { - $data = $this->_addContinue($data); - } - $this->_data .= $data; - $this->_datasize += strlen($data); - } - - /** - * General storage function like _append, but returns string instead of modifying $this->_data - * - * @param string $data binary data to write - * @return string - */ - public function writeData($data) - { - if (strlen($data) - 4 > $this->_limit) { - $data = $this->_addContinue($data); - } - $this->_datasize += strlen($data); - - return $data; - } - - /** - * Writes Excel BOF record to indicate the beginning of a stream or - * sub-stream in the BIFF file. - * - * @param integer $type Type of BIFF file to write: 0x0005 Workbook, - * 0x0010 Worksheet. - * @access private - */ - function _storeBof($type) - { - $record = 0x0809; // Record identifier - - // According to the SDK $build and $year should be set to zero. - // However, this throws a warning in Excel 5. So, use magic numbers. - if ($this->_BIFF_version == 0x0500) { - $length = 0x0008; - $unknown = ''; - $build = 0x096C; - $year = 0x07C9; - } elseif ($this->_BIFF_version == 0x0600) { - $length = 0x0010; - - // by inspection of real files, MS Office Excel 2007 writes the following - $unknown = pack("VV", 0x000100D1, 0x00000406); - - $build = 0x0DBB; - $year = 0x07CC; - } - $version = $this->_BIFF_version; - - $header = pack("vv", $record, $length); - $data = pack("vvvv", $version, $type, $build, $year); - $this->_append($header . $data . $unknown); - } - - /** - * Writes Excel EOF record to indicate the end of a BIFF stream. - * - * @access private - */ - function _storeEof() - { - $record = 0x000A; // Record identifier - $length = 0x0000; // Number of bytes to follow - $header = pack("vv", $record, $length); - $this->_append($header); - } - - /** - * Writes Excel EOF record to indicate the end of a BIFF stream. - * - * @access private - */ - public function writeEof() - { - $record = 0x000A; // Record identifier - $length = 0x0000; // Number of bytes to follow - $header = pack("vv", $record, $length); - return $this->writeData($header); - } - - /** - * Excel limits the size of BIFF records. In Excel 5 the limit is 2084 bytes. In - * Excel 97 the limit is 8228 bytes. Records that are longer than these limits - * must be split up into CONTINUE blocks. - * - * This function takes a long BIFF record and inserts CONTINUE records as - * necessary. - * - * @param string $data The original binary data to be written - * @return string A very convenient string of continue blocks - * @access private - */ - function _addContinue($data) - { - $limit = $this->_limit; - $record = 0x003C; // Record identifier - - // The first 2080/8224 bytes remain intact. However, we have to change - // the length field of the record. - $tmp = substr($data, 0, 2) . pack("v", $limit) . substr($data, 4, $limit); - - $header = pack("vv", $record, $limit); // Headers for continue records - - // Retrieve chunks of 2080/8224 bytes +4 for the header. - $data_length = strlen($data); - for ($i = $limit + 4; $i < ($data_length - $limit); $i += $limit) { - $tmp .= $header; - $tmp .= substr($data, $i, $limit); - } - - // Retrieve the last chunk of data - $header = pack("vv", $record, strlen($data) - $i); - $tmp .= $header; - $tmp .= substr($data, $i, strlen($data) - $i); - - return $tmp; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Escher.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Escher.php deleted file mode 100644 index aff3682821..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Escher.php +++ /dev/null @@ -1,512 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Shared_Escher_DggContainer_BstoreContainer - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Escher -{ - /** - * The object we are writing - */ - private $_object; - - /** - * The written binary data - */ - private $_data; - - /** - * Shape offsets. Positions in binary stream where a new shape record begins - * - * @var array - */ - private $_spOffsets; - - - /** - * Constructor - * - * @param mixed - */ - public function __construct($object) - { - $this->_object = $object; - } - - /** - * Process the object to be written - */ - public function close() - { - // initialize - $this->_data = ''; - - switch (get_class($this->_object)) { - - case 'PHPExcel_Shared_Escher': - if ($dggContainer = $this->_object->getDggContainer()) { - $writer = new PHPExcel_Writer_Excel5_Escher($dggContainer); - $this->_data = $writer->close(); - } else if ($dgContainer = $this->_object->getDgContainer()) { - $writer = new PHPExcel_Writer_Excel5_Escher($dgContainer); - $this->_data = $writer->close(); - $this->_spOffsets = $writer->getSpOffsets(); - } - break; - - case 'PHPExcel_Shared_Escher_DggContainer': - // this is a container record - - // initialize - $innerData = ''; - - // write the dgg - $recVer = 0x0; - $recInstance = 0x0000; - $recType = 0xF006; - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - // dgg data - $dggData = - pack('VVVV' - , $this->_object->getSpIdMax() // maximum shape identifier increased by one - , $this->_object->getCDgSaved() + 1 // number of file identifier clusters increased by one - , $this->_object->getCSpSaved() - , $this->_object->getCDgSaved() // count total number of drawings saved - ); - - // add file identifier clusters (one per drawing) - $IDCLs = $this->_object->getIDCLs(); - - foreach ($IDCLs as $dgId => $maxReducedSpId) { - $dggData .= pack('VV', $dgId, $maxReducedSpId + 1); - } - - $header = pack('vvV', $recVerInstance, $recType, strlen($dggData)); - $innerData .= $header . $dggData; - - // write the bstoreContainer - if ($bstoreContainer = $this->_object->getBstoreContainer()) { - $writer = new PHPExcel_Writer_Excel5_Escher($bstoreContainer); - $innerData .= $writer->close(); - } - - // write the record - $recVer = 0xF; - $recInstance = 0x0000; - $recType = 0xF000; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header . $innerData; - break; - - case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer': - // this is a container record - - // initialize - $innerData = ''; - - // treat the inner data - if ($BSECollection = $this->_object->getBSECollection()) { - foreach ($BSECollection as $BSE) { - $writer = new PHPExcel_Writer_Excel5_Escher($BSE); - $innerData .= $writer->close(); - } - } - - // write the record - $recVer = 0xF; - $recInstance = count($this->_object->getBSECollection()); - $recType = 0xF001; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header . $innerData; - break; - - case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE': - // this is a semi-container record - - // initialize - $innerData = ''; - - // here we treat the inner data - if ($blip = $this->_object->getBlip()) { - $writer = new PHPExcel_Writer_Excel5_Escher($blip); - $innerData .= $writer->close(); - } - - // initialize - $data = ''; - - $btWin32 = $this->_object->getBlipType(); - $btMacOS = $this->_object->getBlipType(); - $data .= pack('CC', $btWin32, $btMacOS); - - $rgbUid = pack('VVVV', 0,0,0,0); // todo - $data .= $rgbUid; - - $tag = 0; - $size = strlen($innerData); - $cRef = 1; - $foDelay = 0; //todo - $unused1 = 0x0; - $cbName = 0x0; - $unused2 = 0x0; - $unused3 = 0x0; - $data .= pack('vVVVCCCC', $tag, $size, $cRef, $foDelay, $unused1, $cbName, $unused2, $unused3); - - $data .= $innerData; - - // write the record - $recVer = 0x2; - $recInstance = $this->_object->getBlipType(); - $recType = 0xF007; - $length = strlen($data); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header; - - $this->_data .= $data; - break; - - case 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip': - // this is an atom record - - // write the record - switch ($this->_object->getParent()->getBlipType()) { - - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG: - // initialize - $innerData = ''; - - $rgbUid1 = pack('VVVV', 0,0,0,0); // todo - $innerData .= $rgbUid1; - - $tag = 0xFF; // todo - $innerData .= pack('C', $tag); - - $innerData .= $this->_object->getData(); - - $recVer = 0x0; - $recInstance = 0x46A; - $recType = 0xF01D; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header; - - $this->_data .= $innerData; - break; - - case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG: - // initialize - $innerData = ''; - - $rgbUid1 = pack('VVVV', 0,0,0,0); // todo - $innerData .= $rgbUid1; - - $tag = 0xFF; // todo - $innerData .= pack('C', $tag); - - $innerData .= $this->_object->getData(); - - $recVer = 0x0; - $recInstance = 0x6E0; - $recType = 0xF01E; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header; - - $this->_data .= $innerData; - break; - - } - break; - - case 'PHPExcel_Shared_Escher_DgContainer': - // this is a container record - - // initialize - $innerData = ''; - - // write the dg - $recVer = 0x0; - $recInstance = $this->_object->getDgId(); - $recType = 0xF008; - $length = 8; - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - // number of shapes in this drawing (including group shape) - $countShapes = count($this->_object->getSpgrContainer()->getChildren()); - $innerData .= $header . pack('VV', $countShapes, $this->_object->getLastSpId()); - //$innerData .= $header . pack('VV', 0, 0); - - // write the spgrContainer - if ($spgrContainer = $this->_object->getSpgrContainer()) { - $writer = new PHPExcel_Writer_Excel5_Escher($spgrContainer); - $innerData .= $writer->close(); - - // get the shape offsets relative to the spgrContainer record - $spOffsets = $writer->getSpOffsets(); - - // save the shape offsets relative to dgContainer - foreach ($spOffsets as & $spOffset) { - $spOffset += 24; // add length of dgContainer header data (8 bytes) plus dg data (16 bytes) - } - - $this->_spOffsets = $spOffsets; - } - - // write the record - $recVer = 0xF; - $recInstance = 0x0000; - $recType = 0xF002; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header . $innerData; - break; - - case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer': - // this is a container record - - // initialize - $innerData = ''; - - // initialize spape offsets - $totalSize = 8; - $spOffsets = array(); - - // treat the inner data - foreach ($this->_object->getChildren() as $spContainer) { - $writer = new PHPExcel_Writer_Excel5_Escher($spContainer); - $spData = $writer->close(); - $innerData .= $spData; - - // save the shape offsets (where new shape records begin) - $totalSize += strlen($spData); - $spOffsets[] = $totalSize; - } - - // write the record - $recVer = 0xF; - $recInstance = 0x0000; - $recType = 0xF003; - $length = strlen($innerData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header . $innerData; - $this->_spOffsets = $spOffsets; - break; - - case 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer': - // initialize - $data = ''; - - // build the data - - // write group shape record, if necessary? - if ($this->_object->getSpgr()) { - $recVer = 0x1; - $recInstance = 0x0000; - $recType = 0xF009; - $length = 0x00000010; - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $data .= $header . pack('VVVV', 0,0,0,0); - } - - // write the shape record - $recVer = 0x2; - $recInstance = $this->_object->getSpType(); // shape type - $recType = 0xF00A; - $length = 0x00000008; - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $data .= $header . pack('VV', $this->_object->getSpId(), $this->_object->getSpgr() ? 0x0005 : 0x0A00); - - - // the options - if ($this->_object->getOPTCollection()) { - $optData = ''; - - $recVer = 0x3; - $recInstance = count($this->_object->getOPTCollection()); - $recType = 0xF00B; - foreach ($this->_object->getOPTCollection() as $property => $value) { - $optData .= pack('vV', $property, $value); - } - $length = strlen($optData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - $data .= $header . $optData; - } - - // the client anchor - if ($this->_object->getStartCoordinates()) { - $clientAnchorData = ''; - - $recVer = 0x0; - $recInstance = 0x0; - $recType = 0xF010; - - // start coordinates - list($column, $row) = PHPExcel_Cell::coordinateFromString($this->_object->getStartCoordinates()); - $c1 = PHPExcel_Cell::columnIndexFromString($column) - 1; - $r1 = $row - 1; - - // start offsetX - $startOffsetX = $this->_object->getStartOffsetX(); - - // start offsetY - $startOffsetY = $this->_object->getStartOffsetY(); - - // end coordinates - list($column, $row) = PHPExcel_Cell::coordinateFromString($this->_object->getEndCoordinates()); - $c2 = PHPExcel_Cell::columnIndexFromString($column) - 1; - $r2 = $row - 1; - - // end offsetX - $endOffsetX = $this->_object->getEndOffsetX(); - - // end offsetY - $endOffsetY = $this->_object->getEndOffsetY(); - - $clientAnchorData = pack('vvvvvvvvv', 0x02, - $c1, $startOffsetX, $r1, $startOffsetY, - $c2, $endOffsetX, $r2, $endOffsetY); - - $length = strlen($clientAnchorData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - $data .= $header . $clientAnchorData; - } - - // the client data, just empty for now - if (!$this->_object->getSpgr()) { - $clientDataData = ''; - - $recVer = 0x0; - $recInstance = 0x0; - $recType = 0xF011; - - $length = strlen($clientDataData); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - $data .= $header . $clientDataData; - } - - // write the record - $recVer = 0xF; - $recInstance = 0x0000; - $recType = 0xF004; - $length = strlen($data); - - $recVerInstance = $recVer; - $recVerInstance |= $recInstance << 4; - - $header = pack('vvV', $recVerInstance, $recType, $length); - - $this->_data = $header . $data; - break; - - } - - return $this->_data; - } - - /** - * Gets the shape offsets - * - * @return array - */ - public function getSpOffsets() - { - return $this->_spOffsets; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Font.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Font.php deleted file mode 100644 index 0da4d20fdc..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Font.php +++ /dev/null @@ -1,193 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_Excel5_Font - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Font -{ - /** - * BIFF version - * - * @var int - */ - private $_BIFFVersion; - - /** - * Color index - * - * @var int - */ - private $_colorIndex; - - /** - * Font - * - * @var PHPExcel_Style_Font - */ - private $_font; - - /** - * Constructor - * - * @param PHPExcel_Style_Font $font - */ - public function __construct(PHPExcel_Style_Font $font = null) - { - $this->_BIFFVersion = 0x0600; - $this->_colorIndex = 0x7FFF; - $this->_font = $font; - } - - /** - * Set the color index - * - * @param int $colorIndex - */ - public function setColorIndex($colorIndex) - { - $this->_colorIndex = $colorIndex; - } - - /** - * Get font record data - * - * @return string - */ - public function writeFont() - { - $font_outline = 0; - $font_shadow = 0; - - $icv = $this->_colorIndex; // Index to color palette - if ($this->_font->getSuperScript()) { - $sss = 1; - } else if ($this->_font->getSubScript()) { - $sss = 2; - } else { - $sss = 0; - } - $bFamily = 0; // Font family - $bCharSet = PHPExcel_Shared_Font::getCharsetFromFontName($this->_font->getName()); // Character set - - $record = 0x31; // Record identifier - $reserved = 0x00; // Reserved - $grbit = 0x00; // Font attributes - if ($this->_font->getItalic()) { - $grbit |= 0x02; - } - if ($this->_font->getStrikethrough()) { - $grbit |= 0x08; - } - if ($font_outline) { - $grbit |= 0x10; - } - if ($font_shadow) { - $grbit |= 0x20; - } - - if ($this->_BIFFVersion == 0x0500) { - $data = pack("vvvvvCCCCC", - $this->_font->getSize() * 20, - $grbit, - $icv, - $this->_mapBold($this->_font->getBold()), - $sss, - $this->_mapUnderline($this->_font->getUnderline()), - $bFamily, - $bCharSet, - $reserved, - strlen($this->_font->getName()) - ); - $data .= $this->_font->getName(); - } elseif ($this->_BIFFVersion == 0x0600) { - $data = pack("vvvvvCCCC", - $this->_font->getSize() * 20, - $grbit, - $icv, - $this->_mapBold($this->_font->getBold()), - $sss, - $this->_mapUnderline($this->_font->getUnderline()), - $bFamily, - $bCharSet, - $reserved - ); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($this->_font->getName()); - } - - $length = strlen($data); - $header = pack("vv", $record, $length); - - return($header . $data); - } - - /** - * Set BIFF version - * - * @param int $BIFFVersion - */ - public function setBIFFVersion($BIFFVersion) - { - $this->_BIFFVersion = $BIFFVersion; - } - - /** - * Map to BIFF5-BIFF8 codes for bold - * - * @param boolean $bold - * @return int - */ - private function _mapBold($bold) { - if ($bold) { - return 0x2BC; - } - return 0x190; - } - - /** - * Map underline - * - * @param string - * @return int - */ - private function _mapUnderline($underline) { - switch ($underline) { - case PHPExcel_Style_Font::UNDERLINE_NONE: return 0x00; - case PHPExcel_Style_Font::UNDERLINE_SINGLE: return 0x01; - case PHPExcel_Style_Font::UNDERLINE_DOUBLE: return 0x02; - case PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING: return 0x21; - case PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING: return 0x22; - default: return 0x00; - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Parser.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Parser.php deleted file mode 100644 index 3d7e0f9a8a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Parser.php +++ /dev/null @@ -1,1611 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -// Original file header of PEAR::Spreadsheet_Excel_Writer_Parser (used as the base for this class): -// ----------------------------------------------------------------------------------------- -// * Class for parsing Excel formulas -// * -// * License Information: -// * -// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets -// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com -// * -// * This library is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 2.1 of the License, or (at your option) any later version. -// * -// * This library is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public -// * License along with this library; if not, write to the Free Software -// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// */ - - -/** - * PHPExcel_Writer_Excel5_Parser - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Parser -{ - /** Constants */ - // Sheet title in unquoted form - // Invalid sheet title characters cannot occur in the sheet title: - // *:/\?[] - // Moreover, there are valid sheet title characters that cannot occur in unquoted form (there may be more?) - // +-% '^&<>=,;#()"{} - const REGEX_SHEET_TITLE_UNQUOTED = '[^\*\:\/\\\\\?\[\]\+\-\% \\\'\^\&\<\>\=\,\;\#\(\)\"\{\}]+'; - - // Sheet title in quoted form (without surrounding quotes) - // Invalid sheet title characters cannot occur in the sheet title: - // *:/\?[] (usual invalid sheet title characters) - // Single quote is represented as a pair '' - const REGEX_SHEET_TITLE_QUOTED = '(([^\*\:\/\\\\\?\[\]\\\'])+|(\\\'\\\')+)+'; - - /** - * The index of the character we are currently looking at - * @var integer - */ - public $_current_char; - - /** - * The token we are working on. - * @var string - */ - public $_current_token; - - /** - * The formula to parse - * @var string - */ - public $_formula; - - /** - * The character ahead of the current char - * @var string - */ - public $_lookahead; - - /** - * The parse tree to be generated - * @var string - */ - public $_parse_tree; - - /** - * Array of external sheets - * @var array - */ - public $_ext_sheets; - - /** - * Array of sheet references in the form of REF structures - * @var array - */ - public $_references; - - /** - * The BIFF version for the workbook - * @var integer - */ - public $_BIFF_version; - - /** - * The class constructor - * - * @param integer $byte_order The byte order (Little endian or Big endian) of the architecture - * (optional). 1 => big endian, 0 (default) little endian. - */ - public function __construct($biff_version) - { - $this->_current_char = 0; - $this->_BIFF_version = $biff_version; - $this->_current_token = ''; // The token we are working on. - $this->_formula = ''; // The formula to parse. - $this->_lookahead = ''; // The character ahead of the current char. - $this->_parse_tree = ''; // The parse tree to be generated. - $this->_initializeHashes(); // Initialize the hashes: ptg's and function's ptg's - $this->_ext_sheets = array(); - $this->_references = array(); - } - - /** - * Initialize the ptg and function hashes. - * - * @access private - */ - function _initializeHashes() - { - // The Excel ptg indices - $this->ptg = array( - 'ptgExp' => 0x01, - 'ptgTbl' => 0x02, - 'ptgAdd' => 0x03, - 'ptgSub' => 0x04, - 'ptgMul' => 0x05, - 'ptgDiv' => 0x06, - 'ptgPower' => 0x07, - 'ptgConcat' => 0x08, - 'ptgLT' => 0x09, - 'ptgLE' => 0x0A, - 'ptgEQ' => 0x0B, - 'ptgGE' => 0x0C, - 'ptgGT' => 0x0D, - 'ptgNE' => 0x0E, - 'ptgIsect' => 0x0F, - 'ptgUnion' => 0x10, - 'ptgRange' => 0x11, - 'ptgUplus' => 0x12, - 'ptgUminus' => 0x13, - 'ptgPercent' => 0x14, - 'ptgParen' => 0x15, - 'ptgMissArg' => 0x16, - 'ptgStr' => 0x17, - 'ptgAttr' => 0x19, - 'ptgSheet' => 0x1A, - 'ptgEndSheet' => 0x1B, - 'ptgErr' => 0x1C, - 'ptgBool' => 0x1D, - 'ptgInt' => 0x1E, - 'ptgNum' => 0x1F, - 'ptgArray' => 0x20, - 'ptgFunc' => 0x21, - 'ptgFuncVar' => 0x22, - 'ptgName' => 0x23, - 'ptgRef' => 0x24, - 'ptgArea' => 0x25, - 'ptgMemArea' => 0x26, - 'ptgMemErr' => 0x27, - 'ptgMemNoMem' => 0x28, - 'ptgMemFunc' => 0x29, - 'ptgRefErr' => 0x2A, - 'ptgAreaErr' => 0x2B, - 'ptgRefN' => 0x2C, - 'ptgAreaN' => 0x2D, - 'ptgMemAreaN' => 0x2E, - 'ptgMemNoMemN' => 0x2F, - 'ptgNameX' => 0x39, - 'ptgRef3d' => 0x3A, - 'ptgArea3d' => 0x3B, - 'ptgRefErr3d' => 0x3C, - 'ptgAreaErr3d' => 0x3D, - 'ptgArrayV' => 0x40, - 'ptgFuncV' => 0x41, - 'ptgFuncVarV' => 0x42, - 'ptgNameV' => 0x43, - 'ptgRefV' => 0x44, - 'ptgAreaV' => 0x45, - 'ptgMemAreaV' => 0x46, - 'ptgMemErrV' => 0x47, - 'ptgMemNoMemV' => 0x48, - 'ptgMemFuncV' => 0x49, - 'ptgRefErrV' => 0x4A, - 'ptgAreaErrV' => 0x4B, - 'ptgRefNV' => 0x4C, - 'ptgAreaNV' => 0x4D, - 'ptgMemAreaNV' => 0x4E, - 'ptgMemNoMemN' => 0x4F, - 'ptgFuncCEV' => 0x58, - 'ptgNameXV' => 0x59, - 'ptgRef3dV' => 0x5A, - 'ptgArea3dV' => 0x5B, - 'ptgRefErr3dV' => 0x5C, - 'ptgAreaErr3d' => 0x5D, - 'ptgArrayA' => 0x60, - 'ptgFuncA' => 0x61, - 'ptgFuncVarA' => 0x62, - 'ptgNameA' => 0x63, - 'ptgRefA' => 0x64, - 'ptgAreaA' => 0x65, - 'ptgMemAreaA' => 0x66, - 'ptgMemErrA' => 0x67, - 'ptgMemNoMemA' => 0x68, - 'ptgMemFuncA' => 0x69, - 'ptgRefErrA' => 0x6A, - 'ptgAreaErrA' => 0x6B, - 'ptgRefNA' => 0x6C, - 'ptgAreaNA' => 0x6D, - 'ptgMemAreaNA' => 0x6E, - 'ptgMemNoMemN' => 0x6F, - 'ptgFuncCEA' => 0x78, - 'ptgNameXA' => 0x79, - 'ptgRef3dA' => 0x7A, - 'ptgArea3dA' => 0x7B, - 'ptgRefErr3dA' => 0x7C, - 'ptgAreaErr3d' => 0x7D - ); - - // Thanks to Michael Meeks and Gnumeric for the initial arg values. - // - // The following hash was generated by "function_locale.pl" in the distro. - // Refer to function_locale.pl for non-English function names. - // - // The array elements are as follow: - // ptg: The Excel function ptg code. - // args: The number of arguments that the function takes: - // >=0 is a fixed number of arguments. - // -1 is a variable number of arguments. - // class: The reference, value or array class of the function args. - // vol: The function is volatile. - // - $this->_functions = array( - // function ptg args class vol - 'COUNT' => array( 0, -1, 0, 0 ), - 'IF' => array( 1, -1, 1, 0 ), - 'ISNA' => array( 2, 1, 1, 0 ), - 'ISERROR' => array( 3, 1, 1, 0 ), - 'SUM' => array( 4, -1, 0, 0 ), - 'AVERAGE' => array( 5, -1, 0, 0 ), - 'MIN' => array( 6, -1, 0, 0 ), - 'MAX' => array( 7, -1, 0, 0 ), - 'ROW' => array( 8, -1, 0, 0 ), - 'COLUMN' => array( 9, -1, 0, 0 ), - 'NA' => array( 10, 0, 0, 0 ), - 'NPV' => array( 11, -1, 1, 0 ), - 'STDEV' => array( 12, -1, 0, 0 ), - 'DOLLAR' => array( 13, -1, 1, 0 ), - 'FIXED' => array( 14, -1, 1, 0 ), - 'SIN' => array( 15, 1, 1, 0 ), - 'COS' => array( 16, 1, 1, 0 ), - 'TAN' => array( 17, 1, 1, 0 ), - 'ATAN' => array( 18, 1, 1, 0 ), - 'PI' => array( 19, 0, 1, 0 ), - 'SQRT' => array( 20, 1, 1, 0 ), - 'EXP' => array( 21, 1, 1, 0 ), - 'LN' => array( 22, 1, 1, 0 ), - 'LOG10' => array( 23, 1, 1, 0 ), - 'ABS' => array( 24, 1, 1, 0 ), - 'INT' => array( 25, 1, 1, 0 ), - 'SIGN' => array( 26, 1, 1, 0 ), - 'ROUND' => array( 27, 2, 1, 0 ), - 'LOOKUP' => array( 28, -1, 0, 0 ), - 'INDEX' => array( 29, -1, 0, 1 ), - 'REPT' => array( 30, 2, 1, 0 ), - 'MID' => array( 31, 3, 1, 0 ), - 'LEN' => array( 32, 1, 1, 0 ), - 'VALUE' => array( 33, 1, 1, 0 ), - 'TRUE' => array( 34, 0, 1, 0 ), - 'FALSE' => array( 35, 0, 1, 0 ), - 'AND' => array( 36, -1, 0, 0 ), - 'OR' => array( 37, -1, 0, 0 ), - 'NOT' => array( 38, 1, 1, 0 ), - 'MOD' => array( 39, 2, 1, 0 ), - 'DCOUNT' => array( 40, 3, 0, 0 ), - 'DSUM' => array( 41, 3, 0, 0 ), - 'DAVERAGE' => array( 42, 3, 0, 0 ), - 'DMIN' => array( 43, 3, 0, 0 ), - 'DMAX' => array( 44, 3, 0, 0 ), - 'DSTDEV' => array( 45, 3, 0, 0 ), - 'VAR' => array( 46, -1, 0, 0 ), - 'DVAR' => array( 47, 3, 0, 0 ), - 'TEXT' => array( 48, 2, 1, 0 ), - 'LINEST' => array( 49, -1, 0, 0 ), - 'TREND' => array( 50, -1, 0, 0 ), - 'LOGEST' => array( 51, -1, 0, 0 ), - 'GROWTH' => array( 52, -1, 0, 0 ), - 'PV' => array( 56, -1, 1, 0 ), - 'FV' => array( 57, -1, 1, 0 ), - 'NPER' => array( 58, -1, 1, 0 ), - 'PMT' => array( 59, -1, 1, 0 ), - 'RATE' => array( 60, -1, 1, 0 ), - 'MIRR' => array( 61, 3, 0, 0 ), - 'IRR' => array( 62, -1, 0, 0 ), - 'RAND' => array( 63, 0, 1, 1 ), - 'MATCH' => array( 64, -1, 0, 0 ), - 'DATE' => array( 65, 3, 1, 0 ), - 'TIME' => array( 66, 3, 1, 0 ), - 'DAY' => array( 67, 1, 1, 0 ), - 'MONTH' => array( 68, 1, 1, 0 ), - 'YEAR' => array( 69, 1, 1, 0 ), - 'WEEKDAY' => array( 70, -1, 1, 0 ), - 'HOUR' => array( 71, 1, 1, 0 ), - 'MINUTE' => array( 72, 1, 1, 0 ), - 'SECOND' => array( 73, 1, 1, 0 ), - 'NOW' => array( 74, 0, 1, 1 ), - 'AREAS' => array( 75, 1, 0, 1 ), - 'ROWS' => array( 76, 1, 0, 1 ), - 'COLUMNS' => array( 77, 1, 0, 1 ), - 'OFFSET' => array( 78, -1, 0, 1 ), - 'SEARCH' => array( 82, -1, 1, 0 ), - 'TRANSPOSE' => array( 83, 1, 1, 0 ), - 'TYPE' => array( 86, 1, 1, 0 ), - 'ATAN2' => array( 97, 2, 1, 0 ), - 'ASIN' => array( 98, 1, 1, 0 ), - 'ACOS' => array( 99, 1, 1, 0 ), - 'CHOOSE' => array( 100, -1, 1, 0 ), - 'HLOOKUP' => array( 101, -1, 0, 0 ), - 'VLOOKUP' => array( 102, -1, 0, 0 ), - 'ISREF' => array( 105, 1, 0, 0 ), - 'LOG' => array( 109, -1, 1, 0 ), - 'CHAR' => array( 111, 1, 1, 0 ), - 'LOWER' => array( 112, 1, 1, 0 ), - 'UPPER' => array( 113, 1, 1, 0 ), - 'PROPER' => array( 114, 1, 1, 0 ), - 'LEFT' => array( 115, -1, 1, 0 ), - 'RIGHT' => array( 116, -1, 1, 0 ), - 'EXACT' => array( 117, 2, 1, 0 ), - 'TRIM' => array( 118, 1, 1, 0 ), - 'REPLACE' => array( 119, 4, 1, 0 ), - 'SUBSTITUTE' => array( 120, -1, 1, 0 ), - 'CODE' => array( 121, 1, 1, 0 ), - 'FIND' => array( 124, -1, 1, 0 ), - 'CELL' => array( 125, -1, 0, 1 ), - 'ISERR' => array( 126, 1, 1, 0 ), - 'ISTEXT' => array( 127, 1, 1, 0 ), - 'ISNUMBER' => array( 128, 1, 1, 0 ), - 'ISBLANK' => array( 129, 1, 1, 0 ), - 'T' => array( 130, 1, 0, 0 ), - 'N' => array( 131, 1, 0, 0 ), - 'DATEVALUE' => array( 140, 1, 1, 0 ), - 'TIMEVALUE' => array( 141, 1, 1, 0 ), - 'SLN' => array( 142, 3, 1, 0 ), - 'SYD' => array( 143, 4, 1, 0 ), - 'DDB' => array( 144, -1, 1, 0 ), - 'INDIRECT' => array( 148, -1, 1, 1 ), - 'CALL' => array( 150, -1, 1, 0 ), - 'CLEAN' => array( 162, 1, 1, 0 ), - 'MDETERM' => array( 163, 1, 2, 0 ), - 'MINVERSE' => array( 164, 1, 2, 0 ), - 'MMULT' => array( 165, 2, 2, 0 ), - 'IPMT' => array( 167, -1, 1, 0 ), - 'PPMT' => array( 168, -1, 1, 0 ), - 'COUNTA' => array( 169, -1, 0, 0 ), - 'PRODUCT' => array( 183, -1, 0, 0 ), - 'FACT' => array( 184, 1, 1, 0 ), - 'DPRODUCT' => array( 189, 3, 0, 0 ), - 'ISNONTEXT' => array( 190, 1, 1, 0 ), - 'STDEVP' => array( 193, -1, 0, 0 ), - 'VARP' => array( 194, -1, 0, 0 ), - 'DSTDEVP' => array( 195, 3, 0, 0 ), - 'DVARP' => array( 196, 3, 0, 0 ), - 'TRUNC' => array( 197, -1, 1, 0 ), - 'ISLOGICAL' => array( 198, 1, 1, 0 ), - 'DCOUNTA' => array( 199, 3, 0, 0 ), - 'USDOLLAR' => array( 204, -1, 1, 0 ), - 'FINDB' => array( 205, -1, 1, 0 ), - 'SEARCHB' => array( 206, -1, 1, 0 ), - 'REPLACEB' => array( 207, 4, 1, 0 ), - 'LEFTB' => array( 208, -1, 1, 0 ), - 'RIGHTB' => array( 209, -1, 1, 0 ), - 'MIDB' => array( 210, 3, 1, 0 ), - 'LENB' => array( 211, 1, 1, 0 ), - 'ROUNDUP' => array( 212, 2, 1, 0 ), - 'ROUNDDOWN' => array( 213, 2, 1, 0 ), - 'ASC' => array( 214, 1, 1, 0 ), - 'DBCS' => array( 215, 1, 1, 0 ), - 'RANK' => array( 216, -1, 0, 0 ), - 'ADDRESS' => array( 219, -1, 1, 0 ), - 'DAYS360' => array( 220, -1, 1, 0 ), - 'TODAY' => array( 221, 0, 1, 1 ), - 'VDB' => array( 222, -1, 1, 0 ), - 'MEDIAN' => array( 227, -1, 0, 0 ), - 'SUMPRODUCT' => array( 228, -1, 2, 0 ), - 'SINH' => array( 229, 1, 1, 0 ), - 'COSH' => array( 230, 1, 1, 0 ), - 'TANH' => array( 231, 1, 1, 0 ), - 'ASINH' => array( 232, 1, 1, 0 ), - 'ACOSH' => array( 233, 1, 1, 0 ), - 'ATANH' => array( 234, 1, 1, 0 ), - 'DGET' => array( 235, 3, 0, 0 ), - 'INFO' => array( 244, 1, 1, 1 ), - 'DB' => array( 247, -1, 1, 0 ), - 'FREQUENCY' => array( 252, 2, 0, 0 ), - 'ERROR.TYPE' => array( 261, 1, 1, 0 ), - 'REGISTER.ID' => array( 267, -1, 1, 0 ), - 'AVEDEV' => array( 269, -1, 0, 0 ), - 'BETADIST' => array( 270, -1, 1, 0 ), - 'GAMMALN' => array( 271, 1, 1, 0 ), - 'BETAINV' => array( 272, -1, 1, 0 ), - 'BINOMDIST' => array( 273, 4, 1, 0 ), - 'CHIDIST' => array( 274, 2, 1, 0 ), - 'CHIINV' => array( 275, 2, 1, 0 ), - 'COMBIN' => array( 276, 2, 1, 0 ), - 'CONFIDENCE' => array( 277, 3, 1, 0 ), - 'CRITBINOM' => array( 278, 3, 1, 0 ), - 'EVEN' => array( 279, 1, 1, 0 ), - 'EXPONDIST' => array( 280, 3, 1, 0 ), - 'FDIST' => array( 281, 3, 1, 0 ), - 'FINV' => array( 282, 3, 1, 0 ), - 'FISHER' => array( 283, 1, 1, 0 ), - 'FISHERINV' => array( 284, 1, 1, 0 ), - 'FLOOR' => array( 285, 2, 1, 0 ), - 'GAMMADIST' => array( 286, 4, 1, 0 ), - 'GAMMAINV' => array( 287, 3, 1, 0 ), - 'CEILING' => array( 288, 2, 1, 0 ), - 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), - 'LOGNORMDIST' => array( 290, 3, 1, 0 ), - 'LOGINV' => array( 291, 3, 1, 0 ), - 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), - 'NORMDIST' => array( 293, 4, 1, 0 ), - 'NORMSDIST' => array( 294, 1, 1, 0 ), - 'NORMINV' => array( 295, 3, 1, 0 ), - 'NORMSINV' => array( 296, 1, 1, 0 ), - 'STANDARDIZE' => array( 297, 3, 1, 0 ), - 'ODD' => array( 298, 1, 1, 0 ), - 'PERMUT' => array( 299, 2, 1, 0 ), - 'POISSON' => array( 300, 3, 1, 0 ), - 'TDIST' => array( 301, 3, 1, 0 ), - 'WEIBULL' => array( 302, 4, 1, 0 ), - 'SUMXMY2' => array( 303, 2, 2, 0 ), - 'SUMX2MY2' => array( 304, 2, 2, 0 ), - 'SUMX2PY2' => array( 305, 2, 2, 0 ), - 'CHITEST' => array( 306, 2, 2, 0 ), - 'CORREL' => array( 307, 2, 2, 0 ), - 'COVAR' => array( 308, 2, 2, 0 ), - 'FORECAST' => array( 309, 3, 2, 0 ), - 'FTEST' => array( 310, 2, 2, 0 ), - 'INTERCEPT' => array( 311, 2, 2, 0 ), - 'PEARSON' => array( 312, 2, 2, 0 ), - 'RSQ' => array( 313, 2, 2, 0 ), - 'STEYX' => array( 314, 2, 2, 0 ), - 'SLOPE' => array( 315, 2, 2, 0 ), - 'TTEST' => array( 316, 4, 2, 0 ), - 'PROB' => array( 317, -1, 2, 0 ), - 'DEVSQ' => array( 318, -1, 0, 0 ), - 'GEOMEAN' => array( 319, -1, 0, 0 ), - 'HARMEAN' => array( 320, -1, 0, 0 ), - 'SUMSQ' => array( 321, -1, 0, 0 ), - 'KURT' => array( 322, -1, 0, 0 ), - 'SKEW' => array( 323, -1, 0, 0 ), - 'ZTEST' => array( 324, -1, 0, 0 ), - 'LARGE' => array( 325, 2, 0, 0 ), - 'SMALL' => array( 326, 2, 0, 0 ), - 'QUARTILE' => array( 327, 2, 0, 0 ), - 'PERCENTILE' => array( 328, 2, 0, 0 ), - 'PERCENTRANK' => array( 329, -1, 0, 0 ), - 'MODE' => array( 330, -1, 2, 0 ), - 'TRIMMEAN' => array( 331, 2, 0, 0 ), - 'TINV' => array( 332, 2, 1, 0 ), - 'CONCATENATE' => array( 336, -1, 1, 0 ), - 'POWER' => array( 337, 2, 1, 0 ), - 'RADIANS' => array( 342, 1, 1, 0 ), - 'DEGREES' => array( 343, 1, 1, 0 ), - 'SUBTOTAL' => array( 344, -1, 0, 0 ), - 'SUMIF' => array( 345, -1, 0, 0 ), - 'COUNTIF' => array( 346, 2, 0, 0 ), - 'COUNTBLANK' => array( 347, 1, 0, 0 ), - 'ISPMT' => array( 350, 4, 1, 0 ), - 'DATEDIF' => array( 351, 3, 1, 0 ), - 'DATESTRING' => array( 352, 1, 1, 0 ), - 'NUMBERSTRING' => array( 353, 2, 1, 0 ), - 'ROMAN' => array( 354, -1, 1, 0 ), - 'GETPIVOTDATA' => array( 358, -1, 0, 0 ), - 'HYPERLINK' => array( 359, -1, 1, 0 ), - 'PHONETIC' => array( 360, 1, 0, 0 ), - 'AVERAGEA' => array( 361, -1, 0, 0 ), - 'MAXA' => array( 362, -1, 0, 0 ), - 'MINA' => array( 363, -1, 0, 0 ), - 'STDEVPA' => array( 364, -1, 0, 0 ), - 'VARPA' => array( 365, -1, 0, 0 ), - 'STDEVA' => array( 366, -1, 0, 0 ), - 'VARA' => array( 367, -1, 0, 0 ), - 'BAHTTEXT' => array( 368, 1, 0, 0 ), - ); - } - - /** - * Convert a token to the proper ptg value. - * - * @access private - * @param mixed $token The token to convert. - * @return mixed the converted token on success - */ - function _convert($token) - { - if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $token)) { - return $this->_convertString($token); - - } elseif (is_numeric($token)) { - return $this->_convertNumber($token); - - // match references like A1 or $A$1 - } elseif (preg_match('/^\$?([A-Ia-i]?[A-Za-z])\$?(\d+)$/',$token)) { - return $this->_convertRef2d($token); - - // match external references like Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1 - } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u",$token)) { - return $this->_convertRef3d($token); - - // match external references like 'Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1 - } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?(\d+)$/u",$token)) { - return $this->_convertRef3d($token); - - // match ranges like A1:B2 or $A$1:$B$2 - } elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)\:(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)$/', $token)) { - return $this->_convertRange2d($token); - - // match external ranges like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 - } elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u",$token)) { - return $this->_convertRange3d($token); - - // match external ranges like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 - } elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)\:\\$?([A-Ia-i]?[A-Za-z])?\\$?(\d+)$/u",$token)) { - return $this->_convertRange3d($token); - - // operators (including parentheses) - } elseif (isset($this->ptg[$token])) { - return pack("C", $this->ptg[$token]); - - // match error codes - } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') { - return $this->_convertError($token); - - // commented so argument number can be processed correctly. See toReversePolish(). - /*elseif (preg_match("/[A-Z0-9\xc0-\xdc\.]+/",$token)) - { - return($this->_convertFunction($token,$this->_func_args)); - }*/ - - // if it's an argument, ignore the token (the argument remains) - } elseif ($token == 'arg') { - return ''; - } - - // TODO: use real error codes - throw new Exception("Unknown token $token"); - } - - /** - * Convert a number token to ptgInt or ptgNum - * - * @access private - * @param mixed $num an integer or double for conversion to its ptg value - */ - function _convertNumber($num) - { - // Integer in the range 0..2**16-1 - if ((preg_match("/^\d+$/", $num)) and ($num <= 65535)) { - return pack("Cv", $this->ptg['ptgInt'], $num); - } else { // A float - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $num = strrev($num); - } - return pack("Cd", $this->ptg['ptgNum'], $num); - } - } - - /** - * Convert a string token to ptgStr - * - * @access private - * @param string $string A string for conversion to its ptg value. - * @return mixed the converted token on success - */ - function _convertString($string) - { - // chop away beggining and ending quotes - $string = substr($string, 1, strlen($string) - 2); - if (strlen($string) > 255) { - throw new Exception("String is too long"); - } - - if ($this->_BIFF_version == 0x0500) { - return pack("CC", $this->ptg['ptgStr'], strlen($string)).$string; - } elseif ($this->_BIFF_version == 0x0600) { - return pack('C', $this->ptg['ptgStr']) . PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($string); - } - } - - /** - * Convert a function to a ptgFunc or ptgFuncVarV depending on the number of - * args that it takes. - * - * @access private - * @param string $token The name of the function for convertion to ptg value. - * @param integer $num_args The number of arguments the function receives. - * @return string The packed ptg for the function - */ - function _convertFunction($token, $num_args) - { - $args = $this->_functions[$token][1]; - $volatile = $this->_functions[$token][3]; - - // Fixed number of args eg. TIME($i,$j,$k). - if ($args >= 0) { - return pack("Cv", $this->ptg['ptgFuncV'], $this->_functions[$token][0]); - } - // Variable number of args eg. SUM($i,$j,$k, ..). - if ($args == -1) { - return pack("CCv", $this->ptg['ptgFuncVarV'], $num_args, $this->_functions[$token][0]); - } - } - - /** - * Convert an Excel range such as A1:D4 to a ptgRefV. - * - * @access private - * @param string $range An Excel range in the A1:A2 - */ - function _convertRange2d($range, $class=0) - { - - // TODO: possible class value 0,1,2 check Formula.pm - // Split the range into 2 cell refs - if (preg_match('/^(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)\:(\$)?([A-Ia-i]?[A-Za-z])(\$)?(\d+)$/', $range)) { - list($cell1, $cell2) = explode(':', $range); - } else { - // TODO: use real error codes - throw new Exception("Unknown range separator"); - } - - // Convert the cell references - $cell_array1 = $this->_cellToPackedRowcol($cell1); - list($row1, $col1) = $cell_array1; - $cell_array2 = $this->_cellToPackedRowcol($cell2); - list($row2, $col2) = $cell_array2; - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgArea = pack("C", $this->ptg['ptgArea']); - } elseif ($class == 1) { - $ptgArea = pack("C", $this->ptg['ptgAreaV']); - } elseif ($class == 2) { - $ptgArea = pack("C", $this->ptg['ptgAreaA']); - } else { - // TODO: use real error codes - throw new Exception("Unknown class $class"); - } - return $ptgArea . $row1 . $row2 . $col1. $col2; - } - - /** - * Convert an Excel 3d range such as "Sheet1!A1:D4" or "Sheet1:Sheet2!A1:D4" to - * a ptgArea3d. - * - * @access private - * @param string $token An Excel range in the Sheet1!A1:A2 format. - * @return mixed The packed ptgArea3d token on success. - */ - function _convertRange3d($token) - { - $class = 0; // formulas like Sheet1!$A$1:$A$2 in list type data validation need this class (0x3B) - - // Split the ref at the ! symbol - list($ext_ref, $range) = explode('!', $token); - - // Convert the external reference part (different for BIFF8) - if ($this->_BIFF_version == 0x0500) { - $ext_ref = $this->_packExtRef($ext_ref); - } elseif ($this->_BIFF_version == 0x0600) { - $ext_ref = $this->_getRefIndex($ext_ref); - } - - // Split the range into 2 cell refs - list($cell1, $cell2) = explode(':', $range); - - // Convert the cell references - if (preg_match("/^(\\$)?[A-Ia-i]?[A-Za-z](\\$)?(\d+)$/", $cell1)) { - $cell_array1 = $this->_cellToPackedRowcol($cell1); - list($row1, $col1) = $cell_array1; - $cell_array2 = $this->_cellToPackedRowcol($cell2); - list($row2, $col2) = $cell_array2; - } else { // It's a rows range (like 26:27) - $cells_array = $this->_rangeToPackedRange($cell1.':'.$cell2); - list($row1, $col1, $row2, $col2) = $cells_array; - } - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgArea = pack("C", $this->ptg['ptgArea3d']); - } elseif ($class == 1) { - $ptgArea = pack("C", $this->ptg['ptgArea3dV']); - } elseif ($class == 2) { - $ptgArea = pack("C", $this->ptg['ptgArea3dA']); - } else { - throw new Exception("Unknown class $class"); - } - - return $ptgArea . $ext_ref . $row1 . $row2 . $col1. $col2; - } - - /** - * Convert an Excel reference such as A1, $B2, C$3 or $D$4 to a ptgRefV. - * - * @access private - * @param string $cell An Excel cell reference - * @return string The cell in packed() format with the corresponding ptg - */ - function _convertRef2d($cell) - { - $class = 2; // as far as I know, this is magick. - - // Convert the cell reference - $cell_array = $this->_cellToPackedRowcol($cell); - list($row, $col) = $cell_array; - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgRef = pack("C", $this->ptg['ptgRef']); - } elseif ($class == 1) { - $ptgRef = pack("C", $this->ptg['ptgRefV']); - } elseif ($class == 2) { - $ptgRef = pack("C", $this->ptg['ptgRefA']); - } else { - // TODO: use real error codes - throw new Exception("Unknown class $class"); - } - return $ptgRef.$row.$col; - } - - /** - * Convert an Excel 3d reference such as "Sheet1!A1" or "Sheet1:Sheet2!A1" to a - * ptgRef3d. - * - * @access private - * @param string $cell An Excel cell reference - * @return mixed The packed ptgRef3d token on success. - */ - function _convertRef3d($cell) - { - $class = 2; // as far as I know, this is magick. - - // Split the ref at the ! symbol - list($ext_ref, $cell) = explode('!', $cell); - - // Convert the external reference part (different for BIFF8) - if ($this->_BIFF_version == 0x0500) { - $ext_ref = $this->_packExtRef($ext_ref); - } elseif ($this->_BIFF_version == 0x0600) { - $ext_ref = $this->_getRefIndex($ext_ref); - } - - // Convert the cell reference part - list($row, $col) = $this->_cellToPackedRowcol($cell); - - // The ptg value depends on the class of the ptg. - if ($class == 0) { - $ptgRef = pack("C", $this->ptg['ptgRef3d']); - } elseif ($class == 1) { - $ptgRef = pack("C", $this->ptg['ptgRef3dV']); - } elseif ($class == 2) { - $ptgRef = pack("C", $this->ptg['ptgRef3dA']); - } else { - throw new Exception("Unknown class $class"); - } - - return $ptgRef . $ext_ref. $row . $col; - } - - /** - * Convert an error code to a ptgErr - * - * @access private - * @param mixed $num an error codefor conversion to its ptg value - */ - function _convertError($errorCode) - { - switch ($errorCode) { - case '#NULL!': return pack("C", 0x00); - case '#DIV/0!': return pack("C", 0x07); - case '#VALUE!': return pack("C", 0x0F); - case '#REF!': return pack("C", 0x17); - case '#NAME?': return pack("C", 0x1D); - case '#NUM!': return pack("C", 0x24); - case '#N/A': return pack("C", 0x2A); - } - return pack("C", 0xFF); - } - - /** - * Convert the sheet name part of an external reference, for example "Sheet1" or - * "Sheet1:Sheet2", to a packed structure. - * - * @access private - * @param string $ext_ref The name of the external reference - * @return string The reference index in packed() format - */ - function _packExtRef($ext_ref) - { - $ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any. - $ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any. - - // Check if there is a sheet range eg., Sheet1:Sheet2. - if (preg_match("/:/", $ext_ref)) { - list($sheet_name1, $sheet_name2) = explode(':', $ext_ref); - - $sheet1 = $this->_getSheetIndex($sheet_name1); - if ($sheet1 == -1) { - throw new Exception("Unknown sheet name $sheet_name1 in formula"); - } - $sheet2 = $this->_getSheetIndex($sheet_name2); - if ($sheet2 == -1) { - throw new Exception("Unknown sheet name $sheet_name2 in formula"); - } - - // Reverse max and min sheet numbers if necessary - if ($sheet1 > $sheet2) { - list($sheet1, $sheet2) = array($sheet2, $sheet1); - } - } else { // Single sheet name only. - $sheet1 = $this->_getSheetIndex($ext_ref); - if ($sheet1 == -1) { - throw new Exception("Unknown sheet name $ext_ref in formula"); - } - $sheet2 = $sheet1; - } - - // References are stored relative to 0xFFFF. - $offset = -1 - $sheet1; - - return pack('vdvv', $offset, 0x00, $sheet1, $sheet2); - } - - /** - * Look up the REF index that corresponds to an external sheet name - * (or range). If it doesn't exist yet add it to the workbook's references - * array. It assumes all sheet names given must exist. - * - * @access private - * @param string $ext_ref The name of the external reference - * @return mixed The reference index in packed() format on success - */ - function _getRefIndex($ext_ref) - { - $ext_ref = preg_replace("/^'/", '', $ext_ref); // Remove leading ' if any. - $ext_ref = preg_replace("/'$/", '', $ext_ref); // Remove trailing ' if any. - $ext_ref = str_replace('\'\'', '\'', $ext_ref); // Replace escaped '' with ' - - // Check if there is a sheet range eg., Sheet1:Sheet2. - if (preg_match("/:/", $ext_ref)) { - list($sheet_name1, $sheet_name2) = explode(':', $ext_ref); - - $sheet1 = $this->_getSheetIndex($sheet_name1); - if ($sheet1 == -1) { - throw new Exception("Unknown sheet name $sheet_name1 in formula"); - } - $sheet2 = $this->_getSheetIndex($sheet_name2); - if ($sheet2 == -1) { - throw new Exception("Unknown sheet name $sheet_name2 in formula"); - } - - // Reverse max and min sheet numbers if necessary - if ($sheet1 > $sheet2) { - list($sheet1, $sheet2) = array($sheet2, $sheet1); - } - } else { // Single sheet name only. - $sheet1 = $this->_getSheetIndex($ext_ref); - if ($sheet1 == -1) { - throw new Exception("Unknown sheet name $ext_ref in formula"); - } - $sheet2 = $sheet1; - } - - // assume all references belong to this document - $supbook_index = 0x00; - $ref = pack('vvv', $supbook_index, $sheet1, $sheet2); - $total_references = count($this->_references); - $index = -1; - for ($i = 0; $i < $total_references; ++$i) { - if ($ref == $this->_references[$i]) { - $index = $i; - break; - } - } - // if REF was not found add it to references array - if ($index == -1) { - $this->_references[$total_references] = $ref; - $index = $total_references; - } - - return pack('v', $index); - } - - /** - * Look up the index that corresponds to an external sheet name. The hash of - * sheet names is updated by the addworksheet() method of the - * PHPExcel_Writer_Excel5_Workbook class. - * - * @access private - * @return integer The sheet index, -1 if the sheet was not found - */ - function _getSheetIndex($sheet_name) - { - if (!isset($this->_ext_sheets[$sheet_name])) { - return -1; - } else { - return $this->_ext_sheets[$sheet_name]; - } - } - - /** - * This method is used to update the array of sheet names. It is - * called by the addWorksheet() method of the - * PHPExcel_Writer_Excel5_Workbook class. - * - * @access public - * @see PHPExcel_Writer_Excel5_Workbook::addWorksheet() - * @param string $name The name of the worksheet being added - * @param integer $index The index of the worksheet being added - */ - function setExtSheet($name, $index) - { - $this->_ext_sheets[$name] = $index; - } - - /** - * pack() row and column into the required 3 or 4 byte format. - * - * @access private - * @param string $cell The Excel cell reference to be packed - * @return array Array containing the row and column in packed() format - */ - function _cellToPackedRowcol($cell) - { - $cell = strtoupper($cell); - list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell); - if ($col >= 256) { - throw new Exception("Column in: $cell greater than 255"); - } - // FIXME: change for BIFF8 - if ($row >= 16384) { - throw new Exception("Row in: $cell greater than 16384 "); - } - - // Set the high bits to indicate if row or col are relative. - if ($this->_BIFF_version == 0x0500) { - $row |= $col_rel << 14; - $row |= $row_rel << 15; - $col = pack('C', $col); - } elseif ($this->_BIFF_version == 0x0600) { - $col |= $col_rel << 14; - $col |= $row_rel << 15; - $col = pack('v', $col); - } - $row = pack('v', $row); - - return array($row, $col); - } - - /** - * pack() row range into the required 3 or 4 byte format. - * Just using maximum col/rows, which is probably not the correct solution - * - * @access private - * @param string $range The Excel range to be packed - * @return array Array containing (row1,col1,row2,col2) in packed() format - */ - function _rangeToPackedRange($range) - { - preg_match('/(\$)?(\d+)\:(\$)?(\d+)/', $range, $match); - // return absolute rows if there is a $ in the ref - $row1_rel = empty($match[1]) ? 1 : 0; - $row1 = $match[2]; - $row2_rel = empty($match[3]) ? 1 : 0; - $row2 = $match[4]; - // Convert 1-index to zero-index - --$row1; - --$row2; - // Trick poor inocent Excel - $col1 = 0; - $col2 = 16383; // FIXME: maximum possible value for Excel 5 (change this!!!) - - // FIXME: this changes for BIFF8 - if (($row1 >= 16384) or ($row2 >= 16384)) { - throw new Exception("Row in: $range greater than 16384 "); - } - - // Set the high bits to indicate if rows are relative. - if ($this->_BIFF_version == 0x0500) { - $row1 |= $row1_rel << 14; // FIXME: probably a bug - $row2 |= $row2_rel << 15; - $col1 = pack('C', $col1); - $col2 = pack('C', $col2); - } elseif ($this->_BIFF_version == 0x0600) { - $col1 |= $row1_rel << 15; - $col2 |= $row2_rel << 15; - $col1 = pack('v', $col1); - $col2 = pack('v', $col2); - } - $row1 = pack('v', $row1); - $row2 = pack('v', $row2); - - return array($row1, $col1, $row2, $col2); - } - - /** - * Convert an Excel cell reference such as A1 or $B2 or C$3 or $D$4 to a zero - * indexed row and column number. Also returns two (0,1) values to indicate - * whether the row or column are relative references. - * - * @access private - * @param string $cell The Excel cell reference in A1 format. - * @return array - */ - function _cellToRowcol($cell) - { - preg_match('/(\$)?([A-I]?[A-Z])(\$)?(\d+)/',$cell,$match); - // return absolute column if there is a $ in the ref - $col_rel = empty($match[1]) ? 1 : 0; - $col_ref = $match[2]; - $row_rel = empty($match[3]) ? 1 : 0; - $row = $match[4]; - - // Convert base26 column string to a number. - $expn = strlen($col_ref) - 1; - $col = 0; - $col_ref_length = strlen($col_ref); - for ($i = 0; $i < $col_ref_length; ++$i) { - $col += (ord($col_ref{$i}) - 64) * pow(26, $expn); - --$expn; - } - - // Convert 1-index to zero-index - --$row; - --$col; - - return array($row, $col, $row_rel, $col_rel); - } - - /** - * Advance to the next valid token. - * - * @access private - */ - function _advance() - { - $i = $this->_current_char; - $formula_length = strlen($this->_formula); - // eat up white spaces - if ($i < $formula_length) { - while ($this->_formula{$i} == " ") { - ++$i; - } - - if ($i < ($formula_length - 1)) { - $this->_lookahead = $this->_formula{$i+1}; - } - $token = ''; - } - - while ($i < $formula_length) { - $token .= $this->_formula{$i}; - if ($i < ($formula_length - 1)) { - $this->_lookahead = $this->_formula{$i+1}; - } else { - $this->_lookahead = ''; - } - - if ($this->_match($token) != '') { - //if ($i < strlen($this->_formula) - 1) { - // $this->_lookahead = $this->_formula{$i+1}; - //} - $this->_current_char = $i + 1; - $this->_current_token = $token; - return 1; - } - - if ($i < ($formula_length - 2)) { - $this->_lookahead = $this->_formula{$i+2}; - } else { // if we run out of characters _lookahead becomes empty - $this->_lookahead = ''; - } - ++$i; - } - //die("Lexical error ".$this->_current_char); - } - - /** - * Checks if it's a valid token. - * - * @access private - * @param mixed $token The token to check. - * @return mixed The checked token or false on failure - */ - function _match($token) - { - switch($token) { - case "+": - case "-": - case "*": - case "/": - case "(": - case ")": - case ",": - case ";": - case ">=": - case "<=": - case "=": - case "<>": - case "^": - case "&": - case "%": - return $token; - break; - case ">": - if ($this->_lookahead == '=') { // it's a GE token - break; - } - return $token; - break; - case "<": - // it's a LE or a NE token - if (($this->_lookahead == '=') or ($this->_lookahead == '>')) { - break; - } - return $token; - break; - default: - // if it's a reference A1 or $A$1 or $A1 or A$1 - if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$token) and - !preg_match("/[0-9]/",$this->_lookahead) and - ($this->_lookahead != ':') and ($this->_lookahead != '.') and - ($this->_lookahead != '!')) - { - return $token; - } - // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) - elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u",$token) and - !preg_match("/[0-9]/",$this->_lookahead) and - ($this->_lookahead != ':') and ($this->_lookahead != '.')) - { - return $token; - } - // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) - elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u",$token) and - !preg_match("/[0-9]/",$this->_lookahead) and - ($this->_lookahead != ':') and ($this->_lookahead != '.')) - { - return $token; - } - // if it's a range A1:A2 or $A$1:$A$2 - elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/', $token) and - !preg_match("/[0-9]/",$this->_lookahead)) - { - return $token; - } - // If it's an external range like Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2 - elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u",$token) and - !preg_match("/[0-9]/",$this->_lookahead)) - { - return $token; - } - // If it's an external range like 'Sheet1'!A1:B2 or 'Sheet1:Sheet2'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1:Sheet2'!$A$1:$B$2 - elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u",$token) and - !preg_match("/[0-9]/",$this->_lookahead)) - { - return $token; - } - // If it's a number (check that it's not a sheet name or range) - elseif (is_numeric($token) and - (!is_numeric($token.$this->_lookahead) or ($this->_lookahead == '')) and - ($this->_lookahead != '!') and ($this->_lookahead != ':')) - { - return $token; - } - // If it's a string (of maximum 255 characters) - elseif (preg_match("/\"([^\"]|\"\"){0,255}\"/",$token) and $this->_lookahead != '"' and (substr_count($token, '"')%2 == 0)) - { - return $token; - } - // If it's an error code - elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') - { - return $token; - } - // if it's a function call - elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$token) and ($this->_lookahead == "(")) - { - return $token; - } - return ''; - } - } - - /** - * The parsing method. It parses a formula. - * - * @access public - * @param string $formula The formula to parse, without the initial equal - * sign (=). - * @return mixed true on success - */ - function parse($formula) - { - $this->_current_char = 0; - $this->_formula = $formula; - $this->_lookahead = isset($formula{1}) ? $formula{1} : ''; - $this->_advance(); - $this->_parse_tree = $this->_condition(); - return true; - } - - /** - * It parses a condition. It assumes the following rule: - * Cond -> Expr [(">" | "<") Expr] - * - * @access private - * @return mixed The parsed ptg'd tree on success - */ - function _condition() - { - $result = $this->_expression(); - if ($this->_current_token == "<") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgLT', $result, $result2); - } elseif ($this->_current_token == ">") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgGT', $result, $result2); - } elseif ($this->_current_token == "<=") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgLE', $result, $result2); - } elseif ($this->_current_token == ">=") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgGE', $result, $result2); - } elseif ($this->_current_token == "=") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgEQ', $result, $result2); - } elseif ($this->_current_token == "<>") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgNE', $result, $result2); - } elseif ($this->_current_token == "&") { - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgConcat', $result, $result2); - } - return $result; - } - - /** - * It parses a expression. It assumes the following rule: - * Expr -> Term [("+" | "-") Term] - * -> "string" - * -> "-" Term : Negative value - * -> "+" Term : Positive value - * -> Error code - * - * @access private - * @return mixed The parsed ptg'd tree on success - */ - function _expression() - { - // If it's a string return a string node - if (preg_match("/\"([^\"]|\"\"){0,255}\"/", $this->_current_token)) { - $tmp = str_replace('""', '"', $this->_current_token); - if (($tmp == '"') || ($tmp == '')) $tmp = '""'; // Trap for "" that has been used for an empty string - $result = $this->_createTree($tmp, '', ''); - $this->_advance(); - return $result; - // If it's an error code - } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $this->_current_token) or $this->_current_token == '#N/A'){ - $result = $this->_createTree($this->_current_token, 'ptgErr', ''); - $this->_advance(); - return $result; - // If it's a negative value - } elseif ($this->_current_token == "-") { - // catch "-" Term - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgUminus', $result2, ''); - return $result; - // If it's a positive value - } elseif ($this->_current_token == "+") { - // catch "+" Term - $this->_advance(); - $result2 = $this->_expression(); - $result = $this->_createTree('ptgUplus', $result2, ''); - return $result; - } - $result = $this->_term(); - while (($this->_current_token == "+") or - ($this->_current_token == "-") or - ($this->_current_token == "^")) { - /**/ - if ($this->_current_token == "+") { - $this->_advance(); - $result2 = $this->_term(); - $result = $this->_createTree('ptgAdd', $result, $result2); - } elseif ($this->_current_token == "-") { - $this->_advance(); - $result2 = $this->_term(); - $result = $this->_createTree('ptgSub', $result, $result2); - } else { - $this->_advance(); - $result2 = $this->_term(); - $result = $this->_createTree('ptgPower', $result, $result2); - } - } - return $result; - } - - /** - * This function just introduces a ptgParen element in the tree, so that Excel - * doesn't get confused when working with a parenthesized formula afterwards. - * - * @access private - * @see _fact() - * @return array The parsed ptg'd tree - */ - function _parenthesizedExpression() - { - $result = $this->_createTree('ptgParen', $this->_expression(), ''); - return $result; - } - - /** - * It parses a term. It assumes the following rule: - * Term -> Fact [("*" | "/") Fact] - * - * @access private - * @return mixed The parsed ptg'd tree on success - */ - function _term() - { - $result = $this->_fact(); - while (($this->_current_token == "*") or - ($this->_current_token == "/")) { - /**/ - if ($this->_current_token == "*") { - $this->_advance(); - $result2 = $this->_fact(); - $result = $this->_createTree('ptgMul', $result, $result2); - } else { - $this->_advance(); - $result2 = $this->_fact(); - $result = $this->_createTree('ptgDiv', $result, $result2); - } - } - return $result; - } - - /** - * It parses a factor. It assumes the following rule: - * Fact -> ( Expr ) - * | CellRef - * | CellRange - * | Number - * | Function - * - * @access private - * @return mixed The parsed ptg'd tree on success - */ - function _fact() - { - if ($this->_current_token == "(") { - $this->_advance(); // eat the "(" - $result = $this->_parenthesizedExpression(); - if ($this->_current_token != ")") { - throw new Exception("')' token expected."); - } - $this->_advance(); // eat the ")" - return $result; - } - // if it's a reference - if (preg_match('/^\$?[A-Ia-i]?[A-Za-z]\$?[0-9]+$/',$this->_current_token)) - { - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // If it's an external reference (Sheet1!A1 or Sheet1:Sheet2!A1 or Sheet1!$A$1 or Sheet1:Sheet2!$A$1) - elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u",$this->_current_token)) - { - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // If it's an external reference ('Sheet1'!A1 or 'Sheet1:Sheet2'!A1 or 'Sheet1'!$A$1 or 'Sheet1:Sheet2'!$A$1) - elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?[A-Ia-i]?[A-Za-z]\\$?[0-9]+$/u",$this->_current_token)) - { - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // if it's a range A1:B2 or $A$1:$B$2 - elseif (preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+:(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/',$this->_current_token) or - preg_match('/^(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+\.\.(\$)?[A-Ia-i]?[A-Za-z](\$)?[0-9]+$/',$this->_current_token)) - { - // must be an error? - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // If it's an external range (Sheet1!A1:B2 or Sheet1:Sheet2!A1:B2 or Sheet1!$A$1:$B$2 or Sheet1:Sheet2!$A$1:$B$2) - elseif (preg_match("/^" . self::REGEX_SHEET_TITLE_UNQUOTED . "(\:" . self::REGEX_SHEET_TITLE_UNQUOTED . ")?\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u",$this->_current_token)) - { - // must be an error? - //$result = $this->_current_token; - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // If it's an external range ('Sheet1'!A1:B2 or 'Sheet1'!A1:B2 or 'Sheet1'!$A$1:$B$2 or 'Sheet1'!$A$1:$B$2) - elseif (preg_match("/^'" . self::REGEX_SHEET_TITLE_QUOTED . "(\:" . self::REGEX_SHEET_TITLE_QUOTED . ")?'\!\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+:\\$?([A-Ia-i]?[A-Za-z])?\\$?[0-9]+$/u",$this->_current_token)) - { - // must be an error? - //$result = $this->_current_token; - $result = $this->_createTree($this->_current_token, '', ''); - $this->_advance(); - return $result; - } - // If it's a number or a percent - elseif (is_numeric($this->_current_token)) - { - if($this->_lookahead == '%'){ - $result = $this->_createTree('ptgPercent', $this->_current_token, ''); - } else { - $result = $this->_createTree($this->_current_token, '', ''); - } - $this->_advance(); - return $result; - } - // if it's a function call - elseif (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/i",$this->_current_token)) - { - $result = $this->_func(); - return $result; - } - throw new Exception("Syntax error: ".$this->_current_token. - ", lookahead: ".$this->_lookahead. - ", current char: ".$this->_current_char); - } - - /** - * It parses a function call. It assumes the following rule: - * Func -> ( Expr [,Expr]* ) - * - * @access private - * @return mixed The parsed ptg'd tree on success - */ - function _func() - { - $num_args = 0; // number of arguments received - $function = strtoupper($this->_current_token); - $result = ''; // initialize result - $this->_advance(); - $this->_advance(); // eat the "(" - while ($this->_current_token != ')') { - /**/ - if ($num_args > 0) { - if ($this->_current_token == "," or - $this->_current_token == ";") - { - $this->_advance(); // eat the "," or ";" - } else { - throw new Exception("Syntax error: comma expected in ". - "function $function, arg #{$num_args}"); - } - $result2 = $this->_condition(); - $result = $this->_createTree('arg', $result, $result2); - } else { // first argument - $result2 = $this->_condition(); - $result = $this->_createTree('arg', '', $result2); - } - ++$num_args; - } - if (!isset($this->_functions[$function])) { - throw new Exception("Function $function() doesn't exist"); - } - $args = $this->_functions[$function][1]; - // If fixed number of args eg. TIME($i,$j,$k). Check that the number of args is valid. - if (($args >= 0) and ($args != $num_args)) { - throw new Exception("Incorrect number of arguments in function $function() "); - } - - $result = $this->_createTree($function, $result, $num_args); - $this->_advance(); // eat the ")" - return $result; - } - - /** - * Creates a tree. In fact an array which may have one or two arrays (sub-trees) - * as elements. - * - * @access private - * @param mixed $value The value of this node. - * @param mixed $left The left array (sub-tree) or a final node. - * @param mixed $right The right array (sub-tree) or a final node. - * @return array A tree - */ - function _createTree($value, $left, $right) - { - return array('value' => $value, 'left' => $left, 'right' => $right); - } - - /** - * Builds a string containing the tree in reverse polish notation (What you - * would use in a HP calculator stack). - * The following tree: - * - * + - * / \ - * 2 3 - * - * produces: "23+" - * - * The following tree: - * - * + - * / \ - * 3 * - * / \ - * 6 A1 - * - * produces: "36A1*+" - * - * In fact all operands, functions, references, etc... are written as ptg's - * - * @access public - * @param array $tree The optional tree to convert. - * @return string The tree in reverse polish notation - */ - function toReversePolish($tree = array()) - { - $polish = ""; // the string we are going to return - if (empty($tree)) { // If it's the first call use _parse_tree - $tree = $this->_parse_tree; - } - - if (is_array($tree['left'])) { - $converted_tree = $this->toReversePolish($tree['left']); - $polish .= $converted_tree; - } elseif ($tree['left'] != '') { // It's a final node - $converted_tree = $this->_convert($tree['left']); - $polish .= $converted_tree; - } - if (is_array($tree['right'])) { - $converted_tree = $this->toReversePolish($tree['right']); - $polish .= $converted_tree; - } elseif ($tree['right'] != '') { // It's a final node - $converted_tree = $this->_convert($tree['right']); - $polish .= $converted_tree; - } - // if it's a function convert it here (so we can set it's arguments) - if (preg_match("/^[A-Z0-9\xc0-\xdc\.]+$/",$tree['value']) and - !preg_match('/^([A-Ia-i]?[A-Za-z])(\d+)$/',$tree['value']) and - !preg_match("/^[A-Ia-i]?[A-Za-z](\d+)\.\.[A-Ia-i]?[A-Za-z](\d+)$/",$tree['value']) and - !is_numeric($tree['value']) and - !isset($this->ptg[$tree['value']])) - { - // left subtree for a function is always an array. - if ($tree['left'] != '') { - $left_tree = $this->toReversePolish($tree['left']); - } else { - $left_tree = ''; - } - // add it's left subtree and return. - return $left_tree.$this->_convertFunction($tree['value'], $tree['right']); - } else { - $converted_tree = $this->_convert($tree['value']); - } - $polish .= $converted_tree; - return $polish; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Workbook.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Workbook.php deleted file mode 100644 index b0223f8ad5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Workbook.php +++ /dev/null @@ -1,1446 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -// Original file header of PEAR::Spreadsheet_Excel_Writer_Workbook (used as the base for this class): -// ----------------------------------------------------------------------------------------- -// /* -// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> -// * -// * The majority of this is _NOT_ my code. I simply ported it from the -// * PERL Spreadsheet::WriteExcel module. -// * -// * The author of the Spreadsheet::WriteExcel module is John McNamara -// * <jmcnamara@cpan.org> -// * -// * I _DO_ maintain this code, and John McNamara has nothing to do with the -// * porting of this code to PHP. Any questions directly related to this -// * class library should be directed to me. -// * -// * License Information: -// * -// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets -// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com -// * -// * This library is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 2.1 of the License, or (at your option) any later version. -// * -// * This library is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public -// * License along with this library; if not, write to the Free Software -// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// */ - - -/** - * PHPExcel_Writer_Excel5_Workbook - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter -{ - /** - * Formula parser - * - * @var PHPExcel_Writer_Excel5_Parser - */ - private $_parser; - - /** - * The BIFF file size for the workbook. - * @var integer - * @see _calcSheetOffsets() - */ - public $_biffsize; - - /** - * XF Writers - * @var PHPExcel_Writer_Excel5_Xf[] - */ - private $_xfWriters = array(); - - /** - * Array containing the colour palette - * @var array - */ - public $_palette; - - /** - * The codepage indicates the text encoding used for strings - * @var integer - */ - public $_codepage; - - /** - * The country code used for localization - * @var integer - */ - public $_country_code; - - /** - * Workbook - * @var PHPExcel - */ - private $_phpExcel; - - /** - * Fonts writers - * - * @var PHPExcel_Writer_Excel5_Font[] - */ - private $_fontWriters = array(); - - /** - * Added fonts. Maps from font's hash => index in workbook - * - * @var array - */ - private $_addedFonts = array(); - - /** - * Shared number formats - * - * @var array - */ - private $_numberFormats = array(); - - /** - * Added number formats. Maps from numberFormat's hash => index in workbook - * - * @var array - */ - private $_addedNumberFormats = array(); - - /** - * Sizes of the binary worksheet streams - * - * @var array - */ - private $_worksheetSizes = array(); - - /** - * Offsets of the binary worksheet streams relative to the start of the global workbook stream - * - * @var array - */ - private $_worksheetOffsets = array(); - - /** - * Total number of shared strings in workbook - * - * @var int - */ - private $_str_total; - - /** - * Number of unique shared strings in workbook - * - * @var int - */ - private $_str_unique; - - /** - * Array of unique shared strings in workbook - * - * @var array - */ - private $_str_table; - - /** - * Color cache - */ - private $_colors; - - /** - * Escher object corresponding to MSODRAWINGGROUP - * - * @var PHPExcel_Shared_Escher - */ - private $_escher; - - - /** - * Class constructor - * - * @param PHPExcel $phpExcel The Workbook - * @param int $BIFF_verions BIFF version - * @param int $str_total Total number of strings - * @param int $str_unique Total number of unique strings - * @param array $str_table - * @param mixed $parser The formula parser created for the Workbook - */ - public function __construct(PHPExcel $phpExcel = null, $BIFF_version = 0x0600, - &$str_total, - &$str_unique, &$str_table, &$colors, $parser - ) - { - // It needs to call its parent's constructor explicitly - parent::__construct(); - - $this->_parser = $parser; - $this->_biffsize = 0; - $this->_palette = array(); - $this->_codepage = 0x04E4; // FIXME: should change for BIFF8 - $this->_country_code = -1; - - $this->_str_total = &$str_total; - $this->_str_unique = &$str_unique; - $this->_str_table = &$str_table; - $this->_colors = &$colors; - $this->_setPaletteXl97(); - - $this->_phpExcel = $phpExcel; - - if ($BIFF_version == 0x0600) { - $this->_BIFF_version = 0x0600; - // change BIFFwriter limit for CONTINUE records - $this->_limit = 8224; - $this->_codepage = 0x04B0; - } - - // Add empty sheets and Build color cache - $countSheets = $phpExcel->getSheetCount(); - for ($i = 0; $i < $countSheets; ++$i) { - $phpSheet = $phpExcel->getSheet($i); - - $this->_parser->setExtSheet($phpSheet->getTitle(), $i); // Register worksheet name with parser - - // for BIFF8 - if ($this->_BIFF_version == 0x0600) { - $supbook_index = 0x00; - $ref = pack('vvv', $supbook_index, $i, $i); - $this->_parser->_references[] = $ref; // Register reference with parser - } - // Sheet tab colors? - if ($phpSheet->isTabColorSet()) { - $this->_addColor($phpSheet->getTabColor()->getRGB()); - } - } - - } - - /** - * Add a new XF writer - * - * @param PHPExcel_Style - * @param boolean Is it a style XF? - * @return int Index to XF record - */ - public function addXfWriter($style, $isStyleXf = false) - { - $xfWriter = new PHPExcel_Writer_Excel5_Xf($style); - $xfWriter->setBIFFVersion($this->_BIFF_version); - $xfWriter->setIsStyleXf($isStyleXf); - - // Add the font if not already added - $fontHashCode = $style->getFont()->getHashCode(); - - if (isset($this->_addedFonts[$fontHashCode])) { - $fontIndex = $this->_addedFonts[$fontHashCode]; - } else { - $countFonts = count($this->_fontWriters); - $fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1; - - $fontWriter = new PHPExcel_Writer_Excel5_Font($style->getFont()); - $fontWriter->setBIFFVersion($this->_BIFF_version); - $fontWriter->setColorIndex($this->_addColor($style->getFont()->getColor()->getRGB())); - $this->_fontWriters[] = $fontWriter; - - $this->_addedFonts[$fontHashCode] = $fontIndex; - } - - // Assign the font index to the xf record - $xfWriter->setFontIndex($fontIndex); - - // Background colors, best to treat these after the font so black will come after white in custom palette - $xfWriter->setFgColor($this->_addColor($style->getFill()->getStartColor()->getRGB())); - $xfWriter->setBgColor($this->_addColor($style->getFill()->getEndColor()->getRGB())); - $xfWriter->setBottomColor($this->_addColor($style->getBorders()->getBottom()->getColor()->getRGB())); - $xfWriter->setTopColor($this->_addColor($style->getBorders()->getTop()->getColor()->getRGB())); - $xfWriter->setRightColor($this->_addColor($style->getBorders()->getRight()->getColor()->getRGB())); - $xfWriter->setLeftColor($this->_addColor($style->getBorders()->getLeft()->getColor()->getRGB())); - $xfWriter->setDiagColor($this->_addColor($style->getBorders()->getDiagonal()->getColor()->getRGB())); - - // Add the number format if it is not a built-in one and not already added - if ($style->getNumberFormat()->getBuiltInFormatCode() === false) { - $numberFormatHashCode = $style->getNumberFormat()->getHashCode(); - - if (isset($this->_addedNumberFormats[$numberFormatHashCode])) { - $numberFormatIndex = $this->_addedNumberFormats[$numberFormatHashCode]; - } else { - $numberFormatIndex = 164 + count($this->_numberFormats); - $this->_numberFormats[$numberFormatIndex] = $style->getNumberFormat(); - $this->_addedNumberFormats[$numberFormatHashCode] = $numberFormatIndex; - } - } - else { - $numberFormatIndex = (int) $style->getNumberFormat()->getBuiltInFormatCode(); - } - - // Assign the number format index to xf record - $xfWriter->setNumberFormatIndex($numberFormatIndex); - - $this->_xfWriters[] = $xfWriter; - - $xfIndex = count($this->_xfWriters) - 1; - return $xfIndex; - } - - /** - * Alter color palette adding a custom color - * - * @param string $rgb E.g. 'FF00AA' - * @return int Color index - */ - private function _addColor($rgb) { - if (!isset($this->_colors[$rgb])) { - if (count($this->_colors) < 57) { - // then we add a custom color altering the palette - $colorIndex = 8 + count($this->_colors); - $this->_palette[$colorIndex] = - array( - hexdec(substr($rgb, 0, 2)), - hexdec(substr($rgb, 2, 2)), - hexdec(substr($rgb, 4)), - 0 - ); - $this->_colors[$rgb] = $colorIndex; - } else { - // no room for more custom colors, just map to black - $colorIndex = 0; - } - } else { - // fetch already added custom color - $colorIndex = $this->_colors[$rgb]; - } - - return $colorIndex; - } - - /** - * Sets the colour palette to the Excel 97+ default. - * - * @access private - */ - function _setPaletteXl97() - { - $this->_palette = array( - 0x08 => array(0x00, 0x00, 0x00, 0x00), - 0x09 => array(0xff, 0xff, 0xff, 0x00), - 0x0A => array(0xff, 0x00, 0x00, 0x00), - 0x0B => array(0x00, 0xff, 0x00, 0x00), - 0x0C => array(0x00, 0x00, 0xff, 0x00), - 0x0D => array(0xff, 0xff, 0x00, 0x00), - 0x0E => array(0xff, 0x00, 0xff, 0x00), - 0x0F => array(0x00, 0xff, 0xff, 0x00), - 0x10 => array(0x80, 0x00, 0x00, 0x00), - 0x11 => array(0x00, 0x80, 0x00, 0x00), - 0x12 => array(0x00, 0x00, 0x80, 0x00), - 0x13 => array(0x80, 0x80, 0x00, 0x00), - 0x14 => array(0x80, 0x00, 0x80, 0x00), - 0x15 => array(0x00, 0x80, 0x80, 0x00), - 0x16 => array(0xc0, 0xc0, 0xc0, 0x00), - 0x17 => array(0x80, 0x80, 0x80, 0x00), - 0x18 => array(0x99, 0x99, 0xff, 0x00), - 0x19 => array(0x99, 0x33, 0x66, 0x00), - 0x1A => array(0xff, 0xff, 0xcc, 0x00), - 0x1B => array(0xcc, 0xff, 0xff, 0x00), - 0x1C => array(0x66, 0x00, 0x66, 0x00), - 0x1D => array(0xff, 0x80, 0x80, 0x00), - 0x1E => array(0x00, 0x66, 0xcc, 0x00), - 0x1F => array(0xcc, 0xcc, 0xff, 0x00), - 0x20 => array(0x00, 0x00, 0x80, 0x00), - 0x21 => array(0xff, 0x00, 0xff, 0x00), - 0x22 => array(0xff, 0xff, 0x00, 0x00), - 0x23 => array(0x00, 0xff, 0xff, 0x00), - 0x24 => array(0x80, 0x00, 0x80, 0x00), - 0x25 => array(0x80, 0x00, 0x00, 0x00), - 0x26 => array(0x00, 0x80, 0x80, 0x00), - 0x27 => array(0x00, 0x00, 0xff, 0x00), - 0x28 => array(0x00, 0xcc, 0xff, 0x00), - 0x29 => array(0xcc, 0xff, 0xff, 0x00), - 0x2A => array(0xcc, 0xff, 0xcc, 0x00), - 0x2B => array(0xff, 0xff, 0x99, 0x00), - 0x2C => array(0x99, 0xcc, 0xff, 0x00), - 0x2D => array(0xff, 0x99, 0xcc, 0x00), - 0x2E => array(0xcc, 0x99, 0xff, 0x00), - 0x2F => array(0xff, 0xcc, 0x99, 0x00), - 0x30 => array(0x33, 0x66, 0xff, 0x00), - 0x31 => array(0x33, 0xcc, 0xcc, 0x00), - 0x32 => array(0x99, 0xcc, 0x00, 0x00), - 0x33 => array(0xff, 0xcc, 0x00, 0x00), - 0x34 => array(0xff, 0x99, 0x00, 0x00), - 0x35 => array(0xff, 0x66, 0x00, 0x00), - 0x36 => array(0x66, 0x66, 0x99, 0x00), - 0x37 => array(0x96, 0x96, 0x96, 0x00), - 0x38 => array(0x00, 0x33, 0x66, 0x00), - 0x39 => array(0x33, 0x99, 0x66, 0x00), - 0x3A => array(0x00, 0x33, 0x00, 0x00), - 0x3B => array(0x33, 0x33, 0x00, 0x00), - 0x3C => array(0x99, 0x33, 0x00, 0x00), - 0x3D => array(0x99, 0x33, 0x66, 0x00), - 0x3E => array(0x33, 0x33, 0x99, 0x00), - 0x3F => array(0x33, 0x33, 0x33, 0x00), - ); - } - - /** - * Assemble worksheets into a workbook and send the BIFF data to an OLE - * storage. - * - * @param array $worksheetSizes The sizes in bytes of the binary worksheet streams - * @return string Binary data for workbook stream - */ - public function writeWorkbook($pWorksheetSizes = null) - { - $this->_worksheetSizes = $pWorksheetSizes; - - // Calculate the number of selected worksheet tabs and call the finalization - // methods for each worksheet - $total_worksheets = $this->_phpExcel->getSheetCount(); - - // Add part 1 of the Workbook globals, what goes before the SHEET records - $this->_storeBof(0x0005); - $this->_writeCodepage(); - if ($this->_BIFF_version == 0x0600) { - $this->_writeWindow1(); - } - if ($this->_BIFF_version == 0x0500) { - $this->_writeExterns(); // For print area and repeat rows - $this->_writeNames(); // For print area and repeat rows - } - if ($this->_BIFF_version == 0x0500) { - $this->_writeWindow1(); - } - $this->_writeDatemode(); - $this->_writeAllFonts(); - $this->_writeAllNumFormats(); - $this->_writeAllXfs(); - $this->_writeAllStyles(); - $this->_writePalette(); - - // Prepare part 3 of the workbook global stream, what goes after the SHEET records - $part3 = ''; - if ($this->_country_code != -1) { - $part3 .= $this->_writeCountry(); - } - $part3 .= $this->_writeRecalcId(); - - if ($this->_BIFF_version == 0x0600) { - $part3 .= $this->_writeSupbookInternal(); - /* TODO: store external SUPBOOK records and XCT and CRN records - in case of external references for BIFF8 */ - $part3 .= $this->_writeExternsheetBiff8(); - $part3 .= $this->_writeAllDefinedNamesBiff8(); - $part3 .= $this->_writeMsoDrawingGroup(); - $part3 .= $this->_writeSharedStringsTable(); - } - - $part3 .= $this->writeEof(); - - // Add part 2 of the Workbook globals, the SHEET records - $this->_calcSheetOffsets(); - for ($i = 0; $i < $total_worksheets; ++$i) { - $this->_writeBoundsheet($this->_phpExcel->getSheet($i), $this->_worksheetOffsets[$i]); - } - - // Add part 3 of the Workbook globals - $this->_data .= $part3; - - return $this->_data; - } - - /** - * Calculate offsets for Worksheet BOF records. - * - * @access private - */ - function _calcSheetOffsets() - { - if ($this->_BIFF_version == 0x0600) { - $boundsheet_length = 10; // fixed length for a BOUNDSHEET record - } else { - $boundsheet_length = 11; - } - - // size of Workbook globals part 1 + 3 - $offset = $this->_datasize; - - // add size of Workbook globals part 2, the length of the SHEET records - $total_worksheets = count($this->_phpExcel->getAllSheets()); - foreach ($this->_phpExcel->getWorksheetIterator() as $sheet) { - if ($this->_BIFF_version == 0x0600) { - $offset += $boundsheet_length + strlen(PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($sheet->getTitle())); - } else { - $offset += $boundsheet_length + strlen($sheet->getTitle()); - } - } - - // add the sizes of each of the Sheet substreams, respectively - for ($i = 0; $i < $total_worksheets; ++$i) { - $this->_worksheetOffsets[$i] = $offset; - $offset += $this->_worksheetSizes[$i]; - } - $this->_biffsize = $offset; - } - - /** - * Store the Excel FONT records. - */ - private function _writeAllFonts() - { - foreach ($this->_fontWriters as $fontWriter) { - $this->_append($fontWriter->writeFont()); - } - } - - /** - * Store user defined numerical formats i.e. FORMAT records - */ - private function _writeAllNumFormats() - { - foreach ($this->_numberFormats as $numberFormatIndex => $numberFormat) { - $this->_writeNumFormat($numberFormat->getFormatCode(), $numberFormatIndex); - } - } - - /** - * Write all XF records. - */ - private function _writeAllXfs() - { - foreach ($this->_xfWriters as $xfWriter) { - $this->_append($xfWriter->writeXf()); - } - } - - /** - * Write all STYLE records. - */ - private function _writeAllStyles() - { - $this->_writeStyle(); - } - - /** - * Write the EXTERNCOUNT and EXTERNSHEET records. These are used as indexes for - * the NAME records. - */ - private function _writeExterns() - { - $countSheets = $this->_phpExcel->getSheetCount(); - // Create EXTERNCOUNT with number of worksheets - $this->_writeExterncount($countSheets); - - // Create EXTERNSHEET for each worksheet - for ($i = 0; $i < $countSheets; ++$i) { - $this->_writeExternsheet($phpExcel->getSheet($i)->getTitle()); - } - } - - /** - * Write the NAME record to define the print area and the repeat rows and cols. - */ - private function _writeNames() - { - // total number of sheets - $total_worksheets = $this->_phpExcel->getSheetCount(); - - // Create the print area NAME records - for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->_phpExcel->getSheet($i)->getPageSetup(); - // Write a Name record if the print area has been defined - if ($sheetSetup->isPrintAreaSet()) { - // Print area - $printArea = PHPExcel_Cell::splitRange($sheetSetup->getPrintArea()); - $printArea = $printArea[0]; - $printArea[0] = PHPExcel_Cell::coordinateFromString($printArea[0]); - $printArea[1] = PHPExcel_Cell::coordinateFromString($printArea[1]); - - $print_rowmin = $printArea[0][1] - 1; - $print_rowmax = $printArea[1][1] - 1; - $print_colmin = PHPExcel_Cell::columnIndexFromString($printArea[0][0]) - 1; - $print_colmax = PHPExcel_Cell::columnIndexFromString($printArea[1][0]) - 1; - - $this->_writeNameShort( - $i, // sheet index - 0x06, // NAME type - $print_rowmin, - $print_rowmax, - $print_colmin, - $print_colmax - ); - } - } - - // Create the print title NAME records - for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->_phpExcel->getSheet($i)->getPageSetup(); - - // simultaneous repeatColumns repeatRows - if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { - $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; - - $repeat = $sheetSetup->getRowsToRepeatAtTop(); - $rowmin = $repeat[0] - 1; - $rowmax = $repeat[1] - 1; - - $this->_writeNameLong( - $i, // sheet index - 0x07, // NAME type - $rowmin, - $rowmax, - $colmin, - $colmax - ); - - // (exclusive) either repeatColumns or repeatRows - } else if ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { - - // Columns to repeat - if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { - $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; - } else { - $colmin = 0; - $colmax = 255; - } - - // Rows to repeat - if ($sheetSetup->isRowsToRepeatAtTopSet()) { - $repeat = $sheetSetup->getRowsToRepeatAtTop(); - $rowmin = $repeat[0] - 1; - $rowmax = $repeat[1] - 1; - } else { - $rowmin = 0; - $rowmax = 16383; - } - - $this->_writeNameShort( - $i, // sheet index - 0x07, // NAME type - $rowmin, - $rowmax, - $colmin, - $colmax - ); - } - } - } - - - /** - * Writes all the DEFINEDNAME records (BIFF8). - * So far this is only used for repeating rows/columns (print titles) and print areas - */ - private function _writeAllDefinedNamesBiff8() - { - $chunk = ''; - - // Named ranges - if (count($this->_phpExcel->getNamedRanges()) > 0) { - // Loop named ranges - $namedRanges = $this->_phpExcel->getNamedRanges(); - foreach ($namedRanges as $namedRange) { - - // Create absolute coordinate - $range = PHPExcel_Cell::splitRange($namedRange->getRange()); - for ($i = 0; $i < count($range); $i++) { - $range[$i][0] = '\'' . str_replace("'", "''", $namedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteCoordinate($range[$i][0]); - if (isset($range[$i][1])) { - $range[$i][1] = PHPExcel_Cell::absoluteCoordinate($range[$i][1]); - } - } - $range = PHPExcel_Cell::buildRange($range); // e.g. Sheet1!$A$1:$B$2 - - // parse formula - try { - $error = $this->_parser->parse($range); - $formulaData = $this->_parser->toReversePolish(); - - // make sure tRef3d is of type tRef3dR (0x3A) - if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { - $formulaData = "\x3A" . substr($formulaData, 1); - } - - if ($namedRange->getLocalOnly()) { - // local scope - $scope = $this->_phpExcel->getIndex($namedRange->getScope()) + 1; - } else { - // global scope - $scope = 0; - } - $chunk .= $this->writeData($this->_writeDefinedNameBiff8($namedRange->getName(), $formulaData, $scope, false)); - - } catch(Exception $e) { - // do nothing - } - } - } - - // total number of sheets - $total_worksheets = $this->_phpExcel->getSheetCount(); - - // write the print titles (repeating rows, columns), if any - for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->_phpExcel->getSheet($i)->getPageSetup(); - // simultaneous repeatColumns repeatRows - if ($sheetSetup->isColumnsToRepeatAtLeftSet() && $sheetSetup->isRowsToRepeatAtTopSet()) { - $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; - - $repeat = $sheetSetup->getRowsToRepeatAtTop(); - $rowmin = $repeat[0] - 1; - $rowmax = $repeat[1] - 1; - - // construct formula data manually - $formulaData = pack('Cv', 0x29, 0x17); // tMemFunc - $formulaData .= pack('Cvvvvv', 0x3B, $i, 0, 65535, $colmin, $colmax); // tArea3d - $formulaData .= pack('Cvvvvv', 0x3B, $i, $rowmin, $rowmax, 0, 255); // tArea3d - $formulaData .= pack('C', 0x10); // tList - - // store the DEFINEDNAME record - $chunk .= $this->writeData($this->_writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true)); - - // (exclusive) either repeatColumns or repeatRows - } else if ($sheetSetup->isColumnsToRepeatAtLeftSet() || $sheetSetup->isRowsToRepeatAtTopSet()) { - - // Columns to repeat - if ($sheetSetup->isColumnsToRepeatAtLeftSet()) { - $repeat = $sheetSetup->getColumnsToRepeatAtLeft(); - $colmin = PHPExcel_Cell::columnIndexFromString($repeat[0]) - 1; - $colmax = PHPExcel_Cell::columnIndexFromString($repeat[1]) - 1; - } else { - $colmin = 0; - $colmax = 255; - } - // Rows to repeat - if ($sheetSetup->isRowsToRepeatAtTopSet()) { - $repeat = $sheetSetup->getRowsToRepeatAtTop(); - $rowmin = $repeat[0] - 1; - $rowmax = $repeat[1] - 1; - } else { - $rowmin = 0; - $rowmax = 65535; - } - - // construct formula data manually because parser does not recognize absolute 3d cell references - $formulaData = pack('Cvvvvv', 0x3B, $i, $rowmin, $rowmax, $colmin, $colmax); - - // store the DEFINEDNAME record - $chunk .= $this->writeData($this->_writeDefinedNameBiff8(pack('C', 0x07), $formulaData, $i + 1, true)); - } - } - - // write the print areas, if any - for ($i = 0; $i < $total_worksheets; ++$i) { - $sheetSetup = $this->_phpExcel->getSheet($i)->getPageSetup(); - if ($sheetSetup->isPrintAreaSet()) { - // Print area, e.g. A3:J6,H1:X20 - $printArea = PHPExcel_Cell::splitRange($sheetSetup->getPrintArea()); - $countPrintArea = count($printArea); - - $formulaData = ''; - for ($j = 0; $j < $countPrintArea; ++$j) { - $printAreaRect = $printArea[$j]; // e.g. A3:J6 - $printAreaRect[0] = PHPExcel_Cell::coordinateFromString($printAreaRect[0]); - $printAreaRect[1] = PHPExcel_Cell::coordinateFromString($printAreaRect[1]); - - $print_rowmin = $printAreaRect[0][1] - 1; - $print_rowmax = $printAreaRect[1][1] - 1; - $print_colmin = PHPExcel_Cell::columnIndexFromString($printAreaRect[0][0]) - 1; - $print_colmax = PHPExcel_Cell::columnIndexFromString($printAreaRect[1][0]) - 1; - - // construct formula data manually because parser does not recognize absolute 3d cell references - $formulaData .= pack('Cvvvvv', 0x3B, $i, $print_rowmin, $print_rowmax, $print_colmin, $print_colmax); - - if ($j > 0) { - $formulaData .= pack('C', 0x10); // list operator token ',' - } - } - - // store the DEFINEDNAME record - $chunk .= $this->writeData($this->_writeDefinedNameBiff8(pack('C', 0x06), $formulaData, $i + 1, true)); - } - } - - return $chunk; - } - - /** - * Write a DEFINEDNAME record for BIFF8 using explicit binary formula data - * - * @param string $name The name in UTF-8 - * @param string $formulaData The binary formula data - * @param string $sheetIndex 1-based sheet index the defined name applies to. 0 = global - * @param boolean $isBuiltIn Built-in name? - * @return string Complete binary record data - */ - private function _writeDefinedNameBiff8($name, $formulaData, $sheetIndex = 0, $isBuiltIn = false) - { - $record = 0x0018; - - // option flags - $options = $isBuiltIn ? 0x20 : 0x00; - - // length of the name, character count - $nlen = PHPExcel_Shared_String::CountCharacters($name); - - // name with stripped length field - $name = substr(PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($name), 2); - - // size of the formula (in bytes) - $sz = strlen($formulaData); - - // combine the parts - $data = pack('vCCvvvCCCC', $options, 0, $nlen, $sz, 0, $sheetIndex, 0, 0, 0, 0) - . $name . $formulaData; - $length = strlen($data); - - $header = pack('vv', $record, $length); - - return $header . $data; - } - - /** - * Stores the CODEPAGE biff record. - */ - private function _writeCodepage() - { - $record = 0x0042; // Record identifier - $length = 0x0002; // Number of bytes to follow - $cv = $this->_codepage; // The code page - - $header = pack('vv', $record, $length); - $data = pack('v', $cv); - - $this->_append($header . $data); - } - - /** - * Write Excel BIFF WINDOW1 record. - */ - private function _writeWindow1() - { - $record = 0x003D; // Record identifier - $length = 0x0012; // Number of bytes to follow - - $xWn = 0x0000; // Horizontal position of window - $yWn = 0x0000; // Vertical position of window - $dxWn = 0x25BC; // Width of window - $dyWn = 0x1572; // Height of window - - $grbit = 0x0038; // Option flags - - // not supported by PHPExcel, so there is only one selected sheet, the active - $ctabsel = 1; // Number of workbook tabs selected - - $wTabRatio = 0x0258; // Tab to scrollbar ratio - - // not supported by PHPExcel, set to 0 - $itabFirst = 0; // 1st displayed worksheet - $itabCur = $this->_phpExcel->getActiveSheetIndex(); // Active worksheet - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvvv", $xWn, $yWn, $dxWn, $dyWn, - $grbit, - $itabCur, $itabFirst, - $ctabsel, $wTabRatio); - $this->_append($header . $data); - } - - /** - * Writes Excel BIFF BOUNDSHEET record. - * - * @param PHPExcel_Worksheet $sheet Worksheet name - * @param integer $offset Location of worksheet BOF - */ - private function _writeBoundsheet($sheet, $offset) - { - $sheetname = $sheet->getTitle(); - $record = 0x0085; // Record identifier - - // sheet state - switch ($sheet->getSheetState()) { - case PHPExcel_Worksheet::SHEETSTATE_VISIBLE: $ss = 0x00; break; - case PHPExcel_Worksheet::SHEETSTATE_HIDDEN: $ss = 0x01; break; - case PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN: $ss = 0x02; break; - default: $ss = 0x00; break; - } - - // sheet type - $st = 0x00; - - $grbit = 0x0000; // Visibility and sheet type - - if ($this->_BIFF_version == 0x0600) { - $data = pack("VCC", $offset, $ss, $st); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($sheetname); - } else { - $cch = strlen($sheetname); // Length of sheet name - $data = pack("VCCC", $offset, $ss, $st, $cch); - $data .= $sheetname; - } - - $length = strlen($data); - $header = pack("vv", $record, $length); - $this->_append($header . $data); - } - - /** - * Write Internal SUPBOOK record - */ - private function _writeSupbookInternal() - { - $record = 0x01AE; // Record identifier - $length = 0x0004; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vv", $this->_phpExcel->getSheetCount(), 0x0401); - return $this->writeData($header . $data); - } - - /** - * Writes the Excel BIFF EXTERNSHEET record. These references are used by - * formulas. - * - */ - private function _writeExternsheetBiff8() - { - $total_references = count($this->_parser->_references); - $record = 0x0017; // Record identifier - $length = 2 + 6 * $total_references; // Number of bytes to follow - - $supbook_index = 0; // FIXME: only using internal SUPBOOK record - $header = pack("vv", $record, $length); - $data = pack('v', $total_references); - for ($i = 0; $i < $total_references; ++$i) { - $data .= $this->_parser->_references[$i]; - } - return $this->writeData($header . $data); - } - - /** - * Write Excel BIFF STYLE records. - */ - private function _writeStyle() - { - $record = 0x0293; // Record identifier - $length = 0x0004; // Bytes to follow - - $ixfe = 0x8000; // Index to cell style XF - $BuiltIn = 0x00; // Built-in style - $iLevel = 0xff; // Outline style level - - $header = pack("vv", $record, $length); - $data = pack("vCC", $ixfe, $BuiltIn, $iLevel); - $this->_append($header . $data); - } - - - /** - * Writes Excel FORMAT record for non "built-in" numerical formats. - * - * @param string $format Custom format string - * @param integer $ifmt Format index code - */ - private function _writeNumFormat($format, $ifmt) - { - $record = 0x041E; // Record identifier - - if ($this->_BIFF_version == 0x0600) { - $numberFormatString = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($format); - $length = 2 + strlen($numberFormatString); // Number of bytes to follow - } elseif ($this->_BIFF_version == 0x0500) { - $length = 3 + strlen($format); // Number of bytes to follow - } - - - $header = pack("vv", $record, $length); - if ($this->_BIFF_version == 0x0600) { - $data = pack("v", $ifmt) . $numberFormatString; - $this->_append($header . $data); - } elseif ($this->_BIFF_version == 0x0500) { - $cch = strlen($format); // Length of format string - $data = pack("vC", $ifmt, $cch); - $this->_append($header . $data . $format); - } - } - - /** - * Write DATEMODE record to indicate the date system in use (1904 or 1900). - */ - private function _writeDatemode() - { - $record = 0x0022; // Record identifier - $length = 0x0002; // Bytes to follow - - $f1904 = (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) ? - 1 : 0; // Flag for 1904 date system - - $header = pack("vv", $record, $length); - $data = pack("v", $f1904); - $this->_append($header . $data); - } - - - /** - * Write BIFF record EXTERNCOUNT to indicate the number of external sheet - * references in the workbook. - * - * Excel only stores references to external sheets that are used in NAME. - * The workbook NAME record is required to define the print area and the repeat - * rows and columns. - * - * A similar method is used in Worksheet.php for a slightly different purpose. - * - * @param integer $cxals Number of external references - */ - private function _writeExterncount($cxals) - { - $record = 0x0016; // Record identifier - $length = 0x0002; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $cxals); - $this->_append($header . $data); - } - - - /** - * Writes the Excel BIFF EXTERNSHEET record. These references are used by - * formulas. NAME record is required to define the print area and the repeat - * rows and columns. - * - * A similar method is used in Worksheet.php for a slightly different purpose. - * - * @param string $sheetname Worksheet name - */ - private function _writeExternsheet($sheetname) - { - $record = 0x0017; // Record identifier - $length = 0x02 + strlen($sheetname); // Number of bytes to follow - - $cch = strlen($sheetname); // Length of sheet name - $rgch = 0x03; // Filename encoding - - $header = pack("vv", $record, $length); - $data = pack("CC", $cch, $rgch); - $this->_append($header . $data . $sheetname); - } - - - /** - * Store the NAME record in the short format that is used for storing the print - * area, repeat rows only and repeat columns only. - * - * @param integer $index Sheet index - * @param integer $type Built-in name type - * @param integer $rowmin Start row - * @param integer $rowmax End row - * @param integer $colmin Start colum - * @param integer $colmax End column - */ - private function _writeNameShort($index, $type, $rowmin, $rowmax, $colmin, $colmax) - { - $record = 0x0018; // Record identifier - $length = 0x0024; // Number of bytes to follow - - $grbit = 0x0020; // Option flags - $chKey = 0x00; // Keyboard shortcut - $cch = 0x01; // Length of text name - $cce = 0x0015; // Length of text definition - $ixals = $index + 1; // Sheet index - $itab = $ixals; // Equal to ixals - $cchCustMenu = 0x00; // Length of cust menu text - $cchDescription = 0x00; // Length of description text - $cchHelptopic = 0x00; // Length of help topic text - $cchStatustext = 0x00; // Length of status bar text - $rgch = $type; // Built-in name type - - $unknown03 = 0x3b; - $unknown04 = 0xffff-$index; - $unknown05 = 0x0000; - $unknown06 = 0x0000; - $unknown07 = 0x1087; - $unknown08 = 0x8005; - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $data .= pack("C", $chKey); - $data .= pack("C", $cch); - $data .= pack("v", $cce); - $data .= pack("v", $ixals); - $data .= pack("v", $itab); - $data .= pack("C", $cchCustMenu); - $data .= pack("C", $cchDescription); - $data .= pack("C", $cchHelptopic); - $data .= pack("C", $cchStatustext); - $data .= pack("C", $rgch); - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", $rowmin); - $data .= pack("v", $rowmax); - $data .= pack("C", $colmin); - $data .= pack("C", $colmax); - $this->_append($header . $data); - } - - - /** - * Store the NAME record in the long format that is used for storing the repeat - * rows and columns when both are specified. This shares a lot of code with - * _writeNameShort() but we use a separate method to keep the code clean. - * Code abstraction for reuse can be carried too far, and I should know. ;-) - * - * @param integer $index Sheet index - * @param integer $type Built-in name type - * @param integer $rowmin Start row - * @param integer $rowmax End row - * @param integer $colmin Start colum - * @param integer $colmax End column - */ - private function _writeNameLong($index, $type, $rowmin, $rowmax, $colmin, $colmax) - { - $record = 0x0018; // Record identifier - $length = 0x003d; // Number of bytes to follow - $grbit = 0x0020; // Option flags - $chKey = 0x00; // Keyboard shortcut - $cch = 0x01; // Length of text name - $cce = 0x002e; // Length of text definition - $ixals = $index + 1; // Sheet index - $itab = $ixals; // Equal to ixals - $cchCustMenu = 0x00; // Length of cust menu text - $cchDescription = 0x00; // Length of description text - $cchHelptopic = 0x00; // Length of help topic text - $cchStatustext = 0x00; // Length of status bar text - $rgch = $type; // Built-in name type - - $unknown01 = 0x29; - $unknown02 = 0x002b; - $unknown03 = 0x3b; - $unknown04 = 0xffff-$index; - $unknown05 = 0x0000; - $unknown06 = 0x0000; - $unknown07 = 0x1087; - $unknown08 = 0x8008; - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $data .= pack("C", $chKey); - $data .= pack("C", $cch); - $data .= pack("v", $cce); - $data .= pack("v", $ixals); - $data .= pack("v", $itab); - $data .= pack("C", $cchCustMenu); - $data .= pack("C", $cchDescription); - $data .= pack("C", $cchHelptopic); - $data .= pack("C", $cchStatustext); - $data .= pack("C", $rgch); - $data .= pack("C", $unknown01); - $data .= pack("v", $unknown02); - // Column definition - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", 0x0000); - $data .= pack("v", 0x3fff); - $data .= pack("C", $colmin); - $data .= pack("C", $colmax); - // Row definition - $data .= pack("C", $unknown03); - $data .= pack("v", $unknown04); - $data .= pack("v", $unknown05); - $data .= pack("v", $unknown06); - $data .= pack("v", $unknown07); - $data .= pack("v", $unknown08); - $data .= pack("v", $index); - $data .= pack("v", $index); - $data .= pack("v", $rowmin); - $data .= pack("v", $rowmax); - $data .= pack("C", 0x00); - $data .= pack("C", 0xff); - // End of data - $data .= pack("C", 0x10); - $this->_append($header . $data); - } - - /** - * Stores the COUNTRY record for localization - * - * @return string - */ - private function _writeCountry() - { - $record = 0x008C; // Record identifier - $length = 4; // Number of bytes to follow - - $header = pack('vv', $record, $length); - /* using the same country code always for simplicity */ - $data = pack('vv', $this->_country_code, $this->_country_code); - //$this->_append($header . $data); - return $this->writeData($header . $data); - } - - /** - * Write the RECALCID record - * - * @return string - */ - private function _writeRecalcId() - { - $record = 0x01C1; // Record identifier - $length = 8; // Number of bytes to follow - - $header = pack('vv', $record, $length); - - // by inspection of real Excel files, MS Office Excel 2007 writes this - $data = pack('VV', 0x000001C1, 0x00001E667); - - return $this->writeData($header . $data); - } - - /** - * Stores the PALETTE biff record. - */ - private function _writePalette() - { - $aref = $this->_palette; - - $record = 0x0092; // Record identifier - $length = 2 + 4 * count($aref); // Number of bytes to follow - $ccv = count($aref); // Number of RGB values to follow - $data = ''; // The RGB data - - // Pack the RGB data - foreach ($aref as $color) { - foreach ($color as $byte) { - $data .= pack("C",$byte); - } - } - - $header = pack("vvv", $record, $length, $ccv); - $this->_append($header . $data); - } - - /** - * Handling of the SST continue blocks is complicated by the need to include an - * additional continuation byte depending on whether the string is split between - * blocks or whether it starts at the beginning of the block. (There are also - * additional complications that will arise later when/if Rich Strings are - * supported). - * - * The Excel documentation says that the SST record should be followed by an - * EXTSST record. The EXTSST record is a hash table that is used to optimise - * access to SST. However, despite the documentation it doesn't seem to be - * required so we will ignore it. - * - * @return string Binary data - */ - private function _writeSharedStringsTable() - { - // maximum size of record data (excluding record header) - $continue_limit = 8224; - - // initialize array of record data blocks - $recordDatas = array(); - - // start SST record data block with total number of strings, total number of unique strings - $recordData = pack("VV", $this->_str_total, $this->_str_unique); - - // loop through all (unique) strings in shared strings table - foreach (array_keys($this->_str_table) as $string) { - - // here $string is a BIFF8 encoded string - - // length = character count - $headerinfo = unpack("vlength/Cencoding", $string); - - // currently, this is always 1 = uncompressed - $encoding = $headerinfo["encoding"]; - - // initialize finished writing current $string - $finished = false; - - while ($finished === false) { - - // normally, there will be only one cycle, but if string cannot immediately be written as is - // there will be need for more than one cylcle, if string longer than one record data block, there - // may be need for even more cycles - - if (strlen($recordData) + strlen($string) < $continue_limit) { - // then we can write the string (or remainder of string) without any problems - $recordData .= $string; - - // we are finished writing this string - $finished = true; - - } else if (strlen($recordData) + strlen($string) == $continue_limit) { - // then we can also write the string (or remainder of string) - $recordData .= $string; - - // but we close the record data block, and initialize a new one - $recordDatas[] = $recordData; - $recordData = ''; - - // we are finished writing this string - $finished = true; - - } else { - // special treatment writing the string (or remainder of the string) - // If the string is very long it may need to be written in more than one CONTINUE record. - - // check how many bytes more there is room for in the current record - $space_remaining = $continue_limit - strlen($recordData); - - // minimum space needed - // uncompressed: 2 byte string length length field + 1 byte option flags + 2 byte character - // compressed: 2 byte string length length field + 1 byte option flags + 1 byte character - $min_space_needed = ($encoding == 1) ? 5 : 4; - - // We have two cases - // 1. space remaining is less than minimum space needed - // here we must waste the space remaining and move to next record data block - // 2. space remaining is greater than or equal to minimum space needed - // here we write as much as we can in the current block, then move to next record data block - - // 1. space remaining is less than minimum space needed - if ($space_remaining < $min_space_needed) { - // we close the block, store the block data - $recordDatas[] = $recordData; - - // and start new record data block where we start writing the string - $recordData = ''; - - // 2. space remaining is greater than or equal to minimum space needed - } else { - // initialize effective remaining space, for Unicode strings this may need to be reduced by 1, see below - $effective_space_remaining = $space_remaining; - - // for uncompressed strings, sometimes effective space remaining is reduced by 1 - if ( $encoding == 1 && (strlen($string) - $space_remaining) % 2 == 1 ) { - --$effective_space_remaining; - } - - // one block fininshed, store the block data - $recordData .= substr($string, 0, $effective_space_remaining); - - $string = substr($string, $effective_space_remaining); // for next cycle in while loop - $recordDatas[] = $recordData; - - // start new record data block with the repeated option flags - $recordData = pack('C', $encoding); - } - } - } - } - - // Store the last record data block unless it is empty - // if there was no need for any continue records, this will be the for SST record data block itself - if (strlen($recordData) > 0) { - $recordDatas[] = $recordData; - } - - // combine into one chunk with all the blocks SST, CONTINUE,... - $chunk = ''; - foreach ($recordDatas as $i => $recordData) { - // first block should have the SST record header, remaing should have CONTINUE header - $record = ($i == 0) ? 0x00FC : 0x003C; - - $header = pack("vv", $record, strlen($recordData)); - $data = $header . $recordData; - - $chunk .= $this->writeData($data); - } - - return $chunk; - } - - /** - * Writes the MSODRAWINGGROUP record if needed. Possibly split using CONTINUE records. - */ - private function _writeMsoDrawingGroup() - { - // write the Escher stream if necessary - if (isset($this->_escher)) { - $writer = new PHPExcel_Writer_Excel5_Escher($this->_escher); - $data = $writer->close(); - - $record = 0x00EB; - $length = strlen($data); - $header = pack("vv", $record, $length); - - return $this->writeData($header . $data); - - } else { - return ''; - } - } - - /** - * Get Escher object - * - * @return PHPExcel_Shared_Escher - */ - public function getEscher() - { - return $this->_escher; - } - - /** - * Set Escher object - * - * @param PHPExcel_Shared_Escher $pValue - */ - public function setEscher(PHPExcel_Shared_Escher $pValue = null) - { - $this->_escher = $pValue; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Worksheet.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Worksheet.php deleted file mode 100644 index 3fd9628e07..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Worksheet.php +++ /dev/null @@ -1,2952 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -// Original file header of PEAR::Spreadsheet_Excel_Writer_Worksheet (used as the base for this class): -// ----------------------------------------------------------------------------------------- -// /* -// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> -// * -// * The majority of this is _NOT_ my code. I simply ported it from the -// * PERL Spreadsheet::WriteExcel module. -// * -// * The author of the Spreadsheet::WriteExcel module is John McNamara -// * <jmcnamara@cpan.org> -// * -// * I _DO_ maintain this code, and John McNamara has nothing to do with the -// * porting of this code to PHP. Any questions directly related to this -// * class library should be directed to me. -// * -// * License Information: -// * -// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets -// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com -// * -// * This library is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 2.1 of the License, or (at your option) any later version. -// * -// * This library is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public -// * License along with this library; if not, write to the Free Software -// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// */ - - -/** - * PHPExcel_Writer_Excel5_Worksheet - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter -{ - /** - * Formula parser - * - * @var PHPExcel_Writer_Excel5_Parser - */ - private $_parser; - - /** - * Maximum number of characters for a string (LABEL record in BIFF5) - * @var integer - */ - public $_xls_strmax; - - /** - * Array containing format information for columns - * @var array - */ - public $_colinfo; - - /** - * Array containing the selected area for the worksheet - * @var array - */ - public $_selection; - - /** - * The active pane for the worksheet - * @var integer - */ - public $_active_pane; - - /** - * Whether to use outline. - * @var integer - */ - public $_outline_on; - - /** - * Auto outline styles. - * @var bool - */ - public $_outline_style; - - /** - * Whether to have outline summary below. - * @var bool - */ - public $_outline_below; - - /** - * Whether to have outline summary at the right. - * @var bool - */ - public $_outline_right; - - /** - * Reference to the total number of strings in the workbook - * @var integer - */ - public $_str_total; - - /** - * Reference to the number of unique strings in the workbook - * @var integer - */ - public $_str_unique; - - /** - * Reference to the array containing all the unique strings in the workbook - * @var array - */ - public $_str_table; - - /** - * Color cache - */ - private $_colors; - - /** - * Index of first used row (at least 0) - * @var int - */ - private $_firstRowIndex; - - /** - * Index of last used row. (no used rows means -1) - * @var int - */ - private $_lastRowIndex; - - /** - * Index of first used column (at least 0) - * @var int - */ - private $_firstColumnIndex; - - /** - * Index of last used column (no used columns means -1) - * @var int - */ - private $_lastColumnIndex; - - /** - * Sheet object - * @var PHPExcel_Worksheet - */ - private $_phpSheet; - - /** - * Count cell style Xfs - * - * @var int - */ - private $_countCellStyleXfs; - - /** - * Escher object corresponding to MSODRAWING - * - * @var PHPExcel_Shared_Escher - */ - private $_escher; - - /** - * Constructor - * - * @param int $BIFF_version BIFF version - * @param int $str_total Total number of strings - * @param int $str_unique Total number of unique strings - * @param array $str_table - * @param mixed $parser The formula parser created for the Workbook - * @param string $tempDir The temporary directory to be used - * @param PHPExcel_Worksheet $phpSheet - */ - public function __construct($BIFF_version, - &$str_total, - &$str_unique, &$str_table, &$colors, - $parser, $preCalculateFormulas, $phpSheet) - { - // It needs to call its parent's constructor explicitly - parent::__construct(); - - $this->_BIFF_version = $BIFF_version; - if ($BIFF_version == 0x0600) { - // change BIFFwriter limit for CONTINUE records - $this->_limit = 8224; - } - - - $this->_preCalculateFormulas = $preCalculateFormulas; - $this->_str_total = &$str_total; - $this->_str_unique = &$str_unique; - $this->_str_table = &$str_table; - $this->_colors = &$colors; - $this->_parser = $parser; - - $this->_phpSheet = $phpSheet; - - //$this->ext_sheets = array(); - //$this->offset = 0; - $this->_xls_strmax = 255; - $this->_colinfo = array(); - $this->_selection = array(0,0,0,0); - $this->_active_pane = 3; - - $this->_print_headers = 0; - - $this->_outline_style = 0; - $this->_outline_below = 1; - $this->_outline_right = 1; - $this->_outline_on = 1; - - // calculate values for DIMENSIONS record - $col = $row = array(); - foreach ($this->_phpSheet->getCellCollection(false) as $cellID) { - list($c,$r) = sscanf($cellID,'%[A-Z]%d'); - $row[$r] = $r; - $col[$c] = strlen($c).$c; - } - // Determine lowest and highest column and row - $this->_firstRowIndex = (count($row) > 0) ? min($row) : 1; - $this->_lastRowIndex = (count($row) > 0) ? max($row) : 1; - if ($this->_firstRowIndex > 65535) $this->_firstRowIndex = 65535; - if ($this->_lastRowIndex > 65535) $this->_lastRowIndex = 65535; - - $this->_firstColumnIndex = (count($col) > 0) ? PHPExcel_Cell::columnIndexFromString(substr(min($col),1)) : 1; - $this->_lastColumnIndex = (count($col) > 0) ? PHPExcel_Cell::columnIndexFromString(substr(max($col),1)) : 1; - - if ($this->_firstColumnIndex > 255) $this->_firstColumnIndex = 255; - if ($this->_lastColumnIndex > 255) $this->_lastColumnIndex = 255; - - $this->_countCellStyleXfs = count($phpSheet->getParent()->getCellStyleXfCollection()); - } - - /** - * Add data to the beginning of the workbook (note the reverse order) - * and to the end of the workbook. - * - * @access public - * @see PHPExcel_Writer_Excel5_Workbook::storeWorkbook() - */ - function close() - { - $num_sheets = $this->_phpSheet->getParent()->getSheetCount(); - - // Write BOF record - $this->_storeBof(0x0010); - - // Write PRINTHEADERS - $this->_writePrintHeaders(); - - // Write PRINTGRIDLINES - $this->_writePrintGridlines(); - - // Write GRIDSET - $this->_writeGridset(); - - // Calculate column widths - $this->_phpSheet->calculateColumnWidths(); - - // Column dimensions - $maxCol = PHPExcel_Cell::columnIndexFromString($this->_phpSheet->getHighestColumn()) -1; - $columnDimensions = $this->_phpSheet->getColumnDimensions(); - for ($i = 0; $i <= $maxCol; ++$i) { - $hidden = 0; - $level = 0; - $xfIndex = 15; // there are 15 cell style Xfs - - if ($this->_phpSheet->getDefaultColumnDimension()->getWidth() >= 0) { - $width = $this->_phpSheet->getDefaultColumnDimension()->getWidth(); - } else { - $width = PHPExcel_Shared_Font::getDefaultColumnWidthByFont($this->_phpSheet->getParent()->getDefaultStyle()->getFont()); - } - - $columnLetter = PHPExcel_Cell::stringFromColumnIndex($i); - if (isset($columnDimensions[$columnLetter])) { - $columnDimension = $columnDimensions[$columnLetter]; - if ($columnDimension->getWidth() >= 0) { - $width = $columnDimension->getWidth(); - } - $hidden = $columnDimension->getVisible() ? 0 : 1; - $level = $columnDimension->getOutlineLevel(); - $xfIndex = $columnDimension->getXfIndex() + 15; // there are 15 cell style Xfs - } - - // Components of _colinfo: - // $firstcol first column on the range - // $lastcol last column on the range - // $width width to set - // $xfIndex The optional cell style Xf index to apply to the columns - // $hidden The optional hidden atribute - // $level The optional outline level - $this->_colinfo[] = array($i, $i, $width, $xfIndex, $hidden, $level); - } - - // Write GUTS - $this->_writeGuts(); - - // Write DEFAULTROWHEIGHT - if ($this->_BIFF_version == 0x0600) { - $this->_writeDefaultRowHeight(); - } - - // Write WSBOOL - $this->_writeWsbool(); - - // Write horizontal and vertical page breaks - $this->_writeBreaks(); - - // Write page header - $this->_writeHeader(); - - // Write page footer - $this->_writeFooter(); - - // Write page horizontal centering - $this->_writeHcenter(); - - // Write page vertical centering - $this->_writeVcenter(); - - // Write left margin - $this->_writeMarginLeft(); - - // Write right margin - $this->_writeMarginRight(); - - // Write top margin - $this->_writeMarginTop(); - - // Write bottom margin - $this->_writeMarginBottom(); - - // Write page setup - $this->_writeSetup(); - - // Write sheet protection - $this->_writeProtect(); - - // Write SCENPROTECT - $this->_writeScenProtect(); - - // Write OBJECTPROTECT - $this->_writeObjectProtect(); - - // Write sheet password - $this->_writePassword(); - - // Write DEFCOLWIDTH record - $this->_writeDefcol(); - - // Write the COLINFO records if they exist - if (!empty($this->_colinfo)) { - $colcount = count($this->_colinfo); - for ($i = 0; $i < $colcount; ++$i) { - $this->_writeColinfo($this->_colinfo[$i]); - } - } - - // Write EXTERNCOUNT of external references - if ($this->_BIFF_version == 0x0500) { - $this->_writeExterncount($num_sheets); - } - - // Write EXTERNSHEET references - if ($this->_BIFF_version == 0x0500) { - for ($i = 0; $i < $num_sheets; ++$i) { - $this->_writeExternsheet($this->_phpSheet->getParent()->getSheet($i)->getTitle()); - } - } - - // Write sheet dimensions - $this->_writeDimensions(); - - // Row dimensions - foreach ($this->_phpSheet->getRowDimensions() as $rowDimension) { - $xfIndex = $rowDimension->getXfIndex() + 15; // there are 15 cellXfs - $this->_writeRow( $rowDimension->getRowIndex() - 1, $rowDimension->getRowHeight(), $xfIndex, ($rowDimension->getVisible() ? '0' : '1'), $rowDimension->getOutlineLevel() ); - } - - // Write Cells - foreach ($this->_phpSheet->getCellCollection() as $cellID) { - $cell = $this->_phpSheet->getCell($cellID); - $row = $cell->getRow() - 1; - $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1; - - // Don't break Excel! - if ($row + 1 > 65536 or $column + 1 > 256) { - break; - } - - // Write cell value - $xfIndex = $cell->getXfIndex() + 15; // there are 15 cell style Xfs - - if ($cell->getValue() instanceof PHPExcel_RichText) { - $this->_writeString($row, $column, $cell->getValue()->getPlainText(), $xfIndex); - } else { - switch ($cell->getDatatype()) { - - case PHPExcel_Cell_DataType::TYPE_STRING: - if ($cell->getValue() === '' or $cell->getValue() === null) { - $this->_writeBlank($row, $column, $xfIndex); - } else { - $this->_writeString($row, $column, $cell->getValue(), $xfIndex); - } - break; - - case PHPExcel_Cell_DataType::TYPE_FORMULA: - $calculatedValue = $this->_preCalculateFormulas ? - $cell->getCalculatedValue() : null; - $this->_writeFormula($row, $column, $cell->getValue(), $xfIndex, $calculatedValue); - break; - - case PHPExcel_Cell_DataType::TYPE_BOOL: - $this->_writeBoolErr($row, $column, $cell->getValue(), 0, $xfIndex); - break; - - case PHPExcel_Cell_DataType::TYPE_ERROR: - $this->_writeBoolErr($row, $column, $this->_mapErrorCode($cell->getValue()), 1, $xfIndex); - break; - - case PHPExcel_Cell_DataType::TYPE_NUMERIC: - $this->_writeNumber($row, $column, $cell->getValue(), $xfIndex); - break; - } - } - } - - // Append - if ($this->_BIFF_version == 0x0600) { - $this->_writeMsoDrawing(); - } - $this->_writeWindow2(); - $this->_writeZoom(); - if ($this->_phpSheet->getFreezePane()) { - $this->_writePanes(); - } - $this->_writeSelection(); - $this->_writeMergedCells(); - - // Hyperlinks - if ($this->_BIFF_version == 0x0600) { - foreach ($this->_phpSheet->getHyperLinkCollection() as $coordinate => $hyperlink) { - list($column, $row) = PHPExcel_Cell::coordinateFromString($coordinate); - - $url = $hyperlink->getUrl(); - - if ( strpos($url, 'sheet://') !== false ) { - // internal to current workbook - $url = str_replace('sheet://', 'internal:', $url); - - } else if ( preg_match('/^(http:|https:|ftp:|mailto:)/', $url) ) { - // URL - // $url = $url; - - } else { - // external (local file) - $url = 'external:' . $url; - } - - $this->_writeUrl($row - 1, PHPExcel_Cell::columnIndexFromString($column) - 1, $url); - } - } - - if ($this->_BIFF_version == 0x0600) { - $this->_writeDataValidity(); - $this->_writeSheetLayout(); - $this->_writeSheetProtection(); - $this->_writeRangeProtection(); - } - - $this->_storeEof(); - } - - /** - * Write a cell range address in BIFF8 - * always fixed range - * See section 2.5.14 in OpenOffice.org's Documentation of the Microsoft Excel File Format - * - * @param string $range E.g. 'A1' or 'A1:B6' - * @return string Binary data - */ - private function _writeBIFF8CellRangeAddressFixed($range = 'A1') - { - $explodes = explode(':', $range); - - // extract first cell, e.g. 'A1' - $firstCell = $explodes[0]; - - // extract last cell, e.g. 'B6' - if (count($explodes) == 1) { - $lastCell = $firstCell; - } else { - $lastCell = $explodes[1]; - } - - $firstCellCoordinates = PHPExcel_Cell::coordinateFromString($firstCell); // e.g. array(0, 1) - $lastCellCoordinates = PHPExcel_Cell::coordinateFromString($lastCell); // e.g. array(1, 6) - - return(pack('vvvv', - $firstCellCoordinates[1] - 1, - $lastCellCoordinates[1] - 1, - PHPExcel_Cell::columnIndexFromString($firstCellCoordinates[0]) - 1, - PHPExcel_Cell::columnIndexFromString($lastCellCoordinates[0]) - 1 - )); - } - - /** - * Retrieves data from memory in one chunk, or from disk in $buffer - * sized chunks. - * - * @return string The data - */ - function getData() - { - $buffer = 4096; - - // Return data stored in memory - if (isset($this->_data)) { - $tmp = $this->_data; - unset($this->_data); - return $tmp; - } - // No data to return - return false; - } - - /** - * Set the option to print the row and column headers on the printed page. - * - * @access public - * @param integer $print Whether to print the headers or not. Defaults to 1 (print). - */ - function printRowColHeaders($print = 1) - { - $this->_print_headers = $print; - } - - /** - * This method sets the properties for outlining and grouping. The defaults - * correspond to Excel's defaults. - * - * @param bool $visible - * @param bool $symbols_below - * @param bool $symbols_right - * @param bool $auto_style - */ - function setOutline($visible = true, $symbols_below = true, $symbols_right = true, $auto_style = false) - { - $this->_outline_on = $visible; - $this->_outline_below = $symbols_below; - $this->_outline_right = $symbols_right; - $this->_outline_style = $auto_style; - - // Ensure this is a boolean vale for Window2 - if ($this->_outline_on) { - $this->_outline_on = 1; - } - } - - /** - * Write a double to the specified row and column (zero indexed). - * An integer can be written as a double. Excel will display an - * integer. $format is optional. - * - * Returns 0 : normal termination - * -2 : row or column out of range - * - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param float $num The number to write - * @param mixed $format The optional XF format - * @return integer - */ - private function _writeNumber($row, $col, $num, $xfIndex) - { - $record = 0x0203; // Record identifier - $length = 0x000E; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $xfIndex); - $xl_double = pack("d", $num); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $xl_double = strrev($xl_double); - } - - $this->_append($header.$data.$xl_double); - return(0); - } - - /** - * Write a LABELSST record or a LABEL record. Which one depends on BIFF version - * - * @param int $row Row index (0-based) - * @param int $col Column index (0-based) - * @param string $str The string - * @param int $xfIndex Index to XF record - */ - private function _writeString($row, $col, $str, $xfIndex) - { - if ($this->_BIFF_version == 0x0600) { - $this->_writeLabelSst($row, $col, $str, $xfIndex); - } else { - $this->_writeLabel($row, $col, $str, $xfIndex); - } - } - /** - * Write a string to the specified row and column (zero indexed). - * NOTE: there is an Excel 5 defined limit of 255 characters. - * $format is optional. - * Returns 0 : normal termination - * -2 : row or column out of range - * -3 : long string truncated to 255 chars - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $str The string to write - * @param mixed $format The XF format for the cell - * @return integer - */ - private function _writeLabel($row, $col, $str, $xfIndex) - { - $strlen = strlen($str); - $record = 0x0204; // Record identifier - $length = 0x0008 + $strlen; // Bytes to follow - - $str_error = 0; - - if ($strlen > $this->_xls_strmax) { // LABEL must be < 255 chars - $str = substr($str, 0, $this->_xls_strmax); - $length = 0x0008 + $this->_xls_strmax; - $strlen = $this->_xls_strmax; - $str_error = -3; - } - - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row, $col, $xfIndex, $strlen); - $this->_append($header . $data . $str); - return($str_error); - } - - /** - * Write a string to the specified row and column (zero indexed). - * This is the BIFF8 version (no 255 chars limit). - * $format is optional. - * Returns 0 : normal termination - * -2 : row or column out of range - * -3 : long string truncated to 255 chars - * - * @access public - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $str The string to write - * @param mixed $format The XF format for the cell - * @return integer - */ - private function _writeLabelSst($row, $col, $str, $xfIndex) - { - $record = 0x00FD; // Record identifier - $length = 0x000A; // Bytes to follow - - $str = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($str); - - /* check if string is already present */ - if (!isset($this->_str_table[$str])) { - $this->_str_table[$str] = $this->_str_unique++; - } - $this->_str_total++; - - $header = pack('vv', $record, $length); - $data = pack('vvvV', $row, $col, $xfIndex, $this->_str_table[$str]); - $this->_append($header.$data); - } - - /** - * Writes a note associated with the cell given by the row and column. - * NOTE records don't have a length limit. - * - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $note The note to write - */ - private function _writeNote($row, $col, $note) - { - $note_length = strlen($note); - $record = 0x001C; // Record identifier - $max_length = 2048; // Maximun length for a NOTE record - //$length = 0x0006 + $note_length; // Bytes to follow - - // Length for this record is no more than 2048 + 6 - $length = 0x0006 + min($note_length, 2048); - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $note_length); - $this->_append($header . $data . substr($note, 0, 2048)); - - for ($i = $max_length; $i < $note_length; $i += $max_length) { - $chunk = substr($note, $i, $max_length); - $length = 0x0006 + strlen($chunk); - $header = pack("vv", $record, $length); - $data = pack("vvv", -1, 0, strlen($chunk)); - $this->_append($header.$data.$chunk); - } - return(0); - } - - /** - * Write a blank cell to the specified row and column (zero indexed). - * A blank cell is used to specify formatting without adding a string - * or a number. - * - * A blank cell without a format serves no purpose. Therefore, we don't write - * a BLANK record unless a format is specified. - * - * Returns 0 : normal termination (including no format) - * -1 : insufficient number of arguments - * -2 : row or column out of range - * - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param mixed $format The XF format - */ - function _writeBlank($row, $col, $xfIndex) - { - $record = 0x0201; // Record identifier - $length = 0x0006; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vvv", $row, $col, $xfIndex); - $this->_append($header . $data); - return 0; - } - - /** - * Write a boolean or an error type to the specified row and column (zero indexed) - * - * @param int $row Row index (0-based) - * @param int $col Column index (0-based) - * @param int $value - * @param boolean $isError Error or Boolean? - * @param int $xfIndex - */ - private function _writeBoolErr($row, $col, $value, $isError, $xfIndex) - { - $record = 0x0205; - $length = 8; - - $header = pack("vv", $record, $length); - $data = pack("vvvCC", $row, $col, $xfIndex, $value, $isError); - $this->_append($header . $data); - return 0; - } - - /** - * Write a formula to the specified row and column (zero indexed). - * The textual representation of the formula is passed to the parser in - * Parser.php which returns a packed binary string. - * - * Returns 0 : normal termination - * -1 : formula errors (bad formula) - * -2 : row or column out of range - * - * @param integer $row Zero indexed row - * @param integer $col Zero indexed column - * @param string $formula The formula text string - * @param mixed $format The optional XF format - * @param mixed $calculatedValue Calculated value - * @return integer - */ - private function _writeFormula($row, $col, $formula, $xfIndex, $calculatedValue) - { - $record = 0x0006; // Record identifier - - // Initialize possible additional value for STRING record that should be written after the FORMULA record? - $stringValue = null; - - // calculated value - if (isset($calculatedValue)) { - - // Since we can't yet get the data type of the calculated value, - // we use best effort to determine data type - - if (is_bool($calculatedValue)) { - // Boolean value - $num = pack('CCCvCv', 0x01, 0x00, (int)$calculatedValue, 0x00, 0x00, 0xFFFF); - - } elseif (is_int($calculatedValue) || is_float($calculatedValue)) { - // Numeric value - $num = pack('d', $calculatedValue); - - } elseif (is_string($calculatedValue)) { - if (array_key_exists($calculatedValue, PHPExcel_Cell_DataType::getErrorCodes())) { - // Error value - $num = pack('CCCvCv', 0x02, 0x00, $this->_mapErrorCode($calculatedValue), 0x00, 0x00, 0xFFFF); - - } elseif ($calculatedValue === '' && $this->_BIFF_version == 0x0600) { - // Empty string (and BIFF8) - $num = pack('CCCvCv', 0x03, 0x00, 0x00, 0x00, 0x00, 0xFFFF); - - } else { - // Non-empty string value (or empty string BIFF5) - $stringValue = $calculatedValue; - $num = pack('CCCvCv', 0x00, 0x00, 0x00, 0x00, 0x00, 0xFFFF); - - } - - } else { - // We are really not supposed to reach here - $num = pack('d', 0x00); - - } - - } else { - $num = pack('d', 0x00); - } - - $grbit = 0x03; // Option flags - $unknown = 0x0000; // Must be zero - - // Strip the '=' or '@' sign at the beginning of the formula string - if ($formula{0} == '=') { - $formula = substr($formula,1); - } else { - // Error handling - $this->_writeString($row, $col, 'Unrecognised character for formula'); - return -1; - } - - // Parse the formula using the parser in Parser.php - try { - $error = $this->_parser->parse($formula); - $formula = $this->_parser->toReversePolish(); - - $formlen = strlen($formula); // Length of the binary string - $length = 0x16 + $formlen; // Length of the record data - - $header = pack("vv", $record, $length); - - $data = pack("vvv", $row, $col, $xfIndex) - . $num - . pack("vVv", $grbit, $unknown, $formlen); - $this->_append($header . $data . $formula); - - // Append also a STRING record if necessary - if ($stringValue !== null) { - $this->_writeStringRecord($stringValue); - } - - return 0; - - } catch (Exception $e) { - // do nothing - } - - } - - /** - * Write a STRING record. This - * - * @param string $stringValue - */ - private function _writeStringRecord($stringValue) - { - $record = 0x0207; // Record identifier - $data = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($stringValue); - - $length = strlen($data); - $header = pack('vv', $record, $length); - - $this->_append($header . $data); - } - - /** - * Write a hyperlink. - * This is comprised of two elements: the visible label and - * the invisible link. The visible label is the same as the link unless an - * alternative string is specified. The label is written using the - * _writeString() method. Therefore the 255 characters string limit applies. - * $string and $format are optional. - * - * The hyperlink can be to a http, ftp, mail, internal sheet (not yet), or external - * directory url. - * - * Returns 0 : normal termination - * -2 : row or column out of range - * -3 : long string truncated to 255 chars - * - * @param integer $row Row - * @param integer $col Column - * @param string $url URL string - * @return integer - */ - private function _writeUrl($row, $col, $url) - { - // Add start row and col to arg list - return($this->_writeUrlRange($row, $col, $row, $col, $url)); - } - - /** - * This is the more general form of _writeUrl(). It allows a hyperlink to be - * written to a range of cells. This function also decides the type of hyperlink - * to be written. These are either, Web (http, ftp, mailto), Internal - * (Sheet1!A1) or external ('c:\temp\foo.xls#Sheet1!A1'). - * - * @access private - * @see _writeUrl() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @return integer - */ - - function _writeUrlRange($row1, $col1, $row2, $col2, $url) - { - - // Check for internal/external sheet links or default to web link - if (preg_match('[^internal:]', $url)) { - return($this->_writeUrlInternal($row1, $col1, $row2, $col2, $url)); - } - if (preg_match('[^external:]', $url)) { - return($this->_writeUrlExternal($row1, $col1, $row2, $col2, $url)); - } - return($this->_writeUrlWeb($row1, $col1, $row2, $col2, $url)); - } - - - /** - * Used to write http, ftp and mailto hyperlinks. - * The link type ($options) is 0x03 is the same as absolute dir ref without - * sheet. However it is differentiated by the $unknown2 data stream. - * - * @access private - * @see _writeUrl() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @return integer - */ - function _writeUrlWeb($row1, $col1, $row2, $col2, $url) - { - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); - $unknown2 = pack("H*", "E0C9EA79F9BACE118C8200AA004BA90B"); - - // Pack the option flags - $options = pack("V", 0x03); - - // Convert URL to a null terminated wchar string - $url = join("\0", preg_split("''", $url, -1, PREG_SPLIT_NO_EMPTY)); - $url = $url . "\0\0\0"; - - // Pack the length of the URL - $url_len = pack("V", strlen($url)); - - // Calculate the data length - $length = 0x34 + strlen($url); - - // Pack the header data - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row1, $row2, $col1, $col2); - - // Write the packed data - $this->_append($header . $data . - $unknown1 . $options . - $unknown2 . $url_len . $url); - return 0; - } - - /** - * Used to write internal reference hyperlinks such as "Sheet1!A1". - * - * @access private - * @see _writeUrl() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @return integer - */ - function _writeUrlInternal($row1, $col1, $row2, $col2, $url) - { - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - // Strip URL type - $url = preg_replace('/^internal:/', '', $url); - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*", "D0C9EA79F9BACE118C8200AA004BA90B02000000"); - - // Pack the option flags - $options = pack("V", 0x08); - - // Convert the URL type and to a null terminated wchar string - $url .= "\0"; - - // character count - $url_len = PHPExcel_Shared_String::CountCharacters($url); - $url_len = pack('V', $url_len); - - $url = PHPExcel_Shared_String::ConvertEncoding($url, 'UTF-16LE', 'UTF-8'); - - // Calculate the data length - $length = 0x24 + strlen($url); - - // Pack the header data - $header = pack("vv", $record, $length); - $data = pack("vvvv", $row1, $row2, $col1, $col2); - - // Write the packed data - $this->_append($header . $data . - $unknown1 . $options . - $url_len . $url); - return 0; - } - - /** - * Write links to external directory names such as 'c:\foo.xls', - * c:\foo.xls#Sheet1!A1', '../../foo.xls'. and '../../foo.xls#Sheet1!A1'. - * - * Note: Excel writes some relative links with the $dir_long string. We ignore - * these cases for the sake of simpler code. - * - * @access private - * @see _writeUrl() - * @param integer $row1 Start row - * @param integer $col1 Start column - * @param integer $row2 End row - * @param integer $col2 End column - * @param string $url URL string - * @return integer - */ - function _writeUrlExternal($row1, $col1, $row2, $col2, $url) - { - // Network drives are different. We will handle them separately - // MS/Novell network drives and shares start with \\ - if (preg_match('[^external:\\\\]', $url)) { - return; //($this->_writeUrlExternal_net($row1, $col1, $row2, $col2, $url, $str, $format)); - } - - $record = 0x01B8; // Record identifier - $length = 0x00000; // Bytes to follow - - // Strip URL type and change Unix dir separator to Dos style (if needed) - // - $url = preg_replace('/^external:/', '', $url); - $url = preg_replace('/\//', "\\", $url); - - // Determine if the link is relative or absolute: - // relative if link contains no dir separator, "somefile.xls" - // relative if link starts with up-dir, "..\..\somefile.xls" - // otherwise, absolute - - $absolute = 0x00; // relative path - if ( preg_match('/^[A-Z]:/', $url) ) { - $absolute = 0x02; // absolute path on Windows, e.g. C:\... - } - $link_type = 0x01 | $absolute; - - // Determine if the link contains a sheet reference and change some of the - // parameters accordingly. - // Split the dir name and sheet name (if it exists) - $dir_long = $url; - if (preg_match("/\#/", $url)) { - $link_type |= 0x08; - } - - - // Pack the link type - $link_type = pack("V", $link_type); - - // Calculate the up-level dir count e.g.. (..\..\..\ == 3) - $up_count = preg_match_all("/\.\.\\\/", $dir_long, $useless); - $up_count = pack("v", $up_count); - - // Store the short dos dir name (null terminated) - $dir_short = preg_replace("/\.\.\\\/", '', $dir_long) . "\0"; - - // Store the long dir name as a wchar string (non-null terminated) - $dir_long = $dir_long . "\0"; - - // Pack the lengths of the dir strings - $dir_short_len = pack("V", strlen($dir_short) ); - $dir_long_len = pack("V", strlen($dir_long) ); - $stream_len = pack("V", 0);//strlen($dir_long) + 0x06); - - // Pack the undocumented parts of the hyperlink stream - $unknown1 = pack("H*",'D0C9EA79F9BACE118C8200AA004BA90B02000000' ); - $unknown2 = pack("H*",'0303000000000000C000000000000046' ); - $unknown3 = pack("H*",'FFFFADDE000000000000000000000000000000000000000'); - $unknown4 = pack("v", 0x03 ); - - // Pack the main data stream - $data = pack("vvvv", $row1, $row2, $col1, $col2) . - $unknown1 . - $link_type . - $unknown2 . - $up_count . - $dir_short_len. - $dir_short . - $unknown3 . - $stream_len ;/*. - $dir_long_len . - $unknown4 . - $dir_long . - $sheet_len . - $sheet ;*/ - - // Pack the header data - $length = strlen($data); - $header = pack("vv", $record, $length); - - // Write the packed data - $this->_append($header. $data); - return 0; - } - - /** - * This method is used to set the height and format for a row. - * - * @param integer $row The row to set - * @param integer $height Height we are giving to the row. - * Use null to set XF without setting height - * @param integer $xfIndex The optional cell style Xf index to apply to the columns - * @param bool $hidden The optional hidden attribute - * @param integer $level The optional outline level for row, in range [0,7] - */ - private function _writeRow($row, $height, $xfIndex, $hidden = false, $level = 0) - { - $record = 0x0208; // Record identifier - $length = 0x0010; // Number of bytes to follow - - $colMic = 0x0000; // First defined column - $colMac = 0x0000; // Last defined column - $irwMac = 0x0000; // Used by Excel to optimise loading - $reserved = 0x0000; // Reserved - $grbit = 0x0000; // Option flags - $ixfe = $xfIndex; - - if ( $height < 0 ){ - $height = null; - } - - // Use _writeRow($row, null, $XF) to set XF format without setting height - if ($height != null) { - $miyRw = $height * 20; // row height - } else { - $miyRw = 0xff; // default row height is 256 - } - - // Set the options flags. fUnsynced is used to show that the font and row - // heights are not compatible. This is usually the case for WriteExcel. - // The collapsed flag 0x10 doesn't seem to be used to indicate that a row - // is collapsed. Instead it is used to indicate that the previous row is - // collapsed. The zero height flag, 0x20, is used to collapse a row. - - $grbit |= $level; - if ($hidden) { - $grbit |= 0x0020; - } - if ($height !== null) { - $grbit |= 0x0040; // fUnsynced - } - if ($xfIndex !== 0xF) { - $grbit |= 0x0080; - } - $grbit |= 0x0100; - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvv", $row, $colMic, $colMac, $miyRw, - $irwMac,$reserved, $grbit, $ixfe); - $this->_append($header.$data); - } - - /** - * Writes Excel DIMENSIONS to define the area in which there is data. - */ - private function _writeDimensions() - { - $record = 0x0200; // Record identifier - - if ($this->_BIFF_version == 0x0500) { - $length = 0x000A; // Number of bytes to follow - $data = pack("vvvvv" - , $this->_firstRowIndex - , $this->_lastRowIndex + 1 - , $this->_firstColumnIndex - , $this->_lastColumnIndex + 1 - , 0x0000 // reserved - ); - - } elseif ($this->_BIFF_version == 0x0600) { - $length = 0x000E; - $data = pack('VVvvv' - , $this->_firstRowIndex - , $this->_lastRowIndex + 1 - , $this->_firstColumnIndex - , $this->_lastColumnIndex + 1 - , 0x0000 // reserved - ); - } - - $header = pack("vv", $record, $length); - $this->_append($header.$data); - } - - /** - * Write BIFF record Window2. - */ - private function _writeWindow2() - { - $record = 0x023E; // Record identifier - if ($this->_BIFF_version == 0x0500) { - $length = 0x000A; // Number of bytes to follow - } elseif ($this->_BIFF_version == 0x0600) { - $length = 0x0012; - } - - $grbit = 0x00B6; // Option flags - $rwTop = 0x0000; // Top row visible in window - $colLeft = 0x0000; // Leftmost column visible in window - - - // The options flags that comprise $grbit - $fDspFmla = 0; // 0 - bit - $fDspGrid = $this->_phpSheet->getShowGridlines() ? 1 : 0; // 1 - $fDspRwCol = $this->_phpSheet->getShowRowColHeaders() ? 1 : 0; // 2 - $fFrozen = $this->_phpSheet->getFreezePane() ? 1 : 0; // 3 - $fDspZeros = 1; // 4 - $fDefaultHdr = 1; // 5 - $fArabic = $this->_phpSheet->getRightToLeft() ? 1 : 0; // 6 - $fDspGuts = $this->_outline_on; // 7 - $fFrozenNoSplit = 0; // 0 - bit - // no support in PHPExcel for selected sheet, therefore sheet is only selected if it is the active sheet - $fSelected = ($this->_phpSheet === $this->_phpSheet->getParent()->getActiveSheet()) ? 1 : 0; - $fPaged = 1; // 2 - - $grbit = $fDspFmla; - $grbit |= $fDspGrid << 1; - $grbit |= $fDspRwCol << 2; - $grbit |= $fFrozen << 3; - $grbit |= $fDspZeros << 4; - $grbit |= $fDefaultHdr << 5; - $grbit |= $fArabic << 6; - $grbit |= $fDspGuts << 7; - $grbit |= $fFrozenNoSplit << 8; - $grbit |= $fSelected << 9; - $grbit |= $fPaged << 10; - - $header = pack("vv", $record, $length); - $data = pack("vvv", $grbit, $rwTop, $colLeft); - // FIXME !!! - if ($this->_BIFF_version == 0x0500) { - $rgbHdr = 0x00000000; // Row/column heading and gridline color - $data .= pack("V", $rgbHdr); - } elseif ($this->_BIFF_version == 0x0600) { - $rgbHdr = 0x0040; // Row/column heading and gridline color index - $zoom_factor_page_break = 0x0000; - $zoom_factor_normal = 0x0000; - $data .= pack("vvvvV", $rgbHdr, 0x0000, $zoom_factor_page_break, $zoom_factor_normal, 0x00000000); - } - $this->_append($header.$data); - } - - /** - * Write BIFF record DEFAULTROWHEIGHT. - */ - private function _writeDefaultRowHeight() - { - $defaultRowHeight = $this->_phpSheet->getDefaultRowDimension()->getRowHeight(); - - if ($defaultRowHeight < 0) { - return; - } - - // convert to twips - $defaultRowHeight = (int) 20 * $defaultRowHeight; - - $record = 0x0225; // Record identifier - $length = 0x0004; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vv", 1, $defaultRowHeight); - $this->_append($header . $data); - } - - /** - * Write BIFF record DEFCOLWIDTH if COLINFO records are in use. - */ - private function _writeDefcol() - { - $defaultColWidth = 8; - - $record = 0x0055; // Record identifier - $length = 0x0002; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $defaultColWidth); - $this->_append($header . $data); - } - - /** - * Write BIFF record COLINFO to define column widths - * - * Note: The SDK says the record length is 0x0B but Excel writes a 0x0C - * length record. - * - * @param array $col_array This is the only parameter received and is composed of the following: - * 0 => First formatted column, - * 1 => Last formatted column, - * 2 => Col width (8.43 is Excel default), - * 3 => The optional XF format of the column, - * 4 => Option flags. - * 5 => Optional outline level - */ - private function _writeColinfo($col_array) - { - if (isset($col_array[0])) { - $colFirst = $col_array[0]; - } - if (isset($col_array[1])) { - $colLast = $col_array[1]; - } - if (isset($col_array[2])) { - $coldx = $col_array[2]; - } else { - $coldx = 8.43; - } - if (isset($col_array[3])) { - $xfIndex = $col_array[3]; - } else { - $xfIndex = 15; - } - if (isset($col_array[4])) { - $grbit = $col_array[4]; - } else { - $grbit = 0; - } - if (isset($col_array[5])) { - $level = $col_array[5]; - } else { - $level = 0; - } - $record = 0x007D; // Record identifier - $length = 0x000C; // Number of bytes to follow - - $coldx *= 256; // Convert to units of 1/256 of a char - - $ixfe = $xfIndex; - $reserved = 0x0000; // Reserved - - $level = max(0, min($level, 7)); - $grbit |= $level << 8; - - $header = pack("vv", $record, $length); - $data = pack("vvvvvv", $colFirst, $colLast, $coldx, - $ixfe, $grbit, $reserved); - $this->_append($header.$data); - } - - /** - * Write BIFF record SELECTION. - */ - private function _writeSelection() - { - // look up the selected cell range - $selectedCells = $this->_phpSheet->getSelectedCells(); - $selectedCells = PHPExcel_Cell::splitRange($this->_phpSheet->getSelectedCells()); - $selectedCells = $selectedCells[0]; - if (count($selectedCells) == 2) { - list($first, $last) = $selectedCells; - } else { - $first = $selectedCells[0]; - $last = $selectedCells[0]; - } - - list($colFirst, $rwFirst) = PHPExcel_Cell::coordinateFromString($first); - $colFirst = PHPExcel_Cell::columnIndexFromString($colFirst) - 1; // base 0 column index - --$rwFirst; // base 0 row index - - list($colLast, $rwLast) = PHPExcel_Cell::coordinateFromString($last); - $colLast = PHPExcel_Cell::columnIndexFromString($colLast) - 1; // base 0 column index - --$rwLast; // base 0 row index - - // make sure we are not out of bounds - $colFirst = min($colFirst, 255); - $colLast = min($colLast, 255); - if ($this->_BIFF_version == 0x0600) { - $rwFirst = min($rwFirst, 65535); - $rwLast = min($rwLast, 65535); - } else { - $rwFirst = min($rwFirst, 16383); - $rwLast = min($rwLast, 16383); - } - - $record = 0x001D; // Record identifier - $length = 0x000F; // Number of bytes to follow - - $pnn = $this->_active_pane; // Pane position - $rwAct = $rwFirst; // Active row - $colAct = $colFirst; // Active column - $irefAct = 0; // Active cell ref - $cref = 1; // Number of refs - - if (!isset($rwLast)) { - $rwLast = $rwFirst; // Last row in reference - } - if (!isset($colLast)) { - $colLast = $colFirst; // Last col in reference - } - - // Swap last row/col for first row/col as necessary - if ($rwFirst > $rwLast) { - list($rwFirst, $rwLast) = array($rwLast, $rwFirst); - } - - if ($colFirst > $colLast) { - list($colFirst, $colLast) = array($colLast, $colFirst); - } - - $header = pack("vv", $record, $length); - $data = pack("CvvvvvvCC", $pnn, $rwAct, $colAct, - $irefAct, $cref, - $rwFirst, $rwLast, - $colFirst, $colLast); - $this->_append($header . $data); - } - - /** - * Store the MERGEDCELLS records for all ranges of merged cells - */ - private function _writeMergedCells() - { - $mergeCells = $this->_phpSheet->getMergeCells(); - $countMergeCells = count($mergeCells); - - if ($countMergeCells == 0) { - return; - } - - // maximum allowed number of merged cells per record - if ($this->_BIFF_version == 0x0600) { - $maxCountMergeCellsPerRecord = 1027; - } else { - $maxCountMergeCellsPerRecord = 259; - } - - // record identifier - $record = 0x00E5; - - // counter for total number of merged cells treated so far by the writer - $i = 0; - - // counter for number of merged cells written in record currently being written - $j = 0; - - // initialize record data - $recordData = ''; - - // loop through the merged cells - foreach ($mergeCells as $mergeCell) { - ++$i; - ++$j; - - // extract the row and column indexes - $range = PHPExcel_Cell::splitRange($mergeCell); - list($first, $last) = $range[0]; - list($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($first); - list($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($last); - - $recordData .= pack('vvvv', $firstRow - 1, $lastRow - 1, PHPExcel_Cell::columnIndexFromString($firstColumn) - 1, PHPExcel_Cell::columnIndexFromString($lastColumn) - 1); - - // flush record if we have reached limit for number of merged cells, or reached final merged cell - if ($j == $maxCountMergeCellsPerRecord or $i == $countMergeCells) { - $recordData = pack('v', $j) . $recordData; - $length = strlen($recordData); - $header = pack('vv', $record, $length); - $this->_append($header . $recordData); - - // initialize for next record, if any - $recordData = ''; - $j = 0; - } - } - } - - /** - * Write SHEETLAYOUT record - */ - private function _writeSheetLayout() - { - if (!$this->_phpSheet->isTabColorSet()) { - return; - } - - $recordData = pack( - 'vvVVVvv' - , 0x0862 - , 0x0000 // unused - , 0x00000000 // unused - , 0x00000000 // unused - , 0x00000014 // size of record data - , $this->_colors[$this->_phpSheet->getTabColor()->getRGB()] // color index - , 0x0000 // unused - ); - - $length = strlen($recordData); - - $record = 0x0862; // Record identifier - $header = pack('vv', $record, $length); - $this->_append($header . $recordData); - } - - /** - * Write SHEETPROTECTION - */ - private function _writeSheetProtection() - { - // record identifier - $record = 0x0867; - - // prepare options - $options = (int) !$this->_phpSheet->getProtection()->getObjects() - | (int) !$this->_phpSheet->getProtection()->getScenarios() << 1 - | (int) !$this->_phpSheet->getProtection()->getFormatCells() << 2 - | (int) !$this->_phpSheet->getProtection()->getFormatColumns() << 3 - | (int) !$this->_phpSheet->getProtection()->getFormatRows() << 4 - | (int) !$this->_phpSheet->getProtection()->getInsertColumns() << 5 - | (int) !$this->_phpSheet->getProtection()->getInsertRows() << 6 - | (int) !$this->_phpSheet->getProtection()->getInsertHyperlinks() << 7 - | (int) !$this->_phpSheet->getProtection()->getDeleteColumns() << 8 - | (int) !$this->_phpSheet->getProtection()->getDeleteRows() << 9 - | (int) !$this->_phpSheet->getProtection()->getSelectLockedCells() << 10 - | (int) !$this->_phpSheet->getProtection()->getSort() << 11 - | (int) !$this->_phpSheet->getProtection()->getAutoFilter() << 12 - | (int) !$this->_phpSheet->getProtection()->getPivotTables() << 13 - | (int) !$this->_phpSheet->getProtection()->getSelectUnlockedCells() << 14 ; - - // record data - $recordData = pack( - 'vVVCVVvv' - , 0x0867 // repeated record identifier - , 0x0000 // not used - , 0x0000 // not used - , 0x00 // not used - , 0x01000200 // unknown data - , 0xFFFFFFFF // unknown data - , $options // options - , 0x0000 // not used - ); - - $length = strlen($recordData); - $header = pack('vv', $record, $length); - - $this->_append($header . $recordData); - } - - /** - * Write BIFF record RANGEPROTECTION - * - * Openoffice.org's Documentaion of the Microsoft Excel File Format uses term RANGEPROTECTION for these records - * Microsoft Office Excel 97-2007 Binary File Format Specification uses term FEAT for these records - */ - private function _writeRangeProtection() - { - foreach ($this->_phpSheet->getProtectedCells() as $range => $password) { - // number of ranges, e.g. 'A1:B3 C20:D25' - $cellRanges = explode(' ', $range); - $cref = count($cellRanges); - - $recordData = pack( - 'vvVVvCVvVv', - 0x0868, - 0x00, - 0x0000, - 0x0000, - 0x02, - 0x0, - 0x0000, - $cref, - 0x0000, - 0x00 - ); - - foreach ($cellRanges as $cellRange) { - $recordData .= $this->_writeBIFF8CellRangeAddressFixed($cellRange); - } - - // the rgbFeat structure - $recordData .= pack( - 'VV', - 0x0000, - hexdec($password) - ); - - $recordData .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong('p' . md5($recordData)); - - $length = strlen($recordData); - - $record = 0x0868; // Record identifier - $header = pack("vv", $record, $length); - $this->_append($header . $recordData); - } - } - - /** - * Write BIFF record EXTERNCOUNT to indicate the number of external sheet - * references in a worksheet. - * - * Excel only stores references to external sheets that are used in formulas. - * For simplicity we store references to all the sheets in the workbook - * regardless of whether they are used or not. This reduces the overall - * complexity and eliminates the need for a two way dialogue between the formula - * parser the worksheet objects. - * - * @param integer $count The number of external sheet references in this worksheet - */ - private function _writeExterncount($count) - { - $record = 0x0016; // Record identifier - $length = 0x0002; // Number of bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("v", $count); - $this->_append($header . $data); - } - - /** - * Writes the Excel BIFF EXTERNSHEET record. These references are used by - * formulas. A formula references a sheet name via an index. Since we store a - * reference to all of the external worksheets the EXTERNSHEET index is the same - * as the worksheet index. - * - * @param string $sheetname The name of a external worksheet - */ - private function _writeExternsheet($sheetname) - { - $record = 0x0017; // Record identifier - - // References to the current sheet are encoded differently to references to - // external sheets. - // - if ($this->_phpSheet->getTitle() == $sheetname) { - $sheetname = ''; - $length = 0x02; // The following 2 bytes - $cch = 1; // The following byte - $rgch = 0x02; // Self reference - } else { - $length = 0x02 + strlen($sheetname); - $cch = strlen($sheetname); - $rgch = 0x03; // Reference to a sheet in the current workbook - } - - $header = pack("vv", $record, $length); - $data = pack("CC", $cch, $rgch); - $this->_append($header . $data . $sheetname); - } - - /** - * Writes the Excel BIFF PANE record. - * The panes can either be frozen or thawed (unfrozen). - * Frozen panes are specified in terms of an integer number of rows and columns. - * Thawed panes are specified in terms of Excel's units for rows and columns. - */ - private function _writePanes() - { - $panes = array(); - if ($freezePane = $this->_phpSheet->getFreezePane()) { - list($column, $row) = PHPExcel_Cell::coordinateFromString($freezePane); - $panes[0] = $row - 1; - $panes[1] = PHPExcel_Cell::columnIndexFromString($column) - 1; - } else { - // thaw panes - return; - } - - $y = isset($panes[0]) ? $panes[0] : null; - $x = isset($panes[1]) ? $panes[1] : null; - $rwTop = isset($panes[2]) ? $panes[2] : null; - $colLeft = isset($panes[3]) ? $panes[3] : null; - if (count($panes) > 4) { // if Active pane was received - $pnnAct = $panes[4]; - } else { - $pnnAct = null; - } - $record = 0x0041; // Record identifier - $length = 0x000A; // Number of bytes to follow - - // Code specific to frozen or thawed panes. - if ($this->_phpSheet->getFreezePane()) { - // Set default values for $rwTop and $colLeft - if (!isset($rwTop)) { - $rwTop = $y; - } - if (!isset($colLeft)) { - $colLeft = $x; - } - } else { - // Set default values for $rwTop and $colLeft - if (!isset($rwTop)) { - $rwTop = 0; - } - if (!isset($colLeft)) { - $colLeft = 0; - } - - // Convert Excel's row and column units to the internal units. - // The default row height is 12.75 - // The default column width is 8.43 - // The following slope and intersection values were interpolated. - // - $y = 20*$y + 255; - $x = 113.879*$x + 390; - } - - - // Determine which pane should be active. There is also the undocumented - // option to override this should it be necessary: may be removed later. - // - if (!isset($pnnAct)) { - if ($x != 0 && $y != 0) { - $pnnAct = 0; // Bottom right - } - if ($x != 0 && $y == 0) { - $pnnAct = 1; // Top right - } - if ($x == 0 && $y != 0) { - $pnnAct = 2; // Bottom left - } - if ($x == 0 && $y == 0) { - $pnnAct = 3; // Top left - } - } - - $this->_active_pane = $pnnAct; // Used in _writeSelection - - $header = pack("vv", $record, $length); - $data = pack("vvvvv", $x, $y, $rwTop, $colLeft, $pnnAct); - $this->_append($header . $data); - } - - /** - * Store the page setup SETUP BIFF record. - */ - private function _writeSetup() - { - $record = 0x00A1; // Record identifier - $length = 0x0022; // Number of bytes to follow - - $iPaperSize = $this->_phpSheet->getPageSetup()->getPaperSize(); // Paper size - - $iScale = $this->_phpSheet->getPageSetup()->getScale() ? - $this->_phpSheet->getPageSetup()->getScale() : 100; // Print scaling factor - - $iPageStart = 0x01; // Starting page number - $iFitWidth = (int) $this->_phpSheet->getPageSetup()->getFitToWidth(); // Fit to number of pages wide - $iFitHeight = (int) $this->_phpSheet->getPageSetup()->getFitToHeight(); // Fit to number of pages high - $grbit = 0x00; // Option flags - $iRes = 0x0258; // Print resolution - $iVRes = 0x0258; // Vertical print resolution - - $numHdr = $this->_phpSheet->getPageMargins()->getHeader(); // Header Margin - - $numFtr = $this->_phpSheet->getPageMargins()->getFooter(); // Footer Margin - $iCopies = 0x01; // Number of copies - - $fLeftToRight = 0x0; // Print over then down - - // Page orientation - $fLandscape = ($this->_phpSheet->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? - 0x0 : 0x1; - - $fNoPls = 0x0; // Setup not read from printer - $fNoColor = 0x0; // Print black and white - $fDraft = 0x0; // Print draft quality - $fNotes = 0x0; // Print notes - $fNoOrient = 0x0; // Orientation not set - $fUsePage = 0x0; // Use custom starting page - - $grbit = $fLeftToRight; - $grbit |= $fLandscape << 1; - $grbit |= $fNoPls << 2; - $grbit |= $fNoColor << 3; - $grbit |= $fDraft << 4; - $grbit |= $fNotes << 5; - $grbit |= $fNoOrient << 6; - $grbit |= $fUsePage << 7; - - $numHdr = pack("d", $numHdr); - $numFtr = pack("d", $numFtr); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $numHdr = strrev($numHdr); - $numFtr = strrev($numFtr); - } - - $header = pack("vv", $record, $length); - $data1 = pack("vvvvvvvv", $iPaperSize, - $iScale, - $iPageStart, - $iFitWidth, - $iFitHeight, - $grbit, - $iRes, - $iVRes); - $data2 = $numHdr.$numFtr; - $data3 = pack("v", $iCopies); - $this->_append($header . $data1 . $data2 . $data3); - } - - /** - * Store the header caption BIFF record. - */ - private function _writeHeader() - { - $record = 0x0014; // Record identifier - - /* removing for now - // need to fix character count (multibyte!) - if (strlen($this->_phpSheet->getHeaderFooter()->getOddHeader()) <= 255) { - $str = $this->_phpSheet->getHeaderFooter()->getOddHeader(); // header string - } else { - $str = ''; - } - */ - - if ($this->_BIFF_version == 0x0600) { - $recordData = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($this->_phpSheet->getHeaderFooter()->getOddHeader()); - $length = strlen($recordData); - } else { - $cch = strlen($this->_phpSheet->getHeaderFooter()->getOddHeader()); // Length of header string - $length = 1 + $cch; // Bytes to follow - $data = pack("C", $cch); - $recordData = $data . $this->_phpSheet->getHeaderFooter()->getOddHeader(); - } - - $header = pack("vv", $record, $length); - - $this->_append($header . $recordData); - } - - /** - * Store the footer caption BIFF record. - */ - private function _writeFooter() - { - $record = 0x0015; // Record identifier - - /* removing for now - // need to fix character count (multibyte!) - if (strlen($this->_phpSheet->getHeaderFooter()->getOddFooter()) <= 255) { - $str = $this->_phpSheet->getHeaderFooter()->getOddFooter(); - } else { - $str = ''; - } - */ - - if ($this->_BIFF_version == 0x0600) { - $recordData = PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($this->_phpSheet->getHeaderFooter()->getOddFooter()); - $length = strlen($recordData); - } else { - $cch = strlen($this->_phpSheet->getHeaderFooter()->getOddFooter()); // Length of footer string - $length = 1 + $cch; - $data = pack("C", $cch); - $recordData = $data . $this->_phpSheet->getHeaderFooter()->getOddFooter(); - } - - $header = pack("vv", $record, $length); - - $this->_append($header . $recordData); - } - - /** - * Store the horizontal centering HCENTER BIFF record. - * - * @access private - */ - private function _writeHcenter() - { - $record = 0x0083; // Record identifier - $length = 0x0002; // Bytes to follow - - $fHCenter = $this->_phpSheet->getPageSetup()->getHorizontalCentered() ? 1 : 0; // Horizontal centering - - $header = pack("vv", $record, $length); - $data = pack("v", $fHCenter); - - $this->_append($header.$data); - } - - /** - * Store the vertical centering VCENTER BIFF record. - */ - private function _writeVcenter() - { - $record = 0x0084; // Record identifier - $length = 0x0002; // Bytes to follow - - $fVCenter = $this->_phpSheet->getPageSetup()->getVerticalCentered() ? 1 : 0; // Horizontal centering - - $header = pack("vv", $record, $length); - $data = pack("v", $fVCenter); - $this->_append($header . $data); - } - - /** - * Store the LEFTMARGIN BIFF record. - */ - private function _writeMarginLeft() - { - $record = 0x0026; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_phpSheet->getPageMargins()->getLeft(); // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $data = strrev($data); - } - - $this->_append($header . $data); - } - - /** - * Store the RIGHTMARGIN BIFF record. - */ - private function _writeMarginRight() - { - $record = 0x0027; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_phpSheet->getPageMargins()->getRight(); // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $data = strrev($data); - } - - $this->_append($header . $data); - } - - /** - * Store the TOPMARGIN BIFF record. - */ - private function _writeMarginTop() - { - $record = 0x0028; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_phpSheet->getPageMargins()->getTop(); // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $data = strrev($data); - } - - $this->_append($header . $data); - } - - /** - * Store the BOTTOMMARGIN BIFF record. - */ - private function _writeMarginBottom() - { - $record = 0x0029; // Record identifier - $length = 0x0008; // Bytes to follow - - $margin = $this->_phpSheet->getPageMargins()->getBottom(); // Margin in inches - - $header = pack("vv", $record, $length); - $data = pack("d", $margin); - if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) { // if it's Big Endian - $data = strrev($data); - } - - $this->_append($header . $data); - } - - /** - * Write the PRINTHEADERS BIFF record. - */ - private function _writePrintHeaders() - { - $record = 0x002a; // Record identifier - $length = 0x0002; // Bytes to follow - - $fPrintRwCol = $this->_print_headers; // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fPrintRwCol); - $this->_append($header . $data); - } - - /** - * Write the PRINTGRIDLINES BIFF record. Must be used in conjunction with the - * GRIDSET record. - */ - private function _writePrintGridlines() - { - $record = 0x002b; // Record identifier - $length = 0x0002; // Bytes to follow - - $fPrintGrid = $this->_phpSheet->getPrintGridlines() ? 1 : 0; // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fPrintGrid); - $this->_append($header . $data); - } - - /** - * Write the GRIDSET BIFF record. Must be used in conjunction with the - * PRINTGRIDLINES record. - */ - private function _writeGridset() - { - $record = 0x0082; // Record identifier - $length = 0x0002; // Bytes to follow - - $fGridSet = !$this->_phpSheet->getPrintGridlines(); // Boolean flag - - $header = pack("vv", $record, $length); - $data = pack("v", $fGridSet); - $this->_append($header . $data); - } - - /** - * Write the GUTS BIFF record. This is used to configure the gutter margins - * where Excel outline symbols are displayed. The visibility of the gutters is - * controlled by a flag in WSBOOL. - * - * @see _writeWsbool() - */ - private function _writeGuts() - { - $record = 0x0080; // Record identifier - $length = 0x0008; // Bytes to follow - - $dxRwGut = 0x0000; // Size of row gutter - $dxColGut = 0x0000; // Size of col gutter - - // determine maximum row outline level - $maxRowOutlineLevel = 0; - foreach ($this->_phpSheet->getRowDimensions() as $rowDimension) { - $maxRowOutlineLevel = max($maxRowOutlineLevel, $rowDimension->getOutlineLevel()); - } - - $col_level = 0; - - // Calculate the maximum column outline level. The equivalent calculation - // for the row outline level is carried out in _writeRow(). - $colcount = count($this->_colinfo); - for ($i = 0; $i < $colcount; ++$i) { - $col_level = max($this->_colinfo[$i][5], $col_level); - } - - // Set the limits for the outline levels (0 <= x <= 7). - $col_level = max(0, min($col_level, 7)); - - // The displayed level is one greater than the max outline levels - if ($maxRowOutlineLevel) { - ++$maxRowOutlineLevel; - } - if ($col_level) { - ++$col_level; - } - - $header = pack("vv", $record, $length); - $data = pack("vvvv", $dxRwGut, $dxColGut, $maxRowOutlineLevel, $col_level); - - $this->_append($header.$data); - } - - - /** - * Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction - * with the SETUP record. - */ - private function _writeWsbool() - { - $record = 0x0081; // Record identifier - $length = 0x0002; // Bytes to follow - $grbit = 0x0000; - - // The only option that is of interest is the flag for fit to page. So we - // set all the options in one go. - // - // Set the option flags - $grbit |= 0x0001; // Auto page breaks visible - if ($this->_outline_style) { - $grbit |= 0x0020; // Auto outline styles - } - if ($this->_phpSheet->getShowSummaryBelow()) { - $grbit |= 0x0040; // Outline summary below - } - if ($this->_phpSheet->getShowSummaryRight()) { - $grbit |= 0x0080; // Outline summary right - } - if ($this->_phpSheet->getPageSetup()->getFitToPage()) { - $grbit |= 0x0100; // Page setup fit to page - } - if ($this->_outline_on) { - $grbit |= 0x0400; // Outline symbols displayed - } - - $header = pack("vv", $record, $length); - $data = pack("v", $grbit); - $this->_append($header . $data); - } - - /** - * Write the HORIZONTALPAGEBREAKS and VERTICALPAGEBREAKS BIFF records. - */ - private function _writeBreaks() - { - // initialize - $vbreaks = array(); - $hbreaks = array(); - - foreach ($this->_phpSheet->getBreaks() as $cell => $breakType) { - // Fetch coordinates - $coordinates = PHPExcel_Cell::coordinateFromString($cell); - - // Decide what to do by the type of break - switch ($breakType) { - case PHPExcel_Worksheet::BREAK_COLUMN: - // Add to list of vertical breaks - $vbreaks[] = PHPExcel_Cell::columnIndexFromString($coordinates[0]) - 1; - break; - - case PHPExcel_Worksheet::BREAK_ROW: - // Add to list of horizontal breaks - $hbreaks[] = $coordinates[1]; - break; - - case PHPExcel_Worksheet::BREAK_NONE: - default: - // Nothing to do - break; - } - } - - //horizontal page breaks - if (count($hbreaks) > 0) { - - // Sort and filter array of page breaks - sort($hbreaks, SORT_NUMERIC); - if ($hbreaks[0] == 0) { // don't use first break if it's 0 - array_shift($hbreaks); - } - - $record = 0x001b; // Record identifier - $cbrk = count($hbreaks); // Number of page breaks - if ($this->_BIFF_version == 0x0600) { - $length = 2 + 6 * $cbrk; // Bytes to follow - } else { - $length = 2 + 2 * $cbrk; // Bytes to follow - } - - $header = pack("vv", $record, $length); - $data = pack("v", $cbrk); - - // Append each page break - foreach ($hbreaks as $hbreak) { - if ($this->_BIFF_version == 0x0600) { - $data .= pack("vvv", $hbreak, 0x0000, 0x00ff); - } else { - $data .= pack("v", $hbreak); - } - } - - $this->_append($header . $data); - } - - // vertical page breaks - if (count($vbreaks) > 0) { - - // 1000 vertical pagebreaks appears to be an internal Excel 5 limit. - // It is slightly higher in Excel 97/200, approx. 1026 - $vbreaks = array_slice($vbreaks, 0, 1000); - - // Sort and filter array of page breaks - sort($vbreaks, SORT_NUMERIC); - if ($vbreaks[0] == 0) { // don't use first break if it's 0 - array_shift($vbreaks); - } - - $record = 0x001a; // Record identifier - $cbrk = count($vbreaks); // Number of page breaks - if ($this->_BIFF_version == 0x0600) { - $length = 2 + 6 * $cbrk; // Bytes to follow - } else { - $length = 2 + 2 * $cbrk; // Bytes to follow - } - - $header = pack("vv", $record, $length); - $data = pack("v", $cbrk); - - // Append each page break - foreach ($vbreaks as $vbreak) { - if ($this->_BIFF_version == 0x0600) { - $data .= pack("vvv", $vbreak, 0x0000, 0xffff); - } else { - $data .= pack("v", $vbreak); - } - } - - $this->_append($header . $data); - } - } - - /** - * Set the Biff PROTECT record to indicate that the worksheet is protected. - */ - private function _writeProtect() - { - // Exit unless sheet protection has been specified - if (!$this->_phpSheet->getProtection()->getSheet()) { - return; - } - - $record = 0x0012; // Record identifier - $length = 0x0002; // Bytes to follow - - $fLock = 1; // Worksheet is protected - - $header = pack("vv", $record, $length); - $data = pack("v", $fLock); - - $this->_append($header.$data); - } - - /** - * Write SCENPROTECT - */ - private function _writeScenProtect() - { - // Exit if sheet protection is not active - if (!$this->_phpSheet->getProtection()->getSheet()) { - return; - } - - // Exit if scenarios are not protected - if (!$this->_phpSheet->getProtection()->getScenarios()) { - return; - } - - $record = 0x00DD; // Record identifier - $length = 0x0002; // Bytes to follow - - $header = pack('vv', $record, $length); - $data = pack('v', 1); - - $this->_append($header . $data); - } - - /** - * Write OBJECTPROTECT - */ - private function _writeObjectProtect() - { - // Exit if sheet protection is not active - if (!$this->_phpSheet->getProtection()->getSheet()) { - return; - } - - // Exit if objects are not protected - if (!$this->_phpSheet->getProtection()->getObjects()) { - return; - } - - $record = 0x0063; // Record identifier - $length = 0x0002; // Bytes to follow - - $header = pack('vv', $record, $length); - $data = pack('v', 1); - - $this->_append($header . $data); - } - - /** - * Write the worksheet PASSWORD record. - */ - private function _writePassword() - { - // Exit unless sheet protection and password have been specified - if (!$this->_phpSheet->getProtection()->getSheet() || !$this->_phpSheet->getProtection()->getPassword()) { - return; - } - - $record = 0x0013; // Record identifier - $length = 0x0002; // Bytes to follow - - $wPassword = hexdec($this->_phpSheet->getProtection()->getPassword()); // Encoded password - - $header = pack("vv", $record, $length); - $data = pack("v", $wPassword); - - $this->_append($header . $data); - } - - - /** - * Insert a 24bit bitmap image in a worksheet. - * - * @access public - * @param integer $row The row we are going to insert the bitmap into - * @param integer $col The column we are going to insert the bitmap into - * @param mixed $bitmap The bitmap filename or GD-image resource - * @param integer $x The horizontal position (offset) of the image inside the cell. - * @param integer $y The vertical position (offset) of the image inside the cell. - * @param float $scale_x The horizontal scale - * @param float $scale_y The vertical scale - */ - function insertBitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) - { - $bitmap_array = (is_resource($bitmap) ? $this->_processBitmapGd($bitmap) : $this->_processBitmap($bitmap)); - list($width, $height, $size, $data) = $bitmap_array; //$this->_processBitmap($bitmap); - - // Scale the frame of the image. - $width *= $scale_x; - $height *= $scale_y; - - // Calculate the vertices of the image and write the OBJ record - $this->_positionImage($col, $row, $x, $y, $width, $height); - - // Write the IMDATA record to store the bitmap data - $record = 0x007f; - $length = 8 + $size; - $cf = 0x09; - $env = 0x01; - $lcb = $size; - - $header = pack("vvvvV", $record, $length, $cf, $env, $lcb); - $this->_append($header.$data); - } - - /** - * Calculate the vertices that define the position of the image as required by - * the OBJ record. - * - * +------------+------------+ - * | A | B | - * +-----+------------+------------+ - * | |(x1,y1) | | - * | 1 |(A1)._______|______ | - * | | | | | - * | | | | | - * +-----+----| BITMAP |-----+ - * | | | | | - * | 2 | |______________. | - * | | | (B2)| - * | | | (x2,y2)| - * +---- +------------+------------+ - * - * Example of a bitmap that covers some of the area from cell A1 to cell B2. - * - * Based on the width and height of the bitmap we need to calculate 8 vars: - * $col_start, $row_start, $col_end, $row_end, $x1, $y1, $x2, $y2. - * The width and height of the cells are also variable and have to be taken into - * account. - * The values of $col_start and $row_start are passed in from the calling - * function. The values of $col_end and $row_end are calculated by subtracting - * the width and height of the bitmap from the width and height of the - * underlying cells. - * The vertices are expressed as a percentage of the underlying cell width as - * follows (rhs values are in pixels): - * - * x1 = X / W *1024 - * y1 = Y / H *256 - * x2 = (X-1) / W *1024 - * y2 = (Y-1) / H *256 - * - * Where: X is distance from the left side of the underlying cell - * Y is distance from the top of the underlying cell - * W is the width of the cell - * H is the height of the cell - * The SDK incorrectly states that the height should be expressed as a - * percentage of 1024. - * - * @access private - * @param integer $col_start Col containing upper left corner of object - * @param integer $row_start Row containing top left corner of object - * @param integer $x1 Distance to left side of object - * @param integer $y1 Distance to top of object - * @param integer $width Width of image frame - * @param integer $height Height of image frame - */ - function _positionImage($col_start, $row_start, $x1, $y1, $width, $height) - { - // Initialise end cell to the same as the start cell - $col_end = $col_start; // Col containing lower right corner of object - $row_end = $row_start; // Row containing bottom right corner of object - - // Zero the specified offset if greater than the cell dimensions - if ($x1 >= PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start))) { - $x1 = 0; - } - if ($y1 >= PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_start + 1)) { - $y1 = 0; - } - - $width = $width + $x1 -1; - $height = $height + $y1 -1; - - // Subtract the underlying cell widths to find the end cell of the image - while ($width >= PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end))) { - $width -= PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)); - ++$col_end; - } - - // Subtract the underlying cell heights to find the end cell of the image - while ($height >= PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_end + 1)) { - $height -= PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_end + 1); - ++$row_end; - } - - // Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell - // with zero eight or width. - // - if (PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) == 0) { - return; - } - if (PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) == 0) { - return; - } - if (PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_start + 1) == 0) { - return; - } - if (PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_end + 1) == 0) { - return; - } - - // Convert the pixel values to the percentage value expected by Excel - $x1 = $x1 / PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_start)) * 1024; - $y1 = $y1 / PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_start + 1) * 256; - $x2 = $width / PHPExcel_Shared_Excel5::sizeCol($this->_phpSheet, PHPExcel_Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object - $y2 = $height / PHPExcel_Shared_Excel5::sizeRow($this->_phpSheet, $row_end + 1) * 256; // Distance to bottom of object - - $this->_writeObjPicture($col_start, $x1, - $row_start, $y1, - $col_end, $x2, - $row_end, $y2); - } - - /** - * Store the OBJ record that precedes an IMDATA record. This could be generalise - * to support other Excel objects. - * - * @param integer $colL Column containing upper left corner of object - * @param integer $dxL Distance from left side of cell - * @param integer $rwT Row containing top left corner of object - * @param integer $dyT Distance from top of cell - * @param integer $colR Column containing lower right corner of object - * @param integer $dxR Distance from right of cell - * @param integer $rwB Row containing bottom right corner of object - * @param integer $dyB Distance from bottom of cell - */ - private function _writeObjPicture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) - { - $record = 0x005d; // Record identifier - $length = 0x003c; // Bytes to follow - - $cObj = 0x0001; // Count of objects in file (set to 1) - $OT = 0x0008; // Object type. 8 = Picture - $id = 0x0001; // Object ID - $grbit = 0x0614; // Option flags - - $cbMacro = 0x0000; // Length of FMLA structure - $Reserved1 = 0x0000; // Reserved - $Reserved2 = 0x0000; // Reserved - - $icvBack = 0x09; // Background colour - $icvFore = 0x09; // Foreground colour - $fls = 0x00; // Fill pattern - $fAuto = 0x00; // Automatic fill - $icv = 0x08; // Line colour - $lns = 0xff; // Line style - $lnw = 0x01; // Line weight - $fAutoB = 0x00; // Automatic border - $frs = 0x0000; // Frame style - $cf = 0x0009; // Image format, 9 = bitmap - $Reserved3 = 0x0000; // Reserved - $cbPictFmla = 0x0000; // Length of FMLA structure - $Reserved4 = 0x0000; // Reserved - $grbit2 = 0x0001; // Option flags - $Reserved5 = 0x0000; // Reserved - - - $header = pack("vv", $record, $length); - $data = pack("V", $cObj); - $data .= pack("v", $OT); - $data .= pack("v", $id); - $data .= pack("v", $grbit); - $data .= pack("v", $colL); - $data .= pack("v", $dxL); - $data .= pack("v", $rwT); - $data .= pack("v", $dyT); - $data .= pack("v", $colR); - $data .= pack("v", $dxR); - $data .= pack("v", $rwB); - $data .= pack("v", $dyB); - $data .= pack("v", $cbMacro); - $data .= pack("V", $Reserved1); - $data .= pack("v", $Reserved2); - $data .= pack("C", $icvBack); - $data .= pack("C", $icvFore); - $data .= pack("C", $fls); - $data .= pack("C", $fAuto); - $data .= pack("C", $icv); - $data .= pack("C", $lns); - $data .= pack("C", $lnw); - $data .= pack("C", $fAutoB); - $data .= pack("v", $frs); - $data .= pack("V", $cf); - $data .= pack("v", $Reserved3); - $data .= pack("v", $cbPictFmla); - $data .= pack("v", $Reserved4); - $data .= pack("v", $grbit2); - $data .= pack("V", $Reserved5); - - $this->_append($header . $data); - } - - /** - * Convert a GD-image into the internal format. - * - * @access private - * @param resource $image The image to process - * @return array Array with data and properties of the bitmap - */ - function _processBitmapGd($image) { - $width = imagesx($image); - $height = imagesy($image); - - $data = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); - for ($j=$height; $j--; ) { - for ($i=0; $i < $width; ++$i) { - $color = imagecolorsforindex($image, imagecolorat($image, $i, $j)); - foreach (array("red", "green", "blue") as $key) { - $color[$key] = $color[$key] + round((255 - $color[$key]) * $color["alpha"] / 127); - } - $data .= chr($color["blue"]) . chr($color["green"]) . chr($color["red"]); - } - if (3*$width % 4) { - $data .= str_repeat("\x00", 4 - 3*$width % 4); - } - } - - return array($width, $height, strlen($data), $data); - } - - /** - * Convert a 24 bit bitmap into the modified internal format used by Windows. - * This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the - * MSDN library. - * - * @access private - * @param string $bitmap The bitmap to process - * @return array Array with data and properties of the bitmap - */ - function _processBitmap($bitmap) - { - // Open file. - $bmp_fd = @fopen($bitmap,"rb"); - if (!$bmp_fd) { - throw new Exception("Couldn't import $bitmap"); - } - - // Slurp the file into a string. - $data = fread($bmp_fd, filesize($bitmap)); - - // Check that the file is big enough to be a bitmap. - if (strlen($data) <= 0x36) { - throw new Exception("$bitmap doesn't contain enough data.\n"); - } - - // The first 2 bytes are used to identify the bitmap. - $identity = unpack("A2ident", $data); - if ($identity['ident'] != "BM") { - throw new Exception("$bitmap doesn't appear to be a valid bitmap image.\n"); - } - - // Remove bitmap data: ID. - $data = substr($data, 2); - - // Read and remove the bitmap size. This is more reliable than reading - // the data size at offset 0x22. - // - $size_array = unpack("Vsa", substr($data, 0, 4)); - $size = $size_array['sa']; - $data = substr($data, 4); - $size -= 0x36; // Subtract size of bitmap header. - $size += 0x0C; // Add size of BIFF header. - - // Remove bitmap data: reserved, offset, header length. - $data = substr($data, 12); - - // Read and remove the bitmap width and height. Verify the sizes. - $width_and_height = unpack("V2", substr($data, 0, 8)); - $width = $width_and_height[1]; - $height = $width_and_height[2]; - $data = substr($data, 8); - if ($width > 0xFFFF) { - throw new Exception("$bitmap: largest image width supported is 65k.\n"); - } - if ($height > 0xFFFF) { - throw new Exception("$bitmap: largest image height supported is 65k.\n"); - } - - // Read and remove the bitmap planes and bpp data. Verify them. - $planes_and_bitcount = unpack("v2", substr($data, 0, 4)); - $data = substr($data, 4); - if ($planes_and_bitcount[2] != 24) { // Bitcount - throw new Exception("$bitmap isn't a 24bit true color bitmap.\n"); - } - if ($planes_and_bitcount[1] != 1) { - throw new Exception("$bitmap: only 1 plane supported in bitmap image.\n"); - } - - // Read and remove the bitmap compression. Verify compression. - $compression = unpack("Vcomp", substr($data, 0, 4)); - $data = substr($data, 4); - - //$compression = 0; - if ($compression['comp'] != 0) { - throw new Exception("$bitmap: compression not supported in bitmap image.\n"); - } - - // Remove bitmap data: data size, hres, vres, colours, imp. colours. - $data = substr($data, 20); - - // Add the BITMAPCOREHEADER data - $header = pack("Vvvvv", 0x000c, $width, $height, 0x01, 0x18); - $data = $header . $data; - - return (array($width, $height, $size, $data)); - } - - /** - * Store the window zoom factor. This should be a reduced fraction but for - * simplicity we will store all fractions with a numerator of 100. - */ - private function _writeZoom() - { - // If scale is 100 we don't need to write a record - if ($this->_phpSheet->getSheetView()->getZoomScale() == 100) { - return; - } - - $record = 0x00A0; // Record identifier - $length = 0x0004; // Bytes to follow - - $header = pack("vv", $record, $length); - $data = pack("vv", $this->_phpSheet->getSheetView()->getZoomScale(), 100); - $this->_append($header . $data); - } - - /** - * Get Escher object - * - * @return PHPExcel_Shared_Escher - */ - public function getEscher() - { - return $this->_escher; - } - - /** - * Set Escher object - * - * @param PHPExcel_Shared_Escher $pValue - */ - public function setEscher(PHPExcel_Shared_Escher $pValue = null) - { - $this->_escher = $pValue; - } - - /** - * Write MSODRAWING record - */ - private function _writeMsoDrawing() - { - // write the Escher stream if necessary - if (isset($this->_escher)) { - $writer = new PHPExcel_Writer_Excel5_Escher($this->_escher); - $data = $writer->close(); - $spOffsets = $writer->getSpOffsets(); - - // write the neccesary MSODRAWING, OBJ records - - // split the Escher stream - $spOffsets[0] = 0; - $nm = count($spOffsets) - 1; // number of shapes excluding first shape - for ($i = 1; $i <= $nm; ++$i) { - // MSODRAWING record - $record = 0x00EC; // Record identifier - - // chunk of Escher stream for one shape - - $dataChunk = substr($data, $spOffsets[$i -1], $spOffsets[$i] - $spOffsets[$i - 1]); - - $length = strlen($dataChunk); - $header = pack("vv", $record, $length); - - $this->_append($header . $dataChunk); - - // OBJ record - $record = 0x005D; // record identifier - $objData = ''; - - // ftCmo - $objData .= - pack('vvvvvVVV' - , 0x0015 // 0x0015 = ftCmo - , 0x0012 // length of ftCmo data - , 0x0008 // object type, 0x0008 = picture - , $i // object id number, Excel seems to use 1-based index, local for the sheet - , 0x6011 // option flags, 0x6011 is what OpenOffice.org uses - , 0 // reserved - , 0 // reserved - , 0 // reserved - ); - // ftEnd - $objData .= - pack('vv' - , 0x0000 // 0x0000 = ftEnd - , 0x0000 // length of ftEnd data - ); - - $length = strlen($objData); - $header = pack('vv', $record, $length); - $this->_append($header . $objData); - } - } - } - - /** - * Store the DATAVALIDATIONS and DATAVALIDATION records. - */ - private function _writeDataValidity() - { - // Datavalidation collection - $dataValidationCollection = $this->_phpSheet->getDataValidationCollection(); - - // Write data validations? - if (count($dataValidationCollection) > 0) { - - // DATAVALIDATIONS record - $record = 0x01B2; // Record identifier - $length = 0x0012; // Bytes to follow - - $grbit = 0x0000; // Prompt box at cell, no cached validity data at DV records - $horPos = 0x00000000; // Horizontal position of prompt box, if fixed position - $verPos = 0x00000000; // Vertical position of prompt box, if fixed position - $objId = 0xFFFFFFFF; // Object identifier of drop down arrow object, or -1 if not visible - - $header = pack('vv', $record, $length); - $data = pack('vVVVV', $grbit, $horPos, $verPos, $objId, - count($dataValidationCollection)); - $this->_append($header.$data); - - // DATAVALIDATION records - $record = 0x01BE; // Record identifier - - foreach ($dataValidationCollection as $cellCoordinate => $dataValidation) { - // initialize record data - $data = ''; - - // options - $options = 0x00000000; - - // data type - $type = $dataValidation->getType(); - switch ($type) { - case PHPExcel_Cell_DataValidation::TYPE_NONE: $type = 0x00; break; - case PHPExcel_Cell_DataValidation::TYPE_WHOLE: $type = 0x01; break; - case PHPExcel_Cell_DataValidation::TYPE_DECIMAL: $type = 0x02; break; - case PHPExcel_Cell_DataValidation::TYPE_LIST: $type = 0x03; break; - case PHPExcel_Cell_DataValidation::TYPE_DATE: $type = 0x04; break; - case PHPExcel_Cell_DataValidation::TYPE_TIME: $type = 0x05; break; - case PHPExcel_Cell_DataValidation::TYPE_TEXTLENGTH: $type = 0x06; break; - case PHPExcel_Cell_DataValidation::TYPE_CUSTOM: $type = 0x07; break; - } - $options |= $type << 0; - - // error style - $errorStyle = $dataValidation->getType(); - switch ($errorStyle) { - case PHPExcel_Cell_DataValidation::STYLE_STOP: $errorStyle = 0x00; break; - case PHPExcel_Cell_DataValidation::STYLE_WARNING: $errorStyle = 0x01; break; - case PHPExcel_Cell_DataValidation::STYLE_INFORMATION: $errorStyle = 0x02; break; - } - $options |= $errorStyle << 4; - - // explicit formula? - if ($type == 0x03 && preg_match('/^\".*\"$/', $dataValidation->getFormula1())) { - $options |= 0x01 << 7; - } - - // empty cells allowed - $options |= $dataValidation->getAllowBlank() << 8; - - // show drop down - $options |= (!$dataValidation->getShowDropDown()) << 9; - - // show input message - $options |= $dataValidation->getShowInputMessage() << 18; - - // show error message - $options |= $dataValidation->getShowErrorMessage() << 19; - - // condition operator - $operator = $dataValidation->getOperator(); - switch ($operator) { - case PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN: $operator = 0x00 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_NOTBETWEEN: $operator = 0x01 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_EQUAL: $operator = 0x02 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_NOTEQUAL: $operator = 0x03 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHAN: $operator = 0x04 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_LESSTHAN: $operator = 0x05 ; break; - case PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL: $operator = 0x06; break; - case PHPExcel_Cell_DataValidation::OPERATOR_LESSTHANOREQUAL: $operator = 0x07 ; break; - } - $options |= $operator << 20; - - $data = pack('V', $options); - - // prompt title - $promptTitle = $dataValidation->getPromptTitle() !== '' ? - $dataValidation->getPromptTitle() : chr(0); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($promptTitle); - - // error title - $errorTitle = $dataValidation->getErrorTitle() !== '' ? - $dataValidation->getErrorTitle() : chr(0); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($errorTitle); - - // prompt text - $prompt = $dataValidation->getPrompt() !== '' ? - $dataValidation->getPrompt() : chr(0); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($prompt); - - // error text - $error = $dataValidation->getError() !== '' ? - $dataValidation->getError() : chr(0); - $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeLong($error); - - // formula 1 - try { - $formula1 = $dataValidation->getFormula1(); - if ($type == 0x03) { // list type - $formula1 = str_replace(',', chr(0), $formula1); - } - $this->_parser->parse($formula1); - $formula1 = $this->_parser->toReversePolish(); - $sz1 = strlen($formula1); - - } catch(Exception $e) { - $sz1 = 0; - $formula1 = ''; - } - $data .= pack('vv', $sz1, 0x0000); - $data .= $formula1; - - // formula 2 - try { - $formula2 = $dataValidation->getFormula2(); - if ($formula2 === '') { - throw new Exception('No formula2'); - } - $this->_parser->parse($formula2); - $formula2 = $this->_parser->toReversePolish(); - $sz2 = strlen($formula2); - - } catch(Exception $e) { - $sz2 = 0; - $formula2 = ''; - } - $data .= pack('vv', $sz2, 0x0000); - $data .= $formula2; - - // cell range address list - $data .= pack('v', 0x0001); - $data .= $this->_writeBIFF8CellRangeAddressFixed($cellCoordinate); - - $length = strlen($data); - $header = pack("vv", $record, $length); - - $this->_append($header . $data); - } - } - } - - /** - * Map Error code - */ - private function _mapErrorCode($errorCode) { - switch ($errorCode) { - case '#NULL!': return 0x00; - case '#DIV/0!': return 0x07; - case '#VALUE!': return 0x0F; - case '#REF!': return 0x17; - case '#NAME?': return 0x1D; - case '#NUM!': return 0x24; - case '#N/A': return 0x2A; - } - - return 0; - } - -} \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Xf.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Xf.php deleted file mode 100644 index 6d48e5bfa0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/Excel5/Xf.php +++ /dev/null @@ -1,573 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - -// Original file header of PEAR::Spreadsheet_Excel_Writer_Format (used as the base for this class): -// ----------------------------------------------------------------------------------------- -// /* -// * Module written/ported by Xavier Noguer <xnoguer@rezebra.com> -// * -// * The majority of this is _NOT_ my code. I simply ported it from the -// * PERL Spreadsheet::WriteExcel module. -// * -// * The author of the Spreadsheet::WriteExcel module is John McNamara -// * <jmcnamara@cpan.org> -// * -// * I _DO_ maintain this code, and John McNamara has nothing to do with the -// * porting of this code to PHP. Any questions directly related to this -// * class library should be directed to me. -// * -// * License Information: -// * -// * Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets -// * Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com -// * -// * This library is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 2.1 of the License, or (at your option) any later version. -// * -// * This library is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public -// * License along with this library; if not, write to the Free Software -// * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// */ - - -/** - * PHPExcel_Writer_Excel5_Xf - * - * @category PHPExcel - * @package PHPExcel_Writer_Excel5 - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_Excel5_Xf -{ - /** - * BIFF version - * - * @var int - */ - private $_BIFFVersion; - - /** - * Style XF or a cell XF ? - * - * @var boolean - */ - private $_isStyleXf; - - /** - * Index to the FONT record. Index 4 does not exist - * @var integer - */ - private $_fontIndex; - - /** - * An index (2 bytes) to a FORMAT record (number format). - * @var integer - */ - public $_numberFormatIndex; - - /** - * 1 bit, apparently not used. - * @var integer - */ - public $_text_justlast; - - /** - * The cell's foreground color. - * @var integer - */ - public $_fg_color; - - /** - * The cell's background color. - * @var integer - */ - public $_bg_color; - - /** - * Color of the bottom border of the cell. - * @var integer - */ - public $_bottom_color; - - /** - * Color of the top border of the cell. - * @var integer - */ - public $_top_color; - - /** - * Color of the left border of the cell. - * @var integer - */ - public $_left_color; - - /** - * Color of the right border of the cell. - * @var integer - */ - public $_right_color; - - /** - * Constructor - * - * @access private - * @param integer $index the XF index for the format. - * @param PHPExcel_Style - */ - public function __construct(PHPExcel_Style $style = null) - { - $this->_isStyleXf = false; - $this->_BIFFVersion = 0x0600; - $this->_fontIndex = 0; - - $this->_numberFormatIndex = 0; - - $this->_text_justlast = 0; - - $this->_fg_color = 0x40; - $this->_bg_color = 0x41; - - $this->_diag = 0; - - $this->_bottom_color = 0x40; - $this->_top_color = 0x40; - $this->_left_color = 0x40; - $this->_right_color = 0x40; - $this->_diag_color = 0x40; - $this->_style = $style; - - } - - - /** - * Generate an Excel BIFF XF record (style or cell). - * - * @param string $style The type of the XF record ('style' or 'cell'). - * @return string The XF record - */ - function writeXf() - { - // Set the type of the XF record and some of the attributes. - if ($this->_isStyleXf) { - $style = 0xFFF5; - } else { - $style = $this->_mapLocked($this->_style->getProtection()->getLocked()); - $style |= $this->_mapHidden($this->_style->getProtection()->getHidden()) << 1; - } - - // Flags to indicate if attributes have been set. - $atr_num = ($this->_numberFormatIndex != 0)?1:0; - $atr_fnt = ($this->_fontIndex != 0)?1:0; - $atr_alc = ((int) $this->_style->getAlignment()->getWrapText())?1:0; - $atr_bdr = ($this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) || - $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) || - $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) || - $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()))?1:0; - $atr_pat = (($this->_fg_color != 0x40) || - ($this->_bg_color != 0x41) || - $this->_mapFillType($this->_style->getFill()->getFillType()))?1:0; - $atr_prot = $this->_mapLocked($this->_style->getProtection()->getLocked()) - | $this->_mapHidden($this->_style->getProtection()->getHidden()); - - // Zero the default border colour if the border has not been set. - if ($this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) == 0) { - $this->_bottom_color = 0; - } - if ($this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) == 0) { - $this->_top_color = 0; - } - if ($this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) == 0) { - $this->_right_color = 0; - } - if ($this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) == 0) { - $this->_left_color = 0; - } - if ($this->_mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) == 0) { - $this->_diag_color = 0; - } - - $record = 0x00E0; // Record identifier - if ($this->_BIFFVersion == 0x0500) { - $length = 0x0010; // Number of bytes to follow - } - if ($this->_BIFFVersion == 0x0600) { - $length = 0x0014; - } - - $ifnt = $this->_fontIndex; // Index to FONT record - $ifmt = $this->_numberFormatIndex; // Index to FORMAT record - if ($this->_BIFFVersion == 0x0500) { - $align = $this->_mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment - $align |= (int) $this->_style->getAlignment()->getWrapText() << 3; - $align |= $this->_mapVAlign($this->_style->getAlignment()->getVertical()) << 4; - $align |= $this->_text_justlast << 7; - $align |= 0 << 8; // rotation - $align |= $atr_num << 10; - $align |= $atr_fnt << 11; - $align |= $atr_alc << 12; - $align |= $atr_bdr << 13; - $align |= $atr_pat << 14; - $align |= $atr_prot << 15; - - $icv = $this->_fg_color; // fg and bg pattern colors - $icv |= $this->_bg_color << 7; - - $fill = $this->_mapFillType($this->_style->getFill()->getFillType()); // Fill and border line style - $fill |= $this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 6; - $fill |= $this->_bottom_color << 9; - - $border1 = $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()); // Border line style and color - $border1 |= $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()) << 3; - $border1 |= $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 6; - $border1 |= $this->_top_color << 9; - - $border2 = $this->_left_color; // Border color - $border2 |= $this->_right_color << 7; - - $header = pack("vv", $record, $length); - $data = pack("vvvvvvvv", $ifnt, $ifmt, $style, $align, - $icv, $fill, - $border1, $border2); - } elseif ($this->_BIFFVersion == 0x0600) { - $align = $this->_mapHAlign($this->_style->getAlignment()->getHorizontal()); // Alignment - $align |= (int) $this->_style->getAlignment()->getWrapText() << 3; - $align |= $this->_mapVAlign($this->_style->getAlignment()->getVertical()) << 4; - $align |= $this->_text_justlast << 7; - - $used_attrib = $atr_num << 2; - $used_attrib |= $atr_fnt << 3; - $used_attrib |= $atr_alc << 4; - $used_attrib |= $atr_bdr << 5; - $used_attrib |= $atr_pat << 6; - $used_attrib |= $atr_prot << 7; - - $icv = $this->_fg_color; // fg and bg pattern colors - $icv |= $this->_bg_color << 7; - - $border1 = $this->_mapBorderStyle($this->_style->getBorders()->getLeft()->getBorderStyle()); // Border line style and color - $border1 |= $this->_mapBorderStyle($this->_style->getBorders()->getRight()->getBorderStyle()) << 4; - $border1 |= $this->_mapBorderStyle($this->_style->getBorders()->getTop()->getBorderStyle()) << 8; - $border1 |= $this->_mapBorderStyle($this->_style->getBorders()->getBottom()->getBorderStyle()) << 12; - $border1 |= $this->_left_color << 16; - $border1 |= $this->_right_color << 23; - - $diagonalDirection = $this->_style->getBorders()->getDiagonalDirection(); - $diag_tl_to_rb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH - || $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_DOWN; - $diag_tr_to_lb = $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_BOTH - || $diagonalDirection == PHPExcel_Style_Borders::DIAGONAL_UP; - $border1 |= $diag_tl_to_rb << 30; - $border1 |= $diag_tr_to_lb << 31; - - $border2 = $this->_top_color; // Border color - $border2 |= $this->_bottom_color << 7; - $border2 |= $this->_diag_color << 14; - $border2 |= $this->_mapBorderStyle($this->_style->getBorders()->getDiagonal()->getBorderStyle()) << 21; - $border2 |= $this->_mapFillType($this->_style->getFill()->getFillType()) << 26; - - $header = pack("vv", $record, $length); - - //BIFF8 options: identation, shrinkToFit and text direction - $biff8_options = $this->_style->getAlignment()->getIndent(); - $biff8_options |= (int) $this->_style->getAlignment()->getShrinkToFit() << 4; - - $data = pack("vvvC", $ifnt, $ifmt, $style, $align); - $data .= pack("CCC" - , $this->_mapTextRotation($this->_style->getAlignment()->getTextRotation()) - , $biff8_options - , $used_attrib - ); - $data .= pack("VVv", $border1, $border2, $icv); - } - - return($header . $data); - } - - /** - * Set BIFF version - * - * @param int $BIFFVersion - */ - public function setBIFFVersion($BIFFVersion) - { - $this->_BIFFVersion = $BIFFVersion; - } - - /** - * Is this a style XF ? - * - * @param boolean $value - */ - public function setIsStyleXf($value) - { - $this->_isStyleXf = $value; - } - - /** - * Sets the cell's bottom border color - * - * @access public - * @param int $colorIndex Color index - */ - function setBottomColor($colorIndex) - { - $this->_bottom_color = $colorIndex; - } - - /** - * Sets the cell's top border color - * - * @access public - * @param int $colorIndex Color index - */ - function setTopColor($colorIndex) - { - $this->_top_color = $colorIndex; - } - - /** - * Sets the cell's left border color - * - * @access public - * @param int $colorIndex Color index - */ - function setLeftColor($colorIndex) - { - $this->_left_color = $colorIndex; - } - - /** - * Sets the cell's right border color - * - * @access public - * @param int $colorIndex Color index - */ - function setRightColor($colorIndex) - { - $this->_right_color = $colorIndex; - } - - /** - * Sets the cell's diagonal border color - * - * @access public - * @param int $colorIndex Color index - */ - function setDiagColor($colorIndex) - { - $this->_diag_color = $colorIndex; - } - - - /** - * Sets the cell's foreground color - * - * @access public - * @param int $colorIndex Color index - */ - function setFgColor($colorIndex) - { - $this->_fg_color = $colorIndex; - } - - /** - * Sets the cell's background color - * - * @access public - * @param int $colorIndex Color index - */ - function setBgColor($colorIndex) - { - $this->_bg_color = $colorIndex; - } - - /** - * Sets the index to the number format record - * It can be date, time, currency, etc... - * - * @access public - * @param integer $numberFormatIndex Index to format record - */ - function setNumberFormatIndex($numberFormatIndex) - { - $this->_numberFormatIndex = $numberFormatIndex; - } - - /** - * Set the font index. - * - * @param int $value Font index, note that value 4 does not exist - */ - public function setFontIndex($value) - { - $this->_fontIndex = $value; - } - - /** - * Map border style - */ - private function _mapBorderStyle($borderStyle) { - switch ($borderStyle) { - case PHPExcel_Style_Border::BORDER_NONE: return 0x00; - case PHPExcel_Style_Border::BORDER_THIN; return 0x01; - case PHPExcel_Style_Border::BORDER_MEDIUM; return 0x02; - case PHPExcel_Style_Border::BORDER_DASHED; return 0x03; - case PHPExcel_Style_Border::BORDER_DOTTED; return 0x04; - case PHPExcel_Style_Border::BORDER_THICK; return 0x05; - case PHPExcel_Style_Border::BORDER_DOUBLE; return 0x06; - case PHPExcel_Style_Border::BORDER_HAIR; return 0x07; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHED; return 0x08; - case PHPExcel_Style_Border::BORDER_DASHDOT; return 0x09; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT; return 0x0A; - case PHPExcel_Style_Border::BORDER_DASHDOTDOT; return 0x0B; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT; return 0x0C; - case PHPExcel_Style_Border::BORDER_SLANTDASHDOT; return 0x0D; - default: return 0x00; - } - } - - /** - * Map fill type - */ - private function _mapFillType($fillType) { - switch ($fillType) { - case PHPExcel_Style_Fill::FILL_NONE: return 0x00; - case PHPExcel_Style_Fill::FILL_SOLID: return 0x01; - case PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY: return 0x02; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY: return 0x03; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY: return 0x04; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL: return 0x05; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL: return 0x06; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN: return 0x07; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKUP: return 0x08; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID: return 0x09; - case PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS: return 0x0A; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL: return 0x0B; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL: return 0x0C; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN: return 0x0D; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP: return 0x0E; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID: return 0x0F; - case PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS: return 0x10; - case PHPExcel_Style_Fill::FILL_PATTERN_GRAY125: return 0x11; - case PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625: return 0x12; - case PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR: // does not exist in BIFF8 - case PHPExcel_Style_Fill::FILL_GRADIENT_PATH: // does not exist in BIFF8 - default: return 0x00; - } - } - - /** - * Map to BIFF2-BIFF8 codes for horizontal alignment - * - * @param string $hAlign - * @return int - */ - private function _mapHAlign($hAlign) - { - switch ($hAlign) { - case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL: return 0; - case PHPExcel_Style_Alignment::HORIZONTAL_LEFT: return 1; - case PHPExcel_Style_Alignment::HORIZONTAL_CENTER: return 2; - case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT: return 3; - case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY: return 5; - case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS: return 6; - default: return 0; - } - } - - /** - * Map to BIFF2-BIFF8 codes for vertical alignment - * - * @param string $vAlign - * @return int - */ - private function _mapVAlign($vAlign) { - switch ($vAlign) { - case PHPExcel_Style_Alignment::VERTICAL_TOP: return 0; - case PHPExcel_Style_Alignment::VERTICAL_CENTER: return 1; - case PHPExcel_Style_Alignment::VERTICAL_BOTTOM: return 2; - case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY: return 3; - default: return 2; - } - } - - /** - * Map to BIFF8 codes for text rotation angle - * - * @param int $textRotation - * @return int - */ - private function _mapTextRotation($textRotation) { - if ($textRotation >= 0) { - return $textRotation; - } - if ($textRotation == -165) { - return 255; - } - if ($textRotation < 0) { - return 90 - $textRotation; - } - } - - /** - * Map locked - * - * @param string - * @return int - */ - private function _mapLocked($locked) { - switch ($locked) { - case PHPExcel_Style_Protection::PROTECTION_INHERIT: return 1; - case PHPExcel_Style_Protection::PROTECTION_PROTECTED: return 1; - case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED: return 0; - default: return 1; - } - } - - /** - * Map hidden - * - * @param string - * @return int - */ - private function _mapHidden($hidden) { - switch ($hidden) { - case PHPExcel_Style_Protection::PROTECTION_INHERIT: return 0; - case PHPExcel_Style_Protection::PROTECTION_PROTECTED: return 1; - case PHPExcel_Style_Protection::PROTECTION_UNPROTECTED: return 0; - default: return 0; - } - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/HTML.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/HTML.php deleted file mode 100644 index 3e7a9b15ee..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/HTML.php +++ /dev/null @@ -1,1345 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_HTML - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { - /** - * PHPExcel object - * - * @var PHPExcel - */ - protected $_phpExcel; - - /** - * Sheet index to write - * - * @var int - */ - private $_sheetIndex = 0; - - /** - * Pre-calculate formulas - * - * @var boolean - */ - private $_preCalculateFormulas = true; - - /** - * Images root - * - * @var string - */ - private $_imagesRoot = '.'; - - /** - * Use inline CSS? - * - * @var boolean - */ - private $_useInlineCss = false; - - /** - * Array of CSS styles - * - * @var array - */ - private $_cssStyles = null; - - /** - * Array of column widths in points - * - * @var array - */ - private $_columnWidths = null; - - /** - * Default font - * - * @var PHPExcel_Style_Font - */ - private $_defaultFont; - - /** - * Flag whether spans have been calculated - * - * @var boolean - */ - private $_spansAreCalculated = false; - - /** - * Excel cells that should not be written as HTML cells - * - * @var array - */ - private $_isSpannedCell = array(); - - /** - * Excel cells that are upper-left corner in a cell merge - * - * @var array - */ - private $_isBaseCell = array(); - - /** - * Excel rows that should not be written as HTML rows - * - * @var array - */ - private $_isSpannedRow = array(); - - /** - * Is the current writer creating PDF? - * - * @var boolean - */ - protected $_isPdf = false; - - /** - * Generate the Navigation block - * - * @var boolean - */ - private $_generateSheetNavigationBlock = true; - - /** - * Create a new PHPExcel_Writer_HTML - * - * @param PHPExcel $phpExcel PHPExcel object - */ - public function __construct(PHPExcel $phpExcel) { - $this->_phpExcel = $phpExcel; - $this->_defaultFont = $this->_phpExcel->getDefaultStyle()->getFont(); - } - - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null) { - // garbage collect - $this->_phpExcel->garbageCollect(); - - $saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog; - PHPExcel_Calculation::getInstance()->writeDebugLog = false; - $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); - PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); - - // Build CSS - $this->buildCSS(!$this->_useInlineCss); - - // Open file - $fileHandle = fopen($pFilename, 'wb+'); - if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); - } - - // Write headers - fwrite($fileHandle, $this->generateHTMLHeader(!$this->_useInlineCss)); - - // Write navigation (tabs) - if ((!$this->_isPdf) && ($this->_generateSheetNavigationBlock)) { - fwrite($fileHandle, $this->generateNavigation()); - } - - // Write data - fwrite($fileHandle, $this->generateSheetData()); - - // Write footer - fwrite($fileHandle, $this->generateHTMLFooter()); - - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); - PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog; - } - - /** - * Map VAlign - */ - private function _mapVAlign($vAlign) { - switch ($vAlign) { - case PHPExcel_Style_Alignment::VERTICAL_BOTTOM: return 'bottom'; - case PHPExcel_Style_Alignment::VERTICAL_TOP: return 'top'; - case PHPExcel_Style_Alignment::VERTICAL_CENTER: - case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY: return 'middle'; - default: return 'baseline'; - } - } - - /** - * Map HAlign - * - * @return string|false - */ - private function _mapHAlign($hAlign) { - switch ($hAlign) { - case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL: return false; - case PHPExcel_Style_Alignment::HORIZONTAL_LEFT: return 'left'; - case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT: return 'right'; - case PHPExcel_Style_Alignment::HORIZONTAL_CENTER: - case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS: return 'center'; - case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY: return 'justify'; - default: return false; - } - } - - /** - * Map border style - */ - private function _mapBorderStyle($borderStyle) { - switch ($borderStyle) { - case PHPExcel_Style_Border::BORDER_NONE: return '0px'; - case PHPExcel_Style_Border::BORDER_DASHDOT: return '1px dashed'; - case PHPExcel_Style_Border::BORDER_DASHDOTDOT: return '1px dotted'; - case PHPExcel_Style_Border::BORDER_DASHED: return '1px dashed'; - case PHPExcel_Style_Border::BORDER_DOTTED: return '1px dotted'; - case PHPExcel_Style_Border::BORDER_DOUBLE: return '3px double'; - case PHPExcel_Style_Border::BORDER_HAIR: return '1px solid'; - case PHPExcel_Style_Border::BORDER_MEDIUM: return '2px solid'; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT: return '2px dashed'; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT: return '2px dotted'; - case PHPExcel_Style_Border::BORDER_MEDIUMDASHED: return '2px dashed'; - case PHPExcel_Style_Border::BORDER_SLANTDASHDOT: return '2px dashed'; - case PHPExcel_Style_Border::BORDER_THICK: return '3px solid'; - case PHPExcel_Style_Border::BORDER_THIN: return '1px solid'; - default: return '1px solid'; // map others to thin - } - } - - /** - * Get sheet index - * - * @return int - */ - public function getSheetIndex() { - return $this->_sheetIndex; - } - - /** - * Set sheet index - * - * @param int $pValue Sheet index - * @return PHPExcel_Writer_HTML - */ - public function setSheetIndex($pValue = 0) { - $this->_sheetIndex = $pValue; - return $this; - } - - /** - * Get sheet index - * - * @return boolean - */ - public function getGenerateSheetNavigationBlock() { - return $this->_generateSheetNavigationBlock; - } - - /** - * Set sheet index - * - * @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not - * @return PHPExcel_Writer_HTML - */ - public function setGenerateSheetNavigationBlock($pValue = true) { - $this->_generateSheetNavigationBlock = (bool) $pValue; - return $this; - } - - /** - * Write all sheets (resets sheetIndex to NULL) - */ - public function writeAllSheets() { - $this->_sheetIndex = null; - return $this; - } - - /** - * Generate HTML header - * - * @param boolean $pIncludeStyles Include styles? - * @return string - * @throws Exception - */ - public function generateHTMLHeader($pIncludeStyles = false) { - // PHPExcel object known? - if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); - } - - // Construct HTML - $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL; - $html .= '<!-- Generated by PHPExcel - http://www.phpexcel.net -->' . PHP_EOL; - $html .= '<html>' . PHP_EOL; - $html .= ' <head>' . PHP_EOL; - $html .= ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . PHP_EOL; - $html .= ' <title>' . htmlspecialchars($this->_phpExcel->getProperties()->getTitle()) . '</title>' . PHP_EOL; - if ($pIncludeStyles) { - $html .= $this->generateStyles(true); - } - $html .= ' </head>' . PHP_EOL; - $html .= '' . PHP_EOL; - $html .= ' <body>' . PHP_EOL; - - // Return - return $html; - } - - /** - * Generate sheet data - * - * @return string - * @throws Exception - */ - public function generateSheetData() { - // PHPExcel object known? - if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); - } - - // Ensure that Spans have been calculated? - if (!$this->_spansAreCalculated) { - $this->_calculateSpans(); - } - - // Fetch sheets - $sheets = array(); - if (is_null($this->_sheetIndex)) { - $sheets = $this->_phpExcel->getAllSheets(); - } else { - $sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex); - } - - // Construct HTML - $html = ''; - - // Loop all sheets - $sheetId = 0; - foreach ($sheets as $sheet) { - // Write table header - $html .= $this->_generateTableHeader($sheet); - - // Get worksheet dimension - $dimension = explode(':', $sheet->calculateWorksheetDimension()); - $dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]); - $dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1; - $dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]); - $dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1; - - // row min,max - $rowMin = $dimension[0][1]; - $rowMax = $dimension[1][1]; - - // calculate start of <tbody>, <thead> - $tbodyStart = $rowMin; - $tbodyEnd = $rowMax; - $theadStart = $theadEnd = 0; // default: no <thead> no </thead> - if ($sheet->getPageSetup()->isRowsToRepeatAtTopSet()) { - $rowsToRepeatAtTop = $sheet->getPageSetup()->getRowsToRepeatAtTop(); - - // we can only support repeating rows that start at top row - if ($rowsToRepeatAtTop[0] == 1) { - $theadStart = $rowsToRepeatAtTop[0]; - $theadEnd = $rowsToRepeatAtTop[1]; - $tbodyStart = $rowsToRepeatAtTop[1] + 1; - } - } - - // Loop through cells - $row = $rowMin-1; - while($row++ < $rowMax) { - // <thead> ? - if ($row == $theadStart) { - $html .= ' <thead>' . PHP_EOL; - } - - // <tbody> ? - if ($row == $tbodyStart) { - $html .= ' <tbody>' . PHP_EOL; - } - - // Write row if there are HTML table cells in it - if ( !isset($this->_isSpannedRow[$sheet->getParent()->getIndex($sheet)][$row]) ) { - // Start a new rowData - $rowData = array(); - // Loop through columns - $column = $dimension[0][0] - 1; - while($column++ < $dimension[1][0]) { - // Cell exists? - if ($sheet->cellExistsByColumnAndRow($column, $row)) { - $rowData[$column] = $sheet->getCellByColumnAndRow($column, $row); - } else { - $rowData[$column] = ''; - } - } - $html .= $this->_generateRow($sheet, $rowData, $row - 1); - } - - // </thead> ? - if ($row == $theadEnd) { - $html .= ' </thead>' . PHP_EOL; - } - - // </tbody> ? - if ($row == $tbodyEnd) { - $html .= ' </tbody>' . PHP_EOL; - } - } - - // Write table footer - $html .= $this->_generateTableFooter(); - - // Writing PDF? - if ($this->_isPdf) { - if (is_null($this->_sheetIndex) && $sheetId + 1 < $this->_phpExcel->getSheetCount()) { - $html .= '<div style="page-break-before:always" />'; - } - } - - // Next sheet - ++$sheetId; - } - - // Return - return $html; - } - - /** - * Generate sheet tabs - * - * @return string - * @throws Exception - */ - public function generateNavigation() - { - // PHPExcel object known? - if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); - } - - // Fetch sheets - $sheets = array(); - if (is_null($this->_sheetIndex)) { - $sheets = $this->_phpExcel->getAllSheets(); - } else { - $sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex); - } - - // Construct HTML - $html = ''; - - // Only if there are more than 1 sheets - if (count($sheets) > 1) { - // Loop all sheets - $sheetId = 0; - - $html .= '<ul class="navigation">' . PHP_EOL; - - foreach ($sheets as $sheet) { - $html .= ' <li class="sheet' . $sheetId . '"><a href="#sheet' . $sheetId . '">' . $sheet->getTitle() . '</a></li>' . PHP_EOL; - ++$sheetId; - } - - $html .= '</ul>' . PHP_EOL; - } - - return $html; - } - - /** - * Generate image tag in cell - * - * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet - * @param string $coordinates Cell coordinates - * @return string - * @throws Exception - */ - private function _writeImageTagInCell(PHPExcel_Worksheet $pSheet, $coordinates) { - // Construct HTML - $html = ''; - - // Write images - foreach ($pSheet->getDrawingCollection() as $drawing) { - if ($drawing instanceof PHPExcel_Worksheet_Drawing) { - if ($drawing->getCoordinates() == $coordinates) { - $filename = $drawing->getPath(); - - // Strip off eventual '.' - if (substr($filename, 0, 1) == '.') { - $filename = substr($filename, 1); - } - - // Prepend images root - $filename = $this->getImagesRoot() . $filename; - - // Strip off eventual '.' - if (substr($filename, 0, 1) == '.' && substr($filename, 0, 2) != './') { - $filename = substr($filename, 1); - } - - // Convert UTF8 data to PCDATA - $filename = htmlspecialchars($filename); - - $html .= PHP_EOL; - $html .= ' <img style="position: relative; left: ' . $drawing->getOffsetX() . 'px; top: ' . $drawing->getOffsetY() . 'px; width: ' . $drawing->getWidth() . 'px; height: ' . $drawing->getHeight() . 'px;" src="' . $filename . '" border="0" width="' . $drawing->getWidth() . '" height="' . $drawing->getHeight() . '" />' . PHP_EOL; - } - } - } - - // Return - return $html; - } - - /** - * Generate CSS styles - * - * @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>) - * @return string - * @throws Exception - */ - public function generateStyles($generateSurroundingHTML = true) { - // PHPExcel object known? - if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); - } - - // Build CSS - $css = $this->buildCSS($generateSurroundingHTML); - - // Construct HTML - $html = ''; - - // Start styles - if ($generateSurroundingHTML) { - $html .= ' <style type="text/css">' . PHP_EOL; - $html .= ' html { ' . $this->_assembleCSS($css['html']) . ' }' . PHP_EOL; - } - - // Write all other styles - foreach ($css as $styleName => $styleDefinition) { - if ($styleName != 'html') { - $html .= ' ' . $styleName . ' { ' . $this->_assembleCSS($styleDefinition) . ' }' . PHP_EOL; - } - } - - // End styles - if ($generateSurroundingHTML) { - $html .= ' </style>' . PHP_EOL; - } - - // Return - return $html; - } - - /** - * Build CSS styles - * - * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { }) - * @return array - * @throws Exception - */ - public function buildCSS($generateSurroundingHTML = true) { - // PHPExcel object known? - if (is_null($this->_phpExcel)) { - throw new Exception('Internal PHPExcel object not set to an instance of an object.'); - } - - // Cached? - if (!is_null($this->_cssStyles)) { - return $this->_cssStyles; - } - - // Ensure that spans have been calculated - if (!$this->_spansAreCalculated) { - $this->_calculateSpans(); - } - - // Construct CSS - $css = array(); - - // Start styles - if ($generateSurroundingHTML) { - // html { } - $css['html']['font-family'] = 'Calibri, Arial, Helvetica, sans-serif'; - $css['html']['font-size'] = '11pt'; - $css['html']['background-color'] = 'white'; - } - - - // table { } - $css['table']['border-collapse'] = 'collapse'; - $css['table']['page-break-after'] = 'always'; - - // .gridlines td { } - $css['.gridlines td']['border'] = '1px dotted black'; - - // .b {} - $css['.b']['text-align'] = 'center'; // BOOL - - // .e {} - $css['.e']['text-align'] = 'center'; // ERROR - - // .f {} - $css['.f']['text-align'] = 'right'; // FORMULA - - // .inlineStr {} - $css['.inlineStr']['text-align'] = 'left'; // INLINE - - // .n {} - $css['.n']['text-align'] = 'right'; // NUMERIC - - // .s {} - $css['.s']['text-align'] = 'left'; // STRING - - // Calculate cell style hashes - foreach ($this->_phpExcel->getCellXfCollection() as $index => $style) { - $css['td.style' . $index] = $this->_createCSSStyle( $style ); - } - - // Fetch sheets - $sheets = array(); - if (is_null($this->_sheetIndex)) { - $sheets = $this->_phpExcel->getAllSheets(); - } else { - $sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex); - } - - // Build styles per sheet - foreach ($sheets as $sheet) { - // Calculate hash code - $sheetIndex = $sheet->getParent()->getIndex($sheet); - - // Build styles - // Calculate column widths - $sheet->calculateColumnWidths(); - - // col elements, initialize - $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()) - 1; - $column = -1; - while($column++ < $highestColumnIndex) { - $this->_columnWidths[$sheetIndex][$column] = 42; // approximation - $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = '42pt'; - } - - // col elements, loop through columnDimensions and set width - foreach ($sheet->getColumnDimensions() as $columnDimension) { - if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->_defaultFont)) >= 0) { - $width = PHPExcel_Shared_Drawing::pixelsToPoints($width); - $column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1; - $this->_columnWidths[$sheetIndex][$column] = $width; - $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt'; - - if ($columnDimension->getVisible() === false) { - $css['table.sheet' . $sheetIndex . ' col.col' . $column]['visibility'] = 'collapse'; - $css['table.sheet' . $sheetIndex . ' col.col' . $column]['*display'] = 'none'; // target IE6+7 - } - } - } - - // Default row height - $rowDimension = $sheet->getDefaultRowDimension(); - - // table.sheetN tr { } - $css['table.sheet' . $sheetIndex . ' tr'] = array(); - - if ($rowDimension->getRowHeight() == -1) { - $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont()); - } else { - $pt_height = $rowDimension->getRowHeight(); - } - $css['table.sheet' . $sheetIndex . ' tr']['height'] = $pt_height . 'pt'; - if ($rowDimension->getVisible() === false) { - $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none'; - $css['table.sheet' . $sheetIndex . ' tr']['visibility'] = 'hidden'; - } - - // Calculate row heights - foreach ($sheet->getRowDimensions() as $rowDimension) { - $row = $rowDimension->getRowIndex() - 1; - - // table.sheetN tr.rowYYYYYY { } - $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array(); - - if ($rowDimension->getRowHeight() == -1) { - $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont()); - } else { - $pt_height = $rowDimension->getRowHeight(); - } - $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['height'] = $pt_height . 'pt'; - if ($rowDimension->getVisible() === false) { - $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['display'] = 'none'; - $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['visibility'] = 'hidden'; - } - } - } - - // Cache - if (is_null($this->_cssStyles)) { - $this->_cssStyles = $css; - } - - // Return - return $css; - } - - /** - * Create CSS style - * - * @param PHPExcel_Style $pStyle PHPExcel_Style - * @return array - */ - private function _createCSSStyle(PHPExcel_Style $pStyle) { - // Construct CSS - $css = ''; - - // Create CSS - $css = array_merge( - $this->_createCSSStyleAlignment($pStyle->getAlignment()) - , $this->_createCSSStyleBorders($pStyle->getBorders()) - , $this->_createCSSStyleFont($pStyle->getFont()) - , $this->_createCSSStyleFill($pStyle->getFill()) - ); - - // Return - return $css; - } - - /** - * Create CSS style (PHPExcel_Style_Alignment) - * - * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment - * @return array - */ - private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) { - // Construct CSS - $css = array(); - - // Create CSS - $css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical()); - if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) { - $css['text-align'] = $textAlign; - } - - // Return - return $css; - } - - /** - * Create CSS style (PHPExcel_Style_Font) - * - * @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font - * @return array - */ - private function _createCSSStyleFont(PHPExcel_Style_Font $pStyle) { - // Construct CSS - $css = array(); - - // Create CSS - if ($pStyle->getBold()) { - $css['font-weight'] = 'bold'; - } - if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) { - $css['text-decoration'] = 'underline line-through'; - } else if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) { - $css['text-decoration'] = 'underline'; - } else if ($pStyle->getStrikethrough()) { - $css['text-decoration'] = 'line-through'; - } - if ($pStyle->getItalic()) { - $css['font-style'] = 'italic'; - } - - $css['color'] = '#' . $pStyle->getColor()->getRGB(); - $css['font-family'] = '\'' . $pStyle->getName() . '\''; - $css['font-size'] = $pStyle->getSize() . 'pt'; - - // Return - return $css; - } - - /** - * Create CSS style (PHPExcel_Style_Borders) - * - * @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders - * @return array - */ - private function _createCSSStyleBorders(PHPExcel_Style_Borders $pStyle) { - // Construct CSS - $css = array(); - - // Create CSS - $css['border-bottom'] = $this->_createCSSStyleBorder($pStyle->getBottom()); - $css['border-top'] = $this->_createCSSStyleBorder($pStyle->getTop()); - $css['border-left'] = $this->_createCSSStyleBorder($pStyle->getLeft()); - $css['border-right'] = $this->_createCSSStyleBorder($pStyle->getRight()); - - // Return - return $css; - } - - /** - * Create CSS style (PHPExcel_Style_Border) - * - * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border - * @return string - */ - private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) { - // Construct HTML - $css = ''; - - // Create CSS - $css .= $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB(); - - // Return - return $css; - } - - /** - * Create CSS style (PHPExcel_Style_Fill) - * - * @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill - * @return array - */ - private function _createCSSStyleFill(PHPExcel_Style_Fill $pStyle) { - // Construct HTML - $css = array(); - - // Create CSS - $value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ? - 'white' : '#' . $pStyle->getStartColor()->getRGB(); - $css['background-color'] = $value; - - // Return - return $css; - } - - /** - * Generate HTML footer - */ - public function generateHTMLFooter() { - // Construct HTML - $html = ''; - $html .= ' </body>' . PHP_EOL; - $html .= '</html>' . PHP_EOL; - - // Return - return $html; - } - - /** - * Generate table header - * - * @param PHPExcel_Worksheet $pSheet The worksheet for the table we are writing - * @return string - * @throws Exception - */ - private function _generateTableHeader($pSheet) { - $sheetIndex = $pSheet->getParent()->getIndex($pSheet); - - // Construct HTML - $html = ''; - - if (!$this->_useInlineCss) { - $gridlines = $pSheet->getShowGridLines() ? ' gridlines' : ''; - $html .= ' <table border="0" cellpadding="0" cellspacing="0" id="sheet' . $sheetIndex . '" class="sheet' . $sheetIndex . $gridlines . '">' . PHP_EOL; - } else { - $style = isset($this->_cssStyles['table']) ? - $this->_assembleCSS($this->_cssStyles['table']) : ''; - - if ($this->_isPdf && $pSheet->getShowGridLines()) { - $html .= ' <table border="1" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="4" style="' . $style . '">' . PHP_EOL; - } else { - $html .= ' <table border="0" cellpadding="1" id="sheet' . $sheetIndex . '" cellspacing="4" style="' . $style . '">' . PHP_EOL; - } - } - - // Write <col> elements - $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1; - $i = -1; - while($i++ < $highestColumnIndex) { - if (!$this->_useInlineCss) { - $html .= ' <col class="col' . $i . '">' . PHP_EOL; - } else { - $style = isset($this->_cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) ? - $this->_assembleCSS($this->_cssStyles['table.sheet' . $sheetIndex . ' col.col' . $i]) : ''; - $html .= ' <col style="' . $style . '">' . PHP_EOL; - } - } - - // Return - return $html; - } - - /** - * Generate table footer - * - * @throws Exception - */ - private function _generateTableFooter() { - // Construct HTML - $html = ''; - $html .= ' </table>' . PHP_EOL; - - // Return - return $html; - } - - /** - * Generate row - * - * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet - * @param array $pValues Array containing cells in a row - * @param int $pRow Row number (0-based) - * @return string - * @throws Exception - */ - private function _generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0) { - if (is_array($pValues)) { - // Construct HTML - $html = ''; - - // Sheet index - $sheetIndex = $pSheet->getParent()->getIndex($pSheet); - - // DomPDF and breaks - if ($this->_isPdf && count($pSheet->getBreaks()) > 0) { - $breaks = $pSheet->getBreaks(); - - // check if a break is needed before this row - if (isset($breaks['A' . $pRow])) { - // close table: </table> - $html .= $this->_generateTableFooter(); - - // insert page break - $html .= '<div style="page-break-before:always" />'; - - // open table again: <table> + <col> etc. - $html .= $this->_generateTableHeader($pSheet); - } - } - - // Write row start - if (!$this->_useInlineCss) { - $html .= ' <tr class="row' . $pRow . '">' . PHP_EOL; - } else { - $style = isset($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) - ? $this->_assembleCSS($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : ''; - - $html .= ' <tr style="' . $style . '">' . PHP_EOL; - } - - // Write cells - $colNum = 0; - foreach ($pValues as $cell) { - $coordinate = PHPExcel_Cell::stringFromColumnIndex($colNum) . ($pRow + 1); - - if (!$this->_useInlineCss) { - $cssClass = ''; - $cssClass = 'column' . $colNum; - } else { - $cssClass = array(); - if (isset($this->_cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) { - $this->_cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum]; - } - } - $colSpan = 1; - $rowSpan = 1; - - // initialize - $cellData = ''; - - // PHPExcel_Cell - if ($cell instanceof PHPExcel_Cell) { - if (is_null($cell->getParent())) { - $cell->attach($pSheet); - } - // Value - if ($cell->getValue() instanceof PHPExcel_RichText) { - // Loop through rich text elements - $elements = $cell->getValue()->getRichTextElements(); - foreach ($elements as $element) { - // Rich text start? - if ($element instanceof PHPExcel_RichText_Run) { - $cellData .= '<span style="' . $this->_assembleCSS($this->_createCSSStyleFont($element->getFont())) . '">'; - - if ($element->getFont()->getSuperScript()) { - $cellData .= '<sup>'; - } else if ($element->getFont()->getSubScript()) { - $cellData .= '<sub>'; - } - } - - // Convert UTF8 data to PCDATA - $cellText = $element->getText(); - $cellData .= htmlspecialchars($cellText); - - if ($element instanceof PHPExcel_RichText_Run) { - if ($element->getFont()->getSuperScript()) { - $cellData .= '</sup>'; - } else if ($element->getFont()->getSubScript()) { - $cellData .= '</sub>'; - } - - $cellData .= '</span>'; - } - } - } else { - if ($this->_preCalculateFormulas) { - $cellData = PHPExcel_Style_NumberFormat::toFormattedString( - $cell->getCalculatedValue(), - $pSheet->getParent()->getCellXfByIndex( $cell->getXfIndex() )->getNumberFormat()->getFormatCode(), - array($this, 'formatColor') - ); - } else { - $cellData = PHPExcel_Style_NumberFormat::ToFormattedString( - $cell->getValue(), - $pSheet->getParent()->getCellXfByIndex( $cell->getXfIndex() )->getNumberFormat()->getFormatCode(), - array($this, 'formatColor') - ); - } - if ($pSheet->getParent()->getCellXfByIndex( $cell->getXfIndex() )->getFont()->getSuperScript()) { - $cellData = '<sup>'.$cellData.'</sup>'; - } elseif ($pSheet->getParent()->getCellXfByIndex( $cell->getXfIndex() )->getFont()->getSubScript()) { - $cellData = '<sub>'.$cellData.'</sub>'; - } - } - - // Converts the cell content so that spaces occuring at beginning of each new line are replaced by &nbsp; - // Example: " Hello\n to the world" is converted to "&nbsp;&nbsp;Hello\n&nbsp;to the world" - $cellData = preg_replace("/(?m)(?:^|\\G) /", '&nbsp;', $cellData); - - // convert newline "\n" to '<br>' - $cellData = nl2br($cellData); - - // Extend CSS class? - if (!$this->_useInlineCss) { - $cssClass .= ' style' . $cell->getXfIndex(); - $cssClass .= ' ' . $cell->getDataType(); - } else { - if (isset($this->_cssStyles['td.style' . $cell->getXfIndex()])) { - $cssClass = array_merge($cssClass, $this->_cssStyles['td.style' . $cell->getXfIndex()]); - } - - // General horizontal alignment: Actual horizontal alignment depends on dataType - $sharedStyle = $pSheet->getParent()->getCellXfByIndex( $cell->getXfIndex() ); - if ($sharedStyle->getAlignment()->getHorizontal() == PHPExcel_Style_Alignment::HORIZONTAL_GENERAL - && isset($this->_cssStyles['.' . $cell->getDataType()]['text-align'])) - { - $cssClass['text-align'] = $this->_cssStyles['.' . $cell->getDataType()]['text-align']; - } - } - } - - // Hyperlink? - if ($pSheet->hyperlinkExists($coordinate) && !$pSheet->getHyperlink($coordinate)->isInternal()) { - $cellData = '<a href="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getUrl()) . '" title="' . htmlspecialchars($pSheet->getHyperlink($coordinate)->getTooltip()) . '">' . $cellData . '</a>'; - } - - // Should the cell be written or is it swallowed by a rowspan or colspan? - $writeCell = ! ( isset($this->_isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]) - && $this->_isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum] ); - - // Colspan and Rowspan - $colspan = 1; - $rowspan = 1; - if (isset($this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) { - $spans = $this->_isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]; - $rowSpan = $spans['rowspan']; - $colSpan = $spans['colspan']; - } - - // Write - if ($writeCell) { - // Column start - $html .= ' <td'; - if (!$this->_useInlineCss) { - $html .= ' class="' . $cssClass . '"'; - } else { - //** Necessary redundant code for the sake of PHPExcel_Writer_PDF ** - // We must explicitly write the width of the <td> element because TCPDF - // does not recognize e.g. <col style="width:42pt"> - $width = 0; - $i = $colNum - 1; - $e = $colNum + $colSpan - 1; - while($i++ < $e) { - if (isset($this->_columnWidths[$sheetIndex][$i])) { - $width += $this->_columnWidths[$sheetIndex][$i]; - } - } - $cssClass['width'] = $width . 'pt'; - - // We must also explicitly write the height of the <td> element because TCPDF - // does not recognize e.g. <tr style="height:50pt"> - if (isset($this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) { - $height = $this->_cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height']; - $cssClass['height'] = $height; - } - //** end of redundant code ** - - $html .= ' style="' . $this->_assembleCSS($cssClass) . '"'; - } - if ($colSpan > 1) { - $html .= ' colspan="' . $colSpan . '"'; - } - if ($rowSpan > 1) { - $html .= ' rowspan="' . $rowSpan . '"'; - } - $html .= '>'; - - // Image? - $html .= $this->_writeImageTagInCell($pSheet, $coordinate); - - // Cell data - $html .= $cellData; - - // Column end - $html .= '</td>' . PHP_EOL; - } - - // Next column - ++$colNum; - } - - // Write row end - $html .= ' </tr>' . PHP_EOL; - - // Return - return $html; - } else { - throw new Exception("Invalid parameters passed."); - } - } - - /** - * Takes array where of CSS properties / values and converts to CSS string - * - * @param array - * @return string - */ - private function _assembleCSS($pValue = array()) - { - $pairs = array(); - foreach ($pValue as $property => $value) { - $pairs[] = $property . ':' . $value; - } - $string = implode('; ', $pairs); - - return $string; - } - - /** - * Get Pre-Calculate Formulas - * - * @return boolean - */ - public function getPreCalculateFormulas() { - return $this->_preCalculateFormulas; - } - - /** - * Set Pre-Calculate Formulas - * - * @param boolean $pValue Pre-Calculate Formulas? - * @return PHPExcel_Writer_HTML - */ - public function setPreCalculateFormulas($pValue = true) { - $this->_preCalculateFormulas = $pValue; - return $this; - } - - /** - * Get images root - * - * @return string - */ - public function getImagesRoot() { - return $this->_imagesRoot; - } - - /** - * Set images root - * - * @param string $pValue - * @return PHPExcel_Writer_HTML - */ - public function setImagesRoot($pValue = '.') { - $this->_imagesRoot = $pValue; - return $this; - } - - /** - * Get use inline CSS? - * - * @return boolean - */ - public function getUseInlineCss() { - return $this->_useInlineCss; - } - - /** - * Set use inline CSS? - * - * @param boolean $pValue - * @return PHPExcel_Writer_HTML - */ - public function setUseInlineCss($pValue = false) { - $this->_useInlineCss = $pValue; - return $this; - } - - /** - * Add color to formatted string as inline style - * - * @param string $pValue Plain formatted value without color - * @param string $pFormat Format code - * @return string - */ - public function formatColor($pValue, $pFormat) - { - // Color information, e.g. [Red] is always at the beginning - $color = null; // initialize - $matches = array(); - - $color_regex = '/^\\[[a-zA-Z]+\\]/'; - if (preg_match($color_regex, $pFormat, $matches)) { - $color = str_replace('[', '', $matches[0]); - $color = str_replace(']', '', $color); - $color = strtolower($color); - } - - // convert to PCDATA - $value = htmlspecialchars($pValue); - - // color span tag - if ($color !== null) { - $value = '<span style="color:' . $color . '">' . $value . '</span>'; - } - - return $value; - } - - /** - * Calculate information about HTML colspan and rowspan which is not always the same as Excel's - */ - private function _calculateSpans() - { - // Identify all cells that should be omitted in HTML due to cell merge. - // In HTML only the upper-left cell should be written and it should have - // appropriate rowspan / colspan attribute - $sheetIndexes = $this->_sheetIndex !== null ? - array($this->_sheetIndex) : range(0, $this->_phpExcel->getSheetCount() - 1); - - foreach ($sheetIndexes as $sheetIndex) { - $sheet = $this->_phpExcel->getSheet($sheetIndex); - - $candidateSpannedRow = array(); - - // loop through all Excel merged cells - foreach ($sheet->getMergeCells() as $cells) { - list($cells, ) = PHPExcel_Cell::splitRange($cells); - $first = $cells[0]; - $last = $cells[1]; - - list($fc, $fr) = PHPExcel_Cell::coordinateFromString($first); - $fc = PHPExcel_Cell::columnIndexFromString($fc) - 1; - - list($lc, $lr) = PHPExcel_Cell::coordinateFromString($last); - $lc = PHPExcel_Cell::columnIndexFromString($lc) - 1; - - // loop through the individual cells in the individual merge - $r = $fr - 1; - while($r++ < $lr) { - // also, flag this row as a HTML row that is candidate to be omitted - $candidateSpannedRow[$r] = $r; - - $c = $fc - 1; - while($c++ < $lc) { - if ( !($c == $fc && $r == $fr) ) { - // not the upper-left cell (should not be written in HTML) - $this->_isSpannedCell[$sheetIndex][$r][$c] = array( - 'baseCell' => array($fr, $fc), - ); - } else { - // upper-left is the base cell that should hold the colspan/rowspan attribute - $this->_isBaseCell[$sheetIndex][$r][$c] = array( - 'xlrowspan' => $lr - $fr + 1, // Excel rowspan - 'rowspan' => $lr - $fr + 1, // HTML rowspan, value may change - 'xlcolspan' => $lc - $fc + 1, // Excel colspan - 'colspan' => $lc - $fc + 1, // HTML colspan, value may change - ); - } - } - } - } - - // Identify which rows should be omitted in HTML. These are the rows where all the cells - // participate in a merge and the where base cells are somewhere above. - $countColumns = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()); - foreach ($candidateSpannedRow as $rowIndex) { - if (isset($this->_isSpannedCell[$sheetIndex][$rowIndex])) { - if (count($this->_isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) { - $this->_isSpannedRow[$sheetIndex][$rowIndex] = $rowIndex; - }; - } - } - - // For each of the omitted rows we found above, the affected rowspans should be subtracted by 1 - if ( isset($this->_isSpannedRow[$sheetIndex]) ) { - foreach ($this->_isSpannedRow[$sheetIndex] as $rowIndex) { - $adjustedBaseCells = array(); - $c = -1; - $e = $countColumns - 1; - while($c++ < $e) { - $baseCell = $this->_isSpannedCell[$sheetIndex][$rowIndex][$c]['baseCell']; - - if ( !in_array($baseCell, $adjustedBaseCells) ) { - // subtract rowspan by 1 - --$this->_isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan']; - $adjustedBaseCells[] = $baseCell; - } - } - } - } - - // TODO: Same for columns - } - - // We have calculated the spans - $this->_spansAreCalculated = true; - } - -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/IWriter.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/IWriter.php deleted file mode 100644 index 97fd2cae67..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/IWriter.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** - * PHPExcel_Writer_IWriter - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -interface PHPExcel_Writer_IWriter -{ - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null); -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/PDF.php b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/PDF.php deleted file mode 100644 index 43bd1283f8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Writer/PDF.php +++ /dev/null @@ -1,328 +0,0 @@ -<?php -/** - * PHPExcel - * - * Copyright (c) 2006 - 2011 PHPExcel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL - * @version 1.7.6, 2011-02-27 - */ - - -/** Require FPDF library */ -$k_path_url = dirname(__FILE__) . '/PDF'; -require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PDF/tcpdf.php'; - -/** - * PHPExcel_Writer_PDF - * - * @category PHPExcel - * @package PHPExcel_Writer - * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) - */ -class PHPExcel_Writer_PDF extends PHPExcel_Writer_HTML implements PHPExcel_Writer_IWriter { - /** - * Temporary storage directory - * - * @var string - */ - private $_tempDir = ''; - - /** - * Font - * - * @var string - */ - private $_font = 'freesans'; - - /** - * Orientation (Over-ride) - * - * @var string - */ - private $_orientation = null; - - /** - * Paper size (Over-ride) - * - * @var int - */ - private $_paperSize = null; - - - /** - * Paper Sizes xRef List - * - * @var array - */ - private static $_paperSizes = array( - // Excel Paper Size TCPDF Paper Size - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER => 'LETTER', // (8.5 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER', // (8.5 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID => array(792.00,1224.00), // (11 in. by 17 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEDGER => array(1224.00,792.00), // (17 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL => 'LEGAL', // (8.5 in. by 14 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STATEMENT => array(396.00,612.00), // (5.5 in. by 8.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE', // (7.25 in. by 10.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3 => 'A3', // (297 mm by 420 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4 => 'A4', // (210 mm by 297 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_SMALL => 'A4', // (210 mm by 297 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5 => 'A5', // (148 mm by 210 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4 => 'B4', // (250 mm by 353 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5 => 'B5', // (176 mm by 250 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_FOLIO => 'FOLIO', // (8.5 in. by 13 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_QUARTO => array(609.45,779.53), // (215 mm by 275 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_1 => array(720.00,1008.00), // (10 in. by 14 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_2 => array(792.00,1224.00), // (11 in. by 17 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NOTE => 'LETTER', // (8.5 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO9_ENVELOPE => array(279.00,639.00), // (3.875 in. by 8.875 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO10_ENVELOPE => array(297.00,684.00), // (4.125 in. by 9.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO11_ENVELOPE => array(324.00,747.00), // (4.5 in. by 10.375 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO12_ENVELOPE => array(342.00,792.00), // (4.75 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO14_ENVELOPE => array(360.00,828.00), // (5 in. by 11.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C => array(1224.00,1584.00), // (17 in. by 22 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_D => array(1584.00,2448.00), // (22 in. by 34 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_E => array(2448.00,3168.00), // (34 in. by 44 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_DL_ENVELOPE => array(311.81,623.62), // (110 mm by 220 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5', // (162 mm by 229 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3', // (324 mm by 458 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4', // (229 mm by 324 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6', // (114 mm by 162 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_C65_ENVELOPE => array(323.15,649.13), // (114 mm by 229 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4', // (250 mm by 353 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5', // (176 mm by 250 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_B6_ENVELOPE => array(498.90,354.33), // (176 mm by 125 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_ITALY_ENVELOPE => array(311.81,651.97), // (110 mm by 230 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_MONARCH_ENVELOPE => array(279.00,540.00), // (3.875 in. by 7.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_6_3_4_ENVELOPE => array(261.00,468.00), // (3.625 in. by 6.5 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => array(1071.00,792.00), // (14.875 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => array(612.00,864.00), // (8.5 in. by 12 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO', // (8.5 in. by 13 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B4 => 'B4', // (250 mm by 353 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => array(566.93,419.53), // (200 mm by 148 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_1 => array(648.00,792.00), // (9 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_2 => array(720.00,792.00), // (10 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_3 => array(1080.00,792.00), // (15 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_INVITE_ENVELOPE => array(623.62,623.62), // (220 mm by 220 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => array(667.80,864.00), // (9.275 in. by 12 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => array(667.80,1080.00), // (9.275 in. by 15 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => array(841.68,1296.00), // (11.69 in. by 18 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_EXTRA_PAPER => array(668.98,912.76), // (236 mm by 322 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => array(595.80,792.00), // (8.275 in. by 11 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4', // (210 mm by 297 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => array(667.80,864.00), // (9.275 in. by 12 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => array(643.46,1009.13), // (227 mm by 356 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => array(864.57,1380.47), // (305 mm by 487 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => array(612.00,913.68), // (8.5 in. by 12.69 in.) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_PLUS_PAPER => array(595.28,935.43), // (210 mm by 330 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5', // (148 mm by 210 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => array(515.91,728.50), // (182 mm by 257 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_PAPER => array(912.76,1261.42), // (322 mm by 445 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_EXTRA_PAPER => array(493.23,666.14), // (174 mm by 235 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => array(569.76,782.36), // (201 mm by 276 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER => 'A2', // (420 mm by 594 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3', // (297 mm by 420 mm) - PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => array(912.76,1261.42) // (322 mm by 445 mm) - ); - - /** - * Create a new PHPExcel_Writer_PDF - * - * @param PHPExcel $phpExcel PHPExcel object - */ - public function __construct(PHPExcel $phpExcel) { - parent::__construct($phpExcel); - $this->setUseInlineCss(true); - $this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); - } - - /** - * Set font. Examples: - * 'arialunicid0-chinese-simplified' - * 'arialunicid0-chinese-traditional' - * 'arialunicid0-korean' - * 'arialunicid0-japanese' - * - * @param string $fontName - */ - public function setFont($fontName) { - $this->_font = $fontName; - return $this; - } - - /** - * Get Paper Size - * - * @return int - */ - public function getPaperSize() { - return $this->_paperSize; - } - - /** - * Set Paper Size - * - * @param int $pValue - * @return PHPExcel_Writer_PDF - */ - public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) { - $this->_paperSize = $pValue; - return $this; - } - - /** - * Get Orientation - * - * @return string - */ - public function getOrientation() { - return $this->_orientation; - } - - /** - * Set Orientation - * - * @param string $pValue - * @return PHPExcel_Writer_PDF - */ - public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) { - $this->_orientation = $pValue; - return $this; - } - - /** - * Save PHPExcel to file - * - * @param string $pFileName - * @throws Exception - */ - public function save($pFilename = null) { - // garbage collect - $this->_phpExcel->garbageCollect(); - - $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType(); - PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE); - - // Open file - $fileHandle = fopen($pFilename, 'w'); - if ($fileHandle === false) { - throw new Exception("Could not open file $pFilename for writing."); - } - - // Set PDF - $this->_isPdf = true; - - // Build CSS - $this->buildCSS(true); - - // Generate HTML - $html = ''; - //$html .= $this->generateHTMLHeader(false); - $html .= $this->generateSheetData(); - //$html .= $this->generateHTMLFooter(); - - // Default PDF paper size - $paperSize = 'LETTER'; // Letter (8.5 in. by 11 in.) - - // Check for paper size and page orientation - if (is_null($this->getSheetIndex())) { - $orientation = ($this->_phpExcel->getSheet(0)->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->_phpExcel->getSheet(0)->getPageSetup()->getPaperSize(); - $printMargins = $this->_phpExcel->getSheet(0)->getPageMargins(); - } else { - $orientation = ($this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - $printPaperSize = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize(); - $printMargins = $this->_phpExcel->getSheet($this->getSheetIndex())->getPageMargins(); - } - - // Override Page Orientation - if (!is_null($this->_orientation)) { - $orientation = ($this->_orientation == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P'; - } - // Override Paper Size - if (!is_null($this->_paperSize)) { - $printPaperSize = $this->_paperSize; - } - - - if (isset(self::$_paperSizes[$printPaperSize])) { - $paperSize = self::$_paperSizes[$printPaperSize]; - } - - - // Create PDF - $pdf = new TCPDF($orientation, 'pt', $paperSize); - $pdf->setFontSubsetting(false); - // Set margins, converting inches to points (using 72 dpi) - $pdf->SetMargins($printMargins->getLeft() * 72,$printMargins->getTop() * 72,$printMargins->getRight() * 72); - $pdf->SetAutoPageBreak(true,$printMargins->getBottom() * 72); -// $pdf->setHeaderMargin($printMargins->getHeader() * 72); -// $pdf->setFooterMargin($printMargins->getFooter() * 72); - - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); - - $pdf->AddPage(); - - // Set the appropriate font - $pdf->SetFont($this->_font); - $pdf->writeHTML($html); - - // Document info - $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle()); - $pdf->SetAuthor($this->_phpExcel->getProperties()->getCreator()); - $pdf->SetSubject($this->_phpExcel->getProperties()->getSubject()); - $pdf->SetKeywords($this->_phpExcel->getProperties()->getKeywords()); - $pdf->SetCreator($this->_phpExcel->getProperties()->getCreator()); - - // Write to file - fwrite($fileHandle, $pdf->output($pFilename, 'S')); - - // Close file - fclose($fileHandle); - - PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType); - } - - /** - * Get temporary storage directory - * - * @return string - */ - public function getTempDir() { - return $this->_tempDir; - } - - /** - * Set temporary storage directory - * - * @param string $pValue Temporary storage directory - * @throws Exception Exception when directory does not exist - * @return PHPExcel_Writer_PDF - */ - public function setTempDir($pValue = '') { - if (is_dir($pValue)) { - $this->_tempDir = $pValue; - } else { - throw new Exception("Directory does not exist: $pValue"); - } - return $this; - } -} diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/config deleted file mode 100644 index 70334c3f99..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = KÄ - - -## -## Excel Error Codes (For future use) -## -NULL = #NULL! -DIV0 = #DIV/0! -VALUE = #HODNOTA! -REF = #REF! -NAME = #NÃZEV? -NUM = #NUM! -NA = #N/A diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/functions deleted file mode 100644 index 71813f07c9..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/cs/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Funkce doplňků a automatizace -## -GETPIVOTDATA = ZÃSKATKONTDATA ## Vrátí data uložená v kontingenÄní tabulce. Pomocí funkce ZÃSKATKONTDATA můžete naÄíst souhrnná data z kontingenÄní tabulky, pokud jsou tato data v kontingenÄní sestavÄ› zobrazena. - - -## -## Cube functions Funkce pro práci s krychlemi -## -CUBEKPIMEMBER = CUBEKPIMEMBER ## Vrátí název, vlastnost a velikost klíÄového ukazatele výkonu (KUV) a zobrazí v buňce název a vlastnost. KlíÄový ukazatel výkonu je kvantifikovatelná veliÄina, například hrubý mÄ›síÄní zisk nebo Ätvrtletní obrat na zamÄ›stnance, která se používá pro sledování výkonnosti organizace. -CUBEMEMBER = CUBEMEMBER ## Vrátí Älen nebo n-tici v hierarchii krychle. Slouží k ověření, zda v krychli existuje Älen nebo n-tice. -CUBEMEMBERPROPERTY = CUBEMEMBERPROPERTY ## Vrátí hodnotu vlastnosti Älena v krychli. Slouží k ověření, zda v krychli existuje Älen s daným názvem, a k vrácení konkrétní vlastnosti tohoto Älena. -CUBERANKEDMEMBER = CUBERANKEDMEMBER ## Vrátí n-tý nebo poÅ™adový Älen sady. Použijte ji pro vrácení jednoho nebo více prvků sady, například obchodníka s nejvyšším obratem nebo deseti nejlepších studentů. -CUBESET = CUBESET ## Definuje vypoÄtenou sadu Älenů nebo n-tic odesláním výrazu sady do krychle na serveru, který vytvoří sadu a potom ji vrátí do aplikace Microsoft Office Excel. -CUBESETCOUNT = CUBESETCOUNT ## Vrátí poÄet položek v množinÄ› -CUBEVALUE = CUBEVALUE ## Vrátí úhrnnou hodnotu z krychle. - - -## -## Database functions Funkce databáze -## -DAVERAGE = DPRÅ®MÄšR ## Vrátí průmÄ›r vybraných položek databáze. -DCOUNT = DPOÄŒET ## SpoÄítá buňky databáze obsahující Äísla. -DCOUNTA = DPOÄŒET2 ## SpoÄítá buňky databáze, které nejsou prázdné. -DGET = DZÃSKAT ## Extrahuje z databáze jeden záznam splňující zadaná kritéria. -DMAX = DMAX ## Vrátí maximální hodnotu z vybraných položek databáze. -DMIN = DMIN ## Vrátí minimální hodnotu z vybraných položek databáze. -DPRODUCT = DSOUÄŒIN ## Vynásobí hodnoty urÄitého pole záznamů v databázi, které splňují daná kritéria. -DSTDEV = DSMODCH.VÃBÄšR ## Odhadne smÄ›rodatnou odchylku výbÄ›ru vybraných položek databáze. -DSTDEVP = DSMODCH ## VypoÄte smÄ›rodatnou odchylku základního souboru vybraných položek databáze. -DSUM = DSUMA ## SeÄte Äísla ve sloupcovém poli záznamů databáze, která splňují daná kritéria. -DVAR = DVAR.VÃBÄšR ## Odhadne rozptyl výbÄ›ru vybraných položek databáze. -DVARP = DVAR ## VypoÄte rozptyl základního souboru vybraných položek databáze. - - -## -## Date and time functions Funkce data a Äasu -## -DATE = DATUM ## Vrátí poÅ™adové Äíslo urÄitého data. -DATEVALUE = DATUMHODN ## PÅ™evede datum ve formÄ› textu na poÅ™adové Äíslo. -DAY = DEN ## PÅ™evede poÅ™adové Äíslo na den v mÄ›síci. -DAYS360 = ROK360 ## Vrátí poÄet dní mezi dvÄ›ma daty na základÄ› roku s 360 dny. -EDATE = EDATE ## Vrátí poÅ™adové Äíslo data, které oznaÄuje urÄený poÄet mÄ›síců pÅ™ed nebo po poÄáteÄním datu. -EOMONTH = EOMONTH ## Vrátí poÅ™adové Äíslo posledního dne mÄ›síce pÅ™ed nebo po zadaném poÄtu mÄ›síců. -HOUR = HODINA ## PÅ™evede poÅ™adové Äíslo na hodinu. -MINUTE = MINUTA ## PÅ™evede poÅ™adové Äíslo na minutu. -MONTH = MÄšSÃC ## PÅ™evede poÅ™adové Äíslo na mÄ›síc. -NETWORKDAYS = NETWORKDAYS ## Vrátí poÄet celých pracovních dní mezi dvÄ›ma daty. -NOW = NYNà ## Vrátí poÅ™adové Äíslo aktuálního data a Äasu. -SECOND = SEKUNDA ## PÅ™evede poÅ™adové Äíslo na sekundu. -TIME = ÄŒAS ## Vrátí poÅ™adové Äíslo urÄitého Äasu. -TIMEVALUE = ÄŒASHODN ## PÅ™evede Äas ve formÄ› textu na poÅ™adové Äíslo. -TODAY = DNES ## Vrátí poÅ™adové Äíslo dneÅ¡ního data. -WEEKDAY = DENTÃDNE ## PÅ™evede poÅ™adové Äíslo na den v týdnu. -WEEKNUM = WEEKNUM ## PÅ™evede poÅ™adové Äíslo na Äíslo pÅ™edstavující Äíselnou pozici týdne v roce. -WORKDAY = WORKDAY ## Vrátí poÅ™adové Äíslo data pÅ™ed nebo po zadaném poÄtu pracovních dní. -YEAR = ROK ## PÅ™evede poÅ™adové Äíslo na rok. -YEARFRAC = YEARFRAC ## Vrátí Äást roku vyjádÅ™enou zlomkem a pÅ™edstavující poÄet celých dní mezi poÄáteÄním a koncovým datem. - - -## -## Engineering functions Inženýrské funkce (Technické funkce) -## -BESSELI = BESSELI ## Vrátí modifikovanou Besselovu funkci In(x). -BESSELJ = BESSELJ ## Vrátí modifikovanou Besselovu funkci Jn(x). -BESSELK = BESSELK ## Vrátí modifikovanou Besselovu funkci Kn(x). -BESSELY = BESSELY ## Vrátí Besselovu funkci Yn(x). -BIN2DEC = BIN2DEC ## PÅ™evede binární Äíslo na desítkové. -BIN2HEX = BIN2HEX ## PÅ™evede binární Äíslo na Å¡estnáctkové. -BIN2OCT = BIN2OCT ## PÅ™evede binární Äíslo na osmiÄkové. -COMPLEX = COMPLEX ## PÅ™evede reálnou a imaginární Äást na komplexní Äíslo. -CONVERT = CONVERT ## PÅ™evede Äíslo do jiného jednotkového mÄ›rného systému. -DEC2BIN = DEC2BIN ## PÅ™evede desítkového Äísla na dvojkové -DEC2HEX = DEC2HEX ## PÅ™evede desítkové Äíslo na Å¡estnáctkové. -DEC2OCT = DEC2OCT ## PÅ™evede desítkové Äíslo na osmiÄkové. -DELTA = DELTA ## Testuje rovnost dvou hodnot. -ERF = ERF ## Vrátí chybovou funkci. -ERFC = ERFC ## Vrátí doplňkovou chybovou funkci. -GESTEP = GESTEP ## Testuje, zda je Äíslo vÄ›tší než mezní hodnota. -HEX2BIN = HEX2BIN ## PÅ™evede Å¡estnáctkové Äíslo na binární. -HEX2DEC = HEX2DEC ## PÅ™evede Å¡estnáctkové Äíslo na desítkové. -HEX2OCT = HEX2OCT ## PÅ™evede Å¡estnáctkové Äíslo na osmiÄkové. -IMABS = IMABS ## Vrátí absolutní hodnotu (modul) komplexního Äísla. -IMAGINARY = IMAGINARY ## Vrátí imaginární Äást komplexního Äísla. -IMARGUMENT = IMARGUMENT ## Vrátí argument théta, úhel vyjádÅ™ený v radiánech. -IMCONJUGATE = IMCONJUGATE ## Vrátí komplexnÄ› sdružené Äíslo ke komplexnímu Äíslu. -IMCOS = IMCOS ## Vrátí kosinus komplexního Äísla. -IMDIV = IMDIV ## Vrátí podíl dvou komplexních Äísel. -IMEXP = IMEXP ## Vrátí exponenciální tvar komplexního Äísla. -IMLN = IMLN ## Vrátí pÅ™irozený logaritmus komplexního Äísla. -IMLOG10 = IMLOG10 ## Vrátí dekadický logaritmus komplexního Äísla. -IMLOG2 = IMLOG2 ## Vrátí logaritmus komplexního Äísla pÅ™i základu 2. -IMPOWER = IMPOWER ## Vrátí komplexní Äíslo umocnÄ›né na celé Äíslo. -IMPRODUCT = IMPRODUCT ## Vrátí souÄin komplexních Äísel. -IMREAL = IMREAL ## Vrátí reálnou Äást komplexního Äísla. -IMSIN = IMSIN ## Vrátí sinus komplexního Äísla. -IMSQRT = IMSQRT ## Vrátí druhou odmocninu komplexního Äísla. -IMSUB = IMSUB ## Vrátí rozdíl mezi dvÄ›ma komplexními Äísly. -IMSUM = IMSUM ## Vrátí souÄet dvou komplexních Äísel. -OCT2BIN = OCT2BIN ## PÅ™evede osmiÄkové Äíslo na binární. -OCT2DEC = OCT2DEC ## PÅ™evede osmiÄkové Äíslo na desítkové. -OCT2HEX = OCT2HEX ## PÅ™evede osmiÄkové Äíslo na Å¡estnáctkové. - - -## -## Financial functions FinanÄní funkce -## -ACCRINT = ACCRINT ## Vrátí nahromadÄ›ný úrok z cenného papíru, ze kterého je úrok placen v pravidelných termínech. -ACCRINTM = ACCRINTM ## Vrátí nahromadÄ›ný úrok z cenného papíru, ze kterého je úrok placen k datu splatnosti. -AMORDEGRC = AMORDEGRC ## Vrátí lineární amortizaci v každém úÄetním období pomocí koeficientu amortizace. -AMORLINC = AMORLINC ## Vrátí lineární amortizaci v každém úÄetním období. -COUPDAYBS = COUPDAYBS ## Vrátí poÄet dnů od zaÄátku období placení kupónů do data splatnosti. -COUPDAYS = COUPDAYS ## Vrátí poÄet dnů v období placení kupónů, které obsahuje den zúÄtování. -COUPDAYSNC = COUPDAYSNC ## Vrátí poÄet dnů od data zúÄtování do následujícího data placení kupónu. -COUPNCD = COUPNCD ## Vrátí následující datum placení kupónu po datu zúÄtování. -COUPNUM = COUPNUM ## Vrátí poÄet kupónů splatných mezi datem zúÄtování a datem splatnosti. -COUPPCD = COUPPCD ## Vrátí pÅ™edchozí datum placení kupónu pÅ™ed datem zúÄtování. -CUMIPMT = CUMIPMT ## Vrátí kumulativní úrok splacený mezi dvÄ›ma obdobími. -CUMPRINC = CUMPRINC ## Vrátí kumulativní jistinu splacenou mezi dvÄ›ma obdobími půjÄky. -DB = ODPIS.ZRYCH ## Vrátí odpis aktiva za urÄité období pomocí degresivní metody odpisu s pevným zůstatkem. -DDB = ODPIS.ZRYCH2 ## Vrátí odpis aktiva za urÄité období pomocí dvojité degresivní metody odpisu nebo jiné metody, kterou zadáte. -DISC = DISC ## Vrátí diskontní sazbu cenného papíru. -DOLLARDE = DOLLARDE ## PÅ™evede Äástku v korunách vyjádÅ™enou zlomkem na Äástku v korunách vyjádÅ™enou desetinným Äíslem. -DOLLARFR = DOLLARFR ## PÅ™evede Äástku v korunách vyjádÅ™enou desetinným Äíslem na Äástku v korunách vyjádÅ™enou zlomkem. -DURATION = DURATION ## Vrátí roÄní dobu cenného papíru s pravidelnými úrokovými sazbami. -EFFECT = EFFECT ## Vrátí efektivní roÄní úrokovou sazbu. -FV = BUDHODNOTA ## Vrátí budoucí hodnotu investice. -FVSCHEDULE = FVSCHEDULE ## Vrátí budoucí hodnotu poÄáteÄní jistiny po použití série sazeb složitého úroku. -INTRATE = INTRATE ## Vrátí úrokovou sazbu plnÄ› investovaného cenného papíru. -IPMT = PLATBA.ÚROK ## Vrátí výšku úroku investice za dané období. -IRR = MÃRA.VÃNOSNOSTI ## Vrátí vnitÅ™ní výnosové procento série peněžních toků. -ISPMT = ISPMT ## VypoÄte výši úroku z investice zaplaceného bÄ›hem urÄitého období. -MDURATION = MDURATION ## Vrátí Macauleyho modifikovanou dobu cenného papíru o nominální hodnotÄ› 100 KÄ. -MIRR = MOD.MÃRA.VÃNOSNOSTI ## Vrátí vnitÅ™ní sazbu výnosu, pÅ™iÄemž kladné a záporné hodnoty peněžních prostÅ™edků jsou financovány podle různých sazeb. -NOMINAL = NOMINAL ## Vrátí nominální roÄní úrokovou sazbu. -NPER = POÄŒET.OBDOBà ## Vrátí poÄet období pro investici. -NPV = ÄŒISTÃ.SOUÄŒHODNOTA ## Vrátí Äistou souÄasnou hodnotu investice vypoÄítanou na základÄ› série pravidelných peněžních toků a diskontní sazby. -ODDFPRICE = ODDFPRICE ## Vrátí cenu cenného papíru o nominální hodnotÄ› 100 KÄ s odliÅ¡ným prvním obdobím. -ODDFYIELD = ODDFYIELD ## Vrátí výnos cenného papíru s odliÅ¡ným prvním obdobím. -ODDLPRICE = ODDLPRICE ## Vrátí cenu cenného papíru o nominální hodnotÄ› 100 KÄ s odliÅ¡ným posledním obdobím. -ODDLYIELD = ODDLYIELD ## Vrátí výnos cenného papíru s odliÅ¡ným posledním obdobím. -PMT = PLATBA ## Vrátí hodnotu pravidelné splátky anuity. -PPMT = PLATBA.ZÃKLAD ## Vrátí hodnotu splátky jistiny pro zadanou investici za dané období. -PRICE = PRICE ## Vrátí cenu cenného papíru o nominální hodnotÄ› 100 KÄ, ze kterého je úrok placen v pravidelných termínech. -PRICEDISC = PRICEDISC ## Vrátí cenu diskontního cenného papíru o nominální hodnotÄ› 100 KÄ. -PRICEMAT = PRICEMAT ## Vrátí cenu cenného papíru o nominální hodnotÄ› 100 KÄ, ze kterého je úrok placen k datu splatnosti. -PV = SOUÄŒHODNOTA ## Vrátí souÄasnou hodnotu investice. -RATE = ÚROKOVÃ.MÃRA ## Vrátí úrokovou sazbu vztaženou na období anuity. -RECEIVED = RECEIVED ## Vrátí Äástku obdrženou k datu splatnosti plnÄ› investovaného cenného papíru. -SLN = ODPIS.LIN ## Vrátí přímé odpisy aktiva pro jedno období. -SYD = ODPIS.NELIN ## Vrátí smÄ›rné Äíslo roÄních odpisů aktiva pro zadané období. -TBILLEQ = TBILLEQ ## Vrátí výnos smÄ›nky státní pokladny ekvivalentní výnosu obligace. -TBILLPRICE = TBILLPRICE ## Vrátí cenu smÄ›nky státní pokladny o nominální hodnotÄ› 100 KÄ. -TBILLYIELD = TBILLYIELD ## Vrátí výnos smÄ›nky státní pokladny. -VDB = ODPIS.ZA.INT ## Vrátí odpis aktiva pro urÄité období nebo Äást období pomocí degresivní metody odpisu. -XIRR = XIRR ## Vrátí vnitÅ™ní výnosnost pro harmonogram peněžních toků, který nemusí být nutnÄ› periodický. -XNPV = XNPV ## Vrátí Äistou souÄasnou hodnotu pro harmonogram peněžních toků, který nemusí být nutnÄ› periodický. -YIELD = YIELD ## Vrátí výnos cenného papíru, ze kterého je úrok placen v pravidelných termínech. -YIELDDISC = YIELDDISC ## Vrátí roÄní výnos diskontního cenného papíru, například smÄ›nky státní pokladny. -YIELDMAT = YIELDMAT ## Vrátí roÄní výnos cenného papíru, ze kterého je úrok placen k datu splatnosti. - - -## -## Information functions InformaÄní funkce -## -CELL = POLÃÄŒKO ## Vrátí informace o formátování, umístÄ›ní nebo obsahu buňky. -ERROR.TYPE = CHYBA.TYP ## Vrátí Äíslo odpovídající typu chyby. -INFO = O.PROSTŘEDà ## Vrátí informace o aktuálním pracovním prostÅ™edí. -ISBLANK = JE.PRÃZDNÉ ## Vrátí hodnotu PRAVDA, pokud se argument hodnota odkazuje na prázdnou buňku. -ISERR = JE.CHYBA ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota (kromÄ› #N/A). -ISERROR = JE.CHYBHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota. -ISEVEN = ISEVEN ## Vrátí hodnotu PRAVDA, pokud je Äíslo sudé. -ISLOGICAL = JE.LOGHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota logická hodnota. -ISNA = JE.NEDEF ## Vrátí hodnotu PRAVDA, pokud je argument hodnota chybová hodnota #N/A. -ISNONTEXT = JE.NETEXT ## Vrátí hodnotu PRAVDA, pokud argument hodnota není text. -ISNUMBER = JE.ÄŒÃSLO ## Vrátí hodnotu PRAVDA, pokud je argument hodnota Äíslo. -ISODD = ISODD ## Vrátí hodnotu PRAVDA, pokud je Äíslo liché. -ISREF = JE.ODKAZ ## Vrátí hodnotu PRAVDA, pokud je argument hodnota odkaz. -ISTEXT = JE.TEXT ## Vrátí hodnotu PRAVDA, pokud je argument hodnota text. -N = N ## Vrátí hodnotu pÅ™evedenou na Äíslo. -NA = NEDEF ## Vrátí chybovou hodnotu #N/A. -TYPE = TYP ## Vrátí Äíslo oznaÄující datový typ hodnoty. - - -## -## Logical functions Logické funkce -## -AND = A ## Vrátí hodnotu PRAVDA, mají-li vÅ¡echny argumenty hodnotu PRAVDA. -FALSE = NEPRAVDA ## Vrátí logickou hodnotu NEPRAVDA. -IF = KDYŽ ## UrÄí, který logický test má probÄ›hnout. -IFERROR = IFERROR ## Pokud je vzorec vyhodnocen jako chyba, vrátí zadanou hodnotu. V opaÄném případÄ› vrátí výsledek vzorce. -NOT = NE ## Provede logickou negaci argumentu funkce. -OR = NEBO ## Vrátí hodnotu PRAVDA, je-li alespoň jeden argument roven hodnotÄ› PRAVDA. -TRUE = PRAVDA ## Vrátí logickou hodnotu PRAVDA. - - -## -## Lookup and reference functions Vyhledávací funkce -## -ADDRESS = ODKAZ ## Vrátí textový odkaz na jednu buňku listu. -AREAS = POÄŒET.BLOKÅ® ## Vrátí poÄet oblastí v odkazu. -CHOOSE = ZVOLIT ## Zvolí hodnotu ze seznamu hodnot. -COLUMN = SLOUPEC ## Vrátí Äíslo sloupce odkazu. -COLUMNS = SLOUPCE ## Vrátí poÄet sloupců v odkazu. -HLOOKUP = VVYHLEDAT ## Prohledá horní řádek matice a vrátí hodnotu urÄené buňky. -HYPERLINK = HYPERTEXTOVÃ.ODKAZ ## Vytvoří zástupce nebo odkaz, který otevÅ™e dokument uložený na síťovém serveru, v síti intranet nebo Internet. -INDEX = INDEX ## Pomocí rejstříku zvolí hodnotu z odkazu nebo matice. -INDIRECT = NEPŘÃMÃ.ODKAZ ## Vrátí odkaz urÄený textovou hodnotou. -LOOKUP = VYHLEDAT ## Vyhledá hodnoty ve vektoru nebo matici. -MATCH = POZVYHLEDAT ## Vyhledá hodnoty v odkazu nebo matici. -OFFSET = POSUN ## Vrátí posun odkazu od zadaného odkazu. -ROW = ŘÃDEK ## Vrátí Äíslo řádku odkazu. -ROWS = ŘÃDKY ## Vrátí poÄet řádků v odkazu. -RTD = RTD ## NaÄte data reálného Äasu z programu, který podporuje automatizaci modelu COM (Automatizace: Způsob práce s objekty urÄité aplikace z jiné aplikace nebo nástroje pro vývoj. Automatizace (dříve nazývaná automatizace OLE) je poÄítaÄovým standardem a je funkcí modelu COM (Component Object Model).). -TRANSPOSE = TRANSPOZICE ## Vrátí transponovanou matici. -VLOOKUP = SVYHLEDAT ## Prohledá první sloupec matice, pÅ™esune kurzor v řádku a vrátí hodnotu buňky. - - -## -## Math and trigonometry functions Matematické a trigonometrické funkce -## -ABS = ABS ## Vrátí absolutní hodnotu Äísla. -ACOS = ARCCOS ## Vrátí arkuskosinus Äísla. -ACOSH = ARCCOSH ## Vrátí hyperbolický arkuskosinus Äísla. -ASIN = ARCSIN ## Vrátí arkussinus Äísla. -ASINH = ARCSINH ## Vrátí hyperbolický arkussinus Äísla. -ATAN = ARCTG ## Vrátí arkustangens Äísla. -ATAN2 = ARCTG2 ## Vrátí arkustangens x-ové a y-ové souÅ™adnice. -ATANH = ARCTGH ## Vrátí hyperbolický arkustangens Äísla. -CEILING = ZAOKR.NAHORU ## Zaokrouhlí Äíslo na nejbližší celé Äíslo nebo na nejbližší násobek zadané hodnoty. -COMBIN = KOMBINACE ## Vrátí poÄet kombinací pro daný poÄet položek. -COS = COS ## Vrátí kosinus Äísla. -COSH = COSH ## Vrátí hyperbolický kosinus Äísla. -DEGREES = DEGREES ## PÅ™evede radiány na stupnÄ›. -EVEN = ZAOKROUHLIT.NA.SUDÉ ## Zaokrouhlí Äíslo nahoru na nejbližší celé sudé Äíslo. -EXP = EXP ## Vrátí základ pÅ™irozeného logaritmu e umocnÄ›ný na zadané Äíslo. -FACT = FAKTORIÃL ## Vrátí faktoriál Äísla. -FACTDOUBLE = FACTDOUBLE ## Vrátí dvojitý faktoriál Äísla. -FLOOR = ZAOKR.DOLÅ® ## Zaokrouhlí Äíslo dolů, smÄ›rem k nule. -GCD = GCD ## Vrátí nejvÄ›tší spoleÄný dÄ›litel. -INT = CELÃ.ÄŒÃST ## Zaokrouhlí Äíslo dolů na nejbližší celé Äíslo. -LCM = LCM ## Vrátí nejmenší spoleÄný násobek. -LN = LN ## Vrátí pÅ™irozený logaritmus Äísla. -LOG = LOGZ ## Vrátí logaritmus Äísla pÅ™i zadaném základu. -LOG10 = LOG ## Vrátí dekadický logaritmus Äísla. -MDETERM = DETERMINANT ## Vrátí determinant matice. -MINVERSE = INVERZE ## Vrátí inverzní matici. -MMULT = SOUÄŒIN.MATIC ## Vrátí souÄin dvou matic. -MOD = MOD ## Vrátí zbytek po dÄ›lení. -MROUND = MROUND ## Vrátí Äíslo zaokrouhlené na požadovaný násobek. -MULTINOMIAL = MULTINOMIAL ## Vrátí mnohoÄlen z množiny Äísel. -ODD = ZAOKROUHLIT.NA.LICHÉ ## Zaokrouhlí Äíslo nahoru na nejbližší celé liché Äíslo. -PI = PI ## Vrátí hodnotu Äísla pí. -POWER = POWER ## Umocní Äíslo na zadanou mocninu. -PRODUCT = SOUÄŒIN ## Vynásobí argumenty funkce. -QUOTIENT = QUOTIENT ## Vrátí celou Äást dÄ›lení. -RADIANS = RADIANS ## PÅ™evede stupnÄ› na radiány. -RAND = NÃHÄŒÃSLO ## Vrátí náhodné Äíslo mezi 0 a 1. -RANDBETWEEN = RANDBETWEEN ## Vrátí náhodné Äíslo mezi zadanými Äísly. -ROMAN = ROMAN ## PÅ™evede arabskou Äíslici na římskou ve formátu textu. -ROUND = ZAOKROUHLIT ## Zaokrouhlí Äíslo na zadaný poÄet Äíslic. -ROUNDDOWN = ROUNDDOWN ## Zaokrouhlí Äíslo dolů, smÄ›rem k nule. -ROUNDUP = ROUNDUP ## Zaokrouhlí Äíslo nahoru, smÄ›rem od nuly. -SERIESSUM = SERIESSUM ## Vrátí souÄet mocninné Å™ady urÄené podle vzorce. -SIGN = SIGN ## Vrátí znaménko Äísla. -SIN = SIN ## Vrátí sinus daného úhlu. -SINH = SINH ## Vrátí hyperbolický sinus Äísla. -SQRT = ODMOCNINA ## Vrátí kladnou druhou odmocninu. -SQRTPI = SQRTPI ## Vrátí druhou odmocninu výrazu (Äíslo * pí). -SUBTOTAL = SUBTOTAL ## Vrátí souhrn v seznamu nebo databázi. -SUM = SUMA ## SeÄte argumenty funkce. -SUMIF = SUMIF ## SeÄte buňky vybrané podle zadaných kritérií. -SUMIFS = SUMIFS ## SeÄte buňky urÄené více zadanými podmínkami. -SUMPRODUCT = SOUÄŒIN.SKALÃRNà ## Vrátí souÄet souÄinů odpovídajících prvků matic. -SUMSQ = SUMA.ÄŒTVERCÅ® ## Vrátí souÄet Ätverců argumentů. -SUMX2MY2 = SUMX2MY2 ## Vrátí souÄet rozdílu Ätverců odpovídajících hodnot ve dvou maticích. -SUMX2PY2 = SUMX2PY2 ## Vrátí souÄet souÄtu Ätverců odpovídajících hodnot ve dvou maticích. -SUMXMY2 = SUMXMY2 ## Vrátí souÄet Ätverců rozdílů odpovídajících hodnot ve dvou maticích. -TAN = TGTG ## Vrátí tangens Äísla. -TANH = TGH ## Vrátí hyperbolický tangens Äísla. -TRUNC = USEKNOUT ## Zkrátí Äíslo na celé Äíslo. - - -## -## Statistical functions Statistické funkce -## -AVEDEV = PRÅ®MODCHYLKA ## Vrátí průmÄ›rnou hodnotu absolutních odchylek datových bodů od jejich stÅ™ední hodnoty. -AVERAGE = PRÅ®MÄšR ## Vrátí průmÄ›rnou hodnotu argumentů. -AVERAGEA = AVERAGEA ## Vrátí průmÄ›rnou hodnotu argumentů vÄetnÄ› Äísel, textu a logických hodnot. -AVERAGEIF = AVERAGEIF ## Vrátí průmÄ›rnou hodnotu (aritmetický průmÄ›r) vÅ¡ech bunÄ›k v oblasti, které vyhovují přísluÅ¡né podmínce. -AVERAGEIFS = AVERAGEIFS ## Vrátí průmÄ›rnou hodnotu (aritmetický průmÄ›r) vÅ¡ech bunÄ›k vyhovujících nÄ›kolika podmínkám. -BETADIST = BETADIST ## Vrátí hodnotu souÄtového rozdÄ›lení beta. -BETAINV = BETAINV ## Vrátí inverzní hodnotu souÄtového rozdÄ›lení pro zadané rozdÄ›lení beta. -BINOMDIST = BINOMDIST ## Vrátí hodnotu binomického rozdÄ›lení pravdÄ›podobnosti jednotlivých veliÄin. -CHIDIST = CHIDIST ## Vrátí jednostrannou pravdÄ›podobnost rozdÄ›lení chí-kvadrát. -CHIINV = CHIINV ## Vrátí hodnotu funkce inverzní k distribuÄní funkci jednostranné pravdÄ›podobnosti rozdÄ›lení chí-kvadrát. -CHITEST = CHITEST ## Vrátí test nezávislosti. -CONFIDENCE = CONFIDENCE ## Vrátí interval spolehlivosti pro stÅ™ední hodnotu základního souboru. -CORREL = CORREL ## Vrátí korelaÄní koeficient mezi dvÄ›ma množinami dat. -COUNT = POÄŒET ## Vrátí poÄet Äísel v seznamu argumentů. -COUNTA = POÄŒET2 ## Vrátí poÄet hodnot v seznamu argumentů. -COUNTBLANK = COUNTBLANK ## SpoÄítá poÄet prázdných bunÄ›k v oblasti. -COUNTIF = COUNTIF ## SpoÄítá buňky v oblasti, které odpovídají zadaným kritériím. -COUNTIFS = COUNTIFS ## SpoÄítá buňky v oblasti, které odpovídají více kritériím. -COVAR = COVAR ## Vrátí hodnotu kovariance, průmÄ›rnou hodnotu souÄinů párových odchylek -CRITBINOM = CRITBINOM ## Vrátí nejmenší hodnotu, pro kterou má souÄtové binomické rozdÄ›lení hodnotu vÄ›tší nebo rovnu hodnotÄ› kritéria. -DEVSQ = DEVSQ ## Vrátí souÄet Ätverců odchylek. -EXPONDIST = EXPONDIST ## Vrátí hodnotu exponenciálního rozdÄ›lení. -FDIST = FDIST ## Vrátí hodnotu rozdÄ›lení pravdÄ›podobnosti F. -FINV = FINV ## Vrátí hodnotu inverzní funkce k distribuÄní funkci rozdÄ›lení F. -FISHER = FISHER ## Vrátí hodnotu Fisherovy transformace. -FISHERINV = FISHERINV ## Vrátí hodnotu inverzní funkce k FisherovÄ› transformaci. -FORECAST = FORECAST ## Vrátí hodnotu lineárního trendu. -FREQUENCY = ÄŒETNOSTI ## Vrátí Äetnost rozdÄ›lení jako svislou matici. -FTEST = FTEST ## Vrátí výsledek F-testu. -GAMMADIST = GAMMADIST ## Vrátí hodnotu rozdÄ›lení gama. -GAMMAINV = GAMMAINV ## Vrátí hodnotu inverzní funkce k distribuÄní funkci souÄtového rozdÄ›lení gama. -GAMMALN = GAMMALN ## Vrátí pÅ™irozený logaritmus funkce gama, Γ(x). -GEOMEAN = GEOMEAN ## Vrátí geometrický průmÄ›r. -GROWTH = LOGLINTREND ## Vrátí hodnoty exponenciálního trendu. -HARMEAN = HARMEAN ## Vrátí harmonický průmÄ›r. -HYPGEOMDIST = HYPGEOMDIST ## Vrátí hodnotu hypergeometrického rozdÄ›lení. -INTERCEPT = INTERCEPT ## Vrátí úsek lineární regresní Äáry. -KURT = KURT ## Vrátí hodnotu excesu množiny dat. -LARGE = LARGE ## Vrátí k-tou nejvÄ›tší hodnotu množiny dat. -LINEST = LINREGRESE ## Vrátí parametry lineárního trendu. -LOGEST = LOGLINREGRESE ## Vrátí parametry exponenciálního trendu. -LOGINV = LOGINV ## Vrátí inverzní funkci k distribuÄní funkci logaritmicko-normálního rozdÄ›lení. -LOGNORMDIST = LOGNORMDIST ## Vrátí hodnotu souÄtového logaritmicko-normálního rozdÄ›lení. -MAX = MAX ## Vrátí maximální hodnotu seznamu argumentů. -MAXA = MAXA ## Vrátí maximální hodnotu seznamu argumentů vÄetnÄ› Äísel, textu a logických hodnot. -MEDIAN = MEDIAN ## Vrátí stÅ™ední hodnotu zadaných Äísel. -MIN = MIN ## Vrátí minimální hodnotu seznamu argumentů. -MINA = MINA ## Vrátí nejmenší hodnotu v seznamu argumentů vÄetnÄ› Äísel, textu a logických hodnot. -MODE = MODE ## Vrátí hodnotu, která se v množinÄ› dat vyskytuje nejÄastÄ›ji. -NEGBINOMDIST = NEGBINOMDIST ## Vrátí hodnotu negativního binomického rozdÄ›lení. -NORMDIST = NORMDIST ## Vrátí hodnotu normálního souÄtového rozdÄ›lení. -NORMINV = NORMINV ## Vrátí inverzní funkci k funkci normálního souÄtového rozdÄ›lení. -NORMSDIST = NORMSDIST ## Vrátí hodnotu standardního normálního souÄtového rozdÄ›lení. -NORMSINV = NORMSINV ## Vrátí inverzní funkci k funkci standardního normálního souÄtového rozdÄ›lení. -PEARSON = PEARSON ## Vrátí Pearsonův výsledný momentový korelaÄní koeficient. -PERCENTILE = PERCENTIL ## Vrátí hodnotu k-tého percentilu hodnot v oblasti. -PERCENTRANK = PERCENTRANK ## Vrátí poÅ™adí hodnoty v množinÄ› dat vyjádÅ™ené procentuální Äástí množiny dat. -PERMUT = PERMUTACE ## Vrátí poÄet permutací pro zadaný poÄet objektů. -POISSON = POISSON ## Vrátí hodnotu distribuÄní funkce Poissonova rozdÄ›lení. -PROB = PROB ## Vrátí pravdÄ›podobnost výskytu hodnot v oblasti mezi dvÄ›ma mezními hodnotami. -QUARTILE = QUARTIL ## Vrátí hodnotu kvartilu množiny dat. -RANK = RANK ## Vrátí poÅ™adí Äísla v seznamu Äísel. -RSQ = RKQ ## Vrátí druhou mocninu Pearsonova výsledného momentového korelaÄního koeficientu. -SKEW = SKEW ## Vrátí zeÅ¡ikmení rozdÄ›lení. -SLOPE = SLOPE ## Vrátí smÄ›rnici lineární regresní Äáry. -SMALL = SMALL ## Vrátí k-tou nejmenší hodnotu množiny dat. -STANDARDIZE = STANDARDIZE ## Vrátí normalizovanou hodnotu. -STDEV = SMODCH.VÃBÄšR ## VypoÄte smÄ›rodatnou odchylku výbÄ›ru. -STDEVA = STDEVA ## VypoÄte smÄ›rodatnou odchylku výbÄ›ru vÄetnÄ› Äísel, textu a logických hodnot. -STDEVP = SMODCH ## VypoÄte smÄ›rodatnou odchylku základního souboru. -STDEVPA = STDEVPA ## VypoÄte smÄ›rodatnou odchylku základního souboru vÄetnÄ› Äísel, textu a logických hodnot. -STEYX = STEYX ## Vrátí standardní chybu pÅ™edpovÄ›zené hodnoty y pro každou hodnotu x v regresi. -TDIST = TDIST ## Vrátí hodnotu Studentova t-rozdÄ›lení. -TINV = TINV ## Vrátí inverzní funkci k distribuÄní funkci Studentova t-rozdÄ›lení. -TREND = LINTREND ## Vrátí hodnoty lineárního trendu. -TRIMMEAN = TRIMMEAN ## Vrátí stÅ™ední hodnotu vnitÅ™ní Äásti množiny dat. -TTEST = TTEST ## Vrátí pravdÄ›podobnost spojenou se Studentovým t-testem. -VAR = VAR.VÃBÄšR ## VypoÄte rozptyl výbÄ›ru. -VARA = VARA ## VypoÄte rozptyl výbÄ›ru vÄetnÄ› Äísel, textu a logických hodnot. -VARP = VAR ## VypoÄte rozptyl základního souboru. -VARPA = VARPA ## VypoÄte rozptyl základního souboru vÄetnÄ› Äísel, textu a logických hodnot. -WEIBULL = WEIBULL ## Vrátí hodnotu Weibullova rozdÄ›lení. -ZTEST = ZTEST ## Vrátí jednostrannou P-hodnotu z-testu. - - -## -## Text functions Textové funkce -## -ASC = ASC ## ZmÄ›ní znaky s plnou šířkou (dvoubajtové)v Å™etÄ›zci znaků na znaky s poloviÄní šířkou (jednobajtové). -BAHTTEXT = BAHTTEXT ## PÅ™evede Äíslo na text ve formátu, mÄ›ny ß (baht). -CHAR = ZNAK ## Vrátí znak urÄený Äíslem kódu. -CLEAN = VYÄŒISTIT ## Odebere z textu vÅ¡echny netisknutelné znaky. -CODE = KÓD ## Vrátí Äíselný kód prvního znaku zadaného textového Å™etÄ›zce. -CONCATENATE = CONCATENATE ## Spojí nÄ›kolik textových položek do jedné. -DOLLAR = KÄŒ ## PÅ™evede Äíslo na text ve formátu mÄ›ny KÄ (Äeská koruna). -EXACT = STEJNÉ ## Zkontroluje, zda jsou dvÄ› textové hodnoty shodné. -FIND = NAJÃT ## Nalezne textovou hodnotu uvnitÅ™ jiné (rozliÅ¡uje malá a velká písmena). -FINDB = FINDB ## Nalezne textovou hodnotu uvnitÅ™ jiné (rozliÅ¡uje malá a velká písmena). -FIXED = ZAOKROUHLIT.NA.TEXT ## Zformátuje Äíslo jako text s pevným poÄtem desetinných míst. -JIS = JIS ## ZmÄ›ní znaky s poloviÄní šířkou (jednobajtové) v Å™etÄ›zci znaků na znaky s plnou šířkou (dvoubajtové). -LEFT = ZLEVA ## Vrátí první znaky textové hodnoty umístÄ›né nejvíce vlevo. -LEFTB = LEFTB ## Vrátí první znaky textové hodnoty umístÄ›né nejvíce vlevo. -LEN = DÉLKA ## Vrátí poÄet znaků textového Å™etÄ›zce. -LENB = LENB ## Vrátí poÄet znaků textového Å™etÄ›zce. -LOWER = MALà ## PÅ™evede text na malá písmena. -MID = ÄŒÃST ## Vrátí urÄitý poÄet znaků textového Å™etÄ›zce poÄínaje zadaným místem. -MIDB = MIDB ## Vrátí urÄitý poÄet znaků textového Å™etÄ›zce poÄínaje zadaným místem. -PHONETIC = ZVUKOVÉ ## Extrahuje fonetické znaky (furigana) z textového Å™etÄ›zce. -PROPER = VELKÃ2 ## PÅ™evede první písmeno každého slova textové hodnoty na velké. -REPLACE = NAHRADIT ## Nahradí znaky uvnitÅ™ textu. -REPLACEB = NAHRADITB ## Nahradí znaky uvnitÅ™ textu. -REPT = OPAKOVAT ## Zopakuje text podle zadaného poÄtu opakování. -RIGHT = ZPRAVA ## Vrátí první znaky textové hodnoty umístÄ›né nejvíce vpravo. -RIGHTB = RIGHTB ## Vrátí první znaky textové hodnoty umístÄ›né nejvíce vpravo. -SEARCH = HLEDAT ## Nalezne textovou hodnotu uvnitÅ™ jiné (malá a velká písmena nejsou rozliÅ¡ována). -SEARCHB = SEARCHB ## Nalezne textovou hodnotu uvnitÅ™ jiné (malá a velká písmena nejsou rozliÅ¡ována). -SUBSTITUTE = DOSADIT ## V textovém Å™etÄ›zci nahradí starý text novým. -T = T ## PÅ™evede argumenty na text. -TEXT = HODNOTA.NA.TEXT ## Zformátuje Äíslo a pÅ™evede ho na text. -TRIM = PROÄŒISTIT ## Odstraní z textu mezery. -UPPER = VELKà ## PÅ™evede text na velká písmena. -VALUE = HODNOTA ## PÅ™evede textový argument na Äíslo. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/config deleted file mode 100644 index 789fe87d1f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/config +++ /dev/null @@ -1,48 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = kr - - - -## -## Excel Error Codes (For future use) -## -NULL = #NUL! -DIV0 = #DIVISION/0! -VALUE = #VÆRDI! -REF = #REFERENCE! -NAME = #NAVN? -NUM = #NUM! -NA = #I/T diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/functions deleted file mode 100644 index 753787f0e0..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/da/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Tilføjelsesprogram- og automatiseringsfunktioner -## -GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data, der er lagret i en pivottabelrapport - - -## -## Cube functions Kubefunktioner -## -CUBEKPIMEMBER = KUBE.KPI.MEDLEM ## Returnerer navn, egenskab og mÃ¥l for en KPI-indikator og viser navnet og egenskaben i cellen. En KPI-indikator er en mÃ¥lbar størrelse, f.eks. bruttooverskud pr. mÃ¥ned eller personaleudskiftning pr. kvartal, der bruges til at overvÃ¥ge en organisations præstationer. -CUBEMEMBER = KUBE.MEDLEM ## Returnerer et medlem eller en tupel fra kubehierarkiet. Bruges til at validere, om et medlem eller en tupel findes i kuben. -CUBEMEMBERPROPERTY = KUBEMEDLEM.EGENSKAB ## Returnerer værdien af en egenskab for et medlem i kuben. Bruges til at validere, om et medlemsnavn findes i kuben, og returnere den angivne egenskab for medlemmet. -CUBERANKEDMEMBER = KUBEMEDLEM.RANG ## Returnerer det n'te eller rangordnede medlem i et sæt. Bruges til at returnere et eller flere elementer i et sæt, f.eks. topsælgere eller de 10 bedste elever. -CUBESET = KUBESÆT ## Definerer et beregnet sæt medlemmer eller tupler ved at sende et sætudtryk til kuben pÃ¥ serveren, som opretter sættet og returnerer det til Microsoft Office Excel. -CUBESETCOUNT = KUBESÆT.TÆL ## Returnerer antallet af elementer i et sæt. -CUBEVALUE = KUBEVÆRDI ## Returnerer en sammenlagt (aggregeret) værdi fra en kube. - - -## -## Database functions Databasefunktioner -## -DAVERAGE = DMIDDEL ## Returnerer gennemsnittet af markerede databaseposter -DCOUNT = DTÆL ## Tæller de celler, der indeholder tal, i en database -DCOUNTA = DTÆLV ## Tæller udfyldte celler i en database -DGET = DHENT ## Uddrager en enkelt post, der opfylder de angivne kriterier, fra en database -DMAX = DMAKS ## Returnerer den største værdi blandt markerede databaseposter -DMIN = DMIN ## Returnerer den mindste værdi blandt markerede databaseposter -DPRODUCT = DPRODUKT ## Ganger værdierne i et bestemt felt med poster, der opfylder kriterierne i en database -DSTDEV = DSTDAFV ## Beregner et skøn over standardafvigelsen baseret pÃ¥ en stikprøve af markerede databaseposter -DSTDEVP = DSTDAFVP ## Beregner standardafvigelsen baseret pÃ¥ hele populationen af markerede databaseposter -DSUM = DSUM ## Sammenlægger de tal i feltkolonnen i databasen, der opfylder kriterierne -DVAR = DVARIANS ## Beregner varians baseret pÃ¥ en stikprøve af markerede databaseposter -DVARP = DVARIANSP ## Beregner varians baseret pÃ¥ hele populationen af markerede databaseposter - - -## -## Date and time functions Dato- og klokkeslætsfunktioner -## -DATE = DATO ## Returnerer serienummeret for en bestemt dato -DATEVALUE = DATOVÆRDI ## Konverterer en dato i form af tekst til et serienummer -DAY = DAG ## Konverterer et serienummer til en dag i mÃ¥neden -DAYS360 = DAGE360 ## Beregner antallet af dage mellem to datoer pÃ¥ grundlag af et Ã¥r med 360 dage -EDATE = EDATO ## Returnerer serienummeret for den dato, der ligger det angivne antal mÃ¥neder før eller efter startdatoen -EOMONTH = SLUT.PÃ….MÃ…NED ## Returnerer serienummeret pÃ¥ den sidste dag i mÃ¥neden før eller efter et angivet antal mÃ¥neder -HOUR = TIME ## Konverterer et serienummer til en time -MINUTE = MINUT ## Konverterer et serienummer til et minut -MONTH = MÃ…NED ## Konverterer et serienummer til en mÃ¥ned -NETWORKDAYS = ANTAL.ARBEJDSDAGE ## Returnerer antallet af hele arbejdsdage mellem to datoer -NOW = NU ## Returnerer serienummeret for den aktuelle dato eller det aktuelle klokkeslæt -SECOND = SEKUND ## Konverterer et serienummer til et sekund -TIME = KLOKKESLÆT ## Returnerer serienummeret for et bestemt klokkeslæt -TIMEVALUE = TIDSVÆRDI ## Konverterer et klokkeslæt i form af tekst til et serienummer -TODAY = IDAG ## Returnerer serienummeret for dags dato -WEEKDAY = UGEDAG ## Konverterer et serienummer til en ugedag -WEEKNUM = UGE.NR ## Konverterer et serienummer til et tal, der angiver ugenummeret i Ã¥ret -WORKDAY = ARBEJDSDAG ## Returnerer serienummeret for dagen før eller efter det angivne antal arbejdsdage -YEAR = Ã…R ## Konverterer et serienummer til et Ã¥r -YEARFRAC = Ã…R.BRØK ## Returnerer Ã¥rsbrøken, der repræsenterer antallet af hele dage mellem startdato og slutdato - - -## -## Engineering functions Tekniske funktioner -## -BESSELI = BESSELI ## Returnerer den modificerede Bessel-funktion In(x) -BESSELJ = BESSELJ ## Returnerer Bessel-funktionen Jn(x) -BESSELK = BESSELK ## Returnerer den modificerede Bessel-funktion Kn(x) -BESSELY = BESSELY ## Returnerer Bessel-funktionen Yn(x) -BIN2DEC = BIN.TIL.DEC ## Konverterer et binært tal til et decimaltal -BIN2HEX = BIN.TIL.HEX ## Konverterer et binært tal til et heksadecimalt tal -BIN2OCT = BIN.TIL.OKT ## Konverterer et binært tal til et oktaltal. -COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koefficienter til et komplekst tal -CONVERT = KONVERTER ## Konverterer et tal fra én mÃ¥leenhed til en anden -DEC2BIN = DEC.TIL.BIN ## Konverterer et decimaltal til et binært tal -DEC2HEX = DEC.TIL.HEX ## Konverterer et decimaltal til et heksadecimalt tal -DEC2OCT = DEC.TIL.OKT ## Konverterer et decimaltal til et oktaltal -DELTA = DELTA ## Tester, om to værdier er ens -ERF = FEJLFUNK ## Returner fejlfunktionen -ERFC = FEJLFUNK.KOMP ## Returnerer den komplementære fejlfunktion -GESTEP = GETRIN ## Tester, om et tal er større end en grænseværdi -HEX2BIN = HEX.TIL.BIN ## Konverterer et heksadecimalt tal til et binært tal -HEX2DEC = HEX.TIL.DEC ## Konverterer et decimaltal til et heksadecimalt tal -HEX2OCT = HEX.TIL.OKT ## Konverterer et heksadecimalt tal til et oktaltal -IMABS = IMAGABS ## Returnerer den absolutte værdi (modulus) for et komplekst tal -IMAGINARY = IMAGINÆR ## Returnerer den imaginære koefficient for et komplekst tal -IMARGUMENT = IMAGARGUMENT ## Returnerer argumentet theta, en vinkel udtrykt i radianer -IMCONJUGATE = IMAGKONJUGERE ## Returnerer den komplekse konjugation af et komplekst tal -IMCOS = IMAGCOS ## Returnerer et komplekst tals cosinus -IMDIV = IMAGDIV ## Returnerer kvotienten for to komplekse tal -IMEXP = IMAGEKSP ## Returnerer et komplekst tals eksponentialfunktion -IMLN = IMAGLN ## Returnerer et komplekst tals naturlige logaritme -IMLOG10 = IMAGLOG10 ## Returnerer et komplekst tals sædvanlige logaritme (titalslogaritme) -IMLOG2 = IMAGLOG2 ## Returnerer et komplekst tals sædvanlige logaritme (totalslogaritme) -IMPOWER = IMAGPOTENS ## Returnerer et komplekst tal opløftet i en heltalspotens -IMPRODUCT = IMAGPRODUKT ## Returnerer produktet af komplekse tal -IMREAL = IMAGREELT ## Returnerer den reelle koefficient for et komplekst tal -IMSIN = IMAGSIN ## Returnerer et komplekst tals sinus -IMSQRT = IMAGKVROD ## Returnerer et komplekst tals kvadratrod -IMSUB = IMAGSUB ## Returnerer forskellen mellem to komplekse tal -IMSUM = IMAGSUM ## Returnerer summen af komplekse tal -OCT2BIN = OKT.TIL.BIN ## Konverterer et oktaltal til et binært tal -OCT2DEC = OKT.TIL.DEC ## Konverterer et oktaltal til et decimaltal -OCT2HEX = OKT.TIL.HEX ## Konverterer et oktaltal til et heksadecimalt tal - - -## -## Financial functions Finansielle funktioner -## -ACCRINT = PÃ…LØBRENTE ## Returnerer den pÃ¥løbne rente for et værdipapir med periodiske renteudbetalinger -ACCRINTM = PÃ…LØBRENTE.UDLØB ## Returnerer den pÃ¥løbne rente for et værdipapir, hvor renteudbetalingen finder sted ved papirets udløb -AMORDEGRC = AMORDEGRC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode ved hjælp af en afskrivningskoefficient -AMORLINC = AMORLINC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode -COUPDAYBS = KUPONDAGE.SA ## Returnerer antallet af dage fra starten af kuponperioden til afregningsdatoen -COUPDAYS = KUPONDAGE.A ## Returnerer antallet af dage fra begyndelsen af kuponperioden til afregningsdatoen -COUPDAYSNC = KUPONDAGE.ANK ## Returnerer antallet af dage i den kuponperiode, der indeholder afregningsdatoen -COUPNCD = KUPONDAG.NÆSTE ## Returnerer den næste kupondato efter afregningsdatoen -COUPNUM = KUPONBETALINGER ## Returnerer antallet af kuponudbetalinger mellem afregnings- og udløbsdatoen -COUPPCD = KUPONDAG.FORRIGE ## Returnerer den forrige kupondato før afregningsdatoen -CUMIPMT = AKKUM.RENTE ## Returnerer den akkumulerede rente, der betales pÃ¥ et lÃ¥n mellem to perioder -CUMPRINC = AKKUM.HOVEDSTOL ## Returnerer den akkumulerede nedbringelse af hovedstol mellem to perioder -DB = DB ## Returnerer afskrivningen pÃ¥ et aktiv i en angivet periode ved anvendelse af saldometoden -DDB = DSA ## Returnerer afskrivningsbeløbet for et aktiv over en bestemt periode ved anvendelse af dobbeltsaldometoden eller en anden afskrivningsmetode, som du angiver -DISC = DISKONTO ## Returnerer et værdipapirs diskonto -DOLLARDE = KR.DECIMAL ## Konverterer en kronepris udtrykt som brøk til en kronepris udtrykt som decimaltal -DOLLARFR = KR.BRØK ## Konverterer en kronepris udtrykt som decimaltal til en kronepris udtrykt som brøk -DURATION = VARIGHED ## Returnerer den Ã¥rlige løbetid for et værdipapir med periodiske renteudbetalinger -EFFECT = EFFEKTIV.RENTE ## Returnerer den Ã¥rlige effektive rente -FV = FV ## Returnerer fremtidsværdien af en investering -FVSCHEDULE = FVTABEL ## Returnerer den fremtidige værdi af en hovedstol, nÃ¥r der er tilskrevet rente og rentes rente efter forskellige rentesatser -INTRATE = RENTEFOD ## Returnerer renten pÃ¥ et fuldt ud investeret værdipapir -IPMT = R.YDELSE ## Returnerer renten fra en investering for en given periode -IRR = IA ## Returnerer den interne rente for en række pengestrømme -ISPMT = ISPMT ## Beregner den betalte rente i løbet af en bestemt investeringsperiode -MDURATION = MVARIGHED ## Returnerer Macauleys modificerede løbetid for et værdipapir med en formodet pari pÃ¥ kr. 100 -MIRR = MIA ## Returnerer den interne forrentning, hvor positive og negative pengestrømme finansieres til forskellig rente -NOMINAL = NOMINEL ## Returnerer den Ã¥rlige nominelle rente -NPER = NPER ## Returnerer antallet af perioder for en investering -NPV = NUTIDSVÆRDI ## Returnerer nettonutidsværdien for en investering baseret pÃ¥ en række periodiske pengestrømme og en diskonteringssats -ODDFPRICE = ULIGE.KURS.PÃ…LYDENDE ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med en ulige (kort eller lang) første periode -ODDFYIELD = ULIGE.FØRSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige første periode -ODDLPRICE = ULIGE.SIDSTE.KURS ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med ulige sidste periode -ODDLYIELD = ULIGE.SIDSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige sidste periode -PMT = YDELSE ## Returnerer renten fra en investering for en given periode -PPMT = H.YDELSE ## Returnerer ydelsen pÃ¥ hovedstolen for en investering i en given periode -PRICE = KURS ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir med periodiske renteudbetalinger -PRICEDISC = KURS.DISKONTO ## Returnerer kursen pr. kr 100 nominel værdi for et diskonteret værdipapir -PRICEMAT = KURS.UDLØB ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir, hvor renten udbetales ved papirets udløb -PV = NV ## Returnerer den nuværende værdi af en investering -RATE = RENTE ## Returnerer renten i hver periode for en annuitet -RECEIVED = MODTAGET.VED.UDLØB ## Returnerer det beløb, der modtages ved udløbet af et fuldt ud investeret værdipapir -SLN = LA ## Returnerer den lineære afskrivning for et aktiv i en enkelt periode -SYD = Ã…RSAFSKRIVNING ## Returnerer den Ã¥rlige afskrivning pÃ¥ et aktiv i en bestemt periode -TBILLEQ = STATSOBLIGATION ## Returnerer det obligationsækvivalente afkast for en statsobligation -TBILLPRICE = STATSOBLIGATION.KURS ## Returnerer kursen pr. kr 100 nominel værdi for en statsobligation -TBILLYIELD = STATSOBLIGATION.AFKAST ## Returnerer en afkastet pÃ¥ en statsobligation -VDB = VSA ## Returnerer afskrivningen pÃ¥ et aktiv i en angivet periode, herunder delperioder, ved brug af dobbeltsaldometoden -XIRR = INTERN.RENTE ## Returnerer den interne rente for en plan over pengestrømme, der ikke behøver at være periodiske -XNPV = NETTO.NUTIDSVÆRDI ## Returnerer nutidsværdien for en plan over pengestrømme, der ikke behøver at være periodiske -YIELD = AFKAST ## Returnerer afkastet for et værdipapir med periodiske renteudbetalinger -YIELDDISC = AFKAST.DISKONTO ## Returnerer det Ã¥rlige afkast for et diskonteret værdipapir, f.eks. en statsobligation -YIELDMAT = AFKAST.UDLØBSDATO ## Returnerer det Ã¥rlige afkast for et værdipapir, hvor renten udbetales ved papirets udløb - - -## -## Information functions Informationsfunktioner -## -CELL = CELLE ## Returnerer oplysninger om formatering, placering eller indhold af en celle -ERROR.TYPE = FEJLTYPE ## Returnerer et tal, der svarer til en fejltype -INFO = INFO ## Returnerer oplysninger om det aktuelle operativmiljø -ISBLANK = ER.TOM ## Returnerer SAND, hvis værdien er tom -ISERR = ER.FJL ## Returnerer SAND, hvis værdien er en fejlværdi undtagen #I/T -ISERROR = ER.FEJL ## Returnerer SAND, hvis værdien er en fejlværdi -ISEVEN = ER.LIGE ## Returnerer SAND, hvis tallet er lige -ISLOGICAL = ER.LOGISK ## Returnerer SAND, hvis værdien er en logisk værdi -ISNA = ER.IKKE.TILGÆNGELIG ## Returnerer SAND, hvis værdien er fejlværdien #I/T -ISNONTEXT = ER.IKKE.TEKST ## Returnerer SAND, hvis værdien ikke er tekst -ISNUMBER = ER.TAL ## Returnerer SAND, hvis værdien er et tal -ISODD = ER.ULIGE ## Returnerer SAND, hvis tallet er ulige -ISREF = ER.REFERENCE ## Returnerer SAND, hvis værdien er en reference -ISTEXT = ER.TEKST ## Returnerer SAND, hvis værdien er tekst -N = TAL ## Returnerer en værdi konverteret til et tal -NA = IKKE.TILGÆNGELIG ## Returnerer fejlværdien #I/T -TYPE = VÆRDITYPE ## Returnerer et tal, der angiver datatypen for en værdi - - -## -## Logical functions Logiske funktioner -## -AND = OG ## Returnerer SAND, hvis alle argumenterne er sande -FALSE = FALSK ## Returnerer den logiske værdi FALSK -IF = HVIS ## Angiver en logisk test, der skal udføres -IFERROR = HVIS.FEJL ## Returnerer en værdi, du angiver, hvis en formel evauleres som en fejl. Returnerer i modsat fald resultatet af formlen -NOT = IKKE ## Vender argumentets logik om -OR = ELLER ## Returneret værdien SAND, hvis mindst ét argument er sandt -TRUE = SAND ## Returnerer den logiske værdi SAND - - -## -## Lookup and reference functions Opslags- og referencefunktioner -## -ADDRESS = ADRESSE ## Returnerer en reference som tekst til en enkelt celle i et regneark -AREAS = OMRÃ…DER ## Returnerer antallet af omrÃ¥der i en reference -CHOOSE = VÆLG ## Vælger en værdi pÃ¥ en liste med værdier -COLUMN = KOLONNE ## Returnerer kolonnenummeret i en reference -COLUMNS = KOLONNER ## Returnerer antallet af kolonner i en reference -HLOOKUP = VOPSLAG ## Søger i den øverste række af en matrix og returnerer værdien af den angivne celle -HYPERLINK = HYPERLINK ## Opretter en genvej kaldet et hyperlink, der Ã¥bner et dokument, som er lagret pÃ¥ en netværksserver, pÃ¥ et intranet eller pÃ¥ internettet -INDEX = INDEKS ## Anvender et indeks til at vælge en værdi fra en reference eller en matrix -INDIRECT = INDIREKTE ## Returnerer en reference, der er angivet af en tekstværdi -LOOKUP = SLÃ….OP ## Søger værdier i en vektor eller en matrix -MATCH = SAMMENLIGN ## Søger værdier i en reference eller en matrix -OFFSET = FORSKYDNING ## Returnerer en reference forskudt i forhold til en given reference -ROW = RÆKKE ## Returnerer rækkenummeret for en reference -ROWS = RÆKKER ## Returnerer antallet af rækker i en reference -RTD = RTD ## Henter realtidsdata fra et program, der understøtter COM-automatisering (Automation: En metode til at arbejde med objekter fra et andet program eller udviklingsværktøj. Automation, som tidligere blev kaldt OLE Automation, er en industristandard og en funktion i COM (Component Object Model).) -TRANSPOSE = TRANSPONER ## Returnerer en transponeret matrix -VLOOKUP = LOPSLAG ## Søger i øverste række af en matrix og flytter pÃ¥ tværs af rækken for at returnere en celleværdi - - -## -## Math and trigonometry functions Matematiske og trigonometriske funktioner -## -ABS = ABS ## Returnerer den absolutte værdi af et tal -ACOS = ARCCOS ## Returnerer et tals arcus cosinus -ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus af tal -ASIN = ARCSIN ## Returnerer et tals arcus sinus -ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus for tal -ATAN = ARCTAN ## Returnerer et tals arcus tangens -ATAN2 = ARCTAN2 ## Returnerer de angivne x- og y-koordinaters arcus tangens -ATANH = ARCTANH ## Returnerer et tals inverse hyperbolske tangens -CEILING = AFRUND.LOFT ## Afrunder et tal til nærmeste heltal eller til nærmeste multiplum af betydning -COMBIN = KOMBIN ## Returnerer antallet af kombinationer for et givet antal objekter -COS = COS ## Returnerer et tals cosinus -COSH = COSH ## Returnerer den inverse hyperbolske cosinus af et tal -DEGREES = GRADER ## Konverterer radianer til grader -EVEN = LIGE ## Runder et tal op til nærmeste lige heltal -EXP = EKSP ## Returnerer e opløftet til en potens af et angivet tal -FACT = FAKULTET ## Returnerer et tals fakultet -FACTDOUBLE = DOBBELT.FAKULTET ## Returnerer et tals dobbelte fakultet -FLOOR = AFRUND.GULV ## Runder et tal ned mod nul -GCD = STØRSTE.FÆLLES.DIVISOR ## Returnerer den største fælles divisor -INT = HELTAL ## Nedrunder et tal til det nærmeste heltal -LCM = MINDSTE.FÆLLES.MULTIPLUM ## Returnerer det mindste fælles multiplum -LN = LN ## Returnerer et tals naturlige logaritme -LOG = LOG ## Returnerer logaritmen for et tal pÃ¥ grundlag af et angivet grundtal -LOG10 = LOG10 ## Returnerer titalslogaritmen af et tal -MDETERM = MDETERM ## Returnerer determinanten for en matrix -MINVERSE = MINVERT ## Returnerer den inverse matrix for en matrix -MMULT = MPRODUKT ## Returnerer matrixproduktet af to matrixer -MOD = REST ## Returnerer restværdien fra division -MROUND = MAFRUND ## Returnerer et tal afrundet til det ønskede multiplum -MULTINOMIAL = MULTINOMIAL ## Returnerer et multinomialt talsæt -ODD = ULIGE ## Runder et tal op til nærmeste ulige heltal -PI = PI ## Returnerer værdien af pi -POWER = POTENS ## Returnerer resultatet af et tal opløftet til en potens -PRODUCT = PRODUKT ## Multiplicerer argumenterne -QUOTIENT = KVOTIENT ## Returnerer heltalsdelen ved division -RADIANS = RADIANER ## Konverterer grader til radianer -RAND = SLUMP ## Returnerer et tilfældigt tal mellem 0 og 1 -RANDBETWEEN = SLUMP.MELLEM ## Returnerer et tilfældigt tal mellem de tal, der angives -ROMAN = ROMERTAL ## Konverterer et arabertal til romertal som tekst -ROUND = AFRUND ## Afrunder et tal til et angivet antal decimaler -ROUNDDOWN = RUND.NED ## Runder et tal ned mod nul -ROUNDUP = RUND.OP ## Runder et tal op, væk fra 0 (nul) -SERIESSUM = SERIESUM ## Returnerer summen af en potensserie baseret pÃ¥ en formel -SIGN = FORTEGN ## Returnerer et tals fortegn -SIN = SIN ## Returnerer en given vinkels sinusværdi -SINH = SINH ## Returnerer den hyperbolske sinus af et tal -SQRT = KVROD ## Returnerer en positiv kvadratrod -SQRTPI = KVRODPI ## Returnerer kvadratroden af (tal * pi;) -SUBTOTAL = SUBTOTAL ## Returnerer en subtotal pÃ¥ en liste eller i en database -SUM = SUM ## Lægger argumenterne sammen -SUMIF = SUM.HVIS ## Lægger de celler sammen, der er specificeret af et givet kriterium. -SUMIFS = SUM.HVISER ## Lægger de celler i et omrÃ¥de sammen, der opfylder flere kriterier. -SUMPRODUCT = SUMPRODUKT ## Returnerer summen af produkter af ens matrixkomponenter -SUMSQ = SUMKV ## Returnerer summen af argumenternes kvadrater -SUMX2MY2 = SUMX2MY2 ## Returnerer summen af differensen mellem kvadrater af ens værdier i to matrixer -SUMX2PY2 = SUMX2PY2 ## Returnerer summen af summen af kvadrater af tilsvarende værdier i to matrixer -SUMXMY2 = SUMXMY2 ## Returnerer summen af kvadrater af differenser mellem ens værdier i to matrixer -TAN = TAN ## Returnerer et tals tangens -TANH = TANH ## Returnerer et tals hyperbolske tangens -TRUNC = AFKORT ## Afkorter et tal til et heltal - - -## -## Statistical functions Statistiske funktioner -## -AVEDEV = MAD ## Returnerer den gennemsnitlige numeriske afvigelse fra stikprøvens middelværdi -AVERAGE = MIDDEL ## Returnerer middelværdien af argumenterne -AVERAGEA = MIDDELV ## Returnerer middelværdien af argumenterne og medtager tal, tekst og logiske værdier -AVERAGEIF = MIDDEL.HVIS ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder et givet kriterium, i et omrÃ¥de -AVERAGEIFS = MIDDEL.HVISER ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder flere kriterier. -BETADIST = BETAFORDELING ## Returnerer den kumulative betafordelingsfunktion -BETAINV = BETAINV ## Returnerer den inverse kumulative fordelingsfunktion for en angivet betafordeling -BINOMDIST = BINOMIALFORDELING ## Returnerer punktsandsynligheden for binomialfordelingen -CHIDIST = CHIFORDELING ## Returnerer fraktilsandsynligheden for en chi2-fordeling -CHIINV = CHIINV ## Returnerer den inverse fraktilsandsynlighed for en chi2-fordeling -CHITEST = CHITEST ## Foretager en test for uafhængighed -CONFIDENCE = KONFIDENSINTERVAL ## Returnerer et konfidensinterval for en population -CORREL = KORRELATION ## Returnerer korrelationskoefficienten mellem to datasæt -COUNT = TÆL ## Tæller antallet af tal pÃ¥ en liste med argumenter -COUNTA = TÆLV ## Tæller antallet af værdier pÃ¥ en liste med argumenter -COUNTBLANK = ANTAL.BLANKE ## Tæller antallet af tomme celler i et omrÃ¥de -COUNTIF = TÆLHVIS ## Tæller antallet af celler, som opfylder de givne kriterier, i et omrÃ¥de -COUNTIFS = TÆL.HVISER ## Tæller antallet af de celler, som opfylder flere kriterier, i et omrÃ¥de -COVAR = KOVARIANS ## Beregner kovariansen mellem to stokastiske variabler -CRITBINOM = KRITBINOM ## Returnerer den mindste værdi for x, for hvilken det gælder, at fordelingsfunktionen er mindre end eller lig med kriterieværdien. -DEVSQ = SAK ## Returnerer summen af de kvadrerede afvigelser fra middelværdien -EXPONDIST = EKSPFORDELING ## Returnerer eksponentialfordelingen -FDIST = FFORDELING ## Returnerer fraktilsandsynligheden for F-fordelingen -FINV = FINV ## Returnerer den inverse fraktilsandsynlighed for F-fordelingen -FISHER = FISHER ## Returnerer Fisher-transformationen -FISHERINV = FISHERINV ## Returnerer den inverse Fisher-transformation -FORECAST = PROGNOSE ## Returnerer en prognoseværdi baseret pÃ¥ lineær tendens -FREQUENCY = FREKVENS ## Returnerer en frekvensfordeling i en søjlevektor -FTEST = FTEST ## Returnerer resultatet af en F-test til sammenligning af varians -GAMMADIST = GAMMAFORDELING ## Returnerer fordelingsfunktionen for gammafordelingen -GAMMAINV = GAMMAINV ## Returnerer den inverse fordelingsfunktion for gammafordelingen -GAMMALN = GAMMALN ## Returnerer den naturlige logaritme til gammafordelingen, G(x) -GEOMEAN = GEOMIDDELVÆRDI ## Returnerer det geometriske gennemsnit -GROWTH = FORØGELSE ## Returnerer værdier langs en eksponentiel tendens -HARMEAN = HARMIDDELVÆRDI ## Returnerer det harmoniske gennemsnit -HYPGEOMDIST = HYPGEOFORDELING ## Returnerer punktsandsynligheden i en hypergeometrisk fordeling -INTERCEPT = SKÆRING ## Returnerer afskæringsværdien pÃ¥ y-aksen i en lineær regression -KURT = TOPSTEJL ## Returnerer kurtosisværdien for en stokastisk variabel -LARGE = STOR ## Returnerer den k'te største værdi i et datasæt -LINEST = LINREGR ## Returnerer parameterestimaterne for en lineær tendens -LOGEST = LOGREGR ## Returnerer parameterestimaterne for en eksponentiel tendens -LOGINV = LOGINV ## Returnerer den inverse fordelingsfunktion for lognormalfordelingen -LOGNORMDIST = LOGNORMFORDELING ## Returnerer fordelingsfunktionen for lognormalfordelingen -MAX = MAKS ## Returnerer den maksimale værdi pÃ¥ en liste med argumenter. -MAXA = MAKSV ## Returnerer den maksimale værdi pÃ¥ en liste med argumenter og medtager tal, tekst og logiske værdier -MEDIAN = MEDIAN ## Returnerer medianen for de angivne tal -MIN = MIN ## Returnerer den mindste værdi pÃ¥ en liste med argumenter. -MINA = MINV ## Returnerer den mindste værdi pÃ¥ en liste med argumenter og medtager tal, tekst og logiske værdier -MODE = HYPPIGST ## Returnerer den hyppigste værdi i et datasæt -NEGBINOMDIST = NEGBINOMFORDELING ## Returnerer den negative binomialfordeling -NORMDIST = NORMFORDELING ## Returnerer fordelingsfunktionen for normalfordelingen -NORMINV = NORMINV ## Returnerer den inverse fordelingsfunktion for normalfordelingen -NORMSDIST = STANDARDNORMFORDELING ## Returnerer fordelingsfunktionen for standardnormalfordelingen -NORMSINV = STANDARDNORMINV ## Returnerer den inverse fordelingsfunktion for standardnormalfordelingen -PEARSON = PEARSON ## Returnerer Pearsons korrelationskoefficient -PERCENTILE = FRAKTIL ## Returnerer den k'te fraktil for datasættet -PERCENTRANK = PROCENTPLADS ## Returnerer den procentuelle rang for en given værdi i et datasæt -PERMUT = PERMUT ## Returnerer antallet af permutationer for et givet sæt objekter -POISSON = POISSON ## Returnerer fordelingsfunktionen for en Poisson-fordeling -PROB = SANDSYNLIGHED ## Returnerer intervalsandsynligheden -QUARTILE = KVARTIL ## Returnerer kvartilen i et givet datasæt -RANK = PLADS ## Returnerer rangen for et tal pÃ¥ en liste med tal -RSQ = FORKLARINGSGRAD ## Returnerer R2-værdien fra en simpel lineær regression -SKEW = SKÆVHED ## Returnerer skævheden for en stokastisk variabel -SLOPE = HÆLDNING ## Returnerer estimatet pÃ¥ hældningen fra en simpel lineær regression -SMALL = MINDSTE ## Returnerer den k'te mindste værdi i datasættet -STANDARDIZE = STANDARDISER ## Returnerer en standardiseret værdi -STDEV = STDAFV ## Estimerer standardafvigelsen pÃ¥ basis af en stikprøve -STDEVA = STDAFVV ## Beregner standardafvigelsen pÃ¥ basis af en prøve og medtager tal, tekst og logiske værdier -STDEVP = STDAFVP ## Beregner standardafvigelsen pÃ¥ basis af en hel population -STDEVPA = STDAFVPV ## Beregner standardafvigelsen pÃ¥ basis af en hel population og medtager tal, tekst og logiske værdier -STEYX = STFYX ## Returnerer standardafvigelsen for de estimerede y-værdier i den simple lineære regression -TDIST = TFORDELING ## Returnerer fordelingsfunktionen for Student's t-fordeling -TINV = TINV ## Returnerer den inverse fordelingsfunktion for Student's t-fordeling -TREND = TENDENS ## Returnerer værdi under antagelse af en lineær tendens -TRIMMEAN = TRIMMIDDELVÆRDI ## Returnerer den trimmede middelværdi for datasættet -TTEST = TTEST ## Returnerer den sandsynlighed, der er forbundet med Student's t-test -VAR = VARIANS ## Beregner variansen pÃ¥ basis af en prøve -VARA = VARIANSV ## Beregner variansen pÃ¥ basis af en prøve og medtager tal, tekst og logiske værdier -VARP = VARIANSP ## Beregner variansen pÃ¥ basis af hele populationen -VARPA = VARIANSPV ## Beregner variansen pÃ¥ basis af hele populationen og medtager tal, tekst og logiske værdier -WEIBULL = WEIBULL ## Returnerer fordelingsfunktionen for Weibull-fordelingen -ZTEST = ZTEST ## Returnerer sandsynlighedsværdien ved en en-sidet z-test - - -## -## Text functions Tekstfunktioner -## -ASC = ASC ## Ændrer engelske tegn i fuld bredde (dobbelt-byte) eller katakana i en tegnstreng til tegn i halv bredde (enkelt-byte) -BAHTTEXT = BAHTTEKST ## Konverterer et tal til tekst ved hjælp af valutaformatet ß (baht) -CHAR = TEGN ## Returnerer det tegn, der svarer til kodenummeret -CLEAN = RENS ## Fjerner alle tegn, der ikke kan udskrives, fra tekst -CODE = KODE ## Returnerer en numerisk kode for det første tegn i en tekststreng -CONCATENATE = SAMMENKÆDNING ## Sammenkæder adskillige tekstelementer til ét tekstelement -DOLLAR = KR ## Konverterer et tal til tekst ved hjælp af valutaformatet kr. (kroner) -EXACT = EKSAKT ## Kontrollerer, om to tekstværdier er identiske -FIND = FIND ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og smÃ¥ bogstaver) -FINDB = FINDB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og smÃ¥ bogstaver) -FIXED = FAST ## Formaterer et tal som tekst med et fast antal decimaler -JIS = JIS ## Ændrer engelske tegn i halv bredde (enkelt-byte) eller katakana i en tegnstreng til tegn i fuld bredde (dobbelt-byte) -LEFT = VENSTRE ## Returnerer tegnet længst til venstre i en tekstværdi -LEFTB = VENSTREB ## Returnerer tegnet længst til venstre i en tekstværdi -LEN = LÆNGDE ## Returnerer antallet af tegn i en tekststreng -LENB = LÆNGDEB ## Returnerer antallet af tegn i en tekststreng -LOWER = SMÃ….BOGSTAVER ## Konverterer tekst til smÃ¥ bogstaver -MID = MIDT ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition -MIDB = MIDTB ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition -PHONETIC = FONETISK ## Uddrager de fonetiske (furigana) tegn fra en tekststreng -PROPER = STORT.FORBOGSTAV ## Konverterer første bogstav i hvert ord i teksten til stort bogstav -REPLACE = ERSTAT ## Erstatter tegn i tekst -REPLACEB = ERSTATB ## Erstatter tegn i tekst -REPT = GENTAG ## Gentager tekst et givet antal gange -RIGHT = HØJRE ## Returnerer tegnet længste til højre i en tekstværdi -RIGHTB = HØJREB ## Returnerer tegnet længste til højre i en tekstværdi -SEARCH = SØG ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og smÃ¥ bogstaver) -SEARCHB = SØGB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og smÃ¥ bogstaver) -SUBSTITUTE = UDSKIFT ## Udskifter gammel tekst med ny tekst i en tekststreng -T = T ## Konverterer argumenterne til tekst -TEXT = TEKST ## Formaterer et tal og konverterer det til tekst -TRIM = FJERN.OVERFLØDIGE.BLANKE ## Fjerner mellemrum fra tekst -UPPER = STORE.BOGSTAVER ## Konverterer tekst til store bogstaver -VALUE = VÆRDI ## Konverterer et tekstargument til et tal diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/config deleted file mode 100644 index 87a3a1c6ed..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = € - - -## -## Excel Error Codes (For future use) -## -NULL = #NULL! -DIV0 = #DIV/0! -VALUE = #WERT! -REF = #BEZUG! -NAME = #NAME? -NUM = #ZAHL! -NA = #NV diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/functions deleted file mode 100644 index 49a4e0c291..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/de/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Add-In- und Automatisierungsfunktionen -## -GETPIVOTDATA = PIVOTDATENZUORDNEN ## In einem PivotTable-Bericht gespeicherte Daten werden zurückgegeben. - - -## -## Cube functions Cubefunktionen -## -CUBEKPIMEMBER = CUBEKPIELEMENT ## Gibt Name, Eigenschaft und Measure eines Key Performance Indicators (KPI) zurück und zeigt den Namen und die Eigenschaft in der Zelle an. Ein KPI ist ein quantifizierbares Maß, wie z. B. der monatliche Bruttogewinn oder die vierteljährliche Mitarbeiterfluktuation, mit dessen Hilfe das Leistungsverhalten eines Unternehmens überwacht werden kann. -CUBEMEMBER = CUBEELEMENT ## Gibt ein Element oder ein Tuple in einer Cubehierarchie zurück. Wird verwendet, um zu überprüfen, ob das Element oder Tuple im Cube vorhanden ist. -CUBEMEMBERPROPERTY = CUBEELEMENTEIGENSCHAFT ## Gibt den Wert einer Elementeigenschaft im Cube zurück. Wird verwendet, um zu überprüfen, ob ein Elementname im Cube vorhanden ist, und um die für dieses Element angegebene Eigenschaft zurückzugeben. -CUBERANKEDMEMBER = CUBERANGELEMENT ## Gibt das n-te oder n-rangige Element in einer Menge zurück. Wird verwendet, um mindestens ein Element in einer Menge zurückzugeben, wie z. B. bester Vertriebsmitarbeiter oder 10 beste Kursteilnehmer. -CUBESET = CUBEMENGE ## Definiert eine berechnete Menge Elemente oder Tuples durch Senden eines Mengenausdrucks an den Cube auf dem Server, der die Menge erstellt und an Microsoft Office Excel zurückgibt. -CUBESETCOUNT = CUBEMENGENANZAHL ## Gibt die Anzahl der Elemente in einer Menge zurück. -CUBEVALUE = CUBEWERT ## Gibt einen Aggregatwert aus einem Cube zurück. - - -## -## Database functions Datenbankfunktionen -## -DAVERAGE = DBMITTELWERT ## Gibt den Mittelwert der ausgewählten Datenbankeinträge zurück -DCOUNT = DBANZAHL ## Zählt die Zellen mit Zahlen in einer Datenbank -DCOUNTA = DBANZAHL2 ## Zählt nicht leere Zellen in einer Datenbank -DGET = DBAUSZUG ## Extrahiert aus einer Datenbank einen einzelnen Datensatz, der den angegebenen Kriterien entspricht -DMAX = DBMAX ## Gibt den größten Wert aus ausgewählten Datenbankeinträgen zurück -DMIN = DBMIN ## Gibt den kleinsten Wert aus ausgewählten Datenbankeinträgen zurück -DPRODUCT = DBPRODUKT ## Multipliziert die Werte in einem bestimmten Feld mit Datensätzen, die den Kriterien in einer Datenbank entsprechen -DSTDEV = DBSTDABW ## Schätzt die Standardabweichung auf der Grundlage einer Stichprobe aus ausgewählten Datenbankeinträgen -DSTDEVP = DBSTDABWN ## Berechnet die Standardabweichung auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge -DSUM = DBSUMME ## Addiert die Zahlen in der Feldspalte mit Datensätzen in der Datenbank, die den Kriterien entsprechen -DVAR = DBVARIANZ ## Schätzt die Varianz auf der Grundlage ausgewählter Datenbankeinträge -DVARP = DBVARIANZEN ## Berechnet die Varianz auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge - - -## -## Date and time functions Datums- und Zeitfunktionen -## -DATE = DATUM ## Gibt die fortlaufende Zahl eines bestimmten Datums zurück -DATEVALUE = DATWERT ## Wandelt ein Datum in Form von Text in eine fortlaufende Zahl um -DAY = TAG ## Wandelt eine fortlaufende Zahl in den Tag des Monats um -DAYS360 = TAGE360 ## Berechnet die Anzahl der Tage zwischen zwei Datumsangaben ausgehend von einem Jahr, das 360 Tage hat -EDATE = EDATUM ## Gibt die fortlaufende Zahl des Datums zurück, bei dem es sich um die angegebene Anzahl von Monaten vor oder nach dem Anfangstermin handelt -EOMONTH = MONATSENDE ## Gibt die fortlaufende Zahl des letzten Tags des Monats vor oder nach einer festgelegten Anzahl von Monaten zurück -HOUR = STUNDE ## Wandelt eine fortlaufende Zahl in eine Stunde um -MINUTE = MINUTE ## Wandelt eine fortlaufende Zahl in eine Minute um -MONTH = MONAT ## Wandelt eine fortlaufende Zahl in einen Monat um -NETWORKDAYS = NETTOARBEITSTAGE ## Gibt die Anzahl von ganzen Arbeitstagen zwischen zwei Datumswerten zurück -NOW = JETZT ## Gibt die fortlaufende Zahl des aktuellen Datums und der aktuellen Uhrzeit zurück -SECOND = SEKUNDE ## Wandelt eine fortlaufende Zahl in eine Sekunde um -TIME = ZEIT ## Gibt die fortlaufende Zahl einer bestimmten Uhrzeit zurück -TIMEVALUE = ZEITWERT ## Wandelt eine Uhrzeit in Form von Text in eine fortlaufende Zahl um -TODAY = HEUTE ## Gibt die fortlaufende Zahl des heutigen Datums zurück -WEEKDAY = WOCHENTAG ## Wandelt eine fortlaufende Zahl in den Wochentag um -WEEKNUM = KALENDERWOCHE ## Wandelt eine fortlaufende Zahl in eine Zahl um, die angibt, in welche Woche eines Jahres das angegebene Datum fällt -WORKDAY = ARBEITSTAG ## Gibt die fortlaufende Zahl des Datums vor oder nach einer bestimmten Anzahl von Arbeitstagen zurück -YEAR = JAHR ## Wandelt eine fortlaufende Zahl in ein Jahr um -YEARFRAC = BRTEILJAHRE ## Gibt die Anzahl der ganzen Tage zwischen Ausgangsdatum und Enddatum in Bruchteilen von Jahren zurück - - -## -## Engineering functions Konstruktionsfunktionen -## -BESSELI = BESSELI ## Gibt die geänderte Besselfunktion In(x) zurück -BESSELJ = BESSELJ ## Gibt die Besselfunktion Jn(x) zurück -BESSELK = BESSELK ## Gibt die geänderte Besselfunktion Kn(x) zurück -BESSELY = BESSELY ## Gibt die Besselfunktion Yn(x) zurück -BIN2DEC = BININDEZ ## Wandelt eine binäre Zahl (Dualzahl) in eine dezimale Zahl um -BIN2HEX = BININHEX ## Wandelt eine binäre Zahl (Dualzahl) in eine hexadezimale Zahl um -BIN2OCT = BININOKT ## Wandelt eine binäre Zahl (Dualzahl) in eine oktale Zahl um -COMPLEX = KOMPLEXE ## Wandelt den Real- und Imaginärteil in eine komplexe Zahl um -CONVERT = UMWANDELN ## Wandelt eine Zahl von einem Maßsystem in ein anderes um -DEC2BIN = DEZINBIN ## Wandelt eine dezimale Zahl in eine binäre Zahl (Dualzahl) um -DEC2HEX = DEZINHEX ## Wandelt eine dezimale Zahl in eine hexadezimale Zahl um -DEC2OCT = DEZINOKT ## Wandelt eine dezimale Zahl in eine oktale Zahl um -DELTA = DELTA ## Überprüft, ob zwei Werte gleich sind -ERF = GAUSSFEHLER ## Gibt die Gauss'sche Fehlerfunktion zurück -ERFC = GAUSSFKOMPL ## Gibt das Komplement zur Gauss'schen Fehlerfunktion zurück -GESTEP = GGANZZAHL ## Überprüft, ob eine Zahl größer als ein gegebener Schwellenwert ist -HEX2BIN = HEXINBIN ## Wandelt eine hexadezimale Zahl in eine Binärzahl um -HEX2DEC = HEXINDEZ ## Wandelt eine hexadezimale Zahl in eine dezimale Zahl um -HEX2OCT = HEXINOKT ## Wandelt eine hexadezimale Zahl in eine Oktalzahl um -IMABS = IMABS ## Gibt den Absolutbetrag (Modulo) einer komplexen Zahl zurück -IMAGINARY = IMAGINÄRTEIL ## Gibt den Imaginärteil einer komplexen Zahl zurück -IMARGUMENT = IMARGUMENT ## Gibt das Argument Theta zurück, einen Winkel, der als Bogenmaß ausgedrückt wird -IMCONJUGATE = IMKONJUGIERTE ## Gibt die konjugierte komplexe Zahl zu einer komplexen Zahl zurück -IMCOS = IMCOS ## Gibt den Kosinus einer komplexen Zahl zurück -IMDIV = IMDIV ## Gibt den Quotienten zweier komplexer Zahlen zurück -IMEXP = IMEXP ## Gibt die algebraische Form einer in exponentieller Schreibweise vorliegenden komplexen Zahl zurück -IMLN = IMLN ## Gibt den natürlichen Logarithmus einer komplexen Zahl zurück -IMLOG10 = IMLOG10 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 10 zurück -IMLOG2 = IMLOG2 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 2 zurück -IMPOWER = IMAPOTENZ ## Potenziert eine komplexe Zahl mit einer ganzen Zahl -IMPRODUCT = IMPRODUKT ## Gibt das Produkt von komplexen Zahlen zurück -IMREAL = IMREALTEIL ## Gibt den Realteil einer komplexen Zahl zurück -IMSIN = IMSIN ## Gibt den Sinus einer komplexen Zahl zurück -IMSQRT = IMWURZEL ## Gibt die Quadratwurzel einer komplexen Zahl zurück -IMSUB = IMSUB ## Gibt die Differenz zwischen zwei komplexen Zahlen zurück -IMSUM = IMSUMME ## Gibt die Summe von komplexen Zahlen zurück -OCT2BIN = OKTINBIN ## Wandelt eine oktale Zahl in eine binäre Zahl (Dualzahl) um -OCT2DEC = OKTINDEZ ## Wandelt eine oktale Zahl in eine dezimale Zahl um -OCT2HEX = OKTINHEX ## Wandelt eine oktale Zahl in eine hexadezimale Zahl um - - -## -## Financial functions Finanzmathematische Funktionen -## -ACCRINT = AUFGELZINS ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers mit periodischen Zinszahlungen zurück -ACCRINTM = AUFGELZINSF ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers zurück, die bei Fälligkeit ausgezahlt werden -AMORDEGRC = AMORDEGRK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume mithilfe eines Abschreibungskoeffizienten zurück -AMORLINC = AMORLINEARK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume zurück -COUPDAYBS = ZINSTERMTAGVA ## Gibt die Anzahl der Tage vom Anfang des Zinstermins bis zum Abrechnungstermin zurück -COUPDAYS = ZINSTERMTAGE ## Gibt die Anzahl der Tage der Zinsperiode zurück, die den Abrechnungstermin einschließt -COUPDAYSNC = ZINSTERMTAGNZ ## Gibt die Anzahl der Tage vom Abrechnungstermin bis zum nächsten Zinstermin zurück -COUPNCD = ZINSTERMNZ ## Gibt das Datum des ersten Zinstermins nach dem Abrechnungstermin zurück -COUPNUM = ZINSTERMZAHL ## Gibt die Anzahl der Zinstermine zwischen Abrechnungs- und Fälligkeitsdatum zurück -COUPPCD = ZINSTERMVZ ## Gibt das Datum des letzten Zinstermins vor dem Abrechnungstermin zurück -CUMIPMT = KUMZINSZ ## Berechnet die kumulierten Zinsen, die zwischen zwei Perioden zu zahlen sind -CUMPRINC = KUMKAPITAL ## Berechnet die aufgelaufene Tilgung eines Darlehens, die zwischen zwei Perioden zu zahlen ist -DB = GDA2 ## Gibt die geometrisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück -DDB = GDA ## Gibt die Abschreibung eines Anlageguts für einen angegebenen Zeitraum unter Verwendung der degressiven Doppelraten-Abschreibung oder eines anderen von Ihnen angegebenen Abschreibungsverfahrens zurück -DISC = DISAGIO ## Gibt den in Prozent ausgedrückten Abzinsungssatz eines Wertpapiers zurück -DOLLARDE = NOTIERUNGDEZ ## Wandelt eine Notierung, die als Dezimalbruch ausgedrückt wurde, in eine Dezimalzahl um -DOLLARFR = NOTIERUNGBRU ## Wandelt eine Notierung, die als Dezimalzahl ausgedrückt wurde, in einen Dezimalbruch um -DURATION = DURATION ## Gibt die jährliche Duration eines Wertpapiers mit periodischen Zinszahlungen zurück -EFFECT = EFFEKTIV ## Gibt die jährliche Effektivverzinsung zurück -FV = ZW ## Gibt den zukünftigen Wert (Endwert) einer Investition zurück -FVSCHEDULE = ZW2 ## Gibt den aufgezinsten Wert des Anfangskapitals für eine Reihe periodisch unterschiedlicher Zinssätze zurück -INTRATE = ZINSSATZ ## Gibt den Zinssatz eines voll investierten Wertpapiers zurück -IPMT = ZINSZ ## Gibt die Zinszahlung einer Investition für die angegebene Periode zurück -IRR = IKV ## Gibt den internen Zinsfuß einer Investition ohne Finanzierungskosten oder Reinvestitionsgewinne zurück -ISPMT = ISPMT ## Berechnet die während eines bestimmten Zeitraums für eine Investition gezahlten Zinsen -MDURATION = MDURATION ## Gibt die geänderte Dauer für ein Wertpapier mit einem angenommenen Nennwert von 100 € zurück -MIRR = QIKV ## Gibt den internen Zinsfuß zurück, wobei positive und negative Zahlungen zu unterschiedlichen Sätzen finanziert werden -NOMINAL = NOMINAL ## Gibt die jährliche Nominalverzinsung zurück -NPER = ZZR ## Gibt die Anzahl der Zahlungsperioden einer Investition zurück -NPV = NBW ## Gibt den Nettobarwert einer Investition auf Basis periodisch anfallender Zahlungen und eines Abzinsungsfaktors zurück -ODDFPRICE = UNREGER.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück -ODDFYIELD = UNREGER.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück -ODDLPRICE = UNREGLE.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück -ODDLYIELD = UNREGLE.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück -PMT = RMZ ## Gibt die periodische Zahlung für eine Annuität zurück -PPMT = KAPZ ## Gibt die Kapitalrückzahlung einer Investition für eine angegebene Periode zurück -PRICE = KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das periodisch Zinsen auszahlt -PRICEDISC = KURSDISAGIO ## Gibt den Kurs pro 100 € Nennwert eines unverzinslichen Wertpapiers zurück -PRICEMAT = KURSFÄLLIG ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt -PV = BW ## Gibt den Barwert einer Investition zurück -RATE = ZINS ## Gibt den Zinssatz pro Zeitraum einer Annuität zurück -RECEIVED = AUSZAHLUNG ## Gibt den Auszahlungsbetrag eines voll investierten Wertpapiers am Fälligkeitstermin zurück -SLN = LIA ## Gibt die lineare Abschreibung eines Wirtschaftsguts pro Periode zurück -SYD = DIA ## Gibt die arithmetisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück -TBILLEQ = TBILLÄQUIV ## Gibt die Rendite für ein Wertpapier zurück -TBILLPRICE = TBILLKURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück -TBILLYIELD = TBILLRENDITE ## Gibt die Rendite für ein Wertpapier zurück -VDB = VDB ## Gibt die degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode oder Teilperiode zurück -XIRR = XINTZINSFUSS ## Gibt den internen Zinsfuß einer Reihe nicht periodisch anfallender Zahlungen zurück -XNPV = XKAPITALWERT ## Gibt den Nettobarwert (Kapitalwert) einer Reihe nicht periodisch anfallender Zahlungen zurück -YIELD = RENDITE ## Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen auszahlt -YIELDDISC = RENDITEDIS ## Gibt die jährliche Rendite eines unverzinslichen Wertpapiers zurück -YIELDMAT = RENDITEFÄLL ## Gibt die jährliche Rendite eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt - - -## -## Information functions Informationsfunktionen -## -CELL = ZELLE ## Gibt Informationen zu Formatierung, Position oder Inhalt einer Zelle zurück -ERROR.TYPE = FEHLER.TYP ## Gibt eine Zahl zurück, die einem Fehlertyp entspricht -INFO = INFO ## Gibt Informationen zur aktuellen Betriebssystemumgebung zurück -ISBLANK = ISTLEER ## Gibt WAHR zurück, wenn der Wert leer ist -ISERR = ISTFEHL ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert außer #N/V ist -ISERROR = ISTFEHLER ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert ist -ISEVEN = ISTGERADE ## Gibt WAHR zurück, wenn es sich um eine gerade Zahl handelt -ISLOGICAL = ISTLOG ## Gibt WAHR zurück, wenn der Wert ein Wahrheitswert ist -ISNA = ISTNV ## Gibt WAHR zurück, wenn der Wert der Fehlerwert #N/V ist -ISNONTEXT = ISTKTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das keinen Text enthält -ISNUMBER = ISTZAHL ## Gibt WAHR zurück, wenn der Wert eine Zahl ist -ISODD = ISTUNGERADE ## Gibt WAHR zurück, wenn es sich um eine ungerade Zahl handelt -ISREF = ISTBEZUG ## Gibt WAHR zurück, wenn der Wert ein Bezug ist -ISTEXT = ISTTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das Text enthält -N = N ## Gibt den in eine Zahl umgewandelten Wert zurück -NA = NV ## Gibt den Fehlerwert #NV zurück -TYPE = TYP ## Gibt eine Zahl zurück, die den Datentyp des angegebenen Werts anzeigt - - -## -## Logical functions Logische Funktionen -## -AND = UND ## Gibt WAHR zurück, wenn alle zugehörigen Argumente WAHR sind -FALSE = FALSCH ## Gibt den Wahrheitswert FALSCH zurück -IF = WENN ## Gibt einen logischen Test zum Ausführen an -IFERROR = WENNFEHLER ## Gibt einen von Ihnen festgelegten Wert zurück, wenn die Auswertung der Formel zu einem Fehler führt; andernfalls wird das Ergebnis der Formel zurückgegeben -NOT = NICHT ## Kehrt den Wahrheitswert der zugehörigen Argumente um -OR = ODER ## Gibt WAHR zurück, wenn ein Argument WAHR ist -TRUE = WAHR ## Gibt den Wahrheitswert WAHR zurück - - -## -## Lookup and reference functions Nachschlage- und Verweisfunktionen -## -ADDRESS = ADRESSE ## Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück -AREAS = BEREICHE ## Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück -CHOOSE = WAHL ## Wählt einen Wert aus eine Liste mit Werten aus -COLUMN = SPALTE ## Gibt die Spaltennummer eines Bezugs zurück -COLUMNS = SPALTEN ## Gibt die Anzahl der Spalten in einem Bezug zurück -HLOOKUP = HVERWEIS ## Sucht in der obersten Zeile einer Matrix und gibt den Wert der angegebenen Zelle zurück -HYPERLINK = HYPERLINK ## Erstellt eine Verknüpfung, über die ein auf einem Netzwerkserver, in einem Intranet oder im Internet gespeichertes Dokument geöffnet wird -INDEX = INDEX ## Verwendet einen Index, um einen Wert aus einem Bezug oder einer Matrix auszuwählen -INDIRECT = INDIREKT ## Gibt einen Bezug zurück, der von einem Textwert angegeben wird -LOOKUP = LOOKUP ## Sucht Werte in einem Vektor oder einer Matrix -MATCH = VERGLEICH ## Sucht Werte in einem Bezug oder einer Matrix -OFFSET = BEREICH.VERSCHIEBEN ## Gibt einen Bezugoffset aus einem gegebenen Bezug zurück -ROW = ZEILE ## Gibt die Zeilennummer eines Bezugs zurück -ROWS = ZEILEN ## Gibt die Anzahl der Zeilen in einem Bezug zurück -RTD = RTD ## Ruft Echtzeitdaten von einem Programm ab, das die COM-Automatisierung (Automatisierung: Ein Verfahren, bei dem aus einer Anwendung oder einem Entwicklungstool heraus mit den Objekten einer anderen Anwendung gearbeitet wird. Die früher als OLE-Automatisierung bezeichnete Automatisierung ist ein Industriestandard und eine Funktion von COM (Component Object Model).) unterstützt -TRANSPOSE = MTRANS ## Gibt die transponierte Matrix einer Matrix zurück -VLOOKUP = SVERWEIS ## Sucht in der ersten Spalte einer Matrix und arbeitet sich durch die Zeile, um den Wert einer Zelle zurückzugeben - - -## -## Math and trigonometry functions Mathematische und trigonometrische Funktionen -## -ABS = ABS ## Gibt den Absolutwert einer Zahl zurück -ACOS = ARCCOS ## Gibt den Arkuskosinus einer Zahl zurück -ACOSH = ARCCOSHYP ## Gibt den umgekehrten hyperbolischen Kosinus einer Zahl zurück -ASIN = ARCSIN ## Gibt den Arkussinus einer Zahl zurück -ASINH = ARCSINHYP ## Gibt den umgekehrten hyperbolischen Sinus einer Zahl zurück -ATAN = ARCTAN ## Gibt den Arkustangens einer Zahl zurück -ATAN2 = ARCTAN2 ## Gibt den Arkustangens einer x- und einer y-Koordinate zurück -ATANH = ARCTANHYP ## Gibt den umgekehrten hyperbolischen Tangens einer Zahl zurück -CEILING = OBERGRENZE ## Rundet eine Zahl auf die nächste ganze Zahl oder das nächste Vielfache von Schritt -COMBIN = KOMBINATIONEN ## Gibt die Anzahl der Kombinationen für eine bestimmte Anzahl von Objekten zurück -COS = COS ## Gibt den Kosinus einer Zahl zurück -COSH = COSHYP ## Gibt den hyperbolischen Kosinus einer Zahl zurück -DEGREES = GRAD ## Wandelt Bogenmaß (Radiant) in Grad um -EVEN = GERADE ## Rundet eine Zahl auf die nächste gerade ganze Zahl auf -EXP = EXP ## Potenziert die Basis e mit der als Argument angegebenen Zahl -FACT = FAKULTÄT ## Gibt die Fakultät einer Zahl zurück -FACTDOUBLE = ZWEIFAKULTÄT ## Gibt die Fakultät zu Zahl mit Schrittlänge 2 zurück -FLOOR = UNTERGRENZE ## Rundet die Zahl auf Anzahl_Stellen ab -GCD = GGT ## Gibt den größten gemeinsamen Teiler zurück -INT = GANZZAHL ## Rundet eine Zahl auf die nächstkleinere ganze Zahl ab -LCM = KGV ## Gibt das kleinste gemeinsame Vielfache zurück -LN = LN ## Gibt den natürlichen Logarithmus einer Zahl zurück -LOG = LOG ## Gibt den Logarithmus einer Zahl zu der angegebenen Basis zurück -LOG10 = LOG10 ## Gibt den Logarithmus einer Zahl zur Basis 10 zurück -MDETERM = MDET ## Gibt die Determinante einer Matrix zurück -MINVERSE = MINV ## Gibt die inverse Matrix einer Matrix zurück -MMULT = MMULT ## Gibt das Produkt zweier Matrizen zurück -MOD = REST ## Gibt den Rest einer Division zurück -MROUND = VRUNDEN ## Gibt eine auf das gewünschte Vielfache gerundete Zahl zurück -MULTINOMIAL = POLYNOMIAL ## Gibt den Polynomialkoeffizienten einer Gruppe von Zahlen zurück -ODD = UNGERADE ## Rundet eine Zahl auf die nächste ungerade ganze Zahl auf -PI = PI ## Gibt den Wert Pi zurück -POWER = POTENZ ## Gibt als Ergebnis eine potenzierte Zahl zurück -PRODUCT = PRODUKT ## Multipliziert die zugehörigen Argumente -QUOTIENT = QUOTIENT ## Gibt den ganzzahligen Anteil einer Division zurück -RADIANS = BOGENMASS ## Wandelt Grad in Bogenmaß (Radiant) um -RAND = ZUFALLSZAHL ## Gibt eine Zufallszahl zwischen 0 und 1 zurück -RANDBETWEEN = ZUFALLSBEREICH ## Gibt eine Zufallszahl aus dem festgelegten Bereich zurück -ROMAN = RÖMISCH ## Wandelt eine arabische Zahl in eine römische Zahl als Text um -ROUND = RUNDEN ## Rundet eine Zahl auf eine bestimmte Anzahl von Dezimalstellen -ROUNDDOWN = ABRUNDEN ## Rundet die Zahl auf Anzahl_Stellen ab -ROUNDUP = AUFRUNDEN ## Rundet die Zahl auf Anzahl_Stellen auf -SERIESSUM = POTENZREIHE ## Gibt die Summe von Potenzen (zur Berechnung von Potenzreihen und dichotomen Wahrscheinlichkeiten) zurück -SIGN = VORZEICHEN ## Gibt das Vorzeichen einer Zahl zurück -SIN = SIN ## Gibt den Sinus einer Zahl zurück -SINH = SINHYP ## Gibt den hyperbolischen Sinus einer Zahl zurück -SQRT = WURZEL ## Gibt die Quadratwurzel einer Zahl zurück -SQRTPI = WURZELPI ## Gibt die Wurzel aus der mit Pi (pi) multiplizierten Zahl zurück -SUBTOTAL = TEILERGEBNIS ## Gibt ein Teilergebnis in einer Liste oder Datenbank zurück -SUM = SUMME ## Addiert die zugehörigen Argumente -SUMIF = SUMMEWENN ## Addiert Zahlen, die mit den Suchkriterien übereinstimmen -SUMIFS = SUMMEWENNS ## Die Zellen, die mehrere Kriterien erfüllen, werden in einem Bereich hinzugefügt -SUMPRODUCT = SUMMENPRODUKT ## Gibt die Summe der Produkte zusammengehöriger Matrixkomponenten zurück -SUMSQ = QUADRATESUMME ## Gibt die Summe der quadrierten Argumente zurück -SUMX2MY2 = SUMMEX2MY2 ## Gibt die Summe der Differenzen der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück -SUMX2PY2 = SUMMEX2PY2 ## Gibt die Summe der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück -SUMXMY2 = SUMMEXMY2 ## Gibt die Summe der quadrierten Differenzen für zusammengehörige Komponenten zweier Matrizen zurück -TAN = TAN ## Gibt den Tangens einer Zahl zurück -TANH = TANHYP ## Gibt den hyperbolischen Tangens einer Zahl zurück -TRUNC = KÜRZEN ## Schneidet die Kommastellen einer Zahl ab und gibt als Ergebnis eine ganze Zahl zurück - - -## -## Statistical functions Statistische Funktionen -## -AVEDEV = MITTELABW ## Gibt die durchschnittliche absolute Abweichung einer Reihe von Merkmalsausprägungen und ihrem Mittelwert zurück -AVERAGE = MITTELWERT ## Gibt den Mittelwert der zugehörigen Argumente zurück -AVERAGEA = MITTELWERTA ## Gibt den Mittelwert der zugehörigen Argumente, die Zahlen, Text und Wahrheitswerte enthalten, zurück -AVERAGEIF = MITTELWERTWENN ## Der Durchschnittswert (arithmetisches Mittel) für alle Zellen in einem Bereich, die einem angegebenen Kriterium entsprechen, wird zurückgegeben -AVERAGEIFS = MITTELWERTWENNS ## Gibt den Durchschnittswert (arithmetisches Mittel) aller Zellen zurück, die mehreren Kriterien entsprechen -BETADIST = BETAVERT ## Gibt die Werte der kumulierten Betaverteilungsfunktion zurück -BETAINV = BETAINV ## Gibt das Quantil der angegebenen Betaverteilung zurück -BINOMDIST = BINOMVERT ## Gibt Wahrscheinlichkeiten einer binomialverteilten Zufallsvariablen zurück -CHIDIST = CHIVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer Chi-Quadrat-verteilten Zufallsgröße zurück -CHIINV = CHIINV ## Gibt Quantile der Verteilungsfunktion (1-Alpha) der Chi-Quadrat-Verteilung zurück -CHITEST = CHITEST ## Gibt die Teststatistik eines Unabhängigkeitstests zurück -CONFIDENCE = KONFIDENZ ## Ermöglicht die Berechnung des 1-Alpha Konfidenzintervalls für den Erwartungswert einer Zufallsvariablen -CORREL = KORREL ## Gibt den Korrelationskoeffizienten zweier Reihen von Merkmalsausprägungen zurück -COUNT = ANZAHL ## Gibt die Anzahl der Zahlen in der Liste mit Argumenten an -COUNTA = ANZAHL2 ## Gibt die Anzahl der Werte in der Liste mit Argumenten an -COUNTBLANK = ANZAHLLEEREZELLEN ## Gibt die Anzahl der leeren Zellen in einem Bereich an -COUNTIF = ZÄHLENWENN ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit den Suchkriterien übereinstimmen -COUNTIFS = ZÄHLENWENNS ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit mehreren Suchkriterien übereinstimmen -COVAR = KOVAR ## Gibt die Kovarianz zurück, den Mittelwert der für alle Datenpunktpaare gebildeten Produkte der Abweichungen -CRITBINOM = KRITBINOM ## Gibt den kleinsten Wert zurück, für den die kumulierten Wahrscheinlichkeiten der Binomialverteilung kleiner oder gleich einer Grenzwahrscheinlichkeit sind -DEVSQ = SUMQUADABW ## Gibt die Summe der quadrierten Abweichungen der Datenpunkte von ihrem Stichprobenmittelwert zurück -EXPONDIST = EXPONVERT ## Gibt Wahrscheinlichkeiten einer exponential verteilten Zufallsvariablen zurück -FDIST = FVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer F-verteilten Zufallsvariablen zurück -FINV = FINV ## Gibt Quantile der F-Verteilung zurück -FISHER = FISHER ## Gibt die Fisher-Transformation zurück -FISHERINV = FISHERINV ## Gibt die Umkehrung der Fisher-Transformation zurück -FORECAST = PROGNOSE ## Gibt einen Wert zurück, der sich aus einem linearen Trend ergibt -FREQUENCY = HÄUFIGKEIT ## Gibt eine Häufigkeitsverteilung als vertikale Matrix zurück -FTEST = FTEST ## Gibt die Teststatistik eines F-Tests zurück -GAMMADIST = GAMMAVERT ## Gibt Wahrscheinlichkeiten einer gammaverteilten Zufallsvariablen zurück -GAMMAINV = GAMMAINV ## Gibt Quantile der Gammaverteilung zurück -GAMMALN = GAMMALN ## Gibt den natürlichen Logarithmus der Gammafunktion zurück, Γ(x) -GEOMEAN = GEOMITTEL ## Gibt das geometrische Mittel zurück -GROWTH = VARIATION ## Gibt Werte zurück, die sich aus einem exponentiellen Trend ergeben -HARMEAN = HARMITTEL ## Gibt das harmonische Mittel zurück -HYPGEOMDIST = HYPGEOMVERT ## Gibt Wahrscheinlichkeiten einer hypergeometrisch-verteilten Zufallsvariablen zurück -INTERCEPT = ACHSENABSCHNITT ## Gibt den Schnittpunkt der Regressionsgeraden zurück -KURT = KURT ## Gibt die Kurtosis (Exzess) einer Datengruppe zurück -LARGE = KGRÖSSTE ## Gibt den k-größten Wert einer Datengruppe zurück -LINEST = RGP ## Gibt die Parameter eines linearen Trends zurück -LOGEST = RKP ## Gibt die Parameter eines exponentiellen Trends zurück -LOGINV = LOGINV ## Gibt Quantile der Lognormalverteilung zurück -LOGNORMDIST = LOGNORMVERT ## Gibt Werte der Verteilungsfunktion einer lognormalverteilten Zufallsvariablen zurück -MAX = MAX ## Gibt den Maximalwert einer Liste mit Argumenten zurück -MAXA = MAXA ## Gibt den Maximalwert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten -MEDIAN = MEDIAN ## Gibt den Median der angegebenen Zahlen zurück -MIN = MIN ## Gibt den Minimalwert einer Liste mit Argumenten zurück -MINA = MINA ## Gibt den kleinsten Wert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten -MODE = MODALWERT ## Gibt den am häufigsten vorkommenden Wert in einer Datengruppe zurück -NEGBINOMDIST = NEGBINOMVERT ## Gibt Wahrscheinlichkeiten einer negativen, binominal verteilten Zufallsvariablen zurück -NORMDIST = NORMVERT ## Gibt Wahrscheinlichkeiten einer normal verteilten Zufallsvariablen zurück -NORMINV = NORMINV ## Gibt Quantile der Normalverteilung zurück -NORMSDIST = STANDNORMVERT ## Gibt Werte der Verteilungsfunktion einer standardnormalverteilten Zufallsvariablen zurück -NORMSINV = STANDNORMINV ## Gibt Quantile der Standardnormalverteilung zurück -PEARSON = PEARSON ## Gibt den Pearsonschen Korrelationskoeffizienten zurück -PERCENTILE = QUANTIL ## Gibt das Alpha-Quantil einer Gruppe von Daten zurück -PERCENTRANK = QUANTILSRANG ## Gibt den prozentualen Rang (Alpha) eines Werts in einer Datengruppe zurück -PERMUT = VARIATIONEN ## Gibt die Anzahl der Möglichkeiten zurück, um k Elemente aus einer Menge von n Elementen ohne Zurücklegen zu ziehen -POISSON = POISSON ## Gibt Wahrscheinlichkeiten einer poissonverteilten Zufallsvariablen zurück -PROB = WAHRSCHBEREICH ## Gibt die Wahrscheinlichkeit für ein von zwei Werten eingeschlossenes Intervall zurück -QUARTILE = QUARTILE ## Gibt die Quartile der Datengruppe zurück -RANK = RANG ## Gibt den Rang zurück, den eine Zahl innerhalb einer Liste von Zahlen einnimmt -RSQ = BESTIMMTHEITSMASS ## Gibt das Quadrat des Pearsonschen Korrelationskoeffizienten zurück -SKEW = SCHIEFE ## Gibt die Schiefe einer Verteilung zurück -SLOPE = STEIGUNG ## Gibt die Steigung der Regressionsgeraden zurück -SMALL = KKLEINSTE ## Gibt den k-kleinsten Wert einer Datengruppe zurück -STANDARDIZE = STANDARDISIERUNG ## Gibt den standardisierten Wert zurück -STDEV = STABW ## Schätzt die Standardabweichung ausgehend von einer Stichprobe -STDEVA = STABWA ## Schätzt die Standardabweichung ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält -STDEVP = STABWN ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit -STDEVPA = STABWNA ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält -STEYX = STFEHLERYX ## Gibt den Standardfehler der geschätzten y-Werte für alle x-Werte der Regression zurück -TDIST = TVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer (Student) t-verteilten Zufallsvariablen zurück -TINV = TINV ## Gibt Quantile der t-Verteilung zurück -TREND = TREND ## Gibt Werte zurück, die sich aus einem linearen Trend ergeben -TRIMMEAN = GESTUTZTMITTEL ## Gibt den Mittelwert einer Datengruppe zurück, ohne die Randwerte zu berücksichtigen -TTEST = TTEST ## Gibt die Teststatistik eines Student'schen t-Tests zurück -VAR = VARIANZ ## Schätzt die Varianz ausgehend von einer Stichprobe -VARA = VARIANZA ## Schätzt die Varianz ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält -VARP = VARIANZEN ## Berechnet die Varianz ausgehend von der Grundgesamtheit -VARPA = VARIANZENA ## Berechnet die Varianz ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält -WEIBULL = WEIBULL ## Gibt Wahrscheinlichkeiten einer weibullverteilten Zufallsvariablen zurück -ZTEST = GTEST ## Gibt den einseitigen Wahrscheinlichkeitswert für einen Gausstest (Normalverteilung) zurück - - -## -## Text functions Textfunktionen -## -ASC = ASC ## Konvertiert DB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in SB-Text -BAHTTEXT = BAHTTEXT ## Wandelt eine Zahl in Text im Währungsformat ß (Baht) um -CHAR = ZEICHEN ## Gibt das der Codezahl entsprechende Zeichen zurück -CLEAN = SÄUBERN ## Löscht alle nicht druckbaren Zeichen aus einem Text -CODE = CODE ## Gibt die Codezahl des ersten Zeichens in einem Text zurück -CONCATENATE = VERKETTEN ## Verknüpft mehrere Textelemente zu einem Textelement -DOLLAR = DM ## Wandelt eine Zahl in Text im Währungsformat € (Euro) um -EXACT = IDENTISCH ## Prüft, ob zwei Textwerte identisch sind -FIND = FINDEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden) -FINDB = FINDENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden) -FIXED = FEST ## Formatiert eine Zahl als Text mit einer festen Anzahl von Dezimalstellen -JIS = JIS ## Konvertiert SB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in DB-Text -LEFT = LINKS ## Gibt die Zeichen ganz links in einem Textwert zurück -LEFTB = LINKSB ## Gibt die Zeichen ganz links in einem Textwert zurück -LEN = LÄNGE ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück -LENB = LÄNGEB ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück -LOWER = KLEIN ## Wandelt Text in Kleinbuchstaben um -MID = TEIL ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück -MIDB = TEILB ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück -PHONETIC = PHONETIC ## Extrahiert die phonetischen (Furigana-)Zeichen aus einer Textzeichenfolge -PROPER = GROSS2 ## Wandelt den ersten Buchstaben aller Wörter eines Textwerts in Großbuchstaben um -REPLACE = ERSETZEN ## Ersetzt Zeichen in Text -REPLACEB = ERSETZENB ## Ersetzt Zeichen in Text -REPT = WIEDERHOLEN ## Wiederholt einen Text so oft wie angegeben -RIGHT = RECHTS ## Gibt die Zeichen ganz rechts in einem Textwert zurück -RIGHTB = RECHTSB ## Gibt die Zeichen ganz rechts in einem Textwert zurück -SEARCH = SUCHEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden) -SEARCHB = SUCHENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden) -SUBSTITUTE = WECHSELN ## Ersetzt in einer Zeichenfolge neuen Text gegen alten -T = T ## Wandelt die zugehörigen Argumente in Text um -TEXT = TEXT ## Formatiert eine Zahl und wandelt sie in Text um -TRIM = GLÄTTEN ## Entfernt Leerzeichen aus Text -UPPER = GROSS ## Wandelt Text in Großbuchstaben um -VALUE = WERT ## Wandelt ein Textargument in eine Zahl um diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/en/uk/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/en/uk/config deleted file mode 100644 index 82f9abd84d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/en/uk/config +++ /dev/null @@ -1,32 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -## -## (For future use) -## -currencySymbol = £ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/config deleted file mode 100644 index ed2113b8de..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rather than € - - -## -## Excel Error Codes (For future use) -## -NULL = #¡NULO! -DIV0 = #¡DIV/0! -VALUE = #¡VALOR! -REF = #¡REF! -NAME = #¿NOMBRE? -NUM = #¡NÚM! -NA = #N/A diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/functions deleted file mode 100644 index 2042be4ef7..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/es/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Funciones de complementos y automatización -## -GETPIVOTDATA = IMPORTARDATOSDINAMICOS ## Devuelve los datos almacenados en un informe de tabla dinámica. - - -## -## Cube functions Funciones de cubo -## -CUBEKPIMEMBER = MIEMBROKPICUBO ## Devuelve un nombre, propiedad y medida de indicador de rendimiento clave (KPI) y muestra el nombre y la propiedad en la celda. Un KPI es una medida cuantificable, como los beneficios brutos mensuales o la facturación trimestral por empleado, que se usa para supervisar el rendimiento de una organización. -CUBEMEMBER = MIEMBROCUBO ## Devuelve un miembro o tupla en una jerarquía de cubo. Se usa para validar la existencia del miembro o la tupla en el cubo. -CUBEMEMBERPROPERTY = PROPIEDADMIEMBROCUBO ## Devuelve el valor de una propiedad de miembro del cubo Se usa para validar la existencia de un nombre de miembro en el cubo y para devolver la propiedad especificada para este miembro. -CUBERANKEDMEMBER = MIEMBRORANGOCUBO ## Devuelve el miembro n, o clasificado, de un conjunto. Se usa para devolver uno o más elementos de un conjunto, por ejemplo, el representante con mejores ventas o los diez mejores alumnos. -CUBESET = CONJUNTOCUBO ## Define un conjunto calculado de miembros o tuplas mediante el envío de una expresión de conjunto al cubo en el servidor, lo que crea el conjunto y, después, devuelve dicho conjunto a Microsoft Office Excel. -CUBESETCOUNT = RECUENTOCONJUNTOCUBO ## Devuelve el número de elementos de un conjunto. -CUBEVALUE = VALORCUBO ## Devuelve un valor agregado de un cubo. - - -## -## Database functions Funciones de base de datos -## -DAVERAGE = BDPROMEDIO ## Devuelve el promedio de las entradas seleccionadas en la base de datos. -DCOUNT = BDCONTAR ## Cuenta el número de celdas que contienen números en una base de datos. -DCOUNTA = BDCONTARA ## Cuenta el número de celdas no vacías en una base de datos. -DGET = BDEXTRAER ## Extrae de una base de datos un único registro que cumple los criterios especificados. -DMAX = BDMAX ## Devuelve el valor máximo de las entradas seleccionadas de la base de datos. -DMIN = BDMIN ## Devuelve el valor mínimo de las entradas seleccionadas de la base de datos. -DPRODUCT = BDPRODUCTO ## Multiplica los valores de un campo concreto de registros de una base de datos que cumplen los criterios especificados. -DSTDEV = BDDESVEST ## Calcula la desviación estándar a partir de una muestra de entradas seleccionadas en la base de datos. -DSTDEVP = BDDESVESTP ## Calcula la desviación estándar en función de la población total de las entradas seleccionadas de la base de datos. -DSUM = BDSUMA ## Suma los números de la columna de campo de los registros de la base de datos que cumplen los criterios. -DVAR = BDVAR ## Calcula la varianza a partir de una muestra de entradas seleccionadas de la base de datos. -DVARP = BDVARP ## Calcula la varianza a partir de la población total de entradas seleccionadas de la base de datos. - - -## -## Date and time functions Funciones de fecha y hora -## -DATE = FECHA ## Devuelve el número de serie correspondiente a una fecha determinada. -DATEVALUE = FECHANUMERO ## Convierte una fecha con formato de texto en un valor de número de serie. -DAY = DIA ## Convierte un número de serie en un valor de día del mes. -DAYS360 = DIAS360 ## Calcula el número de días entre dos fechas a partir de un año de 360 días. -EDATE = FECHA.MES ## Devuelve el número de serie de la fecha equivalente al número indicado de meses anteriores o posteriores a la fecha inicial. -EOMONTH = FIN.MES ## Devuelve el número de serie correspondiente al último día del mes anterior o posterior a un número de meses especificado. -HOUR = HORA ## Convierte un número de serie en un valor de hora. -MINUTE = MINUTO ## Convierte un número de serie en un valor de minuto. -MONTH = MES ## Convierte un número de serie en un valor de mes. -NETWORKDAYS = DIAS.LAB ## Devuelve el número de todos los días laborables existentes entre dos fechas. -NOW = AHORA ## Devuelve el número de serie correspondiente a la fecha y hora actuales. -SECOND = SEGUNDO ## Convierte un número de serie en un valor de segundo. -TIME = HORA ## Devuelve el número de serie correspondiente a una hora determinada. -TIMEVALUE = HORANUMERO ## Convierte una hora con formato de texto en un valor de número de serie. -TODAY = HOY ## Devuelve el número de serie correspondiente al día actual. -WEEKDAY = DIASEM ## Convierte un número de serie en un valor de día de la semana. -WEEKNUM = NUM.DE.SEMANA ## Convierte un número de serie en un número que representa el lugar numérico correspondiente a una semana de un año. -WORKDAY = DIA.LAB ## Devuelve el número de serie de la fecha que tiene lugar antes o después de un número determinado de días laborables. -YEAR = AÑO ## Convierte un número de serie en un valor de año. -YEARFRAC = FRAC.AÑO ## Devuelve la fracción de año que representa el número total de días existentes entre el valor de fecha_inicial y el de fecha_final. - - -## -## Engineering functions Funciones de ingeniería -## -BESSELI = BESSELI ## Devuelve la función Bessel In(x) modificada. -BESSELJ = BESSELJ ## Devuelve la función Bessel Jn(x). -BESSELK = BESSELK ## Devuelve la función Bessel Kn(x) modificada. -BESSELY = BESSELY ## Devuelve la función Bessel Yn(x). -BIN2DEC = BIN.A.DEC ## Convierte un número binario en decimal. -BIN2HEX = BIN.A.HEX ## Convierte un número binario en hexadecimal. -BIN2OCT = BIN.A.OCT ## Convierte un número binario en octal. -COMPLEX = COMPLEJO ## Convierte coeficientes reales e imaginarios en un número complejo. -CONVERT = CONVERTIR ## Convierte un número de un sistema de medida a otro. -DEC2BIN = DEC.A.BIN ## Convierte un número decimal en binario. -DEC2HEX = DEC.A.HEX ## Convierte un número decimal en hexadecimal. -DEC2OCT = DEC.A.OCT ## Convierte un número decimal en octal. -DELTA = DELTA ## Comprueba si dos valores son iguales. -ERF = FUN.ERROR ## Devuelve la función de error. -ERFC = FUN.ERROR.COMPL ## Devuelve la función de error complementario. -GESTEP = MAYOR.O.IGUAL ## Comprueba si un número es mayor que un valor de umbral. -HEX2BIN = HEX.A.BIN ## Convierte un número hexadecimal en binario. -HEX2DEC = HEX.A.DEC ## Convierte un número hexadecimal en decimal. -HEX2OCT = HEX.A.OCT ## Convierte un número hexadecimal en octal. -IMABS = IM.ABS ## Devuelve el valor absoluto (módulo) de un número complejo. -IMAGINARY = IMAGINARIO ## Devuelve el coeficiente imaginario de un número complejo. -IMARGUMENT = IM.ANGULO ## Devuelve el argumento theta, un ángulo expresado en radianes. -IMCONJUGATE = IM.CONJUGADA ## Devuelve la conjugada compleja de un número complejo. -IMCOS = IM.COS ## Devuelve el coseno de un número complejo. -IMDIV = IM.DIV ## Devuelve el cociente de dos números complejos. -IMEXP = IM.EXP ## Devuelve el valor exponencial de un número complejo. -IMLN = IM.LN ## Devuelve el logaritmo natural (neperiano) de un número complejo. -IMLOG10 = IM.LOG10 ## Devuelve el logaritmo en base 10 de un número complejo. -IMLOG2 = IM.LOG2 ## Devuelve el logaritmo en base 2 de un número complejo. -IMPOWER = IM.POT ## Devuelve un número complejo elevado a una potencia entera. -IMPRODUCT = IM.PRODUCT ## Devuelve el producto de números complejos. -IMREAL = IM.REAL ## Devuelve el coeficiente real de un número complejo. -IMSIN = IM.SENO ## Devuelve el seno de un número complejo. -IMSQRT = IM.RAIZ2 ## Devuelve la raíz cuadrada de un número complejo. -IMSUB = IM.SUSTR ## Devuelve la diferencia entre dos números complejos. -IMSUM = IM.SUM ## Devuelve la suma de números complejos. -OCT2BIN = OCT.A.BIN ## Convierte un número octal en binario. -OCT2DEC = OCT.A.DEC ## Convierte un número octal en decimal. -OCT2HEX = OCT.A.HEX ## Convierte un número octal en hexadecimal. - - -## -## Financial functions Funciones financieras -## -ACCRINT = INT.ACUM ## Devuelve el interés acumulado de un valor bursátil con pagos de interés periódicos. -ACCRINTM = INT.ACUM.V ## Devuelve el interés acumulado de un valor bursátil con pagos de interés al vencimiento. -AMORDEGRC = AMORTIZ.PROGRE ## Devuelve la amortización de cada período contable mediante el uso de un coeficiente de amortización. -AMORLINC = AMORTIZ.LIN ## Devuelve la amortización de cada uno de los períodos contables. -COUPDAYBS = CUPON.DIAS.L1 ## Devuelve el número de días desde el principio del período de un cupón hasta la fecha de liquidación. -COUPDAYS = CUPON.DIAS ## Devuelve el número de días del período (entre dos cupones) donde se encuentra la fecha de liquidación. -COUPDAYSNC = CUPON.DIAS.L2 ## Devuelve el número de días desde la fecha de liquidación hasta la fecha del próximo cupón. -COUPNCD = CUPON.FECHA.L2 ## Devuelve la fecha del próximo cupón después de la fecha de liquidación. -COUPNUM = CUPON.NUM ## Devuelve el número de pagos de cupón entre la fecha de liquidación y la fecha de vencimiento. -COUPPCD = CUPON.FECHA.L1 ## Devuelve la fecha de cupón anterior a la fecha de liquidación. -CUMIPMT = PAGO.INT.ENTRE ## Devuelve el interés acumulado pagado entre dos períodos. -CUMPRINC = PAGO.PRINC.ENTRE ## Devuelve el capital acumulado pagado de un préstamo entre dos períodos. -DB = DB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización de saldo fijo. -DDB = DDB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización por doble disminución de saldo u otro método que se especifique. -DISC = TASA.DESC ## Devuelve la tasa de descuento de un valor bursátil. -DOLLARDE = MONEDA.DEC ## Convierte una cotización de un valor bursátil expresada en forma fraccionaria en una cotización de un valor bursátil expresada en forma decimal. -DOLLARFR = MONEDA.FRAC ## Convierte una cotización de un valor bursátil expresada en forma decimal en una cotización de un valor bursátil expresada en forma fraccionaria. -DURATION = DURACION ## Devuelve la duración anual de un valor bursátil con pagos de interés periódico. -EFFECT = INT.EFECTIVO ## Devuelve la tasa de interés anual efectiva. -FV = VF ## Devuelve el valor futuro de una inversión. -FVSCHEDULE = VF.PLAN ## Devuelve el valor futuro de un capital inicial después de aplicar una serie de tasas de interés compuesto. -INTRATE = TASA.INT ## Devuelve la tasa de interés para la inversión total de un valor bursátil. -IPMT = PAGOINT ## Devuelve el pago de intereses de una inversión durante un período determinado. -IRR = TIR ## Devuelve la tasa interna de retorno para una serie de flujos de efectivo periódicos. -ISPMT = INT.PAGO.DIR ## Calcula el interés pagado durante un período específico de una inversión. -MDURATION = DURACION.MODIF ## Devuelve la duración de Macauley modificada de un valor bursátil con un valor nominal supuesto de 100 $. -MIRR = TIRM ## Devuelve la tasa interna de retorno donde se financian flujos de efectivo positivos y negativos a tasas diferentes. -NOMINAL = TASA.NOMINAL ## Devuelve la tasa nominal de interés anual. -NPER = NPER ## Devuelve el número de períodos de una inversión. -NPV = VNA ## Devuelve el valor neto actual de una inversión en función de una serie de flujos periódicos de efectivo y una tasa de descuento. -ODDFPRICE = PRECIO.PER.IRREGULAR.1 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un primer período impar. -ODDFYIELD = RENDTO.PER.IRREGULAR.1 ## Devuelve el rendimiento de un valor bursátil con un primer período impar. -ODDLPRICE = PRECIO.PER.IRREGULAR.2 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un último período impar. -ODDLYIELD = RENDTO.PER.IRREGULAR.2 ## Devuelve el rendimiento de un valor bursátil con un último período impar. -PMT = PAGO ## Devuelve el pago periódico de una anualidad. -PPMT = PAGOPRIN ## Devuelve el pago de capital de una inversión durante un período determinado. -PRICE = PRECIO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga una tasa de interés periódico. -PRICEDISC = PRECIO.DESCUENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con descuento. -PRICEMAT = PRECIO.VENCIMIENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga interés a su vencimiento. -PV = VALACT ## Devuelve el valor actual de una inversión. -RATE = TASA ## Devuelve la tasa de interés por período de una anualidad. -RECEIVED = CANTIDAD.RECIBIDA ## Devuelve la cantidad recibida al vencimiento de un valor bursátil completamente invertido. -SLN = SLN ## Devuelve la amortización por método directo de un bien en un período dado. -SYD = SYD ## Devuelve la amortización por suma de dígitos de los años de un bien durante un período especificado. -TBILLEQ = LETRA.DE.TES.EQV.A.BONO ## Devuelve el rendimiento de un bono equivalente a una letra del Tesoro (de EE.UU.) -TBILLPRICE = LETRA.DE.TES.PRECIO ## Devuelve el precio por un valor nominal de 100 $ de una letra del Tesoro (de EE.UU.) -TBILLYIELD = LETRA.DE.TES.RENDTO ## Devuelve el rendimiento de una letra del Tesoro (de EE.UU.) -VDB = DVS ## Devuelve la amortización de un bien durante un período específico o parcial a través del método de cálculo del saldo en disminución. -XIRR = TIR.NO.PER ## Devuelve la tasa interna de retorno para un flujo de efectivo que no es necesariamente periódico. -XNPV = VNA.NO.PER ## Devuelve el valor neto actual para un flujo de efectivo que no es necesariamente periódico. -YIELD = RENDTO ## Devuelve el rendimiento de un valor bursátil que paga intereses periódicos. -YIELDDISC = RENDTO.DESC ## Devuelve el rendimiento anual de un valor bursátil con descuento; por ejemplo, una letra del Tesoro (de EE.UU.) -YIELDMAT = RENDTO.VENCTO ## Devuelve el rendimiento anual de un valor bursátil que paga intereses al vencimiento. - - -## -## Information functions Funciones de información -## -CELL = CELDA ## Devuelve información acerca del formato, la ubicación o el contenido de una celda. -ERROR.TYPE = TIPO.DE.ERROR ## Devuelve un número que corresponde a un tipo de error. -INFO = INFO ## Devuelve información acerca del entorno operativo en uso. -ISBLANK = ESBLANCO ## Devuelve VERDADERO si el valor está en blanco. -ISERR = ESERR ## Devuelve VERDADERO si el valor es cualquier valor de error excepto #N/A. -ISERROR = ESERROR ## Devuelve VERDADERO si el valor es cualquier valor de error. -ISEVEN = ES.PAR ## Devuelve VERDADERO si el número es par. -ISLOGICAL = ESLOGICO ## Devuelve VERDADERO si el valor es un valor lógico. -ISNA = ESNOD ## Devuelve VERDADERO si el valor es el valor de error #N/A. -ISNONTEXT = ESNOTEXTO ## Devuelve VERDADERO si el valor no es texto. -ISNUMBER = ESNUMERO ## Devuelve VERDADERO si el valor es un número. -ISODD = ES.IMPAR ## Devuelve VERDADERO si el número es impar. -ISREF = ESREF ## Devuelve VERDADERO si el valor es una referencia. -ISTEXT = ESTEXTO ## Devuelve VERDADERO si el valor es texto. -N = N ## Devuelve un valor convertido en un número. -NA = ND ## Devuelve el valor de error #N/A. -TYPE = TIPO ## Devuelve un número que indica el tipo de datos de un valor. - - -## -## Logical functions Funciones lógicas -## -AND = Y ## Devuelve VERDADERO si todos sus argumentos son VERDADERO. -FALSE = FALSO ## Devuelve el valor lógico FALSO. -IF = SI ## Especifica una prueba lógica que realizar. -IFERROR = SI.ERROR ## Devuelve un valor que se especifica si una fórmula lo evalúa como un error; de lo contrario, devuelve el resultado de la fórmula. -NOT = NO ## Invierte el valor lógico del argumento. -OR = O ## Devuelve VERDADERO si cualquier argumento es VERDADERO. -TRUE = VERDADERO ## Devuelve el valor lógico VERDADERO. - - -## -## Lookup and reference functions Funciones de búsqueda y referencia -## -ADDRESS = DIRECCION ## Devuelve una referencia como texto a una sola celda de una hoja de cálculo. -AREAS = AREAS ## Devuelve el número de áreas de una referencia. -CHOOSE = ELEGIR ## Elige un valor de una lista de valores. -COLUMN = COLUMNA ## Devuelve el número de columna de una referencia. -COLUMNS = COLUMNAS ## Devuelve el número de columnas de una referencia. -HLOOKUP = BUSCARH ## Busca en la fila superior de una matriz y devuelve el valor de la celda indicada. -HYPERLINK = HIPERVINCULO ## Crea un acceso directo o un salto que abre un documento almacenado en un servidor de red, en una intranet o en Internet. -INDEX = INDICE ## Usa un índice para elegir un valor de una referencia o matriz. -INDIRECT = INDIRECTO ## Devuelve una referencia indicada por un valor de texto. -LOOKUP = BUSCAR ## Busca valores de un vector o una matriz. -MATCH = COINCIDIR ## Busca valores de una referencia o matriz. -OFFSET = DESREF ## Devuelve un desplazamiento de referencia respecto a una referencia dada. -ROW = FILA ## Devuelve el número de fila de una referencia. -ROWS = FILAS ## Devuelve el número de filas de una referencia. -RTD = RDTR ## Recupera datos en tiempo real desde un programa compatible con la automatización COM (automatización: modo de trabajar con los objetos de una aplicación desde otra aplicación o herramienta de entorno. La automatización, antes denominada automatización OLE, es un estándar de la industria y una función del Modelo de objetos componentes (COM).). -TRANSPOSE = TRANSPONER ## Devuelve la transposición de una matriz. -VLOOKUP = BUSCARV ## Busca en la primera columna de una matriz y se mueve en horizontal por la fila para devolver el valor de una celda. - - -## -## Math and trigonometry functions Funciones matemáticas y trigonométricas -## -ABS = ABS ## Devuelve el valor absoluto de un número. -ACOS = ACOS ## Devuelve el arcocoseno de un número. -ACOSH = ACOSH ## Devuelve el coseno hiperbólico inverso de un número. -ASIN = ASENO ## Devuelve el arcoseno de un número. -ASINH = ASENOH ## Devuelve el seno hiperbólico inverso de un número. -ATAN = ATAN ## Devuelve la arcotangente de un número. -ATAN2 = ATAN2 ## Devuelve la arcotangente de las coordenadas "x" e "y". -ATANH = ATANH ## Devuelve la tangente hiperbólica inversa de un número. -CEILING = MULTIPLO.SUPERIOR ## Redondea un número al entero más próximo o al múltiplo significativo más cercano. -COMBIN = COMBINAT ## Devuelve el número de combinaciones para un número determinado de objetos. -COS = COS ## Devuelve el coseno de un número. -COSH = COSH ## Devuelve el coseno hiperbólico de un número. -DEGREES = GRADOS ## Convierte radianes en grados. -EVEN = REDONDEA.PAR ## Redondea un número hasta el entero par más próximo. -EXP = EXP ## Devuelve e elevado a la potencia de un número dado. -FACT = FACT ## Devuelve el factorial de un número. -FACTDOUBLE = FACT.DOBLE ## Devuelve el factorial doble de un número. -FLOOR = MULTIPLO.INFERIOR ## Redondea un número hacia abajo, en dirección hacia cero. -GCD = M.C.D ## Devuelve el máximo común divisor. -INT = ENTERO ## Redondea un número hacia abajo hasta el entero más próximo. -LCM = M.C.M ## Devuelve el mínimo común múltiplo. -LN = LN ## Devuelve el logaritmo natural (neperiano) de un número. -LOG = LOG ## Devuelve el logaritmo de un número en una base especificada. -LOG10 = LOG10 ## Devuelve el logaritmo en base 10 de un número. -MDETERM = MDETERM ## Devuelve la determinante matricial de una matriz. -MINVERSE = MINVERSA ## Devuelve la matriz inversa de una matriz. -MMULT = MMULT ## Devuelve el producto de matriz de dos matrices. -MOD = RESIDUO ## Devuelve el resto de la división. -MROUND = REDOND.MULT ## Devuelve un número redondeado al múltiplo deseado. -MULTINOMIAL = MULTINOMIAL ## Devuelve el polinomio de un conjunto de números. -ODD = REDONDEA.IMPAR ## Redondea un número hacia arriba hasta el entero impar más próximo. -PI = PI ## Devuelve el valor de pi. -POWER = POTENCIA ## Devuelve el resultado de elevar un número a una potencia. -PRODUCT = PRODUCTO ## Multiplica sus argumentos. -QUOTIENT = COCIENTE ## Devuelve la parte entera de una división. -RADIANS = RADIANES ## Convierte grados en radianes. -RAND = ALEATORIO ## Devuelve un número aleatorio entre 0 y 1. -RANDBETWEEN = ALEATORIO.ENTRE ## Devuelve un número aleatorio entre los números que especifique. -ROMAN = NUMERO.ROMANO ## Convierte un número arábigo en número romano, con formato de texto. -ROUND = REDONDEAR ## Redondea un número al número de decimales especificado. -ROUNDDOWN = REDONDEAR.MENOS ## Redondea un número hacia abajo, en dirección hacia cero. -ROUNDUP = REDONDEAR.MAS ## Redondea un número hacia arriba, en dirección contraria a cero. -SERIESSUM = SUMA.SERIES ## Devuelve la suma de una serie de potencias en función de la fórmula. -SIGN = SIGNO ## Devuelve el signo de un número. -SIN = SENO ## Devuelve el seno de un ángulo determinado. -SINH = SENOH ## Devuelve el seno hiperbólico de un número. -SQRT = RAIZ ## Devuelve la raíz cuadrada positiva de un número. -SQRTPI = RAIZ2PI ## Devuelve la raíz cuadrada de un número multiplicado por PI (número * pi). -SUBTOTAL = SUBTOTALES ## Devuelve un subtotal en una lista o base de datos. -SUM = SUMA ## Suma sus argumentos. -SUMIF = SUMAR.SI ## Suma las celdas especificadas que cumplen unos criterios determinados. -SUMIFS = SUMAR.SI.CONJUNTO ## Suma las celdas de un rango que cumplen varios criterios. -SUMPRODUCT = SUMAPRODUCTO ## Devuelve la suma de los productos de los correspondientes componentes de matriz. -SUMSQ = SUMA.CUADRADOS ## Devuelve la suma de los cuadrados de los argumentos. -SUMX2MY2 = SUMAX2MENOSY2 ## Devuelve la suma de la diferencia de los cuadrados de los valores correspondientes de dos matrices. -SUMX2PY2 = SUMAX2MASY2 ## Devuelve la suma de la suma de los cuadrados de los valores correspondientes de dos matrices. -SUMXMY2 = SUMAXMENOSY2 ## Devuelve la suma de los cuadrados de las diferencias de los valores correspondientes de dos matrices. -TAN = TAN ## Devuelve la tangente de un número. -TANH = TANH ## Devuelve la tangente hiperbólica de un número. -TRUNC = TRUNCAR ## Trunca un número a un entero. - - -## -## Statistical functions Funciones estadísticas -## -AVEDEV = DESVPROM ## Devuelve el promedio de las desviaciones absolutas de la media de los puntos de datos. -AVERAGE = PROMEDIO ## Devuelve el promedio de sus argumentos. -AVERAGEA = PROMEDIOA ## Devuelve el promedio de sus argumentos, incluidos números, texto y valores lógicos. -AVERAGEIF = PROMEDIO.SI ## Devuelve el promedio (media aritmética) de todas las celdas de un rango que cumplen unos criterios determinados. -AVERAGEIFS = PROMEDIO.SI.CONJUNTO ## Devuelve el promedio (media aritmética) de todas las celdas que cumplen múltiples criterios. -BETADIST = DISTR.BETA ## Devuelve la función de distribución beta acumulativa. -BETAINV = DISTR.BETA.INV ## Devuelve la función inversa de la función de distribución acumulativa de una distribución beta especificada. -BINOMDIST = DISTR.BINOM ## Devuelve la probabilidad de una variable aleatoria discreta siguiendo una distribución binomial. -CHIDIST = DISTR.CHI ## Devuelve la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola. -CHIINV = PRUEBA.CHI.INV ## Devuelve la función inversa de la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola. -CHITEST = PRUEBA.CHI ## Devuelve la prueba de independencia. -CONFIDENCE = INTERVALO.CONFIANZA ## Devuelve el intervalo de confianza de la media de una población. -CORREL = COEF.DE.CORREL ## Devuelve el coeficiente de correlación entre dos conjuntos de datos. -COUNT = CONTAR ## Cuenta cuántos números hay en la lista de argumentos. -COUNTA = CONTARA ## Cuenta cuántos valores hay en la lista de argumentos. -COUNTBLANK = CONTAR.BLANCO ## Cuenta el número de celdas en blanco de un rango. -COUNTIF = CONTAR.SI ## Cuenta el número de celdas, dentro del rango, que cumplen el criterio especificado. -COUNTIFS = CONTAR.SI.CONJUNTO ## Cuenta el número de celdas, dentro del rango, que cumplen varios criterios. -COVAR = COVAR ## Devuelve la covarianza, que es el promedio de los productos de las desviaciones para cada pareja de puntos de datos. -CRITBINOM = BINOM.CRIT ## Devuelve el menor valor cuya distribución binomial acumulativa es menor o igual a un valor de criterio. -DEVSQ = DESVIA2 ## Devuelve la suma de los cuadrados de las desviaciones. -EXPONDIST = DISTR.EXP ## Devuelve la distribución exponencial. -FDIST = DISTR.F ## Devuelve la distribución de probabilidad F. -FINV = DISTR.F.INV ## Devuelve la función inversa de la distribución de probabilidad F. -FISHER = FISHER ## Devuelve la transformación Fisher. -FISHERINV = PRUEBA.FISHER.INV ## Devuelve la función inversa de la transformación Fisher. -FORECAST = PRONOSTICO ## Devuelve un valor en una tendencia lineal. -FREQUENCY = FRECUENCIA ## Devuelve una distribución de frecuencia como una matriz vertical. -FTEST = PRUEBA.F ## Devuelve el resultado de una prueba F. -GAMMADIST = DISTR.GAMMA ## Devuelve la distribución gamma. -GAMMAINV = DISTR.GAMMA.INV ## Devuelve la función inversa de la distribución gamma acumulativa. -GAMMALN = GAMMA.LN ## Devuelve el logaritmo natural de la función gamma, G(x). -GEOMEAN = MEDIA.GEOM ## Devuelve la media geométrica. -GROWTH = CRECIMIENTO ## Devuelve valores en una tendencia exponencial. -HARMEAN = MEDIA.ARMO ## Devuelve la media armónica. -HYPGEOMDIST = DISTR.HIPERGEOM ## Devuelve la distribución hipergeométrica. -INTERCEPT = INTERSECCION.EJE ## Devuelve la intersección de la línea de regresión lineal. -KURT = CURTOSIS ## Devuelve la curtosis de un conjunto de datos. -LARGE = K.ESIMO.MAYOR ## Devuelve el k-ésimo mayor valor de un conjunto de datos. -LINEST = ESTIMACION.LINEAL ## Devuelve los parámetros de una tendencia lineal. -LOGEST = ESTIMACION.LOGARITMICA ## Devuelve los parámetros de una tendencia exponencial. -LOGINV = DISTR.LOG.INV ## Devuelve la función inversa de la distribución logarítmico-normal. -LOGNORMDIST = DISTR.LOG.NORM ## Devuelve la distribución logarítmico-normal acumulativa. -MAX = MAX ## Devuelve el valor máximo de una lista de argumentos. -MAXA = MAXA ## Devuelve el valor máximo de una lista de argumentos, incluidos números, texto y valores lógicos. -MEDIAN = MEDIANA ## Devuelve la mediana de los números dados. -MIN = MIN ## Devuelve el valor mínimo de una lista de argumentos. -MINA = MINA ## Devuelve el valor mínimo de una lista de argumentos, incluidos números, texto y valores lógicos. -MODE = MODA ## Devuelve el valor más común de un conjunto de datos. -NEGBINOMDIST = NEGBINOMDIST ## Devuelve la distribución binomial negativa. -NORMDIST = DISTR.NORM ## Devuelve la distribución normal acumulativa. -NORMINV = DISTR.NORM.INV ## Devuelve la función inversa de la distribución normal acumulativa. -NORMSDIST = DISTR.NORM.ESTAND ## Devuelve la distribución normal estándar acumulativa. -NORMSINV = DISTR.NORM.ESTAND.INV ## Devuelve la función inversa de la distribución normal estándar acumulativa. -PEARSON = PEARSON ## Devuelve el coeficiente de momento de correlación de producto Pearson. -PERCENTILE = PERCENTIL ## Devuelve el k-ésimo percentil de los valores de un rango. -PERCENTRANK = RANGO.PERCENTIL ## Devuelve el rango porcentual de un valor de un conjunto de datos. -PERMUT = PERMUTACIONES ## Devuelve el número de permutaciones de un número determinado de objetos. -POISSON = POISSON ## Devuelve la distribución de Poisson. -PROB = PROBABILIDAD ## Devuelve la probabilidad de que los valores de un rango se encuentren entre dos límites. -QUARTILE = CUARTIL ## Devuelve el cuartil de un conjunto de datos. -RANK = JERARQUIA ## Devuelve la jerarquía de un número en una lista de números. -RSQ = COEFICIENTE.R2 ## Devuelve el cuadrado del coeficiente de momento de correlación de producto Pearson. -SKEW = COEFICIENTE.ASIMETRIA ## Devuelve la asimetría de una distribución. -SLOPE = PENDIENTE ## Devuelve la pendiente de la línea de regresión lineal. -SMALL = K.ESIMO.MENOR ## Devuelve el k-ésimo menor valor de un conjunto de datos. -STANDARDIZE = NORMALIZACION ## Devuelve un valor normalizado. -STDEV = DESVEST ## Calcula la desviación estándar a partir de una muestra. -STDEVA = DESVESTA ## Calcula la desviación estándar a partir de una muestra, incluidos números, texto y valores lógicos. -STDEVP = DESVESTP ## Calcula la desviación estándar en función de toda la población. -STDEVPA = DESVESTPA ## Calcula la desviación estándar en función de toda la población, incluidos números, texto y valores lógicos. -STEYX = ERROR.TIPICO.XY ## Devuelve el error estándar del valor de "y" previsto para cada "x" de la regresión. -TDIST = DISTR.T ## Devuelve la distribución de t de Student. -TINV = DISTR.T.INV ## Devuelve la función inversa de la distribución de t de Student. -TREND = TENDENCIA ## Devuelve valores en una tendencia lineal. -TRIMMEAN = MEDIA.ACOTADA ## Devuelve la media del interior de un conjunto de datos. -TTEST = PRUEBA.T ## Devuelve la probabilidad asociada a una prueba t de Student. -VAR = VAR ## Calcula la varianza en función de una muestra. -VARA = VARA ## Calcula la varianza en función de una muestra, incluidos números, texto y valores lógicos. -VARP = VARP ## Calcula la varianza en función de toda la población. -VARPA = VARPA ## Calcula la varianza en función de toda la población, incluidos números, texto y valores lógicos. -WEIBULL = DIST.WEIBULL ## Devuelve la distribución de Weibull. -ZTEST = PRUEBA.Z ## Devuelve el valor de una probabilidad de una cola de una prueba z. - - -## -## Text functions Funciones de texto -## -ASC = ASC ## Convierte las letras inglesas o katakana de ancho completo (de dos bytes) dentro de una cadena de caracteres en caracteres de ancho medio (de un byte). -BAHTTEXT = TEXTOBAHT ## Convierte un número en texto, con el formato de moneda ß (Baht). -CHAR = CARACTER ## Devuelve el carácter especificado por el número de código. -CLEAN = LIMPIAR ## Quita del texto todos los caracteres no imprimibles. -CODE = CODIGO ## Devuelve un código numérico del primer carácter de una cadena de texto. -CONCATENATE = CONCATENAR ## Concatena varios elementos de texto en uno solo. -DOLLAR = MONEDA ## Convierte un número en texto, con el formato de moneda $ (dólar). -EXACT = IGUAL ## Comprueba si dos valores de texto son idénticos. -FIND = ENCONTRAR ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas). -FINDB = ENCONTRARB ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas). -FIXED = DECIMAL ## Da formato a un número como texto con un número fijo de decimales. -JIS = JIS ## Convierte las letras inglesas o katakana de ancho medio (de un byte) dentro de una cadena de caracteres en caracteres de ancho completo (de dos bytes). -LEFT = IZQUIERDA ## Devuelve los caracteres del lado izquierdo de un valor de texto. -LEFTB = IZQUIERDAB ## Devuelve los caracteres del lado izquierdo de un valor de texto. -LEN = LARGO ## Devuelve el número de caracteres de una cadena de texto. -LENB = LARGOB ## Devuelve el número de caracteres de una cadena de texto. -LOWER = MINUSC ## Pone el texto en minúsculas. -MID = EXTRAE ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique. -MIDB = EXTRAEB ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique. -PHONETIC = FONETICO ## Extrae los caracteres fonéticos (furigana) de una cadena de texto. -PROPER = NOMPROPIO ## Pone en mayúscula la primera letra de cada palabra de un valor de texto. -REPLACE = REEMPLAZAR ## Reemplaza caracteres de texto. -REPLACEB = REEMPLAZARB ## Reemplaza caracteres de texto. -REPT = REPETIR ## Repite el texto un número determinado de veces. -RIGHT = DERECHA ## Devuelve los caracteres del lado derecho de un valor de texto. -RIGHTB = DERECHAB ## Devuelve los caracteres del lado derecho de un valor de texto. -SEARCH = HALLAR ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas). -SEARCHB = HALLARB ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas). -SUBSTITUTE = SUSTITUIR ## Sustituye texto nuevo por texto antiguo en una cadena de texto. -T = T ## Convierte sus argumentos a texto. -TEXT = TEXTO ## Da formato a un número y lo convierte en texto. -TRIM = ESPACIOS ## Quita los espacios del texto. -UPPER = MAYUSC ## Pone el texto en mayúsculas. -VALUE = VALOR ## Convierte un argumento de texto en un número. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/config deleted file mode 100644 index a147034e5d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = $ # Symbol not known, should it be a € (Euro)? - - -## -## Excel Error Codes (For future use) -## -NULL = #TYHJÄ! -DIV0 = #JAKO/0! -VALUE = #ARVO! -REF = #VIITTAUS! -NAME = #NIMI? -NUM = #LUKU! -NA = #PUUTTUU diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/functions deleted file mode 100644 index ccabe74445..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fi/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Apuohjelma- ja automaatiofunktiot -## -GETPIVOTDATA = NOUDA.PIVOT.TIEDOT ## Palauttaa pivot-taulukkoraporttiin tallennettuja tietoja. - - -## -## Cube functions Kuutiofunktiot -## -CUBEKPIMEMBER = KUUTIOKPIJÄSEN ## Palauttaa suorituskykyilmaisimen (KPI) nimen, ominaisuuden sekä mitan ja näyttää nimen sekä ominaisuuden solussa. KPI on mitattavissa oleva suure, kuten kuukauden bruttotuotto tai vuosineljänneksen työntekijäkohtainen liikevaihto, joiden avulla tarkkaillaan organisaation suorituskykyä. -CUBEMEMBER = KUUTIONJÄSEN ## Palauttaa kuutiohierarkian jäsenen tai monikon. Tällä funktiolla voit tarkistaa, että jäsen tai monikko on olemassa kuutiossa. -CUBEMEMBERPROPERTY = KUUTIONJÄSENENOMINAISUUS ## Palauttaa kuution jäsenominaisuuden arvon. Tällä funktiolla voit tarkistaa, että nimi on olemassa kuutiossa, ja palauttaa tämän jäsenen määritetyn ominaisuuden. -CUBERANKEDMEMBER = KUUTIONLUOKITELTUJÄSEN ## Palauttaa joukon n:nnen jäsenen. Tällä funktiolla voit palauttaa joukosta elementtejä, kuten parhaan myyjän tai 10 parasta opiskelijaa. -CUBESET = KUUTIOJOUKKO ## Määrittää lasketun jäsen- tai monikkojoukon lähettämällä joukon lausekkeita palvelimessa olevalle kuutiolle. Palvelin luo joukon ja palauttaa sen Microsoft Office Excelille. -CUBESETCOUNT = KUUTIOJOUKKOJENMÄÄRÄ ## Palauttaa joukon kohteiden määrän. -CUBEVALUE = KUUTIONARVO ## Palauttaa koostetun arvon kuutiosta. - - -## -## Database functions Tietokantafunktiot -## -DAVERAGE = TKESKIARVO ## Palauttaa valittujen tietokantamerkintöjen keskiarvon. -DCOUNT = TLASKE ## Laskee tietokannan lukuja sisältävien solujen määrän. -DCOUNTA = TLASKEA ## Laskee tietokannan tietoja sisältävien solujen määrän. -DGET = TNOUDA ## Hakee määritettyjä ehtoja vastaavan tietueen tietokannasta. -DMAX = TMAKS ## Palauttaa suurimman arvon tietokannasta valittujen arvojen joukosta. -DMIN = TMIN ## Palauttaa pienimmän arvon tietokannasta valittujen arvojen joukosta. -DPRODUCT = TTULO ## Kertoo määritetyn ehdon täyttävien tietokannan tietueiden tietyssä kentässä olevat arvot. -DSTDEV = TKESKIHAJONTA ## Laskee keskihajonnan tietokannasta valituista arvoista muodostuvan otoksen perusteella. -DSTDEVP = TKESKIHAJONTAP ## Laskee keskihajonnan tietokannasta valittujen arvojen koko populaation perusteella. -DSUM = TSUMMA ## Lisää luvut määritetyn ehdon täyttävien tietokannan tietueiden kenttäsarakkeeseen. -DVAR = TVARIANSSI ## Laskee varianssin tietokannasta valittujen arvojen otoksen perusteella. -DVARP = TVARIANSSIP ## Laskee varianssin tietokannasta valittujen arvojen koko populaation perusteella. - - -## -## Date and time functions Päivämäärä- ja aikafunktiot -## -DATE = PÄIVÄYS ## Palauttaa annetun päivämäärän järjestysluvun. -DATEVALUE = PÄIVÄYSARVO ## Muuntaa tekstimuodossa olevan päivämäärän järjestysluvuksi. -DAY = PÄIVÄ ## Muuntaa järjestysluvun kuukauden päiväksi. -DAYS360 = PÄIVÄT360 ## Laskee kahden päivämäärän välisten päivien määrän käyttäen perustana 360-päiväistä vuotta. -EDATE = PÄIVÄ.KUUKAUSI ## Palauttaa järjestyslukuna päivämäärän, joka poikkeaa aloituspäivän päivämäärästä annetun kuukausimäärän verran joko eteen- tai taaksepäin. -EOMONTH = KUUKAUSI.LOPPU ## Palauttaa järjestyslukuna sen kuukauden viimeisen päivämäärän, joka poikkeaa annetun kuukausimäärän verran eteen- tai taaksepäin. -HOUR = TUNNIT ## Muuntaa järjestysluvun tunneiksi. -MINUTE = MINUUTIT ## Muuntaa järjestysluvun minuuteiksi. -MONTH = KUUKAUSI ## Muuntaa järjestysluvun kuukausiksi. -NETWORKDAYS = TYÖPÄIVÄT ## Palauttaa kahden päivämäärän välissä olevien täysien työpäivien määrän. -NOW = NYT ## Palauttaa kuluvan päivämäärän ja ajan järjestysnumeron. -SECOND = SEKUNNIT ## Muuntaa järjestysluvun sekunneiksi. -TIME = AIKA ## Palauttaa annetun kellonajan järjestysluvun. -TIMEVALUE = AIKA_ARVO ## Muuntaa tekstimuodossa olevan kellonajan järjestysluvuksi. -TODAY = TÄMÄ.PÄIVÄ ## Palauttaa kuluvan päivän päivämäärän järjestysluvun. -WEEKDAY = VIIKONPÄIVÄ ## Muuntaa järjestysluvun viikonpäiväksi. -WEEKNUM = VIIKKO.NRO ## Muuntaa järjestysluvun luvuksi, joka ilmaisee viikon järjestysluvun vuoden alusta laskettuna. -WORKDAY = TYÖPÄIVÄ ## Palauttaa järjestysluvun päivämäärälle, joka sijaitsee annettujen työpäivien verran eteen tai taaksepäin. -YEAR = VUOSI ## Muuntaa järjestysluvun vuosiksi. -YEARFRAC = VUOSI.OSA ## Palauttaa määritettyjen päivämäärien (aloituspäivä ja lopetuspäivä) välisen osan vuodesta. - - -## -## Engineering functions Tekniset funktiot -## -BESSELI = BESSELI ## Palauttaa muunnetun Bessel-funktion In(x). -BESSELJ = BESSELJ ## Palauttaa Bessel-funktion Jn(x). -BESSELK = BESSELK ## Palauttaa muunnetun Bessel-funktion Kn(x). -BESSELY = BESSELY ## Palauttaa Bessel-funktion Yn(x). -BIN2DEC = BINDES ## Muuntaa binaariluvun desimaaliluvuksi. -BIN2HEX = BINHEKSA ## Muuntaa binaariluvun heksadesimaaliluvuksi. -BIN2OCT = BINOKT ## Muuntaa binaariluvun oktaaliluvuksi. -COMPLEX = KOMPLEKSI ## Muuntaa reaali- ja imaginaariosien kertoimet kompleksiluvuksi. -CONVERT = MUUNNA ## Muuntaa luvun toisen mittajärjestelmän mukaiseksi. -DEC2BIN = DESBIN ## Muuntaa desimaaliluvun binaariluvuksi. -DEC2HEX = DESHEKSA ## Muuntaa kymmenjärjestelmän luvun heksadesimaaliluvuksi. -DEC2OCT = DESOKT ## Muuntaa kymmenjärjestelmän luvun oktaaliluvuksi. -DELTA = SAMA.ARVO ## Tarkistaa, ovatko kaksi arvoa yhtä suuria. -ERF = VIRHEFUNKTIO ## Palauttaa virhefunktion. -ERFC = VIRHEFUNKTIO.KOMPLEMENTTI ## Palauttaa komplementtivirhefunktion. -GESTEP = RAJA ## Testaa, onko luku suurempi kuin kynnysarvo. -HEX2BIN = HEKSABIN ## Muuntaa heksadesimaaliluvun binaariluvuksi. -HEX2DEC = HEKSADES ## Muuntaa heksadesimaaliluvun desimaaliluvuksi. -HEX2OCT = HEKSAOKT ## Muuntaa heksadesimaaliluvun oktaaliluvuksi. -IMABS = KOMPLEKSI.ITSEISARVO ## Palauttaa kompleksiluvun itseisarvon (moduluksen). -IMAGINARY = KOMPLEKSI.IMAG ## Palauttaa kompleksiluvun imaginaariosan kertoimen. -IMARGUMENT = KOMPLEKSI.ARG ## Palauttaa theeta-argumentin, joka on radiaaneina annettu kulma. -IMCONJUGATE = KOMPLEKSI.KONJ ## Palauttaa kompleksiluvun konjugaattiluvun. -IMCOS = KOMPLEKSI.COS ## Palauttaa kompleksiluvun kosinin. -IMDIV = KOMPLEKSI.OSAM ## Palauttaa kahden kompleksiluvun osamäärän. -IMEXP = KOMPLEKSI.EKSP ## Palauttaa kompleksiluvun eksponentin. -IMLN = KOMPLEKSI.LN ## Palauttaa kompleksiluvun luonnollisen logaritmin. -IMLOG10 = KOMPLEKSI.LOG10 ## Palauttaa kompleksiluvun kymmenkantaisen logaritmin. -IMLOG2 = KOMPLEKSI.LOG2 ## Palauttaa kompleksiluvun kaksikantaisen logaritmin. -IMPOWER = KOMPLEKSI.POT ## Palauttaa kokonaislukupotenssiin korotetun kompleksiluvun. -IMPRODUCT = KOMPLEKSI.TULO ## Palauttaa kompleksilukujen tulon. -IMREAL = KOMPLEKSI.REAALI ## Palauttaa kompleksiluvun reaaliosan kertoimen. -IMSIN = KOMPLEKSI.SIN ## Palauttaa kompleksiluvun sinin. -IMSQRT = KOMPLEKSI.NELIÖJ ## Palauttaa kompleksiluvun neliöjuuren. -IMSUB = KOMPLEKSI.EROTUS ## Palauttaa kahden kompleksiluvun erotuksen. -IMSUM = KOMPLEKSI.SUM ## Palauttaa kompleksilukujen summan. -OCT2BIN = OKTBIN ## Muuntaa oktaaliluvun binaariluvuksi. -OCT2DEC = OKTDES ## Muuntaa oktaaliluvun desimaaliluvuksi. -OCT2HEX = OKTHEKSA ## Muuntaa oktaaliluvun heksadesimaaliluvuksi. - - -## -## Financial functions Rahoitusfunktiot -## -ACCRINT = KERTYNYT.KORKO ## Laskee arvopaperille kertyneen koron, kun korko kertyy säännöllisin väliajoin. -ACCRINTM = KERTYNYT.KORKO.LOPUSSA ## Laskee arvopaperille kertyneen koron, kun korko maksetaan eräpäivänä. -AMORDEGRC = AMORDEGRC ## Laskee kunkin laskentakauden poiston poistokerrointa käyttämällä. -AMORLINC = AMORLINC ## Palauttaa kunkin laskentakauden poiston. -COUPDAYBS = KORKOPÄIVÄT.ALUSTA ## Palauttaa koronmaksukauden aloituspäivän ja tilityspäivän välisen ajanjakson päivien määrän. -COUPDAYS = KORKOPÄIVÄT ## Palauttaa päivien määrän koronmaksukaudelta, johon tilityspäivä kuuluu. -COUPDAYSNC = KORKOPÄIVÄT.SEURAAVA ## Palauttaa tilityspäivän ja seuraavan koronmaksupäivän välisen ajanjakson päivien määrän. -COUPNCD = KORKOMAKSU.SEURAAVA ## Palauttaa tilityspäivän jälkeisen seuraavan koronmaksupäivän. -COUPNUM = KORKOPÄIVÄJAKSOT ## Palauttaa arvopaperin ostopäivän ja erääntymispäivän välisten koronmaksupäivien määrän. -COUPPCD = KORKOPÄIVÄ.EDELLINEN ## Palauttaa tilityspäivää edeltävän koronmaksupäivän. -CUMIPMT = MAKSETTU.KORKO ## Palauttaa kahden jakson välisenä aikana kertyneen koron. -CUMPRINC = MAKSETTU.LYHENNYS ## Palauttaa lainalle kahden jakson välisenä aikana kertyneen lyhennyksen. -DB = DB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan. -DDB = DDB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DDB-menetelmän (Double-Declining Balance) tai jonkin muun määrittämäsi menetelmän mukaan. -DISC = DISKONTTOKORKO ## Palauttaa arvopaperin diskonttokoron. -DOLLARDE = VALUUTTA.DES ## Muuntaa murtolukuna ilmoitetun valuuttamäärän desimaaliluvuksi. -DOLLARFR = VALUUTTA.MURTO ## Muuntaa desimaalilukuna ilmaistun valuuttamäärän murtoluvuksi. -DURATION = KESTO ## Palauttaa keston arvopaperille, jonka koronmaksu tapahtuu säännöllisesti. -EFFECT = KORKO.EFEKT ## Palauttaa todellisen vuosikoron. -FV = TULEVA.ARVO ## Palauttaa sijoituksen tulevan arvon. -FVSCHEDULE = TULEVA.ARVO.ERIKORKO ## Palauttaa pääoman tulevan arvon, kun pääomalle on kertynyt korkoa vaihtelevasti. -INTRATE = KORKO.ARVOPAPERI ## Palauttaa arvopaperin korkokannan täysin sijoitetulle arvopaperille. -IPMT = IPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona kertyvän koron. -IRR = SISÄINEN.KORKO ## Laskee sisäisen korkokannan kassavirrasta muodostuvalle sarjalle. -ISPMT = ONMAKSU ## Laskee sijoituksen maksetun koron tietyllä jaksolla. -MDURATION = KESTO.MUUNN ## Palauttaa muunnetun Macauley-keston arvopaperille, jonka oletettu nimellisarvo on 100 euroa. -MIRR = MSISÄINEN ## Palauttaa sisäisen korkokannan, kun positiivisten ja negatiivisten kassavirtojen rahoituskorko on erilainen. -NOMINAL = KORKO.VUOSI ## Palauttaa vuosittaisen nimelliskoron. -NPER = NJAKSO ## Palauttaa sijoituksen jaksojen määrän. -NPV = NNA ## Palauttaa sijoituksen nykyarvon toistuvista kassavirroista muodostuvan sarjan ja diskonttokoron perusteella. -ODDFPRICE = PARITON.ENS.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa ensimmäinen jakso on pariton. -ODDFYIELD = PARITON.ENS.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa ensimmäinen jakso on pariton. -ODDLPRICE = PARITON.VIIM.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa viimeinen jakso on pariton. -ODDLYIELD = PARITON.VIIM.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa viimeinen jakso on pariton. -PMT = MAKSU ## Palauttaa annuiteetin kausittaisen maksuerän. -PPMT = PPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona maksettavan lyhennyksen. -PRICE = HINTA ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan säännöllisin väliajoin. -PRICEDISC = HINTA.DISK ## Palauttaa diskontatun arvopaperin hinnan 100 euron nimellisarvoa kohden. -PRICEMAT = HINTA.LUNASTUS ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan erääntymispäivänä. -PV = NA ## Palauttaa sijoituksen nykyarvon. -RATE = KORKO ## Palauttaa annuiteetin kausittaisen korkokannan. -RECEIVED = SAATU.HINTA ## Palauttaa arvopaperin tuoton erääntymispäivänä kokonaan maksetulle sijoitukselle. -SLN = STP ## Palauttaa sijoituksen tasapoiston yhdeltä jaksolta. -SYD = VUOSIPOISTO ## Palauttaa sijoituksen vuosipoiston annettuna kautena amerikkalaisen SYD-menetelmän (Sum-of-Year's Digits) avulla. -TBILLEQ = OBLIG.TUOTTOPROS ## Palauttaa valtion obligaation tuoton vastaavana joukkovelkakirjan tuottona. -TBILLPRICE = OBLIG.HINTA ## Palauttaa obligaation hinnan 100 euron nimellisarvoa kohden. -TBILLYIELD = OBLIG.TUOTTO ## Palauttaa obligaation tuoton. -VDB = VDB ## Palauttaa annetun kauden tai kauden osan kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan. -XIRR = SISÄINEN.KORKO.JAKSOTON ## Palauttaa sisäisen korkokannan kassavirtojen sarjoille, jotka eivät välttämättä ole säännöllisiä. -XNPV = NNA.JAKSOTON ## Palauttaa nettonykyarvon kassavirtasarjalle, joka ei välttämättä ole kausittainen. -YIELD = TUOTTO ## Palauttaa tuoton arvopaperille, jonka korko maksetaan säännöllisin väliajoin. -YIELDDISC = TUOTTO.DISK ## Palauttaa diskontatun arvopaperin, kuten obligaation, vuosittaisen tuoton. -YIELDMAT = TUOTTO.ERÄP ## Palauttaa erääntymispäivänään korkoa tuottavan arvopaperin vuosittaisen tuoton. - - -## -## Information functions Erikoisfunktiot -## -CELL = SOLU ## Palauttaa tietoja solun muotoilusta, sijainnista ja sisällöstä. -ERROR.TYPE = VIRHEEN.LAJI ## Palauttaa virhetyyppiä vastaavan luvun. -INFO = KUVAUS ## Palauttaa tietoja nykyisestä käyttöympäristöstä. -ISBLANK = ONTYHJÄ ## Palauttaa arvon TOSI, jos arvo on tyhjä. -ISERR = ONVIRH ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo paitsi arvo #PUUTTUU!. -ISERROR = ONVIRHE ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo. -ISEVEN = ONPARILLINEN ## Palauttaa arvon TOSI, jos arvo on parillinen. -ISLOGICAL = ONTOTUUS ## Palauttaa arvon TOSI, jos arvo on mikä tahansa looginen arvo. -ISNA = ONPUUTTUU ## Palauttaa arvon TOSI, jos virhearvo on #PUUTTUU!. -ISNONTEXT = ONEI_TEKSTI ## Palauttaa arvon TOSI, jos arvo ei ole teksti. -ISNUMBER = ONLUKU ## Palauttaa arvon TOSI, jos arvo on luku. -ISODD = ONPARITON ## Palauttaa arvon TOSI, jos arvo on pariton. -ISREF = ONVIITT ## Palauttaa arvon TOSI, jos arvo on viittaus. -ISTEXT = ONTEKSTI ## Palauttaa arvon TOSI, jos arvo on teksti. -N = N ## Palauttaa arvon luvuksi muunnettuna. -NA = PUUTTUU ## Palauttaa virhearvon #PUUTTUU!. -TYPE = TYYPPI ## Palauttaa luvun, joka ilmaisee arvon tietotyypin. - - -## -## Logical functions Loogiset funktiot -## -AND = JA ## Palauttaa arvon TOSI, jos kaikkien argumenttien arvo on TOSI. -FALSE = EPÄTOSI ## Palauttaa totuusarvon EPÄTOSI. -IF = JOS ## Määrittää suoritettavan loogisen testin. -IFERROR = JOSVIRHE ## Palauttaa määrittämäsi arvon, jos kaavan tulos on virhe; muussa tapauksessa palauttaa kaavan tuloksen. -NOT = EI ## Kääntää argumentin loogisen arvon. -OR = TAI ## Palauttaa arvon TOSI, jos minkä tahansa argumentin arvo on TOSI. -TRUE = TOSI ## Palauttaa totuusarvon TOSI. - - -## -## Lookup and reference functions Haku- ja viitefunktiot -## -ADDRESS = OSOITE ## Palauttaa laskentataulukon soluun osoittavan viittauksen tekstinä. -AREAS = ALUEET ## Palauttaa viittauksessa olevien alueiden määrän. -CHOOSE = VALITSE.INDEKSI ## Valitsee arvon arvoluettelosta. -COLUMN = SARAKE ## Palauttaa viittauksen sarakenumeron. -COLUMNS = SARAKKEET ## Palauttaa viittauksessa olevien sarakkeiden määrän. -HLOOKUP = VHAKU ## Suorittaa haun matriisin ylimmältä riviltä ja palauttaa määritetyn solun arvon. -HYPERLINK = HYPERLINKKI ## Luo pikakuvakkeen tai tekstin, joka avaa verkkopalvelimeen, intranetiin tai Internetiin tallennetun tiedoston. -INDEX = INDEKSI ## Valitsee arvon viittauksesta tai matriisista indeksin mukaan. -INDIRECT = EPÄSUORA ## Palauttaa tekstiarvona ilmaistun viittauksen. -LOOKUP = HAKU ## Etsii arvoja vektorista tai matriisista. -MATCH = VASTINE ## Etsii arvoja viittauksesta tai matriisista. -OFFSET = SIIRTYMÄ ## Palauttaa annetun viittauksen siirtymän. -ROW = RIVI ## Palauttaa viittauksen rivinumeron. -ROWS = RIVIT ## Palauttaa viittauksessa olevien rivien määrän. -RTD = RTD ## Noutaa COM-automaatiota (automaatio: Tapa käsitellä sovelluksen objekteja toisesta sovelluksesta tai kehitystyökalusta. Automaatio, jota aiemmin kutsuttiin OLE-automaatioksi, on teollisuusstandardi ja COM-mallin (Component Object Model) ominaisuus.) tukevasta ohjelmasta reaaliaikaisia tietoja. -TRANSPOSE = TRANSPONOI ## Palauttaa matriisin käänteismatriisin. -VLOOKUP = PHAKU ## Suorittaa haun matriisin ensimmäisestä sarakkeesta ja palauttaa rivillä olevan solun arvon. - - -## -## Math and trigonometry functions Matemaattiset ja trigonometriset funktiot -## -ABS = ITSEISARVO ## Palauttaa luvun itseisarvon. -ACOS = ACOS ## Palauttaa luvun arkuskosinin. -ACOSH = ACOSH ## Palauttaa luvun käänteisen hyperbolisen kosinin. -ASIN = ASIN ## Palauttaa luvun arkussinin. -ASINH = ASINH ## Palauttaa luvun käänteisen hyperbolisen sinin. -ATAN = ATAN ## Palauttaa luvun arkustangentin. -ATAN2 = ATAN2 ## Palauttaa arkustangentin x- ja y-koordinaatin perusteella. -ATANH = ATANH ## Palauttaa luvun käänteisen hyperbolisen tangentin. -CEILING = PYÖRISTÄ.KERR.YLÖS ## Pyöristää luvun lähimpään kokonaislukuun tai tarkkuusargumentin lähimpään kerrannaiseen. -COMBIN = KOMBINAATIO ## Palauttaa mahdollisten kombinaatioiden määrän annetulle objektien määrälle. -COS = COS ## Palauttaa luvun kosinin. -COSH = COSH ## Palauttaa luvun hyperbolisen kosinin. -DEGREES = ASTEET ## Muuntaa radiaanit asteiksi. -EVEN = PARILLINEN ## Pyöristää luvun ylöspäin lähimpään parilliseen kokonaislukuun. -EXP = EKSPONENTTI ## Palauttaa e:n korotettuna annetun luvun osoittamaan potenssiin. -FACT = KERTOMA ## Palauttaa luvun kertoman. -FACTDOUBLE = KERTOMA.OSA ## Palauttaa luvun osakertoman. -FLOOR = PYÖRISTÄ.KERR.ALAS ## Pyöristää luvun alaspäin (nollaa kohti). -GCD = SUURIN.YHT.TEKIJÄ ## Palauttaa suurimman yhteisen tekijän. -INT = KOKONAISLUKU ## Pyöristää luvun alaspäin lähimpään kokonaislukuun. -LCM = PIENIN.YHT.JAETTAVA ## Palauttaa pienimmän yhteisen tekijän. -LN = LUONNLOG ## Palauttaa luvun luonnollisen logaritmin. -LOG = LOG ## Laskee luvun logaritmin käyttämällä annettua kantalukua. -LOG10 = LOG10 ## Palauttaa luvun kymmenkantaisen logaritmin. -MDETERM = MDETERM ## Palauttaa matriisin matriisideterminantin. -MINVERSE = MKÄÄNTEINEN ## Palauttaa matriisin käänteismatriisin. -MMULT = MKERRO ## Palauttaa kahden matriisin tulon. -MOD = JAKOJ ## Palauttaa jakolaskun jäännöksen. -MROUND = PYÖRISTÄ.KERR ## Palauttaa luvun pyöristettynä annetun luvun kerrannaiseen. -MULTINOMIAL = MULTINOMI ## Palauttaa lukujoukon multinomin. -ODD = PARITON ## Pyöristää luvun ylöspäin lähimpään parittomaan kokonaislukuun. -PI = PII ## Palauttaa piin arvon. -POWER = POTENSSI ## Palauttaa luvun korotettuna haluttuun potenssiin. -PRODUCT = TULO ## Kertoo annetut argumentit. -QUOTIENT = OSAMÄÄRÄ ## Palauttaa osamäärän kokonaislukuosan. -RADIANS = RADIAANIT ## Muuntaa asteet radiaaneiksi. -RAND = SATUNNAISLUKU ## Palauttaa satunnaisluvun väliltä 0–1. -RANDBETWEEN = SATUNNAISLUKU.VÄLILTÄ ## Palauttaa satunnaisluvun määritettyjen lukujen väliltä. -ROMAN = ROMAN ## Muuntaa arabialaisen numeron tekstimuotoiseksi roomalaiseksi numeroksi. -ROUND = PYÖRISTÄ ## Pyöristää luvun annettuun määrään desimaaleja. -ROUNDDOWN = PYÖRISTÄ.DES.ALAS ## Pyöristää luvun alaspäin (nollaa kohti). -ROUNDUP = PYÖRISTÄ.DES.YLÖS ## Pyöristää luvun ylöspäin (poispäin nollasta). -SERIESSUM = SARJA.SUMMA ## Palauttaa kaavaan perustuvan potenssisarjan arvon. -SIGN = ETUMERKKI ## Palauttaa luvun etumerkin. -SIN = SIN ## Palauttaa annetun kulman sinin. -SINH = SINH ## Palauttaa luvun hyperbolisen sinin. -SQRT = NELIÖJUURI ## Palauttaa positiivisen neliöjuuren. -SQRTPI = NELIÖJUURI.PII ## Palauttaa tulon (luku * pii) neliöjuuren. -SUBTOTAL = VÄLISUMMA ## Palauttaa luettelon tai tietokannan välisumman. -SUM = SUMMA ## Laskee yhteen annetut argumentit. -SUMIF = SUMMA.JOS ## Laskee ehdot täyttävien solujen summan. -SUMIFS = SUMMA.JOS.JOUKKO ## Laskee yhteen solualueen useita ehtoja vastaavat solut. -SUMPRODUCT = TULOJEN.SUMMA ## Palauttaa matriisin toisiaan vastaavien osien tulojen summan. -SUMSQ = NELIÖSUMMA ## Palauttaa argumenttien neliöiden summan. -SUMX2MY2 = NELIÖSUMMIEN.EROTUS ## Palauttaa kahden matriisin toisiaan vastaavien arvojen laskettujen neliösummien erotuksen. -SUMX2PY2 = NELIÖSUMMIEN.SUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen neliösummien summan. -SUMXMY2 = EROTUSTEN.NELIÖSUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen erotusten neliösumman. -TAN = TAN ## Palauttaa luvun tangentin. -TANH = TANH ## Palauttaa luvun hyperbolisen tangentin. -TRUNC = KATKAISE ## Katkaisee luvun kokonaisluvuksi. - - -## -## Statistical functions Tilastolliset funktiot -## -AVEDEV = KESKIPOIKKEAMA ## Palauttaa hajontojen itseisarvojen keskiarvon. -AVERAGE = KESKIARVO ## Palauttaa argumenttien keskiarvon. -AVERAGEA = KESKIARVOA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, keskiarvon. -AVERAGEIF = KESKIARVO.JOS ## Palauttaa alueen niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka täyttävät annetut ehdot. -AVERAGEIFS = KESKIARVO.JOS.JOUKKO ## Palauttaa niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka vastaavat useita ehtoja. -BETADIST = BEETAJAKAUMA ## Palauttaa kumulatiivisen beetajakaumafunktion arvon. -BETAINV = BEETAJAKAUMA.KÄÄNT ## Palauttaa määritetyn beetajakauman käänteisen kumulatiivisen jakaumafunktion arvon. -BINOMDIST = BINOMIJAKAUMA ## Palauttaa yksittäisen termin binomijakaumatodennäköisyyden. -CHIDIST = CHIJAKAUMA ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden. -CHIINV = CHIJAKAUMA.KÄÄNT ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden käänteisarvon. -CHITEST = CHITESTI ## Palauttaa riippumattomuustestin tuloksen. -CONFIDENCE = LUOTTAMUSVÄLI ## Palauttaa luottamusvälin populaation keskiarvolle. -CORREL = KORRELAATIO ## Palauttaa kahden arvojoukon korrelaatiokertoimen. -COUNT = LASKE ## Laskee argumenttiluettelossa olevien lukujen määrän. -COUNTA = LASKE.A ## Laskee argumenttiluettelossa olevien arvojen määrän. -COUNTBLANK = LASKE.TYHJÄT ## Laskee alueella olevien tyhjien solujen määrän. -COUNTIF = LASKE.JOS ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa annettuja ehtoja. -COUNTIFS = LASKE.JOS.JOUKKO ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa useita ehtoja. -COVAR = KOVARIANSSI ## Palauttaa kovarianssin, joka on keskiarvo havaintoaineiston kunkin pisteparin poikkeamien tuloista. -CRITBINOM = BINOMIJAKAUMA.KRIT ## Palauttaa pienimmän arvon, jossa binomijakauman kertymäfunktion arvo on pienempi tai yhtä suuri kuin vertailuarvo. -DEVSQ = OIKAISTU.NELIÖSUMMA ## Palauttaa keskipoikkeamien neliösumman. -EXPONDIST = EKSPONENTIAALIJAKAUMA ## Palauttaa eksponentiaalijakauman. -FDIST = FJAKAUMA ## Palauttaa F-todennäköisyysjakauman. -FINV = FJAKAUMA.KÄÄNT ## Palauttaa F-todennäköisyysjakauman käänteisfunktion. -FISHER = FISHER ## Palauttaa Fisher-muunnoksen. -FISHERINV = FISHER.KÄÄNT ## Palauttaa käänteisen Fisher-muunnoksen. -FORECAST = ENNUSTE ## Palauttaa lineaarisen trendin arvon. -FREQUENCY = TAAJUUS ## Palauttaa frekvenssijakautuman pystysuuntaisena matriisina. -FTEST = FTESTI ## Palauttaa F-testin tuloksen. -GAMMADIST = GAMMAJAKAUMA ## Palauttaa gammajakauman. -GAMMAINV = GAMMAJAKAUMA.KÄÄNT ## Palauttaa käänteisen gammajakauman kertymäfunktion. -GAMMALN = GAMMALN ## Palauttaa gammafunktion luonnollisen logaritmin G(x). -GEOMEAN = KESKIARVO.GEOM ## Palauttaa geometrisen keskiarvon. -GROWTH = KASVU ## Palauttaa eksponentiaalisen trendin arvon. -HARMEAN = KESKIARVO.HARM ## Palauttaa harmonisen keskiarvon. -HYPGEOMDIST = HYPERGEOM.JAKAUMA ## Palauttaa hypergeometrisen jakauman. -INTERCEPT = LEIKKAUSPISTE ## Palauttaa lineaarisen regressiosuoran leikkauspisteen. -KURT = KURT ## Palauttaa tietoalueen vinous-arvon eli huipukkuuden. -LARGE = SUURI ## Palauttaa tietojoukon k:nneksi suurimman arvon. -LINEST = LINREGR ## Palauttaa lineaarisen trendin parametrit. -LOGEST = LOGREGR ## Palauttaa eksponentiaalisen trendin parametrit. -LOGINV = LOGNORM.JAKAUMA.KÄÄNT ## Palauttaa lognormeeratun jakauman käänteisfunktion. -LOGNORMDIST = LOGNORM.JAKAUMA ## Palauttaa lognormaalisen jakauman kertymäfunktion. -MAX = MAKS ## Palauttaa suurimman arvon argumenttiluettelosta. -MAXA = MAKSA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, suurimman arvon. -MEDIAN = MEDIAANI ## Palauttaa annettujen lukujen mediaanin. -MIN = MIN ## Palauttaa pienimmän arvon argumenttiluettelosta. -MINA = MINA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, pienimmän arvon. -MODE = MOODI ## Palauttaa tietojoukossa useimmin esiintyvän arvon. -NEGBINOMDIST = BINOMIJAKAUMA.NEG ## Palauttaa negatiivisen binomijakauman. -NORMDIST = NORM.JAKAUMA ## Palauttaa normaalijakauman kertymäfunktion. -NORMINV = NORM.JAKAUMA.KÄÄNT ## Palauttaa käänteisen normaalijakauman kertymäfunktion. -NORMSDIST = NORM.JAKAUMA.NORMIT ## Palauttaa normitetun normaalijakauman kertymäfunktion. -NORMSINV = NORM.JAKAUMA.NORMIT.KÄÄNT ## Palauttaa normitetun normaalijakauman kertymäfunktion käänteisarvon. -PEARSON = PEARSON ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen. -PERCENTILE = PROSENTTIPISTE ## Palauttaa alueen arvojen k:nnen prosenttipisteen. -PERCENTRANK = PROSENTTIJÄRJESTYS ## Palauttaa tietojoukon arvon prosentuaalisen järjestysluvun. -PERMUT = PERMUTAATIO ## Palauttaa mahdollisten permutaatioiden määrän annetulle objektien määrälle. -POISSON = POISSON ## Palauttaa Poissonin todennäköisyysjakauman. -PROB = TODENNÄKÖISYYS ## Palauttaa todennäköisyyden sille, että arvot ovat tietyltä väliltä. -QUARTILE = NELJÄNNES ## Palauttaa tietoalueen neljänneksen. -RANK = ARVON.MUKAAN ## Palauttaa luvun paikan lukuarvoluettelossa. -RSQ = PEARSON.NELIÖ ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen neliön. -SKEW = JAKAUMAN.VINOUS ## Palauttaa jakauman vinouden. -SLOPE = KULMAKERROIN ## Palauttaa lineaarisen regressiosuoran kulmakertoimen. -SMALL = PIENI ## Palauttaa tietojoukon k:nneksi pienimmän arvon. -STANDARDIZE = NORMITA ## Palauttaa normitetun arvon. -STDEV = KESKIHAJONTA ## Laskee populaation keskihajonnan otoksen perusteella. -STDEVA = KESKIHAJONTAA ## Laskee populaation keskihajonnan otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot. -STDEVP = KESKIHAJONTAP ## Laskee normaalijakautuman koko populaation perusteella. -STDEVPA = KESKIHAJONTAPA ## Laskee populaation keskihajonnan koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot. -STEYX = KESKIVIRHE ## Palauttaa regression kutakin x-arvoa vastaavan ennustetun y-arvon keskivirheen. -TDIST = TJAKAUMA ## Palauttaa t-jakautuman. -TINV = TJAKAUMA.KÄÄNT ## Palauttaa käänteisen t-jakauman. -TREND = SUUNTAUS ## Palauttaa lineaarisen trendin arvoja. -TRIMMEAN = KESKIARVO.TASATTU ## Palauttaa tietojoukon tasatun keskiarvon. -TTEST = TTESTI ## Palauttaa t-testiin liittyvän todennäköisyyden. -VAR = VAR ## Arvioi populaation varianssia otoksen perusteella. -VARA = VARA ## Laskee populaation varianssin otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot. -VARP = VARP ## Laskee varianssin koko populaation perusteella. -VARPA = VARPA ## Laskee populaation varianssin koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot. -WEIBULL = WEIBULL ## Palauttaa Weibullin jakauman. -ZTEST = ZTESTI ## Palauttaa z-testin yksisuuntaisen todennäköisyysarvon. - - -## -## Text functions Tekstifunktiot -## -ASC = ASC ## Muuntaa merkkijonossa olevat englanninkieliset DBCS- tai katakana-merkit SBCS-merkeiksi. -BAHTTEXT = BAHTTEKSTI ## Muuntaa luvun tekstiksi ß (baht) -valuuttamuotoa käyttämällä. -CHAR = MERKKI ## Palauttaa koodin lukua vastaavan merkin. -CLEAN = SIIVOA ## Poistaa tekstistä kaikki tulostumattomat merkit. -CODE = KOODI ## Palauttaa tekstimerkkijonon ensimmäisen merkin numerokoodin. -CONCATENATE = KETJUTA ## Yhdistää useat merkkijonot yhdeksi merkkijonoksi. -DOLLAR = VALUUTTA ## Muuntaa luvun tekstiksi $ (dollari) -valuuttamuotoa käyttämällä. -EXACT = VERTAA ## Tarkistaa, ovatko kaksi tekstiarvoa samanlaiset. -FIND = ETSI ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet). -FINDB = ETSIB ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet). -FIXED = KIINTEÄ ## Muotoilee luvun tekstiksi, jossa on kiinteä määrä desimaaleja. -JIS = JIS ## Muuntaa merkkijonossa olevat englanninkieliset SBCS- tai katakana-merkit DBCS-merkeiksi. -LEFT = VASEN ## Palauttaa tekstiarvon vasemmanpuoliset merkit. -LEFTB = VASENB ## Palauttaa tekstiarvon vasemmanpuoliset merkit. -LEN = PITUUS ## Palauttaa tekstimerkkijonon merkkien määrän. -LENB = PITUUSB ## Palauttaa tekstimerkkijonon merkkien määrän. -LOWER = PIENET ## Muuntaa tekstin pieniksi kirjaimiksi. -MID = POIMI.TEKSTI ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta. -MIDB = POIMI.TEKSTIB ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta. -PHONETIC = FONEETTINEN ## Hakee foneettiset (furigana) merkit merkkijonosta. -PROPER = ERISNIMI ## Muuttaa merkkijonon kunkin sanan ensimmäisen kirjaimen isoksi. -REPLACE = KORVAA ## Korvaa tekstissä olevat merkit. -REPLACEB = KORVAAB ## Korvaa tekstissä olevat merkit. -REPT = TOISTA ## Toistaa tekstin annetun määrän kertoja. -RIGHT = OIKEA ## Palauttaa tekstiarvon oikeanpuoliset merkit. -RIGHTB = OIKEAB ## Palauttaa tekstiarvon oikeanpuoliset merkit. -SEARCH = KÄY.LÄPI ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi). -SEARCHB = KÄY.LÄPIB ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi). -SUBSTITUTE = VAIHDA ## Korvaa merkkijonossa olevan tekstin toisella. -T = T ## Muuntaa argumentit tekstiksi. -TEXT = TEKSTI ## Muotoilee luvun ja muuntaa sen tekstiksi. -TRIM = POISTA.VÄLIT ## Poistaa välilyönnit tekstistä. -UPPER = ISOT ## Muuntaa tekstin isoiksi kirjaimiksi. -VALUE = ARVO ## Muuntaa tekstiargumentin luvuksi. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/config deleted file mode 100644 index 206c761289..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = € - - -## -## Excel Error Codes (For future use) -## -NULL = #NUL! -DIV0 = #DIV/0! -VALUE = #VALEUR! -REF = #REF! -NAME = #NOM? -NUM = #NOMBRE! -NA = #N/A diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/functions deleted file mode 100644 index ab1ced0013..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/fr/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Fonctions de complément et d’automatisation -## -GETPIVOTDATA = LIREDONNEESTABCROISDYNAMIQUE ## Renvoie les données stockées dans un rapport de tableau croisé dynamique. - - -## -## Cube functions Fonctions Cube -## -CUBEKPIMEMBER = MEMBREKPICUBE ## Renvoie un nom, une propriété et une mesure d’indicateur de performance clé et affiche le nom et la propriété dans la cellule. Un indicateur de performance clé est une mesure quantifiable, telle que la marge bénéficiaire brute mensuelle ou la rotation trimestrielle du personnel, utilisée pour évaluer les performances d’une entreprise. -CUBEMEMBER = MEMBRECUBE ## Renvoie un membre ou un uplet dans une hiérarchie de cubes. Utilisez cette fonction pour valider l’existence du membre ou de l’uplet dans le cube. -CUBEMEMBERPROPERTY = PROPRIETEMEMBRECUBE ## Renvoie la valeur d’une propriété de membre du cube. Utilisez cette fonction pour valider l’existence d’un nom de membre dans le cube et pour renvoyer la propriété spécifiée pour ce membre. -CUBERANKEDMEMBER = RANGMEMBRECUBE ## Renvoie le nième membre ou le membre placé à un certain rang dans un ensemble. Utilisez cette fonction pour renvoyer un ou plusieurs éléments d’un ensemble, tels que les meilleurs vendeurs ou les 10 meilleurs étudiants. -CUBESET = JEUCUBE ## Définit un ensemble calculé de membres ou d’uplets en envoyant une expression définie au cube sur le serveur qui crée l’ensemble et le renvoie à Microsoft Office Excel. -CUBESETCOUNT = NBJEUCUBE ## Renvoie le nombre d’éléments dans un jeu. -CUBEVALUE = VALEURCUBE ## Renvoie une valeur d’agrégation issue d’un cube. - - -## -## Database functions Fonctions de base de données -## -DAVERAGE = BDMOYENNE ## Renvoie la moyenne des entrées de base de données sélectionnées. -DCOUNT = BCOMPTE ## Compte le nombre de cellules d’une base de données qui contiennent des nombres. -DCOUNTA = BDNBVAL ## Compte les cellules non vides d’une base de données. -DGET = BDLIRE ## Extrait d’une base de données un enregistrement unique répondant aux critères spécifiés. -DMAX = BDMAX ## Renvoie la valeur maximale des entrées de base de données sélectionnées. -DMIN = BDMIN ## Renvoie la valeur minimale des entrées de base de données sélectionnées. -DPRODUCT = BDPRODUIT ## Multiplie les valeurs d’un champ particulier des enregistrements d’une base de données, qui répondent aux critères spécifiés. -DSTDEV = BDECARTYPE ## Calcule l’écart type pour un échantillon d’entrées de base de données sélectionnées. -DSTDEVP = BDECARTYPEP ## Calcule l’écart type pour l’ensemble d’une population d’entrées de base de données sélectionnées. -DSUM = BDSOMME ## Ajoute les nombres dans la colonne de champ des enregistrements de la base de données, qui répondent aux critères. -DVAR = BDVAR ## Calcule la variance pour un échantillon d’entrées de base de données sélectionnées. -DVARP = BDVARP ## Calcule la variance pour l’ensemble d’une population d’entrées de base de données sélectionnées. - - -## -## Date and time functions Fonctions de date et d’heure -## -DATE = DATE ## Renvoie le numéro de série d’une date précise. -DATEVALUE = DATEVAL ## Convertit une date représentée sous forme de texte en numéro de série. -DAY = JOUR ## Convertit un numéro de série en jour du mois. -DAYS360 = JOURS360 ## Calcule le nombre de jours qui séparent deux dates sur la base d’une année de 360 jours. -EDATE = MOIS.DECALER ## Renvoie le numéro séquentiel de la date qui représente une date spécifiée (l’argument date_départ), corrigée en plus ou en moins du nombre de mois indiqué. -EOMONTH = FIN.MOIS ## Renvoie le numéro séquentiel de la date du dernier jour du mois précédant ou suivant la date_départ du nombre de mois indiqué. -HOUR = HEURE ## Convertit un numéro de série en heure. -MINUTE = MINUTE ## Convertit un numéro de série en minute. -MONTH = MOIS ## Convertit un numéro de série en mois. -NETWORKDAYS = NB.JOURS.OUVRES ## Renvoie le nombre de jours ouvrés entiers compris entre deux dates. -NOW = MAINTENANT ## Renvoie le numéro de série de la date et de l’heure du jour. -SECOND = SECONDE ## Convertit un numéro de série en seconde. -TIME = TEMPS ## Renvoie le numéro de série d’une heure précise. -TIMEVALUE = TEMPSVAL ## Convertit une date représentée sous forme de texte en numéro de série. -TODAY = AUJOURDHUI ## Renvoie le numéro de série de la date du jour. -WEEKDAY = JOURSEM ## Convertit un numéro de série en jour de la semaine. -WEEKNUM = NO.SEMAINE ## Convertit un numéro de série en un numéro représentant l’ordre de la semaine dans l’année. -WORKDAY = SERIE.JOUR.OUVRE ## Renvoie le numéro de série de la date avant ou après le nombre de jours ouvrés spécifiés. -YEAR = ANNEE ## Convertit un numéro de série en année. -YEARFRAC = FRACTION.ANNEE ## Renvoie la fraction de l’année représentant le nombre de jours entre la date de début et la date de fin. - - -## -## Engineering functions Fonctions d’ingénierie -## -BESSELI = BESSELI ## Renvoie la fonction Bessel modifiée In(x). -BESSELJ = BESSELJ ## Renvoie la fonction Bessel Jn(x). -BESSELK = BESSELK ## Renvoie la fonction Bessel modifiée Kn(x). -BESSELY = BESSELY ## Renvoie la fonction Bessel Yn(x). -BIN2DEC = BINDEC ## Convertit un nombre binaire en nombre décimal. -BIN2HEX = BINHEX ## Convertit un nombre binaire en nombre hexadécimal. -BIN2OCT = BINOCT ## Convertit un nombre binaire en nombre octal. -COMPLEX = COMPLEXE ## Convertit des coefficients réel et imaginaire en un nombre complexe. -CONVERT = CONVERT ## Convertit un nombre d’une unité de mesure à une autre. -DEC2BIN = DECBIN ## Convertit un nombre décimal en nombre binaire. -DEC2HEX = DECHEX ## Convertit un nombre décimal en nombre hexadécimal. -DEC2OCT = DECOCT ## Convertit un nombre décimal en nombre octal. -DELTA = DELTA ## Teste l’égalité de deux nombres. -ERF = ERF ## Renvoie la valeur de la fonction d’erreur. -ERFC = ERFC ## Renvoie la valeur de la fonction d’erreur complémentaire. -GESTEP = SUP.SEUIL ## Teste si un nombre est supérieur à une valeur de seuil. -HEX2BIN = HEXBIN ## Convertit un nombre hexadécimal en nombre binaire. -HEX2DEC = HEXDEC ## Convertit un nombre hexadécimal en nombre décimal. -HEX2OCT = HEXOCT ## Convertit un nombre hexadécimal en nombre octal. -IMABS = COMPLEXE.MODULE ## Renvoie la valeur absolue (module) d’un nombre complexe. -IMAGINARY = COMPLEXE.IMAGINAIRE ## Renvoie le coefficient imaginaire d’un nombre complexe. -IMARGUMENT = COMPLEXE.ARGUMENT ## Renvoie l’argument thêta, un angle exprimé en radians. -IMCONJUGATE = COMPLEXE.CONJUGUE ## Renvoie le nombre complexe conjugué d’un nombre complexe. -IMCOS = IMCOS ## Renvoie le cosinus d’un nombre complexe. -IMDIV = COMPLEXE.DIV ## Renvoie le quotient de deux nombres complexes. -IMEXP = COMPLEXE.EXP ## Renvoie la fonction exponentielle d’un nombre complexe. -IMLN = COMPLEXE.LN ## Renvoie le logarithme népérien d’un nombre complexe. -IMLOG10 = COMPLEXE.LOG10 ## Calcule le logarithme en base 10 d’un nombre complexe. -IMLOG2 = COMPLEXE.LOG2 ## Calcule le logarithme en base 2 d’un nombre complexe. -IMPOWER = COMPLEXE.PUISSANCE ## Renvoie un nombre complexe élevé à une puissance entière. -IMPRODUCT = COMPLEXE.PRODUIT ## Renvoie le produit de plusieurs nombres complexes. -IMREAL = COMPLEXE.REEL ## Renvoie le coefficient réel d’un nombre complexe. -IMSIN = COMPLEXE.SIN ## Renvoie le sinus d’un nombre complexe. -IMSQRT = COMPLEXE.RACINE ## Renvoie la racine carrée d’un nombre complexe. -IMSUB = COMPLEXE.DIFFERENCE ## Renvoie la différence entre deux nombres complexes. -IMSUM = COMPLEXE.SOMME ## Renvoie la somme de plusieurs nombres complexes. -OCT2BIN = OCTBIN ## Convertit un nombre octal en nombre binaire. -OCT2DEC = OCTDEC ## Convertit un nombre octal en nombre décimal. -OCT2HEX = OCTHEX ## Convertit un nombre octal en nombre hexadécimal. - - -## -## Financial functions Fonctions financières -## -ACCRINT = INTERET.ACC ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu périodiquement. -ACCRINTM = INTERET.ACC.MAT ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu à l’échéance. -AMORDEGRC = AMORDEGRC ## Renvoie l’amortissement correspondant à chaque période comptable en utilisant un coefficient d’amortissement. -AMORLINC = AMORLINC ## Renvoie l’amortissement d’un bien à la fin d’une période fiscale donnée. -COUPDAYBS = NB.JOURS.COUPON.PREC ## Renvoie le nombre de jours entre le début de la période de coupon et la date de liquidation. -COUPDAYS = NB.JOURS.COUPONS ## Renvoie le nombre de jours pour la période du coupon contenant la date de liquidation. -COUPDAYSNC = NB.JOURS.COUPON.SUIV ## Renvoie le nombre de jours entre la date de liquidation et la date du coupon suivant la date de liquidation. -COUPNCD = DATE.COUPON.SUIV ## Renvoie la première date de coupon ultérieure à la date de règlement. -COUPNUM = NB.COUPONS ## Renvoie le nombre de coupons dus entre la date de règlement et la date d’échéance. -COUPPCD = DATE.COUPON.PREC ## Renvoie la date de coupon précédant la date de règlement. -CUMIPMT = CUMUL.INTER ## Renvoie l’intérêt cumulé payé sur un emprunt entre deux périodes. -CUMPRINC = CUMUL.PRINCPER ## Renvoie le montant cumulé des remboursements du capital d’un emprunt effectués entre deux périodes. -DB = DB ## Renvoie l’amortissement d’un bien pour une période spécifiée en utilisant la méthode de l’amortissement dégressif à taux fixe. -DDB = DDB ## Renvoie l’amortissement d’un bien pour toute période spécifiée, en utilisant la méthode de l’amortissement dégressif à taux double ou selon un coefficient à spécifier. -DISC = TAUX.ESCOMPTE ## Calcule le taux d’escompte d’une transaction. -DOLLARDE = PRIX.DEC ## Convertit un prix en euros, exprimé sous forme de fraction, en un prix en euros exprimé sous forme de nombre décimal. -DOLLARFR = PRIX.FRAC ## Convertit un prix en euros, exprimé sous forme de nombre décimal, en un prix en euros exprimé sous forme de fraction. -DURATION = DUREE ## Renvoie la durée, en années, d’un titre dont l’intérêt est perçu périodiquement. -EFFECT = TAUX.EFFECTIF ## Renvoie le taux d’intérêt annuel effectif. -FV = VC ## Renvoie la valeur future d’un investissement. -FVSCHEDULE = VC.PAIEMENTS ## Calcule la valeur future d’un investissement en appliquant une série de taux d’intérêt composites. -INTRATE = TAUX.INTERET ## Affiche le taux d’intérêt d’un titre totalement investi. -IPMT = INTPER ## Calcule le montant des intérêts d’un investissement pour une période donnée. -IRR = TRI ## Calcule le taux de rentabilité interne d’un investissement pour une succession de trésoreries. -ISPMT = ISPMT ## Calcule le montant des intérêts d’un investissement pour une période donnée. -MDURATION = DUREE.MODIFIEE ## Renvoie la durée de Macauley modifiée pour un titre ayant une valeur nominale hypothétique de 100_euros. -MIRR = TRIM ## Calcule le taux de rentabilité interne lorsque les paiements positifs et négatifs sont financés à des taux différents. -NOMINAL = TAUX.NOMINAL ## Calcule le taux d’intérêt nominal annuel. -NPER = NPM ## Renvoie le nombre de versements nécessaires pour rembourser un emprunt. -NPV = VAN ## Calcule la valeur actuelle nette d’un investissement basé sur une série de décaissements et un taux d’escompte. -ODDFPRICE = PRIX.PCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière. -ODDFYIELD = REND.PCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la première période de coupon est irrégulière. -ODDLPRICE = PRIX.DCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière. -ODDLYIELD = REND.DCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la dernière période de coupon est irrégulière. -PMT = VPM ## Calcule le paiement périodique d’un investissement donné. -PPMT = PRINCPER ## Calcule, pour une période donnée, la part de remboursement du principal d’un investissement. -PRICE = PRIX.TITRE ## Renvoie le prix d’un titre rapportant des intérêts périodiques, pour une valeur nominale de 100 euros. -PRICEDISC = VALEUR.ENCAISSEMENT ## Renvoie la valeur d’encaissement d’un escompte commercial, pour une valeur nominale de 100 euros. -PRICEMAT = PRIX.TITRE.ECHEANCE ## Renvoie le prix d’un titre dont la valeur nominale est 100 euros et qui rapporte des intérêts à l’échéance. -PV = PV ## Calcule la valeur actuelle d’un investissement. -RATE = TAUX ## Calcule le taux d’intérêt par période pour une annuité. -RECEIVED = VALEUR.NOMINALE ## Renvoie la valeur nominale à échéance d’un effet de commerce. -SLN = AMORLIN ## Calcule l’amortissement linéaire d’un bien pour une période donnée. -SYD = SYD ## Calcule l’amortissement d’un bien pour une période donnée sur la base de la méthode américaine Sum-of-Years Digits (amortissement dégressif à taux décroissant appliqué à une valeur constante). -TBILLEQ = TAUX.ESCOMPTE.R ## Renvoie le taux d’escompte rationnel d’un bon du Trésor. -TBILLPRICE = PRIX.BON.TRESOR ## Renvoie le prix d’un bon du Trésor d’une valeur nominale de 100 euros. -TBILLYIELD = RENDEMENT.BON.TRESOR ## Calcule le taux de rendement d’un bon du Trésor. -VDB = VDB ## Renvoie l’amortissement d’un bien pour une période spécifiée ou partielle en utilisant une méthode de l’amortissement dégressif à taux fixe. -XIRR = TRI.PAIEMENTS ## Calcule le taux de rentabilité interne d’un ensemble de paiements non périodiques. -XNPV = VAN.PAIEMENTS ## Renvoie la valeur actuelle nette d’un ensemble de paiements non périodiques. -YIELD = RENDEMENT.TITRE ## Calcule le rendement d’un titre rapportant des intérêts périodiquement. -YIELDDISC = RENDEMENT.SIMPLE ## Calcule le taux de rendement d’un emprunt à intérêt simple (par exemple, un bon du Trésor). -YIELDMAT = RENDEMENT.TITRE.ECHEANCE ## Renvoie le rendement annuel d’un titre qui rapporte des intérêts à l’échéance. - - -## -## Information functions Fonctions d’information -## -CELL = CELLULE ## Renvoie des informations sur la mise en forme, l’emplacement et le contenu d’une cellule. -ERROR.TYPE = TYPE.ERREUR ## Renvoie un nombre correspondant à un type d’erreur. -INFO = INFORMATIONS ## Renvoie des informations sur l’environnement d’exploitation actuel. -ISBLANK = ESTVIDE ## Renvoie VRAI si l’argument valeur est vide. -ISERR = ESTERR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur, sauf #N/A. -ISERROR = ESTERREUR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur. -ISEVEN = EST.PAIR ## Renvoie VRAI si le chiffre est pair. -ISLOGICAL = ESTLOGIQUE ## Renvoie VRAI si l’argument valeur fait référence à une valeur logique. -ISNA = ESTNA ## Renvoie VRAI si l’argument valeur fait référence à la valeur d’erreur #N/A. -ISNONTEXT = ESTNONTEXTE ## Renvoie VRAI si l’argument valeur ne se présente pas sous forme de texte. -ISNUMBER = ESTNUM ## Renvoie VRAI si l’argument valeur représente un nombre. -ISODD = EST.IMPAIR ## Renvoie VRAI si le chiffre est impair. -ISREF = ESTREF ## Renvoie VRAI si l’argument valeur est une référence. -ISTEXT = ESTTEXTE ## Renvoie VRAI si l’argument valeur se présente sous forme de texte. -N = N ## Renvoie une valeur convertie en nombre. -NA = NA ## Renvoie la valeur d’erreur #N/A. -TYPE = TYPE ## Renvoie un nombre indiquant le type de données d’une valeur. - - -## -## Logical functions Fonctions logiques -## -AND = ET ## Renvoie VRAI si tous ses arguments sont VRAI. -FALSE = FAUX ## Renvoie la valeur logique FAUX. -IF = SI ## Spécifie un test logique à effectuer. -IFERROR = SIERREUR ## Renvoie une valeur que vous spécifiez si une formule génère une erreur ; sinon, elle renvoie le résultat de la formule. -NOT = NON ## Inverse la logique de cet argument. -OR = OU ## Renvoie VRAI si un des arguments est VRAI. -TRUE = VRAI ## Renvoie la valeur logique VRAI. - - -## -## Lookup and reference functions Fonctions de recherche et de référence -## -ADDRESS = ADRESSE ## Renvoie une référence sous forme de texte à une seule cellule d’une feuille de calcul. -AREAS = ZONES ## Renvoie le nombre de zones dans une référence. -CHOOSE = CHOISIR ## Choisit une valeur dans une liste. -COLUMN = COLONNE ## Renvoie le numéro de colonne d’une référence. -COLUMNS = COLONNES ## Renvoie le nombre de colonnes dans une référence. -HLOOKUP = RECHERCHEH ## Effectue une recherche dans la première ligne d’une matrice et renvoie la valeur de la cellule indiquée. -HYPERLINK = LIEN_HYPERTEXTE ## Crée un raccourci ou un renvoi qui ouvre un document stocké sur un serveur réseau, sur un réseau Intranet ou sur Internet. -INDEX = INDEX ## Utilise un index pour choisir une valeur provenant d’une référence ou d’une matrice. -INDIRECT = INDIRECT ## Renvoie une référence indiquée par une valeur de texte. -LOOKUP = RECHERCHE ## Recherche des valeurs dans un vecteur ou une matrice. -MATCH = EQUIV ## Recherche des valeurs dans une référence ou une matrice. -OFFSET = DECALER ## Renvoie une référence décalée par rapport à une référence donnée. -ROW = LIGNE ## Renvoie le numéro de ligne d’une référence. -ROWS = LIGNES ## Renvoie le nombre de lignes dans une référence. -RTD = RTD ## Extrait les données en temps réel à partir d’un programme prenant en charge l’automation COM (Automation : utilisation des objets d'une application à partir d'une autre application ou d'un autre outil de développement. Autrefois appelée OLE Automation, Automation est une norme industrielle et une fonctionnalité du modèle d'objet COM (Component Object Model).). -TRANSPOSE = TRANSPOSE ## Renvoie la transposition d’une matrice. -VLOOKUP = RECHERCHEV ## Effectue une recherche dans la première colonne d’une matrice et se déplace sur la ligne pour renvoyer la valeur d’une cellule. - - -## -## Math and trigonometry functions Fonctions mathématiques et trigonométriques -## -ABS = ABS ## Renvoie la valeur absolue d’un nombre. -ACOS = ACOS ## Renvoie l’arccosinus d’un nombre. -ACOSH = ACOSH ## Renvoie le cosinus hyperbolique inverse d’un nombre. -ASIN = ASIN ## Renvoie l’arcsinus d’un nombre. -ASINH = ASINH ## Renvoie le sinus hyperbolique inverse d’un nombre. -ATAN = ATAN ## Renvoie l’arctangente d’un nombre. -ATAN2 = ATAN2 ## Renvoie l’arctangente des coordonnées x et y. -ATANH = ATANH ## Renvoie la tangente hyperbolique inverse d’un nombre. -CEILING = PLAFOND ## Arrondit un nombre au nombre entier le plus proche ou au multiple le plus proche de l’argument précision en s’éloignant de zéro. -COMBIN = COMBIN ## Renvoie le nombre de combinaisons que l’on peut former avec un nombre donné d’objets. -COS = COS ## Renvoie le cosinus d’un nombre. -COSH = COSH ## Renvoie le cosinus hyperbolique d’un nombre. -DEGREES = DEGRES ## Convertit des radians en degrés. -EVEN = PAIR ## Arrondit un nombre au nombre entier pair le plus proche en s’éloignant de zéro. -EXP = EXP ## Renvoie e élevé à la puissance d’un nombre donné. -FACT = FACT ## Renvoie la factorielle d’un nombre. -FACTDOUBLE = FACTDOUBLE ## Renvoie la factorielle double d’un nombre. -FLOOR = PLANCHER ## Arrondit un nombre en tendant vers 0 (zéro). -GCD = PGCD ## Renvoie le plus grand commun diviseur. -INT = ENT ## Arrondit un nombre à l’entier immédiatement inférieur. -LCM = PPCM ## Renvoie le plus petit commun multiple. -LN = LN ## Renvoie le logarithme népérien d’un nombre. -LOG = LOG ## Renvoie le logarithme d’un nombre dans la base spécifiée. -LOG10 = LOG10 ## Calcule le logarithme en base 10 d’un nombre. -MDETERM = DETERMAT ## Renvoie le déterminant d’une matrice. -MINVERSE = INVERSEMAT ## Renvoie la matrice inverse d’une matrice. -MMULT = PRODUITMAT ## Renvoie le produit de deux matrices. -MOD = MOD ## Renvoie le reste d’une division. -MROUND = ARRONDI.AU.MULTIPLE ## Donne l’arrondi d’un nombre au multiple spécifié. -MULTINOMIAL = MULTINOMIALE ## Calcule la multinomiale d’un ensemble de nombres. -ODD = IMPAIR ## Renvoie le nombre, arrondi à la valeur du nombre entier impair le plus proche en s’éloignant de zéro. -PI = PI ## Renvoie la valeur de pi. -POWER = PUISSANCE ## Renvoie la valeur du nombre élevé à une puissance. -PRODUCT = PRODUIT ## Multiplie ses arguments. -QUOTIENT = QUOTIENT ## Renvoie la partie entière du résultat d’une division. -RADIANS = RADIANS ## Convertit des degrés en radians. -RAND = ALEA ## Renvoie un nombre aléatoire compris entre 0 et 1. -RANDBETWEEN = ALEA.ENTRE.BORNES ## Renvoie un nombre aléatoire entre les nombres que vous spécifiez. -ROMAN = ROMAIN ## Convertit des chiffres arabes en chiffres romains, sous forme de texte. -ROUND = ARRONDI ## Arrondit un nombre au nombre de chiffres indiqué. -ROUNDDOWN = ARRONDI.INF ## Arrondit un nombre en tendant vers 0 (zéro). -ROUNDUP = ARRONDI.SUP ## Arrondit un nombre à l’entier supérieur, en s’éloignant de zéro. -SERIESSUM = SOMME.SERIES ## Renvoie la somme d’une série géométrique en s’appuyant sur la formule suivante : -SIGN = SIGNE ## Renvoie le signe d’un nombre. -SIN = SIN ## Renvoie le sinus d’un angle donné. -SINH = SINH ## Renvoie le sinus hyperbolique d’un nombre. -SQRT = RACINE ## Renvoie la racine carrée d’un nombre. -SQRTPI = RACINE.PI ## Renvoie la racine carrée de (nombre * pi). -SUBTOTAL = SOUS.TOTAL ## Renvoie un sous-total dans une liste ou une base de données. -SUM = SOMME ## Calcule la somme de ses arguments. -SUMIF = SOMME.SI ## Additionne les cellules spécifiées si elles répondent à un critère donné. -SUMIFS = SOMME.SI.ENS ## Ajoute les cellules d’une plage qui répondent à plusieurs critères. -SUMPRODUCT = SOMMEPROD ## Multiplie les valeurs correspondantes des matrices spécifiées et calcule la somme de ces produits. -SUMSQ = SOMME.CARRES ## Renvoie la somme des carrés des arguments. -SUMX2MY2 = SOMME.X2MY2 ## Renvoie la somme de la différence des carrés des valeurs correspondantes de deux matrices. -SUMX2PY2 = SOMME.X2PY2 ## Renvoie la somme de la somme des carrés des valeurs correspondantes de deux matrices. -SUMXMY2 = SOMME.XMY2 ## Renvoie la somme des carrés des différences entre les valeurs correspondantes de deux matrices. -TAN = TAN ## Renvoie la tangente d’un nombre. -TANH = TANH ## Renvoie la tangente hyperbolique d’un nombre. -TRUNC = TRONQUE ## Renvoie la partie entière d’un nombre. - - -## -## Statistical functions Fonctions statistiques -## -AVEDEV = ECART.MOYEN ## Renvoie la moyenne des écarts absolus observés dans la moyenne des points de données. -AVERAGE = MOYENNE ## Renvoie la moyenne de ses arguments. -AVERAGEA = AVERAGEA ## Renvoie la moyenne de ses arguments, nombres, texte et valeurs logiques inclus. -AVERAGEIF = MOYENNE.SI ## Renvoie la moyenne (arithmétique) de toutes les cellules d’une plage qui répondent à des critères donnés. -AVERAGEIFS = MOYENNE.SI.ENS ## Renvoie la moyenne (arithmétique) de toutes les cellules qui répondent à plusieurs critères. -BETADIST = LOI.BETA ## Renvoie la fonction de distribution cumulée. -BETAINV = BETA.INVERSE ## Renvoie l’inverse de la fonction de distribution cumulée pour une distribution bêta spécifiée. -BINOMDIST = LOI.BINOMIALE ## Renvoie la probabilité d’une variable aléatoire discrète suivant la loi binomiale. -CHIDIST = LOI.KHIDEUX ## Renvoie la probabilité unilatérale de la distribution khi-deux. -CHIINV = KHIDEUX.INVERSE ## Renvoie l’inverse de la probabilité unilatérale de la distribution khi-deux. -CHITEST = TEST.KHIDEUX ## Renvoie le test d’indépendance. -CONFIDENCE = INTERVALLE.CONFIANCE ## Renvoie l’intervalle de confiance pour une moyenne de population. -CORREL = COEFFICIENT.CORRELATION ## Renvoie le coefficient de corrélation entre deux séries de données. -COUNT = NB ## Détermine les nombres compris dans la liste des arguments. -COUNTA = NBVAL ## Détermine le nombre de valeurs comprises dans la liste des arguments. -COUNTBLANK = NB.VIDE ## Compte le nombre de cellules vides dans une plage. -COUNTIF = NB.SI ## Compte le nombre de cellules qui répondent à un critère donné dans une plage. -COUNTIFS = NB.SI.ENS ## Compte le nombre de cellules à l’intérieur d’une plage qui répondent à plusieurs critères. -COVAR = COVARIANCE ## Renvoie la covariance, moyenne des produits des écarts pour chaque série d’observations. -CRITBINOM = CRITERE.LOI.BINOMIALE ## Renvoie la plus petite valeur pour laquelle la distribution binomiale cumulée est inférieure ou égale à une valeur de critère. -DEVSQ = SOMME.CARRES.ECARTS ## Renvoie la somme des carrés des écarts. -EXPONDIST = LOI.EXPONENTIELLE ## Renvoie la distribution exponentielle. -FDIST = LOI.F ## Renvoie la distribution de probabilité F. -FINV = INVERSE.LOI.F ## Renvoie l’inverse de la distribution de probabilité F. -FISHER = FISHER ## Renvoie la transformation de Fisher. -FISHERINV = FISHER.INVERSE ## Renvoie l’inverse de la transformation de Fisher. -FORECAST = PREVISION ## Calcule une valeur par rapport à une tendance linéaire. -FREQUENCY = FREQUENCE ## Calcule la fréquence d’apparition des valeurs dans une plage de valeurs, puis renvoie des nombres sous forme de matrice verticale. -FTEST = TEST.F ## Renvoie le résultat d’un test F. -GAMMADIST = LOI.GAMMA ## Renvoie la probabilité d’une variable aléatoire suivant une loi Gamma. -GAMMAINV = LOI.GAMMA.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi Gamma. -GAMMALN = LNGAMMA ## Renvoie le logarithme népérien de la fonction Gamma, G(x) -GEOMEAN = MOYENNE.GEOMETRIQUE ## Renvoie la moyenne géométrique. -GROWTH = CROISSANCE ## Calcule des valeurs par rapport à une tendance exponentielle. -HARMEAN = MOYENNE.HARMONIQUE ## Renvoie la moyenne harmonique. -HYPGEOMDIST = LOI.HYPERGEOMETRIQUE ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi hypergéométrique. -INTERCEPT = ORDONNEE.ORIGINE ## Renvoie l’ordonnée à l’origine d’une droite de régression linéaire. -KURT = KURTOSIS ## Renvoie le kurtosis d’une série de données. -LARGE = GRANDE.VALEUR ## Renvoie la k-ième plus grande valeur d’une série de données. -LINEST = DROITEREG ## Renvoie les paramètres d’une tendance linéaire. -LOGEST = LOGREG ## Renvoie les paramètres d’une tendance exponentielle. -LOGINV = LOI.LOGNORMALE.INVERSE ## Renvoie l’inverse de la probabilité pour une variable aléatoire suivant la loi lognormale. -LOGNORMDIST = LOI.LOGNORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi lognormale. -MAX = MAX ## Renvoie la valeur maximale contenue dans une liste d’arguments. -MAXA = MAXA ## Renvoie la valeur maximale d’une liste d’arguments, nombres, texte et valeurs logiques inclus. -MEDIAN = MEDIANE ## Renvoie la valeur médiane des nombres donnés. -MIN = MIN ## Renvoie la valeur minimale contenue dans une liste d’arguments. -MINA = MINA ## Renvoie la plus petite valeur d’une liste d’arguments, nombres, texte et valeurs logiques inclus. -MODE = MODE ## Renvoie la valeur la plus courante d’une série de données. -NEGBINOMDIST = LOI.BINOMIALE.NEG ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi binomiale négative. -NORMDIST = LOI.NORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale. -NORMINV = LOI.NORMALE.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi normale standard. -NORMSDIST = LOI.NORMALE.STANDARD ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale standard. -NORMSINV = LOI.NORMALE.STANDARD.INVERSE ## Renvoie l’inverse de la distribution cumulée normale standard. -PEARSON = PEARSON ## Renvoie le coefficient de corrélation d’échantillonnage de Pearson. -PERCENTILE = CENTILE ## Renvoie le k-ième centile des valeurs d’une plage. -PERCENTRANK = RANG.POURCENTAGE ## Renvoie le rang en pourcentage d’une valeur d’une série de données. -PERMUT = PERMUTATION ## Renvoie le nombre de permutations pour un nombre donné d’objets. -POISSON = LOI.POISSON ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Poisson. -PROB = PROBABILITE ## Renvoie la probabilité que des valeurs d’une plage soient comprises entre deux limites. -QUARTILE = QUARTILE ## Renvoie le quartile d’une série de données. -RANK = RANG ## Renvoie le rang d’un nombre contenu dans une liste. -RSQ = COEFFICIENT.DETERMINATION ## Renvoie la valeur du coefficient de détermination R^2 d’une régression linéaire. -SKEW = COEFFICIENT.ASYMETRIE ## Renvoie l’asymétrie d’une distribution. -SLOPE = PENTE ## Renvoie la pente d’une droite de régression linéaire. -SMALL = PETITE.VALEUR ## Renvoie la k-ième plus petite valeur d’une série de données. -STANDARDIZE = CENTREE.REDUITE ## Renvoie une valeur centrée réduite. -STDEV = ECARTYPE ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population. -STDEVA = STDEVA ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques inclus. -STDEVP = ECARTYPEP ## Calcule l’écart type d’une population à partir de la population entière. -STDEVPA = STDEVPA ## Calcule l’écart type d’une population à partir de l’ensemble de la population, nombres, texte et valeurs logiques inclus. -STEYX = ERREUR.TYPE.XY ## Renvoie l’erreur type de la valeur y prévue pour chaque x de la régression. -TDIST = LOI.STUDENT ## Renvoie la probabilité d’une variable aléatoire suivant une loi T de Student. -TINV = LOI.STUDENT.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi T de Student. -TREND = TENDANCE ## Renvoie des valeurs par rapport à une tendance linéaire. -TRIMMEAN = MOYENNE.REDUITE ## Renvoie la moyenne de l’intérieur d’une série de données. -TTEST = TEST.STUDENT ## Renvoie la probabilité associée à un test T de Student. -VAR = VAR ## Calcule la variance sur la base d’un échantillon. -VARA = VARA ## Estime la variance d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques incluses. -VARP = VAR.P ## Calcule la variance sur la base de l’ensemble de la population. -VARPA = VARPA ## Calcule la variance d’une population en se basant sur la population entière, nombres, texte et valeurs logiques inclus. -WEIBULL = LOI.WEIBULL ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Weibull. -ZTEST = TEST.Z ## Renvoie la valeur de probabilité unilatérale d’un test z. - - -## -## Text functions Fonctions de texte -## -ASC = ASC ## Change les caractères anglais ou katakana à pleine chasse (codés sur deux octets) à l’intérieur d’une chaîne de caractères en caractères à demi-chasse (codés sur un octet). -BAHTTEXT = BAHTTEXT ## Convertit un nombre en texte en utilisant le format monétaire ß (baht). -CHAR = CAR ## Renvoie le caractère spécifié par le code numérique. -CLEAN = EPURAGE ## Supprime tous les caractères de contrôle du texte. -CODE = CODE ## Renvoie le numéro de code du premier caractère du texte. -CONCATENATE = CONCATENER ## Assemble plusieurs éléments textuels de façon à n’en former qu’un seul. -DOLLAR = EURO ## Convertit un nombre en texte en utilisant le format monétaire € (euro). -EXACT = EXACT ## Vérifie si deux valeurs de texte sont identiques. -FIND = TROUVE ## Trouve un valeur textuelle dans une autre, en respectant la casse. -FINDB = TROUVERB ## Trouve un valeur textuelle dans une autre, en respectant la casse. -FIXED = CTXT ## Convertit un nombre au format texte avec un nombre de décimales spécifié. -JIS = JIS ## Change les caractères anglais ou katakana à demi-chasse (codés sur un octet) à l’intérieur d’une chaîne de caractères en caractères à à pleine chasse (codés sur deux octets). -LEFT = GAUCHE ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères. -LEFTB = GAUCHEB ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères. -LEN = NBCAR ## Renvoie le nombre de caractères contenus dans une chaîne de texte. -LENB = LENB ## Renvoie le nombre de caractères contenus dans une chaîne de texte. -LOWER = MINUSCULE ## Convertit le texte en minuscules. -MID = STXT ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez. -MIDB = STXTB ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez. -PHONETIC = PHONETIQUE ## Extrait les caractères phonétiques (furigana) d’une chaîne de texte. -PROPER = NOMPROPRE ## Met en majuscules la première lettre de chaque mot dans une chaîne textuelle. -REPLACE = REMPLACER ## Remplace des caractères dans un texte. -REPLACEB = REMPLACERB ## Remplace des caractères dans un texte. -REPT = REPT ## Répète un texte un certain nombre de fois. -RIGHT = DROITE ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères. -RIGHTB = DROITEB ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères. -SEARCH = CHERCHE ## Trouve un texte dans un autre texte (sans respecter la casse). -SEARCHB = CHERCHERB ## Trouve un texte dans un autre texte (sans respecter la casse). -SUBSTITUTE = SUBSTITUE ## Remplace l’ancien texte d’une chaîne de caractères par un nouveau. -T = T ## Convertit ses arguments en texte. -TEXT = TEXTE ## Convertit un nombre au format texte. -TRIM = SUPPRESPACE ## Supprime les espaces du texte. -UPPER = MAJUSCULE ## Convertit le texte en majuscules. -VALUE = CNUM ## Convertit un argument textuel en nombre diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/config deleted file mode 100644 index bf423a6c8b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = Ft - - -## -## Excel Error Codes (For future use) -## -NULL = #NULLA! -DIV0 = #ZÉRÓOSZTÓ! -VALUE = #ÉRTÉK! -REF = #HIV! -NAME = #NÉV? -NUM = #SZÃM! -NA = #HIÃNYZIK diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/functions deleted file mode 100644 index dd9cff55ef..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/hu/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions BÅ‘vítmények és automatizálási függvények -## -GETPIVOTDATA = KIMUTATÃSADATOT.VESZ ## A kimutatásokban tárolt adatok visszaadására használható. - - -## -## Cube functions Kockafüggvények -## -CUBEKPIMEMBER = KOCKA.FÅTELJMUT ## Egy fÅ‘ teljesítménymutató (KPI) nevét, tulajdonságát és mértékegységét adja eredményül, a nevet és a tulajdonságot megjeleníti a cellában. A KPI-k számszerűsíthetÅ‘ mérési lehetÅ‘séget jelentenek – ilyen mutató például a havi bruttó nyereség vagy az egy alkalmazottra jutó negyedéves forgalom –, egy szervezet teljesítményének nyomonkövetésére használhatók. -CUBEMEMBER = KOCKA.TAG ## Kockahierachia tagját vagy rekordját adja eredményül. EllenÅ‘rizhetÅ‘ vele, hogy szerepel-e a kockában az adott tag vagy rekord. -CUBEMEMBERPROPERTY = KOCKA.TAG.TUL ## A kocka egyik tagtulajdonságának értékét adja eredményül. Használatával ellenÅ‘rizhetÅ‘, hogy szerepel-e egy tagnév a kockában, eredménye pedig az erre a tagra vonatkozó, megadott tulajdonság. -CUBERANKEDMEMBER = KOCKA.HALM.ELEM ## Egy halmaz rangsor szerinti n-edik tagját adja eredményül. Használatával egy halmaz egy vagy több elemét kaphatja meg, például a legnagyobb teljesítményű üzletkötÅ‘t vagy a 10 legjobb tanulót. -CUBESET = KOCKA.HALM ## Számított tagok vagy rekordok halmazát adja eredményül, ehhez egy beállított kifejezést elküld a kiszolgálón található kockának, majd ezt a halmazt adja vissza a Microsoft Office Excel alkalmazásnak. -CUBESETCOUNT = KOCKA.HALM.DB ## Egy halmaz elemszámát adja eredményül. -CUBEVALUE = KOCKA.ÉRTÉK ## Kockából összesített értéket ad eredményül. - - -## -## Database functions Adatbázis-kezelÅ‘ függvények -## -DAVERAGE = AB.ÃTLAG ## A kijelölt adatbáziselemek átlagát számítja ki. -DCOUNT = AB.DARAB ## Megszámolja, hogy az adatbázisban hány cella tartalmaz számokat. -DCOUNTA = AB.DARAB2 ## Megszámolja az adatbázisban lévÅ‘ nem üres cellákat. -DGET = AB.MEZÅ ## Egy adatbázisból egyetlen olyan rekordot ad vissza, amely megfelel a megadott feltételeknek. -DMAX = AB.MAX ## A kiválasztott adatbáziselemek közül a legnagyobb értéket adja eredményül. -DMIN = AB.MIN ## A kijelölt adatbáziselemek közül a legkisebb értéket adja eredményül. -DPRODUCT = AB.SZORZAT ## Az adatbázis megadott feltételeknek eleget tevÅ‘ rekordjaira összeszorozza a megadott mezÅ‘ben található számértékeket, és eredményül ezt a szorzatot adja. -DSTDEV = AB.SZÓRÃS ## A kijelölt adatbáziselemek egy mintája alapján megbecsüli a szórást. -DSTDEVP = AB.SZÓRÃS2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórást. -DSUM = AB.SZUM ## Összeadja a feltételnek megfelelÅ‘ adatbázisrekordok mezÅ‘oszlopában a számokat. -DVAR = AB.VAR ## A kijelölt adatbáziselemek mintája alapján becslést ad a szórásnégyzetre. -DVARP = AB.VAR2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórásnégyzetet. - - -## -## Date and time functions Dátumfüggvények -## -DATE = DÃTUM ## Adott dátum dátumértékét adja eredményül. -DATEVALUE = DÃTUMÉRTÉK ## Szövegként megadott dátumot dátumértékké alakít át. -DAY = NAP ## Dátumértéket a hónap egy napjává (0-31) alakít. -DAYS360 = NAP360 ## Két dátum közé esÅ‘ napok számát számítja ki a 360 napos év alapján. -EDATE = EDATE ## Adott dátumnál adott számú hónappal korábbi vagy késÅ‘bbi dátum dátumértékét adja eredményül. -EOMONTH = EOMONTH ## Adott dátumnál adott számú hónappal korábbi vagy késÅ‘bbi hónap utolsó napjának dátumértékét adja eredményül. -HOUR = ÓRA ## Időértéket órákká alakít. -MINUTE = PERC ## Időértéket percekké alakít. -MONTH = HÓNAP ## Időértéket hónapokká alakít. -NETWORKDAYS = NETWORKDAYS ## Két dátum között a teljes munkanapok számát adja meg. -NOW = MOST ## A napi dátum dátumértékét és a pontos idÅ‘ időértékét adja eredményül. -SECOND = MPERC ## Időértéket másodpercekké alakít át. -TIME = IDÅ ## Adott idÅ‘pont időértékét adja meg. -TIMEVALUE = IDÅÉRTÉK ## Szövegként megadott idÅ‘pontot időértékké alakít át. -TODAY = MA ## A napi dátum dátumértékét adja eredményül. -WEEKDAY = HÉT.NAPJA ## Dátumértéket a hét napjává alakítja át. -WEEKNUM = WEEKNUM ## Visszatérési értéke egy szám, amely azt mutatja meg, hogy a megadott dátum az év hányadik hetére esik. -WORKDAY = WORKDAY ## Adott dátumnál adott munkanappal korábbi vagy késÅ‘bbi dátum dátumértékét adja eredményül. -YEAR = ÉV ## Sorszámot évvé alakít át. -YEARFRAC = YEARFRAC ## Az adott dátumok közötti teljes napok számát törtévként adja meg. - - -## -## Engineering functions Mérnöki függvények -## -BESSELI = BESSELI ## Az In(x) módosított Bessel-függvény értékét adja eredményül. -BESSELJ = BESSELJ ## A Jn(x) Bessel-függvény értékét adja eredményül. -BESSELK = BESSELK ## A Kn(x) módosított Bessel-függvény értékét adja eredményül. -BESSELY = BESSELY ## Az Yn(x) módosított Bessel-függvény értékét adja eredményül. -BIN2DEC = BIN2DEC ## Bináris számot decimálissá alakít át. -BIN2HEX = BIN2HEX ## Bináris számot hexadecimálissá alakít át. -BIN2OCT = BIN2OCT ## Bináris számot oktálissá alakít át. -COMPLEX = COMPLEX ## Valós és képzetes részbÅ‘l komplex számot képez. -CONVERT = CONVERT ## Mértékegységeket vált át. -DEC2BIN = DEC2BIN ## Decimális számot binárissá alakít át. -DEC2HEX = DEC2HEX ## Decimális számot hexadecimálissá alakít át. -DEC2OCT = DEC2OCT ## Decimális számot oktálissá alakít át. -DELTA = DELTA ## Azt vizsgálja, hogy két érték egyenlÅ‘-e. -ERF = ERF ## A hibafüggvény értékét adja eredményül. -ERFC = ERFC ## A kiegészített hibafüggvény értékét adja eredményül. -GESTEP = GESTEP ## Azt vizsgálja, hogy egy szám nagyobb-e adott küszöbértéknél. -HEX2BIN = HEX2BIN ## Hexadecimális számot binárissá alakít át. -HEX2DEC = HEX2DEC ## Hexadecimális számot decimálissá alakít át. -HEX2OCT = HEX2OCT ## Hexadecimális számot oktálissá alakít át. -IMABS = IMABS ## Komplex szám abszolút értékét (modulusát) adja eredményül. -IMAGINARY = IMAGINARY ## Komplex szám képzetes részét adja eredményül. -IMARGUMENT = IMARGUMENT ## A komplex szám radiánban kifejezett théta argumentumát adja eredményül. -IMCONJUGATE = IMCONJUGATE ## Komplex szám komplex konjugáltját adja eredményül. -IMCOS = IMCOS ## Komplex szám koszinuszát adja eredményül. -IMDIV = IMDIV ## Két komplex szám hányadosát adja eredményül. -IMEXP = IMEXP ## Az e szám komplex kitevÅ‘jű hatványát adja eredményül. -IMLN = IMLN ## Komplex szám természetes logaritmusát adja eredményül. -IMLOG10 = IMLOG10 ## Komplex szám tízes alapú logaritmusát adja eredményül. -IMLOG2 = IMLOG2 ## Komplex szám kettes alapú logaritmusát adja eredményül. -IMPOWER = IMPOWER ## Komplex szám hatványát adja eredményül. -IMPRODUCT = IMPRODUCT ## Komplex számok szorzatát adja eredményül. -IMREAL = IMREAL ## Komplex szám valós részét adja eredményül. -IMSIN = IMSIN ## Komplex szám szinuszát adja eredményül. -IMSQRT = IMSQRT ## Komplex szám négyzetgyökét adja eredményül. -IMSUB = IMSUB ## Két komplex szám különbségét adja eredményül. -IMSUM = IMSUM ## Komplex számok összegét adja eredményül. -OCT2BIN = OCT2BIN ## Oktális számot binárissá alakít át. -OCT2DEC = OCT2DEC ## Oktális számot decimálissá alakít át. -OCT2HEX = OCT2HEX ## Oktális számot hexadecimálissá alakít át. - - -## -## Financial functions Pénzügyi függvények -## -ACCRINT = ACCRINT ## Periodikusan kamatozó értékpapír felszaporodott kamatát adja eredményül. -ACCRINTM = ACCRINTM ## Lejáratkor kamatozó értékpapír felszaporodott kamatát adja eredményül. -AMORDEGRC = AMORDEGRC ## Ãllóeszköz lineáris értékcsökkenését adja meg az egyes könyvelési idÅ‘szakokra vonatkozóan. -AMORLINC = AMORLINC ## Az egyes könyvelési idÅ‘szakokban az értékcsökkenést adja meg. -COUPDAYBS = COUPDAYBS ## A szelvényidÅ‘szak kezdetétÅ‘l a kifizetés idÅ‘pontjáig eltelt napokat adja vissza. -COUPDAYS = COUPDAYS ## A kifizetés idÅ‘pontját magában foglaló szelvényperiódus hosszát adja meg napokban. -COUPDAYSNC = COUPDAYSNC ## A kifizetés idÅ‘pontja és a legközelebbi szelvénydátum közötti napok számát adja meg. -COUPNCD = COUPNCD ## A kifizetést követÅ‘ legelsÅ‘ szelvénydátumot adja eredményül. -COUPNUM = COUPNUM ## A kifizetés és a lejárat idÅ‘pontja között kifizetendÅ‘ szelvények számát adja eredményül. -COUPPCD = COUPPCD ## A kifizetés elÅ‘tti utolsó szelvénydátumot adja eredményül. -CUMIPMT = CUMIPMT ## Két fizetési idÅ‘szak között kifizetett kamat halmozott értékét adja eredményül. -CUMPRINC = CUMPRINC ## Két fizetési idÅ‘szak között kifizetett részletek halmozott (kamatot nem tartalmazó) értékét adja eredményül. -DB = KCS2 ## Eszköz adott idÅ‘szak alatti értékcsökkenését számítja ki a lineáris leírási modell alkalmazásával. -DDB = KCSA ## Eszköz értékcsökkenését számítja ki adott idÅ‘szakra vonatkozóan a progresszív vagy egyéb megadott leírási modell alkalmazásával. -DISC = DISC ## Értékpapír leszámítolási kamatlábát adja eredményül. -DOLLARDE = DOLLARDE ## Egy közönséges törtként megadott számot tizedes törtté alakít át. -DOLLARFR = DOLLARFR ## Tizedes törtként megadott számot közönséges törtté alakít át. -DURATION = DURATION ## Periodikus kamatfizetésű értékpapír éves kamatérzékenységét adja eredményül. -EFFECT = EFFECT ## Az éves tényleges kamatláb értékét adja eredményül. -FV = JBÉ ## Befektetés jövÅ‘beli értékét számítja ki. -FVSCHEDULE = FVSCHEDULE ## A kezdÅ‘tÅ‘ke adott kamatlábak szerint megnövelt jövÅ‘beli értékét adja eredményül. -INTRATE = INTRATE ## A lejáratig teljesen lekötött értékpapír kamatrátáját adja eredményül. -IPMT = RRÉSZLET ## Hiteltörlesztésen belül a tÅ‘ketörlesztés nagyságát számítja ki adott idÅ‘szakra. -IRR = BMR ## A befektetés belsÅ‘ megtérülési rátáját számítja ki pénzáramláshoz. -ISPMT = LRÉSZLETKAMAT ## A befektetés adott idÅ‘szakára fizetett kamatot számítja ki. -MDURATION = MDURATION ## Egy 100 Ft névértékű értékpapír Macauley-féle módosított kamatérzékenységét adja eredményül. -MIRR = MEGTÉRÜLÉS ## A befektetés belsÅ‘ megtérülési rátáját számítja ki a költségek és a bevételek különbözÅ‘ kamatlába mellett. -NOMINAL = NOMINAL ## Az éves névleges kamatláb értékét adja eredményül. -NPER = PER.SZÃM ## A törlesztési idÅ‘szakok számát adja meg. -NPV = NMÉ ## Befektetéshez kapcsolódó pénzáramlás nettó jelenértékét számítja ki ismert pénzáramlás és kamatláb mellett. -ODDFPRICE = ODDFPRICE ## Egy 100 Ft névértékű, a futamidÅ‘ elején töredék-idÅ‘szakos értékpapír árát adja eredményül. -ODDFYIELD = ODDFYIELD ## A futamidÅ‘ elején töredék-idÅ‘szakos értékpapír hozamát adja eredményül. -ODDLPRICE = ODDLPRICE ## Egy 100 Ft névértékű, a futamidÅ‘ végén töredék-idÅ‘szakos értékpapír árát adja eredményül. -ODDLYIELD = ODDLYIELD ## A futamidÅ‘ végén töredék-idÅ‘szakos értékpapír hozamát adja eredményül. -PMT = RÉSZLET ## A törlesztési idÅ‘szakra vonatkozó törlesztési összeget számítja ki. -PPMT = PRÉSZLET ## Hiteltörlesztésen belül a tÅ‘ketörlesztés nagyságát számítja ki adott idÅ‘szakra. -PRICE = PRICE ## Egy 100 Ft névértékű, periodikusan kamatozó értékpapír árát adja eredményül. -PRICEDISC = PRICEDISC ## Egy 100 Ft névértékű leszámítolt értékpapír árát adja eredményül. -PRICEMAT = PRICEMAT ## Egy 100 Ft névértékű, a lejáratkor kamatozó értékpapír árát adja eredményül. -PV = MÉ ## Befektetés jelenlegi értékét számítja ki. -RATE = RÃTA ## Egy törlesztési idÅ‘szakban az egy idÅ‘szakra esÅ‘ kamatláb nagyságát számítja ki. -RECEIVED = RECEIVED ## A lejáratig teljesen lekötött értékpapír lejáratakor kapott összegét adja eredményül. -SLN = LCSA ## Tárgyi eszköz egy idÅ‘szakra esÅ‘ amortizációját adja meg bruttó érték szerinti lineáris leírási kulcsot alkalmazva. -SYD = SYD ## Tárgyi eszköz értékcsökkenését számítja ki adott idÅ‘szakra az évek számjegyösszegével dolgozó módszer alapján. -TBILLEQ = TBILLEQ ## Kincstárjegy kötvény-egyenértékű hozamát adja eredményül. -TBILLPRICE = TBILLPRICE ## Egy 100 Ft névértékű kincstárjegy árát adja eredményül. -TBILLYIELD = TBILLYIELD ## Kincstárjegy hozamát adja eredményül. -VDB = ÉCSRI ## Tárgyi eszköz amortizációját számítja ki megadott vagy részidÅ‘szakra a csökkenÅ‘ egyenleg módszerének alkalmazásával. -XIRR = XIRR ## Ütemezett készpénzforgalom (cash flow) belsÅ‘ megtérülési kamatrátáját adja eredményül. -XNPV = XNPV ## Ütemezett készpénzforgalom (cash flow) nettó jelenlegi értékét adja eredményül. -YIELD = YIELD ## Periodikusan kamatozó értékpapír hozamát adja eredményül. -YIELDDISC = YIELDDISC ## Leszámítolt értékpapír (például kincstárjegy) éves hozamát adja eredményül. -YIELDMAT = YIELDMAT ## Lejáratkor kamatozó értékpapír éves hozamát adja eredményül. - - -## -## Information functions Információs függvények -## -CELL = CELLA ## Egy cella formátumára, elhelyezkedésére vagy tartalmára vonatkozó adatokat ad eredményül. -ERROR.TYPE = HIBA.TÃPUS ## Egy hibatípushoz tartozó számot ad eredményül. -INFO = INFÓ ## A rendszer- és munkakörnyezet pillanatnyi állapotáról ad felvilágosítást. -ISBLANK = ÜRES ## Eredménye IGAZ, ha az érték üres. -ISERR = HIBA ## Eredménye IGAZ, ha az érték valamelyik hibaérték a #HIÃNYZIK kivételével. -ISERROR = HIBÃS ## Eredménye IGAZ, ha az érték valamelyik hibaérték. -ISEVEN = ISEVEN ## Eredménye IGAZ, ha argumentuma páros szám. -ISLOGICAL = LOGIKAI ## Eredménye IGAZ, ha az érték logikai érték. -ISNA = NINCS ## Eredménye IGAZ, ha az érték a #HIÃNYZIK hibaérték. -ISNONTEXT = NEM.SZÖVEG ## Eredménye IGAZ, ha az érték nem szöveg. -ISNUMBER = SZÃM ## Eredménye IGAZ, ha az érték szám. -ISODD = ISODD ## Eredménye IGAZ, ha argumentuma páratlan szám. -ISREF = HIVATKOZÃS ## Eredménye IGAZ, ha az érték hivatkozás. -ISTEXT = SZÖVEG.E ## Eredménye IGAZ, ha az érték szöveg. -N = N ## Argumentumának értékét számmá alakítja. -NA = HIÃNYZIK ## Eredménye a #HIÃNYZIK hibaérték. -TYPE = TÃPUS ## Érték adattípusának azonosítószámát adja eredményül. - - -## -## Logical functions Logikai függvények -## -AND = ÉS ## Eredménye IGAZ, ha minden argumentuma IGAZ. -FALSE = HAMIS ## A HAMIS logikai értéket adja eredményül. -IF = HA ## Logikai vizsgálatot hajt végre. -IFERROR = HAHIBA ## A megadott értéket adja vissza, ha egy képlet hibához vezet; más esetben a képlet értékét adja eredményül. -NOT = NEM ## Argumentuma értékének ellentettjét adja eredményül. -OR = VAGY ## Eredménye IGAZ, ha bármely argumentuma IGAZ. -TRUE = IGAZ ## Az IGAZ logikai értéket adja eredményül. - - -## -## Lookup and reference functions Keresési és hivatkozási függvények -## -ADDRESS = CÃM ## A munkalap egy cellájára való hivatkozást adja szövegként eredményül. -AREAS = TERÜLET ## Hivatkozásban a területek számát adja eredményül. -CHOOSE = VÃLASZT ## Értékek listájából választ ki egy elemet. -COLUMN = OSZLOP ## Egy hivatkozás oszlopszámát adja eredményül. -COLUMNS = OSZLOPOK ## A hivatkozásban található oszlopok számát adja eredményül. -HLOOKUP = VKERES ## A megadott tömb felsÅ‘ sorában adott értékű elemet keres, és a megtalált elem oszlopából adott sorban elhelyezkedÅ‘ értékkel tér vissza. -HYPERLINK = HIPERHIVATKOZÃS ## Hálózati kiszolgálón, intraneten vagy az interneten tárolt dokumentumot megnyitó parancsikont vagy hivatkozást hoz létre. -INDEX = INDEX ## Tömb- vagy hivatkozás indexszel megadott értékét adja vissza. -INDIRECT = INDIREKT ## Szöveg megadott hivatkozást ad eredményül. -LOOKUP = KERES ## Vektorban vagy tömbben keres meg értékeket. -MATCH = HOL.VAN ## Hivatkozásban vagy tömbben értékeket keres. -OFFSET = OFSZET ## Hivatkozás egy másik hivatkozástól számított távolságát adja meg. -ROW = SOR ## Egy hivatkozás sorának számát adja meg. -ROWS = SOROK ## Egy hivatkozás sorainak számát adja meg. -RTD = RTD ## Valós idejű adatokat keres vissza a COM automatizmust (automatizálás: Egy alkalmazás objektumaival való munka másik alkalmazásból vagy fejlesztÅ‘eszközbÅ‘l. A korábban OLE automatizmusnak nevezett automatizálás iparági szabvány, a Component Object Model (COM) szolgáltatása.) támogató programból. -TRANSPOSE = TRANSZPONÃLÃS ## Egy tömb transzponáltját adja eredményül. -VLOOKUP = FKERES ## A megadott tömb bal szélsÅ‘ oszlopában megkeres egy értéket, majd annak sora és a megadott oszlop metszéspontjában levÅ‘ értéked adja eredményül. - - -## -## Math and trigonometry functions Matematikai és trigonometrikus függvények -## -ABS = ABS ## Egy szám abszolút értékét adja eredményül. -ACOS = ARCCOS ## Egy szám arkusz koszinuszát számítja ki. -ACOSH = ACOSH ## Egy szám inverz koszinusz hiperbolikuszát számítja ki. -ASIN = ARCSIN ## Egy szám arkusz szinuszát számítja ki. -ASINH = ASINH ## Egy szám inverz szinusz hiperbolikuszát számítja ki. -ATAN = ARCTAN ## Egy szám arkusz tangensét számítja ki. -ATAN2 = ARCTAN2 ## X és y koordináták alapján számítja ki az arkusz tangens értéket. -ATANH = ATANH ## A szám inverz tangens hiperbolikuszát számítja ki. -CEILING = PLAFON ## Egy számot a legközelebbi egészre vagy a pontosságként megadott érték legközelebb esÅ‘ többszörösére kerekít. -COMBIN = KOMBINÃCIÓK ## Adott számú objektum összes lehetséges kombinációinak számát számítja ki. -COS = COS ## Egy szám koszinuszát számítja ki. -COSH = COSH ## Egy szám koszinusz hiperbolikuszát számítja ki. -DEGREES = FOK ## Radiánt fokká alakít át. -EVEN = PÃROS ## Egy számot a legközelebbi páros egész számra kerekít. -EXP = KITEVÅ ## Az e adott kitevÅ‘jű hatványát adja eredményül. -FACT = FAKT ## Egy szám faktoriálisát számítja ki. -FACTDOUBLE = FACTDOUBLE ## Egy szám dupla faktoriálisát adja eredményül. -FLOOR = PADLÓ ## Egy számot lefelé, a nulla felé kerekít. -GCD = GCD ## A legnagyobb közös osztót adja eredményül. -INT = INT ## Egy számot lefelé kerekít a legközelebbi egészre. -LCM = LCM ## A legkisebb közös többszöröst adja eredményül. -LN = LN ## Egy szám természetes logaritmusát számítja ki. -LOG = LOG ## Egy szám adott alapú logaritmusát számítja ki. -LOG10 = LOG10 ## Egy szám 10-es alapú logaritmusát számítja ki. -MDETERM = MDETERM ## Egy tömb mátrix-determinánsát számítja ki. -MINVERSE = INVERZ.MÃTRIX ## Egy tömb mátrix inverzét adja eredményül. -MMULT = MSZORZAT ## Két tömb mátrix-szorzatát adja meg. -MOD = MARADÉK ## Egy szám osztási maradékát adja eredményül. -MROUND = MROUND ## A kívánt többszörösére kerekített értéket ad eredményül. -MULTINOMIAL = MULTINOMIAL ## Számhalmaz multinomiálisát adja eredményül. -ODD = PÃRATLAN ## Egy számot a legközelebbi páratlan számra kerekít. -PI = PI ## A pi matematikai állandót adja vissza. -POWER = HATVÃNY ## Egy szám adott kitevÅ‘jű hatványát számítja ki. -PRODUCT = SZORZAT ## Argumentumai szorzatát számítja ki. -QUOTIENT = QUOTIENT ## Egy hányados egész részét adja eredményül. -RADIANS = RADIÃN ## Fokot radiánná alakít át. -RAND = VÉL ## Egy 0 és 1 közötti véletlen számot ad eredményül. -RANDBETWEEN = RANDBETWEEN ## Megadott számok közé esÅ‘ véletlen számot állít elÅ‘. -ROMAN = RÓMAI ## Egy számot római számokkal kifejezve szövegként ad eredményül. -ROUND = KEREKÃTÉS ## Egy számot adott számú számjegyre kerekít. -ROUNDDOWN = KEREKÃTÉS.LE ## Egy számot lefelé, a nulla felé kerekít. -ROUNDUP = KEREKÃTÉS.FEL ## Egy számot felfelé, a nullától távolabbra kerekít. -SERIESSUM = SERIESSUM ## Hatványsor összegét adja eredményül. -SIGN = ELÅJEL ## Egy szám elÅ‘jelét adja meg. -SIN = SIN ## Egy szög szinuszát számítja ki. -SINH = SINH ## Egy szám szinusz hiperbolikuszát számítja ki. -SQRT = GYÖK ## Egy szám pozitív négyzetgyökét számítja ki. -SQRTPI = SQRTPI ## A (szám*pi) négyzetgyökét adja eredményül. -SUBTOTAL = RÉSZÖSSZEG ## Lista vagy adatbázis részösszegét adja eredményül. -SUM = SZUM ## Összeadja az argumentumlistájában lévÅ‘ számokat. -SUMIF = SZUMHA ## A megadott feltételeknek eleget tevÅ‘ cellákban található értékeket adja össze. -SUMIFS = SZUMHATÖBB ## Több megadott feltételnek eleget tévÅ‘ tartománycellák összegét adja eredményül. -SUMPRODUCT = SZORZATÖSSZEG ## A megfelelÅ‘ tömbelemek szorzatának összegét számítja ki. -SUMSQ = NÉGYZETÖSSZEG ## Argumentumai négyzetének összegét számítja ki. -SUMX2MY2 = SZUMX2BÅLY2 ## Két tömb megfelelÅ‘ elemei négyzetének különbségét összegzi. -SUMX2PY2 = SZUMX2MEGY2 ## Két tömb megfelelÅ‘ elemei négyzetének összegét összegzi. -SUMXMY2 = SZUMXBÅLY2 ## Két tömb megfelelÅ‘ elemei különbségének négyzetösszegét számítja ki. -TAN = TAN ## Egy szám tangensét számítja ki. -TANH = TANH ## Egy szám tangens hiperbolikuszát számítja ki. -TRUNC = CSONK ## Egy számot egésszé csonkít. - - -## -## Statistical functions Statisztikai függvények -## -AVEDEV = ÃTL.ELTÉRÉS ## Az adatpontoknak átlaguktól való átlagos abszolút eltérését számítja ki. -AVERAGE = ÃTLAG ## Argumentumai átlagát számítja ki. -AVERAGEA = ÃTLAGA ## Argumentumai átlagát számítja ki (beleértve a számokat, szöveget és logikai értékeket). -AVERAGEIF = ÃTLAGHA ## A megadott feltételnek eleget tévÅ‘ tartomány celláinak átlagát (számtani közepét) adja eredményül. -AVERAGEIFS = ÃTLAGHATÖBB ## A megadott feltételeknek eleget tévÅ‘ cellák átlagát (számtani közepét) adja eredményül. -BETADIST = BÉTA.ELOSZLÃS ## A béta-eloszlás függvényt számítja ki. -BETAINV = INVERZ.BÉTA ## Adott béta-eloszláshoz kiszámítja a béta eloszlásfüggvény inverzét. -BINOMDIST = BINOM.ELOSZLÃS ## A diszkrét binomiális eloszlás valószínűségértékét számítja ki. -CHIDIST = KHI.ELOSZLÃS ## A khi-négyzet-eloszlás egyszélű valószínűségértékét számítja ki. -CHIINV = INVERZ.KHI ## A khi-négyzet-eloszlás egyszélű valószínűségértékének inverzét számítja ki. -CHITEST = KHI.PRÓBA ## Függetlenségvizsgálatot hajt végre. -CONFIDENCE = MEGBÃZHATÓSÃG ## Egy statisztikai sokaság várható értékének megbízhatósági intervallumát adja eredményül. -CORREL = KORREL ## Két adathalmaz korrelációs együtthatóját számítja ki. -COUNT = DARAB ## Megszámolja, hogy argumentumlistájában hány szám található. -COUNTA = DARAB2 ## Megszámolja, hogy argumentumlistájában hány érték található. -COUNTBLANK = DARABÜRES ## Egy tartományban összeszámolja az üres cellákat. -COUNTIF = DARABTELI ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek a megadott feltételnek. -COUNTIFS = DARABHATÖBB ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek több feltételnek. -COVAR = KOVAR ## A kovarianciát, azaz a páronkénti eltérések szorzatának átlagát számítja ki. -CRITBINOM = KRITBINOM ## Azt a legkisebb számot adja eredményül, amelyre a binomiális eloszlásfüggvény értéke nem kisebb egy adott határértéknél. -DEVSQ = SQ ## Az átlagtól való eltérések négyzetének összegét számítja ki. -EXPONDIST = EXP.ELOSZLÃS ## Az exponenciális eloszlás értékét számítja ki. -FDIST = F.ELOSZLÃS ## Az F-eloszlás értékét számítja ki. -FINV = INVERZ.F ## Az F-eloszlás inverzének értékét számítja ki. -FISHER = FISHER ## Fisher-transzformációt hajt végre. -FISHERINV = INVERZ.FISHER ## A Fisher-transzformáció inverzét hajtja végre. -FORECAST = ELÅREJELZÉS ## Az ismert értékek alapján lineáris regresszióval becsült értéket ad eredményül. -FREQUENCY = GYAKORISÃG ## A gyakorisági vagy empirikus eloszlás értékét függÅ‘leges tömbként adja eredményül. -FTEST = F.PRÓBA ## Az F-próba értékét adja eredményül. -GAMMADIST = GAMMA.ELOSZLÃS ## A gamma-eloszlás értékét számítja ki. -GAMMAINV = INVERZ.GAMMA ## A gamma-eloszlás eloszlásfüggvénye inverzének értékét számítja ki. -GAMMALN = GAMMALN ## A gamma-függvény természetes logaritmusát számítja ki. -GEOMEAN = MÉRTANI.KÖZÉP ## Argumentumai mértani középértékét számítja ki. -GROWTH = NÖV ## Exponenciális regresszió alapján ad becslést. -HARMEAN = HARM.KÖZÉP ## Argumentumai harmonikus átlagát számítja ki. -HYPGEOMDIST = HIPERGEOM.ELOSZLÃS ## A hipergeometriai eloszlás értékét számítja ki. -INTERCEPT = METSZ ## A regressziós egyenes y tengellyel való metszéspontját határozza meg. -KURT = CSÚCSOSSÃG ## Egy adathalmaz csúcsosságát számítja ki. -LARGE = NAGY ## Egy adathalmaz k-adik legnagyobb elemét adja eredményül. -LINEST = LIN.ILL ## A legkisebb négyzetek módszerével az adatokra illesztett egyenes paramétereit határozza meg. -LOGEST = LOG.ILL ## Az adatokra illesztett exponenciális görbe paramétereit határozza meg. -LOGINV = INVERZ.LOG.ELOSZLÃS ## A lognormális eloszlás inverzét számítja ki. -LOGNORMDIST = LOG.ELOSZLÃS ## A lognormális eloszlásfüggvény értékét számítja ki. -MAX = MAX ## Az argumentumai között szereplÅ‘ legnagyobb számot adja meg. -MAXA = MAX2 ## Az argumentumai között szereplÅ‘ legnagyobb számot adja meg (beleértve a számokat, szöveget és logikai értékeket). -MEDIAN = MEDIÃN ## Adott számhalmaz mediánját számítja ki. -MIN = MIN ## Az argumentumai között szereplÅ‘ legkisebb számot adja meg. -MINA = MIN2 ## Az argumentumai között szereplÅ‘ legkisebb számot adja meg, beleértve a számokat, szöveget és logikai értékeket. -MODE = MÓDUSZ ## Egy adathalmazból kiválasztja a leggyakrabban elÅ‘forduló számot. -NEGBINOMDIST = NEGBINOM.ELOSZL ## A negatív binomiális eloszlás értékét számítja ki. -NORMDIST = NORM.ELOSZL ## A normális eloszlás értékét számítja ki. -NORMINV = INVERZ.NORM ## A normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki. -NORMSDIST = STNORMELOSZL ## A standard normális eloszlás eloszlásfüggvényének értékét számítja ki. -NORMSINV = INVERZ.STNORM ## A standard normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki. -PEARSON = PEARSON ## A Pearson-féle korrelációs együtthatót számítja ki. -PERCENTILE = PERCENTILIS ## Egy tartományban található értékek k-adik percentilisét, azaz százalékosztályát adja eredményül. -PERCENTRANK = SZÃZALÉKRANG ## Egy értéknek egy adathalmazon belül vett százalékos rangját (elhelyezkedését) számítja ki. -PERMUT = VARIÃCIÓK ## Adott számú objektum k-ad osztályú ismétlés nélküli variációinak számát számítja ki. -POISSON = POISSON ## A Poisson-eloszlás értékét számítja ki. -PROB = VALÓSZÃNŰSÉG ## Annak valószínűségét számítja ki, hogy adott értékek két határérték közé esnek. -QUARTILE = KVARTILIS ## Egy adathalmaz kvartilisét (negyedszintjét) számítja ki. -RANK = SORSZÃM ## Kiszámítja, hogy egy szám hányadik egy számsorozatban. -RSQ = RNÉGYZET ## Kiszámítja a Pearson-féle szorzatmomentum korrelációs együtthatójának négyzetét. -SKEW = FERDESÉG ## Egy eloszlás ferdeségét határozza meg. -SLOPE = MEREDEKSÉG ## Egy lineáris regressziós egyenes meredekségét számítja ki. -SMALL = KICSI ## Egy adathalmaz k-adik legkisebb elemét adja meg. -STANDARDIZE = NORMALIZÃLÃS ## Normalizált értéket ad eredményül. -STDEV = SZÓRÃS ## Egy statisztikai sokaság mintájából kiszámítja annak szórását. -STDEVA = SZÓRÃSA ## Egy statisztikai sokaság mintájából kiszámítja annak szórását (beleértve a számokat, szöveget és logikai értékeket). -STDEVP = SZÓRÃSP ## Egy statisztikai sokaság egészébÅ‘l kiszámítja annak szórását. -STDEVPA = SZÓRÃSPA ## Egy statisztikai sokaság egészébÅ‘l kiszámítja annak szórását (beleértve számokat, szöveget és logikai értékeket). -STEYX = STHIBAYX ## Egy regresszió esetén az egyes x-értékek alapján meghatározott y-értékek standard hibáját számítja ki. -TDIST = T.ELOSZLÃS ## A Student-féle t-eloszlás értékét számítja ki. -TINV = INVERZ.T ## A Student-féle t-eloszlás inverzét számítja ki. -TREND = TREND ## Lineáris trend értékeit számítja ki. -TRIMMEAN = RÉSZÃTLAG ## Egy adathalmaz középsÅ‘ részének átlagát számítja ki. -TTEST = T.PRÓBA ## A Student-féle t-próbához tartozó valószínűséget számítja ki. -VAR = VAR ## Minta alapján becslést ad a varianciára. -VARA = VARA ## Minta alapján becslést ad a varianciára (beleértve számokat, szöveget és logikai értékeket). -VARP = VARP ## Egy statisztikai sokaság varianciáját számítja ki. -VARPA = VARPA ## Egy statisztikai sokaság varianciáját számítja ki (beleértve számokat, szöveget és logikai értékeket). -WEIBULL = WEIBULL ## A Weibull-féle eloszlás értékét számítja ki. -ZTEST = Z.PRÓBA ## Az egyszélű z-próbával kapott valószínűségértéket számítja ki. - - -## -## Text functions Szövegműveletekhez használható függvények -## -ASC = ASC ## Szöveg teljes szélességű (kétbájtos) latin és katakana karaktereit félszélességű (egybájtos) karakterekké alakítja. -BAHTTEXT = BAHTSZÖVEG ## Számot szöveggé alakít a ß (baht) pénznemformátum használatával. -CHAR = KARAKTER ## A kódszámmal meghatározott karaktert adja eredményül. -CLEAN = TISZTÃT ## A szövegbÅ‘l eltávolítja az összes nem nyomtatható karaktert. -CODE = KÓD ## Karaktersorozat elsÅ‘ karakterének numerikus kódját adja eredményül. -CONCATENATE = ÖSSZEFŰZ ## Több szövegelemet egyetlen szöveges elemmé fűz össze. -DOLLAR = FORINT ## Számot pénznem formátumú szöveggé alakít át. -EXACT = AZONOS ## Megvizsgálja, hogy két érték azonos-e. -FIND = SZÖVEG.TALÃL ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével). -FINDB = SZÖVEG.TALÃL2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével). -FIXED = FIX ## Számot szöveges formátumúra alakít adott számú tizedesjegyre kerekítve. -JIS = JIS ## A félszélességű (egybájtos) latin és a katakana karaktereket teljes szélességű (kétbájtos) karakterekké alakítja. -LEFT = BAL ## Szöveg bal szélsÅ‘ karaktereit adja eredményül. -LEFTB = BAL2 ## Szöveg bal szélsÅ‘ karaktereit adja eredményül. -LEN = HOSSZ ## Szöveg karakterekben mért hosszát adja eredményül. -LENB = HOSSZ2 ## Szöveg karakterekben mért hosszát adja eredményül. -LOWER = KISBETŰ ## Szöveget kisbetűssé alakít át. -MID = KÖZÉP ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként. -MIDB = KÖZÉP2 ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként. -PHONETIC = PHONETIC ## Szöveg furigana (fonetikus) karaktereit adja vissza. -PROPER = TNÉV ## Szöveg minden szavának kezdÅ‘betűjét nagybetűsre cseréli. -REPLACE = CSERE ## A szövegen belül karaktereket cserél. -REPLACEB = CSERE2 ## A szövegen belül karaktereket cserél. -REPT = SOKSZOR ## Megadott számú alkalommal megismétel egy szövegrészt. -RIGHT = JOBB ## Szövegrész jobb szélsÅ‘ karaktereit adja eredményül. -RIGHTB = JOBB2 ## Szövegrész jobb szélsÅ‘ karaktereit adja eredményül. -SEARCH = SZÖVEG.KERES ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget). -SEARCHB = SZÖVEG.KERES2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget). -SUBSTITUTE = HELYETTE ## Szövegben adott karaktereket másikra cserél. -T = T ## Argumentumát szöveggé alakítja át. -TEXT = SZÖVEG ## Számértéket alakít át adott számformátumú szöveggé. -TRIM = TRIM ## A szövegbÅ‘l eltávolítja a szóközöket. -UPPER = NAGYBETŰS ## Szöveget nagybetűssé alakít át. -VALUE = ÉRTÉK ## Szöveget számmá alakít át. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/config deleted file mode 100644 index d2d18f770d..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = € - - -## -## Excel Error Codes (For future use) -## -NULL = #NULLO! -DIV0 = #DIV/0! -VALUE = #VALORE! -REF = #RIF! -NAME = #NOME? -NUM = #NUM! -NA = #N/D diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/functions deleted file mode 100644 index 7ccc52c45b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/it/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Funzioni di automazione e dei componenti aggiuntivi -## -GETPIVOTDATA = INFO.DATI.TAB.PIVOT ## Restituisce i dati memorizzati in un rapporto di tabella pivot - - -## -## Cube functions Funzioni cubo -## -CUBEKPIMEMBER = MEMBRO.KPI.CUBO ## Restituisce il nome, la proprietà e la misura di un indicatore di prestazioni chiave (KPI) e visualizza il nome e la proprietà nella cella. Un KPI è una misura quantificabile, ad esempio l'utile lordo mensile o il fatturato trimestrale dei dipendenti, utilizzata per il monitoraggio delle prestazioni di un'organizzazione. -CUBEMEMBER = MEMBRO.CUBO ## Restituisce un membro o una tupla in una gerarchia di cubi. Consente di verificare l'esistenza del membro o della tupla nel cubo. -CUBEMEMBERPROPERTY = PROPRIETÀ.MEMBRO.CUBO ## Restituisce il valore di una proprietà di un membro del cubo. Consente di verificare l'esistenza di un nome di membro all'interno del cubo e di restituire la proprietà specificata per tale membro. -CUBERANKEDMEMBER = MEMBRO.CUBO.CON.RANGO ## Restituisce l'n-esimo membro o il membro ordinato di un insieme. Consente di restituire uno o più elementi in un insieme, ad esempio l'agente di vendita migliore o i primi 10 studenti. -CUBESET = SET.CUBO ## Definisce un insieme di tuple o membri calcolati mediante l'invio di un'espressione di insieme al cubo sul server. In questo modo l'insieme viene creato e restituito a Microsoft Office Excel. -CUBESETCOUNT = CONTA.SET.CUBO ## Restituisce il numero di elementi di un insieme. -CUBEVALUE = VALORE.CUBO ## Restituisce un valore aggregato da un cubo. - - -## -## Database functions Funzioni di database -## -DAVERAGE = DB.MEDIA ## Restituisce la media di voci del database selezionate -DCOUNT = DB.CONTA.NUMERI ## Conta le celle di un database contenenti numeri -DCOUNTA = DB.CONTA.VALORI ## Conta le celle non vuote in un database -DGET = DB.VALORI ## Estrae da un database un singolo record che soddisfa i criteri specificati -DMAX = DB.MAX ## Restituisce il valore massimo dalle voci selezionate in un database -DMIN = DB.MIN ## Restituisce il valore minimo dalle voci di un database selezionate -DPRODUCT = DB.PRODOTTO ## Moltiplica i valori in un determinato campo di record che soddisfano i criteri del database -DSTDEV = DB.DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione di voci di un database selezionate -DSTDEVP = DB.DEV.ST.POP ## Calcola la deviazione standard sulla base di tutte le voci di un database selezionate -DSUM = DB.SOMMA ## Aggiunge i numeri nel campo colonna di record del database che soddisfa determinati criteri -DVAR = DB.VAR ## Restituisce una stima della varianza sulla base di un campione da voci di un database selezionate -DVARP = DB.VAR.POP ## Calcola la varianza sulla base di tutte le voci di un database selezionate - - -## -## Date and time functions Funzioni data e ora -## -DATE = DATA ## Restituisce il numero seriale di una determinata data -DATEVALUE = DATA.VALORE ## Converte una data sotto forma di testo in un numero seriale -DAY = GIORNO ## Converte un numero seriale in un giorno del mese -DAYS360 = GIORNO360 ## Calcola il numero di giorni compreso tra due date basandosi su un anno di 360 giorni -EDATE = DATA.MESE ## Restituisce il numero seriale della data che rappresenta il numero di mesi prima o dopo la data di inizio -EOMONTH = FINE.MESE ## Restituisce il numero seriale dell'ultimo giorno del mese, prima o dopo un determinato numero di mesi -HOUR = ORA ## Converte un numero seriale in un'ora -MINUTE = MINUTO ## Converte un numero seriale in un minuto -MONTH = MESE ## Converte un numero seriale in un mese -NETWORKDAYS = GIORNI.LAVORATIVI.TOT ## Restituisce il numero di tutti i giorni lavorativi compresi fra due date -NOW = ADESSO ## Restituisce il numero seriale della data e dell'ora corrente -SECOND = SECONDO ## Converte un numero seriale in un secondo -TIME = ORARIO ## Restituisce il numero seriale di una determinata ora -TIMEVALUE = ORARIO.VALORE ## Converte un orario in forma di testo in un numero seriale -TODAY = OGGI ## Restituisce il numero seriale relativo alla data odierna -WEEKDAY = GIORNO.SETTIMANA ## Converte un numero seriale in un giorno della settimana -WEEKNUM = NUM.SETTIMANA ## Converte un numero seriale in un numero che rappresenta la posizione numerica di una settimana nell'anno -WORKDAY = GIORNO.LAVORATIVO ## Restituisce il numero della data prima o dopo un determinato numero di giorni lavorativi -YEAR = ANNO ## Converte un numero seriale in un anno -YEARFRAC = FRAZIONE.ANNO ## Restituisce la frazione dell'anno che rappresenta il numero dei giorni compresi tra una data_ iniziale e una data_finale - - -## -## Engineering functions Funzioni ingegneristiche -## -BESSELI = BESSEL.I ## Restituisce la funzione di Bessel modificata In(x) -BESSELJ = BESSEL.J ## Restituisce la funzione di Bessel Jn(x) -BESSELK = BESSEL.K ## Restituisce la funzione di Bessel modificata Kn(x) -BESSELY = BESSEL.Y ## Restituisce la funzione di Bessel Yn(x) -BIN2DEC = BINARIO.DECIMALE ## Converte un numero binario in decimale -BIN2HEX = BINARIO.HEX ## Converte un numero binario in esadecimale -BIN2OCT = BINARIO.OCT ## Converte un numero binario in ottale -COMPLEX = COMPLESSO ## Converte i coefficienti reali e immaginari in numeri complessi -CONVERT = CONVERTI ## Converte un numero da un sistema di misura in un altro -DEC2BIN = DECIMALE.BINARIO ## Converte un numero decimale in binario -DEC2HEX = DECIMALE.HEX ## Converte un numero decimale in esadecimale -DEC2OCT = DECIMALE.OCT ## Converte un numero decimale in ottale -DELTA = DELTA ## Verifica se due valori sono uguali -ERF = FUNZ.ERRORE ## Restituisce la funzione di errore -ERFC = FUNZ.ERRORE.COMP ## Restituisce la funzione di errore complementare -GESTEP = SOGLIA ## Verifica se un numero è maggiore del valore di soglia -HEX2BIN = HEX.BINARIO ## Converte un numero esadecimale in binario -HEX2DEC = HEX.DECIMALE ## Converte un numero esadecimale in decimale -HEX2OCT = HEX.OCT ## Converte un numero esadecimale in ottale -IMABS = COMP.MODULO ## Restituisce il valore assoluto (modulo) di un numero complesso -IMAGINARY = COMP.IMMAGINARIO ## Restituisce il coefficiente immaginario di un numero complesso -IMARGUMENT = COMP.ARGOMENTO ## Restituisce l'argomento theta, un angolo espresso in radianti -IMCONJUGATE = COMP.CONIUGATO ## Restituisce il complesso coniugato del numero complesso -IMCOS = COMP.COS ## Restituisce il coseno di un numero complesso -IMDIV = COMP.DIV ## Restituisce il quoziente di due numeri complessi -IMEXP = COMP.EXP ## Restituisce il valore esponenziale di un numero complesso -IMLN = COMP.LN ## Restituisce il logaritmo naturale di un numero complesso -IMLOG10 = COMP.LOG10 ## Restituisce il logaritmo in base 10 di un numero complesso -IMLOG2 = COMP.LOG2 ## Restituisce un logaritmo in base 2 di un numero complesso -IMPOWER = COMP.POTENZA ## Restituisce il numero complesso elevato a una potenza intera -IMPRODUCT = COMP.PRODOTTO ## Restituisce il prodotto di numeri complessi compresi tra 2 e 29 -IMREAL = COMP.PARTE.REALE ## Restituisce il coefficiente reale di un numero complesso -IMSIN = COMP.SEN ## Restituisce il seno di un numero complesso -IMSQRT = COMP.RADQ ## Restituisce la radice quadrata di un numero complesso -IMSUB = COMP.DIFF ## Restituisce la differenza fra due numeri complessi -IMSUM = COMP.SOMMA ## Restituisce la somma di numeri complessi -OCT2BIN = OCT.BINARIO ## Converte un numero ottale in binario -OCT2DEC = OCT.DECIMALE ## Converte un numero ottale in decimale -OCT2HEX = OCT.HEX ## Converte un numero ottale in esadecimale - - -## -## Financial functions Funzioni finanziarie -## -ACCRINT = INT.MATURATO.PER ## Restituisce l'interesse maturato di un titolo che paga interessi periodici -ACCRINTM = INT.MATURATO.SCAD ## Restituisce l'interesse maturato di un titolo che paga interessi alla scadenza -AMORDEGRC = AMMORT.DEGR ## Restituisce l'ammortamento per ogni periodo contabile utilizzando un coefficiente di ammortamento -AMORLINC = AMMORT.PER ## Restituisce l'ammortamento per ogni periodo contabile -COUPDAYBS = GIORNI.CED.INIZ.LIQ ## Restituisce il numero dei giorni che vanno dall'inizio del periodo di durata della cedola alla data di liquidazione -COUPDAYS = GIORNI.CED ## Restituisce il numero dei giorni relativi al periodo della cedola che contiene la data di liquidazione -COUPDAYSNC = GIORNI.CED.NUOVA ## Restituisce il numero di giorni che vanno dalla data di liquidazione alla data della cedola successiva -COUPNCD = DATA.CED.SUCC ## Restituisce un numero che rappresenta la data della cedola successiva alla data di liquidazione -COUPNUM = NUM.CED ## Restituisce il numero di cedole pagabili fra la data di liquidazione e la data di scadenza -COUPPCD = DATA.CED.PREC ## Restituisce un numero che rappresenta la data della cedola precedente alla data di liquidazione -CUMIPMT = INT.CUMUL ## Restituisce l'interesse cumulativo pagato fra due periodi -CUMPRINC = CAP.CUM ## Restituisce il capitale cumulativo pagato per estinguere un debito fra due periodi -DB = DB ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a quote fisse decrescenti -DDB = AMMORT ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a doppie quote decrescenti o altri metodi specificati -DISC = TASSO.SCONTO ## Restituisce il tasso di sconto per un titolo -DOLLARDE = VALUTA.DEC ## Converte un prezzo valuta, espresso come frazione, in prezzo valuta, espresso come numero decimale -DOLLARFR = VALUTA.FRAZ ## Converte un prezzo valuta, espresso come numero decimale, in prezzo valuta, espresso come frazione -DURATION = DURATA ## Restituisce la durata annuale di un titolo con i pagamenti di interesse periodico -EFFECT = EFFETTIVO ## Restituisce l'effettivo tasso di interesse annuo -FV = VAL.FUT ## Restituisce il valore futuro di un investimento -FVSCHEDULE = VAL.FUT.CAPITALE ## Restituisce il valore futuro di un capitale iniziale dopo aver applicato una serie di tassi di interesse composti -INTRATE = TASSO.INT ## Restituisce il tasso di interesse per un titolo interamente investito -IPMT = INTERESSI ## Restituisce il valore degli interessi per un investimento relativo a un periodo specifico -IRR = TIR.COST ## Restituisce il tasso di rendimento interno per una serie di flussi di cassa -ISPMT = INTERESSE.RATA ## Calcola l'interesse di un investimento pagato durante un periodo specifico -MDURATION = DURATA.M ## Restituisce la durata Macauley modificata per un titolo con un valore presunto di € 100 -MIRR = TIR.VAR ## Restituisce il tasso di rendimento interno in cui i flussi di cassa positivi e negativi sono finanziati a tassi differenti -NOMINAL = NOMINALE ## Restituisce il tasso di interesse nominale annuale -NPER = NUM.RATE ## Restituisce un numero di periodi relativi a un investimento -NPV = VAN ## Restituisce il valore attuale netto di un investimento basato su una serie di flussi di cassa periodici e sul tasso di sconto -ODDFPRICE = PREZZO.PRIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente il primo periodo di durata irregolare -ODDFYIELD = REND.PRIMO.IRR ## Restituisce il rendimento di un titolo avente il primo periodo di durata irregolare -ODDLPRICE = PREZZO.ULTIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente l'ultimo periodo di durata irregolare -ODDLYIELD = REND.ULTIMO.IRR ## Restituisce il rendimento di un titolo avente l'ultimo periodo di durata irregolare -PMT = RATA ## Restituisce il pagamento periodico di una rendita annua -PPMT = P.RATA ## Restituisce il pagamento sul capitale di un investimento per un dato periodo -PRICE = PREZZO ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga interessi periodici -PRICEDISC = PREZZO.SCONT ## Restituisce il prezzo di un titolo scontato dal valore nominale di € 100 -PRICEMAT = PREZZO.SCAD ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga gli interessi alla scadenza -PV = VA ## Restituisce il valore attuale di un investimento -RATE = TASSO ## Restituisce il tasso di interesse per un periodo di un'annualità -RECEIVED = RICEV.SCAD ## Restituisce l'ammontare ricevuto alla scadenza di un titolo interamente investito -SLN = AMMORT.COST ## Restituisce l'ammortamento a quote costanti di un bene per un singolo periodo -SYD = AMMORT.ANNUO ## Restituisce l'ammortamento a somma degli anni di un bene per un periodo specificato -TBILLEQ = BOT.EQUIV ## Restituisce il rendimento equivalente ad un'obbligazione per un Buono ordinario del Tesoro -TBILLPRICE = BOT.PREZZO ## Restituisce il prezzo di un Buono del Tesoro dal valore nominale di € 100 -TBILLYIELD = BOT.REND ## Restituisce il rendimento di un Buono del Tesoro -VDB = AMMORT.VAR ## Restituisce l'ammortamento di un bene per un periodo specificato o parziale utilizzando il metodo a doppie quote proporzionali ai valori residui -XIRR = TIR.X ## Restituisce il tasso di rendimento interno di un impiego di flussi di cassa -XNPV = VAN.X ## Restituisce il valore attuale netto di un impiego di flussi di cassa non necessariamente periodici -YIELD = REND ## Restituisce il rendimento di un titolo che frutta interessi periodici -YIELDDISC = REND.TITOLI.SCONT ## Restituisce il rendimento annuale di un titolo scontato, ad esempio un Buono del Tesoro -YIELDMAT = REND.SCAD ## Restituisce il rendimento annuo di un titolo che paga interessi alla scadenza - - -## -## Information functions Funzioni relative alle informazioni -## -CELL = CELLA ## Restituisce le informazioni sulla formattazione, la posizione o i contenuti di una cella -ERROR.TYPE = ERRORE.TIPO ## Restituisce un numero che corrisponde a un tipo di errore -INFO = INFO ## Restituisce le informazioni sull'ambiente operativo corrente -ISBLANK = VAL.VUOTO ## Restituisce VERO se il valore è vuoto -ISERR = VAL.ERR ## Restituisce VERO se il valore è un valore di errore qualsiasi tranne #N/D -ISERROR = VAL.ERRORE ## Restituisce VERO se il valore è un valore di errore qualsiasi -ISEVEN = VAL.PARI ## Restituisce VERO se il numero è pari -ISLOGICAL = VAL.LOGICO ## Restituisce VERO se il valore è un valore logico -ISNA = VAL.NON.DISP ## Restituisce VERO se il valore è un valore di errore #N/D -ISNONTEXT = VAL.NON.TESTO ## Restituisce VERO se il valore non è in formato testo -ISNUMBER = VAL.NUMERO ## Restituisce VERO se il valore è un numero -ISODD = VAL.DISPARI ## Restituisce VERO se il numero è dispari -ISREF = VAL.RIF ## Restituisce VERO se il valore è un riferimento -ISTEXT = VAL.TESTO ## Restituisce VERO se il valore è in formato testo -N = NUM ## Restituisce un valore convertito in numero -NA = NON.DISP ## Restituisce il valore di errore #N/D -TYPE = TIPO ## Restituisce un numero che indica il tipo di dati relativi a un valore - - -## -## Logical functions Funzioni logiche -## -AND = E ## Restituisce VERO se tutti gli argomenti sono VERO -FALSE = FALSO ## Restituisce il valore logico FALSO -IF = SE ## Specifica un test logico da eseguire -IFERROR = SE.ERRORE ## Restituisce un valore specificato se una formula fornisce un errore come risultato; in caso contrario, restituisce il risultato della formula -NOT = NON ## Inverte la logica degli argomenti -OR = O ## Restituisce VERO se un argomento qualsiasi è VERO -TRUE = VERO ## Restituisce il valore logico VERO - - -## -## Lookup and reference functions Funzioni di ricerca e di riferimento -## -ADDRESS = INDIRIZZO ## Restituisce un riferimento come testo in una singola cella di un foglio di lavoro -AREAS = AREE ## Restituisce il numero di aree in un riferimento -CHOOSE = SCEGLI ## Sceglie un valore da un elenco di valori -COLUMN = RIF.COLONNA ## Restituisce il numero di colonna di un riferimento -COLUMNS = COLONNE ## Restituisce il numero di colonne in un riferimento -HLOOKUP = CERCA.ORIZZ ## Effettua una ricerca nella riga superiore di una matrice e restituisce il valore della cella specificata -HYPERLINK = COLLEG.IPERTESTUALE ## Crea un collegamento che apre un documento memorizzato in un server di rete, una rete Intranet o Internet -INDEX = INDICE ## Utilizza un indice per scegliere un valore da un riferimento o da una matrice -INDIRECT = INDIRETTO ## Restituisce un riferimento specificato da un valore testo -LOOKUP = CERCA ## Ricerca i valori in un vettore o in una matrice -MATCH = CONFRONTA ## Ricerca i valori in un riferimento o in una matrice -OFFSET = SCARTO ## Restituisce uno scarto di riferimento da un riferimento dato -ROW = RIF.RIGA ## Restituisce il numero di riga di un riferimento -ROWS = RIGHE ## Restituisce il numero delle righe in un riferimento -RTD = DATITEMPOREALE ## Recupera dati in tempo reale da un programma che supporta l'automazione COM (automazione: Metodo per utilizzare gli oggetti di un'applicazione da un'altra applicazione o da un altro strumento di sviluppo. Precedentemente nota come automazione OLE, l'automazione è uno standard del settore e una caratteristica del modello COM (Component Object Model).) -TRANSPOSE = MATR.TRASPOSTA ## Restituisce la trasposizione di una matrice -VLOOKUP = CERCA.VERT ## Effettua una ricerca nella prima colonna di una matrice e si sposta attraverso la riga per restituire il valore di una cella - - -## -## Math and trigonometry functions Funzioni matematiche e trigonometriche -## -ABS = ASS ## Restituisce il valore assoluto di un numero. -ACOS = ARCCOS ## Restituisce l'arcocoseno di un numero -ACOSH = ARCCOSH ## Restituisce l'inverso del coseno iperbolico di un numero -ASIN = ARCSEN ## Restituisce l'arcoseno di un numero -ASINH = ARCSENH ## Restituisce l'inverso del seno iperbolico di un numero -ATAN = ARCTAN ## Restituisce l'arcotangente di un numero -ATAN2 = ARCTAN.2 ## Restituisce l'arcotangente delle coordinate x e y specificate -ATANH = ARCTANH ## Restituisce l'inverso della tangente iperbolica di un numero -CEILING = ARROTONDA.ECCESSO ## Arrotonda un numero per eccesso all'intero più vicino o al multiplo più vicino a peso -COMBIN = COMBINAZIONE ## Restituisce il numero di combinazioni possibili per un numero assegnato di elementi -COS = COS ## Restituisce il coseno dell'angolo specificato -COSH = COSH ## Restituisce il coseno iperbolico di un numero -DEGREES = GRADI ## Converte i radianti in gradi -EVEN = PARI ## Arrotonda il valore assoluto di un numero per eccesso al più vicino intero pari -EXP = ESP ## Restituisce il numero e elevato alla potenza di num -FACT = FATTORIALE ## Restituisce il fattoriale di un numero -FACTDOUBLE = FATT.DOPPIO ## Restituisce il fattoriale doppio di un numero -FLOOR = ARROTONDA.DIFETTO ## Arrotonda un numero per difetto al multiplo più vicino a zero -GCD = MCD ## Restituisce il massimo comune divisore -INT = INT ## Arrotonda un numero per difetto al numero intero più vicino -LCM = MCM ## Restituisce il minimo comune multiplo -LN = LN ## Restituisce il logaritmo naturale di un numero -LOG = LOG ## Restituisce il logaritmo di un numero in una specificata base -LOG10 = LOG10 ## Restituisce il logaritmo in base 10 di un numero -MDETERM = MATR.DETERM ## Restituisce il determinante di una matrice -MINVERSE = MATR.INVERSA ## Restituisce l'inverso di una matrice -MMULT = MATR.PRODOTTO ## Restituisce il prodotto di due matrici -MOD = RESTO ## Restituisce il resto della divisione -MROUND = ARROTONDA.MULTIPLO ## Restituisce un numero arrotondato al multiplo desiderato -MULTINOMIAL = MULTINOMIALE ## Restituisce il multinomiale di un insieme di numeri -ODD = DISPARI ## Arrotonda un numero per eccesso al più vicino intero dispari -PI = PI.GRECO ## Restituisce il valore di pi greco -POWER = POTENZA ## Restituisce il risultato di un numero elevato a potenza -PRODUCT = PRODOTTO ## Moltiplica i suoi argomenti -QUOTIENT = QUOZIENTE ## Restituisce la parte intera di una divisione -RADIANS = RADIANTI ## Converte i gradi in radianti -RAND = CASUALE ## Restituisce un numero casuale compreso tra 0 e 1 -RANDBETWEEN = CASUALE.TRA ## Restituisce un numero casuale compreso tra i numeri specificati -ROMAN = ROMANO ## Restituisce il numero come numero romano sotto forma di testo -ROUND = ARROTONDA ## Arrotonda il numero al numero di cifre specificato -ROUNDDOWN = ARROTONDA.PER.DIF ## Arrotonda il valore assoluto di un numero per difetto -ROUNDUP = ARROTONDA.PER.ECC ## Arrotonda il valore assoluto di un numero per eccesso -SERIESSUM = SOMMA.SERIE ## Restituisce la somma di una serie di potenze in base alla formula -SIGN = SEGNO ## Restituisce il segno di un numero -SIN = SEN ## Restituisce il seno di un dato angolo -SINH = SENH ## Restituisce il seno iperbolico di un numero -SQRT = RADQ ## Restituisce una radice quadrata -SQRTPI = RADQ.PI.GRECO ## Restituisce la radice quadrata di un numero (numero * pi greco) -SUBTOTAL = SUBTOTALE ## Restituisce un subtotale in un elenco o in un database -SUM = SOMMA ## Somma i suoi argomenti -SUMIF = SOMMA.SE ## Somma le celle specificate da un dato criterio -SUMIFS = SOMMA.PIÙ.SE ## Somma le celle in un intervallo che soddisfano più criteri -SUMPRODUCT = MATR.SOMMA.PRODOTTO ## Restituisce la somma dei prodotti dei componenti corrispondenti della matrice -SUMSQ = SOMMA.Q ## Restituisce la somma dei quadrati degli argomenti -SUMX2MY2 = SOMMA.DIFF.Q ## Restituisce la somma della differenza dei quadrati dei corrispondenti elementi in due matrici -SUMX2PY2 = SOMMA.SOMMA.Q ## Restituisce la somma della somma dei quadrati dei corrispondenti elementi in due matrici -SUMXMY2 = SOMMA.Q.DIFF ## Restituisce la somma dei quadrati delle differenze dei corrispondenti elementi in due matrici -TAN = TAN ## Restituisce la tangente di un numero -TANH = TANH ## Restituisce la tangente iperbolica di un numero -TRUNC = TRONCA ## Tronca la parte decimale di un numero - - -## -## Statistical functions Funzioni statistiche -## -AVEDEV = MEDIA.DEV ## Restituisce la media delle deviazioni assolute delle coordinate rispetto alla loro media -AVERAGE = MEDIA ## Restituisce la media degli argomenti -AVERAGEA = MEDIA.VALORI ## Restituisce la media degli argomenti, inclusi i numeri, il testo e i valori logici -AVERAGEIF = MEDIA.SE ## Restituisce la media aritmetica di tutte le celle in un intervallo che soddisfano un determinato criterio -AVERAGEIFS = MEDIA.PIÙ.SE ## Restituisce la media aritmetica di tutte le celle che soddisfano più criteri -BETADIST = DISTRIB.BETA ## Restituisce la funzione di distribuzione cumulativa beta -BETAINV = INV.BETA ## Restituisce l'inverso della funzione di distribuzione cumulativa per una distribuzione beta specificata -BINOMDIST = DISTRIB.BINOM ## Restituisce la distribuzione binomiale per il termine individuale -CHIDIST = DISTRIB.CHI ## Restituisce la probabilità a una coda per la distribuzione del chi quadrato -CHIINV = INV.CHI ## Restituisce l'inverso della probabilità ad una coda per la distribuzione del chi quadrato -CHITEST = TEST.CHI ## Restituisce il test per l'indipendenza -CONFIDENCE = CONFIDENZA ## Restituisce l'intervallo di confidenza per una popolazione -CORREL = CORRELAZIONE ## Restituisce il coefficiente di correlazione tra due insiemi di dati -COUNT = CONTA.NUMERI ## Conta la quantità di numeri nell'elenco di argomenti -COUNTA = CONTA.VALORI ## Conta il numero di valori nell'elenco di argomenti -COUNTBLANK = CONTA.VUOTE ## Conta il numero di celle vuote all'interno di un intervallo -COUNTIF = CONTA.SE ## Conta il numero di celle all'interno di un intervallo che soddisfa i criteri specificati -COUNTIFS = CONTA.PIÙ.SE ## Conta il numero di celle in un intervallo che soddisfano più criteri. -COVAR = COVARIANZA ## Calcola la covarianza, la media dei prodotti delle deviazioni accoppiate -CRITBINOM = CRIT.BINOM ## Restituisce il più piccolo valore per il quale la distribuzione cumulativa binomiale risulta maggiore o uguale ad un valore di criterio -DEVSQ = DEV.Q ## Restituisce la somma dei quadrati delle deviazioni -EXPONDIST = DISTRIB.EXP ## Restituisce la distribuzione esponenziale -FDIST = DISTRIB.F ## Restituisce la distribuzione di probabilità F -FINV = INV.F ## Restituisce l'inverso della distribuzione della probabilità F -FISHER = FISHER ## Restituisce la trasformazione di Fisher -FISHERINV = INV.FISHER ## Restituisce l'inverso della trasformazione di Fisher -FORECAST = PREVISIONE ## Restituisce i valori lungo una tendenza lineare -FREQUENCY = FREQUENZA ## Restituisce la distribuzione di frequenza come matrice verticale -FTEST = TEST.F ## Restituisce il risultato di un test F -GAMMADIST = DISTRIB.GAMMA ## Restituisce la distribuzione gamma -GAMMAINV = INV.GAMMA ## Restituisce l'inverso della distribuzione cumulativa gamma -GAMMALN = LN.GAMMA ## Restituisce il logaritmo naturale della funzione gamma, G(x) -GEOMEAN = MEDIA.GEOMETRICA ## Restituisce la media geometrica -GROWTH = CRESCITA ## Restituisce i valori lungo una linea di tendenza esponenziale -HARMEAN = MEDIA.ARMONICA ## Restituisce la media armonica -HYPGEOMDIST = DISTRIB.IPERGEOM ## Restituisce la distribuzione ipergeometrica -INTERCEPT = INTERCETTA ## Restituisce l'intercetta della retta di regressione lineare -KURT = CURTOSI ## Restituisce la curtosi di un insieme di dati -LARGE = GRANDE ## Restituisce il k-esimo valore più grande in un insieme di dati -LINEST = REGR.LIN ## Restituisce i parametri di una tendenza lineare -LOGEST = REGR.LOG ## Restituisce i parametri di una linea di tendenza esponenziale -LOGINV = INV.LOGNORM ## Restituisce l'inverso di una distribuzione lognormale -LOGNORMDIST = DISTRIB.LOGNORM ## Restituisce la distribuzione lognormale cumulativa -MAX = MAX ## Restituisce il valore massimo in un elenco di argomenti -MAXA = MAX.VALORI ## Restituisce il valore massimo in un elenco di argomenti, inclusi i numeri, il testo e i valori logici -MEDIAN = MEDIANA ## Restituisce la mediana dei numeri specificati -MIN = MIN ## Restituisce il valore minimo in un elenco di argomenti -MINA = MIN.VALORI ## Restituisce il più piccolo valore in un elenco di argomenti, inclusi i numeri, il testo e i valori logici -MODE = MODA ## Restituisce il valore più comune in un insieme di dati -NEGBINOMDIST = DISTRIB.BINOM.NEG ## Restituisce la distribuzione binomiale negativa -NORMDIST = DISTRIB.NORM ## Restituisce la distribuzione cumulativa normale -NORMINV = INV.NORM ## Restituisce l'inverso della distribuzione cumulativa normale standard -NORMSDIST = DISTRIB.NORM.ST ## Restituisce la distribuzione cumulativa normale standard -NORMSINV = INV.NORM.ST ## Restituisce l'inverso della distribuzione cumulativa normale -PEARSON = PEARSON ## Restituisce il coefficiente del momento di correlazione di Pearson -PERCENTILE = PERCENTILE ## Restituisce il k-esimo dato percentile di valori in un intervallo -PERCENTRANK = PERCENT.RANGO ## Restituisce il rango di un valore in un insieme di dati come percentuale -PERMUT = PERMUTAZIONE ## Restituisce il numero delle permutazioni per un determinato numero di oggetti -POISSON = POISSON ## Restituisce la distribuzione di Poisson -PROB = PROBABILITÀ ## Calcola la probabilità che dei valori in un intervallo siano compresi tra due limiti -QUARTILE = QUARTILE ## Restituisce il quartile di un insieme di dati -RANK = RANGO ## Restituisce il rango di un numero in un elenco di numeri -RSQ = RQ ## Restituisce la radice quadrata del coefficiente di momento di correlazione di Pearson -SKEW = ASIMMETRIA ## Restituisce il grado di asimmetria di una distribuzione -SLOPE = PENDENZA ## Restituisce la pendenza di una retta di regressione lineare -SMALL = PICCOLO ## Restituisce il k-esimo valore più piccolo in un insieme di dati -STANDARDIZE = NORMALIZZA ## Restituisce un valore normalizzato -STDEV = DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione -STDEVA = DEV.ST.VALORI ## Restituisce una stima della deviazione standard sulla base di un campione, inclusi i numeri, il testo e i valori logici -STDEVP = DEV.ST.POP ## Calcola la deviazione standard sulla base di un'intera popolazione -STDEVPA = DEV.ST.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici -STEYX = ERR.STD.YX ## Restituisce l'errore standard del valore previsto per y per ogni valore x nella regressione -TDIST = DISTRIB.T ## Restituisce la distribuzione t di Student -TINV = INV.T ## Restituisce l'inversa della distribuzione t di Student -TREND = TENDENZA ## Restituisce i valori lungo una linea di tendenza lineare -TRIMMEAN = MEDIA.TRONCATA ## Restituisce la media della parte interna di un insieme di dati -TTEST = TEST.T ## Restituisce la probabilità associata ad un test t di Student -VAR = VAR ## Stima la varianza sulla base di un campione -VARA = VAR.VALORI ## Stima la varianza sulla base di un campione, inclusi i numeri, il testo e i valori logici -VARP = VAR.POP ## Calcola la varianza sulla base dell'intera popolazione -VARPA = VAR.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici -WEIBULL = WEIBULL ## Restituisce la distribuzione di Weibull -ZTEST = TEST.Z ## Restituisce il valore di probabilità a una coda per un test z - - -## -## Text functions Funzioni di testo -## -ASC = ASC ## Modifica le lettere inglesi o il katakana a doppio byte all'interno di una stringa di caratteri in caratteri a singolo byte -BAHTTEXT = BAHTTESTO ## Converte un numero in testo, utilizzando il formato valuta ß (baht) -CHAR = CODICE.CARATT ## Restituisce il carattere specificato dal numero di codice -CLEAN = LIBERA ## Elimina dal testo tutti i caratteri che non è possibile stampare -CODE = CODICE ## Restituisce il codice numerico del primo carattere di una stringa di testo -CONCATENATE = CONCATENA ## Unisce diversi elementi di testo in un unico elemento di testo -DOLLAR = VALUTA ## Converte un numero in testo, utilizzando il formato valuta € (euro) -EXACT = IDENTICO ## Verifica se due valori di testo sono uguali -FIND = TROVA ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole) -FINDB = TROVA.B ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole) -FIXED = FISSO ## Formatta un numero come testo con un numero fisso di decimali -JIS = ORDINAMENTO.JIS ## Modifica le lettere inglesi o i caratteri katakana a byte singolo all'interno di una stringa di caratteri in caratteri a byte doppio. -LEFT = SINISTRA ## Restituisce il carattere più a sinistra di un valore di testo -LEFTB = SINISTRA.B ## Restituisce il carattere più a sinistra di un valore di testo -LEN = LUNGHEZZA ## Restituisce il numero di caratteri di una stringa di testo -LENB = LUNB ## Restituisce il numero di caratteri di una stringa di testo -LOWER = MINUSC ## Converte il testo in lettere minuscole -MID = MEDIA ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata -MIDB = MEDIA.B ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata -PHONETIC = FURIGANA ## Estrae i caratteri fonetici (furigana) da una stringa di testo. -PROPER = MAIUSC.INIZ ## Converte in maiuscolo la prima lettera di ogni parola di un valore di testo -REPLACE = RIMPIAZZA ## Sostituisce i caratteri all'interno di un testo -REPLACEB = SOSTITUISCI.B ## Sostituisce i caratteri all'interno di un testo -REPT = RIPETI ## Ripete un testo per un dato numero di volte -RIGHT = DESTRA ## Restituisce il carattere più a destra di un valore di testo -RIGHTB = DESTRA.B ## Restituisce il carattere più a destra di un valore di testo -SEARCH = RICERCA ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole) -SEARCHB = CERCA.B ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole) -SUBSTITUTE = SOSTITUISCI ## Sostituisce il nuovo testo al testo contenuto in una stringa -T = T ## Converte gli argomenti in testo -TEXT = TESTO ## Formatta un numero e lo converte in testo -TRIM = ANNULLA.SPAZI ## Elimina gli spazi dal testo -UPPER = MAIUSC ## Converte il testo in lettere maiuscole -VALUE = VALORE ## Converte un argomento di testo in numero diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/config deleted file mode 100644 index 818a98ca8e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = € - - -## -## Excel Error Codes (For future use) -## -NULL = #LEEG! -DIV0 = #DEEL/0! -VALUE = #WAARDE! -REF = #VERW! -NAME = #NAAM? -NUM = #GETAL! -NA = #N/B diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/functions deleted file mode 100644 index ea6d463f54..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/nl/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Automatiseringsfuncties en functies in invoegtoepassingen -## -GETPIVOTDATA = DRAAITABEL.OPHALEN ## Geeft gegevens uit een draaitabelrapport als resultaat - - -## -## Cube functions Kubusfuncties -## -CUBEKPIMEMBER = KUBUSKPILID ## Retourneert de naam, eigenschap en waarde van een KPI (prestatie-indicator) en geeft de naam en de eigenschap in de cel weer. Een KPI is een meetbare waarde, zoals de maandelijkse brutowinst of de omzet per kwartaal per werknemer, die wordt gebruikt om de prestaties van een organisatie te bewaken -CUBEMEMBER = KUBUSLID ## Retourneert een lid of tupel in een kubushiërarchie. Wordt gebruikt om te controleren of het lid of de tupel in de kubus aanwezig is -CUBEMEMBERPROPERTY = KUBUSLIDEIGENSCHAP ## Retourneert de waarde van een lideigenschap in de kubus. Wordt gebruikt om te controleren of de lidnaam in de kubus bestaat en retourneert de opgegeven eigenschap voor dit lid -CUBERANKEDMEMBER = KUBUSGERANGCHIKTLID ## Retourneert het zoveelste, gerangschikte lid in een set. Wordt gebruikt om een of meer elementen in een set te retourneren, zoals de tien beste verkopers of de tien beste studenten -CUBESET = KUBUSSET ## Definieert een berekende set leden of tupels door een ingestelde expressie naar de kubus op de server te sturen, alwaar de set wordt gemaakt en vervolgens wordt geretourneerd naar Microsoft Office Excel -CUBESETCOUNT = KUBUSSETAANTAL ## Retourneert het aantal onderdelen in een set -CUBEVALUE = KUBUSWAARDE ## Retourneert een samengestelde waarde van een kubus - - -## -## Database functions Databasefuncties -## -DAVERAGE = DBGEMIDDELDE ## Berekent de gemiddelde waarde in geselecteerde databasegegevens -DCOUNT = DBAANTAL ## Telt de cellen met getallen in een database -DCOUNTA = DBAANTALC ## Telt de niet-lege cellen in een database -DGET = DBLEZEN ## Retourneert één record dat voldoet aan de opgegeven criteria uit een database -DMAX = DBMAX ## Retourneert de maximumwaarde in de geselecteerde databasegegevens -DMIN = DBMIN ## Retourneert de minimumwaarde in de geselecteerde databasegegevens -DPRODUCT = DBPRODUCT ## Vermenigvuldigt de waarden in een bepaald veld van de records die voldoen aan de criteria in een database -DSTDEV = DBSTDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef uit geselecteerde databasegegevens -DSTDEVP = DBSTDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie van geselecteerde databasegegevens -DSUM = DBSOM ## Telt de getallen uit een kolom records in de database op die voldoen aan de criteria -DVAR = DBVAR ## Maakt een schatting van de variantie op basis van een steekproef uit geselecteerde databasegegevens -DVARP = DBVARP ## Berekent de variantie op basis van de volledige populatie van geselecteerde databasegegevens - - -## -## Date and time functions Datum- en tijdfuncties -## -DATE = DATUM ## Geeft als resultaat het seriële getal van een opgegeven datum -DATEVALUE = DATUMWAARDE ## Converteert een datum in de vorm van tekst naar een serieel getal -DAY = DAG ## Converteert een serieel getal naar een dag van de maand -DAYS360 = DAGEN360 ## Berekent het aantal dagen tussen twee datums op basis van een jaar met 360 dagen -EDATE = ZELFDE.DAG ## Geeft als resultaat het seriële getal van een datum die het opgegeven aantal maanden voor of na de begindatum ligt -EOMONTH = LAATSTE.DAG ## Geeft als resultaat het seriële getal van de laatste dag van de maand voor of na het opgegeven aantal maanden -HOUR = UUR ## Converteert een serieel getal naar uren -MINUTE = MINUUT ## Converteert een serieel naar getal minuten -MONTH = MAAND ## Converteert een serieel getal naar een maand -NETWORKDAYS = NETTO.WERKDAGEN ## Geeft als resultaat het aantal hele werkdagen tussen twee datums -NOW = NU ## Geeft als resultaat het seriële getal van de huidige datum en tijd -SECOND = SECONDE ## Converteert een serieel getal naar seconden -TIME = TIJD ## Geeft als resultaat het seriële getal van een bepaald tijdstip -TIMEVALUE = TIJDWAARDE ## Converteert de tijd in de vorm van tekst naar een serieel getal -TODAY = VANDAAG ## Geeft als resultaat het seriële getal van de huidige datum -WEEKDAY = WEEKDAG ## Converteert een serieel getal naar een weekdag -WEEKNUM = WEEKNUMMER ## Converteert een serieel getal naar een weeknummer -WORKDAY = WERKDAG ## Geeft als resultaat het seriële getal van de datum voor of na een bepaald aantal werkdagen -YEAR = JAAR ## Converteert een serieel getal naar een jaar -YEARFRAC = JAAR.DEEL ## Geeft als resultaat het gedeelte van het jaar, uitgedrukt in het aantal hele dagen tussen begindatum en einddatum - - -## -## Engineering functions Technische functies -## -BESSELI = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie In(x) -BESSELJ = BESSEL.J ## Geeft als resultaat de Bessel-functie Jn(x) -BESSELK = BESSEL.K ## Geeft als resultaat de gewijzigde Bessel-functie Kn(x) -BESSELY = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie Yn(x) -BIN2DEC = BIN.N.DEC ## Converteert een binair getal naar een decimaal getal -BIN2HEX = BIN.N.HEX ## Converteert een binair getal naar een hexadecimaal getal -BIN2OCT = BIN.N.OCT ## Converteert een binair getal naar een octaal getal -COMPLEX = COMPLEX ## Converteert reële en imaginaire coëfficiënten naar een complex getal -CONVERT = CONVERTEREN ## Converteert een getal in de ene maateenheid naar een getal in een andere maateenheid -DEC2BIN = DEC.N.BIN ## Converteert een decimaal getal naar een binair getal -DEC2HEX = DEC.N.HEX ## Converteert een decimaal getal naar een hexadecimaal getal -DEC2OCT = DEC.N.OCT ## Converteert een decimaal getal naar een octaal getal -DELTA = DELTA ## Test of twee waarden gelijk zijn -ERF = FOUTFUNCTIE ## Geeft als resultaat de foutfunctie -ERFC = FOUT.COMPLEMENT ## Geeft als resultaat de complementaire foutfunctie -GESTEP = GROTER.DAN ## Test of een getal groter is dan de drempelwaarde -HEX2BIN = HEX.N.BIN ## Converteert een hexadecimaal getal naar een binair getal -HEX2DEC = HEX.N.DEC ## Converteert een hexadecimaal getal naar een decimaal getal -HEX2OCT = HEX.N.OCT ## Converteert een hexadecimaal getal naar een octaal getal -IMABS = C.ABS ## Geeft als resultaat de absolute waarde (modulus) van een complex getal -IMAGINARY = C.IM.DEEL ## Geeft als resultaat de imaginaire coëfficiënt van een complex getal -IMARGUMENT = C.ARGUMENT ## Geeft als resultaat het argument thèta, een hoek uitgedrukt in radialen -IMCONJUGATE = C.TOEGEVOEGD ## Geeft als resultaat het complexe toegevoegde getal van een complex getal -IMCOS = C.COS ## Geeft als resultaat de cosinus van een complex getal -IMDIV = C.QUOTIENT ## Geeft als resultaat het quotiënt van twee complexe getallen -IMEXP = C.EXP ## Geeft als resultaat de exponent van een complex getal -IMLN = C.LN ## Geeft als resultaat de natuurlijke logaritme van een complex getal -IMLOG10 = C.LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een complex getal -IMLOG2 = C.LOG2 ## Geeft als resultaat de logaritme met grondtal 2 van een complex getal -IMPOWER = C.MACHT ## Geeft als resultaat een complex getal dat is verheven tot de macht van een geheel getal -IMPRODUCT = C.PRODUCT ## Geeft als resultaat het product van complexe getallen -IMREAL = C.REEEL.DEEL ## Geeft als resultaat de reële coëfficiënt van een complex getal -IMSIN = C.SIN ## Geeft als resultaat de sinus van een complex getal -IMSQRT = C.WORTEL ## Geeft als resultaat de vierkantswortel van een complex getal -IMSUB = C.VERSCHIL ## Geeft als resultaat het verschil tussen twee complexe getallen -IMSUM = C.SOM ## Geeft als resultaat de som van complexe getallen -OCT2BIN = OCT.N.BIN ## Converteert een octaal getal naar een binair getal -OCT2DEC = OCT.N.DEC ## Converteert een octaal getal naar een decimaal getal -OCT2HEX = OCT.N.HEX ## Converteert een octaal getal naar een hexadecimaal getal - - -## -## Financial functions Financiële functies -## -ACCRINT = SAMENG.RENTE ## Berekent de opgelopen rente voor een waardepapier waarvan de rente periodiek wordt uitgekeerd -ACCRINTM = SAMENG.RENTE.V ## Berekent de opgelopen rente voor een waardepapier waarvan de rente op de vervaldatum wordt uitgekeerd -AMORDEGRC = AMORDEGRC ## Geeft als resultaat de afschrijving voor elke boekingsperiode door een afschrijvingscoëfficiënt toe te passen -AMORLINC = AMORLINC ## Berekent de afschrijving voor elke boekingsperiode -COUPDAYBS = COUP.DAGEN.BB ## Berekent het aantal dagen vanaf het begin van de coupontermijn tot de stortingsdatum -COUPDAYS = COUP.DAGEN ## Geeft als resultaat het aantal dagen in de coupontermijn waarin de stortingsdatum valt -COUPDAYSNC = COUP.DAGEN.VV ## Geeft als resultaat het aantal dagen vanaf de stortingsdatum tot de volgende couponvervaldatum -COUPNCD = COUP.DATUM.NB ## Geeft als resultaat de volgende coupondatum na de stortingsdatum -COUPNUM = COUP.AANTAL ## Geeft als resultaat het aantal coupons dat nog moet worden uitbetaald tussen de stortingsdatum en de vervaldatum -COUPPCD = COUP.DATUM.VB ## Geeft als resultaat de vorige couponvervaldatum vóór de stortingsdatum -CUMIPMT = CUM.RENTE ## Geeft als resultaat de cumulatieve rente die tussen twee termijnen is uitgekeerd -CUMPRINC = CUM.HOOFDSOM ## Geeft als resultaat de cumulatieve hoofdsom van een lening die tussen twee termijnen is terugbetaald -DB = DB ## Geeft als resultaat de afschrijving van activa voor een bepaalde periode met behulp van de 'fixed declining balance'-methode -DDB = DDB ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'double declining balance'-methode of een andere methode die u opgeeft -DISC = DISCONTO ## Geeft als resultaat het discontopercentage voor een waardepapier -DOLLARDE = EURO.DE ## Converteert een prijs in euro's, uitgedrukt in een breuk, naar een prijs in euro's, uitgedrukt in een decimaal getal -DOLLARFR = EURO.BR ## Converteert een prijs in euro's, uitgedrukt in een decimaal getal, naar een prijs in euro's, uitgedrukt in een breuk -DURATION = DUUR ## Geeft als resultaat de gewogen gemiddelde looptijd voor een waardepapier met periodieke rentebetalingen -EFFECT = EFFECT.RENTE ## Geeft als resultaat het effectieve jaarlijkse rentepercentage -FV = TW ## Geeft als resultaat de toekomstige waarde van een investering -FVSCHEDULE = TOEK.WAARDE2 ## Geeft als resultaat de toekomstige waarde van een bepaalde hoofdsom na het toepassen van een reeks samengestelde rentepercentages -INTRATE = RENTEPERCENTAGE ## Geeft als resultaat het rentepercentage voor een volgestort waardepapier -IPMT = IBET ## Geeft als resultaat de te betalen rente voor een investering over een bepaalde termijn -IRR = IR ## Geeft als resultaat de interne rentabiliteit voor een reeks cashflows -ISPMT = ISBET ## Geeft als resultaat de rente die is betaald tijdens een bepaalde termijn van een investering -MDURATION = AANG.DUUR ## Geeft als resultaat de aangepaste Macauley-looptijd voor een waardepapier, aangenomen dat de nominale waarde € 100 bedraagt -MIRR = GIR ## Geeft als resultaat de interne rentabiliteit voor een serie cashflows, waarbij voor betalingen een ander rentepercentage geldt dan voor inkomsten -NOMINAL = NOMINALE.RENTE ## Geeft als resultaat het nominale jaarlijkse rentepercentage -NPER = NPER ## Geeft als resultaat het aantal termijnen van een investering -NPV = NHW ## Geeft als resultaat de netto huidige waarde van een investering op basis van een reeks periodieke cashflows en een discontopercentage -ODDFPRICE = AFW.ET.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende eerste termijn -ODDFYIELD = AFW.ET.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende eerste termijn -ODDLPRICE = AFW.LT.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende laatste termijn -ODDLYIELD = AFW.LT.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende laatste termijn -PMT = BET ## Geeft als resultaat de periodieke betaling voor een annuïteit -PPMT = PBET ## Geeft als resultaat de afbetaling op de hoofdsom voor een bepaalde termijn -PRICE = PRIJS.NOM ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente periodiek wordt uitgekeerd -PRICEDISC = PRIJS.DISCONTO ## Geeft als resultaat de prijs per € 100 nominale waarde voor een verdisconteerd waardepapier -PRICEMAT = PRIJS.VERVALDAG ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum -PV = HW ## Geeft als resultaat de huidige waarde van een investering -RATE = RENTE ## Geeft als resultaat het periodieke rentepercentage voor een annuïteit -RECEIVED = OPBRENGST ## Geeft als resultaat het bedrag dat op de vervaldatum wordt uitgekeerd voor een volgestort waardepapier -SLN = LIN.AFSCHR ## Geeft als resultaat de lineaire afschrijving van activa over één termijn -SYD = SYD ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'Sum-Of-Years-Digits'-methode -TBILLEQ = SCHATK.OBL ## Geeft als resultaat het rendement op schatkistpapier, dat op dezelfde manier wordt berekend als het rendement op obligaties -TBILLPRICE = SCHATK.PRIJS ## Bepaalt de prijs per € 100 nominale waarde voor schatkistpapier -TBILLYIELD = SCHATK.REND ## Berekent het rendement voor schatkistpapier -VDB = VDB ## Geeft als resultaat de afschrijving van activa over een gehele of gedeeltelijke termijn met behulp van de 'declining balance'-methode -XIRR = IR.SCHEMA ## Berekent de interne rentabiliteit voor een betalingsschema van cashflows -XNPV = NHW2 ## Berekent de huidige nettowaarde voor een betalingsschema van cashflows -YIELD = RENDEMENT ## Geeft als resultaat het rendement voor een waardepapier waarvan de rente periodiek wordt uitgekeerd -YIELDDISC = REND.DISCONTO ## Geeft als resultaat het jaarlijkse rendement voor een verdisconteerd waardepapier, bijvoorbeeld schatkistpapier -YIELDMAT = REND.VERVAL ## Geeft als resultaat het jaarlijkse rendement voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum - - -## -## Information functions Informatiefuncties -## -CELL = CEL ## Geeft als resultaat informatie over de opmaak, locatie of inhoud van een cel -ERROR.TYPE = TYPE.FOUT ## Geeft als resultaat een getal dat overeenkomt met een van de foutwaarden van Microsoft Excel -INFO = INFO ## Geeft als resultaat informatie over de huidige besturingsomgeving -ISBLANK = ISLEEG ## Geeft als resultaat WAAR als de waarde leeg is -ISERR = ISFOUT2 ## Geeft als resultaat WAAR als de waarde een foutwaarde is, met uitzondering van #N/B -ISERROR = ISFOUT ## Geeft als resultaat WAAR als de waarde een foutwaarde is -ISEVEN = IS.EVEN ## Geeft als resultaat WAAR als het getal even is -ISLOGICAL = ISLOGISCH ## Geeft als resultaat WAAR als de waarde een logische waarde is -ISNA = ISNB ## Geeft als resultaat WAAR als de waarde de foutwaarde #N/B is -ISNONTEXT = ISGEENTEKST ## Geeft als resultaat WAAR als de waarde geen tekst is -ISNUMBER = ISGETAL ## Geeft als resultaat WAAR als de waarde een getal is -ISODD = IS.ONEVEN ## Geeft als resultaat WAAR als het getal oneven is -ISREF = ISVERWIJZING ## Geeft als resultaat WAAR als de waarde een verwijzing is -ISTEXT = ISTEKST ## Geeft als resultaat WAAR als de waarde tekst is -N = N ## Geeft als resultaat een waarde die is geconverteerd naar een getal -NA = NB ## Geeft als resultaat de foutwaarde #N/B -TYPE = TYPE ## Geeft als resultaat een getal dat het gegevenstype van een waarde aangeeft - - -## -## Logical functions Logische functies -## -AND = EN ## Geeft als resultaat WAAR als alle argumenten WAAR zijn -FALSE = ONWAAR ## Geeft als resultaat de logische waarde ONWAAR -IF = ALS ## Geeft een logische test aan -IFERROR = ALS.FOUT ## Retourneert een waarde die u opgeeft als een formule een fout oplevert, anders wordt het resultaat van de formule geretourneerd -NOT = NIET ## Keert de logische waarde van het argument om -OR = OF ## Geeft als resultaat WAAR als minimaal een van de argumenten WAAR is -TRUE = WAAR ## Geeft als resultaat de logische waarde WAAR - - -## -## Lookup and reference functions Zoek- en verwijzingsfuncties -## -ADDRESS = ADRES ## Geeft als resultaat een verwijzing, in de vorm van tekst, naar één bepaalde cel in een werkblad -AREAS = BEREIKEN ## Geeft als resultaat het aantal bereiken in een verwijzing -CHOOSE = KIEZEN ## Kiest een waarde uit een lijst met waarden -COLUMN = KOLOM ## Geeft als resultaat het kolomnummer van een verwijzing -COLUMNS = KOLOMMEN ## Geeft als resultaat het aantal kolommen in een verwijzing -HLOOKUP = HORIZ.ZOEKEN ## Zoekt in de bovenste rij van een matrix naar een bepaalde waarde en geeft als resultaat de gevonden waarde in de opgegeven cel -HYPERLINK = HYPERLINK ## Maakt een snelkoppeling of een sprong waarmee een document wordt geopend dat is opgeslagen op een netwerkserver, een intranet of op internet -INDEX = INDEX ## Kiest met een index een waarde uit een verwijzing of een matrix -INDIRECT = INDIRECT ## Geeft als resultaat een verwijzing die wordt aangegeven met een tekstwaarde -LOOKUP = ZOEKEN ## Zoekt naar bepaalde waarden in een vector of een matrix -MATCH = VERGELIJKEN ## Zoekt naar bepaalde waarden in een verwijzing of een matrix -OFFSET = VERSCHUIVING ## Geeft als resultaat een nieuwe verwijzing die is verschoven ten opzichte van een bepaalde verwijzing -ROW = RIJ ## Geeft als resultaat het rijnummer van een verwijzing -ROWS = RIJEN ## Geeft als resultaat het aantal rijen in een verwijzing -RTD = RTG ## Haalt realtimegegevens op uit een programma dat COM-automatisering (automatisering: een methode waarmee de ene toepassing objecten van een andere toepassing of ontwikkelprogramma kan besturen. Automatisering werd vroeger OLE-automatisering genoemd. Automatisering is een industrienorm die deel uitmaakt van het Component Object Model (COM).) ondersteunt -TRANSPOSE = TRANSPONEREN ## Geeft als resultaat de getransponeerde van een matrix -VLOOKUP = VERT.ZOEKEN ## Zoekt in de meest linkse kolom van een matrix naar een bepaalde waarde en geeft als resultaat de waarde in de opgegeven cel - - -## -## Math and trigonometry functions Wiskundige en trigonometrische functies -## -ABS = ABS ## Geeft als resultaat de absolute waarde van een getal -ACOS = BOOGCOS ## Geeft als resultaat de boogcosinus van een getal -ACOSH = BOOGCOSH ## Geeft als resultaat de inverse cosinus hyperbolicus van een getal -ASIN = BOOGSIN ## Geeft als resultaat de boogsinus van een getal -ASINH = BOOGSINH ## Geeft als resultaat de inverse sinus hyperbolicus van een getal -ATAN = BOOGTAN ## Geeft als resultaat de boogtangens van een getal -ATAN2 = BOOGTAN2 ## Geeft als resultaat de boogtangens van de x- en y-coördinaten -ATANH = BOOGTANH ## Geeft als resultaat de inverse tangens hyperbolicus van een getal -CEILING = AFRONDEN.BOVEN ## Rondt de absolute waarde van een getal naar boven af op het dichtstbijzijnde gehele getal of het dichtstbijzijnde significante veelvoud -COMBIN = COMBINATIES ## Geeft als resultaat het aantal combinaties voor een bepaald aantal objecten -COS = COS ## Geeft als resultaat de cosinus van een getal -COSH = COSH ## Geeft als resultaat de cosinus hyperbolicus van een getal -DEGREES = GRADEN ## Converteert radialen naar graden -EVEN = EVEN ## Rondt het getal af op het dichtstbijzijnde gehele even getal -EXP = EXP ## Verheft e tot de macht van een bepaald getal -FACT = FACULTEIT ## Geeft als resultaat de faculteit van een getal -FACTDOUBLE = DUBBELE.FACULTEIT ## Geeft als resultaat de dubbele faculteit van een getal -FLOOR = AFRONDEN.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af -GCD = GGD ## Geeft als resultaat de grootste gemene deler -INT = INTEGER ## Rondt een getal naar beneden af op het dichtstbijzijnde gehele getal -LCM = KGV ## Geeft als resultaat het kleinste gemene veelvoud -LN = LN ## Geeft als resultaat de natuurlijke logaritme van een getal -LOG = LOG ## Geeft als resultaat de logaritme met het opgegeven grondtal van een getal -LOG10 = LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een getal -MDETERM = DETERMINANTMAT ## Geeft als resultaat de determinant van een matrix -MINVERSE = INVERSEMAT ## Geeft als resultaat de inverse van een matrix -MMULT = PRODUCTMAT ## Geeft als resultaat het product van twee matrices -MOD = REST ## Geeft als resultaat het restgetal van een deling -MROUND = AFRONDEN.N.VEELVOUD ## Geeft als resultaat een getal afgerond op het gewenste veelvoud -MULTINOMIAL = MULTINOMIAAL ## Geeft als resultaat de multinomiaalcoëfficiënt van een reeks getallen -ODD = ONEVEN ## Rondt de absolute waarde van het getal naar boven af op het dichtstbijzijnde gehele oneven getal -PI = PI ## Geeft als resultaat de waarde van pi -POWER = MACHT ## Verheft een getal tot een macht -PRODUCT = PRODUCT ## Vermenigvuldigt de argumenten met elkaar -QUOTIENT = QUOTIENT ## Geeft als resultaat de uitkomst van een deling als geheel getal -RADIANS = RADIALEN ## Converteert graden naar radialen -RAND = ASELECT ## Geeft als resultaat een willekeurig getal tussen 0 en 1 -RANDBETWEEN = ASELECTTUSSEN ## Geeft een willekeurig getal tussen de getallen die u hebt opgegeven -ROMAN = ROMEINS ## Converteert een Arabisch getal naar een Romeins getal en geeft het resultaat weer in de vorm van tekst -ROUND = AFRONDEN ## Rondt een getal af op het opgegeven aantal decimalen -ROUNDDOWN = AFRONDEN.NAAR.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af -ROUNDUP = AFRONDEN.NAAR.BOVEN ## Rondt de absolute waarde van een getal naar boven af -SERIESSUM = SOM.MACHTREEKS ## Geeft als resultaat de som van een machtreeks die is gebaseerd op de formule -SIGN = POS.NEG ## Geeft als resultaat het teken van een getal -SIN = SIN ## Geeft als resultaat de sinus van de opgegeven hoek -SINH = SINH ## Geeft als resultaat de sinus hyperbolicus van een getal -SQRT = WORTEL ## Geeft als resultaat de positieve vierkantswortel van een getal -SQRTPI = WORTEL.PI ## Geeft als resultaat de vierkantswortel van (getal * pi) -SUBTOTAL = SUBTOTAAL ## Geeft als resultaat een subtotaal voor een bereik -SUM = SOM ## Telt de argumenten op -SUMIF = SOM.ALS ## Telt de getallen bij elkaar op die voldoen aan een bepaald criterium -SUMIFS = SOMMEN.ALS ## Telt de cellen in een bereik op die aan meerdere criteria voldoen -SUMPRODUCT = SOMPRODUCT ## Geeft als resultaat de som van de producten van de corresponderende matrixelementen -SUMSQ = KWADRATENSOM ## Geeft als resultaat de som van de kwadraten van de argumenten -SUMX2MY2 = SOM.X2MINY2 ## Geeft als resultaat de som van het verschil tussen de kwadraten van corresponderende waarden in twee matrices -SUMX2PY2 = SOM.X2PLUSY2 ## Geeft als resultaat de som van de kwadratensom van corresponderende waarden in twee matrices -SUMXMY2 = SOM.XMINY.2 ## Geeft als resultaat de som van de kwadraten van de verschillen tussen de corresponderende waarden in twee matrices -TAN = TAN ## Geeft als resultaat de tangens van een getal -TANH = TANH ## Geeft als resultaat de tangens hyperbolicus van een getal -TRUNC = GEHEEL ## Kapt een getal af tot een geheel getal - - -## -## Statistical functions Statistische functies -## -AVEDEV = GEM.DEVIATIE ## Geeft als resultaat het gemiddelde van de absolute deviaties van gegevenspunten ten opzichte van hun gemiddelde waarde -AVERAGE = GEMIDDELDE ## Geeft als resultaat het gemiddelde van de argumenten -AVERAGEA = GEMIDDELDEA ## Geeft als resultaat het gemiddelde van de argumenten, inclusief getallen, tekst en logische waarden -AVERAGEIF = GEMIDDELDE.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen in een bereik die voldoen aan de opgegeven criteria -AVERAGEIFS = GEMIDDELDEN.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen die aan meerdere criteria voldoen -BETADIST = BETA.VERD ## Geeft als resultaat de cumulatieve bèta-verdelingsfunctie -BETAINV = BETA.INV ## Geeft als resultaat de inverse van de cumulatieve verdelingsfunctie voor een gegeven bèta-verdeling -BINOMDIST = BINOMIALE.VERD ## Geeft als resultaat de binomiale verdeling -CHIDIST = CHI.KWADRAAT ## Geeft als resultaat de eenzijdige kans van de chi-kwadraatverdeling -CHIINV = CHI.KWADRAAT.INV ## Geeft als resultaat de inverse van een eenzijdige kans van de chi-kwadraatverdeling -CHITEST = CHI.TOETS ## Geeft als resultaat de onafhankelijkheidstoets -CONFIDENCE = BETROUWBAARHEID ## Geeft als resultaat het betrouwbaarheidsinterval van een gemiddelde waarde voor de elementen van een populatie -CORREL = CORRELATIE ## Geeft als resultaat de correlatiecoëfficiënt van twee gegevensverzamelingen -COUNT = AANTAL ## Telt het aantal getallen in de argumentenlijst -COUNTA = AANTALARG ## Telt het aantal waarden in de argumentenlijst -COUNTBLANK = AANTAL.LEGE.CELLEN ## Telt het aantal lege cellen in een bereik -COUNTIF = AANTAL.ALS ## Telt in een bereik het aantal cellen die voldoen aan een bepaald criterium -COUNTIFS = AANTALLEN.ALS ## Telt in een bereik het aantal cellen die voldoen aan meerdere criteria -COVAR = COVARIANTIE ## Geeft als resultaat de covariantie, het gemiddelde van de producten van de gepaarde deviaties -CRITBINOM = CRIT.BINOM ## Geeft als resultaat de kleinste waarde waarvoor de binomiale verdeling kleiner is dan of gelijk is aan het criterium -DEVSQ = DEV.KWAD ## Geeft als resultaat de som van de deviaties in het kwadraat -EXPONDIST = EXPON.VERD ## Geeft als resultaat de exponentiële verdeling -FDIST = F.VERDELING ## Geeft als resultaat de F-verdeling -FINV = F.INVERSE ## Geeft als resultaat de inverse van de F-verdeling -FISHER = FISHER ## Geeft als resultaat de Fisher-transformatie -FISHERINV = FISHER.INV ## Geeft als resultaat de inverse van de Fisher-transformatie -FORECAST = VOORSPELLEN ## Geeft als resultaat een waarde op basis van een lineaire trend -FREQUENCY = FREQUENTIE ## Geeft als resultaat een frequentieverdeling in de vorm van een verticale matrix -FTEST = F.TOETS ## Geeft als resultaat een F-toets -GAMMADIST = GAMMA.VERD ## Geeft als resultaat de gamma-verdeling -GAMMAINV = GAMMA.INV ## Geeft als resultaat de inverse van de cumulatieve gamma-verdeling -GAMMALN = GAMMA.LN ## Geeft als resultaat de natuurlijke logaritme van de gamma-functie, G(x) -GEOMEAN = MEETK.GEM ## Geeft als resultaat het meetkundige gemiddelde -GROWTH = GROEI ## Geeft als resultaat de waarden voor een exponentiële trend -HARMEAN = HARM.GEM ## Geeft als resultaat het harmonische gemiddelde -HYPGEOMDIST = HYPERGEO.VERD ## Geeft als resultaat de hypergeometrische verdeling -INTERCEPT = SNIJPUNT ## Geeft als resultaat het snijpunt van de lineaire regressielijn met de y-as -KURT = KURTOSIS ## Geeft als resultaat de kurtosis van een gegevensverzameling -LARGE = GROOTSTE ## Geeft als resultaat de op k-1 na grootste waarde in een gegevensverzameling -LINEST = LIJNSCH ## Geeft als resultaat de parameters van een lineaire trend -LOGEST = LOGSCH ## Geeft als resultaat de parameters van een exponentiële trend -LOGINV = LOG.NORM.INV ## Geeft als resultaat de inverse van de logaritmische normale verdeling -LOGNORMDIST = LOG.NORM.VERD ## Geeft als resultaat de cumulatieve logaritmische normale verdeling -MAX = MAX ## Geeft als resultaat de maximumwaarde in een lijst met argumenten -MAXA = MAXA ## Geeft als resultaat de maximumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden -MEDIAN = MEDIAAN ## Geeft als resultaat de mediaan van de opgegeven getallen -MIN = MIN ## Geeft als resultaat de minimumwaarde in een lijst met argumenten -MINA = MINA ## Geeft als resultaat de minimumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden -MODE = MODUS ## Geeft als resultaat de meest voorkomende waarde in een gegevensverzameling -NEGBINOMDIST = NEG.BINOM.VERD ## Geeft als resultaat de negatieve binomiaalverdeling -NORMDIST = NORM.VERD ## Geeft als resultaat de cumulatieve normale verdeling -NORMINV = NORM.INV ## Geeft als resultaat de inverse van de cumulatieve standaardnormale verdeling -NORMSDIST = STAND.NORM.VERD ## Geeft als resultaat de cumulatieve standaardnormale verdeling -NORMSINV = STAND.NORM.INV ## Geeft als resultaat de inverse van de cumulatieve normale verdeling -PEARSON = PEARSON ## Geeft als resultaat de correlatiecoëfficiënt van Pearson -PERCENTILE = PERCENTIEL ## Geeft als resultaat het k-de percentiel van waarden in een bereik -PERCENTRANK = PERCENT.RANG ## Geeft als resultaat de positie, in procenten uitgedrukt, van een waarde in de rangorde van een gegevensverzameling -PERMUT = PERMUTATIES ## Geeft als resultaat het aantal permutaties voor een gegeven aantal objecten -POISSON = POISSON ## Geeft als resultaat de Poisson-verdeling -PROB = KANS ## Geeft als resultaat de kans dat waarden zich tussen twee grenzen bevinden -QUARTILE = KWARTIEL ## Geeft als resultaat het kwartiel van een gegevensverzameling -RANK = RANG ## Geeft als resultaat het rangnummer van een getal in een lijst getallen -RSQ = R.KWADRAAT ## Geeft als resultaat het kwadraat van de Pearson-correlatiecoëfficiënt -SKEW = SCHEEFHEID ## Geeft als resultaat de mate van asymmetrie van een verdeling -SLOPE = RICHTING ## Geeft als resultaat de richtingscoëfficiënt van een lineaire regressielijn -SMALL = KLEINSTE ## Geeft als resultaat de op k-1 na kleinste waarde in een gegevensverzameling -STANDARDIZE = NORMALISEREN ## Geeft als resultaat een genormaliseerde waarde -STDEV = STDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef -STDEVA = STDEVA ## Maakt een schatting van de standaarddeviatie op basis van een steekproef, inclusief getallen, tekst en logische waarden -STDEVP = STDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie -STDEVPA = STDEVPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden -STEYX = STAND.FOUT.YX ## Geeft als resultaat de standaardfout in de voorspelde y-waarde voor elke x in een regressie -TDIST = T.VERD ## Geeft als resultaat de Student T-verdeling -TINV = T.INV ## Geeft als resultaat de inverse van de Student T-verdeling -TREND = TREND ## Geeft als resultaat de waarden voor een lineaire trend -TRIMMEAN = GETRIMD.GEM ## Geeft als resultaat het gemiddelde van waarden in een gegevensverzameling -TTEST = T.TOETS ## Geeft als resultaat de kans met behulp van de Student T-toets -VAR = VAR ## Maakt een schatting van de variantie op basis van een steekproef -VARA = VARA ## Maakt een schatting van de variantie op basis van een steekproef, inclusief getallen, tekst en logische waarden -VARP = VARP ## Berekent de variantie op basis van de volledige populatie -VARPA = VARPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden -WEIBULL = WEIBULL ## Geeft als resultaat de Weibull-verdeling -ZTEST = Z.TOETS ## Geeft als resultaat de eenzijdige kanswaarde van een Z-toets - - -## -## Text functions Tekstfuncties -## -ASC = ASC ## Wijzigt Nederlandse letters of katakanatekens over de volle breedte (dubbel-bytetekens) binnen een tekenreeks in tekens over de halve breedte (enkel-bytetekens) -BAHTTEXT = BAHT.TEKST ## Converteert een getal naar tekst met de valutanotatie ß (baht) -CHAR = TEKEN ## Geeft als resultaat het teken dat hoort bij de opgegeven code -CLEAN = WISSEN.CONTROL ## Verwijdert alle niet-afdrukbare tekens uit een tekst -CODE = CODE ## Geeft als resultaat de numerieke code voor het eerste teken in een tekenreeks -CONCATENATE = TEKST.SAMENVOEGEN ## Voegt verschillende tekstfragmenten samen tot één tekstfragment -DOLLAR = EURO ## Converteert een getal naar tekst met de valutanotatie € (euro) -EXACT = GELIJK ## Controleert of twee tekenreeksen identiek zijn -FIND = VIND.ALLES ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters) -FINDB = VIND.ALLES.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters) -FIXED = VAST ## Maakt een getal als tekst met een vast aantal decimalen op -JIS = JIS ## Wijzigt Nederlandse letters of katakanatekens over de halve breedte (enkel-bytetekens) binnen een tekenreeks in tekens over de volle breedte (dubbel-bytetekens) -LEFT = LINKS ## Geeft als resultaat de meest linkse tekens in een tekenreeks -LEFTB = LINKSB ## Geeft als resultaat de meest linkse tekens in een tekenreeks -LEN = LENGTE ## Geeft als resultaat het aantal tekens in een tekenreeks -LENB = LENGTEB ## Geeft als resultaat het aantal tekens in een tekenreeks -LOWER = KLEINE.LETTERS ## Zet tekst om in kleine letters -MID = MIDDEN ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft -MIDB = DEELB ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft -PHONETIC = FONETISCH ## Haalt de fonetische tekens (furigana) uit een tekenreeks op -PROPER = BEGINLETTERS ## Zet de eerste letter van elk woord in een tekst om in een hoofdletter -REPLACE = VERVANG ## Vervangt tekens binnen een tekst -REPLACEB = VERVANGENB ## Vervangt tekens binnen een tekst -REPT = HERHALING ## Herhaalt een tekst een aantal malen -RIGHT = RECHTS ## Geeft als resultaat de meest rechtse tekens in een tekenreeks -RIGHTB = RECHTSB ## Geeft als resultaat de meest rechtse tekens in een tekenreeks -SEARCH = VIND.SPEC ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters) -SEARCHB = VIND.SPEC.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters) -SUBSTITUTE = SUBSTITUEREN ## Vervangt oude tekst door nieuwe tekst in een tekenreeks -T = T ## Converteert de argumenten naar tekst -TEXT = TEKST ## Maakt een getal op en converteert het getal naar tekst -TRIM = SPATIES.WISSEN ## Verwijdert de spaties uit een tekst -UPPER = HOOFDLETTERS ## Zet tekst om in hoofdletters -VALUE = WAARDE ## Converteert tekst naar een getal diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/config deleted file mode 100644 index 1c5cc62bb8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = kr - - -## -## Excel Error Codes (For future use) -## -NULL = #NULL! -DIV0 = #DIV/0! -VALUE = #VERDI! -REF = #REF! -NAME = #NAVN? -NUM = #NUM! -NA = #I/T diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/functions deleted file mode 100644 index 80a4390067..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/no/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Funksjonene Tillegg og Automatisering -## -GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data som er lagret i en pivottabellrapport - - -## -## Cube functions Kubefunksjoner -## -CUBEKPIMEMBER = KUBEKPIMEDLEM ## Returnerer navnet, egenskapen og mÃ¥let for en viktig ytelsesindikator (KPI), og viser navnet og egenskapen i cellen. En KPI er en mÃ¥lbar enhet, for eksempel mÃ¥nedlig bruttoinntjening eller kvartalsvis inntjening per ansatt, og brukes til Ã¥ overvÃ¥ke ytelsen i en organisasjon. -CUBEMEMBER = KUBEMEDLEM ## Returnerer et medlem eller en tuppel i et kubehierarki. Brukes til Ã¥ validere at medlemmet eller tuppelen finnes i kuben. -CUBEMEMBERPROPERTY = KUBEMEDLEMEGENSKAP ## Returnerer verdien til en medlemsegenskap i kuben. Brukes til Ã¥ validere at et medlemsnavn finnes i kuben, og til Ã¥ returnere den angitte egenskapen for dette medlemmet. -CUBERANKEDMEMBER = KUBERANGERTMEDLEM ## Returnerer det n-te, eller rangerte, medlemmet i et sett. Brukes til Ã¥ returnere ett eller flere elementer i et sett, for eksempel de 10 beste studentene. -CUBESET = KUBESETT ## Definerer et beregnet sett av medlemmer eller tuppeler ved Ã¥ sende et settuttrykk til kuben pÃ¥ serveren, noe som oppretter settet og deretter returnerer dette settet til Microsoft Office Excel. -CUBESETCOUNT = KUBESETTANTALL ## Returnerer antallet elementer i et sett. -CUBEVALUE = KUBEVERDI ## Returnerer en aggregert verdi fra en kube. - - -## -## Database functions Databasefunksjoner -## -DAVERAGE = DGJENNOMSNITT ## Returnerer gjennomsnittet av merkede databaseposter -DCOUNT = DANTALL ## Teller celler som inneholder tall i en database -DCOUNTA = DANTALLA ## Teller celler som ikke er tomme i en database -DGET = DHENT ## Trekker ut fra en database en post som oppfyller angitte vilkÃ¥r -DMAX = DMAKS ## Returnerer maksimumsverdien fra merkede databaseposter -DMIN = DMIN ## Returnerer minimumsverdien fra merkede databaseposter -DPRODUCT = DPRODUKT ## Multipliserer verdiene i et bestemt felt med poster som oppfyller vilkÃ¥rene i en database -DSTDEV = DSTDAV ## Estimerer standardavviket basert pÃ¥ et utvalg av merkede databaseposter -DSTDEVP = DSTAVP ## Beregner standardavviket basert pÃ¥ at merkede databaseposter utgjør hele populasjonen -DSUM = DSUMMER ## Legger til tallene i feltkolonnen med poster, i databasen som oppfyller vilkÃ¥rene -DVAR = DVARIANS ## Estimerer variansen basert pÃ¥ et utvalg av merkede databaseposter -DVARP = DVARIANSP ## Beregner variansen basert pÃ¥ at merkede databaseposter utgjør hele populasjonen - - -## -## Date and time functions Dato- og tidsfunksjoner -## -DATE = DATO ## Returnerer serienummeret som svarer til en bestemt dato -DATEVALUE = DATOVERDI ## Konverterer en dato med tekstformat til et serienummer -DAY = DAG ## Konverterer et serienummer til en dag i mÃ¥neden -DAYS360 = DAGER360 ## Beregner antall dager mellom to datoer basert pÃ¥ et Ã¥r med 360 dager -EDATE = DAG.ETTER ## Returnerer serienummeret som svarer til datoen som er det indikerte antall mÃ¥neder før eller etter startdatoen -EOMONTH = MÃ…NEDSSLUTT ## Returnerer serienummeret som svarer til siste dag i mÃ¥neden, før eller etter et angitt antall mÃ¥neder -HOUR = TIME ## Konverterer et serienummer til en time -MINUTE = MINUTT ## Konverterer et serienummer til et minutt -MONTH = MÃ…NED ## Konverterer et serienummer til en mÃ¥ned -NETWORKDAYS = NETT.ARBEIDSDAGER ## Returnerer antall hele arbeidsdager mellom to datoer -NOW = NÃ… ## Returnerer serienummeret som svarer til gjeldende dato og klokkeslett -SECOND = SEKUND ## Konverterer et serienummer til et sekund -TIME = TID ## Returnerer serienummeret som svarer til et bestemt klokkeslett -TIMEVALUE = TIDSVERDI ## Konverterer et klokkeslett i tekstformat til et serienummer -TODAY = IDAG ## Returnerer serienummeret som svarer til dagens dato -WEEKDAY = UKEDAG ## Konverterer et serienummer til en ukedag -WEEKNUM = UKENR ## Konverterer et serienummer til et tall som representerer hvilket nummer uken har i et Ã¥r -WORKDAY = ARBEIDSDAG ## Returnerer serienummeret som svarer til datoen før eller etter et angitt antall arbeidsdager -YEAR = Ã…R ## Konverterer et serienummer til et Ã¥r -YEARFRAC = Ã…RDEL ## Returnerer brøkdelen for Ã¥ret, som svarer til antall hele dager mellom startdato og sluttdato - - -## -## Engineering functions Tekniske funksjoner -## -BESSELI = BESSELI ## Returnerer den endrede Bessel-funksjonen In(x) -BESSELJ = BESSELJ ## Returnerer Bessel-funksjonen Jn(x) -BESSELK = BESSELK ## Returnerer den endrede Bessel-funksjonen Kn(x) -BESSELY = BESSELY ## Returnerer Bessel-funksjonen Yn(x) -BIN2DEC = BINTILDES ## Konverterer et binært tall til et desimaltall -BIN2HEX = BINTILHEKS ## Konverterer et binært tall til et heksadesimaltall -BIN2OCT = BINTILOKT ## Konverterer et binært tall til et oktaltall -COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koeffisienter til et komplekst tall -CONVERT = KONVERTER ## Konverterer et tall fra ett mÃ¥lsystem til et annet -DEC2BIN = DESTILBIN ## Konverterer et desimaltall til et binærtall -DEC2HEX = DESTILHEKS ## Konverterer et heltall i 10-tallsystemet til et heksadesimalt tall -DEC2OCT = DESTILOKT ## Konverterer et heltall i 10-tallsystemet til et oktaltall -DELTA = DELTA ## Undersøker om to verdier er like -ERF = FEILF ## Returnerer feilfunksjonen -ERFC = FEILFK ## Returnerer den komplementære feilfunksjonen -GESTEP = GRENSEVERDI ## Tester om et tall er større enn en terskelverdi -HEX2BIN = HEKSTILBIN ## Konverterer et heksadesimaltall til et binært tall -HEX2DEC = HEKSTILDES ## Konverterer et heksadesimalt tall til et heltall i 10-tallsystemet -HEX2OCT = HEKSTILOKT ## Konverterer et heksadesimalt tall til et oktaltall -IMABS = IMABS ## Returnerer absoluttverdien (koeffisienten) til et komplekst tall -IMAGINARY = IMAGINÆR ## Returnerer den imaginære koeffisienten til et komplekst tall -IMARGUMENT = IMARGUMENT ## Returnerer argumentet theta, som er en vinkel uttrykt i radianer -IMCONJUGATE = IMKONJUGERT ## Returnerer den komplekse konjugaten til et komplekst tall -IMCOS = IMCOS ## Returnerer cosinus til et komplekst tall -IMDIV = IMDIV ## Returnerer kvotienten til to komplekse tall -IMEXP = IMEKSP ## Returnerer eksponenten til et komplekst tall -IMLN = IMLN ## Returnerer den naturlige logaritmen for et komplekst tall -IMLOG10 = IMLOG10 ## Returnerer logaritmen med grunntall 10 for et komplekst tall -IMLOG2 = IMLOG2 ## Returnerer logaritmen med grunntall 2 for et komplekst tall -IMPOWER = IMOPPHØY ## Returnerer et komplekst tall opphøyd til en heltallspotens -IMPRODUCT = IMPRODUKT ## Returnerer produktet av komplekse tall -IMREAL = IMREELL ## Returnerer den reelle koeffisienten til et komplekst tall -IMSIN = IMSIN ## Returnerer sinus til et komplekst tall -IMSQRT = IMROT ## Returnerer kvadratroten av et komplekst tall -IMSUB = IMSUB ## Returnerer differansen mellom to komplekse tall -IMSUM = IMSUMMER ## Returnerer summen av komplekse tall -OCT2BIN = OKTTILBIN ## Konverterer et oktaltall til et binært tall -OCT2DEC = OKTTILDES ## Konverterer et oktaltall til et desimaltall -OCT2HEX = OKTTILHEKS ## Konverterer et oktaltall til et heksadesimaltall - - -## -## Financial functions Økonomiske funksjoner -## -ACCRINT = PÃ…LØPT.PERIODISK.RENTE ## Returnerer pÃ¥løpte renter for et verdipapir som betaler periodisk rente -ACCRINTM = PÃ…LØPT.FORFALLSRENTE ## Returnerer den pÃ¥løpte renten for et verdipapir som betaler rente ved forfall -AMORDEGRC = AMORDEGRC ## Returnerer avskrivningen for hver regnskapsperiode ved hjelp av en avskrivingskoeffisient -AMORLINC = AMORLINC ## Returnerer avskrivingen for hver regnskapsperiode -COUPDAYBS = OBLIG.DAGER.FF ## Returnerer antall dager fra begynnelsen av den rentebærende perioden til innløsningsdatoen -COUPDAYS = OBLIG.DAGER ## Returnerer antall dager i den rentebærende perioden som inneholder innløsningsdatoen -COUPDAYSNC = OBLIG.DAGER.NF ## Returnerer antall dager fra betalingsdato til neste renteinnbetalingsdato -COUPNCD = OBLIG.DAGER.EF ## Returnerer obligasjonsdatoen som kommer etter oppgjørsdatoen -COUPNUM = OBLIG.ANTALL ## Returnerer antall obligasjoner som skal betales mellom oppgjørsdatoen og forfallsdatoen -COUPPCD = OBLIG.DAG.FORRIGE ## Returnerer obligasjonsdatoen som kommer før oppgjørsdatoen -CUMIPMT = SAMLET.RENTE ## Returnerer den kumulative renten som er betalt mellom to perioder -CUMPRINC = SAMLET.HOVEDSTOL ## Returnerer den kumulative hovedstolen som er betalt for et lÃ¥n mellom to perioder -DB = DAVSKR ## Returnerer avskrivningen for et aktivum i en angitt periode, foretatt med fast degressiv avskrivning -DDB = DEGRAVS ## Returnerer avskrivningen for et aktivum for en gitt periode, ved hjelp av dobbel degressiv avskrivning eller en metode som du selv angir -DISC = DISKONTERT ## Returnerer diskonteringsraten for et verdipapir -DOLLARDE = DOLLARDE ## Konverterer en valutapris uttrykt som en brøk, til en valutapris uttrykt som et desimaltall -DOLLARFR = DOLLARBR ## Konverterer en valutapris uttrykt som et desimaltall, til en valutapris uttrykt som en brøk -DURATION = VARIGHET ## Returnerer Ã¥rlig varighet for et verdipapir med renter som betales periodisk -EFFECT = EFFEKTIV.RENTE ## Returnerer den effektive Ã¥rlige rentesatsen -FV = SLUTTVERDI ## Returnerer fremtidig verdi for en investering -FVSCHEDULE = SVPLAN ## Returnerer den fremtidige verdien av en inngÃ¥ende hovedstol etter Ã¥ ha anvendt en serie med sammensatte rentesatser -INTRATE = RENTESATS ## Returnerer rentefoten av et fullfinansiert verdipapir -IPMT = RAVDRAG ## Returnerer betalte renter pÃ¥ en investering for en gitt periode -IRR = IR ## Returnerer internrenten for en serie kontantstrømmer -ISPMT = ER.AVDRAG ## Beregner renten som er betalt for en investering i løpet av en bestemt periode -MDURATION = MVARIGHET ## Returnerer Macauleys modifiserte varighet for et verdipapir med en antatt pÃ¥lydende verdi pÃ¥ kr 100,00 -MIRR = MODIR ## Returnerer internrenten der positive og negative kontantstrømmer finansieres med forskjellige satser -NOMINAL = NOMINELL ## Returnerer Ã¥rlig nominell rentesats -NPER = PERIODER ## Returnerer antall perioder for en investering -NPV = NNV ## Returnerer netto nÃ¥verdi for en investering, basert pÃ¥ en serie periodiske kontantstrømmer og en rentesats -ODDFPRICE = AVVIKFP.PRIS ## Returnerer pris pÃ¥lydende kr 100 for et verdipapir med en odde første periode -ODDFYIELD = AVVIKFP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde første periode -ODDLPRICE = AVVIKSP.PRIS ## Returnerer pris pÃ¥lydende kr 100 for et verdipapir med en odde siste periode -ODDLYIELD = AVVIKSP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde siste periode -PMT = AVDRAG ## Returnerer periodisk betaling for en annuitet -PPMT = AMORT ## Returnerer betalingen pÃ¥ hovedstolen for en investering i en gitt periode -PRICE = PRIS ## Returnerer prisen per pÃ¥lydende kr 100 for et verdipapir som gir periodisk avkastning -PRICEDISC = PRIS.DISKONTERT ## Returnerer prisen per pÃ¥lydende kr 100 for et diskontert verdipapir -PRICEMAT = PRIS.FORFALL ## Returnerer prisen per pÃ¥lydende kr 100 av et verdipapir som betaler rente ved forfall -PV = NÃ…VERDI ## Returnerer nÃ¥verdien av en investering -RATE = RENTE ## Returnerer rentesatsen per periode for en annuitet -RECEIVED = MOTTATT.AVKAST ## Returnerer summen som mottas ved forfallsdato for et fullinvestert verdipapir -SLN = LINAVS ## Returnerer den lineære avskrivningen for et aktivum i én periode -SYD = Ã…RSAVS ## Returnerer Ã¥rsavskrivningen for et aktivum i en angitt periode -TBILLEQ = TBILLEKV ## Returnerer den obligasjonsekvivalente avkastningen for en statsobligasjon -TBILLPRICE = TBILLPRIS ## Returnerer prisen per pÃ¥lydende kr 100 for en statsobligasjon -TBILLYIELD = TBILLAVKASTNING ## Returnerer avkastningen til en statsobligasjon -VDB = VERDIAVS ## Returnerer avskrivningen for et aktivum i en angitt periode eller delperiode, ved hjelp av degressiv avskrivning -XIRR = XIR ## Returnerer internrenten for en serie kontantstrømmer som ikke nødvendigvis er periodiske -XNPV = XNNV ## Returnerer netto nÃ¥verdi for en serie kontantstrømmer som ikke nødvendigvis er periodiske -YIELD = AVKAST ## Returnerer avkastningen pÃ¥ et verdipapir som betaler periodisk rente -YIELDDISC = AVKAST.DISKONTERT ## Returnerer Ã¥rlig avkastning for et diskontert verdipapir, for eksempel en statskasseveksel -YIELDMAT = AVKAST.FORFALL ## Returnerer den Ã¥rlige avkastningen for et verdipapir som betaler rente ved forfallsdato - - -## -## Information functions Informasjonsfunksjoner -## -CELL = CELLE ## Returnerer informasjon om formatering, plassering eller innholdet til en celle -ERROR.TYPE = FEIL.TYPE ## Returnerer et tall som svarer til en feiltype -INFO = INFO ## Returnerer informasjon om gjeldende operativmiljø -ISBLANK = ERTOM ## Returnerer SANN hvis verdien er tom -ISERR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst annen feilverdi enn #I/T -ISERROR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst feilverdi -ISEVEN = ERPARTALL ## Returnerer SANN hvis tallet er et partall -ISLOGICAL = ERLOGISK ## Returnerer SANN hvis verdien er en logisk verdi -ISNA = ERIT ## Returnerer SANN hvis verdien er feilverdien #I/T -ISNONTEXT = ERIKKETEKST ## Returnerer SANN hvis verdien ikke er tekst -ISNUMBER = ERTALL ## Returnerer SANN hvis verdien er et tall -ISODD = ERODDETALL ## Returnerer SANN hvis tallet er et oddetall -ISREF = ERREF ## Returnerer SANN hvis verdien er en referanse -ISTEXT = ERTEKST ## Returnerer SANN hvis verdien er tekst -N = N ## Returnerer en verdi som er konvertert til et tall -NA = IT ## Returnerer feilverdien #I/T -TYPE = VERDITYPE ## Returnerer et tall som indikerer datatypen til en verdi - - -## -## Logical functions Logiske funksjoner -## -AND = OG ## Returnerer SANN hvis alle argumentene er lik SANN -FALSE = USANN ## Returnerer den logiske verdien USANN -IF = HVIS ## Angir en logisk test som skal utføres -IFERROR = HVISFEIL ## Returnerer en verdi du angir hvis en formel evaluerer til en feil. Ellers returnerer den resultatet av formelen. -NOT = IKKE ## Reverserer logikken til argumentet -OR = ELLER ## Returnerer SANN hvis ett eller flere argumenter er lik SANN -TRUE = SANN ## Returnerer den logiske verdien SANN - - -## -## Lookup and reference functions Oppslag- og referansefunksjoner -## -ADDRESS = ADRESSE ## Returnerer en referanse som tekst til en enkelt celle i et regneark -AREAS = OMRÃ…DER ## Returnerer antall omrÃ¥der i en referanse -CHOOSE = VELG ## Velger en verdi fra en liste med verdier -COLUMN = KOLONNE ## Returnerer kolonnenummeret for en referanse -COLUMNS = KOLONNER ## Returnerer antall kolonner i en referanse -HLOOKUP = FINN.KOLONNE ## Leter i den øverste raden i en matrise og returnerer verdien for den angitte cellen -HYPERLINK = HYPERKOBLING ## Oppretter en snarvei eller et hopp som Ã¥pner et dokument som er lagret pÃ¥ en nettverksserver, et intranett eller Internett -INDEX = INDEKS ## Bruker en indeks til Ã¥ velge en verdi fra en referanse eller matrise -INDIRECT = INDIREKTE ## Returnerer en referanse angitt av en tekstverdi -LOOKUP = SLÃ….OPP ## SlÃ¥r opp verdier i en vektor eller matrise -MATCH = SAMMENLIGNE ## SlÃ¥r opp verdier i en referanse eller matrise -OFFSET = FORSKYVNING ## Returnerer en referanseforskyvning fra en gitt referanse -ROW = RAD ## Returnerer radnummeret for en referanse -ROWS = RADER ## Returnerer antall rader i en referanse -RTD = RTD ## Henter sanntidsdata fra et program som støtter COM-automatisering (automatisering: En mÃ¥te Ã¥ arbeide pÃ¥ med programobjekter fra et annet program- eller utviklingsverktøy. Tidligere kalt OLE-automatisering. Automatisering er en bransjestandard og en funksjon i Component Object Model (COM).) -TRANSPOSE = TRANSPONER ## Returnerer transponeringen av en matrise -VLOOKUP = FINN.RAD ## Leter i den første kolonnen i en matrise og flytter bortover raden for Ã¥ returnere verdien til en celle - - -## -## Math and trigonometry functions Matematikk- og trigonometrifunksjoner -## -ABS = ABS ## Returnerer absoluttverdien til et tall -ACOS = ARCCOS ## Returnerer arcus cosinus til et tall -ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus til et tall -ASIN = ARCSIN ## Returnerer arcus sinus til et tall -ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus til et tall -ATAN = ARCTAN ## Returnerer arcus tangens til et tall -ATAN2 = ARCTAN2 ## Returnerer arcus tangens fra x- og y-koordinater -ATANH = ARCTANH ## Returnerer den inverse hyperbolske tangens til et tall -CEILING = AVRUND.GJELDENDE.MULTIPLUM ## Runder av et tall til nærmeste heltall eller til nærmeste signifikante multiplum -COMBIN = KOMBINASJON ## Returnerer antall kombinasjoner for ett gitt antall objekter -COS = COS ## Returnerer cosinus til et tall -COSH = COSH ## Returnerer den hyperbolske cosinus til et tall -DEGREES = GRADER ## Konverterer radianer til grader -EVEN = AVRUND.TIL.PARTALL ## Runder av et tall oppover til nærmeste heltall som er et partall -EXP = EKSP ## Returnerer e opphøyd i en angitt potens -FACT = FAKULTET ## Returnerer fakultet til et tall -FACTDOUBLE = DOBBELFAKT ## Returnerer et talls doble fakultet -FLOOR = AVRUND.GJELDENDE.MULTIPLUM.NED ## Avrunder et tall nedover, mot null -GCD = SFF ## Returnerer høyeste felles divisor -INT = HELTALL ## Avrunder et tall nedover til nærmeste heltall -LCM = MFM ## Returnerer minste felles multiplum -LN = LN ## Returnerer den naturlige logaritmen til et tall -LOG = LOG ## Returnerer logaritmen for et tall til et angitt grunntall -LOG10 = LOG10 ## Returnerer logaritmen med grunntall 10 for et tall -MDETERM = MDETERM ## Returnerer matrisedeterminanten til en matrise -MINVERSE = MINVERS ## Returnerer den inverse matrisen til en matrise -MMULT = MMULT ## Returnerer matriseproduktet av to matriser -MOD = REST ## Returnerer resten fra en divisjon -MROUND = MRUND ## Returnerer et tall avrundet til det ønskede multiplum -MULTINOMIAL = MULTINOMINELL ## Returnerer det multinominelle for et sett med tall -ODD = AVRUND.TIL.ODDETALL ## Runder av et tall oppover til nærmeste heltall som er et oddetall -PI = PI ## Returnerer verdien av pi -POWER = OPPHØYD.I ## Returnerer resultatet av et tall opphøyd i en potens -PRODUCT = PRODUKT ## Multipliserer argumentene -QUOTIENT = KVOTIENT ## Returnerer heltallsdelen av en divisjon -RADIANS = RADIANER ## Konverterer grader til radianer -RAND = TILFELDIG ## Returnerer et tilfeldig tall mellom 0 og 1 -RANDBETWEEN = TILFELDIGMELLOM ## Returnerer et tilfeldig tall innenfor et angitt omrÃ¥de -ROMAN = ROMERTALL ## Konverterer vanlige tall til romertall, som tekst -ROUND = AVRUND ## Avrunder et tall til et angitt antall sifre -ROUNDDOWN = AVRUND.NED ## Avrunder et tall nedover, mot null -ROUNDUP = AVRUND.OPP ## Runder av et tall oppover, bort fra null -SERIESSUM = SUMMER.REKKE ## Returnerer summen av en geometrisk rekke, basert pÃ¥ formelen -SIGN = FORTEGN ## Returnerer fortegnet for et tall -SIN = SIN ## Returnerer sinus til en gitt vinkel -SINH = SINH ## Returnerer den hyperbolske sinus til et tall -SQRT = ROT ## Returnerer en positiv kvadratrot -SQRTPI = ROTPI ## Returnerer kvadratroten av (tall * pi) -SUBTOTAL = DELSUM ## Returnerer en delsum i en liste eller database -SUM = SUMMER ## Legger sammen argumentene -SUMIF = SUMMERHVIS ## Legger sammen cellene angitt ved et gitt vilkÃ¥r -SUMIFS = SUMMER.HVIS.SETT ## Legger sammen cellene i et omrÃ¥de som oppfyller flere vilkÃ¥r -SUMPRODUCT = SUMMERPRODUKT ## Returnerer summen av produktene av tilsvarende matrisekomponenter -SUMSQ = SUMMERKVADRAT ## Returnerer kvadratsummen av argumentene -SUMX2MY2 = SUMMERX2MY2 ## Returnerer summen av differansen av kvadratene for tilsvarende verdier i to matriser -SUMX2PY2 = SUMMERX2PY2 ## Returnerer summen av kvadratsummene for tilsvarende verdier i to matriser -SUMXMY2 = SUMMERXMY2 ## Returnerer summen av kvadratene av differansen for tilsvarende verdier i to matriser -TAN = TAN ## Returnerer tangens for et tall -TANH = TANH ## Returnerer den hyperbolske tangens for et tall -TRUNC = AVKORT ## Korter av et tall til et heltall - - -## -## Statistical functions Statistiske funksjoner -## -AVEDEV = GJENNOMSNITTSAVVIK ## Returnerer datapunktenes gjennomsnittlige absoluttavvik fra middelverdien -AVERAGE = GJENNOMSNITT ## Returnerer gjennomsnittet for argumentene -AVERAGEA = GJENNOMSNITTA ## Returnerer gjennomsnittet for argumentene, inkludert tall, tekst og logiske verdier -AVERAGEIF = GJENNOMSNITTHVIS ## Returnerer gjennomsnittet (aritmetisk gjennomsnitt) av alle cellene i et omrÃ¥de som oppfyller et bestemt vilkÃ¥r -AVERAGEIFS = GJENNOMSNITT.HVIS.SETT ## Returnerer gjennomsnittet (aritmetisk middelverdi) av alle celler som oppfyller flere vilkÃ¥r. -BETADIST = BETA.FORDELING ## Returnerer den kumulative betafordelingsfunksjonen -BETAINV = INVERS.BETA.FORDELING ## Returnerer den inverse verdien til fordelingsfunksjonen for en angitt betafordeling -BINOMDIST = BINOM.FORDELING ## Returnerer den individuelle binomiske sannsynlighetsfordelingen -CHIDIST = KJI.FORDELING ## Returnerer den ensidige sannsynligheten for en kjikvadrert fordeling -CHIINV = INVERS.KJI.FORDELING ## Returnerer den inverse av den ensidige sannsynligheten for den kjikvadrerte fordelingen -CHITEST = KJI.TEST ## Utfører testen for uavhengighet -CONFIDENCE = KONFIDENS ## Returnerer konfidensintervallet til gjennomsnittet for en populasjon -CORREL = KORRELASJON ## Returnerer korrelasjonskoeffisienten mellom to datasett -COUNT = ANTALL ## Teller hvor mange tall som er i argumentlisten -COUNTA = ANTALLA ## Teller hvor mange verdier som er i argumentlisten -COUNTBLANK = TELLBLANKE ## Teller antall tomme celler i et omrÃ¥de. -COUNTIF = ANTALL.HVIS ## Teller antall celler i et omrÃ¥de som oppfyller gitte vilkÃ¥r -COUNTIFS = ANTALL.HVIS.SETT ## Teller antallet ikke-tomme celler i et omrÃ¥de som oppfyller flere vilkÃ¥r -COVAR = KOVARIANS ## Returnerer kovariansen, gjennomsnittet av produktene av parvise avvik -CRITBINOM = GRENSE.BINOM ## Returnerer den minste verdien der den kumulative binomiske fordelingen er mindre enn eller lik en vilkÃ¥rsverdi -DEVSQ = AVVIK.KVADRERT ## Returnerer summen av kvadrerte avvik -EXPONDIST = EKSP.FORDELING ## Returnerer eksponentialfordelingen -FDIST = FFORDELING ## Returnerer F-sannsynlighetsfordelingen -FINV = FFORDELING.INVERS ## Returnerer den inverse av den sannsynlige F-fordelingen -FISHER = FISHER ## Returnerer Fisher-transformasjonen -FISHERINV = FISHERINV ## Returnerer den inverse av Fisher-transformasjonen -FORECAST = PROGNOSE ## Returnerer en verdi langs en lineær trend -FREQUENCY = FREKVENS ## Returnerer en frekvensdistribusjon som en loddrett matrise -FTEST = FTEST ## Returnerer resultatet av en F-test -GAMMADIST = GAMMAFORDELING ## Returnerer gammafordelingen -GAMMAINV = GAMMAINV ## Returnerer den inverse av den gammakumulative fordelingen -GAMMALN = GAMMALN ## Returnerer den naturlige logaritmen til gammafunksjonen G(x) -GEOMEAN = GJENNOMSNITT.GEOMETRISK ## Returnerer den geometriske middelverdien -GROWTH = VEKST ## Returnerer verdier langs en eksponentiell trend -HARMEAN = GJENNOMSNITT.HARMONISK ## Returnerer den harmoniske middelverdien -HYPGEOMDIST = HYPGEOM.FORDELING ## Returnerer den hypergeometriske fordelingen -INTERCEPT = SKJÆRINGSPUNKT ## Returnerer skjæringspunktet til den lineære regresjonslinjen -KURT = KURT ## Returnerer kurtosen til et datasett -LARGE = N.STØRST ## Returnerer den n-te største verdien i et datasett -LINEST = RETTLINJE ## Returnerer parameterne til en lineær trend -LOGEST = KURVE ## Returnerer parameterne til en eksponentiell trend -LOGINV = LOGINV ## Returnerer den inverse lognormale fordelingen -LOGNORMDIST = LOGNORMFORD ## Returnerer den kumulative lognormale fordelingen -MAX = STØRST ## Returnerer maksimumsverdien i en argumentliste -MAXA = MAKSA ## Returnerer maksimumsverdien i en argumentliste, inkludert tall, tekst og logiske verdier -MEDIAN = MEDIAN ## Returnerer medianen til tallene som er gitt -MIN = MIN ## Returnerer minimumsverdien i en argumentliste -MINA = MINA ## Returnerer den minste verdien i en argumentliste, inkludert tall, tekst og logiske verdier -MODE = MODUS ## Returnerer den vanligste verdien i et datasett -NEGBINOMDIST = NEGBINOM.FORDELING ## Returnerer den negative binomiske fordelingen -NORMDIST = NORMALFORDELING ## Returnerer den kumulative normalfordelingen -NORMINV = NORMINV ## Returnerer den inverse kumulative normalfordelingen -NORMSDIST = NORMSFORDELING ## Returnerer standard kumulativ normalfordeling -NORMSINV = NORMSINV ## Returnerer den inverse av den den kumulative standard normalfordelingen -PEARSON = PEARSON ## Returnerer produktmomentkorrelasjonskoeffisienten, Pearson -PERCENTILE = PERSENTIL ## Returnerer den n-te persentil av verdiene i et omrÃ¥de -PERCENTRANK = PROSENTDEL ## Returnerer prosentrangeringen av en verdi i et datasett -PERMUT = PERMUTER ## Returnerer antall permutasjoner for et gitt antall objekter -POISSON = POISSON ## Returnerer Poissons sannsynlighetsfordeling -PROB = SANNSYNLIG ## Returnerer sannsynligheten for at verdier i et omrÃ¥de ligger mellom to grenser -QUARTILE = KVARTIL ## Returnerer kvartilen til et datasett -RANK = RANG ## Returnerer rangeringen av et tall, eller plassen tallet har i en rekke -RSQ = RKVADRAT ## Returnerer kvadratet av produktmomentkorrelasjonskoeffisienten (Pearsons r) -SKEW = SKJEVFORDELING ## Returnerer skjevheten i en fordeling -SLOPE = STIGNINGSTALL ## Returnerer stigningtallet for den lineære regresjonslinjen -SMALL = N.MINST ## Returnerer den n-te minste verdien i et datasett -STANDARDIZE = NORMALISER ## Returnerer en normalisert verdi -STDEV = STDAV ## Estimere standardavvik pÃ¥ grunnlag av et utvalg -STDEVA = STDAVVIKA ## Estimerer standardavvik basert pÃ¥ et utvalg, inkludert tall, tekst og logiske verdier -STDEVP = STDAVP ## Beregner standardavvik basert pÃ¥ hele populasjonen -STDEVPA = STDAVVIKPA ## Beregner standardavvik basert pÃ¥ hele populasjonen, inkludert tall, tekst og logiske verdier -STEYX = STANDARDFEIL ## Returnerer standardfeilen for den predikerte y-verdien for hver x i regresjonen -TDIST = TFORDELING ## Returnerer en Student t-fordeling -TINV = TINV ## Returnerer den inverse Student t-fordelingen -TREND = TREND ## Returnerer verdier langs en lineær trend -TRIMMEAN = TRIMMET.GJENNOMSNITT ## Returnerer den interne middelverdien til et datasett -TTEST = TTEST ## Returnerer sannsynligheten assosiert med en Student t-test -VAR = VARIANS ## Estimerer varians basert pÃ¥ et utvalg -VARA = VARIANSA ## Estimerer varians basert pÃ¥ et utvalg, inkludert tall, tekst og logiske verdier -VARP = VARIANSP ## Beregner varians basert pÃ¥ hele populasjonen -VARPA = VARIANSPA ## Beregner varians basert pÃ¥ hele populasjonen, inkludert tall, tekst og logiske verdier -WEIBULL = WEIBULL.FORDELING ## Returnerer Weibull-fordelingen -ZTEST = ZTEST ## Returnerer den ensidige sannsynlighetsverdien for en z-test - - -## -## Text functions Tekstfunksjoner -## -ASC = STIGENDE ## Endrer fullbreddes (dobbeltbyte) engelske bokstaver eller katakana i en tegnstreng, til halvbreddes (enkeltbyte) tegn -BAHTTEXT = BAHTTEKST ## Konverterer et tall til tekst, og bruker valutaformatet ß (baht) -CHAR = TEGNKODE ## Returnerer tegnet som svarer til kodenummeret -CLEAN = RENSK ## Fjerner alle tegn som ikke kan skrives ut, fra teksten -CODE = KODE ## Returnerer en numerisk kode for det første tegnet i en tekststreng -CONCATENATE = KJEDE.SAMMEN ## SlÃ¥r sammen flere tekstelementer til ett tekstelement -DOLLAR = VALUTA ## Konverterer et tall til tekst, og bruker valutaformatet $ (dollar) -EXACT = EKSAKT ## Kontrollerer om to tekstverdier er like -FIND = FINN ## Finner en tekstverdi inne i en annen (skiller mellom store og smÃ¥ bokstaver) -FINDB = FINNB ## Finner en tekstverdi inne i en annen (skiller mellom store og smÃ¥ bokstaver) -FIXED = FASTSATT ## Formaterer et tall som tekst med et bestemt antall desimaler -JIS = JIS ## Endrer halvbreddes (enkeltbyte) engelske bokstaver eller katakana i en tegnstreng, til fullbreddes (dobbeltbyte) tegn -LEFT = VENSTRE ## Returnerer tegnene lengst til venstre i en tekstverdi -LEFTB = VENSTREB ## Returnerer tegnene lengst til venstre i en tekstverdi -LEN = LENGDE ## Returnerer antall tegn i en tekststreng -LENB = LENGDEB ## Returnerer antall tegn i en tekststreng -LOWER = SMÃ… ## Konverterer tekst til smÃ¥ bokstaver -MID = DELTEKST ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir -MIDB = DELTEKSTB ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir -PHONETIC = FURIGANA ## Trekker ut fonetiske tegn (furigana) fra en tekststreng -PROPER = STOR.FORBOKSTAV ## Gir den første bokstaven i hvert ord i en tekstverdi stor forbokstav -REPLACE = ERSTATT ## Erstatter tegn i en tekst -REPLACEB = ERSTATTB ## Erstatter tegn i en tekst -REPT = GJENTA ## Gjentar tekst et gitt antall ganger -RIGHT = HØYRE ## Returnerer tegnene lengst til høyre i en tekstverdi -RIGHTB = HØYREB ## Returnerer tegnene lengst til høyre i en tekstverdi -SEARCH = SØK ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og smÃ¥ bokstaver) -SEARCHB = SØKB ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og smÃ¥ bokstaver) -SUBSTITUTE = BYTT.UT ## Bytter ut gammel tekst med ny tekst i en tekststreng -T = T ## Konverterer argumentene til tekst -TEXT = TEKST ## Formaterer et tall og konverterer det til tekst -TRIM = TRIMME ## Fjerner mellomrom fra tekst -UPPER = STORE ## Konverterer tekst til store bokstaver -VALUE = VERDI ## Konverterer et tekstargument til et tall diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/config deleted file mode 100644 index ab8e092d35..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = zÅ‚ ## Not sure if it should be a € (Euro) - - -## -## Excel Error Codes (For future use) -## -NULL = #ZERO! -DIV0 = #DZIEL/0! -VALUE = #ARG! -REF = #ADR! -NAME = #NAZWA? -NUM = #LICZBA! -NA = #N/D! diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/functions deleted file mode 100644 index 55f0ae55ad..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pl/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/ -## -## - - -## -## Add-in and Automation functions Funkcje dodatków i automatyzacji -## -GETPIVOTDATA = WEŹDANETABELI ## Zwraca dane przechowywane w raporcie tabeli przestawnej. - - -## -## Cube functions Funkcje modułów -## -CUBEKPIMEMBER = ELEMENT.KPI.MODUÅU ## Zwraca nazwÄ™, wÅ‚aÅ›ciwość i miarÄ™ kluczowego wskaźnika wydajnoÅ›ci (KPI) oraz wyÅ›wietla nazwÄ™ i wÅ‚aÅ›ciwość w komórce. Wskaźnik KPI jest miarÄ… iloÅ›ciowÄ…, takÄ… jak miesiÄ™czny zysk brutto lub kwartalna fluktuacja pracowników, używanÄ… do monitorowania wydajnoÅ›ci organizacji. -CUBEMEMBER = ELEMENT.MODUÅU ## Zwraca element lub krotkÄ™ z hierarchii moduÅ‚u. SÅ‚uży do sprawdzania, czy element lub krotka istnieje w module. -CUBEMEMBERPROPERTY = WÅAÅšCIWOŚĆ.ELEMENTU.MODUÅU ## Zwraca wartość wÅ‚aÅ›ciwoÅ›ci elementu w module. SÅ‚uży do sprawdzania, czy nazwa elementu istnieje w module, i zwracania okreÅ›lonej wÅ‚aÅ›ciwoÅ›ci dla tego elementu. -CUBERANKEDMEMBER = USZEREGOWANY.ELEMENT.MODUÅU ## Zwraca n-ty (albo uszeregowany) element zestawu. SÅ‚uży do zwracania elementu lub elementów zestawu, na przykÅ‚ad najlepszego sprzedawcy lub 10 najlepszych studentów. -CUBESET = ZESTAW.MODUÅÓW ## Definiuje obliczony zestaw elementów lub krotek, wysyÅ‚ajÄ…c wyrażenie zestawu do serwera moduÅ‚u, który tworzy zestaw i zwraca go do programu Microsoft Office Excel. -CUBESETCOUNT = LICZNIK.MODUÅÓW.ZESTAWU ## Zwraca liczbÄ™ elementów zestawu. -CUBEVALUE = WARTOŚĆ.MODUÅU ## Zwraca zagregowanÄ… wartość z moduÅ‚u. - - -## -## Database functions Funkcje baz danych -## -DAVERAGE = BD.ÅšREDNIA ## Zwraca wartość Å›redniej wybranych wpisów bazy danych. -DCOUNT = BD.ILE.REKORDÓW ## Zlicza komórki zawierajÄ…ce liczby w bazie danych. -DCOUNTA = BD.ILE.REKORDÓW.A ## Zlicza niepuste komórki w bazie danych. -DGET = BD.POLE ## WyodrÄ™bnia z bazy danych jeden rekord speÅ‚niajÄ…cy okreÅ›lone kryteria. -DMAX = BD.MAX ## Zwraca wartość maksymalnÄ… z wybranych wpisów bazy danych. -DMIN = BD.MIN ## Zwraca wartość minimalnÄ… z wybranych wpisów bazy danych. -DPRODUCT = BD.ILOCZYN ## Mnoży wartoÅ›ci w konkretnym, speÅ‚niajÄ…cym kryteria polu rekordów bazy danych. -DSTDEV = BD.ODCH.STANDARD ## Szacuje odchylenie standardowe na podstawie próbki z wybranych wpisów bazy danych. -DSTDEVP = BD.ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie caÅ‚ej populacji wybranych wpisów bazy danych. -DSUM = BD.SUMA ## Dodaje liczby w kolumnie pól rekordów bazy danych, które speÅ‚niajÄ… kryteria. -DVAR = BD.WARIANCJA ## Szacuje wariancjÄ™ na podstawie próbki z wybranych wpisów bazy danych. -DVARP = BD.WARIANCJA.POPUL ## Oblicza wariancjÄ™ na podstawie caÅ‚ej populacji wybranych wpisów bazy danych. - - -## -## Date and time functions Funkcje dat, godzin i czasu -## -DATE = DATA ## Zwraca liczbÄ™ seryjnÄ… dla wybranej daty. -DATEVALUE = DATA.WARTOŚĆ ## Konwertuje datÄ™ w formie tekstu na liczbÄ™ seryjnÄ…. -DAY = DZIEŃ ## Konwertuje liczbÄ™ seryjnÄ… na dzieÅ„ miesiÄ…ca. -DAYS360 = DNI.360 ## Oblicza liczbÄ™ dni miÄ™dzy dwiema datami na podstawie roku 360-dniowego. -EDATE = UPÅDNI ## Zwraca liczbÄ™ seryjnÄ… daty jako wskazanÄ… liczbÄ™ miesiÄ™cy przed okreÅ›lonÄ… datÄ… poczÄ…tkowÄ… lub po niej. -EOMONTH = EOMONTH ## Zwraca liczbÄ™ seryjnÄ… ostatniego dnia miesiÄ…ca przed okreÅ›lonÄ… liczbÄ… miesiÄ™cy lub po niej. -HOUR = GODZINA ## Konwertuje liczbÄ™ seryjnÄ… na godzinÄ™. -MINUTE = MINUTA ## Konwertuje liczbÄ™ seryjnÄ… na minutÄ™. -MONTH = MIESIÄ„C ## Konwertuje liczbÄ™ seryjnÄ… na miesiÄ…c. -NETWORKDAYS = NETWORKDAYS ## Zwraca liczbÄ™ peÅ‚nych dni roboczych miÄ™dzy dwiema datami. -NOW = TERAZ ## Zwraca liczbÄ™ seryjnÄ… bieżącej daty i godziny. -SECOND = SEKUNDA ## Konwertuje liczbÄ™ seryjnÄ… na sekundÄ™. -TIME = CZAS ## Zwraca liczbÄ™ seryjnÄ… okreÅ›lonego czasu. -TIMEVALUE = CZAS.WARTOŚĆ ## Konwertuje czas w formie tekstu na liczbÄ™ seryjnÄ…. -TODAY = DZIÅš ## Zwraca liczbÄ™ seryjnÄ… dla daty bieżącej. -WEEKDAY = DZIEŃ.TYG ## Konwertuje liczbÄ™ seryjnÄ… na dzieÅ„ tygodnia. -WEEKNUM = WEEKNUM ## Konwertuje liczbÄ™ seryjnÄ… na liczbÄ™ reprezentujÄ…cÄ… numer tygodnia w roku. -WORKDAY = WORKDAY ## Zwraca liczbÄ™ seryjnÄ… dla daty przed okreÅ›lonÄ… liczbÄ… dni roboczych lub po niej. -YEAR = ROK ## Konwertuje liczbÄ™ seryjnÄ… na rok. -YEARFRAC = YEARFRAC ## Zwraca część roku reprezentowanÄ… przez peÅ‚nÄ… liczbÄ™ dni miÄ™dzy datÄ… poczÄ…tkowÄ… a datÄ… koÅ„cowÄ…. - - -## -## Engineering functions Funkcje inżynierskie -## -BESSELI = BESSELI ## Zwraca wartość zmodyfikowanej funkcji Bessela In(x). -BESSELJ = BESSELJ ## Zwraca wartość funkcji Bessela Jn(x). -BESSELK = BESSELK ## Zwraca wartość zmodyfikowanej funkcji Bessela Kn(x). -BESSELY = BESSELY ## Zwraca wartość funkcji Bessela Yn(x). -BIN2DEC = BIN2DEC ## Konwertuje liczbÄ™ w postaci dwójkowej na liczbÄ™ w postaci dziesiÄ™tnej. -BIN2HEX = BIN2HEX ## Konwertuje liczbÄ™ w postaci dwójkowej na liczbÄ™ w postaci szesnastkowej. -BIN2OCT = BIN2OCT ## Konwertuje liczbÄ™ w postaci dwójkowej na liczbÄ™ w postaci ósemkowej. -COMPLEX = COMPLEX ## Konwertuje część rzeczywistÄ… i urojonÄ… na liczbÄ™ zespolonÄ…. -CONVERT = CONVERT ## Konwertuje liczbÄ™ z jednego systemu miar na inny. -DEC2BIN = DEC2BIN ## Konwertuje liczbÄ™ w postaci dziesiÄ™tnej na postać dwójkowÄ…. -DEC2HEX = DEC2HEX ## Konwertuje liczbÄ™ w postaci dziesiÄ™tnej na liczbÄ™ w postaci szesnastkowej. -DEC2OCT = DEC2OCT ## Konwertuje liczbÄ™ w postaci dziesiÄ™tnej na liczbÄ™ w postaci ósemkowej. -DELTA = DELTA ## Sprawdza, czy dwie wartoÅ›ci sÄ… równe. -ERF = ERF ## Zwraca wartość funkcji błędu. -ERFC = ERFC ## Zwraca wartość komplementarnej funkcji błędu. -GESTEP = GESTEP ## Sprawdza, czy liczba jest wiÄ™ksza niż wartość progowa. -HEX2BIN = HEX2BIN ## Konwertuje liczbÄ™ w postaci szesnastkowej na liczbÄ™ w postaci dwójkowej. -HEX2DEC = HEX2DEC ## Konwertuje liczbÄ™ w postaci szesnastkowej na liczbÄ™ w postaci dziesiÄ™tnej. -HEX2OCT = HEX2OCT ## Konwertuje liczbÄ™ w postaci szesnastkowej na liczbÄ™ w postaci ósemkowej. -IMABS = IMABS ## Zwraca wartość bezwzglÄ™dnÄ… (moduÅ‚) liczby zespolonej. -IMAGINARY = IMAGINARY ## Zwraca wartość części urojonej liczby zespolonej. -IMARGUMENT = IMARGUMENT ## Zwraca wartość argumentu liczby zespolonej, przy czym kÄ…t wyrażony jest w radianach. -IMCONJUGATE = IMCONJUGATE ## Zwraca wartość liczby sprzężonej danej liczby zespolonej. -IMCOS = IMCOS ## Zwraca wartość cosinusa liczby zespolonej. -IMDIV = IMDIV ## Zwraca wartość ilorazu dwóch liczb zespolonych. -IMEXP = IMEXP ## Zwraca postać wykÅ‚adniczÄ… liczby zespolonej. -IMLN = IMLN ## Zwraca wartość logarytmu naturalnego liczby zespolonej. -IMLOG10 = IMLOG10 ## Zwraca wartość logarytmu dziesiÄ™tnego liczby zespolonej. -IMLOG2 = IMLOG2 ## Zwraca wartość logarytmu liczby zespolonej przy podstawie 2. -IMPOWER = IMPOWER ## Zwraca wartość liczby zespolonej podniesionej do potÄ™gi caÅ‚kowitej. -IMPRODUCT = IMPRODUCT ## Zwraca wartość iloczynu liczb zespolonych. -IMREAL = IMREAL ## Zwraca wartość części rzeczywistej liczby zespolonej. -IMSIN = IMSIN ## Zwraca wartość sinusa liczby zespolonej. -IMSQRT = IMSQRT ## Zwraca wartość pierwiastka kwadratowego z liczby zespolonej. -IMSUB = IMSUB ## Zwraca wartość różnicy dwóch liczb zespolonych. -IMSUM = IMSUM ## Zwraca wartość sumy liczb zespolonych. -OCT2BIN = OCT2BIN ## Konwertuje liczbÄ™ w postaci ósemkowej na liczbÄ™ w postaci dwójkowej. -OCT2DEC = OCT2DEC ## Konwertuje liczbÄ™ w postaci ósemkowej na liczbÄ™ w postaci dziesiÄ™tnej. -OCT2HEX = OCT2HEX ## Konwertuje liczbÄ™ w postaci ósemkowej na liczbÄ™ w postaci szesnastkowej. - - -## -## Financial functions Funkcje finansowe -## -ACCRINT = ACCRINT ## Zwraca narosÅ‚e odsetki dla papieru wartoÅ›ciowego z oprocentowaniem okresowym. -ACCRINTM = ACCRINTM ## Zwraca narosÅ‚e odsetki dla papieru wartoÅ›ciowego z oprocentowaniem w terminie wykupu. -AMORDEGRC = AMORDEGRC ## Zwraca amortyzacjÄ™ dla każdego okresu rozliczeniowego z wykorzystaniem współczynnika amortyzacji. -AMORLINC = AMORLINC ## Zwraca amortyzacjÄ™ dla każdego okresu rozliczeniowego. -COUPDAYBS = COUPDAYBS ## Zwraca liczbÄ™ dni od poczÄ…tku okresu dywidendy do dnia rozliczeniowego. -COUPDAYS = COUPDAYS ## Zwraca liczbÄ™ dni w okresie dywidendy, z uwzglÄ™dnieniem dnia rozliczeniowego. -COUPDAYSNC = COUPDAYSNC ## Zwraca liczbÄ™ dni od dnia rozliczeniowego do daty nastÄ™pnego dnia dywidendy. -COUPNCD = COUPNCD ## Zwraca dzieÅ„ nastÄ™pnej dywidendy po dniu rozliczeniowym. -COUPNUM = COUPNUM ## Zwraca liczbÄ™ dywidend pÅ‚atnych miÄ™dzy dniem rozliczeniowym a dniem wykupu. -COUPPCD = COUPPCD ## Zwraca dzieÅ„ poprzedniej dywidendy przed dniem rozliczeniowym. -CUMIPMT = CUMIPMT ## Zwraca wartość procentu skÅ‚adanego pÅ‚atnego miÄ™dzy dwoma okresami. -CUMPRINC = CUMPRINC ## Zwraca wartość kapitaÅ‚u skumulowanego spÅ‚aty pożyczki miÄ™dzy dwoma okresami. -DB = DB ## Zwraca amortyzacjÄ™ Å›rodka trwaÅ‚ego w danym okresie metodÄ… degresywnÄ… z zastosowaniem staÅ‚ej bazowej. -DDB = DDB ## Zwraca amortyzacjÄ™ Å›rodka trwaÅ‚ego za podany okres metodÄ… degresywnÄ… z zastosowaniem podwójnej bazowej lub metodÄ… okreÅ›lonÄ… przez użytkownika. -DISC = DISC ## Zwraca wartość stopy dyskontowej papieru wartoÅ›ciowego. -DOLLARDE = DOLLARDE ## Konwertuje cenÄ™ w postaci uÅ‚amkowej na cenÄ™ wyrażonÄ… w postaci dziesiÄ™tnej. -DOLLARFR = DOLLARFR ## Konwertuje cenÄ™ wyrażonÄ… w postaci dziesiÄ™tnej na cenÄ™ wyrażonÄ… w postaci uÅ‚amkowej. -DURATION = DURATION ## Zwraca wartość rocznego przychodu z papieru wartoÅ›ciowego o okresowych wypÅ‚atach oprocentowania. -EFFECT = EFFECT ## Zwraca wartość efektywnej rocznej stopy procentowej. -FV = FV ## Zwraca przyszłą wartość lokaty. -FVSCHEDULE = FVSCHEDULE ## Zwraca przyszłą wartość kapitaÅ‚u poczÄ…tkowego wraz z szeregiem procentów skÅ‚adanych. -INTRATE = INTRATE ## Zwraca wartość stopy procentowej papieru wartoÅ›ciowego caÅ‚kowicie ulokowanego. -IPMT = IPMT ## Zwraca wysokość spÅ‚aty oprocentowania lokaty za dany okres. -IRR = IRR ## Zwraca wartość wewnÄ™trznej stopy zwrotu dla serii przepÅ‚ywów gotówkowych. -ISPMT = ISPMT ## Oblicza wysokość spÅ‚aty oprocentowania za dany okres lokaty. -MDURATION = MDURATION ## Zwraca wartość zmodyfikowanego okresu Macauleya dla papieru wartoÅ›ciowego o zaÅ‚ożonej wartoÅ›ci nominalnej 100 zÅ‚. -MIRR = MIRR ## Zwraca wartość wewnÄ™trznej stopy zwrotu dla przypadku, gdy dodatnie i ujemne przepÅ‚ywy gotówkowe majÄ… różne stopy. -NOMINAL = NOMINAL ## Zwraca wysokość nominalnej rocznej stopy procentowej. -NPER = NPER ## Zwraca liczbÄ™ okresów dla lokaty. -NPV = NPV ## Zwraca wartość bieżącÄ… netto lokaty na podstawie szeregu okresowych przepÅ‚ywów gotówkowych i stopy dyskontowej. -ODDFPRICE = ODDFPRICE ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej papieru wartoÅ›ciowego z nietypowym pierwszym okresem. -ODDFYIELD = ODDFYIELD ## Zwraca rentowność papieru wartoÅ›ciowego z nietypowym pierwszym okresem. -ODDLPRICE = ODDLPRICE ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej papieru wartoÅ›ciowego z nietypowym ostatnim okresem. -ODDLYIELD = ODDLYIELD ## Zwraca rentowność papieru wartoÅ›ciowego z nietypowym ostatnim okresem. -PMT = PMT ## Zwraca wartość okresowej pÅ‚atnoÅ›ci raty rocznej. -PPMT = PPMT ## Zwraca wysokość spÅ‚aty kapitaÅ‚u w przypadku lokaty dla danego okresu. -PRICE = PRICE ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej papieru wartoÅ›ciowego z oprocentowaniem okresowym. -PRICEDISC = PRICEDISC ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej papieru wartoÅ›ciowego zdyskontowanego. -PRICEMAT = PRICEMAT ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej papieru wartoÅ›ciowego z oprocentowaniem w terminie wykupu. -PV = PV ## Zwraca wartość bieżącÄ… lokaty. -RATE = RATE ## Zwraca wysokość stopy procentowej w okresie raty rocznej. -RECEIVED = RECEIVED ## Zwraca wartość kapitaÅ‚u otrzymanego przy wykupie papieru wartoÅ›ciowego caÅ‚kowicie ulokowanego. -SLN = SLN ## Zwraca amortyzacjÄ™ Å›rodka trwaÅ‚ego za jeden okres metodÄ… liniowÄ…. -SYD = SYD ## Zwraca amortyzacjÄ™ Å›rodka trwaÅ‚ego za dany okres metodÄ… sumy cyfr lat amortyzacji. -TBILLEQ = TBILLEQ ## Zwraca rentowność ekwiwalentu obligacji dla bonu skarbowego. -TBILLPRICE = TBILLPRICE ## Zwraca cenÄ™ za 100 zÅ‚ wartoÅ›ci nominalnej bonu skarbowego. -TBILLYIELD = TBILLYIELD ## Zwraca rentowność bonu skarbowego. -VDB = VDB ## Oblicza amortyzacjÄ™ Å›rodka trwaÅ‚ego w danym okresie lub jego części metodÄ… degresywnÄ…. -XIRR = XIRR ## Zwraca wartość wewnÄ™trznej stopy zwrotu dla serii rozÅ‚ożonych w czasie przepÅ‚ywów gotówkowych, niekoniecznie okresowych. -XNPV = XNPV ## Zwraca wartość bieżącÄ… netto dla serii rozÅ‚ożonych w czasie przepÅ‚ywów gotówkowych, niekoniecznie okresowych. -YIELD = YIELD ## Zwraca rentowność papieru wartoÅ›ciowego z oprocentowaniem okresowym. -YIELDDISC = YIELDDISC ## Zwraca rocznÄ… rentowność zdyskontowanego papieru wartoÅ›ciowego, na przykÅ‚ad bonu skarbowego. -YIELDMAT = YIELDMAT ## Zwraca rocznÄ… rentowność papieru wartoÅ›ciowego oprocentowanego przy wykupie. - - -## -## Information functions Funkcje informacyjne -## -CELL = KOMÓRKA ## Zwraca informacje o formacie, poÅ‚ożeniu lub zawartoÅ›ci komórki. -ERROR.TYPE = NR.BÅĘDU ## Zwraca liczbÄ™ odpowiadajÄ…cÄ… typowi błędu. -INFO = INFO ## Zwraca informacjÄ™ o aktualnym Å›rodowisku pracy. -ISBLANK = CZY.PUSTA ## Zwraca wartość PRAWDA, jeÅ›li wartość jest pusta. -ISERR = CZY.BÅ ## Zwraca wartość PRAWDA, jeÅ›li wartość jest dowolnÄ… wartoÅ›ciÄ… błędu, z wyjÄ…tkiem #N/D!. -ISERROR = CZY.BÅÄ„D ## Zwraca wartość PRAWDA, jeÅ›li wartość jest dowolnÄ… wartoÅ›ciÄ… błędu. -ISEVEN = ISEVEN ## Zwraca wartość PRAWDA, jeÅ›li liczba jest parzysta. -ISLOGICAL = CZY.LOGICZNA ## Zwraca wartość PRAWDA, jeÅ›li wartość jest wartoÅ›ciÄ… logicznÄ…. -ISNA = CZY.BRAK ## Zwraca wartość PRAWDA, jeÅ›li wartość jest wartoÅ›ciÄ… błędu #N/D!. -ISNONTEXT = CZY.NIE.TEKST ## Zwraca wartość PRAWDA, jeÅ›li wartość nie jest tekstem. -ISNUMBER = CZY.LICZBA ## Zwraca wartość PRAWDA, jeÅ›li wartość jest liczbÄ…. -ISODD = ISODD ## Zwraca wartość PRAWDA, jeÅ›li liczba jest nieparzysta. -ISREF = CZY.ADR ## Zwraca wartość PRAWDA, jeÅ›li wartość jest odwoÅ‚aniem. -ISTEXT = CZY.TEKST ## Zwraca wartość PRAWDA, jeÅ›li wartość jest tekstem. -N = L ## Zwraca wartość przekonwertowanÄ… na postać liczbowÄ…. -NA = BRAK ## Zwraca wartość błędu #N/D!. -TYPE = TYP ## Zwraca liczbÄ™ wskazujÄ…cÄ… typ danych wartoÅ›ci. - - -## -## Logical functions Funkcje logiczne -## -AND = ORAZ ## Zwraca wartość PRAWDA, jeÅ›li wszystkie argumenty majÄ… wartość PRAWDA. -FALSE = FAÅSZ ## Zwraca wartość logicznÄ… FAÅSZ. -IF = JEÅ»ELI ## OkreÅ›la warunek logiczny do sprawdzenia. -IFERROR = JEÅ»ELI.BÅÄ„D ## Zwraca okreÅ›lonÄ… wartość, jeÅ›li wynikiem obliczenia formuÅ‚y jest błąd; w przeciwnym przypadku zwraca wynik formuÅ‚y. -NOT = NIE ## Odwraca wartość logicznÄ… argumentu. -OR = LUB ## Zwraca wartość PRAWDA, jeÅ›li co najmniej jeden z argumentów ma wartość PRAWDA. -TRUE = PRAWDA ## Zwraca wartość logicznÄ… PRAWDA. - - -## -## Lookup and reference functions Funkcje wyszukiwania i odwoÅ‚aÅ„ -## -ADDRESS = ADRES ## Zwraca odwoÅ‚anie do jednej komórki w arkuszu jako wartość tekstowÄ…. -AREAS = OBSZARY ## Zwraca liczbÄ™ obszarów wystÄ™pujÄ…cych w odwoÅ‚aniu. -CHOOSE = WYBIERZ ## Wybiera wartość z listy wartoÅ›ci. -COLUMN = NR.KOLUMNY ## Zwraca numer kolumny z odwoÅ‚ania. -COLUMNS = LICZBA.KOLUMN ## Zwraca liczbÄ™ kolumn dla danego odwoÅ‚ania. -HLOOKUP = WYSZUKAJ.POZIOMO ## PrzeglÄ…da górny wiersz tablicy i zwraca wartość wskazanej komórki. -HYPERLINK = HIPERÅÄ„CZE ## Tworzy skrót lub skok, który pozwala otwierać dokument przechowywany na serwerze sieciowym, w sieci intranet lub w Internecie. -INDEX = INDEKS ## Używa indeksu do wybierania wartoÅ›ci z odwoÅ‚ania lub tablicy. -INDIRECT = ADR.POÅšR ## Zwraca odwoÅ‚anie okreÅ›lone przez wartość tekstowÄ…. -LOOKUP = WYSZUKAJ ## Wyszukuje wartoÅ›ci w wektorze lub tablicy. -MATCH = PODAJ.POZYCJĘ ## Wyszukuje wartoÅ›ci w odwoÅ‚aniu lub w tablicy. -OFFSET = PRZESUNIĘCIE ## Zwraca adres przesuniÄ™ty od danego odwoÅ‚ania. -ROW = WIERSZ ## Zwraca numer wiersza odwoÅ‚ania. -ROWS = ILE.WIERSZY ## Zwraca liczbÄ™ wierszy dla danego odwoÅ‚ania. -RTD = RTD ## Pobiera dane w czasie rzeczywistym z programu obsÅ‚ugujÄ…cego automatyzacjÄ™ COM (Automatyzacja: Sposób pracy z obiektami aplikacji pochodzÄ…cymi z innej aplikacji lub narzÄ™dzia projektowania. Nazywana wczeÅ›niej AutomatyzacjÄ… OLE, Automatyzacja jest standardem przemysÅ‚owym i funkcjÄ… obiektowego modelu skÅ‚adników (COM, Component Object Model).). -TRANSPOSE = TRANSPONUJ ## Zwraca transponowanÄ… tablicÄ™. -VLOOKUP = WYSZUKAJ.PIONOWO ## Przeszukuje pierwszÄ… kolumnÄ™ tablicy i przechodzi wzdÅ‚uż wiersza, aby zwrócić wartość komórki. - - -## -## Math and trigonometry functions Funkcje matematyczne i trygonometryczne -## -ABS = MODUÅ.LICZBY ## Zwraca wartość absolutnÄ… liczby. -ACOS = ACOS ## Zwraca arcus cosinus liczby. -ACOSH = ACOSH ## Zwraca arcus cosinus hiperboliczny liczby. -ASIN = ASIN ## Zwraca arcus sinus liczby. -ASINH = ASINH ## Zwraca arcus sinus hiperboliczny liczby. -ATAN = ATAN ## Zwraca arcus tangens liczby. -ATAN2 = ATAN2 ## Zwraca arcus tangens liczby na podstawie współrzÄ™dnych x i y. -ATANH = ATANH ## Zwraca arcus tangens hiperboliczny liczby. -CEILING = ZAOKR.W.GÓRĘ ## ZaokrÄ…gla liczbÄ™ do najbliższej liczby caÅ‚kowitej lub do najbliższej wielokrotnoÅ›ci dokÅ‚adnoÅ›ci. -COMBIN = KOMBINACJE ## Zwraca liczbÄ™ kombinacji dla danej liczby obiektów. -COS = COS ## Zwraca cosinus liczby. -COSH = COSH ## Zwraca cosinus hiperboliczny liczby. -DEGREES = STOPNIE ## Konwertuje radiany na stopnie. -EVEN = ZAOKR.DO.PARZ ## ZaokrÄ…gla liczbÄ™ w górÄ™ do najbliższej liczby parzystej. -EXP = EXP ## Zwraca wartość liczby e podniesionej do potÄ™gi okreÅ›lonej przez podanÄ… liczbÄ™. -FACT = SILNIA ## Zwraca silniÄ™ liczby. -FACTDOUBLE = FACTDOUBLE ## Zwraca podwójnÄ… silniÄ™ liczby. -FLOOR = ZAOKR.W.DÓŠ## ZaokrÄ…gla liczbÄ™ w dół, w kierunku zera. -GCD = GCD ## Zwraca najwiÄ™kszy wspólny dzielnik. -INT = ZAOKR.DO.CAÅK ## ZaokrÄ…gla liczbÄ™ w dół do najbliższej liczby caÅ‚kowitej. -LCM = LCM ## Zwraca najmniejszÄ… wspólnÄ… wielokrotność. -LN = LN ## Zwraca logarytm naturalny podanej liczby. -LOG = LOG ## Zwraca logarytm danej liczby przy zadanej podstawie. -LOG10 = LOG10 ## Zwraca logarytm dziesiÄ™tny liczby. -MDETERM = WYZNACZNIK.MACIERZY ## Zwraca wyznacznik macierzy tablicy. -MINVERSE = MACIERZ.ODW ## Zwraca odwrotność macierzy tablicy. -MMULT = MACIERZ.ILOCZYN ## Zwraca iloczyn macierzy dwóch tablic. -MOD = MOD ## Zwraca resztÄ™ z dzielenia. -MROUND = MROUND ## Zwraca liczbÄ™ zaokrÄ…glonÄ… do żądanej wielokrotnoÅ›ci. -MULTINOMIAL = MULTINOMIAL ## Zwraca wielomian dla zbioru liczb. -ODD = ZAOKR.DO.NPARZ ## ZaokrÄ…gla liczbÄ™ w górÄ™ do najbliższej liczby nieparzystej. -PI = PI ## Zwraca wartość liczby Pi. -POWER = POTĘGA ## Zwraca liczbÄ™ podniesionÄ… do potÄ™gi. -PRODUCT = ILOCZYN ## Mnoży argumenty. -QUOTIENT = QUOTIENT ## Zwraca iloraz (caÅ‚kowity). -RADIANS = RADIANY ## Konwertuje stopnie na radiany. -RAND = LOS ## Zwraca liczbÄ™ pseudolosowÄ… z zakresu od 0 do 1. -RANDBETWEEN = RANDBETWEEN ## Zwraca liczbÄ™ pseudolosowÄ… z zakresu okreÅ›lonego przez podane argumenty. -ROMAN = RZYMSKIE ## Konwertuje liczbÄ™ arabskÄ… na rzymskÄ… jako tekst. -ROUND = ZAOKR ## ZaokrÄ…gla liczbÄ™ do okreÅ›lonej liczby cyfr. -ROUNDDOWN = ZAOKR.DÓŠ## ZaokrÄ…gla liczbÄ™ w dół, w kierunku zera. -ROUNDUP = ZAOKR.GÓRA ## ZaokrÄ…gla liczbÄ™ w górÄ™, w kierunku od zera. -SERIESSUM = SERIESSUM ## Zwraca sumÄ™ szeregu potÄ™gowego na podstawie wzoru. -SIGN = ZNAK.LICZBY ## Zwraca znak liczby. -SIN = SIN ## Zwraca sinus danego kÄ…ta. -SINH = SINH ## Zwraca sinus hiperboliczny liczby. -SQRT = PIERWIASTEK ## Zwraca dodatni pierwiastek kwadratowy. -SQRTPI = SQRTPI ## Zwraca pierwiastek kwadratowy iloczynu (liczba * Pi). -SUBTOTAL = SUMY.POÅšREDNIE ## Zwraca sumÄ™ częściowÄ… listy lub bazy danych. -SUM = SUMA ## Dodaje argumenty. -SUMIF = SUMA.JEÅ»ELI ## Dodaje komórki okreÅ›lone przez podane kryterium. -SUMIFS = SUMA.WARUNKÓW ## Dodaje komórki w zakresie, które speÅ‚niajÄ… wiele kryteriów. -SUMPRODUCT = SUMA.ILOCZYNÓW ## Zwraca sumÄ™ iloczynów odpowiednich elementów tablicy. -SUMSQ = SUMA.KWADRATÓW ## Zwraca sumÄ™ kwadratów argumentów. -SUMX2MY2 = SUMA.X2.M.Y2 ## Zwraca sumÄ™ różnic kwadratów odpowiednich wartoÅ›ci w dwóch tablicach. -SUMX2PY2 = SUMA.X2.P.Y2 ## Zwraca sumÄ™ sum kwadratów odpowiednich wartoÅ›ci w dwóch tablicach. -SUMXMY2 = SUMA.XMY.2 ## Zwraca sumÄ™ kwadratów różnic odpowiednich wartoÅ›ci w dwóch tablicach. -TAN = TAN ## Zwraca tangens liczby. -TANH = TANH ## Zwraca tangens hiperboliczny liczby. -TRUNC = LICZBA.CAÅK ## Przycina liczbÄ™ do wartoÅ›ci caÅ‚kowitej. - - -## -## Statistical functions Funkcje statystyczne -## -AVEDEV = ODCH.ÅšREDNIE ## Zwraca Å›redniÄ… wartość odchyleÅ„ absolutnych punktów danych od ich wartoÅ›ci Å›redniej. -AVERAGE = ÅšREDNIA ## Zwraca wartość Å›redniÄ… argumentów. -AVERAGEA = ÅšREDNIA.A ## Zwraca wartość Å›redniÄ… argumentów, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -AVERAGEIF = ÅšREDNIA.JEÅ»ELI ## Zwraca Å›redniÄ… (Å›redniÄ… arytmetycznÄ…) wszystkich komórek w zakresie, które speÅ‚niajÄ… podane kryteria. -AVERAGEIFS = ÅšREDNIA.WARUNKÓW ## Zwraca Å›redniÄ… (Å›redniÄ… arytmetycznÄ…) wszystkich komórek, które speÅ‚niajÄ… jedno lub wiÄ™cej kryteriów. -BETADIST = ROZKÅAD.BETA ## Zwraca skumulowanÄ… funkcjÄ™ gÄ™stoÅ›ci prawdopodobieÅ„stwa beta. -BETAINV = ROZKÅAD.BETA.ODW ## Zwraca odwrotność skumulowanej funkcji gÄ™stoÅ›ci prawdopodobieÅ„stwa beta. -BINOMDIST = ROZKÅAD.DWUM ## Zwraca pojedynczy skÅ‚adnik dwumianowego rozkÅ‚adu prawdopodobieÅ„stwa. -CHIDIST = ROZKÅAD.CHI ## Zwraca wartość jednostronnego prawdopodobieÅ„stwa rozkÅ‚adu chi-kwadrat. -CHIINV = ROZKÅAD.CHI.ODW ## Zwraca odwrotność wartoÅ›ci jednostronnego prawdopodobieÅ„stwa rozkÅ‚adu chi-kwadrat. -CHITEST = TEST.CHI ## Zwraca test niezależnoÅ›ci. -CONFIDENCE = UFNOŚĆ ## Zwraca interwaÅ‚ ufnoÅ›ci dla Å›redniej populacji. -CORREL = WSP.KORELACJI ## Zwraca współczynnik korelacji dwóch zbiorów danych. -COUNT = ILE.LICZB ## Zlicza liczby znajdujÄ…ce siÄ™ na liÅ›cie argumentów. -COUNTA = ILE.NIEPUSTYCH ## Zlicza wartoÅ›ci znajdujÄ…ce siÄ™ na liÅ›cie argumentów. -COUNTBLANK = LICZ.PUSTE ## Zwraca liczbÄ™ pustych komórek w pewnym zakresie. -COUNTIF = LICZ.JEÅ»ELI ## Zlicza komórki wewnÄ…trz zakresu, które speÅ‚niajÄ… podane kryteria. -COUNTIFS = LICZ.WARUNKI ## Zlicza komórki wewnÄ…trz zakresu, które speÅ‚niajÄ… wiele kryteriów. -COVAR = KOWARIANCJA ## Zwraca kowariancjÄ™, czyli Å›redniÄ… wartość iloczynów odpowiednich odchyleÅ„. -CRITBINOM = PRÓG.ROZKÅAD.DWUM ## Zwraca najmniejszÄ… wartość, dla której skumulowany rozkÅ‚ad dwumianowy jest mniejszy niż wartość kryterium lub równy jej. -DEVSQ = ODCH.KWADRATOWE ## Zwraca sumÄ™ kwadratów odchyleÅ„. -EXPONDIST = ROZKÅAD.EXP ## Zwraca rozkÅ‚ad wykÅ‚adniczy. -FDIST = ROZKÅAD.F ## Zwraca rozkÅ‚ad prawdopodobieÅ„stwa F. -FINV = ROZKÅAD.F.ODW ## Zwraca odwrotność rozkÅ‚adu prawdopodobieÅ„stwa F. -FISHER = ROZKÅAD.FISHER ## Zwraca transformacjÄ™ Fishera. -FISHERINV = ROZKÅAD.FISHER.ODW ## Zwraca odwrotność transformacji Fishera. -FORECAST = REGLINX ## Zwraca wartość trendu liniowego. -FREQUENCY = CZĘSTOŚĆ ## Zwraca rozkÅ‚ad czÄ™stotliwoÅ›ci jako tablicÄ™ pionowÄ…. -FTEST = TEST.F ## Zwraca wynik testu F. -GAMMADIST = ROZKÅAD.GAMMA ## Zwraca rozkÅ‚ad gamma. -GAMMAINV = ROZKÅAD.GAMMA.ODW ## Zwraca odwrotność skumulowanego rozkÅ‚adu gamma. -GAMMALN = ROZKÅAD.LIN.GAMMA ## Zwraca logarytm naturalny funkcji gamma, Γ(x). -GEOMEAN = ÅšREDNIA.GEOMETRYCZNA ## Zwraca Å›redniÄ… geometrycznÄ…. -GROWTH = REGEXPW ## Zwraca wartoÅ›ci trendu wykÅ‚adniczego. -HARMEAN = ÅšREDNIA.HARMONICZNA ## Zwraca Å›redniÄ… harmonicznÄ…. -HYPGEOMDIST = ROZKÅAD.HIPERGEOM ## Zwraca rozkÅ‚ad hipergeometryczny. -INTERCEPT = ODCIĘTA ## Zwraca punkt przeciÄ™cia osi pionowej z liniÄ… regresji liniowej. -KURT = KURTOZA ## Zwraca kurtozÄ™ zbioru danych. -LARGE = MAX.K ## Zwraca k-tÄ… najwiÄ™kszÄ… wartość ze zbioru danych. -LINEST = REGLINP ## Zwraca parametry trendu liniowego. -LOGEST = REGEXPP ## Zwraca parametry trendu wykÅ‚adniczego. -LOGINV = ROZKÅAD.LOG.ODW ## Zwraca odwrotność rozkÅ‚adu logarytmu naturalnego. -LOGNORMDIST = ROZKÅAD.LOG ## Zwraca skumulowany rozkÅ‚ad logarytmu naturalnego. -MAX = MAX ## Zwraca maksymalnÄ… wartość listy argumentów. -MAXA = MAX.A ## Zwraca maksymalnÄ… wartość listy argumentów, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -MEDIAN = MEDIANA ## Zwraca medianÄ™ podanych liczb. -MIN = MIN ## Zwraca minimalnÄ… wartość listy argumentów. -MINA = MIN.A ## Zwraca najmniejszÄ… wartość listy argumentów, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -MODE = WYST.NAJCZĘŚCIEJ ## Zwraca wartość najczęściej wystÄ™pujÄ…cÄ… w zbiorze danych. -NEGBINOMDIST = ROZKÅAD.DWUM.PRZEC ## Zwraca ujemny rozkÅ‚ad dwumianowy. -NORMDIST = ROZKÅAD.NORMALNY ## Zwraca rozkÅ‚ad normalny skumulowany. -NORMINV = ROZKÅAD.NORMALNY.ODW ## Zwraca odwrotność rozkÅ‚adu normalnego skumulowanego. -NORMSDIST = ROZKÅAD.NORMALNY.S ## Zwraca standardowy rozkÅ‚ad normalny skumulowany. -NORMSINV = ROZKÅAD.NORMALNY.S.ODW ## Zwraca odwrotność standardowego rozkÅ‚adu normalnego skumulowanego. -PEARSON = PEARSON ## Zwraca współczynnik korelacji momentu iloczynu Pearsona. -PERCENTILE = PERCENTYL ## Wyznacza k-ty percentyl wartoÅ›ci w zakresie. -PERCENTRANK = PROCENT.POZYCJA ## Zwraca procentowÄ… pozycjÄ™ wartoÅ›ci w zbiorze danych. -PERMUT = PERMUTACJE ## Zwraca liczbÄ™ permutacji dla danej liczby obiektów. -POISSON = ROZKÅAD.POISSON ## Zwraca rozkÅ‚ad Poissona. -PROB = PRAWDPD ## Zwraca prawdopodobieÅ„stwo, że wartoÅ›ci w zakresie leżą pomiÄ™dzy dwiema granicami. -QUARTILE = KWARTYL ## Wyznacza kwartyl zbioru danych. -RANK = POZYCJA ## Zwraca pozycjÄ™ liczby na liÅ›cie liczb. -RSQ = R.KWADRAT ## Zwraca kwadrat współczynnika korelacji momentu iloczynu Pearsona. -SKEW = SKOÅšNOŚĆ ## Zwraca skoÅ›ność rozkÅ‚adu. -SLOPE = NACHYLENIE ## Zwraca nachylenie linii regresji liniowej. -SMALL = MIN.K ## Zwraca k-tÄ… najmniejszÄ… wartość ze zbioru danych. -STANDARDIZE = NORMALIZUJ ## Zwraca wartość znormalizowanÄ…. -STDEV = ODCH.STANDARDOWE ## Szacuje odchylenie standardowe na podstawie próbki. -STDEVA = ODCH.STANDARDOWE.A ## Szacuje odchylenie standardowe na podstawie próbki, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -STDEVP = ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie caÅ‚ej populacji. -STDEVPA = ODCH.STANDARD.POPUL.A ## Oblicza odchylenie standardowe na podstawie caÅ‚ej populacji, z uwzglÄ™dnieniem liczb, teksów i wartoÅ›ci logicznych. -STEYX = REGBÅSTD ## Zwraca błąd standardowy przewidzianej wartoÅ›ci y dla każdej wartoÅ›ci x w regresji. -TDIST = ROZKÅAD.T ## Zwraca rozkÅ‚ad t-Studenta. -TINV = ROZKÅAD.T.ODW ## Zwraca odwrotność rozkÅ‚adu t-Studenta. -TREND = REGLINW ## Zwraca wartoÅ›ci trendu liniowego. -TRIMMEAN = ÅšREDNIA.WEWN ## Zwraca Å›redniÄ… wartość dla wnÄ™trza zbioru danych. -TTEST = TEST.T ## Zwraca prawdopodobieÅ„stwo zwiÄ…zane z testem t-Studenta. -VAR = WARIANCJA ## Szacuje wariancjÄ™ na podstawie próbki. -VARA = WARIANCJA.A ## Szacuje wariancjÄ™ na podstawie próbki, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -VARP = WARIANCJA.POPUL ## Oblicza wariancjÄ™ na podstawie caÅ‚ej populacji. -VARPA = WARIANCJA.POPUL.A ## Oblicza wariancjÄ™ na podstawie caÅ‚ej populacji, z uwzglÄ™dnieniem liczb, tekstów i wartoÅ›ci logicznych. -WEIBULL = ROZKÅAD.WEIBULL ## Zwraca rozkÅ‚ad Weibulla. -ZTEST = TEST.Z ## Zwraca wartość jednostronnego prawdopodobieÅ„stwa testu z. - - -## -## Text functions Funkcje tekstowe -## -ASC = ASC ## Zamienia litery angielskie lub katakana o peÅ‚nej szerokoÅ›ci (dwubajtowe) w ciÄ…gu znaków na znaki o szerokoÅ›ci połówkowej (jednobajtowe). -BAHTTEXT = BAHTTEXT ## Konwertuje liczbÄ™ na tekst, stosujÄ…c format walutowy ß (baht). -CHAR = ZNAK ## Zwraca znak o podanym numerze kodu. -CLEAN = OCZYŚĆ ## Usuwa z tekstu wszystkie znaki, które nie mogÄ… być drukowane. -CODE = KOD ## Zwraca kod numeryczny pierwszego znaku w ciÄ…gu tekstowym. -CONCATENATE = ZÅÄ„CZ.TEKSTY ## ÅÄ…czy kilka oddzielnych tekstów w jeden tekst. -DOLLAR = KWOTA ## Konwertuje liczbÄ™ na tekst, stosujÄ…c format walutowy $ (dolar). -EXACT = PORÓWNAJ ## Sprawdza identyczność dwóch wartoÅ›ci tekstowych. -FIND = ZNAJDŹ ## Znajduje jednÄ… wartość tekstowÄ… wewnÄ…trz innej (z uwzglÄ™dnieniem wielkich i maÅ‚ych liter). -FINDB = ZNAJDŹB ## Znajduje jednÄ… wartość tekstowÄ… wewnÄ…trz innej (z uwzglÄ™dnieniem wielkich i maÅ‚ych liter). -FIXED = ZAOKR.DO.TEKST ## Formatuje liczbÄ™ jako tekst przy staÅ‚ej liczbie miejsc dziesiÄ™tnych. -JIS = JIS ## Zmienia litery angielskie lub katakana o szerokoÅ›ci połówkowej (jednobajtowe) w ciÄ…gu znaków na znaki o peÅ‚nej szerokoÅ›ci (dwubajtowe). -LEFT = LEWY ## Zwraca skrajne lewe znaki z wartoÅ›ci tekstowej. -LEFTB = LEWYB ## Zwraca skrajne lewe znaki z wartoÅ›ci tekstowej. -LEN = DÅ ## Zwraca liczbÄ™ znaków ciÄ…gu tekstowego. -LENB = DÅ.B ## Zwraca liczbÄ™ znaków ciÄ…gu tekstowego. -LOWER = LITERY.MAÅE ## Konwertuje wielkie litery tekstu na maÅ‚e litery. -MID = FRAGMENT.TEKSTU ## Zwraca okreÅ›lonÄ… liczbÄ™ znaków z ciÄ…gu tekstowego, zaczynajÄ…c od zadanej pozycji. -MIDB = FRAGMENT.TEKSTU.B ## Zwraca okreÅ›lonÄ… liczbÄ™ znaków z ciÄ…gu tekstowego, zaczynajÄ…c od zadanej pozycji. -PHONETIC = PHONETIC ## Wybiera znaki fonetyczne (furigana) z ciÄ…gu tekstowego. -PROPER = Z.WIELKIEJ.LITERY ## ZastÄ™puje pierwszÄ… literÄ™ każdego wyrazu tekstu wielkÄ… literÄ…. -REPLACE = ZASTÄ„P ## ZastÄ™puje znaki w tekÅ›cie. -REPLACEB = ZASTÄ„P.B ## ZastÄ™puje znaki w tekÅ›cie. -REPT = POWT ## Powiela tekst danÄ… liczbÄ™ razy. -RIGHT = PRAWY ## Zwraca skrajne prawe znaki z wartoÅ›ci tekstowej. -RIGHTB = PRAWYB ## Zwraca skrajne prawe znaki z wartoÅ›ci tekstowej. -SEARCH = SZUKAJ.TEKST ## Wyszukuje jednÄ… wartość tekstowÄ… wewnÄ…trz innej (bez uwzglÄ™dniania wielkoÅ›ci liter). -SEARCHB = SZUKAJ.TEKST.B ## Wyszukuje jednÄ… wartość tekstowÄ… wewnÄ…trz innej (bez uwzglÄ™dniania wielkoÅ›ci liter). -SUBSTITUTE = PODSTAW ## Podstawia nowy tekst w miejsce poprzedniego tekstu w ciÄ…gu tekstowym. -T = T ## Konwertuje argumenty na tekst. -TEXT = TEKST ## Formatuje liczbÄ™ i konwertuje jÄ… na tekst. -TRIM = USUŃ.ZBĘDNE.ODSTĘPY ## Usuwa spacje z tekstu. -UPPER = LITERY.WIELKIE ## Konwertuje znaki tekstu na wielkie litery. -VALUE = WARTOŚĆ ## Konwertuje argument tekstowy na liczbÄ™. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/config deleted file mode 100644 index 270ad5367b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = R$ - - -## -## Excel Error Codes (For future use) -## -NULL = #NULO! -DIV0 = #DIV/0! -VALUE = #VALOR! -REF = #REF! -NAME = #NOME? -NUM = #NÚM! -NA = #N/D diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/functions deleted file mode 100644 index c53e4c9a6a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/br/functions +++ /dev/null @@ -1,408 +0,0 @@ -## -## Add-in and Automation functions Funções Suplemento e Automação -## -GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica - - -## -## Cube functions Funções de Cubo -## -CUBEKPIMEMBER = MEMBROKPICUBO ## Retorna o nome de um KPI (indicador de desempenho-chave), uma propriedade e uma medida e exibe o nome e a propriedade na célula. Um KPI é uma medida quantificável, como o lucro bruto mensal ou a rotatividade trimestral dos funcionários, usada para monitorar o desempenho de uma organização. -CUBEMEMBER = MEMBROCUBO ## Retorna um membro ou tupla em uma hierarquia de cubo. Use para validar se o membro ou tupla existe no cubo. -CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Retorna o valor da propriedade de um membro no cubo. Usada para validar a existência do nome do membro no cubo e para retornar a propriedade especificada para esse membro. -CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Retorna o enésimo membro, ou o membro ordenado, em um conjunto. Use para retornar um ou mais elementos em um conjunto, assim como o melhor vendedor ou os dez melhores alunos. -CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou tuplas enviando uma expressão do conjunto para o cubo no servidor, que cria o conjunto e o retorna para o Microsoft Office Excel. -CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto. -CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo. - - -## -## Database functions Funções de banco de dados -## -DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um banco de dados -DCOUNT = BDCONTAR ## Conta as células que contêm números em um banco de dados -DCOUNTA = BDCONTARA ## Conta células não vazias em um banco de dados -DGET = BDEXTRAIR ## Extrai de um banco de dados um único registro que corresponde a um critério específico -DMAX = BDMÃX ## Retorna o valor máximo de entradas selecionadas de um banco de dados -DMIN = BDMÃN ## Retorna o valor mínimo de entradas selecionadas de um banco de dados -DPRODUCT = BDMULTIPL ## Multiplica os valores em um campo específico de registros que correspondem ao critério em um banco de dados -DSTDEV = BDEST ## Estima o desvio padrão com base em uma amostra de entradas selecionadas de um banco de dados -DSTDEVP = BDDESVPA ## Calcula o desvio padrão com base na população inteira de entradas selecionadas de um banco de dados -DSUM = BDSOMA ## Adiciona os números à coluna de campos de registros do banco de dados que correspondem ao critério -DVAR = BDVAREST ## Estima a variância com base em uma amostra de entradas selecionadas de um banco de dados -DVARP = BDVARP ## Calcula a variância com base na população inteira de entradas selecionadas de um banco de dados - - -## -## Date and time functions Funções de data e hora -## -DATE = DATA ## Retorna o número de série de uma data específica -DATEVALUE = DATA.VALOR ## Converte uma data na forma de texto para um número de série -DAY = DIA ## Converte um número de série em um dia do mês -DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base em um ano de 360 dias -EDATE = DATAM ## Retorna o número de série da data que é o número indicado de meses antes ou depois da data inicial -EOMONTH = FIMMÊS ## Retorna o número de série do último dia do mês antes ou depois de um número especificado de meses -HOUR = HORA ## Converte um número de série em uma hora -MINUTE = MINUTO ## Converte um número de série em um minuto -MONTH = MÊS ## Converte um número de série em um mês -NETWORKDAYS = DIATRABALHOTOTAL ## Retorna o número de dias úteis inteiros entre duas datas -NOW = AGORA ## Retorna o número de série seqüencial da data e hora atuais -SECOND = SEGUNDO ## Converte um número de série em um segundo -TIME = HORA ## Retorna o número de série de uma hora específica -TIMEVALUE = VALOR.TEMPO ## Converte um horário na forma de texto para um número de série -TODAY = HOJE ## Retorna o número de série da data de hoje -WEEKDAY = DIA.DA.SEMANA ## Converte um número de série em um dia da semana -WEEKNUM = NÚMSEMANA ## Converte um número de série em um número que representa onde a semana cai numericamente em um ano -WORKDAY = DIATRABALHO ## Retorna o número de série da data antes ou depois de um número específico de dias úteis -YEAR = ANO ## Converte um número de série em um ano -YEARFRAC = FRAÇÃOANO ## Retorna a fração do ano que representa o número de dias entre data_inicial e data_final - - -## -## Engineering functions Funções de engenharia -## -BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada -BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x) -BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada -BESSELY = BESSELY ## Retorna a função de Bessel Yn(x) -BIN2DEC = BIN2DEC ## Converte um número binário em decimal -BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal -BIN2OCT = BIN2OCT ## Converte um número binário em octal -COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo -CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro -DEC2BIN = DECABIN ## Converte um número decimal em binário -DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal -DEC2OCT = DECAOCT ## Converte um número decimal em octal -DELTA = DELTA ## Testa se dois valores são iguais -ERF = FUNERRO ## Retorna a função de erro -ERFC = FUNERROCOMPL ## Retorna a função de erro complementar -GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite -HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário -HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal -HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal -IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo -IMAGINARY = IMAGINÃRIO ## Retorna o coeficiente imaginário de um número complexo -IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos -IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo -IMCOS = IMCOS ## Retorna o cosseno de um número complexo -IMDIV = IMDIV ## Retorna o quociente de dois números complexos -IMEXP = IMEXP ## Retorna o exponencial de um número complexo -IMLN = IMLN ## Retorna o logaritmo natural de um número complexo -IMLOG10 = IMLOG10 ## Retorna o logaritmo de base 10 de um número complexo -IMLOG2 = IMLOG2 ## Retorna o logaritmo de base 2 de um número complexo -IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira -IMPRODUCT = IMPROD ## Retorna o produto de números complexos -IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo -IMSIN = IMSENO ## Retorna o seno de um número complexo -IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo -IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos -IMSUM = IMSOMA ## Retorna a soma de números complexos -OCT2BIN = OCTABIN ## Converte um número octal em binário -OCT2DEC = OCTADEC ## Converte um número octal em decimal -OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal - - -## -## Financial functions Funções financeiras -## -ACCRINT = JUROSACUM ## Retorna a taxa de juros acumulados de um título que paga uma taxa periódica de juros -ACCRINTM = JUROSACUMV ## Retorna os juros acumulados de um título que paga juros no vencimento -AMORDEGRC = AMORDEGRC ## Retorna a depreciação para cada período contábil usando o coeficiente de depreciação -AMORLINC = AMORLINC ## Retorna a depreciação para cada período contábil -COUPDAYBS = CUPDIASINLIQ ## Retorna o número de dias do início do período de cupom até a data de liquidação -COUPDAYS = CUPDIAS ## Retorna o número de dias no período de cupom que contém a data de quitação -COUPDAYSNC = CUPDIASPRÓX ## Retorna o número de dias da data de liquidação até a data do próximo cupom -COUPNCD = CUPDATAPRÓX ## Retorna a próxima data de cupom após a data de quitação -COUPNUM = CUPNÚM ## Retorna o número de cupons pagáveis entre as datas de quitação e vencimento -COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação -CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos -CUMPRINC = PGTOCAPACUM ## Retorna o capital acumulado pago sobre um empréstimo entre dois períodos -DB = BD ## Retorna a depreciação de um ativo para um período especificado, usando o método de balanço de declínio fixo -DDB = BDD ## Retorna a depreciação de um ativo com relação a um período especificado usando o método de saldos decrescentes duplos ou qualquer outro método especificado por você -DISC = DESC ## Retorna a taxa de desconto de um título -DOLLARDE = MOEDADEC ## Converte um preço em formato de moeda, na forma fracionária, em um preço na forma decimal -DOLLARFR = MOEDAFRA ## Converte um preço, apresentado na forma decimal, em um preço apresentado na forma fracionária -DURATION = DURAÇÃO ## Retorna a duração anual de um título com pagamentos de juros periódicos -EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva -FV = VF ## Retorna o valor futuro de um investimento -FVSCHEDULE = VFPLANO ## Retorna o valor futuro de um capital inicial após a aplicação de uma série de taxas de juros compostas -INTRATE = TAXAJUROS ## Retorna a taxa de juros de um título totalmente investido -IPMT = IPGTO ## Retorna o pagamento de juros para um investimento em um determinado período -IRR = TIR ## Retorna a taxa interna de retorno de uma série de fluxos de caixa -ISPMT = ÉPGTO ## Calcula os juros pagos durante um período específico de um investimento -MDURATION = MDURAÇÃO ## Retorna a duração de Macauley modificada para um título com um valor de paridade equivalente a R$ 100 -MIRR = MTIR ## Calcula a taxa interna de retorno em que fluxos de caixa positivos e negativos são financiados com diferentes taxas -NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual -NPER = NPER ## Retorna o número de períodos de um investimento -NPV = VPL ## Retorna o valor líquido atual de um investimento com base em uma série de fluxos de caixa periódicos e em uma taxa de desconto -ODDFPRICE = PREÇOPRIMINC ## Retorna o preço por R$ 100 de valor nominal de um título com um primeiro período indefinido -ODDFYIELD = LUCROPRIMINC ## Retorna o rendimento de um título com um primeiro período indefinido -ODDLPRICE = PREÇOÚLTINC ## Retorna o preço por R$ 100 de valor nominal de um título com um último período de cupom indefinido -ODDLYIELD = LUCROÚLTINC ## Retorna o rendimento de um título com um último período indefinido -PMT = PGTO ## Retorna o pagamento periódico de uma anuidade -PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento -PRICE = PREÇO ## Retorna a preço por R$ 100,00 de valor nominal de um título que paga juros periódicos -PRICEDISC = PREÇODESC ## Retorna o preço por R$ 100,00 de valor nominal de um título descontado -PRICEMAT = PREÇOVENC ## Retorna o preço por R$ 100,00 de valor nominal de um título que paga juros no vencimento -PV = VP ## Retorna o valor presente de um investimento -RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade -RECEIVED = RECEBER ## Retorna a quantia recebida no vencimento de um título totalmente investido -SLN = DPD ## Retorna a depreciação em linha reta de um ativo durante um período -SYD = SDA ## Retorna a depreciação dos dígitos da soma dos anos de um ativo para um período especificado -TBILLEQ = OTN ## Retorna o rendimento de um título equivalente a uma obrigação do Tesouro -TBILLPRICE = OTNVALOR ## Retorna o preço por R$ 100,00 de valor nominal de uma obrigação do Tesouro -TBILLYIELD = OTNLUCRO ## Retorna o rendimento de uma obrigação do Tesouro -VDB = BDV ## Retorna a depreciação de um ativo para um período especificado ou parcial usando um método de balanço declinante -XIRR = XTIR ## Fornece a taxa interna de retorno para um programa de fluxos de caixa que não é necessariamente periódico -XNPV = XVPL ## Retorna o valor presente líquido de um programa de fluxos de caixa que não é necessariamente periódico -YIELD = LUCRO ## Retorna o lucro de um título que paga juros periódicos -YIELDDISC = LUCRODESC ## Retorna o rendimento anual de um título descontado. Por exemplo, uma obrigação do Tesouro -YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento - - -## -## Information functions Funções de informação -## -CELL = CÉL ## Retorna informações sobre formatação, localização ou conteúdo de uma célula -ERROR.TYPE = TIPO.ERRO ## Retorna um número correspondente a um tipo de erro -INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual -ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio -ISERR = ÉERRO ## Retorna VERDADEIRO se o valor for um valor de erro diferente de #N/D -ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro -ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par -ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico -ISNA = É.NÃO.DISP ## Retorna VERDADEIRO se o valor for o valor de erro #N/D -ISNONTEXT = É.NÃO.TEXTO ## Retorna VERDADEIRO se o valor for diferente de texto -ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número -ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar -ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência -ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto -N = N ## Retorna um valor convertido em um número -NA = NÃO.DISP ## Retorna o valor de erro #N/D -TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor - - -## -## Logical functions Funções lógicas -## -AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS -FALSE = FALSO ## Retorna o valor lógico FALSO -IF = SE ## Especifica um teste lógico a ser executado -IFERROR = SEERRO ## Retornará um valor que você especifica se uma fórmula for avaliada para um erro; do contrário, retornará o resultado da fórmula -NOT = NÃO ## Inverte o valor lógico do argumento -OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO -TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO - - -## -## Lookup and reference functions Funções de pesquisa e referência -## -ADDRESS = ENDEREÇO ## Retorna uma referência como texto para uma única célula em uma planilha -AREAS = ÃREAS ## Retorna o número de áreas em uma referência -CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores -COLUMN = COL ## Retorna o número da coluna de uma referência -COLUMNS = COLS ## Retorna o número de colunas em uma referência -HLOOKUP = PROCH ## Procura na linha superior de uma matriz e retorna o valor da célula especificada -HYPERLINK = HYPERLINK ## Cria um atalho ou salto que abre um documento armazenado em um servidor de rede, uma intranet ou na Internet -INDEX = ÃNDICE ## Usa um índice para escolher um valor de uma referência ou matriz -INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto -LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz -MATCH = CORRESP ## Procura valores em uma referência ou em uma matriz -OFFSET = DESLOC ## Retorna um deslocamento de referência com base em uma determinada referência -ROW = LIN ## Retorna o número da linha de uma referência -ROWS = LINS ## Retorna o número de linhas em uma referência -RTD = RTD ## Recupera dados em tempo real de um programa que ofereça suporte a automação COM (automação: uma forma de trabalhar com objetos de um aplicativo a partir de outro aplicativo ou ferramenta de desenvolvimento. Chamada inicialmente de automação OLE, a automação é um padrão industrial e um recurso do modelo de objeto componente (COM).) -TRANSPOSE = TRANSPOR ## Retorna a transposição de uma matriz -VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e move ao longo da linha para retornar o valor de uma célula - - -## -## Math and trigonometry functions Funções matemáticas e trigonométricas -## -ABS = ABS ## Retorna o valor absoluto de um número -ACOS = ACOS ## Retorna o arco cosseno de um número -ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número -ASIN = ASEN ## Retorna o arco seno de um número -ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número -ATAN = ATAN ## Retorna o arco tangente de um número -ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas -ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número -CEILING = TETO ## Arredonda um número para o inteiro mais próximo ou para o múltiplo mais próximo de significância -COMBIN = COMBIN ## Retorna o número de combinações de um determinado número de objetos -COS = COS ## Retorna o cosseno de um número -COSH = COSH ## Retorna o cosseno hiperbólico de um número -DEGREES = GRAUS ## Converte radianos em graus -EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo -EXP = EXP ## Retorna e elevado à potência de um número especificado -FACT = FATORIAL ## Retorna o fatorial de um número -FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número -FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero -GCD = MDC ## Retorna o máximo divisor comum -INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo -LCM = MMC ## Retorna o mínimo múltiplo comum -LN = LN ## Retorna o logaritmo natural de um número -LOG = LOG ## Retorna o logaritmo de um número de uma base especificada -LOG10 = LOG10 ## Retorna o logaritmo de base 10 de um número -MDETERM = MATRIZ.DETERM ## Retorna o determinante de uma matriz de uma variável do tipo matriz -MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz -MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes -MOD = RESTO ## Retorna o resto da divisão -MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado -MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números -ODD = ÃMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo -PI = PI ## Retorna o valor de Pi -POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência -PRODUCT = MULT ## Multiplica seus argumentos -QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão -RADIANS = RADIANOS ## Converte graus em radianos -RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1 -RANDBETWEEN = ALEATÓRIOENTRE ## Retorna um número aleatório entre os números especificados -ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto -ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos -ROUNDDOWN = ARREDONDAR.PARA.BAIXO ## Arredonda um número para baixo até zero -ROUNDUP = ARREDONDAR.PARA.CIMA ## Arredonda um número para cima, afastando-o de zero -SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula -SIGN = SINAL ## Retorna o sinal de um número -SIN = SEN ## Retorna o seno de um ângulo dado -SINH = SENH ## Retorna o seno hiperbólico de um número -SQRT = RAIZ ## Retorna uma raiz quadrada positiva -SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi) -SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados -SUM = SOMA ## Soma seus argumentos -SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério -SUMIFS = SOMASE ## Adiciona as células em um intervalo que atende a vários critérios -SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes -SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos -SUMX2MY2 = SOMAX2DY2 ## Retorna a soma da diferença dos quadrados dos valores correspondentes em duas matrizes -SUMX2PY2 = SOMAX2SY2 ## Retorna a soma da soma dos quadrados dos valores correspondentes em duas matrizes -SUMXMY2 = SOMAXMY2 ## Retorna a soma dos quadrados das diferenças dos valores correspondentes em duas matrizes -TAN = TAN ## Retorna a tangente de um número -TANH = TANH ## Retorna a tangente hiperbólica de um número -TRUNC = TRUNCAR ## Trunca um número para um inteiro - - -## -## Statistical functions Funções estatísticas -## -AVEDEV = DESV.MÉDIO ## Retorna a média aritmética dos desvios médios dos pontos de dados a partir de sua média -AVERAGE = MÉDIA ## Retorna a média dos argumentos -AVERAGEA = MÉDIAA ## Retorna a média dos argumentos, inclusive números, texto e valores lógicos -AVERAGEIF = MÉDIASE ## Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério -AVERAGEIFS = MÉDIASES ## Retorna a média (média aritmética) de todas as células que atendem a múltiplos critérios. -BETADIST = DISTBETA ## Retorna a função de distribuição cumulativa beta -BETAINV = BETA.ACUM.INV ## Retorna o inverso da função de distribuição cumulativa para uma distribuição beta especificada -BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual -CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada -CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada -CHITEST = TESTE.QUI ## Retorna o teste para independência -CONFIDENCE = INT.CONFIANÇA ## Retorna o intervalo de confiança para uma média da população -CORREL = CORREL ## Retorna o coeficiente de correlação entre dois conjuntos de dados -COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos -COUNTA = CONT.VALORES ## Calcula quantos valores há na lista de argumentos -COUNTBLANK = CONTAR.VAZIO ## Conta o número de células vazias no intervalo especificado -COUNTIF = CONT.SE ## Calcula o número de células não vazias em um intervalo que corresponde a determinados critérios -COUNTIFS = CONT.SES ## Conta o número de células dentro de um intervalo que atende a múltiplos critérios -COVAR = COVAR ## Retorna a covariância, a média dos produtos dos desvios pares -CRITBINOM = CRIT.BINOM ## Retorna o menor valor para o qual a distribuição binomial cumulativa é menor ou igual ao valor padrão -DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios -EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial -FDIST = DISTF ## Retorna a distribuição de probabilidade F -FINV = INVF ## Retorna o inverso da distribuição de probabilidades F -FISHER = FISHER ## Retorna a transformação Fisher -FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher -FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta -FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical -FTEST = TESTEF ## Retorna o resultado de um teste F -GAMMADIST = DISTGAMA ## Retorna a distribuição gama -GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama -GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x) -GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica -GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial -HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica -HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica -INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear -KURT = CURT ## Retorna a curtose de um conjunto de dados -LARGE = MAIOR ## Retorna o maior valor k-ésimo de um conjunto de dados -LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear -LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial -LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal -LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa -MAX = MÃXIMO ## Retorna o valor máximo em uma lista de argumentos -MAXA = MÃXIMOA ## Retorna o maior valor em uma lista de argumentos, inclusive números, texto e valores lógicos -MEDIAN = MED ## Retorna a mediana dos números indicados -MIN = MÃNIMO ## Retorna o valor mínimo em uma lista de argumentos -MINA = MÃNIMOA ## Retorna o menor valor em uma lista de argumentos, inclusive números, texto e valores lógicos -MODE = MODO ## Retorna o valor mais comum em um conjunto de dados -NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa -NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal -NORMINV = INV.NORM ## Retorna o inverso da distribuição cumulativa normal -NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão -NORMSINV = INV.NORMP ## Retorna o inverso da distribuição cumulativa normal padrão -PEARSON = PEARSON ## Retorna o coeficiente de correlação do momento do produto Pearson -PERCENTILE = PERCENTIL ## Retorna o k-ésimo percentil de valores em um intervalo -PERCENTRANK = ORDEM.PORCENTUAL ## Retorna a ordem percentual de um valor em um conjunto de dados -PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos -POISSON = POISSON ## Retorna a distribuição Poisson -PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites -QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados -RANK = ORDEM ## Retorna a posição de um número em uma lista de números -RSQ = RQUAD ## Retorna o quadrado do coeficiente de correlação do momento do produto de Pearson -SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição -SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear -SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados -STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado -STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra -STDEVA = DESVPADA ## Estima o desvio padrão com base em uma amostra, inclusive números, texto e valores lógicos -STDEVP = DESVPADP ## Calcula o desvio padrão com base na população total -STDEVPA = DESVPADPA ## Calcula o desvio padrão com base na população total, inclusive números, texto e valores lógicos -STEYX = EPADYX ## Retorna o erro padrão do valor-y previsto para cada x da regressão -TDIST = DISTT ## Retorna a distribuição t de Student -TINV = INVT ## Retorna o inverso da distribuição t de Student -TREND = TENDÊNCIA ## Retorna valores ao longo de uma tendência linear -TRIMMEAN = MÉDIA.INTERNA ## Retorna a média do interior de um conjunto de dados -TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student -VAR = VAR ## Estima a variância com base em uma amostra -VARA = VARA ## Estima a variância com base em uma amostra, inclusive números, texto e valores lógicos -VARP = VARP ## Calcula a variância com base na população inteira -VARPA = VARPA ## Calcula a variância com base na população total, inclusive números, texto e valores lógicos -WEIBULL = WEIBULL ## Retorna a distribuição Weibull -ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z - - -## -## Text functions Funções de texto -## -ASC = ASC ## Altera letras do inglês ou katakana de largura total (bytes duplos) dentro de uma seqüência de caracteres para caracteres de meia largura (byte único) -BAHTTEXT = BAHTTEXT ## Converte um número em um texto, usando o formato de moeda ß (baht) -CHAR = CARACT ## Retorna o caractere especificado pelo número de código -CLEAN = TIRAR ## Remove todos os caracteres do texto que não podem ser impressos -CODE = CÓDIGO ## Retorna um código numérico para o primeiro caractere de uma seqüência de caracteres de texto -CONCATENATE = CONCATENAR ## Agrupa vários itens de texto em um único item de texto -DOLLAR = MOEDA ## Converte um número em texto, usando o formato de moeda $ (dólar) -EXACT = EXATO ## Verifica se dois valores de texto são idênticos -FIND = PROCURAR ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas) -FINDB = PROCURARB ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas) -FIXED = DEF.NÚM.DEC ## Formata um número como texto com um número fixo de decimais -JIS = JIS ## Altera letras do inglês ou katakana de meia largura (byte único) dentro de uma seqüência de caracteres para caracteres de largura total (bytes duplos) -LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto -LEFTB = ESQUERDAB ## Retorna os caracteres mais à esquerda de um valor de texto -LEN = NÚM.CARACT ## Retorna o número de caracteres em uma seqüência de texto -LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto -LOWER = MINÚSCULA ## Converte texto para minúsculas -MID = EXT.TEXTO ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada -MIDB = EXT.TEXTOB ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada -PHONETIC = FONÉTICA ## Extrai os caracteres fonéticos (furigana) de uma seqüência de caracteres de texto -PROPER = PRI.MAIÚSCULA ## Coloca a primeira letra de cada palavra em maiúscula em um valor de texto -REPLACE = MUDAR ## Muda os caracteres dentro do texto -REPLACEB = MUDARB ## Muda os caracteres dentro do texto -REPT = REPT ## Repete o texto um determinado número de vezes -RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto -RIGHTB = DIREITAB ## Retorna os caracteres mais à direita de um valor de texto -SEARCH = LOCALIZAR ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas) -SEARCHB = LOCALIZARB ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas) -SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto -T = T ## Converte os argumentos em texto -TEXT = TEXTO ## Formata um número e o converte em texto -TRIM = ARRUMAR ## Remove espaços do texto -UPPER = MAIÚSCULA ## Converte o texto em maiúsculas -VALUE = VALOR ## Converte um argumento de texto em um número diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/config deleted file mode 100644 index 781ae6db4c..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = € - - -## -## Excel Error Codes (For future use) -## -NULL = #NULO! -DIV0 = #DIV/0! -VALUE = #VALOR! -REF = #REF! -NAME = #NOME? -NUM = #NÚM! -NA = #N/D diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/functions deleted file mode 100644 index d8e9082f5f..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/pt/functions +++ /dev/null @@ -1,408 +0,0 @@ -## -## Add-in and Automation functions Funções de Suplemento e Automatização -## -GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica - - -## -## Cube functions Funções de cubo -## -CUBEKPIMEMBER = MEMBROKPICUBO ## Devolve o nome, propriedade e medição de um KPI (key performance indicator) e apresenta o nome e a propriedade na célula. Um KPI é uma medida quantificável, como, por exemplo, o lucro mensal bruto ou a rotatividade trimestral de pessoal, utilizada para monitorizar o desempenho de uma organização. -CUBEMEMBER = MEMBROCUBO ## Devolve um membro ou cadeia de identificação numa hierarquia de cubo. Utilizada para validar a existência do membro ou cadeia de identificação no cubo. -CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Devolve o valor de uma propriedade de membro no cubo. Utilizada para validar a existência de um nome de membro no cubo e para devolver a propriedade especificada para esse membro. -CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Devolve o enésimo ou a classificação mais alta num conjunto. Utilizada para devolver um ou mais elementos num conjunto, tal como o melhor vendedor ou os 10 melhores alunos. -CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou cadeias de identificação enviando uma expressão de conjunto para o cubo no servidor, que cria o conjunto e, em seguida, devolve o conjunto ao Microsoft Office Excel. -CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto. -CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo. - - -## -## Database functions Funções de base de dados -## -DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas -DCOUNT = BDCONTAR ## Conta as células que contêm números numa base de dados -DCOUNTA = BDCONTAR.VAL ## Conta as células que não estejam em branco numa base de dados -DGET = BDOBTER ## Extrai de uma base de dados um único registo que corresponde aos critérios especificados -DMAX = BDMÃX ## Devolve o valor máximo das entradas da base de dados seleccionadas -DMIN = BDMÃN ## Devolve o valor mínimo das entradas da base de dados seleccionadas -DPRODUCT = BDMULTIPL ## Multiplica os valores de um determinado campo de registos que correspondem aos critérios numa base de dados -DSTDEV = BDDESVPAD ## Calcula o desvio-padrão com base numa amostra de entradas da base de dados seleccionadas -DSTDEVP = BDDESVPADP ## Calcula o desvio-padrão com base na população total das entradas da base de dados seleccionadas -DSUM = BDSOMA ## Adiciona os números na coluna de campo dos registos de base de dados que correspondem aos critérios -DVAR = BDVAR ## Calcula a variância com base numa amostra das entradas de base de dados seleccionadas -DVARP = BDVARP ## Calcula a variância com base na população total das entradas de base de dados seleccionadas - - -## -## Date and time functions Funções de data e hora -## -DATE = DATA ## Devolve o número de série de uma determinada data -DATEVALUE = DATA.VALOR ## Converte uma data em forma de texto num número de série -DAY = DIA ## Converte um número de série num dia do mês -DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base num ano com 360 dias -EDATE = DATAM ## Devolve um número de série de data que corresponde ao número de meses indicado antes ou depois da data de início -EOMONTH = FIMMÊS ## Devolve o número de série do último dia do mês antes ou depois de um número de meses especificado -HOUR = HORA ## Converte um número de série numa hora -MINUTE = MINUTO ## Converte um número de série num minuto -MONTH = MÊS ## Converte um número de série num mês -NETWORKDAYS = DIATRABALHOTOTAL ## Devolve o número total de dias úteis entre duas datas -NOW = AGORA ## Devolve o número de série da data e hora actuais -SECOND = SEGUNDO ## Converte um número de série num segundo -TIME = TEMPO ## Devolve o número de série de um determinado tempo -TIMEVALUE = VALOR.TEMPO ## Converte um tempo em forma de texto num número de série -TODAY = HOJE ## Devolve o número de série da data actual -WEEKDAY = DIA.SEMANA ## Converte um número de série num dia da semana -WEEKNUM = NÚMSEMANA ## Converte um número de série num número que representa o número da semana num determinado ano -WORKDAY = DIA.TRABALHO ## Devolve o número de série da data antes ou depois de um número de dias úteis especificado -YEAR = ANO ## Converte um número de série num ano -YEARFRAC = FRACÇÃOANO ## Devolve a fracção de ano que representa o número de dias inteiros entre a data_de_início e a data_de_fim - - -## -## Engineering functions Funções de engenharia -## -BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x) -BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x) -BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x) -BESSELY = BESSELY ## Devolve a função de Bessel Yn(x) -BIN2DEC = BINADEC ## Converte um número binário em decimal -BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal -BIN2OCT = BINAOCT ## Converte um número binário em octal -COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo -CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro -DEC2BIN = DECABIN ## Converte um número decimal em binário -DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal -DEC2OCT = DECAOCT ## Converte um número decimal em octal -DELTA = DELTA ## Testa se dois valores são iguais -ERF = FUNCERRO ## Devolve a função de erro -ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar -GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite -HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário -HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal -HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal -IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo -IMAGINARY = IMAGINÃRIO ## Devolve o coeficiente imaginário de um número complexo -IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos -IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo -IMCOS = IMCOS ## Devolve o co-seno de um número complexo -IMDIV = IMDIV ## Devolve o quociente de dois números complexos -IMEXP = IMEXP ## Devolve o exponencial de um número complexo -IMLN = IMLN ## Devolve o logaritmo natural de um número complexo -IMLOG10 = IMLOG10 ## Devolve o logaritmo de base 10 de um número complexo -IMLOG2 = IMLOG2 ## Devolve o logaritmo de base 2 de um número complexo -IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira -IMPRODUCT = IMPROD ## Devolve o produto de números complexos -IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo -IMSIN = IMSENO ## Devolve o seno de um número complexo -IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo -IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos -IMSUM = IMSOMA ## Devolve a soma de números complexos -OCT2BIN = OCTABIN ## Converte um número octal em binário -OCT2DEC = OCTADEC ## Converte um número octal em decimal -OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal - - -## -## Financial functions Funções financeiras -## -ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos -ACCRINTM = JUROSACUMV ## Devolve os juros acumulados de um título que paga juros no vencimento -AMORDEGRC = AMORDEGRC ## Devolve a depreciação correspondente a cada período contabilístico utilizando um coeficiente de depreciação -AMORLINC = AMORLINC ## Devolve a depreciação correspondente a cada período contabilístico -COUPDAYBS = CUPDIASINLIQ ## Devolve o número de dias entre o início do período do cupão e a data de regularização -COUPDAYS = CUPDIAS ## Devolve o número de dias no período do cupão que contém a data de regularização -COUPDAYSNC = CUPDIASPRÓX ## Devolve o número de dias entre a data de regularização e a data do cupão seguinte -COUPNCD = CUPDATAPRÓX ## Devolve a data do cupão seguinte após a data de regularização -COUPNUM = CUPNÚM ## Devolve o número de cupões a serem pagos entre a data de regularização e a data de vencimento -COUPPCD = CUPDATAANT ## Devolve a data do cupão anterior antes da data de regularização -CUMIPMT = PGTOJURACUM ## Devolve os juros cumulativos pagos entre dois períodos -CUMPRINC = PGTOCAPACUM ## Devolve o capital cumulativo pago a título de empréstimo entre dois períodos -DB = BD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas fixas -DDB = BDD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas duplas ou qualquer outro método especificado -DISC = DESC ## Devolve a taxa de desconto de um título -DOLLARDE = MOEDADEC ## Converte um preço em unidade monetária, expresso como uma fracção, num preço em unidade monetária, expresso como um número decimal -DOLLARFR = MOEDAFRA ## Converte um preço em unidade monetária, expresso como um número decimal, num preço em unidade monetária, expresso como uma fracção -DURATION = DURAÇÃO ## Devolve a duração anual de um título com pagamentos de juros periódicos -EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva -FV = VF ## Devolve o valor futuro de um investimento -FVSCHEDULE = VFPLANO ## Devolve o valor futuro de um capital inicial após a aplicação de uma série de taxas de juro compostas -INTRATE = TAXAJUROS ## Devolve a taxa de juros de um título investido na totalidade -IPMT = IPGTO ## Devolve o pagamento dos juros de um investimento durante um determinado período -IRR = TIR ## Devolve a taxa de rentabilidade interna para uma série de fluxos monetários -ISPMT = É.PGTO ## Calcula os juros pagos durante um período específico de um investimento -MDURATION = MDURAÇÃO ## Devolve a duração modificada de Macauley de um título com um valor de paridade equivalente a € 100 -MIRR = MTIR ## Devolve a taxa interna de rentabilidade em que os fluxos monetários positivos e negativos são financiados com taxas diferentes -NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual -NPER = NPER ## Devolve o número de períodos de um investimento -NPV = VAL ## Devolve o valor actual líquido de um investimento com base numa série de fluxos monetários periódicos e numa taxa de desconto -ODDFPRICE = PREÇOPRIMINC ## Devolve o preço por € 100 do valor nominal de um título com um período inicial incompleto -ODDFYIELD = LUCROPRIMINC ## Devolve o lucro de um título com um período inicial incompleto -ODDLPRICE = PREÇOÚLTINC ## Devolve o preço por € 100 do valor nominal de um título com um período final incompleto -ODDLYIELD = LUCROÚLTINC ## Devolve o lucro de um título com um período final incompleto -PMT = PGTO ## Devolve o pagamento periódico de uma anuidade -PPMT = PPGTO ## Devolve o pagamento sobre o capital de um investimento num determinado período -PRICE = PREÇO ## Devolve o preço por € 100 do valor nominal de um título que paga juros periódicos -PRICEDISC = PREÇODESC ## Devolve o preço por € 100 do valor nominal de um título descontado -PRICEMAT = PREÇOVENC ## Devolve o preço por € 100 do valor nominal de um título que paga juros no vencimento -PV = VA ## Devolve o valor actual de um investimento -RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade -RECEIVED = RECEBER ## Devolve o montante recebido no vencimento de um título investido na totalidade -SLN = AMORT ## Devolve uma depreciação linear de um activo durante um período -SYD = AMORTD ## Devolve a depreciação por algarismos da soma dos anos de um activo durante um período especificado -TBILLEQ = OTN ## Devolve o lucro de um título equivalente a uma Obrigação do Tesouro -TBILLPRICE = OTNVALOR ## Devolve o preço por € 100 de valor nominal de uma Obrigação do Tesouro -TBILLYIELD = OTNLUCRO ## Devolve o lucro de uma Obrigação do Tesouro -VDB = BDV ## Devolve a depreciação de um activo relativo a um período específico ou parcial utilizando um método de quotas degressivas -XIRR = XTIR ## Devolve a taxa interna de rentabilidade de um plano de fluxos monetários que não seja necessariamente periódica -XNPV = XVAL ## Devolve o valor actual líquido de um plano de fluxos monetários que não seja necessariamente periódico -YIELD = LUCRO ## Devolve o lucro de um título que paga juros periódicos -YIELDDISC = LUCRODESC ## Devolve o lucro anual de um título emitido abaixo do valor nominal, por exemplo, uma Obrigação do Tesouro -YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento - - -## -## Information functions Funções de informação -## -CELL = CÉL ## Devolve informações sobre a formatação, localização ou conteúdo de uma célula -ERROR.TYPE = TIPO.ERRO ## Devolve um número correspondente a um tipo de erro -INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual -ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco -ISERR = É.ERROS ## Devolve VERDADEIRO se o valor for um valor de erro diferente de #N/D -ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro -ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par -ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico -ISNA = É.NÃO.DISP ## Devolve VERDADEIRO se o valor for o valor de erro #N/D -ISNONTEXT = É.NÃO.TEXTO ## Devolve VERDADEIRO se o valor não for texto -ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número -ISODD = ÉÃMPAR ## Devolve VERDADEIRO se o número for ímpar -ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência -ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto -N = N ## Devolve um valor convertido num número -NA = NÃO.DISP ## Devolve o valor de erro #N/D -TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor - - -## -## Logical functions Funções lógicas -## -AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO -FALSE = FALSO ## Devolve o valor lógico FALSO -IF = SE ## Especifica um teste lógico a ser executado -IFERROR = SE.ERRO ## Devolve um valor definido pelo utilizador se ocorrer um erro na fórmula, e devolve o resultado da fórmula se não ocorrer nenhum erro -NOT = NÃO ## Inverte a lógica do respectivo argumento -OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO -TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO - - -## -## Lookup and reference functions Funções de pesquisa e referência -## -ADDRESS = ENDEREÇO ## Devolve uma referência a uma única célula numa folha de cálculo como texto -AREAS = ÃREAS ## Devolve o número de áreas numa referência -CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores -COLUMN = COL ## Devolve o número da coluna de uma referência -COLUMNS = COLS ## Devolve o número de colunas numa referência -HLOOKUP = PROCH ## Procura na linha superior de uma matriz e devolve o valor da célula indicada -HYPERLINK = HIPERLIGAÇÃO ## Cria um atalho ou hiperligação que abre um documento armazenado num servidor de rede, numa intranet ou na Internet -INDEX = ÃNDICE ## Utiliza um índice para escolher um valor de uma referência ou de uma matriz -INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto -LOOKUP = PROC ## Procura valores num vector ou numa matriz -MATCH = CORRESP ## Procura valores numa referência ou numa matriz -OFFSET = DESLOCAMENTO ## Devolve o deslocamento de referência de uma determinada referência -ROW = LIN ## Devolve o número da linha de uma referência -ROWS = LINS ## Devolve o número de linhas numa referência -RTD = RTD ## Obtém dados em tempo real a partir de um programa que suporte automatização COM (automatização: modo de trabalhar com objectos de uma aplicação a partir de outra aplicação ou ferramenta de desenvolvimento. Anteriormente conhecida como automatização OLE, a automatização é uma norma da indústria de software e uma funcionalidade COM (Component Object Model).) -TRANSPOSE = TRANSPOR ## Devolve a transposição de uma matriz -VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e percorre a linha para devolver o valor de uma célula - - -## -## Math and trigonometry functions Funções matemáticas e trigonométricas -## -ABS = ABS ## Devolve o valor absoluto de um número -ACOS = ACOS ## Devolve o arco de co-seno de um número -ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número -ASIN = ASEN ## Devolve o arco de seno de um número -ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número -ATAN = ATAN ## Devolve o arco de tangente de um número -ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y -ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número -CEILING = ARRED.EXCESSO ## Arredonda um número para o número inteiro mais próximo ou para o múltiplo de significância mais próximo -COMBIN = COMBIN ## Devolve o número de combinações de um determinado número de objectos -COS = COS ## Devolve o co-seno de um número -COSH = COSH ## Devolve o co-seno hiperbólico de um número -DEGREES = GRAUS ## Converte radianos em graus -EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo -EXP = EXP ## Devolve e elevado à potência de um determinado número -FACT = FACTORIAL ## Devolve o factorial de um número -FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo de um número -FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero -GCD = MDC ## Devolve o maior divisor comum -INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo -LCM = MMC ## Devolve o mínimo múltiplo comum -LN = LN ## Devolve o logaritmo natural de um número -LOG = LOG ## Devolve o logaritmo de um número com uma base especificada -LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número -MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz -MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz -MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes -MOD = RESTO ## Devolve o resto da divisão -MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido -MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números -ODD = ÃMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo -PI = PI ## Devolve o valor de pi -POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência -PRODUCT = PRODUTO ## Multiplica os respectivos argumentos -QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão -RADIANS = RADIANOS ## Converte graus em radianos -RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1 -RANDBETWEEN = ALEATÓRIOENTRE ## Devolve um número aleatório entre os números especificados -ROMAN = ROMANO ## Converte um número árabe em romano, como texto -ROUND = ARRED ## Arredonda um número para um número de dígitos especificado -ROUNDDOWN = ARRED.PARA.BAIXO ## Arredonda um número por defeito até zero -ROUNDUP = ARRED.PARA.CIMA ## Arredonda um número por excesso, afastando-o de zero -SERIESSUM = SOMASÉRIE ## Devolve a soma de uma série de potências baseada na fórmula -SIGN = SINAL ## Devolve o sinal de um número -SIN = SEN ## Devolve o seno de um determinado ângulo -SINH = SENH ## Devolve o seno hiperbólico de um número -SQRT = RAIZQ ## Devolve uma raiz quadrada positiva -SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi) -SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados -SUM = SOMA ## Adiciona os respectivos argumentos -SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério -SUMIFS = SOMA.SE.S ## Adiciona as células num intervalo que cumpre vários critérios -SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes -SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos -SUMX2MY2 = SOMAX2DY2 ## Devolve a soma da diferença dos quadrados dos valores correspondentes em duas matrizes -SUMX2PY2 = SOMAX2SY2 ## Devolve a soma da soma dos quadrados dos valores correspondentes em duas matrizes -SUMXMY2 = SOMAXMY2 ## Devolve a soma dos quadrados da diferença dos valores correspondentes em duas matrizes -TAN = TAN ## Devolve a tangente de um número -TANH = TANH ## Devolve a tangente hiperbólica de um número -TRUNC = TRUNCAR ## Trunca um número para um número inteiro - - -## -## Statistical functions Funções estatísticas -## -AVEDEV = DESV.MÉDIO ## Devolve a média aritmética dos desvios absolutos à média dos pontos de dados -AVERAGE = MÉDIA ## Devolve a média dos respectivos argumentos -AVERAGEA = MÉDIAA ## Devolve uma média dos respectivos argumentos, incluindo números, texto e valores lógicos -AVERAGEIF = MÉDIA.SE ## Devolve a média aritmética de todas as células num intervalo que cumprem determinado critério -AVERAGEIFS = MÉDIA.SE.S ## Devolve a média aritmética de todas as células que cumprem múltiplos critérios -BETADIST = DISTBETA ## Devolve a função de distribuição cumulativa beta -BETAINV = BETA.ACUM.INV ## Devolve o inverso da função de distribuição cumulativa relativamente a uma distribuição beta específica -BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual -CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada -CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada -CHITEST = TESTE.CHI ## Devolve o teste para independência -CONFIDENCE = INT.CONFIANÇA ## Devolve o intervalo de confiança correspondente a uma média de população -CORREL = CORREL ## Devolve o coeficiente de correlação entre dois conjuntos de dados -COUNT = CONTAR ## Conta os números que existem na lista de argumentos -COUNTA = CONTAR.VAL ## Conta os valores que existem na lista de argumentos -COUNTBLANK = CONTAR.VAZIO ## Conta o número de células em branco num intervalo -COUNTIF = CONTAR.SE ## Calcula o número de células num intervalo que corresponde aos critérios determinados -COUNTIFS = CONTAR.SE.S ## Conta o número de células num intervalo que cumprem múltiplos critérios -COVAR = COVAR ## Devolve a covariância, que é a média dos produtos de desvios de pares -CRITBINOM = CRIT.BINOM ## Devolve o menor valor em que a distribuição binomial cumulativa é inferior ou igual a um valor de critério -DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios -EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial -FDIST = DISTF ## Devolve a distribuição da probabilidade F -FINV = INVF ## Devolve o inverso da distribuição da probabilidade F -FISHER = FISHER ## Devolve a transformação Fisher -FISHERINV = FISHERINV ## Devolve o inverso da transformação Fisher -FORECAST = PREVISÃO ## Devolve um valor ao longo de uma tendência linear -FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical -FTEST = TESTEF ## Devolve o resultado de um teste F -GAMMADIST = DISTGAMA ## Devolve a distribuição gama -GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa -GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x) -GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica -GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial -HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica -HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica -INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear -KURT = CURT ## Devolve a curtose de um conjunto de dados -LARGE = MAIOR ## Devolve o maior valor k-ésimo de um conjunto de dados -LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear -LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial -LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica -LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa -MAX = MÃXIMO ## Devolve o valor máximo numa lista de argumentos -MAXA = MÃXIMOA ## Devolve o valor máximo numa lista de argumentos, incluindo números, texto e valores lógicos -MEDIAN = MED ## Devolve a mediana dos números indicados -MIN = MÃNIMO ## Devolve o valor mínimo numa lista de argumentos -MINA = MÃNIMOA ## Devolve o valor mínimo numa lista de argumentos, incluindo números, texto e valores lógicos -MODE = MODA ## Devolve o valor mais comum num conjunto de dados -NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa -NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal -NORMINV = INV.NORM ## Devolve o inverso da distribuição cumulativa normal -NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão -NORMSINV = INV.NORMP ## Devolve o inverso da distribuição cumulativa normal padrão -PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson -PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo -PERCENTRANK = ORDEM.PERCENTUAL ## Devolve a ordem percentual de um valor num conjunto de dados -PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos -POISSON = POISSON ## Devolve a distribuição de Poisson -PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites -QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados -RANK = ORDEM ## Devolve a ordem de um número numa lista numérica -RSQ = RQUAD ## Devolve o quadrado do coeficiente de correlação momento/produto de Pearson -SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição -SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear -SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados -STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado -STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra -STDEVA = DESVPADA ## Calcula o desvio-padrão com base numa amostra, incluindo números, texto e valores lógicos -STDEVP = DESVPADP ## Calcula o desvio-padrão com base na população total -STDEVPA = DESVPADPA ## Calcula o desvio-padrão com base na população total, incluindo números, texto e valores lógicos -STEYX = EPADYX ## Devolve o erro-padrão do valor de y previsto para cada x na regressão -TDIST = DISTT ## Devolve a distribuição t de Student -TINV = INVT ## Devolve o inverso da distribuição t de Student -TREND = TENDÊNCIA ## Devolve valores ao longo de uma tendência linear -TRIMMEAN = MÉDIA.INTERNA ## Devolve a média do interior de um conjunto de dados -TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student -VAR = VAR ## Calcula a variância com base numa amostra -VARA = VARA ## Calcula a variância com base numa amostra, incluindo números, texto e valores lógicos -VARP = VARP ## Calcula a variância com base na população total -VARPA = VARPA ## Calcula a variância com base na população total, incluindo números, texto e valores lógicos -WEIBULL = WEIBULL ## Devolve a distribuição Weibull -ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z - - -## -## Text functions Funções de texto -## -ASC = ASC ## Altera letras ou katakana de largura total (byte duplo) numa cadeia de caracteres para caracteres de largura média (byte único) -BAHTTEXT = TEXTO.BAHT ## Converte um número em texto, utilizando o formato monetário ß (baht) -CHAR = CARÃCT ## Devolve o carácter especificado pelo número de código -CLEAN = LIMPAR ## Remove do texto todos os caracteres não imprimíveis -CODE = CÓDIGO ## Devolve um código numérico correspondente ao primeiro carácter numa cadeia de texto -CONCATENATE = CONCATENAR ## Agrupa vários itens de texto num único item de texto -DOLLAR = MOEDA ## Converte um número em texto, utilizando o formato monetário € (Euro) -EXACT = EXACTO ## Verifica se dois valores de texto são idênticos -FIND = LOCALIZAR ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas) -FINDB = LOCALIZARB ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas) -FIXED = FIXA ## Formata um número como texto com um número fixo de decimais -JIS = JIS ## Altera letras ou katakana de largura média (byte único) numa cadeia de caracteres para caracteres de largura total (byte duplo) -LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto -LEFTB = ESQUERDAB ## Devolve os caracteres mais à esquerda de um valor de texto -LEN = NÚM.CARACT ## Devolve o número de caracteres de uma cadeia de texto -LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto -LOWER = MINÚSCULAS ## Converte o texto em minúsculas -MID = SEG.TEXTO ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada -MIDB = SEG.TEXTOB ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada -PHONETIC = FONÉTICA ## Retira os caracteres fonéticos (furigana) de uma cadeia de texto -PROPER = INICIAL.MAIÚSCULA ## Coloca em maiúsculas a primeira letra de cada palavra de um valor de texto -REPLACE = SUBSTITUIR ## Substitui caracteres no texto -REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto -REPT = REPETIR ## Repete texto um determinado número de vezes -RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto -RIGHTB = DIREITAB ## Devolve os caracteres mais à direita de um valor de texto -SEARCH = PROCURAR ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas) -SEARCHB = PROCURARB ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas) -SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto -T = T ## Converte os respectivos argumentos em texto -TEXT = TEXTO ## Formata um número e converte-o em texto -TRIM = COMPACTAR ## Remove espaços do texto -UPPER = MAIÚSCULAS ## Converte texto em maiúsculas -VALUE = VALOR ## Converte um argumento de texto num número diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/config deleted file mode 100644 index c9fb56930e..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = Ñ€ - - -## -## Excel Error Codes (For future use) -## -NULL = #ПУСТО! -DIV0 = #ДЕЛ/0! -VALUE = #ЗÐÐЧ! -REF = #ССЫЛ! -NAME = #ИМЯ? -NUM = #ЧИСЛО! -NA = #Ð/Д diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/functions deleted file mode 100644 index 37a5d4da3b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/ru/functions +++ /dev/null @@ -1,438 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Calculation -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## Data in this file derived from information provided by web-junior (http://www.web-junior.net/) -## -## - - -## -## Add-in and Automation functions Функции надÑтроек и автоматизации -## -GETPIVOTDATA = ПОЛУЧИТЬ.ДÐÐÐЫЕ.СВОДÐОЙ.ТÐБЛИЦЫ ## Возвращает данные, хранÑщиеÑÑ Ð² отчете Ñводной таблицы. - - -## -## Cube functions Функции Куб -## -CUBEKPIMEMBER = КУБЭЛЕМЕÐТКИП ## Возвращает ÑвойÑтво ключевого индикатора производительноÑти «(КИП)» и отображает Ð¸Ð¼Ñ Â«ÐšÐ˜ÐŸÂ» в Ñчейке. «КИП» предÑтавлÑет Ñобой количеÑтвенную величину, такую как ежемеÑÑÑ‡Ð½Ð°Ñ Ð²Ð°Ð»Ð¾Ð²Ð°Ñ Ð¿Ñ€Ð¸Ð±Ñ‹Ð»ÑŒ или ÐµÐ¶ÐµÐºÐ²Ð°Ñ€Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚ÐµÐºÑƒÑ‡ÐµÑть кадров, иÑпользуемой Ð´Ð»Ñ ÐºÐ¾Ð½Ñ‚Ñ€Ð¾Ð»Ñ ÑффективноÑти работы организации. -CUBEMEMBER = КУБЭЛЕМЕÐТ ## Возвращает Ñлемент или кортеж из куба. ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ ÑущеÑÑ‚Ð²Ð¾Ð²Ð°Ð½Ð¸Ñ Ñлемента или кортежа в кубе. -CUBEMEMBERPROPERTY = КУБСВОЙСТВОЭЛЕМЕÐТР## Возвращает значение ÑвойÑтва Ñлемента из куба. ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ñ€Ð¾Ð²ÐµÑ€ÐºÐ¸ ÑущеÑÑ‚Ð²Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¸Ð¼ÐµÐ½Ð¸ Ñлемента в кубе и возвращает указанное ÑвойÑтво Ð´Ð»Ñ Ñтого Ñлемента. -CUBERANKEDMEMBER = КУБПОРЭЛЕМЕÐТ ## Возвращает n-ый или ранжированный Ñлемент в множеÑтво. ИÑпользуетÑÑ Ð´Ð»Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ или неÑкольких Ñлементов в множеÑтво, например, лучшего продавца или 10 лучших Ñтудентов. -CUBESET = КУБМÐОЖ ## ОпределÑет вычиÑлительное множеÑтво Ñлементов или кортежей, отправлÑÑ Ð½Ð° Ñервер выражение, которое Ñоздает множеÑтво, а затем возвращает его в Microsoft Office Excel. -CUBESETCOUNT = КУБЧИСЛОЭЛМÐОЖ ## Возвращает чиÑло Ñлементов множеÑтва. -CUBEVALUE = КУБЗÐÐЧЕÐИЕ ## Возвращает обобщенное значение из куба. - - -## -## Database functions Функции Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ Ð±Ð°Ð·Ð°Ð¼Ð¸ данных -## -DAVERAGE = ДСРЗÐÐЧ ## Возвращает Ñреднее значение выбранных запиÑей базы данных. -DCOUNT = БСЧÐТ ## ПодÑчитывает количеÑтво чиÑловых Ñчеек в базе данных. -DCOUNTA = БСЧÐТР## ПодÑчитывает количеÑтво непуÑтых Ñчеек в базе данных. -DGET = БИЗВЛЕЧЬ ## Извлекает из базы данных одну запиÑÑŒ, удовлетворÑющую заданному уÑловию. -DMAX = ДМÐКС ## Возвращает макÑимальное значение Ñреди выделенных запиÑей базы данных. -DMIN = ДМИР## Возвращает минимальное значение Ñреди выделенных запиÑей базы данных. -DPRODUCT = БДПРОИЗВЕД ## Перемножает Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð½Ð¾Ð³Ð¾ Ð¿Ð¾Ð»Ñ Ð² запиÑÑÑ… базы данных, удовлетворÑющих уÑловию. -DSTDEV = ДСТÐÐДОТКЛ ## Оценивает Ñтандартное отклонение по выборке Ð´Ð»Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð½Ñ‹Ñ… запиÑей базы данных. -DSTDEVP = ДСТÐÐДОТКЛП ## ВычиÑлÑет Ñтандартное отклонение по генеральной ÑовокупноÑти Ð´Ð»Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð½Ñ‹Ñ… запиÑей базы данных -DSUM = БДСУММ ## Суммирует чиÑла в поле Ð´Ð»Ñ Ð·Ð°Ð¿Ð¸Ñей базы данных, удовлетворÑющих уÑловию. -DVAR = БДДИСП ## Оценивает диÑперÑию по выборке из выделенных запиÑей базы данных -DVARP = БДДИСПП ## ВычиÑлÑет диÑперÑию по генеральной ÑовокупноÑти Ð´Ð»Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð½Ñ‹Ñ… запиÑей базы данных - - -## -## Date and time functions Функции даты и времени -## -DATE = ДÐТР## Возвращает заданную дату в чиÑловом формате. -DATEVALUE = ДÐТÐЗÐÐЧ ## Преобразует дату из текÑтового формата в чиÑловой формат. -DAY = ДЕÐЬ ## Преобразует дату в чиÑловом формате в день меÑÑца. -DAYS360 = ДÐЕЙ360 ## ВычиÑлÑет количеÑтво дней между Ð´Ð²ÑƒÐ¼Ñ Ð´Ð°Ñ‚Ð°Ð¼Ð¸ на оÑнове 360-дневного года. -EDATE = ДÐТÐМЕС ## Возвращает дату в чиÑловом формате, отÑтоÑщую на заданное чиÑло меÑÑцев вперед или назад от начальной даты. -EOMONTH = КОÐМЕСЯЦР## Возвращает дату в чиÑловом формате Ð´Ð»Ñ Ð¿Ð¾Ñледнего Ð´Ð½Ñ Ð¼ÐµÑÑца, отÑтоÑщего вперед или назад на заданное чиÑло меÑÑцев. -HOUR = ЧÐС ## Преобразует дату в чиÑловом формате в чаÑÑ‹. -MINUTE = МИÐУТЫ ## Преобразует дату в чиÑловом формате в минуты. -MONTH = МЕСЯЦ ## Преобразует дату в чиÑловом формате в меÑÑцы. -NETWORKDAYS = ЧИСТРÐБДÐИ ## Возвращает количеÑтво рабочих дней между Ð´Ð²ÑƒÐ¼Ñ Ð´Ð°Ñ‚Ð°Ð¼Ð¸. -NOW = ТДÐТР## Возвращает текущую дату и Ð²Ñ€ÐµÐ¼Ñ Ð² чиÑловом формате. -SECOND = СЕКУÐДЫ ## Преобразует дату в чиÑловом формате в Ñекунды. -TIME = ВРЕМЯ ## Возвращает заданное Ð²Ñ€ÐµÐ¼Ñ Ð² чиÑловом формате. -TIMEVALUE = ВРЕМЗÐÐЧ ## Преобразует Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð· текÑтового формата в чиÑловой формат. -TODAY = СЕГОДÐЯ ## Возвращает текущую дату в чиÑловом формате. -WEEKDAY = ДЕÐЬÐЕД ## Преобразует дату в чиÑловом формате в день недели. -WEEKNUM = ÐОМÐЕДЕЛИ ## Преобразует чиÑловое предÑтавление в чиÑло, которое указывает, на какую неделю года приходитÑÑ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð°Ñ Ð´Ð°Ñ‚Ð°. -WORKDAY = РÐБДЕÐЬ ## Возвращает дату в чиÑловом формате, отÑтоÑщую вперед или назад на заданное количеÑтво рабочих дней. -YEAR = ГОД ## Преобразует дату в чиÑловом формате в год. -YEARFRAC = ДОЛЯГОДР## Возвращает долю года, которую ÑоÑтавлÑет количеÑтво дней между начальной и конечной датами. - - -## -## Engineering functions Инженерные функции -## -BESSELI = БЕССЕЛЬ.I ## Возвращает модифицированную функцию БеÑÑÐµÐ»Ñ In(x). -BESSELJ = БЕССЕЛЬ.J ## Возвращает функцию БеÑÑÐµÐ»Ñ Jn(x). -BESSELK = БЕССЕЛЬ.K ## Возвращает модифицированную функцию БеÑÑÐµÐ»Ñ Kn(x). -BESSELY = БЕССЕЛЬ.Y ## Возвращает функцию БеÑÑÐµÐ»Ñ Yn(x). -BIN2DEC = ДВ.Ð’.ДЕС ## Преобразует двоичное чиÑло в деÑÑтичное. -BIN2HEX = ДВ.Ð’.ШЕСТР## Преобразует двоичное чиÑло в шеÑтнадцатеричное. -BIN2OCT = ДВ.Ð’.ВОСЬМ ## Преобразует двоичное чиÑло в воÑьмеричное. -COMPLEX = КОМПЛЕКСР## Преобразует коÑффициенты при вещеÑтвенной и мнимой чаÑÑ‚ÑÑ… комплекÑного чиÑла в комплекÑное чиÑло. -CONVERT = ПРЕОБР ## Преобразует чиÑло из одной ÑиÑтемы единиц Ð¸Ð·Ð¼ÐµÑ€ÐµÐ½Ð¸Ñ Ð² другую. -DEC2BIN = ДЕС.Ð’.ДВ ## Преобразует деÑÑтичное чиÑло в двоичное. -DEC2HEX = ДЕС.Ð’.ШЕСТР## Преобразует деÑÑтичное чиÑло в шеÑтнадцатеричное. -DEC2OCT = ДЕС.Ð’.ВОСЬМ ## Преобразует деÑÑтичное чиÑло в воÑьмеричное. -DELTA = ДЕЛЬТР## ПроверÑет равенÑтво двух значений. -ERF = ФОШ ## Возвращает функцию ошибки. -ERFC = ДФОШ ## Возвращает дополнительную функцию ошибки. -GESTEP = ПОРОГ ## ПроверÑет, не превышает ли данное чиÑло порогового значениÑ. -HEX2BIN = ШЕСТÐ.Ð’.ДВ ## Преобразует шеÑтнадцатеричное чиÑло в двоичное. -HEX2DEC = ШЕСТÐ.Ð’.ДЕС ## Преобразует шеÑтнадцатеричное чиÑло в деÑÑтичное. -HEX2OCT = ШЕСТÐ.Ð’.ВОСЬМ ## Преобразует шеÑтнадцатеричное чиÑло в воÑьмеричное. -IMABS = МÐИМ.ABS ## Возвращает абÑолютную величину (модуль) комплекÑного чиÑла. -IMAGINARY = МÐИМ.ЧÐСТЬ ## Возвращает коÑффициент при мнимой чаÑти комплекÑного чиÑла. -IMARGUMENT = МÐИМ.ÐРГУМЕÐТ ## Возвращает значение аргумента комплекÑного чиÑла (тета) — угол, выраженный в радианах. -IMCONJUGATE = МÐИМ.СОПРЯЖ ## Возвращает комплекÑно-ÑопрÑженное комплекÑное чиÑло. -IMCOS = МÐИМ.COS ## Возвращает коÑÐ¸Ð½ÑƒÑ ÐºÐ¾Ð¼Ð¿Ð»ÐµÐºÑного чиÑла. -IMDIV = МÐИМ.ДЕЛ ## Возвращает чаÑтное от Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð´Ð²ÑƒÑ… комплекÑных чиÑел. -IMEXP = МÐИМ.EXP ## Возвращает ÑкÑпоненту комплекÑного чиÑла. -IMLN = МÐИМ.LN ## Возвращает натуральный логарифм комплекÑного чиÑла. -IMLOG10 = МÐИМ.LOG10 ## Возвращает обычный (деÑÑтичный) логарифм комплекÑного чиÑла. -IMLOG2 = МÐИМ.LOG2 ## Возвращает двоичный логарифм комплекÑного чиÑла. -IMPOWER = МÐИМ.СТЕПЕÐЬ ## Возвращает комплекÑное чиÑло, возведенное в целую Ñтепень. -IMPRODUCT = МÐИМ.ПРОИЗВЕД ## Возвращает произведение от 2 до 29 комплекÑных чиÑел. -IMREAL = МÐИМ.ВЕЩ ## Возвращает коÑффициент при вещеÑтвенной чаÑти комплекÑного чиÑла. -IMSIN = МÐИМ.SIN ## Возвращает ÑÐ¸Ð½ÑƒÑ ÐºÐ¾Ð¼Ð¿Ð»ÐµÐºÑного чиÑла. -IMSQRT = МÐИМ.КОРЕÐЬ ## Возвращает значение квадратного ÐºÐ¾Ñ€Ð½Ñ Ð¸Ð· комплекÑного чиÑла. -IMSUB = МÐИМ.РÐЗР## Возвращает разноÑть двух комплекÑных чиÑел. -IMSUM = МÐИМ.СУММ ## Возвращает Ñумму комплекÑных чиÑел. -OCT2BIN = ВОСЬМ.Ð’.ДВ ## Преобразует воÑьмеричное чиÑло в двоичное. -OCT2DEC = ВОСЬМ.Ð’.ДЕС ## Преобразует воÑьмеричное чиÑло в деÑÑтичное. -OCT2HEX = ВОСЬМ.Ð’.ШЕСТР## Преобразует воÑьмеричное чиÑло в шеÑтнадцатеричное. - - -## -## Financial functions ФинанÑовые функции -## -ACCRINT = ÐÐКОПДОХОД ## Возвращает накопленный процент по ценным бумагам Ñ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑкой выплатой процентов. -ACCRINTM = ÐÐКОПДОХОДПОГÐШ ## Возвращает накопленный процент по ценным бумагам, проценты по которым выплачиваютÑÑ Ð² Ñрок погашениÑ. -AMORDEGRC = ÐМОРУМ ## Возвращает величину амортизации Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ периода, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ ÐºÐ¾Ñффициент амортизации. -AMORLINC = ÐМОРУВ ## Возвращает величину амортизации Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ периода. -COUPDAYBS = ДÐЕЙКУПОÐДО ## Возвращает количеÑтво дней от начала дейÑÑ‚Ð²Ð¸Ñ ÐºÑƒÐ¿Ð¾Ð½Ð° до даты ÑоглашениÑ. -COUPDAYS = ДÐЕЙКУПОР## Возвращает чиÑло дней в периоде купона, Ñодержащем дату ÑоглашениÑ. -COUPDAYSNC = ДÐЕЙКУПОÐПОСЛЕ ## Возвращает чиÑло дней от даты ÑÐ¾Ð³Ð»Ð°ÑˆÐµÐ½Ð¸Ñ Ð´Ð¾ Ñрока Ñледующего купона. -COUPNCD = ДÐТÐКУПОÐПОСЛЕ ## Возвращает Ñледующую дату купона поÑле даты ÑоглашениÑ. -COUPNUM = ЧИСЛКУПОР## Возвращает количеÑтво купонов, которые могут быть оплачены между датой ÑÐ¾Ð³Ð»Ð°ÑˆÐµÐ½Ð¸Ñ Ð¸ Ñроком вÑÑ‚ÑƒÐ¿Ð»ÐµÐ½Ð¸Ñ Ð² Ñилу. -COUPPCD = ДÐТÐКУПОÐДО ## Возвращает предыдущую дату купона перед датой ÑоглашениÑ. -CUMIPMT = ОБЩПЛÐТ ## Возвращает общую выплату, произведенную между Ð´Ð²ÑƒÐ¼Ñ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑкими выплатами. -CUMPRINC = ОБЩДОХОД ## Возвращает общую выплату по займу между Ð´Ð²ÑƒÐ¼Ñ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð°Ð¼Ð¸. -DB = ФУО ## Возвращает величину амортизации актива Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ периода, раÑÑчитанную методом фикÑированного ÑƒÐ¼ÐµÐ½ÑŒÑˆÐµÐ½Ð¸Ñ Ð¾Ñтатка. -DDB = ДДОБ ## Возвращает величину амортизации актива за данный период, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð¼ÐµÑ‚Ð¾Ð´ двойного ÑƒÐ¼ÐµÐ½ÑŒÑˆÐµÐ½Ð¸Ñ Ð¾Ñтатка или иной Ñвно указанный метод. -DISC = СКИДКР## Возвращает норму Ñкидки Ð´Ð»Ñ Ñ†ÐµÐ½Ð½Ñ‹Ñ… бумаг. -DOLLARDE = РУБЛЬ.ДЕС ## Преобразует цену в рублÑÑ…, выраженную в виде дроби, в цену в рублÑÑ…, выраженную деÑÑтичным чиÑлом. -DOLLARFR = РУБЛЬ.ДРОБЬ ## Преобразует цену в рублÑÑ…, выраженную деÑÑтичным чиÑлом, в цену в рублÑÑ…, выраженную в виде дроби. -DURATION = ДЛИТ ## Возвращает ежегодную продолжительноÑть дейÑÑ‚Ð²Ð¸Ñ Ñ†ÐµÐ½Ð½Ñ‹Ñ… бумаг Ñ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑкими выплатами по процентам. -EFFECT = ЭФФЕКТ ## Возвращает дейÑтвующие ежегодные процентные Ñтавки. -FV = БС ## Возвращает будущую ÑтоимоÑть инвеÑтиции. -FVSCHEDULE = БЗРÐСПИС ## Возвращает будущую ÑтоимоÑть первоначальной оÑновной Ñуммы поÑле начиÑÐ»ÐµÐ½Ð¸Ñ Ñ€Ñда Ñложных процентов. -INTRATE = ИÐОРМР## Возвращает процентную Ñтавку Ð´Ð»Ñ Ð¿Ð¾Ð»Ð½Ð¾Ñтью инвеÑтированных ценных бумаг. -IPMT = ПРПЛТ ## Возвращает величину выплаты прибыли на Ð²Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð·Ð° данный период. -IRR = ВСД ## Возвращает внутреннюю Ñтавку доходноÑти Ð´Ð»Ñ Ñ€Ñда потоков денежных ÑредÑтв. -ISPMT = ПРОЦПЛÐТ ## ВычиÑлÑет выплаты за указанный период инвеÑтиции. -MDURATION = МДЛИТ ## Возвращает модифицированную длительноÑть ÐœÐ°ÐºÐ¾Ð»ÐµÑ Ð´Ð»Ñ Ñ†ÐµÐ½Ð½Ñ‹Ñ… бумаг Ñ Ð¿Ñ€ÐµÐ´Ð¿Ð¾Ð»Ð°Ð³Ð°ÐµÐ¼Ð¾Ð¹ номинальной ÑтоимоÑтью 100 рублей. -MIRR = МВСД ## Возвращает внутреннюю Ñтавку доходноÑти, при которой положительные и отрицательные денежные потоки имеют разные Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñтавки. -NOMINAL = ÐОМИÐÐЛ ## Возвращает номинальную годовую процентную Ñтавку. -NPER = КПЕР ## Возвращает общее количеÑтво периодов выплаты Ð´Ð»Ñ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ вклада. -NPV = ЧПС ## Возвращает чиÑтую приведенную ÑтоимоÑть инвеÑтиции, оÑнованной на Ñерии периодичеÑких денежных потоков и Ñтавке диÑконтированиÑ. -ODDFPRICE = ЦЕÐÐПЕРВÐЕРЕГ ## Возвращает цену за 100 рублей нарицательной ÑтоимоÑти ценных бумаг Ñ Ð½ÐµÑ€ÐµÐ³ÑƒÐ»Ñрным первым периодом. -ODDFYIELD = ДОХОДПЕРВÐЕРЕГ ## Возвращает доход по ценным бумагам Ñ Ð½ÐµÑ€ÐµÐ³ÑƒÐ»Ñрным первым периодом. -ODDLPRICE = ЦЕÐÐПОСЛÐЕРЕГ ## Возвращает цену за 100 рублей нарицательной ÑтоимоÑти ценных бумаг Ñ Ð½ÐµÑ€ÐµÐ³ÑƒÐ»Ñрным поÑледним периодом. -ODDLYIELD = ДОХОДПОСЛÐЕРЕГ ## Возвращает доход по ценным бумагам Ñ Ð½ÐµÑ€ÐµÐ³ÑƒÐ»Ñрным поÑледним периодом. -PMT = ПЛТ ## Возвращает величину выплаты за один период аннуитета. -PPMT = ОСПЛТ ## Возвращает величину выплат в погашение оÑновной Ñуммы по инвеÑтиции за заданный период. -PRICE = ЦЕÐÐ ## Возвращает цену за 100 рублей нарицательной ÑтоимоÑти ценных бумаг, по которым производитÑÑ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑÐºÐ°Ñ Ð²Ñ‹Ð¿Ð»Ð°Ñ‚Ð° процентов. -PRICEDISC = ЦЕÐÐСКИДКР## Возвращает цену за 100 рублей номинальной ÑтоимоÑти ценных бумаг, на которые Ñделана Ñкидка. -PRICEMAT = ЦЕÐÐПОГÐШ ## Возвращает цену за 100 рублей номинальной ÑтоимоÑти ценных бумаг, проценты по которым выплачиваютÑÑ Ð² Ñрок погашениÑ. -PV = ПС ## Возвращает приведенную (к текущему моменту) ÑтоимоÑть инвеÑтиции. -RATE = СТÐВКР## Возвращает процентную Ñтавку по аннуитету за один период. -RECEIVED = ПОЛУЧЕÐО ## Возвращает Ñумму, полученную к Ñроку Ð¿Ð¾Ð³Ð°ÑˆÐµÐ½Ð¸Ñ Ð¿Ð¾Ð»Ð½Ð¾Ñтью обеÑпеченных ценных бумаг. -SLN = ÐПЛ ## Возвращает величину линейной амортизации актива за один период. -SYD = ÐСЧ ## Возвращает величину амортизации актива за данный период, раÑÑчитанную методом Ñуммы годовых чиÑел. -TBILLEQ = РÐÐ’ÐОКЧЕК ## Возвращает Ñквивалентный облигации доход по казначейÑкому чеку. -TBILLPRICE = ЦЕÐÐКЧЕК ## Возвращает цену за 100 рублей нарицательной ÑтоимоÑти Ð´Ð»Ñ ÐºÐ°Ð·Ð½Ð°Ñ‡ÐµÐ¹Ñкого чека. -TBILLYIELD = ДОХОДКЧЕК ## Возвращает доход по казначейÑкому чеку. -VDB = ПУО ## Возвращает величину амортизации актива Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð³Ð¾ или чаÑтичного периода при иÑпользовании метода ÑокращающегоÑÑ Ð±Ð°Ð»Ð°Ð½Ñа. -XIRR = ЧИСТВÐДОХ ## Возвращает внутреннюю Ñтавку доходноÑти Ð´Ð»Ñ Ð³Ñ€Ð°Ñ„Ð¸ÐºÐ° денежных потоков, которые не обÑзательно ноÑÑÑ‚ периодичеÑкий характер. -XNPV = ЧИСТÐЗ ## Возвращает чиÑтую приведенную ÑтоимоÑть Ð´Ð»Ñ Ð´ÐµÐ½ÐµÐ¶Ð½Ñ‹Ñ… потоков, которые не обÑзательно ÑвлÑÑŽÑ‚ÑÑ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑкими. -YIELD = ДОХОД ## Возвращает доход от ценных бумаг, по которым производÑÑ‚ÑÑ Ð¿ÐµÑ€Ð¸Ð¾Ð´Ð¸Ñ‡ÐµÑкие выплаты процентов. -YIELDDISC = ДОХОДСКИДКР## Возвращает годовой доход по ценным бумагам, на которые Ñделана Ñкидка (пример — казначейÑкие чеки). -YIELDMAT = ДОХОДПОГÐШ ## Возвращает годовой доход от ценных бумаг, проценты по которым выплачиваютÑÑ Ð² Ñрок погашениÑ. - - -## -## Information functions Информационные функции -## -CELL = ЯЧЕЙКР## Возвращает информацию о формате, раÑположении или Ñодержимом Ñчейки. -ERROR.TYPE = ТИП.ОШИБКИ ## Возвращает чиÑловой код, ÑоответÑтвующий типу ошибки. -INFO = ИÐФОРМ ## Возвращает информацию о текущей операционной Ñреде. -ISBLANK = ЕПУСТО ## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑвлÑетÑÑ ÑÑылкой на пуÑтую Ñчейку. -ISERR = ЕОШ ## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑÑылаетÑÑ Ð½Ð° любое значение ошибки, кроме #Ð/Д. -ISERROR = ЕОШИБКР## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑÑылаетÑÑ Ð½Ð° любое значение ошибки. -ISEVEN = ЕЧÐТР## Возвращает значение ИСТИÐÐ, еÑли значение аргумента ÑвлÑетÑÑ Ñ‡ÐµÑ‚Ð½Ñ‹Ð¼ чиÑлом. -ISLOGICAL = ЕЛОГИЧ ## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑÑылаетÑÑ Ð½Ð° логичеÑкое значение. -ISNA = ЕÐД ## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑÑылаетÑÑ Ð½Ð° значение ошибки #Ð/Д. -ISNONTEXT = ЕÐЕТЕКСТ ## Возвращает значение ИСТИÐÐ, еÑли значение аргумента не ÑвлÑетÑÑ Ñ‚ÐµÐºÑтом. -ISNUMBER = ЕЧИСЛО ## Возвращает значение ИСТИÐÐ, еÑли аргумент ÑÑылаетÑÑ Ð½Ð° чиÑло. -ISODD = ЕÐЕЧÐТ ## Возвращает значение ИСТИÐÐ, еÑли значение аргумента ÑвлÑетÑÑ Ð½ÐµÑ‡ÐµÑ‚Ð½Ñ‹Ð¼ чиÑлом. -ISREF = ЕССЫЛКР## Возвращает значение ИСТИÐÐ, еÑли значение аргумента ÑвлÑетÑÑ ÑÑылкой. -ISTEXT = ЕТЕКСТ ## Возвращает значение ИСТИÐÐ, еÑли значение аргумента ÑвлÑетÑÑ Ñ‚ÐµÐºÑтом. -N = Ч ## Возвращает значение, преобразованное в чиÑло. -NA = ÐД ## Возвращает значение ошибки #Ð/Д. -TYPE = ТИП ## Возвращает чиÑло, обозначающее тип данных значениÑ. - - -## -## Logical functions ЛогичеÑкие функции -## -AND = И ## Renvoie VRAI si tous ses arguments sont VRAI. -FALSE = ЛОЖЬ ## Возвращает логичеÑкое значение ЛОЖЬ. -IF = ЕСЛИ ## ВыполнÑет проверку уÑловиÑ. -IFERROR = ЕСЛИОШИБКР## Возвращает введённое значение, еÑли вычиÑление по формуле вызывает ошибку; в противном Ñлучае Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‰Ð°ÐµÑ‚ результат вычиÑлениÑ. -NOT = ÐЕ ## МенÑет логичеÑкое значение Ñвоего аргумента на противоположное. -OR = ИЛИ ## Возвращает значение ИСТИÐÐ, еÑли Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один аргумент имеет значение ИСТИÐÐ. -TRUE = ИСТИÐÐ ## Возвращает логичеÑкое значение ИСТИÐÐ. - - -## -## Lookup and reference functions Функции ÑÑылки и поиÑка -## -ADDRESS = ÐДРЕС ## Возвращает ÑÑылку на отдельную Ñчейку лиÑта в виде текÑта. -AREAS = ОБЛÐСТИ ## Возвращает количеÑтво облаÑтей в ÑÑылке. -CHOOSE = ВЫБОР ## Выбирает значение из ÑпиÑка значений по индекÑу. -COLUMN = СТОЛБЕЦ ## Возвращает номер Ñтолбца, на который указывает ÑÑылка. -COLUMNS = ЧИСЛСТОЛБ ## Возвращает количеÑтво Ñтолбцов в ÑÑылке. -HLOOKUP = ГПР ## Ищет в первой Ñтроке маÑÑива и возвращает значение отмеченной Ñчейки -HYPERLINK = ГИПЕРССЫЛКР## Создает ÑÑылку, открывающую документ, который находитÑÑ Ð½Ð° Ñервере Ñети, в интраÑети или в Интернете. -INDEX = ИÐДЕКС ## ИÑпользует Ð¸Ð½Ð´ÐµÐºÑ Ð´Ð»Ñ Ð²Ñ‹Ð±Ð¾Ñ€Ð° Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¸Ð· ÑÑылки или маÑÑива. -INDIRECT = ДВССЫЛ ## Возвращает ÑÑылку, заданную текÑтовым значением. -LOOKUP = ПРОСМОТР ## Ищет Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² векторе или маÑÑиве. -MATCH = ПОИСКПОЗ ## Ищет Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² ÑÑылке или маÑÑиве. -OFFSET = СМЕЩ ## Возвращает Ñмещение ÑÑылки отноÑительно заданной ÑÑылки. -ROW = СТРОКР## Возвращает номер Ñтроки, определÑемой ÑÑылкой. -ROWS = ЧСТРОК ## Возвращает количеÑтво Ñтрок в ÑÑылке. -RTD = ДРВ ## Извлекает данные реального времени из программ, поддерживающих автоматизацию COM (Программирование объектов. Стандартное ÑредÑтво Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ Ð¾Ð±ÑŠÐµÐºÑ‚Ð°Ð¼Ð¸ некоторого Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¸Ð· другого Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¸Ð»Ð¸ ÑредÑтва разработки. Программирование объектов (ранее называемое программированием OLE) ÑвлÑетÑÑ Ñ„ÑƒÐ½ÐºÑ†Ð¸ÐµÐ¹ модели COM (Component Object Model, модель компонентных объектов).). -TRANSPOSE = ТРÐÐСП ## Возвращает транÑпонированный маÑÑив. -VLOOKUP = ВПР ## Ищет значение в первом Ñтолбце маÑÑива и возвращает значение из Ñчейки в найденной Ñтроке и указанном Ñтолбце. - - -## -## Math and trigonometry functions МатематичеÑкие и тригонометричеÑкие функции -## -ABS = ABS ## Возвращает модуль (абÑолютную величину) чиÑла. -ACOS = ACOS ## Возвращает арккоÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -ACOSH = ACOSH ## Возвращает гиперболичеÑкий арккоÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -ASIN = ASIN ## Возвращает аркÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -ASINH = ASINH ## Возвращает гиперболичеÑкий аркÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -ATAN = ATAN ## Возвращает Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ñ‡Ð¸Ñла. -ATAN2 = ATAN2 ## Возвращает Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ñ‹Ñ… координат x и y. -ATANH = ATANH ## Возвращает гиперболичеÑкий Ð°Ñ€ÐºÑ‚Ð°Ð½Ð³ÐµÐ½Ñ Ñ‡Ð¸Ñла. -CEILING = ОКРВВЕРХ ## ОкруглÑет чиÑло до ближайшего целого или до ближайшего кратного указанному значению. -COMBIN = ЧИСЛКОМБ ## Возвращает количеÑтво комбинаций Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ чиÑла объектов. -COS = COS ## Возвращает коÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -COSH = COSH ## Возвращает гиперболичеÑкий коÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -DEGREES = ГРÐДУСЫ ## Преобразует радианы в градуÑÑ‹. -EVEN = ЧÐТР## ОкруглÑет чиÑло до ближайшего четного целого. -EXP = EXP ## Возвращает чиÑло e, возведенное в указанную Ñтепень. -FACT = ФÐКТР ## Возвращает факториал чиÑла. -FACTDOUBLE = ДВФÐКТР ## Возвращает двойной факториал чиÑла. -FLOOR = ОКРВÐИЗ ## ОкруглÑет чиÑло до ближайшего меньшего по модулю значениÑ. -GCD = ÐОД ## Возвращает наибольший общий делитель. -INT = ЦЕЛОЕ ## ОкруглÑет чиÑло до ближайшего меньшего целого. -LCM = ÐОК ## Возвращает наименьшее общее кратное. -LN = LN ## Возвращает натуральный логарифм чиÑла. -LOG = LOG ## Возвращает логарифм чиÑла по заданному оÑнованию. -LOG10 = LOG10 ## Возвращает деÑÑтичный логарифм чиÑла. -MDETERM = МОПРЕД ## Возвращает определитель матрицы маÑÑива. -MINVERSE = МОБР ## Возвращает обратную матрицу маÑÑива. -MMULT = МУМÐОЖ ## Возвращает произведение матриц двух маÑÑивов. -MOD = ОСТÐТ ## Возвращает оÑтаток от делениÑ. -MROUND = ОКРУГЛТ ## Возвращает чиÑло, округленное Ñ Ñ‚Ñ€ÐµÐ±ÑƒÐµÐ¼Ð¾Ð¹ точноÑтью. -MULTINOMIAL = МУЛЬТИÐОМ ## Возвращает мультиномиальный коÑффициент множеÑтва чиÑел. -ODD = ÐЕЧÐТ ## ОкруглÑет чиÑло до ближайшего нечетного целого. -PI = ПИ ## Возвращает чиÑло пи. -POWER = СТЕПЕÐЬ ## Возвращает результат Ð²Ð¾Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ñ‡Ð¸Ñла в Ñтепень. -PRODUCT = ПРОИЗВЕД ## Возвращает произведение аргументов. -QUOTIENT = ЧÐСТÐОЕ ## Возвращает целую чаÑть чаÑтного при делении. -RADIANS = РÐДИÐÐЫ ## Преобразует градуÑÑ‹ в радианы. -RAND = СЛЧИС ## Возвращает Ñлучайное чиÑло в интервале от 0 до 1. -RANDBETWEEN = СЛУЧМЕЖДУ ## Возвращает Ñлучайное чиÑло в интервале между Ð´Ð²ÑƒÐ¼Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ñ‹Ð¼Ð¸ чиÑлами. -ROMAN = РИМСКОЕ ## Преобразует арабÑкие цифры в римÑкие в виде текÑта. -ROUND = ОКРУГЛ ## ОкруглÑет чиÑло до указанного количеÑтва деÑÑтичных разрÑдов. -ROUNDDOWN = ОКРУГЛВÐИЗ ## ОкруглÑет чиÑло до ближайшего меньшего по модулю значениÑ. -ROUNDUP = ОКРУГЛВВЕРХ ## ОкруглÑет чиÑло до ближайшего большего по модулю значениÑ. -SERIESSUM = РЯД.СУММ ## Возвращает Ñумму Ñтепенного Ñ€Ñда, вычиÑленную по формуле. -SIGN = ЗÐÐК ## Возвращает знак чиÑла. -SIN = SIN ## Возвращает ÑÐ¸Ð½ÑƒÑ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ угла. -SINH = SINH ## Возвращает гиперболичеÑкий ÑÐ¸Ð½ÑƒÑ Ñ‡Ð¸Ñла. -SQRT = КОРЕÐЬ ## Возвращает положительное значение квадратного корнÑ. -SQRTPI = КОРЕÐЬПИ ## Возвращает квадратный корень из Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ (чиÑло * ПИ). -SUBTOTAL = ПРОМЕЖУТОЧÐЫЕ.ИТОГИ ## Возвращает промежуточный итог в ÑпиÑке или базе данных. -SUM = СУММ ## Суммирует аргументы. -SUMIF = СУММЕСЛИ ## Суммирует Ñчейки, удовлетворÑющие заданному уÑловию. -SUMIFS = СУММЕСЛИМР## Суммирует диапазон Ñчеек, удовлетворÑющих неÑкольким уÑловиÑм. -SUMPRODUCT = СУММПРОИЗВ ## Возвращает Ñумму произведений ÑоответÑтвующих Ñлементов маÑÑивов. -SUMSQ = СУММКВ ## Возвращает Ñумму квадратов аргументов. -SUMX2MY2 = СУММРÐЗÐКВ ## Возвращает Ñумму разноÑтей квадратов ÑоответÑтвующих значений в двух маÑÑивах. -SUMX2PY2 = СУММСУММКВ ## Возвращает Ñумму Ñумм квадратов ÑоответÑтвующих Ñлементов двух маÑÑивов. -SUMXMY2 = СУММКВРÐЗР## Возвращает Ñумму квадратов разноÑтей ÑоответÑтвующих значений в двух маÑÑивах. -TAN = TAN ## Возвращает Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ñ‡Ð¸Ñла. -TANH = TANH ## Возвращает гиперболичеÑкий Ñ‚Ð°Ð½Ð³ÐµÐ½Ñ Ñ‡Ð¸Ñла. -TRUNC = ОТБР ## ОтбраÑывает дробную чаÑть чиÑла. - - -## -## Statistical functions СтатиÑтичеÑкие функции -## -AVEDEV = СРОТКЛ ## Возвращает Ñреднее арифметичеÑкое абÑолютных значений отклонений точек данных от Ñреднего. -AVERAGE = СРЗÐÐЧ ## Возвращает Ñреднее арифметичеÑкое аргументов. -AVERAGEA = СРЗÐÐЧР## Возвращает Ñреднее арифметичеÑкое аргументов, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -AVERAGEIF = СРЗÐÐЧЕСЛИ ## Возвращает Ñреднее значение (Ñреднее арифметичеÑкое) вÑех Ñчеек в диапазоне, которые удовлетворÑÑŽÑ‚ данному уÑловию. -AVERAGEIFS = СРЗÐÐЧЕСЛИМР## Возвращает Ñреднее значение (Ñреднее арифметичеÑкое) вÑех Ñчеек, которые удовлетворÑÑŽÑ‚ неÑкольким уÑловиÑм. -BETADIST = БЕТÐРÐСП ## Возвращает интегральную функцию бета-раÑпределениÑ. -BETAINV = БЕТÐОБР ## Возвращает обратную интегральную функцию указанного бета-раÑпределениÑ. -BINOMDIST = БИÐОМРÐСП ## Возвращает отдельное значение биномиального раÑпределениÑ. -CHIDIST = ХИ2РÐСП ## Возвращает одноÑтороннюю вероÑтноÑть раÑÐ¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ñ…Ð¸-квадрат. -CHIINV = ХИ2ОБР ## Возвращает обратное значение одноÑторонней вероÑтноÑти раÑÐ¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ñ…Ð¸-квадрат. -CHITEST = ХИ2ТЕСТ ## Возвращает теÑÑ‚ на незавиÑимоÑть. -CONFIDENCE = ДОВЕРИТ ## Возвращает доверительный интервал Ð´Ð»Ñ Ñреднего Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ генеральной ÑовокупноÑти. -CORREL = КОРРЕЛ ## Возвращает коÑффициент коррелÑции между Ð´Ð²ÑƒÐ¼Ñ Ð¼Ð½Ð¾Ð¶ÐµÑтвами данных. -COUNT = СЧÐТ ## ПодÑчитывает количеÑтво чиÑел в ÑпиÑке аргументов. -COUNTA = СЧÐТЗ ## ПодÑчитывает количеÑтво значений в ÑпиÑке аргументов. -COUNTBLANK = СЧИТÐТЬПУСТОТЫ ## ПодÑчитывает количеÑтво пуÑтых Ñчеек в диапазоне -COUNTIF = СЧÐТЕСЛИ ## ПодÑчитывает количеÑтво Ñчеек в диапазоне, удовлетворÑющих заданному уÑловию -COUNTIFS = СЧÐТЕСЛИМР## ПодÑчитывает количеÑтво Ñчеек внутри диапазона, удовлетворÑющих неÑкольким уÑловиÑм. -COVAR = КОВÐР ## Возвращает ковариацию, Ñреднее произведений парных отклонений -CRITBINOM = КРИТБИÐОМ ## Возвращает наименьшее значение, Ð´Ð»Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ð³Ð¾ интегральное биномиальное раÑпределение меньше или равно заданному критерию. -DEVSQ = КВÐДРОТКЛ ## Возвращает Ñумму квадратов отклонений. -EXPONDIST = ЭКСПРÐСП ## Возвращает ÑкÑпоненциальное раÑпределение. -FDIST = FРÐСП ## Возвращает F-раÑпределение вероÑтноÑти. -FINV = FРÐСПОБР ## Возвращает обратное значение Ð´Ð»Ñ F-раÑÐ¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð²ÐµÑ€Ð¾ÑтноÑти. -FISHER = ФИШЕР ## Возвращает преобразование Фишера. -FISHERINV = ФИШЕРОБР ## Возвращает обратное преобразование Фишера. -FORECAST = ПРЕДСКÐЗ ## Возвращает значение линейного тренда. -FREQUENCY = ЧÐСТОТР## Возвращает раÑпределение чаÑтот в виде вертикального маÑÑива. -FTEST = ФТЕСТ ## Возвращает результат F-теÑта. -GAMMADIST = ГÐММÐРÐСП ## Возвращает гамма-раÑпределение. -GAMMAINV = ГÐММÐОБР ## Возвращает обратное гамма-раÑпределение. -GAMMALN = ГÐММÐÐЛОГ ## Возвращает натуральный логарифм гамма функции, Γ(x). -GEOMEAN = СРГЕОМ ## Возвращает Ñреднее геометричеÑкое. -GROWTH = РОСТ ## Возвращает Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² ÑоответÑтвии Ñ ÑкÑпоненциальным трендом. -HARMEAN = СРГÐРМ ## Возвращает Ñреднее гармоничеÑкое. -HYPGEOMDIST = ГИПЕРГЕОМЕТ ## Возвращает гипергеометричеÑкое раÑпределение. -INTERCEPT = ОТРЕЗОК ## Возвращает отрезок, отÑекаемый на оÑи линией линейной регреÑÑии. -KURT = ЭКСЦЕСС ## Возвращает ÑкÑцеÑÑ Ð¼Ð½Ð¾Ð¶ÐµÑтва данных. -LARGE = ÐÐИБОЛЬШИЙ ## Возвращает k-ое наибольшее значение в множеÑтве данных. -LINEST = ЛИÐЕЙР## Возвращает параметры линейного тренда. -LOGEST = ЛГРФПРИБЛ ## Возвращает параметры ÑкÑпоненциального тренда. -LOGINV = ЛОГÐОРМОБР ## Возвращает обратное логарифмичеÑкое нормальное раÑпределение. -LOGNORMDIST = ЛОГÐОРМРÐСП ## Возвращает интегральное логарифмичеÑкое нормальное раÑпределение. -MAX = МÐКС ## Возвращает наибольшее значение в ÑпиÑке аргументов. -MAXA = МÐКСР## Возвращает наибольшее значение в ÑпиÑке аргументов, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -MEDIAN = МЕДИÐÐÐ ## Возвращает медиану заданных чиÑел. -MIN = МИР## Возвращает наименьшее значение в ÑпиÑке аргументов. -MINA = МИÐÐ ## Возвращает наименьшее значение в ÑпиÑке аргументов, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -MODE = МОДР## Возвращает значение моды множеÑтва данных. -NEGBINOMDIST = ОТРБИÐОМРÐСП ## Возвращает отрицательное биномиальное раÑпределение. -NORMDIST = ÐОРМРÐСП ## Возвращает нормальную функцию раÑпределениÑ. -NORMINV = ÐОРМОБР ## Возвращает обратное нормальное раÑпределение. -NORMSDIST = ÐОРМСТРÐСП ## Возвращает Ñтандартное нормальное интегральное раÑпределение. -NORMSINV = ÐОРМСТОБР ## Возвращает обратное значение Ñтандартного нормального раÑпределениÑ. -PEARSON = ПИРСОР## Возвращает коÑффициент коррелÑции ПирÑона. -PERCENTILE = ПЕРСЕÐТИЛЬ ## Возвращает k-ую перÑентиль Ð´Ð»Ñ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ð¹ диапазона. -PERCENTRANK = ПРОЦЕÐТРÐÐГ ## Возвращает процентную норму Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² множеÑтве данных. -PERMUT = ПЕРЕСТ ## Возвращает количеÑтво переÑтановок Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ чиÑла объектов. -POISSON = ПУÐССОР## Возвращает раÑпределение ПуаÑÑона. -PROB = ВЕРОЯТÐОСТЬ ## Возвращает вероÑтноÑть того, что значение из диапазона находитÑÑ Ð²Ð½ÑƒÑ‚Ñ€Ð¸ заданных пределов. -QUARTILE = КВÐРТИЛЬ ## Возвращает квартиль множеÑтва данных. -RANK = РÐÐГ ## Возвращает ранг чиÑла в ÑпиÑке чиÑел. -RSQ = КВПИРСОР## Возвращает квадрат коÑффициента коррелÑции ПирÑона. -SKEW = СКОС ## Возвращает аÑимметрию раÑпределениÑ. -SLOPE = ÐÐКЛОР## Возвращает наклон линии линейной регреÑÑии. -SMALL = ÐÐИМЕÐЬШИЙ ## Возвращает k-ое наименьшее значение в множеÑтве данных. -STANDARDIZE = ÐОРМÐЛИЗÐЦИЯ ## Возвращает нормализованное значение. -STDEV = СТÐÐДОТКЛОР## Оценивает Ñтандартное отклонение по выборке. -STDEVA = СТÐÐДОТКЛОÐÐ ## Оценивает Ñтандартное отклонение по выборке, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -STDEVP = СТÐÐДОТКЛОÐП ## ВычиÑлÑет Ñтандартное отклонение по генеральной ÑовокупноÑти. -STDEVPA = СТÐÐДОТКЛОÐПР## ВычиÑлÑет Ñтандартное отклонение по генеральной ÑовокупноÑти, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -STEYX = СТОШYX ## Возвращает Ñтандартную ошибку предÑказанных значений y Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ x в регреÑÑии. -TDIST = СТЬЮДРÐСП ## Возвращает t-раÑпределение Стьюдента. -TINV = СТЬЮДРÐСПОБР ## Возвращает обратное t-раÑпределение Стьюдента. -TREND = ТЕÐДЕÐЦИЯ ## Возвращает Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² ÑоответÑтвии Ñ Ð»Ð¸Ð½ÐµÐ¹Ð½Ñ‹Ð¼ трендом. -TRIMMEAN = УРЕЗСРЕДÐЕЕ ## Возвращает Ñреднее внутренноÑти множеÑтва данных. -TTEST = ТТЕСТ ## Возвращает вероÑтноÑть, ÑоответÑтвующую критерию Стьюдента. -VAR = ДИСП ## Оценивает диÑперÑию по выборке. -VARA = ДИСПР## Оценивает диÑперÑию по выборке, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -VARP = ДИСПР ## ВычиÑлÑет диÑперÑию Ð´Ð»Ñ Ð³ÐµÐ½ÐµÑ€Ð°Ð»ÑŒÐ½Ð¾Ð¹ ÑовокупноÑти. -VARPA = ДИСПРР## ВычиÑлÑет диÑперÑию Ð´Ð»Ñ Ð³ÐµÐ½ÐµÑ€Ð°Ð»ÑŒÐ½Ð¾Ð¹ ÑовокупноÑти, Ð²ÐºÐ»ÑŽÑ‡Ð°Ñ Ñ‡Ð¸Ñла, текÑÑ‚ и логичеÑкие значениÑ. -WEIBULL = ВЕЙБУЛЛ ## Возвращает раÑпределение Вейбулла. -ZTEST = ZТЕСТ ## Возвращает двуÑтороннее P-значение z-теÑта. - - -## -## Text functions ТекÑтовые функции -## -ASC = ASC ## Ð”Ð»Ñ Ñзыков Ñ Ð´Ð²ÑƒÑ…Ð±Ð°Ð¹Ñ‚Ð¾Ð²Ñ‹Ð¼Ð¸ наборами знаков (например, катакана) преобразует полноширинные (двухбайтовые) знаки в полуширинные (однобайтовые). -BAHTTEXT = БÐТТЕКСТ ## Преобразует чиÑло в текÑÑ‚, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð´ÐµÐ½ÐµÐ¶Ð½Ñ‹Ð¹ формат ß (БÐТ). -CHAR = СИМВОЛ ## Возвращает знак Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ñ‹Ð¼ кодом. -CLEAN = ПЕЧСИМВ ## УдалÑет вÑе непечатаемые знаки из текÑта. -CODE = КОДСИМВ ## Возвращает чиÑловой код первого знака в текÑтовой Ñтроке. -CONCATENATE = СЦЕПИТЬ ## ОбъединÑет неÑколько текÑтовых Ñлементов в один. -DOLLAR = РУБЛЬ ## Преобразует чиÑло в текÑÑ‚, иÑÐ¿Ð¾Ð»ÑŒÐ·ÑƒÑ Ð´ÐµÐ½ÐµÐ¶Ð½Ñ‹Ð¹ формат. -EXACT = СОВПÐД ## ПроверÑет идентичноÑть двух текÑтовых значений. -FIND = ÐÐЙТИ ## Ищет Ð²Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ текÑтового Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² другом (Ñ ÑƒÑ‡ÐµÑ‚Ð¾Ð¼ региÑтра). -FINDB = ÐÐЙТИБ ## Ищет Ð²Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ текÑтового Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² другом (Ñ ÑƒÑ‡ÐµÑ‚Ð¾Ð¼ региÑтра). -FIXED = ФИКСИРОВÐÐÐЫЙ ## Форматирует чиÑло и преобразует его в текÑÑ‚ Ñ Ð·Ð°Ð´Ð°Ð½Ð½Ñ‹Ð¼ чиÑлом деÑÑтичных знаков. -JIS = JIS ## Ð”Ð»Ñ Ñзыков Ñ Ð´Ð²ÑƒÑ…Ð±Ð°Ð¹Ñ‚Ð¾Ð²Ñ‹Ð¼Ð¸ наборами знаков (например, катакана) преобразует полуширинные (однобайтовые) знаки в текÑтовой Ñтроке в полноширинные (двухбайтовые). -LEFT = ЛЕВСИМВ ## Возвращает крайние Ñлева знаки текÑтового значениÑ. -LEFTB = ЛЕВБ ## Возвращает крайние Ñлева знаки текÑтового значениÑ. -LEN = ДЛСТР ## Возвращает количеÑтво знаков в текÑтовой Ñтроке. -LENB = ДЛИÐБ ## Возвращает количеÑтво знаков в текÑтовой Ñтроке. -LOWER = СТРОЧР## Преобразует вÑе буквы текÑта в Ñтрочные. -MID = ПСТР ## Возвращает заданное чиÑло знаков из Ñтроки текÑта, Ð½Ð°Ñ‡Ð¸Ð½Ð°Ñ Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¹ позиции. -MIDB = ПСТРБ ## Возвращает заданное чиÑло знаков из Ñтроки текÑта, Ð½Ð°Ñ‡Ð¸Ð½Ð°Ñ Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¹ позиции. -PHONETIC = PHONETIC ## Извлекает фонетичеÑкие (фуригана) знаки из текÑтовой Ñтроки. -PROPER = ПРОПÐÐЧ ## Преобразует первую букву в каждом Ñлове текÑта в пропиÑную. -REPLACE = ЗÐМЕÐИТЬ ## ЗаменÑет знаки в текÑте. -REPLACEB = ЗÐМЕÐИТЬБ ## ЗаменÑет знаки в текÑте. -REPT = ПОВТОР ## ПовторÑет текÑÑ‚ заданное чиÑло раз. -RIGHT = ПРÐВСИМВ ## Возвращает крайние Ñправа знаки текÑтовой Ñтроки. -RIGHTB = ПРÐВБ ## Возвращает крайние Ñправа знаки текÑтовой Ñтроки. -SEARCH = ПОИСК ## Ищет Ð²Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ текÑтового Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² другом (без учета региÑтра). -SEARCHB = ПОИСКБ ## Ищет Ð²Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ текÑтового Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² другом (без учета региÑтра). -SUBSTITUTE = ПОДСТÐВИТЬ ## ЗаменÑет в текÑтовой Ñтроке Ñтарый текÑÑ‚ новым. -T = Т ## Преобразует аргументы в текÑÑ‚. -TEXT = ТЕКСТ ## Форматирует чиÑло и преобразует его в текÑÑ‚. -TRIM = СЖПРОБЕЛЫ ## УдалÑет из текÑта пробелы. -UPPER = ПРОПИСР## Преобразует вÑе буквы текÑта в пропиÑные. -VALUE = ЗÐÐЧЕР## Преобразует текÑтовый аргумент в чиÑло. diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/config b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/config deleted file mode 100644 index afddea91d5..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/config +++ /dev/null @@ -1,47 +0,0 @@ -## -## PHPExcel -## -## Copyright (c) 2006 - 2011 PHPExcel -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## @category PHPExcel -## @package PHPExcel_Settings -## @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -## @version 1.7.6, 2011-02-27 -## -## - - -ArgumentSeparator = ; - - -## -## (For future use) -## -currencySymbol = kr - - -## -## Excel Error Codes (For future use) -## -NULL = #Skärning! -DIV0 = #Division/0! -VALUE = #Värdefel! -REF = #Referens! -NAME = #Namn? -NUM = #Ogiltigt! -NA = #Saknas! diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/functions b/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/functions deleted file mode 100644 index b1dd99522b..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/locale/sv/functions +++ /dev/null @@ -1,408 +0,0 @@ -## -## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner -## -GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport - - -## -## Cube functions Kubfunktioner -## -CUBEKPIMEMBER = KUBKPIMEDLEM ## Returnerar namn, egenskap och mÃ¥tt för en KPI och visar namnet och egenskapen i cellen. En KPI, eller prestandaindikator, är ett kvantifierbart mÃ¥tt, t.ex. mÃ¥natlig bruttovinst eller personalomsättning per kvartal, som används för att analysera ett företags resultat. -CUBEMEMBER = KUBMEDLEM ## Returnerar en medlem eller ett par i en kubhierarki. Används för att verifiera att medlemmen eller paret finns i kuben. -CUBEMEMBERPROPERTY = KUBMEDLEMSEGENSKAP ## Returnerar värdet för en medlemsegenskap i kuben. Används för att verifiera att ett medlemsnamn finns i kuben, samt för att returnera den angivna egenskapen för medlemmen. -CUBERANKEDMEMBER = KUBRANGORDNADMEDLEM ## Returnerar den n:te, eller rangordnade, medlemmen i en uppsättning. Används för att returnera ett eller flera element i en uppsättning, till exempelvis den bästa försäljaren eller de tio bästa eleverna. -CUBESET = KUBINSTÄLLNING ## Definierar en beräknad uppsättning medlemmar eller par genom att skicka ett bestämt uttryck till kuben pÃ¥ servern, som skapar uppsättningen och sedan returnerar den till Microsoft Office Excel. -CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning. -CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde frÃ¥n en kub. - - -## -## Database functions Databasfunktioner -## -DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna -DCOUNT = DANTAL ## Räknar antalet celler som innehÃ¥ller tal i en databas -DCOUNTA = DANTALV ## Räknar ifyllda celler i en databas -DGET = DHÄMTA ## Hämtar en enstaka post frÃ¥n en databas som uppfyller de angivna villkoren -DMAX = DMAX ## Returnerar det största värdet frÃ¥n databasposterna -DMIN = DMIN ## Returnerar det minsta värdet frÃ¥n databasposterna -DPRODUCT = DPRODUKT ## Multiplicerar värdena i ett visst fält i poster som uppfyller villkoret -DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat pÃ¥ ett urval av databasposterna -DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrÃ¥n hela populationen av valda databasposter -DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret -DVAR = DVARIANS ## Uppskattar variansen baserat pÃ¥ ett urval av databasposterna -DVARP = DVARIANSP ## Beräknar variansen utifrÃ¥n hela populationen av valda databasposter - - -## -## Date and time functions Tid- och datumfunktioner -## -DATE = DATUM ## Returnerar ett serienummer för ett visst datum -DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer -DAY = DAG ## Konverterar ett serienummer till dag i mÃ¥naden -DAYS360 = DAGAR360 ## Beräknar antalet dagar mellan tvÃ¥ datum baserat pÃ¥ ett 360-dagarsÃ¥r -EDATE = EDATUM ## Returnerar serienumret för ett datum som infaller ett visst antal mÃ¥nader före eller efter startdatumet -EOMONTH = SLUTMÃ…NAD ## Returnerar serienumret för sista dagen i mÃ¥naden ett visst antal mÃ¥nader tidigare eller senare -HOUR = TIMME ## Konverterar ett serienummer till en timme -MINUTE = MINUT ## Konverterar ett serienummer till en minut -MONTH = MÃ…NAD ## Konverterar ett serienummer till en mÃ¥nad -NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan tvÃ¥ datum -NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid -SECOND = SEKUND ## Konverterar ett serienummer till en sekund -TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid -TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer -TODAY = IDAG ## Returnerar serienumret för dagens datum -WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan -WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer -WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare -YEAR = Ã…R ## Konverterar ett serienummer till ett Ã¥r -YEARFRAC = Ã…RDEL ## Returnerar en del av ett Ã¥r som representerar antalet hela dagar mellan start- och slutdatum - - -## -## Engineering functions Tekniska funktioner -## -BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x) -BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x) -BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x) -BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x) -BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt -BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt -BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt -COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal -CONVERT = KONVERTERA ## Omvandlar ett tal frÃ¥n ett mÃ¥ttsystem till ett annat -DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt -DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt -DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt -DELTA = DELTA ## Testar om tvÃ¥ värden är lika -ERF = FELF ## Returnerar felfunktionen -ERFC = FELFK ## Returnerar den komplementära felfunktionen -GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde -HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt -HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt -HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt -IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal -IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten för ett komplext tal -IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer -IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat -IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal -IMDIV = IMDIV ## Returnerar kvoten för tvÃ¥ komplexa tal -IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal -IMLN = IMLN ## Returnerar den naturliga logaritmen för ett komplext tal -IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal -IMLOG2 = IMLOG2 ## Returnerar 2-logaritmen för ett komplext tal -IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent -IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal -IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal -IMSIN = IMSIN ## Returnerar sinus för ett komplext tal -IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal -IMSUB = IMDIFF ## Returnerar differensen mellan tvÃ¥ komplexa tal -IMSUM = IMSUM ## Returnerar summan av komplexa tal -OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt -OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt -OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt - - -## -## Financial functions Finansiella funktioner -## -ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta -ACCRINTM = UPPLOBLRÄNTA ## Returnerar den upplupna räntan för ett värdepapper som ger avkastning pÃ¥ förfallodagen -AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient -AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod -COUPDAYBS = KUPDAGBB ## Returnerar antal dagar frÃ¥n början av kupongperioden till likviddagen -COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehÃ¥ller betalningsdatumet -COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar frÃ¥n betalningsdatumet till nästa kupongdatum -COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen -COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen -COUPPCD = KUPFKD ## Returnerar föregÃ¥ende kupongdatum före likviddagen -CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan tvÃ¥ perioder -CUMPRINC = KUMPRIS ## Returnerar det ackumulerade kapitalbeloppet som betalats pÃ¥ ett lÃ¥n mellan tvÃ¥ perioder -DB = DB ## Returnerar avskrivningen för en tillgÃ¥ng under en angiven tid enligt metoden för fast degressiv avskrivning -DDB = DEGAVSKR ## Returnerar en tillgÃ¥ngs värdeminskning under en viss period med hjälp av dubbel degressiv avskrivning eller nÃ¥gon annan metod som du anger -DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper -DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett brÃ¥k till ett decimaltal -DOLLARFR = BRÃ…K ## Omvandlar ett pris i kronor uttryckt som ett decimaltal till ett brÃ¥k -DURATION = LÖPTID ## Returnerar den Ã¥rliga löptiden för en säkerhet med periodiska räntebetalningar -EFFECT = EFFRÄNTA ## Returnerar den Ã¥rliga effektiva räntesatsen -FV = SLUTVÄRDE ## Returnerar det framtida värdet pÃ¥ en investering -FVSCHEDULE = FÖRRÄNTNING ## Returnerar det framtida värdet av ett begynnelsekapital beräknat pÃ¥ olika räntenivÃ¥er -INTRATE = Ã…RSRÄNTA ## Returnerar räntesatsen för ett betalt värdepapper -IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period -IRR = IR ## Returnerar internräntan för en serie betalningar -ISPMT = RALÃ…N ## Beräknar räntan som har betalats under en specifik betalningsperiod -MDURATION = MLÖPTID ## Returnerar den modifierade Macauley-löptiden för ett värdepapper med det antagna nominella värdet 100 kr -MIRR = MODIR ## Returnerar internräntan där positiva och negativa betalningar finansieras med olika räntor -NOMINAL = NOMRÄNTA ## Returnerar den Ã¥rliga nominella räntesatsen -NPER = PERIODER ## Returnerar antalet perioder för en investering -NPV = NETNUVÄRDE ## Returnerar nuvärdet av en serie periodiska betalningar vid en given diskonteringsränta -ODDFPRICE = UDDAFPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda första period -ODDFYIELD = UDDAFAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda första period -ODDLPRICE = UDDASPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda sista period -ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period -PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet -PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period -PRICE = PRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger periodisk ränta -PRICEDISC = PRISDISK ## Returnerar priset per 100 kr nominellt värde för ett diskonterat värdepapper -PRICEMAT = PRISFÖRF ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger ränta pÃ¥ förfallodagen -PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar -RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet -RECEIVED = BELOPP ## Returnerar beloppet som utdelas pÃ¥ förfallodagen för ett betalat värdepapper -SLN = LINAVSKR ## Returnerar den linjära avskrivningen för en tillgÃ¥ng under en period -SYD = Ã…RSAVSKR ## Returnerar den Ã¥rliga avskrivningssumman för en tillgÃ¥ng under en angiven period -TBILLEQ = SSVXEKV ## Returnerar avkastningen motsvarande en obligation för en statsskuldväxel -TBILLPRICE = SSVXPRIS ## Returnerar priset per 100 kr nominellt värde för en statsskuldväxel -TBILLYIELD = SSVXRÄNTA ## Returnerar avkastningen för en statsskuldväxel -VDB = VDEGRAVSKR ## Returnerar avskrivningen för en tillgÃ¥ng under en angiven period (med degressiv avskrivning) -XIRR = XIRR ## Returnerar internräntan för en serie betalningar som inte nödvändigtvis är periodiska -XNPV = XNUVÄRDE ## Returnerar det nuvarande nettovärdet för en serie betalningar som inte nödvändigtvis är periodiska -YIELD = NOMAVK ## Returnerar avkastningen för ett värdepapper som ger periodisk ränta -YIELDDISC = NOMAVKDISK ## Returnerar den Ã¥rliga avkastningen för diskonterade värdepapper, exempelvis en statsskuldväxel -YIELDMAT = NOMAVKFÖRF ## Returnerar den Ã¥rliga avkastningen för ett värdepapper som ger ränta pÃ¥ förfallodagen - - -## -## Information functions Informationsfunktioner -## -CELL = CELL ## Returnerar information om formatering, plats och innehÃ¥ll i en cell -ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde -INFO = INFO ## Returnerar information om operativsystemet -ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt -ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS! -ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde -ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt -ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde -ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS! -ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text -ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal -ISODD = ÄRUDDA ## Returnerar SANT om talet är udda -ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens -ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text -N = N ## Returnerar ett värde omvandlat till ett tal -NA = SAKNAS ## Returnerar felvärdet #SAKNAS! -TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp - - -## -## Logical functions Logiska funktioner -## -AND = OCH ## Returnerar SANT om alla argument är sanna -FALSE = FALSKT ## Returnerar det logiska värdet FALSKT -IF = OM ## Anger vilket logiskt test som ska utföras -IFERROR = OMFEL ## Returnerar ett värde som du anger om en formel utvärderar till ett fel; annars returneras resultatet av formeln -NOT = ICKE ## Inverterar logiken för argumenten -OR = ELLER ## Returnerar SANT om nÃ¥got argument är SANT -TRUE = SANT ## Returnerar det logiska värdet SANT - - -## -## Lookup and reference functions Sök- och referensfunktioner -## -ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad -AREAS = OMRÃ…DEN ## Returnerar antalet omrÃ¥den i en referens -CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden -COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens -COLUMNS = KOLUMNER ## Returnerar antalet kolumner i en referens -HLOOKUP = LETAKOLUMN ## Söker i den översta raden i en matris och returnerar värdet för angiven cell -HYPERLINK = HYPERLÄNK ## Skapar en genväg eller ett hopp till ett dokument i nätverket, i ett intranät eller pÃ¥ Internet -INDEX = INDEX ## Använder ett index för ett välja ett värde i en referens eller matris -INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde -LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris -MATCH = PASSA ## Letar upp värden i en referens eller matris -OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhÃ¥llande till en given referens -ROW = RAD ## Returnerar radnumret för en referens -ROWS = RADER ## Returnerar antalet rader i en referens -RTD = RTD ## Hämtar realtidsdata frÃ¥n ett program som stöder COM-automation (Automation: Ett sätt att arbeta med ett programs objekt frÃ¥n ett annat program eller utvecklingsverktyg. Detta kallades tidigare för OLE Automation, och är en branschstandard och ingÃ¥r i Component Object Model (COM).) -TRANSPOSE = TRANSPONERA ## Transponerar en matris -VLOOKUP = LETARAD ## Letar i den första kolumnen i en matris och flyttar över raden för att returnera värdet för en cell - - -## -## Math and trigonometry functions Matematiska och trigonometriska funktioner -## -ABS = ABS ## Returnerar absolutvärdet av ett tal -ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal -ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal -ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal -ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal -ATAN = ARCTAN ## Returnerar arcus tangens för ett tal -ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat -ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal -CEILING = RUNDA.UPP ## Avrundar ett tal till närmaste heltal eller närmaste signifikanta multipel -COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt -COS = COS ## Returnerar cosinus för ett tal -COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal -DEGREES = GRADER ## Omvandlar radianer till grader -EVEN = JÄMN ## Avrundar ett tal uppÃ¥t till närmaste heltal -EXP = EXP ## Returnerar e upphöjt till ett givet tal -FACT = FAKULTET ## Returnerar fakulteten för ett tal -FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal -FLOOR = RUNDA.NED ## Avrundar ett tal nedÃ¥t mot noll -GCD = SGD ## Returnerar den största gemensamma nämnaren -INT = HELTAL ## Avrundar ett tal nedÃ¥t till närmaste heltal -LCM = MGM ## Returnerar den minsta gemensamma multipeln -LN = LN ## Returnerar den naturliga logaritmen för ett tal -LOG = LOG ## Returnerar logaritmen för ett tal för en given bas -LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal -MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris -MINVERSE = MINVERT ## Returnerar matrisinversen av en matris -MMULT = MMULT ## Returnerar matrisprodukten av tvÃ¥ matriser -MOD = REST ## Returnerar resten vid en division -MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel -MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal -ODD = UDDA ## Avrundar ett tal uppÃ¥t till närmaste udda heltal -PI = PI ## Returnerar värdet pi -POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent -PRODUCT = PRODUKT ## Multiplicerar argumenten -QUOTIENT = KVOT ## Returnerar heltalsdelen av en division -RADIANS = RADIANER ## Omvandlar grader till radianer -RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1 -RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger -ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text -ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror -ROUNDDOWN = AVRUNDA.NEDÃ…T ## Avrundar ett tal nedÃ¥t mot noll -ROUNDUP = AVRUNDA.UPPÃ…T ## Avrundar ett tal uppÃ¥t, frÃ¥n noll -SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat pÃ¥ formeln -SIGN = TECKEN ## Returnerar tecknet för ett tal -SIN = SIN ## Returnerar sinus för en given vinkel -SINH = SINH ## Returnerar hyperbolisk sinus för ett tal -SQRT = ROT ## Returnerar den positiva kvadratroten -SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi) -SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas -SUM = SUMMA ## Summerar argumenten -SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor -SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett omrÃ¥de som uppfyller flera kriterier -SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter -SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater -SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i tvÃ¥ matriser -SUMX2PY2 = SUMMAX2PY2 ## Returnerar summan av summan av kvadraterna av motsvarande värden i tvÃ¥ matriser -SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i tvÃ¥ matriser -TAN = TAN ## Returnerar tangens för ett tal -TANH = TANH ## Returnerar hyperbolisk tangens för ett tal -TRUNC = AVKORTA ## Avkortar ett tal till ett heltal - - -## -## Statistical functions Statistiska funktioner -## -AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse frÃ¥n deras medelvärde -AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten -AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden -AVERAGEIF = MEDELOM ## Returnerar medelvärdet (aritmetiskt medelvärde) för alla celler i ett omrÃ¥de som uppfyller ett givet kriterium -AVERAGEIFS = MEDELOMF ## Returnerar medelvärdet (det aritmetiska medelvärdet) för alla celler som uppfyller flera villkor. -BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen -BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning -BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen -CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen -CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen -CHITEST = CHI2TEST ## Returnerar oberoendetesten -CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde -CORREL = KORREL ## Returnerar korrelationskoefficienten mellan tvÃ¥ datamängder -COUNT = ANTAL ## Räknar hur mÃ¥nga tal som finns bland argumenten -COUNTA = ANTALV ## Räknar hur mÃ¥nga värden som finns bland argumenten -COUNTBLANK = ANTAL.TOMMA ## Räknar antalet tomma celler i ett omrÃ¥de -COUNTIF = ANTAL.OM ## Räknar antalet celler i ett omrÃ¥de som uppfyller angivna villkor. -COUNTIFS = ANTAL.OMF ## Räknar antalet celler i ett omrÃ¥de som uppfyller flera villkor. -COVAR = KOVAR ## Returnerar kovariansen, d.v.s. medelvärdet av produkterna för parade avvikelser -CRITBINOM = KRITBINOM ## Returnerar det minsta värdet för vilket den kumulativa binomialfördelningen är mindre än eller lika med ett villkorsvärde -DEVSQ = KVADAVV ## Returnerar summan av kvadrater pÃ¥ avvikelser -EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen -FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen -FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen -FISHER = FISHER ## Returnerar Fisher-transformationen -FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen -FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje -FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris -FTEST = FTEST ## Returnerar resultatet av en F-test -GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen -GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen -GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x) -GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet -GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend -HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet -HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen -INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje -KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data -LARGE = STÖRSTA ## Returnerar det n:te största värdet i en mängd data -LINEST = REGR ## Returnerar parametrar till en linjär trendlinje -LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend -LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen -LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa lognormala fördelningen -MAX = MAX ## Returnerar det största värdet i en lista av argument -MAXA = MAXA ## Returnerar det största värdet i en lista av argument, inklusive tal, text och logiska värden -MEDIAN = MEDIAN ## Returnerar medianen för angivna tal -MIN = MIN ## Returnerar det minsta värdet i en lista med argument -MINA = MINA ## Returnerar det minsta värdet i en lista över argument, inklusive tal, text och logiska värden -MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd -NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen -NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen -NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen -NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen -NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen -PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt -PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett omrÃ¥de -PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd -PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt -POISSON = POISSON ## Returnerar Poisson-fördelningen -PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett omrÃ¥de ligger mellan tvÃ¥ gränser -QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data -RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal -RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient -SKEW = SNEDHET ## Returnerar snedheten för en fördelning -SLOPE = LUTNING ## Returnerar lutningen pÃ¥ en linjär regressionslinje -SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data -STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde -STDEV = STDAV ## Uppskattar standardavvikelsen baserat pÃ¥ ett urval -STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat pÃ¥ ett urval, inklusive tal, text och logiska värden -STDEVP = STDAVP ## Beräknar standardavvikelsen baserat pÃ¥ hela populationen -STDEVPA = STDEVPA ## Beräknar standardavvikelsen baserat pÃ¥ hela populationen, inklusive tal, text och logiska värden -STEYX = STDFELYX ## Returnerar standardfelet för ett förutspÃ¥tt y-värde för varje x-värde i regressionen -TDIST = TFÖRD ## Returnerar Students t-fördelning -TINV = TINV ## Returnerar inversen till Students t-fördelning -TREND = TREND ## Returnerar värden längs en linjär trend -TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd -TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test -VAR = VARIANS ## Uppskattar variansen baserat pÃ¥ ett urval -VARA = VARA ## Uppskattar variansen baserat pÃ¥ ett urval, inklusive tal, text och logiska värden -VARP = VARIANSP ## Beräknar variansen baserat pÃ¥ hela populationen -VARPA = VARPA ## Beräknar variansen baserat pÃ¥ hela populationen, inklusive tal, text och logiska värden -WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen -ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test - - -## -## Text functions Textfunktioner -## -ASC = ASC ## Ändrar helbredds (dubbel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med halvt breddsteg (enkel byte) -BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht) -CHAR = TECKENKOD ## Returnerar tecknet som anges av kod -CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text -CODE = KOD ## Returnerar en numerisk kod för det första tecknet i en textsträng -CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng -DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat -EXACT = EXAKT ## Kontrollerar om tvÃ¥ textvärden är identiska -FIND = HITTA ## Hittar en text i en annan (skiljer pÃ¥ gemener och versaler) -FINDB = HITTAB ## Hittar en text i en annan (skiljer pÃ¥ gemener och versaler) -FIXED = FASTTAL ## Formaterar ett tal som text med ett fast antal decimaler -JIS = JIS ## Ändrar halvbredds (enkel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med helt breddsteg (dubbel byte) -LEFT = VÄNSTER ## Returnerar tecken längst till vänster i en sträng -LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng -LEN = LÄNGD ## Returnerar antalet tecken i en textsträng -LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng -LOWER = GEMENER ## Omvandlar text till gemener -MID = EXTEXT ## Returnerar angivet antal tecken frÃ¥n en text med början vid den position som du anger -MIDB = EXTEXTB ## Returnerar angivet antal tecken frÃ¥n en text med början vid den position som du anger -PHONETIC = PHONETIC ## Returnerar de fonetiska (furigana) tecknen i en textsträng -PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal -REPLACE = ERSÄTT ## Ersätter tecken i text -REPLACEB = ERSÄTTB ## Ersätter tecken i text -REPT = REP ## Upprepar en text ett bestämt antal gÃ¥nger -RIGHT = HÖGER ## Returnerar tecken längst till höger i en sträng -RIGHTB = HÖGERB ## Returnerar tecken längst till höger i en sträng -SEARCH = SÖK ## Hittar ett textvärde i ett annat (skiljer inte pÃ¥ gemener och versaler) -SEARCHB = SÖKB ## Hittar ett textvärde i ett annat (skiljer inte pÃ¥ gemener och versaler) -SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng -T = T ## Omvandlar argumenten till text -TEXT = TEXT ## Formaterar ett tal och omvandlar det till text -TRIM = RENSA ## Tar bort blanksteg frÃ¥n text -UPPER = VERSALER ## Omvandlar text till versaler -VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal diff --git a/third_party/codeplex-phpexcel-1.7.6/changelog.txt b/third_party/codeplex-phpexcel-1.7.6/changelog.txt deleted file mode 100644 index 02960681b8..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/changelog.txt +++ /dev/null @@ -1,1203 +0,0 @@ -************************************************************************************** -* PHPExcel -* -* Copyright (c) 2006 - 2011 PHPExcel -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -* @version 1.7.6, 2011-02-27 -************************************************************************************** - - -2011-02-27 (v1.7.6): - - -2011-02)27 (v1.7.6): -- Feature: (MBaker) Provide option to use PCLZip as an alternative to ZipArchive. - This allows the writing of Excel2007 files, even without ZipArchive enabled (it does require zlib), or when php_zip is one of the buggy PHP 5.2.6 or 5.2.8 versions - It can be enabled using PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP); - Note that it is not yet implemented as an alternative to ZipArchive for those Readers that are extracting from zips -- Feature: (MBaker) Work item 14979 - Added listWorksheetNames() method to Readers that support multiple worksheets in a workbook, allowing a user to extract a list of all the worksheet names from a file without parsing/loading the whole file. -- Feature: (MBaker) Speed boost and memory reduction in the Worksheet toArray() method. -- Feature: (MBaker) Added new rangeToArray() and namedRangeToArray() methods to the PHPExcel_Worksheet object. - Functionally, these are identical to the toArray() method, except that they take an additional first parameter of a Range (e.g. 'B2:C3') or a Named Range name. - Modified the toArray() method so that it actually uses rangeToArray(). -- Feature: (MBaker) Added support for cell comments in the OOCalc, Gnumeric and Excel2003XML Readers, and in the Excel5 Reader -- Feature: (MBaker) Improved toFormattedString() handling for Currency and Accounting formats to render currency symbols -- Feature: (MBaker) Work Item 2346 - Implement more Excel calculation functions - - Implemented the DAVERAGE(), DCOUNT(), DCOUNTA(), DGET(), DMAX(), DMIN(), DPRODUCT(), DSTDEV(), DSTDEVP(), DSUM(), DVAR() and DVARP() Database functions -- Bugfix: (MBaker) Work item 14888 - Simple =IF() formula disappears -- Bugfix: (MBaker) Work item 14898 - PHP Warning: preg_match(): Compilation failed: PCRE does not support \\L, \\l, \\N, \\P, \\p, \\U, \\u, or \\X -- Bugfix: (MBaker) Work item 14901 - VLOOKUP choking on parameters in PHPExcel.1.7.5/PHPExcel_Writer_Excel2007 -- Bugfix: (MBaker) Work item 14973 - PHPExcel_Cell::isInRange() incorrect results - offset by one column -- Bugfix: (MBaker) Treat CodePage of 0 as CP1251 (for .xls files written by applications that don't set the CodePage correctly, such as Apple Numbers) -- Bugfix: (MB) Work item 11583 - Need method for removing autoFilter -- Bugfix: (MBaker) Work item 15029 - coordinateFromString throws exception for rows greater than 99,999 -- Bugfix: (MBaker) Work item 14999 - PHPExcel Excel2007 Reader colour problems with solidfill -- Bugfix: (MBaker) Work item 13215 - Formatting get lost and edit a template XLSX file -- Bugfix: (MBaker) Work item 14029 - Excel 2007 Reader /writer lost fontcolor -- Bugfix: (MBaker) Work item 13374 - file that makes cells go black -- Bugfix: (MBaker) Minor patchfix for Excel2003XML Reader when XML is defined with a charset attribute -- Bugfix: (MBaker) Work item 15089 - PHPExcel_Worksheet->toArray() index problem -- Bugfix: (MBaker) Work item 15094 - Merge cells 'un-merge' when using an existing spreadsheet -- Bugfix: (MBaker) Work item 15129 - Worksheet fromArray() only working with 2-D arrays -- Bugfix: (MBaker) Work item 15172 - rangeToarray function modified for non-existent cells -- Bugfix: (MBaker) Work item 14980 - Images not getting copyied with the ->clone function -- Bugfix: (MBaker) Work item 11576 - AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't -- Bugfix: (MBaker) Fix Excel5 Writer so that it only writes column dimensions for columns that are actually used rather than the full range (A to IV) -- Bugfix: (MBaker) Work item 15198 - FreezePane causing damaged or modified error - The freezePaneByColumnAndRow() method row argument should default to 1 rather than 0. - Default row argument for all __ByColumnAndRow() methods should be 1 -- Bugfix: (MBaker) Work item 15121 - Column reference rather than cell reference in Print Area definition - Fix Excel2007 Writer to handle print areas that are defined as row or column ranges rather than just as cell ranges -- Bugfix: (MBaker) Reduced false positives from isDateTimeFormatCode() method by suppressing testing within quoted strings -- Bugfix: (MBaker) Work item 15312 - Caching and tmp partition exhaustion -- Bugfix: (MBaker) Work item 15308 - Writing to Variable No Longer Works. $_tmp_dir Missing in PHPExcel\PHPExcel\Shared\OLE\PPS\Root.php -- Bugfix: (MBaker) Work item 15379 - Named ranges with dot don't get parsed properly -- Bugfix: (MBaker) Work item 15096 - insertNewRowBefore fails to consistently update references -- Bugfix: (MBaker) "i" is not a valid character for Excel date format masks (in isDateTimeFormatCode() method) -- Bugfix: (MKunert) Work item 15421 - PHPExcel_ReferenceHelper::insertNewBefore() is missing an 'Update worksheet: comments' section -- Bugfix: (MBaker) Work item 15409 - Full column/row references in named ranges not supported by updateCellReference() -- General: (MBaker) Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer. -- General: (MBaker) Improved performance (speed), for PHP to Excel date conversions -- General: (MBaker) Enhanced SheetViews element structures in the Excel2007 Writer for frozen panes. -- General: (MBaker) Removed Serialized Reader/Writer as these no longer work. - - -2010-12-10 (v1.7.5): -- Feature: (MBaker) Work item 8769 - Implement Gnumeric File Format - Initial work on Gnumeric Reader (Worksheet Data, Document Properties and basic Formatting) -- Feature: (MBaker) (incorporating part of Workitem 9759) - Support for Extended Workbook Properties in Excel2007, Excel5 and OOCalc Readers; support for User-defined Workbook Properties in Excel2007 and OOCalc Readers -- Feature: (MBaker) Support for Extended and User-defined Workbook Properties in Excel2007 Writer -- Feature: (MBaker) Provided a setGenerateSheetNavigationBlock(false); option to suppress generation of the sheet navigation block when writing multiple worksheets to HTML -- Feature: (MBaker) Advanced Value Binder now recognises TRUE/FALSE strings (locale-specific) and converts to boolean -- Feature: (MBaker) Work item 14301 - PHPExcel_Worksheet->toArray() is returning truncated values -- Feature: (MBaker) Configure PDF Writer margins based on Excel Worksheet Margin Settings value -- Feature: (MBaker) Added Contiguous flag for the CSV Reader, when working with Read Filters -- Feature: (MBaker) Added getFormattedValue() method for cell object -- Feature: (MBaker) Added strictNullComparison argument to the worksheet fromArray() method -- Feature: (MBaker) Fix to toFormattedString() method in PHPExcel_Style_NumberFormat to handle fractions with a # code for the integer part -- Bugfix: (MB) Work item 14143 - NA() doesn't propagate in matrix calc - quick fix in JAMA/Matrix.php -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : String constant containing double quotation mark -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Percent -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Error constant -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Concatenation operator -- Bugfix: (MBaker) Work item 14146 - Worksheet clone broken for CachedObjectStorage_Memory -- Bugfix: (MBaker) Work item 12998 - PHPExcel_Reader_Excel2007 fails when gradient fill without type is present in a file -- Bugfix: (MBaker) Work item 14176 - @ format for numeric strings in XLSX to CSV conversion -- Bugfix: (MBaker) Work item 14223 - Advanced Value Binder Not Working? -- Bugfix: (MBaker) Work item 14226 - unassigned object variable in PHPExcel->removeCellXfByIndex -- Bugfix: (MBaker) Work item 14236 - problem with getting cell values from another worksheet... (if cell doesn't exist) -- Bugfix: (MBaker) Work items 14260 & 14233 - Setting cell values to one char strings & Trouble reading one character string (thanks gorfou) -- Bugfix: (MBaker) Work item 14256 - Worksheet title exception when duplicate worksheet is being renamed but exceeds the 31 character limit -- Bugfix: (MBaker) Work item 14086 - Named range with sheet name that contains the $ throws exception when getting the cell -- Bugfix: (MBaker) Added autoloader to DefaultValueBinder and AdvancedValueBinder -- Bugfix: (MBaker) Modified PHPExcel_Shared_Date::isDateTimeFormatCode() to return false if format code begins with "_" or with "0 " to prevent false positives - These leading characters are most commonly associated with number, currency or accounting (or occasionally fraction) formats -- Bugfix: (MBaker) Work item 14374 - BUG : Excel5 and setReadFilter ? -- Bugfix: (MBaker) Work item 14425 - Wrong exception message while deleting column -- Bugfix: (MBaker) Work item 14679 - Formula evaluation fails with Japanese sheet refs -- Bugfix: (MBaker) Work item 13559 - PHPExcel_Writer_PDF does not handle cell borders correctly -- Bugfix: (MBaker) Work item 14831 - Style : applyFromArray() for 'allborders' not working -- Bugfix: (MBaker) Work item 14837 - Using $this when not in object context in Excel5 Reader -- General: (MBaker) Applied patch 6609 - Removes a unnecessary loop through each cell when applying conditional formatting to a range. -- General: (MBaker) Applied patch 7169 - Removed spurious PHP end tags (?>) -- General: (MBaker) Improved performance (speed) and reduced memory overheads, particularly for the Writers, but across the whole library. - - -2010-08-26 (v1.7.4): -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Power -- Bugfix: (Progi1984) Work item 7895 - Excel5 : Formula : Unary plus -- Bugfix: (Progi1984) Excel5 : Just write the Escher stream if necessary in Worksheet -- Bugfix: (MBaker) Work item 13433 - Syntax errors in memcache.php 1.7.3c -- Bugfix: (MBaker) Work item 13450 - Standard Deviation functions returning DIV/0 Error when Standard Deviation is zero -- Feature: (MBaker) Support for print area with several ranges in the Excel2007 reader, and improved features for editing print area with several ranges -- Feature: (MBaker) Work item 13769 - Improved Cell Exception Reporting -- Feature: (MBaker) Support for row or column ranges in the calculation engine, e.g. =SUM(C:C) or =SUM(1:2) - Also support in the calculation engine for absolute row or column ranges e.g. =SUM($C:$E) or =SUM($3:5) -- Bugfix: (ET) Work item 13455 - Picture problem with Excel 2003 -- Bugfix: (MBaker) Work item 13484 - Wrong variable used in addExternalSheet in PHPExcel.php -- Bugfix: (MBaker) Work item 13515 - "Invalid cell coordinate" error when formula access data from an other sheet -- Bugfix: (MBaker) (related to Work item 13515) Calculation engine confusing cell range worksheet when referencing cells in a different worksheet to the formula -- Bugfix: (MBaker) Work item 13752 - Wrong var naming in Worksheet->garbageCollect() -- Bugfix: (MBaker) Work item 13764 - PHPExcel_Style_*::__clone() methods cause cloning loops? -- Bugfix: (MBaker) Work item 11488 - Recent builds causing problems loading xlsx files? (ZipArchive issue?) -- Bugfix: (MBaker) Work item 13856 - cache_to_apc causes fatal error when processing large data sets -- Bugfix: (MBaker) Work item 13880 - OOCalc reader misses first line if it's a 'table-header-row' -- Bugfix: (MBaker) Work item 14011 - using cache with copy or clone bug? - Fixed $worksheet->copy() or clone $worksheet when using cache_in_memory, cache_in_memory_gzip, cache_in_memory_serialized, cache_to_discISAM, cache_to_phpTemp, cache_to_apc and cache_to_memcache; - Fixed but untested when using cache_to_wincache. -- Bugfix: (MBaker) Fixed problems with reading Excel2007 Properties -- General: (MB) Applied patch 6324 - PHP Strict Standards: Non-static method PHPExcel_Shared_String::utf16_decode() should not be called statically -- General: (MBaker) Applied patch 6360 - Array functions were ignored when loading an existing file containing them, and as a result, they would lose their 'cse' status. -- General: (MBaker) Minor memory tweaks to Excel2007 Writer -- General: (MBaker) Modified ReferenceHelper updateFormulaReferences() method to handle updates to row and column cell ranges (including absolute references e.g. =SUM(A:$E) or =SUM($5:5), and range/cell references that reference a worksheet by name), and to provide both performance and memory improvements. -- General: (MBaker) Modified Excel2007 Reader so that ReferenceHelper class is instantiated only once rather than for every shared formula in a workbook. -- General: (MBaker) Correct handling for additional (synonym) formula tokens in Excel5 Reader -- General: (MBaker) Additional reading of some Excel2007 Extended Properties (Company, Manager) - - -2010-06-01 (v1.7.3c): -- Bugfix: (MB) Work item 13012 - Fatal error: Class 'ZipArchive' not found... ...Reader/Excel2007.php on line 217 -- Bugfix: (MBaker) Work item 13398 - PHPExcel_Writer_Excel2007 error after 1.7.3b - - -2010-05-31 (v1.7.3b): -- Bugfix: (MBaker) Work item 12903 - Infinite loop when reading -- Bugfix: (MB) Work item 13381 - Wrong method chaining on PHPExcel_Worksheet class - - -2010-05-17 (v1.7.3): -- General: (ET) Applied patch 4990 (modified) -- General: (MB) Applied patch 5568 (modified) -- General: (MB) Applied patch 5943 -- General: (MB) Work item 13042 - Upgrade build script to use Phing -- General: (ET) Work item 11586 - Replacing var with public/private -- General: (MBaker) Applied Anthony's Sterling's Class Autoloader to reduce memory overhead by "Lazy Loading" of classes -- General: (MBaker) Modification to functions that accept a date parameter to support string values containing ordinals as per Excel (English language only) -- General: (MBaker) Modify PHPExcel_Style_NumberFormat::toFormattedString() to handle dates that fall outside of PHP's 32-bit date range -- General: (MBaker) Applied patch 5207 -- General: (ET) Work item 11970 - PHPExcel developer documentation: Set page margins -- Feature: (ET) Work item 11038 - Special characters and accents in SYLK reader -- Feature: (MBaker) Work Item 2346 - Implement more Excel calculation functions - - Implemented the COUPDAYS(), COUPDAYBS(), COUPDAYSNC(), COUPNCD(), COUPPCD() and PRICE() Financial functions - - Implemented the N() and TYPE() Information functions - - Implemented the HYPERLINK() Lookup and Reference function -- Feature: (ET) Work item 11526 - Horizontal page break support in PHPExcel_Writer_PDF -- Feature: (ET) Work item 11529 - Introduce method setActiveSheetIndexByName() -- Feature: (ET) Work item 11550 - AdvancedValueBinder.php: Automatically wrap text when there is new line in string (ALT+"Enter") -- Feature: (ET) Work item 10300 - Data validation support in PHPExcel_Reader_Excel5 and PHPExcel_Writer_Excel5 -- Feature: (MB) Work item 11616 - Improve autosize calculation -- Feature: (MBaker) Methods to translate locale-specific function names in formulae - - Language implementations for Czech (cs), Danish (da), German (de), English (uk), Spanish (es), Finnish (fi), French (fr), Hungarian (hu), Italian (it), Dutch (nl), Norwegian (no), Polish (pl), Portuguese (pt), Brazilian Portuguese (pt_br), Russian (ru) and Swedish (sv) -- Feature: (ET) Work item 9759 - Implement document properties in Excel5 reader/writer - - Fixed so far for PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 11849 - Show/hide row and column headers in worksheet -- Feature: (ET) Work item 11919 - Can't set font on writing PDF (by key) -- Feature: (ET) Work item 12096 - Thousands scale (1000^n) support in PHPExcel_Style_NumberFormat::toFormattedString -- Feature: (ET) Work item 6911 - Implement repeating rows in PDF and HTML writer -- Feature: (ET) Work item 12289 - Sheet tabs in PHPExcel_Writer_HTML -- Feature: (MB) Work item 13041 - Add Wincache CachedObjectProvider -- Feature: (MBaker) Configure PDF Writer paper size based on Excel Page Settings value, and provided methods to override paper size and page orientation with the writer - - Note PHPExcel defaults to Letter size, while the previous PDF writer enforced A4 size, so PDF writer will now default to Letter -- Feature: (MBaker) Initial implementation of cell caching: allowing larger workbooks to be managed, but at a cost in speed -- Feature: (MBaker) Added an identify() method to the IO Factory that identifies the reader which will be used to load a particular file without actually loading it. -- Bugfix: (MBaker) Work item 10979 - Warning messages with INDEX function having 2 arguments -- Bugfix: (ET) Work item 11473 - setValue('=') should result in string instead of formula -- Bugfix: (MBaker) Work item 11471 - method _raiseFormulaError should no be private -- Bugfix: (ET) Work item 11485 - Fatal error: Call to undefined function mb_substr() in ...Classes\PHPExcel\Reader\Excel5.php on line 2903 -- Bugfix: (ET) Work item 11487 - getBold(), getItallic(), getStrikeThrough() not always working with PHPExcel_Reader_Excel2007 -- Bugfix: (ET) Work item 11492 - AdvancedValueBinder.php not working correctly for $cell->setValue('hh:mm:ss') -- Bugfix: (MBaker) Fixed leap year handling for the YEARFRAC() Date/Time function when basis ia 1 (Actual/actual) -- Bugfix: (MBaker) Work item 11490 - Warning messages - - Calculation Engine code modified to enforce strict standards for pass by reference -- Bugfix: (ET) Work item 11483 - PHPExcel_Cell_AdvancedValueBinder doesnt work for dates in far future -- Bugfix: (ET) Work item 11528 - MSODRAWING bug with long CONTINUE record in PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 11571 - PHPExcel_Reader_Excel2007 reads print titles as named range when there is more than one sheet -- Bugfix: (ET) Work item 11561 - missing @return in phpdocblock in reader classes -- Bugfix: (ET) Work item 11576 - AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't -- Bugfix: (ET) Work item 11588 - Small numbers escape treatment in PHPExcel_Style_NumberFormat::toFormattedString() -- Bugfix: (ET) Work item 11590 - Blank styled cells are not blank in output by HTML writer due to &nbsp; -- Bugfix: (MBaker) Work item 11587 - Calculation engine bug: Existing, blank cell + number gives #NUM -- Bugfix: (ET) Work item 11608 - AutoSize only measures length of first line in cell with multiple lines (ALT+Enter) -- Bugfix: (ET) Work item 11608 - Fatal error running Tests/12serializedfileformat.php (PHPExcel 1.7.2) -- Bugfix: (MBaker) Fixed various errors in the WORKDAY() and NETWORKDAYS() Date/Time functions (particularly related to holidays) -- Bugfix: (ET) Work item 11660 - Uncaught exception 'Exception' with message 'Valid scale is between 10 and 400.' in Classes/PHPExcel/Worksheet/SheetView.php:115 -- Bugfix: (ET) Work item 11551 - "Unrecognized token 39 in formula" with PHPExcel_Reader_Excel5 (occuring with add-in functions) -- Bugfix: (ET) Work item 11668 - Excel2007 reader not reading PHPExcel_Style_Conditional::CONDITION_EXPRESSION -- Bugfix: (MBaker) Fix to the BESSELI(), BESSELJ(), BESSELK(), BESSELY() and COMPLEX() Engineering functions to use correct default values for parameters -- Bugfix: (MBaker) Work item 11525 - DATEVALUE function not working for pure time values + allow DATEVALUE() function to handle partial dates (e.g. "1-Jun" or "12/2010") -- Bugfix: (MBaker) Fix for empty quoted strings in formulae -- Bugfix: (MBaker) Trap for division by zero in Bessel functions -- Bugfix: (MBaker) Fix to OOCalc Reader to convert semi-colon (;) argument separator in formulae to a comma (,) -- Bugfix: (ET) Work item 11693 - PHPExcel_Writer_Excel5_Parser cannot parse formula like =SUM(C$5:C5) -- Bugfix: (MBaker) Fix to OOCalc Reader to handle dates that fall outside 32-bit PHP's date range -- Bugfix: (ET) Work item 11692 - File->sys_get_temp_dir() can fail in safe mode -- Bugfix: (ET) Work item 11727 - Sheet references in Excel5 writer do not work when referenced sheet title contains non-Latin symbols -- Bugfix: (ET) Work item 11743 - Bug in HTML writer can result in missing rows in output -- Bugfix: (ET) Work item 11674 - setShowGridLines(true) not working with PHPExcel_Writer_PDF -- Bugfix: (ET) Work item 11836 - PHPExcel_Worksheet_RowIterator initial position incorrect -- Bugfix: (ET) Work item 11835 - PHPExcel_Worksheet_HeaderFooterDrawing Strict Exception thrown (by jshaw86) -- Bugfix: (ET) Work item 11850 - Parts of worksheet lost when there are embedded charts (Excel5 reader) -- Bugfix: (MBaker) VLOOKUP() function error when lookup value is passed as a cell reference rather than an absolute value -- Bugfix: (ET) Work item 12041 - First segment of Rich-Text not read correctly by PHPExcel_Reader_Excel2007 -- Bugfix: (MBaker) Work item 12048 - Fatal Error with getCell('name') when name matches the pattern for a cell reference -- Bugfix: (ET) Work item 12039 - excel5 writer appears to be swapping image locations -- Bugfix: (ET) Work item 11954 - Undefined index: host in ZipStreamWrapper.php, line 94 and line 101 -- Bugfix: (ET) Work item 11672 - BIFF8 File Format problem (too short COLINFO record) -- Bugfix: (ET) Work item 12121 - Column width sometimes changed after read/write with Excel2007 reader/writer -- Bugfix: (ET) Work item 11964 - Worksheet.php throws a fatal error when styling is turned off via setReadDataOnly on the reader -- Bugfix: (MBaker) Work item 11851 - Checking for Circular References in Formulae - - Calculation Engine code now traps for cyclic references, raising an error or throwing an exception, or allows 1 or more iterations through cyclic references, based on a configuration setting -- Bugfix: (ET) Work item 12244 - PNG transparency using Excel2007 writer -- Bugfix: (ET) Work item 12221 - Custom readfilter error when cell formulas reference excluded cells (Excel5 reader) -- Bugfix: (ET) Work item 12288 - Protection problem in XLS -- Bugfix: (ET) Work item 12300 - getColumnDimension()->setAutoSize() incorrect on cells with Number Formatting -- Bugfix: (ET) Work item 12378 - Notices reading Excel file with Add-in funcitons (PHPExcel_Reader_Excel5) -- Bugfix: (ET) Work item 12380 - Excel5 reader not reading formulas with deleted sheet references -- Bugfix: (ET) Work item 12404 - Named range (defined name) scope problems for in PHPExcel -- Bugfix: (ET) Work item 12423 - PHP Parse error: syntax error, unexpected T_PUBLIC in PHPExcel/Calculation.php on line 3482 -- Bugfix: (ET) Work item 12505 - Named ranges don't appear in name box using Excel5 writer -- Bugfix: (ET) Work item 12509 - Many merged cells + autoSize column -> slows down the writer -- Bugfix: (ET) Work item 12539 - Incorrect fallback order comment in Shared/Strings.php ConvertEncoding() -- Bugfix: (ET) Work item 12538 - IBM AIX iconv() will not work, should revert to mbstring etc. instead -- Bugfix: (ET) Work item 12568 - Excel5 writer and mbstring functions overload -- Bugfix: (MBaker) Work item 12672 - OFFSET needs to flattenSingleValue the $rows and $columns args -- Bugfix: (MBaker) Work item 12546 - Formula with DMAX(): Notice: Undefined offset: 2 in ...\PHPExcel\Calculation.php on line 2365 - - Note that the Database functions have not yet been implemented -- Bugfix: (MBaker) Work item 12839 - Call to a member function getParent() on a non-object in Classes\\PHPExcel\\Calculation.php Title is required -- Bugfix: (MBaker) Work item 12935 - Cyclic Reference in Formula -- Bugfix: (MBaker) Work item 13025 - Memory error...data validation? - - -2010/01/11 (v1.7.2): -- General: (ET) Applied patch 4362 -- General: (ET) Applied patch 4363 (modified) -- General: (MBaker) Work item 10874 - 1.7.1 Extremely Slow - Refactored PHPExcel_Calculation_Functions::flattenArray() method and set calculation cache timer default to 2.5 seconds -- General: (MBaker) Allow formulae to contain line breaks -- General: (ET) Work item 10910 - split() function deprecated in PHP 5.3.0 -- General: (ET) sys_get_temp_dir() requires PHP 5.2.1, not PHP 5.2 [provide fallback function for PHP 5.2.0] -- General: (MBaker) Applied patch 4640 - Implementation of the ISPMT() Financial function by Matt Groves -- General: (MBaker) Work item 11052 - Put the example of formula with more arguments in documentation -- General: (MBaker) Improved accuracy for the GAMMAINV() Statistical Function -- Feature: (ET) Work item 10409 - XFEXT record support to fix colors change from Excel5 reader, and copy/paste color change with Excel5 writer - - Excel5 reader reads RGB color information in XFEXT records for borders, font color and fill color -- Feature: (MBaker) Work Item 2346 - Implement more Excel calculation functions - - Implemented the FVSCHEDULE(), XNPV(), IRR(), MIRR(), XIRR() and RATE() Financial functions - - Implemented the SUMPRODUCT() Mathematical function - - Implemented the ZTEST() Statistical Function -- Feature: (ET) Work item 10919 - Multiple print areas in one sheet -- Feature: (ET) Work item 10930 - Store calculated values in output by PHPExcel_Writer_Excel5 -- Feature: (ET) Work item 10939 - Sheet protection options in Excel5 reader/writer -- Feature: (MBaker) Modification of the COUNT(), AVERAGE(), AVERAGEA(), DEVSQ, AVEDEV(), STDEV(), STDEVA(), STDEVP(), STDEVPA(), VARA() and VARPA() SKEW() and KURT() functions to correctly handle boolean values depending on whether they're passed in as values, values within a matrix or values within a range of cells. -- Feature: (ET) Work item 9932 - Cell range selection -- Feature: (MB) Work item 10266 - Root-relative path handling -- Feature: (ET) Work item 11315 - Named Ranges not working with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 11206 - Excel2007 Reader fails to load Apache POI generated Excel -- Bugfix: (MB) Work item 11154 - Number format is broken when system's thousands separator is empty -- Bugfix: (MB) Work item 11401 - ReferenceHelper::updateNamedFormulas throws errors if oldName is empty -- Bugfix: (MB) Work item 11296 - parse_url() fails to parse path to an image in xlsx -- Bugfix: (ET) Work item 10876 - Workaround for iconv_substr() bug in PHP 5.2.0 -- Bugfix: (ET) Work item 10877 - 1 pixel error for image width and height with PHPExcel_Writer_Excel5 -- Bugfix: (MBaker) Fix to GEOMEAN() Statistical function -- Bugfix: (ET) Work item 10884 - setValue('-') and setValue('.') sets numeric 0 instead of 1-character string -- Bugfix: (ET) Work item 10885 - Row height sometimes much too low after read with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10888 - Diagonal border. Miscellaneous missing support. - - Constant PHPExcel_Style_Borders::DIAGONAL_BOTH added to support double-diagonal (cross) - - PHPExcel_Reader_Excel2007 not always reading diagonal borders (only recognizes 'true' and not '1') - - PHPExcel_Reader_Excel5 support for diagonal borders - - PHPExcel_Writer_Excel5 support for diagonal borders -- Bugfix: (ET) Work item 10894 - Session bug: Fatal error: Call to a member function bindValue() on a non-object in ...\Classes\PHPExcel\Cell.php on line 217 -- Bugfix: (ET) Work item 10896 - Colors messed up saving twice with same instance of PHPExcel_Writer_Excel5 (regression since 1.7.0) -- Bugfix: (ET) Work item 10917 - Method PHPExcel_Worksheet::setDefaultStyle is not working -- Bugfix: (ET) Work item 10897 - PHPExcel_Reader_CSV::canRead() sometimes says false when it shouldn't -- Bugfix: (ET) Work item 10922 - Changes in workbook not picked up between two saves with PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 10913 - Decimal and thousands separators missing in HTML and PDF output -- Bugfix: (ET) Work item 10936 - Notices with PHPExcel_Reader_Excel5 and named array constants -- Bugfix: (MBaker) Work item 10938 - Calculation engine limitation on 32-bit platform with integers > 2147483647 -- Bugfix: (ET) Work item 10959 - Shared(?) formulae containing absolute cell references not read correctly using Excel5 Reader -- Bugfix: (MBaker) Work item 10962 - Warning messages with intersection operator involving single cell -- Bugfix: (ET) Work item 10980 - Infinite loop in Excel5 reader caused by zero-length string in SST -- Bugfix: (ET) Work item 10983 - Remove unnecessary cell sorting to improve speed by approx. 18% in HTML and PDF writers -- Bugfix: (MBaker) Work item 10977 - Cannot read A1 cell content - OO_Reader -- Bugfix: (ET) Work item 11000 - Transliteration failed, invalid encoding - - -2009/11/02 (v1.7.1): -- General: (ET) Work item 10687 - ereg() function deprecated in PHP 5.3.0 -- General: (MB) Work item 10739 - Writer Interface Inconsequence - setTempDir and setUseDiskCaching -- General: (ET) Upgrade to TCPDF 4.8.009 -- Feature: (ET) Work item 7333 - Support for row and column styles (feature request) - - Basic implementation for Excel2007/Excel5 reader/writer -- Feature: (ET) Work item 10459 - Hyperlink to local file in Excel5 reader/writer -- Feature: (MB) Work item 10472 - Color Tab (Color Sheet's name) -- Feature: (ET) Work item 10488 - Border style "double" support in PHPExcel_Writer_HTML -- Feature: (ET) Work item 10492 - Multi-section number format support in HTML/PDF/CSV writers -- Feature: (MBaker) - Some additional performance tweaks in the calculation engine -- Feature: (MBaker) - Fix result of DB() and DDB() Financial functions to 2dp when in Gnumeric Compatibility mode -- Feature: (MBaker) - Added AMORDEGRC(), AMORLINC() and COUPNUM() Financial function (no validation of parameters yet) -- Feature: (MBaker) - Improved accuracy of TBILLEQ(), TBILLPRICE() and TBILLYIELD() Financial functions when in Excel or Gnumeric mode -- Feature: (MBaker) - Added INDIRECT() Lookup/Reference function (only supports full addresses at the moment) -- Feature: (MB) Work item 10498 - PHPExcel_Reader_CSV::canRead() improvements -- Feature: (ET) Work item 10500 - Input encoding option for PHPExcel_Reader_CSV -- Feature: (ET) Work item 10493 - Colored number format support, e.g. [Red], in HTML/PDF output -- Feature: (ET) Work item 10559 - Color Tab (Color Sheet's name) [Excel5 reader/writer support] -- Feature: (MBaker) Initial version of SYLK (slk) and Excel 2003 XML Readers (Cell data and basic cell formatting) -- Feature: (MBaker) Initial version of Open Office Calc (ods) Reader (Cell data only) -- Feature: (MBaker) Initial use of "pass by reference" in the calculation engine for ROW() and COLUMN() Lookup/Reference functions -- Feature: (MBaker) Work item 2346 - COLUMNS() and ROWS() Lookup/Reference functions, and SUBSTITUTE() Text function -- Feature: (ET) Work item 10502 - AdvancedValueBinder(): Re-enable zero-padded string-to-number conversion, e.g '0004' -> 4 -- Feature: (ET) Work item 10600 - Make PHP type match Excel datatype -- Feature: (MB) Work item 10630 - Change first page number on header -- Feature: (MB) Applied patch 3941 -- Feature: (MB,ET) Work item 10745 - Hidden sheets -- Feature: (ET) Work item 10761 - mbstring fallback when iconv is broken -- Feature: (MBaker) Added support for matrix/value comparisons (e.g. ={1,2;3,4}>=3 or 2<>{1,2;3,4}) - Note, can't yet handle comparison of two matrices -- Feature: (MBaker) Improved handling for validation and error trapping in a number of functions -- Feature: (MBaker) Improved support for fraction number formatting -- Feature: (ET) Work item 10455 - Support Reading CSV with Byte Order Mark (BOM) -- Feature: (ET) Work item 10860 - addExternalSheet() at specified index -- Bugfix: (MBaker) Work item 10684 - Named range can no longer be passed to worksheet->getCell() -- Bugfix: (ET) Work item 10455 - RichText HTML entities no longer working in PHPExcel 1.7.0 -- Bugfix: (ET) Work item 7610 - Fit-to-width value of 1 is lost after read/write of Excel2007 spreadsheet [+ support for simultaneous scale/fitToPage] -- Bugfix: (MB) Work item 10469 - Performance issue identified by profiling -- Bugfix: (ET) Work item 10473 - setSelectedCell is wrong -- Bugfix: (ET) Work item 10481 - Images get squeezed/stretched with (Mac) Verdana 10 Excel files using Excel5 reader/writer -- Bugfix: (MBaker) Work item 10482 - Error in argument count for DATEDIF() function -- Bugfix: (MBaker) Work item 10452 - updateFormulaReferences is buggy -- Bugfix: (MB) Work item 10485 - CellIterator returns null Cell if onlyExistingCells is set and key() is in use -- Bugfix: (MBaker) Work item 10453 - Wrong RegEx for parsing cell references in formulas -- Bugfix: (MB) Work item 10486 - Optimisation subverted to devastating effect if IterateOnlyExistingCells is clear -- Bugfix: (ET) Work item 10494 - Fatal error: Uncaught exception 'Exception' with message 'Unrecognized token 6C in formula'... with PHPExcel_Reader_Excel5 -- Bugfix: (MBaker) Work item 10490 - Fractions stored as text are not treated as numbers by PHPExcel's calculation engine -- Bugfix: (ET) Work item 10503 - AutoFit (autosize) row height not working in PHPExcel_Writer_Excel5 -- Bugfix: (MBaker) Fixed problem with null values breaking the calculation stack -- Bugfix: (ET) Work item 10524 - Date number formats sometimes fail with PHPExcel_Style_NumberFormat::toFormattedString, e.g. [$-40047]mmmm d yyyy -- Bugfix: (MBaker) Fixed minor problem with DATEDIFF YM calculation -- Bugfix: (MB) Applied patch 3695 -- Bugfix: (ET) Work item 10536 - setAutosize() and Date cells not working properly -- Bugfix: (ET) Work item 10556 - Time value hour offset in output by HTML/PDF/CSV writers (system timezone problem) -- Bugfix: (ET) Work item 10558 - Control characters 0x14-0x1F are not treated by PHPExcel -- Bugfix: (ET) Work item 10560 - PHPExcel_Writer_Excel5 not working when open_basedir restriction is in effect -- Bugfix: (MBaker) Work item 10563 - IF formula calculation problem in PHPExcel 1.7.0 (string comparisons) -- Bugfix: (MBaker) Improved CODE() Text function result for UTF-8 characters -- Bugfix: (ET) Work item 10568 - Empty rows are collapsed with HTML/PDF writer -- Bugfix: (ET) Work item 10569 - Gaps between rows in output by PHPExcel_Writer_PDF (Upgrading to TCPDF 4.7.003) -- Bugfix: (ET) Work item 10575 - Problem reading formulas (Excel5 reader problem with "fake" shared formulas) -- Bugfix: (MBaker) Work item 10588 - Error type in formula: "_raiseFormulaError message is Formula Error: An unexpected error occured" -- Bugfix: (ET) Work item 10599 - Miscellaneous column width problems in Excel5/Excel2007 writer -- Bugfix: (ET) Work item 10615 - Reader/Excel5 'Unrecognized token 2D in formula' in latest version -- Bugfix: (ET) Work item 10623 - on php 5.3 PHPExcel 1.7 Excel 5 reader fails in _getNextToken, token = 2C, throws exception -- Bugfix: (ET) Work item 10617 - Fatal error when altering styles after workbook has been saved -- Bugfix: (ET) Work item 10661 - Images vertically stretched or squeezed when default font size is changed (PHPExcel_Writer_Excel5) -- Bugfix: (ET) Work item 10676 - Styles not read in "manipulated" Excel2007 workbook -- Bugfix: (ET) Work item 10059 - Windows 7 says corrupt file by PHPExcel_Writer_Excel5 when opening in Excel -- Bugfix: (MBaker) Work item 10708 - Calculations sometimes not working with cell references to other sheets -- Bugfix: (ET) Work item 10706 - Problem with merged cells after insertNewRowBefore() -- Bugfix: (MBaker) Applied patch 4023 -- Bugfix: (MBaker) Fix to SUMIF() and COUNTIF() Statistical functions for when condition is a match against a string value -- Bugfix: (ET) Work item 10721 - PHPExcel_Cell::coordinateFromString should throw exception for bad string parameter -- Bugfix: (ET) Work item 10723 - EucrosiaUPC (Thai font) not working with PHPExcel_Writer_Excel5 -- Bugfix: (MBaker) Improved the return of calculated results when the result value is an array -- Bugfix: (MBaker) Allow calculation engine to support Functions prefixed with @ within formulae -- Bugfix: (MBaker) Work item 10632 - Intersection operator (space operator) fatal error with calculation engine -- Bugfix: (ET) Work item 10742 - Chinese, Japanese, Korean characters show as squares in PDF -- Bugfix: (ET) Work item 10756 - sheet title allows invalid characters -- Bugfix: (ET) Work item 10757 - Sheet!$A$1 as function argument in formula causes infinite loop in Excel5 writer -- Bugfix: (MBaker) Work item 10740 - Cell range involving name not working with calculation engine - Modified calculation parser to handle range operator (:), but doesn't currently handle worksheet references with spaces or other non-alphameric characters, or trap erroneous references -- Bugfix: (MBaker) Work item 10798 - DATE function problem with calculation engine (says too few arguments given) -- Bugfix: (MBaker) Work item 10799 - Blank cell can cause wrong calculated value -- Bugfix: (MBaker) Modified ROW() and COLUMN() Lookup/Reference Functions to return an array when passed a cell range, plus some additional work on INDEX() -- Bugfix: (ET) Work item 10817 - Images not showing in Excel 97 using PHPExcel_Writer_Excel5 (patch by Jordi Gutiérrez Hermoso) -- Bugfix: (ET) Work item 10785 - When figures are contained in the excel sheet, Reader was stopped -- Bugfix: (MBaker) Work item 10818 - Formulas changed after insertNewRowBefore() -- Bugfix: (ET) Work item 10825 - Cell range row offset problem with shared formulas using PHPExcel_Reader_Excel5 -- Bugfix: (MBaker) Work item 10832 - Warning: Call-time pass-by-reference has been deprecated -- Bugfix: (ET) Work item 10849 - Image should "Move but don't size with cells" instead of "Move and size with cells" with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 10856 - Opening a Excel5 generated XLS in Excel 2007 results in header/footer entry not showing on input -- Bugfix: (ET) Work item 10859 - addExternalSheet() not returning worksheet -- Bugfix: (MBaker) Work item 10629 - Invalid results in formulas with named ranges - - -2009/08/10 (v1.7.0): -- General: (ET) Work item 9893 - Expand documentation: Number formats -- General: (ET) Work item 9941 - Class 'PHPExcel_Cell_AdvancedValueBinder' not found -- General: (MB) Work item 9960 - Change return type of date functions to PHPExcel_Calculation_Functions::RETURNDATE_EXCEL -- Feature: (MBaker) - New RPN and stack-based calculation engine for improved performance of formula calculation - - Faster (anything between 2 and 12 times faster than the old parser, depending on the complexity and nature of the formula) - - Significantly more memory efficient when formulae reference cells across worksheets - - Correct behaviour when referencing Named Ranges that exist on several worksheets - - Support for Excel ^ (Exponential) and % (Percentage) operators - - Support for matrices within basic arithmetic formulae (e.g. ={1,2,3;4,5,6;7,8,9}/2) - - Better trapping/handling of NaN and infinity results (return #NUM! error) - - Improved handling of empty parameters for Excel functions - - Optional logging of calculation steps -- Feature: (MBaker) - New calculation engine can be accessed independently of workbooks (for use as a standalone calculator) -- Feature: (MBaker) Work Item 2346 - Implement more Excel calculation functions - - Initial implementation of the COUNTIF() and SUMIF() Statistical functions - - Added ACCRINT() Financial function -- Feature: (MBaker) - Modifications to number format handling for dddd and ddd masks in dates, use of thousand separators even when locale only implements it for money, and basic fraction masks (0 ?/? and ?/?) -- Feature: (ET) Work item 9794 - Support arbitrary fixed number of decimals in PHPExcel_Style_NumberFormat::toFormattedString() -- Feature: (ET) Work item 6857 - Improving performance and memory on data dumps - - Various style optimizations (merging from branch wi6857-memory) - - Moving hyperlink and dataValidation properties from cell to worksheet for lower PHP memory usage -- Feature: (MB) Work item 9869 - Provide fluent interfaces where possible -- Feature: (ET) Work item 9899 - Make easy way to apply a border to a rectangular selection -- Feature: (ET) Work item 9906 - Support for system window colors in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 9911 - Horizontal center across selection -- Feature: (ET) Work item 9919 - Merged cells record, write to full record size in PHPExcel_Writer_Excel5 -- Feature: (MB) Work item 9895 - Add page break between sheets in exported PDF -- Feature: (ET) Work item 9902 - Sanitization of UTF-8 input for cell values -- Feature: (ET) Work item 9930 - Read cached calculated value with PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 9896 - Miscellaneous CSS improvements for PHPExcel_Writer_HTML -- Feature: (ET) Work item 9947 - getProperties: setCompany feature request -- Feature: (MB) Patch 2981 - Insert worksheet at a specified index -- Feature: (MB) Patch 3018 - Change worksheet index -- Feature: (MB) Patch 3039 - Readfilter for CSV reader -- Feature: (ET) Work item 10172 - Check value of mbstring.func_overload when saving with PHPExcel_Writer_Excel5 -- Feature: (ET) Work item 10251 - Eliminate dependency of an include path pointing to class directory -- Feature: (ET) Work item 10292 - Method for getting the correct reader for a certain file (contribution) -- Feature: (ET) Work item 10287 - Choosing specific row in fromArray method -- Feature: (ET) Work item 10319 - Shared formula support in PHPExcel_Reader_Excel5 -- Feature: (MB,ET) Work item 10345 - Right-to-left column direction in worksheet -- Bugfix: (ET) Work item 9824 - PHPExcel_Reader_Excel5 not reading PHPExcel_Style_NumberFormat::FORMAT_NUMBER ('0') -- Bugfix: (ET) Work item 9858 - Fractional row height in locale other than English results in corrupt output using PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 9846 - Fractional (decimal) numbers not inserted correctly when locale is other than English -- Bugfix: (ET) Work item 9863 - Fractional calculated value in locale other than English results in corrupt output using PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 9830 - Locale aware decimal and thousands separator in exported formats HTML, CSV, PDF -- Bugfix: (MB) Work item 9819 - Cannot Add Image with Space on its Name -- Bugfix: (ET) Work item 9884 - Black line at top of every page in output by PHPExcel_Writer_PDF -- Bugfix: (ET) Work item 9885 - Border styles and border colors not showing in HTML output (regression since 1.6.4) -- Bugfix: (ET) Work item 9888 - Hidden screen gridlines setting in worksheet not read by PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9913 - Some valid sheet names causes corrupt output using PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 9934 - More than 32,767 characters in a cell gives corrupt Excel file -- Bugfix: (ET) Work item 9937 - Images not getting copyied with the ->copy() function -- Bugfix: (ET) Work item 9940 - Bad calculation of column width setAutoSize(true) function -- Bugfix: (ET) Work item 9968 - Dates are sometimes offset by 1 day in output by HTML and PDF writers depending on system timezone setting -- Bugfix: (ET) Work item 10003 - Wingdings symbol fonts not working with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 10010 - White space string prefix stripped by PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 10023 - The name of the Workbook stream MUST be "Workbook", not "Book" -- Bugfix: (ET) Work item 10030 - Avoid message "Microsoft Excel recalculates formulas..." when closing xls file from Excel -- Bugfix: (ET) Work item 10031 - Non-unique newline representation causes problems with LEN formula -- Bugfix: (ET) Work item 10033 - Newline in cell not showing with PHPExcel_Writer_HTML and PHPExcel_Writer_PDF -- Bugfix: (ET) Work item 10046 - Rich-Text strings get prefixed by &nbsp; when output by HTML writer -- Bugfix: (ET) Work item 10052 - Leading spaces do not appear in output by HTML/PDF writers -- Bugfix: (MB) Work item 10061 - Empty Apache POI-generated file can not be read -- Bugfix: (ET) Work item 10068 - Column width not scaling correctly with font size in HTML and PDF writers -- Bugfix: (ET) Work item 10069 - Inaccurate row heights with HTML writer -- Bugfix: (MB) Patch 2992 - Reference helper -- Bugfix: (MBaker) - Excel 5 Named ranges should not be local to the worksheet, but accessible from all worksheets -- Bugfix: (ET) Work item 10088 - Row heights are ignored by PHPExcel_Writer_PDF -- Bugfix: (MB) Patch 3003 - Write raw XML -- Bugfix: (ET) Work item 10098 - removeRow(), removeColumn() not always clearing cell values -- Bugfix: (ET) Work item 10142 - Problem reading certain hyperlink records with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10143 - Hyperlink cell range read failure with PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 10149 - 'Column string index can not be empty.' -- Bugfix: (ET) Work item 10204 - getHighestColumn() sometimes says there are 256 columns with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10220 - extractSheetTitle fails when sheet title contains exclamation mark (!) -- Bugfix: (ET) Work item 10221 - setTitle() sometimes erroneously appends integer to sheet name -- Bugfix: (ET) Work item 10229 - Mac BIFF5 Excel file read failure (missing support for Mac OS Roman character set) -- Bugfix: (ET) Work item 10230 - BIFF5 header and footer incorrectly read by PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10259 - iconv notices when reading hyperlinks with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10252 - Excel5 reader OLE read failure with small Mac BIFF5 Excel files -- Bugfix: (ET) Work item 10272 - Problem in reading formula : IF( IF ) with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10274 - Error reading formulas referencing external sheets with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10291 - Image horizontally stretched when default font size is increased (PHPExcel_Writer_Excel5) -- Bugfix: (ET) Work item 10333 - Undefined offset in Reader\Excel5.php on line 3572 -- Bugfix: (MB) Work item 10340 - PDF output different then XLS (copied data) -- Bugfix: (ET) Work item 10352 - Internal hyperlinks with UTF-8 sheet names not working in PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 10361 - String shared formula result read error with PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 10363 - Uncaught exception 'Exception' with message 'Valid scale is between 10 and 400.' in Classes/PHPExcel/Worksheet/PageSetup.php:338 -- Bugfix: (ET) Work item 10355 - Using setLoadSheetsOnly fails if you do not use setReadDataOnly(true) and sheet is not the first sheet -- Bugfix: (MB) Work item 10362 - getCalculatedValue() sometimes incorrect with IF formula and 0-values -- Bugfix: (MBaker) Work Item 10198 - Excel Reader 2007 problem with "shared" formulae when "master" is an error -- Bugfix: (MBaker) Work Item 10106 - Named Range Bug, using the same range name on different worksheets -- Bugfix: (MBaker) Work Item 10004 - Java code in JAMA classes -- Bugfix: (MBaker) Work Item 9659 - getCalculatedValue() not working with some formulas involving error types -- Bugfix: (MBaker) Work Item 9447 - evaluation of both return values in an IF() statement returning an error if either result was an error, irrespective of the IF evaluation -- Bugfix: (MBaker) Work Item 6203 - Power in formulas: new calculation engine no longer treats ^ as a bitwise XOR operator -- Bugfix: (MBaker) - Bugfixes and improvements to many of the Excel functions in PHPExcel - - Added optional "places" parameter in the BIN2HEX(), BIN2OCT, DEC2BIN(), DEC2OCT(), DEC2HEX(), HEX2BIN(), HEX2OCT(), OCT2BIN() and OCT2HEX() Engineering Functions - - Trap for unbalanced matrix sizes in MDETERM() and MINVERSE() Mathematic and Trigonometric functions - - Fix for default characters parameter value for LEFT() and RIGHT() Text functions - - Fix for GCD() and LCB() Mathematical functions when the parameters include a zero (0) value - - Fix for BIN2OCT() Engineering Function for 2s complement values (which were returning hex values) - - Fix for BESSELK() and BESSELY() Engineering functions - - Fix for IMDIV() Engineering Function when result imaginary component is positive (wasn't setting the sign) - - Fix for ERF() Engineering Function when called with an upper limit value for the integration - - Fix to DATE() Date/Time Function for year value of 0 - - Set ISPMT() function as category FINANCIAL - - Fix for DOLLARDE() and DOLLARFR() Financial functions - - Fix to EFFECT() Financial function (treating $nominal_rate value as a variable name rather than a value) - - Fix to CRITBINOM() Statistical function (CurrentValue and EssentiallyZero treated as constants rather than variables) - Note that an Error in the function logic can still lead to a permanent loop - - Fix to MOD() Mathematical function to work with floating point results - - Fix for QUOTIENT() Mathematical function - - Fix to HOUR(), MINUTE() and SECOND() Date/Time functions to return an error when passing in a floating point value of 1.0 or greater, or less than 0 - - LOG() Function now correctly returns base-10 log when called with only one parameter, rather than the natural log as the default base - - Modified text functions to handle multibyte character set (UTF-8). - - -2009/04/22 (v1.6.7): -- General: (MB) Work item 9416 - Deprecate misspelled setStriketrough() and getStriketrough() methods -- General: (MB) Work item 9526 - Performance improvement when saving file -- Feature: (MB) Work item 9598 - Check that sheet title has maximum 31 characters -- Feature: (MB, ET) Work item 9631 - True support for Excel built-in number format codes -- Feature: (ET) Work item 9683 - Ability to read defect BIFF5 Excel file without CODEPAGE record -- Feature: (MB) Work item 9701 - Auto-detect which reader to invoke -- Feature: (ET) Work item 9214 - Deprecate insertion of dates using PHP-time (Unix time) [request for removal of feature] -- Feature: (ET) Work item 9747 - Support for entering time values like '9:45', '09:45' using AdvancedValueBinder -- Feature: (ET) Work item 9797 - DataType dependent horizontal alignment in HTML and PDF writer -- Bugfix: (MB) Work item 9375 - Cloning data validation object causes script to stop -- Bugfix: (ET) Work item 9400 - Simultaneous repeating rows and repeating columns not working with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 9399 - Simultaneous repeating rows and repeating columns not working with PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 9437 - Row outline level not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 9452 - Occasional notices with PHPExcel_Reader_Excel5 when Excel file contains drawing elements -- Bugfix: (ET) Work item 9453 - PHPExcel_Reader_Excel5 fails as a whole when workbook contains images other than JPEG/PNG -- Bugfix: (ET) Work item 9444 - Excel5 writer checks for iconv but does not necessarily use it -- Bugfix: (ET) Work item 9463 - Altering a style on copied worksheet alters also the original -- Bugfix: (MB) Work item 9480 - Formulas are incorrectly updated when a sheet is renamed -- Bugfix: (MB) Work item 9513 - PHPExcel_Worksheet::extractSheetTitle not treating single quotes correctly -- Bugfix: (MB) Work item 9477 - PHP Warning raised in function array_key_exists -- Bugfix: (MB) Work item 9599 - getAlignWithMargins() gives wrong value when using PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9600 - getScaleWithDocument() gives wrong value when using PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9630 - PHPExcel_Reader_Excel2007 not reading the first user-defined number format -- Bugfix: (MB) Work item 9647 - Print area converted to uppercase after read with PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9661 - Incorrect reading of scope for named range using PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9690 - Error with pattern (getFillType) and rbg (getRGB) -- Bugfix: (ET) Work item 9712 - AdvancedValueBinder affected by system timezone setting when inserting date values -- Bugfix: (ET) Work item 9743 - PHPExcel_Reader_Excel2007 not reading value of active sheet index -- Bugfix: (ET) Work item 9742 - getARGB() sometimes returns SimpleXMLElement object instead of string with PHPExcel_Reader_Excel2007 -- Bugfix: (ET) Work item 9731 - Negative image offset causes defects in 14excel5.xls and 20readexcel5.xlsx -- Bugfix: (ET) Work item 9758 - HTML & PDF Writer not working with mergeCells (regression since 1.6.5) -- Bugfix: (ET) Work item 9774 - Too wide columns with HTML and PDF writer -- Bugfix: (MB) Work item 9775 - PDF and cyrillic fonts -- Bugfix: (ET) Work item 9793 - Percentages not working correctly with HTML and PDF writers (shows 0.25% instead of 25%) -- Bugfix: (ET) Work item 9791 - PHPExcel_Writer_HTML creates extra borders around cell contents using setUseInlineCss(true) -- Bugfix: (ET) Work item 9784 - Problem with text wrap + merged cells in HTML and PDF writer -- Bugfix: (ET) Work item 9814 - Adjacent path separators in include_path causing IOFactory to violate open_basedir restriction - - --------------------------------------------------------------------------------- -BREAKING CHANGE! In previous versions of PHPExcel up to and including 1.6.6, -when a cell had a date-like number format code, it was possible to enter a date -directly using an integer PHP-time without converting to Excel date format. - -Starting with PHPExcel 1.6.7 this is no longer supported. Refer to the developer -documentation for more information on entering dates into a cell. --------------------------------------------------------------------------------- - - -2009/03/02 (v1.6.6): -- General: (MB) Work item 9102 - Improve support for built-in number formats in PHPExcel_Reader_Excel2007 -- General: (ET) Work item 9281 - Source files are in both UNIX and DOS formats - changed to UNIX -- General: (MB) Work item 9338 - Update documentation: Which language to write formulas in? -- Feature: (ET) Work item 8817 - Ignore DEFCOLWIDTH records with value 8 in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 8847 - Support for width, height, offsetX, offsetY for images in PHPExcel_Reader_Excel5 -- Feature: (MB) Work item 8870 - Disk Caching in specific folder -- Feature: (MBaker) Work item 2346 - Added SUMX2MY2, SUMX2PY2, SUMXMY2, MDETERM and MINVERSE Mathematical and Trigonometric Functions -- Feature: (MBaker) Work item 2346 - Added CONVERT Engineering Function -- Feature: (MBaker) Work item 2346 - Added DB, DDB, DISC, DOLLARDE, DOLLARFR, INTRATE, IPMT, PPMT, PRICEDISC, PRICEMAT and RECEIVED Financial Functions -- Feature: (MBaker) Work item 2346 - Added ACCRINTM, CUMIPMT, CUMPRINC, TBILLEQ, TBILLPRICE, TBILLYIELD, YIELDDISC and YIELDMAT Financial Functions -- Feature: (MBaker) Work item 2346 - Added DOLLAR Text Function -- Feature: (MBaker) Work item 2346 - Added CORREL, COVAR, FORECAST, INTERCEPT, RSQ, SLOPE and STEYX Statistical Functions -- Feature: (MBaker) Work item 2346 - Added PEARSON Statistical Functions as a synonym for CORREL -- Feature: (MBaker) Work item 2346 - Added LINEST, LOGEST (currently only valid for stats = false), TREND and GROWTH Statistical Functions -- Feature: (MBaker) Work item 2346 - Added RANK and PERCENTRANK Statistical Functions -- Feature: (MBaker) Work item 2346 - Added ROMAN Mathematical Function (Classic form only) -- Feature: (MB) Work item 8931 - Update documentation to show example of getCellByColumnAndRow($col, $row) -- Feature: (MB) Work item 8770 - Implement worksheet, row and cell iterators -- Feature: (MB) Work item 9001 - Support for arbitrary defined names (named range) -- Feature: (MB, ET) Work item 9016 - Update formulas when sheet title / named range title changes -- Feature: (MB) Work item 9103 - Ability to read cached calculated value -- Feature: (MBaker, ET) Work item 8483 - Support for Excel 1904 calendar date mode (Mac) -- Feature: (ET) Work item 9194 - PHPExcel_Writer_Excel5 improvements writing shared strings table -- Feature: (ET) Work item 9248 - PHPExcel_Writer_Excel5 iconv fallback when mbstring extension is not enabled -- Feature: (ET) Work item 9253 - UTF-8 support in font names in PHPExcel_Writer_Excel5 -- Feature: (MB) Work item 9215 - Implement value binding architecture -- Feature: (MB) Work item 6742 - PDF writer not working with UTF-8 -- Feature: (ET) Work item 9355 - Eliminate duplicate style entries in multisheet workbook written by PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8810 - Redirect to client browser fails due to trailing white space in class definitions -- Bugfix: (MB) Work item 8816 - Spurious column dimension element introduced in blank worksheet after using PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 8830 - Image gets slightly narrower than expected when using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8831 - Image laid over non-visible row gets squeezed in height when using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8860 - PHPExcel_Reader_Excel5 fails when there are 10 or more images in the workbook -- Bugfix: (MB) Work item 8909 - Different header/footer images in different sheets not working with PHPExcel_Writer_Excel2007 -- Bugfix: (MB, ET) Work item 8924 - Fractional seconds disappear when using PHPExcel_Reader_Excel2007 and PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 7994 - Images not showing in OpenOffice when using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 9047 - Images not showing on print using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 9085 - PHPExcel_Writer_Excel5 maximum allowed record size 4 bytes too short -- Bugfix: (MB) Work item 9119 - Not numeric strings are formatted as dates and numbers using worksheet's toArray method -- Bugfix: (ET) Work item 9132 - Excel5 simple formula parsing error -- Bugfix: (ET) Work item 9206 - Problems writing dates with CSV -- Bugfix: (ET) Work item 9203 - PHPExcel_Reader_Excel5 reader fails with fatal error when reading group shapes -- Bugfix: (ET) Work item 9231 - PHPExcel_Writer_Excel5 fails completely when workbook contains more than 57 colors -- Bugfix: (ET) Work item 9244 - PHPExcel_Writer_PDF not compatible with autoload -- Bugfix: (ET) Work item 9250 - Fatal error: Call to a member function getNestingLevel() on a non-object in PHPExcel/Reader/Excel5.php on line 690 -- Bugfix: (MB) Work item 9246 - Notices when running test 04printing.php on PHP 5.2.8 -- Bugfix: (MB) Work item 9294 - insertColumn() spawns creation of spurious RowDimension -- BugFix: (MBaker) Work item 9296 - Fix declarations for methods in extended Trend classes -- Bugfix: (MBaker) Work item 2346 - Fix to parameters for the FORECAST Statistical Function -- Bugfix: (MB) Work item 7083 - PDF writer problems with cell height and text wrapping -- Bugfix: (MBaker) Work Item 9337 - Fix test for calculated value in case the returned result is an array -- Bugfix: (ET) Work Item 9354 - Column greater than 256 results in corrupt Excel file using PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 9351 - Excel Numberformat 0.00 results in non internal decimal places values in toArray() Method -- Bugfix: (MB,ET) Work item 9356 - setAutoSize not taking into account text rotation -- Bugfix: (ET) Work item 9372 - Call to undefined method PHPExcel_Worksheet_MemoryDrawing::getPath() in PHPExcel/Writer/HTML.php - - -2009/01/05 (v1.6.5): -- General: (MB) Applied patch 2063 -- General: (MB) Applied patch from work item 8073 - Optimise Shared Strings -- General: (MB) Applied patch from work item 8074 - Optimise Cell Sorting -- General: (MB) Applied patch from work item 8075 - Optimise Style Hashing -- General: (ET) Applied patch from work item 8245 - UTF-8 enhancements -- General: (ET) Applied patch from work item 8283 - PHPExcel_Writer_HTML validation errors against strict HTML 4.01 / CSS 2.1 -- General: (MB) Documented work items 6203 and 8110 in manual -- General: (ET) Restructure package hierachy so classes can be found more easily in auto-generated API (from work item 8468) -- General: (MB) Work item 8806 - Redirect output to a client's browser: Update recommendation in documentation -- Feature: (ET) Work item 7897 - PHPExcel_Reader_Excel5 support for print gridlines -- Feature: (ET) Work item 7899 - Screen gridlines support in Excel5 reader/writer -- Feature: (MB, ET) Work item 7552 - Option for adding image to spreadsheet from image resource in memory -- Feature: (ET) Work item 7862 - PHPExcel_Reader_Excel5 style support for BIFF5 files (Excel 5.0 - Excel 95) -- Feature: (ET) Work item 7918 - PHPExcel_Reader_Excel5 support for user-defined colors and special built-in colors -- Feature: (ET) Work item 7992 - Support for freeze panes in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 7996 - Support for header and footer margins in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 7997 - Support for active sheet index in Excel5 reader/writer -- Feature: (MB) Work item 7991 - Freeze panes not read by PHPExcel_Reader_Excel2007 -- Feature: (MB, ET) Work item 7993 - Support for screen zoom level (feature request) -- Feature: (ET) Work item 8012 - Support for default style in PHPExcel_Reader_Excel5 -- Feature: (MB) Work item 8094 - Apple iWork / Numbers.app incompatibility -- Feature: (MB) Work item 7931 - Support "between rule" in conditional formatting -- Feature: (MB) Work item 8308 - Comment size, width and height control (feature request) -- Feature: (ET) Work item 8418 - Improve method for storing MERGEDCELLS records in PHPExcel_Writer_Excel5 -- Feature: (ET) Work item 8435 - Support for protectCells() in Excel5 reader/writer -- Feature: (ET) Work item 8472 - Support for fitToWidth and fitToHeight pagesetup properties in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 8489 - Support for setShowSummaryBelow() and setShowSummaryRight() in PHPExcel_Writer_Excel5 -- Feature: (MB) Work item 8483 - Support for Excel 1904 calendar date mode (Mac) -- Feature: (ET) Work item 7538 - Excel5 reader: Support for reading images (bitmaps) -- Feature: (ET) Work item 8787 - Support for default style in PHPExcel_Writer_Excel5 -- Feature: (MBaker) Modified calculate() method to return either an array or the first value from the array for those functions that return arrays rather than single values (e.g the MMULT and TRANSPOSE function). This performance can be modified based on the $returnArrayAsType which can be set/retrieved by calling the setArrayReturnType() and getArrayReturnType() methods of the PHPExcel_Calculation class. -- Feature: (MBaker) Work item 2346 - Added ERROR.TYPE Information Function, MMULT Mathematical and Trigonometry Function, and TRANSPOSE Lookup and Reference Function -- Bugfix: (ET) Work item 7896 - setPrintGridlines(true) not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7907 - Incorrect mapping of fill patterns in PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7898 - setShowGridlines(false) not working with PHPExcel_Writer_Excel2007 -- Bugfix: (MB) Work item 7905 - getShowGridlines() gives inverted value when reading sheet with PHPExcel_Reader_Excel2007 -- Bugfix: (ET) Work item 7944 - User-defined column width becomes slightly larger after read/write with Excel5 -- Bugfix: (ET) Work item 7949 - Incomplete border style support in PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7928 - Conditional formatting "containsText" read/write results in MS Office Excel 2007 crash -- Bugfix: (MB) Work item 7995 - All sheets are always selected in output when using PHPExcel_Writer_Excel2007 -- Bugfix: (MB) Work item 8013 - COLUMN function warning message during plain read/write -- Bugfix: (MB) Work item 8155 - setValue(0) results in string data type '0' -- Bugfix: (MB) Work item 8226 - Styles not removed when removing rows from sheet -- Bugfix: (MB) Work item 8301 - =IF formula causes fatal error during $objWriter->save() in Excel2007 format -- Bugfix: (ET) Work item 8333 - Exception thrown reading valid xls file: "Excel file is corrupt. Didn't find CONTINUE record while reading shared strings" -- Bugfix: (ET) Work item 8320 - MS Outlook corrupts files generated by PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 8351 - Undefined method PHPExcel_Worksheet::setFreezePane() in ReferenceHelper.php on line 271 -- Bugfix: (MB) Work item 8401 - Ampersands (&), left and right angles (<, >) in Rich-Text strings leads to corrupt output using PHPExcel_Writer_Excel2007 -- Bugfix: (ET) Work item 8408 - Print header and footer not supporting UTF-8 in PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8463 - Vertical page breaks not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8476 - Missing support for accounting underline types in PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8482 - Infinite loops when reading corrupt xls file using PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 8566 - Sheet protection password not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8596 - PHPExcel_Style_NumberFormat::FORMAT_NUMBER ignored by PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8781 - PHPExcel_Reader_Excel5 fails a whole when workbook contains a chart -- Bugfix: (ET) Work item 8788 - Occasional loss of column widths using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 8795 - Notices while reading formulas with deleted sheet references using PHPExcel_Reader_Excel5 -- Bugfix: (MB) Work item 8807 - Default style not read by PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 9341 - Blank rows occupy too much space in file generated by PHPExcel_Writer_Excel2007 - - -2008/10/27 (v1.6.4): -- General: (ET) Work item 7882 - RK record number error in MS developer documentation: 0x007E should be 0x027E -- Feature: (MBaker) Work item 7878 - getHighestColumn() returning "@" for blank worksheet causes corrupt output -- Feature: (MBaker) Work item 2346 - Implement ROW and COLUMN Lookup/Reference Functions (when specified with a parameter) -- Feature: (MBaker) Work item 2346 - Implement initial work on OFFSET Lookup/Reference Function (returning address rather than value at address) -- Feature: (ET) Work item 7416 - Excel5 reader: Page margins -- Feature: (ET) Work item 7417 - Excel5 reader: Header & Footer -- Feature: (ET) Work item 7449 - Excel5 reader support for page setup (paper size etc.) -- Feature: (MB) Work item 7445 - Improve speed and memory consumption of PHPExcel_Writer_CSV -- Feature: (MB) Work item 7432 - Better recognition of number format in HTML, CSV, and PDF writer -- Feature: (MB) Work item 7485 - Font support: Superscript and Subscript -- Feature: (ET) Work item 7509 - Excel5 reader font support: Super- and subscript -- Feature: (ET) Work item 7521 - Excel5 reader style support: Text rotation and stacked text -- Feature: (ET) Work item 7530 - Excel5 reader: Support for hyperlinks -- Feature: (MB, ET) Work item 7557 - Import sheet by request -- Feature: (ET) Work item 7607 - PHPExcel_Reader_Excel5 support for page breaks -- Feature: (ET) Work item 7622 - PHPExcel_Reader_Excel5 support for shrink-to-fit -- Feature: (MB, ET) Work item 7675 - Support for error types -- Feature: (ET) Work item 7388 - Excel5 reader true formula support -- Feature: (ET) Work item 7701 - Support for named ranges (defined names) in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 7781 - Support for repeating rows and repeating columns (print titles) in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 7783 - Support for print area in PHPExcel_Reader_Excel5 -- Feature: (ET) Work item 7795 - Excel5 reader and writer support for horizontal and vertical centering of page -- Feature: (MB) Applied patch 1962 -- Feature: (ET) Work item 7866 - Excel5 reader and writer support for hidden cells (formulas) -- Feature: (MB, ET) Work item 7612 - Support for indentation in cells (feature request) -- Feature: (MB, ET) Work item 7828 - Option for reading only specified interval of rows in a sheet -- Bugfix: (MBaker) Work item 7367 - PHPExcel_Calculation_Functions::DATETIMENOW() and PHPExcel_Calculation_Functions::DATENOW() to force UTC -- Bugfix: (MBaker) Work item 7395 - Modified PHPExcel_Shared_Date::FormattedPHPToExcel() and PHPExcel_Shared_Date::ExcelToPHP to force datatype for return values -- Bugfix: (ET) Work item 7450 - Excel5 reader not producing UTF-8 strings with BIFF5 files -- Bugfix: (MB) Work item 7470 - Array constant in formula gives run-time notice with Excel2007 writer -- Bugfix: (MB) Work item 7494 - PHPExcel_Reader_Excel2007 setReadDataOnly(true) returns Rich-Text -- Bugfix: (ET) Work item 7496 - PHPExcel_Reader_Excel5 setReadDataOnly(true) returns Rich-Text -- Bugfix: (MB) Work item 7497 - Characters before superscript or subscript losing style -- Bugfix: (MB) Work item 7507 - Subscript not working with HTML writer -- Bugfix: (MB) Work item 7508 - DefaultColumnDimension not working on first column (A) -- Bugfix: (MB) Work item 7527 - Negative numbers are stored as text in PHPExcel_Writer_2007 -- Bugfix: (ET) Work item 7531 - Text rotation and stacked text not working with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7536 - PHPExcel_Shared_Date::isDateTimeFormatCode erroneously says true -- Bugfix: (MB) Work item 7559 - Different images with same filename in separate directories become duplicates -- Bugfix: (ET) Work item 7568 - PHPExcel_Reader_Excel5 not returning sheet names as UTF-8 using for Excel 95 files -- Bugfix: (MB) Work item 7575 - setAutoSize(true) on empty column gives column width of 10 using PHPExcel_Writer_Excel2007 -- Bugfix: (MB, ET) Work item 7573 - setAutoSize(true) on empty column gives column width of 255 using PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7514 - Worksheet_Drawing bug -- Bugfix: (MB) Work item 7593 - getCalculatedValue() with REPT function causes script to stop -- Bugfix: (MB) Work item 7594 - getCalculatedValue() with LEN function causes script to stop -- Bugfix: (MB) Work item 7600 - Explicit fit-to-width (page setup) results in fit-to-height becoming 1 -- Bugfix: (MB) Work item 7610 - Fit-to-width value of 1 is lost after read/write of Excel2007 spreadsheet -- Bugfix: (MB) Work item 7516 - Conditional styles not read properly using PHPExcel_Reader_Excel2007 -- Bugfix: (MB) Work item 7611 - PHPExcel_Writer_2007: Default worksheet style works only for first sheet -- Bugfix: (ET) Work item 6940 - Cannot Lock Cells using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7621 - Incorrect cell protection values found when using Excel5 reader -- Bugfix: (ET) Work item 7623 - Default row height not working above highest row using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7637 - Default column width does not get applied when using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7642 - Broken support for UTF-8 string formula results in PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 7643 - UTF-8 sheet names not working with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7631 - getCalculatedValue() with ISNONTEXT function causes script to stop -- Bugfix: (ET) Work item 7652 - Missing BIFF3 functions in PHPExcel_Writer_Excel5: USDOLLAR (YEN), FINDB, SEARCHB, REPLACEB, LEFTB, RIGHTB, MIDB, LENB, ASC, DBCS (JIS) -- Bugfix: (ET) Work item 7663 - Excel5 reader doesn't read numbers correctly in 64-bit systems -- Bugfix: (ET) Work item 7667 - Missing BIFF5 functions in PHPExcel_Writer_Excel5: ISPMT, DATEDIF, DATESTRING, NUMBERSTRING -- Bugfix: (ET) Work item 7668 - Missing BIFF8 functions in PHPExcel_Writer_Excel5: GETPIVOTDATA, HYPERLINK, PHONETIC, AVERAGEA, MAXA, MINA, STDEVPA, VARPA, STDEVA, VARA -- Bugfix: (MB) Work item 7657 - Wrong host value in PHPExcel_Shared_ZipStreamWrapper::stream_open() -- Bugfix: (ET) Work item 7676 - PHPExcel_Reader_Excel5 not reading explicitly entered error types in cells -- Bugfix: (ET) Work item 7678 - Boolean and error data types not preserved for formula results in PHPExcel_Reader_Excel5 -- Bugfix: (MB) Work item 7695 - PHPExcel_Reader_Excel2007 ignores cell data type -- Bugfix: (ET) Work item 7712 - PHPExcel_Reader_Excel5 ignores cell data type -- Bugfix: (ET) Work item 7587 - PHPExcel_Writer_Excel5 not aware of data type -- Bugfix: (ET) Work item 7713 - Long strings sometimes truncated when using PHPExcel_Reader_Excel5 -- Bugfix: (ET) Work item 7727 - Direct entry of boolean or error type in cell not supported by PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 7714 - PHPExcel_Reader_Excel2007: Error reading cell with data type string, date number format, and numeric-like cell value -- Bugfix: (ET) Work item 7735 - Row and column outlines (group indent level) not showing after using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7737 - Missing UTF-8 support in number format codes for PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7750 - Missing UTF-8 support with PHPExcel_Writer_Excel5 for explicit string in formula -- Bugfix: (MB) Work item 7726 - Problem with class constants in PHPExcel_Style_NumberFormat -- Bugfix: (ET) Work item 7758 - Sometimes errors with PHPExcel_Reader_Excel5 reading hyperlinks -- Bugfix: (ET) Work item 7759 - Hyperlink in cell always results in string data type when using PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7771 - Excel file with blank sheet seen as broken in MS Office Excel 2007 when created by PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7785 - PHPExcel_Reader_Excel5: Incorrect reading of formula with explicit string containing (escaped) double-quote -- Bugfix: (MB) Work item 7787 - getCalculatedValue() fails on formula with sheet name containing (escaped) single-quote -- Bugfix: (MB) Work item 7786 - getCalculatedValue() fails on formula with explicit string containing (escaped) double-quote -- Bugfix: (MB) Work item 7780 - Problems with simultaneous repeatRowsAtTop and repeatColumnsAtLeft using Excel2007 reader and writer -- Bugfix: (ET) Work item 7802 - PHPExcel_Reader_Excel5: Error reading formulas with sheet reference containing special characters -- Bugfix: (ET) Work item 7831 - Off-sheet references sheet!A1 not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7834 - Repeating rows/columns (print titles), print area not working with PHPExcel_Writer_Excel5 -- Bugfix: (ET) Work item 7849 - Formula having datetime number format shows as text when using PHPExcel_Writer_Excel5 -- Bugfix: (MBaker) Work item 7863 - Cannot set formula to hidden using applyFromArray() -- Bugfix: (MBaker) Work item 7805 - HTML/PDF Writers limited to 26 columns by calculateWorksheetDimension (erroneous comparison in getHighestColumn() method) -- Bugfix: (MB) Work item 7873 - Formula returning error type is lost when read by PHPExcel_Reader_Excel2007 -- Bugfix: (ET) Work item 7883 - PHPExcel_Reader_Excel5: Cell style lost for last column in group of blank cells -- Bugfix: (MB) Work item 7886 - Column width sometimes collapses to auto size using Excel2007 reader/writer -- Bugfix: (MB) Work item 9343 - Data Validation Formula = 0 crashes Excel - - -2008/08/25 (v1.6.3): -- Bugfix: (MBaker) Work item 7367 - Modified PHPExcel_Shared_Date::PHPToExcel() to force UTC -- General: (MB) Applied patch 1629 -- General: (MB) Applied patch 1644 -- General: (MB) Work item 6485 - Implement repeatRow and repeatColumn in Excel5 writer -- General: (MB) Work item 6838 - Remove scene3d filter in Excel2007 drawing -- Feature: (MBaker) Work item 2346 - Implement CHOOSE and INDEX Lookup/Reference Functions -- Feature: (MBaker) Work item 2346 - Implement CLEAN Text Functions -- Feature: (MBaker) Work item 2346 - Implement YEARFRAC Date/Time Functions -- Feature: (MB) Work item 6508 - Implement 2 options for print/show gridlines -- Feature: (MB) Work item 7270 - Add VLOOKUP function (contribution) -- Feature: (MB) Work item 7182 - Implemented: ShrinkToFit -- Feature: (MB) Work item 7218 - Row heights not updated correctly when inserting new rows -- Feature: (MB) Work item 7157 - Copy worksheets within the same workbook -- Feature: (ET) Work item 7290 - Excel5 reader style support: horizontal and vertical alignment plus text wrap -- Feature: (ET) Work item 7294 - Excel5 reader support for merged cells -- Feature: (ET) Work item 7296 - Excel5 reader: Sheet Protection -- Feature: (ET) Work item 7297 - Excel5 reader: Password for sheet protection -- Feature: (ET) Work item 7299 - Excel5 reader: Column width -- Feature: (ET) Work item 7301 - Excel5 reader: Row height -- Feature: (ET) Work item 7304 - Excel5 reader: Font support -- Feature: (ET) Work item 7324 - Excel5 reader: support for locked cells -- Feature: (ET) Work item 7330 - Excel5 reader style support: Fill (background colors and patterns) -- Feature: (ET) Work item 7332 - Excel5 reader style support: Borders (style and color) -- Feature: (ET) Work item 7346 - Excel5 reader: Rich-Text support -- Feature: (MB) Work item 7313 - Read Excel built-in number formats with Excel 2007 reader -- Feature: (ET) Work item 7317 - Excel5 reader: Number format support -- Feature: (MB) Work item 7362 - Creating a copy of PHPExcel object -- Feature: (ET) Work item 7373 - Excel5 reader: support for row / column outline (group) -- Feature: (MB) Work item 7380 - Implement default row/column sizes -- Feature: (MB) Work item 7364 - Writer HTML - option to return styles and table separately -- Feature: (ET) Work item 7393 - Excel5 reader: Support for remaining built-in number formats -- Bugfix: (MBaker) Fixed rounding in HOUR MINUTE and SECOND Time functions, and improved performance for these -- Bugfix: (MBaker) Fix to TRIM function -- Bugfix: (MBaker) Fixed range validation in TIME Functions.php -- Bugfix: (MBaker) EDATE and EOMONTH functions now return date values based on the returnDateType flag -- Bugfix: (MBaker) Write date values that are the result of a calculation function correctly as Excel serialized dates rather than PHP serialized date values -- Bugfix: (MB) Work item 6690 - Excel2007 reader not always reading boolean correctly -- Bugfix: (MB) Work item 6275 - Columns above IZ -- Bugfix: (MB) Work item 6853 - Other locale than English causes Excel2007 writer to produce broken xlsx -- Bugfix: (MB) Work item 7061 - Typo: Number_fromat in NumberFormat.php -- Bugfix: (MB) Work item 6865 - Bug in Worksheet_BaseDrawing setWidth() -- Bugfix: (MB) Work item 6891 - PDF writer collapses column width for merged cells -- Bugfix: (MB) Work item 6867 - Issues with drawings filenames -- Bugfix: (MB) Work item 7073 - fromArray() local variable isn't defined -- Bugfix: (MB) Work item 7276 - PHPExcel_Writer_Excel5->setTempDir() not passed to all classes involved in writing to a file -- Bugfix: (MB) Work item 7277 - Excel5 reader not handling UTF-8 properly -- Bugfix: (MB) Work item 7327 - If you write a 0 value in cell, cell shows as empty -- Bugfix: (MB) Work item 7302 - Excel2007 writer: Row height ignored for empty rows -- Bugfix: (MB) Work item 7281 - Excel2007 (comments related error) -- Bugfix: (MB) Work item 7345 - Column width in other locale -- Bugfix: (MB) Work item 7347 - Excel2007 reader not reading underlined Rich-Text -- Bugfix: (ET) Work item 7357 - Excel5 reader converting booleans to strings -- Bugfix: (MB) Work item 7365 - Recursive Object Memory Leak -- Bugfix: (MB) Work item 7372 - Excel2007 writer ignoring row dimensions without cells -- Bugfix: (ET) Work item 7382 - Excel5 reader is converting formatted numbers / dates to strings - - -2008/06/23 (v1.6.2): -- General: (MB) Work item 6088 - Document style array values -- General: (MB) Applied patch 1195 -- General: (MB) Work item 6178 - Redirecting output to a client’s web browser - http headers -- General: (MB) Work item 6187 - Improve worksheet garbage collection -- General: (MBaker) Functions that return date values can now be configured to return as Excel serialized date/time, PHP serialized date/time, or a PHP date/time object. -- General: (MBaker) Functions that explicitly accept dates as parameters now permit values as Excel serialized date/time, PHP serialized date/time, a valid date string, or a PHP date/time object. -- General: (MBaker) Implement ACOSH, ASINH and ATANH functions for those operating platforms/PHP versions that don't include these functions -- General: (MBaker) Implement ATAN2 logic reversing the arguments as per Excel -- General: (MBaker) Additional validation of parameters for COMBIN -- General: (MBaker) Fixed validation for CEILING and FLOOR when the value and significance parameters have different signs; and allowed default value of 1 or -1 for significance when in GNUMERIC compatibility mode -- Feature: (MBaker) Work item 2346 - Implement ADDRESS, ISLOGICAL, ISTEXT and ISNONTEXT functions -- Feature: (MBaker) Work item 2346 - Implement COMPLEX, IMAGINARY, IMREAL, IMARGUMENT, IMCONJUGATE, IMABS, IMSUB, IMDIV, IMSUM, IMPRODUCT, IMSQRT, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER IMCOS and IMSIN Engineering functions -- Feature: (MBaker) Work item 2346 - Implement NETWORKDAYS and WORKDAY Date/Time functions -- Feature: (MB) Work item 6100 - Make cell column AAA available -- Feature: (MB) Work item 6095 - Mark particular cell as selected when opening Excel -- Feature: (MB) Work item 6120 - Multiple sheets in PDF and HTML -- Feature: (MB) Work item 6227 - Implement PHPExcel_ReaderFactory and PHPExcel_WriterFactory -- Feature: (MB) Work item 6249 - Set image root of PHPExcel_Writer_HTML -- Feature: (MB) Work item 6264 - Enable/disable calculation cache -- Feature: (MB) Work item 6259 - PDF writer and multi-line text -- Feature: (MB) Work item 6350 - Feature request - setCacheExpirationTime() -- Feature: (JB) Work item 6370 - Implement late-binding mechanisms to reduce memory footprint -- Feature: (JB) Work item 6430 - Implement shared styles -- Feature: (MB) Work item 6391 - Copy sheet from external Workbook to active Workbook -- Feature: (MB) Work item 6428 - Functions in Conditional Formatting -- Bugfix: (MB) Work item 6096 - Default Style in Excel5 -- Bugfix: (MB) Work item 6150 - Numbers starting with '+' cause Excel 2007 errors -- Bugfix: (MB) Work item 6092 - ExcelWriter5 is not PHP5 compatible, using it with E_STRICT results in a bunch of errors (applied patches) -- Bugfix: (MB) Work item 6179 - Error Reader Excel2007 line 653 foreach ($relsDrawing->Relationship as $ele) -- Bugfix: (MB) Work item 6229 - Worksheet toArray() screws up DATE -- Bugfix: (MB) Work item 6253 - References to a Richtext cell in a formula -- Bugfix: (MB) Work item 6285 - insertNewColumnBefore Bug -- Bugfix: (MB) Work item 6319 - Error reading Excel2007 file with shapes -- Bugfix: (MBaker) Work item 6302 - Determine whether date values need conversion from PHP dates to Excel dates before writing to file, based on the data type (float or integer) -- Bugfix: (MBaker) Fixes to DATE function when it is given negative input parameters -- Bugfix: (MB) Work item 6347 - PHPExcel handles empty cells other than Excel -- Bugfix: (MB) Work item 6348 - PHPExcel handles 0 and "" as being the same -- Bugfix: (MB) Work item 6357 - Problem Using Excel2007 Reader for Spreadsheets containing images -- Bugfix: (MB) Work item 6359 - ShowGridLines ignored when reading/writing Excel 2007 -- Bugfix: (MB) Work item 6426 - Bug With Word Wrap in Excel 2007 Reader - - -2008/04/28 (v1.6.1): -- General: (MB) Work item 5532 - Fix documentation printing -- General: (MB) Work item 5586 - Memory usage improvements -- General: (MB) Applied patch 990 -- General: (MB) Applied patch 991 -- Feature: (BM) Work item 2841 - Implement PHPExcel_Reader_Excel5 -- Feature: (MB) Work item 5564 - Implement "toArray" and "fromArray" method -- Feature: (MB) Work item 5665 - Read shared formula -- Feature: (MB) Work item 5681 - Read image twoCellAnchor -- Feature: (MB) Work item 4446 - &G Image as bg for headerfooter -- Feature: (MB) Work item 5834 - Implement page layout functionality for Excel5 format -- Feature: (MB) Work item 6039 - Feature request: PHPExcel_Writer_PDF -- Bugfix: (MB) Work item 5517 - DefinedNames null check -- Bugfix: (MB) Work item 5463 - Hyperlinks should not always have trailing slash -- Bugfix: (MB) Work item 5592 - Saving Error - Uncaught exception (#REF! named range) -- Bugfix: (MB) Work item 5634 - Error when creating Zip file on Linux System (Not Windows) -- Bugfix: (MB) Work item 5876 - Time incorrecly formated -- Bugfix: (MB) Work item 5914 - Conditional formatting - second rule not applied -- Bugfix: (MB) Work item 5978 - PHPExcel_Reader_Excel2007 cannot load PHPExcel_Shared_File -- Bugfix: (MB) Work item 6020 - Output redirection to web browser - - -2008/02/14 (v1.6.0): -- General: (MB) Work item 3156 - Use PHPExcel datatypes in formula calculation -- Feature: (MB) Work item 5019 - Center on page when printing -- Feature: (MB) Work item 5099 - Hyperlink to other spreadsheet -- Feature: (MB) Work item 5104 - Set the print area of a worksheet -- Feature: (MB) Work item 5118 - Read "definedNames" property of worksheet -- Feature: (MB) Work item 5338 - Set default style for all cells -- Feature: (MB) Work item 4216 - Named Ranges -- Feature: (MB) Work item 5398 - Implement worksheet references (Sheet1!A1) -- Bugfix: (MB) Work item 4967 - Redirect output to a client's web browser -- Bugfix: (MB) Work item 5008 - "File Error: data may have been lost." seen in Excel 2007 and Excel 2003 SP3 when opening XLS file -- Bugfix: (MB) Work item 5165 - Bug in style's getHashCode() -- Bugfix: (MB) Work item 5165 - PHPExcel_Reader not correctly reading numeric values -- Bugfix: (MB) Work item 5324 - Text rotation is read incorrectly -- Bugfix: (MB) Work item 5326 - Enclosure " and data " result a bad data : \" instead of "" -- Bugfix: (MB) Work item 5332 - Formula parser - IF statement returning array instead of scalar -- Bugfix: (MB) Work item 5351 - setFitToWidth(nbpage) & setFitToWidth(nbpage) work partially -- Bugfix: (MB) Work item 5361 - Worksheet::setTitle() causes unwanted renaming -- Bugfix: (MB) Work item 5407 - Hyperlinks not working. Results in broken xlsx file. - - -2007/12/24 (v1.5.5): -- General: (MB) Work item 4135 - Grouping Rows -- General: (MB) Work item 4427 - Semi-nightly builds -- Feature: (MB) Work item 3155 - Implement "date" datatype -- Feature: (MB) Work item 4150 - Date format not honored in CSV writer -- Feature: (MB) Work item 4199 - RichText and sharedStrings -- Feature: (MB) Work item 2346 - Implement more Excel calculation functions - - Addition of DATE, DATEDIF, DATEVALUE, DAY, DAYS360 -- Feature: (MBaker) Work item 2346 - Implement more Excel calculation functions - - Addition of AVEDEV, HARMEAN and GEOMEAN - - Addition of the BINOMDIST (Non-cumulative only), COUNTBLANK, EXPONDIST, FISHER, FISHERINV, NORMDIST, NORMSDIST, PERMUT, POISSON (Non-cumulative only) and STANDARDIZE Statistical Functions - - Addition of the CEILING, COMBIN, EVEN, FACT, FACTDOUBLE, FLOOR, MULTINOMIAL, ODD, ROUNDDOWN, ROUNDUP, SIGN, SQRTPI and SUMSQ Mathematical Functions - - Addition of the NORMINV, NORMSINV, CONFIDENCE and SKEW Statistical Functions - - Addition of the CRITBINOM, HYPGEOMDIST, KURT, LOGINV, LOGNORMDIST, NEGBINOMDIST and WEIBULL Statistical Functions - - Addition of the LARGE, PERCENTILE, QUARTILE, SMALL and TRIMMEAN Statistical Functions - - Addition of the BIN2HEX, BIN2OCT, DELTA, ERF, ERFC, GESTEP, HEX2BIN, HEX2DEC, HEX2OCT, OCT2BIN and OCT2HEX Engineering Functions - - Addition of the CHIDIST, GAMMADIST and GAMMALN Statistical Functions - - Addition of the GCD, LCM, MROUND and SUBTOTAL Mathematical Functions - - Addition of the LOWER, PROPER and UPPER Text Functions - - Addition of the BETADIST and BETAINV Statistical Functions - - Addition of the CHIINV and GAMMAINV Statistical Functions - - Addition of the SERIESSUM Mathematical Function - - Addition of the CHAR, CODE, FIND, LEN, REPT, SEARCH, T, TRIM Text Functions - - Addition of the FALSE and TRUE Boolean Functions - - Addition of the TDIST and TINV Statistical Functions - - Addition of the EDATE, EOMONTH, YEAR, MONTH, TIME, TIMEVALUE, HOUR, MINUTE, SECOND, WEEKDAY, WEEKNUM, NOW, TODAY and Date/Time Function - - Addition of the BESSELI, BESSELJ, BESSELK and BESSELY Engineering Functions - - Addition of the SLN and SYD Financial Functions - - reworked MODE calculation to handle floating point numbers - - Improved error trapping for invalid input values - - Fix to SMALL, LARGE, PERCENTILE and TRIMMEAN to eliminate non-numeric values - - Added CDF to BINOMDIST and POISSON - - Fix to a potential endless loop in CRITBINOM, together with other bugfixes to the algorithm - - Fix to SQRTPI so that it will work with a real value parameter rather than just integers - - Trap for passing negative values to FACT - - Improved accuracy of the NORMDIST cumulative function, and of the ERF and ERFC functions - - Replicated Excel data-type and error handling for BIN, DEC, OCT and HEX conversion functions - - Replicated Excel data-type and error handling for AND and OR Boolean functions - - Bugfix to MROUND - - Rework of the DATE, DATEVALUE, DAY, DAYS360 and DATEDIF date/Time functions to use Excel dates rather than straight PHP dates - - Rework of the AND, OR Boolean functions to ignore string values - - Rework of the BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT Engineering functions to handle two's complement - - Excel, Gnumeric and OpenOffice Calc compatibility flag for functions - Note, not all functions have yet been written to work with the Gnumeric and OpenOffice Calc compatibility flags - - 1900 or 1904 Calendar flag for date functions - - Reworked ExcelToPHP date method to handle the Excel 1900 leap year - Note that this will not correctly return values prior to 13-Dec-1901 20:45:52 as this is the minimum value that PHP date serial values can handle. If you need to work with dates prior to this, then an ExcelToPHPObject method has been added which will work correctly with values between Excel's 1900 calendar base date of 1-Jan-1900, and 13-Dec-1901 - - Addition of ExcelToPHPObject date method to return a PHP DateTime object from an Excel date serial value - - PHPToExcel method modified to accept either PHP date serial numbers or PHP DateTime objects - - Addition of FormattedPHPToExcel which will accept a date and time broken to into year, month, day, hour, minute, second and return an Excel date serial value -- Feature: (MB) Work item 4485 - Control characters in Excel 2007 -- Feature: (MB) Work item 4796 - BaseDrawing::setWidthAndHeight method request -- Feature: (MB) Work item 4798 - Page Setup -> Print Titles -> Sheet -> 'Rows to repeat at top' -- Feature: (MB) Work item 4433 - Comment functionality -- Bugfix: (MB) Work item 4124 - Undefined variable in PHPExcel_Writer_Serialized -- Bugfix: (MB) Work item 4125 - Notice: Object of class PHPExcel_RichText could not be converted to int -- Bugfix: (MB) Work item 4126 - Excel5Writer: utf8 string not converted to utf16 -- Bugfix: (MB) Work item 4180 - PHPExcel_RichText and autosize -- Bugfix: (MB) Work item 4574 - Excel5Writer produces broken xls files after change mentioned in work item 4126 -- Bugfix: (MB) Work item 4797 - Small bug in PHPExcel_Reader_Excel2007 function _readStyle - - -2007/10/23 (v 1.5.0): -- General: (MB) Work item 3265 - Refactor PHPExcel Drawing -- Feature: (CS) Work item 3079 - Update Shared/OLE.php to latest version from PEAR -- Feature: (MB) Work item 3217 - Excel2007 vs Excel2003 compatibility pack -- Feature: (MB) Work item 3234 - Cell protection (lock/unlock) -- Feature: (MB) Work item 3543 - Create clickable links (hyperlinks) -- Feature: (MB) Work item 3241 - Additional page setup parameters -- Feature: (MB) Work item 3300 - Make temporary file path configurable (Excel5) -- Feature: (MB) Work item 3306 - Small addition to applyFromArray for font -- Feature: (MB) Work item 3373 - Better feedback when save of file is not possible -- Bugfix: (MB) Work item 3181 - Text Rotation -- Bugfix: (MB) Work item 3237 - Small bug in Page Orientation -- Bugfix: (MB) Work item 3812 - insertNewColumnBeforeByColumn undefined -- Bugfix: (MB) Work item 3893 - Sheet references not working in formula (Excel5 Writer) - - -2007/08/23 (v 1.4.5): -- General: (MB) Work item 3003 - Class file endings -- General: (MB) Work item 3081 - Different calculation engine improvements -- General: (MB) Work item 3082 - Different improvements in PHPExcel_Reader_Excel2007 -- General: (MB) Work item 3146 - Set XML indentation in PHPExcel_Writer_Excel2007 -- Feature: (MB) Work item 3159 - Optionally store temporary Excel2007 writer data in file instead of memory -- Feature: (MB) Work item 3063 - Implement show/hide gridlines -- Feature: (MB) Work item 3064 - Implement option to read only data -- Feature: (MB) Work item 3080 - Optionally disable formula precalculation -- Feature: (MB) Work item 3154 - Explicitly set cell datatype -- Feature: (MBaker) Work item 2346 - Implement more Excel calculation functions - - Addition of MINA, MAXA, COUNTA, AVERAGEA, MEDIAN, MODE, DEVSQ, STDEV, STDEVA, STDEVP, STDEVPA, VAR, VARA, VARP and VARPA Excel Functions - - Fix to SUM, PRODUCT, QUOTIENT, MIN, MAX, COUNT and AVERAGE functions when cell contains a numeric value in a string datatype, bringing it in line with MS Excel behaviour -- Bugfix: (MB) Work item 2881 - File_exists on ZIP fails on some installations -- Bugfix: (MB) Work item 2879 - Argument in textRotation should be -90..90 -- Bugfix: (MB) Work item 2883 - Excel2007 reader/writer not implementing OpenXML/SpreadsheetML styles 100% correct -- Bugfix: (MB) Work item 2513 - Active sheet index not read/saved -- Bugfix: (MB) Work item 2935 - Print and print preview of generated XLSX causes Excel2007 to crash -- Bugfix: (MB) Work item 2952 - Error in Calculations - COUNT() function -- Bugfix: (MB) Work item 3002 - HTML and CSV writer not writing last row -- Bugfix: (MB) Work item 3017 - Memory leak in Excel5 writer -- Bugfix: (MB) Work item 3044 - Printing (PHPExcel_Writer_Excel5) -- Bugfix: (MB) Work item 3046 - Problems reading zip:// -- Bugfix: (MB) Work item 3047 - Error reading conditional formatting -- Bugfix: (MB) Work item 3067 - Bug in Excel5 writer (storePanes) -- Bugfix: (MB) Work item 3077 - Memory leak in PHPExcel_Style_Color - - -2007/07/23 (v 1.4.0): -- General: (MB) Work item 2687 - Coding convention / code cleanup -- General: (MB) Work item 2717 - Use set_include_path in tests -- General: (MB) Work item 2812 - Move PHPExcel_Writer_Excel5 OLE to PHPExcel_Shared_OLE -- Feature: (MB) Work item 2679 - Hide/Unhide Column or Row -- Feature: (MB) Work item 2271 - Implement multi-cell styling -- Feature: (MB) Work item 2720 - Implement CSV file format (reader/writer) -- Feature: (MB) Work item 2845 - Implement HTML file format -- Bugfix: (MB) Work item 2513 - Active sheet index not read/saved -- Bugfix: (MB) Work item 2678 - Freeze Panes with PHPExcel_Writer_Excel5 -- Bugfix: (MB) Work item 2680 - OLE.php -- Bugfix: (MB) Work item 2736 - Copy and pasting multiple drop-down list cells breaks reader -- Bugfix: (MB) Work item 2775 - Function setAutoFilterByColumnAndRow takes wrong arguments -- Bugfix: (MB) Work item 2858 - Simplexml_load_file fails on ZipArchive - - -2007/06/27 (v 1.3.5): -- General: (MB) Work item 15 - Documentation -- Feature: (JV) PHPExcel_Writer_Excel5 -- Feature: (JV) PHPExcel_Reader_Excel2007: Image shadows -- Feature: (MB) Work item 2385 - Data validation -- Feature: (MB) Work item 187 - Implement richtext strings -- Bugfix: (MB) Work item 2443 - Empty relations when adding image to any sheet but the first one -- Bugfix: (MB) Work item 2536 - Excel2007 crashes on print preview - - -2007/06/05 (v 1.3.0): -- General: (MB) Work item 1942 - Create PEAR package -- General: (MB) Work item 2331 - Replace *->duplicate() by __clone() -- Feature: (JV) PHPExcel_Reader_Excel2007: Column auto-size, Protection, Merged cells, Wrap text, Page breaks, Auto filter, Images -- Feature: (MB) Work item 245 - Implement "freezing" panes -- Feature: (MB) Work item 2273 - Cell addressing alternative -- Feature: (MB) Work item 2270 - Implement cell word-wrap attribute -- Feature: (MB) Work item 2282 - Auto-size column -- Feature: (MB) Work item 241 - Implement formula calculation -- Feature: (MB) Work item 2375 - Insert/remove row/column -- Bugfix: (MB) Work item 1931 - PHPExcel_Worksheet::getCell() should not accept absolute coordinates -- Bugfix: (MB) Work item 2272 - Cell reference without row number -- Bugfix: (MB) Work item 2276 - Styles with same coordinate but different worksheet -- Bugfix: (MB) Work item 2290 - PHPExcel_Worksheet->getCellCollection() usort error -- Bugfix: (SS) Work item 2353 - Bug in PHPExcel_Cell::stringFromColumnIndex -- Bugfix: (JV) Work item 2353 - Reader: numFmts can be missing, use cellStyleXfs instead of cellXfs in styles - - -2007/04/26 (v 1.2.0): -- General: (MB) Stringtable attribute "count" not necessary, provides wrong info to Excel sometimes... -- General: (MB) Updated tests to address more document properties -- General: (MB) Some refactoring in PHPExcel_Writer_Excel2007_Workbook -- General: (MB) New package: PHPExcel_Shared -- General: (MB) Password hashing algorithm implemented in PHPExcel_Shared_PasswordHasher -- General: (MB) Moved pixel conversion functions to PHPExcel_Shared_Drawing -- General: (MB) Work item 244 - Switch over to LGPL license -- General: (MB) Work item 5 - Include PHPExcel version in file headers -- Feature: (MB) Work item 6 - Autofilter -- Feature: (MB) Work item 7 - Extra document property: keywords -- Feature: (MB) Work item 8 - Extra document property: category -- Feature: (MB) Work item 9 - Document security -- Feature: (MB) Work item 10 - PHPExcel_Writer_Serialized and PHPExcel_Reader_Serialized -- Feature: (MB) Work item 11 - Alternative syntax: Addressing a cell -- Feature: (MB) Work item 12 - Merge cells -- Feature: (MB) Work item 13 - Protect ranges of cells with a password -- Bugfix: (JV) Work item 14 - (style/fill/patternFill/fgColor or bgColor can be empty) - - -2007/03/26 (v 1.1.1): -- Bugfix: (MB) Work item 1250 - Syntax error in "Classes/PHPExcel/Writer/Excel2007.php" on line 243 -- General: (MB) Work item 1282 - Reader should check if file exists and throws an exception when it doesn't - - -2007/03/22 (v 1.1.0): -- Changed filenames of tests -- Bugfix: (MB) Work item 836 - Style information lost after passing trough Excel2007_Reader -- Bugfix: (MB) Work item 913 - Number of columns > AZ fails fixed in PHPExcel_Cell::columnIndexFromString -- General: (MB) Added a brief file with installation instructions -- Feature: (MB) Page breaks (horizontal and vertical) -- Feature: (MB) Image shadows - - - -2007/02/22 (v 1.0.0): -- Changelog now includes developer initials -- Bugfix: (JV) PHPExcel->removeSheetByIndex now re-orders sheets after deletion, so no array indexes are lost -- Bugfix: (JV) PHPExcel_Writer_Excel2007_Worksheet::_writeCols() used direct assignment to $pSheet->getColumnDimension('A')->Width instead of $pSheet->getColumnDimension('A')->setWidth() -- Bugfix: (JV) DocumentProperties used $this->LastModifiedBy instead of $this->_lastModifiedBy. -- Bugfix: (JV) Only first = should be removed when writing formula in PHPExcel_Writer_Excel2007_Worksheet. -- General: (JV) Consistency of method names to camelCase -- General: (JV) Updated tests to match consistency changes -- General: (JV) Detection of mime-types now with image_type_to_mime_type() -- General: (JV) Constants now hold string value used in Excel 2007 -- General: (MB) Fixed folder name case (WorkSheet -> Worksheet) -- Feature: (MB) PHPExcel classes (not the Writer classes) can be duplicated, using a duplicate() method. -- Feature: (MB) Cell styles can now be duplicated to a range of cells using PHPExcel_Worksheet->duplicateStyle() -- Feature: (MB) Conditional formatting -- Feature: (JV) Reader for Excel 2007 (not supporting full specification yet!) - - - -2007/01/31 (v 1.0.0 RC): -- Project name has been changed to PHPExcel -- Project homepage is now http://www.codeplex.com/PHPExcel -- Started versioning at number: PHPExcel 1.0.0 RC - - - -2007/01/22: -- Fixed some performance issues on large-scale worksheets (mainly loops vs. indexed arrays) -- Performance on creating StringTable has been increased -- Performance on writing Excel2007 worksheet has been increased - - - -2007/01/18: -- Images can now be rotated -- Fixed bug: When drawings have full path specified, no mime type can be deducted -- Fixed bug: Only one drawing can be added to a worksheet - - - -2007/01/12: -- Refactoring of some classes to use ArrayObject instead of array() -- Cell style now has support for number format (i.e. #,##0) -- Implemented embedding images - - - -2007/01/02: -- Cell style now has support for fills, including gradient fills -- Cell style now has support for fonts -- Cell style now has support for border colors -- Cell style now has support for font colors -- Cell style now has support for alignment - - - -2006/12/21: -- Support for cell style borders -- Support for cell styles -- Refactoring of Excel2007 Writer into multiple classes in package SpreadSheet_Writer_Excel2007 -- Refactoring of all classes, changed public members to public properties using getter/setter -- Worksheet names are now unique. On duplicate worksheet names, a number is appended. -- Worksheet now has parent SpreadSheet object -- Worksheet now has support for page header and footer -- Worksheet now has support for page margins -- Worksheet now has support for page setup (only Paper size and Orientation) -- Worksheet properties now accessible by using getProperties() -- Worksheet now has support for row and column dimensions (height / width) -- Exceptions thrown have a more clear description - - - -Initial version: -- Create a Spreadsheet object -- Add one or more Worksheet objects -- Add cells to Worksheet objects -- Export Spreadsheet object to Excel 2007 OpenXML format -- Each cell supports the following data formats: string, number, formula, boolean. \ No newline at end of file diff --git a/third_party/codeplex-phpexcel-1.7.6/install.txt b/third_party/codeplex-phpexcel-1.7.6/install.txt deleted file mode 100644 index 641a976b53..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/install.txt +++ /dev/null @@ -1,75 +0,0 @@ -************************************************************************************** -* PHPExcel -* -* Copyright (c) 2006 - 2011 PHPExcel -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel) -* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL -* @version 1.7.6, 2011-02-27 -************************************************************************************** - -Requirements ------------- - -The following requirements should be met prior to using PHPExcel: -* PHP version 5.2.0 or higher -* PHP extension php_zip enabled *) -* PHP extension php_xml enabled -* PHP extension php_gd2 enabled (if not compiled in) - -*) php_zip is only needed by PHPExcel_Reader_Excel2007, PHPExcel_Writer_Excel2007, - PHPExcel_Reader_OOCalc. In other words, if you need PHPExcel to handle .xlsx or .ods - files you will need the zip extension, but otherwise not. - - - -Installation instructions -------------------------- - -Installation is quite easy: copy the contents of the Classes folder to any location -in your application required. - -Example: - -If your web root folder is /var/www/ you may want to create a subfolder called -/var/www/Classes/ and copy the files into that folder so you end up with files: - -/var/www/Classes/PHPExcel.php -/var/www/Classes/PHPExcel/Calculation.php -/var/www/Classes/PHPExcel/Cell.php -... - - - -Getting started ---------------- - -A good way to get started is to run some of the tests included in the download. -Copy the "Tests" folder next to your "Classes" folder from above so you end up with: - -/var/www/Tests/01simple.php -/var/www/Tests/02types.php -... - -Start running the test by pointing your browser to the test scripts: - -http://example.com/Tests/01simple.php -http://example.com/Tests/02types.php -... - -Note: It may be necessary to modify the include/require statements at the beginning of -each of the test scripts if your "Classes" folder from above is named differently. diff --git a/third_party/codeplex-phpexcel-1.7.6/license.txt b/third_party/codeplex-phpexcel-1.7.6/license.txt deleted file mode 100644 index 01b2d3154a..0000000000 --- a/third_party/codeplex-phpexcel-1.7.6/license.txt +++ /dev/null @@ -1,344 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/third_party/codeplex/PHPExcel/Calculation/Engineering.php b/third_party/codeplex/PHPExcel/Calculation/Engineering.php index 75e278474f..4e8d53064a 100644 --- a/third_party/codeplex/PHPExcel/Calculation/Engineering.php +++ b/third_party/codeplex/PHPExcel/Calculation/Engineering.php @@ -768,7 +768,7 @@ public static function parseComplex($complexNumber) // Split the input into its Real and Imaginary components $leadingSign = 0; if (strlen($workString) > 0) { - $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0; + $leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0; } $power = ''; $realNumber = strtok($workString, '+-'); @@ -809,16 +809,16 @@ public static function parseComplex($complexNumber) */ private static function cleanComplex($complexNumber) { - if ($complexNumber{0} == '+') { + if ($complexNumber[0] == '+') { $complexNumber = substr($complexNumber, 1); } - if ($complexNumber{0} == '0') { + if ($complexNumber[0] == '0') { $complexNumber = substr($complexNumber, 1); } - if ($complexNumber{0} == '.') { + if ($complexNumber[0] == '.') { $complexNumber = '0'.$complexNumber; } - if ($complexNumber{0} == '+') { + if ($complexNumber[0] == '+') { $complexNumber = substr($complexNumber, 1); } return $complexNumber; diff --git a/third_party/codeplex/PHPExcel/Calculation/FormulaParser.php b/third_party/codeplex/PHPExcel/Calculation/FormulaParser.php index 893f19e94c..03340e6998 100644 --- a/third_party/codeplex/PHPExcel/Calculation/FormulaParser.php +++ b/third_party/codeplex/PHPExcel/Calculation/FormulaParser.php @@ -159,7 +159,7 @@ private function parseToTokens() // Check if the formula has a valid starting = $formulaLength = strlen($this->formula); - if ($formulaLength < 2 || $this->formula{0} != '=') { + if ($formulaLength < 2 || $this->formula[0] != '=') { return; } diff --git a/third_party/codeplex/PHPExcel/Calculation/Functions.php b/third_party/codeplex/PHPExcel/Calculation/Functions.php index 5a1e5ee5ad..773ce1ad09 100644 --- a/third_party/codeplex/PHPExcel/Calculation/Functions.php +++ b/third_party/codeplex/PHPExcel/Calculation/Functions.php @@ -318,10 +318,10 @@ public static function isCellValue($idx) public static function ifCondition($condition) { $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition); - if (!isset($condition{0})) { + if (!isset($condition[0])) { $condition = '=""'; } - if (!in_array($condition{0}, array('>', '<', '='))) { + if (!in_array($condition[0], array('>', '<', '='))) { if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::wrapResult(strtoupper($condition)); } @@ -559,7 +559,7 @@ public static function N($value = null) return (integer) $value; case 'string': // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { + if ((strlen($value) > 0) && ($value[0] == '#')) { return $value; } break; @@ -609,7 +609,7 @@ public static function TYPE($value = null) return 64; } elseif (is_string($value)) { // Errors - if ((strlen($value) > 0) && ($value{0} == '#')) { + if ((strlen($value) > 0) && ($value[0] == '#')) { return 16; } return 2; diff --git a/third_party/codeplex/PHPExcel/Calculation/TextData.php b/third_party/codeplex/PHPExcel/Calculation/TextData.php index 6461d06016..b5eeec7f27 100644 --- a/third_party/codeplex/PHPExcel/Calculation/TextData.php +++ b/third_party/codeplex/PHPExcel/Calculation/TextData.php @@ -40,19 +40,19 @@ class PHPExcel_Calculation_TextData private static function unicodeToOrd($c) { - if (ord($c{0}) >=0 && ord($c{0}) <= 127) { - return ord($c{0}); - } elseif (ord($c{0}) >= 192 && ord($c{0}) <= 223) { - return (ord($c{0})-192)*64 + (ord($c{1})-128); - } elseif (ord($c{0}) >= 224 && ord($c{0}) <= 239) { - return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128); - } elseif (ord($c{0}) >= 240 && ord($c{0}) <= 247) { - return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128); - } elseif (ord($c{0}) >= 248 && ord($c{0}) <= 251) { - return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128); - } elseif (ord($c{0}) >= 252 && ord($c{0}) <= 253) { - return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128); - } elseif (ord($c{0}) >= 254 && ord($c{0}) <= 255) { + if (ord($c[0]) >=0 && ord($c[0]) <= 127) { + return ord($c[0]); + } elseif (ord($c[0]) >= 192 && ord($c[0]) <= 223) { + return (ord($c[0])-192)*64 + (ord($c[1])-128); + } elseif (ord($c[0]) >= 224 && ord($c[0]) <= 239) { + return (ord($c[0])-224)*4096 + (ord($c[1])-128)*64 + (ord($c[2])-128); + } elseif (ord($c[0]) >= 240 && ord($c[0]) <= 247) { + return (ord($c[0])-240)*262144 + (ord($c[1])-128)*4096 + (ord($c[2])-128)*64 + (ord($c[3])-128); + } elseif (ord($c[0]) >= 248 && ord($c[0]) <= 251) { + return (ord($c[0])-248)*16777216 + (ord($c[1])-128)*262144 + (ord($c[2])-128)*4096 + (ord($c[3])-128)*64 + (ord($c[4])-128); + } elseif (ord($c[0]) >= 252 && ord($c[0]) <= 253) { + return (ord($c[0])-252)*1073741824 + (ord($c[1])-128)*16777216 + (ord($c[2])-128)*262144 + (ord($c[3])-128)*4096 + (ord($c[4])-128)*64 + (ord($c[5])-128); + } elseif (ord($c[0]) >= 254 && ord($c[0]) <= 255) { // error return PHPExcel_Calculation_Functions::VALUE(); } diff --git a/third_party/codeplex/PHPExcel/Cell.php b/third_party/codeplex/PHPExcel/Cell.php index c99a3c8b18..4b1437f55c 100644 --- a/third_party/codeplex/PHPExcel/Cell.php +++ b/third_party/codeplex/PHPExcel/Cell.php @@ -809,19 +809,19 @@ public static function columnIndexFromString($pString = 'A') // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString // for improved performance - if (isset($pString{0})) { - if (!isset($pString{1})) { + if (isset($pString[0])) { + if (!isset($pString[1])) { $_indexCache[$pString] = $_columnLookup[$pString]; return $_indexCache[$pString]; - } elseif (!isset($pString{2})) { - $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}]; + } elseif (!isset($pString[2])) { + $_indexCache[$pString] = $_columnLookup[$pString[0]] * 26 + $_columnLookup[$pString[1]]; return $_indexCache[$pString]; - } elseif (!isset($pString{3})) { - $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}]; + } elseif (!isset($pString[3])) { + $_indexCache[$pString] = $_columnLookup[$pString[0]] * 676 + $_columnLookup[$pString[1]] * 26 + $_columnLookup[$pString[2]]; return $_indexCache[$pString]; } } - throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty")); + throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString[0])) ? "longer than 3 characters" : "empty")); } /** diff --git a/third_party/codeplex/PHPExcel/Cell/DefaultValueBinder.php b/third_party/codeplex/PHPExcel/Cell/DefaultValueBinder.php index dc19e6c453..d1501b8c25 100644 --- a/third_party/codeplex/PHPExcel/Cell/DefaultValueBinder.php +++ b/third_party/codeplex/PHPExcel/Cell/DefaultValueBinder.php @@ -79,7 +79,7 @@ public static function dataTypeForValue($pValue = null) return PHPExcel_Cell_DataType::TYPE_STRING; } elseif ($pValue instanceof PHPExcel_RichText) { return PHPExcel_Cell_DataType::TYPE_INLINE; - } elseif ($pValue{0} === '=' && strlen($pValue) > 1) { + } elseif ($pValue[0] === '=' && strlen($pValue) > 1) { return PHPExcel_Cell_DataType::TYPE_FORMULA; } elseif (is_bool($pValue)) { return PHPExcel_Cell_DataType::TYPE_BOOL; @@ -87,7 +87,7 @@ public static function dataTypeForValue($pValue = null) return PHPExcel_Cell_DataType::TYPE_NUMERIC; } elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) { $tValue = ltrim($pValue, '+-'); - if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') { + if (is_string($pValue) && $tValue[0] === '0' && strlen($tValue) > 1 && $tValue[1] !== '.') { return PHPExcel_Cell_DataType::TYPE_STRING; } elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) { return PHPExcel_Cell_DataType::TYPE_STRING; diff --git a/third_party/codeplex/PHPExcel/Reader/Excel2003XML.php b/third_party/codeplex/PHPExcel/Reader/Excel2003XML.php index c007f9bbca..3e21c9d914 100644 --- a/third_party/codeplex/PHPExcel/Reader/Excel2003XML.php +++ b/third_party/codeplex/PHPExcel/Reader/Excel2003XML.php @@ -689,7 +689,7 @@ public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) $rowReference = $rowID; } // Bracketed R references are relative to the current row - if ($rowReference{0} == '[') { + if ($rowReference[0] == '[') { $rowReference = $rowID + trim($rowReference, '[]'); } $columnReference = $cellReference[4][0]; @@ -698,7 +698,7 @@ public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel) $columnReference = $columnNumber; } // Bracketed C references are relative to the current column - if ($columnReference{0} == '[') { + if ($columnReference[0] == '[') { $columnReference = $columnNumber + trim($columnReference, '[]'); } $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference; diff --git a/third_party/codeplex/PHPExcel/Reader/Excel5.php b/third_party/codeplex/PHPExcel/Reader/Excel5.php index 62e971d2e6..74fd189cf1 100644 --- a/third_party/codeplex/PHPExcel/Reader/Excel5.php +++ b/third_party/codeplex/PHPExcel/Reader/Excel5.php @@ -1925,7 +1925,7 @@ private function readDateMode() // offset: 0; size: 2; 0 = base 1900, 1 = base 1904 PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900); - if (ord($recordData{0}) == 1) { + if (ord($recordData[0]) == 1) { PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904); } } @@ -2399,7 +2399,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2414,7 +2414,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2429,7 +2429,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2444,7 +2444,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2459,7 +2459,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2474,7 +2474,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2489,7 +2489,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2504,7 +2504,7 @@ private function readXfExt() $xclrValue = substr($extData, 4, 4); // color value (value based on color type) if ($xclfType == 2) { - $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); + $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2])); // modify the relevant style property if (isset($this->mapCellXfIndex[$ixfe])) { @@ -2546,7 +2546,7 @@ private function readStyle() if ($isBuiltIn) { // offset: 2; size: 1; identifier for built-in style - $builtInId = ord($recordData{2}); + $builtInId = ord($recordData[2]); switch ($builtInId) { case 0x00: @@ -3883,7 +3883,7 @@ private function readFormula() // We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true // the formula data may be ordinary formula data, therefore we need to check // explicitly for the tExp token (0x01) - $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01; + $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure[2]) == 0x01; if ($isPartOfSharedFormula) { // part of shared formula which means there will be a formula with a tExp token and nothing else @@ -4447,7 +4447,7 @@ private function readSelection() if (!$this->readDataOnly) { // offset: 0; size: 1; pane identifier - $paneId = ord($recordData{0}); + $paneId = ord($recordData[0]); // offset: 1; size: 2; index to row of the active cell $r = self::getInt2d($recordData, 1); @@ -4467,17 +4467,17 @@ private function readSelection() // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!) if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) { - $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells); + $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '$[1]1048576', $selectedCells); } // first row '1' + last row '65536' indicates that full column is selected if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) { - $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells); + $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '$[1]1048576', $selectedCells); } // first column 'A' + last column 'IV' indicates that full row is selected if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) { - $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells); + $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '$[1]XFD$[2]', $selectedCells); } $this->phpSheet->setSelectedCells($selectedCells); @@ -7294,13 +7294,13 @@ private static function readBIFF8Constant($valueData) private static function readRGB($rgb) { // offset: 0; size 1; Red component - $r = ord($rgb{0}); + $r = ord($rgb[0]); // offset: 1; size: 1; Green component - $g = ord($rgb{1}); + $g = ord($rgb[1]); // offset: 2; size: 1; Blue component - $b = ord($rgb{2}); + $b = ord($rgb[2]); // HEX notation, e.g. 'FF00FC' $rgb = sprintf('%02X%02X%02X', $r, $g, $b); diff --git a/third_party/codeplex/PHPExcel/Shared/OLE.php b/third_party/codeplex/PHPExcel/Shared/OLE.php index 42a3c529f1..558513e88e 100644 --- a/third_party/codeplex/PHPExcel/Shared/OLE.php +++ b/third_party/codeplex/PHPExcel/Shared/OLE.php @@ -443,7 +443,7 @@ public static function Asc2Ucs($ascii) { $rawname = ''; for ($i = 0; $i < strlen($ascii); ++$i) { - $rawname .= $ascii{$i} . "\x00"; + $rawname .= $ascii[$i] . "\x00"; } return $rawname; } diff --git a/third_party/codeplex/PHPExcel/Worksheet/AutoFilter.php b/third_party/codeplex/PHPExcel/Worksheet/AutoFilter.php index 6ec8a44667..1bc312bda5 100644 --- a/third_party/codeplex/PHPExcel/Worksheet/AutoFilter.php +++ b/third_party/codeplex/PHPExcel/Worksheet/AutoFilter.php @@ -717,7 +717,7 @@ public function showHideRows() ); } else { // Date based - if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') { + if ($dynamicRuleType[0] == 'M' || $dynamicRuleType[0] == 'Q') { // Month or Quarter sscanf($dynamicRuleType, '%[A-Z]%d', $periodType, $period); if ($periodType == 'M') { diff --git a/third_party/codeplex/PHPExcel/Writer/Excel5/Parser.php b/third_party/codeplex/PHPExcel/Writer/Excel5/Parser.php index 0cf1c1d65b..0adb20c0e7 100644 --- a/third_party/codeplex/PHPExcel/Writer/Excel5/Parser.php +++ b/third_party/codeplex/PHPExcel/Writer/Excel5/Parser.php @@ -1020,7 +1020,7 @@ private function cellToRowcol($cell) $col = 0; $col_ref_length = strlen($col_ref); for ($i = 0; $i < $col_ref_length; ++$i) { - $col += (ord($col_ref{$i}) - 64) * pow(26, $expn); + $col += (ord($col_ref[$i]) - 64) * pow(26, $expn); --$expn; } @@ -1042,36 +1042,33 @@ private function advance() $formula_length = strlen($this->formula); // eat up white spaces if ($i < $formula_length) { - while ($this->formula{$i} == " ") { + while ($this->formula[$i] == " ") { ++$i; } if ($i < ($formula_length - 1)) { - $this->lookAhead = $this->formula{$i+1}; + $this->lookAhead = $this->formula[$i+1]; } $token = ''; } while ($i < $formula_length) { - $token .= $this->formula{$i}; + $token .= $this->formula[$i]; if ($i < ($formula_length - 1)) { - $this->lookAhead = $this->formula{$i+1}; + $this->lookAhead = $this->formula[$i+1]; } else { $this->lookAhead = ''; } if ($this->match($token) != '') { - //if ($i < strlen($this->formula) - 1) { - // $this->lookAhead = $this->formula{$i+1}; - //} $this->currentCharacter = $i + 1; $this->currentToken = $token; return 1; } if ($i < ($formula_length - 2)) { - $this->lookAhead = $this->formula{$i+2}; + $this->lookAhead = $this->formula[$i+2]; } else { // if we run out of characters lookAhead becomes empty $this->lookAhead = ''; } @@ -1172,7 +1169,7 @@ public function parse($formula) { $this->currentCharacter = 0; $this->formula = $formula; - $this->lookAhead = isset($formula{1}) ? $formula{1} : ''; + $this->lookAhead = isset($formula[1]) ? $formula[1] : ''; $this->advance(); $this->parseTree = $this->condition(); return true; diff --git a/third_party/codeplex/PHPExcel/Writer/Excel5/Workbook.php b/third_party/codeplex/PHPExcel/Writer/Excel5/Workbook.php index 8b0684375d..5a0cca5153 100644 --- a/third_party/codeplex/PHPExcel/Writer/Excel5/Workbook.php +++ b/third_party/codeplex/PHPExcel/Writer/Excel5/Workbook.php @@ -664,7 +664,7 @@ private function writeAllDefinedNamesBiff8() $formulaData = $this->parser->toReversePolish(); // make sure tRef3d is of type tRef3dR (0x3A) - if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) { + if (isset($formulaData[0]) and ($formulaData[0] == "\x7A" or $formulaData[0] == "\x5A")) { $formulaData = "\x3A" . substr($formulaData, 1); } diff --git a/third_party/codeplex/PHPExcel/Writer/Excel5/Worksheet.php b/third_party/codeplex/PHPExcel/Writer/Excel5/Worksheet.php index be965e23d9..5ff0806bce 100644 --- a/third_party/codeplex/PHPExcel/Writer/Excel5/Worksheet.php +++ b/third_party/codeplex/PHPExcel/Writer/Excel5/Worksheet.php @@ -876,7 +876,7 @@ private function writeFormula($row, $col, $formula, $xfIndex, $calculatedValue) $unknown = 0x0000; // Must be zero // Strip the '=' or '@' sign at the beginning of the formula string - if ($formula{0} == '=') { + if ($formula[0] == '=') { $formula = substr($formula, 1); } else { // Error handling diff --git a/third_party/pchart/pChart/pCache.class b/third_party/pchart/pChart/pCache.class deleted file mode 100644 index 454bbada96..0000000000 --- a/third_party/pchart/pChart/pCache.class +++ /dev/null @@ -1,119 +0,0 @@ -<?php - /* - pCache - Faster renderding using data cache - Copyright (C) 2008 Jean-Damien POGOLOTTI - Version 1.1.2 last updated on 06/17/08 - - http://pchart.sourceforge.net - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 1,2,3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - Class initialisation : - pCache($CacheFolder="Cache/") - Cache management : - IsInCache($Data) - GetFromCache($ID,$Data) - WriteToCache($ID,$Data,$Picture) - DeleteFromCache($ID,$Data) - ClearCache() - Inner functions : - GetHash($ID,$Data) - */ - - /* pCache class definition */ - class pCache - { - var $HashKey = ""; - var $CacheFolder = "Cache/"; - - /* Create the pCache object */ - function pCache($CacheFolder="Cache/") - { - $this->CacheFolder = $CacheFolder; - } - - /* This function is clearing the cache folder */ - function ClearCache() - { - if ($handle = opendir($this->CacheFolder)) - { - while (false !== ($file = readdir($handle))) - { - if ( $file != "." && $file != ".." ) - unlink($this->CacheFolder.$file); - } - closedir($handle); - } - } - - /* This function is checking if we have an offline version of this chart */ - function IsInCache($ID,$Data,$Hash="") - { - if ( $Hash == "" ) - $Hash = $this->GetHash($ID,$Data); - - if ( file_exists($this->CacheFolder.$Hash) ) - return(TRUE); - else - return(FALSE); - } - - /* This function is making a copy of drawn chart in the cache folder */ - function WriteToCache($ID,$Data,$Picture) - { - $Hash = $this->GetHash($ID,$Data); - $FileName = $this->CacheFolder.$Hash; - - imagepng($Picture->Picture,$FileName); - } - - /* This function is removing any cached copy of this chart */ - function DeleteFromCache($ID,$Data) - { - $Hash = $this->GetHash($ID,$Data); - $FileName = $this->CacheFolder.$Hash; - - if ( file_exists($FileName ) ) - unlink($FileName); - } - - /* This function is retrieving the cached picture if applicable */ - function GetFromCache($ID,$Data) - { - $Hash = $this->GetHash($ID,$Data); - if ( $this->IsInCache("","",$Hash ) ) - { - $FileName = $this->CacheFolder.$Hash; - - header('Content-type: image/png'); - @readfile($FileName); - exit(); - } - } - - /* This function is building the graph unique hash key */ - function GetHash($ID,$Data) - { - $mKey = "$ID"; - foreach($Data as $key => $Values) - { - $tKey = ""; - foreach($Values as $Serie => $Value) - $tKey = $tKey.$Serie.$Value; - $mKey = $mKey.md5($tKey); - } - return(md5($mKey)); - } - } -?> \ No newline at end of file diff --git a/third_party/pchart/pChart/pChart.class b/third_party/pchart/pChart/pChart.class deleted file mode 100644 index d81a41e433..0000000000 --- a/third_party/pchart/pChart/pChart.class +++ /dev/null @@ -1,3506 +0,0 @@ -<?php - /* - pChart - a PHP class to build charts! - Copyright (C) 2008 Jean-Damien POGOLOTTI - Version 1.27d last updated on 09/30/08 - - http://pchart.sourceforge.net - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 1,2,3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - Class initialisation : - pChart($XSize,$YSize) - Draw methods : - drawBackground($R,$G,$B) - drawRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B) - drawFilledRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B,$DrawBorder=TRUE,$Alpha=100) - drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B) - drawFilledRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B) - drawCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0) - drawFilledCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0) - drawEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B) - drawFilledEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B) - drawLine($X1,$Y1,$X2,$Y2,$R,$G,$B,$GraphFunction=FALSE) - drawDottedLine($X1,$Y1,$X2,$Y2,$DotSize,$R,$G,$B) - drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B) - drawFromPNG($FileName,$X,$Y,$Alpha=100) - drawFromGIF($FileName,$X,$Y,$Alpha=100) - drawFromJPG($FileName,$X,$Y,$Alpha=100) - Graph setup methods : - addBorder($Width=3,$R=0,$G=0,$B=0) - clearScale() - clearShadow() - createColorGradientPalette($R1,$G1,$B1,$R2,$G2,$B2,$Shades) - drawGraphArea($R,$G,$B,$Stripe=FALSE) - drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE) - drawRightScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1) - drawXYScale($Data,$DataDescription,$YSerieName,$XSerieName,$R,$G,$B,$WithMargin=0,$Angle=0,$Decimals=1) - drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=100) - drawLegend($XPos,$YPos,$DataDescription,$R,$G,$B,$Rs=-1,$Gs=-1,$Bs=-1,$Rt=0,$Gt=0,$Bt=0,$Border=FALSE) - drawPieLegend($XPos,$YPos,$Data,$DataDescription,$R,$G,$B) - drawTitle($XPos,$YPos,$Value,$R,$G,$B,$XPos2=-1,$YPos2=-1,$Shadow=FALSE) - drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnRight=FALSE,$TickWidth=4,$FreeText=NULL) - drawArea($Data,$Serie1,$Serie2,$R,$G,$B,$Alpha = 50) - drawRadarAxis($Data,$DataDescription,$Mosaic=TRUE,$BorderOffset=10,$A_R=60,$A_G=60,$A_B=60,$S_R=200,$S_G=200,$S_B=200,$MaxValue=-1) - drawGraphAreaGradient($R,$G,$B,$Decay,$Target=TARGET_GRAPHAREA) - drawTextBox($X1,$Y1,$X2,$Y2,$Text,$Angle=0,$R=255,$G=255,$B=255,$Align=ALIGN_LEFT,$Shadow=TRUE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=100) - getLegendBoxSize($DataDescription) - loadColorPalette($FileName,$Delimiter=",") - reportWarnings($Interface="CLI") - setGraphArea($X1,$Y1,$X2,$Y2) - setLabel($Data,$DataDescription,$SerieName,$ValueName,$Caption,$R=210,$G=210,$B=210) - setColorPalette($ID,$R,$G,$B) - setCurrency($Currency) - setDateFormat($Format) - setFontProperties($FontName,$FontSize) - setLineStyle($Width=1,$DotSize=0) - setFixedScale($VMin,$VMax,$Divisions=5,$VXMin=0,$VXMin=0,$XDivisions=5) - setShadowProperties($XDistance=1,$YDistance=1,$R=60,$G=60,$B=60,$Alpha) - writeValues($Data,$DataDescription,$Series) - Graphs methods : - drawPlotGraph($Data,$DataDescription,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=FALSE) - drawXYPlotGraph($Data,$DataDescription,$YSerieName,$XSerieName,$PaletteID=0,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1) - drawLineGraph($Data,$DataDescription,$SerieName="") - drawXYGraph($Data,$DataDescription,$YSerieName,$XSerieName,$PaletteID=0) - drawFilledLineGraph($Data,$DataDescription,$Alpha=100,$AroundZero=FALSE) - drawCubicCurve($Data,$DataDescription,$Accuracy=.1,$SerieName="") - drawFilledCubicCurve($Data,$DataDescription,$Accuracy=.1,$Alpha=100,$AroundZero=FALSE) - drawOverlayBarGraph($Data,$DataDescription,$Alpha=50) - drawBarGraph($Data,$DataDescription,$Shadow=FALSE) - drawStackedBarGraph($Data,$DataDescription,$Alpha=50,$Contiguous=FALSE) - drawLimitsGraph($Data,$DataDescription,$R=0,$G=0,$B=0) - drawRadar($Data,$DataDescription,$BorderOffset=10,$MaxValue=-1) - drawFilledRadar($Data,$DataDescription,$Alpha=50,$BorderOffset=10,$MaxValue=-1) - drawBasicPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$R=255,$G=255,$B=255,$Decimals=0) - drawFlatPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$SpliceDistance=0,$Decimals = 0) - drawFlatPieGraphWithShadow($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$SpliceDistance=0,$Decimals = 0) - drawPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$EnhanceColors=TRUE,$Skew=60,$SpliceHeight=20,$SpliceDistance=0,$Decimals=0) - Other methods : - setImageMap($Mode=TRUE,$GraphID="MyGraph") - getImageMap($MapName,$Flush=TRUE) - Render($FileName) - Stroke() - */ - - /* Declare some script wide constants */ - define("SCALE_NORMAL",1); - define("SCALE_ADDALL",2); - define("SCALE_START0",3); - define("SCALE_ADDALLSTART0",4); - define("PIE_PERCENTAGE", 1); - define("PIE_LABELS",2); - define("PIE_NOLABEL",3); - define("PIE_PERCENTAGE_LABEL", 4); - define("TARGET_GRAPHAREA",1); - define("TARGET_BACKGROUND",2); - define("ALIGN_TOP_LEFT",1); - define("ALIGN_TOP_CENTER",2); - define("ALIGN_TOP_RIGHT",3); - define("ALIGN_LEFT",4); - define("ALIGN_CENTER",5); - define("ALIGN_RIGHT",6); - define("ALIGN_BOTTOM_LEFT",7); - define("ALIGN_BOTTOM_CENTER",8); - define("ALIGN_BOTTOM_RIGHT",9); - - /* pChart class definition */ - class pChart - { - /* Palettes definition */ - var $Palette = array("0"=>array("R"=>188,"G"=>224,"B"=>46), - "1"=>array("R"=>224,"G"=>100,"B"=>46), - "2"=>array("R"=>224,"G"=>214,"B"=>46), - "3"=>array("R"=>46,"G"=>151,"B"=>224), - "4"=>array("R"=>176,"G"=>46,"B"=>224), - "5"=>array("R"=>224,"G"=>46,"B"=>117), - "6"=>array("R"=>92,"G"=>224,"B"=>46), - "7"=>array("R"=>224,"G"=>176,"B"=>46)); - - /* Some static vars used in the class */ - var $XSize = NULL; - var $YSize = NULL; - var $Picture = NULL; - var $ImageMap = NULL; - - /* Error management */ - var $ErrorReporting = FALSE; - var $ErrorInterface = "CLI"; - var $Errors = NULL; - var $ErrorFontName = "Fonts/pf_arma_five.ttf"; - var $ErrorFontSize = 6; - - /* vars related to the graphing area */ - var $GArea_X1 = NULL; - var $GArea_Y1 = NULL; - var $GArea_X2 = NULL; - var $GArea_Y2 = NULL; - var $GAreaXOffset = NULL; - var $VMax = NULL; - var $VMin = NULL; - var $VXMax = NULL; - var $VXMin = NULL; - var $Divisions = NULL; - var $XDivisions = NULL; - var $DivisionHeight = NULL; - var $XDivisionHeight = NULL; - var $DivisionCount = NULL; - var $XDivisionCount = NULL; - var $DivisionRatio = NULL; - var $XDivisionRatio = NULL; - var $DivisionWidth = NULL; - var $DataCount = NULL; - var $Currency = "\$"; - - /* Text format related vars */ - var $FontName = NULL; - var $FontSize = NULL; - var $DateFormat = "d/m/Y"; - - /* Lines format related vars */ - var $LineWidth = 1; - var $LineDotSize = 0; - - /* Layer related vars */ - var $Layers = NULL; - - /* Set antialias quality : 0 is maximum, 100 minimum*/ - var $AntialiasQuality = 0; - - /* Shadow settings */ - var $ShadowActive = FALSE; - var $ShadowXDistance = 1; - var $ShadowYDistance = 1; - var $ShadowRColor = 60; - var $ShadowGColor = 60; - var $ShadowBColor = 60; - var $ShadowAlpha = 50; - var $ShadowBlur = 0; - - /* Image Map settings */ - var $BuildMap = FALSE; - var $MapFunction = NULL; - var $tmpFolder = "tmp/"; - var $MapID = NULL; - - /* This function create the background picture */ - function pChart($XSize,$YSize) - { - $this->XSize = $XSize; - $this->YSize = $YSize; - $this->Picture = imagecreatetruecolor($XSize,$YSize); - - $C_White =$this->AllocateColor($this->Picture,255,255,255); - imagefilledrectangle($this->Picture,0,0,$XSize,$YSize,$C_White); - imagecolortransparent($this->Picture,$C_White); - - $this->setFontProperties("tahoma.ttf",8); - } - - /* Set if warnings should be reported */ - function reportWarnings($Interface="CLI") - { - $this->ErrorReporting = TRUE; - $this->ErrorInterface = $Interface; - } - - /* Set the font properties */ - function setFontProperties($FontName,$FontSize) - { - $this->FontName = $FontName; - $this->FontSize = $FontSize; - } - - /* Set the shadow properties */ - function setShadowProperties($XDistance=1,$YDistance=1,$R=60,$G=60,$B=60,$Alpha=50,$Blur=0) - { - $this->ShadowActive = TRUE; - $this->ShadowXDistance = $XDistance; - $this->ShadowYDistance = $YDistance; - $this->ShadowRColor = $R; - $this->ShadowGColor = $G; - $this->ShadowBColor = $B; - $this->ShadowAlpha = $Alpha; - $this->ShadowBlur = $Blur; - } - - /* Remove shadow option */ - function clearShadow() - { - $this->ShadowActive = FALSE; - } - - /* Set Palette color */ - function setColorPalette($ID,$R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $this->Palette[$ID]["R"] = $R; - $this->Palette[$ID]["G"] = $G; - $this->Palette[$ID]["B"] = $B; - } - - /* Create a color palette shading from one color to another */ - function createColorGradientPalette($R1,$G1,$B1,$R2,$G2,$B2,$Shades) - { - $RFactor = ($R2-$R1)/$Shades; - $GFactor = ($G2-$G1)/$Shades; - $BFactor = ($B2-$B1)/$Shades; - - for($i=0;$i<=$Shades-1;$i++) - { - $this->Palette[$i]["R"] = $R1+$RFactor*$i; - $this->Palette[$i]["G"] = $G1+$GFactor*$i; - $this->Palette[$i]["B"] = $B1+$BFactor*$i; - } - } - - /* Load Color Palette from file */ - function loadColorPalette($FileName,$Delimiter=",") - { - $handle = @fopen($FileName,"r"); - $ColorID = 0; - if ($handle) - { - while (!feof($handle)) - { - $buffer = fgets($handle, 4096); - $buffer = str_replace(chr(10),"",$buffer); - $buffer = str_replace(chr(13),"",$buffer); - $Values = split($Delimiter,$buffer); - if ( count($Values) == 3 ) - { - $this->Palette[$ColorID]["R"] = $Values[0]; - $this->Palette[$ColorID]["G"] = $Values[1]; - $this->Palette[$ColorID]["B"] = $Values[2]; - $ColorID++; - } - } - } - } - - /* Set line style */ - function setLineStyle($Width=1,$DotSize=0) - { - $this->LineWidth = $Width; - $this->LineDotSize = $DotSize; - } - - /* Set currency symbol */ - function setCurrency($Currency) - { - $this->Currency = $Currency; - } - - /* Set the graph area location */ - function setGraphArea($X1,$Y1,$X2,$Y2) - { - $this->GArea_X1 = $X1; - $this->GArea_Y1 = $Y1; - $this->GArea_X2 = $X2; - $this->GArea_Y2 = $Y2; - } - - /* Prepare the graph area */ - function drawGraphArea($R,$G,$B,$Stripe=FALSE) - { - $this->drawFilledRectangle($this->GArea_X1,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B,FALSE); - $this->drawRectangle($this->GArea_X1,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y2,$R-40,$G-40,$B-40); - - if ( $Stripe ) - { - $R2 = $R-15; if ( $R2 < 0 ) { $R2 = 0; } - $G2 = $R-15; if ( $G2 < 0 ) { $G2 = 0; } - $B2 = $R-15; if ( $B2 < 0 ) { $B2 = 0; } - - $LineColor =$this->AllocateColor($this->Picture,$R2,$G2,$B2); - $SkewWidth = $this->GArea_Y2-$this->GArea_Y1-1; - - for($i=$this->GArea_X1-$SkewWidth;$i<=$this->GArea_X2;$i=$i+4) - { - $X1 = $i; $Y1 = $this->GArea_Y2; - $X2 = $i+$SkewWidth; $Y2 = $this->GArea_Y1; - - - if ( $X1 < $this->GArea_X1 ) - { $X1 = $this->GArea_X1; $Y1 = $this->GArea_Y1 + $X2 - $this->GArea_X1 + 1; } - - if ( $X2 >= $this->GArea_X2 ) - { $Y2 = $this->GArea_Y1 + $X2 - $this->GArea_X2 +1; $X2 = $this->GArea_X2 - 1; } -// * Fixed in 1.27 * { $X2 = $this->GArea_X2 - 1; $Y2 = $this->GArea_Y2 - ($this->GArea_X2 - $X1); } - - imageline($this->Picture,$X1,$Y1,$X2,$Y2+1,$LineColor); - } - } - } - - /* Allow you to clear the scale : used if drawing multiple charts */ - function clearScale() - { - $this->VMin = NULL; - $this->VMax = NULL; - $this->VXMin = NULL; - $this->VXMax = NULL; - $this->Divisions = NULL; - $this->XDivisions = NULL; } - - /* Allow you to fix the scale, use this to bypass the automatic scaling */ - function setFixedScale($VMin,$VMax,$Divisions=5,$VXMin=0,$VXMax=0,$XDivisions=5) - { - $this->VMin = $VMin; - $this->VMax = $VMax; - $this->Divisions = $Divisions; - - if ( !$VXMin == 0 ) - { - $this->VXMin = $VXMin; - $this->VXMax = $VXMax; - $this->XDivisions = $XDivisions; - } - } - - /* Wrapper to the drawScale() function allowing a second scale to be drawn */ - function drawRightScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1) - { - $this->drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks,$Angle,$Decimals,$WithMargin,$SkipLabels,TRUE); - } - - /* Compute and draw the scale */ - function drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE) - { - /* Validate the Data and DataDescription array */ - $this->validateData("drawScale",$Data); - - $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B); - - $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X1,$this->GArea_Y2,$R,$G,$B); - $this->drawLine($this->GArea_X1,$this->GArea_Y2,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B); - - if ( $this->VMin == NULL && $this->VMax == NULL) - { - if (isset($DataDescription["Values"][0])) - { - $this->VMin = $Data[0][$DataDescription["Values"][0]]; - $this->VMax = $Data[0][$DataDescription["Values"][0]]; - } - else { $this->VMin = 2147483647; $this->VMax = -2147483647; } - - /* Compute Min and Max values */ - if ( $ScaleMode == SCALE_NORMAL || $ScaleMode == SCALE_START0 ) - { - if ( $ScaleMode == SCALE_START0 ) { $this->VMin = 0; } - - foreach ( $Data as $Key => $Values ) - { - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if (isset($Data[$Key][$ColName])) - { - $Value = $Data[$Key][$ColName]; - - if ( is_numeric($Value) ) - { - if ( $this->VMax < $Value) { $this->VMax = $Value; } - if ( $this->VMin > $Value) { $this->VMin = $Value; } - } - } - } - } - } - elseif ( $ScaleMode == SCALE_ADDALL || $ScaleMode == SCALE_ADDALLSTART0 ) /* Experimental */ - { - if ( $ScaleMode == SCALE_ADDALLSTART0 ) { $this->VMin = 0; } - - foreach ( $Data as $Key => $Values ) - { - $Sum = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if (isset($Data[$Key][$ColName])) - { - $Value = $Data[$Key][$ColName]; - if ( is_numeric($Value) ) - $Sum += $Value; - } - } - if ( $this->VMax < $Sum) { $this->VMax = $Sum; } - if ( $this->VMin > $Sum) { $this->VMin = $Sum; } - } - } - - if ( $this->VMax > preg_replace('/\.[0-9]+/','',$this->VMax) ) - $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax)+1; - - /* If all values are the same */ - if ( $this->VMax == $this->VMin ) - { - if ( $this->VMax >= 0 ) { $this->VMax++; } - else { $this->VMin--; } - } - - $DataRange = $this->VMax - $this->VMin; - if ( $DataRange == 0 ) { $DataRange = .1; } - - /* Compute automatic scaling */ - $ScaleOk = FALSE; $Factor = 1; - $MinDivHeight = 25; $MaxDivs = ($this->GArea_Y2 - $this->GArea_Y1) / $MinDivHeight; - - if ( $this->VMin == 0 && $this->VMax == 0 ) - { $this->VMin = 0; $this->VMax = 2; $Scale = 1; $Divisions = 2;} - elseif ($MaxDivs > 1) - { - while(!$ScaleOk) - { - $Scale1 = ( $this->VMax - $this->VMin ) / $Factor; - $Scale2 = ( $this->VMax - $this->VMin ) / $Factor / 2; - $Scale4 = ( $this->VMax - $this->VMin ) / $Factor / 4; - - if ( $Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale1); $Scale = 1;} - if ( $Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale2); $Scale = 2;} - if (!$ScaleOk) - { - if ( $Scale2 > 1 ) { $Factor = $Factor * 10; } - if ( $Scale2 < 1 ) { $Factor = $Factor / 10; } - } - } - - if ( floor($this->VMax / $Scale / $Factor) != $this->VMax / $Scale / $Factor) - { - $GridID = floor ( $this->VMax / $Scale / $Factor) + 1; - $this->VMax = $GridID * $Scale * $Factor; - $Divisions++; - } - - if ( floor($this->VMin / $Scale / $Factor) != $this->VMin / $Scale / $Factor) - { - $GridID = floor( $this->VMin / $Scale / $Factor); - $this->VMin = $GridID * $Scale * $Factor; - $Divisions++; - } - } - else /* Can occurs for small graphs */ - $Scale = 1; - - if ( !isset($Divisions) ) - $Divisions = 2; - - if ($Scale == 1 && $Divisions%2 == 1) - $Divisions--; - } - else - $Divisions = $this->Divisions; - - $this->DivisionCount = $Divisions; - - $DataRange = $this->VMax - $this->VMin; - if ( $DataRange == 0 ) { $DataRange = .1; } - - $this->DivisionHeight = ( $this->GArea_Y2 - $this->GArea_Y1 ) / $Divisions; - $this->DivisionRatio = ( $this->GArea_Y2 - $this->GArea_Y1 ) / $DataRange; - - $this->GAreaXOffset = 0; - if ( count($Data) > 1 ) - { - if ( $WithMargin == FALSE ) - $this->DivisionWidth = ( $this->GArea_X2 - $this->GArea_X1 ) / (count($Data)-1); - else - { - $this->DivisionWidth = ( $this->GArea_X2 - $this->GArea_X1 ) / (count($Data)); - $this->GAreaXOffset = $this->DivisionWidth / 2; - } - } - else - { - $this->DivisionWidth = $this->GArea_X2 - $this->GArea_X1; - $this->GAreaXOffset = $this->DivisionWidth / 2; - } - - $this->DataCount = count($Data); - - if ( $DrawTicks == FALSE ) - return(0); - - $YPos = $this->GArea_Y2; $XMin = NULL; - for($i=1;$i<=$Divisions+1;$i++) - { - if ( $RightScale ) - $this->drawLine($this->GArea_X2,$YPos,$this->GArea_X2+5,$YPos,$R,$G,$B); - else - $this->drawLine($this->GArea_X1,$YPos,$this->GArea_X1-5,$YPos,$R,$G,$B); - - $Value = $this->VMin + ($i-1) * (( $this->VMax - $this->VMin ) / $Divisions); - $Value = round($Value * pow(10,$Decimals)) / pow(10,$Decimals); - if ( $DataDescription["Format"]["Y"] == "number" ) - $Value = $Value.$DataDescription["Unit"]["Y"]; - if ( $DataDescription["Format"]["Y"] == "time" ) - $Value = $this->ToTime($Value); - if ( $DataDescription["Format"]["Y"] == "date" ) - $Value = $this->ToDate($Value); - if ( $DataDescription["Format"]["Y"] == "metric" ) - $Value = $this->ToMetric($Value); - if ( $DataDescription["Format"]["Y"] == "currency" ) - $Value = $this->ToCurrency($Value); - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - - if ( $RightScale ) - { - imagettftext($this->Picture,$this->FontSize,0,$this->GArea_X2+10,$YPos+($this->FontSize/2),$C_TextColor,$this->FontName,$Value); - if ( $XMin < $this->GArea_X2+15+$TextWidth || $XMin == NULL ) { $XMin = $this->GArea_X2+15+$TextWidth; } - } - else - { - imagettftext($this->Picture,$this->FontSize,0,$this->GArea_X1-10-$TextWidth,$YPos+($this->FontSize/2),$C_TextColor,$this->FontName,$Value); - if ( $XMin > $this->GArea_X1-10-$TextWidth || $XMin == NULL ) { $XMin = $this->GArea_X1-10-$TextWidth; } - } - - $YPos = $YPos - $this->DivisionHeight; - } - - /* Write the Y Axis caption if set */ - if ( isset($DataDescription["Axis"]["Y"]) ) - { - $Position = imageftbbox($this->FontSize,90,$this->FontName,$DataDescription["Axis"]["Y"]); - $TextHeight = abs($Position[1])+abs($Position[3]); - $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight/2); - - if ( $RightScale ) - imagettftext($this->Picture,$this->FontSize,90,$XMin+$this->FontSize,$TextTop,$C_TextColor,$this->FontName,$DataDescription["Axis"]["Y"]); - else - imagettftext($this->Picture,$this->FontSize,90,$XMin-$this->FontSize,$TextTop,$C_TextColor,$this->FontName,$DataDescription["Axis"]["Y"]); - } - - /* Horizontal Axis */ - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - $ID = 1; $YMax = NULL; - foreach ( $Data as $Key => $Values ) - { - if ( $ID % $SkipLabels == 0 ) - { - $this->drawLine(floor($XPos),$this->GArea_Y2,floor($XPos),$this->GArea_Y2+5,$R,$G,$B); - $Value = $Data[$Key][$DataDescription["Position"]]; - if ( $DataDescription["Format"]["X"] == "number" ) - $Value = $Value.$DataDescription["Unit"]["X"]; - if ( $DataDescription["Format"]["X"] == "time" ) - $Value = $this->ToTime($Value); - if ( $DataDescription["Format"]["X"] == "date" ) - $Value = $this->ToDate($Value); - if ( $DataDescription["Format"]["X"] == "metric" ) - $Value = $this->ToMetric($Value); - if ( $DataDescription["Format"]["X"] == "currency" ) - $Value = $this->ToCurrency($Value); - - $Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value); - $TextWidth = abs($Position[2])+abs($Position[0]); - $TextHeight = abs($Position[1])+abs($Position[3]); - - if ( $Angle == 0 ) - { - $YPos = $this->GArea_Y2+18; - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-floor($TextWidth/2),$YPos,$C_TextColor,$this->FontName,$Value); - } - else - { - $YPos = $this->GArea_Y2+10+$TextHeight; - if ( $Angle <= 90 ) - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value); - else - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)+$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value); - } - if ( $YMax < $YPos || $YMax == NULL ) { $YMax = $YPos; } - } - - $XPos = $XPos + $this->DivisionWidth; - $ID++; - } - - /* Write the X Axis caption if set */ - if ( isset($DataDescription["Axis"]["X"]) ) - { - $Position = imageftbbox($this->FontSize,90,$this->FontName,$DataDescription["Axis"]["X"]); - $TextWidth = abs($Position[2])+abs($Position[0]); - $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth/2); - imagettftext($this->Picture,$this->FontSize,0,$TextLeft,$YMax+$this->FontSize+5,$C_TextColor,$this->FontName,$DataDescription["Axis"]["X"]); - } - } - - /* Compute and draw the scale for X/Y charts */ - function drawXYScale($Data,$DataDescription,$YSerieName,$XSerieName,$R,$G,$B,$WithMargin=0,$Angle=0,$Decimals=1) - { - /* Validate the Data and DataDescription array */ - $this->validateData("drawScale",$Data); - - $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B); - - $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X1,$this->GArea_Y2,$R,$G,$B); - $this->drawLine($this->GArea_X1,$this->GArea_Y2,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B); - - /* Process Y scale */ - if ( $this->VMin == NULL && $this->VMax == NULL) - { - $this->VMin = $Data[0][$YSerieName]; - $this->VMax = $Data[0][$YSerieName]; - - foreach ( $Data as $Key => $Values ) - { - if (isset($Data[$Key][$YSerieName])) - { - $Value = $Data[$Key][$YSerieName]; - if ( $this->VMax < $Value) { $this->VMax = $Value; } - if ( $this->VMin > $Value) { $this->VMin = $Value; } - } - } - - if ( $this->VMax > preg_replace('/\.[0-9]+/','',$this->VMax) ) - $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax)+1; - - $DataRange = $this->VMax - $this->VMin; - if ( $DataRange == 0 ) { $DataRange = .1; } - - /* Compute automatic scaling */ - $ScaleOk = FALSE; $Factor = 1; - $MinDivHeight = 25; $MaxDivs = ($this->GArea_Y2 - $this->GArea_Y1) / $MinDivHeight; - - if ( $this->VMin == 0 && $this->VMax == 0 ) - { $this->VMin = 0; $this->VMax = 2; $Scale = 1; $Divisions = 2;} - elseif ($MaxDivs > 1) - { - while(!$ScaleOk) - { - $Scale1 = ( $this->VMax - $this->VMin ) / $Factor; - $Scale2 = ( $this->VMax - $this->VMin ) / $Factor / 2; - $Scale4 = ( $this->VMax - $this->VMin ) / $Factor / 4; - - if ( $Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale1); $Scale = 1;} - if ( $Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale2); $Scale = 2;} - if (!$ScaleOk) - { - if ( $Scale2 > 1 ) { $Factor = $Factor * 10; } - if ( $Scale2 < 1 ) { $Factor = $Factor / 10; } - } - } - - if ( floor($this->VMax / $Scale / $Factor) != $this->VMax / $Scale / $Factor) - { - $GridID = floor ( $this->VMax / $Scale / $Factor) + 1; - $this->VMax = $GridID * $Scale * $Factor; - $Divisions++; - } - - if ( floor($this->VMin / $Scale / $Factor) != $this->VMin / $Scale / $Factor) - { - $GridID = floor( $this->VMin / $Scale / $Factor); - $this->VMin = $GridID * $Scale * $Factor; - $Divisions++; - } - } - else /* Can occurs for small graphs */ - $Scale = 1; - - if ( !isset($Divisions) ) - $Divisions = 2; - - if ( $this->isRealInt(($this->VMax-$this->VMin)/($Divisions-1))) - $Divisions--; - elseif ( $this->isRealInt(($this->VMax-$this->VMin)/($Divisions+1))) - $Divisions++; - } - else - $Divisions = $this->Divisions; - - $this->DivisionCount = $Divisions; - - $DataRange = $this->VMax - $this->VMin; - if ( $DataRange == 0 ) { $DataRange = .1; } - - $this->DivisionHeight = ( $this->GArea_Y2 - $this->GArea_Y1 ) / $Divisions; - $this->DivisionRatio = ( $this->GArea_Y2 - $this->GArea_Y1 ) / $DataRange; - - $YPos = $this->GArea_Y2; $XMin = NULL; - for($i=1;$i<=$Divisions+1;$i++) - { - $this->drawLine($this->GArea_X1,$YPos,$this->GArea_X1-5,$YPos,$R,$G,$B); - $Value = $this->VMin + ($i-1) * (( $this->VMax - $this->VMin ) / $Divisions); - $Value = round($Value * pow(10,$Decimals)) / pow(10,$Decimals); - if ( $DataDescription["Format"]["Y"] == "number" ) - $Value = $Value.$DataDescription["Unit"]["Y"]; - if ( $DataDescription["Format"]["Y"] == "time" ) - $Value = $this->ToTime($Value); - if ( $DataDescription["Format"]["Y"] == "date" ) - $Value = $this->ToDate($Value); - if ( $DataDescription["Format"]["Y"] == "metric" ) - $Value = $this->ToMetric($Value); - if ( $DataDescription["Format"]["Y"] == "currency" ) - $Value = $this->ToCurrency($Value); - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - imagettftext($this->Picture,$this->FontSize,0,$this->GArea_X1-10-$TextWidth,$YPos+($this->FontSize/2),$C_TextColor,$this->FontName,$Value); - - if ( $XMin > $this->GArea_X1-10-$TextWidth || $XMin == NULL ) { $XMin = $this->GArea_X1-10-$TextWidth; } - - $YPos = $YPos - $this->DivisionHeight; - } - - /* Process X scale */ - if ( $this->VXMin == NULL && $this->VXMax == NULL) - { - $this->VXMin = $Data[0][$XSerieName]; - $this->VXMax = $Data[0][$XSerieName]; - - foreach ( $Data as $Key => $Values ) - { - if (isset($Data[$Key][$XSerieName])) - { - $Value = $Data[$Key][$XSerieName]; - if ( $this->VXMax < $Value) { $this->VXMax = $Value; } - if ( $this->VXMin > $Value) { $this->VXMin = $Value; } - } - } - - if ( $this->VXMax > preg_replace('/\.[0-9]+/','',$this->VXMax) ) - $this->VXMax = preg_replace('/\.[0-9]+/','',$this->VXMax)+1; - - $DataRange = $this->VMax - $this->VMin; - if ( $DataRange == 0 ) { $DataRange = .1; } - - /* Compute automatic scaling */ - $ScaleOk = FALSE; $Factor = 1; - $MinDivWidth = 25; $MaxDivs = ($this->GArea_X2 - $this->GArea_X1) / $MinDivWidth; - - if ( $this->VXMin == 0 && $this->VXMax == 0 ) - { $this->VXMin = 0; $this->VXMax = 2; $Scale = 1; $XDivisions = 2;} - elseif ($MaxDivs > 1) - { - while(!$ScaleOk) - { - $Scale1 = ( $this->VXMax - $this->VXMin ) / $Factor; - $Scale2 = ( $this->VXMax - $this->VXMin ) / $Factor / 2; - $Scale4 = ( $this->VXMax - $this->VXMin ) / $Factor / 4; - - if ( $Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $XDivisions = floor($Scale1); $Scale = 1;} - if ( $Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $XDivisions = floor($Scale2); $Scale = 2;} - if (!$ScaleOk) - { - if ( $Scale2 > 1 ) { $Factor = $Factor * 10; } - if ( $Scale2 < 1 ) { $Factor = $Factor / 10; } - } - } - - if ( floor($this->VXMax / $Scale / $Factor) != $this->VXMax / $Scale / $Factor) - { - $GridID = floor ( $this->VXMax / $Scale / $Factor) + 1; - $this->VXMax = $GridID * $Scale * $Factor; - $XDivisions++; - } - - if ( floor($this->VXMin / $Scale / $Factor) != $this->VXMin / $Scale / $Factor) - { - $GridID = floor( $this->VXMin / $Scale / $Factor); - $this->VXMin = $GridID * $Scale * $Factor; - $XDivisions++; - } - } - else /* Can occurs for small graphs */ - $Scale = 1; - - if ( !isset($XDivisions) ) - $XDivisions = 2; - - if ( $this->isRealInt(($this->VXMax-$this->VXMin)/($XDivisions-1))) - $XDivisions--; - elseif ( $this->isRealInt(($this->VXMax-$this->VXMin)/($XDivisions+1))) - $XDivisions++; - } - else - $XDivisions = $this->XDivisions; - - $this->XDivisionCount = $Divisions; - $this->DataCount = $Divisions + 2; - - $XDataRange = $this->VXMax - $this->VXMin; - if ( $XDataRange == 0 ) { $XDataRange = .1; } - - $this->DivisionWidth = ( $this->GArea_X2 - $this->GArea_X1 ) / $XDivisions; - $this->XDivisionRatio = ( $this->GArea_X2 - $this->GArea_X1 ) / $XDataRange; - - $XPos = $this->GArea_X1; $YMax = NULL; - for($i=1;$i<=$XDivisions+1;$i++) - { - $this->drawLine($XPos,$this->GArea_Y2,$XPos,$this->GArea_Y2+5,$R,$G,$B); - - $Value = $this->VXMin + ($i-1) * (( $this->VXMax - $this->VXMin ) / $XDivisions); - $Value = round($Value * pow(10,$Decimals)) / pow(10,$Decimals); - if ( $DataDescription["Format"]["Y"] == "number" ) - $Value = $Value.$DataDescription["Unit"]["Y"]; - if ( $DataDescription["Format"]["Y"] == "time" ) - $Value = $this->ToTime($Value); - if ( $DataDescription["Format"]["Y"] == "date" ) - $Value = $this->ToDate($Value); - if ( $DataDescription["Format"]["Y"] == "metric" ) - $Value = $this->ToMetric($Value); - if ( $DataDescription["Format"]["Y"] == "currency" ) - $Value = $this->ToCurrency($Value); - - $Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value); - $TextWidth = abs($Position[2])+abs($Position[0]); - $TextHeight = abs($Position[1])+abs($Position[3]); - - if ( $Angle == 0 ) - { - $YPos = $this->GArea_Y2+18; - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-floor($TextWidth/2),$YPos,$C_TextColor,$this->FontName,$Value); - } - else - { - $YPos = $this->GArea_Y2+10+$TextHeight; - if ( $Angle <= 90 ) - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value); - else - imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)+$TextWidth+5,$YPos,$C_TextColor,$this->FontName,$Value); - } - - if ( $YMax < $YPos || $YMax == NULL ) { $YMax = $YPos; } - - $XPos = $XPos + $this->DivisionWidth; - } - - /* Write the Y Axis caption if set */ - if ( isset($DataDescription["Axis"]["Y"]) ) - { - $Position = imageftbbox($this->FontSize,90,$this->FontName,$DataDescription["Axis"]["Y"]); - $TextHeight = abs($Position[1])+abs($Position[3]); - $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight/2); - imagettftext($this->Picture,$this->FontSize,90,$XMin-$this->FontSize,$TextTop,$C_TextColor,$this->FontName,$DataDescription["Axis"]["Y"]); - } - - /* Write the X Axis caption if set */ - if ( isset($DataDescription["Axis"]["X"]) ) - { - $Position = imageftbbox($this->FontSize,90,$this->FontName,$DataDescription["Axis"]["X"]); - $TextWidth = abs($Position[2])+abs($Position[0]); - $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth/2); - imagettftext($this->Picture,$this->FontSize,0,$TextLeft,$YMax+$this->FontSize+5,$C_TextColor,$this->FontName,$DataDescription["Axis"]["X"]); - } - } - - /* Compute and draw the scale */ - function drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=100) - { - /* Draw mosaic */ - if ( $Mosaic ) - { - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White =$this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $C_Rectangle =$this->AllocateColor($this->Layers[0],250,250,250); - - $YPos = $LayerHeight; //$this->GArea_Y2-1; - $LastY = $YPos; - for($i=0;$i<=$this->DivisionCount;$i++) - { - $LastY = $YPos; - $YPos = $YPos - $this->DivisionHeight; - - if ( $YPos <= 0 ) { $YPos = 1; } - - if ( $i % 2 == 0 ) - { - imagefilledrectangle($this->Layers[0],1,$YPos,$LayerWidth-1,$LastY,$C_Rectangle); - } - } - imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - } - - /* Horizontal lines */ - $YPos = $this->GArea_Y2 - $this->DivisionHeight; - for($i=1;$i<=$this->DivisionCount;$i++) - { - if ( $YPos > $this->GArea_Y1 && $YPos < $this->GArea_Y2 ) - $this->drawDottedLine($this->GArea_X1,$YPos,$this->GArea_X2,$YPos,$LineWidth,$R,$G,$B); - - $YPos = $YPos - $this->DivisionHeight; - } - - /* Vertical lines */ - if ( $this->GAreaXOffset == 0 ) - { $XPos = $this->GArea_X1 + $this->DivisionWidth + $this->GAreaXOffset; $ColCount = $this->DataCount-2; } - else - { $XPos = $this->GArea_X1 + $this->GAreaXOffset; $ColCount = floor( ($this->GArea_X2 - $this->GArea_X1) / $this->DivisionWidth ); } - - for($i=1;$i<=$ColCount;$i++) - { - if ( $XPos > $this->GArea_X1 && $XPos < $this->GArea_X2 ) - $this->drawDottedLine(floor($XPos),$this->GArea_Y1,floor($XPos),$this->GArea_Y2,$LineWidth,$R,$G,$B); - $XPos = $XPos + $this->DivisionWidth; - } - } - - /* retrieve the legends size */ - function getLegendBoxSize($DataDescription) - { - if ( !isset($DataDescription["Description"]) ) - return(-1); - - /* <-10->[8]<-4->Text<-10-> */ - $MaxWidth = 0; $MaxHeight = 8; - foreach($DataDescription["Description"] as $Key => $Value) - { - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = $Position[1]-$Position[7]; - if ( $TextWidth > $MaxWidth) { $MaxWidth = $TextWidth; } - $MaxHeight = $MaxHeight + $TextHeight + 4; - } - $MaxHeight = $MaxHeight - 3; - $MaxWidth = $MaxWidth + 32; - - return(array($MaxWidth,$MaxHeight)); - } - - /* Draw the data legends */ - function drawLegend($XPos,$YPos,$DataDescription,$R,$G,$B,$Rs=-1,$Gs=-1,$Bs=-1,$Rt=0,$Gt=0,$Bt=0,$Border=TRUE) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawLegend",$DataDescription); - - if ( !isset($DataDescription["Description"]) ) - return(-1); - - $C_TextColor =$this->AllocateColor($this->Picture,$Rt,$Gt,$Bt); - - /* <-10->[8]<-4->Text<-10-> */ - $MaxWidth = 0; $MaxHeight = 8; - foreach($DataDescription["Description"] as $Key => $Value) - { - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = $Position[1]-$Position[7]; - if ( $TextWidth > $MaxWidth) { $MaxWidth = $TextWidth; } - $MaxHeight = $MaxHeight + $TextHeight + 4; - } - $MaxHeight = $MaxHeight - 5; - $MaxWidth = $MaxWidth + 32; - - if ( $Rs == -1 || $Gs == -1 || $Bs == -1 ) - { $Rs = $R-30; $Gs = $G-30; $Bs = $B-30; } - - if ( $Border ) - { - $this->drawFilledRoundedRectangle($XPos+1,$YPos+1,$XPos+$MaxWidth+1,$YPos+$MaxHeight+1,5,$Rs,$Gs,$Bs); - $this->drawFilledRoundedRectangle($XPos,$YPos,$XPos+$MaxWidth,$YPos+$MaxHeight,5,$R,$G,$B); - } - - $YOffset = 4 + $this->FontSize; $ID = 0; - foreach($DataDescription["Description"] as $Key => $Value) - { - $this->drawFilledRoundedRectangle($XPos+10,$YPos+$YOffset-4,$XPos+14,$YPos+$YOffset-4,2,$this->Palette[$ID]["R"],$this->Palette[$ID]["G"],$this->Palette[$ID]["B"]); - imagettftext($this->Picture,$this->FontSize,0,$XPos+22,$YPos+$YOffset,$C_TextColor,$this->FontName,$Value); - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextHeight = $Position[1]-$Position[7]; - - $YOffset = $YOffset + $TextHeight + 4; - $ID++; - } - } - - /* Draw the data legends */ - function drawPieLegend($XPos,$YPos,$Data,$DataDescription,$R,$G,$B) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawPieLegend",$DataDescription,FALSE); - $this->validateData("drawPieLegend",$Data); - - if ( !isset($DataDescription["Position"]) ) - return(-1); - - $C_TextColor =$this->AllocateColor($this->Picture,0,0,0); - - /* <-10->[8]<-4->Text<-10-> */ - $MaxWidth = 0; $MaxHeight = 8; - foreach($Data as $Key => $Value) - { - $Value2 = $Value[$DataDescription["Position"]]; - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value2); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = $Position[1]-$Position[7]; - if ( $TextWidth > $MaxWidth) { $MaxWidth = $TextWidth; } - - $MaxHeight = $MaxHeight + $TextHeight + 4; - } - $MaxHeight = $MaxHeight - 3; - $MaxWidth = $MaxWidth + 32; - - $this->drawFilledRoundedRectangle($XPos+1,$YPos+1,$XPos+$MaxWidth+1,$YPos+$MaxHeight+1,5,$R-30,$G-30,$B-30); - $this->drawFilledRoundedRectangle($XPos,$YPos,$XPos+$MaxWidth,$YPos+$MaxHeight,5,$R,$G,$B); - - $YOffset = 4 + $this->FontSize; $ID = 0; - foreach($Data as $Key => $Value) - { - $Value2 = $Value[$DataDescription["Position"]]; - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value2); - $TextHeight = $Position[1]-$Position[7]; - $this->drawFilledRectangle($XPos+10,$YPos+$YOffset-6,$XPos+14,$YPos+$YOffset-2,$this->Palette[$ID]["R"],$this->Palette[$ID]["G"],$this->Palette[$ID]["B"]); - - imagettftext($this->Picture,$this->FontSize,0,$XPos+22,$YPos+$YOffset,$C_TextColor,$this->FontName,$Value2); - $YOffset = $YOffset + $TextHeight + 4; - $ID++; - } - } - - /* Draw the graph title */ - function drawTitle($XPos,$YPos,$Value,$R,$G,$B,$XPos2=-1,$YPos2=-1,$Shadow=FALSE) - { - $C_TextColor = $this->AllocateColor($this->Picture,$R,$G,$B); - - if ( $XPos2 != -1 ) - { - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - $XPos = floor(( $XPos2 - $XPos - $TextWidth ) / 2 ) + $XPos; - } - - if ( $YPos2 != -1 ) - { - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Value); - $TextHeight = $Position[5]-$Position[3]; - $YPos = floor(( $YPos2 - $YPos - $TextHeight ) / 2 ) + $YPos; - } - - if ( $Shadow ) - { - $C_ShadowColor = $this->AllocateColor($this->Picture,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor); - imagettftext($this->Picture,$this->FontSize,0,$XPos+$this->ShadowXDistance,$YPos+$this->ShadowYDistance,$C_ShadowColor,$this->FontName,$Value); - } - - imagettftext($this->Picture,$this->FontSize,0,$XPos,$YPos,$C_TextColor,$this->FontName,$Value); - } - - /* Draw a text box with text align & alpha properties */ - function drawTextBox($X1,$Y1,$X2,$Y2,$Text,$Angle=0,$R=255,$G=255,$B=255,$Align=ALIGN_LEFT,$Shadow=TRUE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=100) - { - $Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Text); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = $Position[5]-$Position[3]; - $AreaWidth = $X2 - $X1; - $AreaHeight = $Y2 - $Y1; - - if ( $BgR != -1 && $BgG != -1 && $BgB != -1 ) - $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$BgR,$BgG,$BgB,FALSE,$Alpha); - - if ( $Align == ALIGN_TOP_LEFT ) { $X = $X1+1; $Y = $Y1+$this->FontSize+1; } - if ( $Align == ALIGN_TOP_CENTER ) { $X = $X1+($AreaWidth/2)-($TextWidth/2); $Y = $Y1+$this->FontSize+1; } - if ( $Align == ALIGN_TOP_RIGHT ) { $X = $X2-$TextWidth-1; $Y = $Y1+$this->FontSize+1; } - if ( $Align == ALIGN_LEFT ) { $X = $X1+1; $Y = $Y1+($AreaHeight/2)-($TextHeight/2); } - if ( $Align == ALIGN_CENTER ) { $X = $X1+($AreaWidth/2)-($TextWidth/2); $Y = $Y1+($AreaHeight/2)-($TextHeight/2); } - if ( $Align == ALIGN_RIGHT ) { $X = $X2-$TextWidth-1; $Y = $Y1+($AreaHeight/2)-($TextHeight/2); } - if ( $Align == ALIGN_BOTTOM_LEFT ) { $X = $X1+1; $Y = $Y2-1; } - if ( $Align == ALIGN_BOTTOM_CENTER ) { $X = $X1+($AreaWidth/2)-($TextWidth/2); $Y = $Y2-1; } - if ( $Align == ALIGN_BOTTOM_RIGHT ) { $X = $X2-$TextWidth-1; $Y = $Y2-1; } - - $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B); - $C_ShadowColor =$this->AllocateColor($this->Picture,0,0,0); - if ( $Shadow ) - imagettftext($this->Picture,$this->FontSize,$Angle,$X+1,$Y+1,$C_ShadowColor,$this->FontName,$Text); - - imagettftext($this->Picture,$this->FontSize,$Angle,$X,$Y,$C_TextColor,$this->FontName,$Text); - } - - /* Compute and draw the scale */ - function drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnRight=FALSE,$TickWidth=4,$FreeText=NULL) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B); - $Y = $this->GArea_Y2 - ($Value - $this->VMin) * $this->DivisionRatio; - - if ( $Y <= $this->GArea_Y1 || $Y >= $this->GArea_Y2 ) - return(-1); - - if ( $TickWidth == 0 ) - $this->drawLine($this->GArea_X1,$Y,$this->GArea_X2,$Y,$R,$G,$B); - else - $this->drawDottedLine($this->GArea_X1,$Y,$this->GArea_X2,$Y,$TickWidth,$R,$G,$B); - - if ( $ShowLabel ) - { - if ( $FreeText == NULL ) - { $Label = $Value; } else { $Label = $FreeText; } - - if ( $ShowOnRight ) - imagettftext($this->Picture,$this->FontSize,0,$this->GArea_X2+2,$Y+($this->FontSize/2),$C_TextColor,$this->FontName,$Label); - else - imagettftext($this->Picture,$this->FontSize,0,$this->GArea_X1+2,$Y-($this->FontSize/2),$C_TextColor,$this->FontName,$Label); - } - } - - /* This function put a label on a specific point */ - function setLabel($Data,$DataDescription,$SerieName,$ValueName,$Caption,$R=210,$G=210,$B=210) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("setLabel",$DataDescription); - $this->validateData("setLabel",$Data); - $ShadowFactor = 100; - $C_Label =$this->AllocateColor($this->Picture,$R,$G,$B); - $C_Shadow =$this->AllocateColor($this->Picture,$R-$ShadowFactor,$G-$ShadowFactor,$B-$ShadowFactor); - $C_TextColor =$this->AllocateColor($this->Picture,0,0,0); - - $Cp = 0; $Found = FALSE; - foreach ( $Data as $Key => $Value ) - { - if ( $Data[$Key][$DataDescription["Position"]] == $ValueName ) - { $NumericalValue = $Data[$Key][$SerieName]; $Found = TRUE; } - if ( !$Found ) - $Cp++; - } - - $XPos = $this->GArea_X1 + $this->GAreaXOffset + ( $this->DivisionWidth * $Cp ) + 2; - $YPos = $this->GArea_Y2 - ($NumericalValue - $this->VMin) * $this->DivisionRatio; - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Caption); - $TextHeight = $Position[3] - $Position[5]; - $TextWidth = $Position[2]-$Position[0] + 2; - $TextOffset = floor($TextHeight/2); - - // Shadow - $Poly = array($XPos+1,$YPos+1,$XPos + 9,$YPos - $TextOffset,$XPos + 8,$YPos + $TextOffset + 2); - imagefilledpolygon($this->Picture,$Poly,3,$C_Shadow); - $this->drawLine($XPos,$YPos+1,$XPos + 9,$YPos - $TextOffset - .2,$R-$ShadowFactor,$G-$ShadowFactor,$B-$ShadowFactor); - $this->drawLine($XPos,$YPos+1,$XPos + 9,$YPos + $TextOffset + 2.2,$R-$ShadowFactor,$G-$ShadowFactor,$B-$ShadowFactor); - $this->drawFilledRectangle($XPos + 9,$YPos - $TextOffset-.2,$XPos + 13 + $TextWidth,$YPos + $TextOffset + 2.2,$R-$ShadowFactor,$G-$ShadowFactor,$B-$ShadowFactor); - - // Label background - $Poly = array($XPos,$YPos,$XPos + 8,$YPos - $TextOffset - 1,$XPos + 8,$YPos + $TextOffset + 1); - imagefilledpolygon($this->Picture,$Poly,3,$C_Label); - $this->drawLine($XPos-1,$YPos,$XPos + 8,$YPos - $TextOffset - 1.2,$R,$G,$B); - $this->drawLine($XPos-1,$YPos,$XPos + 8,$YPos + $TextOffset + 1.2,$R,$G,$B); - $this->drawFilledRectangle($XPos + 8,$YPos - $TextOffset - 1.2,$XPos + 12 + $TextWidth,$YPos + $TextOffset + 1.2,$R,$G,$B); - - imagettftext($this->Picture,$this->FontSize,0,$XPos + 10,$YPos + $TextOffset,$C_TextColor,$this->FontName,$Caption); - } - - /* This function draw a plot graph */ - function drawPlotGraph($Data,$DataDescription,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=FALSE) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawPlotGraph",$DataDescription); - $this->validateData("drawPlotGraph",$Data); - - $GraphID = 0; - $Ro = $R2; $Go = $G2; $Bo = $B2; - - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $R = $this->Palette[$ColorID]["R"]; - $G = $this->Palette[$ColorID]["G"]; - $B = $this->Palette[$ColorID]["B"]; - $R2 = $Ro; $G2 = $Go; $B2 = $Bo; - - if ( isset($DataDescription["Symbol"][$ColName]) ) - { - $Is_Alpha = ((ord ( file_get_contents ($DataDescription["Symbol"][$ColName], false, null, 25, 1)) & 6) & 4) == 4; - - $Infos = getimagesize($DataDescription["Symbol"][$ColName]); - $ImageWidth = $Infos[0]; - $ImageHeight = $Infos[1]; - $Symbol = imagecreatefromgif($DataDescription["Symbol"][$ColName]); - } - - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - $Hsize = round($BigRadius/2); - $R3 = -1; $G3 = -1; $B3 = -1; - foreach ( $Data as $Key => $Values ) - { - $Value = $Data[$Key][$ColName]; - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - $this->addToImageMap($XPos-$Hsize,$YPos-$Hsize,$XPos+1+$Hsize,$YPos+$Hsize+1,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Plot"); - - if ( is_numeric($Value) ) - { - if ( !isset($DataDescription["Symbol"][$ColName]) ) - { - - if ( $Shadow ) - { - if ( $R3 !=-1 && $G3 !=-1 && $B3 !=-1 ) - $this->drawFilledCircle($XPos+2,$YPos+2,$BigRadius,$R3,$G3,$B3); - else - { - $R3 = $this->Palette[$ColorID]["R"]-20; if ( $R3 < 0 ) { $R3 = 0; } - $G3 = $this->Palette[$ColorID]["G"]-20; if ( $G3 < 0 ) { $G3 = 0; } - $B3 = $this->Palette[$ColorID]["B"]-20; if ( $B3 < 0 ) { $B3 = 0; } - $this->drawFilledCircle($XPos+2,$YPos+2,$BigRadius,$R3,$G3,$B3); - } - } - - $this->drawFilledCircle($XPos+1,$YPos+1,$BigRadius,$R,$G,$B); - - if ( $SmallRadius != 0 ) - { - if ( $R2 !=-1 && $G2 !=-1 && $B2 !=-1 ) - $this->drawFilledCircle($XPos+1,$YPos+1,$SmallRadius,$R2,$G2,$B2); - else - { - $R2 = $this->Palette[$ColorID]["R"]-15; if ( $R2 < 0 ) { $R2 = 0; } - $G2 = $this->Palette[$ColorID]["G"]-15; if ( $G2 < 0 ) { $G2 = 0; } - $B2 = $this->Palette[$ColorID]["B"]-15; if ( $B2 < 0 ) { $B2 = 0; } - - $this->drawFilledCircle($XPos+1,$YPos+1,$SmallRadius,$R2,$G2,$B2); - } - } - } - else - { - imagecopymerge($this->Picture,$Symbol,$XPos+1-$ImageWidth/2,$YPos+1-$ImageHeight/2,0,0,$ImageWidth,$ImageHeight,100); - } - } - - $XPos = $XPos + $this->DivisionWidth; - } - $GraphID++; - } - } - - /* This function draw a plot graph in an X/Y space */ - function drawXYPlotGraph($Data,$DataDescription,$YSerieName,$XSerieName,$PaletteID=0,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=TRUE) - { - $R = $this->Palette[$PaletteID]["R"]; - $G = $this->Palette[$PaletteID]["G"]; - $B = $this->Palette[$PaletteID]["B"]; - $R3 = -1; $G3 = -1; $B3 = -1; - - $YLast = -1; $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$YSerieName]) && isset($Data[$Key][$XSerieName]) ) - { - $X = $Data[$Key][$XSerieName]; - $Y = $Data[$Key][$YSerieName]; - - $Y = $this->GArea_Y2 - (($Y-$this->VMin) * $this->DivisionRatio); - $X = $this->GArea_X1 + (($X-$this->VXMin) * $this->XDivisionRatio); - - - if ( $Shadow ) - { - if ( $R3 !=-1 && $G3 !=-1 && $B3 !=-1 ) - $this->drawFilledCircle($X+2,$Y+2,$BigRadius,$R3,$G3,$B3); - else - { - $R3 = $this->Palette[$PaletteID]["R"]-20; if ( $R < 0 ) { $R = 0; } - $G3 = $this->Palette[$PaletteID]["G"]-20; if ( $G < 0 ) { $G = 0; } - $B3 = $this->Palette[$PaletteID]["B"]-20; if ( $B < 0 ) { $B = 0; } - $this->drawFilledCircle($X+2,$Y+2,$BigRadius,$R3,$G3,$B3); - } - } - - $this->drawFilledCircle($X+1,$Y+1,$BigRadius,$R,$G,$B); - - if ( $R2 !=-1 && $G2 !=-1 && $B2 !=-1 ) - $this->drawFilledCircle($X+1,$Y+1,$SmallRadius,$R2,$G2,$B2); - else - { - $R2 = $this->Palette[$PaletteID]["R"]+20; if ( $R > 255 ) { $R = 255; } - $G2 = $this->Palette[$PaletteID]["G"]+20; if ( $G > 255 ) { $G = 255; } - $B2 = $this->Palette[$PaletteID]["B"]+20; if ( $B > 255 ) { $B = 255; } - $this->drawFilledCircle($X+1,$Y+1,$SmallRadius,$R2,$G2,$B2); - } - } - } - - } - - /* This function draw an area between two series */ - function drawArea($Data,$Serie1,$Serie2,$R,$G,$B,$Alpha = 50) - { - /* Validate the Data and DataDescription array */ - $this->validateData("drawArea",$Data); - - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White =$this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $C_Graph =$this->AllocateColor($this->Layers[0],$R,$G,$B); - - $XPos = $this->GAreaXOffset; - $LastXPos = -1; - foreach ( $Data as $Key => $Values ) - { - $Value1 = $Data[$Key][$Serie1]; - $Value2 = $Data[$Key][$Serie2]; - $YPos1 = $LayerHeight - (($Value1-$this->VMin) * $this->DivisionRatio); - $YPos2 = $LayerHeight - (($Value2-$this->VMin) * $this->DivisionRatio); - - if ( $LastXPos != -1 ) - { - $Points = ""; - $Points[] = $LastXPos; $Points[] = $LastYPos1; - $Points[] = $LastXPos; $Points[] = $LastYPos2; - $Points[] = $XPos; $Points[] = $YPos2; - $Points[] = $XPos; $Points[] = $YPos1; - - imagefilledpolygon($this->Layers[0],$Points,4,$C_Graph); - } - - $LastYPos1 = $YPos1; - $LastYPos2 = $YPos2; - $LastXPos = $XPos; - - $XPos = $XPos + $this->DivisionWidth; - } - - imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - } - - - /* This function write the values of the specified series */ - function writeValues($Data,$DataDescription,$Series) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("writeValues",$DataDescription); - $this->validateData("writeValues",$Data); - - if ( !is_array($Series) ) { $Series = array($Series); } - - foreach($Series as $Key => $Serie) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $Serie ) { $ColorID = $ID; }; $ID++; } - - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$Serie]) && is_numeric($Data[$Key][$Serie])) - { - $Value = $Data[$Key][$Serie]; - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - - $Positions = imagettfbbox($this->FontSize,0,$this->FontName,$Value); - $Width = $Positions[2] - $Positions[6]; $XOffset = $XPos - ($Width/2); - $Height = $Positions[3] - $Positions[7]; $YOffset = $YPos - 4; - - $C_TextColor =$this->AllocateColor($this->Picture,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagettftext($this->Picture,$this->FontSize,0,$XOffset,$YOffset,$C_TextColor,$this->FontName,$Value); - } - $XPos = $XPos + $this->DivisionWidth; - } - - } - } - - /* This function draw a line graph */ - function drawLineGraph($Data,$DataDescription,$SerieName="") - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawLineGraph",$DataDescription); - $this->validateData("drawLineGraph",$Data); - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - if ( $SerieName == "" || $SerieName == $ColName ) - { - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - { - $Value = $Data[$Key][$ColName]; - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - $this->addToImageMap($XPos-3,$YPos-3,$XPos+3,$YPos+3,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Line"); - - if (!is_numeric($Value)) { $XLast = -1; } - if ( $XLast != -1 ) - $this->drawLine($XLast,$YLast,$XPos,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE); - - $XLast = $XPos; - $YLast = $YPos; - if (!is_numeric($Value)) { $XLast = -1; } - } - $XPos = $XPos + $this->DivisionWidth; - } - $GraphID++; - } - } - } - - /* This function draw a line graph */ - function drawXYGraph($Data,$DataDescription,$YSerieName,$XSerieName,$PaletteID=0) - { - $YLast = -1; $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$YSerieName]) && isset($Data[$Key][$XSerieName]) ) - { - $X = $Data[$Key][$XSerieName]; - $Y = $Data[$Key][$YSerieName]; - - $Y = $this->GArea_Y2 - (($Y-$this->VMin) * $this->DivisionRatio); - $X = $this->GArea_X1 + (($X-$this->VXMin) * $this->XDivisionRatio); - - if ($XLast != -1 && $YLast != -1) - { - $this->drawLine($XLast,$YLast,$X,$Y,$this->Palette[$PaletteID]["R"],$this->Palette[$PaletteID]["G"],$this->Palette[$PaletteID]["B"],TRUE); - } - - $XLast = $X; - $YLast = $Y; - } - } - } - - /* This function draw a cubic curve */ - function drawCubicCurve($Data,$DataDescription,$Accuracy=.1,$SerieName="") - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawCubicCurve",$DataDescription); - $this->validateData("drawCubicCurve",$Data); - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if ( $SerieName == "" || $SerieName == $ColName ) - { - $XIn = ""; $Yin = ""; $Yt = ""; $U = ""; - $XIn[0] = 0; $YIn[0] = 0; - - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $Index = 1; - $XLast = -1; $Missing = ""; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName]) ) - { - $Value = $Data[$Key][$ColName]; - $XIn[$Index] = $Index; - $YIn[$Index] = $Value; - if ( !is_numeric($Value) ) { $Missing[$Index] = TRUE; } - $Index++; - } - } - $Index--; - - $Yt[0] = 0; - $Yt[1] = 0; - $U[1] = 0; - for($i=2;$i<=$Index-1;$i++) - { - $Sig = ($XIn[$i] - $XIn[$i-1]) / ($XIn[$i+1] - $XIn[$i-1]); - $p = $Sig * $Yt[$i-1] + 2; - $Yt[$i] = ($Sig - 1) / $p; - $U[$i] = ($YIn[$i+1] - $YIn[$i]) / ($XIn[$i+1] - $XIn[$i]) - ($YIn[$i] - $YIn[$i-1]) / ($XIn[$i] - $XIn[$i-1]); - $U[$i] = (6 * $U[$i] / ($XIn[$i+1] - $XIn[$i-1]) - $Sig * $U[$i-1]) / $p; - } - - $qn = 0; - $un = 0; - $Yt[$Index] = ($un - $qn * $U[$Index-1]) / ($qn * $Yt[$Index-1] + 1); - - for($k=$Index-1;$k>=1;$k--) - $Yt[$k] = $Yt[$k] * $Yt[$k+1] + $U[$k]; - - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - for($X=1;$X<=$Index;$X=$X+$Accuracy) - { - $klo = 1; - $khi = $Index; - $k = $khi - $klo; - while($k > 1) - { - $k = $khi - $klo; - If ( $XIn[$k] >= $X ) - $khi = $k; - else - $klo = $k; - } - $klo = $khi - 1; - - $h = $XIn[$khi] - $XIn[$klo]; - $a = ($XIn[$khi] - $X) / $h; - $b = ($X - $XIn[$klo]) / $h; - $Value = $a * $YIn[$klo] + $b * $YIn[$khi] + (($a*$a*$a - $a) * $Yt[$klo] + ($b*$b*$b - $b) * $Yt[$khi]) * ($h*$h) / 6; - - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - - if ( $XLast != -1 && !isset($Missing[floor($X)]) && !isset($Missing[floor($X+1)]) ) - $this->drawLine($XLast,$YLast,$XPos,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE); - - $XLast = $XPos; - $YLast = $YPos; - $XPos = $XPos + $this->DivisionWidth * $Accuracy; - } - - // Add potentialy missing values - $XPos = $XPos - $this->DivisionWidth * $Accuracy; - if ( $XPos < ($this->GArea_X2 - $this->GAreaXOffset) ) - { - $YPos = $this->GArea_Y2 - (($YIn[$Index]-$this->VMin) * $this->DivisionRatio); - $this->drawLine($XLast,$YLast,$this->GArea_X2-$this->GAreaXOffset,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE); - } - - $GraphID++; - } - } - } - - /* This function draw a filled cubic curve */ - function drawFilledCubicCurve($Data,$DataDescription,$Accuracy=.1,$Alpha=100,$AroundZero=FALSE) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawFilledCubicCurve",$DataDescription); - $this->validateData("drawFilledCubicCurve",$Data); - - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - $YZero = $LayerHeight - ((0-$this->VMin) * $this->DivisionRatio); - if ( $YZero > $LayerHeight ) { $YZero = $LayerHeight; } - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $XIn = ""; $Yin = ""; $Yt = ""; $U = ""; - $XIn[0] = 0; $YIn[0] = 0; - - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $Index = 1; - $XLast = -1; $Missing = ""; - foreach ( $Data as $Key => $Values ) - { - $Value = $Data[$Key][$ColName]; - $XIn[$Index] = $Index; - $YIn[$Index] = $Value; - if ( !is_numeric($Value) ) { $Missing[$Index] = TRUE; } - $Index++; - } - $Index--; - - $Yt[0] = 0; - $Yt[1] = 0; - $U[1] = 0; - for($i=2;$i<=$Index-1;$i++) - { - $Sig = ($XIn[$i] - $XIn[$i-1]) / ($XIn[$i+1] - $XIn[$i-1]); - $p = $Sig * $Yt[$i-1] + 2; - $Yt[$i] = ($Sig - 1) / $p; - $U[$i] = ($YIn[$i+1] - $YIn[$i]) / ($XIn[$i+1] - $XIn[$i]) - ($YIn[$i] - $YIn[$i-1]) / ($XIn[$i] - $XIn[$i-1]); - $U[$i] = (6 * $U[$i] / ($XIn[$i+1] - $XIn[$i-1]) - $Sig * $U[$i-1]) / $p; - } - - $qn = 0; - $un = 0; - $Yt[$Index] = ($un - $qn * $U[$Index-1]) / ($qn * $Yt[$Index-1] + 1); - - for($k=$Index-1;$k>=1;$k--) - $Yt[$k] = $Yt[$k] * $Yt[$k+1] + $U[$k]; - - $Points = ""; - $Points[] = $this->GAreaXOffset; - $Points[] = $LayerHeight; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White =$this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $YLast = NULL; - $XPos = $this->GAreaXOffset; $PointsCount = 2; - for($X=1;$X<=$Index;$X=$X+$Accuracy) - { - $klo = 1; - $khi = $Index; - $k = $khi - $klo; - while($k > 1) - { - $k = $khi - $klo; - If ( $XIn[$k] >= $X ) - $khi = $k; - else - $klo = $k; - } - $klo = $khi - 1; - - $h = $XIn[$khi] - $XIn[$klo]; - $a = ($XIn[$khi] - $X) / $h; - $b = ($X - $XIn[$klo]) / $h; - $Value = $a * $YIn[$klo] + $b * $YIn[$khi] + (($a*$a*$a - $a) * $Yt[$klo] + ($b*$b*$b - $b) * $Yt[$khi]) * ($h*$h) / 6; - - $YPos = $LayerHeight - (($Value-$this->VMin) * $this->DivisionRatio); - - if ( $YLast != NULL && $AroundZero && !isset($Missing[floor($X)]) && !isset($Missing[floor($X+1)])) - { - $aPoints = ""; - $aPoints[] = $XLast; - $aPoints[] = $YLast; - $aPoints[] = $XPos; - $aPoints[] = $YPos; - $aPoints[] = $XPos; - $aPoints[] = $YZero; - $aPoints[] = $XLast; - $aPoints[] = $YZero; - - $C_Graph =$this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$aPoints,4,$C_Graph); - } - - if ( !isset($Missing[floor($X)]) || $YLast == NULL ) - { - $PointsCount++; - $Points[] = $XPos; - $Points[] = $YPos; - } - else - { - $PointsCount++; $Points[] = $XLast; $Points[] = $LayerHeight; - } - - $YLast = $YPos; $XLast = $XPos; - $XPos = $XPos + $this->DivisionWidth * $Accuracy; - } - - // Add potentialy missing values - $XPos = $XPos - $this->DivisionWidth * $Accuracy; - if ( $XPos < ($LayerWidth-$this->GAreaXOffset) ) - { - $YPos = $LayerHeight - (($YIn[$Index]-$this->VMin) * $this->DivisionRatio); - - if ( $YLast != NULL && $AroundZero ) - { - $aPoints = ""; - $aPoints[] = $XLast; - $aPoints[] = $YLast; - $aPoints[] = $LayerWidth-$this->GAreaXOffset; - $aPoints[] = $YPos; - $aPoints[] = $LayerWidth-$this->GAreaXOffset; - $aPoints[] = $YZero; - $aPoints[] = $XLast; - $aPoints[] = $YZero; - - $C_Graph =$this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$aPoints,4,$C_Graph); - } - - if ( $YIn[$klo] != "" && $YIn[$khi] != "" || $YLast == NULL ) - { - $PointsCount++; - $Points[] = $LayerWidth-$this->GAreaXOffset; - $Points[] = $YPos; - } - } - - $Points[] = $LayerWidth-$this->GAreaXOffset; - $Points[] = $LayerHeight; - - if ( !$AroundZero ) - { - $C_Graph =$this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$Points,$PointsCount,$C_Graph); - } - - imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - - $this->drawCubicCurve($Data,$DataDescription,$Accuracy,$ColName); - - $GraphID++; - } - } - - /* This function draw a filled line graph */ - function drawFilledLineGraph($Data,$DataDescription,$Alpha=100,$AroundZero=FALSE) - { - $Empty = -2147483647; - - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawFilledLineGraph",$DataDescription); - $this->validateData("drawFilledLineGraph",$Data); - - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $aPoints = ""; - $aPoints[] = $this->GAreaXOffset; - $aPoints[] = $LayerHeight; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White = $this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $XPos = $this->GAreaXOffset; - $XLast = -1; $PointsCount = 2; - $YZero = $LayerHeight - ((0-$this->VMin) * $this->DivisionRatio); - if ( $YZero > $LayerHeight ) { $YZero = $LayerHeight; } - - $YLast = $Empty; - foreach ( $Data as $Key => $Values ) - { - $Value = $Data[$Key][$ColName]; - $YPos = $LayerHeight - (($Value-$this->VMin) * $this->DivisionRatio); - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - $this->addToImageMap($XPos-3,$YPos-3,$XPos+3,$YPos+3,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"FLine"); - - if ( !is_numeric($Value) ) - { - $PointsCount++; - $aPoints[] = $XLast; - $aPoints[] = $LayerHeight; - - $YLast = $Empty; - } - else - { - $PointsCount++; - if ( $YLast <> $Empty ) - { $aPoints[] = $XPos; $aPoints[] = $YPos; } - else - { $PointsCount++; $aPoints[] = $XPos; $aPoints[] = $LayerHeight; $aPoints[] = $XPos; $aPoints[] = $YPos; } - - if ($YLast <> $Empty && $AroundZero) - { - $Points = ""; - $Points[] = $XLast; $Points[] = $YLast; - $Points[] = $XPos; - $Points[] = $YPos; - $Points[] = $XPos; - $Points[] = $YZero; - $Points[] = $XLast; - $Points[] = $YZero; - - $C_Graph = $this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$Points,4,$C_Graph); - } - $YLast = $YPos; - } - - $XLast = $XPos; - $XPos = $XPos + $this->DivisionWidth; - } - $aPoints[] = $LayerWidth - $this->GAreaXOffset; - $aPoints[] = $LayerHeight; - - if ( $AroundZero == FALSE ) - { - $C_Graph = $this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$aPoints,$PointsCount,$C_Graph); - } - - imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - $GraphID++; - $this->drawLineGraph($Data,$DataDescription,$ColName); - } - } - - /* This function draw a bar graph */ - function drawOverlayBarGraph($Data,$DataDescription,$Alpha=50) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawOverlayBarGraph",$DataDescription); - $this->validateData("drawOverlayBarGraph",$Data); - - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $this->Layers[$GraphID] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White = $this->AllocateColor($this->Layers[$GraphID],255,255,255); - $C_Graph = $this->AllocateColor($this->Layers[$GraphID],$this->Palette[$GraphID]["R"],$this->Palette[$GraphID]["G"],$this->Palette[$GraphID]["B"]); - imagefilledrectangle($this->Layers[$GraphID],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[$GraphID],$C_White); - - $XWidth = $this->DivisionWidth / 4; - $XPos = $this->GAreaXOffset; - $YZero = $LayerHeight - ((0-$this->VMin) * $this->DivisionRatio); - $XLast = -1; $PointsCount = 2; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName]) ) - { - $Value = $Data[$Key][$ColName]; - if ( is_numeric($Value) ) - { - $YPos = $LayerHeight - (($Value-$this->VMin) * $this->DivisionRatio); - - imagefilledrectangle($this->Layers[$GraphID],$XPos-$XWidth,$YPos,$XPos+$XWidth,$YZero,$C_Graph); - - $X1 = floor($XPos - $XWidth + $this->GArea_X1); $Y1 = floor($YPos+$this->GArea_Y1) + .2; - $X2 = floor($XPos + $XWidth + $this->GArea_X1); $Y2 = $this->GArea_Y2 - ((0-$this->VMin) * $this->DivisionRatio); - if ( $X1 <= $this->GArea_X1 ) { $X1 = $this->GArea_X1 + 1; } - if ( $X2 >= $this->GArea_X2 ) { $X2 = $this->GArea_X2 - 1; } - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - $this->addToImageMap($X1,min($Y1,$Y2),$X2,max($Y1,$Y2),$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"oBar"); - - $this->drawLine($X1,$Y1,$X2,$Y1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE); - } - } - $XPos = $XPos + $this->DivisionWidth; - } - - $GraphID++; - } - - for($i=0;$i<=($GraphID-1);$i++) - { - imagecopymerge($this->Picture,$this->Layers[$i],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[$i]); - } - } - - /* This function draw a bar graph */ - function drawBarGraph($Data,$DataDescription,$Shadow=FALSE,$Alpha=100) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawBarGraph",$DataDescription); - $this->validateData("drawBarGraph",$Data); - - $GraphID = 0; - $Series = count($DataDescription["Values"]); - $SeriesWidth = $this->DivisionWidth / ($Series+1); - $SerieXOffset = $this->DivisionWidth / 2 - $SeriesWidth / 2; - - $YZero = $this->GArea_Y2 - ((0-$this->VMin) * $this->DivisionRatio); - if ( $YZero > $this->GArea_Y2 ) { $YZero = $this->GArea_Y2; } - - $SerieID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SerieXOffset + $SeriesWidth * $SerieID; - $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - { - if ( is_numeric($Data[$Key][$ColName]) ) - { - $Value = $Data[$Key][$ColName]; - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - { - $this->addToImageMap($XPos+1,min($YZero,$YPos),$XPos+$SeriesWidth-1,max($YZero,$YPos),$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Bar"); - } - - if ( $Shadow && $Alpha == 100 ) - $this->drawRectangle($XPos+1,$YZero,$XPos+$SeriesWidth-1,$YPos,25,25,25,TRUE,$Alpha); - - $this->drawFilledRectangle($XPos+1,$YZero,$XPos+$SeriesWidth-1,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha); - } - } - $XPos = $XPos + $this->DivisionWidth; - } - $SerieID++; - } - } - - /* This function draw a stacked bar graph */ - function drawStackedBarGraph($Data,$DataDescription,$Alpha=50,$Contiguous=FALSE) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawBarGraph",$DataDescription); - $this->validateData("drawBarGraph",$Data); - - $GraphID = 0; - $Series = count($DataDescription["Values"]); - if ( $Contiguous ) - $SeriesWidth = $this->DivisionWidth; - else - $SeriesWidth = $this->DivisionWidth * .8; - - $YZero = $this->GArea_Y2 - ((0-$this->VMin) * $this->DivisionRatio); - if ( $YZero > $this->GArea_Y2 ) { $YZero = $this->GArea_Y2; } - - $SerieID = 0; $LastValue = array(); - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SeriesWidth / 2; - $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - { - if ( is_numeric($Data[$Key][$ColName]) ) - { - $Value = $Data[$Key][$ColName]; - - if ( isset($LastValue[$Key]) ) - { - $YPos = $this->GArea_Y2 - ((($Value+$LastValue[$Key])-$this->VMin) * $this->DivisionRatio); - $YBottom = $this->GArea_Y2 - (($LastValue[$Key]-$this->VMin) * $this->DivisionRatio); - $LastValue[$Key] += $Value; - } - else - { - $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); - $YBottom = $YZero; - $LastValue[$Key] = $Value; - } - - /* Save point into the image map if option activated */ - if ( $this->BuildMap ) - $this->addToImageMap($XPos+1,min($YBottom,$YPos),$XPos+$SeriesWidth-1,max($YBottom,$YPos),$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"sBar"); - - $this->drawFilledRectangle($XPos+1,$YBottom,$XPos+$SeriesWidth-1,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha); - } - } - $XPos = $XPos + $this->DivisionWidth; - } - $SerieID++; - } - } - - /* This function draw a limits bar graphs */ - function drawLimitsGraph($Data,$DataDescription,$R=0,$G=0,$B=0) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawLimitsGraph",$DataDescription); - $this->validateData("drawLimitsGraph",$Data); - - $XWidth = $this->DivisionWidth / 4; - $XPos = $this->GArea_X1 + $this->GAreaXOffset; - - foreach ( $Data as $Key => $Values ) - { - $Min = $Data[$Key][$DataDescription["Values"][0]]; - $Max = $Data[$Key][$DataDescription["Values"][0]]; - $GraphID = 0; $MaxID = 0; $MinID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if ( isset($Data[$Key][$ColName]) ) - { - if ( $Data[$Key][$ColName] > $Max && is_numeric($Data[$Key][$ColName])) - { $Max = $Data[$Key][$ColName]; $MaxID = $GraphID; } - } - if ( isset($Data[$Key][$ColName]) && is_numeric($Data[$Key][$ColName])) - { - if ( $Data[$Key][$ColName] < $Min ) - { $Min = $Data[$Key][$ColName]; $MinID = $GraphID; } - $GraphID++; - } - } - - $YPos = $this->GArea_Y2 - (($Max-$this->VMin) * $this->DivisionRatio); - $X1 = floor($XPos - $XWidth); $Y1 = floor($YPos) - .2; - $X2 = floor($XPos + $XWidth); - if ( $X1 <= $this->GArea_X1 ) { $X1 = $this->GArea_X1 + 1; } - if ( $X2 >= $this->GArea_X2 ) { $X2 = $this->GArea_X2 - 1; } - - $YPos = $this->GArea_Y2 - (($Min-$this->VMin) * $this->DivisionRatio); - $Y2 = floor($YPos) + .2; - - $this->drawLine(floor($XPos)-.2,$Y1+1,floor($XPos)-.2,$Y2-1,$R,$G,$B,TRUE); - $this->drawLine(floor($XPos)+.2,$Y1+1,floor($XPos)+.2,$Y2-1,$R,$G,$B,TRUE); - $this->drawLine($X1,$Y1,$X2,$Y1,$this->Palette[$MaxID]["R"],$this->Palette[$MaxID]["G"],$this->Palette[$MaxID]["B"],FALSE); - $this->drawLine($X1,$Y2,$X2,$Y2,$this->Palette[$MinID]["R"],$this->Palette[$MinID]["G"],$this->Palette[$MinID]["B"],FALSE); - - $XPos = $XPos + $this->DivisionWidth; - } - } - - /* This function draw radar axis centered on the graph area */ - function drawRadarAxis($Data,$DataDescription,$Mosaic=TRUE,$BorderOffset=10,$A_R=60,$A_G=60,$A_B=60,$S_R=200,$S_G=200,$S_B=200,$MaxValue=-1) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawRadarAxis",$DataDescription); - $this->validateData("drawRadarAxis",$Data); - - $C_TextColor = $this->AllocateColor($this->Picture,$A_R,$A_G,$A_B); - - /* Draw radar axis */ - $Points = count($Data); - $Radius = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2 - $BorderOffset; - $XCenter = ( $this->GArea_X2 - $this->GArea_X1 ) / 2 + $this->GArea_X1; - $YCenter = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2 + $this->GArea_Y1; - - /* Search for the max value */ - if ( $MaxValue == -1 ) - { - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - if ( $Data[$Key][$ColName] > $MaxValue ) { $MaxValue = $Data[$Key][$ColName]; } - } - } - } - - /* Draw the mosaic */ - if ( $Mosaic ) - { - $RadiusScale = $Radius / $MaxValue; - for ( $t=1; $t<=$MaxValue-1; $t++) - { - $TRadius = $RadiusScale * $t; - $LastX1 = -1; - - for ( $i=0; $i<=$Points; $i++) - { - $Angle = -90 + $i * 360/$Points; - $X1 = cos($Angle * 3.1418 / 180 ) * $TRadius + $XCenter; - $Y1 = sin($Angle * 3.1418 / 180 ) * $TRadius + $YCenter; - $X2 = cos($Angle * 3.1418 / 180 ) * ($TRadius+$RadiusScale) + $XCenter; - $Y2 = sin($Angle * 3.1418 / 180 ) * ($TRadius+$RadiusScale) + $YCenter; - - if ( $t % 2 == 1 && $LastX1 != -1) - { - $Plots = ""; - $Plots[] = $X1; $Plots[] = $Y1; - $Plots[] = $X2; $Plots[] = $Y2; - $Plots[] = $LastX2; $Plots[] = $LastY2; - $Plots[] = $LastX1; $Plots[] = $LastY1; - - $C_Graph = $this->AllocateColor($this->Picture,250,250,250); - imagefilledpolygon($this->Picture,$Plots,(count($Plots)+1)/2,$C_Graph); - } - - $LastX1 = $X1; $LastY1= $Y1; - $LastX2 = $X2; $LastY2= $Y2; - } - } - } - - - /* Draw the spider web */ - for ( $t=1; $t<=$MaxValue; $t++) - { - $TRadius = ( $Radius / $MaxValue ) * $t; - $LastX = -1; - - for ( $i=0; $i<=$Points; $i++) - { - $Angle = -90 + $i * 360/$Points; - $X = cos($Angle * 3.1418 / 180 ) * $TRadius + $XCenter; - $Y = sin($Angle * 3.1418 / 180 ) * $TRadius + $YCenter; - - if ( $LastX != -1 ) - $this->drawDottedLine($LastX,$LastY,$X,$Y,4,$S_R,$S_G,$S_B); - - $LastX = $X; $LastY= $Y; - } - } - - /* Draw the axis */ - for ( $i=0; $i<=$Points; $i++) - { - $Angle = -90 + $i * 360/$Points; - $X = cos($Angle * 3.1418 / 180 ) * $Radius + $XCenter; - $Y = sin($Angle * 3.1418 / 180 ) * $Radius + $YCenter; - - $this->drawLine($XCenter,$YCenter,$X,$Y,$A_R,$A_G,$A_B); - - $XOffset = 0; $YOffset = 0; - if (isset($Data[$i][$DataDescription["Position"]])) - { - $Label = $Data[$i][$DataDescription["Position"]]; - - $Positions = imagettfbbox($this->FontSize,0,$this->FontName,$Label); - $Width = $Positions[2] - $Positions[6]; - $Height = $Positions[3] - $Positions[7]; - - if ( $Angle >= 0 && $Angle <= 90 ) - $YOffset = $Height; - - if ( $Angle > 90 && $Angle <= 180 ) - { $YOffset = $Height; $XOffset = -$Width; } - - if ( $Angle > 180 && $Angle <= 270 ) - { $XOffset = -$Width; } - - imagettftext($this->Picture,$this->FontSize,0,$X+$XOffset,$Y+$YOffset,$C_TextColor,$this->FontName,$Label); - } - } - - /* Write the values */ - for ( $t=1; $t<=$MaxValue; $t++) - { - $TRadius = ( $Radius / $MaxValue ) * $t; - - $Angle = -90 + 360 / $Points; - $X1 = $XCenter; - $Y1 = $YCenter - $TRadius; - $X2 = cos($Angle * 3.1418 / 180 ) * $TRadius + $XCenter; - $Y2 = sin($Angle * 3.1418 / 180 ) * $TRadius + $YCenter; - - $XPos = floor(($X2-$X1)/2) + $X1; - $YPos = floor(($Y2-$Y1)/2) + $Y1; - - $Positions = imagettfbbox($this->FontSize,0,$this->FontName,$t); - $X = $XPos - ( $X+$Positions[2] - $X+$Positions[6] ) / 2; - $Y = $YPos + $this->FontSize; - - $this->drawFilledRoundedRectangle($X+$Positions[6]-2,$Y+$Positions[7]-1,$X+$Positions[2]+4,$Y+$Positions[3]+1,2,240,240,240); - $this->drawRoundedRectangle($X+$Positions[6]-2,$Y+$Positions[7]-1,$X+$Positions[2]+4,$Y+$Positions[3]+1,2,220,220,220); - imagettftext($this->Picture,$this->FontSize,0,$X,$Y,$C_TextColor,$this->FontName,$t); - } - } - - /* This function draw a radar graph centered on the graph area */ - function drawRadar($Data,$DataDescription,$BorderOffset=10,$MaxValue=-1) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawRadar",$DataDescription); - $this->validateData("drawRadar",$Data); - - $Points = count($Data); - $Radius = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2 - $BorderOffset; - $XCenter = ( $this->GArea_X2 - $this->GArea_X1 ) / 2 + $this->GArea_X1; - $YCenter = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2 + $this->GArea_Y1; - - /* Search for the max value */ - if ( $MaxValue == -1 ) - { - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - if ( $Data[$Key][$ColName] > $MaxValue ) { $MaxValue = $Data[$Key][$ColName]; } - } - } - } - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $Angle = -90; - $XLast = -1; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - { - $Value = $Data[$Key][$ColName]; - $Strength = ( $Radius / $MaxValue ) * $Value; - - $XPos = cos($Angle * 3.1418 / 180 ) * $Strength + $XCenter; - $YPos = sin($Angle * 3.1418 / 180 ) * $Strength + $YCenter; - - if ( $XLast != -1 ) - $this->drawLine($XLast,$YLast,$XPos,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - - if ( $XLast == -1 ) - { $FirstX = $XPos; $FirstY = $YPos; } - - $Angle = $Angle + (360/$Points); - $XLast = $XPos; - $YLast = $YPos; - } - } - $this->drawLine($XPos,$YPos,$FirstX,$FirstY,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - $GraphID++; - } - } - - /* This function draw a radar graph centered on the graph area */ - function drawFilledRadar($Data,$DataDescription,$Alpha=50,$BorderOffset=10,$MaxValue=-1) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawFilledRadar",$DataDescription); - $this->validateData("drawFilledRadar",$Data); - - $Points = count($Data); - $LayerWidth = $this->GArea_X2-$this->GArea_X1; - $LayerHeight = $this->GArea_Y2-$this->GArea_Y1; - $Radius = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2 - $BorderOffset; - $XCenter = ( $this->GArea_X2 - $this->GArea_X1 ) / 2; - $YCenter = ( $this->GArea_Y2 - $this->GArea_Y1 ) / 2; - - /* Search for the max value */ - if ( $MaxValue == -1 ) - { - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - if ( $Data[$Key][$ColName] > $MaxValue && is_numeric($Data[$Key][$ColName])) { $MaxValue = $Data[$Key][$ColName]; } - } - } - } - - $GraphID = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - $ID = 0; - foreach ( $DataDescription["Description"] as $keyI => $ValueI ) - { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; } - - $Angle = -90; - $XLast = -1; - $Plots = ""; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - { - $Value = $Data[$Key][$ColName]; - if ( !is_numeric($Value) ) { $Value = 0; } - $Strength = ( $Radius / $MaxValue ) * $Value; - - $XPos = cos($Angle * 3.1418 / 180 ) * $Strength + $XCenter; - $YPos = sin($Angle * 3.1418 / 180 ) * $Strength + $YCenter; - - $Plots[] = $XPos; - $Plots[] = $YPos; - - $Angle = $Angle + (360/$Points); - $XLast = $XPos; - $YLast = $YPos; - } - } - - if (isset($Plots[0])) - { - $Plots[] = $Plots[0]; - $Plots[] = $Plots[1]; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White = $this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $C_Graph = $this->AllocateColor($this->Layers[0],$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - imagefilledpolygon($this->Layers[0],$Plots,(count($Plots)+1)/2,$C_Graph); - - imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - - for($i=0;$i<=count($Plots)-4;$i=$i+2) - $this->drawLine($Plots[$i]+$this->GArea_X1,$Plots[$i+1]+$this->GArea_Y1,$Plots[$i+2]+$this->GArea_X1,$Plots[$i+3]+$this->GArea_Y1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]); - } - - $GraphID++; - } - } - - /* This function draw a flat pie chart */ - function drawBasicPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$R=255,$G=255,$B=255,$Decimals=0) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawBasicPieGraph",$DataDescription,FALSE); - $this->validateData("drawBasicPieGraph",$Data); - - /* Determine pie sum */ - $Series = 0; $PieSum = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if ( $ColName != $DataDescription["Position"] ) - { - $Series++; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - $PieSum = $PieSum + $Data[$Key][$ColName]; $iValues[] = $Data[$Key][$ColName]; $iLabels[] = $Data[$Key][$DataDescription["Position"]]; - } - } - } - - /* Validate serie */ - if ( $Series != 1 ) - { - RaiseFatal("Pie chart can only accept one serie of data."); - } - - $SpliceRatio = 360 / ($PieSum > 0 ? $PieSum : 1); - $SplicePercent = 100 / ($PieSum > 0 ? $PieSum : 1); - - /* Calculate all polygons */ - $Angle = 0; $TopPlots = array(); - foreach($iValues as $Key => $Value) - { - $TopPlots[$Key][] = $XPos; - $TopPlots[$Key][] = $YPos; - - /* Process labels position & size */ - $Caption = ""; - if ( !($DrawLabels == PIE_NOLABEL) ) - { - $TAngle = $Angle+($Value*$SpliceRatio/2); - if ($DrawLabels == PIE_PERCENTAGE) - $Caption = (round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - elseif ($DrawLabels == PIE_LABELS) - $Caption = $iLabels[$Key]; - elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) - $Caption = $iLabels[$Key]."\r\n".(round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) - $Caption = $iLabels[$Key]."\r\n".(round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Caption); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = abs($Position[1])+abs($Position[3]); - - $TX = cos(($TAngle) * 3.1418 / 180 ) * ($Radius+10) + $XPos; - - if ( $TAngle > 0 && $TAngle < 180 ) - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($Radius+10) + $YPos + 4; - else - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($Radius+4) + $YPos - ($TextHeight/2); - - if ( $TAngle > 90 && $TAngle < 270 ) - $TX = $TX - $TextWidth; - - $C_TextColor = $this->AllocateColor($this->Picture,70,70,70); - imagettftext($this->Picture,$this->FontSize,0,$TX,$TY,$C_TextColor,$this->FontName,$Caption); - } - - /* Process pie slices */ - for($iAngle=$Angle;$iAngle<=$Angle+$Value*$SpliceRatio;$iAngle=$iAngle+.5) - { - $TopX = cos($iAngle * 3.1418 / 180 ) * $Radius + $XPos; - $TopY = sin($iAngle * 3.1418 / 180 ) * $Radius + $YPos; - - $TopPlots[$Key][] = $TopX; - $TopPlots[$Key][] = $TopY; - } - - $TopPlots[$Key][] = $XPos; - $TopPlots[$Key][] = $YPos; - - $Angle = $iAngle; - } - $PolyPlots = $TopPlots; - - /* Set array values type to float --- PHP Bug with imagefilledpolygon casting to integer */ - foreach ($TopPlots as $Key => $Value) - { foreach ($TopPlots[$Key] as $Key2 => $Value2) { settype($TopPlots[$Key][$Key2],"float"); } } - - /* Draw Top polygons */ - foreach ($PolyPlots as $Key => $Value) - { - $C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"]); - imagefilledpolygon($this->Picture,$PolyPlots[$Key],(count($PolyPlots[$Key])+1)/2,$C_GraphLo); - } - - $this->drawCircle($XPos-.5,$YPos-.5,$Radius,$R,$G,$B); - $this->drawCircle($XPos-.5,$YPos-.5,$Radius+.5,$R,$G,$B); - - /* Draw Top polygons */ - foreach ($TopPlots as $Key => $Value) - { - for($j=0;$j<=count($TopPlots[$Key])-4;$j=$j+2) - $this->drawLine($TopPlots[$Key][$j],$TopPlots[$Key][$j+1],$TopPlots[$Key][$j+2],$TopPlots[$Key][$j+3],$R,$G,$B); - } - } - - function drawFlatPieGraphWithShadow($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$SpliceDistance=0,$Decimals=0) - { - $this->drawFlatPieGraph($Data,$DataDescription,$XPos+$this->ShadowXDistance,$YPos+$this->ShadowYDistance,$Radius,PIE_NOLABEL,$SpliceDistance,$Decimals,TRUE); - $this->drawFlatPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius,$DrawLabels,$SpliceDistance,$Decimals,FALSE); - } - - /* This function draw a flat pie chart */ - function drawFlatPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$SpliceDistance=0,$Decimals=0,$AllBlack=FALSE) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawFlatPieGraph",$DataDescription,FALSE); - $this->validateData("drawFlatPieGraph",$Data); - - $ShadowStatus = $this->ShadowActive ; $this->ShadowActive = FALSE; - - /* Determine pie sum */ - $Series = 0; $PieSum = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if ( $ColName != $DataDescription["Position"] ) - { - $Series++; - foreach ( $Data as $Key => $Values ) - { - if ( isset($Data[$Key][$ColName])) - $PieSum = $PieSum + $Data[$Key][$ColName]; $iValues[] = $Data[$Key][$ColName]; $iLabels[] = $Data[$Key][$DataDescription["Position"]]; - } - } - } - - /* Validate serie */ - if ( $Series != 1 ) - { - RaiseFatal("Pie chart can only accept one serie of data."); - return(0); - } - - - - // 20101008 - franciscom - add new check to avoid division by zero - // $SpliceRatio = 360 / $PieSum; - // $SplicePercent = 100 / $PieSum; - $SpliceRatio = 360 / ($PieSum > 0 ? $PieSum : 1); - $SplicePercent = 100 / ($PieSum > 0 ? $PieSum : 1); - - - - /* Calculate all polygons */ - $Angle = 0; $TopPlots = ""; - foreach($iValues as $Key => $Value) - { - $XOffset = cos(($Angle+($Value/2*$SpliceRatio)) * 3.1418 / 180 ) * $SpliceDistance; - $YOffset = sin(($Angle+($Value/2*$SpliceRatio)) * 3.1418 / 180 ) * $SpliceDistance; - - $TopPlots[$Key][] = round($XPos + $XOffset); - $TopPlots[$Key][] = round($YPos + $YOffset); - - if ( $AllBlack ) - { $Rc = $this->ShadowRColor; $Gc = $this->ShadowGColor; $Bc = $this->ShadowBColor; } - else - { $Rc = $this->Palette[$Key]["R"]; $Gc = $this->Palette[$Key]["G"]; $Bc = $this->Palette[$Key]["B"]; } - - $XLineLast = ""; $YLineLast = ""; - - /* Process labels position & size */ - $Caption = ""; - if ( !($DrawLabels == PIE_NOLABEL) ) - { - $TAngle = $Angle+($Value*$SpliceRatio/2); - if ($DrawLabels == PIE_PERCENTAGE) - $Caption = (round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - elseif ($DrawLabels == PIE_LABELS) - $Caption = $iLabels[$Key]; - elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) - $Caption = $iLabels[$Key]."\r\n".(round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) - $Caption = $iLabels[$Key]."\r\n".(round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Caption); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = abs($Position[1])+abs($Position[3]); - - $TX = cos(($TAngle) * 3.1418 / 180 ) * ($Radius+10+$SpliceDistance) + $XPos; - - if ( $TAngle > 0 && $TAngle < 180 ) - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($Radius+10+$SpliceDistance) + $YPos + 4; - else - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($Radius+$SpliceDistance+4) + $YPos - ($TextHeight/2); - - if ( $TAngle > 90 && $TAngle < 270 ) - $TX = $TX - $TextWidth; - - $C_TextColor = $this->AllocateColor($this->Picture,70,70,70); - imagettftext($this->Picture,$this->FontSize,0,$TX,$TY,$C_TextColor,$this->FontName,$Caption); - } - - /* Process pie slices */ - if ( !$AllBlack ) - $LineColor = $this->AllocateColor($this->Picture,$Rc,$Gc,$Bc); - else - $LineColor = $this->AllocateColor($this->Picture,$Rc,$Gc,$Bc); - - $XLineLast = ""; $YLineLast = ""; - for($iAngle=$Angle;$iAngle<=$Angle+$Value*$SpliceRatio;$iAngle=$iAngle+.5) - { - $PosX = cos($iAngle * 3.1418 / 180 ) * $Radius + $XPos + $XOffset; - $PosY = sin($iAngle * 3.1418 / 180 ) * $Radius + $YPos + $YOffset; - - $TopPlots[$Key][] = round($PosX); $TopPlots[$Key][] = round($PosY); - - if ( $iAngle == $Angle || $iAngle == $Angle+$Value*$SpliceRatio || $iAngle +.5 > $Angle+$Value*$SpliceRatio) - $this->drawLine($XPos+$XOffset,$YPos+$YOffset,$PosX,$PosY,$Rc,$Gc,$Bc); - - if ( $XLineLast != "" ) - $this->drawLine($XLineLast,$YLineLast,$PosX,$PosY,$Rc,$Gc,$Bc); - - $XLineLast = $PosX; $YLineLast = $PosY; - } - - $TopPlots[$Key][] = round($XPos + $XOffset); $TopPlots[$Key][] = round($YPos + $YOffset); - - $Angle = $iAngle; - } - $PolyPlots = $TopPlots; - - /* Draw Top polygons */ - foreach ($PolyPlots as $Key => $Value) - { - if ( !$AllBlack ) - $C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"]); - else - $C_GraphLo = $this->AllocateColor($this->Picture,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor); - - imagefilledpolygon($this->Picture,$PolyPlots[$Key],(count($PolyPlots[$Key])+1)/2,$C_GraphLo); - } - $this->ShadowActive = $ShadowStatus; - } - - /* This function draw a pseudo-3D pie chart */ - function drawPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$EnhanceColors=TRUE,$Skew=60,$SpliceHeight=20,$SpliceDistance=0,$Decimals=0) - { - /* Validate the Data and DataDescription array */ - $this->validateDataDescription("drawPieGraph",$DataDescription,FALSE); - $this->validateData("drawPieGraph",$Data); - - /* Determine pie sum */ - $Series = 0; $PieSum = 0; $rPieSum = 0; - foreach ( $DataDescription["Values"] as $Key2 => $ColName ) - { - if ( $ColName != $DataDescription["Position"] ) - { - $Series++; - foreach ( $Data as $Key => $Values ) - if ( isset($Data[$Key][$ColName])) - { - if ( $Data[$Key][$ColName] == 0 ) - { $iValues[] = 0; $rValues[] = 0; $iLabels[] = $Data[$Key][$DataDescription["Position"]]; } - // Removed : $PieSum++; $rValues[] = 1; - else - { $PieSum += $Data[$Key][$ColName]; $iValues[] = $Data[$Key][$ColName]; $iLabels[] = $Data[$Key][$DataDescription["Position"]]; $rValues[] = $Data[$Key][$ColName]; $rPieSum += $Data[$Key][$ColName];} - } - } - } - - /* Validate serie */ - if ( $Series != 1 ) - { - RaiseFatal("Pie chart can only accept one serie of data."); - } - - $SpliceDistanceRatio = $SpliceDistance; - $SkewHeight = ($Radius * $Skew) / 100; - - - // 20101008 - franciscom - add new check to avoid division by zero - $PieSum = ($PieSum > 0 ? $PieSum : 1); - $rPieSum = ($rPieSum > 0 ? $rPieSum : 1); - - $SpliceRatio = (360 - $SpliceDistanceRatio * count($iValues) ) / $PieSum; - $SplicePercent = 100 / $PieSum; - $rSplicePercent = 100 / $rPieSum; - - /* Calculate all polygons */ - $Angle = 0; $CDev = 5; - $TopPlots = ""; $BotPlots = ""; - $aTopPlots = ""; $aBotPlots = ""; - foreach($iValues as $Key => $Value) - { - $XCenterPos = cos(($Angle-$CDev+($Value*$SpliceRatio+$SpliceDistanceRatio)/2) * 3.1418 / 180 ) * $SpliceDistance + $XPos; - $YCenterPos = sin(($Angle-$CDev+($Value*$SpliceRatio+$SpliceDistanceRatio)/2) * 3.1418 / 180 ) * $SpliceDistance + $YPos; - $XCenterPos2 = cos(($Angle+$CDev+($Value*$SpliceRatio+$SpliceDistanceRatio)/2) * 3.1418 / 180 ) * $SpliceDistance + $XPos; - $YCenterPos2 = sin(($Angle+$CDev+($Value*$SpliceRatio+$SpliceDistanceRatio)/2) * 3.1418 / 180 ) * $SpliceDistance + $YPos; - - $TopPlots[$Key][] = round($XCenterPos); $BotPlots[$Key][] = round($XCenterPos); - $TopPlots[$Key][] = round($YCenterPos); $BotPlots[$Key][] = round($YCenterPos + $SpliceHeight); - $aTopPlots[$Key][] = $XCenterPos; $aBotPlots[$Key][] = $XCenterPos; - $aTopPlots[$Key][] = $YCenterPos; $aBotPlots[$Key][] = $YCenterPos + $SpliceHeight; - - /* Process labels position & size */ - $Caption = ""; - if ( !($DrawLabels == PIE_NOLABEL) ) - { - $TAngle = $Angle+($Value*$SpliceRatio/2); - if ($DrawLabels == PIE_PERCENTAGE) - $Caption = (round($rValues[$Key] * pow(10,$Decimals) * $rSplicePercent)/pow(10,$Decimals))."%"; - elseif ($DrawLabels == PIE_LABELS) - $Caption = $iLabels[$Key]; - elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) - $Caption = $iLabels[$Key]."\r\n".(round($Value * pow(10,$Decimals) * $SplicePercent)/pow(10,$Decimals))."%"; - - $Position = imageftbbox($this->FontSize,0,$this->FontName,$Caption); - $TextWidth = $Position[2]-$Position[0]; - $TextHeight = abs($Position[1])+abs($Position[3]); - - $TX = cos(($TAngle) * 3.1418 / 180 ) * ($Radius + 10)+ $XPos; - - if ( $TAngle > 0 && $TAngle < 180 ) - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($SkewHeight + 10) + $YPos + $SpliceHeight + 4; - else - $TY = sin(($TAngle) * 3.1418 / 180 ) * ($SkewHeight + 4) + $YPos - ($TextHeight/2); - - if ( $TAngle > 90 && $TAngle < 270 ) - $TX = $TX - $TextWidth; - - $C_TextColor = $this->AllocateColor($this->Picture,70,70,70); - imagettftext($this->Picture,$this->FontSize,0,$TX,$TY,$C_TextColor,$this->FontName,$Caption); - } - - /* Process pie slices */ - for($iAngle=$Angle;$iAngle<=$Angle+$Value*$SpliceRatio;$iAngle=$iAngle+.5) - { - $TopX = cos($iAngle * 3.1418 / 180 ) * $Radius + $XPos; - $TopY = sin($iAngle * 3.1418 / 180 ) * $SkewHeight + $YPos; - - $TopPlots[$Key][] = round($TopX); $BotPlots[$Key][] = round($TopX); - $TopPlots[$Key][] = round($TopY); $BotPlots[$Key][] = round($TopY + $SpliceHeight); - $aTopPlots[$Key][] = $TopX; $aBotPlots[$Key][] = $TopX; - $aTopPlots[$Key][] = $TopY; $aBotPlots[$Key][] = $TopY + $SpliceHeight; - } - - $TopPlots[$Key][] = round($XCenterPos2); $BotPlots[$Key][] = round($XCenterPos2); - $TopPlots[$Key][] = round($YCenterPos2); $BotPlots[$Key][] = round($YCenterPos2 + $SpliceHeight); - $aTopPlots[$Key][] = $XCenterPos2; $aBotPlots[$Key][] = $XCenterPos2; - $aTopPlots[$Key][] = $YCenterPos2; $aBotPlots[$Key][] = $YCenterPos2 + $SpliceHeight; - - $Angle = $iAngle + $SpliceDistanceRatio; - } - - /* Draw Bottom polygons */ - foreach($iValues as $Key => $Value) - { - $C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"],-20); - imagefilledpolygon($this->Picture,$BotPlots[$Key],(count($BotPlots[$Key])+1)/2,$C_GraphLo); - - if ( $EnhanceColors ) { $En = -10; } else { $En = 0; } - - for($j=0;$j<=count($aBotPlots[$Key])-4;$j=$j+2) - $this->drawLine($aBotPlots[$Key][$j],$aBotPlots[$Key][$j+1],$aBotPlots[$Key][$j+2],$aBotPlots[$Key][$j+3],$this->Palette[$Key]["R"]+$En,$this->Palette[$Key]["G"]+$En,$this->Palette[$Key]["B"]+$En); - } - - /* Draw pie layers */ - if ( $EnhanceColors ) { $ColorRatio = 30 / $SpliceHeight; } else { $ColorRatio = 25 / $SpliceHeight; } - for($i=$SpliceHeight-1;$i>=1;$i--) - { - foreach($iValues as $Key => $Value) - { - $C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"],-10); - $Plots = ""; $Plot = 0; - foreach($TopPlots[$Key] as $Key2 => $Value2) - { - $Plot++; - if ( $Plot % 2 == 1 ) - $Plots[] = $Value2; - else - $Plots[] = $Value2+$i; - } - imagefilledpolygon($this->Picture,$Plots,(count($Plots)+1)/2,$C_GraphLo); - - $Index = count($Plots); - if ($EnhanceColors ) {$ColorFactor = -20 + ($SpliceHeight - $i) * $ColorRatio; } else { $ColorFactor = 0; } - - $this->drawAntialiasPixel($Plots[0],$Plots[1],$this->Palette[$Key]["R"]+$ColorFactor,$this->Palette[$Key]["G"]+$ColorFactor,$this->Palette[$Key]["B"]+$ColorFactor); - $this->drawAntialiasPixel($Plots[2],$Plots[3],$this->Palette[$Key]["R"]+$ColorFactor,$this->Palette[$Key]["G"]+$ColorFactor,$this->Palette[$Key]["B"]+$ColorFactor); - $this->drawAntialiasPixel($Plots[$Index-4],$Plots[$Index-3],$this->Palette[$Key]["R"]+$ColorFactor,$this->Palette[$Key]["G"]+$ColorFactor,$this->Palette[$Key]["B"]+$ColorFactor); - } - } - - /* Draw Top polygons */ - for($Key=count($iValues)-1;$Key>=0;$Key--) - { - $C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"]); - imagefilledpolygon($this->Picture,$TopPlots[$Key],(count($TopPlots[$Key])+1)/2,$C_GraphLo); - - if ( $EnhanceColors ) { $En = 10; } else { $En = 0; } - for($j=0;$j<=count($aTopPlots[$Key])-4;$j=$j+2) - $this->drawLine($aTopPlots[$Key][$j],$aTopPlots[$Key][$j+1],$aTopPlots[$Key][$j+2],$aTopPlots[$Key][$j+3],$this->Palette[$Key]["R"]+$En,$this->Palette[$Key]["G"]+$En,$this->Palette[$Key]["B"]+$En); - } - } - - /* This function can be used to set the background color */ - function drawBackground($R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Background = $this->AllocateColor($this->Picture,$R,$G,$B); - imagefilledrectangle($this->Picture,0,0,$this->XSize,$this->YSize,$C_Background); - } - - /* This function can be used to set the background color */ - function drawGraphAreaGradient($R,$G,$B,$Decay,$Target=TARGET_GRAPHAREA) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - if ( $Target == TARGET_GRAPHAREA ) { $X1 = $this->GArea_X1+1; $X2 = $this->GArea_X2-1; $Y1 = $this->GArea_Y1+1; $Y2 = $this->GArea_Y2; } - if ( $Target == TARGET_BACKGROUND ) { $X1 = 0; $X2 = $this->XSize; $Y1 = 0; $Y2 = $this->YSize; } - - /* Positive gradient */ - if ( $Decay > 0 ) - { - $YStep = ($Y2 - $Y1 - 2) / $Decay; - for($i=0;$i<=$Decay;$i++) - { - $R-=1;$G-=1;$B-=1; - $Yi1 = $Y1 + ( $i * $YStep ); - $Yi2 = ceil( $Yi1 + ( $i * $YStep ) + $YStep ); - if ( $Yi2 >= $Yi2 ) { $Yi2 = $Y2-1; } - - $C_Background = $this->AllocateColor($this->Picture,$R,$G,$B); - imagefilledrectangle($this->Picture,$X1,$Yi1,$X2,$Yi2,$C_Background); - } - } - - /* Negative gradient */ - if ( $Decay < 0 ) - { - $YStep = ($Y2 - $Y1 - 2) / -$Decay; - $Yi1 = $Y1; $Yi2 = $Y1+$YStep; - for($i=-$Decay;$i>=0;$i--) - { - $R+=1;$G+=1;$B+=1; - $C_Background = $this->AllocateColor($this->Picture,$R,$G,$B); - imagefilledrectangle($this->Picture,$X1,$Yi1,$X2,$Yi2,$C_Background); - - $Yi1+= $YStep; - $Yi2+= $YStep; - if ( $Yi2 >= $Yi2 ) { $Yi2 = $Y2-1; } - } - } - } - - /* This function create a rectangle with antialias */ - function drawRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Rectangle = $this->AllocateColor($this->Picture,$R,$G,$B); - - $X1=$X1-.2;$Y1=$Y1-.2; - $X2=$X2+.2;$Y2=$Y2+.2; - $this->drawLine($X1,$Y1,$X2,$Y1,$R,$G,$B); - $this->drawLine($X2,$Y1,$X2,$Y2,$R,$G,$B); - $this->drawLine($X2,$Y2,$X1,$Y2,$R,$G,$B); - $this->drawLine($X1,$Y2,$X1,$Y1,$R,$G,$B); - } - - /* This function create a filled rectangle with antialias */ - function drawFilledRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B,$DrawBorder=TRUE,$Alpha=100,$NoFallBack=FALSE) - { - if ( $X2 < $X1 ) { list($X1, $X2) = array($X2, $X1); } - if ( $Y2 < $Y1 ) { list($Y1, $Y2) = array($Y2, $Y1); } - - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - if ( $Alpha == 100 ) - { - /* Process shadows */ - if ( $this->ShadowActive && !$NoFallBack ) - { - $this->drawFilledRectangle($X1+$this->ShadowXDistance,$Y1+$this->ShadowYDistance,$X2+$this->ShadowXDistance,$Y2+$this->ShadowYDistance,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,FALSE,$this->ShadowAlpha,TRUE); - if ( $this->ShadowBlur != 0 ) - { - $AlphaDecay = ($this->ShadowAlpha / $this->ShadowBlur); - - for($i=1; $i<=$this->ShadowBlur; $i++) - $this->drawFilledRectangle($X1+$this->ShadowXDistance-$i/2,$Y1+$this->ShadowYDistance-$i/2,$X2+$this->ShadowXDistance-$i/2,$Y2+$this->ShadowYDistance-$i/2,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,FALSE,$this->ShadowAlpha-$AlphaDecay*$i,TRUE); - for($i=1; $i<=$this->ShadowBlur; $i++) - $this->drawFilledRectangle($X1+$this->ShadowXDistance+$i/2,$Y1+$this->ShadowYDistance+$i/2,$X2+$this->ShadowXDistance+$i/2,$Y2+$this->ShadowYDistance+$i/2,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,FALSE,$this->ShadowAlpha-$AlphaDecay*$i,TRUE); - } - } - - $C_Rectangle = $this->AllocateColor($this->Picture,$R,$G,$B); - imagefilledrectangle($this->Picture,round($X1),round($Y1),round($X2),round($Y2),$C_Rectangle); - } - else - { - $LayerWidth = abs($X2-$X1)+2; - $LayerHeight = abs($Y2-$Y1)+2; - - $this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight); - $C_White = $this->AllocateColor($this->Layers[0],255,255,255); - imagefilledrectangle($this->Layers[0],0,0,$LayerWidth,$LayerHeight,$C_White); - imagecolortransparent($this->Layers[0],$C_White); - - $C_Rectangle = $this->AllocateColor($this->Layers[0],$R,$G,$B); - imagefilledrectangle($this->Layers[0],round(1),round(1),round($LayerWidth-1),round($LayerHeight-1),$C_Rectangle); - - imagecopymerge($this->Picture,$this->Layers[0],round(min($X1,$X2)-1),round(min($Y1,$Y2)-1),0,0,$LayerWidth,$LayerHeight,$Alpha); - imagedestroy($this->Layers[0]); - } - - if ( $DrawBorder ) - { - $ShadowSettings = $this->ShadowActive; $this->ShadowActive = FALSE; - $this->drawRectangle($X1,$Y1,$X2,$Y2,$R,$G,$B); - $this->ShadowActive = $ShadowSettings; - } - } - - /* This function create a rectangle with rounded corners and antialias */ - function drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Rectangle = $this->AllocateColor($this->Picture,$R,$G,$B); - - $Step = 90 / ((3.1418 * $Radius)/2); - - for($i=0;$i<=90;$i=$i+$Step) - { - $X = cos(($i+180)*3.1418/180) * $Radius + $X1 + $Radius; - $Y = sin(($i+180)*3.1418/180) * $Radius + $Y1 + $Radius; - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - - $X = cos(($i-90)*3.1418/180) * $Radius + $X2 - $Radius; - $Y = sin(($i-90)*3.1418/180) * $Radius + $Y1 + $Radius; - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - - $X = cos(($i)*3.1418/180) * $Radius + $X2 - $Radius; - $Y = sin(($i)*3.1418/180) * $Radius + $Y2 - $Radius; - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - - $X = cos(($i+90)*3.1418/180) * $Radius + $X1 + $Radius; - $Y = sin(($i+90)*3.1418/180) * $Radius + $Y2 - $Radius; - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - } - - $X1=$X1-.2;$Y1=$Y1-.2; - $X2=$X2+.2;$Y2=$Y2+.2; - $this->drawLine($X1+$Radius,$Y1,$X2-$Radius,$Y1,$R,$G,$B); - $this->drawLine($X2,$Y1+$Radius,$X2,$Y2-$Radius,$R,$G,$B); - $this->drawLine($X2-$Radius,$Y2,$X1+$Radius,$Y2,$R,$G,$B); - $this->drawLine($X1,$Y2-$Radius,$X1,$Y1+$Radius,$R,$G,$B); - } - - /* This function create a filled rectangle with rounded corners and antialias */ - function drawFilledRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Rectangle = $this->AllocateColor($this->Picture,$R,$G,$B); - - $Step = 90 / ((3.1418 * $Radius)/2); - - for($i=0;$i<=90;$i=$i+$Step) - { - $Xi1 = cos(($i+180)*3.1418/180) * $Radius + $X1 + $Radius; - $Yi1 = sin(($i+180)*3.1418/180) * $Radius + $Y1 + $Radius; - - $Xi2 = cos(($i-90)*3.1418/180) * $Radius + $X2 - $Radius; - $Yi2 = sin(($i-90)*3.1418/180) * $Radius + $Y1 + $Radius; - - $Xi3 = cos(($i)*3.1418/180) * $Radius + $X2 - $Radius; - $Yi3 = sin(($i)*3.1418/180) * $Radius + $Y2 - $Radius; - - $Xi4 = cos(($i+90)*3.1418/180) * $Radius + $X1 + $Radius; - $Yi4 = sin(($i+90)*3.1418/180) * $Radius + $Y2 - $Radius; - - imageline($this->Picture,$Xi1,$Yi1,$X1+$Radius,$Yi1,$C_Rectangle); - imageline($this->Picture,$X2-$Radius,$Yi2,$Xi2,$Yi2,$C_Rectangle); - imageline($this->Picture,$X2-$Radius,$Yi3,$Xi3,$Yi3,$C_Rectangle); - imageline($this->Picture,$Xi4,$Yi4,$X1+$Radius,$Yi4,$C_Rectangle); - - $this->drawAntialiasPixel($Xi1,$Yi1,$R,$G,$B); - $this->drawAntialiasPixel($Xi2,$Yi2,$R,$G,$B); - $this->drawAntialiasPixel($Xi3,$Yi3,$R,$G,$B); - $this->drawAntialiasPixel($Xi4,$Yi4,$R,$G,$B); - } - - imagefilledrectangle($this->Picture,$X1,$Y1+$Radius,$X2,$Y2-$Radius,$C_Rectangle); - imagefilledrectangle($this->Picture,$X1+$Radius,$Y1,$X2-$Radius,$Y2,$C_Rectangle); - - $X1=$X1-.2;$Y1=$Y1-.2; - $X2=$X2+.2;$Y2=$Y2+.2; - $this->drawLine($X1+$Radius,$Y1,$X2-$Radius,$Y1,$R,$G,$B); - $this->drawLine($X2,$Y1+$Radius,$X2,$Y2-$Radius,$R,$G,$B); - $this->drawLine($X2-$Radius,$Y2,$X1+$Radius,$Y2,$R,$G,$B); - $this->drawLine($X1,$Y2-$Radius,$X1,$Y1+$Radius,$R,$G,$B); - } - - /* This function create a circle with antialias */ - function drawCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0) - { - if ( $Width == 0 ) { $Width = $Height; } - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Circle = $this->AllocateColor($this->Picture,$R,$G,$B); - $Step = 360 / (2 * 3.1418 * max($Width,$Height)); - - for($i=0;$i<=360;$i=$i+$Step) - { - $X = cos($i*3.1418/180) * $Height + $Xc; - $Y = sin($i*3.1418/180) * $Width + $Yc; - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - } - } - - /* This function create a filled circle/ellipse with antialias */ - function drawFilledCircle($Xc,$Yc,$Height,$R,$G,$B,$Width=0) - { - if ( $Width == 0 ) { $Width = $Height; } - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $C_Circle = $this->AllocateColor($this->Picture,$R,$G,$B); - $Step = 360 / (2 * 3.1418 * max($Width,$Height)); - - for($i=90;$i<=270;$i=$i+$Step) - { - $X1 = cos($i*3.1418/180) * $Height + $Xc; - $Y1 = sin($i*3.1418/180) * $Width + $Yc; - $X2 = cos((180-$i)*3.1418/180) * $Height + $Xc; - $Y2 = sin((180-$i)*3.1418/180) * $Width + $Yc; - - $this->drawAntialiasPixel($X1-1,$Y1-1,$R,$G,$B); - $this->drawAntialiasPixel($X2-1,$Y2-1,$R,$G,$B); - - if ( ($Y1-1) > $Yc - max($Width,$Height) ) - imageline($this->Picture,$X1,$Y1-1,$X2-1,$Y2-1,$C_Circle); - } - } - - /* This function will draw a filled ellipse */ - function drawEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B) - { $this->drawCircle($Xc,$Yc,$Height,$R,$G,$B,$Width); } - - /* This function will draw an ellipse */ - function drawFilledEllipse($Xc,$Yc,$Height,$Width,$R,$G,$B) - { $this->drawFilledCircle($Xc,$Yc,$Height,$R,$G,$B,$Width); } - - /* This function create a line with antialias */ - function drawLine($X1,$Y1,$X2,$Y2,$R,$G,$B,$GraphFunction=FALSE) - { - if ( $this->LineDotSize > 1 ) { $this->drawDottedLine($X1,$Y1,$X2,$Y2,$this->LineDotSize,$R,$G,$B,$GraphFunction); return(0); } - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $Distance = sqrt(($X2-$X1)*($X2-$X1)+($Y2-$Y1)*($Y2-$Y1)); - if ( $Distance == 0 ) - return(-1); - $XStep = ($X2-$X1) / $Distance; - $YStep = ($Y2-$Y1) / $Distance; - - for($i=0;$i<=$Distance;$i++) - { - $X = $i * $XStep + $X1; - $Y = $i * $YStep + $Y1; - - if ( ($X >= $this->GArea_X1 && $X <= $this->GArea_X2 && $Y >= $this->GArea_Y1 && $Y <= $this->GArea_Y2) || !$GraphFunction ) - { - if ( $this->LineWidth == 1 ) - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - else - { - $StartOffset = -($this->LineWidth/2); $EndOffset = ($this->LineWidth/2); - for($j=$StartOffset;$j<=$EndOffset;$j++) - $this->drawAntialiasPixel($X+$j,$Y+$j,$R,$G,$B); - } - } - } - } - - /* This function create a line with antialias */ - function drawDottedLine($X1,$Y1,$X2,$Y2,$DotSize,$R,$G,$B,$GraphFunction=FALSE) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $Distance = sqrt(($X2-$X1)*($X2-$X1)+($Y2-$Y1)*($Y2-$Y1)); - - $XStep = ($X2-$X1) / $Distance; - $YStep = ($Y2-$Y1) / $Distance; - - $DotIndex = 0; - for($i=0;$i<=$Distance;$i++) - { - $X = $i * $XStep + $X1; - $Y = $i * $YStep + $Y1; - - if ( $DotIndex <= $DotSize) - { - if ( ($X >= $this->GArea_X1 && $X <= $this->GArea_X2 && $Y >= $this->GArea_Y1 && $Y <= $this->GArea_Y2) || !$GraphFunction ) - { - if ( $this->LineWidth == 1 ) - $this->drawAntialiasPixel($X,$Y,$R,$G,$B); - else - { - $StartOffset = -($this->LineWidth/2); $EndOffset = ($this->LineWidth/2); - for($j=$StartOffset;$j<=$EndOffset;$j++) - $this->drawAntialiasPixel($X+$j,$Y+$j,$R,$G,$B); - } - } - } - - $DotIndex++; - if ( $DotIndex == $DotSize * 2 ) - $DotIndex = 0; - } - } - - /* Load a PNG file and draw it over the chart */ - function drawFromPNG($FileName,$X,$Y,$Alpha=100) - { $this->drawFromPicture(1,$FileName,$X,$Y,$Alpha); } - - /* Load a GIF file and draw it over the chart */ - function drawFromGIF($FileName,$X,$Y,$Alpha=100) - { $this->drawFromPicture(2,$FileName,$X,$Y,$Alpha); } - - /* Load a JPEG file and draw it over the chart */ - function drawFromJPG($FileName,$X,$Y,$Alpha=100) - { $this->drawFromPicture(3,$FileName,$X,$Y,$Alpha); } - - /* Generic loader function for external pictures */ - function drawFromPicture($PicType,$FileName,$X,$Y,$Alpha=100) - { - if ( file_exists($FileName)) - { - $Infos = getimagesize($FileName); - $Width = $Infos[0]; - $Height = $Infos[1]; - if ( $PicType == 1 ) { $Raster = imagecreatefrompng($FileName); } - if ( $PicType == 2 ) { $Raster = imagecreatefromgif($FileName); } - if ( $PicType == 3 ) { $Raster = imagecreatefromjpeg($FileName); } - - imagecopymerge($this->Picture,$Raster,$X,$Y,0,0,$Width,$Height,$Alpha); - imagedestroy($Raster); - } - } - - /* Draw an alpha pixel */ - function drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B) - { - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - if ( $X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize ) - return(-1); - - $RGB2 = imagecolorat($this->Picture, $X, $Y); - $R2 = ($RGB2 >> 16) & 0xFF; - $G2 = ($RGB2 >> 8) & 0xFF; - $B2 = $RGB2 & 0xFF; - - $iAlpha = (100 - $Alpha)/100; - $Alpha = $Alpha / 100; - - $Ra = floor($R*$Alpha+$R2*$iAlpha); - $Ga = floor($G*$Alpha+$G2*$iAlpha); - $Ba = floor($B*$Alpha+$B2*$iAlpha); - - $C_Aliased = $this->AllocateColor($this->Picture,$Ra,$Ga,$Ba); - imagesetpixel($this->Picture,$X,$Y,$C_Aliased); - } - - /* Color helper */ - function AllocateColor($Picture,$R,$G,$B,$Factor=0) - { - $R = $R + $Factor; - $G = $G + $Factor; - $B = $B + $Factor; - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - return(imagecolorallocate($Picture,$R,$G,$B)); - } - - /* Add a border to the picture */ - function addBorder($Size=3,$R=0,$G=0,$B=0) - { - $Width = $this->XSize+2*$Size; - $Height = $this->YSize+2*$Size; - - $Resampled = imagecreatetruecolor($Width,$Height); - $C_Background = $this->AllocateColor($Resampled,$R,$G,$B); - imagefilledrectangle($Resampled,0,0,$Width,$Height,$C_Background); - - imagecopy($Resampled,$this->Picture,$Size,$Size,0,0,$this->XSize,$this->YSize); - imagedestroy($this->Picture); - - $this->XSize = $Width; - $this->YSize = $Height; - - $this->Picture = imagecreatetruecolor($this->XSize,$this->YSize); - $C_White = $this->AllocateColor($this->Picture,255,255,255); - imagefilledrectangle($this->Picture,0,0,$this->XSize,$this->YSize,$C_White); - imagecolortransparent($this->Picture,$C_White); - imagecopy($this->Picture,$Resampled,0,0,0,0,$this->XSize,$this->YSize); - } - - /* Render the current picture to a file */ - function Render($FileName) - { - if ( $this->ErrorReporting ) - $this->printErrors($this->ErrorInterface); - - /* Save image map if requested */ - if ( $this->BuildMap ) - $this->SaveImageMap(); - - imagepng($this->Picture,$FileName); - } - - /* Render the current picture to STDOUT */ - function Stroke() - { - if ( $this->ErrorReporting ) - $this->printErrors("GD"); - - /* Save image map if requested */ - if ( $this->BuildMap ) - $this->SaveImageMap(); - - header('Content-type: image/png'); - imagepng($this->Picture); - } - - /* Private functions for internal processing */ - function drawAntialiasPixel($X,$Y,$R,$G,$B,$Alpha=100,$NoFallBack=FALSE) - { - /* Process shadows */ - if ( $this->ShadowActive && !$NoFallBack ) - { - $this->drawAntialiasPixel($X+$this->ShadowXDistance,$Y+$this->ShadowYDistance,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,$this->ShadowAlpha,TRUE); - if ( $this->ShadowBlur != 0 ) - { - $AlphaDecay = ($this->ShadowAlpha / $this->ShadowBlur); - - for($i=1; $i<=$this->ShadowBlur; $i++) - $this->drawAntialiasPixel($X+$this->ShadowXDistance-$i/2,$Y+$this->ShadowYDistance-$i/2,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,$this->ShadowAlpha-$AlphaDecay*$i,TRUE); - for($i=1; $i<=$this->ShadowBlur; $i++) - $this->drawAntialiasPixel($X+$this->ShadowXDistance+$i/2,$Y+$this->ShadowYDistance+$i/2,$this->ShadowRColor,$this->ShadowGColor,$this->ShadowBColor,$this->ShadowAlpha-$AlphaDecay*$i,TRUE); - } - } - - if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } - if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } - if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; } - - $Plot = ""; - $Xi = floor($X); - $Yi = floor($Y); - - if ( $Xi == $X && $Yi == $Y) - { - if ( $Alpha == 100 ) - { - $C_Aliased = $this->AllocateColor($this->Picture,$R,$G,$B); - imagesetpixel($this->Picture,$X,$Y,$C_Aliased); - } - else - $this->drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B); - } - else - { - $Alpha1 = (((1 - ($X - floor($X))) * (1 - ($Y - floor($Y))) * 100) / 100) * $Alpha; - if ( $Alpha1 > $this->AntialiasQuality ) { $this->drawAlphaPixel($Xi,$Yi,$Alpha1,$R,$G,$B); } - - $Alpha2 = ((($X - floor($X)) * (1 - ($Y - floor($Y))) * 100) / 100) * $Alpha; - if ( $Alpha2 > $this->AntialiasQuality ) { $this->drawAlphaPixel($Xi+1,$Yi,$Alpha2,$R,$G,$B); } - - $Alpha3 = (((1 - ($X - floor($X))) * ($Y - floor($Y)) * 100) / 100) * $Alpha; - if ( $Alpha3 > $this->AntialiasQuality ) { $this->drawAlphaPixel($Xi,$Yi+1,$Alpha3,$R,$G,$B); } - - $Alpha4 = ((($X - floor($X)) * ($Y - floor($Y)) * 100) / 100) * $Alpha; - if ( $Alpha4 > $this->AntialiasQuality ) { $this->drawAlphaPixel($Xi+1,$Yi+1,$Alpha4,$R,$G,$B); } - } - } - - /* Validate data contained in the description array */ - function validateDataDescription($FunctionName,&$DataDescription,$DescriptionRequired=TRUE) - { - if (!isset($DataDescription["Position"])) - { - $this->Errors[] = "[Warning] ".$FunctionName." - Y Labels are not set."; - $DataDescription["Position"] = "Name"; - } - - if ( $DescriptionRequired ) - { - if (!isset($DataDescription["Description"])) - { - $this->Errors[] = "[Warning] ".$FunctionName." - Series descriptions are not set."; - foreach($DataDescription["Values"] as $key => $Value) - { - $DataDescription["Description"][$Value] = $Value; - } - } - - if (count($DataDescription["Description"]) < count($DataDescription["Values"])) - { - $this->Errors[] = "[Warning] ".$FunctionName." - Some series descriptions are not set."; - foreach($DataDescription["Values"] as $key => $Value) - { - if ( !isset($DataDescription["Description"][$Value])) - $DataDescription["Description"][$Value] = $Value; - } - } - } - } - - /* Validate data contained in the data array */ - function validateData($FunctionName,&$Data) - { - $DataSummary = array(); - - foreach($Data as $key => $Values) - { - foreach($Values as $key2 => $Value) - { - if (!isset($DataSummary[$key2])) - $DataSummary[$key2] = 1; - else - $DataSummary[$key2]++; - } - } - - if ( max($DataSummary) == 0 ) - $this->Errors[] = "[Warning] ".$FunctionName." - No data set."; - - foreach($DataSummary as $key => $Value) - { - if ($Value < max($DataSummary)) - { - $this->Errors[] = "[Warning] ".$FunctionName." - Missing data in serie ".$key."."; - } - } - } - - /* Print all error messages on the CLI or graphically */ - function printErrors($Mode="CLI") - { - if (count($this->Errors) == 0) - return(0); - - if ( $Mode == "CLI" ) - { - foreach($this->Errors as $key => $Value) - echo $Value."\r\n"; - } - elseif ( $Mode == "GD" ) - { - $this->setLineStyle($Width=1); - $MaxWidth = 0; - foreach($this->Errors as $key => $Value) - { - $Position = imageftbbox($this->ErrorFontSize,0,$this->ErrorFontName,$Value); - $TextWidth = $Position[2]-$Position[0]; - if ( $TextWidth > $MaxWidth ) { $MaxWidth = $TextWidth; } - } - $this->drawFilledRoundedRectangle($this->XSize-($MaxWidth+20),$this->YSize-(20+(($this->ErrorFontSize+4)*count($this->Errors))),$this->XSize-10,$this->YSize-10,6,233,185,185); - $this->drawRoundedRectangle($this->XSize-($MaxWidth+20),$this->YSize-(20+(($this->ErrorFontSize+4)*count($this->Errors))),$this->XSize-10,$this->YSize-10,6,193,145,145); - - $C_TextColor = $this->AllocateColor($this->Picture,133,85,85); - $YPos = $this->YSize - (18 + (count($this->Errors)-1) * ($this->ErrorFontSize + 4)); - foreach($this->Errors as $key => $Value) - { - imagettftext($this->Picture,$this->ErrorFontSize,0,$this->XSize-($MaxWidth+15),$YPos,$C_TextColor,$this->ErrorFontName,$Value); - $YPos = $YPos + ($this->ErrorFontSize + 4); - } - } - } - - /* Activate the image map creation process */ - function setImageMap($Mode=TRUE,$GraphID="MyGraph") - { - $this->BuildMap = $Mode; - $this->MapID = $GraphID; - } - - /* Add a box into the image map */ - function addToImageMap($X1,$Y1,$X2,$Y2,$SerieName,$Value,$CallerFunction) - { - if ( $this->MapFunction == NULL || $this->MapFunction == $CallerFunction ) - { - $this->ImageMap[] = round($X1).",".round($Y1).",".round($X2).",".round($Y2).",".$SerieName.",".$Value; - $this->MapFunction = $CallerFunction; - } - } - - /* Load and cleanup the image map from disk */ - function getImageMap($MapName,$Flush=TRUE) - { - /* Strip HTML query strings */ - $Values = $this->tmpFolder.$MapName; - $Value = split("\?",$Values); - $FileName = $Value[0]; - - if ( file_exists($FileName) ) - { - $Handle = fopen($FileName, "r"); - $MapContent = fread($Handle, filesize($FileName)); - fclose($Handle); - echo $MapContent; - - if ( $Flush ) - unlink($FileName); - - exit(); - } - else - { - header("HTTP/1.0 404 Not Found"); - exit(); - } - } - - /* Save the image map to the disk */ - function SaveImageMap() - { - if ( !$this->BuildMap ) { return(-1); } - - if ( $this->ImageMap == NULL ) - { - $this->Errors[] = "[Warning] SaveImageMap - Image map is empty."; - return(-1); - } - - $Handle = fopen($this->tmpFolder.$this->MapID, 'w'); - if ( !$Handle ) - { - $this->Errors[] = "[Warning] SaveImageMap - Cannot save the image map."; - return(-1); - } - else - { - foreach($this->ImageMap as $Key => $Value) - fwrite($Handle, htmlentities($Value)."\r"); - } - fclose ($Handle); - } - - /* Convert seconds to a time format string */ - function ToTime($Value) - { - $Hour = floor($Value/3600); - $Minute = floor(($Value - $Hour*3600)/60); - $Second = floor($Value - $Hour*3600 - $Minute*60); - - if (strlen($Hour) == 1 ) { $Hour = "0".$Hour; } - if (strlen($Minute) == 1 ) { $Minute = "0".$Minute; } - if (strlen($Second) == 1 ) { $Second = "0".$Second; } - - return($Hour.":".$Minute.":".$Second); - } - - /* Convert to metric system */ - function ToMetric($Value) - { - $Go = floor($Value/1000000000); - $Mo = floor(($Value - $Go*1000000000)/1000000); - $Ko = floor(($Value - $Go*1000000000 - $Mo*1000000)/1000); - $o = floor($Value - $Go*1000000000 - $Mo*1000000 - $Ko*1000); - - if ($Go != 0) { return($Go.".".$Mo."g"); } - if ($Mo != 0) { return($Mo.".".$ko."m"); } - if ($Ko != 0) { return($Ko.".".$o)."k"; } - return($o); - } - - /* Convert to curency */ - function ToCurrency($Value) - { - $Go = floor($Value/1000000000); - $Mo = floor(($Value - $Go*1000000000)/1000000); - $Ko = floor(($Value - $Go*1000000000 - $Mo*1000000)/1000); - $o = floor($Value - $Go*1000000000 - $Mo*1000000 - $Ko*1000); - - if ( strlen($o) == 1 ) { $o = "00".$o; } - if ( strlen($o) == 2 ) { $o = "0".$o; } - - $ResultString = $o; - if ( $Ko != 0 ) { $ResultString = $Ko.".".$ResultString; } - if ( $Mo != 0 ) { $ResultString = $Mo.".".$ResultString; } - if ( $Go != 0 ) { $ResultString = $Go.".".$ResultString; } - - $ResultString = $this->Currency.$ResultString; - return($ResultString); - } - - /* Set date format for axis labels */ - function setDateFormat($Format) - { - $this->DateFormat = $Format; - } - - /* Convert TS to a date format string */ - function ToDate($Value) - { - return(date($this->DateFormat,$Value)); - } - - /* Check if a number is a full integer (for scaling) */ - function isRealInt($Value) - { - if ($Value == floor($Value)) - return(TRUE); - return(FALSE); - } - } - - function RaiseFatal($Message) - { - echo "[FATAL] ".$Message."\r\n"; - exit(); - } -?> \ No newline at end of file diff --git a/third_party/pchart/pChart/pData.class b/third_party/pchart/pChart/pData.class deleted file mode 100644 index 0c64bb1ad2..0000000000 --- a/third_party/pchart/pChart/pData.class +++ /dev/null @@ -1,266 +0,0 @@ -<?php - /* - pData - Simplifying data population for pChart - Copyright (C) 2008 Jean-Damien POGOLOTTI - Version 1.13 last updated on 08/17/08 - - http://pchart.sourceforge.net - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 1,2,3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - - Class initialisation : - pData() - Data populating methods : - ImportFromCSV($FileName,$Delimiter=",",$DataColumns=-1,$HasHeader=FALSE,$DataName=-1) - AddPoint($Value,$Serie="Serie1",$Description="") - Series manipulation methods : - AddSerie($SerieName="Serie1") - AddAllSeries() - RemoveSerie($SerieName="Serie1") - SetAbsciseLabelSerie($SerieName = "Name") - SetSerieName($Name,$SerieName="Serie1") - + SetSerieSymbol($Name,$Symbol) - SetXAxisName($Name="X Axis") - SetYAxisName($Name="Y Axis") - SetXAxisFormat($Format="number") - SetYAxisFormat($Format="number") - SetXAxisUnit($Unit="") - SetYAxisUnit($Unit="") - removeSerieName($SerieName) - removeAllSeries() - Data retrieval methods : - GetData() - GetDataDescription() - */ - - /* pData class definition */ - class pData - { - var $Data; - var $DataDescription; - - function pData() - { - $this->Data = array(); - $this->DataDescription = array(); - $this->DataDescription["Position"] = "Name"; - $this->DataDescription["Format"]["X"] = "number"; - $this->DataDescription["Format"]["Y"] = "number"; - $this->DataDescription["Unit"]["X"] = NULL; - $this->DataDescription["Unit"]["Y"] = NULL; - } - - function ImportFromCSV($FileName,$Delimiter=",",$DataColumns=-1,$HasHeader=FALSE,$DataName=-1) - { - $handle = @fopen($FileName,"r"); - if ($handle) - { - $HeaderParsed = FALSE; - while (!feof($handle)) - { - $buffer = fgets($handle, 4096); - $buffer = str_replace(chr(10),"",$buffer); - $buffer = str_replace(chr(13),"",$buffer); - $Values = split($Delimiter,$buffer); - - if ( $buffer != "" ) - { - if ( $HasHeader == TRUE && $HeaderParsed == FALSE ) - { - if ( $DataColumns == -1 ) - { - $ID = 1; - foreach($Values as $key => $Value) - { $this->SetSerieName($Value,"Serie".$ID); $ID++; } - } - else - { - $SerieName = ""; - - foreach($DataColumns as $key => $Value) - $this->SetSerieName($Values[$Value],"Serie".$Value); - } - $HeaderParsed = TRUE; - } - else - { - if ( $DataColumns == -1 ) - { - $ID = 1; - foreach($Values as $key => $Value) - { $this->AddPoint(intval($Value),"Serie".$ID); $ID++; } - } - else - { - $SerieName = ""; - if ( $DataName != -1 ) - $SerieName = $Values[$DataName]; - - foreach($DataColumns as $key => $Value) - $this->AddPoint($Values[$Value],"Serie".$Value,$SerieName); - } - } - } - } - fclose($handle); - } - } - - function AddPoint($Value,$Serie="Serie1",$Description="") - { - if (is_array($Value) && count($Value) == 1) - $Value = $Value[0]; - - $ID = 0; - for($i=0;$i<=count($this->Data);$i++) - { - // 20101008 - franciscom - added new check to avoid uninitalized E_NOTICE message - if(isset($this->Data[$i]) && isset($this->Data[$i][$Serie])) - { - $ID = $i+1; - } - } - - if ( count($Value) == 1 ) - { - $this->Data[$ID][$Serie] = $Value; - if ( $Description != "" ) - $this->Data[$ID]["Name"] = $Description; - elseif (!isset($this->Data[$ID]["Name"])) - $this->Data[$ID]["Name"] = $ID; - } - else - { - foreach($Value as $key => $Val) - { - $this->Data[$ID][$Serie] = $Val; - if (!isset($this->Data[$ID]["Name"])) - $this->Data[$ID]["Name"] = $ID; - $ID++; - } - } - } - - function AddSerie($SerieName="Serie1") - { - if ( !isset($this->DataDescription["Values"]) ) - { - $this->DataDescription["Values"][] = $SerieName; - } - else - { - $Found = FALSE; - foreach($this->DataDescription["Values"] as $key => $Value ) - if ( $Value == $SerieName ) { $Found = TRUE; } - - if ( !$Found ) - $this->DataDescription["Values"][] = $SerieName; - } - } - - function AddAllSeries() - { - unset($this->DataDescription["Values"]); - - if ( isset($this->Data[0]) ) - { - foreach($this->Data[0] as $Key => $Value) - { - if ( $Key != "Name" ) - $this->DataDescription["Values"][] = $Key; - } - } - } - - function RemoveSerie($SerieName="Serie1") - { - if ( !isset($this->DataDescription["Values"]) ) - return(0); - - $Found = FALSE; - foreach($this->DataDescription["Values"] as $key => $Value ) - { - if ( $Value == $SerieName ) - unset($this->DataDescription["Values"][$key]); - } - } - - function SetAbsciseLabelSerie($SerieName = "Name") - { - $this->DataDescription["Position"] = $SerieName; - } - - function SetSerieName($Name,$SerieName="Serie1") - { - $this->DataDescription["Description"][$SerieName] = $Name; - } - - function SetXAxisName($Name="X Axis") - { - $this->DataDescription["Axis"]["X"] = $Name; - } - - function SetYAxisName($Name="Y Axis") - { - $this->DataDescription["Axis"]["Y"] = $Name; - } - - function SetXAxisFormat($Format="number") - { - $this->DataDescription["Format"]["X"] = $Format; - } - - function SetYAxisFormat($Format="number") - { - $this->DataDescription["Format"]["Y"] = $Format; - } - - function SetXAxisUnit($Unit="") - { - $this->DataDescription["Unit"]["X"] = $Unit; - } - - function SetYAxisUnit($Unit="") - { - $this->DataDescription["Unit"]["Y"] = $Unit; - } - - function SetSerieSymbol($Name,$Symbol) - { - $this->DataDescription["Symbol"][$Name] = $Symbol; - } - - function removeSerieName($SerieName) - { - if ( isset($this->DataDescription["Description"][$SerieName]) ) - unset($this->DataDescription["Description"][$SerieName]); - } - - function removeAllSeries() - { - foreach($this->DataDescription["Values"] as $Key => $Value) - unset($this->DataDescription["Values"][$Key]); - } - - function GetData() - { - return($this->Data); - } - - function GetDataDescription() - { - return($this->DataDescription); - } - } -?> \ No newline at end of file diff --git a/third_party/user_contribution/reassign_tc_id.php b/third_party/user_contribution/reassign_tc_id.php index 22c96a26d9..690db4efb6 100644 --- a/third_party/user_contribution/reassign_tc_id.php +++ b/third_party/user_contribution/reassign_tc_id.php @@ -22,7 +22,7 @@ } -$tcase_mgr = new testcase($db); +$tcaseMgr = new testcase($db); $tproject_mgr = new testproject($db); $testProjects = $tproject_mgr->get_all(); diff --git a/third_party/xml-rpc/class-IXR.php b/third_party/xml-rpc/class-IXR.php index 1aaf0047cc..8eeee909e6 100644 --- a/third_party/xml-rpc/class-IXR.php +++ b/third_party/xml-rpc/class-IXR.php @@ -335,9 +335,11 @@ function call($methodname, $args) { } $method = $this->callbacks[$methodname]; // Perform the callback and send the response - if (count($args) == 1) { + if (!empty($args)) { + if (count($args) == 1) { // If only one paramater just send that instead of the whole array $args = $args[0]; + } } // Are we dealing with a function or a method? if (substr($method, 0, 5) == 'this:') { diff --git a/vendor/adodb/adodb-php/adodb-active-record.inc.php b/vendor/adodb/adodb-php/adodb-active-record.inc.php index ad40640a3a..08f7ca8d29 100644 --- a/vendor/adodb/adodb-php/adodb-active-record.inc.php +++ b/vendor/adodb/adodb-php/adodb-active-record.inc.php @@ -74,6 +74,7 @@ function ADODB_SetDatabaseAdapter(&$db, $index=false) } +#[\AllowDynamicProperties] class ADODB_Active_Record { static $_changeNames = true; // dynamically pluralize table names @@ -501,7 +502,8 @@ function UpdateActiveTable($pkeys=false,$forceUpdate=false) } break; default: - foreach($cols as $name => $fldobj) { + foreach($cols as $fldobj) { + $name = $fldobj->name; if ($ADODB_ACTIVE_DEFVALS && isset($fldobj->default_value)) { $this->$name = $fldobj->default_value; @@ -1054,10 +1056,10 @@ function Update() $valarr = array(); $neworig = array(); $pairs = array(); - $i = -1; + $i = 0; $cnt = 0; foreach($table->flds as $name=>$fld) { - $i += 1; + $orig = $this->_original[$i++] ?? null; $val = $this->$name; $neworig[] = $val; @@ -1077,11 +1079,7 @@ function Update() } } - if (isset($this->_original[$i]) && strcmp($val,$this->_original[$i]) == 0) { - continue; - } - - if (is_null($this->_original[$i]) && is_null($val)) { + if ($val === $orig) { continue; } diff --git a/vendor/adodb/adodb-php/adodb-active-recordx.inc.php b/vendor/adodb/adodb-php/adodb-active-recordx.inc.php index 5de5b13096..18e2a1893a 100644 --- a/vendor/adodb/adodb-php/adodb-active-recordx.inc.php +++ b/vendor/adodb/adodb-php/adodb-active-recordx.inc.php @@ -82,6 +82,7 @@ function ADODB_SetDatabaseAdapter(&$db) } +#[\AllowDynamicProperties] class ADODB_Active_Record { static $_changeNames = true; // dynamically pluralize table names static $_foreignSuffix = '_id'; // @@ -1142,10 +1143,10 @@ function Update() $valarr = array(); $neworig = array(); $pairs = array(); - $i = -1; + $i = 0; $cnt = 0; foreach($table->flds as $name=>$fld) { - $i += 1; + $orig = $this->_original[$i++] ?? null; $val = $this->$name; $neworig[] = $val; @@ -1165,7 +1166,7 @@ function Update() } } - if (isset($this->_original[$i]) && $val === $this->_original[$i]) { + if ($val === $orig) { continue; } $valarr[] = $val; diff --git a/vendor/adodb/adodb-php/adodb-csvlib.inc.php b/vendor/adodb/adodb-php/adodb-csvlib.inc.php index 77e63bfb06..87efd9406c 100644 --- a/vendor/adodb/adodb-php/adodb-csvlib.inc.php +++ b/vendor/adodb/adodb-php/adodb-csvlib.inc.php @@ -76,10 +76,10 @@ function _rs2serialize(&$rs,$conn=false,$sql='') $savefetch = isset($rs->adodbFetchMode) ? $rs->adodbFetchMode : $rs->fetchMode; $class = $rs->connection->arrayClass; - $rs2 = new $class(-1); // Dummy query Id + /** @var ADORecordSet $rs2 */ + $rs2 = new $class(ADORecordSet::DUMMY_QUERY_ID); $rs2->timeCreated = $rs->timeCreated; # memcache fix $rs2->sql = $rs->sql; - $rs2->oldProvider = $rs->dataProvider; $rs2->InitArrayFields($rows,$flds); $rs2->fetchMode = $savefetch; return $line.serialize($rs2); diff --git a/vendor/adodb/adodb-php/adodb-datadict.inc.php b/vendor/adodb/adodb-php/adodb-datadict.inc.php index 9dfa07a6fc..29f2120cba 100644 --- a/vendor/adodb/adodb-php/adodb-datadict.inc.php +++ b/vendor/adodb/adodb-php/adodb-datadict.inc.php @@ -202,6 +202,12 @@ class ADODB_DataDict { */ public $blobAllowsDefaultValue; + + /** + * @var string String to use to quote identifiers and names + */ + public $quote; + function getCommentSQL($table,$col) { return false; @@ -504,10 +510,12 @@ function addColumnSQL($tabname, $flds) * * As some DBMs can't do that on their own, you need to supply the complete definition of the new table, * to allow recreating the table and copying the content over to the new table - * @param string $tabname table-name - * @param string $flds column-name and type for the changed column - * @param string $tableflds='' complete definition of the new table, eg. for postgres, default '' + * + * @param string $tabname table-name + * @param array|string $flds column-name and type for the changed column + * @param string $tableflds='' complete definition of the new table, eg. for postgres, default '' * @param array|string $tableoptions='' options for the new table see createTableSQL, default '' + * * @return array with SQL strings */ function alterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') @@ -837,7 +845,7 @@ function _genFields($flds,$widespacing=false) $fdefault = $this->connection->qstr($fdefault); } } - $suffix = $this->_createSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned); + $suffix = $this->_createSuffix($fname, $ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, $pkey); // add index creation if ($widespacing) $fname = str_pad($fname,24); @@ -890,8 +898,22 @@ function _getSize($ftype, $ty, $fsize, $fprec, $options=false) } - // return string must begin with space - function _createSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + /** + * Construct an database specific SQL string of constraints for column. + * + * @param string $fname column name + * @param string & $ftype column type + * @param bool $fnotnull NOT NULL flag + * @param string|bool $fdefault DEFAULT value + * @param bool $fautoinc AUTOINCREMENT flag + * @param string $fconstraint CONSTRAINT value + * @param bool $funsigned UNSIGNED flag + * @param string|bool $fprimary PRIMARY value + * @param array & $pkey array of primary key column names + * + * @return string Combined constraint string, must start with a space + */ + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; @@ -1007,15 +1029,20 @@ function _getSizePrec($size) } /** - "Florian Buzin [ easywe ]" <florian.buzin#easywe.de> - - This function changes/adds new fields to your table. You don't - have to know if the col is new or not. It will check on its own. - */ + * This function changes/adds new fields to your table. + * + * You don't have to know if the col is new or not. It will check on its own. + * + * @param string $tablename + * @param string $flds + * @param string[] $tableoptions + * @param bool $dropOldFlds + * + * @return string[] Array of SQL Commands + */ function changeTableSQL($tablename, $flds, $tableoptions = false, $dropOldFlds=false) { global $ADODB_FETCH_MODE; - $save = $ADODB_FETCH_MODE; $ADODB_FETCH_MODE = ADODB_FETCH_ASSOC; if ($this->connection->fetchMode !== false) $savem = $this->connection->setFetchMode(false); @@ -1033,12 +1060,15 @@ function changeTableSQL($tablename, $flds, $tableoptions = false, $dropOldFlds=f return $this->createTableSQL($tablename, $flds, $tableoptions); } + $sql = []; if (is_array($flds)) { // Cycle through the update fields, comparing // existing fields to fields to update. // if the Metatype and size is exactly the // same, ignore - by Mark Newham $holdflds = array(); + $fields_to_add = []; + $fields_to_alter = []; foreach($flds as $k=>$v) { if ( isset($cols[$k]) && is_object($cols[$k]) ) { // If already not allowing nulls, then don't change @@ -1062,45 +1092,27 @@ function changeTableSQL($tablename, $flds, $tableoptions = false, $dropOldFlds=f if ($mt == 'X') $ml = $v['SIZE']; if (($mt != $v['TYPE']) || ($ml != $fsize || $sc != $fprec) || (isset($v['AUTOINCREMENT']) && $v['AUTOINCREMENT'] != $obj->auto_increment)) { $holdflds[$k] = $v; + $fields_to_alter[$k] = $v; } } else { + $fields_to_add[$k] = $v; $holdflds[$k] = $v; } } $flds = $holdflds; - } - - - // already exists, alter table instead - list($lines,$pkey,$idxs) = $this->_genFields($flds); - // genfields can return FALSE at times - if ($lines == null) $lines = array(); - $alter = 'ALTER TABLE ' . $this->tableName($tablename); - $sql = array(); - - foreach ( $lines as $id => $v ) { - if ( isset($cols[$id]) && is_object($cols[$id]) ) { - - $flds = lens_ParseArgs($v,','); - // We are trying to change the size of the field, if not allowed, simply ignore the request. - // $flds[1] holds the type, $flds[2] holds the size -postnuke addition - if ($flds && in_array(strtoupper(substr($flds[0][1],0,4)),$this->invalidResizeTypes4) - && (isset($flds[0][2]) && is_numeric($flds[0][2]))) { - if ($this->debug) ADOConnection::outp(sprintf("<h3>%s cannot be changed to %s currently</h3>", $flds[0][0], $flds[0][1])); - #echo "<h3>$this->alterCol cannot be changed to $flds currently</h3>"; - continue; - } - $sql[] = $alter . $this->alterCol . ' ' . $v; - } else { - $sql[] = $alter . $this->addCol . ' ' . $v; - } + $sql = array_merge( + $this->addColumnSQL($tablename, $fields_to_add), + $this->alterColumnSql($tablename, $fields_to_alter) + ); } if ($dropOldFlds) { - foreach ( $cols as $id => $v ) - if ( !isset($lines[$id]) ) - $sql[] = $alter . $this->dropCol . ' ' . $v->name; + foreach ($cols as $id => $v) { + if (!isset($lines[$id])) { + $sql[] = $this->dropColumnSQL($tablename, $flds); + } + } } return $sql; } diff --git a/vendor/adodb/adodb-php/adodb-errorhandler.inc.php b/vendor/adodb/adodb-php/adodb-errorhandler.inc.php index 0cd3f218b4..1d3b9e9e52 100644 --- a/vendor/adodb/adodb-php/adodb-errorhandler.inc.php +++ b/vendor/adodb/adodb-php/adodb-errorhandler.inc.php @@ -37,7 +37,14 @@ */ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) { - if (error_reporting() == 0) return; // obey @ protocol + // Do not throw if errors are suppressed by @ operator + // error_reporting() value for suppressed errors changed in PHP 8.0.0 + $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') + ? 0 + : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + if (error_reporting() == $suppressed) { + return; + } switch($fn) { case 'EXECUTE': $sql = $p1; diff --git a/vendor/adodb/adodb-php/adodb-errorpear.inc.php b/vendor/adodb/adodb-php/adodb-errorpear.inc.php index 2bb15947e8..7b173da84f 100644 --- a/vendor/adodb/adodb-php/adodb-errorpear.inc.php +++ b/vendor/adodb/adodb-php/adodb-errorpear.inc.php @@ -52,7 +52,15 @@ function ADODB_Error_PEAR($dbms, $fn, $errno, $errmsg, $p1=false, $p2=false) { global $ADODB_Last_PEAR_Error; - if (error_reporting() == 0) return; // obey @ protocol + // Do not throw if errors are suppressed by @ operator + // error_reporting() value for suppressed errors changed in PHP 8.0.0 + $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') + ? 0 + : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + if (error_reporting() == $suppressed) { + return; + } + switch($fn) { case 'EXECUTE': $sql = $p1; diff --git a/vendor/adodb/adodb-php/adodb-exceptions.inc.php b/vendor/adodb/adodb-php/adodb-exceptions.inc.php index 560286a184..e4fae817e7 100644 --- a/vendor/adodb/adodb-php/adodb-exceptions.inc.php +++ b/vendor/adodb/adodb-php/adodb-exceptions.inc.php @@ -30,6 +30,9 @@ class ADODB_Exception extends Exception { var $host = ''; var $database = ''; + /** @var string A message text. */ + var $msg = ''; + function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) { switch($fn) { @@ -78,10 +81,18 @@ function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) { -global $ADODB_EXCEPTION; + global $ADODB_EXCEPTION; + + // Do not throw if errors are suppressed by @ operator + // error_reporting() value for suppressed errors changed in PHP 8.0.0 + $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') + ? 0 + : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; + if (error_reporting() == $suppressed) { + return; + } + + $errfn = is_string($ADODB_EXCEPTION) ? $ADODB_EXCEPTION : 'ADODB_EXCEPTION'; - if (error_reporting() == 0) return; // obey @ protocol - if (is_string($ADODB_EXCEPTION)) $errfn = $ADODB_EXCEPTION; - else $errfn = 'ADODB_EXCEPTION'; throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); } diff --git a/vendor/adodb/adodb-php/adodb-lib.inc.php b/vendor/adodb/adodb-php/adodb-lib.inc.php index ced5e12619..46fa5ddf7e 100644 --- a/vendor/adodb/adodb-php/adodb-lib.inc.php +++ b/vendor/adodb/adodb-php/adodb-lib.inc.php @@ -27,44 +27,30 @@ global $ADODB_INCLUDED_LIB; $ADODB_INCLUDED_LIB = 1; +/** + * Strip the ORDER BY clause from the outer SELECT. + * + * @param string $sql + * + * @return string + */ function adodb_strip_order_by($sql) { - $rez = preg_match_all('/(\sORDER\s+BY\s(?:[^)](?!LIMIT))*)/is', $sql, $arr); - if ($arr) - { - $tmp = array_pop($arr); - $arr = [1=>array_pop($tmp)]; - } - if ($arr) - if (strpos($arr[1], '(') !== false) { - $at = strpos($sql, $arr[1]); - $cntin = 0; - for ($i=$at, $max=strlen($sql); $i < $max; $i++) { - $ch = $sql[$i]; - if ($ch == '(') { - $cntin += 1; - } elseif($ch == ')') { - $cntin -= 1; - if ($cntin < 0) { - break; - } - } - } - $sql = substr($sql,0,$at).substr($sql,$i); - } else { - $sql = str_replace($arr[1], '', $sql); + $num = preg_match_all('/(\sORDER\s+BY\s(?:[^)](?!LIMIT))*)/is', $sql, $matches, PREG_OFFSET_CAPTURE); + if ($num) { + // Get the last match + list($last_order_by, $offset) = array_pop($matches[1]); + + // If we find a ')' after the last order by, then it belongs to a + // sub-query, not the outer SQL statement and should not be stripped + if (strpos($sql, ')', $offset) === false) { + $sql = str_replace($last_order_by, '', $sql); } - + } return $sql; } -if (false) { - $sql = 'select * from (select a from b order by a(b),b(c) desc)'; - $sql = '(select * from abc order by 1)'; - die(adodb_strip_order_by($sql)); -} - -function adodb_probetypes(&$array,&$types,$probe=8) +function adodb_probetypes($array,&$types,$probe=8) { // probe and guess the type $types = array(); @@ -96,7 +82,7 @@ function adodb_probetypes(&$array,&$types,$probe=8) // that it is not an integer if (strlen($v) == 0) $types[$i] = 'C'; if (strpos($v,'.') !== false) $types[$i] = 'N'; - else $types[$i] = 'I'; + else $types[$i] = 'I'; continue; } @@ -107,7 +93,7 @@ function adodb_probetypes(&$array,&$types,$probe=8) } -function adodb_transpose(&$arr, &$newarr, &$hdr, &$fobjs) +function adodb_transpose(&$arr, &$newarr, &$hdr, $fobjs) { $oldX = sizeof(reset($arr)); $oldY = sizeof($arr); @@ -135,7 +121,7 @@ function adodb_transpose(&$arr, &$newarr, &$hdr, &$fobjs) } -function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_autoinc) +function _adodb_replace($zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_autoinc) { // Add Quote around table name to support use of spaces / reserved keywords $table=sprintf('%s%s%s', $zthis->nameQuote,$table,$zthis->nameQuote); @@ -209,7 +195,7 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_ return ($rs) ? 2 : 0; } -function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, +function _adodb_getmenu($zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, $size=0, $selectAttr='',$compareFields0=true) { global $ADODB_FETCH_MODE; @@ -242,6 +228,7 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f $value = 'value="' . htmlspecialchars($zval2) . '"'; } + /** @noinspection PhpUndefinedVariableInspection */ $s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval); $zthis->MoveNext(); @@ -250,7 +237,7 @@ function _adodb_getmenu(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=f return $s ."\n</select>\n"; } -function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, +function _adodb_getmenu_gp($zthis, $name,$defstr='',$blank1stItem=true,$multiple=false, $size=0, $selectAttr='',$compareFields0=true) { global $ADODB_FETCH_MODE; @@ -304,6 +291,7 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl $s .="\n<optgroup label='". htmlspecialchars($group) ."'>"; } + /** @noinspection PhpUndefinedVariableInspection */ $s .= _adodb_getmenu_option($defstr, $compareFields0 ? $zval : $zval2, $value, $zval); $zthis->MoveNext(); @@ -349,7 +337,7 @@ function _adodb_getmenu_select($name, $defstr = '', $blank1stItem = true, $html = '<select name="' . $name . '"' . $attr . ' ' . $selectAttr . '>'; if ($blank1stItem) { - if (is_string($blank1stItem)) { + if (is_string($blank1stItem)) { $barr = explode(':',$blank1stItem); if (sizeof($barr) == 1) { $barr[] = ''; @@ -378,7 +366,7 @@ function _adodb_getmenu_select($name, $defstr = '', $blank1stItem = true, function _adodb_getmenu_option($defstr, $compare, $value, $display) { if ( is_array($defstr) && in_array($compare, $defstr) - || !is_array($defstr) && strcasecmp($compare, $defstr) == 0 + || !is_array($defstr) && strcasecmp($compare, $defstr ?? '') == 0 ) { $selected = ' selected="selected"'; } else { @@ -388,19 +376,24 @@ function _adodb_getmenu_option($defstr, $compare, $value, $display) return "\n<option $value$selected>" . htmlspecialchars($display) . '</option>'; } -/* - Count the number of records this sql statement will return by using - query rewriting heuristics... - - Does not work with UNIONs, except with postgresql and oracle. - - Usage: - - $conn->Connect(...); - $cnt = _adodb_getcount($conn, $sql); - -*/ -function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) +/** + * Count the number of records this sql statement will return by using + * query rewriting heuristics... + * + * Does not work with UNIONs, except with postgresql and oracle. + * + * Usage: + * $conn->Connect(...); + * $cnt = _adodb_getcount($conn, $sql); + * + * @param ADOConnection $zthis + * @param string $sql + * @param bool $inputarr + * @param int $secs2cache + * + * @return false|int|mixed + */ +function _adodb_getcount($zthis, $sql,$inputarr=false,$secs2cache=0) { $qryRecs = 0; @@ -456,7 +449,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) continue; } // Exit loop if 'FROM' keyword was found - if (strtoupper(substr($sql, $pos, 4)) == 'FROM') { + if (strtoupper(substr($sql, $pos, 4)) == 'FROM') { break; } } @@ -491,7 +484,7 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) if (preg_match('/\s*UNION\s*/is', $sql)) { $rewritesql = $sql; } else { - $rewritesql = $rewritesql = adodb_strip_order_by($sql); + $rewritesql = adodb_strip_order_by($sql); } if (preg_match('/\sLIMIT\s+[0-9]+/i',$sql,$limitarr)) { @@ -520,37 +513,38 @@ function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0) return $qryRecs; } -/* - Code originally from "Cornel G" <conyg@fx.ro> - - This code might not work with SQL that has UNION in it - - Also if you are using CachePageExecute(), there is a strong possibility that - data will get out of synch. use CachePageExecute() only with tables that - rarely change. -*/ -function _adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, - $inputarr=false, $secs2cache=0) +/** + * Execute query with pagination including record count. + * + * This code might not work with SQL that has UNION in it. + * Also if you are using cachePageExecute(), there is a strong possibility that + * data will get out of sync. cachePageExecute() should only be used with + * tables that rarely change. + * + * @param ADOConnection $zthis Connection + * @param string $sql Query to execute + * @param int $nrows Number of rows per page + * @param int $page Page number to retrieve (1-based) + * @param array $inputarr Array of bind variables + * @param int $secs2cache Time-to-live of the cache (in seconds), 0 to force query execution + * + * @return ADORecordSet|bool + * + * @author Cornel G <conyg@fx.ro> + */ +function _adodb_pageexecute_all_rows($zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) { $atfirstpage = false; $atlastpage = false; - $lastpageno=1; - // If an invalid nrows is supplied, - // we assume a default value of 10 rows per page + // If an invalid nrows is supplied, assume a default value of 10 rows per page if (!isset($nrows) || $nrows <= 0) $nrows = 10; - $qryRecs = false; //count records for no offset - $qryRecs = _adodb_getcount($zthis,$sql,$inputarr,$secs2cache); $lastpageno = (int) ceil($qryRecs / $nrows); - $zthis->_maxRecordCount = $qryRecs; - - - // ***** Here we check whether $page is the last page or - // whether we are trying to retrieve - // a page number greater than the last page number. + // Check whether $page is the last page or if we are trying to retrieve + // a page number greater than the last one. if ($page >= $lastpageno) { $page = $lastpageno; $atlastpage = true; @@ -582,10 +576,27 @@ function _adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page, return $rsreturn; } -// Iván Oliva version -function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) +/** + * Execute query with pagination without last page information. + * + * This code might not work with SQL that has UNION in it. + * Also if you are using cachePageExecute(), there is a strong possibility that + * data will get out of sync. cachePageExecute() should only be used with + * tables that rarely change. + * + * @param ADOConnection $zthis Connection + * @param string $sql Query to execute + * @param int $nrows Number of rows per page + * @param int $page Page number to retrieve (1-based) + * @param array $inputarr Array of bind variables + * @param int $secs2cache Time-to-live of the cache (in seconds), 0 to force query execution + * + * @return ADORecordSet|bool + * + * @author Iván Oliva + */ +function _adodb_pageexecute_no_last_page($zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) { - $atfirstpage = false; $atlastpage = false; @@ -623,7 +634,6 @@ function _adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr // page and return it. Revert to original method and loop through pages // until we find some data... $pagecounter = $page + 1; - $pagecounteroffset = ($pagecounter * $nrows) - $nrows; $rstest = $rsreturn; if ($rstest) { @@ -715,7 +725,7 @@ function _adodb_quote_fieldname($zthis, $fieldName) } } -function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $force=2) +function _adodb_getupdatesql(&$zthis, $rs, $arrFields, $forceUpdate=false, $force=2) { if (!$rs) { printf(ADODB_BAD_RS,'GetUpdateSQL'); @@ -746,11 +756,11 @@ function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $for if ($hasnumeric) $val = $rs->fields[$i]; else if (isset($rs->fields[$upperfname])) $val = $rs->fields[$upperfname]; - else if (isset($rs->fields[$field->name])) $val = $rs->fields[$field->name]; - else if (isset($rs->fields[strtolower($upperfname)])) $val = $rs->fields[strtolower($upperfname)]; + else if (isset($rs->fields[$field->name])) $val = $rs->fields[$field->name]; + else if (isset($rs->fields[strtolower($upperfname)])) $val = $rs->fields[strtolower($upperfname)]; else $val = ''; - if ($forceUpdate || strcmp($val, $arrFields[$upperfname])) { + if ($forceUpdate || $val !== $arrFields[$upperfname]) { // Set the counter for the number of fields that will be updated. $fieldUpdatedCount++; @@ -840,7 +850,6 @@ function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $for $discard = false; // not a good hack, improvements? if ($whereClause) { - #var_dump($whereClause); if (preg_match('/\s(ORDER\s.*)/is', $whereClause[1], $discard)); else if (preg_match('/\s(LIMIT\s.*)/is', $whereClause[1], $discard)); else if (preg_match('/\s(FOR UPDATE.*)/is', $whereClause[1], $discard)); @@ -863,14 +872,14 @@ function _adodb_getupdatesql(&$zthis, &$rs, $arrFields, $forceUpdate=false, $for } } -function adodb_key_exists($key, &$arr,$force=2) +function adodb_key_exists($key, $arr,$force=2) { if ($force<=0) { // the following is the old behaviour where null or empty fields are ignored return (!empty($arr[$key])) || (isset($arr[$key]) && strlen($arr[$key])>0); } - if (isset($arr[$key])) + if (isset($arr[$key])) return true; ## null check below return array_key_exists($key,$arr); @@ -883,7 +892,7 @@ function adodb_key_exists($key, &$arr,$force=2) * * */ -function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) +function _adodb_getinsertsql(&$zthis, $rs, $arrFields, $force=2) { static $cacheRS = false; static $cacheSig = 0; @@ -892,7 +901,6 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) $tableName = ''; $values = ''; $fields = ''; - $recordSet = null; if (is_array($arrFields)) $arrFields = array_change_key_case($arrFields,CASE_UPPER); $fieldInsertedCount = 0; @@ -906,7 +914,7 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) //because we have to call MetaType. //php can't do a $rsclass::MetaType() $rsclass = $zthis->rsPrefix.$zthis->databaseType; - $recordSet = new $rsclass(-1,$zthis->fetchMode); + $recordSet = new $rsclass(ADORecordSet::DUMMY_QUERY_ID, $zthis->fetchMode); $recordSet->connection = $zthis; if (is_string($cacheRS) && $cacheRS == $rs) { @@ -920,6 +928,7 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) if (isset($rs->insertSig) && is_integer($cacheRS) && $cacheRS == $rs->insertSig) { $columns = $cacheCols; } else { + $columns = []; for ($i=0, $max=$rs->FieldCount(); $i < $max; $i++) $columns[] = $rs->FetchField($i); $cacheRS = $cacheSig; @@ -936,60 +945,58 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) // Loop through all of the fields in the recordset foreach( $columns as $field ) { $upperfname = strtoupper($field->name); - if (adodb_key_exists($upperfname,$arrFields,$force)) { + if (adodb_key_exists($upperfname, $arrFields, $force)) { $bad = false; $fnameq = _adodb_quote_fieldname($zthis, $field->name); $type = $recordSet->MetaType($field->type); - /********************************************************/ - if (is_null($arrFields[$upperfname]) - || (empty($arrFields[$upperfname]) && strlen($arrFields[$upperfname]) == 0) - || $arrFields[$upperfname] === $zthis->null2null - ) - { - switch ($force) { + /********************************************************/ + if (is_null($arrFields[$upperfname]) + || (empty($arrFields[$upperfname]) && strlen($arrFields[$upperfname]) == 0) + || $arrFields[$upperfname] === $zthis->null2null + ) { + switch ($force) { - case ADODB_FORCE_IGNORE: // we must always set null if missing - $bad = true; - break; + case ADODB_FORCE_IGNORE: // we must always set null if missing + $bad = true; + break; + + case ADODB_FORCE_NULL: + $values .= "null, "; + break; - case ADODB_FORCE_NULL: - $values .= "null, "; - break; + case ADODB_FORCE_EMPTY: + //Set empty + $arrFields[$upperfname] = ""; + $values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq, $arrFields); + break; - case ADODB_FORCE_EMPTY: - //Set empty - $arrFields[$upperfname] = ""; + default: + case ADODB_FORCE_VALUE: + //Set the value that was given in array, so you can give both null and empty values + if (is_null($arrFields[$upperfname]) || $arrFields[$upperfname] === $zthis->null2null) { + $values .= "null, "; + } else { $values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq, $arrFields); - break; - - default: - case ADODB_FORCE_VALUE: - //Set the value that was given in array, so you can give both null and empty values - if (is_null($arrFields[$upperfname]) || $arrFields[$upperfname] === $zthis->null2null) { - $values .= "null, "; - } else { - $values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq, $arrFields); - } - break; + } + break; - case ADODB_FORCE_NULL_AND_ZERO: - switch ($type) - { - case 'N': - case 'I': - case 'L': - $values .= '0, '; - break; - default: - $values .= "null, "; - break; - } + case ADODB_FORCE_NULL_AND_ZERO: + switch ($type) { + case 'N': + case 'I': + case 'L': + $values .= '0, '; + break; + default: + $values .= "null, "; + break; + } break; - } // switch + } // switch - /*********************************************************/ + /*********************************************************/ } else { //we do this so each driver can customize the sql for //DB specific column types. @@ -998,11 +1005,12 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) $values .= _adodb_column_sql($zthis, 'I', $type, $upperfname, $fnameq, $arrFields); } - if ($bad) continue; + if ($bad) { + continue; + } // Set the counter for the number of fields that will be inserted. $fieldInsertedCount++; - // Get the name of the fields to insert $fields .= $fnameq . ", "; } @@ -1010,7 +1018,7 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) // If there were any inserted fields then build the rest of the insert query. - if ($fieldInsertedCount <= 0) return false; + if ($fieldInsertedCount <= 0) return false; // Get the table name from the existing query. if (!$tableName) { @@ -1048,76 +1056,76 @@ function _adodb_getinsertsql(&$zthis, &$rs, $arrFields, $force=2) */ function _adodb_column_sql_oci8(&$zthis,$action, $type, $fname, $fnameq, $arrFields) { - $sql = ''; - - // Based on the datatype of the field - // Format the value properly for the database - switch($type) { - case 'B': - //in order to handle Blobs correctly, we need - //to do some magic for Oracle - - //we need to create a new descriptor to handle - //this properly - if (!empty($zthis->hasReturningInto)) { - if ($action == 'I') { - $sql = 'empty_blob(), '; - } else { - $sql = $fnameq. '=empty_blob(), '; - } - //add the variable to the returning clause array - //so the user can build this later in - //case they want to add more to it - $zthis->_returningArray[$fname] = ':xx'.$fname.'xx'; - } else if (empty($arrFields[$fname])){ - if ($action == 'I') { - $sql = 'empty_blob(), '; - } else { - $sql = $fnameq. '=empty_blob(), '; - } - } else { - //this is to maintain compatibility - //with older adodb versions. - $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); - } - break; - - case "X": - //we need to do some more magic here for long variables - //to handle these correctly in oracle. - - //create a safe bind var name - //to avoid conflicts w/ dupes. - if (!empty($zthis->hasReturningInto)) { - if ($action == 'I') { - $sql = ':xx'.$fname.'xx, '; - } else { - $sql = $fnameq.'=:xx'.$fname.'xx, '; - } - //add the variable to the returning clause array - //so the user can build this later in - //case they want to add more to it - $zthis->_returningArray[$fname] = ':xx'.$fname.'xx'; - } else { - //this is to maintain compatibility - //with older adodb versions. - $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); - } - break; + // Based on the datatype of the field + // Format the value properly for the database + switch ($type) { + case 'B': + //in order to handle Blobs correctly, we need + //to do some magic for Oracle + + //we need to create a new descriptor to handle + //this properly + if (!empty($zthis->hasReturningInto)) { + if ($action == 'I') { + $sql = 'empty_blob(), '; + } else { + $sql = $fnameq . '=empty_blob(), '; + } + //add the variable to the returning clause array + //so the user can build this later in + //case they want to add more to it + $zthis->_returningArray[$fname] = ':xx' . $fname . 'xx'; + } else { + if (empty($arrFields[$fname])) { + if ($action == 'I') { + $sql = 'empty_blob(), '; + } else { + $sql = $fnameq . '=empty_blob(), '; + } + } else { + //this is to maintain compatibility + //with older adodb versions. + $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); + } + } + break; + + case "X": + //we need to do some more magic here for long variables + //to handle these correctly in oracle. + + //create a safe bind var name + //to avoid conflicts w/ dupes. + if (!empty($zthis->hasReturningInto)) { + if ($action == 'I') { + $sql = ':xx' . $fname . 'xx, '; + } else { + $sql = $fnameq . '=:xx' . $fname . 'xx, '; + } + //add the variable to the returning clause array + //so the user can build this later in + //case they want to add more to it + $zthis->_returningArray[$fname] = ':xx' . $fname . 'xx'; + } else { + //this is to maintain compatibility + //with older adodb versions. + $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); + } + break; - default: - $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); - break; - } + default: + $sql = _adodb_column_sql($zthis, $action, $type, $fname, $fnameq, $arrFields, false); + break; + } - return $sql; + return $sql; } function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields, $recurse=true) { if ($recurse) { - switch($zthis->dataProvider) { + switch($zthis->dataProvider) { case 'postgres': if ($type == 'L') $type = 'C'; break; @@ -1143,15 +1151,15 @@ function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields, break; case "N": - $val = $arrFields[$fname]; + $val = $arrFields[$fname]; if (!is_numeric($val)) $val = str_replace(',', '.', (float)$val); - break; + break; case "I": case "R": - $val = $arrFields[$fname]; + $val = $arrFields[$fname]; if (!is_numeric($val)) $val = (integer) $val; - break; + break; default: $val = str_replace(array("'"," ","("),"",$arrFields[$fname]); // basic sql injection defence @@ -1161,178 +1169,225 @@ function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields, if ($action == 'I') return $val . ", "; - return $fnameq . "=" . $val . ", "; + return $fnameq . "=" . $val . ", "; } - -function _adodb_debug_execute(&$zthis, $sql, $inputarr) +/** +* Replaces standard _execute when debug mode is enabled +* +* @param ADOConnection $zthis An ADOConnection object +* @param string|string[] $sql A string or array of SQL statements +* @param string[]|null $inputarr An optional array of bind parameters +* +* @return handle|void A handle to the executed query +*/ +function _adodb_debug_execute($zthis, $sql, $inputarr) { + // Unpack the bind parameters $ss = ''; if ($inputarr) { - foreach($inputarr as $kk=>$vv) { - if (is_string($vv) && strlen($vv)>64) $vv = substr($vv,0,64).'...'; - if (is_null($vv)) $ss .= "($kk=>null) "; - else - { - if (is_array($vv)) - { - $vv = sprintf("Array Of Values: [%s]", implode(',',$vv)); + foreach ($inputarr as $kk => $vv) { + if (is_string($vv) && strlen($vv) > 64) { + $vv = substr($vv, 0, 64) . '...'; + } + if (is_null($vv)) { + $ss .= "($kk=>null) "; + } else { + if (is_array($vv)) { + $vv = sprintf("Array Of Values: [%s]", implode(',', $vv)); } $ss .= "($kk=>'$vv') "; } } - $ss = "[ $ss ]"; } + $sqlTxt = is_array($sql) ? $sql[0] : $sql; - /*str_replace(', ','##1#__^LF',is_array($sql) ? $sql[0] : $sql); - $sqlTxt = str_replace(',',', ',$sqlTxt); - $sqlTxt = str_replace('##1#__^LF', ', ' ,$sqlTxt); - */ + + // Remove newlines and tabs, compress repeating spaces + $sqlTxt = preg_replace('/\s+/', ' ', $sqlTxt); + // check if running from browser or command-line $inBrowser = isset($_SERVER['HTTP_USER_AGENT']); - $dbt = $zthis->databaseType; - if (isset($zthis->dsnType)) $dbt .= '-'.$zthis->dsnType; + $myDatabaseType = $zthis->databaseType; + if (!isset($zthis->dsnType)) { + // Append the PDO driver name + $myDatabaseType .= '-' . $zthis->dsnType; + } + if ($inBrowser) { if ($ss) { - $ss = '<code>'.htmlspecialchars($ss).'</code>'; + // Default formatting for passed parameter + $ss = sprintf('<code class="adodb-debug">%s</code>', htmlspecialchars($ss)); + } + if ($zthis->debug === -1) { + $outString = "<br class='adodb-debug'>(%s): %s &nbsp; %s<br class='adodb-debug'>"; + ADOConnection::outp(sprintf($outString, $myDatabaseType, htmlspecialchars($sqlTxt), $ss), false); + } elseif ($zthis->debug !== -99) { + $outString = "<hr class='adodb-debug'>(%s): %s &nbsp; %s<hr class='adodb-debug'>"; + ADOConnection::outp(sprintf($outString, $myDatabaseType, htmlspecialchars($sqlTxt), $ss), false); } - if ($zthis->debug === -1) - ADOConnection::outp( "<br>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<br>\n",false); - else if ($zthis->debug !== -99) - ADOConnection::outp( "<hr>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<hr>\n",false); } else { - $ss = "\n ".$ss; - if ($zthis->debug !== -99) - ADOConnection::outp("-----<hr>\n($dbt): ".$sqlTxt." $ss\n-----<hr>\n",false); + // CLI output + if ($zthis->debug !== -99) { + $outString = sprintf("%s\n%s\n %s %s \n%s\n", str_repeat('-', 78), $myDatabaseType, $sqlTxt, $ss, str_repeat('-', 78)); + ADOConnection::outp($outString, false); + } } - $qID = $zthis->_query($sql,$inputarr); + // Now execute the query + $qID = $zthis->_query($sql, $inputarr); - /* - Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql - because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion - */ + // Alexios Fakios notes that ErrorMsg() must be called before ErrorNo() for mssql + // because ErrorNo() calls Execute('SELECT @ERROR'), causing recursion if ($zthis->databaseType == 'mssql') { - // ErrorNo is a slow function call in mssql, and not reliable in PHP 4.0.6 - - if($emsg = $zthis->ErrorMsg()) { + // ErrorNo is a slow function call in mssql + if ($emsg = $zthis->ErrorMsg()) { if ($err = $zthis->ErrorNo()) { - if ($zthis->debug === -99) - ADOConnection::outp( "<hr>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<hr>\n",false); + if ($zthis->debug === -99) { + ADOConnection::outp("<hr>\n($myDatabaseType): " . htmlspecialchars($sqlTxt) . " &nbsp; $ss\n<hr>\n", false); + } - ADOConnection::outp($err.': '.$emsg); + ADOConnection::outp($err . ': ' . $emsg); } } - } else if (!$qID) { - - if ($zthis->debug === -99) - if ($inBrowser) ADOConnection::outp( "<hr>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<hr>\n",false); - else ADOConnection::outp("-----<hr>\n($dbt): ".$sqlTxt."$ss\n-----<hr>\n",false); + } else { + if (!$qID) { + // Statement execution has failed + if ($zthis->debug === -99) { + if ($inBrowser) { + $outString = "<hr class='adodb-debug'>(%s): %s &nbsp; %s<hr class='adodb-debug'>"; + ADOConnection::outp(sprintf($outString, $myDatabaseType, htmlspecialchars($sqlTxt), $ss), false); + } else { + $outString = sprintf("%s\n%s\n %s %s \n%s\n",str_repeat('-',78),$myDatabaseType,$sqlTxt,$ss,str_repeat('-',78)); + ADOConnection::outp($outString, false); + } + } - ADOConnection::outp($zthis->ErrorNo() .': '. $zthis->ErrorMsg()); + // Send last error to output + $errno = $zthis->ErrorNo(); + if ($errno) { + ADOConnection::outp($errno . ': ' . $zthis->ErrorMsg()); + } + } } - if ($zthis->debug === 99) _adodb_backtrace(true,9999,2); + if ($qID === false || $zthis->debug === 99) { + _adodb_backtrace(); + } return $qID; } -# pretty print the debug_backtrace function -function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0,$ishtml=null) +/** + * Pretty print the debug_backtrace function + * + * @param string[]|bool $printOrArr Whether to print the result directly or return the result + * @param int $maximumDepth The maximum depth of the array to traverse + * @param int $elementsToIgnore The backtrace array indexes to ignore + * @param null|bool $ishtml True if we are in a CGI environment, false for CLI, + * null to auto detect + * + * @return string Formatted backtrace + */ +function _adodb_backtrace($printOrArr=true, $maximumDepth=9999, $elementsToIgnore=0, $ishtml=null) { - if (!function_exists('debug_backtrace')) return ''; + if (!function_exists('debug_backtrace')) { + return ''; + } - if ($ishtml === null) $html = (isset($_SERVER['HTTP_USER_AGENT'])); - else $html = $ishtml; + if ($ishtml === null) { + // Auto determine if we in a CGI enviroment + $html = (isset($_SERVER['HTTP_USER_AGENT'])); + } else { + $html = $ishtml; + } - $fmt = ($html) ? "</font><font color=#808080 size=-1> %% line %4d, file: <a href=\"file:/%s\">%s</a></font>" : "%% line %4d, file: %s"; + $cgiString = "</font><font color=#808080 size=-1> %% line %4d, file: <a href=\"file:/%s\">%s</a></font>"; + $cliString = "%% line %4d, file: %s"; + $fmt = ($html) ? $cgiString : $cliString; $MAXSTRLEN = 128; $s = ($html) ? '<pre align=left>' : ''; - if (is_array($printOrArr)) $traceArr = $printOrArr; - else $traceArr = debug_backtrace(); + if (is_array($printOrArr)) { + $traceArr = $printOrArr; + } else { + $traceArr = debug_backtrace(); + } + + // Remove first 2 elements that just show calls to adodb_backtrace array_shift($traceArr); array_shift($traceArr); - $tabs = sizeof($traceArr)-2; + + // We want last element to have no indent + $tabs = sizeof($traceArr) - 1; foreach ($traceArr as $arr) { - if ($skippy) {$skippy -= 1; continue;} - $levels -= 1; - if ($levels < 0) break; + if ($elementsToIgnore) { + // Ignore array element at start of array + $elementsToIgnore--; + $tabs--; + continue; + } + $maximumDepth--; + if ($maximumDepth < 0) { + break; + } $args = array(); - for ($i=0; $i < $tabs; $i++) $s .= ($html) ? ' &nbsp; ' : "\t"; - $tabs -= 1; - if ($html) $s .= '<font face="Courier New,Courier">'; - if (isset($arr['class'])) $s .= $arr['class'].'.'; - if (isset($arr['args'])) - foreach($arr['args'] as $v) { - if (is_null($v)) $args[] = 'null'; - else if (is_array($v)) $args[] = 'Array['.sizeof($v).']'; - else if (is_object($v)) $args[] = 'Object:'.get_class($v); - else if (is_bool($v)) $args[] = $v ? 'true' : 'false'; - else { - $v = (string) @$v; - $str = htmlspecialchars(str_replace(array("\r","\n"),' ',substr($v,0,$MAXSTRLEN))); - if (strlen($v) > $MAXSTRLEN) $str .= '...'; - $args[] = $str; - } + + if ($tabs) { + $s .= str_repeat($html ? ' &nbsp; ' : "\t", $tabs); + $tabs--; + } + if ($html) { + $s .= '<font face="Courier New,Courier">'; } - $s .= $arr['function'].'('.implode(', ',$args).')'; + if (isset($arr['class'])) { + $s .= $arr['class'] . '.'; + } - $s .= @sprintf($fmt, $arr['line'],$arr['file'],basename($arr['file'])); + if (isset($arr['args'])) { + foreach ($arr['args'] as $v) { + if (is_null($v)) { + $args[] = 'null'; + } elseif (is_array($v)) { + $args[] = 'Array[' . sizeof($v) . ']'; + } elseif (is_object($v)) { + $args[] = 'Object:' . get_class($v); + } elseif (is_bool($v)) { + $args[] = $v ? 'true' : 'false'; + } else { + $v = (string)@$v; + // Truncate + $v = substr($v, 0, $MAXSTRLEN); + // Remove newlines and tabs, compress repeating spaces + $v = preg_replace('/\s+/', ' ', $v); + // Convert htmlchars (not sure why we do this in CLI) + $str = htmlspecialchars($v); + + if (strlen($v) > $MAXSTRLEN) { + $str .= '...'; + } + $args[] = $str; + } + } + } + $s .= $arr['function'] . '(' . implode(', ', $args) . ')'; + $s .= @sprintf($fmt, $arr['line'], $arr['file'], basename($arr['file'])); $s .= "\n"; } - if ($html) $s .= '</pre>'; - if ($printOrArr) print $s; + if ($html) { + $s .= '</pre>'; + } + if ($printOrArr) { + ADOConnection::outp($s); + } return $s; } -/* -function _adodb_find_from($sql) -{ - - $sql = str_replace(array("\n","\r"), ' ', $sql); - $charCount = strlen($sql); - - $inString = false; - $quote = ''; - $parentheseCount = 0; - $prevChars = ''; - $nextChars = ''; - - - for($i = 0; $i < $charCount; $i++) { - - $char = substr($sql,$i,1); - $prevChars = substr($sql,0,$i); - $nextChars = substr($sql,$i+1); - - if((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === false) { - $quote = $char; - $inString = true; - } - - elseif((($char == "'" || $char == '"' || $char == '`') && substr($prevChars,-1,1) != '\\') && $inString === true && $quote == $char) { - $quote = ""; - $inString = false; - } - - elseif($char == "(" && $inString === false) - $parentheseCount++; - - elseif($char == ")" && $inString === false && $parentheseCount > 0) - $parentheseCount--; - - elseif($parentheseCount <= 0 && $inString === false && $char == " " && strtoupper(substr($prevChars,-5,5)) == " FROM") - return $i; - - } -} -*/ diff --git a/vendor/adodb/adodb-php/adodb-loadbalancer.inc.php b/vendor/adodb/adodb-php/adodb-loadbalancer.inc.php index 88f5d0fdc2..de067805b5 100644 --- a/vendor/adodb/adodb-php/adodb-loadbalancer.inc.php +++ b/vendor/adodb/adodb-php/adodb-loadbalancer.inc.php @@ -38,17 +38,17 @@ class ADOdbLoadBalancer /** * @var bool|array All connections to each database. */ - protected $connections = false; + protected $connections = []; /** * @var bool|array Just connections to the write capable database. */ - protected $connections_write = false; + protected $connections_write = []; /** * @var bool|array Just connections to the readonly database. */ - protected $connections_readonly = false; + protected $connections_readonly = []; /** * @var array Counts of all connections and their types. @@ -73,12 +73,12 @@ class ADOdbLoadBalancer /** * @var bool Session variables that must be maintained across all connections, ie: SET TIME ZONE. */ - protected $session_variables = false; + protected $session_variables = []; /** * @var bool Called immediately after connecting to any DB. */ - protected $user_defined_session_init_sql = false; + protected $user_defined_session_init_sql = []; /** @@ -403,7 +403,7 @@ public function setSessionVariable($name, $value, $execute_immediately = true) */ private function executeSessionVariables($adodb_obj = false) { - if (is_array($this->session_variables)) { + if (is_array($this->session_variables) && count($this->session_variables) > 0) { $sql = ''; foreach ($this->session_variables as $name => $value) { // $sql .= 'SET SESSION '. $name .' '. $value; diff --git a/vendor/adodb/adodb-php/adodb-perf.inc.php b/vendor/adodb/adodb-php/adodb-perf.inc.php index d9d8a99378..9161053654 100644 --- a/vendor/adodb/adodb-php/adodb-perf.inc.php +++ b/vendor/adodb/adodb-php/adodb-perf.inc.php @@ -237,6 +237,9 @@ class adodb_perf { var $createTableSQL = false; var $maxLength = 2000; + /** @var array Settings data. */ + var $settings = []; + // Sets the tablename to be used static function table($newtable = false) { @@ -1014,7 +1017,7 @@ function SplitSQL($sql) * <code>ADODB_OPT_LOW</code> for CPU-less optimization * Default is LOW <code>ADODB_OPT_LOW</code> * @author Markus Staab - * @return Returns <code>true</code> on success and <code>false</code> on error + * @return bool true on success, false on error */ function OptimizeTables() { @@ -1045,7 +1048,7 @@ function OptimizeTables() * <code>ADODB_OPT_LOW</code> for CPU-less optimization * Default is LOW <code>ADODB_OPT_LOW</code> * @author Markus Staab - * @return Returns <code>true</code> on success and <code>false</code> on error + * @return bool true on success, false on error */ function OptimizeTable( $table, $mode = ADODB_OPT_LOW) { @@ -1059,7 +1062,7 @@ function OptimizeTable( $table, $mode = ADODB_OPT_LOW) * optimize each using <code>optmizeTable()</code> * * @author Markus Staab - * @return Returns <code>true</code> on success and <code>false</code> on error + * @return bool true on success, false on error */ function optimizeDatabase() { diff --git a/vendor/adodb/adodb-php/adodb-time.inc.php b/vendor/adodb/adodb-php/adodb-time.inc.php index cfbdc6a5ca..0c3dd11de6 100644 --- a/vendor/adodb/adodb-php/adodb-time.inc.php +++ b/vendor/adodb/adodb-php/adodb-time.inc.php @@ -2,6 +2,8 @@ /** * ADOdb Date Library. * + * @deprecated 5.22.6 Use 64-bit PHP native functions instead. + * * PHP native date functions use integer timestamps for computations. * Because of this, dates are restricted to the years 1901-2038 on Unix * and 1970-2038 on Windows due to integer overflow for dates beyond diff --git a/vendor/adodb/adodb-php/adodb-xmlschema.inc.php b/vendor/adodb/adodb-php/adodb-xmlschema.inc.php index 32b8afa1e6..662e2aaec8 100644 --- a/vendor/adodb/adodb-php/adodb-xmlschema.inc.php +++ b/vendor/adodb/adodb-php/adodb-xmlschema.inc.php @@ -235,6 +235,15 @@ class dbTable extends dbObject { */ var $drop_field = array(); + /** + * @var array Platform-specific options + * @access private + */ + var $currentPlatform = true; + + /** @var dbData Stores information about table data. */ + var $data; + /** * Iniitializes a new table object. * @@ -403,7 +412,7 @@ function addData( $attributes ) { * @param string $type ADODB datadict field type. * @param string $size Field size * @param array $opts Field options array - * @return array Field specifier array + * @return void */ function addField( $name, $type, $size = NULL, $opts = NULL ) { $field_id = $this->FieldID( $name ); @@ -437,7 +446,7 @@ function addField( $name, $type, $size = NULL, $opts = NULL ) { * @param string $field Field name * @param string $opt ADOdb field option * @param mixed $value Field option value - * @return array Field specifier array + * @return void */ function addFieldOpt( $field, $opt, $value = NULL ) { if( !isset( $value ) ) { @@ -773,6 +782,9 @@ class dbData extends dbObject { var $row; + /** @var string Field name */ + var $current_field; + /** * Initializes the new dbIndex object. * @@ -1282,6 +1294,9 @@ class adoSchema { */ var $continueOnError; + /** @var dbTable A table object. */ + var $obj; + /** * Creates an adoSchema object * diff --git a/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php b/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php index a03386b3cc..3c8bce5d4f 100644 --- a/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php +++ b/vendor/adodb/adodb-php/adodb-xmlschema03.inc.php @@ -259,6 +259,8 @@ class dbTable extends dbObject { */ var $currentPlatform = true; + /** @var dbData Stores information about table data. */ + var $data; /** * Iniitializes a new table object. @@ -448,7 +450,7 @@ function addData( $attributes ) { * @param string $type ADODB datadict field type. * @param string $size Field size * @param array $opts Field options array - * @return array Field specifier array + * @return void */ function addField( $name, $type, $size = NULL, $opts = NULL ) { $field_id = $this->fieldID( $name ); @@ -484,7 +486,7 @@ function addField( $name, $type, $size = NULL, $opts = NULL ) { * @param string $field Field name * @param string $opt ADOdb field option * @param mixed $value Field option value - * @return array Field specifier array + * @return void */ function addFieldOpt( $field, $opt, $value = NULL ) { if( $this->currentPlatform ) { @@ -764,7 +766,7 @@ function _tag_close( $parser, $tag ) { * Adds a field to the index * * @param string $name Field name - * @return string Field list + * @return string[] Field list */ function addField( $name ) { $this->columns[$this->fieldID( $name )] = $name; @@ -777,7 +779,7 @@ function addField( $name ) { * Adds options to the index * * @param string $opt Comma-separated list of index options. - * @return string Option list + * @return string[] Option list */ function addIndexOpt( $opt ) { $this->opts[] = $opt; @@ -830,6 +832,9 @@ class dbData extends dbObject { var $row; + /** @var string Field name */ + var $current_field; + /** * Initializes the new dbData object. * @@ -924,10 +929,10 @@ function addField( $attributes ) { } /** - * Adds options to the index + * Adds data. * - * @param string $opt Comma-separated list of index options. - * @return string Option list + * @param string $cdata Data to add + * @return void */ function addData( $cdata ) { // check we're in a valid field @@ -1401,6 +1406,9 @@ class adoSchema { */ var $existingData; + /** @var dbTable A table object. */ + var $obj; + /** * Creates an adoSchema object * @@ -1774,7 +1782,7 @@ function saveSQL( $filename = './schema.sql' ) { $sqlArray = $this->sqlArray; } if( !isset( $sqlArray ) ) { - return FALSE; + return false; } $fp = fopen( $filename, "w" ); diff --git a/vendor/adodb/adodb-php/adodb.inc.php b/vendor/adodb/adodb-php/adodb.inc.php index 142e3ebe9f..86faa220dc 100644 --- a/vendor/adodb/adodb-php/adodb.inc.php +++ b/vendor/adodb/adodb-php/adodb.inc.php @@ -198,7 +198,7 @@ function ADODB_Setup() { /** * ADODB version as a string. */ - $ADODB_vers = 'v5.22.1 2022-03-30'; + $ADODB_vers = 'v5.22.9 2025-05-01'; /** * Determines whether recordset->RecordCount() is used. @@ -221,8 +221,12 @@ function ADODB_Setup() { // CLASS ADOFieldObject //============================================================================================== /** - * Helper class for FetchFields -- holds info on a column + * Helper class for FetchFields -- holds info on a column. + * + * Note: Dynamic properties are required here, as some drivers may require + * the object to hold database-specific field metadata. */ + #[\AllowDynamicProperties] class ADOFieldObject { var $name = ''; var $max_length=0; @@ -387,10 +391,7 @@ function flushcache($f, $debug=false) { */ function getdirname($hash) { global $ADODB_CACHE_DIR; - if (!isset($this->notSafeMode)) { - $this->notSafeMode = !ini_get('safe_mode'); - } - return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR; + return $ADODB_CACHE_DIR . '/' . substr($hash, 0, 2); } /** @@ -405,7 +406,7 @@ function createdir($hash, $debug) { global $ADODB_CACHE_PERMS; $dir = $this->getdirname($hash); - if ($this->notSafeMode && !file_exists($dir)) { + if (!file_exists($dir)) { $oldu = umask(0); if (!@mkdir($dir, empty($ADODB_CACHE_PERMS) ? 0771 : $ADODB_CACHE_PERMS)) { if(!is_dir($dir) && $debug) { @@ -458,7 +459,14 @@ abstract class ADOConnection { // var $dataProvider = 'native'; var $databaseType = ''; /// RDBMS currently in use, eg. odbc, mysql, mssql - var $database = ''; /// Name of database to be used. + + /** + * @var string Current database name. + * + * This used to be stored in the $databaseName property, which was marked + * as deprecated in 4.66 and removed in 5.22.5. + */ + public $database = ''; /** * @var string If the driver is PDO, then the dsnType is e.g. sqlsrv, otherwise empty @@ -485,8 +493,33 @@ abstract class ADOConnection { var $leftBracket = '['; /// left square bracked for t-sql styled column names var $rightBracket = ']'; /// right square bracked for t-sql styled column names var $charSet=false; /// character set to use - only for interbase, postgres and oci8 + + /** @var string SQL statement to get databases */ var $metaDatabasesSQL = ''; + + /** @var string SQL statement to get database tables */ var $metaTablesSQL = ''; + + /** @var string SQL statement to get table columns. */ + var $metaColumnsSQL; + + /** + * SQL statement to get the last IDENTITY value inserted into an IDENTITY + * column in the same scope. + * @see https://learn.microsoft.com/en-us/sql/t-sql/functions/scope-identity-transact-sql + * @var string + */ + var $identitySQL; + + /** @var string SQL statement to create a Sequence . */ + var $_genSeqSQL; + + /** @var string SQL statement to drop a Sequence. */ + var $_dropSeqSQL; + + /** @var string SQL statement to generate a Sequence ID. */ + var $_genIDSQL; + var $uniqueOrderBy = false; /// All order by columns have to be unique var $emptyDate = '&nbsp;'; var $emptyTimeStamp = '&nbsp;'; @@ -584,6 +617,10 @@ abstract class ADOConnection { var $null2null = 'null'; // in autoexecute/getinsertsql/getupdatesql, this value will be converted to a null var $bulkBind = false; // enable 2D Execute array + + /** @var string SQL statement executed by some drivers after successful connection. */ + public $connectStmt = ''; + // // PRIVATE VARS // @@ -591,14 +628,34 @@ abstract class ADOConnection { var $_transOK = null; /** @var resource Identifier for the native database connection */ var $_connectionID = false; - var $_errorMsg = false; /// A variable which was used to keep the returned last error message. The value will - /// then returned by the errorMsg() function - var $_errorCode = false; /// Last error code, not guaranteed to be used - only by oci8 + + /** + * Stores the last returned error message. + * @see ADOConnection::errorMsg() + * @var string|false + */ + var $_errorMsg = false; + + /** + * Stores the last returned error code. + * Not guaranteed to be used. Only some drivers actually populate it. + * @var int|false + */ + var $_errorCode = false; + var $_queryID = false; /// This variable keeps the last created result link identifier var $_isPersistentConnection = false; /// A boolean variable to state whether its a persistent connection or normal connection. */ var $_bindInputArray = false; /// set to true if ADOConnection.Execute() permits binding of array parameters. - var $_evalAll = false; + + /** + * Eval string used to filter data. + * Only used in the deprecated Text driver. + * @see https://adodb.org/dokuwiki/doku.php?id=v5:database:text#workaround + * @var string + */ + var $evalAll = false; + var $_affected = false; var $_logsql = false; var $_transmode = ''; // transaction mode @@ -633,6 +690,12 @@ abstract class ADOConnection { */ public $customMetaTypes = array(); + /** @var ADORecordSet Recordset used to retrieve MetaType information */ + var $_metars; + + /** @var string a specified locale. */ + var $locale; + /** * Default Constructor. @@ -1403,7 +1466,7 @@ function HasFailedTrans() { * @param array|bool $inputarr holds the input data to bind to. * Null elements will be set to null. * - * @return ADORecordSet|bool + * @return ADORecordSet|false */ public function Execute($sql, $inputarr = false) { if ($this->fnExecute) { @@ -1556,9 +1619,6 @@ function _Execute($sql,$inputarr=false) { // error handling if query fails if ($this->_queryID === false) { - if ($this->debug == 99) { - adodb_backtrace(true,5); - } $fn = $this->raiseErrorFn; if ($fn) { $fn($this->databaseType,'EXECUTE',$this->ErrorNo(),$this->ErrorMsg(),$sql,$inputarr,$this); @@ -1606,6 +1666,18 @@ function _Execute($sql,$inputarr=false) { return $rs; } + /** + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr = false) { + return false; + } + function CreateSequence($seqname='adodbseq',$startID=1) { if (empty($this->_genSeqSQL)) { return false; @@ -2421,7 +2493,7 @@ function CacheFlush($sql=false,$inputarr=false) { * - userid * - setFetchMode (adodb 4.23) * - * When not in safe mode, we create 256 sub-directories in the cache directory ($ADODB_CACHE_DIR). + * We create 256 sub-directories in the cache directory ($ADODB_CACHE_DIR). * Assuming that we can have 50,000 files per directory with good performance, * then we can scale to 12.8 million unique cached recordsets. Wow! */ @@ -2562,34 +2634,32 @@ function CacheExecute($secs2cache,$sql=false,$inputarr=false) { } - /* - - - $forceUpdate . - */ /** - * Similar to PEAR DB's autoExecute(), except that $mode can be 'INSERT' - * or 'UPDATE' or DB_AUTOQUERY_INSERT or DB_AUTOQUERY_UPDATE. - * If $mode == 'UPDATE', then $where is compulsory as a safety measure. + * Simple interface to insert and update records. * - * @param $table - * @param $fields_values - * @param string $mode - * @param false $where - * @param bool $forceUpdate If true, perform update even if the data has not changed. - * @param bool $magic_quotes This param is not used since 5.21.0. - * It remains for backwards compatibility. + * Automatically generate and execute INSERT and UPDATE statements + * on a given table, similar to PEAR DB's autoExecute(). + * + * @param string $table Name of the table to process. + * @param array $fields_values Associative array of field names => values. + * @param string|int $mode Execution mode: 'INSERT' (default), 'UPDATE' or + * one of the DB_AUTOQUERY_xx constants. + * @param string $where SQL where clause (mandatory in UPDATE mode as a safety measure) + * @param bool $forceUpdate If true, update all provided fields, even if they have not changed; + * otherwise only modified fields are updated. + * @param bool $magic_quotes This param is not used since 5.21.0. + * It remains for backwards compatibility. * * @return bool * * @noinspection PhpUnusedParameterInspection */ - function AutoExecute($table, $fields_values, $mode = 'INSERT', $where = false, $forceUpdate = true, $magic_quotes = false) { + function autoExecute($table, $fields_values, $mode = 'INSERT', $where = '', $forceUpdate = true, $magic_quotes = false) { if (empty($fields_values)) { $this->outp_throw('AutoExecute: Empty fields array', 'AutoExecute'); return false; } - if ($where === false && ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) ) { + if (empty($where) && ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */)) { $this->outp_throw('AutoExecute: Illegal mode=UPDATE with empty WHERE clause', 'AutoExecute'); return false; } @@ -2601,7 +2671,7 @@ function AutoExecute($table, $fields_values, $mode = 'INSERT', $where = false, $ } $rs->tableName = $table; - if ($where !== false) { + if (!empty($where)) { $sql .= " WHERE $where"; } $rs->sql = $sql; @@ -3496,20 +3566,21 @@ function qStr($s, $magic_quotes=false) { /** - * Will select the supplied $page number from a recordset, given that it is paginated in pages of - * $nrows rows per page. It also saves two boolean values saying if the given page is the first - * and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination. + * Execute query with pagination. * - * See docs-adodb.htm#ex8 for an example of usage. - * NOTE: phpLens uses a different algorithm and does not use PageExecute(). + * Will select the supplied $page number from a recordset, divided in + * pages of $nrows rows each. It also saves two boolean values saying + * if the given page is the first and/or last one of the recordset. * - * @param string $sql - * @param int $nrows Number of rows per page to get - * @param int $page Page number to get (1-based) - * @param mixed[]|bool $inputarr Array of bind variables - * @param int $secs2cache Private parameter only used by jlim + * @param string $sql Query to execute + * @param int $nrows Number of rows per page + * @param int $page Page number to retrieve (1-based) + * @param array|bool $inputarr Array of bind variables + * @param int $secs2cache Time-to-live of the cache (in seconds), 0 to force query execution + * + * @return ADORecordSet|bool the recordset ($rs->databaseType == 'array') * - * @return mixed the recordset ($rs->databaseType == 'array') + * @author Iván Oliva */ function PageExecute($sql, $nrows, $page, $inputarr=false, $secs2cache=0) { global $ADODB_INCLUDED_LIB; @@ -3685,6 +3756,7 @@ protected function getChangedErrorMsg($old = null) { /** * Internal placeholder for record objects. Used by ADORecordSet->FetchObj(). */ + #[\AllowDynamicProperties] class ADOFetchObj { }; @@ -3875,11 +3947,21 @@ function hasMore() { * means recordcount not known). */ class ADORecordSet implements IteratorAggregate { + /** + * Used for cases when a recordset object is not created by executing a query. + */ + const DUMMY_QUERY_ID = -1; /** * public variables */ var $dataProvider = "native"; + + /** + * @var string Table name (used in _adodb_getupdatesql() and _adodb_getinsertsql())- + */ + public $tableName = ''; + /** @var bool|array */ var $fields = false; /// holds the current row data var $blobSize = 100; /// any varchar/char field this size or greater is treated as a blob @@ -3902,24 +3984,39 @@ class ADORecordSet implements IteratorAggregate { */ var $_numOfRows = -1; /** number of rows, or -1 */ var $_numOfFields = -1; /** number of fields in recordset */ - /** @var resource result link identifier */ - var $_queryID = -1; + + /** + * @var resource|int|false result link identifier + */ + var $_queryID = self::DUMMY_QUERY_ID; + var $_currentRow = -1; /** This variable keeps the current row in the Recordset. */ var $_closed = false; /** has recordset been closed */ var $_inited = false; /** Init() should only be called once */ var $_obj; /** Used by FetchObj */ var $_names; /** Used by FetchObj */ - var $_currentPage = -1; /** Added by Iván Oliva to implement recordset pagination */ - var $_atFirstPage = false; /** Added by Iván Oliva to implement recordset pagination */ - var $_atLastPage = false; /** Added by Iván Oliva to implement recordset pagination */ + // Recordset pagination + /** @var int Number of rows per page */ + var $rowsPerPage; + /** @var int Current page number */ + var $_currentPage = -1; + /** @var bool True if current page is the first page */ + var $_atFirstPage = false; + /** @var bool True if current page is the last page */ + var $_atLastPage = false; + /** @var int Last page number */ var $_lastPageNo = -1; + /** @var int Total number of rows in recordset */ var $_maxRecordCount = 0; + var $datetime = false; public $customActualTypes; public $customMetaTypes; + /** @var int Only used in _adodb_getinsertsql() */ + public $insertSig; /** * @var ADOFieldObject[] Field metadata cache @@ -3927,6 +4024,12 @@ class ADORecordSet implements IteratorAggregate { */ protected $fieldObjectsCache; + /** + * @var int Defines the Fetch Mode for a recordset + * See the ADODB_FETCH_* constants + */ + public $adodbFetchMode; + /** * Constructor * @@ -4197,6 +4300,8 @@ function getRows($nRows = -1) { */ function getAssoc($force_array = false, $first2cols = false) { + global $ADODB_FETCH_MODE; + /* * Insufficient rows to show data */ @@ -4219,8 +4324,8 @@ function getAssoc($force_array = false, $first2cols = false) * Get the fetch mode when the call was executed, this may be * different than ADODB_FETCH_MODE */ - $fetchMode = $this->connection->fetchMode; - if ($fetchMode == ADODB_FETCH_BOTH) { + $fetchMode = $this->adodbFetchMode; + if ($fetchMode == ADODB_FETCH_BOTH || $fetchMode == ADODB_FETCH_DEFAULT) { /* * If we are using BOTH, we present the data as if it * was in ASSOC mode. This could be enhanced by adding @@ -4252,7 +4357,7 @@ function getAssoc($force_array = false, $first2cols = false) $myFields = $this->fields; - if ($fetchMode == ADODB_FETCH_BOTH) { + if ($fetchMode == ADODB_FETCH_BOTH || $fetchMode == ADODB_FETCH_DEFAULT) { /* * extract the associative keys */ @@ -4268,9 +4373,7 @@ function getAssoc($force_array = false, $first2cols = false) switch ($showArrayMethod) { case 0: - if ($fetchMode == ADODB_FETCH_ASSOC - || $fetchMode == ADODB_FETCH_BOTH) - { + if ($fetchMode != ADODB_FETCH_NUM) { /* * The driver should have already handled the key * casing, but in case it did not. We will check and force @@ -5742,6 +5845,7 @@ function newDataDictionary(&$conn, $drivername='') { } include_once($path); $class = "ADODB2_$drivername"; + /** @var ADODB_DataDict $dict */ $dict = new $class(); $dict->dataProvider = $conn->dataProvider; $dict->connection = $conn; diff --git a/vendor/adodb/adodb-php/datadict/datadict-access.inc.php b/vendor/adodb/adodb-php/datadict/datadict-access.inc.php index b3f9fad0a2..00fdeb1e88 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-access.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-access.inc.php @@ -69,7 +69,7 @@ function ActualType($meta) } // return string must begin with space - function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { if ($fautoinc) { $ftype = 'COUNTER'; diff --git a/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php b/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php index 9ac106bbbe..989f08999d 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-db2.inc.php @@ -72,7 +72,7 @@ function ActualType($meta) } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if ($fautoinc) return ' GENERATED ALWAYS AS IDENTITY'; # as identity start with diff --git a/vendor/adodb/adodb-php/datadict/datadict-firebird.inc.php b/vendor/adodb/adodb-php/datadict/datadict-firebird.inc.php index 79d0a8f5c3..b17e0a22a9 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-firebird.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-firebird.inc.php @@ -135,7 +135,7 @@ function _dropAutoIncrement($tabname) } - function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; diff --git a/vendor/adodb/adodb-php/datadict/datadict-informix.inc.php b/vendor/adodb/adodb-php/datadict/datadict-informix.inc.php index 9e151633fd..a69590ce4b 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-informix.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-informix.inc.php @@ -81,7 +81,7 @@ function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='') } // return string must begin with space - function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { if ($fautoinc) { $ftype = 'SERIAL'; diff --git a/vendor/adodb/adodb-php/datadict/datadict-mssql.inc.php b/vendor/adodb/adodb-php/datadict/datadict-mssql.inc.php index 17df9e3967..aeeafa64f0 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-mssql.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-mssql.inc.php @@ -177,7 +177,7 @@ function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; diff --git a/vendor/adodb/adodb-php/datadict/datadict-mssqlnative.inc.php b/vendor/adodb/adodb-php/datadict/datadict-mssqlnative.inc.php index 59228cbe39..ca77340a23 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-mssqlnative.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-mssqlnative.inc.php @@ -269,7 +269,7 @@ function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='') // return string must begin with space /** @noinspection DuplicatedCode */ - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; diff --git a/vendor/adodb/adodb-php/datadict/datadict-mysql.inc.php b/vendor/adodb/adodb-php/datadict/datadict-mysql.inc.php index 9efbba1f31..a1ca1115ba 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-mysql.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-mysql.inc.php @@ -143,7 +143,7 @@ function ActualType($meta) } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if ($funsigned) $suffix .= ' UNSIGNED'; diff --git a/vendor/adodb/adodb-php/datadict/datadict-oci8.inc.php b/vendor/adodb/adodb-php/datadict/datadict-oci8.inc.php index 6d2cd244f5..388f649ca1 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-oci8.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-oci8.inc.php @@ -199,7 +199,7 @@ function _DropAutoIncrement($t) } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; diff --git a/vendor/adodb/adodb-php/datadict/datadict-postgres.inc.php b/vendor/adodb/adodb-php/datadict/datadict-postgres.inc.php index d403cee305..74730c6a77 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-postgres.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-postgres.inc.php @@ -160,7 +160,8 @@ function addColumnSQL($tabname, $flds) $sql = array(); $not_null = false; list($lines,$pkey) = $this->_genFields($flds); - $alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' '; + $alter = 'ALTER TABLE ' . $tabname . $this->addCol; + $alter .= (float)@$this->serverInfo['version'] < 9.6 ? ' ' : ' IF NOT EXISTS '; foreach($lines as $v) { if (($not_null = preg_match('/NOT NULL/i',$v))) { $v = preg_replace('/NOT NULL/i','',$v); @@ -398,7 +399,7 @@ function dropTableSQL($tabname) } // return string must begin with space - function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { if ($fautoinc) { $ftype = 'SERIAL'; diff --git a/vendor/adodb/adodb-php/datadict/datadict-sapdb.inc.php b/vendor/adodb/adodb-php/datadict/datadict-sapdb.inc.php index c469800f2e..48cb9ad89f 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-sapdb.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-sapdb.inc.php @@ -104,7 +104,7 @@ function MetaType($t,$len=-1,$fieldobj=false) } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if ($funsigned) $suffix .= ' UNSIGNED'; diff --git a/vendor/adodb/adodb-php/datadict/datadict-sqlite.inc.php b/vendor/adodb/adodb-php/datadict/datadict-sqlite.inc.php index d565f88775..699be09fcf 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-sqlite.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-sqlite.inc.php @@ -74,13 +74,16 @@ function ActualType($meta) } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; - if ($funsigned) $suffix .= ' UNSIGNED'; + if ($funsigned && !($fprimary && $fautoinc)) $suffix .= ' UNSIGNED'; if ($fnotnull) $suffix .= ' NOT NULL'; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; - if ($fautoinc) $suffix .= ' AUTOINCREMENT'; + if ($fprimary && $fautoinc) { + $suffix .= ' PRIMARY KEY AUTOINCREMENT'; + array_pop($pkey); + } if ($fconstraint) $suffix .= ' '.$fconstraint; return $suffix; } diff --git a/vendor/adodb/adodb-php/datadict/datadict-sybase.inc.php b/vendor/adodb/adodb-php/datadict/datadict-sybase.inc.php index d6573dfa3f..4a917aa86f 100644 --- a/vendor/adodb/adodb-php/datadict/datadict-sybase.inc.php +++ b/vendor/adodb/adodb-php/datadict/datadict-sybase.inc.php @@ -139,7 +139,7 @@ function DropColumnSQL($tabname, $flds, $tableflds='', $tableoptions='') } // return string must begin with space - function _CreateSuffix($fname,&$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned) + function _createSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned, $fprimary, &$pkey) { $suffix = ''; if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault"; diff --git a/vendor/adodb/adodb-php/docs/changelog.md b/vendor/adodb/adodb-php/docs/changelog.md index ec8375756e..9420e7fd59 100644 --- a/vendor/adodb/adodb-php/docs/changelog.md +++ b/vendor/adodb/adodb-php/docs/changelog.md @@ -14,6 +14,231 @@ Older changelogs: -------------------------------------------------------------------------------- +## [5.22.9] - 2025-05-01 + +### Security + +- pgsql: SQL injection in pg_insert_id() method (CVE-2025-46337) + [#1070](https://github.com/ADOdb/ADOdb/issues/1070) + +### Fixed + +- sqlite: Fulfill PRIMARY KEY AUTOINCREMENT requirements + [#1055](https://github.com/ADOdb/ADOdb/issues/1055) +- sqlite: fix error reporting + [#1061](https://github.com/ADOdb/ADOdb/issues/1061) +- Creation of dynamic property deprecated warning with PHP 8.2 + [#1068](https://github.com/ADOdb/ADOdb/issues/1068) + + +## [5.22.8] - 2025-01-25 + +### Added + +- mysql: allow forcing use of emulated prepared statements + [#1028](https://github.com/ADOdb/ADOdb/issues/1028) +- Georgian language strings + [#1042](https://github.com/ADOdb/ADOdb/issues/1042) + +### Changed + +- mysqli: Improve setConnectionParameter() + [#1044](https://github.com/ADOdb/ADOdb/issues/1044) + +### Fixed + +- Backtrace output is not channeled through ADODB_OUTP + [#1018](https://github.com/ADOdb/ADOdb/issues/1018) +- changeColumnSQL not handling new vs changed columns correctly #1010 + [#1010](https://github.com/ADOdb/ADOdb/issues/1010) +- PHP 8 compatibility + [#1009](https://github.com/ADOdb/ADOdb/issues/1009) + [#1012](https://github.com/ADOdb/ADOdb/issues/1012) + [#1021](https://github.com/ADOdb/ADOdb/issues/1021) + [#1045](https://github.com/ADOdb/ADOdb/issues/1045) +- db2: fix connections using *LOCAL on IBM i series + [#1031](https://github.com/ADOdb/ADOdb/issues/1031) + [#1032](https://github.com/ADOdb/ADOdb/issues/1032) +- mysqli: catch getAssoc() execution error in metaColumns() + [#1016](https://github.com/ADOdb/ADOdb/issues/1016) +- mysqli: fix getAssoc() with ADODB_FETCH_DEFAULT mode + [#1023](https://github.com/ADOdb/ADOdb/issues/1023) +- mysqli: SSL not working due to wrong socket/flags + [#919](https://github.com/ADOdb/ADOdb/issues/919) + [#1043](https://github.com/ADOdb/ADOdb/issues/1043) +- pgsql: fix serverInfo() version number + [#1059](https://github.com/ADOdb/ADOdb/issues/1059) + + +## [5.22.7] - 2023-11-04 + +### Fixed + +- Respect @ operator in all error handlers on PHP 8 + [#981](https://github.com/ADOdb/ADOdb/issues/981) +- db2: Declaration of ADODB_db2::_query incompatible with parent + [#987](https://github.com/ADOdb/ADOdb/issues/987) +- mysqli: bulkBind reset after one call + [#1000](https://github.com/ADOdb/ADOdb/issues/1000) +- oci8: deprecation warning in selectLimit() on PHP 8.1 + [#992](https://github.com/ADOdb/ADOdb/issues/992) +- oci8: Fix Automatic conversion of false to array + [#998](https://github.com/ADOdb/ADOdb/issues/998) +- oci8: Prevent str_replace NULL error in qstr() methods on PHP 8.1 + [#999](https://github.com/ADOdb/ADOdb/issues/999) + + +## [5.22.6] - 2023-06-11 + +### Deprecated + +- Date/Time Library + [#970](https://github.com/ADOdb/ADOdb/issues/970) + +### Fixed + +- Creation of dynamic property deprecated warning with PHP 8.2 + [#954](https://github.com/ADOdb/ADOdb/issues/954) + [#975](https://github.com/ADOdb/ADOdb/issues/975) +- Remove unused oldProvider property in _rs2serialize() + [#957](https://github.com/ADOdb/ADOdb/issues/957) +- Fix ADOConnection::execute() documentation of return type + [#964](https://github.com/ADOdb/ADOdb/issues/964) +- Define _query() method in ADOConnection base class + [#966](https://github.com/ADOdb/ADOdb/issues/966) +- Restore rs2html() $htmlspecialchars param behavior + [#968](https://github.com/ADOdb/ADOdb/issues/968) +- adodb_throw() does not respect @ operator on PHP 8 + [#981](https://github.com/ADOdb/ADOdb/issues/981) +- loadbalancer: PHP 8.2 warnings + [#951](https://github.com/ADOdb/ADOdb/issues/951) +- mysql: Fail connection if native driver (mysqlnd) is not available + [#967](https://github.com/ADOdb/ADOdb/issues/967) +- pgsql: Fix PHP 8.1 deprecated warning + [#956](https://github.com/ADOdb/ADOdb/issues/956) +- pgsql: avoid Insert_ID() failing when lastval() is not set + [#978](https://github.com/ADOdb/ADOdb/issues/978) + + +## [5.22.5] - 2023-04-03 + +### Removed + +- Obsolete ADOConnection::$databaseName property + [#932](https://github.com/ADOdb/ADOdb/issues/932) +- Dead code related to safe_mode + [#934](https://github.com/ADOdb/ADOdb/issues/934) +- pdo: remove unnecessary methods _init() and _affectedrows() + [#935](https://github.com/ADOdb/ADOdb/issues/935) + +### Fixed + +- ADODB_FETCH_DEFAULT should be treated as ASSOC in getAssoc() + [#886](https://github.com/ADOdb/ADOdb/issues/886) +- Allow dynamic properties for ADOFieldObject class + [#906](https://github.com/ADOdb/ADOdb/issues/906) +- Fix autoExecute() $where parameter type + [#915](https://github.com/ADOdb/ADOdb/issues/915) +- Creation of dynamic property deprecated warning in PHP 8.2 + [#904](https://github.com/ADOdb/ADOdb/issues/904) + [#907](https://github.com/ADOdb/ADOdb/issues/907) + [#908](https://github.com/ADOdb/ADOdb/issues/908) + [#909](https://github.com/ADOdb/ADOdb/issues/909) + [#911](https://github.com/ADOdb/ADOdb/issues/911) + [#912](https://github.com/ADOdb/ADOdb/issues/912) + [#913](https://github.com/ADOdb/ADOdb/issues/913) + [#917](https://github.com/ADOdb/ADOdb/issues/917) + [#926](https://github.com/ADOdb/ADOdb/issues/926) + [#933](https://github.com/ADOdb/ADOdb/issues/933) + [#935](https://github.com/ADOdb/ADOdb/issues/935) +- Partially-supported callable deprecated warning in PHP 8.2 + [#928](https://github.com/ADOdb/ADOdb/issues/928) +- Passing null to non-nullable parameter is deprecated in PHP 8.1 + [#938](https://github.com/ADOdb/ADOdb/issues/938) +- Define adodbFetchMode property in base ADORecordSet class + [#923](https://github.com/ADOdb/ADOdb/issues/923) +- mysql: uncaught exception calling execute() with empty SQL on PHP 8 + [#945](https://github.com/ADOdb/ADOdb/issues/945) +- oci8: Replace obsolete oci_free_cursor() function alias + [#937](https://github.com/ADOdb/ADOdb/issues/937) +- pdo: Move setTransactionMode() to ADODB_pdo_sqlsrv class + [#939](https://github.com/ADOdb/ADOdb/issues/939) +- pgsql: fix "column already exists" error when adding a new column + [#897](https://github.com/ADOdb/ADOdb/issues/897) +- pgsql: undefined array key in metaIndexes() when column is an expression + [#940](https://github.com/ADOdb/ADOdb/issues/940) +- pgsql: revert non-functional "Noblob optimization" + [#112](https://github.com/ADOdb/ADOdb/issues/112) +- session: full table scan when accessing sessions table on MySQL + [#941](https://github.com/ADOdb/ADOdb/issues/941) +- session: inconsistent DB provider check + [#943](https://github.com/ADOdb/ADOdb/issues/943) + + +## [5.22.4] - 2022-10-28 + +### Fixed + +- adodb_strip_order_by() throws deprecated warnings on PHP 8.1 + [#869](https://github.com/ADOdb/ADOdb/issues/869) +- adodb_strip_order_by() shouldn't strip clause from subqueries + [#870](https://github.com/ADOdb/ADOdb/issues/870) +- mssql: Affected_Rows() not returning correct value + [#895](https://github.com/ADOdb/ADOdb/issues/895) +- mysqli: Fix mysqli_result could not be converted to int + [#867](https://github.com/ADOdb/ADOdb/issues/867) +- mysqli: regression on errorMsg()/errorCode() + [#872](https://github.com/ADOdb/ADOdb/issues/872) + + +## [5.22.3] - 2022-09-06 + +### Fixed + +- alterColumnSql() and changeTableSQL() produce different SQL + [#124](https://github.com/ADOdb/ADOdb/issues/124) + [#383](https://github.com/ADOdb/ADOdb/issues/383) + [#865](https://github.com/ADOdb/ADOdb/issues/865) +- Fix PHP 8.1 deprecated warning in GetUpdateSQL() + [#844](https://github.com/ADOdb/ADOdb/issues/844) +- Fix PHP 8.1 deprecated warning in tohtml.inc.php + [#850](https://github.com/ADOdb/ADOdb/issues/850) +- Fix str_repeat() error in _adodb_backtrace() + [#852](https://github.com/ADOdb/ADOdb/issues/852) +- firebird/ibase: Fix uncaught TypeError + [#858](https://github.com/ADOdb/ADOdb/issues/858) +- mssql: Fix undefined variable when closing connection + [#835](https://github.com/ADOdb/ADOdb/issues/835) +- mssql: insert_id returns false if value is out of range + [#853](https://github.com/ADOdb/ADOdb/issues/853) +- mysql: Fix regression with portable bind arrays + [#838](https://github.com/ADOdb/ADOdb/issues/838) +- mysql: Fix errorMsg() / errorNo() on MySQL 8 + [#842](https://github.com/ADOdb/ADOdb/issues/842) +- oci8po: Replace deprecated functions aliases + [#862](https://github.com/ADOdb/ADOdb/issues/862) +- pdo: Fix uncaught TypeError on PHP 8 + [#840](https://github.com/ADOdb/ADOdb/issues/840) +- pgsql: check for dummy query Id before closing recordset + [#848](https://github.com/ADOdb/ADOdb/issues/848) +- active record: fix changing case of class properties in Native mode + [#837](https://github.com/ADOdb/ADOdb/issues/837) + + +## [5.22.2] - 2022-05-08 + +### Fixed + +- mssql: Automatic conversion of false to array is deprecated in PHP 8.1 + [#829](https://github.com/ADOdb/ADOdb/issues/829) +- mysql: Affected_Rows() not returning correct value + [#820](https://github.com/ADOdb/ADOdb/issues/820) +- mysql: uncaught ValueError exception calling execute() with an empty array + [#832](https://github.com/ADOdb/ADOdb/issues/832) +- pgsql: Affected_Rows() always returns false on PHP 8.1 + [#833](https://github.com/ADOdb/ADOdb/issues/833) + + ## [5.22.1] - 2022-03-30 ### Removed @@ -31,12 +256,10 @@ Older changelogs: [#812](https://github.com/ADOdb/ADOdb/issues/812) - firebird: undefined array key with uppercase columns [#813](https://github.com/ADOdb/ADOdb/issues/813) -- mysqli: regression on setConnectionParameter() +- mysql: regression on setConnectionParameter() [#803](https://github.com/ADOdb/ADOdb/issues/803) -- mysqli: regression on bulk binding +- mysql: regression on bulk binding [#806](https://github.com/ADOdb/ADOdb/issues/806) -- mysqli: Affected_Rows() not returning correct value - [#820](https://github.com/ADOdb/ADOdb/issues/820) - oci8: fix PHP 8.1 array deprecation warning [#817](https://github.com/ADOdb/ADOdb/issues/817) - memcache: weighted servers not connecting @@ -536,9 +759,9 @@ Includes all fixes from 5.20.19. ## [5.20.16] - 2020-01-12 --### Fixed +### Fixed - mssql: queries are not correctly closed +- mssql: queries are not correctly closed [#590](https://github.com/ADOdb/ADOdb/issues/590) @@ -1267,6 +1490,14 @@ Released together with [v4.95](changelog_v4.x.md#495---17-may-2007) - Adodb5 version,more error checking code now will use exceptions if available. +[5.22.9]: https://github.com/adodb/adodb/compare/v5.22.8...v5.22.9 +[5.22.8]: https://github.com/adodb/adodb/compare/v5.22.7...v5.22.8 +[5.22.7]: https://github.com/adodb/adodb/compare/v5.22.6...v5.22.7 +[5.22.6]: https://github.com/adodb/adodb/compare/v5.22.5...v5.22.6 +[5.22.5]: https://github.com/adodb/adodb/compare/v5.22.4...v5.22.5 +[5.22.4]: https://github.com/adodb/adodb/compare/v5.22.3...v5.22.4 +[5.22.3]: https://github.com/adodb/adodb/compare/v5.22.2...v5.22.3 +[5.22.2]: https://github.com/adodb/adodb/compare/v5.22.1...v5.22.2 [5.22.1]: https://github.com/adodb/adodb/compare/v5.22.0...v5.22.1 [5.22.0]: https://github.com/adodb/adodb/compare/v5.21.4...v5.22.0 diff --git a/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php index fc000cecb3..df95c69012 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-ado.inc.php @@ -208,10 +208,6 @@ function MetaColumns($table, $normalize=true) return empty($arr) ? $false : $arr; } - - - - /* returns queryID or false */ function _query($sql,$inputarr=false) { @@ -504,7 +500,7 @@ function MetaType($t,$len=-1,$fieldobj=false) $t = $fieldobj->type; $len = $fieldobj->max_length; } - + if (array_key_exists($t,$this->connection->customActualTypes)) return $this->connection->customActualTypes[$t]; diff --git a/vendor/adodb/adodb-php/drivers/adodb-ado5.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ado5.inc.php index 36f9c3b8d5..04b45abf65 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-ado5.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-ado5.inc.php @@ -233,7 +233,6 @@ function MetaColumns($table, $normalize=true) return $arr; } - /* returns queryID or false */ function _query($sql,$inputarr=false) { try { // In PHP5, all COM errors are exceptions, so to maintain old behaviour... @@ -545,13 +544,13 @@ function MetaType($t,$len=-1,$fieldobj=false) $t = $fieldobj->type; $len = $fieldobj->max_length; } - + $t = strtoupper($t); - + if (array_key_exists($t,$this->connection->customActualTypes)) return $this->connection->customActualTypes[$t]; - if (!is_numeric($t)) + if (!is_numeric($t)) return $t; switch ($t) { diff --git a/vendor/adodb/adodb-php/drivers/adodb-ads.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ads.inc.php index b9d4adb522..16eec97669 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-ads.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-ads.inc.php @@ -97,7 +97,7 @@ function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) $this->_connectionID = ads_connect($argDSN, $argUsername, $argPassword, $this->curmode); } $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); - if (isset($this->connectStmt)) { + if ($this->connectStmt) { $this->Execute($this->connectStmt); } @@ -127,7 +127,7 @@ function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) if ($this->_connectionID && $this->autoRollback) { @ads_rollback($this->_connectionID); } - if (isset($this->connectStmt)) { + if ($this->connectStmt) { $this->Execute($this->connectStmt); } @@ -564,7 +564,6 @@ function Prepare($sql) return array($sql, $stmt, false); } - /* returns queryID or false */ function _query($sql, $inputarr = false) { $last_php_error = $this->resetLastError(); diff --git a/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php b/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php index 8a59626e14..e6694d9adc 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-csv.inc.php @@ -199,7 +199,7 @@ function _close() } } // class -class ADORecordset_csv extends ADORecordset { +class ADORecordset_csv extends ADORecordSet { function _close() { diff --git a/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php b/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php index 16c4054f17..60cd093aca 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-db2.inc.php @@ -77,16 +77,6 @@ class ADODB_db2 extends ADOConnection { */ public $nameQuote = '"'; - /* - * Executed after successful connection - */ - public $connectStmt = ''; - - /* - * Holds the current database name - */ - private $databaseName = ''; - /* * Holds information about the stored procedure request * currently being built @@ -113,16 +103,18 @@ public function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persistent=false) { - + if (!function_exists('db2_connect')) { ADOConnection::outp("DB2 extension not installed."); return null; } - $connectionParameters = $this->unpackParameters($argDSN, - $argUsername, - $argPassword, - $argDatabasename); + $connectionParameters = $this->unpackParameters( + $argDSN, + $argUsername, + $argPassword, + $argDatabasename + ); if ($connectionParameters == null) { @@ -139,7 +131,12 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen $useCataloguedConnection = $connectionParameters['catalogue']; if ($this->debug){ - if ($useCataloguedConnection){ + if (strcmp($argDSN,'*LOCAL') == 0) + { + $connectMessage = '*LOCAL connection'; + } + else if ($useCataloguedConnection) + { $connectMessage = "Catalogued connection using parameters: "; $connectMessage .= "DB=$argDatabasename / "; $connectMessage .= "UID=$argUsername / "; @@ -151,6 +148,7 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen } ADOConnection::outp($connectMessage); } + /* * This needs to be set before the connect(). */ @@ -174,22 +172,28 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen } if ($useCataloguedConnection) + { $this->_connectionID = $db2Function($argDatabasename, $argUsername, $argPassword, $db2Options); + } else + $this->_connectionID = $db2Function($argDSN, - null, - null, + '', + '', $db2Options); - + $this->_errorMsg = @db2_conn_errormsg(); if ($this->_connectionID && $this->connectStmt) $this->execute($this->connectStmt); + if ($this->_connectionID && $argDatabasename) + $this->execute("SET SCHEMA=$argDatabasename"); + return $this->_connectionID != false; } @@ -207,13 +211,26 @@ private function doDB2Connect($argDSN, $argUsername, $argPassword, $argDatabasen private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatabasename) { - - $connectionParameters = array('dsn'=>'', - 'uid'=>'', - 'pwd'=>'', - 'database'=>'', - 'catalogue'=>true - ); + + $connectionParameters = array( + 'dsn'=>'', + 'uid'=>'', + 'pwd'=>'', + 'database'=>'', + 'catalogue'=>true + ); + + /* + * Shortcut for *LOCAL + */ + if (strcmp($argDSN,'*LOCAL') == 0) + { + $connectionParameters['dsn'] = $argDSN; + $connectionParameters['database'] = $argDatabasename; + $connectionParameters['catalogue'] = false; + + return $connectionParameters; + } /* * Uou can either connect to a catalogued connection @@ -257,7 +274,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab $errorMessage = 'Supply uncatalogued connection parameters '; $errorMessage.= 'in either the database or DSN arguments, '; $errorMessage.= 'but not both'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -282,7 +299,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab { $errorMessage = 'For uncatalogued connections, provide '; $errorMessage.= 'both UID and PWD in the connection string'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -307,7 +324,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab } elseif ($argDatabasename) { - $this->databaseName = $argDatabasename; + $this->database = $argDatabasename; $argDSN .= ';database=' . $argDatabasename; $argDatabasename = ''; $useCataloguedConnection = false; @@ -317,7 +334,7 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab { $errorMessage = 'Uncatalogued connection parameters '; $errorMessage.= 'must contain a database= argument'; - + if ($this->debug) ADOConnection::outp($errorMessage); return null; @@ -347,9 +364,9 @@ private function unpackParameters($argDSN, $argUsername, $argPassword, $argDatab } if ($argDatabasename) - $this->databaseName = $argDatabasename; - elseif (!$this->databaseName) - $this->databaseName = $this->getDatabasenameFromDsn($argDSN); + $this->database = $argDatabasename; + elseif (!$this->database) + $this->database = $this->getDatabasenameFromDsn($argDSN); $connectionParameters = array('dsn'=>$argDSN, @@ -1003,7 +1020,7 @@ public function metaProcedures($procedureNamePattern = null, $catalog = null, $ */ public function metaDatabases(){ - $dbName = $this->getMetaCasedValue($this->databaseName); + $dbName = $this->getMetaCasedValue($this->database); return (array)$dbName; @@ -1578,11 +1595,8 @@ function prepare($sql) * * @return mixed either the queryID or false */ - function _query(&$sql,$inputarr=false) + function _query($sql, $inputarr = false) { - - $this->_error = ''; - $db2Options = array(); /* * Use DB2 Internal case handling for best speed @@ -1618,10 +1632,10 @@ function _query(&$sql,$inputarr=false) { $this->_errorMsg = @db2_stmt_errormsg(); $this->_errorCode = @db2_stmt_error(); - + if ($this->debug) ADOConnection::outp($this->_errorMsg); - + return false; } } @@ -1995,14 +2009,13 @@ function _close() $ok = @db2_free_result($this->_queryID); if (!$ok) { - $this->_errorMsg = @db2_stmt_errormsg($this->_queryId); - $this->_errorCode = @db2_stmt_error(); + $this->connection->_errorMsg = @db2_stmt_errormsg($this->_queryID); + $this->connection->_errorCode = @db2_stmt_error(); if ($this->debug) - ADOConnection::outp($this->_errorMsg); + ADOConnection::outp($this->connection->_errorMsg); return false; } - } } diff --git a/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php index a4255eb97e..64913bc249 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-fbsql.inc.php @@ -134,7 +134,6 @@ function SelectDB($dbName) } - // returns queryID or false function _query($sql,$inputarr=false) { return fbsql_query("$sql;",$this->_connectionID); diff --git a/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php b/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php index 135b72c642..db3cca5d6f 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-firebird.inc.php @@ -483,14 +483,14 @@ public function prepare($sql) } /** - * Return the query id. - * - * @param string|array $sql - * @param array $iarr - * - * @return bool|object - */ - function _query($sql, $iarr = false) + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return object|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr = false) { if (!$this->isConnected()) { return false; @@ -512,11 +512,17 @@ function _query($sql, $iarr = false) $fn = 'fbird_query'; $args = [$conn, $sql]; } - if (is_array($iarr)) { - $args = array_merge($args, $iarr); + if (is_array($inputarr)) { + $args = array_merge($args, $inputarr); } $ret = call_user_func_array($fn, $args); + // fbird_query() and fbird_execute() return number of affected rows + // ADOConnection::_Execute() expects true for INSERT/UPDATE/DELETE + if (is_numeric($ret)) { + $ret = true; + } + if ($docommit && $ret === true) { fbird_commit($this->_connectionID); } diff --git a/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php index 81ab29b56e..8159c512d6 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-ibase.inc.php @@ -256,7 +256,7 @@ function MetaIndexes ($table, $primary = FALSE, $owner=false) // See http://community.borland.com/article/0,1410,25844,00.html - function RowLock($tables,$where,$col=false) + function rowLock($table, $where, $col = false) { if ($this->autoCommit) { $this->BeginTrans(); @@ -320,7 +320,7 @@ function ErrorNo() function ErrorMsg() { - return $this->_errorMsg; + return $this->_errorMsg; } function Prepare($sql) @@ -332,9 +332,8 @@ function Prepare($sql) // returns query ID if successful, otherwise false // there have been reports of problems with nested queries - the code is probably not re-entrant? - function _query($sql,$iarr=false) + function _query($sql, $inputarr = false) { - if (!$this->autoCommit && $this->_transactionID) { $conn = $this->_transactionID; $docommit = false; @@ -345,28 +344,35 @@ function _query($sql,$iarr=false) if (is_array($sql)) { $fn = 'ibase_execute'; $sql = $sql[1]; - if (is_array($iarr)) { - if ( !isset($iarr[0]) ) - $iarr[0] = ''; // PHP5 compat hack - $fnarr = array_merge( array($sql) , $iarr); - $ret = call_user_func_array($fn,$fnarr); - } - else { + if (is_array($inputarr)) { + if (!isset($inputarr[0])) { + $inputarr[0] = ''; // PHP5 compat hack + } + $fnarr = array_merge(array($sql), $inputarr); + $ret = call_user_func_array($fn, $fnarr); + } else { $ret = $fn($sql); } } else { $fn = 'ibase_query'; - if (is_array($iarr)) { - if (sizeof($iarr) == 0) - $iarr[0] = ''; // PHP5 compat hack - $fnarr = array_merge( array($conn,$sql) , $iarr); - $ret = call_user_func_array($fn,$fnarr); - } - else { + if (is_array($inputarr)) { + if (sizeof($inputarr) == 0) { + $inputarr[0] = ''; // PHP5 compat hack + } + $fnarr = array_merge(array($conn, $sql), $inputarr); + $ret = call_user_func_array($fn, $fnarr); + } else { $ret = $fn($conn, $sql); } } + + // ibase_query() and ibase_execute() return number of affected rows + // ADOConnection::_Execute() expects true for INSERT/UPDATE/DELETE + if (is_numeric($ret)) { + $ret = true; + } + if ($docommit && $ret === true) { ibase_commit($this->_connectionID); } @@ -514,17 +520,24 @@ function MetaColumns($table, $normalize=true) $fld->has_default = true; $d = substr($rs->fields[2],strlen('default ')); - switch ($fld->type) - { - case 'smallint': - case 'integer': $fld->default_value = (int) $d; break; - case 'char': - case 'blob': - case 'text': - case 'varchar': $fld->default_value = (string) substr($d,1,strlen($d)-2); break; - case 'double': - case 'float': $fld->default_value = (float) $d; break; - default: $fld->default_value = $d; break; + switch ($fld->type) { + case 'smallint': + case 'integer': + $fld->default_value = (int)$d; + break; + case 'char': + case 'blob': + case 'text': + case 'varchar': + $fld->default_value = (string)substr($d, 1, strlen($d) - 2); + break; + case 'double': + case 'float': + $fld->default_value = (float)$d; + break; + default: + $fld->default_value = $d; + break; } // case 35:$tt = 'TIMESTAMP'; break; } @@ -558,9 +571,6 @@ function BlobDecode($blob) return $blob; } - - - // old blobdecode function // still used to auto-decode all blob's function _BlobDecode_old( $blob ) @@ -625,34 +635,34 @@ function UpdateBlobFile($table,$column,$path,$where,$blobtype='BLOB') */ function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') { - $blob_id = ibase_blob_create($this->_connectionID); + $blob_id = ibase_blob_create($this->_connectionID); - // ibase_blob_add($blob_id, $val); + // ibase_blob_add($blob_id, $val); - // replacement that solves the problem by which only the first modulus 64K / - // of $val are stored at the blob field //////////////////////////////////// - // Thx Abel Berenstein aberenstein#afip.gov.ar - $len = strlen($val); - $chunk_size = 32768; - $tail_size = $len % $chunk_size; - $n_chunks = ($len - $tail_size) / $chunk_size; + // replacement that solves the problem by which only the first modulus 64K / + // of $val are stored at the blob field //////////////////////////////////// + // Thx Abel Berenstein aberenstein#afip.gov.ar + $len = strlen($val); + $chunk_size = 32768; + $tail_size = $len % $chunk_size; + $n_chunks = ($len - $tail_size) / $chunk_size; - for ($n = 0; $n < $n_chunks; $n++) { - $start = $n * $chunk_size; - $data = substr($val, $start, $chunk_size); - ibase_blob_add($blob_id, $data); - } + for ($n = 0; $n < $n_chunks; $n++) { + $start = $n * $chunk_size; + $data = substr($val, $start, $chunk_size); + ibase_blob_add($blob_id, $data); + } - if ($tail_size) { - $start = $n_chunks * $chunk_size; - $data = substr($val, $start, $tail_size); - ibase_blob_add($blob_id, $data); - } - // end replacement ///////////////////////////////////////////////////////// + if ($tail_size) { + $start = $n_chunks * $chunk_size; + $data = substr($val, $start, $tail_size); + ibase_blob_add($blob_id, $data); + } + // end replacement ///////////////////////////////////////////////////////// - $blob_id_str = ibase_blob_close($blob_id); + $blob_id_str = ibase_blob_close($blob_id); - return $this->Execute("UPDATE $table SET $column=(?) WHERE $where",array($blob_id_str)) != false; + return $this->Execute("UPDATE $table SET $column=(?) WHERE $where", array($blob_id_str)) != false; } @@ -724,7 +734,7 @@ function SQLDate($fmt, $col=false) Class Name: Recordset --------------------------------------------------------------------------------------*/ -class ADORecordset_ibase extends ADORecordSet +class ADORecordSet_ibase extends ADORecordSet { var $databaseType = "ibase"; @@ -844,13 +854,12 @@ function Fields($colname) } return $this->fields[$this->bind[strtoupper($colname)]]; - } function _close() { - return @ibase_free_result($this->_queryID); + return @ibase_free_result($this->_queryID); } function MetaType($t,$len=-1,$fieldobj=false) @@ -860,35 +869,41 @@ function MetaType($t,$len=-1,$fieldobj=false) $t = $fieldobj->type; $len = $fieldobj->max_length; } - + $t = strtoupper($t); - - if (array_key_exists($t,$this->connection->customActualTypes)) - return $this->connection->customActualTypes[$t]; + + if (array_key_exists($t, $this->connection->customActualTypes)) { + return $this->connection->customActualTypes[$t]; + } switch ($t) { - - case 'CHAR': - return 'C'; - - case 'TEXT': - case 'VARCHAR': - case 'VARYING': - if ($len <= $this->blobSize) return 'C'; - return 'X'; - case 'BLOB': - return 'B'; - - case 'TIMESTAMP': - case 'DATE': return 'D'; - case 'TIME': return 'T'; - //case 'T': return 'T'; - - //case 'L': return 'L'; - case 'INT': - case 'SHORT': - case 'INTEGER': return 'I'; - default: return ADODB_DEFAULT_METATYPE; + case 'CHAR': + return 'C'; + + case 'TEXT': + case 'VARCHAR': + case 'VARYING': + if ($len <= $this->blobSize) { + return 'C'; + } + return 'X'; + case 'BLOB': + return 'B'; + + case 'TIMESTAMP': + case 'DATE': + return 'D'; + case 'TIME': + return 'T'; + //case 'T': return 'T'; + + //case 'L': return 'L'; + case 'INT': + case 'SHORT': + case 'INTEGER': + return 'I'; + default: + return ADODB_DEFAULT_METATYPE; } } diff --git a/vendor/adodb/adodb-php/drivers/adodb-informix72.inc.php b/vendor/adodb/adodb-php/drivers/adodb-informix72.inc.php index 79e5138a9c..6fddde3d62 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-informix72.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-informix72.inc.php @@ -80,12 +80,9 @@ function __construct() function ServerInfo() { - if (isset($this->version)) return $this->version; - - $arr['description'] = $this->GetOne("select DBINFO('version','full') from systables where tabid = 1"); - $arr['version'] = $this->GetOne("select DBINFO('version','major') || DBINFO('version','minor') from systables where tabid = 1"); - $this->version = $arr; - return $arr; + $arr['description'] = $this->GetOne("select DBINFO('version','full') from systables where tabid = 1"); + $arr['version'] = $this->GetOne("select DBINFO('version','major') || DBINFO('version','minor') from systables where tabid = 1"); + return $arr; } @@ -337,7 +334,6 @@ function Prepare($sql) else return array($sql,$stmt); } */ - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { global $ADODB_COUNTRECS; diff --git a/vendor/adodb/adodb-php/drivers/adodb-ldap.inc.php b/vendor/adodb/adodb-php/drivers/adodb-ldap.inc.php index 323b35856b..e1cba330e7 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-ldap.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-ldap.inc.php @@ -76,7 +76,7 @@ function _connect( $host, $username, $password, $ldapbase) if ($this->debug) ADOConnection::outp($e); return false; } - if( count( $LDAP_CONNECT_OPTIONS ) > 0 ) { + if(!empty($LDAP_CONNECT_OPTIONS)) { $this->_inject_bind_options( $LDAP_CONNECT_OPTIONS ); } @@ -157,7 +157,6 @@ function _inject_bind_options( $options ) { } } - /* returns _queryID or false */ function _query($sql,$inputarr=false) { $rs = @ldap_search( $this->_connectionID, $this->database, $sql ); diff --git a/vendor/adodb/adodb-php/drivers/adodb-mssql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mssql.inc.php index 8fb92249cc..c0b714ede2 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-mssql.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-mssql.inc.php @@ -541,7 +541,6 @@ function MetaTables($ttype=false,$showSchema=false,$mask=false) function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { return @mssql_select_db($dbName); } @@ -726,7 +725,6 @@ function UpdateBlob($table,$column,$val,$where,$blobtype='BLOB') return $this->Execute($sql) != false; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $this->_errorMsg = false; diff --git a/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php index dba647cb5c..f7e1bcc167 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-mssqlnative.inc.php @@ -151,6 +151,8 @@ function ServerInfo() { $arrServerInfo = sqlsrv_server_info($this->_connectionID); $ADODB_FETCH_MODE = $savem; + + $arr = array(); $arr['description'] = $arrServerInfo['SQLServerName'].' connected to '.$arrServerInfo['CurrentDatabase']; $arr['version'] = $arrServerInfo['SQLServerVersion'];//ADOConnection::_findvers($arr['description']); return $arr; @@ -182,8 +184,10 @@ protected function _insertID($table = '', $column = '') function _affectedrows() { - if ($this->_queryID) - return sqlsrv_rows_affected($this->_queryID); + if ($this->_queryID && is_resource($this->_queryID)) { + return sqlsrv_rows_affected($this->_queryID); + } + return false; } function GenID($seq='adodbseq',$start=1) { @@ -436,7 +440,6 @@ function RowLock($tables,$where,$col='1 as adodbignore') function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { $rs = $this->Execute('USE '.$dbName); if($rs) { @@ -643,13 +646,6 @@ function _query($sql, $inputarr = false) $rez = sqlsrv_query($this->_connectionID, $sql); } - if ($this->debug) { - ADOConnection::outp("<hr>running query: " . var_export($sql, true) - . "<hr>input array: " . var_export($inputarr, true) - . "<hr>result: " . var_export($rez, true) - ); - } - $this->lastInsID = false; if (!$rez) { $rez = false; @@ -659,23 +655,27 @@ function _query($sql, $inputarr = false) // e.g. if triggers are involved (see #41) while (sqlsrv_next_result($rez)) { sqlsrv_fetch($rez); - $this->lastInsID = sqlsrv_get_field($rez, 0, SQLSRV_PHPTYPE_INT); + $this->lastInsID = sqlsrv_get_field($rez, 0); } } return $rez; } - // returns true or false + /** + * Rolls back pending transactions and closes the connection. + * + * @return bool True, unless the connection id is invalid + */ function _close() { if ($this->transCnt) { $this->RollbackTrans(); } - if($this->_connectionID) { - $rez = sqlsrv_close($this->_connectionID); + if ($this->_connectionID) { + return sqlsrv_close($this->_connectionID); } $this->_connectionID = false; - return $rez; + return true; } diff --git a/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php b/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php index 10f58ec67e..a667827458 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-mysqli.inc.php @@ -75,6 +75,25 @@ class ADODB_mysqli extends ADOConnection { var $ssl_capath = null; var $ssl_cipher = null; + /** + * Forcing emulated prepared statements. + * + * When set to true, ADODb will not execute queries using MySQLi native + * bound variables, and will instead use the built-in string interpolation + * and argument quoting from the parent class {@see ADOConnection::Execute()}. + * + * This is needed for some database engines that use mysql wire-protocol but + * do not support prepared statements, like + * {@see https://manticoresearch.com/ Manticore Search} or + * {@see https://clickhouse.com/ ClickHouse}. + * + * WARNING: This is a potential security risk, and strongly discouraged for code + * handling untrusted input {@see https://github.com/ADOdb/ADOdb/issues/1028#issuecomment-2081586024}. + * + * @var bool $doNotUseBoundVariables + */ + var $doNotUseBoundVariables = false; + /** @var mysqli Identifier for the native database connection */ var $_connectionID = false; @@ -126,22 +145,74 @@ function SetTransactionMode($transaction_mode) } /** - * Adds a parameter to the connection string. + * Adds a parameter to the connection string, can also set connection property values. * * Parameter must be one of the constants listed in mysqli_options(). * @see https://www.php.net/manual/en/mysqli.options.php - * - * @param int $parameter The parameter to set - * @param string $value The value of the parameter + * + * OR + * + * Parameter must be a string matching one of the following special cases. + * 'ssl' - SSL values e.g. ('ssl' => ['ca' => '/path/to/ca.crt.pem']) + * 'clientflags' - Client flags of type 'MYSQLI_CLIENT_' + * @see https://www.php.net/manual/en/mysqli.real-connect.php + * @see https://www.php.net/manual/en/mysqli.constants.php + * 'socket' - The socket or named pipe that should be used + * 'port' - The port number to attempt to connect to the MySQL server + * + * @param string|int $parameter The parameter to set + * @param string|int|array $value The value of the parameter * * @return bool */ public function setConnectionParameter($parameter, $value) { - if(!is_numeric($parameter)) { - $this->outp_throw("Invalid connection parameter '$parameter'", __METHOD__); - return false; + + // Special case for setting SSL values. + if ("ssl" === $parameter && is_array($value)) { + if (isset($value["key"])) { + $this->ssl_key = $value["key"]; + } + if (isset($value["cert"])) { + $this->ssl_cert = $value["cert"]; + } + if (isset($value["ca"])) { + $this->ssl_ca = $value["ca"]; + } + if (isset($value["capath"])) { + $this->ssl_capath = $value["capath"]; + } + if (isset($value["cipher"])) { + $this->ssl_cipher = $value["cipher"]; + } + + return true; } - return parent::setConnectionParameter($parameter, $value); + + // Special case for setting the client flag(s). + if ("clientflags" === $parameter && is_numeric($value)) { + $this->clientFlags = $value; + return true; + } + + // Special case for setting the socket. + if ("socket" === $parameter && is_string($value)) { + $this->socket = $value; + return true; + } + + // Special case for setting the port. + if ("port" === $parameter && is_numeric($value)) { + $this->port = (int)$value; + return true; + } + + // Standard mysqli_options. + if (is_numeric($parameter)) { + return parent::setConnectionParameter($parameter, $value); + } + + $this->outp_throw("Invalid connection parameter '$parameter'", __METHOD__); + return false; } /** @@ -167,6 +238,14 @@ function _connect($argHostname = null, if(!extension_loaded("mysqli")) { return null; } + // Check for a function that only exists in mysqlnd + if (!function_exists('mysqli_stmt_get_result')) { + // @TODO This will be treated as if the mysqli extension were not available + // This could be misleading, so we output an additional error message. + // We should probably throw a specific exception instead. + $this->outp("MySQL Native Driver (msqlnd) required"); + return null; + } $this->_connectionID = @mysqli_init(); if (is_null($this->_connectionID)) { @@ -206,9 +285,14 @@ function _connect($argHostname = null, // SSL Connections for MySQLI if ($this->ssl_key || $this->ssl_cert || $this->ssl_ca || $this->ssl_capath || $this->ssl_cipher) { + mysqli_ssl_set($this->_connectionID, $this->ssl_key, $this->ssl_cert, $this->ssl_ca, $this->ssl_capath, $this->ssl_cipher); - $this->socket = MYSQLI_CLIENT_SSL; - $this->clientFlags = MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; + + // Check for any SSL client flag set, NOTE: bitwise operation. + if (!($this->clientFlags & MYSQLI_CLIENT_SSL)) { + ADOConnection::outp('When using certificates, set the client flag MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT or MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'); + return false; + } } #if (!empty($this->port)) $argHostname .= ":".$this->port; @@ -932,13 +1016,15 @@ function MetaColumns($table, $normalize = true) $SQL = "SELECT column_name, column_type FROM information_schema.columns - WHERE table_schema='{$this->databaseName}' + WHERE table_schema='{$this->database}' AND table_name='$table'"; $schemaArray = $this->getAssoc($SQL); - $schemaArray = array_change_key_case($schemaArray,CASE_LOWER); + if (is_array($schemaArray)) { + $schemaArray = array_change_key_case($schemaArray,CASE_LOWER); + $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); + } - $rs = $this->Execute(sprintf($this->metaColumnsSQL,$table)); if (isset($savem)) $this->SetFetchMode($savem); $ADODB_FETCH_MODE = $save; if (!is_object($rs)) @@ -1017,7 +1103,6 @@ function SelectDB($dbName) { // $this->_connectionID = $this->mysqli_resolve_link($this->_connectionID); $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { $result = @mysqli_select_db($this->_connectionID, $dbName); @@ -1092,18 +1177,12 @@ function Prepare($sql) return array($sql,$stmt); } - /** - * Execute SQL - * - * @param string $sql SQL statement to execute, or possibly an array - * holding prepared statement ($sql[0] will hold sql text) - * @param array|bool $inputarr holds the input data to bind to. - * Null elements will be set to null. - * - * @return ADORecordSet|bool - */ public function execute($sql, $inputarr = false) { + if ($this->doNotUseBoundVariables) { + return parent::execute($sql, $inputarr); + } + if ($this->fnExecute) { $fn = $this->fnExecute; $ret = $fn($this, $sql, $inputarr); @@ -1112,13 +1191,17 @@ public function execute($sql, $inputarr = false) } } - if ($inputarr === false) { + if ($inputarr === false || $inputarr === []) { return $this->_execute($sql); } if (!is_array($inputarr)) { $inputarr = array($inputarr); } + else { + //remove alphanumeric placeholders + $inputarr = array_values($inputarr); + } if (!is_array($sql)) { // Check if we are bulkbinding. If so, $inputarr is a 2d array, @@ -1143,8 +1226,10 @@ public function execute($sql, $inputarr = false) } $bulkTypeArray[] = $typeArray; } + $currentBulkBind = $this->bulkBind; $this->bulkBind = false; $ret = $this->_execute($sql, $bulkTypeArray); + $this->bulkBind = $currentBulkBind; } else { $typeArray = $this->getBindParamWithType($inputarr); $ret = $this->_execute($sql, $typeArray); @@ -1186,14 +1271,14 @@ private function getBindParamWithType($inputArr): array } /** - * Return the query id. - * - * @param string|array $sql - * @param array $inputarr - * - * @return bool|mysqli_result + * Execute a query. + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mysqli_result|bool */ - function _query($sql, $inputarr) + function _query($sql, $inputarr = false) { global $ADODB_COUNTRECS; // Move to the next recordset, or return false if there is none. In a stored proc @@ -1203,6 +1288,14 @@ function _query($sql, $inputarr) // Commented out for reasons of performance. You should retrieve every recordset yourself. // if (!mysqli_next_result($this->connection->_connectionID)) return false; + // When SQL is empty, mysqli_query() throws exception on PHP 8 (#945) + if (!$sql) { + if ($this->debug) { + ADOConnection::outp("Empty query"); + } + return false; + } + if (is_array($sql)) { // Prepare() not supported because mysqli_stmt_execute does not return a recordset, but @@ -1307,6 +1400,10 @@ function _query($sql, $inputarr) $ret = mysqli_stmt_execute($stmt); + // Store error code and message + $this->_errorCode = $stmt->errno; + $this->_errorMsg = $stmt->error; + /* * Did we throw an error? */ @@ -1314,18 +1411,13 @@ function _query($sql, $inputarr) return false; } - /* - * Is the statement a non-select - */ - if ($stmt->affected_rows > -1) - { + // Tells affected_rows to be compliant + $this->isSelectStatement = $stmt->affected_rows == -1; + if (!$this->isSelectStatement) { $this->statementAffectedRows = $stmt->affected_rows; return true; } - // Tells affected_rows to be compliant - $this->isSelectStatement = true; - // Turn the statement into a result set and return it return $stmt->get_result(); } @@ -1337,6 +1429,10 @@ function _query($sql, $inputarr) */ $this->usePreparedStatement = false; $this->useLastInsertStatement = false; + + // Reset error code and message + $this->_errorCode = 0; + $this->_errorMsg = ''; } /* @@ -1378,10 +1474,13 @@ function _query($sql, $inputarr) */ function ErrorMsg() { - if (empty($this->_connectionID)) - $this->_errorMsg = @mysqli_connect_error(); - else - $this->_errorMsg = @mysqli_error($this->_connectionID); + if (!$this->_errorMsg) { + if (empty($this->_connectionID)) { + $this->_errorMsg = mysqli_connect_error(); + } else { + $this->_errorMsg = $this->_connectionID->error ?? $this->_connectionID->connect_error; + } + } return $this->_errorMsg; } @@ -1392,10 +1491,14 @@ function ErrorMsg() */ function ErrorNo() { - if (empty($this->_connectionID)) - return @mysqli_connect_errno(); - else - return @mysqli_errno($this->_connectionID); + if (!$this->_errorCode) { + if (empty($this->_connectionID)) { + $this->_errorCode = mysqli_connect_errno(); + } else { + $this->_errorCode = $this->_connectionID->errno ?? $this->_connectionID->connect_errno; + } + } + return $this->_errorCode; } /** @@ -1445,6 +1548,9 @@ function getCharSet() return $this->charSet ?: false; } + /** + * @deprecated 5.21.0 Use {@see setConnectionParameter()} instead + */ function setCharSet($charset) { if (!$this->_connectionID || !method_exists($this->_connectionID,'set_charset')) { diff --git a/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php index c1f4e50205..b92281c71d 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-oci8.inc.php @@ -92,7 +92,7 @@ class ADODB_oci8 extends ADOConnection { var $random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)"; var $noNullStrings = false; var $connectSID = false; - var $_bind = false; + var $_bind = array(); var $_nestedSQL = true; var $_getarray = false; // currently not working var $leftOuter = ''; // oracle wierdness, $col = $value (+) for LEFT OUTER, $col (+)= $value for RIGHT OUTER @@ -321,10 +321,6 @@ function IfNull( $field, $ifNull ) protected function _insertID($table = '', $column = '') { - - if (!$this->seqField) - return false; - if ($this->schema) { $t = strpos($table,'.'); @@ -785,6 +781,11 @@ function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) $hint = ''; } + // If non-bound statement, $inputarr is false + if (!$inputarr) { + $inputarr = array(); + } + if ($offset == -1 || ($offset < $this->selectOffsetAlg1 && 0 < $nrows && $nrows < 1000)) { if ($nrows > 0) { if ($offset > 0) { @@ -792,10 +793,6 @@ function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) } $sql = "select * from (".$sql.") where rownum <= :adodb_offset"; - // If non-bound statement, $inputarr is false - if (!$inputarr) { - $inputarr = array(); - } $inputarr['adodb_offset'] = $nrows; $nrows = -1; } @@ -813,32 +810,31 @@ function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0) } $stmt = $stmt_arr[1]; - if (is_array($inputarr)) { - foreach($inputarr as $k => $v) { - $i=0; - if ($this->databaseType == 'oci8po') { - $bv_name = ":".$i++; + foreach($inputarr as $k => $v) { + $i = 0; + if ($this->databaseType == 'oci8po') { + $bv_name = ":" . $i++; + } else { + $bv_name = ":" . $k; + } + if (is_array($v)) { + // suggested by g.giunta@libero. + if (sizeof($v) == 2) { + oci_bind_by_name($stmt, $bv_name, $inputarr[$k][0], $v[1]); } else { - $bv_name = ":".$k; + oci_bind_by_name($stmt, $bv_name, $inputarr[$k][0], $v[1], $v[2]); } - if (is_array($v)) { - // suggested by g.giunta@libero. - if (sizeof($v) == 2) { - oci_bind_by_name($stmt,$bv_name,$inputarr[$k][0],$v[1]); - } - else { - oci_bind_by_name($stmt,$bv_name,$inputarr[$k][0],$v[1],$v[2]); - } + } else { + $len = -1; + if ($v === ' ') { + $len = 1; + } + if (isset($bindarr)) { + // prepared sql, so no need to oci_bind_by_name again + $bindarr[$k] = $v; } else { - $len = -1; - if ($v === ' ') { - $len = 1; - } - if (isset($bindarr)) { // is prepared sql, so no need to oci_bind_by_name again - $bindarr[$k] = $v; - } else { // dynamic sql, so rebind every time - oci_bind_by_name($stmt,$bv_name,$inputarr[$k],$len); - } + // dynamic sql, so rebind every time + oci_bind_by_name($stmt, $bv_name, $inputarr[$k], $len); } } } @@ -975,16 +971,6 @@ function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB') return $rez; } - /** - * Execute SQL - * - * @param string|array $sql SQL statement to execute, or possibly an array holding - * prepared statement ($sql[0] will hold sql text). - * @param array|false $inputarr holds the input data to bind to. - * Null elements will be set to null. - * - * @return ADORecordSet|false - */ function Execute($sql,$inputarr=false) { if ($this->fnExecute) { @@ -1151,10 +1137,11 @@ function ExecuteCursor($sql,$cursorName='rs',$params=false) } else $hasref = false; + /** @var ADORecordset_oci8 $rs */ $rs = $this->Execute($stmt); if ($rs) { if ($rs->databaseType == 'array') { - oci_free_cursor($stmt[4]); + oci_free_statement($stmt[4]); } elseif ($hasref) { $rs->_refcursor = $stmt[4]; @@ -1285,7 +1272,8 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) } /** - * returns query ID if successful, otherwise false + * Execute a query. + * * this version supports: * * 1. $db->execute('select * from table'); @@ -1298,6 +1286,11 @@ function Parameter(&$stmt,&$var,$name,$isOutput=false,$maxLen=4000,$type=false) * 4. $db->prepare('insert into table (a,b,c) values (:0,:1,:2)'); * $db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3); * $db->execute($stmt); + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. */ function _query($sql,$inputarr=false) { @@ -1583,8 +1576,8 @@ function TextMax() */ function qStr($s, $magic_quotes=false) { - if ($this->noNullStrings && strlen($s) == 0) { - $s = ' '; + if (strlen((string)$s) == 0) { + return $this->noNullStrings ? "' '" : "''"; } if ($this->replaceQuote[0] == '\\'){ $s = str_replace('\\','\\\\',$s); @@ -1604,6 +1597,9 @@ class ADORecordset_oci8 extends ADORecordSet { var $bind=false; var $_fieldobjs; + /** @var resource Cursor reference */ + var $_refcursor; + function __construct($queryID,$mode=false) { if ($mode === false) { diff --git a/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php index 50630cad69..71c203b62a 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-oci8po.inc.php @@ -70,7 +70,16 @@ function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0 return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); } - // emulate handling of parameters ? ?, replacing with :bind0 :bind1 + /** + * Execute a query. + * + * Emulate handling of parameters ? ?, replacing with :bind0 :bind1 + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ function _query($sql,$inputarr=false) { if (is_array($inputarr)) { @@ -85,21 +94,21 @@ function _query($sql,$inputarr=false) } return ADODB_oci8::_query($sql,$inputarr); } - + /** * Replaces compatibility bind markers with oracle ones and returns a * valid sql statement * * This replaces a regexp based section of code that has been subject * to numerous tweaks, as more extreme test cases have appeared. This - * is now done this like this to help maintainability and avoid the + * is now done this like this to help maintainability and avoid the * need to rely on regexp experienced maintainers * * @param string $sql The sql statement * @param string[] $inputarr The bind array * * @return string The modified statement - */ + */ private function extractBinds($sql,$inputarr) { $inString = false; @@ -107,14 +116,13 @@ private function extractBinds($sql,$inputarr) $sqlLength = strlen($sql) - 1; $newSql = ''; $bindCount = 0; - + /* * inputarr is the passed in bind list, which is associative, but * we only want the keys here */ $inputKeys = array_keys($inputarr); - - + for ($i=0;$i<=$sqlLength;$i++) { /* @@ -137,7 +145,7 @@ private function extractBinds($sql,$inputarr) * We found the end of the string */ $inString = false; - + if ($escaped == 2) $escaped = 0; @@ -151,7 +159,7 @@ private function extractBinds($sql,$inputarr) * Add the current character the pile */ $newSql .= $c; - + if ($escaped == 1) /* * We have just found an escape character, make sure we ignore the @@ -159,9 +167,9 @@ private function extractBinds($sql,$inputarr) */ $escaped = 2; } - + return $newSql; - + } } @@ -192,14 +200,14 @@ function _FetchField($fieldOffset = -1) { $fld = new ADOFieldObject; $fieldOffset += 1; - $fld->name = OCIcolumnname($this->_queryID, $fieldOffset); + $fld->name = oci_field_name($this->_queryID, $fieldOffset); if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) { $fld->name = strtolower($fld->name); } - $fld->type = OCIcolumntype($this->_queryID, $fieldOffset); - $fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset); + $fld->type = oci_field_type($this->_queryID, $fieldOffset); + $fld->max_length = oci_field_size($this->_queryID, $fieldOffset); if ($fld->type == 'NUMBER') { - $sc = OCIColumnScale($this->_queryID, $fieldOffset); + $sc = oci_field_scale($this->_queryID, $fieldOffset); if ($sc == 0) { $fld->type = 'INT'; } @@ -231,7 +239,6 @@ function MoveNext() return false; } - /* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */ function GetArrayLimit($nrows,$offset=-1) { if ($offset <= 0) { @@ -239,7 +246,7 @@ function GetArrayLimit($nrows,$offset=-1) return $arr; } for ($i=1; $i < $offset; $i++) - if (!@OCIFetch($this->_queryID)) { + if (!@oci_fetch($this->_queryID)) { $arr = array(); return $arr; } diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php index a9705e2d80..56db8b0e1b 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-odbc.inc.php @@ -26,7 +26,7 @@ /* * These constants are used to set define MetaColumns() method's behavior. - * - METACOLUMNS_RETURNS_ACTUAL makes the driver return the actual type, + * - METACOLUMNS_RETURNS_ACTUAL makes the driver return the actual type, * like all other drivers do (default) * - METACOLUMNS_RETURNS_META is provided for legacy compatibility (makes * driver behave as it did prior to v5.21) @@ -35,7 +35,7 @@ */ DEFINE('METACOLUMNS_RETURNS_ACTUAL', 0); DEFINE('METACOLUMNS_RETURNS_META', 1); - + /*-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------*/ @@ -57,7 +57,7 @@ class ADODB_odbc extends ADOConnection { var $_autocommit = true; var $_lastAffectedRows = 0; var $uCaseTables = true; // for meta* functions, uppercase table names - + /* * Tells the metaColumns feature whether to return actual or meta type */ @@ -81,7 +81,9 @@ function _connect($argDSN, $argUsername, $argPassword, $argDatabasename) if ($this->curmode === false) $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword); else $this->_connectionID = odbc_connect($argDSN,$argUsername,$argPassword,$this->curmode); $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); - if (isset($this->connectStmt)) $this->Execute($this->connectStmt); + if ($this->connectStmt) { + $this->Execute($this->connectStmt); + } return $this->_connectionID != false; } @@ -102,7 +104,9 @@ function _pconnect($argDSN, $argUsername, $argPassword, $argDatabasename) $this->_errorMsg = $this->getChangedErrorMsg($last_php_error); if ($this->_connectionID && $this->autoRollback) @odbc_rollback($this->_connectionID); - if (isset($this->connectStmt)) $this->Execute($this->connectStmt); + if ($this->connectStmt) { + $this->Execute($this->connectStmt); + } return $this->_connectionID != false; } @@ -469,7 +473,7 @@ function MetaColumns($table, $normalize=true) $fld = new ADOFieldObject(); $fld->name = $rs->fields[3]; if ($this->metaColumnsReturnType == METACOLUMNS_RETURNS_META) - /* + /* * This is the broken, original value */ $fld->type = $this->ODBCTypes($rs->fields[4]); @@ -514,7 +518,6 @@ function Prepare($sql) return array($sql,$stmt,false); } - /* returns queryID or false */ function _query($sql,$inputarr=false) { $last_php_error = $this->resetLastError(); diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php index 9f53d3d7c3..1f8b98d269 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql.inc.php @@ -49,8 +49,12 @@ class ADODB_odbc_mssql extends ADODB_odbc { var $ansiOuter = true; // for mssql7 or later var $identitySQL = 'select SCOPE_IDENTITY()'; // 'select SCOPE_IDENTITY'; # for mssql 2000 var $hasInsertID = true; - var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # When SET CONCAT_NULL_YIELDS_NULL is ON, - # concatenating a null value with a string yields a NULL result + /** + * When SET CONCAT_NULL_YIELDS_NULL is ON, concatenating a null value with + * a string yields a NULL result. + * @var string SQL statement executed after successful connection. + */ + public $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL OFF'; # // crashes php... function ServerInfo() diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql2012.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql2012.inc.php index 79fa32516f..86f7f8c31a 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql2012.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-odbc_mssql2012.inc.php @@ -26,10 +26,11 @@ class ADODB_odbc_mssql2012 extends ADODB_odbc_mssql { - /* - * Makes behavior similar to prior versions of SQL Server - */ - var $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL ON'; + /** + * Makes behavior similar to prior versions of SQL Server. + * @var string SQL statement executed after successful connection. + */ + public $connectStmt = 'SET CONCAT_NULL_YIELDS_NULL ON'; } class ADORecordSet_odbc_mssql2012 extends ADORecordSet_odbc_mssql diff --git a/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php b/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php index 41bd0873ba..e3f814810c 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-odbtp.inc.php @@ -46,6 +46,15 @@ class ADODB_odbtp extends ADOConnection{ var $_canPrepareSP = false; var $_dontPoolDBC = true; + /** @var string DBMS name. */ + var $odbc_name; + + /** @var bool */ + var $_canSelectDb = false; + + /** @var mixed */ + var $_lastAffectedRows; + function ServerInfo() { return array('description' => @odbtp_get_attr( ODB_ATTR_DBMSNAME, $this->_connectionID), @@ -304,7 +313,6 @@ function SelectDB($dbName) return false; } $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions return true; } diff --git a/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php b/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php index 1a2735b147..dc0462fe2f 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-oracle.inc.php @@ -181,7 +181,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { // <G. Giunta 2003/03/03/> Reset error messages before executing diff --git a/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php b/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php index e0e6c72972..d3ce12d08d 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-pdo.inc.php @@ -82,9 +82,17 @@ class ADODB_pdo extends ADOConnection { var $_errormsg = false; var $_errorno = false; - var $stmt = false; + var $_stmt = false; + + /** @var ADODB_pdo_base */ var $_driver; + /** @var PDO */ + var $_connectionID; + + /** @var PDOStatement */ + var $_queryID; + /* * Describe parameters passed directly to the PDO driver * @@ -230,11 +238,11 @@ function _connect($argDSN, $argUsername, $argPassword, $argDatabasename, $persis function Concat() { $args = func_get_args(); - if(method_exists($this->_driver, 'Concat')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'Concat')) { return call_user_func_array(array($this->_driver, 'Concat'), $args); } - return call_user_func_array('parent::Concat', $args); + return call_user_func_array(parent::class . '::Concat', $args); } /** @@ -248,13 +256,13 @@ function Concat() public function param($name,$type='C') { $args = func_get_args(); - if(method_exists($this->_driver, 'param')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'param')) { // Return the driver specific entry, that mimics the native driver return call_user_func_array(array($this->_driver, 'param'), $args); } // No driver specific method defined, use mysql format '?' - return call_user_func_array('parent::param', $args); + return call_user_func_array(parent::class . '::param', $args); } // returns true or false @@ -441,14 +449,14 @@ function ErrorNo() */ function SetAutoCommit($auto_commit) { - if(method_exists($this->_driver, 'SetAutoCommit')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'SetAutoCommit')) { $this->_driver->SetAutoCommit($auto_commit); } } function SetTransactionMode($transaction_mode) { - if(method_exists($this->_driver, 'SetTransactionMode')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'SetTransactionMode')) { return $this->_driver->SetTransactionMode($transaction_mode); } @@ -457,7 +465,7 @@ function SetTransactionMode($transaction_mode) function beginTrans() { - if(method_exists($this->_driver, 'beginTrans')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'beginTrans')) { return $this->_driver->beginTrans(); } @@ -477,7 +485,7 @@ function beginTrans() function commitTrans($ok=true) { - if(method_exists($this->_driver, 'commitTrans')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'commitTrans')) { return $this->_driver->commitTrans($ok); } @@ -502,7 +510,7 @@ function commitTrans($ok=true) function RollbackTrans() { - if(method_exists($this->_driver, 'RollbackTrans')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'RollbackTrans')) { return $this->_driver->RollbackTrans(); } @@ -544,7 +552,7 @@ function PrepareStmt($sql) public function createSequence($seqname='adodbseq',$startID=1) { - if(method_exists($this->_driver, 'createSequence')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'createSequence')) { return $this->_driver->createSequence($seqname, $startID); } @@ -553,7 +561,7 @@ public function createSequence($seqname='adodbseq',$startID=1) function DropSequence($seqname='adodbseq') { - if(method_exists($this->_driver, 'DropSequence')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'DropSequence')) { return $this->_driver->DropSequence($seqname); } @@ -562,7 +570,7 @@ function DropSequence($seqname='adodbseq') function GenID($seqname='adodbseq',$startID=1) { - if(method_exists($this->_driver, 'GenID')) { + if($this->_driver instanceof ADODB_pdo && method_exists($this->_driver, 'GenID')) { return $this->_driver->GenID($seqname, $startID); } @@ -570,7 +578,6 @@ function GenID($seqname='adodbseq',$startID=1) } - /* returns queryID or false */ function _query($sql,$inputarr=false) { $ok = false; @@ -661,6 +668,9 @@ function qStr($s, $magic_quotes = false) } +/** + * Base class for Database-specific PDO drivers. + */ class ADODB_pdo_base extends ADODB_pdo { var $sysDate = "'?'"; @@ -779,6 +789,9 @@ class ADORecordSet_pdo extends ADORecordSet { var $databaseType = "pdo"; var $dataProvider = "pdo"; + /** @var PDOStatement */ + var $_queryID; + function __construct($id,$mode=false) { if ($mode === false) { @@ -919,4 +932,7 @@ function Fields($colname) } -class ADORecordSet_array_pdo extends ADORecordSet_array {} +class ADORecordSet_array_pdo extends ADORecordSet_array { + /** @var PDOStatement */ + var $_queryID; +} diff --git a/vendor/adodb/adodb-php/drivers/adodb-pdo_firebird.inc.php b/vendor/adodb/adodb-php/drivers/adodb-pdo_firebird.inc.php index 0ee5e02b6c..f8847c3cc9 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-pdo_firebird.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-pdo_firebird.inc.php @@ -32,14 +32,6 @@ class ADODB_pdo_firebird extends ADODB_pdo var $arrayClass = 'ADORecordSet_array_pdo_firebird'; - function _init($parentDriver) - { - $this->pdoDriver = $parentDriver; - //$parentDriver->_bindInputArray = true; - //$parentDriver->hasTransactions = false; // // should be set to false because of PDO SQLite driver not supporting changing autocommit mode - //$parentDriver->hasInsertID = true; - } - /** * Gets the version iformation from the server * @@ -243,12 +235,6 @@ public function dropSequence($seqname = 'adodbseq') return $this->Execute("DROP SEQUENCE $seqname"); } - - public function _affectedrows() - { - return fbird_affected_rows($this->_transactionID ? $this->_transactionID : $this->_connectionID); - } - public function genId($seqname = 'adodbseq', $startID = 1) { $getnext = ("SELECT Gen_ID($seqname,1) FROM RDB\$DATABASE"); diff --git a/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php index c8812453fd..a00c8595bc 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-pdo_mysql.inc.php @@ -57,7 +57,7 @@ function OffsetDate($dayFraction, $date=false) return $date . ' + INTERVAL ' . $fraction . ' SECOND'; // return "from_unixtime(unix_timestamp($date)+$fraction)"; } - + /** * Get a list of indexes on the specified table. * @@ -266,7 +266,6 @@ function MetaColumns($table, $normalize=true) function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions $try = $this->Execute('use ' . $dbName); return ($try !== false); } @@ -275,7 +274,7 @@ function SelectDB($dbName) function SelectLimit($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs=0) { $nrows = (int) $nrows; - $offset = (int) $offset; + $offset = (int) $offset; $offsetStr =($offset>=0) ? "$offset," : ''; // jason judge, see PHPLens Issue No: 9220 if ($nrows < 0) { diff --git a/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php b/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php index 22e0329b8f..6c06ac1031 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-pdo_pgsql.inc.php @@ -60,7 +60,7 @@ class ADODB_pdo_pgsql extends ADODB_pdo { var $_genIDSQL = "SELECT NEXTVAL('%s')"; var $_genSeqSQL = "CREATE SEQUENCE %s START %s"; var $_dropSeqSQL = "DROP SEQUENCE %s"; - var $metaDefaultsSQL = "SELECT d.adnum as num, pg_get_expr(d.adbin, d.adrelid) as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum"; + var $metaDefaultsSQL = "SELECT d.adnum as num, d.adsrc as def from pg_attrdef d, pg_class c where d.adrelid=c.oid and c.relname='%s' order by d.adnum"; var $random = 'random()'; /// random function var $concat_operator='||'; diff --git a/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlsrv.inc.php b/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlsrv.inc.php index ed73f3a247..de5fbba022 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlsrv.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-pdo_sqlsrv.inc.php @@ -36,10 +36,15 @@ function _init(ADODB_pdo $parentDriver) $parentDriver->fmtDate = "'Y-m-d'"; } - function BeginTrans() + function setTransactionMode( $transaction_mode ) { - $returnval = parent::BeginTrans(); - return $returnval; + $this->_transmode = $transaction_mode; + if (empty($transaction_mode)) { + $this->_connectionID->query('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); + return; + } + if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; + $this->_connectionID->query("SET TRANSACTION ".$transaction_mode); } function MetaColumns($table, $normalize = true) @@ -54,8 +59,7 @@ function MetaTables($ttype = false, $showSchema = false, $mask = false) function SelectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs2cache = 0) { - $ret = ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); - return $ret; + return ADOConnection::SelectLimit($sql, $nrows, $offset, $inputarr, $secs2cache); } function ServerInfo() @@ -167,15 +171,5 @@ public function fetchField($fieldOffset = 0) return $o; } - - function SetTransactionMode( $transaction_mode ) - { - $this->_transmode = $transaction_mode; - if (empty($transaction_mode)) { - $this->_connectionID->query('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); - return; - } - if (!stristr($transaction_mode,'isolation')) $transaction_mode = 'ISOLATION LEVEL '.$transaction_mode; - $this->_connectionID->query("SET TRANSACTION ".$transaction_mode); - } + } diff --git a/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php b/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php index 525e09d25c..cda1e96210 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-postgres64.inc.php @@ -26,7 +26,7 @@ class ADODB_postgres64 extends ADOConnection{ var $databaseType = 'postgres64'; var $dataProvider = 'postgres'; var $hasInsertID = true; - /** @var bool|resource */ + /** @var PgSql\Connection|resource|false */ var $_resultid = false; var $concat_operator='||'; var $metaDatabasesSQL = "select datname from pg_database where datname not in ('template0','template1') order by 1"; @@ -84,6 +84,9 @@ class ADODB_postgres64 extends ADOConnection{ /** @var int $_pnum Number of the last assigned query parameter {@see param()} */ var $_pnum = 0; + var $version; + var $_nestedSQL = false; + // The last (fmtTimeStamp is not entirely correct: // PostgreSQL also has support for time zones, // and writes these time in this format: "2001-03-01 18:59:26+02". @@ -110,13 +113,12 @@ function ServerInfo($detailed = true) } $version = pg_version($this->_connectionID); + // If PHP has been compiled with PostgreSQL 7.3 or lower, then + // server_version is not set so we use pg_parameter_status() instead. + $version_server = $version['server'] ?? pg_parameter_status($this->_connectionID, 'server_version'); + $this->version = array( - // If PHP has been compiled with PostgreSQL 7.3 or lower, then - // server version is not set so we use pg_parameter_status() - // which includes logic to obtain values server_version - 'version' => isset($version['server']) - ? $version['server'] - : pg_parameter_status($this->_connectionID, 'server_version'), + 'version' => $this->_findvers($version_server), 'client' => $version['client'], 'description' => null, ); @@ -133,10 +135,20 @@ function IfNull( $field, $ifNull ) return " coalesce($field, $ifNull) "; } - // get the last id - never tested - function pg_insert_id($tablename,$fieldname) + /** + * Get the last inserted id. + * + * @param string $tablename + * @param string $fieldname + * @return int|false + * + * @noinspection PhpUnused + * @deprecated 5.22.9 Use {@see insert_ID()} method instead. + */ + function pg_insert_id($tablename, $fieldname) { - $result=pg_query($this->_connectionID, 'SELECT last_value FROM '. $tablename .'_'. $fieldname .'_seq'); + $sequence = pg_escape_identifier($this->_connectionID, $tablename .'_'. $fieldname .'_seq'); + $result = pg_query($this->_connectionID, 'SELECT last_value FROM '. $sequence); if ($result) { $arr = @pg_fetch_row($result,0); pg_free_result($result); @@ -155,7 +167,7 @@ function pg_insert_id($tablename,$fieldname) */ protected function _insertID($table = '', $column = '') { - if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false; + if ($this->_resultid === false) return false; $oid = pg_last_oid($this->_resultid); // to really return the id, we need the table and column-name, else we can only return the oid != id return empty($table) || empty($column) ? $oid : $this->GetOne("SELECT $column FROM $table WHERE oid=".(int)$oid); @@ -163,7 +175,7 @@ protected function _insertID($table = '', $column = '') function _affectedrows() { - if (!is_resource($this->_resultid) || get_resource_type($this->_resultid) !== 'pgsql result') return false; + if ($this->_resultid === false) return false; return pg_affected_rows($this->_resultid); } @@ -255,7 +267,9 @@ function qStr($s, $magic_quotes=false) if ($this->_connectionID) { return "'" . pg_escape_string($this->_connectionID, $s) . "'"; } else { - return "'" . pg_escape_string($s) . "'"; + // Fall back to emulated escaping when there is no database connection. + // Avoids errors when using setSessionVariables() in the load balancer. + return parent::qStr( $s ); } } @@ -656,14 +670,16 @@ function MetaIndexes ($table, $primary = FALSE, $owner = false) return $false; } + // Get column names indexed by attnum so we can lookup the index key $col_names = $this->MetaColumnNames($table,true,true); - // 3rd param is use attnum, - // see https://sourceforge.net/p/adodb/bugs/45/ $indexes = array(); while ($row = $rs->FetchRow()) { $columns = array(); foreach (explode(' ', $row[2]) as $col) { - $columns[] = $col_names[$col]; + // When index attribute (pg_index.indkey) is an expression, $col == 0 + // @see https://www.postgresql.org/docs/current/catalog-pg-index.html + // so there is no matching column name - set it to null (see #940). + $columns[] = $col_names[$col] ?? null; } $indexes[$row[0]] = array( @@ -752,8 +768,7 @@ function _connect($str, $user='', $pwd='', $db='', $ctype=0) # PHP does not handle 'hex' properly ('x74657374' is returned as 't657374') # https://bugs.php.net/bug.php?id=59831 states this is in fact not a bug, # so we manually set bytea_output - if (!empty($this->connection->noBlobs) - && version_compare($info['version'], '9.0', '>=') + if (version_compare($info['version'], '9.0', '>=') && version_compare($info['client'], '9.2', '<') ) { $this->Execute('set bytea_output=escape'); @@ -778,7 +793,6 @@ function _pconnect($str,$user='',$pwd='',$db='') } - // returns queryID or false function _query($sql,$inputarr=false) { $this->_pnum = 0; @@ -844,7 +858,7 @@ function _query($sql,$inputarr=false) } // check if no data returned, then no need to create real recordset if ($rez && pg_num_fields($rez) <= 0) { - if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') { + if ($this->_resultid !== false) { pg_free_result($this->_resultid); } $this->_resultid = $rez; @@ -1075,9 +1089,7 @@ function _fetch() function _close() { - if (!is_resource($this->_queryID) - || get_resource_type($this->_queryID) != 'pgsql result' - ) { + if ($this->_queryID === false || $this->_queryID == self::DUMMY_QUERY_ID) { return true; } return pg_free_result($this->_queryID); diff --git a/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php b/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php index ddbe7a6e0d..b5e63acfac 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-postgres7.inc.php @@ -231,7 +231,7 @@ function _query($sql,$inputarr=false) } // check if no data returned, then no need to create real recordset if ($rez && pg_num_fields($rez) <= 0) { - if (is_resource($this->_resultid) && get_resource_type($this->_resultid) === 'pgsql result') { + if ($this->_resultid !== false) { pg_free_result($this->_resultid); } $this->_resultid = $rez; diff --git a/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php b/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php index 37c2aae141..58df47c63e 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-postgres8.inc.php @@ -45,11 +45,23 @@ class ADODB_postgres8 extends ADODB_postgres7 * @return int last inserted ID for given table/column, or the most recently * returned one if $table or $column are empty */ - protected function _insertID($table = '', $column = '') + protected function _insertID( $table = '', $column = '' ) { - return empty($table) || empty($column) - ? $this->GetOne("SELECT lastval()") - : $this->GetOne("SELECT currval(pg_get_serial_sequence('$table', '$column'))"); + global $ADODB_GETONE_EOF; + + $sql = empty($table) || empty($column) + ? 'SELECT lastval()' + : "SELECT currval(pg_get_serial_sequence('$table', '$column'))"; + + // Squelch "ERROR: lastval is not yet defined in this session" (see #978) + $result = @$this->GetOne($sql); + if ($result === false || $result == $ADODB_GETONE_EOF) { + if ($this->debug) { + ADOConnection::outp(__FUNCTION__ . "() failed : " . $this->errorMsg()); + } + return false; + } + return $result; } } diff --git a/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php b/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php index 88897af926..8d909fdea1 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-sqlanywhere.inc.php @@ -116,7 +116,7 @@ function load_blobvar_from_var($blobVarName, &$varName) { $conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1'); */ - function UpdateBlob($table,$column,&$val,$where,$blobtype='BLOB') + function updateBlob($table, $column, $val, $where, $blobtype = 'BLOB') { $blobVarName = 'hold_blob'; $this->create_blobvar($blobVarName); diff --git a/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php b/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php index 0711f1dde1..d41829c04a 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-sqlite.inc.php @@ -211,7 +211,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return true; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $rez = sqlite_query($sql,$this->_connectionID); diff --git a/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php b/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php index 318171a8c5..7e5f5ffdc9 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-sqlite3.inc.php @@ -32,7 +32,6 @@ class ADODB_sqlite3 extends ADOConnection { var $dataProvider = "sqlite"; var $replaceQuote = "''"; // string to use to replace quotes var $concat_operator='||'; - var $_errorNo = 0; var $hasLimit = true; var $hasInsertID = true; /// supports autoincrement ID? var $hasAffectedRows = true; /// supports affected rows for update/delete? @@ -276,17 +275,20 @@ function _affectedrows() return $this->_connectionID->changes(); } + protected function lastError() + { + $this->_errorMsg = $this->_connectionID->lastErrorMsg(); + $this->_errorCode = $this->_connectionID->lastErrorCode(); + } + function ErrorMsg() { - if ($this->_logsql) { - return $this->_errorMsg; - } - return ($this->_errorNo) ? $this->ErrorNo() : ''; //**tochange? + return $this->_errorMsg; } function ErrorNo() { - return $this->_connectionID->lastErrorCode(); //**tochange?? + return $this->_errorCode; } function SQLDate($fmt, $col=false) @@ -331,12 +333,11 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename); } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { $rez = $this->_connectionID->query($sql); if ($rez === false) { - $this->_errorNo = $this->_connectionID->lastErrorCode(); + $this->lastError(); } // If no data was returned, we don't need to create a real recordset elseif ($rez->numColumns() == 0) { @@ -648,6 +649,10 @@ function updateBlob($table, $column, $val, $where, $blobtype = 'BLOB') // Prepare the statement $stmt = $this->_connectionID->prepare($sql); + if ($stmt === false) { + $this->lastError(); + return false; + } // Set the first bind value equal to value we want to update if (!$stmt->bindValue(1, $val, SQLITE3_BLOB)) { diff --git a/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php b/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php index b8db074797..79fb82e8b5 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-sybase.inc.php @@ -95,7 +95,9 @@ function RollbackTrans() // http://www.isug.com/Sybase_FAQ/ASE/section6.1.html#6.1.4 function RowLock($tables,$where,$col='top 1 null as ignore') { - if (!$this->_hastrans) $this->BeginTrans(); + if (!$this->hasTransactions) { + $this->BeginTrans(); + } $tables = str_replace(',',' HOLDLOCK,',$tables); return $this->GetOne("select $col from $tables HOLDLOCK where $where"); @@ -104,7 +106,6 @@ function RowLock($tables,$where,$col='top 1 null as ignore') function SelectDB($dbName) { $this->database = $dbName; - $this->databaseName = $dbName; # obsolete, retained for compat with older adodb versions if ($this->_connectionID) { return @sybase_select_db($dbName); } @@ -169,7 +170,6 @@ function _pconnect($argHostname, $argUsername, $argPassword, $argDatabasename) return true; } - // returns query ID if successful, otherwise false function _query($sql,$inputarr=false) { global $ADODB_COUNTRECS; diff --git a/vendor/adodb/adodb-php/drivers/adodb-text.inc.php b/vendor/adodb/adodb-php/drivers/adodb-text.inc.php index 77ad06a0ba..36a1a0d4dc 100644 --- a/vendor/adodb/adodb-php/drivers/adodb-text.inc.php +++ b/vendor/adodb/adodb-php/drivers/adodb-text.inc.php @@ -129,14 +129,21 @@ function Connect(&$array, $types = false, $colnames = false) return true; } - - - // returns queryID or false - // We presume that the select statement is on the same table (what else?), - // with the only difference being the order by. - //You can filter by using $eval and each clause is stored in $arr .eg. $arr[1] == 'name' - // also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported - function _query($sql,$input_arr,$eval=false) + /** + * Execute a query. + * + * We presume that the select statement is on the same table (what else?), + * with the only difference being the order by. + * You can filter by using $eval and each clause is stored in $arr e.g. $arr[1] == 'name' + * also supports SELECT [DISTINCT] COL FROM ... -- only 1 col supported + * + * @param string|array $sql Query to execute. + * @param array $inputarr An optional array of parameters. + * @param string $eval Optional eval string + * + * @return mixed|bool Query identifier or true if execution successful, false if failed. + */ + function _query($sql, $inputarr=false, $eval=false) { if ($this->_origarray === false) return false; diff --git a/vendor/adodb/adodb-php/lang/adodb-ka.inc.php b/vendor/adodb/adodb-php/lang/adodb-ka.inc.php new file mode 100644 index 0000000000..480778d78a --- /dev/null +++ b/vendor/adodb/adodb-php/lang/adodb-ka.inc.php @@ -0,0 +1,52 @@ +<?php +/** + * Georgian language strings. + * + * This file is part of ADOdb, a Database Abstraction Layer library for PHP. + * + * @package ADOdb + * @link https://adodb.org Project's web site and documentation + * @link https://github.com/ADOdb/ADOdb Source code and issue tracker + * + * The ADOdb Library is dual-licensed, released under both the BSD 3-Clause + * and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option, + * any later version. This means you can use it in proprietary products. + * See the LICENSE.md file distributed with this source code for details. + * @license BSD-3-Clause + * @license LGPL-2.1-or-later + * + * @copyright 2000-2013 John Lim + * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community + * @author Temuri Doghonadze <temuri.doghonadze@gmail.com> + */ + +$ADODB_LANG_ARRAY = array ( + 'LANG' => 'ka', + DB_ERROR => 'უცნáƒáƒ‘ი შეცდáƒáƒ›áƒ', + DB_ERROR_ALREADY_EXISTS => 'უკვე áƒáƒ áƒ¡áƒ”ბáƒáƒ‘ს', + DB_ERROR_CANNOT_CREATE => 'შექმნრშეუძლებელიáƒ', + DB_ERROR_CANNOT_DELETE => 'წáƒáƒ¨áƒšáƒ შეუძლებელიáƒ', + DB_ERROR_CANNOT_DROP => 'წáƒáƒ¨áƒšáƒ შეუძლებელირ(drop)', + DB_ERROR_CONSTRAINT => 'შეზღუდვის პირáƒáƒ‘ის დáƒáƒ áƒ¦áƒ•ევáƒ', + DB_ERROR_DIVZERO => '0-ზე გáƒáƒ§áƒáƒ¤áƒ', + DB_ERROR_INVALID => 'áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜áƒ', + DB_ERROR_INVALID_DATE => 'áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜ თáƒáƒ áƒ˜áƒ¦áƒ˜ áƒáƒœ დრáƒ', + DB_ERROR_INVALID_NUMBER => 'áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜ რიცხვი', + DB_ERROR_MISMATCH => 'შეცდáƒáƒ›áƒ', + DB_ERROR_NODBSELECTED => 'მáƒáƒœáƒáƒªáƒ”მთრბáƒáƒ–რáƒáƒ áƒ©áƒ”ული áƒáƒ áƒáƒ', + DB_ERROR_NOSUCHFIELD => 'ველი áƒáƒ  áƒáƒ áƒ¡áƒ”ბáƒáƒ‘ს', + DB_ERROR_NOSUCHTABLE => 'ცხრილი áƒáƒ  áƒáƒ áƒ¡áƒ”ბáƒáƒ‘ს', + DB_ERROR_NOT_CAPABLE => 'მáƒáƒœáƒáƒªáƒ”მთრბáƒáƒ–რმზáƒáƒ“ áƒáƒ áƒáƒ', + DB_ERROR_NOT_FOUND => 'áƒáƒ¦áƒ›áƒáƒ©áƒ”ნილი áƒáƒ áƒáƒ', + DB_ERROR_NOT_LOCKED => 'დáƒáƒ‘ლáƒáƒ™áƒ˜áƒšáƒ˜ áƒáƒ áƒáƒ', + DB_ERROR_SYNTAX => 'სინტáƒáƒ¥áƒ¡áƒ£áƒ áƒ˜ შეცდáƒáƒ›áƒ', + DB_ERROR_UNSUPPORTED => 'მხáƒáƒ áƒ“áƒáƒ­áƒ”რიი áƒáƒ áƒáƒ', + DB_ERROR_VALUE_COUNT_ON_ROW => 'მწკრივის მნიშვნელáƒáƒ‘ების მთვლელი', + DB_ERROR_INVALID_DSN => 'áƒáƒ áƒáƒ¡áƒ¬áƒáƒ áƒ˜ DSN', + DB_ERROR_CONNECT_FAILED => 'დáƒáƒ™áƒáƒ•შირებრშეუძლებელიáƒ', + 0 => 'შეცდáƒáƒ›áƒ˜áƒ¡ გáƒáƒ áƒ”შე', // DB_OK + DB_ERROR_NEED_MORE_DATA => 'მიწáƒáƒ“ებულირáƒáƒ áƒáƒ¡áƒáƒ™áƒ›áƒáƒ áƒ˜áƒ¡áƒ˜ მáƒáƒœáƒáƒªáƒ”მები', + DB_ERROR_EXTENSION_NOT_FOUND=> 'გáƒáƒ¤áƒáƒ áƒ—áƒáƒ”ბრáƒáƒ¦áƒ›áƒáƒ©áƒ”ნილი áƒáƒ áƒáƒ', + DB_ERROR_NOSUCHDB => 'მáƒáƒœáƒáƒªáƒ”მთრბáƒáƒ–რáƒáƒ  áƒáƒ áƒ¡áƒ”ბáƒáƒ‘ს', + DB_ERROR_ACCESS_VIOLATION => 'áƒáƒ áƒáƒ¡áƒáƒ™áƒ›áƒáƒ áƒ˜áƒ¡áƒ˜ წვდáƒáƒ›áƒ”ბი' +); diff --git a/vendor/adodb/adodb-php/perf/perf-oci8.inc.php b/vendor/adodb/adodb-php/perf/perf-oci8.inc.php index c11b261fd1..345d8929ff 100644 --- a/vendor/adodb/adodb-php/perf/perf-oci8.inc.php +++ b/vendor/adodb/adodb-php/perf/perf-oci8.inc.php @@ -23,7 +23,7 @@ if (!defined('ADODB_DIR')) die(); -class perf_oci8 extends ADODB_perf{ +class perf_oci8 extends adodb_perf{ var $noShowIxora = 15; // if the sql for suspicious sql is taking too long, then disable ixora diff --git a/vendor/adodb/adodb-php/session/adodb-session2.php b/vendor/adodb/adodb-php/session/adodb-session2.php index bf64b4166e..19793960f4 100644 --- a/vendor/adodb/adodb-php/session/adodb-session2.php +++ b/vendor/adodb/adodb-php/session/adodb-session2.php @@ -28,15 +28,14 @@ define('ADODB_SESSION', dirname(__FILE__)); define('ADODB_SESSION2', ADODB_SESSION); -/* - Unserialize session data manually. See PHPLens Issue No: 9821 - - From Kerr Schere, to unserialize session data stored via ADOdb. - 1. Pull the session data from the db and loop through it. - 2. Inside the loop, you will need to urldecode the data column. - 3. After urldecode, run the serialized string through this function: - -*/ +/** + * Unserialize session data manually. See PHPLens Issue No: 9821 + * + * From Kerr Schere, to unserialize session data stored via ADOdb. + * 1. Pull the session data from the db and loop through it. + * 2. Inside the loop, you will need to urldecode the data column. + * 3. After urldecode, run the serialized string through this function: + */ function adodb_unserialize( $serialized_string ) { $variables = array( ); @@ -47,10 +46,13 @@ function adodb_unserialize( $serialized_string ) return( $variables ); } -/* - Thanks Joe Li. See PHPLens Issue No: 11487&x=1 - Since adodb 4.61. -*/ +/** + * Regenerate session id + * + * Thanks Joe Li. See PHPLens Issue No: 11487&x=1 + * + * @since 4.61 + */ function adodb_session_regenerate_id() { $conn = ADODB_Session::_conn(); @@ -79,45 +81,52 @@ function adodb_session_regenerate_id() return true; } -/* - Generate database table for session data - @see PHPLens Issue No: 12280 - @return 0 if failure, 1 if errors, 2 if successful. - @author Markus Staab http://www.public-4u.de -*/ +/** + * Generate database table for session data. + * @see PHPLens Issue No: 12280 + * + * @return int 0 if failure, 1 if errors, 2 if successful. + * + * @author Markus Staab http://www.public-4u.de + */ function adodb_session_create_table($schemaFile=null,$conn = null) { - // set default values - if ($schemaFile===null) $schemaFile = ADODB_SESSION . '/session_schema2.xml'; - if ($conn===null) $conn = ADODB_Session::_conn(); + // set default values + if ($schemaFile===null) $schemaFile = ADODB_SESSION . '/session_schema2.xml'; + if ($conn===null) $conn = ADODB_Session::_conn(); if (!$conn) return 0; - $schema = new adoSchema($conn); - $schema->ParseSchema($schemaFile); - return $schema->ExecuteSchema(); + $schema = new adoSchema($conn); + $schema->ParseSchema($schemaFile); + return $schema->ExecuteSchema(); } -/*! - \static -*/ +/** + * ADOdb Session v2 class. + */ class ADODB_Session { + + /** + * Session Connection's Database provider. + * + * Populated when opening the database connection. + * @see ADODB_Session::open()}. + * + * @var string + */ + protected static $provider; + ///////////////////// // getter/setter methods ///////////////////// - /* - - function Lock($lock=null) - { - static $_lock = false; - - if (!is_null($lock)) $_lock = $lock; - return $lock; - } - */ - /*! - */ + /** + * Get/Set Database driver. + * + * @param string $driver + * @return string + */ static function driver($driver = null) { static $_driver = 'mysqli'; @@ -136,8 +145,12 @@ static function driver($driver = null) return $_driver; } - /*! - */ + /** + * Get/Set Database hostname. + * + * @param string $host + * @return string + */ static function host($host = null) { static $_host = 'localhost'; static $set = false; @@ -155,8 +168,12 @@ static function host($host = null) { return $_host; } - /*! - */ + /** + * Get/Set Database connection user. + * + * @param string $user + * @return string + */ static function user($user = null) { static $_user = 'root'; @@ -175,8 +192,12 @@ static function user($user = null) return $_user; } - /*! - */ + /** + * Get/Set Database connection password. + * + * @param null $password + * @return string + */ static function password($password = null) { static $_password = ''; @@ -195,8 +216,12 @@ static function password($password = null) return $_password; } - /*! - */ + /** + * Get/Set Database name. + * + * @param null $database + * @return string + */ static function database($database = null) { static $_database = ''; @@ -214,8 +239,12 @@ static function database($database = null) return $_database; } - /*! - */ + /** + * Get/Set Connection's persistence mode. + * + * @param $persist + * @return string|true + */ static function persist($persist = null) { static $_persist = true; @@ -227,8 +256,12 @@ static function persist($persist = null) return $_persist; } - /*! - */ + /** + * Get/Set Connection's lifetime. + * + * @param int $lifetime + * @return int + */ static function lifetime($lifetime = null) { static $_lifetime; @@ -255,8 +288,12 @@ static function lifetime($lifetime = null) return $_lifetime; } - /*! - */ + /** + * Get/Set Connection's debug mode. + * + * @param bool $debug + * @return bool + */ static function debug($debug = null) { static $_debug = false; @@ -264,11 +301,6 @@ static function debug($debug = null) if (!is_null($debug)) { $_debug = (bool) $debug; - - $conn = ADODB_Session::_conn(); - if ($conn) { - #$conn->debug = $_debug; - } $set = true; } elseif (!$set) { // backwards compatibility @@ -280,8 +312,12 @@ static function debug($debug = null) return $_debug; } - /*! - */ + /** + * Get/Set garbage collection function. + * + * @param callable $expire_notify Function name + * @return callable|false + */ static function expireNotify($expire_notify = null) { static $_expire_notify; @@ -300,8 +336,12 @@ static function expireNotify($expire_notify = null) return $_expire_notify; } - /*! - */ + /** + * Get/Set Sessions table name. + * + * @param string $table Session table name (defaults to 'sessions2') + * @return string + */ static function table($table = null) { static $_table = 'sessions2'; @@ -320,8 +360,15 @@ static function table($table = null) return $_table; } - /*! - */ + /** + * Get/Set table optimization mode. + * + * If true, with MySQL and PostgreSQL databases, the Sessions table will + * be optimized when garbage collection is performed. + * + * @param bool $optimize + * @return bool + */ static function optimize($optimize = null) { static $_optimize = false; @@ -340,16 +387,21 @@ static function optimize($optimize = null) return $_optimize; } - /*! - */ + /** + * No longer used, kept for backwards-compatibility only. + * + * @param int $sync_seconds + * @return int + * + * @deprecated + */ static function syncSeconds($sync_seconds = null) { - //echo ("<p>WARNING: ADODB_SESSION::syncSeconds is longer used, please remove this function for your code</p>"); - return 0; } - /*! - */ + /** + * Get/Set if CLOBs are available to store session data. + */ static function clob($clob = null) { static $_clob = false; static $set = false; @@ -367,15 +419,24 @@ static function clob($clob = null) { return $_clob; } - /*! - */ + /** + * No longer used, kept for backwards-compatibility only. + * + * @param string $data_field_name + * @return string + * + * @deprecated + */ static function dataFieldName($data_field_name = null) { - //echo ("<p>WARNING: ADODB_SESSION::dataFieldName() is longer used, please remove this function for your code</p>"); return ''; } - /*! - */ + /** + * Get/Set session data filter. + * + * @param array $filter + * @return array + */ static function filter($filter = null) { static $_filter = array(); @@ -389,8 +450,12 @@ static function filter($filter = null) { return $_filter; } - /*! - */ + /** + * Get/Set the encryption key if encrypted sessions are in use. + * + * @param string $encryption_key + * @return string + */ static function encryptionKey($encryption_key = null) { static $_encryption_key = 'CRYPTED ADODB SESSIONS ROCK!'; @@ -405,14 +470,19 @@ static function encryptionKey($encryption_key = null) { // private methods ///////////////////// - /*! - */ + /** + * Returns the Session's Database Connection. + * + * @return ADOConnection|false + */ static function _conn($conn=null) { return isset($GLOBALS['ADODB_SESS_CONN']) ? $GLOBALS['ADODB_SESS_CONN'] : false; } - /*! - */ + /** + * @param $crc + * @return false|mixed + */ static function _crc($crc = null) { static $_crc = false; @@ -423,8 +493,9 @@ static function _crc($crc = null) { return $_crc; } - /*! - */ + /** + * Initialize session handler. + */ static function _init() { session_set_save_handler( array('ADODB_Session', 'open'), @@ -437,16 +508,19 @@ static function _init() { } - /*! - */ + /** + * Create the encryption key for crypted sessions. + * + * Crypt the used key, ADODB_Session::encryptionKey() as key and + * session_id() as salt. + */ static function _sessionKey() { - // use this function to create the encryption key for crypted sessions - // crypt the used key, ADODB_Session::encryptionKey() as key and session_id() as salt return crypt(ADODB_Session::encryptionKey(), session_id()); } - /*! - */ + /** + * Dump recordset. + */ static function _dumprs(&$rs) { $conn = ADODB_Session::_conn(); $debug = ADODB_Session::debug(); @@ -476,10 +550,39 @@ static function _dumprs(&$rs) { $rs->MoveFirst(); } + /** + * Check if Session Connection's DB type is MySQL. + * + * @return bool + */ + static protected function isConnectionMysql() { + return self::$provider == 'mysql'; + } + + /** + * Check if Session Connection's DB type is PostgreSQL. + * + * @return bool + */ + static protected function isConnectionPostgres() { + return self::$provider == 'postgres'; + } + ///////////////////// // public methods ///////////////////// + /** + * Establishes a connection to the database for session management. + * + * @param string $host + * @param string $driver + * @param string $user + * @param string $password + * @param string $database + * @param array $options + * @return void + */ static function config($driver, $host, $user, $password, $database=false,$options=false) { ADODB_Session::driver($driver); @@ -495,11 +598,17 @@ static function config($driver, $host, $user, $password, $database=false,$option if (isset($options['debug'])) ADODB_Session::debug($options['debug']); } - /*! - Create the connection to the database. - - If $conn already exists, reuse that connection - */ + /** + * Create the connection to the database. + * + * If $conn already exists, reuse that connection. + * + * @param string $save_path + * @param string $session_name + * @param bool $persist + * + * @return bool + */ static function open($save_path, $session_name, $persist = null) { $conn = ADODB_Session::_conn(); @@ -521,10 +630,6 @@ static function open($save_path, $session_name, $persist = null) $persist = ADODB_Session::persist(); } -# these can all be defaulted to in php.ini -# assert('$database'); -# assert('$driver'); -# assert('$host'); if (strpos($driver, 'pdo_') === 0){ $conn = ADONewConnection('pdo'); $driver = str_replace('pdo_', '', $driver); @@ -562,8 +667,15 @@ static function open($save_path, $session_name, $persist = null) } } + if ($ok) { + $GLOBALS['ADODB_SESS_CONN'] = $conn; - if ($ok) $GLOBALS['ADODB_SESS_CONN'] = $conn; + // Initialize Session data provider + self::$provider = $conn->dataProvider; + if (self::$provider == 'pdo') { + self::$provider = $conn->dsnType == 'pgsql' ? 'postgres' : $conn->dsnType; + } + } else ADOConnection::outp('<p>Session: connection failed</p>', false); @@ -571,9 +683,9 @@ static function open($save_path, $session_name, $persist = null) return $ok; } - /*! - Close the connection - */ + /** + * Close the connection + */ static function close() { /* @@ -583,9 +695,12 @@ static function close() return true; } - /* - Slurp in the session variables and return the serialized string - */ + /** + * Slurp in the session variables and return the serialized string. + * + * @param string $key + * @return string + */ static function read($key) { $conn = ADODB_Session::_conn(); @@ -596,9 +711,7 @@ static function read($key) return ''; } - //assert('$table'); - - $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : ''; + $binary = ADODB_Session::isConnectionMysql() ? '/*! BINARY */' : ''; global $ADODB_SESSION_SELECT_FIELDS; if (!isset($ADODB_SESSION_SELECT_FIELDS)) $ADODB_SESSION_SELECT_FIELDS = 'sessdata'; @@ -635,16 +748,22 @@ static function read($key) return ''; } - /*! - Write the serialized data to a database. - - If the data has not been modified since the last read(), we do not write. - */ + /** + * Write the serialized data to a database. + * + * If the data has not been modified since the last read(), we do not write. + * + * @param string $key + * @param string $oval + * + * @return bool + */ static function write($key, $oval) { - global $ADODB_SESSION_READONLY; - - if (!empty($ADODB_SESSION_READONLY)) return; + global $ADODB_SESSION_READONLY; + if (!empty($ADODB_SESSION_READONLY)) { + return false; + } $clob = ADODB_Session::clob(); $conn = ADODB_Session::_conn(); @@ -662,11 +781,9 @@ static function write($key, $oval) if ($debug) $conn->debug = 1; $sysTimeStamp = $conn->sysTimeStamp; - //assert('$table'); - $expiry = $conn->OffsetDate($lifetime/(24*3600),$sysTimeStamp); - $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : ''; + $binary = ADODB_Session::isConnectionMysql() ? '/*! BINARY */' : ''; // crc32 optimization since adodb 2.1 // now we only update expiry date, thx to sebastian thom in adodb 2.32 @@ -684,8 +801,9 @@ static function write($key, $oval) } } - - $sql = "UPDATE $table SET expiry = $expiry ,expireref=".$conn->Param('0').", modified = $sysTimeStamp WHERE $binary sesskey = ".$conn->Param('1')." AND expiry >= $sysTimeStamp"; + $sql = "UPDATE $table SET expiry = $expiry, expireref=" . $conn->Param('0') + . ", modified = $sysTimeStamp WHERE sesskey = $binary " . $conn->Param('1') + . " AND expiry >= $sysTimeStamp"; $rs = $conn->Execute($sql,array($expirevar,$key)); return true; } @@ -705,7 +823,8 @@ static function write($key, $oval) } } - if (!$clob) { // no lobs, simply use replace() + if (!$clob) { + // no lobs, simply use replace() $rs = $conn->Execute("SELECT COUNT(*) AS cnt FROM $table WHERE $binary sesskey = ".$conn->Param(0),array($key)); if ($rs) $rs->Close(); @@ -717,7 +836,6 @@ static function write($key, $oval) VALUES ($expiry,".$conn->Param('0').", ". $conn->Param('1').", ".$conn->Param('2').", $sysTimeStamp, $sysTimeStamp)"; } - $rs = $conn->Execute($sql,array($val,$expireref,$key)); } else { @@ -737,14 +855,12 @@ static function write($key, $oval) VALUES ($expiry,$lob_value, ". $conn->Param('0').", ".$conn->Param('1').", $sysTimeStamp, $sysTimeStamp)"; } - $rs = $conn->Execute($sql,array($expireref,$key)); + $conn->Execute($sql,array($expireref,$key)); $qkey = $conn->qstr($key); - $rs2 = $conn->UpdateBlob($table, 'sessdata', $val, " sesskey=$qkey", strtoupper($clob)); + $conn->UpdateBlob($table, 'sessdata', $val, " sesskey=$qkey", strtoupper($clob)); if ($debug) echo "<hr>",htmlspecialchars($oval), "<hr>"; $rs = @$conn->CompleteTrans(); - - } if (!$rs) { @@ -768,8 +884,12 @@ static function write($key, $oval) return $rs ? true : false; } - /*! - */ + /** + * Destroy session. + * + * @param string $key + * @return bool + */ static function destroy($key) { $conn = ADODB_Session::_conn(); $table = ADODB_Session::table(); @@ -780,16 +900,15 @@ static function destroy($key) { } $debug = ADODB_Session::debug(); if ($debug) $conn->debug = 1; - //assert('$table'); $qkey = $conn->quote($key); - $binary = $conn->dataProvider === 'mysql' || $conn->dataProvider === 'pdo' ? '/*! BINARY */' : ''; + $binary = ADODB_Session::isConnectionMysql() ? '/*! BINARY */' : ''; if ($expire_notify) { reset($expire_notify); $fn = next($expire_notify); $savem = $conn->SetFetchMode(ADODB_FETCH_NUM); - $sql = "SELECT expireref, sesskey FROM $table WHERE $binary sesskey = $qkey"; + $sql = "SELECT expireref, sesskey FROM $table WHERE sesskey = $binary $qkey"; $rs = $conn->Execute($sql); ADODB_Session::_dumprs($rs); $conn->SetFetchMode($savem); @@ -799,24 +918,26 @@ static function destroy($key) { if (!$rs->EOF) { $ref = $rs->fields[0]; $key = $rs->fields[1]; - //assert('$ref'); - //assert('$key'); $fn($ref, $key); } $rs->Close(); } - $sql = "DELETE FROM $table WHERE $binary sesskey = $qkey"; + $sql = "DELETE FROM $table WHERE sesskey = $binary $qkey"; $rs = $conn->Execute($sql); if ($rs) { $rs->Close(); } - return $rs ? true : false; + return (bool)$rs; } - /*! - */ + /** + * Perform garbage collection. + * + * @param int $maxlifetime + * @return bool + */ static function gc($maxlifetime) { $conn = ADODB_Session::_conn(); @@ -829,8 +950,6 @@ static function gc($maxlifetime) return false; } - - $debug = ADODB_Session::debug(); if ($debug) { $conn->debug = 1; $COMMITNUM = 2; @@ -838,10 +957,8 @@ static function gc($maxlifetime) $COMMITNUM = 20; } - //assert('$table'); - $time = $conn->OffsetDate(-$maxlifetime/24/3600,$conn->sysTimeStamp); - $binary = $conn->dataProvider === 'mysql' ? '/*! BINARY */' : ''; + $binary = ADODB_Session::isConnectionMysql() ? '/*! BINARY */' : ''; if ($expire_notify) { reset($expire_notify); @@ -858,13 +975,12 @@ static function gc($maxlifetime) if ($rs) { $tr = $conn->hasTransactions; if ($tr) $conn->BeginTrans(); - $keys = array(); $ccnt = 0; while (!$rs->EOF) { $ref = $rs->fields[0]; $key = $rs->fields[1]; if ($fn) $fn($ref, $key); - $del = $conn->Execute("DELETE FROM $table WHERE sesskey=".$conn->Param('0'),array($key)); + $conn->Execute("DELETE FROM $table WHERE sesskey = $binary " . $conn->Param('0'), array($key)); $rs->MoveNext(); $ccnt += 1; if ($tr && $ccnt % $COMMITNUM == 0) { @@ -881,12 +997,9 @@ static function gc($maxlifetime) // suggested by Cameron, "GaM3R" <gamr@outworld.cx> if ($optimize) { - $driver = ADODB_Session::driver(); - - if (preg_match('/mysql/i', $driver)) { + if (ADODB_Session::isConnectionMysql()) { $sql = "OPTIMIZE TABLE $table"; - } - if (preg_match('/postgres/i', $driver)) { + } elseif (ADODB_Session::isConnectionPostgres()) { $sql = "VACUUM $table"; } if (!empty($sql)) { @@ -903,12 +1016,16 @@ static function gc($maxlifetime) if (empty($ADODB_SESSION_READONLY)) register_shutdown_function('session_write_close'); -// for backwards compatibility only +/** + * @deprecated for backwards compatibility only + */ function adodb_sess_open($save_path, $session_name, $persist = true) { return ADODB_Session::open($save_path, $session_name, $persist); } -// for backwards compatibility only +/** + * @deprecated for backwards compatibility only + */ function adodb_sess_gc($t) { return ADODB_Session::gc($t); diff --git a/vendor/adodb/adodb-php/toexport.inc.php b/vendor/adodb/adodb-php/toexport.inc.php index 66bbf54240..9f515fe923 100644 --- a/vendor/adodb/adodb-php/toexport.inc.php +++ b/vendor/adodb/adodb-php/toexport.inc.php @@ -107,9 +107,9 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote = if ($hasNumIndex) { for ($j=0; $j < $max; $j++) { $v = $rs->fields[$j]; - if (!is_object($v)) $v = trim($v); + if (!is_object($v)) $v = trim((string)$v); else $v = 'Object'; - if ($escquote) $v = str_replace($quote,$escquotequote,$v); + if ($escquote) $v = str_replace($quote,$escquotequote,(string)$v); $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)))); if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; @@ -117,8 +117,8 @@ function _adodb_export(&$rs,$sep,$sepreplace,$fp=false,$addtitles=true,$quote = } } else { // ASSOCIATIVE ARRAY foreach($rs->fields as $v) { - if ($escquote) $v = str_replace($quote,$escquotequote,trim($v)); - $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,$v)))); + if ($escquote) $v = str_replace($quote,$escquotequote,trim((string)$v)); + $v = strip_tags(str_replace("\n", $replaceNewLine, str_replace("\r\n",$replaceNewLine,str_replace($sep,$sepreplace,(string)$v)))); if (strpos($v,$sep) !== false || strpos($v,$quote) !== false) $elements[] = "$quote$v$quote"; else $elements[] = $v; diff --git a/vendor/adodb/adodb-php/tohtml.inc.php b/vendor/adodb/adodb-php/tohtml.inc.php index e92c8b44a0..6e9a62863c 100644 --- a/vendor/adodb/adodb-php/tohtml.inc.php +++ b/vendor/adodb/adodb-php/tohtml.inc.php @@ -113,7 +113,8 @@ function rs2html(&$rs,$ztabhtml=false,$zheaderarray=false,$htmlspecialchars=true else $v = round($v,$ADODB_ROUND); case 'I': - $vv = stripslashes((trim($v))); + $vv = $v ? stripslashes(trim($v)) : ''; + $vv = $vv ?: '&nbsp;'; if (strlen($vv) == 0) $vv .= '&nbsp;'; $s .= " <TD align=right>".$vv ."</TD>\n"; @@ -139,11 +140,17 @@ function mime_content_type ($file) { */ default: - if ($htmlspecialchars) $v = htmlspecialchars(trim($v)); - $v = trim($v); - if (strlen($v) == 0) $v = '&nbsp;'; - $s .= " <TD>". str_replace("\n",'<br>',stripslashes($v)) ."</TD>\n"; - + if ($v) { + $v = trim($v); + if ($htmlspecialchars) { + $v = htmlspecialchars($v); + } + } elseif ($v === null) { + $v = '(NULL)'; + } else { + $v = '&nbsp;'; + } + $s .= " <TD>" . str_replace("\n", '<br>', $v) . "</TD>\n"; } } // for $s .= "</TR>\n\n"; diff --git a/vendor/autoload.php b/vendor/autoload.php index acb35c4522..9104711231 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -3,8 +3,18 @@ // autoload.php @generated by Composer if (PHP_VERSION_ID < 50600) { - echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - exit(1); + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + throw new RuntimeException($err); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index afef3fa2ad..7824d8f7ea 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array<string, array<string, int>> + * @var array<string, array<string, int>> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array<string, array<int, string>> + * @var array<string, list<string>> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array<string, string> + * @var list<string> */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array<string, array<string, string[]>> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array<string, array<string, list<string>>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array<string, string> + * @var list<string> */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array<string, string> + * @var array<string, string> */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array<string, bool> + * @var array<string, bool> */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array<string, self> */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array<string, list<string>> */ public function getPrefixes() { @@ -121,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array<string, array<int, string>> + * @return array<string, list<string>> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array<string, string> + * @return list<string> */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array<string, string> + * @return list<string> */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array<string, string> + * @return array<string, string> Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array<string, string> $classMap + * @param array<string, string> $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list<string>|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list<string>|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list<string>|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list<string>|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array<string, self> */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 41bc143c11..2052022fd8 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -26,12 +26,23 @@ */ class InstalledVersions { + /** + * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to + * @internal + */ + private static $selfDir = null; + /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null */ private static $installed; + /** + * @var bool + */ + private static $installedIsLocalDir; + /** * @var bool|null */ @@ -39,7 +50,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static $installedByVendor = array(); @@ -98,7 +109,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +130,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -243,7 +254,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -257,7 +268,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} */ public static function getRawData() { @@ -280,7 +291,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ public static function getAllRawData() { @@ -303,17 +314,35 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); + + // when using reload, we disable the duplicate protection to ensure that self::$installed data is + // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, + // so we have to assume it does not, and that may result in duplicate data being returned when listing + // all installed packages for example + self::$installedIsLocalDir = false; + } + + /** + * @return string + */ + private static function getSelfDir() + { + if (self::$selfDir === null) { + self::$selfDir = strtr(__DIR__, '\\', '/'); + } + + return self::$selfDir; } /** * @return array[] - * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}> + * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}> */ private static function getInstalled() { @@ -322,17 +351,27 @@ private static function getInstalled() } $installed = array(); + $copiedLocalDir = false; if (self::$canGetVendors) { + $selfDir = self::getSelfDir(); foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + $vendorDir = strtr($vendorDir, '\\', '/'); if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ + $required = require $vendorDir.'/composer/installed.php'; + self::$installedByVendor[$vendorDir] = $required; + $installed[] = $required; + if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { + self::$installed = $required; + self::$installedIsLocalDir = true; } } + if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { + $copiedLocalDir = true; + } } } @@ -340,12 +379,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array() && !$copiedLocalDir) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 913dc1aaf6..a928fc69af 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,7 +6,10 @@ $baseDir = dirname($vendorDir); return array( + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Smarty' => $vendorDir . '/smarty/smarty/libs/Smarty.class.php', 'SmartyBC' => $vendorDir . '/smarty/smarty/libs/SmartyBC.class.php', 'SmartyCompilerException' => $vendorDir . '/smarty/smarty/libs/sysplugins/smartycompilerexception.php', @@ -178,6 +181,9 @@ 'Smarty_Template_Source' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_template_source.php', 'Smarty_Undefined_Variable' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php', 'Smarty_Variable' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_variable.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'TPC_yyStackEntry' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php', 'TP_yyStackEntry' => $vendorDir . '/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 910eb34cd3..d83f6051af 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -8,13 +8,12 @@ return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', '253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'bf9f5270ae66ac6fa0290b4bf47867b7' => $vendorDir . '/adodb/adodb-php/adodb.inc.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', @@ -32,4 +31,5 @@ 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 15a2ff3ad6..312e4b2a7c 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,4 +6,5 @@ $baseDir = dirname($vendorDir); return array( + 'pChart' => array($vendorDir . '/wp-statistics/pchart/src'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 247d95c0dd..ef8002d2b7 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,24 +6,24 @@ $baseDir = dirname($vendorDir); return array( - 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), 'Slim\\Psr7\\' => array($vendorDir . '/slim/psr7/src'), 'Slim\\' => array($vendorDir . '/slim/slim/Slim'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), - 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'), + 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-middleware/src', $vendorDir . '/psr/http-server-handler/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), + 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), 'Omines\\OAuth2\\Client\\' => array($vendorDir . '/omines/oauth2-gitlab/src'), 'Nyholm\\Psr7\\' => array($vendorDir . '/nyholm/psr7/src'), 'Nyholm\\Psr7Server\\' => array($vendorDir . '/nyholm/psr7-server/src'), - 'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-client/src', $vendorDir . '/league/oauth2-github/src', $vendorDir . '/league/oauth2-google/src'), - 'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'), + 'League\\OAuth2\\Client\\' => array($vendorDir . '/league/oauth2-google/src', $vendorDir . '/league/oauth2-github/src', $vendorDir . '/league/oauth2-client/src'), 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'), - 'Http\\Message\\' => array($vendorDir . '/php-http/message-factory/src'), 'Http\\Factory\\Guzzle\\' => array($vendorDir . '/http-interop/http-factory-guzzle/src'), 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'), 'Http\\Adapter\\Guzzle6\\' => array($vendorDir . '/php-http/guzzle6-adapter/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index d02a0c1fbd..181fa2824c 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -33,25 +33,18 @@ public static function getLoader() $loader->register(true); - $includeFiles = \Composer\Autoload\ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$files; - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire056ad17c9fe5d65b7d3c5047fc89f77e($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire056ad17c9fe5d65b7d3c5047fc89f77e($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 99c0d19f5d..6c000b0d4a 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -9,13 +9,12 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'bf9f5270ae66ac6fa0290b4bf47867b7' => __DIR__ . '/..' . '/adodb/adodb-php/adodb.inc.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', @@ -33,13 +32,15 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( 'S' => array ( - 'Symfony\\Polyfill\\Php72\\' => 23, + 'Symfony\\Polyfill\\Php80\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, 'Slim\\Psr7\\' => 10, 'Slim\\' => 5, @@ -49,6 +50,7 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e 'Psr\\Log\\' => 8, 'Psr\\Http\\Server\\' => 16, 'Psr\\Http\\Message\\' => 17, + 'Psr\\Http\\Client\\' => 16, 'Psr\\Container\\' => 14, 'PHPMailer\\PHPMailer\\' => 20, ), @@ -64,13 +66,11 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e 'L' => array ( 'League\\OAuth2\\Client\\' => 21, - 'Laminas\\ZendFrameworkBridge\\' => 28, 'Laminas\\Diactoros\\' => 18, ), 'H' => array ( 'Http\\Promise\\' => 13, - 'Http\\Message\\' => 13, 'Http\\Factory\\Guzzle\\' => 20, 'Http\\Client\\' => 12, 'Http\\Adapter\\Guzzle6\\' => 21, @@ -89,14 +89,18 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e ); public static $prefixDirsPsr4 = array ( - 'Symfony\\Polyfill\\Php72\\' => + 'Symfony\\Polyfill\\Php80\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', ), + 'Symfony\\Polyfill\\Intl\\Normalizer\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', + ), 'Symfony\\Polyfill\\Intl\\Idn\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn', @@ -115,14 +119,18 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e ), 'Psr\\Http\\Server\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-server-handler/src', - 1 => __DIR__ . '/..' . '/psr/http-server-middleware/src', + 0 => __DIR__ . '/..' . '/psr/http-server-middleware/src', + 1 => __DIR__ . '/..' . '/psr/http-server-handler/src', ), 'Psr\\Http\\Message\\' => array ( 0 => __DIR__ . '/..' . '/psr/http-factory/src', 1 => __DIR__ . '/..' . '/psr/http-message/src', ), + 'Psr\\Http\\Client\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/http-client/src', + ), 'Psr\\Container\\' => array ( 0 => __DIR__ . '/..' . '/psr/container/src', @@ -145,13 +153,9 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e ), 'League\\OAuth2\\Client\\' => array ( - 0 => __DIR__ . '/..' . '/league/oauth2-client/src', + 0 => __DIR__ . '/..' . '/league/oauth2-google/src', 1 => __DIR__ . '/..' . '/league/oauth2-github/src', - 2 => __DIR__ . '/..' . '/league/oauth2-google/src', - ), - 'Laminas\\ZendFrameworkBridge\\' => - array ( - 0 => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src', + 2 => __DIR__ . '/..' . '/league/oauth2-client/src', ), 'Laminas\\Diactoros\\' => array ( @@ -161,10 +165,6 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e array ( 0 => __DIR__ . '/..' . '/php-http/promise/src', ), - 'Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/message-factory/src', - ), 'Http\\Factory\\Guzzle\\' => array ( 0 => __DIR__ . '/..' . '/http-interop/http-factory-guzzle/src', @@ -199,8 +199,21 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e ), ); + public static $prefixesPsr0 = array ( + 'p' => + array ( + 'pChart' => + array ( + 0 => __DIR__ . '/..' . '/wp-statistics/pchart/src', + ), + ), + ); + public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Smarty' => __DIR__ . '/..' . '/smarty/smarty/libs/Smarty.class.php', 'SmartyBC' => __DIR__ . '/..' . '/smarty/smarty/libs/SmartyBC.class.php', 'SmartyCompilerException' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smartycompilerexception.php', @@ -372,8 +385,11 @@ class ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e 'Smarty_Template_Source' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_template_source.php', 'Smarty_Undefined_Variable' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_undefined_variable.php', 'Smarty_Variable' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_variable.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'TPC_yyStackEntry' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_internal_configfileparser.php', 'TP_yyStackEntry' => __DIR__ . '/..' . '/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); public static function getInitializer(ClassLoader $loader) @@ -381,6 +397,7 @@ public static function getInitializer(ClassLoader $loader) return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$prefixesPsr0; $loader->classMap = ComposerStaticInit056ad17c9fe5d65b7d3c5047fc89f77e::$classMap; }, null, ClassLoader::class); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 19f83a9e85..0d8c2f33bb 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "adodb/adodb-php", - "version": "v5.22.1", - "version_normalized": "5.22.1.0", + "version": "v5.22.9", + "version_normalized": "5.22.9.0", "source": { "type": "git", "url": "https://github.com/ADOdb/ADOdb.git", - "reference": "64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6" + "reference": "a568bfeb72d6b5942df747adc36b95165a083e60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6", - "reference": "64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6", + "url": "https://api.github.com/repos/ADOdb/ADOdb/zipball/a568bfeb72d6b5942df747adc36b95165a083e60", + "reference": "a568bfeb72d6b5942df747adc36b95165a083e60", "shasum": "" }, "require": { @@ -21,7 +21,7 @@ "require-dev": { "phpunit/phpunit": "^8.5" }, - "time": "2022-03-30T08:49:08+00:00", + "time": "2025-05-01T11:49:24+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -66,26 +66,26 @@ }, { "name": "fig/http-message-util", - "version": "1.1.4", - "version_normalized": "1.1.4.0", + "version": "1.1.5", + "version_normalized": "1.1.5.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message-util.git", - "reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422" + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/3242caa9da7221a304b8f84eb9eaddae0a7cf422", - "reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "suggest": { "psr/http-message": "The package containing the PSR-7 interfaces" }, - "time": "2020-02-05T20:36:27+00:00", + "time": "2020-11-24T22:02:12+00:00", "type": "library", "extra": { "branch-alias": { @@ -105,7 +105,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", @@ -117,29 +117,33 @@ "request", "response" ], + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, "install-path": "../fig/http-message-util" }, { "name": "guzzlehttp/guzzle", - "version": "6.5.3", - "version_normalized": "6.5.3.0", + "version": "6.5.8", + "version_normalized": "6.5.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e" + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/aab4ebd862aa7d04f01a4b51849d657db56d882e", - "reference": "aab4ebd862aa7d04f01a4b51849d657db56d882e", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", + "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", + "guzzlehttp/psr7": "^1.9", "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.11" + "symfony/polyfill-intl-idn": "^1.17" }, "require-dev": { "ext-curl": "*", @@ -149,7 +153,7 @@ "suggest": { "psr/log": "Required for using the Log middleware" }, - "time": "2020-04-18T10:38:46+00:00", + "time": "2022-06-20T22:16:07+00:00", "type": "library", "extra": { "branch-alias": { @@ -158,22 +162,52 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle is a PHP HTTP client library", @@ -187,75 +221,121 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/guzzle" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", - "version_normalized": "1.3.1.0", + "version": "1.5.3", + "version_normalized": "1.5.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, - "time": "2016-12-20T10:07:11+00:00", + "time": "2023-05-21T12:31:43+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "description": "Guzzle promises library", "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/promises" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", - "version_normalized": "1.6.1.0", + "version": "1.9.1", + "version_normalized": "1.9.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { @@ -268,39 +348,55 @@ }, "require-dev": { "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2019-07-01T23:21:34+00:00", + "time": "2023-04-17T16:00:37+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -315,35 +411,57 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], "install-path": "../guzzlehttp/psr7" }, { "name": "http-interop/http-factory-guzzle", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "1.2.0", + "version_normalized": "1.2.0.0", "source": { "type": "git", "url": "https://github.com/http-interop/http-factory-guzzle.git", - "reference": "34861658efb9899a6618cef03de46e2a52c80fc0" + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/34861658efb9899a6618cef03de46e2a52c80fc0", - "reference": "34861658efb9899a6618cef03de46e2a52c80fc0", + "url": "https://api.github.com/repos/http-interop/http-factory-guzzle/zipball/8f06e92b95405216b237521cc64c804dd44c4a81", + "reference": "8f06e92b95405216b237521cc64c804dd44c4a81", "shasum": "" }, "require": { - "guzzlehttp/psr7": "^1.4.2", + "guzzlehttp/psr7": "^1.7||^2.0", + "php": ">=7.3", "psr/http-factory": "^1.0" }, "provide": { "psr/http-factory-implementation": "^1.0" }, "require-dev": { - "http-interop/http-factory-tests": "^0.5", - "phpunit/phpunit": "^6.5" + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" }, - "time": "2018-07-31T19:32:56+00:00", + "time": "2021-07-21T13:50:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -368,55 +486,57 @@ "psr-17", "psr-7" ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/1.2.0" + }, "install-path": "../http-interop/http-factory-guzzle" }, { "name": "laminas/laminas-diactoros", - "version": "2.2.3", - "version_normalized": "2.2.3.0", + "version": "2.26.0", + "version_normalized": "2.26.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "b596c7141f5093aefec94cb5e8745212299e290f" + "reference": "6584d44eb8e477e89d453313b858daac6183cddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/b596c7141f5093aefec94cb5e8745212299e290f", - "reference": "b596c7141f5093aefec94cb5e8745212299e290f", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/6584d44eb8e477e89d453313b858daac6183cddc", + "reference": "6584d44eb8e477e89d453313b858daac6183cddc", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.1", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "conflict": { - "phpspec/prophecy": "<1.9.0" + "zendframework/zend-diactoros": "*" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" - }, "require-dev": { "ext-curl": "*", "ext-dom": "*", + "ext-gd": "*", "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.5.0", - "laminas/laminas-coding-standard": "~1.0.0", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5.18" - }, - "time": "2020-03-29T12:30:54+00:00", + "http-interop/http-factory-tests": "^0.9.0", + "laminas/laminas-coding-standard": "^2.5", + "php-http/psr7-integration-tests": "^1.2", + "phpunit/phpunit": "^9.5.28", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.6" + }, + "time": "2023-10-29T16:17:44+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev", - "dev-develop": "2.2.x-dev", - "dev-release-1.8": "1.8.x-dev" + "laminas": { + "module": "Laminas\\Diactoros", + "config-provider": "Laminas\\Diactoros\\ConfigProvider" } }, "installation-source": "dist", @@ -453,99 +573,53 @@ "http", "laminas", "psr", + "psr-17", "psr-7" ], - "install-path": "../laminas/laminas-diactoros" - }, - { - "name": "laminas/laminas-zendframework-bridge", - "version": "1.0.3", - "version_normalized": "1.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9", - "reference": "bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1", - "squizlabs/php_codesniffer": "^3.5" - }, - "time": "2020-04-03T16:01:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev", - "dev-develop": "1.1.x-dev" - }, - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" + "support": { + "chat": "https://laminas.dev/chat", + "docs": "https://docs.laminas.dev/laminas-diactoros/", + "forum": "https://discourse.laminas.dev", + "issues": "https://github.com/laminas/laminas-diactoros/issues", + "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", + "source": "https://github.com/laminas/laminas-diactoros" + }, + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "keywords": [ - "ZendFramework", - "autoloading", - "laminas", - "zf" ], - "install-path": "../laminas/laminas-zendframework-bridge" + "install-path": "../laminas/laminas-diactoros" }, { "name": "league/oauth2-client", - "version": "2.4.1", - "version_normalized": "2.4.1.0", + "version": "2.8.1", + "version_normalized": "2.8.1.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "cc114abc622a53af969e8664722e84ca36257530" + "reference": "9df2924ca644736c835fc60466a3a60390d334f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/cc114abc622a53af969e8664722e84ca36257530", - "reference": "cc114abc622a53af969e8664722e84ca36257530", + "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/9df2924ca644736c835fc60466a3a60390d334f9", + "reference": "9df2924ca644736c835fc60466a3a60390d334f9", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "paragonie/random_compat": "^1|^2|^9.99", - "php": "^5.6|^7.0" + "ext-json": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5", + "php": "^7.1 || >=8.0.0 <8.5.0" }, "require-dev": { - "eloquent/liberator": "^2.0", - "eloquent/phony-phpunit": "^1.0|^3.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phpunit/phpunit": "^5.7|^6.0", - "squizlabs/php_codesniffer": "^2.3|^3.0" + "mockery/mockery": "^1.3.5", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.11" }, - "time": "2018-11-22T18:33:57+00:00", + "time": "2025-02-26T04:37:30+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -580,6 +654,10 @@ "oauth2", "single sign on" ], + "support": { + "issues": "https://github.com/thephpleague/oauth2-client/issues", + "source": "https://github.com/thephpleague/oauth2-client/tree/2.8.1" + }, "install-path": "../league/oauth2-client" }, { @@ -642,17 +720,17 @@ }, { "name": "league/oauth2-google", - "version": "3.0.2", - "version_normalized": "3.0.2.0", + "version": "3.0.4", + "version_normalized": "3.0.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-google.git", - "reference": "cfe9b0ae69eb5dbac64a282f04410b731f6b9c04" + "reference": "6b79441f244040760bed5fdcd092a2bda7cf34c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-google/zipball/cfe9b0ae69eb5dbac64a282f04410b731f6b9c04", - "reference": "cfe9b0ae69eb5dbac64a282f04410b731f6b9c04", + "url": "https://api.github.com/repos/thephpleague/oauth2-google/zipball/6b79441f244040760bed5fdcd092a2bda7cf34c6", + "reference": "6b79441f244040760bed5fdcd092a2bda7cf34c6", "shasum": "" }, "require": { @@ -664,7 +742,7 @@ "phpunit/phpunit": "^6.0", "squizlabs/php_codesniffer": "^2.0" }, - "time": "2019-11-16T14:11:06+00:00", + "time": "2021-01-27T16:09:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -692,6 +770,10 @@ "oauth", "oauth2" ], + "support": { + "issues": "https://github.com/thephpleague/oauth2-google/issues", + "source": "https://github.com/thephpleague/oauth2-google/tree/3.0.4" + }, "install-path": "../league/oauth2-google" }, { @@ -745,39 +827,41 @@ }, { "name": "nyholm/psr7", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "version": "1.8.2", + "version_normalized": "1.8.2.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c" + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/55ff6b76573f5b242554c9775792bd59fb52e11c", - "reference": "55ff6b76573f5b242554c9775792bd59fb52e11c", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", "shasum": "" }, "require": { - "php": "^7.1", - "php-http/message-factory": "^1.0", + "php": ">=7.2", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { + "php-http/message-factory-implementation": "1.0", "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "http-interop/http-factory-tests": "dev-master", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^7.5" + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" }, - "time": "2019-09-05T13:24:16+00:00", + "time": "2024-09-09T07:06:30+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.8-dev" } }, "installation-source": "dist", @@ -801,39 +885,53 @@ } ], "description": "A fast PHP7 implementation of PSR-7", - "homepage": "http://tnyholm.se", + "homepage": "https://tnyholm.se", "keywords": [ "psr-17", "psr-7" ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], "install-path": "../nyholm/psr7" }, { "name": "nyholm/psr7-server", - "version": "0.4.1", - "version_normalized": "0.4.1.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7-server.git", - "reference": "e6a526e9170e6e33a13efc2b61703ca476b7ea68" + "reference": "4335801d851f554ca43fa6e7d2602141538854dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/e6a526e9170e6e33a13efc2b61703ca476b7ea68", - "reference": "e6a526e9170e6e33a13efc2b61703ca476b7ea68", + "url": "https://api.github.com/repos/Nyholm/psr7-server/zipball/4335801d851f554ca43fa6e7d2602141538854dc", + "reference": "4335801d851f554ca43fa6e7d2602141538854dc", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { "nyholm/nsa": "^1.1", - "nyholm/psr7": "^1.0", - "phpunit/phpunit": "^7.0" + "nyholm/psr7": "^1.3", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3" }, - "time": "2019-11-05T20:36:33+00:00", + "time": "2023-11-08T09:30:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -861,41 +959,59 @@ "psr-17", "psr-7" ], + "support": { + "issues": "https://github.com/Nyholm/psr7-server/issues", + "source": "https://github.com/Nyholm/psr7-server/tree/1.1.0" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], "install-path": "../nyholm/psr7-server" }, { "name": "omines/oauth2-gitlab", - "version": "3.2.0", - "version_normalized": "3.2.0.0", + "version": "3.6.0", + "version_normalized": "3.6.0.0", "source": { "type": "git", "url": "https://github.com/omines/oauth2-gitlab.git", - "reference": "2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a" + "reference": "5d8afd581c3d40dc469d03fa42965c449e95de9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a", - "reference": "2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a", + "url": "https://api.github.com/repos/omines/oauth2-gitlab/zipball/5d8afd581c3d40dc469d03fa42965c449e95de9a", + "reference": "5d8afd581c3d40dc469d03fa42965c449e95de9a", "shasum": "" }, "require": { - "league/oauth2-client": "^2.2", - "php": ">=7.2" - }, - "conflict": { - "league/oauth2-client": "2.4.0" + "league/oauth2-client": "^2.4.1", + "php": ">=8.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "m4tthumphrey/php-gitlab-api": "^9.0.0", - "mockery/mockery": "^1.0", - "php-http/guzzle6-adapter": "^2.0.1", - "phpunit/phpunit": "^8.0|^9.0" + "friendsofphp/php-cs-fixer": "^3.37.1", + "guzzlehttp/psr7": "^2.6.1", + "http-interop/http-factory-guzzle": "^1.2", + "infection/infection": "^0.27.7", + "m4tthumphrey/php-gitlab-api": "^11.12", + "mockery/mockery": "^1.6.6", + "php-http/guzzle7-adapter": "^1.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.41", + "phpstan/phpstan-mockery": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.15", + "phpunit/phpunit": "^10.4.2" }, "suggest": { "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token" }, - "time": "2020-02-10T10:37:24+00:00", + "time": "2023-11-06T21:46:04+00:00", "type": "library", "extra": { "branch-alias": { @@ -928,89 +1044,48 @@ "oauth", "oauth2" ], - "install-path": "../omines/oauth2-gitlab" - }, - { - "name": "paragonie/random_compat", - "version": "v9.99.99", - "version_normalized": "9.99.99.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", - "shasum": "" - }, - "require": { - "php": "^7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + "support": { + "issues": "https://github.com/omines/oauth2-gitlab/issues", + "source": "https://github.com/omines/oauth2-gitlab/tree/3.6.0" }, - "time": "2018-07-02T15:55:56+00:00", - "type": "library", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "install-path": "../paragonie/random_compat" + "install-path": "../omines/oauth2-gitlab" }, { "name": "php-http/guzzle6-adapter", - "version": "v1.1.1", - "version_normalized": "1.1.1.0", + "version": "v2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/9d1a45eb1c59f12574552e81fb295e9e53430a56", + "reference": "9d1a45eb1c59f12574552e81fb295e9e53430a56", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "php-http/httplug": "^1.0" + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0" }, "provide": { "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" }, "require-dev": { "ext-curl": "*", - "php-http/adapter-integration-tests": "^0.4" + "php-http/client-integration-tests": "^2.0 || ^3.0", + "phpunit/phpunit": "^7.4 || ^8.4" }, - "time": "2016-05-10T06:13:32+00:00", + "time": "2021-03-02T10:52:33+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "2.x-dev" } }, "installation-source": "dist", @@ -1024,13 +1099,13 @@ "MIT" ], "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, { "name": "David de Boer", "email": "david@ddeboer.nl" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" } ], "description": "Guzzle 6 HTTP Adapter", @@ -1039,39 +1114,40 @@ "Guzzle", "http" ], + "support": { + "issues": "https://github.com/php-http/guzzle6-adapter/issues", + "source": "https://github.com/php-http/guzzle6-adapter/tree/v2.0.2" + }, + "abandoned": "guzzlehttp/guzzle or php-http/guzzle7-adapter", "install-path": "../php-http/guzzle6-adapter" }, { "name": "php-http/httplug", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", + "version": "2.4.1", + "version_normalized": "2.4.1.0", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { - "php": ">=5.4", - "php-http/promise": "^1.0", - "psr/http-message": "^1.0" + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, - "time": "2016-08-31T08:30:17+00:00", + "time": "2024-09-23T11:39:58+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -1089,7 +1165,8 @@ }, { "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "HTTPlug, the HTTP client abstraction for PHP", @@ -1098,38 +1175,40 @@ "client", "http" ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.1" + }, "install-path": "../php-http/httplug" }, { - "name": "php-http/message-factory", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", + "name": "php-http/promise", + "version": "1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + "url": "https://github.com/php-http/promise.git", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" + "php": "^7.1 || ^8.0" }, - "time": "2015-12-19T14:08:53+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, + "time": "2024-03-15T13:55:21+00:00", + "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Http\\Message\\": "src/" + "Http\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1137,109 +1216,69 @@ "MIT" ], "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, { "name": "Márk Sági-Kazár", "email": "mark.sagikazar@gmail.com" } ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" + "promise" ], - "install-path": "../php-http/message-factory" - }, - { - "name": "php-http/promise", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", - "shasum": "" - }, - "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" - }, - "time": "2016-01-26T13:27:02+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], "install-path": "../php-http/promise" }, { "name": "phpmailer/phpmailer", - "version": "v6.1.5", - "version_normalized": "6.1.5.0", + "version": "v6.10.0", + "version_normalized": "6.10.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a8bf068f64a580302026e484ee29511f661b2ad3" + "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3", - "reference": "a8bf068f64a580302026e484ee29511f661b2ad3", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", + "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144", "shasum": "" }, "require": { "ext-ctype": "*", "ext-filter": "*", + "ext-hash": "*", "php": ">=5.5.0" }, "require-dev": { - "doctrine/annotations": "^1.2", - "friendsofphp/php-cs-fixer": "^2.2", - "phpunit/phpunit": "^4.8 || ^5.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.2", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "ext-mbstring": "Needed to send email in multibyte encoding charset", + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2020-03-14T14:23:48+00:00", + "time": "2025-04-24T15:19:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1269,31 +1308,41 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "support": { + "issues": "https://github.com/PHPMailer/PHPMailer/issues", + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0" + }, + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], "install-path": "../phpmailer/phpmailer" }, { "name": "psr/container", - "version": "1.0.0", - "version_normalized": "1.0.0.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, - "time": "2017-02-14T16:28:37+00:00", + "time": "2021-11-05T16:47:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -1309,7 +1358,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1321,28 +1370,87 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, "install-path": "../psr/container" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "time": "2023-09-23T14:17:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "install-path": "../psr/http-client" + }, { "name": "psr/http-factory", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2019-04-30T12:38:16+00:00", + "time": "2024-04-15T12:06:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -1362,10 +1470,10 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -1376,31 +1484,34 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, "install-path": "../psr/http-factory" }, { "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.1", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, - "time": "2016-08-06T14:39:51+00:00", + "time": "2023-04-04T09:50:52+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "installation-source": "dist", @@ -1429,28 +1540,31 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/1.1" + }, "install-path": "../psr/http-message" }, { "name": "psr/http-server-handler", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7" + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7", - "reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2018-10-30T16:46:14+00:00", + "time": "2023-04-10T20:06:20+00:00", "type": "library", "extra": { "branch-alias": { @@ -1470,7 +1584,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side request handler", @@ -1485,29 +1599,32 @@ "response", "server" ], + "support": { + "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" + }, "install-path": "../psr/http-server-handler" }, { "name": "psr/http-server-middleware", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5" + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5", - "reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", "shasum": "" }, "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, - "time": "2018-10-30T17:12:04+00:00", + "time": "2023-04-11T06:14:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -1527,7 +1644,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP server-side middleware", @@ -1541,27 +1658,31 @@ "request", "response" ], + "support": { + "issues": "https://github.com/php-fig/http-server-middleware/issues", + "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" + }, "install-path": "../psr/http-server-middleware" }, { "name": "psr/log", - "version": "1.1.3", - "version_normalized": "1.1.3.0", + "version": "1.1.4", + "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2020-03-23T09:12:05+00:00", + "time": "2021-05-03T11:20:27+00:00", "type": "library", "extra": { "branch-alias": { @@ -1581,7 +1702,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1591,6 +1712,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, "install-path": "../psr/log" }, { @@ -1638,38 +1762,43 @@ }, { "name": "slim/psr7", - "version": "0.6", - "version_normalized": "0.6.0.0", + "version": "1.7.1", + "version_normalized": "1.7.1.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim-Psr7.git", - "reference": "23015a8814382c244315602d44cb02d412b6b059" + "reference": "fe98653e7983010aa85c1d137c9b9ad5a1cd187d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/23015a8814382c244315602d44cb02d412b6b059", - "reference": "23015a8814382c244315602d44cb02d412b6b059", + "url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/fe98653e7983010aa85c1d137c9b9ad5a1cd187d", + "reference": "fe98653e7983010aa85c1d137c9b9ad5a1cd187d", "shasum": "" }, "require": { - "fig/http-message-util": "^1.1.2", - "php": "^7.1", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3" + "fig/http-message-util": "^1.1.5", + "php": "^8.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.0 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/polyfill-php80": "^1.29" }, "provide": { - "psr/http-message-implementation": "1.0" + "psr/http-factory-implementation": "^1.0", + "psr/http-message-implementation": "^1.0 || ^2.0" }, "require-dev": { + "adriansuter/php-autoload-override": "^1.4", "ext-json": "*", - "http-interop/http-factory-tests": "^0.6.0", - "php-http/psr7-integration-tests": "dev-master", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.0|^7.0", - "squizlabs/php_codesniffer": "^3.3" - }, - "time": "2019-10-05T20:27:07+00:00", + "http-interop/http-factory-tests": "^1.0 || ^2.0", + "php-http/psr7-integration-tests": "^1.4", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.2", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.6 || ^10", + "squizlabs/php_codesniffer": "^3.10" + }, + "time": "2025-05-13T14:24:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1685,22 +1814,22 @@ { "name": "Josh Lockhart", "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" + "homepage": "https://joshlockhart.com" }, { "name": "Andrew Smith", "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" + "homepage": "https://silentworks.co.uk" }, { "name": "Rob Allen", "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" + "homepage": "https://akrabat.com" }, { "name": "Pierre Berube", "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" + "homepage": "https://www.lgse.com" } ], "description": "Strict PSR-7 implementation", @@ -1710,48 +1839,55 @@ "psr-7", "psr7" ], + "support": { + "issues": "https://github.com/slimphp/Slim-Psr7/issues", + "source": "https://github.com/slimphp/Slim-Psr7/tree/1.7.1" + }, "install-path": "../slim/psr7" }, { "name": "slim/slim", - "version": "4.5.0", - "version_normalized": "4.5.0.0", + "version": "4.14.0", + "version_normalized": "4.14.0.0", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "5613cbb521081ed676d5d7eb3e44f2b80a818c24" + "reference": "5943393b88716eb9e82c4161caa956af63423913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/5613cbb521081ed676d5d7eb3e44f2b80a818c24", - "reference": "5613cbb521081ed676d5d7eb3e44f2b80a818c24", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/5943393b88716eb9e82c4161caa956af63423913", + "reference": "5943393b88716eb9e82c4161caa956af63423913", "shasum": "" }, "require": { "ext-json": "*", "nikic/fast-route": "^1.3", - "php": "^7.2", - "psr/container": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.1 || ^2.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "require-dev": { - "adriansuter/php-autoload-override": "^1.0", + "adriansuter/php-autoload-override": "^1.4", "ext-simplexml": "*", - "guzzlehttp/psr7": "^1.5", - "http-interop/http-factory-guzzle": "^1.0", - "laminas/laminas-diactoros": "^2.1", - "nyholm/psr7": "^1.1", - "nyholm/psr7-server": "^0.3.0", - "phpspec/prophecy": "^1.10", - "phpstan/phpstan": "^0.11.5", - "phpunit/phpunit": "^8.5", - "slim/http": "^1.0", - "slim/psr7": "^1.0", - "squizlabs/php_codesniffer": "^3.5" + "guzzlehttp/psr7": "^2.6", + "httpsoft/http-message": "^1.1", + "httpsoft/http-server-request": "^1.1", + "laminas/laminas-diactoros": "^2.17 || ^3", + "nyholm/psr7": "^1.8", + "nyholm/psr7-server": "^1.1", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^9.6", + "slim/http": "^1.3", + "slim/psr7": "^1.6", + "squizlabs/php_codesniffer": "^3.10", + "vimeo/psalm": "^5.24" }, "suggest": { "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", @@ -1759,7 +1895,7 @@ "php-di/php-di": "PHP-DI is the recommended container library to be used with Slim", "slim/psr7": "Slim PSR-7 implementation. See https://www.slimframework.com/docs/v4/start/installation.html for more information." }, - "time": "2020-04-14T20:49:48+00:00", + "time": "2024-06-13T08:54:48+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1806,31 +1942,51 @@ "micro", "router" ], + "support": { + "docs": "https://www.slimframework.com/docs/v4/", + "forum": "https://discourse.slimframework.com/", + "irc": "irc://irc.freenode.net:6667/slimphp", + "issues": "https://github.com/slimphp/Slim/issues", + "rss": "https://www.slimframework.com/blog/feed.rss", + "slack": "https://slimphp.slack.com/", + "source": "https://github.com/slimphp/Slim", + "wiki": "https://github.com/slimphp/Slim/wiki" + }, + "funding": [ + { + "url": "https://opencollective.com/slimphp", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slim/slim", + "type": "tidelift" + } + ], "install-path": "../slim/slim" }, { "name": "smarty/smarty", - "version": "v3.1.36", - "version_normalized": "3.1.36.0", + "version": "v3.1.46", + "version_normalized": "3.1.46.0", "source": { "type": "git", "url": "https://github.com/smarty-php/smarty.git", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451" + "reference": "b3ade90dece67812410954528e0039fb5b73bcf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/smarty-php/smarty/zipball/fd148f7ade295014fff77f89ee3d5b20d9d55451", - "reference": "fd148f7ade295014fff77f89ee3d5b20d9d55451", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/b3ade90dece67812410954528e0039fb5b73bcf7", + "reference": "b3ade90dece67812410954528e0039fb5b73bcf7", "shasum": "" }, "require": { "php": ">=5.2" }, "require-dev": { - "phpunit/phpunit": "6.4.1", + "phpunit/phpunit": "^7.5 || ^6.5 || ^5.7 || ^4.8", "smarty/smarty-lexer": "^3.1" }, - "time": "2020-04-14T14:44:26+00:00", + "time": "2022-08-01T21:58:13+00:00", "type": "library", "extra": { "branch-alias": { @@ -1866,46 +2022,52 @@ "keywords": [ "templating" ], + "support": { + "forum": "http://www.smarty.net/forums/", + "irc": "irc://irc.freenode.org/smarty", + "issues": "https://github.com/smarty-php/smarty/issues", + "source": "https://github.com/smarty-php/smarty/tree/v3.1.46" + }, "install-path": "../smarty/smarty" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf" + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", - "reference": "47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2020-03-09T19:04:49+00:00", + "time": "2024-09-10T14:38:51+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1916,6 +2078,10 @@ "name": "Laurent Bassin", "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -1931,44 +2097,150 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-intl-idn" }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2024-09-09T11:45:10+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-normalizer" + }, { "name": "symfony/polyfill-mbstring", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", - "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2020-03-09T19:04:49+00:00", + "time": "2024-12-23T08:48:59+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1993,40 +2265,61 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "install-path": "../symfony/polyfill-mbstring" }, { - "name": "symfony/polyfill-php72", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", + "name": "symfony/polyfill-php80", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "37b0976c78b94856543260ce09b460a7bc852747" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/37b0976c78b94856543260ce09b460a7bc852747", - "reference": "37b0976c78b94856543260ce09b460a7bc852747", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, - "time": "2020-02-27T09:26:54+00:00", + "time": "2025-01-02T08:10:11+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, "files": [ "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2034,6 +2327,10 @@ "MIT" ], "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2043,7 +2340,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2051,7 +2348,68 @@ "portable", "shim" ], - "install-path": "../symfony/polyfill-php72" + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "wp-statistics/pchart", + "version": "1.2.3", + "version_normalized": "1.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/wp-statistics/pchart.git", + "reference": "721d03460b66de3d52a890c65e7d5cbf3a656059" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-statistics/pchart/zipball/721d03460b66de3d52a890c65e7d5cbf3a656059", + "reference": "721d03460b66de3d52a890c65e7d5cbf3a656059", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "time": "2022-11-14T13:06:09+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "pChart": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mostafa Soufi", + "email": "mostafa.soufi@hotmail.com" + } + ], + "description": "A PHP Class to build Charts", + "support": { + "issues": "https://github.com/wp-statistics/pchart/issues", + "source": "https://github.com/wp-statistics/pchart/tree/1.2.3" + }, + "abandoned": true, + "install-path": "../wp-statistics/pchart" } ], "dev": true, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 9e7ef68dc7..1e117705a9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,166 +1,148 @@ <?php return array( 'root' => array( - 'pretty_version' => 'dev-2.0.0-testplan-explode', - 'version' => 'dev-2.0.0-testplan-explode', + 'name' => '__root__', + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '38914c1efbfee85e551a1a1ec7b72184d6a09289', - 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( - 'pretty_version' => 'dev-2.0.0-testplan-explode', - 'version' => 'dev-2.0.0-testplan-explode', + 'pretty_version' => '1.0.0+no-version-set', + 'version' => '1.0.0.0', + 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '38914c1efbfee85e551a1a1ec7b72184d6a09289', 'dev_requirement' => false, ), 'adodb/adodb-php' => array( - 'pretty_version' => 'v5.22.1', - 'version' => '5.22.1.0', + 'pretty_version' => 'v5.22.9', + 'version' => '5.22.9.0', + 'reference' => 'a568bfeb72d6b5942df747adc36b95165a083e60', 'type' => 'library', 'install_path' => __DIR__ . '/../adodb/adodb-php', 'aliases' => array(), - 'reference' => '64cfc1a65648e4d1245c724ca0c347c9c5eaf2f6', 'dev_requirement' => false, ), 'fig/http-message-util' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => '1.1.5', + 'version' => '1.1.5.0', + 'reference' => '9d94dc0154230ac39e5bf89398b324a86f63f765', 'type' => 'library', 'install_path' => __DIR__ . '/../fig/http-message-util', 'aliases' => array(), - 'reference' => '3242caa9da7221a304b8f84eb9eaddae0a7cf422', 'dev_requirement' => false, ), 'guzzlehttp/guzzle' => array( - 'pretty_version' => '6.5.3', - 'version' => '6.5.3.0', + 'pretty_version' => '6.5.8', + 'version' => '6.5.8.0', + 'reference' => 'a52f0440530b54fa079ce76e8c5d196a42cad981', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), - 'reference' => 'aab4ebd862aa7d04f01a4b51849d657db56d882e', 'dev_requirement' => false, ), 'guzzlehttp/promises' => array( - 'pretty_version' => 'v1.3.1', - 'version' => '1.3.1.0', + 'pretty_version' => '1.5.3', + 'version' => '1.5.3.0', + 'reference' => '67ab6e18aaa14d753cc148911d273f6e6cb6721e', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), - 'reference' => 'a59da6cf61d80060647ff4d3eb2c03a2bc694646', 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '1.6.1', - 'version' => '1.6.1.0', + 'pretty_version' => '1.9.1', + 'version' => '1.9.1.0', + 'reference' => 'e4490cabc77465aaee90b20cfc9a770f8c04be6b', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), - 'reference' => '239400de7a173fe9901b9ac7c06497751f00727a', 'dev_requirement' => false, ), 'http-interop/http-factory-guzzle' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'reference' => '8f06e92b95405216b237521cc64c804dd44c4a81', 'type' => 'library', 'install_path' => __DIR__ . '/../http-interop/http-factory-guzzle', 'aliases' => array(), - 'reference' => '34861658efb9899a6618cef03de46e2a52c80fc0', 'dev_requirement' => false, ), 'laminas/laminas-diactoros' => array( - 'pretty_version' => '2.2.3', - 'version' => '2.2.3.0', + 'pretty_version' => '2.26.0', + 'version' => '2.26.0.0', + 'reference' => '6584d44eb8e477e89d453313b858daac6183cddc', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', 'aliases' => array(), - 'reference' => 'b596c7141f5093aefec94cb5e8745212299e290f', - 'dev_requirement' => false, - ), - 'laminas/laminas-zendframework-bridge' => array( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-zendframework-bridge', - 'aliases' => array(), - 'reference' => 'bfbbdb6c998d50dbf69d2187cb78a5f1fa36e1e9', 'dev_requirement' => false, ), 'league/oauth2-client' => array( - 'pretty_version' => '2.4.1', - 'version' => '2.4.1.0', + 'pretty_version' => '2.8.1', + 'version' => '2.8.1.0', + 'reference' => '9df2924ca644736c835fc60466a3a60390d334f9', 'type' => 'library', 'install_path' => __DIR__ . '/../league/oauth2-client', 'aliases' => array(), - 'reference' => 'cc114abc622a53af969e8664722e84ca36257530', 'dev_requirement' => false, ), 'league/oauth2-github' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => 'e63d64f3ec167c09232d189c6b0c397458a99357', 'type' => 'library', 'install_path' => __DIR__ . '/../league/oauth2-github', 'aliases' => array(), - 'reference' => 'e63d64f3ec167c09232d189c6b0c397458a99357', 'dev_requirement' => false, ), 'league/oauth2-google' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', + 'pretty_version' => '3.0.4', + 'version' => '3.0.4.0', + 'reference' => '6b79441f244040760bed5fdcd092a2bda7cf34c6', 'type' => 'library', 'install_path' => __DIR__ . '/../league/oauth2-google', 'aliases' => array(), - 'reference' => 'cfe9b0ae69eb5dbac64a282f04410b731f6b9c04', 'dev_requirement' => false, ), 'nikic/fast-route' => array( 'pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', + 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/fast-route', 'aliases' => array(), - 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'dev_requirement' => false, ), 'nyholm/psr7' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', + 'pretty_version' => '1.8.2', + 'version' => '1.8.2.0', + 'reference' => 'a71f2b11690f4b24d099d6b16690a90ae14fc6f3', 'type' => 'library', 'install_path' => __DIR__ . '/../nyholm/psr7', 'aliases' => array(), - 'reference' => '55ff6b76573f5b242554c9775792bd59fb52e11c', 'dev_requirement' => false, ), 'nyholm/psr7-server' => array( - 'pretty_version' => '0.4.1', - 'version' => '0.4.1.0', + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '4335801d851f554ca43fa6e7d2602141538854dc', 'type' => 'library', 'install_path' => __DIR__ . '/../nyholm/psr7-server', 'aliases' => array(), - 'reference' => 'e6a526e9170e6e33a13efc2b61703ca476b7ea68', 'dev_requirement' => false, ), 'omines/oauth2-gitlab' => array( - 'pretty_version' => '3.2.0', - 'version' => '3.2.0.0', + 'pretty_version' => '3.6.0', + 'version' => '3.6.0.0', + 'reference' => '5d8afd581c3d40dc469d03fa42965c449e95de9a', 'type' => 'library', 'install_path' => __DIR__ . '/../omines/oauth2-gitlab', 'aliases' => array(), - 'reference' => '2d2d0d055735b5cda3af2ba2eba9ecaa6c0e8a2a', - 'dev_requirement' => false, - ), - 'paragonie/random_compat' => array( - 'pretty_version' => 'v9.99.99', - 'version' => '9.99.99.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../paragonie/random_compat', - 'aliases' => array(), - 'reference' => '84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95', 'dev_requirement' => false, ), 'php-http/async-client-implementation' => array( @@ -176,185 +158,210 @@ ), ), 'php-http/guzzle6-adapter' => array( - 'pretty_version' => 'v1.1.1', - 'version' => '1.1.1.0', + 'pretty_version' => 'v2.0.2', + 'version' => '2.0.2.0', + 'reference' => '9d1a45eb1c59f12574552e81fb295e9e53430a56', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/guzzle6-adapter', 'aliases' => array(), - 'reference' => 'a56941f9dc6110409cfcddc91546ee97039277ab', 'dev_requirement' => false, ), 'php-http/httplug' => array( - 'pretty_version' => 'v1.1.0', - 'version' => '1.1.0.0', + 'pretty_version' => '2.4.1', + 'version' => '2.4.1.0', + 'reference' => '5cad731844891a4c282f3f3e1b582c46839d22f4', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/httplug', 'aliases' => array(), - 'reference' => '1c6381726c18579c4ca2ef1ec1498fdae8bdf018', 'dev_requirement' => false, ), - 'php-http/message-factory' => array( - 'pretty_version' => 'v1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/message-factory', - 'aliases' => array(), - 'reference' => 'a478cb11f66a6ac48d8954216cfed9aa06a501a1', + 'php-http/message-factory-implementation' => array( 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), ), 'php-http/promise' => array( - 'pretty_version' => 'v1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'reference' => 'fc85b1fba37c169a69a07ef0d5a8075770cc1f83', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/promise', 'aliases' => array(), - 'reference' => 'dc494cdc9d7160b9a09bd5573272195242ce7980', 'dev_requirement' => false, ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.1.5', - 'version' => '6.1.5.0', + 'pretty_version' => 'v6.10.0', + 'version' => '6.10.0.0', + 'reference' => 'bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), - 'reference' => 'a8bf068f64a580302026e484ee29511f661b2ad3', 'dev_requirement' => false, ), 'psr/container' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', 'dev_requirement' => false, ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', 'dev_requirement' => false, ), 'psr/http-factory-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '^1.0', - 1 => '1.0', + 0 => '1.0', + 1 => '^1.0', ), ), 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.1', + 'version' => '1.1.0.0', + 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', 'dev_requirement' => false, ), 'psr/http-message-implementation' => array( 'dev_requirement' => false, 'provided' => array( 0 => '1.0', + 1 => '^1.0 || ^2.0', ), ), 'psr/http-server-handler' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-handler', 'aliases' => array(), - 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', 'dev_requirement' => false, ), 'psr/http-server-middleware' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-middleware', 'aliases' => array(), - 'reference' => '2296f45510945530b9dceb8bcedb5cb84d40c5f5', 'dev_requirement' => false, ), 'psr/log' => array( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc', 'dev_requirement' => false, ), 'ralouphie/getallheaders' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'dev_requirement' => false, ), 'slim/psr7' => array( - 'pretty_version' => '0.6', - 'version' => '0.6.0.0', + 'pretty_version' => '1.7.1', + 'version' => '1.7.1.0', + 'reference' => 'fe98653e7983010aa85c1d137c9b9ad5a1cd187d', 'type' => 'library', 'install_path' => __DIR__ . '/../slim/psr7', 'aliases' => array(), - 'reference' => '23015a8814382c244315602d44cb02d412b6b059', 'dev_requirement' => false, ), 'slim/slim' => array( - 'pretty_version' => '4.5.0', - 'version' => '4.5.0.0', + 'pretty_version' => '4.14.0', + 'version' => '4.14.0.0', + 'reference' => '5943393b88716eb9e82c4161caa956af63423913', 'type' => 'library', 'install_path' => __DIR__ . '/../slim/slim', 'aliases' => array(), - 'reference' => '5613cbb521081ed676d5d7eb3e44f2b80a818c24', 'dev_requirement' => false, ), 'smarty/smarty' => array( - 'pretty_version' => 'v3.1.36', - 'version' => '3.1.36.0', + 'pretty_version' => 'v3.1.46', + 'version' => '3.1.46.0', + 'reference' => 'b3ade90dece67812410954528e0039fb5b73bcf7', 'type' => 'library', 'install_path' => __DIR__ . '/../smarty/smarty', 'aliases' => array(), - 'reference' => 'fd148f7ade295014fff77f89ee3d5b20d9d55451', 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', + 'reference' => '9614ac4d8061dc257ecc64cba1b140873dce8ad3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), - 'reference' => '47bd6aa45beb1cd7c6a16b7d1810133b728bdfcf', + 'dev_requirement' => false, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', + 'reference' => '3833d7255cc303546435cb650316bff708a1c75c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', + 'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '81ffd3a9c6d707be22e3012b827de1c9775fc5ac', 'dev_requirement' => false, ), - 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.15.0', - 'version' => '1.15.0.0', + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', + 'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608', 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php72', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '37b0976c78b94856543260ce09b460a7bc852747', 'dev_requirement' => false, ), - 'zendframework/zend-diactoros' => array( + 'wp-statistics/pchart' => array( + 'pretty_version' => '1.2.3', + 'version' => '1.2.3.0', + 'reference' => '721d03460b66de3d52a890c65e7d5cbf3a656059', + 'type' => 'library', + 'install_path' => __DIR__ . '/../wp-statistics/pchart', + 'aliases' => array(), 'dev_requirement' => false, - 'replaced' => array( - 0 => '^2.2.1', - ), ), ), ); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index 589e9e770b..4c3a5d68f1 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70200)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/fig/http-message-util/CHANGELOG.md b/vendor/fig/http-message-util/CHANGELOG.md index 7815030291..1a02e547f0 100644 --- a/vendor/fig/http-message-util/CHANGELOG.md +++ b/vendor/fig/http-message-util/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.1.5 - 2020-11-24 + +### Added + +- [#19](https://github.com/php-fig/http-message-util/pull/19) adds support for PHP 8. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 1.1.4 - 2020-02-05 ### Added diff --git a/vendor/fig/http-message-util/README.md b/vendor/fig/http-message-util/README.md index 56cee17d89..ea5b5aa755 100644 --- a/vendor/fig/http-message-util/README.md +++ b/vendor/fig/http-message-util/README.md @@ -1,7 +1,7 @@ # PSR Http Message Util This repository holds utility classes and constants to facilitate common -operations of [PSR-7](http://www.php-fig.org/psr/psr-7/); the primary purpose is +operations of [PSR-7](https://www.php-fig.org/psr/psr-7/); the primary purpose is to provide constants for referring to request methods, response status codes and messages, and potentially common headers. diff --git a/vendor/fig/http-message-util/composer.json b/vendor/fig/http-message-util/composer.json index 11758fe2b0..8645893b04 100644 --- a/vendor/fig/http-message-util/composer.json +++ b/vendor/fig/http-message-util/composer.json @@ -6,11 +6,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "suggest": { "psr/http-message": "The package containing the PSR-7 interfaces" diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md index a5cb9c1a8f..b053017a96 100644 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -1,5 +1,27 @@ # Change Log +## 6.5.8 - 2022-06-20 + +* Fix change in port should be considered a change in origin +* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin + +## 6.5.7 - 2022-06-09 + +* Fix failure to strip Authorization header on HTTP downgrade +* Fix failure to strip the Cookie header on change in host or HTTP downgrade + +## 6.5.6 - 2022-05-25 + +* Fix cross-domain cookie leakage + +## 6.5.5 - 2020-06-16 + +* Unpin version constraint for `symfony/polyfill-intl-idn` [#2678](https://github.com/guzzle/guzzle/pull/2678) + +## 6.5.4 - 2020-05-25 + +* Fix various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626) + ## 6.5.3 - 2020-04-18 * Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550) @@ -19,7 +41,10 @@ * Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) * Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287) * Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132) -* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) +* Fix: `RetryMiddleware` did not do exponential delay between retries due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132) + Previously, `RetryMiddleware` would sleep for 1 millisecond, then 2 milliseconds, then 4 milliseconds. + **After this change, `RetryMiddleware` will sleep for 1 second, then 2 seconds, then 4 seconds.** + `Middleware::retry()` accepts a second callback parameter to override the default timeouts if needed. * Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) * Deprecated `ClientInterface::VERSION` diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE index 50a177b032..fd2375d888 100644 --- a/vendor/guzzlehttp/guzzle/LICENSE +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -1,4 +1,12 @@ -Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com> +The MIT License (MIT) + +Copyright (c) 2011 Michael Dowling <mtdowling@gmail.com> +Copyright (c) 2012 Jeremy Lindblom <jeremeamia@gmail.com> +Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk> +Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com> +Copyright (c) 2015 Tobias Schultze <webmaster@tubo-world.de> +Copyright (c) 2016 Tobias Nyholm <tobias.nyholm@gmail.com> +Copyright (c) 2016 George Mponos <gmponos@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/guzzlehttp/guzzle/README.md b/vendor/guzzlehttp/guzzle/README.md index 5fdb6c5f42..bc98e1a100 100644 --- a/vendor/guzzlehttp/guzzle/README.md +++ b/vendor/guzzlehttp/guzzle/README.md @@ -1,8 +1,9 @@ -Guzzle, PHP HTTP client -======================= +![Guzzle](.github/logo.png?raw=true) + +# Guzzle, PHP HTTP client [![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) -[![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) +[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI) [![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and @@ -38,15 +39,18 @@ $promise->wait(); ## Help and docs -- [Documentation](http://guzzlephp.org/) -- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) +We use GitHub issues only to discuss bugs and new features. For support please refer to: + +- [Documentation](https://docs.guzzlephp.org) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle) +- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/) - [Gitter](https://gitter.im/guzzle/guzzle) ## Installing Guzzle The recommended way to install Guzzle is through -[Composer](http://getcomposer.org). +[Composer](https://getcomposer.org/). ```bash # Install Composer @@ -74,17 +78,20 @@ composer update ## Version Guidance -| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | -|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| -| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | -| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | -| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | -| 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|----------------|---------------------|--------------|---------------------|---------------------|-------|--------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | +| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.2 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x [guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 -[guzzle-6-repo]: https://github.com/guzzle/guzzle -[guzzle-3-docs]: http://guzzle3.readthedocs.org -[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ -[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ +[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 +[guzzle-7-repo]: https://github.com/guzzle/guzzle +[guzzle-3-docs]: https://guzzle3.readthedocs.io/ +[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/ +[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/ +[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/ diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json index 02ab73c0f1..a57d78f605 100644 --- a/vendor/guzzlehttp/guzzle/composer.json +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -14,18 +14,48 @@ "homepage": "http://guzzlephp.org/", "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "require": { "php": ">=5.5", "ext-json": "*", - "symfony/polyfill-intl-idn": "^1.11", + "symfony/polyfill-intl-idn": "^1.17", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1" + "guzzlehttp/psr7": "^1.9" }, "require-dev": { "ext-curl": "*", @@ -36,7 +66,10 @@ "psr/log": "Required for using the Log middleware" }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "bamarni/composer-bin-plugin": true + } }, "extra": { "branch-alias": { diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php index cd9a63574f..315a022cf4 100644 --- a/vendor/guzzlehttp/guzzle/src/Client.php +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -2,7 +2,7 @@ namespace GuzzleHttp; use GuzzleHttp\Cookie\CookieJar; -use GuzzleHttp\Exception\InvalidArgumentException; +use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Promise; use GuzzleHttp\Psr7; use Psr\Http\Message\RequestInterface; @@ -47,9 +47,8 @@ class Client implements ClientInterface * wire. The function is called with a Psr7\Http\Message\RequestInterface * and array of transfer options, and must return a * GuzzleHttp\Promise\PromiseInterface that is fulfilled with a - * Psr7\Http\Message\ResponseInterface on success. "handler" is a - * constructor only option that cannot be overridden in per/request - * options. If no handler is provided, a default handler will be created + * Psr7\Http\Message\ResponseInterface on success. + * If no handler is provided, a default handler will be created * that enables all of the request options below by attaching all of the * default middleware to the handler. * - base_uri: (string|UriInterface) Base URI of the client that is merged @@ -489,7 +488,7 @@ private function applyOptions(RequestInterface $request, array &$options) /** * Throw Exception with pre-set message. * @return void - * @throws InvalidArgumentException Invalid body. + * @throws \InvalidArgumentException Invalid body. */ private function invalidBody() { diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 76872dd3a9..638b75dca4 100644 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -15,7 +15,7 @@ interface ClientInterface /** * @deprecated Will be removed in Guzzle 7.0.0 */ - const VERSION = '6.5.3'; + const VERSION = '6.5.5'; /** * Send an HTTP request. diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php index 38f98ad7c0..394df3a7cf 100644 --- a/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ b/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -240,6 +240,11 @@ public function extractCookies( if (0 !== strpos($sc->getPath(), '/')) { $sc->setPath($this->getCookiePathFromRequest($request)); } + if (!$sc->matchesDomain($request->getUri()->getHost())) { + continue; + } + // Note: At this point `$sc->getDomain()` being a public suffix should + // be rejected, but we don't want to pull in the full PSL dependency. $this->setCookie($sc); } } diff --git a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php index 3d776a70bc..55f6901a73 100644 --- a/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ b/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -333,12 +333,19 @@ public function matchesPath($requestPath) */ public function matchesDomain($domain) { + $cookieDomain = $this->getDomain(); + if (null === $cookieDomain) { + return true; + } + // Remove the leading '.' as per spec in RFC 6265. // http://tools.ietf.org/html/rfc6265#section-5.2.3 - $cookieDomain = ltrim($this->getDomain(), '.'); + $cookieDomain = ltrim(strtolower($cookieDomain), '.'); + + $domain = strtolower($domain); // Domain not set or exact match. - if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) { + if ('' === $cookieDomain || $domain === $cookieDomain) { return true; } diff --git a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php index 8eaa34f357..564c95f481 100644 --- a/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ b/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -1,7 +1,6 @@ <?php namespace GuzzleHttp\Handler; -use GuzzleHttp\Exception\InvalidArgumentException; use GuzzleHttp\Promise as P; use GuzzleHttp\Promise\Promise; use GuzzleHttp\Utils; diff --git a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index e4644b7ac1..008a29b8c7 100644 --- a/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -94,6 +94,14 @@ public function checkRedirect( $this->guardMax($request, $options); $nextRequest = $this->modifyRequest($request, $options, $response); + // If authorization is handled by curl, unset it if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) { + unset( + $options['curl'][\CURLOPT_HTTPAUTH], + $options['curl'][\CURLOPT_USERPWD] + ); + } + if (isset($options['allow_redirects']['on_redirect'])) { call_user_func( $options['allow_redirects']['on_redirect'], @@ -141,7 +149,7 @@ function (ResponseInterface $response) use ($uri, $statusCode) { } /** - * Check for too many redirects + * Check for too many redirects. * * @return void * @@ -190,7 +198,7 @@ public function modifyRequest( $modify['body'] = ''; } - $uri = $this->redirectUri($request, $response, $protocols); + $uri = self::redirectUri($request, $response, $protocols); if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { $idnOptions = ($options['idn_conversion'] === true) ? IDNA_DEFAULT : $options['idn_conversion']; $uri = Utils::idnUriConvert($uri, $idnOptions); @@ -210,16 +218,17 @@ public function modifyRequest( $modify['remove_headers'][] = 'Referer'; } - // Remove Authorization header if host is different. - if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + // Remove Authorization and Cookie headers if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) { $modify['remove_headers'][] = 'Authorization'; + $modify['remove_headers'][] = 'Cookie'; } return Psr7\modify_request($request, $modify); } /** - * Set the appropriate URL on the request based on the location header + * Set the appropriate URL on the request based on the location header. * * @param RequestInterface $request * @param ResponseInterface $response @@ -227,7 +236,7 @@ public function modifyRequest( * * @return UriInterface */ - private function redirectUri( + private static function redirectUri( RequestInterface $request, ResponseInterface $response, array $protocols diff --git a/vendor/guzzlehttp/guzzle/src/Utils.php b/vendor/guzzlehttp/guzzle/src/Utils.php index c8fc1aec66..c698acbf02 100644 --- a/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/vendor/guzzlehttp/guzzle/src/Utils.php @@ -3,6 +3,7 @@ use GuzzleHttp\Exception\InvalidArgumentException; use Psr\Http\Message\UriInterface; +use Symfony\Polyfill\Intl\Idn\Idn; final class Utils { @@ -30,10 +31,7 @@ public static function currentTime() public static function idnUriConvert(UriInterface $uri, $options = 0) { if ($uri->getHost()) { - $idnaVariant = defined('INTL_IDNA_VARIANT_UTS46') ? INTL_IDNA_VARIANT_UTS46 : 0; - $asciiHost = $idnaVariant === 0 - ? idn_to_ascii($uri->getHost(), $options) - : idn_to_ascii($uri->getHost(), $options, $idnaVariant, $info); + $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); if ($asciiHost === false) { $errorBitSet = isset($info['errors']) ? $info['errors'] : 0; @@ -64,4 +62,31 @@ public static function idnUriConvert(UriInterface $uri, $options = 0) return $uri; } + + /** + * @param string $domain + * @param int $options + * @param array $info + * + * @return string|false + */ + private static function idnToAsci($domain, $options, &$info = []) + { + if (\preg_match('%^[ -~]+$%', $domain) === 1) { + return $domain; + } + + if (\extension_loaded('intl') && defined('INTL_IDNA_VARIANT_UTS46')) { + return \idn_to_ascii($domain, $options, INTL_IDNA_VARIANT_UTS46, $info); + } + + /* + * The Idn class is marked as @internal. Verify that class and method exists. + */ + if (method_exists(Idn::class, 'idn_to_ascii')) { + return Idn::idn_to_ascii($domain, $options, Idn::INTL_IDNA_VARIANT_UTS46, $info); + } + + throw new \RuntimeException('ext-intl or symfony/polyfill-intl-idn not loaded or too old'); + } } diff --git a/vendor/guzzlehttp/promises/CHANGELOG.md b/vendor/guzzlehttp/promises/CHANGELOG.md index 551929f6bd..2e1a2f3841 100644 --- a/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,5 +1,56 @@ # CHANGELOG +## 1.5.3 - 2023-05-21 + +### Changed + +- Removed remaining usage of deprecated functions + +## 1.5.2 - 2022-08-07 + +### Changed + +- Officially support PHP 8.2 + +## 1.5.1 - 2021-10-22 + +### Fixed + +- Revert "Call handler when waiting on fulfilled/rejected Promise" +- Fix pool memory leak when empty array of promises provided + +## 1.5.0 - 2021-10-07 + +### Changed + +- Call handler when waiting on fulfilled/rejected Promise +- Officially support PHP 8.1 + +### Fixed + +- Fix manually settle promises generated with `Utils::task` + +## 1.4.1 - 2021-02-18 + +### Fixed + +- Fixed `each_limit` skipping promises and failing + +## 1.4.0 - 2020-09-30 + +### Added + +- Support for PHP 8 +- Optional `$recursive` flag to `all` +- Replaced functions by static methods + +### Fixed + +- Fix empty `each` processing +- Fix promise handling for Iterators of non-unique keys +- Fixed `method_exists` crashes on PHP 8 +- Memory leak on exceptions + ## 1.3.1 - 2016-12-20 diff --git a/vendor/guzzlehttp/promises/LICENSE b/vendor/guzzlehttp/promises/LICENSE index 67f91a14c0..9f0f943be8 100644 --- a/vendor/guzzlehttp/promises/LICENSE +++ b/vendor/guzzlehttp/promises/LICENSE @@ -1,4 +1,9 @@ -Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com> +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com> +Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk> +Copyright (c) 2017 Tobias Schultze <webmaster@tubo-world.de> +Copyright (c) 2020 Tobias Nyholm <tobias.nyholm@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/guzzlehttp/promises/Makefile b/vendor/guzzlehttp/promises/Makefile deleted file mode 100644 index 8d5b3ef95e..0000000000 --- a/vendor/guzzlehttp/promises/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/vendor/guzzlehttp/promises/README.md b/vendor/guzzlehttp/promises/README.md index 7b607e28b1..1ea667ab9e 100644 --- a/vendor/guzzlehttp/promises/README.md +++ b/vendor/guzzlehttp/promises/README.md @@ -17,7 +17,7 @@ for a general introduction to promises. - [Implementation notes](#implementation-notes) -# Features +## Features - [Promises/A+](https://promisesaplus.com/) implementation. - Promise resolution and chaining is handled iteratively, allowing for @@ -26,18 +26,17 @@ for a general introduction to promises. - Promises can be cancelled. - Works with any object that has a `then` function. - C# style async/await coroutine promises using - `GuzzleHttp\Promise\coroutine()`. + `GuzzleHttp\Promise\Coroutine::of()`. -# Quick start +## Quick Start A *promise* represents the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. - -## Callbacks +### Callbacks Callbacks are registered with the `then` method by providing an optional `$onFulfilled` followed by an optional `$onRejected` function. @@ -60,12 +59,11 @@ $promise->then( ``` *Resolving* a promise means that you either fulfill a promise with a *value* or -reject a promise with a *reason*. Resolving a promises triggers callbacks -registered with the promises's `then` method. These callbacks are triggered +reject a promise with a *reason*. Resolving a promise triggers callbacks +registered with the promise's `then` method. These callbacks are triggered only once and in the order in which they were added. - -## Resolving a promise +### Resolving a Promise Promises are fulfilled using the `resolve($value)` method. Resolving a promise with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger @@ -88,12 +86,11 @@ $promise }); // Resolving the promise triggers the $onFulfilled callbacks and outputs -// "Hello, reader". +// "Hello, reader." $promise->resolve('reader.'); ``` - -## Promise forwarding +### Promise Forwarding Promises can be chained one after the other. Each then in the chain is a new promise. The return value of a promise is what's forwarded to the next @@ -123,7 +120,7 @@ $promise->resolve('A'); $nextPromise->resolve('B'); ``` -## Promise rejection +### Promise Rejection When a promise is rejected, the `$onRejected` callbacks are invoked with the rejection reason. @@ -140,7 +137,7 @@ $promise->reject('Error!'); // Outputs "Error!" ``` -## Rejection forwarding +### Rejection Forwarding If an exception is thrown in an `$onRejected` callback, subsequent `$onRejected` callbacks are invoked with the thrown exception as the reason. @@ -150,7 +147,7 @@ use GuzzleHttp\Promise\Promise; $promise = new Promise(); $promise->then(null, function ($reason) { - throw new \Exception($reason); + throw new Exception($reason); })->then(null, function ($reason) { assert($reason->getMessage() === 'Error!'); }); @@ -182,7 +179,6 @@ invoked using the value returned from the `$onRejected` callback. ```php use GuzzleHttp\Promise\Promise; -use GuzzleHttp\Promise\RejectedPromise; $promise = new Promise(); $promise @@ -196,7 +192,8 @@ $promise $promise->reject('Error!'); ``` -# Synchronous wait + +## Synchronous Wait You can synchronously force promises to complete using a promise's `wait` method. When creating a promise, you can provide a wait function that is used @@ -220,7 +217,7 @@ the promise is rejected with the exception and the exception is thrown. ```php $promise = new Promise(function () use (&$promise) { - throw new \Exception('foo'); + throw new Exception('foo'); }); $promise->wait(); // throws the exception. @@ -248,8 +245,7 @@ $promise->wait(); > PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' - -## Unwrapping a promise +### Unwrapping a Promise When synchronously waiting on a promise, you are joining the state of the promise into the current state of execution (i.e., return the value of the @@ -276,7 +272,7 @@ wait function will be the value delivered to promise B. **Note**: when you do not unwrap the promise, no value is returned. -# Cancellation +## Cancellation You can cancel a promise that has not yet been fulfilled using the `cancel()` method of a promise. When creating a promise you can provide an optional @@ -284,10 +280,9 @@ cancel function that when invoked cancels the action of computing a resolution of the promise. -# API +## API - -## Promise +### Promise When creating a promise object, you can provide an optional `$waitFn` and `$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is @@ -350,7 +345,7 @@ A promise has the following methods: Rejects the promise with the given `$reason`. -## FulfilledPromise +### FulfilledPromise A fulfilled promise can be created to represent a promise that has been fulfilled. @@ -367,7 +362,7 @@ $promise->then(function ($value) { ``` -## RejectedPromise +### RejectedPromise A rejected promise can be created to represent a promise that has been rejected. @@ -384,7 +379,7 @@ $promise->then(null, function ($reason) { ``` -# Promise interop +## Promise Interoperability This library works with foreign promises that have a `then` method. This means you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) @@ -397,7 +392,7 @@ $deferred = new React\Promise\Deferred(); $reactPromise = $deferred->promise(); // Create a Guzzle promise that is fulfilled with a React promise. -$guzzlePromise = new \GuzzleHttp\Promise\Promise(); +$guzzlePromise = new GuzzleHttp\Promise\Promise(); $guzzlePromise->then(function ($value) use ($reactPromise) { // Do something something with the value... // Return the React promise @@ -410,7 +405,7 @@ a foreign promise. You will need to wrap a third-party promise with a Guzzle promise in order to utilize wait and cancel functions with foreign promises. -## Event Loop Integration +### Event Loop Integration In order to keep the stack size constant, Guzzle promises are resolved asynchronously using a task queue. When waiting on promises synchronously, the @@ -424,7 +419,7 @@ instance. ```php // Get the global task queue -$queue = \GuzzleHttp\Promise\queue(); +$queue = GuzzleHttp\Promise\Utils::queue(); $queue->run(); ``` @@ -438,10 +433,9 @@ $loop->addPeriodicTimer(0, [$queue, 'run']); *TODO*: Perhaps adding a `futureTick()` on each tick would be faster? -# Implementation notes - +## Implementation Notes -## Promise resolution and chaining is handled iteratively +### Promise Resolution and Chaining is Handled Iteratively By shuffling pending handlers from one owner to another, promises are resolved iteratively, allowing for "infinite" then chaining. @@ -477,8 +471,7 @@ all of its pending handlers to the new promise. When the new promise is eventually resolved, all of the pending handlers are delivered the forwarded value. - -## A promise is the deferred. +### A Promise is the Deferred Some promise libraries implement promises using a deferred object to represent a computation and a promise object to represent the delivery of the result of @@ -502,3 +495,52 @@ $promise->then(function ($value) { echo $value; }); $promise->resolve('foo'); // prints "foo" ``` + + +## Upgrading from Function API + +A static API was first introduced in 1.4.0, in order to mitigate problems with +functions conflicting between global and local copies of the package. The +function API will be removed in 2.0.0. A migration table has been provided here +for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `queue` | `Utils::queue` | +| `task` | `Utils::task` | +| `promise_for` | `Create::promiseFor` | +| `rejection_for` | `Create::rejectionFor` | +| `exception_for` | `Create::exceptionFor` | +| `iter_for` | `Create::iterFor` | +| `inspect` | `Utils::inspect` | +| `inspect_all` | `Utils::inspectAll` | +| `unwrap` | `Utils::unwrap` | +| `all` | `Utils::all` | +| `some` | `Utils::some` | +| `any` | `Utils::any` | +| `settle` | `Utils::settle` | +| `each` | `Each::of` | +| `each_limit` | `Each::ofLimit` | +| `each_limit_all` | `Each::ofLimitAll` | +| `!is_fulfilled` | `Is::pending` | +| `is_fulfilled` | `Is::fulfilled` | +| `is_rejected` | `Is::rejected` | +| `is_settled` | `Is::settled` | +| `coroutine` | `Coroutine::of` | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json index ec41a61e6e..966e3e3a8b 100644 --- a/vendor/guzzlehttp/promises/composer.json +++ b/vendor/guzzlehttp/promises/composer.json @@ -4,17 +4,32 @@ "keywords": ["promise"], "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" } ], "require": { - "php": ">=5.5.0" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "autoload": { "psr-4": { @@ -22,13 +37,17 @@ }, "files": ["src/functions_include.php"] }, + "autoload-dev": { + "psr-4": { + "GuzzleHttp\\Promise\\Tests\\": "tests/" + } + }, "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text" + "test": "vendor/bin/simple-phpunit", + "test-ci": "vendor/bin/simple-phpunit --coverage-text" }, - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } + "config": { + "preferred-install": "dist", + "sort-packages": true } } diff --git a/vendor/guzzlehttp/promises/src/AggregateException.php b/vendor/guzzlehttp/promises/src/AggregateException.php index 6a5690c376..d2b5712b92 100644 --- a/vendor/guzzlehttp/promises/src/AggregateException.php +++ b/vendor/guzzlehttp/promises/src/AggregateException.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** diff --git a/vendor/guzzlehttp/promises/src/CancellationException.php b/vendor/guzzlehttp/promises/src/CancellationException.php index cb360b8056..56a1ed65bc 100644 --- a/vendor/guzzlehttp/promises/src/CancellationException.php +++ b/vendor/guzzlehttp/promises/src/CancellationException.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** diff --git a/vendor/guzzlehttp/promises/src/Coroutine.php b/vendor/guzzlehttp/promises/src/Coroutine.php index 6aa0958702..670da47739 100644 --- a/vendor/guzzlehttp/promises/src/Coroutine.php +++ b/vendor/guzzlehttp/promises/src/Coroutine.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; use Exception; @@ -9,7 +10,7 @@ * Creates a promise that is resolved using a generator that yields values or * promises (somewhat similar to C#'s async keyword). * - * When called, the coroutine function will start an instance of the generator + * When called, the Coroutine::of method will start an instance of the generator * and returns a promise that is fulfilled with its final yielded value. * * Control is returned back to the generator when the yielded promise settles. @@ -22,7 +23,7 @@ * return new Promise\FulfilledPromise($value); * } * - * $promise = Promise\coroutine(function () { + * $promise = Promise\Coroutine::of(function () { * $value = (yield createPromise('a')); * try { * $value = (yield createPromise($value . 'b')); @@ -38,6 +39,7 @@ * @param callable $generatorFn Generator function to wrap into a promise. * * @return Promise + * * @link https://github.com/petkaantonov/bluebird/blob/master/API.md#generators inspiration */ final class Coroutine implements PromiseInterface @@ -65,7 +67,23 @@ public function __construct(callable $generatorFn) $this->currentPromise->wait(); } }); - $this->nextCoroutine($this->generator->current()); + try { + $this->nextCoroutine($this->generator->current()); + } catch (\Exception $exception) { + $this->result->reject($exception); + } catch (Throwable $throwable) { + $this->result->reject($throwable); + } + } + + /** + * Create a new coroutine. + * + * @return self + */ + public static function of(callable $generatorFn) + { + return new self($generatorFn); } public function then( @@ -108,7 +126,7 @@ public function cancel() private function nextCoroutine($yielded) { - $this->currentPromise = promise_for($yielded) + $this->currentPromise = Create::promiseFor($yielded) ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); } @@ -139,7 +157,7 @@ public function _handleFailure($reason) { unset($this->currentPromise); try { - $nextYield = $this->generator->throw(exception_for($reason)); + $nextYield = $this->generator->throw(Create::exceptionFor($reason)); // The throw was caught, so keep iterating on the coroutine $this->nextCoroutine($nextYield); } catch (Exception $exception) { diff --git a/vendor/guzzlehttp/promises/src/Create.php b/vendor/guzzlehttp/promises/src/Create.php new file mode 100644 index 0000000000..8d038e9c1c --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Create.php @@ -0,0 +1,84 @@ +<?php + +namespace GuzzleHttp\Promise; + +final class Create +{ + /** + * Creates a promise for a value if the value is not a promise. + * + * @param mixed $value Promise or value. + * + * @return PromiseInterface + */ + public static function promiseFor($value) + { + if ($value instanceof PromiseInterface) { + return $value; + } + + // Return a Guzzle promise that shadows the given promise. + if (is_object($value) && method_exists($value, 'then')) { + $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null; + $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; + $promise = new Promise($wfn, $cfn); + $value->then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; + } + + return new FulfilledPromise($value); + } + + /** + * Creates a rejected promise for a reason if the reason is not a promise. + * If the provided reason is a promise, then it is returned as-is. + * + * @param mixed $reason Promise or reason. + * + * @return PromiseInterface + */ + public static function rejectionFor($reason) + { + if ($reason instanceof PromiseInterface) { + return $reason; + } + + return new RejectedPromise($reason); + } + + /** + * Create an exception for a rejected promise value. + * + * @param mixed $reason + * + * @return \Exception|\Throwable + */ + public static function exceptionFor($reason) + { + if ($reason instanceof \Exception || $reason instanceof \Throwable) { + return $reason; + } + + return new RejectionException($reason); + } + + /** + * Returns an iterator for the given value. + * + * @param mixed $value + * + * @return \Iterator + */ + public static function iterFor($value) + { + if ($value instanceof \Iterator) { + return $value; + } + + if (is_array($value)) { + return new \ArrayIterator($value); + } + + return new \ArrayIterator([$value]); + } +} diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php new file mode 100644 index 0000000000..ff8efd734b --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -0,0 +1,90 @@ +<?php + +namespace GuzzleHttp\Promise; + +final class Each +{ + /** + * Given an iterator that yields promises or values, returns a promise that + * is fulfilled with a null value when the iterator has been consumed or + * the aggregate promise has been fulfilled or rejected. + * + * $onFulfilled is a function that accepts the fulfilled value, iterator + * index, and the aggregate promise. The callback can invoke any necessary + * side effects and choose to resolve or reject the aggregate if needed. + * + * $onRejected is a function that accepts the rejection reason, iterator + * index, and the aggregate promise. The callback can invoke any necessary + * side effects and choose to resolve or reject the aggregate if needed. + * + * @param mixed $iterable Iterator or array to iterate over. + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ + public static function of( + $iterable, + callable $onFulfilled = null, + callable $onRejected = null + ) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected + ]))->promise(); + } + + /** + * Like of, but only allows a certain number of outstanding promises at any + * given time. + * + * $concurrency may be an integer or a function that accepts the number of + * pending promises and returns a numeric concurrency limit value to allow + * for dynamic a concurrency size. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * @param callable $onRejected + * + * @return PromiseInterface + */ + public static function ofLimit( + $iterable, + $concurrency, + callable $onFulfilled = null, + callable $onRejected = null + ) { + return (new EachPromise($iterable, [ + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency + ]))->promise(); + } + + /** + * Like limit, but ensures that no promise in the given $iterable argument + * is rejected. If any promise is rejected, then the aggregate promise is + * rejected with the encountered rejection. + * + * @param mixed $iterable + * @param int|callable $concurrency + * @param callable $onFulfilled + * + * @return PromiseInterface + */ + public static function ofLimitAll( + $iterable, + $concurrency, + callable $onFulfilled = null + ) { + return self::ofLimit( + $iterable, + $concurrency, + $onFulfilled, + function ($reason, $idx, PromiseInterface $aggregate) { + $aggregate->reject($reason); + } + ); + } +} diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php index d0ddf603fb..280d79950d 100644 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -9,22 +10,24 @@ class EachPromise implements PromisorInterface { private $pending = []; - /** @var \Iterator */ + private $nextPendingIndex = 0; + + /** @var \Iterator|null */ private $iterable; - /** @var callable|int */ + /** @var callable|int|null */ private $concurrency; - /** @var callable */ + /** @var callable|null */ private $onFulfilled; - /** @var callable */ + /** @var callable|null */ private $onRejected; - /** @var Promise */ + /** @var Promise|null */ private $aggregate; - /** @var bool */ + /** @var bool|null */ private $mutex; /** @@ -45,12 +48,12 @@ class EachPromise implements PromisorInterface * allowed number of outstanding concurrently executing promises, * creating a capped pool of promises. There is no limit by default. * - * @param mixed $iterable Promises or values to iterate. - * @param array $config Configuration options + * @param mixed $iterable Promises or values to iterate. + * @param array $config Configuration options */ public function __construct($iterable, array $config = []) { - $this->iterable = iter_for($iterable); + $this->iterable = Create::iterFor($iterable); if (isset($config['concurrency'])) { $this->concurrency = $config['concurrency']; @@ -65,6 +68,7 @@ public function __construct($iterable, array $config = []) } } + /** @psalm-suppress InvalidNullableReturnType */ public function promise() { if ($this->aggregate) { @@ -73,6 +77,7 @@ public function promise() try { $this->createPromise(); + /** @psalm-assert Promise $this->aggregate */ $this->iterable->rewind(); $this->refillPending(); } catch (\Throwable $e) { @@ -81,6 +86,10 @@ public function promise() $this->aggregate->reject($e); } + /** + * @psalm-suppress NullableReturnStatement + * @phpstan-ignore-next-line + */ return $this->aggregate; } @@ -88,18 +97,16 @@ private function createPromise() { $this->mutex = false; $this->aggregate = new Promise(function () { - reset($this->pending); - if (empty($this->pending) && !$this->iterable->valid()) { - $this->aggregate->resolve(null); + if ($this->checkIfFinished()) { return; } - + reset($this->pending); // Consume a potentially fluctuating list of promises while // ensuring that indexes are maintained (precluding array_shift). while ($promise = current($this->pending)) { next($this->pending); $promise->wait(); - if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + if (Is::settled($this->aggregate)) { return; } } @@ -109,6 +116,7 @@ private function createPromise() $clearFn = function () { $this->iterable = $this->concurrency = $this->pending = null; $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; }; $this->aggregate->then($clearFn, $clearFn); @@ -148,22 +156,32 @@ private function addPending() return false; } - $promise = promise_for($this->iterable->current()); - $idx = $this->iterable->key(); + $promise = Create::promiseFor($this->iterable->current()); + $key = $this->iterable->key(); + + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; $this->pending[$idx] = $promise->then( - function ($value) use ($idx) { + function ($value) use ($idx, $key) { if ($this->onFulfilled) { call_user_func( - $this->onFulfilled, $value, $idx, $this->aggregate + $this->onFulfilled, + $value, + $key, + $this->aggregate ); } $this->step($idx); }, - function ($reason) use ($idx) { + function ($reason) use ($idx, $key) { if ($this->onRejected) { call_user_func( - $this->onRejected, $reason, $idx, $this->aggregate + $this->onRejected, + $reason, + $key, + $this->aggregate ); } $this->step($idx); @@ -201,7 +219,7 @@ private function advanceIterator() private function step($idx) { // If the promise was already resolved, then ignore this step. - if ($this->aggregate->getState() !== PromiseInterface::PENDING) { + if (Is::settled($this->aggregate)) { return; } diff --git a/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/vendor/guzzlehttp/promises/src/FulfilledPromise.php index dbbeeb9f71..98f72a62a6 100644 --- a/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ b/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -13,9 +14,10 @@ class FulfilledPromise implements PromiseInterface public function __construct($value) { - if (method_exists($value, 'then')) { + if (is_object($value) && method_exists($value, 'then')) { throw new \InvalidArgumentException( - 'You cannot create a FulfilledPromise with a promise.'); + 'You cannot create a FulfilledPromise with a promise.' + ); } $this->value = $value; @@ -30,11 +32,11 @@ public function then( return $this; } - $queue = queue(); + $queue = Utils::queue(); $p = new Promise([$queue, 'run']); $value = $this->value; $queue->add(static function () use ($p, $value, $onFulfilled) { - if ($p->getState() === self::PENDING) { + if (Is::pending($p)) { try { $p->resolve($onFulfilled($value)); } catch (\Throwable $e) { diff --git a/vendor/guzzlehttp/promises/src/Is.php b/vendor/guzzlehttp/promises/src/Is.php new file mode 100644 index 0000000000..c3ed8d0143 --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Is.php @@ -0,0 +1,46 @@ +<?php + +namespace GuzzleHttp\Promise; + +final class Is +{ + /** + * Returns true if a promise is pending. + * + * @return bool + */ + public static function pending(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled or rejected. + * + * @return bool + */ + public static function settled(PromiseInterface $promise) + { + return $promise->getState() !== PromiseInterface::PENDING; + } + + /** + * Returns true if a promise is fulfilled. + * + * @return bool + */ + public static function fulfilled(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::FULFILLED; + } + + /** + * Returns true if a promise is rejected. + * + * @return bool + */ + public static function rejected(PromiseInterface $promise) + { + return $promise->getState() === PromiseInterface::REJECTED; + } +} diff --git a/vendor/guzzlehttp/promises/src/Promise.php b/vendor/guzzlehttp/promises/src/Promise.php index 844ada073c..75939057b6 100644 --- a/vendor/guzzlehttp/promises/src/Promise.php +++ b/vendor/guzzlehttp/promises/src/Promise.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -41,14 +42,13 @@ public function then( // Return a fulfilled promise and immediately invoke any callbacks. if ($this->state === self::FULFILLED) { - return $onFulfilled - ? promise_for($this->result)->then($onFulfilled) - : promise_for($this->result); + $promise = Create::promiseFor($this->result); + return $onFulfilled ? $promise->then($onFulfilled) : $promise; } // It's either cancelled or rejected, so return a rejected promise // and immediately invoke any callbacks. - $rejection = rejection_for($this->result); + $rejection = Create::rejectionFor($this->result); return $onRejected ? $rejection->then(null, $onRejected) : $rejection; } @@ -61,19 +61,15 @@ public function wait($unwrap = true) { $this->waitIfPending(); - $inner = $this->result instanceof PromiseInterface - ? $this->result->wait($unwrap) - : $this->result; - + if ($this->result instanceof PromiseInterface) { + return $this->result->wait($unwrap); + } if ($unwrap) { - if ($this->result instanceof PromiseInterface - || $this->state === self::FULFILLED - ) { - return $inner; - } else { - // It's rejected so "unwrap" and throw an exception. - throw exception_for($inner); + if ($this->state === self::FULFILLED) { + return $this->result; } + // It's rejected so "unwrap" and throw an exception. + throw Create::exceptionFor($this->result); } } @@ -103,6 +99,7 @@ public function cancel() } // Reject the promise only if it wasn't rejected in a then callback. + /** @psalm-suppress RedundantCondition */ if ($this->state === self::PENDING) { $this->reject(new CancellationException('Promise has been cancelled')); } @@ -148,17 +145,15 @@ private function settle($state, $value) // If the value was not a settled promise or a thenable, then resolve // it in the task queue using the correct ID. - if (!method_exists($value, 'then')) { + if (!is_object($value) || !method_exists($value, 'then')) { $id = $state === self::FULFILLED ? 1 : 2; // It's a success, so resolve the handlers in the queue. - queue()->add(static function () use ($id, $value, $handlers) { + Utils::queue()->add(static function () use ($id, $value, $handlers) { foreach ($handlers as $handler) { self::callHandler($id, $value, $handler); } }); - } elseif ($value instanceof Promise - && $value->getState() === self::PENDING - ) { + } elseif ($value instanceof Promise && Is::pending($value)) { // We can just merge our handlers onto the next promise. $value->handlers = array_merge($value->handlers, $handlers); } else { @@ -184,8 +179,6 @@ static function ($reason) use ($handlers) { * @param int $index 1 (resolve) or 2 (reject). * @param mixed $value Value to pass to the callback. * @param array $handler Array of handler data (promise and callbacks). - * - * @return array Returns the next group to resolve. */ private static function callHandler($index, $value, array $handler) { @@ -194,13 +187,21 @@ private static function callHandler($index, $value, array $handler) // The promise may have been cancelled or resolved before placing // this thunk in the queue. - if ($promise->getState() !== self::PENDING) { + if (Is::settled($promise)) { return; } try { if (isset($handler[$index])) { - $promise->resolve($handler[$index]($value)); + /* + * If $f throws an exception, then $handler will be in the exception + * stack trace. Since $handler contains a reference to the callable + * itself we get a circular reference. We clear the $handler + * here to avoid that memory leak. + */ + $f = $handler[$index]; + unset($handler); + $promise->resolve($f($value)); } elseif ($index === 1) { // Forward resolution values as-is. $promise->resolve($value); @@ -224,15 +225,16 @@ private function waitIfPending() } elseif ($this->waitList) { $this->invokeWaitList(); } else { - // If there's not wait function, then reject the promise. + // If there's no wait function, then reject the promise. $this->reject('Cannot wait on a promise that has ' . 'no internal wait function. You must provide a wait ' . 'function when constructing the promise to be able to ' . 'wait on a promise.'); } - queue()->run(); + Utils::queue()->run(); + /** @psalm-suppress RedundantCondition */ if ($this->state === self::PENDING) { $this->reject('Invoking the wait callback did not resolve the promise'); } @@ -263,17 +265,13 @@ private function invokeWaitList() $this->waitList = null; foreach ($waitList as $result) { - while (true) { + do { $result->waitIfPending(); + $result = $result->result; + } while ($result instanceof Promise); - if ($result->result instanceof Promise) { - $result = $result->result; - } else { - if ($result->result instanceof PromiseInterface) { - $result->result->wait(false); - } - break; - } + if ($result instanceof PromiseInterface) { + $result->wait(false); } } } diff --git a/vendor/guzzlehttp/promises/src/PromiseInterface.php b/vendor/guzzlehttp/promises/src/PromiseInterface.php index 8f5f4b99b2..e598331435 100644 --- a/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ b/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -56,6 +57,7 @@ public function getState(); * Resolve the promise with the given value. * * @param mixed $value + * * @throws \RuntimeException if the promise is already resolved. */ public function resolve($value); @@ -64,6 +66,7 @@ public function resolve($value); * Reject the promise with the given reason. * * @param mixed $reason + * * @throws \RuntimeException if the promise is already resolved. */ public function reject($reason); @@ -86,6 +89,7 @@ public function cancel(); * @param bool $unwrap * * @return mixed + * * @throws \LogicException if the promise has no wait function or if the * promise does not settle after waiting. */ diff --git a/vendor/guzzlehttp/promises/src/PromisorInterface.php b/vendor/guzzlehttp/promises/src/PromisorInterface.php index b07fe32bc1..2d2e3422ba 100644 --- a/vendor/guzzlehttp/promises/src/PromisorInterface.php +++ b/vendor/guzzlehttp/promises/src/PromisorInterface.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** diff --git a/vendor/guzzlehttp/promises/src/RejectedPromise.php b/vendor/guzzlehttp/promises/src/RejectedPromise.php index 2bc6508e7b..d2918468cf 100644 --- a/vendor/guzzlehttp/promises/src/RejectedPromise.php +++ b/vendor/guzzlehttp/promises/src/RejectedPromise.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -13,9 +14,10 @@ class RejectedPromise implements PromiseInterface public function __construct($reason) { - if (method_exists($reason, 'then')) { + if (is_object($reason) && method_exists($reason, 'then')) { throw new \InvalidArgumentException( - 'You cannot create a RejectedPromise with a promise.'); + 'You cannot create a RejectedPromise with a promise.' + ); } $this->reason = $reason; @@ -30,11 +32,11 @@ public function then( return $this; } - $queue = queue(); + $queue = Utils::queue(); $reason = $this->reason; $p = new Promise([$queue, 'run']); $queue->add(static function () use ($p, $reason, $onRejected) { - if ($p->getState() === self::PENDING) { + if (Is::pending($p)) { try { // Return a resolved promise if onRejected does not throw. $p->resolve($onRejected($reason)); @@ -59,8 +61,10 @@ public function otherwise(callable $onRejected) public function wait($unwrap = true, $defaultDelivery = null) { if ($unwrap) { - throw exception_for($this->reason); + throw Create::exceptionFor($this->reason); } + + return null; } public function getState() diff --git a/vendor/guzzlehttp/promises/src/RejectionException.php b/vendor/guzzlehttp/promises/src/RejectionException.php index 07c1136da1..e2f137707d 100644 --- a/vendor/guzzlehttp/promises/src/RejectionException.php +++ b/vendor/guzzlehttp/promises/src/RejectionException.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -12,7 +13,7 @@ class RejectionException extends \RuntimeException private $reason; /** - * @param mixed $reason Rejection reason. + * @param mixed $reason Rejection reason. * @param string $description Optional description */ public function __construct($reason, $description = null) diff --git a/vendor/guzzlehttp/promises/src/TaskQueue.php b/vendor/guzzlehttp/promises/src/TaskQueue.php index 6e8a2a083c..f0fba2c594 100644 --- a/vendor/guzzlehttp/promises/src/TaskQueue.php +++ b/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -8,7 +9,7 @@ * maintains a constant stack size. You can use the task queue asynchronously * by calling the `run()` function of the global task queue in an event loop. * - * GuzzleHttp\Promise\queue()->run(); + * GuzzleHttp\Promise\Utils::queue()->run(); */ class TaskQueue implements TaskQueueInterface { @@ -42,8 +43,8 @@ public function add(callable $task) public function run() { - /** @var callable $task */ while ($task = array_shift($this->queue)) { + /** @var callable $task */ $task(); } } diff --git a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php index ac8306e197..723d4d54eb 100644 --- a/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ b/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; interface TaskQueueInterface @@ -13,8 +14,6 @@ public function isEmpty(); /** * Adds a task to the queue that will be executed the next time run is * called. - * - * @param callable $task */ public function add(callable $task); diff --git a/vendor/guzzlehttp/promises/src/Utils.php b/vendor/guzzlehttp/promises/src/Utils.php new file mode 100644 index 0000000000..e37618833a --- /dev/null +++ b/vendor/guzzlehttp/promises/src/Utils.php @@ -0,0 +1,276 @@ +<?php + +namespace GuzzleHttp\Promise; + +final class Utils +{ + /** + * Get the global task queue used for promise resolution. + * + * This task queue MUST be run in an event loop in order for promises to be + * settled asynchronously. It will be automatically run when synchronously + * waiting on a promise. + * + * <code> + * while ($eventLoop->isRunning()) { + * GuzzleHttp\Promise\Utils::queue()->run(); + * } + * </code> + * + * @param TaskQueueInterface $assign Optionally specify a new queue instance. + * + * @return TaskQueueInterface + */ + public static function queue(TaskQueueInterface $assign = null) + { + static $queue; + + if ($assign) { + $queue = $assign; + } elseif (!$queue) { + $queue = new TaskQueue(); + } + + return $queue; + } + + /** + * Adds a function to run in the task queue when it is next `run()` and + * returns a promise that is fulfilled or rejected with the result. + * + * @param callable $task Task function to run. + * + * @return PromiseInterface + */ + public static function task(callable $task) + { + $queue = self::queue(); + $promise = new Promise([$queue, 'run']); + $queue->add(function () use ($task, $promise) { + try { + if (Is::pending($promise)) { + $promise->resolve($task()); + } + } catch (\Throwable $e) { + $promise->reject($e); + } catch (\Exception $e) { + $promise->reject($e); + } + }); + + return $promise; + } + + /** + * Synchronously waits on a promise to resolve and returns an inspection + * state array. + * + * Returns a state associative array containing a "state" key mapping to a + * valid promise state. If the state of the promise is "fulfilled", the + * array will contain a "value" key mapping to the fulfilled value of the + * promise. If the promise is rejected, the array will contain a "reason" + * key mapping to the rejection reason of the promise. + * + * @param PromiseInterface $promise Promise or value. + * + * @return array + */ + public static function inspect(PromiseInterface $promise) + { + try { + return [ + 'state' => PromiseInterface::FULFILLED, + 'value' => $promise->wait() + ]; + } catch (RejectionException $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; + } catch (\Throwable $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } catch (\Exception $e) { + return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; + } + } + + /** + * Waits on all of the provided promises, but does not unwrap rejected + * promises as thrown exception. + * + * Returns an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param PromiseInterface[] $promises Traversable of promises to wait upon. + * + * @return array + */ + public static function inspectAll($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = self::inspect($promise); + } + + return $results; + } + + /** + * Waits on all of the provided promises and returns the fulfilled values. + * + * Returns an array that contains the value of each promise (in the same + * order the promises were provided). An exception is thrown if any of the + * promises are rejected. + * + * @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on. + * + * @return array + * + * @throws \Exception on error + * @throws \Throwable on error in PHP >=7 + */ + public static function unwrap($promises) + { + $results = []; + foreach ($promises as $key => $promise) { + $results[$key] = $promise->wait(); + } + + return $results; + } + + /** + * Given an array of promises, return a promise that is fulfilled when all + * the items in the array are fulfilled. + * + * The promise's fulfillment value is an array with fulfillment values at + * respective positions to the original array. If any promise in the array + * rejects, the returned promise is rejected with the rejection reason. + * + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. + * + * @return PromiseInterface + */ + public static function all($promises, $recursive = false) + { + $results = []; + $promise = Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = $value; + }, + function ($reason, $idx, Promise $aggregate) { + $aggregate->reject($reason); + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + + if (true === $recursive) { + $promise = $promise->then(function ($results) use ($recursive, &$promises) { + foreach ($promises as $promise) { + if (Is::pending($promise)) { + return self::all($promises, $recursive); + } + } + return $results; + }); + } + + return $promise; + } + + /** + * Initiate a competitive race between multiple promises or values (values + * will become immediately fulfilled promises). + * + * When count amount of promises have been fulfilled, the returned promise + * is fulfilled with an array that contains the fulfillment values of the + * winners in order of resolution. + * + * This promise is rejected with a {@see AggregateException} if the number + * of fulfilled promises is less than the desired $count. + * + * @param int $count Total number of promises. + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function some($count, $promises) + { + $results = []; + $rejections = []; + + return Each::of( + $promises, + function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + if (Is::settled($p)) { + return; + } + $results[$idx] = $value; + if (count($results) >= $count) { + $p->resolve(null); + } + }, + function ($reason) use (&$rejections) { + $rejections[] = $reason; + } + )->then( + function () use (&$results, &$rejections, $count) { + if (count($results) !== $count) { + throw new AggregateException( + 'Not enough promises to fulfill count', + $rejections + ); + } + ksort($results); + return array_values($results); + } + ); + } + + /** + * Like some(), with 1 as count. However, if the promise fulfills, the + * fulfillment value is not an array of 1 but the value directly. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function any($promises) + { + return self::some(1, $promises)->then(function ($values) { + return $values[0]; + }); + } + + /** + * Returns a promise that is fulfilled when all of the provided promises have + * been fulfilled or rejected. + * + * The returned promise is fulfilled with an array of inspection state arrays. + * + * @see inspect for the inspection state array format. + * + * @param mixed $promises Promises or values. + * + * @return PromiseInterface + */ + public static function settle($promises) + { + $results = []; + + return Each::of( + $promises, + function ($value, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; + }, + function ($reason, $idx) use (&$results) { + $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; + } + )->then(function () use (&$results) { + ksort($results); + return $results; + }); + } +} diff --git a/vendor/guzzlehttp/promises/src/functions.php b/vendor/guzzlehttp/promises/src/functions.php index 4e27709af3..c03d39d021 100644 --- a/vendor/guzzlehttp/promises/src/functions.php +++ b/vendor/guzzlehttp/promises/src/functions.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Promise; /** @@ -17,18 +18,12 @@ * @param TaskQueueInterface $assign Optionally specify a new queue instance. * * @return TaskQueueInterface + * + * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. */ function queue(TaskQueueInterface $assign = null) { - static $queue; - - if ($assign) { - $queue = $assign; - } elseif (!$queue) { - $queue = new TaskQueue(); - } - - return $queue; + return Utils::queue($assign); } /** @@ -38,22 +33,12 @@ function queue(TaskQueueInterface $assign = null) * @param callable $task Task function to run. * * @return PromiseInterface + * + * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. */ function task(callable $task) { - $queue = queue(); - $promise = new Promise([$queue, 'run']); - $queue->add(function () use ($task, $promise) { - try { - $promise->resolve($task()); - } catch (\Throwable $e) { - $promise->reject($e); - } catch (\Exception $e) { - $promise->reject($e); - } - }); - - return $promise; + return Utils::task($task); } /** @@ -62,23 +47,12 @@ function task(callable $task) * @param mixed $value Promise or value. * * @return PromiseInterface + * + * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. */ function promise_for($value) { - if ($value instanceof PromiseInterface) { - return $value; - } - - // Return a Guzzle promise that shadows the given promise. - if (method_exists($value, 'then')) { - $wfn = method_exists($value, 'wait') ? [$value, 'wait'] : null; - $cfn = method_exists($value, 'cancel') ? [$value, 'cancel'] : null; - $promise = new Promise($wfn, $cfn); - $value->then([$promise, 'resolve'], [$promise, 'reject']); - return $promise; - } - - return new FulfilledPromise($value); + return Create::promiseFor($value); } /** @@ -88,14 +62,12 @@ function promise_for($value) * @param mixed $reason Promise or reason. * * @return PromiseInterface + * + * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. */ function rejection_for($reason) { - if ($reason instanceof PromiseInterface) { - return $reason; - } - - return new RejectedPromise($reason); + return Create::rejectionFor($reason); } /** @@ -104,12 +76,12 @@ function rejection_for($reason) * @param mixed $reason * * @return \Exception|\Throwable + * + * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. */ function exception_for($reason) { - return $reason instanceof \Exception || $reason instanceof \Throwable - ? $reason - : new RejectionException($reason); + return Create::exceptionFor($reason); } /** @@ -118,16 +90,12 @@ function exception_for($reason) * @param mixed $value * * @return \Iterator + * + * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. */ function iter_for($value) { - if ($value instanceof \Iterator) { - return $value; - } elseif (is_array($value)) { - return new \ArrayIterator($value); - } else { - return new \ArrayIterator([$value]); - } + return Create::iterFor($value); } /** @@ -143,21 +111,12 @@ function iter_for($value) * @param PromiseInterface $promise Promise or value. * * @return array + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. */ function inspect(PromiseInterface $promise) { - try { - return [ - 'state' => PromiseInterface::FULFILLED, - 'value' => $promise->wait() - ]; - } catch (RejectionException $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; - } catch (\Throwable $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } catch (\Exception $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } + return Utils::inspect($promise); } /** @@ -166,19 +125,17 @@ function inspect(PromiseInterface $promise) * * Returns an array of inspection state arrays. * + * @see inspect for the inspection state array format. + * * @param PromiseInterface[] $promises Traversable of promises to wait upon. * * @return array - * @see GuzzleHttp\Promise\inspect for the inspection state array format. + * + * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. */ function inspect_all($promises) { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = inspect($promise); - } - - return $results; + return Utils::inspectAll($promises); } /** @@ -188,20 +145,18 @@ function inspect_all($promises) * the promises were provided). An exception is thrown if any of the promises * are rejected. * - * @param mixed $promises Iterable of PromiseInterface objects to wait on. + * @param iterable<PromiseInterface> $promises Iterable of PromiseInterface objects to wait on. * * @return array + * * @throws \Exception on error * @throws \Throwable on error in PHP >=7 + * + * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. */ function unwrap($promises) { - $results = []; - foreach ($promises as $key => $promise) { - $results[$key] = $promise->wait(); - } - - return $results; + return Utils::unwrap($promises); } /** @@ -212,25 +167,16 @@ function unwrap($promises) * respective positions to the original array. If any promise in the array * rejects, the returned promise is rejected with the rejection reason. * - * @param mixed $promises Promises or values. + * @param mixed $promises Promises or values. + * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. * * @return PromiseInterface + * + * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. */ -function all($promises) +function all($promises, $recursive = false) { - $results = []; - return each( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = $value; - }, - function ($reason, $idx, Promise $aggregate) { - $aggregate->reject($reason); - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); + return Utils::all($promises, $recursive); } /** @@ -241,45 +187,19 @@ function ($reason, $idx, Promise $aggregate) { * fulfilled with an array that contains the fulfillment values of the winners * in order of resolution. * - * This prommise is rejected with a {@see GuzzleHttp\Promise\AggregateException} - * if the number of fulfilled promises is less than the desired $count. + * This promise is rejected with a {@see AggregateException} if the number of + * fulfilled promises is less than the desired $count. * * @param int $count Total number of promises. * @param mixed $promises Promises or values. * * @return PromiseInterface + * + * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. */ function some($count, $promises) { - $results = []; - $rejections = []; - - return each( - $promises, - function ($value, $idx, PromiseInterface $p) use (&$results, $count) { - if ($p->getState() !== PromiseInterface::PENDING) { - return; - } - $results[$idx] = $value; - if (count($results) >= $count) { - $p->resolve(null); - } - }, - function ($reason) use (&$rejections) { - $rejections[] = $reason; - } - )->then( - function () use (&$results, &$rejections, $count) { - if (count($results) !== $count) { - throw new AggregateException( - 'Not enough promises to fulfill count', - $rejections - ); - } - ksort($results); - return array_values($results); - } - ); + return Utils::some($count, $promises); } /** @@ -289,10 +209,12 @@ function () use (&$results, &$rejections, $count) { * @param mixed $promises Promises or values. * * @return PromiseInterface + * + * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. */ function any($promises) { - return some(1, $promises)->then(function ($values) { return $values[0]; }); + return Utils::any($promises); } /** @@ -301,27 +223,17 @@ function any($promises) * * The returned promise is fulfilled with an array of inspection state arrays. * + * @see inspect for the inspection state array format. + * * @param mixed $promises Promises or values. * * @return PromiseInterface - * @see GuzzleHttp\Promise\inspect for the inspection state array format. + * + * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. */ function settle($promises) { - $results = []; - - return each( - $promises, - function ($value, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; - }, - function ($reason, $idx) use (&$results) { - $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; - } - )->then(function () use (&$results) { - ksort($results); - return $results; - }); + return Utils::settle($promises); } /** @@ -329,29 +241,28 @@ function ($reason, $idx) use (&$results) { * fulfilled with a null value when the iterator has been consumed or the * aggregate promise has been fulfilled or rejected. * - * $onFulfilled is a function that accepts the fulfilled value, iterator - * index, and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate promise if needed. + * $onFulfilled is a function that accepts the fulfilled value, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. * - * $onRejected is a function that accepts the rejection reason, iterator - * index, and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate promise if needed. + * $onRejected is a function that accepts the rejection reason, iterator index, + * and the aggregate promise. The callback can invoke any necessary side + * effects and choose to resolve or reject the aggregate if needed. * * @param mixed $iterable Iterator or array to iterate over. * @param callable $onFulfilled * @param callable $onRejected * * @return PromiseInterface + * + * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. */ function each( $iterable, callable $onFulfilled = null, callable $onRejected = null ) { - return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected - ]))->promise(); + return Each::of($iterable, $onFulfilled, $onRejected); } /** @@ -368,6 +279,8 @@ function each( * @param callable $onRejected * * @return PromiseInterface + * + * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. */ function each_limit( $iterable, @@ -375,11 +288,7 @@ function each_limit( callable $onFulfilled = null, callable $onRejected = null ) { - return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected, - 'concurrency' => $concurrency - ]))->promise(); + return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); } /** @@ -392,66 +301,63 @@ function each_limit( * @param callable $onFulfilled * * @return PromiseInterface + * + * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. */ function each_limit_all( $iterable, $concurrency, callable $onFulfilled = null ) { - return each_limit( - $iterable, - $concurrency, - $onFulfilled, - function ($reason, $idx, PromiseInterface $aggregate) { - $aggregate->reject($reason); - } - ); + return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); } /** * Returns true if a promise is fulfilled. * - * @param PromiseInterface $promise - * * @return bool + * + * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. */ function is_fulfilled(PromiseInterface $promise) { - return $promise->getState() === PromiseInterface::FULFILLED; + return Is::fulfilled($promise); } /** * Returns true if a promise is rejected. * - * @param PromiseInterface $promise - * * @return bool + * + * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. */ function is_rejected(PromiseInterface $promise) { - return $promise->getState() === PromiseInterface::REJECTED; + return Is::rejected($promise); } /** * Returns true if a promise is fulfilled or rejected. * - * @param PromiseInterface $promise - * * @return bool + * + * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. */ function is_settled(PromiseInterface $promise) { - return $promise->getState() !== PromiseInterface::PENDING; + return Is::settled($promise); } /** - * @see Coroutine + * Create a new coroutine. * - * @param callable $generatorFn + * @see Coroutine * * @return PromiseInterface + * + * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. */ function coroutine(callable $generatorFn) { - return new Coroutine($generatorFn); + return Coroutine::of($generatorFn); } diff --git a/vendor/guzzlehttp/psr7/.github/FUNDING.yml b/vendor/guzzlehttp/psr7/.github/FUNDING.yml new file mode 100644 index 0000000000..7d222c5820 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: [Nyholm, GrahamCampbell] +tidelift: "packagist/guzzlehttp/psr7" diff --git a/vendor/guzzlehttp/psr7/.github/stale.yml b/vendor/guzzlehttp/psr7/.github/stale.yml new file mode 100644 index 0000000000..53faa71bd9 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/stale.yml @@ -0,0 +1,14 @@ +daysUntilStale: 120 +daysUntilClose: 14 +exemptLabels: + - lifecycle/keep-open + - lifecycle/ready-for-merge +# Label to use when marking an issue as stale +staleLabel: lifecycle/stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/vendor/guzzlehttp/psr7/.github/workflows/ci.yml b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml new file mode 100644 index 0000000000..0850470e02 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + strategy: + max-parallel: 10 + matrix: + php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: 'none' + extensions: mbstring + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: composer update --no-interaction --no-progress + + - name: Run tests + run: make test diff --git a/vendor/guzzlehttp/psr7/.github/workflows/integration.yml b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml new file mode 100644 index 0000000000..a55a256edb --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/integration.yml @@ -0,0 +1,36 @@ +name: Integration + +on: + pull_request: + +jobs: + build: + name: Test + runs-on: ubuntu-22.04 + strategy: + max-parallel: 10 + matrix: + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Download dependencies + uses: ramsey/composer-install@v1 + with: + composer-options: --no-interaction --optimize-autoloader + + - name: Start server + run: php -S 127.0.0.1:10002 tests/Integration/server.php & + + - name: Run tests + env: + TEST_SERVER: 127.0.0.1:10002 + run: ./vendor/bin/phpunit --testsuite Integration diff --git a/vendor/guzzlehttp/psr7/.github/workflows/static.yml b/vendor/guzzlehttp/psr7/.github/workflows/static.yml new file mode 100644 index 0000000000..f00351b68b --- /dev/null +++ b/vendor/guzzlehttp/psr7/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Static analysis + +on: + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + extensions: mbstring + + - name: Download dependencies + run: composer update --no-interaction --no-progress + + - name: Download PHP CS Fixer + run: composer require "friendsofphp/php-cs-fixer:2.18.4" + + - name: Execute PHP CS Fixer + run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run diff --git a/vendor/guzzlehttp/psr7/.php_cs.dist b/vendor/guzzlehttp/psr7/.php_cs.dist new file mode 100644 index 0000000000..e4f0bd5357 --- /dev/null +++ b/vendor/guzzlehttp/psr7/.php_cs.dist @@ -0,0 +1,56 @@ +<?php + +$config = PhpCsFixer\Config::create() + ->setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'concat_space' => ['spacing' => 'one'], + 'declare_strict_types' => false, + 'final_static_access' => true, + 'fully_qualified_strict_types' => true, + 'header_comment' => false, + 'is_null' => ['use_yoda_style' => true], + 'list_syntax' => ['syntax' => 'long'], + 'lowercase_cast' => true, + 'magic_method_casing' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'no_alias_functions' => true, + 'no_alternative_syntax' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unset_cast' => true, + 'no_unused_imports' => true, + 'no_whitespace_in_blank_line' => true, + 'ordered_imports' => true, + 'php_unit_ordered_covers' => true, + 'php_unit_test_annotation' => ['style' => 'prefix'], + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], + 'phpdoc_align' => ['align' => 'vertical'], + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'phpdoc_var_without_name' => true, + 'single_trait_insert_per_statement' => true, + 'standardize_not_equals' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->name('*.php') + ) +; + +return $config; diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md index 8a3743dba5..9b2b65cdb8 100644 --- a/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -3,14 +3,93 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## Unreleased +## 1.9.1 - 2023-04-17 -## [1.6.0] +### Fixed + +- Fixed header validation issue + +## 1.9.0 - 2022-06-20 + +### Added + +- Added `UriComparator::isCrossOrigin` method + +## 1.8.5 - 2022-03-20 + +### Fixed + +- Correct header value validation + +## 1.8.4 - 2022-03-20 + +### Fixed + +- Validate header values properly + +## 1.8.3 - 2021-10-05 + +### Fixed + +- Return `null` in caching stream size if remote size is `null` + +## 1.8.2 - 2021-04-26 + +### Fixed + +- Handle possibly unset `url` in `stream_get_meta_data` + +## 1.8.1 - 2021-03-21 + +### Fixed + +- Issue parsing IPv6 URLs +- Issue modifying ServerRequest lost all its attributes + +## 1.8.0 - 2021-03-21 + +### Added + +- Locale independent URL parsing +- Most classes got a `@final` annotation to prepare for 2.0 + +### Fixed + +- Issue when creating stream from `php://input` and curl-ext is not installed +- Broken `Utils::tryFopen()` on PHP 8 + +## 1.7.0 - 2020-09-30 + +### Added + +- Replaced functions by static methods + +### Fixed + +- Converting a non-seekable stream to a string +- Handle multiple Set-Cookie correctly +- Ignore array keys in header values when merging +- Allow multibyte characters to be parsed in `Message:bodySummary()` + +### Changed + +- Restored partial HHVM 3 support + + +## [1.6.1] - 2019-07-02 + +### Fixed + +- Accept null and bool header values again + + +## [1.6.0] - 2019-06-30 ### Added @@ -229,7 +308,6 @@ Currently unsupported: -[Unreleased]: https://github.com/guzzle/psr7/compare/1.6.0...HEAD [1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0 [1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2 [1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1 diff --git a/vendor/guzzlehttp/psr7/LICENSE b/vendor/guzzlehttp/psr7/LICENSE index 581d95f920..51c7ec81cb 100644 --- a/vendor/guzzlehttp/psr7/LICENSE +++ b/vendor/guzzlehttp/psr7/LICENSE @@ -1,4 +1,11 @@ -Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com> +The MIT License (MIT) + +Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com> +Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com> +Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk> +Copyright (c) 2016 Tobias Schultze <webmaster@tubo-world.de> +Copyright (c) 2016 George Mponos <gmponos@gmail.com> +Copyright (c) 2018 Tobias Nyholm <tobias.nyholm@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md index c60a6a38d3..64776cb665 100644 --- a/vendor/guzzlehttp/psr7/README.md +++ b/vendor/guzzlehttp/psr7/README.md @@ -1,6 +1,6 @@ # PSR-7 Message Implementation -This repository contains a full [PSR-7](http://www.php-fig.org/psr/psr-7/) +This repository contains a full [PSR-7](https://www.php-fig.org/psr/psr-7/) message implementation, several stream decorators, and some helpful functionality like query string parsing. @@ -23,11 +23,11 @@ Reads from multiple streams, one after the other. ```php use GuzzleHttp\Psr7; -$a = Psr7\stream_for('abc, '); -$b = Psr7\stream_for('123.'); +$a = Psr7\Utils::streamFor('abc, '); +$b = Psr7\Utils::streamFor('123.'); $composed = new Psr7\AppendStream([$a, $b]); -$composed->addStream(Psr7\stream_for(' Above all listen to me')); +$composed->addStream(Psr7\Utils::streamFor(' Above all listen to me')); echo $composed; // abc, 123. Above all listen to me. ``` @@ -65,7 +65,7 @@ then on disk. ```php use GuzzleHttp\Psr7; -$original = Psr7\stream_for(fopen('http://www.google.com', 'r')); +$original = Psr7\Utils::streamFor(fopen('http://www.google.com', 'r')); $stream = new Psr7\CachingStream($original); $stream->read(1024); @@ -89,7 +89,7 @@ stream becomes too full. use GuzzleHttp\Psr7; // Create an empty stream -$stream = Psr7\stream_for(); +$stream = Psr7\Utils::streamFor(); // Start dropping data when the stream has more than 10 bytes $dropping = new Psr7\DroppingStream($stream, 10); @@ -112,7 +112,7 @@ to create a concrete class for a simple extension point. use GuzzleHttp\Psr7; -$stream = Psr7\stream_for('hi'); +$stream = Psr7\Utils::streamFor('hi'); $fnStream = Psr7\FnStream::decorate($stream, [ 'rewind' => function () use ($stream) { echo 'About to rewind - '; @@ -167,7 +167,7 @@ chunks (e.g. Amazon S3's multipart upload API). ```php use GuzzleHttp\Psr7; -$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+')); +$original = Psr7\Utils::streamFor(fopen('/tmp/test.txt', 'r+')); echo $original->getSize(); // >>> 1048576 @@ -197,7 +197,7 @@ NoSeekStream wraps a stream and does not allow seeking. ```php use GuzzleHttp\Psr7; -$original = Psr7\stream_for('foo'); +$original = Psr7\Utils::streamFor('foo'); $noSeek = new Psr7\NoSeekStream($original); echo $noSeek->read(3); @@ -271,7 +271,7 @@ This decorator could be added to any existing stream and used like so: ```php use GuzzleHttp\Psr7; -$original = Psr7\stream_for('foo'); +$original = Psr7\Utils::streamFor('foo'); $eofStream = new EofCallbackStream($original, function () { echo 'EOF!'; @@ -297,228 +297,292 @@ stream from a PSR-7 stream. ```php use GuzzleHttp\Psr7\StreamWrapper; -$stream = GuzzleHttp\Psr7\stream_for('hello!'); +$stream = GuzzleHttp\Psr7\Utils::streamFor('hello!'); $resource = StreamWrapper::getResource($stream); echo fread($resource, 6); // outputs hello! ``` -# Function API +# Static API -There are various functions available under the `GuzzleHttp\Psr7` namespace. +There are various static methods available under the `GuzzleHttp\Psr7` namespace. -## `function str` +## `GuzzleHttp\Psr7\Message::toString` -`function str(MessageInterface $message)` +`public static function toString(MessageInterface $message): string` Returns the string representation of an HTTP message. ```php $request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com'); -echo GuzzleHttp\Psr7\str($request); +echo GuzzleHttp\Psr7\Message::toString($request); ``` -## `function uri_for` +## `GuzzleHttp\Psr7\Message::bodySummary` -`function uri_for($uri)` +`public static function bodySummary(MessageInterface $message, int $truncateAt = 120): string|null` -This function accepts a string or `Psr\Http\Message\UriInterface` and returns a -UriInterface for the given value. If the value is already a `UriInterface`, it -is returned as-is. +Get a short summary of the message body. -```php -$uri = GuzzleHttp\Psr7\uri_for('http://example.com'); -assert($uri === GuzzleHttp\Psr7\uri_for($uri)); -``` +Will return `null` if the response is not printable. -## `function stream_for` +## `GuzzleHttp\Psr7\Message::rewindBody` -`function stream_for($resource = '', array $options = [])` +`public static function rewindBody(MessageInterface $message): void` -Create a new stream based on the input type. +Attempts to rewind a message body and throws an exception on failure. -Options is an associative array that can contain the following keys: +The body of the message will only be rewound if a call to `tell()` +returns a value other than `0`. -* - metadata: Array of custom metadata. -* - size: Size of the stream. -This method accepts the following `$resource` types: +## `GuzzleHttp\Psr7\Message::parseMessage` -- `Psr\Http\Message\StreamInterface`: Returns the value as-is. -- `string`: Creates a stream object that uses the given string as the contents. -- `resource`: Creates a stream object that wraps the given PHP stream resource. -- `Iterator`: If the provided value implements `Iterator`, then a read-only - stream object will be created that wraps the given iterable. Each time the - stream is read from, data from the iterator will fill a buffer and will be - continuously called until the buffer is equal to the requested read size. - Subsequent read calls will first read from the buffer and then call `next` - on the underlying iterator until it is exhausted. -- `object` with `__toString()`: If the object has the `__toString()` method, - the object will be cast to a string and then a stream will be returned that - uses the string value. -- `NULL`: When `null` is passed, an empty stream object is returned. -- `callable` When a callable is passed, a read-only stream object will be - created that invokes the given callable. The callable is invoked with the - number of suggested bytes to read. The callable can return any number of - bytes, but MUST return `false` when there is no more data to return. The - stream object that wraps the callable will invoke the callable until the - number of requested bytes are available. Any additional bytes will be - buffered and used in subsequent reads. +`public static function parseMessage(string $message): array` -```php -$stream = GuzzleHttp\Psr7\stream_for('foo'); -$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r')); +Parses an HTTP message into an associative array. -$generator = function ($bytes) { - for ($i = 0; $i < $bytes; $i++) { - yield ' '; - } -} +The array contains the "start-line" key containing the start line of +the message, "headers" key containing an associative array of header +array values, and a "body" key containing the body of the message. -$stream = GuzzleHttp\Psr7\stream_for($generator(100)); -``` +## `GuzzleHttp\Psr7\Message::parseRequestUri` -## `function parse_header` +`public static function parseRequestUri(string $path, array $headers): string` -`function parse_header($header)` +Constructs a URI for an HTTP request message. -Parse an array of header values containing ";" separated data into an array of -associative arrays representing the header key value pair data of the header. -When a parameter does not contain a value, but just contains a key, this -function will inject a key with a '' string value. +## `GuzzleHttp\Psr7\Message::parseRequest` -## `function normalize_header` +`public static function parseRequest(string $message): Request` -`function normalize_header($header)` +Parses a request message string into a request object. -Converts an array of header values that may contain comma separated headers -into an array of headers with no comma separated values. +## `GuzzleHttp\Psr7\Message::parseResponse` -## `function modify_request` +`public static function parseResponse(string $message): Response` -`function modify_request(RequestInterface $request, array $changes)` +Parses a response message string into a response object. -Clone and modify a request with the given changes. This method is useful for -reducing the number of clones needed to mutate a message. -The changes can be one of: +## `GuzzleHttp\Psr7\Header::parse` -- method: (string) Changes the HTTP method. -- set_headers: (array) Sets the given headers. -- remove_headers: (array) Remove the given headers. -- body: (mixed) Sets the given body. -- uri: (UriInterface) Set the URI. -- query: (string) Set the query string value of the URI. -- version: (string) Set the protocol version. +`public static function parse(string|array $header): array` +Parse an array of header values containing ";" separated data into an +array of associative arrays representing the header key value pair data +of the header. When a parameter does not contain a value, but just +contains a key, this function will inject a key with a '' string value. -## `function rewind_body` -`function rewind_body(MessageInterface $message)` +## `GuzzleHttp\Psr7\Header::normalize` -Attempts to rewind a message body and throws an exception on failure. The body -of the message will only be rewound if a call to `tell()` returns a value other -than `0`. +`public static function normalize(string|array $header): array` +Converts an array of header values that may contain comma separated +headers into an array of headers with no comma separated values. -## `function try_fopen` -`function try_fopen($filename, $mode)` +## `GuzzleHttp\Psr7\Query::parse` -Safely opens a PHP stream resource using a filename. +`public static function parse(string $str, int|bool $urlEncoding = true): array` + +Parse a query string into an associative array. -When fopen fails, PHP normally raises a warning. This function adds an error -handler that checks for errors and throws an exception instead. +If multiple values are found for the same key, the value of that key +value pair will become an array. This function does not parse nested +PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` +will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. -## `function copy_to_string` +## `GuzzleHttp\Psr7\Query::build` + +`public static function build(array $params, int|false $encoding = PHP_QUERY_RFC3986): string` + +Build a query string from an array of key value pairs. + +This function can use the return value of `parse()` to build a query +string. This function does not modify the provided keys when an array is +encountered (like `http_build_query()` would). -`function copy_to_string(StreamInterface $stream, $maxLen = -1)` -Copy the contents of a stream into a string until the given number of bytes -have been read. +## `GuzzleHttp\Psr7\Utils::caselessRemove` +`public static function caselessRemove(iterable<string> $keys, $keys, array $data): array` -## `function copy_to_stream` +Remove the items given by the keys, case insensitively from the data. -`function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1)` -Copy the contents of a stream into another stream until the given number of +## `GuzzleHttp\Psr7\Utils::copyToStream` + +`public static function copyToStream(StreamInterface $source, StreamInterface $dest, int $maxLen = -1): void` + +Copy the contents of a stream into another stream until the given number +of bytes have been read. + + +## `GuzzleHttp\Psr7\Utils::copyToString` + +`public static function copyToString(StreamInterface $stream, int $maxLen = -1): string` + +Copy the contents of a stream into a string until the given number of bytes have been read. -## `function hash` +## `GuzzleHttp\Psr7\Utils::hash` + +`public static function hash(StreamInterface $stream, string $algo, bool $rawOutput = false): string` + +Calculate a hash of a stream. -`function hash(StreamInterface $stream, $algo, $rawOutput = false)` +This method reads the entire stream to calculate a rolling hash, based on +PHP's `hash_init` functions. -Calculate a hash of a Stream. This method reads the entire stream to calculate -a rolling hash (based on PHP's hash_init functions). + +## `GuzzleHttp\Psr7\Utils::modifyRequest` + +`public static function modifyRequest(RequestInterface $request, array $changes): RequestInterface` + +Clone and modify a request with the given changes. + +This method is useful for reducing the number of clones needed to mutate +a message. + +- method: (string) Changes the HTTP method. +- set_headers: (array) Sets the given headers. +- remove_headers: (array) Remove the given headers. +- body: (mixed) Sets the given body. +- uri: (UriInterface) Set the URI. +- query: (string) Set the query string value of the URI. +- version: (string) Set the protocol version. -## `function readline` +## `GuzzleHttp\Psr7\Utils::readLine` -`function readline(StreamInterface $stream, $maxLength = null)` +`public static function readLine(StreamInterface $stream, int $maxLength = null): string` Read a line from the stream up to the maximum allowed buffer length. -## `function parse_request` +## `GuzzleHttp\Psr7\Utils::streamFor` -`function parse_request($message)` +`public static function streamFor(resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource = '', array $options = []): StreamInterface` -Parses a request message string into a request object. +Create a new stream based on the input type. +Options is an associative array that can contain the following keys: -## `function parse_response` +- metadata: Array of custom metadata. +- size: Size of the stream. -`function parse_response($message)` +This method accepts the following `$resource` types: -Parses a response message string into a response object. +- `Psr\Http\Message\StreamInterface`: Returns the value as-is. +- `string`: Creates a stream object that uses the given string as the contents. +- `resource`: Creates a stream object that wraps the given PHP stream resource. +- `Iterator`: If the provided value implements `Iterator`, then a read-only + stream object will be created that wraps the given iterable. Each time the + stream is read from, data from the iterator will fill a buffer and will be + continuously called until the buffer is equal to the requested read size. + Subsequent read calls will first read from the buffer and then call `next` + on the underlying iterator until it is exhausted. +- `object` with `__toString()`: If the object has the `__toString()` method, + the object will be cast to a string and then a stream will be returned that + uses the string value. +- `NULL`: When `null` is passed, an empty stream object is returned. +- `callable` When a callable is passed, a read-only stream object will be + created that invokes the given callable. The callable is invoked with the + number of suggested bytes to read. The callable can return any number of + bytes, but MUST return `false` when there is no more data to return. The + stream object that wraps the callable will invoke the callable until the + number of requested bytes are available. Any additional bytes will be + buffered and used in subsequent reads. +```php +$stream = GuzzleHttp\Psr7\Utils::streamFor('foo'); +$stream = GuzzleHttp\Psr7\Utils::streamFor(fopen('/path/to/file', 'r')); -## `function parse_query` +$generator = function ($bytes) { + for ($i = 0; $i < $bytes; $i++) { + yield ' '; + } +} -`function parse_query($str, $urlEncoding = true)` +$stream = GuzzleHttp\Psr7\Utils::streamFor($generator(100)); +``` -Parse a query string into an associative array. -If multiple values are found for the same key, the value of that key value pair -will become an array. This function does not parse nested PHP style arrays into -an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed into -`['foo[a]' => '1', 'foo[b]' => '2']`). +## `GuzzleHttp\Psr7\Utils::tryFopen` +`public static function tryFopen(string $filename, string $mode): resource` -## `function build_query` +Safely opens a PHP stream resource using a filename. -`function build_query(array $params, $encoding = PHP_QUERY_RFC3986)` +When fopen fails, PHP normally raises a warning. This function adds an +error handler that checks for errors and throws an exception instead. -Build a query string from an array of key value pairs. -This function can use the return value of parse_query() to build a query string. -This function does not modify the provided keys when an array is encountered -(like http_build_query would). +## `GuzzleHttp\Psr7\Utils::uriFor` +`public static function uriFor(string|UriInterface $uri): UriInterface` -## `function mimetype_from_filename` +Returns a UriInterface for the given value. -`function mimetype_from_filename($filename)` +This function accepts a string or UriInterface and returns a +UriInterface for the given value. If the value is already a +UriInterface, it is returned as-is. + + +## `GuzzleHttp\Psr7\MimeType::fromFilename` + +`public static function fromFilename(string $filename): string|null` Determines the mimetype of a file by looking at its extension. -## `function mimetype_from_extension` +## `GuzzleHttp\Psr7\MimeType::fromExtension` -`function mimetype_from_extension($extension)` +`public static function fromExtension(string $extension): string|null` Maps a file extensions to a mimetype. +## Upgrading from Function API + +The static API was first introduced in 1.7.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: + +| Original Function | Replacement Method | +|----------------|----------------| +| `str` | `Message::toString` | +| `uri_for` | `Utils::uriFor` | +| `stream_for` | `Utils::streamFor` | +| `parse_header` | `Header::parse` | +| `normalize_header` | `Header::normalize` | +| `modify_request` | `Utils::modifyRequest` | +| `rewind_body` | `Message::rewindBody` | +| `try_fopen` | `Utils::tryFopen` | +| `copy_to_string` | `Utils::copyToString` | +| `copy_to_stream` | `Utils::copyToStream` | +| `hash` | `Utils::hash` | +| `readline` | `Utils::readLine` | +| `parse_request` | `Message::parseRequest` | +| `parse_response` | `Message::parseResponse` | +| `parse_query` | `Query::parse` | +| `build_query` | `Query::build` | +| `mimetype_from_filename` | `MimeType::fromFilename` | +| `mimetype_from_extension` | `MimeType::fromExtension` | +| `_parse_message` | `Message::parseMessage` | +| `_parse_request_uri` | `Message::parseRequestUri` | +| `get_message_body_summary` | `Message::bodySummary` | +| `_caseless_remove` | `Utils::caselessRemove` | + + # Additional URI Methods Aside from the standard `Psr\Http\Message\UriInterface` implementation in form of the `GuzzleHttp\Psr7\Uri` class, @@ -595,7 +659,7 @@ manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__to `public static function fromParts(array $parts): UriInterface` -Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. +Creates a URI from a hash of [`parse_url`](https://www.php.net/manual/en/function.parse-url.php) components. ### `GuzzleHttp\Psr7\Uri::withQueryValue` @@ -620,6 +684,16 @@ associative array of key => value. Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the provided key are removed. +## Cross-Origin Detection + +`GuzzleHttp\Psr7\UriComparator` provides methods to determine if a modified URL should be considered cross-origin. + +### `GuzzleHttp\Psr7\UriComparator::isCrossOrigin` + +`public static function isCrossOrigin(UriInterface $original, UriInterface $modified): bool` + +Determines if a modified URL should be considered cross-origin with respect to an original URL. + ## Reference Resolution `GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according @@ -743,3 +817,28 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati `$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent. This of course assumes they will be resolved against the same base URI. If this is not the case, determination of equivalence or difference of relative references does not mean anything. + + +## Version Guidance + +| Version | Status | PHP Version | +|---------|----------------|------------------| +| 1.x | Security fixes | >=5.4,<8.1 | +| 2.x | Latest | ^7.2.5 \|\| ^8.0 | + + +## Security + +If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. + + +## License + +Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + + +## For Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/vendor/guzzlehttp/psr7/composer.json b/vendor/guzzlehttp/psr7/composer.json index 168a055b06..2607f22d48 100644 --- a/vendor/guzzlehttp/psr7/composer.json +++ b/vendor/guzzlehttp/psr7/composer.json @@ -1,17 +1,37 @@ { "name": "guzzlehttp/psr7", - "type": "library", "description": "PSR-7 message implementation that also provides common utility methods", "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], "license": "MIT", "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, { "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, { "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" } ], @@ -21,14 +41,14 @@ "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "require-dev": { - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10", "ext-zlib": "*" }, "provide": { "psr/http-message-implementation": "1.0" }, "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "autoload": { "psr-4": { @@ -41,9 +61,11 @@ "GuzzleHttp\\Tests\\Psr7\\": "tests/" } }, - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" + "config": { + "preferred-install": "dist", + "sort-packages": true, + "allow-plugins": { + "bamarni/composer-bin-plugin": true } } } diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php index 472a0d61ba..fa9153d78f 100644 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -7,6 +8,8 @@ * Reads from multiple streams, one after the other. * * This is a read-only stream decorator. + * + * @final */ class AppendStream implements StreamInterface { @@ -61,7 +64,7 @@ public function addStream(StreamInterface $stream) public function getContents() { - return copy_to_string($this); + return Utils::copyToString($this); } /** @@ -98,6 +101,8 @@ public function detach() } $this->streams = []; + + return null; } public function tell() diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php index af4d4c2277..783859c198 100644 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -10,6 +11,8 @@ * This stream returns a "hwm" metadata value that tells upstream consumers * what the configured high water mark of the stream is, or the maximum * preferred size of the buffer. + * + * @final */ class BufferStream implements StreamInterface { @@ -49,6 +52,8 @@ public function close() public function detach() { $this->close(); + + return null; } public function getSize() diff --git a/vendor/guzzlehttp/psr7/src/CachingStream.php b/vendor/guzzlehttp/psr7/src/CachingStream.php index ed68f0861a..febade9f41 100644 --- a/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -6,6 +7,8 @@ /** * Stream decorator that can cache previously read bytes from a sequentially * read stream. + * + * @final */ class CachingStream implements StreamInterface { @@ -20,7 +23,7 @@ class CachingStream implements StreamInterface /** * We will treat the buffer object as the body of the stream * - * @param StreamInterface $stream Stream to cache + * @param StreamInterface $stream Stream to cache. The cursor is assumed to be at the beginning of the stream. * @param StreamInterface $target Optionally specify where data is cached */ public function __construct( @@ -28,12 +31,18 @@ public function __construct( StreamInterface $target = null ) { $this->remoteStream = $stream; - $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); + $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); } public function getSize() { - return max($this->stream->getSize(), $this->remoteStream->getSize()); + $remoteSize = $this->remoteStream->getSize(); + + if (null === $remoteSize) { + return null; + } + + return max($this->stream->getSize(), $remoteSize); } public function rewind() @@ -131,7 +140,7 @@ public function close() private function cacheEntireStream() { $target = new FnStream(['write' => 'strlen']); - copy_to_stream($this, $target); + Utils::copyToStream($this, $target); return $this->tell(); } diff --git a/vendor/guzzlehttp/psr7/src/DroppingStream.php b/vendor/guzzlehttp/psr7/src/DroppingStream.php index 8935c80d72..9f7420c405 100644 --- a/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ b/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -6,6 +7,8 @@ /** * Stream decorator that begins dropping data once the size of the underlying * stream becomes too full. + * + * @final */ class DroppingStream implements StreamInterface { diff --git a/vendor/guzzlehttp/psr7/src/FnStream.php b/vendor/guzzlehttp/psr7/src/FnStream.php index 73daea6f37..76a8cc7ba6 100644 --- a/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/vendor/guzzlehttp/psr7/src/FnStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -8,6 +9,8 @@ * * Allows for easy testing and extension of a provided stream without needing * to create a concrete class for a simple extension point. + * + * @final */ class FnStream implements StreamInterface { @@ -34,6 +37,7 @@ public function __construct(array $methods) /** * Lazily determine which methods are not implemented. + * * @throws \BadMethodCallException */ public function __get($name) @@ -54,6 +58,7 @@ public function __destruct() /** * An unserialize would allow the __destruct to run when the unserialized value goes out of scope. + * * @throws \LogicException */ public function __wakeup() diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php new file mode 100644 index 0000000000..865d742142 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -0,0 +1,71 @@ +<?php + +namespace GuzzleHttp\Psr7; + +final class Header +{ + /** + * Parse an array of header values containing ";" separated data into an + * array of associative arrays representing the header key value pair data + * of the header. When a parameter does not contain a value, but just + * contains a key, this function will inject a key with a '' string value. + * + * @param string|array $header Header to parse into components. + * + * @return array Returns the parsed header values. + */ + public static function parse($header) + { + static $trimmed = "\"' \n\t\r"; + $params = $matches = []; + + foreach (self::normalize($header) as $val) { + $part = []; + foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { + if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } + } + } + if ($part) { + $params[] = $part; + } + } + + return $params; + } + + /** + * Converts an array of header values that may contain comma separated + * headers into an array of headers with no comma separated values. + * + * @param string|array $header Header to normalize. + * + * @return array Returns the normalized header field values. + */ + public static function normalize($header) + { + if (!is_array($header)) { + return array_map('trim', explode(',', $header)); + } + + $result = []; + foreach ($header as $value) { + foreach ((array) $value as $v) { + if (strpos($v, ',') === false) { + $result[] = $v; + continue; + } + foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { + $result[] = trim($vv); + } + } + } + + return $result; + } +} diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php index 5e4f6028ca..0cbd2cce27 100644 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -13,6 +14,8 @@ * * @link http://tools.ietf.org/html/rfc1952 * @link http://php.net/manual/en/filters.compression.php + * + * @final */ class InflateStream implements StreamInterface { @@ -33,6 +36,7 @@ public function __construct(StreamInterface $stream) /** * @param StreamInterface $stream * @param $header + * * @return int */ private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) diff --git a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 02cec3af49..911e127d31 100644 --- a/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -6,6 +7,8 @@ /** * Lazily reads or writes to a file that is opened only after an IO operation * take place on the stream. + * + * @final */ class LazyOpenStream implements StreamInterface { @@ -14,7 +17,7 @@ class LazyOpenStream implements StreamInterface /** @var string File to open */ private $filename; - /** @var string $mode */ + /** @var string */ private $mode; /** @@ -34,6 +37,6 @@ public function __construct($filename, $mode) */ protected function createStream() { - return stream_for(try_fopen($this->filename, $this->mode)); + return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode)); } } diff --git a/vendor/guzzlehttp/psr7/src/LimitStream.php b/vendor/guzzlehttp/psr7/src/LimitStream.php index e4f239e30f..1173ec40d7 100644 --- a/vendor/guzzlehttp/psr7/src/LimitStream.php +++ b/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -1,11 +1,13 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; - /** - * Decorator used to return only a subset of a stream + * Decorator used to return only a subset of a stream. + * + * @final */ class LimitStream implements StreamInterface { diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php new file mode 100644 index 0000000000..516d1cb84a --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -0,0 +1,252 @@ +<?php + +namespace GuzzleHttp\Psr7; + +use Psr\Http\Message\MessageInterface; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; + +final class Message +{ + /** + * Returns the string representation of an HTTP message. + * + * @param MessageInterface $message Message to convert to a string. + * + * @return string + */ + public static function toString(MessageInterface $message) + { + if ($message instanceof RequestInterface) { + $msg = trim($message->getMethod() . ' ' + . $message->getRequestTarget()) + . ' HTTP/' . $message->getProtocolVersion(); + if (!$message->hasHeader('host')) { + $msg .= "\r\nHost: " . $message->getUri()->getHost(); + } + } elseif ($message instanceof ResponseInterface) { + $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' + . $message->getStatusCode() . ' ' + . $message->getReasonPhrase(); + } else { + throw new \InvalidArgumentException('Unknown message type'); + } + + foreach ($message->getHeaders() as $name => $values) { + if (strtolower($name) === 'set-cookie') { + foreach ($values as $value) { + $msg .= "\r\n{$name}: " . $value; + } + } else { + $msg .= "\r\n{$name}: " . implode(', ', $values); + } + } + + return "{$msg}\r\n\r\n" . $message->getBody(); + } + + /** + * Get a short summary of the message body. + * + * Will return `null` if the response is not printable. + * + * @param MessageInterface $message The message to get the body summary + * @param int $truncateAt The maximum allowed size of the summary + * + * @return string|null + */ + public static function bodySummary(MessageInterface $message, $truncateAt = 120) + { + $body = $message->getBody(); + + if (!$body->isSeekable() || !$body->isReadable()) { + return null; + } + + $size = $body->getSize(); + + if ($size === 0) { + return null; + } + + $summary = $body->read($truncateAt); + $body->rewind(); + + if ($size > $truncateAt) { + $summary .= ' (truncated...)'; + } + + // Matches any printable character, including unicode characters: + // letters, marks, numbers, punctuation, spacing, and separators. + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + return null; + } + + return $summary; + } + + /** + * Attempts to rewind a message body and throws an exception on failure. + * + * The body of the message will only be rewound if a call to `tell()` + * returns a value other than `0`. + * + * @param MessageInterface $message Message to rewind + * + * @throws \RuntimeException + */ + public static function rewindBody(MessageInterface $message) + { + $body = $message->getBody(); + + if ($body->tell()) { + $body->rewind(); + } + } + + /** + * Parses an HTTP message into an associative array. + * + * The array contains the "start-line" key containing the start line of + * the message, "headers" key containing an associative array of header + * array values, and a "body" key containing the body of the message. + * + * @param string $message HTTP request or response to parse. + * + * @return array + */ + public static function parseMessage($message) + { + if (!$message) { + throw new \InvalidArgumentException('Invalid message'); + } + + $message = ltrim($message, "\r\n"); + + $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); + + if ($messageParts === false || count($messageParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); + } + + list($rawHeaders, $body) = $messageParts; + $rawHeaders .= "\r\n"; // Put back the delimiter we split previously + $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); + + if ($headerParts === false || count($headerParts) !== 2) { + throw new \InvalidArgumentException('Invalid message: Missing status line'); + } + + list($startLine, $rawHeaders) = $headerParts; + + if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { + // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 + $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); + } + + /** @var array[] $headerLines */ + $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); + + // If these aren't the same, then one line didn't match and there's an invalid header. + if ($count !== substr_count($rawHeaders, "\n")) { + // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 + if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { + throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); + } + + throw new \InvalidArgumentException('Invalid header syntax'); + } + + $headers = []; + + foreach ($headerLines as $headerLine) { + $headers[$headerLine[1]][] = $headerLine[2]; + } + + return [ + 'start-line' => $startLine, + 'headers' => $headers, + 'body' => $body, + ]; + } + + /** + * Constructs a URI for an HTTP request message. + * + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). + * + * @return string + */ + public static function parseRequestUri($path, array $headers) + { + $hostKey = array_filter(array_keys($headers), function ($k) { + return strtolower($k) === 'host'; + }); + + // If no host is found, then a full URI cannot be constructed. + if (!$hostKey) { + return $path; + } + + $host = $headers[reset($hostKey)][0]; + $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; + + return $scheme . '://' . $host . '/' . ltrim($path, '/'); + } + + /** + * Parses a request message string into a request object. + * + * @param string $message Request message string. + * + * @return Request + */ + public static function parseRequest($message) + { + $data = self::parseMessage($message); + $matches = []; + if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { + throw new \InvalidArgumentException('Invalid request string'); + } + $parts = explode(' ', $data['start-line'], 3); + $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; + + $request = new Request( + $parts[0], + $matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1], + $data['headers'], + $data['body'], + $version + ); + + return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + } + + /** + * Parses a response message string into a response object. + * + * @param string $message Response message string. + * + * @return Response + */ + public static function parseResponse($message) + { + $data = self::parseMessage($message); + // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space + // between status-code and reason-phrase is required. But browsers accept + // responses without space and reason as well. + if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { + throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + } + $parts = explode(' ', $data['start-line'], 3); + + return new Response( + (int) $parts[1], + $data['headers'], + $data['body'], + explode('/', $parts[0])[1], + isset($parts[2]) ? $parts[2] : null + ); + } +} diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php index a7966d10cf..0bbd63e0d6 100644 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -17,7 +18,7 @@ trait MessageTrait /** @var string */ private $protocol = '1.1'; - /** @var StreamInterface */ + /** @var StreamInterface|null */ private $stream; public function getProtocolVersion() @@ -117,7 +118,7 @@ public function withoutHeader($header) public function getBody() { if (!$this->stream) { - $this->stream = stream_for(''); + $this->stream = Utils::streamFor(''); } return $this->stream; @@ -156,17 +157,22 @@ private function setHeaders(array $headers) } } + /** + * @param mixed $value + * + * @return string[] + */ private function normalizeHeaderValue($value) { if (!is_array($value)) { - return $this->trimHeaderValues([$value]); + return $this->trimAndValidateHeaderValues([$value]); } if (count($value) === 0) { throw new \InvalidArgumentException('Header value can not be an empty array.'); } - return $this->trimHeaderValues($value); + return $this->trimAndValidateHeaderValues($value); } /** @@ -177,13 +183,13 @@ private function normalizeHeaderValue($value) * header-field = field-name ":" OWS field-value OWS * OWS = *( SP / HTAB ) * - * @param string[] $values Header values + * @param mixed[] $values Header values * * @return string[] Trimmed header values * * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 */ - private function trimHeaderValues(array $values) + private function trimAndValidateHeaderValues(array $values) { return array_map(function ($value) { if (!is_scalar($value) && null !== $value) { @@ -193,10 +199,20 @@ private function trimHeaderValues(array $values) )); } - return trim((string) $value, " \t"); - }, $values); + $trimmed = trim((string) $value, " \t"); + $this->assertValue($trimmed); + + return $trimmed; + }, array_values($values)); } + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * @param mixed $header + * + * @return void + */ private function assertHeader($header) { if (!is_string($header)) { @@ -209,5 +225,45 @@ private function assertHeader($header) if ($header === '') { throw new \InvalidArgumentException('Header name can not be empty.'); } + + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header name.', $header) + ); + } + } + + /** + * @param string $value + * + * @return void + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * VCHAR = %x21-7E + * obs-text = %x80-FF + * obs-fold = CRLF 1*( SP / HTAB ) + */ + private function assertValue($value) + { + // The regular expression intentionally does not support the obs-fold production, because as + // per RFC 7230#3.2.4: + // + // A sender MUST NOT generate a message that includes + // line folding (i.e., that has any field-value that contains a match to + // the obs-fold rule) unless the message is intended for packaging + // within the message/http media type. + // + // Clients must not send a request with line folding and a server sending folded headers is + // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting + // folding is not likely to break any legitimate use case. + if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header value.', $value) + ); + } } } diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php new file mode 100644 index 0000000000..205c7b1fa6 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -0,0 +1,140 @@ +<?php + +namespace GuzzleHttp\Psr7; + +final class MimeType +{ + /** + * Determines the mimetype of a file by looking at its extension. + * + * @param string $filename + * + * @return string|null + */ + public static function fromFilename($filename) + { + return self::fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); + } + + /** + * Maps a file extensions to a mimetype. + * + * @param string $extension string The file extension. + * + * @return string|null + * + * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + */ + public static function fromExtension($extension) + { + static $mimetypes = [ + '3gp' => 'video/3gpp', + '7z' => 'application/x-7z-compressed', + 'aac' => 'audio/x-aac', + 'ai' => 'application/postscript', + 'aif' => 'audio/x-aiff', + 'asc' => 'text/plain', + 'asf' => 'video/x-ms-asf', + 'atom' => 'application/atom+xml', + 'avi' => 'video/x-msvideo', + 'bmp' => 'image/bmp', + 'bz2' => 'application/x-bzip2', + 'cer' => 'application/pkix-cert', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'css' => 'text/css', + 'csv' => 'text/csv', + 'cu' => 'application/cu-seeme', + 'deb' => 'application/x-debian-package', + 'doc' => 'application/msword', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dvi' => 'application/x-dvi', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'etx' => 'text/x-setext', + 'flac' => 'audio/flac', + 'flv' => 'video/x-flv', + 'gif' => 'image/gif', + 'gz' => 'application/gzip', + 'htm' => 'text/html', + 'html' => 'text/html', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ini' => 'text/plain', + 'iso' => 'application/x-iso9660-image', + 'jar' => 'application/java-archive', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'js' => 'text/javascript', + 'json' => 'application/json', + 'latex' => 'application/x-latex', + 'log' => 'text/plain', + 'm4a' => 'audio/mp4', + 'm4v' => 'video/mp4', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mov' => 'video/quicktime', + 'mkv' => 'video/x-matroska', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4v' => 'video/mp4', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'oga' => 'audio/ogg', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'pbm' => 'image/x-portable-bitmap', + 'pdf' => 'application/pdf', + 'pgm' => 'image/x-portable-graymap', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'ppm' => 'image/x-portable-pixmap', + 'ppt' => 'application/vnd.ms-powerpoint', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'ps' => 'application/postscript', + 'qt' => 'video/quicktime', + 'rar' => 'application/x-rar-compressed', + 'ras' => 'image/x-cmu-raster', + 'rss' => 'application/rss+xml', + 'rtf' => 'application/rtf', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'svg' => 'image/svg+xml', + 'swf' => 'application/x-shockwave-flash', + 'tar' => 'application/x-tar', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'torrent' => 'application/x-bittorrent', + 'ttf' => 'application/x-font-ttf', + 'txt' => 'text/plain', + 'wav' => 'audio/x-wav', + 'webm' => 'video/webm', + 'webp' => 'image/webp', + 'wma' => 'audio/x-ms-wma', + 'wmv' => 'video/x-ms-wmv', + 'woff' => 'application/x-font-woff', + 'wsdl' => 'application/wsdl+xml', + 'xbm' => 'image/x-xbitmap', + 'xls' => 'application/vnd.ms-excel', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xml' => 'application/xml', + 'xpm' => 'image/x-xpixmap', + 'xwd' => 'image/x-xwindowdump', + 'yaml' => 'text/yaml', + 'yml' => 'text/yaml', + 'zip' => 'application/zip', + ]; + + $extension = strtolower($extension); + + return isset($mimetypes[$extension]) + ? $mimetypes[$extension] + : null; + } +} diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php index c0fd584f75..5a6079a89f 100644 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -6,6 +7,8 @@ /** * Stream that when read returns bytes for a streaming multipart or * multipart/form-data stream. + * + * @final */ class MultipartStream implements StreamInterface { @@ -71,7 +74,7 @@ protected function createStream(array $elements) } // Add the trailing boundary with CRLF - $stream->addStream(stream_for("--{$this->boundary}--\r\n")); + $stream->addStream(Utils::streamFor("--{$this->boundary}--\r\n")); return $stream; } @@ -84,7 +87,7 @@ private function addElement(AppendStream $stream, array $element) } } - $element['contents'] = stream_for($element['contents']); + $element['contents'] = Utils::streamFor($element['contents']); if (empty($element['filename'])) { $uri = $element['contents']->getMetadata('uri'); @@ -100,9 +103,9 @@ private function addElement(AppendStream $stream, array $element) isset($element['headers']) ? $element['headers'] : [] ); - $stream->addStream(stream_for($this->getHeaders($headers))); + $stream->addStream(Utils::streamFor($this->getHeaders($headers))); $stream->addStream($body); - $stream->addStream(stream_for("\r\n")); + $stream->addStream(Utils::streamFor("\r\n")); } /** @@ -114,9 +117,11 @@ private function createElement($name, StreamInterface $stream, $filename, array $disposition = $this->getHeader($headers, 'content-disposition'); if (!$disposition) { $headers['Content-Disposition'] = ($filename === '0' || $filename) - ? sprintf('form-data; name="%s"; filename="%s"', + ? sprintf( + 'form-data; name="%s"; filename="%s"', $name, - basename($filename)) + basename($filename) + ) : "form-data; name=\"{$name}\""; } @@ -131,7 +136,7 @@ private function createElement($name, StreamInterface $stream, $filename, array // Set a default Content-Type if one was not supplied $type = $this->getHeader($headers, 'content-type'); if (!$type && ($filename === '0' || $filename)) { - if ($type = mimetype_from_filename($filename)) { + if ($type = MimeType::fromFilename($filename)) { $headers['Content-Type'] = $type; } } diff --git a/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/vendor/guzzlehttp/psr7/src/NoSeekStream.php index 233221805e..d66bdde460 100644 --- a/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ b/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -1,10 +1,13 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; /** - * Stream decorator that prevents a stream from being seeked + * Stream decorator that prevents a stream from being seeked. + * + * @final */ class NoSeekStream implements StreamInterface { diff --git a/vendor/guzzlehttp/psr7/src/PumpStream.php b/vendor/guzzlehttp/psr7/src/PumpStream.php index ffb5440da1..44c7b582c1 100644 --- a/vendor/guzzlehttp/psr7/src/PumpStream.php +++ b/vendor/guzzlehttp/psr7/src/PumpStream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -12,6 +13,8 @@ * returned by the provided callable is buffered internally until drained using * the read() function of the PumpStream. The provided callable MUST return * false when there is no more data to read. + * + * @final */ class PumpStream implements StreamInterface { @@ -31,14 +34,14 @@ class PumpStream implements StreamInterface private $buffer; /** - * @param callable $source Source of the stream data. The callable MAY - * accept an integer argument used to control the - * amount of data to return. The callable MUST - * return a string when called, or false on error - * or EOF. - * @param array $options Stream options: - * - metadata: Hash of metadata to use with stream. - * - size: Size of the stream, if known. + * @param callable $source Source of the stream data. The callable MAY + * accept an integer argument used to control the + * amount of data to return. The callable MUST + * return a string when called, or false on error + * or EOF. + * @param array $options Stream options: + * - metadata: Hash of metadata to use with stream. + * - size: Size of the stream, if known. */ public function __construct(callable $source, array $options = []) { @@ -51,7 +54,7 @@ public function __construct(callable $source, array $options = []) public function __toString() { try { - return copy_to_string($this); + return Utils::copyToString($this); } catch (\Exception $e) { return ''; } @@ -66,6 +69,8 @@ public function detach() { $this->tellPos = false; $this->source = null; + + return null; } public function getSize() diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php new file mode 100644 index 0000000000..5a7cc0359e --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -0,0 +1,113 @@ +<?php + +namespace GuzzleHttp\Psr7; + +final class Query +{ + /** + * Parse a query string into an associative array. + * + * If multiple values are found for the same key, the value of that key + * value pair will become an array. This function does not parse nested + * PHP style arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` + * will be parsed into `['foo[a]' => '1', 'foo[b]' => '2'])`. + * + * @param string $str Query string to parse + * @param int|bool $urlEncoding How the query string is encoded + * + * @return array + */ + public static function parse($str, $urlEncoding = true) + { + $result = []; + + if ($str === '') { + return $result; + } + + if ($urlEncoding === true) { + $decoder = function ($value) { + return rawurldecode(str_replace('+', ' ', $value)); + }; + } elseif ($urlEncoding === PHP_QUERY_RFC3986) { + $decoder = 'rawurldecode'; + } elseif ($urlEncoding === PHP_QUERY_RFC1738) { + $decoder = 'urldecode'; + } else { + $decoder = function ($str) { + return $str; + }; + } + + foreach (explode('&', $str) as $kvp) { + $parts = explode('=', $kvp, 2); + $key = $decoder($parts[0]); + $value = isset($parts[1]) ? $decoder($parts[1]) : null; + if (!isset($result[$key])) { + $result[$key] = $value; + } else { + if (!is_array($result[$key])) { + $result[$key] = [$result[$key]]; + } + $result[$key][] = $value; + } + } + + return $result; + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + * + * @return string + */ + public static function build(array $params, $encoding = PHP_QUERY_RFC3986) + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function ($str) { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder($k); + if (!is_array($v)) { + $qs .= $k; + if ($v !== null) { + $qs .= '=' . $encoder($v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + if ($vv !== null) { + $qs .= '=' . $encoder($vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php index 59f337db11..c1cdaebff8 100644 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use InvalidArgumentException; @@ -16,7 +17,7 @@ class Request implements RequestInterface /** @var string */ private $method; - /** @var null|string */ + /** @var string|null */ private $requestTarget; /** @var UriInterface */ @@ -26,7 +27,7 @@ class Request implements RequestInterface * @param string $method HTTP method * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|null|resource|StreamInterface $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version */ public function __construct( @@ -51,7 +52,7 @@ public function __construct( } if ($body !== '' && $body !== null) { - $this->stream = stream_for($body); + $this->stream = Utils::streamFor($body); } } diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php index e7e04d86a6..8c01a0f5a4 100644 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\ResponseInterface; @@ -82,7 +83,7 @@ class Response implements ResponseInterface /** * @param int $status Status code * @param array $headers Response headers - * @param string|null|resource|StreamInterface $body Response body + * @param string|resource|StreamInterface|null $body Response body * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ @@ -100,7 +101,7 @@ public function __construct( $this->statusCode = $status; if ($body !== '' && $body !== null) { - $this->stream = stream_for($body); + $this->stream = Utils::streamFor($body); } $this->setHeaders($headers); @@ -134,7 +135,7 @@ public function withStatus($code, $reasonPhrase = '') if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { $reasonPhrase = self::$phrases[$new->statusCode]; } - $new->reasonPhrase = $reasonPhrase; + $new->reasonPhrase = (string) $reasonPhrase; return $new; } diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php index 505e4742b6..51b571f24d 100644 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -11,6 +11,7 @@ final class Rfc7230 * Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons. * * @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 + * * @license https://github.com/amphp/http/blob/v1.0.1/LICENSE */ const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php index 1a09a6c87c..e6d26f5ff9 100644 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -4,9 +4,9 @@ use InvalidArgumentException; use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\UriInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +use Psr\Http\Message\UriInterface; /** * Server-side HTTP request @@ -35,7 +35,7 @@ class ServerRequest extends Request implements ServerRequestInterface private $cookieParams = []; /** - * @var null|array|object + * @var array|object|null */ private $parsedBody; @@ -58,7 +58,7 @@ class ServerRequest extends Request implements ServerRequestInterface * @param string $method HTTP method * @param string|UriInterface $uri URI * @param array $headers Request headers - * @param string|null|resource|StreamInterface $body Request body + * @param string|resource|StreamInterface|null $body Request body * @param string $version Protocol version * @param array $serverParams Typically the $_SERVER superglobal */ @@ -79,8 +79,10 @@ public function __construct( * Return an UploadedFile instance array. * * @param array $files A array which respect $_FILES structure - * @throws InvalidArgumentException for unrecognized values + * * @return array + * + * @throws InvalidArgumentException for unrecognized values */ public static function normalizeFiles(array $files) { @@ -109,6 +111,7 @@ public static function normalizeFiles(array $files) * delegate to normalizeNestedFileSpec() and return that return value. * * @param array $value $_FILES struct + * * @return array|UploadedFileInterface */ private static function createUploadedFileFromSpec(array $value) @@ -133,6 +136,7 @@ private static function createUploadedFileFromSpec(array $value) * UploadedFileInterface instances. * * @param array $files + * * @return UploadedFileInterface[] */ private static function normalizeNestedFileSpec(array $files = []) @@ -182,7 +186,7 @@ public static function fromGlobals() private static function extractHostAndPortFromAuthority($authority) { - $uri = 'http://'.$authority; + $uri = 'http://' . $authority; $parts = parse_url($uri); if (false === $parts) { return [null, null]; @@ -243,7 +247,6 @@ public static function getUriFromGlobals() return $uri; } - /** * {@inheritdoc} */ diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php index d9e7409c7c..3865d6d6a1 100644 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; @@ -76,8 +77,10 @@ public function __destruct() public function __toString() { try { - $this->seek(0); - return (string) stream_get_contents($this->stream); + if ($this->isSeekable()) { + $this->seek(0); + } + return $this->getContents(); } catch (\Exception $e) { return ''; } @@ -193,7 +196,7 @@ public function rewind() public function seek($offset, $whence = SEEK_SET) { $whence = (int) $whence; - + if (!isset($this->stream)) { throw new \RuntimeException('Stream is detached'); } diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index daec6f52ea..5025dd67b8 100644 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -1,10 +1,12 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; /** * Stream decorator trait + * * @property StreamInterface stream */ trait StreamDecoratorTrait @@ -52,7 +54,7 @@ public function __toString() public function getContents() { - return copy_to_string($this); + return Utils::copyToString($this); } /** @@ -140,6 +142,7 @@ public function write($string) * Implement in subclasses to dynamically create streams when requested. * * @return StreamInterface + * * @throws \BadMethodCallException */ protected function createStream() diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php index 0f3a2856a2..fc7cb969bd 100644 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -1,10 +1,13 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\StreamInterface; /** * Converts Guzzle streams into PHP stream resources. + * + * @final */ class StreamWrapper { @@ -23,6 +26,7 @@ class StreamWrapper * @param StreamInterface $stream The stream to get a resource for * * @return resource + * * @throws \InvalidArgumentException if stream is not readable or writable */ public static function getResource(StreamInterface $stream) diff --git a/vendor/guzzlehttp/psr7/src/UploadedFile.php b/vendor/guzzlehttp/psr7/src/UploadedFile.php index e62bd5c807..bf342c4de3 100644 --- a/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ b/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use InvalidArgumentException; @@ -38,7 +39,7 @@ class UploadedFile implements UploadedFileInterface private $error; /** - * @var null|string + * @var string|null */ private $file; @@ -59,10 +60,10 @@ class UploadedFile implements UploadedFileInterface /** * @param StreamInterface|string|resource $streamOrFile - * @param int $size - * @param int $errorStatus - * @param string|null $clientFilename - * @param string|null $clientMediaType + * @param int $size + * @param int $errorStatus + * @param string|null $clientFilename + * @param string|null $clientMediaType */ public function __construct( $streamOrFile, @@ -85,6 +86,7 @@ public function __construct( * Depending on the value set file or stream variable * * @param mixed $streamOrFile + * * @throws InvalidArgumentException */ private function setStreamOrFile($streamOrFile) @@ -104,6 +106,7 @@ private function setStreamOrFile($streamOrFile) /** * @param int $error + * * @throws InvalidArgumentException */ private function setError($error) @@ -125,6 +128,7 @@ private function setError($error) /** * @param int $size + * * @throws InvalidArgumentException */ private function setSize($size) @@ -140,7 +144,8 @@ private function setSize($size) /** * @param mixed $param - * @return boolean + * + * @return bool */ private function isStringOrNull($param) { @@ -149,7 +154,8 @@ private function isStringOrNull($param) /** * @param mixed $param - * @return boolean + * + * @return bool */ private function isStringNotEmpty($param) { @@ -158,6 +164,7 @@ private function isStringNotEmpty($param) /** * @param string|null $clientFilename + * * @throws InvalidArgumentException */ private function setClientFilename($clientFilename) @@ -173,6 +180,7 @@ private function setClientFilename($clientFilename) /** * @param string|null $clientMediaType + * * @throws InvalidArgumentException */ private function setClientMediaType($clientMediaType) @@ -189,7 +197,7 @@ private function setClientMediaType($clientMediaType) /** * Return true if there is no upload error * - * @return boolean + * @return bool */ private function isOk() { @@ -197,7 +205,7 @@ private function isOk() } /** - * @return boolean + * @return bool */ public function isMoved() { @@ -220,6 +228,7 @@ private function validateActive() /** * {@inheritdoc} + * * @throws RuntimeException if the upload was not successful. */ public function getStream() @@ -238,11 +247,13 @@ public function getStream() * * @see http://php.net/is_uploaded_file * @see http://php.net/move_uploaded_file + * * @param string $targetPath Path to which to move the uploaded file. - * @throws RuntimeException if the upload was not successful. + * + * @throws RuntimeException if the upload was not successful. * @throws InvalidArgumentException if the $path specified is invalid. - * @throws RuntimeException on any error during the move operation, or on - * the second or subsequent call to the method. + * @throws RuntimeException on any error during the move operation, or on + * the second or subsequent call to the method. */ public function moveTo($targetPath) { @@ -259,7 +270,7 @@ public function moveTo($targetPath) ? rename($this->file, $targetPath) : move_uploaded_file($this->file, $targetPath); } else { - copy_to_stream( + Utils::copyToStream( $this->getStream(), new LazyOpenStream($targetPath, 'w') ); @@ -288,6 +299,7 @@ public function getSize() * {@inheritdoc} * * @see http://php.net/manual/en/features.file-upload.errors.php + * * @return int One of PHP's UPLOAD_ERR_XXX constants. */ public function getError() @@ -299,7 +311,7 @@ public function getError() * {@inheritdoc} * * @return string|null The filename sent by the client or null if none - * was provided. + * was provided. */ public function getClientFilename() { diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php index 825a25eedb..0f9f020d3c 100644 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\UriInterface; @@ -66,7 +67,7 @@ public function __construct($uri = '') { // weak type check to also accept null until we can add scalar type hints if ($uri != '') { - $parts = parse_url($uri); + $parts = self::parse($uri); if ($parts === false) { throw new \InvalidArgumentException("Unable to parse URI: $uri"); } @@ -74,6 +75,49 @@ public function __construct($uri = '') } } + /** + * UTF-8 aware \parse_url() replacement. + * + * The internal function produces broken output for non ASCII domain names + * (IDN) when used with locales other than "C". + * + * On the other hand, cURL understands IDN correctly only when UTF-8 locale + * is configured ("C.UTF-8", "en_US.UTF-8", etc.). + * + * @see https://bugs.php.net/bug.php?id=52923 + * @see https://www.php.net/manual/en/function.parse-url.php#114817 + * @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING + * + * @param string $url + * + * @return array|false + */ + private static function parse($url) + { + // If IPv6 + $prefix = ''; + if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) { + $prefix = $matches[1]; + $url = $matches[2]; + } + + $encodedUrl = preg_replace_callback( + '%[^:/@?&=#]+%usD', + static function ($matches) { + return urlencode($matches[0]); + }, + $url + ); + + $result = parse_url($prefix . $encodedUrl); + + if ($result === false) { + return false; + } + + return array_map('urldecode', $result); + } + public function __toString() { return self::composeComponents( @@ -166,6 +210,7 @@ public static function isDefaultPort(UriInterface $uri) * @param UriInterface $uri * * @return bool + * * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference @@ -184,6 +229,7 @@ public static function isAbsolute(UriInterface $uri) * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri) @@ -199,6 +245,7 @@ public static function isNetworkPathReference(UriInterface $uri) * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri) @@ -217,6 +264,7 @@ public static function isAbsolutePathReference(UriInterface $uri) * @param UriInterface $uri * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri) @@ -237,6 +285,7 @@ public static function isRelativePathReference(UriInterface $uri) * @param UriInterface|null $base An optional base URI to compare against * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) @@ -357,6 +406,7 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray) * @param array $parts * * @return UriInterface + * * @link http://php.net/manual/en/function.parse-url.php * * @throws \InvalidArgumentException If the components do not form a valid URI. @@ -575,7 +625,7 @@ private function filterScheme($scheme) throw new \InvalidArgumentException('Scheme must be a string'); } - return strtolower($scheme); + return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); } /** @@ -611,7 +661,7 @@ private function filterHost($host) throw new \InvalidArgumentException('Host must be a string'); } - return strtolower($host); + return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); } /** @@ -640,7 +690,7 @@ private function filterPort($port) /** * @param UriInterface $uri * @param array $keys - * + * * @return array */ private static function getFilteredQueryString(UriInterface $uri, array $keys) @@ -661,7 +711,7 @@ private static function getFilteredQueryString(UriInterface $uri, array $keys) /** * @param string $key * @param string|null $value - * + * * @return string */ private static function generateQueryString($key, $value) @@ -753,7 +803,7 @@ private function validateState() 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', E_USER_DEPRECATED ); - $this->path = '/'. $this->path; + $this->path = '/' . $this->path; //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); } } diff --git a/vendor/guzzlehttp/psr7/src/UriComparator.php b/vendor/guzzlehttp/psr7/src/UriComparator.php new file mode 100644 index 0000000000..ccf51ffb87 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/UriComparator.php @@ -0,0 +1,55 @@ +<?php + +namespace GuzzleHttp\Psr7; + +use Psr\Http\Message\UriInterface; + +/** + * Provides methods to determine if a modified URL should be considered cross-origin. + * + * @author Graham Campbell + */ +final class UriComparator +{ + /** + * Determines if a modified URL should be considered cross-origin with + * respect to an original URL. + * + * @return bool + */ + public static function isCrossOrigin(UriInterface $original, UriInterface $modified) + { + if (\strcasecmp($original->getHost(), $modified->getHost()) !== 0) { + return true; + } + + if ($original->getScheme() !== $modified->getScheme()) { + return true; + } + + if (self::computePort($original) !== self::computePort($modified)) { + return true; + } + + return false; + } + + /** + * @return int + */ + private static function computePort(UriInterface $uri) + { + $port = $uri->getPort(); + + if (null !== $port) { + return $port; + } + + return 'https' === $uri->getScheme() ? 443 : 80; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php index 384c29e508..81419ead42 100644 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\UriInterface; @@ -114,6 +115,7 @@ final class UriNormalizer * @param int $flags A bitmask of normalizations to apply, see constants * * @return UriInterface The normalized URI + * * @link https://tools.ietf.org/html/rfc3986#section-6.2 */ public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS) @@ -170,6 +172,7 @@ public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NO * @param int $normalizations A bitmask of normalizations to apply, see constants * * @return bool + * * @link https://tools.ietf.org/html/rfc3986#section-6.1 */ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php index c1cb8a275a..a3cb15d570 100644 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -1,4 +1,5 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\UriInterface; @@ -18,6 +19,7 @@ final class UriResolver * @param string $path * * @return string + * * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 */ public static function removeDotSegments($path) @@ -57,6 +59,7 @@ public static function removeDotSegments($path) * @param UriInterface $rel Relative URI * * @return UriInterface + * * @link http://tools.ietf.org/html/rfc3986#section-5.2 */ public static function resolve(UriInterface $base, UriInterface $rel) diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php new file mode 100644 index 0000000000..6b6c8cced5 --- /dev/null +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -0,0 +1,428 @@ +<?php + +namespace GuzzleHttp\Psr7; + +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Message\StreamInterface; +use Psr\Http\Message\UriInterface; + +final class Utils +{ + /** + * Remove the items given by the keys, case insensitively from the data. + * + * @param iterable<string> $keys + * + * @return array + */ + public static function caselessRemove($keys, array $data) + { + $result = []; + + foreach ($keys as &$key) { + $key = strtolower($key); + } + + foreach ($data as $k => $v) { + if (!in_array(strtolower($k), $keys)) { + $result[$k] = $v; + } + } + + return $result; + } + + /** + * Copy the contents of a stream into another stream until the given number + * of bytes have been read. + * + * @param StreamInterface $source Stream to read from + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @throws \RuntimeException on error. + */ + public static function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) + { + $bufferSize = 8192; + + if ($maxLen === -1) { + while (!$source->eof()) { + if (!$dest->write($source->read($bufferSize))) { + break; + } + } + } else { + $remaining = $maxLen; + while ($remaining > 0 && !$source->eof()) { + $buf = $source->read(min($bufferSize, $remaining)); + $len = strlen($buf); + if (!$len) { + break; + } + $remaining -= $len; + $dest->write($buf); + } + } + } + + /** + * Copy the contents of a stream into a string until the given number of + * bytes have been read. + * + * @param StreamInterface $stream Stream to read + * @param int $maxLen Maximum number of bytes to read. Pass -1 + * to read the entire stream. + * + * @return string + * + * @throws \RuntimeException on error. + */ + public static function copyToString(StreamInterface $stream, $maxLen = -1) + { + $buffer = ''; + + if ($maxLen === -1) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + } + return $buffer; + } + + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if ($buf == null) { + break; + } + $buffer .= $buf; + $len = strlen($buffer); + } + + return $buffer; + } + + /** + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based + * on PHP's `hash_init` functions. + * + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output + * + * @return string Returns the hash of the stream + * + * @throws \RuntimeException on error. + */ + public static function hash(StreamInterface $stream, $algo, $rawOutput = false) + { + $pos = $stream->tell(); + + if ($pos > 0) { + $stream->rewind(); + } + + $ctx = hash_init($algo); + while (!$stream->eof()) { + hash_update($ctx, $stream->read(1048576)); + } + + $out = hash_final($ctx, (bool) $rawOutput); + $stream->seek($pos); + + return $out; + } + + /** + * Clone and modify a request with the given changes. + * + * This method is useful for reducing the number of clones needed to mutate + * a message. + * + * The changes can be one of: + * - method: (string) Changes the HTTP method. + * - set_headers: (array) Sets the given headers. + * - remove_headers: (array) Remove the given headers. + * - body: (mixed) Sets the given body. + * - uri: (UriInterface) Set the URI. + * - query: (string) Set the query string value of the URI. + * - version: (string) Set the protocol version. + * + * @param RequestInterface $request Request to clone and modify. + * @param array $changes Changes to apply. + * + * @return RequestInterface + */ + public static function modifyRequest(RequestInterface $request, array $changes) + { + if (!$changes) { + return $request; + } + + $headers = $request->getHeaders(); + + if (!isset($changes['uri'])) { + $uri = $request->getUri(); + } else { + // Remove the host header if one is on the URI + if ($host = $changes['uri']->getHost()) { + $changes['set_headers']['Host'] = $host; + + if ($port = $changes['uri']->getPort()) { + $standardPorts = ['http' => 80, 'https' => 443]; + $scheme = $changes['uri']->getScheme(); + if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { + $changes['set_headers']['Host'] .= ':' . $port; + } + } + } + $uri = $changes['uri']; + } + + if (!empty($changes['remove_headers'])) { + $headers = self::caselessRemove($changes['remove_headers'], $headers); + } + + if (!empty($changes['set_headers'])) { + $headers = self::caselessRemove(array_keys($changes['set_headers']), $headers); + $headers = $changes['set_headers'] + $headers; + } + + if (isset($changes['query'])) { + $uri = $uri->withQuery($changes['query']); + } + + if ($request instanceof ServerRequestInterface) { + $new = (new ServerRequest( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion(), + $request->getServerParams() + )) + ->withParsedBody($request->getParsedBody()) + ->withQueryParams($request->getQueryParams()) + ->withCookieParams($request->getCookieParams()) + ->withUploadedFiles($request->getUploadedFiles()); + + foreach ($request->getAttributes() as $key => $value) { + $new = $new->withAttribute($key, $value); + } + + return $new; + } + + return new Request( + isset($changes['method']) ? $changes['method'] : $request->getMethod(), + $uri, + $headers, + isset($changes['body']) ? $changes['body'] : $request->getBody(), + isset($changes['version']) + ? $changes['version'] + : $request->getProtocolVersion() + ); + } + + /** + * Read a line from the stream up to the maximum allowed buffer length. + * + * @param StreamInterface $stream Stream to read from + * @param int|null $maxLength Maximum buffer length + * + * @return string + */ + public static function readLine(StreamInterface $stream, $maxLength = null) + { + $buffer = ''; + $size = 0; + + while (!$stream->eof()) { + // Using a loose equality here to match on '' and false. + if (null == ($byte = $stream->read(1))) { + return $buffer; + } + $buffer .= $byte; + // Break when a new line is found or the max length - 1 is reached + if ($byte === "\n" || ++$size === $maxLength - 1) { + break; + } + } + + return $buffer; + } + + /** + * Create a new stream based on the input type. + * + * Options is an associative array that can contain the following keys: + * - metadata: Array of custom metadata. + * - size: Size of the stream. + * + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data + * @param array $options Additional options + * + * @return StreamInterface + * + * @throws \InvalidArgumentException if the $resource arg is not valid. + */ + public static function streamFor($resource = '', array $options = []) + { + if (is_scalar($resource)) { + $stream = self::tryFopen('php://temp', 'r+'); + if ($resource !== '') { + fwrite($stream, $resource); + fseek($stream, 0); + } + return new Stream($stream, $options); + } + + switch (gettype($resource)) { + case 'resource': + /* + * The 'php://input' is a special stream with quirks and inconsistencies. + * We avoid using that stream by reading it into php://temp + */ + $metaData = \stream_get_meta_data($resource); + if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') { + $stream = self::tryFopen('php://temp', 'w+'); + fwrite($stream, stream_get_contents($resource)); + fseek($stream, 0); + $resource = $stream; + } + return new Stream($resource, $options); + case 'object': + if ($resource instanceof StreamInterface) { + return $resource; + } elseif ($resource instanceof \Iterator) { + return new PumpStream(function () use ($resource) { + if (!$resource->valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return Utils::streamFor((string) $resource, $options); + } + break; + case 'NULL': + return new Stream(self::tryFopen('php://temp', 'r+'), $options); + } + + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + } + + /** + * Safely opens a PHP stream resource using a filename. + * + * When fopen fails, PHP normally raises a warning. This function adds an + * error handler that checks for errors and throws an exception instead. + * + * @param string $filename File to open + * @param string $mode Mode used to open the file + * + * @return resource + * + * @throws \RuntimeException if the file cannot be opened + */ + public static function tryFopen($filename, $mode) + { + $ex = null; + set_error_handler(function () use ($filename, $mode, &$ex) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + func_get_args()[1] + )); + + return true; + }); + + try { + $handle = fopen($filename, $mode); + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to open "%s" using mode "%s": %s', + $filename, + $mode, + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $handle; + } + + /** + * Returns a UriInterface for the given value. + * + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. + * + * @param string|UriInterface $uri + * + * @return UriInterface + * + * @throws \InvalidArgumentException + */ + public static function uriFor($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } + + if (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } +} diff --git a/vendor/guzzlehttp/psr7/src/functions.php b/vendor/guzzlehttp/psr7/src/functions.php index 8e6dafe68e..b0901fadd3 100644 --- a/vendor/guzzlehttp/psr7/src/functions.php +++ b/vendor/guzzlehttp/psr7/src/functions.php @@ -1,10 +1,9 @@ <?php + namespace GuzzleHttp\Psr7; use Psr\Http\Message\MessageInterface; use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; @@ -14,52 +13,32 @@ * @param MessageInterface $message Message to convert to a string. * * @return string + * + * @deprecated str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead. */ function str(MessageInterface $message) { - if ($message instanceof RequestInterface) { - $msg = trim($message->getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); - if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); - } - } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); - } else { - throw new \InvalidArgumentException('Unknown message type'); - } - - foreach ($message->getHeaders() as $name => $values) { - $msg .= "\r\n{$name}: " . implode(', ', $values); - } - - return "{$msg}\r\n\r\n" . $message->getBody(); + return Message::toString($message); } /** * Returns a UriInterface for the given value. * - * This function accepts a string or {@see Psr\Http\Message\UriInterface} and - * returns a UriInterface for the given value. If the value is already a - * `UriInterface`, it is returned as-is. + * This function accepts a string or UriInterface and returns a + * UriInterface for the given value. If the value is already a + * UriInterface, it is returned as-is. * * @param string|UriInterface $uri * * @return UriInterface + * * @throws \InvalidArgumentException + * + * @deprecated uri_for will be removed in guzzlehttp/psr7:2.0. Use Utils::uriFor instead. */ function uri_for($uri) { - if ($uri instanceof UriInterface) { - return $uri; - } elseif (is_string($uri)) { - return new Uri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); + return Utils::uriFor($uri); } /** @@ -69,86 +48,57 @@ function uri_for($uri) * - metadata: Array of custom metadata. * - size: Size of the stream. * - * @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data + * This method accepts the following `$resource` types: + * - `Psr\Http\Message\StreamInterface`: Returns the value as-is. + * - `string`: Creates a stream object that uses the given string as the contents. + * - `resource`: Creates a stream object that wraps the given PHP stream resource. + * - `Iterator`: If the provided value implements `Iterator`, then a read-only + * stream object will be created that wraps the given iterable. Each time the + * stream is read from, data from the iterator will fill a buffer and will be + * continuously called until the buffer is equal to the requested read size. + * Subsequent read calls will first read from the buffer and then call `next` + * on the underlying iterator until it is exhausted. + * - `object` with `__toString()`: If the object has the `__toString()` method, + * the object will be cast to a string and then a stream will be returned that + * uses the string value. + * - `NULL`: When `null` is passed, an empty stream object is returned. + * - `callable` When a callable is passed, a read-only stream object will be + * created that invokes the given callable. The callable is invoked with the + * number of suggested bytes to read. The callable can return any number of + * bytes, but MUST return `false` when there is no more data to return. The + * stream object that wraps the callable will invoke the callable until the + * number of requested bytes are available. Any additional bytes will be + * buffered and used in subsequent reads. + * + * @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data * @param array $options Additional options * * @return StreamInterface + * * @throws \InvalidArgumentException if the $resource arg is not valid. + * + * @deprecated stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead. */ function stream_for($resource = '', array $options = []) { - if (is_scalar($resource)) { - $stream = fopen('php://temp', 'r+'); - if ($resource !== '') { - fwrite($stream, $resource); - fseek($stream, 0); - } - return new Stream($stream, $options); - } - - switch (gettype($resource)) { - case 'resource': - return new Stream($resource, $options); - case 'object': - if ($resource instanceof StreamInterface) { - return $resource; - } elseif ($resource instanceof \Iterator) { - return new PumpStream(function () use ($resource) { - if (!$resource->valid()) { - return false; - } - $result = $resource->current(); - $resource->next(); - return $result; - }, $options); - } elseif (method_exists($resource, '__toString')) { - return stream_for((string) $resource, $options); - } - break; - case 'NULL': - return new Stream(fopen('php://temp', 'r+'), $options); - } - - if (is_callable($resource)) { - return new PumpStream($resource, $options); - } - - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + return Utils::streamFor($resource, $options); } /** * Parse an array of header values containing ";" separated data into an - * array of associative arrays representing the header key value pair - * data of the header. When a parameter does not contain a value, but just + * array of associative arrays representing the header key value pair data + * of the header. When a parameter does not contain a value, but just * contains a key, this function will inject a key with a '' string value. * * @param string|array $header Header to parse into components. * * @return array Returns the parsed header values. + * + * @deprecated parse_header will be removed in guzzlehttp/psr7:2.0. Use Header::parse instead. */ function parse_header($header) { - static $trimmed = "\"' \n\t\r"; - $params = $matches = []; - - foreach (normalize_header($header) as $val) { - $part = []; - foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { - if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); - } - } - } - if ($part) { - $params[] = $part; - } - } - - return $params; + return Header::parse($header); } /** @@ -158,32 +108,20 @@ function parse_header($header) * @param string|array $header Header to normalize. * * @return array Returns the normalized header field values. + * + * @deprecated normalize_header will be removed in guzzlehttp/psr7:2.0. Use Header::normalize instead. */ function normalize_header($header) { - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); - } - - $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; - continue; - } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); - } - } - } - - return $result; + return Header::normalize($header); } /** * Clone and modify a request with the given changes. * + * This method is useful for reducing the number of clones needed to mutate a + * message. + * * The changes can be one of: * - method: (string) Changes the HTTP method. * - set_headers: (array) Sets the given headers. @@ -197,72 +135,12 @@ function normalize_header($header) * @param array $changes Changes to apply. * * @return RequestInterface + * + * @deprecated modify_request will be removed in guzzlehttp/psr7:2.0. Use Utils::modifyRequest instead. */ function modify_request(RequestInterface $request, array $changes) { - if (!$changes) { - return $request; - } - - $headers = $request->getHeaders(); - - if (!isset($changes['uri'])) { - $uri = $request->getUri(); - } else { - // Remove the host header if one is on the URI - if ($host = $changes['uri']->getHost()) { - $changes['set_headers']['Host'] = $host; - - if ($port = $changes['uri']->getPort()) { - $standardPorts = ['http' => 80, 'https' => 443]; - $scheme = $changes['uri']->getScheme(); - if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':'.$port; - } - } - } - $uri = $changes['uri']; - } - - if (!empty($changes['remove_headers'])) { - $headers = _caseless_remove($changes['remove_headers'], $headers); - } - - if (!empty($changes['set_headers'])) { - $headers = _caseless_remove(array_keys($changes['set_headers']), $headers); - $headers = $changes['set_headers'] + $headers; - } - - if (isset($changes['query'])) { - $uri = $uri->withQuery($changes['query']); - } - - if ($request instanceof ServerRequestInterface) { - return (new ServerRequest( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion(), - $request->getServerParams() - )) - ->withParsedBody($request->getParsedBody()) - ->withQueryParams($request->getQueryParams()) - ->withCookieParams($request->getCookieParams()) - ->withUploadedFiles($request->getUploadedFiles()); - } - - return new Request( - isset($changes['method']) ? $changes['method'] : $request->getMethod(), - $uri, - $headers, - isset($changes['body']) ? $changes['body'] : $request->getBody(), - isset($changes['version']) - ? $changes['version'] - : $request->getProtocolVersion() - ); + return Utils::modifyRequest($request, $changes); } /** @@ -274,14 +152,12 @@ function modify_request(RequestInterface $request, array $changes) * @param MessageInterface $message Message to rewind * * @throws \RuntimeException + * + * @deprecated rewind_body will be removed in guzzlehttp/psr7:2.0. Use Message::rewindBody instead. */ function rewind_body(MessageInterface $message) { - $body = $message->getBody(); - - if ($body->tell()) { - $body->rewind(); - } + Message::rewindBody($message); } /** @@ -294,29 +170,14 @@ function rewind_body(MessageInterface $message) * @param string $mode Mode used to open the file * * @return resource + * * @throws \RuntimeException if the file cannot be opened + * + * @deprecated try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead. */ function try_fopen($filename, $mode) { - $ex = null; - set_error_handler(function () use ($filename, $mode, &$ex) { - $ex = new \RuntimeException(sprintf( - 'Unable to open %s using mode %s: %s', - $filename, - $mode, - func_get_args()[1] - )); - }); - - $handle = fopen($filename, $mode); - restore_error_handler(); - - if ($ex) { - /** @var $ex \RuntimeException */ - throw $ex; - } - - return $handle; + return Utils::tryFopen($filename, $mode); } /** @@ -326,37 +187,16 @@ function try_fopen($filename, $mode) * @param StreamInterface $stream Stream to read * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. + * * @return string + * * @throws \RuntimeException on error. + * + * @deprecated copy_to_string will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToString instead. */ function copy_to_string(StreamInterface $stream, $maxLen = -1) { - $buffer = ''; - - if ($maxLen === -1) { - while (!$stream->eof()) { - $buf = $stream->read(1048576); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - } - return $buffer; - } - - $len = 0; - while (!$stream->eof() && $len < $maxLen) { - $buf = $stream->read($maxLen - $len); - // Using a loose equality here to match on '' and false. - if ($buf == null) { - break; - } - $buffer .= $buf; - $len = strlen($buffer); - } - - return $buffer; + return Utils::copyToString($stream, $maxLen); } /** @@ -369,92 +209,48 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1) * to read the entire stream. * * @throws \RuntimeException on error. + * + * @deprecated copy_to_stream will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToStream instead. */ -function copy_to_stream( - StreamInterface $source, - StreamInterface $dest, - $maxLen = -1 -) { - $bufferSize = 8192; - - if ($maxLen === -1) { - while (!$source->eof()) { - if (!$dest->write($source->read($bufferSize))) { - break; - } - } - } else { - $remaining = $maxLen; - while ($remaining > 0 && !$source->eof()) { - $buf = $source->read(min($bufferSize, $remaining)); - $len = strlen($buf); - if (!$len) { - break; - } - $remaining -= $len; - $dest->write($buf); - } - } +function copy_to_stream(StreamInterface $source, StreamInterface $dest, $maxLen = -1) +{ + return Utils::copyToStream($source, $dest, $maxLen); } /** - * Calculate a hash of a Stream + * Calculate a hash of a stream. + * + * This method reads the entire stream to calculate a rolling hash, based on + * PHP's `hash_init` functions. * * @param StreamInterface $stream Stream to calculate the hash for * @param string $algo Hash algorithm (e.g. md5, crc32, etc) * @param bool $rawOutput Whether or not to use raw output * * @return string Returns the hash of the stream + * * @throws \RuntimeException on error. + * + * @deprecated hash will be removed in guzzlehttp/psr7:2.0. Use Utils::hash instead. */ -function hash( - StreamInterface $stream, - $algo, - $rawOutput = false -) { - $pos = $stream->tell(); - - if ($pos > 0) { - $stream->rewind(); - } - - $ctx = hash_init($algo); - while (!$stream->eof()) { - hash_update($ctx, $stream->read(1048576)); - } - - $out = hash_final($ctx, (bool) $rawOutput); - $stream->seek($pos); - - return $out; +function hash(StreamInterface $stream, $algo, $rawOutput = false) +{ + return Utils::hash($stream, $algo, $rawOutput); } /** - * Read a line from the stream up to the maximum allowed buffer length + * Read a line from the stream up to the maximum allowed buffer length. * * @param StreamInterface $stream Stream to read from - * @param int $maxLength Maximum buffer length + * @param int|null $maxLength Maximum buffer length * * @return string + * + * @deprecated readline will be removed in guzzlehttp/psr7:2.0. Use Utils::readLine instead. */ function readline(StreamInterface $stream, $maxLength = null) { - $buffer = ''; - $size = 0; - - while (!$stream->eof()) { - // Using a loose equality here to match on '' and false. - if (null == ($byte = $stream->read(1))) { - return $buffer; - } - $buffer .= $byte; - // Break when a new line is found or the max length - 1 is reached - if ($byte === "\n" || ++$size === $maxLength - 1) { - break; - } - } - - return $buffer; + return Utils::readLine($stream, $maxLength); } /** @@ -463,26 +259,12 @@ function readline(StreamInterface $stream, $maxLength = null) * @param string $message Request message string. * * @return Request + * + * @deprecated parse_request will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequest instead. */ function parse_request($message) { - $data = _parse_message($message); - $matches = []; - if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { - throw new \InvalidArgumentException('Invalid request string'); - } - $parts = explode(' ', $data['start-line'], 3); - $version = isset($parts[2]) ? explode('/', $parts[2])[1] : '1.1'; - - $request = new Request( - $parts[0], - $matches[1] === '/' ? _parse_request_uri($parts[1], $data['headers']) : $parts[1], - $data['headers'], - $data['body'], - $version - ); - - return $matches[1] === '/' ? $request : $request->withRequestTarget($parts[1]); + return Message::parseRequest($message); } /** @@ -491,139 +273,67 @@ function parse_request($message) * @param string $message Response message string. * * @return Response + * + * @deprecated parse_response will be removed in guzzlehttp/psr7:2.0. Use Message::parseResponse instead. */ function parse_response($message) { - $data = _parse_message($message); - // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space - // between status-code and reason-phrase is required. But browsers accept - // responses without space and reason as well. - if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); - } - $parts = explode(' ', $data['start-line'], 3); - - return new Response( - $parts[1], - $data['headers'], - $data['body'], - explode('/', $parts[0])[1], - isset($parts[2]) ? $parts[2] : null - ); + return Message::parseResponse($message); } /** * Parse a query string into an associative array. * - * If multiple values are found for the same key, the value of that key - * value pair will become an array. This function does not parse nested - * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will - * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). + * If multiple values are found for the same key, the value of that key value + * pair will become an array. This function does not parse nested PHP style + * arrays into an associative array (e.g., `foo[a]=1&foo[b]=2` will be parsed + * into `['foo[a]' => '1', 'foo[b]' => '2'])`. * * @param string $str Query string to parse * @param int|bool $urlEncoding How the query string is encoded * * @return array + * + * @deprecated parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead. */ function parse_query($str, $urlEncoding = true) { - $result = []; - - if ($str === '') { - return $result; - } - - if ($urlEncoding === true) { - $decoder = function ($value) { - return rawurldecode(str_replace('+', ' ', $value)); - }; - } elseif ($urlEncoding === PHP_QUERY_RFC3986) { - $decoder = 'rawurldecode'; - } elseif ($urlEncoding === PHP_QUERY_RFC1738) { - $decoder = 'urldecode'; - } else { - $decoder = function ($str) { return $str; }; - } - - foreach (explode('&', $str) as $kvp) { - $parts = explode('=', $kvp, 2); - $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { - $result[$key] = $value; - } else { - if (!is_array($result[$key])) { - $result[$key] = [$result[$key]]; - } - $result[$key][] = $value; - } - } - - return $result; + return Query::parse($str, $urlEncoding); } /** * Build a query string from an array of key value pairs. * - * This function can use the return value of parse_query() to build a query + * This function can use the return value of `parse_query()` to build a query * string. This function does not modify the provided keys when an array is - * encountered (like http_build_query would). + * encountered (like `http_build_query()` would). * * @param array $params Query string parameters. * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 * to encode using RFC3986, or PHP_QUERY_RFC1738 * to encode using RFC1738. + * * @return string + * + * @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead. */ function build_query(array $params, $encoding = PHP_QUERY_RFC3986) { - if (!$params) { - return ''; - } - - if ($encoding === false) { - $encoder = function ($str) { return $str; }; - } elseif ($encoding === PHP_QUERY_RFC3986) { - $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { - $encoder = 'urlencode'; - } else { - throw new \InvalidArgumentException('Invalid type'); - } - - $qs = ''; - foreach ($params as $k => $v) { - $k = $encoder($k); - if (!is_array($v)) { - $qs .= $k; - if ($v !== null) { - $qs .= '=' . $encoder($v); - } - $qs .= '&'; - } else { - foreach ($v as $vv) { - $qs .= $k; - if ($vv !== null) { - $qs .= '=' . $encoder($vv); - } - $qs .= '&'; - } - } - } - - return $qs ? (string) substr($qs, 0, -1) : ''; + return Query::build($params, $encoding); } /** * Determines the mimetype of a file by looking at its extension. * - * @param $filename + * @param string $filename * - * @return null|string + * @return string|null + * + * @deprecated mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead. */ function mimetype_from_filename($filename) { - return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION)); + return MimeType::fromFilename($filename); } /** @@ -632,119 +342,13 @@ function mimetype_from_filename($filename) * @param $extension string The file extension. * * @return string|null + * * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + * @deprecated mimetype_from_extension will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromExtension instead. */ function mimetype_from_extension($extension) { - static $mimetypes = [ - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mkv' => 'video/x-matroska', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', - ]; - - $extension = strtolower($extension); - - return isset($mimetypes[$extension]) - ? $mimetypes[$extension] - : null; + return MimeType::fromExtension($extension); } /** @@ -757,61 +361,14 @@ function mimetype_from_extension($extension) * @param string $message HTTP request or response to parse. * * @return array + * * @internal + * + * @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead. */ function _parse_message($message) { - if (!$message) { - throw new \InvalidArgumentException('Invalid message'); - } - - $message = ltrim($message, "\r\n"); - - $messageParts = preg_split("/\r?\n\r?\n/", $message, 2); - - if ($messageParts === false || count($messageParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing header delimiter'); - } - - list($rawHeaders, $body) = $messageParts; - $rawHeaders .= "\r\n"; // Put back the delimiter we split previously - $headerParts = preg_split("/\r?\n/", $rawHeaders, 2); - - if ($headerParts === false || count($headerParts) !== 2) { - throw new \InvalidArgumentException('Invalid message: Missing status line'); - } - - list($startLine, $rawHeaders) = $headerParts; - - if (preg_match("/(?:^HTTP\/|^[A-Z]+ \S+ HTTP\/)(\d+(?:\.\d+)?)/i", $startLine, $matches) && $matches[1] === '1.0') { - // Header folding is deprecated for HTTP/1.1, but allowed in HTTP/1.0 - $rawHeaders = preg_replace(Rfc7230::HEADER_FOLD_REGEX, ' ', $rawHeaders); - } - - /** @var array[] $headerLines */ - $count = preg_match_all(Rfc7230::HEADER_REGEX, $rawHeaders, $headerLines, PREG_SET_ORDER); - - // If these aren't the same, then one line didn't match and there's an invalid header. - if ($count !== substr_count($rawHeaders, "\n")) { - // Folding is deprecated, see https://tools.ietf.org/html/rfc7230#section-3.2.4 - if (preg_match(Rfc7230::HEADER_FOLD_REGEX, $rawHeaders)) { - throw new \InvalidArgumentException('Invalid header syntax: Obsolete line folding'); - } - - throw new \InvalidArgumentException('Invalid header syntax'); - } - - $headers = []; - - foreach ($headerLines as $headerLine) { - $headers[$headerLine[1]][] = $headerLine[2]; - } - - return [ - 'start-line' => $startLine, - 'headers' => $headers, - 'body' => $body, - ]; + return Message::parseMessage($message); } /** @@ -821,79 +378,45 @@ function _parse_message($message) * @param array $headers Array of headers (each value an array). * * @return string + * * @internal + * + * @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead. */ function _parse_request_uri($path, array $headers) { - $hostKey = array_filter(array_keys($headers), function ($k) { - return strtolower($k) === 'host'; - }); - - // If no host is found, then a full URI cannot be constructed. - if (!$hostKey) { - return $path; - } - - $host = $headers[reset($hostKey)][0]; - $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - - return $scheme . '://' . $host . '/' . ltrim($path, '/'); + return Message::parseRequestUri($path, $headers); } /** - * Get a short summary of the message body + * Get a short summary of the message body. * * Will return `null` if the response is not printable. * * @param MessageInterface $message The message to get the body summary * @param int $truncateAt The maximum allowed size of the summary * - * @return null|string + * @return string|null + * + * @deprecated get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead. */ function get_message_body_summary(MessageInterface $message, $truncateAt = 120) { - $body = $message->getBody(); - - if (!$body->isSeekable() || !$body->isReadable()) { - return null; - } - - $size = $body->getSize(); - - if ($size === 0) { - return null; - } - - $summary = $body->read($truncateAt); - $body->rewind(); - - if ($size > $truncateAt) { - $summary .= ' (truncated...)'; - } - - // Matches any printable character, including unicode characters: - // letters, marks, numbers, punctuation, spacing, and separators. - if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) { - return null; - } - - return $summary; + return Message::bodySummary($message, $truncateAt); } -/** @internal */ +/** + * Remove the items given by the keys, case insensitively from the data. + * + * @param iterable<string> $keys + * + * @return array + * + * @internal + * + * @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead. + */ function _caseless_remove($keys, array $data) { - $result = []; - - foreach ($keys as &$key) { - $key = strtolower($key); - } - - foreach ($data as $k => $v) { - if (!in_array(strtolower($k), $keys)) { - $result[$k] = $v; - } - } - - return $result; + return Utils::caselessRemove($keys, $data); } diff --git a/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml b/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml new file mode 100644 index 0000000000..6d076b841a --- /dev/null +++ b/vendor/http-interop/http-factory-guzzle/.github/workflows/ci.yaml @@ -0,0 +1,60 @@ +name: CI + +on: + pull_request: + push: + branches: [ master ] + +jobs: + run: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + php: + - '7.3' + - '7.4' + - '8.0' + minimum_versions: [false] + coverage: ['none'] + include: + - description: 'Minimum version' + php: '7.3' + minimum_versions: true + - description: 'Log Code Coverage' + php: '8.0' + coverage: 'xdebug' + + name: PHP ${{ matrix.php }} ${{ matrix.description }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: ${{ matrix.php }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: ${{ matrix.coverage }} + + - name: Install dependencies + run: composer install + if: matrix.minimum_versions == false + + - name: Install dependencies (lowest versions) + run: composer update --no-interaction --prefer-lowest + if: matrix.minimum_versions == true + + - name: Run PHPUnit tests + run: vendor/bin/phpunit + + - name: Upload code coverage + uses: codecov/codecov-action@v2 + if: matrix.coverage == 'xdebug' + with: + file: './build/logs/clover.xml' + fail_ci_if_error: true diff --git a/vendor/http-interop/http-factory-guzzle/.gitignore b/vendor/http-interop/http-factory-guzzle/.gitignore deleted file mode 100644 index e2c2927c9b..0000000000 --- a/vendor/http-interop/http-factory-guzzle/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -composer.phar -composer.lock -phpunit.xml -build/ -vendor/ diff --git a/vendor/http-interop/http-factory-guzzle/.travis.yml b/vendor/http-interop/http-factory-guzzle/.travis.yml deleted file mode 100644 index 04c1853627..0000000000 --- a/vendor/http-interop/http-factory-guzzle/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - - vendor - -git: - depth: 1 - -matrix: - include: - - php: 7.0 - env: - - COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - -before_script: - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpunit - -after_script: - - bash -c '[[ -f "build/logs/clover.xml" ]] && wget https://scrutinizer-ci.com/ocular.phar' - - bash -c '[[ -f "build/logs/clover.xml" ]] && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml' diff --git a/vendor/http-interop/http-factory-guzzle/README.md b/vendor/http-interop/http-factory-guzzle/README.md index 6df50bcd9f..3e9197e433 100644 --- a/vendor/http-interop/http-factory-guzzle/README.md +++ b/vendor/http-interop/http-factory-guzzle/README.md @@ -1,3 +1,7 @@ # HTTP Factory for Guzzle HTTP factory implemented for [Guzzle](https://github.com/guzzle/psr7). + +**NOTE:** `guzzlehttp/psr7` includes an HTTP factory implementation starting with +version 2.0. Please use the official factory if your project can use +`"guzzlehttp/psr7": "^2.0"`. diff --git a/vendor/http-interop/http-factory-guzzle/composer.json b/vendor/http-interop/http-factory-guzzle/composer.json index 9414837a35..6956435a90 100644 --- a/vendor/http-interop/http-factory-guzzle/composer.json +++ b/vendor/http-interop/http-factory-guzzle/composer.json @@ -18,16 +18,20 @@ "psr/http-factory-implementation": "^1.0" }, "require": { + "php": ">=7.3", "psr/http-factory": "^1.0", - "guzzlehttp/psr7": "^1.4.2" + "guzzlehttp/psr7": "^1.7||^2.0" }, "require-dev": { - "http-interop/http-factory-tests": "^0.5", - "phpunit/phpunit": "^6.5" + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { "Http\\Factory\\Guzzle\\": "src/" } + }, + "suggest": { + "guzzlehttp/psr7": "Includes an HTTP factory starting in version 2.0" } } diff --git a/vendor/http-interop/http-factory-guzzle/phpunit.xml.dist b/vendor/http-interop/http-factory-guzzle/phpunit.xml.dist deleted file mode 100644 index 356f482463..0000000000 --- a/vendor/http-interop/http-factory-guzzle/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ -<phpunit backupGlobals="true" bootstrap="vendor/autoload.php" colors="true"> - <testsuites> - <testsuite name="Integration tests"> - <directory>vendor/http-interop/http-factory-tests/test</directory> - </testsuite> - </testsuites> - <php> - <const name="REQUEST_FACTORY" value="Http\Factory\Guzzle\RequestFactory"/> - <const name="RESPONSE_FACTORY" value="Http\Factory\Guzzle\ResponseFactory"/> - <const name="SERVER_REQUEST_FACTORY" value="Http\Factory\Guzzle\ServerRequestFactory"/> - <const name="STREAM_FACTORY" value="Http\Factory\Guzzle\StreamFactory"/> - <const name="UPLOADED_FILE_FACTORY" value="Http\Factory\Guzzle\UploadedFileFactory"/> - <const name="URI_FACTORY" value="Http\Factory\Guzzle\UriFactory"/> - </php> - <filter> - <whitelist> - <directory>./src/</directory> - </whitelist> - </filter> - <logging> - <log type="coverage-text" target="php://stdout"/> - <log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/> - <log type="coverage-clover" target="build/logs/clover.xml"/> - </logging> -</phpunit> diff --git a/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php b/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php index 23aee9fa57..6fe772e7f6 100644 --- a/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php +++ b/vendor/http-interop/http-factory-guzzle/src/StreamFactory.php @@ -2,6 +2,8 @@ namespace Http\Factory\Guzzle; +use GuzzleHttp\Psr7\Stream; +use GuzzleHttp\Psr7\Utils; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\StreamInterface; @@ -9,18 +11,16 @@ class StreamFactory implements StreamFactoryInterface { public function createStream(string $content = ''): StreamInterface { - return \GuzzleHttp\Psr7\stream_for($content); + return Utils::streamFor($content); } public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface { - $resource = \GuzzleHttp\Psr7\try_fopen($file, $mode); - - return \GuzzleHttp\Psr7\stream_for($resource); + return $this->createStreamFromResource(Utils::tryFopen($file, $mode)); } public function createStreamFromResource($resource): StreamInterface { - return \GuzzleHttp\Psr7\stream_for($resource); + return new Stream($resource); } } diff --git a/vendor/laminas/laminas-diactoros/CHANGELOG.md b/vendor/laminas/laminas-diactoros/CHANGELOG.md deleted file mode 100644 index 86026918be..0000000000 --- a/vendor/laminas/laminas-diactoros/CHANGELOG.md +++ /dev/null @@ -1,1701 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 2.2.3 - 2020-03-29 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Fixed `replace` version constraint in composer.json so repository can be used as replacement of `zendframework/zend-diactoros:^2.2.1`. - -## 2.2.2 - 2020-01-07 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#30](https://github.com/laminas/laminas-diactoros/pull/30) adds missing `return` statements to the various `src/functions/*.legacy.php` function files to ensure they work correctly when used. - -## 2.2.1 - 2019-11-13 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#379](https://github.com/zendframework/zend-diactoros/pull/379) removes extension of `SplFileInfo` by the `UploadedFile` class. The signatures of `getSize()` are potentially incompatible, and `UploadedFile` is intended to work with arbitrary PHP and PSR-7 streams, whereas `SplFileInfo` can only model files on the filesystem. While this is technically a BC break, we are treating it as a bugfix, as the class was broken for many use cases. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.2.0 - 2019-11-12 - -### Added - -- [zendframework/zend-diactoros#376](https://github.com/zendframework/zend-diactoros/pull/376) adds support for using the X-Forwarded-Host header for determining the originally requested host name when marshaling the server request. - -### Changed - -- [zendframework/zend-diactoros#378](https://github.com/zendframework/zend-diactoros/pull/378) updates the `UploadedFile` class to extend `SplFileInfo`, allowing developers to make use of those features in their applications. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.2.0 - 2019-11-08 - -### Added - -- [zendframework/zend-diactoros#377](https://github.com/zendframework/zend-diactoros/issues/377) enables UploadedFile to stand in and be used as an SplFileInfo object. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.1.5 - 2019-10-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#372](https://github.com/zendframework/zend-diactoros/pull/372) fixes issues that occur in the `Laminas\Diactoros\Uri` class when invalid UTF-8 characters are present the user-info, path, or query string, ensuring they are URL-encoded before being consumed. Previously, such characters could result in a fatal error, which was particularly problematic when marshaling the request URI for an application request cycle. - -## 2.1.4 - 2019-10-08 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#370](https://github.com/zendframework/zend-diactoros/pull/370) updates `Laminas\Diactoros\marshalHeadersFromSapi()` to ensure all underscores in header name keys are converted to dashes (fixing issues with header names such as `CONTENT_SECURITY_POLICY`, which would previously resolve improperly to `content-security_policy`). - -- [zendframework/zend-diactoros#370](https://github.com/zendframework/zend-diactoros/pull/370) updates `Laminas\Diactoros\marshalHeadersFromSapi()` to ignore header names from the `$server` array that resolve to integers; previously, it would raise a fatal error. - -## 2.1.3 - 2019-07-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#363](https://github.com/zendframework/zend-diactoros/issues/363) modifies detection of HTTPS schemas via the `$_SERVER['HTTPS']` value - such that an empty HTTPS-key will result in a scheme of `http` and not - `https`. - -## 2.1.2 - 2019-04-29 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#355](https://github.com/zendframework/zend-diactoros/pull/355) adds `phpdbg` to the list of accepted non-SAPI enviornments for purposes - of calling `UploadedFile::moveTo()`. - -## 2.1.1 - 2019-01-05 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#349](https://github.com/zendframework/zend-diactoros/pull/349) fixes an issue when marshaling headers with values of `0` or `0` from the SAPI, ensuring they are detected and injected into the ServerRequest properly. - -## 2.1.0 - 2018-12-20 - -### Added - -- [zendframework/zend-diactoros#345](https://github.com/zendframework/zend-diactoros/pull/345) adds support for PHP 7.3. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.0.3 - 2019-01-05 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#349](https://github.com/zendframework/zend-diactoros/pull/349) fixes an issue when marshaling headers with values of `0` or `0` from the - SAPI, ensuring they are detected and injected into the ServerRequest properly. - -## 2.0.2 - 2018-12-20 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#344](https://github.com/zendframework/zend-diactoros/pull/344) provides a fix to ensure that headers with a value of "0" are retained. - -## 2.0.1 - 2018-12-03 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#337](https://github.com/zendframework/zend-diactoros/pull/337) ensures that the `ServerRequestFactory::createServerRequest()` method - creates a `php://temp` stream instead of a `php::input` stream, in compliance - with the PSR-17 specification. - -## 2.0.0 - 2018-09-27 - -### Added - -- [zendframework/zend-diactoros#326](https://github.com/zendframework/zend-diactoros/pull/326) adds [PSR-17](https://www.php-fig.org/psr/psr-17/) HTTP Message Factory implementations, including: - - - `Laminas\Diactoros\RequestFactory` - - `Laminas\Diactoros\ResponseFactory` - - `Laminas\Diactoros\ServerRequestFactory` - - `Laminas\Diactoros\StreamFactory` - - `Laminas\Diactoros\UploadedFileFactory` - - `Laminas\Diactoros\UriFactory` - - These factories may be used to produce the associated instances; we encourage - users to rely on the PSR-17 factory interfaces to allow exchanging PSR-7 - implementations within their applications. - -- [zendframework/zend-diactoros#328](https://github.com/zendframework/zend-diactoros/pull/328) adds a package-level exception interface, `Laminas\Diactoros\Exception\ExceptionInterface`, - and several implementations for specific exceptions raised within the package. - These include: - - - `Laminas\Diactoros\Exception\DeserializationException` (extends `UnexpectedValueException`) - - `Laminas\Diactoros\Exception\InvalidArgumentException` (extends `InvalidArgumentException`) - - `Laminas\Diactoros\Exception\InvalidStreamPointerPositionException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\SerializationException` (extends `UnexpectedValueException`) - - `Laminas\Diactoros\Exception\UnreadableStreamException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UnrecognizedProtocolVersionException` (extends `UnexpectedValueException`) - - `Laminas\Diactoros\Exception\UnrewindableStreamException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UnseekableStreamException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UntellableStreamException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UnwritableStreamException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UploadedFileAlreadyMovedException` (extends `RuntimeException`) - - `Laminas\Diactoros\Exception\UploadedFileErrorException` (extends `RuntimeException`) - -### Changed - -- [zendframework/zend-diactoros#329](https://github.com/zendframework/zend-diactoros/pull/329) adds return type hints and scalar parameter type hints wherever possible. - The changes were done to help improve code quality, in part by reducing manual - type checking. If you are extending any classes, you may need to update your - signatures; check the signatures of the class(es) you are extending for changes. - -- [zendframework/zend-diactoros#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `Serializer\Request` such that it now no longer raises an `UnexpectedValueException` via its `toString()` method - when an unexpected HTTP method is encountered; this can be done safely, as the value can never - be invalid due to other changes in the same patch. - -- [zendframework/zend-diactoros#162](https://github.com/zendframework/zend-diactoros/pull/162) modifies `RequestTrait` such that it now invalidates non-string method arguments to either - the constructor or `withMethod()`, raising an `InvalidArgumentException` for any that do not validate. - -### Deprecated - -- Nothing. - -### Removed - -- [zendframework/zend-diactoros#308](https://github.com/zendframework/zend-diactoros/pull/308) removes the following methods from the `ServerRequestFactory` class: - - `normalizeServer()` (use `Laminas\Diactoros\normalizeServer()` instead) - - `marshalHeaders()` (use `Laminas\Diactoros\marshalHeadersFromSapi()` instead) - - `marshalUriFromServer()` (use `Laminas\Diactoros\marshalUriFromSapi()` instead) - - `marshalRequestUri()` (use `Uri::getPath()` from the `Uri` instance returned by `marshalUriFromSapi()` instead) - - `marshalHostAndPortFromHeaders()` (use `Uri::getHost()` and `Uri::getPort()` from the `Uri` instances returned by `marshalUriFromSapi()` instead) - - `stripQueryString()` (use `explode("?", $path, 2)[0]` instead) - - `normalizeFiles()` (use `Laminas\Diactoros\normalizeUploadedFiles()` instead) - -- [zendframework/zend-diactoros#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Laminas\Diactoros\Server`. You can use the `RequestHandlerRunner` class from - [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner) to provide these capabilities instead. - -- [zendframework/zend-diactoros#295](https://github.com/zendframework/zend-diactoros/pull/295) removes `Laminas\Diactoros\Response\EmitterInterface` and the various emitter implementations. - These can now be found in the package [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner/), which also provides - a PSR-7-implementation agnostic way of using them. - -### Fixed - -- Nothing. - -## 1.8.7 - 2019-08-06 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#364](https://github.com/zendframework/zend-diactoros/issues/364) modifies detection of HTTPS schemas via the `$_SERVER['HTTPS']` value - such that an empty HTTPS-key will result in a scheme of `http` and not - `https`. - -## 1.8.6 - 2018-09-05 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#325](https://github.com/zendframework/zend-diactoros/pull/325) changes the behavior of `ServerRequest::withParsedBody()`. Per -- PSR-7, it now no longer allows values other than `null`, arrays, or objects. - -- [zendframework/zend-diactoros#325](https://github.com/zendframework/zend-diactoros/pull/325) changes the behavior of each of `Request`, `ServerRequest`, and - `Response` in relation to the validation of header values. Previously, we - allowed empty arrays to be provided via `withHeader()`; however, this was - contrary to the PSR-7 specification. Empty arrays are no longer allowed. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#325](https://github.com/zendframework/zend-diactoros/pull/325) ensures that `Uri::withUserInfo()` no longer ignores values of - `0` (numeric zero). - -- [zendframework/zend-diactoros#325](https://github.com/zendframework/zend-diactoros/pull/325) fixes how header values are merged when calling - `withAddedHeader()`, ensuring that array keys are ignored. - -## 1.8.5 - 2018-08-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#324](https://github.com/zendframework/zend-diactoros/pull/324) fixes a reference - to an undefined variable in the `ServerRequestFactory`, which made it - impossible to fetch a specific header by name. - -## 1.8.4 - 2018-08-01 - -### Added - -- Nothing. - -### Changed - -- This release modifies how `ServerRequestFactory` marshals the request URI. In - prior releases, we would attempt to inspect the `X-Rewrite-Url` and - `X-Original-Url` headers, using their values, if present. These headers are - issued by the ISAPI_Rewrite module for IIS (developed by HeliconTech). - However, we have no way of guaranteeing that the module is what issued the - headers, making it an unreliable source for discovering the URI. As such, we - have removed this feature in this release of Diactoros. - - If you are developing a middleware application, you can mimic the - functionality via middleware as follows: - - ```php - use Psr\Http\Message\ResponseInterface; - use Psr\Http\Message\ServerRequestInterface; - use Psr\Http\Server\RequestHandlerInterface; - use Laminas\Diactoros\Uri; - - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface - { - $requestUri = null; - - $httpXRewriteUrl = $request->getHeaderLine('X-Rewrite-Url'); - if ($httpXRewriteUrl !== null) { - $requestUri = $httpXRewriteUrl; - } - - $httpXOriginalUrl = $request->getHeaderLine('X-Original-Url'); - if ($httpXOriginalUrl !== null) { - $requestUri = $httpXOriginalUrl; - } - - if ($requestUri !== null) { - $request = $request->withUri(new Uri($requestUri)); - } - - return $handler->handle($request); - } - ``` - - If you use middleware such as the above, make sure you also instruct your web - server to strip any incoming headers of the same name so that you can - guarantee they are issued by the ISAPI_Rewrite module. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.8.3 - 2018-07-24 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#321](https://github.com/zendframework/zend-diactoros/pull/321) updates the logic in `Uri::withPort()` to ensure that it checks that the - value provided is either an integer or a string integer, as only those values - may be cast to integer without data loss. - -- [zendframework/zend-diactoros#320](https://github.com/zendframework/zend-diactoros/pull/320) adds checking within `Response` to ensure that the provided reason - phrase is a string; an `InvalidArgumentException` is now raised if it is not. This change - ensures the class adheres strictly to the PSR-7 specification. - -- [zendframework/zend-diactoros#319](https://github.com/zendframework/zend-diactoros/pull/319) provides a fix to `Laminas\Diactoros\Response` that ensures that the status - code returned is _always_ an integer (and never a string containing an - integer), thus ensuring it strictly adheres to the PSR-7 specification. - -## 1.8.2 - 2018-07-19 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#318](https://github.com/zendframework/zend-diactoros/pull/318) fixes the logic for discovering whether an HTTPS scheme is in play - to be case insensitive when comparing header and SAPI values, ensuring no - false negative lookups occur. - -- [zendframework/zend-diactoros#314](https://github.com/zendframework/zend-diactoros/pull/314) modifies error handling around opening a file resource within - `Laminas\Diactoros\Stream::setStream()` to no longer use the second argument to - `set_error_handler()`, and instead check the error type in the handler itself; - this fixes an issue when the handler is nested inside another error handler, - which currently has buggy behavior within the PHP engine. - -## 1.8.1 - 2018-07-09 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#313](https://github.com/zendframework/zend-diactoros/pull/313) changes the reason phrase associated with the status code 425 - to "Too Early", corresponding to a new definition of the code as specified by the IANA. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#312](https://github.com/zendframework/zend-diactoros/pull/312) fixes how the `normalizeUploadedFiles()` utility function handles nested trees of - uploaded files, ensuring it detects them properly. - -## 1.8.0 - 2018-06-27 - -### Added - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) adds the following functions under the `Laminas\Diactoros` namespace, each of - which may be used to derive artifacts from SAPI supergloabls for the purposes - of generating a `ServerRequest` instance: - - `normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array` - (main purpose is to aggregate the `Authorization` header in the SAPI params - when under Apache) - - `marshalProtocolVersionFromSapi(array $server) : string` - - `marshalMethodFromSapi(array $server) : string` - - `marshalUriFromSapi(array $server, array $headers) : Uri` - - `marshalHeadersFromSapi(array $server) : array` - - `parseCookieHeader(string $header) : array` - - `createUploadedFile(array $spec) : UploadedFile` (creates the instance from - a normal `$_FILES` entry) - - `normalizeUploadedFiles(array $files) : UploadedFileInterface[]` (traverses - a potentially nested array of uploaded file instances and/or `$_FILES` - entries, including those aggregated under mod_php, php-fpm, and php-cgi in - order to create a flat array of `UploadedFileInterface` instances to use in a - request) - -### Changed - -- Nothing. - -### Deprecated - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::normalizeServer()`; the method is - no longer used internally, and users should instead use `Laminas\Diactoros\normalizeServer()`, - to which it proxies. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::marshalHeaders()`; the method is - no longer used internally, and users should instead use `Laminas\Diactoros\marshalHeadersFromSapi()`, - to which it proxies. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::marshalUriFromServer()`; the method - is no longer used internally. Users should use `marshalUriFromSapi()` instead. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::marshalRequestUri()`. the method is no longer - used internally, and currently proxies to `marshalUriFromSapi()`, pulling the - discovered path from the `Uri` instance returned by that function. Users - should use `marshalUriFromSapi()` instead. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::marshalHostAndPortFromHeaders()`; the method - is no longer used internally, and currently proxies to `marshalUriFromSapi()`, - pulling the discovered host and port from the `Uri` instance returned by that - function. Users should use `marshalUriFromSapi()` instead. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::getHeader()`; the method is no longer - used internally. Users should copy and paste the functionality into their own - applications if needed, or rely on headers from a fully-populated `Uri` - instance instead. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::stripQueryString()`; the method is no longer - used internally, and users can mimic the functionality via the expression - `$path = explode('?', $path, 2)[0];`. - -- [zendframework/zend-diactoros#307](https://github.com/zendframework/zend-diactoros/pull/307) deprecates `ServerRequestFactory::normalizeFiles()`; the functionality - is no longer used internally, and users can use `normalizeUploadedFiles()` as - a replacement. - -- [zendframework/zend-diactoros#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates `Laminas\Diactoros\Response\EmitterInterface` and its various implementations. These are now provided via the - [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner) package as 1:1 substitutions. - -- [zendframework/zend-diactoros#303](https://github.com/zendframework/zend-diactoros/pull/303) deprecates the `Laminas\Diactoros\Server` class. Users are directed to the `RequestHandlerRunner` class from the - [laminas/laminas-httphandlerrunner](https://docs.laminas.dev/laminas-httphandlerrunner) package as an alternative. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.7.2 - 2018-05-29 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#301](https://github.com/zendframework/zend-diactoros/pull/301) adds stricter comparisons within the `uri` class to ensure non-empty - values are not treated as empty. - -## 1.7.1 - 2018-02-26 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#293](https://github.com/zendframework/zend-diactoros/pull/293) updates - `Uri::getHost()` to cast the value via `strtolower()` before returning it. - While this represents a change, it is fixing a bug in our implementation: - the PSR-7 specification for the method, which follows IETF RFC 3986 section - 3.2.2, requires that the host name be normalized to lowercase. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#290](https://github.com/zendframework/zend-diactoros/pull/290) fixes - `Stream::getSize()` such that it checks that the result of `fstat` was - succesful before attempting to return its `size` member; in the case of an - error, it now returns `null`. - -## 1.7.0 - 2018-01-04 - -### Added - -- [zendframework/zend-diactoros#285](https://github.com/zendframework/zend-diactoros/pull/285) adds a new - custom response type, `Laminas\Diactoros\Response\XmlResponse`, for generating - responses representing XML. Usage is the same as with the `HtmlResponse` or - `TextResponse`; the response generated will have a `Content-Type: - application/xml` header by default. - -- [zendframework/zend-diactoros#280](https://github.com/zendframework/zend-diactoros/pull/280) adds the - response status code/phrase pairing "103 Early Hints" to the - `Response::$phrases` property. This is a new status proposed via - [RFC 8297](https://datatracker.ietf.org/doc/rfc8297/). - -- [zendframework/zend-diactoros#279](https://github.com/zendframework/zend-diactoros/pull/279) adds explicit - support for PHP 7.2; previously, we'd allowed build failures, though none - occured; we now require PHP 7.2 builds to pass. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.6.1 - 2017-10-12 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#273](https://github.com/zendframework/zend-diactoros/pull/273) updates each - of the SAPI emitter implementations to emit the status line after emitting - other headers; this is done to ensure that the status line is not overridden - by PHP. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#273](https://github.com/zendframework/zend-diactoros/pull/273) modifies how - the `SapiEmitterTrait` calls `header()` to ensure that a response code is - _always_ passed as the third argument; this is done to prevent PHP from - silently overriding it. - -## 1.6.0 - 2017-09-13 - -### Added - -- Nothing. - -### Changed - -- [zendframework/zend-diactoros#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the - behavior of `Laminas\Diactoros\Server`: it no longer creates an output buffer. - -- [zendframework/zend-diactoros#270](https://github.com/zendframework/zend-diactoros/pull/270) changes the - behavior of the two SAPI emitters in two backwards-incompatible ways: - - - They no longer auto-inject a `Content-Length` header. If you need this - functionality, mezzio/mezzio-helpers 4.1+ provides it via - `Mezzio\Helper\ContentLengthMiddleware`. - - - They no longer flush the output buffer. Instead, if headers have been sent, - or the output buffer exists and has a non-zero length, the emitters raise an - exception, as mixed PSR-7/output buffer content creates a blocking issue. - If you are emitting content via `echo`, `print`, `var_dump`, etc., or not - catching PHP errors or exceptions, you will need to either fix your - application to always work with a PSR-7 response, or provide your own - emitters that allow mixed output mechanisms. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.5.0 - 2017-08-22 - -### Added - -- [zendframework/zend-diactoros#205](https://github.com/zendframework/zend-diactoros/pull/205) adds support - for PHP 7.2. - -- [zendframework/zend-diactoros#250](https://github.com/zendframework/zend-diactoros/pull/250) adds a new - API to `JsonResponse` to avoid the need for decoding the response body in - order to make changes to the underlying content. New methods include: - - `getPayload()`: retrieve the unencoded payload. - - `withPayload($data)`: create a new instance with the given data. - - `getEncodingOptions()`: retrieve the flags to use when encoding the payload - to JSON. - - `withEncodingOptions(int $encodingOptions)`: create a new instance that uses - the provided flags when encoding the payload to JSON. - -### Changed - -- [zendframework/zend-diactoros#249](https://github.com/zendframework/zend-diactoros/pull/249) changes the - behavior of the various `Uri::with*()` methods slightly: if the value - represents no change, these methods will return the same instance instead of a - new one. - -- [zendframework/zend-diactoros#248](https://github.com/zendframework/zend-diactoros/pull/248) changes the - behavior of `Uri::getUserInfo()` slightly: it now (correctly) returns the - percent-encoded values for the user and/or password, per RFC 3986 Section - 3.2.1. `withUserInfo()` will percent-encode values, using a mechanism that - prevents double-encoding. - -- [zendframework/zend-diactoros#243](https://github.com/zendframework/zend-diactoros/pull/243) changes the - exception messages thrown by `UploadedFile::getStream()` and `moveTo()` when - an upload error exists to include details about the upload error. - -- [zendframework/zend-diactoros#233](https://github.com/zendframework/zend-diactoros/pull/233) adds a new - argument to `SapiStreamEmitter::emit`, `$maxBufferLevel` **between** the - `$response` and `$maxBufferLength` arguments. This was done because the - `Server::listen()` method passes only the response and `$maxBufferLevel` to - emitters; previously, this often meant that streams were being chunked 2 bytes - at a time versus the expected default of 8kb. - - If you were calling the `SapiStreamEmitter::emit()` method manually - previously, you will need to update your code. - -### Deprecated - -- Nothing. - -### Removed - -- [zendframework/zend-diactoros#205](https://github.com/zendframework/zend-diactoros/pull/205) and - [zendframework/zend-diactoros#243](https://github.com/zendframework/zend-diactoros/pull/243) **remove - support for PHP versions prior to 5.6 as well as HHVM**. - -### Fixed - -- [zendframework/zend-diactoros#248](https://github.com/zendframework/zend-diactoros/pull/248) fixes how the - `Uri` class provides user-info within the URI authority; the value is now - correctly percent-encoded , per RFC 3986 Section 3.2.1. - -## 1.4.1 - 2017-08-17 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [zendframework/zend-diactoros#260](https://github.com/zendframework/zend-diactoros/pull/260) removes - support for HHVM, as tests have failed against it for some time. - -### Fixed - -- [zendframework/zend-diactoros#247](https://github.com/zendframework/zend-diactoros/pull/247) fixes the - `Stream` and `RelativeStream` `__toString()` method implementations to check - if the stream `isSeekable()` before attempting to `rewind()` it, ensuring that - the method does not raise exceptions (PHP does not allow exceptions in that - method). In particular, this fixes an issue when using AWS S3 streams. - -- [zendframework/zend-diactoros#252](https://github.com/zendframework/zend-diactoros/pull/252) provides a - fix to the `SapiEmitterTrait` to ensure that any `Set-Cookie` headers in the - response instance do not override those set by PHP when a session is created - and/or regenerated. - -- [zendframework/zend-diactoros#257](https://github.com/zendframework/zend-diactoros/pull/257) provides a - fix for the `PhpInputStream::read()` method to ensure string content that - evaluates as empty (including `0`) is still cached. - -- [zendframework/zend-diactoros#258](https://github.com/zendframework/zend-diactoros/pull/258) updates the - `Uri::filterPath()` method to allow parens within a URI path, per [RFC 3986 - section 3.3](https://tools.ietf.org/html/rfc3986#section-3.3) (parens are - within the character set "sub-delims"). - -## 1.4.0 - 2017-04-06 - -### Added - -- [zendframework/zend-diactoros#219](https://github.com/zendframework/zend-diactoros/pull/219) adds two new - classes, `Laminas\Diactoros\Request\ArraySerializer` and - `Laminas\Diactoros\Response\ArraySerializer`. Each exposes the static methods - `toArray()` and `fromArray()`, allowing de/serialization of messages from and - to arrays. - -- [zendframework/zend-diactoros#236](https://github.com/zendframework/zend-diactoros/pull/236) adds two new - constants to the `Response` class: `MIN_STATUS_CODE_VALUE` and - `MAX_STATUS_CODE_VALUE`. - -### Changes - -- [zendframework/zend-diactoros#240](https://github.com/zendframework/zend-diactoros/pull/240) changes the - behavior of `ServerRequestFactory::fromGlobals()` when no `$cookies` argument - is present. Previously, it would use `$_COOKIES`; now, if a `Cookie` header is - present, it will parse and use that to populate the instance instead. - - This change allows utilizing cookies that contain period characters (`.`) in - their names (PHP's built-in cookie handling renames these to replace `.` with - `_`, which can lead to synchronization issues with clients). - -- [zendframework/zend-diactoros#235](https://github.com/zendframework/zend-diactoros/pull/235) changes the - behavior of `Uri::__toString()` to better follow proscribed behavior in PSR-7. - In particular, prior to this release, if a scheme was missing but an authority - was present, the class was incorrectly returning a value that did not include - a `//` prefix. As of this release, it now does this correctly. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.3.11 - 2017-04-06 - -### Added - -- Nothing. - -### Changes - -- [zendframework/zend-diactoros#241](https://github.com/zendframework/zend-diactoros/pull/241) changes the - constraint by which the package provides `psr/http-message-implementation` to - simply `1.0` instead of `~1.0.0`, to follow how other implementations provide - PSR-7. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#161](https://github.com/zendframework/zend-diactoros/pull/161) adds - additional validations to header names and values to ensure no malformed values - are provided. - -- [zendframework/zend-diactoros#234](https://github.com/zendframework/zend-diactoros/pull/234) fixes a - number of reason phrases in the `Response` instance, and adds automation from - the canonical IANA sources to ensure any new phrases added are correct. - -## 1.3.10 - 2017-01-23 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#226](https://github.com/zendframework/zend-diactoros/pull/226) fixed an - issue with the `SapiStreamEmitter` causing the response body to be cast - to `(string)` and also be read as a readable stream, potentially producing - double output. - -## 1.3.9 - 2017-01-17 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#223](https://github.com/zendframework/zend-diactoros/issues/223) - [zendframework/zend-diactoros#224](https://github.com/zendframework/zend-diactoros/pull/224) fixed an issue - with the `SapiStreamEmitter` consuming too much memory when producing output - for readable bodies. - -## 1.3.8 - 2017-01-05 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#222](https://github.com/zendframework/zend-diactoros/pull/222) fixes the - `SapiStreamEmitter`'s handling of the `Content-Range` header to properly only - emit a range of bytes if the header value is in the form `bytes {first-last}/length`. - This allows using other range units, such as `items`, without incorrectly - emitting truncated content. - -## 1.3.7 - 2016-10-11 - -### Added - -- [zendframework/zend-diactoros#208](https://github.com/zendframework/zend-diactoros/pull/208) adds several - missing response codes to `Laminas\Diactoros\Response`, including: - - 226 ('IM used') - - 308 ('Permanent Redirect') - - 444 ('Connection Closed Without Response') - - 499 ('Client Closed Request') - - 510 ('Not Extended') - - 599 ('Network Connect Timeout Error') -- [zendframework/zend-diactoros#211](https://github.com/zendframework/zend-diactoros/pull/211) adds support - for UTF-8 characters in query strings handled by `Laminas\Diactoros\Uri`. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.3.6 - 2016-09-07 - -### Added - -- [zendframework/zend-diactoros#170](https://github.com/zendframework/zend-diactoros/pull/170) prepared - documentation for publication at https://docs.laminas.dev/laminas-diactoros/ -- [zendframework/zend-diactoros#165](https://github.com/zendframework/zend-diactoros/pull/165) adds support - for Apache `REDIRECT_HTTP_*` header detection in the `ServerRequestFactory`. -- [zendframework/zend-diactoros#166](https://github.com/zendframework/zend-diactoros/pull/166) adds support - for UTF-8 characters in URI paths. -- [zendframework/zend-diactoros#204](https://github.com/zendframework/zend-diactoros/pull/204) adds testing - against PHP 7.1 release-candidate builds. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#186](https://github.com/zendframework/zend-diactoros/pull/186) fixes a typo - in a variable name within the `SapiStreamEmitter`. -- [zendframework/zend-diactoros#200](https://github.com/zendframework/zend-diactoros/pull/200) updates the - `SapiStreamEmitter` to implement a check for `isSeekable()` prior to attempts - to rewind; this allows it to work with non-seekable streams such as the - `CallbackStream`. -- [zendframework/zend-diactoros#169](https://github.com/zendframework/zend-diactoros/pull/169) ensures that - response serialization always provides a `\r\n\r\n` sequence following the - headers, even when no message body is present, to ensure it conforms with RFC - 7230. -- [zendframework/zend-diactoros#175](https://github.com/zendframework/zend-diactoros/pull/175) updates the - `Request` class to set the `Host` header from the URI host if no header is - already present. (Ensures conformity with PSR-7 specification.) -- [zendframework/zend-diactoros#197](https://github.com/zendframework/zend-diactoros/pull/197) updates the - `Uri` class to ensure that string serialization does not include a colon after - the host name if no port is present in the instance. - -## 1.3.5 - 2016-03-17 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#160](https://github.com/zendframework/zend-diactoros/pull/160) fixes HTTP - protocol detection in the `ServerRequestFactory` to work correctly with HTTP/2. - -## 1.3.4 - 2016-03-17 - -### Added - -- [zendframework/zend-diactoros#119](https://github.com/zendframework/zend-diactoros/pull/119) adds the 451 - (Unavailable for Legal Reasons) status code to the `Response` class. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#117](https://github.com/zendframework/zend-diactoros/pull/117) provides - validation of the HTTP protocol version. -- [zendframework/zend-diactoros#127](https://github.com/zendframework/zend-diactoros/pull/127) now properly - removes attributes with `null` values when calling `withoutAttribute()`. -- [zendframework/zend-diactoros#132](https://github.com/zendframework/zend-diactoros/pull/132) updates the - `ServerRequestFactory` to marshal the request path fragment, if present. -- [zendframework/zend-diactoros#142](https://github.com/zendframework/zend-diactoros/pull/142) updates the - exceptions thrown by `HeaderSecurity` to include the header name and/or - value. -- [zendframework/zend-diactoros#148](https://github.com/zendframework/zend-diactoros/pull/148) fixes several - stream operations to ensure they raise exceptions when the internal pointer - is at an invalid position. -- [zendframework/zend-diactoros#151](https://github.com/zendframework/zend-diactoros/pull/151) ensures - URI fragments are properly encoded. - -## 1.3.3 - 2016-01-04 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#135](https://github.com/zendframework/zend-diactoros/pull/135) fixes the - behavior of `ServerRequestFactory::marshalHeaders()` to no longer omit - `Cookie` headers from the aggregated headers. While the values are parsed and - injected into the cookie params, it's useful to have access to the raw headers - as well. - -## 1.3.2 - 2015-12-22 - -### Added - -- [zendframework/zend-diactoros#124](https://github.com/zendframework/zend-diactoros/pull/124) adds four - more optional arguments to the `ServerRequest` constructor: - - `array $cookies` - - `array $queryParams` - - `null|array|object $parsedBody` - - `string $protocolVersion` - `ServerRequestFactory` was updated to pass values for each of these parameters - when creating an instance, instead of using the related `with*()` methods on - an instance. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#122](https://github.com/zendframework/zend-diactoros/pull/122) updates the - `ServerRequestFactory` to retrieve the HTTP protocol version and inject it in - the generated `ServerRequest`, which previously was not performed. - -## 1.3.1 - 2015-12-16 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#113](https://github.com/zendframework/zend-diactoros/pull/113) fixes an - issue in the response serializer, ensuring that the status code in the - deserialized response is an integer. -- [zendframework/zend-diactoros#115](https://github.com/zendframework/zend-diactoros/pull/115) fixes an - issue in the various text-basd response types (`TextResponse`, `HtmlResponse`, - and `JsonResponse`); due to the fact that the constructor was not - rewinding the message body stream, `getContents()` was thus returning `null`, - as the pointer was at the end of the stream. The constructor now rewinds the - stream after populating it in the constructor. - -## 1.3.0 - 2015-12-15 - -### Added - -- [zendframework/zend-diactoros#110](https://github.com/zendframework/zend-diactoros/pull/110) adds - `Laminas\Diactoros\Response\SapiEmitterTrait`, which provides the following - private method definitions: - - `injectContentLength()` - - `emitStatusLine()` - - `emitHeaders()` - - `flush()` - - `filterHeader()` - The `SapiEmitter` implementation has been updated to remove those methods and - instead compose the trait. -- [zendframework/zend-diactoros#111](https://github.com/zendframework/zend-diactoros/pull/111) adds - a new emitter implementation, `SapiStreamEmitter`; this emitter type will - loop through the stream instead of emitting it in one go, and supports content - ranges. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.2.1 - 2015-12-15 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#101](https://github.com/zendframework/zend-diactoros/pull/101) fixes the - `withHeader()` implementation to ensure that if the header existed previously - but using a different casing strategy, the previous version will be removed - in the cloned instance. -- [zendframework/zend-diactoros#103](https://github.com/zendframework/zend-diactoros/pull/103) fixes the - constructor of `Response` to ensure that null status codes are not possible. -- [zendframework/zend-diactoros#99](https://github.com/zendframework/zend-diactoros/pull/99) fixes - validation of header values submitted via request and response constructors as - follows: - - numeric (integer and float) values are now properly allowed (this solves - some reported issues with setting Content-Length headers) - - invalid header names (non-string values or empty strings) now raise an - exception. - - invalid individual header values (non-string, non-numeric) now raise an - exception. - -## 1.2.0 - 2015-11-24 - -### Added - -- [zendframework/zend-diactoros#88](https://github.com/zendframework/zend-diactoros/pull/88) updates the - `SapiEmitter` to emit a `Content-Length` header with the content length as - reported by the response body stream, assuming that - `StreamInterface::getSize()` returns an integer. -- [zendframework/zend-diactoros#77](https://github.com/zendframework/zend-diactoros/pull/77) adds a new - response type, `Laminas\Diactoros\Response\TextResponse`, for returning plain - text responses. By default, it sets the content type to `text/plain; - charset=utf-8`; per the other response types, the signature is `new - TextResponse($text, $status = 200, array $headers = [])`. -- [zendframework/zend-diactoros#90](https://github.com/zendframework/zend-diactoros/pull/90) adds a new - `Laminas\Diactoros\CallbackStream`, allowing you to back a stream with a PHP - callable (such as a generator) to generate the message content. Its - constructor accepts the callable: `$stream = new CallbackStream($callable);` - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#77](https://github.com/zendframework/zend-diactoros/pull/77) updates the - `HtmlResponse` to set the charset to utf-8 by default (if no content type - header is provided at instantiation). - -## 1.1.4 - 2015-10-16 - -### Added - -- [zendframework/zend-diactoros#98](https://github.com/zendframework/zend-diactoros/pull/98) adds - `JSON_UNESCAPED_SLASHES` to the default `json_encode` flags used by - `Laminas\Diactoros\Response\JsonResponse`. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#96](https://github.com/zendframework/zend-diactoros/pull/96) updates - `withPort()` to allow `null` port values (indicating usage of default for - the given scheme). -- [zendframework/zend-diactoros#91](https://github.com/zendframework/zend-diactoros/pull/91) fixes the - logic of `withUri()` to do a case-insensitive check for an existing `Host` - header, replacing it with the new one. - -## 1.1.3 - 2015-08-10 - -### Added - -- [zendframework/zend-diactoros#73](https://github.com/zendframework/zend-diactoros/pull/73) adds caching of - the vendor directory to the Travis-CI configuration, to speed up builds. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#71](https://github.com/zendframework/zend-diactoros/pull/71) fixes the - docblock of the `JsonResponse` constructor to typehint the `$data` argument - as `mixed`. -- [zendframework/zend-diactoros#73](https://github.com/zendframework/zend-diactoros/pull/73) changes the - behavior in `Request` such that if it marshals a stream during instantiation, - the stream is marked as writeable (specifically, mode `wb+`). -- [zendframework/zend-diactoros#85](https://github.com/zendframework/zend-diactoros/pull/85) updates the - behavior of `Laminas\Diactoros\Uri`'s various `with*()` methods that are - documented as accepting strings to raise exceptions on non-string input. - Previously, several simply passed non-string input on verbatim, others - normalized the input, and a few correctly raised the exceptions. Behavior is - now consistent across each. -- [zendframework/zend-diactoros#87](https://github.com/zendframework/zend-diactoros/pull/87) fixes - `UploadedFile` to ensure that `moveTo()` works correctly in non-SAPI - environments when the file provided to the constructor is a path. - -## 1.1.2 - 2015-07-12 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#67](https://github.com/zendframework/zend-diactoros/pull/67) ensures that - the `Stream` class only accepts `stream` resources, not any resource. - -## 1.1.1 - 2015-06-25 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#64](https://github.com/zendframework/zend-diactoros/pull/64) fixes the - behavior of `JsonResponse` with regards to serialization of `null` and scalar - values; the new behavior is to serialize them verbatim, without any casting. - -## 1.1.0 - 2015-06-24 - -### Added - -- [zendframework/zend-diactoros#52](https://github.com/zendframework/zend-diactoros/pull/52), - [zendframework/zend-diactoros#58](https://github.com/zendframework/zend-diactoros/pull/58), - [zendframework/zend-diactoros#59](https://github.com/zendframework/zend-diactoros/pull/59), and - [zendframework/zend-diactoros#61](https://github.com/zendframework/zend-diactoros/pull/61) create several - custom response types for simplifying response creation: - - - `Laminas\Diactoros\Response\HtmlResponse` accepts HTML content via its - constructor, and sets the `Content-Type` to `text/html`. - - `Laminas\Diactoros\Response\JsonResponse` accepts data to serialize to JSON via - its constructor, and sets the `Content-Type` to `application/json`. - - `Laminas\Diactoros\Response\EmptyResponse` allows creating empty, read-only - responses, with a default status code of 204. - - `Laminas\Diactoros\Response\RedirectResponse` allows specifying a URI for the - `Location` header in the constructor, with a default status code of 302. - - Each also accepts an optional status code, and optional headers (which can - also be used to provide an alternate `Content-Type` in the case of the HTML - and JSON responses). - -### Deprecated - -- Nothing. - -### Removed - -- [zendframework/zend-diactoros#43](https://github.com/zendframework/zend-diactoros/pull/43) removed both - `ServerRequestFactory::marshalUri()` and `ServerRequestFactory::marshalHostAndPort()`, - which were deprecated prior to the 1.0 release. - -### Fixed - -- [zendframework/zend-diactoros#29](https://github.com/zendframework/zend-diactoros/pull/29) fixes request - method validation to allow any valid token as defined by [RFC - 7230](http://tools.ietf.org/html/rfc7230#appendix-B). This allows usage of - custom request methods, vs a static, hard-coded list. - -## 1.0.5 - 2015-06-24 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#60](https://github.com/zendframework/zend-diactoros/pull/60) fixes - the behavior of `UploadedFile` when the `$errorStatus` provided at - instantiation is not `UPLOAD_ERR_OK`. Prior to the fix, an - `InvalidArgumentException` would occur at instantiation due to the fact that - the upload file was missing or invalid. With the fix, no exception is raised - until a call to `moveTo()` or `getStream()` is made. - -## 1.0.4 - 2015-06-23 - -This is a security release. - -A patch has been applied to `Laminas\Diactoros\Uri::filterPath()` that ensures that -paths can only begin with a single leading slash. This prevents the following -potential security issues: - -- XSS vectors. If the URI path is used for links or form targets, this prevents - cases where the first segment of the path resembles a domain name, thus - creating scheme-relative links such as `//example.com/foo`. With the patch, - the leading double slash is reduced to a single slash, preventing the XSS - vector. -- Open redirects. If the URI path is used for `Location` or `Link` headers, - without a scheme and authority, potential for open redirects exist if clients - do not prepend the scheme and authority. Again, preventing a double slash - corrects the vector. - -If you are using `Laminas\Diactoros\Uri` for creating links, form targets, or -redirect paths, and only using the path segment, we recommend upgrading -immediately. - -### Added - -- [zendframework/zend-diactoros#25](https://github.com/zendframework/zend-diactoros/pull/25) adds - documentation. Documentation is written in markdown, and can be converted to - HTML using [bookdown](http://bookdown.io). New features now MUST include - documentation for acceptance. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#51](https://github.com/zendframework/zend-diactoros/pull/51) fixes - `MessageTrait::getHeaderLine()` to return an empty string instead of `null` if - the header is undefined (which is the behavior specified in PSR-7). -- [zendframework/zend-diactoros#57](https://github.com/zendframework/zend-diactoros/pull/57) fixes the - behavior of how the `ServerRequestFactory` marshals upload files when they are - represented as a nested associative array. -- [zendframework/zend-diactoros#49](https://github.com/zendframework/zend-diactoros/pull/49) provides several - fixes that ensure that Diactoros complies with the PSR-7 specification: - - `MessageInterface::getHeaderLine()` MUST return a string (that string CAN be - empty). Previously, Diactoros would return `null`. - - If no `Host` header is set, the `$preserveHost` flag MUST be ignored when - calling `withUri()` (previously, Diactoros would not set the `Host` header - if `$preserveHost` was `true`, but no `Host` header was present). - - The request method MUST be a string; it CAN be empty. Previously, Diactoros - would return `null`. - - The request MUST return a `UriInterface` instance from `getUri()`; that - instance CAN be empty. Previously, Diactoros would return `null`; now it - lazy-instantiates an empty `Uri` instance on initialization. -- [ZF2015-05](https://getlaminas.org/security/advisory/ZF2015-05) was - addressed by altering `Uri::filterPath()` to prevent emitting a path prepended - with multiple slashes. - -## 1.0.3 - 2015-06-04 - -### Added - -- [zendframework/zend-diactoros#48](https://github.com/zendframework/zend-diactoros/pull/48) drops the - minimum supported PHP version to 5.4, to allow an easier upgrade path for - Symfony 2.7 users, and potential Drupal 8 usage. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.0.2 - 2015-06-04 - -### Added - -- [zendframework/zend-diactoros#27](https://github.com/zendframework/zend-diactoros/pull/27) adds phonetic - pronunciation of "Diactoros" to the README file. -- [zendframework/zend-diactoros#36](https://github.com/zendframework/zend-diactoros/pull/36) adds property - annotations to the class-level docblock of `Laminas\Diactoros\RequestTrait` to - ensure properties inherited from the `MessageTrait` are inherited by - implementations. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. -- -### Fixed - -- [zendframework/zend-diactoros#41](https://github.com/zendframework/zend-diactoros/pull/41) fixes the - namespace for test files to begin with `LaminasTest` instead of `Laminas`. -- [zendframework/zend-diactoros#46](https://github.com/zendframework/zend-diactoros/pull/46) ensures that - the cookie and query params for the `ServerRequest` implementation are - initialized as arrays. -- [zendframework/zend-diactoros#47](https://github.com/zendframework/zend-diactoros/pull/47) modifies the - internal logic in `HeaderSecurity::isValid()` to use a regular expression - instead of character-by-character comparisons, improving performance. - -## 1.0.1 - 2015-05-26 - -### Added - -- [zendframework/zend-diactoros#10](https://github.com/zendframework/zend-diactoros/pull/10) adds - `Laminas\Diactoros\RelativeStream`, which will return stream contents relative to - a given offset (i.e., a subset of the stream). `AbstractSerializer` was - updated to create a `RelativeStream` when creating the body of a message, - which will prevent duplication of the stream in-memory. -- [zendframework/zend-diactoros#21](https://github.com/zendframework/zend-diactoros/pull/21) adds a - `.gitattributes` file that excludes directories and files not needed for - production; this will further minify the package for production use cases. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zendframework/zend-diactoros#9](https://github.com/zendframework/zend-diactoros/pull/9) ensures that - attributes are initialized to an empty array, ensuring that attempts to - retrieve single attributes when none are defined will not produce errors. -- [zendframework/zend-diactoros#14](https://github.com/zendframework/zend-diactoros/pull/14) updates - `Laminas\Diactoros\Request` to use a `php://temp` stream by default instead of - `php://memory`, to ensure requests do not create an out-of-memory condition. -- [zendframework/zend-diactoros#15](https://github.com/zendframework/zend-diactoros/pull/15) updates - `Laminas\Diactoros\Stream` to ensure that write operations trigger an exception - if the stream is not writeable. Additionally, it adds more robust logic for - determining if a stream is writeable. - -## 1.0.0 - 2015-05-21 - -First stable release, and first release as `laminas-diactoros`. - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. diff --git a/vendor/laminas/laminas-diactoros/COPYRIGHT.md b/vendor/laminas/laminas-diactoros/COPYRIGHT.md index f68704698d..0a8cccc06b 100644 --- a/vendor/laminas/laminas-diactoros/COPYRIGHT.md +++ b/vendor/laminas/laminas-diactoros/COPYRIGHT.md @@ -1,2 +1 @@ -Copyright (c) 2019-2020, Laminas Foundation. -All rights reserved. (https://getlaminas.org/) +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/) diff --git a/vendor/laminas/laminas-diactoros/LICENSE.md b/vendor/laminas/laminas-diactoros/LICENSE.md index 16fe8690cc..10b40f1423 100644 --- a/vendor/laminas/laminas-diactoros/LICENSE.md +++ b/vendor/laminas/laminas-diactoros/LICENSE.md @@ -1,5 +1,4 @@ -Copyright (c) 2019-2020, Laminas Foundation -All rights reserved. +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/vendor/laminas/laminas-diactoros/README.md b/vendor/laminas/laminas-diactoros/README.md index 1319b2bc7c..078bd50e06 100644 --- a/vendor/laminas/laminas-diactoros/README.md +++ b/vendor/laminas/laminas-diactoros/README.md @@ -1,11 +1,22 @@ # laminas-diactoros -Master: -[![Build status][Master image]][Master] -[![Coverage Status][Master coverage image]][Master coverage] -Develop: -[![Build status][Develop image]][Develop] -[![Coverage Status][Develop coverage image]][Develop coverage] +[![Build Status](https://github.com/laminas/laminas-diactoros/workflows/Continuous%20Integration/badge.svg)](https://github.com/laminas/laminas-diactoros/actions/workflows/continuous-integration.yml) + +> ## 🇷🇺 РуÑÑким гражданам +> +> Мы, учаÑтники Laminas, родилиÑÑŒ и живем в разных Ñтранах. У многих из Ð½Ð°Ñ ÐµÑть друзьÑ, родÑтвенники и коллеги как в РоÑÑии, так и в Украине. Ðекоторые из Ð½Ð°Ñ Ñ€Ð¾Ð´Ð¸Ð»Ð¸ÑÑŒ в РоÑÑии. Ðекоторые из Ð½Ð°Ñ Ð¶Ð¸Ð²ÑƒÑ‚ в РоÑÑии. У некоторых бабушки и дедушки ÑражалиÑÑŒ Ñ Ñ„Ð°ÑˆÐ¸Ñтами во Второй мировой войне. ЗдеÑÑŒ никто не поддерживает фашизм. +> +> У одного из Ð½Ð°Ñ ÐµÑть украинÑÐºÐ°Ñ Ñ€Ð¾Ð´Ñтвенница, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ ÑпаÑлаÑÑŒ из дома вмеÑте Ñ Ñыном. Поезд задержалÑÑ Ð¸Ð·-за бомбежки на дороге впереди. У Ð½Ð°Ñ ÐµÑть друзьÑ, которые прÑчутÑÑ Ð² бомбоубежищах. Мы Ñ Ñ‚Ñ€ÐµÐ²Ð¾Ð³Ð¾Ð¹ ждем веÑточки от них поÑле воздушных налетов, которые беÑпорÑдочно наноÑÑÑ‚ удары и попадают по больницам, школам, детÑким Ñадам и домам. Мы не берем Ñто из каких-либо СМИ. Мы наблюдаем Ñто напрÑмую. +> +> Ð’Ñ‹ доверÑете нам доÑтаточно, чтоб иÑпользовать наши программы, и мы проÑим Ð²Ð°Ñ Ð´Ð¾Ð²ÐµÑ€Ð¸Ñ‚ÑŒÑÑ Ð½Ð°Ð¼ вновь. Мы нуждаемÑÑ Ð² помощи. Выходите и протеÑтуйте против Ñтой беÑполезной войны. ОÑтановите кровопролитие. Скажите "Ðет войне!" +> +> ## 🇺🇸 To Citizens of Russia +> +> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. +> +> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. +> +> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!" > Diactoros (pronunciation: `/dɪʌktÉ’rÉ’s/`): an epithet for Hermes, meaning literally, "the messenger." @@ -15,8 +26,8 @@ This package supercedes and replaces [phly/http](https://github.com/phly/http). [PSR-7 HTTP message interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md) and [PSR-17 HTTP message factory interfaces](https://www.php-fig.org/psr/psr-17). -* File issues at https://github.com/laminas/laminas-diactoros/issues -* Issue patches to https://github.com/laminas/laminas-diactoros/pulls +- File issues at https://github.com/laminas/laminas-diactoros/issues +- Issue patches to https://github.com/laminas/laminas-diactoros/pulls ## Documentation @@ -26,11 +37,10 @@ Documentation is available at: Source files for documentation are [in the docs/ tree](docs/). - [Master]: https://travis-ci.com/laminas/laminas-diactoros - [Master image]: https://travis-ci.com/laminas/laminas-diactoros.svg?branch=master - [Master coverage image]: https://img.shields.io/coveralls/laminas/laminas-diactoros/master.svg - [Master coverage]: https://coveralls.io/r/laminas/laminas-diactoros?branch=master - [Develop]: https://github.com/laminas/laminas-diactoros/tree/develop - [Develop image]: https://travis-ci.com/laminas/laminas-diactoros.svg?branch=develop - [Develop coverage image]: https://coveralls.io/repos/laminas/laminas-diactoros/badge.svg?branch=develop - [Develop coverage]: https://coveralls.io/r/laminas/laminas-diactoros?branch=develop +----- + +## Contributing and Support + +- If you need support with the project, read [the support documentation](https://github.com/laminas/.github/blob/main/SUPPORT.md). +- If you wish to contribute to the project, read the [contributing guidelines](https://github.com/laminas/.github/blob/main/CONTRIBUTING.md) as well as the [Code of Conduct](https://github.com/laminas/.github/blob/main/CODE_OF_CONDUCT.md). +- For reporting security issues, please review our [security policy](https://github.com/laminas/.github/blob/main/SECURITY.md). diff --git a/vendor/laminas/laminas-diactoros/composer.json b/vendor/laminas/laminas-diactoros/composer.json index 9f0526c58e..322f54bf6e 100644 --- a/vendor/laminas/laminas-diactoros/composer.json +++ b/vendor/laminas/laminas-diactoros/composer.json @@ -6,7 +6,8 @@ "laminas", "http", "psr", - "psr-7" + "psr-7", + "psr-17" ], "homepage": "https://laminas.dev", "support": { @@ -18,36 +19,43 @@ "forum": "https://discourse.laminas.dev" }, "config": { - "sort-packages": true + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "sort-packages": true, + "platform": { + "php": "8.0.99" + } }, "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev", - "dev-develop": "2.2.x-dev", - "dev-release-1.8": "1.8.x-dev" + "laminas": { + "config-provider": "Laminas\\Diactoros\\ConfigProvider", + "module": "Laminas\\Diactoros" } }, "require": { - "php": "^7.1", - "laminas/laminas-zendframework-bridge": "^1.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1" }, "require-dev": { "ext-curl": "*", "ext-dom": "*", + "ext-gd": "*", "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.5.0", - "laminas/laminas-coding-standard": "~1.0.0", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5.18" + "http-interop/http-factory-tests": "^0.9.0", + "laminas/laminas-coding-standard": "^2.5", + "php-http/psr7-integration-tests": "^1.2", + "phpunit/phpunit": "^9.5.28", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.6" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "conflict": { - "phpspec/prophecy": "<1.9.0" + "zendframework/zend-diactoros": "*" }, "autoload": { "files": [ @@ -85,9 +93,7 @@ "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" - }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "static-analysis": "psalm --shepherd --stats" } } diff --git a/vendor/laminas/laminas-diactoros/src/AbstractSerializer.php b/vendor/laminas/laminas-diactoros/src/AbstractSerializer.php index cc8a110f4a..3b290f0594 100644 --- a/vendor/laminas/laminas-diactoros/src/AbstractSerializer.php +++ b/vendor/laminas/laminas-diactoros/src/AbstractSerializer.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -14,10 +8,10 @@ use function array_pop; use function implode; -use function ltrim; use function preg_match; use function sprintf; use function str_replace; +use function trim; use function ucwords; /** @@ -27,9 +21,9 @@ */ abstract class AbstractSerializer { - const CR = "\r"; - const EOL = "\r\n"; - const LF = "\n"; + public const CR = "\r"; + public const EOL = "\r\n"; + public const LF = "\n"; /** * Retrieve a single line from the stream. @@ -37,10 +31,10 @@ abstract class AbstractSerializer * Retrieves a line from the stream; a line is defined as a sequence of * characters ending in a CRLF sequence. * - * @throws Exception\DeserializationException if the sequence contains a CR + * @throws Exception\DeserializationException If the sequence contains a CR * or LF in isolation, or ends in a CR. */ - protected static function getLine(StreamInterface $stream) : string + protected static function getLine(StreamInterface $stream): string { $line = ''; $crFound = false; @@ -90,7 +84,7 @@ protected static function getLine(StreamInterface $stream) : string * * @throws Exception\DeserializationException For invalid headers. */ - protected static function splitStream(StreamInterface $stream) : array + protected static function splitStream(StreamInterface $stream): array { $headers = []; $currentHeader = false; @@ -101,7 +95,7 @@ protected static function splitStream(StreamInterface $stream) : array if (! isset($headers[$currentHeader])) { $headers[$currentHeader] = []; } - $headers[$currentHeader][] = ltrim($matches['value']); + $headers[$currentHeader][] = trim($matches['value'], "\t "); continue; } @@ -114,8 +108,8 @@ protected static function splitStream(StreamInterface $stream) : array } // Append continuation to last header value found - $value = array_pop($headers[$currentHeader]); - $headers[$currentHeader][] = $value . ltrim($line); + $value = array_pop($headers[$currentHeader]); + $headers[$currentHeader][] = $value . ' ' . trim($line, "\t "); } // use RelativeStream to avoid copying initial stream into memory @@ -124,8 +118,10 @@ protected static function splitStream(StreamInterface $stream) : array /** * Serialize headers to string values. + * + * @psalm-param array<string, string[]> $headers */ - protected static function serializeHeaders(array $headers) : string + protected static function serializeHeaders(array $headers): string { $lines = []; foreach ($headers as $header => $values) { @@ -140,8 +136,10 @@ protected static function serializeHeaders(array $headers) : string /** * Filter a header name to wordcase + * + * @param string $header */ - protected static function filterHeader($header) : string + protected static function filterHeader($header): string { $filtered = str_replace('-', ' ', $header); $filtered = ucwords($filtered); diff --git a/vendor/laminas/laminas-diactoros/src/CallbackStream.php b/vendor/laminas/laminas-diactoros/src/CallbackStream.php index 48ae1bdd67..cf344a15b9 100644 --- a/vendor/laminas/laminas-diactoros/src/CallbackStream.php +++ b/vendor/laminas/laminas-diactoros/src/CallbackStream.php @@ -1,16 +1,11 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\StreamInterface; +use Stringable; use function array_key_exists; @@ -19,15 +14,12 @@ /** * Implementation of PSR HTTP streams */ -class CallbackStream implements StreamInterface +class CallbackStream implements StreamInterface, Stringable { - /** - * @var callable|null - */ + /** @var callable|null */ protected $callback; /** - * @param callable $callback * @throws Exception\InvalidArgumentException */ public function __construct(callable $callback) @@ -38,7 +30,7 @@ public function __construct(callable $callback) /** * {@inheritdoc} */ - public function __toString() : string + public function __toString(): string { return $this->getContents(); } @@ -46,17 +38,19 @@ public function __toString() : string /** * {@inheritdoc} */ - public function close() : void + public function close(): void { $this->callback = null; } /** * {@inheritdoc} + * + * @return null|callable */ - public function detach() : ?callable + public function detach(): ?callable { - $callback = $this->callback; + $callback = $this->callback; $this->callback = null; return $callback; } @@ -64,7 +58,7 @@ public function detach() : ?callable /** * Attach a new callback to the instance. */ - public function attach(callable $callback) : void + public function attach(callable $callback): void { $this->callback = $callback; } @@ -72,7 +66,7 @@ public function attach(callable $callback) : void /** * {@inheritdoc} */ - public function getSize() : ?int + public function getSize(): ?int { return null; } @@ -80,7 +74,7 @@ public function getSize() : ?int /** * {@inheritdoc} */ - public function tell() : int + public function tell(): int { throw Exception\UntellableStreamException::forCallbackStream(); } @@ -88,7 +82,7 @@ public function tell() : int /** * {@inheritdoc} */ - public function eof() : bool + public function eof(): bool { return empty($this->callback); } @@ -96,13 +90,17 @@ public function eof() : bool /** * {@inheritdoc} */ - public function isSeekable() : bool + public function isSeekable(): bool { return false; } /** * {@inheritdoc} + * + * @param int $offset + * @param int $whence + * @return void */ public function seek($offset, $whence = SEEK_SET) { @@ -112,7 +110,7 @@ public function seek($offset, $whence = SEEK_SET) /** * {@inheritdoc} */ - public function rewind() : void + public function rewind(): void { throw Exception\UnrewindableStreamException::forCallbackStream(); } @@ -120,7 +118,7 @@ public function rewind() : void /** * {@inheritdoc} */ - public function isWritable() : bool + public function isWritable(): bool { return false; } @@ -128,7 +126,7 @@ public function isWritable() : bool /** * {@inheritdoc} */ - public function write($string) : void + public function write($string): void { throw Exception\UnwritableStreamException::forCallbackStream(); } @@ -136,7 +134,7 @@ public function write($string) : void /** * {@inheritdoc} */ - public function isReadable() : bool + public function isReadable(): bool { return false; } @@ -144,7 +142,7 @@ public function isReadable() : bool /** * {@inheritdoc} */ - public function read($length) : string + public function read($length): string { throw Exception\UnreadableStreamException::forCallbackStream(); } @@ -152,7 +150,7 @@ public function read($length) : string /** * {@inheritdoc} */ - public function getContents() : string + public function getContents(): string { $callback = $this->detach(); $contents = $callback ? $callback() : ''; @@ -165,9 +163,9 @@ public function getContents() : string public function getMetadata($key = null) { $metadata = [ - 'eof' => $this->eof(), + 'eof' => $this->eof(), 'stream_type' => 'callback', - 'seekable' => false + 'seekable' => false, ]; if (null === $key) { diff --git a/vendor/laminas/laminas-diactoros/src/ConfigProvider.php b/vendor/laminas/laminas-diactoros/src/ConfigProvider.php new file mode 100644 index 0000000000..ae4e96f452 --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/ConfigProvider.php @@ -0,0 +1,63 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros; + +use Psr\Http\Message\RequestFactoryInterface; +use Psr\Http\Message\ResponseFactoryInterface; +use Psr\Http\Message\ServerRequestFactoryInterface; +use Psr\Http\Message\StreamFactoryInterface; +use Psr\Http\Message\UploadedFileFactoryInterface; +use Psr\Http\Message\UriFactoryInterface; + +class ConfigProvider +{ + public const CONFIG_KEY = 'laminas-diactoros'; + public const X_FORWARDED = 'x-forwarded-request-filter'; + public const X_FORWARDED_TRUSTED_PROXIES = 'trusted-proxies'; + public const X_FORWARDED_TRUSTED_HEADERS = 'trusted-headers'; + + /** + * Retrieve configuration for laminas-diactoros. + * + * @return array + */ + public function __invoke(): array + { + return [ + 'dependencies' => $this->getDependencies(), + self::CONFIG_KEY => $this->getComponentConfig(), + ]; + } + + /** + * Returns the container dependencies. + * Maps factory interfaces to factories. + */ + public function getDependencies(): array + { + // @codingStandardsIgnoreStart + return [ + 'invokables' => [ + RequestFactoryInterface::class => RequestFactory::class, + ResponseFactoryInterface::class => ResponseFactory::class, + StreamFactoryInterface::class => StreamFactory::class, + ServerRequestFactoryInterface::class => ServerRequestFactory::class, + UploadedFileFactoryInterface::class => UploadedFileFactory::class, + UriFactoryInterface::class => UriFactory::class + ], + ]; + // @codingStandardsIgnoreEnd + } + + public function getComponentConfig(): array + { + return [ + self::X_FORWARDED => [ + self::X_FORWARDED_TRUSTED_PROXIES => '', + self::X_FORWARDED_TRUSTED_HEADERS => [], + ], + ]; + } +} diff --git a/vendor/laminas/laminas-diactoros/src/Exception/DeserializationException.php b/vendor/laminas/laminas-diactoros/src/Exception/DeserializationException.php index 6ae6b431e5..424e34710c 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/DeserializationException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/DeserializationException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -15,37 +9,37 @@ class DeserializationException extends UnexpectedValueException implements ExceptionInterface { - public static function forInvalidHeader() : self + public static function forInvalidHeader(): self { throw new self('Invalid header detected'); } - public static function forInvalidHeaderContinuation() : self + public static function forInvalidHeaderContinuation(): self { throw new self('Invalid header continuation'); } - public static function forRequestFromArray(Throwable $previous) : self + public static function forRequestFromArray(Throwable $previous): self { return new self('Cannot deserialize request', $previous->getCode(), $previous); } - public static function forResponseFromArray(Throwable $previous) : self + public static function forResponseFromArray(Throwable $previous): self { return new self('Cannot deserialize response', $previous->getCode(), $previous); } - public static function forUnexpectedCarriageReturn() : self + public static function forUnexpectedCarriageReturn(): self { throw new self('Unexpected carriage return detected'); } - public static function forUnexpectedEndOfHeaders() : self + public static function forUnexpectedEndOfHeaders(): self { throw new self('Unexpected end of headers'); } - public static function forUnexpectedLineFeed() : self + public static function forUnexpectedLineFeed(): self { throw new self('Unexpected line feed detected'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/ExceptionInterface.php b/vendor/laminas/laminas-diactoros/src/Exception/ExceptionInterface.php index 3d7648efa0..e9c38304dd 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/ExceptionInterface.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/ExceptionInterface.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; diff --git a/vendor/laminas/laminas-diactoros/src/Exception/InvalidArgumentException.php b/vendor/laminas/laminas-diactoros/src/Exception/InvalidArgumentException.php index be4502196a..12321a4e9b 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/InvalidArgumentException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/InvalidArgumentException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; diff --git a/vendor/laminas/laminas-diactoros/src/Exception/InvalidForwardedHeaderNameException.php b/vendor/laminas/laminas-diactoros/src/Exception/InvalidForwardedHeaderNameException.php new file mode 100644 index 0000000000..5a3bc3bad5 --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/Exception/InvalidForwardedHeaderNameException.php @@ -0,0 +1,28 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\Exception; + +use Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders; + +use function gettype; +use function is_object; +use function is_string; +use function sprintf; + +class InvalidForwardedHeaderNameException extends RuntimeException implements ExceptionInterface +{ + public static function forHeader(mixed $name): self + { + if (! is_string($name)) { + $name = sprintf('(value of type %s)', is_object($name) ? $name::class : gettype($name)); + } + + return new self(sprintf( + 'Invalid X-Forwarded-* header name "%s" provided to %s', + $name, + FilterUsingXForwardedHeaders::class + )); + } +} diff --git a/vendor/laminas/laminas-diactoros/src/Exception/InvalidProxyAddressException.php b/vendor/laminas/laminas-diactoros/src/Exception/InvalidProxyAddressException.php new file mode 100644 index 0000000000..771c7befcc --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/Exception/InvalidProxyAddressException.php @@ -0,0 +1,32 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\Exception; + +use function gettype; +use function is_object; +use function sprintf; + +class InvalidProxyAddressException extends RuntimeException implements ExceptionInterface +{ + public static function forInvalidProxyArgument(mixed $proxy): self + { + $type = is_object($proxy) ? $proxy::class : gettype($proxy); + return new self(sprintf( + 'Invalid proxy of type "%s" provided;' + . ' must be a valid IPv4 or IPv6 address, optionally with a subnet mask provided' + . ' or an array of such values', + $type, + )); + } + + public static function forAddress(string $address): self + { + return new self(sprintf( + 'Invalid proxy address "%s" provided;' + . ' must be a valid IPv4 or IPv6 address, optionally with a subnet mask provided', + $address, + )); + } +} diff --git a/vendor/laminas/laminas-diactoros/src/Exception/InvalidStreamPointerPositionException.php b/vendor/laminas/laminas-diactoros/src/Exception/InvalidStreamPointerPositionException.php index 5782588c2e..245a2a5454 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/InvalidStreamPointerPositionException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/InvalidStreamPointerPositionException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -15,10 +9,11 @@ class InvalidStreamPointerPositionException extends RuntimeException implements ExceptionInterface { + /** {@inheritDoc} */ public function __construct( string $message = 'Invalid pointer position', - $code = 0, - Throwable $previous = null + int $code = 0, + ?Throwable $previous = null ) { parent::__construct($message, $code, $previous); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/RuntimeException.php b/vendor/laminas/laminas-diactoros/src/Exception/RuntimeException.php new file mode 100644 index 0000000000..1c946c332a --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/Exception/RuntimeException.php @@ -0,0 +1,9 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\Exception; + +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/vendor/laminas/laminas-diactoros/src/Exception/SerializationException.php b/vendor/laminas/laminas-diactoros/src/Exception/SerializationException.php index 43f682d362..fc2b6f09c6 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/SerializationException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/SerializationException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,12 +8,12 @@ class SerializationException extends UnexpectedValueException implements ExceptionInterface { - public static function forInvalidRequestLine() : self + public static function forInvalidRequestLine(): self { return new self('Invalid request line detected'); } - public static function forInvalidStatusLine() : self + public static function forInvalidStatusLine(): self { return new self('No status line detected'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UnreadableStreamException.php b/vendor/laminas/laminas-diactoros/src/Exception/UnreadableStreamException.php index c98787d438..212ac7e1ec 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UnreadableStreamException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UnreadableStreamException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,22 +8,22 @@ class UnreadableStreamException extends RuntimeException implements ExceptionInterface { - public static function dueToConfiguration() : self + public static function dueToConfiguration(): self { return new self('Stream is not readable'); } - public static function dueToMissingResource() : self + public static function dueToMissingResource(): self { return new self('No resource available; cannot read'); } - public static function dueToPhpError() : self + public static function dueToPhpError(): self { return new self('Error reading stream'); } - public static function forCallbackStream() : self + public static function forCallbackStream(): self { return new self('Callback streams cannot read'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UnrecognizedProtocolVersionException.php b/vendor/laminas/laminas-diactoros/src/Exception/UnrecognizedProtocolVersionException.php index 7d11f0301d..475fdcb4cb 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UnrecognizedProtocolVersionException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UnrecognizedProtocolVersionException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -16,7 +10,7 @@ class UnrecognizedProtocolVersionException extends UnexpectedValueException implements ExceptionInterface { - public static function forVersion(string $version) : self + public static function forVersion(string $version): self { return new self(sprintf('Unrecognized protocol version (%s)', $version)); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UnrewindableStreamException.php b/vendor/laminas/laminas-diactoros/src/Exception/UnrewindableStreamException.php index 20eaf4fe77..0d1d5aeb28 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UnrewindableStreamException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UnrewindableStreamException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,7 +8,7 @@ class UnrewindableStreamException extends RuntimeException implements ExceptionInterface { - public static function forCallbackStream() : self + public static function forCallbackStream(): self { return new self('Callback streams cannot rewind position'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UnseekableStreamException.php b/vendor/laminas/laminas-diactoros/src/Exception/UnseekableStreamException.php index 799c2606be..0bb7cebc9e 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UnseekableStreamException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UnseekableStreamException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,22 +8,22 @@ class UnseekableStreamException extends RuntimeException implements ExceptionInterface { - public static function dueToConfiguration() : self + public static function dueToConfiguration(): self { return new self('Stream is not seekable'); } - public static function dueToMissingResource() : self + public static function dueToMissingResource(): self { return new self('No resource available; cannot seek position'); } - public static function dueToPhpError() : self + public static function dueToPhpError(): self { return new self('Error seeking within stream'); } - public static function forCallbackStream() : self + public static function forCallbackStream(): self { return new self('Callback streams cannot seek position'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UntellableStreamException.php b/vendor/laminas/laminas-diactoros/src/Exception/UntellableStreamException.php index f819716f79..c66fd25a10 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UntellableStreamException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UntellableStreamException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,17 +8,17 @@ class UntellableStreamException extends RuntimeException implements ExceptionInterface { - public static function dueToMissingResource() : self + public static function dueToMissingResource(): self { return new self('No resource available; cannot tell position'); } - public static function dueToPhpError() : self + public static function dueToPhpError(): self { return new self('Error occurred during tell operation'); } - public static function forCallbackStream() : self + public static function forCallbackStream(): self { return new self('Callback streams cannot tell position'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UnwritableStreamException.php b/vendor/laminas/laminas-diactoros/src/Exception/UnwritableStreamException.php index 24d7c75adf..13b7e37667 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UnwritableStreamException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UnwritableStreamException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -14,22 +8,22 @@ class UnwritableStreamException extends RuntimeException implements ExceptionInterface { - public static function dueToConfiguration() : self + public static function dueToConfiguration(): self { return new self('Stream is not writable'); } - public static function dueToMissingResource() : self + public static function dueToMissingResource(): self { return new self('No resource available; cannot write'); } - public static function dueToPhpError() : self + public static function dueToPhpError(): self { return new self('Error writing to stream'); } - public static function forCallbackStream() : self + public static function forCallbackStream(): self { return new self('Callback streams cannot write'); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileAlreadyMovedException.php b/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileAlreadyMovedException.php index 3b0990e9da..0e65d24c4a 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileAlreadyMovedException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileAlreadyMovedException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -15,10 +9,11 @@ class UploadedFileAlreadyMovedException extends RuntimeException implements ExceptionInterface { + /** {@inheritDoc} */ public function __construct( string $message = 'Cannot retrieve stream after it has already moved', - $code = 0, - Throwable $previous = null + int $code = 0, + ?Throwable $previous = null ) { parent::__construct($message, $code, $previous); } diff --git a/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileErrorException.php b/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileErrorException.php index 14c52638c5..7c416132f5 100644 --- a/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileErrorException.php +++ b/vendor/laminas/laminas-diactoros/src/Exception/UploadedFileErrorException.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Exception; @@ -16,12 +10,12 @@ class UploadedFileErrorException extends RuntimeException implements ExceptionInterface { - public static function forUnmovableFile() : self + public static function forUnmovableFile(): self { return new self('Error occurred while moving uploaded file'); } - public static function dueToStreamUploadError(string $error) : self + public static function dueToStreamUploadError(string $error): self { return new self(sprintf( 'Cannot retrieve stream due to upload error: %s', @@ -29,15 +23,15 @@ public static function dueToStreamUploadError(string $error) : self )); } - public static function dueToUnwritablePath() : self + public static function dueToUnwritablePath(): self { return new self('Unable to write to designated path'); } - public static function dueToUnwritableTarget(string $targetDirectory) : self + public static function dueToUnwritableTarget(string $targetDirectory): self { return new self(sprintf( - 'The target directory `%s` does not exists or is not writable', + 'The target directory `%s` does not exist or is not writable', $targetDirectory )); } diff --git a/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php b/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php index 5f514650e1..d12486aebe 100644 --- a/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php +++ b/vendor/laminas/laminas-diactoros/src/HeaderSecurity.php @@ -1,16 +1,9 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; -use function get_class; use function gettype; use function in_array; use function is_numeric; @@ -23,17 +16,12 @@ /** * Provide security tools around HTTP headers to prevent common injection vectors. - * - * Code is largely lifted from the Laminas\Http\Header\HeaderValue implementation in - * Laminas, released with the copyright and license below. - * - * @copyright Copyright (c) 2005-2015 Laminas (https://www.zend.com) - * @license https://getlaminas.org/license/new-bsd New BSD License */ final class HeaderSecurity { /** * Private constructor; non-instantiable. + * * @codeCoverageIgnore */ private function __construct() @@ -54,9 +42,8 @@ private function __construct() * * @see http://en.wikipedia.org/wiki/HTTP_response_splitting */ - public static function filter(string $value) : string + public static function filter(string $value): string { - $value = (string) $value; $length = strlen($value); $string = ''; for ($i = 0; $i < $length; $i += 1) { @@ -68,7 +55,7 @@ public static function filter(string $value) : string $ws = ord($value[$i + 2]); if ($lf === 10 && in_array($ws, [9, 32], true)) { $string .= $value[$i] . $value[$i + 1]; - $i += 1; + $i += 1; } continue; @@ -79,7 +66,8 @@ public static function filter(string $value) : string // 32-126, 128-254 === visible // 127 === DEL // 255 === null byte - if (($ascii < 32 && $ascii !== 9) + if ( + ($ascii < 32 && $ascii !== 9) || $ascii === 127 || $ascii > 254 ) { @@ -99,12 +87,13 @@ public static function filter(string $value) : string * tabs are allowed in values; header continuations MUST consist of * a single CRLF sequence followed by a space or horizontal tab. * - * @param string|int|float $value * @see http://en.wikipedia.org/wiki/HTTP_response_splitting + * + * @param string|int|float $value */ - public static function isValid($value) : bool + public static function isValid($value): bool { - $value = (string) $value; + $value = (string) $value; // Look for: // \n not preceded by \r, OR @@ -132,14 +121,14 @@ public static function isValid($value) : bool * Assert a header value is valid. * * @param mixed $value Value to be tested. This method asserts it is a string or number. - * @throws Exception\InvalidArgumentException for invalid values + * @throws Exception\InvalidArgumentException For invalid values. */ - public static function assertValid($value) + public static function assertValid(mixed $value): void { if (! is_string($value) && ! is_numeric($value)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid header value type; must be a string or numeric; received %s', - (is_object($value) ? get_class($value) : gettype($value)) + is_object($value) ? $value::class : gettype($value) )); } if (! self::isValid($value)) { @@ -154,18 +143,18 @@ public static function assertValid($value) * Assert whether or not a header name is valid. * * @see http://tools.ietf.org/html/rfc7230#section-3.2 - * @param mixed $name + * * @throws Exception\InvalidArgumentException */ - public static function assertValidName($name) + public static function assertValidName(mixed $name): void { if (! is_string($name)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid header name type; expected string; received %s', - (is_object($name) ? get_class($name) : gettype($name)) + is_object($name) ? $name::class : gettype($name) )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $name)) { + if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $name)) { throw new Exception\InvalidArgumentException(sprintf( '"%s" is not valid header name', $name diff --git a/vendor/laminas/laminas-diactoros/src/MessageTrait.php b/vendor/laminas/laminas-diactoros/src/MessageTrait.php index 3ae28af551..695b942eb1 100644 --- a/vendor/laminas/laminas-diactoros/src/MessageTrait.php +++ b/vendor/laminas/laminas-diactoros/src/MessageTrait.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -15,7 +9,7 @@ use function array_map; use function array_merge; -use function get_class; +use function array_values; use function gettype; use function implode; use function is_array; @@ -24,7 +18,9 @@ use function is_string; use function preg_match; use function sprintf; +use function str_replace; use function strtolower; +use function trim; /** * Trait implementing the various methods defined in MessageInterface. @@ -37,6 +33,7 @@ trait MessageTrait * List of all registered headers, as key => array of values. * * @var array + * @psalm-var array<non-empty-string, list<string>> */ protected $headers = []; @@ -44,17 +41,14 @@ trait MessageTrait * Map of normalized header name to original name used to register header. * * @var array + * @psalm-var array<non-empty-string, non-empty-string> */ protected $headerNames = []; - /** - * @var string - */ + /** @var string */ private $protocol = '1.1'; - /** - * @var StreamInterface - */ + /** @var StreamInterface */ private $stream; /** @@ -64,7 +58,7 @@ trait MessageTrait * * @return string HTTP protocol version. */ - public function getProtocolVersion() : string + public function getProtocolVersion(): string { return $this->protocol; } @@ -82,10 +76,10 @@ public function getProtocolVersion() : string * @param string $version HTTP protocol version * @return static */ - public function withProtocolVersion($version) : MessageInterface + public function withProtocolVersion($version): MessageInterface { $this->validateProtocolVersion($version); - $new = clone $this; + $new = clone $this; $new->protocol = $version; return $new; } @@ -110,8 +104,9 @@ public function withProtocolVersion($version) : MessageInterface * * @return array Returns an associative array of the message's headers. Each * key MUST be a header name, and each value MUST be an array of strings. + * @psalm-return array<non-empty-string, list<string>> */ - public function getHeaders() : array + public function getHeaders(): array { return $this->headers; } @@ -124,7 +119,7 @@ public function getHeaders() : array * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - public function hasHeader($header) : bool + public function hasHeader($header): bool { return isset($this->headerNames[strtolower($header)]); } @@ -143,7 +138,7 @@ public function hasHeader($header) : bool * header. If the header does not appear in the message, this method MUST * return an empty array. */ - public function getHeader($header) : array + public function getHeader($header): array { if (! $this->hasHeader($header)) { return []; @@ -173,7 +168,7 @@ public function getHeader($header) : array * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - public function getHeaderLine($name) : string + public function getHeaderLine($name): string { $value = $this->getHeader($name); if (empty($value)) { @@ -194,26 +189,26 @@ public function getHeaderLine($name) : string * immutability of the message, and MUST return an instance that has the * new and/or updated header and value. * - * @param string $header Case-insensitive header field name. + * @param string $name Case-insensitive header field name. * @param string|string[] $value Header value(s). * @return static - * @throws Exception\InvalidArgumentException for invalid header names or values. + * @throws Exception\InvalidArgumentException For invalid header names or values. */ - public function withHeader($header, $value) : MessageInterface + public function withHeader($name, $value): MessageInterface { - $this->assertHeader($header); + $this->assertHeader($name); - $normalized = strtolower($header); + $normalized = strtolower($name); $new = clone $this; - if ($new->hasHeader($header)) { + if ($new->hasHeader($name)) { unset($new->headers[$new->headerNames[$normalized]]); } $value = $this->filterHeaderValue($value); - $new->headerNames[$normalized] = $header; - $new->headers[$header] = $value; + $new->headerNames[$normalized] = $name; + $new->headers[$name] = $value; return $new; } @@ -230,23 +225,23 @@ public function withHeader($header, $value) : MessageInterface * immutability of the message, and MUST return an instance that has the * new header and/or value. * - * @param string $header Case-insensitive header field name to add. + * @param string $name Case-insensitive header field name to add. * @param string|string[] $value Header value(s). * @return static - * @throws Exception\InvalidArgumentException for invalid header names or values. + * @throws Exception\InvalidArgumentException For invalid header names or values. */ - public function withAddedHeader($header, $value) : MessageInterface + public function withAddedHeader($name, $value): MessageInterface { - $this->assertHeader($header); + $this->assertHeader($name); - if (! $this->hasHeader($header)) { - return $this->withHeader($header, $value); + if (! $this->hasHeader($name)) { + return $this->withHeader($name, $value); } - $header = $this->headerNames[strtolower($header)]; + $header = $this->headerNames[strtolower($name)]; - $new = clone $this; - $value = $this->filterHeaderValue($value); + $new = clone $this; + $value = $this->filterHeaderValue($value); $new->headers[$header] = array_merge($this->headers[$header], $value); return $new; } @@ -260,16 +255,16 @@ public function withAddedHeader($header, $value) : MessageInterface * immutability of the message, and MUST return an instance that removes * the named header. * - * @param string $header Case-insensitive header field name to remove. + * @param string $name Case-insensitive header field name to remove. * @return static */ - public function withoutHeader($header) : MessageInterface + public function withoutHeader($name): MessageInterface { - if (! $this->hasHeader($header)) { + if (! is_string($name) || $name === '' || ! $this->hasHeader($name)) { return clone $this; } - $normalized = strtolower($header); + $normalized = strtolower($name); $original = $this->headerNames[$normalized]; $new = clone $this; @@ -282,7 +277,7 @@ public function withoutHeader($header) : MessageInterface * * @return StreamInterface Returns the body as a stream. */ - public function getBody() : StreamInterface + public function getBody(): StreamInterface { return $this->stream; } @@ -300,14 +295,15 @@ public function getBody() : StreamInterface * @return static * @throws Exception\InvalidArgumentException When the body is not valid. */ - public function withBody(StreamInterface $body) : MessageInterface + public function withBody(StreamInterface $body): MessageInterface { - $new = clone $this; + $new = clone $this; $new->stream = $body; return $new; } - private function getStream($stream, string $modeIfNotInstance) : StreamInterface + /** @param StreamInterface|string|resource $stream */ + private function getStream($stream, string $modeIfNotInstance): StreamInterface { if ($stream instanceof StreamInterface) { return $stream; @@ -331,7 +327,7 @@ private function getStream($stream, string $modeIfNotInstance) : StreamInterface * * @param array $originalHeaders Headers to filter. */ - private function setHeaders(array $originalHeaders) : void + private function setHeaders(array $originalHeaders): void { $headerNames = $headers = []; @@ -341,20 +337,20 @@ private function setHeaders(array $originalHeaders) : void $this->assertHeader($header); $headerNames[strtolower($header)] = $header; - $headers[$header] = $value; + $headers[$header] = $value; } $this->headerNames = $headerNames; - $this->headers = $headers; + $this->headers = $headers; } /** * Validate the HTTP protocol version * * @param string $version - * @throws Exception\InvalidArgumentException on invalid HTTP protocol version + * @throws Exception\InvalidArgumentException On invalid HTTP protocol version. */ - private function validateProtocolVersion($version) : void + private function validateProtocolVersion($version): void { if (empty($version)) { throw new Exception\InvalidArgumentException( @@ -364,13 +360,13 @@ private function validateProtocolVersion($version) : void if (! is_string($version)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported HTTP protocol version; must be a string, received %s', - (is_object($version) ? get_class($version) : gettype($version)) + is_object($version) ? $version::class : gettype($version) )); } // HTTP/1 uses a "<major>.<minor>" numbering scheme to indicate // versions of the protocol, while HTTP/2 does not. - if (! preg_match('#^(1\.[01]|2)$#', $version)) { + if (! preg_match('#^(1\.[01]|2(\.0)?)$#', $version)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported HTTP protocol version "%s" provided', $version @@ -378,11 +374,8 @@ private function validateProtocolVersion($version) : void } } - /** - * @param mixed $values - * @return string[] - */ - private function filterHeaderValue($values) : array + /** @return list<string> */ + private function filterHeaderValue(mixed $values): array { if (! is_array($values)) { $values = [$values]; @@ -395,10 +388,16 @@ private function filterHeaderValue($values) : array ); } - return array_map(function ($value) { + return array_map(static function ($value): string { HeaderSecurity::assertValid($value); - return (string) $value; + $value = (string) $value; + + // Normalize line folding to a single space (RFC 7230#3.2.4). + $value = str_replace(["\r\n\t", "\r\n "], ' ', $value); + + // Remove optional whitespace (OWS, RFC 7230#3.2.3) around the header value. + return trim($value, "\t "); }, array_values($values)); } @@ -406,10 +405,9 @@ private function filterHeaderValue($values) : array * Ensure header name and values are valid. * * @param string $name - * * @throws Exception\InvalidArgumentException */ - private function assertHeader($name) : void + private function assertHeader($name): void { HeaderSecurity::assertValidName($name); } diff --git a/vendor/laminas/laminas-diactoros/src/Module.php b/vendor/laminas/laminas-diactoros/src/Module.php new file mode 100644 index 0000000000..2d58840461 --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/Module.php @@ -0,0 +1,15 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros; + +class Module +{ + public function getConfig(): array + { + return [ + 'service_manager' => (new ConfigProvider())->getDependencies(), + ]; + } +} diff --git a/vendor/laminas/laminas-diactoros/src/PhpInputStream.php b/vendor/laminas/laminas-diactoros/src/PhpInputStream.php index b7314db431..cef45d6245 100644 --- a/vendor/laminas/laminas-diactoros/src/PhpInputStream.php +++ b/vendor/laminas/laminas-diactoros/src/PhpInputStream.php @@ -1,31 +1,21 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; +use Stringable; + use function stream_get_contents; /** * Caching version of php://input */ -class PhpInputStream extends Stream +class PhpInputStream extends Stream implements Stringable { - /** - * @var string - */ - private $cache = ''; + private string $cache = ''; - /** - * @var bool - */ - private $reachedEof = false; + private bool $reachedEof = false; /** * @param string|resource $stream @@ -38,7 +28,7 @@ public function __construct($stream = 'php://input') /** * {@inheritdoc} */ - public function __toString() : string + public function __toString(): string { if ($this->reachedEof) { return $this->cache; @@ -51,7 +41,7 @@ public function __toString() : string /** * {@inheritdoc} */ - public function isWritable() : bool + public function isWritable(): bool { return false; } @@ -59,7 +49,7 @@ public function isWritable() : bool /** * {@inheritdoc} */ - public function read($length) : string + public function read($length): string { $content = parent::read($length); if (! $this->reachedEof) { @@ -76,7 +66,7 @@ public function read($length) : string /** * {@inheritdoc} */ - public function getContents($maxLength = -1) : string + public function getContents($maxLength = -1): string { if ($this->reachedEof) { return $this->cache; diff --git a/vendor/laminas/laminas-diactoros/src/RelativeStream.php b/vendor/laminas/laminas-diactoros/src/RelativeStream.php index b86b985298..0c12833ef9 100644 --- a/vendor/laminas/laminas-diactoros/src/RelativeStream.php +++ b/vendor/laminas/laminas-diactoros/src/RelativeStream.php @@ -1,54 +1,33 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\StreamInterface; +use Stringable; use const SEEK_SET; /** - * Class RelativeStream - * * Wrapper for default Stream class, representing subpart (starting from given offset) of initial stream. * It can be used to avoid copying full stream, conserving memory. - * @example see Laminas\Diactoros\AbstractSerializer::splitStream() + * + * @see AbstractSerializer::splitStream() */ -final class RelativeStream implements StreamInterface +final class RelativeStream implements StreamInterface, Stringable { - /** - * @var StreamInterface - */ - private $decoratedStream; - - /** - * @var int - */ - private $offset; + private int $offset; - /** - * Class constructor - * - * @param StreamInterface $decoratedStream - * @param int $offset - */ - public function __construct(StreamInterface $decoratedStream, ?int $offset) + public function __construct(private StreamInterface $decoratedStream, ?int $offset) { - $this->decoratedStream = $decoratedStream; $this->offset = (int) $offset; } /** * {@inheritdoc} */ - public function __toString() : string + public function __toString(): string { if ($this->isSeekable()) { $this->seek(0); @@ -59,7 +38,7 @@ public function __toString() : string /** * {@inheritdoc} */ - public function close() : void + public function close(): void { $this->decoratedStream->close(); } @@ -75,7 +54,7 @@ public function detach() /** * {@inheritdoc} */ - public function getSize() : int + public function getSize(): int { return $this->decoratedStream->getSize() - $this->offset; } @@ -83,7 +62,7 @@ public function getSize() : int /** * {@inheritdoc} */ - public function tell() : int + public function tell(): int { return $this->decoratedStream->tell() - $this->offset; } @@ -91,7 +70,7 @@ public function tell() : int /** * {@inheritdoc} */ - public function eof() : bool + public function eof(): bool { return $this->decoratedStream->eof(); } @@ -99,7 +78,7 @@ public function eof() : bool /** * {@inheritdoc} */ - public function isSeekable() : bool + public function isSeekable(): bool { return $this->decoratedStream->isSeekable(); } @@ -107,9 +86,9 @@ public function isSeekable() : bool /** * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET) : void + public function seek($offset, $whence = SEEK_SET): void { - if ($whence == SEEK_SET) { + if ($whence === SEEK_SET) { $this->decoratedStream->seek($offset + $this->offset, $whence); return; } @@ -119,7 +98,7 @@ public function seek($offset, $whence = SEEK_SET) : void /** * {@inheritdoc} */ - public function rewind() : void + public function rewind(): void { $this->seek(0); } @@ -127,7 +106,7 @@ public function rewind() : void /** * {@inheritdoc} */ - public function isWritable() : bool + public function isWritable(): bool { return $this->decoratedStream->isWritable(); } @@ -135,7 +114,7 @@ public function isWritable() : bool /** * {@inheritdoc} */ - public function write($string) : int + public function write($string): int { if ($this->tell() < 0) { throw new Exception\InvalidStreamPointerPositionException(); @@ -146,7 +125,7 @@ public function write($string) : int /** * {@inheritdoc} */ - public function isReadable() : bool + public function isReadable(): bool { return $this->decoratedStream->isReadable(); } @@ -154,7 +133,7 @@ public function isReadable() : bool /** * {@inheritdoc} */ - public function read($length) : string + public function read($length): string { if ($this->tell() < 0) { throw new Exception\InvalidStreamPointerPositionException(); @@ -165,7 +144,7 @@ public function read($length) : string /** * {@inheritdoc} */ - public function getContents() : string + public function getContents(): string { if ($this->tell() < 0) { throw new Exception\InvalidStreamPointerPositionException(); diff --git a/vendor/laminas/laminas-diactoros/src/Request.php b/vendor/laminas/laminas-diactoros/src/Request.php index 30eabf4060..504581c201 100644 --- a/vendor/laminas/laminas-diactoros/src/Request.php +++ b/vendor/laminas/laminas-diactoros/src/Request.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -32,9 +26,9 @@ class Request implements RequestInterface * @param null|string $method HTTP method for the request, if any. * @param string|resource|StreamInterface $body Message body, if any. * @param array $headers Headers for the message, if any. - * @throws Exception\InvalidArgumentException for any invalid value. + * @throws Exception\InvalidArgumentException For any invalid value. */ - public function __construct($uri = null, string $method = null, $body = 'php://temp', array $headers = []) + public function __construct($uri = null, ?string $method = null, $body = 'php://temp', array $headers = []) { $this->initialize($uri, $method, $body, $headers); } @@ -42,10 +36,11 @@ public function __construct($uri = null, string $method = null, $body = 'php://t /** * {@inheritdoc} */ - public function getHeaders() : array + public function getHeaders(): array { $headers = $this->headers; - if (! $this->hasHeader('host') + if ( + ! $this->hasHeader('host') && $this->uri->getHost() ) { $headers['Host'] = [$this->getHostFromUri()]; @@ -57,10 +52,11 @@ public function getHeaders() : array /** * {@inheritdoc} */ - public function getHeader($header) : array + public function getHeader($name): array { - if (! $this->hasHeader($header)) { - if (strtolower($header) === 'host' + if (empty($name) || ! $this->hasHeader($name)) { + if ( + strtolower($name) === 'host' && $this->uri->getHost() ) { return [$this->getHostFromUri()]; @@ -69,7 +65,7 @@ public function getHeader($header) : array return []; } - $header = $this->headerNames[strtolower($header)]; + $header = $this->headerNames[strtolower($name)]; return $this->headers[$header]; } diff --git a/vendor/laminas/laminas-diactoros/src/Request/ArraySerializer.php b/vendor/laminas/laminas-diactoros/src/Request/ArraySerializer.php index 26cdf38d88..e3c10485fb 100644 --- a/vendor/laminas/laminas-diactoros/src/Request/ArraySerializer.php +++ b/vendor/laminas/laminas-diactoros/src/Request/ArraySerializer.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Request; @@ -29,8 +23,17 @@ final class ArraySerializer { /** * Serialize a request message to an array. + * + * @return array{ + * method: string, + * request_target: string, + * uri: string, + * protocol_version: string, + * headers: array<array<string>>, + * body: string + * } */ - public static function toArray(RequestInterface $request) : array + public static function toArray(RequestInterface $request): array { return [ 'method' => $request->getMethod(), @@ -45,14 +48,14 @@ public static function toArray(RequestInterface $request) : array /** * Deserialize a request array to a request instance. * - * @throws Exception\DeserializationException when cannot deserialize response + * @throws Exception\DeserializationException When the response cannot be deserialized. */ - public static function fromArray(array $serializedRequest) : Request + public static function fromArray(array $serializedRequest): Request { try { - $uri = self::getValueFromKey($serializedRequest, 'uri'); - $method = self::getValueFromKey($serializedRequest, 'method'); - $body = new Stream('php://memory', 'wb+'); + $uri = self::getValueFromKey($serializedRequest, 'uri'); + $method = self::getValueFromKey($serializedRequest, 'method'); + $body = new Stream('php://memory', 'wb+'); $body->write(self::getValueFromKey($serializedRequest, 'body')); $headers = self::getValueFromKey($serializedRequest, 'headers'); $requestTarget = self::getValueFromKey($serializedRequest, 'request_target'); @@ -70,7 +73,7 @@ public static function fromArray(array $serializedRequest) : Request * @return mixed * @throws Exception\DeserializationException */ - private static function getValueFromKey(array $data, string $key, string $message = null) + private static function getValueFromKey(array $data, string $key, ?string $message = null) { if (isset($data[$key])) { return $data[$key]; diff --git a/vendor/laminas/laminas-diactoros/src/Request/Serializer.php b/vendor/laminas/laminas-diactoros/src/Request/Serializer.php index 30529e4289..b6faf114bd 100644 --- a/vendor/laminas/laminas-diactoros/src/Request/Serializer.php +++ b/vendor/laminas/laminas-diactoros/src/Request/Serializer.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Request; @@ -35,9 +29,9 @@ final class Serializer extends AbstractSerializer * * Internally, casts the message to a stream and invokes fromStream(). * - * @throws Exception\SerializationException when errors occur parsing the message. + * @throws Exception\SerializationException When errors occur parsing the message. */ - public static function fromString(string $message) : Request + public static function fromString(string $message): Request { $stream = new Stream('php://temp', 'wb+'); $stream->write($message); @@ -47,11 +41,10 @@ public static function fromString(string $message) : Request /** * Deserialize a request stream to a request instance. * - * @throws Exception\InvalidArgumentException if the message stream is not - * readable or seekable. - * @throws Exception\SerializationException if an invalid request line is detected. + * @throws Exception\InvalidArgumentException If the message stream is not readable or seekable. + * @throws Exception\SerializationException If an invalid request line is detected. */ - public static function fromStream(StreamInterface $stream) : Request + public static function fromStream(StreamInterface $stream): Request { if (! $stream->isReadable() || ! $stream->isSeekable()) { throw new Exception\InvalidArgumentException('Message stream must be both readable and seekable'); @@ -60,7 +53,7 @@ public static function fromStream(StreamInterface $stream) : Request $stream->rewind(); [$method, $requestTarget, $version] = self::getRequestLine($stream); - $uri = self::createUriFromRequestTarget($requestTarget); + $uri = self::createUriFromRequestTarget($requestTarget); [$headers, $body] = self::splitStream($stream); @@ -72,12 +65,12 @@ public static function fromStream(StreamInterface $stream) : Request /** * Serialize a request message to a string. */ - public static function toString(RequestInterface $request) : string + public static function toString(RequestInterface $request): string { $httpMethod = $request->getMethod(); - $headers = self::serializeHeaders($request->getHeaders()); - $body = (string) $request->getBody(); - $format = '%s %s HTTP/%s%s%s'; + $headers = self::serializeHeaders($request->getHeaders()); + $body = (string) $request->getBody(); + $format = '%s %s HTTP/%s%s%s'; if (! empty($headers)) { $headers = "\r\n" . $headers; @@ -105,15 +98,17 @@ public static function toString(RequestInterface $request) : string * * @throws Exception\SerializationException */ - private static function getRequestLine(StreamInterface $stream) : array + private static function getRequestLine(StreamInterface $stream): array { $requestLine = self::getLine($stream); - if (! preg_match( - '#^(?P<method>[!\#$%&\'*+.^_`|~a-zA-Z0-9-]+) (?P<target>[^\s]+) HTTP/(?P<version>[1-9]\d*\.\d+)$#', - $requestLine, - $matches - )) { + if ( + ! preg_match( + '#^(?P<method>[!\#$%&\'*+.^_`|~a-zA-Z0-9-]+) (?P<target>[^\s]+) HTTP/(?P<version>[1-9]\d*\.\d+)$#', + $requestLine, + $matches + ) + ) { throw Exception\SerializationException::forInvalidRequestLine(); } @@ -127,7 +122,7 @@ private static function getRequestLine(StreamInterface $stream) : array * instance is returned; otherwise, the value is used to create and return * a new Uri instance. */ - private static function createUriFromRequestTarget(string $requestTarget) : Uri + private static function createUriFromRequestTarget(string $requestTarget): Uri { if (preg_match('#^https?://#', $requestTarget)) { return new Uri($requestTarget); diff --git a/vendor/laminas/laminas-diactoros/src/RequestFactory.php b/vendor/laminas/laminas-diactoros/src/RequestFactory.php index 1a46dd5922..9632d2770b 100644 --- a/vendor/laminas/laminas-diactoros/src/RequestFactory.php +++ b/vendor/laminas/laminas-diactoros/src/RequestFactory.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -18,7 +12,7 @@ class RequestFactory implements RequestFactoryInterface /** * {@inheritDoc} */ - public function createRequest(string $method, $uri) : RequestInterface + public function createRequest(string $method, $uri): RequestInterface { return new Request($uri, $method); } diff --git a/vendor/laminas/laminas-diactoros/src/RequestTrait.php b/vendor/laminas/laminas-diactoros/src/RequestTrait.php index 5aed04a9b3..3194682e9f 100644 --- a/vendor/laminas/laminas-diactoros/src/RequestTrait.php +++ b/vendor/laminas/laminas-diactoros/src/RequestTrait.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -15,7 +9,6 @@ use Psr\Http\Message\UriInterface; use function array_keys; -use function get_class; use function gettype; use function is_object; use function is_string; @@ -37,9 +30,7 @@ trait RequestTrait { use MessageTrait; - /** - * @var string - */ + /** @var string */ private $method = 'GET'; /** @@ -49,9 +40,7 @@ trait RequestTrait */ private $requestTarget; - /** - * @var UriInterface - */ + /** @var UriInterface */ private $uri; /** @@ -63,14 +52,14 @@ trait RequestTrait * @param null|string $method HTTP method for the request, if any. * @param string|resource|StreamInterface $body Message body, if any. * @param array $headers Headers for the message, if any. - * @throws Exception\InvalidArgumentException for any invalid value. + * @throws Exception\InvalidArgumentException For any invalid value. */ private function initialize( $uri = null, - string $method = null, + ?string $method = null, $body = 'php://memory', array $headers = [] - ) : void { + ): void { if ($method !== null) { $this->setMethod($method); } @@ -84,7 +73,7 @@ private function initialize( // Host header is provided if (! $this->hasHeader('Host') && $this->uri->getHost()) { $this->headerNames['host'] = 'Host'; - $this->headers['Host'] = [$this->getHostFromUri()]; + $this->headers['Host'] = [$this->getHostFromUri()]; } } @@ -103,7 +92,7 @@ private function initialize( * @param null|string|UriInterface $uri * @throws Exception\InvalidArgumentException */ - private function createUri($uri) : UriInterface + private function createUri($uri): UriInterface { if ($uri instanceof UriInterface) { return $uri; @@ -133,7 +122,7 @@ private function createUri($uri) : UriInterface * If no URI is available, and no request-target has been specifically * provided, this method MUST return the string "/". */ - public function getRequestTarget() : string + public function getRequestTarget(): string { if (null !== $this->requestTarget) { return $this->requestTarget; @@ -165,10 +154,12 @@ public function getRequestTarget() : string * * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various * request-target forms allowed in request messages) + * * @param string $requestTarget - * @throws Exception\InvalidArgumentException if the request target is invalid. + * @throws Exception\InvalidArgumentException If the request target is invalid. + * @return static */ - public function withRequestTarget($requestTarget) : RequestInterface + public function withRequestTarget($requestTarget): RequestInterface { if (preg_match('#\s#', $requestTarget)) { throw new Exception\InvalidArgumentException( @@ -176,7 +167,7 @@ public function withRequestTarget($requestTarget) : RequestInterface ); } - $new = clone $this; + $new = clone $this; $new->requestTarget = $requestTarget; return $new; } @@ -186,7 +177,7 @@ public function withRequestTarget($requestTarget) : RequestInterface * * @return string Returns the request method. */ - public function getMethod() : string + public function getMethod(): string { return $this->method; } @@ -203,9 +194,10 @@ public function getMethod() : string * changed request method. * * @param string $method Case-insensitive method. - * @throws Exception\InvalidArgumentException for invalid HTTP methods. + * @throws Exception\InvalidArgumentException For invalid HTTP methods. + * @return static */ - public function withMethod($method) : RequestInterface + public function withMethod($method): RequestInterface { $new = clone $this; $new->setMethod($method); @@ -218,10 +210,11 @@ public function withMethod($method) : RequestInterface * This method MUST return a UriInterface instance. * * @link http://tools.ietf.org/html/rfc3986#section-4.3 + * * @return UriInterface Returns a UriInterface instance * representing the URI of the request, if any. */ - public function getUri() : UriInterface + public function getUri(): UriInterface { return $this->uri; } @@ -247,12 +240,14 @@ public function getUri() : UriInterface * new UriInterface instance. * * @link http://tools.ietf.org/html/rfc3986#section-4.3 + * * @param UriInterface $uri New request URI to use. * @param bool $preserveHost Preserve the original state of the Host header. + * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false) : RequestInterface + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface { - $new = clone $this; + $new = clone $this; $new->uri = $uri; if ($preserveHost && $this->hasHeader('Host')) { @@ -288,14 +283,14 @@ public function withUri(UriInterface $uri, $preserveHost = false) : RequestInter * Set and validate the HTTP method * * @param string $method - * @throws Exception\InvalidArgumentException on invalid HTTP method. + * @throws Exception\InvalidArgumentException On invalid HTTP method. */ - private function setMethod($method) : void + private function setMethod($method): void { if (! is_string($method)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported HTTP method; must be a string, received %s', - is_object($method) ? get_class($method) : gettype($method) + is_object($method) ? $method::class : gettype($method) )); } @@ -311,7 +306,7 @@ private function setMethod($method) : void /** * Retrieve the host from the URI instance */ - private function getHostFromUri() : string + private function getHostFromUri(): string { $host = $this->uri->getHost(); $host .= $this->uri->getPort() ? ':' . $this->uri->getPort() : ''; diff --git a/vendor/laminas/laminas-diactoros/src/Response.php b/vendor/laminas/laminas-diactoros/src/Response.php index 1c15255776..0fc353d727 100644 --- a/vendor/laminas/laminas-diactoros/src/Response.php +++ b/vendor/laminas/laminas-diactoros/src/Response.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -16,7 +10,9 @@ use function gettype; use function is_float; use function is_numeric; +use function is_object; use function is_scalar; +use function is_string; use function sprintf; /** @@ -30,15 +26,15 @@ class Response implements ResponseInterface { use MessageTrait; - const MIN_STATUS_CODE_VALUE = 100; - const MAX_STATUS_CODE_VALUE = 599; + public const MIN_STATUS_CODE_VALUE = 100; + public const MAX_STATUS_CODE_VALUE = 599; /** * Map of standard HTTP status code/reason phrases * - * @var array + * @psalm-var array<positive-int, non-empty-string> */ - private $phrases = [ + private array $phrases = [ // INFORMATIONAL CODES 100 => 'Continue', 101 => 'Switching Protocols', @@ -79,14 +75,14 @@ class Response implements ResponseInterface 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', - 413 => 'Payload Too Large', + 413 => 'Content Too Large', 414 => 'URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Range Not Satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 421 => 'Misdirected Request', - 422 => 'Unprocessable Entity', + 422 => 'Unprocessable Content', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Too Early', @@ -107,26 +103,20 @@ class Response implements ResponseInterface 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', - 510 => 'Not Extended', + 510 => 'Not Extended (OBSOLETED)', 511 => 'Network Authentication Required', 599 => 'Network Connect Timeout Error', ]; - /** - * @var string - */ - private $reasonPhrase; + private string $reasonPhrase; - /** - * @var int - */ - private $statusCode; + private int $statusCode; /** * @param string|resource|StreamInterface $body Stream identifier and/or actual stream resource * @param int $status Status code for the response, if any. * @param array $headers Headers for the response, if any. - * @throws Exception\InvalidArgumentException on any invalid element. + * @throws Exception\InvalidArgumentException On any invalid element. */ public function __construct($body = 'php://memory', int $status = 200, array $headers = []) { @@ -138,7 +128,7 @@ public function __construct($body = 'php://memory', int $status = 200, array $he /** * {@inheritdoc} */ - public function getStatusCode() : int + public function getStatusCode(): int { return $this->statusCode; } @@ -146,7 +136,7 @@ public function getStatusCode() : int /** * {@inheritdoc} */ - public function getReasonPhrase() : string + public function getReasonPhrase(): string { return $this->reasonPhrase; } @@ -154,7 +144,7 @@ public function getReasonPhrase() : string /** * {@inheritdoc} */ - public function withStatus($code, $reasonPhrase = '') : Response + public function withStatus($code, $reasonPhrase = ''): Response { $new = clone $this; $new->setStatusCode($code, $reasonPhrase); @@ -166,11 +156,12 @@ public function withStatus($code, $reasonPhrase = '') : Response * * @param int $code * @param string $reasonPhrase - * @throws Exception\InvalidArgumentException on an invalid status code. + * @throws Exception\InvalidArgumentException On an invalid status code. */ - private function setStatusCode($code, $reasonPhrase = '') : void + private function setStatusCode($code, $reasonPhrase = ''): void { - if (! is_numeric($code) + if ( + ! is_numeric($code) || is_float($code) || $code < static::MIN_STATUS_CODE_VALUE || $code > static::MAX_STATUS_CODE_VALUE @@ -186,7 +177,7 @@ private function setStatusCode($code, $reasonPhrase = '') : void if (! is_string($reasonPhrase)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported response reason phrase; must be a string, received %s', - is_object($reasonPhrase) ? get_class($reasonPhrase) : gettype($reasonPhrase) + is_object($reasonPhrase) ? $reasonPhrase::class : gettype($reasonPhrase) )); } @@ -195,6 +186,6 @@ private function setStatusCode($code, $reasonPhrase = '') : void } $this->reasonPhrase = $reasonPhrase; - $this->statusCode = (int) $code; + $this->statusCode = (int) $code; } } diff --git a/vendor/laminas/laminas-diactoros/src/Response/ArraySerializer.php b/vendor/laminas/laminas-diactoros/src/Response/ArraySerializer.php index b5ffd74d05..0828e79837 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/ArraySerializer.php +++ b/vendor/laminas/laminas-diactoros/src/Response/ArraySerializer.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -29,8 +23,16 @@ final class ArraySerializer { /** * Serialize a response message to an array. + * + * @return array{ + * status_code: int, + * reason_phrase: string, + * protocol_version: string, + * headers: array<array<string>>, + * body: string + * } */ - public static function toArray(ResponseInterface $response) : array + public static function toArray(ResponseInterface $response): array { return [ 'status_code' => $response->getStatusCode(), @@ -44,9 +46,9 @@ public static function toArray(ResponseInterface $response) : array /** * Deserialize a response array to a response instance. * - * @throws Exception\DeserializationException when cannot deserialize response + * @throws Exception\DeserializationException When cannot deserialize response. */ - public static function fromArray(array $serializedResponse) : Response + public static function fromArray(array $serializedResponse): Response { try { $body = new Stream('php://memory', 'wb+'); @@ -66,13 +68,10 @@ public static function fromArray(array $serializedResponse) : Response } /** - * @param array $data - * @param string $key - * @param string $message * @return mixed - * @throws UnexpectedValueException + * @throws Exception\DeserializationException */ - private static function getValueFromKey(array $data, string $key, string $message = null) + private static function getValueFromKey(array $data, string $key, ?string $message = null) { if (isset($data[$key])) { return $data[$key]; diff --git a/vendor/laminas/laminas-diactoros/src/Response/EmptyResponse.php b/vendor/laminas/laminas-diactoros/src/Response/EmptyResponse.php index 3dd56596f4..82140e8112 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/EmptyResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/EmptyResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -34,9 +28,8 @@ public function __construct(int $status = 204, array $headers = []) * Create an empty response with the given headers. * * @param array $headers Headers for the response. - * @return EmptyResponse */ - public static function withHeaders(array $headers) : EmptyResponse + public static function withHeaders(array $headers): EmptyResponse { return new static(204, $headers); } diff --git a/vendor/laminas/laminas-diactoros/src/Response/HtmlResponse.php b/vendor/laminas/laminas-diactoros/src/Response/HtmlResponse.php index 7c718e23e7..746f3df322 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/HtmlResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/HtmlResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -15,7 +9,6 @@ use Laminas\Diactoros\Stream; use Psr\Http\Message\StreamInterface; -use function get_class; use function gettype; use function is_object; use function is_string; @@ -41,7 +34,7 @@ class HtmlResponse extends Response * @param string|StreamInterface $html HTML or stream for the message body. * @param int $status Integer status code for the response; 200 by default. * @param array $headers Array of headers to use at initialization. - * @throws Exception\InvalidArgumentException if $html is neither a string or stream. + * @throws Exception\InvalidArgumentException If $html is neither a string or stream. */ public function __construct($html, int $status = 200, array $headers = []) { @@ -56,9 +49,9 @@ public function __construct($html, int $status = 200, array $headers = []) * Create the message body. * * @param string|StreamInterface $html - * @throws Exception\InvalidArgumentException if $html is neither a string or stream. + * @throws Exception\InvalidArgumentException If $html is neither a string or stream. */ - private function createBody($html) : StreamInterface + private function createBody($html): StreamInterface { if ($html instanceof StreamInterface) { return $html; @@ -67,8 +60,8 @@ private function createBody($html) : StreamInterface if (! is_string($html)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid content (%s) provided to %s', - (is_object($html) ? get_class($html) : gettype($html)), - __CLASS__ + is_object($html) ? $html::class : gettype($html), + self::class )); } diff --git a/vendor/laminas/laminas-diactoros/src/Response/InjectContentTypeTrait.php b/vendor/laminas/laminas-diactoros/src/Response/InjectContentTypeTrait.php index 920fe9ad7c..aa27fadf6b 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/InjectContentTypeTrait.php +++ b/vendor/laminas/laminas-diactoros/src/Response/InjectContentTypeTrait.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -21,11 +15,13 @@ trait InjectContentTypeTrait * * @return array Headers with injected Content-Type */ - private function injectContentType(string $contentType, array $headers) : array + private function injectContentType(string $contentType, array $headers): array { - $hasContentType = array_reduce(array_keys($headers), function ($carry, $item) { - return $carry ?: (strtolower($item) === 'content-type'); - }, false); + $hasContentType = array_reduce( + array_keys($headers), + static fn($carry, $item) => $carry ?: strtolower($item) === 'content-type', + false + ); if (! $hasContentType) { $headers['content-type'] = [$contentType]; diff --git a/vendor/laminas/laminas-diactoros/src/Response/JsonResponse.php b/vendor/laminas/laminas-diactoros/src/Response/JsonResponse.php index 9cddf183e2..8dcad1b2c5 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/JsonResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/JsonResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -22,6 +16,11 @@ use function sprintf; use const JSON_ERROR_NONE; +use const JSON_HEX_AMP; +use const JSON_HEX_APOS; +use const JSON_HEX_QUOT; +use const JSON_HEX_TAG; +use const JSON_UNESCAPED_SLASHES; /** * JSON response. @@ -35,26 +34,19 @@ class JsonResponse extends Response use InjectContentTypeTrait; /** - * Default flags for json_encode; value of: - * - * <code> - * JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES - * </code> + * Default flags for json_encode * * @const int */ - const DEFAULT_JSON_FLAGS = 79; + public const DEFAULT_JSON_FLAGS = JSON_HEX_TAG + | JSON_HEX_APOS + | JSON_HEX_AMP + | JSON_HEX_QUOT + | JSON_UNESCAPED_SLASHES; - /** - * @var mixed - */ + /** @var mixed */ private $payload; - /** - * @var int - */ - private $encodingOptions; - /** * Create a JSON response with the given data. * @@ -71,16 +63,15 @@ class JsonResponse extends Response * @param int $status Integer status code for the response; 200 by default. * @param array $headers Array of headers to use at initialization. * @param int $encodingOptions JSON encoding options to use. - * @throws Exception\InvalidArgumentException if unable to encode the $data to JSON. + * @throws Exception\InvalidArgumentException If unable to encode the $data to JSON. */ public function __construct( $data, int $status = 200, array $headers = [], - int $encodingOptions = self::DEFAULT_JSON_FLAGS + private int $encodingOptions = self::DEFAULT_JSON_FLAGS ) { $this->setPayload($data); - $this->encodingOptions = $encodingOptions; $json = $this->jsonEncode($data, $this->encodingOptions); $body = $this->createBodyFromJson($json); @@ -98,29 +89,26 @@ public function getPayload() return $this->payload; } - /** - * @param mixed $data - */ - public function withPayload($data) : JsonResponse + public function withPayload(mixed $data): JsonResponse { $new = clone $this; $new->setPayload($data); return $this->updateBodyFor($new); } - public function getEncodingOptions() : int + public function getEncodingOptions(): int { return $this->encodingOptions; } - public function withEncodingOptions(int $encodingOptions) : JsonResponse + public function withEncodingOptions(int $encodingOptions): JsonResponse { - $new = clone $this; + $new = clone $this; $new->encodingOptions = $encodingOptions; return $this->updateBodyFor($new); } - private function createBodyFromJson(string $json) : Stream + private function createBodyFromJson(string $json): Stream { $body = new Stream('php://temp', 'wb+'); $body->write($json); @@ -132,10 +120,9 @@ private function createBodyFromJson(string $json) : Stream /** * Encode the provided data to JSON. * - * @param mixed $data - * @throws Exception\InvalidArgumentException if unable to encode the $data to JSON. + * @throws Exception\InvalidArgumentException If unable to encode the $data to JSON. */ - private function jsonEncode($data, int $encodingOptions) : string + private function jsonEncode(mixed $data, int $encodingOptions): string { if (is_resource($data)) { throw new Exception\InvalidArgumentException('Cannot JSON encode resources'); @@ -149,7 +136,7 @@ private function jsonEncode($data, int $encodingOptions) : string if (JSON_ERROR_NONE !== json_last_error()) { throw new Exception\InvalidArgumentException(sprintf( 'Unable to encode data to JSON in %s: %s', - __CLASS__, + self::class, json_last_error_msg() )); } @@ -157,10 +144,7 @@ private function jsonEncode($data, int $encodingOptions) : string return $json; } - /** - * @param mixed $data - */ - private function setPayload($data) : void + private function setPayload(mixed $data): void { if (is_object($data)) { $data = clone $data; @@ -175,7 +159,7 @@ private function setPayload($data) : void * @param self $toUpdate Instance to update. * @return JsonResponse Returns a new instance with an updated body. */ - private function updateBodyFor(JsonResponse $toUpdate) : JsonResponse + private function updateBodyFor(JsonResponse $toUpdate): JsonResponse { $json = $this->jsonEncode($toUpdate->payload, $toUpdate->encodingOptions); $body = $this->createBodyFromJson($json); diff --git a/vendor/laminas/laminas-diactoros/src/Response/RedirectResponse.php b/vendor/laminas/laminas-diactoros/src/Response/RedirectResponse.php index eb50a83c5c..0f42ebc92f 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/RedirectResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/RedirectResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -14,7 +8,6 @@ use Laminas\Diactoros\Response; use Psr\Http\Message\UriInterface; -use function get_class; use function gettype; use function is_object; use function is_string; @@ -42,8 +35,8 @@ public function __construct($uri, int $status = 302, array $headers = []) if (! is_string($uri) && ! $uri instanceof UriInterface) { throw new Exception\InvalidArgumentException(sprintf( 'Uri provided to %s MUST be a string or Psr\Http\Message\UriInterface instance; received "%s"', - __CLASS__, - (is_object($uri) ? get_class($uri) : gettype($uri)) + self::class, + is_object($uri) ? $uri::class : gettype($uri) )); } diff --git a/vendor/laminas/laminas-diactoros/src/Response/Serializer.php b/vendor/laminas/laminas-diactoros/src/Response/Serializer.php index 4c6f740b26..01cceef0e2 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/Serializer.php +++ b/vendor/laminas/laminas-diactoros/src/Response/Serializer.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -25,9 +19,9 @@ final class Serializer extends AbstractSerializer /** * Deserialize a response string to a response instance. * - * @throws Exception\SerializationException when errors occur parsing the message. + * @throws Exception\SerializationException When errors occur parsing the message. */ - public static function fromString(string $message) : Response + public static function fromString(string $message): Response { $stream = new Stream('php://temp', 'wb+'); $stream->write($message); @@ -37,10 +31,10 @@ public static function fromString(string $message) : Response /** * Parse a response from a stream. * - * @throws Exception\InvalidArgumentException when the stream is not readable. - * @throws Exception\SerializationException when errors occur parsing the message. + * @throws Exception\InvalidArgumentException When the stream is not readable. + * @throws Exception\SerializationException When errors occur parsing the message. */ - public static function fromStream(StreamInterface $stream) : Response + public static function fromStream(StreamInterface $stream): Response { if (! $stream->isReadable() || ! $stream->isSeekable()) { throw new Exception\InvalidArgumentException('Message stream must be both readable and seekable'); @@ -59,7 +53,7 @@ public static function fromStream(StreamInterface $stream) : Response /** * Create a string representation of a response. */ - public static function toString(ResponseInterface $response) : string + public static function toString(ResponseInterface $response): string { $reasonPhrase = $response->getReasonPhrase(); $headers = self::serializeHeaders($response->getHeaders()); @@ -76,7 +70,7 @@ public static function toString(ResponseInterface $response) : string $format, $response->getProtocolVersion(), $response->getStatusCode(), - ($reasonPhrase ? ' ' . $reasonPhrase : ''), + $reasonPhrase ? ' ' . $reasonPhrase : '', $headers, $body ); @@ -86,20 +80,22 @@ public static function toString(ResponseInterface $response) : string * Retrieve the status line for the message. * * @return array Array with three elements: 0 => version, 1 => status, 2 => reason - * @throws Exception\SerializationException if line is malformed + * @throws Exception\SerializationException If line is malformed. */ - private static function getStatusLine(StreamInterface $stream) : array + private static function getStatusLine(StreamInterface $stream): array { $line = self::getLine($stream); - if (! preg_match( - '#^HTTP/(?P<version>[1-9]\d*\.\d) (?P<status>[1-5]\d{2})(\s+(?P<reason>.+))?$#', - $line, - $matches - )) { + if ( + ! preg_match( + '#^HTTP/(?P<version>[1-9]\d*\.\d) (?P<status>[1-5]\d{2})(\s+(?P<reason>.+))?$#', + $line, + $matches + ) + ) { throw Exception\SerializationException::forInvalidStatusLine(); } - return [$matches['version'], (int) $matches['status'], isset($matches['reason']) ? $matches['reason'] : '']; + return [$matches['version'], (int) $matches['status'], $matches['reason'] ?? '']; } } diff --git a/vendor/laminas/laminas-diactoros/src/Response/TextResponse.php b/vendor/laminas/laminas-diactoros/src/Response/TextResponse.php index f72bdbeb6a..602984911c 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/TextResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/TextResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -15,7 +9,6 @@ use Laminas\Diactoros\Stream; use Psr\Http\Message\StreamInterface; -use function get_class; use function gettype; use function is_object; use function is_string; @@ -41,7 +34,7 @@ class TextResponse extends Response * @param string|StreamInterface $text String or stream for the message body. * @param int $status Integer status code for the response; 200 by default. * @param array $headers Array of headers to use at initialization. - * @throws Exception\InvalidArgumentException if $text is neither a string or stream. + * @throws Exception\InvalidArgumentException If $text is neither a string or stream. */ public function __construct($text, int $status = 200, array $headers = []) { @@ -56,9 +49,9 @@ public function __construct($text, int $status = 200, array $headers = []) * Create the message body. * * @param string|StreamInterface $text - * @throws Exception\InvalidArgumentException if $text is neither a string or stream. + * @throws Exception\InvalidArgumentException If $text is neither a string or stream. */ - private function createBody($text) : StreamInterface + private function createBody($text): StreamInterface { if ($text instanceof StreamInterface) { return $text; @@ -67,8 +60,8 @@ private function createBody($text) : StreamInterface if (! is_string($text)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid content (%s) provided to %s', - (is_object($text) ? get_class($text) : gettype($text)), - __CLASS__ + is_object($text) ? $text::class : gettype($text), + self::class )); } diff --git a/vendor/laminas/laminas-diactoros/src/Response/XmlResponse.php b/vendor/laminas/laminas-diactoros/src/Response/XmlResponse.php index 06c71ddb84..8a4d4237e8 100644 --- a/vendor/laminas/laminas-diactoros/src/Response/XmlResponse.php +++ b/vendor/laminas/laminas-diactoros/src/Response/XmlResponse.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros\Response; @@ -15,7 +9,6 @@ use Laminas\Diactoros\Stream; use Psr\Http\Message\StreamInterface; -use function get_class; use function gettype; use function is_object; use function is_string; @@ -40,7 +33,7 @@ class XmlResponse extends Response * @param string|StreamInterface $xml String or stream for the message body. * @param int $status Integer status code for the response; 200 by default. * @param array $headers Array of headers to use at initialization. - * @throws Exception\InvalidArgumentException if $text is neither a string or stream. + * @throws Exception\InvalidArgumentException If $text is neither a string or stream. */ public function __construct( $xml, @@ -58,9 +51,9 @@ public function __construct( * Create the message body. * * @param string|StreamInterface $xml - * @throws Exception\InvalidArgumentException if $xml is neither a string or stream. + * @throws Exception\InvalidArgumentException If $xml is neither a string or stream. */ - private function createBody($xml) : StreamInterface + private function createBody($xml): StreamInterface { if ($xml instanceof StreamInterface) { return $xml; @@ -69,8 +62,8 @@ private function createBody($xml) : StreamInterface if (! is_string($xml)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid content (%s) provided to %s', - (is_object($xml) ? get_class($xml) : gettype($xml)), - __CLASS__ + is_object($xml) ? $xml::class : gettype($xml), + self::class )); } diff --git a/vendor/laminas/laminas-diactoros/src/ResponseFactory.php b/vendor/laminas/laminas-diactoros/src/ResponseFactory.php index 3ff3881838..b605d2dbbd 100644 --- a/vendor/laminas/laminas-diactoros/src/ResponseFactory.php +++ b/vendor/laminas/laminas-diactoros/src/ResponseFactory.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -18,7 +12,7 @@ class ResponseFactory implements ResponseFactoryInterface /** * {@inheritDoc} */ - public function createResponse(int $code = 200, string $reasonPhrase = '') : ResponseInterface + public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface { return (new Response()) ->withStatus($code, $reasonPhrase); diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequest.php b/vendor/laminas/laminas-diactoros/src/ServerRequest.php index 11973e0a70..8fdfd4491a 100644 --- a/vendor/laminas/laminas-diactoros/src/ServerRequest.php +++ b/vendor/laminas/laminas-diactoros/src/ServerRequest.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -16,7 +10,10 @@ use Psr\Http\Message\UriInterface; use function array_key_exists; +use function gettype; use function is_array; +use function is_object; +use function sprintf; /** * Server-side HTTP request @@ -36,35 +33,9 @@ class ServerRequest implements ServerRequestInterface { use RequestTrait; - /** - * @var array - */ - private $attributes = []; - - /** - * @var array - */ - private $cookieParams = []; - - /** - * @var null|array|object - */ - private $parsedBody; - - /** - * @var array - */ - private $queryParams = []; - - /** - * @var array - */ - private $serverParams; + private array $attributes = []; - /** - * @var array - */ - private $uploadedFiles; + private array $uploadedFiles; /** * @param array $serverParams Server parameters, typically from $_SERVER @@ -73,22 +44,22 @@ class ServerRequest implements ServerRequestInterface * @param null|string $method HTTP method for the request, if any. * @param string|resource|StreamInterface $body Message body, if any. * @param array $headers Headers for the message, if any. - * @param array $cookies Cookies for the message, if any. + * @param array $cookieParams Cookies for the message, if any. * @param array $queryParams Query params for the message, if any. * @param null|array|object $parsedBody The deserialized body parameters, if any. * @param string $protocol HTTP protocol version. - * @throws Exception\InvalidArgumentException for any invalid value. + * @throws Exception\InvalidArgumentException For any invalid value. */ public function __construct( - array $serverParams = [], + private array $serverParams = [], array $uploadedFiles = [], $uri = null, - string $method = null, + ?string $method = null, $body = 'php://input', array $headers = [], - array $cookies = [], - array $queryParams = [], - $parsedBody = null, + private array $cookieParams = [], + private array $queryParams = [], + private $parsedBody = null, string $protocol = '1.1' ) { $this->validateUploadedFiles($uploadedFiles); @@ -98,18 +69,14 @@ public function __construct( } $this->initialize($uri, $method, $body, $headers); - $this->serverParams = $serverParams; $this->uploadedFiles = $uploadedFiles; - $this->cookieParams = $cookies; - $this->queryParams = $queryParams; - $this->parsedBody = $parsedBody; $this->protocol = $protocol; } /** * {@inheritdoc} */ - public function getServerParams() : array + public function getServerParams(): array { return $this->serverParams; } @@ -117,7 +84,7 @@ public function getServerParams() : array /** * {@inheritdoc} */ - public function getUploadedFiles() : array + public function getUploadedFiles(): array { return $this->uploadedFiles; } @@ -125,10 +92,10 @@ public function getUploadedFiles() : array /** * {@inheritdoc} */ - public function withUploadedFiles(array $uploadedFiles) : ServerRequest + public function withUploadedFiles(array $uploadedFiles): ServerRequest { $this->validateUploadedFiles($uploadedFiles); - $new = clone $this; + $new = clone $this; $new->uploadedFiles = $uploadedFiles; return $new; } @@ -136,7 +103,7 @@ public function withUploadedFiles(array $uploadedFiles) : ServerRequest /** * {@inheritdoc} */ - public function getCookieParams() : array + public function getCookieParams(): array { return $this->cookieParams; } @@ -144,9 +111,9 @@ public function getCookieParams() : array /** * {@inheritdoc} */ - public function withCookieParams(array $cookies) : ServerRequest + public function withCookieParams(array $cookies): ServerRequest { - $new = clone $this; + $new = clone $this; $new->cookieParams = $cookies; return $new; } @@ -154,7 +121,7 @@ public function withCookieParams(array $cookies) : ServerRequest /** * {@inheritdoc} */ - public function getQueryParams() : array + public function getQueryParams(): array { return $this->queryParams; } @@ -162,9 +129,9 @@ public function getQueryParams() : array /** * {@inheritdoc} */ - public function withQueryParams(array $query) : ServerRequest + public function withQueryParams(array $query): ServerRequest { - $new = clone $this; + $new = clone $this; $new->queryParams = $query; return $new; } @@ -180,7 +147,7 @@ public function getParsedBody() /** * {@inheritdoc} */ - public function withParsedBody($data) : ServerRequest + public function withParsedBody($data): ServerRequest { if (! is_array($data) && ! is_object($data) && null !== $data) { throw new Exception\InvalidArgumentException(sprintf( @@ -190,7 +157,7 @@ public function withParsedBody($data) : ServerRequest )); } - $new = clone $this; + $new = clone $this; $new->parsedBody = $data; return $new; } @@ -198,7 +165,7 @@ public function withParsedBody($data) : ServerRequest /** * {@inheritdoc} */ - public function getAttributes() : array + public function getAttributes(): array { return $this->attributes; } @@ -218,9 +185,9 @@ public function getAttribute($attribute, $default = null) /** * {@inheritdoc} */ - public function withAttribute($attribute, $value) : ServerRequest + public function withAttribute($attribute, $value): ServerRequest { - $new = clone $this; + $new = clone $this; $new->attributes[$attribute] = $value; return $new; } @@ -228,19 +195,19 @@ public function withAttribute($attribute, $value) : ServerRequest /** * {@inheritdoc} */ - public function withoutAttribute($attribute) : ServerRequest + public function withoutAttribute($name): ServerRequest { $new = clone $this; - unset($new->attributes[$attribute]); + unset($new->attributes[$name]); return $new; } /** * Recursively validate the structure in an uploaded files array. * - * @throws Exception\InvalidArgumentException if any leaf is not an UploadedFileInterface instance. + * @throws Exception\InvalidArgumentException If any leaf is not an UploadedFileInterface instance. */ - private function validateUploadedFiles(array $uploadedFiles) : void + private function validateUploadedFiles(array $uploadedFiles): void { foreach ($uploadedFiles as $file) { if (is_array($file)) { diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequestFactory.php b/vendor/laminas/laminas-diactoros/src/ServerRequestFactory.php index 9261ae8022..5c6718e34b 100644 --- a/vendor/laminas/laminas-diactoros/src/ServerRequestFactory.php +++ b/vendor/laminas/laminas-diactoros/src/ServerRequestFactory.php @@ -1,15 +1,11 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; +use Laminas\Diactoros\ServerRequestFilter\FilterServerRequestInterface; +use Laminas\Diactoros\ServerRequestFilter\FilterUsingXForwardedHeaders; use Psr\Http\Message\ServerRequestFactoryInterface; use Psr\Http\Message\ServerRequestInterface; @@ -18,11 +14,6 @@ /** * Class for marshaling a request object from the current PHP environment. - * - * Logic largely refactored from the Laminas Laminas\Http\PhpEnvironment\Request class. - * - * @copyright Copyright (c) 2005-2015 Laminas (https://www.zend.com) - * @license https://getlaminas.org/license/new-bsd New BSD License */ class ServerRequestFactory implements ServerRequestFactoryInterface { @@ -43,21 +34,29 @@ class ServerRequestFactory implements ServerRequestFactoryInterface * order to marshal the request URI and headers. * * @see fromServer() + * * @param array $server $_SERVER superglobal * @param array $query $_GET superglobal * @param array $body $_POST superglobal * @param array $cookies $_COOKIE superglobal * @param array $files $_FILES superglobal - * @return ServerRequest + * @param null|FilterServerRequestInterface $requestFilter If present, the + * generated request will be passed to this instance and the result + * returned by this method. When not present, a default instance of + * FilterUsingXForwardedHeaders is created, using the `trustReservedSubnets()` + * constructor. */ public static function fromGlobals( - array $server = null, - array $query = null, - array $body = null, - array $cookies = null, - array $files = null - ) : ServerRequest { - $server = normalizeServer( + ?array $server = null, + ?array $query = null, + ?array $body = null, + ?array $cookies = null, + ?array $files = null, + ?FilterServerRequestInterface $requestFilter = null + ): ServerRequest { + $requestFilter = $requestFilter ?: FilterUsingXForwardedHeaders::trustReservedSubnets(); + + $server = normalizeServer( $server ?: $_SERVER, is_callable(self::$apacheRequestHeaders) ? self::$apacheRequestHeaders : null ); @@ -68,10 +67,10 @@ public static function fromGlobals( $cookies = parseCookieHeader($headers['cookie']); } - return new ServerRequest( + return $requestFilter(new ServerRequest( $server, $files, - marshalUriFromSapi($server, $headers), + UriFactory::createFromSapi($server, $headers), marshalMethodFromSapi($server), 'php://input', $headers, @@ -79,13 +78,13 @@ public static function fromGlobals( $query ?: $_GET, $body ?: $_POST, marshalProtocolVersionFromSapi($server) - ); + )); } /** * {@inheritDoc} */ - public function createServerRequest(string $method, $uri, array $serverParams = []) : ServerRequestInterface + public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface { $uploadedFiles = []; diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/DoNotFilter.php b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/DoNotFilter.php new file mode 100644 index 0000000000..7a6867a863 --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/DoNotFilter.php @@ -0,0 +1,15 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\ServerRequestFilter; + +use Psr\Http\Message\ServerRequestInterface; + +final class DoNotFilter implements FilterServerRequestInterface +{ + public function __invoke(ServerRequestInterface $request): ServerRequestInterface + { + return $request; + } +} diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterServerRequestInterface.php b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterServerRequestInterface.php new file mode 100644 index 0000000000..4de57d6d5f --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterServerRequestInterface.php @@ -0,0 +1,29 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\ServerRequestFilter; + +use Psr\Http\Message\ServerRequestInterface; + +/** + * Filter/initialize a server request. + * + * Implementations of this interface will take an incoming request, and + * decide if additional modifications are necessary. As examples: + * + * - Injecting a unique request identifier header. + * - Using the X-Forwarded-* headers to rewrite the URI to reflect the original request. + * - Using the Forwarded header to rewrite the URI to reflect the original request. + * + * This functionality is consumed by the ServerRequestFactory using the request + * instance it generates, just prior to returning a request. + */ +interface FilterServerRequestInterface +{ + /** + * Determine if a request needs further modification, and if so, return a + * new instance reflecting those modifications. + */ + public function __invoke(ServerRequestInterface $request): ServerRequestInterface; +} diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php new file mode 100644 index 0000000000..1ddcb53391 --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/FilterUsingXForwardedHeaders.php @@ -0,0 +1,263 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\ServerRequestFilter; + +use Laminas\Diactoros\Exception\InvalidForwardedHeaderNameException; +use Laminas\Diactoros\Exception\InvalidProxyAddressException; +use Laminas\Diactoros\UriFactory; +use Psr\Http\Message\ServerRequestInterface; + +use function assert; +use function count; +use function explode; +use function filter_var; +use function in_array; +use function is_string; +use function str_contains; +use function strtolower; + +use const FILTER_FLAG_IPV4; +use const FILTER_FLAG_IPV6; +use const FILTER_VALIDATE_IP; + +/** + * Modify the URI to reflect the X-Forwarded-* headers. + * + * If the request comes from a trusted proxy, this filter will analyze the + * various X-Forwarded-* headers, if any, and if they are marked as trusted, + * in order to return a new request that composes a URI instance that reflects + * those headers. + * + * @psalm-immutable +*/ +final class FilterUsingXForwardedHeaders implements FilterServerRequestInterface +{ + public const HEADER_HOST = 'X-FORWARDED-HOST'; + public const HEADER_PORT = 'X-FORWARDED-PORT'; + public const HEADER_PROTO = 'X-FORWARDED-PROTO'; + + private const X_FORWARDED_HEADERS = [ + self::HEADER_HOST, + self::HEADER_PORT, + self::HEADER_PROTO, + ]; + + /** + * Only allow construction via named constructors + * + * @param list<non-empty-string> $trustedProxies + * @param list<FilterUsingXForwardedHeaders::HEADER_*> $trustedHeaders + */ + private function __construct(private array $trustedProxies = [], private array $trustedHeaders = []) + { + } + + public function __invoke(ServerRequestInterface $request): ServerRequestInterface + { + $remoteAddress = $request->getServerParams()['REMOTE_ADDR'] ?? ''; + + if ('' === $remoteAddress || ! is_string($remoteAddress)) { + // Should we trigger a warning here? + return $request; + } + + if (! $this->isFromTrustedProxy($remoteAddress)) { + // Do nothing + return $request; + } + + // Update the URI based on the trusted headers + $uri = $originalUri = $request->getUri(); + foreach ($this->trustedHeaders as $headerName) { + $header = $request->getHeaderLine($headerName); + if ('' === $header || str_contains($header, ',')) { + // Reject empty headers and/or headers with multiple values + continue; + } + + switch ($headerName) { + case self::HEADER_HOST: + [$host, $port] = UriFactory::marshalHostAndPortFromHeader($header); + $uri = $uri + ->withHost($host); + if ($port !== null) { + $uri = $uri->withPort($port); + } + break; + case self::HEADER_PORT: + $uri = $uri->withPort((int) $header); + break; + case self::HEADER_PROTO: + $scheme = strtolower($header) === 'https' ? 'https' : 'http'; + $uri = $uri->withScheme($scheme); + break; + } + } + + if ($uri !== $originalUri) { + return $request->withUri($uri); + } + + return $request; + } + + /** + * Indicate which proxies and which X-Forwarded headers to trust. + * + * @param list<non-empty-string> $proxyCIDRList Each element may + * be an IP address or a subnet specified using CIDR notation; both IPv4 + * and IPv6 are supported. The special string "*" will be translated to + * two entries, "0.0.0.0/0" and "::/0". An empty list indicates no + * proxies are trusted. + * @param list<FilterUsingXForwardedHeaders::HEADER_*> $trustedHeaders If + * the list is empty, all X-Forwarded headers are trusted. + * @throws InvalidProxyAddressException + * @throws InvalidForwardedHeaderNameException + */ + public static function trustProxies( + array $proxyCIDRList, + array $trustedHeaders = self::X_FORWARDED_HEADERS + ): self { + $proxyCIDRList = self::normalizeProxiesList($proxyCIDRList); + self::validateTrustedHeaders($trustedHeaders); + + return new self($proxyCIDRList, $trustedHeaders); + } + + /** + * Trust any X-FORWARDED-* headers from any address. + * + * This is functionally equivalent to calling `trustProxies(['*'])`. + * + * WARNING: Only do this if you know for certain that your application + * sits behind a trusted proxy that cannot be spoofed. This should only + * be the case if your server is not publicly addressable, and all requests + * are routed via a reverse proxy (e.g., a load balancer, a server such as + * Caddy, when using Traefik, etc.). + */ + public static function trustAny(): self + { + return self::trustProxies(['*']); + } + + /** + * Trust X-Forwarded headers from reserved subnetworks. + * + * This is functionally equivalent to calling `trustProxies()` where the + * `$proxcyCIDRList` argument is a list with the following: + * + * - 10.0.0.0/8 + * - 127.0.0.0/8 + * - 172.16.0.0/12 + * - 192.168.0.0/16 + * - ::1/128 (IPv6 localhost) + * - fc00::/7 (IPv6 private networks) + * - fe80::/10 (IPv6 local-link addresses) + * + * @param list<FilterUsingXForwardedHeaders::HEADER_*> $trustedHeaders If + * the list is empty, all X-Forwarded headers are trusted. + * @throws InvalidForwardedHeaderNameException + */ + public static function trustReservedSubnets(array $trustedHeaders = self::X_FORWARDED_HEADERS): self + { + return self::trustProxies([ + '10.0.0.0/8', + '127.0.0.0/8', + '172.16.0.0/12', + '192.168.0.0/16', + '::1/128', // ipv6 localhost + 'fc00::/7', // ipv6 private networks + 'fe80::/10', // ipv6 local-link addresses + ], $trustedHeaders); + } + + private function isFromTrustedProxy(string $remoteAddress): bool + { + foreach ($this->trustedProxies as $proxy) { + if (IPRange::matches($remoteAddress, $proxy)) { + return true; + } + } + + return false; + } + + /** @throws InvalidForwardedHeaderNameException */ + private static function validateTrustedHeaders(array $headers): void + { + foreach ($headers as $header) { + if (! in_array($header, self::X_FORWARDED_HEADERS, true)) { + throw InvalidForwardedHeaderNameException::forHeader($header); + } + } + } + + /** + * @param list<non-empty-string> $proxyCIDRList + * @return list<non-empty-string> + * @throws InvalidProxyAddressException + */ + private static function normalizeProxiesList(array $proxyCIDRList): array + { + $foundWildcard = false; + + foreach ($proxyCIDRList as $index => $cidr) { + if ($cidr === '*') { + unset($proxyCIDRList[$index]); + $foundWildcard = true; + continue; + } + + if (! self::validateProxyCIDR($cidr)) { + throw InvalidProxyAddressException::forAddress($cidr); + } + } + + if ($foundWildcard) { + $proxyCIDRList[] = '0.0.0.0/0'; + $proxyCIDRList[] = '::/0'; + } + + return $proxyCIDRList; + } + + private static function validateProxyCIDR(mixed $cidr): bool + { + if (! is_string($cidr) || '' === $cidr) { + return false; + } + + $address = $cidr; + $mask = null; + if (str_contains($cidr, '/')) { + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$address, $mask] = $parts; + $mask = (int) $mask; + } + + if (str_contains($address, ':')) { + // is IPV6 + return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) + && ( + $mask === null + || ( + $mask <= 128 + && $mask >= 0 + ) + ); + } + + // is IPV4 + return filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) + && ( + $mask === null + || ( + $mask <= 32 + && $mask >= 0 + ) + ); + } +} diff --git a/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php new file mode 100644 index 0000000000..fbdb65ee8f --- /dev/null +++ b/vendor/laminas/laminas-diactoros/src/ServerRequestFilter/IPRange.php @@ -0,0 +1,124 @@ +<?php + +declare(strict_types=1); + +namespace Laminas\Diactoros\ServerRequestFilter; + +use function assert; +use function count; +use function explode; +use function inet_pton; +use function intval; +use function ip2long; +use function pack; +use function sprintf; +use function str_contains; +use function str_pad; +use function str_repeat; +use function substr_compare; +use function unpack; + +/** @internal */ +final class IPRange +{ + /** + * Disable instantiation + */ + private function __construct() + { + } + + /** @psalm-pure */ + public static function matches(string $ip, string $cidr): bool + { + if (str_contains($ip, ':')) { + return self::matchesIPv6($ip, $cidr); + } + + return self::matchesIPv4($ip, $cidr); + } + + /** @psalm-pure */ + public static function matchesIPv4(string $ip, string $cidr): bool + { + $mask = 32; + $subnet = $cidr; + + if (str_contains($cidr, '/')) { + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$subnet, $mask] = $parts; + $mask = (int) $mask; + } + + if ($mask < 0 || $mask > 32) { + return false; + } + + $ip = ip2long($ip); + $subnet = ip2long($subnet); + if (false === $ip || false === $subnet) { + // Invalid data + return false; + } + + return 0 === substr_compare( + sprintf("%032b", $ip), + sprintf("%032b", $subnet), + 0, + $mask + ); + } + + /** @psalm-pure */ + public static function matchesIPv6(string $ip, string $cidr): bool + { + $mask = 128; + $subnet = $cidr; + + if (str_contains($cidr, '/')) { + $parts = explode('/', $cidr, 2); + assert(count($parts) >= 2); + [$subnet, $mask] = $parts; + $mask = (int) $mask; + } + + if ($mask < 0 || $mask > 128) { + return false; + } + + $ip = inet_pton($ip); + $subnet = inet_pton($subnet); + + if (false === $ip || false === $subnet) { + // Invalid data + return false; + } + + // mask 0: if it's a valid IP, it's valid + if ($mask === 0) { + return (bool) unpack('n*', $ip); + } + + // @see http://stackoverflow.com/questions/7951061/matching-ipv6-address-to-a-cidr-subnet, MW answer + $binMask = str_repeat("f", intval($mask / 4)); + switch ($mask % 4) { + case 0: + break; + case 1: + $binMask .= "8"; + break; + case 2: + $binMask .= "c"; + break; + case 3: + $binMask .= "e"; + break; + } + + $binMask = str_pad($binMask, 32, '0'); + $binMask = pack("H*", $binMask); + + return ($ip & $binMask) === $subnet; + } +} diff --git a/vendor/laminas/laminas-diactoros/src/Stream.php b/vendor/laminas/laminas-diactoros/src/Stream.php index 9098fe0b33..96c0982ebd 100644 --- a/vendor/laminas/laminas-diactoros/src/Stream.php +++ b/vendor/laminas/laminas-diactoros/src/Stream.php @@ -1,17 +1,14 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; +use GdImage; use Psr\Http\Message\StreamInterface; use RuntimeException; +use Stringable; +use Throwable; use function array_key_exists; use function fclose; @@ -23,35 +20,35 @@ use function ftell; use function fwrite; use function get_resource_type; +use function in_array; use function is_int; use function is_resource; use function is_string; -use function restore_error_handler; -use function set_error_handler; +use function sprintf; use function stream_get_contents; use function stream_get_meta_data; use function strstr; -use const E_WARNING; use const SEEK_SET; /** * Implementation of PSR HTTP streams */ -class Stream implements StreamInterface +class Stream implements StreamInterface, Stringable { /** - * @var resource|null + * A list of allowed stream resource types that are allowed to instantiate a Stream */ + private const ALLOWED_STREAM_RESOURCE_TYPES = ['gd', 'stream']; + + /** @var resource|null */ protected $resource; - /** - * @var string|resource - */ + /** @var string|object|resource|null */ protected $stream; /** - * @param string|resource $stream + * @param string|object|resource $stream * @param string $mode Mode with which to open stream * @throws Exception\InvalidArgumentException */ @@ -63,7 +60,7 @@ public function __construct($stream, string $mode = 'r') /** * {@inheritdoc} */ - public function __toString() : string + public function __toString(): string { if (! $this->isReadable()) { return ''; @@ -75,7 +72,7 @@ public function __toString() : string } return $this->getContents(); - } catch (RuntimeException $e) { + } catch (RuntimeException) { return ''; } } @@ -83,7 +80,7 @@ public function __toString() : string /** * {@inheritdoc} */ - public function close() : void + public function close(): void { if (! $this->resource) { return; @@ -98,7 +95,7 @@ public function close() : void */ public function detach() { - $resource = $this->resource; + $resource = $this->resource; $this->resource = null; return $resource; } @@ -106,13 +103,11 @@ public function detach() /** * Attach a new stream/resource to the instance. * - * @param string|resource $resource - * @param string $mode - * @throws Exception\InvalidArgumentException for stream identifier that cannot be - * cast to a resource - * @throws Exception\InvalidArgumentException for non-resource stream + * @param string|object|resource $resource + * @throws Exception\InvalidArgumentException For stream identifier that cannot be cast to a resource. + * @throws Exception\InvalidArgumentException For non-resource stream. */ - public function attach($resource, string $mode = 'r') : void + public function attach($resource, string $mode = 'r'): void { $this->setStream($resource, $mode); } @@ -120,7 +115,7 @@ public function attach($resource, string $mode = 'r') : void /** * {@inheritdoc} */ - public function getSize() : ?int + public function getSize(): ?int { if (null === $this->resource) { return null; @@ -137,7 +132,7 @@ public function getSize() : ?int /** * {@inheritdoc} */ - public function tell() : int + public function tell(): int { if (! $this->resource) { throw Exception\UntellableStreamException::dueToMissingResource(); @@ -154,7 +149,7 @@ public function tell() : int /** * {@inheritdoc} */ - public function eof() : bool + public function eof(): bool { if (! $this->resource) { return true; @@ -166,7 +161,7 @@ public function eof() : bool /** * {@inheritdoc} */ - public function isSeekable() : bool + public function isSeekable(): bool { if (! $this->resource) { return false; @@ -179,7 +174,7 @@ public function isSeekable() : bool /** * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET) : void + public function seek($offset, $whence = SEEK_SET): void { if (! $this->resource) { throw Exception\UnseekableStreamException::dueToMissingResource(); @@ -199,7 +194,7 @@ public function seek($offset, $whence = SEEK_SET) : void /** * {@inheritdoc} */ - public function rewind() : void + public function rewind(): void { $this->seek(0); } @@ -207,7 +202,7 @@ public function rewind() : void /** * {@inheritdoc} */ - public function isWritable() : bool + public function isWritable(): bool { if (! $this->resource) { return false; @@ -216,19 +211,17 @@ public function isWritable() : bool $meta = stream_get_meta_data($this->resource); $mode = $meta['mode']; - return ( - strstr($mode, 'x') + return strstr($mode, 'x') || strstr($mode, 'w') || strstr($mode, 'c') || strstr($mode, 'a') - || strstr($mode, '+') - ); + || strstr($mode, '+'); } /** * {@inheritdoc} */ - public function write($string) : int + public function write($string): int { if (! $this->resource) { throw Exception\UnwritableStreamException::dueToMissingResource(); @@ -250,7 +243,7 @@ public function write($string) : int /** * {@inheritdoc} */ - public function isReadable() : bool + public function isReadable(): bool { if (! $this->resource) { return false; @@ -259,13 +252,13 @@ public function isReadable() : bool $meta = stream_get_meta_data($this->resource); $mode = $meta['mode']; - return (strstr($mode, 'r') || strstr($mode, '+')); + return strstr($mode, 'r') || strstr($mode, '+'); } /** * {@inheritdoc} */ - public function read($length) : string + public function read($length): string { if (! $this->resource) { throw Exception\UnreadableStreamException::dueToMissingResource(); @@ -287,7 +280,7 @@ public function read($length) : string /** * {@inheritdoc} */ - public function getContents() : string + public function getContents(): string { if (! $this->isReadable()) { throw Exception\UnreadableStreamException::dueToConfiguration(); @@ -320,32 +313,27 @@ public function getMetadata($key = null) /** * Set the internal stream resource. * - * @param string|resource $stream String stream target or stream resource. + * @param string|object|resource $stream String stream target or stream resource. * @param string $mode Resource mode for stream target. - * @throws Exception\InvalidArgumentException for invalid streams or resources. + * @throws Exception\InvalidArgumentException For invalid streams or resources. */ - private function setStream($stream, string $mode = 'r') : void + private function setStream($stream, string $mode = 'r'): void { - $error = null; $resource = $stream; if (is_string($stream)) { - set_error_handler(function ($e) use (&$error) { - if ($e !== E_WARNING) { - return; - } - - $error = $e; - }); - $resource = fopen($stream, $mode); - restore_error_handler(); - } - - if ($error) { - throw new Exception\InvalidArgumentException('Invalid stream reference provided'); + try { + $resource = fopen($stream, $mode); + } catch (Throwable $error) { + throw new Exception\RuntimeException( + sprintf('Invalid stream reference provided: %s', $error->getMessage()), + 0, + $error + ); + } } - if (! is_resource($resource) || 'stream' !== get_resource_type($resource)) { + if (! $this->isValidStreamResourceType($resource)) { throw new Exception\InvalidArgumentException( 'Invalid stream provided; must be a string stream identifier or stream resource' ); @@ -357,4 +345,23 @@ private function setStream($stream, string $mode = 'r') : void $this->resource = $resource; } + + /** + * Determine if a resource is one of the resource types allowed to instantiate a Stream + * + * @param mixed $resource Stream resource. + * @psalm-assert-if-true resource $resource + */ + private function isValidStreamResourceType(mixed $resource): bool + { + if (is_resource($resource)) { + return in_array(get_resource_type($resource), self::ALLOWED_STREAM_RESOURCE_TYPES, true); + } + + if ($resource instanceof GdImage) { + return true; + } + + return false; + } } diff --git a/vendor/laminas/laminas-diactoros/src/StreamFactory.php b/vendor/laminas/laminas-diactoros/src/StreamFactory.php index ada7bdc941..54596dbaee 100644 --- a/vendor/laminas/laminas-diactoros/src/StreamFactory.php +++ b/vendor/laminas/laminas-diactoros/src/StreamFactory.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -15,8 +9,6 @@ use function fopen; use function fwrite; -use function get_resource_type; -use function is_resource; use function rewind; class StreamFactory implements StreamFactoryInterface @@ -24,7 +16,7 @@ class StreamFactory implements StreamFactoryInterface /** * {@inheritDoc} */ - public function createStream(string $content = '') : StreamInterface + public function createStream(string $content = ''): StreamInterface { $resource = fopen('php://temp', 'r+'); fwrite($resource, $content); @@ -36,7 +28,7 @@ public function createStream(string $content = '') : StreamInterface /** * {@inheritDoc} */ - public function createStreamFromFile(string $file, string $mode = 'r') : StreamInterface + public function createStreamFromFile(string $file, string $mode = 'r'): StreamInterface { return new Stream($file, $mode); } @@ -44,13 +36,8 @@ public function createStreamFromFile(string $file, string $mode = 'r') : StreamI /** * {@inheritDoc} */ - public function createStreamFromResource($resource) : StreamInterface + public function createStreamFromResource($resource): StreamInterface { - if (! is_resource($resource) || 'stream' !== get_resource_type($resource)) { - throw new Exception\InvalidArgumentException( - 'Invalid stream provided; must be a stream resource' - ); - } return new Stream($resource); } } diff --git a/vendor/laminas/laminas-diactoros/src/UploadedFile.php b/vendor/laminas/laminas-diactoros/src/UploadedFile.php index e1a579fed0..50407365e3 100644 --- a/vendor/laminas/laminas-diactoros/src/UploadedFile.php +++ b/vendor/laminas/laminas-diactoros/src/UploadedFile.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -15,16 +9,16 @@ use function dirname; use function fclose; +use function file_exists; use function fopen; use function fwrite; use function is_dir; -use function is_int; use function is_resource; use function is_string; use function is_writable; use function move_uploaded_file; -use function sprintf; -use function strpos; +use function str_starts_with; +use function unlink; use const PHP_SAPI; use const UPLOAD_ERR_CANT_WRITE; @@ -38,7 +32,7 @@ class UploadedFile implements UploadedFileInterface { - const ERROR_MESSAGES = [ + public const ERROR_MESSAGES = [ UPLOAD_ERR_OK => 'There is no error, the file uploaded with success', UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive in php.ini', UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was ' @@ -50,55 +44,25 @@ class UploadedFile implements UploadedFileInterface UPLOAD_ERR_EXTENSION => 'A PHP extension stopped the file upload.', ]; - /** - * @var string|null - */ - private $clientFilename; - - /** - * @var string|null - */ - private $clientMediaType; - - /** - * @var int - */ - private $error; + private int $error; - /** - * @var null|string - */ - private $file; + private ?string $file = null; - /** - * @var bool - */ - private $moved = false; + private bool $moved = false; - /** - * @var int - */ - private $size; - - /** - * @var null|StreamInterface - */ + /** @var null|StreamInterface */ private $stream; /** - * @param string|resource $streamOrFile - * @param int $size - * @param int $errorStatus - * @param string|null $clientFilename - * @param string|null $clientMediaType + * @param string|resource|StreamInterface $streamOrFile * @throws Exception\InvalidArgumentException */ public function __construct( $streamOrFile, - int $size, + private int $size, int $errorStatus, - string $clientFilename = null, - string $clientMediaType = null + private ?string $clientFilename = null, + private ?string $clientMediaType = null ) { if ($errorStatus === UPLOAD_ERR_OK) { if (is_string($streamOrFile)) { @@ -116,25 +80,20 @@ public function __construct( } } - $this->size = $size; - if (0 > $errorStatus || 8 < $errorStatus) { throw new Exception\InvalidArgumentException( 'Invalid error status for UploadedFile; must be an UPLOAD_ERR_* constant' ); } $this->error = $errorStatus; - - $this->clientFilename = $clientFilename; - $this->clientMediaType = $clientMediaType; } /** * {@inheritdoc} - * @throws Exception\UploadedFileAlreadyMovedException if the upload was - * not successful. + * + * @throws Exception\UploadedFileAlreadyMovedException If the upload was not successful. */ - public function getStream() : StreamInterface + public function getStream(): StreamInterface { if ($this->error !== UPLOAD_ERR_OK) { throw Exception\UploadedFileErrorException::dueToStreamUploadError( @@ -159,13 +118,14 @@ public function getStream() : StreamInterface * * @see http://php.net/is_uploaded_file * @see http://php.net/move_uploaded_file + * * @param string $targetPath Path to which to move the uploaded file. - * @throws Exception\UploadedFileErrorException if the upload was not successful. - * @throws Exception\InvalidArgumentException if the $path specified is invalid. - * @throws Exception\UploadedFileErrorException on any error during the + * @throws Exception\UploadedFileErrorException If the upload was not successful. + * @throws Exception\InvalidArgumentException If the $path specified is invalid. + * @throws Exception\UploadedFileErrorException On any error during the * move operation, or on the second or subsequent call to the method. */ - public function moveTo($targetPath) : void + public function moveTo($targetPath): void { if ($this->moved) { throw new Exception\UploadedFileAlreadyMovedException('Cannot move file; already moved!'); @@ -190,9 +150,16 @@ public function moveTo($targetPath) : void $sapi = PHP_SAPI; switch (true) { - case (empty($sapi) || 0 === strpos($sapi, 'cli') || 0 === strpos($sapi, 'phpdbg') || ! $this->file): + case empty($sapi) || str_starts_with($sapi, 'cli') || str_starts_with($sapi, 'phpdbg') || ! $this->file: // Non-SAPI environment, or no filename present $this->writeFile($targetPath); + + if ($this->stream instanceof StreamInterface) { + $this->stream->close(); + } + if (is_string($this->file) && file_exists($this->file)) { + unlink($this->file); + } break; default: // SAPI environment, with file present @@ -210,7 +177,7 @@ public function moveTo($targetPath) : void * * @return int|null The file size in bytes or null if unknown. */ - public function getSize() : ?int + public function getSize(): ?int { return $this->size; } @@ -219,9 +186,10 @@ public function getSize() : ?int * {@inheritdoc} * * @see http://php.net/manual/en/features.file-upload.errors.php + * * @return int One of PHP's UPLOAD_ERR_XXX constants. */ - public function getError() : int + public function getError(): int { return $this->error; } @@ -232,7 +200,7 @@ public function getError() : int * @return string|null The filename sent by the client or null if none * was provided. */ - public function getClientFilename() : ?string + public function getClientFilename(): ?string { return $this->clientFilename; } @@ -240,17 +208,15 @@ public function getClientFilename() : ?string /** * {@inheritdoc} */ - public function getClientMediaType() : ?string + public function getClientMediaType(): ?string { return $this->clientMediaType; } /** * Write internal stream to given path - * - * @param string $path */ - private function writeFile(string $path) : void + private function writeFile(string $path): void { $handle = fopen($path, 'wb+'); if (false === $handle) { diff --git a/vendor/laminas/laminas-diactoros/src/UploadedFileFactory.php b/vendor/laminas/laminas-diactoros/src/UploadedFileFactory.php index 46a7d7c5cd..1fa5fa348b 100644 --- a/vendor/laminas/laminas-diactoros/src/UploadedFileFactory.php +++ b/vendor/laminas/laminas-diactoros/src/UploadedFileFactory.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -23,11 +17,11 @@ class UploadedFileFactory implements UploadedFileFactoryInterface */ public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null - ) : UploadedFileInterface { + ?string $clientFilename = null, + ?string $clientMediaType = null + ): UploadedFileInterface { if ($size === null) { $size = $stream->getSize(); } diff --git a/vendor/laminas/laminas-diactoros/src/Uri.php b/vendor/laminas/laminas-diactoros/src/Uri.php index 64e4c844df..59f776eee8 100644 --- a/vendor/laminas/laminas-diactoros/src/Uri.php +++ b/vendor/laminas/laminas-diactoros/src/Uri.php @@ -1,22 +1,18 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; use Psr\Http\Message\UriInterface; +use SensitiveParameter; +use Stringable; use function array_keys; use function explode; -use function get_class; use function gettype; use function implode; +use function is_float; use function is_numeric; use function is_object; use function is_string; @@ -27,8 +23,9 @@ use function preg_replace_callback; use function rawurlencode; use function sprintf; +use function str_contains; use function str_split; -use function strpos; +use function str_starts_with; use function strtolower; use function substr; @@ -41,71 +38,49 @@ * might change state are implemented such that they retain the internal * state of the current instance and return a new instance that contains the * changed state. + * + * @psalm-immutable */ -class Uri implements UriInterface +class Uri implements UriInterface, Stringable { /** * Sub-delimiters used in user info, query strings and fragments. * * @const string */ - const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + public const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; /** * Unreserved characters used in user info, paths, query strings, and fragments. * * @const string */ - const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL'; + public const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~\pL'; - /** - * @var int[] Array indexed by valid scheme names to their corresponding ports. - */ + /** @var int[] Array indexed by valid scheme names to their corresponding ports. */ protected $allowedSchemes = [ 'http' => 80, 'https' => 443, ]; - /** - * @var string - */ - private $scheme = ''; + private string $scheme = ''; - /** - * @var string - */ - private $userInfo = ''; + private string $userInfo = ''; - /** - * @var string - */ - private $host = ''; + private string $host = ''; - /** - * @var int - */ - private $port; + private ?int $port = null; - /** - * @var string - */ - private $path = ''; + private string $path = ''; - /** - * @var string - */ - private $query = ''; + private string $query = ''; - /** - * @var string - */ - private $fragment = ''; + private string $fragment = ''; /** * generated uri string cache - * @var string|null */ - private $uriString; + private ?string $uriString = null; public function __construct(string $uri = '') { @@ -130,16 +105,17 @@ public function __clone() /** * {@inheritdoc} */ - public function __toString() : string + public function __toString(): string { if (null !== $this->uriString) { return $this->uriString; } + /** @psalm-suppress ImpureMethodCall, InaccessibleProperty */ $this->uriString = static::createUriString( $this->scheme, $this->getAuthority(), - $this->getPath(), // Absolute URIs should use a "/" for an empty path + $this->path, // Absolute URIs should use a "/" for an empty path $this->query, $this->fragment ); @@ -150,7 +126,7 @@ public function __toString() : string /** * {@inheritdoc} */ - public function getScheme() : string + public function getScheme(): string { return $this->scheme; } @@ -158,7 +134,7 @@ public function getScheme() : string /** * {@inheritdoc} */ - public function getAuthority() : string + public function getAuthority(): string { if ('' === $this->host) { return ''; @@ -183,7 +159,7 @@ public function getAuthority() : string * * {@inheritdoc} */ - public function getUserInfo() : string + public function getUserInfo(): string { return $this->userInfo; } @@ -191,7 +167,7 @@ public function getUserInfo() : string /** * {@inheritdoc} */ - public function getHost() : string + public function getHost(): string { return $this->host; } @@ -199,7 +175,7 @@ public function getHost() : string /** * {@inheritdoc} */ - public function getPort() : ?int + public function getPort(): ?int { return $this->isNonStandardPort($this->scheme, $this->host, $this->port) ? $this->port @@ -209,15 +185,26 @@ public function getPort() : ?int /** * {@inheritdoc} */ - public function getPath() : string + public function getPath(): string { - return $this->path; + if ('' === $this->path) { + // No path + return $this->path; + } + + if ($this->path[0] !== '/') { + // Relative path + return $this->path; + } + + // Ensure only one leading slash, to prevent XSS attempts. + return '/' . ltrim($this->path, '/'); } /** * {@inheritdoc} */ - public function getQuery() : string + public function getQuery(): string { return $this->query; } @@ -225,7 +212,7 @@ public function getQuery() : string /** * {@inheritdoc} */ - public function getFragment() : string + public function getFragment(): string { return $this->fragment; } @@ -233,13 +220,13 @@ public function getFragment() : string /** * {@inheritdoc} */ - public function withScheme($scheme) : UriInterface + public function withScheme($scheme): UriInterface { if (! is_string($scheme)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a string argument; received %s', __METHOD__, - is_object($scheme) ? get_class($scheme) : gettype($scheme) + is_object($scheme) ? $scheme::class : gettype($scheme) )); } @@ -250,12 +237,15 @@ public function withScheme($scheme) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->scheme = $scheme; return $new; } + // The following rule is buggy for parameters attributes + // phpcs:disable SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.NoSpaceBetweenTypeHintAndParameter + /** * Create and return a new instance containing the provided user credentials. * @@ -264,20 +254,23 @@ public function withScheme($scheme) : UriInterface * * {@inheritdoc} */ - public function withUserInfo($user, $password = null) : UriInterface - { + public function withUserInfo( + $user, + #[SensitiveParameter] + $password = null + ): UriInterface { if (! is_string($user)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a string user argument; received %s', __METHOD__, - is_object($user) ? get_class($user) : gettype($user) + is_object($user) ? $user::class : gettype($user) )); } if (null !== $password && ! is_string($password)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a string or null password argument; received %s', __METHOD__, - is_object($password) ? get_class($password) : gettype($password) + is_object($password) ? $password::class : gettype($password) )); } @@ -291,22 +284,24 @@ public function withUserInfo($user, $password = null) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->userInfo = $info; return $new; } + // phpcs:enable SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.NoSpaceBetweenTypeHintAndParameter + /** * {@inheritdoc} */ - public function withHost($host) : UriInterface + public function withHost($host): UriInterface { if (! is_string($host)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a string argument; received %s', __METHOD__, - is_object($host) ? get_class($host) : gettype($host) + is_object($host) ? $host::class : gettype($host) )); } @@ -315,7 +310,7 @@ public function withHost($host) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->host = strtolower($host); return $new; @@ -324,13 +319,13 @@ public function withHost($host) : UriInterface /** * {@inheritdoc} */ - public function withPort($port) : UriInterface + public function withPort($port): UriInterface { if ($port !== null) { if (! is_numeric($port) || is_float($port)) { throw new Exception\InvalidArgumentException(sprintf( 'Invalid port "%s" specified; must be an integer, an integer string, or null', - is_object($port) ? get_class($port) : gettype($port) + is_object($port) ? $port::class : gettype($port) )); } @@ -349,7 +344,7 @@ public function withPort($port) : UriInterface )); } - $new = clone $this; + $new = clone $this; $new->port = $port; return $new; @@ -358,7 +353,7 @@ public function withPort($port) : UriInterface /** * {@inheritdoc} */ - public function withPath($path) : UriInterface + public function withPath($path): UriInterface { if (! is_string($path)) { throw new Exception\InvalidArgumentException( @@ -366,13 +361,13 @@ public function withPath($path) : UriInterface ); } - if (strpos($path, '?') !== false) { + if (str_contains($path, '?')) { throw new Exception\InvalidArgumentException( 'Invalid path provided; must not contain a query string' ); } - if (strpos($path, '#') !== false) { + if (str_contains($path, '#')) { throw new Exception\InvalidArgumentException( 'Invalid path provided; must not contain a URI fragment' ); @@ -385,7 +380,7 @@ public function withPath($path) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->path = $path; return $new; @@ -394,7 +389,7 @@ public function withPath($path) : UriInterface /** * {@inheritdoc} */ - public function withQuery($query) : UriInterface + public function withQuery($query): UriInterface { if (! is_string($query)) { throw new Exception\InvalidArgumentException( @@ -402,7 +397,7 @@ public function withQuery($query) : UriInterface ); } - if (strpos($query, '#') !== false) { + if (str_contains($query, '#')) { throw new Exception\InvalidArgumentException( 'Query string must not include a URI fragment' ); @@ -415,7 +410,7 @@ public function withQuery($query) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->query = $query; return $new; @@ -424,13 +419,13 @@ public function withQuery($query) : UriInterface /** * {@inheritdoc} */ - public function withFragment($fragment) : UriInterface + public function withFragment($fragment): UriInterface { if (! is_string($fragment)) { throw new Exception\InvalidArgumentException(sprintf( '%s expects a string argument; received %s', __METHOD__, - is_object($fragment) ? get_class($fragment) : gettype($fragment) + is_object($fragment) ? $fragment::class : gettype($fragment) )); } @@ -441,7 +436,7 @@ public function withFragment($fragment) : UriInterface return $this; } - $new = clone $this; + $new = clone $this; $new->fragment = $fragment; return $new; @@ -449,8 +444,11 @@ public function withFragment($fragment) : UriInterface /** * Parse a URI into its parts, and set the properties + * + * @psalm-suppress InaccessibleProperty Method is only called in {@see Uri::__construct} and thus immutability is + * still given. */ - private function parseUri(string $uri) : void + private function parseUri(string $uri): void { $parts = parse_url($uri); @@ -460,13 +458,13 @@ private function parseUri(string $uri) : void ); } - $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : ''; - $this->userInfo = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : ''; - $this->host = isset($parts['host']) ? strtolower($parts['host']) : ''; - $this->port = isset($parts['port']) ? $parts['port'] : null; - $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; - $this->query = isset($parts['query']) ? $this->filterQuery($parts['query']) : ''; - $this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : ''; + $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : ''; + $this->userInfo = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : ''; + $this->host = isset($parts['host']) ? strtolower($parts['host']) : ''; + $this->port = $parts['port'] ?? null; + $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; + $this->query = isset($parts['query']) ? $this->filterQuery($parts['query']) : ''; + $this->fragment = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : ''; if (isset($parts['pass'])) { $this->userInfo .= ':' . $parts['pass']; @@ -482,7 +480,7 @@ private static function createUriString( string $path, string $query, string $fragment - ) : string { + ): string { $uri = ''; if ('' !== $scheme) { @@ -493,13 +491,12 @@ private static function createUriString( $uri .= '//' . $authority; } - if ('' !== $path && '/' !== substr($path, 0, 1)) { + if ('' !== $path && ! str_starts_with($path, '/')) { $path = '/' . $path; } $uri .= $path; - if ('' !== $query) { $uri .= sprintf('?%s', $query); } @@ -514,7 +511,7 @@ private static function createUriString( /** * Is a given port non-standard for the current scheme? */ - private function isNonStandardPort(string $scheme, string $host, ?int $port) : bool + private function isNonStandardPort(string $scheme, string $host, ?int $port): bool { if ('' === $scheme) { return '' === $host || null !== $port; @@ -533,7 +530,7 @@ private function isNonStandardPort(string $scheme, string $host, ?int $port) : b * @param string $scheme Scheme name. * @return string Filtered scheme. */ - private function filterScheme(string $scheme) : string + private function filterScheme(string $scheme): string { $scheme = strtolower($scheme); $scheme = preg_replace('#:(//)?$#', '', $scheme); @@ -555,16 +552,17 @@ private function filterScheme(string $scheme) : string /** * Filters a part of user info in a URI to ensure it is properly encoded. - * - * @param string $part - * @return string */ - private function filterUserInfoPart(string $part) : string + private function filterUserInfoPart(string $part): string { $part = $this->filterInvalidUtf8($part); - // Note the addition of `%` to initial charset; this allows `|` portion - // to match and thus prevent double-encoding. + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + * Note the addition of `%` to initial charset; this allows `|` portion + * to match and thus prevent double-encoding. + */ return preg_replace_callback( '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], @@ -575,34 +573,25 @@ private function filterUserInfoPart(string $part) : string /** * Filters the path of a URI to ensure it is properly encoded. */ - private function filterPath(string $path) : string + private function filterPath(string $path): string { $path = $this->filterInvalidUtf8($path); - $path = preg_replace_callback( + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + */ + return preg_replace_callback( '/(?:[^' . self::CHAR_UNRESERVED . ')(:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], $path ); - - if ('' === $path) { - // No path - return $path; - } - - if ($path[0] !== '/') { - // Relative path - return $path; - } - - // Ensure only one leading slash, to prevent XSS attempts. - return '/' . ltrim($path, '/'); } /** * Encode invalid UTF-8 characters in given string. All other characters are unchanged. */ - private function filterInvalidUtf8(string $string) : string + private function filterInvalidUtf8(string $string): string { // check if given string contains only valid UTF-8 characters if (preg_match('//u', $string)) { @@ -624,9 +613,9 @@ private function filterInvalidUtf8(string $string) : string * * Ensures that the values in the query string are properly urlencoded. */ - private function filterQuery(string $query) : string + private function filterQuery(string $query): string { - if ('' !== $query && strpos($query, '?') === 0) { + if ('' !== $query && str_starts_with($query, '?')) { $query = substr($query, 1); } @@ -650,10 +639,9 @@ private function filterQuery(string $query) : string /** * Split a query value into a key/value tuple. * - * @param string $value * @return array A value with exactly two elements, key and value */ - private function splitQueryValue(string $value) : array + private function splitQueryValue(string $value): array { $data = explode('=', $value, 2); if (! isset($data[1])) { @@ -665,9 +653,9 @@ private function splitQueryValue(string $value) : array /** * Filter a fragment value to ensure it is properly encoded. */ - private function filterFragment(string $fragment) : string + private function filterFragment(string $fragment): string { - if ('' !== $fragment && strpos($fragment, '#') === 0) { + if ('' !== $fragment && str_starts_with($fragment, '#')) { $fragment = '%23' . substr($fragment, 1); } @@ -677,10 +665,14 @@ private function filterFragment(string $fragment) : string /** * Filter a query string key or value, or a fragment. */ - private function filterQueryOrFragment(string $value) : string + private function filterQueryOrFragment(string $value): string { $value = $this->filterInvalidUtf8($value); + /** + * @psalm-suppress ImpureFunctionCall Even tho the callback targets this immutable class, + * psalm reports an issue here. + */ return preg_replace_callback( '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/u', [$this, 'urlEncodeChar'], @@ -691,7 +683,7 @@ private function filterQueryOrFragment(string $value) : string /** * URL encode a character returned by a regex. */ - private function urlEncodeChar(array $matches) : string + private function urlEncodeChar(array $matches): string { return rawurlencode($matches[0]); } diff --git a/vendor/laminas/laminas-diactoros/src/UriFactory.php b/vendor/laminas/laminas-diactoros/src/UriFactory.php index 43db125aa7..31f5a1de86 100644 --- a/vendor/laminas/laminas-diactoros/src/UriFactory.php +++ b/vendor/laminas/laminas-diactoros/src/UriFactory.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -13,13 +7,246 @@ use Psr\Http\Message\UriFactoryInterface; use Psr\Http\Message\UriInterface; +use function array_change_key_case; +use function array_key_exists; +use function assert; +use function count; +use function explode; +use function gettype; +use function implode; +use function is_bool; +use function is_scalar; +use function is_string; +use function ltrim; +use function preg_match; +use function preg_replace; +use function sprintf; +use function str_contains; +use function strlen; +use function strrpos; +use function strtolower; +use function substr; + +use const CASE_LOWER; + class UriFactory implements UriFactoryInterface { /** * {@inheritDoc} */ - public function createUri(string $uri = '') : UriInterface + public function createUri(string $uri = ''): UriInterface { return new Uri($uri); } + + /** + * Create a Uri instance based on the headers and $_SERVER data. + * + * @param array<non-empty-string, list<string>|int|float|string> $server SAPI parameters + * @param array<string, string|list<string>> $headers + */ + public static function createFromSapi(array $server, array $headers): Uri + { + $uri = new Uri(''); + + $isHttps = false; + if (array_key_exists('HTTPS', $server)) { + $isHttps = self::marshalHttpsValue($server['HTTPS']); + } elseif (array_key_exists('https', $server)) { + $isHttps = self::marshalHttpsValue($server['https']); + } + $uri = $uri->withScheme($isHttps ? 'https' : 'http'); + + [$host, $port] = self::marshalHostAndPort($server, $headers); + if (! empty($host)) { + $uri = $uri->withHost($host); + if (! empty($port)) { + $uri = $uri->withPort($port); + } + } + + $path = self::marshalRequestPath($server); + + // Strip query string + $path = explode('?', $path, 2)[0]; + + $query = ''; + if (isset($server['QUERY_STRING']) && is_scalar($server['QUERY_STRING'])) { + $query = ltrim((string) $server['QUERY_STRING'], '?'); + } + + $fragment = ''; + if (str_contains($path, '#')) { + $parts = explode('#', $path, 2); + assert(count($parts) >= 2); + [$path, $fragment] = $parts; + } + + return $uri + ->withPath($path) + ->withFragment($fragment) + ->withQuery($query); + } + + /** + * Retrieve a header value from an array of headers using a case-insensitive lookup. + * + * @template T + * @param array<string, string|list<string>> $headers Key/value header pairs + * @param T $default Default value to return if header not found + * @return string|T + */ + private static function getHeaderFromArray(string $name, array $headers, $default = null) + { + $header = strtolower($name); + $headers = array_change_key_case($headers, CASE_LOWER); + if (! array_key_exists($header, $headers)) { + return $default; + } + + if (is_string($headers[$header])) { + return $headers[$header]; + } + + return implode(', ', $headers[$header]); + } + + /** + * Marshal the host and port from the PHP environment. + * + * @param array<string, string|list<string>> $headers + * @return array{string, int|null} Array of two items, host and port, + * in that order (can be passed to a list() operation). + */ + private static function marshalHostAndPort(array $server, array $headers): array + { + /** @var array{string, null} $defaults */ + static $defaults = ['', null]; + + $host = self::getHeaderFromArray('host', $headers, false); + if ($host !== false) { + // Ignore obviously malformed host headers: + // - Whitespace is invalid within a hostname and break the URI representation within HTTP. + // non-printable characters other than SPACE and TAB are already rejected by HeaderSecurity. + // - A comma indicates that multiple host headers have been sent which is not legal + // and might be used in an attack where a load balancer sees a different host header + // than Diactoros. + if (! preg_match('/[\\t ,]/', $host)) { + return self::marshalHostAndPortFromHeader($host); + } + } + + if (! isset($server['SERVER_NAME'])) { + return $defaults; + } + + $host = (string) $server['SERVER_NAME']; + $port = isset($server['SERVER_PORT']) ? (int) $server['SERVER_PORT'] : null; + + if ( + ! isset($server['SERVER_ADDR']) + || ! preg_match('/^\[[0-9a-fA-F\:]+\]$/', $host) + ) { + return [$host, $port]; + } + + // Misinterpreted IPv6-Address + // Reported for Safari on Windows + return self::marshalIpv6HostAndPort($server, $port); + } + + /** + * @return array{string, int|null} Array of two items, host and port, + * in that order (can be passed to a list() operation). + */ + private static function marshalIpv6HostAndPort(array $server, ?int $port): array + { + $host = '[' . (string) $server['SERVER_ADDR'] . ']'; + $port = $port ?: 80; + $portSeparatorPos = strrpos($host, ':'); + + if (false === $portSeparatorPos) { + return [$host, $port]; + } + + if ($port . ']' === substr($host, $portSeparatorPos + 1)) { + // The last digit of the IPv6-Address has been taken as port + // Unset the port so the default port can be used + $port = null; + } + return [$host, $port]; + } + + /** + * Detect the path for the request + * + * Looks at a variety of criteria in order to attempt to autodetect the base + * request path, including: + * + * - IIS7 UrlRewrite environment + * - REQUEST_URI + * - ORIG_PATH_INFO + */ + private static function marshalRequestPath(array $server): string + { + // IIS7 with URL Rewrite: make sure we get the unencoded url + // (double slash problem). + /** @var string|array<string>|null $iisUrlRewritten */ + $iisUrlRewritten = $server['IIS_WasUrlRewritten'] ?? null; + /** @var string|array<string> $unencodedUrl */ + $unencodedUrl = $server['UNENCODED_URL'] ?? ''; + if ('1' === $iisUrlRewritten && is_string($unencodedUrl) && '' !== $unencodedUrl) { + return $unencodedUrl; + } + + /** @var string|array<string>|null $requestUri */ + $requestUri = $server['REQUEST_URI'] ?? null; + + if (is_string($requestUri)) { + return preg_replace('#^[^/:]+://[^/]+#', '', $requestUri); + } + + $origPathInfo = $server['ORIG_PATH_INFO'] ?? ''; + if (! is_string($origPathInfo) || '' === $origPathInfo) { + return '/'; + } + + return $origPathInfo; + } + + private static function marshalHttpsValue(mixed $https): bool + { + if (is_bool($https)) { + return $https; + } + + if (! is_string($https)) { + throw new Exception\InvalidArgumentException(sprintf( + 'SAPI HTTPS value MUST be a string or boolean; received %s', + gettype($https) + )); + } + + return 'on' === strtolower($https); + } + + /** + * @internal + * + * @return array{string, int|null} Array of two items, host and port, in that order (can be + * passed to a list() operation). + * @psalm-mutation-free + */ + public static function marshalHostAndPortFromHeader(string $host): array + { + $port = null; + + // works for regname, IPv4 & IPv6 + if (preg_match('|\:(\d+)$|', $host, $matches)) { + $host = substr($host, 0, -1 * (strlen($matches[1]) + 1)); + $port = (int) $matches[1]; + } + + return [$host, $port]; + } } diff --git a/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php index e1563a847e..fff753ff53 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.legacy.php @@ -1,21 +1,18 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use Laminas\Diactoros\UploadedFile; + +use function func_get_args; use function Laminas\Diactoros\createUploadedFile as laminas_createUploadedFile; /** * @deprecated Use Laminas\Diactoros\createUploadedFile instead */ -function createUploadedFile(array $spec) : UploadedFile +function createUploadedFile(array $spec): UploadedFile { return laminas_createUploadedFile(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.php b/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.php index d4eeb27970..22c37e9e49 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.php +++ b/vendor/laminas/laminas-diactoros/src/functions/create_uploaded_file.php @@ -1,25 +1,22 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; +use function sprintf; + /** * Create an uploaded file instance from an array of values. * * @param array $spec A single $_FILES entry. - * @throws Exception\InvalidArgumentException if one or more of the tmp_name, + * @throws Exception\InvalidArgumentException If one or more of the tmp_name, * size, or error keys are missing from $spec. */ -function createUploadedFile(array $spec) : UploadedFile +function createUploadedFile(array $spec): UploadedFile { - if (! isset($spec['tmp_name']) + if ( + ! isset($spec['tmp_name']) || ! isset($spec['size']) || ! isset($spec['error']) ) { @@ -32,7 +29,7 @@ function createUploadedFile(array $spec) : UploadedFile return new UploadedFile( $spec['tmp_name'], - $spec['size'], + (int) $spec['size'], $spec['error'], $spec['name'] ?? null, $spec['type'] ?? null diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php index 5be17b2a95..372ad292ec 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.legacy.php @@ -1,21 +1,16 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use function func_get_args; use function Laminas\Diactoros\marshalHeadersFromSapi as laminas_marshalHeadersFromSapi; /** * @deprecated Use Laminas\Diactoros\marshalHeadersFromSapi instead */ -function marshalHeadersFromSapi(array $server) : array +function marshalHeadersFromSapi(array $server): array { return laminas_marshalHeadersFromSapi(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php index f0629d8dee..7fd09996db 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php @@ -1,18 +1,12 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; use function array_key_exists; use function is_string; -use function strpos; +use function str_starts_with; use function strtolower; use function strtr; use function substr; @@ -21,8 +15,19 @@ * @param array $server Values obtained from the SAPI (generally `$_SERVER`). * @return array Header/value pairs */ -function marshalHeadersFromSapi(array $server) : array +function marshalHeadersFromSapi(array $server): array { + $contentHeaderLookup = isset($server['LAMINAS_DIACTOROS_STRICT_CONTENT_HEADER_LOOKUP']) + ? static function (string $key): bool { + static $contentHeaders = [ + 'CONTENT_TYPE' => true, + 'CONTENT_LENGTH' => true, + 'CONTENT_MD5' => true, + ]; + return isset($contentHeaders[$key]); + } + : static fn(string $key): bool => str_starts_with($key, 'CONTENT_'); + $headers = []; foreach ($server as $key => $value) { if (! is_string($key)) { @@ -35,7 +40,7 @@ function marshalHeadersFromSapi(array $server) : array // Apache prefixes environment variables with REDIRECT_ // if they are added by rewrite rules - if (strpos($key, 'REDIRECT_') === 0) { + if (str_starts_with($key, 'REDIRECT_')) { $key = substr($key, 9); // We will not overwrite existing variables with the @@ -45,14 +50,14 @@ function marshalHeadersFromSapi(array $server) : array } } - if (strpos($key, 'HTTP_') === 0) { - $name = strtr(strtolower(substr($key, 5)), '_', '-'); + if (str_starts_with($key, 'HTTP_')) { + $name = strtr(strtolower(substr($key, 5)), '_', '-'); $headers[$name] = $value; continue; } - if (strpos($key, 'CONTENT_') === 0) { - $name = strtr(strtolower($key), '_', '-'); + if ($contentHeaderLookup($key)) { + $name = strtr(strtolower($key), '_', '-'); $headers[$name] = $value; continue; } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php index 78ad76e521..2eb83d97ab 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.legacy.php @@ -1,21 +1,16 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use function func_get_args; use function Laminas\Diactoros\marshalMethodFromSapi as laminas_marshalMethodFromSapi; /** * @deprecated Use Laminas\Diactoros\marshalMethodFromSapi instead */ -function marshalMethodFromSapi(array $server) : string +function marshalMethodFromSapi(array $server): string { return laminas_marshalMethodFromSapi(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php index 2f87841026..8feeb3169f 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -13,7 +7,7 @@ /** * Retrieve the request method from the SAPI parameters. */ -function marshalMethodFromSapi(array $server) : string +function marshalMethodFromSapi(array $server): string { return $server['REQUEST_METHOD'] ?? 'GET'; } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php index 288bd9a84f..2c69d6db60 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.legacy.php @@ -1,21 +1,16 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use function func_get_args; use function Laminas\Diactoros\marshalProtocolVersionFromSapi as laminas_marshalProtocolVersionFromSapi; /** * @deprecated Use Laminas\Diactoros\marshalProtocolVersionFromSapi instead */ -function marshalProtocolVersionFromSapi(array $server) : string +function marshalProtocolVersionFromSapi(array $server): string { return laminas_marshalProtocolVersionFromSapi(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php index 25ed91cb77..a5eefee888 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_protocol_version_from_sapi.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -15,10 +9,10 @@ /** * Return HTTP protocol version (X.Y) as discovered within a `$_SERVER` array. * - * @throws Exception\UnrecognizedProtocolVersionException if the + * @throws Exception\UnrecognizedProtocolVersionException If the * $server['SERVER_PROTOCOL'] value is malformed. */ -function marshalProtocolVersionFromSapi(array $server) : string +function marshalProtocolVersionFromSapi(array $server): string { if (! isset($server['SERVER_PROTOCOL'])) { return '1.1'; diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php index ebe9e3d74f..43fff2a815 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.legacy.php @@ -1,21 +1,18 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use Laminas\Diactoros\Uri; + +use function func_get_args; use function Laminas\Diactoros\marshalUriFromSapi as laminas_marshalUriFromSapi; /** * @deprecated Use Laminas\Diactoros\marshalUriFromSapi instead */ -function marshalUriFromSapi(array $server, array $headers) : Uri +function marshalUriFromSapi(array $server, array $headers): Uri { return laminas_marshalUriFromSapi(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php b/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php index e7b95dcbd3..186d6d9af1 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php +++ b/vendor/laminas/laminas-diactoros/src/functions/marshal_uri_from_sapi.php @@ -1,35 +1,41 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; use function array_change_key_case; use function array_key_exists; +use function assert; +use function count; use function explode; +use function gettype; use function implode; use function is_array; +use function is_bool; +use function is_string; use function ltrim; use function preg_match; use function preg_replace; +use function sprintf; +use function str_contains; use function strlen; -use function strpos; +use function strrpos; use function strtolower; use function substr; +use const CASE_LOWER; + /** * Marshal a Uri instance based on the values presnt in the $_SERVER array and headers. * + * @deprecated This function is deprecated as of 2.11.1, and will be removed in + * 3.0.0. As of 2.11.1, it is no longer used internally. + * * @param array $server SAPI parameters * @param array $headers HTTP request headers */ -function marshalUriFromSapi(array $server, array $headers) : Uri +function marshalUriFromSapi(array $server, array $headers): Uri { /** * Retrieve a header value from an array of headers using a case-insensitive lookup. @@ -38,12 +44,11 @@ function marshalUriFromSapi(array $server, array $headers) : Uri * @param mixed $default Default value to return if header not found * @return mixed */ - $getHeaderFromArray = function (string $name, array $headers, $default = null) { + $getHeaderFromArray = static function (string $name, array $headers, $default = null) { $header = strtolower($name); $headers = array_change_key_case($headers, CASE_LOWER); if (array_key_exists($header, $headers)) { - $value = is_array($headers[$header]) ? implode(', ', $headers[$header]) : $headers[$header]; - return $value; + return is_array($headers[$header]) ? implode(', ', $headers[$header]) : $headers[$header]; } return $default; @@ -55,13 +60,13 @@ function marshalUriFromSapi(array $server, array $headers) : Uri * @return array Array of two items, host and port, in that order (can be * passed to a list() operation). */ - $marshalHostAndPort = function (array $headers, array $server) use ($getHeaderFromArray) : array { + $marshalHostAndPort = static function (array $headers, array $server) use ($getHeaderFromArray): array { /** - * @param string|array $host - * @return array Array of two items, host and port, in that order (can be - * passed to a list() operation). - */ - $marshalHostAndPortFromHeader = function ($host) { + * @param string|array $host + * @return array Array of two items, host and port, in that order (can be + * passed to a list() operation). + */ + $marshalHostAndPortFromHeader = static function ($host) { if (is_array($host)) { $host = implode(', ', $host); } @@ -78,10 +83,10 @@ function marshalUriFromSapi(array $server, array $headers) : Uri }; /** - * @return array Array of two items, host and port, in that order (can be - * passed to a list() operation). - */ - $marshalIpv6HostAndPort = function (array $server, ?int $port) : array { + * @return array Array of two items, host and port, in that order (can be + * passed to a list() operation). + */ + $marshalIpv6HostAndPort = static function (array $server, ?int $port): array { $host = '[' . $server['SERVER_ADDR'] . ']'; $port = $port ?: 80; if ($port . ']' === substr($host, strrpos($host, ':') + 1)) { @@ -111,7 +116,8 @@ function marshalUriFromSapi(array $server, array $headers) : Uri $host = $server['SERVER_NAME']; $port = isset($server['SERVER_PORT']) ? (int) $server['SERVER_PORT'] : null; - if (! isset($server['SERVER_ADDR']) + if ( + ! isset($server['SERVER_ADDR']) || ! preg_match('/^\[[0-9a-fA-F\:]+\]$/', $host) ) { return [$host, $port]; @@ -134,7 +140,7 @@ function marshalUriFromSapi(array $server, array $headers) : Uri * * From Laminas\Http\PhpEnvironment\Request class */ - $marshalRequestPath = function (array $server) : string { + $marshalRequestPath = static function (array $server): string { // IIS7 with URL Rewrite: make sure we get the unencoded url // (double slash problem). $iisUrlRewritten = $server['IIS_WasUrlRewritten'] ?? null; @@ -160,8 +166,8 @@ function marshalUriFromSapi(array $server, array $headers) : Uri $uri = new Uri(''); // URI scheme - $scheme = 'http'; - $marshalHttpsValue = function ($https) : bool { + $scheme = 'http'; + $marshalHttpsValue = static function ($https): bool { if (is_bool($https)) { return $https; } @@ -183,7 +189,8 @@ function marshalUriFromSapi(array $server, array $headers) : Uri $https = false; } - if ($https + if ( + $https || strtolower($getHeaderFromArray('x-forwarded-proto', $headers, '')) === 'https' ) { $scheme = 'https'; @@ -213,8 +220,10 @@ function marshalUriFromSapi(array $server, array $headers) : Uri // URI fragment $fragment = ''; - if (strpos($path, '#') !== false) { - [$path, $fragment] = explode('#', $path, 2); + if (str_contains($path, '#')) { + $parts = explode('#', $path, 2); + assert(count($parts) >= 2); + [$path, $fragment] = $parts; } return $uri diff --git a/vendor/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php index e1e7669816..b355c4d889 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php @@ -1,21 +1,16 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use function func_get_args; use function Laminas\Diactoros\normalizeServer as laminas_normalizeServer; /** * @deprecated Use Laminas\Diactoros\normalizeServer instead */ -function normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array +function normalizeServer(array $server, ?callable $apacheRequestHeaderCallback = null): array { return laminas_normalizeServer(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/normalize_server.php b/vendor/laminas/laminas-diactoros/src/functions/normalize_server.php index d91080731b..c9efb3881d 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/normalize_server.php +++ b/vendor/laminas/laminas-diactoros/src/functions/normalize_server.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -24,7 +18,7 @@ * `apache_request_headers` under the Apache mod_php. * @return array Either $server verbatim, or with an added HTTP_AUTHORIZATION header. */ -function normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array +function normalizeServer(array $server, ?callable $apacheRequestHeaderCallback = null): array { if (null === $apacheRequestHeaderCallback && is_callable('apache_request_headers')) { $apacheRequestHeaderCallback = 'apache_request_headers'; @@ -32,7 +26,8 @@ function normalizeServer(array $server, callable $apacheRequestHeaderCallback = // If the HTTP_AUTHORIZATION value is already set, or the callback is not // callable, we return verbatim - if (isset($server['HTTP_AUTHORIZATION']) + if ( + isset($server['HTTP_AUTHORIZATION']) || ! is_callable($apacheRequestHeaderCallback) ) { return $server; diff --git a/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php index 046d54b2e9..b21323fa5c 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php @@ -1,23 +1,16 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; -use Psr\Http\Message\UploadedFileInterface; - +use function func_get_args; use function Laminas\Diactoros\normalizeUploadedFiles as laminas_normalizeUploadedFiles; /** * @deprecated Use Laminas\Diactoros\normalizeUploadedFiles instead */ -function normalizeUploadedFiles(array $files) : array +function normalizeUploadedFiles(array $files): array { return laminas_normalizeUploadedFiles(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php b/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php index 34c0ede179..5a66707f15 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php +++ b/vendor/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -13,6 +7,7 @@ use Psr\Http\Message\UploadedFileInterface; use function is_array; +use function sprintf; /** * Normalize uploaded files @@ -21,9 +16,9 @@ * arrays are normalized. * * @return UploadedFileInterface[] - * @throws Exception\InvalidArgumentException for unrecognized values + * @throws Exception\InvalidArgumentException For unrecognized values. */ -function normalizeUploadedFiles(array $files) : array +function normalizeUploadedFiles(array $files): array { /** * Traverse a nested tree of uploaded file specifications. @@ -35,13 +30,13 @@ function normalizeUploadedFiles(array $files) : array * @param string[]|array[]|null $typeTree * @return UploadedFile[]|array[] */ - $recursiveNormalize = function ( + $recursiveNormalize = static function ( array $tmpNameTree, array $sizeTree, array $errorTree, - array $nameTree = null, - array $typeTree = null - ) use (&$recursiveNormalize) : array { + ?array $nameTree = null, + ?array $typeTree = null + ) use (&$recursiveNormalize): array { $normalized = []; foreach ($tmpNameTree as $key => $value) { if (is_array($value)) { @@ -57,10 +52,10 @@ function normalizeUploadedFiles(array $files) : array } $normalized[$key] = createUploadedFile([ 'tmp_name' => $tmpNameTree[$key], - 'size' => $sizeTree[$key], - 'error' => $errorTree[$key], - 'name' => $nameTree[$key] ?? null, - 'type' => $typeTree[$key] ?? null, + 'size' => $sizeTree[$key], + 'error' => $errorTree[$key], + 'name' => $nameTree[$key] ?? null, + 'type' => $typeTree[$key] ?? null, ]); } return $normalized; @@ -80,8 +75,9 @@ function normalizeUploadedFiles(array $files) : array * @param array $files * @return UploadedFile[] */ - $normalizeUploadedFileSpecification = function (array $files = []) use (&$recursiveNormalize) : array { - if (! isset($files['tmp_name']) || ! is_array($files['tmp_name']) + $normalizeUploadedFileSpecification = static function (array $files = []) use (&$recursiveNormalize): array { + if ( + ! isset($files['tmp_name']) || ! is_array($files['tmp_name']) || ! isset($files['size']) || ! is_array($files['size']) || ! isset($files['error']) || ! is_array($files['error']) ) { diff --git a/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php b/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php index 0094483b78..8c9a46a3f0 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php +++ b/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php @@ -1,21 +1,19 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Zend\Diactoros; +use function func_get_args; use function Laminas\Diactoros\parseCookieHeader as laminas_parseCookieHeader; /** - * @deprecated Use Laminas\Diactoros\parseCookieHeader instead + * @deprecated Use {@see \Laminas\Diactoros\parseCookieHeader} instead + * + * @param string $cookieHeader A string cookie header value. + * @return array<non-empty-string, string> key/value cookie pairs. */ -function parseCookieHeader($cookieHeader) : array +function parseCookieHeader($cookieHeader): array { return laminas_parseCookieHeader(...func_get_args()); } diff --git a/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.php b/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.php index 21eda96d76..acb187fa67 100644 --- a/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.php +++ b/vendor/laminas/laminas-diactoros/src/functions/parse_cookie_header.php @@ -1,11 +1,5 @@ <?php -/** - * @see https://github.com/laminas/laminas-diactoros for the canonical source repository - * @copyright https://github.com/laminas/laminas-diactoros/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-diactoros/blob/master/LICENSE.md New BSD License - */ - declare(strict_types=1); namespace Laminas\Diactoros; @@ -13,6 +7,8 @@ use function preg_match_all; use function urldecode; +use const PREG_SET_ORDER; + /** * Parse a cookie header according to RFC 6265. * @@ -20,9 +16,9 @@ * overwriting. Thus, the server request should take the cookies from the request header instead. * * @param string $cookieHeader A string cookie header value. - * @return array key/value cookie pairs. + * @return array<non-empty-string, string> key/value cookie pairs. */ -function parseCookieHeader($cookieHeader) : array +function parseCookieHeader($cookieHeader): array { preg_match_all('( (?:^\\n?[ \t]*|;[ ]) diff --git a/vendor/laminas/laminas-zendframework-bridge/.github/FUNDING.yml b/vendor/laminas/laminas-zendframework-bridge/.github/FUNDING.yml deleted file mode 100644 index 6674aab603..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -community_bridge: laminas-project diff --git a/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md b/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md deleted file mode 100644 index 01ef5be63c..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md +++ /dev/null @@ -1,619 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.0.3 - 2020-04-03 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#63](https://github.com/laminas/laminas-zendframework-bridge/pull/63) fixes handling of dependency configuration to ensure each of delegators, initializers, and abstract factories are properly handled during configuraiton post processing. The new approach should allow delegators to work post-migration to Laminas or Mezzio. - -- [#61](https://github.com/laminas/laminas-zendframework-bridge/pull/61) ensures configuration for delegator factories gets rewritten; the functionality broke in version 1.0.1. - -## 1.0.2 - 2020-03-26 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#55](https://github.com/laminas/laminas-zendframework-bridge/pull/55) adds provisions to ensure that references to legacy classes/interfaces in dependency configuration always create aliases from the legacy to the new classes. Previously, we did straight replacements in the configuration, which could lead to the legacy service no longer being available. Now it will remain available. - -- [#59](https://github.com/laminas/laminas-zendframework-bridge/pull/59) fixes the replacement rules such as to avoid replacing references to API Skeletons packages, classes, or configuration keys. - -- [#57](https://github.com/laminas/laminas-zendframework-bridge/pull/57) fixes how references to the "zf-apigility" key are replaced. Previously, they were rewritten to "laminas-api-tools", but the correct replacement is "api-tools". - -- [#56](https://github.com/laminas/laminas-zendframework-bridge/pull/56) provides a mechanism to add additional maps with multiple levels of namespace separator escaping, in order to ensure that all various known permutations are matched. The escaping is applied to both the original and target, to ensure that rewrites conform to the original escaping. - -- [#56](https://github.com/laminas/laminas-zendframework-bridge/pull/56) makes changes to the replacement rules to ensure we do not replace references to "Zend" or "ZF" if they occur as subnamespaces OR as class names (formerly, we only enforced subnamespaces). Additional rules were provided for cases where one or both occur within our own packages. - -- [#52](https://github.com/laminas/laminas-zendframework-bridge/pull/52) fixes a scenario whereby factory _values_ were not being rewritten during configuration post processing. - -- [#52](https://github.com/laminas/laminas-zendframework-bridge/pull/52) fixes an issue that occurs with the configuration post processor. Previously, when a service name used as a factory or invokable was encountered that referenced a legacy class, it would get rewritten. This would cause issues if the service was not exposed in the original legacy package, however, as there would now be no alias of the legacy service to the new one. This patch modifies the configuration post processor such that it now tests to see if a service name it will rename exists as an alias; if not, it also creates the alias. - -## 1.0.1 - 2020-01-07 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#47](https://github.com/laminas/laminas-zendframework-bridge/pull/47) adds entries for rewriting the various `::*Zend()` methods exposed in the psr7bridge to `::*Laminas()` during migrations. - -- [#46](https://github.com/laminas/laminas-zendframework-bridge/pull/46) adds a rule to rewrite the config key `use_zend_loader` to `use_laminas_loader`. - -- [#45](https://github.com/laminas/laminas-zendframework-bridge/pull/45) adds a rule to exclude rewriting of view paths provided by the various Doctrine modules targeting the developer tools. - -## 1.0.0 - 2019-12-31 - -### Added - -- First stable release. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.4.5 - 2019-12-23 - -### Added - -- Nothing. - -### Changed - -- [#42](https://github.com/laminas/laminas-zendframework-bridge/pull/42) modifies the replacement rules to no longer rewrite zf-deploy; the package will not be coming to the new organizations. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.4.4 - 2019-12-18 - -### Added - -- Nothing. - -### Changed - -- [#40](https://github.com/laminas/laminas-zendframework-bridge/pull/40) adds exclusion rules for subnamespaces that reference Zend, ZF, ZendService, or ZendOAuth to ensure they are not rewritten. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#40](https://github.com/laminas/laminas-zendframework-bridge/pull/40) adds exclusions for classes referencing Zend Server product features to ensure they are not rewritten (e.g., `ZendServerDisk`, `ZendServerShm`, `ZendMonitor`). - -## 0.4.3 - 2019-12-17 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#39](https://github.com/laminas/laminas-zendframework-bridge/pull/39) fixes an issue when using the Auryn DI container. The class `Northwoods\Container\Zend\Config` was incorrectly being renamed to `Northwoods\Container\Laminas\Config` (which should not happen, as it is not a class under our control). - -## 0.4.2 - 2019-12-16 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#36](https://github.com/laminas/laminas-zendframework-bridge/pull/36) adds some cases for classes that contain the verbiage "Expressive" and "Apigility" ot ensure they are rewritten correctly. - -## 0.4.1 - 2019-12-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#35](https://github.com/laminas/laminas-zendframework-bridge/pull/35) removes zend-debug from the replacement list, as it is not being brought over to Laminas. - -## 0.4.0 - 2019-11-27 - -### Added - -- Nothing. - -### Changed - -- [#32](https://github.com/laminas/laminas-zendframework-bridge/pull/32) changes all references to Expressive to instead reference Mezzio. - -- [#32](https://github.com/laminas/laminas-zendframework-bridge/pull/32) changes all references to Apigility to instead reference Laminas API Tools. The vendor becomes laminas-api-tools, the URL becomes api-tools.getlaminas.org, packages and repos are prefixed with api-tools, and namespaces become `Laminas\ApiTools`. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.8 - 2019-11-14 - -### Added - -- [#29](https://github.com/laminas/laminas-zendframework-bridge/pull/29) adds entries to translate `ZendDeveloperTools` to `Laminas\DeveloperTools`, and vice-versa. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.7 - 2019-11-12 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#28](https://github.com/laminas/laminas-zendframework-bridge/pull/28) updates the `zenddevelopertools` string to rewrite to `laminas-developer-tools` instead of `laminasdevelopertools`. - -## 0.3.6 - 2019-11-07 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#27](https://github.com/laminas/laminas-zendframework-bridge/pull/27) adds a rewrite rule for zend-framework.flf => laminas-project.flf. - -## 0.3.5 - 2019-11-06 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#25](https://github.com/laminas/laminas-zendframework-bridge/pull/25) adds entries for ZendHttp and ZendModule, which are file name segments in files from the zend-feed and zend-config-aggregator-module packages, respectively. - -## 0.3.4 - 2019-11-06 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#24](https://github.com/laminas/laminas-zendframework-bridge/pull/24) adds a rule to never rewrite the string `Doctrine\Zend`. - -- [#23](https://github.com/laminas/laminas-zendframework-bridge/pull/23) adds a missing map for each of ZendAcl and ZendRbac, which occur in the zend-expressive-authorization-acl and zend-expressive-authorization-rbac packages, respectively. - -## 0.3.3 - 2019-11-06 - -### Added - -- [#22](https://github.com/laminas/laminas-zendframework-bridge/pull/22) adds configuration post-processing features, exposed both as a laminas-config-aggregator post processor (for use with Expressive applications) and as a laminas-modulemanager `EVENT_MERGE_CONFIG` listener (for use with MVC applications). When registered, it will post-process the configuration, replacing known Zend Framework-specific strings with their Laminas replacements. A ruleset is provided that ensures dependency configuration is rewritten in a safe manner, routing configuration is skipped, and certain top-level configuration keys are matched exactly (instead of potentially as substrings or word stems). A later release of laminas-migration will auto-register these tools in applications when possible. - -### Changed - -- [#22](https://github.com/laminas/laminas-zendframework-bridge/pull/22) removes support for PHP versions prior to PHP 5.6. We have decided to only support supported PHP versions, whether that support is via php.net or commercial. The lowest supported PHP version we have found is 5.6. Users wishing to migrate to Laminas must at least update to PHP 5.6 before doing so. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.2 - 2019-10-30 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) removes rewriting of the Amazon library, as it is not moving to Laminas. - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) removes rewriting of the GCM and APNS libraries, as they are not moving to Laminas. - -### Fixed - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) fixes how the recaptcha and twitter library package and namespaces are rewritten. - -## 0.3.1 - 2019-04-25 - -### Added - -- [#20](https://github.com/laminas/laminas-zendframework-bridge/pull/20) provides an additional autoloader that is _prepended_ to the autoloader - stack. This new autoloader will create class aliases for interfaces, classes, - and traits referenced in type hints and class declarations, ensuring PHP is - able to resolve them correctly during class_alias operations. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.0 - 2019-04-12 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [#16](https://github.com/laminas/laminas-zendframework-bridge/pull/16) removes the `RewriteRules::classRewrite()` method, as it is no longer - needed due to internal refactoring. - -### Fixed - -- [#16](https://github.com/laminas/laminas-zendframework-bridge/pull/16) fixes how the rewrite rules detect the word `Zend` in subnamespaces and - class names to be both more robust and simpler. - -## 0.2.5 - 2019-04-11 - -### Added - -- [#12](https://github.com/laminas/laminas-zendframework-bridge/pull/12) adds functionality for ensuring we alias namespaces and classes that - include the word `Zend` in them; e.g., `Zend\Expressive\ZendView\ZendViewRendererFactory` - will now alias to `Expressive\LaminasView\LaminasViewRendererFactory`. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.2.4 - 2019-04-11 - -### Added - -- [#11](https://github.com/laminas/laminas-zendframework-bridge/pull/11) adds maps for the Expressive router adapter packages. - -- [#10](https://github.com/laminas/laminas-zendframework-bridge/pull/10) adds a map for the Psr7Bridge package, as it used `Zend` within a subnamespace. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.2.3 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#9](https://github.com/laminas/laminas-zendframework-bridge/pull/9) fixes the mapping for the Problem Details package. - -## 0.2.2 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Added a check that the discovered alias exists as a class, interface, or trait - before attempting to call `class_alias()`. - -## 0.2.1 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#8](https://github.com/laminas/laminas-zendframework-bridge/pull/8) fixes mappings for each of zend-expressive-authentication-zendauthentication, - zend-expressive-zendrouter, and zend-expressive-zendviewrenderer. - -## 0.2.0 - 2019-04-01 - -### Added - -- Nothing. - -### Changed - -- [#4](https://github.com/laminas/laminas-zendframework-bridge/pull/4) rewrites the autoloader to be class-based, via the class - `Laminas\ZendFrameworkBridge\Autoloader`. Additionally, the new approach - provides a performance boost by using a balanced tree algorithm, ensuring - matches occur faster. - -### Deprecated - -- Nothing. - -### Removed - -- [#4](https://github.com/laminas/laminas-zendframework-bridge/pull/4) removes function aliasing. Function aliasing will move to the packages that - provide functions. - -### Fixed - -- Nothing. - -## 0.1.0 - 2019-03-27 - -### Added - -- Adds an autoloader file that registers with `spl_autoload_register` a routine - for aliasing legacy ZF class/interface/trait names to Laminas Project - equivalents. - -- Adds autoloader files for aliasing legacy ZF package functions to Laminas - Project equivalents. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. diff --git a/vendor/laminas/laminas-zendframework-bridge/COPYRIGHT.md b/vendor/laminas/laminas-zendframework-bridge/COPYRIGHT.md deleted file mode 100644 index f68704698d..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/COPYRIGHT.md +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2019-2020, Laminas Foundation. -All rights reserved. (https://getlaminas.org/) diff --git a/vendor/laminas/laminas-zendframework-bridge/LICENSE.md b/vendor/laminas/laminas-zendframework-bridge/LICENSE.md deleted file mode 100644 index 16fe8690cc..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/LICENSE.md +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019-2020, Laminas Foundation -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -- Neither the name of Laminas Foundation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/laminas/laminas-zendframework-bridge/README.md b/vendor/laminas/laminas-zendframework-bridge/README.md deleted file mode 100644 index fd7953823b..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# laminas-zendframework-bridge - -[![Build Status](https://travis-ci.com/laminas/laminas-zendframework-bridge.svg?branch=master)](https://travis-ci.com/laminas/laminas-zendframework-bridge) -[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-zendframework-bridge/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-zendframework-bridge?branch=master) - -This library provides a custom autoloader that aliases legacy Zend Framework, -Apigility, and Expressive classes to their replacements under the Laminas -Project. - -This package should be installed only if you are also using the composer plugin -that installs Laminas packages to replace ZF/Apigility/Expressive packages. - -## Installation - -Run the following to install this library: - -```bash -$ composer require laminas/laminas-zendframework-bridge -``` - -## Support - -* [Issues](https://github.com/laminas/laminas-zendframework-bridge/issues/) -* [Forum](https://discourse.laminas.dev/) diff --git a/vendor/laminas/laminas-zendframework-bridge/composer.json b/vendor/laminas/laminas-zendframework-bridge/composer.json deleted file mode 100644 index e4c9941c33..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/composer.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "laminas/laminas-zendframework-bridge", - "description": "Alias legacy ZF class names to Laminas Project equivalents.", - "license": "BSD-3-Clause", - "keywords": [ - "autoloading", - "laminas", - "zf", - "zendframework" - ], - "support": { - "issues": "https://github.com/laminas/laminas-zendframework-bridge/issues", - "source": "https://github.com/laminas/laminas-zendframework-bridge", - "rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom", - "forum": "https://discourse.laminas.dev/" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1", - "squizlabs/php_codesniffer": "^3.5" - }, - "autoload": { - "files": [ - "src/autoload.php" - ], - "psr-4": { - "Laminas\\ZendFrameworkBridge\\": "src//" - } - }, - "autoload-dev": { - "files": [ - "test/classes.php" - ], - "psr-4": { - "LaminasTest\\ZendFrameworkBridge\\": "test/", - "LaminasTest\\ZendFrameworkBridge\\TestAsset\\": "test/TestAsset/classes/", - "Laminas\\ApiTools\\": "test/TestAsset/LaminasApiTools/", - "Mezzio\\": "test/TestAsset/Mezzio/", - "Laminas\\": "test/TestAsset/Laminas/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev", - "dev-develop": "1.1.x-dev" - }, - "laminas": { - "module": "Laminas\\ZendFrameworkBridge" - } - }, - "config": { - "sort-packages": true - }, - "scripts": { - "cs-check": "phpcs", - "cs-fix": "phpcbf", - "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/config/replacements.php b/vendor/laminas/laminas-zendframework-bridge/config/replacements.php deleted file mode 100644 index 1dedebacd8..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/config/replacements.php +++ /dev/null @@ -1,371 +0,0 @@ -<?php - -return [ - // NEVER REWRITE - 'zendframework/zendframework' => 'zendframework/zendframework', - 'zend-developer-tools/toolbar/doctrine' => 'zend-developer-tools/toolbar/doctrine', - - // NAMESPACES - // Zend Framework components - 'Zend\\AuraDi\\Config' => 'Laminas\\AuraDi\\Config', - 'Zend\\Authentication' => 'Laminas\\Authentication', - 'Zend\\Barcode' => 'Laminas\\Barcode', - 'Zend\\Cache' => 'Laminas\\Cache', - 'Zend\\Captcha' => 'Laminas\\Captcha', - 'Zend\\Code' => 'Laminas\\Code', - 'ZendCodingStandard\\Sniffs' => 'LaminasCodingStandard\\Sniffs', - 'ZendCodingStandard\\Utils' => 'LaminasCodingStandard\\Utils', - 'Zend\\ComponentInstaller' => 'Laminas\\ComponentInstaller', - 'Zend\\Config' => 'Laminas\\Config', - 'Zend\\ConfigAggregator' => 'Laminas\\ConfigAggregator', - 'Zend\\ConfigAggregatorModuleManager' => 'Laminas\\ConfigAggregatorModuleManager', - 'Zend\\ConfigAggregatorParameters' => 'Laminas\\ConfigAggregatorParameters', - 'Zend\\Console' => 'Laminas\\Console', - 'Zend\\ContainerConfigTest' => 'Laminas\\ContainerConfigTest', - 'Zend\\Crypt' => 'Laminas\\Crypt', - 'Zend\\Db' => 'Laminas\\Db', - 'ZendDeveloperTools' => 'Laminas\\DeveloperTools', - 'Zend\\Di' => 'Laminas\\Di', - 'Zend\\Diactoros' => 'Laminas\\Diactoros', - 'ZendDiagnostics\\Check' => 'Laminas\\Diagnostics\\Check', - 'ZendDiagnostics\\Result' => 'Laminas\\Diagnostics\\Result', - 'ZendDiagnostics\\Runner' => 'Laminas\\Diagnostics\\Runner', - 'Zend\\Dom' => 'Laminas\\Dom', - 'Zend\\Escaper' => 'Laminas\\Escaper', - 'Zend\\EventManager' => 'Laminas\\EventManager', - 'Zend\\Feed' => 'Laminas\\Feed', - 'Zend\\File' => 'Laminas\\File', - 'Zend\\Filter' => 'Laminas\\Filter', - 'Zend\\Form' => 'Laminas\\Form', - 'Zend\\Http' => 'Laminas\\Http', - 'Zend\\HttpHandlerRunner' => 'Laminas\\HttpHandlerRunner', - 'Zend\\Hydrator' => 'Laminas\\Hydrator', - 'Zend\\I18n' => 'Laminas\\I18n', - 'Zend\\InputFilter' => 'Laminas\\InputFilter', - 'Zend\\Json' => 'Laminas\\Json', - 'Zend\\Ldap' => 'Laminas\\Ldap', - 'Zend\\Loader' => 'Laminas\\Loader', - 'Zend\\Log' => 'Laminas\\Log', - 'Zend\\Mail' => 'Laminas\\Mail', - 'Zend\\Math' => 'Laminas\\Math', - 'Zend\\Memory' => 'Laminas\\Memory', - 'Zend\\Mime' => 'Laminas\\Mime', - 'Zend\\ModuleManager' => 'Laminas\\ModuleManager', - 'Zend\\Mvc' => 'Laminas\\Mvc', - 'Zend\\Navigation' => 'Laminas\\Navigation', - 'Zend\\Paginator' => 'Laminas\\Paginator', - 'Zend\\Permissions' => 'Laminas\\Permissions', - 'Zend\\Pimple\\Config' => 'Laminas\\Pimple\\Config', - 'Zend\\ProblemDetails' => 'Mezzio\\ProblemDetails', - 'Zend\\ProgressBar' => 'Laminas\\ProgressBar', - 'Zend\\Psr7Bridge' => 'Laminas\\Psr7Bridge', - 'Zend\\Router' => 'Laminas\\Router', - 'Zend\\Serializer' => 'Laminas\\Serializer', - 'Zend\\Server' => 'Laminas\\Server', - 'Zend\\ServiceManager' => 'Laminas\\ServiceManager', - 'ZendService\\ReCaptcha' => 'Laminas\\ReCaptcha', - 'ZendService\\Twitter' => 'Laminas\\Twitter', - 'Zend\\Session' => 'Laminas\\Session', - 'Zend\\SkeletonInstaller' => 'Laminas\\SkeletonInstaller', - 'Zend\\Soap' => 'Laminas\\Soap', - 'Zend\\Stdlib' => 'Laminas\\Stdlib', - 'Zend\\Stratigility' => 'Laminas\\Stratigility', - 'Zend\\Tag' => 'Laminas\\Tag', - 'Zend\\Test' => 'Laminas\\Test', - 'Zend\\Text' => 'Laminas\\Text', - 'Zend\\Uri' => 'Laminas\\Uri', - 'Zend\\Validator' => 'Laminas\\Validator', - 'Zend\\View' => 'Laminas\\View', - 'ZendXml' => 'Laminas\\Xml', - 'Zend\\Xml2Json' => 'Laminas\\Xml2Json', - 'Zend\\XmlRpc' => 'Laminas\\XmlRpc', - 'ZendOAuth' => 'Laminas\\OAuth', - - // class ZendAcl in zend-expressive-authorization-acl - 'ZendAcl' => 'LaminasAcl', - 'Zend\\Expressive\\Authorization\\Acl\\ZendAcl' => 'Mezzio\\Authorization\\Acl\\LaminasAcl', - // class ZendHttpClientDecorator in zend-feed - 'ZendHttp' => 'LaminasHttp', - // class ZendModuleProvider in zend-config-aggregator-modulemanager - 'ZendModule' => 'LaminasModule', - // class ZendRbac in zend-expressive-authorization-rbac - 'ZendRbac' => 'LaminasRbac', - 'Zend\\Expressive\\Authorization\\Rbac\\ZendRbac' => 'Mezzio\\Authorization\\Rbac\\LaminasRbac', - // class ZendRouter in zend-expressive-router-zendrouter - 'ZendRouter' => 'LaminasRouter', - 'Zend\\Expressive\\Router\\ZendRouter' => 'Mezzio\\Router\\LaminasRouter', - // class ZendViewRenderer in zend-expressive-zendviewrenderer - 'ZendViewRenderer' => 'LaminasViewRenderer', - 'Zend\\Expressive\\ZendView\\ZendViewRenderer' => 'Mezzio\\LaminasView\\LaminasViewRenderer', - 'a\\Zend' => 'a\\Zend', - 'b\\Zend' => 'b\\Zend', - 'c\\Zend' => 'c\\Zend', - 'd\\Zend' => 'd\\Zend', - 'e\\Zend' => 'e\\Zend', - 'f\\Zend' => 'f\\Zend', - 'g\\Zend' => 'g\\Zend', - 'h\\Zend' => 'h\\Zend', - 'i\\Zend' => 'i\\Zend', - 'j\\Zend' => 'j\\Zend', - 'k\\Zend' => 'k\\Zend', - 'l\\Zend' => 'l\\Zend', - 'm\\Zend' => 'm\\Zend', - 'n\\Zend' => 'n\\Zend', - 'o\\Zend' => 'o\\Zend', - 'p\\Zend' => 'p\\Zend', - 'q\\Zend' => 'q\\Zend', - 'r\\Zend' => 'r\\Zend', - 's\\Zend' => 's\\Zend', - 't\\Zend' => 't\\Zend', - 'u\\Zend' => 'u\\Zend', - 'v\\Zend' => 'v\\Zend', - 'w\\Zend' => 'w\\Zend', - 'x\\Zend' => 'x\\Zend', - 'y\\Zend' => 'y\\Zend', - 'z\\Zend' => 'z\\Zend', - - // Expressive - 'Zend\\Expressive' => 'Mezzio', - 'ZendAuthentication' => 'LaminasAuthentication', - 'ZendAcl' => 'LaminasAcl', - 'ZendRbac' => 'LaminasRbac', - 'ZendRouter' => 'LaminasRouter', - 'ExpressiveUrlGenerator' => 'MezzioUrlGenerator', - 'ExpressiveInstaller' => 'MezzioInstaller', - - // Apigility - 'ZF\\Apigility' => 'Laminas\\ApiTools', - 'ZF\\ApiProblem' => 'Laminas\\ApiTools\\ApiProblem', - 'ZF\\AssetManager' => 'Laminas\\ApiTools\\AssetManager', - 'ZF\\ComposerAutoloading' => 'Laminas\\ComposerAutoloading', - 'ZF\\Configuration' => 'Laminas\\ApiTools\\Configuration', - 'ZF\\ContentNegotiation' => 'Laminas\\ApiTools\\ContentNegotiation', - 'ZF\\ContentValidation' => 'Laminas\\ApiTools\\ContentValidation', - 'ZF\\DevelopmentMode' => 'Laminas\\DevelopmentMode', - 'ZF\\Doctrine\\QueryBuilder' => 'Laminas\\ApiTools\\Doctrine\\QueryBuilder', - 'ZF\\Hal' => 'Laminas\\ApiTools\\Hal', - 'ZF\\HttpCache' => 'Laminas\\ApiTools\\HttpCache', - 'ZF\\MvcAuth' => 'Laminas\\ApiTools\\MvcAuth', - 'ZF\\OAuth2' => 'Laminas\\ApiTools\\OAuth2', - 'ZF\\Rest' => 'Laminas\\ApiTools\\Rest', - 'ZF\\Rpc' => 'Laminas\\ApiTools\\Rpc', - 'ZF\\Versioning' => 'Laminas\\ApiTools\\Versioning', - 'a\\ZF' => 'a\\ZF', - 'b\\ZF' => 'b\\ZF', - 'c\\ZF' => 'c\\ZF', - 'd\\ZF' => 'd\\ZF', - 'e\\ZF' => 'e\\ZF', - 'f\\ZF' => 'f\\ZF', - 'g\\ZF' => 'g\\ZF', - 'h\\ZF' => 'h\\ZF', - 'i\\ZF' => 'i\\ZF', - 'j\\ZF' => 'j\\ZF', - 'k\\ZF' => 'k\\ZF', - 'l\\ZF' => 'l\\ZF', - 'm\\ZF' => 'm\\ZF', - 'n\\ZF' => 'n\\ZF', - 'o\\ZF' => 'o\\ZF', - 'p\\ZF' => 'p\\ZF', - 'q\\ZF' => 'q\\ZF', - 'r\\ZF' => 'r\\ZF', - 's\\ZF' => 's\\ZF', - 't\\ZF' => 't\\ZF', - 'u\\ZF' => 'u\\ZF', - 'v\\ZF' => 'v\\ZF', - 'w\\ZF' => 'w\\ZF', - 'x\\ZF' => 'x\\ZF', - 'y\\ZF' => 'y\\ZF', - 'z\\ZF' => 'z\\ZF', - - 'ApigilityModuleInterface' => 'ApiToolsModuleInterface', - 'ApigilityProviderInterface' => 'ApiToolsProviderInterface', - 'ApigilityVersionController' => 'ApiToolsVersionController', - - // PACKAGES - // ZF components, MVC - 'zendframework/skeleton-application' => 'laminas/skeleton-application', - 'zendframework/zend-auradi-config' => 'laminas/laminas-auradi-config', - 'zendframework/zend-authentication' => 'laminas/laminas-authentication', - 'zendframework/zend-barcode' => 'laminas/laminas-barcode', - 'zendframework/zend-cache' => 'laminas/laminas-cache', - 'zendframework/zend-captcha' => 'laminas/laminas-captcha', - 'zendframework/zend-code' => 'laminas/laminas-code', - 'zendframework/zend-coding-standard' => 'laminas/laminas-coding-standard', - 'zendframework/zend-component-installer' => 'laminas/laminas-component-installer', - 'zendframework/zend-composer-autoloading' => 'laminas/laminas-composer-autoloading', - 'zendframework/zend-config-aggregator' => 'laminas/laminas-config-aggregator', - 'zendframework/zend-config' => 'laminas/laminas-config', - 'zendframework/zend-console' => 'laminas/laminas-console', - 'zendframework/zend-container-config-test' => 'laminas/laminas-container-config-test', - 'zendframework/zend-crypt' => 'laminas/laminas-crypt', - 'zendframework/zend-db' => 'laminas/laminas-db', - 'zendframework/zend-developer-tools' => 'laminas/laminas-developer-tools', - 'zendframework/zend-diactoros' => 'laminas/laminas-diactoros', - 'zendframework/zenddiagnostics' => 'laminas/laminas-diagnostics', - 'zendframework/zend-di' => 'laminas/laminas-di', - 'zendframework/zend-dom' => 'laminas/laminas-dom', - 'zendframework/zend-escaper' => 'laminas/laminas-escaper', - 'zendframework/zend-eventmanager' => 'laminas/laminas-eventmanager', - 'zendframework/zend-feed' => 'laminas/laminas-feed', - 'zendframework/zend-file' => 'laminas/laminas-file', - 'zendframework/zend-filter' => 'laminas/laminas-filter', - 'zendframework/zend-form' => 'laminas/laminas-form', - 'zendframework/zend-httphandlerrunner' => 'laminas/laminas-httphandlerrunner', - 'zendframework/zend-http' => 'laminas/laminas-http', - 'zendframework/zend-hydrator' => 'laminas/laminas-hydrator', - 'zendframework/zend-i18n' => 'laminas/laminas-i18n', - 'zendframework/zend-i18n-resources' => 'laminas/laminas-i18n-resources', - 'zendframework/zend-inputfilter' => 'laminas/laminas-inputfilter', - 'zendframework/zend-json' => 'laminas/laminas-json', - 'zendframework/zend-json-server' => 'laminas/laminas-json-server', - 'zendframework/zend-ldap' => 'laminas/laminas-ldap', - 'zendframework/zend-loader' => 'laminas/laminas-loader', - 'zendframework/zend-log' => 'laminas/laminas-log', - 'zendframework/zend-mail' => 'laminas/laminas-mail', - 'zendframework/zend-math' => 'laminas/laminas-math', - 'zendframework/zend-memory' => 'laminas/laminas-memory', - 'zendframework/zend-mime' => 'laminas/laminas-mime', - 'zendframework/zend-modulemanager' => 'laminas/laminas-modulemanager', - 'zendframework/zend-mvc' => 'laminas/laminas-mvc', - 'zendframework/zend-navigation' => 'laminas/laminas-navigation', - 'zendframework/zend-oauth' => 'laminas/laminas-oauth', - 'zendframework/zend-paginator' => 'laminas/laminas-paginator', - 'zendframework/zend-permissions-acl' => 'laminas/laminas-permissions-acl', - 'zendframework/zend-permissions-rbac' => 'laminas/laminas-permissions-rbac', - 'zendframework/zend-pimple-config' => 'laminas/laminas-pimple-config', - 'zendframework/zend-progressbar' => 'laminas/laminas-progressbar', - 'zendframework/zend-psr7bridge' => 'laminas/laminas-psr7bridge', - 'zendframework/zend-recaptcha' => 'laminas/laminas-recaptcha', - 'zendframework/zend-router' => 'laminas/laminas-router', - 'zendframework/zend-serializer' => 'laminas/laminas-serializer', - 'zendframework/zend-server' => 'laminas/laminas-server', - 'zendframework/zend-servicemanager' => 'laminas/laminas-servicemanager', - 'zendframework/zendservice-recaptcha' => 'laminas/laminas-recaptcha', - 'zendframework/zendservice-twitter' => 'laminas/laminas-twitter', - 'zendframework/zend-session' => 'laminas/laminas-session', - 'zendframework/zend-skeleton-installer' => 'laminas/laminas-skeleton-installer', - 'zendframework/zend-soap' => 'laminas/laminas-soap', - 'zendframework/zend-stdlib' => 'laminas/laminas-stdlib', - 'zendframework/zend-stratigility' => 'laminas/laminas-stratigility', - 'zendframework/zend-tag' => 'laminas/laminas-tag', - 'zendframework/zend-test' => 'laminas/laminas-test', - 'zendframework/zend-text' => 'laminas/laminas-text', - 'zendframework/zend-uri' => 'laminas/laminas-uri', - 'zendframework/zend-validator' => 'laminas/laminas-validator', - 'zendframework/zend-view' => 'laminas/laminas-view', - 'zendframework/zend-xml2json' => 'laminas/laminas-xml2json', - 'zendframework/zend-xml' => 'laminas/laminas-xml', - 'zendframework/zend-xmlrpc' => 'laminas/laminas-xmlrpc', - - // Expressive packages - 'zendframework/zend-expressive' => 'mezzio/mezzio', - 'zendframework/zend-expressive-zendrouter' => 'mezzio/mezzio-laminasrouter', - 'zendframework/zend-problem-details' => 'mezzio/mezzio-problem-details', - 'zendframework/zend-expressive-zendviewrenderer' => 'mezzio/mezzio-laminasviewrenderer', - - // Apigility packages - 'zfcampus/apigility-documentation' => 'laminas-api-tools/documentation', - 'zfcampus/statuslib-example' => 'laminas-api-tools/statuslib-example', - 'zfcampus/zf-apigility' => 'laminas-api-tools/api-tools', - 'zfcampus/zf-api-problem' => 'laminas-api-tools/api-tools-api-problem', - 'zfcampus/zf-asset-manager' => 'laminas-api-tools/api-tools-asset-manager', - 'zfcampus/zf-configuration' => 'laminas-api-tools/api-tools-configuration', - 'zfcampus/zf-content-negotiation' => 'laminas-api-tools/api-tools-content-negotiation', - 'zfcampus/zf-content-validation' => 'laminas-api-tools/api-tools-content-validation', - 'zfcampus/zf-development-mode' => 'laminas/laminas-development-mode', - 'zfcampus/zf-doctrine-querybuilder' => 'laminas-api-tools/api-tools-doctrine-querybuilder', - 'zfcampus/zf-hal' => 'laminas-api-tools/api-tools-hal', - 'zfcampus/zf-http-cache' => 'laminas-api-tools/api-tools-http-cache', - 'zfcampus/zf-mvc-auth' => 'laminas-api-tools/api-tools-mvc-auth', - 'zfcampus/zf-oauth2' => 'laminas-api-tools/api-tools-oauth2', - 'zfcampus/zf-rest' => 'laminas-api-tools/api-tools-rest', - 'zfcampus/zf-rpc' => 'laminas-api-tools/api-tools-rpc', - 'zfcampus/zf-versioning' => 'laminas-api-tools/api-tools-versioning', - - // CONFIG KEYS, SCRIPT NAMES, ETC - // ZF components - '::fromZend' => '::fromLaminas', // psr7bridge - '::toZend' => '::toLaminas', // psr7bridge - 'use_zend_loader' => 'use_laminas_loader', // zend-modulemanager - 'zend-config' => 'laminas-config', - 'zend-developer-tools/' => 'laminas-developer-tools/', - 'zend-tag-cloud' => 'laminas-tag-cloud', - 'zenddevelopertools' => 'laminas-developer-tools', - 'zendbarcode' => 'laminasbarcode', - 'ZendBarcode' => 'LaminasBarcode', - 'zendcache' => 'laminascache', - 'ZendCache' => 'LaminasCache', - 'zendconfig' => 'laminasconfig', - 'ZendConfig' => 'LaminasConfig', - 'zendfeed' => 'laminasfeed', - 'ZendFeed' => 'LaminasFeed', - 'zendfilter' => 'laminasfilter', - 'ZendFilter' => 'LaminasFilter', - 'zendform' => 'laminasform', - 'ZendForm' => 'LaminasForm', - 'zendi18n' => 'laminasi18n', - 'ZendI18n' => 'LaminasI18n', - 'zendinputfilter' => 'laminasinputfilter', - 'ZendInputFilter' => 'LaminasInputFilter', - 'zendlog' => 'laminaslog', - 'ZendLog' => 'LaminasLog', - 'zendmail' => 'laminasmail', - 'ZendMail' => 'LaminasMail', - 'zendmvc' => 'laminasmvc', - 'ZendMvc' => 'LaminasMvc', - 'zendpaginator' => 'laminaspaginator', - 'ZendPaginator' => 'LaminasPaginator', - 'zendserializer' => 'laminasserializer', - 'ZendSerializer' => 'LaminasSerializer', - 'zendtag' => 'laminastag', - 'ZendTag' => 'LaminasTag', - 'zendtext' => 'laminastext', - 'ZendText' => 'LaminasText', - 'zendvalidator' => 'laminasvalidator', - 'ZendValidator' => 'LaminasValidator', - 'zendview' => 'laminasview', - 'ZendView' => 'LaminasView', - 'zend-framework.flf' => 'laminas-project.flf', - - // Expressive-related - "'zend-expressive'" => "'mezzio'", - '"zend-expressive"' => '"mezzio"', - 'zend-expressive.' => 'mezzio.', - 'zend-expressive-authorization' => 'mezzio-authorization', - 'zend-expressive-hal' => 'mezzio-hal', - 'zend-expressive-session' => 'mezzio-session', - 'zend-expressive-swoole' => 'mezzio-swoole', - 'zend-expressive-tooling' => 'mezzio-tooling', - - // Apigility-related - "'zf-apigility'" => "'api-tools'", - '"zf-apigility"' => '"api-tools"', - 'zf-apigility/' => 'api-tools/', - 'zf-apigility-admin' => 'api-tools-admin', - 'zf-content-negotiation' => 'api-tools-content-negotiation', - 'zf-hal' => 'api-tools-hal', - 'zf-rest' => 'api-tools-rest', - 'zf-rpc' => 'api-tools-rpc', - 'zf-content-validation' => 'api-tools-content-validation', - 'zf-apigility-ui' => 'api-tools-ui', - 'zf-apigility-documentation-blueprint' => 'api-tools-documentation-blueprint', - 'zf-apigility-documentation-swagger' => 'api-tools-documentation-swagger', - 'zf-apigility-welcome' => 'api-tools-welcome', - 'zf-api-problem' => 'api-tools-api-problem', - 'zf-configuration' => 'api-tools-configuration', - 'zf-http-cache' => 'api-tools-http-cache', - 'zf-mvc-auth' => 'api-tools-mvc-auth', - 'zf-oauth2' => 'api-tools-oauth2', - 'zf-versioning' => 'api-tools-versioning', - 'ZfApigilityDoctrineQueryProviderManager' => 'LaminasApiToolsDoctrineQueryProviderManager', - 'ZfApigilityDoctrineQueryCreateFilterManager' => 'LaminasApiToolsDoctrineQueryCreateFilterManager', - 'zf-apigility-doctrine' => 'api-tools-doctrine', - 'zf-development-mode' => 'laminas-development-mode', - 'zf-doctrine-querybuilder' => 'api-tools-doctrine-querybuilder', - - // 3rd party Apigility packages - 'api-skeletons/zf-' => 'api-skeletons/zf-', // api-skeletons packages - 'zf-oauth2-' => 'zf-oauth2-', // api-skeletons OAuth2-related packages - 'ZF\\OAuth2\\Client' => 'ZF\\OAuth2\\Client', // api-skeletons/zf-oauth2-client - 'ZF\\OAuth2\\Doctrine' => 'ZF\\OAuth2\\Doctrine', // api-skeletons/zf-oauth2-doctrine -]; diff --git a/vendor/laminas/laminas-zendframework-bridge/src/Autoloader.php b/vendor/laminas/laminas-zendframework-bridge/src/Autoloader.php deleted file mode 100644 index d06acd7562..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/Autoloader.php +++ /dev/null @@ -1,168 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -namespace Laminas\ZendFrameworkBridge; - -use ArrayObject; -use Composer\Autoload\ClassLoader; -use RuntimeException; - -use function array_values; -use function class_alias; -use function class_exists; -use function explode; -use function file_exists; -use function interface_exists; -use function spl_autoload_register; -use function strlen; -use function strtr; -use function substr; -use function trait_exists; - -/** - * Alias legacy Zend Framework project classes/interfaces/traits to Laminas equivalents. - */ -class Autoloader -{ - /** - * Attach autoloaders for managing legacy ZF artifacts. - * - * We attach two autoloaders: - * - * - The first is _prepended_ to handle new classes and add aliases for - * legacy classes. PHP expects any interfaces implemented, classes - * extended, or traits used when declaring class_alias() to exist and/or - * be autoloadable already at the time of declaration. If not, it will - * raise a fatal error. This autoloader helps mitigate errors in such - * situations. - * - * - The second is _appended_ in order to create aliases for legacy - * classes. - */ - public static function load() - { - $loaded = new ArrayObject([]); - - spl_autoload_register(self::createPrependAutoloader( - RewriteRules::namespaceReverse(), - self::getClassLoader(), - $loaded - ), true, true); - - spl_autoload_register(self::createAppendAutoloader( - RewriteRules::namespaceRewrite(), - $loaded - )); - } - - /** - * @return ClassLoader - * @throws RuntimeException - */ - private static function getClassLoader() - { - if (file_exists(__DIR__ . '/../../../autoload.php')) { - return include __DIR__ . '/../../../autoload.php'; - } - - if (file_exists(__DIR__ . '/../vendor/autoload.php')) { - return include __DIR__ . '/../vendor/autoload.php'; - } - - throw new RuntimeException('Cannot detect composer autoload. Please run composer install'); - } - - /** - * @return callable - */ - private static function createPrependAutoloader(array $namespaces, ClassLoader $classLoader, ArrayObject $loaded) - { - /** - * @param string $class Class name to autoload - * @return void - */ - return static function ($class) use ($namespaces, $classLoader, $loaded) { - if (isset($loaded[$class])) { - return; - } - - $segments = explode('\\', $class); - - $i = 0; - $check = ''; - - while (isset($segments[$i + 1], $namespaces[$check . $segments[$i] . '\\'])) { - $check .= $segments[$i] . '\\'; - ++$i; - } - - if ($check === '') { - return; - } - - if ($classLoader->loadClass($class)) { - $legacy = $namespaces[$check] - . strtr(substr($class, strlen($check)), [ - 'ApiTools' => 'Apigility', - 'Mezzio' => 'Expressive', - 'Laminas' => 'Zend', - ]); - class_alias($class, $legacy); - } - }; - } - - /** - * @return callable - */ - private static function createAppendAutoloader(array $namespaces, ArrayObject $loaded) - { - /** - * @param string $class Class name to autoload - * @return void - */ - return static function ($class) use ($namespaces, $loaded) { - $segments = explode('\\', $class); - - if ($segments[0] === 'ZendService' && isset($segments[1])) { - $segments[0] .= '\\' . $segments[1]; - unset($segments[1]); - $segments = array_values($segments); - } - - $i = 0; - $check = ''; - - // We are checking segments of the namespace to match quicker - while (isset($segments[$i + 1], $namespaces[$check . $segments[$i] . '\\'])) { - $check .= $segments[$i] . '\\'; - ++$i; - } - - if ($check === '') { - return; - } - - $alias = $namespaces[$check] - . strtr(substr($class, strlen($check)), [ - 'Apigility' => 'ApiTools', - 'Expressive' => 'Mezzio', - 'Zend' => 'Laminas', - 'AbstractZendServer' => 'AbstractZendServer', - 'ZendServerDisk' => 'ZendServerDisk', - 'ZendServerShm' => 'ZendServerShm', - 'ZendMonitor' => 'ZendMonitor', - ]); - - $loaded[$alias] = true; - if (class_exists($alias) || interface_exists($alias) || trait_exists($alias)) { - class_alias($alias, $class); - } - }; - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php b/vendor/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php deleted file mode 100644 index bac7b97479..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/ConfigPostProcessor.php +++ /dev/null @@ -1,434 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -namespace Laminas\ZendFrameworkBridge; - -use function array_intersect_key; -use function array_key_exists; -use function array_pop; -use function array_push; -use function count; -use function in_array; -use function is_array; -use function is_callable; -use function is_int; -use function is_string; - -class ConfigPostProcessor -{ - /** @internal */ - const SERVICE_MANAGER_KEYS_OF_INTEREST = [ - 'aliases' => true, - 'factories' => true, - 'invokables' => true, - 'services' => true, - ]; - - /** @var array String keys => string values */ - private $exactReplacements = [ - 'zend-expressive' => 'mezzio', - 'zf-apigility' => 'api-tools', - ]; - - /** @var Replacements */ - private $replacements; - - /** @var callable[] */ - private $rulesets; - - public function __construct() - { - $this->replacements = new Replacements(); - - /* Define the rulesets for replacements. - * - * Each ruleset has the following signature: - * - * @param mixed $value - * @param string[] $keys Full nested key hierarchy leading to the value - * @return null|callable - * - * If no match is made, a null is returned, allowing it to fallback to - * the next ruleset in the list. If a match is made, a callback is returned, - * and that will be used to perform the replacement on the value. - * - * The callback should have the following signature: - * - * @param mixed $value - * @param string[] $keys - * @return mixed The transformed value - */ - $this->rulesets = [ - // Exact values - function ($value) { - return is_string($value) && isset($this->exactReplacements[$value]) - ? [$this, 'replaceExactValue'] - : null; - }, - - // Router (MVC applications) - // We do not want to rewrite these. - function ($value, array $keys) { - $key = array_pop($keys); - // Only worried about a top-level "router" key. - return $key === 'router' && count($keys) === 0 && is_array($value) - ? [$this, 'noopReplacement'] - : null; - }, - - // service- and pluginmanager handling - function ($value) { - return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== [] - ? [$this, 'replaceDependencyConfiguration'] - : null; - }, - - // Array values - function ($value, array $keys) { - return 0 !== count($keys) && is_array($value) - ? [$this, '__invoke'] - : null; - }, - ]; - } - - /** - * @param string[] $keys Hierarchy of keys, for determining location in - * nested configuration. - * @return array - */ - public function __invoke(array $config, array $keys = []) - { - $rewritten = []; - - foreach ($config as $key => $value) { - // Determine new key from replacements - $newKey = is_string($key) ? $this->replace($key, $keys) : $key; - - // Keep original values with original key, if the key has changed, but only at the top-level. - if (empty($keys) && $newKey !== $key) { - $rewritten[$key] = $value; - } - - // Perform value replacements, if any - $newValue = $this->replace($value, $keys, $newKey); - - // Key does not already exist and/or is not an array value - if (! array_key_exists($newKey, $rewritten) || ! is_array($rewritten[$newKey])) { - // Do not overwrite existing values with null values - $rewritten[$newKey] = array_key_exists($newKey, $rewritten) && null === $newValue - ? $rewritten[$newKey] - : $newValue; - continue; - } - - // New value is null; nothing to do. - if (null === $newValue) { - continue; - } - - // Key already exists as an array value, but $value is not an array - if (! is_array($newValue)) { - $rewritten[$newKey][] = $newValue; - continue; - } - - // Key already exists as an array value, and $value is also an array - $rewritten[$newKey] = static::merge($rewritten[$newKey], $newValue); - } - - return $rewritten; - } - - /** - * Perform substitutions as needed on an individual value. - * - * The $key is provided to allow fine-grained selection of rewrite rules. - * - * @param mixed $value - * @param string[] $keys Key hierarchy - * @param null|int|string $key - * @return mixed - */ - private function replace($value, array $keys, $key = null) - { - // Add new key to the list of keys. - // We do not need to remove it later, as we are working on a copy of the array. - array_push($keys, $key); - - // Identify rewrite strategy and perform replacements - $rewriteRule = $this->replacementRuleMatch($value, $keys); - return $rewriteRule($value, $keys); - } - - /** - * Merge two arrays together. - * - * If an integer key exists in both arrays, the value from the second array - * will be appended to the first array. If both values are arrays, they are - * merged together, else the value of the second array overwrites the one - * of the first array. - * - * Based on zend-stdlib Zend\Stdlib\ArrayUtils::merge - * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) - * - * @return array - */ - public static function merge(array $a, array $b) - { - foreach ($b as $key => $value) { - if (! isset($a[$key]) && ! array_key_exists($key, $a)) { - $a[$key] = $value; - continue; - } - - if (null === $value && array_key_exists($key, $a)) { - // Leave as-is if value from $b is null - continue; - } - - if (is_int($key)) { - $a[] = $value; - continue; - } - - if (is_array($value) && is_array($a[$key])) { - $a[$key] = static::merge($a[$key], $value); - continue; - } - - $a[$key] = $value; - } - - return $a; - } - - /** - * @param mixed $value - * @param null|int|string $key - * @return callable Callable to invoke with value - */ - private function replacementRuleMatch($value, $key = null) - { - foreach ($this->rulesets as $ruleset) { - $result = $ruleset($value, $key); - if (is_callable($result)) { - return $result; - } - } - return [$this, 'fallbackReplacement']; - } - - /** - * Replace a value using the translation table, if the value is a string. - * - * @param mixed $value - * @return mixed - */ - private function fallbackReplacement($value) - { - return is_string($value) - ? $this->replacements->replace($value) - : $value; - } - - /** - * Replace a value matched exactly. - * - * @param mixed $value - * @return mixed - */ - private function replaceExactValue($value) - { - return $this->exactReplacements[$value]; - } - - private function replaceDependencyConfiguration(array $config) - { - $aliases = isset($config['aliases']) && is_array($config['aliases']) - ? $this->replaceDependencyAliases($config['aliases']) - : []; - - if ($aliases) { - $config['aliases'] = $aliases; - } - - $config = $this->replaceDependencyInvokables($config); - $config = $this->replaceDependencyFactories($config); - $config = $this->replaceDependencyServices($config); - - $keys = self::SERVICE_MANAGER_KEYS_OF_INTEREST; - foreach ($config as $key => $data) { - if (isset($keys[$key])) { - continue; - } - - $config[$key] = is_array($data) ? $this->__invoke($data, [$key]) : $data; - } - - return $config; - } - - /** - * Rewrite dependency aliases array - * - * In this case, we want to keep the alias as-is, but rewrite the target. - * - * We need also provide an additional alias if the alias key is a legacy class. - * - * @return array - */ - private function replaceDependencyAliases(array $aliases) - { - foreach ($aliases as $alias => $target) { - if (! is_string($alias) || ! is_string($target)) { - continue; - } - - $newTarget = $this->replacements->replace($target); - $newAlias = $this->replacements->replace($alias); - - $notIn = [$newTarget]; - $name = $newTarget; - while (isset($aliases[$name])) { - $notIn[] = $aliases[$name]; - $name = $aliases[$name]; - } - - if ($newAlias === $alias && ! in_array($alias, $notIn, true)) { - $aliases[$alias] = $newTarget; - continue; - } - - if (isset($aliases[$newAlias])) { - continue; - } - - if (! in_array($newAlias, $notIn, true)) { - $aliases[$alias] = $newAlias; - $aliases[$newAlias] = $newTarget; - } - } - - return $aliases; - } - - /** - * Rewrite dependency invokables array - * - * In this case, we want to keep the alias as-is, but rewrite the target. - * - * We need also provide an additional alias if invokable is defined with - * an alias which is a legacy class. - * - * @return array - */ - private function replaceDependencyInvokables(array $config) - { - if (empty($config['invokables']) || ! is_array($config['invokables'])) { - return $config; - } - - foreach ($config['invokables'] as $alias => $target) { - if (! is_string($alias)) { - continue; - } - - $newTarget = $this->replacements->replace($target); - $newAlias = $this->replacements->replace($alias); - - if ($alias === $target || isset($config['aliases'][$newAlias])) { - $config['invokables'][$alias] = $newTarget; - continue; - } - - $config['invokables'][$newAlias] = $newTarget; - - if ($newAlias === $alias) { - continue; - } - - $config['aliases'][$alias] = $newAlias; - - unset($config['invokables'][$alias]); - } - - return $config; - } - - /** - * @param mixed $value - * @return mixed Returns $value verbatim. - */ - private function noopReplacement($value) - { - return $value; - } - - private function replaceDependencyFactories(array $config) - { - if (empty($config['factories']) || ! is_array($config['factories'])) { - return $config; - } - - foreach ($config['factories'] as $service => $factory) { - if (! is_string($service)) { - continue; - } - - $replacedService = $this->replacements->replace($service); - $factory = is_string($factory) ? $this->replacements->replace($factory) : $factory; - $config['factories'][$replacedService] = $factory; - - if ($replacedService === $service) { - continue; - } - - unset($config['factories'][$service]); - if (isset($config['aliases'][$service])) { - continue; - } - - $config['aliases'][$service] = $replacedService; - } - - return $config; - } - - private function replaceDependencyServices(array $config) - { - if (empty($config['services']) || ! is_array($config['services'])) { - return $config; - } - - foreach ($config['services'] as $service => $serviceInstance) { - if (! is_string($service)) { - continue; - } - - $replacedService = $this->replacements->replace($service); - $serviceInstance = is_array($serviceInstance) ? $this->__invoke($serviceInstance) : $serviceInstance; - - $config['services'][$replacedService] = $serviceInstance; - - if ($service === $replacedService) { - continue; - } - - unset($config['services'][$service]); - - if (isset($config['aliases'][$service])) { - continue; - } - - $config['aliases'][$service] = $replacedService; - } - - return $config; - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/src/Module.php b/vendor/laminas/laminas-zendframework-bridge/src/Module.php deleted file mode 100644 index d10cb43dd8..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/Module.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -namespace Laminas\ZendFrameworkBridge; - -use Laminas\ModuleManager\Listener\ConfigMergerInterface; -use Laminas\ModuleManager\ModuleEvent; -use Laminas\ModuleManager\ModuleManager; - -class Module -{ - /** - * Initialize the module. - * - * Type-hinting deliberately omitted to allow unit testing - * without dependencies on packages that do not exist yet. - * - * @param ModuleManager $moduleManager - */ - public function init($moduleManager) - { - $moduleManager - ->getEventManager() - ->attach('mergeConfig', [$this, 'onMergeConfig']); - } - - /** - * Perform substitutions in the merged configuration. - * - * Rewrites keys and values matching known ZF classes, namespaces, and - * configuration keys to their Laminas equivalents. - * - * Type-hinting deliberately omitted to allow unit testing - * without dependencies on packages that do not exist yet. - * - * @param ModuleEvent $event - */ - public function onMergeConfig($event) - { - /** @var ConfigMergerInterface */ - $configMerger = $event->getConfigListener(); - $processor = new ConfigPostProcessor(); - $configMerger->setMergedConfig( - $processor( - $configMerger->getMergedConfig($returnAsObject = false) - ) - ); - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/src/Replacements.php b/vendor/laminas/laminas-zendframework-bridge/src/Replacements.php deleted file mode 100644 index ca445c01f9..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/Replacements.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -namespace Laminas\ZendFrameworkBridge; - -use function array_merge; -use function str_replace; -use function strpos; -use function strtr; - -class Replacements -{ - /** @var string[] */ - private $replacements; - - public function __construct(array $additionalReplacements = []) - { - $this->replacements = array_merge( - require __DIR__ . '/../config/replacements.php', - $additionalReplacements - ); - - // Provide multiple variants of strings containing namespace separators - foreach ($this->replacements as $original => $replacement) { - if (false === strpos($original, '\\')) { - continue; - } - $this->replacements[str_replace('\\', '\\\\', $original)] = str_replace('\\', '\\\\', $replacement); - $this->replacements[str_replace('\\', '\\\\\\\\', $original)] = str_replace('\\', '\\\\\\\\', $replacement); - } - } - - /** - * @param string $value - * @return string - */ - public function replace($value) - { - return strtr($value, $this->replacements); - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/src/RewriteRules.php b/vendor/laminas/laminas-zendframework-bridge/src/RewriteRules.php deleted file mode 100644 index 8dc999f45e..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/RewriteRules.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -namespace Laminas\ZendFrameworkBridge; - -class RewriteRules -{ - /** - * @return array - */ - public static function namespaceRewrite() - { - return [ - // Expressive - 'Zend\\ProblemDetails\\' => 'Mezzio\\ProblemDetails\\', - 'Zend\\Expressive\\' => 'Mezzio\\', - - // Laminas - 'Zend\\' => 'Laminas\\', - 'ZF\\ComposerAutoloading\\' => 'Laminas\\ComposerAutoloading\\', - 'ZF\\DevelopmentMode\\' => 'Laminas\\DevelopmentMode\\', - - // Apigility - 'ZF\\Apigility\\' => 'Laminas\\ApiTools\\', - 'ZF\\' => 'Laminas\\ApiTools\\', - - // ZendXml, API wrappers, zend-http OAuth support, zend-diagnostics, ZendDeveloperTools - 'ZendXml\\' => 'Laminas\\Xml\\', - 'ZendOAuth\\' => 'Laminas\\OAuth\\', - 'ZendDiagnostics\\' => 'Laminas\\Diagnostics\\', - 'ZendService\\ReCaptcha\\' => 'Laminas\\ReCaptcha\\', - 'ZendService\\Twitter\\' => 'Laminas\\Twitter\\', - 'ZendDeveloperTools\\' => 'Laminas\\DeveloperTools\\', - ]; - } - - /** - * @return array - */ - public static function namespaceReverse() - { - return [ - // ZendXml, ZendOAuth, ZendDiagnostics, ZendDeveloperTools - 'Laminas\\Xml\\' => 'ZendXml\\', - 'Laminas\\OAuth\\' => 'ZendOAuth\\', - 'Laminas\\Diagnostics\\' => 'ZendDiagnostics\\', - 'Laminas\\DeveloperTools\\' => 'ZendDeveloperTools\\', - - // Zend Service - 'Laminas\\ReCaptcha\\' => 'ZendService\\ReCaptcha\\', - 'Laminas\\Twitter\\' => 'ZendService\\Twitter\\', - - // Zend - 'Laminas\\' => 'Zend\\', - - // Expressive - 'Mezzio\\ProblemDetails\\' => 'Zend\\ProblemDetails\\', - 'Mezzio\\' => 'Zend\\Expressive\\', - - // Laminas to ZfCampus - 'Laminas\\ComposerAutoloading\\' => 'ZF\\ComposerAutoloading\\', - 'Laminas\\DevelopmentMode\\' => 'ZF\\DevelopmentMode\\', - - // Apigility - 'Laminas\\ApiTools\\Admin\\' => 'ZF\\Apigility\\Admin\\', - 'Laminas\\ApiTools\\Doctrine\\' => 'ZF\\Apigility\\Doctrine\\', - 'Laminas\\ApiTools\\Documentation\\' => 'ZF\\Apigility\\Documentation\\', - 'Laminas\\ApiTools\\Example\\' => 'ZF\\Apigility\\Example\\', - 'Laminas\\ApiTools\\Provider\\' => 'ZF\\Apigility\\Provider\\', - 'Laminas\\ApiTools\\Welcome\\' => 'ZF\\Apiglity\\Welcome\\', - 'Laminas\\ApiTools\\' => 'ZF\\', - ]; - } -} diff --git a/vendor/laminas/laminas-zendframework-bridge/src/autoload.php b/vendor/laminas/laminas-zendframework-bridge/src/autoload.php deleted file mode 100644 index 9f2f2adf85..0000000000 --- a/vendor/laminas/laminas-zendframework-bridge/src/autoload.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -/** - * @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository - * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md - * @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License - */ - -Laminas\ZendFrameworkBridge\Autoloader::load(); diff --git a/vendor/league/oauth2-client/CHANGELOG.md b/vendor/league/oauth2-client/CHANGELOG.md deleted file mode 100644 index fa6b1e5719..0000000000 --- a/vendor/league/oauth2-client/CHANGELOG.md +++ /dev/null @@ -1,329 +0,0 @@ -# OAuth 2.0 Client Changelog - -## 2.4.1 - -_Released: 2018-11-22_ - -* Revert to use of `AccessToken` in type hints to preserve backwards - compatibility; this fixes the issue reported in [#752](https://github.com/thephpleague/oauth2-client/issues/752) - and [#753](https://github.com/thephpleague/oauth2-client/issues/753) - -## 2.4.0 - -_Released: 2018-11-21_ - -* Add `HttpBasicAuthOptionProvider` to ease implementation for providers - requiring HTTP basic auth -* Add `GuardedPropertyTrait` to allow providers the ability to specify - properties that may not be overridden by user-defined values passed to the - provider constructor -* Add `AccessTokenInterface` and `ResourceOwnerAccessTokenInterface` to allow - providers the ability to override the default `AccessToken` - -## 2.3.1 - -_Released: 2018-11-19_ - -* Allow paragonie/random_compat's empty 9.99.99 placeholder -* Throw an `UnexpectedValueException` on non-JSON responses from access token - request (when calling `AbstractProvider::getAccessToken()`) - -## 2.3.0 - -_Released: 2018-01-13_ - -* Add `ProviderRedirectTrait` tool for 3rd-party provider libraries to use when - handling provider redirections -* Fix TypeError thrown because `getResourceOwner()` receives a non-JSON Response -* Gracefully handle non-standard errors received from providers -* Update README to reflect official support of PHP 7.2 - -## 2.2.1 - -_Released: 2017-04-25_ - -* Fix potential type error when HTTP 500 errors are encountered -* Allow broader range of `random_compat` versions - -## 2.2.0 - -_Released: 2017-02-01_ - -* Allow base URLs to contain query parameters -* Protect against `+` being improperly encoded in URL parameters -* Remove misleading `state` option from authorization parameters -* Stop generating more random bytes than necessary - -## 2.1.0 - -_Released: 2017-01-24_ - -* Allow `expires_in` with a value of `0` - -## 2.0.0 - -_Released: 2017-01-12_ - -* Rename `getResponse()` to `getParsedResponse()` -* Add `getResponse()` method that returns the unparsed PSR-7 `Response` instance -* Removed `RandomFactory`, switched to native random functions - -## 1.4.1 - -_Released: 2016-04-29_ - -* Add `QueryBuilderTrait` to standardize query string generation. - -## 1.4.0 - -_Released: 2016-04-19_ - -* Add `AccessToken::getValues()` to access additional vendor data provided with tokens. - -## 1.3.0 - -_Released: 2016-02-13_ - -* Enable dynamic parameters being passed into the authorization URL. -* Minor documentation updates. - -## 1.2.0 - -_Released: 2016-01-23_ - -* Add `resource_owner_id` to the JSON-serialized representation of the access token. -* Minor documentation updates and improved test coverage. - -## 1.1.0 - -_Released: 2015-11-13_ - -* Add `ArrayAccessorTrait`, update `AbstractProvider` to utilize. -* Use `expires` to serialize access tokens. -* Documentation updates. - -## 1.0.2 - -_Released: 2015-09-22_ - -* Allow access tokens to be created from storage (see #431). -* Minor fixes and documentation updates. - -## 1.0.1 - -_Released: 2015-08-26_ - -* Allow required parameters checked using the `RequiredParameterTrait` to be set as `false`, `null`, `"0"`, etc. - -## 1.0.0 - -_Released: 2015-08-19_ - -* We are running code-quality builds through Scrutinizer, and we are running unit test builds on the new Travis CI container-based infrastructure. -* Cleaned up code, as recommended by Scrutinizer. -* Documentation updates. - -## 1.0.0-beta2 - -_Released: 2015-08-12_ - -* BREAK: Add toArray() to ResourceOwnerInterface. -* Always attempt to parse responses as JSON and fallback on failure. -* Add dot notation support to access token resource owner ID. -* Use the Bearer authorization header for the generic provider. -* Documentation updates. - -## 1.0.0-beta1 - -_Released: 2015-07-16_ - -* API for 1.0 is now frozen! -* BREAK: Convert all uses of "User" to "ResourceOwner" to more closely match the OAuth 2.0 specification. -* BREAK: Rename `StandardProvider` to `GenericProvider`. -* BREAK: Move access token creation to the `AbstractProvider`. It was previously handled in the `AbstractGrant`. -* FIX: Add `Content-Type` header with value of `application/x-www-form-urlencoded` to the request header when retrieving access tokens. This adheres to the OAuth 2.0 specification and fixes issues where certain OAuth servers expect this header. -* Enhanced `json_encode()` serialization of AccessToken; when using `json_encode()` on an AccessToken, it will return a JSON object with these properties: `access_token`, `refresh_token`, and `expires_in`. - -## 1.0.0-alpha2 - -_Released: 2015-07-04_ - -* BREAK: Renamed `AbstractProvider::ACCESS_TOKEN_METHOD_GET` to `AbstractProvider::METHOD_GET`. -* BREAK: Renamed `AbstractProvider::ACCESS_TOKEN_METHOD_POST` to `AbstractProvider::METHOD_POST`. -* BREAK: Renamed `AbstractProvider::prepareUserDetails()` to `AbstractProvider::createUser()`. -* BREAK: Renamed `AbstractProvider::getUserDetails()` to `AbstractProvider::getUser()`. -* BREAK: Removed `$token` parameter from `AbstractProvider::getDefaultHeaders()`. -* BREAK: Modify `AbstractProvider::getBaseAccessTokenUrl()` to accept a required array of parameters, allowing providers the ability to vary the access token URL, based on the parameters. -* Removed newline characters from MAC Authorization header. -* Documentation updates, notably: - - Moved list of providers to `README.PROVIDERS.md`. - - Moved provider creation notes to `README.PROVIDER-GUIDE.md`. - -## 1.0.0-alpha1 - -_Released: 2015-06-25_ - -This release contains numerous BC breaks from the 0.x series. Please note these breaks and refer to the [upgrade guide](GUIDE-UPGRADING.md). - -* BREAK: Requires PHP 5.5.0 and greater. -* BREAK: All providers have been moved to separate repositories, one for each provider. -* BREAK: All `public` properties have been set as `protected` or `private` and getters/setters have been introduced for access to these properties. -* BREAK: The `Provider\ProviderInterface` has been removed. Please extend from and override `Provider\AbstractProvider`. -* BREAK: The `Entity\User` has been removed. Providers should implement the `Provider\UserInterface` and provide user functionality instead of expecting it in this base library. -* BREAK: The `Grant\GrantInterface` has been removed. Providers needing to provide a new grant type should extend from and override `Grant\AbstractGrant`. -* A generic `Provider\StandardProvider` has been introduced, which may be used as a client to integrate with most OAuth 2.0 compatible servers. -* A `Grant\GrantFactory` has been introduced as a means to register and retrieve singleton grants from a registry. -* Introduced traits for bearer and MAC authorization (`Tool\BearerAuthorizationTrait` and `Tool\MacAuthorizationTrait`), which providers may use to enable these header authorization types. - -## 0.12.1 - -_Released: 2015-06-20_ - -* FIX: Scope separators for LinkedIn and Instagram are now correctly a single space - -## 0.12.0 - -_Released: 2015-06-15_ - -* BREAK: LinkedIn Provider: Default scopes removed from LinkedIn Provider. See "[Managing LinkedIn Scopes](https://github.com/thephpleague/oauth2-client/blob/9cea9864c2e89bce1b922d1e37ba5378b3b0b264/README.md#managing-linkedin-scopes)" in the README for information on how to set scopes. See [#327](https://github.com/thephpleague/oauth2-client/pull/327) and [#307](https://github.com/thephpleague/oauth2-client/pull/307) for details on this change. -* FIX: LinkedIn Provider: A scenario existed in which `publicProfileUrl` was not set, generating a PHP notice; this has been fixed. -* FIX: Instagram Provider: Fixed scope separator. -* Documentation updates and corrections. - - -## 0.11.0 - -_Released: 2015-04-25_ - -* Identity Provider: Better handling of error responses -* Documentation updates - - -## 0.10.1 - -_Released: 2015-04-02_ - -* FIX: Invalid JSON triggering fatal error -* FIX: Sending headers along with auth `getAccessToken()` requests -* Now running Travis CI tests on PHP 7 -* Documentation updates - - -## 0.10.0 - -_Released: 2015-03-10_ - -* Providers: Added `getHeaders()` to ProviderInterface and updated AbstractProvider to provide the method -* Providers: Updated all bundled providers to support new `$authorizationHeader` property -* Identity Provider: Update IDPException to account for empty strings -* Identity Provider: Added `getResponseBody()` method to IDPException -* Documentation updates, minor bug fixes, and coding standards fixes - - -## 0.9.0 - -_Released: 2015-02-24_ - -* Add `AbstractProvider::prepareAccessTokenResult()` to provide additional token response preparation to providers -* Remove custom provider code from AccessToken -* Add links to README for Dropbox and Square providers - - -## 0.8.1 - -_Released: 2015-02-12_ - -* Allow `approval_prompt` to be set by providers. This fixes an issue where some providers have problems if the `approval_prompt` is present in the query string. - - -## 0.8.0 - -_Released: 2015-02-10_ - -* Facebook Provider: Upgrade to Graph API v2.2 -* Google Provider: Add `access_type` parameter for Google authorization URL -* Get a more reliable response body on errors - - -## 0.7.2 - -_Released: 2015-02-03_ - -* GitHub Provider: Fix regression -* Documentation updates - - -## 0.7.1 - -_Released: 2015-01-06_ - -* Google Provider: fixed issue where Google API was not returning the user ID - - -## 0.7.0 - -_Released: 2014-12-29_ - -* Improvements to Provider\AbstractProvider (addition of `userUid()`, `userEmail()`, and `userScreenName()`) -* GitHub Provider: Support for GitHub Enterprise -* GitHub Provider: Methods to allow fetching user email addresses -* Google Provider: Updated scopes and endpoints to remove deprecated values -* Documentation updates, minor bug fixes, and coding standards fixes - - -## 0.6.0 - -_Released: 2014-12-03_ - -* Added ability to specify a redirect handler for providers through use of a callback (see [Provider\AbstractProvider::setRedirectHandler()](https://github.com/thephpleague/oauth2-client/blob/55de45401eaa21f53c0b2414091da6f3b0f3fcb7/src/Provider/AbstractProvider.php#L314-L317)) -* Updated authorize and token URLs for the Microsoft provider; the old URLs had been phased out and were no longer working (see #146) -* Increased test coverage -* Documentation updates, minor bug fixes, and coding standards fixes - - -## 0.5.0 - -_Released: 2014-11-28_ - -* Added `ClientCredentials` and `Password` grants -* Added support for providers to set their own `uid` parameter key name -* Added support for Google's `hd` (hosted domain) parameter -* Added support for providing a custom `state` parameter to the authorization URL -* LinkedIn `pictureUrl` is now an optional response element -* Added Battle.net provider package link to README -* Added Meetup provider package link to README -* Added `.gitattributes` file -* Increased test coverage -* A number of documentation fixes, minor bug fixes, and coding standards fixes - - -## 0.4.0 - -_Released: 2014-10-28_ - -* Added `ProviderInterface` and removed `IdentityProvider`. -* Expose generated state to allow for CSRF validation. -* Renamed `League\OAuth2\Client\Provider\User` to `League\OAuth2\Client\Entity\User`. -* Entity: User: added `gender` and `locale` properties -* Updating logic for populating the token expiration time. - - -## 0.3.0 - -_Released: 2014-04-26_ - -* This release made some huge leaps forward, including 100% unit-coverage and a bunch of new features. - - -## 0.2.0 - -_Released: 2013-05-28_ - -* No release notes available. - - -## 0.1.0 - -_Released: 2013-05-25_ - -* Initial release. diff --git a/vendor/league/oauth2-client/CONTRIBUTING.md b/vendor/league/oauth2-client/CONTRIBUTING.md deleted file mode 100644 index 056e870057..0000000000 --- a/vendor/league/oauth2-client/CONTRIBUTING.md +++ /dev/null @@ -1,39 +0,0 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/oauth2-client). - - -## Pull Requests - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the README and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow SemVer. Randomly breaking public APIs is not an option. - -- **Create topic branches** - Don't ask us to pull from your master branch. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting. - -- **Ensure tests pass!** - Please run the tests (see below) before submitting your pull request, and make sure they pass. We won't accept a patch until all tests pass. - -- **Ensure no coding standards violations** - Please run PHP Code Sniffer using the PSR-2 standard (see below) before submitting your pull request. A violation will cause the build to fail, so please make sure there are no violations. We can't accept a patch if the build fails. - - -## Testing - -The following tests must pass for a build to be considered successful. If contributing, please ensure these pass before submitting a pull request. - -``` bash -$ ./vendor/bin/parallel-lint src test -$ ./vendor/bin/phpunit --coverage-text -$ ./vendor/bin/phpcs src --standard=psr2 -sp -``` - -**Happy coding**! diff --git a/vendor/league/oauth2-client/CREDITS.md b/vendor/league/oauth2-client/CREDITS.md deleted file mode 100644 index 628f49e6e5..0000000000 --- a/vendor/league/oauth2-client/CREDITS.md +++ /dev/null @@ -1,20 +0,0 @@ -# OAuth 2.0 Client - -## Authors - -Also see <https://github.com/thephpleague/oauth2-client/contributors>. - -### Current Maintainer - -- [Ben Ramsey](https://github.com/ramsey) - -### Contributors - -- [Alex Bilbie](https://github.com/alexbilbie) -- [Ben Corlett](https://github.com/bencorlett) -- [Ben Ramsey](https://github.com/ramsey) -- [James Mills](https://github.com/jamesmills) -- [Phil Sturgeon](https://github.com/philsturgeon) -- [Rudi Theunissen](https://github.com/rtheunissen) -- [Tom Anderson](https://github.com/TomHAnderson) -- [Woody Gilk](https://github.com/shadowhand) diff --git a/vendor/league/oauth2-client/LICENSE b/vendor/league/oauth2-client/LICENSE index 262729740a..9c8958afc1 100644 --- a/vendor/league/oauth2-client/LICENSE +++ b/vendor/league/oauth2-client/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2018 Alex Bilbie <hello@alexbilbie.com> +Copyright (c) 2013-2023 Alex Bilbie <hello@alexbilbie.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/league/oauth2-client/README.PROVIDER-GUIDE.md b/vendor/league/oauth2-client/README.PROVIDER-GUIDE.md deleted file mode 100644 index 4999d7da14..0000000000 --- a/vendor/league/oauth2-client/README.PROVIDER-GUIDE.md +++ /dev/null @@ -1,96 +0,0 @@ -# OAuth 2.0 Client - -## Provider Guide - -New providers may be created by copying the layout of an existing package. See -the [list of providers](docs/providers/thirdparty.md) for good examples. - -When choosing a name for your package, please don’t use the `league` vendor -prefix, as this implies that it is officially supported. You should use your own -username as the vendor prefix, and prepend `oauth2-` to the package name to make -it clear that your package works with OAuth2 Client. For example, if your GitHub -username was "santa," and you were implementing the "giftpay" OAuth2 library, a -good name for your composer package would be `santa/oauth2-giftpay`. - -### Implementing your own provider - -If you are working with an oauth2 service not supported out-of-the-box or by an -existing package, it is quite simple to implement your own. Simply extend -[`League\OAuth2\Client\Provider\AbstractProvider`](src/Provider/AbstractProvider.php) -and implement the required abstract methods: - -```php -abstract public function getBaseAuthorizationUrl(); -abstract public function getBaseAccessTokenUrl(array $params); -abstract public function getResourceOwnerDetailsUrl(AccessToken $token); -abstract protected function getDefaultScopes(); -abstract protected function checkResponse(ResponseInterface $response, $data); -abstract protected function createResourceOwner(array $response, AccessToken $token); -``` - -Each of these abstract methods contain a docblock defining their expectations -and typical behavior. Once you have extended this class, you can simply follow -the [usage example in the README](README.md#usage) using your new `Provider`. - -If you wish to use the `Provider` to make authenticated requests to the -service, you will also need to define how you provide the token to the -service. If this is done via headers, you should override this method: - -```php -protected function getAuthorizationHeaders($token = null); -``` - -This package comes with a trait for implementing `Bearer` authorization. -To use this, you just need to include the trait in your `Provider` class: - -```php -<?php -class SomeProvider extends AbstractProvider -{ - use League\OAuth2\Client\Tool\BearerAuthorizationTrait; - - /** ... **/ -} -``` - - -### Resource owner identifiers in access token responses - -In services where the resource owner is a person, the resource owner is sometimes -referred to as an end-user. - -We have decided to abstract away as much of the resource owner details as possible, -since these are not part of the OAuth 2.0 specification and are very specific to each -service provider. This provides greater flexibility to each provider, allowing -them to handle the implementation details for resource owners. - -The `AbstractProvider` does not specify an access token resource owner identifier. It is -the responsibility of the provider class to set the `ACCESS_TOKEN_RESOURCE_OWNER_ID` constant -to the string value of the key used in the access token response to identify the -resource owner. - -```php -/** - * @var string Key used in the access token response to identify the resource owner. - */ -const ACCESS_TOKEN_RESOURCE_OWNER_ID = null; -``` - -Once this is set on your provider, when calling `AbstractProvider::getAccessToken()`, -the `AccessToken` returned will have its `$resourceOwnerId` property set, which you may -retrieve by calling `AccessToken::getResourceOwnerId()`. - -The next step is to implement the `AbstractProvider::createResourceOwner()` method. This -method accepts as parameters a response array and an `AccessToken`. You may use -this information in order to request resource owner details from your service and -construct and return an object that implements -[`League\OAuth2\Client\Provider\ResourceOwnerInterface`](src/Provider/ResourceOwnerInterface.php). -This object is returned when calling `AbstractProvider::getResourceOwner()`. - -### Make your gateway official - -If you want to transfer your provider to the `thephpleague` GitHub organization -and add it to the list of officially supported providers, please open a pull -request on the thephpleague/oauth2-client package. Before new providers will be -accepted, they must have 100% unit test code coverage, and follow the -conventions and code style used in other OAuth2 Client providers. diff --git a/vendor/league/oauth2-client/README.md b/vendor/league/oauth2-client/README.md index 1c7250c259..37a127d151 100644 --- a/vendor/league/oauth2-client/README.md +++ b/vendor/league/oauth2-client/README.md @@ -1,267 +1,56 @@ # OAuth 2.0 Client -This package makes it simple to integrate your application with [OAuth 2.0](http://oauth.net/2/) service providers. +This package provides a base for integrating with [OAuth 2.0](http://oauth.net/2/) service providers. [![Gitter Chat](https://img.shields.io/badge/gitter-join_chat-brightgreen.svg?style=flat-square)](https://gitter.im/thephpleague/oauth2-client) -[![Source Code](http://img.shields.io/badge/source-thephpleague/oauth2--client-blue.svg?style=flat-square)](https://github.com/thephpleague/oauth2-client) +[![Source Code](https://img.shields.io/badge/source-thephpleague/oauth2--client-blue.svg?style=flat-square)](https://github.com/thephpleague/oauth2-client) [![Latest Version](https://img.shields.io/github/release/thephpleague/oauth2-client.svg?style=flat-square)](https://github.com/thephpleague/oauth2-client/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/thephpleague/oauth2-client/blob/master/LICENSE) -[![Build Status](https://img.shields.io/travis/thephpleague/oauth2-client/master.svg?style=flat-square)](https://travis-ci.org/thephpleague/oauth2-client) -[![Scrutinizer](https://img.shields.io/scrutinizer/g/thephpleague/oauth2-client/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/thephpleague/oauth2-client/) -[![Coverage Status](https://img.shields.io/coveralls/thephpleague/oauth2-client/master.svg?style=flat-square)](https://coveralls.io/r/thephpleague/oauth2-client?branch=master) +[![Build Status](https://img.shields.io/github/actions/workflow/status/thephpleague/oauth2-client/continuous-integration.yml?label=CI&logo=github&style=flat-square)](https://github.com/thephpleague/oauth2-client/actions?query=workflow%3ACI) +[![Codecov Code Coverage](https://img.shields.io/codecov/c/gh/thephpleague/oauth2-client?label=codecov&logo=codecov&style=flat-square)](https://codecov.io/gh/thephpleague/oauth2-client) [![Total Downloads](https://img.shields.io/packagist/dt/league/oauth2-client.svg?style=flat-square)](https://packagist.org/packages/league/oauth2-client) --- -We are all used to seeing those "Connect with Facebook/Google/etc." buttons around the internet, and social network integration is an important feature of most web applications these days. Many of these sites use an authentication and authorization standard called OAuth 2.0 ([RFC 6749](http://tools.ietf.org/html/rfc6749)). +The OAuth 2.0 login flow, seen commonly around the web in the form of "Connect with Facebook/Google/etc." buttons, is a common integration added to web applications, but it can be tricky and tedious to do right. To help, we've created the `league/oauth2-client` package, which provides a base for integrating with various OAuth 2.0 providers, without overburdening your application with the concerns of [RFC 6749](http://tools.ietf.org/html/rfc6749). -This OAuth 2.0 client library will work with any OAuth provider that conforms to the OAuth 2.0 standard. Out-of-the-box, we provide a `GenericProvider` that may be used to connect to any service provider that uses [Bearer tokens](http://tools.ietf.org/html/rfc6750) (see example below). +This OAuth 2.0 client library will work with any OAuth 2.0 provider that conforms to the OAuth 2.0 Authorization Framework. Out-of-the-box, we provide a `GenericProvider` class to connect to any service provider that uses [Bearer tokens](http://tools.ietf.org/html/rfc6750). See our [basic usage guide](https://oauth2-client.thephpleague.com/usage/) for examples using `GenericProvider`. -Many service providers provide additional functionality above and beyond the OAuth 2.0 standard. For this reason, this library may be easily extended and wrapped to support this additional behavior. We provide links to [all known provider clients extending this library](docs/providers/thirdparty.md) (i.e. Facebook, GitHub, Google, Instagram, LinkedIn, etc.). If your provider isn't in the list, feel free to add it. +Many service providers provide additional functionality above and beyond the OAuth 2.0 specification. For this reason, you may extend and wrap this library to support additional behavior. There are already many [official](https://oauth2-client.thephpleague.com/providers/league/) and [third-party](https://oauth2-client.thephpleague.com/providers/thirdparty/) provider clients available (e.g., Facebook, GitHub, Google, Instagram, LinkedIn, etc.). If your provider isn't in the list, feel free to add it. -This package is compliant with [PSR-1][], [PSR-2][], [PSR-4][], and [PSR-7][]. If you notice compliance oversights, please send a patch via pull request. If you're interesting in contributing to this library, please take a look at our [contributing guidelines](CONTRIBUTING.md). +This package is compliant with [PSR-1][], [PSR-2][], [PSR-4][], and [PSR-7][]. If you notice compliance oversights, please send a patch via pull request. If you're interested in contributing to this library, please take a look at our [contributing guidelines](https://github.com/thephpleague/oauth2-client/blob/master/CONTRIBUTING.md). ## Requirements -The following versions of PHP are supported. +We support the following versions of PHP: -* PHP 5.6 -* PHP 7.0 -* PHP 7.1 -* PHP 7.2 +* PHP 8.4 +* PHP 8.3 +* PHP 8.2 +* PHP 8.1 +* PHP 8.0 +* PHP 7.4 * PHP 7.3 +* PHP 7.2 +* PHP 7.1 -## Providers +## Provider Clients -A list of official PHP League providers, as well as third-party providers, may be found in the [providers list README](docs/providers/thirdparty.md). +We provide a list of [official PHP League provider clients](https://oauth2-client.thephpleague.com/providers/league/), as well as [third-party provider clients](https://oauth2-client.thephpleague.com/providers/thirdparty/). -To build your own provider, please refer to the [provider guide README](README.PROVIDER-GUIDE.md). +To build your own provider client, please refer to "[Implementing a Provider Client](https://oauth2-client.thephpleague.com/providers/implementing/)." ## Usage -**In most cases, you'll want to use a specific provider client library rather than this base library.** - -Take a look at [providers list README](docs/providers/thirdparty.md) to see a list of provider client libraries. - -If using Composer to require a specific provider client library, you **do not need to also require this library**. Composer will handle the dependencies for you. - -### Authorization Code Grant - -The following example uses the out-of-the-box `GenericProvider` provided by this library. If you're looking for a specific provider (i.e. Facebook, Google, GitHub, etc.), take a look at our [list of provider client libraries](docs/providers/thirdparty.md). **HINT: You're probably looking for a specific provider.** - -The authorization code grant type is the most common grant type used when authenticating users with a third-party service. This grant type utilizes a client (this library), a server (the service provider), and a resource owner (the user with credentials to a protected—or owned—resource) to request access to resources owned by the user. This is often referred to as _3-legged OAuth_, since there are three parties involved. - -The following example illustrates this using [Brent Shaffer's](https://github.com/bshaffer) demo OAuth 2.0 application named **Lock'd In**. When running this code, you will be redirected to Lock'd In, where you'll be prompted to authorize the client to make requests to a resource on your behalf. - -Now, you don't really have an account on Lock'd In, but for the sake of this example, imagine that you are already logged in on Lock'd In when you are redirected there. - -```php -$provider = new \League\OAuth2\Client\Provider\GenericProvider([ - 'clientId' => 'demoapp', // The client ID assigned to you by the provider - 'clientSecret' => 'demopass', // The client password assigned to you by the provider - 'redirectUri' => 'http://example.com/your-redirect-url/', - 'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize', - 'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token', - 'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource' -]); - -// If we don't have an authorization code then get one -if (!isset($_GET['code'])) { - - // Fetch the authorization URL from the provider; this returns the - // urlAuthorize option and generates and applies any necessary parameters - // (e.g. state). - $authorizationUrl = $provider->getAuthorizationUrl(); - - // Get the state generated for you and store it to the session. - $_SESSION['oauth2state'] = $provider->getState(); - - // Redirect the user to the authorization URL. - header('Location: ' . $authorizationUrl); - exit; - -// Check given state against previously stored one to mitigate CSRF attack -} elseif (empty($_GET['state']) || (isset($_SESSION['oauth2state']) && $_GET['state'] !== $_SESSION['oauth2state'])) { - - if (isset($_SESSION['oauth2state'])) { - unset($_SESSION['oauth2state']); - } - - exit('Invalid state'); - -} else { - - try { - - // Try to get an access token using the authorization code grant. - $accessToken = $provider->getAccessToken('authorization_code', [ - 'code' => $_GET['code'] - ]); - - // We have an access token, which we may use in authenticated - // requests against the service provider's API. - echo 'Access Token: ' . $accessToken->getToken() . "<br>"; - echo 'Refresh Token: ' . $accessToken->getRefreshToken() . "<br>"; - echo 'Expired in: ' . $accessToken->getExpires() . "<br>"; - echo 'Already expired? ' . ($accessToken->hasExpired() ? 'expired' : 'not expired') . "<br>"; - - // Using the access token, we may look up details about the - // resource owner. - $resourceOwner = $provider->getResourceOwner($accessToken); - - var_export($resourceOwner->toArray()); - - // The provider provides a way to get an authenticated API request for - // the service, using the access token; it returns an object conforming - // to Psr\Http\Message\RequestInterface. - $request = $provider->getAuthenticatedRequest( - 'GET', - 'http://brentertainment.com/oauth2/lockdin/resource', - $accessToken - ); - - } catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { - - // Failed to get the access token or user details. - exit($e->getMessage()); - - } - -} -``` - -### Refreshing a Token - -Once your application is authorized, you can refresh an expired token using a refresh token rather than going through the entire process of obtaining a brand new token. To do so, simply reuse this refresh token from your data store to request a refresh. - -_This example uses [Brent Shaffer's](https://github.com/bshaffer) demo OAuth 2.0 application named **Lock'd In**. See authorization code example above, for more details._ - -```php -$provider = new \League\OAuth2\Client\Provider\GenericProvider([ - 'clientId' => 'demoapp', // The client ID assigned to you by the provider - 'clientSecret' => 'demopass', // The client password assigned to you by the provider - 'redirectUri' => 'http://example.com/your-redirect-url/', - 'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize', - 'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token', - 'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource' -]); - -$existingAccessToken = getAccessTokenFromYourDataStore(); - -if ($existingAccessToken->hasExpired()) { - $newAccessToken = $provider->getAccessToken('refresh_token', [ - 'refresh_token' => $existingAccessToken->getRefreshToken() - ]); - - // Purge old access token and store new access token to your data store. -} -``` - -### Resource Owner Password Credentials Grant - -Some service providers allow you to skip the authorization code step to exchange a user's credentials (username and password) for an access token. This is referred to as the "resource owner password credentials" grant type. - -According to [section 1.3.3](http://tools.ietf.org/html/rfc6749#section-1.3.3) of the OAuth 2.0 standard (emphasis added): - -> The credentials **should only be used when there is a high degree of trust** -> between the resource owner and the client (e.g., the client is part of the -> device operating system or a highly privileged application), and when other -> authorization grant types are not available (such as an authorization code). - -**We do not advise using this grant type if the service provider supports the authorization code grant type (see above), as this reinforces the [password anti-pattern](https://agentile.com/the-password-anti-pattern) by allowing users to think it's okay to trust third-party applications with their usernames and passwords.** - -That said, there are use-cases where the resource owner password credentials grant is acceptable and useful. Here's an example using it with [Brent Shaffer's](https://github.com/bshaffer) demo OAuth 2.0 application named **Lock'd In**. See authorization code example above, for more details about the Lock'd In demo application. - -``` php -$provider = new \League\OAuth2\Client\Provider\GenericProvider([ - 'clientId' => 'demoapp', // The client ID assigned to you by the provider - 'clientSecret' => 'demopass', // The client password assigned to you by the provider - 'redirectUri' => 'http://example.com/your-redirect-url/', - 'urlAuthorize' => 'http://brentertainment.com/oauth2/lockdin/authorize', - 'urlAccessToken' => 'http://brentertainment.com/oauth2/lockdin/token', - 'urlResourceOwnerDetails' => 'http://brentertainment.com/oauth2/lockdin/resource' -]); - -try { - - // Try to get an access token using the resource owner password credentials grant. - $accessToken = $provider->getAccessToken('password', [ - 'username' => 'demouser', - 'password' => 'testpass' - ]); - -} catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { - - // Failed to get the access token - exit($e->getMessage()); - -} -``` - -### Client Credentials Grant - -When your application is acting on its own behalf to access resources it controls/owns in a service provider, it may use the client credentials grant type. This is best used when the credentials for your application are stored privately and never exposed (e.g. through the web browser, etc.) to end-users. This grant type functions similarly to the resource owner password credentials grant type, but it does not request a user's username or password. It uses only the client ID and secret issued to your client by the service provider. - -Unlike earlier examples, the following does not work against a functioning demo service provider. It is provided for the sake of example only. - -``` php -// Note: the GenericProvider requires the `urlAuthorize` option, even though -// it's not used in the OAuth 2.0 client credentials grant type. - -$provider = new \League\OAuth2\Client\Provider\GenericProvider([ - 'clientId' => 'XXXXXX', // The client ID assigned to you by the provider - 'clientSecret' => 'XXXXXX', // The client password assigned to you by the provider - 'redirectUri' => 'http://my.example.com/your-redirect-url/', - 'urlAuthorize' => 'http://service.example.com/authorize', - 'urlAccessToken' => 'http://service.example.com/token', - 'urlResourceOwnerDetails' => 'http://service.example.com/resource' -]); - -try { - - // Try to get an access token using the client credentials grant. - $accessToken = $provider->getAccessToken('client_credentials'); - -} catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) { - - // Failed to get the access token - exit($e->getMessage()); - -} -``` - -### Using a proxy - -It is possible to use a proxy to debug HTTP calls made to a provider. All you need to do is set the `proxy` and `verify` options when creating your Provider instance. Make sure you enable SSL proxying in your proxy. - -``` php -$provider = new \League\OAuth2\Client\Provider\GenericProvider([ - 'clientId' => 'XXXXXX', // The client ID assigned to you by the provider - 'clientSecret' => 'XXXXXX', // The client password assigned to you by the provider - 'redirectUri' => 'http://my.example.com/your-redirect-url/', - 'urlAuthorize' => 'http://service.example.com/authorize', - 'urlAccessToken' => 'http://service.example.com/token', - 'urlResourceOwnerDetails' => 'http://service.example.com/resource', - 'proxy' => '192.168.0.1:8888', - 'verify' => false -]); -``` - -## Install - -Via Composer - -``` bash -$ composer require league/oauth2-client -``` +For usage and code examples, check out our [basic usage guide](https://oauth2-client.thephpleague.com/usage/). ## Contributing -Please see [CONTRIBUTING](https://github.com/thephpleague/oauth2-client/blob/master/CONTRIBUTING.md) for details. +Please see [our contributing guidelines](https://github.com/thephpleague/oauth2-client/blob/master/CONTRIBUTING.md) for details. ## License -The MIT License (MIT). Please see [License File](https://github.com/thephpleague/oauth2-client/blob/master/LICENSE) for more information. +The MIT License (MIT). Please see [LICENSE](https://github.com/thephpleague/oauth2-client/blob/master/LICENSE) for more information. [PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md diff --git a/vendor/league/oauth2-client/composer.json b/vendor/league/oauth2-client/composer.json index 9b38b04eec..905f7ce8f0 100644 --- a/vendor/league/oauth2-client/composer.json +++ b/vendor/league/oauth2-client/composer.json @@ -6,16 +6,15 @@ "sort-packages": true }, "require": { - "php": "^5.6|^7.0", - "guzzlehttp/guzzle": "^6.0", - "paragonie/random_compat": "^1|^2|^9.99" + "php": "^7.1 || >=8.0.0 <8.5.0", + "ext-json": "*", + "guzzlehttp/guzzle": "^6.5.8 || ^7.4.5" }, "require-dev": { - "eloquent/liberator": "^2.0", - "eloquent/phony-phpunit": "^1.0|^3.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phpunit/phpunit": "^5.7|^6.0", - "squizlabs/php_codesniffer": "^2.3|^3.0" + "mockery/mockery": "^1.3.5", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.11" }, "keywords": [ "oauth", @@ -50,10 +49,5 @@ "psr-4": { "League\\OAuth2\\Client\\Test\\": "test/src/" } - }, - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } } } diff --git a/vendor/league/oauth2-client/phpunit.xml.dist b/vendor/league/oauth2-client/phpunit.xml.dist new file mode 100644 index 0000000000..e63822b2f9 --- /dev/null +++ b/vendor/league/oauth2-client/phpunit.xml.dist @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" + bootstrap="./vendor/autoload.php" + colors="true" + cacheDirectory="build/phpunit"> + + <coverage> + <report> + <clover outputFile="build/logs/clover.xml"/> + <html outputDirectory="build/coverage"/> + <text outputFile="php://stdout"/> + </report> + </coverage> + + <testsuites> + <testsuite name="all"> + <directory>test</directory> + </testsuite> + </testsuites> + + <logging> + <junit outputFile="build/report.junit.xml"/> + </logging> + + <source> + <include> + <directory suffix=".php">src</directory> + </include> + </source> + + <php> + <env name="XDEBUG_MODE" value="coverage"/> + </php> + +</phpunit> diff --git a/vendor/league/oauth2-client/src/Provider/AbstractProvider.php b/vendor/league/oauth2-client/src/Provider/AbstractProvider.php index d1679998ca..eb62417648 100644 --- a/vendor/league/oauth2-client/src/Provider/AbstractProvider.php +++ b/vendor/league/oauth2-client/src/Provider/AbstractProvider.php @@ -17,6 +17,8 @@ use GuzzleHttp\Client as HttpClient; use GuzzleHttp\ClientInterface as HttpClientInterface; use GuzzleHttp\Exception\BadResponseException; +use GuzzleHttp\Exception\GuzzleException; +use InvalidArgumentException; use League\OAuth2\Client\Grant\AbstractGrant; use League\OAuth2\Client\Grant\GrantFactory; use League\OAuth2\Client\OptionProvider\OptionProviderInterface; @@ -44,7 +46,7 @@ abstract class AbstractProvider use QueryBuilderTrait; /** - * @var string Key used in a token response to identify the resource owner. + * @var string|null Key used in a token response to identify the resource owner. */ const ACCESS_TOKEN_RESOURCE_OWNER_ID = null; @@ -58,6 +60,19 @@ abstract class AbstractProvider */ const METHOD_POST = 'POST'; + /** + * @var string PKCE method used to fetch authorization token. + * The PKCE code challenge will be hashed with sha256 (recommended). + */ + const PKCE_METHOD_S256 = 'S256'; + + /** + * @var string PKCE method used to fetch authorization token. + * The PKCE code challenge will be sent as plain text, this is NOT recommended. + * Only use `plain` if no other option is possible. + */ + const PKCE_METHOD_PLAIN = 'plain'; + /** * @var string */ @@ -78,6 +93,11 @@ abstract class AbstractProvider */ protected $state; + /** + * @var string|null + */ + protected $pkceCode = null; + /** * @var GrantFactory */ @@ -264,6 +284,32 @@ public function getState() return $this->state; } + /** + * Set the value of the pkceCode parameter. + * + * When using PKCE this should be set before requesting an access token. + * + * @param string $pkceCode + * @return self + */ + public function setPkceCode($pkceCode) + { + $this->pkceCode = $pkceCode; + return $this; + } + + /** + * Returns the current value of the pkceCode parameter. + * + * This can be accessed by the redirect handler during authorization. + * + * @return string|null + */ + public function getPkceCode() + { + return $this->pkceCode; + } + /** * Returns the base URL for authorizing a client. * @@ -305,6 +351,27 @@ protected function getRandomState($length = 32) return bin2hex(random_bytes($length / 2)); } + /** + * Returns a new random string to use as PKCE code_verifier and + * hashed as code_challenge parameters in an authorization flow. + * Must be between 43 and 128 characters long. + * + * @param int $length Length of the random string to be generated. + * @return string + */ + protected function getRandomPkceCode($length = 64) + { + return substr( + strtr( + base64_encode(random_bytes($length)), + '+/', + '-_' + ), + 0, + $length + ); + } + /** * Returns the default scopes used by this provider. * @@ -326,11 +393,20 @@ protected function getScopeSeparator() return ','; } + /** + * @return string|null + */ + protected function getPkceMethod() + { + return null; + } + /** * Returns authorization parameters based on provided options. * * @param array $options * @return array Authorization parameters + * @throws InvalidArgumentException */ protected function getAuthorizationParameters(array $options) { @@ -355,6 +431,26 @@ protected function getAuthorizationParameters(array $options) // Store the state as it may need to be accessed later on. $this->state = $options['state']; + $pkceMethod = $this->getPkceMethod(); + if (!empty($pkceMethod)) { + $this->pkceCode = $this->getRandomPkceCode(); + if ($pkceMethod === static::PKCE_METHOD_S256) { + $options['code_challenge'] = trim( + strtr( + base64_encode(hash('sha256', $this->pkceCode, true)), + '+/', + '-_' + ), + '=' + ); + } elseif ($pkceMethod === static::PKCE_METHOD_PLAIN) { + $options['code_challenge'] = $this->pkceCode; + } else { + throw new InvalidArgumentException('Unknown PKCE method "' . $pkceMethod . '".'); + } + $options['code_challenge_method'] = $pkceMethod; + } + // Business code layer might set a different redirect_uri parameter // depending on the context, leave it as-is if (!isset($options['redirect_uri'])) { @@ -382,6 +478,7 @@ protected function getAuthorizationQuery(array $params) * * @param array $options * @return string Authorization URL + * @throws InvalidArgumentException */ public function getAuthorizationUrl(array $options = []) { @@ -398,10 +495,11 @@ public function getAuthorizationUrl(array $options = []) * @param array $options * @param callable|null $redirectHandler * @return mixed + * @throws InvalidArgumentException */ public function authorize( array $options = [], - callable $redirectHandler = null + ?callable $redirectHandler = null ) { $url = $this->getAuthorizationUrl($options); if ($redirectHandler) { @@ -517,21 +615,32 @@ protected function getAccessTokenRequest(array $params) /** * Requests an access token using a specified grant and option set. * - * @param mixed $grant - * @param array $options - * @throws IdentityProviderException + * @param mixed $grant + * @param array<string, mixed> $options * @return AccessTokenInterface + * @throws IdentityProviderException + * @throws UnexpectedValueException + * @throws GuzzleException */ public function getAccessToken($grant, array $options = []) { $grant = $this->verifyGrant($grant); + if (isset($options['scope']) && is_array($options['scope'])) { + $separator = $this->getScopeSeparator(); + $options['scope'] = implode($separator, $options['scope']); + } + $params = [ 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'redirect_uri' => $this->redirectUri, ]; + if (!empty($this->pkceCode)) { + $params['code_verifier'] = $this->pkceCode; + } + $params = $grant->prepareRequestParameters($params, $options); $request = $this->getAccessTokenRequest($params); $response = $this->getParsedResponse($request); @@ -564,7 +673,7 @@ public function getRequest($method, $url, array $options = []) * * @param string $method * @param string $url - * @param AccessTokenInterface|string $token + * @param AccessTokenInterface|string|null $token * @param array $options Any of "headers", "body", and "protocolVersion". * @return RequestInterface */ @@ -602,6 +711,7 @@ protected function createRequest($method, $url, $token, array $options) * * @param RequestInterface $request * @return ResponseInterface + * @throws GuzzleException */ public function getResponse(RequestInterface $request) { @@ -612,8 +722,10 @@ public function getResponse(RequestInterface $request) * Sends a request and returns the parsed response. * * @param RequestInterface $request - * @throws IdentityProviderException * @return mixed + * @throws IdentityProviderException + * @throws UnexpectedValueException + * @throws GuzzleException */ public function getParsedResponse(RequestInterface $request) { @@ -659,7 +771,7 @@ protected function parseJson($content) */ protected function getContentType(ResponseInterface $response) { - return join(';', (array) $response->getHeader('content-type')); + return implode(';', $response->getHeader('content-type')); } /** @@ -717,7 +829,7 @@ abstract protected function checkResponse(ResponseInterface $response, $data); * Custom mapping of expiration, etc should be done here. Always call the * parent method when overloading this method. * - * @param mixed $result + * @param array<string, mixed> $result * @return array */ protected function prepareAccessTokenResponse(array $result) @@ -761,6 +873,9 @@ abstract protected function createResourceOwner(array $response, AccessToken $to * * @param AccessToken $token * @return ResourceOwnerInterface + * @throws IdentityProviderException + * @throws UnexpectedValueException + * @throws GuzzleException */ public function getResourceOwner(AccessToken $token) { @@ -774,6 +889,9 @@ public function getResourceOwner(AccessToken $token) * * @param AccessToken $token * @return mixed + * @throws IdentityProviderException + * @throws UnexpectedValueException + * @throws GuzzleException */ protected function fetchResourceOwnerDetails(AccessToken $token) { diff --git a/vendor/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php b/vendor/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php index 52b7e0353c..55cb438fb1 100644 --- a/vendor/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php +++ b/vendor/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php @@ -27,7 +27,7 @@ class IdentityProviderException extends \Exception /** * @param string $message * @param int $code - * @param array|string $response The response body + * @param mixed $response The response body */ public function __construct($message, $code, $response) { @@ -39,7 +39,7 @@ public function __construct($message, $code, $response) /** * Returns the exception's response body. * - * @return array|string + * @return mixed */ public function getResponseBody() { diff --git a/vendor/league/oauth2-client/src/Provider/GenericProvider.php b/vendor/league/oauth2-client/src/Provider/GenericProvider.php index 74393ffda5..0fc95f2502 100644 --- a/vendor/league/oauth2-client/src/Provider/GenericProvider.php +++ b/vendor/league/oauth2-client/src/Provider/GenericProvider.php @@ -78,6 +78,11 @@ class GenericProvider extends AbstractProvider */ private $responseResourceOwnerId = 'id'; + /** + * @var string|null + */ + private $pkceMethod = null; + /** * @param array $options * @param array $collaborators @@ -114,6 +119,7 @@ protected function getConfigurableOptions() 'responseCode', 'responseResourceOwnerId', 'scopes', + 'pkceMethod', ]); } @@ -205,6 +211,14 @@ protected function getScopeSeparator() return $this->scopeSeparator ?: parent::getScopeSeparator(); } + /** + * @inheritdoc + */ + protected function getPkceMethod() + { + return $this->pkceMethod ?: parent::getPkceMethod(); + } + /** * @inheritdoc */ diff --git a/vendor/league/oauth2-client/src/Token/AccessToken.php b/vendor/league/oauth2-client/src/Token/AccessToken.php index 2c55c23c98..331b0ace69 100644 --- a/vendor/league/oauth2-client/src/Token/AccessToken.php +++ b/vendor/league/oauth2-client/src/Token/AccessToken.php @@ -22,7 +22,7 @@ * * @link http://tools.ietf.org/html/rfc6749#section-1.4 Access Token (RFC 6749, §1.4) */ -class AccessToken implements AccessTokenInterface, ResourceOwnerAccessTokenInterface +class AccessToken implements AccessTokenInterface, ResourceOwnerAccessTokenInterface, SettableRefreshTokenInterface { /** * @var string @@ -49,6 +49,40 @@ class AccessToken implements AccessTokenInterface, ResourceOwnerAccessTokenInter */ protected $values = []; + /** + * @var int + */ + private static $timeNow; + + /** + * Set the time now. This should only be used for testing purposes. + * + * @param int $timeNow the time in seconds since epoch + * @return void + */ + public static function setTimeNow($timeNow) + { + self::$timeNow = $timeNow; + } + + /** + * Reset the time now if it was set for test purposes. + * + * @return void + */ + public static function resetTimeNow() + { + self::$timeNow = null; + } + + /** + * @return int + */ + public function getTimeNow() + { + return self::$timeNow ? self::$timeNow : time(); + } + /** * Constructs an access token. * @@ -80,14 +114,14 @@ public function __construct(array $options = []) throw new \InvalidArgumentException('expires_in value must be an integer'); } - $this->expires = $options['expires_in'] != 0 ? time() + $options['expires_in'] : 0; + $this->expires = $options['expires_in'] != 0 ? $this->getTimeNow() + $options['expires_in'] : 0; } elseif (!empty($options['expires'])) { // Some providers supply the seconds until expiration rather than // the exact timestamp. Take a best guess at which we received. - $expires = $options['expires']; + $expires = (int) $options['expires']; if (!$this->isExpirationTimestamp($expires)) { - $expires += time(); + $expires += $this->getTimeNow(); } $this->expires = $expires; @@ -135,6 +169,14 @@ public function getRefreshToken() return $this->refreshToken; } + /** + * @inheritdoc + */ + public function setRefreshToken($refreshToken) + { + $this->refreshToken = $refreshToken; + } + /** * @inheritdoc */ @@ -162,7 +204,7 @@ public function hasExpired() throw new RuntimeException('"expires" is not set on the token'); } - return $expires < time(); + return $expires < $this->getTimeNow(); } /** diff --git a/vendor/league/oauth2-client/src/Token/AccessTokenInterface.php b/vendor/league/oauth2-client/src/Token/AccessTokenInterface.php index cec37f6171..5fd219ffca 100644 --- a/vendor/league/oauth2-client/src/Token/AccessTokenInterface.php +++ b/vendor/league/oauth2-client/src/Token/AccessTokenInterface.php @@ -15,6 +15,7 @@ namespace League\OAuth2\Client\Token; use JsonSerializable; +use ReturnTypeWillChange; use RuntimeException; interface AccessTokenInterface extends JsonSerializable @@ -34,7 +35,7 @@ public function getToken(); public function getRefreshToken(); /** - * Returns the expiration timestamp, if defined. + * Returns the expiration timestamp in seconds, if defined. * * @return integer|null */ @@ -68,5 +69,6 @@ public function __toString(); * * @return array */ + #[ReturnTypeWillChange] public function jsonSerialize(); } diff --git a/vendor/league/oauth2-client/src/Token/SettableRefreshTokenInterface.php b/vendor/league/oauth2-client/src/Token/SettableRefreshTokenInterface.php new file mode 100644 index 0000000000..491bee9911 --- /dev/null +++ b/vendor/league/oauth2-client/src/Token/SettableRefreshTokenInterface.php @@ -0,0 +1,26 @@ +<?php +/** + * This file is part of the league/oauth2-client library + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + * @copyright Copyright (c) Alex Bilbie <hello@alexbilbie.com> + * @license http://opensource.org/licenses/MIT MIT + * @link http://thephpleague.com/oauth2-client/ Documentation + * @link https://packagist.org/packages/league/oauth2-client Packagist + * @link https://github.com/thephpleague/oauth2-client GitHub + */ + +namespace League\OAuth2\Client\Token; + +interface SettableRefreshTokenInterface +{ + /** + * Sets or replaces the refresh token with the provided refresh token. + * + * @param string $refreshToken + * @return void + */ + public function setRefreshToken($refreshToken); +} diff --git a/vendor/league/oauth2-client/src/Tool/QueryBuilderTrait.php b/vendor/league/oauth2-client/src/Tool/QueryBuilderTrait.php index ebccdffc6e..bdda3e79ef 100644 --- a/vendor/league/oauth2-client/src/Tool/QueryBuilderTrait.php +++ b/vendor/league/oauth2-client/src/Tool/QueryBuilderTrait.php @@ -28,6 +28,6 @@ trait QueryBuilderTrait */ protected function buildQueryString(array $params) { - return http_build_query($params, null, '&', \PHP_QUERY_RFC3986); + return http_build_query($params, '', '&', \PHP_QUERY_RFC3986); } } diff --git a/vendor/league/oauth2-google/CHANGELOG.md b/vendor/league/oauth2-google/CHANGELOG.md index 4c0e91d6f3..18b1a9a6ec 100644 --- a/vendor/league/oauth2-google/CHANGELOG.md +++ b/vendor/league/oauth2-google/CHANGELOG.md @@ -1,5 +1,17 @@ OAuth 2.0 Google Provider Changelog +## 3.0.4 - 2021-01-27 + +### Fixed + +- Correct OAuth endpoint, #94 by @Slamdunk + +## 3.0.3 - 2020-07-24 + +### Fixed + +- Remove the `approval_prompt` from default parameters, #90 + ## 3.0.2 - 2019-11-16 ### Fixed diff --git a/vendor/league/oauth2-google/README.md b/vendor/league/oauth2-google/README.md index 6d2025f2ed..df69dcd122 100644 --- a/vendor/league/oauth2-google/README.md +++ b/vendor/league/oauth2-google/README.md @@ -24,6 +24,7 @@ The following versions of PHP are supported. * PHP 7.1 * PHP 7.2 * PHP 7.3 +* PHP 7.4 This package uses [OpenID Connect][openid-connect] to authenticate users with Google accounts. @@ -50,8 +51,12 @@ composer require league/oauth2-google ### Authorization Code Flow ```php +require __DIR__ . '/vendor/autoload.php'; + use League\OAuth2\Client\Provider\Google; +session_start(); // Remove if session.auto_start=1 in php.ini + $provider = new Google([ 'clientId' => '{google-client-id}', 'clientSecret' => '{google-client-secret}', diff --git a/vendor/league/oauth2-google/composer.json b/vendor/league/oauth2-google/composer.json index 5af28af24d..f34a1cec9e 100644 --- a/vendor/league/oauth2-google/composer.json +++ b/vendor/league/oauth2-google/composer.json @@ -34,7 +34,7 @@ }, "autoload-dev": { "psr-4": { - "League\\OAuth2\\Client\\Test\\": "tests/src/" + "League\\OAuth2\\Client\\Test\\": "test/src/" } }, "scripts": { diff --git a/vendor/league/oauth2-google/examples/user.php b/vendor/league/oauth2-google/examples/user.php index 7a80d2fcb4..aacaf31a2a 100644 --- a/vendor/league/oauth2-google/examples/user.php +++ b/vendor/league/oauth2-google/examples/user.php @@ -2,7 +2,7 @@ $provider = require __DIR__ . '/provider.php'; -if (isset($_GET['logout']) && $_GET['logout'] = 1) { +if (isset($_GET['logout']) && 1 == $_GET['logout']) { unset($_SESSION['token']); } diff --git a/vendor/league/oauth2-google/src/Provider/Google.php b/vendor/league/oauth2-google/src/Provider/Google.php index 66c9db6de2..43938e0ecf 100644 --- a/vendor/league/oauth2-google/src/Provider/Google.php +++ b/vendor/league/oauth2-google/src/Provider/Google.php @@ -43,7 +43,7 @@ public function getBaseAuthorizationUrl() public function getBaseAccessTokenUrl(array $params) { - return 'https://www.googleapis.com/oauth2/v4/token'; + return 'https://oauth2.googleapis.com/token'; } public function getResourceOwnerDetailsUrl(AccessToken $token) @@ -65,11 +65,6 @@ protected function getAuthorizationParameters(array $options) $options['prompt'] = $this->prompt; } - // The "approval_prompt" option MUST be removed to prevent conflicts with non-empty "prompt". - if (!empty($options['prompt'])) { - $options['approval_prompt'] = null; - } - // Default scopes MUST be included for OpenID Connect. // Additional scopes MAY be added by constructor or option. $scopes = array_merge($this->getDefaultScopes(), $this->scopes); @@ -80,7 +75,13 @@ protected function getAuthorizationParameters(array $options) $options['scope'] = array_unique($scopes); - return parent::getAuthorizationParameters($options); + $options = parent::getAuthorizationParameters($options); + + // The "approval_prompt" MUST be removed as it is not supported by Google, use "prompt" instead: + // https://developers.google.com/identity/protocols/oauth2/openid-connect#prompt + unset($options['approval_prompt']); + + return $options; } protected function getDefaultScopes() diff --git a/vendor/nyholm/psr7-server/.github/FUNDING.yml b/vendor/nyholm/psr7-server/.github/FUNDING.yml new file mode 100644 index 0000000000..11255a01e8 --- /dev/null +++ b/vendor/nyholm/psr7-server/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [nyholm, Zegnat] diff --git a/vendor/nyholm/psr7-server/CHANGELOG.md b/vendor/nyholm/psr7-server/CHANGELOG.md index 3b289ab2c6..b696b98292 100644 --- a/vendor/nyholm/psr7-server/CHANGELOG.md +++ b/vendor/nyholm/psr7-server/CHANGELOG.md @@ -2,6 +2,29 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.0.2 + +### Fixed + +- `ServerRequestCreator::createStreamFromFile()` should first look if there was an upload error +- Dont crash on numeric header names + +## 1.0.1 + +## Fixed + +- PHP8 support + +## 1.0.0 + +- Changed signature of `ServerRequestCreatorInterface::fromArrays()` to allow null values for $post + +## 0.4.2 + +### Fixed + +- Support for numerical headers + ## 0.4.1 ### Fixed @@ -32,14 +55,14 @@ All notable changes to this project will be documented in this file, in reverse ## 0.1.2 -### Added +### Added - `ServerRequestCreatorInterface` - `ServerRequestCreator::getHeadersFromServer` ## 0.1.1 -### Added +### Added Better testing diff --git a/vendor/nyholm/psr7-server/README.md b/vendor/nyholm/psr7-server/README.md index b3f5cb3aae..306b660eca 100644 --- a/vendor/nyholm/psr7-server/README.md +++ b/vendor/nyholm/psr7-server/README.md @@ -35,4 +35,4 @@ $serverRequest = $creator->fromGlobals(); ## Other packages * [nyholm/psr7](https://github.com/Nyholm/psr7) - A super fast PSR-7 implementation. -* [zendframework/zend-httphandlerrunner](https://github.com/zendframework/zend-httphandlerrunner) - To send/emit PSR-7 responses +* [laminas/laminas-httphandlerrunner](https://github.com/laminas/laminas-httphandlerrunner) - To send/emit PSR-7 responses diff --git a/vendor/nyholm/psr7-server/composer.json b/vendor/nyholm/psr7-server/composer.json index 0a8c62e1f4..d7c789d8a2 100644 --- a/vendor/nyholm/psr7-server/composer.json +++ b/vendor/nyholm/psr7-server/composer.json @@ -15,13 +15,13 @@ } ], "require": { - "php": "^7.1", - "psr/http-message": "^1.0", + "php": "^7.1 || ^8.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-factory": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.0", - "nyholm/psr7": "^1.0", + "phpunit/phpunit": "^7.0 || ^8.5 || ^9.3", + "nyholm/psr7": "^1.3", "nyholm/nsa": "^1.1" }, "autoload": { diff --git a/vendor/nyholm/psr7-server/src/ServerRequestCreator.php b/vendor/nyholm/psr7-server/src/ServerRequestCreator.php index 1e66daacb4..a10685d183 100644 --- a/vendor/nyholm/psr7-server/src/ServerRequestCreator.php +++ b/vendor/nyholm/psr7-server/src/ServerRequestCreator.php @@ -51,13 +51,30 @@ public function fromGlobals(): ServerRequestInterface $headers = \function_exists('getallheaders') ? getallheaders() : static::getHeadersFromServer($_SERVER); - return $this->fromArrays($server, $headers, $_COOKIE, $_GET, $_POST, $_FILES, \fopen('php://input', 'r') ?: null); + $post = null; + if ('POST' === $this->getMethodFromEnv($server)) { + foreach ($headers as $headerName => $headerValue) { + if (true === \is_int($headerName) || 'content-type' !== \strtolower($headerName)) { + continue; + } + if (\in_array( + \strtolower(\trim(\explode(';', $headerValue, 2)[0])), + ['application/x-www-form-urlencoded', 'multipart/form-data'] + )) { + $post = $_POST; + + break; + } + } + } + + return $this->fromArrays($server, $headers, $_COOKIE, $_GET, $post, $_FILES, \fopen('php://input', 'r') ?: null); } /** * {@inheritdoc} */ - public function fromArrays(array $server, array $headers = [], array $cookie = [], array $get = [], array $post = [], array $files = [], $body = null): ServerRequestInterface + public function fromArrays(array $server, array $headers = [], array $cookie = [], array $get = [], ?array $post = null, array $files = [], $body = null): ServerRequestInterface { $method = $this->getMethodFromEnv($server); $uri = $this->getUriFromEnvWithHTTP($server); @@ -65,6 +82,11 @@ public function fromArrays(array $server, array $headers = [], array $cookie = [ $serverRequest = $this->serverRequestFactory->createServerRequest($method, $uri, $server); foreach ($headers as $name => $value) { + // Because PHP automatically casts array keys set with numeric strings to integers, we have to make sure + // that numeric headers will not be sent along as integers, as withAddedHeader can only accept strings. + if (\is_int($name)) { + $name = (string) $name; + } $serverRequest = $serverRequest->withAddedHeader($name, $value); } @@ -91,7 +113,7 @@ public function fromArrays(array $server, array $headers = [], array $cookie = [ } /** - * Implementation from Zend\Diactoros\marshalHeadersFromSapi(). + * Implementation from Laminas\Diactoros\marshalHeadersFromSapi(). */ public static function getHeadersFromServer(array $server): array { @@ -190,10 +212,14 @@ private function createUploadedFileFromSpec(array $value) return $this->normalizeNestedFileSpec($value); } - try { - $stream = $this->streamFactory->createStreamFromFile($value['tmp_name']); - } catch (\RuntimeException $e) { + if (UPLOAD_ERR_OK !== $value['error']) { $stream = $this->streamFactory->createStream(); + } else { + try { + $stream = $this->streamFactory->createStreamFromFile($value['tmp_name']); + } catch (\RuntimeException $e) { + $stream = $this->streamFactory->createStream(); + } } return $this->uploadedFileFactory->createUploadedFile( @@ -211,8 +237,6 @@ private function createUploadedFileFromSpec(array $value) * Loops through all nested files and returns a normalized array of * UploadedFileInterface instances. * - * @param array $files - * * @return UploadedFileInterface[] */ private function normalizeNestedFileSpec(array $files = []): array diff --git a/vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php b/vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php index 0774bc4fd6..e9f189a764 100644 --- a/vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php +++ b/vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php @@ -31,7 +31,7 @@ public function fromGlobals(): ServerRequestInterface; * @param array $headers typically the output of getallheaders() or similar structure * @param array $cookie typically $_COOKIE or similar structure * @param array $get typically $_GET or similar structure - * @param array $post typically $_POST or similar structure + * @param array|null $post typically $_POST or similar structure, represents parsed request body * @param array $files typically $_FILES or similar structure * @param StreamInterface|resource|string|null $body Typically stdIn * @@ -42,7 +42,7 @@ public function fromArrays( array $headers = [], array $cookie = [], array $get = [], - array $post = [], + ?array $post = null, array $files = [], $body = null ): ServerRequestInterface; @@ -51,8 +51,6 @@ public function fromArrays( * Get parsed headers from ($_SERVER) array. * * @param array $server typically $_SERVER or similar structure - * - * @return array */ public static function getHeadersFromServer(array $server): array; } diff --git a/vendor/nyholm/psr7/CHANGELOG.md b/vendor/nyholm/psr7/CHANGELOG.md index 28f17afaa5..17a819fbb1 100644 --- a/vendor/nyholm/psr7/CHANGELOG.md +++ b/vendor/nyholm/psr7/CHANGELOG.md @@ -2,6 +2,94 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.8.2 + +- Fix deprecation warnings in PHP 8.4 + +## 1.8.1 + +- Fix error handling in Stream::getContents() + +## 1.8.0 + +- Deprecate HttplugFactory, use Psr17Factory instead +- Make depencendy on php-http/message-factory optional + +## 1.7.0 + +- Bump to PHP 7.2 minimum +- Allow psr/http-message v2 +- Use copy-on-write for streams created from strings + +## 1.6.1 + +- Security fix: CVE-2023-29197 + +## 1.6.0 + +### Changed + +- Seek to the begining of the string when using Stream::create() +- Populate ServerRequest::getQueryParams() on instantiation +- Encode [reserved characters](https://www.rfc-editor.org/rfc/rfc3986#appendix-A) in userinfo in Uri +- Normalize leading slashes for Uri::getPath() +- Make Stream's constructor public +- Add some missing type checks on arguments + +## 1.5.1 + +### Fixed + +- Fixed deprecations on PHP 8.1 + +## 1.5.0 + +### Added + +- Add explicit `@return mixed` +- Add explicit return types to HttplugFactory + +### Fixed + +- Improve error handling with streams + +## 1.4.1 + +### Fixed + +- `Psr17Factory::createStreamFromFile`, `UploadedFile::moveTo`, and + `UploadedFile::getStream` no longer throw `ValueError` in PHP 8. + +## 1.4.0 + +### Removed + +The `final` keyword was replaced by `@final` annotation. + +## 1.3.2 + +### Fixed + +- `Stream::read()` must not return boolean. +- Improved exception message when using wrong HTTP status code. + +## 1.3.1 + +### Fixed + +- Allow installation on PHP8 + +## 1.3.0 + +### Added + +- Make Stream::__toString() compatible with throwing exceptions on PHP 7.4. + +### Fixed + +- Support for UTF-8 hostnames +- Support for numeric header names + ## 1.2.1 ### Changed @@ -13,9 +101,9 @@ All notable changes to this project will be documented in this file, in reverse ### Changed - Change minimal port number to 0 (unix socket) -- Updated `Psr17Factory::createResponse` to respect the specification. If second - argument is not used, a standard reason phrase. If an empty string is passed, - then the reason phrase will be empty. +- Updated `Psr17Factory::createResponse` to respect the specification. If second + argument is not used, a standard reason phrase. If an empty string is passed, + then the reason phrase will be empty. ### Fixed @@ -38,7 +126,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed - Handle `fopen` failing in createStreamFromFile according to PSR-7. -- Reduce execution path to speed up performance. +- Reduce execution path to speed up performance. - Fixed typos. - Code style. @@ -47,10 +135,10 @@ All notable changes to this project will be documented in this file, in reverse ### Added - Support for final PSR-17 (HTTP factories). (`Psr17Factory`) -- Support for numeric header values. -- Support for empty header values. +- Support for numeric header values. +- Support for empty header values. - All classes are final -- `HttplugFactory` that implements factory interfaces from HTTPlug. +- `HttplugFactory` that implements factory interfaces from HTTPlug. ### Changed @@ -59,27 +147,26 @@ All notable changes to this project will be documented in this file, in reverse ### Removed - The HTTPlug discovery strategy was removed since it is included in php-http/discovery 1.4. -- `UploadedFileFactory()` was removed in favor for `Psr17Factory`. -- `ServerRequestFactory()` was removed in favor for `Psr17Factory`. -- `StreamFactory`, `UriFactory`, abd `MessageFactory`. Use `HttplugFactory` instead. -- `ServerRequestFactory::createServerRequestFromArray`, `ServerRequestFactory::createServerRequestFromArrays` and - `ServerRequestFactory::createServerRequestFromGlobals`. Please use the new `nyholm/psr7-server` instead. +- `UploadedFileFactory()` was removed in favor for `Psr17Factory`. +- `ServerRequestFactory()` was removed in favor for `Psr17Factory`. +- `StreamFactory`, `UriFactory`, abd `MessageFactory`. Use `HttplugFactory` instead. +- `ServerRequestFactory::createServerRequestFromArray`, `ServerRequestFactory::createServerRequestFromArrays` and + `ServerRequestFactory::createServerRequestFromGlobals`. Please use the new `nyholm/psr7-server` instead. ## 0.3.0 ### Added - Return types. -- Many `InvalidArgumentException`s are thrown when you use invalid arguments. +- Many `InvalidArgumentException`s are thrown when you use invalid arguments. - Integration tests for `UploadedFile` and `ServerRequest`. ### Changed -- We dropped PHP7.0 support. -- PSR-17 factories have been marked as internal. They do not fall under our BC promise until PSR-17 is accepted. -- `UploadedFileFactory::createUploadedFile` does not accept a string file path. +- We dropped PHP7.0 support. +- PSR-17 factories have been marked as internal. They do not fall under our BC promise until PSR-17 is accepted. +- `UploadedFileFactory::createUploadedFile` does not accept a string file path. ## 0.2.3 No changelog before this release - diff --git a/vendor/nyholm/psr7/README.md b/vendor/nyholm/psr7/README.md index d626853b3b..7fc30bc13e 100644 --- a/vendor/nyholm/psr7/README.md +++ b/vendor/nyholm/psr7/README.md @@ -1,28 +1,25 @@ # PSR-7 implementation [![Latest Version](https://img.shields.io/github/release/Nyholm/psr7.svg?style=flat-square)](https://github.com/Nyholm/psr7/releases) -[![Build Status](https://img.shields.io/travis/Nyholm/psr7/master.svg?style=flat-square)](https://travis-ci.org/Nyholm/psr7) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) -[![Quality Score](https://img.shields.io/scrutinizer/g/Nyholm/psr7.svg?style=flat-square)](https://scrutinizer-ci.com/g/Nyholm/psr7) [![Total Downloads](https://poser.pugx.org/nyholm/psr7/downloads)](https://packagist.org/packages/nyholm/psr7) [![Monthly Downloads](https://poser.pugx.org/nyholm/psr7/d/monthly.png)](https://packagist.org/packages/nyholm/psr7) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) - +[![Static analysis](https://github.com/Nyholm/psr7/actions/workflows/static.yml/badge.svg?branch=master)](https://github.com/Nyholm/psr7/actions/workflows/static.yml?query=branch%3Amaster) +[![Tests](https://github.com/Nyholm/psr7/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Nyholm/psr7/actions/workflows/tests.yml?query=branch%3Amaster) A super lightweight PSR-7 implementation. Very strict and very fast. -| Description | Guzzle | Zend | Slim | Nyholm | +| Description | Guzzle | Laminas | Slim | Nyholm | | ---- | ------ | ---- | ---- | ------ | -| Lines of code | 3 000 | 3 000 | 1 700 | 1 000 | -| PHP7 | No | Yes | No | Yes | +| Lines of code | 3.300 | 3.100 | 1.900 | 1.000 | | PSR-7* | 66% | 100% | 75% | 100% | | PSR-17 | No | Yes | Yes | Yes | | HTTPlug | No | No | No | Yes | -| Performance** | 1.34x | 1x | 1.16x | 1.75x | +| Performance (runs per second)** | 14.553 | 14.703 | 13.416 | 17.734 | \* Percent of completed tests in https://github.com/php-http/psr7-integration-tests -\** See benchmark at https://github.com/Nyholm/http-client-benchmark (higher is better) +\** Benchmark with 50.000 runs. See https://github.com/devanych/psr-http-benchmark (higher is better) ## Installation @@ -30,16 +27,16 @@ A super lightweight PSR-7 implementation. Very strict and very fast. composer require nyholm/psr7 ``` -If you are using Symfony Flex then you get all message factories registered as services. +If you are using Symfony Flex then you get all message factories registered as services. ## Usage The PSR-7 objects do not contain any other public methods than those defined in -the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). +the [PSR-7 specification](https://www.php-fig.org/psr/psr-7/). ### Create objects -Use the PSR-17 factory to create requests, streams, URIs etc. +Use the PSR-17 factory to create requests, streams, URIs etc. ```php $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); @@ -49,8 +46,8 @@ $stream = $psr17Factory->createStream('foobar'); ### Sending a request -With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send -requests like: +With [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send +requests like: ```bash composer require kriswallsmith/buzz @@ -66,7 +63,7 @@ $response = $psr18Client->sendRequest($request); ### Create server requests -The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used +The [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used to create server requests from PHP superglobals. ```bash @@ -89,7 +86,7 @@ $serverRequest = $creator->fromGlobals(); ### Emitting a response ```bash -composer require zendframework/zend-httphandlerrunner +composer require laminas/laminas-httphandlerrunner ``` ```php @@ -97,15 +94,15 @@ $psr17Factory = new \Nyholm\Psr7\Factory\Psr17Factory(); $responseBody = $psr17Factory->createStream('Hello world'); $response = $psr17Factory->createResponse(200)->withBody($responseBody); -(new \Zend\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); +(new \Laminas\HttpHandlerRunner\Emitter\SapiEmitter())->emit($response); ``` ## Our goal -This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and +This package is currently maintained by [Tobias Nyholm](http://nyholm.se) and [Martijn van der Ven](https://vanderven.se/martijn/). They have decided that the -goal of this library should be to provide a super strict implementation of -[PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. +goal of this library should be to provide a super strict implementation of +[PSR-7](https://www.php-fig.org/psr/psr-7/) that is blazing fast. The package will never include any extra features nor helper methods. All our classes -and functions exist because they are required to fulfill the PSR-7 specification. +and functions exist because they are required to fulfill the PSR-7 specification. diff --git a/vendor/nyholm/psr7/composer.json b/vendor/nyholm/psr7/composer.json index 569cf14f91..c6076159db 100644 --- a/vendor/nyholm/psr7/composer.json +++ b/vendor/nyholm/psr7/composer.json @@ -3,7 +3,7 @@ "description": "A fast PHP7 implementation of PSR-7", "license": "MIT", "keywords": ["psr-7", "psr-17"], - "homepage": "http://tnyholm.se", + "homepage": "https://tnyholm.se", "authors": [ { "name": "Tobias Nyholm", @@ -15,17 +15,19 @@ } ], "require": { - "php": "^7.1", - "psr/http-message": "^1.0", - "php-http/message-factory": "^1.0", + "php": ">=7.2", + "psr/http-message": "^1.1 || ^2.0", "psr/http-factory": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.5", - "php-http/psr7-integration-tests": "dev-master", - "http-interop/http-factory-tests": "dev-master" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "http-interop/http-factory-tests": "^0.9", + "symfony/error-handler": "^4.4" }, "provide": { + "php-http/message-factory-implementation": "1.0", "psr/http-message-implementation": "1.0", "psr/http-factory-implementation": "1.0" }, @@ -39,13 +41,9 @@ "Tests\\Nyholm\\Psr7\\": "tests/" } }, - "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" - }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.8-dev" } } } diff --git a/vendor/nyholm/psr7/src/Factory/HttplugFactory.php b/vendor/nyholm/psr7/src/Factory/HttplugFactory.php index a2965414ad..cc9285ddf5 100644 --- a/vendor/nyholm/psr7/src/Factory/HttplugFactory.php +++ b/vendor/nyholm/psr7/src/Factory/HttplugFactory.php @@ -6,25 +6,38 @@ use Http\Message\{MessageFactory, StreamFactory, UriFactory}; use Nyholm\Psr7\{Request, Response, Stream, Uri}; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; +if (!\interface_exists(MessageFactory::class)) { + throw new \LogicException('You cannot use "Nyholm\Psr7\Factory\HttplugFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + +@\trigger_error('Class "Nyholm\Psr7\Factory\HttplugFactory" is deprecated since version 1.8, use "Nyholm\Psr7\Factory\Psr17Factory" instead.', \E_USER_DEPRECATED); + /** * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + * + * @deprecated since version 1.8, use Psr17Factory instead */ -final class HttplugFactory implements MessageFactory, StreamFactory, UriFactory +class HttplugFactory implements MessageFactory, StreamFactory, UriFactory { - public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1') + public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1'): RequestInterface { return new Request($method, $uri, $headers, $body, $protocolVersion); } - public function createResponse($statusCode = 200, $reasonPhrase = null, array $headers = [], $body = null, $version = '1.1') + public function createResponse($statusCode = 200, $reasonPhrase = null, array $headers = [], $body = null, $version = '1.1'): ResponseInterface { return new Response((int) $statusCode, $headers, $body, $version, $reasonPhrase); } - public function createStream($body = null) + public function createStream($body = null): StreamInterface { return Stream::create($body ?? ''); } diff --git a/vendor/nyholm/psr7/src/Factory/Psr17Factory.php b/vendor/nyholm/psr7/src/Factory/Psr17Factory.php index 08caf8571b..2fa98bee3b 100644 --- a/vendor/nyholm/psr7/src/Factory/Psr17Factory.php +++ b/vendor/nyholm/psr7/src/Factory/Psr17Factory.php @@ -10,8 +10,10 @@ /** * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface +class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface { public function createRequest(string $method, $uri): RequestInterface { @@ -35,13 +37,16 @@ public function createStream(string $content = ''): StreamInterface public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface { - $resource = @\fopen($filename, $mode); - if (false === $resource) { - if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'])) { - throw new \InvalidArgumentException('The mode ' . $mode . ' is invalid.'); + if ('' === $filename) { + throw new \RuntimeException('Path cannot be empty'); + } + + if (false === $resource = @\fopen($filename, $mode)) { + if ('' === $mode || false === \in_array($mode[0], ['r', 'w', 'a', 'x', 'c'], true)) { + throw new \InvalidArgumentException(\sprintf('The mode "%s" is invalid.', $mode)); } - throw new \RuntimeException('The file ' . $filename . ' cannot be opened.'); + throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $filename, \error_get_last()['message'] ?? '')); } return Stream::create($resource); @@ -52,7 +57,7 @@ public function createStreamFromResource($resource): StreamInterface return Stream::create($resource); } - public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface + public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface { if (null === $size) { $size = $stream->getSize(); diff --git a/vendor/nyholm/psr7/src/MessageTrait.php b/vendor/nyholm/psr7/src/MessageTrait.php index d1e93cc1e9..7d02383b83 100644 --- a/vendor/nyholm/psr7/src/MessageTrait.php +++ b/vendor/nyholm/psr7/src/MessageTrait.php @@ -4,6 +4,7 @@ namespace Nyholm\Psr7; +use Psr\Http\Message\MessageInterface; use Psr\Http\Message\StreamInterface; /** @@ -34,14 +35,21 @@ public function getProtocolVersion(): string return $this->protocol; } - public function withProtocolVersion($version): self + /** + * @return static + */ + public function withProtocolVersion($version): MessageInterface { + if (!\is_scalar($version)) { + throw new \InvalidArgumentException('Protocol version must be a string'); + } + if ($this->protocol === $version) { return $this; } $new = clone $this; - $new->protocol = $version; + $new->protocol = (string) $version; return $new; } @@ -53,12 +61,16 @@ public function getHeaders(): array public function hasHeader($header): bool { - return isset($this->headerNames[\strtolower($header)]); + return isset($this->headerNames[\strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')]); } public function getHeader($header): array { - $header = \strtolower($header); + if (!\is_string($header)) { + throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); + } + + $header = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); if (!isset($this->headerNames[$header])) { return []; } @@ -73,10 +85,13 @@ public function getHeaderLine($header): string return \implode(', ', $this->getHeader($header)); } - public function withHeader($header, $value): self + /** + * @return static + */ + public function withHeader($header, $value): MessageInterface { $value = $this->validateAndTrimHeader($header, $value); - $normalized = \strtolower($header); + $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); $new = clone $this; if (isset($new->headerNames[$normalized])) { @@ -88,10 +103,13 @@ public function withHeader($header, $value): self return $new; } - public function withAddedHeader($header, $value): self + /** + * @return static + */ + public function withAddedHeader($header, $value): MessageInterface { if (!\is_string($header) || '' === $header) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string.'); + throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); } $new = clone $this; @@ -100,9 +118,16 @@ public function withAddedHeader($header, $value): self return $new; } - public function withoutHeader($header): self + /** + * @return static + */ + public function withoutHeader($header): MessageInterface { - $normalized = \strtolower($header); + if (!\is_string($header)) { + throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); + } + + $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); if (!isset($this->headerNames[$normalized])) { return $this; } @@ -123,7 +148,10 @@ public function getBody(): StreamInterface return $this->stream; } - public function withBody(StreamInterface $body): self + /** + * @return static + */ + public function withBody(StreamInterface $body): MessageInterface { if ($body === $this->stream) { return $this; @@ -138,8 +166,13 @@ public function withBody(StreamInterface $body): self private function setHeaders(array $headers): void { foreach ($headers as $header => $value) { + if (\is_int($header)) { + // If a header name was set to a numeric string, PHP will cast the key to an int. + // We must cast it back to a string in order to comply with validation. + $header = (string) $header; + } $value = $this->validateAndTrimHeader($header, $value); - $normalized = \strtolower($header); + $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); if (isset($this->headerNames[$normalized])) { $header = $this->headerNames[$normalized]; $this->headers[$header] = \array_merge($this->headers[$header], $value); @@ -170,28 +203,28 @@ private function setHeaders(array $headers): void */ private function validateAndTrimHeader($header, $values): array { - if (!\is_string($header) || 1 !== \preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@", $header)) { - throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string.'); + if (!\is_string($header) || 1 !== \preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@D", $header)) { + throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); } if (!\is_array($values)) { // This is simple, just one value. if ((!\is_numeric($values) && !\is_string($values)) || 1 !== \preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@", (string) $values)) { - throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings.'); + throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings'); } return [\trim((string) $values, " \t")]; } if (empty($values)) { - throw new \InvalidArgumentException('Header values must be a string or an array of strings, empty array given.'); + throw new \InvalidArgumentException('Header values must be a string or an array of strings, empty array given'); } // Assert Non empty array $returnValues = []; foreach ($values as $v) { - if ((!\is_numeric($v) && !\is_string($v)) || 1 !== \preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@", (string) $v)) { - throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings.'); + if ((!\is_numeric($v) && !\is_string($v)) || 1 !== \preg_match("@^[ \t\x21-\x7E\x80-\xFF]*$@D", (string) $v)) { + throw new \InvalidArgumentException('Header values must be RFC 7230 compatible strings'); } $returnValues[] = \trim((string) $v, " \t"); diff --git a/vendor/nyholm/psr7/src/Request.php b/vendor/nyholm/psr7/src/Request.php index 84a9f2abc5..d50744eecb 100644 --- a/vendor/nyholm/psr7/src/Request.php +++ b/vendor/nyholm/psr7/src/Request.php @@ -9,8 +9,10 @@ /** * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class Request implements RequestInterface +class Request implements RequestInterface { use MessageTrait; use RequestTrait; diff --git a/vendor/nyholm/psr7/src/RequestTrait.php b/vendor/nyholm/psr7/src/RequestTrait.php index f39993a197..2dbb3abf68 100644 --- a/vendor/nyholm/psr7/src/RequestTrait.php +++ b/vendor/nyholm/psr7/src/RequestTrait.php @@ -4,6 +4,7 @@ namespace Nyholm\Psr7; +use Psr\Http\Message\RequestInterface; use Psr\Http\Message\UriInterface; /** @@ -40,8 +41,15 @@ public function getRequestTarget(): string return $target; } - public function withRequestTarget($requestTarget): self + /** + * @return static + */ + public function withRequestTarget($requestTarget): RequestInterface { + if (!\is_string($requestTarget)) { + throw new \InvalidArgumentException('Request target must be a string'); + } + if (\preg_match('#\s#', $requestTarget)) { throw new \InvalidArgumentException('Invalid request target provided; cannot contain whitespace'); } @@ -57,7 +65,10 @@ public function getMethod(): string return $this->method; } - public function withMethod($method): self + /** + * @return static + */ + public function withMethod($method): RequestInterface { if (!\is_string($method)) { throw new \InvalidArgumentException('Method must be a string'); @@ -74,7 +85,10 @@ public function getUri(): UriInterface return $this->uri; } - public function withUri(UriInterface $uri, $preserveHost = false): self + /** + * @return static + */ + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface { if ($uri === $this->uri) { return $this; diff --git a/vendor/nyholm/psr7/src/Response.php b/vendor/nyholm/psr7/src/Response.php index a75e93c318..71eb2fa494 100644 --- a/vendor/nyholm/psr7/src/Response.php +++ b/vendor/nyholm/psr7/src/Response.php @@ -10,8 +10,10 @@ * @author Michael Dowling and contributors to guzzlehttp/psr7 * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class Response implements ResponseInterface +class Response implements ResponseInterface { use MessageTrait; @@ -37,7 +39,7 @@ final class Response implements ResponseInterface * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ - public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) + public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', ?string $reason = null) { // If we got no body, defer initialization of the stream until Response::getBody() if ('' !== $body && null !== $body) { @@ -65,7 +67,10 @@ public function getReasonPhrase(): string return $this->reasonPhrase; } - public function withStatus($code, $reasonPhrase = ''): self + /** + * @return static + */ + public function withStatus($code, $reasonPhrase = ''): ResponseInterface { if (!\is_int($code) && !\is_string($code)) { throw new \InvalidArgumentException('Status code has to be an integer'); @@ -73,7 +78,7 @@ public function withStatus($code, $reasonPhrase = ''): self $code = (int) $code; if ($code < 100 || $code > 599) { - throw new \InvalidArgumentException('Status code has to be an integer between 100 and 599'); + throw new \InvalidArgumentException(\sprintf('Status code has to be an integer between 100 and 599. A status code of %d was given', $code)); } $new = clone $this; diff --git a/vendor/nyholm/psr7/src/ServerRequest.php b/vendor/nyholm/psr7/src/ServerRequest.php index aff8721d74..a3c5ba90b3 100644 --- a/vendor/nyholm/psr7/src/ServerRequest.php +++ b/vendor/nyholm/psr7/src/ServerRequest.php @@ -10,8 +10,10 @@ * @author Michael Dowling and contributors to guzzlehttp/psr7 * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class ServerRequest implements ServerRequestInterface +class ServerRequest implements ServerRequestInterface { use MessageTrait; use RequestTrait; @@ -54,6 +56,7 @@ public function __construct(string $method, $uri, array $headers = [], $body = n $this->uri = $uri; $this->setHeaders($headers); $this->protocol = $version; + \parse_str($uri->getQuery(), $this->queryParams); if (!$this->hasHeader('Host')) { $this->updateHostFromUri(); @@ -75,7 +78,10 @@ public function getUploadedFiles(): array return $this->uploadedFiles; } - public function withUploadedFiles(array $uploadedFiles) + /** + * @return static + */ + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface { $new = clone $this; $new->uploadedFiles = $uploadedFiles; @@ -88,7 +94,10 @@ public function getCookieParams(): array return $this->cookieParams; } - public function withCookieParams(array $cookies) + /** + * @return static + */ + public function withCookieParams(array $cookies): ServerRequestInterface { $new = clone $this; $new->cookieParams = $cookies; @@ -101,7 +110,10 @@ public function getQueryParams(): array return $this->queryParams; } - public function withQueryParams(array $query) + /** + * @return static + */ + public function withQueryParams(array $query): ServerRequestInterface { $new = clone $this; $new->queryParams = $query; @@ -109,12 +121,18 @@ public function withQueryParams(array $query) return $new; } + /** + * @return array|object|null + */ public function getParsedBody() { return $this->parsedBody; } - public function withParsedBody($data) + /** + * @return static + */ + public function withParsedBody($data): ServerRequestInterface { if (!\is_array($data) && !\is_object($data) && null !== $data) { throw new \InvalidArgumentException('First parameter to withParsedBody MUST be object, array or null'); @@ -131,8 +149,15 @@ public function getAttributes(): array return $this->attributes; } + /** + * @return mixed + */ public function getAttribute($attribute, $default = null) { + if (!\is_string($attribute)) { + throw new \InvalidArgumentException('Attribute name must be a string'); + } + if (false === \array_key_exists($attribute, $this->attributes)) { return $default; } @@ -140,16 +165,30 @@ public function getAttribute($attribute, $default = null) return $this->attributes[$attribute]; } - public function withAttribute($attribute, $value): self + /** + * @return static + */ + public function withAttribute($attribute, $value): ServerRequestInterface { + if (!\is_string($attribute)) { + throw new \InvalidArgumentException('Attribute name must be a string'); + } + $new = clone $this; $new->attributes[$attribute] = $value; return $new; } - public function withoutAttribute($attribute): self + /** + * @return static + */ + public function withoutAttribute($attribute): ServerRequestInterface { + if (!\is_string($attribute)) { + throw new \InvalidArgumentException('Attribute name must be a string'); + } + if (false === \array_key_exists($attribute, $this->attributes)) { return $this; } diff --git a/vendor/nyholm/psr7/src/Stream.php b/vendor/nyholm/psr7/src/Stream.php index a72ce0a698..63b7d6dd54 100644 --- a/vendor/nyholm/psr7/src/Stream.php +++ b/vendor/nyholm/psr7/src/Stream.php @@ -10,9 +10,13 @@ * @author Michael Dowling and contributors to guzzlehttp/psr7 * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class Stream implements StreamInterface +class Stream implements StreamInterface { + use StreamTrait; + /** @var resource|null A resource reference */ private $stream; @@ -25,7 +29,7 @@ final class Stream implements StreamInterface /** @var bool */ private $writable; - /** @var array|mixed|void|null */ + /** @var array|mixed|void|bool|null */ private $uri; /** @var int|null */ @@ -47,8 +51,20 @@ final class Stream implements StreamInterface ], ]; - private function __construct() + /** + * @param resource $body + */ + public function __construct($body) { + if (!\is_resource($body)) { + throw new \InvalidArgumentException('First argument to Stream::__construct() must be resource'); + } + + $this->stream = $body; + $meta = \stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable'] && 0 === \fseek($this->stream, 0, \SEEK_CUR); + $this->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]); + $this->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]); } /** @@ -56,8 +72,6 @@ private function __construct() * * @param string|resource|StreamInterface $body * - * @return StreamInterface - * * @throws \InvalidArgumentException */ public static function create($body = ''): StreamInterface @@ -67,24 +81,21 @@ public static function create($body = ''): StreamInterface } if (\is_string($body)) { - $resource = \fopen('php://temp', 'rw+'); - \fwrite($resource, $body); - $body = $resource; + if (200000 <= \strlen($body)) { + $body = self::openZvalStream($body); + } else { + $resource = \fopen('php://memory', 'r+'); + \fwrite($resource, $body); + \fseek($resource, 0); + $body = $resource; + } } - if (\is_resource($body)) { - $new = new self(); - $new->stream = $body; - $meta = \stream_get_meta_data($new->stream); - $new->seekable = $meta['seekable'] && 0 === \fseek($new->stream, 0, \SEEK_CUR); - $new->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]); - $new->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]); - $new->uri = $new->getMetadata('uri'); - - return $new; + if (!\is_resource($body)) { + throw new \InvalidArgumentException('First argument to Stream::create() must be a string, resource or StreamInterface'); } - throw new \InvalidArgumentException('First argument to Stream::create() must be a string, resource or StreamInterface.'); + return new self($body); } /** @@ -95,19 +106,6 @@ public function __destruct() $this->close(); } - public function __toString(): string - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - - return $this->getContents(); - } catch (\Exception $e) { - return ''; - } - } - public function close(): void { if (isset($this->stream)) { @@ -132,6 +130,15 @@ public function detach() return $result; } + private function getUri() + { + if (false !== $this->uri) { + $this->uri = $this->getMetadata('uri') ?? false; + } + + return $this->uri; + } + public function getSize(): ?int { if (null !== $this->size) { @@ -143,8 +150,8 @@ public function getSize(): ?int } // Clear the stat cache if the stream has a URI - if ($this->uri) { - \clearstatcache(true, $this->uri); + if ($uri = $this->getUri()) { + \clearstatcache(true, $uri); } $stats = \fstat($this->stream); @@ -159,8 +166,12 @@ public function getSize(): ?int public function tell(): int { - if (false === $result = \ftell($this->stream)) { - throw new \RuntimeException('Unable to determine stream position'); + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + if (false === $result = @\ftell($this->stream)) { + throw new \RuntimeException('Unable to determine stream position: ' . (\error_get_last()['message'] ?? '')); } return $result; @@ -168,7 +179,7 @@ public function tell(): int public function eof(): bool { - return !$this->stream || \feof($this->stream); + return !isset($this->stream) || \feof($this->stream); } public function isSeekable(): bool @@ -178,12 +189,16 @@ public function isSeekable(): bool public function seek($offset, $whence = \SEEK_SET): void { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { throw new \RuntimeException('Stream is not seekable'); } if (-1 === \fseek($this->stream, $offset, $whence)) { - throw new \RuntimeException('Unable to seek to stream position ' . $offset . ' with whence ' . \var_export($whence, true)); + throw new \RuntimeException('Unable to seek to stream position "' . $offset . '" with whence ' . \var_export($whence, true)); } } @@ -199,6 +214,10 @@ public function isWritable(): bool public function write($string): int { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { throw new \RuntimeException('Cannot write to a non-writable stream'); } @@ -206,8 +225,8 @@ public function write($string): int // We can't know the size after writing anything $this->size = null; - if (false === $result = \fwrite($this->stream, $string)) { - throw new \RuntimeException('Unable to write to stream'); + if (false === $result = @\fwrite($this->stream, $string)) { + throw new \RuntimeException('Unable to write to stream: ' . (\error_get_last()['message'] ?? '')); } return $result; @@ -220,28 +239,51 @@ public function isReadable(): bool public function read($length): string { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { throw new \RuntimeException('Cannot read from non-readable stream'); } - return \fread($this->stream, $length); + if (false === $result = @\fread($this->stream, $length)) { + throw new \RuntimeException('Unable to read from stream: ' . (\error_get_last()['message'] ?? '')); + } + + return $result; } public function getContents(): string { if (!isset($this->stream)) { - throw new \RuntimeException('Unable to read stream contents'); + throw new \RuntimeException('Stream is detached'); } - if (false === $contents = \stream_get_contents($this->stream)) { - throw new \RuntimeException('Unable to read stream contents'); - } + $exception = null; - return $contents; + \set_error_handler(static function ($type, $message) use (&$exception) { + throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message); + }); + + try { + return \stream_get_contents($this->stream); + } catch (\Throwable $e) { + throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e); + } finally { + \restore_error_handler(); + } } + /** + * @return mixed + */ public function getMetadata($key = null) { + if (null !== $key && !\is_string($key)) { + throw new \InvalidArgumentException('Metadata key must be a string'); + } + if (!isset($this->stream)) { return $key ? null : []; } @@ -254,4 +296,104 @@ public function getMetadata($key = null) return $meta[$key] ?? null; } + + private static function openZvalStream(string $body) + { + static $wrapper; + + $wrapper ?? \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper = \get_class(new class() { + public $context; + + private $data; + private $position = 0; + + public function stream_open(): bool + { + $this->data = \stream_context_get_options($this->context)['Nyholm-Psr7-Zval']['data']; + \stream_context_set_option($this->context, 'Nyholm-Psr7-Zval', 'data', null); + + return true; + } + + public function stream_read(int $count): string + { + $result = \substr($this->data, $this->position, $count); + $this->position += \strlen($result); + + return $result; + } + + public function stream_write(string $data): int + { + $this->data = \substr_replace($this->data, $data, $this->position, \strlen($data)); + $this->position += \strlen($data); + + return \strlen($data); + } + + public function stream_tell(): int + { + return $this->position; + } + + public function stream_eof(): bool + { + return \strlen($this->data) <= $this->position; + } + + public function stream_stat(): array + { + return [ + 'mode' => 33206, // POSIX_S_IFREG | 0666 + 'nlink' => 1, + 'rdev' => -1, + 'size' => \strlen($this->data), + 'blksize' => -1, + 'blocks' => -1, + ]; + } + + public function stream_seek(int $offset, int $whence): bool + { + if (\SEEK_SET === $whence && (0 <= $offset && \strlen($this->data) >= $offset)) { + $this->position = $offset; + } elseif (\SEEK_CUR === $whence && 0 <= $offset) { + $this->position += $offset; + } elseif (\SEEK_END === $whence && (0 > $offset && 0 <= $offset = \strlen($this->data) + $offset)) { + $this->position = $offset; + } else { + return false; + } + + return true; + } + + public function stream_set_option(): bool + { + return true; + } + + public function stream_truncate(int $new_size): bool + { + if ($new_size) { + $this->data = \substr($this->data, 0, $new_size); + $this->position = \min($this->position, $new_size); + } else { + $this->data = ''; + $this->position = 0; + } + + return true; + } + })); + + $context = \stream_context_create(['Nyholm-Psr7-Zval' => ['data' => $body]]); + + if (!$stream = @\fopen('Nyholm-Psr7-Zval://', 'r+', false, $context)) { + \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper); + $stream = \fopen('Nyholm-Psr7-Zval://', 'r+', false, $context); + } + + return $stream; + } } diff --git a/vendor/nyholm/psr7/src/StreamTrait.php b/vendor/nyholm/psr7/src/StreamTrait.php new file mode 100644 index 0000000000..41a3f9d7e2 --- /dev/null +++ b/vendor/nyholm/psr7/src/StreamTrait.php @@ -0,0 +1,57 @@ +<?php + +declare(strict_types=1); + +namespace Nyholm\Psr7; + +use Psr\Http\Message\StreamInterface; +use Symfony\Component\Debug\ErrorHandler as SymfonyLegacyErrorHandler; +use Symfony\Component\ErrorHandler\ErrorHandler as SymfonyErrorHandler; + +if (\PHP_VERSION_ID >= 70400 || (new \ReflectionMethod(StreamInterface::class, '__toString'))->hasReturnType()) { + /** + * @internal + */ + trait StreamTrait + { + public function __toString(): string + { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } + } +} else { + /** + * @internal + */ + trait StreamTrait + { + /** + * @return string + */ + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\is_array($errorHandler = \set_error_handler('var_dump'))) { + $errorHandler = $errorHandler[0] ?? null; + } + \restore_error_handler(); + + if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { + return \trigger_error((string) $e, \E_USER_ERROR); + } + + return ''; + } + } + } +} diff --git a/vendor/nyholm/psr7/src/UploadedFile.php b/vendor/nyholm/psr7/src/UploadedFile.php index 757e70e9cf..c77dca43f0 100644 --- a/vendor/nyholm/psr7/src/UploadedFile.php +++ b/vendor/nyholm/psr7/src/UploadedFile.php @@ -10,8 +10,10 @@ * @author Michael Dowling and contributors to guzzlehttp/psr7 * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class UploadedFile implements UploadedFileInterface +class UploadedFile implements UploadedFileInterface { /** @var array */ private const ERRORS = [ @@ -56,7 +58,7 @@ final class UploadedFile implements UploadedFileInterface public function __construct($streamOrFile, $size, $errorStatus, $clientFilename = null, $clientMediaType = null) { if (false === \is_int($errorStatus) || !isset(self::ERRORS[$errorStatus])) { - throw new \InvalidArgumentException('Upload file error status must be an integer value and one of the "UPLOAD_ERR_*" constants.'); + throw new \InvalidArgumentException('Upload file error status must be an integer value and one of the "UPLOAD_ERR_*" constants'); } if (false === \is_int($size)) { @@ -78,7 +80,7 @@ public function __construct($streamOrFile, $size, $errorStatus, $clientFilename if (\UPLOAD_ERR_OK === $this->error) { // Depending on the value set file or stream variable. - if (\is_string($streamOrFile)) { + if (\is_string($streamOrFile) && '' !== $streamOrFile) { $this->file = $streamOrFile; } elseif (\is_resource($streamOrFile)) { $this->stream = Stream::create($streamOrFile); @@ -112,7 +114,9 @@ public function getStream(): StreamInterface return $this->stream; } - $resource = \fopen($this->file, 'r'); + if (false === $resource = @\fopen($this->file, 'r')) { + throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $this->file, \error_get_last()['message'] ?? '')); + } return Stream::create($resource); } @@ -126,15 +130,23 @@ public function moveTo($targetPath): void } if (null !== $this->file) { - $this->moved = 'cli' === \PHP_SAPI ? \rename($this->file, $targetPath) : \move_uploaded_file($this->file, $targetPath); + $this->moved = 'cli' === \PHP_SAPI ? @\rename($this->file, $targetPath) : @\move_uploaded_file($this->file, $targetPath); + + if (false === $this->moved) { + throw new \RuntimeException(\sprintf('Uploaded file could not be moved to "%s": %s', $targetPath, \error_get_last()['message'] ?? '')); + } } else { $stream = $this->getStream(); if ($stream->isSeekable()) { $stream->rewind(); } - // Copy the contents of a stream into another stream until end-of-file. - $dest = Stream::create(\fopen($targetPath, 'w')); + if (false === $resource = @\fopen($targetPath, 'w')) { + throw new \RuntimeException(\sprintf('The file "%s" cannot be opened: %s', $targetPath, \error_get_last()['message'] ?? '')); + } + + $dest = Stream::create($resource); + while (!$stream->eof()) { if (!$dest->write($stream->read(1048576))) { break; @@ -143,10 +155,6 @@ public function moveTo($targetPath): void $this->moved = true; } - - if (false === $this->moved) { - throw new \RuntimeException(\sprintf('Uploaded file could not be moved to %s', $targetPath)); - } } public function getSize(): int diff --git a/vendor/nyholm/psr7/src/Uri.php b/vendor/nyholm/psr7/src/Uri.php index d67c0783ee..621e2e7247 100644 --- a/vendor/nyholm/psr7/src/Uri.php +++ b/vendor/nyholm/psr7/src/Uri.php @@ -14,8 +14,10 @@ * @author Matthew Weier O'Phinney * @author Tobias Nyholm <tobias.nyholm@gmail.com> * @author Martijn van der Ven <martijn@vanderven.se> + * + * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md */ -final class Uri implements UriInterface +class Uri implements UriInterface { private const SCHEMES = ['http' => 80, 'https' => 443]; @@ -23,6 +25,8 @@ final class Uri implements UriInterface private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; + private const CHAR_GEN_DELIMS = ':\/\?#\[\]@'; + /** @var string Uri scheme. */ private $scheme = ''; @@ -48,13 +52,13 @@ public function __construct(string $uri = '') { if ('' !== $uri) { if (false === $parts = \parse_url($uri)) { - throw new \InvalidArgumentException("Unable to parse URI: $uri"); + throw new \InvalidArgumentException(\sprintf('Unable to parse URI: "%s"', $uri)); } // Apply parse_url parts to a URI. - $this->scheme = isset($parts['scheme']) ? \strtolower($parts['scheme']) : ''; + $this->scheme = isset($parts['scheme']) ? \strtr($parts['scheme'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; $this->userInfo = $parts['user'] ?? ''; - $this->host = isset($parts['host']) ? \strtolower($parts['host']) : ''; + $this->host = isset($parts['host']) ? \strtr($parts['host'], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') : ''; $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null; $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; $this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : ''; @@ -110,7 +114,20 @@ public function getPort(): ?int public function getPath(): string { - return $this->path; + $path = $this->path; + + if ('' !== $path && '/' !== $path[0]) { + if ('' !== $this->host) { + // If the path is rootless and an authority is present, the path MUST be prefixed by "/" + $path = '/' . $path; + } + } elseif (isset($path[1]) && '/' === $path[1]) { + // If the path is starting with more than one "/", the + // starting slashes MUST be reduced to one. + $path = '/' . \ltrim($path, '/'); + } + + return $path; } public function getQuery(): string @@ -123,13 +140,16 @@ public function getFragment(): string return $this->fragment; } - public function withScheme($scheme): self + /** + * @return static + */ + public function withScheme($scheme): UriInterface { if (!\is_string($scheme)) { throw new \InvalidArgumentException('Scheme must be a string'); } - if ($this->scheme === $scheme = \strtolower($scheme)) { + if ($this->scheme === $scheme = \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { return $this; } @@ -140,11 +160,22 @@ public function withScheme($scheme): self return $new; } - public function withUserInfo($user, $password = null): self + /** + * @return static + */ + public function withUserInfo($user, $password = null): UriInterface { - $info = $user; + if (!\is_string($user)) { + throw new \InvalidArgumentException('User must be a string'); + } + + $info = \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $user); if (null !== $password && '' !== $password) { - $info .= ':' . $password; + if (!\is_string($password)) { + throw new \InvalidArgumentException('Password must be a string'); + } + + $info .= ':' . \preg_replace_callback('/[' . self::CHAR_GEN_DELIMS . self::CHAR_SUB_DELIMS . ']++/', [__CLASS__, 'rawurlencodeMatchZero'], $password); } if ($this->userInfo === $info) { @@ -157,13 +188,16 @@ public function withUserInfo($user, $password = null): self return $new; } - public function withHost($host): self + /** + * @return static + */ + public function withHost($host): UriInterface { if (!\is_string($host)) { throw new \InvalidArgumentException('Host must be a string'); } - if ($this->host === $host = \strtolower($host)) { + if ($this->host === $host = \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { return $this; } @@ -173,7 +207,10 @@ public function withHost($host): self return $new; } - public function withPort($port): self + /** + * @return static + */ + public function withPort($port): UriInterface { if ($this->port === $port = $this->filterPort($port)) { return $this; @@ -185,7 +222,10 @@ public function withPort($port): self return $new; } - public function withPath($path): self + /** + * @return static + */ + public function withPath($path): UriInterface { if ($this->path === $path = $this->filterPath($path)) { return $this; @@ -197,7 +237,10 @@ public function withPath($path): self return $new; } - public function withQuery($query): self + /** + * @return static + */ + public function withQuery($query): UriInterface { if ($this->query === $query = $this->filterQueryAndFragment($query)) { return $this; @@ -209,7 +252,10 @@ public function withQuery($query): self return $new; } - public function withFragment($fragment): self + /** + * @return static + */ + public function withFragment($fragment): UriInterface { if ($this->fragment === $fragment = $this->filterQueryAndFragment($fragment)) { return $this; @@ -278,7 +324,7 @@ private function filterPort($port): ?int } $port = (int) $port; - if (0 > $port || 0xffff < $port) { + if (0 > $port || 0xFFFF < $port) { throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port)); } diff --git a/vendor/omines/oauth2-gitlab/.github/workflows/ci.yaml b/vendor/omines/oauth2-gitlab/.github/workflows/ci.yaml new file mode 100644 index 0000000000..78a6a92d5b --- /dev/null +++ b/vendor/omines/oauth2-gitlab/.github/workflows/ci.yaml @@ -0,0 +1,76 @@ +name: test suite + +on: + pull_request: + push: + branches: + - master + schedule: # Ensure weekly test also if no pushes happen to keep up with dependencies + - cron: 0 11 * * 1 + +jobs: + run: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental || matrix.dependencies == 'beta' }} + strategy: + fail-fast: false + matrix: + php: + - '8.1' + - '8.2' + dependencies: [ stable, beta, lowest ] + experimental: [ false ] + include: + - description: 'stable dependencies' + dependencies: stable + - description: 'lowest dependencies' + dependencies: lowest + - description: 'beta/RC dependencies' + dependencies: beta + - description: 'nightly with stable dependencies' + php: 8.3 + experimental: true + + name: PHP ${{ matrix.php }} ${{ matrix.description }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: intl, mbstring + ini-values: zend.assertions=1 + + - name: Dump PHP diagnostics + run: php -i && php -m + + - name: Allow beta dependencies + run: composer config minimum-stability beta + if: matrix.dependencies == 'beta' + + - name: Install dependencies + run: composer update --no-progress ${{ (matrix.dependencies == 'lowest') && '--prefer-lowest --prefer-stable' || ''}} + + - name: Check code style + run: vendor/bin/php-cs-fixer fix --dry-run + if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} + + - name: Run PHPStan static analysis + run: vendor/bin/phpstan + if: ${{ matrix.dependencies != 'lowest' && !matrix.experimental }} + + - name: Run automated tests + run: vendor/bin/phpunit --coverage-text --coverage-xml build/coverage-xml --coverage-cobertura build/cobertura.xml + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Run infection tests + run: vendor/bin/infection --threads=max + if: ${{ matrix.dependencies == 'stable' && !matrix.experimental }} + env: + STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_TOKEN }} diff --git a/vendor/omines/oauth2-gitlab/.gitignore b/vendor/omines/oauth2-gitlab/.gitignore index 355754b0ca..7574196531 100644 --- a/vendor/omines/oauth2-gitlab/.gitignore +++ b/vendor/omines/oauth2-gitlab/.gitignore @@ -1,7 +1,8 @@ /build /log /vendor -.php_cs.cache +/.idea +.*.cache composer.phar composer.lock infection.json diff --git a/vendor/omines/oauth2-gitlab/.php_cs b/vendor/omines/oauth2-gitlab/.php-cs-fixer.php similarity index 74% rename from vendor/omines/oauth2-gitlab/.php_cs rename to vendor/omines/oauth2-gitlab/.php-cs-fixer.php index bf14aa34da..f748bbf465 100644 --- a/vendor/omines/oauth2-gitlab/.php_cs +++ b/vendor/omines/oauth2-gitlab/.php-cs-fixer.php @@ -11,19 +11,21 @@ $finder = PhpCsFixer\Finder::create() ->files() ->name('*.php') - ->name('*.php') ->in(__DIR__.'/src') ->in(__DIR__.'/test') ; -return PhpCsFixer\Config::create() +$config = new PhpCsFixer\Config(); +return $config + ->setRiskyAllowed(true) ->setRules([ '@Symfony' => true, 'array_syntax' => ['syntax' => 'short'], 'concat_space' => ['spacing' => 'one'], - 'header_comment' => ['header' => $header], + 'header_comment' => ['header' => $header, 'location' => 'after_open'], - 'blank_line_before_return' => false, + 'mb_str_functions' => true, + 'ordered_imports' => true, 'phpdoc_align' => false, 'phpdoc_separation' => false, 'phpdoc_var_without_name' => false, diff --git a/vendor/omines/oauth2-gitlab/.scrutinizer.yml b/vendor/omines/oauth2-gitlab/.scrutinizer.yml deleted file mode 100644 index b18948d32f..0000000000 --- a/vendor/omines/oauth2-gitlab/.scrutinizer.yml +++ /dev/null @@ -1,35 +0,0 @@ -filter: - excluded_paths: [test/*] -checks: - php: - code_rating: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true -tools: - external_code_coverage: - timeout: 600 - runs: 3 - php_analyzer: true - php_code_coverage: false - php_code_sniffer: - config: - standard: PSR2 - filter: - paths: ['src', 'test'] - php_loc: - enabled: true - excluded_dirs: [vendor, test] - php_cpd: - enabled: true - excluded_dirs: [vendor, test] diff --git a/vendor/omines/oauth2-gitlab/.travis.yml b/vendor/omines/oauth2-gitlab/.travis.yml deleted file mode 100644 index f16993ce74..0000000000 --- a/vendor/omines/oauth2-gitlab/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -matrix: - include: - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: 7.2 - env: COMPOSER_FLAGS="--prefer-lowest" - allow_failures: - - php: nightly - -before_script: - - travis_retry composer self-update --no-progress - - travis_retry composer update --no-interaction --no-progress $COMPOSER_FLAGS - - travis_retry phpenv rehash - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then bin/install-infection; fi; - -script: - - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then ./infection.phar --min-msi=60 --threads=4; fi; - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/vendor/omines/oauth2-gitlab/CHANGELOG.md b/vendor/omines/oauth2-gitlab/CHANGELOG.md index b2491feef4..0fa3d3f0f7 100644 --- a/vendor/omines/oauth2-gitlab/CHANGELOG.md +++ b/vendor/omines/oauth2-gitlab/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to `oauth2-gitlab` will be documented in this file This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +Nothing yet. + +## [3.6.0] - 2023-11-06 +Maintenance release + + - Upped code quality to PHPStan max level + - Officially support PHP 8.3 + - Switched to Github Actions + +## [3.5.0] - 2022-10-18 +### Changed + - Maintenance release dropping support for PHP versions below 8.0 + +## [3.4.0] - 2021-02-08 +### Added + - Compatibility with php-gitlab-api v11 + - Test suite compatible with PHP8 + +## [3.3.0] - 2020-02-10 +### Added + - Compatibility with php-gitlab-api v10 ## [3.2.0] - 2020-02-10 ### Changed @@ -55,7 +76,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Original fork, feature complete -[Unreleased]: https://github.com/omines/oauth2-gitlab/compare/3.2.0...master +[Unreleased]: https://github.com/omines/oauth2-gitlab/compare/3.6.0...master +[3.6.0]: https://github.com/omines/oauth2-gitlab/compare/3.5.0...3.6.0 +[3.5.0]: https://github.com/omines/oauth2-gitlab/compare/3.4.0...3.5.0 +[3.4.0]: https://github.com/omines/oauth2-gitlab/compare/3.3.0...3.4.0 +[3.3.0]: https://github.com/omines/oauth2-gitlab/compare/3.2.0...3.3.0 [3.2.0]: https://github.com/omines/oauth2-gitlab/compare/3.1.2...3.2.0 [3.1.2]: https://github.com/omines/oauth2-gitlab/compare/3.1.1...3.1.2 [3.1.1]: https://github.com/omines/oauth2-gitlab/compare/3.1.0...3.1.1 diff --git a/vendor/omines/oauth2-gitlab/CONTRIBUTING.md b/vendor/omines/oauth2-gitlab/CONTRIBUTING.md index c3c5b21fea..e2d103937d 100644 --- a/vendor/omines/oauth2-gitlab/CONTRIBUTING.md +++ b/vendor/omines/oauth2-gitlab/CONTRIBUTING.md @@ -3,5 +3,5 @@ Contributions are **welcome** and will be fully **credited**. We accept contributions via Pull Requests on [Github](https://github.com/omines/oauth2-gitlab). Follow -[good standards](http://www.phptherightway.com/), keep code coverage at 100%, and run `vendor/bin/php-cs-fixer fix` +[good standards](http://www.phptherightway.com/), keep code coverage at 100%, and run `bin/prepare-commit` before committing. diff --git a/vendor/omines/oauth2-gitlab/LICENSE b/vendor/omines/oauth2-gitlab/LICENSE index 057f7f4f64..a5d1e639f9 100644 --- a/vendor/omines/oauth2-gitlab/LICENSE +++ b/vendor/omines/oauth2-gitlab/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Omines Internetbureau B.V. / Steven Maguire +Copyright (c) 2022 and beyond Omines Internetbureau B.V. / Steven Maguire Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/omines/oauth2-gitlab/README.md b/vendor/omines/oauth2-gitlab/README.md index af762a98e4..b5e6981a4e 100644 --- a/vendor/omines/oauth2-gitlab/README.md +++ b/vendor/omines/oauth2-gitlab/README.md @@ -1,16 +1,13 @@ # GitLab Provider for OAuth 2.0 Client [![Latest Version](https://img.shields.io/github/release/omines/oauth2-gitlab.svg?style=flat-square)](https://github.com/omines/oauth2-gitlab/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/travis/omines/oauth2-gitlab/master.svg?style=flat-square)](https://travis-ci.org/omines/oauth2-gitlab) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/omines/oauth2-gitlab.svg?style=flat-square)](https://scrutinizer-ci.com/g/omines/oauth2-gitlab/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/omines/oauth2-gitlab.svg?style=flat-square)](https://scrutinizer-ci.com/g/omines/oauth2-gitlab) [![Total Downloads](https://img.shields.io/packagist/dt/omines/oauth2-gitlab.svg?style=flat-square)](https://packagist.org/packages/omines/oauth2-gitlab) +[![test suite](https://github.com/omines/oauth2-gitlab/actions/workflows/ci.yaml/badge.svg)](https://github.com/omines/oauth2-gitlab/actions/workflows/ci.yaml) +[![codecov](https://codecov.io/gh/omines/oauth2-gitlab/graph/badge.svg?token=sAqu9IFaYQ)](https://codecov.io/gh/omines/oauth2-gitlab) +[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fomines%2Foauth2-gitlab%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/omines/oauth2-gitlab/master) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) This package provides GitLab OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client). -GitLab 8.17 or later is required as the V4 API is being used. If compatibility with older versions -of GitLab is required use version 2 of this library. - ## Installation To install, use composer: @@ -26,7 +23,7 @@ Usage is similar to the basic OAuth client, using `\Omines\OAuth2\Client\Provide ### Authorization Code Flow ```php -$provider = new Omines\OAuth2\Client\Provider\Gitlab([ +$provider = new \Omines\OAuth2\Client\Provider\Gitlab([ 'clientId' => '{gitlab-client-id}', 'clientSecret' => '{gitlab-client-secret}', 'redirectUri' => 'https://example.com/callback-url', @@ -95,22 +92,16 @@ Install [`m4tthumphrey/php-gitlab-api`](https://packagist.org/packages/m4tthumph Gitlab API after authentication. Either connect manually: ```php -$client = new \Gitlab\Client('https://my.gitlab.url/api/v4/'); +$client = new \Gitlab\Client(); +$client->setUrl('https://my.gitlab.url/api/v4/'); $client->authenticate($token->getToken(), \Gitlab\Client::AUTH_OAUTH_TOKEN); ``` Or call the `getApiClient` method on `GitlabResourceOwner` which does the same implicitly. -## Testing - -```bash -$ ./vendor/bin/phpunit -``` - ## Contributing Please see [CONTRIBUTING](https://github.com/omines/oauth2-gitlab/blob/master/CONTRIBUTING.md) for details. - ## Credits This code is a modified fork from the [official Github provider](https://github.com/thephpleague/oauth2-github) adapted diff --git a/vendor/omines/oauth2-gitlab/bin/install-infection b/vendor/omines/oauth2-gitlab/bin/install-infection index ce3e2aa150..09992e3cd3 100755 --- a/vendor/omines/oauth2-gitlab/bin/install-infection +++ b/vendor/omines/oauth2-gitlab/bin/install-infection @@ -1,8 +1,9 @@ #!/bin/sh cd $(dirname $0)/.. -wget -N https://github.com/infection/infection/releases/download/0.10.3/infection.phar -wget -N https://github.com/infection/infection/releases/download/0.10.3/infection.phar.asc -gpg --keyserver hkps.pool.sks-keyservers.net --recv-keys 493B4AA0 +wget https://github.com/infection/infection/releases/download/0.27.0/infection.phar +wget https://github.com/infection/infection/releases/download/0.27.0/infection.phar.asc +gpg --recv-keys C6D76C329EBADE2FB9C458CFC5095986493B4AA0 gpg --with-fingerprint --verify infection.phar.asc infection.phar +rm infection.phar.asc* chmod +x infection.phar diff --git a/vendor/omines/oauth2-gitlab/bin/prepare-commit b/vendor/omines/oauth2-gitlab/bin/prepare-commit new file mode 100644 index 0000000000..5aff19dcae --- /dev/null +++ b/vendor/omines/oauth2-gitlab/bin/prepare-commit @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +cd $(dirname $0)/.. + +vendor/bin/php-cs-fixer fix +vendor/bin/phpstan +XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text +vendor/bin/infection --threads=max + +echo "All good, ready for commit!" diff --git a/vendor/omines/oauth2-gitlab/composer.json b/vendor/omines/oauth2-gitlab/composer.json index e6dbf05b21..d542f43be9 100644 --- a/vendor/omines/oauth2-gitlab/composer.json +++ b/vendor/omines/oauth2-gitlab/composer.json @@ -18,15 +18,22 @@ "gitlab" ], "require": { - "php": ">=7.2", - "league/oauth2-client": "^2.2" + "php": ">=8.1", + "league/oauth2-client": "^2.4.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "mockery/mockery": "^1.0", - "m4tthumphrey/php-gitlab-api": "^9.0.0", - "php-http/guzzle6-adapter": "^2.0.1", - "phpunit/phpunit": "^8.0|^9.0" + "friendsofphp/php-cs-fixer": "^3.37.1", + "guzzlehttp/psr7": "^2.6.1", + "http-interop/http-factory-guzzle": "^1.2", + "infection/infection": "^0.27.7", + "m4tthumphrey/php-gitlab-api": "^11.12", + "mockery/mockery": "^1.6.6", + "php-http/guzzle7-adapter": "^1.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.41", + "phpstan/phpstan-mockery": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.15", + "phpunit/phpunit": "^10.4.2" }, "suggest": { "m4tthumphrey/php-gitlab-api": "For further API usage using the acquired OAuth2 token" @@ -41,12 +48,17 @@ "Omines\\OAuth2\\Client\\Test\\": "test/src/" } }, - "conflict": { - "league/oauth2-client": "2.4.0" - }, "extra": { "branch-alias": { "dev-master": "3.x-dev" } + }, + "config": { + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true, + "php-http/discovery": true, + "infection/extension-installer": true + } } } diff --git a/vendor/omines/oauth2-gitlab/infection.json.dist b/vendor/omines/oauth2-gitlab/infection.json.dist deleted file mode 100644 index 542f1dad88..0000000000 --- a/vendor/omines/oauth2-gitlab/infection.json.dist +++ /dev/null @@ -1,12 +0,0 @@ -{ - "timeout": 10, - "source": { - "directories": [ - "src" - ] - }, - "logs": { - "text": "log/infection.txt", - "perMutator": "log/mutators.md" - } -} \ No newline at end of file diff --git a/vendor/omines/oauth2-gitlab/infection.json5 b/vendor/omines/oauth2-gitlab/infection.json5 new file mode 100644 index 0000000000..3558823132 --- /dev/null +++ b/vendor/omines/oauth2-gitlab/infection.json5 @@ -0,0 +1,19 @@ +{ + "$schema": "https://raw.githubusercontent.com/infection/infection/0.27.0/resources/schema.json", + "timeout": 10, + "source": { + "directories": [ + "src" + ] + }, + "minMsi": 100, + "minCoveredMsi": 100, + "mutators": { + "@default": true + }, + "logs": { + "text": "log/infection.txt", + "perMutator": "log/mutators.md", + "stryker": { "report": "master" } + } +} \ No newline at end of file diff --git a/vendor/omines/oauth2-gitlab/phpstan.neon b/vendor/omines/oauth2-gitlab/phpstan.neon new file mode 100644 index 0000000000..760d5eb7d3 --- /dev/null +++ b/vendor/omines/oauth2-gitlab/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: max + paths: + - src + - test diff --git a/vendor/omines/oauth2-gitlab/phpunit.xml.dist b/vendor/omines/oauth2-gitlab/phpunit.xml.dist index ecca7f4249..cf5a39ce85 100644 --- a/vendor/omines/oauth2-gitlab/phpunit.xml.dist +++ b/vendor/omines/oauth2-gitlab/phpunit.xml.dist @@ -1,34 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<phpunit backupGlobals="false" - backupStaticAttributes="false" - bootstrap="vendor/autoload.php" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" -> - <logging> - <log type="coverage-html" - target="./build/coverage/html" - lowUpperBound="35" - highLowerBound="70"/> - <log type="coverage-clover" - target="./build/coverage/log/coverage.xml"/> - </logging> - <testsuites> - <testsuite name="Package Test Suite"> - <directory suffix=".php">./test/</directory> - </testsuite> - </testsuites> - <filter> - <whitelist> - <directory suffix=".php">./</directory> - <exclude> - <directory suffix=".php">./vendor</directory> - <directory suffix=".php">./test</directory> - </exclude> - </whitelist> - </filter> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> + <coverage> + <report> + <clover outputFile="./build/coverage/log/coverage.xml"/> + <html outputDirectory="./build/coverage/html" lowUpperBound="35" highLowerBound="70"/> + </report> + </coverage> + <logging/> + <testsuites> + <testsuite name="Package Test Suite"> + <directory suffix=".php">./test/</directory> + </testsuite> + </testsuites> + <source> + <include> + <directory suffix=".php">./src</directory> + </include> + </source> </phpunit> diff --git a/vendor/omines/oauth2-gitlab/renovate.json b/vendor/omines/oauth2-gitlab/renovate.json deleted file mode 100644 index 2c63c08510..0000000000 --- a/vendor/omines/oauth2-gitlab/renovate.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/vendor/omines/oauth2-gitlab/src/Provider/Exception/GitlabIdentityProviderException.php b/vendor/omines/oauth2-gitlab/src/Provider/Exception/GitlabIdentityProviderException.php index 0209009bd1..6d7e3f842c 100644 --- a/vendor/omines/oauth2-gitlab/src/Provider/Exception/GitlabIdentityProviderException.php +++ b/vendor/omines/oauth2-gitlab/src/Provider/Exception/GitlabIdentityProviderException.php @@ -18,46 +18,16 @@ * * @author Niels Keurentjes <niels.keurentjes@omines.com> */ -class GitlabIdentityProviderException extends IdentityProviderException +final class GitlabIdentityProviderException extends IdentityProviderException { - /** - * Creates client exception from response. - * - * @param mixed $data Parsed response data - * @return IdentityProviderException - */ - public static function clientException(ResponseInterface $response, $data) - { - return static::fromResponse( - $response, - isset($data['message']) ? $data['message'] : $response->getReasonPhrase() - ); - } - - /** - * Creates oauth exception from response. - * - * @param ResponseInterface $response Response received from upstream - * @param string $data Parsed response data - * @return IdentityProviderException - */ - public static function oauthException(ResponseInterface $response, $data) - { - return static::fromResponse( - $response, - isset($data['error']) ? $data['error'] : $response->getReasonPhrase() - ); - } - /** * Creates identity exception from response. * * @param ResponseInterface $response Response received from upstream - * @param string|null $message Parsed message - * @return IdentityProviderException + * @param ?string $message Parsed message */ - protected static function fromResponse(ResponseInterface $response, $message = null) + public static function fromResponse(ResponseInterface $response, string $message = null): IdentityProviderException { - return new static($message, $response->getStatusCode(), (string) $response->getBody()); + return new self($message ?? $response->getReasonPhrase() ?: self::class, $response->getStatusCode(), $response->getBody()->getContents()); } } diff --git a/vendor/omines/oauth2-gitlab/src/Provider/Gitlab.php b/vendor/omines/oauth2-gitlab/src/Provider/Gitlab.php index 460df202a7..372ecbd5b5 100644 --- a/vendor/omines/oauth2-gitlab/src/Provider/Gitlab.php +++ b/vendor/omines/oauth2-gitlab/src/Provider/Gitlab.php @@ -12,6 +12,7 @@ use League\OAuth2\Client\Provider\AbstractProvider; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; +use League\OAuth2\Client\Provider\ResourceOwnerInterface; use League\OAuth2\Client\Token\AccessToken; use League\OAuth2\Client\Tool\BearerAuthorizationTrait; use Omines\OAuth2\Client\Provider\Exception\GitlabIdentityProviderException; @@ -21,37 +22,27 @@ * Gitlab. * * @author Niels Keurentjes <niels.keurentjes@omines.com> + * + * @phpstan-import-type ResourceOwner from GitlabResourceOwner */ class Gitlab extends AbstractProvider { use BearerAuthorizationTrait; - const PATH_API_USER = '/api/v4/user'; - const PATH_AUTHORIZE = '/oauth/authorize'; - const PATH_TOKEN = '/oauth/token'; - const DEFAULT_SCOPE = 'api'; - const SCOPE_SEPARATOR = ' '; + public const DEFAULT_DOMAIN = 'https://gitlab.com'; + public const DEFAULT_SCOPE = 'api'; + public const SCOPE_SEPARATOR = ' '; - /** @var string */ - public $domain = 'https://gitlab.com'; + private const PATH_API_USER = '/api/v4/user'; + private const PATH_AUTHORIZE = '/oauth/authorize'; + private const PATH_TOKEN = '/oauth/token'; - /** - * Gitlab constructor. - */ - public function __construct(array $options, array $collaborators = []) - { - if (isset($options['domain'])) { - $this->domain = $options['domain']; - } - parent::__construct($options, $collaborators); - } + public string $domain = self::DEFAULT_DOMAIN; /** * Get authorization url to begin OAuth flow. - * - * @return string */ - public function getBaseAuthorizationUrl() + public function getBaseAuthorizationUrl(): string { return $this->domain . self::PATH_AUTHORIZE; } @@ -59,19 +50,17 @@ public function getBaseAuthorizationUrl() /** * Get access token url to retrieve token. * - * @return string + * @param mixed[] $params */ - public function getBaseAccessTokenUrl(array $params) + public function getBaseAccessTokenUrl(array $params): string { return $this->domain . self::PATH_TOKEN; } /** * Get provider url to fetch user details. - * - * @return string */ - public function getResourceOwnerDetailsUrl(AccessToken $token) + public function getResourceOwnerDetailsUrl(AccessToken $token): string { return $this->domain . self::PATH_API_USER; } @@ -82,9 +71,9 @@ public function getResourceOwnerDetailsUrl(AccessToken $token) * * This returns an array with 'api' scope as default. * - * @return array + * @return string[] */ - protected function getDefaultScopes() + protected function getDefaultScopes(): array { return [self::DEFAULT_SCOPE]; } @@ -92,7 +81,7 @@ protected function getDefaultScopes() /** * GitLab uses a space to separate scopes. */ - protected function getScopeSeparator() + protected function getScopeSeparator(): string { return self::SCOPE_SEPARATOR; } @@ -100,24 +89,27 @@ protected function getScopeSeparator() /** * Check a provider response for errors. * - * @param mixed $data Parsed response data + * @param ResponseInterface $response Parsed response data + * @param array{error?: string, message?: string}|mixed $data * @throws IdentityProviderException */ - protected function checkResponse(ResponseInterface $response, $data) + protected function checkResponse(ResponseInterface $response, mixed $data): void { - if ($response->getStatusCode() >= 400) { - throw GitlabIdentityProviderException::clientException($response, $data); + if (!is_array($data)) { + throw GitlabIdentityProviderException::fromResponse($response, 'Corrupted response'); + } elseif ($response->getStatusCode() >= 400) { + throw GitlabIdentityProviderException::fromResponse($response, $data['message'] ?? $response->getReasonPhrase()); } elseif (isset($data['error'])) { - throw GitlabIdentityProviderException::oauthException($response, $data); + throw GitlabIdentityProviderException::fromResponse($response, $data['error']); } } /** * Generate a user object from a successful user details request. * - * @return \League\OAuth2\Client\Provider\ResourceOwnerInterface + * @param ResourceOwner $response */ - protected function createResourceOwner(array $response, AccessToken $token) + protected function createResourceOwner(array $response, AccessToken $token): ResourceOwnerInterface { $user = new GitlabResourceOwner($response, $token); diff --git a/vendor/omines/oauth2-gitlab/src/Provider/GitlabResourceOwner.php b/vendor/omines/oauth2-gitlab/src/Provider/GitlabResourceOwner.php index 8250cf17fd..bdd74173f3 100644 --- a/vendor/omines/oauth2-gitlab/src/Provider/GitlabResourceOwner.php +++ b/vendor/omines/oauth2-gitlab/src/Provider/GitlabResourceOwner.php @@ -11,6 +11,7 @@ namespace Omines\OAuth2\Client\Provider; use Gitlab\Client; +use Gitlab\HttpClient\Builder; use League\OAuth2\Client\Provider\ResourceOwnerInterface; use League\OAuth2\Client\Token\AccessToken; @@ -18,22 +19,23 @@ * GitlabResourceOwner. * * @author Niels Keurentjes <niels.keurentjes@omines.com> + * + * @phpstan-type ResourceOwner array{id: int, is_admin: bool, name: string, username: string, email: string, avatar_url: string, web_url: string, state: string, external: bool} */ class GitlabResourceOwner implements ResourceOwnerInterface { - const PATH_API = '/api/v4/'; - - /** @var array */ - private $data; + public const PATH_API = '/api/v4/'; - /** @var string */ - private $domain; + /** @var ResourceOwner */ + private array $data; - /** @var AccessToken */ - private $token; + private string $domain; + private AccessToken $token; /** * Creates new resource owner. + * + * @param ResourceOwner $response */ public function __construct(array $response, AccessToken $token) { @@ -43,12 +45,10 @@ public function __construct(array $response, AccessToken $token) /** * Returns the identifier of the authorized resource owner. - * - * @return int */ - public function getId() + public function getId(): int { - return (int) $this->get('id'); + return (int) ($this->data['id'] ?? 0); } /** @@ -56,31 +56,26 @@ public function getId() * * Requires optional Gitlab API client to be installed. * - * @return Client + * @infection-ignore-all Cannot be tested for infection due to external dependency */ - public function getApiClient() + public function getApiClient(Builder $builder = null): Client { if (!class_exists('\\Gitlab\\Client')) { throw new \LogicException(__METHOD__ . ' requires package m4tthumphrey/php-gitlab-api to be installed and autoloaded'); // @codeCoverageIgnore } - $client = \Gitlab\Client::create(rtrim($this->domain, '/') . self::PATH_API); + $client = new Client($builder); + $client->setUrl(rtrim($this->domain, '/') . self::PATH_API); + $client->authenticate($this->token->getToken(), Client::AUTH_OAUTH_TOKEN); - return $client->authenticate($this->token->getToken(), Client::AUTH_OAUTH_TOKEN); + return $client; } - /** - * @return string - */ - public function getDomain() + public function getDomain(): string { return $this->domain; } - /** - * @param string $domain - * @return $this - */ - public function setDomain($domain) + public function setDomain(string $domain): self { $this->domain = $domain; @@ -89,109 +84,80 @@ public function setDomain($domain) /** * The full name of the owner. - * - * @return string */ - public function getName() + public function getName(): string { - return $this->get('name'); + return $this->data['name']; } /** * Username of the owner. - * - * @return string */ - public function getUsername() + public function getUsername(): string { - return $this->get('username'); + return $this->data['username']; } /** * Email address of the owner. - * - * @return string */ - public function getEmail() + public function getEmail(): string { - return $this->get('email'); + return $this->data['email']; } /** * URL to the user's avatar. - * - * @return string|null */ - public function getAvatarUrl() + public function getAvatarUrl(): ?string { - return $this->get('avatar_url'); + return $this->data['avatar_url']; } /** * URL to the user's profile page. - * - * @return string */ - public function getProfileUrl() + public function getProfileUrl(): ?string { - return $this->get('web_url'); + return $this->data['web_url']; } - /** - * @return AccessToken - */ - public function getToken() + public function getToken(): AccessToken { return $this->token; } /** * Whether the user is active. - * - * @return bool */ - public function isActive() + public function isActive(): bool { - return 'active' === $this->get('state'); + return 'active' === ($this->data['state'] ?? null); } /** * Whether the user is an admin. - * - * @return bool */ - public function isAdmin() + public function isAdmin(): bool { - return (bool) $this->get('is_admin', false); + return $this->data['is_admin'] ?? false; } /** * Whether the user is external. - * - * @return bool */ - public function isExternal() + public function isExternal(): bool { - return (bool) $this->get('external', true); + return $this->data['external'] ?? true; } /** * Return all of the owner details available as an array. * - * @return array + * @return ResourceOwner */ - public function toArray() + public function toArray(): array { return $this->data; } - - /** - * @param string $key - * @param mixed|null $default - * @return mixed|null - */ - protected function get($key, $default = null) - { - return isset($this->data[$key]) ? $this->data[$key] : $default; - } } diff --git a/vendor/omines/oauth2-gitlab/test/src/Provider/GitlabTest.php b/vendor/omines/oauth2-gitlab/test/src/Provider/GitlabTest.php index 5a9eb9eca5..051184462d 100644 --- a/vendor/omines/oauth2-gitlab/test/src/Provider/GitlabTest.php +++ b/vendor/omines/oauth2-gitlab/test/src/Provider/GitlabTest.php @@ -10,8 +10,10 @@ namespace Omines\OAuth2\Client\Test\Provider; -use GuzzleHttp\ClientInterface; +use GuzzleHttp\Psr7\Response; +use GuzzleHttp\Psr7\Utils; use League\OAuth2\Client\Provider\Exception\IdentityProviderException; +use League\OAuth2\Client\Token\AccessToken; use Mockery as m; use Omines\OAuth2\Client\Provider\Gitlab; use Omines\OAuth2\Client\Provider\GitlabResourceOwner; @@ -19,12 +21,11 @@ class GitlabTest extends TestCase { - /** @var Gitlab */ - protected $provider; + protected Gitlab $provider; protected function setUp(): void { - $this->provider = new \Omines\OAuth2\Client\Provider\Gitlab([ + $this->provider = new Gitlab([ 'clientId' => 'mock_client_id', 'clientSecret' => 'mock_secret', 'redirectUri' => 'none', @@ -37,19 +38,27 @@ public function tearDown(): void parent::tearDown(); } - public function testShorthandedSelfhostedConstructor() + private function createSelfhostedProvider(string $domain): Gitlab { - $provider = new \Omines\OAuth2\Client\Provider\Gitlab([ - 'domain' => 'https://gitlab.example.org', + return new Gitlab([ + 'domain' => $domain, + 'clientId' => 'mock_client_id', + 'clientSecret' => 'mock_secret', + 'redirectUri' => 'none', ]); - $this->assertSame('https://gitlab.example.org', $provider->domain); } - public function testAuthorizationUrl() + public function testShorthandedSelfhostedConstructor(): void + { + $provider = $this->createSelfhostedProvider('https://gitlab.example.org'); + $this->assertSame('https://gitlab.example.org/oauth/authorize', $provider->getBaseAuthorizationUrl()); + } + + public function testAuthorizationUrl(): void { $url = $this->provider->getAuthorizationUrl(); $uri = parse_url($url); - parse_str($uri['query'], $query); + parse_str($uri['query'] ?? '', $query); $this->assertArrayHasKey('client_id', $query); $this->assertArrayHasKey('redirect_uri', $query); @@ -60,37 +69,38 @@ public function testAuthorizationUrl() $this->assertNotNull($this->provider->getState()); } - public function testScopes() + public function testScopes(): void { $options = ['scope' => [uniqid(), uniqid()]]; - $url = $this->provider->getAuthorizationUrl($options); - $this->assertStringContainsString(rawurlencode(implode(Gitlab::SCOPE_SEPARATOR, $options['scope'])), $url); + + // Default scope + $this->assertStringContainsString('&scope=api&', $this->provider->getAuthorizationUrl()); } - public function testGetAuthorizationUrl() + public function testGetAuthorizationUrl(): void { $url = $this->provider->getAuthorizationUrl(); $uri = parse_url($url); - $this->assertEquals('/oauth/authorize', $uri['path']); + $this->assertEquals('/oauth/authorize', $uri['path'] ?? 'error on parsing'); } - public function testGetBaseAccessTokenUrl() + public function testGetBaseAccessTokenUrl(): void { $params = []; $url = $this->provider->getBaseAccessTokenUrl($params); $uri = parse_url($url); - $this->assertEquals('/oauth/token', $uri['path']); + $this->assertEquals('/oauth/token', $uri['path'] ?? 'error on parsing'); } - public function testGetAccessToken() + public function testGetAccessToken(): void { $response = m::mock('Psr\Http\Message\ResponseInterface'); - $response->shouldReceive('getBody')->andReturn('{"access_token":"mock_access_token", "scope":"repo,gist", "token_type":"bearer"}'); + $response->shouldReceive('getBody')->andReturn(Utils::streamFor('{"access_token":"mock_access_token", "scope":"repo,gist", "token_type":"bearer"}')); $response->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $response->shouldReceive('getStatusCode')->andReturn(200); @@ -100,34 +110,36 @@ public function testGetAccessToken() $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); + $this->assertInstanceOf(AccessToken::class, $token); $this->assertEquals('mock_access_token', $token->getToken()); $this->assertNull($token->getExpires()); $this->assertNull($token->getRefreshToken()); $this->assertNull($token->getResourceOwnerId()); } - public function testSelfHostedGitlabDomainUrls() + public function testSelfHostedGitlabDomainUrls(): void { - $this->provider->domain = 'https://gitlab.company.com'; + $provider = $this->createSelfhostedProvider('https://gitlab.company.com'); $response = m::mock('Psr\Http\Message\ResponseInterface'); - $response->shouldReceive('getBody')->times(1)->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}'); + $response->shouldReceive('getBody')->times(1)->andReturn(Utils::streamFor('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}')); $response->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']); $response->shouldReceive('getStatusCode')->andReturn(200); $client = m::mock('GuzzleHttp\ClientInterface'); $client->shouldReceive('send')->times(1)->andReturn($response); - $this->provider->setHttpClient($client); + $provider->setHttpClient($client); - $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); + $token = $provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); - $this->assertEquals($this->provider->domain . '/oauth/authorize', $this->provider->getBaseAuthorizationUrl()); - $this->assertEquals($this->provider->domain . '/oauth/token', $this->provider->getBaseAccessTokenUrl([])); - $this->assertEquals($this->provider->domain . '/api/v4/user', $this->provider->getResourceOwnerDetailsUrl($token)); - //$this->assertEquals($this->provider->domain.'/api/v4/user/emails', $this->provider->urlUserEmails($token)); + $this->assertInstanceOf(AccessToken::class, $token); + $this->assertEquals($provider->domain . '/oauth/authorize', $provider->getBaseAuthorizationUrl()); + $this->assertEquals($provider->domain . '/oauth/token', $provider->getBaseAccessTokenUrl([])); + $this->assertEquals($provider->domain . '/api/v4/user', $provider->getResourceOwnerDetailsUrl($token)); + // $this->assertEquals($provider->domain.'/api/v4/user/emails', $provider->urlUserEmails($token)); } - public function testUserData() + public function testUserData(): GitlabResourceOwner { $userdata = [ 'id' => rand(1000, 9999), @@ -138,20 +150,19 @@ public function testUserData() 'web_url' => 'https://example.org/' . uniqid('web'), 'state' => 'active', 'is_admin' => true, - 'external' => true, + 'external' => false, ]; $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $postResponse->shouldReceive('getBody')->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}'); + $postResponse->shouldReceive('getBody')->andReturn(Utils::streamFor('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}')); $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']); $postResponse->shouldReceive('getStatusCode')->andReturn(200); $userResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $userResponse->shouldReceive('getBody')->andReturn(json_encode($userdata)); + $userResponse->shouldReceive('getBody')->andReturn(Utils::streamFor(json_encode($userdata))); $userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); $userResponse->shouldReceive('getStatusCode')->andReturn(200); - /** @var ClientInterface $client */ $client = m::mock('GuzzleHttp\ClientInterface'); $client->shouldReceive('send') ->times(2) @@ -159,99 +170,121 @@ public function testUserData() $this->provider->setHttpClient($client); $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); + $this->assertInstanceOf(AccessToken::class, $token); $user = $this->provider->getResourceOwner($token); - - /* @var GitlabResourceOwner $user */ - $this->assertSame($userdata, $user->toArray()); - $this->assertEquals($userdata['id'], $user->getId()); - $this->assertEquals($userdata['name'], $user->getName()); - $this->assertEquals($userdata['username'], $user->getUsername()); - $this->assertEquals($userdata['email'], $user->getEmail()); - $this->assertEquals($userdata['avatar_url'], $user->getAvatarUrl()); - $this->assertEquals($userdata['web_url'], $user->getProfileUrl()); - $this->assertEquals('https://gitlab.com', $user->getDomain()); - $this->assertEquals('mock_access_token', $user->getToken()->getToken()); + $this->assertInstanceOf(GitlabResourceOwner::class, $user); + + $this->assertEquals($userdata, $user->toArray()); + $this->assertSame($userdata['id'], $user->getId()); + $this->assertSame($userdata['name'], $user->getName()); + $this->assertSame($userdata['username'], $user->getUsername()); + $this->assertSame($userdata['email'], $user->getEmail()); + $this->assertSame($userdata['avatar_url'], $user->getAvatarUrl()); + $this->assertSame($userdata['web_url'], $user->getProfileUrl()); + $this->assertSame('https://gitlab.com', $user->getDomain()); + $this->assertSame('mock_access_token', $user->getToken()->getToken()); $this->assertTrue($user->isActive()); $this->assertTrue($user->isAdmin()); - $this->assertTrue($user->isExternal()); + $this->assertFalse($user->isExternal()); return $user; } + public function testBuggyResourceOwner(): void + { + /** @phpstan-ignore-next-line Violating type requirements on purpose */ + $owner = new GitlabResourceOwner([ + 'id' => 'foo', // Should be an integer + 'is_admin' => 'bar', // Should be a bool + ], new AccessToken([ + 'access_token' => 'foobar', + ])); + + $this->assertSame(0, $owner->getId()); + $this->assertTrue($owner->isAdmin()); + } + + public function testDefaultValuesForResourceOwner(): void + { + /** @phpstan-ignore-next-line Violating type requirements on purpose */ + $owner = new GitlabResourceOwner([ + ], new AccessToken([ + 'access_token' => 'foobar', + ])); + + $this->assertSame(0, $owner->getId()); + $this->assertFalse($owner->isAdmin()); + $this->assertFalse($owner->isActive()); + $this->assertTrue($owner->isExternal()); + } + /** * @depends testUserData */ - public function testApiClient(GitlabResourceOwner $owner) + public function testApiClient(GitlabResourceOwner $owner): void { $client = $owner->getApiClient(); $this->assertInstanceOf(\Gitlab\Client::class, $client); } - /* public function testUserEmails() + /** + * @return int[][] + */ + public static function provideErrorCodes(): array { + return [ + [400], + [404], + [500], + [rand(401, 600)], + ]; + } - $userId = rand(1000,9999); - $name = uniqid(); - $nickname = uniqid(); - $email = uniqid(); - - $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $postResponse->shouldReceive('getBody')->andReturn('access_token=mock_access_token&expires=3600&refresh_token=mock_refresh_token&otherKey={1234}'); - $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'application/x-www-form-urlencoded']); - - $userResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $userResponse->shouldReceive('getBody')->andReturn('[{"email":"mock_email_1","primary":false,"verified":true},{"email":"mock_email_2","primary":false,"verified":true},{"email":"mock_email_3","primary":true,"verified":true}]'); - $userResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); + /** + * @dataProvider provideErrorCodes + */ + public function testExceptionThrownWhenErrorObjectReceived(int $status): void + { + $response = new Response($status, ['content-type' => 'json'], '{"message": "Validation Failed","errors": [{"resource": "Issue","field": "title","code": "missing_field"}]}'); $client = m::mock('GuzzleHttp\ClientInterface'); $client->shouldReceive('send') - ->times(2) - ->andReturn($postResponse, $userResponse); + ->times(1) + ->andReturn($response); $this->provider->setHttpClient($client); + $this->expectException(IdentityProviderException::class); + $this->expectExceptionMessage('Validation Failed'); $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); - $emails = $this->provider->getUserEmails($token); - - $this->assertEquals($userId, $user->getUserId()); - $this->assertEquals($name, $user->getName()); - $this->assertEquals($nickname, $user->getNickname()); - $this->assertEquals($email, $user->getEmail()); - $this->assertContains($nickname, $user->getUrl()); - } */ + } - public function testExceptionThrownWhenErrorObjectReceived() + public function testExceptionThrownWhenOAuthErrorReceived(): void { - $status = rand(400, 600); - $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $postResponse->shouldReceive('getBody')->andReturn('{"message": "Validation Failed","errors": [{"resource": "Issue","field": "title","code": "missing_field"}]}'); - $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); - $postResponse->shouldReceive('getStatusCode')->andReturn($status); + $response = new Response(200, ['content-type' => 'json'], '{"error": "bad_verification_code","error_description": "The code passed is incorrect or expired.","error_uri": "https://developer.github.com/v4/oauth/#bad-verification-code"}'); $client = m::mock('GuzzleHttp\ClientInterface'); $client->shouldReceive('send') ->times(1) - ->andReturn($postResponse); + ->andReturn($response); $this->provider->setHttpClient($client); $this->expectException(IdentityProviderException::class); + $this->expectExceptionMessage('bad_verification_code'); $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); } - public function testExceptionThrownWhenOAuthErrorReceived() + public function testExceptionThrownWhenUnknownErrorReceived(): void { - $status = 200; - $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); - $postResponse->shouldReceive('getBody')->andReturn('{"error": "bad_verification_code","error_description": "The code passed is incorrect or expired.","error_uri": "https://developer.github.com/v4/oauth/#bad-verification-code"}'); - $postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']); - $postResponse->shouldReceive('getStatusCode')->andReturn($status); + $response = new Response(200, ['content-type' => 'json'], '684'); $client = m::mock('GuzzleHttp\ClientInterface'); $client->shouldReceive('send') ->times(1) - ->andReturn($postResponse); + ->andReturn($response); $this->provider->setHttpClient($client); $this->expectException(IdentityProviderException::class); + $this->expectExceptionMessage('Corrupted response'); $token = $this->provider->getAccessToken('authorization_code', ['code' => 'mock_authorization_code']); } } diff --git a/vendor/paragonie/random_compat/build-phar.sh b/vendor/paragonie/random_compat/build-phar.sh deleted file mode 100755 index b4a5ba31cc..0000000000 --- a/vendor/paragonie/random_compat/build-phar.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -basedir=$( dirname $( readlink -f ${BASH_SOURCE[0]} ) ) - -php -dphar.readonly=0 "$basedir/other/build_phar.php" $* \ No newline at end of file diff --git a/vendor/paragonie/random_compat/composer.json b/vendor/paragonie/random_compat/composer.json deleted file mode 100644 index 1fa8de9f1b..0000000000 --- a/vendor/paragonie/random_compat/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "paragonie/random_compat", - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "random", - "polyfill", - "pseudorandom" - ], - "license": "MIT", - "type": "library", - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "support": { - "issues": "https://github.com/paragonie/random_compat/issues", - "email": "info@paragonie.com", - "source": "https://github.com/paragonie/random_compat" - }, - "require": { - "php": "^7" - }, - "require-dev": { - "vimeo/psalm": "^1", - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - } -} diff --git a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey deleted file mode 100644 index eb50ebfcd6..0000000000 --- a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PUBLIC KEY----- -MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEd+wCqJDrx5B4OldM0dQE0ZMX+lx1ZWm -pui0SUqD4G29L3NGsz9UhJ/0HjBdbnkhIK5xviT0X5vtjacF6ajgcCArbTB+ds+p -+h7Q084NuSuIpNb6YPfoUFgC/CL9kAoc ------END PUBLIC KEY----- diff --git a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc b/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc deleted file mode 100644 index 6a1d7f3006..0000000000 --- a/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.22 (MingW32) - -iQEcBAABAgAGBQJWtW1hAAoJEGuXocKCZATaJf0H+wbZGgskK1dcRTsuVJl9IWip -QwGw/qIKI280SD6/ckoUMxKDCJiFuPR14zmqnS36k7N5UNPnpdTJTS8T11jttSpg -1LCmgpbEIpgaTah+cELDqFCav99fS+bEiAL5lWDAHBTE/XPjGVCqeehyPYref4IW -NDBIEsvnHPHPLsn6X5jq4+Yj5oUixgxaMPiR+bcO4Sh+RzOVB6i2D0upWfRXBFXA -NNnsg9/zjvoC7ZW73y9uSH+dPJTt/Vgfeiv52/v41XliyzbUyLalf02GNPY+9goV -JHG1ulEEBJOCiUD9cE1PUIJwHA/HqyhHIvV350YoEFiHl8iSwm7SiZu5kPjaq74= -=B6+8 ------END PGP SIGNATURE----- diff --git a/vendor/paragonie/random_compat/lib/random.php b/vendor/paragonie/random_compat/lib/random.php deleted file mode 100644 index c7731a56ff..0000000000 --- a/vendor/paragonie/random_compat/lib/random.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Random_* Compatibility Library - * for using the new PHP 7 random_* API in PHP 5 projects - * - * @version 2.99.99 - * @released 2018-06-06 - * - * The MIT License (MIT) - * - * Copyright (c) 2015 - 2018 Paragon Initiative Enterprises - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -// NOP diff --git a/vendor/paragonie/random_compat/other/build_phar.php b/vendor/paragonie/random_compat/other/build_phar.php deleted file mode 100644 index 70ef4b2ed8..0000000000 --- a/vendor/paragonie/random_compat/other/build_phar.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -$dist = dirname(__DIR__).'/dist'; -if (!is_dir($dist)) { - mkdir($dist, 0755); -} -if (file_exists($dist.'/random_compat.phar')) { - unlink($dist.'/random_compat.phar'); -} -$phar = new Phar( - $dist.'/random_compat.phar', - FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME, - 'random_compat.phar' -); -rename( - dirname(__DIR__).'/lib/random.php', - dirname(__DIR__).'/lib/index.php' -); -$phar->buildFromDirectory(dirname(__DIR__).'/lib'); -rename( - dirname(__DIR__).'/lib/index.php', - dirname(__DIR__).'/lib/random.php' -); - -/** - * If we pass an (optional) path to a private key as a second argument, we will - * sign the Phar with OpenSSL. - * - * If you leave this out, it will produce an unsigned .phar! - */ -if ($argc > 1) { - if (!@is_readable($argv[1])) { - echo 'Could not read the private key file:', $argv[1], "\n"; - exit(255); - } - $pkeyFile = file_get_contents($argv[1]); - - $private = openssl_get_privatekey($pkeyFile); - if ($private !== false) { - $pkey = ''; - openssl_pkey_export($private, $pkey); - $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey); - - /** - * Save the corresponding public key to the file - */ - if (!@is_readable($dist.'/random_compat.phar.pubkey')) { - $details = openssl_pkey_get_details($private); - file_put_contents( - $dist.'/random_compat.phar.pubkey', - $details['key'] - ); - } - } else { - echo 'An error occurred reading the private key from OpenSSL.', "\n"; - exit(255); - } -} diff --git a/vendor/paragonie/random_compat/psalm-autoload.php b/vendor/paragonie/random_compat/psalm-autoload.php deleted file mode 100644 index d71d1b818c..0000000000 --- a/vendor/paragonie/random_compat/psalm-autoload.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -require_once 'lib/byte_safe_strings.php'; -require_once 'lib/cast_to_int.php'; -require_once 'lib/error_polyfill.php'; -require_once 'other/ide_stubs/libsodium.php'; -require_once 'lib/random.php'; - -$int = random_int(0, 65536); diff --git a/vendor/paragonie/random_compat/psalm.xml b/vendor/paragonie/random_compat/psalm.xml deleted file mode 100644 index 596d99dd6b..0000000000 --- a/vendor/paragonie/random_compat/psalm.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<psalm - autoloader="psalm-autoload.php" - stopOnFirstError="false" - useDocblockTypes="true" -> - <projectFiles> - <directory name="lib" /> - </projectFiles> - <issueHandlers> - <RedundantConditionGivenDocblockType errorLevel="info" /> - <UnresolvableInclude errorLevel="info" /> - <DuplicateClass errorLevel="info" /> - <InvalidOperand errorLevel="info" /> - <UndefinedConstant errorLevel="info" /> - <MissingReturnType errorLevel="info" /> - <InvalidReturnType errorLevel="info" /> - </issueHandlers> -</psalm> diff --git a/vendor/php-http/guzzle6-adapter/CHANGELOG.md b/vendor/php-http/guzzle6-adapter/CHANGELOG.md index 0fdb5069f3..40a202bf2a 100644 --- a/vendor/php-http/guzzle6-adapter/CHANGELOG.md +++ b/vendor/php-http/guzzle6-adapter/CHANGELOG.md @@ -1,13 +1,52 @@ # Change Log -## 1.1.1 - 2016-05-10 +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [2.0.2] - 2021-03-02 + +### Added + +- Add Support for PHP 8 + +## [2.0.1] - 2018-12-16 + +### Fixed +- `\Http\Adapter\Guzzle6\Client::sendRequest` no longer throws any exceptions that do not implement + the PSR exception interface. + + Instead of `\UnexpectedValueException` we now throw `Http\Adapter\Guzzle6\Exception\UnexpectedValueException` + (which extends `\UnexpectedValueException` and implements `Psr\Http\Client\ClientExceptionInterface`). + + Instead of `\RuntimeException` we now throw `Http\Client\Exception\TransferException` + (which extends `\RuntimeException` and implements `Psr\Http\Client\ClientExceptionInterface`). + +## [2.0.0] - 2018-11-14 + +### Added + +- Support for HTTPlug 2.0 and PSR-18 + +### Changed + +- `Client` and `Promise` are both final + +### Removed + +- Support for PHP <7.1 + + +## [1.1.1] - 2016-05-10 ### Fixed - Adapter can again be instantiated without a guzzle client. -## 1.1.0 - 2016-05-09 + +## [1.1.0] - 2016-05-09 ### Added @@ -15,10 +54,10 @@ configuration for the underlying guzzle client. -## 1.0.0 - 2016-01-26 +## [1.0.0] - 2016-01-26 -## 0.4.1 - 2016-01-13 +## [0.4.1] - 2016-01-13 ### Changed @@ -29,7 +68,7 @@ - Client common dependency -## 0.4.0 - 2016-01-12 +## [0.4.0] - 2016-01-12 ### Changed @@ -37,7 +76,13 @@ - Updated HTTPlug to RC1 -## 0.2.1 - 2015-12-17 +## [0.3.1] - 2015-12-31 + + +## [0.3.0] - 2015-12-31 + + +## [0.2.1] - 2015-12-17 ### Added @@ -48,7 +93,7 @@ - Guzzle setup conforms to HTTPlug requirement now: Minimal functionality in client -## 0.2.0 - 2015-12-15 +## [0.2.0] - 2015-12-15 ### Added @@ -64,3 +109,4 @@ ### Added - Initial release + diff --git a/vendor/php-http/guzzle6-adapter/README.md b/vendor/php-http/guzzle6-adapter/README.md index 623eb2f8d3..9ef1a7d136 100644 --- a/vendor/php-http/guzzle6-adapter/README.md +++ b/vendor/php-http/guzzle6-adapter/README.md @@ -9,6 +9,9 @@ **Guzzle 6 HTTP Adapter.** +**Note for PHP 8**: This adapter can now be installed with PHP 8, even though Guzzle 6 is not tested on PHP 8. +If you need a PSR-18 client, use Guzzle 7 which natively implements PSR-18. +If you need the HTTPlug interfaces for asynchronous calls or for a system that still requires HTTPlug, use the [guzzle7-adapter](https://github.com/php-http/guzzle7-adapter/) instead of this repository. ## Install diff --git a/vendor/php-http/guzzle6-adapter/composer.json b/vendor/php-http/guzzle6-adapter/composer.json index 2f01d1a465..71a3710c68 100644 --- a/vendor/php-http/guzzle6-adapter/composer.json +++ b/vendor/php-http/guzzle6-adapter/composer.json @@ -15,17 +15,20 @@ } ], "require": { - "php": ">=5.5.0", - "php-http/httplug": "^1.0", + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0", "guzzlehttp/guzzle": "^6.0" }, "require-dev": { "ext-curl": "*", - "php-http/adapter-integration-tests": "^0.4" + "phpunit/phpunit": "^7.4 || ^8.4", + "php-http/client-integration-tests": "^2.0 || ^3.0" }, "provide": { "php-http/client-implementation": "1.0", - "php-http/async-client-implementation": "1.0" + "php-http/async-client-implementation": "1.0", + "psr/http-client-implementation": "1.0" }, "autoload": { "psr-4": { @@ -43,7 +46,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "2.x-dev" } } } diff --git a/vendor/php-http/guzzle6-adapter/src/Client.php b/vendor/php-http/guzzle6-adapter/src/Client.php index ded7494bdd..37cb21d936 100644 --- a/vendor/php-http/guzzle6-adapter/src/Client.php +++ b/vendor/php-http/guzzle6-adapter/src/Client.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Http\Adapter\Guzzle6; use GuzzleHttp\Client as GuzzleClient; @@ -9,13 +11,14 @@ use Http\Client\HttpAsyncClient; use Http\Client\HttpClient; use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; /** * HTTP Adapter for Guzzle 6. * * @author David de Boer <david@ddeboer.nl> */ -class Client implements HttpClient, HttpAsyncClient +final class Client implements HttpClient, HttpAsyncClient { /** * @var ClientInterface @@ -23,33 +26,31 @@ class Client implements HttpClient, HttpAsyncClient private $client; /** - * @param ClientInterface|null $client + * If you pass a Guzzle instance as $client, make sure to configure Guzzle to not + * throw exceptions on HTTP error status codes, or this adapter will violate PSR-18. + * See also self::buildClient at the bottom of this class. */ - public function __construct(ClientInterface $client = null) + public function __construct(?ClientInterface $client = null) { if (!$client) { - $client = static::buildClient(); + $client = self::buildClient(); } $this->client = $client; } /** - * Factory method to create the guzzle 6 adapter with custom configuration for guzzle. - * - * @param array $config Configuration to create guzzle with. - * - * @return Client + * Factory method to create the Guzzle 6 adapter with custom Guzzle configuration. */ - public static function createWithConfig(array $config) + public static function createWithConfig(array $config): Client { - return new self(static::buildClient($config)); + return new self(self::buildClient($config)); } /** * {@inheritdoc} */ - public function sendRequest(RequestInterface $request) + public function sendRequest(RequestInterface $request): ResponseInterface { $promise = $this->sendAsyncRequest($request); @@ -67,13 +68,9 @@ public function sendAsyncRequest(RequestInterface $request) } /** - * Build the guzzle client instance. - * - * @param array $config Additional configuration - * - * @return GuzzleClient + * Build the Guzzle client instance. */ - private static function buildClient(array $config = []) + private static function buildClient(array $config = []): GuzzleClient { $handlerStack = new HandlerStack(\GuzzleHttp\choose_handler()); $handlerStack->push(Middleware::prepareBody(), 'prepare_body'); diff --git a/vendor/php-http/guzzle6-adapter/src/Exception/UnexpectedValueException.php b/vendor/php-http/guzzle6-adapter/src/Exception/UnexpectedValueException.php new file mode 100644 index 0000000000..e7244fefc4 --- /dev/null +++ b/vendor/php-http/guzzle6-adapter/src/Exception/UnexpectedValueException.php @@ -0,0 +1,9 @@ +<?php + +namespace Http\Adapter\Guzzle6\Exception; + +use Http\Client\Exception; + +final class UnexpectedValueException extends \UnexpectedValueException implements Exception +{ +} diff --git a/vendor/php-http/guzzle6-adapter/src/Promise.php b/vendor/php-http/guzzle6-adapter/src/Promise.php index 4d5eb8df20..56f14031f0 100644 --- a/vendor/php-http/guzzle6-adapter/src/Promise.php +++ b/vendor/php-http/guzzle6-adapter/src/Promise.php @@ -1,9 +1,12 @@ <?php +declare(strict_types=1); + namespace Http\Adapter\Guzzle6; use GuzzleHttp\Exception as GuzzleExceptions; use GuzzleHttp\Promise\PromiseInterface; +use Http\Adapter\Guzzle6\Exception\UnexpectedValueException; use Http\Client\Exception as HttplugException; use Http\Promise\Promise as HttpPromise; use Psr\Http\Message\RequestInterface; @@ -14,7 +17,7 @@ * * @author Joel Wurtz <joel.wurtz@gmail.com> */ -class Promise implements HttpPromise +final class Promise implements HttpPromise { /** * @var PromiseInterface @@ -41,10 +44,6 @@ class Promise implements HttpPromise */ private $request; - /** - * @param PromiseInterface $promise - * @param RequestInterface $request - */ public function __construct(PromiseInterface $promise, RequestInterface $request) { $this->request = $request; @@ -61,10 +60,10 @@ public function __construct(PromiseInterface $promise, RequestInterface $request $this->exception = $reason; } elseif ($reason instanceof GuzzleExceptions\GuzzleException) { $this->exception = $this->handleException($reason, $request); - } elseif ($reason instanceof \Exception) { - $this->exception = new \RuntimeException('Invalid exception returned from Guzzle6', 0, $reason); + } elseif ($reason instanceof \Throwable) { + $this->exception = new HttplugException\TransferException('Invalid exception returned from Guzzle6', 0, $reason); } else { - $this->exception = new \UnexpectedValueException('Reason returned from Guzzle6 must be an Exception', 0, $reason); + $this->exception = new UnexpectedValueException('Reason returned from Guzzle6 must be an Exception'); } throw $this->exception; @@ -95,7 +94,7 @@ public function wait($unwrap = true) $this->promise->wait(false); if ($unwrap) { - if ($this->getState() == self::REJECTED) { + if (self::REJECTED == $this->getState()) { throw $this->exception; } @@ -105,13 +104,8 @@ public function wait($unwrap = true) /** * Converts a Guzzle exception into an Httplug exception. - * - * @param GuzzleExceptions\GuzzleException $exception - * @param RequestInterface $request - * - * @return HttplugException */ - private function handleException(GuzzleExceptions\GuzzleException $exception, RequestInterface $request) + private function handleException(GuzzleExceptions\GuzzleException $exception, RequestInterface $request): HttplugException { if ($exception instanceof GuzzleExceptions\SeekException) { return new HttplugException\RequestException($exception->getMessage(), $request, $exception); diff --git a/vendor/php-http/httplug/.php-cs-fixer.dist.php b/vendor/php-http/httplug/.php-cs-fixer.dist.php new file mode 100644 index 0000000000..83809c25d4 --- /dev/null +++ b/vendor/php-http/httplug/.php-cs-fixer.dist.php @@ -0,0 +1,16 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->name('*.php') +; + +$config = (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; + +return $config; diff --git a/vendor/php-http/httplug/CHANGELOG.md b/vendor/php-http/httplug/CHANGELOG.md index 8478966ac4..4c3d863ac2 100644 --- a/vendor/php-http/httplug/CHANGELOG.md +++ b/vendor/php-http/httplug/CHANGELOG.md @@ -1,17 +1,78 @@ # Change Log -## 1.1.0 - 2016-08-31 -- Added HttpFulfilledPromise and HttpRejectedPromise which respect the HttpAsyncClient interface +All notable changes to this project will be documented in this file. -## 1.0.0 - 2016-01-26 +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +## [2.4.1] - 2024-09-23 + +- Updated code to not raise warnings for nullable parameters in PHP 8.4. + +## [2.4.0] - 2023-04-14 + +### Changed + +- Allow `psr/http-message` v2 in addition to v1 +- Deprecate `Http\Client\HttpClient`, use [PSR-18](https://www.php-fig.org/psr/psr-18/) instead + +## [2.3.0] - 2022-02-21 + +### Changed + +- Enabled the `$onRejected` callback of `HttpRejectedPromise` to return a promise for implementing a retry + mechanism [#168](https://github.com/php-http/httplug/pull/168) + +## [2.2.0] - 2020-07-13 + +### Changed + +- Support PHP 7.1-8.0 + +## [2.1.0] - 2019-12-27 + +### Changed + +- `Http\Client\Exception\NetworkException` no longer extends `Http\Client\Exception\RequestException`, + in accordance with [PSR-18](https://www.php-fig.org/psr/psr-18/) + +## [2.0.0] - 2018-10-31 + +This version is no BC break for consumers using HTTPlug. However, HTTP clients that +implement HTTPlug need to adjust because we add return type declarations. + +### Added + +- Support for PSR-18 (HTTP client). + +### Changed + +- **BC Break:** `HttpClient::sendRequest(RequestInterface $request)` has a return type annotation. The new +signature is `HttpClient::sendRequest(RequestInterface $request): ResponseInterface`. +- **BC Break:** `RequestException::getRequest()` has a return type annotation. The new +signature is `RequestException::getRequest(): RequestInterface`. + +### Removed + +- PHP 5 support + + +## [1.1.0] - 2016-08-31 + +### Added + +- HttpFulfilledPromise and HttpRejectedPromise which respect the HttpAsyncClient interface + + +## [1.0.0] - 2016-01-26 ### Removed - Stability configuration from composer -## 1.0.0-RC1 - 2016-01-12 +## [1.0.0-RC1] - 2016-01-12 ### Changed @@ -19,7 +80,7 @@ - Updated promise dependency to RC1 -## 1.0.0-beta - 2015-12-17 +## [1.0.0-beta] - 2015-12-17 ### Added @@ -30,7 +91,7 @@ - Exception concept -## 1.0.0-alpha3 - 2015-12-13 +## [1.0.0-alpha3] - 2015-12-13 ### Changed @@ -41,14 +102,14 @@ - Promise interface moved to its own repository: [php-http/promise](https://github.com/php-http/promise) -## 1.0.0-alpha2 - 2015-11-16 +## [1.0.0-alpha2] - 2015-11-16 ### Added - Async client and Promise interface -## 1.0.0-alpha - 2015-10-26 +## [1.0.0-alpha] - 2015-10-26 ### Added @@ -70,3 +131,14 @@ ### Added - Initial release + + +[Unreleased]: https://github.com/php-http/httplug/compare/v2.0.0...HEAD +[2.0.0]: https://github.com/php-http/httplug/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/php-http/httplug/compare/v1.0.0...v1.1.0 +[1.0.0]: https://github.com/php-http/httplug/compare/v1.0.0-RC1...v1.0.0 +[1.0.0-RC1]: https://github.com/php-http/httplug/compare/v1.0.0-beta...v1.0.0-RC1 +[1.0.0-beta]: https://github.com/php-http/httplug/compare/v1.0.0-alpha3...v1.0.0-beta +[1.0.0-alpha3]: https://github.com/php-http/httplug/compare/v1.0.0-alpha2...v1.0.0-alpha3 +[1.0.0-alpha2]: https://github.com/php-http/httplug/compare/v1.0.0-alpha...v1.0.0-alpha2 +[1.0.0-alpha]: https://github.com/php-http/httplug/compare/v0.1.0...v1.0.0-alpha diff --git a/vendor/php-http/httplug/LICENSE b/vendor/php-http/httplug/LICENSE index 48741e4165..8cd264c6b5 100644 --- a/vendor/php-http/httplug/LICENSE +++ b/vendor/php-http/httplug/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2014-2015 Eric GELOEN <geloen.eric@gmail.com> -Copyright (c) 2015-2016 PHP HTTP Team <team@php-http.org> +Copyright (c) 2014 Eric GELOEN <geloen.eric@gmail.com> +Copyright (c) 2015 PHP HTTP Team <team@php-http.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/php-http/httplug/README.md b/vendor/php-http/httplug/README.md index f46212bcc2..a9b476a5e3 100644 --- a/vendor/php-http/httplug/README.md +++ b/vendor/php-http/httplug/README.md @@ -2,17 +2,32 @@ [![Latest Version](https://img.shields.io/github/release/php-http/httplug.svg?style=flat-square)](https://github.com/php-http/httplug/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/httplug.svg?style=flat-square)](https://travis-ci.org/php-http/httplug) +[![Build Status](https://github.com/php-http/httplug/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/httplug/actions/workflows/ci.yml) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) [![Quality Score](https://img.shields.io/scrutinizer/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) [![Total Downloads](https://img.shields.io/packagist/dt/php-http/httplug.svg?style=flat-square)](https://packagist.org/packages/php-http/httplug) -[![Slack Status](http://slack.httplug.io/badge.svg)](http://slack.httplug.io) [![Email](https://img.shields.io/badge/email-team@httplug.io-blue.svg?style=flat-square)](mailto:team@httplug.io) **HTTPlug, the HTTP client abstraction for PHP.** +## Intro + +HTTP client standard built on [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP +messages. The HttpAsyncClient defines an asynchronous HTTP client for PHP. + +This package also provides a synchronous HttpClient interface with the same +method signature as the [PSR-18](http://www.php-fig.org/psr/psr-18/) client. +For synchronous requests, we recommend using PSR-18 directly. + + +## History + +HTTPlug is the official successor of the [ivory http adapter](https://github.com/egeloen/ivory-http-adapter). +HTTPlug is a predecessor of [PSR-18](http://www.php-fig.org/psr/psr-18/) + + ## Install Via Composer @@ -22,14 +37,6 @@ $ composer require php-http/httplug ``` -## Intro - -This is the contract package for HTTP Client. -Use it to create HTTP Clients which are interoperable and compatible with [PSR-7](http://www.php-fig.org/psr/psr-7/). - -This library is the official successor of the [ivory http adapter](https://github.com/egeloen/ivory-http-adapter). - - ## Documentation Please see the [official documentation](http://docs.php-http.org). @@ -42,16 +49,6 @@ $ composer test ``` -## Contributing - -Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - ## License The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/httplug/composer.json b/vendor/php-http/httplug/composer.json index f74c4d30a2..7391770178 100644 --- a/vendor/php-http/httplug/composer.json +++ b/vendor/php-http/httplug/composer.json @@ -1,9 +1,12 @@ { "name": "php-http/httplug", "description": "HTTPlug, the HTTP client abstraction for PHP", - "license": "MIT", - "keywords": ["http", "client"], + "keywords": [ + "http", + "client" + ], "homepage": "http://httplug.io", + "license": "MIT", "authors": [ { "name": "Eric GELOEN", @@ -11,17 +14,19 @@ }, { "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "require": { - "php": ">=5.4", - "psr/http-message": "^1.0", - "php-http/promise": "^1.0" + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { - "phpspec/phpspec": "^2.4", - "henrikbjorn/phpspec-code-coverage" : "^1.0" + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, "autoload": { "psr-4": { @@ -31,10 +36,5 @@ "scripts": { "test": "vendor/bin/phpspec run", "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } } } diff --git a/vendor/php-http/httplug/src/Exception.php b/vendor/php-http/httplug/src/Exception.php index e7382c3cda..4df164c9ac 100644 --- a/vendor/php-http/httplug/src/Exception.php +++ b/vendor/php-http/httplug/src/Exception.php @@ -2,11 +2,13 @@ namespace Http\Client; +use Psr\Http\Client\ClientExceptionInterface as PsrClientException; + /** * Every HTTP Client related Exception must implement this interface. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> */ -interface Exception +interface Exception extends PsrClientException { } diff --git a/vendor/php-http/httplug/src/Exception/HttpException.php b/vendor/php-http/httplug/src/Exception/HttpException.php index f4f32a4d23..8af32f12c0 100644 --- a/vendor/php-http/httplug/src/Exception/HttpException.php +++ b/vendor/php-http/httplug/src/Exception/HttpException.php @@ -20,16 +20,13 @@ class HttpException extends RequestException protected $response; /** - * @param string $message - * @param RequestInterface $request - * @param ResponseInterface $response - * @param \Exception|null $previous + * @param string $message */ public function __construct( $message, RequestInterface $request, ResponseInterface $response, - \Exception $previous = null + ?\Exception $previous = null ) { parent::__construct($message, $request, $previous); @@ -49,17 +46,11 @@ public function getResponse() /** * Factory method to create a new exception with a normalized error message. - * - * @param RequestInterface $request - * @param ResponseInterface $response - * @param \Exception|null $previous - * - * @return HttpException */ public static function create( RequestInterface $request, ResponseInterface $response, - \Exception $previous = null + ?\Exception $previous = null ) { $message = sprintf( '[url] %s [http method] %s [status code] %s [reason phrase] %s', @@ -69,6 +60,6 @@ public static function create( $response->getReasonPhrase() ); - return new self($message, $request, $response, $previous); + return new static($message, $request, $response, $previous); } } diff --git a/vendor/php-http/httplug/src/Exception/NetworkException.php b/vendor/php-http/httplug/src/Exception/NetworkException.php index f2198e5b62..ce5f4d7adc 100644 --- a/vendor/php-http/httplug/src/Exception/NetworkException.php +++ b/vendor/php-http/httplug/src/Exception/NetworkException.php @@ -2,6 +2,9 @@ namespace Http\Client\Exception; +use Psr\Http\Client\NetworkExceptionInterface as PsrNetworkException; +use Psr\Http\Message\RequestInterface; + /** * Thrown when the request cannot be completed because of network issues. * @@ -9,6 +12,17 @@ * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> */ -class NetworkException extends RequestException +class NetworkException extends TransferException implements PsrNetworkException { + use RequestAwareTrait; + + /** + * @param string $message + */ + public function __construct($message, RequestInterface $request, ?\Exception $previous = null) + { + $this->setRequest($request); + + parent::__construct($message, 0, $previous); + } } diff --git a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php new file mode 100644 index 0000000000..f507982afa --- /dev/null +++ b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php @@ -0,0 +1,23 @@ +<?php + +namespace Http\Client\Exception; + +use Psr\Http\Message\RequestInterface; + +trait RequestAwareTrait +{ + /** + * @var RequestInterface + */ + private $request; + + private function setRequest(RequestInterface $request) + { + $this->request = $request; + } + + public function getRequest(): RequestInterface + { + return $this->request; + } +} diff --git a/vendor/php-http/httplug/src/Exception/RequestException.php b/vendor/php-http/httplug/src/Exception/RequestException.php index cdce14bd14..dbed296a7e 100644 --- a/vendor/php-http/httplug/src/Exception/RequestException.php +++ b/vendor/php-http/httplug/src/Exception/RequestException.php @@ -2,6 +2,7 @@ namespace Http\Client\Exception; +use Psr\Http\Client\RequestExceptionInterface as PsrRequestException; use Psr\Http\Message\RequestInterface; /** @@ -12,32 +13,17 @@ * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> */ -class RequestException extends TransferException +class RequestException extends TransferException implements PsrRequestException { - /** - * @var RequestInterface - */ - private $request; + use RequestAwareTrait; /** - * @param string $message - * @param RequestInterface $request - * @param \Exception|null $previous + * @param string $message */ - public function __construct($message, RequestInterface $request, \Exception $previous = null) + public function __construct($message, RequestInterface $request, ?\Exception $previous = null) { - $this->request = $request; + $this->setRequest($request); parent::__construct($message, 0, $previous); } - - /** - * Returns the request. - * - * @return RequestInterface - */ - public function getRequest() - { - return $this->request; - } } diff --git a/vendor/php-http/httplug/src/HttpAsyncClient.php b/vendor/php-http/httplug/src/HttpAsyncClient.php index 492e511b69..c3b9d61aa4 100644 --- a/vendor/php-http/httplug/src/HttpAsyncClient.php +++ b/vendor/php-http/httplug/src/HttpAsyncClient.php @@ -17,9 +17,7 @@ interface HttpAsyncClient * * Exceptions related to processing the request are available from the returned Promise. * - * @param RequestInterface $request - * - * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception. + * @return Promise resolves a PSR-7 Response or fails with an Http\Client\Exception * * @throws \Exception If processing the request is impossible (eg. bad configuration). */ diff --git a/vendor/php-http/httplug/src/HttpClient.php b/vendor/php-http/httplug/src/HttpClient.php index 0e51749fff..22b94aaf70 100644 --- a/vendor/php-http/httplug/src/HttpClient.php +++ b/vendor/php-http/httplug/src/HttpClient.php @@ -2,27 +2,16 @@ namespace Http\Client; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; +use Psr\Http\Client\ClientInterface; /** - * Sends a PSR-7 Request and returns a PSR-7 response. + * {@inheritdoc} * - * @author GeLo <geloen.eric@gmail.com> - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - * @author David Buchmann <mail@davidbu.ch> + * Provide the Httplug HttpClient interface for BC. + * You should typehint Psr\Http\Client\ClientInterface in new code + * + * @deprecated since version 2.4, use Psr\Http\Client\ClientInterface instead; see https://www.php-fig.org/psr/psr-18/ */ -interface HttpClient +interface HttpClient extends ClientInterface { - /** - * Sends a PSR-7 request. - * - * @param RequestInterface $request - * - * @return ResponseInterface - * - * @throws \Http\Client\Exception If an error happens during processing the request. - * @throws \Exception If processing the request is impossible (eg. bad configuration). - */ - public function sendRequest(RequestInterface $request); } diff --git a/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php b/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php index 6779e4479f..ccdf48ed42 100644 --- a/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php +++ b/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php @@ -13,18 +13,12 @@ final class HttpFulfilledPromise implements Promise */ private $response; - /** - * @param ResponseInterface $response - */ public function __construct(ResponseInterface $response) { $this->response = $response; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onFulfilled) { return $this; @@ -37,17 +31,11 @@ public function then(callable $onFulfilled = null, callable $onRejected = null) } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::FULFILLED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { diff --git a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php index bfb0738f1c..a489ad4f74 100644 --- a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php +++ b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php @@ -12,41 +12,34 @@ final class HttpRejectedPromise implements Promise */ private $exception; - /** - * @param Exception $exception - */ public function __construct(Exception $exception) { $this->exception = $exception; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onRejected) { return $this; } try { - return new HttpFulfilledPromise($onRejected($this->exception)); + $result = $onRejected($this->exception); + if ($result instanceof Promise) { + return $result; + } + + return new HttpFulfilledPromise($result); } catch (Exception $e) { return new self($e); } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::REJECTED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { diff --git a/vendor/php-http/message-factory/CHANGELOG.md b/vendor/php-http/message-factory/CHANGELOG.md deleted file mode 100644 index 4711924c6e..0000000000 --- a/vendor/php-http/message-factory/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# Change Log - - -## 1.0.2 - 2015-12-19 - -### Added - -- Request and Response factory binding types to Puli - - -## 1.0.1 - 2015-12-17 - -### Added - -- Puli configuration and binding types - - -## 1.0.0 - 2015-12-15 - -### Added - -- Response Factory in order to be reused in Message and Server Message factories -- Request Factory - -### Changed - -- Message Factory extends Request and Response factories - - -## 1.0.0-RC1 - 2015-12-14 - -### Added - -- CS check - -### Changed - -- RuntimeException is thrown when the StreamFactory cannot write to the underlying stream - - -## 0.3.0 - 2015-11-16 - -### Removed - -- Client Context Factory -- Factory Awares and Templates - - -## 0.2.0 - 2015-11-16 - -### Changed - -- Reordered the parameters when creating a message to have the protocol last, -as its the least likely to need to be changed. - - -## 0.1.0 - 2015-06-01 - -### Added - -- Initial release - -### Changed - -- Helpers are renamed to templates diff --git a/vendor/php-http/message-factory/README.md b/vendor/php-http/message-factory/README.md deleted file mode 100644 index 4654495a72..0000000000 --- a/vendor/php-http/message-factory/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# PSR-7 Message Factory - -[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory) - -**Factory interfaces for PSR-7 HTTP Message.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/message-factory -``` - - -## Documentation - -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). - - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message-factory/composer.json b/vendor/php-http/message-factory/composer.json deleted file mode 100644 index 7c72febe5b..0000000000 --- a/vendor/php-http/message-factory/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "php-http/message-factory", - "description": "Factory interfaces for PSR-7 HTTP Message", - "license": "MIT", - "keywords": ["http", "factory", "message", "stream", "uri"], - "homepage": "http://php-http.org", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/php-http/message-factory/puli.json b/vendor/php-http/message-factory/puli.json deleted file mode 100644 index 08d37627d1..0000000000 --- a/vendor/php-http/message-factory/puli.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": "1.0", - "binding-types": { - "Http\\Message\\MessageFactory": { - "description": "PSR-7 Message Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\RequestFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\ResponseFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\StreamFactory": { - "description": "PSR-7 Stream Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\UriFactory": { - "description": "PSR-7 URI Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - } - } -} diff --git a/vendor/php-http/message-factory/src/MessageFactory.php b/vendor/php-http/message-factory/src/MessageFactory.php deleted file mode 100644 index 965aaa804e..0000000000 --- a/vendor/php-http/message-factory/src/MessageFactory.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Http\Message; - -/** - * Factory for PSR-7 Request and Response. - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -interface MessageFactory extends RequestFactory, ResponseFactory -{ -} diff --git a/vendor/php-http/message-factory/src/RequestFactory.php b/vendor/php-http/message-factory/src/RequestFactory.php deleted file mode 100644 index 624e82f361..0000000000 --- a/vendor/php-http/message-factory/src/RequestFactory.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Http\Message; - -use Psr\Http\Message\UriInterface; -use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\StreamInterface; - -/** - * Factory for PSR-7 Request. - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -interface RequestFactory -{ - /** - * Creates a new PSR-7 request. - * - * @param string $method - * @param string|UriInterface $uri - * @param array $headers - * @param resource|string|StreamInterface|null $body - * @param string $protocolVersion - * - * @return RequestInterface - */ - public function createRequest( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ); -} diff --git a/vendor/php-http/message-factory/src/ResponseFactory.php b/vendor/php-http/message-factory/src/ResponseFactory.php deleted file mode 100644 index 2411ed3a17..0000000000 --- a/vendor/php-http/message-factory/src/ResponseFactory.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Http\Message; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\StreamInterface; - -/** - * Factory for PSR-7 Response. - * - * This factory contract can be reused in Message and Server Message factories. - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -interface ResponseFactory -{ - /** - * Creates a new PSR-7 response. - * - * @param int $statusCode - * @param string|null $reasonPhrase - * @param array $headers - * @param resource|string|StreamInterface|null $body - * @param string $protocolVersion - * - * @return ResponseInterface - */ - public function createResponse( - $statusCode = 200, - $reasonPhrase = null, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ); -} diff --git a/vendor/php-http/message-factory/src/StreamFactory.php b/vendor/php-http/message-factory/src/StreamFactory.php deleted file mode 100644 index 327a902f95..0000000000 --- a/vendor/php-http/message-factory/src/StreamFactory.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Http\Message; - -use Psr\Http\Message\StreamInterface; - -/** - * Factory for PSR-7 Stream. - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -interface StreamFactory -{ - /** - * Creates a new PSR-7 stream. - * - * @param string|resource|StreamInterface|null $body - * - * @return StreamInterface - * - * @throws \InvalidArgumentException If the stream body is invalid. - * @throws \RuntimeException If creating the stream from $body fails. - */ - public function createStream($body = null); -} diff --git a/vendor/php-http/message-factory/src/UriFactory.php b/vendor/php-http/message-factory/src/UriFactory.php deleted file mode 100644 index f05e625210..0000000000 --- a/vendor/php-http/message-factory/src/UriFactory.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Http\Message; - -use Psr\Http\Message\UriInterface; - -/** - * Factory for PSR-7 URI. - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -interface UriFactory -{ - /** - * Creates an PSR-7 URI. - * - * @param string|UriInterface $uri - * - * @return UriInterface - * - * @throws \InvalidArgumentException If the $uri argument can not be converted into a valid URI. - */ - public function createUri($uri); -} diff --git a/vendor/php-http/promise/CHANGELOG.md b/vendor/php-http/promise/CHANGELOG.md index 336e140995..b6233683ca 100644 --- a/vendor/php-http/promise/CHANGELOG.md +++ b/vendor/php-http/promise/CHANGELOG.md @@ -1,5 +1,40 @@ # Change Log +## 1.3.1 - 2024-03-15 + +- Made nullable parameter types explicit (PHP 8.4 compatibility) + +## 1.3.0 - 2024-01-04 + +### Fixed + +- Reverted generic annotations on promise - as `then` returns another promise, there seems no way to properly document this. + +## 1.2.1 - 2023-11-08 + +### Added + +- Fixed PHPDoc for `wait()` and `then()`'s `onRejected` callable + +## 1.2.0 - 2023-10-24 + +### Added + +- Generic annotations + +## 1.1.0 - 2020-07-07 + +### Added + +- Test with PHP 7.1, 7.2, 7.3, 7.4 and 8.0 + +### Removed + +- PHP 5 and 7.0 support + +### Fixed + +- Fixed PHPDoc for `Promise::then` ## 1.0.0 - 2016-01-26 diff --git a/vendor/php-http/promise/README.md b/vendor/php-http/promise/README.md index adda2aeb5d..8ee4aa641b 100644 --- a/vendor/php-http/promise/README.md +++ b/vendor/php-http/promise/README.md @@ -2,7 +2,7 @@ [![Latest Version](https://img.shields.io/github/release/php-http/promise.svg?style=flat-square)](https://github.com/php-http/promise/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/promise.svg?style=flat-square)](https://travis-ci.org/php-http/promise) +[![Build Status](https://github.com/php-http/promise/actions/workflows/tests.yml/badge.svg?branch=1.x)](https://github.com/php-http/promise/actions/workflows/tests.yml) [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) [![Quality Score](https://img.shields.io/scrutinizer/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) [![Total Downloads](https://img.shields.io/packagist/dt/php-http/promise.svg?style=flat-square)](https://packagist.org/packages/php-http/promise) @@ -23,7 +23,7 @@ $ composer require php-http/promise ## Documentation -Please see the [official documentation](http://docs.php-http.org). +Please see the [official documentation](http://docs.php-http.org/en/latest/components/promise.html). ## Testing @@ -40,8 +40,7 @@ Please see our [contributing guide](http://docs.php-http.org/en/latest/developme ## Security -If you discover any security related issues, please contact us at [security@httplug.io](mailto:security@httplug.io) -or [security@php-http.org](mailto:security@php-http.org). +If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). ## License diff --git a/vendor/php-http/promise/composer.json b/vendor/php-http/promise/composer.json index ff1d2cee3b..184fd60ecc 100644 --- a/vendor/php-http/promise/composer.json +++ b/vendor/php-http/promise/composer.json @@ -14,9 +14,12 @@ "email": "mark.sagikazar@gmail.com" } ], + "require": { + "php" : "^7.1 || ^8.0" + }, "require-dev": { - "phpspec/phpspec": "^2.4", - "henrikbjorn/phpspec-code-coverage" : "^1.0" + "friends-of-phpspec/phpspec-code-coverage" : "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, "autoload": { "psr-4": { @@ -26,10 +29,5 @@ "scripts": { "test": "vendor/bin/phpspec run", "test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } } } diff --git a/vendor/php-http/promise/phpstan.neon.dist b/vendor/php-http/promise/phpstan.neon.dist new file mode 100644 index 0000000000..f8b94cf5f6 --- /dev/null +++ b/vendor/php-http/promise/phpstan.neon.dist @@ -0,0 +1,6 @@ +parameters: + level: max + checkMissingIterableValueType: false + treatPhpDocTypesAsCertain: false + paths: + - src diff --git a/vendor/php-http/promise/src/FulfilledPromise.php b/vendor/php-http/promise/src/FulfilledPromise.php index f60f686a21..ed77d469f5 100644 --- a/vendor/php-http/promise/src/FulfilledPromise.php +++ b/vendor/php-http/promise/src/FulfilledPromise.php @@ -15,17 +15,14 @@ final class FulfilledPromise implements Promise private $result; /** - * @param $result + * @param mixed $result */ public function __construct($result) { $this->result = $result; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onFulfilled) { return $this; @@ -38,21 +35,17 @@ public function then(callable $onFulfilled = null, callable $onRejected = null) } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::FULFILLED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { return $this->result; } + + return null; } } diff --git a/vendor/php-http/promise/src/Promise.php b/vendor/php-http/promise/src/Promise.php index e2cf5f89e4..e24031145d 100644 --- a/vendor/php-http/promise/src/Promise.php +++ b/vendor/php-http/promise/src/Promise.php @@ -36,12 +36,12 @@ interface Promise * If you do not care about one of the cases, you can set the corresponding callable to null * The callback will be called when the value arrived and never more than once. * - * @param callable $onFulfilled Called when a response will be available. - * @param callable $onRejected Called when an exception occurs. + * @param callable|null $onFulfilled called when a response will be available + * @param callable|null $onRejected called when an exception occurs * - * @return Promise A new resolved promise with value of the executed callback (onFulfilled / onRejected). + * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) */ - public function then(callable $onFulfilled = null, callable $onRejected = null); + public function then(?callable $onFulfilled = null, ?callable $onRejected = null); /** * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. @@ -61,9 +61,9 @@ public function getState(); * * @param bool $unwrap Whether to return resolved value / throw reason or not * - * @return mixed Resolved value, null if $unwrap is set to false + * @return ($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false * - * @throws \Exception The rejection reason if $unwrap is set to true and the request failed. + * @throws \Throwable the rejection reason if $unwrap is set to true and the request failed */ public function wait($unwrap = true); } diff --git a/vendor/php-http/promise/src/RejectedPromise.php b/vendor/php-http/promise/src/RejectedPromise.php index e396a40f73..8c046ce281 100644 --- a/vendor/php-http/promise/src/RejectedPromise.php +++ b/vendor/php-http/promise/src/RejectedPromise.php @@ -10,22 +10,16 @@ final class RejectedPromise implements Promise { /** - * @var \Exception + * @var \Throwable */ private $exception; - /** - * @param \Exception $exception - */ - public function __construct(\Exception $exception) + public function __construct(\Throwable $exception) { $this->exception = $exception; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onRejected) { return $this; @@ -38,21 +32,17 @@ public function then(callable $onFulfilled = null, callable $onRejected = null) } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::REJECTED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { throw $this->exception; } + + return null; } } diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index c287e307a6..862a4e1a42 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -1,46 +1,54 @@ -![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://supportukrainenow.org/) -# PHPMailer - A full-featured email creation and transfer class for PHP +![PHPMailer](https://raw.github.com/PHPMailer/PHPMailer/master/examples/images/phpmailer.png) -Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/quality-score.png?s=3758e21d279becdf847a557a56a3ed16dfec9d5d)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) -[![Code Coverage](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/badges/coverage.png?s=3fe6ca5fe8cd2cdf96285756e42932f7ca256962)](https://scrutinizer-ci.com/g/PHPMailer/PHPMailer/) +# PHPMailer – A full-featured email creation and transfer class for PHP -[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![Latest Unstable Version](https://poser.pugx.org/phpmailer/phpmailer/v/unstable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](http://phpmailer.github.io/PHPMailer/) +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) +[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer) +[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) +[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer/badge)](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer) -## Class Features +## Features - Probably the world's most popular code for sending email from PHP! - Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more -- Integrated SMTP support - send without a local mail server -- Send emails with multiple To, CC, BCC and Reply-to addresses +- Integrated SMTP support – send without a local mail server +- Send emails with multiple To, CC, BCC, and Reply-to addresses - Multipart/alternative emails for mail clients that do not read HTML email - Add attachments, including inline - Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings -- SMTP authentication with LOGIN, PLAIN, CRAM-MD5, and XOAUTH2 mechanisms over SSL and SMTP+STARTTLS transports +- Full UTF-8 support when using servers that support `SMTPUTF8`. +- Support for iCal events in multiparts and attachments +- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports - Validates email addresses automatically -- Protect against header injection attacks +- Protects against header injection attacks - Error messages in over 50 languages! - DKIM and S/MIME signing support -- Compatible with PHP 5.5 and later +- Compatible with PHP 5.5 and later, including PHP 8.4 - Namespaced to prevent name clashes - Much more! ## Why you might need it -Many PHP developers need to send email from their code. The only PHP function that supports this is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as encryption, authentication, HTML messages, and attachments. +Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments. + +Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe! -Formatting email correctly is surprisingly difficult. There are myriad overlapping RFCs, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong! -*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/), [Zend/Mail](https://zendframework.github.io/zend-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc. +The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost. -The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP implementation allows email sending on Windows platforms without a local mail server. +*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that +you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc. ## License -This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read LICENSE for information on the software availability and distribution. +This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. ## Installation & loading PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "~6.1" +"phpmailer/phpmailer": "^6.10.0" ``` or run @@ -51,9 +59,11 @@ composer require phpmailer/phpmailer Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer. -If you want to use the Gmail XOAUTH2 authentication class, you will also need to add a dependency on the `league/oauth2-client` package in your `composer.json`. +If you want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at +by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services. -Alternatively, if you're not using Composer, copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: +Alternatively, if you're not using Composer, you +can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually: ```php <?php @@ -65,60 +75,58 @@ require 'path/to/PHPMailer/src/PHPMailer.php'; require 'path/to/PHPMailer/src/SMTP.php'; ``` -If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for the SMTP class. - -If you don't speak git or just want a tarball, click the 'zip' button on the right of the project page in GitHub, though note that docs and examples are not included in the tarball. +If you're not using the `SMTP` class explicitly (you're probably not), you don't need a `use` line for it. Even if you're not using exceptions, you do still need to load the `Exception` class as it is used internally. ## Legacy versions -PHPMailer 5.2 (which is compatible with PHP 5.0 - 7.0) is no longer being supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases. +PHPMailer 5.2 (which is compatible with PHP 5.0 — 7.0) is no longer supported, even for security updates. You will find the latest version of 5.2 in the [5.2-stable branch](https://github.com/PHPMailer/PHPMailer/tree/5.2-stable). If you're using PHP 5.5 or later (which you should be), switch to the 6.x releases. ### Upgrading from 5.2 The biggest changes are that source files are now in the `src/` folder, and PHPMailer now declares the namespace `PHPMailer\PHPMailer`. This has several important effects – [read the upgrade guide](https://github.com/PHPMailer/PHPMailer/tree/master/UPGRADING.md) for more details. ### Minimal installation -While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP, you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer! +While installing the entire package manually or with Composer is simple, convenient, and reliable, you may want to include only vital files in your project. At the very least you will need [src/PHPMailer.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/PHPMailer.php). If you're using SMTP, you'll need [src/SMTP.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/SMTP.php), and if you're using POP-before SMTP (*very* unlikely!), you'll need [src/POP3.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/POP3.php). You can skip the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder if you're not showing errors to users and can make do with English-only errors. If you're using XOAUTH2 you will need [src/OAuth.php](https://github.com/PHPMailer/PHPMailer/tree/master/src/OAuth.php) as well as the Composer dependencies for the services you wish to authenticate with. Really, it's much easier to use Composer! ## A Simple Example ```php <?php -// Import PHPMailer classes into the global namespace -// These must be at the top of your script, not inside a function +//Import PHPMailer classes into the global namespace +//These must be at the top of your script, not inside a function use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; -// Load Composer's autoloader +//Load Composer's autoloader (created by composer, not included with PHPMailer) require 'vendor/autoload.php'; -// Instantiation and passing `true` enables exceptions +//Create an instance; passing `true` enables exceptions $mail = new PHPMailer(true); try { //Server settings - $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output - $mail->isSMTP(); // Send using SMTP - $mail->Host = 'smtp1.example.com'; // Set the SMTP server to send through - $mail->SMTPAuth = true; // Enable SMTP authentication - $mail->Username = 'user@example.com'; // SMTP username - $mail->Password = 'secret'; // SMTP password - $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged - $mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'user@example.com'; //SMTP username + $mail->Password = 'secret'; //SMTP password + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption + $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('from@example.com', 'Mailer'); - $mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient - $mail->addAddress('ellen@example.com'); // Name is optional + $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient + $mail->addAddress('ellen@example.com'); //Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); - // Attachments - $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments - $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name + //Attachments + $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments + $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name - // Content - $mail->isHTML(true); // Set email format to HTML + //Content + $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; @@ -130,59 +138,53 @@ try { } ``` -You'll find plenty more to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more. If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. That's it. You should now be ready to use PHPMailer! ## Localization -PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: ```php -// To load the French version +//To load the French version $mail->setLanguage('fr', '/optional/path/to/language/directory/'); ``` -We welcome corrections and new languages - if you're looking for corrections to do, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. +We welcome corrections and new languages – if you're looking for corrections, run the [Language/TranslationCompletenessTest.php](https://github.com/PHPMailer/PHPMailer/blob/master/test/Language/TranslationCompletenessTest.php) script in the tests folder and it will show any missing translations. ## Documentation -Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, this should be the first place you look as it's the most frequently updated. +Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps). -Note that in order to reduce PHPMailer's deployed code footprint, the examples are no longer included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. +To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly. -Complete generated API documentation is [available online](http://phpmailer.github.io/PHPMailer/). +Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/). -You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](http://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailerTest.php) a good source of how to do various operations such as encryption. +You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption. -If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](http://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). +If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting). ## Tests -There is a PHPUnit test script in the [test](https://github.com/PHPMailer/PHPMailer/tree/master/test/) folder. PHPMailer uses PHPUnit 4.8 - we would use 5.x but we need to run on PHP 5.5. +[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions. -Build status: [![Build Status](https://travis-ci.org/PHPMailer/PHPMailer.svg)](https://travis-ci.org/PHPMailer/PHPMailer) +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) If this isn't passing, is there something you can do to help? ## Security -Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. - -PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. +Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately. -PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). - -PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a critical remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). - -See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) for more detail on security issues. +See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). ## Contributing -Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). +Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). -We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. +We're particularly interested in fixing edge cases, expanding test coverage, and updating translations. -If you found a mistake in the docs, or want to add something, go ahead and amend the wiki - anyone can edit it. +If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone: @@ -193,29 +195,38 @@ git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained. ## Sponsorship -Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), a powerful email marketing system. +Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system. + +<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="550" alt="Smartmessages.net privacy-first email marketing logo"></a> + +Donations are very welcome, whether in beer ðŸº, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme. + +## PHPMailer For Enterprise -<a href="https://info.smartmessages.net/"><img src="https://www.smartmessages.net/img/smartmessages-logo.svg" width="250" height="28" alt="Smartmessages email marketing"></a> +Available as part of the Tidelift Subscription. -Other contributions are gladly received, whether in beer ðŸº, T-shirts 👕, Amazon wishlist raids, or cold, hard cash 💰. If you'd like to donate to say "thank you" to maintainers or contributors, please contact them through individual profile pages via [the contributors page](https://github.com/PHPMailer/PHPMailer/graphs/contributors). +The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial +support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and +improve code health, while paying the maintainers of the exact packages you +use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) ## Changelog See [changelog](changelog.md). ## History -- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](http://sourceforge.net/projects/phpmailer/). -- Marcus Bointon (coolbru on SF) and Andy Prevost (codeworxtech) took over the project in 2004. +- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/). +- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004. - Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski. -- Marcus created his fork on [GitHub](https://github.com/Synchro/PHPMailer) in 2008. +- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008. - Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013. -- PHPMailer moves to the [PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. +- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013. ### What's changed since moving from SourceForge? - Official successor to the SourceForge and Google Code projects. - Test suite. -- Continuous integration with Travis-CI. +- Continuous integration with GitHub Actions. - Composer support. - Public development. - Additional languages and language strings. - CRAM-MD5 authentication support. -- Preserves full repo history of authors, commits and branches from the original SourceForge project. +- Preserves full repo history of authors, commits, and branches from the original SourceForge project. diff --git a/vendor/phpmailer/phpmailer/SECURITY.md b/vendor/phpmailer/phpmailer/SECURITY.md index 5e917cd04a..4f34026dfa 100644 --- a/vendor/phpmailer/phpmailer/SECURITY.md +++ b/vendor/phpmailer/phpmailer/SECURITY.md @@ -1,16 +1,25 @@ # Security notices relating to PHPMailer -Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately. +Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately. + +PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/). + +PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows. +PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift. + +PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts. + +PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security. PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr. -PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. +PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project. PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity. PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer). -PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](http://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). +PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html). PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending. diff --git a/vendor/phpmailer/phpmailer/SMTPUTF8.md b/vendor/phpmailer/phpmailer/SMTPUTF8.md new file mode 100644 index 0000000000..ca284ee216 --- /dev/null +++ b/vendor/phpmailer/phpmailer/SMTPUTF8.md @@ -0,0 +1,48 @@ +# A short history of UTF-8 in email + +## Background + +For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds. + +The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP. +This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command. + +From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be: + +``` +Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?= +``` + +Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works. + +Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel. + +Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of +`user@café.example.com` translates to +`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN. + +The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`). + +I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages. + +This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess. + +## SMTPUTF8 + +`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8. + +But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅. + +The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was. + +## SMTPUTF8 in PHPMailer + +Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server. + +This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary. + +The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization). + +### Postfix gotcha + +Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway. diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index f8c5c2ccd2..cf79bf90ee 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.1.5 \ No newline at end of file +6.10.0 diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index fd0695c8a7..7b008b7c57 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -19,22 +19,43 @@ "name": "Brent R. Matzelle" } ], + "funding": [ + { + "url": "https://github.com/Synchro", + "type": "github" + } + ], + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "lock": false + }, "require": { "php": ">=5.5.0", "ext-ctype": "*", - "ext-filter": "*" + "ext-filter": "*", + "ext-hash": "*" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.2", - "phpunit/phpunit": "^4.8 || ^5.7", - "doctrine/annotations": "^1.2" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "doctrine/annotations": "^1.2.6 || ^1.13.3", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcompatibility/php-compatibility": "^9.3.5", + "roave/security-advisories": "dev-latest", + "squizlabs/php_codesniffer": "^3.7.2", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { - "psr/log": "For optional PSR-3 debug logging", - "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", + "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "ext-mbstring": "Needed to send email in multibyte encoding charset", + "league/oauth2-google": "Needed for Google XOAUTH2 authentication", + "psr/log": "For optional PSR-3 debug logging", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "autoload": { @@ -47,5 +68,13 @@ "PHPMailer\\Test\\": "test/" } }, - "license": "LGPL-2.1-only" + "license": "LGPL-2.1-only", + "scripts": { + "check": "./vendor/bin/phpcs", + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build" + ] + } } diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php index 1237b57be8..0e54a00b63 100644 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.5 @@ -8,14 +9,15 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2017 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. */ + /** * Get an OAuth2 token from an OAuth2 provider. * * Install this script on your server so that it's accessible @@ -34,26 +36,43 @@ * Aliases for League Provider Classes * Make sure you have added these to your composer.json and run `composer install` * Plenty to choose from here: - * @see http://oauth2-client.thephpleague.com/providers/thirdparty/ + * @see https://oauth2-client.thephpleague.com/providers/thirdparty/ */ -// @see https://github.com/thephpleague/oauth2-google +//@see https://github.com/thephpleague/oauth2-google use League\OAuth2\Client\Provider\Google; -// @see https://packagist.org/packages/hayageek/oauth2-yahoo +//@see https://packagist.org/packages/hayageek/oauth2-yahoo use Hayageek\OAuth2\Client\Provider\Yahoo; -// @see https://github.com/stevenmaguire/oauth2-microsoft +//@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; +//@see https://github.com/greew/oauth2-azure-provider +use Greew\OAuth2\Client\Provider\Azure; -if (!isset($_GET['code']) && !isset($_GET['provider'])) { -?> +if (!isset($_GET['code']) && !isset($_POST['provider'])) { + ?> <html> -<body>Select Provider:<br/> -<a href='?provider=Google'>Google</a><br/> -<a href='?provider=Yahoo'>Yahoo</a><br/> -<a href='?provider=Microsoft'>Microsoft/Outlook/Hotmail/Live/Office365</a><br/> +<body> +<form method="post"> + <h1>Select Provider</h1> + <input type="radio" name="provider" value="Google" id="providerGoogle"> + <label for="providerGoogle">Google</label><br> + <input type="radio" name="provider" value="Yahoo" id="providerYahoo"> + <label for="providerYahoo">Yahoo</label><br> + <input type="radio" name="provider" value="Microsoft" id="providerMicrosoft"> + <label for="providerMicrosoft">Microsoft</label><br> + <input type="radio" name="provider" value="Azure" id="providerAzure"> + <label for="providerAzure">Azure</label><br> + <h1>Enter id and secret</h1> + <p>These details are obtained by setting up an app in your provider's developer console. + </p> + <p>ClientId: <input type="text" name="clientId"><p> + <p>ClientSecret: <input type="text" name="clientSecret"></p> + <p>TenantID (only relevant for Azure): <input type="text" name="tenantId"></p> + <input type="submit" value="Continue"> +</form> </body> </html> -<?php -exit; + <?php + exit; } require 'vendor/autoload.php'; @@ -61,21 +80,29 @@ session_start(); $providerName = ''; +$clientId = ''; +$clientSecret = ''; +$tenantId = ''; -if (array_key_exists('provider', $_GET)) { - $providerName = $_GET['provider']; +if (array_key_exists('provider', $_POST)) { + $providerName = $_POST['provider']; + $clientId = $_POST['clientId']; + $clientSecret = $_POST['clientSecret']; + $tenantId = $_POST['tenantId']; $_SESSION['provider'] = $providerName; + $_SESSION['clientId'] = $clientId; + $_SESSION['clientSecret'] = $clientSecret; + $_SESSION['tenantId'] = $tenantId; } elseif (array_key_exists('provider', $_SESSION)) { $providerName = $_SESSION['provider']; -} -if (!in_array($providerName, ['Google', 'Microsoft', 'Yahoo'])) { - exit('Only Google, Microsoft and Yahoo OAuth2 providers are currently supported in this script.'); + $clientId = $_SESSION['clientId']; + $clientSecret = $_SESSION['clientSecret']; + $tenantId = $_SESSION['tenantId']; } -//These details are obtained by setting up an app in the Google developer console, -//or whichever provider you're using. -$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com'; -$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP'; +//If you don't want to use the built-in form, set your client id and secret here +//$clientId = 'RANDOMCHARS-----duv1n2.apps.googleusercontent.com'; +//$clientSecret = 'RANDOMCHARS-----lGyjPcRtvP'; //If this automatic URL doesn't work, set it yourself manually to the URL of this script $redirectUri = (isset($_SERVER['HTTPS']) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; @@ -112,6 +139,17 @@ ] ]; break; + case 'Azure': + $params['tenantId'] = $tenantId; + + $provider = new Azure($params); + $options = [ + 'scope' => [ + 'https://outlook.office.com/SMTP.Send', + 'offline_access' + ] + ]; + break; } if (null === $provider) { @@ -119,26 +157,26 @@ } if (!isset($_GET['code'])) { - // If we don't have an authorization code then get one + //If we don't have an authorization code then get one $authUrl = $provider->getAuthorizationUrl($options); $_SESSION['oauth2state'] = $provider->getState(); header('Location: ' . $authUrl); exit; -// Check given state against previously stored one to mitigate CSRF attack + //Check given state against previously stored one to mitigate CSRF attack } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) { unset($_SESSION['oauth2state']); unset($_SESSION['provider']); exit('Invalid state'); } else { unset($_SESSION['provider']); - // Try to get an access token (using the authorization code grant) + //Try to get an access token (using the authorization code grant) $token = $provider->getAccessToken( 'authorization_code', [ 'code' => $_GET['code'] ] ); - // Use this to interact with an API on the users behalf - // Use this to get a new access token if the old one expires - echo 'Refresh Token: ', $token->getRefreshToken(); + //Use this to interact with an API on the users behalf + //Use this to get a new access token if the old one expires + echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken()); } diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php index 3c42d78e15..0b2a72d524 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php @@ -1,4 +1,5 @@ <?php + /** * Afrikaans PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php index 865d0b7329..f795580a14 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php @@ -1,4 +1,5 @@ <?php + /** * Arabic PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -18,8 +19,7 @@ $PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; $PHPMAILER_LANG['provide_address'] = 'يجب توÙير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ' . - 'ÙØ´Ù„ ÙÙŠ الارسال لكل من : '; +$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية ÙØ´Ù„ ÙÙŠ الارسال لكل من : '; $PHPMAILER_LANG['signing'] = 'خطأ ÙÙŠ التوقيع: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; $PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php new file mode 100644 index 0000000000..327dfbafaf --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php @@ -0,0 +1,35 @@ +<?php + +/** + * Assamese PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author Manish Sarkar <manish.n.manish@gmail.com> + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP তà§à§°à§à¦Ÿà¦¿: পà§à§°à¦®à¦¾à¦£à§€à¦•ৰণ কৰিব নোৱাৰি'; +$PHPMAILER_LANG['buggy_php'] = 'আপোনাৰ PHP সংসà§à¦•ৰণ à¦à¦Ÿà¦¾ বাগৰ দà§à¦¬à¦¾à§°à¦¾ পà§à§°à¦­à¦¾à§±à¦¿à¦¤ হয় যাৰ ফলত নষà§à¦Ÿ বাৰà§à¦¤à¦¾ হব পাৰে । ইয়াক সমাধান কৰিবলে, পà§à§°à§‡à§°à¦£ কৰিবলে SMTP বà§à¦¯à§±à¦¹à¦¾à§° কৰক, আপোনাৰ php.ini ত mail.add_x_header বিকলà§à¦ª নিষà§à¦•à§à§°à¦¿à¦¯à¦¼ কৰক, MacOS বা Linux লৈ সলনি কৰক, বা আপোনাৰ PHP সংসà§à¦•ৰণ 7.0.17+ বা 7.1.3+ লৈ সলনি কৰক ।'; +$PHPMAILER_LANG['connect_host'] = 'SMTP তà§à§°à§à¦Ÿà¦¿: SMTP চাৰà§à¦­à¦¾à§°à§° সৈতে সংযোগ কৰিবলে অকà§à¦·à¦®'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP তà§à§°à§à¦Ÿà¦¿: তথà§à¦¯ গà§à§°à¦¹à¦£ কৰা হোৱা নাই'; +$PHPMAILER_LANG['empty_message'] = 'বাৰà§à¦¤à¦¾à§° মূখà§à¦¯ অংশ খালী।'; +$PHPMAILER_LANG['encoding'] = 'অজà§à¦žà¦¾à¦¤ à¦à¦¨à¦•োডিং: '; +$PHPMAILER_LANG['execute'] = 'à¦à¦•à§à¦¸à¦¿à¦•িউট কৰিব নোৱাৰি: '; +$PHPMAILER_LANG['extension_missing'] = 'সমà§à¦ªà§à§°à¦¸à¦¾à§°à¦£ নোহোৱা হৈছে: '; +$PHPMAILER_LANG['file_access'] = 'ফাইল অভিগম কৰিবলে অকà§à¦·à¦®: '; +$PHPMAILER_LANG['file_open'] = 'ফাইল তà§à§°à§à¦Ÿà¦¿: ফাইল খোলিবলৈ অকà§à¦·à¦®: '; +$PHPMAILER_LANG['from_failed'] = 'নিমà§à¦¨à¦²à¦¿à¦–িত পà§à§°à§‡à§°à¦•à§° ঠিকনা(সমূহ) বà§à¦¯à§°à§à¦¥: '; +$PHPMAILER_LANG['instantiate'] = 'মেইল ফাংচনৰ à¦à¦Ÿà¦¾ উদাহৰণ সৃষà§à¦Ÿà¦¿ কৰিবলে অকà§à¦·à¦®'; +$PHPMAILER_LANG['invalid_address'] = 'পà§à§°à§‡à§°à¦£ কৰিব নোৱাৰি: অবৈধ ইমেইল ঠিকনা: '; +$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডাৰৰ নাম বা মান'; +$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোষà§à¦Ÿà§‡à¦¨à§à¦Ÿà§à§°à¦¿: '; +$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হসà§à¦Ÿ:'; +$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলাৰ সমৰà§à¦¥à¦¿à¦¤ নহয়।'; +$PHPMAILER_LANG['provide_address'] = 'আপà§à¦¨à¦¿ অনà§à¦¤à¦¤à¦ƒ à¦à¦Ÿà¦¾ গনà§à¦¤à¦¬à§à¦¯ ইমেইল ঠিকনা দিব লাগিব'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP তà§à§°à§à¦Ÿà¦¿: নিমà§à¦¨à¦²à¦¿à¦–িত গনà§à¦¤à¦¬à§à¦¯à¦¸à§à¦¥à¦¾à¦¨à¦¸à¦®à§‚হ বà§à¦¯à§°à§à¦¥: '; +$PHPMAILER_LANG['signing'] = 'সà§à¦¬à¦¾à¦•à§à¦·à§° কৰাত বà§à¦¯à§°à§à¦¥: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP কড: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'অতিৰিকà§à¦¤ SMTP তথà§à¦¯: '; +$PHPMAILER_LANG['smtp_detail'] = 'বিৱৰণ:'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() বà§à¦¯à§°à§à¦¥'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP চাৰà§à¦­à¦¾à§°à§° তà§à§°à§à¦Ÿà¦¿: '; +$PHPMAILER_LANG['variable_set'] = 'চলক নিৰà§à¦§à¦¾à§°à¦£ কৰিব পৰা নগল: '; +$PHPMAILER_LANG['extension_missing'] = 'অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤ সমà§à¦ªà§à§°à¦¸à¦¾à§°à¦£: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php index 3749d83d60..552167ef62 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php @@ -1,4 +1,5 @@ <?php + /** * Azerbaijani PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php index 576c4bb534..3694f344ab 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php @@ -1,4 +1,5 @@ <?php + /** * Bosnian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -23,4 +24,4 @@ $PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; $PHPMAILER_LANG['smtp_error'] = 'SMTP greÅ¡ka: '; $PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; \ No newline at end of file +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php index e2f98f0f6d..9e92ddaaf7 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php @@ -1,4 +1,5 @@ <?php + /** * Belarusian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php index b22941f6b5..c41f675dfd 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php @@ -1,4 +1,5 @@ <?php + /** * Bulgarian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php new file mode 100644 index 0000000000..4736510804 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php @@ -0,0 +1,35 @@ +<?php + +/** + * Bengali PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author Manish Sarkar <manish.n.manish@gmail.com> + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP তà§à¦°à§à¦Ÿà¦¿: পà§à¦°à¦®à¦¾à¦£à§€à¦•রণ করতে অকà§à¦·à¦®à§·'; +$PHPMAILER_LANG['buggy_php'] = 'আপনার PHP সংসà§à¦•রণ à¦à¦•টি বাগ দà§à¦¬à¦¾à¦°à¦¾ পà§à¦°à¦­à¦¾à¦¬à¦¿à¦¤ হয় যার ফলে দূষিত বারà§à¦¤à¦¾ হতে পারে। à¦à¦Ÿà¦¿ ঠিক করতে, পাঠাতে SMTP বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨, আপনার php.ini ঠmail.add_x_header বিকলà§à¦ªà¦Ÿà¦¿ নিষà§à¦•à§à¦°à¦¿à¦¯à¦¼ করà§à¦¨, MacOS বা Linux-ঠসà§à¦¯à§à¦‡à¦š করà§à¦¨, অথবা আপনার PHP সংসà§à¦•রণকে 7.0.17+ বা 7.1.3+ ঠপরিবরà§à¦¤à¦¨ করà§à¦¨à¥¤'; +$PHPMAILER_LANG['connect_host'] = 'SMTP তà§à¦°à§à¦Ÿà¦¿: SMTP সারà§à¦­à¦¾à¦°à§‡à¦° সাথে সংযোগ করতে অকà§à¦·à¦®à§·'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP তà§à¦°à§à¦Ÿà¦¿: ডেটা গà§à¦°à¦¹à¦£ করা হয়নি৷'; +$PHPMAILER_LANG['empty_message'] = 'বারà§à¦¤à¦¾à¦° অংশটি খালি।'; +$PHPMAILER_LANG['encoding'] = 'অজানা à¦à¦¨à¦•োডিং: '; +$PHPMAILER_LANG['execute'] = 'নিরà§à¦¬à¦¾à¦¹ করতে অকà§à¦·à¦®: '; +$PHPMAILER_LANG['extension_missing'] = 'à¦à¦•à§à¦¸à¦Ÿà§‡à¦¨à¦¶à¦¨ অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤:'; +$PHPMAILER_LANG['file_access'] = 'ফাইল অà§à¦¯à¦¾à¦•à§à¦¸à§‡à¦¸ করতে অকà§à¦·à¦®: '; +$PHPMAILER_LANG['file_open'] = 'ফাইল তà§à¦°à§à¦Ÿà¦¿: ফাইল খà§à¦²à¦¤à§‡ অকà§à¦·à¦®: '; +$PHPMAILER_LANG['from_failed'] = 'নিমà§à¦¨à¦²à¦¿à¦–িত পà§à¦°à§‡à¦°à¦•ের ঠিকানা(গà§à¦²à¦¿) বà§à¦¯à¦°à§à¦¥ হয়েছে: '; +$PHPMAILER_LANG['instantiate'] = 'মেল ফাংশনের à¦à¦•টি উদাহরণ তৈরি করতে অকà§à¦·à¦®à§·'; +$PHPMAILER_LANG['invalid_address'] = 'পাঠাতে অকà§à¦·à¦®: অবৈধ ইমেল ঠিকানা: '; +$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডার নাম বা মান'; +$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোসà§à¦Ÿà§‡à¦¨à§à¦Ÿà§à¦°à¦¿: '; +$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হোসà§à¦Ÿ:'; +$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলার সমরà§à¦¥à¦¿à¦¤ নয়।'; +$PHPMAILER_LANG['provide_address'] = 'আপনাকে অবশà§à¦¯à¦‡ অনà§à¦¤à¦¤ à¦à¦•টি গনà§à¦¤à¦¬à§à¦¯ ইমেল ঠিকানা পà§à¦°à¦¦à¦¾à¦¨ করতে হবে৷'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP তà§à¦°à§à¦Ÿà¦¿: নিমà§à¦¨à¦²à¦¿à¦–িত গনà§à¦¤à¦¬à§à¦¯à¦—à§à¦²à¦¿ বà§à¦¯à¦°à§à¦¥ হয়েছে: '; +$PHPMAILER_LANG['signing'] = 'সà§à¦¬à¦¾à¦•à§à¦·à¦° করতে বà§à¦¯à¦°à§à¦¥ হয়েছে: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP কোড: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'অতিরিকà§à¦¤ SMTP তথà§à¦¯:'; +$PHPMAILER_LANG['smtp_detail'] = 'বরà§à¦£à¦¨à¦¾: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() বà§à¦¯à¦°à§à¦¥ হয়েছে৷'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP সারà§à¦­à¦¾à¦° তà§à¦°à§à¦Ÿà¦¿: '; +$PHPMAILER_LANG['variable_set'] = 'পরিবরà§à¦¤à¦¨à¦¶à§€à¦² সেট করা যায়নি: '; +$PHPMAILER_LANG['extension_missing'] = 'অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤ à¦à¦•à§à¦¸à¦Ÿà§‡à¦¨à¦¶à¦¨: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php index 4117596c6f..34684855a5 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php @@ -1,4 +1,5 @@ <?php + /** * Catalan PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php deleted file mode 100644 index 4fda6b85d7..0000000000 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * Chinese PHPMailer language file: refer to English translation for definitive list - * @package PHPMailer - * @author LiuXin <http://www.80x86.cn/blog/> - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:身份验è¯å¤±è´¥ã€‚'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误: ä¸èƒ½è¿žæŽ¥SMTP主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误: æ•°æ®ä¸å¯æŽ¥å—。'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = '未知编ç ï¼š'; -$PHPMAILER_LANG['execute'] = 'ä¸èƒ½æ‰§è¡Œ: '; -$PHPMAILER_LANG['file_access'] = 'ä¸èƒ½è®¿é—®æ–‡ä»¶ï¼š'; -$PHPMAILER_LANG['file_open'] = '文件错误:ä¸èƒ½æ‰“开文件:'; -$PHPMAILER_LANG['from_failed'] = '下é¢çš„å‘é€åœ°å€é‚®ä»¶å‘é€å¤±è´¥äº†ï¼š '; -$PHPMAILER_LANG['instantiate'] = 'ä¸èƒ½å®žçްmail方法。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的å‘é€é‚®ä»¶çš„æ–¹æ³•并䏿”¯æŒã€‚'; -$PHPMAILER_LANG['provide_address'] = '您必须æä¾›è‡³å°‘一个 收信人的email地å€ã€‚'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误: 下é¢çš„ æ”¶ä»¶äººå¤±è´¥äº†ï¼š '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php index 1160cf0cc4..e770a1a265 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php @@ -1,4 +1,5 @@ <?php + /** * Czech PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -15,6 +16,8 @@ $PHPMAILER_LANG['from_failed'] = 'Následující adresa odesílatele je nesprávná: '; $PHPMAILER_LANG['instantiate'] = 'Nelze vytvoÅ™it instanci emailové funkce.'; $PHPMAILER_LANG['invalid_address'] = 'Neplatná adresa: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostitele je nesprávný: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostitel je nesprávný: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer není podporován.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadat alespoň jednu emailovou adresu příjemce.'; $PHPMAILER_LANG['recipients_failed'] = 'Chyba SMTP: Následující adresy příjemců nejsou správnÄ›: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php index 5febb516e0..db9a1ef5b0 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php @@ -1,28 +1,36 @@ <?php + /** * Danish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author John Sebastian <jms@iwb.dk> - * Rewrite and extension of the work by Mikael Stokkebro <info@stokkebro.dk> - * + * Rewrite and extension of the work by Mikael Stokkebro <info@stokkebro.dk> + * */ $PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.'; +$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slÃ¥ mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.'; $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgÃ¥ filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke Ã¥bne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php index aa987a9caf..e7e59d2b67 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php @@ -1,4 +1,5 @@ <?php + /** * German PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -15,6 +16,8 @@ $PHPMAILER_LANG['from_failed'] = 'Die folgende Absenderadresse ist nicht korrekt: '; $PHPMAILER_LANG['instantiate'] = 'Mail-Funktion konnte nicht initialisiert werden.'; $PHPMAILER_LANG['invalid_address'] = 'Die Adresse ist ungültig: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ungültiger Hosteintrag: '; +$PHPMAILER_LANG['invalid_host'] = 'Ungültiger Host: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wird nicht unterstützt.'; $PHPMAILER_LANG['provide_address'] = 'Bitte geben Sie mindestens eine Empfängeradresse an.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-Fehler: Die folgenden Empfänger sind nicht korrekt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php index 7109641e49..339ee5753b 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php @@ -1,25 +1,33 @@ <?php + /** * Greek PHPMailer language file: refer to English translation for definitive list * @package PHPMailer */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σÏνδεσης στον SMTP-Host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.'; -$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει πεÏιεχόμενο .'; -$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: '; -$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: '; -$PHPMAILER_LANG['file_access'] = 'Αδυναμία Ï€Ïοσπέλασης του αÏχείου: '; -$PHPMAILER_LANG['file_open'] = 'Σφάλμα ΑÏχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αÏχείου: '; -$PHPMAILER_LANG['from_failed'] = 'Η παÏακάτω διεÏθυνση αποστολέα δεν είναι σωστή: '; -$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.'; -$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεÏθυνση δεν είναι έγκυÏη: '; +$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.'; +$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χÏησιμοποιείτε παÏουσιάζει σφάλμα που μποÏεί να έχει ως αποτέλεσμα κατεστÏαμένα μηνÏματα. Για να το διοÏθώσετε, αλλάξτε τον Ï„Ïόπο αποστολής σε SMTP, απενεÏγοποιήστε την επιλογή mail.add_x_header στο αÏχείο php.ini, αλλάξτε λειτουÏγικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σÏνδεσης με τον φιλοξενητή SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.'; +$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτÏονική επιστολή δεν έχει πεÏιεχόμενο.'; +$PHPMAILER_LANG['encoding'] = 'Άγνωστη μοÏφή κωδικοποίησης: '; +$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: '; +$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: '; +$PHPMAILER_LANG['file_access'] = 'Αδυναμία Ï€Ïόσβασης στο αÏχείο: '; +$PHPMAILER_LANG['file_open'] = 'Σφάλμα ΑÏχείου: Αδυναμία ανοίγματος αÏχείου: '; +$PHPMAILER_LANG['from_failed'] = 'Η ακόλουθη διεÏθυνση αποστολέα δεν είναι σωστή: '; +$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης συνάÏτησης Mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Μη έγκυÏη διεÏθυνση: '; +$PHPMAILER_LANG['invalid_header'] = 'Μη έγκυÏο όνομα κεφαλίδας ή τιμή'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Μη έγκυÏη εισαγωγή φιλοξενητή: '; +$PHPMAILER_LANG['invalid_host'] = 'Μη έγκυÏος φιλοξενητής: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηÏίζεται.'; -$PHPMAILER_LANG['provide_address'] = 'ΠαÏακαλοÏμε δώστε τουλάχιστον μια e-mail διεÏθυνση παÏαλήπτη.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παÏακάτω διευθÏνσεις παÏαλήπτη δεν είναι έγκυÏες: '; +$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτÏονική διεÏθυνση παÏαλήπτη.'; +$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παÏακάτω διευθÏνσεις παÏαλήπτη δεν είναι έγκυÏες: '; $PHPMAILER_LANG['signing'] = 'Σφάλμα υπογÏαφής: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σÏνδεσης στον SMTP Server.'; -$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'Αδυναμία οÏÎ¹ÏƒÎ¼Î¿Ï Î® αÏχικοποίησης μεταβλητής: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'ΠÏόσθετες πληÏοφοÏίες SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σÏνδεσης SMTP.'; +$PHPMAILER_LANG['smtp_detail'] = 'ΛεπτομέÏεια: '; +$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Αδυναμία οÏÎ¹ÏƒÎ¼Î¿Ï Î® επαναφοÏάς μεταβλητής: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php index 5ca6cb7095..fa8c2c1758 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php @@ -1,4 +1,5 @@ <?php + /** * Esperanto PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index f2c4e8316c..4e74bfb7b8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -1,26 +1,36 @@ <?php + /** * Spanish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Matt Sturdy <matt.sturdy@gmail.com> + * @author Crystopher Glodzienski Cardoso <crystopher.glodzienski@gmail.com> + * @author Daniel Cruz <danicruz0415@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; +$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP está afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.'; $PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.'; $PHPMAILER_LANG['encoding'] = 'Codificación desconocida: '; $PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; $PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; $PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; $PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; $PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; $PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; $PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; $PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; $PHPMAILER_LANG['signing'] = 'Error al firmar: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalle: '; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php index 7e06da13e6..93addc9e33 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php @@ -1,4 +1,5 @@ <?php + /** * Estonian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php index 8aa0ad2218..295a47f95c 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php @@ -1,4 +1,5 @@ <?php + /** * Persian/Farsi PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php index ec4e752349..6d1e637390 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -1,4 +1,5 @@ <?php + /** * Finnish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -19,7 +20,6 @@ $PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.'; $PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähk&ouml;postiosoite.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.'; -$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php index 68cdef1d09..b30f052014 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php @@ -1,4 +1,5 @@ <?php + /** * Faroese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index af68c92368..a6d582d833 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -1,29 +1,36 @@ <?php + /** * French PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * Some French punctuation requires a thin non-breaking space (U+202F) character before it, * for example before a colon or exclamation mark. * There is one of these characters between these quotes: " " - * @see http://unicode.org/udhr/n/notes_fra.html */ -$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l\'authentification.'; +$PHPMAILER_LANG['authenticate'] = 'Erreur SMTP : échec de l’authentification.'; +$PHPMAILER_LANG['buggy_php'] = 'Votre version de PHP est affectée par un bug qui peut entraîner des messages corrompus. Pour résoudre ce problème, passez à l’envoi par SMTP, désactivez l’option mail.add_x_header dans le fichier php.ini, passez à MacOS ou Linux, ou passez PHP à la version 7.0.17+ ou 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Erreur SMTP : impossible de se connecter au serveur SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erreur SMTP : données incorrectes.'; $PHPMAILER_LANG['empty_message'] = 'Corps du message vide.'; $PHPMAILER_LANG['encoding'] = 'Encodage inconnu : '; -$PHPMAILER_LANG['execute'] = 'Impossible de lancer l\'exécution : '; -$PHPMAILER_LANG['file_access'] = 'Impossible d\'accéder au fichier : '; +$PHPMAILER_LANG['execute'] = 'Impossible de lancer l’exécution : '; +$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; +$PHPMAILER_LANG['file_access'] = 'Impossible d’accéder au fichier : '; $PHPMAILER_LANG['file_open'] = 'Ouverture du fichier impossible : '; -$PHPMAILER_LANG['from_failed'] = 'L\'adresse d\'expéditeur suivante a échoué : '; -$PHPMAILER_LANG['instantiate'] = 'Impossible d\'instancier la fonction mail.'; -$PHPMAILER_LANG['invalid_address'] = 'L\'adresse courriel n\'est pas valide : '; +$PHPMAILER_LANG['from_failed'] = 'L’adresse d’expéditeur suivante a échoué : '; +$PHPMAILER_LANG['instantiate'] = 'Impossible d’instancier la fonction mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Adresse courriel non valide : '; +$PHPMAILER_LANG['invalid_header'] = 'Nom ou valeur de l’en-tête non valide'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Entrée d’hôte non valide : '; +$PHPMAILER_LANG['invalid_host'] = 'Hôte non valide : '; $PHPMAILER_LANG['mailer_not_supported'] = ' client de messagerie non supporté.'; $PHPMAILER_LANG['provide_address'] = 'Vous devez fournir au moins une adresse de destinataire.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants sont en erreur : '; +$PHPMAILER_LANG['recipients_failed'] = 'Erreur SMTP : les destinataires suivants ont échoué : '; $PHPMAILER_LANG['signing'] = 'Erreur de signature : '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Échec de la connexion SMTP.'; +$PHPMAILER_LANG['smtp_code'] = 'Code SMTP : '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informations supplémentaires SMTP : '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué.'; +$PHPMAILER_LANG['smtp_detail'] = 'Détails : '; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; -$PHPMAILER_LANG['variable_set'] = 'Impossible d\'initialiser ou de réinitialiser une variable : '; -$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; +$PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php index 9b4ce4d8de..3f3ab37609 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php @@ -1,4 +1,5 @@ <?php + /** * Galician PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php index 70eb717578..b123aa5fc0 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php @@ -1,4 +1,5 @@ <?php + /** * Hebrew PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php index 607a5ee3f9..d2856e057b 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php @@ -1,26 +1,35 @@ <?php + /** * Hindi PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Yash Karanke <mr.karanke@gmail.com> + * Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com> */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: पà¥à¤°à¤¾à¤®à¤¾à¤£à¤¿à¤•ता की जांच नहीं हो सका। '; +$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संसà¥à¤•रण à¤à¤• बग से पà¥à¤°à¤­à¤¾à¤µà¤¿à¤¤ है जिसके परिणामसà¥à¤µà¤°à¥‚प संदेश दूषित हो सकते हैं. इसे ठीक करने हेतà¥, भेजने के लिठSMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकलà¥à¤ª को अकà¥à¤·à¤® करें, MacOS या Linux पर जाà¤, या अपने PHP संसà¥à¤•रण को 7.0.17+ या 7.1.3+ बदले.'; $PHPMAILER_LANG['connect_host'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: SMTP सरà¥à¤µà¤° से कनेकà¥à¤Ÿ नहीं हो सका। '; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: डेटा सà¥à¤µà¥€à¤•ार नहीं किया जाता है। '; $PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; $PHPMAILER_LANG['encoding'] = 'अजà¥à¤žà¤¾à¤¤ à¤à¤¨à¥à¤•ोडिंग पà¥à¤°à¤•ार। '; $PHPMAILER_LANG['execute'] = 'आदेश को निषà¥à¤ªà¤¾à¤¦à¤¿à¤¤ करने में विफल। '; +$PHPMAILER_LANG['extension_missing'] = 'à¤à¤•à¥à¤¸à¤Ÿà¥‡à¤¨à¥à¤·à¤¨ गायब है: '; $PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलबà¥à¤§ नहीं है। '; $PHPMAILER_LANG['file_open'] = 'फ़ाइल तà¥à¤°à¥à¤Ÿà¤¿: फाइल को खोला नहीं जा सका। '; $PHPMAILER_LANG['from_failed'] = 'पà¥à¤°à¥‡à¤·à¤• का पता गलत है। '; $PHPMAILER_LANG['instantiate'] = 'मेल फ़ंकà¥à¤¶à¤¨ कॉल नहीं कर सकता है।'; $PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; +$PHPMAILER_LANG['invalid_header'] = 'अमानà¥à¤¯ हेडर नाम या मान'; +$PHPMAILER_LANG['invalid_hostentry'] = 'अमानà¥à¤¯ hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'अमानà¥à¤¯ होसà¥à¤Ÿ: '; $PHPMAILER_LANG['mailer_not_supported'] = 'मेल सरà¥à¤µà¤° के साथ काम नहीं करता है। '; $PHPMAILER_LANG['provide_address'] = 'आपको कम से कम à¤à¤• पà¥à¤°à¤¾à¤ªà¥à¤¤à¤•रà¥à¤¤à¤¾ का ई-मेल पता पà¥à¤°à¤¦à¤¾à¤¨ करना होगा।'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP तà¥à¤°à¥à¤Ÿà¤¿: निमà¥à¤¨ पà¥à¤°à¤¾à¤ªà¥à¤¤à¤•रà¥à¤¤à¤¾à¤“ं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप तà¥à¤°à¥à¤Ÿà¤¿:। '; +$PHPMAILER_LANG['signing'] = 'साइनअप तà¥à¤°à¥à¤Ÿà¤¿: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिकà¥à¤¤ SMTP जानकारी: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंकà¥à¤¶à¤¨ विफल हà¥à¤†à¥¤ '; +$PHPMAILER_LANG['smtp_detail'] = 'विवरण: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP सरà¥à¤µà¤° तà¥à¤°à¥à¤Ÿà¤¿à¥¤ '; $PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; -$PHPMAILER_LANG['extension_missing'] = 'à¤à¤•à¥à¤¸à¤Ÿà¥‡à¤¨à¥à¤·à¤¨ गायब है: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php index 3822920add..cacb6c37e5 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php @@ -1,4 +1,5 @@ <?php + /** * Croatian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php index 196cddc224..e6b58b0dbe 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php @@ -1,4 +1,5 @@ <?php + /** * Hungarian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-am.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php similarity index 99% rename from vendor/phpmailer/phpmailer/language/phpmailer.lang-am.php rename to vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php index ff2a969501..bb05d2d923 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-am.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php @@ -1,10 +1,11 @@ <?php + /** * Armenian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Hrayr Grigoryan <hrayr@bits.am> */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ½Õ¿Õ¸Ö‚Õ£Õ¥Õ¬ Õ«Õ½Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨.'; $PHPMAILER_LANG['connect_host'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¹Õ°Õ¡Õ»Õ¸Õ²Õ¾Õ¥Ö Õ¯Õ¡Õº Õ°Õ¡Õ½Õ¿Õ¡Õ¿Õ¥Õ¬ SMTP Õ½Õ¥Ö€Õ¾Õ¥Ö€Õ« Õ°Õ¥Õ¿.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP -Õ« Õ½Õ­Õ¡Õ¬: Õ¿Õ¾ÕµÕ¡Õ¬Õ¶Õ¥Ö€Õ¨ Õ¨Õ¶Õ¤Õ¸Ö‚Õ¶Õ¾Õ¡Õ® Õ¹Õ¥Õ¶.'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php index ba6ca5faca..212a11f135 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php @@ -1,9 +1,11 @@ <?php + /** * Indonesian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Cecep Prawiro <cecep.prawiro@gmail.com> * @author @januridp + * @author Ian Mustafa <mail@ianmustafa.com> */ $PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.'; @@ -11,17 +13,19 @@ $PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.'; $PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong'; $PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses : '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas : '; -$PHPMAILER_LANG['file_open'] = 'Kesalahan File: Berkas tidak dapat dibuka : '; -$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan : '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel'; -$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak benar : '; -$PHPMAILER_LANG['provide_address'] = 'Harus disediakan minimal satu alamat tujuan'; +$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: '; +$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: '; +$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: '; +$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: '; +$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.'; +$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: '; +$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: '; +$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung'; -$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menghasilkan kesalahan : '; -$PHPMAILER_LANG['signing'] = 'Kesalahan dalam tanda tangan : '; +$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: '; +$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP : '; -$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variable : '; -$PHPMAILER_LANG['extension_missing'] = 'Ekstensi hilang: '; +$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: '; +$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php index e67b6f72c6..08a6b73331 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php @@ -1,4 +1,5 @@ <?php + /** * Italian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index 2d778728d7..d01869cec8 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -1,27 +1,37 @@ <?php + /** * Japanese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Mitsuhiro Yoshida <http://mitstek.com/> + * @author Mitsuhiro Yoshida <https://mitstek.com> * @author Yoshi Sakai <http://bluemooninc.jp/> + * @author Arisophy <https://github.com/arisophy/> + * @author ARAKI Musashi <https://github.com/arakim/> */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: èªè¨¼ã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; +$PHPMAILER_LANG['buggy_php'] = 'ã”利用ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®PHPã«ã¯ä¸å…·åˆãŒã‚りã€ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ãŒç ´æã™ã‚‹ãŠãれãŒã‚りã¾ã™ã€‚å•題ã®è§£æ±ºã¯ä»¥ä¸‹ã®ã„ãšã‚Œã‹ã‚’行ã£ã¦ãã ã•ã„。SMTPã§ã®é€ä¿¡ã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã€‚php.iniã®mail.add_x_headerã‚’offã«ã™ã‚‹ã€‚MacOSã¾ãŸã¯Linuxã«åˆ‡ã‚Šæ›¿ãˆã‚‹ã€‚PHPãƒãƒ¼ã‚¸ãƒ§ãƒ³7.0.17以é™ã¾ãŸã¯7.1.3以é™ã«ã‚¢ãƒƒãƒ—グレードã™ã‚‹ã€‚'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPãƒ›ã‚¹ãƒˆã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸã€‚'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データãŒå—ã‘付ã‘られã¾ã›ã‚“ã§ã—ãŸã€‚'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = 'メール本文ãŒç©ºã§ã™ã€‚'; $PHPMAILER_LANG['encoding'] = '䏿˜Žãªã‚¨ãƒ³ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°: '; $PHPMAILER_LANG['execute'] = '実行ã§ãã¾ã›ã‚“ã§ã—ãŸ: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“: '; $PHPMAILER_LANG['file_access'] = 'ファイルã«ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開ã‘ã¾ã›ã‚“: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録ã™ã‚‹éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ: '; $PHPMAILER_LANG['instantiate'] = 'ãƒ¡ãƒ¼ãƒ«é–¢æ•°ãŒæ­£å¸¸ã«å‹•作ã—ã¾ã›ã‚“ã§ã—ãŸã€‚'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['provide_address'] = 'å°‘ãªãã¨ã‚‚1ã¤ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’ 指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚'; +$PHPMAILER_LANG['invalid_address'] = '䏿­£ãªãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹: '; +$PHPMAILER_LANG['invalid_header'] = '䏿­£ãªãƒ˜ãƒƒãƒ€ãƒ¼åã¾ãŸã¯ãã®å†…容'; +$PHPMAILER_LANG['invalid_hostentry'] = '䏿­£ãªãƒ›ã‚¹ãƒˆã‚¨ãƒ³ãƒˆãƒªãƒ¼: '; +$PHPMAILER_LANG['invalid_host'] = '䏿­£ãªãƒ›ã‚¹ãƒˆ: '; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーãŒã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“。'; +$PHPMAILER_LANG['provide_address'] = 'å°‘ãªãã¨ã‚‚1ã¤ãƒ¡ãƒ¼ãƒ«ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’ 指定ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™ã€‚'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次ã®å—信者アドレス㫠間é•ã„ãŒã‚りã¾ã™: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['signing'] = 'ç½²åエラー: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続ã«å¤±æ•—ã—ã¾ã—ãŸã€‚'; +$PHPMAILER_LANG['smtp_detail'] = '詳細: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーãƒãƒ¼ã‚¨ãƒ©ãƒ¼: '; +$PHPMAILER_LANG['variable_set'] = '変数ãŒå­˜åœ¨ã—ã¾ã›ã‚“: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php index dd1af8abec..51fe403b40 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php @@ -1,4 +1,5 @@ <?php + /** * Georgian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php index 9599fa6819..8c97dd947c 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php @@ -1,4 +1,5 @@ <?php + /** * Korean PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php new file mode 100644 index 0000000000..cf3bda69f2 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php @@ -0,0 +1,27 @@ +<?php + +/** + * Kurdish (Sorani) PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author Halo Salman <halo@home4t.com> + */ + +$PHPMAILER_LANG['authenticate'] = 'Ù‡Û•ÚµÛ•ÛŒ SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە '; +$PHPMAILER_LANG['connect_host'] = 'Ù‡Û•ÚµÛ•ÛŒ SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ù‡Û•ÚµÛ•ÛŒ SMTP: ئەو زانیاریانە قبوڵ نەکرا.'; +$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە'; +$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : '; +$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: '; +$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە ÙØ§ÛŒÙ„Û•Ú©Û•: '; +$PHPMAILER_LANG['file_open'] = 'Ù‡Û•ÚµÛ•ÛŒ Ù¾Û•Ú•Ú¯Û•(ÙØ§ÛŒÙ„): ناتوانرێت بکرێتەوە: '; +$PHPMAILER_LANG['from_failed'] = 'Ù‡Û•ÚµÛ• Ù„Û• ئاستی ناونیشانی نێرەر: '; +$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە Ù¾ÛŽØ´Ú©Û•Ø´ بکرێت.'; +$PHPMAILER_LANG['invalid_address'] = 'نەتوانرا بنێردرێت ØŒ چونکە ناونیشانی ئیمەیڵەکە نادروستە: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' مەیلەر پشتگیری ناکات'; +$PHPMAILER_LANG['provide_address'] = 'دەبێت ناونیشانی ئیمەیڵی لانیکەم یەک وەرگر دابین بکرێت.'; +$PHPMAILER_LANG['recipients_failed'] = ' Ù‡Û•ÚµÛ•ÛŒ SMTP: ئەم هەڵانەی خوارەوەشکستی هێنا Ù„Û• ناردن بۆ هەردووکیان: '; +$PHPMAILER_LANG['signing'] = 'Ù‡Û•ÚµÛ•ÛŒ واژۆ: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect()پەیوەندی شکستی هێنا .'; +$PHPMAILER_LANG['smtp_error'] = 'Ù‡Û•ÚµÛ•ÛŒ ئاستی سێرڤەری SMTP: '; +$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: '; +$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php index 1253a4fdb4..4f115b1c58 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php @@ -1,4 +1,5 @@ <?php + /** * Lithuanian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php index 39bf9a19e2..679b18cf9f 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php @@ -1,4 +1,5 @@ <?php + /** * Latvian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php index f4c7563030..8a94f6a044 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php @@ -1,9 +1,11 @@ <?php + /** * Malagasy PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Hackinet <piyushjha8164@gmail.com> */ + $PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php new file mode 100644 index 0000000000..04d262c724 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php @@ -0,0 +1,27 @@ +<?php + +/** + * Mongolian PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author @wispas + */ + +$PHPMAILER_LANG['authenticate'] = 'Ðлдаа SMTP: Холбогдож чадÑангүй.'; +$PHPMAILER_LANG['connect_host'] = 'Ðлдаа SMTP: SMTP- ÑервертÑй холбогдож болохгүй байна.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Ðлдаа SMTP: зөвшөөрөгдÑөнгүй.'; +$PHPMAILER_LANG['encoding'] = 'Тодорхойгүй кодчилол: '; +$PHPMAILER_LANG['execute'] = 'Коммандыг гүйцÑтгÑÑ… боломжгүй байна: '; +$PHPMAILER_LANG['file_access'] = 'Файлд хандах боломжгүй байна: '; +$PHPMAILER_LANG['file_open'] = 'Файлын алдаа: файлыг нÑÑÑ… боломжгүй байна: '; +$PHPMAILER_LANG['from_failed'] = 'ИлгÑÑгчийн хаÑг буруу байна: '; +$PHPMAILER_LANG['instantiate'] = 'Mail () функцийг ажиллуулах боломжгүй байна.'; +$PHPMAILER_LANG['provide_address'] = 'ХүлÑÑн авагчийн имÑйл хаÑгийг оруулна уу.'; +$PHPMAILER_LANG['mailer_not_supported'] = ' — мÑйл Ñерверийг дÑмжÑÑнгүй.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ðлдаа SMTP: ийм хаÑгийг илгÑÑж чадÑангүй: '; +$PHPMAILER_LANG['empty_message'] = 'ХооÑон меÑÑÑж'; +$PHPMAILER_LANG['invalid_address'] = 'И-МÑйл буруу форматтай тул илгÑÑÑ… боломжгүй: '; +$PHPMAILER_LANG['signing'] = 'Гарын Ò¯Ñгийн алдаа: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ÑервертÑй холбогдоход алдаа гарлаа'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP Ñерверийн алдаа: '; +$PHPMAILER_LANG['variable_set'] = 'ХувьÑагчийг тохируулах ÑÑвÑл дахин тохируулах боломжгүй байна: '; +$PHPMAILER_LANG['extension_missing'] = 'Өргөтгөл байхгүй: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php index f12a6ad486..71db338343 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php @@ -1,4 +1,5 @@ <?php + /** * Malaysian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php index 97403e73ca..c9621a164f 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php @@ -1,25 +1,33 @@ <?php + /** * Norwegian BokmÃ¥l PHPMailer language file: refer to English translation for definitive list * @package PHPMailer */ -$PHPMAILER_LANG['authenticate'] = 'SMTP Feil: Kunne ikke autentisere.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Feil: Kunne ikke koble til SMTP tjener.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Feil: Datainnhold ikke akseptert.'; -$PHPMAILER_LANG['empty_message'] = 'Meldingsinnhold mangler'; -$PHPMAILER_LANG['encoding'] = 'Ukjent koding: '; -$PHPMAILER_LANG['execute'] = 'Kunne ikke utføre: '; -$PHPMAILER_LANG['file_access'] = 'FÃ¥r ikke tilgang til filen: '; -$PHPMAILER_LANG['file_open'] = 'Fil Feil: Kunne ikke Ã¥pne filen: '; -$PHPMAILER_LANG['from_failed'] = 'Følgende FrÃ¥ adresse feilet: '; -$PHPMAILER_LANG['instantiate'] = 'Kunne ikke initialisere post funksjon.'; -$PHPMAILER_LANG['invalid_address'] = 'Ugyldig adresse: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' sender er ikke støttet.'; -$PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ opppgi minst en mottakeradresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottakeradresse feilet: '; -$PHPMAILER_LANG['signing'] = 'Signering Feil: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() feilet.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server feil: '; -$PHPMAILER_LANG['variable_set'] = 'Kan ikke skrive eller omskrive variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Utvidelse mangler: '; + $PHPMAILER_LANG['authenticate'] = 'SMTP-feil: Kunne ikke autentiseres.'; + $PHPMAILER_LANG['buggy_php'] = 'Din versjon av PHP er berørt av en feil som kan føre til ødelagte meldinger. For Ã¥ løse problemet kan du bytte til SMTP, deaktivere alternativet mail.add_x_header i php.ini, bytte til MacOS eller Linux eller oppgradere PHP til versjon 7.0.17+ eller 7.1.3+.'; + $PHPMAILER_LANG['connect_host'] = 'SMTP-feil: Kunne ikke koble til SMTP-vert.'; + $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-feil: data ikke akseptert.'; + $PHPMAILER_LANG['empty_message'] = 'Meldingstekst mangler'; + $PHPMAILER_LANG['encoding'] = 'Ukjent koding: '; + $PHPMAILER_LANG['execute'] = 'Kunne ikke utføres: '; + $PHPMAILER_LANG['extension_missing'] = 'Utvidelse mangler: '; + $PHPMAILER_LANG['file_access'] = 'Kunne ikke fÃ¥ tilgang til filen: '; + $PHPMAILER_LANG['file_open'] = 'Feil i fil: Kunne ikke Ã¥pne filen: '; + $PHPMAILER_LANG['from_failed'] = 'Følgende Fra-adresse mislyktes: '; + $PHPMAILER_LANG['instantiate'] = 'Kunne ikke instansiere e-postfunksjonen.'; + $PHPMAILER_LANG['invalid_address'] = 'Ugyldig adresse: '; + $PHPMAILER_LANG['invalid_header'] = 'Ugyldig headernavn eller verdi'; + $PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig vertsinngang: '; + $PHPMAILER_LANG['invalid_host'] = 'Ugyldig vert: '; + $PHPMAILER_LANG['mailer_not_supported'] = ' sender er ikke støttet.'; + $PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ oppgi minst én mottaker-e-postadresse.'; + $PHPMAILER_LANG['recipients_failed'] = 'SMTP Feil: Følgende mottakeradresse feilet: '; + $PHPMAILER_LANG['signing'] = 'Signeringsfeil: '; + $PHPMAILER_LANG['smtp_code'] = 'SMTP-kode: '; + $PHPMAILER_LANG['smtp_code_ex'] = 'Ytterligere SMTP-info: '; + $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() mislyktes.'; + $PHPMAILER_LANG['smtp_detail'] = 'Detaljer: '; + $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfeil: '; + $PHPMAILER_LANG['variable_set'] = 'Kan ikke angi eller tilbakestille variabel: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php index f4d0e7cd3b..8229d5e257 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php @@ -1,4 +1,5 @@ <?php + /** * Dutch PHPMailer language file: refer to PHPMailer.php for definitive list. * @package PHPMailer @@ -6,23 +7,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; $PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; $PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; $PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; $PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; $PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; $PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; $PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; $PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; $PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; $PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; $PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; $PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; $PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php index 3da0dee91f..cb7b2c2107 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -1,26 +1,33 @@ <?php + /** * Polish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer */ $PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzić uwierzytelnienia.'; +$PHPMAILER_LANG['buggy_php'] = 'Twoja wersja PHP zawiera błąd, który może powodować uszkodzenie wiadomoÅ›ci. Aby go naprawić, przełącz siÄ™ na wysyÅ‚anie za pomocÄ… SMTP, wyłącz opcjÄ™ mail.add_x_header w php.ini, przełącz siÄ™ na MacOS lub Linux lub zaktualizuj PHP do wersji 7.0.17+ lub 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć siÄ™ z wybranym hostem.'; $PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostaÅ‚y przyjÄ™te.'; $PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.'; -$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: '; +$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: '; $PHPMAILER_LANG['execute'] = 'Nie można uruchomić: '; +$PHPMAILER_LANG['extension_missing'] = 'BrakujÄ…ce rozszerzenie: '; $PHPMAILER_LANG['file_access'] = 'Brak dostÄ™pu do pliku: '; $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; -$PHPMAILER_LANG['from_failed'] = 'NastÄ™pujÄ…cy adres Nadawcy jest nieprawidÅ‚owy: '; +$PHPMAILER_LANG['from_failed'] = 'NastÄ™pujÄ…cy adres nadawcy jest nieprawidÅ‚owy lub nie istnieje: '; $PHPMAILER_LANG['instantiate'] = 'Nie można wywoÅ‚ać funkcji mail(). Sprawdź konfiguracjÄ™ serwera.'; -$PHPMAILER_LANG['invalid_address'] = 'Nie można wysÅ‚ać wiadomoÅ›ci, '. - 'nastÄ™pujÄ…cy adres Odbiorcy jest nieprawidÅ‚owy: '; -$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidÅ‚owy adres email Odbiorcy.'; +$PHPMAILER_LANG['invalid_address'] = 'Nie można wysÅ‚ać wiadomoÅ›ci, ' . 'nastÄ™pujÄ…cy adres odbiorcy jest nieprawidÅ‚owy lub nie istnieje: '; +$PHPMAILER_LANG['invalid_header'] = 'NieprawidÅ‚owa nazwa lub wartość nagłówka'; +$PHPMAILER_LANG['invalid_hostentry'] = 'NieprawidÅ‚owy wpis hosta: '; +$PHPMAILER_LANG['invalid_host'] = 'NieprawidÅ‚owy host: '; +$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidÅ‚owy adres email odbiorcy.'; $PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyÅ‚ki wiadomoÅ›ci nie jest obsÅ‚ugiwana.'; -$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: NastÄ™pujÄ…cy odbiorcy sÄ… nieprawidÅ‚owi: '; +$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: NastÄ™pujÄ…cy odbiorcy sÄ… nieprawidÅ‚owi lub nie istniejÄ…: '; $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomoÅ›ci: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakoÅ„czone niepowodzeniem.'; +$PHPMAILER_LANG['smtp_code'] = 'Kod SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatkowe informacje SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'WywoÅ‚anie funkcji SMTP Connect() zostaÅ‚o zakoÅ„czone niepowodzeniem.'; +$PHPMAILER_LANG['smtp_detail'] = 'Szczegóły: '; $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: '; -$PHPMAILER_LANG['extension_missing'] = 'BrakujÄ…ce rozszerzenie: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php index f365d5d0b4..79a6802679 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php @@ -1,26 +1,34 @@ <?php + /** * Portuguese (European) PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Jonadabe <jonadabe@hotmail.com> + * @author João Vieira <mail@joaovieira.eu> */ -$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; -$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; +$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.'; +$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.'; +$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.'; +$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.'; +$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; -$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; -$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; +$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: '; +$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: '; +$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: '; +$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; +$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: '; +$PHPMAILER_LANG['invalid_host'] = 'Host inválido: '; +$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.'; +$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: '; $PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: '; +$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php index 62d692d426..5239865a6f 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php @@ -1,4 +1,5 @@ <?php + /** * Brazilian Portuguese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -6,24 +7,32 @@ * @author Lucas Guimarães <lucas@lucasguimaraes.com> * @author Phelipe Alves <phelipealvesdesouza@gmail.com> * @author Fabio Beneditto <fabiobeneditto@gmail.com> + * @author Geidson Benício Coelho <geidsonc@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; +$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ '; $PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.'; $PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.'; $PHPMAILER_LANG['empty_message'] = 'Mensagem vazia'; $PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; $PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; $PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: '; $PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: '; $PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: '; $PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.'; $PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: '; +$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido'; +$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: '; +$PHPMAILER_LANG['invalid_host'] = 'host inválido: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; $PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.'; $PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: '; $PHPMAILER_LANG['signing'] = 'Erro de Assinatura: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; +$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: '; +$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php index fa100eaa20..45bef91553 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php @@ -1,26 +1,33 @@ <?php + /** * Romanian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer - * @author Alex Florea <alecz.fia@gmail.com> */ $PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eÈ™uat.'; +$PHPMAILER_LANG['buggy_php'] = 'Versiunea instalată de PHP este afectată de o problemă care poate duce la coruperea mesajelor Pentru a preveni această problemă, folosiÈ›i SMTP, dezactivaÈ›i opÈ›iunea mail.add_x_header din php.ini, folosiÈ›i MacOS/Linux sau actualizaÈ›i versiunea de PHP la 7.0.17+ sau 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Eroare SMTP: Conectarea la serverul SMTP a eÈ™uat.'; $PHPMAILER_LANG['data_not_accepted'] = 'Eroare SMTP: Datele nu au fost acceptate.'; $PHPMAILER_LANG['empty_message'] = 'Mesajul este gol.'; $PHPMAILER_LANG['encoding'] = 'Encodare necunoscută: '; $PHPMAILER_LANG['execute'] = 'Nu se poate executa următoarea comandă: '; +$PHPMAILER_LANG['extension_missing'] = 'LipseÈ™te extensia: '; $PHPMAILER_LANG['file_access'] = 'Nu se poate accesa următorul fiÈ™ier: '; $PHPMAILER_LANG['file_open'] = 'Eroare fiÈ™ier: Nu se poate deschide următorul fiÈ™ier: '; $PHPMAILER_LANG['from_failed'] = 'Următoarele adrese From au dat eroare: '; $PHPMAILER_LANG['instantiate'] = 'FuncÈ›ia mail nu a putut fi iniÈ›ializată.'; $PHPMAILER_LANG['invalid_address'] = 'Adresa de email nu este validă: '; +$PHPMAILER_LANG['invalid_header'] = 'Numele sau valoarea header-ului nu este validă: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry invalid: '; +$PHPMAILER_LANG['invalid_host'] = 'Host invalid: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer nu este suportat.'; $PHPMAILER_LANG['provide_address'] = 'Trebuie să adăugaÈ›i cel puÈ›in o adresă de email.'; $PHPMAILER_LANG['recipients_failed'] = 'Eroare SMTP: Următoarele adrese de email au eÈ™uat: '; $PHPMAILER_LANG['signing'] = 'A aparut o problemă la semnarea emailului. '; +$PHPMAILER_LANG['smtp_code'] = 'Cod SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'InformaÈ›ii SMTP adiÈ›ionale: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Conectarea la serverul SMTP a eÈ™uat.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalii SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'Eroare server SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nu se poate seta/reseta variabila. '; -$PHPMAILER_LANG['extension_missing'] = 'LipseÈ™te extensia: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php index 720e9a116d..8013f37c4d 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php @@ -1,27 +1,36 @@ <?php + /** * Russian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Alexey Chumakov <alex@chumakov.ru> * @author Foster Snowhill <i18n@forstwoof.ru> + * @author ProjectSoft <projectsoft2009@yandex.ru> */ -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; +$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалоÑÑŒ пройти аутентификацию.'; +$PHPMAILER_LANG['buggy_php'] = 'Ð’ вашей верÑии PHP еÑть ошибка, ÐºÐ¾Ñ‚Ð¾Ñ€Ð°Ñ Ð¼Ð¾Ð¶ÐµÑ‚ привеÑти к повреждению Ñообщений. Чтобы иÑправить, переключитеÑÑŒ на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитеÑÑŒ на MacOS или Linux или обновите PHP до верÑии 7.0.17+ или 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удаетÑÑ Ð¿Ð¾Ð´ÐºÐ»ÑŽÑ‡Ð¸Ñ‚ÑŒÑÑ Ðº SMTP-Ñерверу.'; $PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не принÑты.'; +$PHPMAILER_LANG['empty_message'] = 'ПуÑтое Ñообщение'; $PHPMAILER_LANG['encoding'] = 'ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²ÐºÐ°: '; $PHPMAILER_LANG['execute'] = 'Ðевозможно выполнить команду: '; +$PHPMAILER_LANG['extension_missing'] = 'РаÑширение отÑутÑтвует: '; $PHPMAILER_LANG['file_access'] = 'Ðет доÑтупа к файлу: '; $PHPMAILER_LANG['file_open'] = 'Ð¤Ð°Ð¹Ð»Ð¾Ð²Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°: не удаётÑÑ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚ÑŒ файл: '; $PHPMAILER_LANG['from_failed'] = 'Ðеверный Ð°Ð´Ñ€ÐµÑ Ð¾Ñ‚Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÐµÐ»Ñ: '; $PHPMAILER_LANG['instantiate'] = 'Ðевозможно запуÑтить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'ПожалуйÑта, введите Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один email-Ð°Ð´Ñ€ÐµÑ Ð¿Ð¾Ð»ÑƒÑ‡Ð°Ñ‚ÐµÐ»Ñ.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый Ñервер не поддерживаетÑÑ.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалаÑÑŒ отправка таким адреÑатам: '; -$PHPMAILER_LANG['empty_message'] = 'ПуÑтое Ñообщение'; $PHPMAILER_LANG['invalid_address'] = 'Ðе отправлено из-за неправильного формата email-адреÑа: '; +$PHPMAILER_LANG['invalid_header'] = 'Ðеверное Ð¸Ð¼Ñ Ð¸Ð»Ð¸ значение заголовка'; +$PHPMAILER_LANG['invalid_hostentry'] = 'ÐÐµÐ²ÐµÑ€Ð½Ð°Ñ Ð·Ð°Ð¿Ð¸ÑÑŒ хоÑта: '; +$PHPMAILER_LANG['invalid_host'] = 'Ðеверный хоÑÑ‚: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый Ñервер не поддерживаетÑÑ.'; +$PHPMAILER_LANG['provide_address'] = 'Ð’Ñ‹ должны указать Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один Ð°Ð´Ñ€ÐµÑ Ñлектронной почты получателÑ.'; +$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка Ñледующих получателей: '; $PHPMAILER_LANG['signing'] = 'Ошибка подпиÑи: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ SMTP-Ñервером'; +$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ SMTP: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ SMTP-Ñервером.'; +$PHPMAILER_LANG['smtp_detail'] = 'Детали: '; $PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-Ñервера: '; $PHPMAILER_LANG['variable_set'] = 'Ðевозможно уÑтановить или ÑброÑить переменную: '; -$PHPMAILER_LANG['extension_missing'] = 'РаÑширение отÑутÑтвует: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php new file mode 100644 index 0000000000..dce502aa02 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php @@ -0,0 +1,34 @@ +<?php + +/** + * Sinhalese PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author Ayesh Karunaratne <ayesh@aye.sh> + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP දà·à·‚ය: සත්â€à¶ºà·à¶´à¶±à¶º à¶…à·ƒà·à¶»à·Šà¶®à¶š විය.'; +$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දà·à·‚යක් නිස෠email පණිවිඩ දà·à·‚ සහගත වීමේ à·„à·à¶šà·’යà·à·€à¶šà·Š ඇත. මෙය විසදීම සදහ෠SMTP à¶·à·à·€à·’ත෠කිරීම, mail.add_x_header INI setting à¶‘à¶š à¶…à¶šà·Šâ€à¶»à·“ය කිරීම, MacOS à·„à· Linux වලට මà·à¶»à·” වීම, හ෠ඔබගේ PHP version à¶‘à¶š 7.0.17+ à·„à· 7.1.3+ වලට අලුත් කිරීම කරගන්න.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP දà·à·‚ය: සම්බන්ධ වීමට නොහà·à¶šà·’ විය.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දà·à·‚ය: දත්ත පිළිගනු නොලà·à¶¶à·š.'; +$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්'; +$PHPMAILER_LANG['encoding'] = 'නොදන්න෠කේතනය: '; +$PHPMAILER_LANG['execute'] = 'à¶šà·Šâ€à¶»à·’යà·à¶­à·Šà¶¸à¶š à¶šà·… නොහà·à¶šà·’ විය: '; +$PHPMAILER_LANG['extension_missing'] = 'Extension à¶‘à¶š නොමà·à¶­: '; +$PHPMAILER_LANG['file_access'] = 'File à¶‘à¶šà¶§ à¶´à·Šâ€à¶»à·€à·šà· විය නොහà·à¶šà·’ විය: '; +$PHPMAILER_LANG['file_open'] = 'File දà·à·‚ය: File à¶‘à¶š විවෘත à¶šà·… නොහà·à¶š: '; +$PHPMAILER_LANG['from_failed'] = 'à¶´à·„à¶­ From ලිපිනයන් à¶…à·ƒà·à¶»à·Šà¶®à¶š විය: '; +$PHPMAILER_LANG['instantiate'] = 'mail function à¶‘à¶š à¶šà·Šâ€à¶»à·’යà·à¶­à·Šà¶¸à¶š à¶šà·… නොහà·à¶š.'; +$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: '; +$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header à¶±à·à¶¸à¶ºà¶šà·Š හ෠අගයක්'; +$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry à¶‘à¶šà¶šà·Š: '; +$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host à¶‘à¶šà¶šà·Š: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහà·à¶º නොදක්වයි.'; +$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම à·€à·à¶ºà·™à¶±à·Š à¶‘à¶šà·Š ලබන්නෙකුගේ ඊමේල් ලිපිනයක් à·ƒà·à¶´à¶ºà·’ය යුතුය.'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP දà·à·‚ය: à¶´à·„à¶­ ලබන්නන් අසමත් විය: '; +$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දà·à·‚ය: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය à¶…à·ƒà·à¶»à·Šà¶®à¶š විය.'; +$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP දà·à·‚ය: '; +$PHPMAILER_LANG['variable_set'] = 'Variable à¶‘à¶š à·ƒà·à¶šà·ƒà·“මට à·„à· à¶±à·à·€à¶­ à·ƒà·à¶šà·ƒà·“මට නොහà·à¶š: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php index 69cfb0fc1d..028f5bc496 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php @@ -1,4 +1,5 @@ <?php + /** * Slovak PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -17,6 +18,8 @@ $PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: '; $PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriÅ¥ inÅ¡tancia emailovej funkcie.'; $PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: '; +$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: '; $PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.'; $PHPMAILER_LANG['provide_address'] = 'Musíte zadaÅ¥ aspoň jednu emailovú adresu príjemcu.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php index 1e3cb7fa9b..3e00c25963 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php @@ -1,27 +1,36 @@ <?php + /** * Slovene PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Klemen TuÅ¡ar <techouse@gmail.com> * @author Filip Å  <projects@filips.si> + * @author Blaž Oražem <blaz@orazem.si> */ $PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; +$PHPMAILER_LANG['buggy_php'] = 'Na vaÅ¡o PHP razliÄico vpliva napaka, ki lahko povzroÄi poÅ¡kodovana sporoÄila. ÄŒe želite težavo odpraviti, preklopite na poÅ¡iljanje prek SMTP, onemogoÄite možnost mail.add_x_header v vaÅ¡i php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vaÅ¡o PHP zaliÄico na 7.0.17+ ali 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavraÄa podatke.'; $PHPMAILER_LANG['empty_message'] = 'E-poÅ¡tno sporoÄilo nima vsebine.'; $PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: '; $PHPMAILER_LANG['execute'] = 'Operacija ni uspela: '; +$PHPMAILER_LANG['extension_missing'] = 'ManjkajoÄa razÅ¡iritev: '; $PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: '; $PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: '; $PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov poÅ¡iljatelja: '; $PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.'; $PHPMAILER_LANG['invalid_address'] = 'E-poÅ¡tno sporoÄilo ni bilo poslano. E-naslov je neveljaven: '; +$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: '; +$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; -$PHPMAILER_LANG['provide_address'] = 'Prosim vnesite vsaj enega naslovnika.'; +$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: SledeÄi naslovniki so neveljavni: '; $PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; +$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: '; $PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; $PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; -$PHPMAILER_LANG['extension_missing'] = 'ManjkajoÄa razÅ¡iritev: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php index 34c1e182a0..0b5280f75e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php @@ -1,4 +1,5 @@ <?php + /** * Serbian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php new file mode 100644 index 0000000000..62138329ac --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php @@ -0,0 +1,28 @@ +<?php + +/** + * Serbian PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author ÐлекÑандар Јевремовић <ajevremovic@gmail.com> + * @author MiloÅ¡ Milanović <mmilanovic016@gmail.com> + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP greÅ¡ka: autentifikacija nije uspela.'; +$PHPMAILER_LANG['connect_host'] = 'SMTP greÅ¡ka: povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greÅ¡ka: podaci nisu prihvaćeni.'; +$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; +$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: '; +$PHPMAILER_LANG['execute'] = 'Nije moguće izvrÅ¡iti naredbu: '; +$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: '; +$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: '; +$PHPMAILER_LANG['from_failed'] = 'SMTP greÅ¡ka: slanje sa sledećih adresa nije uspelo: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP greÅ¡ka: slanje na sledeće adrese nije uspelo: '; +$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.'; +$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: '; +$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.'; +$PHPMAILER_LANG['provide_address'] = 'DefiniÅ¡ite bar jednu adresu primaoca.'; +$PHPMAILER_LANG['signing'] = 'GreÅ¡ka prilikom prijave: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.'; +$PHPMAILER_LANG['smtp_error'] = 'GreÅ¡ka SMTP servera: '; +$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: '; +$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proÅ¡irenje: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php index 4408e63eb0..9872c19219 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php @@ -1,4 +1,5 @@ <?php + /** * Swedish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -19,8 +20,8 @@ $PHPMAILER_LANG['provide_address'] = 'Du mÃ¥ste ange minst en mottagares e-postadress.'; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; -$PHPMAILER_LANG['signing'] = 'Signerings fel: '; +$PHPMAILER_LANG['signing'] = 'Signeringsfel: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server fel: '; +$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; $PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller Ã¥terställa variabel: '; $PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php index ed51d4c601..d15bed1c83 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php @@ -1,27 +1,28 @@ <?php + /** * Tagalog PHPMailer language file: refer to English translation for definitive list * * @package PHPMailer - * @author Adriane Justine Tan <adrianetan12@gmail.com> + * @author Adriane Justine Tan <eidoriantan@gmail.com> */ - + $PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.'; $PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi maaaring matatanggap.'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.'; $PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe'; $PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: '; $PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: '; $PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: '; -$PHPMAILER_LANG['file_open'] = 'Hindi mabuksan ang file: '; +$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: '; $PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: '; -$PHPMAILER_LANG['instantiate'] = 'Hindi maaaring magbigay ng institusyon ang mail'; +$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.'; $PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: '; -$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado'; -$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap'; +$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.'; +$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: '; -$PHPMAILER_LANG['signing'] = 'Hindi ma-sign'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo'; -$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo'; -$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda ang mga variables: '; -$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension'; +$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.'; +$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: '; +$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: '; +$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php index cfe8eaae24..3c45bc1c35 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php @@ -1,4 +1,5 @@ <?php + /** * Turkish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -10,21 +11,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP Hatası: Oturum açılamadı.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP sürümünüz iletilerin bozulmasına neden olabilecek bir hatadan etkileniyor. Bunu düzeltmek için, SMTP kullanarak göndermeye geçin, mail.add_x_header seçeneÄŸini devre dışı bırakın php.ini dosyanızdaki mail.add_x_header seçeneÄŸini devre dışı bırakın, MacOS veya Linux geçin veya PHP sürümünü 7.0.17+ veya 7.1.3+ sürümüne yükseltin,'; $PHPMAILER_LANG['connect_host'] = 'SMTP Hatası: SMTP sunucusuna baÄŸlanılamadı.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP Hatası: Veri kabul edilmedi.'; $PHPMAILER_LANG['empty_message'] = 'Mesajın içeriÄŸi boÅŸ'; $PHPMAILER_LANG['encoding'] = 'Bilinmeyen karakter kodlama: '; $PHPMAILER_LANG['execute'] = 'Çalıştırılamadı: '; +$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; $PHPMAILER_LANG['file_access'] = 'Dosyaya eriÅŸilemedi: '; $PHPMAILER_LANG['file_open'] = 'Dosya Hatası: Dosya açılamadı: '; $PHPMAILER_LANG['from_failed'] = 'Belirtilen adreslere gönderme baÅŸarısız: '; $PHPMAILER_LANG['instantiate'] = 'Örnek e-posta fonksiyonu oluÅŸturulamadı.'; $PHPMAILER_LANG['invalid_address'] = 'Geçersiz e-posta adresi: '; +$PHPMAILER_LANG['invalid_header'] = 'Geçersiz baÅŸlık adı veya deÄŸeri: '; +$PHPMAILER_LANG['invalid_hostentry'] = 'Geçersiz ana bilgisayar giriÅŸi: '; +$PHPMAILER_LANG['invalid_host'] = 'Geçersiz ana bilgisayar: '; $PHPMAILER_LANG['mailer_not_supported'] = ' e-posta kütüphanesi desteklenmiyor.'; $PHPMAILER_LANG['provide_address'] = 'En az bir alıcı e-posta adresi belirtmelisiniz.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP Hatası: Belirtilen alıcılara ulaşılamadı: '; $PHPMAILER_LANG['signing'] = 'İmzalama hatası: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kodu: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'ek SMTP bilgileri: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP connect() fonksiyonu baÅŸarısız.'; +$PHPMAILER_LANG['smtp_detail'] = 'SMTP SMTP Detayı: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP sunucu hatası: '; $PHPMAILER_LANG['variable_set'] = 'DeÄŸiÅŸken ayarlanamadı ya da sıfırlanamadı: '; -$PHPMAILER_LANG['extension_missing'] = 'Eklenti bulunamadı: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php index fcd77ade9c..3dea055bbc 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php @@ -1,4 +1,5 @@ <?php + /** * Ukrainian PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -15,11 +16,11 @@ $PHPMAILER_LANG['file_open'] = 'Помилка файлової ÑиÑтеми: не вдаєтьÑÑ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ‚Ð¸ файл: '; $PHPMAILER_LANG['from_failed'] = 'Ðевірна адреÑа відправника: '; $PHPMAILER_LANG['instantiate'] = 'Ðеможливо запуÑтити функцію mail().'; -$PHPMAILER_LANG['provide_address'] = 'Будь-лаÑка, введіть хоча б одну email-адреÑу отримувача.'; +$PHPMAILER_LANG['provide_address'] = 'Будь лаÑка, введіть хоча б одну email-адреÑу отримувача.'; $PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий Ñервер не підтримуєтьÑÑ.'; $PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалоÑÑ Ð²Ñ–Ð´Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð´Ð»Ñ Ñ‚Ð°ÐºÐ¸Ñ… отримувачів: '; $PHPMAILER_LANG['empty_message'] = 'ПуÑте повідомленнÑ'; -$PHPMAILER_LANG['invalid_address'] = 'Ðе відправлено через невірний формат email-адреÑи: '; +$PHPMAILER_LANG['invalid_address'] = 'Ðе відправлено через неправильний формат email-адреÑи: '; $PHPMAILER_LANG['signing'] = 'Помилка підпиÑу: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'Ñ”Ð´Ð½Ð°Ð½Ð½Ñ Ð· SMTP-Ñервером'; $PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-Ñервера: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php new file mode 100644 index 0000000000..0b9de0f127 --- /dev/null +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php @@ -0,0 +1,30 @@ +<?php + +/** + * Urdu PHPMailer language file: refer to English translation for definitive list + * @package PHPMailer + * @author Saqib Ali Siddiqui <saqibsra@gmail.com> + */ + +$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔'; +$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک Ûونے سے قاصر۔'; +$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول Ù†Ûیں کیا گیا۔'; +$PHPMAILER_LANG['empty_message'] = 'پیغام Ú©ÛŒ باڈی خالی ÛÛ’Û”'; +$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: '; +$PHPMAILER_LANG['execute'] = 'عمل کرنے Ú©Û’ قابل Ù†Ûیں '; +$PHPMAILER_LANG['file_access'] = 'ÙØ§Ø¦Ù„ تک رسائی سے قاصر:'; +$PHPMAILER_LANG['file_open'] = 'ÙØ§Ø¦Ù„ Ú©ÛŒ خرابی: ÙØ§Ø¦Ù„ Ú©Ùˆ کھولنے سے قاصر:'; +$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا Ù¾ØªÛ Ù†Ø§Ú©Ø§Ù… ÛÙˆ گیا:'; +$PHPMAILER_LANG['instantiate'] = 'میل Ùنکشن Ú©ÛŒ مثال بنانے سے قاصر۔'; +$PHPMAILER_LANG['invalid_address'] = 'بھیجنے سے قاصر: غلط ای میل پتÛ:'; +$PHPMAILER_LANG['mailer_not_supported'] = ' میلر تعاون ÛŒØ§ÙØªÛ Ù†Ûیں ÛÛ’Û”'; +$PHPMAILER_LANG['provide_address'] = 'آپ Ú©Ùˆ Ú©Ù… از Ú©Ù… ایک منزل کا ای میل Ù¾ØªÛ ÙØ±Ø§ÛÙ… کرنا چاÛیے۔'; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP خرابی: درج ذیل Ù¾ØªÛ Ù¾Ø± Ù†Ûیں بھیجا جاسکا: '; +$PHPMAILER_LANG['signing'] = 'دستخط Ú©ÛŒ خرابی: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP ملنا ناکام Ûوا'; +$PHPMAILER_LANG['smtp_error'] = 'SMTP سرور Ú©ÛŒ خرابی: '; +$PHPMAILER_LANG['variable_set'] = 'متغیر سیٹ Ù†Ûیں کیا جا سکا: '; +$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود Ù†Ûیں ÛÛ’Û” '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور Ú©ÙˆÚˆ: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'اضاÙÛŒ SMTP سرور Ú©ÛŒ معلومات:'; +$PHPMAILER_LANG['invalid_header'] = 'غلط Ûیڈر کا نام یا قدر'; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php index c60dadebdb..d65576e2d4 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php @@ -1,4 +1,5 @@ <?php + /** * Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list. * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php index 3e9e358ceb..35e4e7000e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php @@ -1,4 +1,5 @@ <?php + /** * Traditional Chinese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php index 37537802aa..03d491165b 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -1,4 +1,5 @@ <?php + /** * Simplified Chinese PHPMailer language file: refer to English translation for definitive list * @package PHPMailer @@ -8,11 +9,13 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; +$PHPMAILER_LANG['buggy_php'] = '您的 PHP ç‰ˆæœ¬å­˜åœ¨æ¼æ´žï¼Œå¯èƒ½ä¼šå¯¼è‡´æ¶ˆæ¯æŸåã€‚ä¸ºä¿®å¤æ­¤é—®é¢˜ï¼Œè¯·åˆ‡æ¢åˆ°ä½¿ç”¨ SMTP å‘é€ï¼Œåœ¨æ‚¨çš„ php.ini 中ç¦ç”¨ mail.add_x_header 选项。切æ¢åˆ° MacOS 或 Linux,或将您的 PHP å‡çº§åˆ° 7.0.17+ 或 7.1.3+ 版本。'; $PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数æ®ä¸è¢«æŽ¥å—。'; $PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; $PHPMAILER_LANG['encoding'] = '未知编ç ï¼š'; $PHPMAILER_LANG['execute'] = '无法执行:'; +$PHPMAILER_LANG['extension_missing'] = '缺少扩展å:'; $PHPMAILER_LANG['file_access'] = '无法访问文件:'; $PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; $PHPMAILER_LANG['from_failed'] = 'å‘é€åœ°å€é”™è¯¯ï¼š'; @@ -21,8 +24,13 @@ $PHPMAILER_LANG['mailer_not_supported'] = 'å‘信客户端ä¸è¢«æ”¯æŒã€‚'; $PHPMAILER_LANG['provide_address'] = 'å¿…é¡»æä¾›è‡³å°‘一个收件人地å€ã€‚'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地å€é”™è¯¯ï¼š'; -$PHPMAILER_LANG['signing'] = '登录失败:'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTPæœåŠ¡å™¨è¿žæŽ¥å¤±è´¥ã€‚'; $PHPMAILER_LANG['smtp_error'] = 'SMTPæœåŠ¡å™¨å‡ºé”™ï¼š'; $PHPMAILER_LANG['variable_set'] = '无法设置或é‡ç½®å˜é‡ï¼š'; -$PHPMAILER_LANG['extension_missing'] = 'ä¸¢å¤±æ¨¡å— Extension:'; +$PHPMAILER_LANG['invalid_header'] = '无效的标题å称或值'; +$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: '; +$PHPMAILER_LANG['invalid_host'] = '无效的主机:'; +$PHPMAILER_LANG['signing'] = 'ç­¾å错误:'; +$PHPMAILER_LANG['smtp_code'] = 'SMTP代ç ï¼š '; +$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTPä¿¡æ¯ï¼š '; +$PHPMAILER_LANG['smtp_detail'] = '详情:'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php new file mode 100644 index 0000000000..7058c1f05e --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -0,0 +1,245 @@ +<?php + +/** + * PHPMailer - PHP email creation and transport class. + * PHP Version 5.5. + * + * @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * + * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> + * @author Jim Jagielski (jimjag) <jimjag@gmail.com> + * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2023 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * Configure PHPMailer with DSN string. + * + * @see https://en.wikipedia.org/wiki/Data_source_name + * + * @author Oleg Voronkovich <oleg-voronkovich@yandex.ru> + */ +class DSNConfigurator +{ + /** + * Create new PHPMailer instance configured by DSN. + * + * @param string $dsn DSN + * @param bool $exceptions Should we throw external exceptions? + * + * @return PHPMailer + */ + public static function mailer($dsn, $exceptions = null) + { + static $configurator = null; + + if (null === $configurator) { + $configurator = new DSNConfigurator(); + } + + return $configurator->configure(new PHPMailer($exceptions), $dsn); + } + + /** + * Configure PHPMailer instance with DSN string. + * + * @param PHPMailer $mailer PHPMailer instance + * @param string $dsn DSN + * + * @return PHPMailer + */ + public function configure(PHPMailer $mailer, $dsn) + { + $config = $this->parseDSN($dsn); + + $this->applyConfig($mailer, $config); + + return $mailer; + } + + /** + * Parse DSN string. + * + * @param string $dsn DSN + * + * @throws Exception If DSN is malformed + * + * @return array Configuration + */ + private function parseDSN($dsn) + { + $config = $this->parseUrl($dsn); + + if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { + throw new Exception('Malformed DSN'); + } + + if (isset($config['query'])) { + parse_str($config['query'], $config['query']); + } + + return $config; + } + + /** + * Apply configuration to mailer. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + * + * @throws Exception If scheme is invalid + */ + private function applyConfig(PHPMailer $mailer, $config) + { + switch ($config['scheme']) { + case 'mail': + $mailer->isMail(); + break; + case 'sendmail': + $mailer->isSendmail(); + break; + case 'qmail': + $mailer->isQmail(); + break; + case 'smtp': + case 'smtps': + $mailer->isSMTP(); + $this->configureSMTP($mailer, $config); + break; + default: + throw new Exception( + sprintf( + 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".', + $config['scheme'] + ) + ); + } + + if (isset($config['query'])) { + $this->configureOptions($mailer, $config['query']); + } + } + + /** + * Configure SMTP. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $config Configuration + */ + private function configureSMTP($mailer, $config) + { + $isSMTPS = 'smtps' === $config['scheme']; + + if ($isSMTPS) { + $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; + } + + $mailer->Host = $config['host']; + + if (isset($config['port'])) { + $mailer->Port = $config['port']; + } elseif ($isSMTPS) { + $mailer->Port = SMTP::DEFAULT_SECURE_PORT; + } + + $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']); + + if (isset($config['user'])) { + $mailer->Username = $config['user']; + } + + if (isset($config['pass'])) { + $mailer->Password = $config['pass']; + } + } + + /** + * Configure options. + * + * @param PHPMailer $mailer PHPMailer instance + * @param array $options Options + * + * @throws Exception If option is unknown + */ + private function configureOptions(PHPMailer $mailer, $options) + { + $allowedOptions = get_object_vars($mailer); + + unset($allowedOptions['Mailer']); + unset($allowedOptions['SMTPAuth']); + unset($allowedOptions['Username']); + unset($allowedOptions['Password']); + unset($allowedOptions['Hostname']); + unset($allowedOptions['Port']); + unset($allowedOptions['ErrorInfo']); + + $allowedOptions = \array_keys($allowedOptions); + + foreach ($options as $key => $value) { + if (!in_array($key, $allowedOptions)) { + throw new Exception( + sprintf( + 'Unknown option: "%s". Allowed values: "%s"', + $key, + implode('", "', $allowedOptions) + ) + ); + } + + switch ($key) { + case 'AllowEmpty': + case 'SMTPAutoTLS': + case 'SMTPKeepAlive': + case 'SingleTo': + case 'UseSendmailOptions': + case 'do_verp': + case 'DKIM_copyHeaderFields': + $mailer->$key = (bool) $value; + break; + case 'Priority': + case 'SMTPDebug': + case 'WordWrap': + $mailer->$key = (int) $value; + break; + default: + $mailer->$key = $value; + break; + } + } + } + + /** + * Parse a URL. + * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5. + * + * @param string $url URL + * + * @return array|false + */ + protected function parseUrl($url) + { + if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) { + return parse_url($url); + } + + $chunks = explode('?', $url); + if (is_array($chunks)) { + $result = parse_url($chunks[0]); + if (is_array($result)) { + $result['query'] = $chunks[1]; + } + return $result; + } + + return false; + } +} diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php index b1e552f50b..09c1a2cfef 100644 --- a/vendor/phpmailer/phpmailer/src/Exception.php +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer Exception class. * PHP Version 5.5. @@ -9,10 +10,10 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2017 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -34,6 +35,6 @@ class Exception extends \Exception */ public function errorMessage() { - return '<strong>' . htmlspecialchars($this->getMessage()) . "</strong><br />\n"; + return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n"; } } diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php index 0271963cee..a7e958860c 100644 --- a/vendor/phpmailer/phpmailer/src/OAuth.php +++ b/vendor/phpmailer/phpmailer/src/OAuth.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.5. @@ -9,10 +10,10 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2015 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -28,11 +29,11 @@ * OAuth - OAuth2 authentication wrapper class. * Uses the oauth2-client package from the League of Extraordinary Packages. * - * @see http://oauth2-client.thephpleague.com + * @see https://oauth2-client.thephpleague.com * * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> */ -class OAuth +class OAuth implements OAuthTokenProvider { /** * An instance of the League OAuth Client Provider. @@ -122,7 +123,7 @@ protected function getToken() */ public function getOauth64() { - // Get a new token if it's not available or has expired + //Get a new token if it's not available or has expired if (null === $this->oauthToken || $this->oauthToken->hasExpired()) { $this->oauthToken = $this->getToken(); } diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php new file mode 100644 index 0000000000..cbda1a1296 --- /dev/null +++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php @@ -0,0 +1,44 @@ +<?php + +/** + * PHPMailer - PHP email creation and transport class. + * PHP Version 5.5. + * + * @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project + * + * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> + * @author Jim Jagielski (jimjag) <jimjag@gmail.com> + * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> + * @author Brent R. Matzelle (original founder) + * @copyright 2012 - 2020 Marcus Bointon + * @copyright 2010 - 2012 Jim Jagielski + * @copyright 2004 - 2009 Andy Prevost + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License + * @note This program is distributed in the hope that it will be useful - WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + */ + +namespace PHPMailer\PHPMailer; + +/** + * OAuthTokenProvider - OAuth2 token provider interface. + * Provides base64 encoded OAuth2 auth strings for SMTP authentication. + * + * @see OAuth + * @see SMTP::authenticate() + * + * @author Peter Scopes (pdscopes) + * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk> + */ +interface OAuthTokenProvider +{ + /** + * Generate a base64-encoded OAuth token ensuring that the access token has not expired. + * The string to be base 64 encoded should be in the form: + * "user=<user_email_address>\001auth=Bearer <access_token>\001\001" + * + * @return string + */ + public function getOauth64(); +} diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index fddad40ace..2444bcf351 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer - PHP email creation and transport class. * PHP Version 5.5. @@ -9,10 +10,10 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -102,14 +103,14 @@ class PHPMailer * * @var string */ - public $From = 'root@localhost'; + public $From = ''; /** * The From name of the message. * * @var string */ - public $FromName = 'Root User'; + public $FromName = ''; /** * The envelope sender of the message. @@ -151,8 +152,7 @@ class PHPMailer * Only supported in simple alt or alt_inline message types * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator. * - * @see http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @see http://kigkonsult.se/iCalcreator/ + * @see https://kigkonsult.se/iCalcreator/ * * @var string */ @@ -253,7 +253,7 @@ class PHPMailer * You can set your own, but it must be in the format "<id@domain>", * as defined in RFC5322 section 3.6.4 or it will be ignored. * - * @see https://tools.ietf.org/html/rfc5322#section-3.6.4 + * @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 * * @var string */ @@ -349,17 +349,24 @@ class PHPMailer public $Password = ''; /** - * SMTP auth type. - * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. + * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2. + * If not specified, the first one from that list that the server supports will be selected. * * @var string */ public $AuthType = ''; /** - * An instance of the PHPMailer OAuth class. + * SMTP SMTPXClient command attributes + * + * @var array + */ + protected $SMTPXClient = []; + + /** + * An implementation of the PHPMailer OAuthTokenProvider interface. * - * @var OAuth + * @var OAuthTokenProvider */ protected $oauth; @@ -380,7 +387,7 @@ class PHPMailer * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual * delivery's outcome (success or failure) is not yet decided. * - * @see https://tools.ietf.org/html/rfc3461 See section 4.1 for more information about NOTIFY + * @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY */ public $dsn = ''; @@ -388,11 +395,11 @@ class PHPMailer * SMTP class debug output mode. * Debug output level. * Options: - * * SMTP::DEBUG_OFF: No output - * * SMTP::DEBUG_CLIENT: Client messages - * * SMTP::DEBUG_SERVER: Client and server messages - * * SMTP::DEBUG_CONNECTION: As SERVER plus connection status - * * SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed + * @see SMTP::DEBUG_OFF: No output + * @see SMTP::DEBUG_CLIENT: Client messages + * @see SMTP::DEBUG_SERVER: Client and server messages + * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status + * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed * * @see SMTP::$do_debug * @@ -427,9 +434,11 @@ class PHPMailer public $Debugoutput = 'echo'; /** - * Whether to keep SMTP connection open after each message. - * If this is set to true then to close the connection - * requires an explicit call to smtpClose(). + * Whether to keep the SMTP connection open after each message. + * If this is set to true then the connection will remain open after a send, + * and closing the connection will require an explicit call to smtpClose(). + * It's a good idea to use this if you are sending multiple messages as it reduces overhead. + * See the mailing list example for how to use it. * * @var bool */ @@ -441,6 +450,8 @@ class PHPMailer * Only supported in `mail` and `sendmail` transports, not in SMTP. * * @var bool + * + * @deprecated 6.0.0 PHPMailer isn't a mailing list manager! */ public $SingleTo = false; @@ -456,7 +467,7 @@ class PHPMailer * Only applicable when sending via SMTP. * * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Postfix VERP info + * @see https://www.postfix.org/VERP_README.html Postfix VERP info * * @var bool */ @@ -539,10 +550,10 @@ class PHPMailer * The function that handles the result of the send email action. * It is called out by send() for each email sent. * - * Value can be any php callable: http://www.php.net/is_callable + * Value can be any php callable: https://www.php.net/is_callable * * Parameters: - * bool $result result of the send action + * bool $result result of the send action * array $to email addresses of the recipients * array $cc cc email addresses * array $bcc bcc email addresses @@ -569,6 +580,10 @@ class PHPMailer * May be a callable to inject your own validator, but there are several built-in validators. * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option. * + * If CharSet is UTF8, the validator is left at the default value, + * and you send to addresses that use non-ASCII local parts, then + * PHPMailer automatically changes to the 'eai' validator. + * * @see PHPMailer::validateAddress() * * @var string|callable @@ -648,6 +663,14 @@ class PHPMailer */ protected $ReplyToQueue = []; + /** + * Whether the need for SMTPUTF8 has been detected. Set by + * preSend() if necessary. + * + * @var bool + */ + public $UseSMTPUTF8 = false; + /** * The array of attachments. * @@ -684,7 +707,7 @@ class PHPMailer protected $boundary = []; /** - * The array of available languages. + * The array of available text strings for the current language. * * @var array */ @@ -745,7 +768,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.1.5'; + const VERSION = '6.10.0'; /** * Error severity: message only, continue processing. @@ -790,7 +813,7 @@ class PHPMailer * The maximum line length supported by mail(). * * Background: mail() will sometimes corrupt messages - * with headers headers longer than 65 chars, see #818. + * with headers longer than 65 chars, see #818. * * @var int */ @@ -853,24 +876,31 @@ public function __destruct() private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { + if ((int)ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); } //Calling mail() with null params breaks + $this->edebug('Sending with mail()'); + $this->edebug('Sendmail path: ' . ini_get('sendmail_path')); + $this->edebug("Envelope sender: {$this->Sender}"); + $this->edebug("To: {$to}"); + $this->edebug("Subject: {$subject}"); + $this->edebug("Headers: {$header}"); if (!$this->UseSendmailOptions || null === $params) { $result = @mail($to, $subject, $body, $header); } else { + $this->edebug("Additional params: {$params}"); $result = @mail($to, $subject, $body, $header, $params); } - + $this->edebug('Result: ' . ($result ? 'true' : 'false')); return $result; } /** - * Output debugging info via user-defined method. - * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). + * Output debugging info via a user-defined method. + * Only generates output if debug output is enabled. * * @see PHPMailer::$Debugoutput * @see PHPMailer::$SMTPDebug @@ -884,7 +914,7 @@ protected function edebug($str) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -897,6 +927,7 @@ protected function edebug($str) switch ($this->Debugoutput) { case 'error_log': //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ error_log($str); break; case 'html': @@ -1052,9 +1083,9 @@ public function addReplyTo($address, $name = '') * be modified after calling this function), addition of such addresses is delayed until send(). * Addresses that have been added already return false, but do not throw exceptions. * - * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo' - * @param string $address The email address to send, resp. to reply to - * @param string $name + * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To' + * @param string $address The email address + * @param string $name An optional username associated with the address * * @throws Exception * @@ -1062,11 +1093,13 @@ public function addReplyTo($address, $name = '') */ protected function addOrEnqueueAnAddress($kind, $address, $name) { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - $pos = strrpos($address, '@'); + $pos = false; + if ($address !== null) { + $address = trim($address); + $pos = strrpos($address, '@'); + } if (false === $pos) { - // At-sign is missing. + //At-sign is missing. $error_message = sprintf( '%s (%s): %s', $this->lang('invalid_address'), @@ -1081,28 +1114,53 @@ protected function addOrEnqueueAnAddress($kind, $address, $name) return false; } + if ($name !== null && is_string($name)) { + $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim + } else { + $name = ''; + } $params = [$kind, $address, $name]; - // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - if (static::idnSupported() && $this->has8bitChars(substr($address, ++$pos))) { - if ('Reply-To' !== $kind) { - if (!array_key_exists($address, $this->RecipientsQueue)) { - $this->RecipientsQueue[$address] = $params; + //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. + //Domain is assumed to be whatever is after the last @ symbol in the address + if ($this->has8bitChars(substr($address, ++$pos))) { + if (static::idnSupported()) { + if ('Reply-To' !== $kind) { + if (!array_key_exists($address, $this->RecipientsQueue)) { + $this->RecipientsQueue[$address] = $params; + + return true; + } + } elseif (!array_key_exists($address, $this->ReplyToQueue)) { + $this->ReplyToQueue[$address] = $params; return true; } - } elseif (!array_key_exists($address, $this->ReplyToQueue)) { - $this->ReplyToQueue[$address] = $params; - - return true; } - + //We have an 8-bit domain, but we are missing the necessary extensions to support it + //Or we are already sending to this address return false; } - // Immediately add standard addresses without IDN. + //Immediately add standard addresses without IDN. return call_user_func_array([$this, 'addAnAddress'], $params); } + /** + * Set the boundaries to use for delimiting MIME parts. + * If you override this, ensure you set all 3 boundaries to unique values. + * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, + * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 + * + * @return void + */ + public function setBoundaries() + { + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1=_' . $this->uniqueid; + $this->boundary[2] = 'b2=_' . $this->uniqueid; + $this->boundary[3] = 'b3=_' . $this->uniqueid; + } + /** * Add an address to one of the recipient arrays or to the ReplyTo array. * Addresses that have been added already return false, but do not throw exceptions. @@ -1117,6 +1175,15 @@ protected function addOrEnqueueAnAddress($kind, $address, $name) */ protected function addAnAddress($kind, $address, $name = '') { + if ( + self::$validator === 'php' && + ((bool) preg_match('/[\x80-\xFF]/', $address)) + ) { + //The caller has not altered the validator and is sending to an address + //with UTF-8, so assume that they want UTF-8 support instead of failing + $this->CharSet = self::CHARSET_UTF8; + self::$validator = 'eai'; + } if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { $error_message = sprintf( '%s: %s', @@ -1168,23 +1235,43 @@ protected function addAnAddress($kind, $address, $name = '') * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. * Note that quotes in the name part are removed. * - * @see http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation + * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation * * @param string $addrstr The address list string * @param bool $useimap Whether to use the IMAP extension to parse the list + * @param string $charset The charset to use when decoding the address list string. * * @return array */ - public static function parseAddresses($addrstr, $useimap = true) + public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) { $addresses = []; if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available $list = imap_rfc822_parse_adrlist($addrstr, ''); + // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + imap_errors(); foreach ($list as $address) { - if (('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( - $address->mailbox . '@' . $address->host - )) { + if ( + '.SYNTAX-ERROR.' !== $address->host && + static::validateAddress($address->mailbox . '@' . $address->host) + ) { + //Decode the name part if it's present and encoded + if ( + property_exists($address, 'personal') && + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + defined('MB_CASE_UPPER') && + preg_match('/^=\?.*\?=$/s', $address->personal) + ) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $address->personal = str_replace('_', '=20', $address->personal); + //Decode the name + $address->personal = mb_decode_mimeheader($address->personal); + mb_internal_encoding($origCharset); + } + $addresses[] = [ 'name' => (property_exists($address, 'personal') ? $address->personal : ''), 'address' => $address->mailbox . '@' . $address->host, @@ -1208,9 +1295,22 @@ public static function parseAddresses($addrstr, $useimap = true) } else { list($name, $email) = explode('<', $address); $email = trim(str_replace('>', '', $email)); + $name = trim($name); if (static::validateAddress($email)) { + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + //If this name is encoded, decode it + if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $name = str_replace('_', '=20', $name); + //Decode the name + $name = mb_decode_mimeheader($name); + mb_internal_encoding($origCharset); + } $addresses[] = [ - 'name' => trim(str_replace(['"', "'"], '', $name)), + //Remove any surrounding quotes and spaces from the name + 'name' => trim($name, '\'" '), 'address' => $email, ]; } @@ -1234,11 +1334,12 @@ public static function parseAddresses($addrstr, $useimap = true) */ public function setFrom($address, $name = '', $auto = true) { - $address = trim($address); + $address = trim((string)$address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - // Don't validate now addresses with IDN. Will be done in send(). + //Don't validate now addresses with IDN. Will be done in send(). $pos = strrpos($address, '@'); - if ((false === $pos) + if ( + (false === $pos) || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported()) && !static::validateAddress($address)) ) { @@ -1285,6 +1386,7 @@ public function getLastMessageID() * * `pcre` Use old PCRE implementation; * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `eai` Use a pattern similar to the HTML5 spec for 'email' and to firefox, extended to support EAI (RFC6530). * * `noregex` Don't use a regex: super fast, really dumb. * Alternatively you may pass in a callable to inject your own validator, for example: * @@ -1306,8 +1408,9 @@ public static function validateAddress($address, $patternselect = null) if (null === $patternselect) { $patternselect = static::$validator; } - if (is_callable($patternselect)) { - return $patternselect($address); + //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603 + if (is_callable($patternselect) && !is_string($patternselect)) { + return call_user_func($patternselect, $address); } //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) { @@ -1328,7 +1431,6 @@ public static function validateAddress($address, $patternselect = null) * * IPv6 literals: 'first.last@[IPv6:a1::]' * Not all of these will necessarily work for sending! * - * @see http://squiloople.com/2009/12/20/email-address-validation/ * @copyright 2009-2010 Michael Rushton * Feel free to use and redistribute this code. But please keep this copyright notice. */ @@ -1348,13 +1450,31 @@ public static function validateAddress($address, $patternselect = null) /* * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. * - * @see http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) + * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) */ return (bool) preg_match( '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' . '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD', $address ); + case 'eai': + /* + * This is the pattern used in the HTML5 spec for validation of 'email' type + * form input elements (as above), modified to accept Unicode email addresses. + * This is also more lenient than Firefox' html5 spec, in order to make the regex faster. + * 'eai' is an acronym for Email Address Internationalization. + * This validator is selected automatically if you attempt to use recipient addresses + * that contain Unicode characters in the local part. + * + * @see https://html.spec.whatwg.org/#e-mail-state-(type=email) + * @see https://en.wikipedia.org/wiki/International_email + */ + return (bool) preg_match( + '/^[-\p{L}\p{N}\p{M}.!#$%&\'*+\/=?^_`{|}~]+@[\p{L}\p{N}\p{M}](?:[\p{L}\p{N}\p{M}-]{0,61}' . + '[\p{L}\p{N}\p{M}])?(?:\.[\p{L}\p{N}\p{M}]' . + '(?:[-\p{L}\p{N}\p{M}]{0,61}[\p{L}\p{N}\p{M}])?)*$/usD', + $address + ); case 'php': default: return filter_var($address, FILTER_VALIDATE_EMAIL) !== false; @@ -1388,23 +1508,33 @@ public static function idnSupported() */ public function punyencodeAddress($address) { - // Verify we have required functions, CharSet, and at-sign. + //Verify we have required functions, CharSet, and at-sign. $pos = strrpos($address, '@'); - if (!empty($this->CharSet) && + if ( + !empty($this->CharSet) && false !== $pos && static::idnSupported() ) { $domain = substr($address, ++$pos); - // Verify CharSet string is a valid one, and domain properly encoded in this CharSet. + //Verify CharSet string is a valid one, and domain properly encoded in this CharSet. if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) { - $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); + //Convert the domain from whatever charset it's in to UTF-8 + $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet); //Ignore IDE complaints about this line - method signature changed in PHP 5.4 $errorcode = 0; if (defined('INTL_IDNA_VARIANT_UTS46')) { - $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46); + //Use the current punycode standard (appeared in PHP 7.2) + $punycode = idn_to_ascii( + $domain, + \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI | + \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII, + \INTL_IDNA_VARIANT_UTS46 + ); } elseif (defined('INTL_IDNA_VARIANT_2003')) { - $punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_2003); + //Fall back to this old, deprecated/removed encoding + $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003); } else { + //Fall back to a default we don't know about $punycode = idn_to_ascii($domain, $errorcode); } if (false !== $punycode) { @@ -1452,8 +1582,9 @@ public function send() */ public function preSend() { - if ('smtp' === $this->Mailer - || ('mail' === $this->Mailer && stripos(PHP_OS, 'WIN') === 0) + if ( + 'smtp' === $this->Mailer + || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0)) ) { //SMTP mandates RFC-compliant line endings //and it's also used with mail() on Windows @@ -1463,46 +1594,63 @@ public function preSend() static::setLE(PHP_EOL); } //Check for buggy PHP versions that add a header with an incorrect line break - if ('mail' === $this->Mailer - && ((PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70017) - || (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70103)) + if ( + 'mail' === $this->Mailer + && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017) + || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103)) && ini_get('mail.add_x_header') === '1' && stripos(PHP_OS, 'WIN') === 0 ) { - trigger_error( - 'Your version of PHP is affected by a bug that may result in corrupted messages.' . - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . - ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', - E_USER_WARNING - ); + trigger_error($this->lang('buggy_php'), E_USER_WARNING); } try { - $this->error_count = 0; // Reset errors + $this->error_count = 0; //Reset errors $this->mailHeader = ''; - // Dequeue recipient and Reply-To addresses with IDN + //The code below tries to support full use of Unicode, + //while remaining compatible with legacy SMTP servers to + //the greatest degree possible: If the message uses + //Unicode in the local parts of any addresses, it is sent + //using SMTPUTF8. If not, it it sent using + //punycode-encoded domains and plain SMTP. + if ( + static::CHARSET_UTF8 === strtolower($this->CharSet) && + ($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) || + $this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) || + $this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) || + $this->addressHasUnicodeLocalPart($this->From)) + ) { + $this->UseSMTPUTF8 = true; + } + //Dequeue recipient and Reply-To addresses with IDN foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) { - $params[1] = $this->punyencodeAddress($params[1]); + if (!$this->UseSMTPUTF8) { + $params[1] = $this->punyencodeAddress($params[1]); + } call_user_func_array([$this, 'addAnAddress'], $params); } if (count($this->to) + count($this->cc) + count($this->bcc) < 1) { throw new Exception($this->lang('provide_address'), self::STOP_CRITICAL); } - // Validate From, Sender, and ConfirmReadingTo addresses + //Validate From, Sender, and ConfirmReadingTo addresses foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { - $this->$address_kind = trim($this->$address_kind); - if (empty($this->$address_kind)) { + if ($this->{$address_kind} === null) { + $this->{$address_kind} = ''; + continue; + } + $this->{$address_kind} = trim($this->{$address_kind}); + if (empty($this->{$address_kind})) { continue; } - $this->$address_kind = $this->punyencodeAddress($this->$address_kind); - if (!static::validateAddress($this->$address_kind)) { + $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind}); + if (!static::validateAddress($this->{$address_kind})) { $error_message = sprintf( '%s (%s): %s', $this->lang('invalid_address'), $address_kind, - $this->$address_kind + $this->{$address_kind} ); $this->setError($error_message); $this->edebug($error_message); @@ -1514,29 +1662,29 @@ public function preSend() } } - // Set whether the message is multipart/alternative + //Set whether the message is multipart/alternative if ($this->alternativeExists()) { $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE; } $this->setMessageType(); - // Refuse to send an empty message unless we are specifically allowing it + //Refuse to send an empty message unless we are specifically allowing it if (!$this->AllowEmpty && empty($this->Body)) { throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); } //Trim subject consistently $this->Subject = trim($this->Subject); - // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) + //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding) $this->MIMEHeader = ''; $this->MIMEBody = $this->createBody(); - // createBody may have added some headers, so retain them + //createBody may have added some headers, so retain them $tempheaders = $this->MIMEHeader; $this->MIMEHeader = $this->createHeader(); $this->MIMEHeader .= $tempheaders; - // To capture the complete message when using mail(), create - // an extra header list which createHeader() doesn't fold in + //To capture the complete message when using mail(), create + //an extra header list which createHeader() doesn't fold in if ('mail' === $this->Mailer) { if (count($this->to) > 0) { $this->mailHeader .= $this->addrAppend('To', $this->to); @@ -1549,8 +1697,9 @@ public function preSend() ); } - // Sign with DKIM if enabled - if (!empty($this->DKIM_domain) + //Sign with DKIM if enabled + if ( + !empty($this->DKIM_domain) && !empty($this->DKIM_selector) && (!empty($this->DKIM_private_string) || (!empty($this->DKIM_private) @@ -1589,7 +1738,7 @@ public function preSend() public function postSend() { try { - // Choose the mailer and send through it + //Choose the mailer and send through it switch ($this->Mailer) { case 'sendmail': case 'qmail': @@ -1601,7 +1750,7 @@ public function postSend() default: $sendMethod = $this->Mailer . 'Send'; if (method_exists($this, $sendMethod)) { - return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody); + return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody); } return $this->mailSend($this->MIMEHeader, $this->MIMEBody); @@ -1609,6 +1758,9 @@ public function postSend() } catch (Exception $exc) { $this->setError($exc->getMessage()); $this->edebug($exc->getMessage()); + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { + $this->smtp->reset(); + } if ($this->exceptions) { throw $exc; } @@ -1631,22 +1783,46 @@ public function postSend() */ protected function sendmailSend($header, $body) { + if ($this->Mailer === 'qmail') { + $this->edebug('Sending with qmail'); + } else { + $this->edebug('Sending with sendmail'); + } $header = static::stripTrailingWSP($header) . static::$LE . static::$LE; + //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver + //A space after `-f` is optional, but there is a long history of its presence + //causing problems, so we don't use one + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html + //Example problem: https://www.drupal.org/node/1057954 - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) && self::isShellSafe($this->Sender)) { - if ('qmail' === $this->Mailer) { + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); + } + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { + if ($this->Mailer === 'qmail') { $sendmailFmt = '%s -f%s'; } else { $sendmailFmt = '%s -oi -f%s -t'; } - } elseif ('qmail' === $this->Mailer) { - $sendmailFmt = '%s'; } else { + //allow sendmail to choose a default envelope sender. It may + //seem preferable to force it to use the From header as with + //SMTP, but that introduces new problems (see + //<https://github.com/PHPMailer/PHPMailer/issues/2298>), and + //it has historically worked this way. $sendmailFmt = '%s -oi -t'; } $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); + $this->edebug('Sendmail path: ' . $this->Sendmail); + $this->edebug('Sendmail command: ' . $sendmail); + $this->edebug('Envelope sender: ' . $this->Sender); + $this->edebug("Headers: {$header}"); if ($this->SingleTo) { foreach ($this->SingleToArray as $toAddr) { @@ -1654,13 +1830,15 @@ protected function sendmailSend($header, $body) if (!$mail) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } + $this->edebug("To: {$toAddr}"); fwrite($mail, 'To: ' . $toAddr . "\n"); fwrite($mail, $header); fwrite($mail, $body); $result = pclose($mail); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); $this->doCallback( ($result === 0), - [$toAddr], + [[$addrinfo['address'], $addrinfo['name']]], $this->cc, $this->bcc, $this->Subject, @@ -1668,6 +1846,7 @@ protected function sendmailSend($header, $body) $this->From, [] ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); if (0 !== $result) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } @@ -1690,6 +1869,7 @@ protected function sendmailSend($header, $body) $this->From, [] ); + $this->edebug("Result: " . ($result === 0 ? 'true' : 'false')); if (0 !== $result) { throw new Exception($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); } @@ -1710,8 +1890,15 @@ protected function sendmailSend($header, $body) */ protected static function isShellSafe($string) { - // Future-proof - if (escapeshellcmd($string) !== $string + //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg, + //but some hosting providers disable it, creating a security problem that we don't want to have to deal with, + //so we don't. + if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) { + return false; + } + + if ( + escapeshellcmd($string) !== $string || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""]) ) { return false; @@ -1722,9 +1909,9 @@ protected static function isShellSafe($string) for ($i = 0; $i < $length; ++$i) { $c = $string[$i]; - // All other characters have a special meaning in at least one common shell, including = and +. - // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. - // Note that this does permit non-Latin alphanumeric characters based on the current locale. + //All other characters have a special meaning in at least one common shell, including = and +. + //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here. + //Note that this does permit non-Latin alphanumeric characters based on the current locale. if (!ctype_alnum($c) && strpos('@_-.', $c) === false) { return false; } @@ -1744,13 +1931,34 @@ protected static function isShellSafe($string) */ protected static function isPermittedPath($path) { - return !preg_match('#^[a-z]+://#i', $path); + //Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1 + return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path); + } + + /** + * Check whether a file path is safe, accessible, and readable. + * + * @param string $path A relative or absolute path to a file + * + * @return bool + */ + protected static function fileIsAccessible($path) + { + if (!static::isPermittedPath($path)) { + return false; + } + $readable = is_file($path); + //If not a UNC path (expected to start with \\), check read permission, see #2069 + if (strpos($path, '\\\\') !== 0) { + $readable = $readable && is_readable($path); + } + return $readable; } /** * Send mail using the PHP mail() function. * - * @see http://www.php.net/manual/en/book.mail.php + * @see https://www.php.net/manual/en/book.mail.php * * @param string $header The message headers * @param string $body The message body @@ -1767,21 +1975,34 @@ protected function mailSend($header, $body) foreach ($this->to as $toaddr) { $toArr[] = $this->addrFormat($toaddr); } - $to = implode(', ', $toArr); + $to = trim(implode(', ', $toArr)); + + //If there are no To-addresses (e.g. when sending only to BCC-addresses) + //the following should be added to get a correct DKIM-signature. + //Compare with $this->preSend() + if ($to === '') { + $to = 'undisclosed-recipients:;'; + } $params = null; //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver //A space after `-f` is optional, but there is a long history of its presence //causing problems, so we don't use one - //Exim docs: http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html - //Sendmail docs: http://www.sendmail.org/~ca/email/man/sendmail.html - //Qmail docs: http://www.qmail.org/man/man8/qmail-inject.html + //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html + //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html //Example problem: https://www.drupal.org/node/1057954 - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) { - $params = sprintf('-f%s', $this->Sender); + //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. + + //PHP 5.6 workaround + $sendmail_from_value = ini_get('sendmail_from'); + if (empty($this->Sender) && !empty($sendmail_from_value)) { + //PHP config has a sender address we can use + $this->Sender = ini_get('sendmail_from'); } if (!empty($this->Sender) && static::validateAddress($this->Sender)) { + if (self::isShellSafe($this->Sender)) { + $params = sprintf('-f%s', $this->Sender); + } $old_from = ini_get('sendmail_from'); ini_set('sendmail_from', $this->Sender); } @@ -1789,7 +2010,17 @@ protected function mailSend($header, $body) if ($this->SingleTo && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $this->doCallback($result, [$toAddr], $this->cc, $this->bcc, $this->Subject, $body, $this->From, []); + $addrinfo = static::parseAddresses($toAddr, true, $this->CharSet); + $this->doCallback( + $result, + [[$addrinfo['address'], $addrinfo['name']]], + $this->cc, + $this->bcc, + $this->Subject, + $body, + $this->From, + [] + ); } } else { $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params); @@ -1833,6 +2064,38 @@ public function setSMTPInstance(SMTP $smtp) return $this->smtp; } + /** + * Provide SMTP XCLIENT attributes + * + * @param string $name Attribute name + * @param ?string $value Attribute value + * + * @return bool + */ + public function setSMTPXclientAttribute($name, $value) + { + if (!in_array($name, SMTP::$xclient_allowed_attributes)) { + return false; + } + if (isset($this->SMTPXClient[$name]) && $value === null) { + unset($this->SMTPXClient[$name]); + } elseif ($value !== null) { + $this->SMTPXClient[$name] = $value; + } + + return true; + } + + /** + * Get SMTP XCLIENT attributes + * + * @return array + */ + public function getSMTPXclientAttributes() + { + return $this->SMTPXClient; + } + /** * Send mail via SMTP. * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. @@ -1855,19 +2118,27 @@ protected function smtpSend($header, $body) if (!$this->smtpConnect($this->SMTPOptions)) { throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } + //If we have recipient addresses that need Unicode support, + //but the server doesn't support it, stop here + if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) { + throw new Exception($this->lang('no_smtputf8'), self::STOP_CRITICAL); + } //Sender already validated in preSend() if ('' === $this->Sender) { $smtp_from = $this->From; } else { $smtp_from = $this->Sender; } + if (count($this->SMTPXClient)) { + $this->smtp->xclient($this->SMTPXClient); + } if (!$this->smtp->mail($smtp_from)) { $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); throw new Exception($this->ErrorInfo, self::STOP_CRITICAL); } $callbacks = []; - // Attempt to send to all recipients + //Attempt to send to all recipients foreach ([$this->to, $this->cc, $this->bcc] as $togroup) { foreach ($togroup as $to) { if (!$this->smtp->recipient($to[0], $this->dsn)) { @@ -1878,11 +2149,11 @@ protected function smtpSend($header, $body) $isSent = true; } - $callbacks[] = ['issent'=>$isSent, 'to'=>$to[0]]; + $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]]; } } - // Only send the DATA command if we have viable recipients + //Only send the DATA command if we have viable recipients if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) { throw new Exception($this->lang('data_not_accepted'), self::STOP_CRITICAL); } @@ -1899,7 +2170,7 @@ protected function smtpSend($header, $body) foreach ($callbacks as $cb) { $this->doCallback( $cb['issent'], - [$cb['to']], + [[$cb['to'], $cb['name']]], [], [], $this->Subject, @@ -1944,7 +2215,7 @@ public function smtpConnect($options = null) $options = $this->SMTPOptions; } - // Already connected? + //Already connected? if ($this->smtp->connected()) { return true; } @@ -1953,25 +2224,31 @@ public function smtpConnect($options = null) $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); + $this->smtp->setSMTPUTF8($this->UseSMTPUTF8); + if ($this->Host === null) { + $this->Host = 'localhost'; + } $hosts = explode(';', $this->Host); $lastexception = null; foreach ($hosts as $hostentry) { $hostinfo = []; - if (!preg_match( - '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', - trim($hostentry), - $hostinfo - )) { + if ( + !preg_match( + '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/', + trim($hostentry), + $hostinfo + ) + ) { $this->edebug($this->lang('invalid_hostentry') . ' ' . trim($hostentry)); - // Not a valid host entry + //Not a valid host entry continue; } - // $hostinfo[1]: optional ssl or tls prefix - // $hostinfo[2]: the hostname - // $hostinfo[3]: optional port number - // The host string prefix can temporarily override the current setting for SMTPSecure - // If it's not specified, the default value is used + //$hostinfo[1]: optional ssl or tls prefix + //$hostinfo[2]: the hostname + //$hostinfo[3]: optional port number + //The host string prefix can temporarily override the current setting for SMTPSecure + //If it's not specified, the default value is used //Check the host name is a valid name or IP address before trying to use it if (!static::isValidHost($hostinfo[2])) { @@ -1983,11 +2260,11 @@ public function smtpConnect($options = null) $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure); if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) { $prefix = 'ssl://'; - $tls = false; // Can't have SSL and TLS at the same time + $tls = false; //Can't have SSL and TLS at the same time $secure = static::ENCRYPTION_SMTPS; } elseif ('tls' === $hostinfo[1]) { $tls = true; - // tls doesn't use a prefix + //TLS doesn't use a prefix $secure = static::ENCRYPTION_STARTTLS; } //Do we need the OpenSSL extension? @@ -2000,7 +2277,12 @@ public function smtpConnect($options = null) } $host = $hostinfo[2]; $port = $this->Port; - if (array_key_exists(3, $hostinfo) && is_numeric($hostinfo[3]) && $hostinfo[3] > 0 && $hostinfo[3] < 65536) { + if ( + array_key_exists(3, $hostinfo) && + is_numeric($hostinfo[3]) && + $hostinfo[3] > 0 && + $hostinfo[3] < 65536 + ) { $port = (int) $hostinfo[3]; } if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) { @@ -2012,26 +2294,36 @@ public function smtpConnect($options = null) } $this->smtp->hello($hello); //Automatically enable TLS encryption if: - // * it's not disabled - // * we have openssl extension - // * we are not already using SSL - // * the server offers STARTTLS - if ($this->SMTPAutoTLS && $sslext && 'ssl' !== $secure && $this->smtp->getServerExt('STARTTLS')) { + //* it's not disabled + //* we are not connecting to localhost + //* we have openssl extension + //* we are not already using SSL + //* the server offers STARTTLS + if ( + $this->SMTPAutoTLS && + $this->Host !== 'localhost' && + $sslext && + $secure !== 'ssl' && + $this->smtp->getServerExt('STARTTLS') + ) { $tls = true; } if ($tls) { if (!$this->smtp->startTLS()) { - throw new Exception($this->lang('connect_host')); + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); } - // We must resend EHLO after TLS negotiation + //We must resend EHLO after TLS negotiation $this->smtp->hello($hello); } - if ($this->SMTPAuth && !$this->smtp->authenticate( - $this->Username, - $this->Password, - $this->AuthType, - $this->oauth - )) { + if ( + $this->SMTPAuth && !$this->smtp->authenticate( + $this->Username, + $this->Password, + $this->AuthType, + $this->oauth + ) + ) { throw new Exception($this->lang('authenticate')); } @@ -2039,17 +2331,22 @@ public function smtpConnect($options = null) } catch (Exception $exc) { $lastexception = $exc; $this->edebug($exc->getMessage()); - // We must have connected, but then failed TLS or Auth, so close connection nicely + //We must have connected, but then failed TLS or Auth, so close connection nicely $this->smtp->quit(); } } } - // If we get here, all connection attempts have failed, so close connection hard + //If we get here, all connection attempts have failed, so close connection hard $this->smtp->close(); - // As we've caught all exceptions, just report whatever the last one was + //As we've caught all exceptions, just report whatever the last one was if ($this->exceptions && null !== $lastexception) { throw $lastexception; } + if ($this->exceptions) { + // no exception was thrown, likely $this->smtp->connect() failed + $message = $this->getSmtpErrorMessage('connect_host'); + throw new Exception($message); + } return false; } @@ -2067,17 +2364,19 @@ public function smtpClose() /** * Set the language for error messages. - * Returns false if it cannot load the language file. * The default language is English. * * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * Optionally, the language code can be enhanced with a 4-character + * script annotation and/or a 2-character country annotation. * @param string $lang_path Path to the language file directory, with trailing separator (slash) + * Do not set this from user input! * - * @return bool + * @return bool Returns true if the requested language was loaded, false otherwise. */ public function setLanguage($langcode = 'en', $lang_path = '') { - // Backwards compatibility for renamed language codes + //Backwards compatibility for renamed language codes $renamed_langcodes = [ 'br' => 'pt_br', 'cz' => 'cs', @@ -2086,60 +2385,113 @@ public function setLanguage($langcode = 'en', $lang_path = '') 'se' => 'sv', 'rs' => 'sr', 'tg' => 'tl', + 'am' => 'hy', ]; - if (isset($renamed_langcodes[$langcode])) { + if (array_key_exists($langcode, $renamed_langcodes)) { $langcode = $renamed_langcodes[$langcode]; } - // Define full set of translatable strings in English + //Define full set of translatable strings in English $PHPMAILER_LANG = [ 'authenticate' => 'SMTP Error: Could not authenticate.', + 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', + 'extension_missing' => 'Extension missing: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address: ', + 'invalid_header' => 'Invalid header name or value', 'invalid_hostentry' => 'Invalid hostentry: ', 'invalid_host' => 'Invalid host: ', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', + 'smtp_code' => 'SMTP code: ', + 'smtp_code_ex' => 'Additional SMTP info: ', 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_detail' => 'Detail: ', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ', + 'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses', ]; if (empty($lang_path)) { - // Calculate an absolute path so it can work if CWD is not here + //Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; } + //Validate $langcode - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $foundlang = true; + $langcode = strtolower($langcode); + if ( + !preg_match('/^(?P<lang>[a-z]{2})(?P<script>_[a-z]{4})?(?P<country>_[a-z]{2})?$/', $langcode, $matches) + && $langcode !== 'en' + ) { + $foundlang = false; $langcode = 'en'; } - $foundlang = true; - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; - // There is no English translation file + + //There is no English translation file if ('en' !== $langcode) { - // Make sure language file path is readable - if (!static::isPermittedPath($lang_file) || !file_exists($lang_file)) { + $langcodes = []; + if (!empty($matches['script']) && !empty($matches['country'])) { + $langcodes[] = $matches['lang'] . $matches['script'] . $matches['country']; + } + if (!empty($matches['country'])) { + $langcodes[] = $matches['lang'] . $matches['country']; + } + if (!empty($matches['script'])) { + $langcodes[] = $matches['lang'] . $matches['script']; + } + $langcodes[] = $matches['lang']; + + //Try and find a readable language file for the requested language. + $foundFile = false; + foreach ($langcodes as $code) { + $lang_file = $lang_path . 'phpmailer.lang-' . $code . '.php'; + if (static::fileIsAccessible($lang_file)) { + $foundFile = true; + break; + } + } + + if ($foundFile === false) { $foundlang = false; } else { - // Overwrite language-specific strings. - // This way we'll never have missing translation keys. - $foundlang = include $lang_file; + $lines = file($lang_file); + foreach ($lines as $line) { + //Translation file lines look like this: + //$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.'; + //These files are parsed as text and not PHP so as to avoid the possibility of code injection + //See https://blog.stevenlevithan.com/archives/match-quoted-string + $matches = []; + if ( + preg_match( + '/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/', + $line, + $matches + ) && + //Ignore unknown translation keys + array_key_exists($matches[1], $PHPMAILER_LANG) + ) { + //Overwrite language-specific strings so we'll never have missing translation keys. + $PHPMAILER_LANG[$matches[1]] = (string)$matches[3]; + } + } } } $this->language = $PHPMAILER_LANG; - return (bool) $foundlang; // Returns false if language not found + return $foundlang; //Returns false if language not found } /** @@ -2149,6 +2501,10 @@ public function setLanguage($langcode = 'en', $lang_path = '') */ public function getTranslations() { + if (empty($this->language)) { + $this->setLanguage(); // Set the default language. + } + return $this->language; } @@ -2183,7 +2539,7 @@ public function addrAppend($type, $addr) */ public function addrFormat($addr) { - if (empty($addr[1])) { // No name provided + if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided return $this->secureHeader($addr[0]); } @@ -2210,8 +2566,8 @@ public function wrapText($message, $length, $qp_mode = false) } else { $soft_break = static::$LE; } - // If utf-8 encoding is used, we will need to make sure we don't - // split multibyte characters when we wrap + //If utf-8 encoding is used, we will need to make sure we don't + //split multibyte characters when we wrap $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet); $lelen = strlen(static::$LE); $crlflen = strlen(static::$LE); @@ -2311,29 +2667,29 @@ public function utf8CharBoundary($encodedText, $maxLength) $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); $encodedCharPos = strpos($lastChunk, '='); if (false !== $encodedCharPos) { - // Found start of encoded character byte within $lookBack block. - // Check the encoded byte value (the 2 chars after the '=') + //Found start of encoded character byte within $lookBack block. + //Check the encoded byte value (the 2 chars after the '=') $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); $dec = hexdec($hex); if ($dec < 128) { - // Single byte character. - // If the encoded char was found at pos 0, it will fit - // otherwise reduce maxLength to start of the encoded char + //Single byte character. + //If the encoded char was found at pos 0, it will fit + //otherwise reduce maxLength to start of the encoded char if ($encodedCharPos > 0) { $maxLength -= $lookBack - $encodedCharPos; } $foundSplitPos = true; } elseif ($dec >= 192) { - // First byte of a multi byte character - // Reduce maxLength to split at start of character + //First byte of a multi byte character + //Reduce maxLength to split at start of character $maxLength -= $lookBack - $encodedCharPos; $foundSplitPos = true; } elseif ($dec < 192) { - // Middle byte of a multi byte character, look further back + //Middle byte of a multi byte character, look further back $lookBack += 3; } } else { - // No encoded character found + //No encoded character found $foundSplitPos = true; } } @@ -2377,30 +2733,28 @@ public function createHeader() $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); - // To be created automatically by mail() - if ($this->SingleTo) { - if ('mail' !== $this->Mailer) { + //The To header is created automatically by mail(), so needs to be omitted here + if ('mail' !== $this->Mailer) { + if ($this->SingleTo) { foreach ($this->to as $toaddr) { $this->SingleToArray[] = $this->addrFormat($toaddr); } - } - } elseif (count($this->to) > 0) { - if ('mail' !== $this->Mailer) { + } elseif (count($this->to) > 0) { $result .= $this->addrAppend('To', $this->to); + } elseif (count($this->cc) === 0) { + $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } - } elseif (count($this->cc) === 0) { - $result .= $this->headerLine('To', 'undisclosed-recipients:;'); } - $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); - // sendmail and mail() extract Cc from the header before sending + //sendmail and mail() extract Cc from the header before sending if (count($this->cc) > 0) { $result .= $this->addrAppend('Cc', $this->cc); } - // sendmail and mail() extract Bcc from the header before sending - if (( + //sendmail and mail() extract Bcc from the header before sending + if ( + ( 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer ) && count($this->bcc) > 0 @@ -2412,14 +2766,24 @@ public function createHeader() $result .= $this->addrAppend('Reply-To', $this->ReplyTo); } - // mail() sets the subject itself + //mail() sets the subject itself if ('mail' !== $this->Mailer) { $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); } - // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - // https://tools.ietf.org/html/rfc5322#section-3.6.4 - if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { + //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 + //https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4 + if ( + '' !== $this->MessageID && + preg_match( + '/^<((([a-z\d!#$%&\'*+\/=?^_`{|}~-]+(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)' . + '|("(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]|[\x21\x23-\x5B\x5D-\x7E])' . + '|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*"))@(([a-z\d!#$%&\'*+\/=?^_`{|}~-]+' . + '(\.[a-z\d!#$%&\'*+\/=?^_`{|}~-]+)*)|(\[(([\x01-\x08\x0B\x0C\x0E-\x1F\x7F]' . + '|[\x21-\x5A\x5E-\x7E])|(\\[\x01-\x09\x0B\x0C\x0E-\x7F]))*\])))>$/Di', + $this->MessageID + ) + ) { $this->lastMessageID = $this->MessageID; } else { $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); @@ -2429,22 +2793,21 @@ public function createHeader() $result .= $this->headerLine('X-Priority', $this->Priority); } if ('' === $this->XMailer) { + //Empty string for default X-Mailer header $result .= $this->headerLine( 'X-Mailer', 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' ); - } else { - $myXmailer = trim($this->XMailer); - if ($myXmailer) { - $result .= $this->headerLine('X-Mailer', $myXmailer); - } - } + } elseif (is_string($this->XMailer) && trim($this->XMailer) !== '') { + //Some string + $result .= $this->headerLine('X-Mailer', trim($this->XMailer)); + } //Other values result in no X-Mailer header if ('' !== $this->ConfirmReadingTo) { $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); } - // Add custom headers + //Add custom headers foreach ($this->CustomHeader as $header) { $result .= $this->headerLine( trim($header[0]), @@ -2486,28 +2849,24 @@ public function getMailMIME() $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); break; default: - // Catches case 'plain': and case '': + //Catches case 'plain': and case '': $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); $ismultipart = false; break; } - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $this->Encoding) { - // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE + //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE if ($ismultipart) { if (static::ENCODING_8BIT === $this->Encoding) { $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT); } - // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible + //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible } else { $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); } } - if ('mail' !== $this->Mailer) { -// $result .= static::$LE; - } - return $result; } @@ -2567,10 +2926,7 @@ public function createBody() { $body = ''; //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; + $this->setBoundaries(); if ($this->sign_key_file) { $body .= $this->getMailMIME() . static::$LE; @@ -2581,7 +2937,9 @@ public function createBody() $bodyEncoding = $this->Encoding; $bodyCharSet = $this->CharSet; //Can we do a 7-bit downgrade? - if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) { + if ($this->UseSMTPUTF8) { + $bodyEncoding = static::ENCODING_8BIT; + } elseif (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) { $bodyEncoding = static::ENCODING_7BIT; //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit $bodyCharSet = static::CHARSET_ASCII; @@ -2606,7 +2964,7 @@ public function createBody() $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; } //Use this as a preamble in all multipart message types - $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE; + $mimepre = ''; switch ($this->message_type) { case 'inline': $body .= $mimepre; @@ -2776,7 +3134,7 @@ public function createBody() $body .= $this->attachAll('attachment', $this->boundary[1]); break; default: - // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types + //Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types //Reset the `Encoding` property in case we changed it for line length reasons $this->Encoding = $bodyEncoding; $body .= $this->encodeString($this->Body, $this->Encoding); @@ -2842,6 +3200,18 @@ public function createBody() return $body; } + /** + * Get the boundaries that this message will use + * @return array + */ + public function getBoundaries() + { + if (empty($this->boundary)) { + $this->setBoundaries(); + } + return $this->boundary; + } + /** * Return the start of a message boundary. * @@ -2867,7 +3237,7 @@ protected function getBoundary($boundary, $charSet, $contentType, $encoding) $result .= $this->textLine('--' . $boundary); $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); $result .= static::$LE; - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $encoding) { $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); } @@ -2946,7 +3316,7 @@ public function textLine($value) * @param string $path Path to the attachment * @param string $name Overrides the attachment name * @param string $encoding File encoding (see $Encoding) - * @param string $type File extension (MIME) type + * @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified * @param string $disposition Disposition to use * * @throws Exception @@ -2961,11 +3331,11 @@ public function addAttachment( $disposition = 'attachment' ) { try { - if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) { + if (!static::fileIsAccessible($path)) { throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); } - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($path); } @@ -2974,7 +3344,6 @@ public function addAttachment( if ('' === $name) { $name = $filename; } - if (!$this->validateEncoding($encoding)) { throw new Exception($this->lang('encoding') . $encoding); } @@ -2985,7 +3354,7 @@ public function addAttachment( 2 => $name, 3 => $encoding, 4 => $type, - 5 => false, // isStringAttachment + 5 => false, //isStringAttachment 6 => $disposition, 7 => $name, ]; @@ -3025,16 +3394,16 @@ public function getAttachments() */ protected function attachAll($disposition_type, $boundary) { - // Return text of body + //Return text of body $mime = []; $cidUniq = []; $incl = []; - // Add all attachments + //Add all attachments foreach ($this->attachment as $attachment) { - // Check if it is a valid disposition_filter + //Check if it is a valid disposition_filter if ($attachment[6] === $disposition_type) { - // Check for string attachment + //Check for string attachment $string = ''; $path = ''; $bString = $attachment[5]; @@ -3063,9 +3432,9 @@ protected function attachAll($disposition_type, $boundary) //Only include a filename property if we have one if (!empty($name)) { $mime[] = sprintf( - 'Content-Type: %s; name="%s"%s', + 'Content-Type: %s; name=%s%s', $type, - $this->encodeHeader($this->secureHeader($name)), + static::quotedString($this->encodeHeader($this->secureHeader($name))), static::$LE ); } else { @@ -3075,7 +3444,7 @@ protected function attachAll($disposition_type, $boundary) static::$LE ); } - // RFC1341 part 5 says 7bit is assumed if not specified + //RFC1341 part 5 says 7bit is assumed if not specified if (static::ENCODING_7BIT !== $encoding) { $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE); } @@ -3085,24 +3454,14 @@ protected function attachAll($disposition_type, $boundary) $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; } - // If a filename contains any of these chars, it should be quoted, - // but not otherwise: RFC2183 & RFC2045 5.1 - // Fixes a warning in IETF's msglint MIME checker - // Allow for bypassing the Content-Disposition header totally + //Allow for bypassing the Content-Disposition header if (!empty($disposition)) { $encoded_name = $this->encodeHeader($this->secureHeader($name)); - if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename="%s"%s', - $disposition, - $encoded_name, - static::$LE . static::$LE - ); - } elseif (!empty($encoded_name)) { + if (!empty($encoded_name)) { $mime[] = sprintf( 'Content-Disposition: %s; filename=%s%s', $disposition, - $encoded_name, + static::quotedString($encoded_name), static::$LE . static::$LE ); } else { @@ -3116,7 +3475,7 @@ protected function attachAll($disposition_type, $boundary) $mime[] = static::$LE; } - // Encode as string attachment + //Encode as string attachment if ($bString) { $mime[] = $this->encodeString($string, $encoding); } else { @@ -3146,7 +3505,7 @@ protected function attachAll($disposition_type, $boundary) protected function encodeFile($path, $encoding = self::ENCODING_BASE64) { try { - if (!static::isPermittedPath($path) || !file_exists($path) || !is_readable($path)) { + if (!static::fileIsAccessible($path)) { throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); } $file_buffer = file_get_contents($path); @@ -3162,6 +3521,7 @@ protected function encodeFile($path, $encoding = self::ENCODING_BASE64) if ($this->exceptions) { throw $exc; } + return ''; } } @@ -3191,7 +3551,7 @@ public function encodeString($str, $encoding = self::ENCODING_BASE64) case static::ENCODING_7BIT: case static::ENCODING_8BIT: $encoded = static::normalizeBreaks($str); - // Make sure it ends with a line break + //Make sure it ends with a line break if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) { $encoded .= static::$LE; } @@ -3216,7 +3576,8 @@ public function encodeString($str, $encoding = self::ENCODING_BASE64) /** * Encode a header value (not including its label) optimally. * Picks shortest of Q, B, or none. Result includes folding if needed. - * See RFC822 definitions for phrase, comment and text positions. + * See RFC822 definitions for phrase, comment and text positions, + * and RFC2047 for inline encodings. * * @param string $str The header value to encode * @param string $position What context the string will be used in @@ -3225,11 +3586,16 @@ public function encodeString($str, $encoding = self::ENCODING_BASE64) */ public function encodeHeader($str, $position = 'text') { + $position = strtolower($position); + if ($this->UseSMTPUTF8 && !("comment" === $position)) { + return trim(static::normalizeBreaks($str)); + } + $matchcount = 0; switch (strtolower($position)) { case 'phrase': if (!preg_match('/[\200-\377]/', $str)) { - // Can't use addslashes as we don't know the value of magic_quotes_sybase + //Can't use addslashes as we don't know the value of magic_quotes_sybase $encoded = addcslashes($str, "\0..\37\177\\\""); if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { return $encoded; @@ -3255,7 +3621,7 @@ public function encodeHeader($str, $position = 'text') $charset = static::CHARSET_ASCII; } - // Q/B encoding adds 8 chars and the charset ("` =?<charset>?[QB]?<content>?=`"). + //Q/B encoding adds 8 chars and the charset ("` =?<charset>?[QB]?<content>?=`"). $overhead = 8 + strlen($charset); if ('mail' === $this->Mailer) { @@ -3264,26 +3630,26 @@ public function encodeHeader($str, $position = 'text') $maxlen = static::MAX_LINE_LENGTH - $overhead; } - // Select the encoding that produces the shortest output and/or prevents corruption. + //Select the encoding that produces the shortest output and/or prevents corruption. if ($matchcount > strlen($str) / 3) { - // More than 1/3 of the content needs encoding, use B-encode. + //More than 1/3 of the content needs encoding, use B-encode. $encoding = 'B'; } elseif ($matchcount > 0) { - // Less than 1/3 of the content needs encoding, use Q-encode. + //Less than 1/3 of the content needs encoding, use Q-encode. $encoding = 'Q'; } elseif (strlen($str) > $maxlen) { - // No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. + //No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. $encoding = 'Q'; } else { - // No reformatting needed + //No reformatting needed $encoding = false; } switch ($encoding) { case 'B': if ($this->hasMultiBytes($str)) { - // Use a custom function which correctly encodes and wraps long - // multibyte strings without breaking lines within a character + //Use a custom function which correctly encodes and wraps long + //multibyte strings without breaking lines within a character $encoded = $this->base64EncodeWrapMB($str, "\n"); } else { $encoded = base64_encode($str); @@ -3318,7 +3684,7 @@ public function hasMultiBytes($str) return strlen($str) > mb_strlen($str, $this->CharSet); } - // Assume no multibytes (we can't handle without mbstring functions anyway) + //Assume no multibytes (we can't handle without mbstring functions anyway) return false; } @@ -3339,7 +3705,7 @@ public function has8bitChars($text) * without breaking lines within a character. * Adapted from a function by paravoid. * - * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 + * @see https://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 * * @param string $str multi-byte text to wrap encode * @param string $linebreak string to use as linefeed/end-of-line @@ -3356,11 +3722,11 @@ public function base64EncodeWrapMB($str, $linebreak = null) } $mb_length = mb_strlen($str, $this->CharSet); - // Each line must have length <= 75, including $start and $end + //Each line must have length <= 75, including $start and $end $length = 75 - strlen($start) - strlen($end); - // Average multi-byte ratio + //Average multi-byte ratio $ratio = $mb_length / strlen($str); - // Base64 has a 4:3 ratio + //Base64 has a 4:3 ratio $avgLength = floor($length * $ratio * .75); $offset = 0; @@ -3375,7 +3741,7 @@ public function base64EncodeWrapMB($str, $linebreak = null) $encoded .= $chunk . $linebreak; } - // Chomp the last linefeed + //Chomp the last linefeed return substr($encoded, 0, -strlen($linebreak)); } @@ -3395,7 +3761,7 @@ public function encodeQP($string) /** * Encode a string using Q encoding. * - * @see http://tools.ietf.org/html/rfc2047#section-4.2 + * @see https://www.rfc-editor.org/rfc/rfc2047#section-4.2 * * @param string $str the text to encode * @param string $position Where the text is going to be used, see the RFC for what that means @@ -3404,12 +3770,12 @@ public function encodeQP($string) */ public function encodeQ($str, $position = 'text') { - // There should not be any EOL in the string + //There should not be any EOL in the string $pattern = ''; $encoded = str_replace(["\r", "\n"], '', $str); switch (strtolower($position)) { case 'phrase': - // RFC 2047 section 5.3 + //RFC 2047 section 5.3 $pattern = '^A-Za-z0-9!*+\/ -'; break; /* @@ -3422,15 +3788,15 @@ public function encodeQ($str, $position = 'text') /* Intentional fall through */ case 'text': default: - // RFC 2047 section 5.1 - // Replace every high ascii, control, =, ? and _ characters + //RFC 2047 section 5.1 + //Replace every high ascii, control, =, ? and _ characters $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; break; } $matches = []; if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { - // If the string contains an '=', make sure it's the first thing we replace - // so as to avoid double-encoding + //If the string contains an '=', make sure it's the first thing we replace + //so as to avoid double-encoding $eqkey = array_search('=', $matches[0], true); if (false !== $eqkey) { unset($matches[0][$eqkey]); @@ -3440,8 +3806,8 @@ public function encodeQ($str, $position = 'text') $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); } } - // Replace spaces with _ (more readable than =20) - // RFC 2047 section 4.2(2) + //Replace spaces with _ (more readable than =20) + //RFC 2047 section 4.2(2) return str_replace(' ', '_', $encoded); } @@ -3468,7 +3834,7 @@ public function addStringAttachment( $disposition = 'attachment' ) { try { - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($filename); } @@ -3477,14 +3843,14 @@ public function addStringAttachment( throw new Exception($this->lang('encoding') . $encoding); } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $string, 1 => $filename, 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), 3 => $encoding, 4 => $type, - 5 => true, // isStringAttachment + 5 => true, //isStringAttachment 6 => $disposition, 7 => 0, ]; @@ -3507,20 +3873,21 @@ public function addStringAttachment( * These differ from 'regular' attachments in that they are intended to be * displayed inline with the message, not just attached for download. * This is used in HTML messages that embed the images - * the HTML refers to using the $cid value. + * the HTML refers to using the `$cid` value in `img` tags, for example `<img src="cid:mylogo">`. * Never use a user-supplied path to a file! * * @param string $path Path to the attachment * @param string $cid Content ID of the attachment; Use this to reference * the content when using an embedded image in HTML - * @param string $name Overrides the attachment name - * @param string $encoding File encoding (see $Encoding) - * @param string $type File MIME type - * @param string $disposition Disposition to use + * @param string $name Overrides the attachment filename + * @param string $encoding File encoding (see $Encoding) defaults to `base64` + * @param string $type File MIME type (by default mapped from the `$path` filename's extension) + * @param string $disposition Disposition to use: `inline` (default) or `attachment` + * (unlikely you want this – {@see `addAttachment()`} instead) * + * @return bool True on successfully adding an attachment * @throws Exception * - * @return bool True on successfully adding an attachment */ public function addEmbeddedImage( $path, @@ -3531,11 +3898,11 @@ public function addEmbeddedImage( $disposition = 'inline' ) { try { - if (!static::isPermittedPath($path) || !@is_file($path) || !is_readable($path)) { + if (!static::fileIsAccessible($path)) { throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); } - // If a MIME type is not specified, try to work it out from the file name + //If a MIME type is not specified, try to work it out from the file name if ('' === $type) { $type = static::filenameToType($path); } @@ -3549,14 +3916,14 @@ public function addEmbeddedImage( $name = $filename; } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, - 5 => false, // isStringAttachment + 5 => false, //isStringAttachment 6 => $disposition, 7 => $cid, ]; @@ -3601,7 +3968,7 @@ public function addStringEmbeddedImage( $disposition = 'inline' ) { try { - // If a MIME type is not specified, try to work it out from the name + //If a MIME type is not specified, try to work it out from the name if ('' === $type && !empty($name)) { $type = static::filenameToType($name); } @@ -3610,14 +3977,14 @@ public function addStringEmbeddedImage( throw new Exception($this->lang('encoding') . $encoding); } - // Append to $attachment array + //Append to $attachment array $this->attachment[] = [ 0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, - 5 => true, // isStringAttachment + 5 => true, //isStringAttachment 6 => $disposition, 7 => $cid, ]; @@ -3804,6 +4171,79 @@ public function clearCustomHeaders() $this->CustomHeader = []; } + /** + * Clear a specific custom header by name or name and value. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + * + * @return bool True if a header was replaced successfully + */ + public function clearCustomHeader($name, $value = null) + { + if (null === $value && strpos($name, ':') !== false) { + //Value passed in as name:value + list($name, $value) = explode(':', $name, 2); + } + $name = trim($name); + $value = (null === $value) ? null : trim($value); + + foreach ($this->CustomHeader as $k => $pair) { + if ($pair[0] == $name) { + // We remove the header if the value is not provided or it matches. + if (null === $value || $pair[1] == $value) { + unset($this->CustomHeader[$k]); + } + } + } + + return true; + } + + /** + * Replace a custom header. + * $name value can be overloaded to contain + * both header name and value (name:value). + * + * @param string $name Custom header name + * @param string|null $value Header value + * + * @return bool True if a header was replaced successfully + * @throws Exception + */ + public function replaceCustomHeader($name, $value = null) + { + if (null === $value && strpos($name, ':') !== false) { + //Value passed in as name:value + list($name, $value) = explode(':', $name, 2); + } + $name = trim($name); + $value = (null === $value) ? '' : trim($value); + + $replaced = false; + foreach ($this->CustomHeader as $k => $pair) { + if ($pair[0] == $name) { + if ($replaced) { + unset($this->CustomHeader[$k]); + continue; + } + if (strpbrk($name . $value, "\r\n") !== false) { + if ($this->exceptions) { + throw new Exception($this->lang('invalid_header')); + } + + return false; + } + $this->CustomHeader[$k] = [$name, $value]; + $replaced = true; + } + } + + return true; + } + /** * Add an error message to the error container. * @@ -3815,15 +4255,15 @@ protected function setError($msg) if ('smtp' === $this->Mailer && null !== $this->smtp) { $lasterror = $this->smtp->getError(); if (!empty($lasterror['error'])) { - $msg .= $this->lang('smtp_error') . $lasterror['error']; + $msg .= ' ' . $this->lang('smtp_error') . $lasterror['error']; if (!empty($lasterror['detail'])) { - $msg .= ' Detail: ' . $lasterror['detail']; + $msg .= ' ' . $this->lang('smtp_detail') . $lasterror['detail']; } if (!empty($lasterror['smtp_code'])) { - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; + $msg .= ' ' . $this->lang('smtp_code') . $lasterror['smtp_code']; } if (!empty($lasterror['smtp_code_ex'])) { - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; + $msg .= ' ' . $this->lang('smtp_code_ex') . $lasterror['smtp_code_ex']; } } } @@ -3837,8 +4277,8 @@ protected function setError($msg) */ public static function rfcDate() { - // Set the time zone to whatever the default is to avoid 500 errors - // Will default to UTC if it's not set properly in php.ini + //Set the time zone to whatever the default is to avoid 500 errors + //Will default to UTC if it's not set properly in php.ini date_default_timezone_set(@date_default_timezone_get()); return date('D, j M Y H:i:s O'); @@ -3859,7 +4299,7 @@ protected function serverHostname() $result = $_SERVER['SERVER_NAME']; } elseif (function_exists('gethostname') && gethostname() !== false) { $result = gethostname(); - } elseif (php_uname('n') !== false) { + } elseif (php_uname('n') !== '') { $result = php_uname('n'); } if (!static::isValidHost($result)) { @@ -3880,10 +4320,11 @@ protected function serverHostname() public static function isValidHost($host) { //Simple syntax limits - if (empty($host) + if ( + empty($host) || !is_string($host) || strlen($host) > 256 - || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host) + || !preg_match('/^([a-z\d.-]*|\[[a-f\d:]+\])$/i', $host) ) { return false; } @@ -3897,14 +4338,49 @@ public static function isValidHost($host) //Is it a valid IPv4 address? return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; } - if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) { - //Is it a syntactically valid hostname? - return true; - } + //Is it a syntactically valid hostname (when embedded in a URL)? + return filter_var('https://' . $host, FILTER_VALIDATE_URL) !== false; + } + /** + * Check whether the supplied address uses Unicode in the local part. + * + * @return bool + */ + protected function addressHasUnicodeLocalPart($address) + { + return (bool) preg_match('/[\x80-\xFF].*@/', $address); + } + + /** + * Check whether any of the supplied addresses use Unicode in the local part. + * + * @return bool + */ + protected function anyAddressHasUnicodeLocalPart($addresses) + { + foreach ($addresses as $address) { + if (is_array($address)) { + $address = $address[0]; + } + if ($this->addressHasUnicodeLocalPart($address)) { + return true; + } + } return false; } + /** + * Check whether the message requires SMTPUTF8 based on what's known so far. + * + * @return bool + */ + public function needsSMTPUTF8() + { + return $this->UseSMTPUTF8; + } + + /** * Get an error message in the current language. * @@ -3915,13 +4391,13 @@ public static function isValidHost($host) protected function lang($key) { if (count($this->language) < 1) { - $this->setLanguage(); // set the default language + $this->setLanguage(); //Set the default language } if (array_key_exists($key, $this->language)) { if ('smtp_connect_failed' === $key) { - //Include a link to troubleshooting docs on SMTP connection failure - //this is by far the biggest cause of support questions + //Include a link to troubleshooting docs on SMTP connection failure. + //This is by far the biggest cause of support questions //but it's usually not PHPMailer's fault. return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; } @@ -3933,6 +4409,26 @@ protected function lang($key) return $key; } + /** + * Build an error message starting with a generic one and adding details if possible. + * + * @param string $base_key + * @return string + */ + private function getSmtpErrorMessage($base_key) + { + $message = $this->lang($base_key); + $error = $this->smtp->getError(); + if (!empty($error['error'])) { + $message .= ' ' . $error['error']; + if (!empty($error['detail'])) { + $message .= ' ' . $error['detail']; + } + } + + return $message; + } + /** * Check if an error occurred. * @@ -3951,20 +4447,21 @@ public function isError() * @param string $name Custom header name * @param string|null $value Header value * + * @return bool True if a header was set successfully * @throws Exception */ public function addCustomHeader($name, $value = null) { if (null === $value && strpos($name, ':') !== false) { - // Value passed in as name:value + //Value passed in as name:value list($name, $value) = explode(':', $name, 2); } $name = trim($name); - $value = trim($value); + $value = (null === $value) ? '' : trim($value); //Ensure name is not empty, and that neither name nor value contain line breaks if (empty($name) || strpbrk($name . $value, "\r\n") !== false) { if ($this->exceptions) { - throw new Exception('Invalid header name or value'); + throw new Exception($this->lang('invalid_header')); } return false; @@ -3998,7 +4495,8 @@ public function getCustomHeaders() * @param string $message HTML message string * @param string $basedir Absolute path to a base directory to prepend to relative paths to images * @param bool|callable $advanced Whether to use the internal HTML to text converter - * or your own custom converter @return string $message The transformed message Body + * or your own custom converter + * @return string The transformed message body * * @throws Exception * @@ -4009,11 +4507,11 @@ public function msgHTML($message, $basedir = '', $advanced = false) preg_match_all('/(?<!-)(src|background)=["\'](.*)["\']/Ui', $message, $images); if (array_key_exists(2, $images)) { if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { - // Ensure $basedir has a trailing / + //Ensure $basedir has a trailing / $basedir .= '/'; } foreach ($images[2] as $imgindex => $url) { - // Convert data URIs into embedded images + //Convert data URIs into embedded images //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" $match = []; if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { @@ -4027,7 +4525,7 @@ public function msgHTML($message, $basedir = '', $advanced = false) } //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places //will only be embedded once, even if it used a different encoding - $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; // RFC2392 S 2 + $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2 if (!$this->cidExists($cid)) { $this->addStringEmbeddedImage( @@ -4045,13 +4543,14 @@ public function msgHTML($message, $basedir = '', $advanced = false) ); continue; } - if (// Only process relative URLs if a basedir is provided (i.e. no absolute local paths) + if ( + //Only process relative URLs if a basedir is provided (i.e. no absolute local paths) !empty($basedir) - // Ignore URLs containing parent dir traversal (..) + //Ignore URLs containing parent dir traversal (..) && (strpos($url, '..') === false) - // Do not change urls that are already inline images + //Do not change urls that are already inline images && 0 !== strpos($url, 'cid:') - // Do not change absolute URLs, including anonymous protocol + //Do not change absolute URLs, including anonymous protocol && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) ) { $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); @@ -4059,7 +4558,7 @@ public function msgHTML($message, $basedir = '', $advanced = false) if ('.' === $directory) { $directory = ''; } - // RFC2392 S 2 + //RFC2392 S 2 $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0'; if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { $basedir .= '/'; @@ -4067,13 +4566,14 @@ public function msgHTML($message, $basedir = '', $advanced = false) if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { $directory .= '/'; } - if ($this->addEmbeddedImage( - $basedir . $directory . $filename, - $cid, - $filename, - static::ENCODING_BASE64, - static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) - ) + if ( + $this->addEmbeddedImage( + $basedir . $directory . $filename, + $cid, + $filename, + static::ENCODING_BASE64, + static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) + ) ) { $message = preg_replace( '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', @@ -4085,7 +4585,7 @@ public function msgHTML($message, $basedir = '', $advanced = false) } } $this->isHTML(); - // Convert all message body line breaks to LE, makes quoted-printable encoding work much better + //Convert all message body line breaks to LE, makes quoted-printable encoding work much better $this->Body = static::normalizeBreaks($message); $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced)); if (!$this->alternativeExists()) { @@ -4104,9 +4604,9 @@ public function msgHTML($message, $basedir = '', $advanced = false) * Example usage: * * ```php - * // Use default conversion + * //Use default conversion * $plain = $mail->html2text($html); - * // Use your own custom converter + * //Use your own custom converter * $plain = $mail->html2text($html, function($html) { * $converter = new MyHtml2text($html); * return $converter->get_text(); @@ -4115,14 +4615,15 @@ public function msgHTML($message, $basedir = '', $advanced = false) * * @param string $html The HTML text to convert * @param bool|callable $advanced Any boolean value to use the internal converter, - * or provide your own callable for custom conversion + * or provide your own callable for custom conversion. + * *Never* pass user-supplied data into this parameter * * @return string */ public function html2text($html, $advanced = false) { if (is_callable($advanced)) { - return $advanced($html); + return call_user_func($advanced, $html); } return html_entity_decode( @@ -4221,6 +4722,7 @@ public static function _mime_types($ext = '') 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'webp' => 'image/webp', + 'avif' => 'image/avif', 'heif' => 'image/heif', 'heifs' => 'image/heif-sequence', 'heic' => 'image/heic', @@ -4240,6 +4742,7 @@ public static function _mime_types($ext = '') 'ics' => 'text/calendar', 'xml' => 'text/xml', 'xsl' => 'text/xml', + 'csv' => 'text/csv', 'wmv' => 'video/x-ms-wmv', 'mpeg' => 'video/mpeg', 'mpe' => 'video/mpeg', @@ -4272,7 +4775,7 @@ public static function _mime_types($ext = '') */ public static function filenameToType($filename) { - // In case the path is a URL, strip any query string before getting extension + //In case the path is a URL, strip any query string before getting extension $qpos = strpos($filename, '?'); if (false !== $qpos) { $filename = substr($filename, 0, $qpos); @@ -4286,7 +4789,7 @@ public static function filenameToType($filename) * Multi-byte-safe pathinfo replacement. * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. * - * @see http://www.php.net/manual/en/function.pathinfo.php#107461 + * @see https://www.php.net/manual/en/function.pathinfo.php#107461 * * @param string $path A filename or path, does not need to exist as a file * @param int|string $options Either a PATHINFO_* constant, @@ -4347,7 +4850,7 @@ public static function mb_pathinfo($path, $options = null) public function set($name, $value = '') { if (property_exists($this, $name)) { - $this->$name = $value; + $this->{$name} = $value; return true; } @@ -4383,9 +4886,9 @@ public static function normalizeBreaks($text, $breaktype = null) if (null === $breaktype) { $breaktype = static::$LE; } - // Normalise to \n + //Normalise to \n $text = str_replace([self::CRLF, "\r"], "\n", $text); - // Now convert LE as needed + //Now convert LE as needed if ("\n" !== $breaktype) { $text = str_replace("\n", $breaktype, $text); } @@ -4394,17 +4897,29 @@ public static function normalizeBreaks($text, $breaktype = null) } /** - * Remove trailing breaks from a string. + * Remove trailing whitespace from a string. * * @param string $text * - * @return string The text to remove breaks from + * @return string The text to remove whitespace from */ public static function stripTrailingWSP($text) { return rtrim($text, " \r\n\t"); } + /** + * Strip trailing line breaks from a string. + * + * @param string $text + * + * @return string The text to remove breaks from + */ + public static function stripTrailingBreaks($text) + { + return rtrim($text, "\r\n"); + } + /** * Return the current line break format string. * @@ -4491,11 +5006,15 @@ public function DKIM_Sign($signHeader) $privKey = openssl_pkey_get_private($privKeyStr); } if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - openssl_pkey_free($privKey); + if (\PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } return base64_encode($signature); } - openssl_pkey_free($privKey); + if (\PHP_MAJOR_VERSION < 8) { + openssl_pkey_free($privKey); + } return ''; } @@ -4505,7 +5024,7 @@ public function DKIM_Sign($signHeader) * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. * Canonicalized headers should *always* use CRLF, regardless of mailer setting. * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 + * @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.2 * * @param string $signHeader Header * @@ -4517,7 +5036,7 @@ public function DKIM_HeaderC($signHeader) $signHeader = static::normalizeBreaks($signHeader, self::CRLF); //Unfold header lines //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` - //@see https://tools.ietf.org/html/rfc5322#section-2.2 + //@see https://www.rfc-editor.org/rfc/rfc5322#section-2.2 //That means this may break if you do something daft like put vertical tabs in your headers. $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); //Break headers out into an array @@ -4549,7 +5068,7 @@ public function DKIM_HeaderC($signHeader) * Uses the 'simple' algorithm from RFC6376 section 3.4.3. * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 + * @see https://www.rfc-editor.org/rfc/rfc6376#section-3.4.3 * * @param string $body Message Body * @@ -4560,11 +5079,11 @@ public function DKIM_BodyC($body) if (empty($body)) { return self::CRLF; } - // Normalize line endings to CRLF + //Normalize line endings to CRLF $body = static::normalizeBreaks($body, self::CRLF); //Reduce multiple trailing line breaks to a single one - return static::stripTrailingWSP($body) . self::CRLF; + return static::stripTrailingBreaks($body) . self::CRLF; } /** @@ -4580,12 +5099,12 @@ public function DKIM_BodyC($body) */ public function DKIM_Add($headers_line, $subject, $body) { - $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms - $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization methods of header & body - $DKIMquery = 'dns/txt'; // Query method + $DKIMsignatureType = 'rsa-sha256'; //Signature & hash algorithms + $DKIMcanonicalization = 'relaxed/simple'; //Canonicalization methods of header & body + $DKIMquery = 'dns/txt'; //Query method $DKIMtime = time(); //Always sign these headers without being asked - //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1 + //Recommended list from https://www.rfc-editor.org/rfc/rfc6376#section-5.4.1 $autoSignHeaders = [ 'from', 'to', @@ -4683,14 +5202,15 @@ public function DKIM_Add($headers_line, $subject, $body) $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; $headerValues = implode(static::$LE, $headersToSign); $body = $this->DKIM_BodyC($body); - $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body + //Base64 of packed binary SHA-256 hash of body + $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); $ident = ''; if ('' !== $this->DKIM_identity) { $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; } //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag //which is appended after calculating the signature - //https://tools.ietf.org/html/rfc6376#section-3.5 + //https://www.rfc-editor.org/rfc/rfc6376#section-3.5 $dkimSignatureHeader = 'DKIM-Signature: v=1;' . ' d=' . $this->DKIM_domain . ';' . ' s=' . $this->DKIM_selector . ';' . static::$LE . @@ -4726,6 +5246,28 @@ public static function hasLineLongerThanMax($str) return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); } + /** + * If a string contains any "special" characters, double-quote the name, + * and escape any double quotes with a backslash. + * + * @param string $str + * + * @return string + * + * @see RFC822 3.4.1 + */ + public static function quotedString($str) + { + if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) { + //If the string contains any of these chars, it must be double-quoted + //and any double quotes must be escaped with a backslash + return '"' . str_replace('"', '\\"', $str) . '"'; + } + + //Return the string untouched, it doesn't need quoting + return $str; + } + /** * Allows for public read access to 'to' property. * Before the send() call, queued addresses (i.e. with IDN) are not yet included. @@ -4801,9 +5343,9 @@ protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $ } /** - * Get the OAuth instance. + * Get the OAuthTokenProvider instance. * - * @return OAuth + * @return OAuthTokenProvider */ public function getOAuth() { @@ -4811,9 +5353,9 @@ public function getOAuth() } /** - * Set an OAuth instance. + * Set an OAuthTokenProvider instance. */ - public function setOAuth(OAuth $oauth) + public function setOAuth(OAuthTokenProvider $oauth) { $this->oauth = $oauth; } diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index cd6fc2f2e7..1190a1e20d 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer POP-Before-SMTP Authentication Class. * PHP Version 5.5. @@ -9,10 +10,10 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -45,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.1.5'; + const VERSION = '6.10.0'; /** * Default POP3 port number. @@ -62,12 +63,16 @@ class POP3 const DEFAULT_TIMEOUT = 30; /** - * Debug display level. - * Options: 0 = no, 1+ = yes. + * POP3 class debug output mode. + * Debug output level. + * Options: + * @see POP3::DEBUG_OFF: No output + * @see POP3::DEBUG_SERVER: Server messages, connection/server errors + * @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors * * @var int */ - public $do_debug = 0; + public $do_debug = self::DEBUG_OFF; /** * POP3 mail server hostname. @@ -130,6 +135,28 @@ class POP3 */ const LE = "\r\n"; + /** + * Debug level for no output. + * + * @var int + */ + const DEBUG_OFF = 0; + + /** + * Debug level to show server -> client messages + * also shows clients connection errors or errors from server + * + * @var int + */ + const DEBUG_SERVER = 1; + + /** + * Debug level to show client -> server and server -> client messages. + * + * @var int + */ + const DEBUG_CLIENT = 2; + /** * Simple static wrapper for all-in-one POP before SMTP. * @@ -172,13 +199,13 @@ public static function popBeforeSmtp( public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) { $this->host = $host; - // If no port value provided, use default + //If no port value provided, use default if (false === $port) { $this->port = static::DEFAULT_PORT; } else { $this->port = (int) $port; } - // If no timeout value provided, use default + //If no timeout value provided, use default if (false === $timeout) { $this->tval = static::DEFAULT_TIMEOUT; } else { @@ -187,9 +214,9 @@ public function authorise($host, $port = false, $timeout = false, $username = '' $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; - // Reset the error log + //Reset the error log $this->errors = []; - // connect + //Connect $result = $this->connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->login($this->username, $this->password); @@ -199,7 +226,7 @@ public function authorise($host, $port = false, $timeout = false, $username = '' return true; } } - // We need to disconnect regardless of whether the login succeeded + //We need to disconnect regardless of whether the login succeeded $this->disconnect(); return false; @@ -216,35 +243,37 @@ public function authorise($host, $port = false, $timeout = false, $username = '' */ public function connect($host, $port = false, $tval = 30) { - // Are we already connected? + //Are we already connected? if ($this->connected) { return true; } //On Windows this will raise a PHP Warning error if the hostname doesn't exist. //Rather than suppress it with @fsockopen, capture it cleanly instead - set_error_handler([$this, 'catchWarning']); + set_error_handler(function () { + call_user_func_array([$this, 'catchWarning'], func_get_args()); + }); if (false === $port) { $port = static::DEFAULT_PORT; } - // connect to the POP3 server + //Connect to the POP3 server $errno = 0; $errstr = ''; $this->pop_conn = fsockopen( - $host, // POP3 Host - $port, // Port # - $errno, // Error Number - $errstr, // Error Message + $host, //POP3 Host + $port, //Port # + $errno, //Error Number + $errstr, //Error Message $tval - ); // Timeout (seconds) - // Restore the error handler + ); //Timeout (seconds) + //Restore the error handler restore_error_handler(); - // Did we connect? + //Did we connect? if (false === $this->pop_conn) { - // It would appear not... + //It would appear not... $this->setError( "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr" ); @@ -252,14 +281,14 @@ public function connect($host, $port = false, $tval = 30) return false; } - // Increase the stream time-out + //Increase the stream time-out stream_set_timeout($this->pop_conn, $tval, 0); - // Get the POP3 server response + //Get the POP3 server response $pop3_response = $this->getResponse(); - // Check for the +OK + //Check for the +OK if ($this->checkResponse($pop3_response)) { - // The connection is established and the POP3 server is talking + //The connection is established and the POP3 server is talking $this->connected = true; return true; @@ -281,6 +310,7 @@ public function login($username = '', $password = '') { if (!$this->connected) { $this->setError('Not connected to POP3 server'); + return false; } if (empty($username)) { $username = $this->username; @@ -289,11 +319,11 @@ public function login($username = '', $password = '') $password = $this->password; } - // Send the Username + //Send the Username $this->sendString("USER $username" . static::LE); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { - // Send the Password + //Send the Password $this->sendString("PASS $password" . static::LE); $pop3_response = $this->getResponse(); if ($this->checkResponse($pop3_response)) { @@ -309,7 +339,21 @@ public function login($username = '', $password = '') */ public function disconnect() { - $this->sendString('QUIT'); + // If could not connect at all, no need to disconnect + if ($this->pop_conn === false) { + return; + } + + $this->sendString('QUIT' . static::LE); + + // RFC 1939 shows POP3 server sending a +OK response to the QUIT command. + // Try to get it. Ignore any failures here. + try { + $this->getResponse(); + } catch (Exception $e) { + //Do nothing + } + //The QUIT command may cause the daemon to exit, which will kill our connection //So ignore errors here try { @@ -317,6 +361,10 @@ public function disconnect() } catch (Exception $e) { //Do nothing } + + // Clean up attributes. + $this->connected = false; + $this->pop_conn = false; } /** @@ -329,7 +377,7 @@ public function disconnect() protected function getResponse($size = 128) { $response = fgets($this->pop_conn, $size); - if ($this->do_debug >= 1) { + if ($this->do_debug >= self::DEBUG_SERVER) { echo 'Server -> Client: ', $response; } @@ -346,7 +394,7 @@ protected function getResponse($size = 128) protected function sendString($string) { if ($this->pop_conn) { - if ($this->do_debug >= 2) { //Show client messages when debug >= 2 + if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2 echo 'Client -> Server: ', $string; } @@ -384,7 +432,7 @@ protected function checkResponse($string) protected function setError($error) { $this->errors[] = $error; - if ($this->do_debug >= 1) { + if ($this->do_debug >= self::DEBUG_SERVER) { echo '<pre>'; foreach ($this->errors as $e) { print_r($e); diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 1e38ba7da3..7226ee93be 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -1,4 +1,5 @@ <?php + /** * PHPMailer RFC821 SMTP email transport class. * PHP Version 5.5. @@ -9,10 +10,10 @@ * @author Jim Jagielski (jimjag) <jimjag@gmail.com> * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net> * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2019 Marcus Bointon + * @copyright 2012 - 2020 Marcus Bointon * @copyright 2010 - 2012 Jim Jagielski * @copyright 2004 - 2009 Andy Prevost - * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License * @note This program is distributed in the hope that it will be useful - WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. @@ -34,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.1.5'; + const VERSION = '6.10.0'; /** * SMTP line break constant. @@ -50,11 +51,18 @@ class SMTP */ const DEFAULT_PORT = 25; + /** + * The SMTPs port to use if one is not specified. + * + * @var int + */ + const DEFAULT_SECURE_PORT = 465; + /** * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, * *excluding* a trailing CRLF break. * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 + * @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.6 * * @var int */ @@ -64,7 +72,7 @@ class SMTP * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, * *including* a trailing CRLF line break. * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 + * @see https://www.rfc-editor.org/rfc/rfc5321#section-4.5.3.1.5 * * @var int */ @@ -144,19 +152,28 @@ class SMTP /** * Whether to use VERP. * - * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Info on VERP + * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path + * @see https://www.postfix.org/VERP_README.html Info on VERP * * @var bool */ public $do_verp = false; + /** + * Whether to use SMTPUTF8. + * + * @see https://www.rfc-editor.org/rfc/rfc6531 + * + * @var bool + */ + public $do_smtputf8 = false; + /** * The timeout value for connection, in seconds. * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. * - * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 + * @see https://www.rfc-editor.org/rfc/rfc2821#section-4.5.3.2 * * @var int */ @@ -179,12 +196,27 @@ class SMTP */ protected $smtp_transaction_id_patterns = [ 'exim' => '/[\d]{3} OK id=(.*)/', - 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', - 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', - 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', + 'sendmail' => '/[\d]{3} 2\.0\.0 (.*) Message/', + 'postfix' => '/[\d]{3} 2\.0\.0 Ok: queued as (.*)/', + 'Microsoft_ESMTP' => '/[0-9]{3} 2\.[\d]\.0 (.*)@(?:.*) Queued mail for delivery/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', - 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + 'CampaignMonitor' => '/[\d]{3} 2\.0\.0 OK:([a-zA-Z\d]{48})/', + 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', + 'ZoneMTA' => '/[\d]{3} Message queued as (.*)/', + 'Mailjet' => '/[\d]{3} OK queued as (.*)/', + ]; + + /** + * Allowed SMTP XCLIENT attributes. + * Must be allowed by the SMTP server. EHLO response is not checked. + * + * @see https://www.postfix.org/XCLIENT_README.html + * + * @var array + */ + public static $xclient_allowed_attributes = [ + 'NAME', 'ADDR', 'PORT', 'PROTO', 'HELO', 'LOGIN', 'DESTADDR', 'DESTPORT' ]; /** @@ -257,7 +289,8 @@ protected function edebug($str, $level = 0) } //Is this a PSR-3 logger? if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) { - $this->Debugoutput->debug($str); + //Remove trailing line breaks potentially added by calls to SMTP::client_send() + $this->Debugoutput->debug(rtrim($str, "\r\n")); return; } @@ -270,6 +303,7 @@ protected function edebug($str, $level = 0) switch ($this->Debugoutput) { case 'error_log': //Don't output, just log + /** @noinspection ForgottenDebugOutputInspection */ error_log($str); break; case 'html': @@ -311,17 +345,11 @@ protected function edebug($str, $level = 0) */ public function connect($host, $port = null, $timeout = 30, $options = []) { - static $streamok; - //This is enabled by default since 5.0.0 but some providers disable it - //Check this once and cache the result - if (null === $streamok) { - $streamok = function_exists('stream_socket_client'); - } - // Clear errors to avoid confusion + //Clear errors to avoid confusion $this->setError(''); - // Make sure we are __not__ connected + //Make sure we are __not__ connected if ($this->connected()) { - // Already connected, generate error + //Already connected, generate error $this->setError('Already connected to a server'); return false; @@ -329,18 +357,68 @@ public function connect($host, $port = null, $timeout = 30, $options = []) if (empty($port)) { $port = self::DEFAULT_PORT; } - // Connect to the SMTP server + //Connect to the SMTP server $this->edebug( "Connection: opening to $host:$port, timeout=$timeout, options=" . (count($options) > 0 ? var_export($options, true) : 'array()'), self::DEBUG_CONNECTION ); + + $this->smtp_conn = $this->getSMTPConnection($host, $port, $timeout, $options); + + if ($this->smtp_conn === false) { + //Error info already set inside `getSMTPConnection()` + return false; + } + + $this->edebug('Connection: opened', self::DEBUG_CONNECTION); + + //Get any announcement + $this->last_reply = $this->get_lines(); + $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); + $responseCode = (int)substr($this->last_reply, 0, 3); + if ($responseCode === 220) { + return true; + } + //Anything other than a 220 response means something went wrong + //RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error + //https://www.rfc-editor.org/rfc/rfc5321#section-3.1 + if ($responseCode === 554) { + $this->quit(); + } + //This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down) + $this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION); + $this->close(); + return false; + } + + /** + * Create connection to the SMTP server. + * + * @param string $host SMTP server IP or host name + * @param int $port The port number to connect to + * @param int $timeout How long to wait for the connection to open + * @param array $options An array of options for stream_context_create() + * + * @return false|resource + */ + protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = []) + { + static $streamok; + //This is enabled by default since 5.0.0 but some providers disable it + //Check this once and cache the result + if (null === $streamok) { + $streamok = function_exists('stream_socket_client'); + } + $errno = 0; $errstr = ''; if ($streamok) { $socket_context = stream_context_create($options); - set_error_handler([$this, 'errorHandler']); - $this->smtp_conn = stream_socket_client( + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); + $connection = stream_socket_client( $host . ':' . $port, $errno, $errstr, @@ -348,25 +426,27 @@ public function connect($host, $port = null, $timeout = 30, $options = []) STREAM_CLIENT_CONNECT, $socket_context ); - restore_error_handler(); } else { //Fall back to fsockopen which should work in more places, but is missing some features $this->edebug( 'Connection: stream_socket_client not available, falling back to fsockopen', self::DEBUG_CONNECTION ); - set_error_handler([$this, 'errorHandler']); - $this->smtp_conn = fsockopen( + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); + $connection = fsockopen( $host, $port, $errno, $errstr, $timeout ); - restore_error_handler(); } - // Verify we connected properly - if (!is_resource($this->smtp_conn)) { + restore_error_handler(); + + //Verify we connected properly + if (!is_resource($connection)) { $this->setError( 'Failed to connect to server', '', @@ -381,22 +461,19 @@ public function connect($host, $port = null, $timeout = 30, $options = []) return false; } - $this->edebug('Connection: opened', self::DEBUG_CONNECTION); - // SMTP server can take longer to respond, give longer timeout for first read - // Windows does not have support for this timeout function + + //SMTP server can take longer to respond, give longer timeout for first read + //Windows does not have support for this timeout function if (strpos(PHP_OS, 'WIN') !== 0) { - $max = (int) ini_get('max_execution_time'); - // Don't bother if unlimited - if (0 !== $max && $timeout > $max) { + $max = (int)ini_get('max_execution_time'); + //Don't bother if unlimited, or if set_time_limit is disabled + if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { @set_time_limit($timeout); } - stream_set_timeout($this->smtp_conn, $timeout, 0); + stream_set_timeout($connection, $timeout, 0); } - // Get any announcement - $announce = $this->get_lines(); - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); - return true; + return $connection; } /** @@ -420,8 +497,10 @@ public function startTLS() $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; } - // Begin encrypted connection - set_error_handler([$this, 'errorHandler']); + //Begin encrypted connection + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $crypto_ok = stream_socket_enable_crypto( $this->smtp_conn, true, @@ -441,7 +520,7 @@ public function startTLS() * @param string $username The user name * @param string $password The password * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) - * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication + * @param OAuthTokenProvider $OAuth An optional OAuthTokenProvider instance for XOAUTH2 authentication * * @return bool True if successfully authenticated */ @@ -458,11 +537,11 @@ public function authenticate( } if (array_key_exists('EHLO', $this->server_caps)) { - // SMTP extensions are available; try to find a proper authentication method + //SMTP extensions are available; try to find a proper authentication method if (!array_key_exists('AUTH', $this->server_caps)) { $this->setError('Authentication is not allowed at this stage'); - // 'at this stage' means that auth may be allowed after the stage changes - // e.g. after STARTTLS + //'at this stage' means that auth may be allowed after the stage changes + //e.g. after STARTTLS return false; } @@ -506,22 +585,25 @@ public function authenticate( } switch ($authtype) { case 'PLAIN': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { return false; } - // Send encoded username and password - if (!$this->sendCommand( - 'User & Password', - base64_encode("\0" . $username . "\0" . $password), - 235 - ) + //Send encoded username and password + if ( + //Format from https://www.rfc-editor.org/rfc/rfc4616#section-2 + //We skip the first field (it's forgery), so the string starts with a null byte + !$this->sendCommand( + 'User & Password', + base64_encode("\0" . $username . "\0" . $password), + 235 + ) ) { return false; } break; case 'LOGIN': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { return false; } @@ -533,17 +615,17 @@ public function authenticate( } break; case 'CRAM-MD5': - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { return false; } - // Get the challenge + //Get the challenge $challenge = base64_decode(substr($this->last_reply, 4)); - // Build the response + //Build the response $response = $username . ' ' . $this->hmac($challenge, $password); - // send encoded credentials + //send encoded credentials return $this->sendCommand('Username', base64_encode($response), 235); case 'XOAUTH2': //The OAuth instance must be set up prior to requesting auth. @@ -552,7 +634,7 @@ public function authenticate( } $oauth = $OAuth->getOauth64(); - // Start authentication + //Start authentication if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { return false; } @@ -582,15 +664,15 @@ protected function hmac($data, $key) return hash_hmac('md5', $data, $key); } - // The following borrowed from - // http://php.net/manual/en/function.mhash.php#27225 + //The following borrowed from + //https://www.php.net/manual/en/function.mhash.php#27225 - // RFC 2104 HMAC implementation for php. - // Creates an md5 HMAC. - // Eliminates the need to install mhash to compute a HMAC - // by Lance Rushing + //RFC 2104 HMAC implementation for php. + //Creates an md5 HMAC. + //Eliminates the need to install mhash to compute a HMAC + //by Lance Rushing - $bytelen = 64; // byte length for md5 + $bytelen = 64; //byte length for md5 if (strlen($key) > $bytelen) { $key = pack('H*', md5($key)); } @@ -613,7 +695,7 @@ public function connected() if (is_resource($this->smtp_conn)) { $sock_status = stream_get_meta_data($this->smtp_conn); if ($sock_status['eof']) { - // The socket is valid but we are not connected + //The socket is valid but we are not connected $this->edebug( 'SMTP NOTICE: EOF caught while checking if connected', self::DEBUG_CLIENT @@ -623,7 +705,7 @@ public function connected() return false; } - return true; // everything looks good + return true; //everything looks good } return false; @@ -637,11 +719,10 @@ public function connected() */ public function close() { - $this->setError(''); $this->server_caps = null; $this->helo_rply = null; if (is_resource($this->smtp_conn)) { - // close the connection and cleanup + //Close the connection and cleanup fclose($this->smtp_conn); $this->smtp_conn = null; //Makes for cleaner serialization $this->edebug('Connection: closed', self::DEBUG_CONNECTION); @@ -651,8 +732,8 @@ public function close() /** * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, - * finializing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be + * finalizing the mail transaction. $msg_data is the message + * that is to be sent with the headers. Each header needs to be * on a single line followed by a <CRLF> with the message headers * and the message body being separated by an additional <CRLF>. * Implements RFC 821: DATA <CRLF>. @@ -676,11 +757,11 @@ public function data($msg_data) * NOTE: this does not count towards line-length limit. */ - // Normalize line breaks before exploding + //Normalize line breaks before exploding $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field - * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * of the first line (':' separated) does not contain a space then it _should_ be a header, and we will * process all lines before a blank line as headers. */ @@ -722,7 +803,8 @@ public function data($msg_data) //Send the lines to the server foreach ($lines_out as $line_out) { - //RFC2821 section 4.5.2 + //Dot-stuffing as per RFC5321 section 4.5.2 + //https://www.rfc-editor.org/rfc/rfc5321#section-4.5.2 if (!empty($line_out) && $line_out[0] === '.') { $line_out = '.' . $line_out; } @@ -756,7 +838,16 @@ public function data($msg_data) public function hello($host = '') { //Try extended hello first (RFC 2821) - return $this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host); + if ($this->sendHello('EHLO', $host)) { + return true; + } + + //Some servers shut down the SMTP service here (RFC 5321) + if (substr($this->helo_rply, 0, 3) == '421') { + return false; + } + + return $this->sendHello('HELO', $host); } /** @@ -831,7 +922,15 @@ protected function parseHelloFields($type) * $from. Returns true if successful or false otherwise. If True * the mail transaction is started and then one or more recipient * commands may be called followed by a data command. - * Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>. + * Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF> and + * two extensions, namely XVERP and SMTPUTF8. + * + * The server's EHLO response is not checked. If use of either + * extensions is enabled even though the server does not support + * that, mail submission will fail. + * + * XVERP is documented at https://www.postfix.org/VERP_README.html + * and SMTPUTF8 is specified in RFC 6531. * * @param string $from Source address of this message * @@ -840,10 +939,11 @@ protected function parseHelloFields($type) public function mail($from) { $useVerp = ($this->do_verp ? ' XVERP' : ''); + $useSmtputf8 = ($this->do_smtputf8 ? ' SMTPUTF8' : ''); return $this->sendCommand( 'MAIL FROM', - 'MAIL FROM:<' . $from . '>' . $useVerp, + 'MAIL FROM:<' . $from . '>' . $useSmtputf8 . $useVerp, 250 ); } @@ -909,6 +1009,25 @@ public function recipient($address, $dsn = '') ); } + /** + * Send SMTP XCLIENT command to server and check its return code. + * + * @return bool True on success + */ + public function xclient(array $vars) + { + $xclient_options = ""; + foreach ($vars as $key => $value) { + if (in_array($key, SMTP::$xclient_allowed_attributes)) { + $xclient_options .= " {$key}={$value}"; + } + } + if (!$xclient_options) { + return true; + } + return $this->sendCommand('XCLIENT', 'XCLIENT' . $xclient_options, 250); + } + /** * Send an SMTP RSET command. * Abort any transaction that is currently in progress. @@ -946,12 +1065,12 @@ protected function sendCommand($command, $commandstring, $expect) $this->client_send($commandstring . static::LE, $command); $this->last_reply = $this->get_lines(); - // Fetch SMTP code and possible error code explanation + //Fetch SMTP code and possible error code explanation $matches = []; if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) { $code = (int) $matches[1]; $code_ex = (count($matches) > 2 ? $matches[2] : null); - // Cut off error code from each response line + //Cut off error code from each response line $detail = preg_replace( "/{$code}[ -]" . ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', @@ -959,7 +1078,7 @@ protected function sendCommand($command, $commandstring, $expect) $this->last_reply ); } else { - // Fall back to simple parsing if regex fails + //Fall back to simple parsing if regex fails $code = (int) substr($this->last_reply, 0, 3); $code_ex = null; $detail = substr($this->last_reply, 4); @@ -982,7 +1101,10 @@ protected function sendCommand($command, $commandstring, $expect) return false; } - $this->setError(''); + //Don't clear the error store when using keepalive + if ($command !== 'RSET') { + $this->setError(''); + } return true; } @@ -1058,13 +1180,17 @@ public function client_send($data, $command = '') { //If SMTP transcripts are left enabled, or debug output is posted online //it can leak credentials, so hide credentials in all but lowest level - if (self::DEBUG_LOWLEVEL > $this->do_debug && - in_array($command, ['User & Password', 'Username', 'Password'], true)) { + if ( + self::DEBUG_LOWLEVEL > $this->do_debug && + in_array($command, ['User & Password', 'Username', 'Password'], true) + ) { $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); } else { $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); } - set_error_handler([$this, 'errorHandler']); + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); $result = fwrite($this->smtp_conn, $data); restore_error_handler(); @@ -1113,7 +1239,7 @@ public function getServerExt($name) if (!$this->server_caps) { $this->setError('No HELO/EHLO was sent'); - return; + return null; } if (!array_key_exists($name, $this->server_caps)) { @@ -1125,7 +1251,7 @@ public function getServerExt($name) } $this->setError('HELO handshake was used; No information about server extensions available'); - return; + return null; } return $this->server_caps[$name]; @@ -1152,7 +1278,7 @@ public function getLastReply() */ protected function get_lines() { - // If the connection is bad, give up straight away + //If the connection is bad, give up straight away if (!is_resource($this->smtp_conn)) { return ''; } @@ -1166,33 +1292,63 @@ protected function get_lines() $selW = null; while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { //Must pass vars in here as params are by reference - if (!stream_select($selR, $selW, $selW, $this->Timelimit)) { + //solution for signals inspired by https://github.com/symfony/symfony/pull/6540 + set_error_handler(function () { + call_user_func_array([$this, 'errorHandler'], func_get_args()); + }); + $n = stream_select($selR, $selW, $selW, $this->Timelimit); + restore_error_handler(); + + if ($n === false) { + $message = $this->getError()['detail']; + + $this->edebug( + 'SMTP -> get_lines(): select failed (' . $message . ')', + self::DEBUG_LOWLEVEL + ); + + //stream_select returns false when the `select` system call is interrupted + //by an incoming signal, try the select again + if (stripos($message, 'interrupted system call') !== false) { + $this->edebug( + 'SMTP -> get_lines(): retrying stream_select', + self::DEBUG_LOWLEVEL + ); + $this->setError(''); + continue; + } + + break; + } + + if (!$n) { $this->edebug( - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', + 'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)', self::DEBUG_LOWLEVEL ); break; } + //Deliberate noise suppression - errors are handled afterwards $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); $data .= $str; - // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), - // or 4th character is a space or a line break char, we are done reading, break the loop. - // String array access is a significant micro-optimisation over strlen + //If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), + //or 4th character is a space or a line break char, we are done reading, break the loop. + //String array access is a significant micro-optimisation over strlen if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") { break; } - // Timed-out? Log and break + //Timed-out? Log and break $info = stream_get_meta_data($this->smtp_conn); if ($info['timed_out']) { $this->edebug( - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', + 'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)', self::DEBUG_LOWLEVEL ); break; } - // Now check if reads took too long + //Now check if reads took too long if ($endtime && time() > $endtime) { $this->edebug( 'SMTP -> get_lines(): timelimit reached (' . @@ -1226,6 +1382,26 @@ public function getVerp() return $this->do_verp; } + /** + * Enable or disable use of SMTPUTF8. + * + * @param bool $enabled + */ + public function setSMTPUTF8($enabled = false) + { + $this->do_smtputf8 = $enabled; + } + + /** + * Get SMTPUTF8 use. + * + * @return bool + */ + public function getSMTPUTF8() + { + return $this->do_smtputf8; + } + /** * Set error messages and codes. * diff --git a/vendor/psr/container/README.md b/vendor/psr/container/README.md index 084f6df51b..1b9d9e5708 100644 --- a/vendor/psr/container/README.md +++ b/vendor/psr/container/README.md @@ -1,5 +1,13 @@ -# PSR Container +Container interface +============== -This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md). +This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. + +Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-11/ +[package-url]: https://packagist.org/packages/psr/container +[implementation-url]: https://packagist.org/providers/psr/container-implementation -Note that this is not a container implementation of its own. See the specification for more details. diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json index b8ee01265d..baf6cd1a03 100644 --- a/vendor/psr/container/composer.json +++ b/vendor/psr/container/composer.json @@ -8,11 +8,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": ">=7.4.0" }, "autoload": { "psr-4": { @@ -21,7 +21,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php index d35c6b4d86..0f213f2fed 100644 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ b/vendor/psr/container/src/ContainerExceptionInterface.php @@ -1,13 +1,12 @@ <?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ namespace Psr\Container; +use Throwable; + /** * Base interface representing a generic exception in a container. */ -interface ContainerExceptionInterface +interface ContainerExceptionInterface extends Throwable { } diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php index c3a7206fa0..b2cad40153 100644 --- a/vendor/psr/container/src/ContainerInterface.php +++ b/vendor/psr/container/src/ContainerInterface.php @@ -1,7 +1,6 @@ <?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ + +declare(strict_types=1); namespace Psr\Container; @@ -20,7 +19,7 @@ interface ContainerInterface * * @return mixed Entry. */ - public function get($id); + public function get(string $id); /** * Returns true if the container can return an entry for the given identifier. @@ -33,5 +32,5 @@ public function get($id); * * @return bool */ - public function has($id); + public function has(string $id): bool; } diff --git a/vendor/psr/container/src/NotFoundExceptionInterface.php b/vendor/psr/container/src/NotFoundExceptionInterface.php index 6566704eda..650bf464eb 100644 --- a/vendor/psr/container/src/NotFoundExceptionInterface.php +++ b/vendor/psr/container/src/NotFoundExceptionInterface.php @@ -1,7 +1,4 @@ <?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ namespace Psr\Container; diff --git a/vendor/psr/http-client/CHANGELOG.md b/vendor/psr/http-client/CHANGELOG.md new file mode 100644 index 0000000000..babba7c7b2 --- /dev/null +++ b/vendor/psr/http-client/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.3 + +Add `source` link in composer.json. No code changes. + +## 1.0.2 + +Allow PSR-7 (psr/http-message) 2.0. No code changes. + +## 1.0.1 + +Allow installation with PHP 8. No code changes. + +## 1.0.0 + +First stable release. No changes since 0.3.0. + +## 0.3.0 + +Added Interface suffix on exceptions + +## 0.2.0 + +All exceptions are in `Psr\Http\Client` namespace + +## 0.1.0 + +First release diff --git a/vendor/psr/http-client/LICENSE b/vendor/psr/http-client/LICENSE new file mode 100644 index 0000000000..cd5e0020af --- /dev/null +++ b/vendor/psr/http-client/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/psr/http-client/README.md b/vendor/psr/http-client/README.md new file mode 100644 index 0000000000..84af5c55d5 --- /dev/null +++ b/vendor/psr/http-client/README.md @@ -0,0 +1,12 @@ +HTTP Client +=========== + +This repository holds all the common code related to [PSR-18 (HTTP Client)][psr-url]. + +Note that this is not a HTTP Client implementation of its own. It is merely abstractions that describe the components of a HTTP Client. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-18 +[package-url]: https://packagist.org/packages/psr/http-client +[implementation-url]: https://packagist.org/providers/psr/http-client-implementation diff --git a/vendor/psr/http-client/composer.json b/vendor/psr/http-client/composer.json new file mode 100644 index 0000000000..6fed350beb --- /dev/null +++ b/vendor/psr/http-client/composer.json @@ -0,0 +1,30 @@ +{ + "name": "psr/http-client", + "description": "Common interface for HTTP clients", + "keywords": ["psr", "psr-18", "http", "http-client"], + "homepage": "https://github.com/php-fig/http-client", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/psr/http-client/src/ClientExceptionInterface.php b/vendor/psr/http-client/src/ClientExceptionInterface.php new file mode 100644 index 0000000000..aa0b9cf14b --- /dev/null +++ b/vendor/psr/http-client/src/ClientExceptionInterface.php @@ -0,0 +1,10 @@ +<?php + +namespace Psr\Http\Client; + +/** + * Every HTTP client related exception MUST implement this interface. + */ +interface ClientExceptionInterface extends \Throwable +{ +} diff --git a/vendor/psr/http-client/src/ClientInterface.php b/vendor/psr/http-client/src/ClientInterface.php new file mode 100644 index 0000000000..ad99fd4b77 --- /dev/null +++ b/vendor/psr/http-client/src/ClientInterface.php @@ -0,0 +1,20 @@ +<?php + +namespace Psr\Http\Client; + +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; + +interface ClientInterface +{ + /** + * Sends a PSR-7 request and returns a PSR-7 response. + * + * @param RequestInterface $request + * + * @return ResponseInterface + * + * @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request. + */ + public function sendRequest(RequestInterface $request): ResponseInterface; +} diff --git a/vendor/psr/http-client/src/NetworkExceptionInterface.php b/vendor/psr/http-client/src/NetworkExceptionInterface.php new file mode 100644 index 0000000000..4a11627c7e --- /dev/null +++ b/vendor/psr/http-client/src/NetworkExceptionInterface.php @@ -0,0 +1,24 @@ +<?php + +namespace Psr\Http\Client; + +use Psr\Http\Message\RequestInterface; + +/** + * Thrown when the request cannot be completed because of network issues. + * + * There is no response object as this exception is thrown when no response has been received. + * + * Example: the target host name can not be resolved or the connection failed. + */ +interface NetworkExceptionInterface extends ClientExceptionInterface +{ + /** + * Returns the request. + * + * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() + * + * @return RequestInterface + */ + public function getRequest(): RequestInterface; +} diff --git a/vendor/psr/http-client/src/RequestExceptionInterface.php b/vendor/psr/http-client/src/RequestExceptionInterface.php new file mode 100644 index 0000000000..b17fc34fd9 --- /dev/null +++ b/vendor/psr/http-client/src/RequestExceptionInterface.php @@ -0,0 +1,24 @@ +<?php + +namespace Psr\Http\Client; + +use Psr\Http\Message\RequestInterface; + +/** + * Exception for when a request failed. + * + * Examples: + * - Request is invalid (e.g. method is missing) + * - Runtime request errors (e.g. the body stream is not seekable) + */ +interface RequestExceptionInterface extends ClientExceptionInterface +{ + /** + * Returns the request. + * + * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() + * + * @return RequestInterface + */ + public function getRequest(): RequestInterface; +} diff --git a/vendor/psr/http-factory/.gitignore b/vendor/psr/http-factory/.gitignore deleted file mode 100644 index d8a7996ab3..0000000000 --- a/vendor/psr/http-factory/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -vendor/ diff --git a/vendor/psr/http-factory/.pullapprove.yml b/vendor/psr/http-factory/.pullapprove.yml deleted file mode 100644 index 8cf081942c..0000000000 --- a/vendor/psr/http-factory/.pullapprove.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: default -reviewers: - - - name: contributors - required: 1 - teams: - - http-factory-contributors diff --git a/vendor/psr/http-factory/README.md b/vendor/psr/http-factory/README.md index 41d362a625..bf8913b576 100644 --- a/vendor/psr/http-factory/README.md +++ b/vendor/psr/http-factory/README.md @@ -1,10 +1,12 @@ HTTP Factories ============== -This repository holds all interfaces related to [PSR-17 (HTTP Message Factories)][psr-17]. -Please refer to the specification for a description. +This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url]. -You can find implementations of the specification by looking for packages providing the -[psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) virtual package. +Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory. -[psr-17]: https://www.php-fig.org/psr/psr-17/ +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-17/ +[package-url]: https://packagist.org/packages/psr/http-factory +[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation diff --git a/vendor/psr/http-factory/composer.json b/vendor/psr/http-factory/composer.json index af62b290f9..82a1d3266b 100644 --- a/vendor/psr/http-factory/composer.json +++ b/vendor/psr/http-factory/composer.json @@ -1,6 +1,6 @@ { "name": "psr/http-factory", - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "psr", "psr-7", @@ -15,12 +15,15 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php b/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php index 7db4e30af7..d7adbf0e26 100644 --- a/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php +++ b/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php @@ -15,10 +15,10 @@ interface UploadedFileFactoryInterface * * @param StreamInterface $stream Underlying stream representing the * uploaded file content. - * @param int $size in bytes + * @param int|null $size in bytes * @param int $error PHP file upload error - * @param string $clientFilename Filename as provided by the client, if any. - * @param string $clientMediaType Media type as provided by the client, if any. + * @param string|null $clientFilename Filename as provided by the client, if any. + * @param string|null $clientMediaType Media type as provided by the client, if any. * * @return UploadedFileInterface * @@ -26,9 +26,9 @@ interface UploadedFileFactoryInterface */ public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = \UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface; } diff --git a/vendor/psr/http-message/README.md b/vendor/psr/http-message/README.md index 28185338f7..2668be6c30 100644 --- a/vendor/psr/http-message/README.md +++ b/vendor/psr/http-message/README.md @@ -10,4 +10,7 @@ interface that describes a HTTP message. See the specification for more details. Usage ----- -We'll certainly need some stuff in here. \ No newline at end of file +Before reading the usage guide we recommend reading the PSR-7 interfaces method list: + +* [`PSR-7 Interfaces Method List`](docs/PSR7-Interfaces.md) +* [`PSR-7 Usage Guide`](docs/PSR7-Usage.md) \ No newline at end of file diff --git a/vendor/psr/http-message/composer.json b/vendor/psr/http-message/composer.json index b0d2937a03..56e8c0a6db 100644 --- a/vendor/psr/http-message/composer.json +++ b/vendor/psr/http-message/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "autoload": { "psr-4": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } } } diff --git a/vendor/psr/http-message/docs/PSR7-Interfaces.md b/vendor/psr/http-message/docs/PSR7-Interfaces.md new file mode 100644 index 0000000000..3a7e7dda69 --- /dev/null +++ b/vendor/psr/http-message/docs/PSR7-Interfaces.md @@ -0,0 +1,130 @@ +# Interfaces + +The purpose of this list is to help in finding the methods when working with PSR-7. This can be considered as a cheatsheet for PSR-7 interfaces. + +The interfaces defined in PSR-7 are the following: + +| Class Name | Description | +|---|---| +| [Psr\Http\Message\MessageInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagemessageinterface) | Representation of a HTTP message | +| [Psr\Http\Message\RequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagerequestinterface) | Representation of an outgoing, client-side request. | +| [Psr\Http\Message\ServerRequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageserverrequestinterface) | Representation of an incoming, server-side HTTP request. | +| [Psr\Http\Message\ResponseInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageresponseinterface) | Representation of an outgoing, server-side response. | +| [Psr\Http\Message\StreamInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagestreaminterface) | Describes a data stream | +| [Psr\Http\Message\UriInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuriinterface) | Value object representing a URI. | +| [Psr\Http\Message\UploadedFileInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuploadedfileinterface) | Value object representing a file uploaded through an HTTP request. | + +## `Psr\Http\Message\MessageInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getProtocolVersion()` | Retrieve HTTP protocol version | 1.0 or 1.1 | +| `withProtocolVersion($version)` | Returns new message instance with given HTTP protocol version | | +| `getHeaders()` | Retrieve all HTTP Headers | [Request Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields), [Response Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields) | +| `hasHeader($name)` | Checks if HTTP Header with given name exists | | +| `getHeader($name)` | Retrieves a array with the values for a single header | | +| `getHeaderLine($name)` | Retrieves a comma-separated string of the values for a single header | | +| `withHeader($name, $value)` | Returns new message instance with given HTTP Header | if the header existed in the original instance, replaces the header value from the original message with the value provided when creating the new instance. | +| `withAddedHeader($name, $value)` | Returns new message instance with appended value to given header | If header already exists value will be appended, if not a new header will be created | +| `withoutHeader($name)` | Removes HTTP Header with given name| | +| `getBody()` | Retrieves the HTTP Message Body | Returns object implementing `StreamInterface`| +| `withBody(StreamInterface $body)` | Returns new message instance with given HTTP Message Body | | + + +## `Psr\Http\Message\RequestInterface` Methods + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getRequestTarget()` | Retrieves the message's request target | origin-form, absolute-form, authority-form, asterisk-form ([RFC7230](https://www.rfc-editor.org/rfc/rfc7230.txt)) | +| `withRequestTarget($requestTarget)` | Return a new message instance with the specific request-target | | +| `getMethod()` | Retrieves the HTTP method of the request. | GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE (defined in [RFC7231](https://tools.ietf.org/html/rfc7231)), PATCH (defined in [RFC5789](https://tools.ietf.org/html/rfc5789)) | +| `withMethod($method)` | Returns a new message instance with the provided HTTP method | | +| `getUri()` | Retrieves the URI instance | | +| `withUri(UriInterface $uri, $preserveHost = false)` | Returns a new message instance with the provided URI | | + + +## `Psr\Http\Message\ServerRequestInterface` Methods + +Same methods as `Psr\Http\Message\RequestInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getServerParams() ` | Retrieve server parameters | Typically derived from `$_SERVER` | +| `getCookieParams()` | Retrieves cookies sent by the client to the server. | Typically derived from `$_COOKIES` | +| `withCookieParams(array $cookies)` | Returns a new request instance with the specified cookies | | +| `withQueryParams(array $query)` | Returns a new request instance with the specified query string arguments | | +| `getUploadedFiles()` | Retrieve normalized file upload data | | +| `withUploadedFiles(array $uploadedFiles)` | Returns a new request instance with the specified uploaded files | | +| `getParsedBody()` | Retrieve any parameters provided in the request body | | +| `withParsedBody($data)` | Returns a new request instance with the specified body parameters | | +| `getAttributes()` | Retrieve attributes derived from the request | | +| `getAttribute($name, $default = null)` | Retrieve a single derived request attribute | | +| `withAttribute($name, $value)` | Returns a new request instance with the specified derived request attribute | | +| `withoutAttribute($name)` | Returns a new request instance that without the specified derived request attribute | | + +## `Psr\Http\Message\ResponseInterface` Methods: + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStatusCode()` | Gets the response status code. | | +| `withStatus($code, $reasonPhrase = '')` | Returns a new response instance with the specified status code and, optionally, reason phrase. | | +| `getReasonPhrase()` | Gets the response reason phrase associated with the status code. | | + +## `Psr\Http\Message\StreamInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `__toString()` | Reads all data from the stream into a string, from the beginning to end. | | +| `close()` | Closes the stream and any underlying resources. | | +| `detach()` | Separates any underlying resources from the stream. | | +| `getSize()` | Get the size of the stream if known. | | +| `eof()` | Returns true if the stream is at the end of the stream.| | +| `isSeekable()` | Returns whether or not the stream is seekable. | | +| `seek($offset, $whence = SEEK_SET)` | Seek to a position in the stream. | | +| `rewind()` | Seek to the beginning of the stream. | | +| `isWritable()` | Returns whether or not the stream is writable. | | +| `write($string)` | Write data to the stream. | | +| `isReadable()` | Returns whether or not the stream is readable. | | +| `read($length)` | Read data from the stream. | | +| `getContents()` | Returns the remaining contents in a string | | +| `getMetadata($key = null)()` | Get stream metadata as an associative array or retrieve a specific key. | | + +## `Psr\Http\Message\UriInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getScheme()` | Retrieve the scheme component of the URI. | | +| `getAuthority()` | Retrieve the authority component of the URI. | | +| `getUserInfo()` | Retrieve the user information component of the URI. | | +| `getHost()` | Retrieve the host component of the URI. | | +| `getPort()` | Retrieve the port component of the URI. | | +| `getPath()` | Retrieve the path component of the URI. | | +| `getQuery()` | Retrieve the query string of the URI. | | +| `getFragment()` | Retrieve the fragment component of the URI. | | +| `withScheme($scheme)` | Return an instance with the specified scheme. | | +| `withUserInfo($user, $password = null)` | Return an instance with the specified user information. | | +| `withHost($host)` | Return an instance with the specified host. | | +| `withPort($port)` | Return an instance with the specified port. | | +| `withPath($path)` | Return an instance with the specified path. | | +| `withQuery($query)` | Return an instance with the specified query string. | | +| `withFragment($fragment)` | Return an instance with the specified URI fragment. | | +| `__toString()` | Return the string representation as a URI reference. | | + +## `Psr\Http\Message\UploadedFileInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStream()` | Retrieve a stream representing the uploaded file. | | +| `moveTo($targetPath)` | Move the uploaded file to a new location. | | +| `getSize()` | Retrieve the file size. | | +| `getError()` | Retrieve the error associated with the uploaded file. | | +| `getClientFilename()` | Retrieve the filename sent by the client. | | +| `getClientMediaType()` | Retrieve the media type sent by the client. | | + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + diff --git a/vendor/psr/http-message/docs/PSR7-Usage.md b/vendor/psr/http-message/docs/PSR7-Usage.md new file mode 100644 index 0000000000..b6d048a341 --- /dev/null +++ b/vendor/psr/http-message/docs/PSR7-Usage.md @@ -0,0 +1,159 @@ +### PSR-7 Usage + +All PSR-7 applications comply with these interfaces +They were created to establish a standard between middleware implementations. + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + + +The following examples will illustrate how basic operations are done in PSR-7. + +##### Examples + + +For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) +All PSR-7 implementations should have the same behaviour. + +The following will be assumed: +`$request` is an object of `Psr\Http\Message\RequestInterface` and + +`$response` is an object implementing `Psr\Http\Message\RequestInterface` + + +### Working with HTTP Headers + +#### Adding headers to response: + +```php +$response->withHeader('My-Custom-Header', 'My Custom Message'); +``` + +#### Appending values to headers + +```php +$response->withAddedHeader('My-Custom-Header', 'The second message'); +``` + +#### Checking if header exists: + +```php +$request->hasHeader('My-Custom-Header'); // will return false +$response->hasHeader('My-Custom-Header'); // will return true +``` + +> Note: My-Custom-Header was only added in the Response + +#### Getting comma-separated values from a header (also applies to request) + +```php +// getting value from request headers +$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" +// getting value from response headers +$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" +``` + +#### Getting array of value from a header (also applies to request) +```php +// getting value from request headers +$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] +// getting value from response headers +$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] +``` + +#### Removing headers from HTTP Messages +```php +// removing a header from Request, removing deprecated "Content-MD5" header +$request->withoutHeader('Content-MD5'); + +// removing a header from Response +// effect: the browser won't know the size of the stream +// the browser will download the stream till it ends +$response->withoutHeader('Content-Length'); +``` + +### Working with HTTP Message Body + +When working with the PSR-7 there are two methods of implementation: +#### 1. Getting the body separately + +> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. + +```php +$body = $response->getBody(); +// operations on body, eg. read, write, seek +// ... +// replacing the old body +$response->withBody($body); +// this last statement is optional as we working with objects +// in this case the "new" body is same with the "old" one +// the $body variable has the same value as the one in $request, only the reference is passed +``` + +#### 2. Working directly on response + +> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required + +```php +$response->getBody()->write('hello'); +``` + +### Getting the body contents + +The following snippet gets the contents of a stream contents. +> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. +```php +$body = $response->getBody(); +$body->rewind(); // or $body->seek(0); +$bodyText = $body->getContents(); +``` +> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. + +### Append to body + +```php +$response->getBody()->write('Hello'); // writing directly +$body = $request->getBody(); // which is a `StreamInterface` +$body->write('xxxxx'); +``` + +### Prepend to body +Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. +The following example will explain the behaviour of streams. + +```php +// assuming our response is initially empty +$body = $repsonse->getBody(); +// writing the string "abcd" +$body->write('abcd'); + +// seeking to start of stream +$body->seek(0); +// writing 'ef' +$body->write('ef'); // at this point the stream contains "efcd" +``` + +#### Prepending by rewriting separately + +```php +// assuming our response body stream only contains: "abcd" +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // abcd +// seeking the stream to beginning +$body->rewind(); +$body->write('ef'); // stream contains "efcd" +$body->write($contents); // stream contains "efabcd" +``` + +> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. + +#### Prepending by using contents as a string +```php +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // efabcd +$contents = 'ef'.$contents; +$body->rewind(); +$body->write($contents); +``` diff --git a/vendor/psr/http-message/src/MessageInterface.php b/vendor/psr/http-message/src/MessageInterface.php index dd46e5ec81..8cdb4ed63a 100644 --- a/vendor/psr/http-message/src/MessageInterface.php +++ b/vendor/psr/http-message/src/MessageInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -38,7 +40,7 @@ public function getProtocolVersion(); * @param string $version HTTP protocol version * @return static */ - public function withProtocolVersion($version); + public function withProtocolVersion(string $version); /** * Retrieves all message header values. @@ -75,7 +77,7 @@ public function getHeaders(); * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - public function hasHeader($name); + public function hasHeader(string $name); /** * Retrieves a message header value by the given case-insensitive name. @@ -91,7 +93,7 @@ public function hasHeader($name); * header. If the header does not appear in the message, this method MUST * return an empty array. */ - public function getHeader($name); + public function getHeader(string $name); /** * Retrieves a comma-separated string of the values for a single header. @@ -112,7 +114,7 @@ public function getHeader($name); * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - public function getHeaderLine($name); + public function getHeaderLine(string $name); /** * Return an instance with the provided value replacing the specified header. @@ -129,7 +131,7 @@ public function getHeaderLine($name); * @return static * @throws \InvalidArgumentException for invalid header names or values. */ - public function withHeader($name, $value); + public function withHeader(string $name, $value); /** * Return an instance with the specified header appended with the given value. @@ -147,7 +149,7 @@ public function withHeader($name, $value); * @return static * @throws \InvalidArgumentException for invalid header names or values. */ - public function withAddedHeader($name, $value); + public function withAddedHeader(string $name, $value); /** * Return an instance without the specified header. @@ -161,7 +163,7 @@ public function withAddedHeader($name, $value); * @param string $name Case-insensitive header field name to remove. * @return static */ - public function withoutHeader($name); + public function withoutHeader(string $name); /** * Gets the body of the message. diff --git a/vendor/psr/http-message/src/RequestInterface.php b/vendor/psr/http-message/src/RequestInterface.php index a96d4fd636..38066df6bd 100644 --- a/vendor/psr/http-message/src/RequestInterface.php +++ b/vendor/psr/http-message/src/RequestInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -55,10 +57,10 @@ public function getRequestTarget(); * * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various * request-target forms allowed in request messages) - * @param mixed $requestTarget + * @param string $requestTarget * @return static */ - public function withRequestTarget($requestTarget); + public function withRequestTarget(string $requestTarget); /** * Retrieves the HTTP method of the request. @@ -82,7 +84,7 @@ public function getMethod(); * @return static * @throws \InvalidArgumentException for invalid HTTP methods. */ - public function withMethod($method); + public function withMethod(string $method); /** * Retrieves the URI instance. @@ -125,5 +127,5 @@ public function getUri(); * @param bool $preserveHost Preserve the original state of the Host header. * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false); + public function withUri(UriInterface $uri, bool $preserveHost = false); } diff --git a/vendor/psr/http-message/src/ResponseInterface.php b/vendor/psr/http-message/src/ResponseInterface.php index c306514e6b..f85ca48aad 100644 --- a/vendor/psr/http-message/src/ResponseInterface.php +++ b/vendor/psr/http-message/src/ResponseInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -49,7 +51,7 @@ public function getStatusCode(); * @return static * @throws \InvalidArgumentException For invalid status code arguments. */ - public function withStatus($code, $reasonPhrase = ''); + public function withStatus(int $code, string $reasonPhrase = ''); /** * Gets the response reason phrase associated with the status code. diff --git a/vendor/psr/http-message/src/ServerRequestInterface.php b/vendor/psr/http-message/src/ServerRequestInterface.php index 02512340ad..5e6d964928 100644 --- a/vendor/psr/http-message/src/ServerRequestInterface.php +++ b/vendor/psr/http-message/src/ServerRequestInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -224,7 +226,7 @@ public function getAttributes(); * @param mixed $default Default value to return if the attribute does not exist. * @return mixed */ - public function getAttribute($name, $default = null); + public function getAttribute(string $name, $default = null); /** * Return an instance with the specified derived request attribute. @@ -241,7 +243,7 @@ public function getAttribute($name, $default = null); * @param mixed $value The value of the attribute. * @return static */ - public function withAttribute($name, $value); + public function withAttribute(string $name, $value); /** * Return an instance that removes the specified derived request attribute. @@ -257,5 +259,5 @@ public function withAttribute($name, $value); * @param string $name The attribute name. * @return static */ - public function withoutAttribute($name); + public function withoutAttribute(string $name); } diff --git a/vendor/psr/http-message/src/StreamInterface.php b/vendor/psr/http-message/src/StreamInterface.php index f68f391269..592466390b 100644 --- a/vendor/psr/http-message/src/StreamInterface.php +++ b/vendor/psr/http-message/src/StreamInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -84,7 +86,7 @@ public function isSeekable(); * SEEK_END: Set position to end-of-stream plus offset. * @throws \RuntimeException on failure. */ - public function seek($offset, $whence = SEEK_SET); + public function seek(int $offset, int $whence = SEEK_SET); /** * Seek to the beginning of the stream. @@ -112,7 +114,7 @@ public function isWritable(); * @return int Returns the number of bytes written to the stream. * @throws \RuntimeException on failure. */ - public function write($string); + public function write(string $string); /** * Returns whether or not the stream is readable. @@ -131,7 +133,7 @@ public function isReadable(); * if no bytes are available. * @throws \RuntimeException if an error occurs. */ - public function read($length); + public function read(int $length); /** * Returns the remaining contents in a string @@ -149,10 +151,10 @@ public function getContents(); * stream_get_meta_data() function. * * @link http://php.net/manual/en/function.stream-get-meta-data.php - * @param string $key Specific metadata to retrieve. + * @param string|null $key Specific metadata to retrieve. * @return array|mixed|null Returns an associative array if no key is * provided. Returns a specific key value if a key is provided and the * value is found, or null if the key is not found. */ - public function getMetadata($key = null); + public function getMetadata(?string $key = null); } diff --git a/vendor/psr/http-message/src/UploadedFileInterface.php b/vendor/psr/http-message/src/UploadedFileInterface.php index f8a6901e01..aba6321587 100644 --- a/vendor/psr/http-message/src/UploadedFileInterface.php +++ b/vendor/psr/http-message/src/UploadedFileInterface.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -62,7 +64,7 @@ public function getStream(); * @throws \RuntimeException on any error during the move operation, or on * the second or subsequent call to the method. */ - public function moveTo($targetPath); + public function moveTo(string $targetPath); /** * Retrieve the file size. diff --git a/vendor/psr/http-message/src/UriInterface.php b/vendor/psr/http-message/src/UriInterface.php index 9d7ab9eae8..d974de0de5 100644 --- a/vendor/psr/http-message/src/UriInterface.php +++ b/vendor/psr/http-message/src/UriInterface.php @@ -1,4 +1,7 @@ <?php + +declare(strict_types=1); + namespace Psr\Http\Message; /** @@ -188,7 +191,7 @@ public function getFragment(); * @return static A new instance with the specified scheme. * @throws \InvalidArgumentException for invalid or unsupported schemes. */ - public function withScheme($scheme); + public function withScheme(string $scheme); /** * Return an instance with the specified user information. @@ -204,7 +207,7 @@ public function withScheme($scheme); * @param null|string $password The password associated with $user. * @return static A new instance with the specified user information. */ - public function withUserInfo($user, $password = null); + public function withUserInfo(string $user, ?string $password = null); /** * Return an instance with the specified host. @@ -218,7 +221,7 @@ public function withUserInfo($user, $password = null); * @return static A new instance with the specified host. * @throws \InvalidArgumentException for invalid hostnames. */ - public function withHost($host); + public function withHost(string $host); /** * Return an instance with the specified port. @@ -237,7 +240,7 @@ public function withHost($host); * @return static A new instance with the specified port. * @throws \InvalidArgumentException for invalid ports. */ - public function withPort($port); + public function withPort(?int $port); /** * Return an instance with the specified path. @@ -261,7 +264,7 @@ public function withPort($port); * @return static A new instance with the specified path. * @throws \InvalidArgumentException for invalid paths. */ - public function withPath($path); + public function withPath(string $path); /** * Return an instance with the specified query string. @@ -278,7 +281,7 @@ public function withPath($path); * @return static A new instance with the specified query string. * @throws \InvalidArgumentException for invalid query strings. */ - public function withQuery($query); + public function withQuery(string $query); /** * Return an instance with the specified URI fragment. @@ -294,7 +297,7 @@ public function withQuery($query); * @param string $fragment The fragment to use with the new instance. * @return static A new instance with the specified fragment. */ - public function withFragment($fragment); + public function withFragment(string $fragment); /** * Return the string representation as a URI reference. diff --git a/vendor/psr/http-server-handler/README.md b/vendor/psr/http-server-handler/README.md index 1b7b4860c1..111a9ed2e8 100644 --- a/vendor/psr/http-server-handler/README.md +++ b/vendor/psr/http-server-handler/README.md @@ -1,6 +1,12 @@ -HTTP Server Handler -=================== +HTTP Server Request Handlers for Middleware +=========================================== -Provides the `RequestHandlerInterface` of [PSR-15][psr-15]. +This repository holds the `RequestHandlerInterface` related to [PSR-15 (HTTP Server Request Handlers)][psr-url]. -[psr-15]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md +Note that this is not a Server Request Handler implementation of its own. It is merely the interface that describe a Server Request Handler. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-15/ +[package-url]: https://packagist.org/packages/psr/http-server-handler +[implementation-url]: https://packagist.org/providers/psr/http-server-handler-implementation diff --git a/vendor/psr/http-server-handler/composer.json b/vendor/psr/http-server-handler/composer.json index 9e8b51d1ee..c54b2dee82 100644 --- a/vendor/psr/http-server-handler/composer.json +++ b/vendor/psr/http-server-handler/composer.json @@ -16,12 +16,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": ">=7.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/vendor/psr/http-server-middleware/README.md b/vendor/psr/http-server-middleware/README.md index 8359bd05c1..7b0a9550e5 100644 --- a/vendor/psr/http-server-middleware/README.md +++ b/vendor/psr/http-server-middleware/README.md @@ -1,6 +1,12 @@ HTTP Server Middleware -====================== +============== -Provides the `MiddlewareInterface` of [PSR-15][psr-15]. +This repository holds the `MiddlewareInterface` related to [PSR-15 (HTTP Server Request Handlers)][psr-url]. -[psr-15]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-15-request-handlers.md +Note that this is not a Middleware implementation of its own. It is merely the interface that describe a Middleware. + +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-15/ +[package-url]: https://packagist.org/packages/psr/http-server-middleware +[implementation-url]: https://packagist.org/providers/psr/http-server-middleware-implementation diff --git a/vendor/psr/http-server-middleware/composer.json b/vendor/psr/http-server-middleware/composer.json index 1595513c30..1511671483 100644 --- a/vendor/psr/http-server-middleware/composer.json +++ b/vendor/psr/http-server-middleware/composer.json @@ -15,12 +15,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": ">=7.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-server-handler": "^1.0" }, "autoload": { diff --git a/vendor/psr/log/Psr/Log/AbstractLogger.php b/vendor/psr/log/Psr/Log/AbstractLogger.php index 90e721af2d..e02f9daf3d 100644 --- a/vendor/psr/log/Psr/Log/AbstractLogger.php +++ b/vendor/psr/log/Psr/Log/AbstractLogger.php @@ -14,8 +14,8 @@ abstract class AbstractLogger implements LoggerInterface /** * System is unusable. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -30,8 +30,8 @@ public function emergency($message, array $context = array()) * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -45,8 +45,8 @@ public function alert($message, array $context = array()) * * Example: Application component unavailable, unexpected exception. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -59,8 +59,8 @@ public function critical($message, array $context = array()) * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -75,8 +75,8 @@ public function error($message, array $context = array()) * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -88,8 +88,8 @@ public function warning($message, array $context = array()) /** * Normal but significant events. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -103,8 +103,8 @@ public function notice($message, array $context = array()) * * Example: User logs in, SQL logs. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ @@ -116,8 +116,8 @@ public function info($message, array $context = array()) /** * Detailed debug information. * - * @param string $message - * @param array $context + * @param string $message + * @param mixed[] $context * * @return void */ diff --git a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php b/vendor/psr/log/Psr/Log/LoggerAwareTrait.php index 639f79bdaa..82bf45c89b 100644 --- a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php +++ b/vendor/psr/log/Psr/Log/LoggerAwareTrait.php @@ -10,7 +10,7 @@ trait LoggerAwareTrait /** * The logger instance. * - * @var LoggerInterface + * @var LoggerInterface|null */ protected $logger; diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json index 3f6d4eea4c..ca05695377 100644 --- a/vendor/psr/log/composer.json +++ b/vendor/psr/log/composer.json @@ -7,7 +7,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { diff --git a/vendor/slim/psr7/MAINTAINERS.md b/vendor/slim/psr7/MAINTAINERS.md deleted file mode 100644 index 5c2496e1d3..0000000000 --- a/vendor/slim/psr7/MAINTAINERS.md +++ /dev/null @@ -1,17 +0,0 @@ -# Maintainers - -There aren't many rules for maintainers of Slim-Psr7 to remember; what we have is listed here. - -## We don't merge our own PRs - -Our code is better if more than one set of eyes looks at it. Therefore we do not merge our own pull requests unless there is an exceptional circumstance. This helps to spot errors in the patch and also enables us to share information about the project around the maintainer team. - -## PRs tagged `[WIP]` are not ready to be merged - -Sometimes it's helpful to collaborate on a patch before it's ready to be merged. We use the `[WIP]` tag (for _Work in Progress_) in the title to mark these PRs. - -If a PR has `[WIP]` in its title, then it is not to be merged. The person who raised the PR will remove the `[WIP]` tag when they are ready for a full review and merge. - -## Assign a merged PR to a milestone - -By ensuring that all merged PRs are assigned to a milestone, we can easily find which PRs were in which release. diff --git a/vendor/slim/psr7/composer.json b/vendor/slim/psr7/composer.json index f94cc35615..b96da46e67 100644 --- a/vendor/slim/psr7/composer.json +++ b/vendor/slim/psr7/composer.json @@ -9,41 +9,46 @@ { "name": "Josh Lockhart", "email": "hello@joshlockhart.com", - "homepage": "http://joshlockhart.com" + "homepage": "https://joshlockhart.com" }, { "name": "Andrew Smith", "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" + "homepage": "https://silentworks.co.uk" }, { "name": "Rob Allen", "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" + "homepage": "https://akrabat.com" }, { "name": "Pierre Berube", "email": "pierre@lgse.com", - "homepage": "http://www.lgse.com" + "homepage": "https://www.lgse.com" } ], "require": { - "php": "^7.1", - "fig/http-message-util": "^1.1.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3" + "php": "^8.0", + "fig/http-message-util": "^1.1.5", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.0 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/polyfill-php80": "^1.29" }, "require-dev": { "ext-json": "*", - "http-interop/http-factory-tests": "^0.6.0", - "php-http/psr7-integration-tests": "dev-master", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.0|^7.0", - "squizlabs/php_codesniffer": "^3.3" + "adriansuter/php-autoload-override": "^1.4", + "http-interop/http-factory-tests": "^1.0 || ^2.0", + "php-http/psr7-integration-tests": "^1.4", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.2", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^9.6 || ^10", + "squizlabs/php_codesniffer": "^3.10" }, "provide": { - "psr/http-message-implementation": "1.0" + "psr/http-message-implementation": "^1.0 || ^2.0", + "psr/http-factory-implementation": "^1.0" }, "autoload": { "psr-4": { @@ -61,8 +66,11 @@ "@phpcs", "@phpstan" ], - "phpunit": "phpunit", - "phpcs": "phpcs", - "phpstan": "phpstan analyse src --memory-limit=-1" + "phpunit": "@php phpunit", + "phpcs": "@php phpcs", + "phpstan": "@php phpstan --memory-limit=-1" + }, + "config": { + "sort-packages": true } } diff --git a/vendor/slim/psr7/phpunit.xml.dist b/vendor/slim/psr7/phpunit.xml.dist new file mode 100644 index 0000000000..a65dc57884 --- /dev/null +++ b/vendor/slim/psr7/phpunit.xml.dist @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" + backupGlobals="true" + beStrictAboutOutputDuringTests="true" + colors="true" + bootstrap="tests/bootstrap.php" +> + <testsuites> + <testsuite name="Slim-Psr7 Test Suite"> + <directory>tests</directory> + </testsuite> + </testsuites> + + <coverage processUncoveredFiles="true"> + <include> + <directory suffix=".php">src</directory> + </include> + <report> + <html outputDirectory="coverage" lowUpperBound="20" highLowerBound="50"/> + </report> + </coverage> +</phpunit> diff --git a/vendor/slim/psr7/src/Cookies.php b/vendor/slim/psr7/src/Cookies.php index 319e6048ec..044d438e04 100644 --- a/vendor/slim/psr7/src/Cookies.php +++ b/vendor/slim/psr7/src/Cookies.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -11,28 +12,37 @@ use InvalidArgumentException; +use function array_key_exists; +use function array_replace; +use function count; +use function explode; +use function gmdate; +use function in_array; +use function is_array; +use function is_string; +use function preg_split; +use function rtrim; +use function strtolower; +use function strtotime; +use function urldecode; +use function urlencode; + class Cookies { /** * Cookies from HTTP request - * - * @var array */ - protected $requestCookies = []; + protected array $requestCookies = []; /** * Cookies for HTTP response - * - * @var array */ - protected $responseCookies = []; + protected array $responseCookies = []; /** * Default cookie properties - * - * @var array */ - protected $defaults = [ + protected array $defaults = [ 'value' => '', 'domain' => null, 'hostonly' => null, @@ -74,7 +84,7 @@ public function setDefaults(array $settings): self */ public function get(string $name, $default = null) { - return isset($this->requestCookies[$name]) ? $this->requestCookies[$name] : $default; + return array_key_exists($name, $this->requestCookies) ? $this->requestCookies[$name] : $default; } /** @@ -154,7 +164,10 @@ protected function toHeader(string $name, array $properties): string $result .= '; HttpOnly'; } - if (isset($properties['samesite']) && in_array(strtolower($properties['samesite']), ['lax', 'strict'], true)) { + if ( + isset($properties['samesite']) + && in_array(strtolower($properties['samesite']), ['lax', 'strict', 'none'], true) + ) { // While strtolower is needed for correct comparison, the RFC doesn't care about case $result .= '; SameSite=' . $properties['samesite']; } @@ -174,7 +187,7 @@ protected function toHeader(string $name, array $properties): string public static function parseHeader($header): array { if (is_array($header)) { - $header = isset($header[0]) ? $header[0] : ''; + $header = $header[0] ?? ''; } if (!is_string($header)) { diff --git a/vendor/slim/psr7/src/Environment.php b/vendor/slim/psr7/src/Environment.php index 364468478c..55f187b36f 100644 --- a/vendor/slim/psr7/src/Environment.php +++ b/vendor/slim/psr7/src/Environment.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -9,6 +10,10 @@ namespace Slim\Psr7; +use function array_merge; +use function microtime; +use function time; + class Environment { /** @@ -18,7 +23,8 @@ class Environment */ public static function mock(array $data = []): array { - if ((isset($data['HTTPS']) && $data['HTTPS'] !== 'off') + if ( + (isset($data['HTTPS']) && $data['HTTPS'] !== 'off') || ((isset($data['REQUEST_SCHEME']) && $data['REQUEST_SCHEME'] === 'https')) ) { $scheme = 'https'; diff --git a/vendor/slim/psr7/src/Factory/RequestFactory.php b/vendor/slim/psr7/src/Factory/RequestFactory.php index 47eaa0f65a..e825ee3777 100644 --- a/vendor/slim/psr7/src/Factory/RequestFactory.php +++ b/vendor/slim/psr7/src/Factory/RequestFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -18,17 +19,13 @@ use Slim\Psr7\Headers; use Slim\Psr7\Request; +use function is_string; + class RequestFactory implements RequestFactoryInterface { - /** - * @var StreamFactoryInterface|StreamFactory - */ - protected $streamFactory; + protected StreamFactoryInterface $streamFactory; - /** - * @var UriFactoryInterface|UriFactory - */ - protected $uriFactory; + protected UriFactoryInterface $uriFactory; /** * @param StreamFactoryInterface|null $streamFactory @@ -36,16 +33,8 @@ class RequestFactory implements RequestFactoryInterface */ public function __construct(?StreamFactoryInterface $streamFactory = null, ?UriFactoryInterface $uriFactory = null) { - if (!isset($streamFactory)) { - $streamFactory = new StreamFactory(); - } - - if (!isset($uriFactory)) { - $uriFactory = new UriFactory(); - } - - $this->streamFactory = $streamFactory; - $this->uriFactory = $uriFactory; + $this->streamFactory = $streamFactory ?? new StreamFactory(); + $this->uriFactory = $uriFactory ?? new UriFactory(); } /** diff --git a/vendor/slim/psr7/src/Factory/ResponseFactory.php b/vendor/slim/psr7/src/Factory/ResponseFactory.php index 8cc11e3242..c1a23a7d72 100644 --- a/vendor/slim/psr7/src/Factory/ResponseFactory.php +++ b/vendor/slim/psr7/src/Factory/ResponseFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * diff --git a/vendor/slim/psr7/src/Factory/ServerRequestFactory.php b/vendor/slim/psr7/src/Factory/ServerRequestFactory.php index a8115b6adf..5d1225d979 100644 --- a/vendor/slim/psr7/src/Factory/ServerRequestFactory.php +++ b/vendor/slim/psr7/src/Factory/ServerRequestFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -21,17 +22,17 @@ use Slim\Psr7\Stream; use Slim\Psr7\UploadedFile; +use function current; +use function explode; +use function fopen; +use function in_array; +use function is_string; + class ServerRequestFactory implements ServerRequestFactoryInterface { - /** - * @var StreamFactoryInterface|StreamFactory - */ - protected $streamFactory; + protected StreamFactoryInterface $streamFactory; - /** - * @var UriFactoryInterface|UriFactory - */ - protected $uriFactory; + protected UriFactoryInterface $uriFactory; /** * @param StreamFactoryInterface|null $streamFactory @@ -39,16 +40,8 @@ class ServerRequestFactory implements ServerRequestFactoryInterface */ public function __construct(?StreamFactoryInterface $streamFactory = null, ?UriFactoryInterface $uriFactory = null) { - if (!isset($streamFactory)) { - $streamFactory = new StreamFactory(); - } - - if (!isset($uriFactory)) { - $uriFactory = new UriFactory(); - } - - $this->streamFactory = $streamFactory; - $this->uriFactory = $uriFactory; + $this->streamFactory = $streamFactory ?? new StreamFactory(); + $this->uriFactory = $uriFactory ?? new UriFactory(); } /** @@ -85,7 +78,8 @@ public function createServerRequest(string $method, $uri, array $serverParams = */ public static function createFromGlobals(): Request { - $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; + /** @var string $method */ + $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; $uri = (new UriFactory())->createFromGlobals($_SERVER); $headers = Headers::createFromGlobals(); @@ -99,7 +93,7 @@ public static function createFromGlobals(): Request $uploadedFiles = UploadedFile::createFromGlobals($_SERVER); $request = new Request($method, $uri, $headers, $cookies, $_SERVER, $body, $uploadedFiles); - $contentTypes = $request->getHeader('Content-Type') ?? []; + $contentTypes = $request->getHeader('Content-Type'); $parsedContentType = ''; foreach ($contentTypes as $contentType) { diff --git a/vendor/slim/psr7/src/Factory/StreamFactory.php b/vendor/slim/psr7/src/Factory/StreamFactory.php index f513115232..04d22a1d3f 100644 --- a/vendor/slim/psr7/src/Factory/StreamFactory.php +++ b/vendor/slim/psr7/src/Factory/StreamFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -14,6 +15,14 @@ use Psr\Http\Message\StreamInterface; use RuntimeException; use Slim\Psr7\Stream; +use ValueError; + +use function fopen; +use function fwrite; +use function is_resource; +use function restore_error_handler; +use function rewind; +use function set_error_handler; class StreamFactory implements StreamFactoryInterface { @@ -42,27 +51,23 @@ public function createStream(string $content = ''): StreamInterface public function createStreamFromFile( string $filename, string $mode = 'r', - StreamInterface $cache = null + ?StreamInterface $cache = null ): StreamInterface { - // When fopen fails, PHP normally raises a warning. Add an error - // handler to check for errors and throw an exception instead. - $exc = null; - - set_error_handler(function (int $errno, string $errstr) use ($filename, $mode, &$exc) { - $exc = new RuntimeException(sprintf( - 'Unable to open %s using mode %s: %s', - $filename, - $mode, - $errstr - )); - }); - - $resource = fopen($filename, $mode); - restore_error_handler(); + set_error_handler( + static function (int $errno, string $errstr) use ($filename, $mode): void { + throw new RuntimeException( + "Unable to open $filename using mode $mode: $errstr", + $errno + ); + } + ); - if ($exc) { - /** @var $exc RuntimeException */ - throw $exc; + try { + $resource = fopen($filename, $mode); + } catch (ValueError $exception) { + throw new RuntimeException("Unable to open $filename using mode $mode: " . $exception->getMessage()); + } finally { + restore_error_handler(); } if (!is_resource($resource)) { @@ -77,7 +82,7 @@ public function createStreamFromFile( /** * {@inheritdoc} */ - public function createStreamFromResource($resource, StreamInterface $cache = null): StreamInterface + public function createStreamFromResource($resource, ?StreamInterface $cache = null): StreamInterface { if (!is_resource($resource)) { throw new InvalidArgumentException( diff --git a/vendor/slim/psr7/src/Factory/UploadedFileFactory.php b/vendor/slim/psr7/src/Factory/UploadedFileFactory.php index caa9d2426e..5699e96dbe 100644 --- a/vendor/slim/psr7/src/Factory/UploadedFileFactory.php +++ b/vendor/slim/psr7/src/Factory/UploadedFileFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -15,6 +16,10 @@ use Psr\Http\Message\UploadedFileInterface; use Slim\Psr7\UploadedFile; +use function is_string; + +use const UPLOAD_ERR_OK; + class UploadedFileFactory implements UploadedFileFactoryInterface { /** diff --git a/vendor/slim/psr7/src/Factory/UriFactory.php b/vendor/slim/psr7/src/Factory/UriFactory.php index 7d6e2c8b58..74ab377ad9 100644 --- a/vendor/slim/psr7/src/Factory/UriFactory.php +++ b/vendor/slim/psr7/src/Factory/UriFactory.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -14,6 +15,16 @@ use Psr\Http\Message\UriInterface; use Slim\Psr7\Uri; +use function count; +use function explode; +use function parse_url; +use function preg_match; +use function strpos; +use function strstr; +use function substr; + +use const PHP_URL_QUERY; + class UriFactory implements UriFactoryInterface { /** @@ -51,12 +62,12 @@ public function createUri(string $uri = ''): UriInterface public function createFromGlobals(array $globals): Uri { // Scheme - $https = isset($globals['HTTPS']) ? $globals['HTTPS'] : false; + $https = $globals['HTTPS'] ?? false; $scheme = !$https || $https === 'off' ? 'http' : 'https'; // Authority: Username and password - $username = isset($globals['PHP_AUTH_USER']) ? $globals['PHP_AUTH_USER'] : ''; - $password = isset($globals['PHP_AUTH_PW']) ? $globals['PHP_AUTH_PW'] : ''; + $username = $globals['PHP_AUTH_USER'] ?? ''; + $password = $globals['PHP_AUTH_PW'] ?? ''; // Authority: Host $host = ''; @@ -67,8 +78,8 @@ public function createFromGlobals(array $globals): Uri } // Authority: Port - $port = !empty($globals['SERVER_PORT']) ? (int) $globals['SERVER_PORT'] : 80; - if (preg_match('/^(\[[a-fA-F0-9:.]+\])(:\d+)?\z/', $host, $matches)) { + $port = !empty($globals['SERVER_PORT']) ? (int)$globals['SERVER_PORT'] : ($scheme === 'https' ? 443 : 80); + if (preg_match('/^(\[[a-fA-F0-9:.]+])(:\d+)?\z/', $host, $matches)) { $host = $matches[1]; if (isset($matches[2])) { @@ -83,10 +94,7 @@ public function createFromGlobals(array $globals): Uri } // Query string - $queryString = ''; - if (isset($globals['QUERY_STRING'])) { - $queryString = $globals['QUERY_STRING']; - } + $queryString = $globals['QUERY_STRING'] ?? ''; // Request URI $requestUri = ''; @@ -95,13 +103,11 @@ public function createFromGlobals(array $globals): Uri $requestUri = $uriFragments[0]; if ($queryString === '' && count($uriFragments) > 1) { - $queryString = parse_url('http://www.example.com' . $globals['REQUEST_URI'], PHP_URL_QUERY) ?? ''; + $queryString = parse_url('https://www.example.com' . $globals['REQUEST_URI'], PHP_URL_QUERY) ?? ''; } } - // Build Uri - $uri = new Uri($scheme, $host, $port, $requestUri, $queryString, '', $username, $password); - - return $uri; + // Build Uri and return + return new Uri($scheme, $host, $port, $requestUri, $queryString, '', $username, $password); } } diff --git a/vendor/slim/psr7/src/Header.php b/vendor/slim/psr7/src/Header.php index 0de581b041..ef9e196c23 100644 --- a/vendor/slim/psr7/src/Header.php +++ b/vendor/slim/psr7/src/Header.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -9,32 +10,17 @@ namespace Slim\Psr7; -use InvalidArgumentException; +use function array_merge; +use function is_string; class Header { - /** - * @var string - */ - private $originalName; - - /** - * @var string - */ - private $normalizedName; - - /** - * @var array - */ - private $values; - - /** - * Header constructor. - * - * @param string $originalName - * @param string $normalizedName - * @param array $values - */ + private string $originalName; + + private string $normalizedName; + + private array $values; + public function __construct(string $originalName, string $normalizedName, array $values) { $this->originalName = $originalName; @@ -42,27 +28,16 @@ public function __construct(string $originalName, string $normalizedName, array $this->values = $values; } - /** - * @return string - */ public function getOriginalName(): string { return $this->originalName; } - /** - * @return string - */ public function getNormalizedName(): string { return $this->normalizedName; } - /** - * @param string $value - * - * @return self - */ public function addValue(string $value): self { $this->values[] = $value; @@ -70,29 +45,17 @@ public function addValue(string $value): self return $this; } - /** - * @param array|string $values - * - * @return self - */ - public function addValues($values): self + public function addValues(array|string $values): self { if (is_string($values)) { return $this->addValue($values); } - if (!is_array($values)) { - throw new InvalidArgumentException('Parameter 1 of Header::addValues() should be a string or an array.'); - } - $this->values = array_merge($this->values, $values); return $this; } - /** - * @return array - */ public function getValues(): array { return $this->values; diff --git a/vendor/slim/psr7/src/Headers.php b/vendor/slim/psr7/src/Headers.php index 786f4cbf28..cc345dd51c 100644 --- a/vendor/slim/psr7/src/Headers.php +++ b/vendor/slim/psr7/src/Headers.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -12,23 +13,33 @@ use InvalidArgumentException; use Slim\Psr7\Interfaces\HeadersInterface; +use function base64_encode; +use function function_exists; +use function getallheaders; +use function is_array; +use function is_numeric; +use function is_string; +use function preg_match; +use function strpos; +use function strtolower; +use function strtr; +use function substr; +use function trim; + class Headers implements HeadersInterface { - /** - * @var array - */ - protected $globals; + protected array $globals; /** * @var Header[] */ - protected $headers; + protected array $headers; /** - * @param array $headers - * @param array $globals + * @param array $headers + * @param array|null $globals */ - public function __construct(array $headers = [], ?array $globals = null) + final public function __construct(array $headers = [], ?array $globals = null) { $this->globals = $globals ?? $_SERVER; $this->setHeaders($headers); @@ -165,11 +176,19 @@ protected function normalizeHeaderName(string $name, bool $preserveCase = false) */ protected function parseAuthorizationHeader(array $headers): array { - if (!isset($headers['Authorization'])) { + $hasAuthorizationHeader = false; + foreach ($headers as $name => $value) { + if (strtolower((string) $name) === 'authorization') { + $hasAuthorizationHeader = true; + break; + } + } + + if (!$hasAuthorizationHeader) { if (isset($this->globals['REDIRECT_HTTP_AUTHORIZATION'])) { $headers['Authorization'] = $this->globals['REDIRECT_HTTP_AUTHORIZATION']; } elseif (isset($this->globals['PHP_AUTH_USER'])) { - $pw = isset($this->globals['PHP_AUTH_PW']) ? $this->globals['PHP_AUTH_PW'] : ''; + $pw = $this->globals['PHP_AUTH_PW'] ?? ''; $headers['Authorization'] = 'Basic ' . base64_encode($this->globals['PHP_AUTH_USER'] . ':' . $pw); } elseif (isset($this->globals['PHP_AUTH_DIGEST'])) { $headers['Authorization'] = $this->globals['PHP_AUTH_DIGEST']; @@ -232,9 +251,9 @@ protected function prepareHeader($name, $value): array * @param string $name * @param array|string $value * - * @throws InvalidArgumentException; + * @throws InvalidArgumentException */ - protected function validateHeader($name, $value) + protected function validateHeader($name, $value): void { $this->validateHeaderName($name); $this->validateHeaderValue($value); @@ -245,9 +264,9 @@ protected function validateHeader($name, $value) * * @throws InvalidArgumentException */ - protected function validateHeaderName($name) + protected function validateHeaderName($name): void { - if (!is_string($name) || preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@", $name) !== 1) { + if (!is_string($name) || preg_match("@^[!#$%&'*+.^_`|~0-9A-Za-z-]+$@D", $name) !== 1) { throw new InvalidArgumentException('Header name must be an RFC 7230 compatible string.'); } } @@ -257,7 +276,7 @@ protected function validateHeaderName($name) * * @throws InvalidArgumentException */ - protected function validateHeaderValue($value) + protected function validateHeaderValue($value): void { $items = is_array($value) ? $value : [$value]; @@ -267,7 +286,7 @@ protected function validateHeaderValue($value) ); } - $pattern = "@^[ \t\x21-\x7E\x80-\xFF]*$@"; + $pattern = "@^[ \t\x21-\x7E\x80-\xFF]*$@D"; foreach ($items as $item) { $hasInvalidType = !is_numeric($item) && !is_string($item); $rejected = $hasInvalidType || preg_match($pattern, (string) $item) !== 1; diff --git a/vendor/slim/psr7/src/Interfaces/HeadersInterface.php b/vendor/slim/psr7/src/Interfaces/HeadersInterface.php index 4a6eecc262..3f486f170b 100644 --- a/vendor/slim/psr7/src/Interfaces/HeadersInterface.php +++ b/vendor/slim/psr7/src/Interfaces/HeadersInterface.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * diff --git a/vendor/slim/psr7/src/Message.php b/vendor/slim/psr7/src/Message.php index edf35f8c96..89b3d152e4 100644 --- a/vendor/slim/psr7/src/Message.php +++ b/vendor/slim/psr7/src/Message.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -14,17 +15,17 @@ use Psr\Http\Message\StreamInterface; use Slim\Psr7\Interfaces\HeadersInterface; +use function array_keys; +use function header; +use function header_remove; +use function implode; +use function sprintf; + abstract class Message implements MessageInterface { - /** - * @var string - */ - protected $protocolVersion = '1.1'; + protected string $protocolVersion = '1.1'; - /** - * @var array - */ - protected static $validProtocolVersions = [ + protected static array $validProtocolVersions = [ '1.0' => true, '1.1' => true, '2.0' => true, @@ -63,9 +64,10 @@ public function getProtocolVersion(): string } /** + * @return static * {@inheritdoc} */ - public function withProtocolVersion($version) + public function withProtocolVersion($version): MessageInterface { if (!isset(self::$validProtocolVersions[$version])) { throw new InvalidArgumentException( @@ -114,9 +116,10 @@ public function getHeaderLine($name): string } /** + * @return static * {@inheritdoc} */ - public function withHeader($name, $value) + public function withHeader($name, $value): MessageInterface { $clone = clone $this; $clone->headers->setHeader($name, $value); @@ -129,9 +132,10 @@ public function withHeader($name, $value) } /** + * @return static * {@inheritdoc} */ - public function withAddedHeader($name, $value) + public function withAddedHeader($name, $value): MessageInterface { $clone = clone $this; $clone->headers->addHeader($name, $value); @@ -144,9 +148,10 @@ public function withAddedHeader($name, $value) } /** + * @return static * {@inheritdoc} */ - public function withoutHeader($name) + public function withoutHeader($name): MessageInterface { $clone = clone $this; $clone->headers->removeHeader($name); @@ -167,9 +172,10 @@ public function getBody(): StreamInterface } /** + * @return static * {@inheritdoc} */ - public function withBody(StreamInterface $body) + public function withBody(StreamInterface $body): MessageInterface { $clone = clone $this; $clone->body = $body; diff --git a/vendor/slim/psr7/src/NonBufferedBody.php b/vendor/slim/psr7/src/NonBufferedBody.php index e47988052a..ad22c2d71a 100644 --- a/vendor/slim/psr7/src/NonBufferedBody.php +++ b/vendor/slim/psr7/src/NonBufferedBody.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -12,6 +13,13 @@ use Psr\Http\Message\StreamInterface; use RuntimeException; +use function flush; +use function ob_get_clean; +use function ob_get_level; +use function strlen; + +use const SEEK_SET; + class NonBufferedBody implements StreamInterface { /** @@ -73,7 +81,7 @@ public function isSeekable(): bool /** * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET) + public function seek($offset, $whence = SEEK_SET): void { throw new RuntimeException('A NonBufferedBody is not seekable.'); } diff --git a/vendor/slim/psr7/src/Request.php b/vendor/slim/psr7/src/Request.php index efb0c3ad53..4f9e1d957a 100644 --- a/vendor/slim/psr7/src/Request.php +++ b/vendor/slim/psr7/src/Request.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -10,18 +11,28 @@ namespace Slim\Psr7; use InvalidArgumentException; +use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; use Psr\Http\Message\UriInterface; use Slim\Psr7\Interfaces\HeadersInterface; +use function get_class; +use function gettype; +use function is_array; +use function is_null; +use function is_object; +use function is_string; +use function ltrim; +use function parse_str; +use function preg_match; +use function sprintf; +use function str_replace; + class Request extends Message implements ServerRequestInterface { - /** - * @var string - */ - protected $method; + protected string $method; /** * @var UriInterface @@ -34,24 +45,15 @@ class Request extends Message implements ServerRequestInterface protected $requestTarget; /** - * @var array + * @var ?array */ protected $queryParams; - /** - * @var array - */ - protected $cookies; + protected array $cookies; - /** - * @var array - */ - protected $serverParams; + protected array $serverParams; - /** - * @var array - */ - protected $attributes; + protected array $attributes; /** * @var null|array|object @@ -61,7 +63,7 @@ class Request extends Message implements ServerRequestInterface /** * @var UploadedFileInterface[] */ - protected $uploadedFiles; + protected array $uploadedFiles; /** * @param string $method The request method @@ -120,8 +122,9 @@ public function getMethod(): string /** * {@inheritdoc} + * @return static */ - public function withMethod($method) + public function withMethod($method): RequestInterface { $method = $this->filterMethod($method); $clone = clone $this; @@ -141,6 +144,7 @@ public function withMethod($method) */ protected function filterMethod($method): string { + /** @var mixed $method */ if (!is_string($method)) { throw new InvalidArgumentException(sprintf( 'Unsupported HTTP method; must be a string, received %s', @@ -184,10 +188,11 @@ public function getRequestTarget(): string /** * {@inheritdoc} + * @return static */ - public function withRequestTarget($requestTarget) + public function withRequestTarget($requestTarget): RequestInterface { - if (preg_match('#\s#', $requestTarget)) { + if (!is_string($requestTarget) || preg_match('#\s#', $requestTarget)) { throw new InvalidArgumentException( 'Invalid request target provided; must be a string and cannot contain whitespace' ); @@ -209,8 +214,9 @@ public function getUri(): UriInterface /** * {@inheritdoc} + * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false) + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface { $clone = clone $this; $clone->uri = $uri; @@ -238,8 +244,9 @@ public function getCookieParams(): array /** * {@inheritdoc} + * @return static */ - public function withCookieParams(array $cookies) + public function withCookieParams(array $cookies): ServerRequestInterface { $clone = clone $this; $clone->cookies = $cookies; @@ -260,15 +267,17 @@ public function getQueryParams(): array return []; } - parse_str($this->uri->getQuery(), $this->queryParams); // <-- URL decodes data + // Decode URL data + parse_str($this->uri->getQuery(), $this->queryParams); - return $this->queryParams; + return is_array($this->queryParams) ? $this->queryParams : []; } /** * {@inheritdoc} + * @return static */ - public function withQueryParams(array $query) + public function withQueryParams(array $query): ServerRequestInterface { $clone = clone $this; $clone->queryParams = $query; @@ -286,8 +295,9 @@ public function getUploadedFiles(): array /** * {@inheritdoc} + * @return static */ - public function withUploadedFiles(array $uploadedFiles) + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface { $clone = clone $this; $clone->uploadedFiles = $uploadedFiles; @@ -313,16 +323,18 @@ public function getAttributes(): array /** * {@inheritdoc} + * @return mixed */ public function getAttribute($name, $default = null) { - return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; + return $this->attributes[$name] ?? $default; } /** * {@inheritdoc} + * @return static */ - public function withAttribute($name, $value) + public function withAttribute($name, $value): ServerRequestInterface { $clone = clone $this; $clone->attributes[$name] = $value; @@ -332,8 +344,9 @@ public function withAttribute($name, $value) /** * {@inheritdoc} + * @return static */ - public function withoutAttribute($name) + public function withoutAttribute($name): ServerRequestInterface { $clone = clone $this; @@ -352,9 +365,11 @@ public function getParsedBody() /** * {@inheritdoc} + * @return static */ - public function withParsedBody($data) + public function withParsedBody($data): ServerRequestInterface { + /** @var mixed $data */ if (!is_null($data) && !is_object($data) && !is_array($data)) { throw new InvalidArgumentException('Parsed body value must be an array, an object, or null'); } diff --git a/vendor/slim/psr7/src/Response.php b/vendor/slim/psr7/src/Response.php index ce071a98c5..980e3b50ea 100644 --- a/vendor/slim/psr7/src/Response.php +++ b/vendor/slim/psr7/src/Response.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -16,22 +17,18 @@ use Slim\Psr7\Factory\StreamFactory; use Slim\Psr7\Interfaces\HeadersInterface; +use function is_integer; +use function is_object; +use function is_string; +use function method_exists; + class Response extends Message implements ResponseInterface { - /** - * @var int - */ - protected $status = StatusCodeInterface::STATUS_OK; + protected int $status = StatusCodeInterface::STATUS_OK; - /** - * @var string - */ - protected $reasonPhrase = ''; + protected string $reasonPhrase = ''; - /** - * @var array - */ - protected static $messages = [ + protected static array $messages = [ // Informational 1xx StatusCodeInterface::STATUS_CONTINUE => 'Continue', StatusCodeInterface::STATUS_SWITCHING_PROTOCOLS => 'Switching Protocols', @@ -118,8 +115,8 @@ public function __construct( ?StreamInterface $body = null ) { $this->status = $this->filterStatus($status); - $this->headers = $headers ? $headers : new Headers(); - $this->body = $body ? $body : (new StreamFactory())->createStream(); + $this->headers = $headers ?: new Headers([], []); + $this->body = $body ?: (new StreamFactory())->createStream(); } /** @@ -141,8 +138,9 @@ public function getStatusCode(): int /** * {@inheritdoc} + * @return static */ - public function withStatus($code, $reasonPhrase = '') + public function withStatus($code, $reasonPhrase = ''): ResponseInterface { $code = $this->filterStatus($code); $reasonPhrase = $this->filterReasonPhrase($reasonPhrase); @@ -207,6 +205,12 @@ protected function filterReasonPhrase($reasonPhrase = ''): string throw new InvalidArgumentException('Response reason phrase must be a string.'); } + if (strpos($reasonPhrase, "\r") !== false || strpos($reasonPhrase, "\n") !== false) { + throw new InvalidArgumentException( + 'Reason phrase contains one of the following prohibited characters: \r \n' + ); + } + return $reasonPhrase; } } diff --git a/vendor/slim/psr7/src/Stream.php b/vendor/slim/psr7/src/Stream.php index e728d51a26..0431ff051a 100644 --- a/vendor/slim/psr7/src/Stream.php +++ b/vendor/slim/psr7/src/Stream.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -13,6 +14,24 @@ use Psr\Http\Message\StreamInterface; use RuntimeException; +use function fclose; +use function feof; +use function fread; +use function fseek; +use function fstat; +use function ftell; +use function fwrite; +use function is_array; +use function is_resource; +use function is_string; +use function pclose; +use function rewind; +use function stream_get_contents; +use function stream_get_meta_data; +use function strstr; + +use const SEEK_SET; + class Stream implements StreamInterface { /** @@ -20,7 +39,7 @@ class Stream implements StreamInterface * * This is octal as per header stat.h */ - const FSTAT_MODE_S_IFIFO = 0010000; + public const FSTAT_MODE_S_IFIFO = 0010000; /** * The underlying stream resource @@ -29,53 +48,29 @@ class Stream implements StreamInterface */ protected $stream; - /** - * @var array|null - */ - protected $meta; + protected ?array $meta; - /** - * @var bool|null - */ - protected $readable; + protected ?bool $readable = null; - /** - * @var bool|null - */ - protected $writable; + protected ?bool $writable = null; - /** - * @var bool|null - */ - protected $seekable; + protected ?bool $seekable = null; - /** - * @var null|int - */ - protected $size; + protected ?int $size = null; - /** - * @var bool|null - */ - protected $isPipe; + protected ?bool $isPipe = null; - /** - * @var bool - */ - protected $finished = false; + protected bool $finished = false; - /** - * @var StreamInterface | null - */ - protected $cache; + protected ?StreamInterface $cache; /** - * @param resource $stream A PHP resource handle. - * @param StreamInterface $cache A stream to cache $stream (useful for non-seekable streams) + * @param resource $stream A PHP resource handle. + * @param StreamInterface|null $cache A stream to cache $stream (useful for non-seekable streams) * * @throws InvalidArgumentException If argument is not a resource. */ - public function __construct($stream, StreamInterface $cache = null) + public function __construct($stream, ?StreamInterface $cache = null) { $this->attach($stream); @@ -87,6 +82,7 @@ public function __construct($stream, StreamInterface $cache = null) /** * {@inheritdoc} + * @return array|mixed */ public function getMetadata($key = null) { @@ -100,7 +96,7 @@ public function getMetadata($key = null) return $this->meta; } - return isset($this->meta[$key]) ? $this->meta[$key] : null; + return $this->meta[$key] ?? null; } /** @@ -190,7 +186,7 @@ public function getSize(): ?int $stats = fstat($this->stream); if ($stats) { - $this->size = isset($stats['size']) && !$this->isPipe() ? $stats['size'] : null; + $this->size = !$this->isPipe() ? $stats['size'] : null; } } @@ -220,7 +216,7 @@ public function tell(): int */ public function eof(): bool { - return $this->stream ? feof($this->stream) : true; + return !$this->stream || feof($this->stream); } /** @@ -228,19 +224,17 @@ public function eof(): bool */ public function isReadable(): bool { - if ($this->readable === null) { - if ($this->isPipe()) { - $this->readable = true; - } else { - $this->readable = false; + if ($this->readable !== null) { + return $this->readable; + } - if ($this->stream) { - $mode = $this->getMetadata('mode'); + $this->readable = false; - if (strstr($mode, 'r') !== false || strstr($mode, '+') !== false) { - $this->readable = true; - } - } + if ($this->stream) { + $mode = $this->getMetadata('mode'); + + if (is_string($mode) && (strstr($mode, 'r') !== false || strstr($mode, '+') !== false)) { + $this->readable = true; } } @@ -258,7 +252,7 @@ public function isWritable(): bool if ($this->stream) { $mode = $this->getMetadata('mode'); - if (strstr($mode, 'w') !== false || strstr($mode, '+') !== false) { + if (is_string($mode) && (strstr($mode, 'w') !== false || strstr($mode, '+') !== false)) { $this->writable = true; } } @@ -310,7 +304,7 @@ public function read($length): string { $data = false; - if ($this->isReadable() && $this->stream) { + if ($this->isReadable() && $this->stream && $length > 0) { $data = fread($this->stream, $length); } @@ -329,8 +323,9 @@ public function read($length): string /** * {@inheritdoc} + * @return int */ - public function write($string) + public function write($string): int { $written = false; @@ -390,8 +385,8 @@ public function isPipe(): bool if ($this->stream) { $stats = fstat($this->stream); - if ($stats) { - $this->isPipe = isset($stats['mode']) && ($stats['mode'] & self::FSTAT_MODE_S_IFIFO) !== 0; + if (is_array($stats)) { + $this->isPipe = ($stats['mode'] & self::FSTAT_MODE_S_IFIFO) !== 0; } } } diff --git a/vendor/slim/psr7/src/UploadedFile.php b/vendor/slim/psr7/src/UploadedFile.php index 30cff4beeb..d8d6ad6a11 100644 --- a/vendor/slim/psr7/src/UploadedFile.php +++ b/vendor/slim/psr7/src/UploadedFile.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -15,47 +16,48 @@ use RuntimeException; use Slim\Psr7\Factory\StreamFactory; +use function copy; +use function dirname; +use function is_array; +use function is_string; +use function is_uploaded_file; +use function is_writable; +use function move_uploaded_file; +use function rename; +use function sprintf; +use function strpos; +use function unlink; + +use const UPLOAD_ERR_OK; + class UploadedFile implements UploadedFileInterface { /** * The client-provided full path to the file - * - * @var string */ - protected $file; + protected string $file; /** * The client-provided file name. - * - * @var string|null */ - protected $name; + protected ?string $name; /** * The client-provided media type of the file. - * - * @var string|null */ - protected $type; + protected ?string $type; - /** - * @var int|null - */ - protected $size; + protected ?int $size; /** * A valid PHP UPLOAD_ERR_xxx code for the file upload. - * - * @var int */ - protected $error = UPLOAD_ERR_OK; + protected int $error = UPLOAD_ERR_OK; /** * Indicates if the upload is from a SAPI environment. - * - * @var bool */ - protected $sapi = false; + protected bool $sapi = false; /** * @var StreamInterface|null @@ -64,10 +66,8 @@ class UploadedFile implements UploadedFileInterface /** * Indicates if the uploaded file has already been moved. - * - * @var bool */ - protected $moved = false; + protected bool $moved = false; /** * @param string|StreamInterface $fileNameOrStream The full path to the uploaded file provided by the client, @@ -78,7 +78,7 @@ class UploadedFile implements UploadedFileInterface * @param int $error The UPLOAD_ERR_XXX code representing the status of the upload. * @param bool $sapi Indicates if the upload is in a SAPI environment. */ - public function __construct( + final public function __construct( $fileNameOrStream, ?string $name = null, ?string $type = null, @@ -109,8 +109,9 @@ public function __construct( /** * {@inheritdoc} + * @return StreamInterface */ - public function getStream() + public function getStream(): StreamInterface { if ($this->moved) { throw new RuntimeException(sprintf('Uploaded file %s has already been moved', $this->name)); @@ -125,10 +126,8 @@ public function getStream() /** * {@inheritdoc} - * - * @return static */ - public function moveTo($targetPath) + public function moveTo($targetPath): void { if ($this->moved) { throw new RuntimeException('Uploaded file already moved'); @@ -162,8 +161,6 @@ public function moveTo($targetPath) } $this->moved = true; - - return $this; } /** @@ -198,6 +195,18 @@ public function getSize(): ?int return $this->size; } + /** + * Returns the client-provided full path to the file + * + * @internal This method is not part of the PSR-7 standard + * + * @return string + */ + public function getFilePath(): string + { + return $this->file; + } + /** * Create a normalized tree of UploadedFile instances from the Environment. * @@ -214,7 +223,7 @@ public static function createFromGlobals(array $globals): array } if (!empty($_FILES)) { - return static::parseUploadedFiles($_FILES); + return self::parseUploadedFiles($_FILES); } return []; @@ -235,7 +244,7 @@ private static function parseUploadedFiles(array $uploadedFiles): array foreach ($uploadedFiles as $field => $uploadedFile) { if (!isset($uploadedFile['error'])) { if (is_array($uploadedFile)) { - $parsed[$field] = static::parseUploadedFiles($uploadedFile); + $parsed[$field] = self::parseUploadedFiles($uploadedFile); } continue; } @@ -244,9 +253,9 @@ private static function parseUploadedFiles(array $uploadedFiles): array if (!is_array($uploadedFile['error'])) { $parsed[$field] = new static( $uploadedFile['tmp_name'], - isset($uploadedFile['name']) ? $uploadedFile['name'] : null, - isset($uploadedFile['type']) ? $uploadedFile['type'] : null, - isset($uploadedFile['size']) ? $uploadedFile['size'] : null, + $uploadedFile['name'] ?? null, + $uploadedFile['type'] ?? null, + $uploadedFile['size'] ?? null, $uploadedFile['error'], true ); @@ -260,7 +269,7 @@ private static function parseUploadedFiles(array $uploadedFiles): array $subArray[$fileIdx]['error'] = $uploadedFile['error'][$fileIdx]; $subArray[$fileIdx]['size'] = $uploadedFile['size'][$fileIdx]; - $parsed[$field] = static::parseUploadedFiles($subArray); + $parsed[$field] = self::parseUploadedFiles($subArray); } } } diff --git a/vendor/slim/psr7/src/Uri.php b/vendor/slim/psr7/src/Uri.php index 129456ccc5..6fbe47cce8 100644 --- a/vendor/slim/psr7/src/Uri.php +++ b/vendor/slim/psr7/src/Uri.php @@ -1,4 +1,5 @@ <?php + /** * Slim Framework (https://slimframework.com) * @@ -12,63 +13,64 @@ use InvalidArgumentException; use Psr\Http\Message\UriInterface; +use function filter_var; +use function is_integer; +use function is_null; +use function is_object; +use function is_string; +use function ltrim; +use function method_exists; +use function preg_replace_callback; +use function rawurlencode; +use function str_replace; +use function str_starts_with; +use function strtolower; + +use const FILTER_FLAG_IPV6; +use const FILTER_VALIDATE_IP; + class Uri implements UriInterface { + public const SUPPORTED_SCHEMES = [ + '' => null, + 'http' => 80, + 'https' => 443 + ]; + /** * Uri scheme (without "://" suffix) - * - * @var string */ - protected $scheme = ''; + protected string $scheme = ''; - /** - * @var string - */ - protected $user = ''; + protected string $user = ''; - /** - * @var string - */ - protected $password = ''; + protected string $password = ''; - /** - * @var string - */ - protected $host = ''; + protected string $host = ''; - /** - * @var null|int - */ - protected $port; + protected ?int $port; - /** - * @var string - */ - protected $path = ''; + protected string $path = ''; /** * Uri query string (without "?" prefix) - * - * @var string */ - protected $query = ''; + protected string $query = ''; /** * Uri fragment string (without "#" prefix) - * - * @var string */ - protected $fragment = ''; + protected string $fragment = ''; /** - * @param string $scheme Uri scheme. - * @param string $host Uri host. - * @param int $port Uri port number. - * @param string $path Uri path. - * @param string $query Uri query string. - * @param string $fragment Uri fragment. - * @param string $user Uri user. - * @param string $password Uri password. + * @param string $scheme Uri scheme. + * @param string $host Uri host. + * @param int|null $port Uri port number. + * @param string $path Uri path. + * @param string $query Uri query string. + * @param string $fragment Uri fragment. + * @param string $user Uri user. + * @param string $password Uri password. */ public function __construct( string $scheme, @@ -86,8 +88,8 @@ public function __construct( $this->path = $this->filterPath($path); $this->query = $this->filterQuery($query); $this->fragment = $this->filterFragment($fragment); - $this->user = $user; - $this->password = $password; + $this->user = $this->filterUserInfo($user); + $this->password = $this->filterUserInfo($password); } /** @@ -100,8 +102,9 @@ public function getScheme(): string /** * {@inheritdoc} + * @return static */ - public function withScheme($scheme) + public function withScheme($scheme): UriInterface { $scheme = $this->filterScheme($scheme); $clone = clone $this; @@ -118,7 +121,7 @@ public function withScheme($scheme) * @return string * * @throws InvalidArgumentException If the Uri scheme is not a string. - * @throws InvalidArgumentException If Uri scheme is not "", "https", or "http". + * @throws InvalidArgumentException If Uri scheme is not exists in SUPPORTED_SCHEMES */ protected function filterScheme($scheme): string { @@ -126,15 +129,11 @@ protected function filterScheme($scheme): string throw new InvalidArgumentException('Uri scheme must be a string.'); } - static $valid = [ - '' => true, - 'https' => true, - 'http' => true, - ]; - $scheme = str_replace('://', '', strtolower($scheme)); - if (!isset($valid[$scheme])) { - throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"'); + if (!key_exists($scheme, static::SUPPORTED_SCHEMES)) { + throw new InvalidArgumentException( + 'Uri scheme must be one of: "' . implode('", "', array_keys(static::SUPPORTED_SCHEMES)) . '"' + ); } return $scheme; @@ -159,7 +158,7 @@ public function getUserInfo(): string { $info = $this->user; - if (isset($this->password) && $this->password !== '') { + if ($this->password !== '') { $info .= ':' . $this->password; } @@ -168,8 +167,9 @@ public function getUserInfo(): string /** * {@inheritdoc} + * @return static */ - public function withUserInfo($user, $password = null) + public function withUserInfo($user, $password = null): UriInterface { $clone = clone $this; $clone->user = $this->filterUserInfo($user); @@ -199,7 +199,7 @@ protected function filterUserInfo(?string $info = null): string } $match = preg_replace_callback( - '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u', + '/(?:[^%a-zA-Z0-9_\-\.~\pL!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/', function ($match) { return rawurlencode($match[0]); }, @@ -219,8 +219,9 @@ public function getHost(): string /** * {@inheritdoc} + * @return static */ - public function withHost($host) + public function withHost($host): UriInterface { $clone = clone $this; $clone->host = $this->filterHost($host); @@ -267,8 +268,9 @@ public function getPort(): ?int /** * {@inheritdoc} + * @return static */ - public function withPort($port) + public function withPort($port): UriInterface { $port = $this->filterPort($port); $clone = clone $this; @@ -284,21 +286,27 @@ public function withPort($port) */ protected function hasStandardPort(): bool { - return ($this->scheme === 'http' && $this->port === 80) || ($this->scheme === 'https' && $this->port === 443); + return static::SUPPORTED_SCHEMES[$this->scheme] === $this->port; } /** * Filter Uri port. * - * @param null|int $port The Uri port number. + * @param int|string|null $port The Uri port number. * - * @return null|int + * @return int|null * * @throws InvalidArgumentException If the port is invalid. */ protected function filterPort($port): ?int { - if (is_null($port) || (is_integer($port) && ($port >= 1 && $port <= 65535))) { + if (is_null($port)) { + return null; + } + + $port = (int) $port; + + if ($port >= 1 && $port <= 65535) { return $port; } @@ -310,13 +318,19 @@ protected function filterPort($port): ?int */ public function getPath(): string { + if (str_starts_with($this->path, '/')) { + // Use only one leading slash to prevent XSS attempts. + return '/' . ltrim($this->path, '/'); + } + return $this->path; } /** * {@inheritdoc} + * @return static */ - public function withPath($path) + public function withPath($path): UriInterface { if (!is_string($path)) { throw new InvalidArgumentException('Uri path must be a string'); @@ -344,9 +358,7 @@ protected function filterPath($path): string { $match = preg_replace_callback( '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', - function ($match) { - return rawurlencode($match[0]); - }, + fn (array $match) => rawurlencode($match[0]), $path ); @@ -363,8 +375,9 @@ public function getQuery(): string /** * {@inheritdoc} + * @return static */ - public function withQuery($query) + public function withQuery($query): UriInterface { $query = ltrim($this->filterQuery($query), '?'); $clone = clone $this; @@ -413,8 +426,9 @@ public function getFragment(): string /** * {@inheritdoc} + * @return static */ - public function withFragment($fragment) + public function withFragment($fragment): UriInterface { $fragment = $this->filterFragment($fragment); $clone = clone $this; @@ -462,11 +476,25 @@ public function __toString(): string { $scheme = $this->getScheme(); $authority = $this->getAuthority(); - $path = $this->getPath(); + $path = $this->path; $query = $this->getQuery(); $fragment = $this->getFragment(); - $path = '/' . ltrim($path, '/'); + if ($path !== '') { + if ($path[0] !== '/') { + if ($authority !== '') { + // If the path is rootless and an authority is present, the path MUST be prefixed by "/". + $path = '/' . $path; + } + } elseif (isset($path[1]) && $path[1] === '/') { + if ($authority === '') { + // If the path is starting with more than one "/" and no authority is present, + // the starting slashes MUST be reduced to one. + $path = ltrim($path, '/'); + $path = '/' . $path; + } + } + } return ($scheme !== '' ? $scheme . ':' : '') . ($authority !== '' ? '//' . $authority : '') diff --git a/vendor/slim/psr7/tests/Assets/HeaderStack.php b/vendor/slim/psr7/tests/Assets/HeaderStack.php new file mode 100644 index 0000000000..b07daea347 --- /dev/null +++ b/vendor/slim/psr7/tests/Assets/HeaderStack.php @@ -0,0 +1,95 @@ +<?php + +/** + * This is a direct copy of zend-diactoros/test/TestAsset/Functions.php and is used to override + * header() and headers_sent() so we can test that they do the right thing. + */ + +namespace Slim\Tests\Psr7\Assets; + +use function strpos; + +/** + * Zend Framework (http://framework.zend.com/) + * + * This file exists to allow overriding the various output-related functions + * in order to test what happens during the `Server::listen()` cycle. + * + * These functions include: + * + * - headers_sent(): we want to always return false so that headers will be + * emitted, and we can test to see their values. + * - header(): we want to aggregate calls to this function. + * + * The HeaderStack class then aggregates that information for us, and the test + * harness resets the values pre and post test. + * + * @see http://github.com/zendframework/zend-diactoros for the canonical source repository + * @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com) + * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License + */ + +class HeaderStack +{ + private static array $data = []; + + /** + * Reset state + */ + public static function reset() + { + self::$data = []; + } + + /** + * Push a header on the stack + * + * @param string[] $header + */ + public static function push(array $header) + { + self::$data[] = $header; + } + + /** + * Return the current header stack + * + * @return string[][] + */ + public static function stack(): array + { + return self::$data; + } + + /** + * Verify if there's a header line on the stack + * + * @param string $header + * + * @return bool + */ + public static function has($header): bool + { + foreach (self::$data as $item) { + if ($item['header'] === $header) { + return true; + } + } + + return false; + } + + /** + * Remove occurrences of $header + * + * @param string $header + */ + public static function remove($header): void + { + foreach (self::$data as $key => $item) { + if (false !== strpos($item['header'], "$header:")) { + unset(self::$data[$key]); + } + } + } +} diff --git a/vendor/slim/psr7/tests/BodyTest.php b/vendor/slim/psr7/tests/BodyTest.php new file mode 100644 index 0000000000..de1d8dea52 --- /dev/null +++ b/vendor/slim/psr7/tests/BodyTest.php @@ -0,0 +1,422 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; +use RuntimeException; +use Slim\Psr7\Stream; + +use function fclose; +use function feof; +use function fopen; +use function fread; +use function fseek; +use function ftell; +use function fwrite; +use function is_array; +use function is_resource; +use function mb_strlen; +use function rewind; +use function substr; + +class BodyTest extends TestCase +{ + // @codingStandardsIgnoreStart + protected string $text = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; + // @codingStandardsIgnoreEnd + + /** + * @var resource + */ + protected $stream; + + protected function tearDown(): void + { + if (is_resource($this->stream) === true) { + fclose($this->stream); + } + } + + /** + * @param string $mode + * + * @return resource + */ + public function resourceFactory(string $mode = 'r+') + { + $stream = fopen('php://temp', $mode); + fwrite($stream, $this->text); + rewind($stream); + + return $stream; + } + + public function testConstructorAttachesStream() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + + $this->assertSame($this->stream, $bodyStream->getValue($body)); + } + + public function testConstructorInvalidStream() + { + $this->expectException(InvalidArgumentException::class); + + $this->stream = 'foo'; + $body = new Stream($this->stream); + } + + public function testGetMetadata() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertTrue(is_array($body->getMetadata())); + } + + public function testGetMetadataKey() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertEquals('php://temp', $body->getMetadata('uri')); + } + + public function testGetMetadataKeyNotFound() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertNull($body->getMetadata('foo')); + } + + public function testDetach() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + + $bodyMetadata = new ReflectionProperty($body, 'meta'); + $bodyMetadata->setAccessible(true); + + $bodyReadable = new ReflectionProperty($body, 'readable'); + $bodyReadable->setAccessible(true); + + $bodyWritable = new ReflectionProperty($body, 'writable'); + $bodyWritable->setAccessible(true); + + $bodySeekable = new ReflectionProperty($body, 'seekable'); + $bodySeekable->setAccessible(true); + + $result = $body->detach(); + + $this->assertSame($this->stream, $result); + $this->assertNull($bodyStream->getValue($body)); + $this->assertNull($bodyMetadata->getValue($body)); + $this->assertNull($bodyReadable->getValue($body)); + $this->assertNull($bodyWritable->getValue($body)); + $this->assertNull($bodySeekable->getValue($body)); + } + + public function testToStringAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertEquals($this->text, (string) $body); + } + + public function testToStringAttachedRewindsFirst() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertEquals($this->text, (string) $body); + $this->assertEquals($this->text, (string) $body); + $this->assertEquals($this->text, (string) $body); + } + + public function testToStringDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + $bodyStream->setValue($body, null); + + $this->assertEquals('', (string) $body); + } + + public function testClose() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->close(); + + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + + $this->assertNull($bodyStream->getValue($body)); + } + + public function testGetSizeAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertEquals(mb_strlen($this->text), $body->getSize()); + } + + public function testGetSizeDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + $bodyStream->setValue($body, null); + + $this->assertNull($body->getSize()); + } + + public function testTellAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + fseek($this->stream, 10); + + $this->assertEquals(10, $body->tell()); + } + + public function testTellDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + $bodyStream->setValue($body, null); + + $body->tell(); + } + + public function testEofAttachedFalse() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + fseek($this->stream, 10); + + $this->assertFalse($body->eof()); + } + + public function testEofAttachedTrue() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + while (feof($this->stream) === false) { + fread($this->stream, 1024); + } + + $this->assertTrue($body->eof()); + } + + public function testEofDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $bodyStream = new ReflectionProperty($body, 'stream'); + $bodyStream->setAccessible(true); + $bodyStream->setValue($body, null); + + $this->assertTrue($body->eof()); + } + + public function isReadableAttachedTrue() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertTrue($body->isReadable()); + } + + public function isReadableAttachedFalse() + { + $stream = fopen('php://temp', 'w'); + $body = new Stream($this->stream); + + $this->assertFalse($body->isReadable()); + fclose($stream); + } + + public function testIsReadableDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $this->assertFalse($body->isReadable()); + } + + public function isWritableAttachedTrue() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertTrue($body->isWritable()); + } + + public function isWritableAttachedFalse() + { + $stream = fopen('php://temp', 'r'); + $body = new Stream($this->stream); + + $this->assertFalse($body->isWritable()); + fclose($stream); + } + + public function testIsWritableDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $this->assertFalse($body->isWritable()); + } + + public function isSeekableAttachedTrue() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertTrue($body->isSeekable()); + } + + // TODO: Is seekable is false when attached... how? + + public function testIsSeekableDetached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $this->assertFalse($body->isSeekable()); + } + + public function testSeekAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->seek(10); + + $this->assertEquals(10, ftell($this->stream)); + } + + public function testSeekDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $body->seek(10); + } + + public function testRewindAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + fseek($this->stream, 10); + $body->rewind(); + + $this->assertEquals(0, ftell($this->stream)); + } + + public function testRewindDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $body->rewind(); + } + + public function testReadAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + + $this->assertEquals(substr($this->text, 0, 10), $body->read(10)); + } + + public function testReadDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $body->read(10); + } + + public function testWriteAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + while (feof($this->stream) === false) { + fread($this->stream, 1024); + } + $body->write('foo'); + + $this->assertEquals($this->text . 'foo', (string) $body); + } + + public function testWriteDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $body->write('foo'); + } + + public function testGetContentsAttached() + { + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + fseek($this->stream, 10); + + $this->assertEquals(substr($this->text, 10), $body->getContents()); + } + + public function testGetContentsDetachedThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + + $this->stream = $this->resourceFactory(); + $body = new Stream($this->stream); + $body->detach(); + + $body->getContents(); + } +} diff --git a/vendor/slim/psr7/tests/CookiesTest.php b/vendor/slim/psr7/tests/CookiesTest.php new file mode 100644 index 0000000000..8a1cc86aed --- /dev/null +++ b/vendor/slim/psr7/tests/CookiesTest.php @@ -0,0 +1,283 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use ReflectionClass; +use ReflectionProperty; +use Slim\Psr7\Cookies; +use stdClass; + +use function gmdate; +use function json_decode; +use function strtotime; +use function time; + +class CookiesTest extends TestCase +{ + public function testConstructor() + { + $cookies = new Cookies([ + 'test' => 'Works', + ]); + $prop = new ReflectionProperty($cookies, 'requestCookies'); + $prop->setAccessible(true); + $this->assertNotEmpty($prop->getValue($cookies)['test']); + $this->assertEquals('Works', $prop->getValue($cookies)['test']); + } + + public function testSetDefaults() + { + $defaults = [ + 'value' => 'toast', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => true, + 'httponly' => true, + 'samesite' => null + ]; + + $cookies = new Cookies(); + + $prop = new ReflectionProperty($cookies, 'defaults'); + $prop->setAccessible(true); + + $origDefaults = $prop->getValue($cookies); + + $cookies->setDefaults($defaults); + + $this->assertEquals($defaults, $prop->getValue($cookies)); + $this->assertNotEquals($origDefaults, $prop->getValue($cookies)); + } + + public function testSetCookieValues() + { + $cookies = new Cookies(); + $cookies->set('foo', 'bar'); + + $prop = new ReflectionProperty($cookies, 'responseCookies'); + $prop->setAccessible(true); + + $expectedValue = [ + 'foo' => [ + 'value' => 'bar', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => false, + 'httponly' => false, + 'samesite' => null + ] + ]; + + $this->assertEquals($expectedValue, $prop->getValue($cookies)); + } + + public function testSetCookieValuesContainDefaults() + { + $cookies = new Cookies(); + $defaults = [ + 'value' => 'toast', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => true, + 'httponly' => true, + 'samesite' => 'lax' + ]; + + $cookies->setDefaults($defaults); + $cookies->set('foo', 'bar'); + + $prop = new ReflectionProperty($cookies, 'responseCookies'); + $prop->setAccessible(true); + + $expectedValue = [ + 'foo' => [ + 'value' => 'bar', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => true, + 'httponly' => true, + 'samesite' => 'lax' + ] + ]; + + $this->assertEquals($expectedValue, $prop->getValue($cookies)); + } + + public function testSetCookieValuesCanOverrideDefaults() + { + $cookies = new Cookies(); + $defaults = [ + 'value' => 'toast', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => true, + 'httponly' => true, + 'samesite' => 'lax' + ]; + + $cookies->setDefaults($defaults); + $cookies->set('foo', ['value' => 'bar', 'secure' => false, 'samesite' => 'strict']); + + $prop = new ReflectionProperty($cookies, 'responseCookies'); + $prop->setAccessible(true); + + $expectedValue = [ + 'foo' => [ + 'value' => 'bar', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => false, + 'httponly' => true, + 'samesite' => 'strict' + ] + ]; + + $this->assertEquals($expectedValue, $prop->getValue($cookies)); + } + + public function testSetSameSiteCookieValuesAreCaseInsensitive() + { + $cookies = new Cookies(); + $defaults = [ + 'value' => 'bacon', + 'samesite' => 'lax' + ]; + + $cookies->setDefaults($defaults); + $cookies->set('breakfast', ['samesite' => 'StricT']); + + $prop = new ReflectionProperty($cookies, 'responseCookies'); + $prop->setAccessible(true); + + $expectedValue = [ + 'breakfast' => [ + 'value' => 'bacon', + 'domain' => null, + 'hostonly' => null, + 'path' => null, + 'expires' => null, + 'secure' => false, + 'httponly' => false, + 'samesite' => 'StricT', + ] + ]; + + $this->assertEquals($expectedValue, $prop->getValue($cookies)); + } + + public function testGet() + { + $cookies = new Cookies(['foo' => 'bar', 'baz' => null]); + $this->assertEquals('bar', $cookies->get('foo')); + $this->assertNull($cookies->get('baz', 'defaultValue')); + $this->assertNull($cookies->get('missing')); + $this->assertEquals('defaultValue', $cookies->get('missing', 'defaultValue')); + } + + public function testParseHeader() + { + $cookies = Cookies::parseHeader('foo=bar; name=Josh'); + $this->assertEquals('bar', $cookies['foo']); + $this->assertEquals('Josh', $cookies['name']); + } + + public function testParseHeaderWithJsonArray() + { + $cookies = Cookies::parseHeader('foo=bar; testarray=["someVar1","someVar2","someVar3"]'); + $this->assertEquals('bar', $cookies['foo']); + $this->assertContains('someVar3', json_decode($cookies['testarray'])); + } + + public function testToHeaders() + { + $cookies = new Cookies(); + $cookies->set('test', 'Works'); + $cookies->set('test_array', ['value' => 'bar', 'domain' => 'example.com']); + $this->assertEquals('test=Works', $cookies->toHeaders()[0]); + $this->assertEquals('test_array=bar; domain=example.com', $cookies->toHeaders()[1]); + } + + public function testToHeader() + { + $cookies = new Cookies(); + $class = new ReflectionClass($cookies); + $method = $class->getMethod('toHeader'); + $method->setAccessible(true); + $properties = [ + 'name' => 'test', + 'properties' => [ + 'value' => 'Works' + ] + ]; + $time = time(); + $formattedDate = gmdate('D, d-M-Y H:i:s e', $time); + $propertiesComplex = [ + 'name' => 'test_complex', + 'properties' => [ + 'value' => 'Works', + 'domain' => 'example.com', + 'expires' => $time, + 'path' => '/', + 'secure' => true, + 'hostonly' => true, + 'httponly' => true, + 'samesite' => 'lax' + ] + ]; + $stringDate = '2016-01-01 12:00:00'; + $formattedStringDate = gmdate('D, d-M-Y H:i:s e', strtotime($stringDate)); + $propertiesStringDate = [ + 'name' => 'test_date', + 'properties' => [ + 'value' => 'Works', + 'expires' => $stringDate, + ] + ]; + $cookie = $method->invokeArgs($cookies, $properties); + $cookieComplex = $method->invokeArgs($cookies, $propertiesComplex); + $cookieStringDate = $method->invokeArgs($cookies, $propertiesStringDate); + $this->assertEquals('test=Works', $cookie); + $this->assertEquals( + 'test_complex=Works; domain=example.com; path=/; expires=' + . $formattedDate . '; secure; HostOnly; HttpOnly; SameSite=lax', + $cookieComplex + ); + $this->assertEquals('test_date=Works; expires=' . $formattedStringDate, $cookieStringDate); + } + + public function testParseHeaderException() + { + $this->expectException(InvalidArgumentException::class); + + Cookies::parseHeader(new stdClass()); + } + + public function testSetSameSiteNoneToHeaders() + { + $cookies = new Cookies(); + $cookies->set('foo', ['value' => 'bar', 'samesite' => 'None']); + $this->assertEquals('foo=bar; SameSite=None', $cookies->toHeaders()[0]); + } +} diff --git a/vendor/slim/psr7/tests/EnvironmentTest.php b/vendor/slim/psr7/tests/EnvironmentTest.php new file mode 100644 index 0000000000..ba32e18e24 --- /dev/null +++ b/vendor/slim/psr7/tests/EnvironmentTest.php @@ -0,0 +1,48 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use PHPUnit\Framework\TestCase; +use Slim\Psr7\Environment; + +class EnvironmentTest extends TestCase +{ + public function testMock() + { + $env = Environment::mock([ + 'SCRIPT_NAME' => '/foo/bar/index.php', + 'REQUEST_URI' => '/foo/bar?abc=123', + ]); + + $this->assertEquals('/foo/bar/index.php', $env['SCRIPT_NAME']); + $this->assertEquals('/foo/bar?abc=123', $env['REQUEST_URI']); + } + + public function testMockHttps() + { + $env = Environment::mock([ + 'HTTPS' => 'on' + ]); + + $this->assertEquals('on', $env['HTTPS']); + $this->assertEquals(443, $env['SERVER_PORT']); + } + + public function testMockRequestScheme() + { + $env = Environment::mock([ + 'REQUEST_SCHEME' => 'https' + ]); + + $this->assertEquals('https', $env['REQUEST_SCHEME']); + $this->assertEquals(443, $env['SERVER_PORT']); + } +} diff --git a/vendor/slim/psr7/tests/Factory/RequestFactoryTest.php b/vendor/slim/psr7/tests/Factory/RequestFactoryTest.php new file mode 100644 index 0000000000..02f16e5d7f --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/RequestFactoryTest.php @@ -0,0 +1,42 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\RequestFactoryTestCase; +use InvalidArgumentException; +use Psr\Http\Message\UriInterface; +use Slim\Psr7\Factory\RequestFactory; +use Slim\Psr7\Factory\UriFactory; +use stdClass; + +class RequestFactoryTest extends RequestFactoryTestCase +{ + protected function createRequestFactory(): RequestFactory + { + return new RequestFactory(); + } + + protected function createUri($uri): UriInterface + { + return (new UriFactory())->createUri($uri); + } + + public function testCreateRequestThrowsExceptionWithInvalidUri() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Parameter 2 of RequestFactory::createRequest() must be a string' . + ' or a compatible UriInterface.'); + + $factory = $this->createRequestFactory(); + + $factory->createRequest('GET', new stdClass()); + } +} diff --git a/vendor/slim/psr7/tests/Factory/ResponseFactoryTest.php b/vendor/slim/psr7/tests/Factory/ResponseFactoryTest.php new file mode 100644 index 0000000000..7dc557ad40 --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/ResponseFactoryTest.php @@ -0,0 +1,42 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\ResponseFactoryTestCase; +use Psr\Http\Message\ResponseInterface; +use Slim\Psr7\Factory\ResponseFactory; + +class ResponseFactoryTest extends ResponseFactoryTestCase +{ + protected function createResponseFactory(): ResponseFactory + { + return new ResponseFactory(); + } + + protected function assertResponseCodeAndReasonPhrase(ResponseInterface $response, int $code, string $reasonPhrase) + { + $this->assertInstanceOf(ResponseInterface::class, $response); + $this->assertSame($code, $response->getStatusCode()); + $this->assertSame($reasonPhrase, $response->getReasonPhrase()); + } + + /** + * @dataProvider dataCodes + * + * @param int $code + */ + public function testCreateResponseWithReasonPhrase(int $code) + { + $response = $this->factory->createResponse($code, 'Reason'); + $this->assertResponse($response, $code); + $this->assertResponseCodeAndReasonPhrase($response, $code, 'Reason'); + } +} diff --git a/vendor/slim/psr7/tests/Factory/ServerRequestFactoryTest.php b/vendor/slim/psr7/tests/Factory/ServerRequestFactoryTest.php new file mode 100644 index 0000000000..d46be55439 --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/ServerRequestFactoryTest.php @@ -0,0 +1,208 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\ServerRequestFactoryTestCase; +use InvalidArgumentException; +use Psr\Http\Message\UriInterface; +use ReflectionClass; +use Slim\Psr7\Environment; +use Slim\Psr7\Factory\ServerRequestFactory; +use Slim\Psr7\Factory\UriFactory; +use Slim\Psr7\UploadedFile; +use stdClass; + +use function microtime; +use function time; + +class ServerRequestFactoryTest extends ServerRequestFactoryTestCase +{ + protected function createServerRequestFactory(): ServerRequestFactory + { + return new ServerRequestFactory(); + } + + protected function createUri($uri): UriInterface + { + return (new UriFactory())->createUri($uri); + } + + public function testGetProtocolVersion() + { + $env = Environment::mock(['SERVER_PROTOCOL' => 'HTTP/1.0']); + $request = $this->createServerRequestFactory()->createServerRequest('GET', '', $env); + + $this->assertEquals('1.0', $request->getProtocolVersion()); + } + + public function testCreateFromGlobals() + { + $GLOBALS['getallheaders_return'] = [ + 'ACCEPT' => 'application/json', + 'ACCEPT-CHARSET' => 'utf-8', + 'ACCEPT-LANGUAGE' => 'en-US', + 'CONTENT-TYPE' => 'multipart/form-data', + 'HOST' => 'example.com', + 'USER-AGENT' => 'Slim Framework', + ]; + + $_SERVER = Environment::mock([ + 'HTTP_HOST' => 'example.com', + 'PHP_AUTH_PW' => 'sekrit', + 'PHP_AUTH_USER' => 'josh', + 'QUERY_STRING' => 'abc=123', + 'REMOTE_ADDR' => '127.0.0.1', + 'REQUEST_METHOD' => 'GET', + 'REQUEST_TIME' => time(), + 'REQUEST_TIME_FLOAT' => microtime(true), + 'REQUEST_URI' => '/foo/bar', + 'SCRIPT_NAME' => '/index.php', + 'SERVER_NAME' => 'localhost', + 'SERVER_PORT' => 8080, + 'SERVER_PROTOCOL' => 'HTTP/1.1', + ]); + + $request = ServerRequestFactory::createFromGlobals(); + + unset($GLOBALS['getallheaders_return']); + + $this->assertEquals('GET', $request->getMethod()); + $this->assertEquals('1.1', $request->getProtocolVersion()); + + $this->assertEquals('application/json', $request->getHeaderLine('Accept')); + $this->assertEquals('utf-8', $request->getHeaderLine('Accept-Charset')); + $this->assertEquals('en-US', $request->getHeaderLine('Accept-Language')); + $this->assertEquals('multipart/form-data', $request->getHeaderLine('Content-Type')); + + $uri = $request->getUri(); + $this->assertEquals('josh:sekrit', $uri->getUserInfo()); + $this->assertEquals('example.com', $uri->getHost()); + $this->assertEquals('8080', $uri->getPort()); + $this->assertEquals('/foo/bar', $uri->getPath()); + $this->assertEquals('abc=123', $uri->getQuery()); + $this->assertEquals('', $uri->getFragment()); + } + + public function testCreateFromGlobalsWithParsedBody() + { + $_SERVER = Environment::mock([ + 'HTTP_CONTENT_TYPE' => 'multipart/form-data', + 'REQUEST_METHOD' => 'POST', + ]); + + $_POST = [ + 'def' => '456', + ]; + + $request = ServerRequestFactory::createFromGlobals(); + + // $_POST should be placed into the parsed body + $this->assertEquals($_POST, $request->getParsedBody()); + } + + public function testCreateFromGlobalsBodyPointsToPhpInput() + { + $request = ServerRequestFactory::createFromGlobals(); + + $this->assertEquals('php://input', $request->getBody()->getMetadata('uri')); + } + + public function testCreateFromGlobalsSetsACache() + { + $request = ServerRequestFactory::createFromGlobals(); + + // ensure that the Stream's $cache property has been set for this php://input stream + $stream = $request->getBody(); + $class = new ReflectionClass($stream); + $property = $class->getProperty('cache'); + $property->setAccessible(true); + $cacheStreamValue = $property->getValue($stream); + $this->assertNotNull($cacheStreamValue); + } + + public function testCreateFromGlobalsWithUploadedFiles() + { + $_SERVER = Environment::mock([ + 'HTTP_CONTENT_TYPE' => 'multipart/form-data', + 'REQUEST_METHOD' => 'POST', + ]); + + $_FILES = [ + 'uploaded_file' => [ + 'name' => [ + 0 => 'foo.jpg', + 1 => 'bar.jpg', + ], + + 'type' => [ + 0 => 'image/jpeg', + 1 => 'image/jpeg', + ], + + 'tmp_name' => [ + 0 => '/tmp/phpUA3XUw', + 1 => '/tmp/phpXUFS0x', + ], + + 'error' => [ + 0 => 0, + 1 => 0, + ], + + 'size' => [ + 0 => 358708, + 1 => 236162, + ], + ] + ]; + + $request = ServerRequestFactory::createFromGlobals(); + + // $_FILES should be mapped to an array of UploadedFile objects + $uploadedFiles = $request->getUploadedFiles(); + $this->assertCount(1, $uploadedFiles); + $this->assertArrayHasKey('uploaded_file', $uploadedFiles); + $this->assertInstanceOf(UploadedFile::class, $uploadedFiles['uploaded_file'][0]); + $this->assertInstanceOf(UploadedFile::class, $uploadedFiles['uploaded_file'][1]); + } + + public function testCreateFromGlobalsParsesBodyWithFragmentedContentType() + { + $_SERVER = Environment::mock([ + 'HTTP_CONTENT_TYPE' => 'application/x-www-form-urlencoded;charset=utf-8', + 'REQUEST_METHOD' => 'POST', + ]); + + $_POST = [ + 'def' => '456', + ]; + + $request = ServerRequestFactory::createFromGlobals(); + + $this->assertEquals($_POST, $request->getParsedBody()); + } + + public function testCreateServerRequestWithNullAsUri() + { + $this->expectException(InvalidArgumentException::class); + + $env = Environment::mock(); + $this->createServerRequestFactory()->createServerRequest('GET', null, $env); + } + + public function testCreateServerRequestWithInvalidUriObject() + { + $this->expectException(InvalidArgumentException::class); + + $env = Environment::mock(); + $this->createServerRequestFactory()->createServerRequest('GET', new stdClass(), $env); + } +} diff --git a/vendor/slim/psr7/tests/Factory/StreamFactoryTest.php b/vendor/slim/psr7/tests/Factory/StreamFactoryTest.php new file mode 100644 index 0000000000..e10d38dbb5 --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/StreamFactoryTest.php @@ -0,0 +1,66 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\StreamFactoryTestCase; +use InvalidArgumentException; +use RuntimeException; +use Slim\Psr7\Factory\StreamFactory; + +class StreamFactoryTest extends StreamFactoryTestCase +{ + public function tearDown(): void + { + if (isset($GLOBALS['fopen_return'])) { + unset($GLOBALS['fopen_return']); + } + } + + protected function createStreamFactory(): StreamFactory + { + return new StreamFactory(); + } + + public function testCreateStreamThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('StreamFactory::createStream() could not open temporary file stream.'); + + $GLOBALS['fopen_return'] = false; + + $factory = $this->createStreamFactory(); + + $factory->createStream(); + } + + public function testCreateStreamFromFileThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('StreamFactory::createStreamFromFile() could not create resource' + . ' from file `non-readable`'); + + $GLOBALS['fopen_return'] = false; + + $factory = $this->createStreamFactory(); + + $factory->createStreamFromFile('non-readable'); + } + + public function testCreateStreamFromResourceThrowsRuntimeException() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Parameter 1 of StreamFactory::createStreamFromResource() must be a resource.'); + + $factory = $this->createStreamFactory(); + + $factory->createStreamFromResource('not-resource'); + } +} diff --git a/vendor/slim/psr7/tests/Factory/UploadedFileFactoryTest.php b/vendor/slim/psr7/tests/Factory/UploadedFileFactoryTest.php new file mode 100644 index 0000000000..1f46b79bfc --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/UploadedFileFactoryTest.php @@ -0,0 +1,114 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\UploadedFileFactoryTestCase; +use InvalidArgumentException; +use Prophecy\PhpUnit\ProphecyTrait; +use Psr\Http\Message\StreamInterface; +use Slim\Psr7\Factory\StreamFactory; +use Slim\Psr7\Factory\UploadedFileFactory; + +use function fopen; +use function fwrite; +use function rewind; +use function sys_get_temp_dir; +use function tempnam; + +class UploadedFileFactoryTest extends UploadedFileFactoryTestCase +{ + use ProphecyTrait; + + protected function createUploadedFileFactory(): UploadedFileFactory + { + return new UploadedFileFactory(); + } + + protected function createStream($content): StreamInterface + { + $file = tempnam(sys_get_temp_dir(), 'Slim_Http_UploadedFileTest_'); + $resource = fopen($file, 'r+'); + fwrite($resource, $content); + rewind($resource); + + return (new StreamFactory())->createStreamFromResource($resource); + } + + /** + * Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` method prophecy. + * + * @param string $argKey Argument for the method prophecy. + * @param mixed $returnValue Return value of the `getMetadata` method. + * + * @return StreamInterface + */ + protected function prophesizeStreamInterfaceWithGetMetadataMethod(string $argKey, $returnValue): StreamInterface + { + $streamProphecy = $this->prophesize(StreamInterface::class); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy + ->getMetadata($argKey) + ->willReturn($returnValue) + ->shouldBeCalled(); + + /** @var StreamInterface $stream */ + $stream = $streamProphecy->reveal(); + + return $stream; + } + + public function testCreateUploadedFileWithInvalidUri() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('File is not readable.'); + + // Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` method prophecy. + $streamProphecy = $this->prophesize(StreamInterface::class); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy + ->getMetadata('uri') + ->willReturn(null) + ->shouldBeCalled(); + + /** @var StreamInterface $stream */ + $stream = $streamProphecy->reveal(); + + $this->factory->createUploadedFile($stream); + } + + public function testCreateUploadedFileWithNonReadableFile() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('File is not readable.'); + + // Prophesize a `\Psr\Http\Message\StreamInterface` with a `getMetadata` and `isReadable` method prophecies. + $streamProphecy = $this->prophesize(StreamInterface::class); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy + ->getMetadata('uri') + ->willReturn('non-readable') + ->shouldBeCalled(); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy + ->isReadable() + ->willReturn(false) + ->shouldBeCalled(); + + /** @var StreamInterface $stream */ + $stream = $streamProphecy->reveal(); + + $this->factory->createUploadedFile($stream); + } +} diff --git a/vendor/slim/psr7/tests/Factory/UriFactoryTest.php b/vendor/slim/psr7/tests/Factory/UriFactoryTest.php new file mode 100644 index 0000000000..192756973a --- /dev/null +++ b/vendor/slim/psr7/tests/Factory/UriFactoryTest.php @@ -0,0 +1,243 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Factory; + +use Interop\Http\Factory\UriFactoryTestCase; +use Slim\Psr7\Environment; +use Slim\Psr7\Factory\UriFactory; + +class UriFactoryTest extends UriFactoryTestCase +{ + protected function createUriFactory(): UriFactory + { + return new UriFactory(); + } + + public function testGetAuthorityWithUsername() + { + $uri = $this->createUriFactory()->createUri('https://josh@example.com/foo/bar?abc=123#section3'); + + $this->assertEquals('josh@example.com', $uri->getAuthority()); + } + + public function testGetAuthority() + { + $uri = $this->createUriFactory()->createUri('https://example.com/foo/bar?abc=123#section3'); + + $this->assertEquals('example.com', $uri->getAuthority()); + } + + public function testGetAuthorityWithNonStandardPort() + { + $uri = $this->createUriFactory()->createUri('https://example.com:400/foo/bar?abc=123#section3'); + + $this->assertEquals('example.com:400', $uri->getAuthority()); + } + + public function testGetUserInfoWithUsernameAndPassword() + { + $uri = $this->createUriFactory()->createUri('https://josh:sekrit@example.com:443/foo/bar?abc=123#section3'); + + $this->assertEquals('josh:sekrit', $uri->getUserInfo()); + } + + public function testGetUserInfoWithUsernameAndPasswordEncodesCorrectly() + { + $uri = $this + ->createUriFactory() + ->createUri('https://bob@example.com:pass:word@example.com:443/foo/bar?abc=123#section3'); + + $this->assertEquals('bob%40example.com:pass%3Aword', $uri->getUserInfo()); + } + + public function testGetUserInfoWithUsername() + { + $uri = $this->createUriFactory()->createUri('http://josh@example.com/foo/bar?abc=123#section3'); + + $this->assertEquals('josh', $uri->getUserInfo()); + } + + public function testGetUserInfoNone() + { + $uri = $this->createUriFactory()->createUri('https://example.com/foo/bar?abc=123#section3'); + + $this->assertEquals('', $uri->getUserInfo()); + } + + public function testCreateFromString() + { + $uri = $this->createUriFactory()->createUri('https://example.com:8080/foo/bar?abc=123'); + + $this->assertEquals('https', $uri->getScheme()); + $this->assertEquals('example.com', $uri->getHost()); + $this->assertEquals('8080', $uri->getPort()); + $this->assertEquals('/foo/bar', $uri->getPath()); + $this->assertEquals('abc=123', $uri->getQuery()); + } + + public function testCreateFromGlobals() + { + $globals = Environment::mock([ + 'SCRIPT_NAME' => '/index.php', + 'REQUEST_URI' => '/foo/bar?baz=1', + 'PHP_AUTH_USER' => 'josh', + 'PHP_AUTH_PW' => 'sekrit', + 'QUERY_STRING' => 'abc=123', + 'HTTP_HOST' => 'example.com:8080', + 'SERVER_PORT' => 8080, + ]); + + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('josh:sekrit', $uri->getUserInfo()); + $this->assertEquals('example.com', $uri->getHost()); + $this->assertEquals('8080', $uri->getPort()); + $this->assertEquals('/foo/bar', $uri->getPath()); + $this->assertEquals('abc=123', $uri->getQuery()); + $this->assertEquals('', $uri->getFragment()); + } + + public function testCreateFromGlobalsWithHttps() + { + $globals = Environment::mock( + [ + 'HTTPS' => 'on', + 'HTTP_HOST' => 'example.com' + ] + ); + + // Make the 'SERVER_PORT' empty as we want to test if the default server port gets set correctly. + $globals['SERVER_PORT'] = ''; + + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('https', $uri->getScheme()); + $this->assertEquals('example.com', $uri->getHost()); + + // The port is expected to be NULL as the server port is the default standard (443 in case of https). + $this->assertNull($uri->getPort()); + } + + public function testCreateFromGlobalsUsesServerNameAsHostIfHostHeaderIsNotPresent() + { + $globals = Environment::mock([ + 'SERVER_NAME' => 'example.com', + ]); + + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('example.com', $uri->getHost()); + } + + public function testCreateFromGlobalWithIPv6HostNoPort() + { + $environment = Environment::mock([ + 'SCRIPT_NAME' => '/index.php', + 'REQUEST_URI' => '/foo/bar', + 'PHP_AUTH_USER' => 'josh', + 'PHP_AUTH_PW' => 'sekrit', + 'QUERY_STRING' => 'abc=123', + 'HTTP_HOST' => '[2001:db8::1]', + 'REMOTE_ADDR' => '2001:db8::1', + 'SERVER_PORT' => 8080, + ]); + $uri = $this->createUriFactory()->createFromGlobals($environment); + + $this->assertEquals('josh:sekrit', $uri->getUserInfo()); + $this->assertEquals('[2001:db8::1]', $uri->getHost()); + $this->assertEquals('8080', $uri->getPort()); + $this->assertEquals('/foo/bar', $uri->getPath()); + $this->assertEquals('abc=123', $uri->getQuery()); + $this->assertEquals('', $uri->getFragment()); + } + + public function testCreateFromGlobalsWithIPv6HostWithPort() + { + $globals = Environment::mock([ + 'SCRIPT_NAME' => '/index.php', + 'REQUEST_URI' => '/foo/bar', + 'PHP_AUTH_USER' => 'josh', + 'PHP_AUTH_PW' => 'sekrit', + 'QUERY_STRING' => 'abc=123', + 'HTTP_HOST' => '[2001:db8::1]:8080', + 'REMOTE_ADDR' => '2001:db8::1', + 'SERVER_PORT' => 8080, + ]); + + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('josh:sekrit', $uri->getUserInfo()); + $this->assertEquals('[2001:db8::1]', $uri->getHost()); + $this->assertEquals('8080', $uri->getPort()); + $this->assertEquals('/foo/bar', $uri->getPath()); + $this->assertEquals('abc=123', $uri->getQuery()); + $this->assertEquals('', $uri->getFragment()); + } + + public function testCreateFromGlobalsWithBasePathContainingSpace() + { + $globals = Environment::mock([ + 'SCRIPT_NAME' => "/f'oo bar/index.php", + 'REQUEST_URI' => "/f%27oo%20bar/baz", + ]); + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('/f%27oo%20bar/baz', $uri->getPath()); + } + + public function testWithPathWhenBaseRootIsEmpty() + { + $globals = Environment::mock([ + 'SCRIPT_NAME' => '/index.php', + 'REQUEST_URI' => '/bar', + ]); + $uri = $this->createUriFactory()->createFromGlobals($globals); + + $this->assertEquals('http://localhost/test', (string) $uri->withPath('test')); + } + + /** + * When the URL is /foo/index.php/bar/baz, we need the baseURL to be + * /foo/index.php so that routing works correctly. + * + * @ticket 1639 as a fix to 1590 broke this. + */ + public function testRequestURIContainsIndexDotPhp() + { + $uri = $this->createUriFactory()->createFromGlobals( + Environment::mock( + [ + 'SCRIPT_NAME' => '/foo/index.php', + 'REQUEST_URI' => '/foo/index.php/bar/baz', + ] + ) + ); + $this->assertSame('/foo/index.php/bar/baz', $uri->getPath()); + } + + public function testRequestURICanContainParams() + { + $uri = $this->createUriFactory()->createFromGlobals( + Environment::mock( + [ + 'REQUEST_URI' => '/foo?abc=123', + ] + ) + ); + $this->assertEquals('abc=123', $uri->getQuery()); + } + + public function testUriDistinguishZeroFromEmptyString() + { + $expected = 'https://0:0@0:1/0?0#0'; + $this->assertSame($expected, (string) $this->createUriFactory()->createUri($expected)); + } +} diff --git a/vendor/slim/psr7/tests/HeaderTest.php b/vendor/slim/psr7/tests/HeaderTest.php new file mode 100644 index 0000000000..d062768795 --- /dev/null +++ b/vendor/slim/psr7/tests/HeaderTest.php @@ -0,0 +1,61 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use PHPUnit\Framework\TestCase; +use Slim\Psr7\Header; + +class HeaderTest extends TestCase +{ + /** + * Instantiate a default header. + * + * @return Header + */ + protected function headerFactory(): Header + { + $originalName = 'ACCEPT'; + $normalizedName = 'accept'; + $values = ['application/json']; + + return new Header($originalName, $normalizedName, $values); + } + + public function testGetOriginalName(): void + { + $header = $this->headerFactory(); + $this->assertEquals('ACCEPT', $header->getOriginalName()); + } + + public function testGetNormalizedName(): void + { + $header = $this->headerFactory(); + $this->assertEquals('accept', $header->getNormalizedName()); + } + + public function testAddValue(): void + { + $header = $this->headerFactory(); + $header2 = $header->addValue('text/html'); + + $this->assertEquals(['application/json', 'text/html'], $header->getValues()); + $this->assertSame($header2, $header); + } + + public function testAddValuesString(): void + { + $header = $this->headerFactory(); + $header2 = $header->addValues('text/html'); + + $this->assertEquals(['application/json', 'text/html'], $header->getValues()); + $this->assertSame($header2, $header); + } +} diff --git a/vendor/slim/psr7/tests/HeadersTest.php b/vendor/slim/psr7/tests/HeadersTest.php new file mode 100644 index 0000000000..0642058bcc --- /dev/null +++ b/vendor/slim/psr7/tests/HeadersTest.php @@ -0,0 +1,288 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use Slim\Psr7\Headers; +use stdClass; + +use function base64_encode; + +class HeadersTest extends TestCase +{ + public function testCreateFromGlobals() + { + $GLOBALS['getallheaders_return'] = [ + 'HTTP_ACCEPT' => 'application/json', + ]; + + $headers = Headers::createFromGlobals(); + + unset($GLOBALS['getallheaders_return']); + + $this->assertEquals(['accept' => ['application/json']], $headers->getHeaders()); + $this->assertEquals(['ACCEPT' => ['application/json']], $headers->getHeaders(true)); + } + + public function testCreateFromGlobalsUsesEmptyArrayIfGetAllHeadersReturnsFalse() + { + $GLOBALS['getallheaders_return'] = false; + + $headers = Headers::createFromGlobals(); + + unset($GLOBALS['getallheaders_return']); + + $this->assertEquals([], $headers->getHeaders()); + } + + public function testAddHeader() + { + $headers = new Headers([ + 'Accept' => 'application/json', + ]); + + $headers->addHeader('Accept', 'text/html'); + + $this->assertEquals(['application/json', 'text/html'], $headers->getHeader('Accept')); + $this->assertEquals(['accept' => ['application/json', 'text/html']], $headers->getHeaders()); + $this->assertEquals(['Accept' => ['application/json', 'text/html']], $headers->getHeaders(true)); + } + + public function testAddHeaderValueEmptyArray() + { + $this->expectException(InvalidArgumentException::class); + + $headers = new Headers(); + $headers->addHeader('Header', []); + } + + public function testRemoveHeader() + { + $headers = new Headers([ + 'Accept' => 'application/json', + ]); + + $headers->removeHeader('Accept'); + + $this->assertEquals([], $headers->getHeader('Accept')); + $this->assertEquals([], $headers->getHeaders()); + } + + /** + * @doesNotPerformAssertions + */ + public function testRemoveHeaderByIncompatibleStringWithRFC() + { + $headers = new Headers(); + $headers->removeHeader('<incompatible with RFC>'); + } + + public function testGetHeader() + { + $headers = new Headers([ + 'Accept' => ['application/json', 'text/html'], + ]); + + $this->assertEquals(['application/json', 'text/html'], $headers->getHeader('accept')); + $this->assertEquals(['application/json', 'text/html'], $headers->getHeader('Accept')); + $this->assertEquals(['application/json', 'text/html'], $headers->getHeader('HTTP_ACCEPT')); + } + + public function testGetHeaderReturnsValidatedAndTrimedHeaderDefaultValue() + { + $headers = new Headers([]); + + $this->assertEquals(['application/json'], $headers->getHeader('accept', ' application/json')); + } + + public function testGetHeaderThrowsExceptionWithInvalidDefaultArgument() + { + $this->expectException(InvalidArgumentException::class); + + $headers = new Headers([]); + + $headers->getHeader('accept', new stdClass()); + } + + public function testSetHeader() + { + $headers = new Headers([ + 'Content-Length' => 0, + ]); + + $headers->setHeader('Content-Length', 100); + + $this->assertSame(['100'], $headers->getHeader('Content-Length')); + $this->assertEquals(['content-length' => ['100']], $headers->getHeaders()); + $this->assertEquals(['Content-Length' => ['100']], $headers->getHeaders(true)); + } + + public function testSetHeaderPreservesOriginalCaseIfHeaderAlreadyExists() + { + $headers = new Headers([ + 'CONTENT-LENGTH' => 0, + ]); + + $headers->setHeader('Content-Length', 100); + + $this->assertEquals(['content-length' => ['100']], $headers->getHeaders()); + $this->assertEquals(['CONTENT-LENGTH' => ['100']], $headers->getHeaders(true)); + } + + public function testSetHeaders() + { + $headers = new Headers([ + 'Content-Length' => 0, + ]); + + $headers->setHeaders([ + 'Accept' => 'application/json', + ]); + + $this->assertEquals(['accept' => ['application/json']], $headers->getHeaders()); + $this->assertEquals(['Accept' => ['application/json']], $headers->getHeaders(true)); + } + + public function testHasHeader() + { + $headers = new Headers([ + 'Accept' => 'application/json', + ]); + + $this->assertTrue($headers->hasHeader('accept')); + $this->assertTrue($headers->hasHeader('Accept')); + $this->assertTrue($headers->hasHeader('HTTP_ACCEPT')); + } + + public function testGetHeaders() + { + $headers = new Headers([ + 'HTTP_ACCEPT' => 'text/html', + 'HTTP_CONTENT_TYPE' => 'application/json', + ]); + + $expectedNormalizedHeaders = [ + 'accept' => ['text/html'], + 'content-type' => ['application/json'], + ]; + + $this->assertEquals($expectedNormalizedHeaders, $headers->getHeaders()); + } + + public function testGetHeadersPreservesOriginalCase() + { + $headers = new Headers([ + 'HTTP_ACCEPT' => 'text/html', + 'HTTP_CONTENT_TYPE' => 'application/json', + ]); + + $expectedOriginalHeaders = [ + 'ACCEPT' => ['text/html'], + 'CONTENT-TYPE' => ['application/json'], + ]; + + $this->assertEquals($expectedOriginalHeaders, $headers->getHeaders(true)); + } + + public function testParseAuthorizationHeader() + { + $expectedValue = 'Basic ' . base64_encode('user:password'); + + $headers = new Headers(['Authorization' => $expectedValue]); + $this->assertEquals([$expectedValue], $headers->getHeader('Authorization')); + + $headers = new Headers([], ['REDIRECT_HTTP_AUTHORIZATION' => 'cookie']); + $this->assertEquals(['cookie'], $headers->getHeader('Authorization')); + + $headers = new Headers([], ['PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password']); + $this->assertEquals([$expectedValue], $headers->getHeader('Authorization')); + + $headers = new Headers([], ['PHP_AUTH_DIGEST' => 'digest']); + $this->assertEquals(['digest'], $headers->getHeader('Authorization')); + } + + /** + * @dataProvider provideInvalidHeaderNames + */ + public function testWithInvalidHeaderName($headerName): void + { + $headers = new Headers(); + + $this->expectException(\InvalidArgumentException::class); + + $headers->setHeader($headerName, 'foo'); + } + + public static function provideInvalidHeaderNames(): array + { + return [ + [[]], + [false], + [new \stdClass()], + ["Content-Type\r\n\r\n"], + ["Content-Type\r\n"], + ["Content-Type\n"], + ["\r\nContent-Type"], + ["\nContent-Type"], + ["\n"], + ["\r\n"], + ["\t"], + ]; + } + + /** + * @dataProvider provideInvalidHeaderValues + */ + public function testSetInvalidHeaderValue($headerValue) + { + $headers = new Headers(); + + $this->expectException(\InvalidArgumentException::class); + + $headers->setHeader('Content-Type', $headerValue); + } + + public static function provideInvalidHeaderValues(): array + { + // Explicit tests for newlines as the most common exploit vector. + $tests = [ + ["new\nline"], + ["new\r\nline"], + ["new\rline"], + ["new\r\n line"], + ["newline\n"], + ["\nnewline"], + ["newline\r\n"], + ["\n\rnewline"], + ]; + + for ($i = 0; $i <= 0xff; $i++) { + if (\chr($i) == "\t") { + continue; + } + if (\chr($i) == " ") { + continue; + } + if ($i >= 0x21 && $i <= 0x7e) { + continue; + } + if ($i >= 0x80) { + continue; + } + + $tests[] = ["foo" . \chr($i) . "bar"]; + $tests[] = ["foo" . \chr($i)]; + } + + return $tests; + } +} diff --git a/vendor/slim/psr7/tests/Integration/BaseTestFactories.php b/vendor/slim/psr7/tests/Integration/BaseTestFactories.php new file mode 100644 index 0000000000..1aa31d8c2a --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/BaseTestFactories.php @@ -0,0 +1,57 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Psr\Http\Message\UriInterface; +use Slim\Psr7\Factory\UriFactory; +use Slim\Psr7\Stream; +use Slim\Psr7\UploadedFile; + +use function fopen; +use function fwrite; +use function is_resource; + +trait BaseTestFactories +{ + /** + * @param string $uri + * @return UriInterface + */ + protected function buildUri($uri): UriInterface + { + return (new UriFactory())->createUri($uri); + } + + /** + * @param $data + * @return Stream + */ + protected function buildStream($data): Stream + { + if (!is_resource($data)) { + $h = fopen('php://temp', 'w+'); + fwrite($h, $data); + + $data = $h; + } + + return new Stream($data); + } + + /** + * @param $data + * @return UploadedFile + */ + protected function buildUploadableFile($data): UploadedFile + { + return new UploadedFile($this->buildStream($data)); + } +} diff --git a/vendor/slim/psr7/tests/Integration/RequestTest.php b/vendor/slim/psr7/tests/Integration/RequestTest.php new file mode 100644 index 0000000000..0ea00bcb2e --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/RequestTest.php @@ -0,0 +1,36 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\RequestIntegrationTest; +use Psr\Http\Message\RequestInterface; +use Slim\Psr7\Headers; +use Slim\Psr7\Request; + +class RequestTest extends RequestIntegrationTest +{ + use BaseTestFactories; + + /** + * @return RequestInterface that is used in the tests + */ + public function createSubject(): RequestInterface + { + return new Request( + 'GET', + $this->buildUri('/'), + new Headers(), + [], + [], + $this->buildStream('') + ); + } +} diff --git a/vendor/slim/psr7/tests/Integration/ResponseTest.php b/vendor/slim/psr7/tests/Integration/ResponseTest.php new file mode 100644 index 0000000000..7bd45fe703 --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/ResponseTest.php @@ -0,0 +1,27 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\ResponseIntegrationTest; +use Slim\Psr7\Response; + +class ResponseTest extends ResponseIntegrationTest +{ + use BaseTestFactories; + + /** + * @return Response that is used in the tests + */ + public function createSubject(): Response + { + return new Response(); + } +} diff --git a/vendor/slim/psr7/tests/Integration/ServerRequestTest.php b/vendor/slim/psr7/tests/Integration/ServerRequestTest.php new file mode 100644 index 0000000000..7186a34f41 --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/ServerRequestTest.php @@ -0,0 +1,35 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\ServerRequestIntegrationTest; +use Slim\Psr7\Headers; +use Slim\Psr7\Request; + +class ServerRequestTest extends ServerRequestIntegrationTest +{ + use BaseTestFactories; + + /** + * @return Request + */ + public function createSubject(): Request + { + return new Request( + 'GET', + $this->buildUri('/'), + new Headers(), + $_COOKIE, + $_SERVER, + $this->buildStream('') + ); + } +} diff --git a/vendor/slim/psr7/tests/Integration/StreamTest.php b/vendor/slim/psr7/tests/Integration/StreamTest.php new file mode 100644 index 0000000000..e70af716c4 --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/StreamTest.php @@ -0,0 +1,46 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\StreamIntegrationTest; +use InvalidArgumentException; +use Psr\Http\Message\StreamInterface; +use Slim\Psr7\Stream; + +use function fopen; +use function fwrite; +use function is_resource; +use function is_string; + +class StreamTest extends StreamIntegrationTest +{ + use BaseTestFactories; + + /** + * @param string|resource|StreamInterface $data + * + * @return StreamInterface + */ + public function createStream($data) + { + if ($data instanceof StreamInterface) { + return $data; + } elseif (is_resource($data)) { + return new Stream($data); + } elseif (is_string($data)) { + $s = fopen('php://temp', 'w+'); + fwrite($s, $data); + return new Stream($s); + } + + throw new InvalidArgumentException(); + } +} diff --git a/vendor/slim/psr7/tests/Integration/UploadedFileTest.php b/vendor/slim/psr7/tests/Integration/UploadedFileTest.php new file mode 100644 index 0000000000..04568d4ca3 --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/UploadedFileTest.php @@ -0,0 +1,51 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\UploadedFileIntegrationTest; +use Psr\Http\Message\UploadedFileInterface; +use Slim\Psr7\UploadedFile; + +use function sys_get_temp_dir; +use function tempnam; + +class UploadedFileTest extends UploadedFileIntegrationTest +{ + use BaseTestFactories; + + protected string $tempFilename; + + /** + * @return UploadedFileInterface + */ + public function createSubject() + { + $this->tempFilename = tempnam(sys_get_temp_dir(), 'Slim_Http_UploadedFileTest_'); + if (!$this->tempFilename) { + throw new \RuntimeException("Unable to create temporary file"); + } + file_put_contents($this->tempFilename, '12345'); + + return new UploadedFile( + $this->tempFilename, + basename($this->tempFilename), + 'text/plain', + (int)filesize($this->tempFilename) + ); + } + + protected function tearDown(): void + { + if (is_file($this->tempFilename)) { + unlink($this->tempFilename); + } + } +} diff --git a/vendor/slim/psr7/tests/Integration/UriTest.php b/vendor/slim/psr7/tests/Integration/UriTest.php new file mode 100644 index 0000000000..525052a13a --- /dev/null +++ b/vendor/slim/psr7/tests/Integration/UriTest.php @@ -0,0 +1,30 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Integration; + +use Http\Psr7Test\UriIntegrationTest; +use Psr\Http\Message\UriInterface; +use Slim\Psr7\Factory\UriFactory; + +class UriTest extends UriIntegrationTest +{ + use BaseTestFactories; + + /** + * @param string $uri + * + * @return UriInterface + */ + public function createUri($uri): UriInterface + { + return (new UriFactory())->createUri($uri); + } +} diff --git a/vendor/slim/psr7/tests/MessageTest.php b/vendor/slim/psr7/tests/MessageTest.php new file mode 100644 index 0000000000..eced34fcb8 --- /dev/null +++ b/vendor/slim/psr7/tests/MessageTest.php @@ -0,0 +1,186 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Slim\Psr7\Headers; +use Slim\Psr7\Stream; +use Slim\Tests\Psr7\Mocks\MessageStub; + +class MessageTest extends TestCase +{ + public function testGetProtocolVersion() + { + $message = new MessageStub(); + $message->protocolVersion = '1.0'; + + $this->assertEquals('1.0', $message->getProtocolVersion()); + } + + public function testWithProtocolVersion() + { + $message = new MessageStub(); + $clone = $message->withProtocolVersion('1.0'); + + $this->assertEquals('1.0', $clone->protocolVersion); + } + + public function testWithProtocolVersionInvalidThrowsException() + { + $this->expectException(InvalidArgumentException::class); + + $message = new MessageStub(); + $message->withProtocolVersion('3.0'); + } + + public function testGetHeaders() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $headers->addHeader('X-Foo', 'two'); + $headers->addHeader('X-Foo', 'three'); + + $message = new MessageStub(); + $message->headers = $headers; + + $shouldBe = [ + 'X-Foo' => [ + 'one', + 'two', + 'three', + ], + ]; + + $this->assertEquals($shouldBe, $message->getHeaders()); + } + + public function testHasHeader() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + + $message = new MessageStub(); + $message->headers = $headers; + + $this->assertTrue($message->hasHeader('X-Foo')); + $this->assertFalse($message->hasHeader('X-Bar')); + } + + public function testGetHeaderLine() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $headers->addHeader('X-Foo', 'two'); + $headers->addHeader('X-Foo', 'three'); + + $message = new MessageStub(); + $message->headers = $headers; + + $this->assertEquals('one,two,three', $message->getHeaderLine('X-Foo')); + $this->assertEquals('', $message->getHeaderLine('X-Bar')); + } + + public function testGetHeader() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $headers->addHeader('X-Foo', 'two'); + $headers->addHeader('X-Foo', 'three'); + + $message = new MessageStub(); + $message->headers = $headers; + + $this->assertEquals(['one', 'two', 'three'], $message->getHeader('X-Foo')); + $this->assertEquals([], $message->getHeader('X-Bar')); + } + + public function testWithHeader() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $message = new MessageStub(); + $message->headers = $headers; + $clone = $message->withHeader('X-Foo', 'bar'); + + $this->assertEquals('bar', $clone->getHeaderLine('X-Foo')); + } + + public function testWithAddedHeader() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $message = new MessageStub(); + $message->headers = $headers; + $clone = $message->withAddedHeader('X-Foo', 'two'); + + $this->assertEquals('one,two', $clone->getHeaderLine('X-Foo')); + } + + public function testWithoutHeader() + { + $headers = new Headers(); + $headers->addHeader('X-Foo', 'one'); + $headers->addHeader('X-Bar', 'two'); + $response = new MessageStub(); + $response->headers = $headers; + $clone = $response->withoutHeader('X-Foo'); + $shouldBe = [ + 'X-Bar' => ['two'], + ]; + + $this->assertEquals($shouldBe, $clone->getHeaders()); + } + + /** + * @doesNotPerformAssertions + */ + public function testWithoutHeaderByIncompatibleStringWithRFC() + { + $headers = new Headers(); + $response = new MessageStub(); + $response->headers = $headers; + $response->withoutHeader('<incompatible with RFC'); + } + + public function testGetBody() + { + $body = $this->getBody(); + $message = new MessageStub(); + $message->body = $body; + + $this->assertSame($body, $message->getBody()); + } + + public function testWithBody() + { + $body = $this->getBody(); + $body2 = $this->getBody(); + $message = new MessageStub(); + $message->body = $body; + $clone = $message->withBody($body2); + + $this->assertSame($body, $message->body); + $this->assertSame($body2, $clone->body); + } + + /** + * @return MockObject|Stream + */ + protected function getBody() + { + return $this + ->getMockBuilder(Stream::class) + ->disableOriginalConstructor() + ->getMock(); + } +} diff --git a/vendor/slim/psr7/tests/Mocks/MessageStub.php b/vendor/slim/psr7/tests/Mocks/MessageStub.php new file mode 100644 index 0000000000..3672d84eeb --- /dev/null +++ b/vendor/slim/psr7/tests/Mocks/MessageStub.php @@ -0,0 +1,37 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7\Mocks; + +use Psr\Http\Message\StreamInterface; +use Slim\Psr7\Interfaces\HeadersInterface; +use Slim\Psr7\Message; + +class MessageStub extends Message +{ + /** + * Protocol version + */ + public string $protocolVersion; + + /** + * Headers + * + * @var HeadersInterface + */ + public $headers; + + /** + * Body object + * + * @var StreamInterface + */ + public $body; +} diff --git a/vendor/slim/psr7/tests/NonBufferedBodyTest.php b/vendor/slim/psr7/tests/NonBufferedBodyTest.php new file mode 100644 index 0000000000..146365df74 --- /dev/null +++ b/vendor/slim/psr7/tests/NonBufferedBodyTest.php @@ -0,0 +1,159 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use PHPUnit\Framework\TestCase; +use RuntimeException; +use Slim\Psr7\NonBufferedBody; +use Slim\Psr7\Response; +use Slim\Tests\Psr7\Assets\HeaderStack; + +use function ob_get_clean; +use function ob_get_level; +use function ob_start; +use function strlen; + +class NonBufferedBodyTest extends TestCase +{ + protected function setUp(): void + { + HeaderStack::reset(); + } + + protected function tearDown(): void + { + HeaderStack::reset(); + } + + public function testTheStreamContract() + { + $body = new NonBufferedBody(); + self::assertSame('', (string) $body, 'Casting to string returns no data, since the class does not store any'); + self::assertNull($body->detach(), 'Returns null since there is no such underlying stream'); + self::assertNull($body->getSize(), 'Current size is undefined'); + self::assertSame(0, $body->tell(), 'Pointer is considered to be at position 0 to conform'); + self::assertTrue($body->eof(), 'Always considered to be at EOF'); + self::assertFalse($body->isSeekable(), 'Cannot seek'); + self::assertTrue($body->isWritable(), 'Body is writable'); + self::assertFalse($body->isReadable(), 'Body is not readable'); + self::assertSame('', $body->getContents(), 'Data cannot be retrieved once written'); + self::assertNull($body->getMetadata(), 'Metadata mechanism is not implemented'); + } + + public function testWrite() + { + $ob_initial_level = ob_get_level(); + + // Start output buffering. + ob_start(); + + // Start output buffering again to test the while-loop in the `write()` + // method that calls `ob_get_clean()` as long as the ob level is bigger + // than 0. + ob_start(); + echo 'buffer content: '; + + // Set the ob level shift that should be applied in the `ob_get_level()` + // function override. That way, the `write()` method would only flush + // the second ob, not the first one. We will add the initial ob level + // because phpunit may have started ob too. + $GLOBALS['ob_get_level_shift'] = -($ob_initial_level + 1); + + $body = new NonBufferedBody(); + $length0 = $body->write('hello '); + $length1 = $body->write('world'); + + unset($GLOBALS['ob_get_level_shift']); + $contents = ob_get_clean(); + + $this->assertEquals(strlen('buffer content: ') + strlen('hello '), $length0); + $this->assertEquals(strlen('world'), $length1); + $this->assertEquals('buffer content: hello world', $contents); + } + + public function testWithHeader() + { + (new Response()) + ->withBody(new NonBufferedBody()) + ->withHeader('Foo', 'Bar'); + + self::assertSame([ + [ + 'header' => 'Foo: Bar', + 'replace' => true, + 'status_code' => null + ] + ], HeaderStack::stack()); + } + + public function testWithAddedHeader() + { + (new Response()) + ->withBody(new NonBufferedBody()) + ->withHeader('Foo', 'Bar') + ->withAddedHeader('Foo', 'Baz'); + + self::assertSame([ + [ + 'header' => 'Foo: Bar', + 'replace' => true, + 'status_code' => null + ], + [ + 'header' => 'Foo: Bar,Baz', + 'replace' => true, + 'status_code' => null + ] + ], HeaderStack::stack()); + } + + public function testWithoutHeader() + { + (new Response()) + ->withBody(new NonBufferedBody()) + ->withHeader('Foo', 'Bar') + ->withoutHeader('Foo'); + + self::assertSame([], HeaderStack::stack()); + } + + public function testCloseThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('A NonBufferedBody is not closable.'); + + (new NonBufferedBody())->close(); + } + + public function testSeekThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('A NonBufferedBody is not seekable.'); + + (new NonBufferedBody())->seek(10); + } + + public function testRewindThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('A NonBufferedBody is not rewindable.'); + + (new NonBufferedBody())->rewind(); + } + + public function testReadThrowsRuntimeException() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('A NonBufferedBody is not readable.'); + + (new NonBufferedBody())->read(10); + } +} diff --git a/vendor/slim/psr7/tests/RequestTest.php b/vendor/slim/psr7/tests/RequestTest.php new file mode 100644 index 0000000000..da54f984d8 --- /dev/null +++ b/vendor/slim/psr7/tests/RequestTest.php @@ -0,0 +1,458 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; +use Slim\Psr7\Environment; +use Slim\Psr7\Factory\StreamFactory; +use Slim\Psr7\Factory\UriFactory; +use Slim\Psr7\Headers; +use Slim\Psr7\Request; +use Slim\Psr7\UploadedFile; +use Slim\Psr7\Uri; + +use function property_exists; +use function sprintf; + +class RequestTest extends TestCase +{ + public function requestFactory($envData = []): Request + { + $env = Environment::mock($envData); + + $uri = (new UriFactory())->createUri('https://example.com:443/foo/bar?abc=123'); + $headers = Headers::createFromGlobals($env); + $cookies = [ + 'user' => 'john', + 'id' => '123', + ]; + $serverParams = $env; + $body = (new StreamFactory())->createStream(); + $uploadedFiles = UploadedFile::createFromGlobals($env); + $request = new Request('GET', $uri, $headers, $cookies, $serverParams, $body, $uploadedFiles); + + return $request; + } + + public function testDisableSetter() + { + $request = $this->requestFactory(); + $request->foo = 'bar'; + + $this->assertFalse(property_exists($request, 'foo')); + } + + public function testAddsHostHeaderFromUri() + { + $request = $this->requestFactory(); + $this->assertEquals('example.com', $request->getHeaderLine('Host')); + } + + public function testGetMethod() + { + $this->assertEquals('GET', $this->requestFactory()->getMethod()); + } + + public function testWithMethod() + { + $request = $this->requestFactory()->withMethod('PUT'); + + $this->assertEquals('PUT', $request->getMethod()); + } + + public function testWithMethodCaseSensitive() + { + $request = $this->requestFactory()->withMethod('pOsT'); + + $this->assertEquals('pOsT', $request->getMethod()); + } + + public function testWithAllAllowedCharactersMethod() + { + $request = $this->requestFactory()->withMethod("!#$%&'*+.^_`|~09AZ-"); + + $this->assertEquals("!#$%&'*+.^_`|~09AZ-", $request->getMethod()); + } + + public function testWithMethodInvalid() + { + $this->expectException(InvalidArgumentException::class); + + $this->requestFactory()->withMethod('B@R'); + } + + public function testCreateRequestWithInvalidMethodString() + { + $this->expectException(InvalidArgumentException::class); + + $uri = (new UriFactory())->createUri('https://example.com:443/foo/bar?abc=123'); + $headers = new Headers(); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + + new Request('B@R', $uri, $headers, $cookies, $serverParams, $body); + } + + public function testCreateRequestWithInvalidMethodOther() + { + $this->expectException(InvalidArgumentException::class); + + $uri = (new UriFactory())->createUri('https://example.com:443/foo/bar?abc=123'); + $headers = new Headers(); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + + new Request(10, $uri, $headers, $cookies, $serverParams, $body); + } + + public function testGetRequestTarget() + { + $this->assertEquals('/foo/bar?abc=123', $this->requestFactory()->getRequestTarget()); + } + + public function testGetRequestTargetAlreadySet() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'requestTarget'); + $prop->setAccessible(true); + $prop->setValue($request, '/foo/bar?abc=123'); + + $this->assertEquals('/foo/bar?abc=123', $request->getRequestTarget()); + } + + public function testGetRequestTargetIfNoUri() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'uri'); + $prop->setAccessible(true); + $prop->setValue($request, null); + + $this->assertEquals('/', $request->getRequestTarget()); + } + + public function testWithRequestTarget() + { + $clone = $this->requestFactory()->withRequestTarget('/test?user=1'); + + $this->assertEquals('/test?user=1', $clone->getRequestTarget()); + } + + public function testWithRequestTargetThatHasSpaces() + { + $this->expectException(InvalidArgumentException::class); + + $this->requestFactory()->withRequestTarget('/test/m ore/stuff?user=1'); + } + + public function testGetUri() + { + $uri = (new UriFactory())->createUri('https://example.com:443/foo/bar?abc=123'); + $headers = new Headers(); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + $request = new Request('GET', $uri, $headers, $cookies, $serverParams, $body); + + $this->assertSame($uri, $request->getUri()); + } + + public function testWithUri() + { + // Uris + $uri1 = (new UriFactory())->createUri('https://example.com:443/foo/bar?abc=123'); + $uri2 = (new UriFactory())->createUri('https://example2.com:443/test?xyz=123'); + + // Request + $headers = new Headers(); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + $request = new Request('GET', $uri1, $headers, $cookies, $serverParams, $body); + $clone = $request->withUri($uri2); + + $this->assertSame($uri2, $clone->getUri()); + } + + public function testWithUriPreservesHost() + { + // When `$preserveHost` is set to `true`, this method interacts with + // the Host header in the following ways: + + // - If the Host header is missing or empty, and the new URI contains + // a host component, this method MUST update the Host header in the returned + // request. + $uri1 = (new UriFactory())->createUri(''); + $uri2 = (new UriFactory())->createUri('http://example2.com/test'); + + // Request + $headers = new Headers(); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + $request = new Request('GET', $uri1, $headers, $cookies, $serverParams, $body); + + $clone = $request->withUri($uri2, true); + $this->assertSame('example2.com', $clone->getHeaderLine('Host')); + + // - If the Host header is missing or empty, and the new URI does not contain a + // host component, this method MUST NOT update the Host header in the returned + // request. + $uri3 = (new UriFactory())->createUri(''); + + $clone = $request->withUri($uri3, true); + $this->assertSame('', $clone->getHeaderLine('Host')); + + // - If a Host header is present and non-empty, this method MUST NOT update + // the Host header in the returned request. + $request = $request->withHeader('Host', 'example.com'); + $clone = $request->withUri($uri2, true); + $this->assertSame('example.com', $clone->getHeaderLine('Host')); + } + + public function testGetCookieParams() + { + $shouldBe = [ + 'user' => 'john', + 'id' => '123', + ]; + + $this->assertEquals($shouldBe, $this->requestFactory()->getCookieParams()); + } + + public function testWithCookieParams() + { + $request = $this->requestFactory(); + $clone = $request->withCookieParams(['type' => 'framework']); + + $this->assertEquals(['type' => 'framework'], $clone->getCookieParams()); + } + + public function testGetQueryParams() + { + $this->assertEquals(['abc' => '123'], $this->requestFactory()->getQueryParams()); + } + + public function testGetQueryParamsAlreadySet() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'queryParams'); + $prop->setAccessible(true); + $prop->setValue($request, ['foo' => 'bar']); + + $this->assertEquals(['foo' => 'bar'], $request->getQueryParams()); + } + + public function testWithQueryParams() + { + $request = $this->requestFactory(); + $clone = $request->withQueryParams(['foo' => 'bar']); + $cloneUri = $clone->getUri(); + + $this->assertEquals('abc=123', $cloneUri->getQuery()); // <-- Unchanged + $this->assertEquals(['foo' => 'bar'], $clone->getQueryParams()); // <-- Changed + } + + public function testWithQueryParamsEmptyArray() + { + $request = $this->requestFactory(); + $clone = $request->withQueryParams([]); + $cloneUri = $clone->getUri(); + + $this->assertEquals('abc=123', $cloneUri->getQuery()); // <-- Unchanged + $this->assertEquals([], $clone->getQueryParams()); // <-- Changed + } + + public function testGetQueryParamsWithoutUri() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'uri'); + $prop->setAccessible(true); + $prop->setValue($request, null); + + $this->assertEquals([], $request->getQueryParams()); + } + + public function testWithUploadedFiles() + { + $files = [new UploadedFile('foo.txt'), new UploadedFile('bar.txt')]; + + $request = $this->requestFactory(); + $prevUploaded = $request->getUploadedFiles(); + $clone = $request->withUploadedFiles($files); + + $this->assertEquals($prevUploaded, $request->getUploadedFiles()); + $this->assertEquals($files, $clone->getUploadedFiles()); + } + + public function testGetServerParams() + { + $mockEnv = Environment::mock(["HTTP_AUTHORIZATION" => "test"]); + $request = $this->requestFactory(["HTTP_AUTHORIZATION" => "test"]); + + $serverParams = $request->getServerParams(); + foreach ($serverParams as $key => $value) { + if ($key == 'REQUEST_TIME' || $key == 'REQUEST_TIME_FLOAT') { + $this->assertGreaterThanOrEqual( + $mockEnv[$key], + $value, + sprintf("%s value of %s was less than expected value of %s", $key, $value, $mockEnv[$key]) + ); + } else { + $this->assertEquals( + $mockEnv[$key], + $value, + sprintf("%s value of %s did not equal expected value of %s", $key, $value, $mockEnv[$key]) + ); + } + } + } + + public function testGetAttributes() + { + $request = $this->requestFactory(); + $attrProp = new ReflectionProperty($request, 'attributes'); + $attrProp->setAccessible(true); + $attrProp->setValue($request, ['foo' => 'bar']); + + $this->assertEquals(['foo' => 'bar'], $request->getAttributes()); + } + + public function testGetAttribute() + { + $request = $this->requestFactory(); + $attrProp = new ReflectionProperty($request, 'attributes'); + $attrProp->setAccessible(true); + $attrProp->setValue($request, ['foo' => 'bar']); + + $this->assertEquals('bar', $request->getAttribute('foo')); + $this->assertNull($request->getAttribute('bar')); + $this->assertEquals(2, $request->getAttribute('bar', 2)); + } + + public function testWithAttribute() + { + $request = $this->requestFactory(); + $attrProp = new ReflectionProperty($request, 'attributes'); + $attrProp->setAccessible(true); + $attrProp->setValue($request, ['foo' => 'bar']); + $clone = $request->withAttribute('test', '123'); + + $this->assertEquals('123', $clone->getAttribute('test')); + } + + public function testWithoutAttribute() + { + $request = $this->requestFactory(); + $attrProp = new ReflectionProperty($request, 'attributes'); + $attrProp->setAccessible(true); + $attrProp->setValue($request, ['foo' => 'bar']); + $clone = $request->withoutAttribute('foo'); + + $this->assertNull($clone->getAttribute('foo')); + } + + public function testGetParsedBodyWhenAlreadyParsed() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'parsedBody'); + $prop->setAccessible(true); + $prop->setValue($request, ['foo' => 'bar']); + + $this->assertEquals(['foo' => 'bar'], $request->getParsedBody()); + } + + public function testGetParsedBodyWhenBodyDoesNotExist() + { + $request = $this->requestFactory(); + $prop = new ReflectionProperty($request, 'body'); + $prop->setAccessible(true); + $prop->setValue($request, null); + + $this->assertNull($request->getParsedBody()); + } + + public function testWithParsedBody() + { + $clone = $this->requestFactory()->withParsedBody(['xyz' => '123']); + + $this->assertEquals(['xyz' => '123'], $clone->getParsedBody()); + } + + public function testWithParsedBodyEmptyArray() + { + $method = 'GET'; + $uri = new Uri('https', 'example.com', 443, '/foo/bar', 'abc=123', '', ''); + $headers = new Headers(); + $headers->setHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf8'); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + $body->write('foo=bar'); + $request = new Request($method, $uri, $headers, $cookies, $serverParams, $body); + + $clone = $request->withParsedBody([]); + + $this->assertEquals([], $clone->getParsedBody()); + } + + public function testWithParsedBodyNull() + { + $method = 'GET'; + $uri = new Uri('https', 'example.com', 443, '/foo/bar', 'abc=123', '', ''); + $headers = new Headers(); + $headers->setHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf8'); + $cookies = []; + $serverParams = []; + $body = (new StreamFactory())->createStream(); + $body->write('foo=bar'); + $request = new Request($method, $uri, $headers, $cookies, $serverParams, $body); + + $clone = $request->withParsedBody(null); + + $this->assertNull($clone->getParsedBody()); + } + + public function testGetParsedBodyReturnsNullWhenThereIsNoBodyData() + { + $request = $this->requestFactory(['REQUEST_METHOD' => 'POST']); + + $this->assertNull($request->getParsedBody()); + } + + public function testGetParsedBodyReturnsNullWhenThereIsNoMediaTypeParserRegistered() + { + $request = $this->requestFactory([ + 'REQUEST_METHOD' => 'POST', + 'CONTENT_TYPE' => 'text/csv', + ]); + $request->getBody()->write('foo,bar,baz'); + + $this->assertNull($request->getParsedBody()); + } + + public function testWithParsedBodyInvalid() + { + $this->expectException(InvalidArgumentException::class); + + $this->requestFactory()->withParsedBody(2); + } + + public function testWithParsedBodyInvalidFalseValue() + { + $this->expectException(InvalidArgumentException::class); + + $this->requestFactory()->withParsedBody(false); + } +} diff --git a/vendor/slim/psr7/tests/ResponseTest.php b/vendor/slim/psr7/tests/ResponseTest.php new file mode 100644 index 0000000000..7b734884ad --- /dev/null +++ b/vendor/slim/psr7/tests/ResponseTest.php @@ -0,0 +1,191 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use ReflectionProperty; +use Slim\Psr7\Environment; +use Slim\Psr7\Headers; +use Slim\Psr7\Response; +use Slim\Psr7\Stream; +use stdClass; + +use function fopen; +use function property_exists; + +class ResponseTest extends TestCase +{ + public function testConstructorWithDefaultArgs() + { + $response = new Response(); + + $headersReflection = new ReflectionProperty($response, 'headers'); + $headersReflection->setAccessible(true); + + $bodyReflection = new ReflectionProperty($response, 'body'); + $bodyReflection->setAccessible(true); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertInstanceOf(Headers::class, $headersReflection->getValue($response)); + $this->assertInstanceOf(Stream::class, $bodyReflection->getValue($response)); + } + + public function testConstructorWithCustomArgs() + { + $headers = new Headers(); + $body = new Stream(fopen('php://temp', 'r+')); + $response = new Response(404, $headers, $body); + + $headersReflection = new ReflectionProperty($response, 'headers'); + $headersReflection->setAccessible(true); + + $bodyReflection = new ReflectionProperty($response, 'body'); + $bodyReflection->setAccessible(true); + + $this->assertEquals(404, $response->getStatusCode()); + $this->assertSame($headers, $headersReflection->getValue($response)); + $this->assertSame($body, $bodyReflection->getValue($response)); + } + + public function testDeepCopyClone() + { + $headers = new Headers(); + $body = new Stream(fopen('php://temp', 'r+')); + $response = new Response(404, $headers, $body); + $clone = clone $response; + + $headersReflection = new ReflectionProperty($response, 'headers'); + $headersReflection->setAccessible(true); + + $this->assertEquals(404, $clone->getStatusCode()); + $this->assertEquals('1.1', $clone->getProtocolVersion()); + $this->assertNotSame($headers, $headersReflection->getValue($clone)); + } + + public function testDisableSetter() + { + $response = new Response(); + $response->foo = 'bar'; + + $this->assertFalse(property_exists($response, 'foo')); + } + + public function testGetStatusCode() + { + $response = new Response(); + $responseStatus = new ReflectionProperty($response, 'status'); + $responseStatus->setAccessible(true); + $responseStatus->setValue($response, 404); + + $this->assertEquals(404, $response->getStatusCode()); + } + + public function testWithStatus() + { + $response = new Response(); + $clone = $response->withStatus(302); + + $this->assertEquals(302, $clone->getStatusCode()); + } + + public function testWithStatusInvalidStatusCodeThrowsException() + { + $this->expectException(InvalidArgumentException::class); + + $response = new Response(); + $response->withStatus(800); + } + + public function testWithStatusInvalidReasonPhraseThrowsException() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Response reason phrase must be a string'); + + $response = new Response(); + $response->withStatus(200, null); + } + + public function testWithStatusEmptyReasonPhrase() + { + $responseWithNoMessage = new Response(310); + + $this->assertEquals('', $responseWithNoMessage->getReasonPhrase()); + } + + public function testReasonPhraseContainsCarriageReturn() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Reason phrase contains one of the following prohibited characters: \r \n'); + + $response = new Response(); + $response = $response->withStatus(404, "Not Found\r"); + } + + public function testReasonPhraseContainsLineFeed() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Reason phrase contains one of the following prohibited characters: \r \n'); + + $response = new Response(); + $response = $response->withStatus(404, "Not Found\n"); + } + + public function testWithStatusValidReasonPhraseObject() + { + $response = new Response(); + $response = $response->withStatus(200, new StringableTestObject('Slim OK')); + $this->assertEquals('Slim OK', $response->getReasonPhrase()); + } + + public function testGetReasonPhrase() + { + $response = new Response(404); + + $this->assertEquals('Not Found', $response->getReasonPhrase()); + } + + public function testEmptyReasonPhraseForUnrecognisedCode() + { + $response = new Response(); + $response = $response->withStatus(199); + + $this->assertSame('', $response->getReasonPhrase()); + } + + public function testSetReasonPhraseForUnrecognisedCode() + { + $response = new Response(); + $response = $response->withStatus(199, 'Random Message'); + + $this->assertEquals('Random Message', $response->getReasonPhrase()); + } + + public function testGetCustomReasonPhrase() + { + $response = new Response(); + $clone = $response->withStatus(200, 'Custom Phrase'); + + $this->assertEquals('Custom Phrase', $clone->getReasonPhrase()); + } + + public function testResponseHeadersDoNotContainAuthorizationHeader() + { + $_SERVER = Environment::mock( + [ + 'PHP_AUTH_USER' => 'foo' + ] + ); + + $response = new Response(); + $this->assertEmpty($response->getHeaders()); + } +} diff --git a/vendor/slim/psr7/tests/StreamTest.php b/vendor/slim/psr7/tests/StreamTest.php new file mode 100644 index 0000000000..0a97197312 --- /dev/null +++ b/vendor/slim/psr7/tests/StreamTest.php @@ -0,0 +1,284 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; +use ReflectionException; +use ReflectionMethod; +use ReflectionProperty; +use RuntimeException; +use Slim\Psr7\Stream; + +use function fopen; +use function popen; +use function stream_get_contents; +use function trim; + +class StreamTest extends TestCase +{ + use ProphecyTrait; + + /** + * @var resource pipe stream file handle + */ + private $pipeFh; + + private Stream $pipeStream; + + public function tearDown(): void + { + if ($this->pipeFh != null) { + // prevent broken pipe error message + stream_get_contents($this->pipeFh); + } + } + + public function testIsPipe() + { + $this->openPipeStream(); + + $this->assertTrue($this->pipeStream->isPipe()); + + $this->pipeStream->detach(); + $this->assertFalse($this->pipeStream->isPipe()); + + $fhFile = fopen(__FILE__, 'r'); + $fileStream = new Stream($fhFile); + $this->assertFalse($fileStream->isPipe()); + } + + public function testIsPipeReadable() + { + $this->openPipeStream(); + + $this->assertTrue($this->pipeStream->isReadable()); + } + + public function testPipeIsNotSeekable() + { + $this->openPipeStream(); + + $this->assertFalse($this->pipeStream->isSeekable()); + } + + public function testCannotSeekPipe() + { + $this->expectException(RuntimeException::class); + + $this->openPipeStream(); + + $this->pipeStream->seek(0); + } + + public function testCannotTellPipe() + { + $this->expectException(RuntimeException::class); + + $this->openPipeStream(); + + $this->pipeStream->tell(); + } + + public function testCannotRewindPipe() + { + $this->expectException(RuntimeException::class); + + $this->openPipeStream(); + + $this->pipeStream->rewind(); + } + + public function testPipeGetSizeYieldsNull() + { + $this->openPipeStream(); + + $this->assertNull($this->pipeStream->getSize()); + } + + public function testClosePipe() + { + $this->openPipeStream(); + + // prevent broken pipe error message + stream_get_contents($this->pipeFh); + + $this->pipeStream->close(); + $this->pipeFh = null; + + $this->assertFalse($this->pipeStream->isPipe()); + } + + public function testPipeToString() + { + $this->openPipeStream(); + $content = trim((string) $this->pipeStream); + + $this->assertSame('12', $content); + } + + public function testConvertsToStringPartiallyReadNonSeekableStream() + { + $this->openPipeStream(); + $head = $this->pipeStream->read(1); + $tail = trim((string) $this->pipeStream); + + $this->assertSame('1', $head); + $this->assertSame('2', $tail); + } + + public function testPipeGetContents() + { + $this->openPipeStream(); + + $contents = trim($this->pipeStream->getContents()); + $this->assertSame('12', $contents); + } + + public function testIsWriteable() + { + $resource = fopen('php://temp', 'w'); + $stream = new Stream($resource); + + $this->assertEquals(13, $stream->write('Hello, world!')); + + $this->assertTrue($stream->isWritable()); + } + + public function testIsReadable() + { + $resource = fopen('php://temp', 'r'); + $stream = new Stream($resource); + + $this->assertTrue($stream->isReadable()); + $this->assertFalse($stream->isWritable()); + } + + public function testIsWritableAndReadable() + { + $resource = fopen('php://temp', 'w+'); + $stream = new Stream($resource); + + $stream->write('Hello, world!'); + + $this->assertEquals('Hello, world!', $stream); + + $this->assertTrue($stream->isWritable()); + $this->assertTrue($stream->isReadable()); + } + + /** + * Test that a call to the protected method `attach` would invoke `detach`. + * + * @throws ReflectionException + */ + public function testAttachAgain() + { + $this->openPipeStream(); + + $streamProphecy = $this->prophesize(Stream::class); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy->detach()->shouldBeCalled(); + + /** @var Stream $stream */ + $stream = $streamProphecy->reveal(); + + $streamProperty = new ReflectionProperty(Stream::class, 'stream'); + $streamProperty->setAccessible(true); + $streamProperty->setValue($stream, $this->pipeFh); + + $attachMethod = new ReflectionMethod(Stream::class, 'attach'); + $attachMethod->setAccessible(true); + $attachMethod->invoke($stream, $this->pipeFh); + } + + public function testGetMetaDataReturnsNullIfStreamIsDetached() + { + $resource = fopen('php://temp', 'rw+'); + $stream = new Stream($resource); + $stream->detach(); + + $this->assertNull($stream->getMetadata()); + } + + private function openPipeStream() + { + $this->pipeFh = popen('echo 12', 'r'); + $this->pipeStream = new Stream($this->pipeFh); + } + + public function testReadOnlyCachedStreamsAreDisallowed() + { + $resource = fopen('php://temp', 'w+'); + $cache = new Stream(fopen('php://temp', 'r')); + + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Cache stream must be seekable and writable'); + new Stream($resource, $cache); + } + + public function testNonSeekableCachedStreamsAreDisallowed() + { + $resource = fopen('php://temp', 'w+'); + $cache = new Stream(fopen('php://output', 'w')); + + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Cache stream must be seekable and writable'); + + new Stream($resource, $cache); + } + + public function testCachedStreamsGetsContentFromTheCache() + { + $resource = popen('echo HelloWorld', 'r'); + $stream = new Stream($resource, new Stream(fopen('php://temp', 'w+'))); + + $this->assertEquals("HelloWorld\n", $stream->getContents()); + $this->assertEquals("HelloWorld\n", $stream->getContents()); + } + + public function testCachedStreamsFillsCacheOnRead() + { + $resource = fopen('data://,0', 'r'); + $stream = new Stream($resource, new Stream(fopen('php://temp', 'w+'))); + + $this->assertEquals("0", $stream->read(100)); + $this->assertEquals("0", $stream->__toString()); + } + + public function testDetachingStreamDropsCache() + { + $cache = new Stream(fopen('php://temp', 'w+')); + $resource = fopen('data://,foo', 'r'); + $stream = new Stream($resource, $cache); + + $stream->detach(); + + $cacheProperty = new ReflectionProperty(Stream::class, 'cache'); + $cacheProperty->setAccessible(true); + $finishedProperty = new ReflectionProperty(Stream::class, 'finished'); + $finishedProperty->setAccessible(true); + + $this->assertNull($cacheProperty->getValue($stream)); + $this->assertFalse($finishedProperty->getValue($stream)); + } + + public function testCachedStreamsRewindIfFinishedOnToString() + { + $resource = fopen('data://,foo', 'r'); + + $stream = new Stream($resource, new Stream(fopen('php://temp', 'w+'))); + + $this->assertEquals('foo', (string)$stream); + $this->assertEquals('foo', (string)$stream); + } +} diff --git a/vendor/slim/psr7/tests/StringableTestObject.php b/vendor/slim/psr7/tests/StringableTestObject.php new file mode 100644 index 0000000000..36a67850d5 --- /dev/null +++ b/vendor/slim/psr7/tests/StringableTestObject.php @@ -0,0 +1,23 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +final class StringableTestObject implements \Stringable +{ + public function __construct(private string $value) + { + } + + public function __toString(): string + { + return $this->value; + } +} diff --git a/vendor/slim/psr7/tests/UploadedFileTest.php b/vendor/slim/psr7/tests/UploadedFileTest.php new file mode 100644 index 0000000000..fa13a0cc87 --- /dev/null +++ b/vendor/slim/psr7/tests/UploadedFileTest.php @@ -0,0 +1,676 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; +use Psr\Http\Message\StreamInterface; +use Psr\Http\Message\UploadedFileInterface; +use ReflectionProperty; +use RuntimeException; +use Slim\Psr7\Environment; +use Slim\Psr7\Factory\StreamFactory; +use Slim\Psr7\Factory\UploadedFileFactory; +use Slim\Psr7\Stream; +use Slim\Psr7\UploadedFile; + +use function call_user_func; +use function fclose; +use function file_exists; +use function file_get_contents; +use function fopen; +use function fwrite; +use function microtime; +use function ob_get_clean; +use function ob_start; +use function strlen; +use function sys_get_temp_dir; +use function uniqid; +use function unlink; +use function version_compare; + +use const DIRECTORY_SEPARATOR; +use const UPLOAD_ERR_CANT_WRITE; +use const UPLOAD_ERR_OK; + +class UploadedFileTest extends TestCase +{ + use ProphecyTrait; + + private static string $filename = './phpUxcOty'; + + private static array $tmpFiles = ['./phpUxcOty']; + + public static function setUpBeforeClass(): void + { + $fh = fopen(self::$filename, "w"); + fwrite($fh, "12345678"); + fclose($fh); + } + + public static function tearDownAfterClass(): void + { + foreach (self::$tmpFiles as $filename) { + if (file_exists($filename)) { + unlink($filename); + } + } + } + + public function tearDown(): void + { + if (isset($GLOBALS['is_uploaded_file_return'])) { + unset($GLOBALS['is_uploaded_file_return']); + } + if (isset($GLOBALS['copy_return'])) { + unset($GLOBALS['copy_return']); + } + if (isset($GLOBALS['rename_return'])) { + unset($GLOBALS['rename_return']); + } + } + + protected function generateNewTmpFile(): UploadedFile + { + $filename = './php' . microtime(); + + $fh = fopen($filename, "w"); + fwrite($fh, "12345678"); + fclose($fh); + + self::$tmpFiles[] = $filename; + + return new UploadedFile($filename); + } + + /** + * @param array $input The input array to parse. + * @param array $expected The expected normalized output. + * + * @dataProvider providerCreateFromGlobals + */ + public function testCreateFromGlobalsFromFilesSuperglobal(array $input, array $expected) + { + $_FILES = $input; + + $uploadedFile = UploadedFile::createFromGlobals(Environment::mock()); + $this->assertEquals($expected, $uploadedFile); + } + + /** + * @param array $input The input array to parse. + * + * @dataProvider providerCreateFromGlobals + */ + public function testCreateFromGlobalsFromUserData(array $input) + { + //If slim.files provided - it will return what was provided + $userData['slim.files'] = $input; + + $uploadedFile = UploadedFile::createFromGlobals(Environment::mock($userData)); + $this->assertEquals($input, $uploadedFile); + } + + public function testCreateFromGlobalsWithoutFile() + { + unset($_FILES); + + $uploadedFile = UploadedFile::createFromGlobals(Environment::mock()); + $this->assertEquals([], $uploadedFile); + } + + public function testConstructor(): UploadedFile + { + $attr = [ + 'tmp_name' => self::$filename, + 'name' => 'my-avatar.txt', + 'size' => 8, + 'type' => 'text/plain', + 'error' => 0, + ]; + + $uploadedFile = new UploadedFile( + $attr['tmp_name'], + $attr['name'], + $attr['type'], + $attr['size'], + $attr['error'], + false + ); + + $this->assertEquals($attr['name'], $uploadedFile->getClientFilename()); + $this->assertEquals($attr['type'], $uploadedFile->getClientMediaType()); + $this->assertEquals($attr['size'], $uploadedFile->getSize()); + $this->assertEquals($attr['error'], $uploadedFile->getError()); + $this->assertEquals($attr['tmp_name'], $uploadedFile->getFilePath()); + + return $uploadedFile; + } + + public function testConstructorSapi(): UploadedFile + { + $attr = [ + 'tmp_name' => self::$filename, + 'name' => 'my-avatar.txt', + 'size' => 8, + 'type' => 'text/plain', + 'error' => 0, + ]; + + $uploadedFile = new UploadedFile( + $attr['tmp_name'], + $attr['name'], + $attr['type'], + $attr['size'], + $attr['error'], + true + ); + + $this->assertEquals($attr['name'], $uploadedFile->getClientFilename()); + $this->assertEquals($attr['type'], $uploadedFile->getClientMediaType()); + $this->assertEquals($attr['size'], $uploadedFile->getSize()); + $this->assertEquals($attr['error'], $uploadedFile->getError()); + $this->assertEquals($attr['tmp_name'], $uploadedFile->getFilePath()); + + return $uploadedFile; + } + + /** + * @depends testConstructor + * + * @param UploadedFile $uploadedFile + * + * @return UploadedFile + */ + public function testGetStream(UploadedFile $uploadedFile): UploadedFile + { + $stream = $uploadedFile->getStream(); + $this->assertEquals(true, $uploadedFile->getStream() instanceof Stream); + $stream->close(); + + return $uploadedFile; + } + + /** + * @depends testConstructor + * + * @param UploadedFile $uploadedFile + * + */ + public function testMoveToNotWritable(UploadedFile $uploadedFile) + { + $this->expectException(InvalidArgumentException::class); + + $tempName = uniqid('file-'); + $path = 'some_random_dir' . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + } + + /** + * @depends testConstructor + * + * @param UploadedFile $uploadedFile + * + * @return UploadedFile + */ + public function testMoveTo(UploadedFile $uploadedFile): UploadedFile + { + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + + $this->assertFileExists($path); + + unlink($path); + + return $uploadedFile; + } + + public function testMoveToRenameFailure() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessageMatches('/^Error moving uploaded file .* to .*$/'); + + $uploadedFile = $this->generateNewTmpFile(); + + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + + $GLOBALS['rename_return'] = false; + $uploadedFile->moveTo($path); + } + + /** + * @depends testConstructorSapi + * + * @param UploadedFile $uploadedFile + * + */ + public function testMoveToSapiNonUploadedFile(UploadedFile $uploadedFile) + { + $this->expectException(RuntimeException::class); + + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + } + + /** + * @depends testConstructorSapi + * + * @param UploadedFile $uploadedFile + * + */ + public function testMoveToSapiMoveUploadedFileFails(UploadedFile $uploadedFile) + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessageMatches('~Error moving uploaded file.*~'); + + $GLOBALS['is_uploaded_file_return'] = true; + + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + } + + /** + * @depends testMoveTo + * + * @param UploadedFile $uploadedFile + * + */ + public function testMoveToCannotBeDoneTwice(UploadedFile $uploadedFile) + { + $this->expectException(RuntimeException::class); + + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + $this->assertFileExists($path); + unlink($path); + + $uploadedFile->moveTo($path); + } + + /** + * This test must run after testMoveTo + * + * @depends testConstructor + * + * @param UploadedFile $uploadedFile + * + */ + public function testMoveToAgain(UploadedFile $uploadedFile) + { + $this->expectException(RuntimeException::class); + + $tempName = uniqid('file-'); + $path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $tempName; + $uploadedFile->moveTo($path); + } + + /** + * This test must run after testMoveTo + * + * @depends testConstructor + * + * @param UploadedFile $uploadedFile + * + */ + public function testMovedStream(UploadedFile $uploadedFile) + { + $this->expectException(RuntimeException::class); + + $uploadedFile->getStream(); + } + + public function testMoveToStream() + { + $uploadedFile = $this->generateNewTmpFile(); + + $fileProperty = new ReflectionProperty($uploadedFile, 'file'); + $fileProperty->setAccessible(true); + $fileName = $fileProperty->getValue($uploadedFile); + + $contents = file_get_contents($fileName); + + ob_start(); + $uploadedFile->moveTo('php://output'); + $movedFileContents = ob_get_clean(); + + $this->assertEquals($contents, $movedFileContents); + $this->assertFileDoesNotExist($fileName); + } + + public function testMoveToStreamCopyFailure() + { + $this->expectException(RuntimeException::class); + $this->expectExceptionMessage('Error moving uploaded file to php://output'); + + $uploadedFile = $this->generateNewTmpFile(); + + $GLOBALS['copy_return'] = false; + $uploadedFile->moveTo('php://output'); + } + + public function testFileUploadWithTempStream() + { + $streamFactory = function (...$args) { + return (new StreamFactory())->createStream(...$args); + }; + $uploadedFileFactory = function (...$args) { + return (new UploadedFileFactory())->createUploadedFile(...$args); + }; + $this->runFileUploadWithTempStreamTest($streamFactory, $uploadedFileFactory); + } + + /** + * This test sequence has been inspired by UploadedFileFactoryTestCase from http-interop/http-factory-tests package. + * + * @param callable $streamFactory + * @param callable $uploadedFileFactory + */ + private function runFileUploadWithTempStreamTest(callable $streamFactory, callable $uploadedFileFactory) + { + $content = 'this is your capitan speaking'; + $error = UPLOAD_ERR_OK; + $clientFilename = 'test.txt'; + $clientMediaType = 'text/plain'; + + $stream = call_user_func($streamFactory, $content); + $file = call_user_func( + $uploadedFileFactory, + $stream, + strlen($content), + $error, + $clientFilename, + $clientMediaType + ); + + $this->assertInstanceOf(UploadedFileInterface::class, $file); + $this->assertSame($content, (string)$file->getStream()); + $this->assertSame(strlen($content), $file->getSize()); + $this->assertSame($error, $file->getError()); + $this->assertSame($clientFilename, $file->getClientFilename()); + $this->assertSame($clientMediaType, $file->getClientMediaType()); + $this->assertSame($stream->getMetadata('uri'), $file->getFilePath()); + } + + public function testCreateUploadedFileWithInvalidArguments() + { + $this->expectException(InvalidArgumentException::class); + + new UploadedFile(42); // a random value that is neither a string nor an instance of StreamInterface + } + + public function testCreateUploadedFileWithInvalidUri() + { + $this->expectException(InvalidArgumentException::class); + + $streamProphecy = $this->prophesize(StreamInterface::class); + + /** @noinspection PhpUndefinedMethodInspection */ + $streamProphecy + ->getMetadata('uri') + ->willReturn(null) + ->shouldBeCalled(); + $stream = $streamProphecy->reveal(); + + // Test with a StreamInterface that returns `null` + // when `$stream->getMetadata('uri')` is called (which is an invalid case). + new UploadedFile($stream); + } + + public static function providerCreateFromGlobals(): array + { + return [ + // no nest: <input name="avatar" type="file"> + [ + // $_FILES array + [ + 'avatar' => [ + 'tmp_name' => 'phpUxcOty', + 'name' => 'my-avatar.png', + 'size' => 90996, + 'type' => 'image/png', + 'error' => 0, + ], + ], + // expected format of array + [ + 'avatar' => new UploadedFile('phpUxcOty', 'my-avatar.png', 'image/png', 90996, UPLOAD_ERR_OK, true) + ] + ], + // no nest, with error: <input name="avatar" type="file"> + [ + // $_FILES array + [ + 'avatar' => [ + 'tmp_name' => 'phpUxcOty', + 'name' => 'my-avatar.png', + 'size' => 90996, + 'type' => 'image/png', + 'error' => 7, + ], + ], + // expected format of array + [ + 'avatar' => new UploadedFile( + 'phpUxcOty', + 'my-avatar.png', + 'image/png', + 90996, + UPLOAD_ERR_CANT_WRITE, + true + ) + ] + ], + + // array of files: <input name="avatars[]" type="file"> + [ + // $_FILES array + [ + 'avatars' => [ + 'tmp_name' => [ + 0 => __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 1 => __DIR__ . DIRECTORY_SEPARATOR . 'file1.html', + ], + 'name' => [ + 0 => 'file0.txt', + 1 => 'file1.html', + ], + 'type' => [ + 0 => 'text/plain', + 1 => 'text/html', + ], + 'error' => [ + 0 => 0, + 1 => 0 + ], + 'size' => [ + 0 => 0, + 1 => 0 + ] + ], + ], + // expected format of array + [ + 'avatars' => [ + 0 => new UploadedFile( + __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 'file0.txt', + 'text/plain', + null, + UPLOAD_ERR_OK, + true + ), + 1 => new UploadedFile( + __DIR__ . DIRECTORY_SEPARATOR . 'file1.html', + 'file1.html', + 'text/html', + null, + UPLOAD_ERR_OK, + true + ), + ], + ] + ], + // array of files as multidimensional array: <input name="avatars[]" type="file"> + [ + // $_FILES array + [ + [ + 'avatars' => [ + 'tmp_name' => [ + 0 => __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 1 => __DIR__ . DIRECTORY_SEPARATOR . 'file1.html', + ], + 'name' => [ + 0 => 'file0.txt', + 1 => 'file1.html', + ], + 'type' => [ + 0 => 'text/plain', + 1 => 'text/html', + ], + 'size' => [ + 0 => 0, + 1 => 0, + ], + ], + ], + ], + // expected format of array + [ + 0 => + [ + 'avatars' => + [ + 'tmp_name' => [], + 'name' => [], + 'type' => [], + 'size' => [], + ], + ], + ], + ], + // single nested file: <input name="details[avatar]" type="file"> + [ + // $_FILES array + [ + 'details' => [ + 'tmp_name' => [ + 'avatar' => __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + ], + 'name' => [ + 'avatar' => 'file0.txt', + ], + 'type' => [ + 'avatar' => 'text/plain', + ], + 'error' => [ + 'avatar' => 0, + ], + 'size' => [ + 'avatar' => 0, + ], + ], + ], + // expected format of array + [ + 'details' => [ + 'avatar' => new UploadedFile( + __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 'file0.txt', + 'text/plain', + null, + UPLOAD_ERR_OK, + true + ), + ], + ] + ], + // nested array of files: <input name="files[details][avatar][]" type="file"> + [ + [ + 'files' => [ + 'tmp_name' => [ + 'details' => [ + 'avatar' => [ + 0 => __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 1 => __DIR__ . DIRECTORY_SEPARATOR . 'file1.html', + ], + ], + ], + 'name' => [ + 'details' => [ + 'avatar' => [ + 0 => 'file0.txt', + 1 => 'file1.html', + ], + ], + ], + 'type' => [ + 'details' => [ + 'avatar' => [ + 0 => 'text/plain', + 1 => 'text/html', + ], + ], + ], + 'error' => [ + 'details' => [ + 'avatar' => [ + 0 => 0, + 1 => 0 + ], + ], + ], + 'size' => [ + 'details' => [ + 'avatar' => [ + 0 => 0, + 1 => 0 + ], + ], + ], + ], + ], + // expected format of array + [ + 'files' => [ + 'details' => [ + 'avatar' => [ + 0 => new UploadedFile( + __DIR__ . DIRECTORY_SEPARATOR . 'file0.txt', + 'file0.txt', + 'text/plain', + null, + UPLOAD_ERR_OK, + true + ), + 1 => new UploadedFile( + __DIR__ . DIRECTORY_SEPARATOR . 'file1.html', + 'file1.html', + 'text/html', + null, + UPLOAD_ERR_OK, + true + ), + ], + ], + ], + ] + ], + ]; + } +} diff --git a/vendor/slim/psr7/tests/UriTest.php b/vendor/slim/psr7/tests/UriTest.php new file mode 100644 index 0000000000..aeb3a85dc9 --- /dev/null +++ b/vendor/slim/psr7/tests/UriTest.php @@ -0,0 +1,383 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Tests\Psr7; + +use InvalidArgumentException; +use PHPUnit\Framework\TestCase; +use Slim\Psr7\Uri; +use stdClass; + +class UriTest extends TestCase +{ + public function uriFactory(): Uri + { + $scheme = 'https'; + $host = 'example.com'; + $port = 443; + $path = '/foo/bar'; + $query = 'abc=123'; + $fragment = 'section3'; + $user = 'josh'; + $password = 'sekrit'; + + return new Uri($scheme, $host, $port, $path, $query, $fragment, $user, $password); + } + + public function testSupportOtherSchemes() + { + $wsUri = new class ('ws', 'example.com') extends Uri { + public const SUPPORTED_SCHEMES = [ + 'ws' => 80, + 'wss' => 443, + ]; + }; + + $this->assertEquals('ws', $wsUri->getScheme()); + } + + public function testGetScheme() + { + $this->assertEquals('https', $this->uriFactory()->getScheme()); + } + + public function testWithScheme() + { + $uri = $this->uriFactory()->withScheme('http'); + + $this->assertEquals('http', $uri->getScheme()); + } + + public function testWithSchemeRemovesSuffix() + { + $uri = $this->uriFactory()->withScheme('http://'); + + $this->assertEquals('http', $uri->getScheme()); + } + + public function testWithSchemeEmpty() + { + $uri = $this->uriFactory()->withScheme(''); + + $this->assertEquals('', $uri->getScheme()); + } + + public function testWithSchemeInvalid() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessageMatches('/^Uri scheme must be one of:.*$/'); + + $this->uriFactory()->withScheme('ftp'); + } + + public function testWithSchemeInvalidType() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Uri scheme must be a string'); + + $this->uriFactory()->withScheme([]); + } + + public function testGetAuthorityWithUsernameAndPassword() + { + $this->assertEquals('josh:sekrit@example.com', $this->uriFactory()->getAuthority()); + } + + public function testWithUserInfo() + { + $uri = $this->uriFactory()->withUserInfo('bob', 'pass'); + + $this->assertEquals('bob:pass', $uri->getUserInfo()); + } + + public function testWithUserInfoEncodesCorrectly() + { + $uri = $this->uriFactory()->withUserInfo('bob@example.com', 'pass:word'); + + $this->assertEquals('bob%40example.com:pass%3Aword', $uri->getUserInfo()); + } + + public function testWithUserInfoRemovesPassword() + { + $uri = $this->uriFactory()->withUserInfo('bob'); + + $this->assertEquals('bob', $uri->getUserInfo()); + } + + public function testWithUserInfoRemovesInfo() + { + $uri = $this->uriFactory()->withUserInfo('bob', 'password'); + $uri = $uri->withUserInfo(''); + + $this->assertEquals('', $uri->getUserInfo()); + } + + public function testGetHost() + { + $this->assertEquals('example.com', $this->uriFactory()->getHost()); + } + + public function testWithHost() + { + $uri = $this->uriFactory()->withHost('slimframework.com'); + + $this->assertEquals('slimframework.com', $uri->getHost()); + } + + public function testWithHostValidObject() + { + $mock = new StringableTestObject('host.test'); + + $uri = $this->uriFactory()->withHost($mock); + $this->assertEquals('host.test', $uri->getHost()); + } + + public function testWithHostInvalidObject() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Uri host must be a string'); + + $this->uriFactory()->withHost(new stdClass()); + } + + public function testFilterHost() + { + $uri = new Uri('http', '2001:db8::1'); + + $this->assertEquals('[2001:db8::1]', $uri->getHost()); + } + + public function testGetPortWithSchemeAndNonDefaultPort() + { + $uri = new Uri('https', 'www.example.com', 4000); + + $this->assertEquals(4000, $uri->getPort()); + } + + public function testGetPortWithSchemeAndDefaultPort() + { + $uriHttp = new Uri('http', 'www.example.com', 80); + $uriHttps = new Uri('https', 'www.example.com', 443); + + $this->assertNull($uriHttp->getPort()); + $this->assertNull($uriHttps->getPort()); + } + + public function testGetPortWithoutSchemeAndPort() + { + $uri = new Uri('', 'www.example.com'); + + $this->assertNull($uri->getPort()); + } + + public function testGetPortWithSchemeWithoutPort() + { + $uri = new Uri('http', 'www.example.com'); + + $this->assertNull($uri->getPort()); + } + + public function testWithPort() + { + $uri = $this->uriFactory()->withPort(8000); + + $this->assertEquals(8000, $uri->getPort()); + } + + public function testWithPortNull() + { + $uri = $this->uriFactory()->withPort(null); + + $this->assertEquals(null, $uri->getPort()); + } + + public function testWithPortInvalidInt() + { + $this->expectException(InvalidArgumentException::class); + + $this->uriFactory()->withPort(70000); + } + + public function testWithPortInvalidString() + { + $this->expectException(InvalidArgumentException::class); + + $this->uriFactory()->withPort('Foo'); + } + + public function testWithPortIntegerAsString() + { + $uri = $this->uriFactory()->withPort("199"); + + $this->assertEquals(199, $uri->getPort()); + } + + public function testGetPath() + { + $this->assertEquals('/foo/bar', $this->uriFactory()->getPath()); + } + + public function testWithPath() + { + $uri = $this->uriFactory()->withPath('/new'); + + $this->assertEquals('/new', $uri->getPath()); + } + + public function testWithPathWithoutPrefix() + { + $uri = $this->uriFactory()->withPath('new'); + + $this->assertEquals('new', $uri->getPath()); + } + + public function testWithPathEmptyValue() + { + $uri = $this->uriFactory()->withPath(''); + + $this->assertEquals('', $uri->getPath()); + } + + public function testWithPathUrlEncodesInput() + { + $uri = $this->uriFactory()->withPath('/includes?/new'); + + $this->assertEquals('/includes%3F/new', $uri->getPath()); + } + + public function testWithPathDoesNotDoubleEncodeInput() + { + $uri = $this->uriFactory()->withPath('/include%25s/new'); + + $this->assertEquals('/include%25s/new', $uri->getPath()); + } + + public function testWithPathInvalidType() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Uri path must be a string'); + + $this->uriFactory()->withPath(['foo']); + } + + public function testGetQuery() + { + $this->assertEquals('abc=123', $this->uriFactory()->getQuery()); + } + + public function testWithQuery() + { + $uri = $this->uriFactory()->withQuery('xyz=123'); + + $this->assertEquals('xyz=123', $uri->getQuery()); + } + + public function testWithQueryRemovesPrefix() + { + $uri = $this->uriFactory()->withQuery('?xyz=123'); + + $this->assertEquals('xyz=123', $uri->getQuery()); + } + + public function testWithQueryEmpty() + { + $uri = $this->uriFactory()->withQuery(''); + + $this->assertEquals('', $uri->getQuery()); + } + + public function testWithQueryValidObject() + { + $mock = new StringableTestObject('xyz=123'); + + $uri = $this->uriFactory()->withQuery($mock); + $this->assertEquals('xyz=123', $uri->getQuery()); + } + + public function testFilterQuery() + { + $uri = $this->uriFactory()->withQuery('?foobar=%match'); + + $this->assertEquals('foobar=%25match', $uri->getQuery()); + } + + public function testWithQueryInvalidType() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Uri query must be a string'); + + $this->uriFactory()->withQuery(['foo']); + } + + public function testGetFragment() + { + $this->assertEquals('section3', $this->uriFactory()->getFragment()); + } + + public function testWithFragment() + { + $uri = $this->uriFactory()->withFragment('other-fragment'); + + $this->assertEquals('other-fragment', $uri->getFragment()); + } + + public function testWithFragmentRemovesPrefix() + { + $uri = $this->uriFactory()->withFragment('#other-fragment'); + + $this->assertEquals('other-fragment', $uri->getFragment()); + } + + public function testWithFragmentEmpty() + { + $uri = $this->uriFactory()->withFragment(''); + + $this->assertEquals('', $uri->getFragment()); + } + + public function testWithFragmentValidObject() + { + $mock = new StringableTestObject('other-fragment'); + + $uri = $this->uriFactory()->withFragment($mock); + $this->assertEquals('other-fragment', $uri->getFragment()); + } + + public function testWithFragmentUrlEncode() + { + $uri = $this->uriFactory()->withFragment('^a'); + + $this->assertEquals('%5Ea', $uri->getFragment()); + } + + public function testWithFragmentInvalidType() + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Uri fragment must be a string'); + + $this->uriFactory()->withFragment(['foo']); + } + + public function testToString() + { + $uri = $this->uriFactory(); + + $this->assertEquals('https://josh:sekrit@example.com/foo/bar?abc=123#section3', (string) $uri); + + $uri = $uri->withPath('bar'); + $this->assertEquals('https://josh:sekrit@example.com/bar?abc=123#section3', (string) $uri); + + $uri = $uri->withPath('/bar'); + $this->assertEquals('https://josh:sekrit@example.com/bar?abc=123#section3', (string) $uri); + + $uri = $uri->withScheme('')->withHost('')->withPort(null)->withUserInfo('')->withPath('//bar'); + $this->assertEquals('/bar?abc=123#section3', (string) $uri); + } +} diff --git a/vendor/slim/psr7/tests/bootstrap.php b/vendor/slim/psr7/tests/bootstrap.php new file mode 100644 index 0000000000..eee56377e2 --- /dev/null +++ b/vendor/slim/psr7/tests/bootstrap.php @@ -0,0 +1,99 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim-Psr7/blob/master/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +use AdrianSuter\Autoload\Override\Override; +use Slim\Psr7\Factory; +use Slim\Psr7\Headers; +use Slim\Psr7\Message; +use Slim\Psr7\NonBufferedBody; +use Slim\Psr7\UploadedFile; +use Slim\Tests\Psr7\Assets\HeaderStack; + +$classLoader = require __DIR__ . '/../vendor/autoload.php'; + +Override::apply($classLoader, [ + Headers::class => [ + 'getallheaders' => function () { + if (array_key_exists('getallheaders_return', $GLOBALS)) { + return $GLOBALS['getallheaders_return']; + } + + return getallheaders(); + } + ], + Message::class => [ + 'header' => function (string $string, bool $replace = true, ?int $statusCode = null): void { + HeaderStack::push( + [ + 'header' => $string, + 'replace' => $replace, + 'status_code' => $statusCode, + ] + ); + }, + 'header_remove' => function ($name = null): void { + HeaderStack::remove($name); + } + ], + NonBufferedBody::class => [ + 'ob_get_level' => function (): int { + if (isset($GLOBALS['ob_get_level_shift'])) { + return ob_get_level() + $GLOBALS['ob_get_level_shift']; + } + + return ob_get_level(); + } + ], + UploadedFile::class => [ + 'copy' => function (string $source, string $destination, $context = null): bool { + if (isset($GLOBALS['copy_return'])) { + return $GLOBALS['copy_return']; + } + + if ($context === null) { + return copy($source, $destination); + } + return copy($source, $destination, $context); + }, + 'is_uploaded_file' => function (string $filename): bool { + if (isset($GLOBALS['is_uploaded_file_return'])) { + return $GLOBALS['is_uploaded_file_return']; + } + + return is_uploaded_file($filename); + }, + 'rename' => function (string $oldName, string $newName, $context = null): bool { + if (isset($GLOBALS['rename_return'])) { + return $GLOBALS['rename_return']; + } + + if ($context === null) { + return rename($oldName, $newName); + } + return rename($oldName, $newName, $context = null); + } + ], + Factory\StreamFactory::class => [ + 'fopen' => function (string $filename, string $mode) { + if (isset($GLOBALS['fopen_return'])) { + return isset($GLOBALS['fopen_return']); + } + + return fopen($filename, $mode); + }, + 'is_readable' => function (string $filename) { + if ($filename === 'non-readable') { + return false; + } + + return is_readable($filename); + } + ] +]); diff --git a/vendor/slim/slim/CHANGELOG.md b/vendor/slim/slim/CHANGELOG.md index 88c6c7d19a..6bcb127dd7 100644 --- a/vendor/slim/slim/CHANGELOG.md +++ b/vendor/slim/slim/CHANGELOG.md @@ -1,5 +1,146 @@ # Changelog +# 4.11.0 - 2022-11-06 +- [3180: Declare types](https://github.com/slimphp/Slim/pull/3180) thanks to @nbayramberdiyev +- [3181: Update laminas/laminas-diactoros requirement from ^2.8 to ^2.9](https://github.com/slimphp/Slim/pull/3181) thanks to @dependabot[bot] +- [3182: Update guzzlehttp/psr7 requirement from ^2.1 to ^2.2](https://github.com/slimphp/Slim/pull/3182) thanks to @dependabot[bot] +- [3183: Update phpstan/phpstan requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3183) thanks to @dependabot[bot] +- [3184: Update adriansuter/php-autoload-override requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/3184) thanks to @dependabot[bot] +- [3189: Update phpstan/phpstan requirement from ^1.5 to ^1.6](https://github.com/slimphp/Slim/pull/3189) thanks to @dependabot[bot] +- [3191: Adding property types to Middleware classes](https://github.com/slimphp/Slim/pull/3191) thanks to @ashleycoles +- [3193: Handlers types](https://github.com/slimphp/Slim/pull/3193) thanks to @ashleycoles +- [3194: Adding types to AbstractErrorRenderer](https://github.com/slimphp/Slim/pull/3194) thanks to @ashleycoles +- [3195: Adding prop types for Exception classes](https://github.com/slimphp/Slim/pull/3195) thanks to @ashleycoles +- [3196: Adding property type declarations for Factory classes](https://github.com/slimphp/Slim/pull/3196) thanks to @ashleycoles +- [3197: Remove redundant docblock types](https://github.com/slimphp/Slim/pull/3197) thanks to @theodorejb +- [3199: Update laminas/laminas-diactoros requirement from ^2.9 to ^2.11](https://github.com/slimphp/Slim/pull/3199) thanks to @dependabot[bot] +- [3200: Update phpstan/phpstan requirement from ^1.6 to ^1.7](https://github.com/slimphp/Slim/pull/3200) thanks to @dependabot[bot] +- [3205: Update guzzlehttp/psr7 requirement from ^2.2 to ^2.4](https://github.com/slimphp/Slim/pull/3205) thanks to @dependabot[bot] +- [3206: Update squizlabs/php_codesniffer requirement from ^3.6 to ^3.7](https://github.com/slimphp/Slim/pull/3206) thanks to @dependabot[bot] +- [3207: Update phpstan/phpstan requirement from ^1.7 to ^1.8](https://github.com/slimphp/Slim/pull/3207) thanks to @dependabot[bot] +- [3211: Assign null coalescing to coalesce equal](https://github.com/slimphp/Slim/pull/3211) thanks to @MathiasReker +- [3213: Void return](https://github.com/slimphp/Slim/pull/3213) thanks to @MathiasReker +- [3214: Is null](https://github.com/slimphp/Slim/pull/3214) thanks to @MathiasReker +- [3216: Refactor](https://github.com/slimphp/Slim/pull/3216) thanks to @mehdihasanpour +- [3218: Refactor some code](https://github.com/slimphp/Slim/pull/3218) thanks to @mehdihasanpour +- [3221: Cleanup](https://github.com/slimphp/Slim/pull/3221) thanks to @mehdihasanpour +- [3225: Update laminas/laminas-diactoros requirement from ^2.11 to ^2.14](https://github.com/slimphp/Slim/pull/3225) thanks to @dependabot[bot] +- [3228: Using assertSame to let assert equal be restricted](https://github.com/slimphp/Slim/pull/3228) thanks to @peter279k +- [3229: Update laminas/laminas-diactoros requirement from ^2.14 to ^2.17](https://github.com/slimphp/Slim/pull/3229) thanks to @dependabot[bot] +- [3235: Persist routes indexed by name in RouteCollector for improved performance.](https://github.com/slimphp/Slim/pull/3235) thanks to @BusterNeece + +# 4.10.0 - 2022-03-14 +- [3120: Add a new PSR-17 factory to Psr17FactoryProvider](https://github.com/slimphp/Slim/pull/3120) thanks to @solventt +- [3123: Replace deprecated setMethods() in tests](https://github.com/slimphp/Slim/pull/3123) thanks to @solventt +- [3126: Update guzzlehttp/psr7 requirement from ^2.0 to ^2.1](https://github.com/slimphp/Slim/pull/3126) thanks to @dependabot[bot] +- [3127: PHPStan v1.0](https://github.com/slimphp/Slim/pull/3127) thanks to @t0mmy742 +- [3128: Update phpstan/phpstan requirement from ^1.0 to ^1.2](https://github.com/slimphp/Slim/pull/3128) thanks to @dependabot[bot] +- [3129: Deprecate PHP 7.3](https://github.com/slimphp/Slim/pull/3129) thanks to @l0gicgate +- [3130: Removed double defined PHP 7.4](https://github.com/slimphp/Slim/pull/3130) thanks to @flangofas +- [3132: Add new `RequestResponseNamedArgs` route strategy](https://github.com/slimphp/Slim/pull/3132) thanks to @adoy +- [3133: Improve typehinting for `RouteParserInterface`](https://github.com/slimphp/Slim/pull/3133) thanks to @jerowork +- [3135: Update phpstan/phpstan requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/3135) thanks to @dependabot[bot] +- [3137: Update phpspec/prophecy requirement from ^1.14 to ^1.15](https://github.com/slimphp/Slim/pull/3137) thanks to @dependabot[bot] +- [3138: Update license year](https://github.com/slimphp/Slim/pull/3138) thanks to @Awilum +- [3139: Fixed #1730 (reintroduced in 4.x)](https://github.com/slimphp/Slim/pull/3139) thanks to @adoy +- [3145: Update phpstan/phpstan requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3145) thanks to @dependabot[bot] +- [3146: Inherit HttpException from RuntimeException](https://github.com/slimphp/Slim/pull/3146) thanks to @nbayramberdiyev +- [3148: Upgrade to HTML5](https://github.com/slimphp/Slim/pull/3148) thanks to @nbayramberdiyev +- [3172: Update nyholm/psr7 requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3172) thanks to @dependabot[bot] + +# 4.9.0 - 2021-10-05 +- [3058: Implement exception class for Gone Http error](https://github.com/slimphp/Slim/pull/3058) thanks to @TheKernelPanic +- [3086: Update slim/psr7 requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3086) thanks to @dependabot[bot] +- [3087: Update nyholm/psr7-server requirement from ^1.0.1 to ^1.0.2](https://github.com/slimphp/Slim/pull/3087) thanks to @dependabot[bot] +- [3093: Update phpstan/phpstan requirement from ^0.12.85 to ^0.12.90](https://github.com/slimphp/Slim/pull/3093) thanks to @dependabot[bot] +- [3099: Allow updated psr log](https://github.com/slimphp/Slim/pull/3099) thanks to @t0mmy742 +- [3104: Drop php7.2](https://github.com/slimphp/Slim/pull/3104) thanks to @t0mmy742 +- [3106: Use PSR-17 factory from Guzzle/psr7 2.0](https://github.com/slimphp/Slim/pull/3106) thanks to @t0mmy742 +- [3108: Update README file](https://github.com/slimphp/Slim/pull/3108) thanks to @t0mmy742 +- [3112: Update laminas/laminas-diactoros requirement from ^2.6 to ^2.8](https://github.com/slimphp/Slim/pull/3112) thanks to @dependabot[bot] +- [3114: Update slim/psr7 requirement from ^1.4 to ^1.5](https://github.com/slimphp/Slim/pull/3114) thanks to @dependabot[bot] +- [3115: Update phpstan/phpstan requirement from ^0.12.96 to ^0.12.99](https://github.com/slimphp/Slim/pull/3115) thanks to @dependabot[bot] +- [3116: Remove Zend Diactoros references](https://github.com/slimphp/Slim/pull/3116) thanks to @l0gicgate + +# 4.8.0 - 2021-05-19 +- [3034: Fix phpunit dependency version](https://github.com/slimphp/Slim/pull/3034) thanks to @l0gicgate +- [3037: Replace Travis by GitHub Actions](https://github.com/slimphp/Slim/pull/3037) thanks to @t0mmy742 +- [3043: Cover App creation from AppFactory with empty Container](https://github.com/slimphp/Slim/pull/3043) thanks to @t0mmy742 +- [3045: Update phpstan/phpstan requirement from ^0.12.58 to ^0.12.64](https://github.com/slimphp/Slim/pull/3045) thanks to @dependabot-preview[bot] +- [3047: documentation: min php 7.2 required](https://github.com/slimphp/Slim/pull/3047) thanks to @Rotzbua +- [3054: Update phpstan/phpstan requirement from ^0.12.64 to ^0.12.70](https://github.com/slimphp/Slim/pull/3054) thanks to @dependabot-preview[bot] +- [3056: Fix docblock in ErrorMiddleware](https://github.com/slimphp/Slim/pull/3056) thanks to @piotr-cz +- [3060: Update phpstan/phpstan requirement from ^0.12.70 to ^0.12.80](https://github.com/slimphp/Slim/pull/3060) thanks to @dependabot-preview[bot] +- [3061: Update nyholm/psr7 requirement from ^1.3 to ^1.4](https://github.com/slimphp/Slim/pull/3061) thanks to @dependabot-preview[bot] +- [3063: Allow ^1.0 || ^2.0 in psr/container](https://github.com/slimphp/Slim/pull/3063) thanks to @Ayesh +- [3069: Classname/Method Callable Arrays](https://github.com/slimphp/Slim/pull/3069) thanks to @ddrv +- [3078: Update squizlabs/php&#95;codesniffer requirement from ^3.5 to ^3.6](https://github.com/slimphp/Slim/pull/3078) thanks to @dependabot[bot] +- [3079: Update phpspec/prophecy requirement from ^1.12 to ^1.13](https://github.com/slimphp/Slim/pull/3079) thanks to @dependabot[bot] +- [3080: Update guzzlehttp/psr7 requirement from ^1.7 to ^1.8](https://github.com/slimphp/Slim/pull/3080) thanks to @dependabot[bot] +- [3082: Update phpstan/phpstan requirement from ^0.12.80 to ^0.12.85](https://github.com/slimphp/Slim/pull/3082) thanks to @dependabot[bot] + +# 4.7.0 - 2020-11-30 + +### Fixed +- [3027: Fix: FastRoute dispatcher and data generator should match](https://github.com/slimphp/Slim/pull/3027) thanks to @edudobay + +### Added +- [3015: PHP 8 support](https://github.com/slimphp/Slim/pull/3015) thanks to @edudobay + +### Optimizations +- [3024: Randomize tests](https://github.com/slimphp/Slim/pull/3024) thanks to @pawel-slowik + +## 4.6.0 - 2020-11-15 + +### Fixed +- [2942: Fix PHPdoc for error handlers in ErrorMiddleware ](https://github.com/slimphp/Slim/pull/2942) thanks to @TiMESPLiNTER +- [2944: Remove unused function in ErrorHandler](https://github.com/slimphp/Slim/pull/2944) thanks to @l0gicgate +- [2960: Fix phpstan 0.12 errors](https://github.com/slimphp/Slim/pull/2960) thanks to @adriansuter +- [2982: Removing cloning statements in tests](https://github.com/slimphp/Slim/pull/2982) thanks to @l0gicgate +- [3017: Fix request creator factory test](https://github.com/slimphp/Slim/pull/3017) thanks to @pawel-slowik +- [3022: Ensure RouteParser Always Present After Routing](https://github.com/slimphp/Slim/pull/3022) thanks to @l0gicgate + +### Added +- [2949: Add the support in composer.json](https://github.com/slimphp/Slim/pull/2949) thanks to @ddrv +- [2958: Strict empty string content type checking in BodyParsingMiddleware::getMediaType](https://github.com/slimphp/Slim/pull/2958) thanks to @Ayesh +- [2997: Add hints to methods](https://github.com/slimphp/Slim/pull/2997) thanks to @evgsavosin - [3000: Fix route controller test](https://github.com/slimphp/Slim/pull/3000) thanks to @pawel-slowik +- [3001: Add missing `$strategy` parameter in a Route test](https://github.com/slimphp/Slim/pull/3001) thanks to @pawel-slowik + +### Optimizations +- [2951: Minor optimizations in if() blocks](https://github.com/slimphp/Slim/pull/2951) thanks to @Ayesh +- [2959: Micro optimization: Declare closures in BodyParsingMiddleware as static](https://github.com/slimphp/Slim/pull/2959) thanks to @Ayesh +- [2978: Split the routing results to its own function.](https://github.com/slimphp/Slim/pull/2978) thanks to @dlundgren + +### Dependencies Updated +- [2953: Update nyholm/psr7-server requirement from ^0.4.1](https://github.com/slimphp/Slim/pull/2953) thanks to @dependabot-preview[bot] +- [2954: Update laminas/laminas-diactoros requirement from ^2.1 to ^2.3](https://github.com/slimphp/Slim/pull/2954) thanks to @dependabot-preview[bot] +- [2955: Update guzzlehttp/psr7 requirement from ^1.5 to ^1.6](https://github.com/slimphp/Slim/pull/2955) thanks to @dependabot-preview[bot] +- [2956: Update slim/psr7 requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/2956) thanks to @dependabot-preview[bot] +- [2957: Update nyholm/psr7 requirement from ^1.1 to ^1.2](https://github.com/slimphp/Slim/pull/2957) thanks to @dependabot-preview[bot] +- [2963: Update phpstan/phpstan requirement from ^0.12.23 to ^0.12.25](https://github.com/slimphp/Slim/pull/2963) thanks to @dependabot-preview[bot] +- [2965: Update adriansuter/php-autoload-override requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/2965) thanks to @dependabot-preview[bot] +- [2967: Update nyholm/psr7 requirement from ^1.2 to ^1.3](https://github.com/slimphp/Slim/pull/2967) thanks to @dependabot-preview[bot] +- [2969: Update nyholm/psr7-server requirement from ^0.4.1 to ^1.0.0](https://github.com/slimphp/Slim/pull/2969) thanks to @dependabot-preview[bot] +- [2970: Update phpstan/phpstan requirement from ^0.12.25 to ^0.12.26](https://github.com/slimphp/Slim/pull/2970) thanks to @dependabot-preview[bot] +- [2971: Update phpstan/phpstan requirement from ^0.12.26 to ^0.12.27](https://github.com/slimphp/Slim/pull/2971) thanks to @dependabot-preview[bot] +- [2972: Update phpstan/phpstan requirement from ^0.12.27 to ^0.12.28](https://github.com/slimphp/Slim/pull/2972) thanks to @dependabot-preview[bot] +- [2973: Update phpstan/phpstan requirement from ^0.12.28 to ^0.12.29](https://github.com/slimphp/Slim/pull/2973) thanks to @dependabot-preview[bot] +- [2975: Update phpstan/phpstan requirement from ^0.12.29 to ^0.12.30](https://github.com/slimphp/Slim/pull/2975) thanks to @dependabot-preview[bot] +- [2976: Update phpstan/phpstan requirement from ^0.12.30 to ^0.12.31](https://github.com/slimphp/Slim/pull/2976) thanks to @dependabot-preview[bot] +- [2980: Update phpstan/phpstan requirement from ^0.12.31 to ^0.12.32](https://github.com/slimphp/Slim/pull/2980) thanks to @dependabot-preview[bot] +- [2981: Update phpspec/prophecy requirement from ^1.10 to ^1.11](https://github.com/slimphp/Slim/pull/2981) thanks to @dependabot-preview[bot] +- [2986: Update phpstan/phpstan requirement from ^0.12.32 to ^0.12.33](https://github.com/slimphp/Slim/pull/2986) thanks to @dependabot-preview[bot] +- [2990: Update phpstan/phpstan requirement from ^0.12.33 to ^0.12.34](https://github.com/slimphp/Slim/pull/2990) thanks to @dependabot-preview[bot] +- [2991: Update phpstan/phpstan requirement from ^0.12.34 to ^0.12.35](https://github.com/slimphp/Slim/pull/2991) thanks to @dependabot-preview[bot] +- [2993: Update phpstan/phpstan requirement from ^0.12.35 to ^0.12.36](https://github.com/slimphp/Slim/pull/2993) thanks to @dependabot-preview[bot] +- [2995: Update phpstan/phpstan requirement from ^0.12.36 to ^0.12.37](https://github.com/slimphp/Slim/pull/2995) thanks to @dependabot-preview[bot] +- [3010: Update guzzlehttp/psr7 requirement from ^1.6 to ^1.7](https://github.com/slimphp/Slim/pull/3010) thanks to @dependabot-preview[bot] +- [3011: Update phpspec/prophecy requirement from ^1.11 to ^1.12](https://github.com/slimphp/Slim/pull/3011) thanks to @dependabot-preview[bot] +- [3012: Update slim/http requirement from ^1.0 to ^1.1](https://github.com/slimphp/Slim/pull/3012) thanks to @dependabot-preview[bot] +- [3013: Update slim/psr7 requirement from ^1.1 to ^1.2](https://github.com/slimphp/Slim/pull/3013) thanks to @dependabot-preview[bot] +- [3014: Update laminas/laminas-diactoros requirement from ^2.3 to ^2.4](https://github.com/slimphp/Slim/pull/3014) thanks to @dependabot-preview[bot] +- [3018: Update phpstan/phpstan requirement from ^0.12.37 to ^0.12.54](https://github.com/slimphp/Slim/pull/3018) thanks to @dependabot-preview[bot] + ## 4.5.0 - 2020-04-14 ### Added diff --git a/vendor/slim/slim/LICENSE.md b/vendor/slim/slim/LICENSE.md index 682c21dc7a..d6fd559c78 100644 --- a/vendor/slim/slim/LICENSE.md +++ b/vendor/slim/slim/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2011-2017 Josh Lockhart +Copyright (c) 2011-2022 Josh Lockhart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/slim/slim/SECURITY.md b/vendor/slim/slim/SECURITY.md new file mode 100644 index 0000000000..a5b6df0b4c --- /dev/null +++ b/vendor/slim/slim/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +### Supported Versions + + +| Version | Supported | +| ------- | ------------------ | +| 3.x.x | :white_check_mark: | +| 4.x.x | :white_check_mark: | + + +### Reporting a Vulnerability + +To report a vulnerability please send an email to security@slimframework.com diff --git a/vendor/slim/slim/Slim/App.php b/vendor/slim/slim/Slim/App.php index 7f3e166cae..68b900023f 100644 --- a/vendor/slim/slim/Slim/App.php +++ b/vendor/slim/slim/Slim/App.php @@ -31,6 +31,11 @@ use function strtoupper; +/** + * @api + * @template TContainerInterface of (ContainerInterface|null) + * @template-extends RouteCollectorProxy<TContainerInterface> + */ class App extends RouteCollectorProxy implements RequestHandlerInterface { /** @@ -38,25 +43,14 @@ class App extends RouteCollectorProxy implements RequestHandlerInterface * * @var string */ - public const VERSION = '4.5.0'; + public const VERSION = '4.12.0'; - /** - * @var RouteResolverInterface - */ - protected $routeResolver; + protected RouteResolverInterface $routeResolver; - /** - * @var MiddlewareDispatcherInterface - */ - protected $middlewareDispatcher; + protected MiddlewareDispatcherInterface $middlewareDispatcher; /** - * @param ResponseFactoryInterface $responseFactory - * @param ContainerInterface|null $container - * @param CallableResolverInterface|null $callableResolver - * @param RouteCollectorInterface|null $routeCollector - * @param RouteResolverInterface|null $routeResolver - * @param MiddlewareDispatcherInterface|null $middlewareDispatcher + * @param TContainerInterface $container */ public function __construct( ResponseFactoryInterface $responseFactory, @@ -103,7 +97,7 @@ public function getMiddlewareDispatcher(): MiddlewareDispatcherInterface /** * @param MiddlewareInterface|string|callable $middleware - * @return self + * @return App<TContainerInterface> */ public function add($middleware): self { @@ -113,7 +107,7 @@ public function add($middleware): self /** * @param MiddlewareInterface $middleware - * @return self + * @return App<TContainerInterface> */ public function addMiddleware(MiddlewareInterface $middleware): self { diff --git a/vendor/slim/slim/Slim/CallableResolver.php b/vendor/slim/slim/Slim/CallableResolver.php index 91a1285cf2..dab46c4604 100644 --- a/vendor/slim/slim/Slim/CallableResolver.php +++ b/vendor/slim/slim/Slim/CallableResolver.php @@ -26,20 +26,18 @@ use function preg_match; use function sprintf; +/** + * @template TContainerInterface of (ContainerInterface|null) + */ final class CallableResolver implements AdvancedCallableResolverInterface { - /** - * @var string - */ - public static $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; + public static string $callablePattern = '!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!'; - /** - * @var ContainerInterface|null - */ - private $container; + /** @var TContainerInterface $container */ + private ?ContainerInterface $container; /** - * @param ContainerInterface|null $container + * @param TContainerInterface $container */ public function __construct(?ContainerInterface $container = null) { @@ -51,13 +49,14 @@ public function __construct(?ContainerInterface $container = null) */ public function resolve($toResolve): callable { + $toResolve = $this->prepareToResolve($toResolve); if (is_callable($toResolve)) { return $this->bindToContainer($toResolve); } $resolved = $toResolve; if (is_string($toResolve)) { $resolved = $this->resolveSlimNotation($toResolve); - $resolved[1] = $resolved[1] ?? '__invoke'; + $resolved[1] ??= '__invoke'; } $callable = $this->assertCallable($resolved, $toResolve); return $this->bindToContainer($callable); @@ -81,15 +80,12 @@ public function resolveMiddleware($toResolve): callable /** * @param string|callable $toResolve - * @param callable $predicate - * @param string $defaultMethod * * @throws RuntimeException - * - * @return callable */ private function resolveByPredicate($toResolve, callable $predicate, string $defaultMethod): callable { + $toResolve = $this->prepareToResolve($toResolve); if (is_callable($toResolve)) { return $this->bindToContainer($toResolve); } @@ -99,7 +95,7 @@ private function resolveByPredicate($toResolve, callable $predicate, string $def } if (is_string($toResolve)) { [$instance, $method] = $this->resolveSlimNotation($toResolve); - if ($predicate($instance) && $method === null) { + if ($method === null && $predicate($instance)) { $method = $defaultMethod; } $resolved = [$instance, $method ?? '__invoke']; @@ -110,8 +106,6 @@ private function resolveByPredicate($toResolve, callable $predicate, string $def /** * @param mixed $toResolve - * - * @return bool */ private function isRoute($toResolve): bool { @@ -120,8 +114,6 @@ private function isRoute($toResolve): bool /** * @param mixed $toResolve - * - * @return bool */ private function isMiddleware($toResolve): bool { @@ -129,21 +121,26 @@ private function isMiddleware($toResolve): bool } /** - * @param string $toResolve - * * @throws RuntimeException * - * @return array [Instance, Method Name] + * @return array{object, string|null} [Instance, Method Name] */ private function resolveSlimNotation(string $toResolve): array { + /** @psalm-suppress ArgumentTypeCoercion */ preg_match(CallableResolver::$callablePattern, $toResolve, $matches); [$class, $method] = $matches ? [$matches[1], $matches[2]] : [$toResolve, null]; if ($this->container && $this->container->has($class)) { $instance = $this->container->get($class); + if (!is_object($instance)) { + throw new RuntimeException(sprintf('%s container entry is not an object', $class)); + } } else { if (!class_exists($class)) { + if ($method) { + $class .= '::' . $method . '()'; + } throw new RuntimeException(sprintf('Callable %s does not exist', $class)); } $instance = new $class($this->container); @@ -156,34 +153,47 @@ private function resolveSlimNotation(string $toResolve): array * @param mixed $toResolve * * @throws RuntimeException - * - * @return callable */ private function assertCallable($resolved, $toResolve): callable { if (!is_callable($resolved)) { - throw new RuntimeException(sprintf( - '%s is not resolvable', - is_callable($toResolve) || is_object($toResolve) || is_array($toResolve) ? - json_encode($toResolve) : $toResolve - )); + if (is_callable($toResolve) || is_object($toResolve) || is_array($toResolve)) { + $formatedToResolve = ($toResolveJson = json_encode($toResolve)) !== false ? $toResolveJson : ''; + } else { + $formatedToResolve = is_string($toResolve) ? $toResolve : ''; + } + throw new RuntimeException(sprintf('%s is not resolvable', $formatedToResolve)); } return $resolved; } - /** - * @param callable $callable - * - * @return callable - */ private function bindToContainer(callable $callable): callable { if (is_array($callable) && $callable[0] instanceof Closure) { $callable = $callable[0]; } if ($this->container && $callable instanceof Closure) { + /** @var Closure $callable */ $callable = $callable->bindTo($this->container); } return $callable; } + + /** + * @param string|callable $toResolve + * @return string|callable + */ + private function prepareToResolve($toResolve) + { + if (!is_array($toResolve)) { + return $toResolve; + } + $candidate = $toResolve; + $class = array_shift($candidate); + $method = array_shift($candidate); + if (is_string($class) && is_string($method)) { + return $class . ':' . $method; + } + return $toResolve; + } } diff --git a/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php b/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php index 1f608306ba..90b290d410 100644 --- a/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php +++ b/vendor/slim/slim/Slim/Error/AbstractErrorRenderer.php @@ -22,15 +22,9 @@ */ abstract class AbstractErrorRenderer implements ErrorRendererInterface { - /** - * @var string - */ - protected $defaultErrorTitle = 'Slim Application Error'; - - /** - * @var string - */ - protected $defaultErrorDescription = 'A website error has occurred. Sorry for the temporary inconvenience.'; + protected string $defaultErrorTitle = 'Slim Application Error'; + + protected string $defaultErrorDescription = 'A website error has occurred. Sorry for the temporary inconvenience.'; protected function getErrorTitle(Throwable $exception): string { diff --git a/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php b/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php index 971a06b827..8fd838bcb4 100644 --- a/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php +++ b/vendor/slim/slim/Slim/Error/Renderers/HtmlErrorRenderer.php @@ -22,11 +22,6 @@ */ class HtmlErrorRenderer extends AbstractErrorRenderer { - /** - * @param Throwable $exception - * @param bool $displayErrorDetails - * @return string - */ public function __invoke(Throwable $exception, bool $displayErrorDetails): string { if ($displayErrorDetails) { @@ -40,66 +35,45 @@ public function __invoke(Throwable $exception, bool $displayErrorDetails): strin return $this->renderHtmlBody($this->getErrorTitle($exception), $html); } - /** - * @param Throwable $exception - * @return string - */ private function renderExceptionFragment(Throwable $exception): string { $html = sprintf('<div><strong>Type:</strong> %s</div>', get_class($exception)); $code = $exception->getCode(); - if ($code !== null) { - $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code); - } + $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code); - $message = $exception->getMessage(); - if ($message !== null) { - $html .= sprintf('<div><strong>Message:</strong> %s</div>', htmlentities($message)); - } + $html .= sprintf('<div><strong>Message:</strong> %s</div>', htmlentities($exception->getMessage())); - $file = $exception->getFile(); - if ($file !== null) { - $html .= sprintf('<div><strong>File:</strong> %s</div>', $file); - } + $html .= sprintf('<div><strong>File:</strong> %s</div>', $exception->getFile()); - $line = $exception->getLine(); - if ($line !== null) { - $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line); - } + $html .= sprintf('<div><strong>Line:</strong> %s</div>', $exception->getLine()); - $trace = $exception->getTraceAsString(); - if ($trace !== null) { - $html .= '<h2>Trace</h2>'; - $html .= sprintf('<pre>%s</pre>', htmlentities($trace)); - } + $html .= '<h2>Trace</h2>'; + $html .= sprintf('<pre>%s</pre>', htmlentities($exception->getTraceAsString())); return $html; } - /** - * @param string $title - * @param string $html - * @return string - */ public function renderHtmlBody(string $title = '', string $html = ''): string { return sprintf( - '<html>' . - ' <head>' . - " <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" . - ' <title>%s</title>' . - ' <style>' . - ' body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif}' . - ' h1{margin:0;font-size:48px;font-weight:normal;line-height:48px}' . - ' strong{display:inline-block;width:65px}' . - ' </style>' . - ' </head>' . - ' <body>' . - ' <h1>%s</h1>' . - ' <div>%s</div>' . - ' <a href="#" onClick="window.history.go(-1)">Go Back</a>' . - ' </body>' . + '<!doctype html>' . + '<html lang="en">' . + ' <head>' . + ' <meta charset="utf-8">' . + ' <meta name="viewport" content="width=device-width, initial-scale=1">' . + ' <title>%s</title>' . + ' <style>' . + ' body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif}' . + ' h1{margin:0;font-size:48px;font-weight:normal;line-height:48px}' . + ' strong{display:inline-block;width:65px}' . + ' </style>' . + ' </head>' . + ' <body>' . + ' <h1>%s</h1>' . + ' <div>%s</div>' . + ' <a href="#" onclick="window.history.go(-1)">Go Back</a>' . + ' </body>' . '</html>', $title, $title, diff --git a/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php b/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php index 5ceb359211..06085d2e50 100644 --- a/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php +++ b/vendor/slim/slim/Slim/Error/Renderers/JsonErrorRenderer.php @@ -24,11 +24,6 @@ */ class JsonErrorRenderer extends AbstractErrorRenderer { - /** - * @param Throwable $exception - * @param bool $displayErrorDetails - * @return string - */ public function __invoke(Throwable $exception, bool $displayErrorDetails): string { $error = ['message' => $this->getErrorTitle($exception)]; @@ -44,14 +39,14 @@ public function __invoke(Throwable $exception, bool $displayErrorDetails): strin } /** - * @param Throwable $exception - * @return array + * @return array<string|int> */ private function formatExceptionFragment(Throwable $exception): array { + $code = $exception->getCode(); return [ 'type' => get_class($exception), - 'code' => $exception->getCode(), + 'code' => $code, 'message' => $exception->getMessage(), 'file' => $exception->getFile(), 'line' => $exception->getLine(), diff --git a/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php b/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php index 0b961cd37a..fcb6e8a157 100644 --- a/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php +++ b/vendor/slim/slim/Slim/Error/Renderers/PlainTextErrorRenderer.php @@ -22,11 +22,6 @@ */ class PlainTextErrorRenderer extends AbstractErrorRenderer { - /** - * @param Throwable $exception - * @param bool $displayErrorDetails - * @return string - */ public function __invoke(Throwable $exception, bool $displayErrorDetails): string { $text = "{$this->getErrorTitle($exception)}\n"; @@ -43,38 +38,21 @@ public function __invoke(Throwable $exception, bool $displayErrorDetails): strin return $text; } - /** - * @param Throwable $exception - * @return string - */ private function formatExceptionFragment(Throwable $exception): string { $text = sprintf("Type: %s\n", get_class($exception)); $code = $exception->getCode(); - if ($code !== null) { - $text .= sprintf("Code: %s\n", $code); - } - $message = $exception->getMessage(); - if ($message !== null) { - $text .= sprintf("Message: %s\n", htmlentities($message)); - } + $text .= sprintf("Code: %s\n", $code); - $file = $exception->getFile(); - if ($file !== null) { - $text .= sprintf("File: %s\n", $file); - } + $text .= sprintf("Message: %s\n", $exception->getMessage()); - $line = $exception->getLine(); - if ($line !== null) { - $text .= sprintf("Line: %s\n", $line); - } + $text .= sprintf("File: %s\n", $exception->getFile()); - $trace = $exception->getTraceAsString(); - if ($trace !== null) { - $text .= sprintf('Trace: %s', $trace); - } + $text .= sprintf("Line: %s\n", $exception->getLine()); + + $text .= sprintf('Trace: %s', $exception->getTraceAsString()); return $text; } diff --git a/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php b/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php index 80cd8f93aa..1171b79b2d 100644 --- a/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php +++ b/vendor/slim/slim/Slim/Error/Renderers/XmlErrorRenderer.php @@ -22,11 +22,6 @@ */ class XmlErrorRenderer extends AbstractErrorRenderer { - /** - * @param Throwable $exception - * @param bool $displayErrorDetails - * @return string - */ public function __invoke(Throwable $exception, bool $displayErrorDetails): string { $xml = '<' . '?xml version="1.0" encoding="UTF-8" standalone="yes"?' . ">\n"; @@ -51,9 +46,6 @@ public function __invoke(Throwable $exception, bool $displayErrorDetails): strin /** * Returns a CDATA section with the given content. - * - * @param string $content - * @return string */ private function createCdataSection(string $content): string { diff --git a/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php b/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php index a9b6f50c59..000c2480a2 100644 --- a/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php +++ b/vendor/slim/slim/Slim/Exception/HttpBadRequestException.php @@ -10,10 +10,20 @@ namespace Slim\Exception; +/** @api */ class HttpBadRequestException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 400; + + /** + * @var string + */ protected $message = 'Bad request.'; - protected $title = '400 Bad Request'; - protected $description = 'The server cannot or will not process the request due to an apparent client error.'; + + protected string $title = '400 Bad Request'; + protected string $description = 'The server cannot or will not process ' . + 'the request due to an apparent client error.'; } diff --git a/vendor/slim/slim/Slim/Exception/HttpException.php b/vendor/slim/slim/Slim/Exception/HttpException.php index 1fbbb4ac61..c714dbbe55 100644 --- a/vendor/slim/slim/Slim/Exception/HttpException.php +++ b/vendor/slim/slim/Slim/Exception/HttpException.php @@ -10,33 +10,22 @@ namespace Slim\Exception; -use Exception; use Psr\Http\Message\ServerRequestInterface; +use RuntimeException; use Throwable; -class HttpException extends Exception +/** + * @api + * @method int getCode() + */ +class HttpException extends RuntimeException { - /** - * @var ServerRequestInterface - */ - protected $request; + protected ServerRequestInterface $request; - /** - * @var string - */ - protected $title = ''; + protected string $title = ''; - /** - * @var string - */ - protected $description = ''; + protected string $description = ''; - /** - * @param ServerRequestInterface $request - * @param string $message - * @param int $code - * @param Throwable|null $previous - */ public function __construct( ServerRequestInterface $request, string $message = '', @@ -47,44 +36,27 @@ public function __construct( $this->request = $request; } - /** - * @return ServerRequestInterface - */ public function getRequest(): ServerRequestInterface { return $this->request; } - /** - * @return string - */ public function getTitle(): string { return $this->title; } - /** - * @param string $title - * @return self - */ public function setTitle(string $title): self { $this->title = $title; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->description; } - /** - * @param string $description - * @return self - */ public function setDescription(string $description): self { $this->description = $description; diff --git a/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php b/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php index 9a9141e34d..d262a63f62 100644 --- a/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php +++ b/vendor/slim/slim/Slim/Exception/HttpForbiddenException.php @@ -10,10 +10,19 @@ namespace Slim\Exception; +/** @api */ class HttpForbiddenException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 403; + + /** + * @var string + */ protected $message = 'Forbidden.'; - protected $title = '403 Forbidden'; - protected $description = 'You are not permitted to perform the requested operation.'; + + protected string $title = '403 Forbidden'; + protected string $description = 'You are not permitted to perform the requested operation.'; } diff --git a/vendor/slim/slim/Slim/Exception/HttpGoneException.php b/vendor/slim/slim/Slim/Exception/HttpGoneException.php new file mode 100644 index 0000000000..b1005d83e2 --- /dev/null +++ b/vendor/slim/slim/Slim/Exception/HttpGoneException.php @@ -0,0 +1,28 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Exception; + +/** @api */ +class HttpGoneException extends HttpSpecializedException +{ + /** + * @var int + */ + protected $code = 410; + + /** + * @var string + */ + protected $message = 'Gone.'; + + protected string $title = '410 Gone'; + protected string $description = 'The target resource is no longer available at the origin server.'; +} diff --git a/vendor/slim/slim/Slim/Exception/HttpInternalServerErrorException.php b/vendor/slim/slim/Slim/Exception/HttpInternalServerErrorException.php index ae6b5f3f43..f9cb60f7b3 100644 --- a/vendor/slim/slim/Slim/Exception/HttpInternalServerErrorException.php +++ b/vendor/slim/slim/Slim/Exception/HttpInternalServerErrorException.php @@ -10,10 +10,19 @@ namespace Slim\Exception; +/** @api */ class HttpInternalServerErrorException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 500; + + /** + * @var string + */ protected $message = 'Internal server error.'; - protected $title = '500 Internal Server Error'; - protected $description = 'Unexpected condition encountered preventing server from fulfilling request.'; + + protected string $title = '500 Internal Server Error'; + protected string $description = 'Unexpected condition encountered preventing server from fulfilling request.'; } diff --git a/vendor/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php b/vendor/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php index d6f8703c86..30aaaa743d 100644 --- a/vendor/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php +++ b/vendor/slim/slim/Slim/Exception/HttpMethodNotAllowedException.php @@ -15,17 +15,25 @@ class HttpMethodNotAllowedException extends HttpSpecializedException { /** - * @var array + * @var string[] */ - protected $allowedMethods = []; + protected array $allowedMethods = []; + /** + * @var int + */ protected $code = 405; + + /** + * @var string + */ protected $message = 'Method not allowed.'; - protected $title = '405 Method Not Allowed'; - protected $description = 'The request method is not supported for the requested resource.'; + + protected string $title = '405 Method Not Allowed'; + protected string $description = 'The request method is not supported for the requested resource.'; /** - * @return array + * @return string[] */ public function getAllowedMethods(): array { @@ -33,10 +41,9 @@ public function getAllowedMethods(): array } /** - * @param array $methods - * @return self + * @param string[] $methods */ - public function setAllowedMethods(array $methods): HttpMethodNotAllowedException + public function setAllowedMethods(array $methods): self { $this->allowedMethods = $methods; $this->message = 'Method not allowed. Must be one of: ' . implode(', ', $methods); diff --git a/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php b/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php index c4b7c9d30c..865146d68f 100644 --- a/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php +++ b/vendor/slim/slim/Slim/Exception/HttpNotFoundException.php @@ -12,8 +12,16 @@ class HttpNotFoundException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 404; + + /** + * @var string + */ protected $message = 'Not found.'; - protected $title = '404 Not Found'; - protected $description = 'The requested resource could not be found. Please verify the URI and try again.'; + + protected string $title = '404 Not Found'; + protected string $description = 'The requested resource could not be found. Please verify the URI and try again.'; } diff --git a/vendor/slim/slim/Slim/Exception/HttpNotImplementedException.php b/vendor/slim/slim/Slim/Exception/HttpNotImplementedException.php index f8dcb3fb4c..af4fe253d3 100644 --- a/vendor/slim/slim/Slim/Exception/HttpNotImplementedException.php +++ b/vendor/slim/slim/Slim/Exception/HttpNotImplementedException.php @@ -10,10 +10,19 @@ namespace Slim\Exception; +/** @api */ class HttpNotImplementedException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 501; + + /** + * @var string + */ protected $message = 'Not implemented.'; - protected $title = '501 Not Implemented'; - protected $description = 'The server does not support the functionality required to fulfill the request.'; + + protected string $title = '501 Not Implemented'; + protected string $description = 'The server does not support the functionality required to fulfill the request.'; } diff --git a/vendor/slim/slim/Slim/Exception/HttpTooManyRequestsException.php b/vendor/slim/slim/Slim/Exception/HttpTooManyRequestsException.php new file mode 100644 index 0000000000..af438bad4e --- /dev/null +++ b/vendor/slim/slim/Slim/Exception/HttpTooManyRequestsException.php @@ -0,0 +1,29 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Exception; + +/** @api */ +class HttpTooManyRequestsException extends HttpSpecializedException +{ + /** + * @var int + */ + protected $code = 429; + + /** + * @var string + */ + protected $message = 'Too many requests.'; + + protected string $title = '429 Too Many Requests'; + protected string $description = 'The client application has surpassed its rate limit, ' . + 'or number of requests they can send in a given period of time.'; +} diff --git a/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php b/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php index 5f143fe5df..afb0e54077 100644 --- a/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php +++ b/vendor/slim/slim/Slim/Exception/HttpUnauthorizedException.php @@ -10,10 +10,19 @@ namespace Slim\Exception; +/** @api */ class HttpUnauthorizedException extends HttpSpecializedException { + /** + * @var int + */ protected $code = 401; + + /** + * @var string + */ protected $message = 'Unauthorized.'; - protected $title = '401 Unauthorized'; - protected $description = 'The request requires valid user authentication.'; + + protected string $title = '401 Unauthorized'; + protected string $description = 'The request requires valid user authentication.'; } diff --git a/vendor/slim/slim/Slim/Factory/AppFactory.php b/vendor/slim/slim/Slim/Factory/AppFactory.php index 17bea3916c..be91e88e9c 100644 --- a/vendor/slim/slim/Slim/Factory/AppFactory.php +++ b/vendor/slim/slim/Slim/Factory/AppFactory.php @@ -24,61 +24,31 @@ use Slim\Interfaces\RouteCollectorInterface; use Slim\Interfaces\RouteResolverInterface; +/** @api */ class AppFactory { - /** - * @var Psr17FactoryProviderInterface|null - */ - protected static $psr17FactoryProvider; + protected static ?Psr17FactoryProviderInterface $psr17FactoryProvider = null; - /** - * @var ResponseFactoryInterface|null - */ - protected static $responseFactory; + protected static ?ResponseFactoryInterface $responseFactory = null; - /** - * @var StreamFactoryInterface|null - */ - protected static $streamFactory; + protected static ?StreamFactoryInterface $streamFactory = null; - /** - * @var ContainerInterface|null - */ - protected static $container; + protected static ?ContainerInterface $container = null; - /** - * @var CallableResolverInterface|null - */ - protected static $callableResolver; + protected static ?CallableResolverInterface $callableResolver = null; - /** - * @var RouteCollectorInterface|null - */ - protected static $routeCollector; + protected static ?RouteCollectorInterface $routeCollector = null; - /** - * @var RouteResolverInterface|null - */ - protected static $routeResolver; + protected static ?RouteResolverInterface $routeResolver = null; - /** - * @var MiddlewareDispatcherInterface|null - */ - protected static $middlewareDispatcher; + protected static ?MiddlewareDispatcherInterface $middlewareDispatcher = null; - /** - * @var bool - */ - protected static $slimHttpDecoratorsAutomaticDetectionEnabled = true; + protected static bool $slimHttpDecoratorsAutomaticDetectionEnabled = true; /** - * @param ResponseFactoryInterface|null $responseFactory - * @param ContainerInterface|null $container - * @param CallableResolverInterface|null $callableResolver - * @param RouteCollectorInterface|null $routeCollector - * @param RouteResolverInterface|null $routeResolver - * @param MiddlewareDispatcherInterface|null $middlewareDispatcher - * @return App + * @template TContainerInterface of (ContainerInterface|null) + * @param TContainerInterface $container + * @return (TContainerInterface is ContainerInterface ? App<TContainerInterface> : App<ContainerInterface|null>) */ public static function create( ?ResponseFactoryInterface $responseFactory = null, @@ -100,29 +70,45 @@ public static function create( } /** - * @param ContainerInterface $container - * @return App + * @template TContainerInterface of (ContainerInterface) + * @param TContainerInterface $container + * @return App<TContainerInterface> */ public static function createFromContainer(ContainerInterface $container): App { $responseFactory = $container->has(ResponseFactoryInterface::class) - ? $container->get(ResponseFactoryInterface::class) + && ( + $responseFactoryFromContainer = $container->get(ResponseFactoryInterface::class) + ) instanceof ResponseFactoryInterface + ? $responseFactoryFromContainer : self::determineResponseFactory(); $callableResolver = $container->has(CallableResolverInterface::class) - ? $container->get(CallableResolverInterface::class) + && ( + $callableResolverFromContainer = $container->get(CallableResolverInterface::class) + ) instanceof CallableResolverInterface + ? $callableResolverFromContainer : null; $routeCollector = $container->has(RouteCollectorInterface::class) - ? $container->get(RouteCollectorInterface::class) + && ( + $routeCollectorFromContainer = $container->get(RouteCollectorInterface::class) + ) instanceof RouteCollectorInterface + ? $routeCollectorFromContainer : null; $routeResolver = $container->has(RouteResolverInterface::class) - ? $container->get(RouteResolverInterface::class) + && ( + $routeResolverFromContainer = $container->get(RouteResolverInterface::class) + ) instanceof RouteResolverInterface + ? $routeResolverFromContainer : null; $middlewareDispatcher = $container->has(MiddlewareDispatcherInterface::class) - ? $container->get(MiddlewareDispatcherInterface::class) + && ( + $middlewareDispatcherFromContainer = $container->get(MiddlewareDispatcherInterface::class) + ) instanceof MiddlewareDispatcherInterface + ? $middlewareDispatcherFromContainer : null; return new App( @@ -136,7 +122,6 @@ public static function createFromContainer(ContainerInterface $container): App } /** - * @return ResponseFactoryInterface * @throws RuntimeException */ public static function determineResponseFactory(): ResponseFactoryInterface @@ -155,7 +140,7 @@ public static function determineResponseFactory(): ResponseFactoryInterface if ($psr17factory::isResponseFactoryAvailable()) { $responseFactory = $psr17factory::getResponseFactory(); - if ($psr17factory::isStreamFactoryAvailable() || static::$streamFactory) { + if (static::$streamFactory || $psr17factory::isStreamFactoryAvailable()) { $streamFactory = static::$streamFactory ?? $psr17factory::getStreamFactory(); return static::attemptResponseFactoryDecoration($responseFactory, $streamFactory); } @@ -171,11 +156,6 @@ public static function determineResponseFactory(): ResponseFactoryInterface ); } - /** - * @param ResponseFactoryInterface $responseFactory - * @param StreamFactoryInterface $streamFactory - * @return ResponseFactoryInterface - */ protected static function attemptResponseFactoryDecoration( ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory @@ -190,73 +170,46 @@ protected static function attemptResponseFactoryDecoration( return $responseFactory; } - /** - * @param Psr17FactoryProviderInterface $psr17FactoryProvider - */ public static function setPsr17FactoryProvider(Psr17FactoryProviderInterface $psr17FactoryProvider): void { static::$psr17FactoryProvider = $psr17FactoryProvider; } - /** - * @param ResponseFactoryInterface $responseFactory - */ public static function setResponseFactory(ResponseFactoryInterface $responseFactory): void { static::$responseFactory = $responseFactory; } - /** - * @param StreamFactoryInterface $streamFactory - */ public static function setStreamFactory(StreamFactoryInterface $streamFactory): void { static::$streamFactory = $streamFactory; } - /** - * @param ContainerInterface $container - */ public static function setContainer(ContainerInterface $container): void { static::$container = $container; } - /** - * @param CallableResolverInterface $callableResolver - */ public static function setCallableResolver(CallableResolverInterface $callableResolver): void { static::$callableResolver = $callableResolver; } - /** - * @param RouteCollectorInterface $routeCollector - */ public static function setRouteCollector(RouteCollectorInterface $routeCollector): void { static::$routeCollector = $routeCollector; } - /** - * @param RouteResolverInterface $routeResolver - */ public static function setRouteResolver(RouteResolverInterface $routeResolver): void { static::$routeResolver = $routeResolver; } - /** - * @param MiddlewareDispatcherInterface $middlewareDispatcher - */ public static function setMiddlewareDispatcher(MiddlewareDispatcherInterface $middlewareDispatcher): void { static::$middlewareDispatcher = $middlewareDispatcher; } - /** - * @param bool $enabled - */ public static function setSlimHttpDecoratorsAutomaticDetection(bool $enabled): void { static::$slimHttpDecoratorsAutomaticDetectionEnabled = $enabled; diff --git a/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php index 8ac770291a..32a548a672 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/GuzzlePsr17Factory.php @@ -12,8 +12,8 @@ class GuzzlePsr17Factory extends Psr17Factory { - protected static $responseFactoryClass = 'Http\Factory\Guzzle\ResponseFactory'; - protected static $streamFactoryClass = 'Http\Factory\Guzzle\StreamFactory'; - protected static $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest'; - protected static $serverRequestCreatorMethod = 'fromGlobals'; + protected static string $responseFactoryClass = 'GuzzleHttp\Psr7\HttpFactory'; + protected static string $streamFactoryClass = 'GuzzleHttp\Psr7\HttpFactory'; + protected static string $serverRequestCreatorClass = 'GuzzleHttp\Psr7\ServerRequest'; + protected static string $serverRequestCreatorMethod = 'fromGlobals'; } diff --git a/vendor/slim/slim/Slim/Factory/Psr17/HttpSoftPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/HttpSoftPsr17Factory.php new file mode 100644 index 0000000000..c305d7c19a --- /dev/null +++ b/vendor/slim/slim/Slim/Factory/Psr17/HttpSoftPsr17Factory.php @@ -0,0 +1,19 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Factory\Psr17; + +class HttpSoftPsr17Factory extends Psr17Factory +{ + protected static string $responseFactoryClass = 'HttpSoft\Message\ResponseFactory'; + protected static string $streamFactoryClass = 'HttpSoft\Message\StreamFactory'; + protected static string $serverRequestCreatorClass = 'HttpSoft\ServerRequest\ServerRequestCreator'; + protected static string $serverRequestCreatorMethod = 'createFromGlobals'; +} diff --git a/vendor/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php index 097bc21b4f..e6a9db1acf 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/LaminasDiactorosPsr17Factory.php @@ -12,8 +12,8 @@ class LaminasDiactorosPsr17Factory extends Psr17Factory { - protected static $responseFactoryClass = 'Laminas\Diactoros\ResponseFactory'; - protected static $streamFactoryClass = 'Laminas\Diactoros\StreamFactory'; - protected static $serverRequestCreatorClass = 'Laminas\Diactoros\ServerRequestFactory'; - protected static $serverRequestCreatorMethod = 'fromGlobals'; + protected static string $responseFactoryClass = 'Laminas\Diactoros\ResponseFactory'; + protected static string $streamFactoryClass = 'Laminas\Diactoros\StreamFactory'; + protected static string $serverRequestCreatorClass = 'Laminas\Diactoros\ServerRequestFactory'; + protected static string $serverRequestCreatorMethod = 'fromGlobals'; } diff --git a/vendor/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php index d3fe1307eb..ba11095a4d 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/NyholmPsr17Factory.php @@ -8,10 +8,10 @@ class NyholmPsr17Factory extends Psr17Factory { - protected static $responseFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory'; - protected static $streamFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory'; - protected static $serverRequestCreatorClass = 'Nyholm\Psr7Server\ServerRequestCreator'; - protected static $serverRequestCreatorMethod = 'fromGlobals'; + protected static string $responseFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory'; + protected static string $streamFactoryClass = 'Nyholm\Psr7\Factory\Psr17Factory'; + protected static string $serverRequestCreatorClass = 'Nyholm\Psr7Server\ServerRequestCreator'; + protected static string $serverRequestCreatorMethod = 'fromGlobals'; /** * {@inheritdoc} diff --git a/vendor/slim/slim/Slim/Factory/Psr17/Psr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/Psr17Factory.php index 95f7d8bce6..97977f9bb4 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/Psr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/Psr17Factory.php @@ -21,36 +21,27 @@ abstract class Psr17Factory implements Psr17FactoryInterface { - /** - * @var string - */ - protected static $responseFactoryClass; + protected static string $responseFactoryClass; - /** - * @var string - */ - protected static $streamFactoryClass; + protected static string $streamFactoryClass; - /** - * @var string - */ - protected static $serverRequestCreatorClass; + protected static string $serverRequestCreatorClass; - /** - * @var string - */ - protected static $serverRequestCreatorMethod; + protected static string $serverRequestCreatorMethod; /** * {@inheritdoc} */ public static function getResponseFactory(): ResponseFactoryInterface { - if (!static::isResponseFactoryAvailable()) { + if ( + !static::isResponseFactoryAvailable() + || !(($responseFactory = new static::$responseFactoryClass()) instanceof ResponseFactoryInterface) + ) { throw new RuntimeException(get_called_class() . ' could not instantiate a response factory.'); } - return new static::$responseFactoryClass(); + return $responseFactory; } /** @@ -58,11 +49,14 @@ public static function getResponseFactory(): ResponseFactoryInterface */ public static function getStreamFactory(): StreamFactoryInterface { - if (!static::isStreamFactoryAvailable()) { + if ( + !static::isStreamFactoryAvailable() + || !(($streamFactory = new static::$streamFactoryClass()) instanceof StreamFactoryInterface) + ) { throw new RuntimeException(get_called_class() . ' could not instantiate a stream factory.'); } - return new static::$streamFactoryClass(); + return $streamFactory; } /** diff --git a/vendor/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php b/vendor/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php index 113ee432e1..436d2af0b3 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/Psr17FactoryProvider.php @@ -19,11 +19,11 @@ class Psr17FactoryProvider implements Psr17FactoryProviderInterface /** * @var string[] */ - protected static $factories = [ + protected static array $factories = [ SlimPsr17Factory::class, + HttpSoftPsr17Factory::class, NyholmPsr17Factory::class, LaminasDiactorosPsr17Factory::class, - ZendDiactorosPsr17Factory::class, GuzzlePsr17Factory::class, ]; diff --git a/vendor/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php b/vendor/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php index b4fe54640b..0fc6c06630 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/ServerRequestCreator.php @@ -21,14 +21,10 @@ class ServerRequestCreator implements ServerRequestCreatorInterface */ protected $serverRequestCreator; - /** - * @var string - */ - protected $serverRequestCreatorMethod; + protected string $serverRequestCreatorMethod; /** * @param object|string $serverRequestCreator - * @param string $serverRequestCreatorMethod */ public function __construct($serverRequestCreator, string $serverRequestCreatorMethod) { diff --git a/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php index 193b8668b0..5d636318bc 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpPsr17Factory.php @@ -12,20 +12,28 @@ use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; +use RuntimeException; class SlimHttpPsr17Factory extends Psr17Factory { - protected static $responseFactoryClass = 'Slim\Http\Factory\DecoratedResponseFactory'; + protected static string $responseFactoryClass = 'Slim\Http\Factory\DecoratedResponseFactory'; /** - * @param ResponseFactoryInterface $responseFactory - * @param StreamFactoryInterface $streamFactory - * @return ResponseFactoryInterface + * @throws RuntimeException when the factory could not be instantiated */ public static function createDecoratedResponseFactory( ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory ): ResponseFactoryInterface { - return new static::$responseFactoryClass($responseFactory, $streamFactory); + if ( + !(( + $decoratedResponseFactory = new static::$responseFactoryClass($responseFactory, $streamFactory) + ) instanceof ResponseFactoryInterface + ) + ) { + throw new RuntimeException(get_called_class() . ' could not instantiate a decorated response factory.'); + } + + return $decoratedResponseFactory; } } diff --git a/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php b/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php index cac5f22e02..eb50d48415 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/SlimHttpServerRequestCreator.php @@ -18,19 +18,10 @@ class SlimHttpServerRequestCreator implements ServerRequestCreatorInterface { - /** - * @var ServerRequestCreatorInterface - */ - protected $serverRequestCreator; + protected ServerRequestCreatorInterface $serverRequestCreator; - /** - * @var string - */ - protected static $serverRequestDecoratorClass = 'Slim\Http\ServerRequest'; + protected static string $serverRequestDecoratorClass = 'Slim\Http\ServerRequest'; - /** - * @param ServerRequestCreatorInterface $serverRequestCreator - */ public function __construct(ServerRequestCreatorInterface $serverRequestCreator) { $this->serverRequestCreator = $serverRequestCreator; @@ -47,12 +38,17 @@ public function createServerRequestFromGlobals(): ServerRequestInterface $request = $this->serverRequestCreator->createServerRequestFromGlobals(); - return new static::$serverRequestDecoratorClass($request); + if ( + !(( + $decoratedServerRequest = new static::$serverRequestDecoratorClass($request) + ) instanceof ServerRequestInterface) + ) { + throw new RuntimeException(get_called_class() . ' could not instantiate a decorated server request.'); + } + + return $decoratedServerRequest; } - /** - * @return bool - */ public static function isServerRequestDecoratorAvailable(): bool { return class_exists(static::$serverRequestDecoratorClass); diff --git a/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php index 8de6de945a..46c46f9ce3 100644 --- a/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php +++ b/vendor/slim/slim/Slim/Factory/Psr17/SlimPsr17Factory.php @@ -12,8 +12,8 @@ class SlimPsr17Factory extends Psr17Factory { - protected static $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory'; - protected static $streamFactoryClass = 'Slim\Psr7\Factory\StreamFactory'; - protected static $serverRequestCreatorClass = 'Slim\Psr7\Factory\ServerRequestFactory'; - protected static $serverRequestCreatorMethod = 'createFromGlobals'; + protected static string $responseFactoryClass = 'Slim\Psr7\Factory\ResponseFactory'; + protected static string $streamFactoryClass = 'Slim\Psr7\Factory\StreamFactory'; + protected static string $serverRequestCreatorClass = 'Slim\Psr7\Factory\ServerRequestFactory'; + protected static string $serverRequestCreatorMethod = 'createFromGlobals'; } diff --git a/vendor/slim/slim/Slim/Factory/Psr17/ZendDiactorosPsr17Factory.php b/vendor/slim/slim/Slim/Factory/Psr17/ZendDiactorosPsr17Factory.php deleted file mode 100644 index 779e761e72..0000000000 --- a/vendor/slim/slim/Slim/Factory/Psr17/ZendDiactorosPsr17Factory.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -/** - * Slim Framework (https://slimframework.com) - * - * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) - */ - -declare(strict_types=1); - -namespace Slim\Factory\Psr17; - -class ZendDiactorosPsr17Factory extends Psr17Factory -{ - protected static $responseFactoryClass = 'Zend\Diactoros\ResponseFactory'; - protected static $streamFactoryClass = 'Zend\Diactoros\StreamFactory'; - protected static $serverRequestCreatorClass = 'Zend\Diactoros\ServerRequestFactory'; - protected static $serverRequestCreatorMethod = 'fromGlobals'; -} diff --git a/vendor/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php b/vendor/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php index fb75d30bf9..2bd95d77cc 100644 --- a/vendor/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php +++ b/vendor/slim/slim/Slim/Factory/ServerRequestCreatorFactory.php @@ -17,33 +17,21 @@ use Slim\Interfaces\Psr17FactoryProviderInterface; use Slim\Interfaces\ServerRequestCreatorInterface; +/** @api */ class ServerRequestCreatorFactory { - /** - * @var Psr17FactoryProviderInterface|null - */ - protected static $psr17FactoryProvider; + protected static ?Psr17FactoryProviderInterface $psr17FactoryProvider = null; - /** - * @var ServerRequestCreatorInterface|null - */ - protected static $serverRequestCreator; + protected static ?ServerRequestCreatorInterface $serverRequestCreator = null; - /** - * @var bool - */ - protected static $slimHttpDecoratorsAutomaticDetectionEnabled = true; + protected static bool $slimHttpDecoratorsAutomaticDetectionEnabled = true; - /** - * @return ServerRequestCreatorInterface - */ public static function create(): ServerRequestCreatorInterface { return static::determineServerRequestCreator(); } /** - * @return ServerRequestCreatorInterface * @throws RuntimeException */ public static function determineServerRequestCreator(): ServerRequestCreatorInterface @@ -70,10 +58,6 @@ public static function determineServerRequestCreator(): ServerRequestCreatorInte ); } - /** - * @param ServerRequestCreatorInterface $serverRequestCreator - * @return ServerRequestCreatorInterface - */ protected static function attemptServerRequestCreatorDecoration( ServerRequestCreatorInterface $serverRequestCreator ): ServerRequestCreatorInterface { @@ -87,25 +71,16 @@ protected static function attemptServerRequestCreatorDecoration( return $serverRequestCreator; } - /** - * @param Psr17FactoryProviderInterface $psr17FactoryProvider - */ public static function setPsr17FactoryProvider(Psr17FactoryProviderInterface $psr17FactoryProvider): void { static::$psr17FactoryProvider = $psr17FactoryProvider; } - /** - * @param ServerRequestCreatorInterface $serverRequestCreator - */ public static function setServerRequestCreator(ServerRequestCreatorInterface $serverRequestCreator): void { self::$serverRequestCreator = $serverRequestCreator; } - /** - * @param bool $enabled - */ public static function setSlimHttpDecoratorsAutomaticDetection(bool $enabled): void { static::$slimHttpDecoratorsAutomaticDetectionEnabled = $enabled; diff --git a/vendor/slim/slim/Slim/Handlers/ErrorHandler.php b/vendor/slim/slim/Slim/Handlers/ErrorHandler.php index 0ac33c188b..689b4630b4 100644 --- a/vendor/slim/slim/Slim/Handlers/ErrorHandler.php +++ b/vendor/slim/slim/Slim/Handlers/ErrorHandler.php @@ -33,7 +33,6 @@ use function call_user_func; use function count; use function current; -use function error_log; use function explode; use function implode; use function next; @@ -44,13 +43,11 @@ * * It outputs the error message and diagnostic information in one of the following formats: * JSON, XML, Plain Text or HTML based on the Accept header. + * @api */ class ErrorHandler implements ErrorHandlerInterface { - /** - * @var string - */ - protected $defaultErrorRendererContentType = 'text/html'; + protected string $defaultErrorRendererContentType = 'text/html'; /** * @var ErrorRendererInterface|string|callable @@ -63,9 +60,9 @@ class ErrorHandler implements ErrorHandlerInterface protected $logErrorRenderer = PlainTextErrorRenderer::class; /** - * @var array + * @var array<string|callable> */ - protected $errorRenderers = [ + protected array $errorRenderers = [ 'application/json' => JsonErrorRenderer::class, 'application/xml' => XmlErrorRenderer::class, 'text/xml' => XmlErrorRenderer::class, @@ -73,66 +70,28 @@ class ErrorHandler implements ErrorHandlerInterface 'text/plain' => PlainTextErrorRenderer::class, ]; - /** - * @var bool - */ - protected $displayErrorDetails; + protected bool $displayErrorDetails = false; - /** - * @var bool - */ - protected $logErrors; + protected bool $logErrors; - /** - * @var bool - */ - protected $logErrorDetails; + protected bool $logErrorDetails = false; - /** - * @var string|null - */ - protected $contentType; + protected ?string $contentType = null; - /** - * @var string - */ - protected $method; + protected ?string $method = null; - /** - * @var ServerRequestInterface - */ - protected $request; + protected ServerRequestInterface $request; - /** - * @var Throwable - */ - protected $exception; + protected Throwable $exception; - /** - * @var int - */ - protected $statusCode; + protected int $statusCode; - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; - /** - * @var ResponseFactoryInterface - */ - protected $responseFactory; + protected ResponseFactoryInterface $responseFactory; - /* - * @var LoggerInterface - */ - protected $logger; + protected LoggerInterface $logger; - /** - * @param CallableResolverInterface $callableResolver - * @param ResponseFactoryInterface $responseFactory - * @param LoggerInterface|null $logger - */ public function __construct( CallableResolverInterface $callableResolver, ResponseFactoryInterface $responseFactory, @@ -151,8 +110,6 @@ public function __construct( * @param bool $displayErrorDetails Whether or not to display the error details * @param bool $logErrors Whether or not to log errors * @param bool $logErrorDetails Whether or not to log error details - * - * @return ResponseInterface */ public function __invoke( ServerRequestInterface $request, @@ -189,9 +146,6 @@ public function forceContentType(?string $contentType): void $this->contentType = $contentType; } - /** - * @return int - */ protected function determineStatusCode(): int { if ($this->method === 'OPTIONS') { @@ -211,9 +165,6 @@ protected function determineStatusCode(): int * Note: This method is a bare-bones implementation designed specifically for * Slim's error handling requirements. Consider a fully-feature solution such * as willdurand/negotiation for any other situation. - * - * @param ServerRequestInterface $request - * @return string */ protected function determineContentType(ServerRequestInterface $request): ?string { @@ -232,10 +183,15 @@ protected function determineContentType(ServerRequestInterface $request): ?strin * when multiple content types are provided via Accept header. */ if ($current === 'text/plain' && $count > 1) { - return next($selectedContentTypes); + $next = next($selectedContentTypes); + if (is_string($next)) { + return $next; + } } - return $current; + if (is_string($current)) { + return $current; + } } if (preg_match('/\+(json|xml)/', $acceptHeader, $matches)) { @@ -251,8 +207,6 @@ protected function determineContentType(ServerRequestInterface $request): ?strin /** * Determine which renderer to use based on content type * - * @return callable - * * @throws RuntimeException */ protected function determineRenderer(): callable @@ -301,14 +255,12 @@ public function setLogErrorRenderer($logErrorRenderer): void /** * Write to the error log if $logErrors has been set to true - * - * @return void */ protected function writeToErrorLog(): void { $renderer = $this->callableResolver->resolve($this->logErrorRenderer); $error = $renderer($this->exception, $this->logErrorDetails); - if (!$this->displayErrorDetails) { + if ($this->logErrorRenderer === PlainTextErrorRenderer::class && !$this->displayErrorDetails) { $error .= "\nTips: To display error details in HTTP response "; $error .= 'set "displayErrorDetails" to true in the ErrorHandler constructor.'; } @@ -317,9 +269,6 @@ protected function writeToErrorLog(): void /** * Wraps the error_log function so that this can be easily tested - * - * @param string $error - * @return void */ protected function logError(string $error): void { @@ -328,17 +277,12 @@ protected function logError(string $error): void /** * Returns a default logger implementation. - * - * @return LoggerInterface */ protected function getDefaultLogger(): LoggerInterface { return new Logger(); } - /** - * @return ResponseInterface - */ protected function respond(): ResponseInterface { $response = $this->responseFactory->createResponse($this->statusCode); @@ -355,7 +299,10 @@ protected function respond(): ResponseInterface $renderer = $this->determineRenderer(); $body = call_user_func($renderer, $this->exception, $this->displayErrorDetails); - $response->getBody()->write($body); + if ($body !== false) { + /** @var string $body */ + $response->getBody()->write($body); + } return $response; } diff --git a/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php b/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php index dd118172af..ea88a5f12d 100644 --- a/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php +++ b/vendor/slim/slim/Slim/Handlers/Strategies/RequestHandler.php @@ -19,14 +19,8 @@ */ class RequestHandler implements RequestHandlerInvocationStrategyInterface { - /** - * @var bool - */ - protected $appendRouteArgumentsToRequestAttributes; + protected bool $appendRouteArgumentsToRequestAttributes; - /** - * @param bool $appendRouteArgumentsToRequestAttributes - */ public function __construct(bool $appendRouteArgumentsToRequestAttributes = false) { $this->appendRouteArgumentsToRequestAttributes = $appendRouteArgumentsToRequestAttributes; @@ -35,12 +29,7 @@ public function __construct(bool $appendRouteArgumentsToRequestAttributes = fals /** * Invoke a route callable that implements RequestHandlerInterface * - * @param callable $callable - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @param array $routeArguments - * - * @return ResponseInterface + * @param array<string, string> $routeArguments */ public function __invoke( callable $callable, diff --git a/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php index 9de0d9f566..45b2c05a49 100644 --- a/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php +++ b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php @@ -23,12 +23,7 @@ class RequestResponse implements InvocationStrategyInterface * Invoke a route callable with request, response, and all route parameters * as an array of arguments. * - * @param callable $callable - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @param array $routeArguments - * - * @return ResponseInterface + * @param array<string, string> $routeArguments */ public function __invoke( callable $callable, diff --git a/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php index 0cff7459b3..6eab63a256 100644 --- a/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php +++ b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseArgs.php @@ -18,6 +18,7 @@ /** * Route callback strategy with route parameters as individual arguments. + * @api */ class RequestResponseArgs implements InvocationStrategyInterface { @@ -25,12 +26,7 @@ class RequestResponseArgs implements InvocationStrategyInterface * Invoke a route callable with request, response and all route parameters * as individual arguments. * - * @param callable $callable - * @param ServerRequestInterface $request - * @param ResponseInterface $response - * @param array $routeArguments - * - * @return ResponseInterface + * @param array<string, string> $routeArguments */ public function __invoke( callable $callable, diff --git a/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php new file mode 100644 index 0000000000..f36059646d --- /dev/null +++ b/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponseNamedArgs.php @@ -0,0 +1,45 @@ +<?php + +/** + * Slim Framework (https://slimframework.com) + * + * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License) + */ + +declare(strict_types=1); + +namespace Slim\Handlers\Strategies; + +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\ServerRequestInterface; +use Slim\Interfaces\InvocationStrategyInterface; +use RuntimeException; + +/** + * Route callback strategy with route parameters as individual arguments. + * @api + */ +class RequestResponseNamedArgs implements InvocationStrategyInterface +{ + public function __construct() + { + if (PHP_VERSION_ID < 80000) { + throw new RuntimeException('Named arguments are only available for PHP >= 8.0.0'); + } + } + + /** + * Invoke a route callable with request, response and all route parameters + * as individual arguments. + * + * @param array<string, string> $routeArguments + */ + public function __invoke( + callable $callable, + ServerRequestInterface $request, + ResponseInterface $response, + array $routeArguments + ): ResponseInterface { + return $callable($request, $response, ...$routeArguments); + } +} diff --git a/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php b/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php index c9d290768a..aa1d897de6 100644 --- a/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/AdvancedCallableResolverInterface.php @@ -16,8 +16,6 @@ interface AdvancedCallableResolverInterface extends CallableResolverInterface * Resolve $toResolve into a callable * * @param string|callable $toResolve - * - * @return callable */ public function resolveRoute($toResolve): callable; @@ -25,8 +23,6 @@ public function resolveRoute($toResolve): callable; * Resolve $toResolve into a callable * * @param string|callable $toResolve - * - * @return callable */ public function resolveMiddleware($toResolve): callable; } diff --git a/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php b/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php index 3e960b967b..92bfda43ac 100644 --- a/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/CallableResolverInterface.php @@ -16,7 +16,6 @@ interface CallableResolverInterface * Resolve $toResolve into a callable * * @param string|callable $toResolve - * @return callable */ public function resolve($toResolve): callable; } diff --git a/vendor/slim/slim/Slim/Interfaces/DispatcherInterface.php b/vendor/slim/slim/Slim/Interfaces/DispatcherInterface.php index de50588e44..63133793f3 100644 --- a/vendor/slim/slim/Slim/Interfaces/DispatcherInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/DispatcherInterface.php @@ -16,18 +16,13 @@ interface DispatcherInterface { /** * Get routing results for a given request method and uri - * - * @param string $method - * @param string $uri - * @return RoutingResults */ public function dispatch(string $method, string $uri): RoutingResults; /** * Get allowed methods for a given uri * - * @param string $uri - * @return array + * @return string[] */ public function getAllowedMethods(string $uri): array; } diff --git a/vendor/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php b/vendor/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php index 0cdbb11363..8950e6eceb 100644 --- a/vendor/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/ErrorHandlerInterface.php @@ -16,14 +16,6 @@ interface ErrorHandlerInterface { - /** - * @param ServerRequestInterface $request - * @param Throwable $exception - * @param bool $displayErrorDetails - * @param bool $logErrors - * @param bool $logErrorDetails - * @return ResponseInterface - */ public function __invoke( ServerRequestInterface $request, Throwable $exception, diff --git a/vendor/slim/slim/Slim/Interfaces/ErrorRendererInterface.php b/vendor/slim/slim/Slim/Interfaces/ErrorRendererInterface.php index 90d480be6b..05be65598e 100644 --- a/vendor/slim/slim/Slim/Interfaces/ErrorRendererInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/ErrorRendererInterface.php @@ -14,10 +14,5 @@ interface ErrorRendererInterface { - /** - * @param Throwable $exception - * @param bool $displayErrorDetails - * @return string - */ public function __invoke(Throwable $exception, bool $displayErrorDetails): string; } diff --git a/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php b/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php index d7be7ca4fd..88d6476e07 100644 --- a/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/InvocationStrategyInterface.php @@ -24,7 +24,7 @@ interface InvocationStrategyInterface * @param callable $callable The callable to invoke using the strategy. * @param ServerRequestInterface $request The request object. * @param ResponseInterface $response The response object. - * @param array $routeArguments The route's placeholder arguments + * @param array<string, string> $routeArguments The route's placeholder arguments * * @return ResponseInterface The response from the callable. */ diff --git a/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php b/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php index 60c93976ad..9fa34a6ad6 100644 --- a/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/MiddlewareDispatcherInterface.php @@ -13,6 +13,7 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; +/** @api */ interface MiddlewareDispatcherInterface extends RequestHandlerInterface { /** @@ -23,7 +24,6 @@ interface MiddlewareDispatcherInterface extends RequestHandlerInterface * added one (last in, first out). * * @param MiddlewareInterface|string|callable $middleware - * @return self */ public function add($middleware): self; @@ -33,17 +33,11 @@ public function add($middleware): self; * Middleware are organized as a stack. That means middleware * that have been added before will be executed after the newly * added one (last in, first out). - * - * @param MiddlewareInterface $middleware - * @return self */ public function addMiddleware(MiddlewareInterface $middleware): self; /** * Seed the middleware stack with the inner request handler - * - * @param RequestHandlerInterface $kernel - * @return void */ public function seedMiddlewareStack(RequestHandlerInterface $kernel): void; } diff --git a/vendor/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php b/vendor/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php index dcc1c76d5a..8cf0102874 100644 --- a/vendor/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/Psr17FactoryInterface.php @@ -17,44 +17,32 @@ interface Psr17FactoryInterface { /** - * @return ResponseFactoryInterface - * * @throws RuntimeException when the factory could not be instantiated */ public static function getResponseFactory(): ResponseFactoryInterface; /** - * @return StreamFactoryInterface - * * @throws RuntimeException when the factory could not be instantiated */ public static function getStreamFactory(): StreamFactoryInterface; /** - * @return ServerRequestCreatorInterface - * * @throws RuntimeException when the factory could not be instantiated */ public static function getServerRequestCreator(): ServerRequestCreatorInterface; /** * Is the PSR-17 ResponseFactory available - * - * @return bool */ public static function isResponseFactoryAvailable(): bool; /** * Is the PSR-17 StreamFactory available - * - * @return bool */ public static function isStreamFactoryAvailable(): bool; /** * Is the ServerRequest creator available - * - * @return bool */ public static function isServerRequestCreatorAvailable(): bool; } diff --git a/vendor/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php b/vendor/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php index 58d224f286..24590fe0f9 100644 --- a/vendor/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/Psr17FactoryProviderInterface.php @@ -10,6 +10,7 @@ namespace Slim\Interfaces; +/** @api */ interface Psr17FactoryProviderInterface { /** @@ -18,13 +19,9 @@ interface Psr17FactoryProviderInterface public static function getFactories(): array; /** - * @var string[] + * @param string[] $factories */ public static function setFactories(array $factories): void; - /** - * @param string $factory - * @return void - */ public static function addFactory(string $factory): void; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteCollectorInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteCollectorInterface.php index 959bcd356a..aa83883f6d 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteCollectorInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteCollectorInterface.php @@ -13,43 +13,32 @@ use InvalidArgumentException; use RuntimeException; +/** @api */ interface RouteCollectorInterface { /** * Get the route parser - * - * @return RouteParserInterface */ public function getRouteParser(): RouteParserInterface; /** * Get default route invocation strategy - * - * @return InvocationStrategyInterface */ public function getDefaultInvocationStrategy(): InvocationStrategyInterface; /** * Set default route invocation strategy - * - * @param InvocationStrategyInterface $strategy - * @return RouteCollectorInterface */ public function setDefaultInvocationStrategy(InvocationStrategyInterface $strategy): RouteCollectorInterface; /** * Get path to FastRoute cache file - * - * @return null|string */ public function getCacheFile(): ?string; /** * Set path to FastRoute cache file * - * @param string $cacheFile - * @return RouteCollectorInterface - * * @throws InvalidArgumentException * @throws RuntimeException */ @@ -57,16 +46,11 @@ public function setCacheFile(string $cacheFile): RouteCollectorInterface; /** * Get the base path used in pathFor() - * - * @return string */ public function getBasePath(): string; /** * Set the base path used in pathFor() - * - * @param string $basePath - * @return RouteCollectorInterface */ public function setBasePath(string $basePath): RouteCollectorInterface; @@ -82,8 +66,6 @@ public function getRoutes(): array; * * @param string $name Route name * - * @return RouteInterface - * * @throws RuntimeException If named route does not exist */ public function getNamedRoute(string $name): RouteInterface; @@ -92,7 +74,6 @@ public function getNamedRoute(string $name): RouteInterface; * Remove named route * * @param string $name Route name - * @return RouteCollectorInterface * * @throws RuntimeException If named route does not exist */ @@ -101,20 +82,13 @@ public function removeNamedRoute(string $name): RouteCollectorInterface; /** * Lookup a route via the route's unique identifier * - * @param string $identifier - * - * @return RouteInterface - * * @throws RuntimeException If route of identifier does not exist */ public function lookupRoute(string $identifier): RouteInterface; /** * Add route group - * - * @param string $pattern * @param string|callable $callable - * @return RouteGroupInterface */ public function group(string $pattern, $callable): RouteGroupInterface; @@ -124,8 +98,6 @@ public function group(string $pattern, $callable): RouteGroupInterface; * @param string[] $methods Array of HTTP methods * @param string $pattern The route pattern * @param callable|string $handler The route callable - * - * @return RouteInterface */ public function map(array $methods, string $pattern, $handler): RouteInterface; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php index f0514e1c08..0220af030b 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteCollectorProxyInterface.php @@ -14,41 +14,31 @@ use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\UriInterface; +/** + * @api + * @template TContainerInterface of (ContainerInterface|null) + */ interface RouteCollectorProxyInterface { - /** - * @return ResponseFactoryInterface - */ public function getResponseFactory(): ResponseFactoryInterface; - /** - * @return CallableResolverInterface - */ public function getCallableResolver(): CallableResolverInterface; /** - * @return ContainerInterface|null + * @return TContainerInterface */ public function getContainer(): ?ContainerInterface; - /** - * @return RouteCollectorInterface - */ public function getRouteCollector(): RouteCollectorInterface; /** * Get the RouteCollectorProxy's base path - * - * @return string */ public function getBasePath(): string; /** * Set the RouteCollectorProxy's base path - * - * @param string $basePath - * - * @return RouteCollectorProxyInterface + * @return RouteCollectorProxyInterface<TContainerInterface> */ public function setBasePath(string $basePath): RouteCollectorProxyInterface; @@ -57,8 +47,6 @@ public function setBasePath(string $basePath): RouteCollectorProxyInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function get(string $pattern, $callable): RouteInterface; @@ -67,8 +55,6 @@ public function get(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function post(string $pattern, $callable): RouteInterface; @@ -77,8 +63,6 @@ public function post(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function put(string $pattern, $callable): RouteInterface; @@ -87,8 +71,6 @@ public function put(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function patch(string $pattern, $callable): RouteInterface; @@ -97,8 +79,6 @@ public function patch(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function delete(string $pattern, $callable): RouteInterface; @@ -107,8 +87,6 @@ public function delete(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function options(string $pattern, $callable): RouteInterface; @@ -117,8 +95,6 @@ public function options(string $pattern, $callable): RouteInterface; * * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function any(string $pattern, $callable): RouteInterface; @@ -128,8 +104,6 @@ public function any(string $pattern, $callable): RouteInterface; * @param string[] $methods Numeric array of HTTP method names * @param string $pattern The route URI pattern * @param callable|string $callable The route callback routine - * - * @return RouteInterface */ public function map(array $methods, string $pattern, $callable): RouteInterface; @@ -139,22 +113,14 @@ public function map(array $methods, string $pattern, $callable): RouteInterface; * This method accepts a route pattern and a callback. All route * declarations in the callback will be prepended by the group(s) * that it is in. - * - * @param string $pattern * @param string|callable $callable - * - * @return RouteGroupInterface */ public function group(string $pattern, $callable): RouteGroupInterface; /** * Add a route that sends an HTTP redirect * - * @param string $from * @param string|UriInterface $to - * @param int $status - * - * @return RouteInterface */ public function redirect(string $from, $to, int $status = 302): RouteInterface; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php index b2b57482e0..efc1c5a3bf 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteGroupInterface.php @@ -13,41 +13,31 @@ use Psr\Http\Server\MiddlewareInterface; use Slim\MiddlewareDispatcher; +/** @api */ interface RouteGroupInterface { - /** - * @return RouteGroupInterface - */ public function collectRoutes(): RouteGroupInterface; /** * Add middleware to the route group * * @param MiddlewareInterface|string|callable $middleware - * @return RouteGroupInterface */ public function add($middleware): RouteGroupInterface; /** * Add middleware to the route group - * - * @param MiddlewareInterface $middleware - * @return RouteGroupInterface */ public function addMiddleware(MiddlewareInterface $middleware): RouteGroupInterface; /** * Append the group's middleware to the MiddlewareDispatcher - * - * @param MiddlewareDispatcher $dispatcher - * @return RouteGroupInterface + * @param MiddlewareDispatcher<\Psr\Container\ContainerInterface|null> $dispatcher */ public function appendMiddlewareToDispatcher(MiddlewareDispatcher $dispatcher): RouteGroupInterface; /** * Get the RouteGroup's pattern - * - * @return string */ public function getPattern(): string; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteInterface.php index 018680fde7..8ed817ef47 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteInterface.php @@ -14,20 +14,16 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; +/** @api */ interface RouteInterface { /** * Get route invocation strategy - * - * @return InvocationStrategyInterface */ public function getInvocationStrategy(): InvocationStrategyInterface; /** * Set route invocation strategy - * - * @param InvocationStrategyInterface $invocationStrategy - * @return RouteInterface */ public function setInvocationStrategy(InvocationStrategyInterface $invocationStrategy): RouteInterface; @@ -40,16 +36,11 @@ public function getMethods(): array; /** * Get route pattern - * - * @return string */ public function getPattern(): string; /** * Set route pattern - * - * @param string $pattern - * @return RouteInterface */ public function setPattern(string $pattern): RouteInterface; @@ -64,88 +55,63 @@ public function getCallable(); * Set route callable * * @param callable|string $callable - * @return RouteInterface */ public function setCallable($callable): RouteInterface; /** * Get route name - * - * @return null|string */ public function getName(): ?string; /** * Set route name * - * @param string $name - * * @return static */ public function setName(string $name): RouteInterface; /** * Get the route's unique identifier - * - * @return string */ public function getIdentifier(): string; /** * Retrieve a specific route argument - * - * @param string $name - * @param string|null $default - * - * @return string|null */ public function getArgument(string $name, ?string $default = null): ?string; /** * Get route arguments * - * @return string[] + * @return array<string, string> */ public function getArguments(): array; /** * Set a route argument - * - * @param string $name - * @param string $value - * - * @return self */ public function setArgument(string $name, string $value): RouteInterface; /** * Replace route arguments * - * @param string[] $arguments - * - * @return self + * @param array<string, string> $arguments */ - public function setArguments(array $arguments): RouteInterface; + public function setArguments(array $arguments): self; /** * @param MiddlewareInterface|string|callable $middleware - * @return RouteInterface */ - public function add($middleware): RouteInterface; + public function add($middleware): self; - /** - * @param MiddlewareInterface $middleware - * @return RouteInterface - */ - public function addMiddleware(MiddlewareInterface $middleware): RouteInterface; + public function addMiddleware(MiddlewareInterface $middleware): self; /** * Prepare the route for use * - * @param array $arguments - * @return RouteInterface + * @param array<string, string> $arguments */ - public function prepare(array $arguments): RouteInterface; + public function prepare(array $arguments): self; /** * Run route @@ -153,9 +119,6 @@ public function prepare(array $arguments): RouteInterface; * This method traverses the middleware stack, including the route's callable * and captures the resultant HTTP response object. It then sends the response * back to the Application. - * - * @param ServerRequestInterface $request - * @return ResponseInterface */ public function run(ServerRequestInterface $request): ResponseInterface; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php index 23b717e13e..8ccea3bc33 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteParserInterface.php @@ -14,17 +14,15 @@ use Psr\Http\Message\UriInterface; use RuntimeException; +/** @api */ interface RouteParserInterface { /** * Build the path for a named route excluding the base path * - * - * @param string $routeName Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string + * @param string $routeName Route name + * @param array<string, string> $data Named argument replacement data + * @param array<string, string> $queryParams Optional query string parameters * * @throws RuntimeException If named route does not exist * @throws InvalidArgumentException If required data not provided @@ -34,11 +32,9 @@ public function relativeUrlFor(string $routeName, array $data = [], array $query /** * Build the path for a named route including the base path * - * @param string $routeName Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string + * @param string $routeName Route name + * @param array<string, string> $data Named argument replacement data + * @param array<string, string> $queryParams Optional query string parameters * * @throws RuntimeException If named route does not exist * @throws InvalidArgumentException If required data not provided @@ -48,12 +44,10 @@ public function urlFor(string $routeName, array $data = [], array $queryParams = /** * Get fully qualified URL for named route * - * @param UriInterface $uri - * @param string $routeName Route name - * @param array $data Named argument replacement data - * @param array $queryParams Optional query string parameters - * - * @return string + * @param UriInterface $uri + * @param string $routeName Route name + * @param array<string, string> $data Named argument replacement data + * @param array<string, string> $queryParams Optional query string parameters */ public function fullUrlFor(UriInterface $uri, string $routeName, array $data = [], array $queryParams = []): string; } diff --git a/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php b/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php index bda15fd464..256a359975 100644 --- a/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/RouteResolverInterface.php @@ -10,14 +10,8 @@ interface RouteResolverInterface { /** * @param string $uri Should be ServerRequestInterface::getUri()->getPath() - * @param string $method - * @return RoutingResults */ public function computeRoutingResults(string $uri, string $method): RoutingResults; - /** - * @param string $identifier - * @return RouteInterface - */ public function resolveRoute(string $identifier): RouteInterface; } diff --git a/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php b/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php index 37ffb01afe..54d231edd5 100644 --- a/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php +++ b/vendor/slim/slim/Slim/Interfaces/ServerRequestCreatorInterface.php @@ -14,8 +14,5 @@ interface ServerRequestCreatorInterface { - /** - * @return ServerRequestInterface - */ public function createServerRequestFromGlobals(): ServerRequestInterface; } diff --git a/vendor/slim/slim/Slim/Logger.php b/vendor/slim/slim/Slim/Logger.php index 9d86ac0cfa..31282175ca 100644 --- a/vendor/slim/slim/Slim/Logger.php +++ b/vendor/slim/slim/Slim/Logger.php @@ -12,20 +12,21 @@ use Psr\Log\AbstractLogger; use Psr\Log\InvalidArgumentException; +use Stringable; + +use function error_log; class Logger extends AbstractLogger { /** - * @param mixed $level - * @param string $message - * @param array $context - * - * @return void + * @param mixed $level + * @param string|Stringable $message + * @param array<mixed> $context * * @throws InvalidArgumentException */ - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { - error_log($message); + error_log((string) $message); } } diff --git a/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php b/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php index 1a121430da..94bba37132 100644 --- a/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/BodyParsingMiddleware.php @@ -31,12 +31,15 @@ use function strtolower; use function trim; +use const LIBXML_VERSION; + +/** @api */ class BodyParsingMiddleware implements MiddlewareInterface { /** * @var callable[] */ - protected $bodyParsers; + protected array $bodyParsers; /** * @param callable[] $bodyParsers list of body parsers as an associative array of mediaType => callable @@ -50,15 +53,11 @@ public function __construct(array $bodyParsers = []) } } - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $parsedBody = $request->getParsedBody(); - if ($parsedBody === null || empty($parsedBody)) { + + if (empty($parsedBody)) { $parsedBody = $this->parseBody($request); $request = $request->withParsedBody($parsedBody); } @@ -69,7 +68,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface /** * @param string $mediaType A HTTP media type (excluding content-type params). * @param callable $callable A callable that returns parsed contents for media type. - * @return self */ public function registerBodyParser(string $mediaType, callable $callable): self { @@ -79,7 +77,6 @@ public function registerBodyParser(string $mediaType, callable $callable): self /** * @param string $mediaType A HTTP media type (excluding content-type params). - * @return boolean */ public function hasBodyParser(string $mediaType): bool { @@ -88,7 +85,6 @@ public function hasBodyParser(string $mediaType): bool /** * @param string $mediaType A HTTP media type (excluding content-type params). - * @return callable * @throws RuntimeException */ public function getBodyParser(string $mediaType): callable @@ -99,10 +95,9 @@ public function getBodyParser(string $mediaType): callable return $this->bodyParsers[$mediaType]; } - protected function registerDefaultBodyParsers(): void { - $this->registerBodyParser('application/json', function ($input) { + $this->registerBodyParser('application/json', static function ($input) { $result = json_decode($input, true); if (!is_array($result)) { @@ -112,17 +107,17 @@ protected function registerDefaultBodyParsers(): void return $result; }); - $this->registerBodyParser('application/x-www-form-urlencoded', function ($input) { + $this->registerBodyParser('application/x-www-form-urlencoded', static function ($input) { parse_str($input, $data); return $data; }); - $xmlCallable = function ($input) { - $backup = libxml_disable_entity_loader(true); + $xmlCallable = static function ($input) { + $backup = self::disableXmlEntityLoader(true); $backup_errors = libxml_use_internal_errors(true); $result = simplexml_load_string($input); - libxml_disable_entity_loader($backup); + self::disableXmlEntityLoader($backup); libxml_clear_errors(); libxml_use_internal_errors($backup_errors); @@ -138,8 +133,7 @@ protected function registerDefaultBodyParsers(): void } /** - * @param ServerRequestInterface $request - * @return null|array|object + * @return null|array<mixed>|object */ protected function parseBody(ServerRequestInterface $request) { @@ -161,7 +155,7 @@ protected function parseBody(ServerRequestInterface $request) $body = (string)$request->getBody(); $parsed = $this->bodyParsers[$mediaType]($body); - if (!is_null($parsed) && !is_object($parsed) && !is_array($parsed)) { + if ($parsed !== null && !is_object($parsed) && !is_array($parsed)) { throw new RuntimeException( 'Request body media type parser return value must be an array, an object, or null' ); @@ -174,18 +168,30 @@ protected function parseBody(ServerRequestInterface $request) } /** - * @param ServerRequestInterface $request * @return string|null The serverRequest media type, minus content-type params */ protected function getMediaType(ServerRequestInterface $request): ?string { $contentType = $request->getHeader('Content-Type')[0] ?? null; - if (is_string($contentType) && trim($contentType) != '') { + if (is_string($contentType) && trim($contentType) !== '') { $contentTypeParts = explode(';', $contentType); return strtolower(trim($contentTypeParts[0])); } return null; } + + protected static function disableXmlEntityLoader(bool $disable): bool + { + if (LIBXML_VERSION >= 20900) { + // libxml >= 2.9.0 disables entity loading by default, so it is + // safe to skip the real call (deprecated in PHP 8). + return true; + } + + // @codeCoverageIgnoreStart + return libxml_disable_entity_loader($disable); + // @codeCoverageIgnoreEnd + } } diff --git a/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php b/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php index b742398069..e289fa365d 100644 --- a/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/ContentLengthMiddleware.php @@ -15,13 +15,9 @@ use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; +/** @api */ class ContentLengthMiddleware implements MiddlewareInterface { - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $response = $handler->handle($request); diff --git a/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php b/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php index 0ce324063e..39b1e585d4 100644 --- a/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php @@ -25,61 +25,36 @@ use function get_class; use function is_subclass_of; +/** @api */ class ErrorMiddleware implements MiddlewareInterface { - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; - /** - * @var ResponseFactoryInterface - */ - protected $responseFactory; + protected ResponseFactoryInterface $responseFactory; - /** - * @var bool - */ - protected $displayErrorDetails; + protected bool $displayErrorDetails; - /** - * @var bool - */ - protected $logErrors; + protected bool $logErrors; - /** - * @var bool - */ - protected $logErrorDetails; + protected bool $logErrorDetails; - /** - * @var LoggerInterface|null - */ - protected $logger; + protected ?LoggerInterface $logger = null; /** - * @var ErrorHandlerInterface[]|callable[] + * @var ErrorHandlerInterface[]|callable[]|string[] */ - protected $handlers = []; + protected array $handlers = []; /** - * @var ErrorHandlerInterface[]|callable[] + * @var ErrorHandlerInterface[]|callable[]|string[] */ - protected $subClassHandlers = []; + protected array $subClassHandlers = []; /** - * @var ErrorHandlerInterface|callable|null + * @var ErrorHandlerInterface|callable|string|null */ protected $defaultErrorHandler; - /** - * @param CallableResolverInterface $callableResolver - * @param ResponseFactoryInterface $responseFactory - * @param bool $displayErrorDetails - * @param bool $logErrors - * @param bool $logErrorDetails - * @param LoggerInterface|null $logger - */ public function __construct( CallableResolverInterface $callableResolver, ResponseFactoryInterface $responseFactory, @@ -96,11 +71,6 @@ public function __construct( $this->logger = $logger; } - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { try { @@ -110,11 +80,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface } } - /** - * @param ServerRequestInterface $request - * @param Throwable $exception - * @return ResponseInterface - */ public function handleException(ServerRequestInterface $request, Throwable $exception): ResponseInterface { if ($exception instanceof HttpException) { @@ -138,13 +103,15 @@ public function getErrorHandler(string $type) { if (isset($this->handlers[$type])) { return $this->callableResolver->resolve($this->handlers[$type]); - } elseif (isset($this->subClassHandlers[$type])) { + } + + if (isset($this->subClassHandlers[$type])) { return $this->callableResolver->resolve($this->subClassHandlers[$type]); - } else { - foreach ($this->subClassHandlers as $class => $handler) { - if (is_subclass_of($type, $class)) { - return $this->callableResolver->resolve($handler); - } + } + + foreach ($this->subClassHandlers as $class => $handler) { + if (is_subclass_of($type, $class)) { + return $this->callableResolver->resolve($handler); } } @@ -178,15 +145,14 @@ public function getDefaultErrorHandler() * * 1. Instance of \Psr\Http\Message\ServerRequestInterface * 2. Instance of \Throwable - * 3. Boolean displayErrorDetails + * 3. Boolean $displayErrorDetails * 4. Boolean $logErrors * 5. Boolean $logErrorDetails * * The callable MUST return an instance of * \Psr\Http\Message\ResponseInterface. * - * @param callable|ErrorHandler $handler - * @return self + * @param string|callable|ErrorHandler $handler */ public function setDefaultErrorHandler($handler): self { @@ -207,7 +173,7 @@ public function setDefaultErrorHandler($handler): self * * 1. Instance of \Psr\Http\Message\ServerRequestInterface * 2. Instance of \Throwable - * 3. Boolean displayErrorDetails + * 3. Boolean $displayErrorDetails * 4. Boolean $logErrors * 5. Boolean $logErrorDetails * @@ -217,9 +183,7 @@ public function setDefaultErrorHandler($handler): self * @param string|string[] $typeOrTypes Exception/Throwable name. * ie: RuntimeException::class or an array of classes * ie: [HttpNotFoundException::class, HttpMethodNotAllowedException::class] - * @param callable|ErrorHandlerInterface $handler - * @param bool $handleSubclasses - * @return self + * @param string|callable|ErrorHandlerInterface $handler */ public function setErrorHandler($typeOrTypes, $handler, bool $handleSubclasses = false): self { @@ -236,10 +200,7 @@ public function setErrorHandler($typeOrTypes, $handler, bool $handleSubclasses = /** * Used internally to avoid code repetition when passing multiple exceptions to setErrorHandler(). - * @param string $type - * @param callable|ErrorHandlerInterface $handler - * @param bool $handleSubclasses - * @return void + * @param string|callable|ErrorHandlerInterface $handler */ private function addErrorHandler(string $type, $handler, bool $handleSubclasses): void { diff --git a/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php b/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php index 39388aa5a2..553463e2dd 100644 --- a/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/MethodOverrideMiddleware.php @@ -18,13 +18,9 @@ use function is_array; use function strtoupper; +/** @api */ class MethodOverrideMiddleware implements MiddlewareInterface { - /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $methodHeader = $request->getHeaderLine('X-Http-Method-Override'); diff --git a/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php b/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php index 198ee8f35b..8bfbbf64e4 100644 --- a/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/OutputBufferingMiddleware.php @@ -23,24 +23,18 @@ use function ob_get_clean; use function ob_start; +/** @api */ class OutputBufferingMiddleware implements MiddlewareInterface { public const APPEND = 'append'; public const PREPEND = 'prepend'; - /** - * @var StreamFactoryInterface - */ - protected $streamFactory; + protected StreamFactoryInterface $streamFactory; - /** - * @var string - */ - protected $style; + protected string $style; /** - * @param StreamFactoryInterface $streamFactory - * @param string $style Either "append" or "prepend" + * @param string $style Either "append" or "prepend" */ public function __construct(StreamFactoryInterface $streamFactory, string $style = 'append') { @@ -53,9 +47,6 @@ public function __construct(StreamFactoryInterface $streamFactory, string $style } /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface * @throws Throwable */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface diff --git a/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php b/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php index 4c24e3bc8c..a3d3085bd4 100644 --- a/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php +++ b/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php @@ -24,20 +24,10 @@ class RoutingMiddleware implements MiddlewareInterface { - /** - * @var RouteResolverInterface - */ - protected $routeResolver; + protected RouteResolverInterface $routeResolver; - /** - * @var RouteParserInterface - */ - protected $routeParser; + protected RouteParserInterface $routeParser; - /** - * @param RouteResolverInterface $routeResolver - * @param RouteParserInterface $routeParser - */ public function __construct(RouteResolverInterface $routeResolver, RouteParserInterface $routeParser) { $this->routeResolver = $routeResolver; @@ -45,17 +35,12 @@ public function __construct(RouteResolverInterface $routeResolver, RouteParserIn } /** - * @param ServerRequestInterface $request - * @param RequestHandlerInterface $handler - * @return ResponseInterface - * * @throws HttpNotFoundException * @throws HttpMethodNotAllowedException * @throws RuntimeException */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { - $request = $request->withAttribute(RouteContext::ROUTE_PARSER, $this->routeParser); $request = $this->performRouting($request); return $handler->handle($request); } @@ -64,7 +49,6 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface * Perform routing * * @param ServerRequestInterface $request PSR7 Server Request - * @return ServerRequestInterface * * @throws HttpNotFoundException * @throws HttpMethodNotAllowedException @@ -72,10 +56,9 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface */ public function performRouting(ServerRequestInterface $request): ServerRequestInterface { - $routingResults = $this->routeResolver->computeRoutingResults( - $request->getUri()->getPath(), - $request->getMethod() - ); + $request = $request->withAttribute(RouteContext::ROUTE_PARSER, $this->routeParser); + + $routingResults = $this->resolveRoutingResultsFromRequest($request); $routeStatus = $routingResults->getRouteStatus(); $request = $request->withAttribute(RouteContext::ROUTING_RESULTS, $routingResults); @@ -101,4 +84,15 @@ public function performRouting(ServerRequestInterface $request): ServerRequestIn throw new RuntimeException('An unexpected error occurred while performing routing.'); } } + + /** + * Resolves the route from the given request + */ + protected function resolveRoutingResultsFromRequest(ServerRequestInterface $request): RoutingResults + { + return $this->routeResolver->computeRoutingResults( + $request->getUri()->getPath(), + $request->getMethod() + ); + } } diff --git a/vendor/slim/slim/Slim/MiddlewareDispatcher.php b/vendor/slim/slim/Slim/MiddlewareDispatcher.php index 08b1c536b2..1d4c668ffa 100644 --- a/vendor/slim/slim/Slim/MiddlewareDispatcher.php +++ b/vendor/slim/slim/Slim/MiddlewareDispatcher.php @@ -28,29 +28,24 @@ use function preg_match; use function sprintf; +/** + * @api + * @template TContainerInterface of (ContainerInterface|null) + */ class MiddlewareDispatcher implements MiddlewareDispatcherInterface { /** * Tip of the middleware call stack - * - * @var RequestHandlerInterface */ - protected $tip; + protected RequestHandlerInterface $tip; - /** - * @var CallableResolverInterface|null - */ - protected $callableResolver; + protected ?CallableResolverInterface $callableResolver; - /** - * @var ContainerInterface|null - */ - protected $container; + /** @var TContainerInterface $container */ + protected ?ContainerInterface $container; /** - * @param RequestHandlerInterface $kernel - * @param CallableResolverInterface|null $callableResolver - * @param ContainerInterface|null $container + * @param TContainerInterface $container */ public function __construct( RequestHandlerInterface $kernel, @@ -72,9 +67,6 @@ public function seedMiddlewareStack(RequestHandlerInterface $kernel): void /** * Invoke the middleware stack - * - * @param ServerRequestInterface $request - * @return ResponseInterface */ public function handle(ServerRequestInterface $request): ResponseInterface { @@ -89,7 +81,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface * added one (last in, first out). * * @param MiddlewareInterface|string|callable $middleware - * @return MiddlewareDispatcherInterface */ public function add($middleware): MiddlewareDispatcherInterface { @@ -105,6 +96,7 @@ public function add($middleware): MiddlewareDispatcherInterface return $this->addCallable($middleware); } + /** @phpstan-ignore-next-line */ throw new RuntimeException( 'A middleware must be an object/class name referencing an implementation of ' . 'MiddlewareInterface or a callable with a matching signature.' @@ -117,17 +109,14 @@ public function add($middleware): MiddlewareDispatcherInterface * Middleware are organized as a stack. That means middleware * that have been added before will be executed after the newly * added one (last in, first out). - * - * @param MiddlewareInterface $middleware - * @return MiddlewareDispatcherInterface */ public function addMiddleware(MiddlewareInterface $middleware): MiddlewareDispatcherInterface { $next = $this->tip; - $this->tip = new class ($middleware, $next) implements RequestHandlerInterface - { - private $middleware; - private $next; + $this->tip = new class ($middleware, $next) implements RequestHandlerInterface { + private MiddlewareInterface $middleware; + + private RequestHandlerInterface $next; public function __construct(MiddlewareInterface $middleware, RequestHandlerInterface $next) { @@ -150,9 +139,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface * Middleware are organized as a stack. That means middleware * that have been added before will be executed after the newly * added one (last in, first out). - * - * @param string $middleware - * @return self + * @return MiddlewareDispatcher<TContainerInterface> */ public function addDeferred(string $middleware): self { @@ -162,12 +149,14 @@ public function addDeferred(string $middleware): self $next, $this->container, $this->callableResolver - ) implements RequestHandlerInterface - { - private $middleware; - private $next; - private $container; - private $callableResolver; + ) implements RequestHandlerInterface { + private string $middleware; + + private RequestHandlerInterface $next; + + private ?ContainerInterface $container; + + private ?CallableResolverInterface $callableResolver; public function __construct( string $middleware, @@ -203,6 +192,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface $instance = null; $method = null; + /** @psalm-suppress ArgumentTypeCoercion */ // Check for Slim callable as `class:method` if (preg_match(CallableResolver::$callablePattern, $resolved, $matches)) { $resolved = $matches[1]; @@ -236,10 +226,12 @@ public function handle(ServerRequestInterface $request): ResponseInterface } if (!is_callable($callable)) { - throw new RuntimeException(sprintf( - 'Middleware %s is not resolvable', - $this->middleware - )); + throw new RuntimeException( + sprintf( + 'Middleware %s is not resolvable', + $this->middleware + ) + ); } return $callable($request, $this->next); @@ -250,26 +242,31 @@ public function handle(ServerRequestInterface $request): ResponseInterface } /** - * Add a (non standard) callable middleware to the stack + * Add a (non-standard) callable middleware to the stack * * Middleware are organized as a stack. That means middleware * that have been added before will be executed after the newly * added one (last in, first out). - * - * @param callable $middleware - * @return self + * @return MiddlewareDispatcher<TContainerInterface> */ public function addCallable(callable $middleware): self { $next = $this->tip; if ($this->container && $middleware instanceof Closure) { + /** @var Closure $middleware */ $middleware = $middleware->bindTo($this->container); } - $this->tip = new class ($middleware, $next) implements RequestHandlerInterface - { + $this->tip = new class ($middleware, $next) implements RequestHandlerInterface { + /** + * @var callable + */ private $middleware; + + /** + * @var RequestHandlerInterface + */ private $next; public function __construct(callable $middleware, RequestHandlerInterface $next) diff --git a/vendor/slim/slim/Slim/ResponseEmitter.php b/vendor/slim/slim/Slim/ResponseEmitter.php index 88ccac7dbe..fac36e9e7c 100644 --- a/vendor/slim/slim/Slim/ResponseEmitter.php +++ b/vendor/slim/slim/Slim/ResponseEmitter.php @@ -25,14 +25,8 @@ class ResponseEmitter { - /** - * @var int - */ - private $responseChunkSize; + private int $responseChunkSize; - /** - * @param int $responseChunkSize - */ public function __construct(int $responseChunkSize = 4096) { $this->responseChunkSize = $responseChunkSize; @@ -40,16 +34,17 @@ public function __construct(int $responseChunkSize = 4096) /** * Send the response the client - * - * @param ResponseInterface $response - * @return void */ public function emit(ResponseInterface $response): void { $isEmpty = $this->isResponseEmpty($response); if (headers_sent() === false) { - $this->emitStatusLine($response); $this->emitHeaders($response); + + // Set the status _after_ the headers, because of PHP's "helpful" behavior with location headers. + // See https://github.com/slimphp/Slim/issues/1730 + + $this->emitStatusLine($response); } if (!$isEmpty) { @@ -59,8 +54,6 @@ public function emit(ResponseInterface $response): void /** * Emit Response Headers - * - * @param ResponseInterface $response */ private function emitHeaders(ResponseInterface $response): void { @@ -76,8 +69,6 @@ private function emitHeaders(ResponseInterface $response): void /** * Emit Status Line - * - * @param ResponseInterface $response */ private function emitStatusLine(ResponseInterface $response): void { @@ -92,8 +83,6 @@ private function emitStatusLine(ResponseInterface $response): void /** * Emit Body - * - * @param ResponseInterface $response */ private function emitBody(ResponseInterface $response): void { @@ -131,9 +120,6 @@ private function emitBody(ResponseInterface $response): void /** * Asserts response body is empty or status code is 204, 205 or 304 - * - * @param ResponseInterface $response - * @return bool */ public function isResponseEmpty(ResponseInterface $response): bool { diff --git a/vendor/slim/slim/Slim/Routing/Dispatcher.php b/vendor/slim/slim/Slim/Routing/Dispatcher.php index 070af20719..e33eac3964 100644 --- a/vendor/slim/slim/Slim/Routing/Dispatcher.php +++ b/vendor/slim/slim/Slim/Routing/Dispatcher.php @@ -4,6 +4,7 @@ namespace Slim\Routing; +use FastRoute\DataGenerator\GroupCountBased; use FastRoute\RouteCollector as FastRouteCollector; use FastRoute\RouteParser\Std; use Slim\Interfaces\DispatcherInterface; @@ -11,34 +12,22 @@ class Dispatcher implements DispatcherInterface { - /** - * @var RouteCollectorInterface - */ - private $routeCollector; + private RouteCollectorInterface $routeCollector; - /** - * @var FastRouteDispatcher|null - */ - private $dispatcher; + private ?FastRouteDispatcher $dispatcher = null; - /** - * @param RouteCollectorInterface $routeCollector - */ public function __construct(RouteCollectorInterface $routeCollector) { $this->routeCollector = $routeCollector; } - /** - * @return FastRouteDispatcher - */ protected function createDispatcher(): FastRouteDispatcher { if ($this->dispatcher) { return $this->dispatcher; } - $routeDefinitionCallback = function (FastRouteCollector $r) { + $routeDefinitionCallback = function (FastRouteCollector $r): void { $basePath = $this->routeCollector->getBasePath(); foreach ($this->routeCollector->getRoutes() as $route) { @@ -50,6 +39,7 @@ protected function createDispatcher(): FastRouteDispatcher if ($cacheFile) { /** @var FastRouteDispatcher $dispatcher */ $dispatcher = \FastRoute\cachedDispatcher($routeDefinitionCallback, [ + 'dataGenerator' => GroupCountBased::class, 'dispatcher' => FastRouteDispatcher::class, 'routeParser' => new Std(), 'cacheFile' => $cacheFile, @@ -57,6 +47,7 @@ protected function createDispatcher(): FastRouteDispatcher } else { /** @var FastRouteDispatcher $dispatcher */ $dispatcher = \FastRoute\simpleDispatcher($routeDefinitionCallback, [ + 'dataGenerator' => GroupCountBased::class, 'dispatcher' => FastRouteDispatcher::class, 'routeParser' => new Std(), ]); diff --git a/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php b/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php index 522af85451..797746bbb1 100644 --- a/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php +++ b/vendor/slim/slim/Slim/Routing/FastRouteDispatcher.php @@ -15,15 +15,15 @@ class FastRouteDispatcher extends GroupCountBased { /** - * @var array + * @var string[][] */ - private $allowedMethods = []; + private array $allowedMethods = []; /** * @param string $httpMethod * @param string $uri * - * @return array + * @return array{int, string|null, array<string, string>} */ public function dispatch($httpMethod, $uri): array { @@ -53,15 +53,25 @@ public function dispatch($httpMethod, $uri): array return [self::NOT_FOUND, null, []]; } + /** + * @param string $httpMethod + * @param string $uri + * + * @return array{int, string|null, array<string, string>} + */ private function routingResults(string $httpMethod, string $uri): array { if (isset($this->staticRouteMap[$httpMethod][$uri])) { - return [self::FOUND, $this->staticRouteMap[$httpMethod][$uri], []]; + /** @var string $routeIdentifier */ + $routeIdentifier = $this->staticRouteMap[$httpMethod][$uri]; + return [self::FOUND, $routeIdentifier, []]; } if (isset($this->variableRouteData[$httpMethod])) { + /** @var array{0: int, 1?: string, 2?: array<string, string>} $result */ $result = $this->dispatchVariableRoute($this->variableRouteData[$httpMethod], $uri); if ($result[0] === self::FOUND) { + /** @var array{int, string, array<string, string>} $result */ return [self::FOUND, $result[1], $result[2]]; } } @@ -72,7 +82,7 @@ private function routingResults(string $httpMethod, string $uri): array /** * @param string $uri * - * @return array + * @return string[] */ public function getAllowedMethods(string $uri): array { @@ -80,20 +90,20 @@ public function getAllowedMethods(string $uri): array return $this->allowedMethods[$uri]; } - $this->allowedMethods[$uri] = []; + $allowedMethods = []; foreach ($this->staticRouteMap as $method => $uriMap) { if (isset($uriMap[$uri])) { - $this->allowedMethods[$uri][] = $method; + $allowedMethods[$method] = true; } } foreach ($this->variableRouteData as $method => $routeData) { $result = $this->dispatchVariableRoute($routeData, $uri); if ($result[0] === self::FOUND) { - $this->allowedMethods[$uri][] = $method; + $allowedMethods[$method] = true; } } - return $this->allowedMethods[$uri]; + return $this->allowedMethods[$uri] = array_keys($allowedMethods); } } diff --git a/vendor/slim/slim/Slim/Routing/Route.php b/vendor/slim/slim/Slim/Routing/Route.php index 47badf8233..a2d9d04a2d 100644 --- a/vendor/slim/slim/Slim/Routing/Route.php +++ b/vendor/slim/slim/Slim/Routing/Route.php @@ -33,6 +33,10 @@ use function in_array; use function is_array; +/** + * @api + * @template TContainerInterface of (ContainerInterface|null) + */ class Route implements RouteInterface, RequestHandlerInterface { /** @@ -40,59 +44,49 @@ class Route implements RouteInterface, RequestHandlerInterface * * @var string[] */ - protected $methods = []; + protected array $methods = []; /** * Route identifier - * - * @var string */ - protected $identifier; + protected string $identifier; /** * Route name - * - * @var null|string */ - protected $name; + protected ?string $name = null; /** * Parent route groups * * @var RouteGroupInterface[] */ - protected $groups; + protected array $groups; - /** - * @var InvocationStrategyInterface - */ - protected $invocationStrategy; + protected InvocationStrategyInterface $invocationStrategy; /** * Route parameters * - * @var array + * @var array<string, string> */ - protected $arguments = []; + protected array $arguments = []; /** * Route arguments parameters * - * @var array + * @var string[] */ - protected $savedArguments = []; + protected array $savedArguments = []; /** * Container - * - * @var ContainerInterface|null + * @var TContainerInterface $container */ - protected $container; + protected ?ContainerInterface $container = null; - /** - * @var MiddlewareDispatcher - */ - protected $middlewareDispatcher; + /** @var MiddlewareDispatcher<TContainerInterface> $middlewareDispatcher */ + protected MiddlewareDispatcher $middlewareDispatcher; /** * Route callable @@ -101,27 +95,16 @@ class Route implements RouteInterface, RequestHandlerInterface */ protected $callable; - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; - /** - * @var ResponseFactoryInterface - */ - protected $responseFactory; + protected ResponseFactoryInterface $responseFactory; /** * Route pattern - * - * @var string */ - protected $pattern; + protected string $pattern; - /** - * @var bool - */ - protected $groupMiddlewareAppended = false; + protected bool $groupMiddlewareAppended = false; /** * @param string[] $methods The route HTTP methods @@ -129,9 +112,9 @@ class Route implements RouteInterface, RequestHandlerInterface * @param callable|string $callable The route callable * @param ResponseFactoryInterface $responseFactory * @param CallableResolverInterface $callableResolver - * @param ContainerInterface|null $container + * @param TContainerInterface $container * @param InvocationStrategyInterface|null $invocationStrategy - * @param RouteGroup[] $groups The parent route groups + * @param RouteGroupInterface[] $groups The parent route groups * @param int $identifier The route identifier */ public function __construct( @@ -157,9 +140,6 @@ public function __construct( $this->middlewareDispatcher = new MiddlewareDispatcher($this, $callableResolver, $container); } - /** - * @return CallableResolverInterface - */ public function getCallableResolver(): CallableResolverInterface { return $this->callableResolver; @@ -312,7 +292,7 @@ public function addMiddleware(MiddlewareInterface $middleware): RouteInterface */ public function prepare(array $arguments): RouteInterface { - $this->arguments = array_replace($this->savedArguments, $arguments) ?? []; + $this->arguments = array_replace($this->savedArguments, $arguments); return $this; } @@ -349,7 +329,6 @@ protected function appendGroupMiddlewareToRoute(): void $inner = $this->middlewareDispatcher; $this->middlewareDispatcher = new MiddlewareDispatcher($inner, $this->callableResolver, $this->container); - /** @var RouteGroupInterface $group */ foreach (array_reverse($this->groups) as $group) { $group->appendMiddlewareToDispatcher($this->middlewareDispatcher); } @@ -369,10 +348,13 @@ public function handle(ServerRequestInterface $request): ResponseInterface } $strategy = $this->invocationStrategy; + /** @var string[] $strategyImplements */ + $strategyImplements = class_implements($strategy); + if ( is_array($callable) && $callable[0] instanceof RequestHandlerInterface - && !in_array(RequestHandlerInvocationStrategyInterface::class, class_implements($strategy)) + && !in_array(RequestHandlerInvocationStrategyInterface::class, $strategyImplements) ) { $strategy = new RequestHandler(); } diff --git a/vendor/slim/slim/Slim/Routing/RouteCollector.php b/vendor/slim/slim/Slim/Routing/RouteCollector.php index 0508c94000..6f9f0f66bb 100644 --- a/vendor/slim/slim/Slim/Routing/RouteCollector.php +++ b/vendor/slim/slim/Slim/Routing/RouteCollector.php @@ -17,6 +17,7 @@ use Slim\Interfaces\CallableResolverInterface; use Slim\Interfaces\InvocationStrategyInterface; use Slim\Interfaces\RouteCollectorInterface; +use Slim\Interfaces\RouteCollectorProxyInterface; use Slim\Interfaces\RouteGroupInterface; use Slim\Interfaces\RouteInterface; use Slim\Interfaces\RouteParserInterface; @@ -31,76 +32,58 @@ /** * RouteCollector is used to collect routes and route groups * as well as generate paths and URLs relative to its environment + * @template TContainerInterface of (ContainerInterface|null) */ class RouteCollector implements RouteCollectorInterface { - /** - * @var RouteParserInterface - */ - protected $routeParser; + protected RouteParserInterface $routeParser; - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; - /** - * @var ContainerInterface|null - */ - protected $container; + protected ?ContainerInterface $container = null; - /** - * @var InvocationStrategyInterface - */ - protected $defaultInvocationStrategy; + protected InvocationStrategyInterface $defaultInvocationStrategy; /** * Base path used in pathFor() - * - * @var string */ - protected $basePath = ''; + protected string $basePath = ''; /** * Path to fast route cache file. Set to null to disable route caching - * - * @var string|null */ - protected $cacheFile; + protected ?string $cacheFile = null; /** * Routes * * @var RouteInterface[] */ - protected $routes = []; + protected array $routes = []; /** - * Route groups + * Routes indexed by name * - * @var RouteGroup[] + * @var RouteInterface[] */ - protected $routeGroups = []; + protected array $routesByName = []; /** - * Route counter incrementer + * Route groups * - * @var int + * @var RouteGroupInterface[] */ - protected $routeCounter = 0; + protected array $routeGroups = []; /** - * @var ResponseFactoryInterface + * Route counter incrementer */ - protected $responseFactory; + protected int $routeCounter = 0; + + protected ResponseFactoryInterface $responseFactory; /** - * @param ResponseFactoryInterface $responseFactory - * @param CallableResolverInterface $callableResolver - * @param ContainerInterface|null $container - * @param InvocationStrategyInterface|null $defaultInvocationStrategy - * @param RouteParserInterface|null $routeParser - * @param string|null $cacheFile + * @param TContainerInterface $container */ public function __construct( ResponseFactoryInterface $responseFactory, @@ -121,9 +104,6 @@ public function __construct( } } - /** - * @return RouteParserInterface - */ public function getRouteParser(): RouteParserInterface { return $this->routeParser; @@ -131,18 +111,12 @@ public function getRouteParser(): RouteParserInterface /** * Get default route invocation strategy - * - * @return InvocationStrategyInterface */ public function getDefaultInvocationStrategy(): InvocationStrategyInterface { return $this->defaultInvocationStrategy; } - /** - * @param InvocationStrategyInterface $strategy - * @return self - */ public function setDefaultInvocationStrategy(InvocationStrategyInterface $strategy): RouteCollectorInterface { $this->defaultInvocationStrategy = $strategy; @@ -188,10 +162,6 @@ public function getBasePath(): string /** * Set the base path used in urlFor() - * - * @param string $basePath - * - * @return self */ public function setBasePath(string $basePath): RouteCollectorInterface { @@ -214,7 +184,9 @@ public function getRoutes(): array public function removeNamedRoute(string $name): RouteCollectorInterface { $route = $this->getNamedRoute($name); - unset($this->routes[$route->getIdentifier()]); + + /** @psalm-suppress PossiblyNullArrayOffset */ + unset($this->routesByName[$route->getName()], $this->routes[$route->getIdentifier()]); return $this; } @@ -223,11 +195,22 @@ public function removeNamedRoute(string $name): RouteCollectorInterface */ public function getNamedRoute(string $name): RouteInterface { + if (isset($this->routesByName[$name])) { + $route = $this->routesByName[$name]; + if ($route->getName() === $name) { + return $route; + } + + unset($this->routesByName[$name]); + } + foreach ($this->routes as $route) { if ($name === $route->getName()) { + $this->routesByName[$name] = $route; return $route; } } + throw new RuntimeException('Named route does not exist for name: ' . $name); } @@ -247,15 +230,7 @@ public function lookupRoute(string $identifier): RouteInterface */ public function group(string $pattern, $callable): RouteGroupInterface { - $routeCollectorProxy = new RouteCollectorProxy( - $this->responseFactory, - $this->callableResolver, - $this->container, - $this, - $pattern - ); - - $routeGroup = new RouteGroup($pattern, $callable, $this->callableResolver, $routeCollectorProxy); + $routeGroup = $this->createGroup($pattern, $callable); $this->routeGroups[] = $routeGroup; $routeGroup->collectRoutes(); @@ -264,6 +239,30 @@ public function group(string $pattern, $callable): RouteGroupInterface return $routeGroup; } + /** + * @param string|callable $callable + */ + protected function createGroup(string $pattern, $callable): RouteGroupInterface + { + $routeCollectorProxy = $this->createProxy($pattern); + return new RouteGroup($pattern, $callable, $this->callableResolver, $routeCollectorProxy); + } + + /** + * @return RouteCollectorProxyInterface<TContainerInterface> + */ + protected function createProxy(string $pattern): RouteCollectorProxyInterface + { + /** @var RouteCollectorProxyInterface<TContainerInterface> */ + return new RouteCollectorProxy( + $this->responseFactory, + $this->callableResolver, + $this->container, + $this, + $pattern + ); + } + /** * {@inheritdoc} */ @@ -271,13 +270,20 @@ public function map(array $methods, string $pattern, $handler): RouteInterface { $route = $this->createRoute($methods, $pattern, $handler); $this->routes[$route->getIdentifier()] = $route; + + $routeName = $route->getName(); + if ($routeName !== null && !isset($this->routesByName[$routeName])) { + $this->routesByName[$routeName] = $route; + } + $this->routeCounter++; return $route; } /** - * {@inheritdoc} + * @param string[] $methods + * @param callable|string $callable */ protected function createRoute(array $methods, string $pattern, $callable): RouteInterface { diff --git a/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php b/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php index 293740e33a..a946d148f0 100644 --- a/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php +++ b/vendor/slim/slim/Slim/Routing/RouteCollectorProxy.php @@ -18,39 +18,25 @@ use Slim\Interfaces\RouteGroupInterface; use Slim\Interfaces\RouteInterface; +/** + * @template TContainerInterface of (ContainerInterface|null) + * @template-implements RouteCollectorProxyInterface<TContainerInterface> + */ class RouteCollectorProxy implements RouteCollectorProxyInterface { - /** - * @var ResponseFactoryInterface - */ - protected $responseFactory; + protected ResponseFactoryInterface $responseFactory; - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; - /** - * @var ContainerInterface|null - */ - protected $container; + /** @var TContainerInterface */ + protected ?ContainerInterface $container = null; - /** - * @var RouteCollectorInterface - */ - protected $routeCollector; + protected RouteCollectorInterface $routeCollector; - /** - * @var string - */ - protected $groupPattern; + protected string $groupPattern; /** - * @param ResponseFactoryInterface $responseFactory - * @param CallableResolverInterface $callableResolver - * @param RouteCollectorInterface|null $routeCollector - * @param ContainerInterface|null $container - * @param string $groupPattern + * @param TContainerInterface $container */ public function __construct( ResponseFactoryInterface $responseFactory, @@ -84,6 +70,7 @@ public function getCallableResolver(): CallableResolverInterface /** * {@inheritdoc} + * @return TContainerInterface */ public function getContainer(): ?ContainerInterface { diff --git a/vendor/slim/slim/Slim/Routing/RouteContext.php b/vendor/slim/slim/Slim/Routing/RouteContext.php index 40b9892143..853b0df3e9 100644 --- a/vendor/slim/slim/Slim/Routing/RouteContext.php +++ b/vendor/slim/slim/Slim/Routing/RouteContext.php @@ -15,6 +15,7 @@ use Slim\Interfaces\RouteInterface; use Slim\Interfaces\RouteParserInterface; +/** @api */ final class RouteContext { public const ROUTE = '__route__'; @@ -25,10 +26,6 @@ final class RouteContext public const BASE_PATH = '__basePath__'; - /** - * @param ServerRequestInterface $serverRequest - * @return RouteContext - */ public static function fromRequest(ServerRequestInterface $serverRequest): self { $route = $serverRequest->getAttribute(self::ROUTE); @@ -40,35 +37,21 @@ public static function fromRequest(ServerRequestInterface $serverRequest): self throw new RuntimeException('Cannot create RouteContext before routing has been completed'); } + /** @var RouteInterface|null $route */ + /** @var RouteParserInterface $routeParser */ + /** @var RoutingResults $routingResults */ + /** @var string|null $basePath */ return new self($route, $routeParser, $routingResults, $basePath); } - /** - * @var RouteInterface|null - */ - private $route; - - /** - * @var RouteParserInterface - */ - private $routeParser; - - /** - * @var RoutingResults - */ - private $routingResults; - - /** - * @var string|null - */ - private $basePath; - - /** - * @param RouteInterface|null $route - * @param RouteParserInterface $routeParser - * @param RoutingResults $routingResults - * @param string|null $basePath - */ + private ?RouteInterface $route; + + private RouteParserInterface $routeParser; + + private RoutingResults $routingResults; + + private ?string $basePath; + private function __construct( ?RouteInterface $route, RouteParserInterface $routeParser, @@ -81,33 +64,21 @@ private function __construct( $this->basePath = $basePath; } - /** - * @return RouteInterface|null - */ public function getRoute(): ?RouteInterface { return $this->route; } - /** - * @return RouteParserInterface - */ public function getRouteParser(): RouteParserInterface { return $this->routeParser; } - /** - * @return RoutingResults - */ public function getRoutingResults(): RoutingResults { return $this->routingResults; } - /** - * @return string - */ public function getBasePath(): string { if ($this->basePath === null) { diff --git a/vendor/slim/slim/Slim/Routing/RouteGroup.php b/vendor/slim/slim/Slim/Routing/RouteGroup.php index c73d5ffa7c..60d3df3d8c 100644 --- a/vendor/slim/slim/Slim/Routing/RouteGroup.php +++ b/vendor/slim/slim/Slim/Routing/RouteGroup.php @@ -24,31 +24,23 @@ class RouteGroup implements RouteGroupInterface */ protected $callable; - /** - * @var CallableResolverInterface - */ - protected $callableResolver; + protected CallableResolverInterface $callableResolver; /** - * @var RouteCollectorProxyInterface + * @var RouteCollectorProxyInterface<\Psr\Container\ContainerInterface|null> */ - protected $routeCollectorProxy; + protected RouteCollectorProxyInterface $routeCollectorProxy; /** * @var MiddlewareInterface[]|string[]|callable[] */ - protected $middleware = []; + protected array $middleware = []; - /** - * @var string - */ - protected $pattern; + protected string $pattern; /** - * @param string $pattern * @param callable|string $callable - * @param CallableResolverInterface $callableResolver - * @param RouteCollectorProxyInterface $routeCollectorProxy + * @param RouteCollectorProxyInterface<\Psr\Container\ContainerInterface|null> $routeCollectorProxy */ public function __construct( string $pattern, @@ -96,6 +88,7 @@ public function addMiddleware(MiddlewareInterface $middleware): RouteGroupInterf /** * {@inheritdoc} + * @param MiddlewareDispatcher<\Psr\Container\ContainerInterface|null> $dispatcher */ public function appendMiddlewareToDispatcher(MiddlewareDispatcher $dispatcher): RouteGroupInterface { diff --git a/vendor/slim/slim/Slim/Routing/RouteParser.php b/vendor/slim/slim/Slim/Routing/RouteParser.php index a2b79277b4..afb533cc5a 100644 --- a/vendor/slim/slim/Slim/Routing/RouteParser.php +++ b/vendor/slim/slim/Slim/Routing/RouteParser.php @@ -24,19 +24,10 @@ class RouteParser implements RouteParserInterface { - /** - * @var RouteCollectorInterface - */ - private $routeCollector; + private RouteCollectorInterface $routeCollector; - /** - * @var Std - */ - private $routeParser; + private Std $routeParser; - /** - * @param RouteCollectorInterface $routeCollector - */ public function __construct(RouteCollectorInterface $routeCollector) { $this->routeCollector = $routeCollector; @@ -71,6 +62,7 @@ public function relativeUrlFor(string $routeName, array $data = [], array $query continue; } + /** @var string[] $segment */ /* * If we don't have a data element for this segment in the provided $data * we cancel testing to move onto the next expression with a less specific item diff --git a/vendor/slim/slim/Slim/Routing/RouteResolver.php b/vendor/slim/slim/Slim/Routing/RouteResolver.php index 30f07d5fd7..d4f4eafa32 100644 --- a/vendor/slim/slim/Slim/Routing/RouteResolver.php +++ b/vendor/slim/slim/Slim/Routing/RouteResolver.php @@ -24,20 +24,10 @@ */ class RouteResolver implements RouteResolverInterface { - /** - * @var RouteCollectorInterface - */ - protected $routeCollector; + protected RouteCollectorInterface $routeCollector; - /** - * @var DispatcherInterface - */ - private $dispatcher; + private DispatcherInterface $dispatcher; - /** - * @param RouteCollectorInterface $routeCollector - * @param DispatcherInterface|null $dispatcher - */ public function __construct(RouteCollectorInterface $routeCollector, ?DispatcherInterface $dispatcher = null) { $this->routeCollector = $routeCollector; @@ -46,8 +36,6 @@ public function __construct(RouteCollectorInterface $routeCollector, ?Dispatcher /** * @param string $uri Should be $request->getUri()->getPath() - * @param string $method - * @return RoutingResults */ public function computeRoutingResults(string $uri, string $method): RoutingResults { @@ -59,8 +47,6 @@ public function computeRoutingResults(string $uri, string $method): RoutingResul } /** - * @param string $identifier - * @return RouteInterface * @throws RuntimeException */ public function resolveRoute(string $identifier): RouteInterface diff --git a/vendor/slim/slim/Slim/Routing/RouteRunner.php b/vendor/slim/slim/Slim/Routing/RouteRunner.php index 50c11f29c3..3fb5413527 100644 --- a/vendor/slim/slim/Slim/Routing/RouteRunner.php +++ b/vendor/slim/slim/Slim/Routing/RouteRunner.php @@ -22,25 +22,17 @@ class RouteRunner implements RequestHandlerInterface { - /** - * @var RouteResolverInterface - */ - private $routeResolver; + private RouteResolverInterface $routeResolver; - /** - * @var RouteParserInterface - */ - private $routeParser; + private RouteParserInterface $routeParser; /** - * @var RouteCollectorProxyInterface|null + * @var RouteCollectorProxyInterface<\Psr\Container\ContainerInterface|null> */ - private $routeCollectorProxy; + private ?RouteCollectorProxyInterface $routeCollectorProxy; /** - * @param RouteResolverInterface $routeResolver - * @param RouteParserInterface $routeParser - * @param RouteCollectorProxyInterface|null $routeCollectorProxy + * @param RouteCollectorProxyInterface<\Psr\Container\ContainerInterface|null> $routeCollectorProxy */ public function __construct( RouteResolverInterface $routeResolver, @@ -59,8 +51,6 @@ public function __construct( * defined middleware stack. In the event that the user did not perform routing * it is done here * - * @param ServerRequestInterface $request - * @return ResponseInterface * @throws HttpNotFoundException * @throws HttpMethodNotAllowedException */ @@ -79,7 +69,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface ); } - /** @var Route $route */ + /** @var Route<\Psr\Container\ContainerInterface|null> $route */ $route = $request->getAttribute(RouteContext::ROUTE); return $route->run($request); } diff --git a/vendor/slim/slim/Slim/Routing/RoutingResults.php b/vendor/slim/slim/Slim/Routing/RoutingResults.php index b67abe28bf..4fd8973f85 100644 --- a/vendor/slim/slim/Slim/Routing/RoutingResults.php +++ b/vendor/slim/slim/Slim/Routing/RoutingResults.php @@ -14,53 +14,36 @@ use function rawurldecode; +/** @api */ class RoutingResults { public const NOT_FOUND = 0; public const FOUND = 1; public const METHOD_NOT_ALLOWED = 2; - /** - * @var DispatcherInterface - */ - protected $dispatcher; + protected DispatcherInterface $dispatcher; - /** - * @var string - */ - protected $method; + protected string $method; - /** - * @var string - */ - protected $uri; + protected string $uri; /** - * @var int * The status is one of the constants shown above * NOT_FOUND = 0 * FOUND = 1 * METHOD_NOT_ALLOWED = 2 */ - protected $routeStatus; + protected int $routeStatus; - /** - * @var null|string - */ - protected $routeIdentifier; + protected ?string $routeIdentifier = null; /** - * @var array + * @var array<string, string> */ - protected $routeArguments; + protected array $routeArguments; /** - * @param DispatcherInterface $dispatcher - * @param string $method - * @param string $uri - * @param int $routeStatus - * @param string|null $routeIdentifier - * @param array $routeArguments + * @param array<string, string> $routeArguments */ public function __construct( DispatcherInterface $dispatcher, @@ -78,49 +61,33 @@ public function __construct( $this->routeArguments = $routeArguments; } - /** - * @return DispatcherInterface - */ public function getDispatcher(): DispatcherInterface { return $this->dispatcher; } - /** - * @return string - */ public function getMethod(): string { return $this->method; } - /** - * @return string - */ public function getUri(): string { return $this->uri; } - /** - * @return int - */ public function getRouteStatus(): int { return $this->routeStatus; } - /** - * @return null|string - */ public function getRouteIdentifier(): ?string { return $this->routeIdentifier; } /** - * @param bool $urlDecode - * @return array + * @return array<string, string> */ public function getRouteArguments(bool $urlDecode = true): array { @@ -137,7 +104,7 @@ public function getRouteArguments(bool $urlDecode = true): array } /** - * @return array + * @return string[] */ public function getAllowedMethods(): array { diff --git a/vendor/slim/slim/composer.json b/vendor/slim/slim/composer.json index a341551f87..fdbc786b29 100644 --- a/vendor/slim/slim/composer.json +++ b/vendor/slim/slim/composer.json @@ -32,31 +32,44 @@ "homepage": "http://gabrielmanricks.com" } ], + "support": { + "docs": "https://www.slimframework.com/docs/v4/", + "forum": "https://discourse.slimframework.com/", + "irc": "irc://irc.freenode.net:6667/slimphp", + "issues": "https://github.com/slimphp/Slim/issues", + "rss": "https://www.slimframework.com/blog/feed.rss", + "slack": "https://slimphp.slack.com/", + "source": "https://github.com/slimphp/Slim", + "wiki": "https://github.com/slimphp/Slim/wiki" + }, "require": { - "php": "^7.2", + "php": "^7.4 || ^8.0", "ext-json": "*", "nikic/fast-route": "^1.3", - "psr/container": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/container": "^1.0 || ^2.0", + "psr/http-factory": "^1.1", + "psr/http-message": "^1.1 || ^2.0", "psr/http-server-handler": "^1.0", "psr/http-server-middleware": "^1.0", - "psr/log": "^1.1" + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "require-dev": { "ext-simplexml": "*", - "adriansuter/php-autoload-override": "^1.0", - "guzzlehttp/psr7": "^1.5", - "http-interop/http-factory-guzzle": "^1.0", - "laminas/laminas-diactoros": "^2.1", - "nyholm/psr7": "^1.1", - "nyholm/psr7-server": "^0.3.0", - "phpspec/prophecy": "^1.10", - "phpstan/phpstan": "^0.11.5", - "phpunit/phpunit": "^8.5", - "slim/http": "^1.0", - "slim/psr7": "^1.0", - "squizlabs/php_codesniffer": "^3.5" + "adriansuter/php-autoload-override": "^1.4", + "guzzlehttp/psr7": "^2.6", + "httpsoft/http-message": "^1.1", + "httpsoft/http-server-request": "^1.1", + "laminas/laminas-diactoros": "^2.17 || ^3", + "nyholm/psr7": "^1.8", + "nyholm/psr7-server": "^1.1", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.1", + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^9.6", + "slim/http": "^1.3", + "slim/psr7": "^1.6", + "squizlabs/php_codesniffer": "^3.10", + "vimeo/psalm": "^5.24" }, "autoload": { "psr-4": { @@ -72,11 +85,13 @@ "test": [ "@phpunit", "@phpcs", - "@phpstan" + "@phpstan", + "@psalm" ], "phpunit": "phpunit", "phpcs": "phpcs", - "phpstan": "phpstan analyse Slim --memory-limit=-1" + "phpstan": "phpstan --memory-limit=-1", + "psalm": "psalm --no-cache" }, "suggest": { "ext-simplexml": "Needed to support XML format in BodyParsingMiddleware", diff --git a/vendor/slim/slim/psalm.xml b/vendor/slim/slim/psalm.xml new file mode 100644 index 0000000000..af258ff893 --- /dev/null +++ b/vendor/slim/slim/psalm.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<psalm + errorLevel="3" + resolveFromConfigFile="true" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns="https://getpsalm.org/schema/config" + xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + findUnusedBaselineEntry="true" + findUnusedCode="true" +> + <projectFiles> + <directory name="Slim" /> + <ignoreFiles> + <directory name="vendor" /> + </ignoreFiles> + </projectFiles> +</psalm> diff --git a/vendor/smarty/smarty/CHANGELOG.md b/vendor/smarty/smarty/CHANGELOG.md index 7eb151bf80..fab8301d52 100644 --- a/vendor/smarty/smarty/CHANGELOG.md +++ b/vendor/smarty/smarty/CHANGELOG.md @@ -6,6 +6,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.1.46] - 2022-08-01 + +### Fixed +- Fixed problems with smarty_mb_str_replace [#549](https://github.com/smarty-php/smarty/issues/549) +- Fixed second parameter of unescape modifier not working [#777](https://github.com/smarty-php/smarty/issues/777) + +## [3.1.45] - 2022-05-17 + +### Security +- Prevent PHP injection through malicious block name or include file name. This addresses CVE-2022-29221 + +### Fixed +- Math equation `max(x, y)` didn't work anymore [#721](https://github.com/smarty-php/smarty/issues/721) + +## [3.1.44] - 2022-01-18 + +### Fixed +- Fixed illegal characters bug in math function security check [#702](https://github.com/smarty-php/smarty/issues/702) + +## [3.1.43] - 2022-01-10 + +### Security +- Prevent evasion of the `static_classes` security policy. This addresses CVE-2021-21408 + +## [3.1.42] - 2022-01-10 + +### Security +- Prevent arbitrary PHP code execution through maliciously crafted expression for the math function. This addresses CVE-2021-29454 + +## [3.1.41] - 2022-01-09 + +### Security +- Rewrote the mailto function to not use `eval` when encoding with javascript + +## [3.1.40] - 2021-10-13 + +### Changed +- modifier escape now triggers a E_USER_NOTICE when an unsupported escape type is used https://github.com/smarty-php/smarty/pull/649 + +### Security +- More advanced javascript escaping to handle https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements thanks to m-haritonov + +## [3.1.39] - 2021-02-17 + +### Security +- Prevent access to `$smarty.template_object` in sandbox mode. This addresses CVE-2021-26119. +- Fixed code injection vulnerability by using illegal function names in `{function name='blah'}{/function}`. This addresses CVE-2021-26120. + +## [3.1.38] - 2021-01-08 + +### Fixed +- Smarty::SMARTY_VERSION wasn't updated https://github.com/smarty-php/smarty/issues/628 + +## [3.1.37] - 2021-01-07 + +### Changed +- Changed error handlers and handling of undefined constants for php8-compatibility (set $errcontext argument optional) https://github.com/smarty-php/smarty/issues/605 +- Changed expected error levels in unit tests for php8-compatibility +- Travis unit tests now run for all php versions >= 5.3, including php8 +- Travis runs on Xenial where possible + +### Fixed +- PHP5.3 compatibility fixes +- Brought lexer source functionally up-to-date with compiled version + ## [3.1.36] - 2020-04-14 ### Fixed diff --git a/vendor/smarty/smarty/LICENSE b/vendor/smarty/smarty/LICENSE index fb8ca6c6fb..595e5993da 100644 --- a/vendor/smarty/smarty/LICENSE +++ b/vendor/smarty/smarty/LICENSE @@ -3,7 +3,7 @@ Smarty: the PHP compiling template engine This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/vendor/smarty/smarty/README.md b/vendor/smarty/smarty/README.md index ee7edb1abf..b57969c48c 100644 --- a/vendor/smarty/smarty/README.md +++ b/vendor/smarty/smarty/README.md @@ -18,7 +18,7 @@ Smarty can be run with PHP 5.2 to PHP 7.4. > Read the NEW_FEATURES and INHERITANCE_RELEASE_NOTES file for recent extensions to Smarty 3.1 functionality -Smarty versions 3.1.11 or later are now on github and can be installed with Composer. +Smarty versions 3.1.11 or later are now on GitHub and can be installed with Composer. The "smarty/smarty" package will start at libs/.... subfolder. diff --git a/vendor/smarty/smarty/SECURITY.md b/vendor/smarty/smarty/SECURITY.md new file mode 100644 index 0000000000..d98ea01897 --- /dev/null +++ b/vendor/smarty/smarty/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Supported Versions + +Smarty currently supports the latest minor version of Smarty 3 and Smarty 4. (Smarty 4 has not been released yet.) + +| Version | Supported | +| ------- | ------------------ | +| 4.0.x | :white_check_mark: | +| 3.1.x | :white_check_mark: | +| < 3.1 | :x: | + +## Reporting a Vulnerability + + If you have discovered a security issue with Smarty, please contact us at mail [at] simonwisselink.nl. Do not + disclose your findings publicly and PLEASE PLEASE do not file an Issue. + +We will try to confirm the vulnerability and develop a fix if appropriate. When we release the fix, we will publish +a security release. Please let us know if you want to be credited. diff --git a/vendor/smarty/smarty/composer.json b/vendor/smarty/smarty/composer.json index 889cb94448..183f9f240b 100644 --- a/vendor/smarty/smarty/composer.json +++ b/vendor/smarty/smarty/composer.json @@ -40,7 +40,7 @@ } }, "require-dev": { - "phpunit/phpunit": "6.4.1", + "phpunit/phpunit": "^7.5 || ^6.5 || ^5.7 || ^4.8", "smarty/smarty-lexer": "^3.1" } } diff --git a/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y b/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y index b8c00e5d97..8f81202169 100644 --- a/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y +++ b/vendor/smarty/smarty/lexer/smarty_internal_templateparser.y @@ -249,7 +249,13 @@ template ::= template PHP(B). { // template text template ::= template TEXT(B). { - $this->current_buffer->append_subtree($this, $this->compiler->processText(B)); + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($text, $this->strip)); } // strip on template ::= template STRIPON. { @@ -308,7 +314,7 @@ smartytag(A)::= SIMPLETAG(B). { $tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); if ($tag == 'strip') { $this->strip = true; - A = null;; + A = null; } else { if (defined($tag)) { if ($this->security) { @@ -752,6 +758,9 @@ value(res) ::= doublequoted_with_quotes(s). { value(res) ::= varindexed(vi) DOUBLECOLON static_class_access(r). { + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } $prefixVar = $this->compiler->getNewPrefixVariable(); if (vi['var'] === '\'smarty\'') { $this->compiler->appendPrefixCode("<?php {$prefixVar} = ". $this->compiler->compileTag('private_special_variable',array(),vi['smarty_internal_index']).';?>'); diff --git a/vendor/smarty/smarty/libs/Smarty.class.php b/vendor/smarty/smarty/libs/Smarty.class.php index 9e0ca7670e..77eb28e724 100644 --- a/vendor/smarty/smarty/libs/Smarty.class.php +++ b/vendor/smarty/smarty/libs/Smarty.class.php @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * version 3.0 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,7 +27,6 @@ * @author Uwe Tews <uwe dot tews at gmail dot com> * @author Rodney Rehm * @package Smarty - * @version 3.1.34-dev */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -112,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.36'; + const SMARTY_VERSION = '3.1.46'; /** * define variable scopes */ @@ -800,7 +799,7 @@ public function addTemplateDir($template_dir, $key = null, $isConfig = false) * @param mixed $index index of directory to get, null to get all * @param bool $isConfig true for config_dir * - * @return array list of template directories, or directory of $index + * @return array|string list of template directories, or directory of $index */ public function getTemplateDir($index = null, $isConfig = false) { diff --git a/vendor/smarty/smarty/libs/SmartyBC.class.php b/vendor/smarty/smarty/libs/SmartyBC.class.php index 836f98153a..0550e46dc5 100644 --- a/vendor/smarty/smarty/libs/SmartyBC.class.php +++ b/vendor/smarty/smarty/libs/SmartyBC.class.php @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * version 3.0 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU diff --git a/vendor/smarty/smarty/libs/plugins/function.mailto.php b/vendor/smarty/smarty/libs/plugins/function.mailto.php index 27351df826..8faf696afe 100644 --- a/vendor/smarty/smarty/libs/plugins/function.mailto.php +++ b/vendor/smarty/smarty/libs/plugins/function.mailto.php @@ -94,22 +94,19 @@ function smarty_function_mailto($params) ); return; } - // FIXME: (rodneyrehm) document.write() excues me what? 1998 has passed! if ($encode === 'javascript') { - $string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');'; + $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>'; $js_encode = ''; for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[ $x ]); } - return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>'; + return '<script type="text/javascript">document.write(unescape(\'' . $js_encode . '\'))</script>'; } elseif ($encode === 'javascript_charcode') { $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>'; - for ($x = 0, $y = strlen($string); $x < $y; $x++) { + for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $ord[] = ord($string[ $x ]); } - $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n" . "{document.write(String.fromCharCode(" . - implode(',', $ord) . "))" . "}\n" . "</script>\n"; - return $_ret; + return '<script type="text/javascript">document.write(String.fromCharCode(' . implode(',', $ord) . '))</script>'; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[ 2 ])) { diff --git a/vendor/smarty/smarty/libs/plugins/function.math.php b/vendor/smarty/smarty/libs/plugins/function.math.php index 7348d96494..d5f86a6940 100644 --- a/vendor/smarty/smarty/libs/plugins/function.math.php +++ b/vendor/smarty/smarty/libs/plugins/function.math.php @@ -28,7 +28,12 @@ function smarty_function_math($params, $template) 'int' => true, 'abs' => true, 'ceil' => true, + 'acos' => true, + 'acosh' => true, 'cos' => true, + 'cosh' => true, + 'deg2rad' => true, + 'rad2deg' => true, 'exp' => true, 'floor' => true, 'log' => true, @@ -39,27 +44,51 @@ function smarty_function_math($params, $template) 'pow' => true, 'rand' => true, 'round' => true, + 'asin' => true, + 'asinh' => true, 'sin' => true, + 'sinh' => true, 'sqrt' => true, 'srand' => true, - 'tan' => true + 'atan' => true, + 'atanh' => true, + 'tan' => true, + 'tanh' => true ); + // be sure equation parameter is present if (empty($params[ 'equation' ])) { trigger_error("math: missing equation parameter", E_USER_WARNING); return; } $equation = $params[ 'equation' ]; + + // Remove whitespaces + $equation = preg_replace('/\s+/', '', $equation); + + // Adapted from https://www.php.net/manual/en/function.eval.php#107377 + $number = '(?:\d+(?:[,.]\d+)?|pi|Ï€)'; // What is a number + $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; + $operators = '[,+\/*\^%-]'; // Allowed math operators + $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)+\)|\((?1)+\)))(?:'.$operators.'(?1))?)+$/'; + + if (!preg_match($regexp, $equation)) { + trigger_error("math: illegal characters", E_USER_WARNING); + return; + } + // make sure parenthesis are balanced if (substr_count($equation, '(') !== substr_count($equation, ')')) { trigger_error("math: unbalanced parenthesis", E_USER_WARNING); return; } + // disallow backticks if (strpos($equation, '`') !== false) { trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); return; } + // also disallow dollar signs if (strpos($equation, '$') !== false) { trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); @@ -96,6 +125,7 @@ function smarty_function_math($params, $template) } $smarty_math_result = null; eval("\$smarty_math_result = " . $equation . ";"); + if (empty($params[ 'format' ])) { if (empty($params[ 'assign' ])) { return $smarty_math_result; diff --git a/vendor/smarty/smarty/libs/plugins/modifier.escape.php b/vendor/smarty/smarty/libs/plugins/modifier.escape.php index 150901c7c7..43353cfc6d 100644 --- a/vendor/smarty/smarty/libs/plugins/modifier.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifier.escape.php @@ -184,7 +184,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ '"' => '\\"', "\r" => '\\r', "\n" => '\\n', - '</' => '<\/' + '</' => '<\/', + // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements + '<!--' => '<\!--', + '<s' => '<\s', + '<S' => '<\S' ) ); case 'mail': @@ -250,6 +254,7 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ } return $return; default: + trigger_error("escape: unsupported type: $esc_type - returning unmodified string", E_USER_NOTICE); return $string; } } diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php index e0763adceb..a3048a0354 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.escape.php @@ -89,9 +89,10 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[ 0 ] . ')'; case 'javascript': // escape quotes and backslashes, newlines, etc. + // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements return 'strtr(' . $params[ 0 ] . - ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))'; + ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/", "<!--" => "<\!--", "<s" => "<\s", "<S" => "<\S" ))'; } } catch (SmartyException $e) { // pass through to regular plugin fallback diff --git a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php index 05beb81f5c..3438fe3e07 100644 --- a/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php +++ b/vendor/smarty/smarty/libs/plugins/modifiercompiler.unescape.php @@ -14,20 +14,28 @@ * @author Rodney Rehm * * @param array $params parameters + * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code */ -function smarty_modifiercompiler_unescape($params) +function smarty_modifiercompiler_unescape($params, Smarty_Internal_TemplateCompilerBase $compiler) { - if (!isset($params[ 1 ])) { - $params[ 1 ] = 'html'; - } + $compiler->template->_checkPlugins( + array( + array( + 'function' => 'smarty_literal_compiler_param', + 'file' => SMARTY_PLUGINS_DIR . 'shared.literal_compiler_param.php' + ) + ) + ); + + $esc_type = smarty_literal_compiler_param($params, 1, 'html'); + if (!isset($params[ 2 ])) { $params[ 2 ] = '\'' . addslashes(Smarty::$_CHARSET) . '\''; - } else { - $params[ 2 ] = "'{$params[ 2 ]}'"; } - switch (trim($params[ 1 ], '"\'')) { + + switch ($esc_type) { case 'entity': case 'htmlall': if (Smarty::$_MBSTRING) { diff --git a/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php b/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php index 206cf9ea6b..6366205bfb 100644 --- a/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php +++ b/vendor/smarty/smarty/libs/plugins/shared.mb_str_replace.php @@ -44,9 +44,43 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) } } } else { + $mb_reg_charset = mb_regex_encoding(); + // Check if mbstring regex is using UTF-8 + $reg_is_unicode = !strcasecmp($mb_reg_charset, "UTF-8"); + if(!$reg_is_unicode) { + // ...and set to UTF-8 if not + mb_regex_encoding("UTF-8"); + } + + // See if charset used by Smarty is matching one used by regex... + $current_charset = mb_regex_encoding(); + $convert_result = (bool)strcasecmp(Smarty::$_CHARSET, $current_charset); + if($convert_result) { + // ...convert to it if not. + $subject = mb_convert_encoding($subject, $current_charset, Smarty::$_CHARSET); + $search = mb_convert_encoding($search, $current_charset, Smarty::$_CHARSET); + $replace = mb_convert_encoding($replace, $current_charset, Smarty::$_CHARSET); + } + $parts = mb_split(preg_quote($search), $subject); + // If original regex encoding was not unicode... + if(!$reg_is_unicode) { + // ...restore original regex encoding to avoid breaking the system. + mb_regex_encoding($mb_reg_charset); + } + if($parts === false) { + // This exception is thrown if call to mb_split failed. + // Usually it happens, when $search or $replace are not valid for given mb_regex_encoding(). + // There may be other cases for it to fail, please file an issue if you find a reproducible one. + throw new SmartyException("Source string is not a valid $current_charset sequence (probably)"); + } + $count = count($parts) - 1; $subject = implode($replace, $parts); + // Convert results back to charset used by Smarty, if needed. + if($convert_result) { + $subject = mb_convert_encoding($subject, Smarty::$_CHARSET, $current_charset); + } } return $subject; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php index 8ff15d8e5b..cbaccd2b30 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_block.php @@ -125,7 +125,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ // setup buffer for template function code $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); $output = "<?php\n"; - $output .= "/* {block {$_name}} */\n"; + $output .= $compiler->cStyleComment(" {block {$_name}} ") . "\n"; $output .= "class {$_className} extends Smarty_Internal_Block\n"; $output .= "{\n"; foreach ($_block as $property => $value) { @@ -155,7 +155,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ } $output .= "}\n"; $output .= "}\n"; - $output .= "/* {/block {$_name}} */\n\n"; + $output .= $compiler->cStyleComment(" {/block {$_name}} ") . "\n\n"; $output .= "?>\n"; $compiler->parser->current_buffer->append_subtree( $compiler->parser, diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php index 6e408ca724..1b73a6ba67 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_function.php @@ -58,6 +58,11 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) } unset($_attr[ 'nocache' ]); $_name = trim($_attr[ 'name' ], '\'"'); + + if (!preg_match('/^[a-zA-Z0-9_\x80-\xff]+$/', $_name)) { + $compiler->trigger_template_error("Function name contains invalid characters: {$_name}", null, true); + } + $compiler->parent_compiler->tpl_function[ $_name ] = array(); $save = array( $_attr, $compiler->parser->current_buffer, $compiler->template->compiled->has_nocache_code, @@ -129,7 +134,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) if ($compiler->template->compiled->has_nocache_code) { $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name_caching' ] = $_funcNameCaching; $output = "<?php\n"; - $output .= "/* {$_funcNameCaching} */\n"; + $output .= $compiler->cStyleComment(" {$_funcNameCaching} ") . "\n"; $output .= "if (!function_exists('{$_funcNameCaching}')) {\n"; $output .= "function {$_funcNameCaching} (Smarty_Internal_Template \$_smarty_tpl,\$params) {\n"; $output .= "ob_start();\n"; @@ -154,7 +159,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\";\n?>"; $output .= "<?php echo str_replace('{$compiler->template->compiled->nocache_hash}', \$_smarty_tpl->compiled->nocache_hash, ob_get_clean());\n"; $output .= "}\n}\n"; - $output .= "/*/ {$_funcName}_nocache */\n\n"; + $output .= $compiler->cStyleComment("/ {$_funcName}_nocache ") . "\n\n"; $output .= "?>\n"; $compiler->parser->current_buffer->append_subtree( $compiler->parser, @@ -174,7 +179,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) } $compiler->parent_compiler->tpl_function[ $_name ][ 'call_name' ] = $_funcName; $output = "<?php\n"; - $output .= "/* {$_funcName} */\n"; + $output .= $compiler->cStyleComment(" {$_funcName} ") . "\n"; $output .= "if (!function_exists('{$_funcName}')) {\n"; $output .= "function {$_funcName}(Smarty_Internal_Template \$_smarty_tpl,\$params) {\n"; $output .= $_paramsCode; @@ -191,7 +196,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) ); $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); $output = "<?php\n}}\n"; - $output .= "/*/ {$_funcName} */\n\n"; + $output .= $compiler->cStyleComment("/ {$_funcName} ") . "\n\n"; $output .= "?>\n"; $compiler->parser->current_buffer->append_subtree( $compiler->parser, diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php index 716c91d49b..bf62461bca 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_include.php @@ -318,14 +318,14 @@ public function compileInlineTemplate( } // get compiled code $compiled_code = "<?php\n\n"; - $compiled_code .= "/* Start inline template \"{$sourceInfo}\" =============================*/\n"; + $compiled_code .= $compiler->cStyleComment(" Start inline template \"{$sourceInfo}\" =============================") . "\n"; $compiled_code .= "function {$tpl->compiled->unifunc} (Smarty_Internal_Template \$_smarty_tpl) {\n"; $compiled_code .= "?>\n" . $tpl->compiler->compileTemplateSource($tpl, null, $compiler->parent_compiler); $compiled_code .= "<?php\n"; $compiled_code .= "}\n?>\n"; $compiled_code .= $tpl->compiler->postFilter($tpl->compiler->blockOrFunctionCode); $compiled_code .= "<?php\n\n"; - $compiled_code .= "/* End inline template \"{$sourceInfo}\" =============================*/\n"; + $compiled_code .= $compiler->cStyleComment(" End inline template \"{$sourceInfo}\" =============================") . "\n"; $compiled_code .= '?>'; unset($tpl->compiler); if ($tpl->compiled->has_nocache_code) { diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php index b317c9f33b..d53ef51ff1 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -81,6 +81,10 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ case 'template': return 'basename($_smarty_tpl->source->filepath)'; case 'template_object': + if (isset($compiler->smarty->security_policy)) { + $compiler->trigger_template_error("(secure mode) template_object not permitted"); + break; + } return '$_smarty_tpl'; case 'current_dir': return 'dirname($_smarty_tpl->source->filepath)'; @@ -94,9 +98,9 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ break; } if (strpos($_index[ 1 ], '$') === false && strpos($_index[ 1 ], '\'') === false) { - return "@constant('{$_index[1]}')"; + return "(defined('{$_index[1]}') ? constant('{$_index[1]}') : null)"; } else { - return "@constant({$_index[1]})"; + return "(defined({$_index[1]}) ? constant({$_index[1]}) : null)"; } // no break case 'config': diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php index a842fa8f32..469b9667a3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -115,7 +115,7 @@ public function compileTemplate(Smarty_Internal_Template $template) $this->smarty->_debug->start_compile($this->template); } // init the lexer/parser to compile the config file - /* @var Smarty_Internal_ConfigFileLexer $this ->lex */ + /* @var Smarty_Internal_ConfigFileLexer $this->lex */ $this->lex = new $this->lexer_class( str_replace( array( @@ -127,7 +127,7 @@ public function compileTemplate(Smarty_Internal_Template $template) ) . "\n", $this ); - /* @var Smarty_Internal_ConfigFileParser $this ->parser */ + /* @var Smarty_Internal_ConfigFileParser $this->parser */ $this->parser = new $this->parser_class($this->lex, $this); if (function_exists('mb_internal_encoding') && function_exists('ini_get') @@ -157,10 +157,12 @@ public function compileTemplate(Smarty_Internal_Template $template) $this->smarty->_debug->end_compile($this->template); } // template header code - $template_header = - "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . - "\n"; - $template_header .= " compiled from '{$this->template->source->filepath}' */ ?>\n"; + $template_header = sprintf( + "<?php /* Smarty version %s, created on %s\n compiled from '%s' */ ?>\n", + Smarty::SMARTY_VERSION, + date("Y-m-d H:i:s"), + str_replace('*/', '* /' , $this->template->source->filepath) + ); $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' . var_export($this->config_data, true) . '); ?>'; return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code); diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php index 0ba00659dc..56dca18fa9 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_errorhandler.php @@ -65,7 +65,7 @@ public static function muteExpectedErrors() * * @return bool */ - public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) + public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext = array()) { $_is_muted_directory = false; // add the SMARTY_DIR to the list of muted directories diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php index 477232ef82..ab4c3ec3b6 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_parsetree_template.php @@ -127,12 +127,12 @@ public function to_smarty_php(Smarty_Internal_Templateparser $parser) } private function getChunkedSubtrees() { - $chunks = []; + $chunks = array(); $currentMode = null; - $currentChunk = []; + $currentChunk = array(); for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) { - if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, ['textstripped', 'text', 'tag'])) { + if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, array('textstripped', 'text', 'tag'))) { continue; } @@ -150,19 +150,19 @@ private function getChunkedSubtrees() { if ($newMode == $currentMode) { $currentChunk[] = $this->subtrees[ $key ]; } else { - $chunks[] = [ + $chunks[] = array( 'mode' => $currentMode, 'subtrees' => $currentChunk - ]; + ); $currentMode = $newMode; - $currentChunk = [$this->subtrees[ $key ]]; + $currentChunk = array($this->subtrees[ $key ]); } } if ($currentMode && $currentChunk) { - $chunks[] = [ + $chunks[] = array( 'mode' => $currentMode, 'subtrees' => $currentChunk - ]; + ); } return $chunks; } diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php index 983ca6180f..4a7781c446 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -44,9 +44,12 @@ public function create( $properties[ 'file_dependency' ] = $_template->cached->file_dependency; $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; } - $output = "<?php\n"; - $output .= "/* Smarty version {$properties[ 'version' ]}, created on " . strftime("%Y-%m-%d %H:%M:%S") . - "\n from '" . str_replace('*/', '* /', $_template->source->filepath) . "' */\n\n"; + $output = sprintf( + "<?php\n/* Smarty version %s, created on %s\n from '%s' */\n\n", + $properties[ 'version' ], + date("Y-m-d H:i:s"), + str_replace('*/', '* /', $_template->source->filepath) + ); $output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n"; $dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' . ($cache ? 'true' : 'false') . ')'; diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php index 3cc957dece..b4e270c188 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -1455,6 +1455,10 @@ public function compileCheckPlugins($requiredPlugins) */ abstract protected function doCompile($_content, $isTemplateSource = false); + public function cStyleComment($string) { + return '/*' . str_replace('*/', '* /' , $string) . '*/'; + } + /** * Compile Tag * diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php index aaeae63b71..7c8735cfd3 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templateparser.php @@ -2837,6 +2837,10 @@ public function yy_r91() // line 765 "../smarty/lexer/smarty_internal_templateparser.y" public function yy_r95() { + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\'smarty\'') { $this->compiler->appendPrefixCode("<?php {$prefixVar} = " . diff --git a/vendor/symfony/polyfill-intl-idn/Idn.php b/vendor/symfony/polyfill-intl-idn/Idn.php index adb718d296..448f74cef6 100644 --- a/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/vendor/symfony/polyfill-intl-idn/Idn.php @@ -1,283 +1,941 @@ <?php /* - * Copyright (c) 2014 TrueServer B.V. + * This file is part of the Symfony package. * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is furnished - * to do so, subject to the following conditions: + * (c) Fabien Potencier <fabien@symfony.com> and Trevor Rowbotham <trevor.rowbotham@pm.me> * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from - * https://github.com/true/php-punycode/blob/v2.1.1/src/Punycode.php + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. */ namespace Symfony\Polyfill\Intl\Idn; +use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; +use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; + /** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - idn_to_ascii - Convert domain name to IDNA ASCII form - * - idn_to_utf8 - Convert domain name from IDNA ASCII to Unicode - * - * @author Renan Gonçalves <renan.saddam@gmail.com> - * @author Sebastian Kroczek <sk@xbug.de> - * @author Dmitry Lukashin <dmitry@lukashin.ru> - * @author Laurent Bassin <laurent@bassin.info> + * @see https://www.unicode.org/reports/tr46/ * * @internal */ final class Idn { - const INTL_IDNA_VARIANT_2003 = 0; - const INTL_IDNA_VARIANT_UTS46 = 1; - - private static $encodeTable = array( - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', - 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - ); - - private static $decodeTable = array( - 'a' => 0, 'b' => 1, 'c' => 2, 'd' => 3, 'e' => 4, 'f' => 5, - 'g' => 6, 'h' => 7, 'i' => 8, 'j' => 9, 'k' => 10, 'l' => 11, - 'm' => 12, 'n' => 13, 'o' => 14, 'p' => 15, 'q' => 16, 'r' => 17, - 's' => 18, 't' => 19, 'u' => 20, 'v' => 21, 'w' => 22, 'x' => 23, - 'y' => 24, 'z' => 25, '0' => 26, '1' => 27, '2' => 28, '3' => 29, - '4' => 30, '5' => 31, '6' => 32, '7' => 33, '8' => 34, '9' => 35, - ); - - public static function idn_to_ascii($domain, $options, $variant, &$idna_info = array()) + public const ERROR_EMPTY_LABEL = 1; + public const ERROR_LABEL_TOO_LONG = 2; + public const ERROR_DOMAIN_NAME_TOO_LONG = 4; + public const ERROR_LEADING_HYPHEN = 8; + public const ERROR_TRAILING_HYPHEN = 0x10; + public const ERROR_HYPHEN_3_4 = 0x20; + public const ERROR_LEADING_COMBINING_MARK = 0x40; + public const ERROR_DISALLOWED = 0x80; + public const ERROR_PUNYCODE = 0x100; + public const ERROR_LABEL_HAS_DOT = 0x200; + public const ERROR_INVALID_ACE_LABEL = 0x400; + public const ERROR_BIDI = 0x800; + public const ERROR_CONTEXTJ = 0x1000; + public const ERROR_CONTEXTO_PUNCTUATION = 0x2000; + public const ERROR_CONTEXTO_DIGITS = 0x4000; + + public const INTL_IDNA_VARIANT_2003 = 0; + public const INTL_IDNA_VARIANT_UTS46 = 1; + + public const IDNA_DEFAULT = 0; + public const IDNA_ALLOW_UNASSIGNED = 1; + public const IDNA_USE_STD3_RULES = 2; + public const IDNA_CHECK_BIDI = 4; + public const IDNA_CHECK_CONTEXTJ = 8; + public const IDNA_NONTRANSITIONAL_TO_ASCII = 16; + public const IDNA_NONTRANSITIONAL_TO_UNICODE = 32; + + public const MAX_DOMAIN_SIZE = 253; + public const MAX_LABEL_SIZE = 63; + + public const BASE = 36; + public const TMIN = 1; + public const TMAX = 26; + public const SKEW = 38; + public const DAMP = 700; + public const INITIAL_BIAS = 72; + public const INITIAL_N = 128; + public const DELIMITER = '-'; + public const MAX_INT = 2147483647; + + /** + * Contains the numeric value of a basic code point (for use in representing integers) in the + * range 0 to BASE-1, or -1 if b is does not represent a value. + * + * @var array<int, int> + */ + private static $basicToDigit = [ + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, + + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + ]; + + /** + * @var array<int, int> + */ + private static $virama; + + /** + * @var array<int, string> + */ + private static $mapped; + + /** + * @var array<int, bool> + */ + private static $ignored; + + /** + * @var array<int, string> + */ + private static $deviation; + + /** + * @var array<int, bool> + */ + private static $disallowed; + + /** + * @var array<int, string> + */ + private static $disallowed_STD3_mapped; + + /** + * @var array<int, bool> + */ + private static $disallowed_STD3_valid; + + /** + * @var bool + */ + private static $mappingTableLoaded = false; + + /** + * @see https://www.unicode.org/reports/tr46/#ToASCII + * + * @param string $domainName + * @param int $options + * @param int $variant + * @param array $idna_info + * + * @return string|false + */ + public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', E_USER_DEPRECATED); + if (\PHP_VERSION_ID > 80400 && '' === $domainName) { + throw new \ValueError('idn_to_ascii(): Argument #1 ($domain) cannot be empty'); } - if (self::INTL_IDNA_VARIANT_UTS46 === $variant) { - $domain = mb_strtolower($domain, 'utf-8'); + if (self::INTL_IDNA_VARIANT_2003 === $variant) { + @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } - $parts = explode('.', $domain); + $options = [ + 'CheckHyphens' => true, + 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), + 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), + 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), + 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_ASCII), + 'VerifyDnsLength' => true, + ]; + $info = new Info(); + $labels = self::process((string) $domainName, $options, $info); + + foreach ($labels as $i => $label) { + // Only convert labels to punycode that contain non-ASCII code points + if (1 === preg_match('/[^\x00-\x7F]/', $label)) { + try { + $label = 'xn--'.self::punycodeEncode($label); + } catch (\Exception $e) { + $info->errors |= self::ERROR_PUNYCODE; + } - foreach ($parts as $i => &$part) { - if ('' === $part && \count($parts) > 1 + $i) { - return false; - } - if (false === $part = self::encodePart($part)) { - return false; + $labels[$i] = $label; } } - $output = implode('.', $parts); + if ($options['VerifyDnsLength']) { + self::validateDomainAndLabelLength($labels, $info); + } - $idna_info = array( - 'result' => \strlen($output) > 255 ? false : $output, - 'isTransitionalDifferent' => false, - 'errors' => 0, - ); + $idna_info = [ + 'result' => implode('.', $labels), + 'isTransitionalDifferent' => $info->transitionalDifferent, + 'errors' => $info->errors, + ]; - return $idna_info['result']; + return 0 === $info->errors ? $idna_info['result'] : false; } - public static function idn_to_utf8($domain, $options, $variant, &$idna_info = array()) + /** + * @see https://www.unicode.org/reports/tr46/#ToUnicode + * + * @param string $domainName + * @param int $options + * @param int $variant + * @param array $idna_info + * + * @return string|false + */ + public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { - @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', E_USER_DEPRECATED); + if (\PHP_VERSION_ID > 80400 && '' === $domainName) { + throw new \ValueError('idn_to_utf8(): Argument #1 ($domain) cannot be empty'); + } + + if (self::INTL_IDNA_VARIANT_2003 === $variant) { + @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } - $parts = explode('.', $domain); + $info = new Info(); + $labels = self::process((string) $domainName, [ + 'CheckHyphens' => true, + 'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BIDI), + 'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK_CONTEXTJ), + 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES), + 'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::IDNA_NONTRANSITIONAL_TO_UNICODE), + ], $info); + $idna_info = [ + 'result' => implode('.', $labels), + 'isTransitionalDifferent' => $info->transitionalDifferent, + 'errors' => $info->errors, + ]; + + return 0 === $info->errors ? $idna_info['result'] : false; + } + + /** + * @param string $label + * + * @return bool + */ + private static function isValidContextJ(array $codePoints, $label) + { + if (!isset(self::$virama)) { + self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\DIRECTORY_SEPARATOR.'virama.php'; + } - foreach ($parts as &$part) { - $length = \strlen($part); - if ($length < 1 || 63 < $length) { + $offset = 0; + + foreach ($codePoints as $i => $codePoint) { + if (0x200C !== $codePoint && 0x200D !== $codePoint) { continue; } - if (0 !== strpos($part, 'xn--')) { + + if (!isset($codePoints[$i - 1])) { + return false; + } + + // If Canonical_Combining_Class(Before(cp)) .eq. Virama Then True; + if (isset(self::$virama[$codePoints[$i - 1]])) { continue; } - $part = substr($part, 4); - $part = self::decodePart($part); - } + // If RegExpMatch((Joining_Type:{L,D})(Joining_Type:T)*\u200C(Joining_Type:T)*(Joining_Type:{R,D})) Then + // True; + // Generated RegExp = ([Joining_Type:{L,D}][Joining_Type:T]*\u200C[Joining_Type:T]*)[Joining_Type:{R,D}] + if (0x200C === $codePoint && 1 === preg_match(Regex::ZWNJ, $label, $matches, \PREG_OFFSET_CAPTURE, $offset)) { + $offset += \strlen($matches[1][0]); - $output = implode('.', $parts); + continue; + } - $idna_info = array( - 'result' => \strlen($output) > 255 ? false : $output, - 'isTransitionalDifferent' => false, - 'errors' => 0, - ); + return false; + } - return $idna_info['result']; + return true; } - private static function encodePart($input) + /** + * @see https://www.unicode.org/reports/tr46/#ProcessingStepMap + * + * @param string $input + * @param array<string, bool> $options + * + * @return string + */ + private static function mapCodePoints($input, array $options, Info $info) { - $codePoints = self::listCodePoints($input); + $str = ''; + $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; + $transitional = $options['Transitional_Processing']; - $n = 128; - $bias = 72; - $delta = 0; - $h = $b = \count($codePoints['basic']); + foreach (self::utf8Decode($input) as $codePoint) { + $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); - $output = ''; - foreach ($codePoints['basic'] as $code) { - $output .= mb_chr($code, 'utf-8'); + switch ($data['status']) { + case 'disallowed': + case 'valid': + $str .= mb_chr($codePoint, 'utf-8'); + + break; + + case 'ignored': + // Do nothing. + break; + + case 'mapped': + $str .= $transitional && 0x1E9E === $codePoint ? 'ss' : $data['mapping']; + + break; + + case 'deviation': + $info->transitionalDifferent = true; + $str .= ($transitional ? $data['mapping'] : mb_chr($codePoint, 'utf-8')); + + break; + } } - if ($input === $output) { - return $output; + + return $str; + } + + /** + * @see https://www.unicode.org/reports/tr46/#Processing + * + * @param string $domain + * @param array<string, bool> $options + * + * @return array<int, string> + */ + private static function process($domain, array $options, Info $info) + { + // If VerifyDnsLength is not set, we are doing ToUnicode otherwise we are doing ToASCII and + // we need to respect the VerifyDnsLength option. + $checkForEmptyLabels = !isset($options['VerifyDnsLength']) || $options['VerifyDnsLength']; + + if ($checkForEmptyLabels && '' === $domain) { + $info->errors |= self::ERROR_EMPTY_LABEL; + + return [$domain]; } - if ($b > 0) { - $output .= '-'; + + // Step 1. Map each code point in the domain name string + $domain = self::mapCodePoints($domain, $options, $info); + + // Step 2. Normalize the domain name string to Unicode Normalization Form C. + if (!\Normalizer::isNormalized($domain, \Normalizer::FORM_C)) { + $domain = \Normalizer::normalize($domain, \Normalizer::FORM_C); } - $codePoints['nonBasic'] = array_unique($codePoints['nonBasic']); - sort($codePoints['nonBasic']); + // Step 3. Break the string into labels at U+002E (.) FULL STOP. + $labels = explode('.', $domain); + $lastLabelIndex = \count($labels) - 1; - $i = 0; - $length = mb_strlen($input, 'utf-8'); - while ($h < $length) { - $m = $codePoints['nonBasic'][$i++]; - $delta += ($m - $n) * ($h + 1); - $n = $m; + // Step 4. Convert and validate each label in the domain name string. + foreach ($labels as $i => $label) { + $validationOptions = $options; - foreach ($codePoints['all'] as $c) { - if ($c < $n || $c < 128) { - ++$delta; - } - if ($c === $n) { - $q = $delta; - for ($k = 36;; $k += 36) { - $t = self::calculateThreshold($k, $bias); - if ($q < $t) { - break; - } + if ('xn--' === substr($label, 0, 4)) { + // Step 4.1. If the label contains any non-ASCII code point (i.e., a code point greater than U+007F), + // record that there was an error, and continue with the next label. + if (preg_match('/[^\x00-\x7F]/', $label)) { + $info->errors |= self::ERROR_PUNYCODE; - $code = $t + (($q - $t) % (36 - $t)); - $output .= self::$encodeTable[$code]; + continue; + } - $q = ($q - $t) / (36 - $t); - } + // Step 4.2. Attempt to convert the rest of the label to Unicode according to Punycode [RFC3492]. If + // that conversion fails, record that there was an error, and continue + // with the next label. Otherwise replace the original label in the string by the results of the + // conversion. + try { + $label = self::punycodeDecode(substr($label, 4)); + } catch (\Exception $e) { + $info->errors |= self::ERROR_PUNYCODE; - $output .= self::$encodeTable[$q]; - $bias = self::adapt($delta, $h + 1, ($h === $b)); - $delta = 0; - ++$h; + continue; } + + $validationOptions['Transitional_Processing'] = false; + $labels[$i] = $label; } - ++$delta; - ++$n; + self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex); } - $output = 'xn--'.$output; + if ($info->bidiDomain && !$info->validBidiDomain) { + $info->errors |= self::ERROR_BIDI; + } - return \strlen($output) < 1 || 63 < \strlen($output) ? false : strtolower($output); + // Any input domain name string that does not record an error has been successfully + // processed according to this specification. Conversely, if an input domain_name string + // causes an error, then the processing of the input domain_name string fails. Determining + // what to do with error input is up to the caller, and not in the scope of this document. + return $labels; } - private static function listCodePoints($input) + /** + * @see https://tools.ietf.org/html/rfc5893#section-2 + * + * @param string $label + */ + private static function validateBidiLabel($label, Info $info) { - $codePoints = array( - 'all' => array(), - 'basic' => array(), - 'nonBasic' => array(), - ); + if (1 === preg_match(Regex::RTL_LABEL, $label)) { + $info->bidiDomain = true; - $length = mb_strlen($input, 'utf-8'); - for ($i = 0; $i < $length; ++$i) { - $char = mb_substr($input, $i, 1, 'utf-8'); - $code = mb_ord($char, 'utf-8'); - if ($code < 128) { - $codePoints['all'][] = $codePoints['basic'][] = $code; - } else { - $codePoints['all'][] = $codePoints['nonBasic'][] = $code; + // Step 1. The first character must be a character with Bidi property L, R, or AL. + // If it has the R or AL property, it is an RTL label + if (1 !== preg_match(Regex::BIDI_STEP_1_RTL, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 2. In an RTL label, only characters with the Bidi properties R, AL, AN, EN, ES, + // CS, ET, ON, BN, or NSM are allowed. + if (1 === preg_match(Regex::BIDI_STEP_2, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 3. In an RTL label, the end of the label must be a character with Bidi property + // R, AL, EN, or AN, followed by zero or more characters with Bidi property NSM. + if (1 !== preg_match(Regex::BIDI_STEP_3, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 4. In an RTL label, if an EN is present, no AN may be present, and vice versa. + if (1 === preg_match(Regex::BIDI_STEP_4_AN, $label) && 1 === preg_match(Regex::BIDI_STEP_4_EN, $label)) { + $info->validBidiDomain = false; + + return; } + + return; } - return $codePoints; + // We are a LTR label + // Step 1. The first character must be a character with Bidi property L, R, or AL. + // If it has the L property, it is an LTR label. + if (1 !== preg_match(Regex::BIDI_STEP_1_LTR, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 5. In an LTR label, only characters with the Bidi properties L, EN, + // ES, CS, ET, ON, BN, or NSM are allowed. + if (1 === preg_match(Regex::BIDI_STEP_5, $label)) { + $info->validBidiDomain = false; + + return; + } + + // Step 6.In an LTR label, the end of the label must be a character with Bidi property L or + // EN, followed by zero or more characters with Bidi property NSM. + if (1 !== preg_match(Regex::BIDI_STEP_6, $label)) { + $info->validBidiDomain = false; + + return; + } } - private static function calculateThreshold($k, $bias) + /** + * @param array<int, string> $labels + */ + private static function validateDomainAndLabelLength(array $labels, Info $info) { - if ($k <= $bias + 1) { - return 1; + $maxDomainSize = self::MAX_DOMAIN_SIZE; + $length = \count($labels); + + // Number of "." delimiters. + $domainLength = $length - 1; + + // If the last label is empty and it is not the first label, then it is the root label. + // Increase the max size by 1, making it 254, to account for the root label's "." + // delimiter. This also means we don't need to check the last label's length for being too + // long. + if ($length > 1 && '' === $labels[$length - 1]) { + ++$maxDomainSize; + --$length; } - if ($k >= $bias + 26) { - return 26; + + for ($i = 0; $i < $length; ++$i) { + $bytes = \strlen($labels[$i]); + $domainLength += $bytes; + + if ($bytes > self::MAX_LABEL_SIZE) { + $info->errors |= self::ERROR_LABEL_TOO_LONG; + } } - return $k - $bias; + if ($domainLength > $maxDomainSize) { + $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG; + } } - private static function adapt($delta, $numPoints, $firstTime) + /** + * @see https://www.unicode.org/reports/tr46/#Validity_Criteria + * + * @param string $label + * @param array<string, bool> $options + * @param bool $canBeEmpty + */ + private static function validateLabel($label, Info $info, array $options, $canBeEmpty) { - $delta = (int) ($firstTime ? $delta / 700 : $delta / 2); - $delta += (int) ($delta / $numPoints); + if ('' === $label) { + if (!$canBeEmpty && (!isset($options['VerifyDnsLength']) || $options['VerifyDnsLength'])) { + $info->errors |= self::ERROR_EMPTY_LABEL; + } - $k = 0; - while ($delta > 35 * 13) { - $delta = (int) ($delta / 35); - $k = $k + 36; + return; } - return $k + (int) (36 * $delta / ($delta + 38)); + // Step 1. The label must be in Unicode Normalization Form C. + if (!\Normalizer::isNormalized($label, \Normalizer::FORM_C)) { + $info->errors |= self::ERROR_INVALID_ACE_LABEL; + } + + $codePoints = self::utf8Decode($label); + + if ($options['CheckHyphens']) { + // Step 2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character + // in both the thrid and fourth positions. + if (isset($codePoints[2], $codePoints[3]) && 0x002D === $codePoints[2] && 0x002D === $codePoints[3]) { + $info->errors |= self::ERROR_HYPHEN_3_4; + } + + // Step 3. If CheckHyphens, the label must neither begin nor end with a U+002D + // HYPHEN-MINUS character. + if ('-' === substr($label, 0, 1)) { + $info->errors |= self::ERROR_LEADING_HYPHEN; + } + + if ('-' === substr($label, -1, 1)) { + $info->errors |= self::ERROR_TRAILING_HYPHEN; + } + } elseif ('xn--' === substr($label, 0, 4)) { + $info->errors |= self::ERROR_PUNYCODE; + } + + // Step 4. The label must not contain a U+002E (.) FULL STOP. + if (false !== strpos($label, '.')) { + $info->errors |= self::ERROR_LABEL_HAS_DOT; + } + + // Step 5. The label must not begin with a combining mark, that is: General_Category=Mark. + if (1 === preg_match(Regex::COMBINING_MARK, $label)) { + $info->errors |= self::ERROR_LEADING_COMBINING_MARK; + } + + // Step 6. Each code point in the label must only have certain status values according to + // Section 5, IDNA Mapping Table: + $transitional = $options['Transitional_Processing']; + $useSTD3ASCIIRules = $options['UseSTD3ASCIIRules']; + + foreach ($codePoints as $codePoint) { + $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules); + $status = $data['status']; + + if ('valid' === $status || (!$transitional && 'deviation' === $status)) { + continue; + } + + $info->errors |= self::ERROR_DISALLOWED; + + break; + } + + // Step 7. If CheckJoiners, the label must satisify the ContextJ rules from Appendix A, in + // The Unicode Code Points and Internationalized Domain Names for Applications (IDNA) + // [IDNA2008]. + if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) { + $info->errors |= self::ERROR_CONTEXTJ; + } + + // Step 8. If CheckBidi, and if the domain name is a Bidi domain name, then the label must + // satisfy all six of the numbered conditions in [IDNA2008] RFC 5893, Section 2. + if ($options['CheckBidi'] && (!$info->bidiDomain || $info->validBidiDomain)) { + self::validateBidiLabel($label, $info); + } } - private static function decodePart($input) + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.2 + * + * @param string $input + * + * @return string + */ + private static function punycodeDecode($input) { - $n = 128; + $n = self::INITIAL_N; + $out = 0; $i = 0; - $bias = 72; - $output = ''; + $bias = self::INITIAL_BIAS; + $lastDelimIndex = strrpos($input, self::DELIMITER); + $b = false === $lastDelimIndex ? 0 : $lastDelimIndex; + $inputLength = \strlen($input); + $output = []; + $bytes = array_map('ord', str_split($input)); - $pos = strrpos($input, '-'); - if (false !== $pos) { - $output = substr($input, 0, $pos++); - } else { - $pos = 0; + for ($j = 0; $j < $b; ++$j) { + if ($bytes[$j] > 0x7F) { + throw new \Exception('Invalid input'); + } + + $output[$out++] = $input[$j]; } - $outputLength = \strlen($output); - $inputLength = \strlen($input); + if ($b > 0) { + ++$b; + } - while ($pos < $inputLength) { + for ($in = $b; $in < $inputLength; ++$out) { $oldi = $i; $w = 1; - for ($k = 36;; $k += 36) { - $digit = self::$decodeTable[$input[$pos++]]; + for ($k = self::BASE; /* no condition */; $k += self::BASE) { + if ($in >= $inputLength) { + throw new \Exception('Invalid input'); + } + + $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; + + if ($digit < 0) { + throw new \Exception('Invalid input'); + } + + if ($digit > intdiv(self::MAX_INT - $i, $w)) { + throw new \Exception('Integer overflow'); + } + $i += $digit * $w; - $t = self::calculateThreshold($k, $bias); + + if ($k <= $bias) { + $t = self::TMIN; + } elseif ($k >= $bias + self::TMAX) { + $t = self::TMAX; + } else { + $t = $k - $bias; + } if ($digit < $t) { break; } - $w *= 36 - $t; + $baseMinusT = self::BASE - $t; + + if ($w > intdiv(self::MAX_INT, $baseMinusT)) { + throw new \Exception('Integer overflow'); + } + + $w *= $baseMinusT; } - $bias = self::adapt($i - $oldi, ++$outputLength, 0 === $oldi); - $n = $n + (int) ($i / $outputLength); - $i = $i % $outputLength; - $output = mb_substr($output, 0, $i, 'utf-8').mb_chr($n, 'utf-8').mb_substr($output, $i, $outputLength - 1, 'utf-8'); + $outPlusOne = $out + 1; + $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); + + if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { + throw new \Exception('Integer overflow'); + } - ++$i; + $n += intdiv($i, $outPlusOne); + $i %= $outPlusOne; + array_splice($output, $i++, 0, [mb_chr($n, 'utf-8')]); + } + + return implode('', $output); + } + + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.3 + * + * @param string $input + * + * @return string + */ + private static function punycodeEncode($input) + { + $n = self::INITIAL_N; + $delta = 0; + $out = 0; + $bias = self::INITIAL_BIAS; + $inputLength = 0; + $output = ''; + $iter = self::utf8Decode($input); + + foreach ($iter as $codePoint) { + ++$inputLength; + + if ($codePoint < 0x80) { + $output .= \chr($codePoint); + ++$out; + } + } + + $h = $out; + $b = $out; + + if ($b > 0) { + $output .= self::DELIMITER; + ++$out; + } + + while ($h < $inputLength) { + $m = self::MAX_INT; + + foreach ($iter as $codePoint) { + if ($codePoint >= $n && $codePoint < $m) { + $m = $codePoint; + } + } + + if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { + throw new \Exception('Integer overflow'); + } + + $delta += ($m - $n) * ($h + 1); + $n = $m; + + foreach ($iter as $codePoint) { + if ($codePoint < $n && 0 === ++$delta) { + throw new \Exception('Integer overflow'); + } + + if ($codePoint === $n) { + $q = $delta; + + for ($k = self::BASE; /* no condition */; $k += self::BASE) { + if ($k <= $bias) { + $t = self::TMIN; + } elseif ($k >= $bias + self::TMAX) { + $t = self::TMAX; + } else { + $t = $k - $bias; + } + + if ($q < $t) { + break; + } + + $qMinusT = $q - $t; + $baseMinusT = self::BASE - $t; + $output .= self::encodeDigit($t + $qMinusT % $baseMinusT, false); + ++$out; + $q = intdiv($qMinusT, $baseMinusT); + } + + $output .= self::encodeDigit($q, false); + ++$out; + $bias = self::adaptBias($delta, $h + 1, $h === $b); + $delta = 0; + ++$h; + } + } + + ++$delta; + ++$n; } return $output; } + + /** + * @see https://tools.ietf.org/html/rfc3492#section-6.1 + * + * @param int $delta + * @param int $numPoints + * @param bool $firstTime + * + * @return int + */ + private static function adaptBias($delta, $numPoints, $firstTime) + { + // xxx >> 1 is a faster way of doing intdiv(xxx, 2) + $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1; + $delta += intdiv($delta, $numPoints); + $k = 0; + + while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) { + $delta = intdiv($delta, self::BASE - self::TMIN); + $k += self::BASE; + } + + return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW); + } + + /** + * @param int $d + * @param bool $flag + * + * @return string + */ + private static function encodeDigit($d, $flag) + { + return \chr($d + 22 + 75 * ($d < 26 ? 1 : 0) - (($flag ? 1 : 0) << 5)); + } + + /** + * Takes a UTF-8 encoded string and converts it into a series of integer code points. Any + * invalid byte sequences will be replaced by a U+FFFD replacement code point. + * + * @see https://encoding.spec.whatwg.org/#utf-8-decoder + * + * @param string $input + * + * @return array<int, int> + */ + private static function utf8Decode($input) + { + $bytesSeen = 0; + $bytesNeeded = 0; + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + $codePoint = 0; + $codePoints = []; + $length = \strlen($input); + + for ($i = 0; $i < $length; ++$i) { + $byte = \ord($input[$i]); + + if (0 === $bytesNeeded) { + if ($byte >= 0x00 && $byte <= 0x7F) { + $codePoints[] = $byte; + + continue; + } + + if ($byte >= 0xC2 && $byte <= 0xDF) { + $bytesNeeded = 1; + $codePoint = $byte & 0x1F; + } elseif ($byte >= 0xE0 && $byte <= 0xEF) { + if (0xE0 === $byte) { + $lowerBoundary = 0xA0; + } elseif (0xED === $byte) { + $upperBoundary = 0x9F; + } + + $bytesNeeded = 2; + $codePoint = $byte & 0xF; + } elseif ($byte >= 0xF0 && $byte <= 0xF4) { + if (0xF0 === $byte) { + $lowerBoundary = 0x90; + } elseif (0xF4 === $byte) { + $upperBoundary = 0x8F; + } + + $bytesNeeded = 3; + $codePoint = $byte & 0x7; + } else { + $codePoints[] = 0xFFFD; + } + + continue; + } + + if ($byte < $lowerBoundary || $byte > $upperBoundary) { + $codePoint = 0; + $bytesNeeded = 0; + $bytesSeen = 0; + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + --$i; + $codePoints[] = 0xFFFD; + + continue; + } + + $lowerBoundary = 0x80; + $upperBoundary = 0xBF; + $codePoint = ($codePoint << 6) | ($byte & 0x3F); + + if (++$bytesSeen !== $bytesNeeded) { + continue; + } + + $codePoints[] = $codePoint; + $codePoint = 0; + $bytesNeeded = 0; + $bytesSeen = 0; + } + + // String unexpectedly ended, so append a U+FFFD code point. + if (0 !== $bytesNeeded) { + $codePoints[] = 0xFFFD; + } + + return $codePoints; + } + + /** + * @param int $codePoint + * @param bool $useSTD3ASCIIRules + * + * @return array{status: string, mapping?: string} + */ + private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) + { + if (!self::$mappingTableLoaded) { + self::$mappingTableLoaded = true; + self::$mapped = require __DIR__.'/Resources/unidata/mapped.php'; + self::$ignored = require __DIR__.'/Resources/unidata/ignored.php'; + self::$deviation = require __DIR__.'/Resources/unidata/deviation.php'; + self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php'; + self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php'; + self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php'; + } + + if (isset(self::$mapped[$codePoint])) { + return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]]; + } + + if (isset(self::$ignored[$codePoint])) { + return ['status' => 'ignored']; + } + + if (isset(self::$deviation[$codePoint])) { + return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]]; + } + + if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) { + return ['status' => 'disallowed']; + } + + $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]); + + if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) { + $status = 'disallowed'; + + if (!$useSTD3ASCIIRules) { + $status = $isDisallowedMapped ? 'mapped' : 'valid'; + } + + if ($isDisallowedMapped) { + return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]]; + } + + return ['status' => $status]; + } + + return ['status' => 'valid']; + } } diff --git a/vendor/symfony/polyfill-intl-idn/Info.php b/vendor/symfony/polyfill-intl-idn/Info.php new file mode 100644 index 0000000000..25c3582b2a --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Info.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> and Trevor Rowbotham <trevor.rowbotham@pm.me> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Idn; + +/** + * @internal + */ +class Info +{ + public $bidiDomain = false; + public $errors = 0; + public $validBidiDomain = true; + public $transitionalDifferent = false; +} diff --git a/vendor/symfony/polyfill-intl-idn/LICENSE b/vendor/symfony/polyfill-intl-idn/LICENSE index 3f853aaf35..fd0a0626a3 100644 --- a/vendor/symfony/polyfill-intl-idn/LICENSE +++ b/vendor/symfony/polyfill-intl-idn/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier and Trevor Rowbotham <trevor.rowbotham@pm.me> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-intl-idn/README.md b/vendor/symfony/polyfill-intl-idn/README.md index 2e75f2e520..cae551705a 100644 --- a/vendor/symfony/polyfill-intl-idn/README.md +++ b/vendor/symfony/polyfill-intl-idn/README.md @@ -4,7 +4,7 @@ Symfony Polyfill / Intl: Idn This component provides [`idn_to_ascii`](https://php.net/idn-to-ascii) and [`idn_to_utf8`](https://php.net/idn-to-utf8) functions to users who run php versions without the [Intl](https://php.net/intl) extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php new file mode 100644 index 0000000000..d285acd13e --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php @@ -0,0 +1,384 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; + +/** + * @internal + */ +final class DisallowedRanges +{ + /** + * @param int $codePoint + * + * @return bool + */ + public static function inRange($codePoint) + { + if ($codePoint >= 128 && $codePoint <= 159) { + return true; + } + + if ($codePoint >= 2155 && $codePoint <= 2207) { + return true; + } + + if ($codePoint >= 3676 && $codePoint <= 3712) { + return true; + } + + if ($codePoint >= 3808 && $codePoint <= 3839) { + return true; + } + + if ($codePoint >= 4059 && $codePoint <= 4095) { + return true; + } + + if ($codePoint >= 4256 && $codePoint <= 4293) { + return true; + } + + if ($codePoint >= 6849 && $codePoint <= 6911) { + return true; + } + + if ($codePoint >= 11859 && $codePoint <= 11903) { + return true; + } + + if ($codePoint >= 42955 && $codePoint <= 42996) { + return true; + } + + if ($codePoint >= 55296 && $codePoint <= 57343) { + return true; + } + + if ($codePoint >= 57344 && $codePoint <= 63743) { + return true; + } + + if ($codePoint >= 64218 && $codePoint <= 64255) { + return true; + } + + if ($codePoint >= 64976 && $codePoint <= 65007) { + return true; + } + + if ($codePoint >= 65630 && $codePoint <= 65663) { + return true; + } + + if ($codePoint >= 65953 && $codePoint <= 65999) { + return true; + } + + if ($codePoint >= 66046 && $codePoint <= 66175) { + return true; + } + + if ($codePoint >= 66518 && $codePoint <= 66559) { + return true; + } + + if ($codePoint >= 66928 && $codePoint <= 67071) { + return true; + } + + if ($codePoint >= 67432 && $codePoint <= 67583) { + return true; + } + + if ($codePoint >= 67760 && $codePoint <= 67807) { + return true; + } + + if ($codePoint >= 67904 && $codePoint <= 67967) { + return true; + } + + if ($codePoint >= 68256 && $codePoint <= 68287) { + return true; + } + + if ($codePoint >= 68528 && $codePoint <= 68607) { + return true; + } + + if ($codePoint >= 68681 && $codePoint <= 68735) { + return true; + } + + if ($codePoint >= 68922 && $codePoint <= 69215) { + return true; + } + + if ($codePoint >= 69298 && $codePoint <= 69375) { + return true; + } + + if ($codePoint >= 69466 && $codePoint <= 69551) { + return true; + } + + if ($codePoint >= 70207 && $codePoint <= 70271) { + return true; + } + + if ($codePoint >= 70517 && $codePoint <= 70655) { + return true; + } + + if ($codePoint >= 70874 && $codePoint <= 71039) { + return true; + } + + if ($codePoint >= 71134 && $codePoint <= 71167) { + return true; + } + + if ($codePoint >= 71370 && $codePoint <= 71423) { + return true; + } + + if ($codePoint >= 71488 && $codePoint <= 71679) { + return true; + } + + if ($codePoint >= 71740 && $codePoint <= 71839) { + return true; + } + + if ($codePoint >= 72026 && $codePoint <= 72095) { + return true; + } + + if ($codePoint >= 72441 && $codePoint <= 72703) { + return true; + } + + if ($codePoint >= 72887 && $codePoint <= 72959) { + return true; + } + + if ($codePoint >= 73130 && $codePoint <= 73439) { + return true; + } + + if ($codePoint >= 73465 && $codePoint <= 73647) { + return true; + } + + if ($codePoint >= 74650 && $codePoint <= 74751) { + return true; + } + + if ($codePoint >= 75076 && $codePoint <= 77823) { + return true; + } + + if ($codePoint >= 78905 && $codePoint <= 82943) { + return true; + } + + if ($codePoint >= 83527 && $codePoint <= 92159) { + return true; + } + + if ($codePoint >= 92784 && $codePoint <= 92879) { + return true; + } + + if ($codePoint >= 93072 && $codePoint <= 93759) { + return true; + } + + if ($codePoint >= 93851 && $codePoint <= 93951) { + return true; + } + + if ($codePoint >= 94112 && $codePoint <= 94175) { + return true; + } + + if ($codePoint >= 101590 && $codePoint <= 101631) { + return true; + } + + if ($codePoint >= 101641 && $codePoint <= 110591) { + return true; + } + + if ($codePoint >= 110879 && $codePoint <= 110927) { + return true; + } + + if ($codePoint >= 111356 && $codePoint <= 113663) { + return true; + } + + if ($codePoint >= 113828 && $codePoint <= 118783) { + return true; + } + + if ($codePoint >= 119366 && $codePoint <= 119519) { + return true; + } + + if ($codePoint >= 119673 && $codePoint <= 119807) { + return true; + } + + if ($codePoint >= 121520 && $codePoint <= 122879) { + return true; + } + + if ($codePoint >= 122923 && $codePoint <= 123135) { + return true; + } + + if ($codePoint >= 123216 && $codePoint <= 123583) { + return true; + } + + if ($codePoint >= 123648 && $codePoint <= 124927) { + return true; + } + + if ($codePoint >= 125143 && $codePoint <= 125183) { + return true; + } + + if ($codePoint >= 125280 && $codePoint <= 126064) { + return true; + } + + if ($codePoint >= 126133 && $codePoint <= 126208) { + return true; + } + + if ($codePoint >= 126270 && $codePoint <= 126463) { + return true; + } + + if ($codePoint >= 126652 && $codePoint <= 126703) { + return true; + } + + if ($codePoint >= 126706 && $codePoint <= 126975) { + return true; + } + + if ($codePoint >= 127406 && $codePoint <= 127461) { + return true; + } + + if ($codePoint >= 127590 && $codePoint <= 127743) { + return true; + } + + if ($codePoint >= 129202 && $codePoint <= 129279) { + return true; + } + + if ($codePoint >= 129751 && $codePoint <= 129791) { + return true; + } + + if ($codePoint >= 129995 && $codePoint <= 130031) { + return true; + } + + if ($codePoint >= 130042 && $codePoint <= 131069) { + return true; + } + + if ($codePoint >= 173790 && $codePoint <= 173823) { + return true; + } + + if ($codePoint >= 191457 && $codePoint <= 194559) { + return true; + } + + if ($codePoint >= 195102 && $codePoint <= 196605) { + return true; + } + + if ($codePoint >= 201547 && $codePoint <= 262141) { + return true; + } + + if ($codePoint >= 262144 && $codePoint <= 327677) { + return true; + } + + if ($codePoint >= 327680 && $codePoint <= 393213) { + return true; + } + + if ($codePoint >= 393216 && $codePoint <= 458749) { + return true; + } + + if ($codePoint >= 458752 && $codePoint <= 524285) { + return true; + } + + if ($codePoint >= 524288 && $codePoint <= 589821) { + return true; + } + + if ($codePoint >= 589824 && $codePoint <= 655357) { + return true; + } + + if ($codePoint >= 655360 && $codePoint <= 720893) { + return true; + } + + if ($codePoint >= 720896 && $codePoint <= 786429) { + return true; + } + + if ($codePoint >= 786432 && $codePoint <= 851965) { + return true; + } + + if ($codePoint >= 851968 && $codePoint <= 917501) { + return true; + } + + if ($codePoint >= 917536 && $codePoint <= 917631) { + return true; + } + + if ($codePoint >= 917632 && $codePoint <= 917759) { + return true; + } + + if ($codePoint >= 918000 && $codePoint <= 983037) { + return true; + } + + if ($codePoint >= 983040 && $codePoint <= 1048573) { + return true; + } + + if ($codePoint >= 1048576 && $codePoint <= 1114109) { + return true; + } + + return false; + } +} diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php new file mode 100644 index 0000000000..3c6af0c132 --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php @@ -0,0 +1,33 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; + +/** + * @internal + */ +final class Regex +{ + const COMBINING_MARK = '/^[\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{0903}\x{093A}\x{093B}\x{093C}\x{093E}-\x{0940}\x{0941}-\x{0948}\x{0949}-\x{094C}\x{094D}\x{094E}-\x{094F}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{0982}-\x{0983}\x{09BC}\x{09BE}-\x{09C0}\x{09C1}-\x{09C4}\x{09C7}-\x{09C8}\x{09CB}-\x{09CC}\x{09CD}\x{09D7}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A03}\x{0A3C}\x{0A3E}-\x{0A40}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0A83}\x{0ABC}\x{0ABE}-\x{0AC0}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0AC9}\x{0ACB}-\x{0ACC}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B02}-\x{0B03}\x{0B3C}\x{0B3E}\x{0B3F}\x{0B40}\x{0B41}-\x{0B44}\x{0B47}-\x{0B48}\x{0B4B}-\x{0B4C}\x{0B4D}\x{0B55}-\x{0B56}\x{0B57}\x{0B62}-\x{0B63}\x{0B82}\x{0BBE}-\x{0BBF}\x{0BC0}\x{0BC1}-\x{0BC2}\x{0BC6}-\x{0BC8}\x{0BCA}-\x{0BCC}\x{0BCD}\x{0BD7}\x{0C00}\x{0C01}-\x{0C03}\x{0C04}\x{0C3E}-\x{0C40}\x{0C41}-\x{0C44}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0C82}-\x{0C83}\x{0CBC}\x{0CBE}\x{0CBF}\x{0CC0}-\x{0CC4}\x{0CC6}\x{0CC7}-\x{0CC8}\x{0CCA}-\x{0CCB}\x{0CCC}-\x{0CCD}\x{0CD5}-\x{0CD6}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D02}-\x{0D03}\x{0D3B}-\x{0D3C}\x{0D3E}-\x{0D40}\x{0D41}-\x{0D44}\x{0D46}-\x{0D48}\x{0D4A}-\x{0D4C}\x{0D4D}\x{0D57}\x{0D62}-\x{0D63}\x{0D81}\x{0D82}-\x{0D83}\x{0DCA}\x{0DCF}-\x{0DD1}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0DD8}-\x{0DDF}\x{0DF2}-\x{0DF3}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3E}-\x{0F3F}\x{0F71}-\x{0F7E}\x{0F7F}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102B}-\x{102C}\x{102D}-\x{1030}\x{1031}\x{1032}-\x{1037}\x{1038}\x{1039}-\x{103A}\x{103B}-\x{103C}\x{103D}-\x{103E}\x{1056}-\x{1057}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1062}-\x{1064}\x{1067}-\x{106D}\x{1071}-\x{1074}\x{1082}\x{1083}-\x{1084}\x{1085}-\x{1086}\x{1087}-\x{108C}\x{108D}\x{108F}\x{109A}-\x{109C}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B6}\x{17B7}-\x{17BD}\x{17BE}-\x{17C5}\x{17C6}\x{17C7}-\x{17C8}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1923}-\x{1926}\x{1927}-\x{1928}\x{1929}-\x{192B}\x{1930}-\x{1931}\x{1932}\x{1933}-\x{1938}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A19}-\x{1A1A}\x{1A1B}\x{1A55}\x{1A56}\x{1A57}\x{1A58}-\x{1A5E}\x{1A60}\x{1A61}\x{1A62}\x{1A63}-\x{1A64}\x{1A65}-\x{1A6C}\x{1A6D}-\x{1A72}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B04}\x{1B34}\x{1B35}\x{1B36}-\x{1B3A}\x{1B3B}\x{1B3C}\x{1B3D}-\x{1B41}\x{1B42}\x{1B43}-\x{1B44}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1B82}\x{1BA1}\x{1BA2}-\x{1BA5}\x{1BA6}-\x{1BA7}\x{1BA8}-\x{1BA9}\x{1BAA}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE7}\x{1BE8}-\x{1BE9}\x{1BEA}-\x{1BEC}\x{1BED}\x{1BEE}\x{1BEF}-\x{1BF1}\x{1BF2}-\x{1BF3}\x{1C24}-\x{1C2B}\x{1C2C}-\x{1C33}\x{1C34}-\x{1C35}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE1}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF7}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{302E}-\x{302F}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A823}-\x{A824}\x{A825}-\x{A826}\x{A827}\x{A82C}\x{A880}-\x{A881}\x{A8B4}-\x{A8C3}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A952}-\x{A953}\x{A980}-\x{A982}\x{A983}\x{A9B3}\x{A9B4}-\x{A9B5}\x{A9B6}-\x{A9B9}\x{A9BA}-\x{A9BB}\x{A9BC}-\x{A9BD}\x{A9BE}-\x{A9C0}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA2F}-\x{AA30}\x{AA31}-\x{AA32}\x{AA33}-\x{AA34}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA4D}\x{AA7B}\x{AA7C}\x{AA7D}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEB}\x{AAEC}-\x{AAED}\x{AAEE}-\x{AAEF}\x{AAF5}\x{AAF6}\x{ABE3}-\x{ABE4}\x{ABE5}\x{ABE6}-\x{ABE7}\x{ABE8}\x{ABE9}-\x{ABEA}\x{ABEC}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11000}\x{11001}\x{11002}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{11082}\x{110B0}-\x{110B2}\x{110B3}-\x{110B6}\x{110B7}-\x{110B8}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112C}\x{1112D}-\x{11134}\x{11145}-\x{11146}\x{11173}\x{11180}-\x{11181}\x{11182}\x{111B3}-\x{111B5}\x{111B6}-\x{111BE}\x{111BF}-\x{111C0}\x{111C9}-\x{111CC}\x{111CE}\x{111CF}\x{1122C}-\x{1122E}\x{1122F}-\x{11231}\x{11232}-\x{11233}\x{11234}\x{11235}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E0}-\x{112E2}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{11302}-\x{11303}\x{1133B}-\x{1133C}\x{1133E}-\x{1133F}\x{11340}\x{11341}-\x{11344}\x{11347}-\x{11348}\x{1134B}-\x{1134D}\x{11357}\x{11362}-\x{11363}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11435}-\x{11437}\x{11438}-\x{1143F}\x{11440}-\x{11441}\x{11442}-\x{11444}\x{11445}\x{11446}\x{1145E}\x{114B0}-\x{114B2}\x{114B3}-\x{114B8}\x{114B9}\x{114BA}\x{114BB}-\x{114BE}\x{114BF}-\x{114C0}\x{114C1}\x{114C2}-\x{114C3}\x{115AF}-\x{115B1}\x{115B2}-\x{115B5}\x{115B8}-\x{115BB}\x{115BC}-\x{115BD}\x{115BE}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11630}-\x{11632}\x{11633}-\x{1163A}\x{1163B}-\x{1163C}\x{1163D}\x{1163E}\x{1163F}-\x{11640}\x{116AB}\x{116AC}\x{116AD}\x{116AE}-\x{116AF}\x{116B0}-\x{116B5}\x{116B6}\x{116B7}\x{1171D}-\x{1171F}\x{11720}-\x{11721}\x{11722}-\x{11725}\x{11726}\x{11727}-\x{1172B}\x{1182C}-\x{1182E}\x{1182F}-\x{11837}\x{11838}\x{11839}-\x{1183A}\x{11930}-\x{11935}\x{11937}-\x{11938}\x{1193B}-\x{1193C}\x{1193D}\x{1193E}\x{11940}\x{11942}\x{11943}\x{119D1}-\x{119D3}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119DC}-\x{119DF}\x{119E0}\x{119E4}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A39}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A57}-\x{11A58}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A97}\x{11A98}-\x{11A99}\x{11C2F}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3E}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CA9}\x{11CAA}-\x{11CB0}\x{11CB1}\x{11CB2}-\x{11CB3}\x{11CB4}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D8A}-\x{11D8E}\x{11D90}-\x{11D91}\x{11D93}-\x{11D94}\x{11D95}\x{11D96}\x{11D97}\x{11EF3}-\x{11EF4}\x{11EF5}-\x{11EF6}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F51}-\x{16F87}\x{16F8F}-\x{16F92}\x{16FE4}\x{16FF0}-\x{16FF1}\x{1BC9D}-\x{1BC9E}\x{1D165}-\x{1D166}\x{1D167}-\x{1D169}\x{1D16D}-\x{1D172}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]/u'; + + const RTL_LABEL = '/[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + + const BIDI_STEP_1_LTR = '/^[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; + const BIDI_STEP_1_RTL = '/^[\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{200F}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + const BIDI_STEP_2 = '/[^\x{0000}-\x{0008}\x{000E}-\x{001B}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{0030}-\x{0039}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B2}-\x{00B3}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00B9}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{2060}-\x{2064}\x{2065}\x{206A}-\x{206F}\x{2070}\x{2074}-\x{2079}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{2080}-\x{2089}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{2488}-\x{249B}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF10}-\x{FF19}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{102E1}-\x{102FB}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1D7CE}-\x{1D7FF}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F100}-\x{1F10A}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FBF0}-\x{1FBF9}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}]/u'; + const BIDI_STEP_3 = '/[\x{0030}-\x{0039}\x{00B2}-\x{00B3}\x{00B9}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06F0}-\x{06F9}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{200F}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2488}-\x{249B}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FF10}-\x{FF19}\x{102E1}-\x{102FB}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1D7CE}-\x{1D7FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F100}-\x{1F10A}\x{1FBF0}-\x{1FBF9}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; + const BIDI_STEP_4_AN = '/[\x{0600}-\x{0605}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{06DD}\x{08E2}\x{10D30}-\x{10D39}\x{10E60}-\x{10E7E}]/u'; + const BIDI_STEP_4_EN = '/[\x{0030}-\x{0039}\x{00B2}-\x{00B3}\x{00B9}\x{06F0}-\x{06F9}\x{2070}\x{2074}-\x{2079}\x{2080}-\x{2089}\x{2488}-\x{249B}\x{FF10}-\x{FF19}\x{102E1}-\x{102FB}\x{1D7CE}-\x{1D7FF}\x{1F100}-\x{1F10A}\x{1FBF0}-\x{1FBF9}]/u'; + const BIDI_STEP_5 = '/[\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0085}\x{0590}\x{05BE}\x{05C0}\x{05C3}\x{05C6}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0608}\x{060B}\x{060D}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{0660}-\x{0669}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06DD}\x{06E5}-\x{06E6}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0712}-\x{072F}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07F4}-\x{07F5}\x{07FA}\x{07FB}-\x{07FC}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{081A}\x{0824}\x{0828}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08E2}\x{1680}\x{2000}-\x{200A}\x{200F}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{205F}\x{2066}\x{2067}\x{2068}\x{2069}\x{3000}\x{FB1D}\x{FB1F}-\x{FB28}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFE}-\x{FDFF}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A04}\x{10A07}-\x{10A0B}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A3B}-\x{10A3E}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}]/u'; + const BIDI_STEP_6 = '/[^\x{0000}-\x{0008}\x{0009}\x{000A}\x{000B}\x{000C}\x{000D}\x{000E}-\x{001B}\x{001C}-\x{001E}\x{001F}\x{0020}\x{0021}-\x{0022}\x{0023}\x{0024}\x{0025}\x{0026}-\x{0027}\x{0028}\x{0029}\x{002A}\x{002B}\x{002C}\x{002D}\x{002E}-\x{002F}\x{003A}\x{003B}\x{003C}-\x{003E}\x{003F}-\x{0040}\x{005B}\x{005C}\x{005D}\x{005E}\x{005F}\x{0060}\x{007B}\x{007C}\x{007D}\x{007E}\x{007F}-\x{0084}\x{0085}\x{0086}-\x{009F}\x{00A0}\x{00A1}\x{00A2}-\x{00A5}\x{00A6}\x{00A7}\x{00A8}\x{00A9}\x{00AB}\x{00AC}\x{00AD}\x{00AE}\x{00AF}\x{00B0}\x{00B1}\x{00B4}\x{00B6}-\x{00B7}\x{00B8}\x{00BB}\x{00BC}-\x{00BE}\x{00BF}\x{00D7}\x{00F7}\x{02B9}-\x{02BA}\x{02C2}-\x{02C5}\x{02C6}-\x{02CF}\x{02D2}-\x{02DF}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037E}\x{0384}-\x{0385}\x{0387}\x{03F6}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{058A}\x{058D}-\x{058E}\x{058F}\x{0590}\x{0591}-\x{05BD}\x{05BE}\x{05BF}\x{05C0}\x{05C1}-\x{05C2}\x{05C3}\x{05C4}-\x{05C5}\x{05C6}\x{05C7}\x{05C8}-\x{05CF}\x{05D0}-\x{05EA}\x{05EB}-\x{05EE}\x{05EF}-\x{05F2}\x{05F3}-\x{05F4}\x{05F5}-\x{05FF}\x{0600}-\x{0605}\x{0606}-\x{0607}\x{0608}\x{0609}-\x{060A}\x{060B}\x{060C}\x{060D}\x{060E}-\x{060F}\x{0610}-\x{061A}\x{061B}\x{061C}\x{061D}\x{061E}-\x{061F}\x{0620}-\x{063F}\x{0640}\x{0641}-\x{064A}\x{064B}-\x{065F}\x{0660}-\x{0669}\x{066A}\x{066B}-\x{066C}\x{066D}\x{066E}-\x{066F}\x{0670}\x{0671}-\x{06D3}\x{06D4}\x{06D5}\x{06D6}-\x{06DC}\x{06DD}\x{06DE}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06E9}\x{06EA}-\x{06ED}\x{06EE}-\x{06EF}\x{06FA}-\x{06FC}\x{06FD}-\x{06FE}\x{06FF}\x{0700}-\x{070D}\x{070E}\x{070F}\x{0710}\x{0711}\x{0712}-\x{072F}\x{0730}-\x{074A}\x{074B}-\x{074C}\x{074D}-\x{07A5}\x{07A6}-\x{07B0}\x{07B1}\x{07B2}-\x{07BF}\x{07C0}-\x{07C9}\x{07CA}-\x{07EA}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07F6}\x{07F7}-\x{07F9}\x{07FA}\x{07FB}-\x{07FC}\x{07FD}\x{07FE}-\x{07FF}\x{0800}-\x{0815}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{082E}-\x{082F}\x{0830}-\x{083E}\x{083F}\x{0840}-\x{0858}\x{0859}-\x{085B}\x{085C}-\x{085D}\x{085E}\x{085F}\x{0860}-\x{086A}\x{086B}-\x{086F}\x{0870}-\x{089F}\x{08A0}-\x{08B4}\x{08B5}\x{08B6}-\x{08C7}\x{08C8}-\x{08D2}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09F2}-\x{09F3}\x{09FB}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AF1}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0BF3}-\x{0BF8}\x{0BF9}\x{0BFA}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C78}-\x{0C7E}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E3F}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F3A}\x{0F3B}\x{0F3C}\x{0F3D}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1390}-\x{1399}\x{1400}\x{1680}\x{169B}\x{169C}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DB}\x{17DD}\x{17F0}-\x{17F9}\x{1800}-\x{1805}\x{1806}\x{1807}-\x{180A}\x{180B}-\x{180D}\x{180E}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1940}\x{1944}-\x{1945}\x{19DE}-\x{19FF}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{2000}-\x{200A}\x{200B}-\x{200D}\x{200F}\x{2010}-\x{2015}\x{2016}-\x{2017}\x{2018}\x{2019}\x{201A}\x{201B}-\x{201C}\x{201D}\x{201E}\x{201F}\x{2020}-\x{2027}\x{2028}\x{2029}\x{202A}\x{202B}\x{202C}\x{202D}\x{202E}\x{202F}\x{2030}-\x{2034}\x{2035}-\x{2038}\x{2039}\x{203A}\x{203B}-\x{203E}\x{203F}-\x{2040}\x{2041}-\x{2043}\x{2044}\x{2045}\x{2046}\x{2047}-\x{2051}\x{2052}\x{2053}\x{2054}\x{2055}-\x{205E}\x{205F}\x{2060}-\x{2064}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}\x{206A}-\x{206F}\x{207A}-\x{207B}\x{207C}\x{207D}\x{207E}\x{208A}-\x{208B}\x{208C}\x{208D}\x{208E}\x{20A0}-\x{20BF}\x{20C0}-\x{20CF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2100}-\x{2101}\x{2103}-\x{2106}\x{2108}-\x{2109}\x{2114}\x{2116}-\x{2117}\x{2118}\x{211E}-\x{2123}\x{2125}\x{2127}\x{2129}\x{212E}\x{213A}-\x{213B}\x{2140}-\x{2144}\x{214A}\x{214B}\x{214C}-\x{214D}\x{2150}-\x{215F}\x{2189}\x{218A}-\x{218B}\x{2190}-\x{2194}\x{2195}-\x{2199}\x{219A}-\x{219B}\x{219C}-\x{219F}\x{21A0}\x{21A1}-\x{21A2}\x{21A3}\x{21A4}-\x{21A5}\x{21A6}\x{21A7}-\x{21AD}\x{21AE}\x{21AF}-\x{21CD}\x{21CE}-\x{21CF}\x{21D0}-\x{21D1}\x{21D2}\x{21D3}\x{21D4}\x{21D5}-\x{21F3}\x{21F4}-\x{2211}\x{2212}\x{2213}\x{2214}-\x{22FF}\x{2300}-\x{2307}\x{2308}\x{2309}\x{230A}\x{230B}\x{230C}-\x{231F}\x{2320}-\x{2321}\x{2322}-\x{2328}\x{2329}\x{232A}\x{232B}-\x{2335}\x{237B}\x{237C}\x{237D}-\x{2394}\x{2396}-\x{239A}\x{239B}-\x{23B3}\x{23B4}-\x{23DB}\x{23DC}-\x{23E1}\x{23E2}-\x{2426}\x{2440}-\x{244A}\x{2460}-\x{2487}\x{24EA}-\x{24FF}\x{2500}-\x{25B6}\x{25B7}\x{25B8}-\x{25C0}\x{25C1}\x{25C2}-\x{25F7}\x{25F8}-\x{25FF}\x{2600}-\x{266E}\x{266F}\x{2670}-\x{26AB}\x{26AD}-\x{2767}\x{2768}\x{2769}\x{276A}\x{276B}\x{276C}\x{276D}\x{276E}\x{276F}\x{2770}\x{2771}\x{2772}\x{2773}\x{2774}\x{2775}\x{2776}-\x{2793}\x{2794}-\x{27BF}\x{27C0}-\x{27C4}\x{27C5}\x{27C6}\x{27C7}-\x{27E5}\x{27E6}\x{27E7}\x{27E8}\x{27E9}\x{27EA}\x{27EB}\x{27EC}\x{27ED}\x{27EE}\x{27EF}\x{27F0}-\x{27FF}\x{2900}-\x{2982}\x{2983}\x{2984}\x{2985}\x{2986}\x{2987}\x{2988}\x{2989}\x{298A}\x{298B}\x{298C}\x{298D}\x{298E}\x{298F}\x{2990}\x{2991}\x{2992}\x{2993}\x{2994}\x{2995}\x{2996}\x{2997}\x{2998}\x{2999}-\x{29D7}\x{29D8}\x{29D9}\x{29DA}\x{29DB}\x{29DC}-\x{29FB}\x{29FC}\x{29FD}\x{29FE}-\x{2AFF}\x{2B00}-\x{2B2F}\x{2B30}-\x{2B44}\x{2B45}-\x{2B46}\x{2B47}-\x{2B4C}\x{2B4D}-\x{2B73}\x{2B76}-\x{2B95}\x{2B97}-\x{2BFF}\x{2CE5}-\x{2CEA}\x{2CEF}-\x{2CF1}\x{2CF9}-\x{2CFC}\x{2CFD}\x{2CFE}-\x{2CFF}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E00}-\x{2E01}\x{2E02}\x{2E03}\x{2E04}\x{2E05}\x{2E06}-\x{2E08}\x{2E09}\x{2E0A}\x{2E0B}\x{2E0C}\x{2E0D}\x{2E0E}-\x{2E16}\x{2E17}\x{2E18}-\x{2E19}\x{2E1A}\x{2E1B}\x{2E1C}\x{2E1D}\x{2E1E}-\x{2E1F}\x{2E20}\x{2E21}\x{2E22}\x{2E23}\x{2E24}\x{2E25}\x{2E26}\x{2E27}\x{2E28}\x{2E29}\x{2E2A}-\x{2E2E}\x{2E2F}\x{2E30}-\x{2E39}\x{2E3A}-\x{2E3B}\x{2E3C}-\x{2E3F}\x{2E40}\x{2E41}\x{2E42}\x{2E43}-\x{2E4F}\x{2E50}-\x{2E51}\x{2E52}\x{2E80}-\x{2E99}\x{2E9B}-\x{2EF3}\x{2F00}-\x{2FD5}\x{2FF0}-\x{2FFB}\x{3000}\x{3001}-\x{3003}\x{3004}\x{3008}\x{3009}\x{300A}\x{300B}\x{300C}\x{300D}\x{300E}\x{300F}\x{3010}\x{3011}\x{3012}-\x{3013}\x{3014}\x{3015}\x{3016}\x{3017}\x{3018}\x{3019}\x{301A}\x{301B}\x{301C}\x{301D}\x{301E}-\x{301F}\x{3020}\x{302A}-\x{302D}\x{3030}\x{3036}-\x{3037}\x{303D}\x{303E}-\x{303F}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{30A0}\x{30FB}\x{31C0}-\x{31E3}\x{321D}-\x{321E}\x{3250}\x{3251}-\x{325F}\x{327C}-\x{327E}\x{32B1}-\x{32BF}\x{32CC}-\x{32CF}\x{3377}-\x{337A}\x{33DE}-\x{33DF}\x{33FF}\x{4DC0}-\x{4DFF}\x{A490}-\x{A4C6}\x{A60D}-\x{A60F}\x{A66F}\x{A670}-\x{A672}\x{A673}\x{A674}-\x{A67D}\x{A67E}\x{A67F}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A788}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A828}-\x{A82B}\x{A82C}\x{A838}\x{A839}\x{A874}-\x{A877}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{AB6A}-\x{AB6B}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1D}\x{FB1E}\x{FB1F}-\x{FB28}\x{FB29}\x{FB2A}-\x{FB36}\x{FB37}\x{FB38}-\x{FB3C}\x{FB3D}\x{FB3E}\x{FB3F}\x{FB40}-\x{FB41}\x{FB42}\x{FB43}-\x{FB44}\x{FB45}\x{FB46}-\x{FB4F}\x{FB50}-\x{FBB1}\x{FBB2}-\x{FBC1}\x{FBC2}-\x{FBD2}\x{FBD3}-\x{FD3D}\x{FD3E}\x{FD3F}\x{FD40}-\x{FD4F}\x{FD50}-\x{FD8F}\x{FD90}-\x{FD91}\x{FD92}-\x{FDC7}\x{FDC8}-\x{FDCF}\x{FDD0}-\x{FDEF}\x{FDF0}-\x{FDFB}\x{FDFC}\x{FDFD}\x{FDFE}-\x{FDFF}\x{FE00}-\x{FE0F}\x{FE10}-\x{FE16}\x{FE17}\x{FE18}\x{FE19}\x{FE20}-\x{FE2F}\x{FE30}\x{FE31}-\x{FE32}\x{FE33}-\x{FE34}\x{FE35}\x{FE36}\x{FE37}\x{FE38}\x{FE39}\x{FE3A}\x{FE3B}\x{FE3C}\x{FE3D}\x{FE3E}\x{FE3F}\x{FE40}\x{FE41}\x{FE42}\x{FE43}\x{FE44}\x{FE45}-\x{FE46}\x{FE47}\x{FE48}\x{FE49}-\x{FE4C}\x{FE4D}-\x{FE4F}\x{FE50}\x{FE51}\x{FE52}\x{FE54}\x{FE55}\x{FE56}-\x{FE57}\x{FE58}\x{FE59}\x{FE5A}\x{FE5B}\x{FE5C}\x{FE5D}\x{FE5E}\x{FE5F}\x{FE60}-\x{FE61}\x{FE62}\x{FE63}\x{FE64}-\x{FE66}\x{FE68}\x{FE69}\x{FE6A}\x{FE6B}\x{FE70}-\x{FE74}\x{FE75}\x{FE76}-\x{FEFC}\x{FEFD}-\x{FEFE}\x{FEFF}\x{FF01}-\x{FF02}\x{FF03}\x{FF04}\x{FF05}\x{FF06}-\x{FF07}\x{FF08}\x{FF09}\x{FF0A}\x{FF0B}\x{FF0C}\x{FF0D}\x{FF0E}-\x{FF0F}\x{FF1A}\x{FF1B}\x{FF1C}-\x{FF1E}\x{FF1F}-\x{FF20}\x{FF3B}\x{FF3C}\x{FF3D}\x{FF3E}\x{FF3F}\x{FF40}\x{FF5B}\x{FF5C}\x{FF5D}\x{FF5E}\x{FF5F}\x{FF60}\x{FF61}\x{FF62}\x{FF63}\x{FF64}-\x{FF65}\x{FFE0}-\x{FFE1}\x{FFE2}\x{FFE3}\x{FFE4}\x{FFE5}-\x{FFE6}\x{FFE8}\x{FFE9}-\x{FFEC}\x{FFED}-\x{FFEE}\x{FFF0}-\x{FFF8}\x{FFF9}-\x{FFFB}\x{FFFC}-\x{FFFD}\x{FFFE}-\x{FFFF}\x{10101}\x{10140}-\x{10174}\x{10175}-\x{10178}\x{10179}-\x{10189}\x{1018A}-\x{1018B}\x{1018C}\x{10190}-\x{1019C}\x{101A0}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10800}-\x{10805}\x{10806}-\x{10807}\x{10808}\x{10809}\x{1080A}-\x{10835}\x{10836}\x{10837}-\x{10838}\x{10839}-\x{1083B}\x{1083C}\x{1083D}-\x{1083E}\x{1083F}-\x{10855}\x{10856}\x{10857}\x{10858}-\x{1085F}\x{10860}-\x{10876}\x{10877}-\x{10878}\x{10879}-\x{1087F}\x{10880}-\x{1089E}\x{1089F}-\x{108A6}\x{108A7}-\x{108AF}\x{108B0}-\x{108DF}\x{108E0}-\x{108F2}\x{108F3}\x{108F4}-\x{108F5}\x{108F6}-\x{108FA}\x{108FB}-\x{108FF}\x{10900}-\x{10915}\x{10916}-\x{1091B}\x{1091C}-\x{1091E}\x{1091F}\x{10920}-\x{10939}\x{1093A}-\x{1093E}\x{1093F}\x{10940}-\x{1097F}\x{10980}-\x{109B7}\x{109B8}-\x{109BB}\x{109BC}-\x{109BD}\x{109BE}-\x{109BF}\x{109C0}-\x{109CF}\x{109D0}-\x{109D1}\x{109D2}-\x{109FF}\x{10A00}\x{10A01}-\x{10A03}\x{10A04}\x{10A05}-\x{10A06}\x{10A07}-\x{10A0B}\x{10A0C}-\x{10A0F}\x{10A10}-\x{10A13}\x{10A14}\x{10A15}-\x{10A17}\x{10A18}\x{10A19}-\x{10A35}\x{10A36}-\x{10A37}\x{10A38}-\x{10A3A}\x{10A3B}-\x{10A3E}\x{10A3F}\x{10A40}-\x{10A48}\x{10A49}-\x{10A4F}\x{10A50}-\x{10A58}\x{10A59}-\x{10A5F}\x{10A60}-\x{10A7C}\x{10A7D}-\x{10A7E}\x{10A7F}\x{10A80}-\x{10A9C}\x{10A9D}-\x{10A9F}\x{10AA0}-\x{10ABF}\x{10AC0}-\x{10AC7}\x{10AC8}\x{10AC9}-\x{10AE4}\x{10AE5}-\x{10AE6}\x{10AE7}-\x{10AEA}\x{10AEB}-\x{10AEF}\x{10AF0}-\x{10AF6}\x{10AF7}-\x{10AFF}\x{10B00}-\x{10B35}\x{10B36}-\x{10B38}\x{10B39}-\x{10B3F}\x{10B40}-\x{10B55}\x{10B56}-\x{10B57}\x{10B58}-\x{10B5F}\x{10B60}-\x{10B72}\x{10B73}-\x{10B77}\x{10B78}-\x{10B7F}\x{10B80}-\x{10B91}\x{10B92}-\x{10B98}\x{10B99}-\x{10B9C}\x{10B9D}-\x{10BA8}\x{10BA9}-\x{10BAF}\x{10BB0}-\x{10BFF}\x{10C00}-\x{10C48}\x{10C49}-\x{10C7F}\x{10C80}-\x{10CB2}\x{10CB3}-\x{10CBF}\x{10CC0}-\x{10CF2}\x{10CF3}-\x{10CF9}\x{10CFA}-\x{10CFF}\x{10D00}-\x{10D23}\x{10D24}-\x{10D27}\x{10D28}-\x{10D2F}\x{10D30}-\x{10D39}\x{10D3A}-\x{10D3F}\x{10D40}-\x{10E5F}\x{10E60}-\x{10E7E}\x{10E7F}\x{10E80}-\x{10EA9}\x{10EAA}\x{10EAB}-\x{10EAC}\x{10EAD}\x{10EAE}-\x{10EAF}\x{10EB0}-\x{10EB1}\x{10EB2}-\x{10EFF}\x{10F00}-\x{10F1C}\x{10F1D}-\x{10F26}\x{10F27}\x{10F28}-\x{10F2F}\x{10F30}-\x{10F45}\x{10F46}-\x{10F50}\x{10F51}-\x{10F54}\x{10F55}-\x{10F59}\x{10F5A}-\x{10F6F}\x{10F70}-\x{10FAF}\x{10FB0}-\x{10FC4}\x{10FC5}-\x{10FCB}\x{10FCC}-\x{10FDF}\x{10FE0}-\x{10FF6}\x{10FF7}-\x{10FFF}\x{11001}\x{11038}-\x{11046}\x{11052}-\x{11065}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{11660}-\x{1166C}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{11FD5}-\x{11FDC}\x{11FDD}-\x{11FE0}\x{11FE1}-\x{11FF1}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE2}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D200}-\x{1D241}\x{1D242}-\x{1D244}\x{1D245}\x{1D300}-\x{1D356}\x{1D6DB}\x{1D715}\x{1D74F}\x{1D789}\x{1D7C3}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E2FF}\x{1E800}-\x{1E8C4}\x{1E8C5}-\x{1E8C6}\x{1E8C7}-\x{1E8CF}\x{1E8D0}-\x{1E8D6}\x{1E8D7}-\x{1E8FF}\x{1E900}-\x{1E943}\x{1E944}-\x{1E94A}\x{1E94B}\x{1E94C}-\x{1E94F}\x{1E950}-\x{1E959}\x{1E95A}-\x{1E95D}\x{1E95E}-\x{1E95F}\x{1E960}-\x{1EC6F}\x{1EC70}\x{1EC71}-\x{1ECAB}\x{1ECAC}\x{1ECAD}-\x{1ECAF}\x{1ECB0}\x{1ECB1}-\x{1ECB4}\x{1ECB5}-\x{1ECBF}\x{1ECC0}-\x{1ECFF}\x{1ED00}\x{1ED01}-\x{1ED2D}\x{1ED2E}\x{1ED2F}-\x{1ED3D}\x{1ED3E}-\x{1ED4F}\x{1ED50}-\x{1EDFF}\x{1EE00}-\x{1EE03}\x{1EE04}\x{1EE05}-\x{1EE1F}\x{1EE20}\x{1EE21}-\x{1EE22}\x{1EE23}\x{1EE24}\x{1EE25}-\x{1EE26}\x{1EE27}\x{1EE28}\x{1EE29}-\x{1EE32}\x{1EE33}\x{1EE34}-\x{1EE37}\x{1EE38}\x{1EE39}\x{1EE3A}\x{1EE3B}\x{1EE3C}-\x{1EE41}\x{1EE42}\x{1EE43}-\x{1EE46}\x{1EE47}\x{1EE48}\x{1EE49}\x{1EE4A}\x{1EE4B}\x{1EE4C}\x{1EE4D}-\x{1EE4F}\x{1EE50}\x{1EE51}-\x{1EE52}\x{1EE53}\x{1EE54}\x{1EE55}-\x{1EE56}\x{1EE57}\x{1EE58}\x{1EE59}\x{1EE5A}\x{1EE5B}\x{1EE5C}\x{1EE5D}\x{1EE5E}\x{1EE5F}\x{1EE60}\x{1EE61}-\x{1EE62}\x{1EE63}\x{1EE64}\x{1EE65}-\x{1EE66}\x{1EE67}-\x{1EE6A}\x{1EE6B}\x{1EE6C}-\x{1EE72}\x{1EE73}\x{1EE74}-\x{1EE77}\x{1EE78}\x{1EE79}-\x{1EE7C}\x{1EE7D}\x{1EE7E}\x{1EE7F}\x{1EE80}-\x{1EE89}\x{1EE8A}\x{1EE8B}-\x{1EE9B}\x{1EE9C}-\x{1EEA0}\x{1EEA1}-\x{1EEA3}\x{1EEA4}\x{1EEA5}-\x{1EEA9}\x{1EEAA}\x{1EEAB}-\x{1EEBB}\x{1EEBC}-\x{1EEEF}\x{1EEF0}-\x{1EEF1}\x{1EEF2}-\x{1EEFF}\x{1EF00}-\x{1EFFF}\x{1F000}-\x{1F02B}\x{1F030}-\x{1F093}\x{1F0A0}-\x{1F0AE}\x{1F0B1}-\x{1F0BF}\x{1F0C1}-\x{1F0CF}\x{1F0D1}-\x{1F0F5}\x{1F10B}-\x{1F10C}\x{1F10D}-\x{1F10F}\x{1F12F}\x{1F16A}-\x{1F16F}\x{1F1AD}\x{1F260}-\x{1F265}\x{1F300}-\x{1F3FA}\x{1F3FB}-\x{1F3FF}\x{1F400}-\x{1F6D7}\x{1F6E0}-\x{1F6EC}\x{1F6F0}-\x{1F6FC}\x{1F700}-\x{1F773}\x{1F780}-\x{1F7D8}\x{1F7E0}-\x{1F7EB}\x{1F800}-\x{1F80B}\x{1F810}-\x{1F847}\x{1F850}-\x{1F859}\x{1F860}-\x{1F887}\x{1F890}-\x{1F8AD}\x{1F8B0}-\x{1F8B1}\x{1F900}-\x{1F978}\x{1F97A}-\x{1F9CB}\x{1F9CD}-\x{1FA53}\x{1FA60}-\x{1FA6D}\x{1FA70}-\x{1FA74}\x{1FA78}-\x{1FA7A}\x{1FA80}-\x{1FA86}\x{1FA90}-\x{1FAA8}\x{1FAB0}-\x{1FAB6}\x{1FAC0}-\x{1FAC2}\x{1FAD0}-\x{1FAD6}\x{1FB00}-\x{1FB92}\x{1FB94}-\x{1FBCA}\x{1FFFE}-\x{1FFFF}\x{2FFFE}-\x{2FFFF}\x{3FFFE}-\x{3FFFF}\x{4FFFE}-\x{4FFFF}\x{5FFFE}-\x{5FFFF}\x{6FFFE}-\x{6FFFF}\x{7FFFE}-\x{7FFFF}\x{8FFFE}-\x{8FFFF}\x{9FFFE}-\x{9FFFF}\x{AFFFE}-\x{AFFFF}\x{BFFFE}-\x{BFFFF}\x{CFFFE}-\x{CFFFF}\x{DFFFE}-\x{E0000}\x{E0001}\x{E0002}-\x{E001F}\x{E0020}-\x{E007F}\x{E0080}-\x{E00FF}\x{E0100}-\x{E01EF}\x{E01F0}-\x{E0FFF}\x{EFFFE}-\x{EFFFF}\x{FFFFE}-\x{FFFFF}\x{10FFFE}-\x{10FFFF}][\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A06}\x{11A09}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1D167}-\x{1D169}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{E0100}-\x{E01EF}]*$/u'; + + const ZWNJ = '/([\x{A872}\x{10ACD}\x{10AD7}\x{10D00}\x{10FCB}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B4}\x{08B6}-\x{08B8}\x{08BA}-\x{08C7}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}][\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{13430}-\x{13438}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*\x{200C}[\x{00AD}\x{0300}-\x{036F}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{0610}-\x{061A}\x{061C}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DF}-\x{06E4}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07FD}\x{0816}-\x{0819}\x{081B}-\x{0823}\x{0825}-\x{0827}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B55}-\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0D81}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EBC}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17DD}\x{180B}-\x{180D}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1ABF}-\x{1AC0}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{200B}\x{200E}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{206A}-\x{206F}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2CEF}-\x{2CF1}\x{2D7F}\x{2DE0}-\x{2DFF}\x{302A}-\x{302D}\x{3099}-\x{309A}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A82C}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}-\x{A9BD}\x{A9E5}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AAEC}-\x{AAED}\x{AAF6}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FE00}-\x{FE0F}\x{FE20}-\x{FE2F}\x{FEFF}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10EAB}-\x{10EAC}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{111CF}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{1193B}-\x{1193C}\x{1193E}\x{11943}\x{119D4}-\x{119D7}\x{119DA}-\x{119DB}\x{119E0}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{13430}-\x{13438}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16F4F}\x{16F8F}-\x{16F92}\x{16FE4}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E130}-\x{1E136}\x{1E2EC}-\x{1E2EF}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1E94B}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}]*)[\x{0622}-\x{0625}\x{0627}\x{0629}\x{062F}-\x{0632}\x{0648}\x{0671}-\x{0673}\x{0675}-\x{0677}\x{0688}-\x{0699}\x{06C0}\x{06C3}-\x{06CB}\x{06CD}\x{06CF}\x{06D2}-\x{06D3}\x{06D5}\x{06EE}-\x{06EF}\x{0710}\x{0715}-\x{0719}\x{071E}\x{0728}\x{072A}\x{072C}\x{072F}\x{074D}\x{0759}-\x{075B}\x{076B}-\x{076C}\x{0771}\x{0773}-\x{0774}\x{0778}-\x{0779}\x{0840}\x{0846}-\x{0847}\x{0849}\x{0854}\x{0856}-\x{0858}\x{0867}\x{0869}-\x{086A}\x{08AA}-\x{08AC}\x{08AE}\x{08B1}-\x{08B2}\x{08B9}\x{10AC5}\x{10AC7}\x{10AC9}-\x{10ACA}\x{10ACE}-\x{10AD2}\x{10ADD}\x{10AE1}\x{10AE4}\x{10AEF}\x{10B81}\x{10B83}-\x{10B85}\x{10B89}\x{10B8C}\x{10B8E}-\x{10B8F}\x{10B91}\x{10BA9}-\x{10BAC}\x{10D22}\x{10F33}\x{10F54}\x{10FB4}-\x{10FB6}\x{10FB9}-\x{10FBA}\x{10FBD}\x{10FC2}-\x{10FC3}\x{10FC9}\x{0620}\x{0626}\x{0628}\x{062A}-\x{062E}\x{0633}-\x{063F}\x{0641}-\x{0647}\x{0649}-\x{064A}\x{066E}-\x{066F}\x{0678}-\x{0687}\x{069A}-\x{06BF}\x{06C1}-\x{06C2}\x{06CC}\x{06CE}\x{06D0}-\x{06D1}\x{06FA}-\x{06FC}\x{06FF}\x{0712}-\x{0714}\x{071A}-\x{071D}\x{071F}-\x{0727}\x{0729}\x{072B}\x{072D}-\x{072E}\x{074E}-\x{0758}\x{075C}-\x{076A}\x{076D}-\x{0770}\x{0772}\x{0775}-\x{0777}\x{077A}-\x{077F}\x{07CA}-\x{07EA}\x{0841}-\x{0845}\x{0848}\x{084A}-\x{0853}\x{0855}\x{0860}\x{0862}-\x{0865}\x{0868}\x{08A0}-\x{08A9}\x{08AF}-\x{08B0}\x{08B3}-\x{08B4}\x{08B6}-\x{08B8}\x{08BA}-\x{08C7}\x{1807}\x{1820}-\x{1842}\x{1843}\x{1844}-\x{1878}\x{1887}-\x{18A8}\x{18AA}\x{A840}-\x{A871}\x{10AC0}-\x{10AC4}\x{10AD3}-\x{10AD6}\x{10AD8}-\x{10ADC}\x{10ADE}-\x{10AE0}\x{10AEB}-\x{10AEE}\x{10B80}\x{10B82}\x{10B86}-\x{10B88}\x{10B8A}-\x{10B8B}\x{10B8D}\x{10B90}\x{10BAD}-\x{10BAE}\x{10D01}-\x{10D21}\x{10D23}\x{10F30}-\x{10F32}\x{10F34}-\x{10F44}\x{10F51}-\x{10F53}\x{10FB0}\x{10FB2}-\x{10FB3}\x{10FB8}\x{10FBB}-\x{10FBC}\x{10FBE}-\x{10FBF}\x{10FC1}\x{10FC4}\x{10FCA}\x{1E900}-\x{1E943}]/u'; +} diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php new file mode 100644 index 0000000000..0bbd335677 --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/deviation.php @@ -0,0 +1,8 @@ +<?php + +return array ( + 223 => 'ss', + 962 => 'σ', + 8204 => '', + 8205 => '', +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php new file mode 100644 index 0000000000..25a5f564d5 --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed.php @@ -0,0 +1,2638 @@ +<?php + +return array ( + 888 => true, + 889 => true, + 896 => true, + 897 => true, + 898 => true, + 899 => true, + 907 => true, + 909 => true, + 930 => true, + 1216 => true, + 1328 => true, + 1367 => true, + 1368 => true, + 1419 => true, + 1420 => true, + 1424 => true, + 1480 => true, + 1481 => true, + 1482 => true, + 1483 => true, + 1484 => true, + 1485 => true, + 1486 => true, + 1487 => true, + 1515 => true, + 1516 => true, + 1517 => true, + 1518 => true, + 1525 => true, + 1526 => true, + 1527 => true, + 1528 => true, + 1529 => true, + 1530 => true, + 1531 => true, + 1532 => true, + 1533 => true, + 1534 => true, + 1535 => true, + 1536 => true, + 1537 => true, + 1538 => true, + 1539 => true, + 1540 => true, + 1541 => true, + 1564 => true, + 1565 => true, + 1757 => true, + 1806 => true, + 1807 => true, + 1867 => true, + 1868 => true, + 1970 => true, + 1971 => true, + 1972 => true, + 1973 => true, + 1974 => true, + 1975 => true, + 1976 => true, + 1977 => true, + 1978 => true, + 1979 => true, + 1980 => true, + 1981 => true, + 1982 => true, + 1983 => true, + 2043 => true, + 2044 => true, + 2094 => true, + 2095 => true, + 2111 => true, + 2140 => true, + 2141 => true, + 2143 => true, + 2229 => true, + 2248 => true, + 2249 => true, + 2250 => true, + 2251 => true, + 2252 => true, + 2253 => true, + 2254 => true, + 2255 => true, + 2256 => true, + 2257 => true, + 2258 => true, + 2274 => true, + 2436 => true, + 2445 => true, + 2446 => true, + 2449 => true, + 2450 => true, + 2473 => true, + 2481 => true, + 2483 => true, + 2484 => true, + 2485 => true, + 2490 => true, + 2491 => true, + 2501 => true, + 2502 => true, + 2505 => true, + 2506 => true, + 2511 => true, + 2512 => true, + 2513 => true, + 2514 => true, + 2515 => true, + 2516 => true, + 2517 => true, + 2518 => true, + 2520 => true, + 2521 => true, + 2522 => true, + 2523 => true, + 2526 => true, + 2532 => true, + 2533 => true, + 2559 => true, + 2560 => true, + 2564 => true, + 2571 => true, + 2572 => true, + 2573 => true, + 2574 => true, + 2577 => true, + 2578 => true, + 2601 => true, + 2609 => true, + 2612 => true, + 2615 => true, + 2618 => true, + 2619 => true, + 2621 => true, + 2627 => true, + 2628 => true, + 2629 => true, + 2630 => true, + 2633 => true, + 2634 => true, + 2638 => true, + 2639 => true, + 2640 => true, + 2642 => true, + 2643 => true, + 2644 => true, + 2645 => true, + 2646 => true, + 2647 => true, + 2648 => true, + 2653 => true, + 2655 => true, + 2656 => true, + 2657 => true, + 2658 => true, + 2659 => true, + 2660 => true, + 2661 => true, + 2679 => true, + 2680 => true, + 2681 => true, + 2682 => true, + 2683 => true, + 2684 => true, + 2685 => true, + 2686 => true, + 2687 => true, + 2688 => true, + 2692 => true, + 2702 => true, + 2706 => true, + 2729 => true, + 2737 => true, + 2740 => true, + 2746 => true, + 2747 => true, + 2758 => true, + 2762 => true, + 2766 => true, + 2767 => true, + 2769 => true, + 2770 => true, + 2771 => true, + 2772 => true, + 2773 => true, + 2774 => true, + 2775 => true, + 2776 => true, + 2777 => true, + 2778 => true, + 2779 => true, + 2780 => true, + 2781 => true, + 2782 => true, + 2783 => true, + 2788 => true, + 2789 => true, + 2802 => true, + 2803 => true, + 2804 => true, + 2805 => true, + 2806 => true, + 2807 => true, + 2808 => true, + 2816 => true, + 2820 => true, + 2829 => true, + 2830 => true, + 2833 => true, + 2834 => true, + 2857 => true, + 2865 => true, + 2868 => true, + 2874 => true, + 2875 => true, + 2885 => true, + 2886 => true, + 2889 => true, + 2890 => true, + 2894 => true, + 2895 => true, + 2896 => true, + 2897 => true, + 2898 => true, + 2899 => true, + 2900 => true, + 2904 => true, + 2905 => true, + 2906 => true, + 2907 => true, + 2910 => true, + 2916 => true, + 2917 => true, + 2936 => true, + 2937 => true, + 2938 => true, + 2939 => true, + 2940 => true, + 2941 => true, + 2942 => true, + 2943 => true, + 2944 => true, + 2945 => true, + 2948 => true, + 2955 => true, + 2956 => true, + 2957 => true, + 2961 => true, + 2966 => true, + 2967 => true, + 2968 => true, + 2971 => true, + 2973 => true, + 2976 => true, + 2977 => true, + 2978 => true, + 2981 => true, + 2982 => true, + 2983 => true, + 2987 => true, + 2988 => true, + 2989 => true, + 3002 => true, + 3003 => true, + 3004 => true, + 3005 => true, + 3011 => true, + 3012 => true, + 3013 => true, + 3017 => true, + 3022 => true, + 3023 => true, + 3025 => true, + 3026 => true, + 3027 => true, + 3028 => true, + 3029 => true, + 3030 => true, + 3032 => true, + 3033 => true, + 3034 => true, + 3035 => true, + 3036 => true, + 3037 => true, + 3038 => true, + 3039 => true, + 3040 => true, + 3041 => true, + 3042 => true, + 3043 => true, + 3044 => true, + 3045 => true, + 3067 => true, + 3068 => true, + 3069 => true, + 3070 => true, + 3071 => true, + 3085 => true, + 3089 => true, + 3113 => true, + 3130 => true, + 3131 => true, + 3132 => true, + 3141 => true, + 3145 => true, + 3150 => true, + 3151 => true, + 3152 => true, + 3153 => true, + 3154 => true, + 3155 => true, + 3156 => true, + 3159 => true, + 3163 => true, + 3164 => true, + 3165 => true, + 3166 => true, + 3167 => true, + 3172 => true, + 3173 => true, + 3184 => true, + 3185 => true, + 3186 => true, + 3187 => true, + 3188 => true, + 3189 => true, + 3190 => true, + 3213 => true, + 3217 => true, + 3241 => true, + 3252 => true, + 3258 => true, + 3259 => true, + 3269 => true, + 3273 => true, + 3278 => true, + 3279 => true, + 3280 => true, + 3281 => true, + 3282 => true, + 3283 => true, + 3284 => true, + 3287 => true, + 3288 => true, + 3289 => true, + 3290 => true, + 3291 => true, + 3292 => true, + 3293 => true, + 3295 => true, + 3300 => true, + 3301 => true, + 3312 => true, + 3315 => true, + 3316 => true, + 3317 => true, + 3318 => true, + 3319 => true, + 3320 => true, + 3321 => true, + 3322 => true, + 3323 => true, + 3324 => true, + 3325 => true, + 3326 => true, + 3327 => true, + 3341 => true, + 3345 => true, + 3397 => true, + 3401 => true, + 3408 => true, + 3409 => true, + 3410 => true, + 3411 => true, + 3428 => true, + 3429 => true, + 3456 => true, + 3460 => true, + 3479 => true, + 3480 => true, + 3481 => true, + 3506 => true, + 3516 => true, + 3518 => true, + 3519 => true, + 3527 => true, + 3528 => true, + 3529 => true, + 3531 => true, + 3532 => true, + 3533 => true, + 3534 => true, + 3541 => true, + 3543 => true, + 3552 => true, + 3553 => true, + 3554 => true, + 3555 => true, + 3556 => true, + 3557 => true, + 3568 => true, + 3569 => true, + 3573 => true, + 3574 => true, + 3575 => true, + 3576 => true, + 3577 => true, + 3578 => true, + 3579 => true, + 3580 => true, + 3581 => true, + 3582 => true, + 3583 => true, + 3584 => true, + 3643 => true, + 3644 => true, + 3645 => true, + 3646 => true, + 3715 => true, + 3717 => true, + 3723 => true, + 3748 => true, + 3750 => true, + 3774 => true, + 3775 => true, + 3781 => true, + 3783 => true, + 3790 => true, + 3791 => true, + 3802 => true, + 3803 => true, + 3912 => true, + 3949 => true, + 3950 => true, + 3951 => true, + 3952 => true, + 3992 => true, + 4029 => true, + 4045 => true, + 4294 => true, + 4296 => true, + 4297 => true, + 4298 => true, + 4299 => true, + 4300 => true, + 4302 => true, + 4303 => true, + 4447 => true, + 4448 => true, + 4681 => true, + 4686 => true, + 4687 => true, + 4695 => true, + 4697 => true, + 4702 => true, + 4703 => true, + 4745 => true, + 4750 => true, + 4751 => true, + 4785 => true, + 4790 => true, + 4791 => true, + 4799 => true, + 4801 => true, + 4806 => true, + 4807 => true, + 4823 => true, + 4881 => true, + 4886 => true, + 4887 => true, + 4955 => true, + 4956 => true, + 4989 => true, + 4990 => true, + 4991 => true, + 5018 => true, + 5019 => true, + 5020 => true, + 5021 => true, + 5022 => true, + 5023 => true, + 5110 => true, + 5111 => true, + 5118 => true, + 5119 => true, + 5760 => true, + 5789 => true, + 5790 => true, + 5791 => true, + 5881 => true, + 5882 => true, + 5883 => true, + 5884 => true, + 5885 => true, + 5886 => true, + 5887 => true, + 5901 => true, + 5909 => true, + 5910 => true, + 5911 => true, + 5912 => true, + 5913 => true, + 5914 => true, + 5915 => true, + 5916 => true, + 5917 => true, + 5918 => true, + 5919 => true, + 5943 => true, + 5944 => true, + 5945 => true, + 5946 => true, + 5947 => true, + 5948 => true, + 5949 => true, + 5950 => true, + 5951 => true, + 5972 => true, + 5973 => true, + 5974 => true, + 5975 => true, + 5976 => true, + 5977 => true, + 5978 => true, + 5979 => true, + 5980 => true, + 5981 => true, + 5982 => true, + 5983 => true, + 5997 => true, + 6001 => true, + 6004 => true, + 6005 => true, + 6006 => true, + 6007 => true, + 6008 => true, + 6009 => true, + 6010 => true, + 6011 => true, + 6012 => true, + 6013 => true, + 6014 => true, + 6015 => true, + 6068 => true, + 6069 => true, + 6110 => true, + 6111 => true, + 6122 => true, + 6123 => true, + 6124 => true, + 6125 => true, + 6126 => true, + 6127 => true, + 6138 => true, + 6139 => true, + 6140 => true, + 6141 => true, + 6142 => true, + 6143 => true, + 6150 => true, + 6158 => true, + 6159 => true, + 6170 => true, + 6171 => true, + 6172 => true, + 6173 => true, + 6174 => true, + 6175 => true, + 6265 => true, + 6266 => true, + 6267 => true, + 6268 => true, + 6269 => true, + 6270 => true, + 6271 => true, + 6315 => true, + 6316 => true, + 6317 => true, + 6318 => true, + 6319 => true, + 6390 => true, + 6391 => true, + 6392 => true, + 6393 => true, + 6394 => true, + 6395 => true, + 6396 => true, + 6397 => true, + 6398 => true, + 6399 => true, + 6431 => true, + 6444 => true, + 6445 => true, + 6446 => true, + 6447 => true, + 6460 => true, + 6461 => true, + 6462 => true, + 6463 => true, + 6465 => true, + 6466 => true, + 6467 => true, + 6510 => true, + 6511 => true, + 6517 => true, + 6518 => true, + 6519 => true, + 6520 => true, + 6521 => true, + 6522 => true, + 6523 => true, + 6524 => true, + 6525 => true, + 6526 => true, + 6527 => true, + 6572 => true, + 6573 => true, + 6574 => true, + 6575 => true, + 6602 => true, + 6603 => true, + 6604 => true, + 6605 => true, + 6606 => true, + 6607 => true, + 6619 => true, + 6620 => true, + 6621 => true, + 6684 => true, + 6685 => true, + 6751 => true, + 6781 => true, + 6782 => true, + 6794 => true, + 6795 => true, + 6796 => true, + 6797 => true, + 6798 => true, + 6799 => true, + 6810 => true, + 6811 => true, + 6812 => true, + 6813 => true, + 6814 => true, + 6815 => true, + 6830 => true, + 6831 => true, + 6988 => true, + 6989 => true, + 6990 => true, + 6991 => true, + 7037 => true, + 7038 => true, + 7039 => true, + 7156 => true, + 7157 => true, + 7158 => true, + 7159 => true, + 7160 => true, + 7161 => true, + 7162 => true, + 7163 => true, + 7224 => true, + 7225 => true, + 7226 => true, + 7242 => true, + 7243 => true, + 7244 => true, + 7305 => true, + 7306 => true, + 7307 => true, + 7308 => true, + 7309 => true, + 7310 => true, + 7311 => true, + 7355 => true, + 7356 => true, + 7368 => true, + 7369 => true, + 7370 => true, + 7371 => true, + 7372 => true, + 7373 => true, + 7374 => true, + 7375 => true, + 7419 => true, + 7420 => true, + 7421 => true, + 7422 => true, + 7423 => true, + 7674 => true, + 7958 => true, + 7959 => true, + 7966 => true, + 7967 => true, + 8006 => true, + 8007 => true, + 8014 => true, + 8015 => true, + 8024 => true, + 8026 => true, + 8028 => true, + 8030 => true, + 8062 => true, + 8063 => true, + 8117 => true, + 8133 => true, + 8148 => true, + 8149 => true, + 8156 => true, + 8176 => true, + 8177 => true, + 8181 => true, + 8191 => true, + 8206 => true, + 8207 => true, + 8228 => true, + 8229 => true, + 8230 => true, + 8232 => true, + 8233 => true, + 8234 => true, + 8235 => true, + 8236 => true, + 8237 => true, + 8238 => true, + 8289 => true, + 8290 => true, + 8291 => true, + 8293 => true, + 8294 => true, + 8295 => true, + 8296 => true, + 8297 => true, + 8298 => true, + 8299 => true, + 8300 => true, + 8301 => true, + 8302 => true, + 8303 => true, + 8306 => true, + 8307 => true, + 8335 => true, + 8349 => true, + 8350 => true, + 8351 => true, + 8384 => true, + 8385 => true, + 8386 => true, + 8387 => true, + 8388 => true, + 8389 => true, + 8390 => true, + 8391 => true, + 8392 => true, + 8393 => true, + 8394 => true, + 8395 => true, + 8396 => true, + 8397 => true, + 8398 => true, + 8399 => true, + 8433 => true, + 8434 => true, + 8435 => true, + 8436 => true, + 8437 => true, + 8438 => true, + 8439 => true, + 8440 => true, + 8441 => true, + 8442 => true, + 8443 => true, + 8444 => true, + 8445 => true, + 8446 => true, + 8447 => true, + 8498 => true, + 8579 => true, + 8588 => true, + 8589 => true, + 8590 => true, + 8591 => true, + 9255 => true, + 9256 => true, + 9257 => true, + 9258 => true, + 9259 => true, + 9260 => true, + 9261 => true, + 9262 => true, + 9263 => true, + 9264 => true, + 9265 => true, + 9266 => true, + 9267 => true, + 9268 => true, + 9269 => true, + 9270 => true, + 9271 => true, + 9272 => true, + 9273 => true, + 9274 => true, + 9275 => true, + 9276 => true, + 9277 => true, + 9278 => true, + 9279 => true, + 9291 => true, + 9292 => true, + 9293 => true, + 9294 => true, + 9295 => true, + 9296 => true, + 9297 => true, + 9298 => true, + 9299 => true, + 9300 => true, + 9301 => true, + 9302 => true, + 9303 => true, + 9304 => true, + 9305 => true, + 9306 => true, + 9307 => true, + 9308 => true, + 9309 => true, + 9310 => true, + 9311 => true, + 9352 => true, + 9353 => true, + 9354 => true, + 9355 => true, + 9356 => true, + 9357 => true, + 9358 => true, + 9359 => true, + 9360 => true, + 9361 => true, + 9362 => true, + 9363 => true, + 9364 => true, + 9365 => true, + 9366 => true, + 9367 => true, + 9368 => true, + 9369 => true, + 9370 => true, + 9371 => true, + 11124 => true, + 11125 => true, + 11158 => true, + 11311 => true, + 11359 => true, + 11508 => true, + 11509 => true, + 11510 => true, + 11511 => true, + 11512 => true, + 11558 => true, + 11560 => true, + 11561 => true, + 11562 => true, + 11563 => true, + 11564 => true, + 11566 => true, + 11567 => true, + 11624 => true, + 11625 => true, + 11626 => true, + 11627 => true, + 11628 => true, + 11629 => true, + 11630 => true, + 11633 => true, + 11634 => true, + 11635 => true, + 11636 => true, + 11637 => true, + 11638 => true, + 11639 => true, + 11640 => true, + 11641 => true, + 11642 => true, + 11643 => true, + 11644 => true, + 11645 => true, + 11646 => true, + 11671 => true, + 11672 => true, + 11673 => true, + 11674 => true, + 11675 => true, + 11676 => true, + 11677 => true, + 11678 => true, + 11679 => true, + 11687 => true, + 11695 => true, + 11703 => true, + 11711 => true, + 11719 => true, + 11727 => true, + 11735 => true, + 11743 => true, + 11930 => true, + 12020 => true, + 12021 => true, + 12022 => true, + 12023 => true, + 12024 => true, + 12025 => true, + 12026 => true, + 12027 => true, + 12028 => true, + 12029 => true, + 12030 => true, + 12031 => true, + 12246 => true, + 12247 => true, + 12248 => true, + 12249 => true, + 12250 => true, + 12251 => true, + 12252 => true, + 12253 => true, + 12254 => true, + 12255 => true, + 12256 => true, + 12257 => true, + 12258 => true, + 12259 => true, + 12260 => true, + 12261 => true, + 12262 => true, + 12263 => true, + 12264 => true, + 12265 => true, + 12266 => true, + 12267 => true, + 12268 => true, + 12269 => true, + 12270 => true, + 12271 => true, + 12272 => true, + 12273 => true, + 12274 => true, + 12275 => true, + 12276 => true, + 12277 => true, + 12278 => true, + 12279 => true, + 12280 => true, + 12281 => true, + 12282 => true, + 12283 => true, + 12284 => true, + 12285 => true, + 12286 => true, + 12287 => true, + 12352 => true, + 12439 => true, + 12440 => true, + 12544 => true, + 12545 => true, + 12546 => true, + 12547 => true, + 12548 => true, + 12592 => true, + 12644 => true, + 12687 => true, + 12772 => true, + 12773 => true, + 12774 => true, + 12775 => true, + 12776 => true, + 12777 => true, + 12778 => true, + 12779 => true, + 12780 => true, + 12781 => true, + 12782 => true, + 12783 => true, + 12831 => true, + 13250 => true, + 13255 => true, + 13272 => true, + 40957 => true, + 40958 => true, + 40959 => true, + 42125 => true, + 42126 => true, + 42127 => true, + 42183 => true, + 42184 => true, + 42185 => true, + 42186 => true, + 42187 => true, + 42188 => true, + 42189 => true, + 42190 => true, + 42191 => true, + 42540 => true, + 42541 => true, + 42542 => true, + 42543 => true, + 42544 => true, + 42545 => true, + 42546 => true, + 42547 => true, + 42548 => true, + 42549 => true, + 42550 => true, + 42551 => true, + 42552 => true, + 42553 => true, + 42554 => true, + 42555 => true, + 42556 => true, + 42557 => true, + 42558 => true, + 42559 => true, + 42744 => true, + 42745 => true, + 42746 => true, + 42747 => true, + 42748 => true, + 42749 => true, + 42750 => true, + 42751 => true, + 42944 => true, + 42945 => true, + 43053 => true, + 43054 => true, + 43055 => true, + 43066 => true, + 43067 => true, + 43068 => true, + 43069 => true, + 43070 => true, + 43071 => true, + 43128 => true, + 43129 => true, + 43130 => true, + 43131 => true, + 43132 => true, + 43133 => true, + 43134 => true, + 43135 => true, + 43206 => true, + 43207 => true, + 43208 => true, + 43209 => true, + 43210 => true, + 43211 => true, + 43212 => true, + 43213 => true, + 43226 => true, + 43227 => true, + 43228 => true, + 43229 => true, + 43230 => true, + 43231 => true, + 43348 => true, + 43349 => true, + 43350 => true, + 43351 => true, + 43352 => true, + 43353 => true, + 43354 => true, + 43355 => true, + 43356 => true, + 43357 => true, + 43358 => true, + 43389 => true, + 43390 => true, + 43391 => true, + 43470 => true, + 43482 => true, + 43483 => true, + 43484 => true, + 43485 => true, + 43519 => true, + 43575 => true, + 43576 => true, + 43577 => true, + 43578 => true, + 43579 => true, + 43580 => true, + 43581 => true, + 43582 => true, + 43583 => true, + 43598 => true, + 43599 => true, + 43610 => true, + 43611 => true, + 43715 => true, + 43716 => true, + 43717 => true, + 43718 => true, + 43719 => true, + 43720 => true, + 43721 => true, + 43722 => true, + 43723 => true, + 43724 => true, + 43725 => true, + 43726 => true, + 43727 => true, + 43728 => true, + 43729 => true, + 43730 => true, + 43731 => true, + 43732 => true, + 43733 => true, + 43734 => true, + 43735 => true, + 43736 => true, + 43737 => true, + 43738 => true, + 43767 => true, + 43768 => true, + 43769 => true, + 43770 => true, + 43771 => true, + 43772 => true, + 43773 => true, + 43774 => true, + 43775 => true, + 43776 => true, + 43783 => true, + 43784 => true, + 43791 => true, + 43792 => true, + 43799 => true, + 43800 => true, + 43801 => true, + 43802 => true, + 43803 => true, + 43804 => true, + 43805 => true, + 43806 => true, + 43807 => true, + 43815 => true, + 43823 => true, + 43884 => true, + 43885 => true, + 43886 => true, + 43887 => true, + 44014 => true, + 44015 => true, + 44026 => true, + 44027 => true, + 44028 => true, + 44029 => true, + 44030 => true, + 44031 => true, + 55204 => true, + 55205 => true, + 55206 => true, + 55207 => true, + 55208 => true, + 55209 => true, + 55210 => true, + 55211 => true, + 55212 => true, + 55213 => true, + 55214 => true, + 55215 => true, + 55239 => true, + 55240 => true, + 55241 => true, + 55242 => true, + 55292 => true, + 55293 => true, + 55294 => true, + 55295 => true, + 64110 => true, + 64111 => true, + 64263 => true, + 64264 => true, + 64265 => true, + 64266 => true, + 64267 => true, + 64268 => true, + 64269 => true, + 64270 => true, + 64271 => true, + 64272 => true, + 64273 => true, + 64274 => true, + 64280 => true, + 64281 => true, + 64282 => true, + 64283 => true, + 64284 => true, + 64311 => true, + 64317 => true, + 64319 => true, + 64322 => true, + 64325 => true, + 64450 => true, + 64451 => true, + 64452 => true, + 64453 => true, + 64454 => true, + 64455 => true, + 64456 => true, + 64457 => true, + 64458 => true, + 64459 => true, + 64460 => true, + 64461 => true, + 64462 => true, + 64463 => true, + 64464 => true, + 64465 => true, + 64466 => true, + 64832 => true, + 64833 => true, + 64834 => true, + 64835 => true, + 64836 => true, + 64837 => true, + 64838 => true, + 64839 => true, + 64840 => true, + 64841 => true, + 64842 => true, + 64843 => true, + 64844 => true, + 64845 => true, + 64846 => true, + 64847 => true, + 64912 => true, + 64913 => true, + 64968 => true, + 64969 => true, + 64970 => true, + 64971 => true, + 64972 => true, + 64973 => true, + 64974 => true, + 64975 => true, + 65022 => true, + 65023 => true, + 65042 => true, + 65049 => true, + 65050 => true, + 65051 => true, + 65052 => true, + 65053 => true, + 65054 => true, + 65055 => true, + 65072 => true, + 65106 => true, + 65107 => true, + 65127 => true, + 65132 => true, + 65133 => true, + 65134 => true, + 65135 => true, + 65141 => true, + 65277 => true, + 65278 => true, + 65280 => true, + 65440 => true, + 65471 => true, + 65472 => true, + 65473 => true, + 65480 => true, + 65481 => true, + 65488 => true, + 65489 => true, + 65496 => true, + 65497 => true, + 65501 => true, + 65502 => true, + 65503 => true, + 65511 => true, + 65519 => true, + 65520 => true, + 65521 => true, + 65522 => true, + 65523 => true, + 65524 => true, + 65525 => true, + 65526 => true, + 65527 => true, + 65528 => true, + 65529 => true, + 65530 => true, + 65531 => true, + 65532 => true, + 65533 => true, + 65534 => true, + 65535 => true, + 65548 => true, + 65575 => true, + 65595 => true, + 65598 => true, + 65614 => true, + 65615 => true, + 65787 => true, + 65788 => true, + 65789 => true, + 65790 => true, + 65791 => true, + 65795 => true, + 65796 => true, + 65797 => true, + 65798 => true, + 65844 => true, + 65845 => true, + 65846 => true, + 65935 => true, + 65949 => true, + 65950 => true, + 65951 => true, + 66205 => true, + 66206 => true, + 66207 => true, + 66257 => true, + 66258 => true, + 66259 => true, + 66260 => true, + 66261 => true, + 66262 => true, + 66263 => true, + 66264 => true, + 66265 => true, + 66266 => true, + 66267 => true, + 66268 => true, + 66269 => true, + 66270 => true, + 66271 => true, + 66300 => true, + 66301 => true, + 66302 => true, + 66303 => true, + 66340 => true, + 66341 => true, + 66342 => true, + 66343 => true, + 66344 => true, + 66345 => true, + 66346 => true, + 66347 => true, + 66348 => true, + 66379 => true, + 66380 => true, + 66381 => true, + 66382 => true, + 66383 => true, + 66427 => true, + 66428 => true, + 66429 => true, + 66430 => true, + 66431 => true, + 66462 => true, + 66500 => true, + 66501 => true, + 66502 => true, + 66503 => true, + 66718 => true, + 66719 => true, + 66730 => true, + 66731 => true, + 66732 => true, + 66733 => true, + 66734 => true, + 66735 => true, + 66772 => true, + 66773 => true, + 66774 => true, + 66775 => true, + 66812 => true, + 66813 => true, + 66814 => true, + 66815 => true, + 66856 => true, + 66857 => true, + 66858 => true, + 66859 => true, + 66860 => true, + 66861 => true, + 66862 => true, + 66863 => true, + 66916 => true, + 66917 => true, + 66918 => true, + 66919 => true, + 66920 => true, + 66921 => true, + 66922 => true, + 66923 => true, + 66924 => true, + 66925 => true, + 66926 => true, + 67383 => true, + 67384 => true, + 67385 => true, + 67386 => true, + 67387 => true, + 67388 => true, + 67389 => true, + 67390 => true, + 67391 => true, + 67414 => true, + 67415 => true, + 67416 => true, + 67417 => true, + 67418 => true, + 67419 => true, + 67420 => true, + 67421 => true, + 67422 => true, + 67423 => true, + 67590 => true, + 67591 => true, + 67593 => true, + 67638 => true, + 67641 => true, + 67642 => true, + 67643 => true, + 67645 => true, + 67646 => true, + 67670 => true, + 67743 => true, + 67744 => true, + 67745 => true, + 67746 => true, + 67747 => true, + 67748 => true, + 67749 => true, + 67750 => true, + 67827 => true, + 67830 => true, + 67831 => true, + 67832 => true, + 67833 => true, + 67834 => true, + 67868 => true, + 67869 => true, + 67870 => true, + 67898 => true, + 67899 => true, + 67900 => true, + 67901 => true, + 67902 => true, + 68024 => true, + 68025 => true, + 68026 => true, + 68027 => true, + 68048 => true, + 68049 => true, + 68100 => true, + 68103 => true, + 68104 => true, + 68105 => true, + 68106 => true, + 68107 => true, + 68116 => true, + 68120 => true, + 68150 => true, + 68151 => true, + 68155 => true, + 68156 => true, + 68157 => true, + 68158 => true, + 68169 => true, + 68170 => true, + 68171 => true, + 68172 => true, + 68173 => true, + 68174 => true, + 68175 => true, + 68185 => true, + 68186 => true, + 68187 => true, + 68188 => true, + 68189 => true, + 68190 => true, + 68191 => true, + 68327 => true, + 68328 => true, + 68329 => true, + 68330 => true, + 68343 => true, + 68344 => true, + 68345 => true, + 68346 => true, + 68347 => true, + 68348 => true, + 68349 => true, + 68350 => true, + 68351 => true, + 68406 => true, + 68407 => true, + 68408 => true, + 68438 => true, + 68439 => true, + 68467 => true, + 68468 => true, + 68469 => true, + 68470 => true, + 68471 => true, + 68498 => true, + 68499 => true, + 68500 => true, + 68501 => true, + 68502 => true, + 68503 => true, + 68504 => true, + 68509 => true, + 68510 => true, + 68511 => true, + 68512 => true, + 68513 => true, + 68514 => true, + 68515 => true, + 68516 => true, + 68517 => true, + 68518 => true, + 68519 => true, + 68520 => true, + 68787 => true, + 68788 => true, + 68789 => true, + 68790 => true, + 68791 => true, + 68792 => true, + 68793 => true, + 68794 => true, + 68795 => true, + 68796 => true, + 68797 => true, + 68798 => true, + 68799 => true, + 68851 => true, + 68852 => true, + 68853 => true, + 68854 => true, + 68855 => true, + 68856 => true, + 68857 => true, + 68904 => true, + 68905 => true, + 68906 => true, + 68907 => true, + 68908 => true, + 68909 => true, + 68910 => true, + 68911 => true, + 69247 => true, + 69290 => true, + 69294 => true, + 69295 => true, + 69416 => true, + 69417 => true, + 69418 => true, + 69419 => true, + 69420 => true, + 69421 => true, + 69422 => true, + 69423 => true, + 69580 => true, + 69581 => true, + 69582 => true, + 69583 => true, + 69584 => true, + 69585 => true, + 69586 => true, + 69587 => true, + 69588 => true, + 69589 => true, + 69590 => true, + 69591 => true, + 69592 => true, + 69593 => true, + 69594 => true, + 69595 => true, + 69596 => true, + 69597 => true, + 69598 => true, + 69599 => true, + 69623 => true, + 69624 => true, + 69625 => true, + 69626 => true, + 69627 => true, + 69628 => true, + 69629 => true, + 69630 => true, + 69631 => true, + 69710 => true, + 69711 => true, + 69712 => true, + 69713 => true, + 69744 => true, + 69745 => true, + 69746 => true, + 69747 => true, + 69748 => true, + 69749 => true, + 69750 => true, + 69751 => true, + 69752 => true, + 69753 => true, + 69754 => true, + 69755 => true, + 69756 => true, + 69757 => true, + 69758 => true, + 69821 => true, + 69826 => true, + 69827 => true, + 69828 => true, + 69829 => true, + 69830 => true, + 69831 => true, + 69832 => true, + 69833 => true, + 69834 => true, + 69835 => true, + 69836 => true, + 69837 => true, + 69838 => true, + 69839 => true, + 69865 => true, + 69866 => true, + 69867 => true, + 69868 => true, + 69869 => true, + 69870 => true, + 69871 => true, + 69882 => true, + 69883 => true, + 69884 => true, + 69885 => true, + 69886 => true, + 69887 => true, + 69941 => true, + 69960 => true, + 69961 => true, + 69962 => true, + 69963 => true, + 69964 => true, + 69965 => true, + 69966 => true, + 69967 => true, + 70007 => true, + 70008 => true, + 70009 => true, + 70010 => true, + 70011 => true, + 70012 => true, + 70013 => true, + 70014 => true, + 70015 => true, + 70112 => true, + 70133 => true, + 70134 => true, + 70135 => true, + 70136 => true, + 70137 => true, + 70138 => true, + 70139 => true, + 70140 => true, + 70141 => true, + 70142 => true, + 70143 => true, + 70162 => true, + 70279 => true, + 70281 => true, + 70286 => true, + 70302 => true, + 70314 => true, + 70315 => true, + 70316 => true, + 70317 => true, + 70318 => true, + 70319 => true, + 70379 => true, + 70380 => true, + 70381 => true, + 70382 => true, + 70383 => true, + 70394 => true, + 70395 => true, + 70396 => true, + 70397 => true, + 70398 => true, + 70399 => true, + 70404 => true, + 70413 => true, + 70414 => true, + 70417 => true, + 70418 => true, + 70441 => true, + 70449 => true, + 70452 => true, + 70458 => true, + 70469 => true, + 70470 => true, + 70473 => true, + 70474 => true, + 70478 => true, + 70479 => true, + 70481 => true, + 70482 => true, + 70483 => true, + 70484 => true, + 70485 => true, + 70486 => true, + 70488 => true, + 70489 => true, + 70490 => true, + 70491 => true, + 70492 => true, + 70500 => true, + 70501 => true, + 70509 => true, + 70510 => true, + 70511 => true, + 70748 => true, + 70754 => true, + 70755 => true, + 70756 => true, + 70757 => true, + 70758 => true, + 70759 => true, + 70760 => true, + 70761 => true, + 70762 => true, + 70763 => true, + 70764 => true, + 70765 => true, + 70766 => true, + 70767 => true, + 70768 => true, + 70769 => true, + 70770 => true, + 70771 => true, + 70772 => true, + 70773 => true, + 70774 => true, + 70775 => true, + 70776 => true, + 70777 => true, + 70778 => true, + 70779 => true, + 70780 => true, + 70781 => true, + 70782 => true, + 70783 => true, + 70856 => true, + 70857 => true, + 70858 => true, + 70859 => true, + 70860 => true, + 70861 => true, + 70862 => true, + 70863 => true, + 71094 => true, + 71095 => true, + 71237 => true, + 71238 => true, + 71239 => true, + 71240 => true, + 71241 => true, + 71242 => true, + 71243 => true, + 71244 => true, + 71245 => true, + 71246 => true, + 71247 => true, + 71258 => true, + 71259 => true, + 71260 => true, + 71261 => true, + 71262 => true, + 71263 => true, + 71277 => true, + 71278 => true, + 71279 => true, + 71280 => true, + 71281 => true, + 71282 => true, + 71283 => true, + 71284 => true, + 71285 => true, + 71286 => true, + 71287 => true, + 71288 => true, + 71289 => true, + 71290 => true, + 71291 => true, + 71292 => true, + 71293 => true, + 71294 => true, + 71295 => true, + 71353 => true, + 71354 => true, + 71355 => true, + 71356 => true, + 71357 => true, + 71358 => true, + 71359 => true, + 71451 => true, + 71452 => true, + 71468 => true, + 71469 => true, + 71470 => true, + 71471 => true, + 71923 => true, + 71924 => true, + 71925 => true, + 71926 => true, + 71927 => true, + 71928 => true, + 71929 => true, + 71930 => true, + 71931 => true, + 71932 => true, + 71933 => true, + 71934 => true, + 71943 => true, + 71944 => true, + 71946 => true, + 71947 => true, + 71956 => true, + 71959 => true, + 71990 => true, + 71993 => true, + 71994 => true, + 72007 => true, + 72008 => true, + 72009 => true, + 72010 => true, + 72011 => true, + 72012 => true, + 72013 => true, + 72014 => true, + 72015 => true, + 72104 => true, + 72105 => true, + 72152 => true, + 72153 => true, + 72165 => true, + 72166 => true, + 72167 => true, + 72168 => true, + 72169 => true, + 72170 => true, + 72171 => true, + 72172 => true, + 72173 => true, + 72174 => true, + 72175 => true, + 72176 => true, + 72177 => true, + 72178 => true, + 72179 => true, + 72180 => true, + 72181 => true, + 72182 => true, + 72183 => true, + 72184 => true, + 72185 => true, + 72186 => true, + 72187 => true, + 72188 => true, + 72189 => true, + 72190 => true, + 72191 => true, + 72264 => true, + 72265 => true, + 72266 => true, + 72267 => true, + 72268 => true, + 72269 => true, + 72270 => true, + 72271 => true, + 72355 => true, + 72356 => true, + 72357 => true, + 72358 => true, + 72359 => true, + 72360 => true, + 72361 => true, + 72362 => true, + 72363 => true, + 72364 => true, + 72365 => true, + 72366 => true, + 72367 => true, + 72368 => true, + 72369 => true, + 72370 => true, + 72371 => true, + 72372 => true, + 72373 => true, + 72374 => true, + 72375 => true, + 72376 => true, + 72377 => true, + 72378 => true, + 72379 => true, + 72380 => true, + 72381 => true, + 72382 => true, + 72383 => true, + 72713 => true, + 72759 => true, + 72774 => true, + 72775 => true, + 72776 => true, + 72777 => true, + 72778 => true, + 72779 => true, + 72780 => true, + 72781 => true, + 72782 => true, + 72783 => true, + 72813 => true, + 72814 => true, + 72815 => true, + 72848 => true, + 72849 => true, + 72872 => true, + 72967 => true, + 72970 => true, + 73015 => true, + 73016 => true, + 73017 => true, + 73019 => true, + 73022 => true, + 73032 => true, + 73033 => true, + 73034 => true, + 73035 => true, + 73036 => true, + 73037 => true, + 73038 => true, + 73039 => true, + 73050 => true, + 73051 => true, + 73052 => true, + 73053 => true, + 73054 => true, + 73055 => true, + 73062 => true, + 73065 => true, + 73103 => true, + 73106 => true, + 73113 => true, + 73114 => true, + 73115 => true, + 73116 => true, + 73117 => true, + 73118 => true, + 73119 => true, + 73649 => true, + 73650 => true, + 73651 => true, + 73652 => true, + 73653 => true, + 73654 => true, + 73655 => true, + 73656 => true, + 73657 => true, + 73658 => true, + 73659 => true, + 73660 => true, + 73661 => true, + 73662 => true, + 73663 => true, + 73714 => true, + 73715 => true, + 73716 => true, + 73717 => true, + 73718 => true, + 73719 => true, + 73720 => true, + 73721 => true, + 73722 => true, + 73723 => true, + 73724 => true, + 73725 => true, + 73726 => true, + 74863 => true, + 74869 => true, + 74870 => true, + 74871 => true, + 74872 => true, + 74873 => true, + 74874 => true, + 74875 => true, + 74876 => true, + 74877 => true, + 74878 => true, + 74879 => true, + 78895 => true, + 78896 => true, + 78897 => true, + 78898 => true, + 78899 => true, + 78900 => true, + 78901 => true, + 78902 => true, + 78903 => true, + 78904 => true, + 92729 => true, + 92730 => true, + 92731 => true, + 92732 => true, + 92733 => true, + 92734 => true, + 92735 => true, + 92767 => true, + 92778 => true, + 92779 => true, + 92780 => true, + 92781 => true, + 92910 => true, + 92911 => true, + 92918 => true, + 92919 => true, + 92920 => true, + 92921 => true, + 92922 => true, + 92923 => true, + 92924 => true, + 92925 => true, + 92926 => true, + 92927 => true, + 92998 => true, + 92999 => true, + 93000 => true, + 93001 => true, + 93002 => true, + 93003 => true, + 93004 => true, + 93005 => true, + 93006 => true, + 93007 => true, + 93018 => true, + 93026 => true, + 93048 => true, + 93049 => true, + 93050 => true, + 93051 => true, + 93052 => true, + 94027 => true, + 94028 => true, + 94029 => true, + 94030 => true, + 94088 => true, + 94089 => true, + 94090 => true, + 94091 => true, + 94092 => true, + 94093 => true, + 94094 => true, + 94181 => true, + 94182 => true, + 94183 => true, + 94184 => true, + 94185 => true, + 94186 => true, + 94187 => true, + 94188 => true, + 94189 => true, + 94190 => true, + 94191 => true, + 94194 => true, + 94195 => true, + 94196 => true, + 94197 => true, + 94198 => true, + 94199 => true, + 94200 => true, + 94201 => true, + 94202 => true, + 94203 => true, + 94204 => true, + 94205 => true, + 94206 => true, + 94207 => true, + 100344 => true, + 100345 => true, + 100346 => true, + 100347 => true, + 100348 => true, + 100349 => true, + 100350 => true, + 100351 => true, + 110931 => true, + 110932 => true, + 110933 => true, + 110934 => true, + 110935 => true, + 110936 => true, + 110937 => true, + 110938 => true, + 110939 => true, + 110940 => true, + 110941 => true, + 110942 => true, + 110943 => true, + 110944 => true, + 110945 => true, + 110946 => true, + 110947 => true, + 110952 => true, + 110953 => true, + 110954 => true, + 110955 => true, + 110956 => true, + 110957 => true, + 110958 => true, + 110959 => true, + 113771 => true, + 113772 => true, + 113773 => true, + 113774 => true, + 113775 => true, + 113789 => true, + 113790 => true, + 113791 => true, + 113801 => true, + 113802 => true, + 113803 => true, + 113804 => true, + 113805 => true, + 113806 => true, + 113807 => true, + 113818 => true, + 113819 => true, + 119030 => true, + 119031 => true, + 119032 => true, + 119033 => true, + 119034 => true, + 119035 => true, + 119036 => true, + 119037 => true, + 119038 => true, + 119039 => true, + 119079 => true, + 119080 => true, + 119155 => true, + 119156 => true, + 119157 => true, + 119158 => true, + 119159 => true, + 119160 => true, + 119161 => true, + 119162 => true, + 119273 => true, + 119274 => true, + 119275 => true, + 119276 => true, + 119277 => true, + 119278 => true, + 119279 => true, + 119280 => true, + 119281 => true, + 119282 => true, + 119283 => true, + 119284 => true, + 119285 => true, + 119286 => true, + 119287 => true, + 119288 => true, + 119289 => true, + 119290 => true, + 119291 => true, + 119292 => true, + 119293 => true, + 119294 => true, + 119295 => true, + 119540 => true, + 119541 => true, + 119542 => true, + 119543 => true, + 119544 => true, + 119545 => true, + 119546 => true, + 119547 => true, + 119548 => true, + 119549 => true, + 119550 => true, + 119551 => true, + 119639 => true, + 119640 => true, + 119641 => true, + 119642 => true, + 119643 => true, + 119644 => true, + 119645 => true, + 119646 => true, + 119647 => true, + 119893 => true, + 119965 => true, + 119968 => true, + 119969 => true, + 119971 => true, + 119972 => true, + 119975 => true, + 119976 => true, + 119981 => true, + 119994 => true, + 119996 => true, + 120004 => true, + 120070 => true, + 120075 => true, + 120076 => true, + 120085 => true, + 120093 => true, + 120122 => true, + 120127 => true, + 120133 => true, + 120135 => true, + 120136 => true, + 120137 => true, + 120145 => true, + 120486 => true, + 120487 => true, + 120780 => true, + 120781 => true, + 121484 => true, + 121485 => true, + 121486 => true, + 121487 => true, + 121488 => true, + 121489 => true, + 121490 => true, + 121491 => true, + 121492 => true, + 121493 => true, + 121494 => true, + 121495 => true, + 121496 => true, + 121497 => true, + 121498 => true, + 121504 => true, + 122887 => true, + 122905 => true, + 122906 => true, + 122914 => true, + 122917 => true, + 123181 => true, + 123182 => true, + 123183 => true, + 123198 => true, + 123199 => true, + 123210 => true, + 123211 => true, + 123212 => true, + 123213 => true, + 123642 => true, + 123643 => true, + 123644 => true, + 123645 => true, + 123646 => true, + 125125 => true, + 125126 => true, + 125260 => true, + 125261 => true, + 125262 => true, + 125263 => true, + 125274 => true, + 125275 => true, + 125276 => true, + 125277 => true, + 126468 => true, + 126496 => true, + 126499 => true, + 126501 => true, + 126502 => true, + 126504 => true, + 126515 => true, + 126520 => true, + 126522 => true, + 126524 => true, + 126525 => true, + 126526 => true, + 126527 => true, + 126528 => true, + 126529 => true, + 126531 => true, + 126532 => true, + 126533 => true, + 126534 => true, + 126536 => true, + 126538 => true, + 126540 => true, + 126544 => true, + 126547 => true, + 126549 => true, + 126550 => true, + 126552 => true, + 126554 => true, + 126556 => true, + 126558 => true, + 126560 => true, + 126563 => true, + 126565 => true, + 126566 => true, + 126571 => true, + 126579 => true, + 126584 => true, + 126589 => true, + 126591 => true, + 126602 => true, + 126620 => true, + 126621 => true, + 126622 => true, + 126623 => true, + 126624 => true, + 126628 => true, + 126634 => true, + 127020 => true, + 127021 => true, + 127022 => true, + 127023 => true, + 127124 => true, + 127125 => true, + 127126 => true, + 127127 => true, + 127128 => true, + 127129 => true, + 127130 => true, + 127131 => true, + 127132 => true, + 127133 => true, + 127134 => true, + 127135 => true, + 127151 => true, + 127152 => true, + 127168 => true, + 127184 => true, + 127222 => true, + 127223 => true, + 127224 => true, + 127225 => true, + 127226 => true, + 127227 => true, + 127228 => true, + 127229 => true, + 127230 => true, + 127231 => true, + 127232 => true, + 127491 => true, + 127492 => true, + 127493 => true, + 127494 => true, + 127495 => true, + 127496 => true, + 127497 => true, + 127498 => true, + 127499 => true, + 127500 => true, + 127501 => true, + 127502 => true, + 127503 => true, + 127548 => true, + 127549 => true, + 127550 => true, + 127551 => true, + 127561 => true, + 127562 => true, + 127563 => true, + 127564 => true, + 127565 => true, + 127566 => true, + 127567 => true, + 127570 => true, + 127571 => true, + 127572 => true, + 127573 => true, + 127574 => true, + 127575 => true, + 127576 => true, + 127577 => true, + 127578 => true, + 127579 => true, + 127580 => true, + 127581 => true, + 127582 => true, + 127583 => true, + 128728 => true, + 128729 => true, + 128730 => true, + 128731 => true, + 128732 => true, + 128733 => true, + 128734 => true, + 128735 => true, + 128749 => true, + 128750 => true, + 128751 => true, + 128765 => true, + 128766 => true, + 128767 => true, + 128884 => true, + 128885 => true, + 128886 => true, + 128887 => true, + 128888 => true, + 128889 => true, + 128890 => true, + 128891 => true, + 128892 => true, + 128893 => true, + 128894 => true, + 128895 => true, + 128985 => true, + 128986 => true, + 128987 => true, + 128988 => true, + 128989 => true, + 128990 => true, + 128991 => true, + 129004 => true, + 129005 => true, + 129006 => true, + 129007 => true, + 129008 => true, + 129009 => true, + 129010 => true, + 129011 => true, + 129012 => true, + 129013 => true, + 129014 => true, + 129015 => true, + 129016 => true, + 129017 => true, + 129018 => true, + 129019 => true, + 129020 => true, + 129021 => true, + 129022 => true, + 129023 => true, + 129036 => true, + 129037 => true, + 129038 => true, + 129039 => true, + 129096 => true, + 129097 => true, + 129098 => true, + 129099 => true, + 129100 => true, + 129101 => true, + 129102 => true, + 129103 => true, + 129114 => true, + 129115 => true, + 129116 => true, + 129117 => true, + 129118 => true, + 129119 => true, + 129160 => true, + 129161 => true, + 129162 => true, + 129163 => true, + 129164 => true, + 129165 => true, + 129166 => true, + 129167 => true, + 129198 => true, + 129199 => true, + 129401 => true, + 129484 => true, + 129620 => true, + 129621 => true, + 129622 => true, + 129623 => true, + 129624 => true, + 129625 => true, + 129626 => true, + 129627 => true, + 129628 => true, + 129629 => true, + 129630 => true, + 129631 => true, + 129646 => true, + 129647 => true, + 129653 => true, + 129654 => true, + 129655 => true, + 129659 => true, + 129660 => true, + 129661 => true, + 129662 => true, + 129663 => true, + 129671 => true, + 129672 => true, + 129673 => true, + 129674 => true, + 129675 => true, + 129676 => true, + 129677 => true, + 129678 => true, + 129679 => true, + 129705 => true, + 129706 => true, + 129707 => true, + 129708 => true, + 129709 => true, + 129710 => true, + 129711 => true, + 129719 => true, + 129720 => true, + 129721 => true, + 129722 => true, + 129723 => true, + 129724 => true, + 129725 => true, + 129726 => true, + 129727 => true, + 129731 => true, + 129732 => true, + 129733 => true, + 129734 => true, + 129735 => true, + 129736 => true, + 129737 => true, + 129738 => true, + 129739 => true, + 129740 => true, + 129741 => true, + 129742 => true, + 129743 => true, + 129939 => true, + 131070 => true, + 131071 => true, + 177973 => true, + 177974 => true, + 177975 => true, + 177976 => true, + 177977 => true, + 177978 => true, + 177979 => true, + 177980 => true, + 177981 => true, + 177982 => true, + 177983 => true, + 178206 => true, + 178207 => true, + 183970 => true, + 183971 => true, + 183972 => true, + 183973 => true, + 183974 => true, + 183975 => true, + 183976 => true, + 183977 => true, + 183978 => true, + 183979 => true, + 183980 => true, + 183981 => true, + 183982 => true, + 183983 => true, + 194664 => true, + 194676 => true, + 194847 => true, + 194911 => true, + 195007 => true, + 196606 => true, + 196607 => true, + 262142 => true, + 262143 => true, + 327678 => true, + 327679 => true, + 393214 => true, + 393215 => true, + 458750 => true, + 458751 => true, + 524286 => true, + 524287 => true, + 589822 => true, + 589823 => true, + 655358 => true, + 655359 => true, + 720894 => true, + 720895 => true, + 786430 => true, + 786431 => true, + 851966 => true, + 851967 => true, + 917502 => true, + 917503 => true, + 917504 => true, + 917505 => true, + 917506 => true, + 917507 => true, + 917508 => true, + 917509 => true, + 917510 => true, + 917511 => true, + 917512 => true, + 917513 => true, + 917514 => true, + 917515 => true, + 917516 => true, + 917517 => true, + 917518 => true, + 917519 => true, + 917520 => true, + 917521 => true, + 917522 => true, + 917523 => true, + 917524 => true, + 917525 => true, + 917526 => true, + 917527 => true, + 917528 => true, + 917529 => true, + 917530 => true, + 917531 => true, + 917532 => true, + 917533 => true, + 917534 => true, + 917535 => true, + 983038 => true, + 983039 => true, + 1048574 => true, + 1048575 => true, + 1114110 => true, + 1114111 => true, +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php new file mode 100644 index 0000000000..54f21cc0cd --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php @@ -0,0 +1,308 @@ +<?php + +return array ( + 160 => ' ', + 168 => ' ̈', + 175 => ' Ì„', + 180 => ' Ì', + 184 => ' ̧', + 728 => ' ̆', + 729 => ' ̇', + 730 => ' ÌŠ', + 731 => ' ̨', + 732 => ' ̃', + 733 => ' Ì‹', + 890 => ' ι', + 894 => ';', + 900 => ' Ì', + 901 => ' ̈Ì', + 8125 => ' Ì“', + 8127 => ' Ì“', + 8128 => ' Í‚', + 8129 => ' ̈͂', + 8141 => ' ̓̀', + 8142 => ' Ì“Ì', + 8143 => ' ̓͂', + 8157 => ' ̔̀', + 8158 => ' Ì”Ì', + 8159 => ' ̔͂', + 8173 => ' ̈̀', + 8174 => ' ̈Ì', + 8175 => '`', + 8189 => ' Ì', + 8190 => ' Ì”', + 8192 => ' ', + 8193 => ' ', + 8194 => ' ', + 8195 => ' ', + 8196 => ' ', + 8197 => ' ', + 8198 => ' ', + 8199 => ' ', + 8200 => ' ', + 8201 => ' ', + 8202 => ' ', + 8215 => ' ̳', + 8239 => ' ', + 8252 => '!!', + 8254 => ' Ì…', + 8263 => '??', + 8264 => '?!', + 8265 => '!?', + 8287 => ' ', + 8314 => '+', + 8316 => '=', + 8317 => '(', + 8318 => ')', + 8330 => '+', + 8332 => '=', + 8333 => '(', + 8334 => ')', + 8448 => 'a/c', + 8449 => 'a/s', + 8453 => 'c/o', + 8454 => 'c/u', + 9332 => '(1)', + 9333 => '(2)', + 9334 => '(3)', + 9335 => '(4)', + 9336 => '(5)', + 9337 => '(6)', + 9338 => '(7)', + 9339 => '(8)', + 9340 => '(9)', + 9341 => '(10)', + 9342 => '(11)', + 9343 => '(12)', + 9344 => '(13)', + 9345 => '(14)', + 9346 => '(15)', + 9347 => '(16)', + 9348 => '(17)', + 9349 => '(18)', + 9350 => '(19)', + 9351 => '(20)', + 9372 => '(a)', + 9373 => '(b)', + 9374 => '(c)', + 9375 => '(d)', + 9376 => '(e)', + 9377 => '(f)', + 9378 => '(g)', + 9379 => '(h)', + 9380 => '(i)', + 9381 => '(j)', + 9382 => '(k)', + 9383 => '(l)', + 9384 => '(m)', + 9385 => '(n)', + 9386 => '(o)', + 9387 => '(p)', + 9388 => '(q)', + 9389 => '(r)', + 9390 => '(s)', + 9391 => '(t)', + 9392 => '(u)', + 9393 => '(v)', + 9394 => '(w)', + 9395 => '(x)', + 9396 => '(y)', + 9397 => '(z)', + 10868 => '::=', + 10869 => '==', + 10870 => '===', + 12288 => ' ', + 12443 => ' ã‚™', + 12444 => ' ゚', + 12800 => '(á„€)', + 12801 => '(á„‚)', + 12802 => '(ᄃ)', + 12803 => '(á„…)', + 12804 => '(ᄆ)', + 12805 => '(ᄇ)', + 12806 => '(ᄉ)', + 12807 => '(á„‹)', + 12808 => '(ᄌ)', + 12809 => '(ᄎ)', + 12810 => '(á„)', + 12811 => '(á„)', + 12812 => '(á„‘)', + 12813 => '(á„’)', + 12814 => '(ê°€)', + 12815 => '(나)', + 12816 => '(다)', + 12817 => '(ë¼)', + 12818 => '(마)', + 12819 => '(ë°”)', + 12820 => '(사)', + 12821 => '(ì•„)', + 12822 => '(ìž)', + 12823 => '(ì°¨)', + 12824 => '(ì¹´)', + 12825 => '(타)', + 12826 => '(파)', + 12827 => '(하)', + 12828 => '(주)', + 12829 => '(오전)', + 12830 => '(오후)', + 12832 => '(一)', + 12833 => '(二)', + 12834 => '(三)', + 12835 => '(å››)', + 12836 => '(五)', + 12837 => '(å…­)', + 12838 => '(七)', + 12839 => '(å…«)', + 12840 => '(ä¹)', + 12841 => '(å)', + 12842 => '(月)', + 12843 => '(ç«)', + 12844 => '(æ°´)', + 12845 => '(木)', + 12846 => '(金)', + 12847 => '(土)', + 12848 => '(æ—¥)', + 12849 => '(æ ª)', + 12850 => '(有)', + 12851 => '(社)', + 12852 => '(å)', + 12853 => '(特)', + 12854 => '(財)', + 12855 => '(ç¥)', + 12856 => '(労)', + 12857 => '(代)', + 12858 => '(呼)', + 12859 => '(å­¦)', + 12860 => '(監)', + 12861 => '(ä¼)', + 12862 => '(資)', + 12863 => '(å”)', + 12864 => '(祭)', + 12865 => '(休)', + 12866 => '(自)', + 12867 => '(至)', + 64297 => '+', + 64606 => ' ٌّ', + 64607 => ' ÙÙ‘', + 64608 => ' ÙŽÙ‘', + 64609 => ' ÙÙ‘', + 64610 => ' ÙÙ‘', + 64611 => ' ّٰ', + 65018 => 'صلى الله عليه وسلم', + 65019 => 'جل جلاله', + 65040 => ',', + 65043 => ':', + 65044 => ';', + 65045 => '!', + 65046 => '?', + 65075 => '_', + 65076 => '_', + 65077 => '(', + 65078 => ')', + 65079 => '{', + 65080 => '}', + 65095 => '[', + 65096 => ']', + 65097 => ' Ì…', + 65098 => ' Ì…', + 65099 => ' Ì…', + 65100 => ' Ì…', + 65101 => '_', + 65102 => '_', + 65103 => '_', + 65104 => ',', + 65108 => ';', + 65109 => ':', + 65110 => '?', + 65111 => '!', + 65113 => '(', + 65114 => ')', + 65115 => '{', + 65116 => '}', + 65119 => '#', + 65120 => '&', + 65121 => '*', + 65122 => '+', + 65124 => '<', + 65125 => '>', + 65126 => '=', + 65128 => '\\', + 65129 => '$', + 65130 => '%', + 65131 => '@', + 65136 => ' Ù‹', + 65138 => ' ÙŒ', + 65140 => ' Ù', + 65142 => ' ÙŽ', + 65144 => ' Ù', + 65146 => ' Ù', + 65148 => ' Ù‘', + 65150 => ' Ù’', + 65281 => '!', + 65282 => '"', + 65283 => '#', + 65284 => '$', + 65285 => '%', + 65286 => '&', + 65287 => '\'', + 65288 => '(', + 65289 => ')', + 65290 => '*', + 65291 => '+', + 65292 => ',', + 65295 => '/', + 65306 => ':', + 65307 => ';', + 65308 => '<', + 65309 => '=', + 65310 => '>', + 65311 => '?', + 65312 => '@', + 65339 => '[', + 65340 => '\\', + 65341 => ']', + 65342 => '^', + 65343 => '_', + 65344 => '`', + 65371 => '{', + 65372 => '|', + 65373 => '}', + 65374 => '~', + 65507 => ' Ì„', + 127233 => '0,', + 127234 => '1,', + 127235 => '2,', + 127236 => '3,', + 127237 => '4,', + 127238 => '5,', + 127239 => '6,', + 127240 => '7,', + 127241 => '8,', + 127242 => '9,', + 127248 => '(a)', + 127249 => '(b)', + 127250 => '(c)', + 127251 => '(d)', + 127252 => '(e)', + 127253 => '(f)', + 127254 => '(g)', + 127255 => '(h)', + 127256 => '(i)', + 127257 => '(j)', + 127258 => '(k)', + 127259 => '(l)', + 127260 => '(m)', + 127261 => '(n)', + 127262 => '(o)', + 127263 => '(p)', + 127264 => '(q)', + 127265 => '(r)', + 127266 => '(s)', + 127267 => '(t)', + 127268 => '(u)', + 127269 => '(v)', + 127270 => '(w)', + 127271 => '(x)', + 127272 => '(y)', + 127273 => '(z)', +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php new file mode 100644 index 0000000000..223396ec4c --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php @@ -0,0 +1,71 @@ +<?php + +return array ( + 0 => true, + 1 => true, + 2 => true, + 3 => true, + 4 => true, + 5 => true, + 6 => true, + 7 => true, + 8 => true, + 9 => true, + 10 => true, + 11 => true, + 12 => true, + 13 => true, + 14 => true, + 15 => true, + 16 => true, + 17 => true, + 18 => true, + 19 => true, + 20 => true, + 21 => true, + 22 => true, + 23 => true, + 24 => true, + 25 => true, + 26 => true, + 27 => true, + 28 => true, + 29 => true, + 30 => true, + 31 => true, + 32 => true, + 33 => true, + 34 => true, + 35 => true, + 36 => true, + 37 => true, + 38 => true, + 39 => true, + 40 => true, + 41 => true, + 42 => true, + 43 => true, + 44 => true, + 47 => true, + 58 => true, + 59 => true, + 60 => true, + 61 => true, + 62 => true, + 63 => true, + 64 => true, + 91 => true, + 92 => true, + 93 => true, + 94 => true, + 95 => true, + 96 => true, + 123 => true, + 124 => true, + 125 => true, + 126 => true, + 127 => true, + 8800 => true, + 8814 => true, + 8815 => true, +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php new file mode 100644 index 0000000000..b377844130 --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/ignored.php @@ -0,0 +1,273 @@ +<?php + +return array ( + 173 => true, + 847 => true, + 6155 => true, + 6156 => true, + 6157 => true, + 8203 => true, + 8288 => true, + 8292 => true, + 65024 => true, + 65025 => true, + 65026 => true, + 65027 => true, + 65028 => true, + 65029 => true, + 65030 => true, + 65031 => true, + 65032 => true, + 65033 => true, + 65034 => true, + 65035 => true, + 65036 => true, + 65037 => true, + 65038 => true, + 65039 => true, + 65279 => true, + 113824 => true, + 113825 => true, + 113826 => true, + 113827 => true, + 917760 => true, + 917761 => true, + 917762 => true, + 917763 => true, + 917764 => true, + 917765 => true, + 917766 => true, + 917767 => true, + 917768 => true, + 917769 => true, + 917770 => true, + 917771 => true, + 917772 => true, + 917773 => true, + 917774 => true, + 917775 => true, + 917776 => true, + 917777 => true, + 917778 => true, + 917779 => true, + 917780 => true, + 917781 => true, + 917782 => true, + 917783 => true, + 917784 => true, + 917785 => true, + 917786 => true, + 917787 => true, + 917788 => true, + 917789 => true, + 917790 => true, + 917791 => true, + 917792 => true, + 917793 => true, + 917794 => true, + 917795 => true, + 917796 => true, + 917797 => true, + 917798 => true, + 917799 => true, + 917800 => true, + 917801 => true, + 917802 => true, + 917803 => true, + 917804 => true, + 917805 => true, + 917806 => true, + 917807 => true, + 917808 => true, + 917809 => true, + 917810 => true, + 917811 => true, + 917812 => true, + 917813 => true, + 917814 => true, + 917815 => true, + 917816 => true, + 917817 => true, + 917818 => true, + 917819 => true, + 917820 => true, + 917821 => true, + 917822 => true, + 917823 => true, + 917824 => true, + 917825 => true, + 917826 => true, + 917827 => true, + 917828 => true, + 917829 => true, + 917830 => true, + 917831 => true, + 917832 => true, + 917833 => true, + 917834 => true, + 917835 => true, + 917836 => true, + 917837 => true, + 917838 => true, + 917839 => true, + 917840 => true, + 917841 => true, + 917842 => true, + 917843 => true, + 917844 => true, + 917845 => true, + 917846 => true, + 917847 => true, + 917848 => true, + 917849 => true, + 917850 => true, + 917851 => true, + 917852 => true, + 917853 => true, + 917854 => true, + 917855 => true, + 917856 => true, + 917857 => true, + 917858 => true, + 917859 => true, + 917860 => true, + 917861 => true, + 917862 => true, + 917863 => true, + 917864 => true, + 917865 => true, + 917866 => true, + 917867 => true, + 917868 => true, + 917869 => true, + 917870 => true, + 917871 => true, + 917872 => true, + 917873 => true, + 917874 => true, + 917875 => true, + 917876 => true, + 917877 => true, + 917878 => true, + 917879 => true, + 917880 => true, + 917881 => true, + 917882 => true, + 917883 => true, + 917884 => true, + 917885 => true, + 917886 => true, + 917887 => true, + 917888 => true, + 917889 => true, + 917890 => true, + 917891 => true, + 917892 => true, + 917893 => true, + 917894 => true, + 917895 => true, + 917896 => true, + 917897 => true, + 917898 => true, + 917899 => true, + 917900 => true, + 917901 => true, + 917902 => true, + 917903 => true, + 917904 => true, + 917905 => true, + 917906 => true, + 917907 => true, + 917908 => true, + 917909 => true, + 917910 => true, + 917911 => true, + 917912 => true, + 917913 => true, + 917914 => true, + 917915 => true, + 917916 => true, + 917917 => true, + 917918 => true, + 917919 => true, + 917920 => true, + 917921 => true, + 917922 => true, + 917923 => true, + 917924 => true, + 917925 => true, + 917926 => true, + 917927 => true, + 917928 => true, + 917929 => true, + 917930 => true, + 917931 => true, + 917932 => true, + 917933 => true, + 917934 => true, + 917935 => true, + 917936 => true, + 917937 => true, + 917938 => true, + 917939 => true, + 917940 => true, + 917941 => true, + 917942 => true, + 917943 => true, + 917944 => true, + 917945 => true, + 917946 => true, + 917947 => true, + 917948 => true, + 917949 => true, + 917950 => true, + 917951 => true, + 917952 => true, + 917953 => true, + 917954 => true, + 917955 => true, + 917956 => true, + 917957 => true, + 917958 => true, + 917959 => true, + 917960 => true, + 917961 => true, + 917962 => true, + 917963 => true, + 917964 => true, + 917965 => true, + 917966 => true, + 917967 => true, + 917968 => true, + 917969 => true, + 917970 => true, + 917971 => true, + 917972 => true, + 917973 => true, + 917974 => true, + 917975 => true, + 917976 => true, + 917977 => true, + 917978 => true, + 917979 => true, + 917980 => true, + 917981 => true, + 917982 => true, + 917983 => true, + 917984 => true, + 917985 => true, + 917986 => true, + 917987 => true, + 917988 => true, + 917989 => true, + 917990 => true, + 917991 => true, + 917992 => true, + 917993 => true, + 917994 => true, + 917995 => true, + 917996 => true, + 917997 => true, + 917998 => true, + 917999 => true, +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php new file mode 100644 index 0000000000..9b85fe9d3f --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/mapped.php @@ -0,0 +1,5778 @@ +<?php + +return array ( + 65 => 'a', + 66 => 'b', + 67 => 'c', + 68 => 'd', + 69 => 'e', + 70 => 'f', + 71 => 'g', + 72 => 'h', + 73 => 'i', + 74 => 'j', + 75 => 'k', + 76 => 'l', + 77 => 'm', + 78 => 'n', + 79 => 'o', + 80 => 'p', + 81 => 'q', + 82 => 'r', + 83 => 's', + 84 => 't', + 85 => 'u', + 86 => 'v', + 87 => 'w', + 88 => 'x', + 89 => 'y', + 90 => 'z', + 170 => 'a', + 178 => '2', + 179 => '3', + 181 => 'μ', + 185 => '1', + 186 => 'o', + 188 => '1â„4', + 189 => '1â„2', + 190 => '3â„4', + 192 => 'à', + 193 => 'á', + 194 => 'â', + 195 => 'ã', + 196 => 'ä', + 197 => 'Ã¥', + 198 => 'æ', + 199 => 'ç', + 200 => 'è', + 201 => 'é', + 202 => 'ê', + 203 => 'ë', + 204 => 'ì', + 205 => 'í', + 206 => 'î', + 207 => 'ï', + 208 => 'ð', + 209 => 'ñ', + 210 => 'ò', + 211 => 'ó', + 212 => 'ô', + 213 => 'õ', + 214 => 'ö', + 216 => 'ø', + 217 => 'ù', + 218 => 'ú', + 219 => 'û', + 220 => 'ü', + 221 => 'ý', + 222 => 'þ', + 256 => 'Ä', + 258 => 'ă', + 260 => 'Ä…', + 262 => 'ć', + 264 => 'ĉ', + 266 => 'Ä‹', + 268 => 'Ä', + 270 => 'Ä', + 272 => 'Ä‘', + 274 => 'Ä“', + 276 => 'Ä•', + 278 => 'Ä—', + 280 => 'Ä™', + 282 => 'Ä›', + 284 => 'Ä', + 286 => 'ÄŸ', + 288 => 'Ä¡', + 290 => 'Ä£', + 292 => 'Ä¥', + 294 => 'ħ', + 296 => 'Ä©', + 298 => 'Ä«', + 300 => 'Ä­', + 302 => 'į', + 304 => 'i̇', + 306 => 'ij', + 307 => 'ij', + 308 => 'ĵ', + 310 => 'Ä·', + 313 => 'ĺ', + 315 => 'ļ', + 317 => 'ľ', + 319 => 'l·', + 320 => 'l·', + 321 => 'Å‚', + 323 => 'Å„', + 325 => 'ņ', + 327 => 'ň', + 329 => 'ʼn', + 330 => 'Å‹', + 332 => 'Å', + 334 => 'Å', + 336 => 'Å‘', + 338 => 'Å“', + 340 => 'Å•', + 342 => 'Å—', + 344 => 'Å™', + 346 => 'Å›', + 348 => 'Å', + 350 => 'ÅŸ', + 352 => 'Å¡', + 354 => 'Å£', + 356 => 'Å¥', + 358 => 'ŧ', + 360 => 'Å©', + 362 => 'Å«', + 364 => 'Å­', + 366 => 'ů', + 368 => 'ű', + 370 => 'ų', + 372 => 'ŵ', + 374 => 'Å·', + 376 => 'ÿ', + 377 => 'ź', + 379 => 'ż', + 381 => 'ž', + 383 => 's', + 385 => 'É“', + 386 => 'ƃ', + 388 => 'Æ…', + 390 => 'É”', + 391 => 'ƈ', + 393 => 'É–', + 394 => 'É—', + 395 => 'ÆŒ', + 398 => 'Ç', + 399 => 'É™', + 400 => 'É›', + 401 => 'Æ’', + 403 => 'É ', + 404 => 'É£', + 406 => 'É©', + 407 => 'ɨ', + 408 => 'Æ™', + 412 => 'ɯ', + 413 => 'ɲ', + 415 => 'ɵ', + 416 => 'Æ¡', + 418 => 'Æ£', + 420 => 'Æ¥', + 422 => 'Ê€', + 423 => 'ƨ', + 425 => 'ʃ', + 428 => 'Æ­', + 430 => 'ʈ', + 431 => 'ư', + 433 => 'ÊŠ', + 434 => 'Ê‹', + 435 => 'Æ´', + 437 => 'ƶ', + 439 => 'Ê’', + 440 => 'ƹ', + 444 => 'ƽ', + 452 => 'dž', + 453 => 'dž', + 454 => 'dž', + 455 => 'lj', + 456 => 'lj', + 457 => 'lj', + 458 => 'nj', + 459 => 'nj', + 460 => 'nj', + 461 => 'ÇŽ', + 463 => 'Ç', + 465 => 'Ç’', + 467 => 'Ç”', + 469 => 'Ç–', + 471 => 'ǘ', + 473 => 'Çš', + 475 => 'Çœ', + 478 => 'ÇŸ', + 480 => 'Ç¡', + 482 => 'Ç£', + 484 => 'Ç¥', + 486 => 'ǧ', + 488 => 'Ç©', + 490 => 'Ç«', + 492 => 'Ç­', + 494 => 'ǯ', + 497 => 'dz', + 498 => 'dz', + 499 => 'dz', + 500 => 'ǵ', + 502 => 'Æ•', + 503 => 'Æ¿', + 504 => 'ǹ', + 506 => 'Ç»', + 508 => 'ǽ', + 510 => 'Ç¿', + 512 => 'È', + 514 => 'ȃ', + 516 => 'È…', + 518 => 'ȇ', + 520 => 'ȉ', + 522 => 'È‹', + 524 => 'È', + 526 => 'È', + 528 => 'È‘', + 530 => 'È“', + 532 => 'È•', + 534 => 'È—', + 536 => 'È™', + 538 => 'È›', + 540 => 'È', + 542 => 'ÈŸ', + 544 => 'Æž', + 546 => 'È£', + 548 => 'È¥', + 550 => 'ȧ', + 552 => 'È©', + 554 => 'È«', + 556 => 'È­', + 558 => 'ȯ', + 560 => 'ȱ', + 562 => 'ȳ', + 570 => 'â±¥', + 571 => 'ȼ', + 573 => 'Æš', + 574 => 'ⱦ', + 577 => 'É‚', + 579 => 'Æ€', + 580 => 'ʉ', + 581 => 'ÊŒ', + 582 => 'ɇ', + 584 => 'ɉ', + 586 => 'É‹', + 588 => 'É', + 590 => 'É', + 688 => 'h', + 689 => 'ɦ', + 690 => 'j', + 691 => 'r', + 692 => 'ɹ', + 693 => 'É»', + 694 => 'Ê', + 695 => 'w', + 696 => 'y', + 736 => 'É£', + 737 => 'l', + 738 => 's', + 739 => 'x', + 740 => 'Ê•', + 832 => 'Ì€', + 833 => 'Ì', + 835 => 'Ì“', + 836 => '̈Ì', + 837 => 'ι', + 880 => 'ͱ', + 882 => 'ͳ', + 884 => 'ʹ', + 886 => 'Í·', + 895 => 'ϳ', + 902 => 'ά', + 903 => '·', + 904 => 'έ', + 905 => 'ή', + 906 => 'ί', + 908 => 'ÏŒ', + 910 => 'Ï', + 911 => 'ÏŽ', + 913 => 'α', + 914 => 'β', + 915 => 'γ', + 916 => 'δ', + 917 => 'ε', + 918 => 'ζ', + 919 => 'η', + 920 => 'θ', + 921 => 'ι', + 922 => 'κ', + 923 => 'λ', + 924 => 'μ', + 925 => 'ν', + 926 => 'ξ', + 927 => 'ο', + 928 => 'Ï€', + 929 => 'Ï', + 931 => 'σ', + 932 => 'Ï„', + 933 => 'Ï…', + 934 => 'φ', + 935 => 'χ', + 936 => 'ψ', + 937 => 'ω', + 938 => 'ÏŠ', + 939 => 'Ï‹', + 975 => 'Ï—', + 976 => 'β', + 977 => 'θ', + 978 => 'Ï…', + 979 => 'Ï', + 980 => 'Ï‹', + 981 => 'φ', + 982 => 'Ï€', + 984 => 'Ï™', + 986 => 'Ï›', + 988 => 'Ï', + 990 => 'ÏŸ', + 992 => 'Ï¡', + 994 => 'Ï£', + 996 => 'Ï¥', + 998 => 'ϧ', + 1000 => 'Ï©', + 1002 => 'Ï«', + 1004 => 'Ï­', + 1006 => 'ϯ', + 1008 => 'κ', + 1009 => 'Ï', + 1010 => 'σ', + 1012 => 'θ', + 1013 => 'ε', + 1015 => 'ϸ', + 1017 => 'σ', + 1018 => 'Ï»', + 1021 => 'Í»', + 1022 => 'ͼ', + 1023 => 'ͽ', + 1024 => 'Ñ', + 1025 => 'Ñ‘', + 1026 => 'Ñ’', + 1027 => 'Ñ“', + 1028 => 'Ñ”', + 1029 => 'Ñ•', + 1030 => 'Ñ–', + 1031 => 'Ñ—', + 1032 => 'ј', + 1033 => 'Ñ™', + 1034 => 'Ñš', + 1035 => 'Ñ›', + 1036 => 'Ñœ', + 1037 => 'Ñ', + 1038 => 'Ñž', + 1039 => 'ÑŸ', + 1040 => 'а', + 1041 => 'б', + 1042 => 'в', + 1043 => 'г', + 1044 => 'д', + 1045 => 'е', + 1046 => 'ж', + 1047 => 'з', + 1048 => 'и', + 1049 => 'й', + 1050 => 'к', + 1051 => 'л', + 1052 => 'м', + 1053 => 'н', + 1054 => 'о', + 1055 => 'п', + 1056 => 'Ñ€', + 1057 => 'Ñ', + 1058 => 'Ñ‚', + 1059 => 'у', + 1060 => 'Ñ„', + 1061 => 'Ñ…', + 1062 => 'ц', + 1063 => 'ч', + 1064 => 'ш', + 1065 => 'щ', + 1066 => 'ÑŠ', + 1067 => 'Ñ‹', + 1068 => 'ÑŒ', + 1069 => 'Ñ', + 1070 => 'ÑŽ', + 1071 => 'Ñ', + 1120 => 'Ñ¡', + 1122 => 'Ñ£', + 1124 => 'Ñ¥', + 1126 => 'ѧ', + 1128 => 'Ñ©', + 1130 => 'Ñ«', + 1132 => 'Ñ­', + 1134 => 'ѯ', + 1136 => 'ѱ', + 1138 => 'ѳ', + 1140 => 'ѵ', + 1142 => 'Ñ·', + 1144 => 'ѹ', + 1146 => 'Ñ»', + 1148 => 'ѽ', + 1150 => 'Ñ¿', + 1152 => 'Ò', + 1162 => 'Ò‹', + 1164 => 'Ò', + 1166 => 'Ò', + 1168 => 'Ò‘', + 1170 => 'Ò“', + 1172 => 'Ò•', + 1174 => 'Ò—', + 1176 => 'Ò™', + 1178 => 'Ò›', + 1180 => 'Ò', + 1182 => 'ÒŸ', + 1184 => 'Ò¡', + 1186 => 'Ò£', + 1188 => 'Ò¥', + 1190 => 'Ò§', + 1192 => 'Ò©', + 1194 => 'Ò«', + 1196 => 'Ò­', + 1198 => 'Ò¯', + 1200 => 'Ò±', + 1202 => 'Ò³', + 1204 => 'Òµ', + 1206 => 'Ò·', + 1208 => 'Ò¹', + 1210 => 'Ò»', + 1212 => 'Ò½', + 1214 => 'Ò¿', + 1217 => 'Ó‚', + 1219 => 'Ó„', + 1221 => 'Ó†', + 1223 => 'Óˆ', + 1225 => 'ÓŠ', + 1227 => 'ÓŒ', + 1229 => 'ÓŽ', + 1232 => 'Ó‘', + 1234 => 'Ó“', + 1236 => 'Ó•', + 1238 => 'Ó—', + 1240 => 'Ó™', + 1242 => 'Ó›', + 1244 => 'Ó', + 1246 => 'ÓŸ', + 1248 => 'Ó¡', + 1250 => 'Ó£', + 1252 => 'Ó¥', + 1254 => 'Ó§', + 1256 => 'Ó©', + 1258 => 'Ó«', + 1260 => 'Ó­', + 1262 => 'Ó¯', + 1264 => 'Ó±', + 1266 => 'Ó³', + 1268 => 'Óµ', + 1270 => 'Ó·', + 1272 => 'Ó¹', + 1274 => 'Ó»', + 1276 => 'Ó½', + 1278 => 'Ó¿', + 1280 => 'Ô', + 1282 => 'Ôƒ', + 1284 => 'Ô…', + 1286 => 'Ô‡', + 1288 => 'Ô‰', + 1290 => 'Ô‹', + 1292 => 'Ô', + 1294 => 'Ô', + 1296 => 'Ô‘', + 1298 => 'Ô“', + 1300 => 'Ô•', + 1302 => 'Ô—', + 1304 => 'Ô™', + 1306 => 'Ô›', + 1308 => 'Ô', + 1310 => 'ÔŸ', + 1312 => 'Ô¡', + 1314 => 'Ô£', + 1316 => 'Ô¥', + 1318 => 'Ô§', + 1320 => 'Ô©', + 1322 => 'Ô«', + 1324 => 'Ô­', + 1326 => 'Ô¯', + 1329 => 'Õ¡', + 1330 => 'Õ¢', + 1331 => 'Õ£', + 1332 => 'Õ¤', + 1333 => 'Õ¥', + 1334 => 'Õ¦', + 1335 => 'Õ§', + 1336 => 'Õ¨', + 1337 => 'Õ©', + 1338 => 'Õª', + 1339 => 'Õ«', + 1340 => 'Õ¬', + 1341 => 'Õ­', + 1342 => 'Õ®', + 1343 => 'Õ¯', + 1344 => 'Õ°', + 1345 => 'Õ±', + 1346 => 'Õ²', + 1347 => 'Õ³', + 1348 => 'Õ´', + 1349 => 'Õµ', + 1350 => 'Õ¶', + 1351 => 'Õ·', + 1352 => 'Õ¸', + 1353 => 'Õ¹', + 1354 => 'Õº', + 1355 => 'Õ»', + 1356 => 'Õ¼', + 1357 => 'Õ½', + 1358 => 'Õ¾', + 1359 => 'Õ¿', + 1360 => 'Ö€', + 1361 => 'Ö', + 1362 => 'Ö‚', + 1363 => 'Öƒ', + 1364 => 'Ö„', + 1365 => 'Ö…', + 1366 => 'Ö†', + 1415 => 'Õ¥Ö‚', + 1653 => 'اٴ', + 1654 => 'وٴ', + 1655 => 'Û‡Ù´', + 1656 => 'يٴ', + 2392 => 'क़', + 2393 => 'ख़', + 2394 => 'ग़', + 2395 => 'ज़', + 2396 => 'ड़', + 2397 => 'ढ़', + 2398 => 'फ़', + 2399 => 'य़', + 2524 => 'ড়', + 2525 => 'ঢ়', + 2527 => 'য়', + 2611 => 'ਲ਼', + 2614 => 'ਸ਼', + 2649 => 'ਖ਼', + 2650 => 'ਗ਼', + 2651 => 'ਜ਼', + 2654 => 'ਫ਼', + 2908 => 'ଡ଼', + 2909 => 'ଢ଼', + 3635 => 'à¹à¸²', + 3763 => 'à»àº²', + 3804 => 'ຫນ', + 3805 => 'ຫມ', + 3852 => '་', + 3907 => 'གྷ', + 3917 => 'ཌྷ', + 3922 => 'དྷ', + 3927 => 'བྷ', + 3932 => 'ཛྷ', + 3945 => 'ཀྵ', + 3955 => 'ཱི', + 3957 => 'ཱུ', + 3958 => 'ྲྀ', + 3959 => 'ྲཱྀ', + 3960 => 'ླྀ', + 3961 => 'ླཱྀ', + 3969 => 'ཱྀ', + 3987 => 'ྒྷ', + 3997 => 'ྜྷ', + 4002 => 'ྡྷ', + 4007 => 'ྦྷ', + 4012 => 'ྫྷ', + 4025 => 'à¾à¾µ', + 4295 => 'â´§', + 4301 => 'â´­', + 4348 => 'ნ', + 5112 => 'á°', + 5113 => 'á±', + 5114 => 'á²', + 5115 => 'á³', + 5116 => 'á´', + 5117 => 'áµ', + 7296 => 'в', + 7297 => 'д', + 7298 => 'о', + 7299 => 'Ñ', + 7300 => 'Ñ‚', + 7301 => 'Ñ‚', + 7302 => 'ÑŠ', + 7303 => 'Ñ£', + 7304 => 'ꙋ', + 7312 => 'áƒ', + 7313 => 'ბ', + 7314 => 'გ', + 7315 => 'დ', + 7316 => 'ე', + 7317 => 'ვ', + 7318 => 'ზ', + 7319 => 'თ', + 7320 => 'ი', + 7321 => 'კ', + 7322 => 'ლ', + 7323 => 'მ', + 7324 => 'ნ', + 7325 => 'áƒ', + 7326 => 'პ', + 7327 => 'ჟ', + 7328 => 'რ', + 7329 => 'ს', + 7330 => 'ტ', + 7331 => 'უ', + 7332 => 'ფ', + 7333 => 'ქ', + 7334 => 'ღ', + 7335 => 'ყ', + 7336 => 'შ', + 7337 => 'ჩ', + 7338 => 'ც', + 7339 => 'ძ', + 7340 => 'წ', + 7341 => 'ჭ', + 7342 => 'ხ', + 7343 => 'ჯ', + 7344 => 'ჰ', + 7345 => 'ჱ', + 7346 => 'ჲ', + 7347 => 'ჳ', + 7348 => 'ჴ', + 7349 => 'ჵ', + 7350 => 'ჶ', + 7351 => 'ჷ', + 7352 => 'ჸ', + 7353 => 'ჹ', + 7354 => 'ჺ', + 7357 => 'ჽ', + 7358 => 'ჾ', + 7359 => 'ჿ', + 7468 => 'a', + 7469 => 'æ', + 7470 => 'b', + 7472 => 'd', + 7473 => 'e', + 7474 => 'Ç', + 7475 => 'g', + 7476 => 'h', + 7477 => 'i', + 7478 => 'j', + 7479 => 'k', + 7480 => 'l', + 7481 => 'm', + 7482 => 'n', + 7484 => 'o', + 7485 => 'È£', + 7486 => 'p', + 7487 => 'r', + 7488 => 't', + 7489 => 'u', + 7490 => 'w', + 7491 => 'a', + 7492 => 'É', + 7493 => 'É‘', + 7494 => 'á´‚', + 7495 => 'b', + 7496 => 'd', + 7497 => 'e', + 7498 => 'É™', + 7499 => 'É›', + 7500 => 'Éœ', + 7501 => 'g', + 7503 => 'k', + 7504 => 'm', + 7505 => 'Å‹', + 7506 => 'o', + 7507 => 'É”', + 7508 => 'á´–', + 7509 => 'á´—', + 7510 => 'p', + 7511 => 't', + 7512 => 'u', + 7513 => 'á´', + 7514 => 'ɯ', + 7515 => 'v', + 7516 => 'á´¥', + 7517 => 'β', + 7518 => 'γ', + 7519 => 'δ', + 7520 => 'φ', + 7521 => 'χ', + 7522 => 'i', + 7523 => 'r', + 7524 => 'u', + 7525 => 'v', + 7526 => 'β', + 7527 => 'γ', + 7528 => 'Ï', + 7529 => 'φ', + 7530 => 'χ', + 7544 => 'н', + 7579 => 'É’', + 7580 => 'c', + 7581 => 'É•', + 7582 => 'ð', + 7583 => 'Éœ', + 7584 => 'f', + 7585 => 'ÉŸ', + 7586 => 'É¡', + 7587 => 'É¥', + 7588 => 'ɨ', + 7589 => 'É©', + 7590 => 'ɪ', + 7591 => 'áµ»', + 7592 => 'Ê', + 7593 => 'É­', + 7594 => 'á¶…', + 7595 => 'ÊŸ', + 7596 => 'ɱ', + 7597 => 'ɰ', + 7598 => 'ɲ', + 7599 => 'ɳ', + 7600 => 'É´', + 7601 => 'ɵ', + 7602 => 'ɸ', + 7603 => 'Ê‚', + 7604 => 'ʃ', + 7605 => 'Æ«', + 7606 => 'ʉ', + 7607 => 'ÊŠ', + 7608 => 'á´œ', + 7609 => 'Ê‹', + 7610 => 'ÊŒ', + 7611 => 'z', + 7612 => 'Ê', + 7613 => 'Ê‘', + 7614 => 'Ê’', + 7615 => 'θ', + 7680 => 'á¸', + 7682 => 'ḃ', + 7684 => 'ḅ', + 7686 => 'ḇ', + 7688 => 'ḉ', + 7690 => 'ḋ', + 7692 => 'á¸', + 7694 => 'á¸', + 7696 => 'ḑ', + 7698 => 'ḓ', + 7700 => 'ḕ', + 7702 => 'ḗ', + 7704 => 'ḙ', + 7706 => 'ḛ', + 7708 => 'á¸', + 7710 => 'ḟ', + 7712 => 'ḡ', + 7714 => 'ḣ', + 7716 => 'ḥ', + 7718 => 'ḧ', + 7720 => 'ḩ', + 7722 => 'ḫ', + 7724 => 'ḭ', + 7726 => 'ḯ', + 7728 => 'ḱ', + 7730 => 'ḳ', + 7732 => 'ḵ', + 7734 => 'ḷ', + 7736 => 'ḹ', + 7738 => 'ḻ', + 7740 => 'ḽ', + 7742 => 'ḿ', + 7744 => 'á¹', + 7746 => 'ṃ', + 7748 => 'á¹…', + 7750 => 'ṇ', + 7752 => 'ṉ', + 7754 => 'ṋ', + 7756 => 'á¹', + 7758 => 'á¹', + 7760 => 'ṑ', + 7762 => 'ṓ', + 7764 => 'ṕ', + 7766 => 'á¹—', + 7768 => 'á¹™', + 7770 => 'á¹›', + 7772 => 'á¹', + 7774 => 'ṟ', + 7776 => 'ṡ', + 7778 => 'á¹£', + 7780 => 'á¹¥', + 7782 => 'á¹§', + 7784 => 'ṩ', + 7786 => 'ṫ', + 7788 => 'á¹­', + 7790 => 'ṯ', + 7792 => 'á¹±', + 7794 => 'á¹³', + 7796 => 'á¹µ', + 7798 => 'á¹·', + 7800 => 'á¹¹', + 7802 => 'á¹»', + 7804 => 'á¹½', + 7806 => 'ṿ', + 7808 => 'áº', + 7810 => 'ẃ', + 7812 => 'ẅ', + 7814 => 'ẇ', + 7816 => 'ẉ', + 7818 => 'ẋ', + 7820 => 'áº', + 7822 => 'áº', + 7824 => 'ẑ', + 7826 => 'ẓ', + 7828 => 'ẕ', + 7834 => 'aʾ', + 7835 => 'ṡ', + 7838 => 'ss', + 7840 => 'ạ', + 7842 => 'ả', + 7844 => 'ấ', + 7846 => 'ầ', + 7848 => 'ẩ', + 7850 => 'ẫ', + 7852 => 'ậ', + 7854 => 'ắ', + 7856 => 'ằ', + 7858 => 'ẳ', + 7860 => 'ẵ', + 7862 => 'ặ', + 7864 => 'ẹ', + 7866 => 'ẻ', + 7868 => 'ẽ', + 7870 => 'ế', + 7872 => 'á»', + 7874 => 'ể', + 7876 => 'á»…', + 7878 => 'ệ', + 7880 => 'ỉ', + 7882 => 'ị', + 7884 => 'á»', + 7886 => 'á»', + 7888 => 'ố', + 7890 => 'ồ', + 7892 => 'ổ', + 7894 => 'á»—', + 7896 => 'á»™', + 7898 => 'á»›', + 7900 => 'á»', + 7902 => 'ở', + 7904 => 'ỡ', + 7906 => 'ợ', + 7908 => 'ụ', + 7910 => 'á»§', + 7912 => 'ứ', + 7914 => 'ừ', + 7916 => 'á»­', + 7918 => 'ữ', + 7920 => 'á»±', + 7922 => 'ỳ', + 7924 => 'ỵ', + 7926 => 'á»·', + 7928 => 'ỹ', + 7930 => 'á»»', + 7932 => 'ỽ', + 7934 => 'ỿ', + 7944 => 'á¼€', + 7945 => 'á¼', + 7946 => 'ἂ', + 7947 => 'ἃ', + 7948 => 'ἄ', + 7949 => 'á¼…', + 7950 => 'ἆ', + 7951 => 'ἇ', + 7960 => 'á¼', + 7961 => 'ἑ', + 7962 => 'á¼’', + 7963 => 'ἓ', + 7964 => 'á¼”', + 7965 => 'ἕ', + 7976 => 'á¼ ', + 7977 => 'ἡ', + 7978 => 'á¼¢', + 7979 => 'á¼£', + 7980 => 'ἤ', + 7981 => 'á¼¥', + 7982 => 'ἦ', + 7983 => 'á¼§', + 7992 => 'á¼°', + 7993 => 'á¼±', + 7994 => 'á¼²', + 7995 => 'á¼³', + 7996 => 'á¼´', + 7997 => 'á¼µ', + 7998 => 'á¼¶', + 7999 => 'á¼·', + 8008 => 'á½€', + 8009 => 'á½', + 8010 => 'ὂ', + 8011 => 'ὃ', + 8012 => 'ὄ', + 8013 => 'á½…', + 8025 => 'ὑ', + 8027 => 'ὓ', + 8029 => 'ὕ', + 8031 => 'á½—', + 8040 => 'á½ ', + 8041 => 'ὡ', + 8042 => 'á½¢', + 8043 => 'á½£', + 8044 => 'ὤ', + 8045 => 'á½¥', + 8046 => 'ὦ', + 8047 => 'á½§', + 8049 => 'ά', + 8051 => 'έ', + 8053 => 'ή', + 8055 => 'ί', + 8057 => 'ÏŒ', + 8059 => 'Ï', + 8061 => 'ÏŽ', + 8064 => 'ἀι', + 8065 => 'á¼Î¹', + 8066 => 'ἂι', + 8067 => 'ἃι', + 8068 => 'ἄι', + 8069 => 'ἅι', + 8070 => 'ἆι', + 8071 => 'ἇι', + 8072 => 'ἀι', + 8073 => 'á¼Î¹', + 8074 => 'ἂι', + 8075 => 'ἃι', + 8076 => 'ἄι', + 8077 => 'ἅι', + 8078 => 'ἆι', + 8079 => 'ἇι', + 8080 => 'ἠι', + 8081 => 'ἡι', + 8082 => 'ἢι', + 8083 => 'ἣι', + 8084 => 'ἤι', + 8085 => 'ἥι', + 8086 => 'ἦι', + 8087 => 'ἧι', + 8088 => 'ἠι', + 8089 => 'ἡι', + 8090 => 'ἢι', + 8091 => 'ἣι', + 8092 => 'ἤι', + 8093 => 'ἥι', + 8094 => 'ἦι', + 8095 => 'ἧι', + 8096 => 'ὠι', + 8097 => 'ὡι', + 8098 => 'ὢι', + 8099 => 'ὣι', + 8100 => 'ὤι', + 8101 => 'ὥι', + 8102 => 'ὦι', + 8103 => 'ὧι', + 8104 => 'ὠι', + 8105 => 'ὡι', + 8106 => 'ὢι', + 8107 => 'ὣι', + 8108 => 'ὤι', + 8109 => 'ὥι', + 8110 => 'ὦι', + 8111 => 'ὧι', + 8114 => 'ὰι', + 8115 => 'αι', + 8116 => 'άι', + 8119 => 'ᾶι', + 8120 => 'á¾°', + 8121 => 'á¾±', + 8122 => 'á½°', + 8123 => 'ά', + 8124 => 'αι', + 8126 => 'ι', + 8130 => 'ὴι', + 8131 => 'ηι', + 8132 => 'ήι', + 8135 => 'ῆι', + 8136 => 'á½²', + 8137 => 'έ', + 8138 => 'á½´', + 8139 => 'ή', + 8140 => 'ηι', + 8147 => 'Î', + 8152 => 'á¿', + 8153 => 'á¿‘', + 8154 => 'á½¶', + 8155 => 'ί', + 8163 => 'ΰ', + 8168 => 'á¿ ', + 8169 => 'á¿¡', + 8170 => 'ὺ', + 8171 => 'Ï', + 8172 => 'á¿¥', + 8178 => 'ὼι', + 8179 => 'ωι', + 8180 => 'ώι', + 8183 => 'ῶι', + 8184 => 'ὸ', + 8185 => 'ÏŒ', + 8186 => 'á½¼', + 8187 => 'ÏŽ', + 8188 => 'ωι', + 8209 => 'â€', + 8243 => '′′', + 8244 => '′′′', + 8246 => '‵‵', + 8247 => '‵‵‵', + 8279 => '′′′′', + 8304 => '0', + 8305 => 'i', + 8308 => '4', + 8309 => '5', + 8310 => '6', + 8311 => '7', + 8312 => '8', + 8313 => '9', + 8315 => '−', + 8319 => 'n', + 8320 => '0', + 8321 => '1', + 8322 => '2', + 8323 => '3', + 8324 => '4', + 8325 => '5', + 8326 => '6', + 8327 => '7', + 8328 => '8', + 8329 => '9', + 8331 => '−', + 8336 => 'a', + 8337 => 'e', + 8338 => 'o', + 8339 => 'x', + 8340 => 'É™', + 8341 => 'h', + 8342 => 'k', + 8343 => 'l', + 8344 => 'm', + 8345 => 'n', + 8346 => 'p', + 8347 => 's', + 8348 => 't', + 8360 => 'rs', + 8450 => 'c', + 8451 => '°c', + 8455 => 'É›', + 8457 => '°f', + 8458 => 'g', + 8459 => 'h', + 8460 => 'h', + 8461 => 'h', + 8462 => 'h', + 8463 => 'ħ', + 8464 => 'i', + 8465 => 'i', + 8466 => 'l', + 8467 => 'l', + 8469 => 'n', + 8470 => 'no', + 8473 => 'p', + 8474 => 'q', + 8475 => 'r', + 8476 => 'r', + 8477 => 'r', + 8480 => 'sm', + 8481 => 'tel', + 8482 => 'tm', + 8484 => 'z', + 8486 => 'ω', + 8488 => 'z', + 8490 => 'k', + 8491 => 'Ã¥', + 8492 => 'b', + 8493 => 'c', + 8495 => 'e', + 8496 => 'e', + 8497 => 'f', + 8499 => 'm', + 8500 => 'o', + 8501 => '×', + 8502 => 'ב', + 8503 => '×’', + 8504 => 'ד', + 8505 => 'i', + 8507 => 'fax', + 8508 => 'Ï€', + 8509 => 'γ', + 8510 => 'γ', + 8511 => 'Ï€', + 8512 => '∑', + 8517 => 'd', + 8518 => 'd', + 8519 => 'e', + 8520 => 'i', + 8521 => 'j', + 8528 => '1â„7', + 8529 => '1â„9', + 8530 => '1â„10', + 8531 => '1â„3', + 8532 => '2â„3', + 8533 => '1â„5', + 8534 => '2â„5', + 8535 => '3â„5', + 8536 => '4â„5', + 8537 => '1â„6', + 8538 => '5â„6', + 8539 => '1â„8', + 8540 => '3â„8', + 8541 => '5â„8', + 8542 => '7â„8', + 8543 => '1â„', + 8544 => 'i', + 8545 => 'ii', + 8546 => 'iii', + 8547 => 'iv', + 8548 => 'v', + 8549 => 'vi', + 8550 => 'vii', + 8551 => 'viii', + 8552 => 'ix', + 8553 => 'x', + 8554 => 'xi', + 8555 => 'xii', + 8556 => 'l', + 8557 => 'c', + 8558 => 'd', + 8559 => 'm', + 8560 => 'i', + 8561 => 'ii', + 8562 => 'iii', + 8563 => 'iv', + 8564 => 'v', + 8565 => 'vi', + 8566 => 'vii', + 8567 => 'viii', + 8568 => 'ix', + 8569 => 'x', + 8570 => 'xi', + 8571 => 'xii', + 8572 => 'l', + 8573 => 'c', + 8574 => 'd', + 8575 => 'm', + 8585 => '0â„3', + 8748 => '∫∫', + 8749 => '∫∫∫', + 8751 => '∮∮', + 8752 => '∮∮∮', + 9001 => '〈', + 9002 => '〉', + 9312 => '1', + 9313 => '2', + 9314 => '3', + 9315 => '4', + 9316 => '5', + 9317 => '6', + 9318 => '7', + 9319 => '8', + 9320 => '9', + 9321 => '10', + 9322 => '11', + 9323 => '12', + 9324 => '13', + 9325 => '14', + 9326 => '15', + 9327 => '16', + 9328 => '17', + 9329 => '18', + 9330 => '19', + 9331 => '20', + 9398 => 'a', + 9399 => 'b', + 9400 => 'c', + 9401 => 'd', + 9402 => 'e', + 9403 => 'f', + 9404 => 'g', + 9405 => 'h', + 9406 => 'i', + 9407 => 'j', + 9408 => 'k', + 9409 => 'l', + 9410 => 'm', + 9411 => 'n', + 9412 => 'o', + 9413 => 'p', + 9414 => 'q', + 9415 => 'r', + 9416 => 's', + 9417 => 't', + 9418 => 'u', + 9419 => 'v', + 9420 => 'w', + 9421 => 'x', + 9422 => 'y', + 9423 => 'z', + 9424 => 'a', + 9425 => 'b', + 9426 => 'c', + 9427 => 'd', + 9428 => 'e', + 9429 => 'f', + 9430 => 'g', + 9431 => 'h', + 9432 => 'i', + 9433 => 'j', + 9434 => 'k', + 9435 => 'l', + 9436 => 'm', + 9437 => 'n', + 9438 => 'o', + 9439 => 'p', + 9440 => 'q', + 9441 => 'r', + 9442 => 's', + 9443 => 't', + 9444 => 'u', + 9445 => 'v', + 9446 => 'w', + 9447 => 'x', + 9448 => 'y', + 9449 => 'z', + 9450 => '0', + 10764 => '∫∫∫∫', + 10972 => 'â«Ì¸', + 11264 => 'â°°', + 11265 => 'â°±', + 11266 => 'â°²', + 11267 => 'â°³', + 11268 => 'â°´', + 11269 => 'â°µ', + 11270 => 'â°¶', + 11271 => 'â°·', + 11272 => 'â°¸', + 11273 => 'â°¹', + 11274 => 'â°º', + 11275 => 'â°»', + 11276 => 'â°¼', + 11277 => 'â°½', + 11278 => 'â°¾', + 11279 => 'â°¿', + 11280 => 'â±€', + 11281 => 'â±', + 11282 => 'ⱂ', + 11283 => 'ⱃ', + 11284 => 'ⱄ', + 11285 => 'â±…', + 11286 => 'ⱆ', + 11287 => 'ⱇ', + 11288 => 'ⱈ', + 11289 => 'ⱉ', + 11290 => 'ⱊ', + 11291 => 'ⱋ', + 11292 => 'ⱌ', + 11293 => 'â±', + 11294 => 'ⱎ', + 11295 => 'â±', + 11296 => 'â±', + 11297 => 'ⱑ', + 11298 => 'â±’', + 11299 => 'ⱓ', + 11300 => 'â±”', + 11301 => 'ⱕ', + 11302 => 'â±–', + 11303 => 'â±—', + 11304 => 'ⱘ', + 11305 => 'â±™', + 11306 => 'ⱚ', + 11307 => 'â±›', + 11308 => 'ⱜ', + 11309 => 'â±', + 11310 => 'ⱞ', + 11360 => 'ⱡ', + 11362 => 'É«', + 11363 => 'áµ½', + 11364 => 'ɽ', + 11367 => 'ⱨ', + 11369 => 'ⱪ', + 11371 => 'ⱬ', + 11373 => 'É‘', + 11374 => 'ɱ', + 11375 => 'É', + 11376 => 'É’', + 11378 => 'â±³', + 11381 => 'â±¶', + 11388 => 'j', + 11389 => 'v', + 11390 => 'È¿', + 11391 => 'É€', + 11392 => 'â²', + 11394 => 'ⲃ', + 11396 => 'â²…', + 11398 => 'ⲇ', + 11400 => 'ⲉ', + 11402 => 'ⲋ', + 11404 => 'â²', + 11406 => 'â²', + 11408 => 'ⲑ', + 11410 => 'ⲓ', + 11412 => 'ⲕ', + 11414 => 'â²—', + 11416 => 'â²™', + 11418 => 'â²›', + 11420 => 'â²', + 11422 => 'ⲟ', + 11424 => 'ⲡ', + 11426 => 'â²£', + 11428 => 'â²¥', + 11430 => 'â²§', + 11432 => 'ⲩ', + 11434 => 'ⲫ', + 11436 => 'â²­', + 11438 => 'ⲯ', + 11440 => 'â²±', + 11442 => 'â²³', + 11444 => 'â²µ', + 11446 => 'â²·', + 11448 => 'â²¹', + 11450 => 'â²»', + 11452 => 'â²½', + 11454 => 'ⲿ', + 11456 => 'â³', + 11458 => 'ⳃ', + 11460 => 'â³…', + 11462 => 'ⳇ', + 11464 => 'ⳉ', + 11466 => 'ⳋ', + 11468 => 'â³', + 11470 => 'â³', + 11472 => 'ⳑ', + 11474 => 'ⳓ', + 11476 => 'ⳕ', + 11478 => 'â³—', + 11480 => 'â³™', + 11482 => 'â³›', + 11484 => 'â³', + 11486 => 'ⳟ', + 11488 => 'ⳡ', + 11490 => 'â³£', + 11499 => 'ⳬ', + 11501 => 'â³®', + 11506 => 'â³³', + 11631 => 'ⵡ', + 11935 => 'æ¯', + 12019 => '龟', + 12032 => '一', + 12033 => '丨', + 12034 => '丶', + 12035 => '丿', + 12036 => 'ä¹™', + 12037 => '亅', + 12038 => '二', + 12039 => '亠', + 12040 => '人', + 12041 => 'å„¿', + 12042 => 'å…¥', + 12043 => 'å…«', + 12044 => '冂', + 12045 => '冖', + 12046 => '冫', + 12047 => '几', + 12048 => '凵', + 12049 => '刀', + 12050 => '力', + 12051 => '勹', + 12052 => '匕', + 12053 => '匚', + 12054 => '匸', + 12055 => 'å', + 12056 => 'åœ', + 12057 => 'å©', + 12058 => '厂', + 12059 => '厶', + 12060 => 'åˆ', + 12061 => 'å£', + 12062 => 'å›—', + 12063 => '土', + 12064 => '士', + 12065 => '夂', + 12066 => '夊', + 12067 => '夕', + 12068 => '大', + 12069 => '女', + 12070 => 'å­', + 12071 => '宀', + 12072 => '寸', + 12073 => 'å°', + 12074 => 'å°¢', + 12075 => 'å°¸', + 12076 => 'å±®', + 12077 => 'å±±', + 12078 => 'å·›', + 12079 => 'å·¥', + 12080 => 'å·±', + 12081 => 'å·¾', + 12082 => 'å¹²', + 12083 => '幺', + 12084 => '广', + 12085 => 'å»´', + 12086 => '廾', + 12087 => '弋', + 12088 => '弓', + 12089 => 'å½', + 12090 => '彡', + 12091 => 'å½³', + 12092 => '心', + 12093 => '戈', + 12094 => '戶', + 12095 => '手', + 12096 => '支', + 12097 => 'æ”´', + 12098 => 'æ–‡', + 12099 => 'æ–—', + 12100 => 'æ–¤', + 12101 => 'æ–¹', + 12102 => 'æ— ', + 12103 => 'æ—¥', + 12104 => 'æ›°', + 12105 => '月', + 12106 => '木', + 12107 => '欠', + 12108 => 'æ­¢', + 12109 => 'æ­¹', + 12110 => '殳', + 12111 => '毋', + 12112 => '比', + 12113 => '毛', + 12114 => 'æ°', + 12115 => 'æ°”', + 12116 => 'æ°´', + 12117 => 'ç«', + 12118 => '爪', + 12119 => '父', + 12120 => '爻', + 12121 => '爿', + 12122 => '片', + 12123 => '牙', + 12124 => '牛', + 12125 => '犬', + 12126 => '玄', + 12127 => '玉', + 12128 => '瓜', + 12129 => '瓦', + 12130 => '甘', + 12131 => '生', + 12132 => '用', + 12133 => 'ç”°', + 12134 => 'ç–‹', + 12135 => 'ç–’', + 12136 => 'ç™¶', + 12137 => '白', + 12138 => 'çš®', + 12139 => 'çš¿', + 12140 => 'ç›®', + 12141 => '矛', + 12142 => '矢', + 12143 => '石', + 12144 => '示', + 12145 => '禸', + 12146 => '禾', + 12147 => 'ç©´', + 12148 => 'ç«‹', + 12149 => '竹', + 12150 => 'ç±³', + 12151 => '糸', + 12152 => 'ç¼¶', + 12153 => '网', + 12154 => '羊', + 12155 => 'ç¾½', + 12156 => 'è€', + 12157 => '而', + 12158 => '耒', + 12159 => '耳', + 12160 => 'è¿', + 12161 => '肉', + 12162 => '臣', + 12163 => '自', + 12164 => '至', + 12165 => '臼', + 12166 => '舌', + 12167 => '舛', + 12168 => '舟', + 12169 => '艮', + 12170 => '色', + 12171 => '艸', + 12172 => 'è™', + 12173 => '虫', + 12174 => 'è¡€', + 12175 => '行', + 12176 => 'è¡£', + 12177 => '襾', + 12178 => '見', + 12179 => 'è§’', + 12180 => '言', + 12181 => 'è°·', + 12182 => '豆', + 12183 => '豕', + 12184 => '豸', + 12185 => 'è²', + 12186 => '赤', + 12187 => 'èµ°', + 12188 => 'è¶³', + 12189 => '身', + 12190 => '車', + 12191 => 'è¾›', + 12192 => 'è¾°', + 12193 => 'è¾µ', + 12194 => 'é‚‘', + 12195 => 'é…‰', + 12196 => '釆', + 12197 => '里', + 12198 => '金', + 12199 => 'é•·', + 12200 => 'é–€', + 12201 => '阜', + 12202 => 'éš¶', + 12203 => 'éš¹', + 12204 => '雨', + 12205 => 'é‘', + 12206 => 'éž', + 12207 => 'é¢', + 12208 => 'é©', + 12209 => '韋', + 12210 => '韭', + 12211 => '音', + 12212 => 'é ', + 12213 => '風', + 12214 => '飛', + 12215 => '食', + 12216 => '首', + 12217 => '香', + 12218 => '馬', + 12219 => '骨', + 12220 => '高', + 12221 => '髟', + 12222 => '鬥', + 12223 => '鬯', + 12224 => '鬲', + 12225 => '鬼', + 12226 => 'é­š', + 12227 => 'é³¥', + 12228 => 'é¹µ', + 12229 => '鹿', + 12230 => '麥', + 12231 => '麻', + 12232 => '黃', + 12233 => 'é»', + 12234 => '黑', + 12235 => '黹', + 12236 => '黽', + 12237 => '鼎', + 12238 => '鼓', + 12239 => 'é¼ ', + 12240 => 'é¼»', + 12241 => '齊', + 12242 => 'é½’', + 12243 => 'é¾', + 12244 => '龜', + 12245 => 'é¾ ', + 12290 => '.', + 12342 => '〒', + 12344 => 'å', + 12345 => 'å„', + 12346 => 'å…', + 12447 => 'より', + 12543 => 'コト', + 12593 => 'á„€', + 12594 => 'á„', + 12595 => 'ᆪ', + 12596 => 'á„‚', + 12597 => 'ᆬ', + 12598 => 'ᆭ', + 12599 => 'ᄃ', + 12600 => 'á„„', + 12601 => 'á„…', + 12602 => 'ᆰ', + 12603 => 'ᆱ', + 12604 => 'ᆲ', + 12605 => 'ᆳ', + 12606 => 'ᆴ', + 12607 => 'ᆵ', + 12608 => 'ᄚ', + 12609 => 'ᄆ', + 12610 => 'ᄇ', + 12611 => 'ᄈ', + 12612 => 'á„¡', + 12613 => 'ᄉ', + 12614 => 'ᄊ', + 12615 => 'á„‹', + 12616 => 'ᄌ', + 12617 => 'á„', + 12618 => 'ᄎ', + 12619 => 'á„', + 12620 => 'á„', + 12621 => 'á„‘', + 12622 => 'á„’', + 12623 => 'á…¡', + 12624 => 'á…¢', + 12625 => 'á…£', + 12626 => 'á…¤', + 12627 => 'á…¥', + 12628 => 'á…¦', + 12629 => 'á…§', + 12630 => 'á…¨', + 12631 => 'á…©', + 12632 => 'á…ª', + 12633 => 'á…«', + 12634 => 'á…¬', + 12635 => 'á…­', + 12636 => 'á…®', + 12637 => 'á…¯', + 12638 => 'á…°', + 12639 => 'á…±', + 12640 => 'á…²', + 12641 => 'á…³', + 12642 => 'á…´', + 12643 => 'á…µ', + 12645 => 'á„”', + 12646 => 'á„•', + 12647 => 'ᇇ', + 12648 => 'ᇈ', + 12649 => 'ᇌ', + 12650 => 'ᇎ', + 12651 => 'ᇓ', + 12652 => 'ᇗ', + 12653 => 'ᇙ', + 12654 => 'ᄜ', + 12655 => 'á‡', + 12656 => 'ᇟ', + 12657 => 'á„', + 12658 => 'ᄞ', + 12659 => 'á„ ', + 12660 => 'á„¢', + 12661 => 'á„£', + 12662 => 'á„§', + 12663 => 'á„©', + 12664 => 'á„«', + 12665 => 'ᄬ', + 12666 => 'á„­', + 12667 => 'á„®', + 12668 => 'ᄯ', + 12669 => 'ᄲ', + 12670 => 'á„¶', + 12671 => 'á…€', + 12672 => 'á…‡', + 12673 => 'á…Œ', + 12674 => 'ᇱ', + 12675 => 'ᇲ', + 12676 => 'á…—', + 12677 => 'á…˜', + 12678 => 'á…™', + 12679 => 'ᆄ', + 12680 => 'ᆅ', + 12681 => 'ᆈ', + 12682 => 'ᆑ', + 12683 => 'ᆒ', + 12684 => 'ᆔ', + 12685 => 'ᆞ', + 12686 => 'ᆡ', + 12690 => '一', + 12691 => '二', + 12692 => '三', + 12693 => 'å››', + 12694 => '上', + 12695 => '中', + 12696 => '下', + 12697 => '甲', + 12698 => 'ä¹™', + 12699 => '丙', + 12700 => 'ä¸', + 12701 => '天', + 12702 => '地', + 12703 => '人', + 12868 => 'å•', + 12869 => 'å¹¼', + 12870 => 'æ–‡', + 12871 => 'ç®', + 12880 => 'pte', + 12881 => '21', + 12882 => '22', + 12883 => '23', + 12884 => '24', + 12885 => '25', + 12886 => '26', + 12887 => '27', + 12888 => '28', + 12889 => '29', + 12890 => '30', + 12891 => '31', + 12892 => '32', + 12893 => '33', + 12894 => '34', + 12895 => '35', + 12896 => 'á„€', + 12897 => 'á„‚', + 12898 => 'ᄃ', + 12899 => 'á„…', + 12900 => 'ᄆ', + 12901 => 'ᄇ', + 12902 => 'ᄉ', + 12903 => 'á„‹', + 12904 => 'ᄌ', + 12905 => 'ᄎ', + 12906 => 'á„', + 12907 => 'á„', + 12908 => 'á„‘', + 12909 => 'á„’', + 12910 => 'ê°€', + 12911 => '나', + 12912 => '다', + 12913 => 'ë¼', + 12914 => '마', + 12915 => 'ë°”', + 12916 => '사', + 12917 => 'ì•„', + 12918 => 'ìž', + 12919 => 'ì°¨', + 12920 => 'ì¹´', + 12921 => '타', + 12922 => '파', + 12923 => '하', + 12924 => '참고', + 12925 => '주ì˜', + 12926 => 'ìš°', + 12928 => '一', + 12929 => '二', + 12930 => '三', + 12931 => 'å››', + 12932 => '五', + 12933 => 'å…­', + 12934 => '七', + 12935 => 'å…«', + 12936 => 'ä¹', + 12937 => 'å', + 12938 => '月', + 12939 => 'ç«', + 12940 => 'æ°´', + 12941 => '木', + 12942 => '金', + 12943 => '土', + 12944 => 'æ—¥', + 12945 => 'æ ª', + 12946 => '有', + 12947 => '社', + 12948 => 'å', + 12949 => '特', + 12950 => '財', + 12951 => 'ç¥', + 12952 => '労', + 12953 => '秘', + 12954 => 'ç”·', + 12955 => '女', + 12956 => 'é©', + 12957 => '優', + 12958 => 'å°', + 12959 => '注', + 12960 => 'é …', + 12961 => '休', + 12962 => '写', + 12963 => 'æ­£', + 12964 => '上', + 12965 => '中', + 12966 => '下', + 12967 => 'å·¦', + 12968 => 'å³', + 12969 => '医', + 12970 => 'å®—', + 12971 => 'å­¦', + 12972 => '監', + 12973 => 'ä¼', + 12974 => '資', + 12975 => 'å”', + 12976 => '夜', + 12977 => '36', + 12978 => '37', + 12979 => '38', + 12980 => '39', + 12981 => '40', + 12982 => '41', + 12983 => '42', + 12984 => '43', + 12985 => '44', + 12986 => '45', + 12987 => '46', + 12988 => '47', + 12989 => '48', + 12990 => '49', + 12991 => '50', + 12992 => '1月', + 12993 => '2月', + 12994 => '3月', + 12995 => '4月', + 12996 => '5月', + 12997 => '6月', + 12998 => '7月', + 12999 => '8月', + 13000 => '9月', + 13001 => '10月', + 13002 => '11月', + 13003 => '12月', + 13004 => 'hg', + 13005 => 'erg', + 13006 => 'ev', + 13007 => 'ltd', + 13008 => 'ã‚¢', + 13009 => 'イ', + 13010 => 'ウ', + 13011 => 'エ', + 13012 => 'オ', + 13013 => 'ã‚«', + 13014 => 'ã‚­', + 13015 => 'ク', + 13016 => 'ケ', + 13017 => 'コ', + 13018 => 'サ', + 13019 => 'ã‚·', + 13020 => 'ス', + 13021 => 'ã‚»', + 13022 => 'ソ', + 13023 => 'ã‚¿', + 13024 => 'ãƒ', + 13025 => 'ツ', + 13026 => 'テ', + 13027 => 'ト', + 13028 => 'ナ', + 13029 => 'ニ', + 13030 => 'ヌ', + 13031 => 'ãƒ', + 13032 => 'ノ', + 13033 => 'ãƒ', + 13034 => 'ヒ', + 13035 => 'フ', + 13036 => 'ヘ', + 13037 => 'ホ', + 13038 => 'マ', + 13039 => 'ミ', + 13040 => 'ム', + 13041 => 'メ', + 13042 => 'モ', + 13043 => 'ヤ', + 13044 => 'ユ', + 13045 => 'ヨ', + 13046 => 'ラ', + 13047 => 'リ', + 13048 => 'ル', + 13049 => 'レ', + 13050 => 'ロ', + 13051 => 'ワ', + 13052 => 'ヰ', + 13053 => 'ヱ', + 13054 => 'ヲ', + 13055 => '令和', + 13056 => 'アパート', + 13057 => 'アルファ', + 13058 => 'アンペア', + 13059 => 'アール', + 13060 => 'イニング', + 13061 => 'インãƒ', + 13062 => 'ウォン', + 13063 => 'エスクード', + 13064 => 'エーカー', + 13065 => 'オンス', + 13066 => 'オーム', + 13067 => 'カイリ', + 13068 => 'カラット', + 13069 => 'カロリー', + 13070 => 'ガロン', + 13071 => 'ガンマ', + 13072 => 'ギガ', + 13073 => 'ギニー', + 13074 => 'キュリー', + 13075 => 'ギルダー', + 13076 => 'キロ', + 13077 => 'キログラム', + 13078 => 'キロメートル', + 13079 => 'キロワット', + 13080 => 'グラム', + 13081 => 'グラムトン', + 13082 => 'クルゼイロ', + 13083 => 'クローãƒ', + 13084 => 'ケース', + 13085 => 'コルナ', + 13086 => 'コーãƒ', + 13087 => 'サイクル', + 13088 => 'サンãƒãƒ¼ãƒ ', + 13089 => 'シリング', + 13090 => 'センãƒ', + 13091 => 'セント', + 13092 => 'ダース', + 13093 => 'デシ', + 13094 => 'ドル', + 13095 => 'トン', + 13096 => 'ナノ', + 13097 => 'ノット', + 13098 => 'ãƒã‚¤ãƒ„', + 13099 => 'パーセント', + 13100 => 'パーツ', + 13101 => 'ãƒãƒ¼ãƒ¬ãƒ«', + 13102 => 'ピアストル', + 13103 => 'ピクル', + 13104 => 'ピコ', + 13105 => 'ビル', + 13106 => 'ファラッド', + 13107 => 'フィート', + 13108 => 'ブッシェル', + 13109 => 'フラン', + 13110 => 'ヘクタール', + 13111 => 'ペソ', + 13112 => 'ペニヒ', + 13113 => 'ヘルツ', + 13114 => 'ペンス', + 13115 => 'ページ', + 13116 => 'ベータ', + 13117 => 'ãƒã‚¤ãƒ³ãƒˆ', + 13118 => 'ボルト', + 13119 => 'ホン', + 13120 => 'ãƒãƒ³ãƒ‰', + 13121 => 'ホール', + 13122 => 'ホーン', + 13123 => 'マイクロ', + 13124 => 'マイル', + 13125 => 'マッãƒ', + 13126 => 'マルク', + 13127 => 'マンション', + 13128 => 'ミクロン', + 13129 => 'ミリ', + 13130 => 'ミリãƒãƒ¼ãƒ«', + 13131 => 'メガ', + 13132 => 'メガトン', + 13133 => 'メートル', + 13134 => 'ヤード', + 13135 => 'ヤール', + 13136 => 'ユアン', + 13137 => 'リットル', + 13138 => 'リラ', + 13139 => 'ルピー', + 13140 => 'ルーブル', + 13141 => 'レム', + 13142 => 'レントゲン', + 13143 => 'ワット', + 13144 => '0点', + 13145 => '1点', + 13146 => '2点', + 13147 => '3点', + 13148 => '4点', + 13149 => '5点', + 13150 => '6点', + 13151 => '7点', + 13152 => '8点', + 13153 => '9点', + 13154 => '10点', + 13155 => '11点', + 13156 => '12点', + 13157 => '13点', + 13158 => '14点', + 13159 => '15点', + 13160 => '16点', + 13161 => '17点', + 13162 => '18点', + 13163 => '19点', + 13164 => '20点', + 13165 => '21点', + 13166 => '22点', + 13167 => '23点', + 13168 => '24点', + 13169 => 'hpa', + 13170 => 'da', + 13171 => 'au', + 13172 => 'bar', + 13173 => 'ov', + 13174 => 'pc', + 13175 => 'dm', + 13176 => 'dm2', + 13177 => 'dm3', + 13178 => 'iu', + 13179 => 'å¹³æˆ', + 13180 => '昭和', + 13181 => '大正', + 13182 => '明治', + 13183 => 'æ ªå¼ä¼šç¤¾', + 13184 => 'pa', + 13185 => 'na', + 13186 => 'μa', + 13187 => 'ma', + 13188 => 'ka', + 13189 => 'kb', + 13190 => 'mb', + 13191 => 'gb', + 13192 => 'cal', + 13193 => 'kcal', + 13194 => 'pf', + 13195 => 'nf', + 13196 => 'μf', + 13197 => 'μg', + 13198 => 'mg', + 13199 => 'kg', + 13200 => 'hz', + 13201 => 'khz', + 13202 => 'mhz', + 13203 => 'ghz', + 13204 => 'thz', + 13205 => 'μl', + 13206 => 'ml', + 13207 => 'dl', + 13208 => 'kl', + 13209 => 'fm', + 13210 => 'nm', + 13211 => 'μm', + 13212 => 'mm', + 13213 => 'cm', + 13214 => 'km', + 13215 => 'mm2', + 13216 => 'cm2', + 13217 => 'm2', + 13218 => 'km2', + 13219 => 'mm3', + 13220 => 'cm3', + 13221 => 'm3', + 13222 => 'km3', + 13223 => 'm∕s', + 13224 => 'm∕s2', + 13225 => 'pa', + 13226 => 'kpa', + 13227 => 'mpa', + 13228 => 'gpa', + 13229 => 'rad', + 13230 => 'rad∕s', + 13231 => 'rad∕s2', + 13232 => 'ps', + 13233 => 'ns', + 13234 => 'μs', + 13235 => 'ms', + 13236 => 'pv', + 13237 => 'nv', + 13238 => 'μv', + 13239 => 'mv', + 13240 => 'kv', + 13241 => 'mv', + 13242 => 'pw', + 13243 => 'nw', + 13244 => 'μw', + 13245 => 'mw', + 13246 => 'kw', + 13247 => 'mw', + 13248 => 'kω', + 13249 => 'mω', + 13251 => 'bq', + 13252 => 'cc', + 13253 => 'cd', + 13254 => 'c∕kg', + 13256 => 'db', + 13257 => 'gy', + 13258 => 'ha', + 13259 => 'hp', + 13260 => 'in', + 13261 => 'kk', + 13262 => 'km', + 13263 => 'kt', + 13264 => 'lm', + 13265 => 'ln', + 13266 => 'log', + 13267 => 'lx', + 13268 => 'mb', + 13269 => 'mil', + 13270 => 'mol', + 13271 => 'ph', + 13273 => 'ppm', + 13274 => 'pr', + 13275 => 'sr', + 13276 => 'sv', + 13277 => 'wb', + 13278 => 'v∕m', + 13279 => 'a∕m', + 13280 => '1æ—¥', + 13281 => '2æ—¥', + 13282 => '3æ—¥', + 13283 => '4æ—¥', + 13284 => '5æ—¥', + 13285 => '6æ—¥', + 13286 => '7æ—¥', + 13287 => '8æ—¥', + 13288 => '9æ—¥', + 13289 => '10æ—¥', + 13290 => '11æ—¥', + 13291 => '12æ—¥', + 13292 => '13æ—¥', + 13293 => '14æ—¥', + 13294 => '15æ—¥', + 13295 => '16æ—¥', + 13296 => '17æ—¥', + 13297 => '18æ—¥', + 13298 => '19æ—¥', + 13299 => '20æ—¥', + 13300 => '21æ—¥', + 13301 => '22æ—¥', + 13302 => '23æ—¥', + 13303 => '24æ—¥', + 13304 => '25æ—¥', + 13305 => '26æ—¥', + 13306 => '27æ—¥', + 13307 => '28æ—¥', + 13308 => '29æ—¥', + 13309 => '30æ—¥', + 13310 => '31æ—¥', + 13311 => 'gal', + 42560 => 'ê™', + 42562 => 'ꙃ', + 42564 => 'ê™…', + 42566 => 'ꙇ', + 42568 => 'ꙉ', + 42570 => 'ꙋ', + 42572 => 'ê™', + 42574 => 'ê™', + 42576 => 'ꙑ', + 42578 => 'ꙓ', + 42580 => 'ꙕ', + 42582 => 'ê™—', + 42584 => 'ê™™', + 42586 => 'ê™›', + 42588 => 'ê™', + 42590 => 'ꙟ', + 42592 => 'ꙡ', + 42594 => 'ꙣ', + 42596 => 'ꙥ', + 42598 => 'ê™§', + 42600 => 'ꙩ', + 42602 => 'ꙫ', + 42604 => 'ê™­', + 42624 => 'êš', + 42626 => 'ꚃ', + 42628 => 'êš…', + 42630 => 'ꚇ', + 42632 => 'ꚉ', + 42634 => 'êš‹', + 42636 => 'êš', + 42638 => 'êš', + 42640 => 'êš‘', + 42642 => 'êš“', + 42644 => 'êš•', + 42646 => 'êš—', + 42648 => 'êš™', + 42650 => 'êš›', + 42652 => 'ÑŠ', + 42653 => 'ÑŒ', + 42786 => 'ꜣ', + 42788 => 'ꜥ', + 42790 => 'ꜧ', + 42792 => 'ꜩ', + 42794 => 'ꜫ', + 42796 => 'ꜭ', + 42798 => 'ꜯ', + 42802 => 'ꜳ', + 42804 => 'ꜵ', + 42806 => 'ꜷ', + 42808 => 'ꜹ', + 42810 => 'ꜻ', + 42812 => 'ꜽ', + 42814 => 'ꜿ', + 42816 => 'ê', + 42818 => 'êƒ', + 42820 => 'ê…', + 42822 => 'ê‡', + 42824 => 'ê‰', + 42826 => 'ê‹', + 42828 => 'ê', + 42830 => 'ê', + 42832 => 'ê‘', + 42834 => 'ê“', + 42836 => 'ê•', + 42838 => 'ê—', + 42840 => 'ê™', + 42842 => 'ê›', + 42844 => 'ê', + 42846 => 'êŸ', + 42848 => 'ê¡', + 42850 => 'ê£', + 42852 => 'ê¥', + 42854 => 'ê§', + 42856 => 'ê©', + 42858 => 'ê«', + 42860 => 'ê­', + 42862 => 'ê¯', + 42864 => 'ê¯', + 42873 => 'êº', + 42875 => 'ê¼', + 42877 => 'áµ¹', + 42878 => 'ê¿', + 42880 => 'êž', + 42882 => 'ꞃ', + 42884 => 'êž…', + 42886 => 'ꞇ', + 42891 => 'ꞌ', + 42893 => 'É¥', + 42896 => 'êž‘', + 42898 => 'êž“', + 42902 => 'êž—', + 42904 => 'êž™', + 42906 => 'êž›', + 42908 => 'êž', + 42910 => 'ꞟ', + 42912 => 'êž¡', + 42914 => 'ꞣ', + 42916 => 'ꞥ', + 42918 => 'êž§', + 42920 => 'êž©', + 42922 => 'ɦ', + 42923 => 'Éœ', + 42924 => 'É¡', + 42925 => 'ɬ', + 42926 => 'ɪ', + 42928 => 'Êž', + 42929 => 'ʇ', + 42930 => 'Ê', + 42931 => 'ê­“', + 42932 => 'êžµ', + 42934 => 'êž·', + 42936 => 'êž¹', + 42938 => 'êž»', + 42940 => 'êž½', + 42942 => 'êž¿', + 42946 => 'ꟃ', + 42948 => 'êž”', + 42949 => 'Ê‚', + 42950 => 'á¶Ž', + 42951 => 'ꟈ', + 42953 => 'ꟊ', + 42997 => 'ꟶ', + 43000 => 'ħ', + 43001 => 'Å“', + 43868 => 'ꜧ', + 43869 => 'ꬷ', + 43870 => 'É«', + 43871 => 'ê­’', + 43881 => 'Ê', + 43888 => 'Ꭰ', + 43889 => 'Ꭱ', + 43890 => 'Ꭲ', + 43891 => 'Ꭳ', + 43892 => 'Ꭴ', + 43893 => 'Ꭵ', + 43894 => 'Ꭶ', + 43895 => 'Ꭷ', + 43896 => 'Ꭸ', + 43897 => 'Ꭹ', + 43898 => 'Ꭺ', + 43899 => 'Ꭻ', + 43900 => 'Ꭼ', + 43901 => 'Ꭽ', + 43902 => 'Ꭾ', + 43903 => 'Ꭿ', + 43904 => 'Ꮀ', + 43905 => 'Ꮁ', + 43906 => 'Ꮂ', + 43907 => 'Ꮃ', + 43908 => 'Ꮄ', + 43909 => 'Ꮅ', + 43910 => 'Ꮆ', + 43911 => 'Ꮇ', + 43912 => 'Ꮈ', + 43913 => 'Ꮉ', + 43914 => 'Ꮊ', + 43915 => 'Ꮋ', + 43916 => 'Ꮌ', + 43917 => 'Ꮍ', + 43918 => 'Ꮎ', + 43919 => 'Ꮏ', + 43920 => 'á€', + 43921 => 'á', + 43922 => 'á‚', + 43923 => 'áƒ', + 43924 => 'á„', + 43925 => 'á…', + 43926 => 'á†', + 43927 => 'á‡', + 43928 => 'áˆ', + 43929 => 'á‰', + 43930 => 'áŠ', + 43931 => 'á‹', + 43932 => 'áŒ', + 43933 => 'á', + 43934 => 'áŽ', + 43935 => 'á', + 43936 => 'á', + 43937 => 'á‘', + 43938 => 'á’', + 43939 => 'á“', + 43940 => 'á”', + 43941 => 'á•', + 43942 => 'á–', + 43943 => 'á—', + 43944 => 'á˜', + 43945 => 'á™', + 43946 => 'áš', + 43947 => 'á›', + 43948 => 'áœ', + 43949 => 'á', + 43950 => 'áž', + 43951 => 'áŸ', + 43952 => 'á ', + 43953 => 'á¡', + 43954 => 'á¢', + 43955 => 'á£', + 43956 => 'á¤', + 43957 => 'á¥', + 43958 => 'á¦', + 43959 => 'á§', + 43960 => 'á¨', + 43961 => 'á©', + 43962 => 'áª', + 43963 => 'á«', + 43964 => 'á¬', + 43965 => 'á­', + 43966 => 'á®', + 43967 => 'á¯', + 63744 => '豈', + 63745 => 'æ›´', + 63746 => '車', + 63747 => '賈', + 63748 => '滑', + 63749 => '串', + 63750 => 'å¥', + 63751 => '龜', + 63752 => '龜', + 63753 => '契', + 63754 => '金', + 63755 => 'å–‡', + 63756 => '奈', + 63757 => '懶', + 63758 => '癩', + 63759 => 'ç¾…', + 63760 => '蘿', + 63761 => '螺', + 63762 => '裸', + 63763 => 'é‚', + 63764 => '樂', + 63765 => 'æ´›', + 63766 => '烙', + 63767 => 'çž', + 63768 => 'è½', + 63769 => 'é…ª', + 63770 => 'é§±', + 63771 => '亂', + 63772 => 'åµ', + 63773 => '欄', + 63774 => '爛', + 63775 => '蘭', + 63776 => '鸞', + 63777 => 'åµ', + 63778 => 'æ¿«', + 63779 => 'è—', + 63780 => '襤', + 63781 => '拉', + 63782 => '臘', + 63783 => 'è Ÿ', + 63784 => '廊', + 63785 => '朗', + 63786 => '浪', + 63787 => '狼', + 63788 => '郎', + 63789 => '來', + 63790 => '冷', + 63791 => '勞', + 63792 => 'æ“„', + 63793 => 'æ«“', + 63794 => 'çˆ', + 63795 => 'ç›§', + 63796 => 'è€', + 63797 => '蘆', + 63798 => '虜', + 63799 => 'è·¯', + 63800 => '露', + 63801 => 'é­¯', + 63802 => 'é·º', + 63803 => '碌', + 63804 => '祿', + 63805 => 'ç¶ ', + 63806 => 'è‰', + 63807 => '錄', + 63808 => '鹿', + 63809 => 'è«–', + 63810 => '壟', + 63811 => '弄', + 63812 => 'ç± ', + 63813 => 'è¾', + 63814 => '牢', + 63815 => '磊', + 63816 => '賂', + 63817 => 'é›·', + 63818 => '壘', + 63819 => 'å±¢', + 63820 => '樓', + 63821 => 'æ·š', + 63822 => 'æ¼', + 63823 => 'ç´¯', + 63824 => '縷', + 63825 => '陋', + 63826 => 'å‹’', + 63827 => 'è‚‹', + 63828 => '凜', + 63829 => '凌', + 63830 => '稜', + 63831 => 'ç¶¾', + 63832 => 'è±', + 63833 => '陵', + 63834 => '讀', + 63835 => 'æ‹', + 63836 => '樂', + 63837 => '諾', + 63838 => '丹', + 63839 => '寧', + 63840 => '怒', + 63841 => '率', + 63842 => 'ç•°', + 63843 => '北', + 63844 => '磻', + 63845 => '便', + 63846 => '復', + 63847 => 'ä¸', + 63848 => '泌', + 63849 => '數', + 63850 => 'ç´¢', + 63851 => 'åƒ', + 63852 => '塞', + 63853 => 'çœ', + 63854 => '葉', + 63855 => '說', + 63856 => '殺', + 63857 => 'è¾°', + 63858 => '沈', + 63859 => '拾', + 63860 => 'è‹¥', + 63861 => '掠', + 63862 => 'ç•¥', + 63863 => '亮', + 63864 => 'å…©', + 63865 => '凉', + 63866 => 'æ¢', + 63867 => 'ç³§', + 63868 => '良', + 63869 => 'è«’', + 63870 => 'é‡', + 63871 => '勵', + 63872 => 'å‘‚', + 63873 => '女', + 63874 => '廬', + 63875 => 'æ—…', + 63876 => '濾', + 63877 => '礪', + 63878 => 'é–­', + 63879 => '驪', + 63880 => '麗', + 63881 => '黎', + 63882 => '力', + 63883 => '曆', + 63884 => 'æ­·', + 63885 => 'è½¢', + 63886 => 'å¹´', + 63887 => 'æ†', + 63888 => '戀', + 63889 => 'æ’š', + 63890 => 'æ¼£', + 63891 => 'ç…‰', + 63892 => 'ç’‰', + 63893 => 'ç§Š', + 63894 => 'ç·´', + 63895 => 'è¯', + 63896 => '輦', + 63897 => 'è“®', + 63898 => '連', + 63899 => 'éŠ', + 63900 => '列', + 63901 => '劣', + 63902 => 'å’½', + 63903 => '烈', + 63904 => '裂', + 63905 => '說', + 63906 => '廉', + 63907 => '念', + 63908 => 'æ»', + 63909 => 'æ®®', + 63910 => 'ç°¾', + 63911 => 'çµ', + 63912 => '令', + 63913 => '囹', + 63914 => '寧', + 63915 => '嶺', + 63916 => '怜', + 63917 => '玲', + 63918 => 'ç‘©', + 63919 => '羚', + 63920 => 'è†', + 63921 => '鈴', + 63922 => 'é›¶', + 63923 => 'éˆ', + 63924 => 'é ˜', + 63925 => '例', + 63926 => '禮', + 63927 => '醴', + 63928 => '隸', + 63929 => '惡', + 63930 => '了', + 63931 => '僚', + 63932 => '寮', + 63933 => 'å°¿', + 63934 => 'æ–™', + 63935 => '樂', + 63936 => '燎', + 63937 => '療', + 63938 => '蓼', + 63939 => 'é¼', + 63940 => 'é¾', + 63941 => '暈', + 63942 => '阮', + 63943 => '劉', + 63944 => 'æ»', + 63945 => '柳', + 63946 => 'æµ', + 63947 => '溜', + 63948 => 'ç‰', + 63949 => 'ç•™', + 63950 => 'ç¡«', + 63951 => 'ç´', + 63952 => '類', + 63953 => 'å…­', + 63954 => '戮', + 63955 => '陸', + 63956 => '倫', + 63957 => 'å´™', + 63958 => 'æ·ª', + 63959 => '輪', + 63960 => '律', + 63961 => 'æ…„', + 63962 => 'æ —', + 63963 => '率', + 63964 => '隆', + 63965 => '利', + 63966 => 'å', + 63967 => 'å±¥', + 63968 => '易', + 63969 => 'æŽ', + 63970 => '梨', + 63971 => 'æ³¥', + 63972 => 'ç†', + 63973 => 'ç—¢', + 63974 => 'ç½¹', + 63975 => 'è£', + 63976 => '裡', + 63977 => '里', + 63978 => '離', + 63979 => '匿', + 63980 => '溺', + 63981 => 'å', + 63982 => 'ç‡', + 63983 => 'ç’˜', + 63984 => 'è—º', + 63985 => '隣', + 63986 => 'é±—', + 63987 => '麟', + 63988 => 'æž—', + 63989 => 'æ·‹', + 63990 => '臨', + 63991 => 'ç«‹', + 63992 => '笠', + 63993 => 'ç²’', + 63994 => 'ç‹€', + 63995 => 'ç‚™', + 63996 => 'è­˜', + 63997 => '什', + 63998 => '茶', + 63999 => '刺', + 64000 => '切', + 64001 => '度', + 64002 => 'æ‹“', + 64003 => 'ç³–', + 64004 => 'å®…', + 64005 => 'æ´ž', + 64006 => 'æš´', + 64007 => 'è¼»', + 64008 => '行', + 64009 => 'é™', + 64010 => '見', + 64011 => '廓', + 64012 => 'å…€', + 64013 => 'å—€', + 64016 => '塚', + 64018 => 'æ™´', + 64021 => '凞', + 64022 => '猪', + 64023 => '益', + 64024 => '礼', + 64025 => '神', + 64026 => '祥', + 64027 => 'ç¦', + 64028 => 'é–', + 64029 => 'ç²¾', + 64030 => 'ç¾½', + 64032 => '蘒', + 64034 => '諸', + 64037 => '逸', + 64038 => '都', + 64042 => '飯', + 64043 => '飼', + 64044 => '館', + 64045 => 'é¶´', + 64046 => '郞', + 64047 => 'éš·', + 64048 => 'ä¾®', + 64049 => '僧', + 64050 => 'å…', + 64051 => '勉', + 64052 => '勤', + 64053 => 'å‘', + 64054 => 'å–', + 64055 => '嘆', + 64056 => '器', + 64057 => 'å¡€', + 64058 => '墨', + 64059 => '層', + 64060 => 'å±®', + 64061 => 'æ‚”', + 64062 => 'æ…¨', + 64063 => '憎', + 64064 => '懲', + 64065 => 'æ•', + 64066 => 'æ—¢', + 64067 => 'æš‘', + 64068 => '梅', + 64069 => 'æµ·', + 64070 => '渚', + 64071 => 'æ¼¢', + 64072 => 'ç…®', + 64073 => '爫', + 64074 => 'ç¢', + 64075 => '碑', + 64076 => '社', + 64077 => '祉', + 64078 => '祈', + 64079 => 'ç¥', + 64080 => '祖', + 64081 => 'ç¥', + 64082 => 'ç¦', + 64083 => '禎', + 64084 => 'ç©€', + 64085 => 'çª', + 64086 => '節', + 64087 => 'ç·´', + 64088 => '縉', + 64089 => 'ç¹', + 64090 => 'ç½²', + 64091 => '者', + 64092 => '臭', + 64093 => '艹', + 64094 => '艹', + 64095 => 'è‘—', + 64096 => 'è¤', + 64097 => '視', + 64098 => 'è¬', + 64099 => '謹', + 64100 => '賓', + 64101 => 'è´ˆ', + 64102 => 'è¾¶', + 64103 => '逸', + 64104 => '難', + 64105 => '響', + 64106 => 'é »', + 64107 => 'æµ', + 64108 => '𤋮', + 64109 => '舘', + 64112 => '並', + 64113 => '况', + 64114 => 'å…¨', + 64115 => 'ä¾€', + 64116 => 'å……', + 64117 => '冀', + 64118 => '勇', + 64119 => '勺', + 64120 => 'å–', + 64121 => 'å••', + 64122 => 'å–™', + 64123 => 'å—¢', + 64124 => '塚', + 64125 => '墳', + 64126 => '奄', + 64127 => '奔', + 64128 => 'å©¢', + 64129 => '嬨', + 64130 => 'å»’', + 64131 => 'å»™', + 64132 => '彩', + 64133 => 'å¾­', + 64134 => '惘', + 64135 => 'æ…Ž', + 64136 => '愈', + 64137 => '憎', + 64138 => 'æ… ', + 64139 => '懲', + 64140 => '戴', + 64141 => 'æ„', + 64142 => 'æœ', + 64143 => 'æ‘’', + 64144 => 'æ•–', + 64145 => 'æ™´', + 64146 => '朗', + 64147 => '望', + 64148 => 'æ–', + 64149 => 'æ­¹', + 64150 => '殺', + 64151 => 'æµ', + 64152 => 'æ»›', + 64153 => '滋', + 64154 => 'æ¼¢', + 64155 => '瀞', + 64156 => 'ç…®', + 64157 => 'çž§', + 64158 => '爵', + 64159 => '犯', + 64160 => '猪', + 64161 => '瑱', + 64162 => '甆', + 64163 => 'ç”»', + 64164 => 'ç˜', + 64165 => '瘟', + 64166 => '益', + 64167 => 'ç››', + 64168 => 'ç›´', + 64169 => 'çŠ', + 64170 => 'ç€', + 64171 => '磌', + 64172 => '窱', + 64173 => '節', + 64174 => 'ç±»', + 64175 => 'çµ›', + 64176 => 'ç·´', + 64177 => 'ç¼¾', + 64178 => '者', + 64179 => 'è’', + 64180 => 'è¯', + 64181 => 'è¹', + 64182 => 'è¥', + 64183 => '覆', + 64184 => '視', + 64185 => '調', + 64186 => '諸', + 64187 => 'è«‹', + 64188 => 'è¬', + 64189 => '諾', + 64190 => 'è«­', + 64191 => '謹', + 64192 => '變', + 64193 => 'è´ˆ', + 64194 => '輸', + 64195 => 'é²', + 64196 => '醙', + 64197 => '鉶', + 64198 => '陼', + 64199 => '難', + 64200 => 'é–', + 64201 => '韛', + 64202 => '響', + 64203 => 'é ‹', + 64204 => 'é »', + 64205 => '鬒', + 64206 => '龜', + 64207 => '𢡊', + 64208 => '𢡄', + 64209 => 'ð£•', + 64210 => 'ã®', + 64211 => '䀘', + 64212 => '䀹', + 64213 => '𥉉', + 64214 => 'ð¥³', + 64215 => '𧻓', + 64216 => '齃', + 64217 => '龎', + 64256 => 'ff', + 64257 => 'fi', + 64258 => 'fl', + 64259 => 'ffi', + 64260 => 'ffl', + 64261 => 'st', + 64262 => 'st', + 64275 => 'Õ´Õ¶', + 64276 => 'Õ´Õ¥', + 64277 => 'Õ´Õ«', + 64278 => 'Õ¾Õ¶', + 64279 => 'Õ´Õ­', + 64285 => '×™Ö´', + 64287 => 'ײַ', + 64288 => '×¢', + 64289 => '×', + 64290 => 'ד', + 64291 => '×”', + 64292 => '×›', + 64293 => 'ל', + 64294 => '×', + 64295 => 'ר', + 64296 => 'ת', + 64298 => 'ש×', + 64299 => 'שׂ', + 64300 => 'שּ×', + 64301 => 'שּׂ', + 64302 => '×Ö·', + 64303 => '×Ö¸', + 64304 => '×Ö¼', + 64305 => 'בּ', + 64306 => '×’Ö¼', + 64307 => 'דּ', + 64308 => '×”Ö¼', + 64309 => 'וּ', + 64310 => '×–Ö¼', + 64312 => 'טּ', + 64313 => '×™Ö¼', + 64314 => 'ךּ', + 64315 => '×›Ö¼', + 64316 => 'לּ', + 64318 => 'מּ', + 64320 => '× Ö¼', + 64321 => 'סּ', + 64323 => '×£Ö¼', + 64324 => 'פּ', + 64326 => 'צּ', + 64327 => '×§Ö¼', + 64328 => 'רּ', + 64329 => 'שּ', + 64330 => 'תּ', + 64331 => 'וֹ', + 64332 => 'בֿ', + 64333 => '×›Ö¿', + 64334 => 'פֿ', + 64335 => '×ל', + 64336 => 'Ù±', + 64337 => 'Ù±', + 64338 => 'Ù»', + 64339 => 'Ù»', + 64340 => 'Ù»', + 64341 => 'Ù»', + 64342 => 'Ù¾', + 64343 => 'Ù¾', + 64344 => 'Ù¾', + 64345 => 'Ù¾', + 64346 => 'Ú€', + 64347 => 'Ú€', + 64348 => 'Ú€', + 64349 => 'Ú€', + 64350 => 'Ùº', + 64351 => 'Ùº', + 64352 => 'Ùº', + 64353 => 'Ùº', + 64354 => 'Ù¿', + 64355 => 'Ù¿', + 64356 => 'Ù¿', + 64357 => 'Ù¿', + 64358 => 'Ù¹', + 64359 => 'Ù¹', + 64360 => 'Ù¹', + 64361 => 'Ù¹', + 64362 => 'Ú¤', + 64363 => 'Ú¤', + 64364 => 'Ú¤', + 64365 => 'Ú¤', + 64366 => 'Ú¦', + 64367 => 'Ú¦', + 64368 => 'Ú¦', + 64369 => 'Ú¦', + 64370 => 'Ú„', + 64371 => 'Ú„', + 64372 => 'Ú„', + 64373 => 'Ú„', + 64374 => 'Úƒ', + 64375 => 'Úƒ', + 64376 => 'Úƒ', + 64377 => 'Úƒ', + 64378 => 'Ú†', + 64379 => 'Ú†', + 64380 => 'Ú†', + 64381 => 'Ú†', + 64382 => 'Ú‡', + 64383 => 'Ú‡', + 64384 => 'Ú‡', + 64385 => 'Ú‡', + 64386 => 'Ú', + 64387 => 'Ú', + 64388 => 'ÚŒ', + 64389 => 'ÚŒ', + 64390 => 'ÚŽ', + 64391 => 'ÚŽ', + 64392 => 'Úˆ', + 64393 => 'Úˆ', + 64394 => 'Ú˜', + 64395 => 'Ú˜', + 64396 => 'Ú‘', + 64397 => 'Ú‘', + 64398 => 'Ú©', + 64399 => 'Ú©', + 64400 => 'Ú©', + 64401 => 'Ú©', + 64402 => 'Ú¯', + 64403 => 'Ú¯', + 64404 => 'Ú¯', + 64405 => 'Ú¯', + 64406 => 'Ú³', + 64407 => 'Ú³', + 64408 => 'Ú³', + 64409 => 'Ú³', + 64410 => 'Ú±', + 64411 => 'Ú±', + 64412 => 'Ú±', + 64413 => 'Ú±', + 64414 => 'Úº', + 64415 => 'Úº', + 64416 => 'Ú»', + 64417 => 'Ú»', + 64418 => 'Ú»', + 64419 => 'Ú»', + 64420 => 'Û€', + 64421 => 'Û€', + 64422 => 'Û', + 64423 => 'Û', + 64424 => 'Û', + 64425 => 'Û', + 64426 => 'Ú¾', + 64427 => 'Ú¾', + 64428 => 'Ú¾', + 64429 => 'Ú¾', + 64430 => 'Û’', + 64431 => 'Û’', + 64432 => 'Û“', + 64433 => 'Û“', + 64467 => 'Ú­', + 64468 => 'Ú­', + 64469 => 'Ú­', + 64470 => 'Ú­', + 64471 => 'Û‡', + 64472 => 'Û‡', + 64473 => 'Û†', + 64474 => 'Û†', + 64475 => 'Ûˆ', + 64476 => 'Ûˆ', + 64477 => 'Û‡Ù´', + 64478 => 'Û‹', + 64479 => 'Û‹', + 64480 => 'Û…', + 64481 => 'Û…', + 64482 => 'Û‰', + 64483 => 'Û‰', + 64484 => 'Û', + 64485 => 'Û', + 64486 => 'Û', + 64487 => 'Û', + 64488 => 'Ù‰', + 64489 => 'Ù‰', + 64490 => 'ئا', + 64491 => 'ئا', + 64492 => 'ئە', + 64493 => 'ئە', + 64494 => 'ئو', + 64495 => 'ئو', + 64496 => 'ئۇ', + 64497 => 'ئۇ', + 64498 => 'ئۆ', + 64499 => 'ئۆ', + 64500 => 'ئۈ', + 64501 => 'ئۈ', + 64502 => 'ئÛ', + 64503 => 'ئÛ', + 64504 => 'ئÛ', + 64505 => 'ئى', + 64506 => 'ئى', + 64507 => 'ئى', + 64508 => 'ÛŒ', + 64509 => 'ÛŒ', + 64510 => 'ÛŒ', + 64511 => 'ÛŒ', + 64512 => 'ئج', + 64513 => 'ئح', + 64514 => 'ئم', + 64515 => 'ئى', + 64516 => 'ئي', + 64517 => 'بج', + 64518 => 'بح', + 64519 => 'بخ', + 64520 => 'بم', + 64521 => 'بى', + 64522 => 'بي', + 64523 => 'تج', + 64524 => 'تح', + 64525 => 'تخ', + 64526 => 'تم', + 64527 => 'تى', + 64528 => 'تي', + 64529 => 'ثج', + 64530 => 'ثم', + 64531 => 'ثى', + 64532 => 'ثي', + 64533 => 'جح', + 64534 => 'جم', + 64535 => 'حج', + 64536 => 'حم', + 64537 => 'خج', + 64538 => 'خح', + 64539 => 'خم', + 64540 => 'سج', + 64541 => 'سح', + 64542 => 'سخ', + 64543 => 'سم', + 64544 => 'صح', + 64545 => 'صم', + 64546 => 'ضج', + 64547 => 'ضح', + 64548 => 'ضخ', + 64549 => 'ضم', + 64550 => 'طح', + 64551 => 'طم', + 64552 => 'ظم', + 64553 => 'عج', + 64554 => 'عم', + 64555 => 'غج', + 64556 => 'غم', + 64557 => 'ÙØ¬', + 64558 => 'ÙØ­', + 64559 => 'ÙØ®', + 64560 => 'ÙÙ…', + 64561 => 'ÙÙ‰', + 64562 => 'ÙÙŠ', + 64563 => 'قح', + 64564 => 'قم', + 64565 => 'قى', + 64566 => 'قي', + 64567 => 'كا', + 64568 => 'كج', + 64569 => 'كح', + 64570 => 'كخ', + 64571 => 'كل', + 64572 => 'كم', + 64573 => 'كى', + 64574 => 'كي', + 64575 => 'لج', + 64576 => 'لح', + 64577 => 'لخ', + 64578 => 'لم', + 64579 => 'لى', + 64580 => 'لي', + 64581 => 'مج', + 64582 => 'مح', + 64583 => 'مخ', + 64584 => 'مم', + 64585 => 'مى', + 64586 => 'مي', + 64587 => 'نج', + 64588 => 'نح', + 64589 => 'نخ', + 64590 => 'نم', + 64591 => 'نى', + 64592 => 'ني', + 64593 => 'هج', + 64594 => 'هم', + 64595 => 'هى', + 64596 => 'هي', + 64597 => 'يج', + 64598 => 'يح', + 64599 => 'يخ', + 64600 => 'يم', + 64601 => 'يى', + 64602 => 'يي', + 64603 => 'ذٰ', + 64604 => 'رٰ', + 64605 => 'ىٰ', + 64612 => 'ئر', + 64613 => 'ئز', + 64614 => 'ئم', + 64615 => 'ئن', + 64616 => 'ئى', + 64617 => 'ئي', + 64618 => 'بر', + 64619 => 'بز', + 64620 => 'بم', + 64621 => 'بن', + 64622 => 'بى', + 64623 => 'بي', + 64624 => 'تر', + 64625 => 'تز', + 64626 => 'تم', + 64627 => 'تن', + 64628 => 'تى', + 64629 => 'تي', + 64630 => 'ثر', + 64631 => 'ثز', + 64632 => 'ثم', + 64633 => 'ثن', + 64634 => 'ثى', + 64635 => 'ثي', + 64636 => 'ÙÙ‰', + 64637 => 'ÙÙŠ', + 64638 => 'قى', + 64639 => 'قي', + 64640 => 'كا', + 64641 => 'كل', + 64642 => 'كم', + 64643 => 'كى', + 64644 => 'كي', + 64645 => 'لم', + 64646 => 'لى', + 64647 => 'لي', + 64648 => 'ما', + 64649 => 'مم', + 64650 => 'نر', + 64651 => 'نز', + 64652 => 'نم', + 64653 => 'نن', + 64654 => 'نى', + 64655 => 'ني', + 64656 => 'ىٰ', + 64657 => 'ير', + 64658 => 'يز', + 64659 => 'يم', + 64660 => 'ين', + 64661 => 'يى', + 64662 => 'يي', + 64663 => 'ئج', + 64664 => 'ئح', + 64665 => 'ئخ', + 64666 => 'ئم', + 64667 => 'ئه', + 64668 => 'بج', + 64669 => 'بح', + 64670 => 'بخ', + 64671 => 'بم', + 64672 => 'به', + 64673 => 'تج', + 64674 => 'تح', + 64675 => 'تخ', + 64676 => 'تم', + 64677 => 'ته', + 64678 => 'ثم', + 64679 => 'جح', + 64680 => 'جم', + 64681 => 'حج', + 64682 => 'حم', + 64683 => 'خج', + 64684 => 'خم', + 64685 => 'سج', + 64686 => 'سح', + 64687 => 'سخ', + 64688 => 'سم', + 64689 => 'صح', + 64690 => 'صخ', + 64691 => 'صم', + 64692 => 'ضج', + 64693 => 'ضح', + 64694 => 'ضخ', + 64695 => 'ضم', + 64696 => 'طح', + 64697 => 'ظم', + 64698 => 'عج', + 64699 => 'عم', + 64700 => 'غج', + 64701 => 'غم', + 64702 => 'ÙØ¬', + 64703 => 'ÙØ­', + 64704 => 'ÙØ®', + 64705 => 'ÙÙ…', + 64706 => 'قح', + 64707 => 'قم', + 64708 => 'كج', + 64709 => 'كح', + 64710 => 'كخ', + 64711 => 'كل', + 64712 => 'كم', + 64713 => 'لج', + 64714 => 'لح', + 64715 => 'لخ', + 64716 => 'لم', + 64717 => 'له', + 64718 => 'مج', + 64719 => 'مح', + 64720 => 'مخ', + 64721 => 'مم', + 64722 => 'نج', + 64723 => 'نح', + 64724 => 'نخ', + 64725 => 'نم', + 64726 => 'نه', + 64727 => 'هج', + 64728 => 'هم', + 64729 => 'هٰ', + 64730 => 'يج', + 64731 => 'يح', + 64732 => 'يخ', + 64733 => 'يم', + 64734 => 'يه', + 64735 => 'ئم', + 64736 => 'ئه', + 64737 => 'بم', + 64738 => 'به', + 64739 => 'تم', + 64740 => 'ته', + 64741 => 'ثم', + 64742 => 'ثه', + 64743 => 'سم', + 64744 => 'سه', + 64745 => 'شم', + 64746 => 'شه', + 64747 => 'كل', + 64748 => 'كم', + 64749 => 'لم', + 64750 => 'نم', + 64751 => 'نه', + 64752 => 'يم', + 64753 => 'يه', + 64754 => 'Ù€ÙŽÙ‘', + 64755 => 'Ù€ÙÙ‘', + 64756 => 'Ù€ÙÙ‘', + 64757 => 'طى', + 64758 => 'طي', + 64759 => 'عى', + 64760 => 'عي', + 64761 => 'غى', + 64762 => 'غي', + 64763 => 'سى', + 64764 => 'سي', + 64765 => 'شى', + 64766 => 'شي', + 64767 => 'حى', + 64768 => 'حي', + 64769 => 'جى', + 64770 => 'جي', + 64771 => 'خى', + 64772 => 'خي', + 64773 => 'صى', + 64774 => 'صي', + 64775 => 'ضى', + 64776 => 'ضي', + 64777 => 'شج', + 64778 => 'شح', + 64779 => 'شخ', + 64780 => 'شم', + 64781 => 'شر', + 64782 => 'سر', + 64783 => 'صر', + 64784 => 'ضر', + 64785 => 'طى', + 64786 => 'طي', + 64787 => 'عى', + 64788 => 'عي', + 64789 => 'غى', + 64790 => 'غي', + 64791 => 'سى', + 64792 => 'سي', + 64793 => 'شى', + 64794 => 'شي', + 64795 => 'حى', + 64796 => 'حي', + 64797 => 'جى', + 64798 => 'جي', + 64799 => 'خى', + 64800 => 'خي', + 64801 => 'صى', + 64802 => 'صي', + 64803 => 'ضى', + 64804 => 'ضي', + 64805 => 'شج', + 64806 => 'شح', + 64807 => 'شخ', + 64808 => 'شم', + 64809 => 'شر', + 64810 => 'سر', + 64811 => 'صر', + 64812 => 'ضر', + 64813 => 'شج', + 64814 => 'شح', + 64815 => 'شخ', + 64816 => 'شم', + 64817 => 'سه', + 64818 => 'شه', + 64819 => 'طم', + 64820 => 'سج', + 64821 => 'سح', + 64822 => 'سخ', + 64823 => 'شج', + 64824 => 'شح', + 64825 => 'شخ', + 64826 => 'طم', + 64827 => 'ظم', + 64828 => 'اً', + 64829 => 'اً', + 64848 => 'تجم', + 64849 => 'تحج', + 64850 => 'تحج', + 64851 => 'تحم', + 64852 => 'تخم', + 64853 => 'تمج', + 64854 => 'تمح', + 64855 => 'تمخ', + 64856 => 'جمح', + 64857 => 'جمح', + 64858 => 'حمي', + 64859 => 'حمى', + 64860 => 'سحج', + 64861 => 'سجح', + 64862 => 'سجى', + 64863 => 'سمح', + 64864 => 'سمح', + 64865 => 'سمج', + 64866 => 'سمم', + 64867 => 'سمم', + 64868 => 'صحح', + 64869 => 'صحح', + 64870 => 'صمم', + 64871 => 'شحم', + 64872 => 'شحم', + 64873 => 'شجي', + 64874 => 'شمخ', + 64875 => 'شمخ', + 64876 => 'شمم', + 64877 => 'شمم', + 64878 => 'ضحى', + 64879 => 'ضخم', + 64880 => 'ضخم', + 64881 => 'طمح', + 64882 => 'طمح', + 64883 => 'طمم', + 64884 => 'طمي', + 64885 => 'عجم', + 64886 => 'عمم', + 64887 => 'عمم', + 64888 => 'عمى', + 64889 => 'غمم', + 64890 => 'غمي', + 64891 => 'غمى', + 64892 => 'ÙØ®Ù…', + 64893 => 'ÙØ®Ù…', + 64894 => 'قمح', + 64895 => 'قمم', + 64896 => 'لحم', + 64897 => 'لحي', + 64898 => 'لحى', + 64899 => 'لجج', + 64900 => 'لجج', + 64901 => 'لخم', + 64902 => 'لخم', + 64903 => 'لمح', + 64904 => 'لمح', + 64905 => 'محج', + 64906 => 'محم', + 64907 => 'محي', + 64908 => 'مجح', + 64909 => 'مجم', + 64910 => 'مخج', + 64911 => 'مخم', + 64914 => 'مجخ', + 64915 => 'همج', + 64916 => 'همم', + 64917 => 'نحم', + 64918 => 'نحى', + 64919 => 'نجم', + 64920 => 'نجم', + 64921 => 'نجى', + 64922 => 'نمي', + 64923 => 'نمى', + 64924 => 'يمم', + 64925 => 'يمم', + 64926 => 'بخي', + 64927 => 'تجي', + 64928 => 'تجى', + 64929 => 'تخي', + 64930 => 'تخى', + 64931 => 'تمي', + 64932 => 'تمى', + 64933 => 'جمي', + 64934 => 'جحى', + 64935 => 'جمى', + 64936 => 'سخى', + 64937 => 'صحي', + 64938 => 'شحي', + 64939 => 'ضحي', + 64940 => 'لجي', + 64941 => 'لمي', + 64942 => 'يحي', + 64943 => 'يجي', + 64944 => 'يمي', + 64945 => 'ممي', + 64946 => 'قمي', + 64947 => 'نحي', + 64948 => 'قمح', + 64949 => 'لحم', + 64950 => 'عمي', + 64951 => 'كمي', + 64952 => 'نجح', + 64953 => 'مخي', + 64954 => 'لجم', + 64955 => 'كمم', + 64956 => 'لجم', + 64957 => 'نجح', + 64958 => 'جحي', + 64959 => 'حجي', + 64960 => 'مجي', + 64961 => 'Ùمي', + 64962 => 'بحي', + 64963 => 'كمم', + 64964 => 'عجم', + 64965 => 'صمم', + 64966 => 'سخي', + 64967 => 'نجي', + 65008 => 'صلے', + 65009 => 'قلے', + 65010 => 'الله', + 65011 => 'اكبر', + 65012 => 'محمد', + 65013 => 'صلعم', + 65014 => 'رسول', + 65015 => 'عليه', + 65016 => 'وسلم', + 65017 => 'صلى', + 65020 => 'ریال', + 65041 => 'ã€', + 65047 => '〖', + 65048 => '〗', + 65073 => '—', + 65074 => '–', + 65081 => '〔', + 65082 => '〕', + 65083 => 'ã€', + 65084 => '】', + 65085 => '《', + 65086 => '》', + 65087 => '〈', + 65088 => '〉', + 65089 => '「', + 65090 => 'ã€', + 65091 => '『', + 65092 => 'ã€', + 65105 => 'ã€', + 65112 => '—', + 65117 => '〔', + 65118 => '〕', + 65123 => '-', + 65137 => 'ـً', + 65143 => 'Ù€ÙŽ', + 65145 => 'Ù€Ù', + 65147 => 'Ù€Ù', + 65149 => 'ـّ', + 65151 => 'ـْ', + 65152 => 'Ø¡', + 65153 => 'Ø¢', + 65154 => 'Ø¢', + 65155 => 'Ø£', + 65156 => 'Ø£', + 65157 => 'ؤ', + 65158 => 'ؤ', + 65159 => 'Ø¥', + 65160 => 'Ø¥', + 65161 => 'ئ', + 65162 => 'ئ', + 65163 => 'ئ', + 65164 => 'ئ', + 65165 => 'ا', + 65166 => 'ا', + 65167 => 'ب', + 65168 => 'ب', + 65169 => 'ب', + 65170 => 'ب', + 65171 => 'Ø©', + 65172 => 'Ø©', + 65173 => 'ت', + 65174 => 'ت', + 65175 => 'ت', + 65176 => 'ت', + 65177 => 'Ø«', + 65178 => 'Ø«', + 65179 => 'Ø«', + 65180 => 'Ø«', + 65181 => 'ج', + 65182 => 'ج', + 65183 => 'ج', + 65184 => 'ج', + 65185 => 'Ø­', + 65186 => 'Ø­', + 65187 => 'Ø­', + 65188 => 'Ø­', + 65189 => 'Ø®', + 65190 => 'Ø®', + 65191 => 'Ø®', + 65192 => 'Ø®', + 65193 => 'د', + 65194 => 'د', + 65195 => 'ذ', + 65196 => 'ذ', + 65197 => 'ر', + 65198 => 'ر', + 65199 => 'ز', + 65200 => 'ز', + 65201 => 'س', + 65202 => 'س', + 65203 => 'س', + 65204 => 'س', + 65205 => 'Ø´', + 65206 => 'Ø´', + 65207 => 'Ø´', + 65208 => 'Ø´', + 65209 => 'ص', + 65210 => 'ص', + 65211 => 'ص', + 65212 => 'ص', + 65213 => 'ض', + 65214 => 'ض', + 65215 => 'ض', + 65216 => 'ض', + 65217 => 'Ø·', + 65218 => 'Ø·', + 65219 => 'Ø·', + 65220 => 'Ø·', + 65221 => 'ظ', + 65222 => 'ظ', + 65223 => 'ظ', + 65224 => 'ظ', + 65225 => 'ع', + 65226 => 'ع', + 65227 => 'ع', + 65228 => 'ع', + 65229 => 'غ', + 65230 => 'غ', + 65231 => 'غ', + 65232 => 'غ', + 65233 => 'Ù', + 65234 => 'Ù', + 65235 => 'Ù', + 65236 => 'Ù', + 65237 => 'Ù‚', + 65238 => 'Ù‚', + 65239 => 'Ù‚', + 65240 => 'Ù‚', + 65241 => 'Ùƒ', + 65242 => 'Ùƒ', + 65243 => 'Ùƒ', + 65244 => 'Ùƒ', + 65245 => 'Ù„', + 65246 => 'Ù„', + 65247 => 'Ù„', + 65248 => 'Ù„', + 65249 => 'Ù…', + 65250 => 'Ù…', + 65251 => 'Ù…', + 65252 => 'Ù…', + 65253 => 'Ù†', + 65254 => 'Ù†', + 65255 => 'Ù†', + 65256 => 'Ù†', + 65257 => 'Ù‡', + 65258 => 'Ù‡', + 65259 => 'Ù‡', + 65260 => 'Ù‡', + 65261 => 'Ùˆ', + 65262 => 'Ùˆ', + 65263 => 'Ù‰', + 65264 => 'Ù‰', + 65265 => 'ÙŠ', + 65266 => 'ÙŠ', + 65267 => 'ÙŠ', + 65268 => 'ÙŠ', + 65269 => 'لآ', + 65270 => 'لآ', + 65271 => 'لأ', + 65272 => 'لأ', + 65273 => 'لإ', + 65274 => 'لإ', + 65275 => 'لا', + 65276 => 'لا', + 65293 => '-', + 65294 => '.', + 65296 => '0', + 65297 => '1', + 65298 => '2', + 65299 => '3', + 65300 => '4', + 65301 => '5', + 65302 => '6', + 65303 => '7', + 65304 => '8', + 65305 => '9', + 65313 => 'a', + 65314 => 'b', + 65315 => 'c', + 65316 => 'd', + 65317 => 'e', + 65318 => 'f', + 65319 => 'g', + 65320 => 'h', + 65321 => 'i', + 65322 => 'j', + 65323 => 'k', + 65324 => 'l', + 65325 => 'm', + 65326 => 'n', + 65327 => 'o', + 65328 => 'p', + 65329 => 'q', + 65330 => 'r', + 65331 => 's', + 65332 => 't', + 65333 => 'u', + 65334 => 'v', + 65335 => 'w', + 65336 => 'x', + 65337 => 'y', + 65338 => 'z', + 65345 => 'a', + 65346 => 'b', + 65347 => 'c', + 65348 => 'd', + 65349 => 'e', + 65350 => 'f', + 65351 => 'g', + 65352 => 'h', + 65353 => 'i', + 65354 => 'j', + 65355 => 'k', + 65356 => 'l', + 65357 => 'm', + 65358 => 'n', + 65359 => 'o', + 65360 => 'p', + 65361 => 'q', + 65362 => 'r', + 65363 => 's', + 65364 => 't', + 65365 => 'u', + 65366 => 'v', + 65367 => 'w', + 65368 => 'x', + 65369 => 'y', + 65370 => 'z', + 65375 => '⦅', + 65376 => '⦆', + 65377 => '.', + 65378 => '「', + 65379 => 'ã€', + 65380 => 'ã€', + 65381 => '・', + 65382 => 'ヲ', + 65383 => 'ã‚¡', + 65384 => 'ã‚£', + 65385 => 'ã‚¥', + 65386 => 'ã‚§', + 65387 => 'ã‚©', + 65388 => 'ャ', + 65389 => 'ュ', + 65390 => 'ョ', + 65391 => 'ッ', + 65392 => 'ー', + 65393 => 'ã‚¢', + 65394 => 'イ', + 65395 => 'ウ', + 65396 => 'エ', + 65397 => 'オ', + 65398 => 'ã‚«', + 65399 => 'ã‚­', + 65400 => 'ク', + 65401 => 'ケ', + 65402 => 'コ', + 65403 => 'サ', + 65404 => 'ã‚·', + 65405 => 'ス', + 65406 => 'ã‚»', + 65407 => 'ソ', + 65408 => 'ã‚¿', + 65409 => 'ãƒ', + 65410 => 'ツ', + 65411 => 'テ', + 65412 => 'ト', + 65413 => 'ナ', + 65414 => 'ニ', + 65415 => 'ヌ', + 65416 => 'ãƒ', + 65417 => 'ノ', + 65418 => 'ãƒ', + 65419 => 'ヒ', + 65420 => 'フ', + 65421 => 'ヘ', + 65422 => 'ホ', + 65423 => 'マ', + 65424 => 'ミ', + 65425 => 'ム', + 65426 => 'メ', + 65427 => 'モ', + 65428 => 'ヤ', + 65429 => 'ユ', + 65430 => 'ヨ', + 65431 => 'ラ', + 65432 => 'リ', + 65433 => 'ル', + 65434 => 'レ', + 65435 => 'ロ', + 65436 => 'ワ', + 65437 => 'ン', + 65438 => 'ã‚™', + 65439 => '゚', + 65441 => 'á„€', + 65442 => 'á„', + 65443 => 'ᆪ', + 65444 => 'á„‚', + 65445 => 'ᆬ', + 65446 => 'ᆭ', + 65447 => 'ᄃ', + 65448 => 'á„„', + 65449 => 'á„…', + 65450 => 'ᆰ', + 65451 => 'ᆱ', + 65452 => 'ᆲ', + 65453 => 'ᆳ', + 65454 => 'ᆴ', + 65455 => 'ᆵ', + 65456 => 'ᄚ', + 65457 => 'ᄆ', + 65458 => 'ᄇ', + 65459 => 'ᄈ', + 65460 => 'á„¡', + 65461 => 'ᄉ', + 65462 => 'ᄊ', + 65463 => 'á„‹', + 65464 => 'ᄌ', + 65465 => 'á„', + 65466 => 'ᄎ', + 65467 => 'á„', + 65468 => 'á„', + 65469 => 'á„‘', + 65470 => 'á„’', + 65474 => 'á…¡', + 65475 => 'á…¢', + 65476 => 'á…£', + 65477 => 'á…¤', + 65478 => 'á…¥', + 65479 => 'á…¦', + 65482 => 'á…§', + 65483 => 'á…¨', + 65484 => 'á…©', + 65485 => 'á…ª', + 65486 => 'á…«', + 65487 => 'á…¬', + 65490 => 'á…­', + 65491 => 'á…®', + 65492 => 'á…¯', + 65493 => 'á…°', + 65494 => 'á…±', + 65495 => 'á…²', + 65498 => 'á…³', + 65499 => 'á…´', + 65500 => 'á…µ', + 65504 => '¢', + 65505 => '£', + 65506 => '¬', + 65508 => '¦', + 65509 => 'Â¥', + 65510 => 'â‚©', + 65512 => '│', + 65513 => 'â†', + 65514 => '↑', + 65515 => '→', + 65516 => '↓', + 65517 => 'â– ', + 65518 => 'â—‹', + 66560 => 'ð¨', + 66561 => 'ð©', + 66562 => 'ðª', + 66563 => 'ð«', + 66564 => 'ð¬', + 66565 => 'ð­', + 66566 => 'ð®', + 66567 => 'ð¯', + 66568 => 'ð°', + 66569 => 'ð±', + 66570 => 'ð²', + 66571 => 'ð³', + 66572 => 'ð´', + 66573 => 'ðµ', + 66574 => 'ð¶', + 66575 => 'ð·', + 66576 => 'ð¸', + 66577 => 'ð¹', + 66578 => 'ðº', + 66579 => 'ð»', + 66580 => 'ð¼', + 66581 => 'ð½', + 66582 => 'ð¾', + 66583 => 'ð¿', + 66584 => 'ð‘€', + 66585 => 'ð‘', + 66586 => 'ð‘‚', + 66587 => 'ð‘ƒ', + 66588 => 'ð‘„', + 66589 => 'ð‘…', + 66590 => 'ð‘†', + 66591 => 'ð‘‡', + 66592 => 'ð‘ˆ', + 66593 => 'ð‘‰', + 66594 => 'ð‘Š', + 66595 => 'ð‘‹', + 66596 => 'ð‘Œ', + 66597 => 'ð‘', + 66598 => 'ð‘Ž', + 66599 => 'ð‘', + 66736 => 'ð“˜', + 66737 => 'ð“™', + 66738 => 'ð“š', + 66739 => 'ð“›', + 66740 => 'ð“œ', + 66741 => 'ð“', + 66742 => 'ð“ž', + 66743 => 'ð“Ÿ', + 66744 => 'ð“ ', + 66745 => 'ð“¡', + 66746 => 'ð“¢', + 66747 => 'ð“£', + 66748 => 'ð“¤', + 66749 => 'ð“¥', + 66750 => 'ð“¦', + 66751 => 'ð“§', + 66752 => 'ð“¨', + 66753 => 'ð“©', + 66754 => 'ð“ª', + 66755 => 'ð“«', + 66756 => 'ð“¬', + 66757 => 'ð“­', + 66758 => 'ð“®', + 66759 => 'ð“¯', + 66760 => 'ð“°', + 66761 => 'ð“±', + 66762 => 'ð“²', + 66763 => 'ð“³', + 66764 => 'ð“´', + 66765 => 'ð“µ', + 66766 => 'ð“¶', + 66767 => 'ð“·', + 66768 => 'ð“¸', + 66769 => 'ð“¹', + 66770 => 'ð“º', + 66771 => 'ð“»', + 68736 => 'ð³€', + 68737 => 'ð³', + 68738 => 'ð³‚', + 68739 => 'ð³ƒ', + 68740 => 'ð³„', + 68741 => 'ð³…', + 68742 => 'ð³†', + 68743 => 'ð³‡', + 68744 => 'ð³ˆ', + 68745 => 'ð³‰', + 68746 => 'ð³Š', + 68747 => 'ð³‹', + 68748 => 'ð³Œ', + 68749 => 'ð³', + 68750 => 'ð³Ž', + 68751 => 'ð³', + 68752 => 'ð³', + 68753 => 'ð³‘', + 68754 => 'ð³’', + 68755 => 'ð³“', + 68756 => 'ð³”', + 68757 => 'ð³•', + 68758 => 'ð³–', + 68759 => 'ð³—', + 68760 => 'ð³˜', + 68761 => 'ð³™', + 68762 => 'ð³š', + 68763 => 'ð³›', + 68764 => 'ð³œ', + 68765 => 'ð³', + 68766 => 'ð³ž', + 68767 => 'ð³Ÿ', + 68768 => 'ð³ ', + 68769 => 'ð³¡', + 68770 => 'ð³¢', + 68771 => 'ð³£', + 68772 => 'ð³¤', + 68773 => 'ð³¥', + 68774 => 'ð³¦', + 68775 => 'ð³§', + 68776 => 'ð³¨', + 68777 => 'ð³©', + 68778 => 'ð³ª', + 68779 => 'ð³«', + 68780 => 'ð³¬', + 68781 => 'ð³­', + 68782 => 'ð³®', + 68783 => 'ð³¯', + 68784 => 'ð³°', + 68785 => 'ð³±', + 68786 => 'ð³²', + 71840 => 'ð‘£€', + 71841 => 'ð‘£', + 71842 => '𑣂', + 71843 => '𑣃', + 71844 => '𑣄', + 71845 => 'ð‘£…', + 71846 => '𑣆', + 71847 => '𑣇', + 71848 => '𑣈', + 71849 => '𑣉', + 71850 => '𑣊', + 71851 => '𑣋', + 71852 => '𑣌', + 71853 => 'ð‘£', + 71854 => '𑣎', + 71855 => 'ð‘£', + 71856 => 'ð‘£', + 71857 => '𑣑', + 71858 => 'ð‘£’', + 71859 => '𑣓', + 71860 => 'ð‘£”', + 71861 => '𑣕', + 71862 => 'ð‘£–', + 71863 => 'ð‘£—', + 71864 => '𑣘', + 71865 => 'ð‘£™', + 71866 => '𑣚', + 71867 => 'ð‘£›', + 71868 => '𑣜', + 71869 => 'ð‘£', + 71870 => '𑣞', + 71871 => '𑣟', + 93760 => 'ð–¹ ', + 93761 => '𖹡', + 93762 => 'ð–¹¢', + 93763 => 'ð–¹£', + 93764 => '𖹤', + 93765 => 'ð–¹¥', + 93766 => '𖹦', + 93767 => 'ð–¹§', + 93768 => '𖹨', + 93769 => '𖹩', + 93770 => '𖹪', + 93771 => '𖹫', + 93772 => '𖹬', + 93773 => 'ð–¹­', + 93774 => 'ð–¹®', + 93775 => '𖹯', + 93776 => 'ð–¹°', + 93777 => 'ð–¹±', + 93778 => 'ð–¹²', + 93779 => 'ð–¹³', + 93780 => 'ð–¹´', + 93781 => 'ð–¹µ', + 93782 => 'ð–¹¶', + 93783 => 'ð–¹·', + 93784 => '𖹸', + 93785 => 'ð–¹¹', + 93786 => '𖹺', + 93787 => 'ð–¹»', + 93788 => 'ð–¹¼', + 93789 => 'ð–¹½', + 93790 => 'ð–¹¾', + 93791 => '𖹿', + 119134 => 'ð…—ð…¥', + 119135 => 'ð…˜ð…¥', + 119136 => 'ð…˜ð…¥ð…®', + 119137 => 'ð…˜ð…¥ð…¯', + 119138 => 'ð…˜ð…¥ð…°', + 119139 => 'ð…˜ð…¥ð…±', + 119140 => 'ð…˜ð…¥ð…²', + 119227 => 'ð†¹ð…¥', + 119228 => 'ð†ºð…¥', + 119229 => 'ð†¹ð…¥ð…®', + 119230 => 'ð†ºð…¥ð…®', + 119231 => 'ð†¹ð…¥ð…¯', + 119232 => 'ð†ºð…¥ð…¯', + 119808 => 'a', + 119809 => 'b', + 119810 => 'c', + 119811 => 'd', + 119812 => 'e', + 119813 => 'f', + 119814 => 'g', + 119815 => 'h', + 119816 => 'i', + 119817 => 'j', + 119818 => 'k', + 119819 => 'l', + 119820 => 'm', + 119821 => 'n', + 119822 => 'o', + 119823 => 'p', + 119824 => 'q', + 119825 => 'r', + 119826 => 's', + 119827 => 't', + 119828 => 'u', + 119829 => 'v', + 119830 => 'w', + 119831 => 'x', + 119832 => 'y', + 119833 => 'z', + 119834 => 'a', + 119835 => 'b', + 119836 => 'c', + 119837 => 'd', + 119838 => 'e', + 119839 => 'f', + 119840 => 'g', + 119841 => 'h', + 119842 => 'i', + 119843 => 'j', + 119844 => 'k', + 119845 => 'l', + 119846 => 'm', + 119847 => 'n', + 119848 => 'o', + 119849 => 'p', + 119850 => 'q', + 119851 => 'r', + 119852 => 's', + 119853 => 't', + 119854 => 'u', + 119855 => 'v', + 119856 => 'w', + 119857 => 'x', + 119858 => 'y', + 119859 => 'z', + 119860 => 'a', + 119861 => 'b', + 119862 => 'c', + 119863 => 'd', + 119864 => 'e', + 119865 => 'f', + 119866 => 'g', + 119867 => 'h', + 119868 => 'i', + 119869 => 'j', + 119870 => 'k', + 119871 => 'l', + 119872 => 'm', + 119873 => 'n', + 119874 => 'o', + 119875 => 'p', + 119876 => 'q', + 119877 => 'r', + 119878 => 's', + 119879 => 't', + 119880 => 'u', + 119881 => 'v', + 119882 => 'w', + 119883 => 'x', + 119884 => 'y', + 119885 => 'z', + 119886 => 'a', + 119887 => 'b', + 119888 => 'c', + 119889 => 'd', + 119890 => 'e', + 119891 => 'f', + 119892 => 'g', + 119894 => 'i', + 119895 => 'j', + 119896 => 'k', + 119897 => 'l', + 119898 => 'm', + 119899 => 'n', + 119900 => 'o', + 119901 => 'p', + 119902 => 'q', + 119903 => 'r', + 119904 => 's', + 119905 => 't', + 119906 => 'u', + 119907 => 'v', + 119908 => 'w', + 119909 => 'x', + 119910 => 'y', + 119911 => 'z', + 119912 => 'a', + 119913 => 'b', + 119914 => 'c', + 119915 => 'd', + 119916 => 'e', + 119917 => 'f', + 119918 => 'g', + 119919 => 'h', + 119920 => 'i', + 119921 => 'j', + 119922 => 'k', + 119923 => 'l', + 119924 => 'm', + 119925 => 'n', + 119926 => 'o', + 119927 => 'p', + 119928 => 'q', + 119929 => 'r', + 119930 => 's', + 119931 => 't', + 119932 => 'u', + 119933 => 'v', + 119934 => 'w', + 119935 => 'x', + 119936 => 'y', + 119937 => 'z', + 119938 => 'a', + 119939 => 'b', + 119940 => 'c', + 119941 => 'd', + 119942 => 'e', + 119943 => 'f', + 119944 => 'g', + 119945 => 'h', + 119946 => 'i', + 119947 => 'j', + 119948 => 'k', + 119949 => 'l', + 119950 => 'm', + 119951 => 'n', + 119952 => 'o', + 119953 => 'p', + 119954 => 'q', + 119955 => 'r', + 119956 => 's', + 119957 => 't', + 119958 => 'u', + 119959 => 'v', + 119960 => 'w', + 119961 => 'x', + 119962 => 'y', + 119963 => 'z', + 119964 => 'a', + 119966 => 'c', + 119967 => 'd', + 119970 => 'g', + 119973 => 'j', + 119974 => 'k', + 119977 => 'n', + 119978 => 'o', + 119979 => 'p', + 119980 => 'q', + 119982 => 's', + 119983 => 't', + 119984 => 'u', + 119985 => 'v', + 119986 => 'w', + 119987 => 'x', + 119988 => 'y', + 119989 => 'z', + 119990 => 'a', + 119991 => 'b', + 119992 => 'c', + 119993 => 'd', + 119995 => 'f', + 119997 => 'h', + 119998 => 'i', + 119999 => 'j', + 120000 => 'k', + 120001 => 'l', + 120002 => 'm', + 120003 => 'n', + 120005 => 'p', + 120006 => 'q', + 120007 => 'r', + 120008 => 's', + 120009 => 't', + 120010 => 'u', + 120011 => 'v', + 120012 => 'w', + 120013 => 'x', + 120014 => 'y', + 120015 => 'z', + 120016 => 'a', + 120017 => 'b', + 120018 => 'c', + 120019 => 'd', + 120020 => 'e', + 120021 => 'f', + 120022 => 'g', + 120023 => 'h', + 120024 => 'i', + 120025 => 'j', + 120026 => 'k', + 120027 => 'l', + 120028 => 'm', + 120029 => 'n', + 120030 => 'o', + 120031 => 'p', + 120032 => 'q', + 120033 => 'r', + 120034 => 's', + 120035 => 't', + 120036 => 'u', + 120037 => 'v', + 120038 => 'w', + 120039 => 'x', + 120040 => 'y', + 120041 => 'z', + 120042 => 'a', + 120043 => 'b', + 120044 => 'c', + 120045 => 'd', + 120046 => 'e', + 120047 => 'f', + 120048 => 'g', + 120049 => 'h', + 120050 => 'i', + 120051 => 'j', + 120052 => 'k', + 120053 => 'l', + 120054 => 'm', + 120055 => 'n', + 120056 => 'o', + 120057 => 'p', + 120058 => 'q', + 120059 => 'r', + 120060 => 's', + 120061 => 't', + 120062 => 'u', + 120063 => 'v', + 120064 => 'w', + 120065 => 'x', + 120066 => 'y', + 120067 => 'z', + 120068 => 'a', + 120069 => 'b', + 120071 => 'd', + 120072 => 'e', + 120073 => 'f', + 120074 => 'g', + 120077 => 'j', + 120078 => 'k', + 120079 => 'l', + 120080 => 'm', + 120081 => 'n', + 120082 => 'o', + 120083 => 'p', + 120084 => 'q', + 120086 => 's', + 120087 => 't', + 120088 => 'u', + 120089 => 'v', + 120090 => 'w', + 120091 => 'x', + 120092 => 'y', + 120094 => 'a', + 120095 => 'b', + 120096 => 'c', + 120097 => 'd', + 120098 => 'e', + 120099 => 'f', + 120100 => 'g', + 120101 => 'h', + 120102 => 'i', + 120103 => 'j', + 120104 => 'k', + 120105 => 'l', + 120106 => 'm', + 120107 => 'n', + 120108 => 'o', + 120109 => 'p', + 120110 => 'q', + 120111 => 'r', + 120112 => 's', + 120113 => 't', + 120114 => 'u', + 120115 => 'v', + 120116 => 'w', + 120117 => 'x', + 120118 => 'y', + 120119 => 'z', + 120120 => 'a', + 120121 => 'b', + 120123 => 'd', + 120124 => 'e', + 120125 => 'f', + 120126 => 'g', + 120128 => 'i', + 120129 => 'j', + 120130 => 'k', + 120131 => 'l', + 120132 => 'm', + 120134 => 'o', + 120138 => 's', + 120139 => 't', + 120140 => 'u', + 120141 => 'v', + 120142 => 'w', + 120143 => 'x', + 120144 => 'y', + 120146 => 'a', + 120147 => 'b', + 120148 => 'c', + 120149 => 'd', + 120150 => 'e', + 120151 => 'f', + 120152 => 'g', + 120153 => 'h', + 120154 => 'i', + 120155 => 'j', + 120156 => 'k', + 120157 => 'l', + 120158 => 'm', + 120159 => 'n', + 120160 => 'o', + 120161 => 'p', + 120162 => 'q', + 120163 => 'r', + 120164 => 's', + 120165 => 't', + 120166 => 'u', + 120167 => 'v', + 120168 => 'w', + 120169 => 'x', + 120170 => 'y', + 120171 => 'z', + 120172 => 'a', + 120173 => 'b', + 120174 => 'c', + 120175 => 'd', + 120176 => 'e', + 120177 => 'f', + 120178 => 'g', + 120179 => 'h', + 120180 => 'i', + 120181 => 'j', + 120182 => 'k', + 120183 => 'l', + 120184 => 'm', + 120185 => 'n', + 120186 => 'o', + 120187 => 'p', + 120188 => 'q', + 120189 => 'r', + 120190 => 's', + 120191 => 't', + 120192 => 'u', + 120193 => 'v', + 120194 => 'w', + 120195 => 'x', + 120196 => 'y', + 120197 => 'z', + 120198 => 'a', + 120199 => 'b', + 120200 => 'c', + 120201 => 'd', + 120202 => 'e', + 120203 => 'f', + 120204 => 'g', + 120205 => 'h', + 120206 => 'i', + 120207 => 'j', + 120208 => 'k', + 120209 => 'l', + 120210 => 'm', + 120211 => 'n', + 120212 => 'o', + 120213 => 'p', + 120214 => 'q', + 120215 => 'r', + 120216 => 's', + 120217 => 't', + 120218 => 'u', + 120219 => 'v', + 120220 => 'w', + 120221 => 'x', + 120222 => 'y', + 120223 => 'z', + 120224 => 'a', + 120225 => 'b', + 120226 => 'c', + 120227 => 'd', + 120228 => 'e', + 120229 => 'f', + 120230 => 'g', + 120231 => 'h', + 120232 => 'i', + 120233 => 'j', + 120234 => 'k', + 120235 => 'l', + 120236 => 'm', + 120237 => 'n', + 120238 => 'o', + 120239 => 'p', + 120240 => 'q', + 120241 => 'r', + 120242 => 's', + 120243 => 't', + 120244 => 'u', + 120245 => 'v', + 120246 => 'w', + 120247 => 'x', + 120248 => 'y', + 120249 => 'z', + 120250 => 'a', + 120251 => 'b', + 120252 => 'c', + 120253 => 'd', + 120254 => 'e', + 120255 => 'f', + 120256 => 'g', + 120257 => 'h', + 120258 => 'i', + 120259 => 'j', + 120260 => 'k', + 120261 => 'l', + 120262 => 'm', + 120263 => 'n', + 120264 => 'o', + 120265 => 'p', + 120266 => 'q', + 120267 => 'r', + 120268 => 's', + 120269 => 't', + 120270 => 'u', + 120271 => 'v', + 120272 => 'w', + 120273 => 'x', + 120274 => 'y', + 120275 => 'z', + 120276 => 'a', + 120277 => 'b', + 120278 => 'c', + 120279 => 'd', + 120280 => 'e', + 120281 => 'f', + 120282 => 'g', + 120283 => 'h', + 120284 => 'i', + 120285 => 'j', + 120286 => 'k', + 120287 => 'l', + 120288 => 'm', + 120289 => 'n', + 120290 => 'o', + 120291 => 'p', + 120292 => 'q', + 120293 => 'r', + 120294 => 's', + 120295 => 't', + 120296 => 'u', + 120297 => 'v', + 120298 => 'w', + 120299 => 'x', + 120300 => 'y', + 120301 => 'z', + 120302 => 'a', + 120303 => 'b', + 120304 => 'c', + 120305 => 'd', + 120306 => 'e', + 120307 => 'f', + 120308 => 'g', + 120309 => 'h', + 120310 => 'i', + 120311 => 'j', + 120312 => 'k', + 120313 => 'l', + 120314 => 'm', + 120315 => 'n', + 120316 => 'o', + 120317 => 'p', + 120318 => 'q', + 120319 => 'r', + 120320 => 's', + 120321 => 't', + 120322 => 'u', + 120323 => 'v', + 120324 => 'w', + 120325 => 'x', + 120326 => 'y', + 120327 => 'z', + 120328 => 'a', + 120329 => 'b', + 120330 => 'c', + 120331 => 'd', + 120332 => 'e', + 120333 => 'f', + 120334 => 'g', + 120335 => 'h', + 120336 => 'i', + 120337 => 'j', + 120338 => 'k', + 120339 => 'l', + 120340 => 'm', + 120341 => 'n', + 120342 => 'o', + 120343 => 'p', + 120344 => 'q', + 120345 => 'r', + 120346 => 's', + 120347 => 't', + 120348 => 'u', + 120349 => 'v', + 120350 => 'w', + 120351 => 'x', + 120352 => 'y', + 120353 => 'z', + 120354 => 'a', + 120355 => 'b', + 120356 => 'c', + 120357 => 'd', + 120358 => 'e', + 120359 => 'f', + 120360 => 'g', + 120361 => 'h', + 120362 => 'i', + 120363 => 'j', + 120364 => 'k', + 120365 => 'l', + 120366 => 'm', + 120367 => 'n', + 120368 => 'o', + 120369 => 'p', + 120370 => 'q', + 120371 => 'r', + 120372 => 's', + 120373 => 't', + 120374 => 'u', + 120375 => 'v', + 120376 => 'w', + 120377 => 'x', + 120378 => 'y', + 120379 => 'z', + 120380 => 'a', + 120381 => 'b', + 120382 => 'c', + 120383 => 'd', + 120384 => 'e', + 120385 => 'f', + 120386 => 'g', + 120387 => 'h', + 120388 => 'i', + 120389 => 'j', + 120390 => 'k', + 120391 => 'l', + 120392 => 'm', + 120393 => 'n', + 120394 => 'o', + 120395 => 'p', + 120396 => 'q', + 120397 => 'r', + 120398 => 's', + 120399 => 't', + 120400 => 'u', + 120401 => 'v', + 120402 => 'w', + 120403 => 'x', + 120404 => 'y', + 120405 => 'z', + 120406 => 'a', + 120407 => 'b', + 120408 => 'c', + 120409 => 'd', + 120410 => 'e', + 120411 => 'f', + 120412 => 'g', + 120413 => 'h', + 120414 => 'i', + 120415 => 'j', + 120416 => 'k', + 120417 => 'l', + 120418 => 'm', + 120419 => 'n', + 120420 => 'o', + 120421 => 'p', + 120422 => 'q', + 120423 => 'r', + 120424 => 's', + 120425 => 't', + 120426 => 'u', + 120427 => 'v', + 120428 => 'w', + 120429 => 'x', + 120430 => 'y', + 120431 => 'z', + 120432 => 'a', + 120433 => 'b', + 120434 => 'c', + 120435 => 'd', + 120436 => 'e', + 120437 => 'f', + 120438 => 'g', + 120439 => 'h', + 120440 => 'i', + 120441 => 'j', + 120442 => 'k', + 120443 => 'l', + 120444 => 'm', + 120445 => 'n', + 120446 => 'o', + 120447 => 'p', + 120448 => 'q', + 120449 => 'r', + 120450 => 's', + 120451 => 't', + 120452 => 'u', + 120453 => 'v', + 120454 => 'w', + 120455 => 'x', + 120456 => 'y', + 120457 => 'z', + 120458 => 'a', + 120459 => 'b', + 120460 => 'c', + 120461 => 'd', + 120462 => 'e', + 120463 => 'f', + 120464 => 'g', + 120465 => 'h', + 120466 => 'i', + 120467 => 'j', + 120468 => 'k', + 120469 => 'l', + 120470 => 'm', + 120471 => 'n', + 120472 => 'o', + 120473 => 'p', + 120474 => 'q', + 120475 => 'r', + 120476 => 's', + 120477 => 't', + 120478 => 'u', + 120479 => 'v', + 120480 => 'w', + 120481 => 'x', + 120482 => 'y', + 120483 => 'z', + 120484 => 'ı', + 120485 => 'È·', + 120488 => 'α', + 120489 => 'β', + 120490 => 'γ', + 120491 => 'δ', + 120492 => 'ε', + 120493 => 'ζ', + 120494 => 'η', + 120495 => 'θ', + 120496 => 'ι', + 120497 => 'κ', + 120498 => 'λ', + 120499 => 'μ', + 120500 => 'ν', + 120501 => 'ξ', + 120502 => 'ο', + 120503 => 'Ï€', + 120504 => 'Ï', + 120505 => 'θ', + 120506 => 'σ', + 120507 => 'Ï„', + 120508 => 'Ï…', + 120509 => 'φ', + 120510 => 'χ', + 120511 => 'ψ', + 120512 => 'ω', + 120513 => '∇', + 120514 => 'α', + 120515 => 'β', + 120516 => 'γ', + 120517 => 'δ', + 120518 => 'ε', + 120519 => 'ζ', + 120520 => 'η', + 120521 => 'θ', + 120522 => 'ι', + 120523 => 'κ', + 120524 => 'λ', + 120525 => 'μ', + 120526 => 'ν', + 120527 => 'ξ', + 120528 => 'ο', + 120529 => 'Ï€', + 120530 => 'Ï', + 120531 => 'σ', + 120532 => 'σ', + 120533 => 'Ï„', + 120534 => 'Ï…', + 120535 => 'φ', + 120536 => 'χ', + 120537 => 'ψ', + 120538 => 'ω', + 120539 => '∂', + 120540 => 'ε', + 120541 => 'θ', + 120542 => 'κ', + 120543 => 'φ', + 120544 => 'Ï', + 120545 => 'Ï€', + 120546 => 'α', + 120547 => 'β', + 120548 => 'γ', + 120549 => 'δ', + 120550 => 'ε', + 120551 => 'ζ', + 120552 => 'η', + 120553 => 'θ', + 120554 => 'ι', + 120555 => 'κ', + 120556 => 'λ', + 120557 => 'μ', + 120558 => 'ν', + 120559 => 'ξ', + 120560 => 'ο', + 120561 => 'Ï€', + 120562 => 'Ï', + 120563 => 'θ', + 120564 => 'σ', + 120565 => 'Ï„', + 120566 => 'Ï…', + 120567 => 'φ', + 120568 => 'χ', + 120569 => 'ψ', + 120570 => 'ω', + 120571 => '∇', + 120572 => 'α', + 120573 => 'β', + 120574 => 'γ', + 120575 => 'δ', + 120576 => 'ε', + 120577 => 'ζ', + 120578 => 'η', + 120579 => 'θ', + 120580 => 'ι', + 120581 => 'κ', + 120582 => 'λ', + 120583 => 'μ', + 120584 => 'ν', + 120585 => 'ξ', + 120586 => 'ο', + 120587 => 'Ï€', + 120588 => 'Ï', + 120589 => 'σ', + 120590 => 'σ', + 120591 => 'Ï„', + 120592 => 'Ï…', + 120593 => 'φ', + 120594 => 'χ', + 120595 => 'ψ', + 120596 => 'ω', + 120597 => '∂', + 120598 => 'ε', + 120599 => 'θ', + 120600 => 'κ', + 120601 => 'φ', + 120602 => 'Ï', + 120603 => 'Ï€', + 120604 => 'α', + 120605 => 'β', + 120606 => 'γ', + 120607 => 'δ', + 120608 => 'ε', + 120609 => 'ζ', + 120610 => 'η', + 120611 => 'θ', + 120612 => 'ι', + 120613 => 'κ', + 120614 => 'λ', + 120615 => 'μ', + 120616 => 'ν', + 120617 => 'ξ', + 120618 => 'ο', + 120619 => 'Ï€', + 120620 => 'Ï', + 120621 => 'θ', + 120622 => 'σ', + 120623 => 'Ï„', + 120624 => 'Ï…', + 120625 => 'φ', + 120626 => 'χ', + 120627 => 'ψ', + 120628 => 'ω', + 120629 => '∇', + 120630 => 'α', + 120631 => 'β', + 120632 => 'γ', + 120633 => 'δ', + 120634 => 'ε', + 120635 => 'ζ', + 120636 => 'η', + 120637 => 'θ', + 120638 => 'ι', + 120639 => 'κ', + 120640 => 'λ', + 120641 => 'μ', + 120642 => 'ν', + 120643 => 'ξ', + 120644 => 'ο', + 120645 => 'Ï€', + 120646 => 'Ï', + 120647 => 'σ', + 120648 => 'σ', + 120649 => 'Ï„', + 120650 => 'Ï…', + 120651 => 'φ', + 120652 => 'χ', + 120653 => 'ψ', + 120654 => 'ω', + 120655 => '∂', + 120656 => 'ε', + 120657 => 'θ', + 120658 => 'κ', + 120659 => 'φ', + 120660 => 'Ï', + 120661 => 'Ï€', + 120662 => 'α', + 120663 => 'β', + 120664 => 'γ', + 120665 => 'δ', + 120666 => 'ε', + 120667 => 'ζ', + 120668 => 'η', + 120669 => 'θ', + 120670 => 'ι', + 120671 => 'κ', + 120672 => 'λ', + 120673 => 'μ', + 120674 => 'ν', + 120675 => 'ξ', + 120676 => 'ο', + 120677 => 'Ï€', + 120678 => 'Ï', + 120679 => 'θ', + 120680 => 'σ', + 120681 => 'Ï„', + 120682 => 'Ï…', + 120683 => 'φ', + 120684 => 'χ', + 120685 => 'ψ', + 120686 => 'ω', + 120687 => '∇', + 120688 => 'α', + 120689 => 'β', + 120690 => 'γ', + 120691 => 'δ', + 120692 => 'ε', + 120693 => 'ζ', + 120694 => 'η', + 120695 => 'θ', + 120696 => 'ι', + 120697 => 'κ', + 120698 => 'λ', + 120699 => 'μ', + 120700 => 'ν', + 120701 => 'ξ', + 120702 => 'ο', + 120703 => 'Ï€', + 120704 => 'Ï', + 120705 => 'σ', + 120706 => 'σ', + 120707 => 'Ï„', + 120708 => 'Ï…', + 120709 => 'φ', + 120710 => 'χ', + 120711 => 'ψ', + 120712 => 'ω', + 120713 => '∂', + 120714 => 'ε', + 120715 => 'θ', + 120716 => 'κ', + 120717 => 'φ', + 120718 => 'Ï', + 120719 => 'Ï€', + 120720 => 'α', + 120721 => 'β', + 120722 => 'γ', + 120723 => 'δ', + 120724 => 'ε', + 120725 => 'ζ', + 120726 => 'η', + 120727 => 'θ', + 120728 => 'ι', + 120729 => 'κ', + 120730 => 'λ', + 120731 => 'μ', + 120732 => 'ν', + 120733 => 'ξ', + 120734 => 'ο', + 120735 => 'Ï€', + 120736 => 'Ï', + 120737 => 'θ', + 120738 => 'σ', + 120739 => 'Ï„', + 120740 => 'Ï…', + 120741 => 'φ', + 120742 => 'χ', + 120743 => 'ψ', + 120744 => 'ω', + 120745 => '∇', + 120746 => 'α', + 120747 => 'β', + 120748 => 'γ', + 120749 => 'δ', + 120750 => 'ε', + 120751 => 'ζ', + 120752 => 'η', + 120753 => 'θ', + 120754 => 'ι', + 120755 => 'κ', + 120756 => 'λ', + 120757 => 'μ', + 120758 => 'ν', + 120759 => 'ξ', + 120760 => 'ο', + 120761 => 'Ï€', + 120762 => 'Ï', + 120763 => 'σ', + 120764 => 'σ', + 120765 => 'Ï„', + 120766 => 'Ï…', + 120767 => 'φ', + 120768 => 'χ', + 120769 => 'ψ', + 120770 => 'ω', + 120771 => '∂', + 120772 => 'ε', + 120773 => 'θ', + 120774 => 'κ', + 120775 => 'φ', + 120776 => 'Ï', + 120777 => 'Ï€', + 120778 => 'Ï', + 120779 => 'Ï', + 120782 => '0', + 120783 => '1', + 120784 => '2', + 120785 => '3', + 120786 => '4', + 120787 => '5', + 120788 => '6', + 120789 => '7', + 120790 => '8', + 120791 => '9', + 120792 => '0', + 120793 => '1', + 120794 => '2', + 120795 => '3', + 120796 => '4', + 120797 => '5', + 120798 => '6', + 120799 => '7', + 120800 => '8', + 120801 => '9', + 120802 => '0', + 120803 => '1', + 120804 => '2', + 120805 => '3', + 120806 => '4', + 120807 => '5', + 120808 => '6', + 120809 => '7', + 120810 => '8', + 120811 => '9', + 120812 => '0', + 120813 => '1', + 120814 => '2', + 120815 => '3', + 120816 => '4', + 120817 => '5', + 120818 => '6', + 120819 => '7', + 120820 => '8', + 120821 => '9', + 120822 => '0', + 120823 => '1', + 120824 => '2', + 120825 => '3', + 120826 => '4', + 120827 => '5', + 120828 => '6', + 120829 => '7', + 120830 => '8', + 120831 => '9', + 125184 => '𞤢', + 125185 => '𞤣', + 125186 => '𞤤', + 125187 => '𞤥', + 125188 => '𞤦', + 125189 => '𞤧', + 125190 => '𞤨', + 125191 => '𞤩', + 125192 => '𞤪', + 125193 => '𞤫', + 125194 => '𞤬', + 125195 => '𞤭', + 125196 => '𞤮', + 125197 => '𞤯', + 125198 => '𞤰', + 125199 => '𞤱', + 125200 => '𞤲', + 125201 => '𞤳', + 125202 => '𞤴', + 125203 => '𞤵', + 125204 => '𞤶', + 125205 => '𞤷', + 125206 => '𞤸', + 125207 => '𞤹', + 125208 => '𞤺', + 125209 => '𞤻', + 125210 => '𞤼', + 125211 => '𞤽', + 125212 => '𞤾', + 125213 => '𞤿', + 125214 => '𞥀', + 125215 => 'ðž¥', + 125216 => '𞥂', + 125217 => '𞥃', + 126464 => 'ا', + 126465 => 'ب', + 126466 => 'ج', + 126467 => 'د', + 126469 => 'Ùˆ', + 126470 => 'ز', + 126471 => 'Ø­', + 126472 => 'Ø·', + 126473 => 'ÙŠ', + 126474 => 'Ùƒ', + 126475 => 'Ù„', + 126476 => 'Ù…', + 126477 => 'Ù†', + 126478 => 'س', + 126479 => 'ع', + 126480 => 'Ù', + 126481 => 'ص', + 126482 => 'Ù‚', + 126483 => 'ر', + 126484 => 'Ø´', + 126485 => 'ت', + 126486 => 'Ø«', + 126487 => 'Ø®', + 126488 => 'ذ', + 126489 => 'ض', + 126490 => 'ظ', + 126491 => 'غ', + 126492 => 'Ù®', + 126493 => 'Úº', + 126494 => 'Ú¡', + 126495 => 'Ù¯', + 126497 => 'ب', + 126498 => 'ج', + 126500 => 'Ù‡', + 126503 => 'Ø­', + 126505 => 'ÙŠ', + 126506 => 'Ùƒ', + 126507 => 'Ù„', + 126508 => 'Ù…', + 126509 => 'Ù†', + 126510 => 'س', + 126511 => 'ع', + 126512 => 'Ù', + 126513 => 'ص', + 126514 => 'Ù‚', + 126516 => 'Ø´', + 126517 => 'ت', + 126518 => 'Ø«', + 126519 => 'Ø®', + 126521 => 'ض', + 126523 => 'غ', + 126530 => 'ج', + 126535 => 'Ø­', + 126537 => 'ÙŠ', + 126539 => 'Ù„', + 126541 => 'Ù†', + 126542 => 'س', + 126543 => 'ع', + 126545 => 'ص', + 126546 => 'Ù‚', + 126548 => 'Ø´', + 126551 => 'Ø®', + 126553 => 'ض', + 126555 => 'غ', + 126557 => 'Úº', + 126559 => 'Ù¯', + 126561 => 'ب', + 126562 => 'ج', + 126564 => 'Ù‡', + 126567 => 'Ø­', + 126568 => 'Ø·', + 126569 => 'ÙŠ', + 126570 => 'Ùƒ', + 126572 => 'Ù…', + 126573 => 'Ù†', + 126574 => 'س', + 126575 => 'ع', + 126576 => 'Ù', + 126577 => 'ص', + 126578 => 'Ù‚', + 126580 => 'Ø´', + 126581 => 'ت', + 126582 => 'Ø«', + 126583 => 'Ø®', + 126585 => 'ض', + 126586 => 'ظ', + 126587 => 'غ', + 126588 => 'Ù®', + 126590 => 'Ú¡', + 126592 => 'ا', + 126593 => 'ب', + 126594 => 'ج', + 126595 => 'د', + 126596 => 'Ù‡', + 126597 => 'Ùˆ', + 126598 => 'ز', + 126599 => 'Ø­', + 126600 => 'Ø·', + 126601 => 'ÙŠ', + 126603 => 'Ù„', + 126604 => 'Ù…', + 126605 => 'Ù†', + 126606 => 'س', + 126607 => 'ع', + 126608 => 'Ù', + 126609 => 'ص', + 126610 => 'Ù‚', + 126611 => 'ر', + 126612 => 'Ø´', + 126613 => 'ت', + 126614 => 'Ø«', + 126615 => 'Ø®', + 126616 => 'ذ', + 126617 => 'ض', + 126618 => 'ظ', + 126619 => 'غ', + 126625 => 'ب', + 126626 => 'ج', + 126627 => 'د', + 126629 => 'Ùˆ', + 126630 => 'ز', + 126631 => 'Ø­', + 126632 => 'Ø·', + 126633 => 'ÙŠ', + 126635 => 'Ù„', + 126636 => 'Ù…', + 126637 => 'Ù†', + 126638 => 'س', + 126639 => 'ع', + 126640 => 'Ù', + 126641 => 'ص', + 126642 => 'Ù‚', + 126643 => 'ر', + 126644 => 'Ø´', + 126645 => 'ت', + 126646 => 'Ø«', + 126647 => 'Ø®', + 126648 => 'ذ', + 126649 => 'ض', + 126650 => 'ظ', + 126651 => 'غ', + 127274 => '〔s〕', + 127275 => 'c', + 127276 => 'r', + 127277 => 'cd', + 127278 => 'wz', + 127280 => 'a', + 127281 => 'b', + 127282 => 'c', + 127283 => 'd', + 127284 => 'e', + 127285 => 'f', + 127286 => 'g', + 127287 => 'h', + 127288 => 'i', + 127289 => 'j', + 127290 => 'k', + 127291 => 'l', + 127292 => 'm', + 127293 => 'n', + 127294 => 'o', + 127295 => 'p', + 127296 => 'q', + 127297 => 'r', + 127298 => 's', + 127299 => 't', + 127300 => 'u', + 127301 => 'v', + 127302 => 'w', + 127303 => 'x', + 127304 => 'y', + 127305 => 'z', + 127306 => 'hv', + 127307 => 'mv', + 127308 => 'sd', + 127309 => 'ss', + 127310 => 'ppv', + 127311 => 'wc', + 127338 => 'mc', + 127339 => 'md', + 127340 => 'mr', + 127376 => 'dj', + 127488 => 'ã»ã‹', + 127489 => 'ココ', + 127490 => 'サ', + 127504 => '手', + 127505 => 'å­—', + 127506 => 'åŒ', + 127507 => 'デ', + 127508 => '二', + 127509 => '多', + 127510 => 'è§£', + 127511 => '天', + 127512 => '交', + 127513 => '映', + 127514 => 'ç„¡', + 127515 => 'æ–™', + 127516 => 'å‰', + 127517 => '後', + 127518 => 'å†', + 127519 => 'æ–°', + 127520 => 'åˆ', + 127521 => '終', + 127522 => '生', + 127523 => '販', + 127524 => '声', + 127525 => 'å¹', + 127526 => 'æ¼”', + 127527 => '投', + 127528 => 'æ•', + 127529 => '一', + 127530 => '三', + 127531 => 'éŠ', + 127532 => 'å·¦', + 127533 => '中', + 127534 => 'å³', + 127535 => '指', + 127536 => 'èµ°', + 127537 => '打', + 127538 => 'ç¦', + 127539 => '空', + 127540 => 'åˆ', + 127541 => '満', + 127542 => '有', + 127543 => '月', + 127544 => '申', + 127545 => '割', + 127546 => 'å–¶', + 127547 => 'é…', + 127552 => '〔本〕', + 127553 => '〔三〕', + 127554 => '〔二〕', + 127555 => '〔安〕', + 127556 => '〔点〕', + 127557 => '〔打〕', + 127558 => '〔盗〕', + 127559 => '〔å‹ã€•', + 127560 => '〔敗〕', + 127568 => 'å¾—', + 127569 => 'å¯', + 130032 => '0', + 130033 => '1', + 130034 => '2', + 130035 => '3', + 130036 => '4', + 130037 => '5', + 130038 => '6', + 130039 => '7', + 130040 => '8', + 130041 => '9', + 194560 => '丽', + 194561 => '丸', + 194562 => 'ä¹', + 194563 => 'ð „¢', + 194564 => 'ä½ ', + 194565 => 'ä¾®', + 194566 => 'ä¾»', + 194567 => '倂', + 194568 => 'åº', + 194569 => 'å‚™', + 194570 => '僧', + 194571 => 'åƒ', + 194572 => 'ã’ž', + 194573 => '𠘺', + 194574 => 'å…', + 194575 => 'å…”', + 194576 => 'å…¤', + 194577 => 'å…·', + 194578 => '𠔜', + 194579 => 'ã’¹', + 194580 => 'å…§', + 194581 => 'å†', + 194582 => 'ð •‹', + 194583 => '冗', + 194584 => '冤', + 194585 => '仌', + 194586 => '冬', + 194587 => '况', + 194588 => '𩇟', + 194589 => '凵', + 194590 => '刃', + 194591 => '㓟', + 194592 => '刻', + 194593 => '剆', + 194594 => '割', + 194595 => '剷', + 194596 => '㔕', + 194597 => '勇', + 194598 => '勉', + 194599 => '勤', + 194600 => '勺', + 194601 => '包', + 194602 => '匆', + 194603 => '北', + 194604 => 'å‰', + 194605 => 'å‘', + 194606 => 'åš', + 194607 => 'å³', + 194608 => 'å½', + 194609 => 'å¿', + 194610 => 'å¿', + 194611 => 'å¿', + 194612 => '𠨬', + 194613 => 'ç°', + 194614 => 'åŠ', + 194615 => 'åŸ', + 194616 => 'ð ­£', + 194617 => 'å«', + 194618 => 'å±', + 194619 => 'å†', + 194620 => 'å’ž', + 194621 => 'å¸', + 194622 => '呈', + 194623 => '周', + 194624 => 'å’¢', + 194625 => 'å“¶', + 194626 => 'å”', + 194627 => 'å•“', + 194628 => 'å•£', + 194629 => 'å–„', + 194630 => 'å–„', + 194631 => 'å–™', + 194632 => 'å–«', + 194633 => 'å–³', + 194634 => 'å—‚', + 194635 => '圖', + 194636 => '嘆', + 194637 => '圗', + 194638 => '噑', + 194639 => 'å™´', + 194640 => '切', + 194641 => '壮', + 194642 => '城', + 194643 => '埴', + 194644 => 'å ', + 194645 => 'åž‹', + 194646 => 'å ²', + 194647 => 'å ±', + 194648 => '墬', + 194649 => '𡓤', + 194650 => '売', + 194651 => '壷', + 194652 => '夆', + 194653 => '多', + 194654 => '夢', + 194655 => '奢', + 194656 => '𡚨', + 194657 => '𡛪', + 194658 => '姬', + 194659 => '娛', + 194660 => '娧', + 194661 => '姘', + 194662 => '婦', + 194663 => 'ã›®', + 194665 => '嬈', + 194666 => '嬾', + 194667 => '嬾', + 194668 => '𡧈', + 194669 => '寃', + 194670 => '寘', + 194671 => '寧', + 194672 => '寳', + 194673 => '𡬘', + 194674 => '寿', + 194675 => 'å°†', + 194677 => 'å°¢', + 194678 => 'ãž', + 194679 => 'å± ', + 194680 => 'å±®', + 194681 => 'å³€', + 194682 => 'å²', + 194683 => 'ð¡·¤', + 194684 => '嵃', + 194685 => 'ð¡·¦', + 194686 => 'åµ®', + 194687 => '嵫', + 194688 => 'åµ¼', + 194689 => 'å·¡', + 194690 => 'å·¢', + 194691 => 'ã ¯', + 194692 => 'å·½', + 194693 => '帨', + 194694 => '帽', + 194695 => '幩', + 194696 => 'ã¡¢', + 194697 => '𢆃', + 194698 => '㡼', + 194699 => '庰', + 194700 => '庳', + 194701 => '庶', + 194702 => '廊', + 194703 => '𪎒', + 194704 => '廾', + 194705 => '𢌱', + 194706 => '𢌱', + 194707 => 'èˆ', + 194708 => 'å¼¢', + 194709 => 'å¼¢', + 194710 => '㣇', + 194711 => '𣊸', + 194712 => '𦇚', + 194713 => 'å½¢', + 194714 => '彫', + 194715 => '㣣', + 194716 => '徚', + 194717 => 'å¿', + 194718 => 'å¿—', + 194719 => '忹', + 194720 => 'æ‚', + 194721 => '㤺', + 194722 => '㤜', + 194723 => 'æ‚”', + 194724 => '𢛔', + 194725 => '惇', + 194726 => 'æ…ˆ', + 194727 => 'æ…Œ', + 194728 => 'æ…Ž', + 194729 => 'æ…Œ', + 194730 => 'æ…º', + 194731 => '憎', + 194732 => '憲', + 194733 => '憤', + 194734 => '憯', + 194735 => '懞', + 194736 => '懲', + 194737 => '懶', + 194738 => 'æˆ', + 194739 => '戛', + 194740 => 'æ‰', + 194741 => '抱', + 194742 => 'æ‹”', + 194743 => 'æ', + 194744 => '𢬌', + 194745 => '挽', + 194746 => '拼', + 194747 => 'æ¨', + 194748 => '掃', + 194749 => 'æ¤', + 194750 => '𢯱', + 194751 => 'æ¢', + 194752 => 'æ…', + 194753 => '掩', + 194754 => '㨮', + 194755 => 'æ‘©', + 194756 => '摾', + 194757 => 'æ’', + 194758 => 'æ‘·', + 194759 => '㩬', + 194760 => 'æ•', + 194761 => '敬', + 194762 => '𣀊', + 194763 => 'æ—£', + 194764 => '書', + 194765 => '晉', + 194766 => '㬙', + 194767 => 'æš‘', + 194768 => '㬈', + 194769 => '㫤', + 194770 => '冒', + 194771 => '冕', + 194772 => '最', + 194773 => 'æšœ', + 194774 => 'è‚­', + 194775 => 'ä™', + 194776 => '朗', + 194777 => '望', + 194778 => '朡', + 194779 => 'æž', + 194780 => 'æ“', + 194781 => 'ð£ƒ', + 194782 => 'ã­‰', + 194783 => '柺', + 194784 => 'æž…', + 194785 => 'æ¡’', + 194786 => '梅', + 194787 => '𣑭', + 194788 => '梎', + 194789 => 'æ Ÿ', + 194790 => '椔', + 194791 => 'ã®', + 194792 => '楂', + 194793 => '榣', + 194794 => '槪', + 194795 => '檨', + 194796 => '𣚣', + 194797 => 'æ«›', + 194798 => 'ã°˜', + 194799 => '次', + 194800 => '𣢧', + 194801 => 'æ­”', + 194802 => '㱎', + 194803 => 'æ­²', + 194804 => '殟', + 194805 => '殺', + 194806 => 'æ®»', + 194807 => 'ð£ª', + 194808 => 'ð¡´‹', + 194809 => '𣫺', + 194810 => '汎', + 194811 => '𣲼', + 194812 => '沿', + 194813 => 'æ³', + 194814 => 'æ±§', + 194815 => 'æ´–', + 194816 => 'æ´¾', + 194817 => 'æµ·', + 194818 => 'æµ', + 194819 => '浩', + 194820 => '浸', + 194821 => 'æ¶…', + 194822 => '𣴞', + 194823 => 'æ´´', + 194824 => '港', + 194825 => 'æ¹®', + 194826 => 'ã´³', + 194827 => '滋', + 194828 => '滇', + 194829 => '𣻑', + 194830 => 'æ·¹', + 194831 => 'æ½®', + 194832 => '𣽞', + 194833 => '𣾎', + 194834 => '濆', + 194835 => '瀹', + 194836 => '瀞', + 194837 => '瀛', + 194838 => 'ã¶–', + 194839 => 'çŠ', + 194840 => 'ç½', + 194841 => 'ç·', + 194842 => 'ç‚­', + 194843 => '𠔥', + 194844 => 'ç……', + 194845 => '𤉣', + 194846 => '熜', + 194848 => '爨', + 194849 => '爵', + 194850 => 'ç‰', + 194851 => '𤘈', + 194852 => '犀', + 194853 => '犕', + 194854 => '𤜵', + 194855 => '𤠔', + 194856 => 'çº', + 194857 => '王', + 194858 => '㺬', + 194859 => '玥', + 194860 => '㺸', + 194861 => '㺸', + 194862 => '瑇', + 194863 => '瑜', + 194864 => '瑱', + 194865 => 'ç’…', + 194866 => '瓊', + 194867 => 'ã¼›', + 194868 => '甤', + 194869 => '𤰶', + 194870 => '甾', + 194871 => '𤲒', + 194872 => 'ç•°', + 194873 => '𢆟', + 194874 => 'ç˜', + 194875 => '𤾡', + 194876 => '𤾸', + 194877 => 'ð¥„', + 194878 => '㿼', + 194879 => '䀈', + 194880 => 'ç›´', + 194881 => '𥃳', + 194882 => '𥃲', + 194883 => '𥄙', + 194884 => '𥄳', + 194885 => '眞', + 194886 => '真', + 194887 => '真', + 194888 => 'çŠ', + 194889 => '䀹', + 194890 => 'çž‹', + 194891 => 'ä†', + 194892 => 'ä‚–', + 194893 => 'ð¥', + 194894 => '硎', + 194895 => '碌', + 194896 => '磌', + 194897 => '䃣', + 194898 => '𥘦', + 194899 => '祖', + 194900 => '𥚚', + 194901 => '𥛅', + 194902 => 'ç¦', + 194903 => 'ç§«', + 194904 => '䄯', + 194905 => 'ç©€', + 194906 => '穊', + 194907 => 'ç©', + 194908 => '𥥼', + 194909 => '𥪧', + 194910 => '𥪧', + 194912 => '䈂', + 194913 => '𥮫', + 194914 => '篆', + 194915 => '築', + 194916 => '䈧', + 194917 => '𥲀', + 194918 => 'ç³’', + 194919 => '䊠', + 194920 => '糨', + 194921 => 'ç³£', + 194922 => 'ç´€', + 194923 => '𥾆', + 194924 => 'çµ£', + 194925 => 'äŒ', + 194926 => 'ç·‡', + 194927 => '縂', + 194928 => 'ç¹…', + 194929 => '䌴', + 194930 => '𦈨', + 194931 => '𦉇', + 194932 => 'ä™', + 194933 => '𦋙', + 194934 => '罺', + 194935 => '𦌾', + 194936 => '羕', + 194937 => '翺', + 194938 => '者', + 194939 => '𦓚', + 194940 => '𦔣', + 194941 => 'è ', + 194942 => '𦖨', + 194943 => 'è°', + 194944 => 'ð£Ÿ', + 194945 => 'ä•', + 194946 => '育', + 194947 => '脃', + 194948 => 'ä‹', + 194949 => '脾', + 194950 => '媵', + 194951 => '𦞧', + 194952 => '𦞵', + 194953 => '𣎓', + 194954 => '𣎜', + 194955 => 'èˆ', + 194956 => '舄', + 194957 => '辞', + 194958 => 'ä‘«', + 194959 => '芑', + 194960 => '芋', + 194961 => 'èŠ', + 194962 => '劳', + 194963 => '花', + 194964 => '芳', + 194965 => '芽', + 194966 => '苦', + 194967 => '𦬼', + 194968 => 'è‹¥', + 194969 => 'èŒ', + 194970 => 'è£', + 194971 => '莭', + 194972 => '茣', + 194973 => '莽', + 194974 => 'è§', + 194975 => 'è‘—', + 194976 => 'è“', + 194977 => 'èŠ', + 194978 => 'èŒ', + 194979 => 'èœ', + 194980 => '𦰶', + 194981 => '𦵫', + 194982 => '𦳕', + 194983 => '䔫', + 194984 => '蓱', + 194985 => '蓳', + 194986 => 'è”–', + 194987 => 'ð§Š', + 194988 => '蕤', + 194989 => '𦼬', + 194990 => 'ä•', + 194991 => 'ä•¡', + 194992 => '𦾱', + 194993 => '𧃒', + 194994 => 'ä•«', + 194995 => 'è™', + 194996 => '虜', + 194997 => 'è™§', + 194998 => '虩', + 194999 => 'èš©', + 195000 => '蚈', + 195001 => '蜎', + 195002 => '蛢', + 195003 => 'è¹', + 195004 => '蜨', + 195005 => 'è«', + 195006 => '螆', + 195008 => '蟡', + 195009 => 'è ', + 195010 => 'ä—¹', + 195011 => 'è¡ ', + 195012 => 'è¡£', + 195013 => 'ð§™§', + 195014 => '裗', + 195015 => '裞', + 195016 => '䘵', + 195017 => '裺', + 195018 => 'ã’»', + 195019 => 'ð§¢®', + 195020 => '𧥦', + 195021 => 'äš¾', + 195022 => '䛇', + 195023 => '誠', + 195024 => 'è«­', + 195025 => '變', + 195026 => '豕', + 195027 => '𧲨', + 195028 => '貫', + 195029 => 'è³', + 195030 => 'è´›', + 195031 => 'èµ·', + 195032 => '𧼯', + 195033 => 'ð  „', + 195034 => 'è·‹', + 195035 => 'è¶¼', + 195036 => 'è·°', + 195037 => '𠣞', + 195038 => 'è»”', + 195039 => '輸', + 195040 => '𨗒', + 195041 => '𨗭', + 195042 => 'é‚”', + 195043 => '郱', + 195044 => 'é„‘', + 195045 => '𨜮', + 195046 => 'é„›', + 195047 => '鈸', + 195048 => 'é‹—', + 195049 => '鋘', + 195050 => '鉼', + 195051 => 'é¹', + 195052 => 'é•', + 195053 => '𨯺', + 195054 => 'é–‹', + 195055 => '䦕', + 195056 => 'é–·', + 195057 => '𨵷', + 195058 => '䧦', + 195059 => '雃', + 195060 => 'å¶²', + 195061 => '霣', + 195062 => 'ð©……', + 195063 => '𩈚', + 195064 => 'ä©®', + 195065 => 'ä©¶', + 195066 => '韠', + 195067 => 'ð©Š', + 195068 => '䪲', + 195069 => 'ð©’–', + 195070 => 'é ‹', + 195071 => 'é ‹', + 195072 => 'é ©', + 195073 => 'ð©–¶', + 195074 => '飢', + 195075 => '䬳', + 195076 => '餩', + 195077 => '馧', + 195078 => 'é§‚', + 195079 => 'é§¾', + 195080 => '䯎', + 195081 => '𩬰', + 195082 => '鬒', + 195083 => 'é±€', + 195084 => 'é³½', + 195085 => '䳎', + 195086 => 'ä³­', + 195087 => 'éµ§', + 195088 => '𪃎', + 195089 => '䳸', + 195090 => '𪄅', + 195091 => '𪈎', + 195092 => '𪊑', + 195093 => '麻', + 195094 => 'äµ–', + 195095 => '黹', + 195096 => '黾', + 195097 => 'é¼…', + 195098 => 'é¼', + 195099 => 'é¼–', + 195100 => 'é¼»', + 195101 => '𪘀', +); diff --git a/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php b/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php new file mode 100644 index 0000000000..1958e37ed2 --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/Resources/unidata/virama.php @@ -0,0 +1,65 @@ +<?php + +return array ( + 2381 => 9, + 2509 => 9, + 2637 => 9, + 2765 => 9, + 2893 => 9, + 3021 => 9, + 3149 => 9, + 3277 => 9, + 3387 => 9, + 3388 => 9, + 3405 => 9, + 3530 => 9, + 3642 => 9, + 3770 => 9, + 3972 => 9, + 4153 => 9, + 4154 => 9, + 5908 => 9, + 5940 => 9, + 6098 => 9, + 6752 => 9, + 6980 => 9, + 7082 => 9, + 7083 => 9, + 7154 => 9, + 7155 => 9, + 11647 => 9, + 43014 => 9, + 43052 => 9, + 43204 => 9, + 43347 => 9, + 43456 => 9, + 43766 => 9, + 44013 => 9, + 68159 => 9, + 69702 => 9, + 69759 => 9, + 69817 => 9, + 69939 => 9, + 69940 => 9, + 70080 => 9, + 70197 => 9, + 70378 => 9, + 70477 => 9, + 70722 => 9, + 70850 => 9, + 71103 => 9, + 71231 => 9, + 71350 => 9, + 71467 => 9, + 71737 => 9, + 71997 => 9, + 71998 => 9, + 72160 => 9, + 72244 => 9, + 72263 => 9, + 72345 => 9, + 72767 => 9, + 73028 => 9, + 73029 => 9, + 73111 => 9, +); diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap.php b/vendor/symfony/polyfill-intl-idn/bootstrap.php index b29d4e509d..57c78356c9 100644 --- a/vendor/symfony/polyfill-intl-idn/bootstrap.php +++ b/vendor/symfony/polyfill-intl-idn/bootstrap.php @@ -11,51 +11,135 @@ use Symfony\Polyfill\Intl\Idn as p; -if (!defined('IDNA_DEFAULT')) { +if (extension_loaded('intl')) { + return; +} + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!defined('U_IDNA_PROHIBITED_ERROR')) { define('U_IDNA_PROHIBITED_ERROR', 66560); +} +if (!defined('U_IDNA_ERROR_START')) { define('U_IDNA_ERROR_START', 66560); +} +if (!defined('U_IDNA_UNASSIGNED_ERROR')) { define('U_IDNA_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { define('U_IDNA_CHECK_BIDI_ERROR', 66562); +} +if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); +} +if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { define('U_IDNA_ACE_PREFIX_ERROR', 66564); +} +if (!defined('U_IDNA_VERIFICATION_ERROR')) { define('U_IDNA_VERIFICATION_ERROR', 66565); +} +if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); +} +if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); +} +if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); +} +if (!defined('U_IDNA_ERROR_LIMIT')) { define('U_IDNA_ERROR_LIMIT', 66569); +} +if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { define('U_STRINGPREP_PROHIBITED_ERROR', 66560); +} +if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); +} +if (!defined('IDNA_DEFAULT')) { define('IDNA_DEFAULT', 0); +} +if (!defined('IDNA_ALLOW_UNASSIGNED')) { define('IDNA_ALLOW_UNASSIGNED', 1); +} +if (!defined('IDNA_USE_STD3_RULES')) { define('IDNA_USE_STD3_RULES', 2); +} +if (!defined('IDNA_CHECK_BIDI')) { define('IDNA_CHECK_BIDI', 4); +} +if (!defined('IDNA_CHECK_CONTEXTJ')) { define('IDNA_CHECK_CONTEXTJ', 8); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); +} +if (!defined('INTL_IDNA_VARIANT_2003')) { define('INTL_IDNA_VARIANT_2003', 0); +} +if (!defined('INTL_IDNA_VARIANT_UTS46')) { define('INTL_IDNA_VARIANT_UTS46', 1); +} +if (!defined('IDNA_ERROR_EMPTY_LABEL')) { define('IDNA_ERROR_EMPTY_LABEL', 1); +} +if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { define('IDNA_ERROR_LABEL_TOO_LONG', 2); +} +if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); +} +if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { define('IDNA_ERROR_LEADING_HYPHEN', 8); +} +if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { define('IDNA_ERROR_TRAILING_HYPHEN', 16); +} +if (!defined('IDNA_ERROR_HYPHEN_3_4')) { define('IDNA_ERROR_HYPHEN_3_4', 32); +} +if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); +} +if (!defined('IDNA_ERROR_DISALLOWED')) { define('IDNA_ERROR_DISALLOWED', 128); +} +if (!defined('IDNA_ERROR_PUNYCODE')) { define('IDNA_ERROR_PUNYCODE', 256); +} +if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { define('IDNA_ERROR_LABEL_HAS_DOT', 512); +} +if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); +} +if (!defined('IDNA_ERROR_BIDI')) { define('IDNA_ERROR_BIDI', 2048); +} +if (!defined('IDNA_ERROR_CONTEXTJ')) { define('IDNA_ERROR_CONTEXTJ', 4096); } -if (!function_exists('idn_to_ascii')) { - if (PHP_VERSION_ID < 70400) { - function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); } - function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_2003, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); } - } else { - function idn_to_ascii($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_ascii($domain, $options, $variant, $idna_info); } - function idn_to_utf8($domain, $options = IDNA_DEFAULT, $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = array()) { return p\Idn::idn_to_utf8($domain, $options, $variant, $idna_info); } +if (\PHP_VERSION_ID < 70400) { + if (!function_exists('idn_to_ascii')) { + function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } + } + if (!function_exists('idn_to_utf8')) { + function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } + } +} else { + if (!function_exists('idn_to_ascii')) { + function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); } + } + if (!function_exists('idn_to_utf8')) { + function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); } } } diff --git a/vendor/symfony/polyfill-intl-idn/bootstrap80.php b/vendor/symfony/polyfill-intl-idn/bootstrap80.php new file mode 100644 index 0000000000..a62c2d69bf --- /dev/null +++ b/vendor/symfony/polyfill-intl-idn/bootstrap80.php @@ -0,0 +1,125 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Idn as p; + +if (!defined('U_IDNA_PROHIBITED_ERROR')) { + define('U_IDNA_PROHIBITED_ERROR', 66560); +} +if (!defined('U_IDNA_ERROR_START')) { + define('U_IDNA_ERROR_START', 66560); +} +if (!defined('U_IDNA_UNASSIGNED_ERROR')) { + define('U_IDNA_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_IDNA_CHECK_BIDI_ERROR')) { + define('U_IDNA_CHECK_BIDI_ERROR', 66562); +} +if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) { + define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563); +} +if (!defined('U_IDNA_ACE_PREFIX_ERROR')) { + define('U_IDNA_ACE_PREFIX_ERROR', 66564); +} +if (!defined('U_IDNA_VERIFICATION_ERROR')) { + define('U_IDNA_VERIFICATION_ERROR', 66565); +} +if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) { + define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566); +} +if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) { + define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567); +} +if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) { + define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568); +} +if (!defined('U_IDNA_ERROR_LIMIT')) { + define('U_IDNA_ERROR_LIMIT', 66569); +} +if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) { + define('U_STRINGPREP_PROHIBITED_ERROR', 66560); +} +if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) { + define('U_STRINGPREP_UNASSIGNED_ERROR', 66561); +} +if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) { + define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562); +} +if (!defined('IDNA_DEFAULT')) { + define('IDNA_DEFAULT', 0); +} +if (!defined('IDNA_ALLOW_UNASSIGNED')) { + define('IDNA_ALLOW_UNASSIGNED', 1); +} +if (!defined('IDNA_USE_STD3_RULES')) { + define('IDNA_USE_STD3_RULES', 2); +} +if (!defined('IDNA_CHECK_BIDI')) { + define('IDNA_CHECK_BIDI', 4); +} +if (!defined('IDNA_CHECK_CONTEXTJ')) { + define('IDNA_CHECK_CONTEXTJ', 8); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) { + define('IDNA_NONTRANSITIONAL_TO_ASCII', 16); +} +if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) { + define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32); +} +if (!defined('INTL_IDNA_VARIANT_UTS46')) { + define('INTL_IDNA_VARIANT_UTS46', 1); +} +if (!defined('IDNA_ERROR_EMPTY_LABEL')) { + define('IDNA_ERROR_EMPTY_LABEL', 1); +} +if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) { + define('IDNA_ERROR_LABEL_TOO_LONG', 2); +} +if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) { + define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4); +} +if (!defined('IDNA_ERROR_LEADING_HYPHEN')) { + define('IDNA_ERROR_LEADING_HYPHEN', 8); +} +if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) { + define('IDNA_ERROR_TRAILING_HYPHEN', 16); +} +if (!defined('IDNA_ERROR_HYPHEN_3_4')) { + define('IDNA_ERROR_HYPHEN_3_4', 32); +} +if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) { + define('IDNA_ERROR_LEADING_COMBINING_MARK', 64); +} +if (!defined('IDNA_ERROR_DISALLOWED')) { + define('IDNA_ERROR_DISALLOWED', 128); +} +if (!defined('IDNA_ERROR_PUNYCODE')) { + define('IDNA_ERROR_PUNYCODE', 256); +} +if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) { + define('IDNA_ERROR_LABEL_HAS_DOT', 512); +} +if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) { + define('IDNA_ERROR_INVALID_ACE_LABEL', 1024); +} +if (!defined('IDNA_ERROR_BIDI')) { + define('IDNA_ERROR_BIDI', 2048); +} +if (!defined('IDNA_ERROR_CONTEXTJ')) { + define('IDNA_ERROR_CONTEXTJ', 4096); +} + +if (!function_exists('idn_to_ascii')) { + function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); } +} +if (!function_exists('idn_to_utf8')) { + function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); } +} diff --git a/vendor/symfony/polyfill-intl-idn/composer.json b/vendor/symfony/polyfill-intl-idn/composer.json index ef2c00682c..760debcd2f 100644 --- a/vendor/symfony/polyfill-intl-idn/composer.json +++ b/vendor/symfony/polyfill-intl-idn/composer.json @@ -10,15 +10,18 @@ "name": "Laurent Bassin", "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, @@ -29,8 +32,9 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } } } diff --git a/vendor/symfony/polyfill-php72/LICENSE b/vendor/symfony/polyfill-intl-normalizer/LICENSE similarity index 95% rename from vendor/symfony/polyfill-php72/LICENSE rename to vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd300..6e3afce692 100644 --- a/vendor/symfony/polyfill-php72/LICENSE +++ b/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php new file mode 100644 index 0000000000..81704ab376 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -0,0 +1,310 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Intl\Normalizer; + +/** + * Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension. + * + * It has been validated with Unicode 6.3 Normalization Conformance Test. + * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. + * + * @author Nicolas Grekas <p@tchwork.com> + * + * @internal + */ +class Normalizer +{ + public const FORM_D = \Normalizer::FORM_D; + public const FORM_KD = \Normalizer::FORM_KD; + public const FORM_C = \Normalizer::FORM_C; + public const FORM_KC = \Normalizer::FORM_KC; + public const NFD = \Normalizer::NFD; + public const NFKD = \Normalizer::NFKD; + public const NFC = \Normalizer::NFC; + public const NFKC = \Normalizer::NFKC; + + private static $C; + private static $D; + private static $KD; + private static $cC; + private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; + + public static function isNormalized(string $s, int $form = self::FORM_C) + { + if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { + return false; + } + if (!isset($s[strspn($s, self::$ASCII)])) { + return true; + } + if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { + return true; + } + + return self::normalize($s, $form) === $s; + } + + public static function normalize(string $s, int $form = self::FORM_C) + { + if (!preg_match('//u', $s)) { + return false; + } + + switch ($form) { + case self::NFC: $C = true; $K = false; break; + case self::NFD: $C = false; $K = false; break; + case self::NFKC: $C = true; $K = true; break; + case self::NFKD: $C = false; $K = true; break; + default: + if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { + return $s; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); + } + + if ('' === $s) { + return ''; + } + + if ($K && null === self::$KD) { + self::$KD = self::getData('compatibilityDecomposition'); + } + + if (null === self::$D) { + self::$D = self::getData('canonicalDecomposition'); + self::$cC = self::getData('combiningClass'); + } + + if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { + mb_internal_encoding('8bit'); + } + + $r = self::decompose($s, $K); + + if ($C) { + if (null === self::$C) { + self::$C = self::getData('canonicalComposition'); + } + + $r = self::recompose($r); + } + if (null !== $mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + return $r; + } + + private static function recompose($s) + { + $ASCII = self::$ASCII; + $compMap = self::$C; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + + $result = $tail = ''; + + $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; + $len = \strlen($s); + + $lastUchr = substr($s, 0, $i); + $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + if ($j = strspn($s, $ASCII, $i + 1)) { + $lastUchr .= substr($s, $i, $j); + $i += $j; + } + + $result .= $lastUchr; + $lastUchr = $s[$i]; + $lastUcls = 0; + ++$i; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + + if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr + || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr + || $lastUcls) { + // Table lookup and combining chars composition + + $ucls = $combClass[$uchr] ?? 0; + + if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { + $lastUchr = $compMap[$lastUchr.$uchr]; + } elseif ($lastUcls = $ucls) { + $tail .= $uchr; + } else { + if ($tail) { + $lastUchr .= $tail; + $tail = ''; + } + + $result .= $lastUchr; + $lastUchr = $uchr; + } + } else { + // Hangul chars + + $L = \ord($lastUchr[2]) - 0x80; + $V = \ord($uchr[2]) - 0xA1; + $T = 0; + + $uchr = substr($s, $i + $ulen, 3); + + if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { + $T = \ord($uchr[2]) - 0xA7; + 0 > $T && $T += 0x40; + $ulen += 3; + } + + $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; + $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); + } + + $i += $ulen; + } + + return $result.$lastUchr.$tail; + } + + private static function decompose($s, $c) + { + $result = ''; + + $ASCII = self::$ASCII; + $decompMap = self::$D; + $combClass = self::$cC; + $ulenMask = self::$ulenMask; + if ($c) { + $compatMap = self::$KD; + } + + $c = []; + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + if ($s[$i] < "\x80") { + // ASCII chars + + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $j = 1 + strspn($s, $ASCII, $i + 1); + $result .= substr($s, $i, $j); + $i += $j; + continue; + } + + $ulen = $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { + // Table lookup + + if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { + $uchr = $j; + + $j = \strlen($uchr); + $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; + + if ($ulen != $j) { + // Put trailing chars in $s + + $j -= $ulen; + $i -= $j; + + if (0 > $i) { + $s = str_repeat(' ', -$i).$s; + $len -= $i; + $i = 0; + } + + while ($j--) { + $s[$i + $j] = $uchr[$ulen + $j]; + } + + $uchr = substr($uchr, 0, $ulen); + } + } + if (isset($combClass[$uchr])) { + // Combining chars, for sorting + + if (!isset($c[$combClass[$uchr]])) { + $c[$combClass[$uchr]] = ''; + } + $c[$combClass[$uchr]] .= $uchr; + continue; + } + } else { + // Hangul chars + + $uchr = unpack('C*', $uchr); + $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; + + $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) + ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); + + if ($j %= 28) { + $uchr .= $j < 25 + ? ("\xE1\x86".\chr(0xA7 + $j)) + : ("\xE1\x87".\chr(0x67 + $j)); + } + } + if ($c) { + ksort($c); + $result .= implode('', $c); + $c = []; + } + + $result .= $uchr; + } + + if ($c) { + ksort($c); + $result .= implode('', $c); + } + + return $result; + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } +} diff --git a/vendor/symfony/polyfill-intl-normalizer/README.md b/vendor/symfony/polyfill-intl-normalizer/README.md new file mode 100644 index 0000000000..b9b762e850 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/README.md @@ -0,0 +1,14 @@ +Symfony Polyfill / Intl: Normalizer +=================================== + +This component provides a fallback implementation for the +[`Normalizer`](https://php.net/Normalizer) class provided +by the [Intl](https://php.net/intl) extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php new file mode 100644 index 0000000000..0fdfc890a2 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php @@ -0,0 +1,17 @@ +<?php + +class Normalizer extends Symfony\Polyfill\Intl\Normalizer\Normalizer +{ + /** + * @deprecated since ICU 56 and removed in PHP 8 + */ + public const NONE = 2; + public const FORM_D = 4; + public const FORM_KD = 8; + public const FORM_C = 16; + public const FORM_KC = 32; + public const NFD = 4; + public const NFKD = 8; + public const NFC = 16; + public const NFKC = 32; +} diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php new file mode 100644 index 0000000000..db4764419e --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php @@ -0,0 +1,945 @@ +<?php + +return array ( + 'AÌ€' => 'À', + 'AÌ' => 'Ã', + 'AÌ‚' => 'Â', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'AÌŠ' => 'Ã…', + 'Ç' => 'Ç', + 'EÌ€' => 'È', + 'EÌ' => 'É', + 'EÌ‚' => 'Ê', + 'Ë' => 'Ë', + 'IÌ€' => 'ÃŒ', + 'IÌ' => 'Ã', + 'IÌ‚' => 'ÃŽ', + 'Ï' => 'Ã', + 'Ñ' => 'Ñ', + 'OÌ€' => 'Ã’', + 'OÌ' => 'Ó', + 'OÌ‚' => 'Ô', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'UÌ€' => 'Ù', + 'UÌ' => 'Ú', + 'UÌ‚' => 'Û', + 'Ü' => 'Ü', + 'YÌ' => 'Ã', + 'aÌ€' => 'à', + 'aÌ' => 'á', + 'aÌ‚' => 'â', + 'ã' => 'ã', + 'ä' => 'ä', + 'aÌŠ' => 'Ã¥', + 'ç' => 'ç', + 'eÌ€' => 'è', + 'eÌ' => 'é', + 'eÌ‚' => 'ê', + 'ë' => 'ë', + 'iÌ€' => 'ì', + 'iÌ' => 'í', + 'iÌ‚' => 'î', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'oÌ€' => 'ò', + 'oÌ' => 'ó', + 'oÌ‚' => 'ô', + 'õ' => 'õ', + 'ö' => 'ö', + 'uÌ€' => 'ù', + 'uÌ' => 'ú', + 'uÌ‚' => 'û', + 'ü' => 'ü', + 'yÌ' => 'ý', + 'ÿ' => 'ÿ', + 'AÌ„' => 'Ä€', + 'aÌ„' => 'Ä', + 'Ă' => 'Ä‚', + 'ă' => 'ă', + 'Ą' => 'Ä„', + 'ą' => 'Ä…', + 'CÌ' => 'Ć', + 'cÌ' => 'ć', + 'CÌ‚' => 'Ĉ', + 'cÌ‚' => 'ĉ', + 'Ċ' => 'ÄŠ', + 'ċ' => 'Ä‹', + 'CÌŒ' => 'ÄŒ', + 'cÌŒ' => 'Ä', + 'DÌŒ' => 'ÄŽ', + 'dÌŒ' => 'Ä', + 'EÌ„' => 'Ä’', + 'eÌ„' => 'Ä“', + 'Ĕ' => 'Ä”', + 'ĕ' => 'Ä•', + 'Ė' => 'Ä–', + 'ė' => 'Ä—', + 'Ę' => 'Ę', + 'ę' => 'Ä™', + 'EÌŒ' => 'Äš', + 'eÌŒ' => 'Ä›', + 'GÌ‚' => 'Äœ', + 'gÌ‚' => 'Ä', + 'Ğ' => 'Äž', + 'ğ' => 'ÄŸ', + 'Ġ' => 'Ä ', + 'ġ' => 'Ä¡', + 'Ģ' => 'Ä¢', + 'ģ' => 'Ä£', + 'HÌ‚' => 'Ĥ', + 'hÌ‚' => 'Ä¥', + 'Ĩ' => 'Ĩ', + 'ĩ' => 'Ä©', + 'IÌ„' => 'Ī', + 'iÌ„' => 'Ä«', + 'Ĭ' => 'Ĭ', + 'ĭ' => 'Ä­', + 'Į' => 'Ä®', + 'į' => 'į', + 'İ' => 'İ', + 'JÌ‚' => 'Ä´', + 'jÌ‚' => 'ĵ', + 'Ķ' => 'Ķ', + 'ķ' => 'Ä·', + 'LÌ' => 'Ĺ', + 'lÌ' => 'ĺ', + 'Ļ' => 'Ä»', + 'ļ' => 'ļ', + 'LÌŒ' => 'Ľ', + 'lÌŒ' => 'ľ', + 'NÌ' => 'Ń', + 'nÌ' => 'Å„', + 'Ņ' => 'Å…', + 'ņ' => 'ņ', + 'NÌŒ' => 'Ň', + 'nÌŒ' => 'ň', + 'OÌ„' => 'ÅŒ', + 'oÌ„' => 'Å', + 'Ŏ' => 'ÅŽ', + 'ŏ' => 'Å', + 'OÌ‹' => 'Å', + 'oÌ‹' => 'Å‘', + 'RÌ' => 'Å”', + 'rÌ' => 'Å•', + 'Ŗ' => 'Å–', + 'ŗ' => 'Å—', + 'RÌŒ' => 'Ř', + 'rÌŒ' => 'Å™', + 'SÌ' => 'Åš', + 'sÌ' => 'Å›', + 'SÌ‚' => 'Åœ', + 'sÌ‚' => 'Å', + 'Ş' => 'Åž', + 'ş' => 'ÅŸ', + 'SÌŒ' => 'Å ', + 'sÌŒ' => 'Å¡', + 'Ţ' => 'Å¢', + 'ţ' => 'Å£', + 'TÌŒ' => 'Ť', + 'tÌŒ' => 'Å¥', + 'Ũ' => 'Ũ', + 'ũ' => 'Å©', + 'UÌ„' => 'Ū', + 'uÌ„' => 'Å«', + 'Ŭ' => 'Ŭ', + 'ŭ' => 'Å­', + 'UÌŠ' => 'Å®', + 'uÌŠ' => 'ů', + 'UÌ‹' => 'Ű', + 'uÌ‹' => 'ű', + 'Ų' => 'Ų', + 'ų' => 'ų', + 'WÌ‚' => 'Å´', + 'wÌ‚' => 'ŵ', + 'YÌ‚' => 'Ŷ', + 'yÌ‚' => 'Å·', + 'Ÿ' => 'Ÿ', + 'ZÌ' => 'Ź', + 'zÌ' => 'ź', + 'Ż' => 'Å»', + 'ż' => 'ż', + 'ZÌŒ' => 'Ž', + 'zÌŒ' => 'ž', + 'OÌ›' => 'Æ ', + 'oÌ›' => 'Æ¡', + 'UÌ›' => 'Ư', + 'uÌ›' => 'ư', + 'AÌŒ' => 'Ç', + 'aÌŒ' => 'ÇŽ', + 'IÌŒ' => 'Ç', + 'iÌŒ' => 'Ç', + 'OÌŒ' => 'Ç‘', + 'oÌŒ' => 'Ç’', + 'UÌŒ' => 'Ç“', + 'uÌŒ' => 'Ç”', + 'Ǖ' => 'Ç•', + 'ǖ' => 'Ç–', + 'ÜÌ' => 'Ç—', + 'üÌ' => 'ǘ', + 'Ǚ' => 'Ç™', + 'ǚ' => 'Çš', + 'Ǜ' => 'Ç›', + 'ǜ' => 'Çœ', + 'Ǟ' => 'Çž', + 'ǟ' => 'ÇŸ', + 'Ǡ' => 'Ç ', + 'ǡ' => 'Ç¡', + 'Ǣ' => 'Ç¢', + 'ǣ' => 'Ç£', + 'GÌŒ' => 'Ǧ', + 'gÌŒ' => 'ǧ', + 'KÌŒ' => 'Ǩ', + 'kÌŒ' => 'Ç©', + 'Ǫ' => 'Ǫ', + 'ǫ' => 'Ç«', + 'Ǭ' => 'Ǭ', + 'ǭ' => 'Ç­', + 'Æ·ÌŒ' => 'Ç®', + 'Ê’ÌŒ' => 'ǯ', + 'jÌŒ' => 'ǰ', + 'GÌ' => 'Ç´', + 'gÌ' => 'ǵ', + 'NÌ€' => 'Ǹ', + 'nÌ€' => 'ǹ', + 'Ã…Ì' => 'Ǻ', + 'Ã¥Ì' => 'Ç»', + 'ÆÌ' => 'Ǽ', + 'æÌ' => 'ǽ', + 'ØÌ' => 'Ǿ', + 'øÌ' => 'Ç¿', + 'AÌ' => 'È€', + 'aÌ' => 'È', + 'AÌ‘' => 'È‚', + 'aÌ‘' => 'ȃ', + 'EÌ' => 'È„', + 'eÌ' => 'È…', + 'EÌ‘' => 'Ȇ', + 'eÌ‘' => 'ȇ', + 'IÌ' => 'Ȉ', + 'iÌ' => 'ȉ', + 'IÌ‘' => 'ÈŠ', + 'iÌ‘' => 'È‹', + 'OÌ' => 'ÈŒ', + 'oÌ' => 'È', + 'OÌ‘' => 'ÈŽ', + 'oÌ‘' => 'È', + 'RÌ' => 'È', + 'rÌ' => 'È‘', + 'RÌ‘' => 'È’', + 'rÌ‘' => 'È“', + 'UÌ' => 'È”', + 'uÌ' => 'È•', + 'UÌ‘' => 'È–', + 'uÌ‘' => 'È—', + 'Ș' => 'Ș', + 'ș' => 'È™', + 'Ț' => 'Èš', + 'ț' => 'È›', + 'HÌŒ' => 'Èž', + 'hÌŒ' => 'ÈŸ', + 'Ȧ' => 'Ȧ', + 'ȧ' => 'ȧ', + 'Ȩ' => 'Ȩ', + 'ȩ' => 'È©', + 'Ȫ' => 'Ȫ', + 'ȫ' => 'È«', + 'Ȭ' => 'Ȭ', + 'ȭ' => 'È­', + 'Ȯ' => 'È®', + 'ȯ' => 'ȯ', + 'Ȱ' => 'Ȱ', + 'ȱ' => 'ȱ', + 'YÌ„' => 'Ȳ', + 'yÌ„' => 'ȳ', + '¨Ì' => 'Î…', + 'ΑÌ' => 'Ά', + 'ΕÌ' => 'Έ', + 'ΗÌ' => 'Ή', + 'ΙÌ' => 'Ί', + 'ΟÌ' => 'ÎŒ', + 'Î¥Ì' => 'ÎŽ', + 'ΩÌ' => 'Î', + 'ÏŠÌ' => 'Î', + 'Ϊ' => 'Ϊ', + 'Ϋ' => 'Ϋ', + 'αÌ' => 'ά', + 'εÌ' => 'έ', + 'ηÌ' => 'ή', + 'ιÌ' => 'ί', + 'Ï‹Ì' => 'ΰ', + 'ϊ' => 'ÏŠ', + 'ϋ' => 'Ï‹', + 'οÌ' => 'ÏŒ', + 'Ï…Ì' => 'Ï', + 'ωÌ' => 'ÏŽ', + 'Ï’Ì' => 'Ï“', + 'ϔ' => 'Ï”', + 'Ѐ' => 'Ѐ', + 'Ё' => 'Ð', + 'ГÌ' => 'Ѓ', + 'Ї' => 'Ї', + 'КÌ' => 'ÐŒ', + 'Ѝ' => 'Ð', + 'Ў' => 'ÐŽ', + 'Й' => 'Й', + 'й' => 'й', + 'ѐ' => 'Ñ', + 'ё' => 'Ñ‘', + 'гÌ' => 'Ñ“', + 'ї' => 'Ñ—', + 'кÌ' => 'Ñœ', + 'ѝ' => 'Ñ', + 'ў' => 'Ñž', + 'Ñ´Ì' => 'Ѷ', + 'ѵÌ' => 'Ñ·', + 'Ӂ' => 'Ó', + 'ӂ' => 'Ó‚', + 'Ð̆' => 'Ó', + 'ӑ' => 'Ó‘', + 'Ð̈' => 'Ó’', + 'ӓ' => 'Ó“', + 'Ӗ' => 'Ó–', + 'ӗ' => 'Ó—', + 'Ӛ' => 'Óš', + 'ӛ' => 'Ó›', + 'Ӝ' => 'Óœ', + 'ӝ' => 'Ó', + 'Ӟ' => 'Óž', + 'ӟ' => 'ÓŸ', + 'Ӣ' => 'Ó¢', + 'ӣ' => 'Ó£', + 'Ӥ' => 'Ó¤', + 'ӥ' => 'Ó¥', + 'Ӧ' => 'Ó¦', + 'ӧ' => 'Ó§', + 'Ӫ' => 'Óª', + 'ӫ' => 'Ó«', + 'Ӭ' => 'Ó¬', + 'Ñ̈' => 'Ó­', + 'Ӯ' => 'Ó®', + 'ӯ' => 'Ó¯', + 'Ӱ' => 'Ó°', + 'ӱ' => 'Ó±', + 'Ӳ' => 'Ó²', + 'ӳ' => 'Ó³', + 'Ӵ' => 'Ó´', + 'ӵ' => 'Óµ', + 'Ӹ' => 'Ó¸', + 'ӹ' => 'Ó¹', + 'آ' => 'Ø¢', + 'أ' => 'Ø£', + 'ÙˆÙ”' => 'ؤ', + 'إ' => 'Ø¥', + 'ÙŠÙ”' => 'ئ', + 'Û•Ù”' => 'Û€', + 'ÛÙ”' => 'Û‚', + 'Û’Ù”' => 'Û“', + 'ऩ' => 'ऩ', + 'ऱ' => 'ऱ', + 'ऴ' => 'ऴ', + 'ো' => 'à§‹', + 'ৌ' => 'à§Œ', + 'ୈ' => 'à­ˆ', + 'ୋ' => 'à­‹', + 'ୌ' => 'à­Œ', + 'ஔ' => 'à®”', + 'ொ' => 'ொ', + 'ோ' => 'ோ', + 'ௌ' => 'ௌ', + 'ై' => 'ై', + 'ೀ' => 'à³€', + 'ೇ' => 'ೇ', + 'ೈ' => 'ೈ', + 'ೊ' => 'ೊ', + 'ೋ' => 'ೋ', + 'ൊ' => 'ൊ', + 'ോ' => 'ോ', + 'ൌ' => 'ൌ', + 'ේ' => 'à·š', + 'à·™à·' => 'à·œ', + 'ෝ' => 'à·', + 'ෞ' => 'à·ž', + 'ဦ' => 'ဦ', + 'ᬆ' => 'ᬆ', + 'ᬈ' => 'ᬈ', + 'ᬊ' => 'ᬊ', + 'ᬌ' => 'ᬌ', + 'á¬á¬µ' => 'ᬎ', + 'ᬒ' => 'ᬒ', + 'ᬻ' => 'ᬻ', + 'ᬽ' => 'ᬽ', + 'ᭀ' => 'á­€', + 'ᭁ' => 'á­', + 'ᭃ' => 'á­ƒ', + 'AÌ¥' => 'Ḁ', + 'aÌ¥' => 'á¸', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'BÌ£' => 'Ḅ', + 'bÌ£' => 'ḅ', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'ÇÌ' => 'Ḉ', + 'çÌ' => 'ḉ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'DÌ£' => 'Ḍ', + 'dÌ£' => 'á¸', + 'Ḏ' => 'Ḏ', + 'ḏ' => 'á¸', + 'Ḑ' => 'á¸', + 'ḑ' => 'ḑ', + 'DÌ­' => 'Ḓ', + 'dÌ­' => 'ḓ', + 'Ä’Ì€' => 'Ḕ', + 'ḕ' => 'ḕ', + 'Ä’Ì' => 'Ḗ', + 'Ä“Ì' => 'ḗ', + 'EÌ­' => 'Ḙ', + 'eÌ­' => 'ḙ', + 'Ḛ' => 'Ḛ', + 'ḛ' => 'ḛ', + 'Ḝ' => 'Ḝ', + 'ḝ' => 'á¸', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'GÌ„' => 'Ḡ', + 'gÌ„' => 'ḡ', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'HÌ£' => 'Ḥ', + 'hÌ£' => 'ḥ', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'HÌ®' => 'Ḫ', + 'hÌ®' => 'ḫ', + 'Ḭ' => 'Ḭ', + 'ḭ' => 'ḭ', + 'ÃÌ' => 'Ḯ', + 'ïÌ' => 'ḯ', + 'KÌ' => 'Ḱ', + 'kÌ' => 'ḱ', + 'KÌ£' => 'Ḳ', + 'kÌ£' => 'ḳ', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'LÌ£' => 'Ḷ', + 'lÌ£' => 'ḷ', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'LÌ­' => 'Ḽ', + 'lÌ­' => 'ḽ', + 'MÌ' => 'Ḿ', + 'mÌ' => 'ḿ', + 'Ṁ' => 'á¹€', + 'ṁ' => 'á¹', + 'MÌ£' => 'Ṃ', + 'mÌ£' => 'ṃ', + 'Ṅ' => 'Ṅ', + 'ṅ' => 'á¹…', + 'NÌ£' => 'Ṇ', + 'nÌ£' => 'ṇ', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'NÌ­' => 'Ṋ', + 'nÌ­' => 'ṋ', + 'ÕÌ' => 'Ṍ', + 'õÌ' => 'á¹', + 'Ṏ' => 'Ṏ', + 'ṏ' => 'á¹', + 'Ṑ' => 'á¹', + 'ÅÌ€' => 'ṑ', + 'ÅŒÌ' => 'á¹’', + 'ÅÌ' => 'ṓ', + 'PÌ' => 'á¹”', + 'pÌ' => 'ṕ', + 'Ṗ' => 'á¹–', + 'ṗ' => 'á¹—', + 'Ṙ' => 'Ṙ', + 'ṙ' => 'á¹™', + 'RÌ£' => 'Ṛ', + 'rÌ£' => 'á¹›', + 'Ṝ' => 'Ṝ', + 'ṝ' => 'á¹', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'Ṡ' => 'á¹ ', + 'ṡ' => 'ṡ', + 'SÌ£' => 'á¹¢', + 'sÌ£' => 'á¹£', + 'Ṥ' => 'Ṥ', + 'ṥ' => 'á¹¥', + 'Ṧ' => 'Ṧ', + 'ṧ' => 'á¹§', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'TÌ£' => 'Ṭ', + 'tÌ£' => 'á¹­', + 'Ṯ' => 'á¹®', + 'ṯ' => 'ṯ', + 'TÌ­' => 'á¹°', + 'tÌ­' => 'á¹±', + 'Ṳ' => 'á¹²', + 'ṳ' => 'á¹³', + 'Ṵ' => 'á¹´', + 'ṵ' => 'á¹µ', + 'UÌ­' => 'á¹¶', + 'uÌ­' => 'á¹·', + 'ŨÌ' => 'Ṹ', + 'Å©Ì' => 'á¹¹', + 'Ṻ' => 'Ṻ', + 'ṻ' => 'á¹»', + 'Ṽ' => 'á¹¼', + 'ṽ' => 'á¹½', + 'VÌ£' => 'á¹¾', + 'vÌ£' => 'ṿ', + 'WÌ€' => 'Ẁ', + 'wÌ€' => 'áº', + 'WÌ' => 'Ẃ', + 'wÌ' => 'ẃ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'WÌ£' => 'Ẉ', + 'wÌ£' => 'ẉ', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'ẍ' => 'áº', + 'Ẏ' => 'Ẏ', + 'ẏ' => 'áº', + 'ZÌ‚' => 'áº', + 'zÌ‚' => 'ẑ', + 'ZÌ£' => 'Ẓ', + 'zÌ£' => 'ẓ', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'wÌŠ' => 'ẘ', + 'yÌŠ' => 'ẙ', + 'ẛ' => 'ẛ', + 'AÌ£' => 'Ạ', + 'aÌ£' => 'ạ', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'ÂÌ' => 'Ấ', + 'âÌ' => 'ấ', + 'Ầ' => 'Ầ', + 'ầ' => 'ầ', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ä‚Ì' => 'Ắ', + 'ăÌ' => 'ắ', + 'Ằ' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'EÌ£' => 'Ẹ', + 'eÌ£' => 'ẹ', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'ÊÌ' => 'Ế', + 'êÌ' => 'ế', + 'Ề' => 'Ề', + 'ề' => 'á»', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'ễ' => 'á»…', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'IÌ£' => 'Ị', + 'iÌ£' => 'ị', + 'OÌ£' => 'Ọ', + 'oÌ£' => 'á»', + 'Ỏ' => 'Ỏ', + 'ỏ' => 'á»', + 'ÔÌ' => 'á»', + 'ôÌ' => 'ố', + 'Ồ' => 'á»’', + 'ồ' => 'ồ', + 'Ổ' => 'á»”', + 'ổ' => 'ổ', + 'Ỗ' => 'á»–', + 'ỗ' => 'á»—', + 'Ộ' => 'Ộ', + 'á»Ì‚' => 'á»™', + 'Æ Ì' => 'Ớ', + 'Æ¡Ì' => 'á»›', + 'Ờ' => 'Ờ', + 'ờ' => 'á»', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'Ỡ' => 'á» ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'ợ' => 'ợ', + 'UÌ£' => 'Ụ', + 'uÌ£' => 'ụ', + 'Ủ' => 'Ủ', + 'ủ' => 'á»§', + 'ƯÌ' => 'Ứ', + 'ưÌ' => 'ứ', + 'Ừ' => 'Ừ', + 'ừ' => 'ừ', + 'Ử' => 'Ử', + 'ử' => 'á»­', + 'Ữ' => 'á»®', + 'ữ' => 'ữ', + 'Ự' => 'á»°', + 'ự' => 'á»±', + 'YÌ€' => 'Ỳ', + 'yÌ€' => 'ỳ', + 'YÌ£' => 'á»´', + 'yÌ£' => 'ỵ', + 'Ỷ' => 'á»¶', + 'ỷ' => 'á»·', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'ἀ' => 'á¼€', + 'ἁ' => 'á¼', + 'ἂ' => 'ἂ', + 'á¼Ì€' => 'ἃ', + 'á¼€Ì' => 'ἄ', + 'á¼Ì' => 'á¼…', + 'ἆ' => 'ἆ', + 'á¼Í‚' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'ἈÌ' => 'Ἄ', + 'ἉÌ' => 'á¼', + 'Ἆ' => 'Ἆ', + 'Ἇ' => 'á¼', + 'ἐ' => 'á¼', + 'ἑ' => 'ἑ', + 'á¼Ì€' => 'á¼’', + 'ἓ' => 'ἓ', + 'á¼Ì' => 'á¼”', + 'ἑÌ' => 'ἕ', + 'Ἐ' => 'Ἐ', + 'Ἑ' => 'á¼™', + 'Ἒ' => 'Ἒ', + 'Ἓ' => 'á¼›', + 'ἘÌ' => 'Ἔ', + 'á¼™Ì' => 'á¼', + 'ἠ' => 'á¼ ', + 'ἡ' => 'ἡ', + 'ἢ' => 'á¼¢', + 'ἣ' => 'á¼£', + 'á¼ Ì' => 'ἤ', + 'ἡÌ' => 'á¼¥', + 'á¼ Í‚' => 'ἦ', + 'ἧ' => 'á¼§', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'ἨÌ' => 'Ἤ', + 'ἩÌ' => 'á¼­', + 'Ἦ' => 'á¼®', + 'Ἧ' => 'Ἧ', + 'ἰ' => 'á¼°', + 'ἱ' => 'á¼±', + 'á¼°Ì€' => 'á¼²', + 'ἳ' => 'á¼³', + 'á¼°Ì' => 'á¼´', + 'á¼±Ì' => 'á¼µ', + 'á¼°Í‚' => 'á¼¶', + 'ἷ' => 'á¼·', + 'Ἰ' => 'Ἰ', + 'Ἱ' => 'á¼¹', + 'Ἲ' => 'Ἲ', + 'Ἳ' => 'á¼»', + 'ἸÌ' => 'á¼¼', + 'á¼¹Ì' => 'á¼½', + 'Ἶ' => 'á¼¾', + 'Ἷ' => 'Ἷ', + 'ὀ' => 'á½€', + 'ὁ' => 'á½', + 'ὂ' => 'ὂ', + 'á½Ì€' => 'ὃ', + 'á½€Ì' => 'ὄ', + 'á½Ì' => 'á½…', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'ὈÌ' => 'Ὄ', + 'ὉÌ' => 'á½', + 'Ï…Ì“' => 'á½', + 'Ï…Ì”' => 'ὑ', + 'á½Ì€' => 'á½’', + 'ὓ' => 'ὓ', + 'á½Ì' => 'á½”', + 'ὑÌ' => 'ὕ', + 'á½Í‚' => 'á½–', + 'ὗ' => 'á½—', + 'Ὑ' => 'á½™', + 'Ὓ' => 'á½›', + 'á½™Ì' => 'á½', + 'Ὗ' => 'Ὗ', + 'ὠ' => 'á½ ', + 'ὡ' => 'ὡ', + 'ὢ' => 'á½¢', + 'ὣ' => 'á½£', + 'á½ Ì' => 'ὤ', + 'ὡÌ' => 'á½¥', + 'á½ Í‚' => 'ὦ', + 'ὧ' => 'á½§', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'ὨÌ' => 'Ὤ', + 'ὩÌ' => 'á½­', + 'Ὦ' => 'á½®', + 'Ὧ' => 'Ὧ', + 'ὰ' => 'á½°', + 'ὲ' => 'á½²', + 'ὴ' => 'á½´', + 'ὶ' => 'á½¶', + 'ὸ' => 'ὸ', + 'Ï…Ì€' => 'ὺ', + 'ὼ' => 'á½¼', + 'ᾀ' => 'á¾€', + 'á¼Í…' => 'á¾', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ᾄ', + 'á¼…Í…' => 'á¾…', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ᾌ', + 'á¼Í…' => 'á¾', + 'ᾎ' => 'ᾎ', + 'á¼Í…' => 'á¾', + 'á¼ Í…' => 'á¾', + 'ᾑ' => 'ᾑ', + 'ᾒ' => 'á¾’', + 'ᾓ' => 'ᾓ', + 'ᾔ' => 'á¾”', + 'ᾕ' => 'ᾕ', + 'ᾖ' => 'á¾–', + 'á¼§Í…' => 'á¾—', + 'ᾘ' => 'ᾘ', + 'ᾙ' => 'á¾™', + 'ᾚ' => 'ᾚ', + 'ᾛ' => 'á¾›', + 'ᾜ' => 'ᾜ', + 'á¼­Í…' => 'á¾', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'á½ Í…' => 'á¾ ', + 'ᾡ' => 'ᾡ', + 'ᾢ' => 'á¾¢', + 'ᾣ' => 'á¾£', + 'ᾤ' => 'ᾤ', + 'ᾥ' => 'á¾¥', + 'ᾦ' => 'ᾦ', + 'á½§Í…' => 'á¾§', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ᾬ', + 'á½­Í…' => 'á¾­', + 'ᾮ' => 'á¾®', + 'ᾯ' => 'ᾯ', + 'ᾰ' => 'á¾°', + 'ᾱ' => 'á¾±', + 'á½°Í…' => 'á¾²', + 'ᾳ' => 'á¾³', + 'ᾴ' => 'á¾´', + 'ᾶ' => 'á¾¶', + 'á¾¶Í…' => 'á¾·', + 'Ᾰ' => 'Ᾰ', + 'Ᾱ' => 'á¾¹', + 'Ὰ' => 'Ὰ', + 'ᾼ' => 'á¾¼', + '῁' => 'á¿', + 'á½´Í…' => 'á¿‚', + 'ῃ' => 'ῃ', + 'ῄ' => 'á¿„', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Ὴ' => 'Ὴ', + 'ῌ' => 'ῌ', + '῍' => 'á¿', + '᾿Ì' => '῎', + '῏' => 'á¿', + 'ῐ' => 'á¿', + 'ῑ' => 'á¿‘', + 'ÏŠÌ€' => 'á¿’', + 'ῖ' => 'á¿–', + 'ÏŠÍ‚' => 'á¿—', + 'Ῐ' => 'Ῐ', + 'Ῑ' => 'á¿™', + 'Ὶ' => 'Ὶ', + '῝' => 'á¿', + '῾Ì' => '῞', + '῟' => '῟', + 'ῠ' => 'á¿ ', + 'Ï…Ì„' => 'á¿¡', + 'ῢ' => 'á¿¢', + 'ÏÌ“' => 'ῤ', + 'ÏÌ”' => 'á¿¥', + 'Ï…Í‚' => 'ῦ', + 'ῧ' => 'á¿§', + 'Ῠ' => 'Ῠ', + 'Ῡ' => 'á¿©', + 'Ὺ' => 'Ὺ', + 'Ῥ' => 'Ῥ', + '῭' => 'á¿­', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'ÏŽÍ…' => 'á¿´', + 'ῶ' => 'á¿¶', + 'á¿¶Í…' => 'á¿·', + 'Ὸ' => 'Ὸ', + 'Ὼ' => 'Ὼ', + 'ῼ' => 'ῼ', + 'â†Ì¸' => '↚', + '↛' => '↛', + '↮' => '↮', + 'â‡Ì¸' => 'â‡', + '⇎' => '⇎', + '⇏' => 'â‡', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + '≁' => 'â‰', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + 'â‰Ì¸' => '≭', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + '⊁' => 'âŠ', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + '⋠' => 'â‹ ', + '⋡' => 'â‹¡', + '⋢' => 'â‹¢', + '⋣' => 'â‹£', + '⋪' => '⋪', + '⋫' => 'â‹«', + '⋬' => '⋬', + '⋭' => 'â‹­', + 'ã‹ã‚™' => 'ãŒ', + 'ãã‚™' => 'ãŽ', + 'ãã‚™' => 'ã', + 'ã‘ã‚™' => 'ã’', + 'ã“ã‚™' => 'ã”', + 'ã•ã‚™' => 'ã–', + 'ã—ã‚™' => 'ã˜', + 'ã™ã‚™' => 'ãš', + 'ã›ã‚™' => 'ãœ', + 'ãã‚™' => 'ãž', + 'ãŸã‚™' => 'ã ', + 'ã¡ã‚™' => 'ã¢', + 'ã¤ã‚™' => 'ã¥', + 'ã¦ã‚™' => 'ã§', + 'ã¨ã‚™' => 'ã©', + 'ã¯ã‚™' => 'ã°', + 'ã¯ã‚š' => 'ã±', + 'ã²ã‚™' => 'ã³', + 'ã²ã‚š' => 'ã´', + 'ãµã‚™' => 'ã¶', + 'ãµã‚š' => 'ã·', + 'ã¸ã‚™' => 'ã¹', + 'ã¸ã‚š' => 'ãº', + 'ã»ã‚™' => 'ã¼', + 'ã»ã‚š' => 'ã½', + 'ã†ã‚™' => 'ã‚”', + 'ã‚ã‚™' => 'ゞ', + 'ã‚«ã‚™' => 'ガ', + 'ã‚­ã‚™' => 'ã‚®', + 'グ' => 'ã‚°', + 'ゲ' => 'ゲ', + 'ゴ' => 'ã‚´', + 'ザ' => 'ã‚¶', + 'ã‚·ã‚™' => 'ジ', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ã‚¿ã‚™' => 'ダ', + 'ãƒã‚™' => 'ヂ', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'ãƒã‚™' => 'ãƒ', + 'ãƒã‚š' => 'パ', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ポ' => 'ãƒ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '𑂚' => 'ð‘‚š', + '𑂜' => 'ð‘‚œ', + '𑂫' => 'ð‘‚«', + '𑄮' => 'ð‘„®', + '𑄯' => '𑄯', + 'ð‘‡ð‘Œ¾' => 'ð‘‹', + 'ð‘‡ð‘—' => 'ð‘Œ', + '𑒻' => 'ð‘’»', + '𑒼' => 'ð‘’¼', + '𑒾' => 'ð‘’¾', + '𑖺' => 'ð‘–º', + '𑖻' => 'ð‘–»', + '𑤸' => '𑤸', +); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php new file mode 100644 index 0000000000..5a3e8e0969 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php @@ -0,0 +1,2065 @@ +<?php + +return array ( + 'À' => 'AÌ€', + 'Ã' => 'AÌ', + 'Â' => 'AÌ‚', + 'Ã' => 'Ã', + 'Ä' => 'Ä', + 'Ã…' => 'AÌŠ', + 'Ç' => 'Ç', + 'È' => 'EÌ€', + 'É' => 'EÌ', + 'Ê' => 'EÌ‚', + 'Ë' => 'Ë', + 'ÃŒ' => 'IÌ€', + 'Ã' => 'IÌ', + 'ÃŽ' => 'IÌ‚', + 'Ã' => 'Ï', + 'Ñ' => 'Ñ', + 'Ã’' => 'OÌ€', + 'Ó' => 'OÌ', + 'Ô' => 'OÌ‚', + 'Õ' => 'Õ', + 'Ö' => 'Ö', + 'Ù' => 'UÌ€', + 'Ú' => 'UÌ', + 'Û' => 'UÌ‚', + 'Ü' => 'Ü', + 'Ã' => 'YÌ', + 'à' => 'aÌ€', + 'á' => 'aÌ', + 'â' => 'aÌ‚', + 'ã' => 'ã', + 'ä' => 'ä', + 'Ã¥' => 'aÌŠ', + 'ç' => 'ç', + 'è' => 'eÌ€', + 'é' => 'eÌ', + 'ê' => 'eÌ‚', + 'ë' => 'ë', + 'ì' => 'iÌ€', + 'í' => 'iÌ', + 'î' => 'iÌ‚', + 'ï' => 'ï', + 'ñ' => 'ñ', + 'ò' => 'oÌ€', + 'ó' => 'oÌ', + 'ô' => 'oÌ‚', + 'õ' => 'õ', + 'ö' => 'ö', + 'ù' => 'uÌ€', + 'ú' => 'uÌ', + 'û' => 'uÌ‚', + 'ü' => 'ü', + 'ý' => 'yÌ', + 'ÿ' => 'ÿ', + 'Ä€' => 'AÌ„', + 'Ä' => 'aÌ„', + 'Ä‚' => 'Ă', + 'ă' => 'ă', + 'Ä„' => 'Ą', + 'Ä…' => 'ą', + 'Ć' => 'CÌ', + 'ć' => 'cÌ', + 'Ĉ' => 'CÌ‚', + 'ĉ' => 'cÌ‚', + 'ÄŠ' => 'Ċ', + 'Ä‹' => 'ċ', + 'ÄŒ' => 'CÌŒ', + 'Ä' => 'cÌŒ', + 'ÄŽ' => 'DÌŒ', + 'Ä' => 'dÌŒ', + 'Ä’' => 'EÌ„', + 'Ä“' => 'eÌ„', + 'Ä”' => 'Ĕ', + 'Ä•' => 'ĕ', + 'Ä–' => 'Ė', + 'Ä—' => 'ė', + 'Ę' => 'Ę', + 'Ä™' => 'ę', + 'Äš' => 'EÌŒ', + 'Ä›' => 'eÌŒ', + 'Äœ' => 'GÌ‚', + 'Ä' => 'gÌ‚', + 'Äž' => 'Ğ', + 'ÄŸ' => 'ğ', + 'Ä ' => 'Ġ', + 'Ä¡' => 'ġ', + 'Ä¢' => 'Ģ', + 'Ä£' => 'ģ', + 'Ĥ' => 'HÌ‚', + 'Ä¥' => 'hÌ‚', + 'Ĩ' => 'Ĩ', + 'Ä©' => 'ĩ', + 'Ī' => 'IÌ„', + 'Ä«' => 'iÌ„', + 'Ĭ' => 'Ĭ', + 'Ä­' => 'ĭ', + 'Ä®' => 'Į', + 'į' => 'į', + 'İ' => 'İ', + 'Ä´' => 'JÌ‚', + 'ĵ' => 'jÌ‚', + 'Ķ' => 'Ķ', + 'Ä·' => 'ķ', + 'Ĺ' => 'LÌ', + 'ĺ' => 'lÌ', + 'Ä»' => 'Ļ', + 'ļ' => 'ļ', + 'Ľ' => 'LÌŒ', + 'ľ' => 'lÌŒ', + 'Ń' => 'NÌ', + 'Å„' => 'nÌ', + 'Å…' => 'Ņ', + 'ņ' => 'ņ', + 'Ň' => 'NÌŒ', + 'ň' => 'nÌŒ', + 'ÅŒ' => 'OÌ„', + 'Å' => 'oÌ„', + 'ÅŽ' => 'Ŏ', + 'Å' => 'ŏ', + 'Å' => 'OÌ‹', + 'Å‘' => 'oÌ‹', + 'Å”' => 'RÌ', + 'Å•' => 'rÌ', + 'Å–' => 'Ŗ', + 'Å—' => 'ŗ', + 'Ř' => 'RÌŒ', + 'Å™' => 'rÌŒ', + 'Åš' => 'SÌ', + 'Å›' => 'sÌ', + 'Åœ' => 'SÌ‚', + 'Å' => 'sÌ‚', + 'Åž' => 'Ş', + 'ÅŸ' => 'ş', + 'Å ' => 'SÌŒ', + 'Å¡' => 'sÌŒ', + 'Å¢' => 'Ţ', + 'Å£' => 'ţ', + 'Ť' => 'TÌŒ', + 'Å¥' => 'tÌŒ', + 'Ũ' => 'Ũ', + 'Å©' => 'ũ', + 'Ū' => 'UÌ„', + 'Å«' => 'uÌ„', + 'Ŭ' => 'Ŭ', + 'Å­' => 'ŭ', + 'Å®' => 'UÌŠ', + 'ů' => 'uÌŠ', + 'Ű' => 'UÌ‹', + 'ű' => 'uÌ‹', + 'Ų' => 'Ų', + 'ų' => 'ų', + 'Å´' => 'WÌ‚', + 'ŵ' => 'wÌ‚', + 'Ŷ' => 'YÌ‚', + 'Å·' => 'yÌ‚', + 'Ÿ' => 'Ÿ', + 'Ź' => 'ZÌ', + 'ź' => 'zÌ', + 'Å»' => 'Ż', + 'ż' => 'ż', + 'Ž' => 'ZÌŒ', + 'ž' => 'zÌŒ', + 'Æ ' => 'OÌ›', + 'Æ¡' => 'oÌ›', + 'Ư' => 'UÌ›', + 'ư' => 'uÌ›', + 'Ç' => 'AÌŒ', + 'ÇŽ' => 'aÌŒ', + 'Ç' => 'IÌŒ', + 'Ç' => 'iÌŒ', + 'Ç‘' => 'OÌŒ', + 'Ç’' => 'oÌŒ', + 'Ç“' => 'UÌŒ', + 'Ç”' => 'uÌŒ', + 'Ç•' => 'Ǖ', + 'Ç–' => 'ǖ', + 'Ç—' => 'ÜÌ', + 'ǘ' => 'üÌ', + 'Ç™' => 'Ǚ', + 'Çš' => 'ǚ', + 'Ç›' => 'Ǜ', + 'Çœ' => 'ǜ', + 'Çž' => 'Ǟ', + 'ÇŸ' => 'ǟ', + 'Ç ' => 'Ǡ', + 'Ç¡' => 'ǡ', + 'Ç¢' => 'Ǣ', + 'Ç£' => 'ǣ', + 'Ǧ' => 'GÌŒ', + 'ǧ' => 'gÌŒ', + 'Ǩ' => 'KÌŒ', + 'Ç©' => 'kÌŒ', + 'Ǫ' => 'Ǫ', + 'Ç«' => 'ǫ', + 'Ǭ' => 'Ǭ', + 'Ç­' => 'ǭ', + 'Ç®' => 'Æ·ÌŒ', + 'ǯ' => 'Ê’ÌŒ', + 'ǰ' => 'jÌŒ', + 'Ç´' => 'GÌ', + 'ǵ' => 'gÌ', + 'Ǹ' => 'NÌ€', + 'ǹ' => 'nÌ€', + 'Ǻ' => 'AÌŠÌ', + 'Ç»' => 'aÌŠÌ', + 'Ǽ' => 'ÆÌ', + 'ǽ' => 'æÌ', + 'Ǿ' => 'ØÌ', + 'Ç¿' => 'øÌ', + 'È€' => 'AÌ', + 'È' => 'aÌ', + 'È‚' => 'AÌ‘', + 'ȃ' => 'aÌ‘', + 'È„' => 'EÌ', + 'È…' => 'eÌ', + 'Ȇ' => 'EÌ‘', + 'ȇ' => 'eÌ‘', + 'Ȉ' => 'IÌ', + 'ȉ' => 'iÌ', + 'ÈŠ' => 'IÌ‘', + 'È‹' => 'iÌ‘', + 'ÈŒ' => 'OÌ', + 'È' => 'oÌ', + 'ÈŽ' => 'OÌ‘', + 'È' => 'oÌ‘', + 'È' => 'RÌ', + 'È‘' => 'rÌ', + 'È’' => 'RÌ‘', + 'È“' => 'rÌ‘', + 'È”' => 'UÌ', + 'È•' => 'uÌ', + 'È–' => 'UÌ‘', + 'È—' => 'uÌ‘', + 'Ș' => 'Ș', + 'È™' => 'ș', + 'Èš' => 'Ț', + 'È›' => 'ț', + 'Èž' => 'HÌŒ', + 'ÈŸ' => 'hÌŒ', + 'Ȧ' => 'Ȧ', + 'ȧ' => 'ȧ', + 'Ȩ' => 'Ȩ', + 'È©' => 'ȩ', + 'Ȫ' => 'Ȫ', + 'È«' => 'ȫ', + 'Ȭ' => 'Ȭ', + 'È­' => 'ȭ', + 'È®' => 'Ȯ', + 'ȯ' => 'ȯ', + 'Ȱ' => 'Ȱ', + 'ȱ' => 'ȱ', + 'Ȳ' => 'YÌ„', + 'ȳ' => 'yÌ„', + 'Í€' => 'Ì€', + 'Í' => 'Ì', + '̓' => 'Ì“', + 'Í„' => '̈Ì', + 'Í´' => 'ʹ', + ';' => ';', + 'Î…' => '¨Ì', + 'Ά' => 'ΑÌ', + '·' => '·', + 'Έ' => 'ΕÌ', + 'Ή' => 'ΗÌ', + 'Ί' => 'ΙÌ', + 'ÎŒ' => 'ΟÌ', + 'ÎŽ' => 'Î¥Ì', + 'Î' => 'ΩÌ', + 'Î' => 'ϊÌ', + 'Ϊ' => 'Ϊ', + 'Ϋ' => 'Ϋ', + 'ά' => 'αÌ', + 'έ' => 'εÌ', + 'ή' => 'ηÌ', + 'ί' => 'ιÌ', + 'ΰ' => 'ϋÌ', + 'ÏŠ' => 'ϊ', + 'Ï‹' => 'ϋ', + 'ÏŒ' => 'οÌ', + 'Ï' => 'Ï…Ì', + 'ÏŽ' => 'ωÌ', + 'Ï“' => 'Ï’Ì', + 'Ï”' => 'ϔ', + 'Ѐ' => 'Ѐ', + 'Ð' => 'Ё', + 'Ѓ' => 'ГÌ', + 'Ї' => 'Ї', + 'ÐŒ' => 'КÌ', + 'Ð' => 'Ѝ', + 'ÐŽ' => 'Ў', + 'Й' => 'Й', + 'й' => 'й', + 'Ñ' => 'ѐ', + 'Ñ‘' => 'ё', + 'Ñ“' => 'гÌ', + 'Ñ—' => 'ї', + 'Ñœ' => 'кÌ', + 'Ñ' => 'ѝ', + 'Ñž' => 'ў', + 'Ѷ' => 'Ñ´Ì', + 'Ñ·' => 'ѵÌ', + 'Ó' => 'Ӂ', + 'Ó‚' => 'ӂ', + 'Ó' => 'Ð̆', + 'Ó‘' => 'ӑ', + 'Ó’' => 'Ð̈', + 'Ó“' => 'ӓ', + 'Ó–' => 'Ӗ', + 'Ó—' => 'ӗ', + 'Óš' => 'Ӛ', + 'Ó›' => 'ӛ', + 'Óœ' => 'Ӝ', + 'Ó' => 'ӝ', + 'Óž' => 'Ӟ', + 'ÓŸ' => 'ӟ', + 'Ó¢' => 'Ӣ', + 'Ó£' => 'ӣ', + 'Ó¤' => 'Ӥ', + 'Ó¥' => 'ӥ', + 'Ó¦' => 'Ӧ', + 'Ó§' => 'ӧ', + 'Óª' => 'Ӫ', + 'Ó«' => 'ӫ', + 'Ó¬' => 'Ӭ', + 'Ó­' => 'Ñ̈', + 'Ó®' => 'Ӯ', + 'Ó¯' => 'ӯ', + 'Ó°' => 'Ӱ', + 'Ó±' => 'ӱ', + 'Ó²' => 'Ӳ', + 'Ó³' => 'ӳ', + 'Ó´' => 'Ӵ', + 'Óµ' => 'ӵ', + 'Ó¸' => 'Ӹ', + 'Ó¹' => 'ӹ', + 'Ø¢' => 'آ', + 'Ø£' => 'أ', + 'ؤ' => 'ÙˆÙ”', + 'Ø¥' => 'إ', + 'ئ' => 'ÙŠÙ”', + 'Û€' => 'Û•Ù”', + 'Û‚' => 'ÛÙ”', + 'Û“' => 'Û’Ù”', + 'ऩ' => 'ऩ', + 'ऱ' => 'ऱ', + 'ऴ' => 'ऴ', + 'क़' => 'क़', + 'ख़' => 'ख़', + 'ग़' => 'ग़', + 'ज़' => 'ज़', + 'ड़' => 'ड़', + 'à¥' => 'ढ़', + 'फ़' => 'फ़', + 'य़' => 'य़', + 'à§‹' => 'ো', + 'à§Œ' => 'ৌ', + 'à§œ' => 'ড়', + 'à§' => 'ঢ়', + 'à§Ÿ' => 'য়', + 'ਲ਼' => 'ਲ਼', + 'ਸ਼' => 'ਸ਼', + 'à©™' => 'ਖ਼', + 'ਗ਼' => 'ਗ਼', + 'à©›' => 'ਜ਼', + 'ਫ਼' => 'ਫ਼', + 'à­ˆ' => 'ୈ', + 'à­‹' => 'ୋ', + 'à­Œ' => 'ୌ', + 'à­œ' => 'ଡ଼', + 'à­' => 'ଢ଼', + 'à®”' => 'ஔ', + 'ொ' => 'ொ', + 'ோ' => 'ோ', + 'ௌ' => 'ௌ', + 'ై' => 'ై', + 'à³€' => 'ೀ', + 'ೇ' => 'ೇ', + 'ೈ' => 'ೈ', + 'ೊ' => 'ೊ', + 'ೋ' => 'ೋ', + 'ൊ' => 'ൊ', + 'ോ' => 'ോ', + 'ൌ' => 'ൌ', + 'à·š' => 'ේ', + 'à·œ' => 'à·™à·', + 'à·' => 'à·™à·à·Š', + 'à·ž' => 'ෞ', + 'གྷ' => 'གྷ', + 'à½' => 'ཌྷ', + 'དྷ' => 'དྷ', + 'བྷ' => 'བྷ', + 'ཛྷ' => 'ཛྷ', + 'ཀྵ' => 'ཀྵ', + 'ཱི' => 'ཱི', + 'ཱུ' => 'ཱུ', + 'ྲྀ' => 'ྲྀ', + 'ླྀ' => 'ླྀ', + 'à¾' => 'ཱྀ', + 'ྒྷ' => 'ྒྷ', + 'à¾' => 'ྜྷ', + 'ྡྷ' => 'ྡྷ', + 'ྦྷ' => 'ྦྷ', + 'ྫྷ' => 'ྫྷ', + 'ྐྵ' => 'à¾à¾µ', + 'ဦ' => 'ဦ', + 'ᬆ' => 'ᬆ', + 'ᬈ' => 'ᬈ', + 'ᬊ' => 'ᬊ', + 'ᬌ' => 'ᬌ', + 'ᬎ' => 'á¬á¬µ', + 'ᬒ' => 'ᬒ', + 'ᬻ' => 'ᬻ', + 'ᬽ' => 'ᬽ', + 'á­€' => 'ᭀ', + 'á­' => 'ᭁ', + 'á­ƒ' => 'ᭃ', + 'Ḁ' => 'AÌ¥', + 'á¸' => 'aÌ¥', + 'Ḃ' => 'Ḃ', + 'ḃ' => 'ḃ', + 'Ḅ' => 'BÌ£', + 'ḅ' => 'bÌ£', + 'Ḇ' => 'Ḇ', + 'ḇ' => 'ḇ', + 'Ḉ' => 'ÇÌ', + 'ḉ' => 'çÌ', + 'Ḋ' => 'Ḋ', + 'ḋ' => 'ḋ', + 'Ḍ' => 'DÌ£', + 'á¸' => 'dÌ£', + 'Ḏ' => 'Ḏ', + 'á¸' => 'ḏ', + 'á¸' => 'Ḑ', + 'ḑ' => 'ḑ', + 'Ḓ' => 'DÌ­', + 'ḓ' => 'dÌ­', + 'Ḕ' => 'Ḕ', + 'ḕ' => 'ḕ', + 'Ḗ' => 'EÌ„Ì', + 'ḗ' => 'eÌ„Ì', + 'Ḙ' => 'EÌ­', + 'ḙ' => 'eÌ­', + 'Ḛ' => 'Ḛ', + 'ḛ' => 'ḛ', + 'Ḝ' => 'Ḝ', + 'á¸' => 'ḝ', + 'Ḟ' => 'Ḟ', + 'ḟ' => 'ḟ', + 'Ḡ' => 'GÌ„', + 'ḡ' => 'gÌ„', + 'Ḣ' => 'Ḣ', + 'ḣ' => 'ḣ', + 'Ḥ' => 'HÌ£', + 'ḥ' => 'hÌ£', + 'Ḧ' => 'Ḧ', + 'ḧ' => 'ḧ', + 'Ḩ' => 'Ḩ', + 'ḩ' => 'ḩ', + 'Ḫ' => 'HÌ®', + 'ḫ' => 'hÌ®', + 'Ḭ' => 'Ḭ', + 'ḭ' => 'ḭ', + 'Ḯ' => 'ÏÌ', + 'ḯ' => 'ïÌ', + 'Ḱ' => 'KÌ', + 'ḱ' => 'kÌ', + 'Ḳ' => 'KÌ£', + 'ḳ' => 'kÌ£', + 'Ḵ' => 'Ḵ', + 'ḵ' => 'ḵ', + 'Ḷ' => 'LÌ£', + 'ḷ' => 'lÌ£', + 'Ḹ' => 'Ḹ', + 'ḹ' => 'ḹ', + 'Ḻ' => 'Ḻ', + 'ḻ' => 'ḻ', + 'Ḽ' => 'LÌ­', + 'ḽ' => 'lÌ­', + 'Ḿ' => 'MÌ', + 'ḿ' => 'mÌ', + 'á¹€' => 'Ṁ', + 'á¹' => 'ṁ', + 'Ṃ' => 'MÌ£', + 'ṃ' => 'mÌ£', + 'Ṅ' => 'Ṅ', + 'á¹…' => 'ṅ', + 'Ṇ' => 'NÌ£', + 'ṇ' => 'nÌ£', + 'Ṉ' => 'Ṉ', + 'ṉ' => 'ṉ', + 'Ṋ' => 'NÌ­', + 'ṋ' => 'nÌ­', + 'Ṍ' => 'ÕÌ', + 'á¹' => 'õÌ', + 'Ṏ' => 'Ṏ', + 'á¹' => 'ṏ', + 'á¹' => 'Ṑ', + 'ṑ' => 'ṑ', + 'á¹’' => 'OÌ„Ì', + 'ṓ' => 'oÌ„Ì', + 'á¹”' => 'PÌ', + 'ṕ' => 'pÌ', + 'á¹–' => 'Ṗ', + 'á¹—' => 'ṗ', + 'Ṙ' => 'Ṙ', + 'á¹™' => 'ṙ', + 'Ṛ' => 'RÌ£', + 'á¹›' => 'rÌ£', + 'Ṝ' => 'Ṝ', + 'á¹' => 'ṝ', + 'Ṟ' => 'Ṟ', + 'ṟ' => 'ṟ', + 'á¹ ' => 'Ṡ', + 'ṡ' => 'ṡ', + 'á¹¢' => 'SÌ£', + 'á¹£' => 'sÌ£', + 'Ṥ' => 'SÌ̇', + 'á¹¥' => 'sÌ̇', + 'Ṧ' => 'Ṧ', + 'á¹§' => 'ṧ', + 'Ṩ' => 'Ṩ', + 'ṩ' => 'ṩ', + 'Ṫ' => 'Ṫ', + 'ṫ' => 'ṫ', + 'Ṭ' => 'TÌ£', + 'á¹­' => 'tÌ£', + 'á¹®' => 'Ṯ', + 'ṯ' => 'ṯ', + 'á¹°' => 'TÌ­', + 'á¹±' => 'tÌ­', + 'á¹²' => 'Ṳ', + 'á¹³' => 'ṳ', + 'á¹´' => 'Ṵ', + 'á¹µ' => 'ṵ', + 'á¹¶' => 'UÌ­', + 'á¹·' => 'uÌ­', + 'Ṹ' => 'ŨÌ', + 'á¹¹' => 'ũÌ', + 'Ṻ' => 'Ṻ', + 'á¹»' => 'ṻ', + 'á¹¼' => 'Ṽ', + 'á¹½' => 'ṽ', + 'á¹¾' => 'VÌ£', + 'ṿ' => 'vÌ£', + 'Ẁ' => 'WÌ€', + 'áº' => 'wÌ€', + 'Ẃ' => 'WÌ', + 'ẃ' => 'wÌ', + 'Ẅ' => 'Ẅ', + 'ẅ' => 'ẅ', + 'Ẇ' => 'Ẇ', + 'ẇ' => 'ẇ', + 'Ẉ' => 'WÌ£', + 'ẉ' => 'wÌ£', + 'Ẋ' => 'Ẋ', + 'ẋ' => 'ẋ', + 'Ẍ' => 'Ẍ', + 'áº' => 'ẍ', + 'Ẏ' => 'Ẏ', + 'áº' => 'ẏ', + 'áº' => 'ZÌ‚', + 'ẑ' => 'zÌ‚', + 'Ẓ' => 'ZÌ£', + 'ẓ' => 'zÌ£', + 'Ẕ' => 'Ẕ', + 'ẕ' => 'ẕ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'wÌŠ', + 'ẙ' => 'yÌŠ', + 'ẛ' => 'ẛ', + 'Ạ' => 'AÌ£', + 'ạ' => 'aÌ£', + 'Ả' => 'Ả', + 'ả' => 'ả', + 'Ấ' => 'AÌ‚Ì', + 'ấ' => 'aÌ‚Ì', + 'Ầ' => 'Ầ', + 'ầ' => 'ầ', + 'Ẩ' => 'Ẩ', + 'ẩ' => 'ẩ', + 'Ẫ' => 'Ẫ', + 'ẫ' => 'ẫ', + 'Ậ' => 'Ậ', + 'ậ' => 'ậ', + 'Ắ' => 'ĂÌ', + 'ắ' => 'ăÌ', + 'Ằ' => 'Ằ', + 'ằ' => 'ằ', + 'Ẳ' => 'Ẳ', + 'ẳ' => 'ẳ', + 'Ẵ' => 'Ẵ', + 'ẵ' => 'ẵ', + 'Ặ' => 'Ặ', + 'ặ' => 'ặ', + 'Ẹ' => 'EÌ£', + 'ẹ' => 'eÌ£', + 'Ẻ' => 'Ẻ', + 'ẻ' => 'ẻ', + 'Ẽ' => 'Ẽ', + 'ẽ' => 'ẽ', + 'Ế' => 'EÌ‚Ì', + 'ế' => 'eÌ‚Ì', + 'Ề' => 'Ề', + 'á»' => 'ề', + 'Ể' => 'Ể', + 'ể' => 'ể', + 'Ễ' => 'Ễ', + 'á»…' => 'ễ', + 'Ệ' => 'Ệ', + 'ệ' => 'ệ', + 'Ỉ' => 'Ỉ', + 'ỉ' => 'ỉ', + 'Ị' => 'IÌ£', + 'ị' => 'iÌ£', + 'Ọ' => 'OÌ£', + 'á»' => 'oÌ£', + 'Ỏ' => 'Ỏ', + 'á»' => 'ỏ', + 'á»' => 'OÌ‚Ì', + 'ố' => 'oÌ‚Ì', + 'á»’' => 'Ồ', + 'ồ' => 'ồ', + 'á»”' => 'Ổ', + 'ổ' => 'ổ', + 'á»–' => 'Ỗ', + 'á»—' => 'ỗ', + 'Ộ' => 'Ộ', + 'á»™' => 'ộ', + 'Ớ' => 'OÌ›Ì', + 'á»›' => 'oÌ›Ì', + 'Ờ' => 'Ờ', + 'á»' => 'ờ', + 'Ở' => 'Ở', + 'ở' => 'ở', + 'á» ' => 'Ỡ', + 'ỡ' => 'ỡ', + 'Ợ' => 'Ợ', + 'ợ' => 'ợ', + 'Ụ' => 'UÌ£', + 'ụ' => 'uÌ£', + 'Ủ' => 'Ủ', + 'á»§' => 'ủ', + 'Ứ' => 'UÌ›Ì', + 'ứ' => 'uÌ›Ì', + 'Ừ' => 'Ừ', + 'ừ' => 'ừ', + 'Ử' => 'Ử', + 'á»­' => 'ử', + 'á»®' => 'Ữ', + 'ữ' => 'ữ', + 'á»°' => 'Ự', + 'á»±' => 'ự', + 'Ỳ' => 'YÌ€', + 'ỳ' => 'yÌ€', + 'á»´' => 'YÌ£', + 'ỵ' => 'yÌ£', + 'á»¶' => 'Ỷ', + 'á»·' => 'ỷ', + 'Ỹ' => 'Ỹ', + 'ỹ' => 'ỹ', + 'á¼€' => 'ἀ', + 'á¼' => 'ἁ', + 'ἂ' => 'ἂ', + 'ἃ' => 'ἃ', + 'ἄ' => 'ἀÌ', + 'á¼…' => 'ἁÌ', + 'ἆ' => 'ἆ', + 'ἇ' => 'ἇ', + 'Ἀ' => 'Ἀ', + 'Ἁ' => 'Ἁ', + 'Ἂ' => 'Ἂ', + 'Ἃ' => 'Ἃ', + 'Ἄ' => 'ἈÌ', + 'á¼' => 'ἉÌ', + 'Ἆ' => 'Ἆ', + 'á¼' => 'Ἇ', + 'á¼' => 'ἐ', + 'ἑ' => 'ἑ', + 'á¼’' => 'ἒ', + 'ἓ' => 'ἓ', + 'á¼”' => 'ἐÌ', + 'ἕ' => 'ἑÌ', + 'Ἐ' => 'Ἐ', + 'á¼™' => 'Ἑ', + 'Ἒ' => 'Ἒ', + 'á¼›' => 'Ἓ', + 'Ἔ' => 'ἘÌ', + 'á¼' => 'ἙÌ', + 'á¼ ' => 'ἠ', + 'ἡ' => 'ἡ', + 'á¼¢' => 'ἢ', + 'á¼£' => 'ἣ', + 'ἤ' => 'ἠÌ', + 'á¼¥' => 'ἡÌ', + 'ἦ' => 'ἦ', + 'á¼§' => 'ἧ', + 'Ἠ' => 'Ἠ', + 'Ἡ' => 'Ἡ', + 'Ἢ' => 'Ἢ', + 'Ἣ' => 'Ἣ', + 'Ἤ' => 'ἨÌ', + 'á¼­' => 'ἩÌ', + 'á¼®' => 'Ἦ', + 'Ἧ' => 'Ἧ', + 'á¼°' => 'ἰ', + 'á¼±' => 'ἱ', + 'á¼²' => 'ἲ', + 'á¼³' => 'ἳ', + 'á¼´' => 'ἰÌ', + 'á¼µ' => 'ἱÌ', + 'á¼¶' => 'ἶ', + 'á¼·' => 'ἷ', + 'Ἰ' => 'Ἰ', + 'á¼¹' => 'Ἱ', + 'Ἲ' => 'Ἲ', + 'á¼»' => 'Ἳ', + 'á¼¼' => 'ἸÌ', + 'á¼½' => 'ἹÌ', + 'á¼¾' => 'Ἶ', + 'Ἷ' => 'Ἷ', + 'á½€' => 'ὀ', + 'á½' => 'ὁ', + 'ὂ' => 'ὂ', + 'ὃ' => 'ὃ', + 'ὄ' => 'ὀÌ', + 'á½…' => 'ὁÌ', + 'Ὀ' => 'Ὀ', + 'Ὁ' => 'Ὁ', + 'Ὂ' => 'Ὂ', + 'Ὃ' => 'Ὃ', + 'Ὄ' => 'ὈÌ', + 'á½' => 'ὉÌ', + 'á½' => 'Ï…Ì“', + 'ὑ' => 'Ï…Ì”', + 'á½’' => 'ὒ', + 'ὓ' => 'ὓ', + 'á½”' => 'Ï…Ì“Ì', + 'ὕ' => 'Ï…Ì”Ì', + 'á½–' => 'ὖ', + 'á½—' => 'ὗ', + 'á½™' => 'Ὑ', + 'á½›' => 'Ὓ', + 'á½' => 'ὙÌ', + 'Ὗ' => 'Ὗ', + 'á½ ' => 'ὠ', + 'ὡ' => 'ὡ', + 'á½¢' => 'ὢ', + 'á½£' => 'ὣ', + 'ὤ' => 'ὠÌ', + 'á½¥' => 'ὡÌ', + 'ὦ' => 'ὦ', + 'á½§' => 'ὧ', + 'Ὠ' => 'Ὠ', + 'Ὡ' => 'Ὡ', + 'Ὢ' => 'Ὢ', + 'Ὣ' => 'Ὣ', + 'Ὤ' => 'ὨÌ', + 'á½­' => 'ὩÌ', + 'á½®' => 'Ὦ', + 'Ὧ' => 'Ὧ', + 'á½°' => 'ὰ', + 'á½±' => 'αÌ', + 'á½²' => 'ὲ', + 'á½³' => 'εÌ', + 'á½´' => 'ὴ', + 'á½µ' => 'ηÌ', + 'á½¶' => 'ὶ', + 'á½·' => 'ιÌ', + 'ὸ' => 'ὸ', + 'á½¹' => 'οÌ', + 'ὺ' => 'Ï…Ì€', + 'á½»' => 'Ï…Ì', + 'á½¼' => 'ὼ', + 'á½½' => 'ωÌ', + 'á¾€' => 'ᾀ', + 'á¾' => 'ᾁ', + 'ᾂ' => 'ᾂ', + 'ᾃ' => 'ᾃ', + 'ᾄ' => 'ἀÌÍ…', + 'á¾…' => 'ἁÌÍ…', + 'ᾆ' => 'ᾆ', + 'ᾇ' => 'ᾇ', + 'ᾈ' => 'ᾈ', + 'ᾉ' => 'ᾉ', + 'ᾊ' => 'ᾊ', + 'ᾋ' => 'ᾋ', + 'ᾌ' => 'ἈÌÍ…', + 'á¾' => 'ἉÌÍ…', + 'ᾎ' => 'ᾎ', + 'á¾' => 'ᾏ', + 'á¾' => 'ᾐ', + 'ᾑ' => 'ᾑ', + 'á¾’' => 'ᾒ', + 'ᾓ' => 'ᾓ', + 'á¾”' => 'ἠÌÍ…', + 'ᾕ' => 'ἡÌÍ…', + 'á¾–' => 'ᾖ', + 'á¾—' => 'ᾗ', + 'ᾘ' => 'ᾘ', + 'á¾™' => 'ᾙ', + 'ᾚ' => 'ᾚ', + 'á¾›' => 'ᾛ', + 'ᾜ' => 'ἨÌÍ…', + 'á¾' => 'ἩÌÍ…', + 'ᾞ' => 'ᾞ', + 'ᾟ' => 'ᾟ', + 'á¾ ' => 'ᾠ', + 'ᾡ' => 'ᾡ', + 'á¾¢' => 'ᾢ', + 'á¾£' => 'ᾣ', + 'ᾤ' => 'ὠÌÍ…', + 'á¾¥' => 'ὡÌÍ…', + 'ᾦ' => 'ᾦ', + 'á¾§' => 'ᾧ', + 'ᾨ' => 'ᾨ', + 'ᾩ' => 'ᾩ', + 'ᾪ' => 'ᾪ', + 'ᾫ' => 'ᾫ', + 'ᾬ' => 'ὨÌÍ…', + 'á¾­' => 'ὩÌÍ…', + 'á¾®' => 'ᾮ', + 'ᾯ' => 'ᾯ', + 'á¾°' => 'ᾰ', + 'á¾±' => 'ᾱ', + 'á¾²' => 'ᾲ', + 'á¾³' => 'ᾳ', + 'á¾´' => 'αÌÍ…', + 'á¾¶' => 'ᾶ', + 'á¾·' => 'ᾷ', + 'Ᾰ' => 'Ᾰ', + 'á¾¹' => 'Ᾱ', + 'Ὰ' => 'Ὰ', + 'á¾»' => 'ΑÌ', + 'á¾¼' => 'ᾼ', + 'á¾¾' => 'ι', + 'á¿' => '῁', + 'á¿‚' => 'ῂ', + 'ῃ' => 'ῃ', + 'á¿„' => 'ηÌÍ…', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῇ', + 'Ὲ' => 'Ὲ', + 'Έ' => 'ΕÌ', + 'Ὴ' => 'Ὴ', + 'á¿‹' => 'ΗÌ', + 'ῌ' => 'ῌ', + 'á¿' => '῍', + '῎' => '᾿Ì', + 'á¿' => '῏', + 'á¿' => 'ῐ', + 'á¿‘' => 'ῑ', + 'á¿’' => 'ῒ', + 'á¿“' => 'ϊÌ', + 'á¿–' => 'ῖ', + 'á¿—' => 'ῗ', + 'Ῐ' => 'Ῐ', + 'á¿™' => 'Ῑ', + 'Ὶ' => 'Ὶ', + 'á¿›' => 'ΙÌ', + 'á¿' => '῝', + '῞' => '῾Ì', + '῟' => '῟', + 'á¿ ' => 'ῠ', + 'á¿¡' => 'Ï…Ì„', + 'á¿¢' => 'ῢ', + 'á¿£' => 'ϋÌ', + 'ῤ' => 'ÏÌ“', + 'á¿¥' => 'ÏÌ”', + 'ῦ' => 'Ï…Í‚', + 'á¿§' => 'ῧ', + 'Ῠ' => 'Ῠ', + 'á¿©' => 'Ῡ', + 'Ὺ' => 'Ὺ', + 'á¿«' => 'Î¥Ì', + 'Ῥ' => 'Ῥ', + 'á¿­' => '῭', + 'á¿®' => '¨Ì', + '`' => '`', + 'ῲ' => 'ῲ', + 'ῳ' => 'ῳ', + 'á¿´' => 'ωÌÍ…', + 'á¿¶' => 'ῶ', + 'á¿·' => 'ῷ', + 'Ὸ' => 'Ὸ', + 'Ό' => 'ΟÌ', + 'Ὼ' => 'Ὼ', + 'á¿»' => 'ΩÌ', + 'ῼ' => 'ῼ', + '´' => '´', + ' ' => ' ', + 'â€' => ' ', + 'Ω' => 'Ω', + 'K' => 'K', + 'â„«' => 'AÌŠ', + '↚' => 'â†Ì¸', + '↛' => '↛', + '↮' => '↮', + 'â‡' => 'â‡Ì¸', + '⇎' => '⇎', + 'â‡' => '⇏', + '∄' => '∄', + '∉' => '∉', + '∌' => '∌', + '∤' => '∤', + '∦' => '∦', + 'â‰' => '≁', + '≄' => '≄', + '≇' => '≇', + '≉' => '≉', + '≠' => '≠', + '≢' => '≢', + '≭' => 'â‰Ì¸', + '≮' => '≮', + '≯' => '≯', + '≰' => '≰', + '≱' => '≱', + '≴' => '≴', + '≵' => '≵', + '≸' => '≸', + '≹' => '≹', + '⊀' => '⊀', + 'âŠ' => '⊁', + '⊄' => '⊄', + '⊅' => '⊅', + '⊈' => '⊈', + '⊉' => '⊉', + '⊬' => '⊬', + '⊭' => '⊭', + '⊮' => '⊮', + '⊯' => '⊯', + 'â‹ ' => '⋠', + 'â‹¡' => '⋡', + 'â‹¢' => '⋢', + 'â‹£' => '⋣', + '⋪' => '⋪', + 'â‹«' => '⋫', + '⋬' => '⋬', + 'â‹­' => '⋭', + '〈' => '〈', + '〉' => '〉', + '⫝̸' => 'â«Ì¸', + 'ãŒ' => 'ã‹ã‚™', + 'ãŽ' => 'ãã‚™', + 'ã' => 'ãã‚™', + 'ã’' => 'ã‘ã‚™', + 'ã”' => 'ã“ã‚™', + 'ã–' => 'ã•ã‚™', + 'ã˜' => 'ã—ã‚™', + 'ãš' => 'ã™ã‚™', + 'ãœ' => 'ã›ã‚™', + 'ãž' => 'ãã‚™', + 'ã ' => 'ãŸã‚™', + 'ã¢' => 'ã¡ã‚™', + 'ã¥' => 'ã¤ã‚™', + 'ã§' => 'ã¦ã‚™', + 'ã©' => 'ã¨ã‚™', + 'ã°' => 'ã¯ã‚™', + 'ã±' => 'ã¯ã‚š', + 'ã³' => 'ã²ã‚™', + 'ã´' => 'ã²ã‚š', + 'ã¶' => 'ãµã‚™', + 'ã·' => 'ãµã‚š', + 'ã¹' => 'ã¸ã‚™', + 'ãº' => 'ã¸ã‚š', + 'ã¼' => 'ã»ã‚™', + 'ã½' => 'ã»ã‚š', + 'ã‚”' => 'ã†ã‚™', + 'ゞ' => 'ã‚ã‚™', + 'ガ' => 'ã‚«ã‚™', + 'ã‚®' => 'ã‚­ã‚™', + 'ã‚°' => 'グ', + 'ゲ' => 'ゲ', + 'ã‚´' => 'ゴ', + 'ã‚¶' => 'ザ', + 'ジ' => 'ã‚·ã‚™', + 'ズ' => 'ズ', + 'ゼ' => 'ゼ', + 'ゾ' => 'ゾ', + 'ダ' => 'ã‚¿ã‚™', + 'ヂ' => 'ãƒã‚™', + 'ヅ' => 'ヅ', + 'デ' => 'デ', + 'ド' => 'ド', + 'ãƒ' => 'ãƒã‚™', + 'パ' => 'ãƒã‚š', + 'ビ' => 'ビ', + 'ピ' => 'ピ', + 'ブ' => 'ブ', + 'プ' => 'プ', + 'ベ' => 'ベ', + 'ペ' => 'ペ', + 'ボ' => 'ボ', + 'ãƒ' => 'ポ', + 'ヴ' => 'ヴ', + 'ヷ' => 'ヷ', + 'ヸ' => 'ヸ', + 'ヹ' => 'ヹ', + 'ヺ' => 'ヺ', + 'ヾ' => 'ヾ', + '豈' => '豈', + 'ï¤' => 'æ›´', + '車' => '車', + '賈' => '賈', + '滑' => '滑', + '串' => '串', + '句' => 'å¥', + '龜' => '龜', + '龜' => '龜', + '契' => '契', + '金' => '金', + '喇' => 'å–‡', + '奈' => '奈', + 'ï¤' => '懶', + '癩' => '癩', + 'ï¤' => 'ç¾…', + 'ï¤' => '蘿', + '螺' => '螺', + '裸' => '裸', + '邏' => 'é‚', + '樂' => '樂', + '洛' => 'æ´›', + '烙' => '烙', + '珞' => 'çž', + '落' => 'è½', + '酪' => 'é…ª', + '駱' => 'é§±', + '亂' => '亂', + '卵' => 'åµ', + 'ï¤' => '欄', + '爛' => '爛', + '蘭' => '蘭', + '鸞' => '鸞', + '嵐' => 'åµ', + '濫' => 'æ¿«', + '藍' => 'è—', + '襤' => '襤', + '拉' => '拉', + '臘' => '臘', + '蠟' => 'è Ÿ', + '廊' => '廊', + '朗' => '朗', + '浪' => '浪', + '狼' => '狼', + '郎' => '郎', + '來' => '來', + '冷' => '冷', + '勞' => '勞', + '擄' => 'æ“„', + '櫓' => 'æ«“', + '爐' => 'çˆ', + '盧' => 'ç›§', + '老' => 'è€', + '蘆' => '蘆', + '虜' => '虜', + '路' => 'è·¯', + '露' => '露', + '魯' => 'é­¯', + '鷺' => 'é·º', + '碌' => '碌', + '祿' => '祿', + '綠' => 'ç¶ ', + '菉' => 'è‰', + '錄' => '錄', + '鹿' => '鹿', + 'ï¥' => 'è«–', + '壟' => '壟', + '弄' => '弄', + '籠' => 'ç± ', + '聾' => 'è¾', + '牢' => '牢', + '磊' => '磊', + '賂' => '賂', + '雷' => 'é›·', + '壘' => '壘', + '屢' => 'å±¢', + '樓' => '樓', + 'ï¥' => 'æ·š', + '漏' => 'æ¼', + 'ï¥' => 'ç´¯', + 'ï¥' => '縷', + '陋' => '陋', + '勒' => 'å‹’', + '肋' => 'è‚‹', + '凜' => '凜', + '凌' => '凌', + '稜' => '稜', + '綾' => 'ç¶¾', + '菱' => 'è±', + '陵' => '陵', + '讀' => '讀', + '拏' => 'æ‹', + '樂' => '樂', + 'ï¥' => '諾', + '丹' => '丹', + '寧' => '寧', + '怒' => '怒', + '率' => '率', + '異' => 'ç•°', + '北' => '北', + '磻' => '磻', + '便' => '便', + '復' => '復', + '不' => 'ä¸', + '泌' => '泌', + '數' => '數', + '索' => 'ç´¢', + '參' => 'åƒ', + '塞' => '塞', + '省' => 'çœ', + '葉' => '葉', + '說' => '說', + '殺' => '殺', + '辰' => 'è¾°', + '沈' => '沈', + '拾' => '拾', + '若' => 'è‹¥', + '掠' => '掠', + '略' => 'ç•¥', + '亮' => '亮', + '兩' => 'å…©', + '凉' => '凉', + '梁' => 'æ¢', + '糧' => 'ç³§', + '良' => '良', + '諒' => 'è«’', + '量' => 'é‡', + '勵' => '勵', + '呂' => 'å‘‚', + 'ï¦' => '女', + '廬' => '廬', + '旅' => 'æ—…', + '濾' => '濾', + '礪' => '礪', + '閭' => 'é–­', + '驪' => '驪', + '麗' => '麗', + '黎' => '黎', + '力' => '力', + '曆' => '曆', + '歷' => 'æ­·', + 'ï¦' => 'è½¢', + '年' => 'å¹´', + 'ï¦' => 'æ†', + 'ï¦' => '戀', + '撚' => 'æ’š', + '漣' => 'æ¼£', + '煉' => 'ç…‰', + '璉' => 'ç’‰', + '秊' => 'ç§Š', + '練' => 'ç·´', + '聯' => 'è¯', + '輦' => '輦', + '蓮' => 'è“®', + '連' => '連', + '鍊' => 'éŠ', + '列' => '列', + 'ï¦' => '劣', + '咽' => 'å’½', + '烈' => '烈', + '裂' => '裂', + '說' => '說', + '廉' => '廉', + '念' => '念', + '捻' => 'æ»', + '殮' => 'æ®®', + '簾' => 'ç°¾', + '獵' => 'çµ', + '令' => '令', + '囹' => '囹', + '寧' => '寧', + '嶺' => '嶺', + '怜' => '怜', + '玲' => '玲', + '瑩' => 'ç‘©', + '羚' => '羚', + '聆' => 'è†', + '鈴' => '鈴', + '零' => 'é›¶', + '靈' => 'éˆ', + '領' => 'é ˜', + '例' => '例', + '禮' => '禮', + '醴' => '醴', + '隸' => '隸', + '惡' => '惡', + '了' => '了', + '僚' => '僚', + '寮' => '寮', + '尿' => 'å°¿', + '料' => 'æ–™', + '樂' => '樂', + 'ï§€' => '燎', + 'ï§' => '療', + 'ï§‚' => '蓼', + '遼' => 'é¼', + 'ï§„' => 'é¾', + 'ï§…' => '暈', + '阮' => '阮', + '劉' => '劉', + '杻' => 'æ»', + '柳' => '柳', + 'ï§Š' => 'æµ', + 'ï§‹' => '溜', + 'ï§Œ' => 'ç‰', + 'ï§' => 'ç•™', + 'ï§Ž' => 'ç¡«', + 'ï§' => 'ç´', + 'ï§' => '類', + 'ï§‘' => 'å…­', + 'ï§’' => '戮', + 'ï§“' => '陸', + 'ï§”' => '倫', + 'ï§•' => 'å´™', + 'ï§–' => 'æ·ª', + 'ï§—' => '輪', + '律' => '律', + 'ï§™' => 'æ…„', + 'ï§š' => 'æ —', + 'ï§›' => '率', + 'ï§œ' => '隆', + 'ï§' => '利', + 'ï§ž' => 'å', + 'ï§Ÿ' => 'å±¥', + 'ï§ ' => '易', + 'ï§¡' => 'æŽ', + 'ï§¢' => '梨', + 'ï§£' => 'æ³¥', + '理' => 'ç†', + 'ï§¥' => 'ç—¢', + '罹' => 'ç½¹', + 'ï§§' => 'è£', + '裡' => '裡', + 'ï§©' => '里', + '離' => '離', + 'ï§«' => '匿', + '溺' => '溺', + 'ï§­' => 'å', + 'ï§®' => 'ç‡', + '璘' => 'ç’˜', + 'ï§°' => 'è—º', + 'ï§±' => '隣', + 'ï§²' => 'é±—', + 'ï§³' => '麟', + 'ï§´' => 'æž—', + 'ï§µ' => 'æ·‹', + 'ï§¶' => '臨', + 'ï§·' => 'ç«‹', + '笠' => '笠', + 'ï§¹' => 'ç²’', + '狀' => 'ç‹€', + 'ï§»' => 'ç‚™', + 'ï§¼' => 'è­˜', + 'ï§½' => '什', + 'ï§¾' => '茶', + 'ï§¿' => '刺', + '切' => '切', + 'ï¨' => '度', + '拓' => 'æ‹“', + '糖' => 'ç³–', + '宅' => 'å®…', + '洞' => 'æ´ž', + '暴' => 'æš´', + '輻' => 'è¼»', + '行' => '行', + '降' => 'é™', + '見' => '見', + '廓' => '廓', + '兀' => 'å…€', + 'ï¨' => 'å—€', + 'ï¨' => '塚', + '晴' => 'æ™´', + '凞' => '凞', + '猪' => '猪', + '益' => '益', + '礼' => '礼', + '神' => '神', + '祥' => '祥', + '福' => 'ç¦', + '靖' => 'é–', + 'ï¨' => 'ç²¾', + '羽' => 'ç¾½', + '蘒' => '蘒', + '諸' => '諸', + '逸' => '逸', + '都' => '都', + '飯' => '飯', + '飼' => '飼', + '館' => '館', + '鶴' => 'é¶´', + '郞' => '郞', + '隷' => 'éš·', + '侮' => 'ä¾®', + '僧' => '僧', + '免' => 'å…', + '勉' => '勉', + '勤' => '勤', + '卑' => 'å‘', + '喝' => 'å–', + '嘆' => '嘆', + '器' => '器', + '塀' => 'å¡€', + '墨' => '墨', + '層' => '層', + '屮' => 'å±®', + '悔' => 'æ‚”', + '慨' => 'æ…¨', + '憎' => '憎', + 'ï©€' => '懲', + 'ï©' => 'æ•', + 'ï©‚' => 'æ—¢', + '暑' => 'æš‘', + 'ï©„' => '梅', + 'ï©…' => 'æµ·', + '渚' => '渚', + '漢' => 'æ¼¢', + '煮' => 'ç…®', + '爫' => '爫', + '琢' => 'ç¢', + 'ï©‹' => '碑', + '社' => '社', + 'ï©' => '祉', + '祈' => '祈', + 'ï©' => 'ç¥', + 'ï©' => '祖', + 'ï©‘' => 'ç¥', + 'ï©’' => 'ç¦', + 'ï©“' => '禎', + 'ï©”' => 'ç©€', + 'ï©•' => 'çª', + 'ï©–' => '節', + 'ï©—' => 'ç·´', + '縉' => '縉', + 'ï©™' => 'ç¹', + '署' => 'ç½²', + 'ï©›' => '者', + '臭' => '臭', + 'ï©' => '艹', + '艹' => '艹', + '著' => 'è‘—', + 'ï© ' => 'è¤', + 'ï©¡' => '視', + 'ï©¢' => 'è¬', + 'ï©£' => '謹', + '賓' => '賓', + 'ï©¥' => 'è´ˆ', + '辶' => 'è¾¶', + 'ï©§' => '逸', + '難' => '難', + 'ï©©' => '響', + '頻' => 'é »', + 'ï©«' => 'æµ', + '𤋮' => '𤋮', + 'ï©­' => '舘', + 'ï©°' => '並', + '况' => '况', + '全' => 'å…¨', + '侀' => 'ä¾€', + 'ï©´' => 'å……', + '冀' => '冀', + 'ï©¶' => '勇', + 'ï©·' => '勺', + '喝' => 'å–', + '啕' => 'å••', + '喙' => 'å–™', + 'ï©»' => 'å—¢', + '塚' => '塚', + '墳' => '墳', + '奄' => '奄', + 'ï©¿' => '奔', + '婢' => 'å©¢', + 'ïª' => '嬨', + '廒' => 'å»’', + '廙' => 'å»™', + '彩' => '彩', + '徭' => 'å¾­', + '惘' => '惘', + '慎' => 'æ…Ž', + '愈' => '愈', + '憎' => '憎', + '慠' => 'æ… ', + '懲' => '懲', + '戴' => '戴', + 'ïª' => 'æ„', + '搜' => 'æœ', + 'ïª' => 'æ‘’', + 'ïª' => 'æ•–', + '晴' => 'æ™´', + '朗' => '朗', + '望' => '望', + '杖' => 'æ–', + '歹' => 'æ­¹', + '殺' => '殺', + '流' => 'æµ', + '滛' => 'æ»›', + '滋' => '滋', + '漢' => 'æ¼¢', + '瀞' => '瀞', + '煮' => 'ç…®', + 'ïª' => 'çž§', + '爵' => '爵', + '犯' => '犯', + '猪' => '猪', + '瑱' => '瑱', + '甆' => '甆', + '画' => 'ç”»', + '瘝' => 'ç˜', + '瘟' => '瘟', + '益' => '益', + '盛' => 'ç››', + '直' => 'ç›´', + '睊' => 'çŠ', + '着' => 'ç€', + '磌' => '磌', + '窱' => '窱', + '節' => '節', + '类' => 'ç±»', + '絛' => 'çµ›', + '練' => 'ç·´', + '缾' => 'ç¼¾', + '者' => '者', + '荒' => 'è’', + '華' => 'è¯', + '蝹' => 'è¹', + '襁' => 'è¥', + '覆' => '覆', + '視' => '視', + '調' => '調', + '諸' => '諸', + '請' => 'è«‹', + '謁' => 'è¬', + '諾' => '諾', + '諭' => 'è«­', + '謹' => '謹', + 'ï«€' => '變', + 'ï«' => 'è´ˆ', + 'ï«‚' => '輸', + '遲' => 'é²', + 'ï«„' => '醙', + 'ï«…' => '鉶', + '陼' => '陼', + '難' => '難', + '靖' => 'é–', + '韛' => '韛', + '響' => '響', + 'ï«‹' => 'é ‹', + '頻' => 'é »', + 'ï«' => '鬒', + '龜' => '龜', + 'ï«' => '𢡊', + 'ï«' => '𢡄', + 'ï«‘' => 'ð£•', + 'ï«’' => 'ã®', + 'ï«“' => '䀘', + 'ï«”' => '䀹', + 'ï«•' => '𥉉', + 'ï«–' => 'ð¥³', + 'ï«—' => '𧻓', + '齃' => '齃', + 'ï«™' => '龎', + 'ï¬' => '×™Ö´', + 'ײַ' => 'ײַ', + 'שׁ' => 'ש×', + 'שׂ' => 'שׂ', + 'שּׁ' => 'שּ×', + 'שּׂ' => 'שּׂ', + 'אַ' => '×Ö·', + 'אָ' => '×Ö¸', + 'אּ' => '×Ö¼', + 'בּ' => 'בּ', + 'גּ' => '×’Ö¼', + 'דּ' => 'דּ', + 'הּ' => '×”Ö¼', + 'וּ' => 'וּ', + 'זּ' => '×–Ö¼', + 'טּ' => 'טּ', + 'יּ' => '×™Ö¼', + 'ךּ' => 'ךּ', + 'כּ' => '×›Ö¼', + 'לּ' => 'לּ', + 'מּ' => 'מּ', + 'ï­€' => '× Ö¼', + 'ï­' => 'סּ', + 'ï­ƒ' => '×£Ö¼', + 'ï­„' => 'פּ', + 'ï­†' => 'צּ', + 'ï­‡' => '×§Ö¼', + 'ï­ˆ' => 'רּ', + 'ï­‰' => 'שּ', + 'ï­Š' => 'תּ', + 'ï­‹' => 'וֹ', + 'ï­Œ' => 'בֿ', + 'ï­' => '×›Ö¿', + 'ï­Ž' => 'פֿ', + 'ð‘‚š' => '𑂚', + 'ð‘‚œ' => '𑂜', + 'ð‘‚«' => '𑂫', + 'ð‘„®' => '𑄮', + '𑄯' => '𑄯', + 'ð‘‹' => 'ð‘‡ð‘Œ¾', + 'ð‘Œ' => 'ð‘‡ð‘—', + 'ð‘’»' => '𑒻', + 'ð‘’¼' => '𑒼', + 'ð‘’¾' => '𑒾', + 'ð‘–º' => '𑖺', + 'ð‘–»' => '𑖻', + '𑤸' => '𑤸', + 'ð…ž' => 'ð…—ð…¥', + 'ð…Ÿ' => 'ð…˜ð…¥', + 'ð… ' => 'ð…˜ð…¥ð…®', + 'ð…¡' => 'ð…˜ð…¥ð…¯', + 'ð…¢' => 'ð…˜ð…¥ð…°', + 'ð…£' => 'ð…˜ð…¥ð…±', + 'ð…¤' => 'ð…˜ð…¥ð…²', + 'ð†»' => 'ð†¹ð…¥', + 'ð†¼' => 'ð†ºð…¥', + 'ð†½' => 'ð†¹ð…¥ð…®', + 'ð†¾' => 'ð†ºð…¥ð…®', + 'ð†¿' => 'ð†¹ð…¥ð…¯', + 'ð‡€' => 'ð†ºð…¥ð…¯', + '丽' => '丽', + 'ð¯ ' => '丸', + '乁' => 'ä¹', + '𠄢' => 'ð „¢', + '你' => 'ä½ ', + '侮' => 'ä¾®', + '侻' => 'ä¾»', + '倂' => '倂', + '偺' => 'åº', + '備' => 'å‚™', + '僧' => '僧', + '像' => 'åƒ', + '㒞' => 'ã’ž', + 'ð¯ ' => '𠘺', + '免' => 'å…', + 'ð¯ ' => 'å…”', + 'ð¯ ' => 'å…¤', + '具' => 'å…·', + '𠔜' => '𠔜', + '㒹' => 'ã’¹', + '內' => 'å…§', + '再' => 'å†', + '𠕋' => 'ð •‹', + '冗' => '冗', + '冤' => '冤', + '仌' => '仌', + '冬' => '冬', + '况' => '况', + '𩇟' => '𩇟', + 'ð¯ ' => '凵', + '刃' => '刃', + '㓟' => '㓟', + '刻' => '刻', + '剆' => '剆', + '割' => '割', + '剷' => '剷', + '㔕' => '㔕', + '勇' => '勇', + '勉' => '勉', + '勤' => '勤', + '勺' => '勺', + '包' => '包', + '匆' => '匆', + '北' => '北', + '卉' => 'å‰', + '卑' => 'å‘', + '博' => 'åš', + '即' => 'å³', + '卽' => 'å½', + '卿' => 'å¿', + '卿' => 'å¿', + '卿' => 'å¿', + '𠨬' => '𠨬', + '灰' => 'ç°', + '及' => 'åŠ', + '叟' => 'åŸ', + '𠭣' => 'ð ­£', + '叫' => 'å«', + '叱' => 'å±', + '吆' => 'å†', + '咞' => 'å’ž', + '吸' => 'å¸', + '呈' => '呈', + '周' => '周', + '咢' => 'å’¢', + 'ð¯¡' => 'å“¶', + '唐' => 'å”', + '啓' => 'å•“', + '啣' => 'å•£', + '善' => 'å–„', + '善' => 'å–„', + '喙' => 'å–™', + '喫' => 'å–«', + '喳' => 'å–³', + '嗂' => 'å—‚', + '圖' => '圖', + '嘆' => '嘆', + 'ð¯¡' => '圗', + '噑' => '噑', + 'ð¯¡' => 'å™´', + 'ð¯¡' => '切', + '壮' => '壮', + '城' => '城', + '埴' => '埴', + '堍' => 'å ', + '型' => 'åž‹', + '堲' => 'å ²', + '報' => 'å ±', + '墬' => '墬', + '𡓤' => '𡓤', + '売' => '売', + '壷' => '壷', + '夆' => '夆', + 'ð¯¡' => '多', + '夢' => '夢', + '奢' => '奢', + '𡚨' => '𡚨', + '𡛪' => '𡛪', + '姬' => '姬', + '娛' => '娛', + '娧' => '娧', + '姘' => '姘', + '婦' => '婦', + '㛮' => 'ã›®', + '㛼' => '㛼', + '嬈' => '嬈', + '嬾' => '嬾', + '嬾' => '嬾', + '𡧈' => '𡧈', + '寃' => '寃', + '寘' => '寘', + '寧' => '寧', + '寳' => '寳', + '𡬘' => '𡬘', + '寿' => '寿', + '将' => 'å°†', + '当' => '当', + '尢' => 'å°¢', + '㞁' => 'ãž', + '屠' => 'å± ', + '屮' => 'å±®', + '峀' => 'å³€', + '岍' => 'å²', + '𡷤' => 'ð¡·¤', + '嵃' => '嵃', + '𡷦' => 'ð¡·¦', + '嵮' => 'åµ®', + '嵫' => '嵫', + '嵼' => 'åµ¼', + 'ð¯¢' => 'å·¡', + '巢' => 'å·¢', + '㠯' => 'ã ¯', + '巽' => 'å·½', + '帨' => '帨', + '帽' => '帽', + '幩' => '幩', + '㡢' => 'ã¡¢', + '𢆃' => '𢆃', + '㡼' => '㡼', + '庰' => '庰', + '庳' => '庳', + 'ð¯¢' => '庶', + '廊' => '廊', + 'ð¯¢' => '𪎒', + 'ð¯¢' => '廾', + '𢌱' => '𢌱', + '𢌱' => '𢌱', + '舁' => 'èˆ', + '弢' => 'å¼¢', + '弢' => 'å¼¢', + '㣇' => '㣇', + '𣊸' => '𣊸', + '𦇚' => '𦇚', + '形' => 'å½¢', + '彫' => '彫', + '㣣' => '㣣', + '徚' => '徚', + 'ð¯¢' => 'å¿', + '志' => 'å¿—', + '忹' => '忹', + '悁' => 'æ‚', + '㤺' => '㤺', + '㤜' => '㤜', + '悔' => 'æ‚”', + '𢛔' => '𢛔', + '惇' => '惇', + '慈' => 'æ…ˆ', + '慌' => 'æ…Œ', + '慎' => 'æ…Ž', + '慌' => 'æ…Œ', + '慺' => 'æ…º', + '憎' => '憎', + '憲' => '憲', + '憤' => '憤', + '憯' => '憯', + '懞' => '懞', + '懲' => '懲', + '懶' => '懶', + '成' => 'æˆ', + '戛' => '戛', + '扝' => 'æ‰', + '抱' => '抱', + '拔' => 'æ‹”', + '捐' => 'æ', + '𢬌' => '𢬌', + '挽' => '挽', + '拼' => '拼', + '捨' => 'æ¨', + '掃' => '掃', + '揤' => 'æ¤', + '𢯱' => '𢯱', + '搢' => 'æ¢', + '揅' => 'æ…', + 'ð¯£' => '掩', + '㨮' => '㨮', + '摩' => 'æ‘©', + '摾' => '摾', + '撝' => 'æ’', + '摷' => 'æ‘·', + '㩬' => '㩬', + '敏' => 'æ•', + '敬' => '敬', + '𣀊' => '𣀊', + '旣' => 'æ—£', + '書' => '書', + 'ð¯£' => '晉', + '㬙' => '㬙', + 'ð¯£' => 'æš‘', + 'ð¯£' => '㬈', + '㫤' => '㫤', + '冒' => '冒', + '冕' => '冕', + '最' => '最', + '暜' => 'æšœ', + '肭' => 'è‚­', + '䏙' => 'ä™', + '朗' => '朗', + '望' => '望', + '朡' => '朡', + '杞' => 'æž', + '杓' => 'æ“', + 'ð¯£' => 'ð£ƒ', + '㭉' => 'ã­‰', + '柺' => '柺', + '枅' => 'æž…', + '桒' => 'æ¡’', + '梅' => '梅', + '𣑭' => '𣑭', + '梎' => '梎', + '栟' => 'æ Ÿ', + '椔' => '椔', + '㮝' => 'ã®', + '楂' => '楂', + '榣' => '榣', + '槪' => '槪', + '檨' => '檨', + '𣚣' => '𣚣', + '櫛' => 'æ«›', + '㰘' => 'ã°˜', + '次' => '次', + '𣢧' => '𣢧', + '歔' => 'æ­”', + '㱎' => '㱎', + '歲' => 'æ­²', + '殟' => '殟', + '殺' => '殺', + '殻' => 'æ®»', + '𣪍' => 'ð£ª', + '𡴋' => 'ð¡´‹', + '𣫺' => '𣫺', + '汎' => '汎', + '𣲼' => '𣲼', + '沿' => '沿', + '泍' => 'æ³', + '汧' => 'æ±§', + '洖' => 'æ´–', + '派' => 'æ´¾', + 'ð¯¤' => 'æµ·', + '流' => 'æµ', + '浩' => '浩', + '浸' => '浸', + '涅' => 'æ¶…', + '𣴞' => '𣴞', + '洴' => 'æ´´', + '港' => '港', + '湮' => 'æ¹®', + '㴳' => 'ã´³', + '滋' => '滋', + '滇' => '滇', + 'ð¯¤' => '𣻑', + '淹' => 'æ·¹', + 'ð¯¤' => 'æ½®', + 'ð¯¤' => '𣽞', + '𣾎' => '𣾎', + '濆' => '濆', + '瀹' => '瀹', + '瀞' => '瀞', + '瀛' => '瀛', + '㶖' => 'ã¶–', + '灊' => 'çŠ', + '災' => 'ç½', + '灷' => 'ç·', + '炭' => 'ç‚­', + '𠔥' => '𠔥', + '煅' => 'ç……', + 'ð¯¤' => '𤉣', + '熜' => '熜', + '𤎫' => '𤎫', + '爨' => '爨', + '爵' => '爵', + '牐' => 'ç‰', + '𤘈' => '𤘈', + '犀' => '犀', + '犕' => '犕', + '𤜵' => '𤜵', + '𤠔' => '𤠔', + '獺' => 'çº', + '王' => '王', + '㺬' => '㺬', + '玥' => '玥', + '㺸' => '㺸', + '㺸' => '㺸', + '瑇' => '瑇', + '瑜' => '瑜', + '瑱' => '瑱', + '璅' => 'ç’…', + '瓊' => '瓊', + '㼛' => 'ã¼›', + '甤' => '甤', + '𤰶' => '𤰶', + '甾' => '甾', + '𤲒' => '𤲒', + '異' => 'ç•°', + '𢆟' => '𢆟', + '瘐' => 'ç˜', + '𤾡' => '𤾡', + '𤾸' => '𤾸', + '𥁄' => 'ð¥„', + '㿼' => '㿼', + '䀈' => '䀈', + '直' => 'ç›´', + 'ð¯¥' => '𥃳', + '𥃲' => '𥃲', + '𥄙' => '𥄙', + '𥄳' => '𥄳', + '眞' => '眞', + '真' => '真', + '真' => '真', + '睊' => 'çŠ', + '䀹' => '䀹', + '瞋' => 'çž‹', + '䁆' => 'ä†', + '䂖' => 'ä‚–', + 'ð¯¥' => 'ð¥', + '硎' => '硎', + 'ð¯¥' => '碌', + 'ð¯¥' => '磌', + '䃣' => '䃣', + '𥘦' => '𥘦', + '祖' => '祖', + '𥚚' => '𥚚', + '𥛅' => '𥛅', + '福' => 'ç¦', + '秫' => 'ç§«', + '䄯' => '䄯', + '穀' => 'ç©€', + '穊' => '穊', + '穏' => 'ç©', + '𥥼' => '𥥼', + 'ð¯¥' => '𥪧', + '𥪧' => '𥪧', + '竮' => 'ç«®', + '䈂' => '䈂', + '𥮫' => '𥮫', + '篆' => '篆', + '築' => '築', + '䈧' => '䈧', + '𥲀' => '𥲀', + '糒' => 'ç³’', + '䊠' => '䊠', + '糨' => '糨', + '糣' => 'ç³£', + '紀' => 'ç´€', + '𥾆' => '𥾆', + '絣' => 'çµ£', + '䌁' => 'äŒ', + '緇' => 'ç·‡', + '縂' => '縂', + '繅' => 'ç¹…', + '䌴' => '䌴', + '𦈨' => '𦈨', + '𦉇' => '𦉇', + '䍙' => 'ä™', + '𦋙' => '𦋙', + '罺' => '罺', + '𦌾' => '𦌾', + '羕' => '羕', + '翺' => '翺', + '者' => '者', + '𦓚' => '𦓚', + '𦔣' => '𦔣', + '聠' => 'è ', + '𦖨' => '𦖨', + '聰' => 'è°', + '𣍟' => 'ð£Ÿ', + 'ð¯¦' => 'ä•', + '育' => '育', + '脃' => '脃', + '䐋' => 'ä‹', + '脾' => '脾', + '媵' => '媵', + '𦞧' => '𦞧', + '𦞵' => '𦞵', + '𣎓' => '𣎓', + '𣎜' => '𣎜', + '舁' => 'èˆ', + '舄' => '舄', + 'ð¯¦' => '辞', + '䑫' => 'ä‘«', + 'ð¯¦' => '芑', + 'ð¯¦' => '芋', + '芝' => 'èŠ', + '劳' => '劳', + '花' => '花', + '芳' => '芳', + '芽' => '芽', + '苦' => '苦', + '𦬼' => '𦬼', + '若' => 'è‹¥', + '茝' => 'èŒ', + '荣' => 'è£', + '莭' => '莭', + '茣' => '茣', + 'ð¯¦' => '莽', + '菧' => 'è§', + '著' => 'è‘—', + '荓' => 'è“', + '菊' => 'èŠ', + '菌' => 'èŒ', + '菜' => 'èœ', + '𦰶' => '𦰶', + '𦵫' => '𦵫', + '𦳕' => '𦳕', + '䔫' => '䔫', + '蓱' => '蓱', + '蓳' => '蓳', + '蔖' => 'è”–', + '𧏊' => 'ð§Š', + '蕤' => '蕤', + '𦼬' => '𦼬', + '䕝' => 'ä•', + '䕡' => 'ä•¡', + '𦾱' => '𦾱', + '𧃒' => '𧃒', + '䕫' => 'ä•«', + '虐' => 'è™', + '虜' => '虜', + '虧' => 'è™§', + '虩' => '虩', + '蚩' => 'èš©', + '蚈' => '蚈', + '蜎' => '蜎', + '蛢' => '蛢', + '蝹' => 'è¹', + '蜨' => '蜨', + '蝫' => 'è«', + '螆' => '螆', + '䗗' => 'ä——', + '蟡' => '蟡', + 'ð¯§' => 'è ', + '䗹' => 'ä—¹', + '衠' => 'è¡ ', + '衣' => 'è¡£', + '𧙧' => 'ð§™§', + '裗' => '裗', + '裞' => '裞', + '䘵' => '䘵', + '裺' => '裺', + '㒻' => 'ã’»', + '𧢮' => 'ð§¢®', + '𧥦' => '𧥦', + 'ð¯§' => 'äš¾', + '䛇' => '䛇', + 'ð¯§' => '誠', + 'ð¯§' => 'è«­', + '變' => '變', + '豕' => '豕', + '𧲨' => '𧲨', + '貫' => '貫', + '賁' => 'è³', + '贛' => 'è´›', + '起' => 'èµ·', + '𧼯' => '𧼯', + '𠠄' => 'ð  „', + '跋' => 'è·‹', + '趼' => 'è¶¼', + '跰' => 'è·°', + 'ð¯§' => '𠣞', + '軔' => 'è»”', + '輸' => '輸', + '𨗒' => '𨗒', + '𨗭' => '𨗭', + '邔' => 'é‚”', + '郱' => '郱', + '鄑' => 'é„‘', + '𨜮' => '𨜮', + '鄛' => 'é„›', + '鈸' => '鈸', + '鋗' => 'é‹—', + '鋘' => '鋘', + '鉼' => '鉼', + '鏹' => 'é¹', + '鐕' => 'é•', + '𨯺' => '𨯺', + '開' => 'é–‹', + '䦕' => '䦕', + '閷' => 'é–·', + '𨵷' => '𨵷', + '䧦' => '䧦', + '雃' => '雃', + '嶲' => 'å¶²', + '霣' => '霣', + '𩅅' => 'ð©……', + '𩈚' => '𩈚', + '䩮' => 'ä©®', + '䩶' => 'ä©¶', + '韠' => '韠', + '𩐊' => 'ð©Š', + '䪲' => '䪲', + '𩒖' => 'ð©’–', + '頋' => 'é ‹', + '頋' => 'é ‹', + '頩' => 'é ©', + 'ð¯¨' => 'ð©–¶', + '飢' => '飢', + '䬳' => '䬳', + '餩' => '餩', + '馧' => '馧', + '駂' => 'é§‚', + '駾' => 'é§¾', + '䯎' => '䯎', + '𩬰' => '𩬰', + '鬒' => '鬒', + '鱀' => 'é±€', + '鳽' => 'é³½', + 'ð¯¨' => '䳎', + '䳭' => 'ä³­', + 'ð¯¨' => 'éµ§', + 'ð¯¨' => '𪃎', + '䳸' => '䳸', + '𪄅' => '𪄅', + '𪈎' => '𪈎', + '𪊑' => '𪊑', + '麻' => '麻', + '䵖' => 'äµ–', + '黹' => '黹', + '黾' => '黾', + '鼅' => 'é¼…', + '鼏' => 'é¼', + '鼖' => 'é¼–', + '鼻' => 'é¼»', + 'ð¯¨' => '𪘀', +); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php new file mode 100644 index 0000000000..ec90f36eb6 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php @@ -0,0 +1,876 @@ +<?php + +return array ( + 'Ì€' => 230, + 'Ì' => 230, + 'Ì‚' => 230, + '̃' => 230, + 'Ì„' => 230, + 'Ì…' => 230, + '̆' => 230, + '̇' => 230, + '̈' => 230, + '̉' => 230, + 'ÌŠ' => 230, + 'Ì‹' => 230, + 'ÌŒ' => 230, + 'Ì' => 230, + 'ÌŽ' => 230, + 'Ì' => 230, + 'Ì' => 230, + 'Ì‘' => 230, + 'Ì’' => 230, + 'Ì“' => 230, + 'Ì”' => 230, + 'Ì•' => 232, + 'Ì–' => 220, + 'Ì—' => 220, + '̘' => 220, + 'Ì™' => 220, + 'Ìš' => 232, + 'Ì›' => 216, + 'Ìœ' => 220, + 'Ì' => 220, + 'Ìž' => 220, + 'ÌŸ' => 220, + 'Ì ' => 220, + 'Ì¡' => 202, + 'Ì¢' => 202, + 'Ì£' => 220, + '̤' => 220, + 'Ì¥' => 220, + '̦' => 220, + '̧' => 202, + '̨' => 202, + 'Ì©' => 220, + '̪' => 220, + 'Ì«' => 220, + '̬' => 220, + 'Ì­' => 220, + 'Ì®' => 220, + '̯' => 220, + '̰' => 220, + '̱' => 220, + '̲' => 220, + '̳' => 220, + 'Ì´' => 1, + '̵' => 1, + '̶' => 1, + 'Ì·' => 1, + '̸' => 1, + '̹' => 220, + '̺' => 220, + 'Ì»' => 220, + '̼' => 220, + '̽' => 230, + '̾' => 230, + 'Ì¿' => 230, + 'Í€' => 230, + 'Í' => 230, + 'Í‚' => 230, + '̓' => 230, + 'Í„' => 230, + 'Í…' => 240, + '͆' => 230, + '͇' => 220, + '͈' => 220, + '͉' => 220, + 'ÍŠ' => 230, + 'Í‹' => 230, + 'ÍŒ' => 230, + 'Í' => 220, + 'ÍŽ' => 220, + 'Í' => 230, + 'Í‘' => 230, + 'Í’' => 230, + 'Í“' => 220, + 'Í”' => 220, + 'Í•' => 220, + 'Í–' => 220, + 'Í—' => 230, + '͘' => 232, + 'Í™' => 220, + 'Íš' => 220, + 'Í›' => 230, + 'Íœ' => 233, + 'Í' => 234, + 'Íž' => 234, + 'ÍŸ' => 233, + 'Í ' => 234, + 'Í¡' => 234, + 'Í¢' => 233, + 'Í£' => 230, + 'ͤ' => 230, + 'Í¥' => 230, + 'ͦ' => 230, + 'ͧ' => 230, + 'ͨ' => 230, + 'Í©' => 230, + 'ͪ' => 230, + 'Í«' => 230, + 'ͬ' => 230, + 'Í­' => 230, + 'Í®' => 230, + 'ͯ' => 230, + 'Òƒ' => 230, + 'Ò„' => 230, + 'Ò…' => 230, + 'Ò†' => 230, + 'Ò‡' => 230, + 'Ö‘' => 220, + 'Ö’' => 230, + 'Ö“' => 230, + 'Ö”' => 230, + 'Ö•' => 230, + 'Ö–' => 220, + 'Ö—' => 230, + 'Ö˜' => 230, + 'Ö™' => 230, + 'Öš' => 222, + 'Ö›' => 220, + 'Öœ' => 230, + 'Ö' => 230, + 'Öž' => 230, + 'ÖŸ' => 230, + 'Ö ' => 230, + 'Ö¡' => 230, + 'Ö¢' => 220, + 'Ö£' => 220, + 'Ö¤' => 220, + 'Ö¥' => 220, + 'Ö¦' => 220, + 'Ö§' => 220, + 'Ö¨' => 230, + 'Ö©' => 230, + 'Öª' => 220, + 'Ö«' => 230, + 'Ö¬' => 230, + 'Ö­' => 222, + 'Ö®' => 228, + 'Ö¯' => 230, + 'Ö°' => 10, + 'Ö±' => 11, + 'Ö²' => 12, + 'Ö³' => 13, + 'Ö´' => 14, + 'Öµ' => 15, + 'Ö¶' => 16, + 'Ö·' => 17, + 'Ö¸' => 18, + 'Ö¹' => 19, + 'Öº' => 19, + 'Ö»' => 20, + 'Ö¼' => 21, + 'Ö½' => 22, + 'Ö¿' => 23, + '×' => 24, + 'ׂ' => 25, + 'ׄ' => 230, + '×…' => 220, + 'ׇ' => 18, + 'Ø' => 230, + 'Ø‘' => 230, + 'Ø’' => 230, + 'Ø“' => 230, + 'Ø”' => 230, + 'Ø•' => 230, + 'Ø–' => 230, + 'Ø—' => 230, + 'ؘ' => 30, + 'Ø™' => 31, + 'Øš' => 32, + 'Ù‹' => 27, + 'ÙŒ' => 28, + 'Ù' => 29, + 'ÙŽ' => 30, + 'Ù' => 31, + 'Ù' => 32, + 'Ù‘' => 33, + 'Ù’' => 34, + 'Ù“' => 230, + 'Ù”' => 230, + 'Ù•' => 220, + 'Ù–' => 220, + 'Ù—' => 230, + 'Ù˜' => 230, + 'Ù™' => 230, + 'Ùš' => 230, + 'Ù›' => 230, + 'Ùœ' => 220, + 'Ù' => 230, + 'Ùž' => 230, + 'ÙŸ' => 220, + 'Ù°' => 35, + 'Û–' => 230, + 'Û—' => 230, + 'Û˜' => 230, + 'Û™' => 230, + 'Ûš' => 230, + 'Û›' => 230, + 'Ûœ' => 230, + 'ÛŸ' => 230, + 'Û ' => 230, + 'Û¡' => 230, + 'Û¢' => 230, + 'Û£' => 220, + 'Û¤' => 230, + 'Û§' => 230, + 'Û¨' => 230, + 'Ûª' => 220, + 'Û«' => 230, + 'Û¬' => 230, + 'Û­' => 220, + 'Ü‘' => 36, + 'ܰ' => 230, + 'ܱ' => 220, + 'ܲ' => 230, + 'ܳ' => 230, + 'Ü´' => 220, + 'ܵ' => 230, + 'ܶ' => 230, + 'Ü·' => 220, + 'ܸ' => 220, + 'ܹ' => 220, + 'ܺ' => 230, + 'Ü»' => 220, + 'ܼ' => 220, + 'ܽ' => 230, + 'ܾ' => 220, + 'Ü¿' => 230, + 'Ý€' => 230, + 'Ý' => 230, + 'Ý‚' => 220, + '݃' => 230, + 'Ý„' => 220, + 'Ý…' => 230, + '݆' => 220, + '݇' => 230, + '݈' => 220, + '݉' => 230, + 'ÝŠ' => 230, + 'ß«' => 230, + '߬' => 230, + 'ß­' => 230, + 'ß®' => 230, + '߯' => 230, + 'ß°' => 230, + 'ß±' => 230, + 'ß²' => 220, + 'ß³' => 230, + 'ß½' => 220, + 'à –' => 230, + 'à —' => 230, + 'à ˜' => 230, + 'à ™' => 230, + 'à ›' => 230, + 'à œ' => 230, + 'à ' => 230, + 'à ž' => 230, + 'à Ÿ' => 230, + 'à  ' => 230, + 'à ¡' => 230, + 'à ¢' => 230, + 'à £' => 230, + 'à ¥' => 230, + 'à ¦' => 230, + 'à §' => 230, + 'à ©' => 230, + 'à ª' => 230, + 'à «' => 230, + 'à ¬' => 230, + 'à ­' => 230, + 'à¡™' => 220, + '࡚' => 220, + 'à¡›' => 220, + '࣓' => 220, + 'ࣔ' => 230, + 'ࣕ' => 230, + 'ࣖ' => 230, + 'ࣗ' => 230, + 'ࣘ' => 230, + 'ࣙ' => 230, + 'ࣚ' => 230, + 'ࣛ' => 230, + 'ࣜ' => 230, + 'à£' => 230, + 'ࣞ' => 230, + 'ࣟ' => 230, + '࣠' => 230, + '࣡' => 230, + 'ࣣ' => 220, + 'ࣤ' => 230, + 'ࣥ' => 230, + 'ࣦ' => 220, + 'ࣧ' => 230, + 'ࣨ' => 230, + 'ࣩ' => 220, + '࣪' => 230, + '࣫' => 230, + '࣬' => 230, + '࣭' => 220, + '࣮' => 220, + '࣯' => 220, + 'ࣰ' => 27, + 'ࣱ' => 28, + 'ࣲ' => 29, + 'ࣳ' => 230, + 'ࣴ' => 230, + 'ࣵ' => 230, + 'ࣶ' => 220, + 'ࣷ' => 230, + 'ࣸ' => 230, + 'ࣹ' => 220, + 'ࣺ' => 220, + 'ࣻ' => 230, + 'ࣼ' => 230, + 'ࣽ' => 230, + 'ࣾ' => 230, + 'ࣿ' => 230, + '़' => 7, + 'à¥' => 9, + '॑' => 230, + '॒' => 220, + '॓' => 230, + '॔' => 230, + '়' => 7, + 'à§' => 9, + 'à§¾' => 230, + '਼' => 7, + 'à©' => 9, + '઼' => 7, + 'à«' => 9, + '଼' => 7, + 'à­' => 9, + 'à¯' => 9, + 'à±' => 9, + 'ౕ' => 84, + 'à±–' => 91, + '಼' => 7, + 'à³' => 9, + 'à´»' => 9, + 'à´¼' => 9, + 'àµ' => 9, + 'à·Š' => 9, + 'ุ' => 103, + 'ู' => 103, + 'ฺ' => 9, + '่' => 107, + '้' => 107, + '๊' => 107, + '๋' => 107, + 'ຸ' => 118, + 'ູ' => 118, + '຺' => 9, + '່' => 122, + '້' => 122, + '໊' => 122, + '໋' => 122, + '༘' => 220, + '༙' => 220, + '༵' => 220, + '༷' => 220, + '༹' => 216, + 'ཱ' => 129, + 'ི' => 130, + 'ུ' => 132, + 'ེ' => 130, + 'ཻ' => 130, + 'ོ' => 130, + 'ཽ' => 130, + 'ྀ' => 130, + 'ྂ' => 230, + 'ྃ' => 230, + '྄' => 9, + '྆' => 230, + '྇' => 230, + '࿆' => 220, + '့' => 7, + '္' => 9, + '်' => 9, + 'á‚' => 220, + 'á' => 230, + 'áž' => 230, + 'áŸ' => 230, + '᜔' => 9, + '᜴' => 9, + '្' => 9, + 'áŸ' => 230, + 'ᢩ' => 228, + '᤹' => 222, + '᤺' => 230, + '᤻' => 220, + 'ᨗ' => 230, + 'ᨘ' => 220, + 'á© ' => 9, + '᩵' => 230, + 'á©¶' => 230, + 'á©·' => 230, + '᩸' => 230, + '᩹' => 230, + '᩺' => 230, + 'á©»' => 230, + '᩼' => 230, + 'á©¿' => 220, + '᪰' => 230, + '᪱' => 230, + '᪲' => 230, + '᪳' => 230, + '᪴' => 230, + '᪵' => 220, + '᪶' => 220, + '᪷' => 220, + '᪸' => 220, + '᪹' => 220, + '᪺' => 220, + '᪻' => 230, + '᪼' => 230, + '᪽' => 220, + 'ᪿ' => 220, + 'á«€' => 220, + '᬴' => 7, + 'á­„' => 9, + 'á­«' => 230, + 'á­¬' => 220, + 'á­­' => 230, + 'á­®' => 230, + 'á­¯' => 230, + 'á­°' => 230, + 'á­±' => 230, + 'á­²' => 230, + 'á­³' => 230, + '᮪' => 9, + '᮫' => 9, + '᯦' => 7, + '᯲' => 9, + '᯳' => 9, + 'á°·' => 7, + 'á³' => 230, + '᳑' => 230, + 'á³’' => 230, + 'á³”' => 1, + '᳕' => 220, + 'á³–' => 220, + 'á³—' => 220, + '᳘' => 220, + 'á³™' => 220, + '᳚' => 230, + 'á³›' => 230, + '᳜' => 220, + 'á³' => 220, + '᳞' => 220, + '᳟' => 220, + 'á³ ' => 230, + 'á³¢' => 1, + 'á³£' => 1, + '᳤' => 1, + 'á³¥' => 1, + '᳦' => 1, + 'á³§' => 1, + '᳨' => 1, + 'á³­' => 220, + 'á³´' => 230, + '᳸' => 230, + 'á³¹' => 230, + 'á·€' => 230, + 'á·' => 230, + 'á·‚' => 220, + 'á·ƒ' => 230, + 'á·„' => 230, + 'á·…' => 230, + 'á·†' => 230, + 'á·‡' => 230, + 'á·ˆ' => 230, + 'á·‰' => 230, + 'á·Š' => 220, + 'á·‹' => 230, + 'á·Œ' => 230, + 'á·' => 234, + 'á·Ž' => 214, + 'á·' => 220, + 'á·' => 202, + 'á·‘' => 230, + 'á·’' => 230, + 'á·“' => 230, + 'á·”' => 230, + 'á·•' => 230, + 'á·–' => 230, + 'á·—' => 230, + 'á·˜' => 230, + 'á·™' => 230, + 'á·š' => 230, + 'á·›' => 230, + 'á·œ' => 230, + 'á·' => 230, + 'á·ž' => 230, + 'á·Ÿ' => 230, + 'á· ' => 230, + 'á·¡' => 230, + 'á·¢' => 230, + 'á·£' => 230, + 'á·¤' => 230, + 'á·¥' => 230, + 'á·¦' => 230, + 'á·§' => 230, + 'á·¨' => 230, + 'á·©' => 230, + 'á·ª' => 230, + 'á·«' => 230, + 'á·¬' => 230, + 'á·­' => 230, + 'á·®' => 230, + 'á·¯' => 230, + 'á·°' => 230, + 'á·±' => 230, + 'á·²' => 230, + 'á·³' => 230, + 'á·´' => 230, + 'á·µ' => 230, + 'á·¶' => 232, + 'á··' => 228, + 'á·¸' => 228, + 'á·¹' => 220, + 'á·»' => 230, + 'á·¼' => 233, + 'á·½' => 220, + 'á·¾' => 230, + 'á·¿' => 220, + 'âƒ' => 230, + '⃑' => 230, + '⃒' => 1, + '⃓' => 1, + '⃔' => 230, + '⃕' => 230, + '⃖' => 230, + '⃗' => 230, + '⃘' => 1, + '⃙' => 1, + '⃚' => 1, + '⃛' => 230, + '⃜' => 230, + '⃡' => 230, + '⃥' => 1, + '⃦' => 1, + '⃧' => 230, + '⃨' => 220, + '⃩' => 230, + '⃪' => 1, + '⃫' => 1, + '⃬' => 220, + '⃭' => 220, + '⃮' => 220, + '⃯' => 220, + '⃰' => 230, + '⳯' => 230, + 'â³°' => 230, + 'â³±' => 230, + '⵿' => 9, + 'â· ' => 230, + 'â·¡' => 230, + 'â·¢' => 230, + 'â·£' => 230, + 'â·¤' => 230, + 'â·¥' => 230, + 'â·¦' => 230, + 'â·§' => 230, + 'â·¨' => 230, + 'â·©' => 230, + 'â·ª' => 230, + 'â·«' => 230, + 'â·¬' => 230, + 'â·­' => 230, + 'â·®' => 230, + 'â·¯' => 230, + 'â·°' => 230, + 'â·±' => 230, + 'â·²' => 230, + 'â·³' => 230, + 'â·´' => 230, + 'â·µ' => 230, + 'â·¶' => 230, + 'â··' => 230, + 'â·¸' => 230, + 'â·¹' => 230, + 'â·º' => 230, + 'â·»' => 230, + 'â·¼' => 230, + 'â·½' => 230, + 'â·¾' => 230, + 'â·¿' => 230, + '〪' => 218, + '〫' => 228, + '〬' => 232, + '〭' => 222, + '〮' => 224, + '〯' => 224, + 'ã‚™' => 8, + '゚' => 8, + '꙯' => 230, + 'ê™´' => 230, + 'ꙵ' => 230, + 'ê™¶' => 230, + 'ê™·' => 230, + 'ꙸ' => 230, + 'ꙹ' => 230, + 'ꙺ' => 230, + 'ê™»' => 230, + '꙼' => 230, + '꙽' => 230, + 'êšž' => 230, + 'ꚟ' => 230, + 'ê›°' => 230, + 'ê›±' => 230, + 'ê †' => 9, + 'ê ¬' => 9, + '꣄' => 9, + '꣠' => 230, + '꣡' => 230, + '꣢' => 230, + '꣣' => 230, + '꣤' => 230, + '꣥' => 230, + '꣦' => 230, + '꣧' => 230, + '꣨' => 230, + '꣩' => 230, + '꣪' => 230, + '꣫' => 230, + '꣬' => 230, + '꣭' => 230, + '꣮' => 230, + '꣯' => 230, + '꣰' => 230, + '꣱' => 230, + '꤫' => 220, + '꤬' => 220, + '꤭' => 220, + '꥓' => 9, + '꦳' => 7, + 'ê§€' => 9, + 'ꪰ' => 230, + 'ꪲ' => 230, + 'ꪳ' => 230, + 'ꪴ' => 220, + 'ꪷ' => 230, + 'ꪸ' => 230, + 'ꪾ' => 230, + '꪿' => 230, + 'ê«' => 230, + 'ê«¶' => 9, + '꯭' => 9, + 'ﬞ' => 26, + '︠' => 230, + '︡' => 230, + '︢' => 230, + '︣' => 230, + '︤' => 230, + '︥' => 230, + '︦' => 230, + '︧' => 220, + '︨' => 220, + '︩' => 220, + '︪' => 220, + '︫' => 220, + '︬' => 220, + '︭' => 220, + '︮' => 230, + '︯' => 230, + 'ð‡½' => 220, + 'ð‹ ' => 220, + 'ð¶' => 230, + 'ð·' => 230, + 'ð¸' => 230, + 'ð¹' => 230, + 'ðº' => 230, + 'ð¨' => 220, + 'ð¨' => 230, + 'ð¨¸' => 230, + 'ð¨¹' => 1, + 'ð¨º' => 220, + 'ð¨¿' => 9, + 'ð«¥' => 230, + 'ð«¦' => 220, + 'ð´¤' => 230, + 'ð´¥' => 230, + 'ð´¦' => 230, + 'ð´§' => 230, + 'ðº«' => 230, + 'ðº¬' => 230, + 'ð½†' => 220, + 'ð½‡' => 220, + 'ð½ˆ' => 230, + 'ð½‰' => 230, + 'ð½Š' => 230, + 'ð½‹' => 220, + 'ð½Œ' => 230, + 'ð½' => 220, + 'ð½Ž' => 220, + 'ð½' => 220, + 'ð½' => 220, + 'ð‘†' => 9, + 'ð‘¿' => 9, + 'ð‘‚¹' => 9, + '𑂺' => 7, + 'ð‘„€' => 230, + 'ð‘„' => 230, + 'ð‘„‚' => 230, + 'ð‘„³' => 9, + 'ð‘„´' => 9, + 'ð‘…³' => 7, + '𑇀' => 9, + '𑇊' => 7, + '𑈵' => 9, + '𑈶' => 7, + 'ð‘‹©' => 7, + '𑋪' => 9, + '𑌻' => 7, + '𑌼' => 7, + 'ð‘' => 9, + 'ð‘¦' => 230, + 'ð‘§' => 230, + 'ð‘¨' => 230, + 'ð‘©' => 230, + 'ð‘ª' => 230, + 'ð‘«' => 230, + 'ð‘¬' => 230, + 'ð‘°' => 230, + 'ð‘±' => 230, + 'ð‘²' => 230, + 'ð‘³' => 230, + 'ð‘´' => 230, + 'ð‘‘‚' => 9, + '𑑆' => 7, + 'ð‘‘ž' => 230, + 'ð‘“‚' => 9, + '𑓃' => 7, + 'ð‘–¿' => 9, + 'ð‘—€' => 7, + '𑘿' => 9, + '𑚶' => 9, + '𑚷' => 7, + '𑜫' => 9, + 'ð‘ ¹' => 9, + 'ð‘ º' => 7, + '𑤽' => 9, + '𑤾' => 9, + '𑥃' => 7, + 'ð‘§ ' => 9, + '𑨴' => 9, + '𑩇' => 9, + '𑪙' => 9, + 'ð‘°¿' => 9, + '𑵂' => 7, + '𑵄' => 9, + '𑵅' => 9, + 'ð‘¶—' => 9, + 'ð–«°' => 1, + 'ð–«±' => 1, + 'ð–«²' => 1, + 'ð–«³' => 1, + 'ð–«´' => 1, + 'ð–¬°' => 230, + '𖬱' => 230, + '𖬲' => 230, + '𖬳' => 230, + 'ð–¬´' => 230, + '𖬵' => 230, + '𖬶' => 230, + 'ð–¿°' => 6, + 'ð–¿±' => 6, + '𛲞' => 1, + 'ð…¥' => 216, + 'ð…¦' => 216, + 'ð…§' => 1, + 'ð…¨' => 1, + 'ð…©' => 1, + 'ð…­' => 226, + 'ð…®' => 216, + 'ð…¯' => 216, + 'ð…°' => 216, + 'ð…±' => 216, + 'ð…²' => 216, + 'ð…»' => 220, + 'ð…¼' => 220, + 'ð…½' => 220, + 'ð…¾' => 220, + 'ð…¿' => 220, + 'ð†€' => 220, + 'ð†' => 220, + 'ð†‚' => 220, + 'ð†…' => 230, + 'ð††' => 230, + 'ð†‡' => 230, + 'ð†ˆ' => 230, + 'ð†‰' => 230, + 'ð†Š' => 220, + 'ð†‹' => 220, + 'ð†ª' => 230, + 'ð†«' => 230, + 'ð†¬' => 230, + 'ð†­' => 230, + 'ð‰‚' => 230, + 'ð‰ƒ' => 230, + 'ð‰„' => 230, + '𞀀' => 230, + 'ðž€' => 230, + '𞀂' => 230, + '𞀃' => 230, + '𞀄' => 230, + '𞀅' => 230, + '𞀆' => 230, + '𞀈' => 230, + '𞀉' => 230, + '𞀊' => 230, + '𞀋' => 230, + '𞀌' => 230, + 'ðž€' => 230, + '𞀎' => 230, + 'ðž€' => 230, + 'ðž€' => 230, + '𞀑' => 230, + '𞀒' => 230, + '𞀓' => 230, + '𞀔' => 230, + '𞀕' => 230, + '𞀖' => 230, + '𞀗' => 230, + '𞀘' => 230, + '𞀛' => 230, + '𞀜' => 230, + 'ðž€' => 230, + '𞀞' => 230, + '𞀟' => 230, + '𞀠' => 230, + '𞀡' => 230, + '𞀣' => 230, + '𞀤' => 230, + '𞀦' => 230, + '𞀧' => 230, + '𞀨' => 230, + '𞀩' => 230, + '𞀪' => 230, + 'ðž„°' => 230, + '𞄱' => 230, + '𞄲' => 230, + '𞄳' => 230, + 'ðž„´' => 230, + '𞄵' => 230, + 'ðž„¶' => 230, + '𞋬' => 230, + 'ðž‹­' => 230, + 'ðž‹®' => 230, + '𞋯' => 230, + 'ðž£' => 220, + '𞣑' => 220, + '𞣒' => 220, + '𞣓' => 220, + '𞣔' => 220, + '𞣕' => 220, + '𞣖' => 220, + '𞥄' => 230, + '𞥅' => 230, + '𞥆' => 230, + '𞥇' => 230, + '𞥈' => 230, + '𞥉' => 230, + '𞥊' => 7, +); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php new file mode 100644 index 0000000000..1574902893 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php @@ -0,0 +1,3695 @@ +<?php + +return array ( + ' ' => ' ', + '¨' => ' ̈', + 'ª' => 'a', + '¯' => ' Ì„', + '²' => '2', + '³' => '3', + '´' => ' Ì', + 'µ' => 'μ', + '¸' => ' ̧', + '¹' => '1', + 'º' => 'o', + '¼' => '1â„4', + '½' => '1â„2', + '¾' => '3â„4', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'Ä¿' => 'L·', + 'Å€' => 'l·', + 'ʼn' => 'ʼn', + 'Å¿' => 's', + 'Ç„' => 'DZÌŒ', + 'Ç…' => 'DzÌŒ', + 'dž' => 'dzÌŒ', + 'LJ' => 'LJ', + 'Lj' => 'Lj', + 'lj' => 'lj', + 'ÇŠ' => 'NJ', + 'Ç‹' => 'Nj', + 'ÇŒ' => 'nj', + 'DZ' => 'DZ', + 'Dz' => 'Dz', + 'dz' => 'dz', + 'ʰ' => 'h', + 'ʱ' => 'ɦ', + 'ʲ' => 'j', + 'ʳ' => 'r', + 'Ê´' => 'ɹ', + 'ʵ' => 'É»', + 'ʶ' => 'Ê', + 'Ê·' => 'w', + 'ʸ' => 'y', + '˘' => ' ̆', + 'Ë™' => ' ̇', + 'Ëš' => ' ÌŠ', + 'Ë›' => ' ̨', + 'Ëœ' => ' ̃', + 'Ë' => ' Ì‹', + 'Ë ' => 'É£', + 'Ë¡' => 'l', + 'Ë¢' => 's', + 'Ë£' => 'x', + 'ˤ' => 'Ê•', + 'ͺ' => ' Í…', + '΄' => ' Ì', + 'Î…' => ' ̈Ì', + 'Ï' => 'β', + 'Ï‘' => 'θ', + 'Ï’' => 'Î¥', + 'Ï“' => 'Î¥Ì', + 'Ï”' => 'Ϋ', + 'Ï•' => 'φ', + 'Ï–' => 'Ï€', + 'ϰ' => 'κ', + 'ϱ' => 'Ï', + 'ϲ' => 'Ï‚', + 'Ï´' => 'Θ', + 'ϵ' => 'ε', + 'Ϲ' => 'Σ', + 'Ö‡' => 'Õ¥Ö‚', + 'Ùµ' => 'اٴ', + 'Ù¶' => 'وٴ', + 'Ù·' => 'Û‡Ù´', + 'Ù¸' => 'يٴ', + 'ำ' => 'à¹à¸²', + 'ຳ' => 'à»àº²', + 'ໜ' => 'ຫນ', + 'à»' => 'ຫມ', + '༌' => '་', + 'ཷ' => 'ྲཱྀ', + 'ཹ' => 'ླཱྀ', + 'ჼ' => 'ნ', + 'á´¬' => 'A', + 'á´­' => 'Æ', + 'á´®' => 'B', + 'á´°' => 'D', + 'á´±' => 'E', + 'á´²' => 'ÆŽ', + 'á´³' => 'G', + 'á´´' => 'H', + 'á´µ' => 'I', + 'á´¶' => 'J', + 'á´·' => 'K', + 'á´¸' => 'L', + 'á´¹' => 'M', + 'á´º' => 'N', + 'á´¼' => 'O', + 'á´½' => 'È¢', + 'á´¾' => 'P', + 'á´¿' => 'R', + 'áµ€' => 'T', + 'áµ' => 'U', + 'ᵂ' => 'W', + 'ᵃ' => 'a', + 'ᵄ' => 'É', + 'áµ…' => 'É‘', + 'ᵆ' => 'á´‚', + 'ᵇ' => 'b', + 'ᵈ' => 'd', + 'ᵉ' => 'e', + 'ᵊ' => 'É™', + 'ᵋ' => 'É›', + 'ᵌ' => 'Éœ', + 'áµ' => 'g', + 'áµ' => 'k', + 'áµ' => 'm', + 'ᵑ' => 'Å‹', + 'áµ’' => 'o', + 'ᵓ' => 'É”', + 'áµ”' => 'á´–', + 'ᵕ' => 'á´—', + 'áµ–' => 'p', + 'áµ—' => 't', + 'ᵘ' => 'u', + 'áµ™' => 'á´', + 'ᵚ' => 'ɯ', + 'áµ›' => 'v', + 'ᵜ' => 'á´¥', + 'áµ' => 'β', + 'ᵞ' => 'γ', + 'ᵟ' => 'δ', + 'áµ ' => 'φ', + 'ᵡ' => 'χ', + 'áµ¢' => 'i', + 'áµ£' => 'r', + 'ᵤ' => 'u', + 'áµ¥' => 'v', + 'ᵦ' => 'β', + 'áµ§' => 'γ', + 'ᵨ' => 'Ï', + 'ᵩ' => 'φ', + 'ᵪ' => 'χ', + 'ᵸ' => 'н', + 'á¶›' => 'É’', + 'á¶œ' => 'c', + 'á¶' => 'É•', + 'á¶ž' => 'ð', + 'á¶Ÿ' => 'Éœ', + 'á¶ ' => 'f', + 'á¶¡' => 'ÉŸ', + 'á¶¢' => 'É¡', + 'á¶£' => 'É¥', + 'ᶤ' => 'ɨ', + 'á¶¥' => 'É©', + 'ᶦ' => 'ɪ', + 'á¶§' => 'áµ»', + 'ᶨ' => 'Ê', + 'á¶©' => 'É­', + 'ᶪ' => 'á¶…', + 'á¶«' => 'ÊŸ', + 'ᶬ' => 'ɱ', + 'á¶­' => 'ɰ', + 'á¶®' => 'ɲ', + 'ᶯ' => 'ɳ', + 'á¶°' => 'É´', + 'á¶±' => 'ɵ', + 'á¶²' => 'ɸ', + 'á¶³' => 'Ê‚', + 'á¶´' => 'ʃ', + 'á¶µ' => 'Æ«', + 'á¶¶' => 'ʉ', + 'á¶·' => 'ÊŠ', + 'ᶸ' => 'á´œ', + 'á¶¹' => 'Ê‹', + 'ᶺ' => 'ÊŒ', + 'á¶»' => 'z', + 'á¶¼' => 'Ê', + 'á¶½' => 'Ê‘', + 'á¶¾' => 'Ê’', + 'á¶¿' => 'θ', + 'ẚ' => 'aʾ', + 'ẛ' => 'ṡ', + 'á¾½' => ' Ì“', + '᾿' => ' Ì“', + 'á¿€' => ' Í‚', + 'á¿' => ' ̈͂', + 'á¿' => ' ̓̀', + '῎' => ' Ì“Ì', + 'á¿' => ' ̓͂', + 'á¿' => ' ̔̀', + '῞' => ' Ì”Ì', + '῟' => ' ̔͂', + 'á¿­' => ' ̈̀', + 'á¿®' => ' ̈Ì', + '´' => ' Ì', + '῾' => ' Ì”', + ' ' => ' ', + 'â€' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + ' ' => ' ', + '‑' => 'â€', + '‗' => ' ̳', + '․' => '.', + '‥' => '..', + '…' => '...', + ' ' => ' ', + '″' => '′′', + '‴' => '′′′', + '‶' => '‵‵', + '‷' => '‵‵‵', + '‼' => '!!', + '‾' => ' Ì…', + 'â‡' => '??', + 'âˆ' => '?!', + 'â‰' => '!?', + 'â—' => '′′′′', + 'âŸ' => ' ', + 'â°' => '0', + 'â±' => 'i', + 'â´' => '4', + 'âµ' => '5', + 'â¶' => '6', + 'â·' => '7', + 'â¸' => '8', + 'â¹' => '9', + 'âº' => '+', + 'â»' => '−', + 'â¼' => '=', + 'â½' => '(', + 'â¾' => ')', + 'â¿' => 'n', + 'â‚€' => '0', + 'â‚' => '1', + 'â‚‚' => '2', + '₃' => '3', + 'â‚„' => '4', + 'â‚…' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + '₊' => '+', + 'â‚‹' => '−', + '₌' => '=', + 'â‚' => '(', + '₎' => ')', + 'â‚' => 'a', + 'â‚‘' => 'e', + 'â‚’' => 'o', + 'â‚“' => 'x', + 'â‚”' => 'É™', + 'â‚•' => 'h', + 'â‚–' => 'k', + 'â‚—' => 'l', + 'ₘ' => 'm', + 'â‚™' => 'n', + 'ₚ' => 'p', + 'â‚›' => 's', + 'ₜ' => 't', + '₨' => 'Rs', + 'â„€' => 'a/c', + 'â„' => 'a/s', + 'â„‚' => 'C', + '℃' => '°C', + 'â„…' => 'c/o', + '℆' => 'c/u', + 'ℇ' => 'Æ', + '℉' => '°F', + 'ℊ' => 'g', + 'â„‹' => 'H', + 'ℌ' => 'H', + 'â„' => 'H', + 'ℎ' => 'h', + 'â„' => 'ħ', + 'â„' => 'I', + 'â„‘' => 'I', + 'â„’' => 'L', + 'â„“' => 'l', + 'â„•' => 'N', + 'â„–' => 'No', + 'â„™' => 'P', + 'ℚ' => 'Q', + 'â„›' => 'R', + 'ℜ' => 'R', + 'â„' => 'R', + 'â„ ' => 'SM', + 'â„¡' => 'TEL', + 'â„¢' => 'TM', + 'ℤ' => 'Z', + 'ℨ' => 'Z', + 'ℬ' => 'B', + 'â„­' => 'C', + 'ℯ' => 'e', + 'â„°' => 'E', + 'ℱ' => 'F', + 'ℳ' => 'M', + 'â„´' => 'o', + 'ℵ' => '×', + 'â„¶' => 'ב', + 'â„·' => '×’', + 'ℸ' => 'ד', + 'ℹ' => 'i', + 'â„»' => 'FAX', + 'ℼ' => 'Ï€', + 'ℽ' => 'γ', + 'ℾ' => 'Γ', + 'â„¿' => 'Π', + 'â…€' => '∑', + 'â……' => 'D', + 'â…†' => 'd', + 'â…‡' => 'e', + 'â…ˆ' => 'i', + 'â…‰' => 'j', + 'â…' => '1â„7', + 'â…‘' => '1â„9', + 'â…’' => '1â„10', + 'â…“' => '1â„3', + 'â…”' => '2â„3', + 'â…•' => '1â„5', + 'â…–' => '2â„5', + 'â…—' => '3â„5', + 'â…˜' => '4â„5', + 'â…™' => '1â„6', + 'â…š' => '5â„6', + 'â…›' => '1â„8', + 'â…œ' => '3â„8', + 'â…' => '5â„8', + 'â…ž' => '7â„8', + 'â…Ÿ' => '1â„', + 'â… ' => 'I', + 'â…¡' => 'II', + 'â…¢' => 'III', + 'â…£' => 'IV', + 'â…¤' => 'V', + 'â…¥' => 'VI', + 'â…¦' => 'VII', + 'â…§' => 'VIII', + 'â…¨' => 'IX', + 'â…©' => 'X', + 'â…ª' => 'XI', + 'â…«' => 'XII', + 'â…¬' => 'L', + 'â…­' => 'C', + 'â…®' => 'D', + 'â…¯' => 'M', + 'â…°' => 'i', + 'â…±' => 'ii', + 'â…²' => 'iii', + 'â…³' => 'iv', + 'â…´' => 'v', + 'â…µ' => 'vi', + 'â…¶' => 'vii', + 'â…·' => 'viii', + 'â…¸' => 'ix', + 'â…¹' => 'x', + 'â…º' => 'xi', + 'â…»' => 'xii', + 'â…¼' => 'l', + 'â…½' => 'c', + 'â…¾' => 'd', + 'â…¿' => 'm', + '↉' => '0â„3', + '∬' => '∫∫', + '∭' => '∫∫∫', + '∯' => '∮∮', + '∰' => '∮∮∮', + 'â‘ ' => '1', + 'â‘¡' => '2', + 'â‘¢' => '3', + 'â‘£' => '4', + '⑤' => '5', + 'â‘¥' => '6', + '⑦' => '7', + 'â‘§' => '8', + '⑨' => '9', + 'â‘©' => '10', + '⑪' => '11', + 'â‘«' => '12', + '⑬' => '13', + 'â‘­' => '14', + 'â‘®' => '15', + '⑯' => '16', + 'â‘°' => '17', + '⑱' => '18', + '⑲' => '19', + '⑳' => '20', + 'â‘´' => '(1)', + '⑵' => '(2)', + 'â‘¶' => '(3)', + 'â‘·' => '(4)', + '⑸' => '(5)', + '⑹' => '(6)', + '⑺' => '(7)', + 'â‘»' => '(8)', + '⑼' => '(9)', + '⑽' => '(10)', + '⑾' => '(11)', + 'â‘¿' => '(12)', + 'â’€' => '(13)', + 'â’' => '(14)', + 'â’‚' => '(15)', + 'â’ƒ' => '(16)', + 'â’„' => '(17)', + 'â’…' => '(18)', + 'â’†' => '(19)', + 'â’‡' => '(20)', + 'â’ˆ' => '1.', + 'â’‰' => '2.', + 'â’Š' => '3.', + 'â’‹' => '4.', + 'â’Œ' => '5.', + 'â’' => '6.', + 'â’Ž' => '7.', + 'â’' => '8.', + 'â’' => '9.', + 'â’‘' => '10.', + 'â’’' => '11.', + 'â’“' => '12.', + 'â’”' => '13.', + 'â’•' => '14.', + 'â’–' => '15.', + 'â’—' => '16.', + 'â’˜' => '17.', + 'â’™' => '18.', + 'â’š' => '19.', + 'â’›' => '20.', + 'â’œ' => '(a)', + 'â’' => '(b)', + 'â’ž' => '(c)', + 'â’Ÿ' => '(d)', + 'â’ ' => '(e)', + 'â’¡' => '(f)', + 'â’¢' => '(g)', + 'â’£' => '(h)', + 'â’¤' => '(i)', + 'â’¥' => '(j)', + 'â’¦' => '(k)', + 'â’§' => '(l)', + 'â’¨' => '(m)', + 'â’©' => '(n)', + 'â’ª' => '(o)', + 'â’«' => '(p)', + 'â’¬' => '(q)', + 'â’­' => '(r)', + 'â’®' => '(s)', + 'â’¯' => '(t)', + 'â’°' => '(u)', + 'â’±' => '(v)', + 'â’²' => '(w)', + 'â’³' => '(x)', + 'â’´' => '(y)', + 'â’µ' => '(z)', + 'â’¶' => 'A', + 'â’·' => 'B', + 'â’¸' => 'C', + 'â’¹' => 'D', + 'â’º' => 'E', + 'â’»' => 'F', + 'â’¼' => 'G', + 'â’½' => 'H', + 'â’¾' => 'I', + 'â’¿' => 'J', + 'â“€' => 'K', + 'â“' => 'L', + 'â“‚' => 'M', + 'Ⓝ' => 'N', + 'â“„' => 'O', + 'â“…' => 'P', + 'Ⓠ' => 'Q', + 'Ⓡ' => 'R', + 'Ⓢ' => 'S', + 'Ⓣ' => 'T', + 'Ⓤ' => 'U', + 'â“‹' => 'V', + 'Ⓦ' => 'W', + 'â“' => 'X', + 'Ⓨ' => 'Y', + 'â“' => 'Z', + 'â“' => 'a', + 'â“‘' => 'b', + 'â“’' => 'c', + 'â““' => 'd', + 'â“”' => 'e', + 'â“•' => 'f', + 'â“–' => 'g', + 'â“—' => 'h', + 'ⓘ' => 'i', + 'â“™' => 'j', + 'ⓚ' => 'k', + 'â“›' => 'l', + 'ⓜ' => 'm', + 'â“' => 'n', + 'ⓞ' => 'o', + 'ⓟ' => 'p', + 'â“ ' => 'q', + 'â“¡' => 'r', + 'â“¢' => 's', + 'â“£' => 't', + 'ⓤ' => 'u', + 'â“¥' => 'v', + 'ⓦ' => 'w', + 'â“§' => 'x', + 'ⓨ' => 'y', + 'â“©' => 'z', + '⓪' => '0', + '⨌' => '∫∫∫∫', + 'â©´' => '::=', + '⩵' => '==', + 'â©¶' => '===', + 'â±¼' => 'j', + 'â±½' => 'V', + 'ⵯ' => 'ⵡ', + '⺟' => 'æ¯', + '⻳' => '龟', + 'â¼€' => '一', + 'â¼' => '丨', + '⼂' => '丶', + '⼃' => '丿', + '⼄' => 'ä¹™', + 'â¼…' => '亅', + '⼆' => '二', + '⼇' => '亠', + '⼈' => '人', + '⼉' => 'å„¿', + '⼊' => 'å…¥', + '⼋' => 'å…«', + '⼌' => '冂', + 'â¼' => '冖', + '⼎' => '冫', + 'â¼' => '几', + 'â¼' => '凵', + '⼑' => '刀', + 'â¼’' => '力', + '⼓' => '勹', + 'â¼”' => '匕', + '⼕' => '匚', + 'â¼–' => '匸', + 'â¼—' => 'å', + '⼘' => 'åœ', + 'â¼™' => 'å©', + '⼚' => '厂', + 'â¼›' => '厶', + '⼜' => 'åˆ', + 'â¼' => 'å£', + '⼞' => 'å›—', + '⼟' => '土', + 'â¼ ' => '士', + '⼡' => '夂', + 'â¼¢' => '夊', + 'â¼£' => '夕', + '⼤' => '大', + 'â¼¥' => '女', + '⼦' => 'å­', + 'â¼§' => '宀', + '⼨' => '寸', + '⼩' => 'å°', + '⼪' => 'å°¢', + '⼫' => 'å°¸', + '⼬' => 'å±®', + 'â¼­' => 'å±±', + 'â¼®' => 'å·›', + '⼯' => 'å·¥', + 'â¼°' => 'å·±', + 'â¼±' => 'å·¾', + 'â¼²' => 'å¹²', + 'â¼³' => '幺', + 'â¼´' => '广', + 'â¼µ' => 'å»´', + 'â¼¶' => '廾', + 'â¼·' => '弋', + '⼸' => '弓', + 'â¼¹' => 'å½', + '⼺' => '彡', + 'â¼»' => 'å½³', + 'â¼¼' => '心', + 'â¼½' => '戈', + 'â¼¾' => '戶', + '⼿' => '手', + 'â½€' => '支', + 'â½' => 'æ”´', + '⽂' => 'æ–‡', + '⽃' => 'æ–—', + '⽄' => 'æ–¤', + 'â½…' => 'æ–¹', + '⽆' => 'æ— ', + '⽇' => 'æ—¥', + '⽈' => 'æ›°', + '⽉' => '月', + '⽊' => '木', + '⽋' => '欠', + '⽌' => 'æ­¢', + 'â½' => 'æ­¹', + '⽎' => '殳', + 'â½' => '毋', + 'â½' => '比', + '⽑' => '毛', + 'â½’' => 'æ°', + '⽓' => 'æ°”', + 'â½”' => 'æ°´', + '⽕' => 'ç«', + 'â½–' => '爪', + 'â½—' => '父', + '⽘' => '爻', + 'â½™' => '爿', + '⽚' => '片', + 'â½›' => '牙', + '⽜' => '牛', + 'â½' => '犬', + '⽞' => '玄', + '⽟' => '玉', + 'â½ ' => '瓜', + '⽡' => '瓦', + 'â½¢' => '甘', + 'â½£' => '生', + '⽤' => '用', + 'â½¥' => 'ç”°', + '⽦' => 'ç–‹', + 'â½§' => 'ç–’', + '⽨' => 'ç™¶', + '⽩' => '白', + '⽪' => 'çš®', + '⽫' => 'çš¿', + '⽬' => 'ç›®', + 'â½­' => '矛', + 'â½®' => '矢', + '⽯' => '石', + 'â½°' => '示', + 'â½±' => '禸', + 'â½²' => '禾', + 'â½³' => 'ç©´', + 'â½´' => 'ç«‹', + 'â½µ' => '竹', + 'â½¶' => 'ç±³', + 'â½·' => '糸', + '⽸' => 'ç¼¶', + 'â½¹' => '网', + '⽺' => '羊', + 'â½»' => 'ç¾½', + 'â½¼' => 'è€', + 'â½½' => '而', + 'â½¾' => '耒', + '⽿' => '耳', + 'â¾€' => 'è¿', + 'â¾' => '肉', + '⾂' => '臣', + '⾃' => '自', + '⾄' => '至', + 'â¾…' => '臼', + '⾆' => '舌', + '⾇' => '舛', + '⾈' => '舟', + '⾉' => '艮', + '⾊' => '色', + '⾋' => '艸', + '⾌' => 'è™', + 'â¾' => '虫', + '⾎' => 'è¡€', + 'â¾' => '行', + 'â¾' => 'è¡£', + '⾑' => '襾', + 'â¾’' => '見', + '⾓' => 'è§’', + 'â¾”' => '言', + '⾕' => 'è°·', + 'â¾–' => '豆', + 'â¾—' => '豕', + '⾘' => '豸', + 'â¾™' => 'è²', + '⾚' => '赤', + 'â¾›' => 'èµ°', + '⾜' => 'è¶³', + 'â¾' => '身', + '⾞' => '車', + '⾟' => 'è¾›', + 'â¾ ' => 'è¾°', + '⾡' => 'è¾µ', + 'â¾¢' => 'é‚‘', + 'â¾£' => 'é…‰', + '⾤' => '釆', + 'â¾¥' => '里', + '⾦' => '金', + 'â¾§' => 'é•·', + '⾨' => 'é–€', + '⾩' => '阜', + '⾪' => 'éš¶', + '⾫' => 'éš¹', + '⾬' => '雨', + 'â¾­' => 'é‘', + 'â¾®' => 'éž', + '⾯' => 'é¢', + 'â¾°' => 'é©', + 'â¾±' => '韋', + 'â¾²' => '韭', + 'â¾³' => '音', + 'â¾´' => 'é ', + 'â¾µ' => '風', + 'â¾¶' => '飛', + 'â¾·' => '食', + '⾸' => '首', + 'â¾¹' => '香', + '⾺' => '馬', + 'â¾»' => '骨', + 'â¾¼' => '高', + 'â¾½' => '髟', + 'â¾¾' => '鬥', + '⾿' => '鬯', + 'â¿€' => '鬲', + 'â¿' => '鬼', + 'â¿‚' => 'é­š', + '⿃' => 'é³¥', + 'â¿„' => 'é¹µ', + 'â¿…' => '鹿', + '⿆' => '麥', + '⿇' => '麻', + '⿈' => '黃', + '⿉' => 'é»', + '⿊' => '黑', + 'â¿‹' => '黹', + '⿌' => '黽', + 'â¿' => '鼎', + '⿎' => '鼓', + 'â¿' => 'é¼ ', + 'â¿' => 'é¼»', + 'â¿‘' => '齊', + 'â¿’' => 'é½’', + 'â¿“' => 'é¾', + 'â¿”' => '龜', + 'â¿•' => 'é¾ ', + ' ' => ' ', + '〶' => '〒', + '〸' => 'å', + '〹' => 'å„', + '〺' => 'å…', + 'ã‚›' => ' ã‚™', + '゜' => ' ゚', + 'ゟ' => 'より', + 'ヿ' => 'コト', + 'ㄱ' => 'á„€', + 'ㄲ' => 'á„', + 'ㄳ' => 'ᆪ', + 'ã„´' => 'á„‚', + 'ㄵ' => 'ᆬ', + 'ã„¶' => 'ᆭ', + 'ã„·' => 'ᄃ', + 'ㄸ' => 'á„„', + 'ㄹ' => 'á„…', + 'ㄺ' => 'ᆰ', + 'ã„»' => 'ᆱ', + 'ㄼ' => 'ᆲ', + 'ㄽ' => 'ᆳ', + 'ㄾ' => 'ᆴ', + 'ã„¿' => 'ᆵ', + 'ã…€' => 'ᄚ', + 'ã…' => 'ᄆ', + 'ã…‚' => 'ᄇ', + 'ã…ƒ' => 'ᄈ', + 'ã…„' => 'á„¡', + 'ã……' => 'ᄉ', + 'ã…†' => 'ᄊ', + 'ã…‡' => 'á„‹', + 'ã…ˆ' => 'ᄌ', + 'ã…‰' => 'á„', + 'ã…Š' => 'ᄎ', + 'ã…‹' => 'á„', + 'ã…Œ' => 'á„', + 'ã…' => 'á„‘', + 'ã…Ž' => 'á„’', + 'ã…' => 'á…¡', + 'ã…' => 'á…¢', + 'ã…‘' => 'á…£', + 'ã…’' => 'á…¤', + 'ã…“' => 'á…¥', + 'ã…”' => 'á…¦', + 'ã…•' => 'á…§', + 'ã…–' => 'á…¨', + 'ã…—' => 'á…©', + 'ã…˜' => 'á…ª', + 'ã…™' => 'á…«', + 'ã…š' => 'á…¬', + 'ã…›' => 'á…­', + 'ã…œ' => 'á…®', + 'ã…' => 'á…¯', + 'ã…ž' => 'á…°', + 'ã…Ÿ' => 'á…±', + 'ã… ' => 'á…²', + 'ã…¡' => 'á…³', + 'ã…¢' => 'á…´', + 'ã…£' => 'á…µ', + 'ã…¤' => 'á… ', + 'ã…¥' => 'á„”', + 'ã…¦' => 'á„•', + 'ã…§' => 'ᇇ', + 'ã…¨' => 'ᇈ', + 'ã…©' => 'ᇌ', + 'ã…ª' => 'ᇎ', + 'ã…«' => 'ᇓ', + 'ã…¬' => 'ᇗ', + 'ã…­' => 'ᇙ', + 'ã…®' => 'ᄜ', + 'ã…¯' => 'á‡', + 'ã…°' => 'ᇟ', + 'ã…±' => 'á„', + 'ã…²' => 'ᄞ', + 'ã…³' => 'á„ ', + 'ã…´' => 'á„¢', + 'ã…µ' => 'á„£', + 'ã…¶' => 'á„§', + 'ã…·' => 'á„©', + 'ã…¸' => 'á„«', + 'ã…¹' => 'ᄬ', + 'ã…º' => 'á„­', + 'ã…»' => 'á„®', + 'ã…¼' => 'ᄯ', + 'ã…½' => 'ᄲ', + 'ã…¾' => 'á„¶', + 'ã…¿' => 'á…€', + 'ㆀ' => 'á…‡', + 'ã†' => 'á…Œ', + 'ㆂ' => 'ᇱ', + 'ㆃ' => 'ᇲ', + 'ㆄ' => 'á…—', + 'ㆅ' => 'á…˜', + 'ㆆ' => 'á…™', + 'ㆇ' => 'ᆄ', + 'ㆈ' => 'ᆅ', + 'ㆉ' => 'ᆈ', + 'ㆊ' => 'ᆑ', + 'ㆋ' => 'ᆒ', + 'ㆌ' => 'ᆔ', + 'ã†' => 'ᆞ', + 'ㆎ' => 'ᆡ', + '㆒' => '一', + '㆓' => '二', + '㆔' => '三', + '㆕' => 'å››', + '㆖' => '上', + '㆗' => '中', + '㆘' => '下', + '㆙' => '甲', + '㆚' => 'ä¹™', + '㆛' => '丙', + '㆜' => 'ä¸', + 'ã†' => '天', + '㆞' => '地', + '㆟' => '人', + '㈀' => '(á„€)', + 'ãˆ' => '(á„‚)', + '㈂' => '(ᄃ)', + '㈃' => '(á„…)', + '㈄' => '(ᄆ)', + '㈅' => '(ᄇ)', + '㈆' => '(ᄉ)', + '㈇' => '(á„‹)', + '㈈' => '(ᄌ)', + '㈉' => '(ᄎ)', + '㈊' => '(á„)', + '㈋' => '(á„)', + '㈌' => '(á„‘)', + 'ãˆ' => '(á„’)', + '㈎' => '(가)', + 'ãˆ' => '(á„‚á…¡)', + 'ãˆ' => '(다)', + '㈑' => '(á„…á…¡)', + '㈒' => '(마)', + '㈓' => '(바)', + '㈔' => '(사)', + '㈕' => '(á„‹á…¡)', + '㈖' => '(자)', + '㈗' => '(차)', + '㈘' => '(á„á…¡)', + '㈙' => '(á„á…¡)', + '㈚' => '(á„‘á…¡)', + '㈛' => '(á„’á…¡)', + '㈜' => '(주)', + 'ãˆ' => '(오전)', + '㈞' => '(á„‹á…©á„’á…®)', + '㈠' => '(一)', + '㈡' => '(二)', + '㈢' => '(三)', + '㈣' => '(å››)', + '㈤' => '(五)', + '㈥' => '(å…­)', + '㈦' => '(七)', + '㈧' => '(å…«)', + '㈨' => '(ä¹)', + '㈩' => '(å)', + '㈪' => '(月)', + '㈫' => '(ç«)', + '㈬' => '(æ°´)', + '㈭' => '(木)', + '㈮' => '(金)', + '㈯' => '(土)', + '㈰' => '(æ—¥)', + '㈱' => '(æ ª)', + '㈲' => '(有)', + '㈳' => '(社)', + '㈴' => '(å)', + '㈵' => '(特)', + '㈶' => '(財)', + '㈷' => '(ç¥)', + '㈸' => '(労)', + '㈹' => '(代)', + '㈺' => '(呼)', + '㈻' => '(å­¦)', + '㈼' => '(監)', + '㈽' => '(ä¼)', + '㈾' => '(資)', + '㈿' => '(å”)', + '㉀' => '(祭)', + 'ã‰' => '(休)', + '㉂' => '(自)', + '㉃' => '(至)', + '㉄' => 'å•', + '㉅' => 'å¹¼', + '㉆' => 'æ–‡', + '㉇' => 'ç®', + 'ã‰' => 'PTE', + '㉑' => '21', + '㉒' => '22', + '㉓' => '23', + '㉔' => '24', + '㉕' => '25', + '㉖' => '26', + '㉗' => '27', + '㉘' => '28', + '㉙' => '29', + '㉚' => '30', + '㉛' => '31', + '㉜' => '32', + 'ã‰' => '33', + '㉞' => '34', + '㉟' => '35', + '㉠' => 'á„€', + '㉡' => 'á„‚', + '㉢' => 'ᄃ', + '㉣' => 'á„…', + '㉤' => 'ᄆ', + '㉥' => 'ᄇ', + '㉦' => 'ᄉ', + '㉧' => 'á„‹', + '㉨' => 'ᄌ', + '㉩' => 'ᄎ', + '㉪' => 'á„', + '㉫' => 'á„', + '㉬' => 'á„‘', + '㉭' => 'á„’', + '㉮' => '가', + '㉯' => 'á„‚á…¡', + '㉰' => '다', + '㉱' => 'á„…á…¡', + '㉲' => '마', + '㉳' => '바', + '㉴' => '사', + '㉵' => 'á„‹á…¡', + '㉶' => '자', + '㉷' => '차', + '㉸' => 'á„á…¡', + '㉹' => 'á„á…¡', + '㉺' => 'á„‘á…¡', + '㉻' => 'á„’á…¡', + '㉼' => '참고', + '㉽' => '주의', + '㉾' => 'á„‹á…®', + '㊀' => '一', + 'ãŠ' => '二', + '㊂' => '三', + '㊃' => 'å››', + '㊄' => '五', + '㊅' => 'å…­', + '㊆' => '七', + '㊇' => 'å…«', + '㊈' => 'ä¹', + '㊉' => 'å', + '㊊' => '月', + '㊋' => 'ç«', + '㊌' => 'æ°´', + 'ãŠ' => '木', + '㊎' => '金', + 'ãŠ' => '土', + 'ãŠ' => 'æ—¥', + '㊑' => 'æ ª', + '㊒' => '有', + '㊓' => '社', + '㊔' => 'å', + '㊕' => '特', + '㊖' => '財', + '㊗' => 'ç¥', + '㊘' => '労', + '㊙' => '秘', + '㊚' => 'ç”·', + '㊛' => '女', + '㊜' => 'é©', + 'ãŠ' => '優', + '㊞' => 'å°', + '㊟' => '注', + '㊠' => 'é …', + '㊡' => '休', + '㊢' => '写', + '㊣' => 'æ­£', + '㊤' => '上', + '㊥' => '中', + '㊦' => '下', + '㊧' => 'å·¦', + '㊨' => 'å³', + '㊩' => '医', + '㊪' => 'å®—', + '㊫' => 'å­¦', + '㊬' => '監', + '㊭' => 'ä¼', + '㊮' => '資', + '㊯' => 'å”', + '㊰' => '夜', + '㊱' => '36', + '㊲' => '37', + '㊳' => '38', + '㊴' => '39', + '㊵' => '40', + '㊶' => '41', + '㊷' => '42', + '㊸' => '43', + '㊹' => '44', + '㊺' => '45', + '㊻' => '46', + '㊼' => '47', + '㊽' => '48', + '㊾' => '49', + '㊿' => '50', + 'ã‹€' => '1月', + 'ã‹' => '2月', + 'ã‹‚' => '3月', + '㋃' => '4月', + 'ã‹„' => '5月', + 'ã‹…' => '6月', + '㋆' => '7月', + '㋇' => '8月', + '㋈' => '9月', + '㋉' => '10月', + '㋊' => '11月', + 'ã‹‹' => '12月', + '㋌' => 'Hg', + 'ã‹' => 'erg', + '㋎' => 'eV', + 'ã‹' => 'LTD', + 'ã‹' => 'ã‚¢', + 'ã‹‘' => 'イ', + 'ã‹’' => 'ウ', + 'ã‹“' => 'エ', + 'ã‹”' => 'オ', + 'ã‹•' => 'ã‚«', + 'ã‹–' => 'ã‚­', + 'ã‹—' => 'ク', + '㋘' => 'ケ', + 'ã‹™' => 'コ', + '㋚' => 'サ', + 'ã‹›' => 'ã‚·', + '㋜' => 'ス', + 'ã‹' => 'ã‚»', + '㋞' => 'ソ', + '㋟' => 'ã‚¿', + 'ã‹ ' => 'ãƒ', + 'ã‹¡' => 'ツ', + 'ã‹¢' => 'テ', + 'ã‹£' => 'ト', + '㋤' => 'ナ', + 'ã‹¥' => 'ニ', + '㋦' => 'ヌ', + 'ã‹§' => 'ãƒ', + '㋨' => 'ノ', + 'ã‹©' => 'ãƒ', + '㋪' => 'ヒ', + 'ã‹«' => 'フ', + '㋬' => 'ヘ', + 'ã‹­' => 'ホ', + 'ã‹®' => 'マ', + '㋯' => 'ミ', + 'ã‹°' => 'ム', + '㋱' => 'メ', + '㋲' => 'モ', + '㋳' => 'ヤ', + 'ã‹´' => 'ユ', + '㋵' => 'ヨ', + 'ã‹¶' => 'ラ', + 'ã‹·' => 'リ', + '㋸' => 'ル', + '㋹' => 'レ', + '㋺' => 'ロ', + 'ã‹»' => 'ワ', + '㋼' => 'ヰ', + '㋽' => 'ヱ', + '㋾' => 'ヲ', + 'ã‹¿' => '令和', + '㌀' => 'ã‚¢ãƒã‚šãƒ¼ãƒˆ', + 'ãŒ' => 'アルファ', + '㌂' => 'アンペア', + '㌃' => 'アール', + '㌄' => 'イニング', + '㌅' => 'インãƒ', + '㌆' => 'ウォン', + '㌇' => 'エスクード', + '㌈' => 'エーカー', + '㌉' => 'オンス', + '㌊' => 'オーム', + '㌋' => 'カイリ', + '㌌' => 'カラット', + 'ãŒ' => 'カロリー', + '㌎' => 'ガロン', + 'ãŒ' => 'ガンマ', + 'ãŒ' => 'ギガ', + '㌑' => 'ギニー', + '㌒' => 'キュリー', + '㌓' => 'ギルダー', + '㌔' => 'キロ', + '㌕' => 'キログラム', + '㌖' => 'キロメートル', + '㌗' => 'キロワット', + '㌘' => 'グラム', + '㌙' => 'グラムトン', + '㌚' => 'クルゼイロ', + '㌛' => 'クローãƒ', + '㌜' => 'ケース', + 'ãŒ' => 'コルナ', + '㌞' => 'コーポ', + '㌟' => 'サイクル', + '㌠' => 'サンãƒãƒ¼ãƒ ', + '㌡' => 'シリング', + '㌢' => 'センãƒ', + '㌣' => 'セント', + '㌤' => 'ダース', + '㌥' => 'デシ', + '㌦' => 'ドル', + '㌧' => 'トン', + '㌨' => 'ナノ', + '㌩' => 'ノット', + '㌪' => 'ãƒã‚¤ãƒ„', + '㌫' => 'ãƒã‚šãƒ¼ã‚»ãƒ³ãƒˆ', + '㌬' => 'ãƒã‚šãƒ¼ãƒ„', + '㌭' => 'ãƒã‚™ãƒ¼ãƒ¬ãƒ«', + '㌮' => 'ピアストル', + '㌯' => 'ピクル', + '㌰' => 'ピコ', + '㌱' => 'ビル', + '㌲' => 'ファラッド', + '㌳' => 'フィート', + '㌴' => 'ブッシェル', + '㌵' => 'フラン', + '㌶' => 'ヘクタール', + '㌷' => 'ペソ', + '㌸' => 'ペニヒ', + '㌹' => 'ヘルツ', + '㌺' => 'ペンス', + '㌻' => 'ページ', + '㌼' => 'ベータ', + '㌽' => 'ポイント', + '㌾' => 'ボルト', + '㌿' => 'ホン', + 'ã€' => 'ポンド', + 'ã' => 'ホール', + 'ã‚' => 'ホーン', + 'ãƒ' => 'マイクロ', + 'ã„' => 'マイル', + 'ã…' => 'マッãƒ', + 'ã†' => 'マルク', + 'ã‡' => 'マンション', + 'ãˆ' => 'ミクロン', + 'ã‰' => 'ミリ', + 'ãŠ' => 'ミリãƒã‚™ãƒ¼ãƒ«', + 'ã‹' => 'メガ', + 'ãŒ' => 'メガトン', + 'ã' => 'メートル', + 'ãŽ' => 'ヤード', + 'ã' => 'ヤール', + 'ã' => 'ユアン', + 'ã‘' => 'リットル', + 'ã’' => 'リラ', + 'ã“' => 'ルピー', + 'ã”' => 'ルーブル', + 'ã•' => 'レム', + 'ã–' => 'レントゲン', + 'ã—' => 'ワット', + 'ã˜' => '0点', + 'ã™' => '1点', + 'ãš' => '2点', + 'ã›' => '3点', + 'ãœ' => '4点', + 'ã' => '5点', + 'ãž' => '6点', + 'ãŸ' => '7点', + 'ã ' => '8点', + 'ã¡' => '9点', + 'ã¢' => '10点', + 'ã£' => '11点', + 'ã¤' => '12点', + 'ã¥' => '13点', + 'ã¦' => '14点', + 'ã§' => '15点', + 'ã¨' => '16点', + 'ã©' => '17点', + 'ãª' => '18点', + 'ã«' => '19点', + 'ã¬' => '20点', + 'ã­' => '21点', + 'ã®' => '22点', + 'ã¯' => '23点', + 'ã°' => '24点', + 'ã±' => 'hPa', + 'ã²' => 'da', + 'ã³' => 'AU', + 'ã´' => 'bar', + 'ãµ' => 'oV', + 'ã¶' => 'pc', + 'ã·' => 'dm', + 'ã¸' => 'dm2', + 'ã¹' => 'dm3', + 'ãº' => 'IU', + 'ã»' => 'å¹³æˆ', + 'ã¼' => '昭和', + 'ã½' => '大正', + 'ã¾' => '明治', + 'ã¿' => 'æ ªå¼ä¼šç¤¾', + '㎀' => 'pA', + 'ãŽ' => 'nA', + '㎂' => 'μA', + '㎃' => 'mA', + '㎄' => 'kA', + '㎅' => 'KB', + '㎆' => 'MB', + '㎇' => 'GB', + '㎈' => 'cal', + '㎉' => 'kcal', + '㎊' => 'pF', + '㎋' => 'nF', + '㎌' => 'μF', + 'ãŽ' => 'μg', + '㎎' => 'mg', + 'ãŽ' => 'kg', + 'ãŽ' => 'Hz', + '㎑' => 'kHz', + '㎒' => 'MHz', + '㎓' => 'GHz', + '㎔' => 'THz', + '㎕' => 'μl', + '㎖' => 'ml', + '㎗' => 'dl', + '㎘' => 'kl', + '㎙' => 'fm', + '㎚' => 'nm', + '㎛' => 'μm', + '㎜' => 'mm', + 'ãŽ' => 'cm', + '㎞' => 'km', + '㎟' => 'mm2', + '㎠' => 'cm2', + '㎡' => 'm2', + '㎢' => 'km2', + '㎣' => 'mm3', + '㎤' => 'cm3', + '㎥' => 'm3', + '㎦' => 'km3', + '㎧' => 'm∕s', + '㎨' => 'm∕s2', + '㎩' => 'Pa', + '㎪' => 'kPa', + '㎫' => 'MPa', + '㎬' => 'GPa', + '㎭' => 'rad', + '㎮' => 'rad∕s', + '㎯' => 'rad∕s2', + '㎰' => 'ps', + '㎱' => 'ns', + '㎲' => 'μs', + '㎳' => 'ms', + '㎴' => 'pV', + '㎵' => 'nV', + '㎶' => 'μV', + '㎷' => 'mV', + '㎸' => 'kV', + '㎹' => 'MV', + '㎺' => 'pW', + '㎻' => 'nW', + '㎼' => 'μW', + '㎽' => 'mW', + '㎾' => 'kW', + '㎿' => 'MW', + 'ã€' => 'kΩ', + 'ã' => 'MΩ', + 'ã‚' => 'a.m.', + 'ãƒ' => 'Bq', + 'ã„' => 'cc', + 'ã…' => 'cd', + 'ã†' => 'C∕kg', + 'ã‡' => 'Co.', + 'ãˆ' => 'dB', + 'ã‰' => 'Gy', + 'ãŠ' => 'ha', + 'ã‹' => 'HP', + 'ãŒ' => 'in', + 'ã' => 'KK', + 'ãŽ' => 'KM', + 'ã' => 'kt', + 'ã' => 'lm', + 'ã‘' => 'ln', + 'ã’' => 'log', + 'ã“' => 'lx', + 'ã”' => 'mb', + 'ã•' => 'mil', + 'ã–' => 'mol', + 'ã—' => 'PH', + 'ã˜' => 'p.m.', + 'ã™' => 'PPM', + 'ãš' => 'PR', + 'ã›' => 'sr', + 'ãœ' => 'Sv', + 'ã' => 'Wb', + 'ãž' => 'V∕m', + 'ãŸ' => 'A∕m', + 'ã ' => '1æ—¥', + 'ã¡' => '2æ—¥', + 'ã¢' => '3æ—¥', + 'ã£' => '4æ—¥', + 'ã¤' => '5æ—¥', + 'ã¥' => '6æ—¥', + 'ã¦' => '7æ—¥', + 'ã§' => '8æ—¥', + 'ã¨' => '9æ—¥', + 'ã©' => '10æ—¥', + 'ãª' => '11æ—¥', + 'ã«' => '12æ—¥', + 'ã¬' => '13æ—¥', + 'ã­' => '14æ—¥', + 'ã®' => '15æ—¥', + 'ã¯' => '16æ—¥', + 'ã°' => '17æ—¥', + 'ã±' => '18æ—¥', + 'ã²' => '19æ—¥', + 'ã³' => '20æ—¥', + 'ã´' => '21æ—¥', + 'ãµ' => '22æ—¥', + 'ã¶' => '23æ—¥', + 'ã·' => '24æ—¥', + 'ã¸' => '25æ—¥', + 'ã¹' => '26æ—¥', + 'ãº' => '27æ—¥', + 'ã»' => '28æ—¥', + 'ã¼' => '29æ—¥', + 'ã½' => '30æ—¥', + 'ã¾' => '31æ—¥', + 'ã¿' => 'gal', + 'êšœ' => 'ÑŠ', + 'êš' => 'ÑŒ', + 'ê°' => 'ê¯', + 'ꟸ' => 'Ħ', + 'ꟹ' => 'Å“', + 'ê­œ' => 'ꜧ', + 'ê­' => 'ꬷ', + 'ê­ž' => 'É«', + 'ê­Ÿ' => 'ê­’', + 'ê­©' => 'Ê', + 'ff' => 'ff', + 'ï¬' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'Õ´Õ¶', + 'ﬔ' => 'Õ´Õ¥', + 'ﬕ' => 'Õ´Õ«', + 'ﬖ' => 'Õ¾Õ¶', + 'ﬗ' => 'Õ´Õ­', + 'ﬠ' => '×¢', + 'ﬡ' => '×', + 'ﬢ' => 'ד', + 'ﬣ' => '×”', + 'ﬤ' => '×›', + 'ﬥ' => 'ל', + 'ﬦ' => '×', + 'ﬧ' => 'ר', + 'ﬨ' => 'ת', + '﬩' => '+', + 'ï­' => '×ל', + 'ï­' => 'Ù±', + 'ï­‘' => 'Ù±', + 'ï­’' => 'Ù»', + 'ï­“' => 'Ù»', + 'ï­”' => 'Ù»', + 'ï­•' => 'Ù»', + 'ï­–' => 'Ù¾', + 'ï­—' => 'Ù¾', + 'ï­˜' => 'Ù¾', + 'ï­™' => 'Ù¾', + 'ï­š' => 'Ú€', + 'ï­›' => 'Ú€', + 'ï­œ' => 'Ú€', + 'ï­' => 'Ú€', + 'ï­ž' => 'Ùº', + 'ï­Ÿ' => 'Ùº', + 'ï­ ' => 'Ùº', + 'ï­¡' => 'Ùº', + 'ï­¢' => 'Ù¿', + 'ï­£' => 'Ù¿', + 'ï­¤' => 'Ù¿', + 'ï­¥' => 'Ù¿', + 'ï­¦' => 'Ù¹', + 'ï­§' => 'Ù¹', + 'ï­¨' => 'Ù¹', + 'ï­©' => 'Ù¹', + 'ï­ª' => 'Ú¤', + 'ï­«' => 'Ú¤', + 'ï­¬' => 'Ú¤', + 'ï­­' => 'Ú¤', + 'ï­®' => 'Ú¦', + 'ï­¯' => 'Ú¦', + 'ï­°' => 'Ú¦', + 'ï­±' => 'Ú¦', + 'ï­²' => 'Ú„', + 'ï­³' => 'Ú„', + 'ï­´' => 'Ú„', + 'ï­µ' => 'Ú„', + 'ï­¶' => 'Úƒ', + 'ï­·' => 'Úƒ', + 'ï­¸' => 'Úƒ', + 'ï­¹' => 'Úƒ', + 'ï­º' => 'Ú†', + 'ï­»' => 'Ú†', + 'ï­¼' => 'Ú†', + 'ï­½' => 'Ú†', + 'ï­¾' => 'Ú‡', + 'ï­¿' => 'Ú‡', + 'ﮀ' => 'Ú‡', + 'ï®' => 'Ú‡', + 'ﮂ' => 'Ú', + 'ﮃ' => 'Ú', + 'ﮄ' => 'ÚŒ', + 'ï®…' => 'ÚŒ', + 'ﮆ' => 'ÚŽ', + 'ﮇ' => 'ÚŽ', + 'ﮈ' => 'Úˆ', + 'ﮉ' => 'Úˆ', + 'ﮊ' => 'Ú˜', + 'ﮋ' => 'Ú˜', + 'ﮌ' => 'Ú‘', + 'ï®' => 'Ú‘', + 'ﮎ' => 'Ú©', + 'ï®' => 'Ú©', + 'ï®' => 'Ú©', + 'ﮑ' => 'Ú©', + 'ï®’' => 'Ú¯', + 'ﮓ' => 'Ú¯', + 'ï®”' => 'Ú¯', + 'ﮕ' => 'Ú¯', + 'ï®–' => 'Ú³', + 'ï®—' => 'Ú³', + 'ﮘ' => 'Ú³', + 'ï®™' => 'Ú³', + 'ﮚ' => 'Ú±', + 'ï®›' => 'Ú±', + 'ﮜ' => 'Ú±', + 'ï®' => 'Ú±', + 'ﮞ' => 'Úº', + 'ﮟ' => 'Úº', + 'ï® ' => 'Ú»', + 'ﮡ' => 'Ú»', + 'ﮢ' => 'Ú»', + 'ﮣ' => 'Ú»', + 'ﮤ' => 'Û•Ù”', + 'ﮥ' => 'Û•Ù”', + 'ﮦ' => 'Û', + 'ï®§' => 'Û', + 'ﮨ' => 'Û', + 'ﮩ' => 'Û', + 'ﮪ' => 'Ú¾', + 'ﮫ' => 'Ú¾', + 'ﮬ' => 'Ú¾', + 'ï®­' => 'Ú¾', + 'ï®®' => 'Û’', + 'ﮯ' => 'Û’', + 'ï®°' => 'Û’Ù”', + 'ï®±' => 'Û’Ù”', + 'ﯓ' => 'Ú­', + 'ﯔ' => 'Ú­', + 'ﯕ' => 'Ú­', + 'ﯖ' => 'Ú­', + 'ﯗ' => 'Û‡', + 'ﯘ' => 'Û‡', + 'ﯙ' => 'Û†', + 'ﯚ' => 'Û†', + 'ﯛ' => 'Ûˆ', + 'ﯜ' => 'Ûˆ', + 'ï¯' => 'Û‡Ù´', + 'ﯞ' => 'Û‹', + 'ﯟ' => 'Û‹', + 'ﯠ' => 'Û…', + 'ﯡ' => 'Û…', + 'ﯢ' => 'Û‰', + 'ﯣ' => 'Û‰', + 'ﯤ' => 'Û', + 'ﯥ' => 'Û', + 'ﯦ' => 'Û', + 'ﯧ' => 'Û', + 'ﯨ' => 'Ù‰', + 'ﯩ' => 'Ù‰', + 'ﯪ' => 'ئا', + 'ﯫ' => 'ئا', + 'ﯬ' => 'ÙŠÙ”Û•', + 'ﯭ' => 'ÙŠÙ”Û•', + 'ﯮ' => 'ÙŠÙ”Ùˆ', + 'ﯯ' => 'ÙŠÙ”Ùˆ', + 'ﯰ' => 'ÙŠÙ”Û‡', + 'ﯱ' => 'ÙŠÙ”Û‡', + 'ﯲ' => 'ÙŠÙ”Û†', + 'ﯳ' => 'ÙŠÙ”Û†', + 'ﯴ' => 'ÙŠÙ”Ûˆ', + 'ﯵ' => 'ÙŠÙ”Ûˆ', + 'ﯶ' => 'ÙŠÙ”Û', + 'ﯷ' => 'ÙŠÙ”Û', + 'ﯸ' => 'ÙŠÙ”Û', + 'ﯹ' => 'ÙŠÙ”Ù‰', + 'ﯺ' => 'ÙŠÙ”Ù‰', + 'ﯻ' => 'ÙŠÙ”Ù‰', + 'ﯼ' => 'ÛŒ', + 'ﯽ' => 'ÛŒ', + 'ﯾ' => 'ÛŒ', + 'ﯿ' => 'ÛŒ', + 'ï°€' => 'ئج', + 'ï°' => 'ئح', + 'ï°‚' => 'ÙŠÙ”Ù…', + 'ï°ƒ' => 'ÙŠÙ”Ù‰', + 'ï°„' => 'ÙŠÙ”ÙŠ', + 'ï°…' => 'بج', + 'ï°†' => 'بح', + 'ï°‡' => 'بخ', + 'ï°ˆ' => 'بم', + 'ï°‰' => 'بى', + 'ï°Š' => 'بي', + 'ï°‹' => 'تج', + 'ï°Œ' => 'تح', + 'ï°' => 'تخ', + 'ï°Ž' => 'تم', + 'ï°' => 'تى', + 'ï°' => 'تي', + 'ï°‘' => 'ثج', + 'ï°’' => 'ثم', + 'ï°“' => 'ثى', + 'ï°”' => 'ثي', + 'ï°•' => 'جح', + 'ï°–' => 'جم', + 'ï°—' => 'حج', + 'ï°˜' => 'حم', + 'ï°™' => 'خج', + 'ï°š' => 'خح', + 'ï°›' => 'خم', + 'ï°œ' => 'سج', + 'ï°' => 'سح', + 'ï°ž' => 'سخ', + 'ï°Ÿ' => 'سم', + 'ï° ' => 'صح', + 'ï°¡' => 'صم', + 'ï°¢' => 'ضج', + 'ï°£' => 'ضح', + 'ï°¤' => 'ضخ', + 'ï°¥' => 'ضم', + 'ï°¦' => 'طح', + 'ï°§' => 'طم', + 'ï°¨' => 'ظم', + 'ï°©' => 'عج', + 'ï°ª' => 'عم', + 'ï°«' => 'غج', + 'ï°¬' => 'غم', + 'ï°­' => 'ÙØ¬', + 'ï°®' => 'ÙØ­', + 'ï°¯' => 'ÙØ®', + 'ï°°' => 'ÙÙ…', + 'ï°±' => 'ÙÙ‰', + 'ï°²' => 'ÙÙŠ', + 'ï°³' => 'قح', + 'ï°´' => 'قم', + 'ï°µ' => 'قى', + 'ï°¶' => 'قي', + 'ï°·' => 'كا', + 'ï°¸' => 'كج', + 'ï°¹' => 'كح', + 'ï°º' => 'كخ', + 'ï°»' => 'كل', + 'ï°¼' => 'كم', + 'ï°½' => 'كى', + 'ï°¾' => 'كي', + 'ï°¿' => 'لج', + 'ï±€' => 'لح', + 'ï±' => 'لخ', + 'ﱂ' => 'لم', + 'ﱃ' => 'لى', + 'ﱄ' => 'لي', + 'ï±…' => 'مج', + 'ﱆ' => 'مح', + 'ﱇ' => 'مخ', + 'ﱈ' => 'مم', + 'ﱉ' => 'مى', + 'ﱊ' => 'مي', + 'ﱋ' => 'نج', + 'ﱌ' => 'نح', + 'ï±' => 'نخ', + 'ﱎ' => 'نم', + 'ï±' => 'نى', + 'ï±' => 'ني', + 'ﱑ' => 'هج', + 'ï±’' => 'هم', + 'ﱓ' => 'هى', + 'ï±”' => 'هي', + 'ﱕ' => 'يج', + 'ï±–' => 'يح', + 'ï±—' => 'يخ', + 'ﱘ' => 'يم', + 'ï±™' => 'يى', + 'ﱚ' => 'يي', + 'ï±›' => 'ذٰ', + 'ﱜ' => 'رٰ', + 'ï±' => 'ىٰ', + 'ﱞ' => ' ٌّ', + 'ﱟ' => ' ÙÙ‘', + 'ï± ' => ' ÙŽÙ‘', + 'ﱡ' => ' ÙÙ‘', + 'ï±¢' => ' ÙÙ‘', + 'ï±£' => ' ّٰ', + 'ﱤ' => 'ئر', + 'ï±¥' => 'ئز', + 'ﱦ' => 'ÙŠÙ”Ù…', + 'ï±§' => 'ÙŠÙ”Ù†', + 'ﱨ' => 'ÙŠÙ”Ù‰', + 'ﱩ' => 'ÙŠÙ”ÙŠ', + 'ﱪ' => 'بر', + 'ﱫ' => 'بز', + 'ﱬ' => 'بم', + 'ï±­' => 'بن', + 'ï±®' => 'بى', + 'ﱯ' => 'بي', + 'ï±°' => 'تر', + 'ï±±' => 'تز', + 'ï±²' => 'تم', + 'ï±³' => 'تن', + 'ï±´' => 'تى', + 'ï±µ' => 'تي', + 'ï±¶' => 'ثر', + 'ï±·' => 'ثز', + 'ﱸ' => 'ثم', + 'ï±¹' => 'ثن', + 'ﱺ' => 'ثى', + 'ï±»' => 'ثي', + 'ï±¼' => 'ÙÙ‰', + 'ï±½' => 'ÙÙŠ', + 'ï±¾' => 'قى', + 'ﱿ' => 'قي', + 'ï²€' => 'كا', + 'ï²' => 'كل', + 'ﲂ' => 'كم', + 'ﲃ' => 'كى', + 'ﲄ' => 'كي', + 'ï²…' => 'لم', + 'ﲆ' => 'لى', + 'ﲇ' => 'لي', + 'ﲈ' => 'ما', + 'ﲉ' => 'مم', + 'ﲊ' => 'نر', + 'ﲋ' => 'نز', + 'ﲌ' => 'نم', + 'ï²' => 'نن', + 'ﲎ' => 'نى', + 'ï²' => 'ني', + 'ï²' => 'ىٰ', + 'ﲑ' => 'ير', + 'ï²’' => 'يز', + 'ﲓ' => 'يم', + 'ï²”' => 'ين', + 'ﲕ' => 'يى', + 'ï²–' => 'يي', + 'ï²—' => 'ئج', + 'ﲘ' => 'ئح', + 'ï²™' => 'ئخ', + 'ﲚ' => 'ÙŠÙ”Ù…', + 'ï²›' => 'ÙŠÙ”Ù‡', + 'ﲜ' => 'بج', + 'ï²' => 'بح', + 'ﲞ' => 'بخ', + 'ﲟ' => 'بم', + 'ï² ' => 'به', + 'ﲡ' => 'تج', + 'ï²¢' => 'تح', + 'ï²£' => 'تخ', + 'ﲤ' => 'تم', + 'ï²¥' => 'ته', + 'ﲦ' => 'ثم', + 'ï²§' => 'جح', + 'ﲨ' => 'جم', + 'ﲩ' => 'حج', + 'ﲪ' => 'حم', + 'ﲫ' => 'خج', + 'ﲬ' => 'خم', + 'ï²­' => 'سج', + 'ï²®' => 'سح', + 'ﲯ' => 'سخ', + 'ï²°' => 'سم', + 'ï²±' => 'صح', + 'ï²²' => 'صخ', + 'ï²³' => 'صم', + 'ï²´' => 'ضج', + 'ï²µ' => 'ضح', + 'ï²¶' => 'ضخ', + 'ï²·' => 'ضم', + 'ﲸ' => 'طح', + 'ï²¹' => 'ظم', + 'ﲺ' => 'عج', + 'ï²»' => 'عم', + 'ï²¼' => 'غج', + 'ï²½' => 'غم', + 'ï²¾' => 'ÙØ¬', + 'ﲿ' => 'ÙØ­', + 'ï³€' => 'ÙØ®', + 'ï³' => 'ÙÙ…', + 'ﳂ' => 'قح', + 'ﳃ' => 'قم', + 'ﳄ' => 'كج', + 'ï³…' => 'كح', + 'ﳆ' => 'كخ', + 'ﳇ' => 'كل', + 'ﳈ' => 'كم', + 'ﳉ' => 'لج', + 'ﳊ' => 'لح', + 'ﳋ' => 'لخ', + 'ﳌ' => 'لم', + 'ï³' => 'له', + 'ﳎ' => 'مج', + 'ï³' => 'مح', + 'ï³' => 'مخ', + 'ﳑ' => 'مم', + 'ï³’' => 'نج', + 'ﳓ' => 'نح', + 'ï³”' => 'نخ', + 'ﳕ' => 'نم', + 'ï³–' => 'نه', + 'ï³—' => 'هج', + 'ﳘ' => 'هم', + 'ï³™' => 'هٰ', + 'ﳚ' => 'يج', + 'ï³›' => 'يح', + 'ﳜ' => 'يخ', + 'ï³' => 'يم', + 'ﳞ' => 'يه', + 'ﳟ' => 'ÙŠÙ”Ù…', + 'ï³ ' => 'ÙŠÙ”Ù‡', + 'ﳡ' => 'بم', + 'ï³¢' => 'به', + 'ï³£' => 'تم', + 'ﳤ' => 'ته', + 'ï³¥' => 'ثم', + 'ﳦ' => 'ثه', + 'ï³§' => 'سم', + 'ﳨ' => 'سه', + 'ﳩ' => 'شم', + 'ﳪ' => 'شه', + 'ﳫ' => 'كل', + 'ﳬ' => 'كم', + 'ï³­' => 'لم', + 'ï³®' => 'نم', + 'ﳯ' => 'نه', + 'ï³°' => 'يم', + 'ï³±' => 'يه', + 'ï³²' => 'Ù€ÙŽÙ‘', + 'ï³³' => 'Ù€ÙÙ‘', + 'ï³´' => 'Ù€ÙÙ‘', + 'ï³µ' => 'طى', + 'ï³¶' => 'طي', + 'ï³·' => 'عى', + 'ﳸ' => 'عي', + 'ï³¹' => 'غى', + 'ﳺ' => 'غي', + 'ï³»' => 'سى', + 'ï³¼' => 'سي', + 'ï³½' => 'شى', + 'ï³¾' => 'شي', + 'ﳿ' => 'حى', + 'ï´€' => 'حي', + 'ï´' => 'جى', + 'ï´‚' => 'جي', + 'ï´ƒ' => 'خى', + 'ï´„' => 'خي', + 'ï´…' => 'صى', + 'ï´†' => 'صي', + 'ï´‡' => 'ضى', + 'ï´ˆ' => 'ضي', + 'ï´‰' => 'شج', + 'ï´Š' => 'شح', + 'ï´‹' => 'شخ', + 'ï´Œ' => 'شم', + 'ï´' => 'شر', + 'ï´Ž' => 'سر', + 'ï´' => 'صر', + 'ï´' => 'ضر', + 'ï´‘' => 'طى', + 'ï´’' => 'طي', + 'ï´“' => 'عى', + 'ï´”' => 'عي', + 'ï´•' => 'غى', + 'ï´–' => 'غي', + 'ï´—' => 'سى', + 'ï´˜' => 'سي', + 'ï´™' => 'شى', + 'ï´š' => 'شي', + 'ï´›' => 'حى', + 'ï´œ' => 'حي', + 'ï´' => 'جى', + 'ï´ž' => 'جي', + 'ï´Ÿ' => 'خى', + 'ï´ ' => 'خي', + 'ï´¡' => 'صى', + 'ï´¢' => 'صي', + 'ï´£' => 'ضى', + 'ï´¤' => 'ضي', + 'ï´¥' => 'شج', + 'ï´¦' => 'شح', + 'ï´§' => 'شخ', + 'ï´¨' => 'شم', + 'ï´©' => 'شر', + 'ï´ª' => 'سر', + 'ï´«' => 'صر', + 'ï´¬' => 'ضر', + 'ï´­' => 'شج', + 'ï´®' => 'شح', + 'ï´¯' => 'شخ', + 'ï´°' => 'شم', + 'ï´±' => 'سه', + 'ï´²' => 'شه', + 'ï´³' => 'طم', + 'ï´´' => 'سج', + 'ï´µ' => 'سح', + 'ï´¶' => 'سخ', + 'ï´·' => 'شج', + 'ï´¸' => 'شح', + 'ï´¹' => 'شخ', + 'ï´º' => 'طم', + 'ï´»' => 'ظم', + 'ï´¼' => 'اً', + 'ï´½' => 'اً', + 'ïµ' => 'تجم', + 'ﵑ' => 'تحج', + 'ïµ’' => 'تحج', + 'ﵓ' => 'تحم', + 'ïµ”' => 'تخم', + 'ﵕ' => 'تمج', + 'ïµ–' => 'تمح', + 'ïµ—' => 'تمخ', + 'ﵘ' => 'جمح', + 'ïµ™' => 'جمح', + 'ﵚ' => 'حمي', + 'ïµ›' => 'حمى', + 'ﵜ' => 'سحج', + 'ïµ' => 'سجح', + 'ﵞ' => 'سجى', + 'ﵟ' => 'سمح', + 'ïµ ' => 'سمح', + 'ﵡ' => 'سمج', + 'ïµ¢' => 'سمم', + 'ïµ£' => 'سمم', + 'ﵤ' => 'صحح', + 'ïµ¥' => 'صحح', + 'ﵦ' => 'صمم', + 'ïµ§' => 'شحم', + 'ﵨ' => 'شحم', + 'ﵩ' => 'شجي', + 'ﵪ' => 'شمخ', + 'ﵫ' => 'شمخ', + 'ﵬ' => 'شمم', + 'ïµ­' => 'شمم', + 'ïµ®' => 'ضحى', + 'ﵯ' => 'ضخم', + 'ïµ°' => 'ضخم', + 'ïµ±' => 'طمح', + 'ïµ²' => 'طمح', + 'ïµ³' => 'طمم', + 'ïµ´' => 'طمي', + 'ïµµ' => 'عجم', + 'ïµ¶' => 'عمم', + 'ïµ·' => 'عمم', + 'ﵸ' => 'عمى', + 'ïµ¹' => 'غمم', + 'ﵺ' => 'غمي', + 'ïµ»' => 'غمى', + 'ïµ¼' => 'ÙØ®Ù…', + 'ïµ½' => 'ÙØ®Ù…', + 'ïµ¾' => 'قمح', + 'ﵿ' => 'قمم', + 'ï¶€' => 'لحم', + 'ï¶' => 'لحي', + 'ï¶‚' => 'لحى', + 'ﶃ' => 'لجج', + 'ï¶„' => 'لجج', + 'ï¶…' => 'لخم', + 'ﶆ' => 'لخم', + 'ﶇ' => 'لمح', + 'ﶈ' => 'لمح', + 'ﶉ' => 'محج', + 'ï¶Š' => 'محم', + 'ï¶‹' => 'محي', + 'ï¶Œ' => 'مجح', + 'ï¶' => 'مجم', + 'ï¶Ž' => 'مخج', + 'ï¶' => 'مخم', + 'ï¶’' => 'مجخ', + 'ï¶“' => 'همج', + 'ï¶”' => 'همم', + 'ï¶•' => 'نحم', + 'ï¶–' => 'نحى', + 'ï¶—' => 'نجم', + 'ﶘ' => 'نجم', + 'ï¶™' => 'نجى', + 'ï¶š' => 'نمي', + 'ï¶›' => 'نمى', + 'ï¶œ' => 'يمم', + 'ï¶' => 'يمم', + 'ï¶ž' => 'بخي', + 'ï¶Ÿ' => 'تجي', + 'ï¶ ' => 'تجى', + 'ï¶¡' => 'تخي', + 'ï¶¢' => 'تخى', + 'ï¶£' => 'تمي', + 'ﶤ' => 'تمى', + 'ï¶¥' => 'جمي', + 'ﶦ' => 'جحى', + 'ï¶§' => 'جمى', + 'ﶨ' => 'سخى', + 'ï¶©' => 'صحي', + 'ﶪ' => 'شحي', + 'ï¶«' => 'ضحي', + 'ﶬ' => 'لجي', + 'ï¶­' => 'لمي', + 'ï¶®' => 'يحي', + 'ﶯ' => 'يجي', + 'ï¶°' => 'يمي', + 'ï¶±' => 'ممي', + 'ï¶²' => 'قمي', + 'ï¶³' => 'نحي', + 'ï¶´' => 'قمح', + 'ï¶µ' => 'لحم', + 'ï¶¶' => 'عمي', + 'ï¶·' => 'كمي', + 'ﶸ' => 'نجح', + 'ï¶¹' => 'مخي', + 'ﶺ' => 'لجم', + 'ï¶»' => 'كمم', + 'ï¶¼' => 'لجم', + 'ï¶½' => 'نجح', + 'ï¶¾' => 'جحي', + 'ï¶¿' => 'حجي', + 'ï·€' => 'مجي', + 'ï·' => 'Ùمي', + 'ï·‚' => 'بحي', + 'ï·ƒ' => 'كمم', + 'ï·„' => 'عجم', + 'ï·…' => 'صمم', + 'ï·†' => 'سخي', + 'ï·‡' => 'نجي', + 'ï·°' => 'صلے', + 'ï·±' => 'قلے', + 'ï·²' => 'الله', + 'ï·³' => 'اكبر', + 'ï·´' => 'محمد', + 'ï·µ' => 'صلعم', + 'ï·¶' => 'رسول', + 'ï··' => 'عليه', + 'ï·¸' => 'وسلم', + 'ï·¹' => 'صلى', + 'ï·º' => 'صلى الله عليه وسلم', + 'ï·»' => 'جل جلاله', + 'ï·¼' => 'ریال', + 'ï¸' => ',', + '︑' => 'ã€', + '︒' => '。', + '︓' => ':', + '︔' => ';', + '︕' => '!', + '︖' => '?', + '︗' => '〖', + '︘' => '〗', + '︙' => '...', + '︰' => '..', + '︱' => '—', + '︲' => '–', + '︳' => '_', + '︴' => '_', + '︵' => '(', + '︶' => ')', + '︷' => '{', + '︸' => '}', + '︹' => '〔', + '︺' => '〕', + '︻' => 'ã€', + '︼' => '】', + '︽' => '《', + '︾' => '》', + '︿' => '〈', + 'ï¹€' => '〉', + 'ï¹' => '「', + '﹂' => 'ã€', + '﹃' => '『', + '﹄' => 'ã€', + '﹇' => '[', + '﹈' => ']', + '﹉' => ' Ì…', + '﹊' => ' Ì…', + '﹋' => ' Ì…', + '﹌' => ' Ì…', + 'ï¹' => '_', + '﹎' => '_', + 'ï¹' => '_', + 'ï¹' => ',', + '﹑' => 'ã€', + 'ï¹’' => '.', + 'ï¹”' => ';', + '﹕' => ':', + 'ï¹–' => '?', + 'ï¹—' => '!', + '﹘' => '—', + 'ï¹™' => '(', + '﹚' => ')', + 'ï¹›' => '{', + '﹜' => '}', + 'ï¹' => '〔', + '﹞' => '〕', + '﹟' => '#', + 'ï¹ ' => '&', + '﹡' => '*', + 'ï¹¢' => '+', + 'ï¹£' => '-', + '﹤' => '<', + 'ï¹¥' => '>', + '﹦' => '=', + '﹨' => '\\', + '﹩' => '$', + '﹪' => '%', + '﹫' => '@', + 'ï¹°' => ' Ù‹', + 'ï¹±' => 'ـً', + 'ï¹²' => ' ÙŒ', + 'ï¹´' => ' Ù', + 'ï¹¶' => ' ÙŽ', + 'ï¹·' => 'Ù€ÙŽ', + 'ﹸ' => ' Ù', + 'ï¹¹' => 'Ù€Ù', + 'ﹺ' => ' Ù', + 'ï¹»' => 'Ù€Ù', + 'ï¹¼' => ' Ù‘', + 'ï¹½' => 'ـّ', + 'ï¹¾' => ' Ù’', + 'ﹿ' => 'ـْ', + 'ﺀ' => 'Ø¡', + 'ïº' => 'آ', + 'ﺂ' => 'آ', + 'ﺃ' => 'أ', + 'ﺄ' => 'أ', + 'ﺅ' => 'ÙˆÙ”', + 'ﺆ' => 'ÙˆÙ”', + 'ﺇ' => 'إ', + 'ﺈ' => 'إ', + 'ﺉ' => 'ÙŠÙ”', + 'ﺊ' => 'ÙŠÙ”', + 'ﺋ' => 'ÙŠÙ”', + 'ﺌ' => 'ÙŠÙ”', + 'ïº' => 'ا', + 'ﺎ' => 'ا', + 'ïº' => 'ب', + 'ïº' => 'ب', + 'ﺑ' => 'ب', + 'ﺒ' => 'ب', + 'ﺓ' => 'Ø©', + 'ﺔ' => 'Ø©', + 'ﺕ' => 'ت', + 'ﺖ' => 'ت', + 'ﺗ' => 'ت', + 'ﺘ' => 'ت', + 'ﺙ' => 'Ø«', + 'ﺚ' => 'Ø«', + 'ﺛ' => 'Ø«', + 'ﺜ' => 'Ø«', + 'ïº' => 'ج', + 'ﺞ' => 'ج', + 'ﺟ' => 'ج', + 'ﺠ' => 'ج', + 'ﺡ' => 'Ø­', + 'ﺢ' => 'Ø­', + 'ﺣ' => 'Ø­', + 'ﺤ' => 'Ø­', + 'ﺥ' => 'Ø®', + 'ﺦ' => 'Ø®', + 'ﺧ' => 'Ø®', + 'ﺨ' => 'Ø®', + 'ﺩ' => 'د', + 'ﺪ' => 'د', + 'ﺫ' => 'ذ', + 'ﺬ' => 'ذ', + 'ﺭ' => 'ر', + 'ﺮ' => 'ر', + 'ﺯ' => 'ز', + 'ﺰ' => 'ز', + 'ﺱ' => 'س', + 'ﺲ' => 'س', + 'ﺳ' => 'س', + 'ﺴ' => 'س', + 'ﺵ' => 'Ø´', + 'ﺶ' => 'Ø´', + 'ﺷ' => 'Ø´', + 'ﺸ' => 'Ø´', + 'ﺹ' => 'ص', + 'ﺺ' => 'ص', + 'ﺻ' => 'ص', + 'ﺼ' => 'ص', + 'ﺽ' => 'ض', + 'ﺾ' => 'ض', + 'ﺿ' => 'ض', + 'ﻀ' => 'ض', + 'ï»' => 'Ø·', + 'ﻂ' => 'Ø·', + 'ﻃ' => 'Ø·', + 'ﻄ' => 'Ø·', + 'ï»…' => 'ظ', + 'ﻆ' => 'ظ', + 'ﻇ' => 'ظ', + 'ﻈ' => 'ظ', + 'ﻉ' => 'ع', + 'ﻊ' => 'ع', + 'ﻋ' => 'ع', + 'ﻌ' => 'ع', + 'ï»' => 'غ', + 'ﻎ' => 'غ', + 'ï»' => 'غ', + 'ï»' => 'غ', + 'ﻑ' => 'Ù', + 'ï»’' => 'Ù', + 'ﻓ' => 'Ù', + 'ï»”' => 'Ù', + 'ﻕ' => 'Ù‚', + 'ï»–' => 'Ù‚', + 'ï»—' => 'Ù‚', + 'ﻘ' => 'Ù‚', + 'ï»™' => 'Ùƒ', + 'ﻚ' => 'Ùƒ', + 'ï»›' => 'Ùƒ', + 'ﻜ' => 'Ùƒ', + 'ï»' => 'Ù„', + 'ﻞ' => 'Ù„', + 'ﻟ' => 'Ù„', + 'ï» ' => 'Ù„', + 'ﻡ' => 'Ù…', + 'ﻢ' => 'Ù…', + 'ﻣ' => 'Ù…', + 'ﻤ' => 'Ù…', + 'ﻥ' => 'Ù†', + 'ﻦ' => 'Ù†', + 'ï»§' => 'Ù†', + 'ﻨ' => 'Ù†', + 'ﻩ' => 'Ù‡', + 'ﻪ' => 'Ù‡', + 'ﻫ' => 'Ù‡', + 'ﻬ' => 'Ù‡', + 'ï»­' => 'Ùˆ', + 'ï»®' => 'Ùˆ', + 'ﻯ' => 'Ù‰', + 'ï»°' => 'Ù‰', + 'ï»±' => 'ÙŠ', + 'ﻲ' => 'ÙŠ', + 'ﻳ' => 'ÙŠ', + 'ï»´' => 'ÙŠ', + 'ﻵ' => 'لآ', + 'ï»¶' => 'لآ', + 'ï»·' => 'لأ', + 'ﻸ' => 'لأ', + 'ﻹ' => 'لإ', + 'ﻺ' => 'لإ', + 'ï»»' => 'لا', + 'ﻼ' => 'لا', + 'ï¼' => '!', + '"' => '"', + '#' => '#', + '$' => '$', + 'ï¼…' => '%', + '&' => '&', + ''' => '\'', + '(' => '(', + ')' => ')', + '*' => '*', + '+' => '+', + ',' => ',', + 'ï¼' => '-', + '.' => '.', + 'ï¼' => '/', + 'ï¼' => '0', + '1' => '1', + 'ï¼’' => '2', + '3' => '3', + 'ï¼”' => '4', + '5' => '5', + 'ï¼–' => '6', + 'ï¼—' => '7', + '8' => '8', + 'ï¼™' => '9', + ':' => ':', + 'ï¼›' => ';', + '<' => '<', + 'ï¼' => '=', + '>' => '>', + '?' => '?', + 'ï¼ ' => '@', + 'A' => 'A', + 'ï¼¢' => 'B', + 'ï¼£' => 'C', + 'D' => 'D', + 'ï¼¥' => 'E', + 'F' => 'F', + 'ï¼§' => 'G', + 'H' => 'H', + 'I' => 'I', + 'J' => 'J', + 'K' => 'K', + 'L' => 'L', + 'ï¼­' => 'M', + 'ï¼®' => 'N', + 'O' => 'O', + 'ï¼°' => 'P', + 'ï¼±' => 'Q', + 'ï¼²' => 'R', + 'ï¼³' => 'S', + 'ï¼´' => 'T', + 'ï¼µ' => 'U', + 'ï¼¶' => 'V', + 'ï¼·' => 'W', + 'X' => 'X', + 'ï¼¹' => 'Y', + 'Z' => 'Z', + 'ï¼»' => '[', + 'ï¼¼' => '\\', + 'ï¼½' => ']', + 'ï¼¾' => '^', + '_' => '_', + 'ï½€' => '`', + 'ï½' => 'a', + 'b' => 'b', + 'c' => 'c', + 'd' => 'd', + 'ï½…' => 'e', + 'f' => 'f', + 'g' => 'g', + 'h' => 'h', + 'i' => 'i', + 'j' => 'j', + 'k' => 'k', + 'l' => 'l', + 'ï½' => 'm', + 'n' => 'n', + 'ï½' => 'o', + 'ï½' => 'p', + 'q' => 'q', + 'ï½’' => 'r', + 's' => 's', + 'ï½”' => 't', + 'u' => 'u', + 'ï½–' => 'v', + 'ï½—' => 'w', + 'x' => 'x', + 'ï½™' => 'y', + 'z' => 'z', + 'ï½›' => '{', + '|' => '|', + 'ï½' => '}', + '~' => '~', + '⦅' => '⦅', + 'ï½ ' => '⦆', + '。' => '。', + 'ï½¢' => '「', + 'ï½£' => 'ã€', + '、' => 'ã€', + 'ï½¥' => '・', + 'ヲ' => 'ヲ', + 'ï½§' => 'ã‚¡', + 'ィ' => 'ã‚£', + 'ゥ' => 'ã‚¥', + 'ェ' => 'ã‚§', + 'ォ' => 'ã‚©', + 'ャ' => 'ャ', + 'ï½­' => 'ュ', + 'ï½®' => 'ョ', + 'ッ' => 'ッ', + 'ï½°' => 'ー', + 'ï½±' => 'ã‚¢', + 'ï½²' => 'イ', + 'ï½³' => 'ウ', + 'ï½´' => 'エ', + 'ï½µ' => 'オ', + 'ï½¶' => 'ã‚«', + 'ï½·' => 'ã‚­', + 'ク' => 'ク', + 'ï½¹' => 'ケ', + 'コ' => 'コ', + 'ï½»' => 'サ', + 'ï½¼' => 'ã‚·', + 'ï½½' => 'ス', + 'ï½¾' => 'ã‚»', + 'ソ' => 'ソ', + 'ï¾€' => 'ã‚¿', + 'ï¾' => 'ãƒ', + 'ツ' => 'ツ', + 'テ' => 'テ', + 'ト' => 'ト', + 'ï¾…' => 'ナ', + 'ニ' => 'ニ', + 'ヌ' => 'ヌ', + 'ネ' => 'ãƒ', + 'ノ' => 'ノ', + 'ハ' => 'ãƒ', + 'ヒ' => 'ヒ', + 'フ' => 'フ', + 'ï¾' => 'ヘ', + 'ホ' => 'ホ', + 'ï¾' => 'マ', + 'ï¾' => 'ミ', + 'ム' => 'ム', + 'ï¾’' => 'メ', + 'モ' => 'モ', + 'ï¾”' => 'ヤ', + 'ユ' => 'ユ', + 'ï¾–' => 'ヨ', + 'ï¾—' => 'ラ', + 'リ' => 'リ', + 'ï¾™' => 'ル', + 'レ' => 'レ', + 'ï¾›' => 'ロ', + 'ワ' => 'ワ', + 'ï¾' => 'ン', + '゙' => 'ã‚™', + '゚' => '゚', + 'ï¾ ' => 'á… ', + 'ᄀ' => 'á„€', + 'ï¾¢' => 'á„', + 'ï¾£' => 'ᆪ', + 'ᄂ' => 'á„‚', + 'ï¾¥' => 'ᆬ', + 'ᆭ' => 'ᆭ', + 'ï¾§' => 'ᄃ', + 'ᄄ' => 'á„„', + 'ᄅ' => 'á„…', + 'ᆰ' => 'ᆰ', + 'ᆱ' => 'ᆱ', + 'ᆲ' => 'ᆲ', + 'ï¾­' => 'ᆳ', + 'ï¾®' => 'ᆴ', + 'ᆵ' => 'ᆵ', + 'ï¾°' => 'ᄚ', + 'ï¾±' => 'ᄆ', + 'ï¾²' => 'ᄇ', + 'ï¾³' => 'ᄈ', + 'ï¾´' => 'á„¡', + 'ï¾µ' => 'ᄉ', + 'ï¾¶' => 'ᄊ', + 'ï¾·' => 'á„‹', + 'ᄌ' => 'ᄌ', + 'ï¾¹' => 'á„', + 'ᄎ' => 'ᄎ', + 'ï¾»' => 'á„', + 'ï¾¼' => 'á„', + 'ï¾½' => 'á„‘', + 'ï¾¾' => 'á„’', + 'ï¿‚' => 'á…¡', + 'ᅢ' => 'á…¢', + 'ï¿„' => 'á…£', + 'ï¿…' => 'á…¤', + 'ᅥ' => 'á…¥', + 'ᅦ' => 'á…¦', + 'ᅧ' => 'á…§', + 'ï¿‹' => 'á…¨', + 'ᅩ' => 'á…©', + 'ï¿' => 'á…ª', + 'ᅫ' => 'á…«', + 'ï¿' => 'á…¬', + 'ï¿’' => 'á…­', + 'ï¿“' => 'á…®', + 'ï¿”' => 'á…¯', + 'ï¿•' => 'á…°', + 'ï¿–' => 'á…±', + 'ï¿—' => 'á…²', + 'ᅳ' => 'á…³', + 'ï¿›' => 'á…´', + 'ᅵ' => 'á…µ', + 'ï¿ ' => '¢', + 'ï¿¡' => '£', + 'ï¿¢' => '¬', + 'ï¿£' => ' Ì„', + '¦' => '¦', + 'ï¿¥' => 'Â¥', + '₩' => 'â‚©', + '│' => '│', + 'ï¿©' => 'â†', + '↑' => '↑', + 'ï¿«' => '→', + '↓' => '↓', + 'ï¿­' => 'â– ', + 'ï¿®' => 'â—‹', + 'ð€' => 'A', + 'ð' => 'B', + 'ð‚' => 'C', + 'ðƒ' => 'D', + 'ð„' => 'E', + 'ð…' => 'F', + 'ð†' => 'G', + 'ð‡' => 'H', + 'ðˆ' => 'I', + 'ð‰' => 'J', + 'ðŠ' => 'K', + 'ð‹' => 'L', + 'ðŒ' => 'M', + 'ð' => 'N', + 'ðŽ' => 'O', + 'ð' => 'P', + 'ð' => 'Q', + 'ð‘' => 'R', + 'ð’' => 'S', + 'ð“' => 'T', + 'ð”' => 'U', + 'ð•' => 'V', + 'ð–' => 'W', + 'ð—' => 'X', + 'ð˜' => 'Y', + 'ð™' => 'Z', + 'ðš' => 'a', + 'ð›' => 'b', + 'ðœ' => 'c', + 'ð' => 'd', + 'ðž' => 'e', + 'ðŸ' => 'f', + 'ð ' => 'g', + 'ð¡' => 'h', + 'ð¢' => 'i', + 'ð£' => 'j', + 'ð¤' => 'k', + 'ð¥' => 'l', + 'ð¦' => 'm', + 'ð§' => 'n', + 'ð¨' => 'o', + 'ð©' => 'p', + 'ðª' => 'q', + 'ð«' => 'r', + 'ð¬' => 's', + 'ð­' => 't', + 'ð®' => 'u', + 'ð¯' => 'v', + 'ð°' => 'w', + 'ð±' => 'x', + 'ð²' => 'y', + 'ð³' => 'z', + 'ð´' => 'A', + 'ðµ' => 'B', + 'ð¶' => 'C', + 'ð·' => 'D', + 'ð¸' => 'E', + 'ð¹' => 'F', + 'ðº' => 'G', + 'ð»' => 'H', + 'ð¼' => 'I', + 'ð½' => 'J', + 'ð¾' => 'K', + 'ð¿' => 'L', + 'ð‘€' => 'M', + 'ð‘' => 'N', + 'ð‘‚' => 'O', + 'ð‘ƒ' => 'P', + 'ð‘„' => 'Q', + 'ð‘…' => 'R', + 'ð‘†' => 'S', + 'ð‘‡' => 'T', + 'ð‘ˆ' => 'U', + 'ð‘‰' => 'V', + 'ð‘Š' => 'W', + 'ð‘‹' => 'X', + 'ð‘Œ' => 'Y', + 'ð‘' => 'Z', + 'ð‘Ž' => 'a', + 'ð‘' => 'b', + 'ð‘' => 'c', + 'ð‘‘' => 'd', + 'ð‘’' => 'e', + 'ð‘“' => 'f', + 'ð‘”' => 'g', + 'ð‘–' => 'i', + 'ð‘—' => 'j', + 'ð‘˜' => 'k', + 'ð‘™' => 'l', + 'ð‘š' => 'm', + 'ð‘›' => 'n', + 'ð‘œ' => 'o', + 'ð‘' => 'p', + 'ð‘ž' => 'q', + 'ð‘Ÿ' => 'r', + 'ð‘ ' => 's', + 'ð‘¡' => 't', + 'ð‘¢' => 'u', + 'ð‘£' => 'v', + 'ð‘¤' => 'w', + 'ð‘¥' => 'x', + 'ð‘¦' => 'y', + 'ð‘§' => 'z', + 'ð‘¨' => 'A', + 'ð‘©' => 'B', + 'ð‘ª' => 'C', + 'ð‘«' => 'D', + 'ð‘¬' => 'E', + 'ð‘­' => 'F', + 'ð‘®' => 'G', + 'ð‘¯' => 'H', + 'ð‘°' => 'I', + 'ð‘±' => 'J', + 'ð‘²' => 'K', + 'ð‘³' => 'L', + 'ð‘´' => 'M', + 'ð‘µ' => 'N', + 'ð‘¶' => 'O', + 'ð‘·' => 'P', + 'ð‘¸' => 'Q', + 'ð‘¹' => 'R', + 'ð‘º' => 'S', + 'ð‘»' => 'T', + 'ð‘¼' => 'U', + 'ð‘½' => 'V', + 'ð‘¾' => 'W', + 'ð‘¿' => 'X', + 'ð’€' => 'Y', + 'ð’' => 'Z', + 'ð’‚' => 'a', + 'ð’ƒ' => 'b', + 'ð’„' => 'c', + 'ð’…' => 'd', + 'ð’†' => 'e', + 'ð’‡' => 'f', + 'ð’ˆ' => 'g', + 'ð’‰' => 'h', + 'ð’Š' => 'i', + 'ð’‹' => 'j', + 'ð’Œ' => 'k', + 'ð’' => 'l', + 'ð’Ž' => 'm', + 'ð’' => 'n', + 'ð’' => 'o', + 'ð’‘' => 'p', + 'ð’’' => 'q', + 'ð’“' => 'r', + 'ð’”' => 's', + 'ð’•' => 't', + 'ð’–' => 'u', + 'ð’—' => 'v', + 'ð’˜' => 'w', + 'ð’™' => 'x', + 'ð’š' => 'y', + 'ð’›' => 'z', + 'ð’œ' => 'A', + 'ð’ž' => 'C', + 'ð’Ÿ' => 'D', + 'ð’¢' => 'G', + 'ð’¥' => 'J', + 'ð’¦' => 'K', + 'ð’©' => 'N', + 'ð’ª' => 'O', + 'ð’«' => 'P', + 'ð’¬' => 'Q', + 'ð’®' => 'S', + 'ð’¯' => 'T', + 'ð’°' => 'U', + 'ð’±' => 'V', + 'ð’²' => 'W', + 'ð’³' => 'X', + 'ð’´' => 'Y', + 'ð’µ' => 'Z', + 'ð’¶' => 'a', + 'ð’·' => 'b', + 'ð’¸' => 'c', + 'ð’¹' => 'd', + 'ð’»' => 'f', + 'ð’½' => 'h', + 'ð’¾' => 'i', + 'ð’¿' => 'j', + 'ð“€' => 'k', + 'ð“' => 'l', + 'ð“‚' => 'm', + 'ð“ƒ' => 'n', + 'ð“…' => 'p', + 'ð“†' => 'q', + 'ð“‡' => 'r', + 'ð“ˆ' => 's', + 'ð“‰' => 't', + 'ð“Š' => 'u', + 'ð“‹' => 'v', + 'ð“Œ' => 'w', + 'ð“' => 'x', + 'ð“Ž' => 'y', + 'ð“' => 'z', + 'ð“' => 'A', + 'ð“‘' => 'B', + 'ð“’' => 'C', + 'ð““' => 'D', + 'ð“”' => 'E', + 'ð“•' => 'F', + 'ð“–' => 'G', + 'ð“—' => 'H', + 'ð“˜' => 'I', + 'ð“™' => 'J', + 'ð“š' => 'K', + 'ð“›' => 'L', + 'ð“œ' => 'M', + 'ð“' => 'N', + 'ð“ž' => 'O', + 'ð“Ÿ' => 'P', + 'ð“ ' => 'Q', + 'ð“¡' => 'R', + 'ð“¢' => 'S', + 'ð“£' => 'T', + 'ð“¤' => 'U', + 'ð“¥' => 'V', + 'ð“¦' => 'W', + 'ð“§' => 'X', + 'ð“¨' => 'Y', + 'ð“©' => 'Z', + 'ð“ª' => 'a', + 'ð“«' => 'b', + 'ð“¬' => 'c', + 'ð“­' => 'd', + 'ð“®' => 'e', + 'ð“¯' => 'f', + 'ð“°' => 'g', + 'ð“±' => 'h', + 'ð“²' => 'i', + 'ð“³' => 'j', + 'ð“´' => 'k', + 'ð“µ' => 'l', + 'ð“¶' => 'm', + 'ð“·' => 'n', + 'ð“¸' => 'o', + 'ð“¹' => 'p', + 'ð“º' => 'q', + 'ð“»' => 'r', + 'ð“¼' => 's', + 'ð“½' => 't', + 'ð“¾' => 'u', + 'ð“¿' => 'v', + 'ð”€' => 'w', + 'ð”' => 'x', + 'ð”‚' => 'y', + 'ð”ƒ' => 'z', + 'ð”„' => 'A', + 'ð”…' => 'B', + 'ð”‡' => 'D', + 'ð”ˆ' => 'E', + 'ð”‰' => 'F', + 'ð”Š' => 'G', + 'ð”' => 'J', + 'ð”Ž' => 'K', + 'ð”' => 'L', + 'ð”' => 'M', + 'ð”‘' => 'N', + 'ð”’' => 'O', + 'ð”“' => 'P', + 'ð””' => 'Q', + 'ð”–' => 'S', + 'ð”—' => 'T', + 'ð”˜' => 'U', + 'ð”™' => 'V', + 'ð”š' => 'W', + 'ð”›' => 'X', + 'ð”œ' => 'Y', + 'ð”ž' => 'a', + 'ð”Ÿ' => 'b', + 'ð” ' => 'c', + 'ð”¡' => 'd', + 'ð”¢' => 'e', + 'ð”£' => 'f', + 'ð”¤' => 'g', + 'ð”¥' => 'h', + 'ð”¦' => 'i', + 'ð”§' => 'j', + 'ð”¨' => 'k', + 'ð”©' => 'l', + 'ð”ª' => 'm', + 'ð”«' => 'n', + 'ð”¬' => 'o', + 'ð”­' => 'p', + 'ð”®' => 'q', + 'ð”¯' => 'r', + 'ð”°' => 's', + 'ð”±' => 't', + 'ð”²' => 'u', + 'ð”³' => 'v', + 'ð”´' => 'w', + 'ð”µ' => 'x', + 'ð”¶' => 'y', + 'ð”·' => 'z', + 'ð”¸' => 'A', + 'ð”¹' => 'B', + 'ð”»' => 'D', + 'ð”¼' => 'E', + 'ð”½' => 'F', + 'ð”¾' => 'G', + 'ð•€' => 'I', + 'ð•' => 'J', + 'ð•‚' => 'K', + 'ð•ƒ' => 'L', + 'ð•„' => 'M', + 'ð•†' => 'O', + 'ð•Š' => 'S', + 'ð•‹' => 'T', + 'ð•Œ' => 'U', + 'ð•' => 'V', + 'ð•Ž' => 'W', + 'ð•' => 'X', + 'ð•' => 'Y', + 'ð•’' => 'a', + 'ð•“' => 'b', + 'ð•”' => 'c', + 'ð••' => 'd', + 'ð•–' => 'e', + 'ð•—' => 'f', + 'ð•˜' => 'g', + 'ð•™' => 'h', + 'ð•š' => 'i', + 'ð•›' => 'j', + 'ð•œ' => 'k', + 'ð•' => 'l', + 'ð•ž' => 'm', + 'ð•Ÿ' => 'n', + 'ð• ' => 'o', + 'ð•¡' => 'p', + 'ð•¢' => 'q', + 'ð•£' => 'r', + 'ð•¤' => 's', + 'ð•¥' => 't', + 'ð•¦' => 'u', + 'ð•§' => 'v', + 'ð•¨' => 'w', + 'ð•©' => 'x', + 'ð•ª' => 'y', + 'ð•«' => 'z', + 'ð•¬' => 'A', + 'ð•­' => 'B', + 'ð•®' => 'C', + 'ð•¯' => 'D', + 'ð•°' => 'E', + 'ð•±' => 'F', + 'ð•²' => 'G', + 'ð•³' => 'H', + 'ð•´' => 'I', + 'ð•µ' => 'J', + 'ð•¶' => 'K', + 'ð•·' => 'L', + 'ð•¸' => 'M', + 'ð•¹' => 'N', + 'ð•º' => 'O', + 'ð•»' => 'P', + 'ð•¼' => 'Q', + 'ð•½' => 'R', + 'ð•¾' => 'S', + 'ð•¿' => 'T', + 'ð–€' => 'U', + 'ð–' => 'V', + 'ð–‚' => 'W', + 'ð–ƒ' => 'X', + 'ð–„' => 'Y', + 'ð–…' => 'Z', + 'ð–†' => 'a', + 'ð–‡' => 'b', + 'ð–ˆ' => 'c', + 'ð–‰' => 'd', + 'ð–Š' => 'e', + 'ð–‹' => 'f', + 'ð–Œ' => 'g', + 'ð–' => 'h', + 'ð–Ž' => 'i', + 'ð–' => 'j', + 'ð–' => 'k', + 'ð–‘' => 'l', + 'ð–’' => 'm', + 'ð–“' => 'n', + 'ð–”' => 'o', + 'ð–•' => 'p', + 'ð––' => 'q', + 'ð–—' => 'r', + 'ð–˜' => 's', + 'ð–™' => 't', + 'ð–š' => 'u', + 'ð–›' => 'v', + 'ð–œ' => 'w', + 'ð–' => 'x', + 'ð–ž' => 'y', + 'ð–Ÿ' => 'z', + 'ð– ' => 'A', + 'ð–¡' => 'B', + 'ð–¢' => 'C', + 'ð–£' => 'D', + 'ð–¤' => 'E', + 'ð–¥' => 'F', + 'ð–¦' => 'G', + 'ð–§' => 'H', + 'ð–¨' => 'I', + 'ð–©' => 'J', + 'ð–ª' => 'K', + 'ð–«' => 'L', + 'ð–¬' => 'M', + 'ð–­' => 'N', + 'ð–®' => 'O', + 'ð–¯' => 'P', + 'ð–°' => 'Q', + 'ð–±' => 'R', + 'ð–²' => 'S', + 'ð–³' => 'T', + 'ð–´' => 'U', + 'ð–µ' => 'V', + 'ð–¶' => 'W', + 'ð–·' => 'X', + 'ð–¸' => 'Y', + 'ð–¹' => 'Z', + 'ð–º' => 'a', + 'ð–»' => 'b', + 'ð–¼' => 'c', + 'ð–½' => 'd', + 'ð–¾' => 'e', + 'ð–¿' => 'f', + 'ð—€' => 'g', + 'ð—' => 'h', + 'ð—‚' => 'i', + 'ð—ƒ' => 'j', + 'ð—„' => 'k', + 'ð—…' => 'l', + 'ð—†' => 'm', + 'ð—‡' => 'n', + 'ð—ˆ' => 'o', + 'ð—‰' => 'p', + 'ð—Š' => 'q', + 'ð—‹' => 'r', + 'ð—Œ' => 's', + 'ð—' => 't', + 'ð—Ž' => 'u', + 'ð—' => 'v', + 'ð—' => 'w', + 'ð—‘' => 'x', + 'ð—’' => 'y', + 'ð—“' => 'z', + 'ð—”' => 'A', + 'ð—•' => 'B', + 'ð—–' => 'C', + 'ð——' => 'D', + 'ð—˜' => 'E', + 'ð—™' => 'F', + 'ð—š' => 'G', + 'ð—›' => 'H', + 'ð—œ' => 'I', + 'ð—' => 'J', + 'ð—ž' => 'K', + 'ð—Ÿ' => 'L', + 'ð— ' => 'M', + 'ð—¡' => 'N', + 'ð—¢' => 'O', + 'ð—£' => 'P', + 'ð—¤' => 'Q', + 'ð—¥' => 'R', + 'ð—¦' => 'S', + 'ð—§' => 'T', + 'ð—¨' => 'U', + 'ð—©' => 'V', + 'ð—ª' => 'W', + 'ð—«' => 'X', + 'ð—¬' => 'Y', + 'ð—­' => 'Z', + 'ð—®' => 'a', + 'ð—¯' => 'b', + 'ð—°' => 'c', + 'ð—±' => 'd', + 'ð—²' => 'e', + 'ð—³' => 'f', + 'ð—´' => 'g', + 'ð—µ' => 'h', + 'ð—¶' => 'i', + 'ð—·' => 'j', + 'ð—¸' => 'k', + 'ð—¹' => 'l', + 'ð—º' => 'm', + 'ð—»' => 'n', + 'ð—¼' => 'o', + 'ð—½' => 'p', + 'ð—¾' => 'q', + 'ð—¿' => 'r', + 'ð˜€' => 's', + 'ð˜' => 't', + 'ð˜‚' => 'u', + 'ð˜ƒ' => 'v', + 'ð˜„' => 'w', + 'ð˜…' => 'x', + 'ð˜†' => 'y', + 'ð˜‡' => 'z', + 'ð˜ˆ' => 'A', + 'ð˜‰' => 'B', + 'ð˜Š' => 'C', + 'ð˜‹' => 'D', + 'ð˜Œ' => 'E', + 'ð˜' => 'F', + 'ð˜Ž' => 'G', + 'ð˜' => 'H', + 'ð˜' => 'I', + 'ð˜‘' => 'J', + 'ð˜’' => 'K', + 'ð˜“' => 'L', + 'ð˜”' => 'M', + 'ð˜•' => 'N', + 'ð˜–' => 'O', + 'ð˜—' => 'P', + 'ð˜˜' => 'Q', + 'ð˜™' => 'R', + 'ð˜š' => 'S', + 'ð˜›' => 'T', + 'ð˜œ' => 'U', + 'ð˜' => 'V', + 'ð˜ž' => 'W', + 'ð˜Ÿ' => 'X', + 'ð˜ ' => 'Y', + 'ð˜¡' => 'Z', + 'ð˜¢' => 'a', + 'ð˜£' => 'b', + 'ð˜¤' => 'c', + 'ð˜¥' => 'd', + 'ð˜¦' => 'e', + 'ð˜§' => 'f', + 'ð˜¨' => 'g', + 'ð˜©' => 'h', + 'ð˜ª' => 'i', + 'ð˜«' => 'j', + 'ð˜¬' => 'k', + 'ð˜­' => 'l', + 'ð˜®' => 'm', + 'ð˜¯' => 'n', + 'ð˜°' => 'o', + 'ð˜±' => 'p', + 'ð˜²' => 'q', + 'ð˜³' => 'r', + 'ð˜´' => 's', + 'ð˜µ' => 't', + 'ð˜¶' => 'u', + 'ð˜·' => 'v', + 'ð˜¸' => 'w', + 'ð˜¹' => 'x', + 'ð˜º' => 'y', + 'ð˜»' => 'z', + 'ð˜¼' => 'A', + 'ð˜½' => 'B', + 'ð˜¾' => 'C', + 'ð˜¿' => 'D', + 'ð™€' => 'E', + 'ð™' => 'F', + 'ð™‚' => 'G', + 'ð™ƒ' => 'H', + 'ð™„' => 'I', + 'ð™…' => 'J', + 'ð™†' => 'K', + 'ð™‡' => 'L', + 'ð™ˆ' => 'M', + 'ð™‰' => 'N', + 'ð™Š' => 'O', + 'ð™‹' => 'P', + 'ð™Œ' => 'Q', + 'ð™' => 'R', + 'ð™Ž' => 'S', + 'ð™' => 'T', + 'ð™' => 'U', + 'ð™‘' => 'V', + 'ð™’' => 'W', + 'ð™“' => 'X', + 'ð™”' => 'Y', + 'ð™•' => 'Z', + 'ð™–' => 'a', + 'ð™—' => 'b', + 'ð™˜' => 'c', + 'ð™™' => 'd', + 'ð™š' => 'e', + 'ð™›' => 'f', + 'ð™œ' => 'g', + 'ð™' => 'h', + 'ð™ž' => 'i', + 'ð™Ÿ' => 'j', + 'ð™ ' => 'k', + 'ð™¡' => 'l', + 'ð™¢' => 'm', + 'ð™£' => 'n', + 'ð™¤' => 'o', + 'ð™¥' => 'p', + 'ð™¦' => 'q', + 'ð™§' => 'r', + 'ð™¨' => 's', + 'ð™©' => 't', + 'ð™ª' => 'u', + 'ð™«' => 'v', + 'ð™¬' => 'w', + 'ð™­' => 'x', + 'ð™®' => 'y', + 'ð™¯' => 'z', + 'ð™°' => 'A', + 'ð™±' => 'B', + 'ð™²' => 'C', + 'ð™³' => 'D', + 'ð™´' => 'E', + 'ð™µ' => 'F', + 'ð™¶' => 'G', + 'ð™·' => 'H', + 'ð™¸' => 'I', + 'ð™¹' => 'J', + 'ð™º' => 'K', + 'ð™»' => 'L', + 'ð™¼' => 'M', + 'ð™½' => 'N', + 'ð™¾' => 'O', + 'ð™¿' => 'P', + 'ðš€' => 'Q', + 'ðš' => 'R', + 'ðš‚' => 'S', + 'ðšƒ' => 'T', + 'ðš„' => 'U', + 'ðš…' => 'V', + 'ðš†' => 'W', + 'ðš‡' => 'X', + 'ðšˆ' => 'Y', + 'ðš‰' => 'Z', + 'ðšŠ' => 'a', + 'ðš‹' => 'b', + 'ðšŒ' => 'c', + 'ðš' => 'd', + 'ðšŽ' => 'e', + 'ðš' => 'f', + 'ðš' => 'g', + 'ðš‘' => 'h', + 'ðš’' => 'i', + 'ðš“' => 'j', + 'ðš”' => 'k', + 'ðš•' => 'l', + 'ðš–' => 'm', + 'ðš—' => 'n', + 'ðš˜' => 'o', + 'ðš™' => 'p', + 'ðšš' => 'q', + 'ðš›' => 'r', + 'ðšœ' => 's', + 'ðš' => 't', + 'ðšž' => 'u', + 'ðšŸ' => 'v', + 'ðš ' => 'w', + 'ðš¡' => 'x', + 'ðš¢' => 'y', + 'ðš£' => 'z', + 'ðš¤' => 'ı', + 'ðš¥' => 'È·', + 'ðš¨' => 'Α', + 'ðš©' => 'Î’', + 'ðšª' => 'Γ', + 'ðš«' => 'Δ', + 'ðš¬' => 'Ε', + 'ðš­' => 'Ζ', + 'ðš®' => 'Η', + 'ðš¯' => 'Θ', + 'ðš°' => 'Ι', + 'ðš±' => 'Κ', + 'ðš²' => 'Λ', + 'ðš³' => 'Μ', + 'ðš´' => 'Î', + 'ðšµ' => 'Ξ', + 'ðš¶' => 'Ο', + 'ðš·' => 'Π', + 'ðš¸' => 'Ρ', + 'ðš¹' => 'Θ', + 'ðšº' => 'Σ', + 'ðš»' => 'Τ', + 'ðš¼' => 'Î¥', + 'ðš½' => 'Φ', + 'ðš¾' => 'Χ', + 'ðš¿' => 'Ψ', + 'ð›€' => 'Ω', + 'ð›' => '∇', + 'ð›‚' => 'α', + 'ð›ƒ' => 'β', + 'ð›„' => 'γ', + 'ð›…' => 'δ', + 'ð›†' => 'ε', + 'ð›‡' => 'ζ', + 'ð›ˆ' => 'η', + 'ð›‰' => 'θ', + 'ð›Š' => 'ι', + 'ð›‹' => 'κ', + 'ð›Œ' => 'λ', + 'ð›' => 'μ', + 'ð›Ž' => 'ν', + 'ð›' => 'ξ', + 'ð›' => 'ο', + 'ð›‘' => 'Ï€', + 'ð›’' => 'Ï', + 'ð›“' => 'Ï‚', + 'ð›”' => 'σ', + 'ð›•' => 'Ï„', + 'ð›–' => 'Ï…', + 'ð›—' => 'φ', + 'ð›˜' => 'χ', + 'ð›™' => 'ψ', + 'ð›š' => 'ω', + 'ð››' => '∂', + 'ð›œ' => 'ε', + 'ð›' => 'θ', + 'ð›ž' => 'κ', + 'ð›Ÿ' => 'φ', + 'ð› ' => 'Ï', + 'ð›¡' => 'Ï€', + 'ð›¢' => 'Α', + 'ð›£' => 'Î’', + 'ð›¤' => 'Γ', + 'ð›¥' => 'Δ', + 'ð›¦' => 'Ε', + 'ð›§' => 'Ζ', + 'ð›¨' => 'Η', + 'ð›©' => 'Θ', + 'ð›ª' => 'Ι', + 'ð›«' => 'Κ', + 'ð›¬' => 'Λ', + 'ð›­' => 'Μ', + 'ð›®' => 'Î', + 'ð›¯' => 'Ξ', + 'ð›°' => 'Ο', + 'ð›±' => 'Π', + 'ð›²' => 'Ρ', + 'ð›³' => 'Θ', + 'ð›´' => 'Σ', + 'ð›µ' => 'Τ', + 'ð›¶' => 'Î¥', + 'ð›·' => 'Φ', + 'ð›¸' => 'Χ', + 'ð›¹' => 'Ψ', + 'ð›º' => 'Ω', + 'ð›»' => '∇', + 'ð›¼' => 'α', + 'ð›½' => 'β', + 'ð›¾' => 'γ', + 'ð›¿' => 'δ', + 'ðœ€' => 'ε', + 'ðœ' => 'ζ', + 'ðœ‚' => 'η', + 'ðœƒ' => 'θ', + 'ðœ„' => 'ι', + 'ðœ…' => 'κ', + 'ðœ†' => 'λ', + 'ðœ‡' => 'μ', + 'ðœˆ' => 'ν', + 'ðœ‰' => 'ξ', + 'ðœŠ' => 'ο', + 'ðœ‹' => 'Ï€', + 'ðœŒ' => 'Ï', + 'ðœ' => 'Ï‚', + 'ðœŽ' => 'σ', + 'ðœ' => 'Ï„', + 'ðœ' => 'Ï…', + 'ðœ‘' => 'φ', + 'ðœ’' => 'χ', + 'ðœ“' => 'ψ', + 'ðœ”' => 'ω', + 'ðœ•' => '∂', + 'ðœ–' => 'ε', + 'ðœ—' => 'θ', + 'ðœ˜' => 'κ', + 'ðœ™' => 'φ', + 'ðœš' => 'Ï', + 'ðœ›' => 'Ï€', + 'ðœœ' => 'Α', + 'ðœ' => 'Î’', + 'ðœž' => 'Γ', + 'ðœŸ' => 'Δ', + 'ðœ ' => 'Ε', + 'ðœ¡' => 'Ζ', + 'ðœ¢' => 'Η', + 'ðœ£' => 'Θ', + 'ðœ¤' => 'Ι', + 'ðœ¥' => 'Κ', + 'ðœ¦' => 'Λ', + 'ðœ§' => 'Μ', + 'ðœ¨' => 'Î', + 'ðœ©' => 'Ξ', + 'ðœª' => 'Ο', + 'ðœ«' => 'Π', + 'ðœ¬' => 'Ρ', + 'ðœ­' => 'Θ', + 'ðœ®' => 'Σ', + 'ðœ¯' => 'Τ', + 'ðœ°' => 'Î¥', + 'ðœ±' => 'Φ', + 'ðœ²' => 'Χ', + 'ðœ³' => 'Ψ', + 'ðœ´' => 'Ω', + 'ðœµ' => '∇', + 'ðœ¶' => 'α', + 'ðœ·' => 'β', + 'ðœ¸' => 'γ', + 'ðœ¹' => 'δ', + 'ðœº' => 'ε', + 'ðœ»' => 'ζ', + 'ðœ¼' => 'η', + 'ðœ½' => 'θ', + 'ðœ¾' => 'ι', + 'ðœ¿' => 'κ', + 'ð€' => 'λ', + 'ð' => 'μ', + 'ð‚' => 'ν', + 'ðƒ' => 'ξ', + 'ð„' => 'ο', + 'ð…' => 'Ï€', + 'ð†' => 'Ï', + 'ð‡' => 'Ï‚', + 'ðˆ' => 'σ', + 'ð‰' => 'Ï„', + 'ðŠ' => 'Ï…', + 'ð‹' => 'φ', + 'ðŒ' => 'χ', + 'ð' => 'ψ', + 'ðŽ' => 'ω', + 'ð' => '∂', + 'ð' => 'ε', + 'ð‘' => 'θ', + 'ð’' => 'κ', + 'ð“' => 'φ', + 'ð”' => 'Ï', + 'ð•' => 'Ï€', + 'ð–' => 'Α', + 'ð—' => 'Î’', + 'ð˜' => 'Γ', + 'ð™' => 'Δ', + 'ðš' => 'Ε', + 'ð›' => 'Ζ', + 'ðœ' => 'Η', + 'ð' => 'Θ', + 'ðž' => 'Ι', + 'ðŸ' => 'Κ', + 'ð ' => 'Λ', + 'ð¡' => 'Μ', + 'ð¢' => 'Î', + 'ð£' => 'Ξ', + 'ð¤' => 'Ο', + 'ð¥' => 'Π', + 'ð¦' => 'Ρ', + 'ð§' => 'Θ', + 'ð¨' => 'Σ', + 'ð©' => 'Τ', + 'ðª' => 'Î¥', + 'ð«' => 'Φ', + 'ð¬' => 'Χ', + 'ð­' => 'Ψ', + 'ð®' => 'Ω', + 'ð¯' => '∇', + 'ð°' => 'α', + 'ð±' => 'β', + 'ð²' => 'γ', + 'ð³' => 'δ', + 'ð´' => 'ε', + 'ðµ' => 'ζ', + 'ð¶' => 'η', + 'ð·' => 'θ', + 'ð¸' => 'ι', + 'ð¹' => 'κ', + 'ðº' => 'λ', + 'ð»' => 'μ', + 'ð¼' => 'ν', + 'ð½' => 'ξ', + 'ð¾' => 'ο', + 'ð¿' => 'Ï€', + 'ðž€' => 'Ï', + 'ðž' => 'Ï‚', + 'ðž‚' => 'σ', + 'ðžƒ' => 'Ï„', + 'ðž„' => 'Ï…', + 'ðž…' => 'φ', + 'ðž†' => 'χ', + 'ðž‡' => 'ψ', + 'ðžˆ' => 'ω', + 'ðž‰' => '∂', + 'ðžŠ' => 'ε', + 'ðž‹' => 'θ', + 'ðžŒ' => 'κ', + 'ðž' => 'φ', + 'ðžŽ' => 'Ï', + 'ðž' => 'Ï€', + 'ðž' => 'Α', + 'ðž‘' => 'Î’', + 'ðž’' => 'Γ', + 'ðž“' => 'Δ', + 'ðž”' => 'Ε', + 'ðž•' => 'Ζ', + 'ðž–' => 'Η', + 'ðž—' => 'Θ', + 'ðž˜' => 'Ι', + 'ðž™' => 'Κ', + 'ðžš' => 'Λ', + 'ðž›' => 'Μ', + 'ðžœ' => 'Î', + 'ðž' => 'Ξ', + 'ðžž' => 'Ο', + 'ðžŸ' => 'Π', + 'ðž ' => 'Ρ', + 'ðž¡' => 'Θ', + 'ðž¢' => 'Σ', + 'ðž£' => 'Τ', + 'ðž¤' => 'Î¥', + 'ðž¥' => 'Φ', + 'ðž¦' => 'Χ', + 'ðž§' => 'Ψ', + 'ðž¨' => 'Ω', + 'ðž©' => '∇', + 'ðžª' => 'α', + 'ðž«' => 'β', + 'ðž¬' => 'γ', + 'ðž­' => 'δ', + 'ðž®' => 'ε', + 'ðž¯' => 'ζ', + 'ðž°' => 'η', + 'ðž±' => 'θ', + 'ðž²' => 'ι', + 'ðž³' => 'κ', + 'ðž´' => 'λ', + 'ðžµ' => 'μ', + 'ðž¶' => 'ν', + 'ðž·' => 'ξ', + 'ðž¸' => 'ο', + 'ðž¹' => 'Ï€', + 'ðžº' => 'Ï', + 'ðž»' => 'Ï‚', + 'ðž¼' => 'σ', + 'ðž½' => 'Ï„', + 'ðž¾' => 'Ï…', + 'ðž¿' => 'φ', + 'ðŸ€' => 'χ', + 'ðŸ' => 'ψ', + 'ðŸ‚' => 'ω', + 'ðŸƒ' => '∂', + 'ðŸ„' => 'ε', + 'ðŸ…' => 'θ', + 'ðŸ†' => 'κ', + 'ðŸ‡' => 'φ', + 'ðŸˆ' => 'Ï', + 'ðŸ‰' => 'Ï€', + 'ðŸŠ' => 'Ïœ', + 'ðŸ‹' => 'Ï', + 'ðŸŽ' => '0', + 'ðŸ' => '1', + 'ðŸ' => '2', + 'ðŸ‘' => '3', + 'ðŸ’' => '4', + 'ðŸ“' => '5', + 'ðŸ”' => '6', + 'ðŸ•' => '7', + 'ðŸ–' => '8', + 'ðŸ—' => '9', + 'ðŸ˜' => '0', + 'ðŸ™' => '1', + 'ðŸš' => '2', + 'ðŸ›' => '3', + 'ðŸœ' => '4', + 'ðŸ' => '5', + 'ðŸž' => '6', + 'ðŸŸ' => '7', + 'ðŸ ' => '8', + 'ðŸ¡' => '9', + 'ðŸ¢' => '0', + 'ðŸ£' => '1', + 'ðŸ¤' => '2', + 'ðŸ¥' => '3', + 'ðŸ¦' => '4', + 'ðŸ§' => '5', + 'ðŸ¨' => '6', + 'ðŸ©' => '7', + 'ðŸª' => '8', + 'ðŸ«' => '9', + 'ðŸ¬' => '0', + 'ðŸ­' => '1', + 'ðŸ®' => '2', + 'ðŸ¯' => '3', + 'ðŸ°' => '4', + 'ðŸ±' => '5', + 'ðŸ²' => '6', + 'ðŸ³' => '7', + 'ðŸ´' => '8', + 'ðŸµ' => '9', + 'ðŸ¶' => '0', + 'ðŸ·' => '1', + 'ðŸ¸' => '2', + 'ðŸ¹' => '3', + 'ðŸº' => '4', + 'ðŸ»' => '5', + 'ðŸ¼' => '6', + 'ðŸ½' => '7', + 'ðŸ¾' => '8', + 'ðŸ¿' => '9', + '𞸀' => 'ا', + 'ðž¸' => 'ب', + '𞸂' => 'ج', + '𞸃' => 'د', + '𞸅' => 'Ùˆ', + '𞸆' => 'ز', + '𞸇' => 'Ø­', + '𞸈' => 'Ø·', + '𞸉' => 'ÙŠ', + '𞸊' => 'Ùƒ', + '𞸋' => 'Ù„', + '𞸌' => 'Ù…', + 'ðž¸' => 'Ù†', + '𞸎' => 'س', + 'ðž¸' => 'ع', + 'ðž¸' => 'Ù', + '𞸑' => 'ص', + '𞸒' => 'Ù‚', + '𞸓' => 'ر', + '𞸔' => 'Ø´', + '𞸕' => 'ت', + '𞸖' => 'Ø«', + '𞸗' => 'Ø®', + '𞸘' => 'ذ', + '𞸙' => 'ض', + '𞸚' => 'ظ', + '𞸛' => 'غ', + '𞸜' => 'Ù®', + 'ðž¸' => 'Úº', + '𞸞' => 'Ú¡', + '𞸟' => 'Ù¯', + '𞸡' => 'ب', + '𞸢' => 'ج', + '𞸤' => 'Ù‡', + '𞸧' => 'Ø­', + '𞸩' => 'ÙŠ', + '𞸪' => 'Ùƒ', + '𞸫' => 'Ù„', + '𞸬' => 'Ù…', + '𞸭' => 'Ù†', + '𞸮' => 'س', + '𞸯' => 'ع', + '𞸰' => 'Ù', + '𞸱' => 'ص', + '𞸲' => 'Ù‚', + '𞸴' => 'Ø´', + '𞸵' => 'ت', + '𞸶' => 'Ø«', + '𞸷' => 'Ø®', + '𞸹' => 'ض', + '𞸻' => 'غ', + '𞹂' => 'ج', + '𞹇' => 'Ø­', + '𞹉' => 'ÙŠ', + '𞹋' => 'Ù„', + 'ðž¹' => 'Ù†', + '𞹎' => 'س', + 'ðž¹' => 'ع', + '𞹑' => 'ص', + 'ðž¹’' => 'Ù‚', + 'ðž¹”' => 'Ø´', + 'ðž¹—' => 'Ø®', + 'ðž¹™' => 'ض', + 'ðž¹›' => 'غ', + 'ðž¹' => 'Úº', + '𞹟' => 'Ù¯', + '𞹡' => 'ب', + 'ðž¹¢' => 'ج', + '𞹤' => 'Ù‡', + 'ðž¹§' => 'Ø­', + '𞹨' => 'Ø·', + '𞹩' => 'ÙŠ', + '𞹪' => 'Ùƒ', + '𞹬' => 'Ù…', + 'ðž¹­' => 'Ù†', + 'ðž¹®' => 'س', + '𞹯' => 'ع', + 'ðž¹°' => 'Ù', + 'ðž¹±' => 'ص', + 'ðž¹²' => 'Ù‚', + 'ðž¹´' => 'Ø´', + 'ðž¹µ' => 'ت', + 'ðž¹¶' => 'Ø«', + 'ðž¹·' => 'Ø®', + 'ðž¹¹' => 'ض', + '𞹺' => 'ظ', + 'ðž¹»' => 'غ', + 'ðž¹¼' => 'Ù®', + 'ðž¹¾' => 'Ú¡', + '𞺀' => 'ا', + 'ðžº' => 'ب', + '𞺂' => 'ج', + '𞺃' => 'د', + '𞺄' => 'Ù‡', + '𞺅' => 'Ùˆ', + '𞺆' => 'ز', + '𞺇' => 'Ø­', + '𞺈' => 'Ø·', + '𞺉' => 'ÙŠ', + '𞺋' => 'Ù„', + '𞺌' => 'Ù…', + 'ðžº' => 'Ù†', + '𞺎' => 'س', + 'ðžº' => 'ع', + 'ðžº' => 'Ù', + '𞺑' => 'ص', + '𞺒' => 'Ù‚', + '𞺓' => 'ر', + '𞺔' => 'Ø´', + '𞺕' => 'ت', + '𞺖' => 'Ø«', + '𞺗' => 'Ø®', + '𞺘' => 'ذ', + '𞺙' => 'ض', + '𞺚' => 'ظ', + '𞺛' => 'غ', + '𞺡' => 'ب', + '𞺢' => 'ج', + '𞺣' => 'د', + '𞺥' => 'Ùˆ', + '𞺦' => 'ز', + '𞺧' => 'Ø­', + '𞺨' => 'Ø·', + '𞺩' => 'ÙŠ', + '𞺫' => 'Ù„', + '𞺬' => 'Ù…', + '𞺭' => 'Ù†', + '𞺮' => 'س', + '𞺯' => 'ع', + '𞺰' => 'Ù', + '𞺱' => 'ص', + '𞺲' => 'Ù‚', + '𞺳' => 'ر', + '𞺴' => 'Ø´', + '𞺵' => 'ت', + '𞺶' => 'Ø«', + '𞺷' => 'Ø®', + '𞺸' => 'ذ', + '𞺹' => 'ض', + '𞺺' => 'ظ', + '𞺻' => 'غ', + '🄀' => '0.', + 'ðŸ„' => '0,', + '🄂' => '1,', + '🄃' => '2,', + '🄄' => '3,', + '🄅' => '4,', + '🄆' => '5,', + '🄇' => '6,', + '🄈' => '7,', + '🄉' => '8,', + '🄊' => '9,', + 'ðŸ„' => '(A)', + '🄑' => '(B)', + '🄒' => '(C)', + '🄓' => '(D)', + '🄔' => '(E)', + '🄕' => '(F)', + '🄖' => '(G)', + '🄗' => '(H)', + '🄘' => '(I)', + '🄙' => '(J)', + '🄚' => '(K)', + '🄛' => '(L)', + '🄜' => '(M)', + 'ðŸ„' => '(N)', + '🄞' => '(O)', + '🄟' => '(P)', + '🄠' => '(Q)', + '🄡' => '(R)', + '🄢' => '(S)', + '🄣' => '(T)', + '🄤' => '(U)', + '🄥' => '(V)', + '🄦' => '(W)', + '🄧' => '(X)', + '🄨' => '(Y)', + '🄩' => '(Z)', + '🄪' => '〔S〕', + '🄫' => 'C', + '🄬' => 'R', + '🄭' => 'CD', + '🄮' => 'WZ', + '🄰' => 'A', + '🄱' => 'B', + '🄲' => 'C', + '🄳' => 'D', + '🄴' => 'E', + '🄵' => 'F', + '🄶' => 'G', + '🄷' => 'H', + '🄸' => 'I', + '🄹' => 'J', + '🄺' => 'K', + '🄻' => 'L', + '🄼' => 'M', + '🄽' => 'N', + '🄾' => 'O', + '🄿' => 'P', + '🅀' => 'Q', + 'ðŸ…' => 'R', + '🅂' => 'S', + '🅃' => 'T', + '🅄' => 'U', + '🅅' => 'V', + '🅆' => 'W', + '🅇' => 'X', + '🅈' => 'Y', + '🅉' => 'Z', + '🅊' => 'HV', + '🅋' => 'MV', + '🅌' => 'SD', + 'ðŸ…' => 'SS', + '🅎' => 'PPV', + 'ðŸ…' => 'WC', + '🅪' => 'MC', + '🅫' => 'MD', + '🅬' => 'MR', + 'ðŸ†' => 'DJ', + '🈀' => 'ã»ã‹', + 'ðŸˆ' => 'ココ', + '🈂' => 'サ', + 'ðŸˆ' => '手', + '🈑' => 'å­—', + '🈒' => 'åŒ', + '🈓' => 'デ', + '🈔' => '二', + '🈕' => '多', + '🈖' => 'è§£', + '🈗' => '天', + '🈘' => '交', + '🈙' => '映', + '🈚' => 'ç„¡', + '🈛' => 'æ–™', + '🈜' => 'å‰', + 'ðŸˆ' => '後', + '🈞' => 'å†', + '🈟' => 'æ–°', + '🈠' => 'åˆ', + '🈡' => '終', + '🈢' => '生', + '🈣' => '販', + '🈤' => '声', + '🈥' => 'å¹', + '🈦' => 'æ¼”', + '🈧' => '投', + '🈨' => 'æ•', + '🈩' => '一', + '🈪' => '三', + '🈫' => 'éŠ', + '🈬' => 'å·¦', + '🈭' => '中', + '🈮' => 'å³', + '🈯' => '指', + '🈰' => 'èµ°', + '🈱' => '打', + '🈲' => 'ç¦', + '🈳' => '空', + '🈴' => 'åˆ', + '🈵' => '満', + '🈶' => '有', + '🈷' => '月', + '🈸' => '申', + '🈹' => '割', + '🈺' => 'å–¶', + '🈻' => 'é…', + '🉀' => '〔本〕', + 'ðŸ‰' => '〔三〕', + '🉂' => '〔二〕', + '🉃' => '〔安〕', + '🉄' => '〔点〕', + '🉅' => '〔打〕', + '🉆' => '〔盗〕', + '🉇' => '〔å‹ã€•', + '🉈' => '〔敗〕', + 'ðŸ‰' => 'å¾—', + '🉑' => 'å¯', + '🯰' => '0', + '🯱' => '1', + '🯲' => '2', + '🯳' => '3', + '🯴' => '4', + '🯵' => '5', + '🯶' => '6', + '🯷' => '7', + '🯸' => '8', + '🯹' => '9', +); diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php new file mode 100644 index 0000000000..3608e5c05d --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php @@ -0,0 +1,23 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } +} diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php new file mode 100644 index 0000000000..e36d1a9477 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php @@ -0,0 +1,19 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Intl\Normalizer as p; + +if (!function_exists('normalizer_is_normalized')) { + function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); } +} +if (!function_exists('normalizer_normalize')) { + function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); } +} diff --git a/vendor/symfony/polyfill-intl-normalizer/composer.json b/vendor/symfony/polyfill-intl-normalizer/composer.json new file mode 100644 index 0000000000..9bd04e8879 --- /dev/null +++ b/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-intl-normalizer", + "type": "library", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "suggest": { + "ext-intl": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd300..6e3afce692 100644 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ b/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index 15503bc9dd..31e36a368f 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,11 @@ * - mb_strstr - Finds first occurrence of a string within another * - mb_strwidth - Return width of string * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -67,19 +72,29 @@ */ final class Mbstring { - const MB_CASE_FOLD = PHP_INT_MAX; + public const MB_CASE_FOLD = \PHP_INT_MAX; - private static $encodingList = array('ASCII', 'UTF-8'); + private const SIMPLE_CASE_FOLD = [ + ['µ', 'Å¿', "\xCD\x85", 'Ï‚', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'Ï€', 'κ', 'Ï', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; - private static $caseFold = array( - array('µ', 'Å¿', "\xCD\x85", 'Ï‚', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), - array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'Ï€', 'κ', 'Ï', 'ε', "\xE1\xB9\xA1", 'ι'), - ); public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($s)) { + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -104,24 +119,22 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); } - return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); } if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); $fromEncoding = 'UTF-8'; } return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } - public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) { - $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); - $ok = true; array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { $ok = false; } }); @@ -136,23 +149,23 @@ public static function mb_decode_mimeheader($s) public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); } public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; } - if (!\is_array($convmap) || !$convmap) { + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { return false; } if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return ''; // Instead of null (cf. mb_encode_numericentity). } @@ -185,7 +198,7 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; for ($i = 0; $i < $cnt; $i += 4) { if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return Mbstring::mb_chr($c - $convmap[$i + 2]); + return self::mb_chr($c - $convmap[$i + 2]); } } @@ -201,24 +214,24 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; } - if (!\is_array($convmap) || !$convmap) { + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { return false; } if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; // Instead of '' (cf. mb_decode_numericentity). } if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING); + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); return null; } @@ -239,7 +252,7 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ $s = iconv($encoding, 'UTF-8//IGNORE', $s); } - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; $cnt = floor(\count($convmap) / 4) * 4; $i = 0; @@ -287,14 +300,14 @@ public static function mb_convert_case($s, $mode, $encoding = null) $s = iconv($encoding, 'UTF-8//IGNORE', $s); } - if (MB_CASE_TITLE == $mode) { + if (\MB_CASE_TITLE == $mode) { static $titleRegexp = null; if (null === $titleRegexp) { $titleRegexp = self::getData('titleCaseRegexp'); } - $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); } else { - if (MB_CASE_UPPER == $mode) { + if (\MB_CASE_UPPER == $mode) { static $upper = null; if (null === $upper) { $upper = self::getData('upperCase'); @@ -302,7 +315,11 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -312,7 +329,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $lower; } - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; $i = 0; $len = \strlen($s); @@ -353,15 +370,19 @@ public static function mb_internal_encoding($encoding = null) return self::$internalEncoding; } - $encoding = self::getEncoding($encoding); + $normalizedEncoding = self::getEncoding($encoding); - if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { - self::$internalEncoding = $encoding; + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; return true; } - return false; + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); } public static function mb_language($lang = null) @@ -370,20 +391,24 @@ public static function mb_language($lang = null) return self::$language; } - switch ($lang = strtolower($lang)) { + switch ($normalizedLang = strtolower($lang)) { case 'uni': case 'neutral': - self::$language = $lang; + self::$language = $normalizedLang; return true; } - return false; + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); } public static function mb_list_encodings() { - return array('UTF-8'); + return ['UTF-8']; } public static function mb_encoding_aliases($encoding) @@ -391,7 +416,7 @@ public static function mb_encoding_aliases($encoding) switch (strtoupper($encoding)) { case 'UTF8': case 'UTF-8': - return array('utf8'); + return ['utf8']; } return false; @@ -406,7 +431,20 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -493,9 +531,13 @@ public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = nu $needle = (string) $needle; if ('' === $needle) { - trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - return false; + return false; + } + + return 0; } return iconv_strpos($haystack, $needle, $offset, $encoding); @@ -521,23 +563,29 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = n } } - $pos = iconv_strrpos($haystack, $needle, $encoding); + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); return false !== $pos ? $offset + $pos : false; } public static function mb_str_split($string, $split_length = 1, $encoding = null) { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', E_USER_WARNING); + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); return null; } if (1 > $split_length = (int) $split_length) { - trigger_error('The length of each segment must be greater than zero', E_USER_WARNING); + if (80000 > \PHP_VERSION_ID) { + trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - return false; + return false; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); } if (null === $encoding) { @@ -552,10 +600,10 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null } $rx .= '.{'.$split_length.'})/us'; - return preg_split($rx, $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); } - $result = array(); + $result = []; $length = mb_strlen($string, $encoding); for ($i = 0; $i < $length; $i += $split_length) { @@ -567,21 +615,30 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null public static function mb_strtolower($s, $encoding = null) { - return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); } public static function mb_strtoupper($s, $encoding = null) { - return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); } public static function mb_substitute_character($c = null) { + if (null === $c) { + return 'none'; + } if (0 === strcasecmp($c, 'none')) { return true; } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } - return null !== $c ? false : 'none'; + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } public static function mb_substr($s, $start, $length = null, $encoding = null) @@ -612,8 +669,10 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -629,10 +688,11 @@ public static function mb_strrchr($haystack, $needle, $part = false, $encoding = { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrchr($haystack, $needle, $part); + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); } - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } @@ -647,8 +707,11 @@ public static function mb_strrichr($haystack, $needle, $part = false, $encoding public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -668,7 +731,7 @@ public static function mb_strstr($haystack, $needle, $part = false, $encoding = public static function mb_get_info($type = 'all') { - $info = array( + $info = [ 'internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', @@ -683,7 +746,7 @@ public static function mb_get_info($type = 'all') 'detect_order' => self::$encodingList, 'substitute_character' => 'none', 'strict_detection' => 'Off', - ); + ]; if ('all' === $type) { return $info; @@ -771,6 +834,69 @@ public static function mb_ord($s, $encoding = null) return $code; } + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -787,7 +913,7 @@ private static function html_encoding_callback(array $m) { $i = 1; $entities = ''; - $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); while (isset($m[$i])) { if (0x80 > $m[$i]) { @@ -810,7 +936,7 @@ private static function html_encoding_callback(array $m) private static function title_case(array $s) { - return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); } private static function getData($file) @@ -844,4 +970,76 @@ private static function getEncoding($encoding) return $encoding; } + + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); + } + } else { + $string = iconv($encoding, 'UTF-8//IGNORE', $string); + + if (null !== $characters) { + $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $string); + } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + } } diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md index 4efb599d81..478b40da25 100644 --- a/vendor/symfony/polyfill-mbstring/README.md +++ b/vendor/symfony/polyfill-mbstring/README.md @@ -5,7 +5,7 @@ This component provides a partial, native PHP implementation for the [Mbstring](https://php.net/mbstring) extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 0000000000..512bba0bfd --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ +<?php + +return [ + 'İ' => 'i̇', + 'µ' => 'μ', + 'Å¿' => 's', + 'Í…' => 'ι', + 'Ï‚' => 'σ', + 'Ï' => 'β', + 'Ï‘' => 'θ', + 'Ï•' => 'φ', + 'Ï–' => 'Ï€', + 'ϰ' => 'κ', + 'ϱ' => 'Ï', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'á¾¾' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'Î' => 'Î', + 'ΰ' => 'ΰ', + 'Ö‡' => 'Õ¥Ö‚', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'á½' => 'á½', + 'á½’' => 'á½’', + 'á½”' => 'á½”', + 'á½–' => 'á½–', + 'á¾€' => 'ἀι', + 'á¾' => 'á¼Î¹', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'á¾…' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'á¼Î¹', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'á¾' => 'ἅι', + 'ᾎ' => 'ἆι', + 'á¾' => 'ἇι', + 'á¾' => 'ἠι', + 'ᾑ' => 'ἡι', + 'á¾’' => 'ἢι', + 'ᾓ' => 'ἣι', + 'á¾”' => 'ἤι', + 'ᾕ' => 'ἥι', + 'á¾–' => 'ἦι', + 'á¾—' => 'ἧι', + 'ᾘ' => 'ἠι', + 'á¾™' => 'ἡι', + 'ᾚ' => 'ἢι', + 'á¾›' => 'ἣι', + 'ᾜ' => 'ἤι', + 'á¾' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'á¾ ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'á¾¢' => 'ὢι', + 'á¾£' => 'ὣι', + 'ᾤ' => 'ὤι', + 'á¾¥' => 'ὥι', + 'ᾦ' => 'ὦι', + 'á¾§' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'á¾­' => 'ὥι', + 'á¾®' => 'ὦι', + 'ᾯ' => 'ὧι', + 'á¾²' => 'ὰι', + 'á¾³' => 'αι', + 'á¾´' => 'άι', + 'á¾¶' => 'á¾¶', + 'á¾·' => 'ᾶι', + 'á¾¼' => 'αι', + 'á¿‚' => 'ὴι', + 'ῃ' => 'ηι', + 'á¿„' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'á¿’' => 'á¿’', + 'á¿–' => 'á¿–', + 'á¿—' => 'á¿—', + 'á¿¢' => 'á¿¢', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'á¿§' => 'á¿§', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'á¿´' => 'ώι', + 'á¿¶' => 'á¿¶', + 'á¿·' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'ï¬' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'Õ´Õ¶', + 'ﬔ' => 'Õ´Õ¥', + 'ﬕ' => 'Õ´Õ«', + 'ﬖ' => 'Õ¾Õ¶', + 'ﬗ' => 'Õ´Õ­', +]; diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php index e6fbfa64e6..fac60b081a 100644 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -1,6 +1,6 @@ <?php -return array( +return array ( 'A' => 'a', 'B' => 'b', 'C' => 'c', @@ -81,7 +81,7 @@ 'Ī' => 'Ä«', 'Ĭ' => 'Ä­', 'Ä®' => 'į', - 'İ' => 'i', + 'İ' => 'i̇', 'IJ' => 'ij', 'Ä´' => 'ĵ', 'Ķ' => 'Ä·', @@ -510,6 +510,138 @@ 'Ⴥ' => 'â´¥', 'Ⴧ' => 'â´§', 'áƒ' => 'â´­', + 'Ꭰ' => 'ê­°', + 'Ꭱ' => 'ê­±', + 'Ꭲ' => 'ê­²', + 'Ꭳ' => 'ê­³', + 'Ꭴ' => 'ê­´', + 'Ꭵ' => 'ê­µ', + 'Ꭶ' => 'ê­¶', + 'Ꭷ' => 'ê­·', + 'Ꭸ' => 'ê­¸', + 'Ꭹ' => 'ê­¹', + 'Ꭺ' => 'ê­º', + 'Ꭻ' => 'ê­»', + 'Ꭼ' => 'ê­¼', + 'Ꭽ' => 'ê­½', + 'Ꭾ' => 'ê­¾', + 'Ꭿ' => 'ê­¿', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ê®', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ê®…', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ê®', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ê®', + 'á€' => 'ê®', + 'á' => 'ꮑ', + 'á‚' => 'ê®’', + 'áƒ' => 'ꮓ', + 'á„' => 'ê®”', + 'á…' => 'ꮕ', + 'á†' => 'ê®–', + 'á‡' => 'ê®—', + 'áˆ' => 'ꮘ', + 'á‰' => 'ê®™', + 'áŠ' => 'ꮚ', + 'á‹' => 'ê®›', + 'áŒ' => 'ꮜ', + 'á' => 'ê®', + 'áŽ' => 'ꮞ', + 'á' => 'ꮟ', + 'á' => 'ê® ', + 'á‘' => 'ꮡ', + 'á’' => 'ꮢ', + 'á“' => 'ꮣ', + 'á”' => 'ꮤ', + 'á•' => 'ꮥ', + 'á–' => 'ꮦ', + 'á—' => 'ê®§', + 'á˜' => 'ꮨ', + 'á™' => 'ꮩ', + 'áš' => 'ꮪ', + 'á›' => 'ꮫ', + 'áœ' => 'ꮬ', + 'á' => 'ê®­', + 'áž' => 'ê®®', + 'áŸ' => 'ꮯ', + 'á ' => 'ê®°', + 'á¡' => 'ê®±', + 'á¢' => 'ꮲ', + 'á£' => 'ꮳ', + 'á¤' => 'ê®´', + 'á¥' => 'ꮵ', + 'á¦' => 'ê®¶', + 'á§' => 'ê®·', + 'á¨' => 'ꮸ', + 'á©' => 'ꮹ', + 'áª' => 'ꮺ', + 'á«' => 'ê®»', + 'á¬' => 'ꮼ', + 'á­' => 'ꮽ', + 'á®' => 'ꮾ', + 'á¯' => 'ꮿ', + 'á°' => 'á¸', + 'á±' => 'á¹', + 'á²' => 'áº', + 'á³' => 'á»', + 'á´' => 'á¼', + 'áµ' => 'á½', + 'á²' => 'áƒ', + 'Ბ' => 'ბ', + 'á²’' => 'გ', + 'Დ' => 'დ', + 'á²”' => 'ე', + 'Ვ' => 'ვ', + 'á²–' => 'ზ', + 'á²—' => 'თ', + 'Ი' => 'ი', + 'á²™' => 'კ', + 'Ლ' => 'ლ', + 'á²›' => 'მ', + 'Ნ' => 'ნ', + 'á²' => 'áƒ', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'á² ' => 'რ', + 'Ს' => 'ს', + 'á²¢' => 'ტ', + 'á²£' => 'უ', + 'Ფ' => 'ფ', + 'á²¥' => 'ქ', + 'Ღ' => 'ღ', + 'á²§' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'á²­' => 'ჭ', + 'á²®' => 'ხ', + 'Ჯ' => 'ჯ', + 'á²°' => 'ჰ', + 'á²±' => 'ჱ', + 'á²²' => 'ჲ', + 'á²³' => 'ჳ', + 'á²´' => 'ჴ', + 'á²µ' => 'ჵ', + 'á²¶' => 'ჶ', + 'á²·' => 'ჷ', + 'Ჸ' => 'ჸ', + 'á²¹' => 'ჹ', + 'Ჺ' => 'ჺ', + 'á²½' => 'ჽ', + 'á²¾' => 'ჾ', + 'Ჿ' => 'ჿ', 'Ḁ' => 'á¸', 'Ḃ' => 'ḃ', 'Ḅ' => 'ḅ', @@ -993,8 +1125,24 @@ 'êž«' => 'Éœ', 'Ɡ' => 'É¡', 'êž­' => 'ɬ', + 'êž®' => 'ɪ', 'êž°' => 'Êž', 'êž±' => 'ʇ', + 'êž²' => 'Ê', + 'êž³' => 'ê­“', + 'êž´' => 'êžµ', + 'êž¶' => 'êž·', + 'Ꞹ' => 'êž¹', + 'Ꞻ' => 'êž»', + 'êž¼' => 'êž½', + 'êž¾' => 'êž¿', + 'Ꟃ' => 'ꟃ', + 'Ꞔ' => 'êž”', + 'Ʂ' => 'Ê‚', + 'Ᶎ' => 'á¶Ž', + 'Ꟈ' => 'ꟈ', + 'Ꟊ' => 'ꟊ', + 'Ꟶ' => 'ꟶ', 'A' => 'ï½', 'ï¼¢' => 'b', 'ï¼£' => 'c', @@ -1061,6 +1209,93 @@ 'ð¥' => 'ð‘', 'ð¦' => 'ð‘Ž', 'ð§' => 'ð‘', + 'ð’°' => 'ð“˜', + 'ð’±' => 'ð“™', + 'ð’²' => 'ð“š', + 'ð’³' => 'ð“›', + 'ð’´' => 'ð“œ', + 'ð’µ' => 'ð“', + 'ð’¶' => 'ð“ž', + 'ð’·' => 'ð“Ÿ', + 'ð’¸' => 'ð“ ', + 'ð’¹' => 'ð“¡', + 'ð’º' => 'ð“¢', + 'ð’»' => 'ð“£', + 'ð’¼' => 'ð“¤', + 'ð’½' => 'ð“¥', + 'ð’¾' => 'ð“¦', + 'ð’¿' => 'ð“§', + 'ð“€' => 'ð“¨', + 'ð“' => 'ð“©', + 'ð“‚' => 'ð“ª', + 'ð“ƒ' => 'ð“«', + 'ð“„' => 'ð“¬', + 'ð“…' => 'ð“­', + 'ð“†' => 'ð“®', + 'ð“‡' => 'ð“¯', + 'ð“ˆ' => 'ð“°', + 'ð“‰' => 'ð“±', + 'ð“Š' => 'ð“²', + 'ð“‹' => 'ð“³', + 'ð“Œ' => 'ð“´', + 'ð“' => 'ð“µ', + 'ð“Ž' => 'ð“¶', + 'ð“' => 'ð“·', + 'ð“' => 'ð“¸', + 'ð“‘' => 'ð“¹', + 'ð“’' => 'ð“º', + 'ð““' => 'ð“»', + 'ð²€' => 'ð³€', + 'ð²' => 'ð³', + 'ð²‚' => 'ð³‚', + 'ð²ƒ' => 'ð³ƒ', + 'ð²„' => 'ð³„', + 'ð²…' => 'ð³…', + 'ð²†' => 'ð³†', + 'ð²‡' => 'ð³‡', + 'ð²ˆ' => 'ð³ˆ', + 'ð²‰' => 'ð³‰', + 'ð²Š' => 'ð³Š', + 'ð²‹' => 'ð³‹', + 'ð²Œ' => 'ð³Œ', + 'ð²' => 'ð³', + 'ð²Ž' => 'ð³Ž', + 'ð²' => 'ð³', + 'ð²' => 'ð³', + 'ð²‘' => 'ð³‘', + 'ð²’' => 'ð³’', + 'ð²“' => 'ð³“', + 'ð²”' => 'ð³”', + 'ð²•' => 'ð³•', + 'ð²–' => 'ð³–', + 'ð²—' => 'ð³—', + 'ð²˜' => 'ð³˜', + 'ð²™' => 'ð³™', + 'ð²š' => 'ð³š', + 'ð²›' => 'ð³›', + 'ð²œ' => 'ð³œ', + 'ð²' => 'ð³', + 'ð²ž' => 'ð³ž', + 'ð²Ÿ' => 'ð³Ÿ', + 'ð² ' => 'ð³ ', + 'ð²¡' => 'ð³¡', + 'ð²¢' => 'ð³¢', + 'ð²£' => 'ð³£', + 'ð²¤' => 'ð³¤', + 'ð²¥' => 'ð³¥', + 'ð²¦' => 'ð³¦', + 'ð²§' => 'ð³§', + 'ð²¨' => 'ð³¨', + 'ð²©' => 'ð³©', + 'ð²ª' => 'ð³ª', + 'ð²«' => 'ð³«', + 'ð²¬' => 'ð³¬', + 'ð²­' => 'ð³­', + 'ð²®' => 'ð³®', + 'ð²¯' => 'ð³¯', + 'ð²°' => 'ð³°', + 'ð²±' => 'ð³±', + 'ð²²' => 'ð³²', 'ð‘¢ ' => 'ð‘£€', '𑢡' => 'ð‘£', 'ð‘¢¢' => '𑣂', @@ -1093,4 +1328,70 @@ 'ð‘¢½' => 'ð‘£', 'ð‘¢¾' => '𑣞', '𑢿' => '𑣟', + 'ð–¹€' => 'ð–¹ ', + 'ð–¹' => '𖹡', + '𖹂' => 'ð–¹¢', + '𖹃' => 'ð–¹£', + '𖹄' => '𖹤', + 'ð–¹…' => 'ð–¹¥', + '𖹆' => '𖹦', + '𖹇' => 'ð–¹§', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + 'ð–¹' => 'ð–¹­', + '𖹎' => 'ð–¹®', + 'ð–¹' => '𖹯', + 'ð–¹' => 'ð–¹°', + '𖹑' => 'ð–¹±', + 'ð–¹’' => 'ð–¹²', + '𖹓' => 'ð–¹³', + 'ð–¹”' => 'ð–¹´', + '𖹕' => 'ð–¹µ', + 'ð–¹–' => 'ð–¹¶', + 'ð–¹—' => 'ð–¹·', + '𖹘' => '𖹸', + 'ð–¹™' => 'ð–¹¹', + '𖹚' => '𖹺', + 'ð–¹›' => 'ð–¹»', + '𖹜' => 'ð–¹¼', + 'ð–¹' => 'ð–¹½', + '𖹞' => 'ð–¹¾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + 'ðž¤' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + 'ðž¤' => '𞤯', + '𞤎' => '𞤰', + 'ðž¤' => '𞤱', + 'ðž¤' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + 'ðž¤' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => 'ðž¥', + '𞤠' => '𞥂', + '𞤡' => '𞥃', ); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php index b8103b2e80..56b9cb8520 100644 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php @@ -1,6 +1,6 @@ <?php -return array( +return array ( 'a' => 'A', 'b' => 'B', 'c' => 'C', @@ -225,6 +225,7 @@ 'ɦ' => 'Ɦ', 'ɨ' => 'Æ—', 'É©' => 'Æ–', + 'ɪ' => 'êž®', 'É«' => 'â±¢', 'ɬ' => 'êž­', 'ɯ' => 'Æœ', @@ -233,6 +234,7 @@ 'ɵ' => 'ÆŸ', 'ɽ' => 'Ɽ', 'Ê€' => 'Ʀ', + 'Ê‚' => 'Ʂ', 'ʃ' => 'Æ©', 'ʇ' => 'êž±', 'ʈ' => 'Æ®', @@ -241,6 +243,7 @@ 'Ê‹' => 'Ʋ', 'ÊŒ' => 'É…', 'Ê’' => 'Æ·', + 'Ê' => 'êž²', 'Êž' => 'êž°', 'Í…' => 'Ι', 'ͱ' => 'Ͱ', @@ -493,8 +496,70 @@ 'Ö„' => 'Õ”', 'Ö…' => 'Õ•', 'Ö†' => 'Õ–', + 'áƒ' => 'á²', + 'ბ' => 'Ბ', + 'გ' => 'á²’', + 'დ' => 'Დ', + 'ე' => 'á²”', + 'ვ' => 'Ვ', + 'ზ' => 'á²–', + 'თ' => 'á²—', + 'ი' => 'Ი', + 'კ' => 'á²™', + 'ლ' => 'Ლ', + 'მ' => 'á²›', + 'ნ' => 'Ნ', + 'áƒ' => 'á²', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'á² ', + 'ს' => 'Ს', + 'ტ' => 'á²¢', + 'უ' => 'á²£', + 'ფ' => 'Ფ', + 'ქ' => 'á²¥', + 'ღ' => 'Ღ', + 'ყ' => 'á²§', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'á²­', + 'ხ' => 'á²®', + 'ჯ' => 'Ჯ', + 'ჰ' => 'á²°', + 'ჱ' => 'á²±', + 'ჲ' => 'á²²', + 'ჳ' => 'á²³', + 'ჴ' => 'á²´', + 'ჵ' => 'á²µ', + 'ჶ' => 'á²¶', + 'ჷ' => 'á²·', + 'ჸ' => 'Ჸ', + 'ჹ' => 'á²¹', + 'ჺ' => 'Ჺ', + 'ჽ' => 'á²½', + 'ჾ' => 'á²¾', + 'ჿ' => 'Ჿ', + 'á¸' => 'á°', + 'á¹' => 'á±', + 'áº' => 'á²', + 'á»' => 'á³', + 'á¼' => 'á´', + 'á½' => 'áµ', + 'á²€' => 'Ð’', + 'á²' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'á²…' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ñ¢', + 'ᲈ' => 'Ꙋ', 'áµ¹' => 'ê½', 'áµ½' => 'â±£', + 'á¶Ž' => 'Ᶎ', 'á¸' => 'Ḁ', 'ḃ' => 'Ḃ', 'ḅ' => 'Ḅ', @@ -681,41 +746,41 @@ 'á½»' => 'á¿«', 'á½¼' => 'Ὼ', 'á½½' => 'á¿»', - 'á¾€' => 'ᾈ', - 'á¾' => 'ᾉ', - 'ᾂ' => 'ᾊ', - 'ᾃ' => 'ᾋ', - 'ᾄ' => 'ᾌ', - 'á¾…' => 'á¾', - 'ᾆ' => 'ᾎ', - 'ᾇ' => 'á¾', - 'á¾' => 'ᾘ', - 'ᾑ' => 'á¾™', - 'á¾’' => 'ᾚ', - 'ᾓ' => 'á¾›', - 'á¾”' => 'ᾜ', - 'ᾕ' => 'á¾', - 'á¾–' => 'ᾞ', - 'á¾—' => 'ᾟ', - 'á¾ ' => 'ᾨ', - 'ᾡ' => 'ᾩ', - 'á¾¢' => 'ᾪ', - 'á¾£' => 'ᾫ', - 'ᾤ' => 'ᾬ', - 'á¾¥' => 'á¾­', - 'ᾦ' => 'á¾®', - 'á¾§' => 'ᾯ', + 'á¾€' => 'ἈΙ', + 'á¾' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'á¾…' => 'á¼Î™', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'á¼Î™', + 'á¾' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'á¾’' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'á¾”' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'á¾–' => 'ἮΙ', + 'á¾—' => 'ἯΙ', + 'á¾ ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'á¾¢' => 'ὪΙ', + 'á¾£' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'á¾¥' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'á¾§' => 'ὯΙ', 'á¾°' => 'Ᾰ', 'á¾±' => 'á¾¹', - 'á¾³' => 'á¾¼', + 'á¾³' => 'ΑΙ', 'á¾¾' => 'Ι', - 'ῃ' => 'ῌ', + 'ῃ' => 'ΗΙ', 'á¿' => 'Ῐ', 'á¿‘' => 'á¿™', 'á¿ ' => 'Ῠ', 'á¿¡' => 'á¿©', 'á¿¥' => 'Ῥ', - 'ῳ' => 'ῼ', + 'ῳ' => 'ΩΙ', 'â…Ž' => 'Ⅎ', 'â…°' => 'â… ', 'â…±' => 'â…¡', @@ -993,6 +1058,7 @@ 'ꞌ' => 'êž‹', 'êž‘' => 'êž', 'êž“' => 'êž’', + 'êž”' => 'Ꞔ', 'êž—' => 'êž–', 'êž™' => 'Ꞙ', 'êž›' => 'êžš', @@ -1003,6 +1069,97 @@ 'ꞥ' => 'Ꞥ', 'êž§' => 'Ꞧ', 'êž©' => 'Ꞩ', + 'êžµ' => 'êž´', + 'êž·' => 'êž¶', + 'êž¹' => 'Ꞹ', + 'êž»' => 'Ꞻ', + 'êž½' => 'êž¼', + 'êž¿' => 'êž¾', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ê­“' => 'êž³', + 'ê­°' => 'Ꭰ', + 'ê­±' => 'Ꭱ', + 'ê­²' => 'Ꭲ', + 'ê­³' => 'Ꭳ', + 'ê­´' => 'Ꭴ', + 'ê­µ' => 'Ꭵ', + 'ê­¶' => 'Ꭶ', + 'ê­·' => 'Ꭷ', + 'ê­¸' => 'Ꭸ', + 'ê­¹' => 'Ꭹ', + 'ê­º' => 'Ꭺ', + 'ê­»' => 'Ꭻ', + 'ê­¼' => 'Ꭼ', + 'ê­½' => 'Ꭽ', + 'ê­¾' => 'Ꭾ', + 'ê­¿' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ê®' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ê®…' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ê®' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ê®' => 'Ꮏ', + 'ê®' => 'á€', + 'ꮑ' => 'á', + 'ê®’' => 'á‚', + 'ꮓ' => 'áƒ', + 'ê®”' => 'á„', + 'ꮕ' => 'á…', + 'ê®–' => 'á†', + 'ê®—' => 'á‡', + 'ꮘ' => 'áˆ', + 'ê®™' => 'á‰', + 'ꮚ' => 'áŠ', + 'ê®›' => 'á‹', + 'ꮜ' => 'áŒ', + 'ê®' => 'á', + 'ꮞ' => 'áŽ', + 'ꮟ' => 'á', + 'ê® ' => 'á', + 'ꮡ' => 'á‘', + 'ꮢ' => 'á’', + 'ꮣ' => 'á“', + 'ꮤ' => 'á”', + 'ꮥ' => 'á•', + 'ꮦ' => 'á–', + 'ê®§' => 'á—', + 'ꮨ' => 'á˜', + 'ꮩ' => 'á™', + 'ꮪ' => 'áš', + 'ꮫ' => 'á›', + 'ꮬ' => 'áœ', + 'ê®­' => 'á', + 'ê®®' => 'áž', + 'ꮯ' => 'áŸ', + 'ê®°' => 'á ', + 'ê®±' => 'á¡', + 'ꮲ' => 'á¢', + 'ꮳ' => 'á£', + 'ê®´' => 'á¤', + 'ꮵ' => 'á¥', + 'ê®¶' => 'á¦', + 'ê®·' => 'á§', + 'ꮸ' => 'á¨', + 'ꮹ' => 'á©', + 'ꮺ' => 'áª', + 'ê®»' => 'á«', + 'ꮼ' => 'á¬', + 'ꮽ' => 'á­', + 'ꮾ' => 'á®', + 'ꮿ' => 'á¯', 'ï½' => 'A', 'b' => 'ï¼¢', 'c' => 'ï¼£', @@ -1069,6 +1226,93 @@ 'ð‘' => 'ð¥', 'ð‘Ž' => 'ð¦', 'ð‘' => 'ð§', + 'ð“˜' => 'ð’°', + 'ð“™' => 'ð’±', + 'ð“š' => 'ð’²', + 'ð“›' => 'ð’³', + 'ð“œ' => 'ð’´', + 'ð“' => 'ð’µ', + 'ð“ž' => 'ð’¶', + 'ð“Ÿ' => 'ð’·', + 'ð“ ' => 'ð’¸', + 'ð“¡' => 'ð’¹', + 'ð“¢' => 'ð’º', + 'ð“£' => 'ð’»', + 'ð“¤' => 'ð’¼', + 'ð“¥' => 'ð’½', + 'ð“¦' => 'ð’¾', + 'ð“§' => 'ð’¿', + 'ð“¨' => 'ð“€', + 'ð“©' => 'ð“', + 'ð“ª' => 'ð“‚', + 'ð“«' => 'ð“ƒ', + 'ð“¬' => 'ð“„', + 'ð“­' => 'ð“…', + 'ð“®' => 'ð“†', + 'ð“¯' => 'ð“‡', + 'ð“°' => 'ð“ˆ', + 'ð“±' => 'ð“‰', + 'ð“²' => 'ð“Š', + 'ð“³' => 'ð“‹', + 'ð“´' => 'ð“Œ', + 'ð“µ' => 'ð“', + 'ð“¶' => 'ð“Ž', + 'ð“·' => 'ð“', + 'ð“¸' => 'ð“', + 'ð“¹' => 'ð“‘', + 'ð“º' => 'ð“’', + 'ð“»' => 'ð““', + 'ð³€' => 'ð²€', + 'ð³' => 'ð²', + 'ð³‚' => 'ð²‚', + 'ð³ƒ' => 'ð²ƒ', + 'ð³„' => 'ð²„', + 'ð³…' => 'ð²…', + 'ð³†' => 'ð²†', + 'ð³‡' => 'ð²‡', + 'ð³ˆ' => 'ð²ˆ', + 'ð³‰' => 'ð²‰', + 'ð³Š' => 'ð²Š', + 'ð³‹' => 'ð²‹', + 'ð³Œ' => 'ð²Œ', + 'ð³' => 'ð²', + 'ð³Ž' => 'ð²Ž', + 'ð³' => 'ð²', + 'ð³' => 'ð²', + 'ð³‘' => 'ð²‘', + 'ð³’' => 'ð²’', + 'ð³“' => 'ð²“', + 'ð³”' => 'ð²”', + 'ð³•' => 'ð²•', + 'ð³–' => 'ð²–', + 'ð³—' => 'ð²—', + 'ð³˜' => 'ð²˜', + 'ð³™' => 'ð²™', + 'ð³š' => 'ð²š', + 'ð³›' => 'ð²›', + 'ð³œ' => 'ð²œ', + 'ð³' => 'ð²', + 'ð³ž' => 'ð²ž', + 'ð³Ÿ' => 'ð²Ÿ', + 'ð³ ' => 'ð² ', + 'ð³¡' => 'ð²¡', + 'ð³¢' => 'ð²¢', + 'ð³£' => 'ð²£', + 'ð³¤' => 'ð²¤', + 'ð³¥' => 'ð²¥', + 'ð³¦' => 'ð²¦', + 'ð³§' => 'ð²§', + 'ð³¨' => 'ð²¨', + 'ð³©' => 'ð²©', + 'ð³ª' => 'ð²ª', + 'ð³«' => 'ð²«', + 'ð³¬' => 'ð²¬', + 'ð³­' => 'ð²­', + 'ð³®' => 'ð²®', + 'ð³¯' => 'ð²¯', + 'ð³°' => 'ð²°', + 'ð³±' => 'ð²±', + 'ð³²' => 'ð²²', 'ð‘£€' => 'ð‘¢ ', 'ð‘£' => '𑢡', '𑣂' => 'ð‘¢¢', @@ -1101,4 +1345,145 @@ 'ð‘£' => 'ð‘¢½', '𑣞' => 'ð‘¢¾', '𑣟' => '𑢿', + 'ð–¹ ' => 'ð–¹€', + '𖹡' => 'ð–¹', + 'ð–¹¢' => '𖹂', + 'ð–¹£' => '𖹃', + '𖹤' => '𖹄', + 'ð–¹¥' => 'ð–¹…', + '𖹦' => '𖹆', + 'ð–¹§' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + 'ð–¹­' => 'ð–¹', + 'ð–¹®' => '𖹎', + '𖹯' => 'ð–¹', + 'ð–¹°' => 'ð–¹', + 'ð–¹±' => '𖹑', + 'ð–¹²' => 'ð–¹’', + 'ð–¹³' => '𖹓', + 'ð–¹´' => 'ð–¹”', + 'ð–¹µ' => '𖹕', + 'ð–¹¶' => 'ð–¹–', + 'ð–¹·' => 'ð–¹—', + '𖹸' => '𖹘', + 'ð–¹¹' => 'ð–¹™', + '𖹺' => '𖹚', + 'ð–¹»' => 'ð–¹›', + 'ð–¹¼' => '𖹜', + 'ð–¹½' => 'ð–¹', + 'ð–¹¾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => 'ðž¤', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => 'ðž¤', + '𞤰' => '𞤎', + '𞤱' => 'ðž¤', + '𞤲' => 'ðž¤', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => 'ðž¤', + '𞥀' => '𞤞', + 'ðž¥' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'ï¬' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'Ö‡' => 'ÔµÕ’', + 'ﬓ' => 'Õ„Õ†', + 'ﬔ' => 'Õ„Ôµ', + 'ﬕ' => 'Õ„Ô»', + 'ﬖ' => 'ÕŽÕ†', + 'ﬗ' => 'Õ„Ô½', + 'ʼn' => 'ʼN', + 'Î' => 'ΪÌ', + 'ΰ' => 'ΫÌ', + 'ǰ' => 'JÌŒ', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'WÌŠ', + 'ẙ' => 'YÌŠ', + 'ẚ' => 'Aʾ', + 'á½' => 'Υ̓', + 'á½’' => 'Υ̓̀', + 'á½”' => 'Υ̓Ì', + 'á½–' => 'Υ̓͂', + 'á¾¶' => 'Α͂', + 'ῆ' => 'Η͂', + 'á¿’' => 'Ϊ̀', + 'á¿“' => 'ΪÌ', + 'á¿–' => 'Ι͂', + 'á¿—' => 'Ϊ͂', + 'á¿¢' => 'Ϋ̀', + 'á¿£' => 'ΫÌ', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'á¿§' => 'Ϋ͂', + 'á¿¶' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'á¾' => 'á¼Î™', + 'ᾎ' => 'ἎΙ', + 'á¾' => 'á¼Î™', + 'ᾘ' => 'ἨΙ', + 'á¾™' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'á¾›' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'á¾' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'á¾­' => 'ὭΙ', + 'á¾®' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'á¾¼' => 'ΑΙ', + 'ῌ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'á¾²' => 'ᾺΙ', + 'á¾´' => 'ΆΙ', + 'á¿‚' => 'ῊΙ', + 'á¿„' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'á¿´' => 'ÎΙ', + 'á¾·' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'á¿·' => 'Ω͂Ι', ); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php index 8c8225c524..ff51ae0796 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -11,54 +11,162 @@ use Symfony\Polyfill\Mbstring as p; -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); - define('MB_CASE_LOWER', 1); - define('MB_CASE_TITLE', 2); +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; } -if (!function_exists('mb_strlen')) { - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } - function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } - function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } } -if (!function_exists('mb_chr')) { - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } } +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} if (!function_exists('mb_str_split')) { - function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); } + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); } diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 0000000000..5236e6dcc1 --- /dev/null +++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,167 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 02b8896f74..daa07f86b0 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,11 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.2", + "ext-iconv": "*" + }, + "provide": { + "ext-mbstring": "*" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, @@ -27,8 +31,9 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } } } diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php deleted file mode 100644 index d531e8441b..0000000000 --- a/vendor/symfony/polyfill-php72/Php72.php +++ /dev/null @@ -1,216 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php72; - -/** - * @author Nicolas Grekas <p@tchwork.com> - * @author Dariusz RumiÅ„ski <dariusz.ruminski@gmail.com> - * - * @internal - */ -final class Php72 -{ - private static $hashMask; - - public static function utf8_encode($s) - { - $s .= $s; - $len = \strlen($s); - - for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { - switch (true) { - case $s[$i] < "\x80": $s[$j] = $s[$i]; break; - case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; - default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; - } - } - - return substr($s, 0, $j); - } - - public static function utf8_decode($s) - { - $s = (string) $s; - $len = \strlen($s); - - for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { - switch ($s[$i] & "\xF0") { - case "\xC0": - case "\xD0": - $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); - $s[$j] = $c < 256 ? \chr($c) : '?'; - break; - - case "\xF0": - ++$i; - // no break - - case "\xE0": - $s[$j] = '?'; - $i += 2; - break; - - default: - $s[$j] = $s[$i]; - } - } - - return substr($s, 0, $j); - } - - public static function php_os_family() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return 'Windows'; - } - - $map = array( - 'Darwin' => 'Darwin', - 'DragonFly' => 'BSD', - 'FreeBSD' => 'BSD', - 'NetBSD' => 'BSD', - 'OpenBSD' => 'BSD', - 'Linux' => 'Linux', - 'SunOS' => 'Solaris', - ); - - return isset($map[PHP_OS]) ? $map[PHP_OS] : 'Unknown'; - } - - public static function spl_object_id($object) - { - if (null === self::$hashMask) { - self::initHashMask(); - } - if (null === $hash = spl_object_hash($object)) { - return; - } - - return self::$hashMask ^ hexdec(substr($hash, 16 - \PHP_INT_SIZE, \PHP_INT_SIZE)); - } - - public static function sapi_windows_vt100_support($stream, $enable = null) - { - if (!\is_resource($stream)) { - trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING); - - return false; - } - - $meta = stream_get_meta_data($stream); - - if ('STDIO' !== $meta['stream_type']) { - trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', E_USER_WARNING); - - return false; - } - - // We cannot actually disable vt100 support if it is set - if (false === $enable || !self::stream_isatty($stream)) { - return false; - } - - // The native function does not apply to stdin - $meta = array_map('strtolower', $meta); - $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; - - return !$stdin - && (false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM')); - } - - public static function stream_isatty($stream) - { - if (!\is_resource($stream)) { - trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING); - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $stat = @fstat($stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return \function_exists('posix_isatty') && @posix_isatty($stream); - } - - private static function initHashMask() - { - $obj = (object) array(); - self::$hashMask = -1; - - // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below - $obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush'); - foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { - if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { - $frame['line'] = 0; - break; - } - } - if (!empty($frame['line'])) { - ob_start(); - debug_zval_dump($obj); - self::$hashMask = (int) substr(ob_get_clean(), 17); - } - - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - \PHP_INT_SIZE, \PHP_INT_SIZE)); - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if (null == $encoding) { - $s = mb_convert_encoding($s, 'UTF-8'); - } elseif ('UTF-8' !== $encoding) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } -} diff --git a/vendor/symfony/polyfill-php72/README.md b/vendor/symfony/polyfill-php72/README.md deleted file mode 100644 index 8ac181e43e..0000000000 --- a/vendor/symfony/polyfill-php72/README.md +++ /dev/null @@ -1,27 +0,0 @@ -Symfony Polyfill / Php72 -======================== - -This component provides functions added to PHP 7.2 core: - -- [`spl_object_id`](https://php.net/spl_object_id) -- [`stream_isatty`](https://php.net/stream_isatty) - -On Windows only: - -- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) - -Moved to core since 7.2 (was in the optional XML extension earlier): - -- [`utf8_encode`](https://php.net/utf8_encode) -- [`utf8_decode`](https://php.net/utf8_decode) - -Also, it provides a constant added to PHP 7.2: -- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php72/bootstrap.php b/vendor/symfony/polyfill-php72/bootstrap.php deleted file mode 100644 index 519056de4a..0000000000 --- a/vendor/symfony/polyfill-php72/bootstrap.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php72 as p; - -if (PHP_VERSION_ID < 70200) { - if ('\\' === DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { - function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } - } - if (!function_exists('stream_isatty')) { - function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } - } - if (!function_exists('utf8_encode')) { - function utf8_encode($s) { return p\Php72::utf8_encode($s); } - function utf8_decode($s) { return p\Php72::utf8_decode($s); } - } - if (!function_exists('spl_object_id')) { - function spl_object_id($s) { return p\Php72::spl_object_id($s); } - } - if (!defined('PHP_OS_FAMILY')) { - define('PHP_OS_FAMILY', p\Php72::php_os_family()); - } - if (!function_exists('mb_chr')) { - function mb_ord($s, $enc = null) { return p\Php72::mb_ord($s, $enc); } - function mb_chr($code, $enc = null) { return p\Php72::mb_chr($code, $enc); } - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } - } -} diff --git a/vendor/php-http/message-factory/LICENSE b/vendor/symfony/polyfill-php80/LICENSE similarity index 95% rename from vendor/php-http/message-factory/LICENSE rename to vendor/symfony/polyfill-php80/LICENSE index 8e2c4a0b85..0ed3a24655 100644 --- a/vendor/php-http/message-factory/LICENSE +++ b/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 PHP HTTP Team <team@php-http.org> +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 0000000000..362dd1a959 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,115 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan <ion.bazan@gmail.com> + * @author Nico Oelgart <nicoswd@gmail.com> + * @author Nicolas Grekas <p@tchwork.com> + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 0000000000..cd78c4ccc6 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,106 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton <info@ensostudio.ru> + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var -1|positive-int + */ + public $line; + + /** + * @var int + */ + public $pos; + + /** + * @param -1|positive-int $line + */ + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return list<static> + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md new file mode 100644 index 0000000000..3816c559d5 --- /dev/null +++ b/vendor/symfony/polyfill-php80/README.md @@ -0,0 +1,25 @@ +Symfony Polyfill / Php80 +======================== + +This component provides features added to PHP 8.0 core: + +- [`Stringable`](https://php.net/stringable) interface +- [`fdiv`](https://php.net/fdiv) +- [`ValueError`](https://php.net/valueerror) class +- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class +- `FILTER_VALIDATE_BOOL` constant +- [`get_debug_type`](https://php.net/get_debug_type) +- [`PhpToken`](https://php.net/phptoken) class +- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) +- [`str_contains`](https://php.net/str_contains) +- [`str_starts_with`](https://php.net/str_starts_with) +- [`str_ends_with`](https://php.net/str_ends_with) +- [`get_resource_id`](https://php.net/get_resource_id) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 0000000000..2b955423fc --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,31 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 0000000000..bd1212f6e4 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class PhpToken extends Symfony\Polyfill\Php80\PhpToken + { + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 0000000000..7c62d7508b --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 0000000000..01c6c6c8ab --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 0000000000..783dbc28c7 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class ValueError extends Error + { + } +} diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php new file mode 100644 index 0000000000..e5f7dbc1a4 --- /dev/null +++ b/vendor/symfony/polyfill-php80/bootstrap.php @@ -0,0 +1,42 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/polyfill-php80/composer.json similarity index 53% rename from vendor/symfony/polyfill-php72/composer.json rename to vendor/symfony/polyfill-php80/composer.json index 27901f2a37..a503b039ad 100644 --- a/vendor/symfony/polyfill-php72/composer.json +++ b/vendor/symfony/polyfill-php80/composer.json @@ -1,11 +1,15 @@ { - "name": "symfony/polyfill-php72", + "name": "symfony/polyfill-php80", "type": "library", - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "keywords": ["polyfill", "shim", "compatibility", "portable"], "homepage": "https://symfony.com", "license": "MIT", "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -16,16 +20,18 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, - "files": [ "bootstrap.php" ] + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-master": "1.15-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } } } diff --git a/vendor/wp-statistics/pchart/.editorconfig b/vendor/wp-statistics/pchart/.editorconfig new file mode 100644 index 0000000000..6e6af837e6 --- /dev/null +++ b/vendor/wp-statistics/pchart/.editorconfig @@ -0,0 +1,748 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 990 +tab_width = 4 +ij_continuation_indent_size = 8 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = false +ij_smart_tabs = false +ij_visual_guides = none +ij_wrap_on_typing = false + +[*.blade.php] +ij_blade_keep_indents_on_empty_lines = false + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.feature] +indent_size = 2 +ij_gherkin_keep_indents_on_empty_lines = false + +[*.haml] +indent_size = 2 +ij_haml_keep_indents_on_empty_lines = false + +[*.sass] +indent_size = 2 +ij_sass_align_closing_brace_with_properties = false +ij_sass_blank_lines_around_nested_selector = 1 +ij_sass_blank_lines_between_blocks = 1 +ij_sass_brace_placement = 0 +ij_sass_enforce_quotes_on_format = false +ij_sass_hex_color_long_format = false +ij_sass_hex_color_lower_case = false +ij_sass_hex_color_short_format = false +ij_sass_hex_color_upper_case = false +ij_sass_keep_blank_lines_in_code = 2 +ij_sass_keep_indents_on_empty_lines = false +ij_sass_keep_single_line_blocks = false +ij_sass_line_comment_add_space = false +ij_sass_line_comment_at_first_column = false +ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_sass_space_after_colon = true +ij_sass_space_before_opening_brace = true +ij_sass_use_double_quotes = true +ij_sass_value_alignment = 0 + +[*.scss] +indent_size = 2 +ij_scss_align_closing_brace_with_properties = false +ij_scss_blank_lines_around_nested_selector = 1 +ij_scss_blank_lines_between_blocks = 1 +ij_scss_block_comment_add_space = false +ij_scss_brace_placement = 0 +ij_scss_enforce_quotes_on_format = false +ij_scss_hex_color_long_format = false +ij_scss_hex_color_lower_case = false +ij_scss_hex_color_short_format = false +ij_scss_hex_color_upper_case = false +ij_scss_keep_blank_lines_in_code = 2 +ij_scss_keep_indents_on_empty_lines = false +ij_scss_keep_single_line_blocks = false +ij_scss_line_comment_add_space = false +ij_scss_line_comment_at_first_column = false +ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow +ij_scss_space_after_colon = true +ij_scss_space_before_opening_brace = true +ij_scss_use_double_quotes = true +ij_scss_value_alignment = 0 + +[*.twig] +ij_twig_keep_indents_on_empty_lines = false +ij_twig_spaces_inside_comments_delimiters = true +ij_twig_spaces_inside_delimiters = true +ij_twig_spaces_inside_variable_delimiters = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = false +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ant,*.fxml,*.jhm,*.jnlp,*.jrxml,*.rng,*.tld,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,phpunit.xml.dist}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = normal +ij_xml_block_comment_add_space = false +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = false +ij_xml_text_wrap = normal + +[{*.ats,*.cts,*.mts,*.ts}] +ij_continuation_indent_size = 4 +ij_typescript_align_imports = false +ij_typescript_align_multiline_array_initializer_expression = false +ij_typescript_align_multiline_binary_operation = false +ij_typescript_align_multiline_chained_methods = false +ij_typescript_align_multiline_extends_list = false +ij_typescript_align_multiline_for = true +ij_typescript_align_multiline_parameters = true +ij_typescript_align_multiline_parameters_in_calls = false +ij_typescript_align_multiline_ternary_operation = false +ij_typescript_align_object_properties = 0 +ij_typescript_align_union_types = false +ij_typescript_align_var_statements = 0 +ij_typescript_array_initializer_new_line_after_left_brace = false +ij_typescript_array_initializer_right_brace_on_new_line = false +ij_typescript_array_initializer_wrap = off +ij_typescript_assignment_wrap = off +ij_typescript_binary_operation_sign_on_next_line = false +ij_typescript_binary_operation_wrap = off +ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_typescript_blank_lines_after_imports = 1 +ij_typescript_blank_lines_around_class = 1 +ij_typescript_blank_lines_around_field = 0 +ij_typescript_blank_lines_around_field_in_interface = 0 +ij_typescript_blank_lines_around_function = 1 +ij_typescript_blank_lines_around_method = 1 +ij_typescript_blank_lines_around_method_in_interface = 1 +ij_typescript_block_brace_style = end_of_line +ij_typescript_block_comment_add_space = false +ij_typescript_block_comment_at_first_column = true +ij_typescript_call_parameters_new_line_after_left_paren = false +ij_typescript_call_parameters_right_paren_on_new_line = false +ij_typescript_call_parameters_wrap = off +ij_typescript_catch_on_new_line = false +ij_typescript_chained_call_dot_on_new_line = true +ij_typescript_class_brace_style = end_of_line +ij_typescript_comma_on_new_line = false +ij_typescript_do_while_brace_force = never +ij_typescript_else_on_new_line = false +ij_typescript_enforce_trailing_comma = keep +ij_typescript_enum_constants_wrap = on_every_item +ij_typescript_extends_keyword_wrap = off +ij_typescript_extends_list_wrap = off +ij_typescript_field_prefix = _ +ij_typescript_file_name_style = relaxed +ij_typescript_finally_on_new_line = false +ij_typescript_for_brace_force = never +ij_typescript_for_statement_new_line_after_left_paren = false +ij_typescript_for_statement_right_paren_on_new_line = false +ij_typescript_for_statement_wrap = off +ij_typescript_force_quote_style = false +ij_typescript_force_semicolon_style = false +ij_typescript_function_expression_brace_style = end_of_line +ij_typescript_if_brace_force = never +ij_typescript_import_merge_members = global +ij_typescript_import_prefer_absolute_path = global +ij_typescript_import_sort_members = true +ij_typescript_import_sort_module_name = false +ij_typescript_import_use_node_resolution = true +ij_typescript_imports_wrap = on_every_item +ij_typescript_indent_case_from_switch = true +ij_typescript_indent_chained_calls = true +ij_typescript_indent_package_children = 0 +ij_typescript_jsdoc_include_types = false +ij_typescript_jsx_attribute_value = braces +ij_typescript_keep_blank_lines_in_code = 2 +ij_typescript_keep_first_column_comment = true +ij_typescript_keep_indents_on_empty_lines = false +ij_typescript_keep_line_breaks = true +ij_typescript_keep_simple_blocks_in_one_line = false +ij_typescript_keep_simple_methods_in_one_line = false +ij_typescript_line_comment_add_space = true +ij_typescript_line_comment_at_first_column = false +ij_typescript_method_brace_style = end_of_line +ij_typescript_method_call_chain_wrap = off +ij_typescript_method_parameters_new_line_after_left_paren = false +ij_typescript_method_parameters_right_paren_on_new_line = false +ij_typescript_method_parameters_wrap = off +ij_typescript_object_literal_wrap = on_every_item +ij_typescript_parentheses_expression_new_line_after_left_paren = false +ij_typescript_parentheses_expression_right_paren_on_new_line = false +ij_typescript_place_assignment_sign_on_next_line = false +ij_typescript_prefer_as_type_cast = false +ij_typescript_prefer_explicit_types_function_expression_returns = false +ij_typescript_prefer_explicit_types_function_returns = false +ij_typescript_prefer_explicit_types_vars_fields = false +ij_typescript_prefer_parameters_wrap = false +ij_typescript_reformat_c_style_comments = false +ij_typescript_space_after_colon = true +ij_typescript_space_after_comma = true +ij_typescript_space_after_dots_in_rest_parameter = false +ij_typescript_space_after_generator_mult = true +ij_typescript_space_after_property_colon = true +ij_typescript_space_after_quest = true +ij_typescript_space_after_type_colon = true +ij_typescript_space_after_unary_not = false +ij_typescript_space_before_async_arrow_lparen = true +ij_typescript_space_before_catch_keyword = true +ij_typescript_space_before_catch_left_brace = true +ij_typescript_space_before_catch_parentheses = true +ij_typescript_space_before_class_lbrace = true +ij_typescript_space_before_class_left_brace = true +ij_typescript_space_before_colon = true +ij_typescript_space_before_comma = false +ij_typescript_space_before_do_left_brace = true +ij_typescript_space_before_else_keyword = true +ij_typescript_space_before_else_left_brace = true +ij_typescript_space_before_finally_keyword = true +ij_typescript_space_before_finally_left_brace = true +ij_typescript_space_before_for_left_brace = true +ij_typescript_space_before_for_parentheses = true +ij_typescript_space_before_for_semicolon = false +ij_typescript_space_before_function_left_parenth = true +ij_typescript_space_before_generator_mult = false +ij_typescript_space_before_if_left_brace = true +ij_typescript_space_before_if_parentheses = true +ij_typescript_space_before_method_call_parentheses = false +ij_typescript_space_before_method_left_brace = true +ij_typescript_space_before_method_parentheses = false +ij_typescript_space_before_property_colon = false +ij_typescript_space_before_quest = true +ij_typescript_space_before_switch_left_brace = true +ij_typescript_space_before_switch_parentheses = true +ij_typescript_space_before_try_left_brace = true +ij_typescript_space_before_type_colon = false +ij_typescript_space_before_unary_not = false +ij_typescript_space_before_while_keyword = true +ij_typescript_space_before_while_left_brace = true +ij_typescript_space_before_while_parentheses = true +ij_typescript_spaces_around_additive_operators = true +ij_typescript_spaces_around_arrow_function_operator = true +ij_typescript_spaces_around_assignment_operators = true +ij_typescript_spaces_around_bitwise_operators = true +ij_typescript_spaces_around_equality_operators = true +ij_typescript_spaces_around_logical_operators = true +ij_typescript_spaces_around_multiplicative_operators = true +ij_typescript_spaces_around_relational_operators = true +ij_typescript_spaces_around_shift_operators = true +ij_typescript_spaces_around_unary_operator = false +ij_typescript_spaces_within_array_initializer_brackets = false +ij_typescript_spaces_within_brackets = false +ij_typescript_spaces_within_catch_parentheses = false +ij_typescript_spaces_within_for_parentheses = false +ij_typescript_spaces_within_if_parentheses = false +ij_typescript_spaces_within_imports = false +ij_typescript_spaces_within_interpolation_expressions = false +ij_typescript_spaces_within_method_call_parentheses = false +ij_typescript_spaces_within_method_parentheses = false +ij_typescript_spaces_within_object_literal_braces = false +ij_typescript_spaces_within_object_type_braces = true +ij_typescript_spaces_within_parentheses = false +ij_typescript_spaces_within_switch_parentheses = false +ij_typescript_spaces_within_type_assertion = false +ij_typescript_spaces_within_union_types = true +ij_typescript_spaces_within_while_parentheses = false +ij_typescript_special_else_if_treatment = true +ij_typescript_ternary_operation_signs_on_next_line = false +ij_typescript_ternary_operation_wrap = off +ij_typescript_union_types_wrap = on_every_item +ij_typescript_use_chained_calls_group_indents = false +ij_typescript_use_double_quotes = true +ij_typescript_use_explicit_js_extension = auto +ij_typescript_use_path_mapping = always +ij_typescript_use_public_modifier = false +ij_typescript_use_semicolon_after_statement = true +ij_typescript_var_declaration_wrap = normal +ij_typescript_while_brace_force = never +ij_typescript_while_on_new_line = false +ij_typescript_wrap_comments = false + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = false +ij_javascript_align_multiline_array_initializer_expression = false +ij_javascript_align_multiline_binary_operation = false +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = false +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = false +ij_javascript_align_multiline_ternary_operation = false +ij_javascript_align_object_properties = 0 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 0 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = off +ij_javascript_assignment_wrap = off +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = off +ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = end_of_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = off +ij_javascript_catch_on_new_line = false +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = end_of_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = never +ij_javascript_else_on_new_line = false +ij_javascript_enforce_trailing_comma = keep +ij_javascript_extends_keyword_wrap = off +ij_javascript_extends_list_wrap = off +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = false +ij_javascript_for_brace_force = never +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = off +ij_javascript_force_quote_style = false +ij_javascript_force_semicolon_style = false +ij_javascript_function_expression_brace_style = end_of_line +ij_javascript_if_brace_force = never +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = global +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = false +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = end_of_line +ij_javascript_method_call_chain_wrap = off +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = off +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = false +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_reformat_c_style_comments = false +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = true +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = true +ij_javascript_space_before_catch_parentheses = true +ij_javascript_space_before_class_lbrace = true +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = true +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = true +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = true +ij_javascript_space_before_for_left_brace = true +ij_javascript_space_before_for_parentheses = true +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = true +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = true +ij_javascript_space_before_if_parentheses = true +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = true +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = true +ij_javascript_space_before_switch_parentheses = true +ij_javascript_space_before_try_left_brace = true +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = true +ij_javascript_space_before_while_parentheses = true +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = off +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = false +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = never +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.ctp,*.hphp,*.inc,*.module,*.php,*.php4,*.php5,*.phtml}] +ij_continuation_indent_size = 4 +ij_php_align_assignments = true +ij_php_align_class_constants = true +ij_php_align_group_field_declarations = false +ij_php_align_inline_comments = false +ij_php_align_key_value_pairs = true +ij_php_align_match_arm_bodies = false +ij_php_align_multiline_array_initializer_expression = false +ij_php_align_multiline_binary_operation = false +ij_php_align_multiline_chained_methods = false +ij_php_align_multiline_extends_list = false +ij_php_align_multiline_for = true +ij_php_align_multiline_parameters = true +ij_php_align_multiline_parameters_in_calls = false +ij_php_align_multiline_ternary_operation = false +ij_php_align_named_arguments = false +ij_php_align_phpdoc_comments = false +ij_php_align_phpdoc_param_names = false +ij_php_anonymous_brace_style = end_of_line +ij_php_api_weight = 28 +ij_php_array_initializer_new_line_after_left_brace = false +ij_php_array_initializer_right_brace_on_new_line = false +ij_php_array_initializer_wrap = off +ij_php_assignment_wrap = off +ij_php_attributes_wrap = off +ij_php_author_weight = 28 +ij_php_binary_operation_sign_on_next_line = false +ij_php_binary_operation_wrap = off +ij_php_blank_lines_after_class_header = 0 +ij_php_blank_lines_after_function = 1 +ij_php_blank_lines_after_imports = 1 +ij_php_blank_lines_after_opening_tag = 0 +ij_php_blank_lines_after_package = 0 +ij_php_blank_lines_around_class = 1 +ij_php_blank_lines_around_constants = 0 +ij_php_blank_lines_around_field = 0 +ij_php_blank_lines_around_method = 1 +ij_php_blank_lines_before_class_end = 0 +ij_php_blank_lines_before_imports = 1 +ij_php_blank_lines_before_method_body = 0 +ij_php_blank_lines_before_package = 1 +ij_php_blank_lines_before_return_statement = 0 +ij_php_blank_lines_between_imports = 0 +ij_php_block_brace_style = end_of_line +ij_php_call_parameters_new_line_after_left_paren = false +ij_php_call_parameters_right_paren_on_new_line = false +ij_php_call_parameters_wrap = off +ij_php_catch_on_new_line = false +ij_php_category_weight = 28 +ij_php_class_brace_style = next_line +ij_php_comma_after_last_argument = false +ij_php_comma_after_last_array_element = false +ij_php_comma_after_last_closure_use_var = false +ij_php_comma_after_last_parameter = false +ij_php_concat_spaces = true +ij_php_copyright_weight = 28 +ij_php_deprecated_weight = 28 +ij_php_do_while_brace_force = never +ij_php_else_if_style = as_is +ij_php_else_on_new_line = false +ij_php_example_weight = 28 +ij_php_extends_keyword_wrap = off +ij_php_extends_list_wrap = off +ij_php_fields_default_visibility = private +ij_php_filesource_weight = 28 +ij_php_finally_on_new_line = false +ij_php_for_brace_force = never +ij_php_for_statement_new_line_after_left_paren = false +ij_php_for_statement_right_paren_on_new_line = false +ij_php_for_statement_wrap = off +ij_php_force_empty_methods_in_one_line = false +ij_php_force_short_declaration_array_style = false +ij_php_getters_setters_naming_style = camel_case +ij_php_getters_setters_order_style = getters_first +ij_php_global_weight = 28 +ij_php_group_use_wrap = on_every_item +ij_php_if_brace_force = never +ij_php_if_lparen_on_next_line = false +ij_php_if_rparen_on_next_line = false +ij_php_ignore_weight = 28 +ij_php_import_sorting = alphabetic +ij_php_indent_break_from_case = true +ij_php_indent_case_from_switch = true +ij_php_indent_code_in_php_tags = false +ij_php_internal_weight = 28 +ij_php_keep_blank_lines_after_lbrace = 2 +ij_php_keep_blank_lines_before_right_brace = 2 +ij_php_keep_blank_lines_in_code = 2 +ij_php_keep_blank_lines_in_declarations = 2 +ij_php_keep_control_statement_in_one_line = true +ij_php_keep_first_column_comment = true +ij_php_keep_indents_on_empty_lines = false +ij_php_keep_line_breaks = true +ij_php_keep_rparen_and_lbrace_on_one_line = false +ij_php_keep_simple_classes_in_one_line = false +ij_php_keep_simple_methods_in_one_line = false +ij_php_lambda_brace_style = end_of_line +ij_php_license_weight = 28 +ij_php_line_comment_add_space = false +ij_php_line_comment_at_first_column = true +ij_php_link_weight = 28 +ij_php_lower_case_boolean_const = false +ij_php_lower_case_keywords = true +ij_php_lower_case_null_const = false +ij_php_method_brace_style = next_line +ij_php_method_call_chain_wrap = off +ij_php_method_parameters_new_line_after_left_paren = false +ij_php_method_parameters_right_paren_on_new_line = false +ij_php_method_parameters_wrap = off +ij_php_method_weight = 28 +ij_php_modifier_list_wrap = false +ij_php_multiline_chained_calls_semicolon_on_new_line = false +ij_php_namespace_brace_style = 1 +ij_php_new_line_after_php_opening_tag = false +ij_php_null_type_position = in_the_end +ij_php_package_weight = 28 +ij_php_param_weight = 0 +ij_php_parameters_attributes_wrap = off +ij_php_parentheses_expression_new_line_after_left_paren = false +ij_php_parentheses_expression_right_paren_on_new_line = false +ij_php_phpdoc_blank_line_before_tags = false +ij_php_phpdoc_blank_lines_around_parameters = false +ij_php_phpdoc_keep_blank_lines = true +ij_php_phpdoc_param_spaces_between_name_and_description = 1 +ij_php_phpdoc_param_spaces_between_tag_and_type = 1 +ij_php_phpdoc_param_spaces_between_type_and_name = 1 +ij_php_phpdoc_use_fqcn = false +ij_php_phpdoc_wrap_long_lines = false +ij_php_place_assignment_sign_on_next_line = false +ij_php_place_parens_for_constructor = 0 +ij_php_property_read_weight = 28 +ij_php_property_weight = 28 +ij_php_property_write_weight = 28 +ij_php_return_type_on_new_line = false +ij_php_return_weight = 1 +ij_php_see_weight = 28 +ij_php_since_weight = 28 +ij_php_sort_phpdoc_elements = true +ij_php_space_after_colon = true +ij_php_space_after_colon_in_enum_backed_type = true +ij_php_space_after_colon_in_named_argument = true +ij_php_space_after_colon_in_return_type = true +ij_php_space_after_comma = true +ij_php_space_after_for_semicolon = true +ij_php_space_after_quest = true +ij_php_space_after_type_cast = false +ij_php_space_after_unary_not = false +ij_php_space_before_array_initializer_left_brace = false +ij_php_space_before_catch_keyword = true +ij_php_space_before_catch_left_brace = true +ij_php_space_before_catch_parentheses = true +ij_php_space_before_class_left_brace = true +ij_php_space_before_closure_left_parenthesis = true +ij_php_space_before_colon = true +ij_php_space_before_colon_in_enum_backed_type = false +ij_php_space_before_colon_in_named_argument = false +ij_php_space_before_colon_in_return_type = false +ij_php_space_before_comma = false +ij_php_space_before_do_left_brace = true +ij_php_space_before_else_keyword = true +ij_php_space_before_else_left_brace = true +ij_php_space_before_finally_keyword = true +ij_php_space_before_finally_left_brace = true +ij_php_space_before_for_left_brace = true +ij_php_space_before_for_parentheses = true +ij_php_space_before_for_semicolon = false +ij_php_space_before_if_left_brace = true +ij_php_space_before_if_parentheses = true +ij_php_space_before_method_call_parentheses = false +ij_php_space_before_method_left_brace = true +ij_php_space_before_method_parentheses = false +ij_php_space_before_quest = true +ij_php_space_before_short_closure_left_parenthesis = false +ij_php_space_before_switch_left_brace = true +ij_php_space_before_switch_parentheses = true +ij_php_space_before_try_left_brace = true +ij_php_space_before_unary_not = false +ij_php_space_before_while_keyword = true +ij_php_space_before_while_left_brace = true +ij_php_space_before_while_parentheses = true +ij_php_space_between_ternary_quest_and_colon = false +ij_php_spaces_around_additive_operators = true +ij_php_spaces_around_arrow = false +ij_php_spaces_around_assignment_in_declare = false +ij_php_spaces_around_assignment_operators = true +ij_php_spaces_around_bitwise_operators = true +ij_php_spaces_around_equality_operators = true +ij_php_spaces_around_logical_operators = true +ij_php_spaces_around_multiplicative_operators = true +ij_php_spaces_around_null_coalesce_operator = true +ij_php_spaces_around_pipe_in_union_type = false +ij_php_spaces_around_relational_operators = true +ij_php_spaces_around_shift_operators = true +ij_php_spaces_around_unary_operator = false +ij_php_spaces_around_var_within_brackets = false +ij_php_spaces_within_array_initializer_braces = false +ij_php_spaces_within_brackets = false +ij_php_spaces_within_catch_parentheses = false +ij_php_spaces_within_for_parentheses = false +ij_php_spaces_within_if_parentheses = false +ij_php_spaces_within_method_call_parentheses = false +ij_php_spaces_within_method_parentheses = false +ij_php_spaces_within_parentheses = false +ij_php_spaces_within_short_echo_tags = true +ij_php_spaces_within_switch_parentheses = false +ij_php_spaces_within_while_parentheses = false +ij_php_special_else_if_treatment = false +ij_php_subpackage_weight = 28 +ij_php_ternary_operation_signs_on_next_line = false +ij_php_ternary_operation_wrap = off +ij_php_throws_weight = 2 +ij_php_todo_weight = 28 +ij_php_treat_multiline_arrays_and_lambdas_multiline = false +ij_php_unknown_tag_weight = 28 +ij_php_upper_case_boolean_const = false +ij_php_upper_case_null_const = false +ij_php_uses_weight = 28 +ij_php_var_weight = 28 +ij_php_variable_naming_style = mixed +ij_php_version_weight = 28 +ij_php_while_brace_force = never +ij_php_while_on_new_line = false + +[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,composer.lock,jest.config}] +indent_size = 2 +ij_json_array_wrapping = split_into_lines +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_keep_trailing_comma = false +ij_json_object_wrapping = split_into_lines +ij_json_property_alignment = do_not_align +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = false +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = off +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p +ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = false +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span,pre,textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_insert_quote_arrows_on_wrap = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_keep_line_breaks_inside_text_blocks = true +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 +ij_markdown_wrap_text_if_long = true +ij_markdown_wrap_text_inside_blockquotes = true diff --git a/vendor/wp-statistics/pchart/.gitignore b/vendor/wp-statistics/pchart/.gitignore new file mode 100644 index 0000000000..a67d42b32f --- /dev/null +++ b/vendor/wp-statistics/pchart/.gitignore @@ -0,0 +1,6 @@ +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock diff --git a/vendor/paragonie/random_compat/LICENSE b/vendor/wp-statistics/pchart/LICENSE similarity index 93% rename from vendor/paragonie/random_compat/LICENSE rename to vendor/wp-statistics/pchart/LICENSE index 45c7017dfb..55d9d9bc3c 100644 --- a/vendor/paragonie/random_compat/LICENSE +++ b/vendor/wp-statistics/pchart/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2015 Paragon Initiative Enterprises +Copyright (c) 2018 WP Statistics Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/vendor/wp-statistics/pchart/README.md b/vendor/wp-statistics/pchart/README.md new file mode 100644 index 0000000000..3adc178797 --- /dev/null +++ b/vendor/wp-statistics/pchart/README.md @@ -0,0 +1,96 @@ +# pChart + +A PHP Class to build Charts + +pChart is a PHP class oriented framework designed to create aliased charts. Most of todays chart libraries have a cost, our project is intended to be free. Data can be retrieved from SQL queries, CSV files, or manually provided. This project is still under development and new features or fix are made every week. + +As the primary author of [pChart](http://www.pchart.net/) has not updated it since January 19th, 2014, we decided to update the library due to some out-of-date functions. + +[![Build Status](https://travis-ci.org/wp-statistics/pchart.svg?branch=master)](https://travis-ci.org/wp-statistics/pchart) +[![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%205.4-8892BF.svg)](https://php.net/) +[![Latest Stable Version](https://poser.pugx.org/wp-statistics/pchart/v/stable)](https://packagist.org/packages/wp-statistics/pchart) +[![Total Downloads](https://poser.pugx.org/wp-statistics/pchart/downloads)](https://packagist.org/packages/wp-statistics/pchart) +[![Latest Unstable Version](https://poser.pugx.org/wp-statistics/pchart/v/unstable)](https://packagist.org/packages/wp-statistics/pchart) +[![License](https://poser.pugx.org/wp-statistics/pchart/license)](https://packagist.org/packages/wp-statistics/pchart) + + +Installation +------------ + +The preferred way to install this extension is through [composer](http://getcomposer.org/download/). + +Either run + +``` +composer require wp-statistics/pchart +``` + +to the require section of your `composer.json` file. + + +Usage +----- + +Let's add into config in your main-local config file before return[] + +````php +<?php +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7)); +$DataSet->AddSerie(); +$DataSet->SetSerieName("Sample data", "Serie1"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->setGraphArea(40, 30, 680, 200); +$Test->drawGraphArea(252, 252, 252, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 70); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(45, 35, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "My pretty graph", 50, 50, 50, 585); +$Test->Render("Naked.png"); +```` + +Screenshots +------------ +The pChart charting library is providing many ways to reprensent a single or multiple series of data. We'll try to add screenshots everytime an interesting functionnality is added to the pChart library. +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example10.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example12.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example13.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example14.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example15.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example16.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example17.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example18.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example19.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example2.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example20.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example21.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example22.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example23.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example24.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example25.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example26.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example3.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example4.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example5.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example6.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example7.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example8.png "Logo Title Text 1") +![alt text](https://raw.githubusercontent.com/wp-statistics/pchart/master/src/Screenshots/example9.png "Logo Title Text 1") diff --git a/vendor/wp-statistics/pchart/composer.json b/vendor/wp-statistics/pchart/composer.json new file mode 100644 index 0000000000..cfc9c49244 --- /dev/null +++ b/vendor/wp-statistics/pchart/composer.json @@ -0,0 +1,21 @@ +{ + "name": "wp-statistics/pchart", + "description": "A PHP Class to build Charts", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Mostafa Soufi", + "email": "mostafa.soufi@hotmail.com" + } + ], + "minimum-stability": "stable", + "require": { + "php": ">=5.4.0" + }, + "autoload": { + "psr-0": { + "pChart": "src/" + } + } +} diff --git a/vendor/wp-statistics/pchart/composer.lock b/vendor/wp-statistics/pchart/composer.lock new file mode 100644 index 0000000000..73ef740ef1 --- /dev/null +++ b/vendor/wp-statistics/pchart/composer.lock @@ -0,0 +1,19 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d0b6356efc7f24f0740ac0c1a5a56cde", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.4.0" + }, + "platform-dev": [] +} diff --git a/vendor/wp-statistics/pchart/src/Example1.php b/vendor/wp-statistics/pchart/src/Example1.php new file mode 100644 index 0000000000..7f10d96ced --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example1.php @@ -0,0 +1,47 @@ +<?php +/* + Example1 : A simple line chart +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->ImportFromCSV("Sample/bulkdata.csv", ",", array(1, 2, 3), FALSE, 0); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetSerieName("March", "Serie3"); +$DataSet->SetYAxisName("Average age"); +$DataSet->SetYAxisUnit("�s"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(70, 30, 680, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(75, 35, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "example 1", 50, 50, 50, 585); +$Test->Render("example1.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example10.php b/vendor/wp-statistics/pchart/src/Example10.php new file mode 100644 index 0000000000..b6ed71ce4c --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example10.php @@ -0,0 +1,36 @@ +<?php +/* + Example10 : A 3D exploded pie graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(10, 2, 3, 5, 3), "Serie1"); +$DataSet->AddPoint(array("January", "February", "March", "April", "May"), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie2"); + +// Initialise the graph +$Test = new pChart(420, 250); +$Test->drawFilledRoundedRectangle(7, 7, 413, 243, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 415, 245, 5, 230, 230, 230); +$Test->createColorGradientPalette(195, 204, 56, 223, 110, 41, 5); + +// Draw the pie chart +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->AntialiasQuality = 0; +$Test->drawPieGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 180, 130, 110, PIE_PERCENTAGE_LABEL, FALSE, 50, 20, 5); +$Test->drawPieLegend(330, 15, $DataSet->GetData(), $DataSet->GetDataDescription(), 250, 250, 250); + +// Write the title +$Test->setFontProperties("Fonts/MankSans.ttf", 10); +$Test->drawTitle(10, 20, "Sales per month", 100, 100, 100); + +$Test->Render("example10.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example11.php b/vendor/wp-statistics/pchart/src/Example11.php new file mode 100644 index 0000000000..090fc02d8c --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example11.php @@ -0,0 +1,51 @@ +<?php +/* + Example11 : Using the pCache class +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Cache definition +$Cache = new pCache(); +$Cache->GetFromCache("Graph1", $DataSet->GetData()); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the cubic curve graph +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 1", 50, 50, 50, 585); + +// Render the graph +$Cache->WriteToCache("Graph1", $DataSet->GetData(), $Test); +$Test->Render("example1.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example12.php b/vendor/wp-statistics/pchart/src/Example12.php new file mode 100644 index 0000000000..262b5b3b0b --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example12.php @@ -0,0 +1,47 @@ +<?php +/* + Example12 : A true bar graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4), "Serie1"); +$DataSet->AddPoint(array(3, 3, -4, 1, -2, 2, 1, 0, -1, 6, 3), "Serie2"); +$DataSet->AddPoint(array(4, 1, 2, -1, -4, -2, 3, 2, 1, 2, 2), "Serie3"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetSerieName("March", "Serie3"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 680, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the bar graph +$Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE, 80); + + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(596, 150, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 12", 50, 50, 50, 585); +$Test->Render("example12.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example13.php b/vendor/wp-statistics/pchart/src/Example13.php new file mode 100644 index 0000000000..1c0c62effd --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example13.php @@ -0,0 +1,34 @@ +<?php +/* + Example13: A 2D exploded pie graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(10, 2, 3, 5, 3), "Serie1"); +$DataSet->AddPoint(array("Jan", "Feb", "Mar", "Apr", "May"), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie2"); + +// Initialise the graph +$Test = new pChart(300, 200); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawFilledRoundedRectangle(7, 7, 293, 193, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 295, 195, 5, 230, 230, 230); + +// Draw the pie chart +$Test->AntialiasQuality = 0; +$Test->setShadowProperties(2, 2, 200, 200, 200); +$Test->drawFlatPieGraphWithShadow($DataSet->GetData(), $DataSet->GetDataDescription(), 120, 100, 60, PIE_PERCENTAGE, 8); +$Test->clearShadow(); + +$Test->drawPieLegend(230, 15, $DataSet->GetData(), $DataSet->GetDataDescription(), 250, 250, 250); + +$Test->Render("example13.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example14.php b/vendor/wp-statistics/pchart/src/Example14.php new file mode 100644 index 0000000000..56b58ea05f --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example14.php @@ -0,0 +1,35 @@ +<?php +/* + Example14: A smooth flat pie graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(10, 2, 3, 5, 3), "Serie1"); +$DataSet->AddPoint(array("Jan", "Feb", "Mar", "Apr", "May"), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie2"); + +// Initialise the graph +$Test = new pChart(300, 200); +$Test->loadColorPalette("Sample/softtones.txt"); +$Test->drawFilledRoundedRectangle(7, 7, 293, 193, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 295, 195, 5, 230, 230, 230); + +// This will draw a shadow under the pie chart +$Test->drawFilledCircle(122, 102, 70, 200, 200, 200); + +// Draw the pie chart +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->AntialiasQuality = 0; +$Test->drawBasicPieGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 120, 100, 70, PIE_PERCENTAGE, 255, 255, 218); +$Test->drawPieLegend(230, 15, $DataSet->GetData(), $DataSet->GetDataDescription(), 250, 250, 250); + +$Test->Render("example14.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example15.php b/vendor/wp-statistics/pchart/src/Example15.php new file mode 100644 index 0000000000..5e466c1412 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example15.php @@ -0,0 +1,70 @@ +<?php +/* + Example15 : Playing with line style & pictures inclusion +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(10, 9.4, 7.7, 5, 1.7, -1.7, -5, -7.7, -9.4, -10, -9.4, -7.7, -5, -1.8, 1.7), "Serie1"); +$DataSet->AddPoint(array(0, 3.4, 6.4, 8.7, 9.8, 9.8, 8.7, 6.4, 3.4, 0, -3.4, -6.4, -8.6, -9.8, -9.9), "Serie2"); +$DataSet->AddPoint(array(7.1, 9.1, 10, 9.7, 8.2, 5.7, 2.6, -0.9, -4.2, -7.1, -9.1, -10, -9.7, -8.2, -5.8), "Serie3"); +$DataSet->AddPoint(array("Jan", "Jan", "Jan", "Feb", "Feb", "Feb", "Mar", "Mar", "Mar", "Apr", "Apr", "Apr", "May", "May", "May"), "Serie4"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie("Serie4"); +$DataSet->SetSerieName("Max Average", "Serie1"); +$DataSet->SetSerieName("Min Average", "Serie2"); +$DataSet->SetSerieName("Temperature", "Serie3"); +$DataSet->SetYAxisName("Temperature"); +$DataSet->SetXAxisName("Month of the year"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->reportWarnings("GD"); +$Test->setFixedScale(-12, 12, 5); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(65, 30, 570, 185); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE, 3); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the area +$DataSet->RemoveSerie("Serie4"); +$Test->drawArea($DataSet->GetData(), "Serie1", "Serie2", 239, 238, 227, 50); +$DataSet->RemoveSerie("Serie3"); +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Draw the line graph +$Test->setLineStyle(1, 6); +$DataSet->RemoveAllSeries(); +$DataSet->AddSerie("Serie3"); +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Write values on Serie3 +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie3"); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(590, 90, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "example 15", 50, 50, 50, 585); + +// Add an image +$Test->drawFromPNG("Sample/logo.png", 584, 35); + +// Render the chart +$Test->Render("example15.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example16.php b/vendor/wp-statistics/pchart/src/Example16.php new file mode 100644 index 0000000000..b15ab64574 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example16.php @@ -0,0 +1,44 @@ +<?php +/* + Example16 : Importing CSV data +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->ImportFromCSV("Sample/CO2.csv", ",", array(1, 2, 3, 4), TRUE, 0); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetYAxisName("CO2 concentrations"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->reportWarnings("GD"); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 30, 680, 180); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 90, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(70, 40, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "CO2 concentrations at Mauna Loa", 50, 50, 50, 585); +$Test->Render("example16.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example17.php b/vendor/wp-statistics/pchart/src/Example17.php new file mode 100644 index 0000000000..226e6d1259 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example17.php @@ -0,0 +1,50 @@ +<?php +/* + Example17 : Playing with axis +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(100, 320, 200, 10, 43), "Serie1"); +$DataSet->AddPoint(array(23, 432, 43, 153, 234), "Serie2"); +$DataSet->AddPoint(array(1217541600, 1217628000, 1217714400, 1217800800, 1217887200), "Serie3"); +$DataSet->AddSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("Incoming", "Serie1"); +$DataSet->SetSerieName("Outgoing", "Serie2"); +$DataSet->SetYAxisName("Call duration"); +$DataSet->SetYAxisFormat("time"); +$DataSet->SetXAxisFormat("date"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(85, 30, 650, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(90, 35, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "example 17", 50, 50, 50, 585); +$Test->Render("example17.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example18.php b/vendor/wp-statistics/pchart/src/Example18.php new file mode 100644 index 0000000000..cfd1ba8bef --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example18.php @@ -0,0 +1,57 @@ +<?php +/* + Example18 : Missing values +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(2, 5, 7, "", "", 5, 6, 4, 8, 4, "", 2, 5, 6, 4, 5, 6, 7, 6), "Serie1"); +$DataSet->AddPoint(array(-1, -3, -1, -2, -4, -1, "", -4, -5, -3, -2, -2, -3, -3, -5, -4, -3, -1, ""), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("Raw #1", "Serie1"); +$DataSet->SetSerieName("Raw #2", "Serie2"); +$DataSet->SetYAxisName("Response time"); +$DataSet->SetXAxisName("Sample #ID"); + +//print_r($DataSet->GetData()); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(55, 30, 585, 185); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the line graph +$DataSet->RemoveSerie("Serie2"); +$Test->drawFilledLineGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 60, TRUE); + +// Draw the curve graph +$DataSet->RemoveSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$Test->setShadowProperties(2, 2, 200, 200, 200, 50); +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); +$Test->clearShadow(); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 18", 50, 50, 50, 585); +$Test->Render("example18.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example19.php b/vendor/wp-statistics/pchart/src/Example19.php new file mode 100644 index 0000000000..abba5f269a --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example19.php @@ -0,0 +1,46 @@ +<?php +/* + Example19 : Error reporting +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(10, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, -5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 30), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetXAxisName("Samples"); +$DataSet->SetYAxisName("Temperature"); +$DataSet->SetSerieName("January", "Serie1"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->reportWarnings("GD"); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 30, 585, 185); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the cubic curve graph +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 19", 50, 50, 50, 585); +$Test->Render("example19.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example2.php b/vendor/wp-statistics/pchart/src/Example2.php new file mode 100644 index 0000000000..60fe320739 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example2.php @@ -0,0 +1,45 @@ +<?php +/* + Example2 : A cubic curve graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, 3, 4, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFixedScale(-2, 8); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the cubic curve graph +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 2", 50, 50, 50, 585); +$Test->Render("example2.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example20.php b/vendor/wp-statistics/pchart/src/Example20.php new file mode 100644 index 0000000000..c258c321d8 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example20.php @@ -0,0 +1,46 @@ +<?php +/* + Example20 : A stacked bar graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4), "Serie1"); +$DataSet->AddPoint(array(3, 3, -4, 1, -2, 2, 1, 0, -1, 6, 3), "Serie2"); +$DataSet->AddPoint(array(4, 1, 2, -1, -4, -2, 3, 2, 1, 2, 2), "Serie3"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetSerieName("March", "Serie3"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 680, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_ADDALL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the bar graph +$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 100); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(596, 150, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 20", 50, 50, 50, 585); +$Test->Render("example20.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example21.php b/vendor/wp-statistics/pchart/src/Example21.php new file mode 100644 index 0000000000..a676214fb8 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example21.php @@ -0,0 +1,55 @@ +<?php +/* + Example21 : Playing with background +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(9, 9, 9, 10, 10, 11, 12, 14, 16, 17, 18, 18, 19, 19, 18, 15, 12, 10, 9), "Serie1"); +$DataSet->AddPoint(array(10, 11, 11, 12, 12, 13, 14, 15, 17, 19, 22, 24, 23, 23, 22, 20, 18, 16, 14), "Serie2"); +$DataSet->AddPoint(array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22), "Serie3"); +$DataSet->AddAllSeries(); +$DataSet->RemoveSerie("Serie3"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetYAxisName("Temperature"); +$DataSet->SetYAxisUnit("�C"); +$DataSet->SetXAxisUnit("h"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->drawGraphAreaGradient(132, 153, 172, 50, TARGET_BACKGROUND); + +// Graph area setup +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 20, 585, 180); +$Test->drawGraphArea(213, 217, 221, FALSE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 2); +$Test->drawGraphAreaGradient(162, 183, 202, 50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 20); + +// Draw the line chart +$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4); +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->clearShadow(); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 4, 2, -1, -1, -1, TRUE); + +// Draw the legend +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(605, 142, $DataSet->GetDataDescription(), 236, 238, 240, 52, 58, 82); + +// Draw the title +$Title = "Average Temperatures during the first months of 2008 "; +$Test->drawTextBox(0, 210, 700, 230, $Title, 0, 255, 255, 255, ALIGN_RIGHT, TRUE, 0, 0, 0, 30); + +// Render the picture +$Test->addBorder(2); +$Test->Render("example21.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example22.php b/vendor/wp-statistics/pchart/src/Example22.php new file mode 100644 index 0000000000..5abd7d5976 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example22.php @@ -0,0 +1,52 @@ +<?php +/* + Example22 : Customizing plot graphs +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(60, 70, 90, 110, 100, 90), "Serie1"); +$DataSet->AddPoint(array(40, 50, 60, 80, 70, 60), "Serie2"); +$DataSet->AddPoint(array("Jan", "Feb", "Mar", "Apr", "May", "Jun"), "Serie3"); +$DataSet->AddSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("Company A", "Serie1"); +$DataSet->SetSerieName("Company B", "Serie2"); +$DataSet->SetYAxisName("Product sales"); +$DataSet->SetYAxisUnit("k"); +$DataSet->SetSerieSymbol("Serie1", "Sample/Point_Asterisk.gif"); +$DataSet->SetSerieSymbol("Serie2", "Sample/Point_Cd.gif"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(65, 30, 650, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the title +$Test->setFontProperties("Fonts/pf_arma_five.ttf", 6); +$Title = "Comparative product sales for company A & B "; +$Test->drawTextBox(65, 30, 650, 45, $Title, 0, 255, 255, 255, ALIGN_RIGHT, TRUE, 0, 0, 0, 30); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Draw the legend +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(80, 60, $DataSet->GetDataDescription(), 255, 255, 255); + +// Render the chart +$Test->Render("example22.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example23.php b/vendor/wp-statistics/pchart/src/Example23.php new file mode 100644 index 0000000000..d143294cf6 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example23.php @@ -0,0 +1,51 @@ +<?php +/* + Example23 : Playing with background bis +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(9, 9, 9, 10, 10, 11, 12, 14, 16, 17, 18, 18, 19, 19, 18, 15, 12, 10, 9), "Serie1"); +$DataSet->AddPoint(array(10, 11, 11, 12, 12, 13, 14, 15, 17, 19, 22, 24, 23, 23, 22, 20, 18, 16, 14), "Serie2"); +$DataSet->AddPoint(array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22), "Serie3"); +$DataSet->AddAllSeries(); +$DataSet->RemoveSerie("Serie3"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetYAxisName("Temperature"); +$DataSet->SetYAxisUnit("�C"); +$DataSet->SetXAxisUnit("h"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->drawGraphAreaGradient(132, 173, 131, 50, TARGET_BACKGROUND); + +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(120, 20, 675, 190); +$Test->drawGraphArea(213, 217, 221, FALSE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_ADDALL, 213, 217, 221, TRUE, 0, 2, TRUE); +$Test->drawGraphAreaGradient(163, 203, 167, 50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 20); + +// Draw the bar chart +$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 70); + +// Draw the title +$Title = " Average Temperatures during\r\n the first months of 2008 "; +$Test->drawTextBox(0, 0, 50, 230, $Title, 90, 255, 255, 255, ALIGN_BOTTOM_CENTER, TRUE, 0, 0, 0, 30); + +// Draw the legend +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(610, 10, $DataSet->GetDataDescription(), 236, 238, 240, 52, 58, 82); + +// Render the picture +$Test->addBorder(2); +$Test->Render("example23.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example24.php b/vendor/wp-statistics/pchart/src/Example24.php new file mode 100644 index 0000000000..2c0f53ead0 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example24.php @@ -0,0 +1,54 @@ +<?php +/* + Example24 : X versus Y chart +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; + +// Compute the points +for ($i = 0; $i <= 360; $i = $i + 10) { + $DataSet->AddPoint(cos($i * 3.14 / 180) * 80 + $i, "Serie1"); + $DataSet->AddPoint(sin($i * 3.14 / 180) * 80 + $i, "Serie2"); +} + +$DataSet->SetSerieName("Trigonometric function", "Serie1"); +$DataSet->AddSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$DataSet->SetXAxisName("X Axis"); +$DataSet->SetYAxisName("Y Axis"); + +// Initialise the graph +$Test = new pChart(300, 300); +$Test->drawGraphAreaGradient(0, 0, 0, -100, TARGET_BACKGROUND); + +// Prepare the graph area +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(55, 30, 270, 230); +$Test->drawXYScale($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie1", "Serie2", 213, 217, 221, TRUE, 45); +$Test->drawGraphArea(213, 217, 221, FALSE); +$Test->drawGraphAreaGradient(30, 30, 30, -50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 20); + +// Draw the chart +$Test->setShadowProperties(2, 2, 0, 0, 0, 60, 4); +$Test->drawXYGraph($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie1", "Serie2", 0); +$Test->clearShadow(); + +// Draw the title +$Title = "Drawing X versus Y charts trigonometric functions "; +$Test->drawTextBox(0, 280, 300, 300, $Title, 0, 255, 255, 255, ALIGN_RIGHT, TRUE, 0, 0, 0, 30); + +// Draw the legend +$Test->setFontProperties("Fonts/pf_arma_five.ttf", 6); +$DataSet->RemoveSerie("Serie2"); +$Test->drawLegend(160, 5, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, 255, 255, 255, FALSE); + +$Test->Render("example24.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example25.php b/vendor/wp-statistics/pchart/src/Example25.php new file mode 100644 index 0000000000..cefff653c4 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example25.php @@ -0,0 +1,57 @@ +<?php +/* + Example25 : Playing with shadow +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(9, 9, 9, 10, 10, 11, 12, 14, 16, 17, 18, 18, 19, 19, 18, 15, 12, 10, 9), "Serie1"); +$DataSet->AddPoint(array(10, 11, 11, 12, 12, 13, 14, 15, 17, 19, 22, 24, 23, 23, 22, 20, 18, 16, 14), "Serie2"); +$DataSet->AddPoint(array(4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22), "Serie3"); +$DataSet->AddAllSeries(); +$DataSet->RemoveSerie("Serie3"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); +$DataSet->SetYAxisName("Temperature"); +$DataSet->SetYAxisUnit("�C"); +$DataSet->SetXAxisUnit("h"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->drawGraphAreaGradient(90, 90, 90, 90, TARGET_BACKGROUND); +$Test->setFixedScale(0, 40, 4); + +// Graph area setup +$Test->setFontProperties("Fonts/pf_arma_five.ttf", 6); +$Test->setGraphArea(60, 40, 680, 200); +$Test->drawGraphArea(200, 200, 200, FALSE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 200, 200, 200, TRUE, 0, 2); +$Test->drawGraphAreaGradient(40, 40, 40, -50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 10); + +// Draw the line chart +$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4); +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->clearShadow(); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 0, -1, -1, -1, TRUE); + +// Write the title +$Test->setFontProperties("Fonts/MankSans.ttf", 18); +$Test->setShadowProperties(1, 1, 0, 0, 0); +$Test->drawTitle(0, 0, "Average temperatures", 255, 255, 255, 700, 30, TRUE); +$Test->clearShadow(); + +// Draw the legend +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(610, 5, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, 255, 255, 255, FALSE); + +// Render the picture +$Test->Render("example25.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example26.php b/vendor/wp-statistics/pchart/src/Example26.php new file mode 100644 index 0000000000..2147a70855 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example26.php @@ -0,0 +1,71 @@ +<?php +/* + Example26 : Two Y axis / shadow demonstration +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(110, 101, 118, 108, 110, 106, 104), "Serie1"); +$DataSet->AddPoint(array(700, 2705, 2041, 1712, 2051, 846, 903), "Serie2"); +$DataSet->AddPoint(array("03 Oct", "02 Oct", "01 Oct", "30 Sep", "29 Sep", "28 Sep", "27 Sep"), "Serie3"); +$DataSet->AddSerie("Serie1"); +$DataSet->SetAbsciseLabelSerie("Serie3"); +$DataSet->SetSerieName("SourceForge Rank", "Serie1"); +$DataSet->SetSerieName("Web Hits", "Serie2"); + +// Initialise the graph +$Test = new pChart(660, 230); +$Test->drawGraphAreaGradient(90, 90, 90, 90, TARGET_BACKGROUND); + +// Prepare the graph area +$Test->setFontProperties("fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 40, 595, 190); + +// Initialise graph area +$Test->setFontProperties("fonts/tahoma.ttf", 8); + +// Draw the SourceForge Rank graph +$DataSet->SetYAxisName("Sourceforge Rank"); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 0); +$Test->drawGraphAreaGradient(40, 40, 40, -50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 10); +$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4); +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->clearShadow(); +$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), .1, 30); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Clear the scale +$Test->clearScale(); + +// Draw the 2nd graph +$DataSet->RemoveSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$DataSet->SetYAxisName("Web Hits"); +$Test->drawRightScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 0); +$Test->drawGrid(4, TRUE, 230, 230, 230, 10); +$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4); +$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->clearShadow(); +$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), .1, 30); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Write the legend (box less) +$Test->setFontProperties("fonts/tahoma.ttf", 8); +$Test->drawLegend(530, 5, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, 255, 255, 255, FALSE); + +// Write the title +$Test->setFontProperties("fonts/MankSans.ttf", 18); +$Test->setShadowProperties(1, 1, 0, 0, 0); +$Test->drawTitle(0, 0, "SourceForge ranking summary", 255, 255, 255, 660, 30, TRUE); +$Test->clearShadow(); + +// Render the picture +$Test->Render("example26.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example3.php b/vendor/wp-statistics/pchart/src/Example3.php new file mode 100644 index 0000000000..38a57930be --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example3.php @@ -0,0 +1,44 @@ +<?php +/* + Example3 : an overlayed bar graph, uggly no? +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4, -3, 2, -3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(0, 3, -4, 1, -2, 2, 1, 0, -1, 6, 3, -4, 1, -4, 2, 4, 0, -1, 6), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the bar graph +$Test->drawOverlayBarGraph($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 3", 50, 50, 50, 585); +$Test->Render("example3.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example4.php b/vendor/wp-statistics/pchart/src/Example4.php new file mode 100644 index 0000000000..97045bf6fe --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example4.php @@ -0,0 +1,47 @@ +<?php +/* + Example4 : Showing how to draw area +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->ImportFromCSV("Sample/datawithtitle.csv", ",", array(1, 2, 3), TRUE, 0); +$DataSet->AddSerie("Serie2"); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->removeSerieName("Serie1"); +$DataSet->removeSerieName("Serie3"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 30, 680, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the area +$Test->drawArea($DataSet->GetData(), "Serie1", "Serie3", 239, 238, 227, 50); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(65, 35, $DataSet->GetDataDescription(), 250, 250, 250); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "Example 4", 50, 50, 50, 585); +$Test->Render("example4.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example5.php b/vendor/wp-statistics/pchart/src/Example5.php new file mode 100644 index 0000000000..503912916c --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example5.php @@ -0,0 +1,44 @@ +<?php +/* + Example5 : A limits graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4, -3, 2, -3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(2, 5, 7, 5, 1, 5, 6, 4, 8, 4, 0, 2, 5, 6, 4, 5, 6, 7, 6), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the limit graph +$Test->drawLimitsGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 180, 180, 180); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 5", 50, 50, 50, 585); +$Test->Render("example5.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example6.php b/vendor/wp-statistics/pchart/src/Example6.php new file mode 100644 index 0000000000..2ce71b9e58 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example6.php @@ -0,0 +1,41 @@ +<?php +/* + Example6 : A simple filled line graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->ImportFromCSV("Sample/datawithtitle.csv", ",", array(1, 2, 3), TRUE, 0); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(60, 30, 680, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the filled line graph +$Test->drawFilledLineGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50, TRUE); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(65, 35, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "Example 6", 50, 50, 50, 585); +$Test->Render("example6.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example7.php b/vendor/wp-statistics/pchart/src/Example7.php new file mode 100644 index 0000000000..2f9957bf1e --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example7.php @@ -0,0 +1,44 @@ +<?php +/* + Example7 : A filled cubic curve graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the cubic curve graph +$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), .1, 50); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 7", 50, 50, 50, 585); +$Test->Render("example7.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example8.php b/vendor/wp-statistics/pchart/src/Example8.php new file mode 100644 index 0000000000..ea843fe58e --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example8.php @@ -0,0 +1,43 @@ +<?php +/* + Example8 : A radar graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array("Memory", "Disk", "Network", "Slots", "CPU"), "Label"); +$DataSet->AddPoint(array(1, 2, 3, 4, 3), "Serie1"); +$DataSet->AddPoint(array(1, 4, 2, 6, 2), "Serie2"); +$DataSet->AddSerie("Serie1"); +$DataSet->AddSerie("Serie2"); +$DataSet->SetAbsciseLabelSerie("Label"); + + +$DataSet->SetSerieName("Reference", "Serie1"); +$DataSet->SetSerieName("Tested computer", "Serie2"); + +// Initialise the graph +$Test = new pChart(400, 400); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawFilledRoundedRectangle(7, 7, 393, 393, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 395, 395, 5, 230, 230, 230); +$Test->setGraphArea(30, 30, 370, 370); +$Test->drawFilledRoundedRectangle(30, 30, 370, 370, 5, 255, 255, 255); +$Test->drawRoundedRectangle(30, 30, 370, 370, 5, 220, 220, 220); + +// Draw the radar graph +$Test->drawRadarAxis($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE, 20, 120, 120, 120, 230, 230, 230); +$Test->drawFilledRadar($DataSet->GetData(), $DataSet->GetDataDescription(), 50, 20); + +// Finish the graph +$Test->drawLegend(15, 15, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(0, 22, "Example 8", 50, 50, 50, 400); +$Test->Render("example8.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Example9.php b/vendor/wp-statistics/pchart/src/Example9.php new file mode 100644 index 0000000000..cecd43465c --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Example9.php @@ -0,0 +1,51 @@ +<?php +/* + Example9 : Showing how to use labels +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(0, 70, 70, 0, 0, 70, 70, 0, 0, 70), "Serie1"); +$DataSet->AddPoint(array(0.5, 2, 4.5, 8, 12.5, 18, 24.5, 32, 40.5, 50), "Serie2"); + +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); +$DataSet->SetSerieName("February", "Serie2"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(50, 30, 585, 200); +$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Set labels +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setLabel($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie1", "2", "Daily incomes", 221, 230, 174); +$Test->setLabel($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie2", "6", "Production break", 239, 233, 195); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(50, 22, "Example 9", 50, 50, 50, 585); +$Test->Render("example9.png"); +?> \ No newline at end of file diff --git a/third_party/pchart/Fonts/GeosansLight.ttf b/vendor/wp-statistics/pchart/src/Fonts/GeosansLight.ttf similarity index 100% rename from third_party/pchart/Fonts/GeosansLight.ttf rename to vendor/wp-statistics/pchart/src/Fonts/GeosansLight.ttf diff --git a/third_party/pchart/Fonts/MankSans.ttf b/vendor/wp-statistics/pchart/src/Fonts/MankSans.ttf similarity index 100% rename from third_party/pchart/Fonts/MankSans.ttf rename to vendor/wp-statistics/pchart/src/Fonts/MankSans.ttf diff --git a/third_party/pchart/Fonts/Silkscreen.ttf b/vendor/wp-statistics/pchart/src/Fonts/Silkscreen.ttf similarity index 100% rename from third_party/pchart/Fonts/Silkscreen.ttf rename to vendor/wp-statistics/pchart/src/Fonts/Silkscreen.ttf diff --git a/third_party/pchart/Fonts/pf_arma_five.ttf b/vendor/wp-statistics/pchart/src/Fonts/pf_arma_five.ttf similarity index 100% rename from third_party/pchart/Fonts/pf_arma_five.ttf rename to vendor/wp-statistics/pchart/src/Fonts/pf_arma_five.ttf diff --git a/third_party/pchart/Fonts/tahoma.ttf b/vendor/wp-statistics/pchart/src/Fonts/tahoma.ttf similarity index 100% rename from third_party/pchart/Fonts/tahoma.ttf rename to vendor/wp-statistics/pchart/src/Fonts/tahoma.ttf diff --git a/vendor/wp-statistics/pchart/src/HomePage3.php b/vendor/wp-statistics/pchart/src/HomePage3.php new file mode 100644 index 0000000000..91e00c19c1 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/HomePage3.php @@ -0,0 +1,72 @@ +<?php +/* + Example21 : A single stacked bar graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 2, 5), "Serie1"); +$DataSet->AddPoint(array(3, 2, 2), "Serie2"); +$DataSet->AddPoint(array(3, 4, 1), "Serie3"); +$DataSet->AddPoint(array("A#~1", "A#~2", "A#~3"), "Labels"); +$DataSet->AddAllSeries(); +$DataSet->RemoveSerie("Labels"); +$DataSet->SetAbsciseLabelSerie("Labels"); +$DataSet->SetSerieName("Alpha", "Serie1"); +$DataSet->SetSerieName("Beta", "Serie2"); +$DataSet->SetSerieName("Gama", "Serie3"); +$DataSet->SetXAxisName("Samples IDs"); +$DataSet->SetYAxisName("Test Marker"); +$DataSet->SetYAxisUnit("�m"); + +// Initialise the graph +$Test = new pChart(380, 400); +$Test->drawGraphAreaGradient(90, 90, 90, 90, TARGET_BACKGROUND); + +// Graph area setup +$Test->setFontProperties("Fonts/pf_arma_five.ttf", 6); +$Test->setGraphArea(110, 180, 350, 360); +$Test->drawGraphArea(213, 217, 221, FALSE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_ADDALLSTART0, 213, 217, 221, TRUE, 0, 2, TRUE); +$Test->drawGraphAreaGradient(40, 40, 40, -50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 5); + +// Draw the title +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Title = " Average growth size for selected\r\n DNA samples "; +$Test->setLineStyle(2); +$Test->drawLine(51, -2, 51, 402, 0, 0, 0); +$Test->setLineStyle(1); +$Test->drawTextBox(0, 0, 50, 400, $Title, 90, 255, 255, 255, ALIGN_BOTTOM_CENTER, TRUE, 0, 0, 0, 30); +$Test->setFontProperties("Fonts/pf_arma_five.ttf", 6); + +// Draw the bar graph +$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 70); + +// Second chart +$DataSet->SetXAxisName(""); +$Test->clearScale(); +$Test->setGraphArea(110, 20, 350, 140); +$Test->drawGraphArea(213, 217, 221, FALSE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, 213, 217, 221, TRUE, 0, 2); +$Test->drawGraphAreaGradient(40, 40, 40, -50); +$Test->drawGrid(4, TRUE, 230, 230, 230, 5); + +// Draw the line chart +$Test->setShadowProperties(0, 3, 0, 0, 0, 30, 4); +$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), .1, 40); +$Test->clearShadow(); + +// Write the legend +$Test->drawLegend(-2, 3, $DataSet->GetDataDescription(), 0, 0, 0, 0, 0, 0, 255, 255, 255, FALSE); + +// Finish the graph +$Test->addBorder(1); +$Test->Render("HomePage2.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Naked.php b/vendor/wp-statistics/pchart/src/Naked.php new file mode 100644 index 0000000000..6ebe72cdbb --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Naked.php @@ -0,0 +1,36 @@ +<?php +/* + Naked: Naked and easy! +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7)); +$DataSet->AddSerie(); +$DataSet->SetSerieName("Sample data", "Serie1"); + +// Initialise the graph +$Test = new pChart(700, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->setGraphArea(40, 30, 680, 200); +$Test->drawGraphArea(252, 252, 252, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2); +$Test->drawGrid(4, TRUE, 230, 230, 230, 70); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); +$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(45, 35, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(60, 22, "My pretty graph", 50, 50, 50, 585); +$Test->Render("Naked.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/Sample/CO2.csv b/vendor/wp-statistics/pchart/src/Sample/CO2.csv new file mode 100644 index 0000000000..10fad01550 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Sample/CO2.csv @@ -0,0 +1,37 @@ +Year,Jan.,Feb.,March,April,May,June,July,Aug.,Sept.,Oct.,Nov.,Dec.,Annual +1967,322.33,322.5,323.04,324.42,325,324.09,322.55,320.92,319.26,319.39,320.72,321.96,322.18 +1968,322.57,323.15,323.89,325.02,325.57,325.36,324.14,322.11,320.33,320.25,321.32,322.9,323.05 +1969,324,324.42,325.64,326.66,327.38,326.7,325.89,323.67,322.38,321.78,322.85,324.12,324.62 +1970,325.06,325.98,326.93,328.13,328.07,327.66,326.35,324.69,323.1,323.07,324.01,325.13,325.68 +1971,326.17,326.68,327.18,327.78,328.92,328.57,327.37,325.43,323.36,323.56,324.8,326.01,326.32 +1972,326.77,327.63,327.75,329.72,330.07,329.09,328.05,326.32,324.84,325.2,326.5,327.55,327.46 +1973,328.54,329.56,330.3,331.5,332.48,332.07,330.87,329.31,327.51,327.18,328.16,328.64,329.68 +1974,329.35,330.71,331.48,332.65,333.09,332.25,331.18,329.4,327.44,327.37,328.46,329.58,330.25 +1975,330.4,331.41,332.04,333.31,333.96,333.59,331.91,330.06,328.56,328.34,329.49,330.76,331.15 +1976,331.74,332.56,333.5,334.58,334.87,334.34,333.05,330.94,329.3,328.94,330.31,331.68,332.15 +1977,332.92,333.42,334.7,336.07,336.74,336.27,334.93,332.75,331.58,331.16,332.4,333.85,333.9 +1978,334.97,335.39,336.64,337.76,338.01,337.89,336.54,334.68,332.76,332.54,333.92,334.95,335.5 +1979,336.23,336.76,337.96,338.89,339.47,339.29,337.73,336.09,333.91,333.86,335.29,336.73,336.85 +1980,338.01,338.36,340.08,340.77,341.46,341.17,339.56,337.6,335.88,336.01,337.1,338.21,338.69 +1981,339.23,340.47,341.38,342.51,342.91,342.25,340.49,338.43,336.69,336.85,338.36,339.61,339.93 +1982,340.75,341.61,342.7,343.56,344.13,343.35,342.06,339.82,337.97,337.86,339.26,340.49,341.13 +1983,341.37,342.52,343.1,344.94,345.75,345.32,343.99,342.39,339.86,339.99,341.16,342.99,342.78 +1984,343.7,344.51,345.28,347.08,347.43,346.79,345.4,343.28,341.07,341.35,342.98,344.22,344.42 +1985,344.97,346,347.43,348.35,348.93,348.25,346.56,344.69,343.09,342.8,344.24,345.56,345.9 +1986,346.29,346.96,347.86,349.55,350.21,349.54,347.94,345.91,344.86,344.17,345.66,346.9,347.15 +1987,348.02,348.47,349.42,350.99,351.84,351.25,349.52,348.1,346.44,346.36,347.81,348.96,348.93 +1988,350.43,351.72,352.22,353.59,354.22,353.79,352.39,350.44,348.72,348.88,350.07,351.34,351.48 +1989,352.76,353.07,353.68,355.42,355.67,355.13,353.9,351.67,349.8,349.99,351.3,352.53,352.91 +1990,353.66,354.7,355.39,356.2,357.16,356.22,354.82,352.91,350.96,351.18,352.83,354.21,354.19 +1991,354.72,355.75,357.16,358.6,359.34,358.24,356.17,354.03,352.16,352.21,353.75,354.99,355.59 +1992,355.98,356.72,357.81,359.15,359.66,359.25,357.03,355,353.01,353.31,354.16,355.4,356.37 +1993,356.7,357.16,358.38,359.46,360.28,359.6,357.57,355.52,353.7,353.98,355.33,356.8,357.04 +1994,358.36,358.91,359.97,361.26,361.68,360.95,359.55,357.49,355.84,355.99,357.58,359.04,358.88 +1995,359.96,361,361.64,363.45,363.79,363.26,361.9,359.46,358.06,357.75,359.56,360.7,360.88 +1996,362.05,363.25,364.03,364.72,365.41,364.97,363.65,361.49,359.46,359.6,360.76,362.33,362.64 +1997,363.18,364,364.57,366.35,366.79,365.62,364.47,362.51,360.19,360.77,362.43,364.28,363.76 +1998,365.32,366.15,367.31,368.61,369.3,368.87,367.64,365.77,363.9,364.23,365.46,366.97,366.63 +1999,368.15,368.86,369.58,371.12,370.97,370.33,369.25,366.91,364.6,365.09,366.63,367.96,368.29 +2000,369.08,369.4,370.45,371.59,371.75,371.62,370.04,368.04,366.54,366.63,368.2,369.43,369.4 +2001,370.17,371.39,372,372.75,373.88,373.17,371.48,369.42,367.83,367.96,369.55,371.1,370.89 +2002,372.29,372.94,373.38,374.71,375.4,375.26,373.87,371.35,370.57,370.1,371.93,373.63,372.95 diff --git a/vendor/wp-statistics/pchart/src/Sample/Point_Asterisk.gif b/vendor/wp-statistics/pchart/src/Sample/Point_Asterisk.gif new file mode 100644 index 0000000000..f75e9b84a2 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Sample/Point_Asterisk.gif differ diff --git a/vendor/wp-statistics/pchart/src/Sample/Point_Cd.gif b/vendor/wp-statistics/pchart/src/Sample/Point_Cd.gif new file mode 100644 index 0000000000..814c64290b Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Sample/Point_Cd.gif differ diff --git a/third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/.noencode b/vendor/wp-statistics/pchart/src/Sample/Sav143.tmp similarity index 100% rename from third_party/codeplex-phpexcel-1.7.6/PHPExcel/Shared/PDF/fonts/.noencode rename to vendor/wp-statistics/pchart/src/Sample/Sav143.tmp diff --git a/vendor/wp-statistics/pchart/src/Sample/bulkdata.csv b/vendor/wp-statistics/pchart/src/Sample/bulkdata.csv new file mode 100644 index 0000000000..8717d20e04 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Sample/bulkdata.csv @@ -0,0 +1,20 @@ +1,0,1,0.5 +2,1.204119983,4,2 +3,4.294091292,9,4.5 +4,9.632959861,16,8 +5,17.47425011,25,12.5 +6,28.01344501,36,18 +7,41.40980396,49,24.5 +8,57.79775917,64,32 +9,77.29364326,81,40.5 +10,100,100,50 +11,126.0085149,121,60.5 +12,155.4020994,144,72 +13,188.2564265,169,84.5 +14,224.641095,196,98 +15,264.6205333,225,112.5 +16,308.2547156,256,128 +17,355.5997383,289,144.5 +18,406.7082917,324,162 +19,461.6300499,361,180.5 +20,520.4119983,400,200 diff --git a/vendor/wp-statistics/pchart/src/Sample/datawithtitle.csv b/vendor/wp-statistics/pchart/src/Sample/datawithtitle.csv new file mode 100644 index 0000000000..41acb13422 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Sample/datawithtitle.csv @@ -0,0 +1,21 @@ +Zob,January,February,March +1,0,1,0.5 +2,1.204119983,4,2 +3,4.294091292,9,4.5 +4,9.632959861,16,8 +5,17.47425011,25,12.5 +6,28.01344501,36,18 +7,41.40980396,49,24.5 +8,57.79775917,64,32 +9,77.29364326,81,40.5 +10,100,100,50 +11,126.0085149,121,60.5 +12,155.4020994,144,72 +13,188.2564265,169,84.5 +14,224.641095,196,98 +15,264.6205333,225,112.5 +16,308.2547156,256,128 +17,355.5997383,289,144.5 +18,406.7082917,324,162 +19,461.6300499,361,180.5 +20,520.4119983,400,200 diff --git a/vendor/wp-statistics/pchart/src/Sample/logo.png b/vendor/wp-statistics/pchart/src/Sample/logo.png new file mode 100644 index 0000000000..8df1e4b401 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Sample/logo.png differ diff --git a/vendor/wp-statistics/pchart/src/Sample/softtones.txt b/vendor/wp-statistics/pchart/src/Sample/softtones.txt new file mode 100644 index 0000000000..0f2a70d98b --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Sample/softtones.txt @@ -0,0 +1,5 @@ +168,188,56 +188,208,76 +208,228,96 +228,245,116 +248,255,136 diff --git a/vendor/wp-statistics/pchart/src/Sample/tones.txt b/vendor/wp-statistics/pchart/src/Sample/tones.txt new file mode 100644 index 0000000000..16d6c50312 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Sample/tones.txt @@ -0,0 +1,5 @@ +94,48,0 +201,34,0 +247,143,1 +255,238,208 +90,181,110 diff --git a/vendor/wp-statistics/pchart/src/Screenshots/HomePage3.png b/vendor/wp-statistics/pchart/src/Screenshots/HomePage3.png new file mode 100644 index 0000000000..f3b6e52802 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/HomePage3.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/Naked.png b/vendor/wp-statistics/pchart/src/Screenshots/Naked.png new file mode 100644 index 0000000000..dee8e324d7 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/Naked.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/SmallGraph.png b/vendor/wp-statistics/pchart/src/Screenshots/SmallGraph.png new file mode 100644 index 0000000000..5bea1d2cb6 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/SmallGraph.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/SmallStacked.png b/vendor/wp-statistics/pchart/src/Screenshots/SmallStacked.png new file mode 100644 index 0000000000..9e79b470b1 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/SmallStacked.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example1.png b/vendor/wp-statistics/pchart/src/Screenshots/example1.png new file mode 100644 index 0000000000..9f70a404a4 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example1.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example10.png b/vendor/wp-statistics/pchart/src/Screenshots/example10.png new file mode 100644 index 0000000000..83d8d83d5f Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example10.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example12.png b/vendor/wp-statistics/pchart/src/Screenshots/example12.png new file mode 100644 index 0000000000..55de640263 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example12.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example13.png b/vendor/wp-statistics/pchart/src/Screenshots/example13.png new file mode 100644 index 0000000000..f5666ff6a2 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example13.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example14.png b/vendor/wp-statistics/pchart/src/Screenshots/example14.png new file mode 100644 index 0000000000..e8df3eceb8 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example14.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example15.png b/vendor/wp-statistics/pchart/src/Screenshots/example15.png new file mode 100644 index 0000000000..8e94acbc20 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example15.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example16.png b/vendor/wp-statistics/pchart/src/Screenshots/example16.png new file mode 100644 index 0000000000..e3ed7b00af Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example16.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example17.png b/vendor/wp-statistics/pchart/src/Screenshots/example17.png new file mode 100644 index 0000000000..82683b9cdf Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example17.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example18.png b/vendor/wp-statistics/pchart/src/Screenshots/example18.png new file mode 100644 index 0000000000..0f21b817aa Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example18.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example19.png b/vendor/wp-statistics/pchart/src/Screenshots/example19.png new file mode 100644 index 0000000000..80667177b5 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example19.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example2.png b/vendor/wp-statistics/pchart/src/Screenshots/example2.png new file mode 100644 index 0000000000..44e56cb752 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example2.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example20.png b/vendor/wp-statistics/pchart/src/Screenshots/example20.png new file mode 100644 index 0000000000..d0c8b460a8 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example20.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example21.png b/vendor/wp-statistics/pchart/src/Screenshots/example21.png new file mode 100644 index 0000000000..301ef8f033 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example21.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example22.png b/vendor/wp-statistics/pchart/src/Screenshots/example22.png new file mode 100644 index 0000000000..25f05069e2 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example22.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example23.png b/vendor/wp-statistics/pchart/src/Screenshots/example23.png new file mode 100644 index 0000000000..36379d50bf Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example23.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example24.png b/vendor/wp-statistics/pchart/src/Screenshots/example24.png new file mode 100644 index 0000000000..23271f96ae Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example24.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example25.png b/vendor/wp-statistics/pchart/src/Screenshots/example25.png new file mode 100644 index 0000000000..ef103049cf Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example25.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example26.png b/vendor/wp-statistics/pchart/src/Screenshots/example26.png new file mode 100644 index 0000000000..9fa3214bf9 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example26.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example3.png b/vendor/wp-statistics/pchart/src/Screenshots/example3.png new file mode 100644 index 0000000000..a14be1c9d8 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example3.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example4.png b/vendor/wp-statistics/pchart/src/Screenshots/example4.png new file mode 100644 index 0000000000..5c3c5e8b53 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example4.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example5.png b/vendor/wp-statistics/pchart/src/Screenshots/example5.png new file mode 100644 index 0000000000..634303ff03 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example5.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example6.png b/vendor/wp-statistics/pchart/src/Screenshots/example6.png new file mode 100644 index 0000000000..aebd57152e Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example6.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example7.png b/vendor/wp-statistics/pchart/src/Screenshots/example7.png new file mode 100644 index 0000000000..5a44398e9b Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example7.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example8.png b/vendor/wp-statistics/pchart/src/Screenshots/example8.png new file mode 100644 index 0000000000..636a68550c Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example8.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/example9.png b/vendor/wp-statistics/pchart/src/Screenshots/example9.png new file mode 100644 index 0000000000..edc24106f1 Binary files /dev/null and b/vendor/wp-statistics/pchart/src/Screenshots/example9.png differ diff --git a/vendor/wp-statistics/pchart/src/Screenshots/index.html b/vendor/wp-statistics/pchart/src/Screenshots/index.html new file mode 100644 index 0000000000..6101ac8c68 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/Screenshots/index.html @@ -0,0 +1,36 @@ +<body> +<center> + <img src="example1.png" /> + <img src="example2.png" /> + <img src="example3.png" /> + <img src="example4.png" /> + <img src="example5.png" /> + <img src="example6.png" /> + <img src="example7.png" /> + <img src="example8.png" /> + <img src="example9.png" /> + <img src="example10.png" /> + <img src="example11.png" /> + <img src="example12.png" /> + <img src="example13.png" /> + <img src="example14.png" /> + <img src="example15.png" /> + <img src="example16.png" /> + <img src="example17.png" /> + <img src="example18.png" /> + <img src="example19.png" /> + <img src="example20.png" /> + <img src="example21.png" /> + <img src="example22.png" /> + <img src="example23.png" /> + <img src="example24.png" /> + <img src="example25.png" /> + <img src="example26.png" /> + <img src="example27.png" /> + <img src="example28.png" /> + <img src="HomePage3.png" /> + <img src="Naked.png" /> + <img src="SmallGraph.png" /> + <img src="SmallStacked.png" /> +</center> +</body> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/SmallGraph.php b/vendor/wp-statistics/pchart/src/SmallGraph.php new file mode 100644 index 0000000000..592e7a8819 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/SmallGraph.php @@ -0,0 +1,32 @@ +<?php +/* + SmallGraph: Let's go fast, draw small! +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4, -3, 2, -3, 3, 5, 1, 0, 7), "Serie1"); +$DataSet->AddAllSeries(); +$DataSet->SetAbsciseLabelSerie(); +$DataSet->SetSerieName("January", "Serie1"); + +// Initialise the graph +$Test = new pChart(100, 30); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawFilledRoundedRectangle(2, 2, 98, 28, 2, 230, 230, 230); +$Test->setGraphArea(5, 5, 95, 25); +$Test->drawGraphArea(255, 255, 255); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 220, 220, 220, FALSE); + +// Draw the line graph +$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription()); + +// Finish the graph +$Test->Render("SmallGraph.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/SmallStacked.php b/vendor/wp-statistics/pchart/src/SmallStacked.php new file mode 100644 index 0000000000..5cc9137da5 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/SmallStacked.php @@ -0,0 +1,50 @@ +<?php +/* + Example21 : A single stacked bar graph +*/ + +require_once __DIR__ . '/../vendor/autoload.php'; // Autoload files using Composer autoload + +use pChart\pData; +use pChart\pChart; +use pChart\pCache; + +// Dataset definition +$DataSet = new pData; +$DataSet->AddPoint(1, "Serie1"); +$DataSet->AddPoint(3, "Serie2"); +$DataSet->AddPoint(3, "Serie3"); +$DataSet->AddPoint("A#~1", "Labels"); +$DataSet->AddAllSeries(); +$DataSet->RemoveSerie("Labels"); +$DataSet->SetAbsciseLabelSerie("Labels"); +$DataSet->SetSerieName("Alpha", "Serie1"); +$DataSet->SetSerieName("Beta", "Serie2"); +$DataSet->SetSerieName("Gama", "Serie3"); +$DataSet->SetYAxisName("Test Marker"); +$DataSet->SetYAxisUnit("�m"); + +// Initialise the graph +$Test = new pChart(210, 230); +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->setGraphArea(65, 30, 125, 200); +$Test->drawFilledRoundedRectangle(7, 7, 203, 223, 5, 240, 240, 240); +$Test->drawRoundedRectangle(5, 5, 205, 225, 5, 230, 230, 230); +$Test->drawGraphArea(255, 255, 255, TRUE); +$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_ADDALLSTART0, 150, 150, 150, TRUE, 0, 2, TRUE); +$Test->drawGrid(4, TRUE, 230, 230, 230, 50); + +// Draw the 0 line +$Test->setFontProperties("Fonts/tahoma.ttf", 6); +$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE); + +// Draw the bar graph +$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50); + +// Finish the graph +$Test->setFontProperties("Fonts/tahoma.ttf", 8); +$Test->drawLegend(135, 150, $DataSet->GetDataDescription(), 255, 255, 255); +$Test->setFontProperties("Fonts/tahoma.ttf", 10); +$Test->drawTitle(0, 22, "Sample size", 50, 50, 50, 210); +$Test->Render("SmallStacked.png"); +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/buildAll.cmd b/vendor/wp-statistics/pchart/src/buildAll.cmd new file mode 100644 index 0000000000..6ffa7904a6 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/buildAll.cmd @@ -0,0 +1,63 @@ +ECHO OFF +CLS +ECHO Processing all examples +ECHO. +ECHO [01/28] A simple line chart + php -q %~dp0Example1.php +ECHO [02/28] A cubic curve graph + php -q %~dp0Example2.php +ECHO [03/28] An overlayed bar graph + php -q %~dp0Example3.php +ECHO [04/28] Showing how to draw area + php -q %~dp0Example4.php +ECHO [05/28] A limits graph + php -q %~dp0Example5.php +ECHO [06/28] A simple filled line graph + php -q %~dp0Example6.php +ECHO [07/28] A filled cubic curve graph + php -q %~dp0Example7.php +ECHO [08/28] A radar graph + php -q %~dp0Example8.php +ECHO [09/28] Showing how to use labels + php -q %~dp0Example9.php +ECHO [10/28] A 3D exploded pie graph + php -q %~dp0Example10.php +ECHO [11/28] A true bar graph + php -q %~dp0Example12.php +ECHO [12/28] A 2D exploded pie graph + php -q %~dp0Example13.php +ECHO [13/28] A smooth flat pie graph + php -q %~dp0Example14.php +ECHO [14/28] Playing with line style and pictures inclusion + php -q %~dp0Example15.php +ECHO [15/28] Importing CSV data + php -q %~dp0Example16.php +ECHO [16/28] Playing with axis + php -q %~dp0Example17.php +ECHO [17/28] Missing values + php -q %~dp0Example18.php +ECHO [18/28] Error reporting + php -q %~dp0Example19.php +ECHO [19/28] Stacked bar graph + php -q %~dp0Example20.php +ECHO [20/28] Playing with background + php -q %~dp0Example21.php +ECHO [21/28] Customizing plot charts + php -q %~dp0Example22.php +ECHO [22/28] Playing with background - Bis + php -q %~dp0Example23.php +ECHO [23/28] X Versus Y chart + php -q %~dp0Example24.php +ECHO [24/28] Using shadows + php -q %~dp0Example25.php +ECHO [25/28] Two Y axis / shadow demonstration + php -q %~dp0Example26.php +ECHO [26/28] Naked and easy! + php -q %~dp0Naked.php +ECHO [27/28] Let's go fast, draw small! + php -q %~dp0SmallGraph.php +ECHO [28/28] A Small stacked chart + php -q %~dp0SmallStacked.php +ECHO. +ECHO Rendering complete! +PAUSE diff --git a/vendor/wp-statistics/pchart/src/pChart/pCache.php b/vendor/wp-statistics/pchart/src/pChart/pCache.php new file mode 100644 index 0000000000..a763e65d1a --- /dev/null +++ b/vendor/wp-statistics/pchart/src/pChart/pCache.php @@ -0,0 +1,88 @@ +<?php + +namespace pChart; + +/* pCache class definition */ + +class pCache +{ + + public $HashKey = ""; + public $CacheFolder = "Cache/"; + + public function __construct($CacheFolder = "Cache/") + { + $this->CacheFolder = $CacheFolder; + } + + /* This function is clearing the cache folder */ + function ClearCache() + { + if ($handle = opendir($this->CacheFolder)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") + unlink($this->CacheFolder . $file); + } + closedir($handle); + } + } + + /* This function is checking if we have an offline version of this chart */ + function IsInCache($ID, $Data, $Hash = "") + { + if ($Hash == "") + $Hash = $this->GetHash($ID, $Data); + + if (file_exists($this->CacheFolder . $Hash)) + return (TRUE); + else + return (FALSE); + } + + /* This function is making a copy of drawn chart in the cache folder */ + function WriteToCache($ID, $Data, $Picture) + { + $Hash = $this->GetHash($ID, $Data); + $FileName = $this->CacheFolder . $Hash; + + imagepng($Picture->Picture, $FileName); + } + + /* This function is removing any cached copy of this chart */ + function DeleteFromCache($ID, $Data) + { + $Hash = $this->GetHash($ID, $Data); + $FileName = $this->CacheFolder . $Hash; + + if (file_exists($FileName)) + unlink($FileName); + } + + /* This function is retrieving the cached picture if applicable */ + function GetFromCache($ID, $Data) + { + $Hash = $this->GetHash($ID, $Data); + if ($this->IsInCache("", "", $Hash)) { + $FileName = $this->CacheFolder . $Hash; + + header('Content-type: image/png'); + @readfile($FileName); + exit(); + } + } + + /* This function is building the graph unique hash key */ + function GetHash($ID, $Data) + { + $mKey = "$ID"; + foreach ($Data as $key => $Values) { + $tKey = ""; + foreach ($Values as $Serie => $Value) + $tKey = $tKey . $Serie . $Value; + $mKey = $mKey . md5($tKey); + } + return (md5($mKey)); + } +} + +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/pChart/pChart.php b/vendor/wp-statistics/pchart/src/pChart/pChart.php new file mode 100644 index 0000000000..02323d7db2 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/pChart/pChart.php @@ -0,0 +1,3987 @@ +<?php + +namespace pChart; + +/* Declare some script wide constants */ +define("SCALE_NORMAL", 1); +define("SCALE_ADDALL", 2); +define("SCALE_START0", 3); +define("SCALE_ADDALLSTART0", 4); +define("PIE_PERCENTAGE", 1); +define("PIE_LABELS", 2); +define("PIE_NOLABEL", 3); +define("PIE_PERCENTAGE_LABEL", 4); +define("TARGET_GRAPHAREA", 1); +define("TARGET_BACKGROUND", 2); +define("ALIGN_TOP_LEFT", 1); +define("ALIGN_TOP_CENTER", 2); +define("ALIGN_TOP_RIGHT", 3); +define("ALIGN_LEFT", 4); +define("ALIGN_CENTER", 5); +define("ALIGN_RIGHT", 6); +define("ALIGN_BOTTOM_LEFT", 7); +define("ALIGN_BOTTOM_CENTER", 8); +define("ALIGN_BOTTOM_RIGHT", 9); + +/* pChart class definition */ + +class pChart +{ + /* Palettes definition */ + public $Palette = array( + "0" => array("R" => 188, "G" => 224, "B" => 46), + "1" => array("R" => 224, "G" => 100, "B" => 46), + "2" => array("R" => 224, "G" => 214, "B" => 46), + "3" => array("R" => 46, "G" => 151, "B" => 224), + "4" => array("R" => 176, "G" => 46, "B" => 224), + "5" => array("R" => 224, "G" => 46, "B" => 117), + "6" => array("R" => 92, "G" => 224, "B" => 46), + "7" => array("R" => 224, "G" => 176, "B" => 46) + ); + + /* Some static vars used in the class */ + public $XSize = null; + public $YSize = null; + public $Picture = null; + public $ImageMap = null; + + /* Error management */ + public $ErrorReporting = false; + public $ErrorInterface = "CLI"; + public $Errors = null; + public $ErrorFontName = "Fonts/pf_arma_five.ttf"; + public $ErrorFontSize = 6; + + /* vars related to the graphing area */ + public $GArea_X1 = null; + public $GArea_Y1 = null; + public $GArea_X2 = null; + public $GArea_Y2 = null; + public $GAreaXOffset = null; + public $VMax = null; + public $VMin = null; + public $VXMax = null; + public $VXMin = null; + public $Divisions = null; + public $XDivisions = null; + public $DivisionHeight = null; + public $XDivisionHeight = null; + public $DivisionCount = null; + public $XDivisionCount = null; + public $DivisionRatio = null; + public $XDivisionRatio = null; + public $DivisionWidth = null; + public $DataCount = null; + public $Currency = "\$"; + + /* Text format related vars */ + public $FontName = null; + public $FontSize = null; + public $DateFormat = "d/m/Y"; + + /* Lines format related vars */ + public $LineWidth = 1; + public $LineDotSize = 0; + + /* Layer related vars */ + public $Layers = null; + + /* Set antialias quality : 0 is maximum, 100 minimum*/ + public $AntialiasQuality = 0; + + /* Shadow settings */ + public $ShadowActive = false; + public $ShadowXDistance = 1; + public $ShadowYDistance = 1; + public $ShadowRColor = 60; + public $ShadowGColor = 60; + public $ShadowBColor = 60; + public $ShadowAlpha = 50; + public $ShadowBlur = 0; + + /* Image Map settings */ + public $BuildMap = false; + public $MapFunction = null; + public $tmpFolder = "tmp/"; + public $MapID = null; + + public function __construct($XSize, $YSize) + { + $this->XSize = $XSize; + $this->YSize = $YSize; + $this->Picture = imagecreatetruecolor($XSize, $YSize); + + $C_White = $this->AllocateColor($this->Picture, 255, 255, 255); + imagefilledrectangle($this->Picture, 0, 0, $XSize, $YSize, $C_White); + imagecolortransparent($this->Picture, $C_White); + + $this->setFontProperties("tahoma.ttf", 8); + } + + /* Set if warnings should be reported */ + function reportWarnings($Interface = "CLI") + { + $this->ErrorReporting = true; + $this->ErrorInterface = $Interface; + } + + /* Set the font properties */ + function setFontProperties($FontName, $FontSize) + { + $this->FontName = $FontName; + $this->FontSize = $FontSize; + } + + /* Set the shadow properties */ + function setShadowProperties($XDistance = 1, $YDistance = 1, $R = 60, $G = 60, $B = 60, $Alpha = 50, $Blur = 0) + { + $this->ShadowActive = true; + $this->ShadowXDistance = $XDistance; + $this->ShadowYDistance = $YDistance; + $this->ShadowRColor = $R; + $this->ShadowGColor = $G; + $this->ShadowBColor = $B; + $this->ShadowAlpha = $Alpha; + $this->ShadowBlur = $Blur; + } + + /* Remove shadow option */ + function clearShadow() + { + $this->ShadowActive = false; + } + + /* Set Palette color */ + function setColorPalette($ID, $R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $this->Palette[$ID]["R"] = $R; + $this->Palette[$ID]["G"] = $G; + $this->Palette[$ID]["B"] = $B; + } + + /* Create a color palette shading from one color to another */ + function createColorGradientPalette($R1, $G1, $B1, $R2, $G2, $B2, $Shades) + { + $RFactor = ($R2 - $R1) / $Shades; + $GFactor = ($G2 - $G1) / $Shades; + $BFactor = ($B2 - $B1) / $Shades; + + for ($i = 0; $i <= $Shades - 1; $i++) { + $this->Palette[$i]["R"] = $R1 + $RFactor * $i; + $this->Palette[$i]["G"] = $G1 + $GFactor * $i; + $this->Palette[$i]["B"] = $B1 + $BFactor * $i; + } + } + + /* Load Color Palette from file */ + function loadColorPalette($FileName, $Delimiter = ",") + { + $handle = @fopen($FileName, "r"); + $ColorID = 0; + if ($handle) { + while (!feof($handle)) { + $buffer = fgets($handle, 4096); + $buffer = str_replace(chr(10), "", $buffer); + $buffer = str_replace(chr(13), "", $buffer); + $Values = explode($Delimiter, $buffer); + if (count($Values) == 3) { + $this->Palette[$ColorID]["R"] = $Values[0]; + $this->Palette[$ColorID]["G"] = $Values[1]; + $this->Palette[$ColorID]["B"] = $Values[2]; + $ColorID++; + } + } + } + } + + /* Set line style */ + function setLineStyle($Width = 1, $DotSize = 0) + { + $this->LineWidth = $Width; + $this->LineDotSize = $DotSize; + } + + /* Set currency symbol */ + function setCurrency($Currency) + { + $this->Currency = $Currency; + } + + /* Set the graph area location */ + function setGraphArea($X1, $Y1, $X2, $Y2) + { + $this->GArea_X1 = $X1; + $this->GArea_Y1 = $Y1; + $this->GArea_X2 = $X2; + $this->GArea_Y2 = $Y2; + } + + /* Prepare the graph area */ + function drawGraphArea($R, $G, $B, $Stripe = false) + { + $this->drawFilledRectangle($this->GArea_X1, $this->GArea_Y1, $this->GArea_X2, $this->GArea_Y2, $R, $G, $B, false); + $this->drawRectangle($this->GArea_X1, $this->GArea_Y1, $this->GArea_X2, $this->GArea_Y2, $R - 40, $G - 40, $B - 40); + + if ($Stripe) { + $R2 = $R - 15; + if ($R2 < 0) { + $R2 = 0; + } + $G2 = $R - 15; + if ($G2 < 0) { + $G2 = 0; + } + $B2 = $R - 15; + if ($B2 < 0) { + $B2 = 0; + } + + $LineColor = $this->AllocateColor($this->Picture, $R2, $G2, $B2); + $SkewWidth = $this->GArea_Y2 - $this->GArea_Y1 - 1; + + for ($i = $this->GArea_X1 - $SkewWidth; $i <= $this->GArea_X2; $i = $i + 4) { + $X1 = $i; + $Y1 = $this->GArea_Y2; + $X2 = $i + $SkewWidth; + $Y2 = $this->GArea_Y1; + + + if ($X1 < $this->GArea_X1) { + $X1 = $this->GArea_X1; + $Y1 = $this->GArea_Y1 + $X2 - $this->GArea_X1 + 1; + } + + if ($X2 >= $this->GArea_X2) { + $Y2 = $this->GArea_Y1 + $X2 - $this->GArea_X2 + 1; + $X2 = $this->GArea_X2 - 1; + } +// * Fixed in 1.27 * { $X2 = $this->GArea_X2 - 1; $Y2 = $this->GArea_Y2 - ($this->GArea_X2 - $X1); } + + imageline($this->Picture, $X1, $Y1, $X2, $Y2 + 1, $LineColor); + } + } + } + + /* Allow you to clear the scale : used if drawing multiple charts */ + function clearScale() + { + $this->VMin = null; + $this->VMax = null; + $this->VXMin = null; + $this->VXMax = null; + $this->Divisions = null; + $this->XDivisions = null; + } + + /* Allow you to fix the scale, use this to bypass the automatic scaling */ + function setFixedScale($VMin, $VMax, $Divisions = 5, $VXMin = 0, $VXMax = 0, $XDivisions = 5) + { + $this->VMin = $VMin; + $this->VMax = $VMax; + $this->Divisions = $Divisions; + + if (!$VXMin == 0) { + $this->VXMin = $VXMin; + $this->VXMax = $VXMax; + $this->XDivisions = $XDivisions; + } + } + + /* Wrapper to the drawScale() function allowing a second scale to be drawn */ + function drawRightScale($Data, $DataDescription, $ScaleMode, $R, $G, $B, $DrawTicks = true, $Angle = 0, $Decimals = 1, $WithMargin = false, $SkipLabels = 1) + { + $this->drawScale($Data, $DataDescription, $ScaleMode, $R, $G, $B, $DrawTicks, $Angle, $Decimals, $WithMargin, $SkipLabels, true); + } + + /* Compute and draw the scale */ + function drawScale($Data, $DataDescription, $ScaleMode, $R, $G, $B, $DrawTicks = true, $Angle = 0, $Decimals = 1, $WithMargin = false, $SkipLabels = 1, $RightScale = false) + { + /* Validate the Data and DataDescription array */ + $this->validateData("drawScale", $Data); + + $C_TextColor = $this->AllocateColor($this->Picture, $R, $G, $B); + + $this->drawLine($this->GArea_X1, $this->GArea_Y1, $this->GArea_X1, $this->GArea_Y2, $R, $G, $B); + $this->drawLine($this->GArea_X1, $this->GArea_Y2, $this->GArea_X2, $this->GArea_Y2, $R, $G, $B); + + if ($this->VMin == null && $this->VMax == null) { + if (isset($DataDescription["Values"][0])) { + $this->VMin = $Data[0][$DataDescription["Values"][0]]; + $this->VMax = $Data[0][$DataDescription["Values"][0]]; + } else { + $this->VMin = 2147483647; + $this->VMax = -2147483647; + } + + /* Compute Min and Max values */ + if ($ScaleMode == SCALE_NORMAL || $ScaleMode == SCALE_START0) { + if ($ScaleMode == SCALE_START0) { + $this->VMin = 0; + } + + foreach ($Data as $Key => $Values) { + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + + if (is_numeric($Value)) { + if ($this->VMax < $Value) { + $this->VMax = $Value; + } + if ($this->VMin > $Value) { + $this->VMin = $Value; + } + } + } + } + } + } elseif ($ScaleMode == SCALE_ADDALL || $ScaleMode == SCALE_ADDALLSTART0) /* Experimental */ { + if ($ScaleMode == SCALE_ADDALLSTART0) { + $this->VMin = 0; + } + + foreach ($Data as $Key => $Values) { + $Sum = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + if (is_numeric($Value)) { + $Sum += $Value; + } + } + } + if ($this->VMax < $Sum) { + $this->VMax = $Sum; + } + if ($this->VMin > $Sum) { + $this->VMin = $Sum; + } + } + } + + if ($this->VMax > preg_replace('/\.[0-9]+/', '', $this->VMax)) { + $this->VMax = preg_replace('/\.[0-9]+/', '', $this->VMax) + 1; + } + + /* If all values are the same */ + if ($this->VMax == $this->VMin) { + if ($this->VMax >= 0) { + $this->VMax++; + } else { + $this->VMin--; + } + } + + $DataRange = $this->VMax - $this->VMin; + if ($DataRange == 0) { + $DataRange = .1; + } + + /* Compute automatic scaling */ + $ScaleOk = false; + $Factor = 1; + $MinDivHeight = 25; + $MaxDivs = ($this->GArea_Y2 - $this->GArea_Y1) / $MinDivHeight; + + if ($this->VMin == 0 && $this->VMax == 0) { + $this->VMin = 0; + $this->VMax = 2; + $Scale = 1; + $Divisions = 2; + } elseif ($MaxDivs > 1) { + while (!$ScaleOk) { + $Scale1 = ($this->VMax - $this->VMin) / $Factor; + $Scale2 = ($this->VMax - $this->VMin) / $Factor / 2; + $Scale4 = ($this->VMax - $this->VMin) / $Factor / 4; + + if ($Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $Divisions = floor($Scale1); + $Scale = 1; + } + if ($Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $Divisions = floor($Scale2); + $Scale = 2; + } + if (!$ScaleOk) { + if ($Scale2 > 1) { + $Factor = $Factor * 10; + } + if ($Scale2 < 1) { + $Factor = $Factor / 10; + } + } + } + + if (floor($this->VMax / $Scale / $Factor) != $this->VMax / $Scale / $Factor) { + $GridID = floor($this->VMax / $Scale / $Factor) + 1; + $this->VMax = $GridID * $Scale * $Factor; + $Divisions++; + } + + if (floor($this->VMin / $Scale / $Factor) != $this->VMin / $Scale / $Factor) { + $GridID = floor($this->VMin / $Scale / $Factor); + $this->VMin = $GridID * $Scale * $Factor; + $Divisions++; + } + } else /* Can occurs for small graphs */ { + $Scale = 1; + } + + if (!isset($Divisions)) { + $Divisions = 2; + } + + if ($Scale == 1 && $Divisions % 2 == 1) { + $Divisions--; + } + } else { + $Divisions = $this->Divisions; + } + + $this->DivisionCount = $Divisions; + + $DataRange = $this->VMax - $this->VMin; + if ($DataRange == 0) { + $DataRange = .1; + } + + $this->DivisionHeight = ($this->GArea_Y2 - $this->GArea_Y1) / $Divisions; + $this->DivisionRatio = ($this->GArea_Y2 - $this->GArea_Y1) / $DataRange; + + $this->GAreaXOffset = 0; + if (count($Data) > 1) { + if ($WithMargin == false) { + $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / (count($Data) - 1); + } else { + $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / (count($Data)); + $this->GAreaXOffset = $this->DivisionWidth / 2; + } + } else { + $this->DivisionWidth = $this->GArea_X2 - $this->GArea_X1; + $this->GAreaXOffset = $this->DivisionWidth / 2; + } + + $this->DataCount = count($Data); + + if ($DrawTicks == false) { + return (0); + } + + $YPos = $this->GArea_Y2; + $XMin = null; + for ($i = 1; $i <= $Divisions + 1; $i++) { + if ($RightScale) { + $this->drawLine($this->GArea_X2, $YPos, $this->GArea_X2 + 5, $YPos, $R, $G, $B); + } else { + $this->drawLine($this->GArea_X1, $YPos, $this->GArea_X1 - 5, $YPos, $R, $G, $B); + } + + $Value = $this->VMin + ($i - 1) * (($this->VMax - $this->VMin) / $Divisions); + $Value = round($Value * pow(10, $Decimals)) / pow(10, $Decimals); + if (isset($DataDescription["Format"]["Y"])) { + if ($DataDescription["Format"]["Y"] == "number") { + $Value = $Value . $DataDescription["Unit"]["Y"]; + } + if ($DataDescription["Format"]["Y"] == "time") { + $Value = $this->ToTime($Value); + } + if ($DataDescription["Format"]["Y"] == "date") { + $Value = $this->ToDate($Value); + } + if ($DataDescription["Format"]["Y"] == "metric") { + $Value = $this->ToMetric($Value); + } + if ($DataDescription["Format"]["Y"] == "currency") { + $Value = $this->ToCurrency($Value); + } + } + + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + + if ($RightScale) { + imagettftext($this->Picture, $this->FontSize, 0, $this->GArea_X2 + 10, $YPos + ($this->FontSize / 2), $C_TextColor, $this->FontName, $Value); + if ($XMin < $this->GArea_X2 + 15 + $TextWidth || $XMin == null) { + $XMin = $this->GArea_X2 + 15 + $TextWidth; + } + } else { + imagettftext($this->Picture, $this->FontSize, 0, $this->GArea_X1 - 10 - $TextWidth, $YPos + ($this->FontSize / 2), $C_TextColor, $this->FontName, $Value); + if ($XMin > $this->GArea_X1 - 10 - $TextWidth || $XMin == null) { + $XMin = $this->GArea_X1 - 10 - $TextWidth; + } + } + + $YPos = $YPos - $this->DivisionHeight; + } + + /* Write the Y Axis caption if set */ + if (isset($DataDescription["Axis"]["Y"])) { + $Position = imageftbbox($this->FontSize, 90, $this->FontName, $DataDescription["Axis"]["Y"]); + $TextHeight = abs($Position[1]) + abs($Position[3]); + $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight / 2); + + if ($RightScale) { + imagettftext($this->Picture, $this->FontSize, 90, $XMin + $this->FontSize, $TextTop, $C_TextColor, $this->FontName, $DataDescription["Axis"]["Y"]); + } else { + imagettftext($this->Picture, $this->FontSize, 90, $XMin - $this->FontSize, $TextTop, $C_TextColor, $this->FontName, $DataDescription["Axis"]["Y"]); + } + } + + /* Horizontal Axis */ + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + $ID = 1; + $YMax = null; + foreach ($Data as $Key => $Values) { + if ($ID % $SkipLabels == 0) { + $this->drawLine(floor($XPos), $this->GArea_Y2, floor($XPos), $this->GArea_Y2 + 5, $R, $G, $B); + $Value = $Data[$Key][$DataDescription["Position"]]; + if (isset($DataDescription["Format"]["X"])) { + if ($DataDescription["Format"]["X"] == "number") { + $Value = $Value . $DataDescription["Unit"]["X"]; + } + if ($DataDescription["Format"]["X"] == "time") { + $Value = $this->ToTime($Value); + } + if ($DataDescription["Format"]["X"] == "date") { + $Value = $this->ToDate($Value); + } + if ($DataDescription["Format"]["X"] == "metric") { + $Value = $this->ToMetric($Value); + } + if ($DataDescription["Format"]["X"] == "currency") { + $Value = $this->ToCurrency($Value); + } + } + + $Position = imageftbbox($this->FontSize, $Angle, $this->FontName, $Value); + $TextWidth = abs($Position[2]) + abs($Position[0]); + $TextHeight = abs($Position[1]) + abs($Position[3]); + + if ($Angle == 0) { + $YPos = $this->GArea_Y2 + 18; + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) - floor($TextWidth / 2), $YPos, $C_TextColor, $this->FontName, $Value); + } else { + $YPos = $this->GArea_Y2 + 10 + $TextHeight; + if ($Angle <= 90) { + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) - $TextWidth + 5, $YPos, $C_TextColor, $this->FontName, $Value); + } else { + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) + $TextWidth + 5, $YPos, $C_TextColor, $this->FontName, $Value); + } + } + if ($YMax < $YPos || $YMax == null) { + $YMax = $YPos; + } + } + + $XPos = $XPos + $this->DivisionWidth; + $ID++; + } + + /* Write the X Axis caption if set */ + if (isset($DataDescription["Axis"]["X"])) { + $Position = imageftbbox($this->FontSize, 90, $this->FontName, $DataDescription["Axis"]["X"]); + $TextWidth = abs($Position[2]) + abs($Position[0]); + $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth / 2); + imagettftext($this->Picture, $this->FontSize, 0, $TextLeft, $YMax + $this->FontSize + 5, $C_TextColor, $this->FontName, $DataDescription["Axis"]["X"]); + } + } + + /* Compute and draw the scale for X/Y charts */ + function drawXYScale($Data, $DataDescription, $YSerieName, $XSerieName, $R, $G, $B, $WithMargin = 0, $Angle = 0, $Decimals = 1) + { + /* Validate the Data and DataDescription array */ + $this->validateData("drawScale", $Data); + + $C_TextColor = $this->AllocateColor($this->Picture, $R, $G, $B); + + $this->drawLine($this->GArea_X1, $this->GArea_Y1, $this->GArea_X1, $this->GArea_Y2, $R, $G, $B); + $this->drawLine($this->GArea_X1, $this->GArea_Y2, $this->GArea_X2, $this->GArea_Y2, $R, $G, $B); + + /* Process Y scale */ + if ($this->VMin == null && $this->VMax == null) { + $this->VMin = $Data[0][$YSerieName]; + $this->VMax = $Data[0][$YSerieName]; + + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$YSerieName])) { + $Value = $Data[$Key][$YSerieName]; + if ($this->VMax < $Value) { + $this->VMax = $Value; + } + if ($this->VMin > $Value) { + $this->VMin = $Value; + } + } + } + + if ($this->VMax > preg_replace('/\.[0-9]+/', '', $this->VMax)) { + $this->VMax = preg_replace('/\.[0-9]+/', '', $this->VMax) + 1; + } + + $DataRange = $this->VMax - $this->VMin; + if ($DataRange == 0) { + $DataRange = .1; + } + + /* Compute automatic scaling */ + $ScaleOk = false; + $Factor = 1; + $MinDivHeight = 25; + $MaxDivs = ($this->GArea_Y2 - $this->GArea_Y1) / $MinDivHeight; + + if ($this->VMin == 0 && $this->VMax == 0) { + $this->VMin = 0; + $this->VMax = 2; + $Scale = 1; + $Divisions = 2; + } elseif ($MaxDivs > 1) { + while (!$ScaleOk) { + $Scale1 = ($this->VMax - $this->VMin) / $Factor; + $Scale2 = ($this->VMax - $this->VMin) / $Factor / 2; + $Scale4 = ($this->VMax - $this->VMin) / $Factor / 4; + + if ($Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $Divisions = floor($Scale1); + $Scale = 1; + } + if ($Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $Divisions = floor($Scale2); + $Scale = 2; + } + if (!$ScaleOk) { + if ($Scale2 > 1) { + $Factor = $Factor * 10; + } + if ($Scale2 < 1) { + $Factor = $Factor / 10; + } + } + } + + if (floor($this->VMax / $Scale / $Factor) != $this->VMax / $Scale / $Factor) { + $GridID = floor($this->VMax / $Scale / $Factor) + 1; + $this->VMax = $GridID * $Scale * $Factor; + $Divisions++; + } + + if (floor($this->VMin / $Scale / $Factor) != $this->VMin / $Scale / $Factor) { + $GridID = floor($this->VMin / $Scale / $Factor); + $this->VMin = $GridID * $Scale * $Factor; + $Divisions++; + } + } else /* Can occurs for small graphs */ { + $Scale = 1; + } + + if (!isset($Divisions)) { + $Divisions = 2; + } + + if ($this->isRealInt(($this->VMax - $this->VMin) / ($Divisions - 1))) { + $Divisions--; + } elseif ($this->isRealInt(($this->VMax - $this->VMin) / ($Divisions + 1))) { + $Divisions++; + } + } else { + $Divisions = $this->Divisions; + } + + $this->DivisionCount = $Divisions; + + $DataRange = $this->VMax - $this->VMin; + if ($DataRange == 0) { + $DataRange = .1; + } + + $this->DivisionHeight = ($this->GArea_Y2 - $this->GArea_Y1) / $Divisions; + $this->DivisionRatio = ($this->GArea_Y2 - $this->GArea_Y1) / $DataRange; + + $YPos = $this->GArea_Y2; + $XMin = null; + for ($i = 1; $i <= $Divisions + 1; $i++) { + $this->drawLine($this->GArea_X1, $YPos, $this->GArea_X1 - 5, $YPos, $R, $G, $B); + $Value = $this->VMin + ($i - 1) * (($this->VMax - $this->VMin) / $Divisions); + $Value = round($Value * pow(10, $Decimals)) / pow(10, $Decimals); + if ($DataDescription["Format"]["Y"] == "number") { + $Value = $Value . $DataDescription["Unit"]["Y"]; + } + if ($DataDescription["Format"]["Y"] == "time") { + $Value = $this->ToTime($Value); + } + if ($DataDescription["Format"]["Y"] == "date") { + $Value = $this->ToDate($Value); + } + if ($DataDescription["Format"]["Y"] == "metric") { + $Value = $this->ToMetric($Value); + } + if ($DataDescription["Format"]["Y"] == "currency") { + $Value = $this->ToCurrency($Value); + } + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + imagettftext($this->Picture, $this->FontSize, 0, $this->GArea_X1 - 10 - $TextWidth, $YPos + ($this->FontSize / 2), $C_TextColor, $this->FontName, $Value); + + if ($XMin > $this->GArea_X1 - 10 - $TextWidth || $XMin == null) { + $XMin = $this->GArea_X1 - 10 - $TextWidth; + } + + $YPos = $YPos - $this->DivisionHeight; + } + + /* Process X scale */ + if ($this->VXMin == null && $this->VXMax == null) { + $this->VXMin = $Data[0][$XSerieName]; + $this->VXMax = $Data[0][$XSerieName]; + + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$XSerieName])) { + $Value = $Data[$Key][$XSerieName]; + if ($this->VXMax < $Value) { + $this->VXMax = $Value; + } + if ($this->VXMin > $Value) { + $this->VXMin = $Value; + } + } + } + + if ($this->VXMax > preg_replace('/\.[0-9]+/', '', $this->VXMax)) { + $this->VXMax = preg_replace('/\.[0-9]+/', '', $this->VXMax) + 1; + } + + $DataRange = $this->VMax - $this->VMin; + if ($DataRange == 0) { + $DataRange = .1; + } + + /* Compute automatic scaling */ + $ScaleOk = false; + $Factor = 1; + $MinDivWidth = 25; + $MaxDivs = ($this->GArea_X2 - $this->GArea_X1) / $MinDivWidth; + + if ($this->VXMin == 0 && $this->VXMax == 0) { + $this->VXMin = 0; + $this->VXMax = 2; + $Scale = 1; + $XDivisions = 2; + } elseif ($MaxDivs > 1) { + while (!$ScaleOk) { + $Scale1 = ($this->VXMax - $this->VXMin) / $Factor; + $Scale2 = ($this->VXMax - $this->VXMin) / $Factor / 2; + $Scale4 = ($this->VXMax - $this->VXMin) / $Factor / 4; + + if ($Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $XDivisions = floor($Scale1); + $Scale = 1; + } + if ($Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { + $ScaleOk = true; + $XDivisions = floor($Scale2); + $Scale = 2; + } + if (!$ScaleOk) { + if ($Scale2 > 1) { + $Factor = $Factor * 10; + } + if ($Scale2 < 1) { + $Factor = $Factor / 10; + } + } + } + + if (floor($this->VXMax / $Scale / $Factor) != $this->VXMax / $Scale / $Factor) { + $GridID = floor($this->VXMax / $Scale / $Factor) + 1; + $this->VXMax = $GridID * $Scale * $Factor; + $XDivisions++; + } + + if (floor($this->VXMin / $Scale / $Factor) != $this->VXMin / $Scale / $Factor) { + $GridID = floor($this->VXMin / $Scale / $Factor); + $this->VXMin = $GridID * $Scale * $Factor; + $XDivisions++; + } + } else /* Can occurs for small graphs */ { + $Scale = 1; + } + + if (!isset($XDivisions)) { + $XDivisions = 2; + } + + if ($this->isRealInt(($this->VXMax - $this->VXMin) / ($XDivisions - 1))) { + $XDivisions--; + } elseif ($this->isRealInt(($this->VXMax - $this->VXMin) / ($XDivisions + 1))) { + $XDivisions++; + } + } else { + $XDivisions = $this->XDivisions; + } + + $this->XDivisionCount = $Divisions; + $this->DataCount = $Divisions + 2; + + $XDataRange = $this->VXMax - $this->VXMin; + if ($XDataRange == 0) { + $XDataRange = .1; + } + + $this->DivisionWidth = ($this->GArea_X2 - $this->GArea_X1) / $XDivisions; + $this->XDivisionRatio = ($this->GArea_X2 - $this->GArea_X1) / $XDataRange; + + $XPos = $this->GArea_X1; + $YMax = null; + for ($i = 1; $i <= $XDivisions + 1; $i++) { + $this->drawLine($XPos, $this->GArea_Y2, $XPos, $this->GArea_Y2 + 5, $R, $G, $B); + + $Value = $this->VXMin + ($i - 1) * (($this->VXMax - $this->VXMin) / $XDivisions); + $Value = round($Value * pow(10, $Decimals)) / pow(10, $Decimals); + if ($DataDescription["Format"]["Y"] == "number") { + $Value = $Value . $DataDescription["Unit"]["Y"]; + } + if ($DataDescription["Format"]["Y"] == "time") { + $Value = $this->ToTime($Value); + } + if ($DataDescription["Format"]["Y"] == "date") { + $Value = $this->ToDate($Value); + } + if ($DataDescription["Format"]["Y"] == "metric") { + $Value = $this->ToMetric($Value); + } + if ($DataDescription["Format"]["Y"] == "currency") { + $Value = $this->ToCurrency($Value); + } + + $Position = imageftbbox($this->FontSize, $Angle, $this->FontName, $Value); + $TextWidth = abs($Position[2]) + abs($Position[0]); + $TextHeight = abs($Position[1]) + abs($Position[3]); + + if ($Angle == 0) { + $YPos = $this->GArea_Y2 + 18; + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) - floor($TextWidth / 2), $YPos, $C_TextColor, $this->FontName, $Value); + } else { + $YPos = $this->GArea_Y2 + 10 + $TextHeight; + if ($Angle <= 90) { + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) - $TextWidth + 5, $YPos, $C_TextColor, $this->FontName, $Value); + } else { + imagettftext($this->Picture, $this->FontSize, $Angle, floor($XPos) + $TextWidth + 5, $YPos, $C_TextColor, $this->FontName, $Value); + } + } + + if ($YMax < $YPos || $YMax == null) { + $YMax = $YPos; + } + + $XPos = $XPos + $this->DivisionWidth; + } + + /* Write the Y Axis caption if set */ + if (isset($DataDescription["Axis"]["Y"])) { + $Position = imageftbbox($this->FontSize, 90, $this->FontName, $DataDescription["Axis"]["Y"]); + $TextHeight = abs($Position[1]) + abs($Position[3]); + $TextTop = (($this->GArea_Y2 - $this->GArea_Y1) / 2) + $this->GArea_Y1 + ($TextHeight / 2); + imagettftext($this->Picture, $this->FontSize, 90, $XMin - $this->FontSize, $TextTop, $C_TextColor, $this->FontName, $DataDescription["Axis"]["Y"]); + } + + /* Write the X Axis caption if set */ + if (isset($DataDescription["Axis"]["X"])) { + $Position = imageftbbox($this->FontSize, 90, $this->FontName, $DataDescription["Axis"]["X"]); + $TextWidth = abs($Position[2]) + abs($Position[0]); + $TextLeft = (($this->GArea_X2 - $this->GArea_X1) / 2) + $this->GArea_X1 + ($TextWidth / 2); + imagettftext($this->Picture, $this->FontSize, 0, $TextLeft, $YMax + $this->FontSize + 5, $C_TextColor, $this->FontName, $DataDescription["Axis"]["X"]); + } + } + + /* Compute and draw the scale */ + function drawGrid($LineWidth, $Mosaic = true, $R = 220, $G = 220, $B = 220, $Alpha = 100) + { + /* Draw mosaic */ + if ($Mosaic) { + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $C_Rectangle = $this->AllocateColor($this->Layers[0], 250, 250, 250); + + $YPos = $LayerHeight; //$this->GArea_Y2-1; + $LastY = $YPos; + for ($i = 0; $i <= $this->DivisionCount; $i++) { + $LastY = $YPos; + $YPos = $YPos - $this->DivisionHeight; + + if ($YPos <= 0) { + $YPos = 1; + } + + if ($i % 2 == 0) { + imagefilledrectangle($this->Layers[0], 1, $YPos, $LayerWidth - 1, $LastY, $C_Rectangle); + } + } + imagecopymerge($this->Picture, $this->Layers[0], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + } + + /* Horizontal lines */ + $YPos = $this->GArea_Y2 - $this->DivisionHeight; + for ($i = 1; $i <= $this->DivisionCount; $i++) { + if ($YPos > $this->GArea_Y1 && $YPos < $this->GArea_Y2) { + $this->drawDottedLine($this->GArea_X1, $YPos, $this->GArea_X2, $YPos, $LineWidth, $R, $G, $B); + } + + $YPos = $YPos - $this->DivisionHeight; + } + + /* Vertical lines */ + if ($this->GAreaXOffset == 0) { + $XPos = $this->GArea_X1 + $this->DivisionWidth + $this->GAreaXOffset; + $ColCount = $this->DataCount - 2; + } else { + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + $ColCount = floor(($this->GArea_X2 - $this->GArea_X1) / $this->DivisionWidth); + } + + for ($i = 1; $i <= $ColCount; $i++) { + if ($XPos > $this->GArea_X1 && $XPos < $this->GArea_X2) { + $this->drawDottedLine(floor($XPos), $this->GArea_Y1, floor($XPos), $this->GArea_Y2, $LineWidth, $R, $G, $B); + } + $XPos = $XPos + $this->DivisionWidth; + } + } + + /* retrieve the legends size */ + function getLegendBoxSize($DataDescription) + { + if (!isset($DataDescription["Description"])) { + return (-1); + } + + /* <-10->[8]<-4->Text<-10-> */ + $MaxWidth = 0; + $MaxHeight = 8; + foreach ($DataDescription["Description"] as $Key => $Value) { + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = $Position[1] - $Position[7]; + if ($TextWidth > $MaxWidth) { + $MaxWidth = $TextWidth; + } + $MaxHeight = $MaxHeight + $TextHeight + 4; + } + $MaxHeight = $MaxHeight - 3; + $MaxWidth = $MaxWidth + 32; + + return (array($MaxWidth, $MaxHeight)); + } + + /* Draw the data legends */ + function drawLegend($XPos, $YPos, $DataDescription, $R, $G, $B, $Rs = -1, $Gs = -1, $Bs = -1, $Rt = 0, $Gt = 0, $Bt = 0, $Border = true) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawLegend", $DataDescription); + + if (!isset($DataDescription["Description"])) { + return (-1); + } + + $C_TextColor = $this->AllocateColor($this->Picture, $Rt, $Gt, $Bt); + + /* <-10->[8]<-4->Text<-10-> */ + $MaxWidth = 0; + $MaxHeight = 8; + foreach ($DataDescription["Description"] as $Key => $Value) { + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = $Position[1] - $Position[7]; + if ($TextWidth > $MaxWidth) { + $MaxWidth = $TextWidth; + } + $MaxHeight = $MaxHeight + $TextHeight + 4; + } + $MaxHeight = $MaxHeight - 5; + $MaxWidth = $MaxWidth + 32; + + if ($Rs == -1 || $Gs == -1 || $Bs == -1) { + $Rs = $R - 30; + $Gs = $G - 30; + $Bs = $B - 30; + } + + if ($Border) { + $this->drawFilledRoundedRectangle($XPos + 1, $YPos + 1, $XPos + $MaxWidth + 1, $YPos + $MaxHeight + 1, 5, $Rs, $Gs, $Bs); + $this->drawFilledRoundedRectangle($XPos, $YPos, $XPos + $MaxWidth, $YPos + $MaxHeight, 5, $R, $G, $B); + } + + $YOffset = 4 + $this->FontSize; + $ID = 0; + foreach ($DataDescription["Description"] as $Key => $Value) { + $this->drawFilledRoundedRectangle($XPos + 10, $YPos + $YOffset - 4, $XPos + 14, $YPos + $YOffset - 4, 2, $this->Palette[$ID]["R"], $this->Palette[$ID]["G"], $this->Palette[$ID]["B"]); + imagettftext($this->Picture, $this->FontSize, 0, $XPos + 22, $YPos + $YOffset, $C_TextColor, $this->FontName, $Value); + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextHeight = $Position[1] - $Position[7]; + + $YOffset = $YOffset + $TextHeight + 4; + $ID++; + } + } + + /* Draw the data legends */ + function drawPieLegend($XPos, $YPos, $Data, $DataDescription, $R, $G, $B) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawPieLegend", $DataDescription, false); + $this->validateData("drawPieLegend", $Data); + + if (!isset($DataDescription["Position"])) { + return (-1); + } + + $C_TextColor = $this->AllocateColor($this->Picture, 0, 0, 0); + + /* <-10->[8]<-4->Text<-10-> */ + $MaxWidth = 0; + $MaxHeight = 8; + foreach ($Data as $Key => $Value) { + $Value2 = $Value[$DataDescription["Position"]]; + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value2); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = $Position[1] - $Position[7]; + if ($TextWidth > $MaxWidth) { + $MaxWidth = $TextWidth; + } + + $MaxHeight = $MaxHeight + $TextHeight + 4; + } + $MaxHeight = $MaxHeight - 3; + $MaxWidth = $MaxWidth + 32; + + $this->drawFilledRoundedRectangle($XPos + 1, $YPos + 1, $XPos + $MaxWidth + 1, $YPos + $MaxHeight + 1, 5, $R - 30, $G - 30, $B - 30); + $this->drawFilledRoundedRectangle($XPos, $YPos, $XPos + $MaxWidth, $YPos + $MaxHeight, 5, $R, $G, $B); + + $YOffset = 4 + $this->FontSize; + $ID = 0; + foreach ($Data as $Key => $Value) { + $Value2 = $Value[$DataDescription["Position"]]; + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value2); + $TextHeight = $Position[1] - $Position[7]; + $this->drawFilledRectangle($XPos + 10, $YPos + $YOffset - 6, $XPos + 14, $YPos + $YOffset - 2, $this->Palette[$ID]["R"], $this->Palette[$ID]["G"], $this->Palette[$ID]["B"]); + + imagettftext($this->Picture, $this->FontSize, 0, $XPos + 22, $YPos + $YOffset, $C_TextColor, $this->FontName, $Value2); + $YOffset = $YOffset + $TextHeight + 4; + $ID++; + } + } + + /* Draw the graph title */ + function drawTitle($XPos, $YPos, $Value, $R, $G, $B, $XPos2 = -1, $YPos2 = -1, $Shadow = false) + { + $C_TextColor = $this->AllocateColor($this->Picture, $R, $G, $B); + + if ($XPos2 != -1) { + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + $XPos = floor(($XPos2 - $XPos - $TextWidth) / 2) + $XPos; + } + + if ($YPos2 != -1) { + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Value); + $TextHeight = $Position[5] - $Position[3]; + $YPos = floor(($YPos2 - $YPos - $TextHeight) / 2) + $YPos; + } + + if ($Shadow) { + $C_ShadowColor = $this->AllocateColor($this->Picture, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor); + imagettftext($this->Picture, $this->FontSize, 0, $XPos + $this->ShadowXDistance, $YPos + $this->ShadowYDistance, $C_ShadowColor, $this->FontName, $Value); + } + + imagettftext($this->Picture, $this->FontSize, 0, $XPos, $YPos, $C_TextColor, $this->FontName, $Value); + } + + /* Draw a text box with text align & alpha properties */ + function drawTextBox($X1, $Y1, $X2, $Y2, $Text, $Angle = 0, $R = 255, $G = 255, $B = 255, $Align = ALIGN_LEFT, $Shadow = true, $BgR = -1, $BgG = -1, $BgB = -1, $Alpha = 100) + { + $Position = imageftbbox($this->FontSize, $Angle, $this->FontName, $Text); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = $Position[5] - $Position[3]; + $AreaWidth = $X2 - $X1; + $AreaHeight = $Y2 - $Y1; + + if ($BgR != -1 && $BgG != -1 && $BgB != -1) { + $this->drawFilledRectangle($X1, $Y1, $X2, $Y2, $BgR, $BgG, $BgB, false, $Alpha); + } + + if ($Align == ALIGN_TOP_LEFT) { + $X = $X1 + 1; + $Y = $Y1 + $this->FontSize + 1; + } + if ($Align == ALIGN_TOP_CENTER) { + $X = $X1 + ($AreaWidth / 2) - ($TextWidth / 2); + $Y = $Y1 + $this->FontSize + 1; + } + if ($Align == ALIGN_TOP_RIGHT) { + $X = $X2 - $TextWidth - 1; + $Y = $Y1 + $this->FontSize + 1; + } + if ($Align == ALIGN_LEFT) { + $X = $X1 + 1; + $Y = $Y1 + ($AreaHeight / 2) - ($TextHeight / 2); + } + if ($Align == ALIGN_CENTER) { + $X = $X1 + ($AreaWidth / 2) - ($TextWidth / 2); + $Y = $Y1 + ($AreaHeight / 2) - ($TextHeight / 2); + } + if ($Align == ALIGN_RIGHT) { + $X = $X2 - $TextWidth - 1; + $Y = $Y1 + ($AreaHeight / 2) - ($TextHeight / 2); + } + if ($Align == ALIGN_BOTTOM_LEFT) { + $X = $X1 + 1; + $Y = $Y2 - 1; + } + if ($Align == ALIGN_BOTTOM_CENTER) { + $X = $X1 + ($AreaWidth / 2) - ($TextWidth / 2); + $Y = $Y2 - 1; + } + if ($Align == ALIGN_BOTTOM_RIGHT) { + $X = $X2 - $TextWidth - 1; + $Y = $Y2 - 1; + } + + $C_TextColor = $this->AllocateColor($this->Picture, $R, $G, $B); + $C_ShadowColor = $this->AllocateColor($this->Picture, 0, 0, 0); + if ($Shadow) { + imagettftext($this->Picture, $this->FontSize, $Angle, $X + 1, $Y + 1, $C_ShadowColor, $this->FontName, $Text); + } + + imagettftext($this->Picture, $this->FontSize, $Angle, $X, $Y, $C_TextColor, $this->FontName, $Text); + } + + /* Compute and draw the scale */ + function drawTreshold($Value, $R, $G, $B, $ShowLabel = false, $ShowOnRight = false, $TickWidth = 4, $FreeText = null) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_TextColor = $this->AllocateColor($this->Picture, $R, $G, $B); + $Y = $this->GArea_Y2 - ($Value - $this->VMin) * $this->DivisionRatio; + + if ($Y <= $this->GArea_Y1 || $Y >= $this->GArea_Y2) { + return (-1); + } + + if ($TickWidth == 0) { + $this->drawLine($this->GArea_X1, $Y, $this->GArea_X2, $Y, $R, $G, $B); + } else { + $this->drawDottedLine($this->GArea_X1, $Y, $this->GArea_X2, $Y, $TickWidth, $R, $G, $B); + } + + if ($ShowLabel) { + if ($FreeText == null) { + $Label = $Value; + } else { + $Label = $FreeText; + } + + if ($ShowOnRight) { + imagettftext($this->Picture, $this->FontSize, 0, $this->GArea_X2 + 2, $Y + ($this->FontSize / 2), $C_TextColor, $this->FontName, $Label); + } else { + imagettftext($this->Picture, $this->FontSize, 0, $this->GArea_X1 + 2, $Y - ($this->FontSize / 2), $C_TextColor, $this->FontName, $Label); + } + } + } + + /* This function put a label on a specific point */ + function setLabel($Data, $DataDescription, $SerieName, $ValueName, $Caption, $R = 210, $G = 210, $B = 210) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("setLabel", $DataDescription); + $this->validateData("setLabel", $Data); + $ShadowFactor = 100; + $C_Label = $this->AllocateColor($this->Picture, $R, $G, $B); + $C_Shadow = $this->AllocateColor($this->Picture, $R - $ShadowFactor, $G - $ShadowFactor, $B - $ShadowFactor); + $C_TextColor = $this->AllocateColor($this->Picture, 0, 0, 0); + + $Cp = 0; + $Found = false; + foreach ($Data as $Key => $Value) { + if ($Data[$Key][$DataDescription["Position"]] == $ValueName) { + $NumericalValue = $Data[$Key][$SerieName]; + $Found = true; + } + if (!$Found) { + $Cp++; + } + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset + ($this->DivisionWidth * $Cp) + 2; + $YPos = $this->GArea_Y2 - ($NumericalValue - $this->VMin) * $this->DivisionRatio; + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Caption); + $TextHeight = $Position[3] - $Position[5]; + $TextWidth = $Position[2] - $Position[0] + 2; + $TextOffset = floor($TextHeight / 2); + + // Shadow + $Poly = array($XPos + 1, $YPos + 1, $XPos + 9, $YPos - $TextOffset, $XPos + 8, $YPos + $TextOffset + 2); + imagefilledpolygon($this->Picture, $Poly, 3, $C_Shadow); + $this->drawLine($XPos, $YPos + 1, $XPos + 9, $YPos - $TextOffset - .2, $R - $ShadowFactor, $G - $ShadowFactor, $B - $ShadowFactor); + $this->drawLine($XPos, $YPos + 1, $XPos + 9, $YPos + $TextOffset + 2.2, $R - $ShadowFactor, $G - $ShadowFactor, $B - $ShadowFactor); + $this->drawFilledRectangle($XPos + 9, $YPos - $TextOffset - .2, $XPos + 13 + $TextWidth, $YPos + $TextOffset + 2.2, $R - $ShadowFactor, $G - $ShadowFactor, $B - $ShadowFactor); + + // Label background + $Poly = array($XPos, $YPos, $XPos + 8, $YPos - $TextOffset - 1, $XPos + 8, $YPos + $TextOffset + 1); + imagefilledpolygon($this->Picture, $Poly, 3, $C_Label); + $this->drawLine($XPos - 1, $YPos, $XPos + 8, $YPos - $TextOffset - 1.2, $R, $G, $B); + $this->drawLine($XPos - 1, $YPos, $XPos + 8, $YPos + $TextOffset + 1.2, $R, $G, $B); + $this->drawFilledRectangle($XPos + 8, $YPos - $TextOffset - 1.2, $XPos + 12 + $TextWidth, $YPos + $TextOffset + 1.2, $R, $G, $B); + + imagettftext($this->Picture, $this->FontSize, 0, $XPos + 10, $YPos + $TextOffset, $C_TextColor, $this->FontName, $Caption); + } + + /* This function draw a plot graph */ + function drawPlotGraph($Data, $DataDescription, $BigRadius = 5, $SmallRadius = 2, $R2 = -1, $G2 = -1, $B2 = -1, $Shadow = false) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawPlotGraph", $DataDescription); + $this->validateData("drawPlotGraph", $Data); + + $GraphID = 0; + $Ro = $R2; + $Go = $G2; + $Bo = $B2; + + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $R = $this->Palette[$ColorID]["R"]; + $G = $this->Palette[$ColorID]["G"]; + $B = $this->Palette[$ColorID]["B"]; + $R2 = $Ro; + $G2 = $Go; + $B2 = $Bo; + + if (isset($DataDescription["Symbol"][$ColName])) { + $Is_Alpha = ((ord(file_get_contents($DataDescription["Symbol"][$ColName], false, null, 25, 1)) & 6) & 4) == 4; + + $Infos = getimagesize($DataDescription["Symbol"][$ColName]); + $ImageWidth = $Infos[0]; + $ImageHeight = $Infos[1]; + $Symbol = imagecreatefromgif($DataDescription["Symbol"][$ColName]); + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + $Hsize = round($BigRadius / 2); + $R3 = -1; + $G3 = -1; + $B3 = -1; + foreach ($Data as $Key => $Values) { + $Value = $Data[$Key][$ColName]; + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($XPos - $Hsize, $YPos - $Hsize, $XPos + 1 + $Hsize, $YPos + $Hsize + 1, $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "Plot"); + } + + if (is_numeric($Value)) { + if (!isset($DataDescription["Symbol"][$ColName])) { + + if ($Shadow) { + if ($R3 != -1 && $G3 != -1 && $B3 != -1) { + $this->drawFilledCircle($XPos + 2, $YPos + 2, $BigRadius, $R3, $G3, $B3); + } else { + $R3 = $this->Palette[$ColorID]["R"] - 20; + if ($R3 < 0) { + $R3 = 0; + } + $G3 = $this->Palette[$ColorID]["G"] - 20; + if ($G3 < 0) { + $G3 = 0; + } + $B3 = $this->Palette[$ColorID]["B"] - 20; + if ($B3 < 0) { + $B3 = 0; + } + $this->drawFilledCircle($XPos + 2, $YPos + 2, $BigRadius, $R3, $G3, $B3); + } + } + + $this->drawFilledCircle($XPos + 1, $YPos + 1, $BigRadius, $R, $G, $B); + + if ($SmallRadius != 0) { + if ($R2 != -1 && $G2 != -1 && $B2 != -1) { + $this->drawFilledCircle($XPos + 1, $YPos + 1, $SmallRadius, $R2, $G2, $B2); + } else { + $R2 = $this->Palette[$ColorID]["R"] - 15; + if ($R2 < 0) { + $R2 = 0; + } + $G2 = $this->Palette[$ColorID]["G"] - 15; + if ($G2 < 0) { + $G2 = 0; + } + $B2 = $this->Palette[$ColorID]["B"] - 15; + if ($B2 < 0) { + $B2 = 0; + } + + $this->drawFilledCircle($XPos + 1, $YPos + 1, $SmallRadius, $R2, $G2, $B2); + } + } + } else { + imagecopymerge($this->Picture, $Symbol, $XPos + 1 - $ImageWidth / 2, $YPos + 1 - $ImageHeight / 2, 0, 0, $ImageWidth, $ImageHeight, 100); + } + } + + $XPos = $XPos + $this->DivisionWidth; + } + $GraphID++; + } + } + + /* This function draw a plot graph in an X/Y space */ + function drawXYPlotGraph($Data, $DataDescription, $YSerieName, $XSerieName, $PaletteID = 0, $BigRadius = 5, $SmallRadius = 2, $R2 = -1, $G2 = -1, $B2 = -1, $Shadow = true) + { + $R = $this->Palette[$PaletteID]["R"]; + $G = $this->Palette[$PaletteID]["G"]; + $B = $this->Palette[$PaletteID]["B"]; + $R3 = -1; + $G3 = -1; + $B3 = -1; + + $YLast = -1; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$YSerieName]) && isset($Data[$Key][$XSerieName])) { + $X = $Data[$Key][$XSerieName]; + $Y = $Data[$Key][$YSerieName]; + + $Y = $this->GArea_Y2 - (($Y - $this->VMin) * $this->DivisionRatio); + $X = $this->GArea_X1 + (($X - $this->VXMin) * $this->XDivisionRatio); + + + if ($Shadow) { + if ($R3 != -1 && $G3 != -1 && $B3 != -1) { + $this->drawFilledCircle($X + 2, $Y + 2, $BigRadius, $R3, $G3, $B3); + } else { + $R3 = $this->Palette[$PaletteID]["R"] - 20; + if ($R < 0) { + $R = 0; + } + $G3 = $this->Palette[$PaletteID]["G"] - 20; + if ($G < 0) { + $G = 0; + } + $B3 = $this->Palette[$PaletteID]["B"] - 20; + if ($B < 0) { + $B = 0; + } + $this->drawFilledCircle($X + 2, $Y + 2, $BigRadius, $R3, $G3, $B3); + } + } + + $this->drawFilledCircle($X + 1, $Y + 1, $BigRadius, $R, $G, $B); + + if ($R2 != -1 && $G2 != -1 && $B2 != -1) { + $this->drawFilledCircle($X + 1, $Y + 1, $SmallRadius, $R2, $G2, $B2); + } else { + $R2 = $this->Palette[$PaletteID]["R"] + 20; + if ($R > 255) { + $R = 255; + } + $G2 = $this->Palette[$PaletteID]["G"] + 20; + if ($G > 255) { + $G = 255; + } + $B2 = $this->Palette[$PaletteID]["B"] + 20; + if ($B > 255) { + $B = 255; + } + $this->drawFilledCircle($X + 1, $Y + 1, $SmallRadius, $R2, $G2, $B2); + } + } + } + + } + + /* This function draw an area between two series */ + function drawArea($Data, $Serie1, $Serie2, $R, $G, $B, $Alpha = 50) + { + /* Validate the Data and DataDescription array */ + $this->validateData("drawArea", $Data); + + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $C_Graph = $this->AllocateColor($this->Layers[0], $R, $G, $B); + + $XPos = $this->GAreaXOffset; + $LastXPos = -1; + foreach ($Data as $Key => $Values) { + $Value1 = $Data[$Key][$Serie1]; + $Value2 = $Data[$Key][$Serie2]; + $YPos1 = $LayerHeight - (($Value1 - $this->VMin) * $this->DivisionRatio); + $YPos2 = $LayerHeight - (($Value2 - $this->VMin) * $this->DivisionRatio); + + if ($LastXPos != -1) { + $Points = array(); + $Points[] = $LastXPos; + $Points[] = $LastYPos1; + $Points[] = $LastXPos; + $Points[] = $LastYPos2; + $Points[] = $XPos; + $Points[] = $YPos2; + $Points[] = $XPos; + $Points[] = $YPos1; + + imagefilledpolygon($this->Layers[0], $Points, 4, $C_Graph); + } + + $LastYPos1 = $YPos1; + $LastYPos2 = $YPos2; + $LastXPos = $XPos; + + $XPos = $XPos + $this->DivisionWidth; + } + + imagecopymerge($this->Picture, $this->Layers[0], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + } + + + /* This function write the values of the specified series */ + function writeValues($Data, $DataDescription, $Series) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("writeValues", $DataDescription); + $this->validateData("writeValues", $Data); + + if (!is_array($Series)) { + $Series = array($Series); + } + + foreach ($Series as $Key => $Serie) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $Serie) { + $ColorID = $ID; + }; + $ID++; + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$Serie]) && is_numeric($Data[$Key][$Serie])) { + $Value = $Data[$Key][$Serie]; + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + + $Positions = imagettfbbox($this->FontSize, 0, $this->FontName, $Value); + $Width = $Positions[2] - $Positions[6]; + $XOffset = $XPos - ($Width / 2); + $Height = $Positions[3] - $Positions[7]; + $YOffset = $YPos - 4; + + $C_TextColor = $this->AllocateColor($this->Picture, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagettftext($this->Picture, $this->FontSize, 0, $XOffset, $YOffset, $C_TextColor, $this->FontName, $Value); + } + $XPos = $XPos + $this->DivisionWidth; + } + + } + } + + /* This function draw a line graph */ + function drawLineGraph($Data, $DataDescription, $SerieName = "") + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawLineGraph", $DataDescription); + $this->validateData("drawLineGraph", $Data); + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + if ($SerieName == "" || $SerieName == $ColName) { + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($XPos - 3, $YPos - 3, $XPos + 3, $YPos + 3, $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "Line"); + } + + if (!is_numeric($Value)) { + $XLast = -1; + } + if ($XLast != -1) { + $this->drawLine($XLast, $YLast, $XPos, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true); + } + + $XLast = $XPos; + $YLast = $YPos; + if (!is_numeric($Value)) { + $XLast = -1; + } + } + $XPos = $XPos + $this->DivisionWidth; + } + $GraphID++; + } + } + } + + /* This function draw a line graph */ + function drawXYGraph($Data, $DataDescription, $YSerieName, $XSerieName, $PaletteID = 0) + { + $YLast = -1; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$YSerieName]) && isset($Data[$Key][$XSerieName])) { + $X = $Data[$Key][$XSerieName]; + $Y = $Data[$Key][$YSerieName]; + + $Y = $this->GArea_Y2 - (($Y - $this->VMin) * $this->DivisionRatio); + $X = $this->GArea_X1 + (($X - $this->VXMin) * $this->XDivisionRatio); + + if ($XLast != -1 && $YLast != -1) { + $this->drawLine($XLast, $YLast, $X, $Y, $this->Palette[$PaletteID]["R"], $this->Palette[$PaletteID]["G"], $this->Palette[$PaletteID]["B"], true); + } + + $XLast = $X; + $YLast = $Y; + } + } + } + + /* This function draw a cubic curve */ + function drawCubicCurve($Data, $DataDescription, $Accuracy = .1, $SerieName = "") + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawCubicCurve", $DataDescription); + $this->validateData("drawCubicCurve", $Data); + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if ($SerieName == "" || $SerieName == $ColName) { + $XIn = array(); + $Yin = array(); + $Yt = array(); + $U = array(); + $XIn[0] = 0; + $YIn[0] = 0; + + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $Index = 1; + $XLast = -1; + $Missing = array(); + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + $XIn[$Index] = $Index; + $YIn[$Index] = $Value; + if (!is_numeric($Value)) { + $Missing[$Index] = true; + } + $Index++; + } + } + $Index--; + + $Yt[0] = 0; + $Yt[1] = 0; + $U[1] = 0; + for ($i = 2; $i <= $Index - 1; $i++) { + $Sig = ($XIn[$i] - $XIn[$i - 1]) / ($XIn[$i + 1] - $XIn[$i - 1]); + $p = $Sig * $Yt[$i - 1] + 2; + $Yt[$i] = ($Sig - 1) / $p; + $U[$i] = ($YIn[$i + 1] - $YIn[$i]) / ($XIn[$i + 1] - $XIn[$i]) - ($YIn[$i] - $YIn[$i - 1]) / ($XIn[$i] - $XIn[$i - 1]); + $U[$i] = (6 * $U[$i] / ($XIn[$i + 1] - $XIn[$i - 1]) - $Sig * $U[$i - 1]) / $p; + } + + $qn = 0; + $un = 0; + $Yt[$Index] = ($un - $qn * $U[$Index - 1]) / ($qn * $Yt[$Index - 1] + 1); + + for ($k = $Index - 1; $k >= 1; $k--) { + $Yt[$k] = $Yt[$k] * $Yt[$k + 1] + $U[$k]; + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + for ($X = 1; $X <= $Index; $X = $X + $Accuracy) { + $klo = 1; + $khi = $Index; + $k = $khi - $klo; + while ($k > 1) { + $k = $khi - $klo; + if ($XIn[$k] >= $X) { + $khi = $k; + } else { + $klo = $k; + } + } + $klo = $khi - 1; + + $h = $XIn[$khi] - $XIn[$klo]; + $a = ($XIn[$khi] - $X) / $h; + $b = ($X - $XIn[$klo]) / $h; + $Value = $a * $YIn[$klo] + $b * $YIn[$khi] + (($a * $a * $a - $a) * $Yt[$klo] + ($b * $b * $b - $b) * $Yt[$khi]) * ($h * $h) / 6; + + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + + if ($XLast != -1 && !isset($Missing[floor($X)]) && !isset($Missing[floor($X + 1)])) { + $this->drawLine($XLast, $YLast, $XPos, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true); + } + + $XLast = $XPos; + $YLast = $YPos; + $XPos = $XPos + $this->DivisionWidth * $Accuracy; + } + + // Add potentialy missing values + $XPos = $XPos - $this->DivisionWidth * $Accuracy; + if ($XPos < ($this->GArea_X2 - $this->GAreaXOffset)) { + $YPos = $this->GArea_Y2 - (($YIn[$Index] - $this->VMin) * $this->DivisionRatio); + $this->drawLine($XLast, $YLast, $this->GArea_X2 - $this->GAreaXOffset, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true); + } + + $GraphID++; + } + } + } + + /* This function draw a filled cubic curve */ + function drawFilledCubicCurve($Data, $DataDescription, $Accuracy = .1, $Alpha = 100, $AroundZero = false) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawFilledCubicCurve", $DataDescription); + $this->validateData("drawFilledCubicCurve", $Data); + + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio); + if ($YZero > $LayerHeight) { + $YZero = $LayerHeight; + } + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $XIn = array(); + $Yin = array(); + $Yt = array(); + $U = array(); + $XIn[0] = 0; + $YIn[0] = 0; + + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $Index = 1; + $XLast = -1; + $Missing = array(); + foreach ($Data as $Key => $Values) { + $Value = $Data[$Key][$ColName]; + $XIn[$Index] = $Index; + $YIn[$Index] = $Value; + if (!is_numeric($Value)) { + $Missing[$Index] = true; + } + $Index++; + } + $Index--; + + $Yt[0] = 0; + $Yt[1] = 0; + $U[1] = 0; + for ($i = 2; $i <= $Index - 1; $i++) { + $Sig = ($XIn[$i] - $XIn[$i - 1]) / ($XIn[$i + 1] - $XIn[$i - 1]); + $p = $Sig * $Yt[$i - 1] + 2; + $Yt[$i] = ($Sig - 1) / $p; + $U[$i] = ($YIn[$i + 1] - $YIn[$i]) / ($XIn[$i + 1] - $XIn[$i]) - ($YIn[$i] - $YIn[$i - 1]) / ($XIn[$i] - $XIn[$i - 1]); + $U[$i] = (6 * $U[$i] / ($XIn[$i + 1] - $XIn[$i - 1]) - $Sig * $U[$i - 1]) / $p; + } + + $qn = 0; + $un = 0; + $Yt[$Index] = ($un - $qn * $U[$Index - 1]) / ($qn * $Yt[$Index - 1] + 1); + + for ($k = $Index - 1; $k >= 1; $k--) { + $Yt[$k] = $Yt[$k] * $Yt[$k + 1] + $U[$k]; + } + + $Points = array(); + $Points[] = $this->GAreaXOffset; + $Points[] = $LayerHeight; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $YLast = null; + $XPos = $this->GAreaXOffset; + $PointsCount = 2; + for ($X = 1; $X <= $Index; $X = $X + $Accuracy) { + $klo = 1; + $khi = $Index; + $k = $khi - $klo; + while ($k > 1) { + $k = $khi - $klo; + if ($XIn[$k] >= $X) { + $khi = $k; + } else { + $klo = $k; + } + } + $klo = $khi - 1; + + $h = $XIn[$khi] - $XIn[$klo]; + $a = ($XIn[$khi] - $X) / $h; + $b = ($X - $XIn[$klo]) / $h; + $Value = $a * $YIn[$klo] + $b * $YIn[$khi] + (($a * $a * $a - $a) * $Yt[$klo] + ($b * $b * $b - $b) * $Yt[$khi]) * ($h * $h) / 6; + + $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio); + + if ($YLast != null && $AroundZero && !isset($Missing[floor($X)]) && !isset($Missing[floor($X + 1)])) { + $aPoints = array(); + $aPoints[] = $XLast; + $aPoints[] = $YLast; + $aPoints[] = $XPos; + $aPoints[] = $YPos; + $aPoints[] = $XPos; + $aPoints[] = $YZero; + $aPoints[] = $XLast; + $aPoints[] = $YZero; + + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $aPoints, 4, $C_Graph); + } + + if (!isset($Missing[floor($X)]) || $YLast == null) { + $PointsCount++; + $Points[] = $XPos; + $Points[] = $YPos; + } else { + $PointsCount++; + $Points[] = $XLast; + $Points[] = $LayerHeight; + } + + $YLast = $YPos; + $XLast = $XPos; + $XPos = $XPos + $this->DivisionWidth * $Accuracy; + } + + // Add potentialy missing values + $XPos = $XPos - $this->DivisionWidth * $Accuracy; + if ($XPos < ($LayerWidth - $this->GAreaXOffset)) { + $YPos = $LayerHeight - (($YIn[$Index] - $this->VMin) * $this->DivisionRatio); + + if ($YLast != null && $AroundZero) { + $aPoints = array(); + $aPoints[] = $XLast; + $aPoints[] = $YLast; + $aPoints[] = $LayerWidth - $this->GAreaXOffset; + $aPoints[] = $YPos; + $aPoints[] = $LayerWidth - $this->GAreaXOffset; + $aPoints[] = $YZero; + $aPoints[] = $XLast; + $aPoints[] = $YZero; + + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $aPoints, 4, $C_Graph); + } + + if ($YIn[$klo] != "" && $YIn[$khi] != "" || $YLast == null) { + $PointsCount++; + $Points[] = $LayerWidth - $this->GAreaXOffset; + $Points[] = $YPos; + } + } + + $Points[] = $LayerWidth - $this->GAreaXOffset; + $Points[] = $LayerHeight; + + if (!$AroundZero) { + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $Points, $PointsCount, $C_Graph); + } + + imagecopymerge($this->Picture, $this->Layers[0], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + + $this->drawCubicCurve($Data, $DataDescription, $Accuracy, $ColName); + + $GraphID++; + } + } + + /* This function draw a filled line graph */ + function drawFilledLineGraph($Data, $DataDescription, $Alpha = 100, $AroundZero = false) + { + $Empty = -2147483647; + + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawFilledLineGraph", $DataDescription); + $this->validateData("drawFilledLineGraph", $Data); + + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $aPoints = array(); + $aPoints[] = $this->GAreaXOffset; + $aPoints[] = $LayerHeight; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $XPos = $this->GAreaXOffset; + $XLast = -1; + $PointsCount = 2; + $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio); + if ($YZero > $LayerHeight) { + $YZero = $LayerHeight; + } + + $YLast = $Empty; + foreach ($Data as $Key => $Values) { + $Value = $Data[$Key][$ColName]; + $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio); + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($XPos - 3, $YPos - 3, $XPos + 3, $YPos + 3, $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "FLine"); + } + + if (!is_numeric($Value)) { + $PointsCount++; + $aPoints[] = $XLast; + $aPoints[] = $LayerHeight; + + $YLast = $Empty; + } else { + $PointsCount++; + if ($YLast <> $Empty) { + $aPoints[] = $XPos; + $aPoints[] = $YPos; + } else { + $PointsCount++; + $aPoints[] = $XPos; + $aPoints[] = $LayerHeight; + $aPoints[] = $XPos; + $aPoints[] = $YPos; + } + + if ($YLast <> $Empty && $AroundZero) { + $Points = array(); + $Points[] = $XLast; + $Points[] = $YLast; + $Points[] = $XPos; + $Points[] = $YPos; + $Points[] = $XPos; + $Points[] = $YZero; + $Points[] = $XLast; + $Points[] = $YZero; + + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $Points, 4, $C_Graph); + } + $YLast = $YPos; + } + + $XLast = $XPos; + $XPos = $XPos + $this->DivisionWidth; + } + $aPoints[] = $LayerWidth - $this->GAreaXOffset; + $aPoints[] = $LayerHeight; + + if ($AroundZero == false) { + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $aPoints, $PointsCount, $C_Graph); + } + + imagecopymerge($this->Picture, $this->Layers[0], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + $GraphID++; + $this->drawLineGraph($Data, $DataDescription, $ColName); + } + } + + /* This function draw a bar graph */ + function drawOverlayBarGraph($Data, $DataDescription, $Alpha = 50) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawOverlayBarGraph", $DataDescription); + $this->validateData("drawOverlayBarGraph", $Data); + + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $this->Layers[$GraphID] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[$GraphID], 255, 255, 255); + $C_Graph = $this->AllocateColor($this->Layers[$GraphID], $this->Palette[$GraphID]["R"], $this->Palette[$GraphID]["G"], $this->Palette[$GraphID]["B"]); + imagefilledrectangle($this->Layers[$GraphID], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[$GraphID], $C_White); + + $XWidth = $this->DivisionWidth / 4; + $XPos = $this->GAreaXOffset; + $YZero = $LayerHeight - ((0 - $this->VMin) * $this->DivisionRatio); + $XLast = -1; + $PointsCount = 2; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + if (is_numeric($Value)) { + $YPos = $LayerHeight - (($Value - $this->VMin) * $this->DivisionRatio); + + imagefilledrectangle($this->Layers[$GraphID], $XPos - $XWidth, $YPos, $XPos + $XWidth, $YZero, $C_Graph); + + $X1 = floor($XPos - $XWidth + $this->GArea_X1); + $Y1 = floor($YPos + $this->GArea_Y1) + .2; + $X2 = floor($XPos + $XWidth + $this->GArea_X1); + $Y2 = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio); + if ($X1 <= $this->GArea_X1) { + $X1 = $this->GArea_X1 + 1; + } + if ($X2 >= $this->GArea_X2) { + $X2 = $this->GArea_X2 - 1; + } + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($X1, min($Y1, $Y2), $X2, max($Y1, $Y2), $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "oBar"); + } + + $this->drawLine($X1, $Y1, $X2, $Y1, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true); + } + } + $XPos = $XPos + $this->DivisionWidth; + } + + $GraphID++; + } + + for ($i = 0; $i <= ($GraphID - 1); $i++) { + imagecopymerge($this->Picture, $this->Layers[$i], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[$i]); + } + } + + /* This function draw a bar graph */ + function drawBarGraph($Data, $DataDescription, $Shadow = false, $Alpha = 100) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawBarGraph", $DataDescription); + $this->validateData("drawBarGraph", $Data); + + $GraphID = 0; + $Series = count($DataDescription["Values"]); + $SeriesWidth = $this->DivisionWidth / ($Series + 1); + $SerieXOffset = $this->DivisionWidth / 2 - $SeriesWidth / 2; + + $YZero = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio); + if ($YZero > $this->GArea_Y2) { + $YZero = $this->GArea_Y2; + } + + $SerieID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SerieXOffset + $SeriesWidth * $SerieID; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if (is_numeric($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($XPos + 1, min($YZero, $YPos), $XPos + $SeriesWidth - 1, max($YZero, $YPos), $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "Bar"); + } + + if ($Shadow && $Alpha == 100) { + $this->drawRectangle($XPos + 1, $YZero, $XPos + $SeriesWidth - 1, $YPos, 25, 25, 25, true, $Alpha); + } + + $this->drawFilledRectangle($XPos + 1, $YZero, $XPos + $SeriesWidth - 1, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true, $Alpha); + } + } + $XPos = $XPos + $this->DivisionWidth; + } + $SerieID++; + } + } + + /* This function draw a stacked bar graph */ + function drawStackedBarGraph($Data, $DataDescription, $Alpha = 50, $Contiguous = false) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawBarGraph", $DataDescription); + $this->validateData("drawBarGraph", $Data); + + $GraphID = 0; + $Series = count($DataDescription["Values"]); + if ($Contiguous) { + $SeriesWidth = $this->DivisionWidth; + } else { + $SeriesWidth = $this->DivisionWidth * .8; + } + + $YZero = $this->GArea_Y2 - ((0 - $this->VMin) * $this->DivisionRatio); + if ($YZero > $this->GArea_Y2) { + $YZero = $this->GArea_Y2; + } + + $SerieID = 0; + $LastValue = array(); + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $XPos = $this->GArea_X1 + $this->GAreaXOffset - $SeriesWidth / 2; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if (is_numeric($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + + if (isset($LastValue[$Key])) { + $YPos = $this->GArea_Y2 - ((($Value + $LastValue[$Key]) - $this->VMin) * $this->DivisionRatio); + $YBottom = $this->GArea_Y2 - (($LastValue[$Key] - $this->VMin) * $this->DivisionRatio); + $LastValue[$Key] += $Value; + } else { + $YPos = $this->GArea_Y2 - (($Value - $this->VMin) * $this->DivisionRatio); + $YBottom = $YZero; + $LastValue[$Key] = $Value; + } + + /* Save point into the image map if option activated */ + if ($this->BuildMap) { + $this->addToImageMap($XPos + 1, min($YBottom, $YPos), $XPos + $SeriesWidth - 1, max($YBottom, $YPos), $DataDescription["Description"][$ColName], $Data[$Key][$ColName] . $DataDescription["Unit"]["Y"], "sBar"); + } + + $this->drawFilledRectangle($XPos + 1, $YBottom, $XPos + $SeriesWidth - 1, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"], true, $Alpha); + } + } + $XPos = $XPos + $this->DivisionWidth; + } + $SerieID++; + } + } + + /* This function draw a limits bar graphs */ + function drawLimitsGraph($Data, $DataDescription, $R = 0, $G = 0, $B = 0) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawLimitsGraph", $DataDescription); + $this->validateData("drawLimitsGraph", $Data); + + $XWidth = $this->DivisionWidth / 4; + $XPos = $this->GArea_X1 + $this->GAreaXOffset; + + foreach ($Data as $Key => $Values) { + $Min = $Data[$Key][$DataDescription["Values"][0]]; + $Max = $Data[$Key][$DataDescription["Values"][0]]; + $GraphID = 0; + $MaxID = 0; + $MinID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if (isset($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] > $Max && is_numeric($Data[$Key][$ColName])) { + $Max = $Data[$Key][$ColName]; + $MaxID = $GraphID; + } + } + if (isset($Data[$Key][$ColName]) && is_numeric($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] < $Min) { + $Min = $Data[$Key][$ColName]; + $MinID = $GraphID; + } + $GraphID++; + } + } + + $YPos = $this->GArea_Y2 - (($Max - $this->VMin) * $this->DivisionRatio); + $X1 = floor($XPos - $XWidth); + $Y1 = floor($YPos) - .2; + $X2 = floor($XPos + $XWidth); + if ($X1 <= $this->GArea_X1) { + $X1 = $this->GArea_X1 + 1; + } + if ($X2 >= $this->GArea_X2) { + $X2 = $this->GArea_X2 - 1; + } + + $YPos = $this->GArea_Y2 - (($Min - $this->VMin) * $this->DivisionRatio); + $Y2 = floor($YPos) + .2; + + $this->drawLine(floor($XPos) - .2, $Y1 + 1, floor($XPos) - .2, $Y2 - 1, $R, $G, $B, true); + $this->drawLine(floor($XPos) + .2, $Y1 + 1, floor($XPos) + .2, $Y2 - 1, $R, $G, $B, true); + $this->drawLine($X1, $Y1, $X2, $Y1, $this->Palette[$MaxID]["R"], $this->Palette[$MaxID]["G"], $this->Palette[$MaxID]["B"], false); + $this->drawLine($X1, $Y2, $X2, $Y2, $this->Palette[$MinID]["R"], $this->Palette[$MinID]["G"], $this->Palette[$MinID]["B"], false); + + $XPos = $XPos + $this->DivisionWidth; + } + } + + /* This function draw radar axis centered on the graph area */ + function drawRadarAxis($Data, $DataDescription, $Mosaic = true, $BorderOffset = 10, $A_R = 60, $A_G = 60, $A_B = 60, $S_R = 200, $S_G = 200, $S_B = 200, $MaxValue = -1) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawRadarAxis", $DataDescription); + $this->validateData("drawRadarAxis", $Data); + + $C_TextColor = $this->AllocateColor($this->Picture, $A_R, $A_G, $A_B); + + /* Draw radar axis */ + $Points = count($Data); + $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset; + $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2 + $this->GArea_X1; + $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2 + $this->GArea_Y1; + + /* Search for the max value */ + if ($MaxValue == -1) { + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] > $MaxValue) { + $MaxValue = $Data[$Key][$ColName]; + } + } + } + } + } + + /* Draw the mosaic */ + if ($Mosaic) { + $RadiusScale = $Radius / $MaxValue; + for ($t = 1; $t <= $MaxValue - 1; $t++) { + $TRadius = $RadiusScale * $t; + $LastX1 = -1; + + for ($i = 0; $i <= $Points; $i++) { + $Angle = -90 + $i * 360 / $Points; + $X1 = cos($Angle * 3.1418 / 180) * $TRadius + $XCenter; + $Y1 = sin($Angle * 3.1418 / 180) * $TRadius + $YCenter; + $X2 = cos($Angle * 3.1418 / 180) * ($TRadius + $RadiusScale) + $XCenter; + $Y2 = sin($Angle * 3.1418 / 180) * ($TRadius + $RadiusScale) + $YCenter; + + if ($t % 2 == 1 && $LastX1 != -1) { + $Plots = array(); + $Plots[] = $X1; + $Plots[] = $Y1; + $Plots[] = $X2; + $Plots[] = $Y2; + $Plots[] = $LastX2; + $Plots[] = $LastY2; + $Plots[] = $LastX1; + $Plots[] = $LastY1; + + $C_Graph = $this->AllocateColor($this->Picture, 250, 250, 250); + imagefilledpolygon($this->Picture, $Plots, (count($Plots) + 1) / 2, $C_Graph); + } + + $LastX1 = $X1; + $LastY1 = $Y1; + $LastX2 = $X2; + $LastY2 = $Y2; + } + } + } + + + /* Draw the spider web */ + for ($t = 1; $t <= $MaxValue; $t++) { + $TRadius = ($Radius / $MaxValue) * $t; + $LastX = -1; + + for ($i = 0; $i <= $Points; $i++) { + $Angle = -90 + $i * 360 / $Points; + $X = cos($Angle * 3.1418 / 180) * $TRadius + $XCenter; + $Y = sin($Angle * 3.1418 / 180) * $TRadius + $YCenter; + + if ($LastX != -1) { + $this->drawDottedLine($LastX, $LastY, $X, $Y, 4, $S_R, $S_G, $S_B); + } + + $LastX = $X; + $LastY = $Y; + } + } + + /* Draw the axis */ + for ($i = 0; $i <= $Points; $i++) { + $Angle = -90 + $i * 360 / $Points; + $X = cos($Angle * 3.1418 / 180) * $Radius + $XCenter; + $Y = sin($Angle * 3.1418 / 180) * $Radius + $YCenter; + + $this->drawLine($XCenter, $YCenter, $X, $Y, $A_R, $A_G, $A_B); + + $XOffset = 0; + $YOffset = 0; + if (isset($Data[$i][$DataDescription["Position"]])) { + $Label = $Data[$i][$DataDescription["Position"]]; + + $Positions = imagettfbbox($this->FontSize, 0, $this->FontName, $Label); + $Width = $Positions[2] - $Positions[6]; + $Height = $Positions[3] - $Positions[7]; + + if ($Angle >= 0 && $Angle <= 90) { + $YOffset = $Height; + } + + if ($Angle > 90 && $Angle <= 180) { + $YOffset = $Height; + $XOffset = -$Width; + } + + if ($Angle > 180 && $Angle <= 270) { + $XOffset = -$Width; + } + + imagettftext($this->Picture, $this->FontSize, 0, $X + $XOffset, $Y + $YOffset, $C_TextColor, $this->FontName, $Label); + } + } + + /* Write the values */ + for ($t = 1; $t <= $MaxValue; $t++) { + $TRadius = ($Radius / $MaxValue) * $t; + + $Angle = -90 + 360 / $Points; + $X1 = $XCenter; + $Y1 = $YCenter - $TRadius; + $X2 = cos($Angle * 3.1418 / 180) * $TRadius + $XCenter; + $Y2 = sin($Angle * 3.1418 / 180) * $TRadius + $YCenter; + + $XPos = floor(($X2 - $X1) / 2) + $X1; + $YPos = floor(($Y2 - $Y1) / 2) + $Y1; + + $Positions = imagettfbbox($this->FontSize, 0, $this->FontName, $t); + $X = $XPos - ($X + $Positions[2] - $X + $Positions[6]) / 2; + $Y = $YPos + $this->FontSize; + + $this->drawFilledRoundedRectangle($X + $Positions[6] - 2, $Y + $Positions[7] - 1, $X + $Positions[2] + 4, $Y + $Positions[3] + 1, 2, 240, 240, 240); + $this->drawRoundedRectangle($X + $Positions[6] - 2, $Y + $Positions[7] - 1, $X + $Positions[2] + 4, $Y + $Positions[3] + 1, 2, 220, 220, 220); + imagettftext($this->Picture, $this->FontSize, 0, $X, $Y, $C_TextColor, $this->FontName, $t); + } + } + + /* This function draw a radar graph centered on the graph area */ + function drawRadar($Data, $DataDescription, $BorderOffset = 10, $MaxValue = -1) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawRadar", $DataDescription); + $this->validateData("drawRadar", $Data); + + $Points = count($Data); + $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset; + $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2 + $this->GArea_X1; + $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2 + $this->GArea_Y1; + + /* Search for the max value */ + if ($MaxValue == -1) { + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] > $MaxValue) { + $MaxValue = $Data[$Key][$ColName]; + } + } + } + } + } + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $Angle = -90; + $XLast = -1; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + $Strength = ($Radius / $MaxValue) * $Value; + + $XPos = cos($Angle * 3.1418 / 180) * $Strength + $XCenter; + $YPos = sin($Angle * 3.1418 / 180) * $Strength + $YCenter; + + if ($XLast != -1) { + $this->drawLine($XLast, $YLast, $XPos, $YPos, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + } + + if ($XLast == -1) { + $FirstX = $XPos; + $FirstY = $YPos; + } + + $Angle = $Angle + (360 / $Points); + $XLast = $XPos; + $YLast = $YPos; + } + } + $this->drawLine($XPos, $YPos, $FirstX, $FirstY, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + $GraphID++; + } + } + + /* This function draw a radar graph centered on the graph area */ + function drawFilledRadar($Data, $DataDescription, $Alpha = 50, $BorderOffset = 10, $MaxValue = -1) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawFilledRadar", $DataDescription); + $this->validateData("drawFilledRadar", $Data); + + $Points = count($Data); + $LayerWidth = $this->GArea_X2 - $this->GArea_X1; + $LayerHeight = $this->GArea_Y2 - $this->GArea_Y1; + $Radius = ($this->GArea_Y2 - $this->GArea_Y1) / 2 - $BorderOffset; + $XCenter = ($this->GArea_X2 - $this->GArea_X1) / 2; + $YCenter = ($this->GArea_Y2 - $this->GArea_Y1) / 2; + + /* Search for the max value */ + if ($MaxValue == -1) { + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] > $MaxValue && is_numeric($Data[$Key][$ColName])) { + $MaxValue = $Data[$Key][$ColName]; + } + } + } + } + } + + $GraphID = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + $ID = 0; + foreach ($DataDescription["Description"] as $keyI => $ValueI) { + if ($keyI == $ColName) { + $ColorID = $ID; + }; + $ID++; + } + + $Angle = -90; + $XLast = -1; + $Plots = array(); + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $Value = $Data[$Key][$ColName]; + if (!is_numeric($Value)) { + $Value = 0; + } + $Strength = ($Radius / $MaxValue) * $Value; + + $XPos = cos($Angle * 3.1418 / 180) * $Strength + $XCenter; + $YPos = sin($Angle * 3.1418 / 180) * $Strength + $YCenter; + + $Plots[] = $XPos; + $Plots[] = $YPos; + + $Angle = $Angle + (360 / $Points); + $XLast = $XPos; + $YLast = $YPos; + } + } + + if (isset($Plots[0])) { + $Plots[] = $Plots[0]; + $Plots[] = $Plots[1]; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $C_Graph = $this->AllocateColor($this->Layers[0], $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + imagefilledpolygon($this->Layers[0], $Plots, (count($Plots) + 1) / 2, $C_Graph); + + imagecopymerge($this->Picture, $this->Layers[0], $this->GArea_X1, $this->GArea_Y1, 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + + for ($i = 0; $i <= count($Plots) - 4; $i = $i + 2) { + $this->drawLine($Plots[$i] + $this->GArea_X1, $Plots[$i + 1] + $this->GArea_Y1, $Plots[$i + 2] + $this->GArea_X1, $Plots[$i + 3] + $this->GArea_Y1, $this->Palette[$ColorID]["R"], $this->Palette[$ColorID]["G"], $this->Palette[$ColorID]["B"]); + } + } + + $GraphID++; + } + } + + /* This function draw a flat pie chart */ + function drawBasicPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $DrawLabels = PIE_NOLABEL, $R = 255, $G = 255, $B = 255, $Decimals = 0) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawBasicPieGraph", $DataDescription, false); + $this->validateData("drawBasicPieGraph", $Data); + + /* Determine pie sum */ + $Series = 0; + $PieSum = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if ($ColName != $DataDescription["Position"]) { + $Series++; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $PieSum = $PieSum + $Data[$Key][$ColName]; + } + $iValues[] = $Data[$Key][$ColName]; + $iLabels[] = $Data[$Key][$DataDescription["Position"]]; + } + } + } + + /* Validate serie */ + if ($Series != 1) { + RaiseFatal("Pie chart can only accept one serie of data."); + } + + $SpliceRatio = 360 / $PieSum; + $SplicePercent = 100 / $PieSum; + + /* Calculate all polygons */ + $Angle = 0; + $TopPlots = array(); + foreach ($iValues as $Key => $Value) { + $TopPlots[$Key][] = $XPos; + $TopPlots[$Key][] = $YPos; + + /* Process labels position & size */ + $Caption = ""; + if (!($DrawLabels == PIE_NOLABEL)) { + $TAngle = $Angle + ($Value * $SpliceRatio / 2); + if ($DrawLabels == PIE_PERCENTAGE) { + $Caption = (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } elseif ($DrawLabels == PIE_LABELS) { + $Caption = $iLabels[$Key]; + } elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) { + $Caption = $iLabels[$Key] . "\r\n" . (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) { + $Caption = $iLabels[$Key] . "\r\n" . (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Caption); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = abs($Position[1]) + abs($Position[3]); + + $TX = cos(($TAngle) * 3.1418 / 180) * ($Radius + 10) + $XPos; + + if ($TAngle > 0 && $TAngle < 180) { + $TY = sin(($TAngle) * 3.1418 / 180) * ($Radius + 10) + $YPos + 4; + } else { + $TY = sin(($TAngle) * 3.1418 / 180) * ($Radius + 4) + $YPos - ($TextHeight / 2); + } + + if ($TAngle > 90 && $TAngle < 270) { + $TX = $TX - $TextWidth; + } + + $C_TextColor = $this->AllocateColor($this->Picture, 70, 70, 70); + imagettftext($this->Picture, $this->FontSize, 0, $TX, $TY, $C_TextColor, $this->FontName, $Caption); + } + + /* Process pie slices */ + for ($iAngle = $Angle; $iAngle <= $Angle + $Value * $SpliceRatio; $iAngle = $iAngle + .5) { + $TopX = cos($iAngle * 3.1418 / 180) * $Radius + $XPos; + $TopY = sin($iAngle * 3.1418 / 180) * $Radius + $YPos; + + $TopPlots[$Key][] = $TopX; + $TopPlots[$Key][] = $TopY; + } + + $TopPlots[$Key][] = $XPos; + $TopPlots[$Key][] = $YPos; + + $Angle = $iAngle; + } + $PolyPlots = $TopPlots; + + /* Set array values type to float --- PHP Bug with imagefilledpolygon casting to integer */ + foreach ($TopPlots as $Key => $Value) { + foreach ($TopPlots[$Key] as $Key2 => $Value2) { + settype($TopPlots[$Key][$Key2], "float"); + } + } + + /* Draw Top polygons */ + foreach ($PolyPlots as $Key => $Value) { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"]); + imagefilledpolygon($this->Picture, $PolyPlots[$Key], (count($PolyPlots[$Key]) + 1) / 2, $C_GraphLo); + } + + $this->drawCircle($XPos - .5, $YPos - .5, $Radius, $R, $G, $B); + $this->drawCircle($XPos - .5, $YPos - .5, $Radius + .5, $R, $G, $B); + + /* Draw Top polygons */ + foreach ($TopPlots as $Key => $Value) { + for ($j = 0; $j <= count($TopPlots[$Key]) - 4; $j = $j + 2) { + $this->drawLine($TopPlots[$Key][$j], $TopPlots[$Key][$j + 1], $TopPlots[$Key][$j + 2], $TopPlots[$Key][$j + 3], $R, $G, $B); + } + } + } + + function drawFlatPieGraphWithShadow($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $DrawLabels = PIE_NOLABEL, $SpliceDistance = 0, $Decimals = 0) + { + $this->drawFlatPieGraph($Data, $DataDescription, $XPos + $this->ShadowXDistance, $YPos + $this->ShadowYDistance, $Radius, PIE_NOLABEL, $SpliceDistance, $Decimals, true); + $this->drawFlatPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius, $DrawLabels, $SpliceDistance, $Decimals, false); + } + + /* This function draw a flat pie chart */ + function drawFlatPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $DrawLabels = PIE_NOLABEL, $SpliceDistance = 0, $Decimals = 0, $AllBlack = false) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawFlatPieGraph", $DataDescription, false); + $this->validateData("drawFlatPieGraph", $Data); + + $ShadowStatus = $this->ShadowActive; + $this->ShadowActive = false; + + /* Determine pie sum */ + $Series = 0; + $PieSum = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if ($ColName != $DataDescription["Position"]) { + $Series++; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + $PieSum = $PieSum + $Data[$Key][$ColName]; + } + $iValues[] = $Data[$Key][$ColName]; + $iLabels[] = $Data[$Key][$DataDescription["Position"]]; + } + } + } + + /* Validate serie */ + if ($Series != 1) { + RaiseFatal("Pie chart can only accept one serie of data."); + + return (0); + } + + $SpliceRatio = 360 / $PieSum; + $SplicePercent = 100 / $PieSum; + + /* Calculate all polygons */ + $Angle = 0; + $TopPlots = array(); + foreach ($iValues as $Key => $Value) { + $XOffset = cos(($Angle + ($Value / 2 * $SpliceRatio)) * 3.1418 / 180) * $SpliceDistance; + $YOffset = sin(($Angle + ($Value / 2 * $SpliceRatio)) * 3.1418 / 180) * $SpliceDistance; + + $TopPlots[$Key][] = round($XPos + $XOffset); + $TopPlots[$Key][] = round($YPos + $YOffset); + + if ($AllBlack) { + $Rc = $this->ShadowRColor; + $Gc = $this->ShadowGColor; + $Bc = $this->ShadowBColor; + } else { + $Rc = $this->Palette[$Key]["R"]; + $Gc = $this->Palette[$Key]["G"]; + $Bc = $this->Palette[$Key]["B"]; + } + + $XLineLast = 0; + $YLineLast = 0; + + /* Process labels position & size */ + $Caption = ""; + if (!($DrawLabels == PIE_NOLABEL)) { + $TAngle = $Angle + ($Value * $SpliceRatio / 2); + if ($DrawLabels == PIE_PERCENTAGE) { + $Caption = (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } elseif ($DrawLabels == PIE_LABELS) { + $Caption = $iLabels[$Key]; + } elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) { + $Caption = $iLabels[$Key] . "\r\n" . (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) { + $Caption = $iLabels[$Key] . "\r\n" . (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Caption); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = abs($Position[1]) + abs($Position[3]); + + $TX = cos(($TAngle) * 3.1418 / 180) * ($Radius + 10 + $SpliceDistance) + $XPos; + + if ($TAngle > 0 && $TAngle < 180) { + $TY = sin(($TAngle) * 3.1418 / 180) * ($Radius + 10 + $SpliceDistance) + $YPos + 4; + } else { + $TY = sin(($TAngle) * 3.1418 / 180) * ($Radius + $SpliceDistance + 4) + $YPos - ($TextHeight / 2); + } + + if ($TAngle > 90 && $TAngle < 270) { + $TX = $TX - $TextWidth; + } + + $C_TextColor = $this->AllocateColor($this->Picture, 70, 70, 70); + imagettftext($this->Picture, $this->FontSize, 0, $TX, $TY, $C_TextColor, $this->FontName, $Caption); + } + + /* Process pie slices */ + if (!$AllBlack) { + $LineColor = $this->AllocateColor($this->Picture, $Rc, $Gc, $Bc); + } else { + $LineColor = $this->AllocateColor($this->Picture, $Rc, $Gc, $Bc); + } + + $XLineLast = 0; + $YLineLast = 0; + for ($iAngle = $Angle; $iAngle <= $Angle + $Value * $SpliceRatio; $iAngle = $iAngle + .5) { + $PosX = cos($iAngle * 3.1418 / 180) * $Radius + $XPos + $XOffset; + $PosY = sin($iAngle * 3.1418 / 180) * $Radius + $YPos + $YOffset; + + $TopPlots[$Key][] = round($PosX); + $TopPlots[$Key][] = round($PosY); + + if ($iAngle == $Angle || $iAngle == $Angle + $Value * $SpliceRatio || $iAngle + .5 > $Angle + $Value * $SpliceRatio) { + $this->drawLine($XPos + $XOffset, $YPos + $YOffset, $PosX, $PosY, $Rc, $Gc, $Bc); + } + + if ($XLineLast != "") { + $this->drawLine($XLineLast, $YLineLast, $PosX, $PosY, $Rc, $Gc, $Bc); + } + + $XLineLast = $PosX; + $YLineLast = $PosY; + } + + $TopPlots[$Key][] = round($XPos + $XOffset); + $TopPlots[$Key][] = round($YPos + $YOffset); + + $Angle = $iAngle; + } + $PolyPlots = $TopPlots; + + /* Draw Top polygons */ + foreach ($PolyPlots as $Key => $Value) { + if (!$AllBlack) { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"]); + } else { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor); + } + + imagefilledpolygon($this->Picture, $PolyPlots[$Key], (count($PolyPlots[$Key]) + 1) / 2, $C_GraphLo); + } + $this->ShadowActive = $ShadowStatus; + } + + /* This function draw a pseudo-3D pie chart */ + function drawPieGraph($Data, $DataDescription, $XPos, $YPos, $Radius = 100, $DrawLabels = PIE_NOLABEL, $EnhanceColors = true, $Skew = 60, $SpliceHeight = 20, $SpliceDistance = 0, $Decimals = 0) + { + /* Validate the Data and DataDescription array */ + $this->validateDataDescription("drawPieGraph", $DataDescription, false); + $this->validateData("drawPieGraph", $Data); + + /* Determine pie sum */ + $Series = 0; + $PieSum = 0; + $rPieSum = 0; + foreach ($DataDescription["Values"] as $Key2 => $ColName) { + if ($ColName != $DataDescription["Position"]) { + $Series++; + foreach ($Data as $Key => $Values) { + if (isset($Data[$Key][$ColName])) { + if ($Data[$Key][$ColName] == 0) { + $iValues[] = 0; + $rValues[] = 0; + $iLabels[] = $Data[$Key][$DataDescription["Position"]]; + } // Removed : $PieSum++; $rValues[] = 1; + else { + $PieSum += $Data[$Key][$ColName]; + $iValues[] = $Data[$Key][$ColName]; + $iLabels[] = $Data[$Key][$DataDescription["Position"]]; + $rValues[] = $Data[$Key][$ColName]; + $rPieSum += $Data[$Key][$ColName]; + } + } + } + } + } + + /* Validate serie */ + if ($Series != 1) { + RaiseFatal("Pie chart can only accept one serie of data."); + } + + $SpliceDistanceRatio = $SpliceDistance; + $SkewHeight = ($Radius * $Skew) / 100; + $SpliceRatio = (360 - $SpliceDistanceRatio * count($iValues)) / $PieSum; + $SplicePercent = 100 / $PieSum; + $rSplicePercent = 100 / $rPieSum; + + /* Calculate all polygons */ + $Angle = 0; + $CDev = 5; + $TopPlots = array(); + $BotPlots = array(); + $aTopPlots = array(); + $aBotPlots = array(); + foreach ($iValues as $Key => $Value) { + $XCenterPos = cos(($Angle - $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $XPos; + $YCenterPos = sin(($Angle - $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $YPos; + $XCenterPos2 = cos(($Angle + $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $XPos; + $YCenterPos2 = sin(($Angle + $CDev + ($Value * $SpliceRatio + $SpliceDistanceRatio) / 2) * 3.1418 / 180) * $SpliceDistance + $YPos; + + $TopPlots[$Key][] = round($XCenterPos); + $BotPlots[$Key][] = round($XCenterPos); + $TopPlots[$Key][] = round($YCenterPos); + $BotPlots[$Key][] = round($YCenterPos + $SpliceHeight); + $aTopPlots[$Key][] = $XCenterPos; + $aBotPlots[$Key][] = $XCenterPos; + $aTopPlots[$Key][] = $YCenterPos; + $aBotPlots[$Key][] = $YCenterPos + $SpliceHeight; + + /* Process labels position & size */ + $Caption = ""; + if (!($DrawLabels == PIE_NOLABEL)) { + $TAngle = $Angle + ($Value * $SpliceRatio / 2); + if ($DrawLabels == PIE_PERCENTAGE) { + $Caption = (round($rValues[$Key] * pow(10, $Decimals) * $rSplicePercent) / pow(10, $Decimals)) . "%"; + } elseif ($DrawLabels == PIE_LABELS) { + $Caption = $iLabels[$Key]; + } elseif ($DrawLabels == PIE_PERCENTAGE_LABEL) { + $Caption = $iLabels[$Key] . "\r\n" . (round($Value * pow(10, $Decimals) * $SplicePercent) / pow(10, $Decimals)) . "%"; + } + + $Position = imageftbbox($this->FontSize, 0, $this->FontName, $Caption); + $TextWidth = $Position[2] - $Position[0]; + $TextHeight = abs($Position[1]) + abs($Position[3]); + + $TX = cos(($TAngle) * 3.1418 / 180) * ($Radius + 10) + $XPos; + + if ($TAngle > 0 && $TAngle < 180) { + $TY = sin(($TAngle) * 3.1418 / 180) * ($SkewHeight + 10) + $YPos + $SpliceHeight + 4; + } else { + $TY = sin(($TAngle) * 3.1418 / 180) * ($SkewHeight + 4) + $YPos - ($TextHeight / 2); + } + + if ($TAngle > 90 && $TAngle < 270) { + $TX = $TX - $TextWidth; + } + + $C_TextColor = $this->AllocateColor($this->Picture, 70, 70, 70); + imagettftext($this->Picture, $this->FontSize, 0, $TX, $TY, $C_TextColor, $this->FontName, $Caption); + } + + /* Process pie slices */ + for ($iAngle = $Angle; $iAngle <= $Angle + $Value * $SpliceRatio; $iAngle = $iAngle + .5) { + $TopX = cos($iAngle * 3.1418 / 180) * $Radius + $XPos; + $TopY = sin($iAngle * 3.1418 / 180) * $SkewHeight + $YPos; + + $TopPlots[$Key][] = round($TopX); + $BotPlots[$Key][] = round($TopX); + $TopPlots[$Key][] = round($TopY); + $BotPlots[$Key][] = round($TopY + $SpliceHeight); + $aTopPlots[$Key][] = $TopX; + $aBotPlots[$Key][] = $TopX; + $aTopPlots[$Key][] = $TopY; + $aBotPlots[$Key][] = $TopY + $SpliceHeight; + } + + $TopPlots[$Key][] = round($XCenterPos2); + $BotPlots[$Key][] = round($XCenterPos2); + $TopPlots[$Key][] = round($YCenterPos2); + $BotPlots[$Key][] = round($YCenterPos2 + $SpliceHeight); + $aTopPlots[$Key][] = $XCenterPos2; + $aBotPlots[$Key][] = $XCenterPos2; + $aTopPlots[$Key][] = $YCenterPos2; + $aBotPlots[$Key][] = $YCenterPos2 + $SpliceHeight; + + $Angle = $iAngle + $SpliceDistanceRatio; + } + + /* Draw Bottom polygons */ + foreach ($iValues as $Key => $Value) { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"], -20); + imagefilledpolygon($this->Picture, $BotPlots[$Key], (count($BotPlots[$Key]) + 1) / 2, $C_GraphLo); + + if ($EnhanceColors) { + $En = -10; + } else { + $En = 0; + } + + for ($j = 0; $j <= count($aBotPlots[$Key]) - 4; $j = $j + 2) { + $this->drawLine($aBotPlots[$Key][$j], $aBotPlots[$Key][$j + 1], $aBotPlots[$Key][$j + 2], $aBotPlots[$Key][$j + 3], $this->Palette[$Key]["R"] + $En, $this->Palette[$Key]["G"] + $En, $this->Palette[$Key]["B"] + $En); + } + } + + /* Draw pie layers */ + if ($EnhanceColors) { + $ColorRatio = 30 / $SpliceHeight; + } else { + $ColorRatio = 25 / $SpliceHeight; + } + for ($i = $SpliceHeight - 1; $i >= 1; $i--) { + foreach ($iValues as $Key => $Value) { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"], -10); + $Plots = array(); + $Plot = 0; + foreach ($TopPlots[$Key] as $Key2 => $Value2) { + $Plot++; + if ($Plot % 2 == 1) { + $Plots[] = $Value2; + } else { + $Plots[] = $Value2 + $i; + } + } + imagefilledpolygon($this->Picture, $Plots, (count($Plots) + 1) / 2, $C_GraphLo); + + $Index = count($Plots); + if ($EnhanceColors) { + $ColorFactor = -20 + ($SpliceHeight - $i) * $ColorRatio; + } else { + $ColorFactor = 0; + } + + $this->drawAntialiasPixel($Plots[0], $Plots[1], $this->Palette[$Key]["R"] + $ColorFactor, $this->Palette[$Key]["G"] + $ColorFactor, $this->Palette[$Key]["B"] + $ColorFactor); + $this->drawAntialiasPixel($Plots[2], $Plots[3], $this->Palette[$Key]["R"] + $ColorFactor, $this->Palette[$Key]["G"] + $ColorFactor, $this->Palette[$Key]["B"] + $ColorFactor); + $this->drawAntialiasPixel($Plots[$Index - 4], $Plots[$Index - 3], $this->Palette[$Key]["R"] + $ColorFactor, $this->Palette[$Key]["G"] + $ColorFactor, $this->Palette[$Key]["B"] + $ColorFactor); + } + } + + /* Draw Top polygons */ + for ($Key = count($iValues) - 1; $Key >= 0; $Key--) { + $C_GraphLo = $this->AllocateColor($this->Picture, $this->Palette[$Key]["R"], $this->Palette[$Key]["G"], $this->Palette[$Key]["B"]); + imagefilledpolygon($this->Picture, $TopPlots[$Key], (count($TopPlots[$Key]) + 1) / 2, $C_GraphLo); + + if ($EnhanceColors) { + $En = 10; + } else { + $En = 0; + } + for ($j = 0; $j <= count($aTopPlots[$Key]) - 4; $j = $j + 2) { + $this->drawLine($aTopPlots[$Key][$j], $aTopPlots[$Key][$j + 1], $aTopPlots[$Key][$j + 2], $aTopPlots[$Key][$j + 3], $this->Palette[$Key]["R"] + $En, $this->Palette[$Key]["G"] + $En, $this->Palette[$Key]["B"] + $En); + } + } + } + + /* This function can be used to set the background color */ + function drawBackground($R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Background = $this->AllocateColor($this->Picture, $R, $G, $B); + imagefilledrectangle($this->Picture, 0, 0, $this->XSize, $this->YSize, $C_Background); + } + + /* This function can be used to set the background color */ + function drawGraphAreaGradient($R, $G, $B, $Decay, $Target = TARGET_GRAPHAREA) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + if ($Target == TARGET_GRAPHAREA) { + $X1 = $this->GArea_X1 + 1; + $X2 = $this->GArea_X2 - 1; + $Y1 = $this->GArea_Y1 + 1; + $Y2 = $this->GArea_Y2; + } + if ($Target == TARGET_BACKGROUND) { + $X1 = 0; + $X2 = $this->XSize; + $Y1 = 0; + $Y2 = $this->YSize; + } + + /* Positive gradient */ + if ($Decay > 0) { + $YStep = ($Y2 - $Y1 - 2) / $Decay; + for ($i = 0; $i <= $Decay; $i++) { + $R -= 1; + $G -= 1; + $B -= 1; + $Yi1 = $Y1 + ($i * $YStep); + $Yi2 = ceil($Yi1 + ($i * $YStep) + $YStep); + if ($Yi2 >= $Yi2) { + $Yi2 = $Y2 - 1; + } + + $C_Background = $this->AllocateColor($this->Picture, $R, $G, $B); + imagefilledrectangle($this->Picture, $X1, $Yi1, $X2, $Yi2, $C_Background); + } + } + + /* Negative gradient */ + if ($Decay < 0) { + $YStep = ($Y2 - $Y1 - 2) / -$Decay; + $Yi1 = $Y1; + $Yi2 = $Y1 + $YStep; + for ($i = -$Decay; $i >= 0; $i--) { + $R += 1; + $G += 1; + $B += 1; + $C_Background = $this->AllocateColor($this->Picture, $R, $G, $B); + imagefilledrectangle($this->Picture, $X1, $Yi1, $X2, $Yi2, $C_Background); + + $Yi1 += $YStep; + $Yi2 += $YStep; + if ($Yi2 >= $Yi2) { + $Yi2 = $Y2 - 1; + } + } + } + } + + /* This function create a rectangle with antialias */ + function drawRectangle($X1, $Y1, $X2, $Y2, $R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Rectangle = $this->AllocateColor($this->Picture, $R, $G, $B); + + $X1 = $X1 - .2; + $Y1 = $Y1 - .2; + $X2 = $X2 + .2; + $Y2 = $Y2 + .2; + $this->drawLine($X1, $Y1, $X2, $Y1, $R, $G, $B); + $this->drawLine($X2, $Y1, $X2, $Y2, $R, $G, $B); + $this->drawLine($X2, $Y2, $X1, $Y2, $R, $G, $B); + $this->drawLine($X1, $Y2, $X1, $Y1, $R, $G, $B); + } + + /* This function create a filled rectangle with antialias */ + function drawFilledRectangle($X1, $Y1, $X2, $Y2, $R, $G, $B, $DrawBorder = true, $Alpha = 100, $NoFallBack = false) + { + if ($X2 < $X1) { + list($X1, $X2) = array($X2, $X1); + } + if ($Y2 < $Y1) { + list($Y1, $Y2) = array($Y2, $Y1); + } + + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + if ($Alpha == 100) { + /* Process shadows */ + if ($this->ShadowActive && !$NoFallBack) { + $this->drawFilledRectangle($X1 + $this->ShadowXDistance, $Y1 + $this->ShadowYDistance, $X2 + $this->ShadowXDistance, $Y2 + $this->ShadowYDistance, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, false, $this->ShadowAlpha, true); + if ($this->ShadowBlur != 0) { + $AlphaDecay = ($this->ShadowAlpha / $this->ShadowBlur); + + for ($i = 1; $i <= $this->ShadowBlur; $i++) { + $this->drawFilledRectangle($X1 + $this->ShadowXDistance - $i / 2, $Y1 + $this->ShadowYDistance - $i / 2, $X2 + $this->ShadowXDistance - $i / 2, $Y2 + $this->ShadowYDistance - $i / 2, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, false, $this->ShadowAlpha - $AlphaDecay * $i, true); + } + for ($i = 1; $i <= $this->ShadowBlur; $i++) { + $this->drawFilledRectangle($X1 + $this->ShadowXDistance + $i / 2, $Y1 + $this->ShadowYDistance + $i / 2, $X2 + $this->ShadowXDistance + $i / 2, $Y2 + $this->ShadowYDistance + $i / 2, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, false, $this->ShadowAlpha - $AlphaDecay * $i, true); + } + } + } + + $C_Rectangle = $this->AllocateColor($this->Picture, $R, $G, $B); + imagefilledrectangle($this->Picture, round($X1), round($Y1), round($X2), round($Y2), $C_Rectangle); + } else { + $LayerWidth = abs($X2 - $X1) + 2; + $LayerHeight = abs($Y2 - $Y1) + 2; + + $this->Layers[0] = imagecreatetruecolor($LayerWidth, $LayerHeight); + $C_White = $this->AllocateColor($this->Layers[0], 255, 255, 255); + imagefilledrectangle($this->Layers[0], 0, 0, $LayerWidth, $LayerHeight, $C_White); + imagecolortransparent($this->Layers[0], $C_White); + + $C_Rectangle = $this->AllocateColor($this->Layers[0], $R, $G, $B); + imagefilledrectangle($this->Layers[0], round(1), round(1), round($LayerWidth - 1), round($LayerHeight - 1), $C_Rectangle); + + imagecopymerge($this->Picture, $this->Layers[0], round(min($X1, $X2) - 1), round(min($Y1, $Y2) - 1), 0, 0, $LayerWidth, $LayerHeight, $Alpha); + imagedestroy($this->Layers[0]); + } + + if ($DrawBorder) { + $ShadowSettings = $this->ShadowActive; + $this->ShadowActive = false; + $this->drawRectangle($X1, $Y1, $X2, $Y2, $R, $G, $B); + $this->ShadowActive = $ShadowSettings; + } + } + + /* This function create a rectangle with rounded corners and antialias */ + function drawRoundedRectangle($X1, $Y1, $X2, $Y2, $Radius, $R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Rectangle = $this->AllocateColor($this->Picture, $R, $G, $B); + + $Step = 90 / ((3.1418 * $Radius) / 2); + + for ($i = 0; $i <= 90; $i = $i + $Step) { + $X = cos(($i + 180) * 3.1418 / 180) * $Radius + $X1 + $Radius; + $Y = sin(($i + 180) * 3.1418 / 180) * $Radius + $Y1 + $Radius; + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + + $X = cos(($i - 90) * 3.1418 / 180) * $Radius + $X2 - $Radius; + $Y = sin(($i - 90) * 3.1418 / 180) * $Radius + $Y1 + $Radius; + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + + $X = cos(($i) * 3.1418 / 180) * $Radius + $X2 - $Radius; + $Y = sin(($i) * 3.1418 / 180) * $Radius + $Y2 - $Radius; + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + + $X = cos(($i + 90) * 3.1418 / 180) * $Radius + $X1 + $Radius; + $Y = sin(($i + 90) * 3.1418 / 180) * $Radius + $Y2 - $Radius; + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + } + + $X1 = $X1 - .2; + $Y1 = $Y1 - .2; + $X2 = $X2 + .2; + $Y2 = $Y2 + .2; + $this->drawLine($X1 + $Radius, $Y1, $X2 - $Radius, $Y1, $R, $G, $B); + $this->drawLine($X2, $Y1 + $Radius, $X2, $Y2 - $Radius, $R, $G, $B); + $this->drawLine($X2 - $Radius, $Y2, $X1 + $Radius, $Y2, $R, $G, $B); + $this->drawLine($X1, $Y2 - $Radius, $X1, $Y1 + $Radius, $R, $G, $B); + } + + /* This function create a filled rectangle with rounded corners and antialias */ + function drawFilledRoundedRectangle($X1, $Y1, $X2, $Y2, $Radius, $R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Rectangle = $this->AllocateColor($this->Picture, $R, $G, $B); + + $Step = 90 / ((3.1418 * $Radius) / 2); + + for ($i = 0; $i <= 90; $i = $i + $Step) { + $Xi1 = cos(($i + 180) * 3.1418 / 180) * $Radius + $X1 + $Radius; + $Yi1 = sin(($i + 180) * 3.1418 / 180) * $Radius + $Y1 + $Radius; + + $Xi2 = cos(($i - 90) * 3.1418 / 180) * $Radius + $X2 - $Radius; + $Yi2 = sin(($i - 90) * 3.1418 / 180) * $Radius + $Y1 + $Radius; + + $Xi3 = cos(($i) * 3.1418 / 180) * $Radius + $X2 - $Radius; + $Yi3 = sin(($i) * 3.1418 / 180) * $Radius + $Y2 - $Radius; + + $Xi4 = cos(($i + 90) * 3.1418 / 180) * $Radius + $X1 + $Radius; + $Yi4 = sin(($i + 90) * 3.1418 / 180) * $Radius + $Y2 - $Radius; + + imageline($this->Picture, $Xi1, $Yi1, $X1 + $Radius, $Yi1, $C_Rectangle); + imageline($this->Picture, $X2 - $Radius, $Yi2, $Xi2, $Yi2, $C_Rectangle); + imageline($this->Picture, $X2 - $Radius, $Yi3, $Xi3, $Yi3, $C_Rectangle); + imageline($this->Picture, $Xi4, $Yi4, $X1 + $Radius, $Yi4, $C_Rectangle); + + $this->drawAntialiasPixel($Xi1, $Yi1, $R, $G, $B); + $this->drawAntialiasPixel($Xi2, $Yi2, $R, $G, $B); + $this->drawAntialiasPixel($Xi3, $Yi3, $R, $G, $B); + $this->drawAntialiasPixel($Xi4, $Yi4, $R, $G, $B); + } + + imagefilledrectangle($this->Picture, $X1, $Y1 + $Radius, $X2, $Y2 - $Radius, $C_Rectangle); + imagefilledrectangle($this->Picture, $X1 + $Radius, $Y1, $X2 - $Radius, $Y2, $C_Rectangle); + + $X1 = $X1 - .2; + $Y1 = $Y1 - .2; + $X2 = $X2 + .2; + $Y2 = $Y2 + .2; + $this->drawLine($X1 + $Radius, $Y1, $X2 - $Radius, $Y1, $R, $G, $B); + $this->drawLine($X2, $Y1 + $Radius, $X2, $Y2 - $Radius, $R, $G, $B); + $this->drawLine($X2 - $Radius, $Y2, $X1 + $Radius, $Y2, $R, $G, $B); + $this->drawLine($X1, $Y2 - $Radius, $X1, $Y1 + $Radius, $R, $G, $B); + } + + /* This function create a circle with antialias */ + function drawCircle($Xc, $Yc, $Height, $R, $G, $B, $Width = 0) + { + if ($Width == 0) { + $Width = $Height; + } + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Circle = $this->AllocateColor($this->Picture, $R, $G, $B); + $Step = 360 / (2 * 3.1418 * max($Width, $Height)); + + for ($i = 0; $i <= 360; $i = $i + $Step) { + $X = cos($i * 3.1418 / 180) * $Height + $Xc; + $Y = sin($i * 3.1418 / 180) * $Width + $Yc; + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + } + } + + /* This function create a filled circle/ellipse with antialias */ + function drawFilledCircle($Xc, $Yc, $Height, $R, $G, $B, $Width = 0) + { + if ($Width == 0) { + $Width = $Height; + } + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $C_Circle = $this->AllocateColor($this->Picture, $R, $G, $B); + $Step = 360 / (2 * 3.1418 * max($Width, $Height)); + + for ($i = 90; $i <= 270; $i = $i + $Step) { + $X1 = cos($i * 3.1418 / 180) * $Height + $Xc; + $Y1 = sin($i * 3.1418 / 180) * $Width + $Yc; + $X2 = cos((180 - $i) * 3.1418 / 180) * $Height + $Xc; + $Y2 = sin((180 - $i) * 3.1418 / 180) * $Width + $Yc; + + $this->drawAntialiasPixel($X1 - 1, $Y1 - 1, $R, $G, $B); + $this->drawAntialiasPixel($X2 - 1, $Y2 - 1, $R, $G, $B); + + if (($Y1 - 1) > $Yc - max($Width, $Height)) { + imageline($this->Picture, $X1, $Y1 - 1, $X2 - 1, $Y2 - 1, $C_Circle); + } + } + } + + /* This function will draw a filled ellipse */ + function drawEllipse($Xc, $Yc, $Height, $Width, $R, $G, $B) + { + $this->drawCircle($Xc, $Yc, $Height, $R, $G, $B, $Width); + } + + /* This function will draw an ellipse */ + function drawFilledEllipse($Xc, $Yc, $Height, $Width, $R, $G, $B) + { + $this->drawFilledCircle($Xc, $Yc, $Height, $R, $G, $B, $Width); + } + + /* This function create a line with antialias */ + function drawLine($X1, $Y1, $X2, $Y2, $R, $G, $B, $GraphFunction = false) + { + if ($this->LineDotSize > 1) { + $this->drawDottedLine($X1, $Y1, $X2, $Y2, $this->LineDotSize, $R, $G, $B, $GraphFunction); + + return (0); + } + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $Distance = sqrt(($X2 - $X1) * ($X2 - $X1) + ($Y2 - $Y1) * ($Y2 - $Y1)); + if ($Distance == 0) { + return (-1); + } + $XStep = ($X2 - $X1) / $Distance; + $YStep = ($Y2 - $Y1) / $Distance; + + for ($i = 0; $i <= $Distance; $i++) { + $X = $i * $XStep + $X1; + $Y = $i * $YStep + $Y1; + + if (($X >= $this->GArea_X1 && $X <= $this->GArea_X2 && $Y >= $this->GArea_Y1 && $Y <= $this->GArea_Y2) || !$GraphFunction) { + if ($this->LineWidth == 1) { + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + } else { + $StartOffset = -($this->LineWidth / 2); + $EndOffset = ($this->LineWidth / 2); + for ($j = $StartOffset; $j <= $EndOffset; $j++) { + $this->drawAntialiasPixel($X + $j, $Y + $j, $R, $G, $B); + } + } + } + } + } + + /* This function create a line with antialias */ + function drawDottedLine($X1, $Y1, $X2, $Y2, $DotSize, $R, $G, $B, $GraphFunction = false) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $Distance = sqrt(($X2 - $X1) * ($X2 - $X1) + ($Y2 - $Y1) * ($Y2 - $Y1)); + + $XStep = ($X2 - $X1) / $Distance; + $YStep = ($Y2 - $Y1) / $Distance; + + $DotIndex = 0; + for ($i = 0; $i <= $Distance; $i++) { + $X = $i * $XStep + $X1; + $Y = $i * $YStep + $Y1; + + if ($DotIndex <= $DotSize) { + if (($X >= $this->GArea_X1 && $X <= $this->GArea_X2 && $Y >= $this->GArea_Y1 && $Y <= $this->GArea_Y2) || !$GraphFunction) { + if ($this->LineWidth == 1) { + $this->drawAntialiasPixel($X, $Y, $R, $G, $B); + } else { + $StartOffset = -($this->LineWidth / 2); + $EndOffset = ($this->LineWidth / 2); + for ($j = $StartOffset; $j <= $EndOffset; $j++) { + $this->drawAntialiasPixel($X + $j, $Y + $j, $R, $G, $B); + } + } + } + } + + $DotIndex++; + if ($DotIndex == $DotSize * 2) { + $DotIndex = 0; + } + } + } + + /* Load a PNG file and draw it over the chart */ + function drawFromPNG($FileName, $X, $Y, $Alpha = 100) + { + $this->drawFromPicture(1, $FileName, $X, $Y, $Alpha); + } + + /* Load a GIF file and draw it over the chart */ + function drawFromGIF($FileName, $X, $Y, $Alpha = 100) + { + $this->drawFromPicture(2, $FileName, $X, $Y, $Alpha); + } + + /* Load a JPEG file and draw it over the chart */ + function drawFromJPG($FileName, $X, $Y, $Alpha = 100) + { + $this->drawFromPicture(3, $FileName, $X, $Y, $Alpha); + } + + /* Generic loader function for external pictures */ + function drawFromPicture($PicType, $FileName, $X, $Y, $Alpha = 100) + { + if (file_exists($FileName)) { + $Infos = getimagesize($FileName); + $Width = $Infos[0]; + $Height = $Infos[1]; + if ($PicType == 1) { + $Raster = imagecreatefrompng($FileName); + } + if ($PicType == 2) { + $Raster = imagecreatefromgif($FileName); + } + if ($PicType == 3) { + $Raster = imagecreatefromjpeg($FileName); + } + + imagecopymerge($this->Picture, $Raster, $X, $Y, 0, 0, $Width, $Height, $Alpha); + imagedestroy($Raster); + } + } + + /* Draw an alpha pixel */ + function drawAlphaPixel($X, $Y, $Alpha, $R, $G, $B) + { + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + if ($X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize) { + return (-1); + } + + $RGB2 = imagecolorat($this->Picture, $X, $Y); + $R2 = ($RGB2 >> 16) & 0xFF; + $G2 = ($RGB2 >> 8) & 0xFF; + $B2 = $RGB2 & 0xFF; + + $iAlpha = (100 - $Alpha) / 100; + $Alpha = $Alpha / 100; + + $Ra = floor($R * $Alpha + $R2 * $iAlpha); + $Ga = floor($G * $Alpha + $G2 * $iAlpha); + $Ba = floor($B * $Alpha + $B2 * $iAlpha); + + $C_Aliased = $this->AllocateColor($this->Picture, $Ra, $Ga, $Ba); + imagesetpixel($this->Picture, $X, $Y, $C_Aliased); + } + + /* Color helper */ + function AllocateColor($Picture, $R, $G, $B, $Factor = 0) + { + $R = $R + $Factor; + $G = $G + $Factor; + $B = $B + $Factor; + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + return (imagecolorallocate($Picture, $R, $G, $B)); + } + + /* Add a border to the picture */ + function addBorder($Size = 3, $R = 0, $G = 0, $B = 0) + { + $Width = $this->XSize + 2 * $Size; + $Height = $this->YSize + 2 * $Size; + + $Resampled = imagecreatetruecolor($Width, $Height); + $C_Background = $this->AllocateColor($Resampled, $R, $G, $B); + imagefilledrectangle($Resampled, 0, 0, $Width, $Height, $C_Background); + + imagecopy($Resampled, $this->Picture, $Size, $Size, 0, 0, $this->XSize, $this->YSize); + imagedestroy($this->Picture); + + $this->XSize = $Width; + $this->YSize = $Height; + + $this->Picture = imagecreatetruecolor($this->XSize, $this->YSize); + $C_White = $this->AllocateColor($this->Picture, 255, 255, 255); + imagefilledrectangle($this->Picture, 0, 0, $this->XSize, $this->YSize, $C_White); + imagecolortransparent($this->Picture, $C_White); + imagecopy($this->Picture, $Resampled, 0, 0, 0, 0, $this->XSize, $this->YSize); + } + + /* Render the current picture to a file */ + function Render($FileName) + { + if ($this->ErrorReporting) { + $this->printErrors($this->ErrorInterface); + } + + /* Save image map if requested */ + if ($this->BuildMap) { + $this->SaveImageMap(); + } + + imagepng($this->Picture, $FileName); + } + + /* Render the current picture to STDOUT */ + function Stroke() + { + if ($this->ErrorReporting) { + $this->printErrors("GD"); + } + + /* Save image map if requested */ + if ($this->BuildMap) { + $this->SaveImageMap(); + } + + header('Content-type: image/png'); + imagepng($this->Picture); + } + + /* Private functions for internal processing */ + function drawAntialiasPixel($X, $Y, $R, $G, $B, $Alpha = 100, $NoFallBack = false) + { + /* Process shadows */ + if ($this->ShadowActive && !$NoFallBack) { + $this->drawAntialiasPixel($X + $this->ShadowXDistance, $Y + $this->ShadowYDistance, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, $this->ShadowAlpha, true); + if ($this->ShadowBlur != 0) { + $AlphaDecay = ($this->ShadowAlpha / $this->ShadowBlur); + + for ($i = 1; $i <= $this->ShadowBlur; $i++) { + $this->drawAntialiasPixel($X + $this->ShadowXDistance - $i / 2, $Y + $this->ShadowYDistance - $i / 2, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, $this->ShadowAlpha - $AlphaDecay * $i, true); + } + for ($i = 1; $i <= $this->ShadowBlur; $i++) { + $this->drawAntialiasPixel($X + $this->ShadowXDistance + $i / 2, $Y + $this->ShadowYDistance + $i / 2, $this->ShadowRColor, $this->ShadowGColor, $this->ShadowBColor, $this->ShadowAlpha - $AlphaDecay * $i, true); + } + } + } + + if ($R < 0) { + $R = 0; + } + if ($R > 255) { + $R = 255; + } + if ($G < 0) { + $G = 0; + } + if ($G > 255) { + $G = 255; + } + if ($B < 0) { + $B = 0; + } + if ($B > 255) { + $B = 255; + } + + $Plot = array(); + $Xi = floor($X); + $Yi = floor($Y); + + if ($Xi == $X && $Yi == $Y) { + if ($Alpha == 100) { + $C_Aliased = $this->AllocateColor($this->Picture, $R, $G, $B); + imagesetpixel($this->Picture, $X, $Y, $C_Aliased); + } else { + $this->drawAlphaPixel($X, $Y, $Alpha, $R, $G, $B); + } + } else { + $Alpha1 = (((1 - ($X - floor($X))) * (1 - ($Y - floor($Y))) * 100) / 100) * $Alpha; + if ($Alpha1 > $this->AntialiasQuality) { + $this->drawAlphaPixel($Xi, $Yi, $Alpha1, $R, $G, $B); + } + + $Alpha2 = ((($X - floor($X)) * (1 - ($Y - floor($Y))) * 100) / 100) * $Alpha; + if ($Alpha2 > $this->AntialiasQuality) { + $this->drawAlphaPixel($Xi + 1, $Yi, $Alpha2, $R, $G, $B); + } + + $Alpha3 = (((1 - ($X - floor($X))) * ($Y - floor($Y)) * 100) / 100) * $Alpha; + if ($Alpha3 > $this->AntialiasQuality) { + $this->drawAlphaPixel($Xi, $Yi + 1, $Alpha3, $R, $G, $B); + } + + $Alpha4 = ((($X - floor($X)) * ($Y - floor($Y)) * 100) / 100) * $Alpha; + if ($Alpha4 > $this->AntialiasQuality) { + $this->drawAlphaPixel($Xi + 1, $Yi + 1, $Alpha4, $R, $G, $B); + } + } + } + + /* Validate data contained in the description array */ + function validateDataDescription($FunctionName, &$DataDescription, $DescriptionRequired = true) + { + if (!isset($DataDescription["Position"])) { + $this->Errors[] = "[Warning] " . $FunctionName . " - Y Labels are not set."; + $DataDescription["Position"] = "Name"; + } + + if ($DescriptionRequired) { + if (!isset($DataDescription["Description"])) { + $this->Errors[] = "[Warning] " . $FunctionName . " - Series descriptions are not set."; + foreach ($DataDescription["Values"] as $key => $Value) { + $DataDescription["Description"][$Value] = $Value; + } + } + + if (count($DataDescription["Description"]) < count($DataDescription["Values"])) { + $this->Errors[] = "[Warning] " . $FunctionName . " - Some series descriptions are not set."; + foreach ($DataDescription["Values"] as $key => $Value) { + if (!isset($DataDescription["Description"][$Value])) { + $DataDescription["Description"][$Value] = $Value; + } + } + } + } + } + + /* Validate data contained in the data array */ + function validateData($FunctionName, &$Data) + { + $DataSummary = array(); + + foreach ($Data as $key => $Values) { + foreach ($Values as $key2 => $Value) { + if (!isset($DataSummary[$key2])) { + $DataSummary[$key2] = 1; + } else { + $DataSummary[$key2]++; + } + } + } + + if (max($DataSummary) == 0) { + $this->Errors[] = "[Warning] " . $FunctionName . " - No data set."; + } + + foreach ($DataSummary as $key => $Value) { + if ($Value < max($DataSummary)) { + $this->Errors[] = "[Warning] " . $FunctionName . " - Missing data in serie " . $key . "."; + } + } + } + + /* Print all error messages on the CLI or graphically */ + function printErrors($Mode = "CLI") + { + if (count($this->Errors) == 0) { + return (0); + } + + if ($Mode == "CLI") { + foreach ($this->Errors as $key => $Value) { + echo $Value . "\r\n"; + } + } elseif ($Mode == "GD") { + $this->setLineStyle($Width = 1); + $MaxWidth = 0; + foreach ($this->Errors as $key => $Value) { + $Position = imageftbbox($this->ErrorFontSize, 0, $this->ErrorFontName, $Value); + $TextWidth = $Position[2] - $Position[0]; + if ($TextWidth > $MaxWidth) { + $MaxWidth = $TextWidth; + } + } + $this->drawFilledRoundedRectangle($this->XSize - ($MaxWidth + 20), $this->YSize - (20 + (($this->ErrorFontSize + 4) * count($this->Errors))), $this->XSize - 10, $this->YSize - 10, 6, 233, 185, 185); + $this->drawRoundedRectangle($this->XSize - ($MaxWidth + 20), $this->YSize - (20 + (($this->ErrorFontSize + 4) * count($this->Errors))), $this->XSize - 10, $this->YSize - 10, 6, 193, 145, 145); + + $C_TextColor = $this->AllocateColor($this->Picture, 133, 85, 85); + $YPos = $this->YSize - (18 + (count($this->Errors) - 1) * ($this->ErrorFontSize + 4)); + foreach ($this->Errors as $key => $Value) { + imagettftext($this->Picture, $this->ErrorFontSize, 0, $this->XSize - ($MaxWidth + 15), $YPos, $C_TextColor, $this->ErrorFontName, $Value); + $YPos = $YPos + ($this->ErrorFontSize + 4); + } + } + } + + /* Activate the image map creation process */ + function setImageMap($Mode = true, $GraphID = "MyGraph") + { + $this->BuildMap = $Mode; + $this->MapID = $GraphID; + } + + /* Add a box into the image map */ + function addToImageMap($X1, $Y1, $X2, $Y2, $SerieName, $Value, $CallerFunction) + { + if ($this->MapFunction == null || $this->MapFunction == $CallerFunction) { + $this->ImageMap[] = round($X1) . "," . round($Y1) . "," . round($X2) . "," . round($Y2) . "," . $SerieName . "," . $Value; + $this->MapFunction = $CallerFunction; + } + } + + /* Load and cleanup the image map from disk */ + function getImageMap($MapName, $Flush = true) + { + /* Strip HTML query strings */ + $Values = $this->tmpFolder . $MapName; + $Value = split("\?", $Values); + $FileName = $Value[0]; + + if (file_exists($FileName)) { + $Handle = fopen($FileName, "r"); + $MapContent = fread($Handle, filesize($FileName)); + fclose($Handle); + echo $MapContent; + + if ($Flush) { + unlink($FileName); + } + + exit(); + } else { + header("HTTP/1.0 404 Not Found"); + exit(); + } + } + + /* Save the image map to the disk */ + function SaveImageMap() + { + if (!$this->BuildMap) { + return (-1); + } + + if ($this->ImageMap == null) { + $this->Errors[] = "[Warning] SaveImageMap - Image map is empty."; + + return (-1); + } + + $Handle = fopen($this->tmpFolder . $this->MapID, 'w'); + if (!$Handle) { + $this->Errors[] = "[Warning] SaveImageMap - Cannot save the image map."; + + return (-1); + } else { + foreach ($this->ImageMap as $Key => $Value) { + fwrite($Handle, htmlentities($Value) . "\r"); + } + } + fclose($Handle); + } + + /* Convert seconds to a time format string */ + function ToTime($Value) + { + $Hour = floor($Value / 3600); + $Minute = floor(($Value - $Hour * 3600) / 60); + $Second = floor($Value - $Hour * 3600 - $Minute * 60); + + if (strlen($Hour) == 1) { + $Hour = "0" . $Hour; + } + if (strlen($Minute) == 1) { + $Minute = "0" . $Minute; + } + if (strlen($Second) == 1) { + $Second = "0" . $Second; + } + + return ($Hour . ":" . $Minute . ":" . $Second); + } + + /* Convert to metric system */ + function ToMetric($Value) + { + $Go = floor($Value / 1000000000); + $Mo = floor(($Value - $Go * 1000000000) / 1000000); + $Ko = floor(($Value - $Go * 1000000000 - $Mo * 1000000) / 1000); + $o = floor($Value - $Go * 1000000000 - $Mo * 1000000 - $Ko * 1000); + + if ($Go != 0) { + return ($Go . "." . $Mo . "g"); + } + if ($Mo != 0) { + return ($Mo . "." . $ko . "m"); + } + if ($Ko != 0) { + return ($Ko . "." . $o) . "k"; + } + + return ($o); + } + + /* Convert to curency */ + function ToCurrency($Value) + { + $Go = floor($Value / 1000000000); + $Mo = floor(($Value - $Go * 1000000000) / 1000000); + $Ko = floor(($Value - $Go * 1000000000 - $Mo * 1000000) / 1000); + $o = floor($Value - $Go * 1000000000 - $Mo * 1000000 - $Ko * 1000); + + if (strlen($o) == 1) { + $o = "00" . $o; + } + if (strlen($o) == 2) { + $o = "0" . $o; + } + + $ResultString = $o; + if ($Ko != 0) { + $ResultString = $Ko . "." . $ResultString; + } + if ($Mo != 0) { + $ResultString = $Mo . "." . $ResultString; + } + if ($Go != 0) { + $ResultString = $Go . "." . $ResultString; + } + + $ResultString = $this->Currency . $ResultString; + + return ($ResultString); + } + + /* Set date format for axis labels */ + function setDateFormat($Format) + { + $this->DateFormat = $Format; + } + + /* Convert TS to a date format string */ + function ToDate($Value) + { + return (date($this->DateFormat, $Value)); + } + + /* Check if a number is a full integer (for scaling) */ + function isRealInt($Value) + { + if ($Value == floor($Value)) { + return (true); + } + + return (false); + } +} + +function RaiseFatal($Message) +{ + echo "[FATAL] " . $Message . "\r\n"; + exit(); +} + +?> \ No newline at end of file diff --git a/vendor/wp-statistics/pchart/src/pChart/pData.php b/vendor/wp-statistics/pchart/src/pChart/pData.php new file mode 100644 index 0000000000..a41b853837 --- /dev/null +++ b/vendor/wp-statistics/pchart/src/pChart/pData.php @@ -0,0 +1,221 @@ +<?php +namespace pChart; + +/* pData class definition */ + +class pData +{ + public $Data; + public $DataDescription; + + public function __construct() + { + $this->Data = array(); + $this->DataDescription = array(); + $this->DataDescription["Position"] = "Name"; + $this->DataDescription["Format"]["X"] = "number"; + $this->DataDescription["Format"]["Y"] = "number"; + $this->DataDescription["Unit"]["X"] = null; + $this->DataDescription["Unit"]["Y"] = null; + } + + function ImportFromCSV($FileName, $Delimiter = ",", $DataColumns = -1, $HasHeader = false, $DataName = -1) + { + $handle = @fopen($FileName, "r"); + if ($handle) { + $HeaderParsed = false; + while (!feof($handle)) { + $buffer = fgets($handle, 4096); + $buffer = str_replace(chr(10), "", $buffer); + $buffer = str_replace(chr(13), "", $buffer); + $Values = explode($Delimiter, $buffer); + + if ($buffer != "") { + if ($HasHeader == true && $HeaderParsed == false) { + if ($DataColumns == -1) { + $ID = 1; + foreach ($Values as $key => $Value) { + $this->SetSerieName($Value, "Serie" . $ID); + $ID++; + } + } else { + $SerieName = ""; + + foreach ($DataColumns as $key => $Value) { + $this->SetSerieName($Values[$Value], "Serie" . $Value); + } + } + $HeaderParsed = true; + } else { + if ($DataColumns == -1) { + $ID = 1; + foreach ($Values as $key => $Value) { + $this->AddPoint(intval($Value), "Serie" . $ID); + $ID++; + } + } else { + $SerieName = ""; + if ($DataName != -1) { + $SerieName = $Values[$DataName]; + } + + foreach ($DataColumns as $key => $Value) { + $this->AddPoint($Values[$Value], "Serie" . $Value, $SerieName); + } + } + } + } + } + fclose($handle); + } + } + + function AddPoint($Value, $Serie = "Serie1", $Description = "") + { + if (is_array($Value) && count($Value) == 1) { + $Value = $Value[0]; + } + + $ID = 0; + if (is_array($this->Data)) { + for ($i = 0; $i <= count($this->Data); $i++) { + if (isset($this->Data[$i][$Serie])) { + $ID = $i + 1; + } + } + } + + if (count($Value) == 1) { + $this->Data[$ID][$Serie] = $Value; + if ($Description != "") { + $this->Data[$ID]["Name"] = $Description; + } elseif (!isset($this->Data[$ID]["Name"])) { + $this->Data[$ID]["Name"] = $ID; + } + } else { + foreach ($Value as $key => $Val) { + $this->Data[$ID][$Serie] = $Val; + if (!isset($this->Data[$ID]["Name"])) { + $this->Data[$ID]["Name"] = $ID; + } + $ID++; + } + } + } + + function AddSerie($SerieName = "Serie1") + { + if (!isset($this->DataDescription["Values"])) { + $this->DataDescription["Values"][] = $SerieName; + } else { + $Found = false; + foreach ($this->DataDescription["Values"] as $key => $Value) { + if ($Value == $SerieName) { + $Found = true; + } + } + + if (!$Found) { + $this->DataDescription["Values"][] = $SerieName; + } + } + } + + function AddAllSeries() + { + unset($this->DataDescription["Values"]); + + if (isset($this->Data[0])) { + foreach ($this->Data[0] as $Key => $Value) { + if ($Key != "Name") { + $this->DataDescription["Values"][] = $Key; + } + } + } + } + + function RemoveSerie($SerieName = "Serie1") + { + if (!isset($this->DataDescription["Values"])) { + return (0); + } + + $Found = false; + foreach ($this->DataDescription["Values"] as $key => $Value) { + if ($Value == $SerieName) { + unset($this->DataDescription["Values"][$key]); + } + } + } + + function SetAbsciseLabelSerie($SerieName = "Name") + { + $this->DataDescription["Position"] = $SerieName; + } + + function SetSerieName($Name, $SerieName = "Serie1") + { + $this->DataDescription["Description"][$SerieName] = $Name; + } + + function SetXAxisName($Name = "X Axis") + { + $this->DataDescription["Axis"]["X"] = $Name; + } + + function SetYAxisName($Name = "Y Axis") + { + $this->DataDescription["Axis"]["Y"] = $Name; + } + + function SetXAxisFormat($Format = "number") + { + $this->DataDescription["Format"]["X"] = $Format; + } + + function SetYAxisFormat($Format = "number") + { + $this->DataDescription["Format"]["Y"] = $Format; + } + + function SetXAxisUnit($Unit = "") + { + $this->DataDescription["Unit"]["X"] = $Unit; + } + + function SetYAxisUnit($Unit = "") + { + $this->DataDescription["Unit"]["Y"] = $Unit; + } + + function SetSerieSymbol($Name, $Symbol) + { + $this->DataDescription["Symbol"][$Name] = $Symbol; + } + + function removeSerieName($SerieName) + { + if (isset($this->DataDescription["Description"][$SerieName])) { + unset($this->DataDescription["Description"][$SerieName]); + } + } + + function removeAllSeries() + { + foreach ($this->DataDescription["Values"] as $Key => $Value) { + unset($this->DataDescription["Values"][$Key]); + } + } + + function GetData() + { + return ($this->Data); + } + + function GetDataDescription() + { + return ($this->DataDescription); + } +} + +?>